[SCM] libgroove/master: Imported Upstream version 4.2.0

andrewrk-guest at users.alioth.debian.org andrewrk-guest at users.alioth.debian.org
Sun Sep 28 23:19:04 UTC 2014


The following commit has been merged in the master branch:
commit 2b854c2d766aefa90a07706504bdf65016bdf8a2
Author: Andrew Kelley <superjoe30 at gmail.com>
Date:   Sun Sep 28 23:15:31 2014 +0000

    Imported Upstream version 4.2.0

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4da92fa..70ca61f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+### Version 4.2.0 (2014-09-25)
+
+ * build: remove bundled dependencies
+ * build: simpler cmake find modules, both code and license
+ * player: add shim to fix build failure on OSX
+
 ### Version 4.1.1 (2014-06-20)
 
  * playlist: fix race condition which can cause decoder to hang
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a8302e..fae4426 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,12 +1,11 @@
 cmake_minimum_required(VERSION 2.8)
 project(groove C)
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
-include(ExternalProject)
 
 set(LIBGROOVE_STATUS "yes")
 set(LIBGROOVE_VERSION_MAJOR 4)
-set(LIBGROOVE_VERSION_MINOR 1)
-set(LIBGROOVE_VERSION_PATCH 1)
+set(LIBGROOVE_VERSION_MINOR 2)
+set(LIBGROOVE_VERSION_PATCH 0)
 set(LIBGROOVE_VERSION "${LIBGROOVE_VERSION_MAJOR}.${LIBGROOVE_VERSION_MINOR}.${LIBGROOVE_VERSION_PATCH}")
 message("Configuring libgroove version ${LIBGROOVE_VERSION}")
 file(GLOB_RECURSE LIBGROOVE_SOURCES ${CMAKE_SOURCE_DIR}/groove/*.c)
@@ -17,8 +16,12 @@ if(DISABLE_PLAYER)
 else(DISABLE_PLAYER)
   set(LIBGROOVE_PLAYER_STATUS "yes")
   message("Configuring libgrooveplayer version ${LIBGROOVE_VERSION}")
-  file(GLOB_RECURSE LIBGROOVE_PLAYER_SOURCES ${CMAKE_SOURCE_DIR}/grooveplayer/*.c)
+  set(LIBGROOVE_PLAYER_SOURCES ${CMAKE_SOURCE_DIR}/grooveplayer/player.c)
   file(GLOB_RECURSE LIBGROOVE_PLAYER_HEADERS ${CMAKE_SOURCE_DIR}/grooveplayer/*.h)
+  if(APPLE)
+    set(LIBGROOVE_PLAYER_SOURCES ${LIBGROOVE_PLAYER_SOURCES}
+      ${CMAKE_SOURCE_DIR}/grooveplayer/osx_time_shim.c)
+  endif(APPLE)
 endif(DISABLE_PLAYER)
 
 if(DISABLE_LOUDNESS)
@@ -54,21 +57,12 @@ endif(C99_FLAG_DETECTED)
 # check for ebur128
 if(DISABLE_LOUDNESS)
   set(STATUS_EBUR128 "not needed")
-  set(STATUS_DEP_LIBEBUR128 "not needed")
 else(DISABLE_LOUDNESS)
   find_package(ebur128)
   if(EBUR128_FOUND)
     set(STATUS_EBUR128 "OK")
-    set(STATUS_DEP_LIBEBUR128 "using system library")
-    set(EBUR128_IS_BUNDLED FALSE)
   else(EBUR128_FOUND)
-    set(STATUS_EBUR128 "not found - will use bundled version")
-    set(STATUS_DEP_LIBEBUR128 "ready to build")
-    set(EBUR128_IS_BUNDLED TRUE)
-
-    set(EBUR128_SRC "${PROJECT_SOURCE_DIR}/deps/ebur128")
-    add_subdirectory(${EBUR128_SRC})
-    set(EBUR128_INCLUDE_DIR ${EBUR128_SRC})
+    set(STATUS_EBUR128 "not found")
   endif(EBUR128_FOUND)
 endif(DISABLE_LOUDNESS)
 
@@ -87,137 +81,36 @@ endif(DISABLE_FINGERPRINTER)
 # check for SDL2
 if(DISABLE_PLAYER)
   set(STATUS_SDL2 "not needed")
-  set(STATUS_DEP_SDL2 "not needed")
 else(DISABLE_PLAYER)
   find_package(SDL2)
   if(SDL2_FOUND)
     set(STATUS_SDL2 "OK")
-    set(STATUS_DEP_SDL2 "using system library")
-    set(SDL2_IS_BUNDLED FALSE)
   else(SDL2_FOUND)
-    set(STATUS_SDL2 "not found - will use bundled version")
-    set(STATUS_DEP_SDL2 "ready to build")
-    set(SDL2_IS_BUNDLED TRUE)
-
-    set(SDL_SHARED OFF CACHE BOOL "test")
-    set(SDL_VIDEO OFF CACHE BOOL "test")
-    set(SDL_RENDER OFF CACHE BOOL "test")
-    set(SDL_EVENTS OFF CACHE BOOL "test")
-    set(SDL_JOYSTICK OFF CACHE BOOL "test")
-    set(SDL_HAPTIC OFF CACHE BOOL "test")
-    set(SDL_POWER OFF CACHE BOOL "test")
-    set(SDL_TIMERS OFF CACHE BOOL "test")
-    set(SDL_LOADSO OFF CACHE BOOL "test")
-    set(SDL_CPUINFO OFF CACHE BOOL "test")
-    set(SDL_FILESYSTEM OFF CACHE BOOL "test")
-
-    set(EXTRA_CFLAGS "-fPIC" CACHE STRING "test")
-
-    set(SDL2_SRC "${PROJECT_SOURCE_DIR}/deps/SDL2")
-    add_subdirectory(${SDL2_SRC})
-    set(SDL2_INCLUDE_DIR ${SDL2_SRC})
+    set(STATUS_SDL2 "not found")
   endif(SDL2_FOUND)
 endif(DISABLE_PLAYER)
 
 # check for libav
-find_package(LibAV 10.0)
-if(LIBAV_AVCODEC_FOUND AND LIBAV_AVFILTER_FOUND AND LIBAV_AVFORMAT_FOUND AND LIBAV_AVUTIL_FOUND)
-  set(LIBAV_IS_BUNDLED FALSE)
-  set(STATUS_DEP_LIBAV "using system libraries")
-  set(STATUS_BZIP2 "not needed")
-  set(STATUS_YASM "not needed")
-  set(STATUS_MP3LAME "not needed")
-  set(STATUS_ZLIB "not needed")
+find_package(LibAV)
+if(AVCODEC_FOUND)
   set(STATUS_LIBAVCODEC "OK")
+else()
+  set(STATUS_LIBAVCODEC "not found")
+endif()
+if(AVFILTER_FOUND)
   set(STATUS_LIBAVFILTER "OK")
+else()
+  set(STATUS_LIBAVFILTER "not found")
+endif()
+if(AVFORMAT_FOUND)
   set(STATUS_LIBAVFORMAT "OK")
+else()
+  set(STATUS_LIBAVFORMAT "not found")
+endif()
+if(AVUTIL_FOUND)
   set(STATUS_LIBAVUTIL "OK")
 else()
-  set(LIBAV_IS_BUNDLED TRUE)
-  set(STATUS_DEP_LIBAV "ready to build")
-
-  if(LIBAV_AVCODEC_FOUND)
-    set(STATUS_LIBAVCODEC "OK")
-  else()
-    set(STATUS_LIBAVCODEC "not found - will use bundled version")
-  endif()
-  if(LIBAV_AVFILTER_FOUND)
-    set(STATUS_LIBAVFILTER "OK")
-  else()
-    set(STATUS_LIBAVFILTER "not found - will use bundled version")
-  endif()
-  if(LIBAV_AVFORMAT_FOUND)
-    set(STATUS_LIBAVFORMAT "OK")
-  else()
-    set(STATUS_LIBAVFORMAT "not found - will use bundled version")
-  endif()
-  if(LIBAV_AVUTIL_FOUND)
-    set(STATUS_LIBAVUTIL "OK")
-  else()
-    set(STATUS_LIBAVUTIL "not found - will use bundled version")
-  endif()
-
-  # check for bz2
-  find_package(BZip2)
-  if(BZIP2_FOUND)
-    set(STATUS_BZIP2 "OK")
-  else(BZIP2_FOUND)
-    set(STATUS_BZIP2 "not found")
-    set(STATUS_DEP_LIBAV "missing dependencies, see below")
-    set(LIBGROOVE_STATUS "missing dependencies")
-    set(LIBGROOVE_PLAYER_STATUS "missing dependencies")
-    set(LIBGROOVE_LOUDNESS_STATUS "missing dependencies")
-  endif(BZIP2_FOUND)
-
-  # check for yasm
-  find_package(Yasm)
-  if(${YASM_EXECUTABLE} STREQUAL "YASM_EXECUTABLE-NOTFOUND")
-    set(STATUS_YASM "not found")
-    set(STATUS_DEP_LIBAV "missing dependencies, see below")
-    set(LIBGROOVE_STATUS "missing dependencies")
-    set(LIBGROOVE_PLAYER_STATUS "missing dependencies")
-    set(LIBGROOVE_LOUDNESS_STATUS "missing dependencies")
-  else()
-    set(STATUS_YASM "OK")
-  endif()
-  
-  # check for libmp3lame
-  find_package(mp3lame)
-  if(MP3LAME_FOUND)
-    set(STATUS_MP3LAME "OK")
-  else(MP3LAME_FOUND)
-    set(STATUS_DEP_LIBAV "missing dependencies, see below")
-    set(STATUS_MP3LAME "not found")
-  endif(MP3LAME_FOUND)
-
-  # check for zlib
-  find_package(ZLIB)
-  if(ZLIB_FOUND)
-    set(STATUS_ZLIB "OK")
-  else(ZLIB_FOUND)
-    set(STATUS_ZLIB "not found")
-    set(STATUS_DEP_LIBAV "missing dependencies, see below")
-    set(LIBGROOVE_STATUS "missing dependencies")
-    set(LIBGROOVE_PLAYER_STATUS "missing dependencies")
-    set(LIBGROOVE_LOUDNESS_STATUS "missing dependencies")
-  endif(ZLIB_FOUND)
-
-  set(LIBAV_SRC "${PROJECT_SOURCE_DIR}/deps/libav")
-  set(LIBAV_BUILD "${PROJECT_BINARY_DIR}/deps/libav")
-  set(LIBAV_INSTALL "${LIBAV_BUILD}/install")
-
-  if(APPLE)
-  else(APPLE)
-    set(LIBGROOVE_LDFLAGS "-Wl,-Bsymbolic")
-  endif(APPLE)
-
-  ExternalProject_Add(libav
-    SOURCE_DIR ${LIBAV_SRC}
-    BINARY_DIR ${LIBAV_BUILD}
-    INSTALL_DIR ${LIBAV_INSTALL}
-    CONFIGURE_COMMAND ${LIBAV_SRC}/configure --prefix=${LIBAV_INSTALL} --enable-pic --enable-gpl --enable-libmp3lame
-    )
-
+  set(STATUS_LIBAVUTIL "not found")
 endif()
 
 # check for pthreads
@@ -251,36 +144,15 @@ if(LIBGROOVE_LDFLAGS)
 endif()
 include_directories(${PROJECT_SOURCE_DIR})
 include_directories(${PROJECT_BINARY_DIR})
-if(LIBAV_IS_BUNDLED)
-  target_link_libraries(groove
-    ${CMAKE_DL_LIBS}
-    ${LIBAV_INSTALL}/lib/libavfilter.a
-    ${LIBAV_INSTALL}/lib/libavformat.a
-    ${LIBAV_INSTALL}/lib/libavcodec.a
-    ${LIBAV_INSTALL}/lib/libavresample.a
-    ${LIBAV_INSTALL}/lib/libswscale.a
-    ${LIBAV_INSTALL}/lib/libavutil.a
-    ${BZIP2_LIBRARIES}
-    ${ZLIB_LIBRARIES})
-  if(UNIX)
-    target_link_libraries(groove m)
-  endif(UNIX)
-  if(MP3LAME_FOUND)
-    target_link_libraries(groove ${MP3LAME_LIBRARY})
-  endif()
-  include_directories(${LIBAV_INSTALL}/include)
-  add_dependencies(groove libav)
-else()
-  target_link_libraries(groove LINK_PRIVATE
-    ${LIBAV_AVCODEC_LIBRARIES}
-    ${LIBAV_AVFILTER_LIBRARIES}
-    ${LIBAV_AVFORMAT_LIBRARIES})
-  target_link_libraries(groove LINK_PUBLIC ${LIBAV_AVUTIL_LIBRARIES})
-  if(UNIX)
-    target_link_libraries(groove LINK_PRIVATE m)
-  endif(UNIX)
-  include_directories(${LIBAV_INCLUDE_DIRS})
-endif()
+target_link_libraries(groove LINK_PRIVATE
+  ${AVCODEC_LIBRARIES}
+  ${AVFILTER_LIBRARIES}
+  ${AVFORMAT_LIBRARIES})
+target_link_libraries(groove LINK_PUBLIC ${AVUTIL_LIBRARIES})
+if(UNIX)
+  target_link_libraries(groove LINK_PRIVATE m)
+endif(UNIX)
+include_directories(${LIBAV_INCLUDE_DIRS})
 target_link_libraries(groove LINK_PUBLIC ${CMAKE_THREAD_LIBS_INIT})
 
 
@@ -288,9 +160,6 @@ add_library(groove_static STATIC ${LIBGROOVE_SOURCES} ${LIBGROOVE_HEADERS})
 set_target_properties(groove_static PROPERTIES
   OUTPUT_NAME groove
   COMPILE_FLAGS "${LIB_CFLAGS} -fPIC")
-if(LIBAV_IS_BUNDLED)
-  add_dependencies(groove_static libav)
-endif()
 install(TARGETS groove_static DESTINATION lib)
 
 
@@ -328,16 +197,11 @@ else()
     COMPILE_FLAGS ${LIB_CFLAGS}
     )
   target_link_libraries(grooveplayer LINK_PUBLIC groove)
-  if(UNIX)
+  if(UNIX AND NOT APPLE)
     target_link_libraries(grooveplayer LINK_PRIVATE rt)
-  endif(UNIX)
-  add_dependencies(grooveplayer groove)
-  if(SDL2_IS_BUNDLED)
-    target_link_libraries(grooveplayer SDL2-static)
-    add_dependencies(grooveplayer SDL2-static)
-  else()
-    target_link_libraries(grooveplayer LINK_PRIVATE ${SDL2_LIBRARY})
   endif()
+  add_dependencies(grooveplayer groove)
+  target_link_libraries(grooveplayer LINK_PRIVATE ${SDL2_LIBRARY})
   include_directories(${SDL2_INCLUDE_DIR})
 
   install(FILES "grooveplayer/player.h" DESTINATION "include/grooveplayer")
@@ -349,9 +213,6 @@ else()
   set_target_properties(grooveplayer_static PROPERTIES
     OUTPUT_NAME grooveplayer
     COMPILE_FLAGS "${LIB_CFLAGS} -fPIC")
-  if(SDL2_IS_BUNDLED)
-    add_dependencies(grooveplayer_static SDL2-static)
-  endif()
   install(TARGETS grooveplayer_static DESTINATION lib)
 
 
@@ -375,15 +236,7 @@ else()
     )
   target_link_libraries(grooveloudness LINK_PUBLIC groove ${CMAKE_THREAD_LIBS_INIT})
   add_dependencies(grooveloudness groove)
-  if(EBUR128_IS_BUNDLED)
-    target_link_libraries(grooveloudness ebur128_static)
-    add_dependencies(grooveloudness ebur128_static)
-    if(SPEEXDSP_FOUND)
-      target_link_libraries(grooveloudness ${SPEEXDSP_LIBRARIES})
-    endif(SPEEXDSP_FOUND)
-  else()
-    target_link_libraries(grooveloudness LINK_PRIVATE ${EBUR128_LIBRARY})
-  endif()
+  target_link_libraries(grooveloudness LINK_PRIVATE ${EBUR128_LIBRARY})
   include_directories(${EBUR128_INCLUDE_DIR})
 
   install(FILES "grooveloudness/loudness.h" DESTINATION "include/grooveloudness")
@@ -396,9 +249,6 @@ else()
   set_target_properties(grooveloudness_static PROPERTIES
     OUTPUT_NAME grooveloudness
     COMPILE_FLAGS "${LIB_CFLAGS} -fPIC")
-  if(EBUR128_IS_BUNDLED)
-    add_dependencies(grooveloudness_static ebur128_static)
-  endif()
   install(TARGETS grooveloudness_static DESTINATION lib)
 
 
@@ -422,7 +272,7 @@ else()
     )
   target_link_libraries(groovefingerprinter LINK_PUBLIC groove ${CMAKE_THREAD_LIBS_INIT})
   add_dependencies(groovefingerprinter groove)
-  target_link_libraries(groovefingerprinter LINK_PRIVATE ${CHROMAPRINT_LIBRARIES})
+  target_link_libraries(groovefingerprinter LINK_PRIVATE ${CHROMAPRINT_LIBRARY})
   include_directories(${CHROMAPRINT_INCLUDE_DIR})
 
   install(FILES "groovefingerprinter/fingerprinter.h" DESTINATION "include/groovefingerprinter")
@@ -457,14 +307,6 @@ message("\n"
 )
 
 message(
-"Bundled Dependencies\n"
-"--------------------\n"
-"* SDL2                         : ${STATUS_DEP_SDL2}\n"
-"* libav                        : ${STATUS_DEP_LIBAV}\n"
-"* libebur128                   : ${STATUS_DEP_LIBEBUR128}\n"
-)
-
-message(
 "System Dependencies\n"
 "-------------------\n"
 "* C99 Compiler                 : ${STATUS_C99}\n"
@@ -478,15 +320,6 @@ message(
 "* libavutil                    : ${STATUS_LIBAVUTIL}"
 )
 
-if(LIBAV_IS_BUNDLED)
-message(
-"* yasm                         : ${STATUS_YASM}\n"
-"* bzip2                        : ${STATUS_BZIP2}\n"
-"* mp3lame                      : ${STATUS_MP3LAME}\n"
-"* zlib                         : ${STATUS_ZLIB}"
-)
-endif()
-
 message("\n"
 "If everything is looks good, proceed with\n"
 "make\n"
diff --git a/COPYING b/LICENSE
similarity index 94%
rename from COPYING
rename to LICENSE
index f5992df..b47b023 100644
--- a/COPYING
+++ b/LICENSE
@@ -1,6 +1,6 @@
-The MIT License (MIT)
+The MIT License (Expat)
 
-Copyright (c) 2013 Andrew Kelley
+Copyright (c) 2014 Andrew Kelley
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 78d934b..1ff2098 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,8 @@
 
 This library provides decoding and encoding of audio on a playlist.
 It is intended to be used as a backend for music player applications, however
-it is generic enough to be used as a backend for any audio processing utility.
+it is generic enough to be used as a backend for any streaming audio processing
+utility.
 
 ## Features
 
@@ -36,30 +37,43 @@ it is generic enough to be used as a backend for any audio processing utility.
 
 ## Dependencies
 
-You will need these to compile libgroove. Some dependencies are bundled
-so that you can still compile if they cannot be found on your system.
+You will need these to compile libgroove.
 
  * [cmake](http://www.cmake.org/)
- * [libav](http://libav.org). (bundled) if using bundled version, needs these:
-   - [libbz2-dev](http://www.bzip.org/)
-   - [yasm](http://yasm.tortall.net/)
-   - [libmp3lame-dev](http://lame.sourceforge.net/)
- * [libebur128](https://github.com/jiixyj/libebur128) (bundled) if using
-   bundled version, needs libspeexdsp-dev
- * [libsdl2-dev](http://www.libsdl.org/) (bundled)
+ * [libav](http://libav.org)
+   - suggested flags: `--enable-shared --disable-static --enable-libmp3lame --enable-libvorbis --enable-gpl`
+ * [libebur128](https://github.com/jiixyj/libebur128)
+   - make sure it is compiled with the speex dependency so that true peak
+     functions are available.
+ * [libsdl2-dev](http://www.libsdl.org/)
  * [libchromaprint-dev](http://acoustid.org/chromaprint)
 
 ## Installation
 
 ### Pre-Built Packages
 
- * [Ubuntu PPA](https://launchpad.net/~andrewrk/+archive/libgroove)
+#### [Ubuntu PPA](https://launchpad.net/~andrewrk/+archive/libgroove)
 
-   ```
-   sudo apt-add-repository ppa:andrewrk/libgroove
-   sudo apt-get update
-   sudo apt-get install libgroove-dev libgrooveplayer-dev libgrooveloudness-dev libgroovefingerprinter-dev
-   ```
+```
+sudo apt-add-repository ppa:andrewrk/libgroove
+sudo apt-get update
+sudo apt-get install libgroove-dev libgrooveplayer-dev libgrooveloudness-dev libgroovefingerprinter-dev
+```
+
+#### [FreeBSD Port](http://www.freshports.org/audio/libgroove/)
+
+```
+pkg install audio/libgroove
+```
+
+#### [Debian](http://packages.qa.debian.org/libg/libgroove.html)
+
+[Configure your system](http://serverfault.com/questions/22414/) to be able
+to install packages from testing.
+
+```
+sudo apt-get -t testing install libgroove-dev libgrooveplayer-dev libgrooveloudness-dev libgroovefingerprinter-dev
+```
 
 ### From Source
 
@@ -68,6 +82,40 @@ so that you can still compile if they cannot be found on your system.
  3. `make`
  4. `sudo make install`
 
+#### Mac OS X
+
+Install dependencies from [Homebrew](http://brew.sh/)
+
+```
+brew install chromaprint
+brew install libav --with-libvorbis --with-speex
+brew install sdl2
+```
+
+Install [libebur128](https://github.com/jiixyj/libebur128) from source
+
+```
+git clone https://github.com/jiixyj/libebur128
+cd libebur128
+mkdir build
+cd build
+cmake ..
+make
+make install
+```
+
+Install libgroove from source
+
+```
+git clone https://github.com/andrewrk/libgroove
+cd libgroove
+mkdir build
+cd build
+cmake ..
+make
+make install
+```
+
 ## Documentation
 
  * Check out the example programs in the example folder.
@@ -101,3 +149,5 @@ Feel free to make a pull request adding yours to this list.
    - [Groove Basin](https://github.com/andrewrk/groovebasin) - lazy
      multi-core replaygain scanning, web interface inspired by Amarok 1.4,
      http streaming, upload, download, dynamic playlist mode
+ * [ruby-groove](https://github.com/johnmuhl/ruby-groove) - Ruby FFI bindings
+   to libgroove.
diff --git a/cmake/FindChromaprint.cmake b/cmake/FindChromaprint.cmake
index 5b093de..ac654de 100644
--- a/cmake/FindChromaprint.cmake
+++ b/cmake/FindChromaprint.cmake
@@ -1,22 +1,22 @@
-# copied from https://bitbucket.org/acoustid/acoustid-fingerprinter
-# GPLv2 license
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PKG_LIBCHROMAPRINT libchromaprint)
+# Copyright (c) 2014 Andrew Kelley
+# This file is MIT licensed.
+# See http://opensource.org/licenses/MIT
 
-FIND_PATH(CHROMAPRINT_INCLUDE_DIR chromaprint.h
-    ${PKG_LIBCHROMAPRINT_INCLUDE_DIRS}
-    /usr/include
-    /usr/local/include
-)
+# CHROMAPRINT_FOUND
+# CHROMAPRINT_INCLUDE_DIR
+# CHROMAPRINT_LIBRARY
 
-FIND_LIBRARY(CHROMAPRINT_LIBRARIES
-    NAMES
-    chromaprint chromaprint.dll
-    PATHS
-    ${PKG_LIBCHROMAPRINT_LIBRARY_DIRS}
-    /usr/lib
-    /usr/local/lib
-)
+find_path(CHROMAPRINT_INCLUDE_DIR NAMES chromaprint.h)
 
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Chromaprint DEFAULT_MSG CHROMAPRINT_LIBRARIES CHROMAPRINT_INCLUDE_DIR)
+find_library(CHROMAPRINT_LIBRARY NAMES chromaprint)
+
+if(CHROMAPRINT_LIBRARY AND CHROMAPRINT_INCLUDE_DIR)
+  set(CHROMAPRINT_FOUND TRUE)
+else()
+  set(CHROMAPRINT_FOUND FALSE)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CHROMAPRINT DEFAULT_MSG CHROMAPRINT_LIBRARY CHROMAPRINT_INCLUDE_DIR)
+
+mark_as_advanced(CHROMAPRINT_INCLUDE_DIR CHROMAPRINT_LIBRARY)
diff --git a/cmake/FindLibAV.cmake b/cmake/FindLibAV.cmake
index 26c0608..98c5c35 100644
--- a/cmake/FindLibAV.cmake
+++ b/cmake/FindLibAV.cmake
@@ -1,220 +1,84 @@
-# Module for locating libav.
-#
-# Customizable variables:
-#   LIBAV_ROOT_DIR
-#     Specifies libav's root directory.
-#
-# Read-only variables:
-#   LIBAV_FOUND
-#     Indicates whether the library has been found.
-#
-#   LIBAV_INCLUDE_DIRS
-#      Specifies libav's include directory.
-#
-#   LIBAV_LIBRARIES
-#     Specifies libav libraries that should be passed to target_link_libararies.
-#
-#   LIBAV_<COMPONENT>_LIBRARIES
-#     Specifies the libraries of a specific <COMPONENT>.
-#
-#   LIBAV_<COMPONENT>_FOUND
-#     Indicates whether the specified <COMPONENT> was found.
-#
-#
-# Copyright (c) 2013 Sergiu Dotenco
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTLIBAVLAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-INCLUDE (FindPackageHandleStandardArgs)
-
-IF (CMAKE_VERSION VERSION_GREATER 2.8.7)
-  SET (_LIBAV_CHECK_COMPONENTS FALSE)
-ELSE (CMAKE_VERSION VERSION_GREATER 2.8.7)
-  SET (_LIBAV_CHECK_COMPONENTS TRUE)
-ENDIF (CMAKE_VERSION VERSION_GREATER 2.8.7)
-
-FIND_PATH (LIBAV_ROOT_DIR
-  NAMES include/libavcodec/avcodec.h
-        include/libavdevice/avdevice.h
-        include/libavfilter/avfilter.h
-        include/libavutil/avutil.h
-        include/libswscale/swscale.h
-  PATHS ENV LIBAVROOT
-  DOC "libav root directory")
-
-FIND_PATH (LIBAV_INCLUDE_DIR
-  NAMES libavcodec/avcodec.h
-        libavdevice/avdevice.h
-        libavfilter/avfilter.h
-        libavutil/avutil.h
-        libswscale/swscale.h
-  HINTS ${LIBAV_ROOT_DIR}
-  PATH_SUFFIXES include
-  DOC "libav include directory")
-
-if (NOT LibAV_FIND_COMPONENTS)
-  set (LibAV_FIND_COMPONENTS avcodec avdevice avfilter avformat avutil swscale)
-endif (NOT LibAV_FIND_COMPONENTS)
-
-FOREACH (_LIBAV_COMPONENT ${LibAV_FIND_COMPONENTS})
-  STRING (TOUPPER ${_LIBAV_COMPONENT} _LIBAV_COMPONENT_UPPER)
-  SET (_LIBAV_LIBRARY_BASE LIBAV_${_LIBAV_COMPONENT_UPPER}_LIBRARY)
-
-  FIND_LIBRARY (${_LIBAV_LIBRARY_BASE}
-    NAMES ${_LIBAV_COMPONENT}
-    HINTS ${LIBAV_ROOT_DIR}
-    PATH_SUFFIXES bin lib
-    DOC "libav ${_LIBAV_COMPONENT} library")
-
-  MARK_AS_ADVANCED (${_LIBAV_LIBRARY_BASE})
-
-  SET (LIBAV_${_LIBAV_COMPONENT_UPPER}_FOUND TRUE)
-
-  IF (${_LIBAV_LIBRARY_BASE})
-    # setup the LIBAV_<COMPONENT>_LIBRARIES variable
-    SET (LIBAV_${_LIBAV_COMPONENT_UPPER}_LIBRARIES ${${_LIBAV_LIBRARY_BASE}})
-    LIST (APPEND LIBAV_LIBRARIES ${LIBAV_${_LIBAV_COMPONENT_UPPER}_LIBRARIES})
-    LIST (APPEND _LIBAV_ALL_LIBS ${${_LIBAV_LIBRARY_BASE}})
-  ELSE (${_LIBAV_LIBRARY_BASE})
-    SET (LIBAV_${_LIBAV_COMPONENT_UPPER}_FOUND FALSE)
-
-    IF (_LIBAV_CHECK_COMPONENTS)
-      LIST (APPEND _LIBAV_MISSING_LIBRARIES ${_LIBAV_LIBRARY_BASE})
-    ENDIF (_LIBAV_CHECK_COMPONENTS)
-  ENDIF (${_LIBAV_LIBRARY_BASE})
-
-  SET (LibAV_${_LIBAV_COMPONENT}_FOUND ${LIBAV_${_LIBAV_COMPONENT_UPPER}_FOUND})
-ENDFOREACH (_LIBAV_COMPONENT ${LibAV_FIND_COMPONENTS})
-
-SET (LIBAV_INCLUDE_DIRS ${LIBAV_INCLUDE_DIR})
-
-IF (DEFINED _LIBAV_MISSING_COMPONENTS AND _LIBAV_CHECK_COMPONENTS)
-  IF (NOT LibAV_FIND_QUIETLY)
-    MESSAGE (STATUS "One or more libav components were not found:")
-    # Display missing components indented, each on a separate line
-    FOREACH (_LIBAV_MISSING_COMPONENT ${_LIBAV_MISSING_COMPONENTS})
-      MESSAGE (STATUS "  " ${_LIBAV_MISSING_COMPONENT})
-    ENDFOREACH (_LIBAV_MISSING_COMPONENT ${_LIBAV_MISSING_COMPONENTS})
-  ENDIF (NOT LibAV_FIND_QUIETLY)
-ENDIF (DEFINED _LIBAV_MISSING_COMPONENTS AND _LIBAV_CHECK_COMPONENTS)
-
-# Determine library's version
-
-FIND_PROGRAM (LIBAV_AVCONV_EXECUTABLE NAMES avconv
-  HINTS ${LIBAV_ROOT_DIR}
-  PATH_SUFFIXES bin
-  DOC "avconv executable")
-
-IF (LIBAV_AVCONV_EXECUTABLE)
-  EXECUTE_PROCESS (COMMAND ${LIBAV_AVCONV_EXECUTABLE} -version
-    OUTPUT_VARIABLE _LIBAV_AVCONV_OUTPUT ERROR_QUIET)
-
-  STRING (REGEX REPLACE
-    ".*avconv(\\s+version)?[ \t]+([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*" "\\2"
-    LIBAV_VERSION "${_LIBAV_AVCONV_OUTPUT}")
-  STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\1"
-    LIBAV_VERSION_MAJOR "${LIBAV_VERSION}")
-  STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\2"
-    LIBAV_VERSION_MINOR "${LIBAV_VERSION}")
-
-  IF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
-    STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\3"
-      LIBAV_VERSION_PATCH "${LIBAV_VERSION}")
-    SET (LIBAV_VERSION_COMPONENTS 3)
-  ELSEIF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
-    SET (LIBAV_VERSION_COMPONENTS 2)
-  ELSEIF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)$")
-    # mostly developer/alpha/beta versions
-    SET (LIBAV_VERSION_COMPONENTS 2)
-    SET (LIBAV_VERSION_MINOR 0)
-    SET (LIBAV_VERSION "${LIBAV_VERSION}.0")
-  ENDIF ("${LIBAV_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
-ENDIF (LIBAV_AVCONV_EXECUTABLE)
-
-IF (WIN32)
-  FIND_PROGRAM (LIB_EXECUTABLE NAMES lib
-    HINTS "$ENV{VS110COMNTOOLS}/../../VC/bin"
-          "$ENV{VS100COMNTOOLS}/../../VC/bin"
-          "$ENV{VS90COMNTOOLS}/../../VC/bin"
-          "$ENV{VS71COMNTOOLS}/../../VC/bin"
-          "$ENV{VS80COMNTOOLS}/../../VC/bin"
-    DOC "Library manager")
-
-  MARK_AS_ADVANCED (LIB_EXECUTABLE)
-ENDIF (WIN32)
-
-MACRO (GET_LIB_REQUISITES LIB REQUISITES)
-  IF (LIB_EXECUTABLE)
-    GET_FILENAME_COMPONENT (_LIB_PATH ${LIB_EXECUTABLE} PATH)
-
-    IF (MSVC)
-      # Do not redirect the output
-      UNSET (ENV{VS_UNICODE_OUTPUT})
-    ENDIF (MSVC)
-
-    EXECUTE_PROCESS (COMMAND ${LIB_EXECUTABLE} /nologo /list ${LIB}
-      WORKING_DIRECTORY ${_LIB_PATH}/../../Common7/IDE
-      OUTPUT_VARIABLE _LIB_OUTPUT ERROR_QUIET)
-
-    STRING (REPLACE "\n" ";" "${REQUISITES}" "${_LIB_OUTPUT}")
-    LIST (REMOVE_DUPLICATES ${REQUISITES})
-  ENDIF (LIB_EXECUTABLE)
-ENDMACRO (GET_LIB_REQUISITES)
-
-IF (_LIBAV_ALL_LIBS)
-  # collect lib requisites using the lib tool
-  FOREACH (_LIBAV_COMPONENT ${_LIBAV_ALL_LIBS})
-    GET_LIB_REQUISITES (${_LIBAV_COMPONENT} _LIBAV_REQUISITES)
-  ENDFOREACH (_LIBAV_COMPONENT)
-ENDIF (_LIBAV_ALL_LIBS)
-
-IF (NOT LIBAV_BINARY_DIR)
-  SET (_LIBAV_UPDATE_BINARY_DIR TRUE)
-ELSE (NOT LIBAV_BINARY_DIR)
-  SET (_LIBAV_UPDATE_BINARY_DIR FALSE)
-ENDIF (NOT LIBAV_BINARY_DIR)
-
-SET (_LIBAV_BINARY_DIR_HINTS bin)
-
-IF (_LIBAV_REQUISITES)
-  FIND_FILE (LIBAV_BINARY_DIR NAMES ${_LIBAV_REQUISITES}
-	  HINTS ${LIBAV_ROOT_DIR}
-    PATH_SUFFIXES ${_LIBAV_BINARY_DIR_HINTS} NO_DEFAULT_PATH)
-ENDIF (_LIBAV_REQUISITES)
-
-IF (LIBAV_BINARY_DIR AND _LIBAV_UPDATE_BINARY_DIR)
-  SET (_LIBAV_BINARY_DIR ${LIBAV_BINARY_DIR})
-  UNSET (LIBAV_BINARY_DIR CACHE)
-
-  IF (_LIBAV_BINARY_DIR)
-	GET_FILENAME_COMPONENT (LIBAV_BINARY_DIR ${_LIBAV_BINARY_DIR} PATH)
-  ENDIF (_LIBAV_BINARY_DIR)
-ENDIF (LIBAV_BINARY_DIR AND _LIBAV_UPDATE_BINARY_DIR)
-
-SET (LIBAV_BINARY_DIR ${LIBAV_BINARY_DIR} CACHE PATH "libav binary directory")
-
-MARK_AS_ADVANCED (LIBAV_INCLUDE_DIR LIBAV_BINARY_DIR)
-
-IF (NOT _LIBAV_CHECK_COMPONENTS)
- SET (_LIBAV_FPHSA_ADDITIONAL_ARGS HANDLE_COMPONENTS)
-ENDIF (NOT _LIBAV_CHECK_COMPONENTS)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS (LibAV REQUIRED_VARS LIBAV_ROOT_DIR
-  LIBAV_INCLUDE_DIR ${_LIBAV_MISSING_LIBRARIES} VERSION_VAR LIBAV_VERSION
-  ${_LIBAV_FPHSA_ADDITIONAL_ARGS})
+# Copyright (c) 2014 Andrew Kelley
+# This file is MIT licensed.
+# See http://opensource.org/licenses/MIT
+
+# LIBAV_FOUND
+# LIBAV_INCLUDE_DIRS
+# LIBAV_LIBRARIES
+
+# AVFILTER_FOUND
+# AVFILTER_INCLUDE_DIRS
+# AVFILTER_LIBRARIES
+
+# AVFORMAT_FOUND
+# AVFORMAT_INCLUDE_DIRS
+# AVFORMAT_LIBRARIES
+
+# AVCODEC_FOUND
+# AVCODEC_INCLUDE_DIRS
+# AVCODEC_LIBRARIES
+
+# AVUTIL_FOUND
+# AVUTIL_INCLUDE_DIRS
+# AVUTIL_LIBRARIES
+
+find_path(AVFILTER_INCLUDE_DIRS NAMES libavfilter/avfilter.h)
+find_library(AVFILTER_LIBRARIES NAMES avfilter)
+if(AVFILTER_LIBRARIES AND AVFILTER_INCLUDE_DIRS)
+  set(AVFILTER_FOUND TRUE)
+else()
+  set(AVFILTER_FOUND FALSE)
+endif()
+
+find_path(AVFORMAT_INCLUDE_DIRS NAMES libavformat/avformat.h)
+find_library(AVFORMAT_LIBRARIES NAMES avformat)
+if(AVFORMAT_LIBRARIES AND AVFORMAT_INCLUDE_DIRS)
+  set(AVFORMAT_FOUND TRUE)
+else()
+  set(AVFORMAT_FOUND FALSE)
+endif()
+
+find_path(AVCODEC_INCLUDE_DIRS NAMES libavcodec/avcodec.h)
+find_library(AVCODEC_LIBRARIES NAMES avcodec)
+if(AVCODEC_LIBRARIES AND AVCODEC_INCLUDE_DIRS)
+  set(AVCODEC_FOUND TRUE)
+else()
+  set(AVCODEC_FOUND FALSE)
+endif()
+
+find_path(AVUTIL_INCLUDE_DIRS NAMES libavutil/avutil.h)
+find_library(AVUTIL_LIBRARIES NAMES avutil)
+if(AVUTIL_LIBRARIES AND AVUTIL_INCLUDE_DIRS)
+  set(AVUTIL_FOUND TRUE)
+else()
+  set(AVUTIL_FOUND FALSE)
+endif()
+
+if(AVFILTER_FOUND AND AVFORMAT_FOUND AND AVCODEC_FOUND AND AVUTIL_FOUND)
+  set(LIBAV_FOUND TRUE)
+  set(LIBAV_INCLUDE_DIRS
+    ${AVFILTER_INCLUDE_DIRS}
+    ${AVFORMAT_INCLUDE_DIRS}
+    ${AVCODEC_INCLUDE_DIRS}
+    ${AVUTIL_INCLUDE_DIRS})
+  set(LIBAV_LIBRARIES
+    ${AVFILTER_LIBRARIES}
+    ${AVFORMAT_LIBRARIES}
+    ${AVCODEC_LIBRARIES}
+    ${AVUTIL_LIBRARIES})
+else()
+  set(LIBAV_FOUND FALSE)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LIBAV DEFAULT_MSG
+  AVFILTER_LIBRARIES AVFILTER_INCLUDE_DIRS
+  AVFORMAT_LIBRARIES AVFORMAT_INCLUDE_DIRS
+  AVCODEC_LIBRARIES AVCODEC_INCLUDE_DIRS
+  AVUTIL_LIBRARIES AVUTIL_INCLUDE_DIRS)
+
+mark_as_advanced(
+  AVFILTER_INCLUDE_DIRS AVFILTER_LIBRARIES
+  AVFORMAT_INCLUDE_DIRS AVFORMAT_LIBRARIES
+  AVCODEC_INCLUDE_DIRS AVCODEC_LIBRARIES
+  AVUTIL_INCLUDE_DIRS AVUTIL_LIBRARIES)
diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake
index 236d6b4..f20c862 100644
--- a/cmake/FindSDL2.cmake
+++ b/cmake/FindSDL2.cmake
@@ -1,163 +1,22 @@
-# Locate SDL2 library
-# This module defines
-# SDL2_LIBRARY, the name of the library to link against
-# SDL2_FOUND, if false, do not try to link to SDL2
-# SDL2_INCLUDE_DIR, where to find SDL.h
-#
-# This module responds to the the flag:
-# SDL2_BUILDING_LIBRARY
-# If this is defined, then no SDL2main will be linked in because
-# only applications need main().
-# Otherwise, it is assumed you are building an application and this
-# module will attempt to locate and set the the proper link flags
-# as part of the returned SDL2_LIBRARY variable.
-#
-# Don't forget to include SDLmain.h and SDLmain.m your project for the
-# OS X framework based version. (Other versions link to -lSDL2main which
-# this module will try to find on your behalf.) Also for OS X, this
-# module will automatically add the -framework Cocoa on your behalf.
-#
-#
-# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
-# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
-# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
-# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
-# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
-# as appropriate. These values are used to generate the final SDL2_LIBRARY
-# variable, but when these values are unset, SDL2_LIBRARY does not get created.
-#
-#
-# $SDL2DIR is an environment variable that would
-# correspond to the ./configure --prefix=$SDL2DIR
-# used in building SDL2.
-# l.e.galup  9-20-02
-#
-# Modified by Eric Wing.
-# Added code to assist with automated building by using environmental variables
-# and providing a more controlled/consistent search behavior.
-# Added new modifications to recognize OS X frameworks and
-# additional Unix paths (FreeBSD, etc).
-# Also corrected the header search path to follow "proper" SDL guidelines.
-# Added a search for SDL2main which is needed by some platforms.
-# Added a search for threads which is needed by some platforms.
-# Added needed compile switches for MinGW.
-#
-# On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of
-# SDL2_LIBRARY to override this selection or set the CMake environment
-# CMAKE_INCLUDE_PATH to modify the search paths.
-#
-# Note that the header path has changed from SDL2/SDL.h to just SDL.h
-# This needed to change because "proper" SDL convention
-# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
-# reasons because not all systems place things in SDL2/ (see FreeBSD).
+# Copyright (c) 2014 Andrew Kelley
+# This file is MIT licensed.
+# See http://opensource.org/licenses/MIT
 
-#=============================================================================
-# Copyright 2003-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
+# SDL2_FOUND
+# SDL2_INCLUDE_DIR
+# SDL2_LIBRARY
 
-SET(SDL2_SEARCH_PATHS
-	~/Library/Frameworks
-	/Library/Frameworks
-	/usr/local
-	/usr
-	/sw # Fink
-	/opt/local # DarwinPorts
-	/opt/csw # Blastwave
-	/opt
-)
+find_path(SDL2_INCLUDE_DIR NAMES SDL2/SDL.h)
 
-FIND_PATH(SDL2_INCLUDE_DIR SDL.h
-	HINTS
-	$ENV{SDL2DIR}
-	PATH_SUFFIXES include/SDL2 include
-	PATHS ${SDL2_SEARCH_PATHS}
-)
+find_library(SDL2_LIBRARY NAMES SDL2)
 
-FIND_LIBRARY(SDL2_LIBRARY_TEMP
-	NAMES SDL2
-	HINTS
-	$ENV{SDL2DIR}
-	PATH_SUFFIXES lib64 lib
-	PATHS ${SDL2_SEARCH_PATHS}
-)
+if(SDL2_LIBRARY AND SDL2_INCLUDE_DIR)
+  set(SDL2_FOUND TRUE)
+else()
+  set(SDL2_FOUND FALSE)
+endif()
 
-IF(NOT SDL2_BUILDING_LIBRARY)
-	IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
-		# Non-OS X framework versions expect you to also dynamically link to
-		# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
-		# seem to provide SDL2main for compatibility even though they don't
-		# necessarily need it.
-		FIND_LIBRARY(SDL2MAIN_LIBRARY
-			NAMES SDL2main
-			HINTS
-			$ENV{SDL2DIR}
-			PATH_SUFFIXES lib64 lib
-			PATHS ${SDL2_SEARCH_PATHS}
-		)
-	ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
-ENDIF(NOT SDL2_BUILDING_LIBRARY)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SDL2 DEFAULT_MSG SDL2_LIBRARY SDL2_INCLUDE_DIR)
 
-# SDL2 may require threads on your system.
-# The Apple build may not need an explicit flag because one of the
-# frameworks may already provide it.
-# But for non-OSX systems, I will use the CMake Threads package.
-IF(NOT APPLE)
-	FIND_PACKAGE(Threads)
-ENDIF(NOT APPLE)
-
-# MinGW needs an additional library, mwindows
-# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
-# (Actually on second look, I think it only needs one of the m* libraries.)
-IF(MINGW)
-	SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
-ENDIF(MINGW)
-
-IF(SDL2_LIBRARY_TEMP)
-	# For SDL2main
-	IF(NOT SDL2_BUILDING_LIBRARY)
-		IF(SDL2MAIN_LIBRARY)
-			SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
-		ENDIF(SDL2MAIN_LIBRARY)
-	ENDIF(NOT SDL2_BUILDING_LIBRARY)
-
-	# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
-	# CMake doesn't display the -framework Cocoa string in the UI even
-	# though it actually is there if I modify a pre-used variable.
-	# I think it has something to do with the CACHE STRING.
-	# So I use a temporary variable until the end so I can set the
-	# "real" variable in one-shot.
-	IF(APPLE)
-		SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
-	ENDIF(APPLE)
-
-	# For threads, as mentioned Apple doesn't need this.
-	# In fact, there seems to be a problem if I used the Threads package
-	# and try using this line, so I'm just skipping it entirely for OS X.
-	IF(NOT APPLE)
-		SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
-	ENDIF(NOT APPLE)
-
-	# For MinGW library
-	IF(MINGW)
-		SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
-	ENDIF(MINGW)
-
-	# Set the final string here so the GUI reflects the final state.
-	SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
-	# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
-	SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
-ENDIF(SDL2_LIBRARY_TEMP)
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
+mark_as_advanced(SDL2_INCLUDE_DIR SDL2_LIBRARY)
diff --git a/cmake/FindYasm.cmake b/cmake/FindYasm.cmake
deleted file mode 100644
index 8735eec..0000000
--- a/cmake/FindYasm.cmake
+++ /dev/null
@@ -1,96 +0,0 @@
-# +-----------------------------------------------------------------------------+
-# | $Id::                                                                     $ |
-# +-----------------------------------------------------------------------------+
-# |   Copyright (C) 2007                                                        |
-# |   Lars B"ahren (bahren at astron.nl)                                           |
-# |                                                                             |
-# |   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.,                                           |
-# |   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.                 |
-# +-----------------------------------------------------------------------------+
-
-# - Check for the presence of YASM
-#
-# The following variables are set when YASM is found:
-#  YASM_FOUND      = Set to true, if all components of YASM
-#                         have been found.
-#  YASM_INCLUDES   = Include path for the header files of YASM
-#  YASM_LIBRARIES  = Link these to use YASM
-#  YASM_LFLAGS     = Linker flags (optional)
-
-if (NOT YASM_FOUND)
-    
-  ##_____________________________________________________________________________
-  ## Check for the header files
-  
-  find_path (YASM_INCLUDES libyasm.h libyasm/valparam.h
-    PATHS /sw /usr /usr/local /opt/local ${CMAKE_INSTALL_PREFIX}
-    PATH_SUFFIXES include include/libyasm include/yasm
-    )
-  
-  ##_____________________________________________________________________________
-  ## Check for the library
-  
-  find_library (YASM_LIBRARIES yasm
-    PATHS /sw /usr /usr/local /opt/local ${CMAKE_INSTALL_PREFIX}
-    PATH_SUFFIXES lib
-    )
-  
-  ##_____________________________________________________________________________
-  ## Check for the executable
-  
-  find_program (YASM_EXECUTABLE yasm
-    PATHS /sw /usr /usr/local /opt/local ${CMAKE_INSTALL_PREFIX}
-    PATH_SUFFIXES bin
-    )
-  
-  ##_____________________________________________________________________________
-  ## Actions taken when all components have been found
-  
-  if (YASM_INCLUDES AND YASM_LIBRARIES)
-    set (YASM_FOUND TRUE)
-  else (YASM_INCLUDES AND YASM_LIBRARIES)
-    set (YASM_FOUND FALSE)
-    if (NOT YASM_FIND_QUIETLY)
-      if (NOT YASM_INCLUDES)
-	message (STATUS "Unable to find YASM header files!")
-      endif (NOT YASM_INCLUDES)
-      if (NOT YASM_LIBRARIES)
-	message (STATUS "Unable to find YASM library files!")
-      endif (NOT YASM_LIBRARIES)
-    endif (NOT YASM_FIND_QUIETLY)
-  endif (YASM_INCLUDES AND YASM_LIBRARIES)
-  
-  if (YASM_FOUND)
-    if (NOT YASM_FIND_QUIETLY)
-      message (STATUS "Found components for Yasm")
-      message (STATUS "YASM_INCLUDES  = ${YASM_INCLUDES}")
-      message (STATUS "YASM_LIBRARIES = ${YASM_LIBRARIES}")
-    endif (NOT YASM_FIND_QUIETLY)
-  else (YASM_FOUND)
-    if (YASM_FIND_REQUIRED)
-      message (FATAL_ERROR "Could not find YASM!")
-    endif (YASM_FIND_REQUIRED)
-  endif (YASM_FOUND)
-  
-  ##_____________________________________________________________________________
-  ## Mark advanced variables
-  
-  mark_as_advanced (
-    YASM_INCLUDES
-    YASM_LIBRARIES
-    YASM_EXECUTABLE
-    )
-  
-endif (NOT YASM_FOUND)
diff --git a/cmake/Findebur128.cmake b/cmake/Findebur128.cmake
index 0ba8657..5add45b 100644
--- a/cmake/Findebur128.cmake
+++ b/cmake/Findebur128.cmake
@@ -1,40 +1,22 @@
-# Locate libebur128 library  
-# This module defines
-# EBUR128_LIBRARY, the name of the library to link against
-# EBUR128_FOUND, if false, do not try to link
-# EBUR128_INCLUDE_DIR, where to find header
-#
-set(EBUR128_FOUND FALSE)
+# Copyright (c) 2014 Andrew Kelley
+# This file is MIT licensed.
+# See http://opensource.org/licenses/MIT
 
-find_path(EBUR128_INCLUDE_DIR ebur128.h
-  HINTS
-  PATH_SUFFIXES include 
-  PATHS
-  ~/Library/Frameworks
-  /Library/Frameworks
-  /usr/local/include
-  /usr/include
-  /sw/include
-  /opt/local/include
-  /opt/csw/include 
-  /opt/include
-  /mingw
-)
+# EBUR128_FOUND
+# EBUR128_INCLUDE_DIR
+# EBUR128_LIBRARY
 
-find_library(EBUR128_LIBRARY
-  NAMES ebur128
-  HINTS
-  PATH_SUFFIXES lib64 lib
-  PATHS
-  /usr/local
-  /usr
-  /sw
-  /opt/local
-  /opt/csw
-  /opt
-  /mingw
-)
+find_path(EBUR128_INCLUDE_DIR NAMES ebur128.h)
 
-if(EBUR128_LIBRARY)
+find_library(EBUR128_LIBRARY NAMES ebur128)
+
+if(EBUR128_LIBRARY AND EBUR128_INCLUDE_DIR)
   set(EBUR128_FOUND TRUE)
-endif(EBUR128_LIBRARY)
+else()
+  set(EBUR128_FOUND FALSE)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(EBUR128 DEFAULT_MSG EBUR128_LIBRARY EBUR128_INCLUDE_DIR)
+
+mark_as_advanced(EBUR128_INCLUDE_DIR EBUR128_LIBRARY)
diff --git a/cmake/Findmp3lame.cmake b/cmake/Findmp3lame.cmake
deleted file mode 100644
index 999ed74..0000000
--- a/cmake/Findmp3lame.cmake
+++ /dev/null
@@ -1,41 +0,0 @@
-# Locate libmp3lame library  
-# This module defines
-# MP3LAME_LIBRARY, the name of the library to link against
-# MP3LAME_FOUND, if false, do not try to link
-# MP3LAME_INCLUDE_DIR, where to find header
-#
-
-set( MP3LAME_FOUND "NO" )
-
-find_path( MP3LAME_INCLUDE_DIR lame/lame.h
-  HINTS
-  PATH_SUFFIXES include 
-  PATHS
-  ~/Library/Frameworks
-  /Library/Frameworks
-  /usr/local/include
-  /usr/include
-  /sw/include
-  /opt/local/include
-  /opt/csw/include 
-  /opt/include
-  /mingw
-)
-
-find_library( MP3LAME_LIBRARY
-  NAMES mp3lame
-  HINTS
-  PATH_SUFFIXES lib64 lib
-  PATHS
-  /usr/local
-  /usr
-  /sw
-  /opt/local
-  /opt/csw
-  /opt
-  /mingw
-)
-
-if(MP3LAME_LIBRARY)
-set( MP3LAME_FOUND "YES" )
-endif(MP3LAME_LIBRARY)
diff --git a/deps/SDL2/Android.mk b/deps/SDL2/Android.mk
deleted file mode 100755
index c8e67da..0000000
--- a/deps/SDL2/Android.mk
+++ /dev/null
@@ -1,68 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-###########################
-#
-# SDL shared library
-#
-###########################
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := SDL2
-
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
-
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
-
-LOCAL_SRC_FILES := \
-	$(subst $(LOCAL_PATH)/,, \
-	$(wildcard $(LOCAL_PATH)/src/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
-	$(LOCAL_PATH)/src/atomic/SDL_atomic.c \
-	$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
-	$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/events/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/file/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/power/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/filesystem/dummy/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/render/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/video/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
-    $(wildcard $(LOCAL_PATH)/src/test/*.c))
-
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
-LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
-
-include $(BUILD_SHARED_LIBRARY)
-
-###########################
-#
-# SDL static library
-#
-###########################
-
-LOCAL_MODULE := SDL2_static
-
-LOCAL_MODULE_FILENAME := libSDL2
-
-LOCAL_SRC_FILES += $(LOCAL_PATH)/src/main/android/SDL_android_main.c
-
-LOCAL_LDLIBS := 
-LOCAL_EXPORT_LDLIBS := -Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/deps/SDL2/BUGS.txt b/deps/SDL2/BUGS.txt
deleted file mode 100644
index 7ef5538..0000000
--- a/deps/SDL2/BUGS.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-Bugs are now managed in the SDL bug tracker, here:
-
-    http://bugzilla.libsdl.org/
-
-You may report bugs there, and search to see if a given issue has already
- been reported, discussed, and maybe even fixed.
-
-
-You may also find help on the SDL mailing list. Subscription information:
-
-    http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-
-Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
- bugs discussed on the mailing list may be forgotten or missed.
-
diff --git a/deps/SDL2/CMakeLists.txt b/deps/SDL2/CMakeLists.txt
deleted file mode 100644
index 1a1607f..0000000
--- a/deps/SDL2/CMakeLists.txt
+++ /dev/null
@@ -1,1236 +0,0 @@
-if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
-  message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there")
-endif()
-
-cmake_minimum_required(VERSION 2.6)
-project(SDL2 C)
-include(CheckFunctionExists)
-include(CheckLibraryExists)
-include(CheckIncludeFiles)
-include(CheckIncludeFile)
-include(CheckSymbolExists)
-include(CheckCSourceRuns)
-include(CheckCCompilerFlag)
-include(CheckTypeSize)
-include(CheckStructHasMember)
-include(CMakeDependentOption)
-include(FindPkgConfig)
-set(CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake")
-include(${SDL2_SOURCE_DIR}/cmake/macros.cmake)
-include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake)
-
-# General settings
-# Edit include/SDL_version.h and change the version, then:
-#   SDL_MICRO_VERSION += 1;
-#   SDL_INTERFACE_AGE += 1;
-#   SDL_BINARY_AGE += 1;
-# if any functions have been added, set SDL_INTERFACE_AGE to 0.
-# if backwards compatibility has been broken,
-# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
-set(SDL_MAJOR_VERSION 2)
-set(SDL_MINOR_VERSION 0)
-set(SDL_MICRO_VERSION 1)
-set(SDL_INTERFACE_AGE 0)
-set(SDL_BINARY_AGE 1)
-set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
-
-# Calculate a libtool-like version number
-math(EXPR LT_CURRENT "${SDL_MICRO_VERSION} - ${SDL_INTERFACE_AGE}")
-math(EXPR LT_AGE "${SDL_BINARY_AGE} - ${SDL_INTERFACE_AGE}")
-set(LT_REVISION "${SDL_INTERFACE_AGE}")
-set(LT_RELEASE "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}")
-set(LT_VERSION "${LT_CURRENT}.${LT_REVISION}.${LT_AGE}")
-
-# General settings & flags
-set(LIBRARY_OUTPUT_DIRECTORY "build")
-# Check for 64 or 32 bit
-set(SIZEOF_VOIDP ${CMAKE_SIZEOF_VOID_P})
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-  set(ARCH_64 TRUE)
-  set(PROCESSOR_ARCH "x64")
-else()
-  set(ARCH_64 FALSE)
-  set(PROCESSOR_ARCH "x86")
-endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
-set(LIBNAME SDL2)
-if(NOT LIBTYPE)
-  set(LIBTYPE SHARED)
-endif(NOT LIBTYPE)
-
-# Get the platform
-if(WIN32)
-  if(NOT WINDOWS)
-    set(WINDOWS TRUE)
-  endif(NOT WINDOWS)
-elseif(UNIX AND NOT APPLE)
-  if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
-    set(LINUX TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*")
-    set(FREEBSD TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*")
-    set(NETBSD TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
-    set(OPENBSD TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*")
-    set(GNU TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
-    set(BSDI TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
-    set(FREEBSD TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*")
-    set(SYSV5 TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*")
-    set(SOLARIS TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*")
-    set(HPUX TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*")
-    set(AIX TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*")
-    set(MINIX TRUE)
-  endif()
-elseif(APPLE)
-  if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
-    set(DARWIN TRUE)
-  elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
-    set(MACOSX TRUE)
-  endif()
-  # TODO: iOS?
-elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*|BeOS.*")
-  set(BEOS TRUE)
-endif()
-
-# Don't mistake osx for unix
-if(UNIX AND NOT APPLE)
-  set(UNIX_SYS ON)
-else()
-  set(UNIX_SYS OFF)
-endif(UNIX AND NOT APPLE)
-
-if(UNIX OR APPLE)
-  set(UNIX_OR_MAC_SYS ON)
-else()
-  set(UNIX_OR_MAC_SYS OFF)
-endif(UNIX OR APPLE)
-
-# Default option knobs
-if(APPLE OR ARCH_64)
-  set(OPT_DEF_SSEMATH ON)
-endif()
-if(UNIX OR MINGW OR MSYS)
-  set(OPT_DEF_LIBC ON)
-endif(UNIX OR MINGW OR MSYS)
-
-# Compiler info
-if(CMAKE_COMPILER_IS_GNUCC)
-  set(USE_GCC TRUE)
-  set(OPT_DEF_ASM TRUE)
-elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
-  set(USE_CLANG TRUE)
-  set(OPT_DEF_ASM TRUE)
-elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+
-  set(OPT_DEF_ASM TRUE)
-  #set(CMAKE_C_FLAGS "/ZI /WX- /
-else()
-  set(OPT_DEF_ASM FALSE)
-endif(CMAKE_COMPILER_IS_GNUCC)
-
-# Default flags, if not set otherwise
-if("$ENV{CFLAGS}" STREQUAL "")
-  if(USE_GCC OR USE_CLANG)
-    set(CMAKE_C_FLAGS "-g -O3")
-  endif(USE_GCC OR USE_CLANG)
-else("$ENV{CFLAGS}" STREQUAL "")
-  set(CMAKE_C_FLAGS "$ENV{CFLAGS}")
-  list(APPEND EXTRA_CFLAGS "$ENV{CFLAGS}")
-endif("$ENV{CFLAGS}" STREQUAL "")
-if(NOT ("$ENV{CFLAGS}" STREQUAL "")) # Hackish, but does the trick on Win32
-  list(APPEND EXTRA_LDFLAGS "$ENV{LDFLAGS}")
-endif(NOT ("$ENV{CFLAGS}" STREQUAL ""))
-
-# Those are used for pkg-config and friends, so that the SDL2.pc, sdl2-config,
-# etc. are created correctly.
-set(SDL_LIBS "-lSDL2")
-set(SDL_CFLAGS "")
-
-if(CYGWIN)
-  # We build SDL on cygwin without the UNIX emulation layer
-  include_directories("-I/usr/include/mingw")
-  set(CMAKE_REQUIRED_FLAGS "-mno-cygwin")
-  check_c_source_compiles("int main(int argc, char **argv) {}"
-    HAVE_GCC_NO_CYGWIN)
-  set(CMAKE_REQUIRED_FLAGS)
-  if(HAVE_GCC_NO_CYGWIN)
-    list(APPEND EXTRA_LDFLAGS "-mno-cygwin")
-    list(APPEND SDL_LIBS "-mno-cygwin")
-  endif(HAVE_GCC_NO_CYGWIN)
-  set(SDL_CFLAGS "${SDL_CFLAGS} -I/usr/include/mingw")
-endif(CYGWIN)
-
-add_definitions(-DUSING_GENERATED_CONFIG_H)
-# General includes
-include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include)
-
-set(SDL_SUBSYSTEMS
-    Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
-    File Loadso CPUinfo Filesystem)
-foreach(_SUB ${SDL_SUBSYSTEMS})
-  string(TOUPPER ${_SUB} _OPT)
-  option(SDL_${_OPT} "Enable the ${_SUB} subsystem" ON)
-endforeach()
-
-option_string(ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto")
-#set_option(DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON)
-set_option(LIBC                "Use the system C library" ${OPT_DEF_LIBC})
-set_option(GCC_ATOMICS         "Use gcc builtin atomics" ${USE_GCC})
-set_option(ASSEMBLY            "Enable assembly routines" ${OPT_DEF_ASM})
-set_option(SSEMATH             "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH})
-set_option(MMX                 "Use MMX assembly routines" ${OPT_DEF_ASM})
-set_option(3DNOW               "Use 3Dnow! MMX assembly routines" ${OPT_DEF_ASM})
-set_option(SSE                 "Use SSE assembly routines" ${OPT_DEF_ASM})
-set_option(SSE2                "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH})
-set_option(ALTIVEC             "Use Altivec assembly routines" ${OPT_DEF_ASM})
-set_option(DISKAUDIO           "Support the disk writer audio driver" ON)
-set_option(DUMMYAUDIO          "Support the dummy audio driver" ON)
-set_option(VIDEO_DIRECTFB      "Use DirectFB video driver" OFF)
-dep_option(DIRECTFB_SHARED     "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF)
-set_option(FUSIONSOUND         "Use FusionSound audio driver" OFF)
-dep_option(FUSIONSOUND_SHARED  "Dynamically load fusionsound audio support" ON "FUSIONSOUND_SHARED" OFF)
-set_option(VIDEO_DUMMY         "Use dummy video driver" ON)
-set_option(VIDEO_OPENGL        "Include OpenGL support" ON)
-set_option(VIDEO_OPENGLES      "Include OpenGL ES support" ON)
-set_option(PTHREADS            "Use POSIX threads for multi-threading" ${UNIX_OR_MAC_SYS})
-dep_option(PTHREADS_SEM        "Use pthread semaphores" ON "PTHREADS" OFF)
-set_option(SDL_DLOPEN          "Use dlopen for shared object loading" ON)
-set_option(OSS                 "Support the OSS audio API" ${UNIX_SYS})
-set_option(ALSA                "Support the ALSA audio API" ${UNIX_SYS})
-dep_option(ALSA_SHARED         "Dynamically load ALSA audio support" ON "ALSA" OFF)
-set_option(ESD                 "Support the Enlightened Sound Daemon" ${UNIX_SYS})
-dep_option(ESD_SHARED          "Dynamically load ESD audio support" ON "ESD" OFF)
-set_option(PULSEAUDIO          "Use PulseAudio" ${UNIX_SYS})
-dep_option(PULSEAUDIO_SHARED   "Dynamically load PulseAudio support" ON "PULSEAUDIO" OFF)
-set_option(ARTS                "Support the Analog Real Time Synthesizer" ${UNIX_SYS})
-dep_option(ARTS_SHARED         "Dynamically load aRts audio support" ON "ARTS" OFF)
-set_option(NAS                 "Support the NAS audio API" ${UNIX_SYS})
-set_option(SNDIO               "Support the sndio audio API" ${UNIX_SYS})
-set_option(RPATH               "Use an rpath when linking SDL" ${UNIX_SYS})
-set_option(CLOCK_GETTIME       "Use clock_gettime() instead of gettimeofday()" OFF)
-set_option(INPUT_TSLIB         "Use the Touchscreen library for input" ${UNIX_SYS})
-set_option(VIDEO_X11           "Use X11 video driver" ${UNIX_SYS})
-dep_option(X11_SHARED          "Dynamically load X11 support" ON "VIDEO_X11" OFF)
-set(SDL_X11_OPTIONS Xcursor Xinerama XInput Xrandr Xscrnsaver XShape Xvm)
-foreach(_SUB ${SDL_X11_OPTIONS})
-  string(TOUPPER "VIDEO_X11_${_SUB}" _OPT)
-  dep_option(${_OPT}           "Enable ${_SUB} support" ON "VIDEO_X11" OFF)
-endforeach()
-set_option(VIDEO_COCOA         "Use Cocoa video driver" ${APPLE})
-set_option(DIRECTX             "Use DirectX for Windows audio/video" ${WINDOWS})
-set_option(RENDER_D3D          "Enable the Direct3D render driver" ${WINDOWS})
-
-# TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here
-# The options below are for compatibility to configure's default behaviour.
-set(SDL_SHARED ON CACHE BOOL "Build a shared version of the library")
-set(SDL_STATIC ON CACHE BOOL "Build a static version of the library")
-
-# General source files
-file(GLOB SOURCE_FILES
-  ${SDL2_SOURCE_DIR}/src/*.c
-  ${SDL2_SOURCE_DIR}/src/atomic/*.c
-  ${SDL2_SOURCE_DIR}/src/audio/*.c
-  ${SDL2_SOURCE_DIR}/src/cpuinfo/*.c
-  ${SDL2_SOURCE_DIR}/src/events/*.c
-  ${SDL2_SOURCE_DIR}/src/file/*.c
-  ${SDL2_SOURCE_DIR}/src/libm/*.c
-  ${SDL2_SOURCE_DIR}/src/render/*.c
-  ${SDL2_SOURCE_DIR}/src/render/*/*.c
-  ${SDL2_SOURCE_DIR}/src/stdlib/*.c
-  ${SDL2_SOURCE_DIR}/src/thread/*.c
-  ${SDL2_SOURCE_DIR}/src/timer/*.c
-  ${SDL2_SOURCE_DIR}/src/video/*.c)
-
-
-if(ASSERTIONS STREQUAL "auto")
-  # Do nada - use optimization settings to determine the assertion level
-elseif(ASSERTIONS STREQUAL "disabled")
-  set(SDL_DEFAULT_ASSERT_LEVEL 0)
-elseif(ASSERTIONS STREQUAL "release")
-  set(SDL_DEFAULT_ASSERT_LEVEL 1)
-elseif(ASSERTIONS STREQUAL "enabled")
-  set(SDL_DEFAULT_ASSERT_LEVEL 2)
-elseif(ASSERTIONS STREQUAL "paranoid")
-  set(SDL_DEFAULT_ASSERT_LEVEL 3)
-else()
-  message_error("unknown assertion level")
-endif(ASSERTIONS STREQUAL "auto")
-set(HAVE_ASSERTIONS ${ASSERTIONS})
-
-# Compiler option evaluation
-if(USE_GCC)
-  if(DEPENDENCY_TRACKING)
-    check_c_source_compiles("
-        #if !defined(__GNUC__) || __GNUC__ < 3
-        #error Dependency tracking requires GCC 3.0 or newer
-        #endif
-        int main(int argc, char **argv) { }" HAVE_DEPENDENCY_TRACKING)
-  endif(DEPENDENCY_TRACKING)
-
-  if(GCC_ATOMICS)
-    check_c_source_compiles("int main(int argc, char **argv) {
-        int a;
-        void *x, *y, *z;
-        __sync_lock_test_and_set(&a, 4);
-        __sync_lock_test_and_set(&x, y);
-        __sync_fetch_and_add(&a, 1);
-        __sync_bool_compare_and_swap(&a, 5, 10);
-        __sync_bool_compare_and_swap(&x, y, z); }" HAVE_GCC_ATOMICS)
-    if(NOT HAVE_GCC_ATOMICS)
-      check_c_source_compiles("int main(int argc, char **argv) {
-          int a;
-          __sync_lock_test_and_set(&a, 1);
-          __sync_lock_release(&a); }" HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
-    endif(NOT HAVE_GCC_ATOMICS)
-  endif(GCC_ATOMICS)
-
-  set(CMAKE_REQUIRED_FLAGS "-mpreferred-stack-boundary=2")
-  check_c_source_compiles("int x = 0; int main(int argc, char **argv) {}"
-    HAVE_GCC_PREFERRED_STACK_BOUNDARY)
-  set(CMAKE_REQUIRED_FLAGS)
-
-  set(CMAKE_REQUIRED_FLAGS "-fvisibility=hidden -Werror")
-  check_c_source_compiles("
-      #if !defined(__GNUC__) || __GNUC__ < 4
-      #error SDL only uses visibility attributes in GCC 4 or newer
-      #endif
-      int main(int argc, char **argv) {}" HAVE_GCC_FVISIBILITY)
-  if(HAVE_GCC_FVISIBILITY)
-    list(APPEND EXTRA_CFLAGS "-fvisibility=hidden")
-  endif(HAVE_GCC_FVISIBILITY)
-  set(CMAKE_REQUIRED_FLAGS)
-
-  check_c_compiler_flag(-Wall HAVE_GCC_WALL)
-  if(HAVE_GCC_WALL)
-    if(CMAKE_SYSTEM_NAME MATCHES "Haiku|BeOS")
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
-    endif(CMAKE_SYSTEM_NAME MATCHES "Haiku|BeOS")
-  endif(HAVE_GCC_WALL)
-endif(USE_GCC)
-
-if(ASSEMBLY)
-  if(USE_GCC OR USE_CLANG)
-    set(SDL_ASSEMBLY_ROUTINES 1)
-    # TODO: Those all seem to be quite GCC specific - needs to be
-    # reworked for better compiler support
-    set(HAVE_ASSEMBLY TRUE)
-    if(MMX)
-      set(CMAKE_REQUIRED_FLAGS "-mmmx")
-      check_c_source_compiles("
-          #ifdef __MINGW32__
-          #include <_mingw.h>
-          #ifdef __MINGW64_VERSION_MAJOR
-          #include <intrin.h>
-          #else
-          #include <mmintrin.h>
-          #endif
-          #else
-          #include <mmintrin.h>
-          #endif
-          #ifndef __MMX__
-          #error Assembler CPP flag not enabled
-          #endif
-          int main(int argc, char **argv) { }" HAVE_MMX)
-      if(HAVE_MMX)
-        list(APPEND EXTRA_CFLAGS "-mmmx")
-      endif(HAVE_MMX)
-      set(CMAKE_REQUIRED_FLAGS)
-    endif(MMX)
-
-    if(3DNOW)
-      set(CMAKE_REQUIRED_FLAGS "-m3dnow")
-      check_c_source_compiles("
-          #include <mm3dnow.h>
-          #ifndef __3dNOW__
-          #error Assembler CPP flag not enabled
-          #endif
-          int main(int argc, char **argv) {
-            void *p = 0;
-            _m_prefetch(p);
-          }" HAVE_3DNOW)
-      if(HAVE_3DNOW)
-        list(APPEND EXTRA_CFLAGS "-m3dnow")
-      endif(HAVE_3DNOW)
-      set(CMAKE_REQUIRED_FLAGS)
-    endif(3DNOW)
-
-    if(SSE)
-      set(CMAKE_REQUIRED_FLAGS "-msse")
-      check_c_source_compiles("
-          #ifdef __MINGW32__
-          #include <_mingw.h>
-          #ifdef __MINGW64_VERSION_MAJOR
-          #include <intrin.h>
-          #else
-          #include <xmmintrin.h>
-          #endif
-          #else
-          #include <xmmintrin.h>
-          #endif
-          #ifndef __SSE__
-          #error Assembler CPP flag not enabled
-          #endif
-          int main(int argc, char **argv) { }" HAVE_SSE)
-      if(HAVE_SSE)
-        list(APPEND EXTRA_CFLAGS "-msse")
-      endif(HAVE_SSE)
-      set(CMAKE_REQUIRED_FLAGS)
-    endif(SSE)
-
-    if(SSE2)
-      set(CMAKE_REQUIRED_FLAGS "-msse2")
-      check_c_source_compiles("
-          #ifdef __MINGW32__
-          #include <_mingw.h>
-          #ifdef __MINGW64_VERSION_MAJOR
-          #include <intrin.h>
-          #else
-          #include <emmintrin.h>
-          #endif
-          #else
-          #include <emmintrin.h>
-          #endif
-          #ifndef __SSE2__
-          #error Assembler CPP flag not enabled
-          #endif
-          int main(int argc, char **argv) { }" HAVE_SSE2)
-      if(HAVE_SSE2)
-        list(APPEND EXTRA_CFLAGS "-msse2")
-      endif(HAVE_SSE2)
-      set(CMAKE_REQUIRED_FLAGS)
-    endif(SSE2)
-
-    if(SSEMATH)
-      if(SSE OR SSE2)
-        if(USE_GCC)
-          list(APPEND EXTRA_CFLAGS "-mfpmath=387")
-        endif(USE_GCC)
-        set(HAVE_SSEMATH TRUE)
-      endif(SSE OR SSE2)
-    endif(SSEMATH)
-
-    if(ALTIVEC)
-      set(CMAKE_REQUIRED_FLAGS "-maltivec")
-      check_c_source_compiles("
-          #include <altivec.h>
-          vector unsigned int vzero() {
-              return vec_splat_u32(0);
-          }
-          int main(int argc, char **argv) { }" HAVE_ALTIVEC_H_HDR)
-      check_c_source_compiles("
-          vector unsigned int vzero() {
-              return vec_splat_u32(0);
-          }
-          int main(int argc, char **argv) { }" HAVE_ALTIVEC)
-      set(CMAKE_REQUIRED_FLAGS)
-      if(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR)
-        set(HAVE_ALTIVEC TRUE) # if only HAVE_ALTIVEC_H_HDR is set
-        list(APPEND EXTRA_CFLAGS "-maltivec")
-        set(SDL_ALTIVEC_BLITTERS 1)
-        if(HAVE_ALTIVEC_H_HDR)
-          set(HAVE_ALTIVEC_H 1)
-        endif(HAVE_ALTIVEC_H_HDR)
-      endif(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR)
-    endif(ALTIVEC)
-  elseif(MSVC_VERSION GREATER 1500)
-    # TODO: SDL_cpuinfo.h needs to support the user's configuration wish
-    # for MSVC - right now it is always activated
-    if(NOT ARCH_64)
-      set(HAVE_MMX TRUE)
-      set(HAVE_3DNOW TRUE)
-    endif(NOT ARCH_64)
-    set(HAVE_SSE TRUE)
-    set(HAVE_SSE2 TRUE)
-    set(SDL_ASSEMBLY_ROUTINES 1)
-  endif(USE_GCC OR USE_CLANG)
-# TODO:
-#else(ASSEMBLY)
-#  if(USE_GCC OR USE_CLANG)
-#    list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-mmx")
-#  endif(USE_GCC OR USE_CLANG)
-endif(ASSEMBLY)
-
-# TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define
-# anything.
-if(LIBC)
-  if(WINDOWS AND NOT MINGW)
-    set(HAVE_LIBC TRUE)
-    foreach(_HEADER stdio.h string.h ctype.h math.h)
-      string(TOUPPER "HAVE_${_HEADER}" _UPPER)
-      string(REPLACE "." "_" _HAVE_H ${_UPPER})
-      set(${_HAVE_H} 1)
-    endforeach()
-    set(HAVE_SIGNAL_H 1)
-    foreach(_FN
-            malloc calloc realloc free qsort abs memset memcpy memmove memcmp
-            strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
-            _ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp
-            _stricmp _strnicmp sscanf atan atan2 ceil copysign cos cosf fabs
-            floor log pow scalbn sin sinf sqrt)
-      string(TOUPPER ${_FN} _UPPER)
-      set(HAVE_${_UPPER} 1)
-    endforeach()
-    if(NOT CYGWIN AND NOT MINGW)
-      set(HAVE_ALLOCA 1)
-    endif(NOT CYGWIN AND NOT MINGW)
-    set(HAVE_M_PI 1)
-    add_definitions(-D_USE_MATH_DEFINES) # needed for M_PI
-    set(STDC_HEADERS 1)
-  else(WINDOWS AND NOT MINGW)
-    set(HAVE_LIBC TRUE)
-    check_include_file(sys/types.h HAVE_SYS_TYPES_H)
-    foreach(_HEADER
-            stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h
-            strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h)
-      string(TOUPPER "HAVE_${_HEADER}" _UPPER)
-      string(REPLACE "." "_" _HAVE_H ${_UPPER})
-      check_include_file("${_HEADER}" ${_HAVE_H})
-    endforeach()
-
-    check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" STDC_HEADERS)
-    check_type_size("size_t" SIZEOF_SIZE_T)
-    check_symbol_exists(M_PI math.h HAVE_M_PI)
-    # TODO: refine the mprotect check
-    check_c_source_compiles("#include <sys/types.h>
-                             #include <sys/mman.h>
-                             int main() { }" HAVE_MPROTECT)
-    foreach(_FN
-            strtod malloc calloc realloc free getenv setenv putenv unsetenv
-            qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat
-            strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
-            _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull
-            atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp
-            sscanf snprintf vsnprintf fseeko fseeko64 sigaction setjmp
-            nanosleep sysconf sysctlbyname
-            )
-      string(TOUPPER ${_FN} _UPPER)
-      set(_HAVEVAR "HAVE_${_UPPER}")
-      check_function_exists("${_FN}" ${_HAVEVAR})
-    endforeach()
-
-    check_library_exists(m pow "" HAVE_LIBM)
-    if(HAVE_LIBM)
-      set(CMAKE_REQUIRED_LIBRARIES m)
-      foreach(_FN
-              atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin
-              sinf sqrt)
-        string(TOUPPER ${_FN} _UPPER)
-        set(_HAVEVAR "HAVE_${_UPPER}")
-        check_function_exists("${_FN}" ${_HAVEVAR})
-      endforeach()
-      set(CMAKE_REQUIRED_LIBRARIES)
-      list(APPEND EXTRA_LIBS m)
-    endif(HAVE_LIBM)
-
-    check_library_exists(iconv iconv_open "" HAVE_LIBICONV)
-    if(HAVE_LIBICONV)
-      list(APPEND EXTRA_LIBS iconv)
-    endif(HAVE_LIBICONV)
-
-    check_struct_has_member("struct sigaction" "sa_sigaction" "signal.h" HAVE_SA_SIGACTION)
-  endif(WINDOWS AND NOT MINGW)
-else(LIBC)
-  if(WINDOWS)
-    set(HAVE_STDARG_H 1)
-    set(HAVE_STDDEF_H 1)
-  endif(WINDOWS)
-endif(LIBC)
-
-
-# Enable/disable various subsystems of the SDL library
-foreach(_SUB ${SDL_SUBSYSTEMS})
-  string(TOUPPER ${_SUB} _OPT)
-  if(NOT SDL_${_OPT})
-    set(SDL_${_OPT}_DISABLED 1)
-  endif(NOT SDL_${_OPT})
-endforeach()
-if(SDL_JOYSTICK)
-  file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
-endif(SDL_JOYSTICK)
-if(SDL_HAPTIC)
-  if(NOT SDL_JOYSTICK)
-    # Haptic requires some private functions from the joystick subsystem.
-    message_error("SDL_HAPTIC requires SDL_JOYSTICK, which is not enabled")
-  endif(NOT SDL_JOYSTICK)
-  file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
-endif(SDL_HAPTIC)
-if(SDL_POWER)
-  file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
-endif(SDL_POWER)
-# TODO: in configure.in, the test for LOADSO and SDL_DLOPEN is a bit weird:
-# if LOADSO is not wanted, SDL_LOADSO_DISABLED is set
-# If however on Unix or APPLE dlopen() is detected via CheckDLOPEN(),
-# SDL_LOADSO_DISABLED will not be set, regardless of the LOADSO settings
-
-# General SDL subsystem options, valid for all platforms
-if(SDL_AUDIO)
-  # CheckDummyAudio/CheckDiskAudio - valid for all platforms
-  if(DUMMYAUDIO)
-    set(SDL_AUDIO_DRIVER_DUMMY 1)
-    file(GLOB DUMMYAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dummy/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${DUMMYAUDIO_SOURCES})
-    set(HAVE_DUMMYAUDIO TRUE)
-  endif(DUMMYAUDIO)
-  if(DISKAUDIO)
-    set(SDL_AUDIO_DRIVER_DISK 1)
-    file(GLOB DISKAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/disk/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${DISKAUDIO_SOURCES})
-    set(HAVE_DISKAUDIO TRUE)
-  endif(DISKAUDIO)
-endif(SDL_AUDIO)
-
-if(SDL_DLOPEN)
-  # Relevant for Unix/Darwin only
-  if(UNIX OR APPLE)
-    CheckDLOPEN()
-  endif(UNIX OR APPLE)
-endif(SDL_DLOPEN)
-
-if(SDL_VIDEO)
-  if(VIDEO_DUMMY)
-    set(SDL_VIDEO_DRIVER_DUMMY 1)
-    file(GLOB VIDEO_DUMMY_SOURCES ${SDL2_SOURCE_DIR}/src/video/dummy/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${VIDEO_DUMMY_SOURCES})
-    set(HAVE_VIDEO_DUMMY TRUE)
-    set(HAVE_SDL_VIDEO TRUE)
-  endif(VIDEO_DUMMY)
-endif(SDL_VIDEO)
-
-# Platform-specific options and settings
-if(UNIX AND NOT APPLE)
-  if(SDL_AUDIO)
-    if(SYSV5 OR SOLARIS OR HPUX)
-        set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
-        file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c)
-        set(SOURCE_FILES ${SOURCE_FILES} ${SUN_AUDIO_SOURCES})
-        set(HAVE_SDL_AUDIO TRUE)
-    elseif(NETBSD OR OPENBSD)
-        set(SDL_AUDIO_DRIVER_BSD 1)
-        file(GLOB BSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/bsd/*.c)
-        set(SOURCE_FILES ${SOURCE_FILES} ${BSD_AUDIO_SOURCES})
-        set(HAVE_SDL_AUDIO TRUE)
-    elseif(AIX)
-        set(SDL_AUDIO_DRIVER_PAUDIO 1)
-        file(GLOB AIX_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/paudio/*.c)
-        set(SOURCE_FILES ${SOURCE_FILES} ${AIX_AUDIO_SOURCES})
-        set(HAVE_SDL_AUDIO TRUE)
-    endif()
-    CheckOSS()
-    CheckALSA()
-    CheckPulseAudio()
-    CheckESD()
-    CheckARTS()
-    CheckNAS()
-    CheckSNDIO()
-    CheckFusionSound()
-  endif(SDL_AUDIO)
-
-  if(SDL_VIDEO)
-    CheckX11()
-    CheckDirectFB()
-    CheckOpenGLX11()
-    CheckOpenGLESX11()
-  endif(SDL_VIDEO)
-
-  if(LINUX)
-    check_c_source_compiles("
-        #include <linux/input.h>
-        #ifndef EVIOCGNAME
-        #error EVIOCGNAME() ioctl not available
-        #endif
-        int main(int argc, char** argv) {}" HAVE_INPUT_EVENTS)
-    if(HAVE_INPUT_EVENTS)
-      set(SDL_INPUT_LINUXEV 1)
-    endif(HAVE_INPUT_EVENTS)
-
-    if(SDL_HAPTIC AND HAVE_INPUT_EVENTS)
-      set(SDL_HAPTIC_LINUX 1)
-      file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
-      set(HAVE_SDL_HAPTIC TRUE)
-    endif(SDL_HAPTIC AND HAVE_INPUT_EVENTS)
-
-    check_include_file("libudev.h" HAVE_LIBUDEV_H)
-
-    # !!! FIXME: this needs pkg-config to find the include path, I think.
-    check_include_file("dbus/dbus.h" HAVE_DBUS_DBUS_H)
-  endif(LINUX)
-
-  if(INPUT_TSLIB)
-    check_c_source_compiles("
-        #include \"tslib.h\"
-        int main(int argc, char** argv) { }" HAVE_INPUT_TSLIB)
-    if(HAVE_INPUT_TSLIB)
-      set(SDL_INPUT_TSLIB 1)
-      list(APPEND EXTRA_LIBS ts)
-    endif(HAVE_INPUT_TSLIB)
-  endif(INPUT_TSLIB)
-
-  if(SDL_JOYSTICK)
-    CheckUSBHID()   # seems to be BSD specific - limit the test to BSD only?
-    if(LINUX)
-      set(SDL_JOYSTICK_LINUX 1)
-      file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
-      set(HAVE_SDL_JOYSTICK TRUE)
-    endif(LINUX)
-  endif(SDL_JOYSTICK)
-
-  CheckPTHREAD()
-
-  if(CLOCK_GETTIME)
-    check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME)
-    if(FOUND_CLOCK_GETTIME)
-      list(APPEND EXTRA_LIBS rt)
-      set(HAVE_CLOCK_GETTIME 1)
-    else(FOUND_CLOCK_GETTIME)
-      check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME)
-      if(FOUND_CLOCK_GETTIME)
-        set(HAVE_CLOCK_GETTIME 1)
-      endif(FOUND_CLOCK_GETTIME)
-    endif(HAVE_CLOCK_GETTIME)
-  endif(CLOCK_GETTIME)
-
-  check_include_file(linux/version.h HAVE_LINUX_VERSION_H)
-  if(HAVE_LINUX_VERSION_H)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_LINUX_VERSION_H")
-  endif(HAVE_LINUX_VERSION_H)
-
-  if(SDL_POWER)
-    if(LINUX)
-      set(SDL_POWER_LINUX 1)
-      file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/linux/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
-      set(HAVE_SDL_POWER TRUE)
-    endif(LINUX)
-  endif(SDL_POWER)
-
-  if(SDL_FILESYSTEM)
-    set(SDL_FILESYSTEM_UNIX 1)
-    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/unix/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
-    set(HAVE_SDL_FILESYSTEM TRUE)
-  endif(SDL_FILESYSTEM)
-
-  if(SDL_TIMERS)
-    set(SDL_TIMER_UNIX 1)
-    file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
-    set(HAVE_SDL_TIMERS TRUE)
-  endif(SDL_TIMERS)
-
-  if(RPATH)
-    set(SDL_RLD_FLAGS "")
-    if(BSDI OR FREEBSD OR LINUX OR NETBSD)
-      set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
-    elseif(SOLARIS)
-      set(SDL_RLD_FLAGS "-R\${libdir}")
-    endif()
-    set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
-    set(HAVE_RPATH TRUE)
-  endif(RPATH)
-
-elseif(WINDOWS)
-  find_program(WINDRES windres)
-
-  check_c_source_compiles("
-    #include <windows.h>
-    int main(int argc, char **argv) { }" HAVE_WIN32_CC)
-
-  file(GLOB WIN_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${WIN_SOURCES})
-
-  # Check for DirectX
-  if(DIRECTX)
-    if("$ENV{DXSDK_DIR}" STREQUAL "")
-      message_error("DIRECTX requires the \$DXSDK_DIR environment variable to be set")
-    endif("$ENV{DXSDK_DIR}" STREQUAL "")
-    set(CMAKE_REQUIRED_FLAGS "/I\"$ENV{DXSDK_DIR}\\Include\"")
-    check_include_file(d3d9.h HAVE_D3D_H)
-    check_include_file(ddraw.h HAVE_DDRAW_H)
-    check_include_file(dsound.h HAVE_DSOUND_H)
-    check_include_file(dinput.h HAVE_DINPUT_H)
-    check_include_file(xaudio2.h HAVE_XAUDIO2_H)
-    if(HAVE_D3D_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
-      set(HAVE_DIRECTX TRUE)
-      # TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
-      link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH})
-      include_directories($ENV{DXSDK_DIR}\\Include)
-    endif()
-    set(CMAKE_REQUIRED_FLAGS)
-  endif(DIRECTX)
-
-  if(SDL_AUDIO)
-    set(SDL_AUDIO_DRIVER_WINMM 1)
-    file(GLOB WINMM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/winmm/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${WINMM_AUDIO_SOURCES})
-    set(HAVE_SDL_AUDIO TRUE)
-
-    if(HAVE_DSOUND_H)
-      set(SDL_AUDIO_DRIVER_DSOUND 1)
-      file(GLOB DSOUND_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/directsound/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES})
-    endif(HAVE_DSOUND_H)
-
-    if(HAVE_XAUDIO2_H)
-      set(SDL_AUDIO_DRIVER_XAUDIO2 1)
-      file(GLOB XAUDIO2_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/xaudio2/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${XAUDIO2_AUDIO_SOURCES})
-    endif(HAVE_XAUDIO2_H)
-  endif(SDL_AUDIO)
-
-  if(SDL_VIDEO)
-    # requires SDL_LOADSO on Windows (IME, DX, etc.)
-    if(NOT SDL_LOADSO)
-      message_error("SDL_VIDEO requires SDL_LOADSO, which is not enabled")
-    endif(NOT SDL_LOADSO)
-    set(SDL_VIDEO_DRIVER_WINDOWS 1)
-    file(GLOB WIN_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/windows/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${WIN_VIDEO_SOURCES})
-
-    if(RENDER_D3D AND HAVE_D3D_H)
-      set(SDL_VIDEO_RENDER_D3D 1)
-      set(HAVE_RENDER_D3D TRUE)
-    endif(RENDER_D3D AND HAVE_D3D_H)
-    set(HAVE_SDL_VIDEO TRUE)
-  endif(SDL_VIDEO)
-
-  if(SDL_THREADS)
-    set(SDL_THREAD_WINDOWS 1)
-    set(SOURCE_FILES ${SOURCE_FILES}
-      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c
-      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_syssem.c
-      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systhread.c
-      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systls.c
-      ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c)
-    set(HAVE_SDL_THREADS TRUE)
-  endif(SDL_THREADS)
-
-  if(SDL_POWER)
-    set(SDL_POWER_WINDOWS 1)
-    set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/power/windows/SDL_syspower.c)
-    set(HAVE_SDL_POWER TRUE)
-  endif(SDL_POWER)
-
-  if(SDL_FILESYSTEM)
-    set(SDL_FILESYSTEM_WINDOWS 1)
-    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesytem/windows/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
-    set(HAVE_SDL_FILESYSTEM TRUE)
-  endif(SDL_FILESYSTEM)
-
-  # Libraries for Win32 native and MinGW
-  list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)
-
-  # TODO: in configure.in the check for timers is set on
-  # cygwin | mingw32* - does this include mingw32CE?
-  if(SDL_TIMERS)
-    set(SDL_TIMER_WINDOWS 1)
-    file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/windows/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
-    set(HAVE_SDL_TIMERS TRUE)
-  endif(SDL_TIMERS)
-
-  if(SDL_LOADSO)
-    set(SDL_LOADSO_WINDOWS 1)
-    file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/windows/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
-    set(HAVE_SDL_LOADSO TRUE)
-  endif(SDL_LOADSO)
-
-  file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES})
-
-  if(SDL_VIDEO)
-    if(VIDEO_OPENGL)
-      set(SDL_VIDEO_OPENGL 1)
-      set(SDL_VIDEO_OPENGL_WGL 1)
-      set(SDL_VIDEO_RENDER_OGL 1)
-      set(HAVE_VIDEO_OPENGL TRUE)
-    endif(VIDEO_OPENGL)
-  endif(SDL_VIDEO)
-
-  if(SDL_JOYSTICK)
-    if(HAVE_DINPUT_H)
-      set(SDL_JOYSTICK_DINPUT 1)
-      set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/joystick/windows/SDL_dxjoystick.c)
-      list(APPEND EXTRA_LIBS dinput8 dxguid dxerr)
-    else()
-      set(SDL_JOYSTICK_WINMM 1)
-      set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/joystick/windows/SDL_mmjoystick.c)
-    endif(HAVE_DINPUT_H)
-    set(HAVE_SDL_JOYSTICK TRUE)
-  endif(SDL_JOYSTICK)
-
-  if(SDL_HAPTIC AND HAVE_DINPUT_H)
-    set(SDL_HAPTIC_DINPUT 1)
-    set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/haptic/windows/SDL_syshaptic.c)
-    set(HAVE_SDL_HAPTIC TRUE)
-  endif(SDL_HAPTIC AND HAVE_DINPUT_H)
-
-  file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc)
-  file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c)
-  if(MINGW OR CYGWIN)
-    list(APPEND EXTRA_LIBS mingw32)
-    list(APPEND EXTRA_LDFLAGS "-mwindows")
-    set(SDL_CFLAGS "${SDL_CFLAGS} -Dmain=SDL_main")
-    list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows")
-  endif(MINGW OR CYGWIN)
-elseif(APPLE)
-  # TODO: rework this for proper MacOS X, iOS and Darwin support
-
-  # Requires the darwin file implementation
-  if(SDL_FILE)
-    file(GLOB EXTRA_SOURCES ${PROJECT_SOURCE_DIR}/src/file/cocoa/*.m)
-    set(SOURCE_FILES ${EXTRA_SOURCES} ${SOURCE_FILES})
-    set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C)
-    set(HAVE_SDL_FILE TRUE)
-    set(SDL_FRAMEWORK_COCOA 1)
-  else()
-    message_error("SDL_FILE must be enabled to build on MacOS X")
-  endif()
-
-  if(SDL_AUDIO)
-    set(MACOSX_COREAUDIO 1)
-    file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES})
-    set(HAVE_SDL_AUDIO TRUE)
-    set(SDL_FRAMEWORK_COREAUDIO 1)
-    set(SDL_FRAMEWORK_AUDIOUNIT 1)
-  endif()
-
-  if(SDL_JOYSTICK)
-    set(SDL_JOYSTICK_IOKIT 1)
-    file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
-    set(HAVE_SDL_JOYSTICK TRUE)
-    set(SDL_FRAMEWORK_IOKIT 1)
-    set(SDL_FRAMEWORK_FF 1)
-  endif()
-
-  if(SDL_HAPTIC)
-    set(SDL_HAPTIC_IOKIT 1)
-    file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
-    set(HAVE_SDL_HAPTIC TRUE)
-    set(SDL_FRAMEWORK_IOKIT 1)
-    set(SDL_FRAMEWORK_FF 1)
-    if(NOT SDL_JOYSTICK)
-      message(FATAL_ERROR "SDL_HAPTIC requires SDL_JOYSTICK to be enabled")
-    endif()
-  endif()
-
-  if(SDL_POWER)
-    set(SDL_POWER_MACOSX 1)
-    file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
-    set(HAVE_SDL_POWER TRUE)
-    set(SDL_FRAMEWORK_CARBON 1)
-    set(SDL_FRAMEWORK_IOKIT 1)
-  endif()
-
-  if(SDL_FILESYSTEM)
-    set(SDL_FILESYSTEM_COCOA 1)
-    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/cocoa/*.m)
-    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
-    set(HAVE_SDL_FILESYSTEM TRUE)
-  endif()
-
-  # Actually load the frameworks at the end so we don't duplicate include.
-  if(SDL_FRAMEWORK_COCOA)
-    find_library(COCOA_LIBRARY Cocoa)
-    list(APPEND EXTRA_LIBS ${COCOA_LIBRARY})
-  endif()
-  if(SDL_FRAMEWORK_IOKIT)
-    find_library(IOKIT IOKit)
-    list(APPEND EXTRA_LIBS ${IOKIT})
-  endif()
-  if(SDL_FRAMEWORK_FF)
-    find_library(FORCEFEEDBACK ForceFeedback)
-    list(APPEND EXTRA_LIBS ${FORCEFEEDBACK})
-  endif()
-  if(SDL_FRAMEWORK_CARBON)
-    find_library(CARBON_LIBRARY Carbon)
-    list(APPEND EXTRA_LIBS ${CARBON_LIBRARY})
-  endif()
-  if(SDL_FRAMEWORK_COREAUDIO)
-    find_library(COREAUDIO CoreAudio)
-    list(APPEND EXTRA_LIBS ${COREAUDIO})
-  endif()
-  if(SDL_FRAMEWORK_AUDIOUNIT)
-    find_library(AUDIOUNIT AudioUnit)
-    list(APPEND EXTRA_LIBS ${AUDIOUNIT})
-  endif()
-
-  # iOS hack needed - http://code.google.com/p/ios-cmake/ ?
-  if(SDL_VIDEO)
-    CheckCOCOA()
-    if(VIDEO_OPENGL)
-      set(SDL_VIDEO_OPENGL 1)
-      set(SDL_VIDEO_OPENGL_CGL 1)
-      set(SDL_VIDEO_RENDER_OGL 1)
-      if(DARWIN)
-        find_library(OpenGL_LIBRARY OpenGL)
-        list(APPEND EXTRA_LIBRARIES ${OpenGL_LIBRARY})
-      endif(DARWIN)
-      set(HAVE_VIDEO_OPENGL TRUE)
-    endif(VIDEO_OPENGL)
-  endif(SDL_VIDEO)
-
-  CheckPTHREAD()
-elseif(BEOS)
-  if(SDL_VIDEO)
-    set(SDL_VIDEO_DRIVER_BWINDOW 1)
-    file(GLOB BWINDOW_SOURCES ${SDL2_SOURCE_DIR}/src/video/bwindow/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${BWINDOW_SOURCES})
-    set(HAVE_SDL_VIDEO TRUE)
-
-    set(SDL_FILESYSTEM_BEOS 1)
-    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/beos/*.cc)
-    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
-    set(HAVE_SDL_FILESYSTEM TRUE)
-
-    if(VIDEO_OPENGL)
-      # TODO: Use FIND_PACKAGE(OpenGL) instead
-      set(SDL_VIDEO_OPENGL 1)
-      set(SDL_VIDEO_OPENGL_BGL 1)
-      set(SDL_VIDEO_RENDER_OGL 1)
-      list(APPEND EXTRA_LIBS GL)
-      set(HAVE_VIDEO_OPENGL TRUE)
-    endif(VIDEO_OPENGL)
-  endif(SDL_VIDEO)
-endif()
-
-# Dummies
-# configure.in does it differently:
-# if not have X
-#   if enable_X {  SDL_X_DISABLED = 1 }
-#   [add dummy sources]
-# so it always adds a dummy, without checking, if it was actually requested.
-# This leads to missing internal references on building, since the
-# src/X/*.c does not get included.
-if(NOT HAVE_SDL_JOYSTICK)
-  set(SDL_JOYSTICK_DISABLED 1)
-  if(SDL_JOYSTICK AND NOT APPLE) # results in unresolved symbols on OSX
-
-    file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
-  endif()
-endif(NOT HAVE_SDL_JOYSTICK)
-if(NOT HAVE_SDL_HAPTIC)
-  set(SDL_HAPTIC_DISABLED 1)
-  file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
-endif(NOT HAVE_SDL_HAPTIC)
-if(NOT HAVE_SDL_LOADSO)
-  set(SDL_LOADSO_DISABLED 1)
-  file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
-endif(NOT HAVE_SDL_LOADSO)
-if(NOT HAVE_SDL_FILESYSTEM)
-  set(SDL_FILESYSTEM_DISABLED 1)
-  file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
-endif(NOT HAVE_SDL_FILESYSTEM)
-
-# We always need to have threads and timers around
-if(NOT HAVE_SDL_THREADS)
-  set(SDL_THREADS_DISABLED 1)
-  file(GLOB THREADS_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${THREADS_SOURCES})
-endif(NOT HAVE_SDL_THREADS)
-if(NOT HAVE_SDL_TIMERS)
-  set(SDL_TIMERS_DISABLED 1)
-  file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/dummy/*.c)
-  set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
-endif(NOT HAVE_SDL_TIMERS)
-
-if(NOT SDLMAIN_SOURCES)
-  file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/dummy/*.c)
-endif(NOT SDLMAIN_SOURCES)
-
-# Append the -MMD -MT flags
-# if(DEPENDENCY_TRACKING)
-#   if(COMPILER_IS_GNUCC)
-#     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MMD -MT \$@")
-#   endif(COMPILER_IS_GNUCC)
-# endif(DEPENDENCY_TRACKING)
-
-configure_file("${SDL2_SOURCE_DIR}/include/SDL_config.h.cmake"
-  "${SDL2_BINARY_DIR}/include/SDL_config.h")
-
-# Prepare the flags and remove duplicates
-if(EXTRA_LDFLAGS)
-  list(REMOVE_DUPLICATES EXTRA_LDFLAGS)
-endif(EXTRA_LDFLAGS)
-if(EXTRA_LIBS)
-  list(REMOVE_DUPLICATES EXTRA_LIBS)
-endif(EXTRA_LIBS)
-if(EXTRA_CFLAGS)
-  list(REMOVE_DUPLICATES EXTRA_CFLAGS)
-endif(EXTRA_CFLAGS)
-listtostr(EXTRA_CFLAGS _EXTRA_CFLAGS)
-set(EXTRA_CFLAGS ${_EXTRA_CFLAGS})
-
-# Compat helpers for the configuration files
-if(NOT WINDOWS OR CYGWIN)
-  # TODO: we need a Windows script, too
-  execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh)
-
-  set(prefix ${CMAKE_INSTALL_PREFIX})
-  set(exec_prefix "\${prefix}")
-  set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
-  set(bindir "\${exec_prefix}/bin")
-  set(includedir "\${prefix}/include")
-  if(SDL_STATIC)
-    set(ENABLE_STATIC_TRUE "")
-    set(ENABLE_STATIC_FALSE "#")
-  else(SDL_STATIC)
-    set(ENABLE_STATIC_TRUE "#")
-    set(ENABLE_STATIC_FALSE "")
-  endif(SDL_STATIC)
-  if(SDL_SHARED)
-    set(ENABLE_SHARED_TRUE "")
-    set(ENABLE_SHARED_FALSE "#")
-  else(SDL_SHARED)
-    set(ENABLE_SHARED_TRUE "#")
-    set(ENABLE_SHARED_FALSE "")
-  endif(SDL_SHARED)
-
-  # Clean up the different lists
-  listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
-  set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
-  list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
-  listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS)
-  set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS})
-  listtostr(SDL_LIBS _SDL_LIBS)
-  set(SDL_LIBS ${_SDL_LIBS})
-
-  # MESSAGE(STATUS "SDL_LIBS: ${SDL_LIBS}")
-  # MESSAGE(STATUS "SDL_STATIC_LIBS: ${SDL_STATIC_LIBS}")
-
-  configure_file("${SDL2_SOURCE_DIR}/sdl2.pc.in"
-    "${SDL2_BINARY_DIR}/sdl2.pc" @ONLY)
-  configure_file("${SDL2_SOURCE_DIR}/sdl2-config.in"
-    "${SDL2_BINARY_DIR}/sdl2-config")
-  configure_file("${SDL2_SOURCE_DIR}/sdl2-config.in"
-    "${SDL2_BINARY_DIR}/sdl2-config" @ONLY)
-  configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in"
-    "${SDL2_BINARY_DIR}/SDL2.spec" @ONLY)
-endif(NOT WINDOWS OR CYGWIN)
-
-##### Info output #####
-message(STATUS "")
-message(STATUS "SDL2 was configured with the following options:")
-message(STATUS "")
-message(STATUS "Platform: ${CMAKE_SYSTEM}")
-message(STATUS "64-bit:   ${ARCH_64}")
-message(STATUS "Compiler: ${CMAKE_C_COMPILER}")
-message(STATUS "")
-message(STATUS "Subsystems:")
-foreach(_SUB ${SDL_SUBSYSTEMS})
-  string(TOUPPER ${_SUB} _OPT)
-  message_bool_option(${_SUB} SDL_${_OPT})
-endforeach()
-message(STATUS "")
-message(STATUS "Options:")
-list(SORT ALLOPTIONS)
-foreach(_OPT ${ALLOPTIONS})
-  # Longest option is VIDEO_X11_XSCREENSAVER = 22 characters
-  # Get the padding
-  string(LENGTH ${_OPT} _OPTLEN)
-  math(EXPR _PADLEN "23 - ${_OPTLEN}")
-  string(RANDOM LENGTH ${_PADLEN} ALPHABET " " _PADDING)
-  message_tested_option(${_OPT} ${_PADDING})
-endforeach()
-message(STATUS "")
-message(STATUS " CFLAGS:        ${CMAKE_C_FLAGS}")
-message(STATUS " EXTRA_CFLAGS:  ${EXTRA_CFLAGS}")
-message(STATUS " EXTRA_LDFLAGS: ${EXTRA_LDFLAGS}")
-message(STATUS " EXTRA_LIBS:    ${EXTRA_LIBS}")
-message(STATUS "")
-message(STATUS " Build Shared Library: ${SDL_SHARED}")
-message(STATUS " Build Static Library: ${SDL_STATIC}")
-message(STATUS "")
-if(UNIX)
-  message(STATUS "Something was not detected, although your are sure that it")
-  message(STATUS "has been properly installed? Then make sure, you have set")
-  message(STATUS "the CFLAGS and LDFLAGS environment variables correctly.")
-  message(STATUS "")
-endif(UNIX)
-
-# Ensure that the extra cflags are used at compile time
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-
-# Always build SDLmain
-add_library(SDL2main STATIC ${SDLMAIN_SOURCES})
-set(_INSTALL_LIBS "SDL2main")
-
-if(SDL_SHARED)
-  add_library(SDL2 SHARED ${SOURCE_FILES})
-  if(UNIX)
-    set_target_properties(SDL2 PROPERTIES
-      VERSION ${LT_VERSION}
-      SOVERSION ${LT_CURRENT}
-      OUTPUT_NAME "SDL2-${LT_RELEASE}")
-  else(UNIX)
-    set_target_properties(SDL2 PROPERTIES
-      VERSION ${SDL_VERSION}
-      SOVERSION ${LT_CURRENT}
-      OUTPUT_NAME "SDL2")
-  endif(UNIX)
- set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
- target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
-endif(SDL_SHARED)
-
-if(SDL_STATIC)
-  add_library(SDL2-static STATIC ${SOURCE_FILES})
-  set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2")
-  # TODO: Win32 platforms keep the same suffix .lib for import and static
-  # libraries - do we need to consider this?
-  set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
-  target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
-endif(SDL_STATIC)
-
-##### Installation targets #####
-install(TARGETS ${_INSTALL_LIBS}
-  LIBRARY DESTINATION "lib${LIB_SUFFIX}"
-  ARCHIVE DESTINATION "lib${LIB_SUFFIX}")
-
-file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
-file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h)
-foreach(_FNAME ${BIN_INCLUDE_FILES})
-  get_filename_component(_INCNAME ${_FNAME} NAME)
-  list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME})
-endforeach()
-list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
-install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2)
-
-if(SDL_SHARED)
-  install(CODE "
-    execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
-    \"libSDL2-2.0.so\" \"libSDL2.so\")")
-  install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}")
-endif(SDL_SHARED)
-
-if(NOT WINDOWS OR CYGWIN)
-  if(FREEBSD)
-    # FreeBSD uses ${PREFIX}/libdata/pkgconfig
-    install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig")
-  else(FREEBSD)
-    install(FILES ${SDL2_BINARY_DIR}/sdl2.pc
-      DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
-  endif(FREEBSD)
-  install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin)
-  # TODO: what about the .spec file? Is it only needed for RPM creation?
-  install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal")
-endif(NOT WINDOWS OR CYGWIN)
diff --git a/deps/SDL2/COPYING.txt b/deps/SDL2/COPYING.txt
deleted file mode 100644
index 391424f..0000000
--- a/deps/SDL2/COPYING.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Simple DirectMedia Layer
-Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-  
-This software is provided 'as-is', without any express or implied
-warranty.  In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-  
-1. The origin of this software must not be misrepresented; you must not
-   claim that you wrote the original software. If you use this software
-   in a product, an acknowledgment in the product documentation would be
-   appreciated but is not required. 
-2. Altered source versions must be plainly marked as such, and must not be
-   misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
diff --git a/deps/SDL2/CREDITS.txt b/deps/SDL2/CREDITS.txt
deleted file mode 100644
index 74163e8..0000000
--- a/deps/SDL2/CREDITS.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-
-Simple DirectMedia Layer CREDITS
-Thanks to everyone who made this possible, including:
-
-* Cliff Matthews, for giving me a reason to start this project. :)
- -- Executor rocks!  *grin*
-
-* Ryan Gordon for helping everybody out and keeping the dream alive. :)
-
-* Gabriel Jacobo for his work on the Android port and generally helping out all around.
- 
-* Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
-
-* Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
-
-* Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
-
-* Alfred Reynolds for the game controller API and general (in)sanity
-
-* Jørgen Tjernø for numerous magical Mac OS X fixes.
-
-* Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
- 
-* Julian Winter for the SDL 2.0 website.
-
-* Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
-
-* Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
-
-* Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
-
-* Jim Grandpre for his work on multi-touch and gesture recognition during
-  the Google Summer of Code 2010.
-
-* Edgar "bobbens" Simo for his force feedback API development during the
-  Google Summer of Code 2008.
-
-* Aaron Wishnick for his work on audio resampling and pitch shifting during
-  the Google Summer of Code 2008.
-
-* Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
-  Google Summer of Code 2008.
-
-* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
-
-* Everybody at Loki Software, Inc. for their great contributions!
-
- And a big hand to everyone else who has contributed over the years.
-
-THANKS! :)
-
-  -- Sam Lantinga			<slouken at libsdl.org>
-
diff --git a/deps/SDL2/INSTALL.txt b/deps/SDL2/INSTALL.txt
deleted file mode 100644
index ce77664..0000000
--- a/deps/SDL2/INSTALL.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-
-To compile and install SDL:
-
-    1.  Windows with Visual Studio:
-        * Read VisualC.html
-
-        Windows with gcc, either native or cross-compiling:
-        * Read the FAQ at http://wiki.libsdl.org/moin.fcg/FAQWindows
-        * Run './configure; make; make install'
-
-        Mac OS X with Xcode:
-        * Read README-macosx.txt
-
-        Mac OS X from the command line:
-        * Run './configure; make; make install'
-
-        Linux and other UNIX systems:
-        * Run './configure; make; make install'
-
-        Android:
-        * Read README-android.txt
-
-        iOS:
-        * Read README-ios.txt
-
-        Using Cmake:
-        * Read README-cmake.txt
-
-    2.  Look at the example programs in ./test, and check out the online
-        documentation at http://wiki.libsdl.org/
-
-    3.  Join the SDL developer mailing list by sending E-mail to
-    	sdl-request at libsdl.org
-        and put "subscribe" in the subject of the message.
-
-        Or alternatively you can use the web interface:
-            http://www.libsdl.org/mailing-list.php
-
-That's it!
-Sam Lantinga <slouken at libsdl.org>
diff --git a/deps/SDL2/Makefile b/deps/SDL2/Makefile
deleted file mode 100644
index 4b304f3..0000000
--- a/deps/SDL2/Makefile
+++ /dev/null
@@ -1,572 +0,0 @@
-# Makefile to build and install the SDL library
-
-top_builddir = .
-srcdir  = /home/andy/dev/libgroove/deps/SDL2
-objects = build
-prefix = /home/andy/dev/libgroove/deps/SDL2/build
-exec_prefix = ${prefix}
-bindir	= ${exec_prefix}/bin
-libdir  = ${exec_prefix}/lib
-includedir = ${prefix}/include
-datarootdir = ${prefix}/share
-datadir	= ${datarootdir}
-auxdir	= build-scripts
-distpath = $(srcdir)/..
-distdir = SDL2-2.0.1
-distfile = $(distdir).tar.gz
-
-
-SHELL	= /bin/bash
-CC      = gcc
-INCLUDE = -Iinclude -I/home/andy/dev/libgroove/deps/SDL2/include
-CFLAGS  = -g -O3 -DUSING_GENERATED_CONFIG_H
-EXTRA_CFLAGS = -Iinclude -I/home/andy/dev/libgroove/deps/SDL2/include  -mmmx -m3dnow -msse -msse2 -fvisibility=hidden -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include   -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall
-LDFLAGS = 
-EXTRA_LDFLAGS =  -lm -ldl -lpthread -lrt
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-INSTALL = /usr/bin/install -c
-AR	= ar
-RANLIB	= ranlib
-WINDRES	= :
-
-TARGET  = libSDL2.la
-OBJECTS = $(objects)/SDL.lo $(objects)/SDL_assert.lo $(objects)/SDL_error.lo $(objects)/SDL_hints.lo $(objects)/SDL_log.lo $(objects)/SDL_atomic.lo $(objects)/SDL_spinlock.lo $(objects)/SDL_audio.lo $(objects)/SDL_audiocvt.lo $(objects)/SDL_audiodev.lo $(objects)/SDL_audiotypecvt.lo $(objects)/SDL_mixer.lo $(objects)/SDL_wave.lo $(objects)/SDL_cpuinfo.lo $(objects)/SDL_clipboardevents.lo $(objects)/SDL_dropevents.lo $(objects)/SDL_events.lo $(objects)/SDL_gesture.lo $(objects)/SDL_keyboard.lo $(objects)/SDL_mouse.lo $(objects)/SDL_quit.lo $(objects)/SDL_touch.lo $(objects)/SDL_windowevents.lo $(objects)/SDL_rwops.lo $(objects)/SDL_haptic.lo $(objects)/SDL_gamecontroller.lo $(objects)/SDL_joystick.lo $(objects)/e_atan2.lo $(objects)/e_log.lo $(objects)/e_pow.lo $(objects)/e_rem_pio2.lo $(objects)/e_sqrt.lo $(objects)/k_cos.lo $(objects)/k_rem_pio2.lo $(objects)/k_sin.lo $(objects)/s_atan.lo $(objects)/s_copysign.lo $(objects)/s_cos.lo $(objects)/s_fabs.lo $(objects)/s_floor.lo $(objects)/s_scalbn.lo $(objects)/s_sin.lo $(objects)/SDL_power.lo $(objects)/SDL_render.lo $(objects)/SDL_yuv_mmx.lo $(objects)/SDL_yuv_sw.lo $(objects)/SDL_render_d3d.lo $(objects)/SDL_render_gl.lo $(objects)/SDL_shaders_gl.lo $(objects)/SDL_render_gles.lo $(objects)/SDL_render_gles2.lo $(objects)/SDL_shaders_gles2.lo $(objects)/SDL_render_psp.lo $(objects)/SDL_blendfillrect.lo $(objects)/SDL_blendline.lo $(objects)/SDL_blendpoint.lo $(objects)/SDL_drawline.lo $(objects)/SDL_drawpoint.lo $(objects)/SDL_render_sw.lo $(objects)/SDL_rotate.lo $(objects)/SDL_getenv.lo $(objects)/SDL_iconv.lo $(objects)/SDL_malloc.lo $(objects)/SDL_qsort.lo $(objects)/SDL_stdlib.lo $(objects)/SDL_string.lo $(objects)/SDL_thread.lo $(objects)/SDL_timer.lo $(objects)/SDL_RLEaccel.lo $(objects)/SDL_blit.lo $(objects)/SDL_blit_0.lo $(objects)/SDL_blit_1.lo $(objects)/SDL_blit_A.lo $(objects)/SDL_blit_N.lo $(objects)/SDL_blit_auto.lo $(objects)/SDL_blit_copy.lo $(objects)/SDL_blit_slow.lo $(objects)/SDL_bmp.lo $(objects)/SDL_clipboard.lo $(objects)/SDL_egl.lo $(objects)/SDL_fillrect.lo $(objects)/SDL_pixels.lo $(objects)/SDL_rect.lo $(objects)/SDL_shape.lo $(objects)/SDL_stretch.lo $(objects)/SDL_surface.lo $(objects)/SDL_video.lo $(objects)/SDL_nullevents.lo $(objects)/SDL_nullframebuffer.lo $(objects)/SDL_nullvideo.lo $(objects)/SDL_diskaudio.lo $(objects)/SDL_dummyaudio.lo $(objects)/SDL_sysloadso.lo $(objects)/SDL_dspaudio.lo $(objects)/SDL_systhread.lo $(objects)/SDL_syssem.lo $(objects)/SDL_sysmutex.lo $(objects)/SDL_syscond.lo $(objects)/SDL_systls.lo $(objects)/SDL_sysfilesystem.lo $(objects)/SDL_evdev.lo $(objects)/SDL_sysjoystick.lo $(objects)/SDL_syshaptic.lo $(objects)/SDL_systimer.lo
-VERSION_OBJECTS = 
-
-SDLMAIN_TARGET = libSDL2main.a
-SDLMAIN_OBJECTS = $(objects)/SDL_dummy_main.o
-
-SDLTEST_TARGET = libSDL2_test.a
-SDLTEST_OBJECTS = $(objects)/SDL_test_assert.o $(objects)/SDL_test_common.o $(objects)/SDL_test_compare.o $(objects)/SDL_test_crc32.o $(objects)/SDL_test_font.o $(objects)/SDL_test_fuzzer.o $(objects)/SDL_test_harness.o $(objects)/SDL_test_imageBlit.o $(objects)/SDL_test_imageBlitBlend.o $(objects)/SDL_test_imageFace.o $(objects)/SDL_test_imagePrimitives.o $(objects)/SDL_test_imagePrimitivesBlend.o $(objects)/SDL_test_log.o $(objects)/SDL_test_md5.o $(objects)/SDL_test_random.o
-
-SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake configure configure.in debian include Makefile.* sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC Xcode Xcode-iOS
-GEN_DIST = SDL2.spec
-
-HDRS = \
-	SDL.h \
-	SDL_assert.h \
-	SDL_atomic.h \
-	SDL_audio.h \
-    SDL_bits.h \
-	SDL_blendmode.h \
-	SDL_clipboard.h \
-	SDL_cpuinfo.h \
-	SDL_endian.h \
-	SDL_error.h \
-	SDL_events.h \
-	SDL_filesystem.h \
-	SDL_gamecontroller.h \
-	SDL_gesture.h \
-	SDL_haptic.h \
-	SDL_hints.h \
-	SDL_joystick.h \
-	SDL_keyboard.h \
-	SDL_keycode.h \
-	SDL_loadso.h \
-	SDL_log.h \
-	SDL_main.h \
-	SDL_messagebox.h \
-	SDL_mouse.h \
-	SDL_mutex.h \
-	SDL_name.h \
-	SDL_opengl.h \
-	SDL_opengles.h \
-	SDL_opengles2.h \
-	SDL_pixels.h \
-	SDL_platform.h \
-	SDL_power.h \
-	SDL_quit.h \
-	SDL_rect.h \
-	SDL_render.h \
-	SDL_rwops.h \
-	SDL_scancode.h \
-	SDL_shape.h \
-	SDL_stdinc.h \
-	SDL_surface.h \
-	SDL_system.h \
-	SDL_syswm.h \
-	SDL_thread.h \
-	SDL_timer.h \
-	SDL_touch.h \
-	SDL_types.h \
-	SDL_version.h \
-	SDL_video.h \
-	begin_code.h \
-	close_code.h
-
-SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
-
-LT_AGE      = 1
-LT_CURRENT  = 1
-LT_RELEASE  = 2.0
-LT_REVISION = 0
-LT_LDFLAGS  = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-
-all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
-
-$(srcdir)/configure: $(srcdir)/configure.in
-	@echo "Warning, configure.in is out of date"
-	#(cd $(srcdir) && sh autogen.sh && sh configure)
-	@sleep 3
-
-Makefile: $(srcdir)/Makefile.in
-	$(SHELL) config.status $@
-
-Makefile.in:;
-
-$(objects):
-	$(SHELL) $(auxdir)/mkinstalldirs $@
-
-update-revision:
-	$(SHELL) $(auxdir)/updaterev.sh
-
-.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
-
-$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
-	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
-
-$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
-	$(AR) cru $@ $(SDLMAIN_OBJECTS)
-	$(RANLIB) $@
-
-$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
-	$(AR) cru $@ $(SDLTEST_OBJECTS)
-	$(RANLIB) $@
-
-install: all install-bin install-hdrs install-lib install-data
-install-bin:
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
-	$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
-install-hdrs: update-revision
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
-	for file in $(HDRS) $(SDLTEST_HDRS); do \
-	    $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
-	done
-	$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
-	if test -f include/SDL_revision.h; then \
-	    $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
-	else \
-	    $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
-	fi
-
-install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
-	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
-	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
-	$(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
-	$(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
-	$(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
-install-data:
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
-	$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
-	$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
-
-uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
-uninstall-bin:
-	rm -f $(DESTDIR)$(bindir)/sdl2-config
-uninstall-hdrs:
-	for file in $(HDRS) $(SDLTEST_HDRS); do \
-	    rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
-	done
-	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
-	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
-	-rmdir $(DESTDIR)$(includedir)/SDL2
-uninstall-lib:
-	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
-	rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
-	rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
-uninstall-data:
-	rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
-	rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
-
-clean:
-	rm -rf $(objects)
-	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
-
-distclean: clean
-	rm -f Makefile Makefile.rules sdl2-config
-	rm -f config.status config.cache config.log libtool
-	rm -rf $(srcdir)/autom4te*
-	find $(srcdir) \( \
-	    -name '*~' -o \
-	    -name '*.bak' -o \
-	    -name '*.old' -o \
-	    -name '*.rej' -o \
-	    -name '*.orig' -o \
-	    -name '.#*' \) \
-	    -exec rm -f {} \;
-	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
-
-dist $(distfile):
-	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
-	(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
-	tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
-	find $(distdir) \( \
-	    -name '*~' -o \
-	    -name '*.bak' -o \
-	    -name '*.old' -o \
-	    -name '*.rej' -o \
-	    -name '*.orig' -o \
-	    -name '.#*' \) \
-	    -exec rm -f {} \;
-	if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
-	(cd $(distdir); build-scripts/updaterev.sh)
-	tar cvf - $(distdir) | gzip --best >$(distfile)
-	rm -rf $(distdir)
-
-rpm: $(distfile)
-	rpmbuild -ta $?
-
-# Build rules for objects
--include $(OBJECTS:.lo=.d)
-
-# Special dependency for SDL.c, since it depends on SDL_revision.h
-/home/andy/dev/libgroove/deps/SDL2/src/SDL.c: update-revision
-
-$(objects)/SDL.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_assert.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL_assert.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_error.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL_error.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_hints.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL_hints.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_log.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL_log.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_atomic.lo: /home/andy/dev/libgroove/deps/SDL2/src/atomic/SDL_atomic.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_spinlock.lo: /home/andy/dev/libgroove/deps/SDL2/src/atomic/SDL_spinlock.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_audio.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_audio.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_audiocvt.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_audiocvt.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_audiodev.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_audiodev.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_audiotypecvt.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_audiotypecvt.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_mixer.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_mixer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_wave.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_wave.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_cpuinfo.lo: /home/andy/dev/libgroove/deps/SDL2/src/cpuinfo/SDL_cpuinfo.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_clipboardevents.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_clipboardevents.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_dropevents.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_dropevents.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_events.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_events.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_gesture.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_gesture.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_keyboard.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_keyboard.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_mouse.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_mouse.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_quit.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_quit.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_touch.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_touch.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_windowevents.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_windowevents.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_rwops.lo: /home/andy/dev/libgroove/deps/SDL2/src/file/SDL_rwops.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_haptic.lo: /home/andy/dev/libgroove/deps/SDL2/src/haptic/SDL_haptic.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_gamecontroller.lo: /home/andy/dev/libgroove/deps/SDL2/src/joystick/SDL_gamecontroller.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_joystick.lo: /home/andy/dev/libgroove/deps/SDL2/src/joystick/SDL_joystick.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_atan2.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_atan2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_log.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_log.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_pow.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_pow.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_rem_pio2.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_rem_pio2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_sqrt.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_sqrt.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/k_cos.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/k_cos.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/k_rem_pio2.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/k_rem_pio2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/k_sin.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/k_sin.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_atan.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_atan.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_copysign.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_copysign.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_cos.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_cos.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_fabs.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_fabs.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_floor.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_floor.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_scalbn.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_scalbn.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_sin.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_sin.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_power.lo: /home/andy/dev/libgroove/deps/SDL2/src/power/SDL_power.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/SDL_render.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_yuv_mmx.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/SDL_yuv_mmx.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_yuv_sw.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/SDL_yuv_sw.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_d3d.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/direct3d/SDL_render_d3d.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_gl.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengl/SDL_render_gl.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_shaders_gl.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengl/SDL_shaders_gl.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_gles.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengles/SDL_render_gles.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_gles2.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengles2/SDL_render_gles2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_shaders_gles2.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengles2/SDL_shaders_gles2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_psp.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/psp/SDL_render_psp.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blendfillrect.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_blendfillrect.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blendline.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_blendline.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blendpoint.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_blendpoint.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_drawline.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_drawline.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_drawpoint.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_drawpoint.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_sw.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_render_sw.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_rotate.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_rotate.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_getenv.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_getenv.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_iconv.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_iconv.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_malloc.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_malloc.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_qsort.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_qsort.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_stdlib.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_stdlib.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_string.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_string.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_thread.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/SDL_thread.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_timer.lo: /home/andy/dev/libgroove/deps/SDL2/src/timer/SDL_timer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_RLEaccel.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_RLEaccel.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_0.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_0.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_1.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_1.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_A.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_A.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_N.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_N.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_auto.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_auto.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_copy.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_copy.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_slow.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_slow.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_bmp.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_bmp.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_clipboard.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_clipboard.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_egl.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_egl.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_fillrect.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_fillrect.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_pixels.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_pixels.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_rect.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_rect.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_shape.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_shape.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_stretch.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_stretch.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_surface.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_surface.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_video.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_video.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_nullevents.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/dummy/SDL_nullevents.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_nullframebuffer.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/dummy/SDL_nullframebuffer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_nullvideo.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/dummy/SDL_nullvideo.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_diskaudio.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/disk/SDL_diskaudio.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_dummyaudio.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/dummy/SDL_dummyaudio.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_sysloadso.lo: /home/andy/dev/libgroove/deps/SDL2/src/loadso/dlopen/SDL_sysloadso.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_dspaudio.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/dsp/SDL_dspaudio.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_systhread.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_systhread.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_syssem.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_syssem.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_sysmutex.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_sysmutex.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_syscond.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_syscond.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_systls.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_systls.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_sysfilesystem.lo: /home/andy/dev/libgroove/deps/SDL2/src/filesystem/unix/SDL_sysfilesystem.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_evdev.lo: /home/andy/dev/libgroove/deps/SDL2/src/input/evdev/SDL_evdev.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_sysjoystick.lo: /home/andy/dev/libgroove/deps/SDL2/src/joystick/dummy/SDL_sysjoystick.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_syshaptic.lo: /home/andy/dev/libgroove/deps/SDL2/src/haptic/dummy/SDL_syshaptic.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_systimer.lo: /home/andy/dev/libgroove/deps/SDL2/src/timer/dummy/SDL_systimer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-
-$(objects)/SDL_dummy_main.o: /home/andy/dev/libgroove/deps/SDL2/src/main/dummy/SDL_dummy_main.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_test_assert.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_assert.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_common.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_common.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_compare.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_compare.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_crc32.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_crc32.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_font.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_font.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_fuzzer.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_fuzzer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_harness.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_harness.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imageBlit.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imageBlit.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imageBlitBlend.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imageBlitBlend.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imageFace.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imageFace.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imagePrimitives.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imagePrimitives.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imagePrimitivesBlend.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imagePrimitivesBlend.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_log.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_log.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_md5.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_md5.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_random.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_random.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
diff --git a/deps/SDL2/Makefile.in b/deps/SDL2/Makefile.in
deleted file mode 100644
index da42661..0000000
--- a/deps/SDL2/Makefile.in
+++ /dev/null
@@ -1,219 +0,0 @@
-# Makefile to build and install the SDL library
-
-top_builddir = .
-srcdir  = @srcdir@
-objects = build
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir	= @bindir@
-libdir  = @libdir@
-includedir = @includedir@
-datarootdir = @datarootdir@
-datadir	= @datadir@
-auxdir	= @ac_aux_dir@
-distpath = $(srcdir)/..
-distdir = SDL2- at SDL_VERSION@
-distfile = $(distdir).tar.gz
-
- at SET_MAKE@
-SHELL	= @SHELL@
-CC      = @CC@
-INCLUDE = @INCLUDE@
-CFLAGS  = @BUILD_CFLAGS@
-EXTRA_CFLAGS = @EXTRA_CFLAGS@
-LDFLAGS = @BUILD_LDFLAGS@
-EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
-LIBTOOL = @LIBTOOL@
-INSTALL = @INSTALL@
-AR	= @AR@
-RANLIB	= @RANLIB@
-WINDRES	= @WINDRES@
-
-TARGET  = libSDL2.la
-OBJECTS = @OBJECTS@
-VERSION_OBJECTS = @VERSION_OBJECTS@
-
-SDLMAIN_TARGET = libSDL2main.a
-SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
-
-SDLTEST_TARGET = libSDL2_test.a
-SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
-
-SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake configure configure.in debian include Makefile.* sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC Xcode Xcode-iOS
-GEN_DIST = SDL2.spec
-
-HDRS = \
-	SDL.h \
-	SDL_assert.h \
-	SDL_atomic.h \
-	SDL_audio.h \
-    SDL_bits.h \
-	SDL_blendmode.h \
-	SDL_clipboard.h \
-	SDL_cpuinfo.h \
-	SDL_endian.h \
-	SDL_error.h \
-	SDL_events.h \
-	SDL_filesystem.h \
-	SDL_gamecontroller.h \
-	SDL_gesture.h \
-	SDL_haptic.h \
-	SDL_hints.h \
-	SDL_joystick.h \
-	SDL_keyboard.h \
-	SDL_keycode.h \
-	SDL_loadso.h \
-	SDL_log.h \
-	SDL_main.h \
-	SDL_messagebox.h \
-	SDL_mouse.h \
-	SDL_mutex.h \
-	SDL_name.h \
-	SDL_opengl.h \
-	SDL_opengles.h \
-	SDL_opengles2.h \
-	SDL_pixels.h \
-	SDL_platform.h \
-	SDL_power.h \
-	SDL_quit.h \
-	SDL_rect.h \
-	SDL_render.h \
-	SDL_rwops.h \
-	SDL_scancode.h \
-	SDL_shape.h \
-	SDL_stdinc.h \
-	SDL_surface.h \
-	SDL_system.h \
-	SDL_syswm.h \
-	SDL_thread.h \
-	SDL_timer.h \
-	SDL_touch.h \
-	SDL_types.h \
-	SDL_version.h \
-	SDL_video.h \
-	begin_code.h \
-	close_code.h
-
-SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
-
-LT_AGE      = @LT_AGE@
-LT_CURRENT  = @LT_CURRENT@
-LT_RELEASE  = @LT_RELEASE@
-LT_REVISION = @LT_REVISION@
-LT_LDFLAGS  = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-
-all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
-
-$(srcdir)/configure: $(srcdir)/configure.in
-	@echo "Warning, configure.in is out of date"
-	#(cd $(srcdir) && sh autogen.sh && sh configure)
-	@sleep 3
-
-Makefile: $(srcdir)/Makefile.in
-	$(SHELL) config.status $@
-
-Makefile.in:;
-
-$(objects):
-	$(SHELL) $(auxdir)/mkinstalldirs $@
-
-update-revision:
-	$(SHELL) $(auxdir)/updaterev.sh
-
-.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
-
-$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
-	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
-
-$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
-	$(AR) cru $@ $(SDLMAIN_OBJECTS)
-	$(RANLIB) $@
-
-$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
-	$(AR) cru $@ $(SDLTEST_OBJECTS)
-	$(RANLIB) $@
-
-install: all install-bin install-hdrs install-lib install-data
-install-bin:
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
-	$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
-install-hdrs: update-revision
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
-	for file in $(HDRS) $(SDLTEST_HDRS); do \
-	    $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
-	done
-	$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
-	if test -f include/SDL_revision.h; then \
-	    $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
-	else \
-	    $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
-	fi
-
-install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
-	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
-	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
-	$(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
-	$(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
-	$(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
-install-data:
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
-	$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
-	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
-	$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
-
-uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
-uninstall-bin:
-	rm -f $(DESTDIR)$(bindir)/sdl2-config
-uninstall-hdrs:
-	for file in $(HDRS) $(SDLTEST_HDRS); do \
-	    rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
-	done
-	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
-	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
-	-rmdir $(DESTDIR)$(includedir)/SDL2
-uninstall-lib:
-	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
-	rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
-	rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
-uninstall-data:
-	rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
-	rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
-
-clean:
-	rm -rf $(objects)
-	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
-
-distclean: clean
-	rm -f Makefile Makefile.rules sdl2-config
-	rm -f config.status config.cache config.log libtool
-	rm -rf $(srcdir)/autom4te*
-	find $(srcdir) \( \
-	    -name '*~' -o \
-	    -name '*.bak' -o \
-	    -name '*.old' -o \
-	    -name '*.rej' -o \
-	    -name '*.orig' -o \
-	    -name '.#*' \) \
-	    -exec rm -f {} \;
-	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
-
-dist $(distfile):
-	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
-	(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
-	tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
-	find $(distdir) \( \
-	    -name '*~' -o \
-	    -name '*.bak' -o \
-	    -name '*.old' -o \
-	    -name '*.rej' -o \
-	    -name '*.orig' -o \
-	    -name '.#*' \) \
-	    -exec rm -f {} \;
-	if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
-	(cd $(distdir); build-scripts/updaterev.sh)
-	tar cvf - $(distdir) | gzip --best >$(distfile)
-	rm -rf $(distdir)
-
-rpm: $(distfile)
-	rpmbuild -ta $?
diff --git a/deps/SDL2/Makefile.minimal b/deps/SDL2/Makefile.minimal
deleted file mode 100644
index 6ec1ce8..0000000
--- a/deps/SDL2/Makefile.minimal
+++ /dev/null
@@ -1,42 +0,0 @@
-# Makefile to build the SDL library
-
-INCLUDE = -I./include
-CFLAGS  = -g -O2 $(INCLUDE)
-AR	= ar
-RANLIB	= ranlib
-
-TARGET  = libSDL.a
-SOURCES = \
-	src/*.c \
-	src/audio/*.c \
-	src/audio/dummy/*.c \
-	src/cpuinfo/*.c \
-	src/events/*.c \
-	src/file/*.c \
-	src/haptic/*.c \
-	src/haptic/dummy/*.c \
-	src/joystick/*.c \
-	src/joystick/dummy/*.c \
-	src/loadso/dummy/*.c \
-	src/power/*.c \
-	src/filesystem/dummy/*.c \
-	src/render/*.c \
-	src/render/software/*.c \
-	src/stdlib/*.c \
-	src/thread/*.c \
-	src/thread/generic/*.c \
-	src/timer/*.c \
-	src/timer/dummy/*.c \
-	src/video/*.c \
-	src/video/dummy/*.c \
-
-OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
-
-all: $(TARGET)
-
-$(TARGET): $(OBJECTS)
-	$(AR) crv $@ $^
-	$(RANLIB) $@
-
-clean:
-	rm -f $(TARGET) $(OBJECTS)
diff --git a/deps/SDL2/Makefile.pandora b/deps/SDL2/Makefile.pandora
deleted file mode 100644
index bb89d52..0000000
--- a/deps/SDL2/Makefile.pandora
+++ /dev/null
@@ -1,37 +0,0 @@
-# Makefile to build the pandora SDL library
-
-AR	= arm-none-linux-gnueabi-ar
-RANLIB	= arm-none-linux-gnueabi-ranlib
-CC = arm-none-linux-gnueabi-gcc
-CXX = arm-none-linux-gnueabi-g++
-STRIP = arm-none-linux-gnueabi-strip
-
-CFLAGS  = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp \
-	-mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \
-	-I./include -I$(PNDSDK)/usr/include -DSDL_REVISION=0
-
-TARGET  = libSDL.a
-
-SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
-	./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
-	./src/joystick/*.c ./src/haptic/*.c ./src/power/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
-	./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
-	./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
-	./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
-	./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
-	./src/atomic/linux/*.c ./src/filesystem/unix/*.c \
-	./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c 
-	
-
-OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
-
-CONFIG_H = $(shell cp include/SDL_config_pandora.h include/SDL_config.h && touch include/SDL_revision.h)
-
-all: $(TARGET)
-
-$(TARGET): $(CONFIG_H) $(OBJECTS)
-	$(AR) crv $@ $^
-	$(RANLIB) $@
-
-clean:
-	rm -f $(TARGET) $(OBJECTS)
diff --git a/deps/SDL2/Makefile.psp b/deps/SDL2/Makefile.psp
deleted file mode 100644
index 5e7dcd2..0000000
--- a/deps/SDL2/Makefile.psp
+++ /dev/null
@@ -1,92 +0,0 @@
-TARGET_LIB = libSDL2.a
-OBJS= src/SDL.o \
-      src/SDL_assert.o \
-      src/SDL_error.o \
-      src/SDL_hints.o \
-      src/SDL_log.o \
-      src/atomic/SDL_atomic.o \
-      src/atomic/SDL_spinlock.o \
-      src/audio/SDL_audio.o \
-      src/audio/SDL_audiocvt.o \
-      src/audio/SDL_audiodev.o \
-      src/audio/SDL_audiotypecvt.o \
-      src/audio/SDL_mixer.o \
-      src/audio/SDL_wave.o \
-      src/audio/psp/SDL_pspaudio.o \
-      src/cpuinfo/SDL_cpuinfo.o \
-      src/events/SDL_clipboardevents.o \
-      src/events/SDL_dropevents.o \
-      src/events/SDL_events.o \
-      src/events/SDL_gesture.o \
-      src/events/SDL_keyboard.o \
-      src/events/SDL_mouse.o \
-      src/events/SDL_quit.o \
-      src/events/SDL_touch.o \
-      src/events/SDL_windowevents.o \
-      src/file/SDL_rwops.o \
-      src/haptic/SDL_haptic.o \
-      src/haptic/dummy/SDL_syshaptic.o \
-      src/joystick/SDL_joystick.o \
-      src/joystick/SDL_gamecontroller.o \
-      src/joystick/psp/SDL_sysjoystick.o \
-      src/power/SDL_power.o \
-      src/power/psp/SDL_syspower.o \
-      src/filesystem/dummy/SDL_sysfilesystem.o \
-      src/render/SDL_render.o \
-      src/render/SDL_yuv_sw.o \
-      src/render/psp/SDL_render_psp.o \
-      src/render/software/SDL_blendfillrect.o \
-      src/render/software/SDL_blendline.o \
-      src/render/software/SDL_blendpoint.o \
-      src/render/software/SDL_drawline.o \
-      src/render/software/SDL_drawpoint.o \
-      src/render/software/SDL_render_sw.o \
-      src/render/software/SDL_rotate.o \
-      src/stdlib/SDL_getenv.o \
-      src/stdlib/SDL_iconv.o \
-      src/stdlib/SDL_malloc.o \
-      src/stdlib/SDL_qsort.o \
-      src/stdlib/SDL_stdlib.o \
-      src/stdlib/SDL_string.o \
-      src/thread/SDL_thread.o \
-      src/thread/psp/SDL_syssem.o \
-      src/thread/psp/SDL_systhread.o \
-      src/thread/psp/SDL_sysmutex.o \
-      src/thread/psp/SDL_syscond.o \
-      src/timer/SDL_timer.o \
-      src/timer/psp/SDL_systimer.o \
-      src/video/SDL_RLEaccel.o \
-      src/video/SDL_blit.o \
-      src/video/SDL_blit_0.o \
-      src/video/SDL_blit_1.o \
-      src/video/SDL_blit_A.o \
-      src/video/SDL_blit_N.o \
-      src/video/SDL_blit_auto.o \
-      src/video/SDL_blit_copy.o \
-      src/video/SDL_blit_slow.o \
-      src/video/SDL_bmp.o \
-      src/video/SDL_clipboard.o \
-      src/video/SDL_fillrect.o \
-      src/video/SDL_pixels.o \
-      src/video/SDL_rect.o \
-      src/video/SDL_stretch.o \
-      src/video/SDL_surface.o \
-      src/video/SDL_video.o \
-      src/video/psp/SDL_pspevents.o \
-      src/video/psp/SDL_pspvideo.o \
-      src/video/psp/SDL_pspgl.o \
-      src/video/psp/SDL_pspmouse.o \
-
-INCDIR = ./include
-CFLAGS = -g -O2 -G0 -Wall -D__PSP__ -DHAVE_OPENGL
-CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
-ASFLAGS = $(CFLAGS)
-
-LIBDIR  =
-LIBS = -lGL -lGLU -lglut -lz \
-         -lpspvfpu -lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgum -lpspgu -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-         -lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -lpspvram
-
-PSPSDK=$(shell psp-config --pspsdk-path)
-include $(PSPSDK)/lib/build.mak
-
diff --git a/deps/SDL2/Makefile.rules b/deps/SDL2/Makefile.rules
deleted file mode 100644
index b177cca..0000000
--- a/deps/SDL2/Makefile.rules
+++ /dev/null
@@ -1,353 +0,0 @@
-
-# Build rules for objects
--include $(OBJECTS:.lo=.d)
-
-# Special dependency for SDL.c, since it depends on SDL_revision.h
-/home/andy/dev/libgroove/deps/SDL2/src/SDL.c: update-revision
-
-$(objects)/SDL.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_assert.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL_assert.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_error.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL_error.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_hints.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL_hints.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_log.lo: /home/andy/dev/libgroove/deps/SDL2/src/SDL_log.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_atomic.lo: /home/andy/dev/libgroove/deps/SDL2/src/atomic/SDL_atomic.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_spinlock.lo: /home/andy/dev/libgroove/deps/SDL2/src/atomic/SDL_spinlock.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_audio.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_audio.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_audiocvt.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_audiocvt.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_audiodev.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_audiodev.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_audiotypecvt.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_audiotypecvt.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_mixer.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_mixer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_wave.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/SDL_wave.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_cpuinfo.lo: /home/andy/dev/libgroove/deps/SDL2/src/cpuinfo/SDL_cpuinfo.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_clipboardevents.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_clipboardevents.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_dropevents.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_dropevents.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_events.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_events.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_gesture.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_gesture.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_keyboard.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_keyboard.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_mouse.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_mouse.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_quit.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_quit.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_touch.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_touch.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_windowevents.lo: /home/andy/dev/libgroove/deps/SDL2/src/events/SDL_windowevents.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_rwops.lo: /home/andy/dev/libgroove/deps/SDL2/src/file/SDL_rwops.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_haptic.lo: /home/andy/dev/libgroove/deps/SDL2/src/haptic/SDL_haptic.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_gamecontroller.lo: /home/andy/dev/libgroove/deps/SDL2/src/joystick/SDL_gamecontroller.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_joystick.lo: /home/andy/dev/libgroove/deps/SDL2/src/joystick/SDL_joystick.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_atan2.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_atan2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_log.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_log.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_pow.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_pow.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_rem_pio2.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_rem_pio2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/e_sqrt.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/e_sqrt.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/k_cos.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/k_cos.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/k_rem_pio2.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/k_rem_pio2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/k_sin.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/k_sin.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_atan.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_atan.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_copysign.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_copysign.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_cos.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_cos.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_fabs.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_fabs.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_floor.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_floor.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_scalbn.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_scalbn.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/s_sin.lo: /home/andy/dev/libgroove/deps/SDL2/src/libm/s_sin.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_power.lo: /home/andy/dev/libgroove/deps/SDL2/src/power/SDL_power.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/SDL_render.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_yuv_mmx.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/SDL_yuv_mmx.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_yuv_sw.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/SDL_yuv_sw.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_d3d.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/direct3d/SDL_render_d3d.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_gl.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengl/SDL_render_gl.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_shaders_gl.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengl/SDL_shaders_gl.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_gles.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengles/SDL_render_gles.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_gles2.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengles2/SDL_render_gles2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_shaders_gles2.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/opengles2/SDL_shaders_gles2.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_psp.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/psp/SDL_render_psp.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blendfillrect.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_blendfillrect.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blendline.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_blendline.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blendpoint.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_blendpoint.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_drawline.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_drawline.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_drawpoint.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_drawpoint.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_render_sw.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_render_sw.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_rotate.lo: /home/andy/dev/libgroove/deps/SDL2/src/render/software/SDL_rotate.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_getenv.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_getenv.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_iconv.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_iconv.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_malloc.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_malloc.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_qsort.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_qsort.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_stdlib.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_stdlib.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_string.lo: /home/andy/dev/libgroove/deps/SDL2/src/stdlib/SDL_string.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_thread.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/SDL_thread.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_timer.lo: /home/andy/dev/libgroove/deps/SDL2/src/timer/SDL_timer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_RLEaccel.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_RLEaccel.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_0.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_0.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_1.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_1.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_A.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_A.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_N.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_N.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_auto.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_auto.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_copy.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_copy.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_blit_slow.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_blit_slow.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_bmp.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_bmp.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_clipboard.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_clipboard.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_egl.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_egl.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_fillrect.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_fillrect.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_pixels.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_pixels.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_rect.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_rect.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_shape.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_shape.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_stretch.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_stretch.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_surface.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_surface.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_video.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/SDL_video.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_nullevents.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/dummy/SDL_nullevents.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_nullframebuffer.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/dummy/SDL_nullframebuffer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_nullvideo.lo: /home/andy/dev/libgroove/deps/SDL2/src/video/dummy/SDL_nullvideo.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_diskaudio.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/disk/SDL_diskaudio.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_dummyaudio.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/dummy/SDL_dummyaudio.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_sysloadso.lo: /home/andy/dev/libgroove/deps/SDL2/src/loadso/dlopen/SDL_sysloadso.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_dspaudio.lo: /home/andy/dev/libgroove/deps/SDL2/src/audio/dsp/SDL_dspaudio.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_systhread.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_systhread.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_syssem.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_syssem.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_sysmutex.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_sysmutex.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_syscond.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_syscond.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_systls.lo: /home/andy/dev/libgroove/deps/SDL2/src/thread/pthread/SDL_systls.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_sysfilesystem.lo: /home/andy/dev/libgroove/deps/SDL2/src/filesystem/unix/SDL_sysfilesystem.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_evdev.lo: /home/andy/dev/libgroove/deps/SDL2/src/input/evdev/SDL_evdev.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_sysjoystick.lo: /home/andy/dev/libgroove/deps/SDL2/src/joystick/dummy/SDL_sysjoystick.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_syshaptic.lo: /home/andy/dev/libgroove/deps/SDL2/src/haptic/dummy/SDL_syshaptic.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_systimer.lo: /home/andy/dev/libgroove/deps/SDL2/src/timer/dummy/SDL_systimer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-
-$(objects)/SDL_dummy_main.o: /home/andy/dev/libgroove/deps/SDL2/src/main/dummy/SDL_dummy_main.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
-
-$(objects)/SDL_test_assert.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_assert.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_common.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_common.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_compare.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_compare.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_crc32.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_crc32.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_font.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_font.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_fuzzer.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_fuzzer.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_harness.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_harness.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imageBlit.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imageBlit.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imageBlitBlend.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imageBlitBlend.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imageFace.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imageFace.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imagePrimitives.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imagePrimitives.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_imagePrimitivesBlend.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_imagePrimitivesBlend.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_log.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_log.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_md5.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_md5.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ 
-$(objects)/SDL_test_random.o: /home/andy/dev/libgroove/deps/SDL2/src/test/SDL_test_random.c
-	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@
diff --git a/deps/SDL2/Makefile.wiz b/deps/SDL2/Makefile.wiz
deleted file mode 100644
index 82619f0..0000000
--- a/deps/SDL2/Makefile.wiz
+++ /dev/null
@@ -1,61 +0,0 @@
-# Makefile to build the pandora SDL library
-WIZSDK = /mythtv/media/devel/toolchains/openwiz/arm-openwiz-linux-gnu
-
-AR	= $(WIZSDK)/bin/arm-openwiz-linux-gnu-ar
-RANLIB	= $(WIZSDK)/bin/arm-openwiz-linux-gnu-ranlib
-CC = $(WIZSDK)/bin/arm-openwiz-linux-gnu-gcc
-CXX = $(WIZSDK)/bin/arm-openwiz-linux-gnu-g++
-STRIP = $(WIZSDK)/bin/arm-openwiz-linux-gnu-strip
-
-CFLAGS  = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE
-
-TARGET_STATIC  = libSDL13.a
-TARGET_SHARED  = libSDL13.so
-
-SOURCES = ./src/*.c ./src/audio/*.c ./src/cdrom/*.c ./src/cpuinfo/*.c ./src/events/*.c \
-	./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
-	./src/joystick/*.c ./src/haptic/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
-	./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
-	./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
-	./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
-	./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c ./src/cdrom/dummy/*.c \
-	./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o
-	
-
-OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
-
-all: config_copy $(TARGET_STATIC) $(TARGET_SHARED)
-
-$(TARGET_STATIC): $(OBJECTS)
-	$(AR) crv $@ $^
-	$(RANLIB) $@
-
-$(TARGET_SHARED):
-	$(CC) -shared -Wl,-soname,$(TARGET_SHARED).0 -o $(TARGET_SHARED).0.0.1  $(OBJECTS)
-	ln -s $(TARGET_SHARED).0.0.1 $(TARGET_SHARED).0
-	ln -s $(TARGET_SHARED).0 $(TARGET_SHARED)
-
-config_copy:
-	cp include/SDL_config_wiz.h include/SDL_config.h
-
-clean:
-	rm -f $(TARGET_STATIC) $(TARGET_SHARED)* $(OBJECTS)
-
-install:
-	mkdir -p $(WIZSDK)/lib
-	mkdir -p $(WIZSDK)/include/SDL13
-	cp -f $(TARGET_STATIC) $(WIZSDK)/lib
-	cp -f $(TARGET_SHARED).0.0.1 $(WIZSDK)/lib
-	rm -f $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
-	ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0.0.1 $(WIZSDK)/lib/$(TARGET_SHARED).0
-	ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
-
-	cp $(TARGET_STATIC) ../../toolchain/libs
-	cp $(TARGET_SHARED).0.0.1 ../../toolchain/libs
-	rm -f ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
-	ln -s ../../toolchain/libs/$(TARGET_SHARED).0.0.1 ../../toolchain/libs/$(TARGET_SHARED).0
-	ln -s ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
-
-	cp $(TARGET_SHARED).0.0.1 ../nehe_demos/build/$(TARGET_SHARED).0
-	cp -f include/*.h $(WIZSDK)/include/SDL13/
-	cp -f include/*.h ../../toolchain/include/SDL13/
diff --git a/deps/SDL2/README-SDL.txt b/deps/SDL2/README-SDL.txt
deleted file mode 100644
index 0630395..0000000
--- a/deps/SDL2/README-SDL.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-
-Please distribute this file with the SDL runtime environment:
-
-The Simple DirectMedia Layer (SDL for short) is a cross-platform library
-designed to make it easy to write multi-media software, such as games and
-emulators.
-
-The Simple DirectMedia Layer library source code is available from:
-http://www.libsdl.org/
-
-This library is distributed under the terms of the zlib license:
-http://www.zlib.net/zlib_license.html
-
diff --git a/deps/SDL2/README-android.txt b/deps/SDL2/README-android.txt
deleted file mode 100644
index a161c84..0000000
--- a/deps/SDL2/README-android.txt
+++ /dev/null
@@ -1,432 +0,0 @@
-================================================================================
-Simple DirectMedia Layer for Android
-================================================================================
-
-Requirements:
-
-Android SDK (version 10 or later)
-http://developer.android.com/sdk/index.html
-
-Android NDK r7 or later
-http://developer.android.com/sdk/ndk/index.html
-
-Minimum API level supported by SDL: 10 (Android 2.3.3)
-
-================================================================================
- How the port works
-================================================================================
-
-- Android applications are Java-based, optionally with parts written in C
-- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to 
-the SDL library
-- This means that your application C code must be placed inside an Android 
-Java project, along with some C support code that communicates with Java
-- This eventually produces a standard Android .apk package
-
-The Android Java code implements an "Activity" and can be found in:
-android-project/src/org/libsdl/app/SDLActivity.java
-
-The Java code loads your game code, the SDL shared library, and
-dispatches to native functions implemented in the SDL library:
-src/SDL_android.c
-
-Your project must include some glue code that starts your main() routine:
-src/main/android/SDL_android_main.c
-
-
-================================================================================
- Building an app
-================================================================================
-
-For simple projects you can use the script located at build-scripts/androidbuild.sh
-
-There's two ways of using it:
-
-androidbuild.sh com.yourcompany.yourapp < sources.list
-androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c
-
-sources.list should be a text file with a source file name in each line
-Filenames should be specified relative to the current directory, for example if
-you are in the build-scripts directory and want to create the testgles.c test, you'll
-run:
-    
-./androidbuild.sh org.libsdl.testgles ../test/testgles.c
-
-One limitation of this script is that all sources provided will be aggregated into
-a single directory, thus all your source files should have a unique name.
-
-Once the project is complete the script will tell you where the debug APK is located.
-If you want to create a signed release APK, you can use the project created by this
-utility to generate it.
-
-Finally, a word of caution: re running androidbuild.sh wipes any changes you may have
-done in the build directory for the app!
-
-
-For more complex projects, follow these instructions:
-    
-1. Copy the android-project directory wherever you want to keep your projects
-   and rename it to the name of your project.
-2. Move or symlink this SDL directory into the <project>/jni directory
-3. Edit <project>/jni/src/Android.mk to include your source files
-4. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
-
-If you want to use the Eclipse IDE, skip to the Eclipse section below.
-
-5. Create <project>/local.properties and use that to point to the Android SDK directory, by writing a line with the following form:
-sdk.dir=PATH_TO_ANDROID_SDK
-6. Run 'ant debug' in android/project. This compiles the .java and eventually 
-   creates a .apk with the native code embedded
-7. 'ant debug install' will push the apk to the device or emulator (if connected)
-
-Here's an explanation of the files in the Android project, so you can customize them:
-
-android-project/
-	AndroidManifest.xml	- package manifest. Among others, it contains the class name
-				  of the main Activity and the package name of the application.
-	build.properties	- empty
-	build.xml		- build description file, used by ant. The actual application name
-				  is specified here.
-	default.properties	- holds the target ABI for the application, android-10 and up
-	project.properties	- holds the target ABI for the application, android-10 and up
-	local.properties	- holds the SDK path, you should change this to the path to your SDK
-	jni/			- directory holding native code
-	jni/Android.mk		- Android makefile that can call recursively the Android.mk files
-				  in all subdirectories
-	jni/SDL/		- (symlink to) directory holding the SDL library files
-	jni/SDL/Android.mk	- Android makefile for creating the SDL shared library
-	jni/src/		- directory holding your C/C++ source
-	jni/src/Android.mk	- Android makefile that you should customize to include your 
-                                  source code and any library references
-	res/			- directory holding resources for your application
-	res/drawable-*		- directories holding icons for different phone hardware. Could be
-				  one dir called "drawable".
-	res/layout/main.xml	- Usually contains a file main.xml, which declares the screen layout.
-				  We don't need it because we use the SDL video output.
-	res/values/strings.xml	- strings used in your application, including the application name
-				  shown on the phone.
-	src/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding
-				  to SDL.  Be very careful changing this, as the SDL library relies
-				  on this implementation.
-
-
-================================================================================
- Build an app with static linking of libSDL
-================================================================================
-
-This build uses the Android NDK module system.
-
-Instructions:
-1. Copy the android-project directory wherever you want to keep your projects
-   and rename it to the name of your project.
-2. Rename <project>/jni/src/Android_static.mk to <project>/jni/src/Android.mk
-   (overwrite the existing one)
-3. Edit <project>/jni/src/Android.mk to include your source files
-4. create and export an environment variable named NDK_MODULE_PATH that points
-   to the parent directory of this SDL directory. e.g.:
-
-   export NDK_MODULE_PATH="$PWD"/..
-
-5. Edit <project>/src/org/libsdl/app/SDLActivity.java and remove the call to
-   System.loadLibrary("SDL2") line 42.
-6. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
-
-
-================================================================================
- Customizing your application name
-================================================================================
-
-To customize your application name, edit AndroidManifest.xml and replace
-"org.libsdl.app" with an identifier for your product package.
-
-Then create a Java class extending SDLActivity and place it in a directory
-under src matching your package, e.g.
-	src/com/gamemaker/game/MyGame.java
-
-Here's an example of a minimal class file:
---- MyGame.java --------------------------
-package com.gamemaker.game;
-
-import org.libsdl.app.SDLActivity; 
-
-/* 
- * A sample wrapper class that just calls SDLActivity 
- */ 
-
-public class MyGame extends SDLActivity { }
-
-------------------------------------------
-
-Then replace "SDLActivity" in AndroidManifest.xml with the name of your
-class, .e.g. "MyGame"
-
-================================================================================
- Customizing your application icon
-================================================================================
-
-Conceptually changing your icon is just replacing the "ic_launcher.png" files in
-the drawable directories under the res directory. There are four directories for
-different screen sizes. These can be replaced with one dir called "drawable",
-containing an icon file "ic_launcher.png" with dimensions 48x48 or 72x72.
-
-You may need to change the name of your icon in AndroidManifest.xml to match
-this icon filename.
-
-================================================================================
- Loading assets
-================================================================================
-
-Any files you put in the "assets" directory of your android-project directory
-will get bundled into the application package and you can load them using the
-standard functions in SDL_rwops.h.
-
-There are also a few Android specific functions that allow you to get other
-useful paths for saving and loading data:
-SDL_AndroidGetInternalStoragePath()
-SDL_AndroidGetExternalStorageState()
-SDL_AndroidGetExternalStoragePath()
-
-See SDL_system.h for more details on these functions.
-
-The asset packaging system will, by default, compress certain file extensions.
-SDL includes two asset file access mechanisms, the preferred one is the so
-called "File Descriptor" method, which is faster and doesn't involve the Dalvik
-GC, but given this method does not work on compressed assets, there is also the
-"Input Stream" method, which is automatically used as a fall back by SDL. You
-may want to keep this fact in mind when building your APK, specially when large
-files are involved.
-For more information on which extensions get compressed by default and how to
-disable this behaviour, see for example:
-    
-http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
-
-================================================================================
- Pause / Resume behaviour
-================================================================================
-
-If SDL is compiled with SDL_ANDROID_BLOCK_ON_PAUSE defined (the default),
-the event loop will block itself when the app is paused (ie, when the user
-returns to the main Android dashboard). Blocking is better in terms of battery
-use, and it allows your app to spring back to life instantaneously after resume
-(versus polling for a resume message).
-
-Upon resume, SDL will attempt to restore the GL context automatically.
-In modern devices (Android 3.0 and up) this will most likely succeed and your
-app can continue to operate as it was.
-
-However, there's a chance (on older hardware, or on systems under heavy load),
-where the GL context can not be restored. In that case you have to listen for
-a specific message, (which is not yet implemented!) and restore your textures
-manually or quit the app (which is actually the kind of behaviour you'll see
-under iOS, if the OS can not restore your GL context it will just kill your app)
-
-================================================================================
- Threads and the Java VM
-================================================================================
-
-For a quick tour on how Linux native threads interoperate with the Java VM, take
-a look here: http://developer.android.com/guide/practices/jni.html
-If you want to use threads in your SDL app, it's strongly recommended that you
-do so by creating them using SDL functions. This way, the required attach/detach
-handling is managed by SDL automagically. If you have threads created by other
-means and they make calls to SDL functions, make sure that you call
-Android_JNI_SetupThread before doing anything else otherwise SDL will attach
-your thread automatically anyway (when you make an SDL call), but it'll never
-detach it.
-
-================================================================================
- Using STL
-================================================================================
-
-You can use STL in your project by creating an Application.mk file in the jni
-folder and adding the following line:
-APP_STL := stlport_static
-
-For more information check out CPLUSPLUS-SUPPORT.html in the NDK documentation.
-
-================================================================================
- Additional documentation
-================================================================================
-
-The documentation in the NDK docs directory is very helpful in understanding the
-build process and how to work with native code on the Android platform.
-
-The best place to start is with docs/OVERVIEW.TXT
-
-
-================================================================================
- Using Eclipse
-================================================================================
-
-First make sure that you've installed Eclipse and the Android extensions as described here:
-	http://developer.android.com/sdk/eclipse-adt.html
-
-Once you've copied the SDL android project and customized it, you can create an Eclipse project from it:
- * File -> New -> Other
- * Select the Android -> Android Project wizard and click Next
- * Enter the name you'd like your project to have
- * Select "Create project from existing source" and browse for your project directory
- * Make sure the Build Target is set to Android 2.0
- * Click Finish
-
-
-================================================================================
- Using the emulator
-================================================================================
-
-There are some good tips and tricks for getting the most out of the
-emulator here: http://developer.android.com/tools/devices/emulator.html
-
-Especially useful is the info on setting up OpenGL ES 2.0 emulation.
-
-Notice that this software emulator is incredibly slow and needs a lot of disk space.
-Using a real device works better.
-
-================================================================================
- Troubleshooting
-================================================================================
-
-You can create and run an emulator from the Eclipse IDE:
- * Window -> Android SDK and AVD Manager
-
-You can see if adb can see any devices with the following command:
-	adb devices
-
-You can see the output of log messages on the default device with:
-	adb logcat
-
-You can push files to the device with:
-	adb push local_file remote_path_and_file
-
-You can push files to the SD Card at /sdcard, for example:
-	adb push moose.dat /sdcard/moose.dat
-
-You can see the files on the SD card with a shell command:
-	adb shell ls /sdcard/
-
-You can start a command shell on the default device with:
-	adb shell
-
-You can remove the library files of your project (and not the SDL lib files) with:
-	ndk-build clean
-
-You can do a build with the following command:
-	ndk-build
-
-You can see the complete command line that ndk-build is using by passing V=1 on the command line:
-	ndk-build V=1
-
-If your application crashes in native code, you can use addr2line to convert the
-addresses in the stack trace to lines in your code.
-
-For example, if your crash looks like this:
-I/DEBUG   (   31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0
-I/DEBUG   (   31):  r0 00000000  r1 00001000  r2 00000003  r3 400085d4
-I/DEBUG   (   31):  r4 400085d0  r5 40008000  r6 afd41504  r7 436c6a7c
-I/DEBUG   (   31):  r8 436c6b30  r9 435c6fb0  10 435c6f9c  fp 4168d82c
-I/DEBUG   (   31):  ip 8346aff0  sp 436c6a60  lr afd1c8ff  pc afd1c902  cpsr 60000030
-I/DEBUG   (   31):          #00  pc 0001c902  /system/lib/libc.so
-I/DEBUG   (   31):          #01  pc 0001ccf6  /system/lib/libc.so
-I/DEBUG   (   31):          #02  pc 000014bc  /data/data/org.libsdl.app/lib/libmain.so
-I/DEBUG   (   31):          #03  pc 00001506  /data/data/org.libsdl.app/lib/libmain.so
-
-You can see that there's a crash in the C library being called from the main code.
-I run addr2line with the debug version of my code:
-	arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so
-and then paste in the number after "pc" in the call stack, from the line that I care about:
-000014bc
-
-I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23.
-
-You can add logging to your code to help show what's happening:
-
-#include <android/log.h>
-
-	__android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x);
-
-If you need to build without optimization turned on, you can create a file called
-"Application.mk" in the jni directory, with the following line in it:
-APP_OPTIM := debug
-
-
-================================================================================
- Memory debugging
-================================================================================
-
-The best (and slowest) way to debug memory issues on Android is valgrind.
-Valgrind has support for Android out of the box, just grab code using:
-	svn co svn://svn.valgrind.org/valgrind/trunk valgrind
-... and follow the instructions in the file README.android to build it.
-
-One thing I needed to do on Mac OS X was change the path to the toolchain,
-and add ranlib to the environment variables:
-export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib
-
-Once valgrind is built, you can create a wrapper script to launch your
-application with it, changing org.libsdl.app to your package identifier:
---- start_valgrind_app -------------------
-#!/system/bin/sh
-export TMPDIR=/data/data/org.libsdl.app
-exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*
-------------------------------------------
-
-Then push it to the device:
-	adb push start_valgrind_app /data/local
-
-and make it executable:
-	adb shell chmod 755 /data/local/start_valgrind_app
-
-and tell Android to use the script to launch your application:
-	adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app"
-
-If the setprop command says "could not set property", it's likely that
-your package name is too long and you should make it shorter by changing
-AndroidManifest.xml and the path to your class file in android-project/src
-
-You can then launch your application normally and waaaaaaaiiittt for it.
-You can monitor the startup process with the logcat command above, and
-when it's done (or even while it's running) you can grab the valgrind
-output file:
-	adb pull /sdcard/valgrind.log
-
-When you're done instrumenting with valgrind, you can disable the wrapper:
-	adb shell setprop wrap.org.libsdl.app ""
-
-================================================================================
- Why is API level 10 the minimum required?
-================================================================================
-
-API level 10 is required because SDL requires some functionality for running not
-available on older devices and some for building which is not in older NDK/SDKs.
-
-Support for native OpenGL ES and ES2 applications was introduced in the NDK for
-API level 4 and 8. EGL was made a stable API in the NDK for API level 9, which
-has since then been obsoleted, with the recommendation to developers to bump the
-required API level to 10.
-As of this writing, according to http://developer.android.com/about/dashboards/index.html
-about 90% of the Android devices accessing Google Play support API level 10 or
-higher (March 2013).
-
-================================================================================
- A note regarding the use of the "dirty rectangles" rendering technique
-================================================================================
-
-If your app uses a variation of the "dirty rectangles" rendering technique,
-where you only update a portion of the screen on each frame, you may notice a
-variety of visual glitches on Android, that are not present on other platforms.
-This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2
-contexts, in particular the use of the eglSwapBuffers function. As stated in the
-documentation for the function "The contents of ancillary buffers are always 
-undefined after calling eglSwapBuffers".
-Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED
-is not possible for SDL as it requires EGL 1.4, available only on the API level
-17+, so the only workaround available on this platform is to redraw the entire
-screen each frame.
-
-Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
-
-================================================================================
- Known issues
-================================================================================
-
-- TODO. I'm sure there's a bunch more stuff I haven't thought of 
diff --git a/deps/SDL2/README-cmake.txt b/deps/SDL2/README-cmake.txt
deleted file mode 100644
index 63c762b..0000000
--- a/deps/SDL2/README-cmake.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-================================================================================
-CMake build system for SDL (www.cmake.org)
-================================================================================
-
-SDL's build system was traditionally based on autotools. Over time, this
-approach has suffered from several issues across the different supported 
-platforms.
-To solve these problems, a new build system based on CMake is under development.
-It works in parallel to the legacy system, so users can experiment with it
-without complication.
-While still experimental, the build system should be usable on the following
-platforms:
-    
-    * FreeBSD
-    * Linux
-    * VS.NET 2010
-    * MinGW and Msys
-    * OS X with support for XCode
-    
-================================================================================
-Usage
-================================================================================
-
-Assuming the source for SDL is located at ~/sdl
-
-cd ~
-mkdir build
-cd build
-cmake ../sdl
-
-This will build the static and dynamic versions of SDL in the ~/build directory.
diff --git a/deps/SDL2/README-directfb.txt b/deps/SDL2/README-directfb.txt
deleted file mode 100644
index e358278..0000000
--- a/deps/SDL2/README-directfb.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-SDL on DirectFB
-
-Supports:
-
-- Hardware YUV overlays
-- OpenGL - software only
-- 2D/3D accelerations (depends on directfb driver)
-- multiple displays
-- windows
-
-What you need:
-
-DirectFB 1.0.1, 1.2.x, 1.3.0
-Kernel-Framebuffer support: required: vesafb, radeonfb .... 
-Mesa 7.0.x	   - optional for OpenGL
-
-/etc/directfbrc
-
-This file should contain the following lines to make
-your joystick work and avoid crashes:
-------------------------
-disable-module=joystick
-disable-module=cle266
-disable-module=cyber5k
-no-linux-input-grab
-------------------------
-
-To disable to use x11 backend when DISPLAY variable is found use
-
-export SDL_DIRECTFB_X11_CHECK=0
-
-To disable the use of linux input devices, i.e. multimice/multikeyboard support,
-use
-
-export SDL_DIRECTFB_LINUX_INPUT=0
-
-To use hardware accelerated YUV-overlays for YUV-textures, use:
-
-export SDL_DIRECTFB_YUV_DIRECT=1
-
-This is disabled by default. It will only support one 
-YUV texture, namely the first. Every other YUV texture will be
-rendered in software.
-
-In addition, you may use (directfb-1.2.x)
-
-export SDL_DIRECTFB_YUV_UNDERLAY=1
-
-to make the YUV texture an underlay. This will make the cursor to
-be shown.
-
-Simple Window Manager
-=====================
-
-The driver has support for a very, very basic window manager you may
-want to use when running with "wm=default". Use
-
-export SDL_DIRECTFB_WM=1
-
-to enable basic window borders. In order to have the window title rendered,
-you need to have the following font installed:
-
-/usr/share/fonts/truetype/freefont/FreeSans.ttf
-
-OpenGL Support
-==============
-
-The following instructions will give you *software* OpenGL. However this
-works at least on all directfb supported platforms.
-
-As of this writing 20100802 you need to pull Mesa from git and do the following:
-
-------------------------
-git clone git://anongit.freedesktop.org/git/mesa/mesa
-cd mesa 
-git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
-------------------------
-
-Edit configs/linux-directfb so that the Directories-section looks like
-------------------------
-# Directories
-SRC_DIRS     = mesa glu 
-GLU_DIRS     = sgi
-DRIVER_DIRS  = directfb
-PROGRAM_DIRS = 
-------------------------
-
-make linux-directfb
-make
-
-echo Installing - please enter sudo pw.
-
-sudo make install INSTALL_DIR=/usr/local/dfb_GL
-cd src/mesa/drivers/directfb
-make
-sudo make install INSTALL_DIR=/usr/local/dfb_GL
-------------------------
-
-To run the SDL - testprograms:
-
-export SDL_VIDEODRIVER=directfb
-export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
-export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
-
-./testgl
-
diff --git a/deps/SDL2/README-gesture.txt b/deps/SDL2/README-gesture.txt
deleted file mode 100644
index 4d0a8d6..0000000
--- a/deps/SDL2/README-gesture.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-===========================================================================
-Dollar Gestures
-===========================================================================
-SDL Provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
-
-Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up. 
-
-Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
-
-Recording:
-----------
-To begin recording on a touch device call:
-SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices.
-
-Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event.
-A SDL_DOLLARRECORD event is a dgesture with the following fields:
-
-event.dgesture.touchId   - the Id of the touch used to record the gesture.
-event.dgesture.gestureId - the unique id of the recorded gesture.
-
-
-Performing:
------------
-As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
-
-event.dgesture.touchId    - the Id of the touch which performed the gesture.
-event.dgesture.gestureId  - the unique id of the closest gesture to the performed stroke.
-event.dgesture.error      - the difference between the gesture template and the actual performed gesture. Lower error is a better match.
-event.dgesture.numFingers - the number of fingers used to draw the stroke.
-
-Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed).
-
-
-
-Saving:
--------
-To save a template, call SDL_SaveDollarTemplate(gestureId, src) where gestureId is the id of the gesture you want to save, and src is an SDL_RWops pointer to the file where the gesture will be stored.
-
-To save all currently loaded templates, call SDL_SaveAllDollarTemplates(src) where source is an SDL_RWops pointer to the file where the gesture will be stored.
-
-Both functions return the number of gestures successfully saved.
-
-
-Loading:
---------
-To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file. 
-
-SDL_LoadDollarTemplates returns the number of templates successfully loaded.
-
-
-
-===========================================================================
-Multi Gestures
-===========================================================================
-SDL provides simple support for pinch/rotate/swipe gestures. 
-Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
-
-event.mgesture.touchId - the Id of the touch on which the gesture was performed.
-event.mgesture.x       - the normalized x coordinate of the gesture. (0..1)
-event.mgesture.y       - the normalized y coordinate of the gesture. (0..1)
-event.mgesture.dTheta  - the amount that the fingers rotated during this motion.
-event.mgesture.dDist   - the amount that the fingers pinched during this motion.
-event.mgesture.numFingers - the number of fingers used in the gesture.
-
-
-===========================================================================
-Notes
-===========================================================================
-For a complete example see test/testgesture.c
-
-Please direct questions/comments to:
-   jim.tla+sdl_touch at gmail.com
diff --git a/deps/SDL2/README-hg.txt b/deps/SDL2/README-hg.txt
deleted file mode 100644
index 32fb8f9..0000000
--- a/deps/SDL2/README-hg.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-The latest development version of SDL is available via Mercurial.
-Mercurial allows you to get up-to-the-minute fixes and enhancements;
-as a developer works on a source tree, you can use "hg" to mirror that
-source tree instead of waiting for an official release. Please look
-at the Mercurial website ( http://mercurial.selenic.com/ ) for more
-information on using hg, where you can also download software for
-Mac OS X, Windows, and Unix systems.
-
-  hg clone http://hg.libsdl.org/SDL
-
-If you are building SDL with an IDE, you will need to copy the file
-include/SDL_config.h.default to include/SDL_config.h before building.
-
-If you are building SDL via configure, you will need to run autogen.sh
-before running configure.
-
-There is a web interface to the subversion repository at:
-
-	http://hg.libsdl.org/SDL/
-
-There is an RSS feed available at that URL, for those that want to
-track commits in real time.
-
diff --git a/deps/SDL2/README-ios.txt b/deps/SDL2/README-ios.txt
deleted file mode 100644
index ee0a16d..0000000
--- a/deps/SDL2/README-ios.txt
+++ /dev/null
@@ -1,222 +0,0 @@
-==============================================================================
-Building the Simple DirectMedia Layer for iPhone OS 2.0
-==============================================================================
-
-Requirements: Mac OS X v10.5 or later and the iPhone SDK.
-
-Instructions:
-1.  Open SDL.xcodeproj (located in Xcode-iOS/SDL) in XCode.
-2.  Select your desired target, and hit build.
-
-There are three build targets:
-- libSDL.a:
-	Build SDL as a statically linked library
-- testsdl
-	Build a test program (there are known test failures which are fine)
-- Template:
-	Package a project template together with the SDL for iPhone static libraries and copies of the SDL headers.  The template includes proper references to the SDL library and headers, skeleton code for a basic SDL program, and placeholder graphics for the application icon and startup screen.
-
-==============================================================================
-Build SDL for iOS from the command line
-==============================================================================
-
-1. cd (PATH WHERE THE SDL CODE IS)/build-scripts
-2. ./iosbuild.sh
-
-If everything goes fine, you should see a build/ios directory, inside there's
-two directories "lib" and "include". 
-"include" contains a copy of the SDL headers that you'll need for your project,
-make sure to configure XCode to look for headers there.
-"lib" contains find two files, libSDL2.a and libSDL2main.a, you have to add both 
-to your XCode project. These libraries contain three architectures in them,
-armv6 for legacy devices, armv7, and i386 (for the simulator).
-By default, iosbuild.sh will autodetect the SDK version you have installed using 
-xcodebuild -showsdks, and build for iOS >= 3.0, you can override this behaviour 
-by setting the MIN_OS_VERSION variable, ie:
-
-MIN_OS_VERSION=4.2 ./iosbuild.sh
-
-==============================================================================
-Using the Simple DirectMedia Layer for iOS
-==============================================================================
-
-FIXME: This needs to be updated for the latest methods
-
-Here is the easiest method:
-1.  Build the SDL libraries (libSDL.a and libSDLSimulator.a) and the iPhone SDL Application template.
-1.  Install the iPhone SDL Application template by copying it to one of XCode's template directories.  I recommend creating a directory called "SDL" in "/Developer/Platforms/iOS.platform/Developer/Library/XCode/Project Templates/" and placing it there.
-2.  Start a new project using the template.  The project should be immediately ready for use with SDL.
-
-Here is a more manual method:
-1.  Create a new iPhone view based application.
-2.  Build the SDL static libraries (libSDL.a and libSDLSimulator.a) for iPhone and include them in your project.  XCode will ignore the library that is not currently of the correct architecture, hence your app will work both on iPhone and in the iPhone Simulator.
-3.  Include the SDL header files in your project.
-4.  Remove the ApplicationDelegate.h and ApplicationDelegate.m files -- SDL for iPhone provides its own UIApplicationDelegate.  Remove MainWindow.xib -- SDL for iPhone produces its user interface programmatically.
-5.  Delete the contents of main.m and program your app as a regular SDL program instead.  You may replace main.m with your own main.c, but you must tell XCode not to use the project prefix file, as it includes Objective-C code.
-
-==============================================================================
-Notes -- Application events
-==============================================================================
-
-On iOS the application goes through a fixed life cycle and you will get
-notifications of state changes via application events. When these events
-are delivered you must handle them in an event callback because the OS may
-not give you any processing time after the events are delivered.
-
-e.g.
-
-int HandleAppEvents(void *userdata, SDL_Event *event)
-{
-    switch (event->type)
-    {
-    case SDL_APP_TERMINATING:
-        /* Terminate the app.
-           Shut everything down before returning from this function.
-        */
-        return 0;
-    case SDL_APP_LOWMEMORY:
-        /* You will get this when your app is paused and iOS wants more memory.
-           Release as much memory as possible.
-        */
-        return 0;
-    case SDL_APP_WILLENTERBACKGROUND:
-        /* Prepare your app to go into the background.  Stop loops, etc.
-           This gets called when the user hits the home button, or gets a call.
-        */
-        return 0;
-    case SDL_APP_DIDENTERBACKGROUND:
-        /* This will get called if the user accepted whatever sent your app to the background.
-           If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops.
-           When you get this, you have 5 seconds to save all your state or the app will be terminated.
-           Your app is NOT active at this point.
-        */
-        return 0;
-    case SDL_APP_WILLENTERFOREGROUND:
-        /* This call happens when your app is coming back to the foreground.
-           Restore all your state here.
-        */
-        return 0;
-    case SDL_APP_DIDENTERFOREGROUND:
-        /* Restart your loops here.
-           Your app is interactive and getting CPU again.
-        */
-        return 0;
-    default:
-        /* No special processing, add it to the event queue */
-        return 1;
-    }
-}
-
-int main(int argc, char *argv[])
-{
-    SDL_SetEventFilter(HandleAppEvents, NULL);
-
-    ... run your main loop
-
-    return 0;
-}
-
-    
-==============================================================================
-Notes -- Accelerometer as Joystick
-==============================================================================
-
-SDL for iPhone supports polling the built in accelerometer as a joystick device.  For an example on how to do this, see the accelerometer.c in the demos directory.
-
-The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis reports joystick values as signed integers.  Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver.  To convert SDL_JoystickGetAxis reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
-
-==============================================================================
-Notes -- OpenGL ES
-==============================================================================
-
-Your SDL application for iPhone uses OpenGL ES for video by default.
-
-OpenGL ES for iPhone supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively.  By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute.
-
-If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
-
-Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 1.
-
-==============================================================================
-Notes -- Keyboard
-==============================================================================
-
-The SDL keyboard API has been extended to support on-screen keyboards:
-
-void SDL_StartTextInput()
-	-- enables text events and reveals the onscreen keyboard.
-void SDL_StopTextInput()
-	-- disables text events and hides the onscreen keyboard.
-SDL_bool SDL_IsTextInputActive()
-	-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
-
-==============================================================================
-Notes -- Reading and Writing files
-==============================================================================
-
-Each application installed on iPhone resides in a sandbox which includes its own Application Home directory.  Your application may not access files outside this directory.
-
-Once your application is installed its directory tree looks like:
-
-MySDLApp Home/
-	MySDLApp.app
-	Documents/
-	Library/
-		Preferences/
-	tmp/
-
-When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored.  You cannot write to this directory.  Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".  
-
-More information on this subject is available here:
-http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
-
-==============================================================================
-Notes -- iPhone SDL limitations
-==============================================================================
-
-Windows:
-	Full-size, single window applications only.  You cannot create multi-window SDL applications for iPhone OS.  The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow the flag SDL_WINDOW_BORDERLESS).
-
-Textures:
-	The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
-
-Loading Shared Objects:
-	This is disabled by default since it seems to break the terms of the iPhone SDK agreement.  It can be re-enabled in SDL_config_iphoneos.h.
-
-==============================================================================
-Game Center 
-==============================================================================
-
-Game Center integration requires that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
-    
-int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
-
-This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
-
-e.g.
-
-extern "C"
-void ShowFrame(void*)
-{
-    ... do event handling, frame logic and rendering
-}
-
-int main(int argc, char *argv[])
-{
-   ... initialize game ...
-
-#if __IPHONEOS__
-        // Initialize the Game Center for scoring and matchmaking
-        InitGameCenter();
-
-        // Set up the game to run in the window animation callback on iOS
-        // so that Game Center and so forth works correctly.
-        SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
-#else
-        while ( running ) {
-                ShowFrame(0);
-                DelayFrame();
-        }
-#endif
-        return 0;
-}
diff --git a/deps/SDL2/README-macosx.txt b/deps/SDL2/README-macosx.txt
deleted file mode 100644
index 021b140..0000000
--- a/deps/SDL2/README-macosx.txt
+++ /dev/null
@@ -1,222 +0,0 @@
-==============================================================================
-Using the Simple DirectMedia Layer with Mac OS X
-==============================================================================
-
-These instructions are for people using Apple's Mac OS X (pronounced
-"ten").
-
-From the developer's point of view, OS X is a sort of hybrid Mac and
-Unix system, and you have the option of using either traditional
-command line tools or Apple's IDE Xcode.
-
-To build SDL using the command line, use the standard configure and make
-process:
-
-	./configure
-	make
-	sudo make install
-
-You can also build SDL as a Universal library (a single binary for both
-PowerPC and Intel architectures), on Mac OS X 10.4 and newer, by using
-the fatbuild.sh script in build-scripts:
-	sh build-scripts/fatbuild.sh
-	sudo build-scripts/fatbuild.sh install
-This script builds SDL with 10.2 ABI compatibility on PowerPC and 10.4
-ABI compatibility on Intel architectures.  For best compatibility you
-should compile your application the same way.  A script which wraps
-gcc to make this easy is provided in test/gcc-fat.sh
-
-To use the library once it's built, you essential have two possibilities:
-use the traditional autoconf/automake/make method, or use Xcode.
-
-==============================================================================
-Caveats for using SDL with Mac OS X
-==============================================================================
-
-Some things you have to be aware of when using SDL on Mac OS X:
-
-- If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
-  SDL will not register its own. This means that SDL will not terminate using
-  SDL_Quit if it receives a termination request, it will terminate like a 
-  normal app, and it will not send a SDL_DROPFILE when you request to open a
-  file with the app. To solve these issues, put the following code in your 
-  NSApplicationDelegate implementation:
-
-  - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
-  {
-      if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) {
-          SDL_Event event;
-          event.type = SDL_QUIT;
-          SDL_PushEvent(&event);
-      }
-
-      return NSTerminateCancel;
-  }
-
-  - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
-  {
-      if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
-          SDL_Event event;
-          event.type = SDL_DROPFILE;
-          event.drop.file = SDL_strdup([filename UTF8String]);
-          return (SDL_PushEvent(&event) > 0);
-      }
-
-      return NO;
-  }
-
-==============================================================================
-Using the Simple DirectMedia Layer with a traditional Makefile
-==============================================================================
-
-An existing autoconf/automake build system for your SDL app has good chances
-to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary
-that you can distribute to users, you need to put the generated binary into a
-so called "bundle", which basically is a fancy folder with a name like
-"MyCoolGame.app".
-
-To get this build automatically, add something like the following rule to
-your Makefile.am:
-
-bundle_contents = APP_NAME.app/Contents
-APP_NAME_bundle: EXE_NAME
-	mkdir -p $(bundle_contents)/MacOS
-	mkdir -p $(bundle_contents)/Resources
-	echo "APPL????" > $(bundle_contents)/PkgInfo
-	$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
-
-You should replace EXE_NAME with the name of the executable. APP_NAME is what
-will be visible to the user in the Finder. Usually it will be the same
-as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME 
-usually is "TestGame". You might also want to use @PACKAGE@ to use the package
-name as specified in your configure.in file.
-
-If your project builds more than one application, you will have to do a bit
-more. For each of your target applications, you need a separate rule.
-
-If you want the created bundles to be installed, you may want to add this
-rule to your Makefile.am:
-
-install-exec-hook: APP_NAME_bundle
-	rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
-	mkdir -p $(DESTDIR)$(prefix)/Applications/
-	cp -r $< /$(DESTDIR)$(prefix)Applications/
-
-This rule takes the Bundle created by the rule from step 3 and installs them
-into $(DESTDIR)$(prefix)/Applications/.
-
-Again, if you want to install multiple applications, you will have to augment
-the make rule accordingly.
-
-
-But beware! That is only part of the story! With the above, you end up with
-a bare bone .app bundle, which is double clickable from the Finder. But
-there are some more things you should do before shipping your product...
-
-1) The bundle right now probably is dynamically linked against SDL. That 
-   means that when you copy it to another computer, *it will not run*,
-   unless you also install SDL on that other computer. A good solution
-   for this dilemma is to static link against SDL. On OS X, you can
-   achieve that by linking against the libraries listed by
-     sdl-config --static-libs
-   instead of those listed by
-     sdl-config --libs
-   Depending on how exactly SDL is integrated into your build systems, the
-   way to achieve that varies, so I won't describe it here in detail
-2) Add an 'Info.plist' to your application. That is a special XML file which
-   contains some meta-information about your application (like some copyright
-   information, the version of your app, the name of an optional icon file,
-   and other things). Part of that information is displayed by the Finder
-   when you click on the .app, or if you look at the "Get Info" window.
-   More information about Info.plist files can be found on Apple's homepage.
-
-
-As a final remark, let me add that I use some of the techniques (and some
-variations of them) in Exult and ScummVM; both are available in source on
-the net, so feel free to take a peek at them for inspiration!
-
-
-==============================================================================
-Using the Simple DirectMedia Layer with Xcode
-==============================================================================
-
-These instructions are for using Apple's Xcode IDE to build SDL applications.
-
-- First steps
-
-The first thing to do is to unpack the Xcode.tar.gz archive in the
-top level SDL directory (where the Xcode.tar.gz archive resides).
-Because Stuffit Expander will unpack the archive into a subdirectory,
-you should unpack the archive manually from the command line:
-	cd [path_to_SDL_source]
-	tar zxf Xcode.tar.gz
-This will create a new folder called Xcode, which you can browse
-normally from the Finder.
-
-- Building the Framework
-
-The SDL Library is packaged as a framework bundle, an organized
-relocatable folder hierarchy of executable code, interface headers,
-and additional resources. For practical purposes, you can think of a 
-framework as a more user and system-friendly shared library, whose library
-file behaves more or less like a standard UNIX shared library.
-
-To build the framework, simply open the framework project and build it. 
-By default, the framework bundle "SDL.framework" is installed in 
-/Library/Frameworks. Therefore, the testers and project stationary expect
-it to be located there. However, it will function the same in any of the
-following locations:
-
-    ~/Library/Frameworks
-    /Local/Library/Frameworks
-    /System/Library/Frameworks
-
-- Build Options
-    There are two "Build Styles" (See the "Targets" tab) for SDL.
-    "Deployment" should be used if you aren't tweaking the SDL library.
-    "Development" should be used to debug SDL apps or the library itself.
-
-- Building the Testers
-    Open the SDLTest project and build away!
-
-- Using the Project Stationary
-    Copy the stationary to the indicated folders to access it from
-    the "New Project" and "Add target" menus. What could be easier?
-
-- Setting up a new project by hand
-    Some of you won't want to use the Stationary so I'll give some tips:
-    * Create a new "Cocoa Application"
-    * Add src/main/macosx/SDLMain.m , .h and .nib to your project
-    * Remove "main.c" from your project
-    * Remove "MainMenu.nib" from your project
-    * Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
-    * Add "$(HOME)/Library/Frameworks" to the frameworks search path
-    * Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
-    * Set the "Main Nib File" under "Application Settings" to "SDLMain.nib"
-    * Add your files
-    * Clean and build
-
-- Building from command line
-    Use pbxbuild in the same directory as your .pbproj file
-
-- Running your app
-    You can send command line args to your app by either invoking it from
-    the command line (in *.app/Contents/MacOS) or by entering them in the
-    "Executables" panel of the target settings.
-    
-- Implementation Notes
-    Some things that may be of interest about how it all works...
-    * Working directory
-        As defined in the SDL_main.m file, the working directory of your SDL app
-        is by default set to its parent. You may wish to change this to better
-        suit your needs.
-    * You have a Cocoa App!
-        Your SDL app is essentially a Cocoa application. When your app
-        starts up and the libraries finish loading, a Cocoa procedure is called,
-        which sets up the working directory and calls your main() method.
-        You are free to modify your Cocoa app with generally no consequence 
-        to SDL. You cannot, however, easily change the SDL window itself.
-        Functionality may be added in the future to help this.
-
-
-Known bugs are listed in the file "BUGS"
diff --git a/deps/SDL2/README-pandora.txt b/deps/SDL2/README-pandora.txt
deleted file mode 100644
index f70ed67..0000000
--- a/deps/SDL2/README-pandora.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-SDL 2.0 with open pandora console support ( http://openpandora.org/ )
-=====================================================================
-
-- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
-support to work on the pandora under the framebuffer. This driver do not have
-input support for now, so if you use it you will have to add your own control code.
-The video driver name is "pandora" so if you have problem running it from
-the framebuffer, try to set the following variable before starting your application :
-"export SDL_VIDEODRIVER=pandora"
-
-- OpenGL ES support was added to the x11 driver, so it's working like the normal
-x11 driver one with OpenGLX support, with SDL input event's etc..
-
-
-David Carré (Cpasjuste)
-cpasjuste at gmail.com
diff --git a/deps/SDL2/README-platforms.txt b/deps/SDL2/README-platforms.txt
deleted file mode 100644
index f30c45a..0000000
--- a/deps/SDL2/README-platforms.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-
-This is a list of the platforms SDL supports, and who maintains them.
-
-Officially supported platforms
-==============================
-(code compiles, and thoroughly tested for release)
-==============================
-Windows XP/Vista/7/8
-Mac OS X 10.5+
-Linux 2.6+
-iOS 5.1.1+
-Android 2.3.3+
-
-Unofficially supported platforms
-================================
-(code compiles, but not thoroughly tested)
-================================
-FreeBSD
-NetBSD
-OpenBSD
-Solaris
-
-Platforms supported by volunteers
-=================================
-Haiku - maintained by Axel Dörfler <axeld at pinc-software.de>
-PSP - maintained by 527721088 at qq.com
-Pandora - maintained by Scott Smith <pickle136 at sbcglobal.net>
-
-Platforms that need maintainers
-===============================
diff --git a/deps/SDL2/README-porting.txt b/deps/SDL2/README-porting.txt
deleted file mode 100644
index bea194a..0000000
--- a/deps/SDL2/README-porting.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-
-* Porting To A New Platform
-
-  The first thing you have to do when porting to a new platform, is look at
-include/SDL_platform.h and create an entry there for your operating system.
-The standard format is __PLATFORM__, where PLATFORM is the name of the OS.
-Ideally SDL_platform.h will be able to auto-detect the system it's building
-on based on C preprocessor symbols.
-
-There are two basic ways of building SDL at the moment:
-
-1. The "UNIX" way:  ./configure; make; make install
-
-   If you have a GNUish system, then you might try this.  Edit configure.in,
-   take a look at the large section labelled:
-	"Set up the configuration based on the target platform!"
-   Add a section for your platform, and then re-run autogen.sh and build!
-
-2. Using an IDE:
-
-   If you're using an IDE or other non-configure build system, you'll probably
-   want to create a custom SDL_config.h for your platform.  Edit SDL_config.h,
-   add a section for your platform, and create a custom SDL_config_{platform}.h,
-   based on SDL_config.h.minimal and SDL_config.h.in
-
-   Add the top level include directory to the header search path, and then add
-   the following sources to the project:
-	src/*.c
-	src/atomic/*.c
-	src/audio/*.c
-	src/cpuinfo/*.c
-	src/events/*.c
-	src/file/*.c
-	src/haptic/*.c
-	src/joystick/*.c
-	src/power/*.c
-	src/render/*.c
-	src/stdlib/*.c
-	src/thread/*.c
-	src/timer/*.c
-	src/video/*.c
-	src/audio/disk/*.c
-	src/audio/dummy/*.c
-	src/video/dummy/*.c
-	src/haptic/dummy/*.c
-	src/joystick/dummy/*.c
-	src/main/dummy/*.c
-	src/thread/generic/*.c
-	src/timer/dummy/*.c
-	src/loadso/dummy/*.c
-
-
-Once you have a working library without any drivers, you can go back to each
-of the major subsystems and start implementing drivers for your platform.
-
-If you have any questions, don't hesitate to ask on the SDL mailing list:
-	http://www.libsdl.org/mailing-list.php
-
-Enjoy!
-	Sam Lantinga				(slouken at libsdl.org)
-
diff --git a/deps/SDL2/README-psp.txt b/deps/SDL2/README-psp.txt
deleted file mode 100644
index e9e32ea..0000000
--- a/deps/SDL2/README-psp.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-SDL port for the Sony PSP contributed by 
-   Captian Lex 
-
-Credit to
-   Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
-   Geecko for his PSP GU lib "Glib2d"
-
-Building
---------
-To build for the PSP, make sure psp-config is in the path and run:
-   make -f Makefile.psp
-
-
-
-To Do
-------
-PSP Screen Keyboard
diff --git a/deps/SDL2/README-raspberrypi.txt b/deps/SDL2/README-raspberrypi.txt
deleted file mode 100644
index 0724a8c..0000000
--- a/deps/SDL2/README-raspberrypi.txt
+++ /dev/null
@@ -1,155 +0,0 @@
-================================================================================
-SDL2 for Raspberry Pi
-================================================================================
-
-Requirements:
-
-Raspbian (other Linux distros may work as well).
-
-================================================================================
- Features
-================================================================================
-
-* Works without X11
-* Hardware accelerated OpenGL ES 2.x
-* Sound via ALSA
-* Input (mouse/keyboard/joystick) via EVDEV
-* Hotplugging of input devices via UDEV
-
-================================================================================
- Raspbian Build Dependencies
-================================================================================
-
-sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
-
-You also need the VideoCore binary stuff that ships in /opt/vc for EGL and 
-OpenGL ES 2.x, it usually comes pre installed, but in any case:
-    
-sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
-
-================================================================================
- Cross compiling from x86 Linux
-================================================================================
-
-To cross compile SDL for Raspbian from your desktop machine, you'll need a
-Raspbian system root and the cross compilation tools. We'll assume these tools
-will be placed in /opt/rpi-tools
-
-    sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
-
-You'll also need a Rasbian binary image.
-Get it from: http://downloads.raspberrypi.org/raspbian_latest 
-After unzipping, you'll get file with a name like: <date>-wheezy-raspbian.img
-Let's assume the sysroot will be built in /opt/rpi-sysroot.
-
-    export SYSROOT=/opt/rpi-sysroot
-    sudo kpartx -a -v <path_to_raspbian_image>.img
-    sudo mount -o loop /dev/mapper/loop0p2 /mnt
-    sudo cp -r /mnt $SYSROOT
-    sudo apt-get install qemu binfmt-support qemu-user-static
-    sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin
-    sudo mount --bind /dev $SYSROOT/dev
-    sudo mount --bind /proc $SYSROOT/proc
-    sudo mount --bind /sys $SYSROOT/sys
-
-Now, before chrooting into the ARM sysroot, you'll need to apply a workaround,
-edit $SYSROOT/etc/ld.so.preload and comment out all lines in it.
-
-    sudo chroot $SYSROOT
-    apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev
-    exit
-    sudo umount $SYSROOT/dev
-    sudo umount $SYSROOT/proc
-    sudo umount $SYSROOT/sys
-    sudo umount /mnt
-
-The final step is compiling SDL itself.
-
-    export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
-    cd <SDL SOURCE>
-    mkdir -p build;cd build
-    ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
-    make
-    make install
-
-To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
-    
-    perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
-    
-================================================================================
- Apps don't work or poor video/audio performance
-================================================================================
-
-If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to 
-update the RPi's firmware. Note that doing so will fix these problems, but it
-will also render the CMA - Dynamic Memory Split functionality useless.
-
-Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too
-low in general, specially if a 1080p TV is hooked up.
-
-See here how to configure this setting: http://elinux.org/RPiconfig
-
-Using a fixed gpu_mem=128 is the best option (specially if you updated the 
-firmware, using CMA probably won't work, at least it's the current case).
-
-================================================================================
- No input
-================================================================================
-
-Make sure you belong to the "input" group.
-
-    sudo usermod -aG input `whoami`
-
-================================================================================
- No HDMI Audio
-================================================================================
-
-If you notice that ALSA works but there's no audio over HDMI, try adding:
-    
-    hdmi_drive=2
-    
-to your config.txt file and reboot.
-
-Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
-
-================================================================================
- Text Input API support
-================================================================================
-
-The Text Input API is supported, with translation of scan codes done via the
-kernel symbol tables. For this to work, SDL needs access to a valid console.
-If you notice there's no SDL_TEXTINPUT message being emmited, double check that
-your app has read access to one of the following:
-    
-* /proc/self/fd/0
-* /dev/tty
-* /dev/tty[0...6]
-* /dev/vc/0
-* /dev/console
-
-This is usually not a problem if you run from the physical terminal (as opposed
-to running from a pseudo terminal, such as via SSH). If running from a PTS, a 
-quick workaround is to run your app as root or add yourself to the tty group,
-then re login to the system.
-
-   sudo usermod -aG tty `whoami`
-    
-The keyboard layout used by SDL is the same as the one the kernel uses.
-To configure the layout on Raspbian:
-    
-    sudo dpkg-reconfigure keyboard-configuration
-    
-To configure the locale, which controls which keys are interpreted as letters,
-this determining the CAPS LOCK behavior:
-
-    sudo dpkg-reconfigure locales
-
-================================================================================
- Notes
-================================================================================
-
-* When launching apps remotely (via SSH), SDL can prevent local keystrokes from
-  leaking into the console only if it has root privileges. Launching apps locally
-  does not suffer from this issue.
-  
-
diff --git a/deps/SDL2/README-touch.txt b/deps/SDL2/README-touch.txt
deleted file mode 100644
index 07823c9..0000000
--- a/deps/SDL2/README-touch.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-===========================================================================
-System Specific Notes
-===========================================================================
-Linux:
-The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch at gmail.com and I will help you get support for it.
-
-Mac:
-The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
-
-iPhone: 
-Works out of box.
-
-Windows:
-Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch at gmail.com
-
-===========================================================================
-Events
-===========================================================================
-SDL_FINGERDOWN:
-Sent when a finger (or stylus) is placed on a touch device.
-Fields:
-event.tfinger.touchId  - the Id of the touch device.
-event.tfinger.fingerId - the Id of the finger which just went down.
-event.tfinger.x        - the x coordinate of the touch (0..1)
-event.tfinger.y        - the y coordinate of the touch (0..1)
-event.tfinger.pressure - the pressure of the touch (0..1)
-
-SDL_FINGERMOTION:
-Sent when a finger (or stylus) is moved on the touch device.
-Fields:
-Same as SDL_FINGERDOWN but with additional:
-event.tfinger.dx       - change in x coordinate during this motion event.
-event.tfinger.dy       - change in y coordinate during this motion event.
-
-SDL_FINGERUP:
-Sent when a finger (or stylus) is lifted from the touch device.
-Fields:
-Same as SDL_FINGERDOWN.
-
-
-===========================================================================
-Functions
-===========================================================================
-SDL provides the ability to access the underlying Finger structures.
-These structures should _never_ be modified.
-
-The following functions are included from SDL_touch.h
-
-To get a SDL_TouchID call SDL_GetTouchDevice(index).
-This returns a SDL_TouchID.
-IMPORTANT: If the touch has been removed, or there is no touch with the given ID, SDL_GetTouchID will return 0. Be sure to check for this!
-
-The number of touch devices can be queried with SDL_GetNumTouchDevices().
-
-A SDL_TouchID may be used to get pointers to SDL_Finger.
-
-SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device.
-
-The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following:
-
-      float x = event.tfinger.x;
-      float y = event.tfinger.y;
-
-
-
-To get a SDL_Finger, call SDL_GetTouchFinger(touchID,index), where touchID is a SDL_TouchID, and index is the requested finger.
-This returns a SDL_Finger*, or NULL if the finger does not exist, or has been removed.
-A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled.
-As a result, be very careful to check for NULL return values.
-
-A SDL_Finger has the following fields:
->x,y,pressure:
-	The current coordinates of the touch.
->pressure:
-	The pressure of the touch.
-
-===========================================================================
-Notes
-===========================================================================
-For a complete example see test/testgesture.c
-
-Please direct questions/comments to:
-   jim.tla+sdl_touch at gmail.com
-   (original author, API was changed since)
diff --git a/deps/SDL2/README-wince.txt b/deps/SDL2/README-wince.txt
deleted file mode 100644
index eaacc49..0000000
--- a/deps/SDL2/README-wince.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-
-Windows CE is no longer supported by SDL.
-
-We have left the CE support in SDL 1.2 for those that must have it, and we
-will accept patches that support more modern Windows Mobile platforms for
-SDL 2.0.
-
---ryan.
-
diff --git a/deps/SDL2/README.txt b/deps/SDL2/README.txt
deleted file mode 100644
index 681f4a3..0000000
--- a/deps/SDL2/README.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-
-                         Simple DirectMedia Layer
-
-                                  (SDL)
-
-                                Version 2.0
-
----
-http://www.libsdl.org/
-
-Simple DirectMedia Layer is a cross-platform development library designed
-to provide low level access to audio, keyboard, mouse, joystick, and graphics
-hardware via OpenGL and Direct3D. It is used by video playback software,
-emulators, and popular games including Valve's award winning catalog
-and many Humble Bundle games.
-
-SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
-Support for other platforms may be found in the source code.
-
-SDL is written in C, works natively with C++, and there are bindings 
-available for several other languages, including C# and Python.
-
-This library is distributed under the zlib license, which can be found
-in the file "COPYING.txt".
-
-The best way to learn how to use SDL is to check out the header files in
-the "include" subdirectory and the programs in the "test" subdirectory.
-The header files and test programs are well commented and always up to date.
-More documentation and FAQs are available online at:
-	http://wiki.libsdl.org/
-
-If you need help with the library, or just want to discuss SDL related
-issues, you can join the developers mailing list:
-	http://www.libsdl.org/mailing-list.php
-
-Enjoy!
-	Sam Lantinga				(slouken at libsdl.org)
-
diff --git a/deps/SDL2/SDL2 b/deps/SDL2/SDL2
deleted file mode 120000
index dacffc6..0000000
--- a/deps/SDL2/SDL2
+++ /dev/null
@@ -1 +0,0 @@
-include/
\ No newline at end of file
diff --git a/deps/SDL2/SDL2.spec b/deps/SDL2/SDL2.spec
deleted file mode 100644
index 5aaa584..0000000
--- a/deps/SDL2/SDL2.spec
+++ /dev/null
@@ -1,112 +0,0 @@
-Summary: Simple DirectMedia Layer
-Name: SDL2
-Version: 2.0.1
-Release: 1
-Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
-URL: http://www.libsdl.org/
-License: zlib
-Group: System Environment/Libraries
-BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
-Prefix: %{_prefix}
-%ifos linux
-Provides: libSDL2-2.0.so.0
-%endif
-
-%define __defattr %defattr(-,root,root)
-%define __soext so
-
-%description
-This is the Simple DirectMedia Layer, a generic API that provides low
-level access to audio, keyboard, mouse, and display framebuffer across
-multiple platforms.
-
-%package devel
-Summary: Libraries, includes and more to develop SDL applications.
-Group: Development/Libraries
-Requires: %{name} = %{version}
-
-%description devel
-This is the Simple DirectMedia Layer, a generic API that provides low
-level access to audio, keyboard, mouse, and display framebuffer across
-multiple platforms.
-
-This is the libraries, include files and other resources you can use
-to develop SDL applications.
-
-
-%prep
-%setup -q 
-
-%build
-%ifos linux
-CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-directfb
-%else
-%configure
-%endif
-make
-
-%install
-rm -rf $RPM_BUILD_ROOT
-%ifos linux
-make install prefix=$RPM_BUILD_ROOT%{prefix} \
-             bindir=$RPM_BUILD_ROOT%{_bindir} \
-             libdir=$RPM_BUILD_ROOT%{_libdir} \
-             includedir=$RPM_BUILD_ROOT%{_includedir} \
-             datadir=$RPM_BUILD_ROOT%{_datadir} \
-             mandir=$RPM_BUILD_ROOT%{_mandir}
-%else
-%makeinstall
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%{__defattr}
-%doc README-SDL.txt COPYING.txt CREDITS.txt BUGS.txt
-%{_libdir}/lib*.%{__soext}.*
-
-%files devel
-%{__defattr}
-%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew
-%{_bindir}/*-config
-%{_libdir}/lib*.a
-%{_libdir}/lib*.la
-%{_libdir}/lib*.%{__soext}
-%{_includedir}/*/*.h
-%{_libdir}/pkgconfig/*
-%{_datadir}/aclocal/*
-
-%changelog
-* Sun Jan 22 2012 Sam Lantinga <slouken at libsdl.org>
-- Updated for SDL 2.0
-
-* Tue May 16 2006 Sam Lantinga <slouken at libsdl.org>
-- Removed support for Darwin, due to build problems on ps2linux
-
-* Mon Jan 03 2004 Anders Bjorklund <afb at algonet.se>
-- Added support for Darwin, updated spec file
-
-* Wed Jan 19 2000 Sam Lantinga <slouken at libsdl.org>
-- Re-integrated spec file into SDL distribution
-- 'name' and 'version' come from configure 
-- Some of the documentation is devel specific
-- Removed SMP support from %build - it doesn't work with libtool anyway
-
-* Tue Jan 18 2000 Hakan Tandogan <hakan at iconsult.com>
-- Hacked Mandrake sdl spec to build 1.1
-
-* Sun Dec 19 1999 John Buswell <johnb at mandrakesoft.com>
-- Build Release
-
-* Sat Dec 18 1999 John Buswell <johnb at mandrakesoft.com>
-- Add symlink for libSDL-1.0.so.0 required by sdlbomber
-- Added docs
-
-* Thu Dec 09 1999 Lenny Cartier <lenny at mandrakesoft.com>
-- v 1.0.0
-
-* Mon Nov  1 1999 Chmouel Boudjnah <chmouel at mandrakesoft.com>
-- First spec file for Mandrake distribution.
-
-# end of file
diff --git a/deps/SDL2/SDL2.spec.in b/deps/SDL2/SDL2.spec.in
deleted file mode 100644
index 2a5c479..0000000
--- a/deps/SDL2/SDL2.spec.in
+++ /dev/null
@@ -1,112 +0,0 @@
-Summary: Simple DirectMedia Layer
-Name: SDL2
-Version: @SDL_VERSION@
-Release: 1
-Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
-URL: http://www.libsdl.org/
-License: zlib
-Group: System Environment/Libraries
-BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
-Prefix: %{_prefix}
-%ifos linux
-Provides: libSDL2-2.0.so.0
-%endif
-
-%define __defattr %defattr(-,root,root)
-%define __soext so
-
-%description
-This is the Simple DirectMedia Layer, a generic API that provides low
-level access to audio, keyboard, mouse, and display framebuffer across
-multiple platforms.
-
-%package devel
-Summary: Libraries, includes and more to develop SDL applications.
-Group: Development/Libraries
-Requires: %{name} = %{version}
-
-%description devel
-This is the Simple DirectMedia Layer, a generic API that provides low
-level access to audio, keyboard, mouse, and display framebuffer across
-multiple platforms.
-
-This is the libraries, include files and other resources you can use
-to develop SDL applications.
-
-
-%prep
-%setup -q 
-
-%build
-%ifos linux
-CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-directfb
-%else
-%configure
-%endif
-make
-
-%install
-rm -rf $RPM_BUILD_ROOT
-%ifos linux
-make install prefix=$RPM_BUILD_ROOT%{prefix} \
-             bindir=$RPM_BUILD_ROOT%{_bindir} \
-             libdir=$RPM_BUILD_ROOT%{_libdir} \
-             includedir=$RPM_BUILD_ROOT%{_includedir} \
-             datadir=$RPM_BUILD_ROOT%{_datadir} \
-             mandir=$RPM_BUILD_ROOT%{_mandir}
-%else
-%makeinstall
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%{__defattr}
-%doc README-SDL.txt COPYING.txt CREDITS.txt BUGS.txt
-%{_libdir}/lib*.%{__soext}.*
-
-%files devel
-%{__defattr}
-%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew
-%{_bindir}/*-config
-%{_libdir}/lib*.a
-%{_libdir}/lib*.la
-%{_libdir}/lib*.%{__soext}
-%{_includedir}/*/*.h
-%{_libdir}/pkgconfig/*
-%{_datadir}/aclocal/*
-
-%changelog
-* Sun Jan 22 2012 Sam Lantinga <slouken at libsdl.org>
-- Updated for SDL 2.0
-
-* Tue May 16 2006 Sam Lantinga <slouken at libsdl.org>
-- Removed support for Darwin, due to build problems on ps2linux
-
-* Mon Jan 03 2004 Anders Bjorklund <afb at algonet.se>
-- Added support for Darwin, updated spec file
-
-* Wed Jan 19 2000 Sam Lantinga <slouken at libsdl.org>
-- Re-integrated spec file into SDL distribution
-- 'name' and 'version' come from configure 
-- Some of the documentation is devel specific
-- Removed SMP support from %build - it doesn't work with libtool anyway
-
-* Tue Jan 18 2000 Hakan Tandogan <hakan at iconsult.com>
-- Hacked Mandrake sdl spec to build 1.1
-
-* Sun Dec 19 1999 John Buswell <johnb at mandrakesoft.com>
-- Build Release
-
-* Sat Dec 18 1999 John Buswell <johnb at mandrakesoft.com>
-- Add symlink for libSDL-1.0.so.0 required by sdlbomber
-- Added docs
-
-* Thu Dec 09 1999 Lenny Cartier <lenny at mandrakesoft.com>
-- v 1.0.0
-
-* Mon Nov  1 1999 Chmouel Boudjnah <chmouel at mandrakesoft.com>
-- First spec file for Mandrake distribution.
-
-# end of file
diff --git a/deps/SDL2/TODO.txt b/deps/SDL2/TODO.txt
deleted file mode 100644
index 89637eb..0000000
--- a/deps/SDL2/TODO.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Future work roadmap:
- * http://wiki.libsdl.org/moin.cgi/Roadmap
-
- * Check 1.2 revisions:
-	3554 - Need to resolve semantics for locking keys on different platforms
-	4874 - Do we want screen rotation?  At what level?
-	4974 - Windows file code needs to convert UTF-8 to Unicode, but we don't need to tap dance for Windows 95/98
-	4865 - See if this is still needed (mouse coordinate clamping)
-	4866 - See if this is still needed (blocking window repositioning)
-
diff --git a/deps/SDL2/VisualC.html b/deps/SDL2/VisualC.html
deleted file mode 100644
index a25907b..0000000
--- a/deps/SDL2/VisualC.html
+++ /dev/null
@@ -1,148 +0,0 @@
-<HTML>
-	<HEAD>
-		<TITLE>Using SDL with Microsoft Visual C++</TITLE>
-	</HEAD>
-	<BODY>
-		<H1>
-			Using SDL with Microsoft Visual C++
-		</H1>
-		<H3>
-			by <A HREF="mailto:snowlion at sprynet.com">Lion Kimbro </A>and additions by <A HREF="mailto:james at conceptofzero.net">
-				James Turk</A>
-		</H3>
-		<p>
-			You can either use the precompiled libraries from <A HREF="http://www.libsdl.org/download.php"> the SDL Download web site </A>, or you can build SDL yourself.
-		</p>
-		<H3>
-			Building SDL
-		</H3>
-		<P>
-			Go into the VisualC directory and double-click on the Visual Studio solution for your version of Visual Studio, e.g. <CODE>SDL_VS2008.sln</CODE> This should open up the IDE.
-		</P>
-		<P>
-			There are different solution files for the various
-			versions of the IDE. Please use the appropiate version
-			2008, 2010 or 2012; the 2010EE and 2012EE files
-			should be used with the "Express Edition" releases.
-		</P>
-		<P>
-			Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
-		</P>
-		<P>
-			This is done by right clicking on each project in turn (Projects are listed in 
-			the Workspace panel in the FileView tab), and selecting "Build".
-		</P>
-		<P>
-			You may get a few warnings, but you should not get any errors. You do have to 
-			have at least the DirectX 9 SDK installed, however. The latest 
-			version of DirectX can be downloaded from <A HREF="http://www.microsoft.com">Microsoft</A>.
-		</P>
-		<P>
-			Later, we will refer to the following .lib and .dll files that have just been 
-			generated:
-		</P>
-		<ul>
-    <li> SDL2.dll</li>
-    <li> SDL2.lib</li>
-    <li> SDL2main.lib</li>
-    </ul>
-		<P>
-			Search for these using the Windows Find (Windows-F) utility inside the VisualC directory.
-		</P>
-		<H3>
-			Creating a Project with SDL
-		</H3>
-		<P>
-			Create a project as a Win32 Application.
-		</P>
-		<P>
-			Create a C++ file for your project.
-		</P>
-		<P>
-			Set the C runtime to "Multi-threaded DLL" in the menu: <CODE>Project|Settings|C/C++ 
-				tab|Code Generation|Runtime Library </CODE>.
-		</P>
-		<P>
-			Add the SDL <CODE>include</CODE> directory to your list of includes in the 
-			menu: <CODE>Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>
-			.
-			<br>
-			<STRONG><FONT color="#009900">VC7 Specific: Instead of doing this I find it easier to 
-					add the include and library directories to the list that VC7 keeps. Do this by 
-					selecting Tools|Options|Projects|VC++ Directories and under the "Show 
-					Directories For:" dropbox select "Include Files", and click the "New Directory 
-					Icon" and add the [SDLROOT]\include directory (e.g. If you installed to 
-					c:\SDL\ add c:\SDL\include). Proceed to change the 
-					dropbox selection to "Library Files" and add [SDLROOT]\lib.</FONT></STRONG>
-		</P>
-			<P>
-				The "include directory" I am referring to is the <CODE>include</CODE> folder 
-				within the main SDL directory (the one that this HTML file located within).
-			</P>
-			<P>
-				Now we're going to use the files that we had created earlier in the Build SDL 
-				step.
-			</P>
-			<P>
-				Copy the following files into your Project directory:
-			</P>
-			<ul>
-     <li> SDL2.dll</li>
-     </ul>
-			<P>
-				Add the following files to your project (It is not necessary to copy them to 
-				your project directory):
-			</P>
-			<ul>
-     <li> SDL2.lib </li>
-     <li> SDL2main.lib</li>
-     </ul>
-			<P>
-				(To add them to your project, right click on your project, and select "Add 
-				files to project")
-			</P>
-		<P><STRONG><FONT color="#009900">Instead of adding the files to your project it is more 
-					desireable to add them to the linker options: Project|Properties|Linker|Command 
-					Line and type the names of the libraries to link with in the "Additional 
-					Options:" box.  Note: This must be done for each build 
-					configuration (e.g. Release,Debug).</FONT></STRONG></P>
-		<H3>
-			SDL 101, First Day of Class
-		</H3>
-		<P>
-			Now create the basic body of your project. The body of your program should take 
-			the following form: <CODE>
-				<PRE>
-#include "SDL.h"
-
-int main( int argc, char* argv[] )
-{
-  // Body of the program goes here.
-  return 0;
-}
-</PRE>
-			</CODE>
-		<P></P>
-		<H3>
-			That's it!
-		</H3>
-		<P>
-			I hope that this document has helped you get through the most difficult part of 
-			using the SDL: installing it. Suggestions for improvements to this document 
-			should be sent to the writers of this document.
-		</P>
-		<P>
-			Thanks to Paulus Esterhazy (pesterhazy at gmx.net), for the work on VC++ port.
-		</P>
-		<P>
-			This document was originally called "VisualC.txt", and was written by <A HREF="mailto:slouken at libsdl.org">
-				Sam Lantinga</A>.
-		</P>
-		<P>
-			Later, it was converted to HTML and expanded into the document that you see 
-			today by <A HREF="mailto:snowlion at sprynet.com">Lion Kimbro</A>.
-		</P>
-		<P>Minor Fixes and Visual C++ 7 Information (In Green) was added by <A HREF="mailto:james at conceptofzero.net">James Turk</A>
-		</P>
-	</BODY>
-</HTML>
diff --git a/deps/SDL2/VisualC/SDL/SDL_VS2008.vcproj b/deps/SDL2/VisualC/SDL/SDL_VS2008.vcproj
deleted file mode 100644
index 1e7db21..0000000
--- a/deps/SDL2/VisualC/SDL/SDL_VS2008.vcproj
+++ /dev/null
@@ -1,1338 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="SDL2"
-	ProjectGUID="{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-	RootNamespace="SDL"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/SDL.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="_DEBUG;_WINDOWS"
-				ExceptionHandling="0"
-				RuntimeLibrary="3"
-				BufferSecurityCheck="false"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib imm32.lib version.lib"
-				IgnoreAllDefaultLibraries="true"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="3"
-				TypeLibraryName=".\Debug/SDL.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="_DEBUG;_WINDOWS"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib imm32.lib version.lib"
-				IgnoreAllDefaultLibraries="true"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/SDL.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				EnableIntrinsicFunctions="false"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="NDEBUG;_WINDOWS"
-				StringPooling="true"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				EnableFunctionLevelLinking="true"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib imm32.lib version.lib"
-				IgnoreAllDefaultLibraries="true"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|x64"
-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="2"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="3"
-				TypeLibraryName=".\Release/SDL.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				EnableIntrinsicFunctions="false"
-				AdditionalIncludeDirectories="..\..\include"
-				PreprocessorDefinitions="NDEBUG;_WINDOWS"
-				StringPooling="true"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				BufferSecurityCheck="false"
-				EnableFunctionLevelLinking="true"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="winmm.lib imm32.lib version.lib"
-				IgnoreAllDefaultLibraries="true"
-				GenerateDebugInformation="true"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="17"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="API Headers"
-			>
-			<File
-				RelativePath="..\..\include\SDL.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_assert.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_atomic.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_audio.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_bits.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_blendmode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_clipboard.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_config.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_config_windows.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_copying.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_cpuinfo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_endian.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_error.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_events.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_filesystem.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_gamecontroller.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_gesture.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_haptic.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_hints.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_joystick.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_keyboard.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_keycode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_loadso.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_log.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_main.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_messagebox.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_mouse.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_mutex.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_name.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_opengl.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_opengles.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_pixels.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_platform.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_power.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_quit.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_rect.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_render.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_revision.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_rwops.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_scancode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_shape.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_stdinc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_surface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_system.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_syswm.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_thread.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_timer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_touch.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_types.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_version.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_video.h"
-				>
-			</File>
-		</Filter>
-		<File
-			RelativePath="..\..\src\events\blank_cursor.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\default_cursor.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\directsound\directx.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\e_atan2.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\e_log.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\e_pow.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\e_rem_pio2.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\e_sqrt.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\k_cos.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\k_rem_pio2.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\k_sin.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\math.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\math_private.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\mmx.h"
-			>
-		</File>
-		<File
-			RelativePath=".\resource.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_atan.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_copysign.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_cos.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_fabs.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_floor.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_scalbn.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\libm\s_sin.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_assert.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\atomic\SDL_atomic.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audio.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audio_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiocvt.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiodev.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiodev_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiomem.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_audiotypecvt.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_blendfillrect.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_blendfillrect.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_blendline.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_blendline.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_blendpoint.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_blendpoint.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_0.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_1.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_A.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_auto.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_auto.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_copy.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_copy.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_N.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_slow.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_blit_slow.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_bmp.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_clipboard.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_clipboardevents.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_clipboardevents_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\cpuinfo\SDL_cpuinfo.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\directsound\SDL_directsound.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\directsound\SDL_directsound.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\disk\SDL_diskaudio.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\disk\SDL_diskaudio.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_draw.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_drawline.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_drawline.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_drawpoint.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_drawpoint.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_dropevents.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_dropevents_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\windows\SDL_dxjoystick.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_error.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_error_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_events.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_events_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_fillrect.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\SDL_gamecontroller.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_gesture.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_gesture_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_getenv.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_glesfuncs.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_glfuncs.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\haptic\SDL_haptic.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_hints.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_hints_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_iconv.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\SDL_joystick.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\SDL_joystick_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_keyboard.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_keyboard_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\SDL_log.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_malloc.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_mixer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\windows\SDL_mmjoystick.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_mouse.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_mouse_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullevents.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullevents_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullframebuffer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullframebuffer_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullvideo.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\dummy\SDL_nullvideo.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_pixels.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_pixels_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\power\SDL_power.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_qsort.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_quit.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_rect.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_rect_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\SDL_render.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\direct3d\SDL_render_d3d.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\opengl\SDL_render_gl.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_render_sw.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_render_sw_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_RLEaccel.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_RLEaccel_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_rotate.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\software\SDL_rotate.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\file\SDL_rwops.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\opengl\SDL_shaders_gl.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\opengl\SDL_shaders_gl.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_shape.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_shape_internals.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\atomic\SDL_spinlock.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_stdlib.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_stretch.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\stdlib\SDL_string.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_surface.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_sysaudio.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\generic\SDL_syscond.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_sysevents.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\filesystem\windows\SDL_sysfilesystem.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\haptic\windows\SDL_syshaptic.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\haptic\SDL_syshaptic.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\joystick\SDL_sysjoystick.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\loadso\windows\SDL_sysloadso.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\windows\SDL_sysmutex.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\power\windows\SDL_syspower.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\SDL_sysrender.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\windows\SDL_syssem.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\windows\SDL_systhread.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\windows\SDL_systls.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\SDL_systhread.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\windows\SDL_systhread_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\timer\windows\SDL_systimer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\timer\SDL_systimer.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_sysvideo.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\SDL_thread.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\thread\SDL_thread_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\timer\SDL_timer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\timer\SDL_timer_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_touch.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_touch_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\SDL_video.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_vkeys.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_wave.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\SDL_wave.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_windowevents.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_windowevents_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\core\windows\SDL_windows.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\core\windows\SDL_windows.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsclipboard.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsclipboard.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsevents.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsevents.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsframebuffer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsframebuffer.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowskeyboard.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowskeyboard.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsmessagebox.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsmessagebox.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsmodes.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsmodes.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsmouse.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsmouse.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsopengl.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsopengl.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsshape.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsshape.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsvideo.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowsvideo.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowswindow.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\SDL_windowswindow.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\winmm\SDL_winmm.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\winmm\SDL_winmm.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\audio\xaudio2\SDL_xaudio2.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\SDL_yuv_mmx.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\SDL_yuv_sw.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\render\SDL_yuv_sw_c.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\main\windows\version.rc"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\video\windows\wmmsg.h"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/SDL/SDL_VS2010.vcxproj b/deps/SDL2/VisualC/SDL/SDL_VS2010.vcxproj
deleted file mode 100644
index d9ca5af..0000000
--- a/deps/SDL2/VisualC/SDL/SDL_VS2010.vcxproj
+++ /dev/null
@@ -1,679 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug_static|Win32">
-      <Configuration>Debug_static</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug_static|x64">
-      <Configuration>Debug_static</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release_static|Win32">
-      <Configuration>Release_static</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release_static|x64">
-      <Configuration>Release_static</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>SDL2</ProjectName>
-    <ProjectGuid>{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}</ProjectGuid>
-    <RootNamespace>SDL</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_static|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_static|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_static|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_static|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_static|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_static|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_static|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_static|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_static|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_static|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_static|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_static|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release_static|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release_static|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release_static|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release_static|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug_static|Win32'">$(ProjectName)_static</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug_static|x64'">$(ProjectName)_static</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release_static|Win32'">$(ProjectName)_static</TargetName>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release_static|x64'">$(ProjectName)_static</TargetName>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PreBuildEvent />
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <CLRUnmanagedCodeCheck>false</CLRUnmanagedCodeCheck>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_static|Win32'">
-    <PreBuildEvent />
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>HAVE_LIBC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-      <OmitDefaultLibName>true</OmitDefaultLibName>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <CLRUnmanagedCodeCheck>false</CLRUnmanagedCodeCheck>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <CLRUnmanagedCodeCheck>false</CLRUnmanagedCodeCheck>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x64</AdditionalLibraryDirectories>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_static|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>HAVE_LIBC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <ExceptionHandling>false</ExceptionHandling>
-      <OmitDefaultLibName>true</OmitDefaultLibName>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <CLRUnmanagedCodeCheck>false</CLRUnmanagedCodeCheck>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x64</AdditionalLibraryDirectories>
-    </Link>
-    <Lib>
-      <AdditionalOptions>/MACHINE:X64 %(AdditionalOptions)</AdditionalOptions>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PreBuildEvent />
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <IntrinsicFunctions>false</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <SubSystem>Windows</SubSystem>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_static|Win32'">
-    <PreBuildEvent />
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <IntrinsicFunctions>false</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>HAVE_LIBC;_CRT_SECURE_NO_WARNINGS;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <OmitDefaultLibName>true</OmitDefaultLibName>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <SubSystem>Windows</SubSystem>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <IntrinsicFunctions>false</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <ExceptionHandling>false</ExceptionHandling>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <SubSystem>Windows</SubSystem>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x64</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_static|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <IntrinsicFunctions>false</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>HAVE_LIBC;_CRT_SECURE_NO_WARNINGS;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <ExceptionHandling>false</ExceptionHandling>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <OmitDefaultLibName>true</OmitDefaultLibName>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <SubSystem>Windows</SubSystem>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x64</AdditionalLibraryDirectories>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-    <Lib>
-      <AdditionalOptions>/MACHINE:X64 %(AdditionalOptions)</AdditionalOptions>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\SDL.h" />
-    <ClInclude Include="..\..\include\SDL_assert.h" />
-    <ClInclude Include="..\..\include\SDL_atomic.h" />
-    <ClInclude Include="..\..\include\SDL_audio.h" />
-    <ClInclude Include="..\..\include\SDL_bits.h" />
-    <ClInclude Include="..\..\include\SDL_blendmode.h" />
-    <ClInclude Include="..\..\include\SDL_clipboard.h" />
-    <ClInclude Include="..\..\include\SDL_config.h" />
-    <ClInclude Include="..\..\include\SDL_config_windows.h" />
-    <ClInclude Include="..\..\include\SDL_copying.h" />
-    <ClInclude Include="..\..\include\SDL_cpuinfo.h" />
-    <ClInclude Include="..\..\include\SDL_endian.h" />
-    <ClInclude Include="..\..\include\SDL_error.h" />
-    <ClInclude Include="..\..\include\SDL_events.h" />
-    <ClInclude Include="..\..\include\SDL_filesystem.h" />
-    <ClInclude Include="..\..\include\SDL_gesture.h" />
-    <ClInclude Include="..\..\include\SDL_haptic.h" />
-    <ClInclude Include="..\..\include\SDL_hints.h" />
-    <ClInclude Include="..\..\include\SDL_joystick.h" />
-    <ClInclude Include="..\..\include\SDL_gamecontroller.h" />
-    <ClInclude Include="..\..\include\SDL_keyboard.h" />
-    <ClInclude Include="..\..\include\SDL_keycode.h" />
-    <ClInclude Include="..\..\include\SDL_loadso.h" />
-    <ClInclude Include="..\..\include\SDL_log.h" />
-    <ClInclude Include="..\..\include\SDL_main.h" />
-    <ClInclude Include="..\..\include\SDL_mouse.h" />
-    <ClInclude Include="..\..\include\SDL_mutex.h" />
-    <ClInclude Include="..\..\include\SDL_name.h" />
-    <ClInclude Include="..\..\include\SDL_opengl.h" />
-    <ClInclude Include="..\..\include\SDL_opengles.h" />
-    <ClInclude Include="..\..\include\SDL_pixels.h" />
-    <ClInclude Include="..\..\include\SDL_platform.h" />
-    <ClInclude Include="..\..\include\SDL_power.h" />
-    <ClInclude Include="..\..\include\SDL_quit.h" />
-    <ClInclude Include="..\..\include\SDL_rect.h" />
-    <ClInclude Include="..\..\include\SDL_render.h" />
-    <ClInclude Include="..\..\include\SDL_revision.h" />
-    <ClInclude Include="..\..\include\SDL_rwops.h" />
-    <ClInclude Include="..\..\include\SDL_scancode.h" />
-    <ClInclude Include="..\..\include\SDL_shape.h" />
-    <ClInclude Include="..\..\include\SDL_stdinc.h" />
-    <ClInclude Include="..\..\include\SDL_surface.h" />
-    <ClInclude Include="..\..\include\SDL_system.h" />
-    <ClInclude Include="..\..\include\SDL_syswm.h" />
-    <ClInclude Include="..\..\include\SDL_thread.h" />
-    <ClInclude Include="..\..\include\SDL_timer.h" />
-    <ClInclude Include="..\..\include\SDL_touch.h" />
-    <ClInclude Include="..\..\include\SDL_types.h" />
-    <ClInclude Include="..\..\include\SDL_version.h" />
-    <ClInclude Include="..\..\include\SDL_video.h" />
-    <ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
-    <ClInclude Include="..\..\src\events\blank_cursor.h" />
-    <ClInclude Include="..\..\src\events\default_cursor.h" />
-    <ClInclude Include="..\..\src\audio\directsound\directx.h" />
-    <ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_gesture_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_touch_c.h" />
-    <ClInclude Include="..\..\src\libm\math.h" />
-    <ClInclude Include="..\..\src\libm\math_private.h" />
-    <ClInclude Include="..\..\src\render\mmx.h" />
-    <ClInclude Include="..\..\src\render\opengl\SDL_shaders_gl.h" />
-    <ClInclude Include="..\..\src\render\SDL_sysrender.h" />
-    <ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
-    <ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
-    <ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
-    <ClInclude Include="..\..\src\audio\SDL_audiomem.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_blendfillrect.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_blendline.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_blendpoint.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_draw.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_drawline.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_drawpoint.h" />
-    <ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_render_sw_c.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_rotate.h" />
-    <ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_blit.h" />
-    <ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
-    <ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
-    <ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
-    <ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
-    <ClInclude Include="..\..\src\audio\winmm\SDL_winmm.h" />
-    <ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
-    <ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
-    <ClInclude Include="..\..\src\audio\directsound\SDL_directsound.h" />
-    <ClInclude Include="..\..\src\SDL_error_c.h" />
-    <ClInclude Include="..\..\src\SDL_hints_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_events_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_glesfuncs.h" />
-    <ClInclude Include="..\..\src\video\SDL_glfuncs.h" />
-    <ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
-    <ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
-    <ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
-    <ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_rect_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_stretch_c.h" />
-    <ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
-    <ClInclude Include="..\..\src\events\SDL_sysevents.h" />
-    <ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
-    <ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
-    <ClInclude Include="..\..\src\thread\SDL_systhread.h" />
-    <ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
-    <ClInclude Include="..\..\src\timer\SDL_systimer.h" />
-    <ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
-    <ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
-    <ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_vkeys.h" />
-    <ClInclude Include="..\..\src\audio\SDL_wave.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
-    <ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
-    <ClInclude Include="..\..\src\video\windows\wmmsg.h" />
-    <ClInclude Include="resource.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
-    <ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
-    <ClCompile Include="..\..\src\events\SDL_gesture.c" />
-    <ClCompile Include="..\..\src\events\SDL_touch.c" />
-    <ClCompile Include="..\..\src\libm\e_atan2.c" />
-    <ClCompile Include="..\..\src\libm\e_log.c" />
-    <ClCompile Include="..\..\src\libm\e_pow.c" />
-    <ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
-    <ClCompile Include="..\..\src\libm\e_sqrt.c" />
-    <ClCompile Include="..\..\src\libm\k_cos.c" />
-    <ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
-    <ClCompile Include="..\..\src\libm\k_sin.c" />
-    <ClCompile Include="..\..\src\libm\s_atan.c" />
-    <ClCompile Include="..\..\src\libm\s_copysign.c" />
-    <ClCompile Include="..\..\src\libm\s_cos.c" />
-    <ClCompile Include="..\..\src\libm\s_fabs.c" />
-    <ClCompile Include="..\..\src\libm\s_floor.c" />
-    <ClCompile Include="..\..\src\libm\s_scalbn.c" />
-    <ClCompile Include="..\..\src\libm\s_sin.c" />
-    <ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
-    <ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
-    <ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
-    <ClCompile Include="..\..\src\render\SDL_render.c" />
-    <ClCompile Include="..\..\src\render\SDL_yuv_mmx.c" />
-    <ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_blendpoint.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_drawline.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_drawpoint.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_render_sw.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_rotate.c" />
-    <ClCompile Include="..\..\src\SDL.c" />
-    <ClCompile Include="..\..\src\SDL_assert.c" />
-    <ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
-    <ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
-    <ClCompile Include="..\..\src\audio\SDL_audio.c" />
-    <ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
-    <ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
-    <ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
-    <ClCompile Include="..\..\src\SDL_hints.c" />
-    <ClCompile Include="..\..\src\SDL_log.c" />
-    <ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_0.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_1.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_A.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_auto.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_copy.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_N.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_slow.c" />
-    <ClCompile Include="..\..\src\video\SDL_bmp.c" />
-    <ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
-    <ClCompile Include="..\..\src\video\SDL_clipboard.c" />
-    <ClCompile Include="..\..\src\video\SDL_shape.c" />
-    <ClCompile Include="..\..\src\audio\winmm\SDL_winmm.c" />
-    <ClCompile Include="..\..\src\audio\disk\SDL_diskaudio.c" />
-    <ClCompile Include="..\..\src\audio\dummy\SDL_dummyaudio.c" />
-    <ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
-    <ClCompile Include="..\..\src\events\SDL_dropevents.c" />
-    <ClCompile Include="..\..\src\audio\xaudio2\SDL_xaudio2.c" />
-    <ClCompile Include="..\..\src\joystick\windows\SDL_dxjoystick.c" />
-    <ClCompile Include="..\..\src\SDL_error.c" />
-    <ClCompile Include="..\..\src\events\SDL_events.c" />
-    <ClCompile Include="..\..\src\video\SDL_fillrect.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
-    <ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
-    <ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
-    <ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
-    <ClCompile Include="..\..\src\events\SDL_keyboard.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
-    <ClCompile Include="..\..\src\audio\SDL_mixer.c" />
-    <ClCompile Include="..\..\src\joystick\windows\SDL_mmjoystick.c" />
-    <ClCompile Include="..\..\src\events\SDL_mouse.c" />
-    <ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
-    <ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
-    <ClCompile Include="..\..\src\video\SDL_pixels.c" />
-    <ClCompile Include="..\..\src\power\SDL_power.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
-    <ClCompile Include="..\..\src\events\SDL_quit.c" />
-    <ClCompile Include="..\..\src\video\SDL_rect.c" />
-    <ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
-    <ClCompile Include="..\..\src\file\SDL_rwops.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
-    <ClCompile Include="..\..\src\video\SDL_stretch.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_string.c" />
-    <ClCompile Include="..\..\src\video\SDL_surface.c" />
-    <ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
-    <ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
-    <ClCompile Include="..\..\src\haptic\windows\SDL_syshaptic.c" />
-    <ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
-    <ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
-    <ClCompile Include="..\..\src\power\windows\SDL_syspower.c" />
-    <ClCompile Include="..\..\src\thread\windows\SDL_syssem.c" />
-    <ClCompile Include="..\..\src\thread\windows\SDL_systhread.c" />
-    <ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
-    <ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
-    <ClCompile Include="..\..\src\thread\SDL_thread.c" />
-    <ClCompile Include="..\..\src\timer\SDL_timer.c" />
-    <ClCompile Include="..\..\src\video\SDL_video.c" />
-    <ClCompile Include="..\..\src\audio\SDL_wave.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
-    <ClCompile Include="..\..\src\events\SDL_windowevents.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\main\windows\version.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/SDL/SDL_VS2012.vcxproj b/deps/SDL2/VisualC/SDL/SDL_VS2012.vcxproj
deleted file mode 100644
index 141bc64..0000000
--- a/deps/SDL2/VisualC/SDL/SDL_VS2012.vcxproj
+++ /dev/null
@@ -1,470 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>SDL2</ProjectName>
-    <ProjectGuid>{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}</ProjectGuid>
-    <RootNamespace>SDL</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PreBuildEvent />
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <CLRUnmanagedCodeCheck>false</CLRUnmanagedCodeCheck>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <CLRUnmanagedCodeCheck>false</CLRUnmanagedCodeCheck>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x64</AdditionalLibraryDirectories>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PreBuildEvent />
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <IntrinsicFunctions>false</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <SubSystem>Windows</SubSystem>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x86</AdditionalLibraryDirectories>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <IntrinsicFunctions>false</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include";</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <ExceptionHandling>false</ExceptionHandling>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
-      <SubSystem>Windows</SubSystem>
-      <AdditionalLibraryDirectories>$(DXSDK_DIR)\lib\x64</AdditionalLibraryDirectories>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\SDL.h" />
-    <ClInclude Include="..\..\include\SDL_assert.h" />
-    <ClInclude Include="..\..\include\SDL_atomic.h" />
-    <ClInclude Include="..\..\include\SDL_audio.h" />
-    <ClInclude Include="..\..\include\SDL_bits.h" />
-    <ClInclude Include="..\..\include\SDL_blendmode.h" />
-    <ClInclude Include="..\..\include\SDL_clipboard.h" />
-    <ClInclude Include="..\..\include\SDL_config.h" />
-    <ClInclude Include="..\..\include\SDL_config_windows.h" />
-    <ClInclude Include="..\..\include\SDL_copying.h" />
-    <ClInclude Include="..\..\include\SDL_cpuinfo.h" />
-    <ClInclude Include="..\..\include\SDL_endian.h" />
-    <ClInclude Include="..\..\include\SDL_error.h" />
-    <ClInclude Include="..\..\include\SDL_events.h" />
-    <ClInclude Include="..\..\include\SDL_filesystem.h" />
-    <ClInclude Include="..\..\include\SDL_gesture.h" />
-    <ClInclude Include="..\..\include\SDL_haptic.h" />
-    <ClInclude Include="..\..\include\SDL_hints.h" />
-    <ClInclude Include="..\..\include\SDL_joystick.h" />
-    <ClInclude Include="..\..\include\SDL_keyboard.h" />
-    <ClInclude Include="..\..\include\SDL_keycode.h" />
-    <ClInclude Include="..\..\include\SDL_loadso.h" />
-    <ClInclude Include="..\..\include\SDL_log.h" />
-    <ClInclude Include="..\..\include\SDL_main.h" />
-    <ClInclude Include="..\..\include\SDL_mouse.h" />
-    <ClInclude Include="..\..\include\SDL_mutex.h" />
-    <ClInclude Include="..\..\include\SDL_name.h" />
-    <ClInclude Include="..\..\include\SDL_opengl.h" />
-    <ClInclude Include="..\..\include\SDL_opengles.h" />
-    <ClInclude Include="..\..\include\SDL_pixels.h" />
-    <ClInclude Include="..\..\include\SDL_platform.h" />
-    <ClInclude Include="..\..\include\SDL_power.h" />
-    <ClInclude Include="..\..\include\SDL_quit.h" />
-    <ClInclude Include="..\..\include\SDL_rect.h" />
-    <ClInclude Include="..\..\include\SDL_render.h" />
-    <ClInclude Include="..\..\include\SDL_revision.h" />
-    <ClInclude Include="..\..\include\SDL_rwops.h" />
-    <ClInclude Include="..\..\include\SDL_scancode.h" />
-    <ClInclude Include="..\..\include\SDL_shape.h" />
-    <ClInclude Include="..\..\include\SDL_stdinc.h" />
-    <ClInclude Include="..\..\include\SDL_surface.h" />
-    <ClInclude Include="..\..\include\SDL_system.h" />
-    <ClInclude Include="..\..\include\SDL_syswm.h" />
-    <ClInclude Include="..\..\include\SDL_thread.h" />
-    <ClInclude Include="..\..\include\SDL_timer.h" />
-    <ClInclude Include="..\..\include\SDL_touch.h" />
-    <ClInclude Include="..\..\include\SDL_types.h" />
-    <ClInclude Include="..\..\include\SDL_version.h" />
-    <ClInclude Include="..\..\include\SDL_video.h" />
-    <ClInclude Include="..\..\include\SDL_gamecontroller.h" />
-    <ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
-    <ClInclude Include="..\..\src\events\blank_cursor.h" />
-    <ClInclude Include="..\..\src\events\default_cursor.h" />
-    <ClInclude Include="..\..\src\audio\directsound\directx.h" />
-    <ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_gesture_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_touch_c.h" />
-    <ClInclude Include="..\..\src\libm\math.h" />
-    <ClInclude Include="..\..\src\libm\math_private.h" />
-    <ClInclude Include="..\..\src\render\mmx.h" />
-    <ClInclude Include="..\..\src\render\opengl\SDL_shaders_gl.h" />
-    <ClInclude Include="..\..\src\render\SDL_sysrender.h" />
-    <ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
-    <ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
-    <ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
-    <ClInclude Include="..\..\src\audio\SDL_audiomem.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_blendfillrect.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_blendline.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_blendpoint.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_draw.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_drawline.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_drawpoint.h" />
-    <ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_render_sw_c.h" />
-    <ClInclude Include="..\..\src\render\software\SDL_rotate.h" />
-    <ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_blit.h" />
-    <ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
-    <ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
-    <ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
-    <ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
-    <ClInclude Include="..\..\src\audio\winmm\SDL_winmm.h" />
-    <ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
-    <ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
-    <ClInclude Include="..\..\src\audio\directsound\SDL_directsound.h" />
-    <ClInclude Include="..\..\src\SDL_error_c.h" />
-    <ClInclude Include="..\..\src\SDL_hints_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_events_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_glesfuncs.h" />
-    <ClInclude Include="..\..\src\video\SDL_glfuncs.h" />
-    <ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
-    <ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
-    <ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
-    <ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
-    <ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_rect_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
-    <ClInclude Include="..\..\src\video\SDL_stretch_c.h" />
-    <ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
-    <ClInclude Include="..\..\src\events\SDL_sysevents.h" />
-    <ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
-    <ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
-    <ClInclude Include="..\..\src\thread\SDL_systhread.h" />
-    <ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
-    <ClInclude Include="..\..\src\timer\SDL_systimer.h" />
-    <ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
-    <ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
-    <ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_vkeys.h" />
-    <ClInclude Include="..\..\src\audio\SDL_wave.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
-    <ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
-    <ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
-    <ClInclude Include="..\..\src\video\windows\wmmsg.h" />
-    <ClInclude Include="resource.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
-    <ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
-    <ClCompile Include="..\..\src\events\SDL_gesture.c" />
-    <ClCompile Include="..\..\src\events\SDL_touch.c" />
-    <ClCompile Include="..\..\src\libm\e_atan2.c" />
-    <ClCompile Include="..\..\src\libm\e_log.c" />
-    <ClCompile Include="..\..\src\libm\e_pow.c" />
-    <ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
-    <ClCompile Include="..\..\src\libm\e_sqrt.c" />
-    <ClCompile Include="..\..\src\libm\k_cos.c" />
-    <ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
-    <ClCompile Include="..\..\src\libm\k_sin.c" />
-    <ClCompile Include="..\..\src\libm\s_atan.c" />
-    <ClCompile Include="..\..\src\libm\s_copysign.c" />
-    <ClCompile Include="..\..\src\libm\s_cos.c" />
-    <ClCompile Include="..\..\src\libm\s_fabs.c" />
-    <ClCompile Include="..\..\src\libm\s_floor.c" />
-    <ClCompile Include="..\..\src\libm\s_scalbn.c" />
-    <ClCompile Include="..\..\src\libm\s_sin.c" />
-    <ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
-    <ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
-    <ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
-    <ClCompile Include="..\..\src\render\SDL_render.c" />
-    <ClCompile Include="..\..\src\render\SDL_yuv_mmx.c" />
-    <ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_blendpoint.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_drawline.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_drawpoint.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_render_sw.c" />
-    <ClCompile Include="..\..\src\render\software\SDL_rotate.c" />
-    <ClCompile Include="..\..\src\SDL.c" />
-    <ClCompile Include="..\..\src\SDL_assert.c" />
-    <ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
-    <ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
-    <ClCompile Include="..\..\src\audio\SDL_audio.c" />
-    <ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
-    <ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
-    <ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
-    <ClCompile Include="..\..\src\SDL_hints.c" />
-    <ClCompile Include="..\..\src\SDL_log.c" />
-    <ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_0.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_1.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_A.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_auto.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_copy.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_N.c" />
-    <ClCompile Include="..\..\src\video\SDL_blit_slow.c" />
-    <ClCompile Include="..\..\src\video\SDL_bmp.c" />
-    <ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
-    <ClCompile Include="..\..\src\video\SDL_clipboard.c" />
-    <ClCompile Include="..\..\src\video\SDL_shape.c" />
-    <ClCompile Include="..\..\src\audio\winmm\SDL_winmm.c" />
-    <ClCompile Include="..\..\src\audio\disk\SDL_diskaudio.c" />
-    <ClCompile Include="..\..\src\audio\dummy\SDL_dummyaudio.c" />
-    <ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
-    <ClCompile Include="..\..\src\events\SDL_dropevents.c" />
-    <ClCompile Include="..\..\src\audio\xaudio2\SDL_xaudio2.c" />
-    <ClCompile Include="..\..\src\joystick\windows\SDL_dxjoystick.c" />
-    <ClCompile Include="..\..\src\SDL_error.c" />
-    <ClCompile Include="..\..\src\events\SDL_events.c" />
-    <ClCompile Include="..\..\src\video\SDL_fillrect.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
-    <ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
-    <ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
-    <ClCompile Include="..\..\src\events\SDL_keyboard.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
-    <ClCompile Include="..\..\src\audio\SDL_mixer.c" />
-    <ClCompile Include="..\..\src\joystick\windows\SDL_mmjoystick.c" />
-    <ClCompile Include="..\..\src\events\SDL_mouse.c" />
-    <ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
-    <ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
-    <ClCompile Include="..\..\src\video\SDL_pixels.c" />
-    <ClCompile Include="..\..\src\power\SDL_power.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
-    <ClCompile Include="..\..\src\events\SDL_quit.c" />
-    <ClCompile Include="..\..\src\video\SDL_rect.c" />
-    <ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
-    <ClCompile Include="..\..\src\file\SDL_rwops.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
-    <ClCompile Include="..\..\src\video\SDL_stretch.c" />
-    <ClCompile Include="..\..\src\stdlib\SDL_string.c" />
-    <ClCompile Include="..\..\src\video\SDL_surface.c" />
-    <ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
-    <ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
-    <ClCompile Include="..\..\src\haptic\windows\SDL_syshaptic.c" />
-    <ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
-    <ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
-    <ClCompile Include="..\..\src\power\windows\SDL_syspower.c" />
-    <ClCompile Include="..\..\src\thread\windows\SDL_syssem.c" />
-    <ClCompile Include="..\..\src\thread\windows\SDL_systhread.c" />
-    <ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
-    <ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
-    <ClCompile Include="..\..\src\thread\SDL_thread.c" />
-    <ClCompile Include="..\..\src\timer\SDL_timer.c" />
-    <ClCompile Include="..\..\src\video\SDL_video.c" />
-    <ClCompile Include="..\..\src\audio\SDL_wave.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
-    <ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
-    <ClCompile Include="..\..\src\events\SDL_windowevents.c" />
-    <ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\src\main\windows\version.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/deps/SDL2/VisualC/SDL_VS2008.sln b/deps/SDL2/VisualC/SDL_VS2008.sln
deleted file mode 100644
index 3c6a380..0000000
--- a/deps/SDL2/VisualC/SDL_VS2008.sln
+++ /dev/null
@@ -1,237 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2008.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2008.vcproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2008.vcproj", "{26828762-C95D-4637-9CB1-7F0979523813}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2008.vcproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2008.vcproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2008.vcproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2008.vcproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2008.vcproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2008.vcproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2008.vcproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2008.vcproj", "{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2008.vcproj", "{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2008.vcproj", "{66B32F7E-5716-48D0-B5B9-D832FD052DD5}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2008.vcproj", "{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2008.vcproj", "{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2008.vcproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_VS2008.vcproj", "{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|Win32
-		{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.ActiveCfg = Debug|Win32
-		{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.Build.0 = Debug|Win32
-		{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.ActiveCfg = Debug|Win32
-		{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.ActiveCfg = Release|Win32
-		{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.Build.0 = Release|Win32
-		{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.ActiveCfg = Release|Win32
-		{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.Build.0 = Debug|Win32
-		{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.ActiveCfg = Debug|Win32
-		{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.ActiveCfg = Release|Win32
-		{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.Build.0 = Release|Win32
-		{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.ActiveCfg = Release|Win32
-		{66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.ActiveCfg = Debug|Win32
-		{66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.Build.0 = Debug|Win32
-		{66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|x64.ActiveCfg = Debug|Win32
-		{66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.ActiveCfg = Release|Win32
-		{66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.Build.0 = Release|Win32
-		{66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|x64.ActiveCfg = Release|Win32
-		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.Build.0 = Debug|Win32
-		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|x64.ActiveCfg = Debug|Win32
-		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.ActiveCfg = Release|Win32
-		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.Build.0 = Release|Win32
-		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|x64.ActiveCfg = Release|Win32
-		{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.Build.0 = Debug|Win32
-		{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|x64.ActiveCfg = Debug|Win32
-		{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.ActiveCfg = Release|Win32
-		{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.Build.0 = Release|Win32
-		{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|x64.ActiveCfg = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64
-		{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.ActiveCfg = Debug|Win32
-		{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.Build.0 = Debug|Win32
-		{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|x64.ActiveCfg = Debug|Win32
-		{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.ActiveCfg = Release|Win32
-		{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.Build.0 = Release|Win32
-		{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.ActiveCfg = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(NestedProjects) = preSolution
-		{26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{66B32F7E-5716-48D0-B5B9-D832FD052DD5} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-	EndGlobalSection
-EndGlobal
diff --git a/deps/SDL2/VisualC/SDL_VS2010.sln b/deps/SDL2/VisualC/SDL_VS2010.sln
deleted file mode 100644
index 3a493ac..0000000
--- a/deps/SDL2/VisualC/SDL_VS2010.sln
+++ /dev/null
@@ -1,417 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2010.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2010.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2010.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2010.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2010.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2010.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2010.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2010.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2010.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2010.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2010.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2010.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2010.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2010.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2010.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2010.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08AAD}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug_static|Win32 = Debug_static|Win32
-		Debug_static|x64 = Debug_static|x64
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release_static|Win32 = Release_static|Win32
-		Release_static|x64 = Release_static|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug_static|Win32.ActiveCfg = Debug_static|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug_static|Win32.Build.0 = Debug_static|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug_static|x64.ActiveCfg = Debug_static|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug_static|x64.Build.0 = Debug_static|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_static|Win32.ActiveCfg = Release_static|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_static|Win32.Build.0 = Release_static|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_static|x64.ActiveCfg = Release|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_static|x64.Build.0 = Release|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug_static|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug_static|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug_static|x64.Build.0 = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_static|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_static|Win32.Build.0 = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_static|x64.ActiveCfg = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_static|x64.Build.0 = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug_static|Win32.Build.0 = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug_static|x64.ActiveCfg = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug_static|x64.Build.0 = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_static|Win32.ActiveCfg = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_static|Win32.Build.0 = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_static|x64.ActiveCfg = Release|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release_static|x64.Build.0 = Release|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.Build.0 = Release|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug_static|Win32.Build.0 = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug_static|x64.ActiveCfg = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug_static|x64.Build.0 = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_static|Win32.ActiveCfg = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_static|Win32.Build.0 = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_static|x64.ActiveCfg = Release|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release_static|x64.Build.0 = Release|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.Build.0 = Release|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug_static|Win32.Build.0 = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug_static|x64.ActiveCfg = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug_static|x64.Build.0 = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_static|Win32.ActiveCfg = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_static|Win32.Build.0 = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_static|x64.ActiveCfg = Release|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release_static|x64.Build.0 = Release|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug_static|Win32.Build.0 = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug_static|x64.ActiveCfg = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug_static|x64.Build.0 = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_static|Win32.ActiveCfg = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_static|Win32.Build.0 = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_static|x64.ActiveCfg = Release|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release_static|x64.Build.0 = Release|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug_static|Win32.Build.0 = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug_static|x64.ActiveCfg = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug_static|x64.Build.0 = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release_static|Win32.ActiveCfg = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release_static|Win32.Build.0 = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release_static|x64.ActiveCfg = Release|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release_static|x64.Build.0 = Release|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.Build.0 = Release|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug_static|Win32.Build.0 = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug_static|x64.ActiveCfg = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug_static|x64.Build.0 = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_static|Win32.ActiveCfg = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_static|Win32.Build.0 = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_static|x64.ActiveCfg = Release|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release_static|x64.Build.0 = Release|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.Build.0 = Release|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug_static|Win32.Build.0 = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug_static|x64.ActiveCfg = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug_static|x64.Build.0 = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release_static|Win32.ActiveCfg = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release_static|Win32.Build.0 = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release_static|x64.ActiveCfg = Release|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release_static|x64.Build.0 = Release|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.Build.0 = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.Build.0 = Release|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug_static|Win32.Build.0 = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug_static|x64.ActiveCfg = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug_static|x64.Build.0 = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_static|Win32.ActiveCfg = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_static|Win32.Build.0 = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_static|x64.ActiveCfg = Release|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release_static|x64.Build.0 = Release|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.Build.0 = Release|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug_static|Win32.Build.0 = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug_static|x64.ActiveCfg = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug_static|x64.Build.0 = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_static|Win32.ActiveCfg = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_static|Win32.Build.0 = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_static|x64.ActiveCfg = Release|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release_static|x64.Build.0 = Release|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.Build.0 = Release|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug_static|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug_static|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug_static|x64.Build.0 = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_static|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_static|Win32.Build.0 = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_static|x64.ActiveCfg = Release|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release_static|x64.Build.0 = Release|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug_static|Win32.Build.0 = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug_static|x64.ActiveCfg = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug_static|x64.Build.0 = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_static|Win32.ActiveCfg = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_static|Win32.Build.0 = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_static|x64.ActiveCfg = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release_static|x64.Build.0 = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug_static|Win32.Build.0 = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug_static|x64.ActiveCfg = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release_static|Win32.ActiveCfg = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release_static|Win32.Build.0 = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release_static|x64.ActiveCfg = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug_static|Win32.Build.0 = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug_static|x64.ActiveCfg = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug_static|x64.Build.0 = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release_static|Win32.ActiveCfg = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release_static|Win32.Build.0 = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release_static|x64.ActiveCfg = Release|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release_static|x64.Build.0 = Release|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug_static|Win32.Build.0 = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug_static|x64.ActiveCfg = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug_static|x64.Build.0 = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release_static|Win32.ActiveCfg = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release_static|Win32.Build.0 = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release_static|x64.ActiveCfg = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release_static|x64.Build.0 = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug_static|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug_static|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug_static|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release_static|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release_static|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release_static|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release_static|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug_static|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug_static|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug_static|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release_static|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release_static|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release_static|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release_static|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug_static|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug_static|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug_static|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release_static|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release_static|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release_static|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release_static|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug_static|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug_static|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug_static|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug_static|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Release_static|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Release_static|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Release_static|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Release_static|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(NestedProjects) = preSolution
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{2271060E-98B4-4596-8172-A041E4B2EC7A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{55812185-D13C-4022-9C81-32E0F4A08336} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{55812185-D13C-4022-9C81-32E0F4A08996} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{55812185-D13C-4022-9C81-32E0F4A08BCC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{55812185-D13C-4022-9C81-32E0F4A08AAD} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-	EndGlobalSection
-EndGlobal
diff --git a/deps/SDL2/VisualC/SDL_VS2010EE.sln b/deps/SDL2/VisualC/SDL_VS2010EE.sln
deleted file mode 100644
index d5213da..0000000
--- a/deps/SDL2/VisualC/SDL_VS2010EE.sln
+++ /dev/null
@@ -1,219 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2010.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2010.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2010.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2010.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2010.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2010.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2010.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2010.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2010.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2010.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2010.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2010.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2010.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2010.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2010.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2010.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.Build.0 = Release|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.Build.0 = Release|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.Build.0 = Release|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.Build.0 = Release|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.Build.0 = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.Build.0 = Release|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.Build.0 = Release|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.Build.0 = Release|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/deps/SDL2/VisualC/SDL_VS2012.sln b/deps/SDL2/VisualC/SDL_VS2012.sln
deleted file mode 100644
index 3ac7b68..0000000
--- a/deps/SDL2/VisualC/SDL_VS2012.sln
+++ /dev/null
@@ -1,278 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2012.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2012.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2012.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2012.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2012.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2012.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2012.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2012.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2012.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2012.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2012.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2012.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2012.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2012.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2012.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2012.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.Build.0 = Debug|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.Build.0 = Release|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(NestedProjects) = preSolution
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{2271060E-98B4-4596-8172-A041E4B2EC7A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{55812185-D13C-4022-9C81-32E0F4A08336} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{55812185-D13C-4022-9C81-32E0F4A08996} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-		{55812185-D13C-4022-9C81-32E0F4A08BCC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7}
-	EndGlobalSection
-EndGlobal
diff --git a/deps/SDL2/VisualC/SDL_VS2012EE.sln b/deps/SDL2/VisualC/SDL_VS2012EE.sln
deleted file mode 100644
index 456f699..0000000
--- a/deps/SDL2/VisualC/SDL_VS2012EE.sln
+++ /dev/null
@@ -1,258 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2012.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2012.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2012.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2012.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2012.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2012.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2012.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2012.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2012.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2012.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2012.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2012.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2012.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2012.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2012.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2012.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}"
-	ProjectSection(ProjectDependencies) = postProject
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
-		{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32
-		{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32
-		{26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32
-		{CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32
-		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32
-		{26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32
-		{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32
-		{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32
-		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32
-		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64
-		{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64
-		{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.Build.0 = Debug|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|x64
-		{2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.Build.0 = Release|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64
-		{E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64
-		{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/deps/SDL2/VisualC/SDLmain/SDLmain_VS2008.vcproj b/deps/SDL2/VisualC/SDLmain/SDLmain_VS2008.vcproj
deleted file mode 100644
index 9e43c5c..0000000
--- a/deps/SDL2/VisualC/SDLmain/SDLmain_VS2008.vcproj
+++ /dev/null
@@ -1,424 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="SDL2main"
-	ProjectGUID="{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
-	RootNamespace="SDLmain"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|x64"
-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release_NoSTDIO|Win32"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				ExceptionHandling="0"
-				DebugInformationFormat="1"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release_NoSTDIO|x64"
-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,NO_STDIO_REDIRECT"
-				StringPooling="true"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile="$(IntDir)\SDLmain.lib"
-				SuppressStartupBanner="true"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				ExceptionHandling="0"
-				RuntimeLibrary="3"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\src\main\windows\SDL_windows_main.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/SDLmain/SDLmain_VS2010.vcxproj b/deps/SDL2/VisualC/SDLmain/SDLmain_VS2010.vcxproj
deleted file mode 100644
index 122491d..0000000
--- a/deps/SDL2/VisualC/SDLmain/SDLmain_VS2010.vcxproj
+++ /dev/null
@@ -1,163 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>SDL2main</ProjectName>
-    <ProjectGuid>{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PreBuildEvent />
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PreBuildEvent />
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <PrecompiledHeaderOutputFile>.\Debug/SDLmain.pch</PrecompiledHeaderOutputFile>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\main\windows\SDL_windows_main.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/SDLmain/SDLmain_VS2012.vcxproj b/deps/SDL2/VisualC/SDLmain/SDLmain_VS2012.vcxproj
deleted file mode 100644
index d44ea95..0000000
--- a/deps/SDL2/VisualC/SDLmain/SDLmain_VS2012.vcxproj
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>SDL2main</ProjectName>
-    <ProjectGuid>{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PreBuildEvent />
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PreBuildEvent />
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\main\windows\SDL_windows_main.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/SDLtest/SDLtest_VS2008.vcproj b/deps/SDL2/VisualC/SDLtest/SDLtest_VS2008.vcproj
deleted file mode 100644
index 4cd7e00..0000000
--- a/deps/SDL2/VisualC/SDLtest/SDLtest_VS2008.vcproj
+++ /dev/null
@@ -1,480 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="SDL2test"
-	ProjectGUID="{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
-	RootNamespace="SDLtest"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-		<Platform
-			Name="x64"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|x64"
-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release_NoSTDIO|Win32"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				ExceptionHandling="0"
-				DebugInformationFormat="1"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release_NoSTDIO|x64"
-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,NO_STDIO_REDIRECT"
-				StringPooling="true"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-				OutputFile="$(IntDir)\SDLtest.lib"
-				SuppressStartupBanner="true"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-				CommandLine=""
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				ExceptionHandling="0"
-				RuntimeLibrary="3"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|x64"
-			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
-			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-			ConfigurationType="4"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TargetEnvironment="3"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				ExceptionHandling="0"
-				RuntimeLibrary="2"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="1"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\src\test\SDL_test_assert.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_common.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_compare.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_crc32.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_font.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_fuzzer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_harness.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_imageBlit.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_imageBlitBlend.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_imageFace.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_imagePrimitives.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_imagePrimitivesBlend.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_log.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_md5.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\test\SDL_test_random.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/SDLtest/SDLtest_VS2010.vcxproj b/deps/SDL2/VisualC/SDLtest/SDLtest_VS2010.vcxproj
deleted file mode 100644
index 2fbbd25..0000000
--- a/deps/SDL2/VisualC/SDLtest/SDLtest_VS2010.vcxproj
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>SDL2test</ProjectName>
-    <ProjectGuid>{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PreBuildEvent />
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PreBuildEvent />
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <PrecompiledHeaderOutputFile>.\Debug/SDLtest.pch</PrecompiledHeaderOutputFile>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\SDL_test.h" />
-    <ClInclude Include="..\..\include\SDL_test_assert.h" />
-    <ClInclude Include="..\..\include\SDL_test_common.h" />
-    <ClInclude Include="..\..\include\SDL_test_crc32.h" />
-    <ClInclude Include="..\..\include\SDL_test_font.h" />
-    <ClInclude Include="..\..\include\SDL_test_fuzzer.h" />
-    <ClInclude Include="..\..\include\SDL_test_harness.h" />
-    <ClInclude Include="..\..\include\SDL_test_log.h" />
-    <ClInclude Include="..\..\include\SDL_test_md5.h" />
-    <ClInclude Include="..\..\include\SDL_test_random.h" />
-    <ClInclude Include="..\..\include\SDL_test_images.h" />
-    <ClInclude Include="..\..\include\SDL_test_compare.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\test\SDL_test_assert.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_common.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_crc32.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_font.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_harness.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_log.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_md5.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_random.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imageBlit.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imageBlitBlend.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_compare.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/SDLtest/SDLtest_VS2012.vcxproj b/deps/SDL2/VisualC/SDLtest/SDLtest_VS2012.vcxproj
deleted file mode 100644
index a0d78c6..0000000
--- a/deps/SDL2/VisualC/SDLtest/SDLtest_VS2012.vcxproj
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>SDL2test</ProjectName>
-    <ProjectGuid>{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PreBuildEvent />
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PreBuildEvent />
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-      <ExceptionHandling>false</ExceptionHandling>
-    </ClCompile>
-    <Lib>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\include\SDL_test.h" />
-    <ClInclude Include="..\..\include\SDL_test_assert.h" />
-    <ClInclude Include="..\..\include\SDL_test_common.h" />
-    <ClInclude Include="..\..\include\SDL_test_crc32.h" />
-    <ClInclude Include="..\..\include\SDL_test_font.h" />
-    <ClInclude Include="..\..\include\SDL_test_fuzzer.h" />
-    <ClInclude Include="..\..\include\SDL_test_harness.h" />
-    <ClInclude Include="..\..\include\SDL_test_log.h" />
-    <ClInclude Include="..\..\include\SDL_test_md5.h" />
-    <ClInclude Include="..\..\include\SDL_test_random.h" />
-    <ClInclude Include="..\..\include\SDL_test_images.h" />
-    <ClInclude Include="..\..\include\SDL_test_compare.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\src\test\SDL_test_assert.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_common.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_crc32.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_font.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_harness.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_log.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_md5.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_random.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imageBlit.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imageBlitBlend.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.c" />
-    <ClCompile Include="..\..\src\test\SDL_test_compare.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/clean.sh b/deps/SDL2/VisualC/clean.sh
deleted file mode 100755
index f90a11e..0000000
--- a/deps/SDL2/VisualC/clean.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-find . -type d -name 'Debug' -exec rm -rv {} \;
-find . -type d -name 'Release' -exec rm -rv {} \;
-find . -type f -name '*.user' -exec rm -v {} \;
-find . -type f -name '*.ncb' -exec rm -v {} \;
-find . -type f -name '*.suo' -exec rm -v {} \;
diff --git a/deps/SDL2/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj b/deps/SDL2/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj
deleted file mode 100644
index 412eda3..0000000
--- a/deps/SDL2/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="checkkeys"
-	ProjectGUID="{26828762-C95D-4637-9CB1-7F0979523813}"
-	RootNamespace="checkkeys"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/checkkeys.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/checkkeys.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/checkkeys.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/checkkeys.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/checkkeys.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/checkkeys.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\checkkeys.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj b/deps/SDL2/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj
deleted file mode 100644
index 9c2abe4..0000000
--- a/deps/SDL2/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>checkkeys</ProjectName>
-    <RootNamespace>checkkeys</RootNamespace>
-    <ProjectGuid>{26828762-C95D-4637-9CB1-7F0979523813}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\checkkeys.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/deps/SDL2/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj b/deps/SDL2/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj
deleted file mode 100644
index 10ac85e..0000000
--- a/deps/SDL2/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>checkkeys</ProjectName>
-    <RootNamespace>checkkeys</RootNamespace>
-    <ProjectGuid>{26828762-C95D-4637-9CB1-7F0979523813}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\checkkeys.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/loopwave/loopwave_VS2008.vcproj b/deps/SDL2/VisualC/tests/loopwave/loopwave_VS2008.vcproj
deleted file mode 100644
index f64cc0f..0000000
--- a/deps/SDL2/VisualC/tests/loopwave/loopwave_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="loopwave"
-	ProjectGUID="{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
-	RootNamespace="loopwave"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/loopwave.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/loopwave.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/loopwave.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/loopwave.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/loopwave.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/loopwave.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\Test\Loopwave.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/loopwave/loopwave_VS2010.vcxproj b/deps/SDL2/VisualC/tests/loopwave/loopwave_VS2010.vcxproj
deleted file mode 100644
index 1fd5189..0000000
--- a/deps/SDL2/VisualC/tests/loopwave/loopwave_VS2010.vcxproj
+++ /dev/null
@@ -1,235 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>loopwave</ProjectName>
-    <RootNamespace>loopwave</RootNamespace>
-    <ProjectGuid>{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\sample.wav" "$(TargetDir)\sample.wav"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\sample.wav" "$(TargetDir)\sample.wav"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\sample.wav" "$(TargetDir)\sample.wav"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\sample.wav" "$(TargetDir)\sample.wav"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\Test\Loopwave.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/deps/SDL2/VisualC/tests/loopwave/loopwave_VS2012.vcxproj b/deps/SDL2/VisualC/tests/loopwave/loopwave_VS2012.vcxproj
deleted file mode 100644
index ea983c5..0000000
--- a/deps/SDL2/VisualC/tests/loopwave/loopwave_VS2012.vcxproj
+++ /dev/null
@@ -1,235 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>loopwave</ProjectName>
-    <RootNamespace>loopwave</RootNamespace>
-    <ProjectGuid>{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\sample.wav" "$(TargetDir)\sample.wav"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\sample.wav" "$(TargetDir)\sample.wav"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\sample.wav" "$(TargetDir)\sample.wav"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\sample.wav" "$(TargetDir)\sample.wav"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\Test\Loopwave.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testatomic/testatomic_VS2008.vcproj b/deps/SDL2/VisualC/tests/testatomic/testatomic_VS2008.vcproj
deleted file mode 100644
index 8d69c92..0000000
--- a/deps/SDL2/VisualC/tests/testatomic/testatomic_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testatomic"
-	ProjectGUID="{66B32F7E-5716-48D0-B5B9-D832FD052DD5}"
-	RootNamespace="testatomic"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testatomic.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testatomic.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testatomic.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testatomic.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testatomic.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testatomic.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testatomic.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testatomic/testatomic_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testatomic/testatomic_VS2010.vcxproj
deleted file mode 100644
index 3b7c7e1..0000000
--- a/deps/SDL2/VisualC/tests/testatomic/testatomic_VS2010.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testatomic</ProjectName>
-    <ProjectGuid>{2271060E-98B4-4596-8172-A041E4B2EC7A}</ProjectGuid>
-    <RootNamespace>testatomic</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testatomic.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>  
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testatomic/testatomic_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testatomic/testatomic_VS2012.vcxproj
deleted file mode 100644
index 8e908f0..0000000
--- a/deps/SDL2/VisualC/tests/testatomic/testatomic_VS2012.vcxproj
+++ /dev/null
@@ -1,235 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testatomic</ProjectName>
-    <ProjectGuid>{2271060E-98B4-4596-8172-A041E4B2EC7A}</ProjectGuid>
-    <RootNamespace>testatomic</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testatomic.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2012.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2012.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testautomation/testautomation_VS2008.vcproj b/deps/SDL2/VisualC/tests/testautomation/testautomation_VS2008.vcproj
deleted file mode 100755
index 5b5ffa6..0000000
--- a/deps/SDL2/VisualC/tests/testautomation/testautomation_VS2008.vcproj
+++ /dev/null
@@ -1,277 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testautomation"
-	ProjectGUID="{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}"
-	RootNamespace="testautomation"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testautomation.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testautomation.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testautomation.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testautomation.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testautomation.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testautomation.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\Test\testautomation.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_audio.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_clipboard.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_events.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_keyboard.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_main.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_mouse.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_pixels.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_platform.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_rect.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_render.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_rwops.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_sdltest.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_stdlib.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_suites.h"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_surface.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_syswm.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_timer.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\..\test\testautomation_video.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testautomation/testautomation_vs2010.vcxproj b/deps/SDL2/VisualC/tests/testautomation/testautomation_vs2010.vcxproj
deleted file mode 100644
index 3c4fe9d..0000000
--- a/deps/SDL2/VisualC/tests/testautomation/testautomation_vs2010.vcxproj
+++ /dev/null
@@ -1,215 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testautomation</ProjectName>
-    <ProjectGuid>{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}</ProjectGuid>
-    <RootNamespace>testautomation</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <PostBuildEvent>
-        <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-      </PostBuildEvent>
-      <PostBuildEvent>
-        <Message>Copy SDL</Message>
-      </PostBuildEvent>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testautomation.c" />
-    <ClCompile Include="..\..\..\test\testautomation_audio.c" />
-    <ClCompile Include="..\..\..\test\testautomation_clipboard.c" />
-    <ClCompile Include="..\..\..\test\testautomation_events.c" />
-    <ClCompile Include="..\..\..\test\testautomation_keyboard.c" />
-    <ClCompile Include="..\..\..\test\testautomation_main.c" />
-    <ClCompile Include="..\..\..\test\testautomation_mouse.c" />
-    <ClCompile Include="..\..\..\test\testautomation_pixels.c" />
-    <ClCompile Include="..\..\..\test\testautomation_platform.c" />
-    <ClCompile Include="..\..\..\test\testautomation_rect.c" />
-    <ClCompile Include="..\..\..\test\testautomation_render.c" />
-    <ClCompile Include="..\..\..\test\testautomation_rwops.c" />
-    <ClCompile Include="..\..\..\test\testautomation_sdltest.c" />
-    <ClCompile Include="..\..\..\test\testautomation_stdlib.c" />
-    <ClCompile Include="..\..\..\test\testautomation_surface.c" />
-    <ClCompile Include="..\..\..\test\testautomation_syswm.c" />
-    <ClCompile Include="..\..\..\test\testautomation_timer.c" />
-    <ClCompile Include="..\..\..\test\testautomation_video.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\test\testautomation_suites.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDLtest\SDLtest_VS2010.vcxproj">
-      <Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/deps/SDL2/VisualC/tests/testautomation/testautomation_vs2012.vcxproj b/deps/SDL2/VisualC/tests/testautomation/testautomation_vs2012.vcxproj
deleted file mode 100644
index a026096..0000000
--- a/deps/SDL2/VisualC/tests/testautomation/testautomation_vs2012.vcxproj
+++ /dev/null
@@ -1,213 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testautomation</ProjectName>
-    <ProjectGuid>{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}</ProjectGuid>
-    <RootNamespace>testautomation</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testautomation.c" />
-    <ClCompile Include="..\..\..\test\testautomation_audio.c" />
-    <ClCompile Include="..\..\..\test\testautomation_clipboard.c" />
-    <ClCompile Include="..\..\..\test\testautomation_events.c" />
-    <ClCompile Include="..\..\..\test\testautomation_keyboard.c" />
-    <ClCompile Include="..\..\..\test\testautomation_main.c" />
-    <ClCompile Include="..\..\..\test\testautomation_mouse.c" />
-    <ClCompile Include="..\..\..\test\testautomation_pixels.c" />
-    <ClCompile Include="..\..\..\test\testautomation_platform.c" />
-    <ClCompile Include="..\..\..\test\testautomation_rect.c" />
-    <ClCompile Include="..\..\..\test\testautomation_render.c" />
-    <ClCompile Include="..\..\..\test\testautomation_rwops.c" />
-    <ClCompile Include="..\..\..\test\testautomation_sdltest.c" />
-    <ClCompile Include="..\..\..\test\testautomation_stdlib.c" />
-    <ClCompile Include="..\..\..\test\testautomation_surface.c" />
-    <ClCompile Include="..\..\..\test\testautomation_syswm.c" />
-    <ClCompile Include="..\..\..\test\testautomation_timer.c" />
-    <ClCompile Include="..\..\..\test\testautomation_video.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\..\test\testautomation_suites.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-    <Library Include="..\..\SDLtest\$(Platform)\$(Configuration)\SDL2test.lib" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/deps/SDL2/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj b/deps/SDL2/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj
deleted file mode 100644
index 03a4449..0000000
--- a/deps/SDL2/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testdraw2"
-	ProjectGUID="{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}"
-	RootNamespace="testdraw2"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testdraw2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testdraw2.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testdraw2.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testdraw2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testdraw2.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testdraw2.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testdraw2.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj
deleted file mode 100644
index 5588b76..0000000
--- a/deps/SDL2/VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj
+++ /dev/null
@@ -1,234 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testdraw2</ProjectName>
-    <RootNamespace>testdraw2</RootNamespace>
-    <ProjectGuid>{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testdraw2.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDLtest\SDLtest_VS2010.vcxproj">
-      <Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj
deleted file mode 100644
index e95358f..0000000
--- a/deps/SDL2/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj
+++ /dev/null
@@ -1,232 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testdraw2</ProjectName>
-    <RootNamespace>testdraw2</RootNamespace>
-    <ProjectGuid>{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testdraw2.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-    <Library Include="..\..\SDLtest\$(Platform)\$(Configuration)\SDL2test.lib" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testfile/testfile_VS2008.vcproj b/deps/SDL2/VisualC/tests/testfile/testfile_VS2008.vcproj
deleted file mode 100644
index c421a2a..0000000
--- a/deps/SDL2/VisualC/tests/testfile/testfile_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testfile"
-	ProjectGUID="{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
-	RootNamespace="testfile"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testfile.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testfile.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testfile.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testfile.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testfile.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testfile.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\Test\testfile.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testfile/testfile_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testfile/testfile_VS2010.vcxproj
deleted file mode 100644
index 6a74a12..0000000
--- a/deps/SDL2/VisualC/tests/testfile/testfile_VS2010.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testfile</ProjectName>
-    <RootNamespace>testfile</RootNamespace>
-    <ProjectGuid>{CAE4F1D0-314F-4B10-805B-0EFD670133A0}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\Test\testfile.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testfile/testfile_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testfile/testfile_VS2012.vcxproj
deleted file mode 100644
index dc9f828..0000000
--- a/deps/SDL2/VisualC/tests/testfile/testfile_VS2012.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testfile</ProjectName>
-    <RootNamespace>testfile</RootNamespace>
-    <ProjectGuid>{CAE4F1D0-314F-4B10-805B-0EFD670133A0}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\Test\testfile.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj
deleted file mode 100644
index e2d7b6b..0000000
--- a/deps/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testgamecontroller</ProjectName>
-    <RootNamespace>testgamecontroller</RootNamespace>
-    <ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08336}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testgamecontroller.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj
deleted file mode 100644
index c832c59..0000000
--- a/deps/SDL2/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testgamecontroller</ProjectName>
-    <RootNamespace>testgamecontroller</RootNamespace>
-    <ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08336}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testgamecontroller.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testgesture/testgesture_VS2008.vcproj b/deps/SDL2/VisualC/tests/testgesture/testgesture_VS2008.vcproj
deleted file mode 100644
index cc19906..0000000
--- a/deps/SDL2/VisualC/tests/testgesture/testgesture_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testgesture"
-	ProjectGUID="{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}"
-	RootNamespace="testgesture"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testgesture.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testgesture.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testgesture.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testgesture.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testgesture.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testgesture.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testgesture.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testgesture/testgesture_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testgesture/testgesture_VS2010.vcxproj
deleted file mode 100644
index 63adbf0..0000000
--- a/deps/SDL2/VisualC/tests/testgesture/testgesture_VS2010.vcxproj
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testgesture</ProjectName>
-    <RootNamespace>testgesture</RootNamespace>
-    <ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08996}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testgesture.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testgesture/testgesture_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testgesture/testgesture_VS2012.vcxproj
deleted file mode 100644
index ef71820..0000000
--- a/deps/SDL2/VisualC/tests/testgesture/testgesture_VS2012.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testgesture</ProjectName>
-    <RootNamespace>testgesture</RootNamespace>
-    <ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08996}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testgesture.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testgl2/testgl2_VS2008.vcproj b/deps/SDL2/VisualC/tests/testgl2/testgl2_VS2008.vcproj
deleted file mode 100644
index 65c6a6e..0000000
--- a/deps/SDL2/VisualC/tests/testgl2/testgl2_VS2008.vcproj
+++ /dev/null
@@ -1,207 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testgl2"
-	ProjectGUID="{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}"
-	RootNamespace="testgl2"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testgl2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testgl2.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="opengl32.lib"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testgl2.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testgl2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testgl2.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="opengl32.lib"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testgl2.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testgl2.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testgl2/testgl2_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testgl2/testgl2_VS2010.vcxproj
deleted file mode 100644
index 8a3bd51..0000000
--- a/deps/SDL2/VisualC/tests/testgl2/testgl2_VS2010.vcxproj
+++ /dev/null
@@ -1,238 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testgl2</ProjectName>
-    <RootNamespace>testgl2</RootNamespace>
-    <ProjectGuid>{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testgl2.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDLtest\SDLtest_VS2010.vcxproj">
-      <Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testgl2/testgl2_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testgl2/testgl2_VS2012.vcxproj
deleted file mode 100644
index d02101f..0000000
--- a/deps/SDL2/VisualC/tests/testgl2/testgl2_VS2012.vcxproj
+++ /dev/null
@@ -1,236 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testgl2</ProjectName>
-    <RootNamespace>testgl2</RootNamespace>
-    <ProjectGuid>{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testgl2.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-    <Library Include="..\..\SDLtest\$(Platform)\$(Configuration)\SDL2test.lib" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj b/deps/SDL2/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj
deleted file mode 100644
index c6b91bf..0000000
--- a/deps/SDL2/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testjoystick"
-	ProjectGUID="{55812185-D13C-4022-9C81-32E0F4A08304}"
-	RootNamespace="testjoystick"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testjoystick.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testjoystick.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testjoystick.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testjoystick.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testjoystick.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testjoystick.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testjoystick.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj
deleted file mode 100644
index 41c98e4..0000000
--- a/deps/SDL2/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testjoystick</ProjectName>
-    <RootNamespace>testjoystick</RootNamespace>
-    <ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08BCC}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testjoystick.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj
deleted file mode 100644
index 9730432..0000000
--- a/deps/SDL2/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testjoystick</ProjectName>
-    <RootNamespace>testjoystick</RootNamespace>
-    <ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08BCC}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testjoystick.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj b/deps/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj
deleted file mode 100644
index cb5023f..0000000
--- a/deps/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testoverlay2"
-	ProjectGUID="{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
-	RootNamespace="testoverlay2"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testoverlay2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testoverlay2.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testoverlay2.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL and data files"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\moose.dat" "$(ProjectDir)\moose.dat"&#x0D;&#x0A;"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testoverlay2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testoverlay2.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testoverlay2.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL and data files"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\moose.dat" "$(ProjectDir)\moose.dat"&#x0D;&#x0A;"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testoverlay2.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj
deleted file mode 100644
index 86a73ed..0000000
--- a/deps/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testoverlay2</ProjectName>
-    <RootNamespace>testoverlay2</RootNamespace>
-    <ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08AAD}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testoverlay2.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj
deleted file mode 100644
index d51d495..0000000
--- a/deps/SDL2/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj
+++ /dev/null
@@ -1,235 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testoverlay2</ProjectName>
-    <RootNamespace>testoverlay2</RootNamespace>
-    <ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08AAD}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testoverlay2.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testplatform/testplatform_VS2008.vcproj b/deps/SDL2/VisualC/tests/testplatform/testplatform_VS2008.vcproj
deleted file mode 100644
index b1fa2dc..0000000
--- a/deps/SDL2/VisualC/tests/testplatform/testplatform_VS2008.vcproj
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testplatform"
-	ProjectGUID="{26932B24-EFC6-4E3A-B277-ED653DA37968}"
-	RootNamespace="testplatform"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testplatform.tlb"
-				HeaderFileName=""
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
-				MinimalRebuild="true"
-				RuntimeLibrary="3"
-				PrecompiledHeaderFile=".\Debug/testplatform.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testplatform.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-				SuppressStartupBanner="true"
-				OutputFile=".\Debug/testplatform.bsc"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testplatform.tlb"
-				HeaderFileName=""
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				PrecompiledHeaderFile=".\Release/testplatform.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testplatform.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-				SuppressStartupBanner="true"
-				OutputFile=".\Release/testplatform.bsc"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\Test\testplatform.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testplatform/testplatform_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testplatform/testplatform_VS2010.vcxproj
deleted file mode 100644
index d0c0192..0000000
--- a/deps/SDL2/VisualC/tests/testplatform/testplatform_VS2010.vcxproj
+++ /dev/null
@@ -1,250 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testplatform</ProjectName>
-    <RootNamespace>testplatform</RootNamespace>
-    <ProjectGuid>{26932B24-EFC6-4E3A-B277-ED653DA37968}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Bscmake>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Bscmake>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-      <TypeLibraryName>.\Release/testplatform.tlb</TypeLibraryName>
-      <HeaderFileName>
-      </HeaderFileName>
-    </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeaderOutputFile>.\Release/testplatform.pch</PrecompiledHeaderOutputFile>
-      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
-      <ObjectFileName>$(IntDir)</ObjectFileName>
-      <ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Bscmake>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Bscmake>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\Test\testplatform.c">
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testplatform/testplatform_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testplatform/testplatform_VS2012.vcxproj
deleted file mode 100644
index 8885fdf..0000000
--- a/deps/SDL2/VisualC/tests/testplatform/testplatform_VS2012.vcxproj
+++ /dev/null
@@ -1,249 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testplatform</ProjectName>
-    <RootNamespace>testplatform</RootNamespace>
-    <ProjectGuid>{26932B24-EFC6-4E3A-B277-ED653DA37968}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Bscmake>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Bscmake>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-      <TypeLibraryName>.\Release/testplatform.tlb</TypeLibraryName>
-      <HeaderFileName>
-      </HeaderFileName>
-    </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
-      <ObjectFileName>$(IntDir)</ObjectFileName>
-      <ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Bscmake>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <Bscmake>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Bscmake>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\Test\testplatform.c">
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testpower/testpower_VS2008.vcproj b/deps/SDL2/VisualC/tests/testpower/testpower_VS2008.vcproj
deleted file mode 100644
index 6171d0f..0000000
--- a/deps/SDL2/VisualC/tests/testpower/testpower_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testpower"
-	ProjectGUID="{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}"
-	RootNamespace="testpower"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testpower.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testpower.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testpower.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testpower.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testpower.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testpower.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testpower.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testpower/testpower_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testpower/testpower_VS2010.vcxproj
deleted file mode 100644
index 6c252a1..0000000
--- a/deps/SDL2/VisualC/tests/testpower/testpower_VS2010.vcxproj
+++ /dev/null
@@ -1,234 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testpower</ProjectName>
-    <ProjectGuid>{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}</ProjectGuid>
-    <RootNamespace>testpower</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testpower.c">
-      <PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug/testpower.pch</PrecompiledHeaderOutputFile>
-      <PrecompiledHeaderOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug/testpower.pch</PrecompiledHeaderOutputFile>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testpower/testpower_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testpower/testpower_VS2012.vcxproj
deleted file mode 100644
index 60c8981..0000000
--- a/deps/SDL2/VisualC/tests/testpower/testpower_VS2012.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testpower</ProjectName>
-    <ProjectGuid>{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}</ProjectGuid>
-    <RootNamespace>testpower</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testpower.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj b/deps/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj
deleted file mode 100644
index d298dd0..0000000
--- a/deps/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testrendertarget"
-	ProjectGUID="{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}"
-	RootNamespace="testrendertarget"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testrendertarget.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testrendertarget.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testrendertarget.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL and data files"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\icon.bmp" "$(ProjectDir)\icon.bmp"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\sample.bmp" "$(ProjectDir)\sample.bmp"&#x0D;&#x0A;"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testrendertarget.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testrendertarget.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testrendertarget.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL and data files"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\icon.bmp" "$(ProjectDir)\icon.bmp"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\sample.bmp" "$(ProjectDir)\sample.bmp"&#x0D;&#x0A;"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testrendertarget.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj
deleted file mode 100644
index 133366f..0000000
--- a/deps/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj
+++ /dev/null
@@ -1,242 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testrendertarget</ProjectName>
-    <ProjectGuid>{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}</ProjectGuid>
-    <RootNamespace>testrendertarget</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testrendertarget.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDLtest\SDLtest_VS2010.vcxproj">
-      <Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>  
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/deps/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj
deleted file mode 100644
index b85c066..0000000
--- a/deps/SDL2/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj
+++ /dev/null
@@ -1,245 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testrendertarget</ProjectName>
-    <ProjectGuid>{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}</ProjectGuid>
-    <RootNamespace>testrendertarget</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testrendertarget.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2012.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDLtest\SDLtest_VS2012.vcxproj">
-      <Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2012.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>  
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/deps/SDL2/VisualC/tests/testscale/testscale_VS2008.vcproj b/deps/SDL2/VisualC/tests/testscale/testscale_VS2008.vcproj
deleted file mode 100644
index e0cac7c..0000000
--- a/deps/SDL2/VisualC/tests/testscale/testscale_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testscale"
-	ProjectGUID="{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}"
-	RootNamespace="testscale"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testscale.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testscale.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testscale.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL and data files"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\icon.bmp" "$(ProjectDir)\icon.bmp"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\sample.bmp" "$(ProjectDir)\sample.bmp"&#x0D;&#x0A;"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testscale.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testscale.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testscale.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL and data files"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\icon.bmp" "$(ProjectDir)\icon.bmp"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\sample.bmp" "$(ProjectDir)\sample.bmp"&#x0D;&#x0A;"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testscale.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testscale/testscale_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testscale/testscale_VS2010.vcxproj
deleted file mode 100644
index 6753c1c..0000000
--- a/deps/SDL2/VisualC/tests/testscale/testscale_VS2010.vcxproj
+++ /dev/null
@@ -1,242 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testscale</ProjectName>
-    <ProjectGuid>{E7A6C41C-E059-4C9C-8CCC-73586A540B62}</ProjectGuid>
-    <RootNamespace>testscale</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testscale.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDLtest\SDLtest_VS2010.vcxproj">
-      <Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>  
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/deps/SDL2/VisualC/tests/testscale/testscale_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testscale/testscale_VS2012.vcxproj
deleted file mode 100644
index 1419804..0000000
--- a/deps/SDL2/VisualC/tests/testscale/testscale_VS2012.vcxproj
+++ /dev/null
@@ -1,246 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testscale</ProjectName>
-    <ProjectGuid>{E7A6C41C-E059-4C9C-8CCC-73586A540B62}</ProjectGuid>
-    <RootNamespace>testscale</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"
-copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp"</Command>      
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testscale.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2012.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDLtest\SDLtest_VS2012.vcxproj">
-      <Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2012.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>  
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
diff --git a/deps/SDL2/VisualC/tests/testshape/testshape_VS2008.vcproj b/deps/SDL2/VisualC/tests/testshape/testshape_VS2008.vcproj
deleted file mode 100644
index fff1458..0000000
--- a/deps/SDL2/VisualC/tests/testshape/testshape_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testshape"
-	ProjectGUID="{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}"
-	RootNamespace="testshape"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testshape.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testshape.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testshape.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testshape.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testshape.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testshape.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll""
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testshape.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testshape/testshape_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testshape/testshape_VS2010.vcxproj
deleted file mode 100644
index f7e96f9..0000000
--- a/deps/SDL2/VisualC/tests/testshape/testshape_VS2010.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testshape</ProjectName>
-    <RootNamespace>testshape</RootNamespace>
-    <ProjectGuid>{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testshape.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testshape/testshape_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testshape/testshape_VS2012.vcxproj
deleted file mode 100644
index b7c4e5e..0000000
--- a/deps/SDL2/VisualC/tests/testshape/testshape_VS2012.vcxproj
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testshape</ProjectName>
-    <RootNamespace>testshape</RootNamespace>
-    <ProjectGuid>{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testshape.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj b/deps/SDL2/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj
deleted file mode 100644
index 5e37549..0000000
--- a/deps/SDL2/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="testsprite2"
-	ProjectGUID="{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
-	RootNamespace="testsprite2"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="NDEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Release/testsprite2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
-				StringPooling="true"
-				RuntimeLibrary="2"
-				EnableFunctionLevelLinking="true"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Release/testsprite2.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				ProgramDatabaseFile=".\Release/testsprite2.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL and data files"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\icon.bmp" "$(ProjectDir)\icon.bmp"&#x0D;&#x0A;"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				PreprocessorDefinitions="_DEBUG"
-				MkTypLibCompatible="true"
-				SuppressStartupBanner="true"
-				TargetEnvironment="1"
-				TypeLibraryName=".\Debug/testsprite2.tlb"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\include"
-				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
-				PrecompiledHeaderFile=".\Debug/testsprite2.pch"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-				CompileAs="0"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="1033"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalOptions="/MACHINE:I386"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/testsprite2.pdb"
-				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				Description="Copy SDL and data files"
-				CommandLine="copy "$(SolutionDir)\SDL\$(ConfigurationName)\SDL2.dll" "$(TargetDir)\SDL2.dll"&#x0D;&#x0A;copy "$(SolutionDir)\..\test\icon.bmp" "$(ProjectDir)\icon.bmp"&#x0D;&#x0A;"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath="..\..\..\test\testsprite2.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
diff --git a/deps/SDL2/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj b/deps/SDL2/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj
deleted file mode 100644
index e3cac8a..0000000
--- a/deps/SDL2/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj
+++ /dev/null
@@ -1,238 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testsprite2</ProjectName>
-    <RootNamespace>testsprite2</RootNamespace>
-    <ProjectGuid>{40FB7794-D3C3-4CFE-BCF4-A80C96635682}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testsprite2.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDLmain\SDLmain_VS2010.vcxproj">
-      <Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDLtest\SDLtest_VS2010.vcxproj">
-      <Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL\SDL_VS2010.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj b/deps/SDL2/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj
deleted file mode 100644
index c2ac6e0..0000000
--- a/deps/SDL2/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj
+++ /dev/null
@@ -1,236 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>testsprite2</ProjectName>
-    <RootNamespace>testsprite2</RootNamespace>
-    <ProjectGuid>{40FB7794-D3C3-4CFE-BCF4-A80C96635682}</ProjectGuid>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseOfMfc>false</UseOfMfc>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <CompileAs>Default</CompileAs>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-    <PostBuildEvent>
-      <Command>copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll"
-copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp"</Command>
-    </PostBuildEvent>
-    <PostBuildEvent>
-      <Message>Copy SDL and data files</Message>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\testsprite2.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <Library Include="..\..\SDL\$(Platform)\$(Configuration)\SDL2.lib" />
-    <Library Include="..\..\SDLmain\$(Platform)\$(Configuration)\SDL2main.lib" />
-    <Library Include="..\..\SDLtest\$(Platform)\$(Configuration)\SDL2test.lib" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/deps/SDL2/WhatsNew.txt b/deps/SDL2/WhatsNew.txt
deleted file mode 100644
index 5ac78c5..0000000
--- a/deps/SDL2/WhatsNew.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-
-This is a list of major changes in SDL's version history.
-
----------------------------------------------------------------------------
-2.0.1:
----------------------------------------------------------------------------
-
-General:
-* Added an API to get common filesystem paths in SDL_filesystem.h:
-    SDL_GetBasePath(), SDL_GetPrefPath()
-* Added an API to do optimized YV12 and IYUV texture updates:
-    SDL_UpdateYUVTexture()
-* Added an API to get the amount of RAM on the system:
-    SDL_GetSystemRAM()
-* Added a macro to perform timestamp comparisons with SDL_GetTicks():
-    SDL_TICKS_PASSED()
-* Dramatically improved OpenGL ES 2.0 rendering performance
-* Added OpenGL attribute SDL_GL_FRAMEBUFFER_SRGB_CAPABLE
-
-Windows:
-* Created a static library configuration for the Visual Studio 2010 project
-* Added a hint to create the Direct3D device with support for multi-threading:
-    SDL_HINT_RENDER_DIRECT3D_THREADSAFE
-* Added a function to get the D3D9 adapter index for a display:
-    SDL_Direct3D9GetAdapterIndex()
-* Added a function to get the D3D9 device for a D3D9 renderer:
-    SDL_RenderGetD3D9Device()
-* Fixed building SDL with the mingw32 toolchain (mingw-w64 is preferred)
-* Fixed crash when using two XInput controllers at the same time
-* Fixed detecting a mixture of XInput and DirectInput controllers
-* Fixed clearing a D3D render target larger than the window
-* Improved support for format specifiers in SDL_snprintf()
-
-Mac OS X:
-* Added support for retina displays:
-  Create your window with the SDL_WINDOW_ALLOW_HIGHDPI flag, and then use SDL_GL_GetDrawableSize() to find the actual drawable size. You are responsible for scaling mouse and drawing coordinates appropriately.
-* Fixed mouse warping in fullscreen mode
-* Right mouse click is emulated by holding the Ctrl key while left clicking
-
-Linux:
-* Fixed float audio support with the PulseAudio driver
-* Fixed missing line endpoints in the OpenGL renderer on some drivers
-* X11 symbols are no longer defined to avoid collisions when linking statically
-
-iOS:
-* Fixed status bar visibility on iOS 7
-* Flipped the accelerometer Y axis to match expected values
-
-Android:
-IMPORTANT: You MUST get the updated SDLActivity.java to match C code
-* Moved EGL initialization to native code 
-* Fixed the accelerometer axis rotation relative to the device rotation
-* Fixed race conditions when handling the EGL context on pause/resume
-* Touch devices are available for enumeration immediately after init
-
-Raspberry Pi:
-* Added support for the Raspberry Pi, see README-raspberrypi.txt for details
diff --git a/deps/SDL2/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj b/deps/SDL2/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
deleted file mode 100755
index 78d1c0b..0000000
--- a/deps/SDL2/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,1306 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 46;
-	objects = {
-
-/* Begin PBXAggregateTarget section */
-		00B4F48B12F6A69C0084EC00 /* PrepareXcodeProjectTemplate */ = {
-			isa = PBXAggregateTarget;
-			buildConfigurationList = 00B4F48E12F6A6BA0084EC00 /* Build configuration list for PBXAggregateTarget "PrepareXcodeProjectTemplate" */;
-			buildPhases = (
-				00B4F48A12F6A69C0084EC00 /* ShellScript */,
-			);
-			dependencies = (
-			);
-			name = PrepareXcodeProjectTemplate;
-			productName = PrepareXcodeProjectTemplate;
-		};
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
-		006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 006E9886119552DD001DE610 /* SDL_rwopsbundlesupport.h */; };
-		006E9889119552DD001DE610 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 006E9887119552DD001DE610 /* SDL_rwopsbundlesupport.m */; };
-		0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85512FE70C600CECEE3 /* SDL_render_gles2.c */; };
-		0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85612FE70C600CECEE3 /* SDL_shaders_gles2.c */; };
-		0402A85A12FE70C600CECEE3 /* SDL_shaders_gles2.h in Headers */ = {isa = PBXBuildFile; fileRef = 0402A85712FE70C600CECEE3 /* SDL_shaders_gles2.h */; };
-		041B2CF112FA0F680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CEA12FA0F680087D585 /* SDL_render.c */; };
-		041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */; };
-		0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */; };
-		0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */; };
-		04409BA612FA989600FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA212FA989600FB9AA8 /* mmx.h */; };
-		04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */; };
-		04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */; };
-		04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */; };
-		0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */; };
-		0442EC5112FE1C1E004C9285 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */; };
-		0442EC5312FE1C28004C9285 /* SDL_render_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5212FE1C28004C9285 /* SDL_render_gles.c */; };
-		0442EC5512FE1C3F004C9285 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5412FE1C3F004C9285 /* SDL_hints.c */; };
-		044E5FB811E606EB0076F181 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 044E5FB711E606EB0076F181 /* SDL_clipboard.c */; };
-		046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */; };
-		046387460F0B5B7D0041FD65 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */; };
-		047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */; };
-		047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B90EA76A31008ABAF1 /* SDL_haptic.c */; };
-		047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 047677BA0EA76A31008ABAF1 /* SDL_syshaptic.h */; };
-		047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */; };
-		04BA9D6311EF474A00B60E01 /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */; };
-		04BA9D6411EF474A00B60E01 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6011EF474A00B60E01 /* SDL_gesture.c */; };
-		04BA9D6511EF474A00B60E01 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */; };
-		04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6211EF474A00B60E01 /* SDL_touch.c */; };
-		04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */; };
-		04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC09B1300C1290055DE28 /* SDL_log.c */; };
-		04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; };
-		04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */; };
-		04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */; };
-		04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806C12FB751400FC43C0 /* SDL_blendline.c */; };
-		04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806D12FB751400FC43C0 /* SDL_blendline.h */; };
-		04F7807A12FB751400FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */; };
-		04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */; };
-		04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807012FB751400FC43C0 /* SDL_draw.h */; };
-		04F7807D12FB751400FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807112FB751400FC43C0 /* SDL_drawline.c */; };
-		04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807212FB751400FC43C0 /* SDL_drawline.h */; };
-		04F7807F12FB751400FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */; };
-		04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807412FB751400FC43C0 /* SDL_drawpoint.h */; };
-		04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */; };
-		04F7808512FB753F00FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */; };
-		04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */; };
-		04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */; };
-		56C181DF17C44D5E00406AE3 /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 56C181DE17C44D5E00406AE3 /* SDL_filesystem.h */; };
-		56C181E217C44D7A00406AE3 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */; };
-		56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */; };
-		56EA86FC13E9EC2B002E47EB /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */; };
-		56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; };
-		56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; };
-		93CB792313FC5E5200BD3E05 /* SDL_uikitviewcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */; };
-		93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */; };
-		AA0AD06216647BBB00CE5896 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */; };
-		AA0AD06516647BD400CE5896 /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0AD06416647BD400CE5896 /* SDL_gamecontroller.h */; };
-		AA0F8495178D5F1A00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8494178D5F1A00823F9D /* SDL_systls.c */; };
-		AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */ = {isa = PBXBuildFile; fileRef = AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */; };
-		AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */ = {isa = PBXBuildFile; fileRef = AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */; };
-		AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AD9159369E3005138DD /* SDL_rotate.c */; };
-		AA628ADC159369E3005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628ADA159369E3005138DD /* SDL_rotate.h */; };
-		AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */; };
-		AA704DD7162AA90A0076D1C1 /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */; };
-		AA7558981595D55500BBD41B /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558651595D55500BBD41B /* begin_code.h */; };
-		AA7558991595D55500BBD41B /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558661595D55500BBD41B /* close_code.h */; };
-		AA75589A1595D55500BBD41B /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558671595D55500BBD41B /* SDL_assert.h */; };
-		AA75589B1595D55500BBD41B /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558681595D55500BBD41B /* SDL_atomic.h */; };
-		AA75589C1595D55500BBD41B /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558691595D55500BBD41B /* SDL_audio.h */; };
-		AA75589D1595D55500BBD41B /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586A1595D55500BBD41B /* SDL_blendmode.h */; };
-		AA75589E1595D55500BBD41B /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586B1595D55500BBD41B /* SDL_clipboard.h */; };
-		AA75589F1595D55500BBD41B /* SDL_config_iphoneos.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586C1595D55500BBD41B /* SDL_config_iphoneos.h */; };
-		AA7558A01595D55500BBD41B /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586D1595D55500BBD41B /* SDL_config.h */; };
-		AA7558A11595D55500BBD41B /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586E1595D55500BBD41B /* SDL_copying.h */; };
-		AA7558A21595D55500BBD41B /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586F1595D55500BBD41B /* SDL_cpuinfo.h */; };
-		AA7558A31595D55500BBD41B /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558701595D55500BBD41B /* SDL_endian.h */; };
-		AA7558A41595D55500BBD41B /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558711595D55500BBD41B /* SDL_error.h */; };
-		AA7558A51595D55500BBD41B /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558721595D55500BBD41B /* SDL_events.h */; };
-		AA7558A61595D55500BBD41B /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558731595D55500BBD41B /* SDL_gesture.h */; };
-		AA7558A71595D55500BBD41B /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558741595D55500BBD41B /* SDL_haptic.h */; };
-		AA7558A81595D55500BBD41B /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558751595D55500BBD41B /* SDL_hints.h */; };
-		AA7558AA1595D55500BBD41B /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558771595D55500BBD41B /* SDL_joystick.h */; };
-		AA7558AB1595D55500BBD41B /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558781595D55500BBD41B /* SDL_keyboard.h */; };
-		AA7558AC1595D55500BBD41B /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558791595D55500BBD41B /* SDL_keycode.h */; };
-		AA7558AD1595D55500BBD41B /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587A1595D55500BBD41B /* SDL_loadso.h */; };
-		AA7558AE1595D55500BBD41B /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587B1595D55500BBD41B /* SDL_log.h */; };
-		AA7558AF1595D55500BBD41B /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587C1595D55500BBD41B /* SDL_main.h */; };
-		AA7558B01595D55500BBD41B /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587D1595D55500BBD41B /* SDL_mouse.h */; };
-		AA7558B11595D55500BBD41B /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587E1595D55500BBD41B /* SDL_mutex.h */; };
-		AA7558B21595D55500BBD41B /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587F1595D55500BBD41B /* SDL_name.h */; };
-		AA7558B31595D55500BBD41B /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558801595D55500BBD41B /* SDL_opengl.h */; };
-		AA7558B41595D55500BBD41B /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558811595D55500BBD41B /* SDL_opengles.h */; };
-		AA7558B51595D55500BBD41B /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558821595D55500BBD41B /* SDL_opengles2.h */; };
-		AA7558B61595D55500BBD41B /* SDL_pixels.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558831595D55500BBD41B /* SDL_pixels.h */; };
-		AA7558B71595D55500BBD41B /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558841595D55500BBD41B /* SDL_platform.h */; };
-		AA7558B81595D55500BBD41B /* SDL_power.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558851595D55500BBD41B /* SDL_power.h */; };
-		AA7558B91595D55500BBD41B /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558861595D55500BBD41B /* SDL_quit.h */; };
-		AA7558BA1595D55500BBD41B /* SDL_rect.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558871595D55500BBD41B /* SDL_rect.h */; };
-		AA7558BB1595D55500BBD41B /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558881595D55500BBD41B /* SDL_render.h */; };
-		AA7558BC1595D55500BBD41B /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558891595D55500BBD41B /* SDL_revision.h */; };
-		AA7558BD1595D55500BBD41B /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588A1595D55500BBD41B /* SDL_rwops.h */; };
-		AA7558BE1595D55500BBD41B /* SDL_scancode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588B1595D55500BBD41B /* SDL_scancode.h */; };
-		AA7558BF1595D55500BBD41B /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588C1595D55500BBD41B /* SDL_shape.h */; };
-		AA7558C01595D55500BBD41B /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588D1595D55500BBD41B /* SDL_stdinc.h */; };
-		AA7558C11595D55500BBD41B /* SDL_surface.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588E1595D55500BBD41B /* SDL_surface.h */; };
-		AA7558C21595D55500BBD41B /* SDL_system.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588F1595D55500BBD41B /* SDL_system.h */; };
-		AA7558C31595D55500BBD41B /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558901595D55500BBD41B /* SDL_syswm.h */; };
-		AA7558C41595D55500BBD41B /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558911595D55500BBD41B /* SDL_thread.h */; };
-		AA7558C51595D55500BBD41B /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558921595D55500BBD41B /* SDL_timer.h */; };
-		AA7558C61595D55500BBD41B /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558931595D55500BBD41B /* SDL_touch.h */; };
-		AA7558C71595D55500BBD41B /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558941595D55500BBD41B /* SDL_types.h */; };
-		AA7558C81595D55500BBD41B /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558951595D55500BBD41B /* SDL_version.h */; };
-		AA7558C91595D55500BBD41B /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558961595D55500BBD41B /* SDL_video.h */; };
-		AA7558CA1595D55500BBD41B /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558971595D55500BBD41B /* SDL.h */; };
-		AA9FF9511637C6E5000DF050 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9501637C6E5000DF050 /* SDL_messagebox.h */; };
-		AABCC3941640643D00AB8930 /* SDL_uikitmessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */; };
-		AABCC3951640643D00AB8930 /* SDL_uikitmessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */; };
-		AADA5B8F16CCAB7C00107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */; };
-		FD3F4A760DEA620800C5B771 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A700DEA620800C5B771 /* SDL_getenv.c */; };
-		FD3F4A770DEA620800C5B771 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A710DEA620800C5B771 /* SDL_iconv.c */; };
-		FD3F4A780DEA620800C5B771 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A720DEA620800C5B771 /* SDL_malloc.c */; };
-		FD3F4A790DEA620800C5B771 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A730DEA620800C5B771 /* SDL_qsort.c */; };
-		FD3F4A7A0DEA620800C5B771 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A740DEA620800C5B771 /* SDL_stdlib.c */; };
-		FD3F4A7B0DEA620800C5B771 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A750DEA620800C5B771 /* SDL_string.c */; };
-		FD5F9D2F0E0E08B3008E885B /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FD5F9D1E0E0E08B3008E885B /* SDL_joystick.c */; };
-		FD5F9D300E0E08B3008E885B /* SDL_joystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FD5F9D1F0E0E08B3008E885B /* SDL_joystick_c.h */; };
-		FD5F9D310E0E08B3008E885B /* SDL_sysjoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = FD5F9D200E0E08B3008E885B /* SDL_sysjoystick.h */; };
-		FD6526660DE8FCDD002AD96B /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */; };
-		FD6526670DE8FCDD002AD96B /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */; };
-		FD6526680DE8FCDD002AD96B /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */; };
-		FD65266A0DE8FCDD002AD96B /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */; };
-		FD65266B0DE8FCDD002AD96B /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */; };
-		FD65266F0DE8FCDD002AD96B /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9530DD52EDC00FB1D6B /* SDL_wave.c */; };
-		FD6526700DE8FCDD002AD96B /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B98B0DD52EDC00FB1D6B /* SDL_cpuinfo.c */; };
-		FD6526710DE8FCDD002AD96B /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9930DD52EDC00FB1D6B /* SDL_events.c */; };
-		FD6526720DE8FCDD002AD96B /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */; };
-		FD6526730DE8FCDD002AD96B /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9970DD52EDC00FB1D6B /* SDL_mouse.c */; };
-		FD6526740DE8FCDD002AD96B /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9990DD52EDC00FB1D6B /* SDL_quit.c */; };
-		FD6526750DE8FCDD002AD96B /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */; };
-		FD6526760DE8FCDD002AD96B /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */; };
-		FD6526780DE8FCDD002AD96B /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */; };
-		FD65267A0DE8FCDD002AD96B /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9D80DD52EDC00FB1D6B /* SDL.c */; };
-		FD65267B0DE8FCDD002AD96B /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA070DD52EDC00FB1D6B /* SDL_syscond.c */; };
-		FD65267C0DE8FCDD002AD96B /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA080DD52EDC00FB1D6B /* SDL_sysmutex.c */; };
-		FD65267D0DE8FCDD002AD96B /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA0A0DD52EDC00FB1D6B /* SDL_syssem.c */; };
-		FD65267E0DE8FCDD002AD96B /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA0B0DD52EDC00FB1D6B /* SDL_systhread.c */; };
-		FD65267F0DE8FCDD002AD96B /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */; };
-		FD6526800DE8FCDD002AD96B /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */; };
-		FD6526810DE8FCDD002AD96B /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA310DD52EDC00FB1D6B /* SDL_systimer.c */; };
-		FD689F030E26E5B600F90B21 /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F000E26E5B600F90B21 /* SDL_sysjoystick.m */; };
-		FD689F040E26E5B600F90B21 /* SDLUIAccelerationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F010E26E5B600F90B21 /* SDLUIAccelerationDelegate.h */; };
-		FD689F050E26E5B600F90B21 /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F020E26E5B600F90B21 /* SDLUIAccelerationDelegate.m */; };
-		FD689F1C0E26E5D900F90B21 /* SDL_uikitevents.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F0C0E26E5D900F90B21 /* SDL_uikitevents.h */; };
-		FD689F1D0E26E5D900F90B21 /* SDL_uikitevents.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */; };
-		FD689F1E0E26E5D900F90B21 /* SDL_uikitopengles.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F0E0E26E5D900F90B21 /* SDL_uikitopengles.h */; };
-		FD689F1F0E26E5D900F90B21 /* SDL_uikitopengles.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F0F0E26E5D900F90B21 /* SDL_uikitopengles.m */; };
-		FD689F200E26E5D900F90B21 /* SDL_uikitvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F100E26E5D900F90B21 /* SDL_uikitvideo.h */; };
-		FD689F210E26E5D900F90B21 /* SDL_uikitvideo.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F110E26E5D900F90B21 /* SDL_uikitvideo.m */; };
-		FD689F230E26E5D900F90B21 /* SDL_uikitview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F130E26E5D900F90B21 /* SDL_uikitview.m */; };
-		FD689F240E26E5D900F90B21 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F140E26E5D900F90B21 /* SDL_uikitwindow.h */; };
-		FD689F250E26E5D900F90B21 /* SDL_uikitwindow.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */; };
-		FD689F260E26E5D900F90B21 /* SDL_uikitopenglview.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F160E26E5D900F90B21 /* SDL_uikitopenglview.h */; };
-		FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */; };
-		FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */; };
-		FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */; };
-		FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */; };
-		FDA6844D0DF2374E00F98A1A /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683000DF2374E00F98A1A /* SDL_blit.c */; };
-		FDA6844E0DF2374E00F98A1A /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683010DF2374E00F98A1A /* SDL_blit.h */; };
-		FDA6844F0DF2374E00F98A1A /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683020DF2374E00F98A1A /* SDL_blit_0.c */; };
-		FDA684500DF2374E00F98A1A /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683030DF2374E00F98A1A /* SDL_blit_1.c */; };
-		FDA684510DF2374E00F98A1A /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683040DF2374E00F98A1A /* SDL_blit_A.c */; };
-		FDA684520DF2374E00F98A1A /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683050DF2374E00F98A1A /* SDL_blit_auto.c */; };
-		FDA684530DF2374E00F98A1A /* SDL_blit_auto.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683060DF2374E00F98A1A /* SDL_blit_auto.h */; };
-		FDA684540DF2374E00F98A1A /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683070DF2374E00F98A1A /* SDL_blit_copy.c */; };
-		FDA684550DF2374E00F98A1A /* SDL_blit_copy.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683080DF2374E00F98A1A /* SDL_blit_copy.h */; };
-		FDA684560DF2374E00F98A1A /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683090DF2374E00F98A1A /* SDL_blit_N.c */; };
-		FDA684570DF2374E00F98A1A /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */; };
-		FDA684580DF2374E00F98A1A /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */; };
-		FDA6845C0DF2374E00F98A1A /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */; };
-		FDA6845D0DF2374E00F98A1A /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */; };
-		FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683110DF2374E00F98A1A /* SDL_rect.c */; };
-		FDA684620DF2374E00F98A1A /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */; };
-		FDA684630DF2374E00F98A1A /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */; };
-		FDA684640DF2374E00F98A1A /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683170DF2374E00F98A1A /* SDL_stretch.c */; };
-		FDA684660DF2374E00F98A1A /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683190DF2374E00F98A1A /* SDL_surface.c */; };
-		FDA684670DF2374E00F98A1A /* SDL_sysvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA6831A0DF2374E00F98A1A /* SDL_sysvideo.h */; };
-		FDA684680DF2374E00F98A1A /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6831B0DF2374E00F98A1A /* SDL_video.c */; };
-		FDA685FB0DF244C800F98A1A /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F50DF244C800F98A1A /* SDL_nullevents.c */; };
-		FDA685FC0DF244C800F98A1A /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */; };
-		FDA685FF0DF244C800F98A1A /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */; };
-		FDA686000DF244C800F98A1A /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
-		006E9886119552DD001DE610 /* SDL_rwopsbundlesupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwopsbundlesupport.h; sourceTree = "<group>"; };
-		006E9887119552DD001DE610 /* SDL_rwopsbundlesupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_rwopsbundlesupport.m; sourceTree = "<group>"; };
-		0402A85512FE70C600CECEE3 /* SDL_render_gles2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gles2.c; sourceTree = "<group>"; };
-		0402A85612FE70C600CECEE3 /* SDL_shaders_gles2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shaders_gles2.c; sourceTree = "<group>"; };
-		0402A85712FE70C600CECEE3 /* SDL_shaders_gles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_gles2.h; sourceTree = "<group>"; };
-		041B2CEA12FA0F680087D585 /* SDL_render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render.c; sourceTree = "<group>"; };
-		041B2CEB12FA0F680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = "<group>"; };
-		0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = "<group>"; };
-		0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = "<group>"; };
-		04409BA212FA989600FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = "<group>"; };
-		04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = "<group>"; };
-		04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = "<group>"; };
-		04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = "<group>"; };
-		0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render_sw_c.h; sourceTree = "<group>"; };
-		0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_sw.c; sourceTree = "<group>"; };
-		0442EC5212FE1C28004C9285 /* SDL_render_gles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gles.c; sourceTree = "<group>"; };
-		0442EC5412FE1C3F004C9285 /* SDL_hints.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_hints.c; path = ../../src/SDL_hints.c; sourceTree = SOURCE_ROOT; };
-		044E5FB711E606EB0076F181 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = "<group>"; };
-		0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_slow.h; sourceTree = "<group>"; };
-		0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = "<group>"; };
-		047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syshaptic.c; sourceTree = "<group>"; };
-		047677B90EA76A31008ABAF1 /* SDL_haptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_haptic.c; path = ../../src/haptic/SDL_haptic.c; sourceTree = SOURCE_ROOT; };
-		047677BA0EA76A31008ABAF1 /* SDL_syshaptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_syshaptic.h; path = ../../src/haptic/SDL_syshaptic.h; sourceTree = SOURCE_ROOT; };
-		047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = "<group>"; };
-		04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture_c.h; sourceTree = "<group>"; };
-		04BA9D6011EF474A00B60E01 /* SDL_gesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gesture.c; sourceTree = "<group>"; };
-		04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch_c.h; sourceTree = "<group>"; };
-		04BA9D6211EF474A00B60E01 /* SDL_touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_touch.c; sourceTree = "<group>"; };
-		04BAC09A1300C1290055DE28 /* SDL_assert_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert_c.h; path = ../../src/SDL_assert_c.h; sourceTree = SOURCE_ROOT; };
-		04BAC09B1300C1290055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_log.c; path = ../../src/SDL_log.c; sourceTree = SOURCE_ROOT; };
-		04F2AF551104ABD200D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; };
-		04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
-		04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendfillrect.h; sourceTree = "<group>"; };
-		04F7806C12FB751400FC43C0 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = "<group>"; };
-		04F7806D12FB751400FC43C0 /* SDL_blendline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendline.h; sourceTree = "<group>"; };
-		04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = "<group>"; };
-		04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendpoint.h; sourceTree = "<group>"; };
-		04F7807012FB751400FC43C0 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = "<group>"; };
-		04F7807112FB751400FC43C0 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = "<group>"; };
-		04F7807212FB751400FC43C0 /* SDL_drawline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawline.h; sourceTree = "<group>"; };
-		04F7807312FB751400FC43C0 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = "<group>"; };
-		04F7807412FB751400FC43C0 /* SDL_drawpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawpoint.h; sourceTree = "<group>"; };
-		04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullframebuffer_c.h; sourceTree = "<group>"; };
-		04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullframebuffer.c; sourceTree = "<group>"; };
-		04FFAB8912E23B8D00BA343D /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = "<group>"; };
-		04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = "<group>"; };
-		56C181DE17C44D5E00406AE3 /* SDL_filesystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_filesystem.h; sourceTree = "<group>"; };
-		56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_sysfilesystem.m; path = ../../src/filesystem/cocoa/SDL_sysfilesystem.m; sourceTree = "<group>"; };
-		56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_coreaudio.c; path = coreaudio/SDL_coreaudio.c; sourceTree = "<group>"; };
-		56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_coreaudio.h; path = coreaudio/SDL_coreaudio.h; sourceTree = "<group>"; };
-		56ED04E0118A8EE200A56AA6 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_power.c; path = ../../src/power/SDL_power.c; sourceTree = SOURCE_ROOT; };
-		56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_syspower.m; path = ../../src/power/uikit/SDL_syspower.m; sourceTree = SOURCE_ROOT; };
-		93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitviewcontroller.h; sourceTree = "<group>"; };
-		93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitviewcontroller.m; sourceTree = "<group>"; };
-		AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gamecontroller.c; sourceTree = "<group>"; };
-		AA0AD06416647BD400CE5896 /* SDL_gamecontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamecontroller.h; sourceTree = "<group>"; };
-		AA0F8494178D5F1A00823F9D /* SDL_systls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systls.c; sourceTree = "<group>"; };
-		AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmodes.h; sourceTree = "<group>"; };
-		AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmodes.m; sourceTree = "<group>"; };
-		AA628AD9159369E3005138DD /* SDL_rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rotate.c; sourceTree = "<group>"; };
-		AA628ADA159369E3005138DD /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = "<group>"; };
-		AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dropevents_c.h; sourceTree = "<group>"; };
-		AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dropevents.c; sourceTree = "<group>"; };
-		AA7558651595D55500BBD41B /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = "<group>"; };
-		AA7558661595D55500BBD41B /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = "<group>"; };
-		AA7558671595D55500BBD41B /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_assert.h; sourceTree = "<group>"; };
-		AA7558681595D55500BBD41B /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_atomic.h; sourceTree = "<group>"; };
-		AA7558691595D55500BBD41B /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio.h; sourceTree = "<group>"; };
-		AA75586A1595D55500BBD41B /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendmode.h; sourceTree = "<group>"; };
-		AA75586B1595D55500BBD41B /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboard.h; sourceTree = "<group>"; };
-		AA75586C1595D55500BBD41B /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_iphoneos.h; sourceTree = "<group>"; };
-		AA75586D1595D55500BBD41B /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config.h; sourceTree = "<group>"; };
-		AA75586E1595D55500BBD41B /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_copying.h; sourceTree = "<group>"; };
-		AA75586F1595D55500BBD41B /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cpuinfo.h; sourceTree = "<group>"; };
-		AA7558701595D55500BBD41B /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_endian.h; sourceTree = "<group>"; };
-		AA7558711595D55500BBD41B /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error.h; sourceTree = "<group>"; };
-		AA7558721595D55500BBD41B /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events.h; sourceTree = "<group>"; };
-		AA7558731595D55500BBD41B /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture.h; sourceTree = "<group>"; };
-		AA7558741595D55500BBD41B /* SDL_haptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_haptic.h; sourceTree = "<group>"; };
-		AA7558751595D55500BBD41B /* SDL_hints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hints.h; sourceTree = "<group>"; };
-		AA7558771595D55500BBD41B /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = "<group>"; };
-		AA7558781595D55500BBD41B /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard.h; sourceTree = "<group>"; };
-		AA7558791595D55500BBD41B /* SDL_keycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keycode.h; sourceTree = "<group>"; };
-		AA75587A1595D55500BBD41B /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_loadso.h; sourceTree = "<group>"; };
-		AA75587B1595D55500BBD41B /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_log.h; sourceTree = "<group>"; };
-		AA75587C1595D55500BBD41B /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_main.h; sourceTree = "<group>"; };
-		AA75587D1595D55500BBD41B /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse.h; sourceTree = "<group>"; };
-		AA75587E1595D55500BBD41B /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mutex.h; sourceTree = "<group>"; };
-		AA75587F1595D55500BBD41B /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_name.h; sourceTree = "<group>"; };
-		AA7558801595D55500BBD41B /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengl.h; sourceTree = "<group>"; };
-		AA7558811595D55500BBD41B /* SDL_opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles.h; sourceTree = "<group>"; };
-		AA7558821595D55500BBD41B /* SDL_opengles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles2.h; sourceTree = "<group>"; };
-		AA7558831595D55500BBD41B /* SDL_pixels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels.h; sourceTree = "<group>"; };
-		AA7558841595D55500BBD41B /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_platform.h; sourceTree = "<group>"; };
-		AA7558851595D55500BBD41B /* SDL_power.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_power.h; sourceTree = "<group>"; };
-		AA7558861595D55500BBD41B /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_quit.h; sourceTree = "<group>"; };
-		AA7558871595D55500BBD41B /* SDL_rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect.h; sourceTree = "<group>"; };
-		AA7558881595D55500BBD41B /* SDL_render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render.h; sourceTree = "<group>"; };
-		AA7558891595D55500BBD41B /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_revision.h; sourceTree = "<group>"; };
-		AA75588A1595D55500BBD41B /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwops.h; sourceTree = "<group>"; };
-		AA75588B1595D55500BBD41B /* SDL_scancode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scancode.h; sourceTree = "<group>"; };
-		AA75588C1595D55500BBD41B /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape.h; sourceTree = "<group>"; };
-		AA75588D1595D55500BBD41B /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_stdinc.h; sourceTree = "<group>"; };
-		AA75588E1595D55500BBD41B /* SDL_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_surface.h; sourceTree = "<group>"; };
-		AA75588F1595D55500BBD41B /* SDL_system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_system.h; sourceTree = "<group>"; };
-		AA7558901595D55500BBD41B /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syswm.h; sourceTree = "<group>"; };
-		AA7558911595D55500BBD41B /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread.h; sourceTree = "<group>"; };
-		AA7558921595D55500BBD41B /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer.h; sourceTree = "<group>"; };
-		AA7558931595D55500BBD41B /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch.h; sourceTree = "<group>"; };
-		AA7558941595D55500BBD41B /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_types.h; sourceTree = "<group>"; };
-		AA7558951595D55500BBD41B /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_version.h; sourceTree = "<group>"; };
-		AA7558961595D55500BBD41B /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = "<group>"; };
-		AA7558971595D55500BBD41B /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = "<group>"; };
-		AA9FF9501637C6E5000DF050 /* SDL_messagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_messagebox.h; sourceTree = "<group>"; };
-		AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmessagebox.h; sourceTree = "<group>"; };
-		AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmessagebox.m; sourceTree = "<group>"; };
-		AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = "<group>"; };
-		FD0BBFEF0E3933DD00D833B1 /* SDL_uikitview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitview.h; sourceTree = "<group>"; };
-		FD3F4A700DEA620800C5B771 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = "<group>"; };
-		FD3F4A710DEA620800C5B771 /* SDL_iconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_iconv.c; sourceTree = "<group>"; };
-		FD3F4A720DEA620800C5B771 /* SDL_malloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_malloc.c; sourceTree = "<group>"; };
-		FD3F4A730DEA620800C5B771 /* SDL_qsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_qsort.c; sourceTree = "<group>"; };
-		FD3F4A740DEA620800C5B771 /* SDL_stdlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_stdlib.c; sourceTree = "<group>"; };
-		FD3F4A750DEA620800C5B771 /* SDL_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_string.c; sourceTree = "<group>"; };
-		FD5F9D1E0E0E08B3008E885B /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = "<group>"; };
-		FD5F9D1F0E0E08B3008E885B /* SDL_joystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick_c.h; sourceTree = "<group>"; };
-		FD5F9D200E0E08B3008E885B /* SDL_sysjoystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick.h; sourceTree = "<group>"; };
-		FD6526630DE8FCCB002AD96B /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; };
-		FD689F000E26E5B600F90B21 /* SDL_sysjoystick.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_sysjoystick.m; sourceTree = "<group>"; };
-		FD689F010E26E5B600F90B21 /* SDLUIAccelerationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLUIAccelerationDelegate.h; sourceTree = "<group>"; };
-		FD689F020E26E5B600F90B21 /* SDLUIAccelerationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLUIAccelerationDelegate.m; sourceTree = "<group>"; };
-		FD689F0C0E26E5D900F90B21 /* SDL_uikitevents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitevents.h; sourceTree = "<group>"; };
-		FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitevents.m; sourceTree = "<group>"; };
-		FD689F0E0E26E5D900F90B21 /* SDL_uikitopengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitopengles.h; sourceTree = "<group>"; };
-		FD689F0F0E26E5D900F90B21 /* SDL_uikitopengles.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitopengles.m; sourceTree = "<group>"; };
-		FD689F100E26E5D900F90B21 /* SDL_uikitvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitvideo.h; sourceTree = "<group>"; };
-		FD689F110E26E5D900F90B21 /* SDL_uikitvideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitvideo.m; sourceTree = "<group>"; };
-		FD689F130E26E5D900F90B21 /* SDL_uikitview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitview.m; sourceTree = "<group>"; };
-		FD689F140E26E5D900F90B21 /* SDL_uikitwindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitwindow.h; sourceTree = "<group>"; };
-		FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitwindow.m; sourceTree = "<group>"; };
-		FD689F160E26E5D900F90B21 /* SDL_uikitopenglview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitopenglview.h; sourceTree = "<group>"; };
-		FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitopenglview.m; sourceTree = "<group>"; };
-		FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitappdelegate.m; sourceTree = "<group>"; };
-		FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitappdelegate.h; sourceTree = "<group>"; };
-		FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = "<group>"; };
-		FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = "<group>"; };
-		FD99B91E0DD52EDC00FB1D6B /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = "<group>"; };
-		FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = "<group>"; };
-		FD99B9450DD52EDC00FB1D6B /* SDL_audio_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_c.h; sourceTree = "<group>"; };
-		FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiocvt.c; sourceTree = "<group>"; };
-		FD99B9490DD52EDC00FB1D6B /* SDL_audiomem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiomem.h; sourceTree = "<group>"; };
-		FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiotypecvt.c; sourceTree = "<group>"; };
-		FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mixer.c; sourceTree = "<group>"; };
-		FD99B9520DD52EDC00FB1D6B /* SDL_sysaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysaudio.h; sourceTree = "<group>"; };
-		FD99B9530DD52EDC00FB1D6B /* SDL_wave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_wave.c; sourceTree = "<group>"; };
-		FD99B9540DD52EDC00FB1D6B /* SDL_wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_wave.h; sourceTree = "<group>"; };
-		FD99B98B0DD52EDC00FB1D6B /* SDL_cpuinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_cpuinfo.c; sourceTree = "<group>"; };
-		FD99B98D0DD52EDC00FB1D6B /* blank_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blank_cursor.h; sourceTree = "<group>"; };
-		FD99B98E0DD52EDC00FB1D6B /* default_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default_cursor.h; sourceTree = "<group>"; };
-		FD99B98F0DD52EDC00FB1D6B /* scancodes_darwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_darwin.h; sourceTree = "<group>"; };
-		FD99B9900DD52EDC00FB1D6B /* scancodes_linux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_linux.h; sourceTree = "<group>"; };
-		FD99B9920DD52EDC00FB1D6B /* scancodes_xfree86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_xfree86.h; sourceTree = "<group>"; };
-		FD99B9930DD52EDC00FB1D6B /* SDL_events.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_events.c; sourceTree = "<group>"; };
-		FD99B9940DD52EDC00FB1D6B /* SDL_events_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events_c.h; sourceTree = "<group>"; };
-		FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_keyboard.c; sourceTree = "<group>"; };
-		FD99B9960DD52EDC00FB1D6B /* SDL_keyboard_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard_c.h; sourceTree = "<group>"; };
-		FD99B9970DD52EDC00FB1D6B /* SDL_mouse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mouse.c; sourceTree = "<group>"; };
-		FD99B9980DD52EDC00FB1D6B /* SDL_mouse_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse_c.h; sourceTree = "<group>"; };
-		FD99B9990DD52EDC00FB1D6B /* SDL_quit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_quit.c; sourceTree = "<group>"; };
-		FD99B99A0DD52EDC00FB1D6B /* SDL_sysevents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysevents.h; sourceTree = "<group>"; };
-		FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_windowevents.c; sourceTree = "<group>"; };
-		FD99B99C0DD52EDC00FB1D6B /* SDL_windowevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_windowevents_c.h; sourceTree = "<group>"; };
-		FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rwops.c; sourceTree = "<group>"; };
-		FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_error_c.h; path = ../../src/SDL_error_c.h; sourceTree = "<group>"; };
-		FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_error.c; path = ../../src/SDL_error.c; sourceTree = "<group>"; };
-		FD99B9D80DD52EDC00FB1D6B /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL.c; path = ../../src/SDL.c; sourceTree = "<group>"; };
-		FD99BA070DD52EDC00FB1D6B /* SDL_syscond.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syscond.c; sourceTree = "<group>"; };
-		FD99BA080DD52EDC00FB1D6B /* SDL_sysmutex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysmutex.c; sourceTree = "<group>"; };
-		FD99BA090DD52EDC00FB1D6B /* SDL_sysmutex_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysmutex_c.h; sourceTree = "<group>"; };
-		FD99BA0A0DD52EDC00FB1D6B /* SDL_syssem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syssem.c; sourceTree = "<group>"; };
-		FD99BA0B0DD52EDC00FB1D6B /* SDL_systhread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systhread.c; sourceTree = "<group>"; };
-		FD99BA0C0DD52EDC00FB1D6B /* SDL_systhread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread_c.h; sourceTree = "<group>"; };
-		FD99BA140DD52EDC00FB1D6B /* SDL_systhread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread.h; sourceTree = "<group>"; };
-		FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_thread.c; sourceTree = "<group>"; };
-		FD99BA160DD52EDC00FB1D6B /* SDL_thread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread_c.h; sourceTree = "<group>"; };
-		FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_timer.c; sourceTree = "<group>"; };
-		FD99BA2F0DD52EDC00FB1D6B /* SDL_timer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer_c.h; sourceTree = "<group>"; };
-		FD99BA310DD52EDC00FB1D6B /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = "<group>"; };
-		FDA683000DF2374E00F98A1A /* SDL_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit.c; sourceTree = "<group>"; };
-		FDA683010DF2374E00F98A1A /* SDL_blit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit.h; sourceTree = "<group>"; };
-		FDA683020DF2374E00F98A1A /* SDL_blit_0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_0.c; sourceTree = "<group>"; };
-		FDA683030DF2374E00F98A1A /* SDL_blit_1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_1.c; sourceTree = "<group>"; };
-		FDA683040DF2374E00F98A1A /* SDL_blit_A.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_A.c; sourceTree = "<group>"; };
-		FDA683050DF2374E00F98A1A /* SDL_blit_auto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_auto.c; sourceTree = "<group>"; };
-		FDA683060DF2374E00F98A1A /* SDL_blit_auto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_auto.h; sourceTree = "<group>"; };
-		FDA683070DF2374E00F98A1A /* SDL_blit_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_copy.c; sourceTree = "<group>"; };
-		FDA683080DF2374E00F98A1A /* SDL_blit_copy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_copy.h; sourceTree = "<group>"; };
-		FDA683090DF2374E00F98A1A /* SDL_blit_N.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_N.c; sourceTree = "<group>"; };
-		FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_slow.c; sourceTree = "<group>"; };
-		FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = "<group>"; };
-		FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = "<group>"; };
-		FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels_c.h; sourceTree = "<group>"; };
-		FDA683110DF2374E00F98A1A /* SDL_rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rect.c; sourceTree = "<group>"; };
-		FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_RLEaccel.c; sourceTree = "<group>"; };
-		FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_RLEaccel_c.h; sourceTree = "<group>"; };
-		FDA683170DF2374E00F98A1A /* SDL_stretch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_stretch.c; sourceTree = "<group>"; };
-		FDA683190DF2374E00F98A1A /* SDL_surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_surface.c; sourceTree = "<group>"; };
-		FDA6831A0DF2374E00F98A1A /* SDL_sysvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysvideo.h; sourceTree = "<group>"; };
-		FDA6831B0DF2374E00F98A1A /* SDL_video.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_video.c; sourceTree = "<group>"; };
-		FDA685F50DF244C800F98A1A /* SDL_nullevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullevents.c; sourceTree = "<group>"; };
-		FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = "<group>"; };
-		FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = "<group>"; };
-		FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = "<group>"; };
-		FDC261780E3A3FC8001C4554 /* keyinfotable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyinfotable.h; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXGroup section */
-		006E9885119552DD001DE610 /* cocoa */ = {
-			isa = PBXGroup;
-			children = (
-				006E9886119552DD001DE610 /* SDL_rwopsbundlesupport.h */,
-				006E9887119552DD001DE610 /* SDL_rwopsbundlesupport.m */,
-			);
-			path = cocoa;
-			sourceTree = "<group>";
-		};
-		0402A85412FE70C600CECEE3 /* opengles2 */ = {
-			isa = PBXGroup;
-			children = (
-				0402A85512FE70C600CECEE3 /* SDL_render_gles2.c */,
-				0402A85612FE70C600CECEE3 /* SDL_shaders_gles2.c */,
-				0402A85712FE70C600CECEE3 /* SDL_shaders_gles2.h */,
-			);
-			path = opengles2;
-			sourceTree = "<group>";
-		};
-		041B2CE312FA0F680087D585 /* render */ = {
-			isa = PBXGroup;
-			children = (
-				041B2CE812FA0F680087D585 /* opengles */,
-				0402A85412FE70C600CECEE3 /* opengles2 */,
-				041B2CEC12FA0F680087D585 /* software */,
-				04409BA212FA989600FB9AA8 /* mmx.h */,
-				041B2CEA12FA0F680087D585 /* SDL_render.c */,
-				041B2CEB12FA0F680087D585 /* SDL_sysrender.h */,
-				04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */,
-				04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */,
-				04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */,
-			);
-			name = render;
-			path = ../../src/render;
-			sourceTree = SOURCE_ROOT;
-		};
-		041B2CE812FA0F680087D585 /* opengles */ = {
-			isa = PBXGroup;
-			children = (
-				0442EC5212FE1C28004C9285 /* SDL_render_gles.c */,
-			);
-			path = opengles;
-			sourceTree = "<group>";
-		};
-		041B2CEC12FA0F680087D585 /* software */ = {
-			isa = PBXGroup;
-			children = (
-				04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */,
-				04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */,
-				04F7806C12FB751400FC43C0 /* SDL_blendline.c */,
-				04F7806D12FB751400FC43C0 /* SDL_blendline.h */,
-				04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */,
-				04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */,
-				04F7807012FB751400FC43C0 /* SDL_draw.h */,
-				04F7807112FB751400FC43C0 /* SDL_drawline.c */,
-				04F7807212FB751400FC43C0 /* SDL_drawline.h */,
-				04F7807312FB751400FC43C0 /* SDL_drawpoint.c */,
-				04F7807412FB751400FC43C0 /* SDL_drawpoint.h */,
-				0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */,
-				0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */,
-				AA628AD9159369E3005138DD /* SDL_rotate.c */,
-				AA628ADA159369E3005138DD /* SDL_rotate.h */,
-			);
-			path = software;
-			sourceTree = "<group>";
-		};
-		047677B60EA769DF008ABAF1 /* haptic */ = {
-			isa = PBXGroup;
-			children = (
-				047677B70EA76A31008ABAF1 /* dummy */,
-				047677B90EA76A31008ABAF1 /* SDL_haptic.c */,
-				047677BA0EA76A31008ABAF1 /* SDL_syshaptic.h */,
-			);
-			name = haptic;
-			sourceTree = "<group>";
-		};
-		047677B70EA76A31008ABAF1 /* dummy */ = {
-			isa = PBXGroup;
-			children = (
-				047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */,
-			);
-			name = dummy;
-			path = ../../src/haptic/dummy;
-			sourceTree = SOURCE_ROOT;
-		};
-		047AF1B10EA98D6C00811173 /* dummy */ = {
-			isa = PBXGroup;
-			children = (
-				047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */,
-			);
-			path = dummy;
-			sourceTree = "<group>";
-		};
-		04B2ECEF1025CEB900F9BC5F /* atomic */ = {
-			isa = PBXGroup;
-			children = (
-				04FFAB8912E23B8D00BA343D /* SDL_atomic.c */,
-				04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */,
-			);
-			name = atomic;
-			path = ../../src/atomic;
-			sourceTree = SOURCE_ROOT;
-		};
-		19C28FACFE9D520D11CA2CBB /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				FD6526630DE8FCCB002AD96B /* libSDL2.a */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
-			isa = PBXGroup;
-			children = (
-				FD99B8BC0DD52E5C00FB1D6B /* Public Headers */,
-				FD99B8BD0DD52E6D00FB1D6B /* Library Source */,
-				19C28FACFE9D520D11CA2CBB /* Products */,
-			);
-			name = CustomTemplate;
-			sourceTree = "<group>";
-		};
-		56C181E017C44D6900406AE3 /* filesystem */ = {
-			isa = PBXGroup;
-			children = (
-				56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */,
-			);
-			name = filesystem;
-			sourceTree = "<group>";
-		};
-		56EA86F813E9EBF9002E47EB /* coreaudio */ = {
-			isa = PBXGroup;
-			children = (
-				56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */,
-				56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */,
-			);
-			name = coreaudio;
-			sourceTree = "<group>";
-		};
-		56ED04DE118A8E9A00A56AA6 /* power */ = {
-			isa = PBXGroup;
-			children = (
-				56ED04E0118A8EE200A56AA6 /* SDL_power.c */,
-				56ED04DF118A8EB700A56AA6 /* uikit */,
-			);
-			name = power;
-			sourceTree = "<group>";
-		};
-		56ED04DF118A8EB700A56AA6 /* uikit */ = {
-			isa = PBXGroup;
-			children = (
-				56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */,
-			);
-			name = uikit;
-			sourceTree = "<group>";
-		};
-		FD3F4A6F0DEA620800C5B771 /* stdlib */ = {
-			isa = PBXGroup;
-			children = (
-				FD3F4A700DEA620800C5B771 /* SDL_getenv.c */,
-				FD3F4A710DEA620800C5B771 /* SDL_iconv.c */,
-				FD3F4A720DEA620800C5B771 /* SDL_malloc.c */,
-				FD3F4A730DEA620800C5B771 /* SDL_qsort.c */,
-				FD3F4A740DEA620800C5B771 /* SDL_stdlib.c */,
-				FD3F4A750DEA620800C5B771 /* SDL_string.c */,
-			);
-			name = stdlib;
-			path = ../../src/stdlib;
-			sourceTree = SOURCE_ROOT;
-		};
-		FD5F9D080E0E08B3008E885B /* joystick */ = {
-			isa = PBXGroup;
-			children = (
-				FD689EFF0E26E5B600F90B21 /* iphoneos */,
-				AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */,
-				FD5F9D1E0E0E08B3008E885B /* SDL_joystick.c */,
-				FD5F9D1F0E0E08B3008E885B /* SDL_joystick_c.h */,
-				FD5F9D200E0E08B3008E885B /* SDL_sysjoystick.h */,
-			);
-			name = joystick;
-			path = ../../src/joystick;
-			sourceTree = SOURCE_ROOT;
-		};
-		FD689EFF0E26E5B600F90B21 /* iphoneos */ = {
-			isa = PBXGroup;
-			children = (
-				FD689F000E26E5B600F90B21 /* SDL_sysjoystick.m */,
-				FD689F010E26E5B600F90B21 /* SDLUIAccelerationDelegate.h */,
-				FD689F020E26E5B600F90B21 /* SDLUIAccelerationDelegate.m */,
-			);
-			path = iphoneos;
-			sourceTree = "<group>";
-		};
-		FD689F090E26E5D900F90B21 /* uikit */ = {
-			isa = PBXGroup;
-			children = (
-				FDC261780E3A3FC8001C4554 /* keyinfotable.h */,
-				FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */,
-				FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */,
-				FD689F0C0E26E5D900F90B21 /* SDL_uikitevents.h */,
-				FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */,
-				AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */,
-				AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */,
-				AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */,
-				AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */,
-				FD689F0E0E26E5D900F90B21 /* SDL_uikitopengles.h */,
-				FD689F0F0E26E5D900F90B21 /* SDL_uikitopengles.m */,
-				FD689F160E26E5D900F90B21 /* SDL_uikitopenglview.h */,
-				FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */,
-				FD689F100E26E5D900F90B21 /* SDL_uikitvideo.h */,
-				FD689F110E26E5D900F90B21 /* SDL_uikitvideo.m */,
-				FD0BBFEF0E3933DD00D833B1 /* SDL_uikitview.h */,
-				FD689F130E26E5D900F90B21 /* SDL_uikitview.m */,
-				93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */,
-				93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */,
-				FD689F140E26E5D900F90B21 /* SDL_uikitwindow.h */,
-				FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */,
-			);
-			path = uikit;
-			sourceTree = "<group>";
-		};
-		FD8BD8150E27E25900B52CD5 /* loadso */ = {
-			isa = PBXGroup;
-			children = (
-				047AF1B10EA98D6C00811173 /* dummy */,
-				FD8BD8180E27E25900B52CD5 /* dlopen */,
-			);
-			name = loadso;
-			path = ../../src/loadso;
-			sourceTree = SOURCE_ROOT;
-		};
-		FD8BD8180E27E25900B52CD5 /* dlopen */ = {
-			isa = PBXGroup;
-			children = (
-				FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */,
-			);
-			path = dlopen;
-			sourceTree = "<group>";
-		};
-		FD99B8BC0DD52E5C00FB1D6B /* Public Headers */ = {
-			isa = PBXGroup;
-			children = (
-				AA7558651595D55500BBD41B /* begin_code.h */,
-				AA7558661595D55500BBD41B /* close_code.h */,
-				AA7558971595D55500BBD41B /* SDL.h */,
-				AA7558671595D55500BBD41B /* SDL_assert.h */,
-				AA7558681595D55500BBD41B /* SDL_atomic.h */,
-				AA7558691595D55500BBD41B /* SDL_audio.h */,
-				AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */,
-				AA75586A1595D55500BBD41B /* SDL_blendmode.h */,
-				AA75586B1595D55500BBD41B /* SDL_clipboard.h */,
-				AA75586D1595D55500BBD41B /* SDL_config.h */,
-				AA75586C1595D55500BBD41B /* SDL_config_iphoneos.h */,
-				AA75586E1595D55500BBD41B /* SDL_copying.h */,
-				AA75586F1595D55500BBD41B /* SDL_cpuinfo.h */,
-				AA7558701595D55500BBD41B /* SDL_endian.h */,
-				AA7558711595D55500BBD41B /* SDL_error.h */,
-				AA7558721595D55500BBD41B /* SDL_events.h */,
-				56C181DE17C44D5E00406AE3 /* SDL_filesystem.h */,
-				AA0AD06416647BD400CE5896 /* SDL_gamecontroller.h */,
-				AA7558731595D55500BBD41B /* SDL_gesture.h */,
-				AA7558741595D55500BBD41B /* SDL_haptic.h */,
-				AA7558751595D55500BBD41B /* SDL_hints.h */,
-				AA7558771595D55500BBD41B /* SDL_joystick.h */,
-				AA7558781595D55500BBD41B /* SDL_keyboard.h */,
-				AA7558791595D55500BBD41B /* SDL_keycode.h */,
-				AA75587A1595D55500BBD41B /* SDL_loadso.h */,
-				AA75587B1595D55500BBD41B /* SDL_log.h */,
-				AA75587C1595D55500BBD41B /* SDL_main.h */,
-				AA9FF9501637C6E5000DF050 /* SDL_messagebox.h */,
-				AA75587D1595D55500BBD41B /* SDL_mouse.h */,
-				AA75587E1595D55500BBD41B /* SDL_mutex.h */,
-				AA75587F1595D55500BBD41B /* SDL_name.h */,
-				AA7558801595D55500BBD41B /* SDL_opengl.h */,
-				AA7558811595D55500BBD41B /* SDL_opengles.h */,
-				AA7558821595D55500BBD41B /* SDL_opengles2.h */,
-				AA7558831595D55500BBD41B /* SDL_pixels.h */,
-				AA7558841595D55500BBD41B /* SDL_platform.h */,
-				AA7558851595D55500BBD41B /* SDL_power.h */,
-				AA7558861595D55500BBD41B /* SDL_quit.h */,
-				AA7558871595D55500BBD41B /* SDL_rect.h */,
-				AA7558881595D55500BBD41B /* SDL_render.h */,
-				AA7558891595D55500BBD41B /* SDL_revision.h */,
-				AA75588A1595D55500BBD41B /* SDL_rwops.h */,
-				AA75588B1595D55500BBD41B /* SDL_scancode.h */,
-				AA75588C1595D55500BBD41B /* SDL_shape.h */,
-				AA75588D1595D55500BBD41B /* SDL_stdinc.h */,
-				AA75588E1595D55500BBD41B /* SDL_surface.h */,
-				AA75588F1595D55500BBD41B /* SDL_system.h */,
-				AA7558901595D55500BBD41B /* SDL_syswm.h */,
-				AA7558911595D55500BBD41B /* SDL_thread.h */,
-				AA7558921595D55500BBD41B /* SDL_timer.h */,
-				AA7558931595D55500BBD41B /* SDL_touch.h */,
-				AA7558941595D55500BBD41B /* SDL_types.h */,
-				AA7558951595D55500BBD41B /* SDL_version.h */,
-				AA7558961595D55500BBD41B /* SDL_video.h */,
-			);
-			name = "Public Headers";
-			path = ../../include;
-			sourceTree = "<group>";
-		};
-		FD99B8BD0DD52E6D00FB1D6B /* Library Source */ = {
-			isa = PBXGroup;
-			children = (
-				04B2ECEF1025CEB900F9BC5F /* atomic */,
-				FD99B8FB0DD52EDC00FB1D6B /* audio */,
-				FD99B98A0DD52EDC00FB1D6B /* cpuinfo */,
-				FD99B98C0DD52EDC00FB1D6B /* events */,
-				FD99B99D0DD52EDC00FB1D6B /* file */,
-				56C181E017C44D6900406AE3 /* filesystem */,
-				047677B60EA769DF008ABAF1 /* haptic */,
-				FD5F9D080E0E08B3008E885B /* joystick */,
-				FD8BD8150E27E25900B52CD5 /* loadso */,
-				56ED04DE118A8E9A00A56AA6 /* power */,
-				041B2CE312FA0F680087D585 /* render */,
-				FD3F4A6F0DEA620800C5B771 /* stdlib */,
-				FD99B9E00DD52EDC00FB1D6B /* thread */,
-				FD99BA1E0DD52EDC00FB1D6B /* timer */,
-				FDA682420DF2374D00F98A1A /* video */,
-				04F2AF551104ABD200D6DDF7 /* SDL_assert.c */,
-				04BAC09A1300C1290055DE28 /* SDL_assert_c.h */,
-				FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */,
-				FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */,
-				0442EC5412FE1C3F004C9285 /* SDL_hints.c */,
-				04BAC09B1300C1290055DE28 /* SDL_log.c */,
-				FD99B9D80DD52EDC00FB1D6B /* SDL.c */,
-			);
-			name = "Library Source";
-			sourceTree = "<group>";
-		};
-		FD99B8FB0DD52EDC00FB1D6B /* audio */ = {
-			isa = PBXGroup;
-			children = (
-				56EA86F813E9EBF9002E47EB /* coreaudio */,
-				FD99B91C0DD52EDC00FB1D6B /* dummy */,
-				FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */,
-				FD99B9450DD52EDC00FB1D6B /* SDL_audio_c.h */,
-				FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */,
-				FD99B9490DD52EDC00FB1D6B /* SDL_audiomem.h */,
-				FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */,
-				FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */,
-				FD99B9520DD52EDC00FB1D6B /* SDL_sysaudio.h */,
-				FD99B9530DD52EDC00FB1D6B /* SDL_wave.c */,
-				FD99B9540DD52EDC00FB1D6B /* SDL_wave.h */,
-			);
-			name = audio;
-			path = ../../src/audio;
-			sourceTree = "<group>";
-		};
-		FD99B91C0DD52EDC00FB1D6B /* dummy */ = {
-			isa = PBXGroup;
-			children = (
-				FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */,
-				FD99B91E0DD52EDC00FB1D6B /* SDL_dummyaudio.h */,
-			);
-			path = dummy;
-			sourceTree = "<group>";
-		};
-		FD99B98A0DD52EDC00FB1D6B /* cpuinfo */ = {
-			isa = PBXGroup;
-			children = (
-				FD99B98B0DD52EDC00FB1D6B /* SDL_cpuinfo.c */,
-			);
-			name = cpuinfo;
-			path = ../../src/cpuinfo;
-			sourceTree = "<group>";
-		};
-		FD99B98C0DD52EDC00FB1D6B /* events */ = {
-			isa = PBXGroup;
-			children = (
-				FD99B98D0DD52EDC00FB1D6B /* blank_cursor.h */,
-				FD99B98E0DD52EDC00FB1D6B /* default_cursor.h */,
-				FD99B98F0DD52EDC00FB1D6B /* scancodes_darwin.h */,
-				FD99B9900DD52EDC00FB1D6B /* scancodes_linux.h */,
-				FD99B9920DD52EDC00FB1D6B /* scancodes_xfree86.h */,
-				0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */,
-				0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */,
-				AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */,
-				AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */,
-				FD99B9930DD52EDC00FB1D6B /* SDL_events.c */,
-				FD99B9940DD52EDC00FB1D6B /* SDL_events_c.h */,
-				04BA9D6011EF474A00B60E01 /* SDL_gesture.c */,
-				04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */,
-				FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */,
-				FD99B9960DD52EDC00FB1D6B /* SDL_keyboard_c.h */,
-				FD99B9970DD52EDC00FB1D6B /* SDL_mouse.c */,
-				FD99B9980DD52EDC00FB1D6B /* SDL_mouse_c.h */,
-				FD99B9990DD52EDC00FB1D6B /* SDL_quit.c */,
-				FD99B99A0DD52EDC00FB1D6B /* SDL_sysevents.h */,
-				04BA9D6211EF474A00B60E01 /* SDL_touch.c */,
-				04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */,
-				FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */,
-				FD99B99C0DD52EDC00FB1D6B /* SDL_windowevents_c.h */,
-			);
-			name = events;
-			path = ../../src/events;
-			sourceTree = "<group>";
-		};
-		FD99B99D0DD52EDC00FB1D6B /* file */ = {
-			isa = PBXGroup;
-			children = (
-				006E9885119552DD001DE610 /* cocoa */,
-				FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */,
-			);
-			name = file;
-			path = ../../src/file;
-			sourceTree = "<group>";
-		};
-		FD99B9E00DD52EDC00FB1D6B /* thread */ = {
-			isa = PBXGroup;
-			children = (
-				FD99BA060DD52EDC00FB1D6B /* pthread */,
-				FD99BA140DD52EDC00FB1D6B /* SDL_systhread.h */,
-				FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */,
-				FD99BA160DD52EDC00FB1D6B /* SDL_thread_c.h */,
-			);
-			name = thread;
-			path = ../../src/thread;
-			sourceTree = "<group>";
-		};
-		FD99BA060DD52EDC00FB1D6B /* pthread */ = {
-			isa = PBXGroup;
-			children = (
-				FD99BA070DD52EDC00FB1D6B /* SDL_syscond.c */,
-				FD99BA080DD52EDC00FB1D6B /* SDL_sysmutex.c */,
-				FD99BA090DD52EDC00FB1D6B /* SDL_sysmutex_c.h */,
-				FD99BA0A0DD52EDC00FB1D6B /* SDL_syssem.c */,
-				FD99BA0B0DD52EDC00FB1D6B /* SDL_systhread.c */,
-				FD99BA0C0DD52EDC00FB1D6B /* SDL_systhread_c.h */,
-				AA0F8494178D5F1A00823F9D /* SDL_systls.c */,
-			);
-			path = pthread;
-			sourceTree = "<group>";
-		};
-		FD99BA1E0DD52EDC00FB1D6B /* timer */ = {
-			isa = PBXGroup;
-			children = (
-				FD99BA300DD52EDC00FB1D6B /* unix */,
-				FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */,
-				FD99BA2F0DD52EDC00FB1D6B /* SDL_timer_c.h */,
-			);
-			name = timer;
-			path = ../../src/timer;
-			sourceTree = "<group>";
-		};
-		FD99BA300DD52EDC00FB1D6B /* unix */ = {
-			isa = PBXGroup;
-			children = (
-				FD99BA310DD52EDC00FB1D6B /* SDL_systimer.c */,
-			);
-			path = unix;
-			sourceTree = "<group>";
-		};
-		FDA682420DF2374D00F98A1A /* video */ = {
-			isa = PBXGroup;
-			children = (
-				FD689F090E26E5D900F90B21 /* uikit */,
-				FDA685F40DF244C800F98A1A /* dummy */,
-				FDA683000DF2374E00F98A1A /* SDL_blit.c */,
-				FDA683010DF2374E00F98A1A /* SDL_blit.h */,
-				FDA683020DF2374E00F98A1A /* SDL_blit_0.c */,
-				FDA683030DF2374E00F98A1A /* SDL_blit_1.c */,
-				FDA683040DF2374E00F98A1A /* SDL_blit_A.c */,
-				FDA683050DF2374E00F98A1A /* SDL_blit_auto.c */,
-				FDA683060DF2374E00F98A1A /* SDL_blit_auto.h */,
-				FDA683070DF2374E00F98A1A /* SDL_blit_copy.c */,
-				FDA683080DF2374E00F98A1A /* SDL_blit_copy.h */,
-				FDA683090DF2374E00F98A1A /* SDL_blit_N.c */,
-				FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */,
-				0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */,
-				FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */,
-				044E5FB711E606EB0076F181 /* SDL_clipboard.c */,
-				0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */,
-				FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */,
-				FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */,
-				FDA683110DF2374E00F98A1A /* SDL_rect.c */,
-				FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */,
-				FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */,
-				FDA683170DF2374E00F98A1A /* SDL_stretch.c */,
-				FDA683190DF2374E00F98A1A /* SDL_surface.c */,
-				FDA6831A0DF2374E00F98A1A /* SDL_sysvideo.h */,
-				FDA6831B0DF2374E00F98A1A /* SDL_video.c */,
-			);
-			name = video;
-			path = ../../src/video;
-			sourceTree = SOURCE_ROOT;
-		};
-		FDA685F40DF244C800F98A1A /* dummy */ = {
-			isa = PBXGroup;
-			children = (
-				FDA685F50DF244C800F98A1A /* SDL_nullevents.c */,
-				FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */,
-				04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */,
-				04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */,
-				FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */,
-				FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */,
-			);
-			path = dummy;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
-		FD65265F0DE8FCCB002AD96B /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDA6844E0DF2374E00F98A1A /* SDL_blit.h in Headers */,
-				FDA684530DF2374E00F98A1A /* SDL_blit_auto.h in Headers */,
-				FDA684550DF2374E00F98A1A /* SDL_blit_copy.h in Headers */,
-				FDA6845D0DF2374E00F98A1A /* SDL_pixels_c.h in Headers */,
-				FDA684630DF2374E00F98A1A /* SDL_RLEaccel_c.h in Headers */,
-				FDA684670DF2374E00F98A1A /* SDL_sysvideo.h in Headers */,
-				FDA685FC0DF244C800F98A1A /* SDL_nullevents_c.h in Headers */,
-				FDA686000DF244C800F98A1A /* SDL_nullvideo.h in Headers */,
-				FD5F9D300E0E08B3008E885B /* SDL_joystick_c.h in Headers */,
-				FD5F9D310E0E08B3008E885B /* SDL_sysjoystick.h in Headers */,
-				FD689F040E26E5B600F90B21 /* SDLUIAccelerationDelegate.h in Headers */,
-				FD689F1C0E26E5D900F90B21 /* SDL_uikitevents.h in Headers */,
-				FD689F1E0E26E5D900F90B21 /* SDL_uikitopengles.h in Headers */,
-				FD689F200E26E5D900F90B21 /* SDL_uikitvideo.h in Headers */,
-				FD689F240E26E5D900F90B21 /* SDL_uikitwindow.h in Headers */,
-				FD689F260E26E5D900F90B21 /* SDL_uikitopenglview.h in Headers */,
-				FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */,
-				047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */,
-				046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */,
-				006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
-				0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */,
-				04BA9D6311EF474A00B60E01 /* SDL_gesture_c.h in Headers */,
-				04BA9D6511EF474A00B60E01 /* SDL_touch_c.h in Headers */,
-				041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */,
-				04409BA612FA989600FB9AA8 /* mmx.h in Headers */,
-				04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
-				04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */,
-				04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */,
-				04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */,
-				04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */,
-				04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */,
-				04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */,
-				04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
-				0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */,
-				0402A85A12FE70C600CECEE3 /* SDL_shaders_gles2.h in Headers */,
-				04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */,
-				56EA86FC13E9EC2B002E47EB /* SDL_coreaudio.h in Headers */,
-				93CB792313FC5E5200BD3E05 /* SDL_uikitviewcontroller.h in Headers */,
-				AA628ADC159369E3005138DD /* SDL_rotate.h in Headers */,
-				AA7558981595D55500BBD41B /* begin_code.h in Headers */,
-				AA7558991595D55500BBD41B /* close_code.h in Headers */,
-				AA75589A1595D55500BBD41B /* SDL_assert.h in Headers */,
-				AA75589B1595D55500BBD41B /* SDL_atomic.h in Headers */,
-				AA75589C1595D55500BBD41B /* SDL_audio.h in Headers */,
-				AA75589D1595D55500BBD41B /* SDL_blendmode.h in Headers */,
-				AA75589E1595D55500BBD41B /* SDL_clipboard.h in Headers */,
-				AA75589F1595D55500BBD41B /* SDL_config_iphoneos.h in Headers */,
-				AA7558A01595D55500BBD41B /* SDL_config.h in Headers */,
-				AA7558A11595D55500BBD41B /* SDL_copying.h in Headers */,
-				AA7558A21595D55500BBD41B /* SDL_cpuinfo.h in Headers */,
-				AA7558A31595D55500BBD41B /* SDL_endian.h in Headers */,
-				AA7558A41595D55500BBD41B /* SDL_error.h in Headers */,
-				AA7558A51595D55500BBD41B /* SDL_events.h in Headers */,
-				AA7558A61595D55500BBD41B /* SDL_gesture.h in Headers */,
-				AA7558A71595D55500BBD41B /* SDL_haptic.h in Headers */,
-				AA7558A81595D55500BBD41B /* SDL_hints.h in Headers */,
-				AA7558AA1595D55500BBD41B /* SDL_joystick.h in Headers */,
-				AA7558AB1595D55500BBD41B /* SDL_keyboard.h in Headers */,
-				AA7558AC1595D55500BBD41B /* SDL_keycode.h in Headers */,
-				AA7558AD1595D55500BBD41B /* SDL_loadso.h in Headers */,
-				AA7558AE1595D55500BBD41B /* SDL_log.h in Headers */,
-				AA7558AF1595D55500BBD41B /* SDL_main.h in Headers */,
-				AA7558B01595D55500BBD41B /* SDL_mouse.h in Headers */,
-				AA7558B11595D55500BBD41B /* SDL_mutex.h in Headers */,
-				AA7558B21595D55500BBD41B /* SDL_name.h in Headers */,
-				AA7558B31595D55500BBD41B /* SDL_opengl.h in Headers */,
-				AA7558B41595D55500BBD41B /* SDL_opengles.h in Headers */,
-				AA7558B51595D55500BBD41B /* SDL_opengles2.h in Headers */,
-				AA7558B61595D55500BBD41B /* SDL_pixels.h in Headers */,
-				AA7558B71595D55500BBD41B /* SDL_platform.h in Headers */,
-				AA7558B81595D55500BBD41B /* SDL_power.h in Headers */,
-				AA7558B91595D55500BBD41B /* SDL_quit.h in Headers */,
-				AA7558BA1595D55500BBD41B /* SDL_rect.h in Headers */,
-				AA7558BB1595D55500BBD41B /* SDL_render.h in Headers */,
-				AA7558BC1595D55500BBD41B /* SDL_revision.h in Headers */,
-				AA7558BD1595D55500BBD41B /* SDL_rwops.h in Headers */,
-				AA7558BE1595D55500BBD41B /* SDL_scancode.h in Headers */,
-				AA7558BF1595D55500BBD41B /* SDL_shape.h in Headers */,
-				AA7558C01595D55500BBD41B /* SDL_stdinc.h in Headers */,
-				AA7558C11595D55500BBD41B /* SDL_surface.h in Headers */,
-				AA7558C21595D55500BBD41B /* SDL_system.h in Headers */,
-				AA7558C31595D55500BBD41B /* SDL_syswm.h in Headers */,
-				AA7558C41595D55500BBD41B /* SDL_thread.h in Headers */,
-				AA7558C51595D55500BBD41B /* SDL_timer.h in Headers */,
-				AA7558C61595D55500BBD41B /* SDL_touch.h in Headers */,
-				AA7558C71595D55500BBD41B /* SDL_types.h in Headers */,
-				AA7558C81595D55500BBD41B /* SDL_version.h in Headers */,
-				AA7558C91595D55500BBD41B /* SDL_video.h in Headers */,
-				AA7558CA1595D55500BBD41B /* SDL.h in Headers */,
-				AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */,
-				AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */,
-				AA9FF9511637C6E5000DF050 /* SDL_messagebox.h in Headers */,
-				AABCC3941640643D00AB8930 /* SDL_uikitmessagebox.h in Headers */,
-				AA0AD06516647BD400CE5896 /* SDL_gamecontroller.h in Headers */,
-				AADA5B8F16CCAB7C00107CF7 /* SDL_bits.h in Headers */,
-				56C181DF17C44D5E00406AE3 /* SDL_filesystem.h in Headers */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
-		FD6526620DE8FCCB002AD96B /* libSDL */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL" */;
-			buildPhases = (
-				FD65265F0DE8FCCB002AD96B /* Headers */,
-				FD6526600DE8FCCB002AD96B /* Sources */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = libSDL;
-			productName = iPhoneSDLStaticLib;
-			productReference = FD6526630DE8FCCB002AD96B /* libSDL2.a */;
-			productType = "com.apple.product-type.library.static";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		29B97313FDCFA39411CA2CEA /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				LastUpgradeCheck = 0420;
-			};
-			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDL" */;
-			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
-			hasScannedForEncodings = 1;
-			knownRegions = (
-				English,
-				Japanese,
-				French,
-				German,
-			);
-			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
-			projectDirPath = "";
-			projectRoot = ../..;
-			targets = (
-				FD6526620DE8FCCB002AD96B /* libSDL */,
-				00B4F48B12F6A69C0084EC00 /* PrepareXcodeProjectTemplate */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXShellScriptBuildPhase section */
-		00B4F48A12F6A69C0084EC00 /* ShellScript */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-				"$(SYMROOT)/$CONFIGURATION-Universal/libSDL.a",
-			);
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "# clean up the framework, remove headers, extra files\n\ntemp=$BUILD_DIR/$BUILD_STYLE-template\n# Wrong! 1. Can't assume location of Xcode directory (use xcode-select)\n# 2. Project templates should go in Application Support directories anyway.\ntemplate_dir_name=\"SDL iOS Application\"\n# dest=\"$(HOME)/Library/Application Support/Developer/Shared/Xcode/Project Templates/SDL/SDL iOS Application\"\nrsync_flags=\"--exclude *.svn --links -r\"\n\n# mkdir -p $dest\nmkdir -p $temp\nmkdir -p \"$temp/$template_dir_name/SDL/lib/\"\nmkdir -p \"$temp/$template_dir_name/SDL/include\"\n\n# copy template\nrsync $rsync_flags \"../template/$template_dir_name\" $temp/\n\n# copy Universal libSDL.a\nrsync $rsync_flags -r $SYMROOT/$CONFIGURATION-Universal/libSDL.a \"$temp/$template_dir_name/SDL/lib/\"\n\n# copy headers\nrsync $rsync_flags ../../include/ \"$temp/$template_dir_name/SDL/include\"\n\n#install (nah, don't install)\n# cp -fr \"$temp/$template_dir_name\" \"$dest\"";
-		};
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		FD6526600DE8FCCB002AD96B /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FD6526810DE8FCDD002AD96B /* SDL_systimer.c in Sources */,
-				FD6526800DE8FCDD002AD96B /* SDL_timer.c in Sources */,
-				FD3F4A7B0DEA620800C5B771 /* SDL_string.c in Sources */,
-				FD6526660DE8FCDD002AD96B /* SDL_dummyaudio.c in Sources */,
-				FD6526670DE8FCDD002AD96B /* SDL_audio.c in Sources */,
-				FD6526680DE8FCDD002AD96B /* SDL_audiocvt.c in Sources */,
-				FD65266A0DE8FCDD002AD96B /* SDL_audiotypecvt.c in Sources */,
-				FD65266B0DE8FCDD002AD96B /* SDL_mixer.c in Sources */,
-				FD65266F0DE8FCDD002AD96B /* SDL_wave.c in Sources */,
-				FD6526700DE8FCDD002AD96B /* SDL_cpuinfo.c in Sources */,
-				FD6526710DE8FCDD002AD96B /* SDL_events.c in Sources */,
-				FD6526720DE8FCDD002AD96B /* SDL_keyboard.c in Sources */,
-				FD6526730DE8FCDD002AD96B /* SDL_mouse.c in Sources */,
-				FD6526740DE8FCDD002AD96B /* SDL_quit.c in Sources */,
-				FD6526750DE8FCDD002AD96B /* SDL_windowevents.c in Sources */,
-				FD6526760DE8FCDD002AD96B /* SDL_rwops.c in Sources */,
-				FD6526780DE8FCDD002AD96B /* SDL_error.c in Sources */,
-				FD65267A0DE8FCDD002AD96B /* SDL.c in Sources */,
-				FD65267B0DE8FCDD002AD96B /* SDL_syscond.c in Sources */,
-				FD65267C0DE8FCDD002AD96B /* SDL_sysmutex.c in Sources */,
-				FD65267D0DE8FCDD002AD96B /* SDL_syssem.c in Sources */,
-				FD65267E0DE8FCDD002AD96B /* SDL_systhread.c in Sources */,
-				FD65267F0DE8FCDD002AD96B /* SDL_thread.c in Sources */,
-				FD3F4A760DEA620800C5B771 /* SDL_getenv.c in Sources */,
-				FD3F4A770DEA620800C5B771 /* SDL_iconv.c in Sources */,
-				FD3F4A780DEA620800C5B771 /* SDL_malloc.c in Sources */,
-				FD3F4A790DEA620800C5B771 /* SDL_qsort.c in Sources */,
-				FD3F4A7A0DEA620800C5B771 /* SDL_stdlib.c in Sources */,
-				FDA6844D0DF2374E00F98A1A /* SDL_blit.c in Sources */,
-				FDA6844F0DF2374E00F98A1A /* SDL_blit_0.c in Sources */,
-				FDA684500DF2374E00F98A1A /* SDL_blit_1.c in Sources */,
-				FDA684510DF2374E00F98A1A /* SDL_blit_A.c in Sources */,
-				FDA684520DF2374E00F98A1A /* SDL_blit_auto.c in Sources */,
-				FDA684540DF2374E00F98A1A /* SDL_blit_copy.c in Sources */,
-				FDA684560DF2374E00F98A1A /* SDL_blit_N.c in Sources */,
-				FDA684570DF2374E00F98A1A /* SDL_blit_slow.c in Sources */,
-				FDA684580DF2374E00F98A1A /* SDL_bmp.c in Sources */,
-				FDA6845C0DF2374E00F98A1A /* SDL_pixels.c in Sources */,
-				FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */,
-				FDA684620DF2374E00F98A1A /* SDL_RLEaccel.c in Sources */,
-				FDA684640DF2374E00F98A1A /* SDL_stretch.c in Sources */,
-				FDA684660DF2374E00F98A1A /* SDL_surface.c in Sources */,
-				FDA684680DF2374E00F98A1A /* SDL_video.c in Sources */,
-				FDA685FB0DF244C800F98A1A /* SDL_nullevents.c in Sources */,
-				FDA685FF0DF244C800F98A1A /* SDL_nullvideo.c in Sources */,
-				FD5F9D2F0E0E08B3008E885B /* SDL_joystick.c in Sources */,
-				FD689F030E26E5B600F90B21 /* SDL_sysjoystick.m in Sources */,
-				FD689F050E26E5B600F90B21 /* SDLUIAccelerationDelegate.m in Sources */,
-				FD689F1D0E26E5D900F90B21 /* SDL_uikitevents.m in Sources */,
-				FD689F1F0E26E5D900F90B21 /* SDL_uikitopengles.m in Sources */,
-				FD689F210E26E5D900F90B21 /* SDL_uikitvideo.m in Sources */,
-				FD689F230E26E5D900F90B21 /* SDL_uikitview.m in Sources */,
-				FD689F250E26E5D900F90B21 /* SDL_uikitwindow.m in Sources */,
-				FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */,
-				FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */,
-				FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */,
-				047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */,
-				047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */,
-				047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */,
-				046387460F0B5B7D0041FD65 /* SDL_fillrect.c in Sources */,
-				04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */,
-				56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */,
-				56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */,
-				006E9889119552DD001DE610 /* SDL_rwopsbundlesupport.m in Sources */,
-				044E5FB811E606EB0076F181 /* SDL_clipboard.c in Sources */,
-				0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */,
-				04BA9D6411EF474A00B60E01 /* SDL_gesture.c in Sources */,
-				04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */,
-				04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */,
-				04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */,
-				041B2CF112FA0F680087D585 /* SDL_render.c in Sources */,
-				04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */,
-				04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */,
-				04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */,
-				04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */,
-				04F7807A12FB751400FC43C0 /* SDL_blendpoint.c in Sources */,
-				04F7807D12FB751400FC43C0 /* SDL_drawline.c in Sources */,
-				04F7807F12FB751400FC43C0 /* SDL_drawpoint.c in Sources */,
-				04F7808512FB753F00FC43C0 /* SDL_nullframebuffer.c in Sources */,
-				0442EC5112FE1C1E004C9285 /* SDL_render_sw.c in Sources */,
-				0442EC5312FE1C28004C9285 /* SDL_render_gles.c in Sources */,
-				0442EC5512FE1C3F004C9285 /* SDL_hints.c in Sources */,
-				0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */,
-				0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */,
-				04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */,
-				56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */,
-				93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */,
-				AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */,
-				AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */,
-				AA704DD7162AA90A0076D1C1 /* SDL_dropevents.c in Sources */,
-				AABCC3951640643D00AB8930 /* SDL_uikitmessagebox.m in Sources */,
-				AA0AD06216647BBB00CE5896 /* SDL_gamecontroller.c in Sources */,
-				AA0F8495178D5F1A00823F9D /* SDL_systls.c in Sources */,
-				56C181E217C44D7A00406AE3 /* SDL_sysfilesystem.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
-		00B4F48C12F6A69C0084EC00 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = NO;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				PRODUCT_NAME = PrepareXcodeProjectTemplate;
-			};
-			name = Debug;
-		};
-		00B4F48D12F6A69C0084EC00 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				PRODUCT_NAME = PrepareXcodeProjectTemplate;
-				ZERO_LINK = NO;
-			};
-			name = Release;
-		};
-		C01FCF4F08A954540054247B /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
-				SDKROOT = iphoneos;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Debug;
-		};
-		C01FCF5008A954540054247B /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
-				SDKROOT = iphoneos;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Release;
-		};
-		FD6526640DE8FCCB002AD96B /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = NO;
-				PRODUCT_NAME = SDL2;
-				SKIP_INSTALL = YES;
-			};
-			name = Debug;
-		};
-		FD6526650DE8FCCB002AD96B /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = YES;
-				PRODUCT_NAME = SDL2;
-				SKIP_INSTALL = YES;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		00B4F48E12F6A6BA0084EC00 /* Build configuration list for PBXAggregateTarget "PrepareXcodeProjectTemplate" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				00B4F48C12F6A69C0084EC00 /* Debug */,
-				00B4F48D12F6A69C0084EC00 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDL" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				C01FCF4F08A954540054247B /* Debug */,
-				C01FCF5008A954540054247B /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FD6526640DE8FCCB002AD96B /* Debug */,
-				FD6526650DE8FCCB002AD96B /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
diff --git a/deps/SDL2/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj b/deps/SDL2/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
deleted file mode 100644
index 0995735..0000000
--- a/deps/SDL2/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,272 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 46;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		AA1EE462176059AB0029C7A5 /* SDL_test_common.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE454176059AB0029C7A5 /* SDL_test_common.c */; };
-		AA1EE463176059AB0029C7A5 /* SDL_test_compare.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */; };
-		AA1EE464176059AB0029C7A5 /* SDL_test_crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */; };
-		AA1EE465176059AB0029C7A5 /* SDL_test_font.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE457176059AB0029C7A5 /* SDL_test_font.c */; };
-		AA1EE466176059AB0029C7A5 /* SDL_test_fuzzer.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */; };
-		AA1EE467176059AB0029C7A5 /* SDL_test_harness.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */; };
-		AA1EE468176059AB0029C7A5 /* SDL_test_imageBlit.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */; };
-		AA1EE469176059AB0029C7A5 /* SDL_test_imageBlitBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */; };
-		AA1EE46A176059AB0029C7A5 /* SDL_test_imageFace.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */; };
-		AA1EE46B176059AB0029C7A5 /* SDL_test_imagePrimitives.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */; };
-		AA1EE46C176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */; };
-		AA1EE46D176059AB0029C7A5 /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */; };
-		AA1EE46E176059AB0029C7A5 /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */; };
-		AA1EE46F176059AB0029C7A5 /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE461176059AB0029C7A5 /* SDL_test_random.c */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
-		AA1EE4461760589B0029C7A5 /* libSDL2test.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2test.a; sourceTree = BUILT_PRODUCTS_DIR; };
-		AA1EE454176059AB0029C7A5 /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_common.c; path = ../../src/test/SDL_test_common.c; sourceTree = "<group>"; };
-		AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_compare.c; path = ../../src/test/SDL_test_compare.c; sourceTree = "<group>"; };
-		AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_crc32.c; path = ../../src/test/SDL_test_crc32.c; sourceTree = "<group>"; };
-		AA1EE457176059AB0029C7A5 /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_font.c; path = ../../src/test/SDL_test_font.c; sourceTree = "<group>"; };
-		AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_fuzzer.c; path = ../../src/test/SDL_test_fuzzer.c; sourceTree = "<group>"; };
-		AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_harness.c; path = ../../src/test/SDL_test_harness.c; sourceTree = "<group>"; };
-		AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlit.c; path = ../../src/test/SDL_test_imageBlit.c; sourceTree = "<group>"; };
-		AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlitBlend.c; path = ../../src/test/SDL_test_imageBlitBlend.c; sourceTree = "<group>"; };
-		AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageFace.c; path = ../../src/test/SDL_test_imageFace.c; sourceTree = "<group>"; };
-		AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitives.c; path = ../../src/test/SDL_test_imagePrimitives.c; sourceTree = "<group>"; };
-		AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitivesBlend.c; path = ../../src/test/SDL_test_imagePrimitivesBlend.c; sourceTree = "<group>"; };
-		AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_log.c; path = ../../src/test/SDL_test_log.c; sourceTree = "<group>"; };
-		AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_md5.c; path = ../../src/test/SDL_test_md5.c; sourceTree = "<group>"; };
-		AA1EE461176059AB0029C7A5 /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_random.c; path = ../../src/test/SDL_test_random.c; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		AA1EE4431760589B0029C7A5 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		AA1EE43D1760589B0029C7A5 = {
-			isa = PBXGroup;
-			children = (
-				AA1EE453176059770029C7A5 /* Library Source */,
-				AA1EE4471760589B0029C7A5 /* Products */,
-			);
-			sourceTree = "<group>";
-		};
-		AA1EE4471760589B0029C7A5 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				AA1EE4461760589B0029C7A5 /* libSDL2test.a */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		AA1EE453176059770029C7A5 /* Library Source */ = {
-			isa = PBXGroup;
-			children = (
-				AA1EE454176059AB0029C7A5 /* SDL_test_common.c */,
-				AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */,
-				AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */,
-				AA1EE457176059AB0029C7A5 /* SDL_test_font.c */,
-				AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */,
-				AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */,
-				AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */,
-				AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */,
-				AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */,
-				AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */,
-				AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */,
-				AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */,
-				AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */,
-				AA1EE461176059AB0029C7A5 /* SDL_test_random.c */,
-			);
-			name = "Library Source";
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
-		AA1EE4441760589B0029C7A5 /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
-		AA1EE4451760589B0029C7A5 /* SDL2test */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = AA1EE44A1760589B0029C7A5 /* Build configuration list for PBXNativeTarget "SDL2test" */;
-			buildPhases = (
-				AA1EE4421760589B0029C7A5 /* Sources */,
-				AA1EE4431760589B0029C7A5 /* Frameworks */,
-				AA1EE4441760589B0029C7A5 /* Headers */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = SDL2test;
-			productName = SDL2test;
-			productReference = AA1EE4461760589B0029C7A5 /* libSDL2test.a */;
-			productType = "com.apple.product-type.library.static";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		AA1EE43E1760589B0029C7A5 /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				LastUpgradeCheck = 0460;
-				ORGANIZATIONNAME = "Sam Lantinga";
-			};
-			buildConfigurationList = AA1EE4411760589B0029C7A5 /* Build configuration list for PBXProject "SDL2test" */;
-			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
-			hasScannedForEncodings = 0;
-			knownRegions = (
-				en,
-			);
-			mainGroup = AA1EE43D1760589B0029C7A5;
-			productRefGroup = AA1EE4471760589B0029C7A5 /* Products */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				AA1EE4451760589B0029C7A5 /* SDL2test */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
-		AA1EE4421760589B0029C7A5 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA1EE462176059AB0029C7A5 /* SDL_test_common.c in Sources */,
-				AA1EE463176059AB0029C7A5 /* SDL_test_compare.c in Sources */,
-				AA1EE464176059AB0029C7A5 /* SDL_test_crc32.c in Sources */,
-				AA1EE465176059AB0029C7A5 /* SDL_test_font.c in Sources */,
-				AA1EE466176059AB0029C7A5 /* SDL_test_fuzzer.c in Sources */,
-				AA1EE467176059AB0029C7A5 /* SDL_test_harness.c in Sources */,
-				AA1EE468176059AB0029C7A5 /* SDL_test_imageBlit.c in Sources */,
-				AA1EE469176059AB0029C7A5 /* SDL_test_imageBlitBlend.c in Sources */,
-				AA1EE46A176059AB0029C7A5 /* SDL_test_imageFace.c in Sources */,
-				AA1EE46B176059AB0029C7A5 /* SDL_test_imagePrimitives.c in Sources */,
-				AA1EE46C176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c in Sources */,
-				AA1EE46D176059AB0029C7A5 /* SDL_test_log.c in Sources */,
-				AA1EE46E176059AB0029C7A5 /* SDL_test_md5.c in Sources */,
-				AA1EE46F176059AB0029C7A5 /* SDL_test_random.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
-		AA1EE4481760589B0029C7A5 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
-				CLANG_CXX_LIBRARY = "libc++";
-				CLANG_WARN_CONSTANT_CONVERSION = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN_ENUM_CONVERSION = YES;
-				CLANG_WARN_INT_CONVERSION = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				COPY_PHASE_STRIP = NO;
-				GCC_C_LANGUAGE_STANDARD = gnu99;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"DEBUG=1",
-					"$(inherited)",
-				);
-				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.8;
-				ONLY_ACTIVE_ARCH = YES;
-				SDKROOT = iphoneos;
-			};
-			name = Debug;
-		};
-		AA1EE4491760589B0029C7A5 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
-				CLANG_CXX_LIBRARY = "libc++";
-				CLANG_WARN_CONSTANT_CONVERSION = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN_ENUM_CONVERSION = YES;
-				CLANG_WARN_INT_CONVERSION = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				COPY_PHASE_STRIP = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_C_LANGUAGE_STANDARD = gnu99;
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.8;
-				SDKROOT = iphoneos;
-			};
-			name = Release;
-		};
-		AA1EE44B1760589B0029C7A5 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				EXECUTABLE_PREFIX = lib;
-				HEADER_SEARCH_PATHS = ../../include;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-			};
-			name = Debug;
-		};
-		AA1EE44C1760589B0029C7A5 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				EXECUTABLE_PREFIX = lib;
-				HEADER_SEARCH_PATHS = ../../include;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		AA1EE4411760589B0029C7A5 /* Build configuration list for PBXProject "SDL2test" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				AA1EE4481760589B0029C7A5 /* Debug */,
-				AA1EE4491760589B0029C7A5 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		AA1EE44A1760589B0029C7A5 /* Build configuration list for PBXNativeTarget "SDL2test" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				AA1EE44B1760589B0029C7A5 /* Debug */,
-				AA1EE44C1760589B0029C7A5 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = AA1EE43E1760589B0029C7A5 /* Project object */;
-}
diff --git a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/Default.png b/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/Default.png
deleted file mode 100644
index f912828..0000000
Binary files a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/Default.png and /dev/null differ
diff --git a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/Icon.png b/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/Icon.png
deleted file mode 100644
index 83f4d10..0000000
Binary files a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/Icon.png and /dev/null differ
diff --git a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/Info.plist b/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/Info.plist
deleted file mode 100644
index b8089dc..0000000
--- a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/Info.plist	
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>en</string>
-	<key>CFBundleDisplayName</key>
-	<string>${PRODUCT_NAME}</string>
-	<key>CFBundleExecutable</key>
-	<string>${EXECUTABLE_NAME}</string>
-	<key>CFBundleIconFile</key>
-	<string>Icon</string>
-	<key>CFBundleIdentifier</key>
-	<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>${PRODUCT_NAME}</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>1.0</string>
-	<key>LSRequiresIPhoneOS</key>
-	<false/>
-</dict>
-</plist>
diff --git a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
deleted file mode 100644
index 4500ce2..0000000
Binary files a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns and /dev/null differ
diff --git a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
deleted file mode 100644
index 498e37d..0000000
--- a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist	
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>Description</key>
-	<string>This project builds an SDL based project for iPhone OS using C or Objective-C.  It includes everything you need to get up and running with SDL on iPhone.</string>
-	<key>CFBundleIconFile</key>
-	<string>Icon.png</string>
-</dict>
-</plist>
diff --git a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj
deleted file mode 100755
index 3e0eb0c..0000000
--- a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj	
+++ /dev/null
@@ -1,403 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 45;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		0097E2D912F70C4E00724AC5 /* libSDL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0097E2D512F70C4D00724AC5 /* libSDL.a */; };
-		1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
-		1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
-		28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
-		28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
-		FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD779EDD0E26BA1200F39101 /* CoreAudio.framework */; };
-		FD77A07D0E26BD8C00F39101 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07C0E26BD8C00F39101 /* Icon.png */; };
-		FD77A07F0E26BDA900F39101 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07E0E26BDA900F39101 /* Default.png */; };
-		FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD77A0840E26BDB800F39101 /* AudioToolbox.framework */; };
-		FD77A09D0E26BDE500F39101 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A09C0E26BDE500F39101 /* main.c */; };
-		FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
-		0097E29A12F70C4D00724AC5 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = "<group>"; };
-		0097E29B12F70C4D00724AC5 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = "<group>"; };
-		0097E29C12F70C4D00724AC5 /* doxyfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = doxyfile; sourceTree = "<group>"; };
-		0097E29D12F70C4D00724AC5 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = "<group>"; };
-		0097E29E12F70C4D00724AC5 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_assert.h; sourceTree = "<group>"; };
-		0097E29F12F70C4D00724AC5 /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_atomic.h; sourceTree = "<group>"; };
-		0097E2A012F70C4D00724AC5 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio.h; sourceTree = "<group>"; };
-		0097E2A112F70C4D00724AC5 /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendmode.h; sourceTree = "<group>"; };
-		0097E2A212F70C4D00724AC5 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboard.h; sourceTree = "<group>"; };
-		0097E2A312F70C4D00724AC5 /* SDL_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_compat.h; sourceTree = "<group>"; };
-		0097E2A412F70C4D00724AC5 /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config.h; sourceTree = "<group>"; };
-		0097E2A512F70C4D00724AC5 /* SDL_config.h.default */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SDL_config.h.default; sourceTree = "<group>"; };
-		0097E2A612F70C4D00724AC5 /* SDL_config.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SDL_config.h.in; sourceTree = "<group>"; };
-		0097E2A712F70C4D00724AC5 /* SDL_config_android.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_android.h; sourceTree = "<group>"; };
-		0097E2A812F70C4D00724AC5 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_iphoneos.h; sourceTree = "<group>"; };
-		0097E2A912F70C4D00724AC5 /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_macosx.h; sourceTree = "<group>"; };
-		0097E2AA12F70C4D00724AC5 /* SDL_config_minimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_minimal.h; sourceTree = "<group>"; };
-		0097E2AC12F70C4D00724AC5 /* SDL_config_pandora.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_pandora.h; sourceTree = "<group>"; };
-		0097E2AD12F70C4D00724AC5 /* SDL_config_windows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_windows.h; sourceTree = "<group>"; };
-		0097E2AE12F70C4D00724AC5 /* SDL_config_wiz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_wiz.h; sourceTree = "<group>"; };
-		0097E2AF12F70C4D00724AC5 /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_copying.h; sourceTree = "<group>"; };
-		0097E2B012F70C4D00724AC5 /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cpuinfo.h; sourceTree = "<group>"; };
-		0097E2B112F70C4D00724AC5 /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_endian.h; sourceTree = "<group>"; };
-		0097E2B212F70C4D00724AC5 /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error.h; sourceTree = "<group>"; };
-		0097E2B312F70C4D00724AC5 /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events.h; sourceTree = "<group>"; };
-		0097E2B412F70C4D00724AC5 /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture.h; sourceTree = "<group>"; };
-		0097E2B512F70C4D00724AC5 /* SDL_haptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_haptic.h; sourceTree = "<group>"; };
-		0097E2B612F70C4D00724AC5 /* SDL_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_input.h; sourceTree = "<group>"; };
-		0097E2B712F70C4D00724AC5 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = "<group>"; };
-		0097E2B812F70C4D00724AC5 /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard.h; sourceTree = "<group>"; };
-		0097E2B912F70C4D00724AC5 /* SDL_keysym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keysym.h; sourceTree = "<group>"; };
-		0097E2BA12F70C4D00724AC5 /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_loadso.h; sourceTree = "<group>"; };
-		0097E2BB12F70C4D00724AC5 /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_main.h; sourceTree = "<group>"; };
-		0097E2BC12F70C4D00724AC5 /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse.h; sourceTree = "<group>"; };
-		0097E2BD12F70C4D00724AC5 /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mutex.h; sourceTree = "<group>"; };
-		0097E2BE12F70C4D00724AC5 /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_name.h; sourceTree = "<group>"; };
-		0097E2BF12F70C4D00724AC5 /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengl.h; sourceTree = "<group>"; };
-		0097E2C012F70C4D00724AC5 /* SDL_opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles.h; sourceTree = "<group>"; };
-		0097E2C112F70C4D00724AC5 /* SDL_pixels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels.h; sourceTree = "<group>"; };
-		0097E2C212F70C4D00724AC5 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_platform.h; sourceTree = "<group>"; };
-		0097E2C312F70C4D00724AC5 /* SDL_power.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_power.h; sourceTree = "<group>"; };
-		0097E2C412F70C4D00724AC5 /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_quit.h; sourceTree = "<group>"; };
-		0097E2C512F70C4D00724AC5 /* SDL_rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect.h; sourceTree = "<group>"; };
-		0097E2C612F70C4D00724AC5 /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_revision.h; sourceTree = "<group>"; };
-		0097E2C712F70C4D00724AC5 /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwops.h; sourceTree = "<group>"; };
-		0097E2C812F70C4D00724AC5 /* SDL_scalemode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scalemode.h; sourceTree = "<group>"; };
-		0097E2C912F70C4D00724AC5 /* SDL_scancode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scancode.h; sourceTree = "<group>"; };
-		0097E2CA12F70C4D00724AC5 /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape.h; sourceTree = "<group>"; };
-		0097E2CB12F70C4D00724AC5 /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_stdinc.h; sourceTree = "<group>"; };
-		0097E2CC12F70C4D00724AC5 /* SDL_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_surface.h; sourceTree = "<group>"; };
-		0097E2CD12F70C4D00724AC5 /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syswm.h; sourceTree = "<group>"; };
-		0097E2CE12F70C4D00724AC5 /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread.h; sourceTree = "<group>"; };
-		0097E2CF12F70C4D00724AC5 /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer.h; sourceTree = "<group>"; };
-		0097E2D012F70C4D00724AC5 /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch.h; sourceTree = "<group>"; };
-		0097E2D112F70C4D00724AC5 /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_types.h; sourceTree = "<group>"; };
-		0097E2D212F70C4D00724AC5 /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_version.h; sourceTree = "<group>"; };
-		0097E2D312F70C4D00724AC5 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = "<group>"; };
-		0097E2D512F70C4D00724AC5 /* libSDL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSDL.a; sourceTree = "<group>"; };
-		1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-		1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; };
-		1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
-		28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
-		28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
-		8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-		FD779EDD0E26BA1200F39101 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
-		FD77A07C0E26BD8C00F39101 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
-		FD77A07E0E26BDA900F39101 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
-		FD77A0840E26BDB800F39101 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
-		FD77A09C0E26BDE500F39101 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
-		FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
-				1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
-				28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */,
-				28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */,
-				FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */,
-				FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */,
-				FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */,
-				0097E2D912F70C4E00724AC5 /* libSDL.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		0097E29812F70C4D00724AC5 /* SDL */ = {
-			isa = PBXGroup;
-			children = (
-				0097E29912F70C4D00724AC5 /* include */,
-				0097E2D412F70C4D00724AC5 /* lib */,
-			);
-			path = SDL;
-			sourceTree = "<group>";
-		};
-		0097E29912F70C4D00724AC5 /* include */ = {
-			isa = PBXGroup;
-			children = (
-				0097E29A12F70C4D00724AC5 /* begin_code.h */,
-				0097E29B12F70C4D00724AC5 /* close_code.h */,
-				0097E29C12F70C4D00724AC5 /* doxyfile */,
-				0097E29D12F70C4D00724AC5 /* SDL.h */,
-				0097E29E12F70C4D00724AC5 /* SDL_assert.h */,
-				0097E29F12F70C4D00724AC5 /* SDL_atomic.h */,
-				0097E2A012F70C4D00724AC5 /* SDL_audio.h */,
-				0097E2A112F70C4D00724AC5 /* SDL_blendmode.h */,
-				0097E2A212F70C4D00724AC5 /* SDL_clipboard.h */,
-				0097E2A312F70C4D00724AC5 /* SDL_compat.h */,
-				0097E2A412F70C4D00724AC5 /* SDL_config.h */,
-				0097E2A512F70C4D00724AC5 /* SDL_config.h.default */,
-				0097E2A612F70C4D00724AC5 /* SDL_config.h.in */,
-				0097E2A712F70C4D00724AC5 /* SDL_config_android.h */,
-				0097E2A812F70C4D00724AC5 /* SDL_config_iphoneos.h */,
-				0097E2A912F70C4D00724AC5 /* SDL_config_macosx.h */,
-				0097E2AA12F70C4D00724AC5 /* SDL_config_minimal.h */,
-				0097E2AC12F70C4D00724AC5 /* SDL_config_pandora.h */,
-				0097E2AD12F70C4D00724AC5 /* SDL_config_windows.h */,
-				0097E2AE12F70C4D00724AC5 /* SDL_config_wiz.h */,
-				0097E2AF12F70C4D00724AC5 /* SDL_copying.h */,
-				0097E2B012F70C4D00724AC5 /* SDL_cpuinfo.h */,
-				0097E2B112F70C4D00724AC5 /* SDL_endian.h */,
-				0097E2B212F70C4D00724AC5 /* SDL_error.h */,
-				0097E2B312F70C4D00724AC5 /* SDL_events.h */,
-				0097E2B412F70C4D00724AC5 /* SDL_gesture.h */,
-				0097E2B512F70C4D00724AC5 /* SDL_haptic.h */,
-				0097E2B612F70C4D00724AC5 /* SDL_input.h */,
-				0097E2B712F70C4D00724AC5 /* SDL_joystick.h */,
-				0097E2B812F70C4D00724AC5 /* SDL_keyboard.h */,
-				0097E2B912F70C4D00724AC5 /* SDL_keysym.h */,
-				0097E2BA12F70C4D00724AC5 /* SDL_loadso.h */,
-				0097E2BB12F70C4D00724AC5 /* SDL_main.h */,
-				0097E2BC12F70C4D00724AC5 /* SDL_mouse.h */,
-				0097E2BD12F70C4D00724AC5 /* SDL_mutex.h */,
-				0097E2BE12F70C4D00724AC5 /* SDL_name.h */,
-				0097E2BF12F70C4D00724AC5 /* SDL_opengl.h */,
-				0097E2C012F70C4D00724AC5 /* SDL_opengles.h */,
-				0097E2C112F70C4D00724AC5 /* SDL_pixels.h */,
-				0097E2C212F70C4D00724AC5 /* SDL_platform.h */,
-				0097E2C312F70C4D00724AC5 /* SDL_power.h */,
-				0097E2C412F70C4D00724AC5 /* SDL_quit.h */,
-				0097E2C512F70C4D00724AC5 /* SDL_rect.h */,
-				0097E2C612F70C4D00724AC5 /* SDL_revision.h */,
-				0097E2C712F70C4D00724AC5 /* SDL_rwops.h */,
-				0097E2C812F70C4D00724AC5 /* SDL_scalemode.h */,
-				0097E2C912F70C4D00724AC5 /* SDL_scancode.h */,
-				0097E2CA12F70C4D00724AC5 /* SDL_shape.h */,
-				0097E2CB12F70C4D00724AC5 /* SDL_stdinc.h */,
-				0097E2CC12F70C4D00724AC5 /* SDL_surface.h */,
-				0097E2CD12F70C4D00724AC5 /* SDL_syswm.h */,
-				0097E2CE12F70C4D00724AC5 /* SDL_thread.h */,
-				0097E2CF12F70C4D00724AC5 /* SDL_timer.h */,
-				0097E2D012F70C4D00724AC5 /* SDL_touch.h */,
-				0097E2D112F70C4D00724AC5 /* SDL_types.h */,
-				0097E2D212F70C4D00724AC5 /* SDL_version.h */,
-				0097E2D312F70C4D00724AC5 /* SDL_video.h */,
-			);
-			path = include;
-			sourceTree = "<group>";
-		};
-		0097E2D412F70C4D00724AC5 /* lib */ = {
-			isa = PBXGroup;
-			children = (
-				0097E2D512F70C4D00724AC5 /* libSDL.a */,
-			);
-			path = lib;
-			sourceTree = "<group>";
-		};
-		19C28FACFE9D520D11CA2CBB /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
-			isa = PBXGroup;
-			children = (
-				29B97315FDCFA39411CA2CEA /* Sources */,
-				29B97317FDCFA39411CA2CEA /* Resources */,
-				0097E29812F70C4D00724AC5 /* SDL */,
-				29B97323FDCFA39411CA2CEA /* Frameworks */,
-				19C28FACFE9D520D11CA2CBB /* Products */,
-			);
-			name = CustomTemplate;
-			sourceTree = "<group>";
-		};
-		29B97315FDCFA39411CA2CEA /* Sources */ = {
-			isa = PBXGroup;
-			children = (
-				FD77A09C0E26BDE500F39101 /* main.c */,
-			);
-			name = Sources;
-			sourceTree = "<group>";
-		};
-		29B97317FDCFA39411CA2CEA /* Resources */ = {
-			isa = PBXGroup;
-			children = (
-				FD77A07E0E26BDA900F39101 /* Default.png */,
-				FD77A07C0E26BD8C00F39101 /* Icon.png */,
-				8D1107310486CEB800E47090 /* Info.plist */,
-			);
-			name = Resources;
-			sourceTree = "<group>";
-		};
-		29B97323FDCFA39411CA2CEA /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */,
-				FD77A0840E26BDB800F39101 /* AudioToolbox.framework */,
-				FD779EDD0E26BA1200F39101 /* CoreAudio.framework */,
-				28FD15070DC6FC5B0079059D /* QuartzCore.framework */,
-				28FD14FF0DC6FC520079059D /* OpenGLES.framework */,
-				1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
-				1D30AB110D05D00D00671497 /* Foundation.framework */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		1D6058900D05DD3D006BFB54 /* ___PROJECTNAME___ */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */;
-			buildPhases = (
-				1D60588D0D05DD3D006BFB54 /* Resources */,
-				1D60588E0D05DD3D006BFB54 /* Sources */,
-				1D60588F0D05DD3D006BFB54 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = "___PROJECTNAME___";
-			productName = "___PROJECTNAME___";
-			productReference = 1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */;
-			productType = "com.apple.product-type.application";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		29B97313FDCFA39411CA2CEA /* Project object */ = {
-			isa = PBXProject;
-			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */;
-			compatibilityVersion = "Xcode 3.1";
-			developmentRegion = English;
-			hasScannedForEncodings = 1;
-			knownRegions = (
-				English,
-				Japanese,
-				French,
-				German,
-			);
-			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				1D6058900D05DD3D006BFB54 /* ___PROJECTNAME___ */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-		1D60588D0D05DD3D006BFB54 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FD77A07D0E26BD8C00F39101 /* Icon.png in Resources */,
-				FD77A07F0E26BDA900F39101 /* Default.png in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		1D60588E0D05DD3D006BFB54 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FD77A09D0E26BDE500F39101 /* main.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
-		1D6058940D05DD3E006BFB54 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				COPY_PHASE_STRIP = NO;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = "";
-				INFOPLIST_FILE = Info.plist;
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/SDL/lib\"",
-				);
-				PRODUCT_NAME = "___PROJECTNAME___";
-			};
-			name = Debug;
-		};
-		1D6058950D05DD3E006BFB54 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				COPY_PHASE_STRIP = YES;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = "";
-				INFOPLIST_FILE = Info.plist;
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/SDL/lib\"",
-				);
-				PRODUCT_NAME = "___PROJECTNAME___";
-			};
-			name = Release;
-		};
-		C01FCF4F08A954540054247B /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				GCC_C_LANGUAGE_STANDARD = c99;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				ONLY_ACTIVE_ARCH = YES;
-				OTHER_CFLAGS = "";
-				PREBINDING = NO;
-				SDKROOT = iphoneos;
-			};
-			name = Debug;
-		};
-		C01FCF5008A954540054247B /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				GCC_C_LANGUAGE_STANDARD = c99;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				OTHER_CFLAGS = "";
-				PREBINDING = NO;
-				SDKROOT = iphoneos;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				1D6058940D05DD3E006BFB54 /* Debug */,
-				1D6058950D05DD3E006BFB54 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				C01FCF4F08A954540054247B /* Debug */,
-				C01FCF5008A954540054247B /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
diff --git a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/main.c b/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/main.c
deleted file mode 100644
index 8dc0070..0000000
--- a/deps/SDL2/Xcode-iOS/Template/SDL iOS Application/main.c	
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *  rectangles.c
- *  written by Holmes Futrell
- *  use however you want
- */
-
-#include "SDL.h"
-#include <time.h>
-
-#define SCREEN_WIDTH 320
-#define SCREEN_HEIGHT 480
-
-int
-randomInt(int min, int max)
-{
-    return min + rand() % (max - min + 1);
-}
-
-void
-render(SDL_Renderer *renderer)
-{
-
-    Uint8 r, g, b;
-
-    /* Clear the screen */
-    SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
-    SDL_RenderClear(renderer);
-
-    /*  Come up with a random rectangle */
-    SDL_Rect rect;
-    rect.w = randomInt(64, 128);
-    rect.h = randomInt(64, 128);
-    rect.x = randomInt(0, SCREEN_WIDTH);
-    rect.y = randomInt(0, SCREEN_HEIGHT);
-
-    /* Come up with a random color */
-    r = randomInt(50, 255);
-    g = randomInt(50, 255);
-    b = randomInt(50, 255);
-    SDL_SetRenderDrawColor(renderer, r, g, b, 255);
-
-    /*  Fill the rectangle in the color */
-    SDL_RenderFillRect(renderer, &rect);
-
-    /* update screen */
-    SDL_RenderPresent(renderer);
-}
-
-int
-main(int argc, char *argv[])
-{
-
-    SDL_Window *window;
-    SDL_Renderer *renderer;
-    int done;
-    SDL_Event event;
-
-    /* initialize SDL */
-    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
-        printf("Could not initialize SDL\n");
-        return 1;
-    }
-
-    /* seed random number generator */
-    srand(time(NULL));
-
-    /* create window and renderer */
-    window =
-        SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
-                         SDL_WINDOW_OPENGL);
-    if (!window) {
-        printf("Could not initialize Window\n");
-        return 1;
-    }
-
-    renderer = SDL_CreateRenderer(window, -1, 0);
-    if (!renderer) {
-        printf("Could not create renderer\n");
-        return 1;
-    }
-
-    /* Enter render loop, waiting for user to quit */
-    done = 0;
-    while (!done) {
-        while (SDL_PollEvent(&event)) {
-            if (event.type == SDL_QUIT) {
-                done = 1;
-            }
-        }
-        render(renderer);
-        SDL_Delay(1);
-    }
-
-    /* shutdown SDL */
-    SDL_Quit();
-
-    return 0;
-}
diff --git a/deps/SDL2/Xcode-iOS/Test/Info.plist b/deps/SDL2/Xcode-iOS/Test/Info.plist
deleted file mode 100644
index c0f1179..0000000
--- a/deps/SDL2/Xcode-iOS/Test/Info.plist
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>en</string>
-	<key>CFBundleDisplayName</key>
-	<string>${PRODUCT_NAME}</string>
-	<key>CFBundleExecutable</key>
-	<string>${EXECUTABLE_NAME}</string>
-	<key>CFBundleIconFile</key>
-	<string></string>
-	<key>CFBundleIdentifier</key>
-	<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>${PRODUCT_NAME}</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>1.0</string>
-	<key>NSMainNibFile</key>
-	<string></string>
-</dict>
-</plist>
diff --git a/deps/SDL2/Xcode-iOS/Test/README b/deps/SDL2/Xcode-iOS/Test/README
deleted file mode 100644
index b16ff7c..0000000
--- a/deps/SDL2/Xcode-iOS/Test/README
+++ /dev/null
@@ -1,22 +0,0 @@
-TestiPhoneOS.xcodeproj contains targets to compile many of the SDL test programs for iPhone OS.  Most of these test programs work fine, with the following exceptions:
-
-testalpha:
-	Program crashes.  Problem appears to effect Mac OS X as well.
-
-testthread:
-	SIGTERM kills the process immediately without executing the 'kill' function.  The posix standard says this shouldn't happen.  Apple seems intent on having iPhone apps exit promptly when the user requests it, so maybe that's why(?)
-
-testlock:
-	Locks appear to work, but there doesn't appear to be a simple way to send the process SIGINT.
-
-testpalette:
-	"SDL error: blitting boat: Blit combination not supported."  Happens on Mac OS X as well.
-
-testsprite2: 
-	SDL_CreateTextureFromSurface requests an ARGB pixel format, but iPhone's SDL video driver only supports ABGR.
-
-testwin:
-	Behaves as it does under Mac OS X ... not sure if that is correctly or not.
-
-threadwin:
-	Works if -threaded is not on.  Otherwise it doesn't work, but this is true under Mac OS X as well.
diff --git a/deps/SDL2/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj b/deps/SDL2/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
deleted file mode 100755
index 0b35c22..0000000
--- a/deps/SDL2/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,2267 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 46;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		046CEF7713254F23007AD51D /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
-		046CEF7B13254F23007AD51D /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		046CEF7C13254F23007AD51D /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		046CEF7D13254F23007AD51D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		046CEF7E13254F23007AD51D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		046CEF7F13254F23007AD51D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		046CEF8013254F23007AD51D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		046CEF8113254F23007AD51D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		046CEF8213254F23007AD51D /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		046CEF8A13254F63007AD51D /* testgesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 046CEF8913254F63007AD51D /* testgesture.c */; };
-		047A63E213285C3200CD7973 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		047A63E313285C3200CD7973 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		047A63E413285C3200CD7973 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		047A63E513285C3200CD7973 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		047A63E613285C3200CD7973 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		047A63E713285C3200CD7973 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		047A63E813285C3200CD7973 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		047A63E913285C3200CD7973 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		047A63F113285CD100CD7973 /* checkkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 047A63F013285CD100CD7973 /* checkkeys.c */; };
-		56ED04FE118A8FE400A56AA6 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
-		56ED0502118A8FE400A56AA6 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		56ED0503118A8FE400A56AA6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		56ED0504118A8FE400A56AA6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		56ED0505118A8FE400A56AA6 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		56ED0506118A8FE400A56AA6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		56ED0507118A8FE400A56AA6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		56ED0508118A8FE400A56AA6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		56ED0509118A8FE400A56AA6 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		56ED0511118A904200A56AA6 /* testpower.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED0510118A904200A56AA6 /* testpower.c */; };
-		AA1EE470176059D00029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
-		AA1EE47117605A7F0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
-		AA1EE47417605B5C0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
-		AA1EE47517605B930029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
-		AA1EE47617605B9E0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
-		AA1EE47717605BAB0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
-		AA1EE47817605BF60029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
-		AAE7DEDC14CBB1E100DF1A0E /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
-		AAE7DEE114CBB1E100DF1A0E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		AAE7DEE214CBB1E100DF1A0E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		AAE7DEE314CBB1E100DF1A0E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		AAE7DEE414CBB1E100DF1A0E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		AAE7DEE514CBB1E100DF1A0E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		AAE7DEE614CBB1E100DF1A0E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		AAE7DEE714CBB1E100DF1A0E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		AAE7DEE814CBB1E100DF1A0E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		AAE7DF4614CBB43900DF1A0E /* testscale.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE7DF4514CBB43900DF1A0E /* testscale.c */; };
-		AAE7DF4714CBB45000DF1A0E /* sample.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AADE0E2D33C100EA573E /* sample.bmp */; };
-		AAE7DFA014CBB54E00DF1A0E /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
-		AAE7DFA114CBB54E00DF1A0E /* sample.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AADE0E2D33C100EA573E /* sample.bmp */; };
-		AAE7DFA614CBB54E00DF1A0E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		AAE7DFA714CBB54E00DF1A0E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		AAE7DFA814CBB54E00DF1A0E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		AAE7DFA914CBB54E00DF1A0E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		AAE7DFAA14CBB54E00DF1A0E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		AAE7DFAB14CBB54E00DF1A0E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		AAE7DFAC14CBB54E00DF1A0E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		AAE7DFAD14CBB54E00DF1A0E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		AAE7DFB514CBB5F700DF1A0E /* testrendertarget.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */; };
-		FDA8A79C0E2D0F9300EA573E /* testwm2.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A75F0E2D0F1600EA573E /* testwm2.c */; };
-		FDA8A89F0E2D111A00EA573E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDA8A8A00E2D111A00EA573E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDA8A8A10E2D111A00EA573E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDA8A8A20E2D111A00EA573E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDA8A8A30E2D111A00EA573E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDA8A8A40E2D111A00EA573E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDA8A8A50E2D111A00EA573E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDA8AAB10E2D330F00EA573E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDA8AAB20E2D330F00EA573E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDA8AAB30E2D330F00EA573E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDA8AAB40E2D330F00EA573E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDA8AAB50E2D330F00EA573E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDA8AAB60E2D330F00EA573E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDA8AAB70E2D330F00EA573E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDA8AABE0E2D335C00EA573E /* loopwave.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A78B0E2D0F3D00EA573E /* loopwave.c */; };
-		FDA8AAE30E2D33C600EA573E /* sample.wav in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAE20E2D33C600EA573E /* sample.wav */; };
-		FDAAC3C30E2D47E6001DB1D8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDAAC3C40E2D47E6001DB1D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDAAC3C50E2D47E6001DB1D8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDAAC3C60E2D47E6001DB1D8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDAAC3C70E2D47E6001DB1D8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDAAC3C80E2D47E6001DB1D8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDAAC3C90E2D47E6001DB1D8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDAAC3D30E2D4800001DB1D8 /* testaudioinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */; };
-		FDAAC5910E2D5429001DB1D8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDAAC5920E2D5429001DB1D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDAAC5930E2D5429001DB1D8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDAAC5940E2D5429001DB1D8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDAAC5950E2D5429001DB1D8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDAAC5960E2D5429001DB1D8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDAAC5970E2D5429001DB1D8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDAAC59F0E2D54B8001DB1D8 /* testerror.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7470E2D0F1600EA573E /* testerror.c */; };
-		FDAAC5BF0E2D55B5001DB1D8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDAAC5C00E2D55B5001DB1D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDAAC5C10E2D55B5001DB1D8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDAAC5C20E2D55B5001DB1D8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDAAC5C30E2D55B5001DB1D8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDAAC5C40E2D55B5001DB1D8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDAAC5C50E2D55B5001DB1D8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDAAC5CC0E2D55CA001DB1D8 /* testfile.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7480E2D0F1600EA573E /* testfile.c */; };
-		FDAAC61C0E2D5914001DB1D8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDAAC61D0E2D5914001DB1D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDAAC61E0E2D5914001DB1D8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDAAC61F0E2D5914001DB1D8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDAAC6200E2D5914001DB1D8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDAAC6210E2D5914001DB1D8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDAAC6220E2D5914001DB1D8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDAAC62A0E2D5960001DB1D8 /* testgles.c in Sources */ = {isa = PBXBuildFile; fileRef = FDAAC6290E2D5960001DB1D8 /* testgles.c */; };
-		FDAAC6390E2D59BE001DB1D8 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
-		FDBDE57C0E313445006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5810E313465006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5850E313495006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE58C0E3134F3006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE59B0E31356A006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE59F0E31358D006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5A90E3135C0006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5AE0E3135E6006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5B60E3135FE006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5BC0E31364D006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5C20E313663006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5C60E3136F1006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5C80E313702006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5CA0E313712006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5CC0E31372B006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5CE0E31373E006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDBDE5D40E313789006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDC42FF40F0D866D009C87E1 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
-		FDC42FF60F0D866D009C87E1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDC42FF70F0D866D009C87E1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDC42FF80F0D866D009C87E1 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDC42FF90F0D866D009C87E1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDC42FFA0F0D866D009C87E1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDC42FFB0F0D866D009C87E1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDC42FFC0F0D866D009C87E1 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDC4300A0F0D86BF009C87E1 /* testdraw2.c in Sources */ = {isa = PBXBuildFile; fileRef = FDC430090F0D86BF009C87E1 /* testdraw2.c */; };
-		FDD2C1000E2E4F4B00B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C1010E2E4F4B00B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C1020E2E4F4B00B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C1030E2E4F4B00B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C1040E2E4F4B00B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C1050E2E4F4B00B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C1060E2E4F4B00B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C10D0E2E4F6900B7A85F /* testthread.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74C0E2D0F1600EA573E /* testthread.c */; };
-		FDD2C1770E2E52C000B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C1780E2E52C000B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C1790E2E52C000B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C17A0E2E52C000B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C17B0E2E52C000B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C17C0E2E52C000B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C17D0E2E52C000B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C1840E2E52D900B7A85F /* testiconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74D0E2D0F1600EA573E /* testiconv.c */; };
-		FDD2C18B0E2E52FE00B7A85F /* utf8.txt in Resources */ = {isa = PBXBuildFile; fileRef = FDD2C18A0E2E52FE00B7A85F /* utf8.txt */; };
-		FDD2C19B0E2E534F00B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C19C0E2E534F00B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C19D0E2E534F00B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C19E0E2E534F00B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C19F0E2E534F00B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C1A00E2E534F00B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C1A10E2E534F00B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C1A80E2E536400B7A85F /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74E0E2D0F1600EA573E /* testjoystick.c */; };
-		FDD2C4540E2E773800B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C4550E2E773800B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C4560E2E773800B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C4570E2E773800B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C4580E2E773800B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C4590E2E773800B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C45A0E2E773800B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C4610E2E777500B7A85F /* testkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74F0E2D0F1600EA573E /* testkeys.c */; };
-		FDD2C4720E2E77D700B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C4730E2E77D700B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C4740E2E77D700B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C4750E2E77D700B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C4760E2E77D700B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C4770E2E77D700B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C4780E2E77D700B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C47F0E2E77E300B7A85F /* testlock.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7510E2D0F1600EA573E /* testlock.c */; };
-		FDD2C5010E2E7F4800B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C5020E2E7F4800B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C5030E2E7F4800B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C5040E2E7F4800B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C5050E2E7F4800B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C5060E2E7F4800B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C5070E2E7F4800B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C50E0E2E7F5800B7A85F /* testplatform.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7560E2D0F1600EA573E /* testplatform.c */; };
-		FDD2C51F0E2E807600B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C5200E2E807600B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C5210E2E807600B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C5220E2E807600B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C5230E2E807600B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C5240E2E807600B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C5250E2E807600B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C52C0E2E808700B7A85F /* testsem.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7570E2D0F1600EA573E /* testsem.c */; };
-		FDD2C5440E2E80E400B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C5450E2E80E400B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C5460E2E80E400B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C5470E2E80E400B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C5480E2E80E400B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C5490E2E80E400B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C54A0E2E80E400B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C5510E2E80F400B7A85F /* testsprite2.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7590E2D0F1600EA573E /* testsprite2.c */; };
-		FDD2C5520E2E812C00B7A85F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
-		FDD2C5760E2E8C7400B7A85F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
-		FDD2C57D0E2E8C7400B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C57E0E2E8C7400B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C57F0E2E8C7400B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C5800E2E8C7400B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C5810E2E8C7400B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C5820E2E8C7400B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C5830E2E8C7400B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C58A0E2E8CB500B7A85F /* testtimer.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A75A0E2D0F1600EA573E /* testtimer.c */; };
-		FDD2C5B50E2E8CFC00B7A85F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; };
-		FDD2C5BB0E2E8CFC00B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C5BC0E2E8CFC00B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C5BD0E2E8CFC00B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C5BE0E2E8CFC00B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C5BF0E2E8CFC00B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C5C00E2E8CFC00B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C5C10E2E8CFC00B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C5C80E2E8D1200B7A85F /* testver.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A75B0E2D0F1600EA573E /* testver.c */; };
-		FDD2C6EA0E2E959E00B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
-		FDD2C6EB0E2E959E00B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
-		FDD2C6EC0E2E959E00B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
-		FDD2C6ED0E2E959E00B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
-		FDD2C6EE0E2E959E00B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
-		FDD2C6EF0E2E959E00B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
-		FDD2C6F00E2E959E00B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
-		FDD2C6F70E2E95B100B7A85F /* torturethread.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7610E2D0F1600EA573E /* torturethread.c */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
-		0466EE6F11E565E4000198A4 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = 006E982211955059001DE610;
-			remoteInfo = testsdl;
-		};
-		AA1EE451176059230029C7A5 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = AA1EE4461760589B0029C7A5;
-			remoteInfo = SDL2test;
-		};
-		FD1B48B70E3131CA007AB34E /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = FD6526630DE8FCCB002AD96B;
-			remoteInfo = StaticLib;
-		};
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
-		046CEF8613254F23007AD51D /* testgesture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgesture.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		046CEF8913254F63007AD51D /* testgesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgesture.c; path = ../../test/testgesture.c; sourceTree = SOURCE_ROOT; };
-		047A63ED13285C3200CD7973 /* checkkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = checkkeys.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		047A63F013285CD100CD7973 /* checkkeys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = checkkeys.c; path = ../../test/checkkeys.c; sourceTree = SOURCE_ROOT; };
-		1D6058910D05DD3D006BFB54 /* testwm2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwm2.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		56ED050D118A8FE400A56AA6 /* testpower.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpower.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		56ED0510118A904200A56AA6 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testpower.c; path = ../../test/testpower.c; sourceTree = SOURCE_ROOT; };
-		AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL2test.xcodeproj; path = ../SDLtest/SDL2test.xcodeproj; sourceTree = "<group>"; };
-		AAE7DEEC14CBB1E100DF1A0E /* testscale.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testscale.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		AAE7DF4514CBB43900DF1A0E /* testscale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testscale.c; path = ../../test/testscale.c; sourceTree = "<group>"; };
-		AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrendertarget.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testrendertarget.c; path = ../../test/testrendertarget.c; sourceTree = "<group>"; };
-		FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; };
-		FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testaudioinfo.c; path = ../../test/testaudioinfo.c; sourceTree = SOURCE_ROOT; };
-		FDA8A7470E2D0F1600EA573E /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testerror.c; path = ../../test/testerror.c; sourceTree = SOURCE_ROOT; };
-		FDA8A7480E2D0F1600EA573E /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testfile.c; path = ../../test/testfile.c; sourceTree = SOURCE_ROOT; };
-		FDA8A74C0E2D0F1600EA573E /* testthread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testthread.c; path = ../../test/testthread.c; sourceTree = SOURCE_ROOT; };
-		FDA8A74D0E2D0F1600EA573E /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testiconv.c; path = ../../test/testiconv.c; sourceTree = SOURCE_ROOT; };
-		FDA8A74E0E2D0F1600EA573E /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testjoystick.c; path = ../../test/testjoystick.c; sourceTree = SOURCE_ROOT; };
-		FDA8A74F0E2D0F1600EA573E /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testkeys.c; path = ../../test/testkeys.c; sourceTree = SOURCE_ROOT; };
-		FDA8A7510E2D0F1600EA573E /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testlock.c; path = ../../test/testlock.c; sourceTree = SOURCE_ROOT; };
-		FDA8A7540E2D0F1600EA573E /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testoverlay2.c; path = ../../test/testoverlay2.c; sourceTree = SOURCE_ROOT; };
-		FDA8A7560E2D0F1600EA573E /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testplatform.c; path = ../../test/testplatform.c; sourceTree = SOURCE_ROOT; };
-		FDA8A7570E2D0F1600EA573E /* testsem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsem.c; path = ../../test/testsem.c; sourceTree = SOURCE_ROOT; };
-		FDA8A7590E2D0F1600EA573E /* testsprite2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsprite2.c; path = ../../test/testsprite2.c; sourceTree = SOURCE_ROOT; };
-		FDA8A75A0E2D0F1600EA573E /* testtimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testtimer.c; path = ../../test/testtimer.c; sourceTree = SOURCE_ROOT; };
-		FDA8A75B0E2D0F1600EA573E /* testver.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testver.c; path = ../../test/testver.c; sourceTree = SOURCE_ROOT; };
-		FDA8A75F0E2D0F1600EA573E /* testwm2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testwm2.c; path = ../../test/testwm2.c; sourceTree = SOURCE_ROOT; };
-		FDA8A7610E2D0F1600EA573E /* torturethread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = torturethread.c; path = ../../test/torturethread.c; sourceTree = SOURCE_ROOT; };
-		FDA8A78B0E2D0F3D00EA573E /* loopwave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = loopwave.c; path = ../../test/loopwave.c; sourceTree = SOURCE_ROOT; };
-		FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
-		FDA8A8990E2D111A00EA573E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
-		FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
-		FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
-		FDA8A89C0E2D111A00EA573E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
-		FDA8A89D0E2D111A00EA573E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-		FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
-		FDA8AABB0E2D330F00EA573E /* loopwav.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = loopwav.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDA8AAD90E2D33B000EA573E /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; };
-		FDA8AADA0E2D33BA00EA573E /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; };
-		FDA8AADB0E2D33BA00EA573E /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; };
-		FDA8AADE0E2D33C100EA573E /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; };
-		FDA8AAE20E2D33C600EA573E /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; };
-		FDAAC3CD0E2D47E6001DB1D8 /* testaudioinfo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testaudioinfo.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDAAC59B0E2D5429001DB1D8 /* testerror.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testerror.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDAAC5C90E2D55B5001DB1D8 /* testfile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testfile.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDAAC6260E2D5914001DB1D8 /* testgles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgles.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDAAC6290E2D5960001DB1D8 /* testgles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgles.c; path = ../../test/testgles.c; sourceTree = SOURCE_ROOT; };
-		FDC430000F0D866D009C87E1 /* torturethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = torturethread.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDC430090F0D86BF009C87E1 /* testdraw2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testdraw2.c; path = ../../test/testdraw2.c; sourceTree = SOURCE_ROOT; };
-		FDD2C10A0E2E4F4B00B7A85F /* testthread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testthread.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C1810E2E52C000B7A85F /* testiconv.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testiconv.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C18A0E2E52FE00B7A85F /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; };
-		FDD2C1A50E2E534F00B7A85F /* testjoystick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testjoystick.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C45E0E2E773800B7A85F /* testkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testkeys.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C47C0E2E77D700B7A85F /* testlock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testlock.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C50B0E2E7F4800B7A85F /* testplatform.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testplatform.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C5290E2E807600B7A85F /* testsem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsem.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C54E0E2E80E400B7A85F /* testsprite2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsprite2.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C5870E2E8C7400B7A85F /* testtimer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testtimer.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C5C50E2E8CFC00B7A85F /* testver.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testver.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		FDD2C6F40E2E959E00B7A85F /* torturethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = torturethread.app; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		046CEF7A13254F23007AD51D /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				046CEF7B13254F23007AD51D /* libSDL2.a in Frameworks */,
-				046CEF7C13254F23007AD51D /* AudioToolbox.framework in Frameworks */,
-				046CEF7D13254F23007AD51D /* QuartzCore.framework in Frameworks */,
-				046CEF7E13254F23007AD51D /* OpenGLES.framework in Frameworks */,
-				046CEF7F13254F23007AD51D /* CoreGraphics.framework in Frameworks */,
-				046CEF8013254F23007AD51D /* UIKit.framework in Frameworks */,
-				046CEF8113254F23007AD51D /* Foundation.framework in Frameworks */,
-				046CEF8213254F23007AD51D /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		047A63E113285C3200CD7973 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA1EE470176059D00029C7A5 /* libSDL2test.a in Frameworks */,
-				047A63E213285C3200CD7973 /* libSDL2.a in Frameworks */,
-				047A63E313285C3200CD7973 /* AudioToolbox.framework in Frameworks */,
-				047A63E413285C3200CD7973 /* QuartzCore.framework in Frameworks */,
-				047A63E513285C3200CD7973 /* OpenGLES.framework in Frameworks */,
-				047A63E613285C3200CD7973 /* CoreGraphics.framework in Frameworks */,
-				047A63E713285C3200CD7973 /* UIKit.framework in Frameworks */,
-				047A63E813285C3200CD7973 /* Foundation.framework in Frameworks */,
-				047A63E913285C3200CD7973 /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA1EE47817605BF60029C7A5 /* libSDL2test.a in Frameworks */,
-				FDBDE5810E313465006BAC0B /* libSDL2.a in Frameworks */,
-				FDA8A89F0E2D111A00EA573E /* AudioToolbox.framework in Frameworks */,
-				FDA8A8A00E2D111A00EA573E /* QuartzCore.framework in Frameworks */,
-				FDA8A8A10E2D111A00EA573E /* OpenGLES.framework in Frameworks */,
-				FDA8A8A20E2D111A00EA573E /* CoreGraphics.framework in Frameworks */,
-				FDA8A8A30E2D111A00EA573E /* UIKit.framework in Frameworks */,
-				FDA8A8A40E2D111A00EA573E /* Foundation.framework in Frameworks */,
-				FDA8A8A50E2D111A00EA573E /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		56ED0501118A8FE400A56AA6 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				56ED0502118A8FE400A56AA6 /* libSDL2.a in Frameworks */,
-				56ED0503118A8FE400A56AA6 /* AudioToolbox.framework in Frameworks */,
-				56ED0504118A8FE400A56AA6 /* QuartzCore.framework in Frameworks */,
-				56ED0505118A8FE400A56AA6 /* OpenGLES.framework in Frameworks */,
-				56ED0506118A8FE400A56AA6 /* CoreGraphics.framework in Frameworks */,
-				56ED0507118A8FE400A56AA6 /* UIKit.framework in Frameworks */,
-				56ED0508118A8FE400A56AA6 /* Foundation.framework in Frameworks */,
-				56ED0509118A8FE400A56AA6 /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		AAE7DEE014CBB1E100DF1A0E /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA1EE47617605B9E0029C7A5 /* libSDL2test.a in Frameworks */,
-				AAE7DEE114CBB1E100DF1A0E /* libSDL2.a in Frameworks */,
-				AAE7DEE214CBB1E100DF1A0E /* AudioToolbox.framework in Frameworks */,
-				AAE7DEE314CBB1E100DF1A0E /* QuartzCore.framework in Frameworks */,
-				AAE7DEE414CBB1E100DF1A0E /* OpenGLES.framework in Frameworks */,
-				AAE7DEE514CBB1E100DF1A0E /* CoreGraphics.framework in Frameworks */,
-				AAE7DEE614CBB1E100DF1A0E /* UIKit.framework in Frameworks */,
-				AAE7DEE714CBB1E100DF1A0E /* Foundation.framework in Frameworks */,
-				AAE7DEE814CBB1E100DF1A0E /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		AAE7DFA514CBB54E00DF1A0E /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA1EE47517605B930029C7A5 /* libSDL2test.a in Frameworks */,
-				AAE7DFA614CBB54E00DF1A0E /* libSDL2.a in Frameworks */,
-				AAE7DFA714CBB54E00DF1A0E /* AudioToolbox.framework in Frameworks */,
-				AAE7DFA814CBB54E00DF1A0E /* QuartzCore.framework in Frameworks */,
-				AAE7DFA914CBB54E00DF1A0E /* OpenGLES.framework in Frameworks */,
-				AAE7DFAA14CBB54E00DF1A0E /* CoreGraphics.framework in Frameworks */,
-				AAE7DFAB14CBB54E00DF1A0E /* UIKit.framework in Frameworks */,
-				AAE7DFAC14CBB54E00DF1A0E /* Foundation.framework in Frameworks */,
-				AAE7DFAD14CBB54E00DF1A0E /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDA8AAAE0E2D330F00EA573E /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5850E313495006BAC0B /* libSDL2.a in Frameworks */,
-				FDA8AAB10E2D330F00EA573E /* AudioToolbox.framework in Frameworks */,
-				FDA8AAB20E2D330F00EA573E /* QuartzCore.framework in Frameworks */,
-				FDA8AAB30E2D330F00EA573E /* OpenGLES.framework in Frameworks */,
-				FDA8AAB40E2D330F00EA573E /* CoreGraphics.framework in Frameworks */,
-				FDA8AAB50E2D330F00EA573E /* UIKit.framework in Frameworks */,
-				FDA8AAB60E2D330F00EA573E /* Foundation.framework in Frameworks */,
-				FDA8AAB70E2D330F00EA573E /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC3C00E2D47E6001DB1D8 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE58C0E3134F3006BAC0B /* libSDL2.a in Frameworks */,
-				FDAAC3C30E2D47E6001DB1D8 /* AudioToolbox.framework in Frameworks */,
-				FDAAC3C40E2D47E6001DB1D8 /* QuartzCore.framework in Frameworks */,
-				FDAAC3C50E2D47E6001DB1D8 /* OpenGLES.framework in Frameworks */,
-				FDAAC3C60E2D47E6001DB1D8 /* CoreGraphics.framework in Frameworks */,
-				FDAAC3C70E2D47E6001DB1D8 /* UIKit.framework in Frameworks */,
-				FDAAC3C80E2D47E6001DB1D8 /* Foundation.framework in Frameworks */,
-				FDAAC3C90E2D47E6001DB1D8 /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC58E0E2D5429001DB1D8 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE59B0E31356A006BAC0B /* libSDL2.a in Frameworks */,
-				FDAAC5910E2D5429001DB1D8 /* AudioToolbox.framework in Frameworks */,
-				FDAAC5920E2D5429001DB1D8 /* QuartzCore.framework in Frameworks */,
-				FDAAC5930E2D5429001DB1D8 /* OpenGLES.framework in Frameworks */,
-				FDAAC5940E2D5429001DB1D8 /* CoreGraphics.framework in Frameworks */,
-				FDAAC5950E2D5429001DB1D8 /* UIKit.framework in Frameworks */,
-				FDAAC5960E2D5429001DB1D8 /* Foundation.framework in Frameworks */,
-				FDAAC5970E2D5429001DB1D8 /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC5BC0E2D55B5001DB1D8 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE59F0E31358D006BAC0B /* libSDL2.a in Frameworks */,
-				FDAAC5BF0E2D55B5001DB1D8 /* AudioToolbox.framework in Frameworks */,
-				FDAAC5C00E2D55B5001DB1D8 /* QuartzCore.framework in Frameworks */,
-				FDAAC5C10E2D55B5001DB1D8 /* OpenGLES.framework in Frameworks */,
-				FDAAC5C20E2D55B5001DB1D8 /* CoreGraphics.framework in Frameworks */,
-				FDAAC5C30E2D55B5001DB1D8 /* UIKit.framework in Frameworks */,
-				FDAAC5C40E2D55B5001DB1D8 /* Foundation.framework in Frameworks */,
-				FDAAC5C50E2D55B5001DB1D8 /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC6190E2D5914001DB1D8 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA1EE47417605B5C0029C7A5 /* libSDL2test.a in Frameworks */,
-				FDBDE57C0E313445006BAC0B /* libSDL2.a in Frameworks */,
-				FDAAC61C0E2D5914001DB1D8 /* AudioToolbox.framework in Frameworks */,
-				FDAAC61D0E2D5914001DB1D8 /* QuartzCore.framework in Frameworks */,
-				FDAAC61E0E2D5914001DB1D8 /* OpenGLES.framework in Frameworks */,
-				FDAAC61F0E2D5914001DB1D8 /* CoreGraphics.framework in Frameworks */,
-				FDAAC6200E2D5914001DB1D8 /* UIKit.framework in Frameworks */,
-				FDAAC6210E2D5914001DB1D8 /* Foundation.framework in Frameworks */,
-				FDAAC6220E2D5914001DB1D8 /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDC42FF30F0D866D009C87E1 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA1EE47117605A7F0029C7A5 /* libSDL2test.a in Frameworks */,
-				FDC42FF40F0D866D009C87E1 /* libSDL2.a in Frameworks */,
-				FDC42FF60F0D866D009C87E1 /* AudioToolbox.framework in Frameworks */,
-				FDC42FF70F0D866D009C87E1 /* QuartzCore.framework in Frameworks */,
-				FDC42FF80F0D866D009C87E1 /* OpenGLES.framework in Frameworks */,
-				FDC42FF90F0D866D009C87E1 /* CoreGraphics.framework in Frameworks */,
-				FDC42FFA0F0D866D009C87E1 /* UIKit.framework in Frameworks */,
-				FDC42FFB0F0D866D009C87E1 /* Foundation.framework in Frameworks */,
-				FDC42FFC0F0D866D009C87E1 /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C0FD0E2E4F4B00B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5A90E3135C0006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C1000E2E4F4B00B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C1010E2E4F4B00B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C1020E2E4F4B00B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C1030E2E4F4B00B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C1040E2E4F4B00B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C1050E2E4F4B00B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C1060E2E4F4B00B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C1740E2E52C000B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5AE0E3135E6006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C1770E2E52C000B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C1780E2E52C000B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C1790E2E52C000B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C17A0E2E52C000B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C17B0E2E52C000B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C17C0E2E52C000B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C17D0E2E52C000B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C1980E2E534F00B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5B60E3135FE006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C19B0E2E534F00B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C19C0E2E534F00B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C19D0E2E534F00B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C19E0E2E534F00B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C19F0E2E534F00B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C1A00E2E534F00B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C1A10E2E534F00B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C4510E2E773800B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5BC0E31364D006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C4540E2E773800B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C4550E2E773800B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C4560E2E773800B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C4570E2E773800B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C4580E2E773800B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C4590E2E773800B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C45A0E2E773800B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C46F0E2E77D700B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5C20E313663006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C4720E2E77D700B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C4730E2E77D700B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C4740E2E77D700B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C4750E2E77D700B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C4760E2E77D700B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C4770E2E77D700B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C4780E2E77D700B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C4FE0E2E7F4800B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5C60E3136F1006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C5010E2E7F4800B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C5020E2E7F4800B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C5030E2E7F4800B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C5040E2E7F4800B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C5050E2E7F4800B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C5060E2E7F4800B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C5070E2E7F4800B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C51C0E2E807600B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5C80E313702006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C51F0E2E807600B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C5200E2E807600B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C5210E2E807600B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C5220E2E807600B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C5230E2E807600B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C5240E2E807600B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C5250E2E807600B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C5410E2E80E400B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA1EE47717605BAB0029C7A5 /* libSDL2test.a in Frameworks */,
-				FDBDE5CA0E313712006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C5440E2E80E400B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C5450E2E80E400B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C5460E2E80E400B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C5470E2E80E400B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C5480E2E80E400B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C5490E2E80E400B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C54A0E2E80E400B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C57A0E2E8C7400B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5CC0E31372B006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C57D0E2E8C7400B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C57E0E2E8C7400B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C57F0E2E8C7400B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C5800E2E8C7400B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C5810E2E8C7400B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C5820E2E8C7400B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C5830E2E8C7400B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C5B80E2E8CFC00B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5CE0E31373E006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C5BB0E2E8CFC00B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C5BC0E2E8CFC00B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C5BD0E2E8CFC00B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C5BE0E2E8CFC00B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C5BF0E2E8CFC00B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C5C00E2E8CFC00B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C5C10E2E8CFC00B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C6E70E2E959E00B7A85F /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDBDE5D40E313789006BAC0B /* libSDL2.a in Frameworks */,
-				FDD2C6EA0E2E959E00B7A85F /* AudioToolbox.framework in Frameworks */,
-				FDD2C6EB0E2E959E00B7A85F /* QuartzCore.framework in Frameworks */,
-				FDD2C6EC0E2E959E00B7A85F /* OpenGLES.framework in Frameworks */,
-				FDD2C6ED0E2E959E00B7A85F /* CoreGraphics.framework in Frameworks */,
-				FDD2C6EE0E2E959E00B7A85F /* UIKit.framework in Frameworks */,
-				FDD2C6EF0E2E959E00B7A85F /* Foundation.framework in Frameworks */,
-				FDD2C6F00E2E959E00B7A85F /* CoreAudio.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		19C28FACFE9D520D11CA2CBB /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				1D6058910D05DD3D006BFB54 /* testwm2.app */,
-				FDA8AABB0E2D330F00EA573E /* loopwav.app */,
-				FDAAC3CD0E2D47E6001DB1D8 /* testaudioinfo.app */,
-				FDAAC59B0E2D5429001DB1D8 /* testerror.app */,
-				FDAAC5C90E2D55B5001DB1D8 /* testfile.app */,
-				FDAAC6260E2D5914001DB1D8 /* testgles.app */,
-				FDD2C10A0E2E4F4B00B7A85F /* testthread.app */,
-				FDD2C1810E2E52C000B7A85F /* testiconv.app */,
-				FDD2C1A50E2E534F00B7A85F /* testjoystick.app */,
-				FDD2C45E0E2E773800B7A85F /* testkeys.app */,
-				FDD2C47C0E2E77D700B7A85F /* testlock.app */,
-				FDD2C50B0E2E7F4800B7A85F /* testplatform.app */,
-				FDD2C5290E2E807600B7A85F /* testsem.app */,
-				FDD2C54E0E2E80E400B7A85F /* testsprite2.app */,
-				FDD2C5870E2E8C7400B7A85F /* testtimer.app */,
-				FDD2C5C50E2E8CFC00B7A85F /* testver.app */,
-				FDD2C6F40E2E959E00B7A85F /* torturethread.app */,
-				FDC430000F0D866D009C87E1 /* torturethread.app */,
-				56ED050D118A8FE400A56AA6 /* testpower.app */,
-				046CEF8613254F23007AD51D /* testgesture.app */,
-				047A63ED13285C3200CD7973 /* checkkeys.app */,
-				AAE7DEEC14CBB1E100DF1A0E /* testscale.app */,
-				AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
-			isa = PBXGroup;
-			children = (
-				AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */,
-				FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */,
-				FDA8AAD60E2D339A00EA573E /* Resources */,
-				FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */,
-				FDA8A73B0E2D0F0400EA573E /* src */,
-				19C28FACFE9D520D11CA2CBB /* Products */,
-			);
-			name = CustomTemplate;
-			sourceTree = "<group>";
-		};
-		AA1EE44E176059220029C7A5 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				AA1EE452176059230029C7A5 /* libSDL2test.a */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		FD1B48AD0E3131CA007AB34E /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				FD1B48B80E3131CA007AB34E /* libSDL2.a */,
-				0466EE7011E565E4000198A4 /* testsdl.app */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		FDA8A73B0E2D0F0400EA573E /* src */ = {
-			isa = PBXGroup;
-			children = (
-				047A63F013285CD100CD7973 /* checkkeys.c */,
-				FDA8A78B0E2D0F3D00EA573E /* loopwave.c */,
-				FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */,
-				FDC430090F0D86BF009C87E1 /* testdraw2.c */,
-				FDA8A7470E2D0F1600EA573E /* testerror.c */,
-				FDA8A7480E2D0F1600EA573E /* testfile.c */,
-				046CEF8913254F63007AD51D /* testgesture.c */,
-				FDAAC6290E2D5960001DB1D8 /* testgles.c */,
-				FDA8A74D0E2D0F1600EA573E /* testiconv.c */,
-				FDA8A74E0E2D0F1600EA573E /* testjoystick.c */,
-				FDA8A74F0E2D0F1600EA573E /* testkeys.c */,
-				FDA8A7510E2D0F1600EA573E /* testlock.c */,
-				FDA8A7540E2D0F1600EA573E /* testoverlay2.c */,
-				FDA8A7560E2D0F1600EA573E /* testplatform.c */,
-				56ED0510118A904200A56AA6 /* testpower.c */,
-				AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */,
-				AAE7DF4514CBB43900DF1A0E /* testscale.c */,
-				FDA8A7570E2D0F1600EA573E /* testsem.c */,
-				FDA8A7590E2D0F1600EA573E /* testsprite2.c */,
-				FDA8A74C0E2D0F1600EA573E /* testthread.c */,
-				FDA8A75A0E2D0F1600EA573E /* testtimer.c */,
-				FDA8A75B0E2D0F1600EA573E /* testver.c */,
-				FDA8A75F0E2D0F1600EA573E /* testwm2.c */,
-				FDA8A7610E2D0F1600EA573E /* torturethread.c */,
-			);
-			name = src;
-			sourceTree = "<group>";
-		};
-		FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */,
-				FDA8A8990E2D111A00EA573E /* QuartzCore.framework */,
-				FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */,
-				FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */,
-				FDA8A89C0E2D111A00EA573E /* UIKit.framework */,
-				FDA8A89D0E2D111A00EA573E /* Foundation.framework */,
-				FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */,
-			);
-			name = "Linked Frameworks";
-			sourceTree = "<group>";
-		};
-		FDA8AAD60E2D339A00EA573E /* Resources */ = {
-			isa = PBXGroup;
-			children = (
-				FDD2C18A0E2E52FE00B7A85F /* utf8.txt */,
-				FDA8AAD90E2D33B000EA573E /* icon.bmp */,
-				FDA8AADA0E2D33BA00EA573E /* moose.dat */,
-				FDA8AADB0E2D33BA00EA573E /* picture.xbm */,
-				FDA8AADE0E2D33C100EA573E /* sample.bmp */,
-				FDA8AAE20E2D33C600EA573E /* sample.wav */,
-			);
-			name = Resources;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		046CEF7513254F23007AD51D /* testgesture */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 046CEF8313254F23007AD51D /* Build configuration list for PBXNativeTarget "testgesture" */;
-			buildPhases = (
-				046CEF7613254F23007AD51D /* Resources */,
-				046CEF7813254F23007AD51D /* Sources */,
-				046CEF7A13254F23007AD51D /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testgesture;
-			productName = Test;
-			productReference = 046CEF8613254F23007AD51D /* testgesture.app */;
-			productType = "com.apple.product-type.application";
-		};
-		047A63DD13285C3200CD7973 /* checkkeys */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 047A63EA13285C3200CD7973 /* Build configuration list for PBXNativeTarget "checkkeys" */;
-			buildPhases = (
-				047A63DE13285C3200CD7973 /* Resources */,
-				047A63DF13285C3200CD7973 /* Sources */,
-				047A63E113285C3200CD7973 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = checkkeys;
-			productName = Test;
-			productReference = 047A63ED13285C3200CD7973 /* checkkeys.app */;
-			productType = "com.apple.product-type.application";
-		};
-		1D6058900D05DD3D006BFB54 /* testwm2 */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "testwm2" */;
-			buildPhases = (
-				1D60588D0D05DD3D006BFB54 /* Resources */,
-				1D60588E0D05DD3D006BFB54 /* Sources */,
-				1D60588F0D05DD3D006BFB54 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testwm2;
-			productName = Test;
-			productReference = 1D6058910D05DD3D006BFB54 /* testwm2.app */;
-			productType = "com.apple.product-type.application";
-		};
-		56ED04FC118A8FE400A56AA6 /* testpower */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 56ED050A118A8FE400A56AA6 /* Build configuration list for PBXNativeTarget "testpower" */;
-			buildPhases = (
-				56ED04FD118A8FE400A56AA6 /* Resources */,
-				56ED04FF118A8FE400A56AA6 /* Sources */,
-				56ED0501118A8FE400A56AA6 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testpower;
-			productName = Test;
-			productReference = 56ED050D118A8FE400A56AA6 /* testpower.app */;
-			productType = "com.apple.product-type.application";
-		};
-		AAE7DEDA14CBB1E100DF1A0E /* testscale */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = AAE7DEE914CBB1E100DF1A0E /* Build configuration list for PBXNativeTarget "testscale" */;
-			buildPhases = (
-				AAE7DEDB14CBB1E100DF1A0E /* Resources */,
-				AAE7DEDD14CBB1E100DF1A0E /* Sources */,
-				AAE7DEE014CBB1E100DF1A0E /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testscale;
-			productName = Test;
-			productReference = AAE7DEEC14CBB1E100DF1A0E /* testscale.app */;
-			productType = "com.apple.product-type.application";
-		};
-		AAE7DF9E14CBB54E00DF1A0E /* testrendertarget */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = AAE7DFAE14CBB54E00DF1A0E /* Build configuration list for PBXNativeTarget "testrendertarget" */;
-			buildPhases = (
-				AAE7DF9F14CBB54E00DF1A0E /* Resources */,
-				AAE7DFA214CBB54E00DF1A0E /* Sources */,
-				AAE7DFA514CBB54E00DF1A0E /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testrendertarget;
-			productName = Test;
-			productReference = AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDA8AAAA0E2D330F00EA573E /* loopwav */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDA8AAB80E2D330F00EA573E /* Build configuration list for PBXNativeTarget "loopwav" */;
-			buildPhases = (
-				FDA8AAAB0E2D330F00EA573E /* Resources */,
-				FDA8AAAC0E2D330F00EA573E /* Sources */,
-				FDA8AAAE0E2D330F00EA573E /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = loopwav;
-			productName = Test;
-			productReference = FDA8AABB0E2D330F00EA573E /* loopwav.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDAAC3BB0E2D47E6001DB1D8 /* testaudioinfo */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDAAC3CA0E2D47E6001DB1D8 /* Build configuration list for PBXNativeTarget "testaudioinfo" */;
-			buildPhases = (
-				FDAAC3BC0E2D47E6001DB1D8 /* Resources */,
-				FDAAC3BE0E2D47E6001DB1D8 /* Sources */,
-				FDAAC3C00E2D47E6001DB1D8 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testaudioinfo;
-			productName = Test;
-			productReference = FDAAC3CD0E2D47E6001DB1D8 /* testaudioinfo.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDAAC58A0E2D5429001DB1D8 /* testerror */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDAAC5980E2D5429001DB1D8 /* Build configuration list for PBXNativeTarget "testerror" */;
-			buildPhases = (
-				FDAAC58B0E2D5429001DB1D8 /* Resources */,
-				FDAAC58C0E2D5429001DB1D8 /* Sources */,
-				FDAAC58E0E2D5429001DB1D8 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testerror;
-			productName = Test;
-			productReference = FDAAC59B0E2D5429001DB1D8 /* testerror.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDAAC5B80E2D55B5001DB1D8 /* testfile */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDAAC5C60E2D55B5001DB1D8 /* Build configuration list for PBXNativeTarget "testfile" */;
-			buildPhases = (
-				FDAAC5B90E2D55B5001DB1D8 /* Resources */,
-				FDAAC5BA0E2D55B5001DB1D8 /* Sources */,
-				FDAAC5BC0E2D55B5001DB1D8 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testfile;
-			productName = Test;
-			productReference = FDAAC5C90E2D55B5001DB1D8 /* testfile.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDAAC6150E2D5914001DB1D8 /* testgles */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDAAC6230E2D5914001DB1D8 /* Build configuration list for PBXNativeTarget "testgles" */;
-			buildPhases = (
-				FDAAC6160E2D5914001DB1D8 /* Resources */,
-				FDAAC6170E2D5914001DB1D8 /* Sources */,
-				FDAAC6190E2D5914001DB1D8 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testgles;
-			productName = Test;
-			productReference = FDAAC6260E2D5914001DB1D8 /* testgles.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDC42FEF0F0D866D009C87E1 /* testdraw2 */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDC42FFD0F0D866D009C87E1 /* Build configuration list for PBXNativeTarget "testdraw2" */;
-			buildPhases = (
-				FDC42FF00F0D866D009C87E1 /* Resources */,
-				FDC42FF10F0D866D009C87E1 /* Sources */,
-				FDC42FF30F0D866D009C87E1 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testdraw2;
-			productName = Test;
-			productReference = FDC430000F0D866D009C87E1 /* torturethread.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C0F90E2E4F4B00B7A85F /* testthread */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C1070E2E4F4B00B7A85F /* Build configuration list for PBXNativeTarget "testthread" */;
-			buildPhases = (
-				FDD2C0FA0E2E4F4B00B7A85F /* Resources */,
-				FDD2C0FB0E2E4F4B00B7A85F /* Sources */,
-				FDD2C0FD0E2E4F4B00B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testthread;
-			productName = Test;
-			productReference = FDD2C10A0E2E4F4B00B7A85F /* testthread.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C1700E2E52C000B7A85F /* testiconv */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C17E0E2E52C000B7A85F /* Build configuration list for PBXNativeTarget "testiconv" */;
-			buildPhases = (
-				FDD2C1710E2E52C000B7A85F /* Resources */,
-				FDD2C1720E2E52C000B7A85F /* Sources */,
-				FDD2C1740E2E52C000B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testiconv;
-			productName = Test;
-			productReference = FDD2C1810E2E52C000B7A85F /* testiconv.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C1930E2E534F00B7A85F /* testjoystick */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C1A20E2E534F00B7A85F /* Build configuration list for PBXNativeTarget "testjoystick" */;
-			buildPhases = (
-				FDD2C1940E2E534F00B7A85F /* Resources */,
-				FDD2C1960E2E534F00B7A85F /* Sources */,
-				FDD2C1980E2E534F00B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testjoystick;
-			productName = Test;
-			productReference = FDD2C1A50E2E534F00B7A85F /* testjoystick.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C44D0E2E773800B7A85F /* testkeys */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C45B0E2E773800B7A85F /* Build configuration list for PBXNativeTarget "testkeys" */;
-			buildPhases = (
-				FDD2C44E0E2E773800B7A85F /* Resources */,
-				FDD2C44F0E2E773800B7A85F /* Sources */,
-				FDD2C4510E2E773800B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testkeys;
-			productName = Test;
-			productReference = FDD2C45E0E2E773800B7A85F /* testkeys.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C46B0E2E77D700B7A85F /* testlock */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C4790E2E77D700B7A85F /* Build configuration list for PBXNativeTarget "testlock" */;
-			buildPhases = (
-				FDD2C46C0E2E77D700B7A85F /* Resources */,
-				FDD2C46D0E2E77D700B7A85F /* Sources */,
-				FDD2C46F0E2E77D700B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testlock;
-			productName = Test;
-			productReference = FDD2C47C0E2E77D700B7A85F /* testlock.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C4F90E2E7F4800B7A85F /* testplatform */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C5080E2E7F4800B7A85F /* Build configuration list for PBXNativeTarget "testplatform" */;
-			buildPhases = (
-				FDD2C4FA0E2E7F4800B7A85F /* Resources */,
-				FDD2C4FC0E2E7F4800B7A85F /* Sources */,
-				FDD2C4FE0E2E7F4800B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testplatform;
-			productName = Test;
-			productReference = FDD2C50B0E2E7F4800B7A85F /* testplatform.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C5170E2E807600B7A85F /* testsem */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C5260E2E807600B7A85F /* Build configuration list for PBXNativeTarget "testsem" */;
-			buildPhases = (
-				FDD2C5180E2E807600B7A85F /* Resources */,
-				FDD2C51A0E2E807600B7A85F /* Sources */,
-				FDD2C51C0E2E807600B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testsem;
-			productName = Test;
-			productReference = FDD2C5290E2E807600B7A85F /* testsem.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C53D0E2E80E400B7A85F /* testsprite2 */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C54B0E2E80E400B7A85F /* Build configuration list for PBXNativeTarget "testsprite2" */;
-			buildPhases = (
-				FDD2C53E0E2E80E400B7A85F /* Resources */,
-				FDD2C53F0E2E80E400B7A85F /* Sources */,
-				FDD2C5410E2E80E400B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testsprite2;
-			productName = Test;
-			productReference = FDD2C54E0E2E80E400B7A85F /* testsprite2.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C5740E2E8C7400B7A85F /* testtimer */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C5840E2E8C7400B7A85F /* Build configuration list for PBXNativeTarget "testtimer" */;
-			buildPhases = (
-				FDD2C5750E2E8C7400B7A85F /* Resources */,
-				FDD2C5770E2E8C7400B7A85F /* Sources */,
-				FDD2C57A0E2E8C7400B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testtimer;
-			productName = Test;
-			productReference = FDD2C5870E2E8C7400B7A85F /* testtimer.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C5B30E2E8CFC00B7A85F /* testver */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C5C20E2E8CFC00B7A85F /* Build configuration list for PBXNativeTarget "testver" */;
-			buildPhases = (
-				FDD2C5B40E2E8CFC00B7A85F /* Resources */,
-				FDD2C5B60E2E8CFC00B7A85F /* Sources */,
-				FDD2C5B80E2E8CFC00B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testver;
-			productName = Test;
-			productReference = FDD2C5C50E2E8CFC00B7A85F /* testver.app */;
-			productType = "com.apple.product-type.application";
-		};
-		FDD2C6E20E2E959E00B7A85F /* torturethread */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FDD2C6F10E2E959E00B7A85F /* Build configuration list for PBXNativeTarget "torturethread" */;
-			buildPhases = (
-				FDD2C6E30E2E959E00B7A85F /* Resources */,
-				FDD2C6E50E2E959E00B7A85F /* Sources */,
-				FDD2C6E70E2E959E00B7A85F /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = torturethread;
-			productName = Test;
-			productReference = FDD2C6F40E2E959E00B7A85F /* torturethread.app */;
-			productType = "com.apple.product-type.application";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		29B97313FDCFA39411CA2CEA /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				LastUpgradeCheck = 0420;
-			};
-			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TestiPhoneOS" */;
-			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
-			hasScannedForEncodings = 1;
-			knownRegions = (
-				English,
-				Japanese,
-				French,
-				German,
-			);
-			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
-			projectDirPath = "";
-			projectReferences = (
-				{
-					ProductGroup = FD1B48AD0E3131CA007AB34E /* Products */;
-					ProjectRef = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */;
-				},
-				{
-					ProductGroup = AA1EE44E176059220029C7A5 /* Products */;
-					ProjectRef = AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */;
-				},
-			);
-			projectRoot = "";
-			targets = (
-				047A63DD13285C3200CD7973 /* checkkeys */,
-				FDA8AAAA0E2D330F00EA573E /* loopwav */,
-				FDAAC3BB0E2D47E6001DB1D8 /* testaudioinfo */,
-				FDC42FEF0F0D866D009C87E1 /* testdraw2 */,
-				FDAAC58A0E2D5429001DB1D8 /* testerror */,
-				FDAAC5B80E2D55B5001DB1D8 /* testfile */,
-				046CEF7513254F23007AD51D /* testgesture */,
-				FDAAC6150E2D5914001DB1D8 /* testgles */,
-				FDD2C1700E2E52C000B7A85F /* testiconv */,
-				FDD2C1930E2E534F00B7A85F /* testjoystick */,
-				FDD2C44D0E2E773800B7A85F /* testkeys */,
-				FDD2C46B0E2E77D700B7A85F /* testlock */,
-				FDD2C4F90E2E7F4800B7A85F /* testplatform */,
-				56ED04FC118A8FE400A56AA6 /* testpower */,
-				AAE7DF9E14CBB54E00DF1A0E /* testrendertarget */,
-				AAE7DEDA14CBB1E100DF1A0E /* testscale */,
-				FDD2C5170E2E807600B7A85F /* testsem */,
-				FDD2C53D0E2E80E400B7A85F /* testsprite2 */,
-				FDD2C0F90E2E4F4B00B7A85F /* testthread */,
-				FDD2C5740E2E8C7400B7A85F /* testtimer */,
-				FDD2C5B30E2E8CFC00B7A85F /* testver */,
-				1D6058900D05DD3D006BFB54 /* testwm2 */,
-				FDD2C6E20E2E959E00B7A85F /* torturethread */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXReferenceProxy section */
-		0466EE7011E565E4000198A4 /* testsdl.app */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.application;
-			path = testsdl.app;
-			remoteRef = 0466EE6F11E565E4000198A4 /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		AA1EE452176059230029C7A5 /* libSDL2test.a */ = {
-			isa = PBXReferenceProxy;
-			fileType = archive.ar;
-			path = libSDL2test.a;
-			remoteRef = AA1EE451176059230029C7A5 /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		FD1B48B80E3131CA007AB34E /* libSDL2.a */ = {
-			isa = PBXReferenceProxy;
-			fileType = archive.ar;
-			path = libSDL2.a;
-			remoteRef = FD1B48B70E3131CA007AB34E /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-/* End PBXReferenceProxy section */
-
-/* Begin PBXResourcesBuildPhase section */
-		046CEF7613254F23007AD51D /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				046CEF7713254F23007AD51D /* icon.bmp in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		047A63DE13285C3200CD7973 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		1D60588D0D05DD3D006BFB54 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		56ED04FD118A8FE400A56AA6 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				56ED04FE118A8FE400A56AA6 /* icon.bmp in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		AAE7DEDB14CBB1E100DF1A0E /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AAE7DEDC14CBB1E100DF1A0E /* icon.bmp in Resources */,
-				AAE7DF4714CBB45000DF1A0E /* sample.bmp in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		AAE7DF9F14CBB54E00DF1A0E /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AAE7DFA014CBB54E00DF1A0E /* icon.bmp in Resources */,
-				AAE7DFA114CBB54E00DF1A0E /* sample.bmp in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDA8AAAB0E2D330F00EA573E /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDA8AAE30E2D33C600EA573E /* sample.wav in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC3BC0E2D47E6001DB1D8 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC58B0E2D5429001DB1D8 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC5B90E2D55B5001DB1D8 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC6160E2D5914001DB1D8 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDAAC6390E2D59BE001DB1D8 /* icon.bmp in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDC42FF00F0D866D009C87E1 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C0FA0E2E4F4B00B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C1710E2E52C000B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C18B0E2E52FE00B7A85F /* utf8.txt in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C1940E2E534F00B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C44E0E2E773800B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C46C0E2E77D700B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C4FA0E2E7F4800B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C5180E2E807600B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C53E0E2E80E400B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C5520E2E812C00B7A85F /* icon.bmp in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C5750E2E8C7400B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C5760E2E8C7400B7A85F /* icon.bmp in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C5B40E2E8CFC00B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C5B50E2E8CFC00B7A85F /* icon.bmp in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C6E30E2E959E00B7A85F /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		046CEF7813254F23007AD51D /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				046CEF8A13254F63007AD51D /* testgesture.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		047A63DF13285C3200CD7973 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				047A63F113285CD100CD7973 /* checkkeys.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		1D60588E0D05DD3D006BFB54 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDA8A79C0E2D0F9300EA573E /* testwm2.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		56ED04FF118A8FE400A56AA6 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				56ED0511118A904200A56AA6 /* testpower.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		AAE7DEDD14CBB1E100DF1A0E /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AAE7DF4614CBB43900DF1A0E /* testscale.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		AAE7DFA214CBB54E00DF1A0E /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AAE7DFB514CBB5F700DF1A0E /* testrendertarget.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDA8AAAC0E2D330F00EA573E /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDA8AABE0E2D335C00EA573E /* loopwave.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC3BE0E2D47E6001DB1D8 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDAAC3D30E2D4800001DB1D8 /* testaudioinfo.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC58C0E2D5429001DB1D8 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDAAC59F0E2D54B8001DB1D8 /* testerror.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC5BA0E2D55B5001DB1D8 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDAAC5CC0E2D55CA001DB1D8 /* testfile.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDAAC6170E2D5914001DB1D8 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDAAC62A0E2D5960001DB1D8 /* testgles.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDC42FF10F0D866D009C87E1 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDC4300A0F0D86BF009C87E1 /* testdraw2.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C0FB0E2E4F4B00B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C10D0E2E4F6900B7A85F /* testthread.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C1720E2E52C000B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C1840E2E52D900B7A85F /* testiconv.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C1960E2E534F00B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C1A80E2E536400B7A85F /* testjoystick.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C44F0E2E773800B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C4610E2E777500B7A85F /* testkeys.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C46D0E2E77D700B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C47F0E2E77E300B7A85F /* testlock.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C4FC0E2E7F4800B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C50E0E2E7F5800B7A85F /* testplatform.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C51A0E2E807600B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C52C0E2E808700B7A85F /* testsem.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C53F0E2E80E400B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C5510E2E80F400B7A85F /* testsprite2.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C5770E2E8C7400B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C58A0E2E8CB500B7A85F /* testtimer.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C5B60E2E8CFC00B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C5C80E2E8D1200B7A85F /* testver.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		FDD2C6E50E2E959E00B7A85F /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FDD2C6F70E2E95B100B7A85F /* torturethread.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
-		046CEF8413254F23007AD51D /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testgesture;
-			};
-			name = Debug;
-		};
-		046CEF8513254F23007AD51D /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testgesture;
-			};
-			name = Release;
-		};
-		047A63EB13285C3200CD7973 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = checkkeys;
-			};
-			name = Debug;
-		};
-		047A63EC13285C3200CD7973 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = checkkeys;
-			};
-			name = Release;
-		};
-		1D6058940D05DD3E006BFB54 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testwm2;
-			};
-			name = Debug;
-		};
-		1D6058950D05DD3E006BFB54 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testwm2;
-			};
-			name = Release;
-		};
-		56ED050B118A8FE400A56AA6 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testpower;
-			};
-			name = Debug;
-		};
-		56ED050C118A8FE400A56AA6 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testpower;
-			};
-			name = Release;
-		};
-		AAE7DEEA14CBB1E100DF1A0E /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testscale;
-			};
-			name = Debug;
-		};
-		AAE7DEEB14CBB1E100DF1A0E /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testscale;
-			};
-			name = Release;
-		};
-		AAE7DFAF14CBB54E00DF1A0E /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testrendertarget;
-			};
-			name = Debug;
-		};
-		AAE7DFB014CBB54E00DF1A0E /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testrendertarget;
-			};
-			name = Release;
-		};
-		C01FCF4F08A954540054247B /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = (
-					armv7,
-					armv6,
-				);
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				GCC_OPTIMIZATION_LEVEL = 0;
-				HEADER_SEARCH_PATHS = ../../include;
-				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
-				OTHER_LDFLAGS = "-ObjC";
-				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
-				SDKROOT = iphoneos;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Debug;
-		};
-		C01FCF5008A954540054247B /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = (
-					armv7,
-					armv6,
-				);
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				HEADER_SEARCH_PATHS = ../../include;
-				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
-				OTHER_LDFLAGS = "-ObjC";
-				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
-				SDKROOT = iphoneos;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Release;
-		};
-		FDA8AAB90E2D330F00EA573E /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = loopwav;
-			};
-			name = Debug;
-		};
-		FDA8AABA0E2D330F00EA573E /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = loopwav;
-			};
-			name = Release;
-		};
-		FDAAC3CB0E2D47E6001DB1D8 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testaudioinfo;
-			};
-			name = Debug;
-		};
-		FDAAC3CC0E2D47E6001DB1D8 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testaudioinfo;
-			};
-			name = Release;
-		};
-		FDAAC5990E2D5429001DB1D8 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testerror;
-			};
-			name = Debug;
-		};
-		FDAAC59A0E2D5429001DB1D8 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testerror;
-			};
-			name = Release;
-		};
-		FDAAC5C70E2D55B5001DB1D8 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testfile;
-			};
-			name = Debug;
-		};
-		FDAAC5C80E2D55B5001DB1D8 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testfile;
-			};
-			name = Release;
-		};
-		FDAAC6240E2D5914001DB1D8 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testgles;
-			};
-			name = Debug;
-		};
-		FDAAC6250E2D5914001DB1D8 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testgles;
-			};
-			name = Release;
-		};
-		FDC42FFE0F0D866D009C87E1 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = torturethread;
-			};
-			name = Debug;
-		};
-		FDC42FFF0F0D866D009C87E1 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = torturethread;
-			};
-			name = Release;
-		};
-		FDD2C1080E2E4F4B00B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testthread;
-			};
-			name = Debug;
-		};
-		FDD2C1090E2E4F4B00B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testthread;
-			};
-			name = Release;
-		};
-		FDD2C17F0E2E52C000B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testiconv;
-			};
-			name = Debug;
-		};
-		FDD2C1800E2E52C000B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testiconv;
-			};
-			name = Release;
-		};
-		FDD2C1A30E2E534F00B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testjoystick;
-			};
-			name = Debug;
-		};
-		FDD2C1A40E2E534F00B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testjoystick;
-			};
-			name = Release;
-		};
-		FDD2C45C0E2E773800B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testkeys;
-			};
-			name = Debug;
-		};
-		FDD2C45D0E2E773800B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testkeys;
-			};
-			name = Release;
-		};
-		FDD2C47A0E2E77D700B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testlock;
-			};
-			name = Debug;
-		};
-		FDD2C47B0E2E77D700B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testlock;
-			};
-			name = Release;
-		};
-		FDD2C5090E2E7F4800B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testplatform;
-			};
-			name = Debug;
-		};
-		FDD2C50A0E2E7F4800B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testplatform;
-			};
-			name = Release;
-		};
-		FDD2C5270E2E807600B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testsem;
-			};
-			name = Debug;
-		};
-		FDD2C5280E2E807600B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testsem;
-			};
-			name = Release;
-		};
-		FDD2C54C0E2E80E400B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testsprite2;
-			};
-			name = Debug;
-		};
-		FDD2C54D0E2E80E400B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testsprite2;
-			};
-			name = Release;
-		};
-		FDD2C5850E2E8C7400B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testtimer;
-			};
-			name = Debug;
-		};
-		FDD2C5860E2E8C7400B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testtimer;
-			};
-			name = Release;
-		};
-		FDD2C5C30E2E8CFC00B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testver;
-			};
-			name = Debug;
-		};
-		FDD2C5C40E2E8CFC00B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = testver;
-			};
-			name = Release;
-		};
-		FDD2C6F20E2E959E00B7A85F /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = torturethread;
-			};
-			name = Debug;
-		};
-		FDD2C6F30E2E959E00B7A85F /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				INFOPLIST_FILE = Info.plist;
-				PRODUCT_NAME = torturethread;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		046CEF8313254F23007AD51D /* Build configuration list for PBXNativeTarget "testgesture" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				046CEF8413254F23007AD51D /* Debug */,
-				046CEF8513254F23007AD51D /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		047A63EA13285C3200CD7973 /* Build configuration list for PBXNativeTarget "checkkeys" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				047A63EB13285C3200CD7973 /* Debug */,
-				047A63EC13285C3200CD7973 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "testwm2" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				1D6058940D05DD3E006BFB54 /* Debug */,
-				1D6058950D05DD3E006BFB54 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		56ED050A118A8FE400A56AA6 /* Build configuration list for PBXNativeTarget "testpower" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				56ED050B118A8FE400A56AA6 /* Debug */,
-				56ED050C118A8FE400A56AA6 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		AAE7DEE914CBB1E100DF1A0E /* Build configuration list for PBXNativeTarget "testscale" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				AAE7DEEA14CBB1E100DF1A0E /* Debug */,
-				AAE7DEEB14CBB1E100DF1A0E /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		AAE7DFAE14CBB54E00DF1A0E /* Build configuration list for PBXNativeTarget "testrendertarget" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				AAE7DFAF14CBB54E00DF1A0E /* Debug */,
-				AAE7DFB014CBB54E00DF1A0E /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TestiPhoneOS" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				C01FCF4F08A954540054247B /* Debug */,
-				C01FCF5008A954540054247B /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDA8AAB80E2D330F00EA573E /* Build configuration list for PBXNativeTarget "loopwav" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDA8AAB90E2D330F00EA573E /* Debug */,
-				FDA8AABA0E2D330F00EA573E /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDAAC3CA0E2D47E6001DB1D8 /* Build configuration list for PBXNativeTarget "testaudioinfo" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDAAC3CB0E2D47E6001DB1D8 /* Debug */,
-				FDAAC3CC0E2D47E6001DB1D8 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDAAC5980E2D5429001DB1D8 /* Build configuration list for PBXNativeTarget "testerror" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDAAC5990E2D5429001DB1D8 /* Debug */,
-				FDAAC59A0E2D5429001DB1D8 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDAAC5C60E2D55B5001DB1D8 /* Build configuration list for PBXNativeTarget "testfile" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDAAC5C70E2D55B5001DB1D8 /* Debug */,
-				FDAAC5C80E2D55B5001DB1D8 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDAAC6230E2D5914001DB1D8 /* Build configuration list for PBXNativeTarget "testgles" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDAAC6240E2D5914001DB1D8 /* Debug */,
-				FDAAC6250E2D5914001DB1D8 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDC42FFD0F0D866D009C87E1 /* Build configuration list for PBXNativeTarget "testdraw2" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDC42FFE0F0D866D009C87E1 /* Debug */,
-				FDC42FFF0F0D866D009C87E1 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C1070E2E4F4B00B7A85F /* Build configuration list for PBXNativeTarget "testthread" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C1080E2E4F4B00B7A85F /* Debug */,
-				FDD2C1090E2E4F4B00B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C17E0E2E52C000B7A85F /* Build configuration list for PBXNativeTarget "testiconv" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C17F0E2E52C000B7A85F /* Debug */,
-				FDD2C1800E2E52C000B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C1A20E2E534F00B7A85F /* Build configuration list for PBXNativeTarget "testjoystick" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C1A30E2E534F00B7A85F /* Debug */,
-				FDD2C1A40E2E534F00B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C45B0E2E773800B7A85F /* Build configuration list for PBXNativeTarget "testkeys" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C45C0E2E773800B7A85F /* Debug */,
-				FDD2C45D0E2E773800B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C4790E2E77D700B7A85F /* Build configuration list for PBXNativeTarget "testlock" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C47A0E2E77D700B7A85F /* Debug */,
-				FDD2C47B0E2E77D700B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C5080E2E7F4800B7A85F /* Build configuration list for PBXNativeTarget "testplatform" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C5090E2E7F4800B7A85F /* Debug */,
-				FDD2C50A0E2E7F4800B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C5260E2E807600B7A85F /* Build configuration list for PBXNativeTarget "testsem" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C5270E2E807600B7A85F /* Debug */,
-				FDD2C5280E2E807600B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C54B0E2E80E400B7A85F /* Build configuration list for PBXNativeTarget "testsprite2" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C54C0E2E80E400B7A85F /* Debug */,
-				FDD2C54D0E2E80E400B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C5840E2E8C7400B7A85F /* Build configuration list for PBXNativeTarget "testtimer" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C5850E2E8C7400B7A85F /* Debug */,
-				FDD2C5860E2E8C7400B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C5C20E2E8CFC00B7A85F /* Build configuration list for PBXNativeTarget "testver" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C5C30E2E8CFC00B7A85F /* Debug */,
-				FDD2C5C40E2E8CFC00B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FDD2C6F10E2E959E00B7A85F /* Build configuration list for PBXNativeTarget "torturethread" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FDD2C6F20E2E959E00B7A85F /* Debug */,
-				FDD2C6F30E2E959E00B7A85F /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
diff --git a/deps/SDL2/Xcode/SDL/Info-Framework.plist b/deps/SDL2/Xcode/SDL/Info-Framework.plist
deleted file mode 100644
index 696ef99..0000000
--- a/deps/SDL2/Xcode/SDL/Info-Framework.plist
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>English</string>
-	<key>CFBundleExecutable</key>
-	<string>${EXECUTABLE_NAME}</string>
-	<key>CFBundleGetInfoString</key>
-	<string>http://www.libsdl.org</string>
-	<key>CFBundleIconFile</key>
-	<string></string>
-	<key>CFBundleIdentifier</key>
-	<string>org.libsdl.SDL2</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>Simple DirectMedia Layer</string>
-	<key>CFBundlePackageType</key>
-	<string>FMWK</string>
-	<key>CFBundleShortVersionString</key>
-	<string>2.0.1</string>
-	<key>CFBundleSignature</key>
-	<string>SDLX</string>
-	<key>CFBundleVersion</key>
-	<string>2.0.1</string>
-</dict>
-</plist>
diff --git a/deps/SDL2/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/deps/SDL2/Xcode/SDL/SDL.xcodeproj/project.pbxproj
deleted file mode 100755
index 9002cc6..0000000
--- a/deps/SDL2/Xcode/SDL/SDL.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,2905 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 46;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; };
-		007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; };
-		007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; };
-		007317A50858DECD00B2BC32 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; };
-		007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; };
-		007317A70858DECD00B2BC32 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A00858DECD00B2BC32 /* OpenGL.framework */; };
-		007317A90858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; };
-		007317AA0858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; };
-		007317AB0858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; };
-		007317AC0858DECD00B2BC32 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; };
-		007317AD0858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; };
-		007317AE0858DECD00B2BC32 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A00858DECD00B2BC32 /* OpenGL.framework */; };
-		007317C30858E15000B2BC32 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
-		00CFA89D106B4BA100758660 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; };
-		00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D0D08310675DD9004B05EF /* CoreFoundation.framework */; };
-		00D0D0D810675E46004B05EF /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
-		04043BBB12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */; };
-		04043BBC12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */; };
-		041B2CA512FA0D680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; };
-		041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; };
-		041B2CAB12FA0D680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; };
-		041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; };
-		0435673E1303160F00BA5428 /* SDL_shaders_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */; };
-		0435673F1303160F00BA5428 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; };
-		043567401303160F00BA5428 /* SDL_shaders_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */; };
-		043567411303160F00BA5428 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; };
-		04409B9112FA97ED00FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; };
-		04409B9212FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; };
-		04409B9312FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; };
-		04409B9412FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */; };
-		04409B9512FA97ED00FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; };
-		04409B9612FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; };
-		04409B9712FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; };
-		04409B9812FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */; };
-		0442EC1812FE1BBA004C9285 /* SDL_render_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */; };
-		0442EC1912FE1BBA004C9285 /* SDL_render_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */; };
-		0442EC1C12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */; };
-		0442EC1D12FE1BCB004C9285 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */; };
-		0442EC1E12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */; };
-		0442EC1F12FE1BCB004C9285 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */; };
-		0442EC5A12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */; };
-		0442EC5B12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */; };
-		0442EC5C12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */; };
-		0442EC5D12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */; };
-		0442EC5F12FE1C75004C9285 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5E12FE1C75004C9285 /* SDL_hints.c */; };
-		0442EC6012FE1C75004C9285 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5E12FE1C75004C9285 /* SDL_hints.c */; };
-		04BAC0C81300C2160055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; };
-		04BAC0C91300C2160055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; };
-		04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; };
-		04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; };
-		04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; };
-		04BD001112E6671800899322 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; };
-		04BD001812E6671800899322 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; };
-		04BD001912E6671800899322 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; };
-		04BD002612E6671800899322 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; };
-		04BD002712E6671800899322 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; };
-		04BD002812E6671800899322 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; };
-		04BD002912E6671800899322 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; };
-		04BD002A12E6671800899322 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */; };
-		04BD002B12E6671800899322 /* SDL_audiomem.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB912E6671700899322 /* SDL_audiomem.h */; };
-		04BD002C12E6671800899322 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */; };
-		04BD002D12E6671800899322 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBB12E6671700899322 /* SDL_mixer.c */; };
-		04BD003412E6671800899322 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC212E6671700899322 /* SDL_sysaudio.h */; };
-		04BD003512E6671800899322 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDC312E6671700899322 /* SDL_wave.c */; };
-		04BD003612E6671800899322 /* SDL_wave.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC412E6671700899322 /* SDL_wave.h */; };
-		04BD004112E6671800899322 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDD412E6671700899322 /* SDL_cpuinfo.c */; };
-		04BD004212E6671800899322 /* blank_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD612E6671700899322 /* blank_cursor.h */; };
-		04BD004312E6671800899322 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD712E6671700899322 /* default_cursor.h */; };
-		04BD004412E6671800899322 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD812E6671700899322 /* scancodes_darwin.h */; };
-		04BD004512E6671800899322 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD912E6671700899322 /* scancodes_linux.h */; };
-		04BD004712E6671800899322 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */; };
-		04BD004812E6671800899322 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */; };
-		04BD004912E6671800899322 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */; };
-		04BD004A12E6671800899322 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDE12E6671700899322 /* SDL_events.c */; };
-		04BD004B12E6671800899322 /* SDL_events_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDF12E6671700899322 /* SDL_events_c.h */; };
-		04BD004C12E6671800899322 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE012E6671700899322 /* SDL_gesture.c */; };
-		04BD004D12E6671800899322 /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE112E6671700899322 /* SDL_gesture_c.h */; };
-		04BD004E12E6671800899322 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE212E6671700899322 /* SDL_keyboard.c */; };
-		04BD004F12E6671800899322 /* SDL_keyboard_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE312E6671700899322 /* SDL_keyboard_c.h */; };
-		04BD005012E6671800899322 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE412E6671700899322 /* SDL_mouse.c */; };
-		04BD005112E6671800899322 /* SDL_mouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE512E6671700899322 /* SDL_mouse_c.h */; };
-		04BD005212E6671800899322 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE612E6671700899322 /* SDL_quit.c */; };
-		04BD005312E6671800899322 /* SDL_sysevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE712E6671700899322 /* SDL_sysevents.h */; };
-		04BD005412E6671800899322 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE812E6671700899322 /* SDL_touch.c */; };
-		04BD005512E6671800899322 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE912E6671700899322 /* SDL_touch_c.h */; };
-		04BD005612E6671800899322 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEA12E6671700899322 /* SDL_windowevents.c */; };
-		04BD005712E6671800899322 /* SDL_windowevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */; };
-		04BD005812E6671800899322 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */; };
-		04BD005912E6671800899322 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */; };
-		04BD005A12E6671800899322 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF012E6671700899322 /* SDL_rwops.c */; };
-		04BD005B12E6671800899322 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF312E6671700899322 /* SDL_syshaptic.c */; };
-		04BD005F12E6671800899322 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDFA12E6671700899322 /* SDL_haptic.c */; };
-		04BD006012E6671800899322 /* SDL_haptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFB12E6671700899322 /* SDL_haptic_c.h */; };
-		04BD006112E6671800899322 /* SDL_syshaptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFC12E6671700899322 /* SDL_syshaptic.h */; };
-		04BD006612E6671800899322 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE0712E6671700899322 /* SDL_sysjoystick.c */; };
-		04BD006712E6671800899322 /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */; };
-		04BD007012E6671800899322 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE1612E6671700899322 /* SDL_joystick.c */; };
-		04BD007112E6671800899322 /* SDL_joystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1712E6671700899322 /* SDL_joystick_c.h */; };
-		04BD007212E6671800899322 /* SDL_sysjoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1812E6671700899322 /* SDL_sysjoystick.h */; };
-		04BD008812E6671800899322 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE3312E6671700899322 /* SDL_sysloadso.c */; };
-		04BD009412E6671800899322 /* SDL_syspower.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4B12E6671700899322 /* SDL_syspower.c */; };
-		04BD009612E6671800899322 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4E12E6671700899322 /* SDL_power.c */; };
-		04BD009B12E6671800899322 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5512E6671700899322 /* SDL_assert_c.h */; };
-		04BD009C12E6671800899322 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5612E6671700899322 /* SDL_assert.c */; };
-		04BD009E12E6671800899322 /* SDL_error_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5812E6671700899322 /* SDL_error_c.h */; };
-		04BD009F12E6671800899322 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5912E6671700899322 /* SDL_error.c */; };
-		04BD00A212E6671800899322 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5C12E6671700899322 /* SDL.c */; };
-		04BD00A312E6671800899322 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5E12E6671700899322 /* SDL_getenv.c */; };
-		04BD00A412E6671800899322 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5F12E6671700899322 /* SDL_iconv.c */; };
-		04BD00A512E6671800899322 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6012E6671700899322 /* SDL_malloc.c */; };
-		04BD00A612E6671800899322 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6112E6671700899322 /* SDL_qsort.c */; };
-		04BD00A712E6671800899322 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6212E6671700899322 /* SDL_stdlib.c */; };
-		04BD00A812E6671800899322 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6312E6671700899322 /* SDL_string.c */; };
-		04BD00BD12E6671800899322 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7E12E6671800899322 /* SDL_syscond.c */; };
-		04BD00BE12E6671800899322 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7F12E6671800899322 /* SDL_sysmutex.c */; };
-		04BD00BF12E6671800899322 /* SDL_sysmutex_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */; };
-		04BD00C012E6671800899322 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8112E6671800899322 /* SDL_syssem.c */; };
-		04BD00C112E6671800899322 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8212E6671800899322 /* SDL_systhread.c */; };
-		04BD00C212E6671800899322 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8312E6671800899322 /* SDL_systhread_c.h */; };
-		04BD00C912E6671800899322 /* SDL_systhread.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8B12E6671800899322 /* SDL_systhread.h */; };
-		04BD00CA12E6671800899322 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8C12E6671800899322 /* SDL_thread.c */; };
-		04BD00CB12E6671800899322 /* SDL_thread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8D12E6671800899322 /* SDL_thread_c.h */; };
-		04BD00D712E6671800899322 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE9F12E6671800899322 /* SDL_timer.c */; };
-		04BD00D812E6671800899322 /* SDL_timer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEA012E6671800899322 /* SDL_timer_c.h */; };
-		04BD00D912E6671800899322 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEA212E6671800899322 /* SDL_systimer.c */; };
-		04BD00F312E6671800899322 /* SDL_cocoaclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */; };
-		04BD00F412E6671800899322 /* SDL_cocoaclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */; };
-		04BD00F512E6671800899322 /* SDL_cocoaevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC412E6671800899322 /* SDL_cocoaevents.h */; };
-		04BD00F612E6671800899322 /* SDL_cocoaevents.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC512E6671800899322 /* SDL_cocoaevents.m */; };
-		04BD00F712E6671800899322 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */; };
-		04BD00F812E6671800899322 /* SDL_cocoakeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */; };
-		04BD00F912E6671800899322 /* SDL_cocoamodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC812E6671800899322 /* SDL_cocoamodes.h */; };
-		04BD00FA12E6671800899322 /* SDL_cocoamodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC912E6671800899322 /* SDL_cocoamodes.m */; };
-		04BD00FB12E6671800899322 /* SDL_cocoamouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECA12E6671800899322 /* SDL_cocoamouse.h */; };
-		04BD00FC12E6671800899322 /* SDL_cocoamouse.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECB12E6671800899322 /* SDL_cocoamouse.m */; };
-		04BD00FD12E6671800899322 /* SDL_cocoaopengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */; };
-		04BD00FE12E6671800899322 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */; };
-		04BD00FF12E6671800899322 /* SDL_cocoashape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECE12E6671800899322 /* SDL_cocoashape.h */; };
-		04BD010012E6671800899322 /* SDL_cocoashape.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECF12E6671800899322 /* SDL_cocoashape.m */; };
-		04BD010112E6671800899322 /* SDL_cocoavideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED012E6671800899322 /* SDL_cocoavideo.h */; };
-		04BD010212E6671800899322 /* SDL_cocoavideo.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED112E6671800899322 /* SDL_cocoavideo.m */; };
-		04BD010312E6671800899322 /* SDL_cocoawindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED212E6671800899322 /* SDL_cocoawindow.h */; };
-		04BD010412E6671800899322 /* SDL_cocoawindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED312E6671800899322 /* SDL_cocoawindow.m */; };
-		04BD011712E6671800899322 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEE812E6671800899322 /* SDL_nullevents.c */; };
-		04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; };
-		04BD011B12E6671800899322 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; };
-		04BD011C12E6671800899322 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; };
-		04BD017512E6671800899322 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; };
-		04BD017612E6671800899322 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; };
-		04BD017712E6671800899322 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; };
-		04BD017812E6671800899322 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5112E6671800899322 /* SDL_blit_1.c */; };
-		04BD017912E6671800899322 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5212E6671800899322 /* SDL_blit_A.c */; };
-		04BD017A12E6671800899322 /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5312E6671800899322 /* SDL_blit_auto.c */; };
-		04BD017B12E6671800899322 /* SDL_blit_auto.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5412E6671800899322 /* SDL_blit_auto.h */; };
-		04BD017C12E6671800899322 /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5512E6671800899322 /* SDL_blit_copy.c */; };
-		04BD017D12E6671800899322 /* SDL_blit_copy.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5612E6671800899322 /* SDL_blit_copy.h */; };
-		04BD017E12E6671800899322 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5712E6671800899322 /* SDL_blit_N.c */; };
-		04BD017F12E6671800899322 /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5812E6671800899322 /* SDL_blit_slow.c */; };
-		04BD018012E6671800899322 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; };
-		04BD018112E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; };
-		04BD018212E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; };
-		04BD018712E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; };
-		04BD018C12E6671800899322 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; };
-		04BD018D12E6671800899322 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; };
-		04BD018E12E6671800899322 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; };
-		04BD019612E6671800899322 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */; };
-		04BD019712E6671800899322 /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */; };
-		04BD019812E6671800899322 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7112E6671800899322 /* SDL_shape.c */; };
-		04BD019912E6671800899322 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7212E6671800899322 /* SDL_shape_internals.h */; };
-		04BD019A12E6671800899322 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7312E6671800899322 /* SDL_stretch.c */; };
-		04BD019B12E6671800899322 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7412E6671800899322 /* SDL_surface.c */; };
-		04BD019C12E6671800899322 /* SDL_sysvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7512E6671800899322 /* SDL_sysvideo.h */; };
-		04BD019D12E6671800899322 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7612E6671800899322 /* SDL_video.c */; };
-		04BD01DB12E6671800899322 /* imKStoUCS.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFB812E6671800899322 /* imKStoUCS.c */; };
-		04BD01DC12E6671800899322 /* imKStoUCS.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFB912E6671800899322 /* imKStoUCS.h */; };
-		04BD01DD12E6671800899322 /* SDL_x11clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */; };
-		04BD01DE12E6671800899322 /* SDL_x11clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */; };
-		04BD01DF12E6671800899322 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBC12E6671800899322 /* SDL_x11dyn.c */; };
-		04BD01E012E6671800899322 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */; };
-		04BD01E112E6671800899322 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBE12E6671800899322 /* SDL_x11events.c */; };
-		04BD01E212E6671800899322 /* SDL_x11events.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBF12E6671800899322 /* SDL_x11events.h */; };
-		04BD01E512E6671800899322 /* SDL_x11keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */; };
-		04BD01E612E6671800899322 /* SDL_x11keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */; };
-		04BD01E712E6671800899322 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC412E6671800899322 /* SDL_x11modes.c */; };
-		04BD01E812E6671800899322 /* SDL_x11modes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC512E6671800899322 /* SDL_x11modes.h */; };
-		04BD01E912E6671800899322 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC612E6671800899322 /* SDL_x11mouse.c */; };
-		04BD01EA12E6671800899322 /* SDL_x11mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC712E6671800899322 /* SDL_x11mouse.h */; };
-		04BD01EB12E6671800899322 /* SDL_x11opengl.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC812E6671800899322 /* SDL_x11opengl.c */; };
-		04BD01EC12E6671800899322 /* SDL_x11opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC912E6671800899322 /* SDL_x11opengl.h */; };
-		04BD01ED12E6671800899322 /* SDL_x11opengles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */; };
-		04BD01EE12E6671800899322 /* SDL_x11opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */; };
-		04BD01F112E6671800899322 /* SDL_x11shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCE12E6671800899322 /* SDL_x11shape.c */; };
-		04BD01F212E6671800899322 /* SDL_x11shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCF12E6671800899322 /* SDL_x11shape.h */; };
-		04BD01F312E6671800899322 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD012E6671800899322 /* SDL_x11sym.h */; };
-		04BD01F412E6671800899322 /* SDL_x11touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD112E6671800899322 /* SDL_x11touch.c */; };
-		04BD01F512E6671800899322 /* SDL_x11touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD212E6671800899322 /* SDL_x11touch.h */; };
-		04BD01F612E6671800899322 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD312E6671800899322 /* SDL_x11video.c */; };
-		04BD01F712E6671800899322 /* SDL_x11video.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD412E6671800899322 /* SDL_x11video.h */; };
-		04BD01F812E6671800899322 /* SDL_x11window.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD512E6671800899322 /* SDL_x11window.c */; };
-		04BD01F912E6671800899322 /* SDL_x11window.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD612E6671800899322 /* SDL_x11window.h */; };
-		04BD021712E6671800899322 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7412E6671700899322 /* SDL_atomic.c */; };
-		04BD021812E6671800899322 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7512E6671700899322 /* SDL_spinlock.c */; };
-		04BD022412E6671800899322 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; };
-		04BD022512E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; };
-		04BD022C12E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; };
-		04BD022D12E6671800899322 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; };
-		04BD023412E6671800899322 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; };
-		04BD023512E6671800899322 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; };
-		04BD024212E6671800899322 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; };
-		04BD024312E6671800899322 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; };
-		04BD024412E6671800899322 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; };
-		04BD024512E6671800899322 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; };
-		04BD024612E6671800899322 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */; };
-		04BD024712E6671800899322 /* SDL_audiomem.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB912E6671700899322 /* SDL_audiomem.h */; };
-		04BD024812E6671800899322 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */; };
-		04BD024912E6671800899322 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBB12E6671700899322 /* SDL_mixer.c */; };
-		04BD025012E6671800899322 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC212E6671700899322 /* SDL_sysaudio.h */; };
-		04BD025112E6671800899322 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDC312E6671700899322 /* SDL_wave.c */; };
-		04BD025212E6671800899322 /* SDL_wave.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC412E6671700899322 /* SDL_wave.h */; };
-		04BD025C12E6671800899322 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDD412E6671700899322 /* SDL_cpuinfo.c */; };
-		04BD025D12E6671800899322 /* blank_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD612E6671700899322 /* blank_cursor.h */; };
-		04BD025E12E6671800899322 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD712E6671700899322 /* default_cursor.h */; };
-		04BD025F12E6671800899322 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD812E6671700899322 /* scancodes_darwin.h */; };
-		04BD026012E6671800899322 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD912E6671700899322 /* scancodes_linux.h */; };
-		04BD026212E6671800899322 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */; };
-		04BD026312E6671800899322 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */; };
-		04BD026412E6671800899322 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */; };
-		04BD026512E6671800899322 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDE12E6671700899322 /* SDL_events.c */; };
-		04BD026612E6671800899322 /* SDL_events_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDF12E6671700899322 /* SDL_events_c.h */; };
-		04BD026712E6671800899322 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE012E6671700899322 /* SDL_gesture.c */; };
-		04BD026812E6671800899322 /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE112E6671700899322 /* SDL_gesture_c.h */; };
-		04BD026912E6671800899322 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE212E6671700899322 /* SDL_keyboard.c */; };
-		04BD026A12E6671800899322 /* SDL_keyboard_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE312E6671700899322 /* SDL_keyboard_c.h */; };
-		04BD026B12E6671800899322 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE412E6671700899322 /* SDL_mouse.c */; };
-		04BD026C12E6671800899322 /* SDL_mouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE512E6671700899322 /* SDL_mouse_c.h */; };
-		04BD026D12E6671800899322 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE612E6671700899322 /* SDL_quit.c */; };
-		04BD026E12E6671800899322 /* SDL_sysevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE712E6671700899322 /* SDL_sysevents.h */; };
-		04BD026F12E6671800899322 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE812E6671700899322 /* SDL_touch.c */; };
-		04BD027012E6671800899322 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE912E6671700899322 /* SDL_touch_c.h */; };
-		04BD027112E6671800899322 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEA12E6671700899322 /* SDL_windowevents.c */; };
-		04BD027212E6671800899322 /* SDL_windowevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */; };
-		04BD027312E6671800899322 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */; };
-		04BD027412E6671800899322 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */; };
-		04BD027512E6671800899322 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF012E6671700899322 /* SDL_rwops.c */; };
-		04BD027612E6671800899322 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF312E6671700899322 /* SDL_syshaptic.c */; };
-		04BD027A12E6671800899322 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDFA12E6671700899322 /* SDL_haptic.c */; };
-		04BD027B12E6671800899322 /* SDL_haptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFB12E6671700899322 /* SDL_haptic_c.h */; };
-		04BD027C12E6671800899322 /* SDL_syshaptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFC12E6671700899322 /* SDL_syshaptic.h */; };
-		04BD028112E6671800899322 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE0712E6671700899322 /* SDL_sysjoystick.c */; };
-		04BD028212E6671800899322 /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */; };
-		04BD028B12E6671800899322 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE1612E6671700899322 /* SDL_joystick.c */; };
-		04BD028C12E6671800899322 /* SDL_joystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1712E6671700899322 /* SDL_joystick_c.h */; };
-		04BD028D12E6671800899322 /* SDL_sysjoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1812E6671700899322 /* SDL_sysjoystick.h */; };
-		04BD02A312E6671800899322 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE3312E6671700899322 /* SDL_sysloadso.c */; };
-		04BD02AE12E6671800899322 /* SDL_syspower.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4B12E6671700899322 /* SDL_syspower.c */; };
-		04BD02B012E6671800899322 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4E12E6671700899322 /* SDL_power.c */; };
-		04BD02B512E6671800899322 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5512E6671700899322 /* SDL_assert_c.h */; };
-		04BD02B612E6671800899322 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5612E6671700899322 /* SDL_assert.c */; };
-		04BD02B812E6671800899322 /* SDL_error_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5812E6671700899322 /* SDL_error_c.h */; };
-		04BD02B912E6671800899322 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5912E6671700899322 /* SDL_error.c */; };
-		04BD02BC12E6671800899322 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5C12E6671700899322 /* SDL.c */; };
-		04BD02BD12E6671800899322 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5E12E6671700899322 /* SDL_getenv.c */; };
-		04BD02BE12E6671800899322 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5F12E6671700899322 /* SDL_iconv.c */; };
-		04BD02BF12E6671800899322 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6012E6671700899322 /* SDL_malloc.c */; };
-		04BD02C012E6671800899322 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6112E6671700899322 /* SDL_qsort.c */; };
-		04BD02C112E6671800899322 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6212E6671700899322 /* SDL_stdlib.c */; };
-		04BD02C212E6671800899322 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6312E6671700899322 /* SDL_string.c */; };
-		04BD02D712E6671800899322 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7E12E6671800899322 /* SDL_syscond.c */; };
-		04BD02D812E6671800899322 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7F12E6671800899322 /* SDL_sysmutex.c */; };
-		04BD02D912E6671800899322 /* SDL_sysmutex_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */; };
-		04BD02DA12E6671800899322 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8112E6671800899322 /* SDL_syssem.c */; };
-		04BD02DB12E6671800899322 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8212E6671800899322 /* SDL_systhread.c */; };
-		04BD02DC12E6671800899322 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8312E6671800899322 /* SDL_systhread_c.h */; };
-		04BD02E312E6671800899322 /* SDL_systhread.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8B12E6671800899322 /* SDL_systhread.h */; };
-		04BD02E412E6671800899322 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8C12E6671800899322 /* SDL_thread.c */; };
-		04BD02E512E6671800899322 /* SDL_thread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8D12E6671800899322 /* SDL_thread_c.h */; };
-		04BD02F112E6671800899322 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE9F12E6671800899322 /* SDL_timer.c */; };
-		04BD02F212E6671800899322 /* SDL_timer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEA012E6671800899322 /* SDL_timer_c.h */; };
-		04BD02F312E6671800899322 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEA212E6671800899322 /* SDL_systimer.c */; };
-		04BD030D12E6671800899322 /* SDL_cocoaclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */; };
-		04BD030E12E6671800899322 /* SDL_cocoaclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */; };
-		04BD030F12E6671800899322 /* SDL_cocoaevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC412E6671800899322 /* SDL_cocoaevents.h */; };
-		04BD031012E6671800899322 /* SDL_cocoaevents.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC512E6671800899322 /* SDL_cocoaevents.m */; };
-		04BD031112E6671800899322 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */; };
-		04BD031212E6671800899322 /* SDL_cocoakeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */; };
-		04BD031312E6671800899322 /* SDL_cocoamodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC812E6671800899322 /* SDL_cocoamodes.h */; };
-		04BD031412E6671800899322 /* SDL_cocoamodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC912E6671800899322 /* SDL_cocoamodes.m */; };
-		04BD031512E6671800899322 /* SDL_cocoamouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECA12E6671800899322 /* SDL_cocoamouse.h */; };
-		04BD031612E6671800899322 /* SDL_cocoamouse.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECB12E6671800899322 /* SDL_cocoamouse.m */; };
-		04BD031712E6671800899322 /* SDL_cocoaopengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */; };
-		04BD031812E6671800899322 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */; };
-		04BD031912E6671800899322 /* SDL_cocoashape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECE12E6671800899322 /* SDL_cocoashape.h */; };
-		04BD031A12E6671800899322 /* SDL_cocoashape.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECF12E6671800899322 /* SDL_cocoashape.m */; };
-		04BD031B12E6671800899322 /* SDL_cocoavideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED012E6671800899322 /* SDL_cocoavideo.h */; };
-		04BD031C12E6671800899322 /* SDL_cocoavideo.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED112E6671800899322 /* SDL_cocoavideo.m */; };
-		04BD031D12E6671800899322 /* SDL_cocoawindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED212E6671800899322 /* SDL_cocoawindow.h */; };
-		04BD031E12E6671800899322 /* SDL_cocoawindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED312E6671800899322 /* SDL_cocoawindow.m */; };
-		04BD033112E6671800899322 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEE812E6671800899322 /* SDL_nullevents.c */; };
-		04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; };
-		04BD033512E6671800899322 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; };
-		04BD033612E6671800899322 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; };
-		04BD038F12E6671800899322 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; };
-		04BD039012E6671800899322 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; };
-		04BD039112E6671800899322 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; };
-		04BD039212E6671800899322 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5112E6671800899322 /* SDL_blit_1.c */; };
-		04BD039312E6671800899322 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5212E6671800899322 /* SDL_blit_A.c */; };
-		04BD039412E6671800899322 /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5312E6671800899322 /* SDL_blit_auto.c */; };
-		04BD039512E6671800899322 /* SDL_blit_auto.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5412E6671800899322 /* SDL_blit_auto.h */; };
-		04BD039612E6671800899322 /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5512E6671800899322 /* SDL_blit_copy.c */; };
-		04BD039712E6671800899322 /* SDL_blit_copy.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5612E6671800899322 /* SDL_blit_copy.h */; };
-		04BD039812E6671800899322 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5712E6671800899322 /* SDL_blit_N.c */; };
-		04BD039912E6671800899322 /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5812E6671800899322 /* SDL_blit_slow.c */; };
-		04BD039A12E6671800899322 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; };
-		04BD039B12E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; };
-		04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; };
-		04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; };
-		04BD03A612E6671800899322 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; };
-		04BD03A712E6671800899322 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; };
-		04BD03A812E6671800899322 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; };
-		04BD03B012E6671800899322 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */; };
-		04BD03B112E6671800899322 /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */; };
-		04BD03B212E6671800899322 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7112E6671800899322 /* SDL_shape.c */; };
-		04BD03B312E6671800899322 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7212E6671800899322 /* SDL_shape_internals.h */; };
-		04BD03B412E6671800899322 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7312E6671800899322 /* SDL_stretch.c */; };
-		04BD03B512E6671800899322 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7412E6671800899322 /* SDL_surface.c */; };
-		04BD03B612E6671800899322 /* SDL_sysvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7512E6671800899322 /* SDL_sysvideo.h */; };
-		04BD03B712E6671800899322 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7612E6671800899322 /* SDL_video.c */; };
-		04BD03F312E6671800899322 /* imKStoUCS.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFB812E6671800899322 /* imKStoUCS.c */; };
-		04BD03F412E6671800899322 /* imKStoUCS.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFB912E6671800899322 /* imKStoUCS.h */; };
-		04BD03F512E6671800899322 /* SDL_x11clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */; };
-		04BD03F612E6671800899322 /* SDL_x11clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */; };
-		04BD03F712E6671800899322 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBC12E6671800899322 /* SDL_x11dyn.c */; };
-		04BD03F812E6671800899322 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */; };
-		04BD03F912E6671800899322 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBE12E6671800899322 /* SDL_x11events.c */; };
-		04BD03FA12E6671800899322 /* SDL_x11events.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBF12E6671800899322 /* SDL_x11events.h */; };
-		04BD03FD12E6671800899322 /* SDL_x11keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */; };
-		04BD03FE12E6671800899322 /* SDL_x11keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */; };
-		04BD03FF12E6671800899322 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC412E6671800899322 /* SDL_x11modes.c */; };
-		04BD040012E6671800899322 /* SDL_x11modes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC512E6671800899322 /* SDL_x11modes.h */; };
-		04BD040112E6671800899322 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC612E6671800899322 /* SDL_x11mouse.c */; };
-		04BD040212E6671800899322 /* SDL_x11mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC712E6671800899322 /* SDL_x11mouse.h */; };
-		04BD040312E6671800899322 /* SDL_x11opengl.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC812E6671800899322 /* SDL_x11opengl.c */; };
-		04BD040412E6671800899322 /* SDL_x11opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC912E6671800899322 /* SDL_x11opengl.h */; };
-		04BD040512E6671800899322 /* SDL_x11opengles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */; };
-		04BD040612E6671800899322 /* SDL_x11opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */; };
-		04BD040912E6671800899322 /* SDL_x11shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCE12E6671800899322 /* SDL_x11shape.c */; };
-		04BD040A12E6671800899322 /* SDL_x11shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCF12E6671800899322 /* SDL_x11shape.h */; };
-		04BD040B12E6671800899322 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD012E6671800899322 /* SDL_x11sym.h */; };
-		04BD040C12E6671800899322 /* SDL_x11touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD112E6671800899322 /* SDL_x11touch.c */; };
-		04BD040D12E6671800899322 /* SDL_x11touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD212E6671800899322 /* SDL_x11touch.h */; };
-		04BD040E12E6671800899322 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD312E6671800899322 /* SDL_x11video.c */; };
-		04BD040F12E6671800899322 /* SDL_x11video.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD412E6671800899322 /* SDL_x11video.h */; };
-		04BD041012E6671800899322 /* SDL_x11window.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD512E6671800899322 /* SDL_x11window.c */; };
-		04BD041112E6671800899322 /* SDL_x11window.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD612E6671800899322 /* SDL_x11window.h */; };
-		04BDFFFB12E6671800899322 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7412E6671700899322 /* SDL_atomic.c */; };
-		04BDFFFC12E6671800899322 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7512E6671700899322 /* SDL_spinlock.c */; };
-		04F7803912FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; };
-		04F7803A12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; };
-		04F7803B12FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; };
-		04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; };
-		04F7804912FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; };
-		04F7804A12FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; };
-		04F7804B12FB74A200FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; };
-		04F7804C12FB74A200FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; };
-		04F7804D12FB74A200FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; };
-		04F7804E12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; };
-		04F7804F12FB74A200FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; };
-		04F7805012FB74A200FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; };
-		04F7805112FB74A200FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; };
-		04F7805212FB74A200FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; };
-		04F7805312FB74A200FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; };
-		04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; };
-		04F7805612FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; };
-		04F7805712FB74A200FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; };
-		04F7805812FB74A200FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; };
-		04F7805912FB74A200FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; };
-		04F7805A12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; };
-		04F7805B12FB74A200FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; };
-		04F7805C12FB74A200FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; };
-		04F7805D12FB74A200FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; };
-		04F7805E12FB74A200FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; };
-		04F7805F12FB74A200FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; };
-		566CDE8F148F0AC200C5A9BB /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 566CDE8D148F0AC200C5A9BB /* SDL_dropevents_c.h */; };
-		566CDE90148F0AC200C5A9BB /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */; };
-		567E2F1C17C44BB2005F1892 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 567E2F1B17C44BB2005F1892 /* SDL_sysfilesystem.m */; };
-		567E2F2117C44C35005F1892 /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 567E2F2017C44C35005F1892 /* SDL_filesystem.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		A77E6EB4167AB0A90010E40B /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		A77E6EB5167AB0A90010E40B /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA0AD09D16648D1700CE5896 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */; };
-		AA0F8491178D5ECC00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8490178D5ECC00823F9D /* SDL_systls.c */; };
-		AA0F8492178D5ECC00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8490178D5ECC00823F9D /* SDL_systls.c */; };
-		AA0F8493178D5ECC00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8490178D5ECC00823F9D /* SDL_systls.c */; };
-		AA41F88014B8F1F500993C4F /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */; };
-		AA628ACA159367B7005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AC8159367B7005138DD /* SDL_rotate.c */; };
-		AA628ACB159367B7005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AC8159367B7005138DD /* SDL_rotate.c */; };
-		AA628ACC159367B7005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AC9159367B7005138DD /* SDL_rotate.h */; };
-		AA628ACD159367B7005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AC9159367B7005138DD /* SDL_rotate.h */; };
-		AA628AD1159367F2005138DD /* SDL_x11xinput2.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628ACF159367F2005138DD /* SDL_x11xinput2.c */; };
-		AA628AD2159367F2005138DD /* SDL_x11xinput2.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628ACF159367F2005138DD /* SDL_x11xinput2.c */; };
-		AA628AD3159367F2005138DD /* SDL_x11xinput2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AD0159367F2005138DD /* SDL_x11xinput2.h */; };
-		AA628AD4159367F2005138DD /* SDL_x11xinput2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AD0159367F2005138DD /* SDL_x11xinput2.h */; };
-		AA7557FA1595D4D800BBD41B /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C71595D4D800BBD41B /* begin_code.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7557FB1595D4D800BBD41B /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C71595D4D800BBD41B /* begin_code.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7557FC1595D4D800BBD41B /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C81595D4D800BBD41B /* close_code.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7557FD1595D4D800BBD41B /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C81595D4D800BBD41B /* close_code.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7557FE1595D4D800BBD41B /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C91595D4D800BBD41B /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7557FF1595D4D800BBD41B /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C91595D4D800BBD41B /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558001595D4D800BBD41B /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CA1595D4D800BBD41B /* SDL_atomic.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558011595D4D800BBD41B /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CA1595D4D800BBD41B /* SDL_atomic.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558021595D4D800BBD41B /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CB1595D4D800BBD41B /* SDL_audio.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558031595D4D800BBD41B /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CB1595D4D800BBD41B /* SDL_audio.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558041595D4D800BBD41B /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558051595D4D800BBD41B /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558061595D4D800BBD41B /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558071595D4D800BBD41B /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558081595D4D800BBD41B /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558091595D4D800BBD41B /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75580A1595D4D800BBD41B /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CF1595D4D800BBD41B /* SDL_config.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75580B1595D4D800BBD41B /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CF1595D4D800BBD41B /* SDL_config.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75580C1595D4D800BBD41B /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D01595D4D800BBD41B /* SDL_copying.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75580D1595D4D800BBD41B /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D01595D4D800BBD41B /* SDL_copying.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75580E1595D4D800BBD41B /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75580F1595D4D800BBD41B /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558101595D4D800BBD41B /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D21595D4D800BBD41B /* SDL_endian.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558111595D4D800BBD41B /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D21595D4D800BBD41B /* SDL_endian.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558121595D4D800BBD41B /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D31595D4D800BBD41B /* SDL_error.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558131595D4D800BBD41B /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D31595D4D800BBD41B /* SDL_error.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558141595D4D800BBD41B /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D41595D4D800BBD41B /* SDL_events.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558151595D4D800BBD41B /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D41595D4D800BBD41B /* SDL_events.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558161595D4D800BBD41B /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D51595D4D800BBD41B /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558171595D4D800BBD41B /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D51595D4D800BBD41B /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558181595D4D800BBD41B /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D61595D4D800BBD41B /* SDL_haptic.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558191595D4D800BBD41B /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D61595D4D800BBD41B /* SDL_haptic.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75581A1595D4D800BBD41B /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D71595D4D800BBD41B /* SDL_hints.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75581B1595D4D800BBD41B /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D71595D4D800BBD41B /* SDL_hints.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75581E1595D4D800BBD41B /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D91595D4D800BBD41B /* SDL_joystick.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75581F1595D4D800BBD41B /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D91595D4D800BBD41B /* SDL_joystick.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558201595D4D800BBD41B /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558211595D4D800BBD41B /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558221595D4D800BBD41B /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558231595D4D800BBD41B /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558241595D4D800BBD41B /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558251595D4D800BBD41B /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558261595D4D800BBD41B /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DD1595D4D800BBD41B /* SDL_log.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558271595D4D800BBD41B /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DD1595D4D800BBD41B /* SDL_log.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558281595D4D800BBD41B /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DE1595D4D800BBD41B /* SDL_main.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558291595D4D800BBD41B /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DE1595D4D800BBD41B /* SDL_main.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75582A1595D4D800BBD41B /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DF1595D4D800BBD41B /* SDL_mouse.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75582B1595D4D800BBD41B /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DF1595D4D800BBD41B /* SDL_mouse.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75582C1595D4D800BBD41B /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E01595D4D800BBD41B /* SDL_mutex.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75582D1595D4D800BBD41B /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E01595D4D800BBD41B /* SDL_mutex.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75582E1595D4D800BBD41B /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E11595D4D800BBD41B /* SDL_name.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75582F1595D4D800BBD41B /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E11595D4D800BBD41B /* SDL_name.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558301595D4D800BBD41B /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E21595D4D800BBD41B /* SDL_opengl.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558311595D4D800BBD41B /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E21595D4D800BBD41B /* SDL_opengl.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558321595D4D800BBD41B /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E31595D4D800BBD41B /* SDL_opengles.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558331595D4D800BBD41B /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E31595D4D800BBD41B /* SDL_opengles.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558341595D4D800BBD41B /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E41595D4D800BBD41B /* SDL_opengles2.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558351595D4D800BBD41B /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E41595D4D800BBD41B /* SDL_opengles2.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558361595D4D800BBD41B /* SDL_pixels.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E51595D4D800BBD41B /* SDL_pixels.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558371595D4D800BBD41B /* SDL_pixels.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E51595D4D800BBD41B /* SDL_pixels.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558381595D4D800BBD41B /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E61595D4D800BBD41B /* SDL_platform.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558391595D4D800BBD41B /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E61595D4D800BBD41B /* SDL_platform.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75583A1595D4D800BBD41B /* SDL_power.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E71595D4D800BBD41B /* SDL_power.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75583B1595D4D800BBD41B /* SDL_power.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E71595D4D800BBD41B /* SDL_power.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75583C1595D4D800BBD41B /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75583D1595D4D800BBD41B /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75583E1595D4D800BBD41B /* SDL_rect.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E91595D4D800BBD41B /* SDL_rect.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75583F1595D4D800BBD41B /* SDL_rect.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E91595D4D800BBD41B /* SDL_rect.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558401595D4D800BBD41B /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EA1595D4D800BBD41B /* SDL_render.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558411595D4D800BBD41B /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EA1595D4D800BBD41B /* SDL_render.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558421595D4D800BBD41B /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EB1595D4D800BBD41B /* SDL_revision.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558431595D4D800BBD41B /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EB1595D4D800BBD41B /* SDL_revision.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558441595D4D800BBD41B /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EC1595D4D800BBD41B /* SDL_rwops.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558451595D4D800BBD41B /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EC1595D4D800BBD41B /* SDL_rwops.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558461595D4D800BBD41B /* SDL_scancode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557ED1595D4D800BBD41B /* SDL_scancode.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558471595D4D800BBD41B /* SDL_scancode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557ED1595D4D800BBD41B /* SDL_scancode.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558481595D4D800BBD41B /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EE1595D4D800BBD41B /* SDL_shape.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558491595D4D800BBD41B /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EE1595D4D800BBD41B /* SDL_shape.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75584A1595D4D800BBD41B /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75584B1595D4D800BBD41B /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75584C1595D4D800BBD41B /* SDL_surface.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F01595D4D800BBD41B /* SDL_surface.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75584D1595D4D800BBD41B /* SDL_surface.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F01595D4D800BBD41B /* SDL_surface.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75584E1595D4D800BBD41B /* SDL_system.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F11595D4D800BBD41B /* SDL_system.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75584F1595D4D800BBD41B /* SDL_system.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F11595D4D800BBD41B /* SDL_system.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558501595D4D800BBD41B /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F21595D4D800BBD41B /* SDL_syswm.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558511595D4D800BBD41B /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F21595D4D800BBD41B /* SDL_syswm.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558521595D4D800BBD41B /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F31595D4D800BBD41B /* SDL_thread.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558531595D4D800BBD41B /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F31595D4D800BBD41B /* SDL_thread.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558541595D4D800BBD41B /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F41595D4D800BBD41B /* SDL_timer.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558551595D4D800BBD41B /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F41595D4D800BBD41B /* SDL_timer.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558561595D4D800BBD41B /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F51595D4D800BBD41B /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558571595D4D800BBD41B /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F51595D4D800BBD41B /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558581595D4D800BBD41B /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F61595D4D800BBD41B /* SDL_types.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA7558591595D4D800BBD41B /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F61595D4D800BBD41B /* SDL_types.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75585A1595D4D800BBD41B /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F71595D4D800BBD41B /* SDL_version.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75585B1595D4D800BBD41B /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F71595D4D800BBD41B /* SDL_version.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75585C1595D4D800BBD41B /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F81595D4D800BBD41B /* SDL_video.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75585D1595D4D800BBD41B /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F81595D4D800BBD41B /* SDL_video.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75585E1595D4D800BBD41B /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F91595D4D800BBD41B /* SDL.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA75585F1595D4D800BBD41B /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F91595D4D800BBD41B /* SDL.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AA9E4093163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */; };
-		AA9E4094163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */; };
-		AA9FF95A1637CBF9000DF050 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AABCC38D164063D200AB8930 /* SDL_cocoamessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */; };
-		AABCC38E164063D200AB8930 /* SDL_cocoamessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */; };
-		AABCC38F164063D200AB8930 /* SDL_cocoamessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */; };
-		AABCC390164063D200AB8930 /* SDL_cocoamessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */; };
-		AADA5B8716CCAB3000107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		AADA5B8816CCAB3000107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		BBFC088D164C6647003E6A99 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */; };
-		D55A1B81179F262300625D7C /* SDL_cocoamousetap.h in Headers */ = {isa = PBXBuildFile; fileRef = D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */; };
-		D55A1B82179F262300625D7C /* SDL_cocoamousetap.m in Sources */ = {isa = PBXBuildFile; fileRef = D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */; };
-		D55A1B83179F263500625D7C /* SDL_cocoamousetap.m in Sources */ = {isa = PBXBuildFile; fileRef = D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */; };
-		D55A1B84179F263600625D7C /* SDL_cocoamousetap.m in Sources */ = {isa = PBXBuildFile; fileRef = D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */; };
-		D55A1B85179F278E00625D7C /* SDL_cocoamousetap.h in Headers */ = {isa = PBXBuildFile; fileRef = D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */; };
-		D55A1B86179F278F00625D7C /* SDL_cocoamousetap.h in Headers */ = {isa = PBXBuildFile; fileRef = D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */; };
-		DB0F489317C400E6008798C5 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB0F489417C400ED008798C5 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB0F490817CA5292008798C5 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 567E2F1B17C44BB2005F1892 /* SDL_sysfilesystem.m */; };
-		DB0F490A17CA5293008798C5 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 567E2F1B17C44BB2005F1892 /* SDL_sysfilesystem.m */; };
-		DB0F490B17CA57ED008798C5 /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 567E2F2017C44C35005F1892 /* SDL_filesystem.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB0F490C17CA57ED008798C5 /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 567E2F2017C44C35005F1892 /* SDL_filesystem.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313F7417554B71006C0E22 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; };
-		DB313F7517554B71006C0E22 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; };
-		DB313F7617554B71006C0E22 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; };
-		DB313F7717554B71006C0E22 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; };
-		DB313F7817554B71006C0E22 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */; };
-		DB313F7917554B71006C0E22 /* SDL_audiomem.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB912E6671700899322 /* SDL_audiomem.h */; };
-		DB313F7A17554B71006C0E22 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC212E6671700899322 /* SDL_sysaudio.h */; };
-		DB313F7B17554B71006C0E22 /* SDL_wave.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC412E6671700899322 /* SDL_wave.h */; };
-		DB313F7C17554B71006C0E22 /* blank_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD612E6671700899322 /* blank_cursor.h */; };
-		DB313F7D17554B71006C0E22 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD712E6671700899322 /* default_cursor.h */; };
-		DB313F7E17554B71006C0E22 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD812E6671700899322 /* scancodes_darwin.h */; };
-		DB313F7F17554B71006C0E22 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD912E6671700899322 /* scancodes_linux.h */; };
-		DB313F8017554B71006C0E22 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */; };
-		DB313F8117554B71006C0E22 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */; };
-		DB313F8217554B71006C0E22 /* SDL_events_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDF12E6671700899322 /* SDL_events_c.h */; };
-		DB313F8317554B71006C0E22 /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE112E6671700899322 /* SDL_gesture_c.h */; };
-		DB313F8417554B71006C0E22 /* SDL_keyboard_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE312E6671700899322 /* SDL_keyboard_c.h */; };
-		DB313F8517554B71006C0E22 /* SDL_mouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE512E6671700899322 /* SDL_mouse_c.h */; };
-		DB313F8617554B71006C0E22 /* SDL_sysevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE712E6671700899322 /* SDL_sysevents.h */; };
-		DB313F8717554B71006C0E22 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE912E6671700899322 /* SDL_touch_c.h */; };
-		DB313F8817554B71006C0E22 /* SDL_windowevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */; };
-		DB313F8917554B71006C0E22 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */; };
-		DB313F8A17554B71006C0E22 /* SDL_haptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFB12E6671700899322 /* SDL_haptic_c.h */; };
-		DB313F8B17554B71006C0E22 /* SDL_syshaptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFC12E6671700899322 /* SDL_syshaptic.h */; };
-		DB313F8C17554B71006C0E22 /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */; };
-		DB313F8D17554B71006C0E22 /* SDL_joystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1712E6671700899322 /* SDL_joystick_c.h */; };
-		DB313F8E17554B71006C0E22 /* SDL_sysjoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1812E6671700899322 /* SDL_sysjoystick.h */; };
-		DB313F8F17554B71006C0E22 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5512E6671700899322 /* SDL_assert_c.h */; };
-		DB313F9017554B71006C0E22 /* SDL_error_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5812E6671700899322 /* SDL_error_c.h */; };
-		DB313F9217554B71006C0E22 /* SDL_sysmutex_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */; };
-		DB313F9317554B71006C0E22 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8312E6671800899322 /* SDL_systhread_c.h */; };
-		DB313F9417554B71006C0E22 /* SDL_systhread.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8B12E6671800899322 /* SDL_systhread.h */; };
-		DB313F9517554B71006C0E22 /* SDL_thread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8D12E6671800899322 /* SDL_thread_c.h */; };
-		DB313F9617554B71006C0E22 /* SDL_timer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEA012E6671800899322 /* SDL_timer_c.h */; };
-		DB313F9717554B71006C0E22 /* SDL_cocoaclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */; };
-		DB313F9817554B71006C0E22 /* SDL_cocoaevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC412E6671800899322 /* SDL_cocoaevents.h */; };
-		DB313F9917554B71006C0E22 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */; };
-		DB313F9A17554B71006C0E22 /* SDL_cocoamodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC812E6671800899322 /* SDL_cocoamodes.h */; };
-		DB313F9B17554B71006C0E22 /* SDL_cocoamouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECA12E6671800899322 /* SDL_cocoamouse.h */; };
-		DB313F9C17554B71006C0E22 /* SDL_cocoaopengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */; };
-		DB313F9D17554B71006C0E22 /* SDL_cocoashape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECE12E6671800899322 /* SDL_cocoashape.h */; };
-		DB313F9E17554B71006C0E22 /* SDL_cocoavideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED012E6671800899322 /* SDL_cocoavideo.h */; };
-		DB313F9F17554B71006C0E22 /* SDL_cocoawindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED212E6671800899322 /* SDL_cocoawindow.h */; };
-		DB313FA017554B71006C0E22 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; };
-		DB313FA117554B71006C0E22 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; };
-		DB313FA217554B71006C0E22 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; };
-		DB313FA317554B71006C0E22 /* SDL_blit_auto.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5412E6671800899322 /* SDL_blit_auto.h */; };
-		DB313FA417554B71006C0E22 /* SDL_blit_copy.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5612E6671800899322 /* SDL_blit_copy.h */; };
-		DB313FA517554B71006C0E22 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; };
-		DB313FA617554B71006C0E22 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; };
-		DB313FA717554B71006C0E22 /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */; };
-		DB313FA817554B71006C0E22 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7212E6671800899322 /* SDL_shape_internals.h */; };
-		DB313FA917554B71006C0E22 /* SDL_sysvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7512E6671800899322 /* SDL_sysvideo.h */; };
-		DB313FAA17554B71006C0E22 /* imKStoUCS.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFB912E6671800899322 /* imKStoUCS.h */; };
-		DB313FAB17554B71006C0E22 /* SDL_x11clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */; };
-		DB313FAC17554B71006C0E22 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */; };
-		DB313FAD17554B71006C0E22 /* SDL_x11events.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBF12E6671800899322 /* SDL_x11events.h */; };
-		DB313FAE17554B71006C0E22 /* SDL_x11keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */; };
-		DB313FAF17554B71006C0E22 /* SDL_x11modes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC512E6671800899322 /* SDL_x11modes.h */; };
-		DB313FB017554B71006C0E22 /* SDL_x11mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC712E6671800899322 /* SDL_x11mouse.h */; };
-		DB313FB117554B71006C0E22 /* SDL_x11opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC912E6671800899322 /* SDL_x11opengl.h */; };
-		DB313FB217554B71006C0E22 /* SDL_x11opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */; };
-		DB313FB317554B71006C0E22 /* SDL_x11shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCF12E6671800899322 /* SDL_x11shape.h */; };
-		DB313FB417554B71006C0E22 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD012E6671800899322 /* SDL_x11sym.h */; };
-		DB313FB517554B71006C0E22 /* SDL_x11touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD212E6671800899322 /* SDL_x11touch.h */; };
-		DB313FB617554B71006C0E22 /* SDL_x11video.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD412E6671800899322 /* SDL_x11video.h */; };
-		DB313FB717554B71006C0E22 /* SDL_x11window.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD612E6671800899322 /* SDL_x11window.h */; };
-		DB313FB817554B71006C0E22 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; };
-		DB313FB917554B71006C0E22 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; };
-		DB313FBA17554B71006C0E22 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; };
-		DB313FBB17554B71006C0E22 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; };
-		DB313FBC17554B71006C0E22 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; };
-		DB313FBD17554B71006C0E22 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; };
-		DB313FBE17554B71006C0E22 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; };
-		DB313FBF17554B71006C0E22 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; };
-		DB313FC017554B71006C0E22 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; };
-		DB313FC117554B71006C0E22 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; };
-		DB313FC217554B71006C0E22 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */; };
-		DB313FC317554B71006C0E22 /* SDL_x11framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */; };
-		DB313FC417554B71006C0E22 /* SDL_glfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */; };
-		DB313FC517554B71006C0E22 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; };
-		DB313FC617554B71006C0E22 /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AC9159367B7005138DD /* SDL_rotate.h */; };
-		DB313FC717554B71006C0E22 /* SDL_x11xinput2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AD0159367F2005138DD /* SDL_x11xinput2.h */; };
-		DB313FC817554B71006C0E22 /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C71595D4D800BBD41B /* begin_code.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FC917554B71006C0E22 /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C81595D4D800BBD41B /* close_code.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FCA17554B71006C0E22 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C91595D4D800BBD41B /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FCB17554B71006C0E22 /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CA1595D4D800BBD41B /* SDL_atomic.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FCC17554B71006C0E22 /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CB1595D4D800BBD41B /* SDL_audio.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FCD17554B71006C0E22 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FCE17554B71006C0E22 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FCF17554B71006C0E22 /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD017554B71006C0E22 /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CF1595D4D800BBD41B /* SDL_config.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD117554B71006C0E22 /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D01595D4D800BBD41B /* SDL_copying.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD217554B71006C0E22 /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD317554B71006C0E22 /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D21595D4D800BBD41B /* SDL_endian.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD417554B71006C0E22 /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D31595D4D800BBD41B /* SDL_error.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD517554B71006C0E22 /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D41595D4D800BBD41B /* SDL_events.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD617554B71006C0E22 /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D51595D4D800BBD41B /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD717554B71006C0E22 /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D61595D4D800BBD41B /* SDL_haptic.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD817554B71006C0E22 /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D71595D4D800BBD41B /* SDL_hints.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FD917554B71006C0E22 /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D91595D4D800BBD41B /* SDL_joystick.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FDA17554B71006C0E22 /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FDB17554B71006C0E22 /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FDC17554B71006C0E22 /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FDD17554B71006C0E22 /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DD1595D4D800BBD41B /* SDL_log.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FDE17554B71006C0E22 /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DE1595D4D800BBD41B /* SDL_main.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FDF17554B71006C0E22 /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DF1595D4D800BBD41B /* SDL_mouse.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE017554B71006C0E22 /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E01595D4D800BBD41B /* SDL_mutex.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE117554B71006C0E22 /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E11595D4D800BBD41B /* SDL_name.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE217554B71006C0E22 /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E21595D4D800BBD41B /* SDL_opengl.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE317554B71006C0E22 /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E31595D4D800BBD41B /* SDL_opengles.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE417554B71006C0E22 /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E41595D4D800BBD41B /* SDL_opengles2.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE517554B71006C0E22 /* SDL_pixels.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E51595D4D800BBD41B /* SDL_pixels.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE617554B71006C0E22 /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E61595D4D800BBD41B /* SDL_platform.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE717554B71006C0E22 /* SDL_power.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E71595D4D800BBD41B /* SDL_power.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE817554B71006C0E22 /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FE917554B71006C0E22 /* SDL_rect.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E91595D4D800BBD41B /* SDL_rect.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FEA17554B71006C0E22 /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EA1595D4D800BBD41B /* SDL_render.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FEB17554B71006C0E22 /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EB1595D4D800BBD41B /* SDL_revision.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FEC17554B71006C0E22 /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EC1595D4D800BBD41B /* SDL_rwops.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FED17554B71006C0E22 /* SDL_scancode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557ED1595D4D800BBD41B /* SDL_scancode.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FEE17554B71006C0E22 /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EE1595D4D800BBD41B /* SDL_shape.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FEF17554B71006C0E22 /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF017554B71006C0E22 /* SDL_surface.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F01595D4D800BBD41B /* SDL_surface.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF117554B71006C0E22 /* SDL_system.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F11595D4D800BBD41B /* SDL_system.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF217554B71006C0E22 /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F21595D4D800BBD41B /* SDL_syswm.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF317554B71006C0E22 /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F31595D4D800BBD41B /* SDL_thread.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF417554B71006C0E22 /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F41595D4D800BBD41B /* SDL_timer.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF517554B71006C0E22 /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F51595D4D800BBD41B /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF617554B71006C0E22 /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F61595D4D800BBD41B /* SDL_types.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF717554B71006C0E22 /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F71595D4D800BBD41B /* SDL_version.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF817554B71006C0E22 /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F81595D4D800BBD41B /* SDL_video.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FF917554B71006C0E22 /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F91595D4D800BBD41B /* SDL.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FFA17554B71006C0E22 /* SDL_cocoamessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */; };
-		DB313FFB17554B71006C0E22 /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FFC17554B71006C0E22 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		DB313FFE17554B71006C0E22 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7412E6671700899322 /* SDL_atomic.c */; };
-		DB313FFF17554B71006C0E22 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7512E6671700899322 /* SDL_spinlock.c */; };
-		DB31400017554B71006C0E22 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; };
-		DB31400117554B71006C0E22 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; };
-		DB31400217554B71006C0E22 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; };
-		DB31400317554B71006C0E22 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; };
-		DB31400417554B71006C0E22 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; };
-		DB31400517554B71006C0E22 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; };
-		DB31400617554B71006C0E22 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */; };
-		DB31400717554B71006C0E22 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBB12E6671700899322 /* SDL_mixer.c */; };
-		DB31400817554B71006C0E22 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDC312E6671700899322 /* SDL_wave.c */; };
-		DB31400917554B71006C0E22 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDD412E6671700899322 /* SDL_cpuinfo.c */; };
-		DB31400A17554B71006C0E22 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */; };
-		DB31400B17554B71006C0E22 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDE12E6671700899322 /* SDL_events.c */; };
-		DB31400C17554B71006C0E22 /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */; };
-		DB31400D17554B71006C0E22 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE012E6671700899322 /* SDL_gesture.c */; };
-		DB31400E17554B71006C0E22 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE212E6671700899322 /* SDL_keyboard.c */; };
-		DB31400F17554B71006C0E22 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE412E6671700899322 /* SDL_mouse.c */; };
-		DB31401017554B71006C0E22 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE612E6671700899322 /* SDL_quit.c */; };
-		DB31401117554B71006C0E22 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE812E6671700899322 /* SDL_touch.c */; };
-		DB31401217554B71006C0E22 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEA12E6671700899322 /* SDL_windowevents.c */; };
-		DB31401317554B71006C0E22 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */; };
-		DB31401417554B71006C0E22 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF012E6671700899322 /* SDL_rwops.c */; };
-		DB31401517554B71006C0E22 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF312E6671700899322 /* SDL_syshaptic.c */; };
-		DB31401617554B71006C0E22 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDFA12E6671700899322 /* SDL_haptic.c */; };
-		DB31401717554B71006C0E22 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE0712E6671700899322 /* SDL_sysjoystick.c */; };
-		DB31401817554B71006C0E22 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */; };
-		DB31401917554B71006C0E22 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE1612E6671700899322 /* SDL_joystick.c */; };
-		DB31401A17554B71006C0E22 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE3312E6671700899322 /* SDL_sysloadso.c */; };
-		DB31401B17554B71006C0E22 /* SDL_syspower.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4B12E6671700899322 /* SDL_syspower.c */; };
-		DB31401C17554B71006C0E22 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4E12E6671700899322 /* SDL_power.c */; };
-		DB31401D17554B71006C0E22 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5612E6671700899322 /* SDL_assert.c */; };
-		DB31401E17554B71006C0E22 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5912E6671700899322 /* SDL_error.c */; };
-		DB31402017554B71006C0E22 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5C12E6671700899322 /* SDL.c */; };
-		DB31402117554B71006C0E22 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5E12E6671700899322 /* SDL_getenv.c */; };
-		DB31402217554B71006C0E22 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5F12E6671700899322 /* SDL_iconv.c */; };
-		DB31402317554B71006C0E22 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6012E6671700899322 /* SDL_malloc.c */; };
-		DB31402417554B71006C0E22 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6112E6671700899322 /* SDL_qsort.c */; };
-		DB31402517554B71006C0E22 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6212E6671700899322 /* SDL_stdlib.c */; };
-		DB31402617554B71006C0E22 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6312E6671700899322 /* SDL_string.c */; };
-		DB31402717554B71006C0E22 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7E12E6671800899322 /* SDL_syscond.c */; };
-		DB31402817554B71006C0E22 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7F12E6671800899322 /* SDL_sysmutex.c */; };
-		DB31402917554B71006C0E22 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8112E6671800899322 /* SDL_syssem.c */; };
-		DB31402A17554B71006C0E22 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8212E6671800899322 /* SDL_systhread.c */; };
-		DB31402B17554B71006C0E22 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8C12E6671800899322 /* SDL_thread.c */; };
-		DB31402C17554B71006C0E22 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE9F12E6671800899322 /* SDL_timer.c */; };
-		DB31402D17554B71006C0E22 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEA212E6671800899322 /* SDL_systimer.c */; };
-		DB31402E17554B71006C0E22 /* SDL_cocoaclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */; };
-		DB31402F17554B71006C0E22 /* SDL_cocoaevents.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC512E6671800899322 /* SDL_cocoaevents.m */; };
-		DB31403017554B71006C0E22 /* SDL_cocoakeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */; };
-		DB31403117554B71006C0E22 /* SDL_cocoamodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC912E6671800899322 /* SDL_cocoamodes.m */; };
-		DB31403217554B71006C0E22 /* SDL_cocoamouse.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECB12E6671800899322 /* SDL_cocoamouse.m */; };
-		DB31403317554B71006C0E22 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */; };
-		DB31403417554B71006C0E22 /* SDL_cocoashape.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECF12E6671800899322 /* SDL_cocoashape.m */; };
-		DB31403517554B71006C0E22 /* SDL_cocoavideo.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED112E6671800899322 /* SDL_cocoavideo.m */; };
-		DB31403617554B71006C0E22 /* SDL_cocoawindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED312E6671800899322 /* SDL_cocoawindow.m */; };
-		DB31403717554B71006C0E22 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEE812E6671800899322 /* SDL_nullevents.c */; };
-		DB31403817554B71006C0E22 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; };
-		DB31403917554B71006C0E22 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; };
-		DB31403A17554B71006C0E22 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; };
-		DB31403B17554B71006C0E22 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5112E6671800899322 /* SDL_blit_1.c */; };
-		DB31403C17554B71006C0E22 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5212E6671800899322 /* SDL_blit_A.c */; };
-		DB31403D17554B71006C0E22 /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5312E6671800899322 /* SDL_blit_auto.c */; };
-		DB31403E17554B71006C0E22 /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5512E6671800899322 /* SDL_blit_copy.c */; };
-		DB31403F17554B71006C0E22 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5712E6671800899322 /* SDL_blit_N.c */; };
-		DB31404017554B71006C0E22 /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5812E6671800899322 /* SDL_blit_slow.c */; };
-		DB31404117554B71006C0E22 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; };
-		DB31404217554B71006C0E22 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; };
-		DB31404317554B71006C0E22 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; };
-		DB31404417554B71006C0E22 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; };
-		DB31404517554B71006C0E22 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; };
-		DB31404617554B71006C0E22 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */; };
-		DB31404717554B71006C0E22 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7112E6671800899322 /* SDL_shape.c */; };
-		DB31404817554B71006C0E22 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7312E6671800899322 /* SDL_stretch.c */; };
-		DB31404917554B71006C0E22 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7412E6671800899322 /* SDL_surface.c */; };
-		DB31404A17554B71006C0E22 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7612E6671800899322 /* SDL_video.c */; };
-		DB31404B17554B71006C0E22 /* imKStoUCS.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFB812E6671800899322 /* imKStoUCS.c */; };
-		DB31404C17554B71006C0E22 /* SDL_x11clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */; };
-		DB31404D17554B71006C0E22 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBC12E6671800899322 /* SDL_x11dyn.c */; };
-		DB31404E17554B71006C0E22 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBE12E6671800899322 /* SDL_x11events.c */; };
-		DB31404F17554B71006C0E22 /* SDL_x11keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */; };
-		DB31405017554B71006C0E22 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC412E6671800899322 /* SDL_x11modes.c */; };
-		DB31405117554B71006C0E22 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC612E6671800899322 /* SDL_x11mouse.c */; };
-		DB31405217554B71006C0E22 /* SDL_x11opengl.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC812E6671800899322 /* SDL_x11opengl.c */; };
-		DB31405317554B71006C0E22 /* SDL_x11opengles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */; };
-		DB31405417554B71006C0E22 /* SDL_x11shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCE12E6671800899322 /* SDL_x11shape.c */; };
-		DB31405517554B71006C0E22 /* SDL_x11touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD112E6671800899322 /* SDL_x11touch.c */; };
-		DB31405617554B71006C0E22 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD312E6671800899322 /* SDL_x11video.c */; };
-		DB31405717554B71006C0E22 /* SDL_x11window.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD512E6671800899322 /* SDL_x11window.c */; };
-		DB31405817554B71006C0E22 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; };
-		DB31405917554B71006C0E22 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; };
-		DB31405A17554B71006C0E22 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */; };
-		DB31405B17554B71006C0E22 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; };
-		DB31405C17554B71006C0E22 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; };
-		DB31405D17554B71006C0E22 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; };
-		DB31405E17554B71006C0E22 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; };
-		DB31405F17554B71006C0E22 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; };
-		DB31406017554B71006C0E22 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; };
-		DB31406117554B71006C0E22 /* SDL_render_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */; };
-		DB31406217554B71006C0E22 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */; };
-		DB31406317554B71006C0E22 /* SDL_x11framebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */; };
-		DB31406417554B71006C0E22 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5E12FE1C75004C9285 /* SDL_hints.c */; };
-		DB31406517554B71006C0E22 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; };
-		DB31406617554B71006C0E22 /* SDL_shaders_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */; };
-		DB31406717554B71006C0E22 /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AC8159367B7005138DD /* SDL_rotate.c */; };
-		DB31406817554B71006C0E22 /* SDL_x11xinput2.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628ACF159367F2005138DD /* SDL_x11xinput2.c */; };
-		DB31406917554B71006C0E22 /* SDL_x11messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */; };
-		DB31406A17554B71006C0E22 /* SDL_cocoamessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */; };
-		DB31406C17554B71006C0E22 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; };
-		DB31406D17554B71006C0E22 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; };
-		DB31406E17554B71006C0E22 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; };
-		DB31406F17554B71006C0E22 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; };
-		DB31407017554B71006C0E22 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; };
-		DB31407117554B71006C0E22 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A00858DECD00B2BC32 /* OpenGL.framework */; };
-		DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
-		DB31408B17554D37006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; };
-		DB31408D17554D3C006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
-		BECDF6C50761BA81005FE872 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BECDF5FE0761BA81005FE872;
-			remoteInfo = "Framework (Upgraded)";
-		};
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
-		0073179B0858DECD00B2BC32 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
-		0073179C0858DECD00B2BC32 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
-		0073179D0858DECD00B2BC32 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
-		0073179E0858DECD00B2BC32 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
-		0073179F0858DECD00B2BC32 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
-		007317A00858DECD00B2BC32 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
-		007317C10858E15000B2BC32 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
-		00794D3F09D0C461003FC8A1 /* License.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = License.txt; sourceTree = "<group>"; };
-		00AE6E1E08B958CC00255E2F /* ReadMeDevLite.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMeDevLite.txt; sourceTree = "<group>"; };
-		00CFA89C106B4BA100758660 /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = "<absolute>"; };
-		00D0D08310675DD9004B05EF /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
-		04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_glfuncs.h; sourceTree = "<group>"; };
-		041B2C9E12FA0D680087D585 /* SDL_render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render.c; sourceTree = "<group>"; };
-		041B2C9F12FA0D680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = "<group>"; };
-		0435673C1303160F00BA5428 /* SDL_shaders_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shaders_gl.c; sourceTree = "<group>"; };
-		0435673D1303160F00BA5428 /* SDL_shaders_gl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_gl.h; sourceTree = "<group>"; };
-		04409B8D12FA97ED00FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = "<group>"; };
-		04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = "<group>"; };
-		04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = "<group>"; };
-		04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = "<group>"; };
-		0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gl.c; sourceTree = "<group>"; };
-		0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render_sw_c.h; sourceTree = "<group>"; };
-		0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_sw.c; sourceTree = "<group>"; };
-		0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11framebuffer.c; sourceTree = "<group>"; };
-		0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11framebuffer.h; sourceTree = "<group>"; };
-		0442EC5E12FE1C75004C9285 /* SDL_hints.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_hints.c; path = ../../src/SDL_hints.c; sourceTree = SOURCE_ROOT; };
-		04BAC0C71300C2160055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_log.c; path = ../../src/SDL_log.c; sourceTree = SOURCE_ROOT; };
-		04BDFD7412E6671700899322 /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = "<group>"; };
-		04BDFD7512E6671700899322 /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = "<group>"; };
-		04BDFD8812E6671700899322 /* SDL_diskaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_diskaudio.c; sourceTree = "<group>"; };
-		04BDFD8912E6671700899322 /* SDL_diskaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_diskaudio.h; sourceTree = "<group>"; };
-		04BDFD9412E6671700899322 /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = "<group>"; };
-		04BDFD9512E6671700899322 /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = "<group>"; };
-		04BDFDA012E6671700899322 /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_coreaudio.c; sourceTree = "<group>"; };
-		04BDFDA112E6671700899322 /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_coreaudio.h; sourceTree = "<group>"; };
-		04BDFDB412E6671700899322 /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = "<group>"; };
-		04BDFDB512E6671700899322 /* SDL_audio_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_c.h; sourceTree = "<group>"; };
-		04BDFDB612E6671700899322 /* SDL_audiocvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiocvt.c; sourceTree = "<group>"; };
-		04BDFDB712E6671700899322 /* SDL_audiodev.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiodev.c; sourceTree = "<group>"; };
-		04BDFDB812E6671700899322 /* SDL_audiodev_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiodev_c.h; sourceTree = "<group>"; };
-		04BDFDB912E6671700899322 /* SDL_audiomem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiomem.h; sourceTree = "<group>"; };
-		04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiotypecvt.c; sourceTree = "<group>"; };
-		04BDFDBB12E6671700899322 /* SDL_mixer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mixer.c; sourceTree = "<group>"; };
-		04BDFDC212E6671700899322 /* SDL_sysaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysaudio.h; sourceTree = "<group>"; };
-		04BDFDC312E6671700899322 /* SDL_wave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_wave.c; sourceTree = "<group>"; };
-		04BDFDC412E6671700899322 /* SDL_wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_wave.h; sourceTree = "<group>"; };
-		04BDFDD412E6671700899322 /* SDL_cpuinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_cpuinfo.c; sourceTree = "<group>"; };
-		04BDFDD612E6671700899322 /* blank_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blank_cursor.h; sourceTree = "<group>"; };
-		04BDFDD712E6671700899322 /* default_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default_cursor.h; sourceTree = "<group>"; };
-		04BDFDD812E6671700899322 /* scancodes_darwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_darwin.h; sourceTree = "<group>"; };
-		04BDFDD912E6671700899322 /* scancodes_linux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_linux.h; sourceTree = "<group>"; };
-		04BDFDDB12E6671700899322 /* scancodes_xfree86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_xfree86.h; sourceTree = "<group>"; };
-		04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = "<group>"; };
-		04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = "<group>"; };
-		04BDFDDE12E6671700899322 /* SDL_events.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_events.c; sourceTree = "<group>"; };
-		04BDFDDF12E6671700899322 /* SDL_events_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events_c.h; sourceTree = "<group>"; };
-		04BDFDE012E6671700899322 /* SDL_gesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gesture.c; sourceTree = "<group>"; };
-		04BDFDE112E6671700899322 /* SDL_gesture_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture_c.h; sourceTree = "<group>"; };
-		04BDFDE212E6671700899322 /* SDL_keyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_keyboard.c; sourceTree = "<group>"; };
-		04BDFDE312E6671700899322 /* SDL_keyboard_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard_c.h; sourceTree = "<group>"; };
-		04BDFDE412E6671700899322 /* SDL_mouse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mouse.c; sourceTree = "<group>"; };
-		04BDFDE512E6671700899322 /* SDL_mouse_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse_c.h; sourceTree = "<group>"; };
-		04BDFDE612E6671700899322 /* SDL_quit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_quit.c; sourceTree = "<group>"; };
-		04BDFDE712E6671700899322 /* SDL_sysevents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysevents.h; sourceTree = "<group>"; };
-		04BDFDE812E6671700899322 /* SDL_touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_touch.c; sourceTree = "<group>"; };
-		04BDFDE912E6671700899322 /* SDL_touch_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch_c.h; sourceTree = "<group>"; };
-		04BDFDEA12E6671700899322 /* SDL_windowevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_windowevents.c; sourceTree = "<group>"; };
-		04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_windowevents_c.h; sourceTree = "<group>"; };
-		04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwopsbundlesupport.h; sourceTree = "<group>"; };
-		04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_rwopsbundlesupport.m; sourceTree = "<group>"; };
-		04BDFDF012E6671700899322 /* SDL_rwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rwops.c; sourceTree = "<group>"; };
-		04BDFDF312E6671700899322 /* SDL_syshaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syshaptic.c; sourceTree = "<group>"; };
-		04BDFDFA12E6671700899322 /* SDL_haptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_haptic.c; sourceTree = "<group>"; };
-		04BDFDFB12E6671700899322 /* SDL_haptic_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_haptic_c.h; sourceTree = "<group>"; };
-		04BDFDFC12E6671700899322 /* SDL_syshaptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syshaptic.h; sourceTree = "<group>"; };
-		04BDFE0712E6671700899322 /* SDL_sysjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysjoystick.c; sourceTree = "<group>"; };
-		04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick_c.h; sourceTree = "<group>"; };
-		04BDFE1612E6671700899322 /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = "<group>"; };
-		04BDFE1712E6671700899322 /* SDL_joystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick_c.h; sourceTree = "<group>"; };
-		04BDFE1812E6671700899322 /* SDL_sysjoystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick.h; sourceTree = "<group>"; };
-		04BDFE3312E6671700899322 /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = "<group>"; };
-		04BDFE4B12E6671700899322 /* SDL_syspower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syspower.c; sourceTree = "<group>"; };
-		04BDFE4E12E6671700899322 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_power.c; sourceTree = "<group>"; };
-		04BDFE5512E6671700899322 /* SDL_assert_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert_c.h; path = ../../src/SDL_assert_c.h; sourceTree = SOURCE_ROOT; };
-		04BDFE5612E6671700899322 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; };
-		04BDFE5812E6671700899322 /* SDL_error_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_error_c.h; path = ../../src/SDL_error_c.h; sourceTree = SOURCE_ROOT; };
-		04BDFE5912E6671700899322 /* SDL_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_error.c; path = ../../src/SDL_error.c; sourceTree = SOURCE_ROOT; };
-		04BDFE5C12E6671700899322 /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL.c; path = ../../src/SDL.c; sourceTree = SOURCE_ROOT; };
-		04BDFE5E12E6671700899322 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = "<group>"; };
-		04BDFE5F12E6671700899322 /* SDL_iconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_iconv.c; sourceTree = "<group>"; };
-		04BDFE6012E6671700899322 /* SDL_malloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_malloc.c; sourceTree = "<group>"; };
-		04BDFE6112E6671700899322 /* SDL_qsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_qsort.c; sourceTree = "<group>"; };
-		04BDFE6212E6671700899322 /* SDL_stdlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_stdlib.c; sourceTree = "<group>"; };
-		04BDFE6312E6671700899322 /* SDL_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_string.c; sourceTree = "<group>"; };
-		04BDFE7E12E6671800899322 /* SDL_syscond.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syscond.c; sourceTree = "<group>"; };
-		04BDFE7F12E6671800899322 /* SDL_sysmutex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysmutex.c; sourceTree = "<group>"; };
-		04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysmutex_c.h; sourceTree = "<group>"; };
-		04BDFE8112E6671800899322 /* SDL_syssem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syssem.c; sourceTree = "<group>"; };
-		04BDFE8212E6671800899322 /* SDL_systhread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systhread.c; sourceTree = "<group>"; };
-		04BDFE8312E6671800899322 /* SDL_systhread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread_c.h; sourceTree = "<group>"; };
-		04BDFE8B12E6671800899322 /* SDL_systhread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread.h; sourceTree = "<group>"; };
-		04BDFE8C12E6671800899322 /* SDL_thread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_thread.c; sourceTree = "<group>"; };
-		04BDFE8D12E6671800899322 /* SDL_thread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread_c.h; sourceTree = "<group>"; };
-		04BDFE9F12E6671800899322 /* SDL_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_timer.c; sourceTree = "<group>"; };
-		04BDFEA012E6671800899322 /* SDL_timer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer_c.h; sourceTree = "<group>"; };
-		04BDFEA212E6671800899322 /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = "<group>"; };
-		04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoaclipboard.h; sourceTree = "<group>"; };
-		04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoaclipboard.m; sourceTree = "<group>"; };
-		04BDFEC412E6671800899322 /* SDL_cocoaevents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoaevents.h; sourceTree = "<group>"; };
-		04BDFEC512E6671800899322 /* SDL_cocoaevents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoaevents.m; sourceTree = "<group>"; };
-		04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoakeyboard.h; sourceTree = "<group>"; };
-		04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoakeyboard.m; sourceTree = "<group>"; };
-		04BDFEC812E6671800899322 /* SDL_cocoamodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamodes.h; sourceTree = "<group>"; };
-		04BDFEC912E6671800899322 /* SDL_cocoamodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamodes.m; sourceTree = "<group>"; };
-		04BDFECA12E6671800899322 /* SDL_cocoamouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamouse.h; sourceTree = "<group>"; };
-		04BDFECB12E6671800899322 /* SDL_cocoamouse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamouse.m; sourceTree = "<group>"; };
-		04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoaopengl.h; sourceTree = "<group>"; };
-		04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoaopengl.m; sourceTree = "<group>"; };
-		04BDFECE12E6671800899322 /* SDL_cocoashape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoashape.h; sourceTree = "<group>"; };
-		04BDFECF12E6671800899322 /* SDL_cocoashape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoashape.m; sourceTree = "<group>"; };
-		04BDFED012E6671800899322 /* SDL_cocoavideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoavideo.h; sourceTree = "<group>"; };
-		04BDFED112E6671800899322 /* SDL_cocoavideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoavideo.m; sourceTree = "<group>"; };
-		04BDFED212E6671800899322 /* SDL_cocoawindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoawindow.h; sourceTree = "<group>"; };
-		04BDFED312E6671800899322 /* SDL_cocoawindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoawindow.m; sourceTree = "<group>"; };
-		04BDFEE812E6671800899322 /* SDL_nullevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullevents.c; sourceTree = "<group>"; };
-		04BDFEE912E6671800899322 /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = "<group>"; };
-		04BDFEEC12E6671800899322 /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = "<group>"; };
-		04BDFEED12E6671800899322 /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = "<group>"; };
-		04BDFF4E12E6671800899322 /* SDL_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit.c; sourceTree = "<group>"; };
-		04BDFF4F12E6671800899322 /* SDL_blit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit.h; sourceTree = "<group>"; };
-		04BDFF5012E6671800899322 /* SDL_blit_0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_0.c; sourceTree = "<group>"; };
-		04BDFF5112E6671800899322 /* SDL_blit_1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_1.c; sourceTree = "<group>"; };
-		04BDFF5212E6671800899322 /* SDL_blit_A.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_A.c; sourceTree = "<group>"; };
-		04BDFF5312E6671800899322 /* SDL_blit_auto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_auto.c; sourceTree = "<group>"; };
-		04BDFF5412E6671800899322 /* SDL_blit_auto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_auto.h; sourceTree = "<group>"; };
-		04BDFF5512E6671800899322 /* SDL_blit_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_copy.c; sourceTree = "<group>"; };
-		04BDFF5612E6671800899322 /* SDL_blit_copy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_copy.h; sourceTree = "<group>"; };
-		04BDFF5712E6671800899322 /* SDL_blit_N.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_N.c; sourceTree = "<group>"; };
-		04BDFF5812E6671800899322 /* SDL_blit_slow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_slow.c; sourceTree = "<group>"; };
-		04BDFF5912E6671800899322 /* SDL_blit_slow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_slow.h; sourceTree = "<group>"; };
-		04BDFF5A12E6671800899322 /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = "<group>"; };
-		04BDFF5B12E6671800899322 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = "<group>"; };
-		04BDFF6012E6671800899322 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = "<group>"; };
-		04BDFF6512E6671800899322 /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = "<group>"; };
-		04BDFF6612E6671800899322 /* SDL_pixels_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels_c.h; sourceTree = "<group>"; };
-		04BDFF6712E6671800899322 /* SDL_rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rect.c; sourceTree = "<group>"; };
-		04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_RLEaccel.c; sourceTree = "<group>"; };
-		04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_RLEaccel_c.h; sourceTree = "<group>"; };
-		04BDFF7112E6671800899322 /* SDL_shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shape.c; sourceTree = "<group>"; };
-		04BDFF7212E6671800899322 /* SDL_shape_internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape_internals.h; sourceTree = "<group>"; };
-		04BDFF7312E6671800899322 /* SDL_stretch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_stretch.c; sourceTree = "<group>"; };
-		04BDFF7412E6671800899322 /* SDL_surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_surface.c; sourceTree = "<group>"; };
-		04BDFF7512E6671800899322 /* SDL_sysvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysvideo.h; sourceTree = "<group>"; };
-		04BDFF7612E6671800899322 /* SDL_video.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_video.c; sourceTree = "<group>"; };
-		04BDFFB812E6671800899322 /* imKStoUCS.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = imKStoUCS.c; sourceTree = "<group>"; };
-		04BDFFB912E6671800899322 /* imKStoUCS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = imKStoUCS.h; sourceTree = "<group>"; };
-		04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11clipboard.c; sourceTree = "<group>"; };
-		04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11clipboard.h; sourceTree = "<group>"; };
-		04BDFFBC12E6671800899322 /* SDL_x11dyn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11dyn.c; sourceTree = "<group>"; };
-		04BDFFBD12E6671800899322 /* SDL_x11dyn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11dyn.h; sourceTree = "<group>"; };
-		04BDFFBE12E6671800899322 /* SDL_x11events.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11events.c; sourceTree = "<group>"; };
-		04BDFFBF12E6671800899322 /* SDL_x11events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11events.h; sourceTree = "<group>"; };
-		04BDFFC212E6671800899322 /* SDL_x11keyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11keyboard.c; sourceTree = "<group>"; };
-		04BDFFC312E6671800899322 /* SDL_x11keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11keyboard.h; sourceTree = "<group>"; };
-		04BDFFC412E6671800899322 /* SDL_x11modes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11modes.c; sourceTree = "<group>"; };
-		04BDFFC512E6671800899322 /* SDL_x11modes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11modes.h; sourceTree = "<group>"; };
-		04BDFFC612E6671800899322 /* SDL_x11mouse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11mouse.c; sourceTree = "<group>"; };
-		04BDFFC712E6671800899322 /* SDL_x11mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11mouse.h; sourceTree = "<group>"; };
-		04BDFFC812E6671800899322 /* SDL_x11opengl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11opengl.c; sourceTree = "<group>"; };
-		04BDFFC912E6671800899322 /* SDL_x11opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11opengl.h; sourceTree = "<group>"; };
-		04BDFFCA12E6671800899322 /* SDL_x11opengles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11opengles.c; sourceTree = "<group>"; };
-		04BDFFCB12E6671800899322 /* SDL_x11opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11opengles.h; sourceTree = "<group>"; };
-		04BDFFCE12E6671800899322 /* SDL_x11shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11shape.c; sourceTree = "<group>"; };
-		04BDFFCF12E6671800899322 /* SDL_x11shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11shape.h; sourceTree = "<group>"; };
-		04BDFFD012E6671800899322 /* SDL_x11sym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11sym.h; sourceTree = "<group>"; };
-		04BDFFD112E6671800899322 /* SDL_x11touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11touch.c; sourceTree = "<group>"; };
-		04BDFFD212E6671800899322 /* SDL_x11touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11touch.h; sourceTree = "<group>"; };
-		04BDFFD312E6671800899322 /* SDL_x11video.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11video.c; sourceTree = "<group>"; };
-		04BDFFD412E6671800899322 /* SDL_x11video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11video.h; sourceTree = "<group>"; };
-		04BDFFD512E6671800899322 /* SDL_x11window.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11window.c; sourceTree = "<group>"; };
-		04BDFFD612E6671800899322 /* SDL_x11window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11window.h; sourceTree = "<group>"; };
-		04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullframebuffer_c.h; sourceTree = "<group>"; };
-		04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullframebuffer.c; sourceTree = "<group>"; };
-		04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = "<group>"; };
-		04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendfillrect.h; sourceTree = "<group>"; };
-		04F7803F12FB74A200FC43C0 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = "<group>"; };
-		04F7804012FB74A200FC43C0 /* SDL_blendline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendline.h; sourceTree = "<group>"; };
-		04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = "<group>"; };
-		04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendpoint.h; sourceTree = "<group>"; };
-		04F7804312FB74A200FC43C0 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = "<group>"; };
-		04F7804412FB74A200FC43C0 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = "<group>"; };
-		04F7804512FB74A200FC43C0 /* SDL_drawline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawline.h; sourceTree = "<group>"; };
-		04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = "<group>"; };
-		04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawpoint.h; sourceTree = "<group>"; };
-		566CDE8D148F0AC200C5A9BB /* SDL_dropevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dropevents_c.h; sourceTree = "<group>"; };
-		566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dropevents.c; sourceTree = "<group>"; };
-		567E2F1B17C44BB2005F1892 /* SDL_sysfilesystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_sysfilesystem.m; path = ../../src/filesystem/cocoa/SDL_sysfilesystem.m; sourceTree = "<group>"; };
-		567E2F2017C44C35005F1892 /* SDL_filesystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_filesystem.h; sourceTree = "<group>"; };
-		A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamecontroller.h; sourceTree = "<group>"; };
-		AA0F8490178D5ECC00823F9D /* SDL_systls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systls.c; sourceTree = "<group>"; };
-		AA628AC8159367B7005138DD /* SDL_rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rotate.c; sourceTree = "<group>"; };
-		AA628AC9159367B7005138DD /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = "<group>"; };
-		AA628ACF159367F2005138DD /* SDL_x11xinput2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11xinput2.c; sourceTree = "<group>"; };
-		AA628AD0159367F2005138DD /* SDL_x11xinput2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11xinput2.h; sourceTree = "<group>"; };
-		AA7557C71595D4D800BBD41B /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = "<group>"; };
-		AA7557C81595D4D800BBD41B /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = "<group>"; };
-		AA7557C91595D4D800BBD41B /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_assert.h; sourceTree = "<group>"; };
-		AA7557CA1595D4D800BBD41B /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_atomic.h; sourceTree = "<group>"; };
-		AA7557CB1595D4D800BBD41B /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio.h; sourceTree = "<group>"; };
-		AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendmode.h; sourceTree = "<group>"; };
-		AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboard.h; sourceTree = "<group>"; };
-		AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_macosx.h; sourceTree = "<group>"; };
-		AA7557CF1595D4D800BBD41B /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config.h; sourceTree = "<group>"; };
-		AA7557D01595D4D800BBD41B /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_copying.h; sourceTree = "<group>"; };
-		AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cpuinfo.h; sourceTree = "<group>"; };
-		AA7557D21595D4D800BBD41B /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_endian.h; sourceTree = "<group>"; };
-		AA7557D31595D4D800BBD41B /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error.h; sourceTree = "<group>"; };
-		AA7557D41595D4D800BBD41B /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events.h; sourceTree = "<group>"; };
-		AA7557D51595D4D800BBD41B /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture.h; sourceTree = "<group>"; };
-		AA7557D61595D4D800BBD41B /* SDL_haptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_haptic.h; sourceTree = "<group>"; };
-		AA7557D71595D4D800BBD41B /* SDL_hints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hints.h; sourceTree = "<group>"; };
-		AA7557D91595D4D800BBD41B /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = "<group>"; };
-		AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard.h; sourceTree = "<group>"; };
-		AA7557DB1595D4D800BBD41B /* SDL_keycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keycode.h; sourceTree = "<group>"; };
-		AA7557DC1595D4D800BBD41B /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_loadso.h; sourceTree = "<group>"; };
-		AA7557DD1595D4D800BBD41B /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_log.h; sourceTree = "<group>"; };
-		AA7557DE1595D4D800BBD41B /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_main.h; sourceTree = "<group>"; };
-		AA7557DF1595D4D800BBD41B /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse.h; sourceTree = "<group>"; };
-		AA7557E01595D4D800BBD41B /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mutex.h; sourceTree = "<group>"; };
-		AA7557E11595D4D800BBD41B /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_name.h; sourceTree = "<group>"; };
-		AA7557E21595D4D800BBD41B /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengl.h; sourceTree = "<group>"; };
-		AA7557E31595D4D800BBD41B /* SDL_opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles.h; sourceTree = "<group>"; };
-		AA7557E41595D4D800BBD41B /* SDL_opengles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles2.h; sourceTree = "<group>"; };
-		AA7557E51595D4D800BBD41B /* SDL_pixels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels.h; sourceTree = "<group>"; };
-		AA7557E61595D4D800BBD41B /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_platform.h; sourceTree = "<group>"; };
-		AA7557E71595D4D800BBD41B /* SDL_power.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_power.h; sourceTree = "<group>"; };
-		AA7557E81595D4D800BBD41B /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_quit.h; sourceTree = "<group>"; };
-		AA7557E91595D4D800BBD41B /* SDL_rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect.h; sourceTree = "<group>"; };
-		AA7557EA1595D4D800BBD41B /* SDL_render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render.h; sourceTree = "<group>"; };
-		AA7557EB1595D4D800BBD41B /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_revision.h; sourceTree = "<group>"; };
-		AA7557EC1595D4D800BBD41B /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwops.h; sourceTree = "<group>"; };
-		AA7557ED1595D4D800BBD41B /* SDL_scancode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scancode.h; sourceTree = "<group>"; };
-		AA7557EE1595D4D800BBD41B /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape.h; sourceTree = "<group>"; };
-		AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_stdinc.h; sourceTree = "<group>"; };
-		AA7557F01595D4D800BBD41B /* SDL_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_surface.h; sourceTree = "<group>"; };
-		AA7557F11595D4D800BBD41B /* SDL_system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_system.h; sourceTree = "<group>"; };
-		AA7557F21595D4D800BBD41B /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syswm.h; sourceTree = "<group>"; };
-		AA7557F31595D4D800BBD41B /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread.h; sourceTree = "<group>"; };
-		AA7557F41595D4D800BBD41B /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer.h; sourceTree = "<group>"; };
-		AA7557F51595D4D800BBD41B /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch.h; sourceTree = "<group>"; };
-		AA7557F61595D4D800BBD41B /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_types.h; sourceTree = "<group>"; };
-		AA7557F71595D4D800BBD41B /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_version.h; sourceTree = "<group>"; };
-		AA7557F81595D4D800BBD41B /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = "<group>"; };
-		AA7557F91595D4D800BBD41B /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = "<group>"; };
-		AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11messagebox.c; sourceTree = "<group>"; };
-		AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_messagebox.h; sourceTree = "<group>"; };
-		AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamessagebox.h; sourceTree = "<group>"; };
-		AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamessagebox.m; sourceTree = "<group>"; };
-		AADA5B8616CCAB3000107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = "<group>"; };
-		BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gamecontroller.c; sourceTree = "<group>"; };
-		BECDF66B0761BA81005FE872 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = "<group>"; };
-		BECDF66C0761BA81005FE872 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-		BECDF6B30761BA81005FE872 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; };
-		BECDF6BE0761BA81005FE872 /* Standard DMG */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Standard DMG"; sourceTree = BUILT_PRODUCTS_DIR; };
-		D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamousetap.h; sourceTree = "<group>"; };
-		D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamousetap.m; sourceTree = "<group>"; };
-		DB31407717554B71006C0E22 /* libSDL2.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL2.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
-		F59C70FF00D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = "<group>"; };
-		F59C710000D5CB5801000001 /* Welcome.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Welcome.txt; sourceTree = "<group>"; };
-		F59C710300D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = "<group>"; };
-		F59C710500D5CB5801000001 /* SDL-devel.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "SDL-devel.info"; sourceTree = "<group>"; };
-		F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = "<group>"; };
-		F59C710C00D5D15801000001 /* install.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = install.sh; sourceTree = "<group>"; };
-		F5A2EF3900C6A39A01000001 /* BUGS.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = BUGS.txt; path = ../../BUGS.txt; sourceTree = SOURCE_ROOT; };
-		F5A2EF3A00C6A3C201000001 /* README-macosx.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "README-macosx.txt"; path = "../../README-macosx.txt"; sourceTree = SOURCE_ROOT; };
-		F5F81AD400D706B101000001 /* Readme SDL Developer.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "Readme SDL Developer.txt"; path = "pkg-support/Readme SDL Developer.txt"; sourceTree = SOURCE_ROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		BECDF6680761BA81005FE872 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */,
-				007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */,
-				007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */,
-				007317A50858DECD00B2BC32 /* CoreAudio.framework in Frameworks */,
-				007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */,
-				007317A70858DECD00B2BC32 /* OpenGL.framework in Frameworks */,
-				00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */,
-				00D0D0D810675E46004B05EF /* Carbon.framework in Frameworks */,
-				00CFA89D106B4BA100758660 /* ForceFeedback.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BECDF6B10761BA81005FE872 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				007317A90858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */,
-				007317AA0858DECD00B2BC32 /* AudioUnit.framework in Frameworks */,
-				007317AB0858DECD00B2BC32 /* Cocoa.framework in Frameworks */,
-				007317AC0858DECD00B2BC32 /* CoreAudio.framework in Frameworks */,
-				007317AD0858DECD00B2BC32 /* IOKit.framework in Frameworks */,
-				007317AE0858DECD00B2BC32 /* OpenGL.framework in Frameworks */,
-				007317C30858E15000B2BC32 /* Carbon.framework in Frameworks */,
-				DB31408B17554D37006C0E22 /* ForceFeedback.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB31406B17554B71006C0E22 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB31406C17554B71006C0E22 /* AudioToolbox.framework in Frameworks */,
-				DB31406D17554B71006C0E22 /* AudioUnit.framework in Frameworks */,
-				DB31406E17554B71006C0E22 /* Cocoa.framework in Frameworks */,
-				DB31406F17554B71006C0E22 /* CoreAudio.framework in Frameworks */,
-				DB31407017554B71006C0E22 /* IOKit.framework in Frameworks */,
-				DB31407117554B71006C0E22 /* OpenGL.framework in Frameworks */,
-				DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */,
-				DB31408D17554D3C006C0E22 /* ForceFeedback.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		0153844A006D81B07F000001 /* Public Headers */ = {
-			isa = PBXGroup;
-			children = (
-				AA7557C71595D4D800BBD41B /* begin_code.h */,
-				AA7557C81595D4D800BBD41B /* close_code.h */,
-				AA7557F91595D4D800BBD41B /* SDL.h */,
-				AA7557C91595D4D800BBD41B /* SDL_assert.h */,
-				AA7557CA1595D4D800BBD41B /* SDL_atomic.h */,
-				AA7557CB1595D4D800BBD41B /* SDL_audio.h */,
-				AADA5B8616CCAB3000107CF7 /* SDL_bits.h */,
-				AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */,
-				AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */,
-				AA7557CF1595D4D800BBD41B /* SDL_config.h */,
-				AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */,
-				AA7557D01595D4D800BBD41B /* SDL_copying.h */,
-				AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */,
-				AA7557D21595D4D800BBD41B /* SDL_endian.h */,
-				AA7557D31595D4D800BBD41B /* SDL_error.h */,
-				AA7557D41595D4D800BBD41B /* SDL_events.h */,
-				567E2F2017C44C35005F1892 /* SDL_filesystem.h */,
-				A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */,
-				AA7557D51595D4D800BBD41B /* SDL_gesture.h */,
-				AA7557D61595D4D800BBD41B /* SDL_haptic.h */,
-				AA7557D71595D4D800BBD41B /* SDL_hints.h */,
-				AA7557D91595D4D800BBD41B /* SDL_joystick.h */,
-				AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */,
-				AA7557DB1595D4D800BBD41B /* SDL_keycode.h */,
-				AA7557DC1595D4D800BBD41B /* SDL_loadso.h */,
-				AA7557DD1595D4D800BBD41B /* SDL_log.h */,
-				AA7557DE1595D4D800BBD41B /* SDL_main.h */,
-				AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */,
-				AA7557DF1595D4D800BBD41B /* SDL_mouse.h */,
-				AA7557E01595D4D800BBD41B /* SDL_mutex.h */,
-				AA7557E11595D4D800BBD41B /* SDL_name.h */,
-				AA7557E21595D4D800BBD41B /* SDL_opengl.h */,
-				AA7557E31595D4D800BBD41B /* SDL_opengles.h */,
-				AA7557E41595D4D800BBD41B /* SDL_opengles2.h */,
-				AA7557E51595D4D800BBD41B /* SDL_pixels.h */,
-				AA7557E61595D4D800BBD41B /* SDL_platform.h */,
-				AA7557E71595D4D800BBD41B /* SDL_power.h */,
-				AA7557E81595D4D800BBD41B /* SDL_quit.h */,
-				AA7557E91595D4D800BBD41B /* SDL_rect.h */,
-				AA7557EA1595D4D800BBD41B /* SDL_render.h */,
-				AA7557EB1595D4D800BBD41B /* SDL_revision.h */,
-				AA7557EC1595D4D800BBD41B /* SDL_rwops.h */,
-				AA7557ED1595D4D800BBD41B /* SDL_scancode.h */,
-				AA7557EE1595D4D800BBD41B /* SDL_shape.h */,
-				AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */,
-				AA7557F01595D4D800BBD41B /* SDL_surface.h */,
-				AA7557F11595D4D800BBD41B /* SDL_system.h */,
-				AA7557F21595D4D800BBD41B /* SDL_syswm.h */,
-				AA7557F31595D4D800BBD41B /* SDL_thread.h */,
-				AA7557F41595D4D800BBD41B /* SDL_timer.h */,
-				AA7557F51595D4D800BBD41B /* SDL_touch.h */,
-				AA7557F61595D4D800BBD41B /* SDL_types.h */,
-				AA7557F71595D4D800BBD41B /* SDL_version.h */,
-				AA7557F81595D4D800BBD41B /* SDL_video.h */,
-			);
-			name = "Public Headers";
-			path = ../../include;
-			sourceTree = "<group>";
-		};
-		034768DDFF38A45A11DB9C8B /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				089C1665FE841158C02AAC07 /* Resources */,
-				BECDF66C0761BA81005FE872 /* SDL2.framework */,
-				BECDF6B30761BA81005FE872 /* libSDL2.a */,
-				BECDF6BE0761BA81005FE872 /* Standard DMG */,
-				DB31407717554B71006C0E22 /* libSDL2.dylib */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		041B2C9712FA0D680087D585 /* render */ = {
-			isa = PBXGroup;
-			children = (
-				041B2C9A12FA0D680087D585 /* opengl */,
-				041B2CA012FA0D680087D585 /* software */,
-				04409B8D12FA97ED00FB9AA8 /* mmx.h */,
-				041B2C9E12FA0D680087D585 /* SDL_render.c */,
-				041B2C9F12FA0D680087D585 /* SDL_sysrender.h */,
-				04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */,
-				04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */,
-				04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */,
-			);
-			name = render;
-			path = ../../src/render;
-			sourceTree = SOURCE_ROOT;
-		};
-		041B2C9A12FA0D680087D585 /* opengl */ = {
-			isa = PBXGroup;
-			children = (
-				04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */,
-				0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */,
-				0435673C1303160F00BA5428 /* SDL_shaders_gl.c */,
-				0435673D1303160F00BA5428 /* SDL_shaders_gl.h */,
-			);
-			path = opengl;
-			sourceTree = "<group>";
-		};
-		041B2CA012FA0D680087D585 /* software */ = {
-			isa = PBXGroup;
-			children = (
-				04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */,
-				04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */,
-				04F7803F12FB74A200FC43C0 /* SDL_blendline.c */,
-				04F7804012FB74A200FC43C0 /* SDL_blendline.h */,
-				04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */,
-				04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */,
-				04F7804312FB74A200FC43C0 /* SDL_draw.h */,
-				04F7804412FB74A200FC43C0 /* SDL_drawline.c */,
-				04F7804512FB74A200FC43C0 /* SDL_drawline.h */,
-				04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */,
-				04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */,
-				0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */,
-				0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */,
-				AA628AC8159367B7005138DD /* SDL_rotate.c */,
-				AA628AC9159367B7005138DD /* SDL_rotate.h */,
-			);
-			path = software;
-			sourceTree = "<group>";
-		};
-		04BDFD7312E6671700899322 /* atomic */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFD7412E6671700899322 /* SDL_atomic.c */,
-				04BDFD7512E6671700899322 /* SDL_spinlock.c */,
-			);
-			name = atomic;
-			path = ../../src/atomic;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFD7612E6671700899322 /* audio */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFD8712E6671700899322 /* disk */,
-				04BDFD9312E6671700899322 /* dummy */,
-				04BDFD9F12E6671700899322 /* coreaudio */,
-				04BDFDB412E6671700899322 /* SDL_audio.c */,
-				04BDFDB512E6671700899322 /* SDL_audio_c.h */,
-				04BDFDB612E6671700899322 /* SDL_audiocvt.c */,
-				04BDFDB712E6671700899322 /* SDL_audiodev.c */,
-				04BDFDB812E6671700899322 /* SDL_audiodev_c.h */,
-				04BDFDB912E6671700899322 /* SDL_audiomem.h */,
-				04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */,
-				04BDFDBB12E6671700899322 /* SDL_mixer.c */,
-				04BDFDC212E6671700899322 /* SDL_sysaudio.h */,
-				04BDFDC312E6671700899322 /* SDL_wave.c */,
-				04BDFDC412E6671700899322 /* SDL_wave.h */,
-			);
-			name = audio;
-			path = ../../src/audio;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFD8712E6671700899322 /* disk */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFD8812E6671700899322 /* SDL_diskaudio.c */,
-				04BDFD8912E6671700899322 /* SDL_diskaudio.h */,
-			);
-			path = disk;
-			sourceTree = "<group>";
-		};
-		04BDFD9312E6671700899322 /* dummy */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFD9412E6671700899322 /* SDL_dummyaudio.c */,
-				04BDFD9512E6671700899322 /* SDL_dummyaudio.h */,
-			);
-			path = dummy;
-			sourceTree = "<group>";
-		};
-		04BDFD9F12E6671700899322 /* coreaudio */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFDA012E6671700899322 /* SDL_coreaudio.c */,
-				04BDFDA112E6671700899322 /* SDL_coreaudio.h */,
-			);
-			path = coreaudio;
-			sourceTree = "<group>";
-		};
-		04BDFDD312E6671700899322 /* cpuinfo */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFDD412E6671700899322 /* SDL_cpuinfo.c */,
-			);
-			name = cpuinfo;
-			path = ../../src/cpuinfo;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFDD512E6671700899322 /* events */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFDD612E6671700899322 /* blank_cursor.h */,
-				04BDFDD712E6671700899322 /* default_cursor.h */,
-				04BDFDD812E6671700899322 /* scancodes_darwin.h */,
-				04BDFDD912E6671700899322 /* scancodes_linux.h */,
-				04BDFDDB12E6671700899322 /* scancodes_xfree86.h */,
-				04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */,
-				04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */,
-				566CDE8D148F0AC200C5A9BB /* SDL_dropevents_c.h */,
-				566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */,
-				04BDFDDE12E6671700899322 /* SDL_events.c */,
-				04BDFDDF12E6671700899322 /* SDL_events_c.h */,
-				04BDFDE012E6671700899322 /* SDL_gesture.c */,
-				04BDFDE112E6671700899322 /* SDL_gesture_c.h */,
-				04BDFDE212E6671700899322 /* SDL_keyboard.c */,
-				04BDFDE312E6671700899322 /* SDL_keyboard_c.h */,
-				04BDFDE412E6671700899322 /* SDL_mouse.c */,
-				04BDFDE512E6671700899322 /* SDL_mouse_c.h */,
-				04BDFDE612E6671700899322 /* SDL_quit.c */,
-				04BDFDE712E6671700899322 /* SDL_sysevents.h */,
-				04BDFDE812E6671700899322 /* SDL_touch.c */,
-				04BDFDE912E6671700899322 /* SDL_touch_c.h */,
-				04BDFDEA12E6671700899322 /* SDL_windowevents.c */,
-				04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */,
-			);
-			name = events;
-			path = ../../src/events;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFDEC12E6671700899322 /* file */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFDED12E6671700899322 /* cocoa */,
-				04BDFDF012E6671700899322 /* SDL_rwops.c */,
-			);
-			name = file;
-			path = ../../src/file;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFDED12E6671700899322 /* cocoa */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */,
-				04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */,
-			);
-			path = cocoa;
-			sourceTree = "<group>";
-		};
-		04BDFDF112E6671700899322 /* haptic */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFDF212E6671700899322 /* darwin */,
-				04BDFDFA12E6671700899322 /* SDL_haptic.c */,
-				04BDFDFB12E6671700899322 /* SDL_haptic_c.h */,
-				04BDFDFC12E6671700899322 /* SDL_syshaptic.h */,
-			);
-			name = haptic;
-			path = ../../src/haptic;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFDF212E6671700899322 /* darwin */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFDF312E6671700899322 /* SDL_syshaptic.c */,
-			);
-			path = darwin;
-			sourceTree = "<group>";
-		};
-		04BDFDFF12E6671700899322 /* joystick */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFE0612E6671700899322 /* darwin */,
-				04BDFE1612E6671700899322 /* SDL_joystick.c */,
-				04BDFE1712E6671700899322 /* SDL_joystick_c.h */,
-				BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */,
-				04BDFE1812E6671700899322 /* SDL_sysjoystick.h */,
-			);
-			name = joystick;
-			path = ../../src/joystick;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFE0612E6671700899322 /* darwin */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFE0712E6671700899322 /* SDL_sysjoystick.c */,
-				04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */,
-			);
-			path = darwin;
-			sourceTree = "<group>";
-		};
-		04BDFE2F12E6671700899322 /* loadso */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFE3212E6671700899322 /* dlopen */,
-			);
-			name = loadso;
-			path = ../../src/loadso;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFE3212E6671700899322 /* dlopen */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFE3312E6671700899322 /* SDL_sysloadso.c */,
-			);
-			path = dlopen;
-			sourceTree = "<group>";
-		};
-		04BDFE4512E6671700899322 /* power */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFE4A12E6671700899322 /* macosx */,
-				04BDFE4E12E6671700899322 /* SDL_power.c */,
-			);
-			name = power;
-			path = ../../src/power;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFE4A12E6671700899322 /* macosx */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFE4B12E6671700899322 /* SDL_syspower.c */,
-			);
-			path = macosx;
-			sourceTree = "<group>";
-		};
-		04BDFE5D12E6671700899322 /* stdlib */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFE5E12E6671700899322 /* SDL_getenv.c */,
-				04BDFE5F12E6671700899322 /* SDL_iconv.c */,
-				04BDFE6012E6671700899322 /* SDL_malloc.c */,
-				04BDFE6112E6671700899322 /* SDL_qsort.c */,
-				04BDFE6212E6671700899322 /* SDL_stdlib.c */,
-				04BDFE6312E6671700899322 /* SDL_string.c */,
-			);
-			name = stdlib;
-			path = ../../src/stdlib;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFE6412E6671800899322 /* thread */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFE7D12E6671800899322 /* pthread */,
-				04BDFE8B12E6671800899322 /* SDL_systhread.h */,
-				04BDFE8C12E6671800899322 /* SDL_thread.c */,
-				04BDFE8D12E6671800899322 /* SDL_thread_c.h */,
-			);
-			name = thread;
-			path = ../../src/thread;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFE7D12E6671800899322 /* pthread */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFE7E12E6671800899322 /* SDL_syscond.c */,
-				04BDFE7F12E6671800899322 /* SDL_sysmutex.c */,
-				04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */,
-				04BDFE8112E6671800899322 /* SDL_syssem.c */,
-				04BDFE8212E6671800899322 /* SDL_systhread.c */,
-				04BDFE8312E6671800899322 /* SDL_systhread_c.h */,
-				AA0F8490178D5ECC00823F9D /* SDL_systls.c */,
-			);
-			path = pthread;
-			sourceTree = "<group>";
-		};
-		04BDFE9512E6671800899322 /* timer */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFEA112E6671800899322 /* unix */,
-				04BDFE9F12E6671800899322 /* SDL_timer.c */,
-				04BDFEA012E6671800899322 /* SDL_timer_c.h */,
-			);
-			name = timer;
-			path = ../../src/timer;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFEA112E6671800899322 /* unix */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFEA212E6671800899322 /* SDL_systimer.c */,
-			);
-			path = unix;
-			sourceTree = "<group>";
-		};
-		04BDFEA712E6671800899322 /* video */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFEC112E6671800899322 /* cocoa */,
-				04BDFEE712E6671800899322 /* dummy */,
-				04BDFFB712E6671800899322 /* x11 */,
-				04BDFF4E12E6671800899322 /* SDL_blit.c */,
-				04BDFF4F12E6671800899322 /* SDL_blit.h */,
-				04BDFF5012E6671800899322 /* SDL_blit_0.c */,
-				04BDFF5112E6671800899322 /* SDL_blit_1.c */,
-				04BDFF5212E6671800899322 /* SDL_blit_A.c */,
-				04BDFF5312E6671800899322 /* SDL_blit_auto.c */,
-				04BDFF5412E6671800899322 /* SDL_blit_auto.h */,
-				04BDFF5512E6671800899322 /* SDL_blit_copy.c */,
-				04BDFF5612E6671800899322 /* SDL_blit_copy.h */,
-				04BDFF5712E6671800899322 /* SDL_blit_N.c */,
-				04BDFF5812E6671800899322 /* SDL_blit_slow.c */,
-				04BDFF5912E6671800899322 /* SDL_blit_slow.h */,
-				04BDFF5A12E6671800899322 /* SDL_bmp.c */,
-				04BDFF5B12E6671800899322 /* SDL_clipboard.c */,
-				04BDFF6012E6671800899322 /* SDL_fillrect.c */,
-				04BDFF6512E6671800899322 /* SDL_pixels.c */,
-				04BDFF6612E6671800899322 /* SDL_pixels_c.h */,
-				04BDFF6712E6671800899322 /* SDL_rect.c */,
-				04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */,
-				04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */,
-				04BDFF7112E6671800899322 /* SDL_shape.c */,
-				04BDFF7212E6671800899322 /* SDL_shape_internals.h */,
-				04BDFF7312E6671800899322 /* SDL_stretch.c */,
-				04BDFF7412E6671800899322 /* SDL_surface.c */,
-				04BDFF7512E6671800899322 /* SDL_sysvideo.h */,
-				04BDFF7612E6671800899322 /* SDL_video.c */,
-			);
-			name = video;
-			path = ../../src/video;
-			sourceTree = SOURCE_ROOT;
-		};
-		04BDFEC112E6671800899322 /* cocoa */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */,
-				04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */,
-				04BDFEC412E6671800899322 /* SDL_cocoaevents.h */,
-				04BDFEC512E6671800899322 /* SDL_cocoaevents.m */,
-				04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */,
-				04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */,
-				AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */,
-				AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */,
-				04BDFEC812E6671800899322 /* SDL_cocoamodes.h */,
-				04BDFEC912E6671800899322 /* SDL_cocoamodes.m */,
-				04BDFECA12E6671800899322 /* SDL_cocoamouse.h */,
-				04BDFECB12E6671800899322 /* SDL_cocoamouse.m */,
-				D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */,
-				D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */,
-				04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */,
-				04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */,
-				04BDFECE12E6671800899322 /* SDL_cocoashape.h */,
-				04BDFECF12E6671800899322 /* SDL_cocoashape.m */,
-				04BDFED012E6671800899322 /* SDL_cocoavideo.h */,
-				04BDFED112E6671800899322 /* SDL_cocoavideo.m */,
-				04BDFED212E6671800899322 /* SDL_cocoawindow.h */,
-				04BDFED312E6671800899322 /* SDL_cocoawindow.m */,
-			);
-			path = cocoa;
-			sourceTree = "<group>";
-		};
-		04BDFEE712E6671800899322 /* dummy */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFEE812E6671800899322 /* SDL_nullevents.c */,
-				04BDFEE912E6671800899322 /* SDL_nullevents_c.h */,
-				04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */,
-				04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */,
-				04BDFEEC12E6671800899322 /* SDL_nullvideo.c */,
-				04BDFEED12E6671800899322 /* SDL_nullvideo.h */,
-			);
-			path = dummy;
-			sourceTree = "<group>";
-		};
-		04BDFFB712E6671800899322 /* x11 */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFFB812E6671800899322 /* imKStoUCS.c */,
-				04BDFFB912E6671800899322 /* imKStoUCS.h */,
-				04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */,
-				04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */,
-				04BDFFBC12E6671800899322 /* SDL_x11dyn.c */,
-				04BDFFBD12E6671800899322 /* SDL_x11dyn.h */,
-				04BDFFBE12E6671800899322 /* SDL_x11events.c */,
-				04BDFFBF12E6671800899322 /* SDL_x11events.h */,
-				0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */,
-				0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */,
-				04BDFFC212E6671800899322 /* SDL_x11keyboard.c */,
-				04BDFFC312E6671800899322 /* SDL_x11keyboard.h */,
-				AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */,
-				04BDFFC412E6671800899322 /* SDL_x11modes.c */,
-				04BDFFC512E6671800899322 /* SDL_x11modes.h */,
-				04BDFFC612E6671800899322 /* SDL_x11mouse.c */,
-				04BDFFC712E6671800899322 /* SDL_x11mouse.h */,
-				04BDFFC812E6671800899322 /* SDL_x11opengl.c */,
-				04BDFFC912E6671800899322 /* SDL_x11opengl.h */,
-				04BDFFCA12E6671800899322 /* SDL_x11opengles.c */,
-				04BDFFCB12E6671800899322 /* SDL_x11opengles.h */,
-				04BDFFCE12E6671800899322 /* SDL_x11shape.c */,
-				04BDFFCF12E6671800899322 /* SDL_x11shape.h */,
-				04BDFFD012E6671800899322 /* SDL_x11sym.h */,
-				04BDFFD112E6671800899322 /* SDL_x11touch.c */,
-				04BDFFD212E6671800899322 /* SDL_x11touch.h */,
-				04BDFFD312E6671800899322 /* SDL_x11video.c */,
-				04BDFFD412E6671800899322 /* SDL_x11video.h */,
-				04BDFFD512E6671800899322 /* SDL_x11window.c */,
-				04BDFFD612E6671800899322 /* SDL_x11window.h */,
-				AA628ACF159367F2005138DD /* SDL_x11xinput2.c */,
-				AA628AD0159367F2005138DD /* SDL_x11xinput2.h */,
-			);
-			path = x11;
-			sourceTree = "<group>";
-		};
-		0867D691FE84028FC02AAC07 /* SDLFramework */ = {
-			isa = PBXGroup;
-			children = (
-				F5A2EF3900C6A39A01000001 /* BUGS.txt */,
-				F5A2EF3A00C6A3C201000001 /* README-macosx.txt */,
-				F59C70FC00D5CB5801000001 /* pkg-support */,
-				0153844A006D81B07F000001 /* Public Headers */,
-				08FB77ACFE841707C02AAC07 /* Library Source */,
-				034768DDFF38A45A11DB9C8B /* Products */,
-				BECDF66B0761BA81005FE872 /* Info-Framework.plist */,
-				BEC562FE0761C0E800A33029 /* Linked Frameworks */,
-			);
-			comments = "To build Universal Binaries, we have experimented with a variety of different options.\nThe complication is that we must retain compatibility with at least 10.2. \nThe Universal Binary defaults only work for > 10.3.9\n\nSo far, we have found:\ngcc 4.0.0 with Xcode 2.1 always links against libgcc_s. gcc 4.0.1 from Xcode 2.2 fixes this problem.\n\nBut gcc 4.0 will not work with < 10.3.9 because we continue to get an undefined symbol to _fprintf$LDBL128.\nSo we must use gcc 3.3 on PPC to accomplish 10.2 support. (But 4.0 is required for i386.)\n\nSetting the deployment target to 10.4 will disable prebinding, so for PPC, we set it less than 10.4 to preserve prebinding for legacy support.\n\nSetting the PPC SDKROOT to /Developers/SDKs/MacOSX10.2.8.sdk will link to 63.0.0 libSystem.B.dylib. Leaving it at current or 10.4u links to 88.1.2. However, as long as we are using gcc 3.3, it doesn't seem to matter as testing has demonstrated both will run. We have decided not to invoke the 10.2.8 SDK because it is not a default installed component with Xcode which will probably cause most people problems. However, rather than deleting the SDKROOT_ppc entry entirely, we have mapped it to 10.4u in case we decide we need to change this setting.\n\nTo use Altivec or SSE, we needed architecture specific flags:\nOTHER_CFLAGS_ppc\nOTHER_CFLAGS_i386\nOTHER_CFLAGS=$(OTHER_CFLAGS_($CURRENT_ARCH))\n\nThe general OTHER_CFLAGS needed to be manually mapped to architecture specific options because Xcode didn't do this automatically for us.\n\n\n";
-			indentWidth = 4;
-			name = SDLFramework;
-			sourceTree = "<group>";
-			tabWidth = 4;
-			usesTabs = 0;
-		};
-		089C1665FE841158C02AAC07 /* Resources */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			name = Resources;
-			sourceTree = "<group>";
-		};
-		08FB77ACFE841707C02AAC07 /* Library Source */ = {
-			isa = PBXGroup;
-			children = (
-				04BDFD7312E6671700899322 /* atomic */,
-				04BDFD7612E6671700899322 /* audio */,
-				04BDFDD312E6671700899322 /* cpuinfo */,
-				04BDFDD512E6671700899322 /* events */,
-				567E2F1F17C44BBB005F1892 /* filesystem */,
-				04BDFDEC12E6671700899322 /* file */,
-				04BDFDF112E6671700899322 /* haptic */,
-				04BDFDFF12E6671700899322 /* joystick */,
-				04BDFE2F12E6671700899322 /* loadso */,
-				04BDFE4512E6671700899322 /* power */,
-				041B2C9712FA0D680087D585 /* render */,
-				04BDFE5D12E6671700899322 /* stdlib */,
-				04BDFE6412E6671800899322 /* thread */,
-				04BDFE9512E6671800899322 /* timer */,
-				04BDFEA712E6671800899322 /* video */,
-				04BDFE5512E6671700899322 /* SDL_assert_c.h */,
-				04BDFE5612E6671700899322 /* SDL_assert.c */,
-				04BDFE5812E6671700899322 /* SDL_error_c.h */,
-				04BDFE5912E6671700899322 /* SDL_error.c */,
-				0442EC5E12FE1C75004C9285 /* SDL_hints.c */,
-				04BAC0C71300C2160055DE28 /* SDL_log.c */,
-				04BDFE5C12E6671700899322 /* SDL.c */,
-			);
-			name = "Library Source";
-			sourceTree = "<group>";
-		};
-		567E2F1F17C44BBB005F1892 /* filesystem */ = {
-			isa = PBXGroup;
-			children = (
-				567E2F1B17C44BB2005F1892 /* SDL_sysfilesystem.m */,
-			);
-			name = filesystem;
-			sourceTree = "<group>";
-		};
-		BEC562FE0761C0E800A33029 /* Linked Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				00D0D08310675DD9004B05EF /* CoreFoundation.framework */,
-				007317C10858E15000B2BC32 /* Carbon.framework */,
-				0073179B0858DECD00B2BC32 /* AudioToolbox.framework */,
-				0073179C0858DECD00B2BC32 /* AudioUnit.framework */,
-				0073179D0858DECD00B2BC32 /* Cocoa.framework */,
-				0073179E0858DECD00B2BC32 /* CoreAudio.framework */,
-				0073179F0858DECD00B2BC32 /* IOKit.framework */,
-				007317A00858DECD00B2BC32 /* OpenGL.framework */,
-				00CFA89C106B4BA100758660 /* ForceFeedback.framework */,
-			);
-			name = "Linked Frameworks";
-			sourceTree = "<group>";
-		};
-		F59C70FC00D5CB5801000001 /* pkg-support */ = {
-			isa = PBXGroup;
-			children = (
-				F59C70FE00D5CB5801000001 /* devel-resources */,
-				F59C710100D5CB5801000001 /* resources */,
-				F5F81AD400D706B101000001 /* Readme SDL Developer.txt */,
-				F59C710500D5CB5801000001 /* SDL-devel.info */,
-				F59C710600D5CB5801000001 /* SDL.info */,
-			);
-			path = "pkg-support";
-			sourceTree = SOURCE_ROOT;
-		};
-		F59C70FE00D5CB5801000001 /* devel-resources */ = {
-			isa = PBXGroup;
-			children = (
-				F59C710C00D5D15801000001 /* install.sh */,
-				F59C70FF00D5CB5801000001 /* ReadMe.txt */,
-				F59C710000D5CB5801000001 /* Welcome.txt */,
-			);
-			path = "devel-resources";
-			sourceTree = "<group>";
-		};
-		F59C710100D5CB5801000001 /* resources */ = {
-			isa = PBXGroup;
-			children = (
-				00794D3F09D0C461003FC8A1 /* License.txt */,
-				00AE6E1E08B958CC00255E2F /* ReadMeDevLite.txt */,
-				F59C710300D5CB5801000001 /* ReadMe.txt */,
-			);
-			path = resources;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
-		BECDF5FF0761BA81005FE872 /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA7557FA1595D4D800BBD41B /* begin_code.h in Headers */,
-				AA7557FC1595D4D800BBD41B /* close_code.h in Headers */,
-				AA7557FE1595D4D800BBD41B /* SDL_assert.h in Headers */,
-				AA7558001595D4D800BBD41B /* SDL_atomic.h in Headers */,
-				AA7558021595D4D800BBD41B /* SDL_audio.h in Headers */,
-				AADA5B8716CCAB3000107CF7 /* SDL_bits.h in Headers */,
-				AA7558041595D4D800BBD41B /* SDL_blendmode.h in Headers */,
-				AA7558061595D4D800BBD41B /* SDL_clipboard.h in Headers */,
-				AA7558081595D4D800BBD41B /* SDL_config_macosx.h in Headers */,
-				AA75580A1595D4D800BBD41B /* SDL_config.h in Headers */,
-				AA75580C1595D4D800BBD41B /* SDL_copying.h in Headers */,
-				AA75580E1595D4D800BBD41B /* SDL_cpuinfo.h in Headers */,
-				AA7558101595D4D800BBD41B /* SDL_endian.h in Headers */,
-				AA7558121595D4D800BBD41B /* SDL_error.h in Headers */,
-				AA7558141595D4D800BBD41B /* SDL_events.h in Headers */,
-				567E2F2117C44C35005F1892 /* SDL_filesystem.h in Headers */,
-				A77E6EB4167AB0A90010E40B /* SDL_gamecontroller.h in Headers */,
-				AA7558161595D4D800BBD41B /* SDL_gesture.h in Headers */,
-				AA7558181595D4D800BBD41B /* SDL_haptic.h in Headers */,
-				AA75581A1595D4D800BBD41B /* SDL_hints.h in Headers */,
-				AA75581E1595D4D800BBD41B /* SDL_joystick.h in Headers */,
-				AA7558201595D4D800BBD41B /* SDL_keyboard.h in Headers */,
-				AA7558221595D4D800BBD41B /* SDL_keycode.h in Headers */,
-				AA7558241595D4D800BBD41B /* SDL_loadso.h in Headers */,
-				AA7558261595D4D800BBD41B /* SDL_log.h in Headers */,
-				AA7558281595D4D800BBD41B /* SDL_main.h in Headers */,
-				AA9FF95A1637CBF9000DF050 /* SDL_messagebox.h in Headers */,
-				AA75582A1595D4D800BBD41B /* SDL_mouse.h in Headers */,
-				AA75582C1595D4D800BBD41B /* SDL_mutex.h in Headers */,
-				AA75582E1595D4D800BBD41B /* SDL_name.h in Headers */,
-				AA7558301595D4D800BBD41B /* SDL_opengl.h in Headers */,
-				AA7558321595D4D800BBD41B /* SDL_opengles.h in Headers */,
-				AA7558341595D4D800BBD41B /* SDL_opengles2.h in Headers */,
-				AA7558361595D4D800BBD41B /* SDL_pixels.h in Headers */,
-				AA7558381595D4D800BBD41B /* SDL_platform.h in Headers */,
-				AA75583A1595D4D800BBD41B /* SDL_power.h in Headers */,
-				AA75583C1595D4D800BBD41B /* SDL_quit.h in Headers */,
-				AA75583E1595D4D800BBD41B /* SDL_rect.h in Headers */,
-				AA7558401595D4D800BBD41B /* SDL_render.h in Headers */,
-				AA7558421595D4D800BBD41B /* SDL_revision.h in Headers */,
-				AA7558441595D4D800BBD41B /* SDL_rwops.h in Headers */,
-				AA7558461595D4D800BBD41B /* SDL_scancode.h in Headers */,
-				AA7558481595D4D800BBD41B /* SDL_shape.h in Headers */,
-				AA75584A1595D4D800BBD41B /* SDL_stdinc.h in Headers */,
-				AA75584C1595D4D800BBD41B /* SDL_surface.h in Headers */,
-				AA75584E1595D4D800BBD41B /* SDL_system.h in Headers */,
-				AA7558501595D4D800BBD41B /* SDL_syswm.h in Headers */,
-				AA7558521595D4D800BBD41B /* SDL_thread.h in Headers */,
-				AA7558541595D4D800BBD41B /* SDL_timer.h in Headers */,
-				AA7558561595D4D800BBD41B /* SDL_touch.h in Headers */,
-				AA7558581595D4D800BBD41B /* SDL_types.h in Headers */,
-				AA75585A1595D4D800BBD41B /* SDL_version.h in Headers */,
-				AA75585C1595D4D800BBD41B /* SDL_video.h in Headers */,
-				AA75585E1595D4D800BBD41B /* SDL.h in Headers */,
-				04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */,
-				04BD001112E6671800899322 /* SDL_dummyaudio.h in Headers */,
-				04BD001912E6671800899322 /* SDL_coreaudio.h in Headers */,
-				04BD002712E6671800899322 /* SDL_audio_c.h in Headers */,
-				04BD002A12E6671800899322 /* SDL_audiodev_c.h in Headers */,
-				04BD002B12E6671800899322 /* SDL_audiomem.h in Headers */,
-				04BD003412E6671800899322 /* SDL_sysaudio.h in Headers */,
-				04BD003612E6671800899322 /* SDL_wave.h in Headers */,
-				04BD004212E6671800899322 /* blank_cursor.h in Headers */,
-				04BD004312E6671800899322 /* default_cursor.h in Headers */,
-				04BD004412E6671800899322 /* scancodes_darwin.h in Headers */,
-				04BD004512E6671800899322 /* scancodes_linux.h in Headers */,
-				04BD004712E6671800899322 /* scancodes_xfree86.h in Headers */,
-				04BD004912E6671800899322 /* SDL_clipboardevents_c.h in Headers */,
-				04BD004B12E6671800899322 /* SDL_events_c.h in Headers */,
-				04BD004D12E6671800899322 /* SDL_gesture_c.h in Headers */,
-				04BD004F12E6671800899322 /* SDL_keyboard_c.h in Headers */,
-				04BD005112E6671800899322 /* SDL_mouse_c.h in Headers */,
-				04BD005312E6671800899322 /* SDL_sysevents.h in Headers */,
-				04BD005512E6671800899322 /* SDL_touch_c.h in Headers */,
-				04BD005712E6671800899322 /* SDL_windowevents_c.h in Headers */,
-				04BD005812E6671800899322 /* SDL_rwopsbundlesupport.h in Headers */,
-				04BD006012E6671800899322 /* SDL_haptic_c.h in Headers */,
-				04BD006112E6671800899322 /* SDL_syshaptic.h in Headers */,
-				04BD006712E6671800899322 /* SDL_sysjoystick_c.h in Headers */,
-				04BD007112E6671800899322 /* SDL_joystick_c.h in Headers */,
-				04BD007212E6671800899322 /* SDL_sysjoystick.h in Headers */,
-				04BD009B12E6671800899322 /* SDL_assert_c.h in Headers */,
-				04BD009E12E6671800899322 /* SDL_error_c.h in Headers */,
-				04BD00BF12E6671800899322 /* SDL_sysmutex_c.h in Headers */,
-				04BD00C212E6671800899322 /* SDL_systhread_c.h in Headers */,
-				04BD00C912E6671800899322 /* SDL_systhread.h in Headers */,
-				04BD00CB12E6671800899322 /* SDL_thread_c.h in Headers */,
-				04BD00D812E6671800899322 /* SDL_timer_c.h in Headers */,
-				04BD00F312E6671800899322 /* SDL_cocoaclipboard.h in Headers */,
-				04BD00F512E6671800899322 /* SDL_cocoaevents.h in Headers */,
-				04BD00F712E6671800899322 /* SDL_cocoakeyboard.h in Headers */,
-				04BD00F912E6671800899322 /* SDL_cocoamodes.h in Headers */,
-				04BD00FB12E6671800899322 /* SDL_cocoamouse.h in Headers */,
-				04BD00FD12E6671800899322 /* SDL_cocoaopengl.h in Headers */,
-				04BD00FF12E6671800899322 /* SDL_cocoashape.h in Headers */,
-				04BD010112E6671800899322 /* SDL_cocoavideo.h in Headers */,
-				04BD010312E6671800899322 /* SDL_cocoawindow.h in Headers */,
-				04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */,
-				04BD011C12E6671800899322 /* SDL_nullvideo.h in Headers */,
-				04BD017612E6671800899322 /* SDL_blit.h in Headers */,
-				04BD017B12E6671800899322 /* SDL_blit_auto.h in Headers */,
-				04BD017D12E6671800899322 /* SDL_blit_copy.h in Headers */,
-				04BD018012E6671800899322 /* SDL_blit_slow.h in Headers */,
-				04BD018D12E6671800899322 /* SDL_pixels_c.h in Headers */,
-				04BD019712E6671800899322 /* SDL_RLEaccel_c.h in Headers */,
-				04BD019912E6671800899322 /* SDL_shape_internals.h in Headers */,
-				04BD019C12E6671800899322 /* SDL_sysvideo.h in Headers */,
-				04BD01DC12E6671800899322 /* imKStoUCS.h in Headers */,
-				04BD01DE12E6671800899322 /* SDL_x11clipboard.h in Headers */,
-				04BD01E012E6671800899322 /* SDL_x11dyn.h in Headers */,
-				04BD01E212E6671800899322 /* SDL_x11events.h in Headers */,
-				04BD01E612E6671800899322 /* SDL_x11keyboard.h in Headers */,
-				04BD01E812E6671800899322 /* SDL_x11modes.h in Headers */,
-				04BD01EA12E6671800899322 /* SDL_x11mouse.h in Headers */,
-				04BD01EC12E6671800899322 /* SDL_x11opengl.h in Headers */,
-				04BD01EE12E6671800899322 /* SDL_x11opengles.h in Headers */,
-				04BD01F212E6671800899322 /* SDL_x11shape.h in Headers */,
-				04BD01F312E6671800899322 /* SDL_x11sym.h in Headers */,
-				04BD01F512E6671800899322 /* SDL_x11touch.h in Headers */,
-				04BD01F712E6671800899322 /* SDL_x11video.h in Headers */,
-				04BD01F912E6671800899322 /* SDL_x11window.h in Headers */,
-				041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */,
-				04409B9112FA97ED00FB9AA8 /* mmx.h in Headers */,
-				04409B9312FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
-				04F7803912FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
-				04F7804A12FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */,
-				04F7804C12FB74A200FC43C0 /* SDL_blendline.h in Headers */,
-				04F7804E12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */,
-				04F7804F12FB74A200FC43C0 /* SDL_draw.h in Headers */,
-				04F7805112FB74A200FC43C0 /* SDL_drawline.h in Headers */,
-				04F7805312FB74A200FC43C0 /* SDL_drawpoint.h in Headers */,
-				0442EC1C12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */,
-				0442EC5B12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */,
-				04043BBB12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */,
-				0435673F1303160F00BA5428 /* SDL_shaders_gl.h in Headers */,
-				566CDE8F148F0AC200C5A9BB /* SDL_dropevents_c.h in Headers */,
-				AA628ACC159367B7005138DD /* SDL_rotate.h in Headers */,
-				AA628AD3159367F2005138DD /* SDL_x11xinput2.h in Headers */,
-				AABCC38D164063D200AB8930 /* SDL_cocoamessagebox.h in Headers */,
-				D55A1B81179F262300625D7C /* SDL_cocoamousetap.h in Headers */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BECDF66E0761BA81005FE872 /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB0F490B17CA57ED008798C5 /* SDL_filesystem.h in Headers */,
-				AA7557FB1595D4D800BBD41B /* begin_code.h in Headers */,
-				AA7557FD1595D4D800BBD41B /* close_code.h in Headers */,
-				AA75585F1595D4D800BBD41B /* SDL.h in Headers */,
-				AA7557FF1595D4D800BBD41B /* SDL_assert.h in Headers */,
-				AA7558011595D4D800BBD41B /* SDL_atomic.h in Headers */,
-				AA7558031595D4D800BBD41B /* SDL_audio.h in Headers */,
-				AADA5B8816CCAB3000107CF7 /* SDL_bits.h in Headers */,
-				AA7558051595D4D800BBD41B /* SDL_blendmode.h in Headers */,
-				AA7558071595D4D800BBD41B /* SDL_clipboard.h in Headers */,
-				AA75580B1595D4D800BBD41B /* SDL_config.h in Headers */,
-				AA7558091595D4D800BBD41B /* SDL_config_macosx.h in Headers */,
-				AA75580D1595D4D800BBD41B /* SDL_copying.h in Headers */,
-				AA75580F1595D4D800BBD41B /* SDL_cpuinfo.h in Headers */,
-				AA7558111595D4D800BBD41B /* SDL_endian.h in Headers */,
-				AA7558131595D4D800BBD41B /* SDL_error.h in Headers */,
-				AA7558151595D4D800BBD41B /* SDL_events.h in Headers */,
-				A77E6EB5167AB0A90010E40B /* SDL_gamecontroller.h in Headers */,
-				AA7558171595D4D800BBD41B /* SDL_gesture.h in Headers */,
-				AA7558191595D4D800BBD41B /* SDL_haptic.h in Headers */,
-				AA75581B1595D4D800BBD41B /* SDL_hints.h in Headers */,
-				AA75581F1595D4D800BBD41B /* SDL_joystick.h in Headers */,
-				AA7558211595D4D800BBD41B /* SDL_keyboard.h in Headers */,
-				AA7558231595D4D800BBD41B /* SDL_keycode.h in Headers */,
-				AA7558251595D4D800BBD41B /* SDL_loadso.h in Headers */,
-				AA7558271595D4D800BBD41B /* SDL_log.h in Headers */,
-				AA7558291595D4D800BBD41B /* SDL_main.h in Headers */,
-				DB0F489417C400ED008798C5 /* SDL_messagebox.h in Headers */,
-				AA75582B1595D4D800BBD41B /* SDL_mouse.h in Headers */,
-				AA75582D1595D4D800BBD41B /* SDL_mutex.h in Headers */,
-				AA75582F1595D4D800BBD41B /* SDL_name.h in Headers */,
-				AA7558311595D4D800BBD41B /* SDL_opengl.h in Headers */,
-				AA7558331595D4D800BBD41B /* SDL_opengles.h in Headers */,
-				AA7558351595D4D800BBD41B /* SDL_opengles2.h in Headers */,
-				AA7558371595D4D800BBD41B /* SDL_pixels.h in Headers */,
-				AA7558391595D4D800BBD41B /* SDL_platform.h in Headers */,
-				AA75583B1595D4D800BBD41B /* SDL_power.h in Headers */,
-				AA75583D1595D4D800BBD41B /* SDL_quit.h in Headers */,
-				AA75583F1595D4D800BBD41B /* SDL_rect.h in Headers */,
-				AA7558411595D4D800BBD41B /* SDL_render.h in Headers */,
-				AA7558431595D4D800BBD41B /* SDL_revision.h in Headers */,
-				AA7558451595D4D800BBD41B /* SDL_rwops.h in Headers */,
-				AA7558471595D4D800BBD41B /* SDL_scancode.h in Headers */,
-				AA7558491595D4D800BBD41B /* SDL_shape.h in Headers */,
-				AA75584B1595D4D800BBD41B /* SDL_stdinc.h in Headers */,
-				AA75584D1595D4D800BBD41B /* SDL_surface.h in Headers */,
-				AA75584F1595D4D800BBD41B /* SDL_system.h in Headers */,
-				AA7558511595D4D800BBD41B /* SDL_syswm.h in Headers */,
-				AA7558531595D4D800BBD41B /* SDL_thread.h in Headers */,
-				AA7558551595D4D800BBD41B /* SDL_timer.h in Headers */,
-				AA7558571595D4D800BBD41B /* SDL_touch.h in Headers */,
-				AA7558591595D4D800BBD41B /* SDL_types.h in Headers */,
-				AA75585B1595D4D800BBD41B /* SDL_version.h in Headers */,
-				AA75585D1595D4D800BBD41B /* SDL_video.h in Headers */,
-				04BD022512E6671800899322 /* SDL_diskaudio.h in Headers */,
-				04BD022D12E6671800899322 /* SDL_dummyaudio.h in Headers */,
-				04BD023512E6671800899322 /* SDL_coreaudio.h in Headers */,
-				04BD024312E6671800899322 /* SDL_audio_c.h in Headers */,
-				04BD024612E6671800899322 /* SDL_audiodev_c.h in Headers */,
-				04BD024712E6671800899322 /* SDL_audiomem.h in Headers */,
-				04BD025012E6671800899322 /* SDL_sysaudio.h in Headers */,
-				04BD025212E6671800899322 /* SDL_wave.h in Headers */,
-				04BD025D12E6671800899322 /* blank_cursor.h in Headers */,
-				04BD025E12E6671800899322 /* default_cursor.h in Headers */,
-				04BD025F12E6671800899322 /* scancodes_darwin.h in Headers */,
-				04BD026012E6671800899322 /* scancodes_linux.h in Headers */,
-				04BD026212E6671800899322 /* scancodes_xfree86.h in Headers */,
-				04BD026412E6671800899322 /* SDL_clipboardevents_c.h in Headers */,
-				04BD026612E6671800899322 /* SDL_events_c.h in Headers */,
-				04BD026812E6671800899322 /* SDL_gesture_c.h in Headers */,
-				04BD026A12E6671800899322 /* SDL_keyboard_c.h in Headers */,
-				04BD026C12E6671800899322 /* SDL_mouse_c.h in Headers */,
-				04BD026E12E6671800899322 /* SDL_sysevents.h in Headers */,
-				04BD027012E6671800899322 /* SDL_touch_c.h in Headers */,
-				04BD027212E6671800899322 /* SDL_windowevents_c.h in Headers */,
-				04BD027312E6671800899322 /* SDL_rwopsbundlesupport.h in Headers */,
-				04BD027B12E6671800899322 /* SDL_haptic_c.h in Headers */,
-				04BD027C12E6671800899322 /* SDL_syshaptic.h in Headers */,
-				04BD028212E6671800899322 /* SDL_sysjoystick_c.h in Headers */,
-				04BD028C12E6671800899322 /* SDL_joystick_c.h in Headers */,
-				04BD028D12E6671800899322 /* SDL_sysjoystick.h in Headers */,
-				04BD02B512E6671800899322 /* SDL_assert_c.h in Headers */,
-				04BD02B812E6671800899322 /* SDL_error_c.h in Headers */,
-				04BD02D912E6671800899322 /* SDL_sysmutex_c.h in Headers */,
-				04BD02DC12E6671800899322 /* SDL_systhread_c.h in Headers */,
-				04BD02E312E6671800899322 /* SDL_systhread.h in Headers */,
-				04BD02E512E6671800899322 /* SDL_thread_c.h in Headers */,
-				04BD02F212E6671800899322 /* SDL_timer_c.h in Headers */,
-				04BD030D12E6671800899322 /* SDL_cocoaclipboard.h in Headers */,
-				04BD030F12E6671800899322 /* SDL_cocoaevents.h in Headers */,
-				04BD031112E6671800899322 /* SDL_cocoakeyboard.h in Headers */,
-				04BD031312E6671800899322 /* SDL_cocoamodes.h in Headers */,
-				04BD031512E6671800899322 /* SDL_cocoamouse.h in Headers */,
-				04BD031712E6671800899322 /* SDL_cocoaopengl.h in Headers */,
-				04BD031912E6671800899322 /* SDL_cocoashape.h in Headers */,
-				04BD031B12E6671800899322 /* SDL_cocoavideo.h in Headers */,
-				04BD031D12E6671800899322 /* SDL_cocoawindow.h in Headers */,
-				04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */,
-				04BD033612E6671800899322 /* SDL_nullvideo.h in Headers */,
-				04BD039012E6671800899322 /* SDL_blit.h in Headers */,
-				04BD039512E6671800899322 /* SDL_blit_auto.h in Headers */,
-				04BD039712E6671800899322 /* SDL_blit_copy.h in Headers */,
-				04BD039A12E6671800899322 /* SDL_blit_slow.h in Headers */,
-				04BD03A712E6671800899322 /* SDL_pixels_c.h in Headers */,
-				04BD03B112E6671800899322 /* SDL_RLEaccel_c.h in Headers */,
-				04BD03B312E6671800899322 /* SDL_shape_internals.h in Headers */,
-				04BD03B612E6671800899322 /* SDL_sysvideo.h in Headers */,
-				04BD03F412E6671800899322 /* imKStoUCS.h in Headers */,
-				04BD03F612E6671800899322 /* SDL_x11clipboard.h in Headers */,
-				04BD03F812E6671800899322 /* SDL_x11dyn.h in Headers */,
-				04BD03FA12E6671800899322 /* SDL_x11events.h in Headers */,
-				04BD03FE12E6671800899322 /* SDL_x11keyboard.h in Headers */,
-				04BD040012E6671800899322 /* SDL_x11modes.h in Headers */,
-				04BD040212E6671800899322 /* SDL_x11mouse.h in Headers */,
-				04BD040412E6671800899322 /* SDL_x11opengl.h in Headers */,
-				04BD040612E6671800899322 /* SDL_x11opengles.h in Headers */,
-				04BD040A12E6671800899322 /* SDL_x11shape.h in Headers */,
-				04BD040B12E6671800899322 /* SDL_x11sym.h in Headers */,
-				04BD040D12E6671800899322 /* SDL_x11touch.h in Headers */,
-				04BD040F12E6671800899322 /* SDL_x11video.h in Headers */,
-				04BD041112E6671800899322 /* SDL_x11window.h in Headers */,
-				041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */,
-				04409B9512FA97ED00FB9AA8 /* mmx.h in Headers */,
-				04409B9712FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
-				04F7803B12FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
-				04F7805612FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */,
-				04F7805812FB74A200FC43C0 /* SDL_blendline.h in Headers */,
-				04F7805A12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */,
-				04F7805B12FB74A200FC43C0 /* SDL_draw.h in Headers */,
-				04F7805D12FB74A200FC43C0 /* SDL_drawline.h in Headers */,
-				04F7805F12FB74A200FC43C0 /* SDL_drawpoint.h in Headers */,
-				0442EC1E12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */,
-				0442EC5D12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */,
-				04043BBC12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */,
-				043567411303160F00BA5428 /* SDL_shaders_gl.h in Headers */,
-				AA628ACD159367B7005138DD /* SDL_rotate.h in Headers */,
-				AA628AD4159367F2005138DD /* SDL_x11xinput2.h in Headers */,
-				AABCC38E164063D200AB8930 /* SDL_cocoamessagebox.h in Headers */,
-				D55A1B85179F278E00625D7C /* SDL_cocoamousetap.h in Headers */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB313F7317554B71006C0E22 /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB0F490C17CA57ED008798C5 /* SDL_filesystem.h in Headers */,
-				DB313FC817554B71006C0E22 /* begin_code.h in Headers */,
-				DB313FC917554B71006C0E22 /* close_code.h in Headers */,
-				DB313FF917554B71006C0E22 /* SDL.h in Headers */,
-				DB313FCA17554B71006C0E22 /* SDL_assert.h in Headers */,
-				DB313FCB17554B71006C0E22 /* SDL_atomic.h in Headers */,
-				DB313FCC17554B71006C0E22 /* SDL_audio.h in Headers */,
-				DB313FFC17554B71006C0E22 /* SDL_bits.h in Headers */,
-				DB313FCD17554B71006C0E22 /* SDL_blendmode.h in Headers */,
-				DB313FCE17554B71006C0E22 /* SDL_clipboard.h in Headers */,
-				DB313FD017554B71006C0E22 /* SDL_config.h in Headers */,
-				DB313FCF17554B71006C0E22 /* SDL_config_macosx.h in Headers */,
-				DB313FD117554B71006C0E22 /* SDL_copying.h in Headers */,
-				DB313FD217554B71006C0E22 /* SDL_cpuinfo.h in Headers */,
-				DB313FD317554B71006C0E22 /* SDL_endian.h in Headers */,
-				DB313FD417554B71006C0E22 /* SDL_error.h in Headers */,
-				DB313FD517554B71006C0E22 /* SDL_events.h in Headers */,
-				DB313FFB17554B71006C0E22 /* SDL_gamecontroller.h in Headers */,
-				DB313FD617554B71006C0E22 /* SDL_gesture.h in Headers */,
-				DB313FD717554B71006C0E22 /* SDL_haptic.h in Headers */,
-				DB313FD817554B71006C0E22 /* SDL_hints.h in Headers */,
-				DB313FD917554B71006C0E22 /* SDL_joystick.h in Headers */,
-				DB313FDA17554B71006C0E22 /* SDL_keyboard.h in Headers */,
-				DB313FDB17554B71006C0E22 /* SDL_keycode.h in Headers */,
-				DB313FDC17554B71006C0E22 /* SDL_loadso.h in Headers */,
-				DB313FDD17554B71006C0E22 /* SDL_log.h in Headers */,
-				DB313FDE17554B71006C0E22 /* SDL_main.h in Headers */,
-				DB0F489317C400E6008798C5 /* SDL_messagebox.h in Headers */,
-				DB313FDF17554B71006C0E22 /* SDL_mouse.h in Headers */,
-				DB313FE017554B71006C0E22 /* SDL_mutex.h in Headers */,
-				DB313FE117554B71006C0E22 /* SDL_name.h in Headers */,
-				DB313FE217554B71006C0E22 /* SDL_opengl.h in Headers */,
-				DB313FE317554B71006C0E22 /* SDL_opengles.h in Headers */,
-				DB313FE417554B71006C0E22 /* SDL_opengles2.h in Headers */,
-				DB313FE517554B71006C0E22 /* SDL_pixels.h in Headers */,
-				DB313FE617554B71006C0E22 /* SDL_platform.h in Headers */,
-				DB313FE717554B71006C0E22 /* SDL_power.h in Headers */,
-				DB313FE817554B71006C0E22 /* SDL_quit.h in Headers */,
-				DB313FE917554B71006C0E22 /* SDL_rect.h in Headers */,
-				DB313FEA17554B71006C0E22 /* SDL_render.h in Headers */,
-				DB313FEB17554B71006C0E22 /* SDL_revision.h in Headers */,
-				DB313FEC17554B71006C0E22 /* SDL_rwops.h in Headers */,
-				DB313FED17554B71006C0E22 /* SDL_scancode.h in Headers */,
-				DB313FEE17554B71006C0E22 /* SDL_shape.h in Headers */,
-				DB313FEF17554B71006C0E22 /* SDL_stdinc.h in Headers */,
-				DB313FF017554B71006C0E22 /* SDL_surface.h in Headers */,
-				DB313FF117554B71006C0E22 /* SDL_system.h in Headers */,
-				DB313FF217554B71006C0E22 /* SDL_syswm.h in Headers */,
-				DB313FF317554B71006C0E22 /* SDL_thread.h in Headers */,
-				DB313FF417554B71006C0E22 /* SDL_timer.h in Headers */,
-				DB313FF517554B71006C0E22 /* SDL_touch.h in Headers */,
-				DB313FF617554B71006C0E22 /* SDL_types.h in Headers */,
-				DB313FF717554B71006C0E22 /* SDL_version.h in Headers */,
-				DB313FF817554B71006C0E22 /* SDL_video.h in Headers */,
-				DB313F7417554B71006C0E22 /* SDL_diskaudio.h in Headers */,
-				DB313F7517554B71006C0E22 /* SDL_dummyaudio.h in Headers */,
-				DB313F7617554B71006C0E22 /* SDL_coreaudio.h in Headers */,
-				DB313F7717554B71006C0E22 /* SDL_audio_c.h in Headers */,
-				DB313F7817554B71006C0E22 /* SDL_audiodev_c.h in Headers */,
-				DB313F7917554B71006C0E22 /* SDL_audiomem.h in Headers */,
-				DB313F7A17554B71006C0E22 /* SDL_sysaudio.h in Headers */,
-				DB313F7B17554B71006C0E22 /* SDL_wave.h in Headers */,
-				DB313F7C17554B71006C0E22 /* blank_cursor.h in Headers */,
-				DB313F7D17554B71006C0E22 /* default_cursor.h in Headers */,
-				DB313F7E17554B71006C0E22 /* scancodes_darwin.h in Headers */,
-				DB313F7F17554B71006C0E22 /* scancodes_linux.h in Headers */,
-				DB313F8017554B71006C0E22 /* scancodes_xfree86.h in Headers */,
-				DB313F8117554B71006C0E22 /* SDL_clipboardevents_c.h in Headers */,
-				DB313F8217554B71006C0E22 /* SDL_events_c.h in Headers */,
-				DB313F8317554B71006C0E22 /* SDL_gesture_c.h in Headers */,
-				DB313F8417554B71006C0E22 /* SDL_keyboard_c.h in Headers */,
-				DB313F8517554B71006C0E22 /* SDL_mouse_c.h in Headers */,
-				DB313F8617554B71006C0E22 /* SDL_sysevents.h in Headers */,
-				DB313F8717554B71006C0E22 /* SDL_touch_c.h in Headers */,
-				DB313F8817554B71006C0E22 /* SDL_windowevents_c.h in Headers */,
-				DB313F8917554B71006C0E22 /* SDL_rwopsbundlesupport.h in Headers */,
-				DB313F8A17554B71006C0E22 /* SDL_haptic_c.h in Headers */,
-				DB313F8B17554B71006C0E22 /* SDL_syshaptic.h in Headers */,
-				DB313F8C17554B71006C0E22 /* SDL_sysjoystick_c.h in Headers */,
-				DB313F8D17554B71006C0E22 /* SDL_joystick_c.h in Headers */,
-				DB313F8E17554B71006C0E22 /* SDL_sysjoystick.h in Headers */,
-				DB313F8F17554B71006C0E22 /* SDL_assert_c.h in Headers */,
-				DB313F9017554B71006C0E22 /* SDL_error_c.h in Headers */,
-				DB313F9217554B71006C0E22 /* SDL_sysmutex_c.h in Headers */,
-				DB313F9317554B71006C0E22 /* SDL_systhread_c.h in Headers */,
-				DB313F9417554B71006C0E22 /* SDL_systhread.h in Headers */,
-				DB313F9517554B71006C0E22 /* SDL_thread_c.h in Headers */,
-				DB313F9617554B71006C0E22 /* SDL_timer_c.h in Headers */,
-				DB313F9717554B71006C0E22 /* SDL_cocoaclipboard.h in Headers */,
-				DB313F9817554B71006C0E22 /* SDL_cocoaevents.h in Headers */,
-				DB313F9917554B71006C0E22 /* SDL_cocoakeyboard.h in Headers */,
-				DB313F9A17554B71006C0E22 /* SDL_cocoamodes.h in Headers */,
-				DB313F9B17554B71006C0E22 /* SDL_cocoamouse.h in Headers */,
-				DB313F9C17554B71006C0E22 /* SDL_cocoaopengl.h in Headers */,
-				DB313F9D17554B71006C0E22 /* SDL_cocoashape.h in Headers */,
-				DB313F9E17554B71006C0E22 /* SDL_cocoavideo.h in Headers */,
-				DB313F9F17554B71006C0E22 /* SDL_cocoawindow.h in Headers */,
-				DB313FA017554B71006C0E22 /* SDL_nullevents_c.h in Headers */,
-				DB313FA117554B71006C0E22 /* SDL_nullvideo.h in Headers */,
-				DB313FA217554B71006C0E22 /* SDL_blit.h in Headers */,
-				DB313FA317554B71006C0E22 /* SDL_blit_auto.h in Headers */,
-				DB313FA417554B71006C0E22 /* SDL_blit_copy.h in Headers */,
-				DB313FA517554B71006C0E22 /* SDL_blit_slow.h in Headers */,
-				DB313FA617554B71006C0E22 /* SDL_pixels_c.h in Headers */,
-				DB313FA717554B71006C0E22 /* SDL_RLEaccel_c.h in Headers */,
-				DB313FA817554B71006C0E22 /* SDL_shape_internals.h in Headers */,
-				DB313FA917554B71006C0E22 /* SDL_sysvideo.h in Headers */,
-				DB313FAA17554B71006C0E22 /* imKStoUCS.h in Headers */,
-				DB313FAB17554B71006C0E22 /* SDL_x11clipboard.h in Headers */,
-				DB313FAC17554B71006C0E22 /* SDL_x11dyn.h in Headers */,
-				DB313FAD17554B71006C0E22 /* SDL_x11events.h in Headers */,
-				DB313FAE17554B71006C0E22 /* SDL_x11keyboard.h in Headers */,
-				DB313FAF17554B71006C0E22 /* SDL_x11modes.h in Headers */,
-				DB313FB017554B71006C0E22 /* SDL_x11mouse.h in Headers */,
-				DB313FB117554B71006C0E22 /* SDL_x11opengl.h in Headers */,
-				DB313FB217554B71006C0E22 /* SDL_x11opengles.h in Headers */,
-				DB313FB317554B71006C0E22 /* SDL_x11shape.h in Headers */,
-				DB313FB417554B71006C0E22 /* SDL_x11sym.h in Headers */,
-				DB313FB517554B71006C0E22 /* SDL_x11touch.h in Headers */,
-				DB313FB617554B71006C0E22 /* SDL_x11video.h in Headers */,
-				DB313FB717554B71006C0E22 /* SDL_x11window.h in Headers */,
-				DB313FB817554B71006C0E22 /* SDL_sysrender.h in Headers */,
-				DB313FB917554B71006C0E22 /* mmx.h in Headers */,
-				DB313FBA17554B71006C0E22 /* SDL_yuv_sw_c.h in Headers */,
-				DB313FBB17554B71006C0E22 /* SDL_nullframebuffer_c.h in Headers */,
-				DB313FBC17554B71006C0E22 /* SDL_blendfillrect.h in Headers */,
-				DB313FBD17554B71006C0E22 /* SDL_blendline.h in Headers */,
-				DB313FBE17554B71006C0E22 /* SDL_blendpoint.h in Headers */,
-				DB313FBF17554B71006C0E22 /* SDL_draw.h in Headers */,
-				DB313FC017554B71006C0E22 /* SDL_drawline.h in Headers */,
-				DB313FC117554B71006C0E22 /* SDL_drawpoint.h in Headers */,
-				DB313FC217554B71006C0E22 /* SDL_render_sw_c.h in Headers */,
-				DB313FC317554B71006C0E22 /* SDL_x11framebuffer.h in Headers */,
-				DB313FC417554B71006C0E22 /* SDL_glfuncs.h in Headers */,
-				DB313FC517554B71006C0E22 /* SDL_shaders_gl.h in Headers */,
-				DB313FC617554B71006C0E22 /* SDL_rotate.h in Headers */,
-				DB313FC717554B71006C0E22 /* SDL_x11xinput2.h in Headers */,
-				DB313FFA17554B71006C0E22 /* SDL_cocoamessagebox.h in Headers */,
-				D55A1B86179F278F00625D7C /* SDL_cocoamousetap.h in Headers */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
-		BECDF5FE0761BA81005FE872 /* Framework */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */;
-			buildPhases = (
-				BECDF5FF0761BA81005FE872 /* Headers */,
-				BECDF62A0761BA81005FE872 /* Resources */,
-				BECDF62C0761BA81005FE872 /* Sources */,
-				BECDF6680761BA81005FE872 /* Frameworks */,
-				AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */,
-			);
-			buildRules = (
-			);
-			comments = "We recommend installing to /Library/Frameworks\nAn alternative is $(HOME)/Library/Frameworks for per-user if permissions are an issue.\n\nAdd the framework to the Groups & Files panel (under Linked Frameworks is a good place) and enable the check box for the targets that need to link to it. You can also manually add \"-framework SDL\" to your linker flags if you don't like the check box system.\n\nAdd /Library/Frameworks/SDL.framework/Headers to your header search path\nAdd /Library/Frameworks to your library search path\n(Adjust the two above if installed in $(HOME)/Library/Frameworks. You can also list both paths if you want robustness.)\n\nWe used to use an exports file. It was becoming a maintenance issue we kept neglecting, so we have removed it. If you need it back, set the \"Exported Symbols File\" option to:\n../../src/main/macosx/exports/SDL.x\n(You may need to regenerate the exports list. There is a Makefile in that directory that you can run from the command line to rebuild it.)\nLong term, we want to utilize gcc 4.0's new visibility feature (analogous to declspec on Windows). Other platforms would benefit from this change too. The downside is that we still use gcc 3.3 for the PowerPC build here so only our x86 builds will cull the symbols if we go down this route (and don't use the exports file).\n\n";
-			dependencies = (
-			);
-			name = Framework;
-			productInstallPath = "@executable_path/../Frameworks";
-			productName = SDL;
-			productReference = BECDF66C0761BA81005FE872 /* SDL2.framework */;
-			productType = "com.apple.product-type.framework";
-		};
-		BECDF66D0761BA81005FE872 /* Static Library */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 0073177E0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Static Library" */;
-			buildPhases = (
-				BECDF66E0761BA81005FE872 /* Headers */,
-				BECDF6790761BA81005FE872 /* Sources */,
-				BECDF6B10761BA81005FE872 /* Frameworks */,
-				BECDF6B20761BA81005FE872 /* Rez */,
-			);
-			buildRules = (
-			);
-			comments = "This produces libsdl.a, which is the static build of SDL. You will have to link to the Cocoa and OpenGL frameworks in your application.";
-			dependencies = (
-			);
-			name = "Static Library";
-			productInstallPath = /usr/local/lib;
-			productName = "Static Library";
-			productReference = BECDF6B30761BA81005FE872 /* libSDL2.a */;
-			productType = "com.apple.product-type.library.static";
-		};
-		BECDF6BB0761BA81005FE872 /* Standard DMG */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 007317860858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Standard DMG" */;
-			buildPhases = (
-				BECDF6BD0761BA81005FE872 /* ShellScript */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-				BECDF6C60761BA81005FE872 /* PBXTargetDependency */,
-			);
-			name = "Standard DMG";
-			productInstallPath = /usr/local/bin;
-			productName = "Standard Package";
-			productReference = BECDF6BE0761BA81005FE872 /* Standard DMG */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB313F7217554B71006C0E22 /* Shared Library */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB31407417554B71006C0E22 /* Build configuration list for PBXNativeTarget "Shared Library" */;
-			buildPhases = (
-				DB313F7317554B71006C0E22 /* Headers */,
-				DB313FFD17554B71006C0E22 /* Sources */,
-				DB31406B17554B71006C0E22 /* Frameworks */,
-				DB31407317554B71006C0E22 /* Rez */,
-			);
-			buildRules = (
-			);
-			comments = "This produces libSDL2.dylib, which is the shared build of SDL.";
-			dependencies = (
-			);
-			name = "Shared Library";
-			productInstallPath = /usr/local/lib;
-			productName = "Shared Library";
-			productReference = DB31407717554B71006C0E22 /* libSDL2.dylib */;
-			productType = "com.apple.product-type.library.dynamic";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		0867D690FE84028FC02AAC07 /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				LastUpgradeCheck = 0420;
-			};
-			buildConfigurationList = 0073178E0858DB0500B2BC32 /* Build configuration list for PBXProject "SDL" */;
-			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
-			hasScannedForEncodings = 1;
-			knownRegions = (
-				English,
-				Japanese,
-				French,
-				German,
-			);
-			mainGroup = 0867D691FE84028FC02AAC07 /* SDLFramework */;
-			productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				BECDF5FE0761BA81005FE872 /* Framework */,
-				BECDF66D0761BA81005FE872 /* Static Library */,
-				DB313F7217554B71006C0E22 /* Shared Library */,
-				BECDF6BB0761BA81005FE872 /* Standard DMG */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-		BECDF62A0761BA81005FE872 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXRezBuildPhase section */
-		BECDF6B20761BA81005FE872 /* Rez */ = {
-			isa = PBXRezBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB31407317554B71006C0E22 /* Rez */ = {
-			isa = PBXRezBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXRezBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
-		AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			name = "Sign Frameworks";
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "if [ \"$USER\" = \"slouken\" ]; then\n    CODE_SIGN_IDENTITY=\"Mac Developer: Sam Lantinga (84TP7N5TA4)\" pkg-support/codesign-frameworks.sh || exit 1\nfi";
-		};
-		BECDF6BD0761BA81005FE872 /* ShellScript */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 12;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\nxcrun CpMac -r $TARGET_BUILD_DIR/SDL2.framework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL2 -srcfolder build/dmg-tmp build/SDL2.dmg\n\n# clean up\nrm -rf build/dmg-tmp";
-		};
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		BECDF62C0761BA81005FE872 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				04BDFFFB12E6671800899322 /* SDL_atomic.c in Sources */,
-				04BDFFFC12E6671800899322 /* SDL_spinlock.c in Sources */,
-				04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */,
-				04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */,
-				04BD001812E6671800899322 /* SDL_coreaudio.c in Sources */,
-				04BD002612E6671800899322 /* SDL_audio.c in Sources */,
-				04BD002812E6671800899322 /* SDL_audiocvt.c in Sources */,
-				04BD002912E6671800899322 /* SDL_audiodev.c in Sources */,
-				04BD002C12E6671800899322 /* SDL_audiotypecvt.c in Sources */,
-				04BD002D12E6671800899322 /* SDL_mixer.c in Sources */,
-				04BD003512E6671800899322 /* SDL_wave.c in Sources */,
-				04BD004112E6671800899322 /* SDL_cpuinfo.c in Sources */,
-				04BD004812E6671800899322 /* SDL_clipboardevents.c in Sources */,
-				04BD004A12E6671800899322 /* SDL_events.c in Sources */,
-				04BD004C12E6671800899322 /* SDL_gesture.c in Sources */,
-				04BD004E12E6671800899322 /* SDL_keyboard.c in Sources */,
-				04BD005012E6671800899322 /* SDL_mouse.c in Sources */,
-				04BD005212E6671800899322 /* SDL_quit.c in Sources */,
-				04BD005412E6671800899322 /* SDL_touch.c in Sources */,
-				04BD005612E6671800899322 /* SDL_windowevents.c in Sources */,
-				04BD005912E6671800899322 /* SDL_rwopsbundlesupport.m in Sources */,
-				04BD005A12E6671800899322 /* SDL_rwops.c in Sources */,
-				04BD005B12E6671800899322 /* SDL_syshaptic.c in Sources */,
-				04BD005F12E6671800899322 /* SDL_haptic.c in Sources */,
-				04BD006612E6671800899322 /* SDL_sysjoystick.c in Sources */,
-				04BD007012E6671800899322 /* SDL_joystick.c in Sources */,
-				04BD008812E6671800899322 /* SDL_sysloadso.c in Sources */,
-				04BD009412E6671800899322 /* SDL_syspower.c in Sources */,
-				04BD009612E6671800899322 /* SDL_power.c in Sources */,
-				04BD009C12E6671800899322 /* SDL_assert.c in Sources */,
-				04BD009F12E6671800899322 /* SDL_error.c in Sources */,
-				04BD00A212E6671800899322 /* SDL.c in Sources */,
-				04BD00A312E6671800899322 /* SDL_getenv.c in Sources */,
-				04BD00A412E6671800899322 /* SDL_iconv.c in Sources */,
-				04BD00A512E6671800899322 /* SDL_malloc.c in Sources */,
-				04BD00A612E6671800899322 /* SDL_qsort.c in Sources */,
-				04BD00A712E6671800899322 /* SDL_stdlib.c in Sources */,
-				04BD00A812E6671800899322 /* SDL_string.c in Sources */,
-				04BD00BD12E6671800899322 /* SDL_syscond.c in Sources */,
-				04BD00BE12E6671800899322 /* SDL_sysmutex.c in Sources */,
-				04BD00C012E6671800899322 /* SDL_syssem.c in Sources */,
-				04BD00C112E6671800899322 /* SDL_systhread.c in Sources */,
-				04BD00CA12E6671800899322 /* SDL_thread.c in Sources */,
-				04BD00D712E6671800899322 /* SDL_timer.c in Sources */,
-				04BD00D912E6671800899322 /* SDL_systimer.c in Sources */,
-				04BD00F412E6671800899322 /* SDL_cocoaclipboard.m in Sources */,
-				04BD00F612E6671800899322 /* SDL_cocoaevents.m in Sources */,
-				04BD00F812E6671800899322 /* SDL_cocoakeyboard.m in Sources */,
-				04BD00FA12E6671800899322 /* SDL_cocoamodes.m in Sources */,
-				04BD00FC12E6671800899322 /* SDL_cocoamouse.m in Sources */,
-				04BD00FE12E6671800899322 /* SDL_cocoaopengl.m in Sources */,
-				04BD010012E6671800899322 /* SDL_cocoashape.m in Sources */,
-				04BD010212E6671800899322 /* SDL_cocoavideo.m in Sources */,
-				04BD010412E6671800899322 /* SDL_cocoawindow.m in Sources */,
-				04BD011712E6671800899322 /* SDL_nullevents.c in Sources */,
-				04BD011B12E6671800899322 /* SDL_nullvideo.c in Sources */,
-				04BD017512E6671800899322 /* SDL_blit.c in Sources */,
-				04BD017712E6671800899322 /* SDL_blit_0.c in Sources */,
-				04BD017812E6671800899322 /* SDL_blit_1.c in Sources */,
-				04BD017912E6671800899322 /* SDL_blit_A.c in Sources */,
-				04BD017A12E6671800899322 /* SDL_blit_auto.c in Sources */,
-				04BD017C12E6671800899322 /* SDL_blit_copy.c in Sources */,
-				04BD017E12E6671800899322 /* SDL_blit_N.c in Sources */,
-				04BD017F12E6671800899322 /* SDL_blit_slow.c in Sources */,
-				04BD018112E6671800899322 /* SDL_bmp.c in Sources */,
-				04BD018212E6671800899322 /* SDL_clipboard.c in Sources */,
-				04BD018712E6671800899322 /* SDL_fillrect.c in Sources */,
-				04BD018C12E6671800899322 /* SDL_pixels.c in Sources */,
-				04BD018E12E6671800899322 /* SDL_rect.c in Sources */,
-				04BD019612E6671800899322 /* SDL_RLEaccel.c in Sources */,
-				04BD019812E6671800899322 /* SDL_shape.c in Sources */,
-				04BD019A12E6671800899322 /* SDL_stretch.c in Sources */,
-				04BD019B12E6671800899322 /* SDL_surface.c in Sources */,
-				04BD019D12E6671800899322 /* SDL_video.c in Sources */,
-				04BD01DB12E6671800899322 /* imKStoUCS.c in Sources */,
-				04BD01DD12E6671800899322 /* SDL_x11clipboard.c in Sources */,
-				04BD01DF12E6671800899322 /* SDL_x11dyn.c in Sources */,
-				04BD01E112E6671800899322 /* SDL_x11events.c in Sources */,
-				04BD01E512E6671800899322 /* SDL_x11keyboard.c in Sources */,
-				04BD01E712E6671800899322 /* SDL_x11modes.c in Sources */,
-				04BD01E912E6671800899322 /* SDL_x11mouse.c in Sources */,
-				04BD01EB12E6671800899322 /* SDL_x11opengl.c in Sources */,
-				04BD01ED12E6671800899322 /* SDL_x11opengles.c in Sources */,
-				04BD01F112E6671800899322 /* SDL_x11shape.c in Sources */,
-				04BD01F412E6671800899322 /* SDL_x11touch.c in Sources */,
-				04BD01F612E6671800899322 /* SDL_x11video.c in Sources */,
-				04BD01F812E6671800899322 /* SDL_x11window.c in Sources */,
-				041B2CA512FA0D680087D585 /* SDL_render.c in Sources */,
-				04409B9212FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */,
-				04409B9412FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */,
-				04F7803A12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */,
-				04F7804912FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */,
-				04F7804B12FB74A200FC43C0 /* SDL_blendline.c in Sources */,
-				04F7804D12FB74A200FC43C0 /* SDL_blendpoint.c in Sources */,
-				04F7805012FB74A200FC43C0 /* SDL_drawline.c in Sources */,
-				04F7805212FB74A200FC43C0 /* SDL_drawpoint.c in Sources */,
-				0442EC1812FE1BBA004C9285 /* SDL_render_gl.c in Sources */,
-				0442EC1D12FE1BCB004C9285 /* SDL_render_sw.c in Sources */,
-				0442EC5A12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */,
-				0442EC5F12FE1C75004C9285 /* SDL_hints.c in Sources */,
-				04BAC0C81300C2160055DE28 /* SDL_log.c in Sources */,
-				0435673E1303160F00BA5428 /* SDL_shaders_gl.c in Sources */,
-				566CDE90148F0AC200C5A9BB /* SDL_dropevents.c in Sources */,
-				AA628ACA159367B7005138DD /* SDL_rotate.c in Sources */,
-				AA628AD1159367F2005138DD /* SDL_x11xinput2.c in Sources */,
-				AA9E4093163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */,
-				AABCC38F164063D200AB8930 /* SDL_cocoamessagebox.m in Sources */,
-				AA0AD09D16648D1700CE5896 /* SDL_gamecontroller.c in Sources */,
-				AA0F8491178D5ECC00823F9D /* SDL_systls.c in Sources */,
-				D55A1B82179F262300625D7C /* SDL_cocoamousetap.m in Sources */,
-				567E2F1C17C44BB2005F1892 /* SDL_sysfilesystem.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BECDF6790761BA81005FE872 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				04BD021712E6671800899322 /* SDL_atomic.c in Sources */,
-				04BD021812E6671800899322 /* SDL_spinlock.c in Sources */,
-				04BD022412E6671800899322 /* SDL_diskaudio.c in Sources */,
-				04BD022C12E6671800899322 /* SDL_dummyaudio.c in Sources */,
-				04BD023412E6671800899322 /* SDL_coreaudio.c in Sources */,
-				04BD024212E6671800899322 /* SDL_audio.c in Sources */,
-				04BD024412E6671800899322 /* SDL_audiocvt.c in Sources */,
-				04BD024512E6671800899322 /* SDL_audiodev.c in Sources */,
-				04BD024812E6671800899322 /* SDL_audiotypecvt.c in Sources */,
-				04BD024912E6671800899322 /* SDL_mixer.c in Sources */,
-				04BD025112E6671800899322 /* SDL_wave.c in Sources */,
-				04BD025C12E6671800899322 /* SDL_cpuinfo.c in Sources */,
-				04BD026312E6671800899322 /* SDL_clipboardevents.c in Sources */,
-				04BD026512E6671800899322 /* SDL_events.c in Sources */,
-				AA41F88014B8F1F500993C4F /* SDL_dropevents.c in Sources */,
-				04BD026712E6671800899322 /* SDL_gesture.c in Sources */,
-				04BD026912E6671800899322 /* SDL_keyboard.c in Sources */,
-				04BD026B12E6671800899322 /* SDL_mouse.c in Sources */,
-				04BD026D12E6671800899322 /* SDL_quit.c in Sources */,
-				04BD026F12E6671800899322 /* SDL_touch.c in Sources */,
-				04BD027112E6671800899322 /* SDL_windowevents.c in Sources */,
-				04BD027412E6671800899322 /* SDL_rwopsbundlesupport.m in Sources */,
-				04BD027512E6671800899322 /* SDL_rwops.c in Sources */,
-				04BD027612E6671800899322 /* SDL_syshaptic.c in Sources */,
-				04BD027A12E6671800899322 /* SDL_haptic.c in Sources */,
-				04BD028112E6671800899322 /* SDL_sysjoystick.c in Sources */,
-				BBFC088D164C6647003E6A99 /* SDL_gamecontroller.c in Sources */,
-				04BD028B12E6671800899322 /* SDL_joystick.c in Sources */,
-				04BD02A312E6671800899322 /* SDL_sysloadso.c in Sources */,
-				04BD02AE12E6671800899322 /* SDL_syspower.c in Sources */,
-				04BD02B012E6671800899322 /* SDL_power.c in Sources */,
-				04BD02B612E6671800899322 /* SDL_assert.c in Sources */,
-				04BD02B912E6671800899322 /* SDL_error.c in Sources */,
-				04BD02BC12E6671800899322 /* SDL.c in Sources */,
-				04BD02BD12E6671800899322 /* SDL_getenv.c in Sources */,
-				04BD02BE12E6671800899322 /* SDL_iconv.c in Sources */,
-				04BD02BF12E6671800899322 /* SDL_malloc.c in Sources */,
-				04BD02C012E6671800899322 /* SDL_qsort.c in Sources */,
-				04BD02C112E6671800899322 /* SDL_stdlib.c in Sources */,
-				04BD02C212E6671800899322 /* SDL_string.c in Sources */,
-				04BD02D712E6671800899322 /* SDL_syscond.c in Sources */,
-				04BD02D812E6671800899322 /* SDL_sysmutex.c in Sources */,
-				04BD02DA12E6671800899322 /* SDL_syssem.c in Sources */,
-				04BD02DB12E6671800899322 /* SDL_systhread.c in Sources */,
-				04BD02E412E6671800899322 /* SDL_thread.c in Sources */,
-				04BD02F112E6671800899322 /* SDL_timer.c in Sources */,
-				04BD02F312E6671800899322 /* SDL_systimer.c in Sources */,
-				04BD030E12E6671800899322 /* SDL_cocoaclipboard.m in Sources */,
-				04BD031012E6671800899322 /* SDL_cocoaevents.m in Sources */,
-				04BD031212E6671800899322 /* SDL_cocoakeyboard.m in Sources */,
-				04BD031412E6671800899322 /* SDL_cocoamodes.m in Sources */,
-				04BD031612E6671800899322 /* SDL_cocoamouse.m in Sources */,
-				04BD031812E6671800899322 /* SDL_cocoaopengl.m in Sources */,
-				04BD031A12E6671800899322 /* SDL_cocoashape.m in Sources */,
-				04BD031C12E6671800899322 /* SDL_cocoavideo.m in Sources */,
-				04BD031E12E6671800899322 /* SDL_cocoawindow.m in Sources */,
-				04BD033112E6671800899322 /* SDL_nullevents.c in Sources */,
-				04BD033512E6671800899322 /* SDL_nullvideo.c in Sources */,
-				04BD038F12E6671800899322 /* SDL_blit.c in Sources */,
-				04BD039112E6671800899322 /* SDL_blit_0.c in Sources */,
-				04BD039212E6671800899322 /* SDL_blit_1.c in Sources */,
-				04BD039312E6671800899322 /* SDL_blit_A.c in Sources */,
-				04BD039412E6671800899322 /* SDL_blit_auto.c in Sources */,
-				04BD039612E6671800899322 /* SDL_blit_copy.c in Sources */,
-				04BD039812E6671800899322 /* SDL_blit_N.c in Sources */,
-				04BD039912E6671800899322 /* SDL_blit_slow.c in Sources */,
-				04BD039B12E6671800899322 /* SDL_bmp.c in Sources */,
-				04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */,
-				04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */,
-				04BD03A612E6671800899322 /* SDL_pixels.c in Sources */,
-				04BD03A812E6671800899322 /* SDL_rect.c in Sources */,
-				04BD03B012E6671800899322 /* SDL_RLEaccel.c in Sources */,
-				04BD03B212E6671800899322 /* SDL_shape.c in Sources */,
-				04BD03B412E6671800899322 /* SDL_stretch.c in Sources */,
-				04BD03B512E6671800899322 /* SDL_surface.c in Sources */,
-				04BD03B712E6671800899322 /* SDL_video.c in Sources */,
-				04BD03F312E6671800899322 /* imKStoUCS.c in Sources */,
-				04BD03F512E6671800899322 /* SDL_x11clipboard.c in Sources */,
-				04BD03F712E6671800899322 /* SDL_x11dyn.c in Sources */,
-				04BD03F912E6671800899322 /* SDL_x11events.c in Sources */,
-				04BD03FD12E6671800899322 /* SDL_x11keyboard.c in Sources */,
-				04BD03FF12E6671800899322 /* SDL_x11modes.c in Sources */,
-				04BD040112E6671800899322 /* SDL_x11mouse.c in Sources */,
-				04BD040312E6671800899322 /* SDL_x11opengl.c in Sources */,
-				04BD040512E6671800899322 /* SDL_x11opengles.c in Sources */,
-				04BD040912E6671800899322 /* SDL_x11shape.c in Sources */,
-				04BD040C12E6671800899322 /* SDL_x11touch.c in Sources */,
-				04BD040E12E6671800899322 /* SDL_x11video.c in Sources */,
-				04BD041012E6671800899322 /* SDL_x11window.c in Sources */,
-				041B2CAB12FA0D680087D585 /* SDL_render.c in Sources */,
-				04409B9612FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */,
-				04409B9812FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */,
-				04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */,
-				04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */,
-				04F7805712FB74A200FC43C0 /* SDL_blendline.c in Sources */,
-				04F7805912FB74A200FC43C0 /* SDL_blendpoint.c in Sources */,
-				04F7805C12FB74A200FC43C0 /* SDL_drawline.c in Sources */,
-				04F7805E12FB74A200FC43C0 /* SDL_drawpoint.c in Sources */,
-				0442EC1912FE1BBA004C9285 /* SDL_render_gl.c in Sources */,
-				0442EC1F12FE1BCB004C9285 /* SDL_render_sw.c in Sources */,
-				0442EC5C12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */,
-				0442EC6012FE1C75004C9285 /* SDL_hints.c in Sources */,
-				04BAC0C91300C2160055DE28 /* SDL_log.c in Sources */,
-				043567401303160F00BA5428 /* SDL_shaders_gl.c in Sources */,
-				AA628ACB159367B7005138DD /* SDL_rotate.c in Sources */,
-				AA628AD2159367F2005138DD /* SDL_x11xinput2.c in Sources */,
-				AA9E4094163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */,
-				AABCC390164063D200AB8930 /* SDL_cocoamessagebox.m in Sources */,
-				AA0F8492178D5ECC00823F9D /* SDL_systls.c in Sources */,
-				D55A1B84179F263600625D7C /* SDL_cocoamousetap.m in Sources */,
-				DB0F490817CA5292008798C5 /* SDL_sysfilesystem.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB313FFD17554B71006C0E22 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB313FFE17554B71006C0E22 /* SDL_atomic.c in Sources */,
-				DB313FFF17554B71006C0E22 /* SDL_spinlock.c in Sources */,
-				DB31400017554B71006C0E22 /* SDL_diskaudio.c in Sources */,
-				DB31400117554B71006C0E22 /* SDL_dummyaudio.c in Sources */,
-				DB31400217554B71006C0E22 /* SDL_coreaudio.c in Sources */,
-				DB31400317554B71006C0E22 /* SDL_audio.c in Sources */,
-				DB31400417554B71006C0E22 /* SDL_audiocvt.c in Sources */,
-				DB31400517554B71006C0E22 /* SDL_audiodev.c in Sources */,
-				DB31400617554B71006C0E22 /* SDL_audiotypecvt.c in Sources */,
-				DB31400717554B71006C0E22 /* SDL_mixer.c in Sources */,
-				DB31400817554B71006C0E22 /* SDL_wave.c in Sources */,
-				DB31400917554B71006C0E22 /* SDL_cpuinfo.c in Sources */,
-				DB31400A17554B71006C0E22 /* SDL_clipboardevents.c in Sources */,
-				DB31400B17554B71006C0E22 /* SDL_events.c in Sources */,
-				DB31400C17554B71006C0E22 /* SDL_dropevents.c in Sources */,
-				DB31400D17554B71006C0E22 /* SDL_gesture.c in Sources */,
-				DB31400E17554B71006C0E22 /* SDL_keyboard.c in Sources */,
-				DB31400F17554B71006C0E22 /* SDL_mouse.c in Sources */,
-				DB31401017554B71006C0E22 /* SDL_quit.c in Sources */,
-				DB31401117554B71006C0E22 /* SDL_touch.c in Sources */,
-				DB31401217554B71006C0E22 /* SDL_windowevents.c in Sources */,
-				DB31401317554B71006C0E22 /* SDL_rwopsbundlesupport.m in Sources */,
-				DB31401417554B71006C0E22 /* SDL_rwops.c in Sources */,
-				DB31401517554B71006C0E22 /* SDL_syshaptic.c in Sources */,
-				DB31401617554B71006C0E22 /* SDL_haptic.c in Sources */,
-				DB31401717554B71006C0E22 /* SDL_sysjoystick.c in Sources */,
-				DB31401817554B71006C0E22 /* SDL_gamecontroller.c in Sources */,
-				DB31401917554B71006C0E22 /* SDL_joystick.c in Sources */,
-				DB31401A17554B71006C0E22 /* SDL_sysloadso.c in Sources */,
-				DB31401B17554B71006C0E22 /* SDL_syspower.c in Sources */,
-				DB31401C17554B71006C0E22 /* SDL_power.c in Sources */,
-				DB31401D17554B71006C0E22 /* SDL_assert.c in Sources */,
-				DB31401E17554B71006C0E22 /* SDL_error.c in Sources */,
-				DB31402017554B71006C0E22 /* SDL.c in Sources */,
-				DB31402117554B71006C0E22 /* SDL_getenv.c in Sources */,
-				DB31402217554B71006C0E22 /* SDL_iconv.c in Sources */,
-				DB31402317554B71006C0E22 /* SDL_malloc.c in Sources */,
-				DB31402417554B71006C0E22 /* SDL_qsort.c in Sources */,
-				DB31402517554B71006C0E22 /* SDL_stdlib.c in Sources */,
-				DB31402617554B71006C0E22 /* SDL_string.c in Sources */,
-				DB31402717554B71006C0E22 /* SDL_syscond.c in Sources */,
-				DB31402817554B71006C0E22 /* SDL_sysmutex.c in Sources */,
-				DB31402917554B71006C0E22 /* SDL_syssem.c in Sources */,
-				DB31402A17554B71006C0E22 /* SDL_systhread.c in Sources */,
-				DB31402B17554B71006C0E22 /* SDL_thread.c in Sources */,
-				DB31402C17554B71006C0E22 /* SDL_timer.c in Sources */,
-				DB31402D17554B71006C0E22 /* SDL_systimer.c in Sources */,
-				DB31402E17554B71006C0E22 /* SDL_cocoaclipboard.m in Sources */,
-				DB31402F17554B71006C0E22 /* SDL_cocoaevents.m in Sources */,
-				DB31403017554B71006C0E22 /* SDL_cocoakeyboard.m in Sources */,
-				DB31403117554B71006C0E22 /* SDL_cocoamodes.m in Sources */,
-				DB31403217554B71006C0E22 /* SDL_cocoamouse.m in Sources */,
-				DB31403317554B71006C0E22 /* SDL_cocoaopengl.m in Sources */,
-				DB31403417554B71006C0E22 /* SDL_cocoashape.m in Sources */,
-				DB31403517554B71006C0E22 /* SDL_cocoavideo.m in Sources */,
-				DB31403617554B71006C0E22 /* SDL_cocoawindow.m in Sources */,
-				DB31403717554B71006C0E22 /* SDL_nullevents.c in Sources */,
-				DB31403817554B71006C0E22 /* SDL_nullvideo.c in Sources */,
-				DB31403917554B71006C0E22 /* SDL_blit.c in Sources */,
-				DB31403A17554B71006C0E22 /* SDL_blit_0.c in Sources */,
-				DB31403B17554B71006C0E22 /* SDL_blit_1.c in Sources */,
-				DB31403C17554B71006C0E22 /* SDL_blit_A.c in Sources */,
-				DB31403D17554B71006C0E22 /* SDL_blit_auto.c in Sources */,
-				DB31403E17554B71006C0E22 /* SDL_blit_copy.c in Sources */,
-				DB31403F17554B71006C0E22 /* SDL_blit_N.c in Sources */,
-				DB31404017554B71006C0E22 /* SDL_blit_slow.c in Sources */,
-				DB31404117554B71006C0E22 /* SDL_bmp.c in Sources */,
-				DB31404217554B71006C0E22 /* SDL_clipboard.c in Sources */,
-				DB31404317554B71006C0E22 /* SDL_fillrect.c in Sources */,
-				DB31404417554B71006C0E22 /* SDL_pixels.c in Sources */,
-				DB31404517554B71006C0E22 /* SDL_rect.c in Sources */,
-				DB31404617554B71006C0E22 /* SDL_RLEaccel.c in Sources */,
-				DB31404717554B71006C0E22 /* SDL_shape.c in Sources */,
-				DB31404817554B71006C0E22 /* SDL_stretch.c in Sources */,
-				DB31404917554B71006C0E22 /* SDL_surface.c in Sources */,
-				DB31404A17554B71006C0E22 /* SDL_video.c in Sources */,
-				DB31404B17554B71006C0E22 /* imKStoUCS.c in Sources */,
-				DB31404C17554B71006C0E22 /* SDL_x11clipboard.c in Sources */,
-				DB31404D17554B71006C0E22 /* SDL_x11dyn.c in Sources */,
-				DB31404E17554B71006C0E22 /* SDL_x11events.c in Sources */,
-				DB31404F17554B71006C0E22 /* SDL_x11keyboard.c in Sources */,
-				DB31405017554B71006C0E22 /* SDL_x11modes.c in Sources */,
-				DB31405117554B71006C0E22 /* SDL_x11mouse.c in Sources */,
-				DB31405217554B71006C0E22 /* SDL_x11opengl.c in Sources */,
-				DB31405317554B71006C0E22 /* SDL_x11opengles.c in Sources */,
-				DB31405417554B71006C0E22 /* SDL_x11shape.c in Sources */,
-				DB31405517554B71006C0E22 /* SDL_x11touch.c in Sources */,
-				DB31405617554B71006C0E22 /* SDL_x11video.c in Sources */,
-				DB31405717554B71006C0E22 /* SDL_x11window.c in Sources */,
-				DB31405817554B71006C0E22 /* SDL_render.c in Sources */,
-				DB31405917554B71006C0E22 /* SDL_yuv_mmx.c in Sources */,
-				DB31405A17554B71006C0E22 /* SDL_yuv_sw.c in Sources */,
-				DB31405B17554B71006C0E22 /* SDL_nullframebuffer.c in Sources */,
-				DB31405C17554B71006C0E22 /* SDL_blendfillrect.c in Sources */,
-				DB31405D17554B71006C0E22 /* SDL_blendline.c in Sources */,
-				DB31405E17554B71006C0E22 /* SDL_blendpoint.c in Sources */,
-				DB31405F17554B71006C0E22 /* SDL_drawline.c in Sources */,
-				DB31406017554B71006C0E22 /* SDL_drawpoint.c in Sources */,
-				DB31406117554B71006C0E22 /* SDL_render_gl.c in Sources */,
-				DB31406217554B71006C0E22 /* SDL_render_sw.c in Sources */,
-				DB31406317554B71006C0E22 /* SDL_x11framebuffer.c in Sources */,
-				DB31406417554B71006C0E22 /* SDL_hints.c in Sources */,
-				DB31406517554B71006C0E22 /* SDL_log.c in Sources */,
-				DB31406617554B71006C0E22 /* SDL_shaders_gl.c in Sources */,
-				DB31406717554B71006C0E22 /* SDL_rotate.c in Sources */,
-				DB31406817554B71006C0E22 /* SDL_x11xinput2.c in Sources */,
-				DB31406917554B71006C0E22 /* SDL_x11messagebox.c in Sources */,
-				DB31406A17554B71006C0E22 /* SDL_cocoamessagebox.m in Sources */,
-				AA0F8493178D5ECC00823F9D /* SDL_systls.c in Sources */,
-				D55A1B83179F263500625D7C /* SDL_cocoamousetap.m in Sources */,
-				DB0F490A17CA5293008798C5 /* SDL_sysfilesystem.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
-		BECDF6C60761BA81005FE872 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BECDF5FE0761BA81005FE872 /* Framework */;
-			targetProxy = BECDF6C50761BA81005FE872 /* PBXContainerItemProxy */;
-		};
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
-		00CFA621106A567900758660 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
-				DEPLOYMENT_POSTPROCESSING = YES;
-				GCC_ALTIVEC_EXTENSIONS = YES;
-				GCC_AUTO_VECTORIZATION = YES;
-				GCC_ENABLE_SSE3_EXTENSIONS = YES;
-				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
-				GCC_OPTIMIZATION_LEVEL = 3;
-				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.5;
-				SDKROOT = macosx;
-				STRIP_STYLE = "non-global";
-			};
-			name = Release;
-		};
-		00CFA622106A567900758660 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 1;
-				FRAMEWORK_VERSION = A;
-				HEADER_SEARCH_PATHS = /usr/X11R6/include;
-				INFOPLIST_FILE = "Info-Framework.plist";
-				INSTALL_PATH = "@rpath";
-				OTHER_LDFLAGS = "-liconv";
-				PRODUCT_NAME = SDL2;
-				WRAPPER_EXTENSION = framework;
-			};
-			name = Release;
-		};
-		00CFA623106A567900758660 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"$(GCC_PREPROCESSOR_DEFINITIONS)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)",
-				);
-				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-				HEADER_SEARCH_PATHS = /usr/X11R6/include;
-				PRODUCT_NAME = SDL2;
-				SKIP_INSTALL = YES;
-			};
-			name = Release;
-		};
-		00CFA625106A567900758660 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = "Standard DMG";
-			};
-			name = Release;
-		};
-		00CFA627106A568900758660 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
-				GCC_ALTIVEC_EXTENSIONS = YES;
-				GCC_AUTO_VECTORIZATION = YES;
-				GCC_ENABLE_SSE3_EXTENSIONS = YES;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.5;
-				SDKROOT = macosx;
-				STRIP_INSTALLED_PRODUCT = NO;
-			};
-			name = Debug;
-		};
-		00CFA628106A568900758660 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 1;
-				FRAMEWORK_VERSION = A;
-				HEADER_SEARCH_PATHS = /usr/X11R6/include;
-				INFOPLIST_FILE = "Info-Framework.plist";
-				INSTALL_PATH = "@rpath";
-				OTHER_LDFLAGS = "-liconv";
-				PRODUCT_NAME = SDL2;
-				WRAPPER_EXTENSION = framework;
-			};
-			name = Debug;
-		};
-		00CFA629106A568900758660 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"$(GCC_PREPROCESSOR_DEFINITIONS)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)",
-				);
-				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-				HEADER_SEARCH_PATHS = /usr/X11R6/include;
-				PRODUCT_NAME = SDL2;
-				SKIP_INSTALL = YES;
-			};
-			name = Debug;
-		};
-		00CFA62B106A568900758660 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = "Standard DMG";
-			};
-			name = Debug;
-		};
-		DB31407517554B71006C0E22 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				EXECUTABLE_PREFIX = lib;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"$(GCC_PREPROCESSOR_DEFINITIONS)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)",
-				);
-				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-				HEADER_SEARCH_PATHS = /usr/X11R6/include;
-				INSTALL_PATH = "@rpath";
-				PRODUCT_NAME = SDL2;
-				SKIP_INSTALL = YES;
-			};
-			name = Debug;
-		};
-		DB31407617554B71006C0E22 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				EXECUTABLE_PREFIX = lib;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"$(GCC_PREPROCESSOR_DEFINITIONS)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)",
-					"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)",
-				);
-				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
-				HEADER_SEARCH_PATHS = /usr/X11R6/include;
-				INSTALL_PATH = "@rpath";
-				PRODUCT_NAME = SDL2;
-				SKIP_INSTALL = YES;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				00CFA628106A568900758660 /* Debug */,
-				00CFA622106A567900758660 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		0073177E0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Static Library" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				00CFA629106A568900758660 /* Debug */,
-				00CFA623106A567900758660 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		007317860858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Standard DMG" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				00CFA62B106A568900758660 /* Debug */,
-				00CFA625106A567900758660 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		0073178E0858DB0500B2BC32 /* Build configuration list for PBXProject "SDL" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				00CFA627106A568900758660 /* Debug */,
-				00CFA621106A567900758660 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB31407417554B71006C0E22 /* Build configuration list for PBXNativeTarget "Shared Library" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB31407517554B71006C0E22 /* Debug */,
-				DB31407617554B71006C0E22 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
-}
diff --git a/deps/SDL2/Xcode/SDL/pkg-support/SDL.info b/deps/SDL2/Xcode/SDL/pkg-support/SDL.info
deleted file mode 100755
index f08facd..0000000
--- a/deps/SDL2/Xcode/SDL/pkg-support/SDL.info
+++ /dev/null
@@ -1,15 +0,0 @@
-Title SDL 2.0.0
-Version 1
-Description SDL Library for Mac OS X (http://www.libsdl.org)
-DefaultLocation /Library/Frameworks
-Diskname (null)
-DeleteWarning 
-NeedsAuthorization NO
-DisableStop NO
-UseUserMask NO
-Application NO
-Relocatable YES
-Required NO
-InstallOnly NO
-RequiresReboot NO
-InstallFat NO
diff --git a/deps/SDL2/Xcode/SDL/pkg-support/codesign-frameworks.sh b/deps/SDL2/Xcode/SDL/pkg-support/codesign-frameworks.sh
deleted file mode 100755
index 16dea25..0000000
--- a/deps/SDL2/Xcode/SDL/pkg-support/codesign-frameworks.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-# WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY! 
-
-# Verify that $CODE_SIGN_IDENTITY is set
-if [ -z "$CODE_SIGN_IDENTITY" ] ; then
-    echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!"
-
-    if [ "$CONFIGURATION" = "Release" ] ; then
-        exit 1
-    else
-        # Codesigning is optional for non-release builds.
-        exit 0
-    fi
-fi
-
-SAVEIFS=$IFS
-IFS=$(echo -en "\n\b")
-
-FRAMEWORK_DIR="${TARGET_BUILD_DIR}"
-
-# Loop through all frameworks
-FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework" | sed -e "s/\(.*\)/\1\/Versions\/A\//"`
-RESULT=$?
-if [[ $RESULT != 0 ]] ; then
-    exit 1
-fi
-
-echo "Found:"
-echo "${FRAMEWORKS}"
-
-for FRAMEWORK in $FRAMEWORKS;
-do
-    echo "Signing '${FRAMEWORK}'"
-    `codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}"`
-    RESULT=$?
-    if [[ $RESULT != 0 ]] ; then
-        exit 1
-    fi
-done
-
-# restore $IFS
-IFS=$SAVEIFS
diff --git a/deps/SDL2/Xcode/SDL/pkg-support/resources/License.txt b/deps/SDL2/Xcode/SDL/pkg-support/resources/License.txt
deleted file mode 100644
index 18f109c..0000000
--- a/deps/SDL2/Xcode/SDL/pkg-support/resources/License.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-
-Simple DirectMedia Layer
-Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-  
-This software is provided 'as-is', without any express or implied
-warranty.  In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-  
-1. The origin of this software must not be misrepresented; you must not
-   claim that you wrote the original software. If you use this software
-   in a product, an acknowledgment in the product documentation would be
-   appreciated but is not required. 
-2. Altered source versions must be plainly marked as such, and must not be
-   misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
diff --git a/deps/SDL2/Xcode/SDL/pkg-support/resources/ReadMe.txt b/deps/SDL2/Xcode/SDL/pkg-support/resources/ReadMe.txt
deleted file mode 100755
index 40ac3a1..0000000
--- a/deps/SDL2/Xcode/SDL/pkg-support/resources/ReadMe.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-The Simple DirectMedia Layer (SDL for short) is a cross-platform 
-library designed to make it easy to write multi-media software, 
-such as games and emulators.
-
-The Simple DirectMedia Layer library source code is available from: 
-http://www.libsdl.org/
-
-This library is distributed under the terms of the zlib license: 
-http://zlib.net/zlib_license.html
-
-
-This packages contains the SDL framework for OS X. 
-Conforming with Apple guidelines, this framework 
-contains both the SDL runtime component and development header files.
-
-
-To Install:
-Copy the SDL2.framework to /Library/Frameworks
-
-You may alternatively install it in <Your home directory>/Library/Frameworks 
-if your access privileges are not high enough. 
-
-
-Additional References:
-
- - Screencast tutorials for getting started with OpenSceneGraph/Mac OS X are 
- 	available at:
-	http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/MacOSXTips
-	Though these are OpenSceneGraph centric, the same exact concepts apply to 
-	SDL, thus the videos are recommended for everybody getting started with
-	developing on Mac OS X. (You can skim over the PlugIns stuff since SDL
-	doesn't have any PlugIns to worry about.)
diff --git a/deps/SDL2/Xcode/SDL/pkg-support/resources/SDL_DS_Store b/deps/SDL2/Xcode/SDL/pkg-support/resources/SDL_DS_Store
deleted file mode 100644
index 5658d15..0000000
Binary files a/deps/SDL2/Xcode/SDL/pkg-support/resources/SDL_DS_Store and /dev/null differ
diff --git a/deps/SDL2/Xcode/SDL/pkg-support/sdl_logo.pdf b/deps/SDL2/Xcode/SDL/pkg-support/sdl_logo.pdf
deleted file mode 100644
index a172f97..0000000
Binary files a/deps/SDL2/Xcode/SDL/pkg-support/sdl_logo.pdf and /dev/null differ
diff --git a/deps/SDL2/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/deps/SDL2/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
deleted file mode 100755
index 152c3d2..0000000
--- a/deps/SDL2/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,4612 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 46;
-	objects = {
-
-/* Begin PBXAggregateTarget section */
-		BEC566920761D90300A33029 /* All */ = {
-			isa = PBXAggregateTarget;
-			buildConfigurationList = 001B599808BDB826006539E9 /* Build configuration list for PBXAggregateTarget "All" */;
-			buildPhases = (
-			);
-			dependencies = (
-				DB0F490517CA5249008798C5 /* PBXTargetDependency */,
-				DB0F490717CA5249008798C5 /* PBXTargetDependency */,
-				DB166E9816A1D7CF00A1396C /* PBXTargetDependency */,
-				DB166E9616A1D7CD00A1396C /* PBXTargetDependency */,
-				DB166E6C16A1D72000A1396C /* PBXTargetDependency */,
-				DB166E5616A1D6B800A1396C /* PBXTargetDependency */,
-				DB166E3B16A1D65A00A1396C /* PBXTargetDependency */,
-				DB166E2016A1D5D000A1396C /* PBXTargetDependency */,
-				DB166E0916A1D5A400A1396C /* PBXTargetDependency */,
-				DB166DF216A1D53700A1396C /* PBXTargetDependency */,
-				DB166DD916A1D38900A1396C /* PBXTargetDependency */,
-				001799481074403E00F5D044 /* PBXTargetDependency */,
-				0017994C1074403E00F5D044 /* PBXTargetDependency */,
-				001799501074403E00F5D044 /* PBXTargetDependency */,
-				001799521074403E00F5D044 /* PBXTargetDependency */,
-				0017995A1074403E00F5D044 /* PBXTargetDependency */,
-				0017995E1074403E00F5D044 /* PBXTargetDependency */,
-				001799601074403E00F5D044 /* PBXTargetDependency */,
-				001799661074403E00F5D044 /* PBXTargetDependency */,
-				001799681074403E00F5D044 /* PBXTargetDependency */,
-				0017996A1074403E00F5D044 /* PBXTargetDependency */,
-				0017996C1074403E00F5D044 /* PBXTargetDependency */,
-				0017996E1074403E00F5D044 /* PBXTargetDependency */,
-				001799701074403E00F5D044 /* PBXTargetDependency */,
-				001799721074403E00F5D044 /* PBXTargetDependency */,
-				001799741074403E00F5D044 /* PBXTargetDependency */,
-				001799761074403E00F5D044 /* PBXTargetDependency */,
-				001799781074403E00F5D044 /* PBXTargetDependency */,
-				0017997C1074403E00F5D044 /* PBXTargetDependency */,
-				001799801074403E00F5D044 /* PBXTargetDependency */,
-				001799841074403E00F5D044 /* PBXTargetDependency */,
-				001799881074403E00F5D044 /* PBXTargetDependency */,
-				0017998A1074403E00F5D044 /* PBXTargetDependency */,
-				0017998C1074403E00F5D044 /* PBXTargetDependency */,
-				0017998E1074403E00F5D044 /* PBXTargetDependency */,
-				001799921074403E00F5D044 /* PBXTargetDependency */,
-				001799941074403E00F5D044 /* PBXTargetDependency */,
-				001799961074403E00F5D044 /* PBXTargetDependency */,
-				0017999E1074403E00F5D044 /* PBXTargetDependency */,
-				001799A21074403E00F5D044 /* PBXTargetDependency */,
-				DB166D7016A1CEAF00A1396C /* PBXTargetDependency */,
-				DB166D6E16A1CEAA00A1396C /* PBXTargetDependency */,
-				DB166DC316A1D32C00A1396C /* PBXTargetDependency */,
-			);
-			name = All;
-			productName = "Build All";
-		};
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
-		001794D01073667700F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794D11073667B00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794D41073668800F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794D51073668D00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794D61073669200F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794D71073669700F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794D91073669E00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794DB107366A700F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794DC107366AC00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794DE107366B900F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794DF107366BD00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794E0107366C100F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001794E5107366D900F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		0017957C10741F7900F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		0017957D10741F7900F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		0017957E10741F7900F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		0017957F10741F7900F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		0017958010741F7900F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		0017958110741F7900F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		0017958210741F7900F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		0017958310741F7900F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		0017958410741F7900F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		0017958510741F7900F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001795901074216E00F5D044 /* testatomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017958F1074216E00F5D044 /* testatomic.c */; };
-		0017959D107421BF00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		0017959E107421BF00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		0017959F107421BF00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		001795A0107421BF00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		001795A1107421BF00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		001795A2107421BF00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		001795A3107421BF00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		001795A4107421BF00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		001795A5107421BF00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		001795A6107421BF00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001795B11074222D00F5D044 /* testaudioinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 001795B01074222D00F5D044 /* testaudioinfo.c */; };
-		0017971110742F3200F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		0017971210742F3200F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		0017971310742F3200F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		0017971410742F3200F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		0017971510742F3200F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		0017971610742F3200F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		0017971710742F3200F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		0017971810742F3200F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		0017971910742F3200F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		0017971A10742F3200F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		0017972810742FB900F5D044 /* testgl2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017972710742FB900F5D044 /* testgl2.c */; };
-		00179738107430D600F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		00179739107430D600F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		0017973A107430D600F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		0017973B107430D600F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		0017973C107430D600F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		0017973D107430D600F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		0017973E107430D600F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		0017973F107430D600F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		00179740107430D600F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		00179741107430D600F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		0017974F1074315700F5D044 /* testhaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017974E1074315700F5D044 /* testhaptic.c */; };
-		0017975E107431B300F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		0017975F107431B300F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		00179760107431B300F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		00179761107431B300F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		00179762107431B300F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		00179763107431B300F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		00179764107431B300F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		00179765107431B300F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		00179766107431B300F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		00179767107431B300F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001797721074320D00F5D044 /* testdraw2.c in Sources */ = {isa = PBXBuildFile; fileRef = 001797711074320D00F5D044 /* testdraw2.c */; };
-		0017977E107432AE00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		0017977F107432AE00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		00179780107432AE00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		00179781107432AE00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		00179782107432AE00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		00179783107432AE00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		00179784107432AE00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		00179785107432AE00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		00179786107432AE00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		00179787107432AE00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		00179792107432FA00F5D044 /* testime.c in Sources */ = {isa = PBXBuildFile; fileRef = 00179791107432FA00F5D044 /* testime.c */; };
-		0017979E1074334C00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		0017979F1074334C00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		001797A01074334C00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		001797A11074334C00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		001797A21074334C00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		001797A31074334C00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		001797A41074334C00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		001797A51074334C00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		001797A61074334C00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		001797A71074334C00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001797B41074339C00F5D044 /* testintersections.c in Sources */ = {isa = PBXBuildFile; fileRef = 001797B31074339C00F5D044 /* testintersections.c */; };
-		001797C0107433C600F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		001797C1107433C600F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		001797C2107433C600F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		001797C3107433C600F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		001797C4107433C600F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		001797C5107433C600F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		001797C6107433C600F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		001797C7107433C600F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		001797C8107433C600F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		001797C9107433C600F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001797D41074343E00F5D044 /* testloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 001797D31074343E00F5D044 /* testloadso.c */; };
-		001798021074355200F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		001798031074355200F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		001798041074355200F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		001798051074355200F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		001798061074355200F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		001798071074355200F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		001798081074355200F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		001798091074355200F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		0017980A1074355200F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		0017980B1074355200F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001798161074359B00F5D044 /* testmultiaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 001798151074359B00F5D044 /* testmultiaudio.c */; };
-		0017987F1074392D00F5D044 /* testnative.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017985A107436ED00F5D044 /* testnative.c */; };
-		001798801074392D00F5D044 /* testnativecocoa.m in Sources */ = {isa = PBXBuildFile; fileRef = 0017985C107436ED00F5D044 /* testnativecocoa.m */; };
-		001798811074392D00F5D044 /* testnativex11.c in Sources */ = {isa = PBXBuildFile; fileRef = 00179872107438D000F5D044 /* testnativex11.c */; };
-		001798841074392D00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		001798851074392D00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		001798861074392D00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		001798871074392D00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		001798881074392D00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		001798891074392D00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		0017988A1074392D00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		0017988B1074392D00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		0017988C1074392D00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		0017988D1074392D00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001798A5107439DF00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		001798A6107439DF00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		001798A7107439DF00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		001798A8107439DF00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		001798A9107439DF00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		001798AA107439DF00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		001798AB107439DF00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		001798AC107439DF00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		001798AD107439DF00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		001798AE107439DF00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001798BA10743A4900F5D044 /* testpower.c in Sources */ = {isa = PBXBuildFile; fileRef = 001798B910743A4900F5D044 /* testpower.c */; };
-		001798E210743BEC00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		001798E310743BEC00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		001798E410743BEC00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		001798E510743BEC00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		001798E610743BEC00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		001798E710743BEC00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		001798E810743BEC00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		001798E910743BEC00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		001798EA10743BEC00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		001798EB10743BEC00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		001798FA10743E9200F5D044 /* testresample.c in Sources */ = {isa = PBXBuildFile; fileRef = 001798F910743E9200F5D044 /* testresample.c */; };
-		0017990610743F1000F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		0017990710743F1000F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		0017990810743F1000F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		0017990910743F1000F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		0017990A10743F1000F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		0017990B10743F1000F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		0017990C10743F1000F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		0017990D10743F1000F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		0017990E10743F1000F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		0017990F10743F1000F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		0017991A10743F5300F5D044 /* testsprite2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017991910743F5300F5D044 /* testsprite2.c */; };
-		0017992810743FB700F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		0017992910743FB700F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		0017992A10743FB700F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		0017992B10743FB700F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		0017992C10743FB700F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		0017992D10743FB700F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		0017992E10743FB700F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		0017992F10743FB700F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		0017993010743FB700F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		0017993110743FB700F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		0017993C10743FEF00F5D044 /* testwm2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017993B10743FEF00F5D044 /* testwm2.c */; };
-		002A863010730405007319AE /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		002A864110730546007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A864210730546007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A864310730546007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A864D10730546007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A864E10730546007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A864F10730546007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A865310730547007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A865410730547007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A865510730547007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A866210730547007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A866310730547007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A866410730547007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A866B10730548007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A866C10730548007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A866D10730548007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A866E10730548007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A866F10730548007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A867010730548007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A867410730548007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A867510730548007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A867610730548007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A867710730548007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A867810730548007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A867910730549007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A867A10730549007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A867B10730549007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A867C10730549007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A868010730549007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A868110730549007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A868210730549007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A868610730549007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A868710730549007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A868810730549007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A868910730549007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A868A10730549007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A868B1073054A007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A868F1073054A007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A86901073054A007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A86911073054A007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A86951073054A007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A86961073054A007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A86971073054A007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A86981073054A007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		002A86991073054A007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		002A869A1073054A007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		002A86A310730593007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86A410730593007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86AB10730594007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86AC10730594007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86AF10730594007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86B010730594007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86B910730594007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86BA10730594007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86BF10730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86C010730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86C110730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86C210730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86C510730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86C610730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86C710730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86C810730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86C910730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86CA10730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86CD10730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86CE10730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86D110730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86D210730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86D310730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86D410730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86D710730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86D810730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86DB10730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86DC10730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86DD10730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		002A86DE10730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		002A86F4107305CE007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A86F8107305CE007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A86FA107305CE007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A86FF107305CE007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A8702107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A8703107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A8705107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A8706107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A8707107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A8709107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A870B107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A870C107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A870E107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A8710107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A8711107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		002A871610730623007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A871A10730623007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A871C10730623007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A872110730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A872410730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A872510730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A872710730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A872810730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A872910730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A872B10730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A872D10730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A872E10730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A873010730625007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A873210730625007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A873310730625007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		002A873B10730675007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A873F10730675007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A874110730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A874610730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A874910730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A874A10730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A874C10730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A874D10730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A874E10730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A875010730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A875210730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A875310730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A875510730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A875710730678007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A875810730678007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		002A875E10730745007319AE /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		002F33AA09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33AF09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33B009CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33B209CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33B509CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33B609CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33B709CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33B809CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33BC09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33BF09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F33C109CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F340B09CA1BFF00EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F341809CA1C5B00EBEB88 /* testfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F341709CA1C5B00EBEB88 /* testfile.c */; };
-		002F342A09CA1F0300EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F343709CA1F6F00EBEB88 /* testiconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F343609CA1F6F00EBEB88 /* testiconv.c */; };
-		002F344609CA1FB300EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F345409CA202000EBEB88 /* testoverlay2.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F345209CA201C00EBEB88 /* testoverlay2.c */; };
-		002F346309CA204F00EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		002F347009CA20A600EBEB88 /* testplatform.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F346F09CA20A600EBEB88 /* testplatform.c */; };
-		00794E6609D20865003FC8A1 /* sample.wav in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6209D20839003FC8A1 /* sample.wav */; };
-		00794EF009D23739003FC8A1 /* utf8.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6309D20839003FC8A1 /* utf8.txt */; };
-		00794EF709D237DE003FC8A1 /* moose.dat in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5E09D20839003FC8A1 /* moose.dat */; };
-		453774A5120915E3002F0F45 /* testshape.c in Sources */ = {isa = PBXBuildFile; fileRef = 453774A4120915E3002F0F45 /* testshape.c */; };
-		BBFC08C0164C6862003E6A99 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		BBFC08C1164C6862003E6A99 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		BBFC08C2164C6862003E6A99 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		BBFC08C3164C6862003E6A99 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		BBFC08C4164C6862003E6A99 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		BBFC08C5164C6862003E6A99 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		BBFC08C6164C6862003E6A99 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		BBFC08C7164C6862003E6A99 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		BBFC08C8164C6862003E6A99 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		BBFC08C9164C6862003E6A99 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		BBFC08D0164C6876003E6A99 /* testgamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = BBFC088E164C6820003E6A99 /* testgamecontroller.c */; };
-		BEC566B10761D90300A33029 /* checkkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D10FFB30A2C7F000001 /* checkkeys.c */; };
-		BEC566CB0761D90300A33029 /* loopwave.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4872006D84C97F000001 /* loopwave.c */; };
-		BEC567010761D90300A33029 /* testerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4878006D85357F000001 /* testerror.c */; };
-		BEC567290761D90400A33029 /* testthread.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D58FFB311A97F000001 /* testthread.c */; };
-		BEC567360761D90400A33029 /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D62FFB312AA7F000001 /* testjoystick.c */; };
-		BEC567430761D90400A33029 /* testkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D6CFFB313437F000001 /* testkeys.c */; };
-		BEC567500761D90400A33029 /* testlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D75FFB313BB7F000001 /* testlock.c */; };
-		BEC567780761D90500A33029 /* testsem.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E487E006D86A17F000001 /* testsem.c */; };
-		BEC567930761D90500A33029 /* testtimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4880006D86A17F000001 /* testtimer.c */; };
-		BEC567AD0761D90500A33029 /* testver.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4882006D86A17F000001 /* testver.c */; };
-		BEC567F00761D90600A33029 /* torturethread.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4887006D86A17F000001 /* torturethread.c */; };
-		DB0F48DD17CA51E5008798C5 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB0F48DE17CA51E5008798C5 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB0F48DF17CA51E5008798C5 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB0F48E017CA51E5008798C5 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB0F48E117CA51E5008798C5 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB0F48E217CA51E5008798C5 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB0F48E317CA51E5008798C5 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB0F48E417CA51E5008798C5 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB0F48E517CA51E5008798C5 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB0F48E617CA51E5008798C5 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB0F48EE17CA51F8008798C5 /* testdrawchessboard.c in Sources */ = {isa = PBXBuildFile; fileRef = DB0F48D717CA51D2008798C5 /* testdrawchessboard.c */; };
-		DB0F48F317CA5212008798C5 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB0F48F417CA5212008798C5 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB0F48F517CA5212008798C5 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB0F48F617CA5212008798C5 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB0F48F717CA5212008798C5 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB0F48F817CA5212008798C5 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB0F48F917CA5212008798C5 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB0F48FA17CA5212008798C5 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB0F48FB17CA5212008798C5 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB0F48FC17CA5212008798C5 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB0F490317CA5225008798C5 /* testfilesystem.c in Sources */ = {isa = PBXBuildFile; fileRef = DB0F48D817CA51D2008798C5 /* testfilesystem.c */; };
-		DB166D7116A1CFB200A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166D7216A1CFB200A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166D7316A1CFB200A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166D7416A1CFB200A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166D7516A1CFB200A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166D7616A1CFB200A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166D7716A1CFB200A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166D7816A1CFB200A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166D7916A1CFB200A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166D7A16A1CFD500A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166D9316A1D1A500A1396C /* SDL_test_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8416A1D1A500A1396C /* SDL_test_assert.c */; };
-		DB166D9416A1D1A500A1396C /* SDL_test_common.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8516A1D1A500A1396C /* SDL_test_common.c */; };
-		DB166D9516A1D1A500A1396C /* SDL_test_compare.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8616A1D1A500A1396C /* SDL_test_compare.c */; };
-		DB166D9616A1D1A500A1396C /* SDL_test_crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8716A1D1A500A1396C /* SDL_test_crc32.c */; };
-		DB166D9716A1D1A500A1396C /* SDL_test_font.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8816A1D1A500A1396C /* SDL_test_font.c */; };
-		DB166D9816A1D1A500A1396C /* SDL_test_fuzzer.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8916A1D1A500A1396C /* SDL_test_fuzzer.c */; };
-		DB166D9916A1D1A500A1396C /* SDL_test_harness.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */; };
-		DB166D9A16A1D1A500A1396C /* SDL_test_imageBlit.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8B16A1D1A500A1396C /* SDL_test_imageBlit.c */; };
-		DB166D9B16A1D1A500A1396C /* SDL_test_imageBlitBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8C16A1D1A500A1396C /* SDL_test_imageBlitBlend.c */; };
-		DB166D9C16A1D1A500A1396C /* SDL_test_imageFace.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8D16A1D1A500A1396C /* SDL_test_imageFace.c */; };
-		DB166D9D16A1D1A500A1396C /* SDL_test_imagePrimitives.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8E16A1D1A500A1396C /* SDL_test_imagePrimitives.c */; };
-		DB166D9E16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8F16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c */; };
-		DB166D9F16A1D1A500A1396C /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D9016A1D1A500A1396C /* SDL_test_log.c */; };
-		DB166DA016A1D1A500A1396C /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D9116A1D1A500A1396C /* SDL_test_md5.c */; };
-		DB166DA116A1D1A500A1396C /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D9216A1D1A500A1396C /* SDL_test_random.c */; };
-		DB166DA216A1D1E900A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166DA316A1D1FA00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166DA416A1D21700A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166DA716A1D24D00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166DAA16A1D27700A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166DAB16A1D27C00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166DAC16A1D29000A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166DB116A1D2F600A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166DB216A1D2F600A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166DB316A1D2F600A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166DB416A1D2F600A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166DB516A1D2F600A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166DB616A1D2F600A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166DB716A1D2F600A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166DB816A1D2F600A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166DB916A1D2F600A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166DBA16A1D2F600A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166DC116A1D31E00A1396C /* testgesture.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CBB16A1C74100A1396C /* testgesture.c */; };
-		DB166DC816A1D36A00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166DC916A1D36A00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166DCA16A1D36A00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166DCB16A1D36A00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166DCC16A1D36A00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166DCD16A1D36A00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166DCE16A1D36A00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166DCF16A1D36A00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166DD016A1D36A00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166DD116A1D36A00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166DD716A1D37800A1396C /* testmessage.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CBD16A1C74100A1396C /* testmessage.c */; };
-		DB166DDB16A1D42F00A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; };
-		DB166DE016A1D50C00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166DE116A1D50C00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166DE216A1D50C00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166DE316A1D50C00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166DE416A1D50C00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166DE516A1D50C00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166DE616A1D50C00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166DE716A1D50C00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166DE816A1D50C00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166DE916A1D50C00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166DEA16A1D50C00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166DF016A1D52500A1396C /* testrelative.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CBF16A1C74100A1396C /* testrelative.c */; };
-		DB166DF716A1D57C00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166DF816A1D57C00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166DF916A1D57C00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166DFA16A1D57C00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166DFB16A1D57C00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166DFC16A1D57C00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166DFD16A1D57C00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166DFE16A1D57C00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166DFF16A1D57C00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166E0016A1D57C00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166E0116A1D57C00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166E0716A1D59400A1396C /* testrendercopyex.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC016A1C74100A1396C /* testrendercopyex.c */; };
-		DB166E0E16A1D5AD00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166E0F16A1D5AD00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166E1016A1D5AD00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166E1116A1D5AD00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166E1216A1D5AD00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166E1316A1D5AD00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166E1416A1D5AD00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166E1516A1D5AD00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166E1616A1D5AD00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166E1716A1D5AD00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166E1816A1D5AD00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166E1E16A1D5C300A1396C /* testrendertarget.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC116A1C74100A1396C /* testrendertarget.c */; };
-		DB166E2216A1D5EC00A1396C /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; };
-		DB166E2316A1D60B00A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; };
-		DB166E2516A1D61900A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; };
-		DB166E2616A1D61900A1396C /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; };
-		DB166E2B16A1D64D00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166E2C16A1D64D00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166E2D16A1D64D00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166E2E16A1D64D00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166E2F16A1D64D00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166E3016A1D64D00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166E3116A1D64D00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166E3216A1D64D00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166E3316A1D64D00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166E3416A1D64D00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166E3C16A1D66500A1396C /* testrumble.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC216A1C74100A1396C /* testrumble.c */; };
-		DB166E4116A1D69000A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166E4216A1D69000A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166E4316A1D69000A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166E4416A1D69000A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166E4516A1D69000A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166E4616A1D69000A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166E4716A1D69000A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166E4816A1D69000A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166E4916A1D69000A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166E4A16A1D69000A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166E4B16A1D69000A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; };
-		DB166E4D16A1D69000A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; };
-		DB166E4E16A1D69000A1396C /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; };
-		DB166E5416A1D6A300A1396C /* testscale.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC316A1C74100A1396C /* testscale.c */; };
-		DB166E5B16A1D6F300A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166E5C16A1D6F300A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166E5D16A1D6F300A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166E5E16A1D6F300A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166E5F16A1D6F300A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166E6016A1D6F300A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166E6116A1D6F300A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166E6216A1D6F300A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166E6316A1D6F300A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166E6416A1D6F300A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166E6A16A1D70C00A1396C /* testshader.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC416A1C74100A1396C /* testshader.c */; };
-		DB166E7116A1D78400A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166E7216A1D78400A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166E7316A1D78400A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166E7416A1D78400A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166E7516A1D78400A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166E7616A1D78400A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166E7716A1D78400A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166E7816A1D78400A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166E7916A1D78400A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166E7A16A1D78400A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166E8416A1D78C00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
-		DB166E8516A1D78C00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; };
-		DB166E8616A1D78C00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; };
-		DB166E8716A1D78C00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; };
-		DB166E8816A1D78C00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; };
-		DB166E8916A1D78C00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; };
-		DB166E8A16A1D78C00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; };
-		DB166E8B16A1D78C00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; };
-		DB166E8C16A1D78C00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; };
-		DB166E8D16A1D78C00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; };
-		DB166E9316A1D7BC00A1396C /* testspriteminimal.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC516A1C74100A1396C /* testspriteminimal.c */; };
-		DB166E9416A1D7C700A1396C /* teststreaming.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC616A1C74100A1396C /* teststreaming.c */; };
-		DB166E9A16A1D7F700A1396C /* moose.dat in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5E09D20839003FC8A1 /* moose.dat */; };
-		DB166E9C16A1D80900A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; };
-		DB166ED016A1D88100A1396C /* shapes in CopyFiles */ = {isa = PBXBuildFile; fileRef = DB166ECF16A1D87000A1396C /* shapes */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
-		001799471074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC566AB0761D90300A33029;
-			remoteInfo = checkkeys;
-		};
-		0017994B1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC566C50761D90300A33029;
-			remoteInfo = loopwave;
-		};
-		0017994F1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 0017957410741F7900F5D044;
-			remoteInfo = testatomic;
-		};
-		001799511074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 00179595107421BF00F5D044;
-			remoteInfo = testaudioinfo;
-		};
-		001799591074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 00179756107431B300F5D044;
-			remoteInfo = testdraw2;
-		};
-		0017995D1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC566FB0761D90300A33029;
-			remoteInfo = testerror;
-		};
-		0017995F1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 002F340109CA1BFF00EBEB88;
-			remoteInfo = testfile;
-		};
-		001799651074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 0017970910742F3200F5D044;
-			remoteInfo = testgl2;
-		};
-		001799671074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 00179730107430D600F5D044;
-			remoteInfo = testhaptic;
-		};
-		001799691074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC567230761D90400A33029;
-			remoteInfo = testthread;
-		};
-		0017996B1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 002F342009CA1F0300EBEB88;
-			remoteInfo = testiconv;
-		};
-		0017996D1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 00179776107432AE00F5D044;
-			remoteInfo = testime;
-		};
-		0017996F1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 001797961074334C00F5D044;
-			remoteInfo = testintersections;
-		};
-		001799711074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC567300761D90400A33029;
-			remoteInfo = testjoystick;
-		};
-		001799731074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC5673D0761D90400A33029;
-			remoteInfo = testkeys;
-		};
-		001799751074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 001797B8107433C600F5D044;
-			remoteInfo = testloadso;
-		};
-		001799771074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC5674A0761D90400A33029;
-			remoteInfo = testlock;
-		};
-		0017997B1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 001797FA1074355200F5D044;
-			remoteInfo = testmultiaudio;
-		};
-		0017997F1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 001798781074392D00F5D044;
-			remoteInfo = testnativex11;
-		};
-		001799831074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 002F343C09CA1FB300EBEB88;
-			remoteInfo = testoverlay2;
-		};
-		001799871074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 002F345909CA204F00EBEB88;
-			remoteInfo = testplatform;
-		};
-		001799891074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 0017989D107439DF00F5D044;
-			remoteInfo = testpower;
-		};
-		0017998B1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 001798DA10743BEC00F5D044;
-			remoteInfo = testresample;
-		};
-		0017998D1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC567720761D90500A33029;
-			remoteInfo = testsem;
-		};
-		001799911074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 001798FE10743F1000F5D044;
-			remoteInfo = testsprite2;
-		};
-		001799931074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC5678D0761D90500A33029;
-			remoteInfo = testtimer;
-		};
-		001799951074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC567A70761D90500A33029;
-			remoteInfo = testversion;
-		};
-		0017999D1074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 0017992010743FB700F5D044;
-			remoteInfo = testwm2;
-		};
-		001799A11074403E00F5D044 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BEC567EA0761D90600A33029;
-			remoteInfo = torturethread;
-		};
-		003FA642093FFD41000C53B3 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = BECDF66C0761BA81005FE872;
-			remoteInfo = Framework;
-		};
-		003FA644093FFD41000C53B3 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = BECDF6B30761BA81005FE872;
-			remoteInfo = "Static Library";
-		};
-		003FA648093FFD41000C53B3 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = BECDF6BE0761BA81005FE872;
-			remoteInfo = "Standard DMG";
-		};
-		DB0F490417CA5249008798C5 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB0F48D917CA51E5008798C5;
-			remoteInfo = testdrawchessboard;
-		};
-		DB0F490617CA5249008798C5 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB0F48EF17CA5212008798C5;
-			remoteInfo = testfilesystem;
-		};
-		DB166D6D16A1CEAA00A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = BBFC08B7164C6862003E6A99;
-			remoteInfo = testgamecontroller;
-		};
-		DB166D6F16A1CEAF00A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 4537749112091504002F0F45;
-			remoteInfo = testshape;
-		};
-		DB166DC216A1D32C00A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166DAD16A1D2F600A1396C;
-			remoteInfo = testgesture;
-		};
-		DB166DD816A1D38900A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166DC416A1D36A00A1396C;
-			remoteInfo = testmessage;
-		};
-		DB166DF116A1D53700A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166DDC16A1D50C00A1396C;
-			remoteInfo = testrelative;
-		};
-		DB166E0816A1D5A400A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166DF316A1D57C00A1396C;
-			remoteInfo = testrendercopyex;
-		};
-		DB166E1F16A1D5D000A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166E0A16A1D5AD00A1396C;
-			remoteInfo = testrendertarget;
-		};
-		DB166E3A16A1D65A00A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166E2716A1D64D00A1396C;
-			remoteInfo = testrumble;
-		};
-		DB166E5516A1D6B800A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166E3D16A1D69000A1396C;
-			remoteInfo = testscale;
-		};
-		DB166E6B16A1D72000A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166E5716A1D6F300A1396C;
-			remoteInfo = testshader;
-		};
-		DB166E9516A1D7CD00A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166E6D16A1D78400A1396C;
-			remoteInfo = testspriteminimal;
-		};
-		DB166E9716A1D7CF00A1396C /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = DB166E8016A1D78C00A1396C;
-			remoteInfo = teststreaming;
-		};
-		DB1D40D617B3F30D00D74CFC /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = DB31407717554B71006C0E22;
-			remoteInfo = "Shared Library";
-		};
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
-		00794E6409D2084F003FC8A1 /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				00794E6609D20865003FC8A1 /* sample.wav in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		00794EEC09D2371F003FC8A1 /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				00794EF009D23739003FC8A1 /* utf8.txt in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		00794EF409D237C7003FC8A1 /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				00794EF709D237DE003FC8A1 /* moose.dat in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB0F48E717CA51E5008798C5 /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB0F48FD17CA5212008798C5 /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166DDA16A1D40F00A1396C /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				DB166DDB16A1D42F00A1396C /* icon.bmp in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E2116A1D5DF00A1396C /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				DB166E2316A1D60B00A1396C /* icon.bmp in CopyFiles */,
-				DB166E2216A1D5EC00A1396C /* sample.bmp in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E2416A1D61000A1396C /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				DB166E2516A1D61900A1396C /* icon.bmp in CopyFiles */,
-				DB166E2616A1D61900A1396C /* sample.bmp in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E4C16A1D69000A1396C /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				DB166E4D16A1D69000A1396C /* icon.bmp in CopyFiles */,
-				DB166E4E16A1D69000A1396C /* sample.bmp in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E9916A1D7EE00A1396C /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				DB166E9A16A1D7F700A1396C /* moose.dat in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E9B16A1D7FC00A1396C /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				DB166E9C16A1D80900A1396C /* icon.bmp in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166ECE16A1D85400A1396C /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = "";
-			dstSubfolderSpec = 16;
-			files = (
-				DB166ED016A1D88100A1396C /* shapes in CopyFiles */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
-		0017958C10741F7900F5D044 /* testatomic */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testatomic; sourceTree = BUILT_PRODUCTS_DIR; };
-		0017958F1074216E00F5D044 /* testatomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testatomic.c; path = ../../test/testatomic.c; sourceTree = SOURCE_ROOT; };
-		001795AD107421BF00F5D044 /* testaudioinfo */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testaudioinfo; sourceTree = BUILT_PRODUCTS_DIR; };
-		001795B01074222D00F5D044 /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testaudioinfo.c; path = ../../test/testaudioinfo.c; sourceTree = SOURCE_ROOT; };
-		0017972110742F3200F5D044 /* testgl2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testgl2; sourceTree = BUILT_PRODUCTS_DIR; };
-		0017972710742FB900F5D044 /* testgl2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgl2.c; path = ../../test/testgl2.c; sourceTree = SOURCE_ROOT; };
-		00179748107430D600F5D044 /* testhaptic */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testhaptic; sourceTree = BUILT_PRODUCTS_DIR; };
-		0017974E1074315700F5D044 /* testhaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testhaptic.c; path = ../../test/testhaptic.c; sourceTree = SOURCE_ROOT; };
-		0017976E107431B300F5D044 /* testdraw2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testdraw2; sourceTree = BUILT_PRODUCTS_DIR; };
-		001797711074320D00F5D044 /* testdraw2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testdraw2.c; path = ../../test/testdraw2.c; sourceTree = SOURCE_ROOT; };
-		0017978E107432AE00F5D044 /* testime */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testime; sourceTree = BUILT_PRODUCTS_DIR; };
-		00179791107432FA00F5D044 /* testime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testime.c; path = ../../test/testime.c; sourceTree = SOURCE_ROOT; };
-		001797AE1074334C00F5D044 /* testintersections */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testintersections; sourceTree = BUILT_PRODUCTS_DIR; };
-		001797B31074339C00F5D044 /* testintersections.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testintersections.c; path = ../../test/testintersections.c; sourceTree = SOURCE_ROOT; };
-		001797D0107433C600F5D044 /* testloadso */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testloadso; sourceTree = BUILT_PRODUCTS_DIR; };
-		001797D31074343E00F5D044 /* testloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testloadso.c; path = ../../test/testloadso.c; sourceTree = SOURCE_ROOT; };
-		001798121074355200F5D044 /* testmultiaudio */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testmultiaudio; sourceTree = BUILT_PRODUCTS_DIR; };
-		001798151074359B00F5D044 /* testmultiaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testmultiaudio.c; path = ../../test/testmultiaudio.c; sourceTree = SOURCE_ROOT; };
-		0017985A107436ED00F5D044 /* testnative.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testnative.c; path = ../../test/testnative.c; sourceTree = SOURCE_ROOT; };
-		0017985B107436ED00F5D044 /* testnative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = testnative.h; path = ../../test/testnative.h; sourceTree = SOURCE_ROOT; };
-		0017985C107436ED00F5D044 /* testnativecocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = testnativecocoa.m; path = ../../test/testnativecocoa.m; sourceTree = SOURCE_ROOT; };
-		00179872107438D000F5D044 /* testnativex11.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testnativex11.c; path = ../../test/testnativex11.c; sourceTree = SOURCE_ROOT; };
-		001798941074392D00F5D044 /* testnative */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testnative; sourceTree = BUILT_PRODUCTS_DIR; };
-		001798B5107439DF00F5D044 /* testpower */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testpower; sourceTree = BUILT_PRODUCTS_DIR; };
-		001798B910743A4900F5D044 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testpower.c; path = ../../test/testpower.c; sourceTree = SOURCE_ROOT; };
-		001798F210743BEC00F5D044 /* testresample */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testresample; sourceTree = BUILT_PRODUCTS_DIR; };
-		001798F910743E9200F5D044 /* testresample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testresample.c; path = ../../test/testresample.c; sourceTree = SOURCE_ROOT; };
-		0017991610743F1000F5D044 /* testsprite2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testsprite2; sourceTree = BUILT_PRODUCTS_DIR; };
-		0017991910743F5300F5D044 /* testsprite2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsprite2.c; path = ../../test/testsprite2.c; sourceTree = SOURCE_ROOT; };
-		0017993810743FB700F5D044 /* testwm2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testwm2; sourceTree = BUILT_PRODUCTS_DIR; };
-		0017993B10743FEF00F5D044 /* testwm2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testwm2.c; path = ../../test/testwm2.c; sourceTree = SOURCE_ROOT; };
-		002A863B10730545007319AE /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
-		002A863C10730545007319AE /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = "<absolute>"; };
-		002A863D10730545007319AE /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
-		002A869F10730593007319AE /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
-		002A86A010730593007319AE /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
-		002A86F2107305CE007319AE /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
-		002A871410730623007319AE /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
-		002A873910730675007319AE /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
-		002F33A709CA188600EBEB88 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
-		002F341209CA1BFF00EBEB88 /* testfile */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testfile; sourceTree = BUILT_PRODUCTS_DIR; };
-		002F341709CA1C5B00EBEB88 /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testfile.c; path = ../../test/testfile.c; sourceTree = SOURCE_ROOT; };
-		002F343109CA1F0300EBEB88 /* testiconv */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testiconv; sourceTree = BUILT_PRODUCTS_DIR; };
-		002F343609CA1F6F00EBEB88 /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testiconv.c; path = ../../test/testiconv.c; sourceTree = SOURCE_ROOT; };
-		002F344D09CA1FB300EBEB88 /* testoverlay2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testoverlay2; sourceTree = BUILT_PRODUCTS_DIR; };
-		002F345209CA201C00EBEB88 /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testoverlay2.c; path = ../../test/testoverlay2.c; sourceTree = SOURCE_ROOT; };
-		002F346A09CA204F00EBEB88 /* testplatform */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testplatform; sourceTree = BUILT_PRODUCTS_DIR; };
-		002F346F09CA20A600EBEB88 /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testplatform.c; path = ../../test/testplatform.c; sourceTree = SOURCE_ROOT; };
-		003FA63A093FFD41000C53B3 /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; };
-		00794E5D09D20839003FC8A1 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; };
-		00794E5E09D20839003FC8A1 /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; };
-		00794E5F09D20839003FC8A1 /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; };
-		00794E6109D20839003FC8A1 /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; };
-		00794E6209D20839003FC8A1 /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; };
-		00794E6309D20839003FC8A1 /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; };
-		083E4872006D84C97F000001 /* loopwave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = loopwave.c; path = ../../test/loopwave.c; sourceTree = SOURCE_ROOT; };
-		083E4878006D85357F000001 /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testerror.c; path = ../../test/testerror.c; sourceTree = SOURCE_ROOT; };
-		083E487E006D86A17F000001 /* testsem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testsem.c; path = ../../test/testsem.c; sourceTree = SOURCE_ROOT; };
-		083E4880006D86A17F000001 /* testtimer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testtimer.c; path = ../../test/testtimer.c; sourceTree = SOURCE_ROOT; };
-		083E4882006D86A17F000001 /* testver.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testver.c; path = ../../test/testver.c; sourceTree = SOURCE_ROOT; };
-		083E4887006D86A17F000001 /* torturethread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = torturethread.c; path = ../../test/torturethread.c; sourceTree = SOURCE_ROOT; };
-		092D6D10FFB30A2C7F000001 /* checkkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = checkkeys.c; path = ../../test/checkkeys.c; sourceTree = SOURCE_ROOT; };
-		092D6D58FFB311A97F000001 /* testthread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testthread.c; path = ../../test/testthread.c; sourceTree = SOURCE_ROOT; };
-		092D6D62FFB312AA7F000001 /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testjoystick.c; path = ../../test/testjoystick.c; sourceTree = SOURCE_ROOT; };
-		092D6D6CFFB313437F000001 /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testkeys.c; path = ../../test/testkeys.c; sourceTree = SOURCE_ROOT; };
-		092D6D75FFB313BB7F000001 /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testlock.c; path = ../../test/testlock.c; sourceTree = SOURCE_ROOT; };
-		4537749212091504002F0F45 /* testshape */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testshape; sourceTree = BUILT_PRODUCTS_DIR; };
-		453774A4120915E3002F0F45 /* testshape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testshape.c; path = ../../test/testshape.c; sourceTree = SOURCE_ROOT; };
-		BBFC088E164C6820003E6A99 /* testgamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgamecontroller.c; path = ../../test/testgamecontroller.c; sourceTree = "<group>"; };
-		BBFC08CD164C6862003E6A99 /* testgamecontroller */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testgamecontroller; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC566B60761D90300A33029 /* checkkeys */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = checkkeys; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC566D10761D90300A33029 /* loopwave */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = loopwave; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC567060761D90400A33029 /* testerror */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testerror; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC5672E0761D90400A33029 /* testthread */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testthread; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC5673B0761D90400A33029 /* testjoystick */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testjoystick; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC567480761D90400A33029 /* testkeys */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testkeys; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC567550761D90400A33029 /* testlock */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testlock; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC5677D0761D90500A33029 /* testsem */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testsem; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC567980761D90500A33029 /* testtimer */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testtimer; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC567B20761D90500A33029 /* testversion */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testversion; sourceTree = BUILT_PRODUCTS_DIR; };
-		BEC567F50761D90600A33029 /* torturethread */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = torturethread; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB0F48D717CA51D2008798C5 /* testdrawchessboard.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testdrawchessboard.c; path = ../../test/testdrawchessboard.c; sourceTree = "<group>"; };
-		DB0F48D817CA51D2008798C5 /* testfilesystem.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testfilesystem.c; path = ../../test/testfilesystem.c; sourceTree = "<group>"; };
-		DB0F48EC17CA51E5008798C5 /* testdrawchessboard */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testdrawchessboard; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB0F490117CA5212008798C5 /* testfilesystem */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testfilesystem; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166CBB16A1C74100A1396C /* testgesture.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testgesture.c; path = ../../test/testgesture.c; sourceTree = "<group>"; };
-		DB166CBC16A1C74100A1396C /* testgles.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testgles.c; path = ../../test/testgles.c; sourceTree = "<group>"; };
-		DB166CBD16A1C74100A1396C /* testmessage.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testmessage.c; path = ../../test/testmessage.c; sourceTree = "<group>"; };
-		DB166CBF16A1C74100A1396C /* testrelative.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrelative.c; path = ../../test/testrelative.c; sourceTree = "<group>"; };
-		DB166CC016A1C74100A1396C /* testrendercopyex.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrendercopyex.c; path = ../../test/testrendercopyex.c; sourceTree = "<group>"; };
-		DB166CC116A1C74100A1396C /* testrendertarget.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrendertarget.c; path = ../../test/testrendertarget.c; sourceTree = "<group>"; };
-		DB166CC216A1C74100A1396C /* testrumble.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrumble.c; path = ../../test/testrumble.c; sourceTree = "<group>"; };
-		DB166CC316A1C74100A1396C /* testscale.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testscale.c; path = ../../test/testscale.c; sourceTree = "<group>"; };
-		DB166CC416A1C74100A1396C /* testshader.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testshader.c; path = ../../test/testshader.c; sourceTree = "<group>"; };
-		DB166CC516A1C74100A1396C /* testspriteminimal.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testspriteminimal.c; path = ../../test/testspriteminimal.c; sourceTree = "<group>"; };
-		DB166CC616A1C74100A1396C /* teststreaming.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = teststreaming.c; path = ../../test/teststreaming.c; sourceTree = "<group>"; };
-		DB166D7F16A1D12400A1396C /* libSDL_test.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL_test.a; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166D8416A1D1A500A1396C /* SDL_test_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_assert.c; path = ../../src/test/SDL_test_assert.c; sourceTree = "<group>"; };
-		DB166D8516A1D1A500A1396C /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_common.c; path = ../../src/test/SDL_test_common.c; sourceTree = "<group>"; };
-		DB166D8616A1D1A500A1396C /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_compare.c; path = ../../src/test/SDL_test_compare.c; sourceTree = "<group>"; };
-		DB166D8716A1D1A500A1396C /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_crc32.c; path = ../../src/test/SDL_test_crc32.c; sourceTree = "<group>"; };
-		DB166D8816A1D1A500A1396C /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_font.c; path = ../../src/test/SDL_test_font.c; sourceTree = "<group>"; };
-		DB166D8916A1D1A500A1396C /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_fuzzer.c; path = ../../src/test/SDL_test_fuzzer.c; sourceTree = "<group>"; };
-		DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_harness.c; path = ../../src/test/SDL_test_harness.c; sourceTree = "<group>"; };
-		DB166D8B16A1D1A500A1396C /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlit.c; path = ../../src/test/SDL_test_imageBlit.c; sourceTree = "<group>"; };
-		DB166D8C16A1D1A500A1396C /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlitBlend.c; path = ../../src/test/SDL_test_imageBlitBlend.c; sourceTree = "<group>"; };
-		DB166D8D16A1D1A500A1396C /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageFace.c; path = ../../src/test/SDL_test_imageFace.c; sourceTree = "<group>"; };
-		DB166D8E16A1D1A500A1396C /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitives.c; path = ../../src/test/SDL_test_imagePrimitives.c; sourceTree = "<group>"; };
-		DB166D8F16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitivesBlend.c; path = ../../src/test/SDL_test_imagePrimitivesBlend.c; sourceTree = "<group>"; };
-		DB166D9016A1D1A500A1396C /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_log.c; path = ../../src/test/SDL_test_log.c; sourceTree = "<group>"; };
-		DB166D9116A1D1A500A1396C /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_md5.c; path = ../../src/test/SDL_test_md5.c; sourceTree = "<group>"; };
-		DB166D9216A1D1A500A1396C /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_random.c; path = ../../src/test/SDL_test_random.c; sourceTree = "<group>"; };
-		DB166DBF16A1D2F600A1396C /* testgesture */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testgesture; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166DD516A1D36A00A1396C /* testmessage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testmessage; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166DEE16A1D50C00A1396C /* testrelative */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testrelative; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166E0516A1D57C00A1396C /* testrendercopyex */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testrendercopyex; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166E1C16A1D5AD00A1396C /* testrendertarget */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testrendertarget; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166E3816A1D64D00A1396C /* testrumble */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testrumble; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166E5216A1D69000A1396C /* testscale */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testscale; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166E6816A1D6F300A1396C /* testshader */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testshader; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166E7E16A1D78400A1396C /* testspriteminimal */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testspriteminimal; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166E9116A1D78C00A1396C /* teststreaming */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = teststreaming; sourceTree = BUILT_PRODUCTS_DIR; };
-		DB166ECF16A1D87000A1396C /* shapes */ = {isa = PBXFileReference; lastKnownFileType = folder; name = shapes; path = ../../test/shapes; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		0017957A10741F7900F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017957C10741F7900F5D044 /* Cocoa.framework in Frameworks */,
-				0017957D10741F7900F5D044 /* CoreAudio.framework in Frameworks */,
-				0017957E10741F7900F5D044 /* ForceFeedback.framework in Frameworks */,
-				0017957F10741F7900F5D044 /* IOKit.framework in Frameworks */,
-				0017958010741F7900F5D044 /* AudioToolbox.framework in Frameworks */,
-				0017958110741F7900F5D044 /* CoreFoundation.framework in Frameworks */,
-				0017958210741F7900F5D044 /* OpenGL.framework in Frameworks */,
-				0017958310741F7900F5D044 /* AudioUnit.framework in Frameworks */,
-				0017958410741F7900F5D044 /* Carbon.framework in Frameworks */,
-				0017958510741F7900F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017959B107421BF00F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017959D107421BF00F5D044 /* Cocoa.framework in Frameworks */,
-				0017959E107421BF00F5D044 /* CoreAudio.framework in Frameworks */,
-				0017959F107421BF00F5D044 /* ForceFeedback.framework in Frameworks */,
-				001795A0107421BF00F5D044 /* IOKit.framework in Frameworks */,
-				001795A1107421BF00F5D044 /* AudioToolbox.framework in Frameworks */,
-				001795A2107421BF00F5D044 /* CoreFoundation.framework in Frameworks */,
-				001795A3107421BF00F5D044 /* OpenGL.framework in Frameworks */,
-				001795A4107421BF00F5D044 /* AudioUnit.framework in Frameworks */,
-				001795A5107421BF00F5D044 /* Carbon.framework in Frameworks */,
-				001795A6107421BF00F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017970F10742F3200F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017971110742F3200F5D044 /* Cocoa.framework in Frameworks */,
-				0017971210742F3200F5D044 /* CoreAudio.framework in Frameworks */,
-				0017971310742F3200F5D044 /* ForceFeedback.framework in Frameworks */,
-				0017971410742F3200F5D044 /* IOKit.framework in Frameworks */,
-				0017971510742F3200F5D044 /* AudioToolbox.framework in Frameworks */,
-				0017971610742F3200F5D044 /* CoreFoundation.framework in Frameworks */,
-				0017971710742F3200F5D044 /* OpenGL.framework in Frameworks */,
-				0017971810742F3200F5D044 /* AudioUnit.framework in Frameworks */,
-				0017971910742F3200F5D044 /* Carbon.framework in Frameworks */,
-				0017971A10742F3200F5D044 /* libSDL2.a in Frameworks */,
-				DB166DA316A1D1FA00A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		00179736107430D600F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				00179738107430D600F5D044 /* Cocoa.framework in Frameworks */,
-				00179739107430D600F5D044 /* CoreAudio.framework in Frameworks */,
-				0017973A107430D600F5D044 /* ForceFeedback.framework in Frameworks */,
-				0017973B107430D600F5D044 /* IOKit.framework in Frameworks */,
-				0017973C107430D600F5D044 /* AudioToolbox.framework in Frameworks */,
-				0017973D107430D600F5D044 /* CoreFoundation.framework in Frameworks */,
-				0017973E107430D600F5D044 /* OpenGL.framework in Frameworks */,
-				0017973F107430D600F5D044 /* AudioUnit.framework in Frameworks */,
-				00179740107430D600F5D044 /* Carbon.framework in Frameworks */,
-				00179741107430D600F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017975C107431B300F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017975E107431B300F5D044 /* Cocoa.framework in Frameworks */,
-				0017975F107431B300F5D044 /* CoreAudio.framework in Frameworks */,
-				00179760107431B300F5D044 /* ForceFeedback.framework in Frameworks */,
-				00179761107431B300F5D044 /* IOKit.framework in Frameworks */,
-				00179762107431B300F5D044 /* AudioToolbox.framework in Frameworks */,
-				00179763107431B300F5D044 /* CoreFoundation.framework in Frameworks */,
-				00179764107431B300F5D044 /* OpenGL.framework in Frameworks */,
-				00179765107431B300F5D044 /* AudioUnit.framework in Frameworks */,
-				00179766107431B300F5D044 /* Carbon.framework in Frameworks */,
-				00179767107431B300F5D044 /* libSDL2.a in Frameworks */,
-				DB166DA216A1D1E900A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017977C107432AE00F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017977E107432AE00F5D044 /* Cocoa.framework in Frameworks */,
-				0017977F107432AE00F5D044 /* CoreAudio.framework in Frameworks */,
-				00179780107432AE00F5D044 /* ForceFeedback.framework in Frameworks */,
-				00179781107432AE00F5D044 /* IOKit.framework in Frameworks */,
-				00179782107432AE00F5D044 /* AudioToolbox.framework in Frameworks */,
-				00179783107432AE00F5D044 /* CoreFoundation.framework in Frameworks */,
-				00179784107432AE00F5D044 /* OpenGL.framework in Frameworks */,
-				00179785107432AE00F5D044 /* AudioUnit.framework in Frameworks */,
-				00179786107432AE00F5D044 /* Carbon.framework in Frameworks */,
-				00179787107432AE00F5D044 /* libSDL2.a in Frameworks */,
-				DB166DA716A1D24D00A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017979C1074334C00F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017979E1074334C00F5D044 /* Cocoa.framework in Frameworks */,
-				0017979F1074334C00F5D044 /* CoreAudio.framework in Frameworks */,
-				001797A01074334C00F5D044 /* ForceFeedback.framework in Frameworks */,
-				001797A11074334C00F5D044 /* IOKit.framework in Frameworks */,
-				001797A21074334C00F5D044 /* AudioToolbox.framework in Frameworks */,
-				001797A31074334C00F5D044 /* CoreFoundation.framework in Frameworks */,
-				001797A41074334C00F5D044 /* OpenGL.framework in Frameworks */,
-				001797A51074334C00F5D044 /* AudioUnit.framework in Frameworks */,
-				001797A61074334C00F5D044 /* Carbon.framework in Frameworks */,
-				001797A71074334C00F5D044 /* libSDL2.a in Frameworks */,
-				DB166DAA16A1D27700A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		001797BE107433C600F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001797C0107433C600F5D044 /* Cocoa.framework in Frameworks */,
-				001797C1107433C600F5D044 /* CoreAudio.framework in Frameworks */,
-				001797C2107433C600F5D044 /* ForceFeedback.framework in Frameworks */,
-				001797C3107433C600F5D044 /* IOKit.framework in Frameworks */,
-				001797C4107433C600F5D044 /* AudioToolbox.framework in Frameworks */,
-				001797C5107433C600F5D044 /* CoreFoundation.framework in Frameworks */,
-				001797C6107433C600F5D044 /* OpenGL.framework in Frameworks */,
-				001797C7107433C600F5D044 /* AudioUnit.framework in Frameworks */,
-				001797C8107433C600F5D044 /* Carbon.framework in Frameworks */,
-				001797C9107433C600F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		001798001074355200F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001798021074355200F5D044 /* Cocoa.framework in Frameworks */,
-				001798031074355200F5D044 /* CoreAudio.framework in Frameworks */,
-				001798041074355200F5D044 /* ForceFeedback.framework in Frameworks */,
-				001798051074355200F5D044 /* IOKit.framework in Frameworks */,
-				001798061074355200F5D044 /* AudioToolbox.framework in Frameworks */,
-				001798071074355200F5D044 /* CoreFoundation.framework in Frameworks */,
-				001798081074355200F5D044 /* OpenGL.framework in Frameworks */,
-				001798091074355200F5D044 /* AudioUnit.framework in Frameworks */,
-				0017980A1074355200F5D044 /* Carbon.framework in Frameworks */,
-				0017980B1074355200F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		001798821074392D00F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001798841074392D00F5D044 /* Cocoa.framework in Frameworks */,
-				001798851074392D00F5D044 /* CoreAudio.framework in Frameworks */,
-				001798861074392D00F5D044 /* ForceFeedback.framework in Frameworks */,
-				001798871074392D00F5D044 /* IOKit.framework in Frameworks */,
-				001798881074392D00F5D044 /* AudioToolbox.framework in Frameworks */,
-				001798891074392D00F5D044 /* CoreFoundation.framework in Frameworks */,
-				0017988A1074392D00F5D044 /* OpenGL.framework in Frameworks */,
-				0017988B1074392D00F5D044 /* AudioUnit.framework in Frameworks */,
-				0017988C1074392D00F5D044 /* Carbon.framework in Frameworks */,
-				0017988D1074392D00F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		001798A3107439DF00F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001798A5107439DF00F5D044 /* Cocoa.framework in Frameworks */,
-				001798A6107439DF00F5D044 /* CoreAudio.framework in Frameworks */,
-				001798A7107439DF00F5D044 /* ForceFeedback.framework in Frameworks */,
-				001798A8107439DF00F5D044 /* IOKit.framework in Frameworks */,
-				001798A9107439DF00F5D044 /* AudioToolbox.framework in Frameworks */,
-				001798AA107439DF00F5D044 /* CoreFoundation.framework in Frameworks */,
-				001798AB107439DF00F5D044 /* OpenGL.framework in Frameworks */,
-				001798AC107439DF00F5D044 /* AudioUnit.framework in Frameworks */,
-				001798AD107439DF00F5D044 /* Carbon.framework in Frameworks */,
-				001798AE107439DF00F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		001798E010743BEC00F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001798E210743BEC00F5D044 /* Cocoa.framework in Frameworks */,
-				001798E310743BEC00F5D044 /* CoreAudio.framework in Frameworks */,
-				001798E410743BEC00F5D044 /* ForceFeedback.framework in Frameworks */,
-				001798E510743BEC00F5D044 /* IOKit.framework in Frameworks */,
-				001798E610743BEC00F5D044 /* AudioToolbox.framework in Frameworks */,
-				001798E710743BEC00F5D044 /* CoreFoundation.framework in Frameworks */,
-				001798E810743BEC00F5D044 /* OpenGL.framework in Frameworks */,
-				001798E910743BEC00F5D044 /* AudioUnit.framework in Frameworks */,
-				001798EA10743BEC00F5D044 /* Carbon.framework in Frameworks */,
-				001798EB10743BEC00F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017990410743F1000F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017990610743F1000F5D044 /* Cocoa.framework in Frameworks */,
-				0017990710743F1000F5D044 /* CoreAudio.framework in Frameworks */,
-				0017990810743F1000F5D044 /* ForceFeedback.framework in Frameworks */,
-				0017990910743F1000F5D044 /* IOKit.framework in Frameworks */,
-				0017990A10743F1000F5D044 /* AudioToolbox.framework in Frameworks */,
-				0017990B10743F1000F5D044 /* CoreFoundation.framework in Frameworks */,
-				0017990C10743F1000F5D044 /* OpenGL.framework in Frameworks */,
-				0017990D10743F1000F5D044 /* AudioUnit.framework in Frameworks */,
-				0017990E10743F1000F5D044 /* Carbon.framework in Frameworks */,
-				0017990F10743F1000F5D044 /* libSDL2.a in Frameworks */,
-				DB166DAB16A1D27C00A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017992610743FB700F5D044 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017992810743FB700F5D044 /* Cocoa.framework in Frameworks */,
-				0017992910743FB700F5D044 /* CoreAudio.framework in Frameworks */,
-				0017992A10743FB700F5D044 /* ForceFeedback.framework in Frameworks */,
-				0017992B10743FB700F5D044 /* IOKit.framework in Frameworks */,
-				0017992C10743FB700F5D044 /* AudioToolbox.framework in Frameworks */,
-				0017992D10743FB700F5D044 /* CoreFoundation.framework in Frameworks */,
-				0017992E10743FB700F5D044 /* OpenGL.framework in Frameworks */,
-				0017992F10743FB700F5D044 /* AudioUnit.framework in Frameworks */,
-				0017993010743FB700F5D044 /* Carbon.framework in Frameworks */,
-				0017993110743FB700F5D044 /* libSDL2.a in Frameworks */,
-				DB166DAC16A1D29000A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		002F340809CA1BFF00EBEB88 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F340B09CA1BFF00EBEB88 /* Cocoa.framework in Frameworks */,
-				002A866B10730548007319AE /* CoreAudio.framework in Frameworks */,
-				002A866C10730548007319AE /* ForceFeedback.framework in Frameworks */,
-				002A866D10730548007319AE /* IOKit.framework in Frameworks */,
-				002A86BF10730595007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86C010730595007319AE /* CoreFoundation.framework in Frameworks */,
-				002A8702107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A872410730624007319AE /* AudioUnit.framework in Frameworks */,
-				002A874910730676007319AE /* Carbon.framework in Frameworks */,
-				001794D11073667B00F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		002F342709CA1F0300EBEB88 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F342A09CA1F0300EBEB88 /* Cocoa.framework in Frameworks */,
-				002A866210730547007319AE /* CoreAudio.framework in Frameworks */,
-				002A866310730547007319AE /* ForceFeedback.framework in Frameworks */,
-				002A866410730547007319AE /* IOKit.framework in Frameworks */,
-				002A86B910730594007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86BA10730594007319AE /* CoreFoundation.framework in Frameworks */,
-				002A86FF107305CE007319AE /* OpenGL.framework in Frameworks */,
-				002A872110730624007319AE /* AudioUnit.framework in Frameworks */,
-				002A874610730676007319AE /* Carbon.framework in Frameworks */,
-				001794D41073668800F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		002F344309CA1FB300EBEB88 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F344609CA1FB300EBEB88 /* Cocoa.framework in Frameworks */,
-				002A868010730549007319AE /* CoreAudio.framework in Frameworks */,
-				002A868110730549007319AE /* ForceFeedback.framework in Frameworks */,
-				002A868210730549007319AE /* IOKit.framework in Frameworks */,
-				002A86CD10730595007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86CE10730596007319AE /* CoreFoundation.framework in Frameworks */,
-				002A8709107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A872B10730624007319AE /* AudioUnit.framework in Frameworks */,
-				002A875010730677007319AE /* Carbon.framework in Frameworks */,
-				001794D91073669E00F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		002F346009CA204F00EBEB88 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F346309CA204F00EBEB88 /* Cocoa.framework in Frameworks */,
-				002A868610730549007319AE /* CoreAudio.framework in Frameworks */,
-				002A868710730549007319AE /* ForceFeedback.framework in Frameworks */,
-				002A868810730549007319AE /* IOKit.framework in Frameworks */,
-				002A86D110730596007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86D210730596007319AE /* CoreFoundation.framework in Frameworks */,
-				002A870B107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A872D10730624007319AE /* AudioUnit.framework in Frameworks */,
-				002A875210730677007319AE /* Carbon.framework in Frameworks */,
-				001794DB107366A700F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		4537749012091504002F0F45 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166D7116A1CFB200A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166D7216A1CFB200A1396C /* AudioUnit.framework in Frameworks */,
-				DB166D7316A1CFB200A1396C /* Carbon.framework in Frameworks */,
-				DB166D7416A1CFB200A1396C /* Cocoa.framework in Frameworks */,
-				DB166D7516A1CFB200A1396C /* CoreAudio.framework in Frameworks */,
-				DB166D7616A1CFB200A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166D7716A1CFB200A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166D7816A1CFB200A1396C /* IOKit.framework in Frameworks */,
-				DB166D7916A1CFB200A1396C /* OpenGL.framework in Frameworks */,
-				DB166D7A16A1CFD500A1396C /* libSDL2.a in Frameworks */,
-				DB166DA416A1D21700A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BBFC08BE164C6862003E6A99 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BBFC08C0164C6862003E6A99 /* Cocoa.framework in Frameworks */,
-				BBFC08C1164C6862003E6A99 /* CoreAudio.framework in Frameworks */,
-				BBFC08C2164C6862003E6A99 /* ForceFeedback.framework in Frameworks */,
-				BBFC08C3164C6862003E6A99 /* IOKit.framework in Frameworks */,
-				BBFC08C4164C6862003E6A99 /* AudioToolbox.framework in Frameworks */,
-				BBFC08C5164C6862003E6A99 /* CoreFoundation.framework in Frameworks */,
-				BBFC08C6164C6862003E6A99 /* OpenGL.framework in Frameworks */,
-				BBFC08C7164C6862003E6A99 /* AudioUnit.framework in Frameworks */,
-				BBFC08C8164C6862003E6A99 /* Carbon.framework in Frameworks */,
-				BBFC08C9164C6862003E6A99 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC566B20761D90300A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33C109CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A863010730405007319AE /* libSDL2.a in Frameworks */,
-				002A864D10730546007319AE /* CoreAudio.framework in Frameworks */,
-				002A864E10730546007319AE /* ForceFeedback.framework in Frameworks */,
-				002A864F10730546007319AE /* IOKit.framework in Frameworks */,
-				002A86AB10730594007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86AC10730594007319AE /* CoreFoundation.framework in Frameworks */,
-				002A86F8107305CE007319AE /* OpenGL.framework in Frameworks */,
-				002A871A10730623007319AE /* AudioUnit.framework in Frameworks */,
-				002A873F10730675007319AE /* Carbon.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC566CC0761D90300A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33BF09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A865310730547007319AE /* CoreAudio.framework in Frameworks */,
-				002A865410730547007319AE /* ForceFeedback.framework in Frameworks */,
-				002A865510730547007319AE /* IOKit.framework in Frameworks */,
-				002A86AF10730594007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86B010730594007319AE /* CoreFoundation.framework in Frameworks */,
-				002A86FA107305CE007319AE /* OpenGL.framework in Frameworks */,
-				002A871C10730623007319AE /* AudioUnit.framework in Frameworks */,
-				002A874110730676007319AE /* Carbon.framework in Frameworks */,
-				002A875E10730745007319AE /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567020761D90300A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33BC09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A866E10730548007319AE /* CoreAudio.framework in Frameworks */,
-				002A866F10730548007319AE /* ForceFeedback.framework in Frameworks */,
-				002A867010730548007319AE /* IOKit.framework in Frameworks */,
-				002A86C110730595007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86C210730595007319AE /* CoreFoundation.framework in Frameworks */,
-				002A8703107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A872510730624007319AE /* AudioUnit.framework in Frameworks */,
-				002A874A10730676007319AE /* Carbon.framework in Frameworks */,
-				001794D01073667700F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC5672A0761D90400A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33B809CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A868F1073054A007319AE /* CoreAudio.framework in Frameworks */,
-				002A86901073054A007319AE /* ForceFeedback.framework in Frameworks */,
-				002A86911073054A007319AE /* IOKit.framework in Frameworks */,
-				002A86D710730596007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86D810730596007319AE /* CoreFoundation.framework in Frameworks */,
-				002A870E107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A873010730625007319AE /* AudioUnit.framework in Frameworks */,
-				002A875510730677007319AE /* Carbon.framework in Frameworks */,
-				001794DE107366B900F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567370761D90400A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33B709CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A867410730548007319AE /* CoreAudio.framework in Frameworks */,
-				002A867510730548007319AE /* ForceFeedback.framework in Frameworks */,
-				002A867610730548007319AE /* IOKit.framework in Frameworks */,
-				002A86C510730595007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86C610730595007319AE /* CoreFoundation.framework in Frameworks */,
-				002A8705107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A872710730624007319AE /* AudioUnit.framework in Frameworks */,
-				002A874C10730676007319AE /* Carbon.framework in Frameworks */,
-				001794D51073668D00F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567440761D90400A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33B509CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A867710730548007319AE /* CoreAudio.framework in Frameworks */,
-				002A867810730548007319AE /* ForceFeedback.framework in Frameworks */,
-				002A867910730549007319AE /* IOKit.framework in Frameworks */,
-				002A86C710730595007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86C810730595007319AE /* CoreFoundation.framework in Frameworks */,
-				002A8706107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A872810730624007319AE /* AudioUnit.framework in Frameworks */,
-				002A874D10730677007319AE /* Carbon.framework in Frameworks */,
-				001794D61073669200F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567510761D90400A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33B609CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A867A10730549007319AE /* CoreAudio.framework in Frameworks */,
-				002A867B10730549007319AE /* ForceFeedback.framework in Frameworks */,
-				002A867C10730549007319AE /* IOKit.framework in Frameworks */,
-				002A86C910730595007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86CA10730595007319AE /* CoreFoundation.framework in Frameworks */,
-				002A8707107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A872910730624007319AE /* AudioUnit.framework in Frameworks */,
-				002A874E10730677007319AE /* Carbon.framework in Frameworks */,
-				001794D71073669700F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567790761D90500A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33B209CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A868910730549007319AE /* CoreAudio.framework in Frameworks */,
-				002A868A10730549007319AE /* ForceFeedback.framework in Frameworks */,
-				002A868B1073054A007319AE /* IOKit.framework in Frameworks */,
-				002A86D310730596007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86D410730596007319AE /* CoreFoundation.framework in Frameworks */,
-				002A870C107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A872E10730624007319AE /* AudioUnit.framework in Frameworks */,
-				002A875310730677007319AE /* Carbon.framework in Frameworks */,
-				001794DC107366AC00F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567940761D90500A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33B009CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A86981073054A007319AE /* CoreAudio.framework in Frameworks */,
-				002A86991073054A007319AE /* ForceFeedback.framework in Frameworks */,
-				002A869A1073054A007319AE /* IOKit.framework in Frameworks */,
-				002A86DD10730596007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86DE10730596007319AE /* CoreFoundation.framework in Frameworks */,
-				002A8711107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A873310730625007319AE /* AudioUnit.framework in Frameworks */,
-				002A875810730678007319AE /* Carbon.framework in Frameworks */,
-				001794DF107366BD00F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567AE0761D90500A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33AF09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A86951073054A007319AE /* CoreAudio.framework in Frameworks */,
-				002A86961073054A007319AE /* ForceFeedback.framework in Frameworks */,
-				002A86971073054A007319AE /* IOKit.framework in Frameworks */,
-				002A86DB10730596007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86DC10730596007319AE /* CoreFoundation.framework in Frameworks */,
-				002A8710107305CF007319AE /* OpenGL.framework in Frameworks */,
-				002A873210730625007319AE /* AudioUnit.framework in Frameworks */,
-				002A875710730678007319AE /* Carbon.framework in Frameworks */,
-				001794E0107366C100F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567F10761D90600A33029 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F33AA09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
-				002A864110730546007319AE /* CoreAudio.framework in Frameworks */,
-				002A864210730546007319AE /* ForceFeedback.framework in Frameworks */,
-				002A864310730546007319AE /* IOKit.framework in Frameworks */,
-				002A86A310730593007319AE /* AudioToolbox.framework in Frameworks */,
-				002A86A410730593007319AE /* CoreFoundation.framework in Frameworks */,
-				002A86F4107305CE007319AE /* OpenGL.framework in Frameworks */,
-				002A871610730623007319AE /* AudioUnit.framework in Frameworks */,
-				002A873B10730675007319AE /* Carbon.framework in Frameworks */,
-				001794E5107366D900F5D044 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB0F48DC17CA51E5008798C5 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB0F48DD17CA51E5008798C5 /* Cocoa.framework in Frameworks */,
-				DB0F48DE17CA51E5008798C5 /* CoreAudio.framework in Frameworks */,
-				DB0F48DF17CA51E5008798C5 /* ForceFeedback.framework in Frameworks */,
-				DB0F48E017CA51E5008798C5 /* IOKit.framework in Frameworks */,
-				DB0F48E117CA51E5008798C5 /* AudioToolbox.framework in Frameworks */,
-				DB0F48E217CA51E5008798C5 /* CoreFoundation.framework in Frameworks */,
-				DB0F48E317CA51E5008798C5 /* OpenGL.framework in Frameworks */,
-				DB0F48E417CA51E5008798C5 /* AudioUnit.framework in Frameworks */,
-				DB0F48E517CA51E5008798C5 /* Carbon.framework in Frameworks */,
-				DB0F48E617CA51E5008798C5 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB0F48F217CA5212008798C5 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB0F48F317CA5212008798C5 /* Cocoa.framework in Frameworks */,
-				DB0F48F417CA5212008798C5 /* CoreAudio.framework in Frameworks */,
-				DB0F48F517CA5212008798C5 /* ForceFeedback.framework in Frameworks */,
-				DB0F48F617CA5212008798C5 /* IOKit.framework in Frameworks */,
-				DB0F48F717CA5212008798C5 /* AudioToolbox.framework in Frameworks */,
-				DB0F48F817CA5212008798C5 /* CoreFoundation.framework in Frameworks */,
-				DB0F48F917CA5212008798C5 /* OpenGL.framework in Frameworks */,
-				DB0F48FA17CA5212008798C5 /* AudioUnit.framework in Frameworks */,
-				DB0F48FB17CA5212008798C5 /* Carbon.framework in Frameworks */,
-				DB0F48FC17CA5212008798C5 /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166D7C16A1D12400A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166DB016A1D2F600A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166DB116A1D2F600A1396C /* Cocoa.framework in Frameworks */,
-				DB166DB216A1D2F600A1396C /* CoreAudio.framework in Frameworks */,
-				DB166DB316A1D2F600A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166DB416A1D2F600A1396C /* IOKit.framework in Frameworks */,
-				DB166DB516A1D2F600A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166DB616A1D2F600A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166DB716A1D2F600A1396C /* OpenGL.framework in Frameworks */,
-				DB166DB816A1D2F600A1396C /* AudioUnit.framework in Frameworks */,
-				DB166DB916A1D2F600A1396C /* Carbon.framework in Frameworks */,
-				DB166DBA16A1D2F600A1396C /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166DC716A1D36A00A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166DC816A1D36A00A1396C /* Cocoa.framework in Frameworks */,
-				DB166DC916A1D36A00A1396C /* CoreAudio.framework in Frameworks */,
-				DB166DCA16A1D36A00A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166DCB16A1D36A00A1396C /* IOKit.framework in Frameworks */,
-				DB166DCC16A1D36A00A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166DCD16A1D36A00A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166DCE16A1D36A00A1396C /* OpenGL.framework in Frameworks */,
-				DB166DCF16A1D36A00A1396C /* AudioUnit.framework in Frameworks */,
-				DB166DD016A1D36A00A1396C /* Carbon.framework in Frameworks */,
-				DB166DD116A1D36A00A1396C /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166DDF16A1D50C00A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166DE016A1D50C00A1396C /* Cocoa.framework in Frameworks */,
-				DB166DE116A1D50C00A1396C /* CoreAudio.framework in Frameworks */,
-				DB166DE216A1D50C00A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166DE316A1D50C00A1396C /* IOKit.framework in Frameworks */,
-				DB166DE416A1D50C00A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166DE516A1D50C00A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166DE616A1D50C00A1396C /* OpenGL.framework in Frameworks */,
-				DB166DE716A1D50C00A1396C /* AudioUnit.framework in Frameworks */,
-				DB166DE816A1D50C00A1396C /* Carbon.framework in Frameworks */,
-				DB166DE916A1D50C00A1396C /* libSDL2.a in Frameworks */,
-				DB166DEA16A1D50C00A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166DF616A1D57C00A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166DF716A1D57C00A1396C /* Cocoa.framework in Frameworks */,
-				DB166DF816A1D57C00A1396C /* CoreAudio.framework in Frameworks */,
-				DB166DF916A1D57C00A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166DFA16A1D57C00A1396C /* IOKit.framework in Frameworks */,
-				DB166DFB16A1D57C00A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166DFC16A1D57C00A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166DFD16A1D57C00A1396C /* OpenGL.framework in Frameworks */,
-				DB166DFE16A1D57C00A1396C /* AudioUnit.framework in Frameworks */,
-				DB166DFF16A1D57C00A1396C /* Carbon.framework in Frameworks */,
-				DB166E0016A1D57C00A1396C /* libSDL2.a in Frameworks */,
-				DB166E0116A1D57C00A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E0D16A1D5AD00A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E0E16A1D5AD00A1396C /* Cocoa.framework in Frameworks */,
-				DB166E0F16A1D5AD00A1396C /* CoreAudio.framework in Frameworks */,
-				DB166E1016A1D5AD00A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166E1116A1D5AD00A1396C /* IOKit.framework in Frameworks */,
-				DB166E1216A1D5AD00A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166E1316A1D5AD00A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166E1416A1D5AD00A1396C /* OpenGL.framework in Frameworks */,
-				DB166E1516A1D5AD00A1396C /* AudioUnit.framework in Frameworks */,
-				DB166E1616A1D5AD00A1396C /* Carbon.framework in Frameworks */,
-				DB166E1716A1D5AD00A1396C /* libSDL2.a in Frameworks */,
-				DB166E1816A1D5AD00A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E2A16A1D64D00A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E2B16A1D64D00A1396C /* Cocoa.framework in Frameworks */,
-				DB166E2C16A1D64D00A1396C /* CoreAudio.framework in Frameworks */,
-				DB166E2D16A1D64D00A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166E2E16A1D64D00A1396C /* IOKit.framework in Frameworks */,
-				DB166E2F16A1D64D00A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166E3016A1D64D00A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166E3116A1D64D00A1396C /* OpenGL.framework in Frameworks */,
-				DB166E3216A1D64D00A1396C /* AudioUnit.framework in Frameworks */,
-				DB166E3316A1D64D00A1396C /* Carbon.framework in Frameworks */,
-				DB166E3416A1D64D00A1396C /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E4016A1D69000A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E4116A1D69000A1396C /* Cocoa.framework in Frameworks */,
-				DB166E4216A1D69000A1396C /* CoreAudio.framework in Frameworks */,
-				DB166E4316A1D69000A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166E4416A1D69000A1396C /* IOKit.framework in Frameworks */,
-				DB166E4516A1D69000A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166E4616A1D69000A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166E4716A1D69000A1396C /* OpenGL.framework in Frameworks */,
-				DB166E4816A1D69000A1396C /* AudioUnit.framework in Frameworks */,
-				DB166E4916A1D69000A1396C /* Carbon.framework in Frameworks */,
-				DB166E4A16A1D69000A1396C /* libSDL2.a in Frameworks */,
-				DB166E4B16A1D69000A1396C /* libSDL_test.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E5A16A1D6F300A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E5B16A1D6F300A1396C /* Cocoa.framework in Frameworks */,
-				DB166E5C16A1D6F300A1396C /* CoreAudio.framework in Frameworks */,
-				DB166E5D16A1D6F300A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166E5E16A1D6F300A1396C /* IOKit.framework in Frameworks */,
-				DB166E5F16A1D6F300A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166E6016A1D6F300A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166E6116A1D6F300A1396C /* OpenGL.framework in Frameworks */,
-				DB166E6216A1D6F300A1396C /* AudioUnit.framework in Frameworks */,
-				DB166E6316A1D6F300A1396C /* Carbon.framework in Frameworks */,
-				DB166E6416A1D6F300A1396C /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E7016A1D78400A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E7116A1D78400A1396C /* Cocoa.framework in Frameworks */,
-				DB166E7216A1D78400A1396C /* CoreAudio.framework in Frameworks */,
-				DB166E7316A1D78400A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166E7416A1D78400A1396C /* IOKit.framework in Frameworks */,
-				DB166E7516A1D78400A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166E7616A1D78400A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166E7716A1D78400A1396C /* OpenGL.framework in Frameworks */,
-				DB166E7816A1D78400A1396C /* AudioUnit.framework in Frameworks */,
-				DB166E7916A1D78400A1396C /* Carbon.framework in Frameworks */,
-				DB166E7A16A1D78400A1396C /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E8316A1D78C00A1396C /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E8416A1D78C00A1396C /* Cocoa.framework in Frameworks */,
-				DB166E8516A1D78C00A1396C /* CoreAudio.framework in Frameworks */,
-				DB166E8616A1D78C00A1396C /* ForceFeedback.framework in Frameworks */,
-				DB166E8716A1D78C00A1396C /* IOKit.framework in Frameworks */,
-				DB166E8816A1D78C00A1396C /* AudioToolbox.framework in Frameworks */,
-				DB166E8916A1D78C00A1396C /* CoreFoundation.framework in Frameworks */,
-				DB166E8A16A1D78C00A1396C /* OpenGL.framework in Frameworks */,
-				DB166E8B16A1D78C00A1396C /* AudioUnit.framework in Frameworks */,
-				DB166E8C16A1D78C00A1396C /* Carbon.framework in Frameworks */,
-				DB166E8D16A1D78C00A1396C /* libSDL2.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		002F33A209CA183B00EBEB88 /* Linked Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				002A869F10730593007319AE /* AudioToolbox.framework */,
-				002A871410730623007319AE /* AudioUnit.framework */,
-				002A873910730675007319AE /* Carbon.framework */,
-				002F33A709CA188600EBEB88 /* Cocoa.framework */,
-				002A863B10730545007319AE /* CoreAudio.framework */,
-				002A86A010730593007319AE /* CoreFoundation.framework */,
-				002A863C10730545007319AE /* ForceFeedback.framework */,
-				002A863D10730545007319AE /* IOKit.framework */,
-				002A86F2107305CE007319AE /* OpenGL.framework */,
-			);
-			name = "Linked Frameworks";
-			sourceTree = "<group>";
-		};
-		003FA63B093FFD41000C53B3 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				003FA643093FFD41000C53B3 /* SDL2.framework */,
-				003FA645093FFD41000C53B3 /* libSDL2.a */,
-				DB1D40D717B3F30D00D74CFC /* libSDL2.dylib */,
-				003FA649093FFD41000C53B3 /* Standard DMG */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		00794E4609D207B4003FC8A1 /* Resources */ = {
-			isa = PBXGroup;
-			children = (
-				DB166ECF16A1D87000A1396C /* shapes */,
-				00794E5D09D20839003FC8A1 /* icon.bmp */,
-				00794E5E09D20839003FC8A1 /* moose.dat */,
-				00794E5F09D20839003FC8A1 /* picture.xbm */,
-				00794E6109D20839003FC8A1 /* sample.bmp */,
-				00794E6209D20839003FC8A1 /* sample.wav */,
-				00794E6309D20839003FC8A1 /* utf8.txt */,
-			);
-			name = Resources;
-			sourceTree = "<group>";
-		};
-		08FB7794FE84155DC02AAC07 /* SDLTest */ = {
-			isa = PBXGroup;
-			children = (
-				003FA63A093FFD41000C53B3 /* SDL.xcodeproj */,
-				08FB7795FE84155DC02AAC07 /* Source */,
-				DB166D8316A1D17E00A1396C /* SDL_Test */,
-				002F33A209CA183B00EBEB88 /* Linked Frameworks */,
-				00794E4609D207B4003FC8A1 /* Resources */,
-				1AB674ADFE9D54B511CA2CBB /* Products */,
-			);
-			comments = "I made these tests link against our \"default\" framework which includes X11 stuff. If you didn't install the X11 headers with Xcode, you might have problems building the SDL.framework (which is a dependency). You can swap the dependencies around to get around this, or you can modify the default SDL.framework target to not include X11 stuff. (Go into its target build options and remove all the Preprocessor macros.)\n\n\n\nWe are sort of in a half-way state at the moment. Going \"all-the-way\" means we copy the SDL.framework inside the app bundle so we can run the test without the step of the user \"installing\" the framework. But there is an oversight/bug in Xcode that doesn't correctly find the location of the framework when in an embedded/nested Xcode project. We could probably try to hack this with a shell script that checks multiple directories for existence, but this is messier and more work than I prefer, so I rather just wait for Apple to fix this. In the meantime...\n\nThe \"All\" target will build the SDL framework from the Xcode project. The other targets do not have this dependency set (for flexibility reasons in case we make changes). If you have not built the framework, you will probably be unable to link. You will either need to build the framework, or you need to add \"-framework SDL\" to the link options and make sure you have the SDL.framework installed somewhere where it can be seen (like /Library/Frameworks...I think we already set this one up.) \n\nTo run though, you should have a copy of the SDL.framework in /Library/Frameworks or ~/Library/Frameworks.\n\n\n\n\ntestgl and testdyngl need -DHAVE_OPENGL\ntestgl needs to link against OpenGL.framework\n\n";
-			name = SDLTest;
-			sourceTree = "<group>";
-		};
-		08FB7795FE84155DC02AAC07 /* Source */ = {
-			isa = PBXGroup;
-			children = (
-				092D6D10FFB30A2C7F000001 /* checkkeys.c */,
-				083E4872006D84C97F000001 /* loopwave.c */,
-				0017958F1074216E00F5D044 /* testatomic.c */,
-				001795B01074222D00F5D044 /* testaudioinfo.c */,
-				001797711074320D00F5D044 /* testdraw2.c */,
-				DB0F48D717CA51D2008798C5 /* testdrawchessboard.c */,
-				083E4878006D85357F000001 /* testerror.c */,
-				002F341709CA1C5B00EBEB88 /* testfile.c */,
-				DB0F48D817CA51D2008798C5 /* testfilesystem.c */,
-				BBFC088E164C6820003E6A99 /* testgamecontroller.c */,
-				DB166CBB16A1C74100A1396C /* testgesture.c */,
-				0017972710742FB900F5D044 /* testgl2.c */,
-				DB166CBC16A1C74100A1396C /* testgles.c */,
-				0017974E1074315700F5D044 /* testhaptic.c */,
-				002F343609CA1F6F00EBEB88 /* testiconv.c */,
-				00179791107432FA00F5D044 /* testime.c */,
-				001797B31074339C00F5D044 /* testintersections.c */,
-				092D6D62FFB312AA7F000001 /* testjoystick.c */,
-				092D6D6CFFB313437F000001 /* testkeys.c */,
-				001797D31074343E00F5D044 /* testloadso.c */,
-				092D6D75FFB313BB7F000001 /* testlock.c */,
-				DB166CBD16A1C74100A1396C /* testmessage.c */,
-				001798151074359B00F5D044 /* testmultiaudio.c */,
-				0017985A107436ED00F5D044 /* testnative.c */,
-				0017985B107436ED00F5D044 /* testnative.h */,
-				0017985C107436ED00F5D044 /* testnativecocoa.m */,
-				00179872107438D000F5D044 /* testnativex11.c */,
-				002F345209CA201C00EBEB88 /* testoverlay2.c */,
-				002F346F09CA20A600EBEB88 /* testplatform.c */,
-				001798B910743A4900F5D044 /* testpower.c */,
-				DB166CBF16A1C74100A1396C /* testrelative.c */,
-				DB166CC016A1C74100A1396C /* testrendercopyex.c */,
-				DB166CC116A1C74100A1396C /* testrendertarget.c */,
-				001798F910743E9200F5D044 /* testresample.c */,
-				DB166CC216A1C74100A1396C /* testrumble.c */,
-				DB166CC316A1C74100A1396C /* testscale.c */,
-				083E487E006D86A17F000001 /* testsem.c */,
-				DB166CC416A1C74100A1396C /* testshader.c */,
-				453774A4120915E3002F0F45 /* testshape.c */,
-				0017991910743F5300F5D044 /* testsprite2.c */,
-				DB166CC516A1C74100A1396C /* testspriteminimal.c */,
-				DB166CC616A1C74100A1396C /* teststreaming.c */,
-				092D6D58FFB311A97F000001 /* testthread.c */,
-				083E4880006D86A17F000001 /* testtimer.c */,
-				083E4882006D86A17F000001 /* testver.c */,
-				0017993B10743FEF00F5D044 /* testwm2.c */,
-				083E4887006D86A17F000001 /* torturethread.c */,
-			);
-			name = Source;
-			sourceTree = "<group>";
-		};
-		1AB674ADFE9D54B511CA2CBB /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				BEC566B60761D90300A33029 /* checkkeys */,
-				BEC566D10761D90300A33029 /* loopwave */,
-				BEC567060761D90400A33029 /* testerror */,
-				BEC5672E0761D90400A33029 /* testthread */,
-				BEC5673B0761D90400A33029 /* testjoystick */,
-				BEC567480761D90400A33029 /* testkeys */,
-				BEC567550761D90400A33029 /* testlock */,
-				BEC5677D0761D90500A33029 /* testsem */,
-				BEC567980761D90500A33029 /* testtimer */,
-				BEC567B20761D90500A33029 /* testversion */,
-				BEC567F50761D90600A33029 /* torturethread */,
-				002F341209CA1BFF00EBEB88 /* testfile */,
-				002F343109CA1F0300EBEB88 /* testiconv */,
-				002F344D09CA1FB300EBEB88 /* testoverlay2 */,
-				002F346A09CA204F00EBEB88 /* testplatform */,
-				0017958C10741F7900F5D044 /* testatomic */,
-				001795AD107421BF00F5D044 /* testaudioinfo */,
-				0017972110742F3200F5D044 /* testgl2 */,
-				00179748107430D600F5D044 /* testhaptic */,
-				0017976E107431B300F5D044 /* testdraw2 */,
-				0017978E107432AE00F5D044 /* testime */,
-				001797AE1074334C00F5D044 /* testintersections */,
-				001797D0107433C600F5D044 /* testloadso */,
-				001798121074355200F5D044 /* testmultiaudio */,
-				001798941074392D00F5D044 /* testnative */,
-				001798B5107439DF00F5D044 /* testpower */,
-				001798F210743BEC00F5D044 /* testresample */,
-				0017991610743F1000F5D044 /* testsprite2 */,
-				0017993810743FB700F5D044 /* testwm2 */,
-				4537749212091504002F0F45 /* testshape */,
-				BBFC08CD164C6862003E6A99 /* testgamecontroller */,
-				DB166D7F16A1D12400A1396C /* libSDL_test.a */,
-				DB166DBF16A1D2F600A1396C /* testgesture */,
-				DB166DD516A1D36A00A1396C /* testmessage */,
-				DB166DEE16A1D50C00A1396C /* testrelative */,
-				DB166E0516A1D57C00A1396C /* testrendercopyex */,
-				DB166E1C16A1D5AD00A1396C /* testrendertarget */,
-				DB166E3816A1D64D00A1396C /* testrumble */,
-				DB166E5216A1D69000A1396C /* testscale */,
-				DB166E6816A1D6F300A1396C /* testshader */,
-				DB166E7E16A1D78400A1396C /* testspriteminimal */,
-				DB166E9116A1D78C00A1396C /* teststreaming */,
-				DB0F48EC17CA51E5008798C5 /* testdrawchessboard */,
-				DB0F490117CA5212008798C5 /* testfilesystem */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		DB166D8316A1D17E00A1396C /* SDL_Test */ = {
-			isa = PBXGroup;
-			children = (
-				DB166D8416A1D1A500A1396C /* SDL_test_assert.c */,
-				DB166D8516A1D1A500A1396C /* SDL_test_common.c */,
-				DB166D8616A1D1A500A1396C /* SDL_test_compare.c */,
-				DB166D8716A1D1A500A1396C /* SDL_test_crc32.c */,
-				DB166D8816A1D1A500A1396C /* SDL_test_font.c */,
-				DB166D8916A1D1A500A1396C /* SDL_test_fuzzer.c */,
-				DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */,
-				DB166D8B16A1D1A500A1396C /* SDL_test_imageBlit.c */,
-				DB166D8C16A1D1A500A1396C /* SDL_test_imageBlitBlend.c */,
-				DB166D8D16A1D1A500A1396C /* SDL_test_imageFace.c */,
-				DB166D8E16A1D1A500A1396C /* SDL_test_imagePrimitives.c */,
-				DB166D8F16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c */,
-				DB166D9016A1D1A500A1396C /* SDL_test_log.c */,
-				DB166D9116A1D1A500A1396C /* SDL_test_md5.c */,
-				DB166D9216A1D1A500A1396C /* SDL_test_random.c */,
-			);
-			name = SDL_Test;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
-		DB166D7D16A1D12400A1396C /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
-		0017957410741F7900F5D044 /* testatomic */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 0017958610741F7900F5D044 /* Build configuration list for PBXNativeTarget "testatomic" */;
-			buildPhases = (
-				0017957910741F7900F5D044 /* Sources */,
-				0017957A10741F7900F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testatomic;
-			productName = testalpha;
-			productReference = 0017958C10741F7900F5D044 /* testatomic */;
-			productType = "com.apple.product-type.tool";
-		};
-		00179595107421BF00F5D044 /* testaudioinfo */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001795A7107421BF00F5D044 /* Build configuration list for PBXNativeTarget "testaudioinfo" */;
-			buildPhases = (
-				0017959A107421BF00F5D044 /* Sources */,
-				0017959B107421BF00F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testaudioinfo;
-			productName = testalpha;
-			productReference = 001795AD107421BF00F5D044 /* testaudioinfo */;
-			productType = "com.apple.product-type.tool";
-		};
-		0017970910742F3200F5D044 /* testgl2 */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 0017971B10742F3200F5D044 /* Build configuration list for PBXNativeTarget "testgl2" */;
-			buildPhases = (
-				0017970E10742F3200F5D044 /* Sources */,
-				0017970F10742F3200F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testgl2;
-			productName = testalpha;
-			productReference = 0017972110742F3200F5D044 /* testgl2 */;
-			productType = "com.apple.product-type.tool";
-		};
-		00179730107430D600F5D044 /* testhaptic */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 00179742107430D600F5D044 /* Build configuration list for PBXNativeTarget "testhaptic" */;
-			buildPhases = (
-				00179735107430D600F5D044 /* Sources */,
-				00179736107430D600F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testhaptic;
-			productName = testalpha;
-			productReference = 00179748107430D600F5D044 /* testhaptic */;
-			productType = "com.apple.product-type.tool";
-		};
-		00179756107431B300F5D044 /* testdraw2 */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 00179768107431B300F5D044 /* Build configuration list for PBXNativeTarget "testdraw2" */;
-			buildPhases = (
-				0017975B107431B300F5D044 /* Sources */,
-				0017975C107431B300F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testdraw2;
-			productName = testalpha;
-			productReference = 0017976E107431B300F5D044 /* testdraw2 */;
-			productType = "com.apple.product-type.tool";
-		};
-		00179776107432AE00F5D044 /* testime */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 00179788107432AE00F5D044 /* Build configuration list for PBXNativeTarget "testime" */;
-			buildPhases = (
-				0017977B107432AE00F5D044 /* Sources */,
-				0017977C107432AE00F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testime;
-			productName = testalpha;
-			productReference = 0017978E107432AE00F5D044 /* testime */;
-			productType = "com.apple.product-type.tool";
-		};
-		001797961074334C00F5D044 /* testintersections */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001797A81074334C00F5D044 /* Build configuration list for PBXNativeTarget "testintersections" */;
-			buildPhases = (
-				0017979B1074334C00F5D044 /* Sources */,
-				0017979C1074334C00F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testintersections;
-			productName = testalpha;
-			productReference = 001797AE1074334C00F5D044 /* testintersections */;
-			productType = "com.apple.product-type.tool";
-		};
-		001797B8107433C600F5D044 /* testloadso */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001797CA107433C600F5D044 /* Build configuration list for PBXNativeTarget "testloadso" */;
-			buildPhases = (
-				001797BD107433C600F5D044 /* Sources */,
-				001797BE107433C600F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testloadso;
-			productName = testalpha;
-			productReference = 001797D0107433C600F5D044 /* testloadso */;
-			productType = "com.apple.product-type.tool";
-		};
-		001797FA1074355200F5D044 /* testmultiaudio */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 0017980C1074355200F5D044 /* Build configuration list for PBXNativeTarget "testmultiaudio" */;
-			buildPhases = (
-				001797FF1074355200F5D044 /* Sources */,
-				001798001074355200F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testmultiaudio;
-			productName = testalpha;
-			productReference = 001798121074355200F5D044 /* testmultiaudio */;
-			productType = "com.apple.product-type.tool";
-		};
-		001798781074392D00F5D044 /* testnative */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 0017988E1074392D00F5D044 /* Build configuration list for PBXNativeTarget "testnative" */;
-			buildPhases = (
-				0017987E1074392D00F5D044 /* Sources */,
-				001798821074392D00F5D044 /* Frameworks */,
-				DB166DDA16A1D40F00A1396C /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testnative;
-			productName = testalpha;
-			productReference = 001798941074392D00F5D044 /* testnative */;
-			productType = "com.apple.product-type.tool";
-		};
-		0017989D107439DF00F5D044 /* testpower */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001798AF107439DF00F5D044 /* Build configuration list for PBXNativeTarget "testpower" */;
-			buildPhases = (
-				001798A2107439DF00F5D044 /* Sources */,
-				001798A3107439DF00F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testpower;
-			productName = testalpha;
-			productReference = 001798B5107439DF00F5D044 /* testpower */;
-			productType = "com.apple.product-type.tool";
-		};
-		001798DA10743BEC00F5D044 /* testresample */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001798EC10743BEC00F5D044 /* Build configuration list for PBXNativeTarget "testresample" */;
-			buildPhases = (
-				001798DF10743BEC00F5D044 /* Sources */,
-				001798E010743BEC00F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testresample;
-			productName = testalpha;
-			productReference = 001798F210743BEC00F5D044 /* testresample */;
-			productType = "com.apple.product-type.tool";
-		};
-		001798FE10743F1000F5D044 /* testsprite2 */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 0017991010743F1000F5D044 /* Build configuration list for PBXNativeTarget "testsprite2" */;
-			buildPhases = (
-				0017990310743F1000F5D044 /* Sources */,
-				0017990410743F1000F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testsprite2;
-			productName = testalpha;
-			productReference = 0017991610743F1000F5D044 /* testsprite2 */;
-			productType = "com.apple.product-type.tool";
-		};
-		0017992010743FB700F5D044 /* testwm2 */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 0017993210743FB700F5D044 /* Build configuration list for PBXNativeTarget "testwm2" */;
-			buildPhases = (
-				0017992510743FB700F5D044 /* Sources */,
-				0017992610743FB700F5D044 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testwm2;
-			productName = testalpha;
-			productReference = 0017993810743FB700F5D044 /* testwm2 */;
-			productType = "com.apple.product-type.tool";
-		};
-		002F340109CA1BFF00EBEB88 /* testfile */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 002F340E09CA1BFF00EBEB88 /* Build configuration list for PBXNativeTarget "testfile" */;
-			buildPhases = (
-				002F340709CA1BFF00EBEB88 /* Sources */,
-				002F340809CA1BFF00EBEB88 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testfile;
-			productName = testalpha;
-			productReference = 002F341209CA1BFF00EBEB88 /* testfile */;
-			productType = "com.apple.product-type.tool";
-		};
-		002F342009CA1F0300EBEB88 /* testiconv */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 002F342D09CA1F0300EBEB88 /* Build configuration list for PBXNativeTarget "testiconv" */;
-			buildPhases = (
-				002F342609CA1F0300EBEB88 /* Sources */,
-				002F342709CA1F0300EBEB88 /* Frameworks */,
-				00794EEC09D2371F003FC8A1 /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testiconv;
-			productName = testalpha;
-			productReference = 002F343109CA1F0300EBEB88 /* testiconv */;
-			productType = "com.apple.product-type.tool";
-		};
-		002F343C09CA1FB300EBEB88 /* testoverlay2 */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 002F344909CA1FB300EBEB88 /* Build configuration list for PBXNativeTarget "testoverlay2" */;
-			buildPhases = (
-				002F344209CA1FB300EBEB88 /* Sources */,
-				002F344309CA1FB300EBEB88 /* Frameworks */,
-				00794EF409D237C7003FC8A1 /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testoverlay2;
-			productName = testalpha;
-			productReference = 002F344D09CA1FB300EBEB88 /* testoverlay2 */;
-			productType = "com.apple.product-type.tool";
-		};
-		002F345909CA204F00EBEB88 /* testplatform */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 002F346609CA204F00EBEB88 /* Build configuration list for PBXNativeTarget "testplatform" */;
-			buildPhases = (
-				002F345F09CA204F00EBEB88 /* Sources */,
-				002F346009CA204F00EBEB88 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testplatform;
-			productName = testalpha;
-			productReference = 002F346A09CA204F00EBEB88 /* testplatform */;
-			productType = "com.apple.product-type.tool";
-		};
-		4537749112091504002F0F45 /* testshape */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 4537749A1209150C002F0F45 /* Build configuration list for PBXNativeTarget "testshape" */;
-			buildPhases = (
-				4537748F12091504002F0F45 /* Sources */,
-				4537749012091504002F0F45 /* Frameworks */,
-				DB166ECE16A1D85400A1396C /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testshape;
-			productName = testshape;
-			productReference = 4537749212091504002F0F45 /* testshape */;
-			productType = "com.apple.product-type.tool";
-		};
-		BBFC08B7164C6862003E6A99 /* testgamecontroller */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = BBFC08CA164C6862003E6A99 /* Build configuration list for PBXNativeTarget "testgamecontroller" */;
-			buildPhases = (
-				BBFC08BC164C6862003E6A99 /* Sources */,
-				BBFC08BE164C6862003E6A99 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testgamecontroller;
-			productName = testjoystick;
-			productReference = BBFC08CD164C6862003E6A99 /* testgamecontroller */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC566AB0761D90300A33029 /* checkkeys */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B593808BDB826006539E9 /* Build configuration list for PBXNativeTarget "checkkeys" */;
-			buildPhases = (
-				BEC566B00761D90300A33029 /* Sources */,
-				BEC566B20761D90300A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = checkkeys;
-			productName = checkkeys;
-			productReference = BEC566B60761D90300A33029 /* checkkeys */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC566C50761D90300A33029 /* loopwave */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B594008BDB826006539E9 /* Build configuration list for PBXNativeTarget "loopwave" */;
-			buildPhases = (
-				BEC566CA0761D90300A33029 /* Sources */,
-				BEC566CC0761D90300A33029 /* Frameworks */,
-				00794E6409D2084F003FC8A1 /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = loopwave;
-			productName = loopwave;
-			productReference = BEC566D10761D90300A33029 /* loopwave */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC566FB0761D90300A33029 /* testerror */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B595008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testerror" */;
-			buildPhases = (
-				BEC567000761D90300A33029 /* Sources */,
-				BEC567020761D90300A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testerror;
-			productName = testerror;
-			productReference = BEC567060761D90400A33029 /* testerror */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC567230761D90400A33029 /* testthread */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B595C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testthread" */;
-			buildPhases = (
-				BEC567280761D90400A33029 /* Sources */,
-				BEC5672A0761D90400A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testthread;
-			productName = testthread;
-			productReference = BEC5672E0761D90400A33029 /* testthread */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC567300761D90400A33029 /* testjoystick */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B596008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testjoystick" */;
-			buildPhases = (
-				BEC567350761D90400A33029 /* Sources */,
-				BEC567370761D90400A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testjoystick;
-			productName = testjoystick;
-			productReference = BEC5673B0761D90400A33029 /* testjoystick */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC5673D0761D90400A33029 /* testkeys */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B596408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testkeys" */;
-			buildPhases = (
-				BEC567420761D90400A33029 /* Sources */,
-				BEC567440761D90400A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testkeys;
-			productName = testkeys;
-			productReference = BEC567480761D90400A33029 /* testkeys */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC5674A0761D90400A33029 /* testlock */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B596808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testlock" */;
-			buildPhases = (
-				BEC5674F0761D90400A33029 /* Sources */,
-				BEC567510761D90400A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testlock;
-			productName = testlock;
-			productReference = BEC567550761D90400A33029 /* testlock */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC567720761D90500A33029 /* testsem */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B597008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsem" */;
-			buildPhases = (
-				BEC567770761D90500A33029 /* Sources */,
-				BEC567790761D90500A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testsem;
-			productName = testsem;
-			productReference = BEC5677D0761D90500A33029 /* testsem */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC5678D0761D90500A33029 /* testtimer */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B597808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testtimer" */;
-			buildPhases = (
-				BEC567920761D90500A33029 /* Sources */,
-				BEC567940761D90500A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testtimer;
-			productName = testtimer;
-			productReference = BEC567980761D90500A33029 /* testtimer */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC567A70761D90500A33029 /* testversion */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B598008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testversion" */;
-			buildPhases = (
-				BEC567AC0761D90500A33029 /* Sources */,
-				BEC567AE0761D90500A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testversion;
-			productName = testversion;
-			productReference = BEC567B20761D90500A33029 /* testversion */;
-			productType = "com.apple.product-type.tool";
-		};
-		BEC567EA0761D90600A33029 /* torturethread */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 001B599408BDB826006539E9 /* Build configuration list for PBXNativeTarget "torturethread" */;
-			buildPhases = (
-				BEC567EF0761D90600A33029 /* Sources */,
-				BEC567F10761D90600A33029 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = torturethread;
-			productName = torturethread;
-			productReference = BEC567F50761D90600A33029 /* torturethread */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB0F48D917CA51E5008798C5 /* testdrawchessboard */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB0F48E917CA51E5008798C5 /* Build configuration list for PBXNativeTarget "testdrawchessboard" */;
-			buildPhases = (
-				DB0F48DA17CA51E5008798C5 /* Sources */,
-				DB0F48DC17CA51E5008798C5 /* Frameworks */,
-				DB0F48E717CA51E5008798C5 /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testdrawchessboard;
-			productName = testalpha;
-			productReference = DB0F48EC17CA51E5008798C5 /* testdrawchessboard */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB0F48EF17CA5212008798C5 /* testfilesystem */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB0F48FE17CA5212008798C5 /* Build configuration list for PBXNativeTarget "testfilesystem" */;
-			buildPhases = (
-				DB0F48F017CA5212008798C5 /* Sources */,
-				DB0F48F217CA5212008798C5 /* Frameworks */,
-				DB0F48FD17CA5212008798C5 /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testfilesystem;
-			productName = testalpha;
-			productReference = DB0F490117CA5212008798C5 /* testfilesystem */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166D7E16A1D12400A1396C /* SDL_test */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166D8016A1D12400A1396C /* Build configuration list for PBXNativeTarget "SDL_test" */;
-			buildPhases = (
-				DB166D7B16A1D12400A1396C /* Sources */,
-				DB166D7C16A1D12400A1396C /* Frameworks */,
-				DB166D7D16A1D12400A1396C /* Headers */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = SDL_test;
-			productName = SDL_test;
-			productReference = DB166D7F16A1D12400A1396C /* libSDL_test.a */;
-			productType = "com.apple.product-type.library.static";
-		};
-		DB166DAD16A1D2F600A1396C /* testgesture */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166DBC16A1D2F600A1396C /* Build configuration list for PBXNativeTarget "testgesture" */;
-			buildPhases = (
-				DB166DAE16A1D2F600A1396C /* Sources */,
-				DB166DB016A1D2F600A1396C /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testgesture;
-			productName = testalpha;
-			productReference = DB166DBF16A1D2F600A1396C /* testgesture */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166DC416A1D36A00A1396C /* testmessage */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166DD216A1D36A00A1396C /* Build configuration list for PBXNativeTarget "testmessage" */;
-			buildPhases = (
-				DB166DC516A1D36A00A1396C /* Sources */,
-				DB166DC716A1D36A00A1396C /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testmessage;
-			productName = testalpha;
-			productReference = DB166DD516A1D36A00A1396C /* testmessage */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166DDC16A1D50C00A1396C /* testrelative */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166DEB16A1D50C00A1396C /* Build configuration list for PBXNativeTarget "testrelative" */;
-			buildPhases = (
-				DB166DDD16A1D50C00A1396C /* Sources */,
-				DB166DDF16A1D50C00A1396C /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testrelative;
-			productName = testalpha;
-			productReference = DB166DEE16A1D50C00A1396C /* testrelative */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166DF316A1D57C00A1396C /* testrendercopyex */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166E0216A1D57C00A1396C /* Build configuration list for PBXNativeTarget "testrendercopyex" */;
-			buildPhases = (
-				DB166DF416A1D57C00A1396C /* Sources */,
-				DB166DF616A1D57C00A1396C /* Frameworks */,
-				DB166E2116A1D5DF00A1396C /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testrendercopyex;
-			productName = testalpha;
-			productReference = DB166E0516A1D57C00A1396C /* testrendercopyex */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166E0A16A1D5AD00A1396C /* testrendertarget */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166E1916A1D5AD00A1396C /* Build configuration list for PBXNativeTarget "testrendertarget" */;
-			buildPhases = (
-				DB166E0B16A1D5AD00A1396C /* Sources */,
-				DB166E0D16A1D5AD00A1396C /* Frameworks */,
-				DB166E2416A1D61000A1396C /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testrendertarget;
-			productName = testalpha;
-			productReference = DB166E1C16A1D5AD00A1396C /* testrendertarget */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166E2716A1D64D00A1396C /* testrumble */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166E3516A1D64D00A1396C /* Build configuration list for PBXNativeTarget "testrumble" */;
-			buildPhases = (
-				DB166E2816A1D64D00A1396C /* Sources */,
-				DB166E2A16A1D64D00A1396C /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testrumble;
-			productName = testalpha;
-			productReference = DB166E3816A1D64D00A1396C /* testrumble */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166E3D16A1D69000A1396C /* testscale */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166E4F16A1D69000A1396C /* Build configuration list for PBXNativeTarget "testscale" */;
-			buildPhases = (
-				DB166E3E16A1D69000A1396C /* Sources */,
-				DB166E4016A1D69000A1396C /* Frameworks */,
-				DB166E4C16A1D69000A1396C /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testscale;
-			productName = testalpha;
-			productReference = DB166E5216A1D69000A1396C /* testscale */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166E5716A1D6F300A1396C /* testshader */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166E6516A1D6F300A1396C /* Build configuration list for PBXNativeTarget "testshader" */;
-			buildPhases = (
-				DB166E5816A1D6F300A1396C /* Sources */,
-				DB166E5A16A1D6F300A1396C /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testshader;
-			productName = testsem;
-			productReference = DB166E6816A1D6F300A1396C /* testshader */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166E6D16A1D78400A1396C /* testspriteminimal */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166E7B16A1D78400A1396C /* Build configuration list for PBXNativeTarget "testspriteminimal" */;
-			buildPhases = (
-				DB166E6E16A1D78400A1396C /* Sources */,
-				DB166E7016A1D78400A1396C /* Frameworks */,
-				DB166E9B16A1D7FC00A1396C /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testspriteminimal;
-			productName = testsem;
-			productReference = DB166E7E16A1D78400A1396C /* testspriteminimal */;
-			productType = "com.apple.product-type.tool";
-		};
-		DB166E8016A1D78C00A1396C /* teststreaming */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = DB166E8E16A1D78C00A1396C /* Build configuration list for PBXNativeTarget "teststreaming" */;
-			buildPhases = (
-				DB166E8116A1D78C00A1396C /* Sources */,
-				DB166E8316A1D78C00A1396C /* Frameworks */,
-				DB166E9916A1D7EE00A1396C /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = teststreaming;
-			productName = testsem;
-			productReference = DB166E9116A1D78C00A1396C /* teststreaming */;
-			productType = "com.apple.product-type.tool";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		08FB7793FE84155DC02AAC07 /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				LastUpgradeCheck = 0420;
-			};
-			buildConfigurationList = 001B5A0C08BDB826006539E9 /* Build configuration list for PBXProject "SDLTest" */;
-			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
-			hasScannedForEncodings = 1;
-			knownRegions = (
-				English,
-				Japanese,
-				French,
-				German,
-				en,
-			);
-			mainGroup = 08FB7794FE84155DC02AAC07 /* SDLTest */;
-			projectDirPath = "";
-			projectReferences = (
-				{
-					ProductGroup = 003FA63B093FFD41000C53B3 /* Products */;
-					ProjectRef = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
-				},
-			);
-			projectRoot = "";
-			targets = (
-				BEC566920761D90300A33029 /* All */,
-				DB166D7E16A1D12400A1396C /* SDL_test */,
-				BEC566AB0761D90300A33029 /* checkkeys */,
-				BEC566C50761D90300A33029 /* loopwave */,
-				0017957410741F7900F5D044 /* testatomic */,
-				00179595107421BF00F5D044 /* testaudioinfo */,
-				00179756107431B300F5D044 /* testdraw2 */,
-				DB0F48D917CA51E5008798C5 /* testdrawchessboard */,
-				BEC566FB0761D90300A33029 /* testerror */,
-				002F340109CA1BFF00EBEB88 /* testfile */,
-				DB0F48EF17CA5212008798C5 /* testfilesystem */,
-				BBFC08B7164C6862003E6A99 /* testgamecontroller */,
-				DB166DAD16A1D2F600A1396C /* testgesture */,
-				0017970910742F3200F5D044 /* testgl2 */,
-				00179730107430D600F5D044 /* testhaptic */,
-				002F342009CA1F0300EBEB88 /* testiconv */,
-				00179776107432AE00F5D044 /* testime */,
-				001797961074334C00F5D044 /* testintersections */,
-				BEC567300761D90400A33029 /* testjoystick */,
-				BEC5673D0761D90400A33029 /* testkeys */,
-				001797B8107433C600F5D044 /* testloadso */,
-				BEC5674A0761D90400A33029 /* testlock */,
-				DB166DC416A1D36A00A1396C /* testmessage */,
-				001797FA1074355200F5D044 /* testmultiaudio */,
-				001798781074392D00F5D044 /* testnative */,
-				002F343C09CA1FB300EBEB88 /* testoverlay2 */,
-				002F345909CA204F00EBEB88 /* testplatform */,
-				0017989D107439DF00F5D044 /* testpower */,
-				DB166DDC16A1D50C00A1396C /* testrelative */,
-				DB166DF316A1D57C00A1396C /* testrendercopyex */,
-				DB166E0A16A1D5AD00A1396C /* testrendertarget */,
-				001798DA10743BEC00F5D044 /* testresample */,
-				DB166E2716A1D64D00A1396C /* testrumble */,
-				DB166E3D16A1D69000A1396C /* testscale */,
-				BEC567720761D90500A33029 /* testsem */,
-				DB166E5716A1D6F300A1396C /* testshader */,
-				4537749112091504002F0F45 /* testshape */,
-				001798FE10743F1000F5D044 /* testsprite2 */,
-				DB166E6D16A1D78400A1396C /* testspriteminimal */,
-				DB166E8016A1D78C00A1396C /* teststreaming */,
-				BEC567230761D90400A33029 /* testthread */,
-				BEC5678D0761D90500A33029 /* testtimer */,
-				BEC567A70761D90500A33029 /* testversion */,
-				0017992010743FB700F5D044 /* testwm2 */,
-				BEC567EA0761D90600A33029 /* torturethread */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXReferenceProxy section */
-		003FA643093FFD41000C53B3 /* SDL2.framework */ = {
-			isa = PBXReferenceProxy;
-			fileType = wrapper.framework;
-			path = SDL2.framework;
-			remoteRef = 003FA642093FFD41000C53B3 /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		003FA645093FFD41000C53B3 /* libSDL2.a */ = {
-			isa = PBXReferenceProxy;
-			fileType = archive.ar;
-			path = libSDL2.a;
-			remoteRef = 003FA644093FFD41000C53B3 /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		003FA649093FFD41000C53B3 /* Standard DMG */ = {
-			isa = PBXReferenceProxy;
-			fileType = "compiled.mach-o.executable";
-			path = "Standard DMG";
-			remoteRef = 003FA648093FFD41000C53B3 /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		DB1D40D717B3F30D00D74CFC /* libSDL2.dylib */ = {
-			isa = PBXReferenceProxy;
-			fileType = "compiled.mach-o.dylib";
-			path = libSDL2.dylib;
-			remoteRef = DB1D40D617B3F30D00D74CFC /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-/* End PBXReferenceProxy section */
-
-/* Begin PBXSourcesBuildPhase section */
-		0017957910741F7900F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001795901074216E00F5D044 /* testatomic.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017959A107421BF00F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001795B11074222D00F5D044 /* testaudioinfo.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017970E10742F3200F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017972810742FB900F5D044 /* testgl2.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		00179735107430D600F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017974F1074315700F5D044 /* testhaptic.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017975B107431B300F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001797721074320D00F5D044 /* testdraw2.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017977B107432AE00F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				00179792107432FA00F5D044 /* testime.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017979B1074334C00F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001797B41074339C00F5D044 /* testintersections.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		001797BD107433C600F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001797D41074343E00F5D044 /* testloadso.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		001797FF1074355200F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001798161074359B00F5D044 /* testmultiaudio.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017987E1074392D00F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017987F1074392D00F5D044 /* testnative.c in Sources */,
-				001798801074392D00F5D044 /* testnativecocoa.m in Sources */,
-				001798811074392D00F5D044 /* testnativex11.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		001798A2107439DF00F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001798BA10743A4900F5D044 /* testpower.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		001798DF10743BEC00F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				001798FA10743E9200F5D044 /* testresample.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017990310743F1000F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017991A10743F5300F5D044 /* testsprite2.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		0017992510743FB700F5D044 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				0017993C10743FEF00F5D044 /* testwm2.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		002F340709CA1BFF00EBEB88 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F341809CA1C5B00EBEB88 /* testfile.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		002F342609CA1F0300EBEB88 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F343709CA1F6F00EBEB88 /* testiconv.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		002F344209CA1FB300EBEB88 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F345409CA202000EBEB88 /* testoverlay2.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		002F345F09CA204F00EBEB88 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				002F347009CA20A600EBEB88 /* testplatform.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		4537748F12091504002F0F45 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				453774A5120915E3002F0F45 /* testshape.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BBFC08BC164C6862003E6A99 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BBFC08D0164C6876003E6A99 /* testgamecontroller.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC566B00761D90300A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC566B10761D90300A33029 /* checkkeys.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC566CA0761D90300A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC566CB0761D90300A33029 /* loopwave.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567000761D90300A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC567010761D90300A33029 /* testerror.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567280761D90400A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC567290761D90400A33029 /* testthread.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567350761D90400A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC567360761D90400A33029 /* testjoystick.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567420761D90400A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC567430761D90400A33029 /* testkeys.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC5674F0761D90400A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC567500761D90400A33029 /* testlock.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567770761D90500A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC567780761D90500A33029 /* testsem.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567920761D90500A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC567930761D90500A33029 /* testtimer.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567AC0761D90500A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC567AD0761D90500A33029 /* testver.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		BEC567EF0761D90600A33029 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				BEC567F00761D90600A33029 /* torturethread.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB0F48DA17CA51E5008798C5 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB0F48EE17CA51F8008798C5 /* testdrawchessboard.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB0F48F017CA5212008798C5 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB0F490317CA5225008798C5 /* testfilesystem.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166D7B16A1D12400A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166D9316A1D1A500A1396C /* SDL_test_assert.c in Sources */,
-				DB166D9416A1D1A500A1396C /* SDL_test_common.c in Sources */,
-				DB166D9516A1D1A500A1396C /* SDL_test_compare.c in Sources */,
-				DB166D9616A1D1A500A1396C /* SDL_test_crc32.c in Sources */,
-				DB166D9716A1D1A500A1396C /* SDL_test_font.c in Sources */,
-				DB166D9816A1D1A500A1396C /* SDL_test_fuzzer.c in Sources */,
-				DB166D9916A1D1A500A1396C /* SDL_test_harness.c in Sources */,
-				DB166D9A16A1D1A500A1396C /* SDL_test_imageBlit.c in Sources */,
-				DB166D9B16A1D1A500A1396C /* SDL_test_imageBlitBlend.c in Sources */,
-				DB166D9C16A1D1A500A1396C /* SDL_test_imageFace.c in Sources */,
-				DB166D9D16A1D1A500A1396C /* SDL_test_imagePrimitives.c in Sources */,
-				DB166D9E16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c in Sources */,
-				DB166D9F16A1D1A500A1396C /* SDL_test_log.c in Sources */,
-				DB166DA016A1D1A500A1396C /* SDL_test_md5.c in Sources */,
-				DB166DA116A1D1A500A1396C /* SDL_test_random.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166DAE16A1D2F600A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166DC116A1D31E00A1396C /* testgesture.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166DC516A1D36A00A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166DD716A1D37800A1396C /* testmessage.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166DDD16A1D50C00A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166DF016A1D52500A1396C /* testrelative.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166DF416A1D57C00A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E0716A1D59400A1396C /* testrendercopyex.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E0B16A1D5AD00A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E1E16A1D5C300A1396C /* testrendertarget.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E2816A1D64D00A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E3C16A1D66500A1396C /* testrumble.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E3E16A1D69000A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E5416A1D6A300A1396C /* testscale.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E5816A1D6F300A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E6A16A1D70C00A1396C /* testshader.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E6E16A1D78400A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E9316A1D7BC00A1396C /* testspriteminimal.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-		DB166E8116A1D78C00A1396C /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				DB166E9416A1D7C700A1396C /* teststreaming.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
-		001799481074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC566AB0761D90300A33029 /* checkkeys */;
-			targetProxy = 001799471074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017994C1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC566C50761D90300A33029 /* loopwave */;
-			targetProxy = 0017994B1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799501074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 0017957410741F7900F5D044 /* testatomic */;
-			targetProxy = 0017994F1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799521074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 00179595107421BF00F5D044 /* testaudioinfo */;
-			targetProxy = 001799511074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017995A1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 00179756107431B300F5D044 /* testdraw2 */;
-			targetProxy = 001799591074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017995E1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC566FB0761D90300A33029 /* testerror */;
-			targetProxy = 0017995D1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799601074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 002F340109CA1BFF00EBEB88 /* testfile */;
-			targetProxy = 0017995F1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799661074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 0017970910742F3200F5D044 /* testgl2 */;
-			targetProxy = 001799651074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799681074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 00179730107430D600F5D044 /* testhaptic */;
-			targetProxy = 001799671074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017996A1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC567230761D90400A33029 /* testthread */;
-			targetProxy = 001799691074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017996C1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 002F342009CA1F0300EBEB88 /* testiconv */;
-			targetProxy = 0017996B1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017996E1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 00179776107432AE00F5D044 /* testime */;
-			targetProxy = 0017996D1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799701074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 001797961074334C00F5D044 /* testintersections */;
-			targetProxy = 0017996F1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799721074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC567300761D90400A33029 /* testjoystick */;
-			targetProxy = 001799711074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799741074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC5673D0761D90400A33029 /* testkeys */;
-			targetProxy = 001799731074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799761074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 001797B8107433C600F5D044 /* testloadso */;
-			targetProxy = 001799751074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799781074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC5674A0761D90400A33029 /* testlock */;
-			targetProxy = 001799771074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017997C1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 001797FA1074355200F5D044 /* testmultiaudio */;
-			targetProxy = 0017997B1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799801074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 001798781074392D00F5D044 /* testnative */;
-			targetProxy = 0017997F1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799841074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 002F343C09CA1FB300EBEB88 /* testoverlay2 */;
-			targetProxy = 001799831074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799881074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 002F345909CA204F00EBEB88 /* testplatform */;
-			targetProxy = 001799871074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017998A1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 0017989D107439DF00F5D044 /* testpower */;
-			targetProxy = 001799891074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017998C1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 001798DA10743BEC00F5D044 /* testresample */;
-			targetProxy = 0017998B1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017998E1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC567720761D90500A33029 /* testsem */;
-			targetProxy = 0017998D1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799921074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 001798FE10743F1000F5D044 /* testsprite2 */;
-			targetProxy = 001799911074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799941074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC5678D0761D90500A33029 /* testtimer */;
-			targetProxy = 001799931074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799961074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC567A70761D90500A33029 /* testversion */;
-			targetProxy = 001799951074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		0017999E1074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 0017992010743FB700F5D044 /* testwm2 */;
-			targetProxy = 0017999D1074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		001799A21074403E00F5D044 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BEC567EA0761D90600A33029 /* torturethread */;
-			targetProxy = 001799A11074403E00F5D044 /* PBXContainerItemProxy */;
-		};
-		DB0F490517CA5249008798C5 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB0F48D917CA51E5008798C5 /* testdrawchessboard */;
-			targetProxy = DB0F490417CA5249008798C5 /* PBXContainerItemProxy */;
-		};
-		DB0F490717CA5249008798C5 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB0F48EF17CA5212008798C5 /* testfilesystem */;
-			targetProxy = DB0F490617CA5249008798C5 /* PBXContainerItemProxy */;
-		};
-		DB166D6E16A1CEAA00A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = BBFC08B7164C6862003E6A99 /* testgamecontroller */;
-			targetProxy = DB166D6D16A1CEAA00A1396C /* PBXContainerItemProxy */;
-		};
-		DB166D7016A1CEAF00A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 4537749112091504002F0F45 /* testshape */;
-			targetProxy = DB166D6F16A1CEAF00A1396C /* PBXContainerItemProxy */;
-		};
-		DB166DC316A1D32C00A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166DAD16A1D2F600A1396C /* testgesture */;
-			targetProxy = DB166DC216A1D32C00A1396C /* PBXContainerItemProxy */;
-		};
-		DB166DD916A1D38900A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166DC416A1D36A00A1396C /* testmessage */;
-			targetProxy = DB166DD816A1D38900A1396C /* PBXContainerItemProxy */;
-		};
-		DB166DF216A1D53700A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166DDC16A1D50C00A1396C /* testrelative */;
-			targetProxy = DB166DF116A1D53700A1396C /* PBXContainerItemProxy */;
-		};
-		DB166E0916A1D5A400A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166DF316A1D57C00A1396C /* testrendercopyex */;
-			targetProxy = DB166E0816A1D5A400A1396C /* PBXContainerItemProxy */;
-		};
-		DB166E2016A1D5D000A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166E0A16A1D5AD00A1396C /* testrendertarget */;
-			targetProxy = DB166E1F16A1D5D000A1396C /* PBXContainerItemProxy */;
-		};
-		DB166E3B16A1D65A00A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166E2716A1D64D00A1396C /* testrumble */;
-			targetProxy = DB166E3A16A1D65A00A1396C /* PBXContainerItemProxy */;
-		};
-		DB166E5616A1D6B800A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166E3D16A1D69000A1396C /* testscale */;
-			targetProxy = DB166E5516A1D6B800A1396C /* PBXContainerItemProxy */;
-		};
-		DB166E6C16A1D72000A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166E5716A1D6F300A1396C /* testshader */;
-			targetProxy = DB166E6B16A1D72000A1396C /* PBXContainerItemProxy */;
-		};
-		DB166E9616A1D7CD00A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166E6D16A1D78400A1396C /* testspriteminimal */;
-			targetProxy = DB166E9516A1D7CD00A1396C /* PBXContainerItemProxy */;
-		};
-		DB166E9816A1D7CF00A1396C /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = DB166E8016A1D78C00A1396C /* teststreaming */;
-			targetProxy = DB166E9716A1D7CF00A1396C /* PBXContainerItemProxy */;
-		};
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
-		0017958910741F7900F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testatomic;
-			};
-			name = Debug;
-		};
-		0017958A10741F7900F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testatomic;
-			};
-			name = Release;
-		};
-		001795AA107421BF00F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testaudioinfo;
-			};
-			name = Debug;
-		};
-		001795AB107421BF00F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testaudioinfo;
-			};
-			name = Release;
-		};
-		0017971E10742F3200F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL;
-				PRODUCT_NAME = testgl2;
-			};
-			name = Debug;
-		};
-		0017971F10742F3200F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL;
-				PRODUCT_NAME = testgl2;
-			};
-			name = Release;
-		};
-		00179745107430D600F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testhaptic;
-			};
-			name = Debug;
-		};
-		00179746107430D600F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testhaptic;
-			};
-			name = Release;
-		};
-		0017976B107431B300F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testdraw2;
-			};
-			name = Debug;
-		};
-		0017976C107431B300F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testdraw2;
-			};
-			name = Release;
-		};
-		0017978B107432AE00F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testime;
-			};
-			name = Debug;
-		};
-		0017978C107432AE00F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testime;
-			};
-			name = Release;
-		};
-		001797AB1074334C00F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testintersections;
-			};
-			name = Debug;
-		};
-		001797AC1074334C00F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testintersections;
-			};
-			name = Release;
-		};
-		001797CD107433C600F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testloadso;
-			};
-			name = Debug;
-		};
-		001797CE107433C600F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testloadso;
-			};
-			name = Release;
-		};
-		0017980F1074355200F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testmultiaudio;
-			};
-			name = Debug;
-		};
-		001798101074355200F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testmultiaudio;
-			};
-			name = Release;
-		};
-		001798911074392D00F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				LIBRARY_SEARCH_PATHS = /usr/X11/lib;
-				OTHER_LDFLAGS = "-lX11";
-				PRODUCT_NAME = testnative;
-			};
-			name = Debug;
-		};
-		001798921074392D00F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				LIBRARY_SEARCH_PATHS = /usr/X11/lib;
-				OTHER_LDFLAGS = "-lX11";
-				PRODUCT_NAME = testnative;
-			};
-			name = Release;
-		};
-		001798B2107439DF00F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testpower;
-			};
-			name = Debug;
-		};
-		001798B3107439DF00F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testpower;
-			};
-			name = Release;
-		};
-		001798EF10743BEC00F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testresample;
-			};
-			name = Debug;
-		};
-		001798F010743BEC00F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testresample;
-			};
-			name = Release;
-		};
-		0017991310743F1000F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testsprite2;
-			};
-			name = Debug;
-		};
-		0017991410743F1000F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testsprite2;
-			};
-			name = Release;
-		};
-		0017993510743FB700F5D044 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testwm2;
-			};
-			name = Debug;
-		};
-		0017993610743FB700F5D044 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testwm2;
-			};
-			name = Release;
-		};
-		002A85B21073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(SRCROOT)/../SDL/build/$(CONFIGURATION)",
-					"$(HOME)/Library/Frameworks",
-					/Library/Frameworks,
-				);
-				GCC_OPTIMIZATION_LEVEL = 0;
-				HEADER_SEARCH_PATHS = ../../include;
-			};
-			name = Debug;
-		};
-		002A85B31073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = "Build All";
-			};
-			name = Debug;
-		};
-		002A85B41073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = checkkeys;
-			};
-			name = Debug;
-		};
-		002A85B61073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = loopwave;
-			};
-			name = Debug;
-		};
-		002A85BC1073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testerror;
-			};
-			name = Debug;
-		};
-		002A85BD1073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testfile;
-			};
-			name = Debug;
-		};
-		002A85C01073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testiconv;
-			};
-			name = Debug;
-		};
-		002A85C11073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testjoystick;
-			};
-			name = Debug;
-		};
-		002A85C21073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testkeys;
-			};
-			name = Debug;
-		};
-		002A85C31073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testlock;
-			};
-			name = Debug;
-		};
-		002A85C51073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testoverlay2;
-			};
-			name = Debug;
-		};
-		002A85C71073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testplatform;
-			};
-			name = Debug;
-		};
-		002A85C81073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testsem;
-			};
-			name = Debug;
-		};
-		002A85CA1073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testthread;
-			};
-			name = Debug;
-		};
-		002A85CB1073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testtimer;
-			};
-			name = Debug;
-		};
-		002A85CC1073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testversion;
-			};
-			name = Debug;
-		};
-		002A85D11073008E007319AE /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = torturethread;
-			};
-			name = Debug;
-		};
-		002A85D41073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(SRCROOT)/../SDL/build/$(CONFIGURATION)",
-					"$(HOME)/Library/Frameworks",
-					/Library/Frameworks,
-				);
-				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
-				HEADER_SEARCH_PATHS = ../../include;
-			};
-			name = Release;
-		};
-		002A85D51073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = "Build All";
-			};
-			name = Release;
-		};
-		002A85D61073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = checkkeys;
-			};
-			name = Release;
-		};
-		002A85D81073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = loopwave;
-			};
-			name = Release;
-		};
-		002A85DE1073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testerror;
-			};
-			name = Release;
-		};
-		002A85DF1073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testfile;
-			};
-			name = Release;
-		};
-		002A85E21073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testiconv;
-			};
-			name = Release;
-		};
-		002A85E31073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testjoystick;
-			};
-			name = Release;
-		};
-		002A85E41073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testkeys;
-			};
-			name = Release;
-		};
-		002A85E51073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testlock;
-			};
-			name = Release;
-		};
-		002A85E71073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testoverlay2;
-			};
-			name = Release;
-		};
-		002A85E91073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testplatform;
-			};
-			name = Release;
-		};
-		002A85EA1073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testsem;
-			};
-			name = Release;
-		};
-		002A85EC1073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testthread;
-			};
-			name = Release;
-		};
-		002A85ED1073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testtimer;
-			};
-			name = Release;
-		};
-		002A85EE1073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testversion;
-			};
-			name = Release;
-		};
-		002A85F31073009D007319AE /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = torturethread;
-			};
-			name = Release;
-		};
-		4537749712091509002F0F45 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testshape;
-			};
-			name = Debug;
-		};
-		4537749812091509002F0F45 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testshape;
-			};
-			name = Release;
-		};
-		BBFC08CB164C6862003E6A99 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testgamecontroller;
-			};
-			name = Debug;
-		};
-		BBFC08CC164C6862003E6A99 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testgamecontroller;
-			};
-			name = Release;
-		};
-		DB0F48EA17CA51E5008798C5 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testdrawchessboard;
-			};
-			name = Debug;
-		};
-		DB0F48EB17CA51E5008798C5 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testdrawchessboard;
-			};
-			name = Release;
-		};
-		DB0F48FF17CA5212008798C5 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testfilesystem;
-			};
-			name = Debug;
-		};
-		DB0F490017CA5212008798C5 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testfilesystem;
-			};
-			name = Release;
-		};
-		DB166D8116A1D12400A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				EXECUTABLE_PREFIX = lib;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-			};
-			name = Debug;
-		};
-		DB166D8216A1D12400A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				EXECUTABLE_PREFIX = lib;
-				PRODUCT_NAME = "$(TARGET_NAME)";
-			};
-			name = Release;
-		};
-		DB166DBD16A1D2F600A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testgesture;
-			};
-			name = Debug;
-		};
-		DB166DBE16A1D2F600A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testgesture;
-			};
-			name = Release;
-		};
-		DB166DD316A1D36A00A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testmessage;
-			};
-			name = Debug;
-		};
-		DB166DD416A1D36A00A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testmessage;
-			};
-			name = Release;
-		};
-		DB166DEC16A1D50C00A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testrelative;
-			};
-			name = Debug;
-		};
-		DB166DED16A1D50C00A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testrelative;
-			};
-			name = Release;
-		};
-		DB166E0316A1D57C00A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testrendercopyex;
-			};
-			name = Debug;
-		};
-		DB166E0416A1D57C00A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testrendercopyex;
-			};
-			name = Release;
-		};
-		DB166E1A16A1D5AD00A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testrendertarget;
-			};
-			name = Debug;
-		};
-		DB166E1B16A1D5AD00A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testrendertarget;
-			};
-			name = Release;
-		};
-		DB166E3616A1D64D00A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testrumble;
-			};
-			name = Debug;
-		};
-		DB166E3716A1D64D00A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testrumble;
-			};
-			name = Release;
-		};
-		DB166E5016A1D69000A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testscale;
-			};
-			name = Debug;
-		};
-		DB166E5116A1D69000A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testscale;
-			};
-			name = Release;
-		};
-		DB166E6616A1D6F300A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testshader;
-			};
-			name = Debug;
-		};
-		DB166E6716A1D6F300A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testshader;
-			};
-			name = Release;
-		};
-		DB166E7C16A1D78400A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testspriteminimal;
-			};
-			name = Debug;
-		};
-		DB166E7D16A1D78400A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = testspriteminimal;
-			};
-			name = Release;
-		};
-		DB166E8F16A1D78C00A1396C /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = teststreaming;
-			};
-			name = Debug;
-		};
-		DB166E9016A1D78C00A1396C /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				PRODUCT_NAME = teststreaming;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		0017958610741F7900F5D044 /* Build configuration list for PBXNativeTarget "testatomic" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				0017958910741F7900F5D044 /* Debug */,
-				0017958A10741F7900F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001795A7107421BF00F5D044 /* Build configuration list for PBXNativeTarget "testaudioinfo" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				001795AA107421BF00F5D044 /* Debug */,
-				001795AB107421BF00F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		0017971B10742F3200F5D044 /* Build configuration list for PBXNativeTarget "testgl2" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				0017971E10742F3200F5D044 /* Debug */,
-				0017971F10742F3200F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		00179742107430D600F5D044 /* Build configuration list for PBXNativeTarget "testhaptic" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				00179745107430D600F5D044 /* Debug */,
-				00179746107430D600F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		00179768107431B300F5D044 /* Build configuration list for PBXNativeTarget "testdraw2" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				0017976B107431B300F5D044 /* Debug */,
-				0017976C107431B300F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		00179788107432AE00F5D044 /* Build configuration list for PBXNativeTarget "testime" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				0017978B107432AE00F5D044 /* Debug */,
-				0017978C107432AE00F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001797A81074334C00F5D044 /* Build configuration list for PBXNativeTarget "testintersections" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				001797AB1074334C00F5D044 /* Debug */,
-				001797AC1074334C00F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001797CA107433C600F5D044 /* Build configuration list for PBXNativeTarget "testloadso" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				001797CD107433C600F5D044 /* Debug */,
-				001797CE107433C600F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		0017980C1074355200F5D044 /* Build configuration list for PBXNativeTarget "testmultiaudio" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				0017980F1074355200F5D044 /* Debug */,
-				001798101074355200F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		0017988E1074392D00F5D044 /* Build configuration list for PBXNativeTarget "testnative" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				001798911074392D00F5D044 /* Debug */,
-				001798921074392D00F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001798AF107439DF00F5D044 /* Build configuration list for PBXNativeTarget "testpower" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				001798B2107439DF00F5D044 /* Debug */,
-				001798B3107439DF00F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001798EC10743BEC00F5D044 /* Build configuration list for PBXNativeTarget "testresample" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				001798EF10743BEC00F5D044 /* Debug */,
-				001798F010743BEC00F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		0017991010743F1000F5D044 /* Build configuration list for PBXNativeTarget "testsprite2" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				0017991310743F1000F5D044 /* Debug */,
-				0017991410743F1000F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		0017993210743FB700F5D044 /* Build configuration list for PBXNativeTarget "testwm2" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				0017993510743FB700F5D044 /* Debug */,
-				0017993610743FB700F5D044 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B593808BDB826006539E9 /* Build configuration list for PBXNativeTarget "checkkeys" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85B41073008E007319AE /* Debug */,
-				002A85D61073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B594008BDB826006539E9 /* Build configuration list for PBXNativeTarget "loopwave" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85B61073008E007319AE /* Debug */,
-				002A85D81073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B595008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testerror" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85BC1073008E007319AE /* Debug */,
-				002A85DE1073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B595C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testthread" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85CA1073008E007319AE /* Debug */,
-				002A85EC1073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B596008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testjoystick" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85C11073008E007319AE /* Debug */,
-				002A85E31073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B596408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testkeys" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85C21073008E007319AE /* Debug */,
-				002A85E41073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B596808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testlock" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85C31073008E007319AE /* Debug */,
-				002A85E51073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B597008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsem" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85C81073008E007319AE /* Debug */,
-				002A85EA1073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B597808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testtimer" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85CB1073008E007319AE /* Debug */,
-				002A85ED1073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B598008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testversion" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85CC1073008E007319AE /* Debug */,
-				002A85EE1073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B599408BDB826006539E9 /* Build configuration list for PBXNativeTarget "torturethread" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85D11073008E007319AE /* Debug */,
-				002A85F31073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B599808BDB826006539E9 /* Build configuration list for PBXAggregateTarget "All" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85B31073008E007319AE /* Debug */,
-				002A85D51073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		001B5A0C08BDB826006539E9 /* Build configuration list for PBXProject "SDLTest" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85B21073008E007319AE /* Debug */,
-				002A85D41073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		002F340E09CA1BFF00EBEB88 /* Build configuration list for PBXNativeTarget "testfile" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85BD1073008E007319AE /* Debug */,
-				002A85DF1073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		002F342D09CA1F0300EBEB88 /* Build configuration list for PBXNativeTarget "testiconv" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85C01073008E007319AE /* Debug */,
-				002A85E21073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		002F344909CA1FB300EBEB88 /* Build configuration list for PBXNativeTarget "testoverlay2" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85C51073008E007319AE /* Debug */,
-				002A85E71073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		002F346609CA204F00EBEB88 /* Build configuration list for PBXNativeTarget "testplatform" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				002A85C71073008E007319AE /* Debug */,
-				002A85E91073009D007319AE /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		4537749A1209150C002F0F45 /* Build configuration list for PBXNativeTarget "testshape" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				4537749712091509002F0F45 /* Debug */,
-				4537749812091509002F0F45 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		BBFC08CA164C6862003E6A99 /* Build configuration list for PBXNativeTarget "testgamecontroller" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				BBFC08CB164C6862003E6A99 /* Debug */,
-				BBFC08CC164C6862003E6A99 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB0F48E917CA51E5008798C5 /* Build configuration list for PBXNativeTarget "testdrawchessboard" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB0F48EA17CA51E5008798C5 /* Debug */,
-				DB0F48EB17CA51E5008798C5 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB0F48FE17CA5212008798C5 /* Build configuration list for PBXNativeTarget "testfilesystem" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB0F48FF17CA5212008798C5 /* Debug */,
-				DB0F490017CA5212008798C5 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166D8016A1D12400A1396C /* Build configuration list for PBXNativeTarget "SDL_test" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166D8116A1D12400A1396C /* Debug */,
-				DB166D8216A1D12400A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166DBC16A1D2F600A1396C /* Build configuration list for PBXNativeTarget "testgesture" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166DBD16A1D2F600A1396C /* Debug */,
-				DB166DBE16A1D2F600A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166DD216A1D36A00A1396C /* Build configuration list for PBXNativeTarget "testmessage" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166DD316A1D36A00A1396C /* Debug */,
-				DB166DD416A1D36A00A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166DEB16A1D50C00A1396C /* Build configuration list for PBXNativeTarget "testrelative" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166DEC16A1D50C00A1396C /* Debug */,
-				DB166DED16A1D50C00A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166E0216A1D57C00A1396C /* Build configuration list for PBXNativeTarget "testrendercopyex" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166E0316A1D57C00A1396C /* Debug */,
-				DB166E0416A1D57C00A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166E1916A1D5AD00A1396C /* Build configuration list for PBXNativeTarget "testrendertarget" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166E1A16A1D5AD00A1396C /* Debug */,
-				DB166E1B16A1D5AD00A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166E3516A1D64D00A1396C /* Build configuration list for PBXNativeTarget "testrumble" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166E3616A1D64D00A1396C /* Debug */,
-				DB166E3716A1D64D00A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166E4F16A1D69000A1396C /* Build configuration list for PBXNativeTarget "testscale" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166E5016A1D69000A1396C /* Debug */,
-				DB166E5116A1D69000A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166E6516A1D6F300A1396C /* Build configuration list for PBXNativeTarget "testshader" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166E6616A1D6F300A1396C /* Debug */,
-				DB166E6716A1D6F300A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166E7B16A1D78400A1396C /* Build configuration list for PBXNativeTarget "testspriteminimal" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166E7C16A1D78400A1396C /* Debug */,
-				DB166E7D16A1D78400A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-		DB166E8E16A1D78C00A1396C /* Build configuration list for PBXNativeTarget "teststreaming" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				DB166E8F16A1D78C00A1396C /* Debug */,
-				DB166E9016A1D78C00A1396C /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Debug;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/deps/SDL2/Xcode/XcodeDocSet/Doxyfile b/deps/SDL2/Xcode/XcodeDocSet/Doxyfile
deleted file mode 100644
index 961ac98..0000000
--- a/deps/SDL2/Xcode/XcodeDocSet/Doxyfile
+++ /dev/null
@@ -1,1558 +0,0 @@
-# Doxyfile 1.6.1
-
-# 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 (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file 
-# that follow. The default is UTF-8 which is also the encoding used for all 
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
-# iconv built into libc) for the transcoding. See 
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = SDL
-
-# 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         = 1.3.0
-
-# 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       = 
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
-# 4096 sub-directories (in 2 levels) under the output directory of each output 
-# format and will distribute the generated files over these directories. 
-# Enabling this option can be useful when feeding doxygen a huge amount of 
-# source files, where putting all generated files in the same directory would 
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS         = NO
-
-# 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: 
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, 
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE        = English
-
-# 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
-
-# This tag implements a quasi-intelligent brief description abbreviator 
-# that is used to form the text in various listings. Each string 
-# in this list, if found as the leading text of the brief description, will be 
-# stripped from the text and the result after processing the whole list, is 
-# used as the annotated text. Otherwise, the brief description is used as-is. 
-# If left blank, the following values are used ("$name" is automatically 
-# replaced with the name of the entity): "The $name class" "The $name widget" 
-# "The $name file" "is" "provides" "specifies" "contains" 
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF       = "The $name class" \
-                         "The $name widget" \
-                         "The $name file" \
-                         is \
-                         provides \
-                         specifies \
-                         contains \
-                         represents \
-                         a \
-                         an \
-                         the
-
-# 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        = NO
-
-# 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. The tag can be used to show relative paths in the file list. 
-# If left blank the directory from which doxygen is run is used as the 
-# path to strip.
-
-STRIP_FROM_PATH        = 
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
-# the path mentioned in the documentation of a class, which tells 
-# the reader which header file to include in order to use a class. 
-# If left blank only the name of the header file containing the class 
-# definition is used. Otherwise one should specify the include paths that 
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH    = 
-
-# 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 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 regular Qt-style comments 
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF      = YES
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
-# interpret the first line (until the first dot) of a Qt-style 
-# comment as the brief description. If set to NO, the comments 
-# will behave just like regular Qt-style comments (thus requiring 
-# an explicit \brief command for a brief description.)
-
-QT_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 INHERIT_DOCS tag is set to YES (the default) then an undocumented 
-# member inherits the documentation from any documented member that it 
-# re-implements.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
-# a new page for each member. If set to NO, the documentation of a member will 
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES  = 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               = 4
-
-# 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                = 
-
-# 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 OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
-# sources only. Doxygen will then generate output that is more tailored for 
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
-# sources. Doxygen will then generate output that is tailored for 
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it parses. 
-# With this tag you can assign which parser to use for a given extension. 
-# Doxygen has a built-in mapping, but you can override or extend it using this tag. 
-# The format is ext=language, where ext is a file extension, and language is one of 
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set
-# FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING      = 
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
-# to include (a tag file for) the STL sources as input, then you should 
-# set this tag to YES in order to let doxygen match functions declarations and 
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
-# func(std::string) {}). This also make the inheritance and collaboration 
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to 
-# enable parsing support.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
-# Doxygen will parse them like normal C++ but will assume all classes use public 
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter 
-# and setter methods for a property. Setting this option to YES (the default) 
-# will make doxygen to replace the get and set methods by a property in the 
-# documentation. This will only work if the methods are indeed getting or 
-# setting a simple type. If this is not the case, or you want to show the 
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT   = 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
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
-# the same type (for instance a group of public functions) to be put as a 
-# subgroup of that type (e.g. under the Public Functions section). Set it to 
-# NO to prevent subgrouping. Alternatively, this can be done per class using 
-# the \nosubgrouping command.
-
-SUBGROUPING            = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
-# is documented as struct, union, or enum with the name of the typedef. So 
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
-# with name TypeT. When disabled the typedef will appear as a member of a file, 
-# namespace, or class. And the struct will be named TypeS. This can typically 
-# be useful for C code in case the coding convention dictates that all compound 
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT   = YES
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 
-# determine which symbols to keep in memory and which to flush to disk. 
-# When the cache is full, less often used symbols will be written to disk. 
-# For small to medium size projects (<1000 input files) the default value is 
-# probably good enough. For larger projects a too small cache size can cause 
-# doxygen to be busy swapping symbols to and from disk most of the time 
-# causing a significant performance penality. 
-# If the system has enough physical memory increasing the cache will improve the 
-# performance by keeping more symbols in memory. Note that the value works on 
-# a logarithmic scale so increasing the size by one will rougly double the 
-# memory usage. The cache size is given by this formula: 
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE      = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# 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        = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file 
-# will be included in the documentation.
-
-EXTRACT_STATIC         = NO
-
-# 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  = NO
-
-# This flag is only useful for Objective-C code. When set to YES local 
-# methods, which are defined in the implementation section but not in 
-# the interface are included in the documentation. 
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS  = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be 
-# extracted and appear in the documentation as a namespace called 
-# 'anonymous_namespace{file}', where file will be replaced with the base 
-# name of the file that contains the anonymous namespace. By default 
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES   = NO
-
-# 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 classes 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
-
-# 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 
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES       = YES
-
-# 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       = YES
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
-# will put a list of the files that are included by a file in the documentation 
-# of that file.
-
-SHOW_INCLUDE_FILES     = 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       = NO
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
-# brief documentation of file, namespace and class members alphabetically 
-# by member name. If set to NO (the default) the members will appear in 
-# declaration order.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
-# hierarchy of group names into alphabetical order. If set to NO (the default) 
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
-# sorted by fully-qualified names, including namespaces. If set to 
-# NO (the default), the class list will be sorted only by class name, 
-# not including the namespace part. 
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 
-# Note: This option applies only to the class list, not to the 
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# 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
-
-# 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 consists 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 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
-
-# If the sources in your project are distributed over multiple directories 
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES       = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
-# This will remove the Files entry from the Quick Index and from the 
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
-# Namespaces page.  This will remove the Namespaces entry from the Quick Index 
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES        = NO
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
-# doxygen should invoke to get the current version for each file (typically from 
-# the version control system). Doxygen will invoke the program by executing (via 
-# popen()) the command <command> <input-file>, where <command> is the value of 
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
-# provided by doxygen. Whatever the program writes to standard output 
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER    = 
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 
-# doxygen. The layout file controls the global structure of the generated output files 
-# in an output format independent way. The create the layout file that represents 
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a 
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name 
-# of the layout file.
-
-LAYOUT_FILE            = 
-
-#---------------------------------------------------------------------------
-# 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                  = YES
-
-# 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
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
-# potential errors in the documentation, such as not documenting some 
-# parameters in a documented function, or documenting parameters that 
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for 
-# functions that are documented, but have no documentation for their parameters 
-# or return value. If set to NO (the default) doxygen will only warn about 
-# wrong or incomplete parameter documentation, but not about the absence of 
-# documentation.
-
-WARN_NO_PARAMDOC       = 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. Optionally the format may contain 
-# $version, which will be replaced by the version of the file (if it could 
-# be obtained via FILE_VERSION_FILTER)
-
-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                  = ../../include
-
-# This tag can be used to specify the character encoding of the source files 
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
-# also the default input encoding. Doxygen uses libiconv (or the iconv built 
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
-# the list of possible encodings.
-
-INPUT_ENCODING         = UTF-8
-
-# 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 *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS          = *.c \
-                         *.cc \
-                         *.cxx \
-                         *.cpp \
-                         *.c++ \
-                         *.d \
-                         *.java \
-                         *.ii \
-                         *.ixx \
-                         *.ipp \
-                         *.i++ \
-                         *.inl \
-                         *.h \
-                         *.hh \
-                         *.hxx \
-                         *.hpp \
-                         *.h++ \
-                         *.idl \
-                         *.odl \
-                         *.cs \
-                         *.php \
-                         *.php3 \
-                         *.inc \
-                         *.m \
-                         *.mm \
-                         *.dox \
-                         *.py \
-                         *.f90 \
-                         *.f \
-                         *.vhd \
-                         *.vhdl
-
-# 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              = NO
-
-# 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. Note that the wildcards are matched 
-# against the file with absolute path, so to exclude all test directories 
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       = 
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
-# (namespaces, classes, functions, etc.) that should be excluded from the 
-# output. The symbol name can be a fully qualified name, a word, or if the 
-# wildcard * is used, a substring. Examples: ANamespace, AClass, 
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS        = 
-
-# 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.  If FILTER_PATTERNS is specified, this tag will be 
-# ignored.
-
-INPUT_FILTER           = 
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
-# basis.  Doxygen will compare the file name with each pattern and apply the 
-# filter if there is a match.  The filters are a list of the form: 
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
-# is applied to all files.
-
-FILTER_PATTERNS        = 
-
-# 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. 
-# Note: To get rid of all source code in the generated output, make sure also 
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER         = NO
-
-# 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 
-# 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 
-# then for each documented function all documented entities 
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = YES
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 
-# link to the source code.  Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code 
-# will point to the HTML generated by the htags(1) tool instead of doxygen 
-# built-in source browser. The htags tool is part of GNU's global source 
-# tagging system (see http://www.gnu.org/software/global/global.html). You 
-# will need version 4.8.6 or higher.
-
-USE_HTAGS              = 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       = 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. Note that doxygen will try to copy 
-# the style sheet file to the HTML output directory, so don't put your own 
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-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 HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
-# documentation will contain sections that can be hidden and shown after the 
-# page has loaded. For this to work a browser that supports 
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files 
-# will be generated that can be used as input for Apple's Xcode 3 
-# integrated development environment, introduced with OSX 10.5 (Leopard). 
-# To create a documentation set, doxygen will generate a Makefile in the 
-# HTML output directory. Running make will produce the docset in that 
-# directory and running "make install" will install the docset in 
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
-# it at startup. 
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET        = YES
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
-# feed. A documentation feed provides an umbrella under which multiple 
-# documentation sets from a single provider (such as a company or product suite) 
-# can be grouped.
-
-DOCSET_FEEDNAME        = "Doxygen generated docs for SDL"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
-# should uniquely identify the documentation set bundle. This should be a 
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID       = org.libsdl.sdl
-
-# 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 compiled 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 directory.
-
-CHM_FILE               = SDL.chm
-
-# 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           = "C:/Program Files/HTML Help Workshop/hhc.exe"
-
-# 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 CHM_INDEX_ENCODING 
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file 
-# content.
-
-CHM_INDEX_ENCODING     = 
-
-# 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             = YES
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 
-# are set, an additional index file will be generated that can be used as input for 
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 
-# HTML documentation.
-
-GENERATE_QHP           = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
-# be used to specify the file name of the resulting .qch file. 
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE               = 
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating 
-# Qt Help Project output. For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE          = 
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
-# Qt Help Project output. For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER     = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 
-# For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME   = 
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS  = 
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 
-# filter section matches. 
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS  = 
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
-# be used to specify the location of Qt's qhelpgenerator. 
-# If non-empty doxygen will try to run qhelpgenerator on the generated 
-# .qhp file.
-
-QHG_LOCATION           = 
-
-# 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
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 
-# structure should be generated to display hierarchical information. 
-# If the tag value 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, DHTML, CSS and frames is required (i.e. any modern browser). 
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW      = NO
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, 
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES       = 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
-
-# Use this tag to change the font size of Latex formulas included 
-# as images in the HTML documentation. The default is 10. Note that 
-# when you change the font size after a successful doxygen run you need 
-# to manually remove any form_*.png images from the HTML output directory 
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE       = 10
-
-# When the SEARCHENGINE tag is enable doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript 
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) 
-# there is already a search function so this one should typically 
-# be disabled.
-
-SEARCHENGINE           = NO
-
-#---------------------------------------------------------------------------
-# 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         = NO
-
-# 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         = YES
-
-# 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           = YES
-
-# 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
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
-# include the index chapters (such as File Index, Compound Index, etc.) 
-# in the output.
-
-LATEX_HIDE_INDICES     = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE      = 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 assignments. 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.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML 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 `xml' will be used as the default path.
-
-XML_OUTPUT             = xml
-
-# 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                = 
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
-# dump the program listings (including syntax highlighting 
-# and cross-referencing information) to the XML output. Note that 
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# 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_DEFINED 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        = NO
-
-# 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. To prevent a macro definition from being 
-# undefined via #undef or recursively expanded use the := operator 
-# instead of the = operator.
-
-PREDEFINED             = 
-
-# 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      = DECLSPEC \
-                         SDLCALL
-
-# 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::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles. 
-# Optionally an initial location of the external documentation 
-# can be added for each tagfile. The format of a tag file without 
-# this location is as follows: 
-#   TAGFILES = file1 file2 ... 
-# Adding location for the tag files is done as follows: 
-#   TAGFILES = file1=loc1 "file2 = loc2" ... 
-# where "loc1" and "loc2" can be relative or absolute paths or 
-# URLs. If a location is present for each tag, the installdox tool 
-# does not have to be run to correct the links. 
-# Note that each tag file must have a unique name 
-# (where the name does NOT include the path) 
-# If a tag file is not located in the directory in which doxygen 
-# is run, you must also specify the path to the tagfile here.
-
-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 superseded by the HAVE_DOT option below. This is only a 
-# fallback. It is recommended to install and use dot, since it yields more 
-# powerful graphs.
-
-CLASS_DIAGRAMS         = NO
-
-# You can define message sequence charts within doxygen comments using the \msc 
-# command. Doxygen will then run the mscgen tool (see 
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
-# the mscgen tool resides. If left empty the tool is assumed to be found in the 
-# default search path.
-
-MSCGEN_PATH            = 
-
-# 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
-
-# By default doxygen will write a font called FreeSans.ttf to the output 
-# directory and reference it in all dot files that doxygen generates. This 
-# font does not include all possible unicode characters however, so when you need 
-# these (or just want a differently looking font) you can specify the font name 
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font, 
-# which can be done by putting it in a standard location or by setting the 
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 
-# containing the font.
-
-DOT_FONTNAME           = FreeSans
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 
-# The default size is 10pt.
-
-DOT_FONTSIZE           = 10
-
-# By default doxygen will tell dot to use the output directory to look for the 
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a 
-# different font using DOT_FONTNAME you can set the path where dot 
-# can find it using this tag.
-
-DOT_FONTPATH           = 
-
-# 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 the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
-# collaboration diagrams in a style similar to the OMG's Unified Modeling 
-# Language.
-
-UML_LOOK               = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the 
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS     = NO
-
-# 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 CALL_GRAPH and HAVE_DOT options are set to YES then 
-# doxygen will generate a call dependency graph for every global function 
-# or class method. Note that enabling this option will significantly increase 
-# the time of a run. So in most cases it will be better to enable call graphs 
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
-# doxygen will generate a caller dependency graph for every global function 
-# or class method. Note that enabling this option will significantly increase 
-# the time of a run. So in most cases it will be better to enable caller 
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH           = NO
-
-# 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
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
-# then doxygen will show the dependencies a directory has on other directories 
-# in a graphical way. The dependency relations are determined by the #include 
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH        = 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 in the path.
-
-DOT_PATH               = /Applications/Graphviz.app/Contents/MacOS
-
-# 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 DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
-# nodes that will be shown in the graph. If the number of nodes in a graph 
-# becomes larger than this value, doxygen will truncate the graph, which is 
-# visualized by representing a node as a red box. Note that doxygen if the 
-# number of direct children of the root node in a graph is already larger than 
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES    = 67
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
-# graphs generated by dot. A depth value of 3 means that only nodes reachable 
-# from the root by following a path via at most 3 edges will be shown. Nodes 
-# that lay further from the root node will be omitted. Note that setting this 
-# option to 1 or 2 may greatly reduce the computation time needed for large 
-# code bases. Also note that the size of a graph can be further restricted by 
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH    = 2
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
-# background. This is disabled by default, because dot on Windows does not 
-# seem to support this out of the box. Warning: Depending on the platform used, 
-# enabling this option may lead to badly anti-aliased labels on the edges of 
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT        = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
-# files in one run (i.e. multiple -o and -T options on the command line). This 
-# makes dot run faster, but since only newer versions of dot (>1.8.10) 
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS      = NO
-
-# 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 intermediate dot files that are used to generate 
-# the various graphs.
-
-DOT_CLEANUP            = YES
diff --git a/deps/SDL2/acinclude/ac_check_define.m4 b/deps/SDL2/acinclude/ac_check_define.m4
deleted file mode 100644
index 64de801..0000000
--- a/deps/SDL2/acinclude/ac_check_define.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-AC_DEFUN([AC_CHECK_DEFINE],[dnl
-  AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
-    AC_EGREP_CPP([YES_IS_DEFINED], [
-#include <$2>
-#ifdef $1
-YES_IS_DEFINED
-#endif
-    ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
-  )
-  if test "$ac_cv_define_$1" = "yes" ; then
-    AC_DEFINE([HAVE_$1],[],[Added by AC_CHECK_DEFINE])
-  fi
-])dnl
-AC_DEFINE([HAVE_$1],[],[Added by AC_CHECK_DEFINE])
diff --git a/deps/SDL2/acinclude/alsa.m4 b/deps/SDL2/acinclude/alsa.m4
deleted file mode 100644
index d818e70..0000000
--- a/deps/SDL2/acinclude/alsa.m4
+++ /dev/null
@@ -1,145 +0,0 @@
-##############################################################################
-dnl Configure Paths for Alsa
-dnl Some modifications by Richard Boulton <richard-alsa at tartarus.org>
-dnl Christopher Lansdown <lansdoct at cs.alfred.edu>
-dnl Jaroslav Kysela <perex at suse.cz>
-dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
-dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
-dnl enables arguments --with-alsa-prefix=
-dnl                   --with-alsa-enc-prefix=
-dnl                   --disable-alsatest
-dnl
-dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
-dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
-dnl
-AC_DEFUN([AM_PATH_ALSA],
-[dnl Save the original CFLAGS, LDFLAGS, and LIBS
-alsa_save_CFLAGS="$CFLAGS"
-alsa_save_LDFLAGS="$LDFLAGS"
-alsa_save_LIBS="$LIBS"
-alsa_found=yes
-
-dnl
-dnl Get the cflags and libraries for alsa
-dnl
-AC_ARG_WITH(alsa-prefix,
-[  --with-alsa-prefix=PFX  Prefix where Alsa library is installed(optional)],
-[alsa_prefix="$withval"], [alsa_prefix=""])
-
-AC_ARG_WITH(alsa-inc-prefix,
-[  --with-alsa-inc-prefix=PFX  Prefix where include libraries are (optional)],
-[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
-
-dnl FIXME: this is not yet implemented
-AC_ARG_ENABLE(alsatest,
-[  --disable-alsatest      Do not try to compile and run a test Alsa program],
-[enable_alsatest="$enableval"],
-[enable_alsatest=yes])
-
-dnl Add any special include directories
-AC_MSG_CHECKING(for ALSA CFLAGS)
-if test "$alsa_inc_prefix" != "" ; then
-	ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
-	CFLAGS="$CFLAGS -I$alsa_inc_prefix"
-fi
-AC_MSG_RESULT($ALSA_CFLAGS)
-
-dnl add any special lib dirs
-AC_MSG_CHECKING(for ALSA LDFLAGS)
-if test "$alsa_prefix" != "" ; then
-	ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
-	LDFLAGS="$LDFLAGS $ALSA_LIBS"
-fi
-
-dnl add the alsa library
-ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
-LIBS=`echo $LIBS | sed 's/-lm//'`
-LIBS=`echo $LIBS | sed 's/-ldl//'`
-LIBS=`echo $LIBS | sed 's/-lpthread//'`
-LIBS=`echo $LIBS | sed 's/  //'`
-LIBS="$ALSA_LIBS $LIBS"
-AC_MSG_RESULT($ALSA_LIBS)
-
-dnl Check for a working version of libasound that is of the right version.
-min_alsa_version=ifelse([$1], ,0.1.1,$1)
-AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
-no_alsa=""
-    alsa_min_major_version=`echo $min_alsa_version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-    alsa_min_minor_version=`echo $min_alsa_version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-    alsa_min_micro_version=`echo $min_alsa_version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-
-AC_LANG_SAVE
-AC_LANG_C
-AC_TRY_COMPILE([
-#include <alsa/asoundlib.h>
-], [
-/* ensure backward compatibility */
-#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
-#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
-#endif
-#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
-#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
-#endif
-#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
-#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
-#endif
-
-#  if(SND_LIB_MAJOR > $alsa_min_major_version)
-  exit(0);
-#  else
-#    if(SND_LIB_MAJOR < $alsa_min_major_version)
-#       error not present
-#    endif
-
-#   if(SND_LIB_MINOR > $alsa_min_minor_version)
-  exit(0);
-#   else
-#     if(SND_LIB_MINOR < $alsa_min_minor_version)
-#          error not present
-#      endif
-
-#      if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
-#        error not present
-#      endif
-#    endif
-#  endif
-exit(0);
-],
-  [AC_MSG_RESULT(found.)],
-  [AC_MSG_RESULT(not present.)
-   ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
-   alsa_found=no]
-)
-AC_LANG_RESTORE
-
-dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
-if test "x$enable_alsatest" = "xyes"; then
-AC_CHECK_LIB([asound], [snd_ctl_open],,
-	[ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
-	 alsa_found=no]
-)
-fi
-
-if test "x$alsa_found" = "xyes" ; then
-   ifelse([$2], , :, [$2])
-   LIBS=`echo $LIBS | sed 's/-lasound//g'`
-   LIBS=`echo $LIBS | sed 's/  //'`
-   LIBS="-lasound $LIBS"
-fi
-if test "x$alsa_found" = "xno" ; then
-   ifelse([$3], , :, [$3])
-   CFLAGS="$alsa_save_CFLAGS"
-   LDFLAGS="$alsa_save_LDFLAGS"
-   LIBS="$alsa_save_LIBS"
-   ALSA_CFLAGS=""
-   ALSA_LIBS=""
-fi
-
-dnl That should be it.  Now just export out symbols:
-AC_SUBST(ALSA_CFLAGS)
-AC_SUBST(ALSA_LIBS)
-])
diff --git a/deps/SDL2/acinclude/ax_check_compiler_flags.m4 b/deps/SDL2/acinclude/ax_check_compiler_flags.m4
deleted file mode 100644
index 35bfd2a..0000000
--- a/deps/SDL2/acinclude/ax_check_compiler_flags.m4
+++ /dev/null
@@ -1,76 +0,0 @@
-# ===========================================================================
-#  http://www.gnu.org/software/autoconf-archive/ax_check_compiler_flags.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
-#
-# DESCRIPTION
-#
-#   Check whether the given compiler FLAGS work with the current language's
-#   compiler, or whether they give an error. (Warnings, however, are
-#   ignored.)
-#
-#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
-#   success/failure.
-#
-# LICENSE
-#
-#   Copyright (c) 2009 Steven G. Johnson <stevenj at alum.mit.edu>
-#   Copyright (c) 2009 Matteo Frigo
-#
-#   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/>.
-#
-#   As a special exception, the respective Autoconf Macro's copyright owner
-#   gives unlimited permission to copy, distribute and modify the configure
-#   scripts that are the output of Autoconf when processing the Macro. You
-#   need not follow the terms of the GNU General Public License when using
-#   or distributing such scripts, even though portions of the text of the
-#   Macro appear in them. The GNU General Public License (GPL) does govern
-#   all other use of the material that constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Archive. When you make and distribute a
-#   modified version of the Autoconf Macro, you may extend this special
-#   exception to the GPL to apply to your modified version as well.
-
-#serial 9
-
-AC_DEFUN([AX_CHECK_COMPILER_FLAGS],
-[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
-AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1])
-dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
-AS_LITERAL_IF([$1],
-  [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [
-      ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
-      _AC_LANG_PREFIX[]FLAGS="$1"
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
-        AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
-        AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
-      _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])],
-  [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
-   _AC_LANG_PREFIX[]FLAGS="$1"
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
-     eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
-     eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
-   _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])
-eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])
-AC_MSG_RESULT($ax_check_compiler_flags)
-if test "x$ax_check_compiler_flags" = xyes; then
-	m4_default([$2], :)
-else
-	m4_default([$3], :)
-fi
-])dnl AX_CHECK_COMPILER_FLAGS
diff --git a/deps/SDL2/acinclude/ax_gcc_archflag.m4 b/deps/SDL2/acinclude/ax_gcc_archflag.m4
deleted file mode 100644
index d37a913..0000000
--- a/deps/SDL2/acinclude/ax_gcc_archflag.m4
+++ /dev/null
@@ -1,215 +0,0 @@
-# ===========================================================================
-#      http://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE])
-#
-# DESCRIPTION
-#
-#   This macro tries to guess the "native" arch corresponding to the target
-#   architecture for use with gcc's -march=arch or -mtune=arch flags. If
-#   found, the cache variable $ax_cv_gcc_archflag is set to this flag and
-#   ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is is set to
-#   "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is
-#   to add $ax_cv_gcc_archflag to the end of $CFLAGS.
-#
-#   PORTABLE? should be either [yes] (default) or [no]. In the former case,
-#   the flag is set to -mtune (or equivalent) so that the architecture is
-#   only used for tuning, but the instruction set used is still portable. In
-#   the latter case, the flag is set to -march (or equivalent) so that
-#   architecture-specific instructions are enabled.
-#
-#   The user can specify --with-gcc-arch=<arch> in order to override the
-#   macro's choice of architecture, or --without-gcc-arch to disable this.
-#
-#   When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is
-#   called unless the user specified --with-gcc-arch manually.
-#
-#   Requires macros: AX_CHECK_COMPILER_FLAGS, AX_GCC_X86_CPUID
-#
-#   (The main emphasis here is on recent CPUs, on the principle that doing
-#   high-performance computing on old hardware is uncommon.)
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Steven G. Johnson <stevenj at alum.mit.edu>
-#   Copyright (c) 2008 Matteo Frigo
-#
-#   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/>.
-#
-#   As a special exception, the respective Autoconf Macro's copyright owner
-#   gives unlimited permission to copy, distribute and modify the configure
-#   scripts that are the output of Autoconf when processing the Macro. You
-#   need not follow the terms of the GNU General Public License when using
-#   or distributing such scripts, even though portions of the text of the
-#   Macro appear in them. The GNU General Public License (GPL) does govern
-#   all other use of the material that constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Archive. When you make and distribute a
-#   modified version of the Autoconf Macro, you may extend this special
-#   exception to the GPL to apply to your modified version as well.
-
-#serial 8
-
-AC_DEFUN([AX_GCC_ARCHFLAG],
-[AC_REQUIRE([AC_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-
-AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])],
-	ax_gcc_arch=$withval, ax_gcc_arch=yes)
-
-AC_MSG_CHECKING([for gcc architecture flag])
-AC_MSG_RESULT([])
-AC_CACHE_VAL(ax_cv_gcc_archflag,
-[
-ax_cv_gcc_archflag="unknown"
-
-if test "$GCC" = yes; then
-
-if test "x$ax_gcc_arch" = xyes; then
-ax_gcc_arch=""
-if test "$cross_compiling" = no; then
-case $host_cpu in
-  i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones
-     AX_GCC_X86_CPUID(0)
-     AX_GCC_X86_CPUID(1)
-     case $ax_cv_gcc_x86_cpuid_0 in
-       *:756e6547:*:*) # Intel
-          case $ax_cv_gcc_x86_cpuid_1 in
-	    *5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;;
-	    *5??:*:*:*) ax_gcc_arch=pentium ;;
-	    *6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
-	    *6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
-	    *6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
-	    *6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;;
-	    *6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
-	    *6??:*:*:*) ax_gcc_arch=pentiumpro ;;
-            *f3[[347]]:*:*:*|*f4[1347]:*:*:*)
-		case $host_cpu in
-                  x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;;
-                  *) ax_gcc_arch="prescott pentium4 pentiumpro" ;;
-                esac ;;
-            *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";;
-          esac ;;
-       *:68747541:*:*) # AMD
-          case $ax_cv_gcc_x86_cpuid_1 in
-	    *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;;
-	    *5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;;
-	    *5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;;
-	    *60?:*:*:*) ax_gcc_arch=k7 ;;
-	    *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;;
-	    *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;;
-	    *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;;
-	    *6[[68a]]?:*:*:*)
-	       AX_GCC_X86_CPUID(0x80000006) # L2 cache size
-	       case $ax_cv_gcc_x86_cpuid_0x80000006 in
-                 *:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256
-			ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;;
-                 *) ax_gcc_arch="athlon-4 athlon k7" ;;
-	       esac ;;
-	    *f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;;
-	    *f5?:*:*:*) ax_gcc_arch="opteron k8" ;;
-	    *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;;
-	    *f??:*:*:*) ax_gcc_arch="k8" ;;
-          esac ;;
-	*:746e6543:*:*) # IDT
-	   case $ax_cv_gcc_x86_cpuid_1 in
-	     *54?:*:*:*) ax_gcc_arch=winchip-c6 ;;
-	     *58?:*:*:*) ax_gcc_arch=winchip2 ;;
-	     *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;;
-	     *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;;
-	   esac ;;
-     esac
-     if test x"$ax_gcc_arch" = x; then # fallback
-	case $host_cpu in
-	  i586*) ax_gcc_arch=pentium ;;
-	  i686*) ax_gcc_arch=pentiumpro ;;
-        esac
-     fi
-     ;;
-
-  sparc*)
-     AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/])
-     cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
-     cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters`
-     case $cputype in
-         *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
-         *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
-         *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;;
-         *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;;
-         *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;;
-         *cypress*) ax_gcc_arch=cypress ;;
-     esac ;;
-
-  alphaev5) ax_gcc_arch=ev5 ;;
-  alphaev56) ax_gcc_arch=ev56 ;;
-  alphapca56) ax_gcc_arch="pca56 ev56" ;;
-  alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;;
-  alphaev6) ax_gcc_arch=ev6 ;;
-  alphaev67) ax_gcc_arch=ev67 ;;
-  alphaev68) ax_gcc_arch="ev68 ev67" ;;
-  alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;;
-  alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;;
-  alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;;
-
-  powerpc*)
-     cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null`
-     cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'`
-     case $cputype in
-       *750*) ax_gcc_arch="750 G3" ;;
-       *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;;
-       *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;;
-       *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;;
-       *970*) ax_gcc_arch="970 G5 power4";;
-       *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";;
-       *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";;
-       603ev|8240) ax_gcc_arch="$cputype 603e 603";;
-       *) ax_gcc_arch=$cputype ;;
-     esac
-     ax_gcc_arch="$ax_gcc_arch powerpc"
-     ;;
-esac
-fi # not cross-compiling
-fi # guess arch
-
-if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then
-for arch in $ax_gcc_arch; do
-  if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code
-    flags="-mtune=$arch"
-    # -mcpu=$arch and m$arch generate nonportable code on every arch except
-    # x86.  And some other arches (e.g. Alpha) don't accept -mtune.  Grrr.
-    case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac
-  else
-    flags="-march=$arch -mcpu=$arch -m$arch"
-  fi
-  for flag in $flags; do
-    AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break])
-  done
-  test "x$ax_cv_gcc_archflag" = xunknown || break
-done
-fi
-
-fi # $GCC=yes
-])
-AC_MSG_CHECKING([for gcc architecture flag])
-AC_MSG_RESULT($ax_cv_gcc_archflag)
-if test "x$ax_cv_gcc_archflag" = xunknown; then
-  m4_default([$3],:)
-else
-  m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"])
-fi
-])
diff --git a/deps/SDL2/acinclude/ax_gcc_x86_cpuid.m4.htm b/deps/SDL2/acinclude/ax_gcc_x86_cpuid.m4.htm
deleted file mode 100644
index 7d46fee..0000000
--- a/deps/SDL2/acinclude/ax_gcc_x86_cpuid.m4.htm
+++ /dev/null
@@ -1,79 +0,0 @@
-# ===========================================================================
-#     http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_GCC_X86_CPUID(OP)
-#
-# DESCRIPTION
-#
-#   On Pentium and later x86 processors, with gcc or a compiler that has a
-#   compatible syntax for inline assembly instructions, run a small program
-#   that executes the cpuid instruction with input OP. This can be used to
-#   detect the CPU type.
-#
-#   On output, the values of the eax, ebx, ecx, and edx registers are stored
-#   as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable
-#   ax_cv_gcc_x86_cpuid_OP.
-#
-#   If the cpuid instruction fails (because you are running a
-#   cross-compiler, or because you are not using gcc, or because you are on
-#   a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP
-#   is set to the string "unknown".
-#
-#   This macro mainly exists to be used in AX_GCC_ARCHFLAG.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Steven G. Johnson <stevenj at alum.mit.edu>
-#   Copyright (c) 2008 Matteo Frigo
-#
-#   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/>.
-#
-#   As a special exception, the respective Autoconf Macro's copyright owner
-#   gives unlimited permission to copy, distribute and modify the configure
-#   scripts that are the output of Autoconf when processing the Macro. You
-#   need not follow the terms of the GNU General Public License when using
-#   or distributing such scripts, even though portions of the text of the
-#   Macro appear in them. The GNU General Public License (GPL) does govern
-#   all other use of the material that constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Archive. When you make and distribute a
-#   modified version of the Autoconf Macro, you may extend this special
-#   exception to the GPL to apply to your modified version as well.
-
-#serial 7
-
-AC_DEFUN([AX_GCC_X86_CPUID],
-[AC_REQUIRE([AC_PROG_CC])
-AC_LANG_PUSH([C])
-AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1,
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [
-     int op = $1, eax, ebx, ecx, edx;
-     FILE *f;
-      __asm__("cpuid"
-        : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
-        : "a" (op));
-     f = fopen("conftest_cpuid", "w"); if (!f) return 1;
-     fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
-     fclose(f);
-     return 0;
-])],
-     [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid],
-     [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid],
-     [ax_cv_gcc_x86_cpuid_$1=unknown])])
-AC_LANG_POP([C])
-])
diff --git a/deps/SDL2/acinclude/esd.m4 b/deps/SDL2/acinclude/esd.m4
deleted file mode 100644
index 58d64a9..0000000
--- a/deps/SDL2/acinclude/esd.m4
+++ /dev/null
@@ -1,168 +0,0 @@
-##############################################################################
-#
-# --- esd.m4 ---
-#
-# Configure paths for ESD
-# Manish Singh    98-9-30
-# stolen back from Frank Belew
-# stolen from Manish Singh
-# Shamelessly stolen from Owen Taylor
-
-dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
-dnl
-AC_DEFUN([AM_PATH_ESD],
-[dnl 
-dnl Get the cflags and libraries from the esd-config script
-dnl
-AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
-            esd_prefix="$withval", esd_prefix="")
-AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
-            esd_exec_prefix="$withval", esd_exec_prefix="")
-AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
-		    , enable_esdtest=yes)
-
-  if test x$esd_exec_prefix != x ; then
-     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
-     if test x${ESD_CONFIG+set} != xset ; then
-        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
-     fi
-  fi
-  if test x$esd_prefix != x ; then
-     esd_args="$esd_args --prefix=$esd_prefix"
-     if test x${ESD_CONFIG+set} != xset ; then
-        ESD_CONFIG=$esd_prefix/bin/esd-config
-     fi
-  fi
-
-  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
-  min_esd_version=ifelse([$1], ,0.2.7,$1)
-  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
-  no_esd=""
-  if test "$ESD_CONFIG" = "no" ; then
-    no_esd=yes
-  else
-    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
-    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
-
-    esd_major_version=`$ESD_CONFIG $esd_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-    if test "x$enable_esdtest" = "xyes" ; then
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $ESD_CFLAGS"
-      LIBS="$LIBS $ESD_LIBS"
-dnl
-dnl Now check if the installed ESD is sufficiently new. (Also sanity
-dnl checks the results of esd-config to some extent
-dnl
-      rm -f conf.esdtest
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <esd.h>
-
-char*
-my_strdup (char *str)
-{
-  char *new_str;
-  
-  if (str)
-    {
-      new_str = malloc ((strlen (str) + 1) * sizeof(char));
-      strcpy (new_str, str);
-    }
-  else
-    new_str = NULL;
-  
-  return new_str;
-}
-
-int main ()
-{
-  int major, minor, micro;
-  char *tmp_version;
-
-  system ("touch conf.esdtest");
-
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = my_strdup("$min_esd_version");
-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string\n", "$min_esd_version");
-     exit(1);
-   }
-
-   if (($esd_major_version > major) ||
-      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
-      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
-    {
-      return 0;
-    }
-  else
-    {
-      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
-      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
-      printf("*** best to upgrade to the required version.\n");
-      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
-      printf("*** to point to the correct copy of esd-config, and remove the file\n");
-      printf("*** config.cache before re-running configure\n");
-      return 1;
-    }
-}
-
-],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-  if test "x$no_esd" = x ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$2], , :, [$2])     
-  else
-     AC_MSG_RESULT(no)
-     if test "$ESD_CONFIG" = "no" ; then
-       echo "*** The esd-config script installed by ESD could not be found"
-       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the ESD_CONFIG environment variable to the"
-       echo "*** full path to esd-config."
-     else
-       if test -f conf.esdtest ; then
-        :
-       else
-          echo "*** Could not run ESD test program, checking why..."
-          CFLAGS="$CFLAGS $ESD_CFLAGS"
-          LIBS="$LIBS $ESD_LIBS"
-          AC_TRY_LINK([
-#include <stdio.h>
-#include <esd.h>
-],      [ return 0; ],
-        [ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding ESD or finding the wrong"
-          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-	  echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
-          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
-          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
-          CFLAGS="$ac_save_CFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     ESD_CFLAGS=""
-     ESD_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  AC_SUBST(ESD_CFLAGS)
-  AC_SUBST(ESD_LIBS)
-  rm -f conf.esdtest
-])
diff --git a/deps/SDL2/acinclude/libtool.m4 b/deps/SDL2/acinclude/libtool.m4
deleted file mode 100644
index c444a5e..0000000
--- a/deps/SDL2/acinclude/libtool.m4
+++ /dev/null
@@ -1,7988 +0,0 @@
-##############################################################################
-# Based on libtool-2.4.2
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 57 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
-       [m4_default([$3],
-		   [m4_fatal([Libtool version $1 or higher is required],
-		             63)])],
-       [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
-  *\ * | *\	*)
-    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    _LT_PATH_MAGIC
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-])
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-## ------------------------------------- ##
-## Accumulate code for creating libtool. ##
-## ------------------------------------- ##
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
-              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-## ------------------------ ##
-## FIXME: Eliminate VARNAME ##
-## ------------------------ ##
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME.  Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
-    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
-	[m4_ifval([$1], [$1], [$2])])
-    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
-    m4_ifval([$4],
-	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
-    lt_dict_add_subkey([lt_decl_dict], [$2],
-	[tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
-  [0], [m4_fatal([$0: too few arguments: $#])],
-  [1], [m4_fatal([$0: too few arguments: $#: $1])],
-  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
-  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
-  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
-    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
-    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
-     m4_if([$2], [],
-	   m4_quote(lt_decl_varnames),
-	m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
-			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'.  VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly.  In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
-    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-#    # Some comment about what VAR is for.
-#    visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
-					   [description])))[]dnl
-m4_pushdef([_libtool_name],
-    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
-    [0], [_libtool_name=[$]$1],
-    [1], [_libtool_name=$lt_[]$1],
-    [2], [_libtool_name=$lt_[]$1],
-    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
-    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'.  Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
-	dnl If the libtool generation code has been placed in $CONFIG_LT,
-	dnl instead of duplicating it all over again into config.status,
-	dnl then we will have config.status run $CONFIG_LT later, so it
-	dnl needs to know what name is stored there:
-        [AC_CONFIG_COMMANDS([libtool],
-            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
-    dnl If the libtool generation code is destined for config.status,
-    dnl expand the accumulated commands and init code now:
-    [AC_CONFIG_COMMANDS([libtool],
-        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$[]1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable.  If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins.  After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script.  The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-lt_cl_silent=false
-exec AS_MESSAGE_LOG_FD>>config.log
-{
-  echo
-  AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
-  -h, --help      print this help, then exit
-  -V, --version   print version number, then exit
-  -q, --quiet     do not print progress messages
-  -d, --debug     don't remove temporary files
-
-Report bugs to <bug-libtool at gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2011 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
-  case $[1] in
-    --version | --v* | -V )
-      echo "$lt_cl_version"; exit 0 ;;
-    --help | --h* | -h )
-      echo "$lt_cl_help"; exit 0 ;;
-    --debug | --d* | -d )
-      debug=: ;;
-    --quiet | --q* | --silent | --s* | -q )
-      lt_cl_silent=: ;;
-
-    -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
-    *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
-  esac
-  shift
-done
-
-if $lt_cl_silent; then
-  exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure.  Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-lt_cl_success=:
-test "$silent" = yes &&
-  lt_config_lt_args="$lt_config_lt_args --quiet"
-exec AS_MESSAGE_LOG_FD>/dev/null
-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-exec AS_MESSAGE_LOG_FD>>config.log
-$lt_cl_success || AS_EXIT(1)
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars.  Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
-  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
-  m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options which allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile="${ofile}T"
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-  _LT_PROG_LTMAIN
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" \
-     || (rm -f "$cfgfile"; exit 1)
-
-  _LT_PROG_REPLACE_SHELLFNS
-
-   mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
-    RM='$RM'
-    ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
-  [C],			[_LT_LANG(C)],
-  [C++],		[_LT_LANG(CXX)],
-  [Go],			[_LT_LANG(GO)],
-  [Java],		[_LT_LANG(GCJ)],
-  [Fortran 77],		[_LT_LANG(F77)],
-  [Fortran],		[_LT_LANG(FC)],
-  [Windows Resource],	[_LT_LANG(RC)],
-  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
-    [_LT_LANG($1)],
-    [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
-  [LT_SUPPORTED_TAG([$1])dnl
-  m4_append([_LT_TAGS], [$1 ])dnl
-  m4_define([_LT_LANG_]$1[_enabled], [])dnl
-  _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-m4_ifndef([AC_PROG_GO], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-############################################################
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC],     [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
-  fi
-fi
-if test -z "$GOC"; then
-  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
-  [LT_LANG(CXX)],
-  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
-  [LT_LANG(F77)],
-  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
-  [LT_LANG(FC)],
-  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-  [LT_LANG(GCJ)],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-    [LT_LANG(GCJ)],
-    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
-      [LT_LANG(GCJ)],
-      [m4_ifdef([AC_PROG_GCJ],
-	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([A][M_PROG_GCJ],
-	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([LT_PROG_GCJ],
-	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([AC_PROG_GO],
-  [LT_LANG(GO)],
-  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
-  [LT_LANG(RC)],
-  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
-  case $host_os in
-    rhapsody* | darwin*)
-    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
-    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
-    AC_CHECK_TOOL([LIPO], [lipo], [:])
-    AC_CHECK_TOOL([OTOOL], [otool], [:])
-    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
-    _LT_DECL([], [DSYMUTIL], [1],
-      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
-    _LT_DECL([], [NMEDIT], [1],
-      [Tool to change global to local symbols on Mac OS X])
-    _LT_DECL([], [LIPO], [1],
-      [Tool to manipulate fat objects and archives on Mac OS X])
-    _LT_DECL([], [OTOOL], [1],
-      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
-    _LT_DECL([], [OTOOL64], [1],
-      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
-    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
-      [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-	# By default we will add the -single_module flag. You can override
-	# by either setting the environment variable LT_MULTI_MODULE
-	# non-empty at configure time, or by adding -multi_module to the
-	# link flags.
-	rm -rf libconftest.dylib*
-	echo "int foo(void){return 1;}" > conftest.c
-	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
-	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-	# If there is a non-empty error log, and "single_module"
-	# appears in it, assume the flag caused a linker warning
-        if test -s conftest.err && $GREP single_module conftest.err; then
-	  cat conftest.err >&AS_MESSAGE_LOG_FD
-	# Otherwise, if the output was created with a 0 exit code from
-	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
-	  lt_cv_apple_cc_single_mod=yes
-	else
-	  cat conftest.err >&AS_MESSAGE_LOG_FD
-	fi
-	rm -rf libconftest.dylib*
-	rm -f conftest.*
-      fi])
-
-    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
-      [lt_cv_ld_exported_symbols_list],
-      [lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-	[lt_cv_ld_exported_symbols_list=yes],
-	[lt_cv_ld_exported_symbols_list=no])
-	LDFLAGS="$save_LDFLAGS"
-    ])
-
-    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
-      [lt_cv_ld_force_load=no
-      cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
-      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
-      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
-      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
-      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
-      cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
-      _lt_result=$?
-      if test -s conftest.err && $GREP force_load conftest.err; then
-	cat conftest.err >&AS_MESSAGE_LOG_FD
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
-	lt_cv_ld_force_load=yes
-      else
-	cat conftest.err >&AS_MESSAGE_LOG_FD
-      fi
-        rm -f conftest.err libconftest.a conftest conftest.c
-        rm -rf conftest.dSYM
-    ])
-    case $host_os in
-    rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[[012]]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
-  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_automatic, $1)=yes
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
-                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
-  else
-    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
-  fi
-  _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    m4_if([$1], [CXX],
-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-    fi
-],[])
-  else
-  _LT_TAGVAR(ld_shlibs, $1)=no
-  fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-# ----------------------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-# Store the results from the different compilers for each TAGNAME.
-# Allow to override them for all tags through lt_cv_aix_libpath.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
-  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
-  lt_aix_libpath_sed='[
-      /Import File Strings/,/^$/ {
-	  /^0/ {
-	      s/^0  *\([^ ]*\) *$/\1/
-	      p
-	  }
-      }]'
-  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi],[])
-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
-  fi
-  ])
-  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _LT_SHELL_INIT
-
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='printf %s\n'
-else
-  # Use this function as a fallback that always works.
-  func_fallback_echo ()
-  {
-    eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
-  }
-  ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*" 
-}
-
-case "$ECHO" in
-  printf*) AC_MSG_RESULT([printf]) ;;
-  print*) AC_MSG_RESULT([print -r]) ;;
-  *) AC_MSG_RESULT([cat]) ;;
-esac
-
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
-  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
-    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-    PATH=/empty FPATH=/empty; export PATH FPATH
-    test "X`printf %s $ECHO`" = "X$ECHO" \
-      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_WITH_SYSROOT
-# ----------------
-AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
-AC_ARG_WITH([sysroot],
-[  --with-sysroot[=DIR] Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).],
-[], [with_sysroot=no])
-
-dnl lt_sysroot will always be passed unquoted.  We quote it here
-dnl in case the user passed a directory name.
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
-   if test "$GCC" = yes; then
-     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-   fi
-   ;; #(
- /*)
-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-   ;; #(
- no|'')
-   ;; #(
- *)
-   AC_MSG_RESULT([${with_sysroot}])
-   AC_MSG_ERROR([The sysroot must be an absolute path.])
-   ;;
-esac
-
- AC_MSG_RESULT([${lt_sysroot:-no}])
-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-  [AS_HELP_STRING([--disable-libtool-lock],
-    [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-	HPUX_IA64_MODE="32"
-	;;
-      *ELF-64*)
-	HPUX_IA64_MODE="64"
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -melf32bsmip"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -melf32bmipn32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -melf64bmip"
-	;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -32"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -n32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -64"
-	  ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_i386_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
-	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
-	    LD="${LD-ld} -m elf32ppclinux"
-	    ;;
-	  s390x-*linux*)
-	    LD="${LD-ld} -m elf_s390"
-	    ;;
-	  sparc64-*linux*)
-	    LD="${LD-ld} -m elf32_sparc"
-	    ;;
-	esac
-	;;
-      *64-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_x86_64_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_x86_64"
-	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
-	    LD="${LD-ld} -m elf64ppc"
-	    ;;
-	  s390*-*linux*|s390*-*tpf*)
-	    LD="${LD-ld} -m elf64_s390"
-	    ;;
-	  sparc*-*linux*)
-	    LD="${LD-ld} -m elf64_sparc"
-	    ;;
-	esac
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_PUSH(C)
-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*)
-        case $host in
-        i?86-*-solaris*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        sparc*-*-solaris*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-        esac
-        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
-        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
-        fi
-        ;;
-      *)
-	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-	  LD="${LD-ld} -64"
-	fi
-	;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_PROG_AR
-# -----------
-m4_defun([_LT_PROG_AR],
-[AC_CHECK_TOOLS(AR, [ar], false)
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-
-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
-  [lt_cv_ar_at_file=no
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
-     [echo conftest.$ac_objext > conftest.lst
-      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
-      AC_TRY_EVAL([lt_ar_try])
-      if test "$ac_status" -eq 0; then
-	# Ensure the archiver fails upon bogus file names.
-	rm -f conftest.$ac_objext libconftest.a
-	AC_TRY_EVAL([lt_ar_try])
-	if test "$ac_status" -ne 0; then
-          lt_cv_ar_at_file=@
-        fi
-      fi
-      rm -f conftest.* libconftest.a
-     ])
-  ])
-
-if test "x$lt_cv_ar_at_file" = xno; then
-  archiver_list_spec=
-else
-  archiver_list_spec=$lt_cv_ar_at_file
-fi
-_LT_DECL([], [archiver_list_spec], [1],
-  [How to feed a file listing to the archiver])
-])# _LT_PROG_AR
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[_LT_PROG_AR
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
-    [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
-  darwin*)
-    lock_old_archive_extraction=yes ;;
-  *)
-    lock_old_archive_extraction=no ;;
-esac
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
-    [Commands used to build an old-style archive])
-_LT_DECL([], [lock_old_archive_extraction], [0],
-    [Whether to use a lock for old archive extraction])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$5], , :, [$5])
-else
-    m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                  [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$4], , :, [$4])
-else
-    m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
-  i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  mint*)
-    # On MiNT this can take a long time and run out of memory.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  os2*)
-    # The test takes a long time on OS/2.
-    lt_cv_sys_max_cmd_len=8192
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
-	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
-  AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
-    [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-	}
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}]
-_LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_dlunknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ])
-    ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
-	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen="dlopen"],
-	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
-	      ])
-	    ])
-	  ])
-	])
-      ])
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-	  lt_cv_dlopen_self, [dnl
-	  _LT_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-	  lt_cv_dlopen_self_static, [dnl
-	  _LT_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
-	 [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
-	 [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
-	 [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-     fi
-   fi
-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
-	[Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
-         [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
-   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
-    [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      AC_MSG_RESULT([yes])
-    else
-      AC_MSG_RESULT([no])
-    fi
-    ;;
-  *)
-    AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
-	[], [
-if test "$GCC" = yes; then
-  case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
-  esac
-  case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
-  case $lt_search_path_spec in
-  *\;*)
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
-    ;;
-  *)
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
-    ;;
-  esac
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
-      test -d "$lt_sys_path" && \
-	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
-  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
-  # AWK program above erroneously prepends '/' to C:/dos/paths
-  # for these hosts.
-  case $host_os in
-    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
-  esac
-  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[[4-9]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$cc_basename in
-  yes,*)
-    # gcc
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
-m4_if([$1], [],[
-      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}'
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    dynamic_linker='Win32 ld.exe'
-    ;;
-
-  *,cl*)
-    # Native MSVC
-    libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
-
-    case $build_os in
-    mingw*)
-      sys_lib_search_path_spec=
-      lt_save_ifs=$IFS
-      IFS=';'
-      for lt_path in $LIB
-      do
-        IFS=$lt_save_ifs
-        # Let DOS variable expansion print the short 8.3 style file name.
-        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-      done
-      IFS=$lt_save_ifs
-      # Convert to MSYS style.
-      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
-      ;;
-    cygwin*)
-      # Convert to unix form, then to dos form, then back to unix form
-      # but this time dos style (no spaces!) so that the unix form looks
-      # like /cygdrive/c/PROGRA~1:/cygdr...
-      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      ;;
-    *)
-      sys_lib_search_path_spec="$LIB"
-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      # FIXME: find the short name or the path components, as spaces are
-      # common. (e.g. "Program Files" -> "PROGRA~1")
-      ;;
-    esac
-
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-    dynamic_linker='Win32 link.exe'
-    ;;
-
-  *)
-    # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    dynamic_linker='Win32 ld.exe'
-    ;;
-  esac
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[[23]].*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2.*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
-  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-haiku*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
-  postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
-  ;;
-
-interix[[3-9]]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux # correct to gnu/linux during the next big refactor
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-
-  # Some binutils ld are patched to set DT_RUNPATH
-  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
-    [lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
-	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
-	 [lt_cv_shlibpath_overrides_runpath=yes])])
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-    ])
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
-    [Variables whose values should be saved in libtool wrapper scripts and
-    restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
-    [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
-    [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
-    [[List of archive names.  First name is the real one, the rest are links.
-    The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
-    [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [install_override_mode], [1],
-    [Permission mode override for installation of shared libraries])
-_LT_DECL([], [postinstall_cmds], [2],
-    [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
-    [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
-    [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
-    [[As "finish_cmds", except a single script fragment to be evaled but
-    not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
-    [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
-    [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
-    [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="m4_if([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-_LT_EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
-	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
-
-AC_ARG_WITH([gnu-ld],
-    [AS_HELP_STRING([--with-gnu-ld],
-	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
-    [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
-  lt_cv_ld_reload_flag,
-  [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
-      reload_cmds=false
-    fi
-    ;;
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[[45]]*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    # Keep this pattern in sync with the one in func_win32_libid.
-    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-cegcc*)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-haiku*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[[3-9]]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
-  case $host_os in
-  mingw* | pw32*)
-    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-      want_nocaseglob=yes
-    else
-      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
-    fi
-    ;;
-  esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
-    [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
-    [Command to use when deplibs_check_method = "file_magic"])
-_LT_DECL([], [file_magic_glob], [1],
-    [How to find potential files when deplibs_check_method = "file_magic"])
-_LT_DECL([], [want_nocaseglob], [1],
-    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$DUMPBIN"; then :
-    # Let the user override the test.
-  else
-    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
-    *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
-      ;;
-    *)
-      DUMPBIN=:
-      ;;
-    esac
-  fi
-  AC_SUBST([DUMPBIN])
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
-  [lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
-  cat conftest.out >&AS_MESSAGE_LOG_FD
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-# --------------------------------
-# how to determine the name of the shared library
-# associated with a specific link library.
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-m4_require([_LT_DECL_DLLTOOL])
-AC_CACHE_CHECK([how to associate runtime and link libraries],
-lt_cv_sharedlib_from_linklib_cmd,
-[lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
-  case `$DLLTOOL --help 2>&1` in
-  *--identify-strict*)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-    ;;
-  *)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-    ;;
-  esac
-  ;;
-*)
-  # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-  ;;
-esac
-])
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
-    [Command to associate shared and link libraries])
-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-
-
-# _LT_PATH_MANIFEST_TOOL
-# ----------------------
-# locate the manifest tool
-m4_defun([_LT_PATH_MANIFEST_TOOL],
-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
-  [lt_cv_path_mainfest_tool=no
-  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
-  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-    lt_cv_path_mainfest_tool=yes
-  fi
-  rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
-  MANIFEST_TOOL=:
-fi
-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-])# _LT_PATH_MANIFEST_TOOL
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
-  ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
-  case $cc_basename in
-  nvcc*)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
-  esac
-
-  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
-	[Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris*)
-  symcode='[[BDRT]]'
-  ;;
-sco3.2v5*)
-  symcode='[[DT]]'
-  ;;
-sysv4.2uw2*)
-  symcode='[[DT]]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[[ABDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK ['"\
-"     {last_section=section; section=\$ 3};"\
-"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx]"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT@&t at _DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data.  */
-# define LT@&t at _DLSYM_CONST
-#else
-# define LT@&t at _DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-	  cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-LT@&t at _DLSYM_CONST struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-	  cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_globsym_save_LIBS=$LIBS
-	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
-	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
-	    pipe_works=yes
-	  fi
-	  LIBS=$lt_globsym_save_LIBS
-	  CFLAGS=$lt_globsym_save_CFLAGS
-	else
-	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
-    fi
-  else
-    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
-  nm_file_list_spec='@'
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
-    [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
-    [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
-    [lt_cv_sys_global_symbol_to_c_name_address], [1],
-    [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
-    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
-    [Transform the output of nm in a C name address pair when lib prefix is needed])
-_LT_DECL([], [nm_file_list_spec], [1],
-    [Specify filename containing input files for $NM])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-m4_if([$1], [CXX], [
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-    *qnx* | *nto*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[[4-9]]*)
-	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
-	  # AIX 5 now supports IA64 processor
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	else
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-      mingw* | cygwin* | os2* | pw32* | cegcc*)
-	# This hack is so that the source file can tell whether it is being
-	# built for inclusion in a dll (and should export symbols for example).
-	m4_if([$1], [GCJ], [],
-	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-	;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    ;;
-	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  icpc* )
-	    # Intel C++, used to be incompatible with GCC.
-	    # ICC 10 doesn't accept -KPIC any more.
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
-	    # IBM XL 8.0, 9.0 on PPC and BlueGene
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd*)
-	;;
-      *qnx* | *nto*)
-        # QNX uses GNU C++, but need to define -shared option too, otherwise
-        # it will coredump.
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-        ;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC* | sunCC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-	;;
-    esac
-  fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	# +Z the default
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-
-    case $cc_basename in
-    nvcc*) # Cuda Compiler Driver 2.2
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
-      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
-      fi
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
-      case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
-      ecc*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
-	;;
-      nagfor*)
-	# NAG Fortran compiler
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	;;
-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      xl* | bgxl* | bgf* | mpixl*)
-	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
-	  ;;
-	*Sun\ F* | *Sun*Fortran*)
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	  ;;
-	*Sun\ C*)
-	  # Sun C 5.9
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	  ;;
-        *Intel*\ [[CF]]*Compiler*)
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	  ;;
-	*Portland\ Group*)
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    rdos*)
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    unicos*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-
-AC_CACHE_CHECK([for $compiler option to produce PIC],
-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
-    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
-    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
-	[Additional compiler flags for building library objects])
-
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
-	[How to pass a linker flag through the compiler])
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
-  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
-  $lt_tmp_static_flag,
-  [],
-  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
-	[Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  case $host_os in
-  aix[[4-9]]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-    ;;
-  cygwin* | mingw* | cegcc*)
-    case $cc_basename in
-    cl*)
-      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-      ;;
-    *)
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-      ;;
-    esac
-    ;;
-  *)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-    ;;
-  esac
-], [
-  runpath_var=
-  _LT_TAGVAR(allow_undefined_flag, $1)=
-  _LT_TAGVAR(always_export_symbols, $1)=no
-  _LT_TAGVAR(archive_cmds, $1)=
-  _LT_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_TAGVAR(compiler_needs_object, $1)=no
-  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  _LT_TAGVAR(hardcode_automatic, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
-  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(inherit_rpath, $1)=no
-  _LT_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_TAGVAR(module_cmds, $1)=
-  _LT_TAGVAR(module_expsym_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_TAGVAR(include_expsyms, $1)=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  _LT_TAGVAR(ld_shlibs, $1)=yes
-
-  # On some targets, GNU ld is compatible enough with the native linker
-  # that we're better off using the native interface for both.
-  lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
-    case $host_os in
-      aix*)
-	# The AIX port of GNU ld has always aspired to compatibility
-	# with the native linker.  However, as the warning in the GNU ld
-	# block says, versions before 2.19.5* couldn't really create working
-	# shared libraries, regardless of the interface used.
-	case `$LD -v 2>&1` in
-	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
-	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
-	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
-	  *)
-	    lt_use_gnu_ld_interface=yes
-	    ;;
-	esac
-	;;
-      *)
-	lt_use_gnu_ld_interface=yes
-	;;
-    esac
-  fi
-
-  if test "$lt_use_gnu_ld_interface" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[[3-9]]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=no
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    interix[[3-9]]*)
-      _LT_TAGVAR(hardcode_direct, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
-      tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
-	case $cc_basename in
-	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
-	esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
-      then
-	tmp_addflag=' $pic_flag'
-	tmp_sharedflag='-shared'
-	case $cc_basename,$host_cpu in
-        pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95* | pgfortran*)
-					# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	lf95*)				# Lahey Fortran 8.1
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-	  tmp_sharedflag='--shared' ;;
-	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
-	  tmp_sharedflag='-qmkshrobj'
-	  tmp_addflag= ;;
-	nvcc*)	# Cuda Compiler Driver 2.2
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	  _LT_TAGVAR(compiler_needs_object, $1)=yes
-	  ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	  _LT_TAGVAR(compiler_needs_object, $1)=yes
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	esac
-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-        if test "x$supports_anon_versioning" = xyes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-        fi
-
-	case $cc_basename in
-	xlf* | bgf* | bgxlf* | mpixlf*)
-	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-	  fi
-	  ;;
-	esac
-      else
-        _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  # For security reasons, it is highly recommended that you always
-	  # use absolute paths for naming shared libraries, and exclude the
-	  # DT_RUNPATH tag from executables and libraries.  But doing so
-	  # requires that you compile everything twice, which is a pain.
-	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  else
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	_LT_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	# Also, AIX nm treats weak defined symbols like other global
-	# defined symbols, whereas GNU nm marks them as "W".
-	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	else
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-	    aix_use_runtimelinking=yes
-	    break
-	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      _LT_TAGVAR(archive_cmds, $1)=''
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[[012]]|aix4.[[012]].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	  # We have reworked collect2
-	  :
-	  else
-	  # We have old collect2
-	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-      else
-	if test "$host_cpu" = ia64; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an
-	 # empty executable.
-	 _LT_SYS_MODULE_PATH_AIX([$1])
-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
-	    # We only use this code for GNU lds that support --whole-archive.
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	  else
-	    # Exported symbols can be pulled into shared objects from archives
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	  fi
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[[45]]*)
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      case $cc_basename in
-      cl*)
-	# Native MSVC
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	_LT_TAGVAR(always_export_symbols, $1)=yes
-	_LT_TAGVAR(file_list_spec, $1)='@'
-	# Tell ltmain to make .lib files, not .a files.
-	libext=lib
-	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
-	# FIXME: Setting linknames here is a bad hack.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
-	# The linker will not automatically build a static lib if we build a DLL.
-	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-	# Don't use ranlib
-	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
-	;;
-      *)
-	# Assume MSVC wrapper
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	# Tell ltmain to make .lib files, not .a files.
-	libext=lib
-	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
-	# FIXME: Setting linknames here is a bad hack.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-	# The linker will automatically build a .lib file if we build a DLL.
-	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-	# FIXME: Should let the user specify the lib program.
-	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-	;;
-      esac
-      ;;
-
-    darwin* | rhapsody*)
-      _LT_DARWIN_LINKER_FEATURES($1)
-      ;;
-
-    dgux*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2.*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
-	_LT_TAGVAR(hardcode_direct, $1)=yes
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	_LT_TAGVAR(hardcode_minus_L, $1)=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	m4_if($1, [], [
-	  # Older versions of the 11.00 compiler do not understand -b yet
-	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
-	  _LT_LINKER_OPTION([if $CC understands -b],
-	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
-	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  _LT_TAGVAR(hardcode_direct, $1)=no
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  ;;
-	*)
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	# Try to use the -exported_symbol ld option, if it does not
-	# work, assume that -exports_file does not work either and
-	# implicitly export all symbols.
-	# This should be the same for all languages, so no per-tag cache variable.
-	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
-	  [lt_cv_irix_exported_symbol],
-	  [save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-	   AC_LINK_IFELSE(
-	     [AC_LANG_SOURCE(
-	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
-			      [C++], [[int foo (void) { return 0; }]],
-			      [Fortran 77], [[
-      subroutine foo
-      end]],
-			      [Fortran], [[
-      subroutine foo
-      end]])])],
-	      [lt_cv_irix_exported_symbol=yes],
-	      [lt_cv_irix_exported_symbol=no])
-           LDFLAGS="$save_LDFLAGS"])
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-	fi
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(inherit_rpath, $1)=yes
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	_LT_TAGVAR(hardcode_direct, $1)=yes
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	     ;;
-	   *)
-	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-	fi
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    os2*)
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-	case `$CC -V 2>&1` in
-	*"Compilers 5.0"*)
-	  wlarc=''
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-	  ;;
-	*)
-	  wlarc='${wl}'
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-	  ;;
-	esac
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
-	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-	  _LT_TAGVAR(hardcode_direct, $1)=no
-        ;;
-	motorola)
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4.3*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	_LT_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-
-    if test x$host_vendor = xsni; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
-	;;
-      esac
-    fi
-  fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
-    [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_TAGVAR(archive_cmds, $1) in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
-	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
-	[$RM conftest*
-	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-	  soname=conftest
-	  lib=conftest
-	  libobjs=conftest.$ac_objext
-	  deplibs=
-	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
-	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
-	  compiler_flags=-v
-	  linker_flags=-v
-	  verstring=
-	  output_objdir=.
-	  libname=conftest
-	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
-	  _LT_TAGVAR(allow_undefined_flag, $1)=
-	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
-	  then
-	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	  else
-	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  fi
-	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-	else
-	  cat conftest.err 1>&5
-	fi
-	$RM conftest*
-	])
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
-    [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
-    [enable_shared_with_static_runtimes], [0],
-    [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
-    [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
-    [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
-    [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
-    [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
-    [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
-    [Commands used to build a loadable module if different from building
-    a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
-    [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
-    [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
-    [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
-    [Flag to hardcode $libdir into a binary during linking.
-    This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
-    [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
-    library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
-    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
-    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
-    [Set to "yes" if building a shared library automatically hardcodes DIR
-    into the library and all subsequent libraries and executables linked
-    against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
-    [Set to yes if linker adds runtime paths of dependent libraries
-    to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
-    [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [always_export_symbols], [0],
-    [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
-    [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
-    [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
-    [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
-    [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [postlink_cmds], [2],
-    [Commands necessary for finishing linking programs])
-_LT_TAGDECL([], [file_list_spec], [1],
-    [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl    [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_SYS_DYNAMIC_LINKER($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-  LT_SYS_DLOPEN_SELF
-  _LT_CMD_STRIPLIB
-
-  # Report which library types will actually be built
-  AC_MSG_CHECKING([if libtool supports shared libraries])
-  AC_MSG_RESULT([$can_build_shared])
-
-  AC_MSG_CHECKING([whether to build shared libraries])
-  test "$can_build_shared" = "no" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[[4-9]]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  AC_MSG_RESULT([$enable_shared])
-
-  AC_MSG_CHECKING([whether to build static libraries])
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  AC_MSG_RESULT([$enable_static])
-
-  _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_CFLAGS=$CFLAGS
-  lt_save_LD=$LD
-  lt_save_GCC=$GCC
-  GCC=$GXX
-  lt_save_with_gnu_ld=$with_gnu_ld
-  lt_save_path_LD=$lt_cv_path_LD
-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-  else
-    $as_unset lt_cv_prog_gnu_ld
-  fi
-  if test -n "${lt_cv_path_LDCXX+set}"; then
-    lt_cv_path_LD=$lt_cv_path_LDCXX
-  else
-    $as_unset lt_cv_path_LD
-  fi
-  test -z "${LDCXX+set}" || LD=$LDCXX
-  CC=${CXX-"c++"}
-  CFLAGS=$CXXFLAGS
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    # We don't want -fno-exception when compiling C++ code, so set the
-    # no_builtin_flag separately
-    if test "$GXX" = yes; then
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-    else
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-    fi
-
-    if test "$GXX" = yes; then
-      # Set up default GNU C++ configuration
-
-      LT_PATH_LD
-
-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
-      # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-        # If archive_cmds runs LD, not CC, wlarc should be empty
-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-        #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
-
-        # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-	  $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-        else
-          _LT_TAGVAR(whole_archive_flag_spec, $1)=
-        fi
-      else
-        with_gnu_ld=no
-        wlarc=
-
-        # A generic and very simple default shared library creation
-        # command for GNU C++ for the case where it uses the native
-        # linker, instead of GNU ld.  If possible, this setting should
-        # overridden to take advantage of the native linker features on
-        # the platform it is being used on.
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      fi
-
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-    else
-      GXX=no
-      with_gnu_ld=no
-      wlarc=
-    fi
-
-    # PORTME: fill in a description of your system's C++ link characteristics
-    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-    _LT_TAGVAR(ld_shlibs, $1)=yes
-    case $host_os in
-      aix3*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-      aix[[4-9]]*)
-        if test "$host_cpu" = ia64; then
-          # On IA64, the linker does run time linking by default, so we don't
-          # have to do anything special.
-          aix_use_runtimelinking=no
-          exp_sym_flag='-Bexport'
-          no_entry_flag=""
-        else
-          aix_use_runtimelinking=no
-
-          # Test if we are trying to use run time linking or normal
-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
-          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	    for ld_flag in $LDFLAGS; do
-	      case $ld_flag in
-	      *-brtl*)
-	        aix_use_runtimelinking=yes
-	        break
-	        ;;
-	      esac
-	    done
-	    ;;
-          esac
-
-          exp_sym_flag='-bexport'
-          no_entry_flag='-bnoentry'
-        fi
-
-        # When large executables or shared objects are built, AIX ld can
-        # have problems creating the table of contents.  If linking a library
-        # or program results in "error TOC overflow" add -mminimal-toc to
-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-        _LT_TAGVAR(archive_cmds, $1)=''
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-        if test "$GXX" = yes; then
-          case $host_os in aix4.[[012]]|aix4.[[012]].*)
-          # We only want to do this on AIX 4.2 and lower, the check
-          # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	    # We have reworked collect2
-	    :
-	  else
-	    # We have old collect2
-	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
-	    # It fails to find uninstalled libraries when the uninstalled
-	    # path is not listed in the libpath.  Setting hardcode_minus_L
-	    # to unsupported forces relinking
-	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-          esac
-          shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
-	  fi
-        else
-          # not using gcc
-          if test "$host_cpu" = ia64; then
-	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	  # chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-          else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
-	    else
-	      shared_flag='${wl}-bM:SRE'
-	    fi
-          fi
-        fi
-
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-        # It seems that -bexpall does not export symbols beginning with
-        # underscore (_), so it is better to generate a list of symbols to
-	# export.
-        _LT_TAGVAR(always_export_symbols, $1)=yes
-        if test "$aix_use_runtimelinking" = yes; then
-          # Warning - without using the other runtime loading flags (-brtl),
-          # -berok will link without error, but may produce a broken library.
-          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-          # Determine the default libpath from the value encoded in an empty
-          # executable.
-          _LT_SYS_MODULE_PATH_AIX([$1])
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-        else
-          if test "$host_cpu" = ia64; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-          else
-	    # Determine the default libpath from the value encoded in an
-	    # empty executable.
-	    _LT_SYS_MODULE_PATH_AIX([$1])
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	    # Warning - without using the other run time loading flags,
-	    # -berok will link without error, but may produce a broken library.
-	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	    if test "$with_gnu_ld" = yes; then
-	      # We only use this code for GNU lds that support --whole-archive.
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	    else
-	      # Exported symbols can be pulled into shared objects from archives
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	    fi
-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-          fi
-        fi
-        ;;
-
-      beos*)
-	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	  # support --undefined.  This deserves some investigation.  FIXME
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	else
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-
-      chorus*)
-        case $cc_basename in
-          *)
-	  # FIXME: insert proper C++ library support
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	  ;;
-        esac
-        ;;
-
-      cygwin* | mingw* | pw32* | cegcc*)
-	case $GXX,$cc_basename in
-	,cl* | no,cl*)
-	  # Native MSVC
-	  # hardcode_libdir_flag_spec is actually meaningless, as there is
-	  # no search path for DLLs.
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	  _LT_TAGVAR(always_export_symbols, $1)=yes
-	  _LT_TAGVAR(file_list_spec, $1)='@'
-	  # Tell ltmain to make .lib files, not .a files.
-	  libext=lib
-	  # Tell ltmain to make .dll files, not .so files.
-	  shrext_cmds=".dll"
-	  # FIXME: Setting linknames here is a bad hack.
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	    else
-	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	    fi~
-	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	    linknames='
-	  # The linker will not automatically build a static lib if we build a DLL.
-	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-	  # Don't use ranlib
-	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-	    case $lt_outputfile in
-	      *.exe|*.EXE) ;;
-	      *)
-		lt_outputfile="$lt_outputfile.exe"
-		lt_tool_outputfile="$lt_tool_outputfile.exe"
-		;;
-	    esac~
-	    func_to_tool_file "$lt_outputfile"~
-	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	      $RM "$lt_outputfile.manifest";
-	    fi'
-	  ;;
-	*)
-	  # g++
-	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-	  # as there is no search path for DLLs.
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	  _LT_TAGVAR(always_export_symbols, $1)=no
-	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file (1st line
-	    # is EXPORTS), use it as is; otherwise, prepend...
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      cp $export_symbols $output_objdir/$soname.def;
-	    else
-	      echo EXPORTS > $output_objdir/$soname.def;
-	      cat $export_symbols >> $output_objdir/$soname.def;
-	    fi~
-	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	  else
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	  fi
-	  ;;
-	esac
-	;;
-      darwin* | rhapsody*)
-        _LT_DARWIN_LINKER_FEATURES($1)
-	;;
-
-      dgux*)
-        case $cc_basename in
-          ec++*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          ghcx*)
-	    # Green Hills C++ Compiler
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      freebsd2.*)
-        # C++ shared libraries reported to be fairly broken before
-	# switch to ELF
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      freebsd-elf*)
-        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        ;;
-
-      freebsd* | dragonfly*)
-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-        # conventions
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-        ;;
-
-      gnu*)
-        ;;
-
-      haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        ;;
-
-      hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-				             # but as the default
-				             # location of the library.
-
-        case $cc_basename in
-          CC*)
-            # FIXME: insert proper C++ library support
-            _LT_TAGVAR(ld_shlibs, $1)=no
-            ;;
-          aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            # Commands to make compiler produce verbose output that lists
-            # what "hidden" libraries, object files and flags are used when
-            # linking a shared library.
-            #
-            # There doesn't appear to be a way to prevent this compiler from
-            # explicitly linking system object files so we need to strip them
-            # from the output so that they don't get included in the library
-            # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-            ;;
-          *)
-            if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            else
-              # FIXME: insert proper C++ library support
-              _LT_TAGVAR(ld_shlibs, $1)=no
-            fi
-            ;;
-        esac
-        ;;
-
-      hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-          case $host_cpu in
-            hppa*64*|ia64*)
-              ;;
-            *)
-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-              ;;
-          esac
-        fi
-        case $host_cpu in
-          hppa*64*|ia64*)
-            _LT_TAGVAR(hardcode_direct, $1)=no
-            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-            ;;
-          *)
-            _LT_TAGVAR(hardcode_direct, $1)=yes
-            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-					         # but as the default
-					         # location of the library.
-            ;;
-        esac
-
-        case $cc_basename in
-          CC*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          aCC*)
-	    case $host_cpu in
-	      hppa*64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      ia64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      *)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	    esac
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
-	        case $host_cpu in
-	          hppa*64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	        esac
-	      fi
-	    else
-	      # FIXME: insert proper C++ library support
-	      _LT_TAGVAR(ld_shlibs, $1)=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      interix[[3-9]]*)
-	_LT_TAGVAR(hardcode_direct, $1)=no
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-	# Instead, shared libraries are loaded at an image base (0x10000000 by
-	# default) and relocated if they conflict, which is a slow very memory
-	# consuming and fragmenting process.  To avoid this, we pick a random,
-	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	;;
-      irix5* | irix6*)
-        case $cc_basename in
-          CC*)
-	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
-	      fi
-	    fi
-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
-	    ;;
-        esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(inherit_rpath, $1)=yes
-        ;;
-
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-	    ;;
-	  icpc* | ecpc* )
-	    # Intel C++
-	    with_gnu_ld=yes
-	    # version 8.0 and above of icpc choke on multiply defined symbols
-	    # if we add $predep_objects and $postdep_objects, however 7.1 and
-	    # earlier do not add the objects themselves.
-	    case `$CC -V 2>&1` in
-	      *"Version 7."*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	      *)  # Version 8.0 or newer
-	        tmp_idyn=
-	        case $host_cpu in
-		  ia64*) tmp_idyn=' -i_dynamic';;
-		esac
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	    esac
-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	    ;;
-          pgCC* | pgcpp*)
-            # Portland Group C++ compiler
-	    case `$CC -V` in
-	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
-	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
-	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-		$RANLIB $oldlib'
-	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    *) # Version 6 and above use weak symbols
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    esac
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-            ;;
-	  cxx*)
-	    # Compaq C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-	    runpath_var=LD_RUN_PATH
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
-	    ;;
-	  xl* | mpixl* | bgxl*)
-	    # IBM XL 8.0 on PPC, with GNU ld
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	    fi
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	      _LT_TAGVAR(compiler_needs_object, $1)=yes
-
-	      # Not sure whether something based on
-	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	      # would be better.
-	      output_verbose_link_cmd='func_echo_all'
-
-	      # Archives containing C++ object files must be created using
-	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	      # necessary to make sure instantiated templates are included
-	      # in the archive.
-	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-
-      lynxos*)
-        # FIXME: insert proper C++ library support
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      m88k*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      mvs*)
-        case $cc_basename in
-          cxx*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-	  *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-	esac
-	;;
-
-      netbsd*)
-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-	  wlarc=
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	fi
-	# Workaround some broken pre-1.5 toolchains
-	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-	;;
-
-      *nto* | *qnx*)
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-	;;
-
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      openbsd*)
-	if test -f /usr/libexec/ld.so; then
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-	  fi
-	  output_verbose_link_cmd=func_echo_all
-	else
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-
-      osf3* | osf4* | osf5*)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Archives containing C++ object files must be created using
-	    # the KAI C++ compiler.
-	    case $host in
-	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
-	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
-	    esac
-	    ;;
-          RCC*)
-	    # Rational C++ 2.4.1
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          cxx*)
-	    case $host in
-	      osf3*)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-		;;
-	      *)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-		;;
-	    esac
-
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-	    ;;
-	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	      case $host in
-	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	      esac
-
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	      # Commands to make compiler produce verbose output that lists
-	      # what "hidden" libraries, object files and flags are used when
-	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-	    else
-	      # FIXME: insert proper C++ library support
-	      _LT_TAGVAR(ld_shlibs, $1)=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      psos*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      sunos4*)
-        case $cc_basename in
-          CC*)
-	    # Sun C++ 4.x
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          lcc*)
-	    # Lucid
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      solaris*)
-        case $cc_basename in
-          CC* | sunCC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
-	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	    case $host_os in
-	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-	      *)
-		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
-	        # Supported since Solaris 2.6 (maybe 2.5.1?)
-		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	        ;;
-	    esac
-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
-
-	    output_verbose_link_cmd='func_echo_all'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	    ;;
-          gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-	    # The C++ compiler must be used to create the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	        # platform.
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-	      fi
-
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-	      case $host_os in
-		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-		*)
-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-		  ;;
-	      esac
-	    fi
-	    ;;
-        esac
-        ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      case $cc_basename in
-        CC*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-      esac
-      ;;
-
-      sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
-	# link with -lc, and that would cause any symbols used from libc to
-	# always be unresolved, which means just about no library would
-	# ever link correctly.  If we're not using GNU ld we use -z text
-	# though, which does catch some bad symbols but isn't as heavy-handed
-	# as -z defs.
-	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-	_LT_TAGVAR(link_all_deplibs, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-	runpath_var='LD_RUN_PATH'
-
-	case $cc_basename in
-          CC*)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
-	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-	      '"$_LT_TAGVAR(reload_cmds, $1)"
-	    ;;
-	  *)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    ;;
-	esac
-      ;;
-
-      tandem*)
-        case $cc_basename in
-          NCC*)
-	    # NonStop-UX NCC 3.20
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      vxworks*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      *)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-    esac
-
-    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-    _LT_TAGVAR(GCC, $1)="$GXX"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_FUNC_STRIPNAME_CNF
-# ----------------------
-# func_stripname_cnf prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-#
-# This function is identical to the (non-XSI) version of func_stripname,
-# except this one can be used by m4 code that may be executed by configure,
-# rather than the libtool script.
-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-AC_REQUIRE([_LT_DECL_SED])
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-func_stripname_cnf ()
-{
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-  esac
-} # func_stripname_cnf
-])# _LT_FUNC_STRIPNAME_CNF
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-_LT_EOF
-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
-package foo
-func foo() {
-}
-_LT_EOF
-])
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
-	 prev=$p
-	 continue
-       fi
-
-       # Expand the sysroot to ease extracting the directories later.
-       if test -z "$prev"; then
-         case $p in
-         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
-         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
-         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
-         esac
-       fi
-       case $p in
-       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
-       esac
-       if test "$pre_test_object_deps_done" = no; then
-	 case ${prev} in
-	 -L | -R)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-	   else
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
-	 else
-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
-	 fi
-       fi
-       prev=
-       ;;
-
-    *.lto.$objext) ;; # Ignore GCC LTO objects
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-	   _LT_TAGVAR(predep_objects, $1)="$p"
-	 else
-	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
-	 fi
-       else
-	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-	   _LT_TAGVAR(postdep_objects, $1)="$p"
-	 else
-	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  _LT_TAGVAR(predep_objects,$1)=
-  _LT_TAGVAR(postdep_objects,$1)=
-  _LT_TAGVAR(postdeps,$1)=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
-    [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
-    [Dependencies to place before and after the objects being linked to
-    create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
-    [The library search path used internally by the compiler when linking
-    a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
-  _lt_disable_F77=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
-  CC=${F77-"f77"}
-  CFLAGS=$FFLAGS
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-  GCC=$G77
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
-	fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$G77"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-  CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_LANG_PUSH(Fortran)
-
-if test -z "$FC" || test "X$FC" = "Xno"; then
-  _lt_disable_FC=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
-  CC=${FC-"f95"}
-  CFLAGS=$FCFLAGS
-  compiler=$CC
-  GCC=$ac_cv_fc_compiler_gnu
-
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
-	fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-CFLAGS=$GCJFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GO_CONFIG],
-[AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
-
-# Source file extension for Go test sources.
-ac_ext=go
-
-# Object file extension for compiled Go test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GO_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-CFLAGS=
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
-  :
-  _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
-  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
-    [AC_CHECK_TOOL(GCJ, gcj,)
-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-      AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_GO
-# ----------
-AC_DEFUN([LT_PROG_GO],
-[AC_CHECK_TOOL(GOC, gccgo,)
-])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-# _LT_DECL_DLLTOOL
-# ----------------
-# Ensure DLLTOOL variable is set.
-m4_defun([_LT_DECL_DLLTOOL],
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-AC_SUBST([DLLTOOL])
-])
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
-    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
-  fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary parameter first.
-    func_stripname_result=${3}
-    func_stripname_result=${func_stripname_result#"${1}"}
-    func_stripname_result=${func_stripname_result%"${2}"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
-
-  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
-
-  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
-    func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
-    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
-# _LT_PATH_CONVERSION_FUNCTIONS
-# -----------------------------
-# Determine which file name conversion functions should be used by
-# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
-# for certain cross-compile configurations and native mingw.
-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_MSG_CHECKING([how to convert $build file names to $host format])
-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-[case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-        ;;
-    esac
-    ;;
-  *-*-cygwin* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_noop
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-        ;;
-    esac
-    ;;
-  * ) # unhandled hosts (and "normal" native builds)
-    lt_cv_to_host_file_cmd=func_convert_file_noop
-    ;;
-esac
-])
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
-         [0], [convert $build file names to $host format])dnl
-
-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-[#assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-        ;;
-    esac
-    ;;
-esac
-])
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
-         [0], [convert $build files to toolchain format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/deps/SDL2/acinclude/ltoptions.m4 b/deps/SDL2/acinclude/ltoptions.m4
deleted file mode 100644
index 5d9acd8..0000000
--- a/deps/SDL2/acinclude/ltoptions.m4
+++ /dev/null
@@ -1,384 +0,0 @@
-# Helper functions for option handling.                    -*- Autoconf -*-
-#
-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-#   Inc.
-#   Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 7 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
-        _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
-		      [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME.  If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-    [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
-  dnl
-  dnl Simply set some default values (i.e off) if boolean options were not
-  dnl specified:
-  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
-  ])
-  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
-  ])
-  dnl
-  dnl If no reference was made to various pairs of opposing options, then
-  dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
-  dnl archives by default:
-  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
-  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-  		   [_LT_ENABLE_FAST_INSTALL])
-  ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS],      [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
-    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
-    _LT_DECL([build_libtool_libs], [enable_shared], [0],
-	[Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
-    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
-    _LT_DECL([build_old_libs], [enable_static], [0],
-	[Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
-    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
-	 [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
-	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [lt_p=${PACKAGE-default}
-    case $withval in
-    yes|no) pic_mode=$withval ;;
-    *)
-      pic_mode=default
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
-	if test "X$lt_pkg" = "X$lt_p"; then
-	  pic_mode=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-## ----------------- ##
-## LTDL_INIT Options ##
-## ----------------- ##
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
-		 [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
-		 [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
-		 [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
-		 [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
-		 [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/deps/SDL2/acinclude/ltsugar.m4 b/deps/SDL2/acinclude/ltsugar.m4
deleted file mode 100644
index 9000a05..0000000
--- a/deps/SDL2/acinclude/ltsugar.m4
+++ /dev/null
@@ -1,123 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
-       [$#], [2], [[$2]],
-       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
-       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
-       [$#], 1, [],
-       [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
-	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
-       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
-	     [m4_foreach([_Lt_suffix],
-		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
-	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
-	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
-		 [lt_append([$1], [$2], [$3])$4],
-		 [$5])],
-	  [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
-	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
-    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
-	[$5],
-    [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
-  [lt_join(m4_quote(m4_default([$4], [[, ]])),
-           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
-		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
diff --git a/deps/SDL2/acinclude/ltversion.m4 b/deps/SDL2/acinclude/ltversion.m4
deleted file mode 100644
index 07a8602..0000000
--- a/deps/SDL2/acinclude/ltversion.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers			-*- Autoconf -*-
-#
-#   Copyright (C) 2004 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# @configure_input@
-
-# serial 3337 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
diff --git a/deps/SDL2/acinclude/lt~obsolete.m4 b/deps/SDL2/acinclude/lt~obsolete.m4
deleted file mode 100644
index c573da9..0000000
--- a/deps/SDL2/acinclude/lt~obsolete.m4
+++ /dev/null
@@ -1,98 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
-#
-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else.  This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
diff --git a/deps/SDL2/android-project/AndroidManifest.xml b/deps/SDL2/android-project/AndroidManifest.xml
deleted file mode 100644
index 27db418..0000000
--- a/deps/SDL2/android-project/AndroidManifest.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Replace org.libsdl.app with the identifier of your game below, e.g.
-     com.gamemaker.game
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="org.libsdl.app"
-      android:versionCode="1"
-      android:versionName="1.0"
-      android:installLocation="auto">
-
-    <!-- Create a Java class extending SDLActivity and place it in a
-         directory under src matching the package, e.g.
-         	src/com/gamemaker/game/MyGame.java
-
-         then replace "SDLActivity" with the name of your class (e.g. "MyGame")
-         in the XML below.
-
-         An example Java class can be found in README-android.txt
-    -->
-    <application android:label="@string/app_name"
-                 android:icon="@drawable/ic_launcher"
-                 android:allowBackup="true"
-                 android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
-        <activity android:name="SDLActivity"
-                  android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-    <!-- Android 2.3.3 -->
-    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" />
-
-    <!-- OpenGL ES 2.0 -->
-    <uses-feature android:glEsVersion="0x00020000" /> 
-
-    <!-- Allow writing to external storage -->
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
-</manifest> 
diff --git a/deps/SDL2/android-project/ant.properties b/deps/SDL2/android-project/ant.properties
deleted file mode 100644
index b0971e8..0000000
--- a/deps/SDL2/android-project/ant.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-#  'source.dir' for the location of your java source folder and
-#  'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-#  'key.store' for the location of your keystore and
-#  'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/deps/SDL2/android-project/build.properties b/deps/SDL2/android-project/build.properties
deleted file mode 100644
index edc7f23..0000000
--- a/deps/SDL2/android-project/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-# 
-# This file must be checked in Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-#  'source.dir' for the location of your java source folder and
-#  'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-#  'key.store' for the location of your keystore and
-#  'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/deps/SDL2/android-project/build.xml b/deps/SDL2/android-project/build.xml
deleted file mode 100644
index 9f19a07..0000000
--- a/deps/SDL2/android-project/build.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This should be changed to the name of your project -->
-<project name="SDLActivity" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- if sdk.dir was not set from one of the property file, then
-         get it from the ANDROID_HOME env var.
-         This must be done before we load project.properties since
-         the proguard config can use sdk.dir -->
-    <property environment="env" />
-    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
-        <isset property="env.ANDROID_HOME" />
-    </condition>
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail
-            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
-            unless="sdk.dir"
-    />
-
-    <!--
-        Import per project custom build rules if present at the root of the project.
-        This is the place to put custom intermediary targets such as:
-            -pre-build
-            -pre-compile
-            -post-compile (This is typically used for code obfuscation.
-                           Compiled code location: ${out.classes.absolute.dir}
-                           If this is not done in place, override ${out.dex.input.absolute.dir})
-            -post-package
-            -post-build
-            -pre-clean
-    -->
-    <import file="custom_rules.xml" optional="true" />
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/deps/SDL2/android-project/default.properties b/deps/SDL2/android-project/default.properties
deleted file mode 100644
index 9d135cb..0000000
--- a/deps/SDL2/android-project/default.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-# 
-# This file must be checked in Version Control Systems.
-# 
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-7
diff --git a/deps/SDL2/android-project/jni/Android.mk b/deps/SDL2/android-project/jni/Android.mk
deleted file mode 100644
index 5053e7d..0000000
--- a/deps/SDL2/android-project/jni/Android.mk
+++ /dev/null
@@ -1 +0,0 @@
-include $(call all-subdir-makefiles)
diff --git a/deps/SDL2/android-project/jni/Application.mk b/deps/SDL2/android-project/jni/Application.mk
deleted file mode 100644
index 05cf0c3..0000000
--- a/deps/SDL2/android-project/jni/Application.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-
-# Uncomment this if you're using STL in your project
-# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
-# APP_STL := stlport_static 
diff --git a/deps/SDL2/android-project/jni/src/Android.mk b/deps/SDL2/android-project/jni/src/Android.mk
deleted file mode 100644
index 70ca7dc..0000000
--- a/deps/SDL2/android-project/jni/src/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := main
-
-SDL_PATH := ../SDL
-
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include
-
-# Add your application source files here...
-LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
-	YourSourceHere.c
-
-LOCAL_SHARED_LIBRARIES := SDL2
-
-LOCAL_LDLIBS := -lGLESv1_CM -llog
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/deps/SDL2/android-project/jni/src/Android_static.mk b/deps/SDL2/android-project/jni/src/Android_static.mk
deleted file mode 100644
index faed669..0000000
--- a/deps/SDL2/android-project/jni/src/Android_static.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := main
-
-LOCAL_SRC_FILES := YourSourceHere.c
-
-LOCAL_STATIC_LIBRARIES := SDL2_static
-
-include $(BUILD_SHARED_LIBRARY)
-$(call import-module,SDL)LOCAL_PATH := $(call my-dir)
diff --git a/deps/SDL2/android-project/proguard-project.txt b/deps/SDL2/android-project/proguard-project.txt
deleted file mode 100644
index f2fe155..0000000
--- a/deps/SDL2/android-project/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
diff --git a/deps/SDL2/android-project/project.properties b/deps/SDL2/android-project/project.properties
deleted file mode 100644
index b7c2081..0000000
--- a/deps/SDL2/android-project/project.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-10
diff --git a/deps/SDL2/android-project/res/drawable-hdpi/ic_launcher.png b/deps/SDL2/android-project/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index d50bdaa..0000000
Binary files a/deps/SDL2/android-project/res/drawable-hdpi/ic_launcher.png and /dev/null differ
diff --git a/deps/SDL2/android-project/res/drawable-mdpi/ic_launcher.png b/deps/SDL2/android-project/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index 0a299eb..0000000
Binary files a/deps/SDL2/android-project/res/drawable-mdpi/ic_launcher.png and /dev/null differ
diff --git a/deps/SDL2/android-project/res/drawable-xhdpi/ic_launcher.png b/deps/SDL2/android-project/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100644
index a336ad5..0000000
Binary files a/deps/SDL2/android-project/res/drawable-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/deps/SDL2/android-project/res/drawable-xxhdpi/ic_launcher.png b/deps/SDL2/android-project/res/drawable-xxhdpi/ic_launcher.png
deleted file mode 100644
index d423dac..0000000
Binary files a/deps/SDL2/android-project/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/deps/SDL2/android-project/res/layout/main.xml b/deps/SDL2/android-project/res/layout/main.xml
deleted file mode 100644
index 123c4b6..0000000
--- a/deps/SDL2/android-project/res/layout/main.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<TextView  
-    android:layout_width="fill_parent" 
-    android:layout_height="wrap_content" 
-    android:text="Hello World, SDLActivity"
-    />
-</LinearLayout>
-
diff --git a/deps/SDL2/android-project/res/values/strings.xml b/deps/SDL2/android-project/res/values/strings.xml
deleted file mode 100644
index 9bce51c..0000000
--- a/deps/SDL2/android-project/res/values/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="app_name">SDL App</string>
-</resources>
diff --git a/deps/SDL2/android-project/src/org/libsdl/app/SDLActivity.java b/deps/SDL2/android-project/src/org/libsdl/app/SDLActivity.java
deleted file mode 100644
index 49b014c..0000000
--- a/deps/SDL2/android-project/src/org/libsdl/app/SDLActivity.java
+++ /dev/null
@@ -1,771 +0,0 @@
-package org.libsdl.app;
-
-import java.util.Arrays;
-
-import android.app.*;
-import android.content.*;
-import android.view.*;
-import android.view.inputmethod.BaseInputConnection;
-import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputConnection;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.AbsoluteLayout;
-import android.os.*;
-import android.util.Log;
-import android.graphics.*;
-import android.media.*;
-import android.hardware.*;
-
-
-/**
-    SDL Activity
-*/
-public class SDLActivity extends Activity {
-    private static final String TAG = "SDL";
-
-    // Keep track of the paused state
-    public static boolean mIsPaused = false, mIsSurfaceReady = false, mHasFocus = true;
-
-    // Main components
-    protected static SDLActivity mSingleton;
-    protected static SDLSurface mSurface;
-    protected static View mTextEdit;
-    protected static ViewGroup mLayout;
-
-    // This is what SDL runs in. It invokes SDL_main(), eventually
-    protected static Thread mSDLThread;
-
-    // Audio
-    protected static Thread mAudioThread;
-    protected static AudioTrack mAudioTrack;
-
-    // Load the .so
-    static {
-        System.loadLibrary("SDL2");
-        //System.loadLibrary("SDL2_image");
-        //System.loadLibrary("SDL2_mixer");
-        //System.loadLibrary("SDL2_net");
-        //System.loadLibrary("SDL2_ttf");
-        System.loadLibrary("main");
-    }
-
-    // Setup
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        //Log.v("SDL", "onCreate()");
-        super.onCreate(savedInstanceState);
-        
-        // So we can call stuff from static callbacks
-        mSingleton = this;
-
-        // Set up the surface
-        mSurface = new SDLSurface(getApplication());
-
-        mLayout = new AbsoluteLayout(this);
-        mLayout.addView(mSurface);
-
-        setContentView(mLayout);
-    }
-
-    // Events
-    @Override
-    protected void onPause() {
-        Log.v("SDL", "onPause()");
-        super.onPause();
-        SDLActivity.handlePause();
-    }
-
-    @Override
-    protected void onResume() {
-        Log.v("SDL", "onResume()");
-        super.onResume();
-        SDLActivity.handleResume();
-    }
-
-
-    @Override
-    public void onWindowFocusChanged(boolean hasFocus) {
-        super.onWindowFocusChanged(hasFocus);
-        Log.v("SDL", "onWindowFocusChanged(): " + hasFocus);
-
-        SDLActivity.mHasFocus = hasFocus;
-        if (hasFocus) {
-            SDLActivity.handleResume();
-        }
-    }
-
-    @Override
-    public void onLowMemory() {
-        Log.v("SDL", "onLowMemory()");
-        super.onLowMemory();
-        SDLActivity.nativeLowMemory();
-    }
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-        Log.v("SDL", "onDestroy()");
-        // Send a quit message to the application
-        SDLActivity.nativeQuit();
-
-        // Now wait for the SDL thread to quit
-        if (mSDLThread != null) {
-            try {
-                mSDLThread.join();
-            } catch(Exception e) {
-                Log.v("SDL", "Problem stopping thread: " + e);
-            }
-            mSDLThread = null;
-
-            //Log.v("SDL", "Finished waiting for SDL thread");
-        }
-    }
-
-    @Override
-    public boolean dispatchKeyEvent(KeyEvent event) {
-        int keyCode = event.getKeyCode();
-        // Ignore certain special keys so they're handled by Android
-        if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||
-            keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
-            keyCode == KeyEvent.KEYCODE_CAMERA ||
-            keyCode == 168 || /* API 11: KeyEvent.KEYCODE_ZOOM_IN */
-            keyCode == 169 /* API 11: KeyEvent.KEYCODE_ZOOM_OUT */
-            ) {
-            return false;
-        }
-        return super.dispatchKeyEvent(event);
-    }
-
-    /** Called by onPause or surfaceDestroyed. Even if surfaceDestroyed
-     *  is the first to be called, mIsSurfaceReady should still be set
-     *  to 'true' during the call to onPause (in a usual scenario).
-     */
-    public static void handlePause() {
-        if (!SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady) {
-            SDLActivity.mIsPaused = true;
-            SDLActivity.nativePause();
-            mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, false);
-        }
-    }
-
-    /** Called by onResume or surfaceCreated. An actual resume should be done only when the surface is ready.
-     * Note: Some Android variants may send multiple surfaceChanged events, so we don't need to resume
-     * every time we get one of those events, only if it comes after surfaceDestroyed
-     */
-    public static void handleResume() {
-        if (SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady && SDLActivity.mHasFocus) {
-            SDLActivity.mIsPaused = false;
-            SDLActivity.nativeResume();
-            mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
-        }
-    }
-
-
-    // Messages from the SDLMain thread
-    static final int COMMAND_CHANGE_TITLE = 1;
-    static final int COMMAND_UNUSED = 2;
-    static final int COMMAND_TEXTEDIT_HIDE = 3;
-
-    protected static final int COMMAND_USER = 0x8000;
-
-    /**
-     * This method is called by SDL if SDL did not handle a message itself.
-     * This happens if a received message contains an unsupported command.
-     * Method can be overwritten to handle Messages in a different class.
-     * @param command the command of the message.
-     * @param param the parameter of the message. May be null.
-     * @return if the message was handled in overridden method.
-     */
-    protected boolean onUnhandledMessage(int command, Object param) {
-        return false;
-    }
-
-    /**
-     * A Handler class for Messages from native SDL applications.
-     * It uses current Activities as target (e.g. for the title).
-     * static to prevent implicit references to enclosing object.
-     */
-    protected static class SDLCommandHandler extends Handler {
-        @Override
-        public void handleMessage(Message msg) {
-            Context context = getContext();
-            if (context == null) {
-                Log.e(TAG, "error handling message, getContext() returned null");
-                return;
-            }
-            switch (msg.arg1) {
-            case COMMAND_CHANGE_TITLE:
-                if (context instanceof Activity) {
-                    ((Activity) context).setTitle((String)msg.obj);
-                } else {
-                    Log.e(TAG, "error handling message, getContext() returned no Activity");
-                }
-                break;
-            case COMMAND_TEXTEDIT_HIDE:
-                if (mTextEdit != null) {
-                    mTextEdit.setVisibility(View.GONE);
-
-                    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
-                    imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);
-                }
-                break;
-
-            default:
-                if ((context instanceof SDLActivity) && !((SDLActivity) context).onUnhandledMessage(msg.arg1, msg.obj)) {
-                    Log.e(TAG, "error handling message, command is " + msg.arg1);
-                }
-            }
-        }
-    }
-
-    // Handler for the messages
-    Handler commandHandler = new SDLCommandHandler();
-
-    // Send a message from the SDLMain thread
-    boolean sendCommand(int command, Object data) {
-        Message msg = commandHandler.obtainMessage();
-        msg.arg1 = command;
-        msg.obj = data;
-        return commandHandler.sendMessage(msg);
-    }
-
-    // C functions we call
-    public static native void nativeInit();
-    public static native void nativeLowMemory();
-    public static native void nativeQuit();
-    public static native void nativePause();
-    public static native void nativeResume();
-    public static native void onNativeResize(int x, int y, int format);
-    public static native void onNativeKeyDown(int keycode);
-    public static native void onNativeKeyUp(int keycode);
-    public static native void onNativeKeyboardFocusLost();
-    public static native void onNativeTouch(int touchDevId, int pointerFingerId,
-                                            int action, float x, 
-                                            float y, float p);
-    public static native void onNativeAccel(float x, float y, float z);
-    public static native void onNativeSurfaceChanged();
-    public static native void onNativeSurfaceDestroyed();
-    public static native void nativeFlipBuffers();
-
-    public static void flipBuffers() {
-        SDLActivity.nativeFlipBuffers();
-    }
-
-    public static boolean setActivityTitle(String title) {
-        // Called from SDLMain() thread and can't directly affect the view
-        return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
-    }
-
-    public static boolean sendMessage(int command, int param) {
-        return mSingleton.sendCommand(command, Integer.valueOf(param));
-    }
-
-    public static Context getContext() {
-        return mSingleton;
-    }
-
-    static class ShowTextInputTask implements Runnable {
-        /*
-         * This is used to regulate the pan&scan method to have some offset from
-         * the bottom edge of the input region and the top edge of an input
-         * method (soft keyboard)
-         */
-        static final int HEIGHT_PADDING = 15;
-
-        public int x, y, w, h;
-
-        public ShowTextInputTask(int x, int y, int w, int h) {
-            this.x = x;
-            this.y = y;
-            this.w = w;
-            this.h = h;
-        }
-
-        @Override
-        public void run() {
-            AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(
-                    w, h + HEIGHT_PADDING, x, y);
-
-            if (mTextEdit == null) {
-                mTextEdit = new DummyEdit(getContext());
-
-                mLayout.addView(mTextEdit, params);
-            } else {
-                mTextEdit.setLayoutParams(params);
-            }
-
-            mTextEdit.setVisibility(View.VISIBLE);
-            mTextEdit.requestFocus();
-
-            InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
-            imm.showSoftInput(mTextEdit, 0);
-        }
-    }
-
-    public static boolean showTextInput(int x, int y, int w, int h) {
-        // Transfer the task to the main thread as a Runnable
-        return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h));
-    }
-            
-    public static Surface getNativeSurface() {
-        return SDLActivity.mSurface.getNativeSurface();
-    }
-
-    // Audio
-    public static int audioInit(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) {
-        int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO;
-        int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
-        int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
-        
-        Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
-        
-        // Let the user pick a larger buffer if they really want -- but ye
-        // gods they probably shouldn't, the minimums are horrifyingly high
-        // latency already
-        desiredFrames = Math.max(desiredFrames, (AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize);
-        
-        if (mAudioTrack == null) {
-            mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate,
-                    channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM);
-            
-            // Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid
-            // Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java
-            // Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState()
-            
-            if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) {
-                Log.e("SDL", "Failed during initialization of Audio Track");
-                mAudioTrack = null;
-                return -1;
-            }
-            
-            mAudioTrack.play();
-        }
-       
-        Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");
-        
-        return 0;
-    }
-    
-    public static void audioWriteShortBuffer(short[] buffer) {
-        for (int i = 0; i < buffer.length; ) {
-            int result = mAudioTrack.write(buffer, i, buffer.length - i);
-            if (result > 0) {
-                i += result;
-            } else if (result == 0) {
-                try {
-                    Thread.sleep(1);
-                } catch(InterruptedException e) {
-                    // Nom nom
-                }
-            } else {
-                Log.w("SDL", "SDL audio: error return from write(short)");
-                return;
-            }
-        }
-    }
-    
-    public static void audioWriteByteBuffer(byte[] buffer) {
-        for (int i = 0; i < buffer.length; ) {
-            int result = mAudioTrack.write(buffer, i, buffer.length - i);
-            if (result > 0) {
-                i += result;
-            } else if (result == 0) {
-                try {
-                    Thread.sleep(1);
-                } catch(InterruptedException e) {
-                    // Nom nom
-                }
-            } else {
-                Log.w("SDL", "SDL audio: error return from write(byte)");
-                return;
-            }
-        }
-    }
-
-    public static void audioQuit() {
-        if (mAudioTrack != null) {
-            mAudioTrack.stop();
-            mAudioTrack = null;
-        }
-    }
-
-    // Input
-
-    /**
-     * @return an array which may be empty but is never null.
-     */
-    public static int[] inputGetInputDeviceIds(int sources) {
-        int[] ids = InputDevice.getDeviceIds();
-        int[] filtered = new int[ids.length];
-        int used = 0;
-        for (int i = 0; i < ids.length; ++i) {
-            InputDevice device = InputDevice.getDevice(ids[i]);
-            if ((device != null) && ((device.getSources() & sources) != 0)) {
-                filtered[used++] = device.getId();
-            }
-        }
-        return Arrays.copyOf(filtered, used);
-    }
-}
-
-/**
-    Simple nativeInit() runnable
-*/
-class SDLMain implements Runnable {
-    @Override
-    public void run() {
-        // Runs SDL_main()
-        SDLActivity.nativeInit();
-
-        //Log.v("SDL", "SDL thread terminated");
-    }
-}
-
-
-/**
-    SDLSurface. This is what we draw on, so we need to know when it's created
-    in order to do anything useful. 
-
-    Because of this, that's where we set up the SDL thread
-*/
-class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, 
-    View.OnKeyListener, View.OnTouchListener, SensorEventListener  {
-
-    // Sensors
-    protected static SensorManager mSensorManager;
-    protected static Display mDisplay;
-
-    // Keep track of the surface size to normalize touch events
-    protected static float mWidth, mHeight;
-
-    // Startup    
-    public SDLSurface(Context context) {
-        super(context);
-        getHolder().addCallback(this); 
-    
-        setFocusable(true);
-        setFocusableInTouchMode(true);
-        requestFocus();
-        setOnKeyListener(this); 
-        setOnTouchListener(this);   
-
-        mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
-        mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
-
-        // Some arbitrary defaults to avoid a potential division by zero
-        mWidth = 1.0f;
-        mHeight = 1.0f;
-    }
-    
-    public Surface getNativeSurface() {
-        return getHolder().getSurface();
-    }
-
-    // Called when we have a valid drawing surface
-    @Override
-    public void surfaceCreated(SurfaceHolder holder) {
-        Log.v("SDL", "surfaceCreated()");
-        holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
-    }
-
-    // Called when we lose the surface
-    @Override
-    public void surfaceDestroyed(SurfaceHolder holder) {
-        Log.v("SDL", "surfaceDestroyed()");
-        // Call this *before* setting mIsSurfaceReady to 'false'
-        SDLActivity.handlePause();
-        SDLActivity.mIsSurfaceReady = false;
-        SDLActivity.onNativeSurfaceDestroyed();
-    }
-
-    // Called when the surface is resized
-    @Override
-    public void surfaceChanged(SurfaceHolder holder,
-                               int format, int width, int height) {
-        Log.v("SDL", "surfaceChanged()");
-
-        int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
-        switch (format) {
-        case PixelFormat.A_8:
-            Log.v("SDL", "pixel format A_8");
-            break;
-        case PixelFormat.LA_88:
-            Log.v("SDL", "pixel format LA_88");
-            break;
-        case PixelFormat.L_8:
-            Log.v("SDL", "pixel format L_8");
-            break;
-        case PixelFormat.RGBA_4444:
-            Log.v("SDL", "pixel format RGBA_4444");
-            sdlFormat = 0x15421002; // SDL_PIXELFORMAT_RGBA4444
-            break;
-        case PixelFormat.RGBA_5551:
-            Log.v("SDL", "pixel format RGBA_5551");
-            sdlFormat = 0x15441002; // SDL_PIXELFORMAT_RGBA5551
-            break;
-        case PixelFormat.RGBA_8888:
-            Log.v("SDL", "pixel format RGBA_8888");
-            sdlFormat = 0x16462004; // SDL_PIXELFORMAT_RGBA8888
-            break;
-        case PixelFormat.RGBX_8888:
-            Log.v("SDL", "pixel format RGBX_8888");
-            sdlFormat = 0x16261804; // SDL_PIXELFORMAT_RGBX8888
-            break;
-        case PixelFormat.RGB_332:
-            Log.v("SDL", "pixel format RGB_332");
-            sdlFormat = 0x14110801; // SDL_PIXELFORMAT_RGB332
-            break;
-        case PixelFormat.RGB_565:
-            Log.v("SDL", "pixel format RGB_565");
-            sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565
-            break;
-        case PixelFormat.RGB_888:
-            Log.v("SDL", "pixel format RGB_888");
-            // Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
-            sdlFormat = 0x16161804; // SDL_PIXELFORMAT_RGB888
-            break;
-        default:
-            Log.v("SDL", "pixel format unknown " + format);
-            break;
-        }
-
-        mWidth = width;
-        mHeight = height;
-        SDLActivity.onNativeResize(width, height, sdlFormat);
-        Log.v("SDL", "Window size:" + width + "x"+height);
-
-        // Set mIsSurfaceReady to 'true' *before* making a call to handleResume
-        SDLActivity.mIsSurfaceReady = true;
-        SDLActivity.onNativeSurfaceChanged();
-
-
-        if (SDLActivity.mSDLThread == null) {
-            // This is the entry point to the C app.
-            // Start up the C app thread and enable sensor input for the first time
-
-            SDLActivity.mSDLThread = new Thread(new SDLMain(), "SDLThread");
-            enableSensor(Sensor.TYPE_ACCELEROMETER, true);
-            SDLActivity.mSDLThread.start();
-        }
-    }
-
-    // unused
-    @Override
-    public void onDraw(Canvas canvas) {}
-
-
-    // Key events
-    @Override
-    public boolean onKey(View  v, int keyCode, KeyEvent event) {
-        
-        if (event.getAction() == KeyEvent.ACTION_DOWN) {
-            //Log.v("SDL", "key down: " + keyCode);
-            SDLActivity.onNativeKeyDown(keyCode);
-            return true;
-        }
-        else if (event.getAction() == KeyEvent.ACTION_UP) {
-            //Log.v("SDL", "key up: " + keyCode);
-            SDLActivity.onNativeKeyUp(keyCode);
-            return true;
-        }
-        
-        return false;
-    }
-
-    // Touch events
-    @Override
-    public boolean onTouch(View v, MotionEvent event) {
-             final int touchDevId = event.getDeviceId();
-             final int pointerCount = event.getPointerCount();
-             // touchId, pointerId, action, x, y, pressure
-             int actionPointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT; /* API 8: event.getActionIndex(); */
-             int pointerFingerId = event.getPointerId(actionPointerIndex);
-             int action = (event.getAction() & MotionEvent.ACTION_MASK); /* API 8: event.getActionMasked(); */
-
-             float x = event.getX(actionPointerIndex) / mWidth;
-             float y = event.getY(actionPointerIndex) / mHeight;
-             float p = event.getPressure(actionPointerIndex);
-
-             if (action == MotionEvent.ACTION_MOVE && pointerCount > 1) {
-                // TODO send motion to every pointer if its position has
-                // changed since prev event.
-                for (int i = 0; i < pointerCount; i++) {
-                    pointerFingerId = event.getPointerId(i);
-                    x = event.getX(i) / mWidth;
-                    y = event.getY(i) / mHeight;
-                    p = event.getPressure(i);
-                    SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
-                }
-             } else {
-                SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
-             }
-      return true;
-   } 
-
-    // Sensor events
-    public void enableSensor(int sensortype, boolean enabled) {
-        // TODO: This uses getDefaultSensor - what if we have >1 accels?
-        if (enabled) {
-            mSensorManager.registerListener(this, 
-                            mSensorManager.getDefaultSensor(sensortype), 
-                            SensorManager.SENSOR_DELAY_GAME, null);
-        } else {
-            mSensorManager.unregisterListener(this, 
-                            mSensorManager.getDefaultSensor(sensortype));
-        }
-    }
-    
-    @Override
-    public void onAccuracyChanged(Sensor sensor, int accuracy) {
-        // TODO
-    }
-
-    @Override
-    public void onSensorChanged(SensorEvent event) {
-        if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
-            float x, y;
-            switch (mDisplay.getRotation()) {
-                case Surface.ROTATION_90:
-                    x = -event.values[1];
-                    y = event.values[0];
-                    break;
-                case Surface.ROTATION_270:
-                    x = event.values[1];
-                    y = -event.values[0];
-                    break;
-                case Surface.ROTATION_180:
-                    x = -event.values[1];
-                    y = -event.values[0];
-                    break;
-                default:
-                    x = event.values[0];
-                    y = event.values[1];
-                    break;
-            }
-            SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,
-                                      y / SensorManager.GRAVITY_EARTH,
-                                      event.values[2] / SensorManager.GRAVITY_EARTH - 1);
-        }
-    }
-    
-}
-
-/* This is a fake invisible editor view that receives the input and defines the
- * pan&scan region
- */
-class DummyEdit extends View implements View.OnKeyListener {
-    InputConnection ic;
-
-    public DummyEdit(Context context) {
-        super(context);
-        setFocusableInTouchMode(true);
-        setFocusable(true);
-        setOnKeyListener(this);
-    }
-
-    @Override
-    public boolean onCheckIsTextEditor() {
-        return true;
-    }
-
-    @Override
-    public boolean onKey(View v, int keyCode, KeyEvent event) {
-
-        // This handles the hardware keyboard input
-        if (event.isPrintingKey()) {
-            if (event.getAction() == KeyEvent.ACTION_DOWN) {
-                ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
-            }
-            return true;
-        }
-
-        if (event.getAction() == KeyEvent.ACTION_DOWN) {
-            SDLActivity.onNativeKeyDown(keyCode);
-            return true;
-        } else if (event.getAction() == KeyEvent.ACTION_UP) {
-            SDLActivity.onNativeKeyUp(keyCode);
-            return true;
-        }
-
-        return false;
-    }
-        
-    //
-    @Override
-    public boolean onKeyPreIme (int keyCode, KeyEvent event) {
-        // As seen on StackOverflow: http://stackoverflow.com/questions/7634346/keyboard-hide-event
-        // FIXME: Discussion at http://bugzilla.libsdl.org/show_bug.cgi?id=1639
-        // FIXME: This is not a 100% effective solution to the problem of detecting if the keyboard is showing or not
-        // FIXME: A more effective solution would be to change our Layout from AbsoluteLayout to Relative or Linear
-        // FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android
-        // FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :)
-        if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
-            if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) {
-                SDLActivity.onNativeKeyboardFocusLost();
-            }
-        }
-        return super.onKeyPreIme(keyCode, event);
-    }
-
-    @Override
-    public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
-        ic = new SDLInputConnection(this, true);
-
-        outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
-                | 33554432 /* API 11: EditorInfo.IME_FLAG_NO_FULLSCREEN */;
-
-        return ic;
-    }
-}
-
-class SDLInputConnection extends BaseInputConnection {
-
-    public SDLInputConnection(View targetView, boolean fullEditor) {
-        super(targetView, fullEditor);
-
-    }
-
-    @Override
-    public boolean sendKeyEvent(KeyEvent event) {
-
-        /*
-         * This handles the keycodes from soft keyboard (and IME-translated
-         * input from hardkeyboard)
-         */
-        int keyCode = event.getKeyCode();
-        if (event.getAction() == KeyEvent.ACTION_DOWN) {
-            if (event.isPrintingKey()) {
-                commitText(String.valueOf((char) event.getUnicodeChar()), 1);
-            }
-            SDLActivity.onNativeKeyDown(keyCode);
-            return true;
-        } else if (event.getAction() == KeyEvent.ACTION_UP) {
-
-            SDLActivity.onNativeKeyUp(keyCode);
-            return true;
-        }
-        return super.sendKeyEvent(event);
-    }
-
-    @Override
-    public boolean commitText(CharSequence text, int newCursorPosition) {
-
-        nativeCommitText(text.toString(), newCursorPosition);
-
-        return super.commitText(text, newCursorPosition);
-    }
-
-    @Override
-    public boolean setComposingText(CharSequence text, int newCursorPosition) {
-
-        nativeSetComposingText(text.toString(), newCursorPosition);
-
-        return super.setComposingText(text, newCursorPosition);
-    }
-
-    public native void nativeCommitText(String text, int newCursorPosition);
-
-    public native void nativeSetComposingText(String text, int newCursorPosition);
-
-}
-
diff --git a/deps/SDL2/autogen.sh b/deps/SDL2/autogen.sh
deleted file mode 100755
index 649d7b3..0000000
--- a/deps/SDL2/autogen.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-#
-echo "Generating build information using autoconf"
-echo "This may take a while ..."
-
-# Regenerate configuration files
-cat acinclude/* >aclocal.m4
-found=false
-for autoconf in autoconf autoconf259 autoconf-2.59
-do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
-done
-if test x$found = xfalse; then
-    echo "Couldn't find autoconf, aborting"
-    exit 1
-fi
-(cd test; sh autogen.sh)
-
-# Run configure for this platform
-echo "Now you are ready to run ./configure"
diff --git a/deps/SDL2/build-scripts/androidbuild.sh b/deps/SDL2/build-scripts/androidbuild.sh
deleted file mode 100755
index b4a8323..0000000
--- a/deps/SDL2/build-scripts/androidbuild.sh
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/bin/bash
-
-SOURCES=()
-MKSOURCES=""
-CURDIR=`pwd -P`
-
-# Fetch sources
-if [[ $# -ge 2 ]]; then
-    for src in ${@:2}
-    do
-        SOURCES+=($src)
-        MKSOURCES="$MKSOURCES $(basename $src)"
-    done
-else
-    if [ -n "$1" ]; then
-        while read src
-        do
-            SOURCES+=($src)
-            MKSOURCES="$MKSOURCES $(basename $src)"
-        done
-    fi
-fi
-
-if [ -z "$1" ] || [ -z "$SOURCES" ]; then
-    echo "Usage: androidbuild.sh com.yourcompany.yourapp < sources.list"
-    echo "Usage: androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c"
-    exit 1
-fi
-
-
-
-SDLPATH="$( cd "$(dirname "$0")/.." ; pwd -P )"
-
-NDKBUILD=`which ndk-build`
-if [ -z "$NDKBUILD" ];then
-    echo "Could not find the ndk-build utility, install Android's NDK and add it to the path"
-    exit 1
-fi
-
-ANDROID=`which android`
-if [ -z "$ANDROID" ];then
-    echo "Could not find the android utility, install Android's SDK and add it to the path"
-    exit 1
-fi
-
-ANT=`which ant`
-
-if [ -z "$ANT" ];then
-    echo "Could not find the ant utility, install Android's SDK and add it to the path"
-    exit 1
-fi
-
-APP="$1"
-APPARR=(${APP//./ })
-BUILDPATH="$SDLPATH/build/$APP"
-
-# Start Building
-
-rm -rf $BUILDPATH
-mkdir -p $BUILDPATH
-
-cp -r $SDLPATH/android-project/* $BUILDPATH
-
-# Copy SDL sources
-mkdir -p $BUILDPATH/jni/SDL
-cp -r $SDLPATH/src $BUILDPATH/jni/SDL
-cp -r $SDLPATH/include $BUILDPATH/jni/SDL
-cp $SDLPATH/Android.mk $BUILDPATH/jni/SDL
-sed -i "s|YourSourceHere.c|$MKSOURCES|g" $BUILDPATH/jni/src/Android.mk
-sed -i "s|org\.libsdl\.app|$APP|g" $BUILDPATH/AndroidManifest.xml
-
-# Copy user sources
-for src in "${SOURCES[@]}"
-do
-    cp $src $BUILDPATH/jni/src
-done
-
-# Create an inherited Activity
-cd $BUILDPATH/src
-for folder in "${APPARR[@]}"
-do
-    mkdir -p $folder
-    cd $folder
-done
-
-ACTIVITY="${folder}Activity"
-sed -i "s|SDLActivity|$ACTIVITY|g" $BUILDPATH/AndroidManifest.xml
-sed -i "s|SDLActivity|$APP|g" $BUILDPATH/build.xml
-
-# Fill in a default Activity
-echo "package $APP;" >  "$ACTIVITY.java"
-echo "import org.libsdl.app.SDLActivity;" >> "$ACTIVITY.java"
-echo "public class $ACTIVITY extends SDLActivity {}" >> "$ACTIVITY.java"
-
-# Update project and build
-cd $BUILDPATH
-android update project --path $BUILDPATH
-$NDKBUILD
-$ANT debug
-
-cd $CURDIR
-
-APK="$BUILDPATH/bin/$APP-debug.apk"
-
-if [ -f "$APK" ]; then
-    echo "Your APK is ready at $APK"
-    echo "To install to your device: "
-    echo "cd  $BUILDPATH"
-    echo "ant debug install"
-    exit 0
-fi
-
-echo "There was an error building the APK"
-exit 1
\ No newline at end of file
diff --git a/deps/SDL2/build-scripts/config.guess b/deps/SDL2/build-scripts/config.guess
deleted file mode 100644
index ddb3622..0000000
--- a/deps/SDL2/build-scripts/config.guess
+++ /dev/null
@@ -1,1541 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
-
-timestamp='2012-08-14'
-
-# This file 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches at gnu.org> and include a ChangeLog
-# entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )	# Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help" >&2
-       exit 1 ;;
-    * )
-       break ;;
-  esac
-done
-
-if test $# != 0; then
-  echo "$me: too many arguments$help" >&2
-  exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-	     CC_FOR_BUILD="$c"; break ;
-	  fi ;
-	done ;
-	if test x"$CC_FOR_BUILD" = x ; then
-	  CC_FOR_BUILD=no_compiler_found ;
-	fi
-	;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi at noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
-	PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
-    *:NetBSD:*:*)
-	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
-	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
-	# switched to ELF, *-*-netbsd* would select the old
-	# object file format.  This provides both forward
-	# compatibility and a consistent mechanism for selecting the
-	# object file format.
-	#
-	# Note: NetBSD doesn't particularly care about the vendor
-	# portion of the name.  We always set it to "unknown".
-	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
-	case "${UNAME_MACHINE_ARCH}" in
-	    armeb) machine=armeb-unknown ;;
-	    arm*) machine=arm-unknown ;;
-	    sh3el) machine=shl-unknown ;;
-	    sh3eb) machine=sh-unknown ;;
-	    sh5el) machine=sh5le-unknown ;;
-	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
-	esac
-	# The Operating System including object format, if it has switched
-	# to ELF recently, or will in the future.
-	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval $set_cc_for_build
-		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep -q __ELF__
-		then
-		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
-		    # Return netbsd for either.  FIX?
-		    os=netbsd
-		else
-		    os=netbsdelf
-		fi
-		;;
-	    *)
-		os=netbsd
-		;;
-	esac
-	# The OS release
-	# Debian GNU/NetBSD machines have a different userland, and
-	# thus, need a distinct triplet. However, they do not need
-	# kernel version information, so it can be replaced with a
-	# suitable tag, in the style of linux-gnu.
-	case "${UNAME_VERSION}" in
-	    Debian*)
-		release='-gnu'
-		;;
-	    *)
-		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-		;;
-	esac
-	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
-	# contains redundant information, the shorter form:
-	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
-	exit ;;
-    *:Bitrig:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
-	exit ;;
-    *:OpenBSD:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
-	exit ;;
-    *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-	exit ;;
-    *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
-	exit ;;
-    macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
-    *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
-    alpha:OSF1:*:*)
-	case $UNAME_RELEASE in
-	*4.0)
-		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-		;;
-	*5.*)
-		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
-		;;
-	esac
-	# According to Compaq, /usr/sbin/psrinfo has been available on
-	# OSF/1 and Tru64 systems produced since 1995.  I hope that
-	# covers most systems running today.  This code pipes the CPU
-	# types through head -n 1, so we only detect the type of CPU 0.
-	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-	case "$ALPHA_CPU_TYPE" in
-	    "EV4 (21064)")
-		UNAME_MACHINE="alpha" ;;
-	    "EV4.5 (21064)")
-		UNAME_MACHINE="alpha" ;;
-	    "LCA4 (21066/21068)")
-		UNAME_MACHINE="alpha" ;;
-	    "EV5 (21164)")
-		UNAME_MACHINE="alphaev5" ;;
-	    "EV5.6 (21164A)")
-		UNAME_MACHINE="alphaev56" ;;
-	    "EV5.6 (21164PC)")
-		UNAME_MACHINE="alphapca56" ;;
-	    "EV5.7 (21164PC)")
-		UNAME_MACHINE="alphapca57" ;;
-	    "EV6 (21264)")
-		UNAME_MACHINE="alphaev6" ;;
-	    "EV6.7 (21264A)")
-		UNAME_MACHINE="alphaev67" ;;
-	    "EV6.8CB (21264C)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.8AL (21264B)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.8CX (21264D)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.9A (21264/EV69A)")
-		UNAME_MACHINE="alphaev69" ;;
-	    "EV7 (21364)")
-		UNAME_MACHINE="alphaev7" ;;
-	    "EV7.9 (21364A)")
-		UNAME_MACHINE="alphaev79" ;;
-	esac
-	# A Pn.n version is a patched version.
-	# A Vn.n version is a released version.
-	# A Tn.n version is a released field test version.
-	# A Xn.n version is an unreleased experimental baselevel.
-	# 1.2 uses "1.2" for uname -r.
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
-	exitcode=$?
-	trap '' 0
-	exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# Should we change UNAME_MACHINE based on the output of uname instead
-	# of the specific Alpha model?
-	echo alpha-pc-interix
-	exit ;;
-    21064:Windows_NT:50:3)
-	echo alpha-dec-winnt3.5
-	exit ;;
-    Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-unknown-sysv4
-	exit ;;
-    *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
-	exit ;;
-    *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
-	exit ;;
-    *:OS/390:*:*)
-	echo i370-ibm-openedition
-	exit ;;
-    *:z/VM:*:*)
-	echo s390-ibm-zvmoe
-	exit ;;
-    *:OS400:*:*)
-	echo powerpc-ibm-os400
-	exit ;;
-    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
-	echo arm-unknown-riscos
-	exit ;;
-    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-	echo hppa1.1-hitachi-hiuxmpp
-	exit ;;
-    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
-	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-	if test "`(/bin/universe) 2>/dev/null`" = att ; then
-		echo pyramid-pyramid-sysv3
-	else
-		echo pyramid-pyramid-bsd
-	fi
-	exit ;;
-    NILE*:*:*:dcosx)
-	echo pyramid-pyramid-svr4
-	exit ;;
-    DRS?6000:unix:4.0:6*)
-	echo sparc-icl-nx6
-	exit ;;
-    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
-	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7; exit ;;
-	esac ;;
-    s390x:SunOS:*:*)
-	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	echo i386-pc-auroraux${UNAME_RELEASE}
-	exit ;;
-    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval $set_cc_for_build
-	SUN_ARCH="i386"
-	# If there is a compiler, see if it is configured for 64-bit objects.
-	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-	# This test works for both compilers.
-	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		SUN_ARCH="x86_64"
-	    fi
-	fi
-	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:6*:*)
-	# According to config.sub, this is the proper way to canonicalize
-	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
-	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:*:*)
-	case "`/usr/bin/arch -k`" in
-	    Series*|S4*)
-		UNAME_RELEASE=`uname -v`
-		;;
-	esac
-	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit ;;
-    sun3*:SunOS:*:*)
-	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit ;;
-    sun*:*:4.2BSD:*)
-	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
-	case "`/bin/arch`" in
-	    sun3)
-		echo m68k-sun-sunos${UNAME_RELEASE}
-		;;
-	    sun4)
-		echo sparc-sun-sunos${UNAME_RELEASE}
-		;;
-	esac
-	exit ;;
-    aushp:SunOS:*:*)
-	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit ;;
-    # The situation for MiNT is a little confusing.  The machine name
-    # can be virtually everything (everything which is not
-    # "atarist" or "atariste" at least should have a processor
-    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
-    # to the lowercase version "mint" (or "freemint").  Finally
-    # the system name "TOS" denotes a system which is actually not
-    # MiNT.  But MiNT is downward compatible to TOS, so this should
-    # be no problem.
-    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-	echo m68k-milan-mint${UNAME_RELEASE}
-	exit ;;
-    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	echo m68k-hades-mint${UNAME_RELEASE}
-	exit ;;
-    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	echo m68k-unknown-mint${UNAME_RELEASE}
-	exit ;;
-    m68k:machten:*:*)
-	echo m68k-apple-machten${UNAME_RELEASE}
-	exit ;;
-    powerpc:machten:*:*)
-	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit ;;
-    RISC*:Mach:*:*)
-	echo mips-dec-mach_bsd4.3
-	exit ;;
-    RISC*:ULTRIX:*:*)
-	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit ;;
-    VAX*:ULTRIX*:*:*)
-	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit ;;
-    2020:CLIX:*:* | 2430:CLIX:*:*)
-	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit ;;
-    mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-	int main (int argc, char *argv[]) {
-#else
-	int main (argc, argv) int argc; char *argv[]; {
-#endif
-	#if defined (host_mips) && defined (MIPSEB)
-	#if defined (SYSTYPE_SYSV)
-	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
-	#endif
-	#if defined (SYSTYPE_SVR4)
-	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
-	#endif
-	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
-	#endif
-	#endif
-	  exit (-1);
-	}
-EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c &&
-	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`$dummy $dummyarg` &&
-	    { echo "$SYSTEM_NAME"; exit; }
-	echo mips-mips-riscos${UNAME_RELEASE}
-	exit ;;
-    Motorola:PowerMAX_OS:*:*)
-	echo powerpc-motorola-powermax
-	exit ;;
-    Motorola:*:4.3:PL8-*)
-	echo powerpc-harris-powermax
-	exit ;;
-    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
-	echo powerpc-harris-powermax
-	exit ;;
-    Night_Hawk:Power_UNIX:*:*)
-	echo powerpc-harris-powerunix
-	exit ;;
-    m88k:CX/UX:7*:*)
-	echo m88k-harris-cxux7
-	exit ;;
-    m88k:*:4*:R4*)
-	echo m88k-motorola-sysv4
-	exit ;;
-    m88k:*:3*:R3*)
-	echo m88k-motorola-sysv3
-	exit ;;
-    AViiON:dgux:*:*)
-	# DG/UX returns AViiON for all architectures
-	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
-	then
-	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-	       [ ${TARGET_BINARY_INTERFACE}x = x ]
-	    then
-		echo m88k-dg-dgux${UNAME_RELEASE}
-	    else
-		echo m88k-dg-dguxbcs${UNAME_RELEASE}
-	    fi
-	else
-	    echo i586-dg-dgux${UNAME_RELEASE}
-	fi
-	exit ;;
-    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
-	echo m88k-dolphin-sysv3
-	exit ;;
-    M88*:*:R3*:*)
-	# Delta 88k system running SVR3
-	echo m88k-motorola-sysv3
-	exit ;;
-    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
-	echo m88k-tektronix-sysv3
-	exit ;;
-    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
-	echo m68k-tektronix-bsd
-	exit ;;
-    *:IRIX*:*:*)
-	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit ;;
-    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
-    i*86:AIX:*:*)
-	echo i386-ibm-aix
-	exit ;;
-    ia64:AIX:*:*)
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
-	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-	fi
-	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-	exit ;;
-    *:AIX:2:3)
-	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval $set_cc_for_build
-		sed 's/^		//' << EOF >$dummy.c
-		#include <sys/systemcfg.h>
-
-		main()
-			{
-			if (!__power_pc())
-				exit(1);
-			puts("powerpc-ibm-aix3.2.5");
-			exit(0);
-			}
-EOF
-		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
-		then
-			echo "$SYSTEM_NAME"
-		else
-			echo rs6000-ibm-aix3.2.5
-		fi
-	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
-		echo rs6000-ibm-aix3.2.4
-	else
-		echo rs6000-ibm-aix3.2
-	fi
-	exit ;;
-    *:AIX:*:[4567])
-	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
-		IBM_ARCH=rs6000
-	else
-		IBM_ARCH=powerpc
-	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
-	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-	fi
-	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit ;;
-    *:AIX:*:*)
-	echo rs6000-ibm-aix
-	exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
-	echo romp-ibm-bsd4.4
-	exit ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit ;;                             # report: romp-ibm BSD 4.3
-    *:BOSX:*:*)
-	echo rs6000-bull-bosx
-	exit ;;
-    DPX/2?00:B.O.S.:*:*)
-	echo m68k-bull-sysv3
-	exit ;;
-    9000/[34]??:4.3bsd:1.*:*)
-	echo m68k-hp-bsd
-	exit ;;
-    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
-	echo m68k-hp-bsd4.4
-	exit ;;
-    9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	case "${UNAME_MACHINE}" in
-	    9000/31? )            HP_ARCH=m68000 ;;
-	    9000/[34]?? )         HP_ARCH=m68k ;;
-	    9000/[678][0-9][0-9])
-		if [ -x /usr/bin/getconf ]; then
-		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-		    case "${sc_cpu_version}" in
-		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-		      532)                      # CPU_PA_RISC2_0
-			case "${sc_kernel_bits}" in
-			  32) HP_ARCH="hppa2.0n" ;;
-			  64) HP_ARCH="hppa2.0w" ;;
-			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-			esac ;;
-		    esac
-		fi
-		if [ "${HP_ARCH}" = "" ]; then
-		    eval $set_cc_for_build
-		    sed 's/^		//' << EOF >$dummy.c
-
-		#define _HPUX_SOURCE
-		#include <stdlib.h>
-		#include <unistd.h>
-
-		int main ()
-		{
-		#if defined(_SC_KERNEL_BITS)
-		    long bits = sysconf(_SC_KERNEL_BITS);
-		#endif
-		    long cpu  = sysconf (_SC_CPU_VERSION);
-
-		    switch (cpu)
-			{
-			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-			case CPU_PA_RISC2_0:
-		#if defined(_SC_KERNEL_BITS)
-			    switch (bits)
-				{
-				case 64: puts ("hppa2.0w"); break;
-				case 32: puts ("hppa2.0n"); break;
-				default: puts ("hppa2.0"); break;
-				} break;
-		#else  /* !defined(_SC_KERNEL_BITS) */
-			    puts ("hppa2.0"); break;
-		#endif
-			default: puts ("hppa1.0"); break;
-			}
-		    exit (0);
-		}
-EOF
-		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
-		    test -z "$HP_ARCH" && HP_ARCH=hppa
-		fi ;;
-	esac
-	if [ ${HP_ARCH} = "hppa2.0w" ]
-	then
-	    eval $set_cc_for_build
-
-	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
-	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
-	    # generating 64-bit code.  GNU and HP use different nomenclature:
-	    #
-	    # $ CC_FOR_BUILD=cc ./config.guess
-	    # => hppa2.0w-hp-hpux11.23
-	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
-	    # => hppa64-hp-hpux11.23
-
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-		grep -q __LP64__
-	    then
-		HP_ARCH="hppa2.0w"
-	    else
-		HP_ARCH="hppa64"
-	    fi
-	fi
-	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit ;;
-    ia64:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	echo ia64-hp-hpux${HPUX_REV}
-	exit ;;
-    3050*:HI-UX:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <unistd.h>
-	int
-	main ()
-	{
-	  long cpu = sysconf (_SC_CPU_VERSION);
-	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
-	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
-	     results, however.  */
-	  if (CPU_IS_PA_RISC (cpu))
-	    {
-	      switch (cpu)
-		{
-		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
-		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
-		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
-		  default: puts ("hppa-hitachi-hiuxwe2"); break;
-		}
-	    }
-	  else if (CPU_IS_HP_MC68K (cpu))
-	    puts ("m68k-hitachi-hiuxwe2");
-	  else puts ("unknown-hitachi-hiuxwe2");
-	  exit (0);
-	}
-EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
-		{ echo "$SYSTEM_NAME"; exit; }
-	echo unknown-hitachi-hiuxwe2
-	exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
-	echo hppa1.1-hp-bsd
-	exit ;;
-    9000/8??:4.3bsd:*:*)
-	echo hppa1.0-hp-bsd
-	exit ;;
-    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
-	echo hppa1.0-hp-mpeix
-	exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
-	echo hppa1.1-hp-osf
-	exit ;;
-    hp8??:OSF1:*:*)
-	echo hppa1.0-hp-osf
-	exit ;;
-    i*86:OSF1:*:*)
-	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
-	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
-	fi
-	exit ;;
-    parisc*:Lites*:*:*)
-	echo hppa1.1-hp-lites
-	exit ;;
-    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
-	echo c1-convex-bsd
-	exit ;;
-    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
-	echo c34-convex-bsd
-	exit ;;
-    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
-	echo c38-convex-bsd
-	exit ;;
-    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
-	echo c4-convex-bsd
-	exit ;;
-    CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*[A-Z]90:*:*:*)
-	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
-	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-	      -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*T3E:*:*:*)
-	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*SV1:*:*:*)
-	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
-    5000:UNIX_System_V:4.*:*)
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
-    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit ;;
-    sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
-    *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
-    *:FreeBSD:*:*)
-	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	case ${UNAME_PROCESSOR} in
-	    amd64)
-		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	    *)
-		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	esac
-	exit ;;
-    i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin
-	exit ;;
-    *:MINGW64*:*)
-	echo ${UNAME_MACHINE}-pc-mingw64
-	exit ;;
-    *:MINGW*:*)
-	echo ${UNAME_MACHINE}-pc-mingw32
-	exit ;;
-    i*:MSYS*:*)
-	echo ${UNAME_MACHINE}-pc-msys
-	exit ;;
-    i*:windows32*:*)
-	# uname -m includes "-pc" on this system.
-	echo ${UNAME_MACHINE}-mingw32
-	exit ;;
-    i*:PW*:*)
-	echo ${UNAME_MACHINE}-pc-pw32
-	exit ;;
-    *:Interix*:*)
-	case ${UNAME_MACHINE} in
-	    x86)
-		echo i586-pc-interix${UNAME_RELEASE}
-		exit ;;
-	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-	echo i${UNAME_MACHINE}-pc-mks
-	exit ;;
-    8664:Windows_NT:*)
-	echo x86_64-pc-mks
-	exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-	# UNAME_MACHINE based on the output of uname instead of i386?
-	echo i586-pc-interix
-	exit ;;
-    i*:UWIN*:*)
-	echo ${UNAME_MACHINE}-pc-uwin
-	exit ;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
-	exit ;;
-    p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
-	exit ;;
-    prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    *:GNU:*:*)
-	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit ;;
-    *:GNU/*:*:*)
-	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-	exit ;;
-    i*86:Minix:*:*)
-	echo ${UNAME_MACHINE}-pc-minix
-	exit ;;
-    aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    aarch64_be:Linux:*:*)
-	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-	  EV5)   UNAME_MACHINE=alphaev5 ;;
-	  EV56)  UNAME_MACHINE=alphaev56 ;;
-	  PCA56) UNAME_MACHINE=alphapca56 ;;
-	  PCA57) UNAME_MACHINE=alphapca56 ;;
-	  EV6)   UNAME_MACHINE=alphaev6 ;;
-	  EV67)  UNAME_MACHINE=alphaev67 ;;
-	  EV68*) UNAME_MACHINE=alphaev68 ;;
-	esac
-	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-	exit ;;
-    arm*:Linux:*:*)
-	eval $set_cc_for_build
-	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
-	    | grep -q __ARM_EABI__
-	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
-	else
-        case `sed -n '/^Hardware/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-        BCM2708) MANUFACTURER=raspberry;;
-        *) MANUFACTURER=unknown;;
-        esac
-	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
-		| grep -q __ARM_PCS_VFP
-	    then
-		echo ${UNAME_MACHINE}-${MANUFACTURER}-linux-gnueabi
-	    else
-		echo ${UNAME_MACHINE}-${MANUFACTURER}-linux-gnueabihf
-	    fi
-	fi
-	exit ;;
-    avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
-	exit ;;
-    crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
-	exit ;;
-    frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-	exit ;;
-    ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    mips:Linux:*:* | mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#undef CPU
-	#undef ${UNAME_MACHINE}
-	#undef ${UNAME_MACHINE}el
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=${UNAME_MACHINE}el
-	#else
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=${UNAME_MACHINE}
-	#else
-	CPU=
-	#endif
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-	;;
-    or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
-	exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
-	exit ;;
-    parisc:Linux:*:* | hppa:Linux:*:*)
-	# Look for CPU level
-	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
-	esac
-	exit ;;
-    ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
-	exit ;;
-    ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
-	exit ;;
-    s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
-	exit ;;
-    sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
-	exit ;;
-    x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    i*86:DYNIX/ptx:4*:*)
-	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
-	# earlier versions are messed up and put the nodename in both
-	# sysname and nodename.
-	echo i386-sequent-sysv4
-	exit ;;
-    i*86:UNIX_SV:4.2MP:2.*)
-	# Unixware is an offshoot of SVR4, but it has its own version
-	# number series starting with 2...
-	# I am not positive that other SVR4 systems won't match this,
-	# I just have to hope.  -- rms.
-	# Use sysv4.2uw... so that sysv4* matches it.
-	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit ;;
-    i*86:OS/2:*:*)
-	# If we were able to find `uname', then EMX Unix compatibility
-	# is probably installed.
-	echo ${UNAME_MACHINE}-pc-os2-emx
-	exit ;;
-    i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
-	exit ;;
-    i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
-	exit ;;
-    i*86:syllable:*:*)
-	echo ${UNAME_MACHINE}-pc-syllable
-	exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    i*86:*DOS:*:*)
-	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
-	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
-	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
-	fi
-	exit ;;
-    i*86:*:5:[678]*)
-	# UnixWare 7.x, OpenUNIX and OpenServer 6.
-	case `/bin/uname -X | grep "^Machine"` in
-	    *486*)	     UNAME_MACHINE=i486 ;;
-	    *Pentium)	     UNAME_MACHINE=i586 ;;
-	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
-	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	exit ;;
-    i*86:*:3.2:*)
-	if test -f /usr/options/cb.name; then
-		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
-	elif /bin/uname -X 2>/dev/null >/dev/null ; then
-		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
-		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
-		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
-			&& UNAME_MACHINE=i586
-		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
-			&& UNAME_MACHINE=i686
-		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
-			&& UNAME_MACHINE=i686
-		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
-	else
-		echo ${UNAME_MACHINE}-pc-sysv32
-	fi
-	exit ;;
-    pc:*:*:*)
-	# Left here for compatibility:
-	# uname -m prints for DJGPP always 'pc', but it prints nothing about
-	# the processor, so we play safe by assuming i586.
-	# Note: whatever this is, it MUST be the same as what config.sub
-	# prints for the "djgpp" host, or else GDB configury will decide that
-	# this is a cross-build.
-	echo i586-pc-msdosdjgpp
-	exit ;;
-    Intel:Mach:3*:*)
-	echo i386-pc-mach3
-	exit ;;
-    paragon:*:*:*)
-	echo i860-intel-osf1
-	exit ;;
-    i860:*:4.*:*) # i860-SVR4
-	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
-	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
-	fi
-	exit ;;
-    mini*:CTIX:SYS*5:*)
-	# "miniframe"
-	echo m68010-convergent-sysv
-	exit ;;
-    mc68k:UNIX:SYSTEM5:3.51m)
-	echo m68k-convergent-sysv
-	exit ;;
-    M680?0:D-NIX:5.3:*)
-	echo m68k-diab-dnix
-	exit ;;
-    M68*:*:R3V[5678]*:*)
-	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
-	OS_REL=''
-	test -r /etc/.relid \
-	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4; exit; } ;;
-    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
-	OS_REL='.3'
-	test -r /etc/.relid \
-	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    mc68030:UNIX_System_V:4.*:*)
-	echo m68k-atari-sysv4
-	exit ;;
-    TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    SM[BE]S:UNIX_SV:*:*)
-	echo mips-dde-sysv${UNAME_RELEASE}
-	exit ;;
-    RM*:ReliantUNIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
-    RM*:SINIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
-    *:SINIX-*:*:*)
-	if uname -p 2>/dev/null >/dev/null ; then
-		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		echo ${UNAME_MACHINE}-sni-sysv4
-	else
-		echo ns32k-sni-sysv
-	fi
-	exit ;;
-    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-			# says <Richard.M.Bartel at ccMail.Census.GOV>
-	echo i586-unisys-sysv4
-	exit ;;
-    *:UNIX_System_V:4*:FTX*)
-	# From Gerald Hewes <hewes at openmarket.com>.
-	# How about differentiating between stratus architectures? -djm
-	echo hppa1.1-stratus-sysv4
-	exit ;;
-    *:*:*:FTX*)
-	# From seanf at swdc.stratus.com.
-	echo i860-stratus-sysv4
-	exit ;;
-    i*86:VOS:*:*)
-	# From Paul.Green at stratus.com.
-	echo ${UNAME_MACHINE}-stratus-vos
-	exit ;;
-    *:VOS:*:*)
-	# From Paul.Green at stratus.com.
-	echo hppa1.1-stratus-vos
-	exit ;;
-    mc68*:A/UX:*:*)
-	echo m68k-apple-aux${UNAME_RELEASE}
-	exit ;;
-    news*:NEWS-OS:6*:*)
-	echo mips-sony-newsos6
-	exit ;;
-    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-	if [ -d /usr/nec ]; then
-		echo mips-nec-sysv${UNAME_RELEASE}
-	else
-		echo mips-unknown-sysv${UNAME_RELEASE}
-	fi
-	exit ;;
-    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
-	echo powerpc-be-beos
-	exit ;;
-    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
-	echo powerpc-apple-beos
-	exit ;;
-    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
-	echo i586-pc-beos
-	exit ;;
-    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
-	echo i586-pc-haiku
-	exit ;;
-    x86_64:Haiku:*:*)
-	echo x86_64-unknown-haiku
-	exit ;;
-    SX-4:SUPER-UX:*:*)
-	echo sx4-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-5:SUPER-UX:*:*)
-	echo sx5-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-6:SUPER-UX:*:*)
-	echo sx6-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux${UNAME_RELEASE}
-	exit ;;
-    Power*:Rhapsody:*:*)
-	echo powerpc-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
-    *:Rhapsody:*:*)
-	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
-    *:Darwin:*:*)
-	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
-	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-	exit ;;
-    *:procnto*:*:* | *:QNX:[0123456789]*:*)
-	UNAME_PROCESSOR=`uname -p`
-	if test "$UNAME_PROCESSOR" = "x86"; then
-		UNAME_PROCESSOR=i386
-		UNAME_MACHINE=pc
-	fi
-	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-	exit ;;
-    *:QNX:*:4*)
-	echo i386-pc-qnx
-	exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
-	echo neo-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    NSE-*:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-	echo nsr-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    *:NonStop-UX:*:*)
-	echo mips-compaq-nonstopux
-	exit ;;
-    BS2000:POSIX*:*:*)
-	echo bs2000-siemens-sysv
-	exit ;;
-    DS/*:UNIX_System_V:*:*)
-	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-	exit ;;
-    *:Plan9:*:*)
-	# "uname -m" is not consistent, so use $cputype instead. 386
-	# is converted to i386 for consistency with other x86
-	# operating systems.
-	if test "$cputype" = "386"; then
-	    UNAME_MACHINE=i386
-	else
-	    UNAME_MACHINE="$cputype"
-	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
-	exit ;;
-    *:TOPS-10:*:*)
-	echo pdp10-unknown-tops10
-	exit ;;
-    *:TENEX:*:*)
-	echo pdp10-unknown-tenex
-	exit ;;
-    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-	echo pdp10-dec-tops20
-	exit ;;
-    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-	echo pdp10-xkl-tops20
-	exit ;;
-    *:TOPS-20:*:*)
-	echo pdp10-unknown-tops20
-	exit ;;
-    *:ITS:*:*)
-	echo pdp10-unknown-its
-	exit ;;
-    SEI:*:*:SEIUX)
-	echo mips-sei-seiux${UNAME_RELEASE}
-	exit ;;
-    *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit ;;
-    *:*VMS:*:*)
-	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "${UNAME_MACHINE}" in
-	    A*) echo alpha-dec-vms ; exit ;;
-	    I*) echo ia64-dec-vms ; exit ;;
-	    V*) echo vax-dec-vms ; exit ;;
-	esac ;;
-    *:XENIX:*:SysV)
-	echo i386-pc-xenix
-	exit ;;
-    i*86:skyos:*:*)
-	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
-	exit ;;
-    i*86:rdos:*:*)
-	echo ${UNAME_MACHINE}-pc-rdos
-	exit ;;
-    i*86:AROS:*:*)
-	echo ${UNAME_MACHINE}-pc-aros
-	exit ;;
-    x86_64:VMkernel:*:*)
-	echo ${UNAME_MACHINE}-unknown-esx
-	exit ;;
-esac
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches at gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo               = `(hostinfo) 2>/dev/null`
-/bin/universe          = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch              = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/deps/SDL2/build-scripts/config.sub b/deps/SDL2/build-scripts/config.sub
deleted file mode 100644
index bdda9e4..0000000
--- a/deps/SDL2/build-scripts/config.sub
+++ /dev/null
@@ -1,1786 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
-
-timestamp='2012-08-18'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support.  The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
-       $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )	# Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help"
-       exit 1 ;;
-
-    *local*)
-       # First pass through any local machine types.
-       echo $1
-       exit ;;
-
-    * )
-       break ;;
-  esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
-    exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
-    exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
-  kopensolaris*-gnu* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-	-sun*os*)
-		# Prevent following clause from handling this invalid input.
-		;;
-	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze)
-		os=
-		basic_machine=$1
-		;;
-	-bluegene*)
-		os=-cnk
-		;;
-	-sim | -cisco | -oki | -wec | -winbond)
-		os=
-		basic_machine=$1
-		;;
-	-scout)
-		;;
-	-wrs)
-		os=-vxworks
-		basic_machine=$1
-		;;
-	-chorusos*)
-		os=-chorusos
-		basic_machine=$1
-		;;
-	-chorusrdb)
-		os=-chorusrdb
-		basic_machine=$1
-		;;
-	-hiux*)
-		os=-hiuxwe2
-		;;
-	-sco6)
-		os=-sco5v6
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5)
-		os=-sco3.2v5
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco4)
-		os=-sco3.2v4
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2.[4-9]*)
-		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2v[4-9]*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco*)
-		os=-sco3.2v2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-udk*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-isc)
-		os=-isc2.2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-clix*)
-		basic_machine=clipper-intergraph
-		;;
-	-isc*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-lynx*178)
-		os=-lynxos178
-		;;
-	-lynx*5)
-		os=-lynxos5
-		;;
-	-lynx*)
-		os=-lynxos
-		;;
-	-ptx*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
-		;;
-	-windowsnt*)
-		os=`echo $os | sed -e 's/windowsnt/winnt/'`
-		;;
-	-psos*)
-		os=-psos
-		;;
-	-mint | -mint[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
-	# Recognize the basic CPU types without company name.
-	# Some are omitted here because they have special meanings below.
-	1750a | 580 \
-	| a29k \
-	| aarch64 | aarch64_be \
-	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
-	| bfin \
-	| c4x | clipper \
-	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
-	| fido | fr30 | frv \
-	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-	| hexagon \
-	| i370 | i860 | i960 | ia64 \
-	| ip2k | iq2000 \
-	| le32 | le64 \
-	| lm32 \
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
-	| mips | mipsbe | mipseb | mipsel | mipsle \
-	| mips16 \
-	| mips64 | mips64el \
-	| mips64octeon | mips64octeonel \
-	| mips64orion | mips64orionel \
-	| mips64r5900 | mips64r5900el \
-	| mips64vr | mips64vrel \
-	| mips64vr4100 | mips64vr4100el \
-	| mips64vr4300 | mips64vr4300el \
-	| mips64vr5000 | mips64vr5000el \
-	| mips64vr5900 | mips64vr5900el \
-	| mipsisa32 | mipsisa32el \
-	| mipsisa32r2 | mipsisa32r2el \
-	| mipsisa64 | mipsisa64el \
-	| mipsisa64r2 | mipsisa64r2el \
-	| mipsisa64sb1 | mipsisa64sb1el \
-	| mipsisa64sr71k | mipsisa64sr71kel \
-	| mipstx39 | mipstx39el \
-	| mn10200 | mn10300 \
-	| moxie \
-	| mt \
-	| msp430 \
-	| nds32 | nds32le | nds32be \
-	| nios | nios2 \
-	| ns16k | ns32k \
-	| open8 \
-	| or32 \
-	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle \
-	| pyramid \
-	| rl78 | rx \
-	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu \
-	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-	| ubicom32 \
-	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-	| we32k \
-	| x86 | xc16x | xstormy16 | xtensa \
-	| z8k | z80)
-		basic_machine=$basic_machine-unknown
-		;;
-	c54x)
-		basic_machine=tic54x-unknown
-		;;
-	c55x)
-		basic_machine=tic55x-unknown
-		;;
-	c6x)
-		basic_machine=tic6x-unknown
-		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
-		basic_machine=$basic_machine-unknown
-		os=-none
-		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
-		;;
-	ms1)
-		basic_machine=mt-unknown
-		;;
-
-	strongarm | thumb | xscale)
-		basic_machine=arm-unknown
-		;;
-	xgate)
-		basic_machine=$basic_machine-unknown
-		os=-none
-		;;
-	xscaleeb)
-		basic_machine=armeb-unknown
-		;;
-
-	xscaleel)
-		basic_machine=armel-unknown
-		;;
-
-	# We use `pc' rather than `unknown'
-	# because (1) that's what they normally are, and
-	# (2) the word "unknown" tends to confuse beginning users.
-	i*86 | x86_64)
-	  basic_machine=$basic_machine-pc
-	  ;;
-	# Object if more than one company name word.
-	*-*-*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-	# Recognize the basic CPU types with company name.
-	580-* \
-	| a29k-* \
-	| aarch64-* | aarch64_be-* \
-	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
-	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* | avr32-* \
-	| be32-* | be64-* \
-	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| clipper-* | craynv-* | cydra-* \
-	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-	| h8300-* | h8500-* \
-	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-	| hexagon-* \
-	| i*86-* | i860-* | i960-* | ia64-* \
-	| ip2k-* | iq2000-* \
-	| le32-* | le64-* \
-	| lm32-* \
-	| m32c-* | m32r-* | m32rle-* \
-	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
-	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-	| mips16-* \
-	| mips64-* | mips64el-* \
-	| mips64octeon-* | mips64octeonel-* \
-	| mips64orion-* | mips64orionel-* \
-	| mips64r5900-* | mips64r5900el-* \
-	| mips64vr-* | mips64vrel-* \
-	| mips64vr4100-* | mips64vr4100el-* \
-	| mips64vr4300-* | mips64vr4300el-* \
-	| mips64vr5000-* | mips64vr5000el-* \
-	| mips64vr5900-* | mips64vr5900el-* \
-	| mipsisa32-* | mipsisa32el-* \
-	| mipsisa32r2-* | mipsisa32r2el-* \
-	| mipsisa64-* | mipsisa64el-* \
-	| mipsisa64r2-* | mipsisa64r2el-* \
-	| mipsisa64sb1-* | mipsisa64sb1el-* \
-	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
-	| mipstx39-* | mipstx39el-* \
-	| mmix-* \
-	| mt-* \
-	| msp430-* \
-	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
-	| open8-* \
-	| orion-* \
-	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-	| pyramid-* \
-	| rl78-* | romp-* | rs6000-* | rx-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
-	| tahoe-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile*-* \
-	| tron-* \
-	| ubicom32-* \
-	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-	| vax-* \
-	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* \
-	| xstormy16-* | xtensa*-* \
-	| ymp-* \
-	| z8k-* | z80-*)
-		;;
-	# Recognize the basic CPU types without company name, with glob match.
-	xtensa*)
-		basic_machine=$basic_machine-unknown
-		;;
-	# Recognize the various machine names and aliases which stand
-	# for a CPU type and a company and sometimes even an OS.
-	386bsd)
-		basic_machine=i386-unknown
-		os=-bsd
-		;;
-	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-		basic_machine=m68000-att
-		;;
-	3b*)
-		basic_machine=we32k-att
-		;;
-	a29khif)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	abacus)
-		basic_machine=abacus-unknown
-		;;
-	adobe68k)
-		basic_machine=m68010-adobe
-		os=-scout
-		;;
-	alliant | fx80)
-		basic_machine=fx80-alliant
-		;;
-	altos | altos3068)
-		basic_machine=m68k-altos
-		;;
-	am29k)
-		basic_machine=a29k-none
-		os=-bsd
-		;;
-	amd64)
-		basic_machine=x86_64-pc
-		;;
-	amd64-*)
-		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	amdahl)
-		basic_machine=580-amdahl
-		os=-sysv
-		;;
-	amiga | amiga-*)
-		basic_machine=m68k-unknown
-		;;
-	amigaos | amigados)
-		basic_machine=m68k-unknown
-		os=-amigaos
-		;;
-	amigaunix | amix)
-		basic_machine=m68k-unknown
-		os=-sysv4
-		;;
-	apollo68)
-		basic_machine=m68k-apollo
-		os=-sysv
-		;;
-	apollo68bsd)
-		basic_machine=m68k-apollo
-		os=-bsd
-		;;
-	aros)
-		basic_machine=i386-pc
-		os=-aros
-		;;
-	aux)
-		basic_machine=m68k-apple
-		os=-aux
-		;;
-	balance)
-		basic_machine=ns32k-sequent
-		os=-dynix
-		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=-linux
-		;;
-	blackfin-*)
-		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	bluegene*)
-		basic_machine=powerpc-ibm
-		os=-cnk
-		;;
-	c54x-*)
-		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c55x-*)
-		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c6x-*)
-		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c90)
-		basic_machine=c90-cray
-		os=-unicos
-		;;
-	cegcc)
-		basic_machine=arm-unknown
-		os=-cegcc
-		;;
-	convex-c1)
-		basic_machine=c1-convex
-		os=-bsd
-		;;
-	convex-c2)
-		basic_machine=c2-convex
-		os=-bsd
-		;;
-	convex-c32)
-		basic_machine=c32-convex
-		os=-bsd
-		;;
-	convex-c34)
-		basic_machine=c34-convex
-		os=-bsd
-		;;
-	convex-c38)
-		basic_machine=c38-convex
-		os=-bsd
-		;;
-	cray | j90)
-		basic_machine=j90-cray
-		os=-unicos
-		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=-unicosmp
-		;;
-	cr16 | cr16-*)
-		basic_machine=cr16-unknown
-		os=-elf
-		;;
-	crds | unos)
-		basic_machine=m68k-crds
-		;;
-	crisv32 | crisv32-* | etraxfs*)
-		basic_machine=crisv32-axis
-		;;
-	cris | cris-* | etrax*)
-		basic_machine=cris-axis
-		;;
-	crx)
-		basic_machine=crx-unknown
-		os=-elf
-		;;
-	da30 | da30-*)
-		basic_machine=m68k-da30
-		;;
-	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-		basic_machine=mips-dec
-		;;
-	decsystem10* | dec10*)
-		basic_machine=pdp10-dec
-		os=-tops10
-		;;
-	decsystem20* | dec20*)
-		basic_machine=pdp10-dec
-		os=-tops20
-		;;
-	delta | 3300 | motorola-3300 | motorola-delta \
-	      | 3300-motorola | delta-motorola)
-		basic_machine=m68k-motorola
-		;;
-	delta88)
-		basic_machine=m88k-motorola
-		os=-sysv3
-		;;
-	dicos)
-		basic_machine=i686-pc
-		os=-dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=-msdosdjgpp
-		;;
-	dpx20 | dpx20-*)
-		basic_machine=rs6000-bull
-		os=-bosx
-		;;
-	dpx2* | dpx2*-bull)
-		basic_machine=m68k-bull
-		os=-sysv3
-		;;
-	ebmon29k)
-		basic_machine=a29k-amd
-		os=-ebmon
-		;;
-	elxsi)
-		basic_machine=elxsi-elxsi
-		os=-bsd
-		;;
-	encore | umax | mmax)
-		basic_machine=ns32k-encore
-		;;
-	es1800 | OSE68k | ose68k | ose | OSE)
-		basic_machine=m68k-ericsson
-		os=-ose
-		;;
-	fx2800)
-		basic_machine=i860-alliant
-		;;
-	genix)
-		basic_machine=ns32k-ns
-		;;
-	gmicro)
-		basic_machine=tron-gmicro
-		os=-sysv
-		;;
-	go32)
-		basic_machine=i386-pc
-		os=-go32
-		;;
-	h3050r* | hiux*)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	h8300hms)
-		basic_machine=h8300-hitachi
-		os=-hms
-		;;
-	h8300xray)
-		basic_machine=h8300-hitachi
-		os=-xray
-		;;
-	h8500hms)
-		basic_machine=h8500-hitachi
-		os=-hms
-		;;
-	harris)
-		basic_machine=m88k-harris
-		os=-sysv3
-		;;
-	hp300-*)
-		basic_machine=m68k-hp
-		;;
-	hp300bsd)
-		basic_machine=m68k-hp
-		os=-bsd
-		;;
-	hp300hpux)
-		basic_machine=m68k-hp
-		os=-hpux
-		;;
-	hp3k9[0-9][0-9] | hp9[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k2[0-9][0-9] | hp9k31[0-9])
-		basic_machine=m68000-hp
-		;;
-	hp9k3[2-9][0-9])
-		basic_machine=m68k-hp
-		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k78[0-9] | hp78[0-9])
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][0-9] | hp8[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hppa-next)
-		os=-nextstep3
-		;;
-	hppaosf)
-		basic_machine=hppa1.1-hp
-		os=-osf
-		;;
-	hppro)
-		basic_machine=hppa1.1-hp
-		os=-proelf
-		;;
-	i370-ibm* | ibm*)
-		basic_machine=i370-ibm
-		;;
-	i*86v32)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv32
-		;;
-	i*86v4*)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv4
-		;;
-	i*86v)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv
-		;;
-	i*86sol2)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-solaris2
-		;;
-	i386mach)
-		basic_machine=i386-mach
-		os=-mach
-		;;
-	i386-vsta | vsta)
-		basic_machine=i386-unknown
-		os=-vsta
-		;;
-	iris | iris4d)
-		basic_machine=mips-sgi
-		case $os in
-		    -irix*)
-			;;
-		    *)
-			os=-irix4
-			;;
-		esac
-		;;
-	isi68 | isi)
-		basic_machine=m68k-isi
-		os=-sysv
-		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=-linux
-		;;
-	m68knommu-*)
-		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	m88k-omron*)
-		basic_machine=m88k-omron
-		;;
-	magnum | m3230)
-		basic_machine=mips-mips
-		os=-sysv
-		;;
-	merlin)
-		basic_machine=ns32k-utek
-		os=-sysv
-		;;
-	microblaze)
-		basic_machine=microblaze-xilinx
-		;;
-	mingw64)
-		basic_machine=x86_64-pc
-		os=-mingw64
-		;;
-	mingw32)
-		basic_machine=i386-pc
-		os=-mingw32
-		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=-mingw32ce
-		;;
-	miniframe)
-		basic_machine=m68000-convergent
-		;;
-	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-	mips3*-*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-		;;
-	mips3*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-		;;
-	monitor)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	morphos)
-		basic_machine=powerpc-unknown
-		os=-morphos
-		;;
-	msdos)
-		basic_machine=i386-pc
-		os=-msdos
-		;;
-	ms1-*)
-		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-		;;
-	msys)
-		basic_machine=i386-pc
-		os=-msys
-		;;
-	mvs)
-		basic_machine=i370-ibm
-		os=-mvs
-		;;
-	nacl)
-		basic_machine=le32-unknown
-		os=-nacl
-		;;
-	ncr3000)
-		basic_machine=i486-ncr
-		os=-sysv4
-		;;
-	netbsd386)
-		basic_machine=i386-unknown
-		os=-netbsd
-		;;
-	netwinder)
-		basic_machine=armv4l-rebel
-		os=-linux
-		;;
-	news | news700 | news800 | news900)
-		basic_machine=m68k-sony
-		os=-newsos
-		;;
-	news1000)
-		basic_machine=m68030-sony
-		os=-newsos
-		;;
-	news-3600 | risc-news)
-		basic_machine=mips-sony
-		os=-newsos
-		;;
-	necv70)
-		basic_machine=v70-nec
-		os=-sysv
-		;;
-	next | m*-next )
-		basic_machine=m68k-next
-		case $os in
-		    -nextstep* )
-			;;
-		    -ns2*)
-		      os=-nextstep2
-			;;
-		    *)
-		      os=-nextstep3
-			;;
-		esac
-		;;
-	nh3000)
-		basic_machine=m68k-harris
-		os=-cxux
-		;;
-	nh[45]000)
-		basic_machine=m88k-harris
-		os=-cxux
-		;;
-	nindy960)
-		basic_machine=i960-intel
-		os=-nindy
-		;;
-	mon960)
-		basic_machine=i960-intel
-		os=-mon960
-		;;
-	nonstopux)
-		basic_machine=mips-compaq
-		os=-nonstopux
-		;;
-	np1)
-		basic_machine=np1-gould
-		;;
-	neo-tandem)
-		basic_machine=neo-tandem
-		;;
-	nse-tandem)
-		basic_machine=nse-tandem
-		;;
-	nsr-tandem)
-		basic_machine=nsr-tandem
-		;;
-	op50n-* | op60c-*)
-		basic_machine=hppa1.1-oki
-		os=-proelf
-		;;
-	openrisc | openrisc-*)
-		basic_machine=or32-unknown
-		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=-os400
-		;;
-	OSE68000 | ose68000)
-		basic_machine=m68000-ericsson
-		os=-ose
-		;;
-	os68k)
-		basic_machine=m68k-none
-		os=-os68k
-		;;
-	pa-hitachi)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	paragon)
-		basic_machine=i860-intel
-		os=-osf
-		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=-linux
-		;;
-	parisc-*)
-		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	pbd)
-		basic_machine=sparc-tti
-		;;
-	pbb)
-		basic_machine=m68k-tti
-		;;
-	pc532 | pc532-*)
-		basic_machine=ns32k-pc532
-		;;
-	pc98)
-		basic_machine=i386-pc
-		;;
-	pc98-*)
-		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium | p5 | k5 | k6 | nexgen | viac3)
-		basic_machine=i586-pc
-		;;
-	pentiumpro | p6 | 6x86 | athlon | athlon_*)
-		basic_machine=i686-pc
-		;;
-	pentiumii | pentium2 | pentiumiii | pentium3)
-		basic_machine=i686-pc
-		;;
-	pentium4)
-		basic_machine=i786-pc
-		;;
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumpro-* | p6-* | 6x86-* | athlon-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium4-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pn)
-		basic_machine=pn-gould
-		;;
-	power)	basic_machine=power-ibm
-		;;
-	ppc | ppcbe)	basic_machine=powerpc-unknown
-		;;
-	ppc-* | ppcbe-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppcle | powerpclittle | ppc-le | powerpc-little)
-		basic_machine=powerpcle-unknown
-		;;
-	ppcle-* | powerpclittle-*)
-		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64)	basic_machine=powerpc64-unknown
-		;;
-	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-		basic_machine=powerpc64le-unknown
-		;;
-	ppc64le-* | powerpc64little-*)
-		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ps2)
-		basic_machine=i386-ibm
-		;;
-	pw32)
-		basic_machine=i586-unknown
-		os=-pw32
-		;;
-	rdos)
-		basic_machine=i386-pc
-		os=-rdos
-		;;
-	rom68k)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	rm[46]00)
-		basic_machine=mips-siemens
-		;;
-	rtpc | rtpc-*)
-		basic_machine=romp-ibm
-		;;
-	s390 | s390-*)
-		basic_machine=s390-ibm
-		;;
-	s390x | s390x-*)
-		basic_machine=s390x-ibm
-		;;
-	sa29200)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	sb1)
-		basic_machine=mipsisa64sb1-unknown
-		;;
-	sb1el)
-		basic_machine=mipsisa64sb1el-unknown
-		;;
-	sde)
-		basic_machine=mipsisa32-sde
-		os=-elf
-		;;
-	sei)
-		basic_machine=mips-sei
-		os=-seiux
-		;;
-	sequent)
-		basic_machine=i386-sequent
-		;;
-	sh)
-		basic_machine=sh-hitachi
-		os=-hms
-		;;
-	sh5el)
-		basic_machine=sh5le-unknown
-		;;
-	sh64)
-		basic_machine=sh64-unknown
-		;;
-	sparclite-wrs | simso-wrs)
-		basic_machine=sparclite-wrs
-		os=-vxworks
-		;;
-	sps7)
-		basic_machine=m68k-bull
-		os=-sysv2
-		;;
-	spur)
-		basic_machine=spur-unknown
-		;;
-	st2000)
-		basic_machine=m68k-tandem
-		;;
-	stratus)
-		basic_machine=i860-stratus
-		os=-sysv4
-		;;
-	strongarm-* | thumb-*)
-		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	sun2)
-		basic_machine=m68000-sun
-		;;
-	sun2os3)
-		basic_machine=m68000-sun
-		os=-sunos3
-		;;
-	sun2os4)
-		basic_machine=m68000-sun
-		os=-sunos4
-		;;
-	sun3os3)
-		basic_machine=m68k-sun
-		os=-sunos3
-		;;
-	sun3os4)
-		basic_machine=m68k-sun
-		os=-sunos4
-		;;
-	sun4os3)
-		basic_machine=sparc-sun
-		os=-sunos3
-		;;
-	sun4os4)
-		basic_machine=sparc-sun
-		os=-sunos4
-		;;
-	sun4sol2)
-		basic_machine=sparc-sun
-		os=-solaris2
-		;;
-	sun3 | sun3-*)
-		basic_machine=m68k-sun
-		;;
-	sun4)
-		basic_machine=sparc-sun
-		;;
-	sun386 | sun386i | roadrunner)
-		basic_machine=i386-sun
-		;;
-	sv1)
-		basic_machine=sv1-cray
-		os=-unicos
-		;;
-	symmetry)
-		basic_machine=i386-sequent
-		os=-dynix
-		;;
-	t3e)
-		basic_machine=alphaev5-cray
-		os=-unicos
-		;;
-	t90)
-		basic_machine=t90-cray
-		os=-unicos
-		;;
-	tile*)
-		basic_machine=$basic_machine-unknown
-		os=-linux-gnu
-		;;
-	tx39)
-		basic_machine=mipstx39-unknown
-		;;
-	tx39el)
-		basic_machine=mipstx39el-unknown
-		;;
-	toad1)
-		basic_machine=pdp10-xkl
-		os=-tops20
-		;;
-	tower | tower-32)
-		basic_machine=m68k-ncr
-		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=-tpf
-		;;
-	udi29k)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	ultra3)
-		basic_machine=a29k-nyu
-		os=-sym1
-		;;
-	v810 | necv810)
-		basic_machine=v810-nec
-		os=-none
-		;;
-	vaxv)
-		basic_machine=vax-dec
-		os=-sysv
-		;;
-	vms)
-		basic_machine=vax-dec
-		os=-vms
-		;;
-	vpp*|vx|vx-*)
-		basic_machine=f301-fujitsu
-		;;
-	vxworks960)
-		basic_machine=i960-wrs
-		os=-vxworks
-		;;
-	vxworks68)
-		basic_machine=m68k-wrs
-		os=-vxworks
-		;;
-	vxworks29k)
-		basic_machine=a29k-wrs
-		os=-vxworks
-		;;
-	w65*)
-		basic_machine=w65-wdc
-		os=-none
-		;;
-	w89k-*)
-		basic_machine=hppa1.1-winbond
-		os=-proelf
-		;;
-	xbox)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	xps | xps100)
-		basic_machine=xps100-honeywell
-		;;
-	xscale-* | xscalee[bl]-*)
-		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
-		;;
-	ymp)
-		basic_machine=ymp-cray
-		os=-unicos
-		;;
-	z8k-*-coff)
-		basic_machine=z8k-unknown
-		os=-sim
-		;;
-	z80-*-coff)
-		basic_machine=z80-unknown
-		os=-sim
-		;;
-	none)
-		basic_machine=none-none
-		os=-none
-		;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-	w89k)
-		basic_machine=hppa1.1-winbond
-		;;
-	op50n)
-		basic_machine=hppa1.1-oki
-		;;
-	op60c)
-		basic_machine=hppa1.1-oki
-		;;
-	romp)
-		basic_machine=romp-ibm
-		;;
-	mmix)
-		basic_machine=mmix-knuth
-		;;
-	rs6000)
-		basic_machine=rs6000-ibm
-		;;
-	vax)
-		basic_machine=vax-dec
-		;;
-	pdp10)
-		# there are many clones, so DEC is not a safe bet
-		basic_machine=pdp10-unknown
-		;;
-	pdp11)
-		basic_machine=pdp11-dec
-		;;
-	we32k)
-		basic_machine=we32k-att
-		;;
-	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-		basic_machine=sh-unknown
-		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-		basic_machine=sparc-sun
-		;;
-	cydra)
-		basic_machine=cydra-cydrome
-		;;
-	orion)
-		basic_machine=orion-highlevel
-		;;
-	orion105)
-		basic_machine=clipper-highlevel
-		;;
-	mac | mpw | mac-mpw)
-		basic_machine=m68k-apple
-		;;
-	pmac | pmac-mpw)
-		basic_machine=powerpc-apple
-		;;
-	*-unknown)
-		# Make sure to match an already-canonicalized machine name.
-		;;
-	*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-	*-digital*)
-		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
-		;;
-	*-commodore*)
-		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
-		;;
-	*)
-		;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
-	# First match some system type aliases
-	# that might get confused with valid system types.
-	# -solaris* is a basic system type, with this one exception.
-	-auroraux)
-		os=-auroraux
-		;;
-	-solaris1 | -solaris1.*)
-		os=`echo $os | sed -e 's|solaris1|sunos4|'`
-		;;
-	-solaris)
-		os=-solaris2
-		;;
-	-svr4*)
-		os=-sysv4
-		;;
-	-unixware*)
-		os=-sysv4.2uw
-		;;
-	-gnu/linux*)
-		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
-		;;
-	# First accept the basic system types.
-	# The portable systems comes first.
-	# Each alternative MUST END IN A *, to match a version number.
-	# -sysv* is not here because it comes later, after sysvr4.
-	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
-	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
-	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -bitrig* | -openbsd* | -solidbsd* \
-	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
-	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
-	# Remember, each alternative MUST END IN *, to match a version number.
-		;;
-	-qnx*)
-		case $basic_machine in
-		    x86-* | i*86-*)
-			;;
-		    *)
-			os=-nto$os
-			;;
-		esac
-		;;
-	-nto-qnx*)
-		;;
-	-nto*)
-		os=`echo $os | sed -e 's|nto|nto-qnx|'`
-		;;
-	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
-		;;
-	-mac*)
-		os=`echo $os | sed -e 's|mac|macos|'`
-		;;
-	-linux-dietlibc)
-		os=-linux-dietlibc
-		;;
-	-linux*)
-		os=`echo $os | sed -e 's|linux|linux-gnu|'`
-		;;
-	-sunos5*)
-		os=`echo $os | sed -e 's|sunos5|solaris2|'`
-		;;
-	-sunos6*)
-		os=`echo $os | sed -e 's|sunos6|solaris3|'`
-		;;
-	-opened*)
-		os=-openedition
-		;;
-	-os400*)
-		os=-os400
-		;;
-	-wince*)
-		os=-wince
-		;;
-	-osfrose*)
-		os=-osfrose
-		;;
-	-osf*)
-		os=-osf
-		;;
-	-utek*)
-		os=-bsd
-		;;
-	-dynix*)
-		os=-bsd
-		;;
-	-acis*)
-		os=-aos
-		;;
-	-atheos*)
-		os=-atheos
-		;;
-	-syllable*)
-		os=-syllable
-		;;
-	-386bsd)
-		os=-bsd
-		;;
-	-ctix* | -uts*)
-		os=-sysv
-		;;
-	-nova*)
-		os=-rtmk-nova
-		;;
-	-ns2 )
-		os=-nextstep2
-		;;
-	-nsk*)
-		os=-nsk
-		;;
-	# Preserve the version number of sinix5.
-	-sinix5.*)
-		os=`echo $os | sed -e 's|sinix|sysv|'`
-		;;
-	-sinix*)
-		os=-sysv4
-		;;
-	-tpf*)
-		os=-tpf
-		;;
-	-triton*)
-		os=-sysv3
-		;;
-	-oss*)
-		os=-sysv3
-		;;
-	-svr4)
-		os=-sysv4
-		;;
-	-svr3)
-		os=-sysv3
-		;;
-	-sysvr4)
-		os=-sysv4
-		;;
-	# This must come after -sysvr4.
-	-sysv*)
-		;;
-	-ose*)
-		os=-ose
-		;;
-	-es1800*)
-		os=-ose
-		;;
-	-xenix)
-		os=-xenix
-		;;
-	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-		os=-mint
-		;;
-	-aros*)
-		os=-aros
-		;;
-	-kaos*)
-		os=-kaos
-		;;
-	-zvmoe)
-		os=-zvmoe
-		;;
-	-dicos*)
-		os=-dicos
-		;;
-	-nacl*)
-		;;
-	-none)
-		;;
-	*)
-		# Get rid of the `-' at the beginning of $os.
-		os=`echo $os | sed 's/[^-]*-//'`
-		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
-		exit 1
-		;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system.  Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
-	score-*)
-		os=-elf
-		;;
-	spu-*)
-		os=-elf
-		;;
-	*-acorn)
-		os=-riscix1.2
-		;;
-	arm*-rebel)
-		os=-linux
-		;;
-	arm*-semi)
-		os=-aout
-		;;
-	c4x-* | tic4x-*)
-		os=-coff
-		;;
-	hexagon-*)
-		os=-elf
-		;;
-	tic54x-*)
-		os=-coff
-		;;
-	tic55x-*)
-		os=-coff
-		;;
-	tic6x-*)
-		os=-coff
-		;;
-	# This must come before the *-dec entry.
-	pdp10-*)
-		os=-tops20
-		;;
-	pdp11-*)
-		os=-none
-		;;
-	*-dec | vax-*)
-		os=-ultrix4.2
-		;;
-	m68*-apollo)
-		os=-domain
-		;;
-	i386-sun)
-		os=-sunos4.0.2
-		;;
-	m68000-sun)
-		os=-sunos3
-		;;
-	m68*-cisco)
-		os=-aout
-		;;
-	mep-*)
-		os=-elf
-		;;
-	mips*-cisco)
-		os=-elf
-		;;
-	mips*-*)
-		os=-elf
-		;;
-	or32-*)
-		os=-coff
-		;;
-	*-tti)	# must be before sparc entry or we get the wrong os.
-		os=-sysv3
-		;;
-	sparc-* | *-sun)
-		os=-sunos4.1.1
-		;;
-	*-be)
-		os=-beos
-		;;
-	*-haiku)
-		os=-haiku
-		;;
-	*-ibm)
-		os=-aix
-		;;
-	*-knuth)
-		os=-mmixware
-		;;
-	*-wec)
-		os=-proelf
-		;;
-	*-winbond)
-		os=-proelf
-		;;
-	*-oki)
-		os=-proelf
-		;;
-	*-hp)
-		os=-hpux
-		;;
-	*-hitachi)
-		os=-hiux
-		;;
-	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-		os=-sysv
-		;;
-	*-cbm)
-		os=-amigaos
-		;;
-	*-dg)
-		os=-dgux
-		;;
-	*-dolphin)
-		os=-sysv3
-		;;
-	m68k-ccur)
-		os=-rtu
-		;;
-	m88k-omron*)
-		os=-luna
-		;;
-	*-next )
-		os=-nextstep
-		;;
-	*-sequent)
-		os=-ptx
-		;;
-	*-crds)
-		os=-unos
-		;;
-	*-ns)
-		os=-genix
-		;;
-	i370-*)
-		os=-mvs
-		;;
-	*-next)
-		os=-nextstep3
-		;;
-	*-gould)
-		os=-sysv
-		;;
-	*-highlevel)
-		os=-bsd
-		;;
-	*-encore)
-		os=-bsd
-		;;
-	*-sgi)
-		os=-irix
-		;;
-	*-siemens)
-		os=-sysv4
-		;;
-	*-masscomp)
-		os=-rtu
-		;;
-	f30[01]-fujitsu | f700-fujitsu)
-		os=-uxpv
-		;;
-	*-rom68k)
-		os=-coff
-		;;
-	*-*bug)
-		os=-coff
-		;;
-	*-apple)
-		os=-macos
-		;;
-	*-atari*)
-		os=-mint
-		;;
-	*)
-		os=-none
-		;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-	*-unknown)
-		case $os in
-			-riscix*)
-				vendor=acorn
-				;;
-			-sunos*)
-				vendor=sun
-				;;
-			-cnk*|-aix*)
-				vendor=ibm
-				;;
-			-beos*)
-				vendor=be
-				;;
-			-hpux*)
-				vendor=hp
-				;;
-			-mpeix*)
-				vendor=hp
-				;;
-			-hiux*)
-				vendor=hitachi
-				;;
-			-unos*)
-				vendor=crds
-				;;
-			-dgux*)
-				vendor=dg
-				;;
-			-luna*)
-				vendor=omron
-				;;
-			-genix*)
-				vendor=ns
-				;;
-			-mvs* | -opened*)
-				vendor=ibm
-				;;
-			-os400*)
-				vendor=ibm
-				;;
-			-ptx*)
-				vendor=sequent
-				;;
-			-tpf*)
-				vendor=ibm
-				;;
-			-vxsim* | -vxworks* | -windiss*)
-				vendor=wrs
-				;;
-			-aux*)
-				vendor=apple
-				;;
-			-hms*)
-				vendor=hitachi
-				;;
-			-mpw* | -macos*)
-				vendor=apple
-				;;
-			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-				vendor=atari
-				;;
-			-vos*)
-				vendor=stratus
-				;;
-		esac
-		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
-		;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/deps/SDL2/build-scripts/g++-fat.sh b/deps/SDL2/build-scripts/g++-fat.sh
deleted file mode 100755
index 6e4f53e..0000000
--- a/deps/SDL2/build-scripts/g++-fat.sh
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/sh
-#
-# Build Universal binaries on Mac OS X, thanks Ryan!
-#
-# Usage: ./configure CXX="sh g++-fat.sh" && make && rm -rf x86 x64
-
-DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer"
-
-# Intel 32-bit compiler flags (10.6 runtime compatibility)
-GCC_COMPILE_X86="g++ -arch i386 -mmacosx-version-min=10.5 \
--I/usr/local/include"
-
-GCC_LINK_X86="-mmacosx-version-min=10.5"
-
-# Intel 64-bit compiler flags (10.6 runtime compatibility)
-GCC_COMPILE_X64="g++ -arch x86_64 -mmacosx-version-min=10.6 \
--I/usr/local/include"
-
-GCC_LINK_X64="-mmacosx-version-min=10.6"
-
-# Output both PowerPC and Intel object files
-args="$*"
-compile=yes
-link=yes
-while test x$1 != x; do
-    case $1 in
-        --version) exec g++ $1;;
-        -v) exec g++ $1;;
-        -V) exec g++ $1;;
-        -print-prog-name=*) exec g++ $1;;
-        -print-search-dirs) exec g++ $1;;
-        -E) GCC_COMPILE_X86="$GCC_COMPILE_X86 -E"
-            GCC_COMPILE_X64="$GCC_COMPILE_X64 -E"
-            compile=no; link=no;;
-        -c) link=no;;
-        -o) output=$2;;
-        *.c|*.cc|*.cpp|*.S) source=$1;;
-    esac
-    shift
-done
-if test x$link = xyes; then
-    GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86"
-    GCC_COMPILE_X64="$GCC_COMPILE_X64 $GCC_LINK_X64"
-fi
-if test x"$output" = x; then
-    if test x$link = xyes; then
-        output=a.out
-    elif test x$compile = xyes; then
-        output=`echo $source | sed -e 's|.*/||' -e 's|\(.*\)\.[^\.]*|\1|'`.o
-    fi
-fi
-
-# Compile X86 32-bit
-if test x"$output" != x; then
-    dir=x86/`dirname $output`
-    if test -d $dir; then
-        :
-    else
-        mkdir -p $dir
-    fi
-fi
-set -- $args
-while test x$1 != x; do
-    if test -f "x86/$1" && test "$1" != "$output"; then
-        x86_args="$x86_args x86/$1"
-    else
-        x86_args="$x86_args $1"
-    fi
-    shift
-done
-$GCC_COMPILE_X86 $x86_args || exit $?
-if test x"$output" != x; then
-    cp $output x86/$output
-fi
-
-# Compile X86 32-bit
-if test x"$output" != x; then
-    dir=x64/`dirname $output`
-    if test -d $dir; then
-        :
-    else
-        mkdir -p $dir
-    fi
-fi
-set -- $args
-while test x$1 != x; do
-    if test -f "x64/$1" && test "$1" != "$output"; then
-        x64_args="$x64_args x64/$1"
-    else
-        x64_args="$x64_args $1"
-    fi
-    shift
-done
-$GCC_COMPILE_X64 $x64_args || exit $?
-if test x"$output" != x; then
-    cp $output x64/$output
-fi
-
-if test x"$output" != x; then
-    lipo -create -o $output x86/$output x64/$output
-fi
diff --git a/deps/SDL2/build-scripts/gcc-fat.sh b/deps/SDL2/build-scripts/gcc-fat.sh
deleted file mode 100755
index edabb0d..0000000
--- a/deps/SDL2/build-scripts/gcc-fat.sh
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/sh
-#
-# Build Universal binaries on Mac OS X, thanks Ryan!
-#
-# Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf x86 x64
-
-DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer"
-
-# Intel 32-bit compiler flags (10.5 runtime compatibility)
-GCC_COMPILE_X86="gcc -arch i386 -mmacosx-version-min=10.5 \
--I/usr/local/include"
-
-GCC_LINK_X86="-mmacosx-version-min=10.5"
-
-# Intel 64-bit compiler flags (10.6 runtime compatibility)
-GCC_COMPILE_X64="gcc -arch x86_64 -mmacosx-version-min=10.6 \
--DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \
--I/usr/local/include"
-
-GCC_LINK_X64="-mmacosx-version-min=10.6"
-
-# Output both PowerPC and Intel object files
-args="$*"
-compile=yes
-link=yes
-while test x$1 != x; do
-    case $1 in
-        --version) exec gcc $1;;
-        -v) exec gcc $1;;
-        -V) exec gcc $1;;
-        -print-prog-name=*) exec gcc $1;;
-        -print-search-dirs) exec gcc $1;;
-        -E) GCC_COMPILE_X86="$GCC_COMPILE_X86 -E"
-            GCC_COMPILE_X64="$GCC_COMPILE_X64 -E"
-            compile=no; link=no;;
-        -c) link=no;;
-        -o) output=$2;;
-        *.c|*.cc|*.cpp|*.S) source=$1;;
-    esac
-    shift
-done
-if test x$link = xyes; then
-    GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86"
-    GCC_COMPILE_X64="$GCC_COMPILE_X64 $GCC_LINK_X64"
-fi
-if test x"$output" = x; then
-    if test x$link = xyes; then
-        output=a.out
-    elif test x$compile = xyes; then
-        output=`echo $source | sed -e 's|.*/||' -e 's|\(.*\)\.[^\.]*|\1|'`.o
-    fi
-fi
-
-# Compile X86 32-bit
-if test x"$output" != x; then
-    dir=x86/`dirname $output`
-    if test -d $dir; then
-        :
-    else
-        mkdir -p $dir
-    fi
-fi
-set -- $args
-while test x$1 != x; do
-    if test -f "x86/$1" && test "$1" != "$output"; then
-        x86_args="$x86_args x86/$1"
-    else
-        x86_args="$x86_args $1"
-    fi
-    shift
-done
-$GCC_COMPILE_X86 $x86_args || exit $?
-if test x"$output" != x; then
-    cp $output x86/$output
-fi
-
-# Compile X86 32-bit
-if test x"$output" != x; then
-    dir=x64/`dirname $output`
-    if test -d $dir; then
-        :
-    else
-        mkdir -p $dir
-    fi
-fi
-set -- $args
-while test x$1 != x; do
-    if test -f "x64/$1" && test "$1" != "$output"; then
-        x64_args="$x64_args x64/$1"
-    else
-        x64_args="$x64_args $1"
-    fi
-    shift
-done
-$GCC_COMPILE_X64 $x64_args || exit $?
-if test x"$output" != x; then
-    cp $output x64/$output
-fi
-
-if test x"$output" != x; then
-    lipo -create -o $output x86/$output x64/$output
-fi
diff --git a/deps/SDL2/build-scripts/install-sh b/deps/SDL2/build-scripts/install-sh
deleted file mode 100755
index 1a83534..0000000
--- a/deps/SDL2/build-scripts/install-sh
+++ /dev/null
@@ -1,323 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2005-02-02.21
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-chmodcmd="$chmodprog 0755"
-chowncmd=
-chgrpcmd=
-stripcmd=
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=
-dst=
-dir_arg=
-dstarg=
-no_target_directory=
-
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
-   or: $0 [OPTION]... SRCFILES... DIRECTORY
-   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
-   or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
--c         (ignored)
--d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
---help     display this help and exit.
---version  display version info and exit.
-
-Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
-"
-
-while test -n "$1"; do
-  case $1 in
-    -c) shift
-        continue;;
-
-    -d) dir_arg=true
-        shift
-        continue;;
-
-    -g) chgrpcmd="$chgrpprog $2"
-        shift
-        shift
-        continue;;
-
-    --help) echo "$usage"; exit $?;;
-
-    -m) chmodcmd="$chmodprog $2"
-        shift
-        shift
-        continue;;
-
-    -o) chowncmd="$chownprog $2"
-        shift
-        shift
-        continue;;
-
-    -s) stripcmd=$stripprog
-        shift
-        continue;;
-
-    -t) dstarg=$2
-	shift
-	shift
-	continue;;
-
-    -T) no_target_directory=true
-	shift
-	continue;;
-
-    --version) echo "$0 $scriptversion"; exit $?;;
-
-    *)  # When -d is used, all remaining arguments are directories to create.
-	# When -t is used, the destination is already specified.
-	test -n "$dir_arg$dstarg" && break
-        # Otherwise, the last argument is the destination.  Remove it from $@.
-	for arg
-	do
-          if test -n "$dstarg"; then
-	    # $@ is not empty: it contains at least $arg.
-	    set fnord "$@" "$dstarg"
-	    shift # fnord
-	  fi
-	  shift # arg
-	  dstarg=$arg
-	done
-	break;;
-  esac
-done
-
-if test -z "$1"; then
-  if test -z "$dir_arg"; then
-    echo "$0: no input file specified." >&2
-    exit 1
-  fi
-  # It's OK to call `install-sh -d' without argument.
-  # This can happen when creating conditional directories.
-  exit 0
-fi
-
-for src
-do
-  # Protect names starting with `-'.
-  case $src in
-    -*) src=./$src ;;
-  esac
-
-  if test -n "$dir_arg"; then
-    dst=$src
-    src=
-
-    if test -d "$dst"; then
-      mkdircmd=:
-      chmodcmd=
-    else
-      mkdircmd=$mkdirprog
-    fi
-  else
-    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
-    # might cause directories to be created, which would be especially bad
-    # if $src (and thus $dsttmp) contains '*'.
-    if test ! -f "$src" && test ! -d "$src"; then
-      echo "$0: $src does not exist." >&2
-      exit 1
-    fi
-
-    if test -z "$dstarg"; then
-      echo "$0: no destination specified." >&2
-      exit 1
-    fi
-
-    dst=$dstarg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst ;;
-    esac
-
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
-    if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-	echo "$0: $dstarg: Is a directory" >&2
-	exit 1
-      fi
-      dst=$dst/`basename "$src"`
-    fi
-  fi
-
-  # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
-
-  # Make sure that the destination directory exists.
-
-  # Skip lots of stat calls in the usual case.
-  if test ! -d "$dstdir"; then
-    defaultIFS='
-	 '
-    IFS="${IFS-$defaultIFS}"
-
-    oIFS=$IFS
-    # Some sh's can't handle IFS=/ for some reason.
-    IFS='%'
-    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-    shift
-    IFS=$oIFS
-
-    pathcomp=
-
-    while test $# -ne 0 ; do
-      pathcomp=$pathcomp$1
-      shift
-      if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
-	# mkdir can fail with a `File exist' error in case several
-	# install-sh are creating the directory concurrently.  This
-	# is OK.
-	test -d "$pathcomp" || exit
-      fi
-      pathcomp=$pathcomp/
-    done
-  fi
-
-  if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
-      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
-  else
-    dstfile=`basename "$dst"`
-
-    # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
-
-    # Trap to clean up those temp files at exit.
-    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-    trap '(exit $?); exit' 1 2 13 15
-
-    # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
-
-    # and set any options; do chmod last to preserve setuid bits.
-    #
-    # If any of these fail, we abort the whole thing.  If we want to
-    # ignore errors from any of these, just make sure not to ignore
-    # errors from the above "$doit $cpprog $src $dsttmp" command.
-    #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
-    # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
-      || {
-	   # The rename failed, perhaps because mv can't rename something else
-	   # to itself, or perhaps because mv is so ancient that it does not
-	   # support -f.
-
-	   # Now remove or move aside any old file at destination location.
-	   # We try this two ways since rm can't unlink itself on some
-	   # systems and the destination file might be busy for other
-	   # reasons.  In this case, the final cleanup might fail but the new
-	   # file should still install successfully.
-	   {
-	     if test -f "$dstdir/$dstfile"; then
-	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-	       || {
-		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-		 (exit 1); exit 1
-	       }
-	     else
-	       :
-	     fi
-	   } &&
-
-	   # Now rename the file to the real destination.
-	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-	 }
-    }
-  fi || { (exit 1); exit 1; }
-done
-
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
-  (exit 0); exit 0
-}
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/deps/SDL2/build-scripts/iosbuild.sh b/deps/SDL2/build-scripts/iosbuild.sh
deleted file mode 100755
index eeb5716..0000000
--- a/deps/SDL2/build-scripts/iosbuild.sh
+++ /dev/null
@@ -1,277 +0,0 @@
-#!/bin/sh
-#
-# Build a fat binary for iOS
-# Based on fatbuild.sh and code from the Ignifuga Game Engine
-
-# Number of CPUs (for make -j)
-NCPU=`sysctl -n hw.ncpu`
-if test x$NJOB = x; then
-    NJOB=$NCPU
-fi
-
-# SDK path
-XCODE_PATH=`xcode-select --print-path`
-if [ -z "$XCODE_PATH" ]; then
-    echo "Could not find XCode location (use xcode-select -switch to set the correct path)"
-    exit 1
-fi
-
-prepare_environment() {
-    ARCH=$1
-    
-    if test x$SDK_VERSION = x; then
-      export SDK_VERSION=`xcodebuild -showsdks | grep iphoneos | sed "s|.*iphoneos||"`
-      if [ -z "$XCODE_PATH" ]; then
-          echo "Could not find a valid iOS SDK"
-          exit 1
-      fi  
-    fi
-    
-    case $ARCH in
-        armv6)
-            DEV_PATH="$XCODE_PATH/Platforms/iPhoneOS.platform/Developer"
-            SDK_PATH="$DEV_PATH/SDKs/iPhoneOS$SDK_VERSION.sdk"
-            ;;
-        armv7)
-            DEV_PATH="$XCODE_PATH/Platforms/iPhoneOS.platform/Developer"
-            SDK_PATH="$DEV_PATH/SDKs/iPhoneOS$SDK_VERSION.sdk"
-            ;;
-        i386)
-            DEV_PATH="$XCODE_PATH/Platforms/iPhoneSimulator.platform/Developer"
-            SDK_PATH="$DEV_PATH/SDKs/iPhoneSimulator$SDK_VERSION.sdk"
-            ;;
-        *)
-            echo "Unknown Architecture $ARCH"
-            exit 1
-            ;;
-    esac
-
-    if [ ! -d "$SDK_PATH" ]; then
-        echo "Could not find iOS SDK at $SDK_PATH"
-        exit 1
-    fi
-
-    if test x$MIN_OS_VERSION = x; then
-        export MIN_OS_VERSION="3.0"
-    fi
-    
-    # Environment flags
-    CFLAGS="-g -O2 -pipe -no-cpp-precomp -isysroot $SDK_PATH \
-            -miphoneos-version-min=$MIN_OS_VERSION -I$SDK_PATH/usr/include/"
-    LDFLAGS="-L$SDK_PATH/usr/lib/ -isysroot $SDK_PATH \
-             -miphoneos-version-min=$MIN_OS_VERSION -static-libgcc"
-    export CXXFLAGS="$CFLAGS"
-    export CXXCPP="$DEV_PATH/usr/bin/llvm-cpp-4.2"
-    export CPP="$CXXCPP"
-    export CXX="$DEV_PATH/usr/bin/llvm-g++-4.2"
-    export CC="$DEV_PATH/usr/bin/llvm-gcc-4.2"
-    export LD="$DEV_PATH/usr/bin/ld"
-    export AR="$DEV_PATH/usr/bin/ar"
-    export AS="$DEV_PATH/usr/bin/ls"
-    export NM="$DEV_PATH/usr/bin/nm"
-    export RANLIB="$DEV_PATH/usr/bin/ranlib"
-    export STRIP="$DEV_PATH/usr/bin/strip"
-    
-    # We dynamically load X11, so using the system X11 headers is fine.
-    CONFIG_FLAGS="--disable-shared --enable-static"
-    
-    case $ARCH in
-        armv6)
-            export CONFIG_FLAGS="$CONFIG_FLAGS --host=armv6-apple-darwin"
-            export CFLAGS="$CFLAGS -arch armv6"
-            export LDFLAGS="$LDFLAGS -arch armv6"
-            ;;
-        armv7)
-            export CONFIG_FLAGS="$CONFIG_FLAGS --host=armv7-apple-darwin"
-            export CFLAGS="$CFLAGS -arch armv7"
-            export LDFLAGS="$LDFLAGS -arch armv7"
-            ;;
-        i386)
-            export CONFIG_FLAGS="$CONFIG_FLAGS --host=i386-apple-darwin"
-            export CFLAGS="$CFLAGS -arch i386"
-            export LDFLAGS="$LDFLAGS -arch i386"
-            ;;
-        *)
-            echo "Unknown Architecture $ARCH"
-            exit 1
-            ;;
-    esac
-}
-
-prepare_environment "armv6"
-echo "Building with iOS SDK v$SDK_VERSION for iOS >= $MIN_OS_VERSION"
-
-#
-# Find the configure script
-#
-srcdir=`dirname $0`/..
-srcdir=`cd $srcdir && pwd`
-auxdir=$srcdir/build-scripts
-cd $srcdir
-
-#
-# Figure out which phase to build:
-# all,
-# configure, configure-armv6, configure-armv7, configure-i386
-# make, make-armv6, make-armv7, make-i386, merge
-# clean
-if test x"$1" = x; then
-    phase=all
-else
-    phase="$1"
-fi
-case $phase in
-    all)
-        configure_armv6="yes"
-        configure_armv7="yes"
-        configure_i386="yes"
-        make_armv6="yes"
-        make_armv7="yes"
-        make_i386="yes"
-        merge="yes"
-        ;;
-    configure)
-        configure_armv6="yes"
-        configure_armv7="yes"
-        configure_i386="yes"
-        ;;
-    configure-armv6)
-        configure_armv6="yes"
-        ;;
-    configure-armv7)
-        configure_armv7="yes"
-        ;;
-    configure-i386)
-        configure_i386="yes"
-        ;;
-    make)
-        make_armv6="yes"
-        make_armv7="yes"
-        make_i386="yes"
-        merge="yes"
-        ;;
-    make-armv6)
-        make_armv6="yes"
-        ;;
-    make-armv7)
-        make_armv7="yes"
-        ;;
-    make-i386)
-        make_i386="yes"
-        ;;
-    merge)
-        merge="yes"
-        ;;
-    clean)
-        clean_armv6="yes"
-        clean_armv7="yes"
-        clean_i386="yes"
-        ;;
-    clean-armv6)
-        clean_armv6="yes"
-        ;;
-    clean-armv7)
-        clean_armv7="yes"
-        ;;
-    clean-i386)
-        clean_i386="yes"
-        ;;
-    *)
-        echo "Usage: $0 [all|configure[-armv6|-armv7|-i386]|make[-armv6|-armv7|-i386]|merge|clean[-armv6|-armv7|-i386]]"
-        exit 1
-        ;;
-esac
-
-#
-# Create the build directories
-#
-for dir in build build/armv6 build/armv7 build/i386; do
-    if test -d $dir; then
-        :
-    else
-        mkdir $dir || exit 1
-    fi
-done
-
-#
-# Build the armv6 binary
-#
-prepare_environment "armv6"
-if test x$configure_armv6 = xyes; then
-    (cd build/armv6 && \
-     sh ../../configure $CONFIG_FLAGS CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS") || exit 2
-     # configure is not yet fully ready for iOS, some manual patching is required
-     cp include/* build/armv6/include
-     cp include/SDL_config_iphoneos.h build/armv6/include/SDL_config.h || exit 2
-     sed -i "" -e "s|^EXTRA_CFLAGS.*|EXTRA_CFLAGS=-I./include|g" build/armv6/Makefile || exit 2
-     sed -i "" -e "s|^EXTRA_LDFLAGS.*|EXTRA_LDFLAGS=-lm|g" build/armv6/Makefile || exit 2
-fi
-if test x$make_armv6 = xyes; then
-    (cd build/armv6 && make -j$NJOB) || exit 3
-fi
-#
-# Build the armv7 binary
-#
-prepare_environment "armv7"
-if test x$configure_armv7 = xyes; then
-    (cd build/armv7 && \
-     sh ../../configure $CONFIG_FLAGS CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS") || exit 2
-     # configure is not yet fully ready for iOS, some manual patching is required
-     cp include/* build/armv7/include
-     cp include/SDL_config_iphoneos.h build/armv7/include/SDL_config.h || exit 2
-     sed -i "" -e "s|^EXTRA_CFLAGS.*|EXTRA_CFLAGS=-I./include|g" build/armv7/Makefile || exit 2
-     sed -i "" -e "s|^EXTRA_LDFLAGS.*|EXTRA_LDFLAGS=-lm|g" build/armv7/Makefile || exit 2
-fi
-if test x$make_armv7 = xyes; then
-    (cd build/armv7 && make -j$NJOB) || exit 3
-fi
-#
-# Build the i386 binary
-#
-prepare_environment "i386"
-if test x$configure_i386 = xyes; then
-    (cd build/i386 && \
-     sh ../../configure $CONFIG_FLAGS CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS") || exit 2
-     # configure is not yet fully ready for iOS, some manual patching is required
-     cp include/* build/i386/include
-     cp include/SDL_config_iphoneos.h build/i386/include/SDL_config.h || exit 2
-     sed -i "" -e "s|^EXTRA_CFLAGS.*|EXTRA_CFLAGS=-I./include|g" build/i386/Makefile || exit 2
-     sed -i "" -e "s|^EXTRA_LDFLAGS.*|EXTRA_LDFLAGS=-lm|g" build/i386/Makefile || exit 2
-fi
-if test x$make_i386 = xyes; then
-    (cd build/i386 && make -j$NJOB) || exit 3
-fi
-
-#
-# Combine into fat binary
-#
-if test x$merge = xyes; then
-    output=ios/lib
-    sh $auxdir/mkinstalldirs build/$output
-    cd build
-    target=`find . -mindepth 4 -maxdepth 4 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
-    (lipo -create -o $output/libSDL2.a armv6/build/.libs/libSDL2.a armv7/build/.libs/libSDL2.a i386/build/.libs/libSDL2.a &&
-     lipo -create -o $output/libSDL2main.a armv6/build/libSDL2main.a armv7/build/libSDL2main.a i386/build/libSDL2main.a &&
-     cp -r armv6/include ios
-     echo "Build complete!" &&
-     echo "Files can be found under the build/ios directory.") || exit 4
-    cd ..
-fi
-
-#
-# Clean up
-#
-do_clean()
-{
-    echo $*
-    $* || exit 6
-}
-if test x$clean_armv6 = xyes; then
-    do_clean rm -r build/armv6
-fi
-if test x$clean_armv7 = xyes; then
-    do_clean rm -r build/armv7
-fi
-if test x$clean_i386 = xyes; then
-    do_clean rm -r build/i386
-fi
diff --git a/deps/SDL2/build-scripts/ltmain.sh b/deps/SDL2/build-scripts/ltmain.sh
deleted file mode 100755
index 63ae69d..0000000
--- a/deps/SDL2/build-scripts/ltmain.sh
+++ /dev/null
@@ -1,9655 +0,0 @@
-
-# libtool (GNU libtool) 2.4.2
-# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-#       --config             show all configuration variables
-#       --debug              enable verbose shell tracing
-#   -n, --dry-run            display commands without modifying any files
-#       --features           display basic configuration information and exit
-#       --mode=MODE          use operation mode MODE
-#       --preserve-dup-deps  don't remove duplicate dependency libraries
-#       --quiet, --silent    don't print informational messages
-#       --no-quiet, --no-silent
-#                            print informational messages (default)
-#       --no-warn            don't display warning messages
-#       --tag=TAG            use configuration variables from tag TAG
-#   -v, --verbose            print more informational messages than default
-#       --no-verbose         don't print the extra informational messages
-#       --version            print version information
-#   -h, --help, --help-all   print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-#         clean              remove files from the build directory
-#         compile            compile a source file into a libtool object
-#         execute            automatically set library path, then run a program
-#         finish             complete the installation of libtool libraries
-#         install            install libraries or executables
-#         link               create a library or an executable
-#         uninstall          remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.  When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-#         host-triplet:	$host
-#         shell:		$SHELL
-#         compiler:		$LTCC
-#         compiler flags:		$LTCFLAGS
-#         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2
-#         automake:	$automake_version
-#         autoconf:	$autoconf_version
-#
-# Report bugs to <bug-libtool at gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
-
-PROGRAM=libtool
-PACKAGE=libtool
-VERSION=2.4.2
-TIMESTAMP=""
-package_revision=1.3337
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
-  eval "if test \"\${$lt_var+set}\" = set; then
-          save_$lt_var=\$$lt_var
-          $lt_var=C
-	  export $lt_var
-	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
-	fi"
-done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
-
-$lt_unset CDPATH
-
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-
-
-: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
-
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-} # func_dirname may be replaced by extended shell implementation
-
-
-# func_basename file
-func_basename ()
-{
-    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
-
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-    # Extract subdirectory from the argument.
-    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-    case ${2} in
-      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-    esac
-} # func_stripname may be replaced by extended shell implementation
-
-
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
-		s@/\./@/@g
-		t dotsl
-		s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
-
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-#             value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
-  # Start from root dir and reassemble the path.
-  func_normal_abspath_result=
-  func_normal_abspath_tpath=$1
-  func_normal_abspath_altnamespace=
-  case $func_normal_abspath_tpath in
-    "")
-      # Empty path, that just means $cwd.
-      func_stripname '' '/' "`pwd`"
-      func_normal_abspath_result=$func_stripname_result
-      return
-    ;;
-    # The next three entries are used to spot a run of precisely
-    # two leading slashes without using negated character classes;
-    # we take advantage of case's first-match behaviour.
-    ///*)
-      # Unusual form of absolute path, do nothing.
-    ;;
-    //*)
-      # Not necessarily an ordinary path; POSIX reserves leading '//'
-      # and for example Cygwin uses it to access remote file shares
-      # over CIFS/SMB, so we conserve a leading double slash if found.
-      func_normal_abspath_altnamespace=/
-    ;;
-    /*)
-      # Absolute path, do nothing.
-    ;;
-    *)
-      # Relative path, prepend $cwd.
-      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-    ;;
-  esac
-  # Cancel out all the simple stuff to save iterations.  We also want
-  # the path to end with a slash for ease of parsing, so make sure
-  # there is one (and only one) here.
-  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
-  while :; do
-    # Processed it all yet?
-    if test "$func_normal_abspath_tpath" = / ; then
-      # If we ascended to the root using ".." the result may be empty now.
-      if test -z "$func_normal_abspath_result" ; then
-        func_normal_abspath_result=/
-      fi
-      break
-    fi
-    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcar"`
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcdr"`
-    # Figure out what to do with it
-    case $func_normal_abspath_tcomponent in
-      "")
-        # Trailing empty path component, ignore it.
-      ;;
-      ..)
-        # Parent dir; strip last assembled component from result.
-        func_dirname "$func_normal_abspath_result"
-        func_normal_abspath_result=$func_dirname_result
-      ;;
-      *)
-        # Actual path component, append it.
-        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
-      ;;
-    esac
-  done
-  # Restore leading double-slash if one was found on entry.
-  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
-
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-#             value returned in "$func_relative_path_result"
-func_relative_path ()
-{
-  func_relative_path_result=
-  func_normal_abspath "$1"
-  func_relative_path_tlibdir=$func_normal_abspath_result
-  func_normal_abspath "$2"
-  func_relative_path_tbindir=$func_normal_abspath_result
-
-  # Ascend the tree starting from libdir
-  while :; do
-    # check if we have found a prefix of bindir
-    case $func_relative_path_tbindir in
-      $func_relative_path_tlibdir)
-        # found an exact match
-        func_relative_path_tcancelled=
-        break
-        ;;
-      $func_relative_path_tlibdir*)
-        # found a matching prefix
-        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-        func_relative_path_tcancelled=$func_stripname_result
-        if test -z "$func_relative_path_result"; then
-          func_relative_path_result=.
-        fi
-        break
-        ;;
-      *)
-        func_dirname $func_relative_path_tlibdir
-        func_relative_path_tlibdir=${func_dirname_result}
-        if test "x$func_relative_path_tlibdir" = x ; then
-          # Have to descend all the way to the root!
-          func_relative_path_result=../$func_relative_path_result
-          func_relative_path_tcancelled=$func_relative_path_tbindir
-          break
-        fi
-        func_relative_path_result=../$func_relative_path_result
-        ;;
-    esac
-  done
-
-  # Now calculate path; take care to avoid doubling-up slashes.
-  func_stripname '' '/' "$func_relative_path_result"
-  func_relative_path_result=$func_stripname_result
-  func_stripname '/' '/' "$func_relative_path_tcancelled"
-  if test "x$func_stripname_result" != x ; then
-    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
-  fi
-
-  # Normalisation. If bindir is libdir, return empty string,
-  # else relative path ending with a slash; either way, target
-  # file name can be directly appended.
-  if test ! -z "$func_relative_path_result"; then
-    func_stripname './' '' "$func_relative_path_result/"
-    func_relative_path_result=$func_stripname_result
-  fi
-}
-
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
-  [\\/]*|[A-Za-z]:\\*) ;;
-  *[\\/]*)
-     progdir=$func_dirname_result
-     progdir=`cd "$progdir" && pwd`
-     progpath="$progdir/$progname"
-     ;;
-  *)
-     save_IFS="$IFS"
-     IFS=${PATH_SEPARATOR-:}
-     for progdir in $PATH; do
-       IFS="$save_IFS"
-       test -x "$progdir/$progname" && break
-     done
-     IFS="$save_IFS"
-     test -n "$progdir" || progdir=`pwd`
-     progpath="$progdir/$progname"
-     ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
-
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
-  s/$bs4/&\\
-/g
-  s/^$bs2$dollar/$bs&/
-  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
-  s/\n//g"
-
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
-
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
-
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
-
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
-
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
-
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
-    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
-
-    # bash bug again:
-    :
-}
-
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
-
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    func_error ${1+"$@"}
-    func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information."  ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
-    $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_mkdir_p directory-path
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
-    my_directory_path="$1"
-    my_dir_list=
-
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
-
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
-      esac
-
-      # While some portion of DIR does not yet exist...
-      while test ! -d "$my_directory_path"; do
-        # ...make a list in topmost first order.  Use a colon delimited
-	# list incase some portion of path contains whitespace.
-        my_dir_list="$my_directory_path:$my_dir_list"
-
-        # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
-
-        # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
-      done
-      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
-
-      save_mkdir_p_IFS="$IFS"; IFS=':'
-      for my_dir in $my_dir_list; do
-	IFS="$save_mkdir_p_IFS"
-        # mkdir can fail with a `File exist' error if two processes
-        # try to create one of the directories concurrently.  Don't
-        # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
-      done
-      IFS="$save_mkdir_p_IFS"
-
-      # Bail out if we (or some other process) failed to create a directory.
-      test -d "$my_directory_path" || \
-        func_fatal_error "Failed to create \`$1'"
-    fi
-}
-
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
-
-    if test "$opt_dry_run" = ":"; then
-      # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
-    else
-
-      # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
-      if test ! -d "$my_tmpdir"; then
-        # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
-
-        save_mktempdir_umask=`umask`
-        umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_mktempdir_umask
-      fi
-
-      # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || \
-        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
-    fi
-
-    $ECHO "$my_tmpdir"
-}
-
-
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
-{
-    case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
-      *)
-        func_quote_for_eval_unquoted_result="$1" ;;
-    esac
-
-    case $func_quote_for_eval_unquoted_result in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting, command substitution and and variable
-      # expansion for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
-        ;;
-      *)
-        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
-    esac
-}
-
-
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
-    case $1 in
-      *[\\\`\"]*)
-	my_arg=`$ECHO "$1" | $SED \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        my_arg="$1" ;;
-    esac
-
-    case $my_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        my_arg="\"$my_arg\""
-        ;;
-    esac
-
-    func_quote_for_expand_result="$my_arg"
-}
-
-
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
-
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
-
-    if ${opt_dry_run-false}; then :; else
-      eval "$my_cmd"
-      my_status=$?
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
-
-
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
-
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
-
-    if ${opt_dry_run-false}; then :; else
-      eval "$lt_user_locale
-	    $my_cmd"
-      my_status=$?
-      eval "$lt_safe_locale"
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
-
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result.  All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
-  case $1 in
-  [0-9]* | *[!a-zA-Z0-9_]*)
-    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
-    ;;
-  * )
-    func_tr_sh_result=$1
-    ;;
-  esac
-}
-
-
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
-    $opt_debug
-
-    $SED -n '/(C)/!b go
-	:more
-	/\./!{
-	  N
-	  s/\n# / /
-	  b more
-	}
-	:go
-	/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //
-	s/^# *$//
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
-        p
-     }' < "$progpath"
-     exit $?
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    echo
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
-}
-
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
-func_help ()
-{
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/# Report bugs to/ {
-	:print
-        s/^# //
-	s/^# *$//
-	s*\$progname*'$progname'*
-	s*\$host*'"$host"'*
-	s*\$SHELL*'"$SHELL"'*
-	s*\$LTCC*'"$LTCC"'*
-	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-	s*\$LD*'"$LD"'*
-	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
-	p
-	d
-     }
-     /^# .* home page:/b print
-     /^# General help using/b print
-     ' < "$progpath"
-    ret=$?
-    if test -z "$1"; then
-      exit $ret
-    fi
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
-    $opt_debug
-
-    func_error "missing argument for $1."
-    exit_cmd=exit
-}
-
-
-# func_split_short_opt shortopt
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
-{
-    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
-    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
-
-    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
-    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
-
-
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
-{
-    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
-    my_sed_long_arg='1s/^--[^=]*=//'
-
-    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
-    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
-
-exit_cmd=:
-
-
-
-
-
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
-
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-    eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
-
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
-    func_quote_for_eval "${2}"
-    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
-
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-    func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
-
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
-
-
-# func_lo2o object
-func_lo2o ()
-{
-    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
-
-
-# func_xform libobj-or-source
-func_xform ()
-{
-    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
-
-
-# func_fatal_configuration arg...
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
-    func_error ${1+"$@"}
-    func_error "See the $PACKAGE documentation for more information."
-    func_fatal_error "Fatal configuration error."
-}
-
-
-# func_config
-# Display the configuration for all the tags in this script.
-func_config ()
-{
-    re_begincf='^# ### BEGIN LIBTOOL'
-    re_endcf='^# ### END LIBTOOL'
-
-    # Default configuration.
-    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
-    # Now print the configurations for the tags.
-    for tagname in $taglist; do
-      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
-    done
-
-    exit $?
-}
-
-# func_features
-# Display the features supported by this script.
-func_features ()
-{
-    echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
-      echo "enable shared libraries"
-    else
-      echo "disable shared libraries"
-    fi
-    if test "$build_old_libs" = yes; then
-      echo "enable static libraries"
-    else
-      echo "disable static libraries"
-    fi
-
-    exit $?
-}
-
-# func_enable_tag tagname
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
-  # Global variable:
-  tagname="$1"
-
-  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-  sed_extractcf="/$re_begincf/,/$re_endcf/p"
-
-  # Validate tagname.
-  case $tagname in
-    *[!-_A-Za-z0-9,/]*)
-      func_fatal_error "invalid tag name: $tagname"
-      ;;
-  esac
-
-  # Don't test for the "default" C tag, as we know it's
-  # there but not specially marked.
-  case $tagname in
-    CC) ;;
-    *)
-      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	taglist="$taglist $tagname"
-
-	# Evaluate the configuration.  Be careful to quote the path
-	# and the sed script, to avoid splitting on whitespace, but
-	# also don't use non-portable quotes within backquotes within
-	# quotes we have to do it in 2 steps:
-	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	eval "$extractedcf"
-      else
-	func_error "ignoring unknown tag $tagname"
-      fi
-      ;;
-  esac
-}
-
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      else
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
-    fi
-
-    exit $EXIT_MISMATCH
-  fi
-}
-
-
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
-  shift; set dummy --mode clean ${1+"$@"}; shift
-  ;;
-compile|compil|compi|comp|com|co|c)
-  shift; set dummy --mode compile ${1+"$@"}; shift
-  ;;
-execute|execut|execu|exec|exe|ex|e)
-  shift; set dummy --mode execute ${1+"$@"}; shift
-  ;;
-finish|finis|fini|fin|fi|f)
-  shift; set dummy --mode finish ${1+"$@"}; shift
-  ;;
-install|instal|insta|inst|ins|in|i)
-  shift; set dummy --mode install ${1+"$@"}; shift
-  ;;
-link|lin|li|l)
-  shift; set dummy --mode link ${1+"$@"}; shift
-  ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-  shift; set dummy --mode uninstall ${1+"$@"}; shift
-  ;;
-esac
-
-
-
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
-
-
-# Parse options once, thoroughly.  This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
-{
-  # this just eases exit handling
-  while test $# -gt 0; do
-    opt="$1"
-    shift
-    case $opt in
-      --debug|-x)	opt_debug='set -x'
-			func_echo "enabling shell trace mode"
-			$opt_debug
-			;;
-      --dry-run|--dryrun|-n)
-			opt_dry_run=:
-			;;
-      --config)
-			opt_config=:
-func_config
-			;;
-      --dlopen|-dlopen)
-			optarg="$1"
-			opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
-			shift
-			;;
-      --preserve-dup-deps)
-			opt_preserve_dup_deps=:
-			;;
-      --features)
-			opt_features=:
-func_features
-			;;
-      --finish)
-			opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
-			;;
-      --help)
-			opt_help=:
-			;;
-      --help-all)
-			opt_help_all=:
-opt_help=': help-all'
-			;;
-      --mode)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_mode="$optarg"
-case $optarg in
-  # Valid mode arguments:
-  clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-  # Catch anything else as an error
-  *) func_error "invalid argument for $opt"
-     exit_cmd=exit
-     break
-     ;;
-esac
-			shift
-			;;
-      --no-silent|--no-quiet)
-			opt_silent=false
-func_append preserve_args " $opt"
-			;;
-      --no-warning|--no-warn)
-			opt_warning=false
-func_append preserve_args " $opt"
-			;;
-      --no-verbose)
-			opt_verbose=false
-func_append preserve_args " $opt"
-			;;
-      --silent|--quiet)
-			opt_silent=:
-func_append preserve_args " $opt"
-        opt_verbose=false
-			;;
-      --verbose|-v)
-			opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
-			;;
-      --tag)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
-			shift
-			;;
-
-      -\?|-h)		func_usage				;;
-      --help)		func_help				;;
-      --version)	func_version				;;
-
-      # Separate optargs to long options:
-      --*=*)
-			func_split_long_opt "$opt"
-			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      # Separate non-argument short options:
-      -\?*|-h*|-n*|-v*)
-			func_split_short_opt "$opt"
-			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      --)		break					;;
-      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
-      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
-    esac
-  done
-
-  # Validate options:
-
-  # save first non-option argument
-  if test "$#" -gt 0; then
-    nonopt="$opt"
-    shift
-  fi
-
-  # preserve --debug
-  test "$opt_debug" = : || func_append preserve_args " --debug"
-
-  case $host in
-    *cygwin* | *mingw* | *pw32* | *cegcc*)
-      # don't eliminate duplications in $postdeps and $predeps
-      opt_duplicate_compiler_generated_deps=:
-      ;;
-    *)
-      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-      ;;
-  esac
-
-  $opt_help || {
-    # Sanity checks first:
-    func_check_version_match
-
-    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-      func_fatal_configuration "not configured to build any kind of library"
-    fi
-
-    # Darwin sucks
-    eval std_shrext=\"$shrext_cmds\"
-
-    # Only execute mode is allowed to have -dlopen flags.
-    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
-      func_error "unrecognized option \`-dlopen'"
-      $ECHO "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    # Change the help message to a mode-specific one.
-    generic_help="$help"
-    help="Try \`$progname --help --mode=$opt_mode' for more information."
-  }
-
-
-  # Bail if the options were screwed
-  $exit_cmd $EXIT_FAILURE
-}
-
-
-
-
-## ----------- ##
-##    Main.    ##
-## ----------- ##
-
-# func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
-    test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null \
-        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs.  To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if `file' does not exist.
-func_lalib_unsafe_p ()
-{
-    lalib_p=no
-    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
-	for lalib_p_l in 1 2 3 4
-	do
-	    read lalib_p_line
-	    case "$lalib_p_line" in
-		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
-	    esac
-	done
-	exec 0<&5 5<&-
-    fi
-    test "$lalib_p" = yes
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
-    func_lalib_p "$1"
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
-    func_ltwrapper_exec_suffix=
-    case $1 in
-    *.exe) ;;
-    *) func_ltwrapper_exec_suffix=.exe ;;
-    esac
-    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
-    func_dirname_and_basename "$1" "" "."
-    func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
-    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
-    $opt_debug
-    save_ifs=$IFS; IFS='~'
-    for cmd in $1; do
-      IFS=$save_ifs
-      eval cmd=\"$cmd\"
-      func_show_eval "$cmd" "${2-:}"
-    done
-    IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
-    $opt_debug
-    case $1 in
-    */* | *\\*)	. "$1" ;;
-    *)		. "./$1" ;;
-    esac
-}
-
-
-# func_resolve_sysroot PATH
-# Replace a leading = in PATH with a sysroot.  Store the result into
-# func_resolve_sysroot_result
-func_resolve_sysroot ()
-{
-  func_resolve_sysroot_result=$1
-  case $func_resolve_sysroot_result in
-  =*)
-    func_stripname '=' '' "$func_resolve_sysroot_result"
-    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
-    ;;
-  esac
-}
-
-# func_replace_sysroot PATH
-# If PATH begins with the sysroot, replace it with = and
-# store the result into func_replace_sysroot_result.
-func_replace_sysroot ()
-{
-  case "$lt_sysroot:$1" in
-  ?*:"$lt_sysroot"*)
-    func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result="=$func_stripname_result"
-    ;;
-  *)
-    # Including no sysroot.
-    func_replace_sysroot_result=$1
-    ;;
-  esac
-}
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
-    $opt_debug
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-	func_append_quoted CC_quoted "$arg"
-      done
-      CC_expanded=`func_echo_all $CC`
-      CC_quoted_expanded=`func_echo_all $CC_quoted`
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-	for z in $available_tags; do
-	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
-	    CC_quoted=
-	    for arg in $CC; do
-	      # Double-quote args containing other shell metacharacters.
-	      func_append_quoted CC_quoted "$arg"
-	    done
-	    CC_expanded=`func_echo_all $CC`
-	    CC_quoted_expanded=`func_echo_all $CC_quoted`
-	    case "$@ " in
-	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with \`--tag'"
-#	else
-#	  func_verbose "using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
-{
-    write_libobj=${1}
-    if test "$build_libtool_libs" = yes; then
-      write_lobj=\'${2}\'
-    else
-      write_lobj=none
-    fi
-
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
-    else
-      write_oldobj=none
-    fi
-
-    $opt_dry_run || {
-      cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
-      $MV "${write_libobj}T" "${write_libobj}"
-    }
-}
-
-
-##################################################
-# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-##################################################
-
-# func_convert_core_file_wine_to_w32 ARG
-# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-# correctly configured wine environment available, with the winepath program
-# in $build's $PATH.
-#
-# ARG is the $build file name to be converted to w32 format.
-# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-# be empty on error (or when ARG is empty)
-func_convert_core_file_wine_to_w32 ()
-{
-  $opt_debug
-  func_convert_core_file_wine_to_w32_result="$1"
-  if test -n "$1"; then
-    # Unfortunately, winepath does not exit with a non-zero error code, so we
-    # are forced to check the contents of stdout. On the other hand, if the
-    # command is not found, the shell will set an exit code of 127 and print
-    # *an error message* to stdout. So we must check for both error code of
-    # zero AND non-empty stdout, which explains the odd construction:
-    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
-      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$lt_sed_naive_backslashify"`
-    else
-      func_convert_core_file_wine_to_w32_result=
-    fi
-  fi
-}
-# end: func_convert_core_file_wine_to_w32
-
-
-# func_convert_core_path_wine_to_w32 ARG
-# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
-#
-# ARG is path to be converted from $build format to win32.
-# Result is available in $func_convert_core_path_wine_to_w32_result.
-# Unconvertible file (directory) names in ARG are skipped; if no directory names
-# are convertible, then the result may be empty.
-func_convert_core_path_wine_to_w32 ()
-{
-  $opt_debug
-  # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=""
-  if test -n "$1"; then
-    oldIFS=$IFS
-    IFS=:
-    for func_convert_core_path_wine_to_w32_f in $1; do
-      IFS=$oldIFS
-      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
-        if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
-        else
-          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
-        fi
-      fi
-    done
-    IFS=$oldIFS
-  fi
-}
-# end: func_convert_core_path_wine_to_w32
-
-
-# func_cygpath ARGS...
-# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-# (2), returns the Cygwin file name or path in func_cygpath_result (input
-# file name or path is assumed to be in w32 format, as previously converted
-# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-# or path in func_cygpath_result (input file name or path is assumed to be in
-# Cygwin format). Returns an empty string on error.
-#
-# ARGS are passed to cygpath, with the last one being the file name or path to
-# be converted.
-#
-# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-# environment variable; do not put it in $PATH.
-func_cygpath ()
-{
-  $opt_debug
-  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
-    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
-    if test "$?" -ne 0; then
-      # on failure, ensure result is empty
-      func_cygpath_result=
-    fi
-  else
-    func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
-  fi
-}
-#end: func_cygpath
-
-
-# func_convert_core_msys_to_w32 ARG
-# Convert file name or path ARG from MSYS format to w32 format.  Return
-# result in func_convert_core_msys_to_w32_result.
-func_convert_core_msys_to_w32 ()
-{
-  $opt_debug
-  # awkward: cmd appends spaces to result
-  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
-}
-#end: func_convert_core_msys_to_w32
-
-
-# func_convert_file_check ARG1 ARG2
-# Verify that ARG1 (a file name in $build format) was converted to $host
-# format in ARG2. Otherwise, emit an error message, but continue (resetting
-# func_to_host_file_result to ARG1).
-func_convert_file_check ()
-{
-  $opt_debug
-  if test -z "$2" && test -n "$1" ; then
-    func_error "Could not determine host file name corresponding to"
-    func_error "  \`$1'"
-    func_error "Continuing, but uninstalled executables may not work."
-    # Fallback:
-    func_to_host_file_result="$1"
-  fi
-}
-# end func_convert_file_check
-
-
-# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-# Verify that FROM_PATH (a path in $build format) was converted to $host
-# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-# func_to_host_file_result to a simplistic fallback value (see below).
-func_convert_path_check ()
-{
-  $opt_debug
-  if test -z "$4" && test -n "$3"; then
-    func_error "Could not determine the host path corresponding to"
-    func_error "  \`$3'"
-    func_error "Continuing, but uninstalled executables may not work."
-    # Fallback.  This is a deliberately simplistic "conversion" and
-    # should not be "improved".  See libtool.info.
-    if test "x$1" != "x$2"; then
-      lt_replace_pathsep_chars="s|$1|$2|g"
-      func_to_host_path_result=`echo "$3" |
-        $SED -e "$lt_replace_pathsep_chars"`
-    else
-      func_to_host_path_result="$3"
-    fi
-  fi
-}
-# end func_convert_path_check
-
-
-# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-# and appending REPL if ORIG matches BACKPAT.
-func_convert_path_front_back_pathsep ()
-{
-  $opt_debug
-  case $4 in
-  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
-    ;;
-  esac
-  case $4 in
-  $2 ) func_append func_to_host_path_result "$3"
-    ;;
-  esac
-}
-# end func_convert_path_front_back_pathsep
-
-
-##################################################
-# $build to $host FILE NAME CONVERSION FUNCTIONS #
-##################################################
-# invoked via `$to_host_file_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# Result will be available in $func_to_host_file_result.
-
-
-# func_to_host_file ARG
-# Converts the file name ARG from $build format to $host format. Return result
-# in func_to_host_file_result.
-func_to_host_file ()
-{
-  $opt_debug
-  $to_host_file_cmd "$1"
-}
-# end func_to_host_file
-
-
-# func_to_tool_file ARG LAZY
-# converts the file name ARG from $build format to toolchain format. Return
-# result in func_to_tool_file_result.  If the conversion in use is listed
-# in (the comma separated) LAZY, no conversion takes place.
-func_to_tool_file ()
-{
-  $opt_debug
-  case ,$2, in
-    *,"$to_tool_file_cmd",*)
-      func_to_tool_file_result=$1
-      ;;
-    *)
-      $to_tool_file_cmd "$1"
-      func_to_tool_file_result=$func_to_host_file_result
-      ;;
-  esac
-}
-# end func_to_tool_file
-
-
-# func_convert_file_noop ARG
-# Copy ARG to func_to_host_file_result.
-func_convert_file_noop ()
-{
-  func_to_host_file_result="$1"
-}
-# end func_convert_file_noop
-
-
-# func_convert_file_msys_to_w32 ARG
-# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_file_result.
-func_convert_file_msys_to_w32 ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_w32
-
-
-# func_convert_file_cygwin_to_w32 ARG
-# Convert file name ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_file_cygwin_to_w32 ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
-    # LT_CYGPATH in this case.
-    func_to_host_file_result=`cygpath -m "$1"`
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_cygwin_to_w32
-
-
-# func_convert_file_nix_to_w32 ARG
-# Convert file name ARG from *nix to w32 format.  Requires a wine environment
-# and a working winepath. Returns result in func_to_host_file_result.
-func_convert_file_nix_to_w32 ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_w32
-
-
-# func_convert_file_msys_to_cygwin ARG
-# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_file_msys_to_cygwin ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    func_convert_core_msys_to_w32 "$1"
-    func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_cygwin
-
-
-# func_convert_file_nix_to_cygwin ARG
-# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
-# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
-# in func_to_host_file_result.
-func_convert_file_nix_to_cygwin ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
-    func_convert_core_file_wine_to_w32 "$1"
-    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_cygwin
-
-
-#############################################
-# $build to $host PATH CONVERSION FUNCTIONS #
-#############################################
-# invoked via `$to_host_path_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# The result will be available in $func_to_host_path_result.
-#
-# Path separators are also converted from $build format to $host format.  If
-# ARG begins or ends with a path separator character, it is preserved (but
-# converted to $host format) on output.
-#
-# All path conversion functions are named using the following convention:
-#   file name conversion function    : func_convert_file_X_to_Y ()
-#   path conversion function         : func_convert_path_X_to_Y ()
-# where, for any given $build/$host combination the 'X_to_Y' value is the
-# same.  If conversion functions are added for new $build/$host combinations,
-# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-# will break.
-
-
-# func_init_to_host_path_cmd
-# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-# appropriate value, based on the value of $to_host_file_cmd.
-to_host_path_cmd=
-func_init_to_host_path_cmd ()
-{
-  $opt_debug
-  if test -z "$to_host_path_cmd"; then
-    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd="func_convert_path_${func_stripname_result}"
-  fi
-}
-
-
-# func_to_host_path ARG
-# Converts the path ARG from $build format to $host format. Return result
-# in func_to_host_path_result.
-func_to_host_path ()
-{
-  $opt_debug
-  func_init_to_host_path_cmd
-  $to_host_path_cmd "$1"
-}
-# end func_to_host_path
-
-
-# func_convert_path_noop ARG
-# Copy ARG to func_to_host_path_result.
-func_convert_path_noop ()
-{
-  func_to_host_path_result="$1"
-}
-# end func_convert_path_noop
-
-
-# func_convert_path_msys_to_w32 ARG
-# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_path_result.
-func_convert_path_msys_to_w32 ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # Remove leading and trailing path separator characters from ARG.  MSYS
-    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
-    # and winepath ignores them completely.
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_msys_to_w32
-
-
-# func_convert_path_cygwin_to_w32 ARG
-# Convert path ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_path_cygwin_to_w32 ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_cygwin_to_w32
-
-
-# func_convert_path_nix_to_w32 ARG
-# Convert path ARG from *nix to w32 format.  Requires a wine environment and
-# a working winepath.  Returns result in func_to_host_file_result.
-func_convert_path_nix_to_w32 ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_nix_to_w32
-
-
-# func_convert_path_msys_to_cygwin ARG
-# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_path_msys_to_cygwin ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
-    func_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_msys_to_cygwin
-
-
-# func_convert_path_nix_to_cygwin ARG
-# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
-# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
-# func_to_host_file_result.
-func_convert_path_nix_to_cygwin ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # Remove leading and trailing path separator characters from
-    # ARG. msys behavior is inconsistent here, cygpath turns them
-    # into '.;' and ';.', and winepath ignores them completely.
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
-    func_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_nix_to_cygwin
-
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
-    $opt_debug
-    # Get the compilation command and the source file.
-    base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
-    suppress_opt=yes
-    suppress_output=
-    arg_mode=normal
-    libobj=
-    later=
-    pie_flag=
-
-    for arg
-    do
-      case $arg_mode in
-      arg  )
-	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
-	arg_mode=normal
-	;;
-
-      target )
-	libobj="$arg"
-	arg_mode=normal
-	continue
-	;;
-
-      normal )
-	# Accept any command-line options.
-	case $arg in
-	-o)
-	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
-	  arg_mode=target
-	  continue
-	  ;;
-
-	-pie | -fpie | -fPIE)
-          func_append pie_flag " $arg"
-	  continue
-	  ;;
-
-	-shared | -static | -prefer-pic | -prefer-non-pic)
-	  func_append later " $arg"
-	  continue
-	  ;;
-
-	-no-suppress)
-	  suppress_opt=no
-	  continue
-	  ;;
-
-	-Xcompiler)
-	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
-	  continue      #  The current "srcfile" will either be retained or
-	  ;;            #  replaced later.  I would guess that would be a bug.
-
-	-Wc,*)
-	  func_stripname '-Wc,' '' "$arg"
-	  args=$func_stripname_result
-	  lastarg=
-	  save_ifs="$IFS"; IFS=','
-	  for arg in $args; do
-	    IFS="$save_ifs"
-	    func_append_quoted lastarg "$arg"
-	  done
-	  IFS="$save_ifs"
-	  func_stripname ' ' '' "$lastarg"
-	  lastarg=$func_stripname_result
-
-	  # Add the arguments to base_compile.
-	  func_append base_compile " $lastarg"
-	  continue
-	  ;;
-
-	*)
-	  # Accept the current argument as the source file.
-	  # The previous "srcfile" becomes the current argument.
-	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
-	  ;;
-	esac  #  case $arg
-	;;
-      esac    #  case $arg_mode
-
-      # Aesthetically quote the previous argument.
-      func_append_quoted base_compile "$lastarg"
-    done # for arg
-
-    case $arg_mode in
-    arg)
-      func_fatal_error "you must specify an argument for -Xcompile"
-      ;;
-    target)
-      func_fatal_error "you must specify a target with \`-o'"
-      ;;
-    *)
-      # Get the name of the library object.
-      test -z "$libobj" && {
-	func_basename "$srcfile"
-	libobj="$func_basename_result"
-      }
-      ;;
-    esac
-
-    # Recognize several different file suffixes.
-    # If the user specifies -o file.o, it is replaced with file.lo
-    case $libobj in
-    *.[cCFSifmso] | \
-    *.ada | *.adb | *.ads | *.asm | \
-    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
-      func_xform "$libobj"
-      libobj=$func_xform_result
-      ;;
-    esac
-
-    case $libobj in
-    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
-    *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
-      ;;
-    esac
-
-    func_infer_tag $base_compile
-
-    for arg in $later; do
-      case $arg in
-      -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
-	build_old_libs=no
-	continue
-	;;
-
-      -static)
-	build_libtool_libs=no
-	build_old_libs=yes
-	continue
-	;;
-
-      -prefer-pic)
-	pic_mode=yes
-	continue
-	;;
-
-      -prefer-non-pic)
-	pic_mode=no
-	continue
-	;;
-      esac
-    done
-
-    func_quote_for_eval "$libobj"
-    test "X$libobj" != "X$func_quote_for_eval_result" \
-      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name \`$libobj' may not contain shell special characters."
-    func_dirname_and_basename "$obj" "/" ""
-    objname="$func_basename_result"
-    xdir="$func_dirname_result"
-    lobj=${xdir}$objdir/$objname
-
-    test -z "$base_compile" && \
-      func_fatal_help "you must specify a compilation command"
-
-    # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
-      removelist="$obj $lobj $libobj ${libobj}T"
-    else
-      removelist="$lobj $libobj ${libobj}T"
-    fi
-
-    # On Cygwin there's no "real" PIC flag so we must build both object types
-    case $host_os in
-    cygwin* | mingw* | pw32* | os2* | cegcc*)
-      pic_mode=default
-      ;;
-    esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
-      # non-PIC code in shared libraries is not supported
-      pic_mode=default
-    fi
-
-    # Calculate the filename of the output object if compiler does
-    # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
-    else
-      output_obj=
-      need_locks=no
-      lockfile=
-    fi
-
-    # Lock this critical section if it is needed
-    # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
-      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-	func_echo "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    elif test "$need_locks" = warn; then
-      if test -f "$lockfile"; then
-	$ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-      func_append removelist " $output_obj"
-      $ECHO "$srcfile" > "$lockfile"
-    fi
-
-    $opt_dry_run || $RM $removelist
-    func_append removelist " $lockfile"
-    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
-    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
-    srcfile=$func_to_tool_file_result
-    func_quote_for_eval "$srcfile"
-    qsrcfile=$func_quote_for_eval_result
-
-    # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
-      # Without this assignment, base_compile gets emptied.
-      fbsd_hideous_sh_bug=$base_compile
-
-      if test "$pic_mode" != no; then
-	command="$base_compile $qsrcfile $pic_flag"
-      else
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      fi
-
-      func_mkdir_p "$xdir$objdir"
-
-      if test -z "$output_obj"; then
-	# Place PIC objects in $objdir
-	func_append command " -o $lobj"
-      fi
-
-      func_show_eval_locale "$command"	\
-          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
-
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed, then go on to compile the next one
-      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	func_show_eval '$MV "$output_obj" "$lobj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-
-      # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
-	suppress_output=' >/dev/null 2>&1'
-      fi
-    fi
-
-    # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
-	# Don't build PIC code
-	command="$base_compile $qsrcfile$pie_flag"
-      else
-	command="$base_compile $qsrcfile $pic_flag"
-      fi
-      if test "$compiler_c_o" = yes; then
-	func_append command " -o $obj"
-      fi
-
-      # Suppress compiler output if we already did a PIC compilation.
-      func_append command "$suppress_output"
-      func_show_eval_locale "$command" \
-        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed
-      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	func_show_eval '$MV "$output_obj" "$obj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-    fi
-
-    $opt_dry_run || {
-      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
-      # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
-	removelist=$lockfile
-        $RM "$lockfile"
-      fi
-    }
-
-    exit $EXIT_SUCCESS
-}
-
-$opt_help || {
-  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
-    # We need to display help for each of the modes.
-    case $opt_mode in
-      "")
-        # Generic help is extracted from the usage comments
-        # at the start of this file.
-        func_help
-        ;;
-
-      clean)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      compile)
-      $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -no-suppress      do not suppress compiler output for multiple passes
-  -prefer-pic       try to build PIC objects only
-  -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a \`.o' file suitable for static linking
-  -static           only build a \`.o' file suitable for static linking
-  -Wc,FLAG          pass FLAG directly to the compiler
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
-        ;;
-
-      execute)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-        ;;
-
-      finish)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
-        ;;
-
-      install)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
-  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-        ;;
-
-      link)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -avoid-version    do not add a version suffix if possible
-  -bindir BINDIR    specify path to binaries directory (for systems where
-                    libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -export-symbols SYMFILE
-                    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-                    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -no-install       link a not-installable executable
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -shared           only do dynamic linking of libtool libraries
-  -shrext SUFFIX    override the standard shared library file extension
-  -static           do not do any dynamic linking of uninstalled libtool libraries
-  -static-libtool-libs
-                    do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-  -weak LIBNAME     declare that the target provides the LIBNAME interface
-  -Wc,FLAG
-  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
-  -Wl,FLAG
-  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
-  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
-        ;;
-
-      uninstall)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      *)
-        func_fatal_help "invalid operation mode \`$opt_mode'"
-        ;;
-    esac
-
-    echo
-    $ECHO "Try \`$progname --help' for more information about other modes."
-}
-
-# Now that we've collected a possible --mode arg, show help if necessary
-if $opt_help; then
-  if test "$opt_help" = :; then
-    func_mode_help
-  else
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	func_mode_help
-      done
-    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	echo
-	func_mode_help
-      done
-    } |
-    sed '1d
-      /^When reporting/,/^Report/{
-	H
-	d
-      }
-      $x
-      /information about other modes/d
-      /more detailed .*MODE/d
-      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
-  fi
-  exit $?
-fi
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
-    $opt_debug
-    # The first argument is the command name.
-    cmd="$nonopt"
-    test -z "$cmd" && \
-      func_fatal_help "you must specify a COMMAND"
-
-    # Handle -dlopen flags immediately.
-    for file in $opt_dlopen; do
-      test -f "$file" \
-	|| func_fatal_help "\`$file' is not a file"
-
-      dir=
-      case $file in
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$lib' is not a valid libtool archive"
-
-	# Read the libtool library.
-	dlname=
-	library_names=
-	func_source "$file"
-
-	# Skip this library if it cannot be dlopened.
-	if test -z "$dlname"; then
-	  # Warn if it was a shared library.
-	  test -n "$library_names" && \
-	    func_warning "\`$file' was not linked with \`-export-dynamic'"
-	  continue
-	fi
-
-	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
-
-	if test -f "$dir/$objdir/$dlname"; then
-	  func_append dir "/$objdir"
-	else
-	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
-	  fi
-	fi
-	;;
-
-      *.lo)
-	# Just add the directory containing the .lo file.
-	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
-	;;
-
-      *)
-	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
-	continue
-	;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -* | *.la | *.lo ) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if func_ltwrapper_script_p "$file"; then
-	  func_source "$file"
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	elif func_ltwrapper_executable_p "$file"; then
-	  func_ltwrapper_scriptname "$file"
-	  func_source "$func_ltwrapper_scriptname_result"
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      func_append_quoted args "$file"
-    done
-
-    if test "X$opt_dry_run" = Xfalse; then
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
-
-      # Restore saved environment variables
-      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-      do
-	eval "if test \"\${save_$lt_var+set}\" = set; then
-                $lt_var=\$save_$lt_var; export $lt_var
-	      else
-		$lt_unset $lt_var
-	      fi"
-      done
-
-      # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
-    fi
-}
-
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
-    $opt_debug
-    libs=
-    libdirs=
-    admincmds=
-
-    for opt in "$nonopt" ${1+"$@"}
-    do
-      if test -d "$opt"; then
-	func_append libdirs " $opt"
-
-      elif test -f "$opt"; then
-	if func_lalib_unsafe_p "$opt"; then
-	  func_append libs " $opt"
-	else
-	  func_warning "\`$opt' is not a valid libtool archive"
-	fi
-
-      else
-	func_fatal_error "invalid argument \`$opt'"
-      fi
-    done
-
-    if test -n "$libs"; then
-      if test -n "$lt_sysroot"; then
-        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
-        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
-      else
-        sysroot_cmd=
-      fi
-
-      # Remove sysroot references
-      if $opt_dry_run; then
-        for lib in $libs; do
-          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
-        done
-      else
-        tmpdir=`func_mktempdir`
-        for lib in $libs; do
-	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
-	    > $tmpdir/tmp-la
-	  mv -f $tmpdir/tmp-la $lib
-	done
-        ${RM}r "$tmpdir"
-      fi
-    fi
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $opt_dry_run || eval "$cmds" || func_append admincmds "
-       $cmds"
-	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      echo "----------------------------------------------------------------------"
-      echo "Libraries have been installed in:"
-      for libdir in $libdirs; do
-	$ECHO "   $libdir"
-      done
-      echo
-      echo "If you ever happen to want to link against installed libraries"
-      echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
-      echo "flag during linking and do at least one of the following:"
-      if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-	echo "     during execution"
-      fi
-      if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
-	echo "     during linking"
-      fi
-      if test -n "$hardcode_libdir_flag_spec"; then
-	libdir=LIBDIR
-	eval flag=\"$hardcode_libdir_flag_spec\"
-
-	$ECHO "   - use the \`$flag' linker flag"
-      fi
-      if test -n "$admincmds"; then
-	$ECHO "   - have your system administrator run these commands:$admincmds"
-      fi
-      if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-      fi
-      echo
-
-      echo "See any operating system documentation about shared libraries for"
-      case $host in
-	solaris2.[6789]|solaris2.1[0-9])
-	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
-	  echo "pages."
-	  ;;
-	*)
-	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
-	  ;;
-      esac
-      echo "----------------------------------------------------------------------"
-    fi
-    exit $EXIT_SUCCESS
-}
-
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
-    $opt_debug
-    # There may be an optional sh(1) argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
-       # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac; then
-      # Aesthetically quote it.
-      func_quote_for_eval "$nonopt"
-      install_prog="$func_quote_for_eval_result "
-      arg=$1
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    func_quote_for_eval "$arg"
-    func_append install_prog "$func_quote_for_eval_result"
-    install_shared_prog=$install_prog
-    case " $install_prog " in
-      *[\\\ /]cp\ *) install_cp=: ;;
-      *) install_cp=false ;;
-    esac
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=no
-    stripme=
-    no_mode=:
-    for arg
-    do
-      arg2=
-      if test -n "$dest"; then
-	func_append files " $dest"
-	dest=$arg
-	continue
-      fi
-
-      case $arg in
-      -d) isdir=yes ;;
-      -f)
-	if $install_cp; then :; else
-	  prev=$arg
-	fi
-	;;
-      -g | -m | -o)
-	prev=$arg
-	;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
-	;;
-      *)
-	# If the previous option needed an argument, then skip it.
-	if test -n "$prev"; then
-	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
-	    arg2=$install_override_mode
-	    no_mode=false
-	  fi
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
-	;;
-      esac
-
-      # Aesthetically quote the argument.
-      func_quote_for_eval "$arg"
-      func_append install_prog " $func_quote_for_eval_result"
-      if test -n "$arg2"; then
-	func_quote_for_eval "$arg2"
-      fi
-      func_append install_shared_prog " $func_quote_for_eval_result"
-    done
-
-    test -z "$install_prog" && \
-      func_fatal_help "you must specify an install program"
-
-    test -n "$prev" && \
-      func_fatal_help "the \`$prev' option requires an argument"
-
-    if test -n "$install_override_mode" && $no_mode; then
-      if $install_cp; then :; else
-	func_quote_for_eval "$install_override_mode"
-	func_append install_shared_prog " -m $func_quote_for_eval_result"
-      fi
-    fi
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	func_fatal_help "no file or destination specified"
-      else
-	func_fatal_help "you must specify a destination"
-      fi
-    fi
-
-    # Strip any trailing slash from the destination.
-    func_stripname '' '/' "$dest"
-    dest=$func_stripname_result
-
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
-      destname=
-    else
-      func_dirname_and_basename "$dest" "" "."
-      destdir="$func_dirname_result"
-      destname="$func_basename_result"
-
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files; shift
-      test "$#" -gt 1 && \
-	func_fatal_help "\`$dest' is not a directory"
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
-	  ;;
-	esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	func_append staticlibs " $file"
-	;;
-
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$file' is not a valid libtool archive"
-
-	library_names=
-	old_library=
-	relink_command=
-	func_source "$file"
-
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
-	  *" $libdir "*) ;;
-	  *) func_append current_libdirs " $libdir" ;;
-	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
-	  *" $libdir "*) ;;
-	  *) func_append future_libdirs " $libdir" ;;
-	  esac
-	fi
-
-	func_dirname "$file" "/" ""
-	dir="$func_dirname_result"
-	func_append dir "$objdir"
-
-	if test -n "$relink_command"; then
-	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # are installed into $libdir/../bin (currently, that works fine)
-	  # but it's something to keep an eye on.
-	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
-	  else
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
-	  fi
-
-	  func_warning "relinking \`$file'"
-	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
-	fi
-
-	# See the names of the shared library.
-	set dummy $library_names; shift
-	if test -n "$1"; then
-	  realname="$1"
-	  shift
-
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
-
-	  # Install the shared library and build the symlinks.
-	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
-	      'exit $?'
-	  tstripme="$stripme"
-	  case $host_os in
-	  cygwin* | mingw* | pw32* | cegcc*)
-	    case $realname in
-	    *.dll.a)
-	      tstripme=""
-	      ;;
-	    esac
-	    ;;
-	  esac
-	  if test -n "$tstripme" && test -n "$striplib"; then
-	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
-	  fi
-
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
-	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
-	    # so we also need to try rm && ln -s.
-	    for linkname
-	    do
-	      test "$linkname" != "$realname" \
-		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
-	    done
-	  fi
-
-	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
-	  func_execute_cmds "$postinstall_cmds" 'exit $?'
-	fi
-
-	# Install the pseudo-library for information purposes.
-	func_basename "$file"
-	name="$func_basename_result"
-	instname="$dir/$name"i
-	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
-	# Maybe install the static library, too.
-	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
-	;;
-
-      *.lo)
-	# Install (i.e. copy) a libtool object.
-
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
-	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  func_lo2o "$destfile"
-	  staticdest=$func_lo2o_result
-	  ;;
-	*.$objext)
-	  staticdest="$destfile"
-	  destfile=
-	  ;;
-	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	test -n "$destfile" && \
-	  func_show_eval "$install_prog $file $destfile" 'exit $?'
-
-	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
-	  # Deduce the name of the old-style object file.
-	  func_lo2o "$file"
-	  staticobj=$func_lo2o_result
-	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
-	fi
-	exit $EXIT_SUCCESS
-	;;
-
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
-	fi
-
-	# If the file is missing, and there is a .exe on the end, strip it
-	# because it is most likely a libtool script we actually want to
-	# install
-	stripped_ext=""
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      func_stripname '' '.exe' "$file"
-	      file=$func_stripname_result
-	      stripped_ext=".exe"
-	    fi
-	    ;;
-	esac
-
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin* | *mingw*)
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      wrapper=$func_ltwrapper_scriptname_result
-	    else
-	      func_stripname '' '.exe' "$file"
-	      wrapper=$func_stripname_result
-	    fi
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if func_ltwrapper_script_p "$wrapper"; then
-	  notinst_deplibs=
-	  relink_command=
-
-	  func_source "$wrapper"
-
-	  # Check the variables that should have been set.
-	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
-
-	  finalize=yes
-	  for lib in $notinst_deplibs; do
-	    # Check to see that each library is installed.
-	    libdir=
-	    if test -f "$lib"; then
-	      func_source "$lib"
-	    fi
-	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
-	    fi
-	  done
-
-	  relink_command=
-	  func_source "$wrapper"
-
-	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
-	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
-	        tmpdir=`func_mktempdir`
-		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
-	        # Replace the output file specification.
-	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
-
-	        $opt_silent || {
-	          func_quote_for_expand "$relink_command"
-		  eval "func_echo $func_quote_for_expand_result"
-	        }
-	        if eval "$relink_command"; then :
-	          else
-		  func_error "error: relink \`$file' with the above command before installing it"
-		  $opt_dry_run || ${RM}r "$tmpdir"
-		  continue
-	        fi
-	        file="$outputname"
-	      else
-	        func_warning "cannot relink \`$file'"
-	      fi
-	    }
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
-
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    func_stripname '' '.exe' "$destfile"
-	    destfile=$func_stripname_result
-	    ;;
-	  esac
-	  ;;
-	esac
-	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
-	$opt_dry_run || if test -n "$outputname"; then
-	  ${RM}r "$tmpdir"
-	fi
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      func_basename "$file"
-      name="$func_basename_result"
-
-      # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
-      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-      tool_oldlib=$func_to_tool_file_result
-
-      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
-      fi
-
-      # Do each command in the postinstall commands.
-      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
-    done
-
-    test -n "$future_libdirs" && \
-      func_warning "remember to run \`$progname --finish$future_libdirs'"
-
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
-    else
-      exit $EXIT_SUCCESS
-    fi
-}
-
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
-    $opt_debug
-    my_outputname="$1"
-    my_originator="$2"
-    my_pic_p="${3-no}"
-    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
-    my_dlsyms=
-
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-      if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
-      else
-	func_error "not configured to extract global symbols from dlpreopened files"
-      fi
-    fi
-
-    if test -n "$my_dlsyms"; then
-      case $my_dlsyms in
-      "") ;;
-      *.c)
-	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
-
-	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
-	# Parse the name list into a source file.
-	func_verbose "creating $output_objdir/$my_dlsyms"
-
-	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
-#endif
-
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data.  */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-/* External symbol declarations for the compiler. */\
-"
-
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
-
-	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
-	  # Add our own program objects to the symbol list.
-	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	  for progfile in $progfiles; do
-	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
-	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -n "$exclude_expsyms"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  if test -n "$export_symbols_regex"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  # Prepare the list of exported symbols
-	  if test -z "$export_symbols"; then
-	    export_symbols="$output_objdir/$outputname.exp"
-	    $opt_dry_run || {
-	      $RM $export_symbols
-	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-	      case $host in
-	      *cygwin* | *mingw* | *cegcc* )
-                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-	        ;;
-	      esac
-	    }
-	  else
-	    $opt_dry_run || {
-	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	      case $host in
-	        *cygwin* | *mingw* | *cegcc* )
-	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-	          ;;
-	      esac
-	    }
-	  fi
-	fi
-
-	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
-	  func_basename "$dlprefile"
-	  name="$func_basename_result"
-          case $host in
-	    *cygwin* | *mingw* | *cegcc* )
-	      # if an import library, we need to obtain dlname
-	      if func_win32_import_lib_p "$dlprefile"; then
-	        func_tr_sh "$dlprefile"
-	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=""
-	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
-	          # Use subshell, to avoid clobbering current variable values
-	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname" ; then
-	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename="$func_basename_result"
-	          else
-	            # no lafile. user explicitly requested -dlpreopen <import library>.
-	            $sharedlib_from_linklib_cmd "$dlprefile"
-	            dlprefile_dlbasename=$sharedlib_from_linklib_result
-	          fi
-	        fi
-	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename" ; then
-	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
-	          else
-	            func_warning "Could not compute DLL name from $name"
-	            eval '$ECHO ": $name " >> "$nlist"'
-	          fi
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
-	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
-	        }
-	      else # not an import lib
-	        $opt_dry_run || {
-	          eval '$ECHO ": $name " >> "$nlist"'
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	        }
-	      fi
-	    ;;
-	    *)
-	      $opt_dry_run || {
-	        eval '$ECHO ": $name " >> "$nlist"'
-	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	      }
-	    ;;
-          esac
-	done
-
-	$opt_dry_run || {
-	  # Make sure we have at least an empty file.
-	  test -f "$nlist" || : > "$nlist"
-
-	  if test -n "$exclude_expsyms"; then
-	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	    $MV "$nlist"T "$nlist"
-	  fi
-
-	  # Try sorting and uniquifying the output.
-	  if $GREP -v "^: " < "$nlist" |
-	      if sort -k 3 </dev/null >/dev/null 2>&1; then
-		sort -k 3
-	      else
-		sort +2
-	      fi |
-	      uniq > "$nlist"S; then
-	    :
-	  else
-	    $GREP -v "^: " < "$nlist" > "$nlist"S
-	  fi
-
-	  if test -f "$nlist"S; then
-	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
-	  else
-	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
-	  fi
-
-	  echo >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols.  */
-typedef struct {
-  const char *name;
-  void *address;
-} lt_dlsymlist;
-extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
-LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
-
-	  case $need_lib_prefix in
-	  no)
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  *)
-	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  esac
-	  echo >> "$output_objdir/$my_dlsyms" "\
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	} # !$opt_dry_run
-
-	pic_flag_for_symtable=
-	case "$compile_command " in
-	*" -static "*) ;;
-	*)
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
-	  *-*-hpux*)
-	    pic_flag_for_symtable=" $pic_flag"  ;;
-	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
-	    ;;
-	  esac
-	  ;;
-	esac
-	symtab_cflags=
-	for arg in $LTCFLAGS; do
-	  case $arg in
-	  -pie | -fpie | -fPIE) ;;
-	  *) func_append symtab_cflags " $arg" ;;
-	  esac
-	done
-
-	# Now compile the dynamic symbol file.
-	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
-	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
-
-	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
-	case $host in
-	*cygwin* | *mingw* | *cegcc* )
-	  if test -f "$output_objdir/$my_outputname.def"; then
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	  else
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  fi
-	  ;;
-	*)
-	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  ;;
-	esac
-	;;
-      *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
-	;;
-      esac
-    else
-      # We keep going just in case the user didn't refer to
-      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-      # really was required.
-
-      # Nullify the symbol file.
-      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
-      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
-    fi
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-# Despite the name, also deal with 64 bit binaries.
-func_win32_libid ()
-{
-  $opt_debug
-  win32_libid_type="unknown"
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      func_to_tool_file "$1" func_convert_file_msys_to_w32
-      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	$SED -n -e '
-	    1,100{
-		/ I /{
-		    s,.*,import,
-		    p
-		    q
-		}
-	    }'`
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
-    esac
-    ;;
-  esac
-  $ECHO "$win32_libid_type"
-}
-
-# func_cygming_dll_for_implib ARG
-#
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib ()
-{
-  $opt_debug
-  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-}
-
-# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-#
-# The is the core of a fallback implementation of a
-# platform-specific function to extract the name of the
-# DLL associated with the specified import library LIBNAME.
-#
-# SECTION_NAME is either .idata$6 or .idata$7, depending
-# on the platform and compiler that created the implib.
-#
-# Echos the name of the DLL associated with the
-# specified import library.
-func_cygming_dll_for_implib_fallback_core ()
-{
-  $opt_debug
-  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
-  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
-    $SED '/^Contents of section '"$match_literal"':/{
-      # Place marker at beginning of archive member dllname section
-      s/.*/====MARK====/
-      p
-      d
-    }
-    # These lines can sometimes be longer than 43 characters, but
-    # are always uninteresting
-    /:[	 ]*file format pe[i]\{,1\}-/d
-    /^In archive [^:]*:/d
-    # Ensure marker is printed
-    /^====MARK====/p
-    # Remove all lines with less than 43 characters
-    /^.\{43\}/!d
-    # From remaining lines, remove first 43 characters
-    s/^.\{43\}//' |
-    $SED -n '
-      # Join marker and all lines until next marker into a single line
-      /^====MARK====/ b para
-      H
-      $ b para
-      b
-      :para
-      x
-      s/\n//g
-      # Remove the marker
-      s/^====MARK====//
-      # Remove trailing dots and whitespace
-      s/[\. \t]*$//
-      # Print
-      /./p' |
-    # we now have a list, one entry per line, of the stringified
-    # contents of the appropriate section of all members of the
-    # archive which possess that section. Heuristic: eliminate
-    # all those which have a first or second character that is
-    # a '.' (that is, objdump's representation of an unprintable
-    # character.) This should work for all archives with less than
-    # 0x302f exports -- but will fail for DLLs whose name actually
-    # begins with a literal '.' or a single character followed by
-    # a '.'.
-    #
-    # Of those that remain, print the first one.
-    $SED -e '/^\./d;/^.\./d;q'
-}
-
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
-# func_cygming_dll_for_implib_fallback ARG
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-#
-# This fallback implementation is for use when $DLLTOOL
-# does not support the --identify-strict option.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib_fallback ()
-{
-  $opt_debug
-  if func_cygming_gnu_implib_p "$1" ; then
-    # binutils import library
-    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1" ; then
-    # ms-generated import library
-    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
-  else
-    # unknown
-    sharedlib_from_linklib_result=""
-  fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
-    $opt_debug
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-    if test "$lock_old_archive_extraction" = yes; then
-      lockfile=$f_ex_an_ar_oldlib.lock
-      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-	func_echo "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    fi
-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
-		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test "$lock_old_archive_extraction" = yes; then
-      $opt_dry_run || rm -f "$lockfile"
-    fi
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
-    fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
-    $opt_debug
-    my_gentop="$1"; shift
-    my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
-
-    for my_xlib in $my_oldlibs; do
-      # Extract the objects.
-      case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
-      my_xlib_u=$my_xlib
-      while :; do
-        case " $extracted_archives " in
-	*" $my_xlib_u "*)
-	  func_arith $extracted_serial + 1
-	  extracted_serial=$func_arith_result
-	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-	*) break ;;
-	esac
-      done
-      extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
-
-      func_mkdir_p "$my_xdir"
-
-      case $host in
-      *-darwin*)
-	func_verbose "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	$opt_dry_run || {
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
-	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
-	  if test -n "$darwin_arches"; then
-	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
-	    darwin_arch=
-	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
-	      cd "$darwin_curdir"
-	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
-	    done # $darwin_arches
-            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
-	    darwin_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
-	      $LIPO -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    $RM -rf unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd $darwin_orig_dir
-	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	} # !$opt_dry_run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-	;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
-    done
-
-    func_extract_archives_result="$my_oldobjs"
-}
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable.  Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory.  This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
-	func_emit_wrapper_arg1=${1-no}
-
-	$ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variables:
-  generated_by_libtool_version='$macro_version'
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$ECHO are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    file=\"\$0\""
-
-    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
-    $ECHO "\
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-    ECHO=\"$qECHO\"
-  fi
-
-# Very basic option parsing. These options are (a) specific to
-# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
-# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
-# this pattern).
-#
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
-#
-# The first argument to this parsing function should be the
-# script's $0 value, followed by "$@".
-lt_option_debug=
-func_parse_lt_options ()
-{
-  lt_script_arg0=\$0
-  shift
-  for lt_opt
-  do
-    case \"\$lt_opt\" in
-    --lt-debug) lt_option_debug=1 ;;
-    --lt-dump-script)
-        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
-        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
-        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
-        cat \"\$lt_dump_D/\$lt_dump_F\"
-        exit 0
-      ;;
-    --lt-*)
-        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
-        exit 1
-      ;;
-    esac
-  done
-
-  # Print the debug banner immediately:
-  if test -n \"\$lt_option_debug\"; then
-    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
-  fi
-}
-
-# Used when --lt-debug. Prints its arguments to stdout
-# (redirection is the responsibility of the caller)
-func_lt_dump_args ()
-{
-  lt_dump_args_N=1;
-  for lt_arg
-  do
-    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
-    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
-  done
-}
-
-# Core function for launching the target application
-func_exec_program_core ()
-{
-"
-  case $host in
-  # Backslashes separate directories on plain windows
-  *-*-mingw | *-*-os2* | *-cegcc*)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-    ;;
-
-  *)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-    ;;
-  esac
-  $ECHO "\
-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-      exit 1
-}
-
-# A function to encapsulate launching the target application
-# Strips options in the --lt-* namespace from \$@ and
-# launches target application with the remaining arguments.
-func_exec_program ()
-{
-  case \" \$* \" in
-  *\\ --lt-*)
-    for lt_wr_arg
-    do
-      case \$lt_wr_arg in
-      --lt-*) ;;
-      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-      esac
-      shift
-    done ;;
-  esac
-  func_exec_program_core \${1+\"\$@\"}
-}
-
-  # Parse options
-  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
-  done
-
-  # Usually 'no', except on cygwin/mingw when embedded into
-  # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
-  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
-    # special case for '.'
-    if test \"\$thisdir\" = \".\"; then
-      thisdir=\`pwd\`
-    fi
-    # remove .libs from thisdir
-    case \"\$thisdir\" in
-    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
-    $objdir )   thisdir=. ;;
-    esac
-  fi
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
-	if test "$fast_install" = yes; then
-	  $ECHO "\
-  program=lt-'$outputname'$exeext
-  progdir=\"\$thisdir/$objdir\"
-
-  if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
-    file=\"\$\$-\$program\"
-
-    if test ! -d \"\$progdir\"; then
-      $MKDIR \"\$progdir\"
-    else
-      $RM \"\$progdir/\$file\"
-    fi"
-
-	  $ECHO "\
-
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	$ECHO \"\$relink_command_output\" >&2
-	$RM \"\$progdir/\$file\"
-	exit 1
-      fi
-    fi
-
-    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $RM \"\$progdir/\$program\";
-      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $RM \"\$progdir/\$file\"
-  fi"
-	else
-	  $ECHO "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
-	fi
-
-	$ECHO "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# fixup the dll searchpath if we need to.
-	#
-	# Fix the DLL searchpath if we need to.  Do this before prepending
-	# to shlibpath, because on Windows, both are PATH and uninstalled
-	# libraries must come first.
-	if test -n "$dllsearchpath"; then
-	  $ECHO "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
-
-	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $ECHO "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
-
-    export $shlibpath_var
-"
-	fi
-
-	$ECHO "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-      func_exec_program \${1+\"\$@\"}
-    fi
-  else
-    # The program doesn't exist.
-    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
-    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
-    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit 1
-  fi
-fi\
-"
-}
-
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
-	cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-*/
-EOF
-	    cat <<"EOF"
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-#  include <io.h>
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-/* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
-# ifdef __STRICT_ANSI__
-int _putenv (const char *);
-# endif
-#elif defined(__CYGWIN__)
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
-/* #elif defined (other platforms) ... */
-#endif
-
-/* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
-# define setmode _setmode
-# define stat    _stat
-# define chmod   _chmod
-# define getcwd  _getcwd
-# define putenv  _putenv
-# define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-#  define _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#elif defined(__MINGW32__)
-# define setmode _setmode
-# define stat    _stat
-# define chmod   _chmod
-# define getcwd  _getcwd
-# define putenv  _putenv
-#elif defined(__CYGWIN__)
-# define HAVE_SETENV
-# define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
-#endif
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-/* path handling portability macros */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-#if defined(LT_DEBUGWRAPPER)
-static int lt_debug = 1;
-#else
-static int lt_debug = 0;
-#endif
-
-const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-void lt_fatal (const char *file, int line, const char *message, ...);
-static const char *nonnull (const char *s);
-static const char *nonempty (const char *s);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-char **prepare_spawn (char **argv);
-void lt_dump_script (FILE *f);
-EOF
-
-	    cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
-	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-              func_to_host_path "$temp_rpath"
-	      cat <<EOF
-const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * LIB_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test -n "$dllsearchpath"; then
-              func_to_host_path "$dllsearchpath:"
-	      cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test "$fast_install" = yes; then
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
-	    else
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
-	    fi
-
-
-	    cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX         "--lt-"
-
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
-
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int  newargc;
-  char *tmp_pathspec;
-  char *actual_cwrapper_path;
-  char *actual_cwrapper_name;
-  char *target_name;
-  char *lt_argv_zero;
-  intptr_t rval = 127;
-
-  int i;
-
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
-
-  /* very simple arg parsing; don't want to rely on getopt
-   * also, copy all non cwrapper options to newargz, except
-   * argz[0], which is handled differently
-   */
-  newargc=0;
-  for (i = 1; i < argc; i++)
-    {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
-	{
-EOF
-	    case "$host" in
-	      *mingw* | *cygwin* )
-		# make stdout use "unix" line endings
-		echo "          setmode(1,_O_BINARY);"
-		;;
-	      esac
-
-	    cat <<"EOF"
-	  lt_dump_script (stdout);
-	  return 0;
-	}
-      if (strcmp (argv[i], debug_opt) == 0)
-	{
-          lt_debug = 1;
-          continue;
-	}
-      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
-        {
-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-             namespace, but it is not one of the ones we know about and
-             have already dealt with, above (inluding dump-script), then
-             report an error. Otherwise, targets might begin to believe
-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-             namespace. The first time any user complains about this, we'll
-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-             or a configure.ac-settable value.
-           */
-          lt_fatal (__FILE__, __LINE__,
-		    "unrecognized %s option: '%s'",
-                    ltwrapper_option_prefix, argv[i]);
-        }
-      /* otherwise ... */
-      newargz[++newargc] = xstrdup (argv[i]);
-    }
-  newargz[++newargc] = NULL;
-
-EOF
-	    cat <<EOF
-  /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
-EOF
-	    cat <<"EOF"
-  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
-
-  tmp_pathspec = find_executable (argv[0]);
-  if (tmp_pathspec == NULL)
-    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (before symlink chase) at: %s\n",
-		  tmp_pathspec);
-
-  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (after symlink chase) at: %s\n",
-		  actual_cwrapper_path);
-  XFREE (tmp_pathspec);
-
-  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
-  strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
-  /* wrapper name transforms */
-  strendzap (actual_cwrapper_name, ".exe");
-  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
-  XFREE (actual_cwrapper_name);
-  actual_cwrapper_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  /* target_name transforms -- use actual target program name; might have lt- prefix */
-  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
-  strendzap (target_name, ".exe");
-  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
-  XFREE (target_name);
-  target_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(main) libtool target name: %s\n",
-		  target_name);
-EOF
-
-	    cat <<EOF
-  newargz[0] =
-    XMALLOC (char, (strlen (actual_cwrapper_path) +
-		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
-  strcpy (newargz[0], actual_cwrapper_path);
-  strcat (newargz[0], "$objdir");
-  strcat (newargz[0], "/");
-EOF
-
-	    cat <<"EOF"
-  /* stop here, and copy so we don't have to do this twice */
-  tmp_pathspec = xstrdup (newargz[0]);
-
-  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
-  strcat (newargz[0], actual_cwrapper_name);
-
-  /* DO want the lt- prefix here if it exists, so use target_name */
-  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
-  XFREE (tmp_pathspec);
-  tmp_pathspec = NULL;
-EOF
-
-	    case $host_os in
-	      mingw*)
-	    cat <<"EOF"
-  {
-    char* p;
-    while ((p = strchr (newargz[0], '\\')) != NULL)
-      {
-	*p = '/';
-      }
-    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
-      {
-	*p = '/';
-      }
-  }
-EOF
-	    ;;
-	    esac
-
-	    cat <<"EOF"
-  XFREE (target_name);
-  XFREE (actual_cwrapper_path);
-  XFREE (actual_cwrapper_name);
-
-  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
-  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
-  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
-     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
-     because on Windows, both *_VARNAMEs are PATH but uninstalled
-     libraries must come first. */
-  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-
-  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
-		  nonnull (lt_argv_zero));
-  for (i = 0; i < newargc; i++)
-    {
-      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
-		      i, nonnull (newargz[i]));
-    }
-
-EOF
-
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-  /* execv doesn't actually work on mingw as expected on unix */
-  newargz = prepare_spawn (newargz);
-  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
-  if (rval == -1)
-    {
-      /* failed to start process */
-      lt_debugprintf (__FILE__, __LINE__,
-		      "(main) failed to launch target \"%s\": %s\n",
-		      lt_argv_zero, nonnull (strerror (errno)));
-      return 127;
-    }
-  return rval;
-EOF
-		;;
-	      *)
-		cat <<"EOF"
-  execv (lt_argv_zero, newargz);
-  return rval; /* =127, but avoids unused variable warning */
-EOF
-		;;
-	    esac
-
-	    cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
-  void *p = (void *) malloc (num);
-  if (!p)
-    lt_fatal (__FILE__, __LINE__, "memory exhausted");
-
-  return p;
-}
-
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
-			  string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
-  const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
-    name += 2;
-#endif
-
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
-
-int
-check_executable (const char *path)
-{
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if ((stat (path, &st) >= 0)
-      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
-    return 1;
-  else
-    return 0;
-}
-
-int
-make_executable (const char *path)
-{
-  int rval = 0;
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if (stat (path, &st) >= 0)
-    {
-      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
-    }
-  return rval;
-}
-
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise
-   Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
-  int has_slash = 0;
-  const char *p;
-  const char *p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  int tmp_len;
-  char *concat_name;
-
-  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
-                  nonempty (wrapper));
-
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
-
-  /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable (concat_name))
-	return concat_name;
-      XFREE (concat_name);
-    }
-  else
-    {
-#endif
-      if (IS_DIR_SEPARATOR (wrapper[0]))
-	{
-	  concat_name = xstrdup (wrapper);
-	  if (check_executable (concat_name))
-	    return concat_name;
-	  XFREE (concat_name);
-	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-    }
-#endif
-
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-      {
-	has_slash = 1;
-	break;
-      }
-  if (!has_slash)
-    {
-      /* no slashes; search PATH */
-      const char *path = getenv ("PATH");
-      if (path != NULL)
-	{
-	  for (p = path; *p; p = p_next)
-	    {
-	      const char *q;
-	      size_t p_len;
-	      for (q = p; *q; q++)
-		if (IS_PATH_SEPARATOR (*q))
-		  break;
-	      p_len = q - p;
-	      p_next = (*q == '\0' ? q : q + 1);
-	      if (p_len == 0)
-		{
-		  /* empty path: current directory */
-		  if (getcwd (tmp, LT_PATHMAX) == NULL)
-		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-                              nonnull (strerror (errno)));
-		  tmp_len = strlen (tmp);
-		  concat_name =
-		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, tmp, tmp_len);
-		  concat_name[tmp_len] = '/';
-		  strcpy (concat_name + tmp_len + 1, wrapper);
-		}
-	      else
-		{
-		  concat_name =
-		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, p, p_len);
-		  concat_name[p_len] = '/';
-		  strcpy (concat_name + p_len + 1, wrapper);
-		}
-	      if (check_executable (concat_name))
-		return concat_name;
-	      XFREE (concat_name);
-	    }
-	}
-      /* not found in PATH; assume curdir */
-    }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-              nonnull (strerror (errno)));
-  tmp_len = strlen (tmp);
-  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
-
-  if (check_executable (concat_name))
-    return concat_name;
-  XFREE (concat_name);
-  return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
-  return xstrdup (pathspec);
-#else
-  char buf[LT_PATHMAX];
-  struct stat s;
-  char *tmp_pathspec = xstrdup (pathspec);
-  char *p;
-  int has_symlinks = 0;
-  while (strlen (tmp_pathspec) && !has_symlinks)
-    {
-      lt_debugprintf (__FILE__, __LINE__,
-		      "checking path component for symlinks: %s\n",
-		      tmp_pathspec);
-      if (lstat (tmp_pathspec, &s) == 0)
-	{
-	  if (S_ISLNK (s.st_mode) != 0)
-	    {
-	      has_symlinks = 1;
-	      break;
-	    }
-
-	  /* search backwards for last DIR_SEPARATOR */
-	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
-	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    p--;
-	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    {
-	      /* no more DIR_SEPARATORS left */
-	      break;
-	    }
-	  *p = '\0';
-	}
-      else
-	{
-	  lt_fatal (__FILE__, __LINE__,
-		    "error accessing file \"%s\": %s",
-		    tmp_pathspec, nonnull (strerror (errno)));
-	}
-    }
-  XFREE (tmp_pathspec);
-
-  if (!has_symlinks)
-    {
-      return xstrdup (pathspec);
-    }
-
-  tmp_pathspec = realpath (pathspec, buf);
-  if (tmp_pathspec == 0)
-    {
-      lt_fatal (__FILE__, __LINE__,
-		"could not follow symlinks for %s", pathspec);
-    }
-  return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
-  size_t len, patlen;
-
-  assert (str != NULL);
-  assert (pat != NULL);
-
-  len = strlen (str);
-  patlen = strlen (pat);
-
-  if (patlen <= len)
-    {
-      str += len - patlen;
-      if (strcmp (str, pat) == 0)
-	*str = '\0';
-    }
-  return str;
-}
-
-void
-lt_debugprintf (const char *file, int line, const char *fmt, ...)
-{
-  va_list args;
-  if (lt_debug)
-    {
-      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
-      va_start (args, fmt);
-      (void) vfprintf (stderr, fmt, args);
-      va_end (args);
-    }
-}
-
-static void
-lt_error_core (int exit_status, const char *file,
-	       int line, const char *mode,
-	       const char *message, va_list ap)
-{
-  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
-
-  if (exit_status >= 0)
-    exit (exit_status);
-}
-
-void
-lt_fatal (const char *file, int line, const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
-  va_end (ap);
-}
-
-static const char *
-nonnull (const char *s)
-{
-  return s ? s : "(null)";
-}
-
-static const char *
-nonempty (const char *s)
-{
-  return (s && !*s) ? "(empty)" : nonnull (s);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_setenv) setting '%s' to '%s'\n",
-                  nonnull (name), nonnull (value));
-  {
-#ifdef HAVE_SETENV
-    /* always make a copy, for consistency with !HAVE_SETENV */
-    char *str = xstrdup (value);
-    setenv (name, str, 1);
-#else
-    int len = strlen (name) + 1 + strlen (value) + 1;
-    char *str = XMALLOC (char, len);
-    sprintf (str, "%s=%s", name, value);
-    if (putenv (str) != EXIT_SUCCESS)
-      {
-        XFREE (str);
-      }
-#endif
-  }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
-  char *new_value;
-  if (orig_value && *orig_value)
-    {
-      int orig_value_len = strlen (orig_value);
-      int add_len = strlen (add);
-      new_value = XMALLOC (char, add_len + orig_value_len + 1);
-      if (to_end)
-        {
-          strcpy (new_value, orig_value);
-          strcpy (new_value + orig_value_len, add);
-        }
-      else
-        {
-          strcpy (new_value, add);
-          strcpy (new_value + add_len, orig_value);
-        }
-    }
-  else
-    {
-      new_value = xstrdup (add);
-    }
-  return new_value;
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      /* some systems can't cope with a ':'-terminated path #' */
-      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
-        {
-          new_value[len-1] = '\0';
-        }
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-EOF
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-
-/* Prepares an argument vector before calling spawn().
-   Note that spawn() does not by itself call the command interpreter
-     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
-      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-         GetVersionEx(&v);
-         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
-      }) ? "cmd.exe" : "command.com").
-   Instead it simply concatenates the arguments, separated by ' ', and calls
-   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
-   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
-   special way:
-   - Space and tab are interpreted as delimiters. They are not treated as
-     delimiters if they are surrounded by double quotes: "...".
-   - Unescaped double quotes are removed from the input. Their only effect is
-     that within double quotes, space and tab are treated like normal
-     characters.
-   - Backslashes not followed by double quotes are not special.
-   - But 2*n+1 backslashes followed by a double quote become
-     n backslashes followed by a double quote (n >= 0):
-       \" -> "
-       \\\" -> \"
-       \\\\\" -> \\"
- */
-#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-char **
-prepare_spawn (char **argv)
-{
-  size_t argc;
-  char **new_argv;
-  size_t i;
-
-  /* Count number of arguments.  */
-  for (argc = 0; argv[argc] != NULL; argc++)
-    ;
-
-  /* Allocate new argument vector.  */
-  new_argv = XMALLOC (char *, argc + 1);
-
-  /* Put quoted arguments into the new argument vector.  */
-  for (i = 0; i < argc; i++)
-    {
-      const char *string = argv[i];
-
-      if (string[0] == '\0')
-	new_argv[i] = xstrdup ("\"\"");
-      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
-	{
-	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
-	  size_t length;
-	  unsigned int backslashes;
-	  const char *s;
-	  char *quoted_string;
-	  char *p;
-
-	  length = 0;
-	  backslashes = 0;
-	  if (quote_around)
-	    length++;
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		length += backslashes + 1;
-	      length++;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    length += backslashes + 1;
-
-	  quoted_string = XMALLOC (char, length + 1);
-
-	  p = quoted_string;
-	  backslashes = 0;
-	  if (quote_around)
-	    *p++ = '"';
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		{
-		  unsigned int j;
-		  for (j = backslashes + 1; j > 0; j--)
-		    *p++ = '\\';
-		}
-	      *p++ = c;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    {
-	      unsigned int j;
-	      for (j = backslashes; j > 0; j--)
-		*p++ = '\\';
-	      *p++ = '"';
-	    }
-	  *p = '\0';
-
-	  new_argv[i] = quoted_string;
-	}
-      else
-	new_argv[i] = (char *) string;
-    }
-  new_argv[argc] = NULL;
-
-  return new_argv;
-}
-EOF
-		;;
-	    esac
-
-            cat <<"EOF"
-void lt_dump_script (FILE* f)
-{
-EOF
-	    func_emit_wrapper yes |
-	      $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/  fputs ("\1", f);/p
-g
-D'
-            cat <<"EOF"
-}
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_win32_import_lib_p ARG
-# True if ARG is an import lib, as indicated by $file_magic_cmd
-func_win32_import_lib_p ()
-{
-    $opt_debug
-    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
-    *import*) : ;;
-    *) false ;;
-    esac
-}
-
-# func_mode_link arg...
-func_mode_link ()
-{
-    $opt_debug
-    case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-      # It is impossible to link a dll without this setting, and
-      # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
-      # flag for every libtool invocation.
-      # allow_undefined=no
-
-      # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
-      # even a static library is built.  For now, we need to specify
-      # -no-undefined on the libtool link line when we can be certain
-      # that all symbols are satisfied, otherwise we get a static library.
-      allow_undefined=yes
-      ;;
-    *)
-      allow_undefined=yes
-      ;;
-    esac
-    libtool_args=$nonopt
-    base_compile="$nonopt $@"
-    compile_command=$nonopt
-    finalize_command=$nonopt
-
-    compile_rpath=
-    finalize_rpath=
-    compile_shlibpath=
-    finalize_shlibpath=
-    convenience=
-    old_convenience=
-    deplibs=
-    old_deplibs=
-    compiler_flags=
-    linker_flags=
-    dllsearchpath=
-    lib_search_path=`pwd`
-    inst_prefix_dir=
-    new_inherited_linker_flags=
-
-    avoid_version=no
-    bindir=
-    dlfiles=
-    dlprefiles=
-    dlself=no
-    export_dynamic=no
-    export_symbols=
-    export_symbols_regex=
-    generated=
-    libobjs=
-    ltlibs=
-    module=no
-    no_install=no
-    objs=
-    non_pic_objects=
-    precious_files_regex=
-    prefer_static_libs=no
-    preload=no
-    prev=
-    prevarg=
-    release=
-    rpath=
-    xrpath=
-    perm_rpath=
-    temp_rpath=
-    thread_safe=no
-    vinfo=
-    vinfo_number=no
-    weak_libs=
-    single_module="${wl}-single_module"
-    func_infer_tag $base_compile
-
-    # We need to know -static, to get the right output filenames.
-    for arg
-    do
-      case $arg in
-      -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
-	build_old_libs=no
-	break
-	;;
-      -all-static | -static | -static-libtool-libs)
-	case $arg in
-	-all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
-	    func_warning "complete static linking is impossible in this configuration"
-	  fi
-	  if test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	-static)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=built
-	  ;;
-	-static-libtool-libs)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	esac
-	build_libtool_libs=no
-	build_old_libs=yes
-	break
-	;;
-      esac
-    done
-
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
-    # Go through the arguments, transforming them on the way.
-    while test "$#" -gt 0; do
-      arg="$1"
-      shift
-      func_quote_for_eval "$arg"
-      qarg=$func_quote_for_eval_unquoted_result
-      func_append libtool_args " $func_quote_for_eval_result"
-
-      # If the previous option needs an argument, assign it.
-      if test -n "$prev"; then
-	case $prev in
-	output)
-	  func_append compile_command " @OUTPUT@"
-	  func_append finalize_command " @OUTPUT@"
-	  ;;
-	esac
-
-	case $prev in
-	bindir)
-	  bindir="$arg"
-	  prev=
-	  continue
-	  ;;
-	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
-	    # Add the symbol object into the linking commands.
-	    func_append compile_command " @SYMFILE@"
-	    func_append finalize_command " @SYMFILE@"
-	    preload=yes
-	  fi
-	  case $arg in
-	  *.la | *.lo) ;;  # We handle these cases below.
-	  force)
-	    if test "$dlself" = no; then
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  self)
-	    if test "$prev" = dlprefiles; then
-	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
-	      dlself=yes
-	    else
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  *)
-	    if test "$prev" = dlfiles; then
-	      func_append dlfiles " $arg"
-	    else
-	      func_append dlprefiles " $arg"
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  esac
-	  ;;
-	expsyms)
-	  export_symbols="$arg"
-	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
-	  prev=
-	  continue
-	  ;;
-	expsyms_regex)
-	  export_symbols_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	framework)
-	  case $host in
-	    *-*-darwin*)
-	      case "$deplibs " in
-		*" $qarg.ltframework "*) ;;
-		*) func_append deplibs " $qarg.ltframework" # this is fixed later
-		   ;;
-	      esac
-	      ;;
-	  esac
-	  prev=
-	  continue
-	  ;;
-	inst_prefix)
-	  inst_prefix_dir="$arg"
-	  prev=
-	  continue
-	  ;;
-	objectlist)
-	  if test -f "$arg"; then
-	    save_arg=$arg
-	    moreargs=
-	    for fil in `cat "$save_arg"`
-	    do
-#	      func_append moreargs " $fil"
-	      arg=$fil
-	      # A libtool-controlled object.
-
-	      # Check to see that this really is a libtool object.
-	      if func_lalib_unsafe_p "$arg"; then
-		pic_object=
-		non_pic_object=
-
-		# Read the .lo file
-		func_source "$arg"
-
-		if test -z "$pic_object" ||
-		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none &&
-		   test "$non_pic_object" = none; then
-		  func_fatal_error "cannot find name of object for \`$arg'"
-		fi
-
-		# Extract subdirectory from the argument.
-		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
-
-		if test "$pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
-
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		      func_append dlfiles " $pic_object"
-		      prev=
-		      continue
-		    else
-		      # If libtool objects are unsupported, then we need to preload.
-		      prev=dlprefiles
-		    fi
-		  fi
-
-		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
-		    # Preload the old-style object.
-		    func_append dlprefiles " $pic_object"
-		    prev=
-		  fi
-
-		  # A PIC object.
-		  func_append libobjs " $pic_object"
-		  arg="$pic_object"
-		fi
-
-		# Non-PIC object.
-		if test "$non_pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
-
-		  # A standard non-PIC object
-		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
-		  fi
-		else
-		  # If the PIC object exists, use it instead.
-		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
-		  func_append non_pic_objects " $non_pic_object"
-		fi
-	      else
-		# Only an error if not doing a dry-run.
-		if $opt_dry_run; then
-		  # Extract subdirectory from the argument.
-		  func_dirname "$arg" "/" ""
-		  xdir="$func_dirname_result"
-
-		  func_lo2o "$arg"
-		  pic_object=$xdir$objdir/$func_lo2o_result
-		  non_pic_object=$xdir$func_lo2o_result
-		  func_append libobjs " $pic_object"
-		  func_append non_pic_objects " $non_pic_object"
-	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
-		fi
-	      fi
-	    done
-	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
-	  fi
-	  arg=$save_arg
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	release)
-	  release="-$arg"
-	  prev=
-	  continue
-	  ;;
-	rpath | xrpath)
-	  # We need an absolute path.
-	  case $arg in
-	  [\\/]* | [A-Za-z]:[\\/]*) ;;
-	  *)
-	    func_fatal_error "only absolute run-paths are allowed"
-	    ;;
-	  esac
-	  if test "$prev" = rpath; then
-	    case "$rpath " in
-	    *" $arg "*) ;;
-	    *) func_append rpath " $arg" ;;
-	    esac
-	  else
-	    case "$xrpath " in
-	    *" $arg "*) ;;
-	    *) func_append xrpath " $arg" ;;
-	    esac
-	  fi
-	  prev=
-	  continue
-	  ;;
-	shrext)
-	  shrext_cmds="$arg"
-	  prev=
-	  continue
-	  ;;
-	weak)
-	  func_append weak_libs " $arg"
-	  prev=
-	  continue
-	  ;;
-	xcclinker)
-	  func_append linker_flags " $qarg"
-	  func_append compiler_flags " $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xcompiler)
-	  func_append compiler_flags " $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xlinker)
-	  func_append linker_flags " $qarg"
-	  func_append compiler_flags " $wl$qarg"
-	  prev=
-	  func_append compile_command " $wl$qarg"
-	  func_append finalize_command " $wl$qarg"
-	  continue
-	  ;;
-	*)
-	  eval "$prev=\"\$arg\""
-	  prev=
-	  continue
-	  ;;
-	esac
-      fi # test -n "$prev"
-
-      prevarg="$arg"
-
-      case $arg in
-      -all-static)
-	if test -n "$link_static_flag"; then
-	  # See comment for -static flag below, for more details.
-	  func_append compile_command " $link_static_flag"
-	  func_append finalize_command " $link_static_flag"
-	fi
-	continue
-	;;
-
-      -allow-undefined)
-	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
-	;;
-
-      -avoid-version)
-	avoid_version=yes
-	continue
-	;;
-
-      -bindir)
-	prev=bindir
-	continue
-	;;
-
-      -dlopen)
-	prev=dlfiles
-	continue
-	;;
-
-      -dlpreopen)
-	prev=dlprefiles
-	continue
-	;;
-
-      -export-dynamic)
-	export_dynamic=yes
-	continue
-	;;
-
-      -export-symbols | -export-symbols-regex)
-	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	  func_fatal_error "more than one -exported-symbols argument is not allowed"
-	fi
-	if test "X$arg" = "X-export-symbols"; then
-	  prev=expsyms
-	else
-	  prev=expsyms_regex
-	fi
-	continue
-	;;
-
-      -framework)
-	prev=framework
-	continue
-	;;
-
-      -inst-prefix-dir)
-	prev=inst_prefix
-	continue
-	;;
-
-      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
-      # so, if we see these flags be careful not to treat them like -L
-      -L[A-Z][A-Z]*:*)
-	case $with_gcc/$host in
-	no/*-*-irix* | /*-*-irix*)
-	  func_append compile_command " $arg"
-	  func_append finalize_command " $arg"
-	  ;;
-	esac
-	continue
-	;;
-
-      -L*)
-	func_stripname "-L" '' "$arg"
-	if test -z "$func_stripname_result"; then
-	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between \`-L' and \`$1'"
-	  else
-	    func_fatal_error "need path for \`-L' option"
-	  fi
-	fi
-	func_resolve_sysroot "$func_stripname_result"
-	dir=$func_resolve_sysroot_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  absdir=`cd "$dir" && pwd`
-	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
-	  ;;
-	esac
-	case "$deplibs " in
-	*" -L$dir "* | *" $arg "*)
-	  # Will only happen for absolute or sysroot arguments
-	  ;;
-	*)
-	  # Preserve sysroot, but never include relative directories
-	  case $dir in
-	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
-	    *) func_append deplibs " -L$dir" ;;
-	  esac
-	  func_append lib_search_path " $dir"
-	  ;;
-	esac
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$dir:"*) ;;
-	  ::) dllsearchpath=$dir;;
-	  *) func_append dllsearchpath ":$dir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) func_append dllsearchpath ":$testbindir";;
-	  esac
-	  ;;
-	esac
-	continue
-	;;
-
-      -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # These systems don't actually have a C or math library (as such)
-	    continue
-	    ;;
-	  *-*-os2*)
-	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C and math libraries are in the System framework
-	    func_append deplibs " System.ltframework"
-	    continue
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  esac
-	elif test "X$arg" = "X-lc_r"; then
-	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	   # Do not include libc_r directly, use -pthread flag.
-	   continue
-	   ;;
-	 esac
-	fi
-	func_append deplibs " $arg"
-	continue
-	;;
-
-      -module)
-	module=yes
-	continue
-	;;
-
-      # Tru64 UNIX uses -model [arg] to determine the layout of C++
-      # classes, name mangling, and exception handling.
-      # Darwin uses the -arch flag to determine output architecture.
-      -model|-arch|-isysroot|--sysroot)
-	func_append compiler_flags " $arg"
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-	prev=xcompiler
-	continue
-	;;
-
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	func_append compiler_flags " $arg"
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-	case "$new_inherited_linker_flags " in
-	    *" $arg "*) ;;
-	    * ) func_append new_inherited_linker_flags " $arg" ;;
-	esac
-	continue
-	;;
-
-      -multi_module)
-	single_module="${wl}-multi_module"
-	continue
-	;;
-
-      -no-fast-install)
-	fast_install=no
-	continue
-	;;
-
-      -no-install)
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
-	  # The PATH hackery in wrapper scripts is required on Windows
-	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "\`-no-install' is ignored for $host"
-	  func_warning "assuming \`-no-fast-install' instead"
-	  fast_install=no
-	  ;;
-	*) no_install=yes ;;
-	esac
-	continue
-	;;
-
-      -no-undefined)
-	allow_undefined=no
-	continue
-	;;
-
-      -objectlist)
-	prev=objectlist
-	continue
-	;;
-
-      -o) prev=output ;;
-
-      -precious-files-regex)
-	prev=precious_regex
-	continue
-	;;
-
-      -release)
-	prev=release
-	continue
-	;;
-
-      -rpath)
-	prev=rpath
-	continue
-	;;
-
-      -R)
-	prev=xrpath
-	continue
-	;;
-
-      -R*)
-	func_stripname '-R' '' "$arg"
-	dir=$func_stripname_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	=*)
-	  func_stripname '=' '' "$dir"
-	  dir=$lt_sysroot$func_stripname_result
-	  ;;
-	*)
-	  func_fatal_error "only absolute run-paths are allowed"
-	  ;;
-	esac
-	case "$xrpath " in
-	*" $dir "*) ;;
-	*) func_append xrpath " $dir" ;;
-	esac
-	continue
-	;;
-
-      -shared)
-	# The effects of -shared are defined in a previous loop.
-	continue
-	;;
-
-      -shrext)
-	prev=shrext
-	continue
-	;;
-
-      -static | -static-libtool-libs)
-	# The effects of -static are defined in a previous loop.
-	# We used to do the same as -all-static on platforms that
-	# didn't have a PIC flag, but the assumption that the effects
-	# would be equivalent was wrong.  It would break on at least
-	# Digital Unix and AIX.
-	continue
-	;;
-
-      -thread-safe)
-	thread_safe=yes
-	continue
-	;;
-
-      -version-info)
-	prev=vinfo
-	continue
-	;;
-
-      -version-number)
-	prev=vinfo
-	vinfo_number=yes
-	continue
-	;;
-
-      -weak)
-        prev=weak
-	continue
-	;;
-
-      -Wc,*)
-	func_stripname '-Wc,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-          func_quote_for_eval "$flag"
-	  func_append arg " $func_quote_for_eval_result"
-	  func_append compiler_flags " $func_quote_for_eval_result"
-	done
-	IFS="$save_ifs"
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Wl,*)
-	func_stripname '-Wl,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-          func_quote_for_eval "$flag"
-	  func_append arg " $wl$func_quote_for_eval_result"
-	  func_append compiler_flags " $wl$func_quote_for_eval_result"
-	  func_append linker_flags " $func_quote_for_eval_result"
-	done
-	IFS="$save_ifs"
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Xcompiler)
-	prev=xcompiler
-	continue
-	;;
-
-      -Xlinker)
-	prev=xlinker
-	continue
-	;;
-
-      -XCClinker)
-	prev=xcclinker
-	continue
-	;;
-
-      # -msg_* for osf cc
-      -msg_*)
-	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-
-      # Flags to be passed through unchanged, with rationale:
-      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
-      # -r[0-9][0-9]*        specify processor for the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
-      # +DA*, +DD*           enable 64-bit mode for the HP compiler
-      # -q*                  compiler args for the IBM compiler
-      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
-      # -F/path              path to uninstalled frameworks, gcc on darwin
-      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
-      # @file                GCC response files
-      # -tp=*                Portland pgcc target processor selection
-      # --sysroot=*          for sysroot support
-      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
-        func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-        func_append compile_command " $arg"
-        func_append finalize_command " $arg"
-        func_append compiler_flags " $arg"
-        continue
-        ;;
-
-      # Some other compiler flag.
-      -* | +*)
-        func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-
-      *.$objext)
-	# A standard object.
-	func_append objs " $arg"
-	;;
-
-      *.lo)
-	# A libtool-controlled object.
-
-	# Check to see that this really is a libtool object.
-	if func_lalib_unsafe_p "$arg"; then
-	  pic_object=
-	  non_pic_object=
-
-	  # Read the .lo file
-	  func_source "$arg"
-
-	  if test -z "$pic_object" ||
-	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none &&
-	     test "$non_pic_object" = none; then
-	    func_fatal_error "cannot find name of object for \`$arg'"
-	  fi
-
-	  # Extract subdirectory from the argument.
-	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
-
-	  if test "$pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
-
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		func_append dlfiles " $pic_object"
-		prev=
-		continue
-	      else
-		# If libtool objects are unsupported, then we need to preload.
-		prev=dlprefiles
-	      fi
-	    fi
-
-	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
-	      # Preload the old-style object.
-	      func_append dlprefiles " $pic_object"
-	      prev=
-	    fi
-
-	    # A PIC object.
-	    func_append libobjs " $pic_object"
-	    arg="$pic_object"
-	  fi
-
-	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
-
-	    # A standard non-PIC object
-	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
-	    fi
-	  else
-	    # If the PIC object exists, use it instead.
-	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
-	    func_append non_pic_objects " $non_pic_object"
-	  fi
-	else
-	  # Only an error if not doing a dry-run.
-	  if $opt_dry_run; then
-	    # Extract subdirectory from the argument.
-	    func_dirname "$arg" "/" ""
-	    xdir="$func_dirname_result"
-
-	    func_lo2o "$arg"
-	    pic_object=$xdir$objdir/$func_lo2o_result
-	    non_pic_object=$xdir$func_lo2o_result
-	    func_append libobjs " $pic_object"
-	    func_append non_pic_objects " $non_pic_object"
-	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
-	  fi
-	fi
-	;;
-
-      *.$libext)
-	# An archive.
-	func_append deplibs " $arg"
-	func_append old_deplibs " $arg"
-	continue
-	;;
-
-      *.la)
-	# A libtool-controlled library.
-
-	func_resolve_sysroot "$arg"
-	if test "$prev" = dlfiles; then
-	  # This library was specified with -dlopen.
-	  func_append dlfiles " $func_resolve_sysroot_result"
-	  prev=
-	elif test "$prev" = dlprefiles; then
-	  # The library was specified with -dlpreopen.
-	  func_append dlprefiles " $func_resolve_sysroot_result"
-	  prev=
-	else
-	  func_append deplibs " $func_resolve_sysroot_result"
-	fi
-	continue
-	;;
-
-      # Some other compiler argument.
-      *)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-      esac # arg
-
-      # Now actually substitute the argument into the commands.
-      if test -n "$arg"; then
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-      fi
-    done # argument parsing loop
-
-    test -n "$prev" && \
-      func_fatal_help "the \`$prevarg' option requires an argument"
-
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
-      eval arg=\"$export_dynamic_flag_spec\"
-      func_append compile_command " $arg"
-      func_append finalize_command " $arg"
-    fi
-
-    oldlibs=
-    # calculate the name of the file, without its directory
-    func_basename "$output"
-    outputname="$func_basename_result"
-    libobjs_save="$libobjs"
-
-    if test -n "$shlibpath_var"; then
-      # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
-    else
-      shlib_search_path=
-    fi
-    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
-    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
-    func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
-    func_to_tool_file "$output_objdir/"
-    tool_output_objdir=$func_to_tool_file_result
-    # Create the object directory.
-    func_mkdir_p "$output_objdir"
-
-    # Determine the type of output
-    case $output in
-    "")
-      func_fatal_help "you must specify an output file"
-      ;;
-    *.$libext) linkmode=oldlib ;;
-    *.lo | *.$objext) linkmode=obj ;;
-    *.la) linkmode=lib ;;
-    *) linkmode=prog ;; # Anything else should be a program.
-    esac
-
-    specialdeplibs=
-
-    libs=
-    # Find all interdependent deplibs by searching for libraries
-    # that are linked more than once (e.g. -la -lb -la)
-    for deplib in $deplibs; do
-      if $opt_preserve_dup_deps ; then
-	case "$libs " in
-	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	esac
-      fi
-      func_append libs " $deplib"
-    done
-
-    if test "$linkmode" = lib; then
-      libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
-      # Compute libraries that are listed more than once in $predeps
-      # $postdeps and mark them as special (i.e., whose duplicates are
-      # not to be eliminated).
-      pre_post_deps=
-      if $opt_duplicate_compiler_generated_deps; then
-	for pre_post_dep in $predeps $postdeps; do
-	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
-	  esac
-	  func_append pre_post_deps " $pre_post_dep"
-	done
-      fi
-      pre_post_deps=
-    fi
-
-    deplibs=
-    newdependency_libs=
-    newlib_search_path=
-    need_relink=no # whether we're linking any uninstalled libtool libraries
-    notinst_deplibs= # not-installed libtool libraries
-    notinst_path= # paths that contain not-installed libtool libraries
-
-    case $linkmode in
-    lib)
-	passes="conv dlpreopen link"
-	for file in $dlfiles $dlprefiles; do
-	  case $file in
-	  *.la) ;;
-	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
-	    ;;
-	  esac
-	done
-	;;
-    prog)
-	compile_deplibs=
-	finalize_deplibs=
-	alldeplibs=no
-	newdlfiles=
-	newdlprefiles=
-	passes="conv scan dlopen dlpreopen link"
-	;;
-    *)  passes="conv"
-	;;
-    esac
-
-    for pass in $passes; do
-      # The preopen pass in lib mode reverses $deplibs; put it back here
-      # so that -L comes before libs that need it for instance...
-      if test "$linkmode,$pass" = "lib,link"; then
-	## FIXME: Find the place where the list is rebuilt in the wrong
-	##        order, and fix it there properly
-        tmp_deplibs=
-	for deplib in $deplibs; do
-	  tmp_deplibs="$deplib $tmp_deplibs"
-	done
-	deplibs="$tmp_deplibs"
-      fi
-
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
-	deplibs=
-      fi
-      if test "$linkmode" = prog; then
-	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
-	esac
-      fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
-	# Collect and forward deplibs of preopened libtool libs
-	for lib in $dlprefiles; do
-	  # Ignore non-libtool-libs
-	  dependency_libs=
-	  func_resolve_sysroot "$lib"
-	  case $lib in
-	  *.la)	func_source "$func_resolve_sysroot_result" ;;
-	  esac
-
-	  # Collect preopened libtool deplibs, except any this library
-	  # has declared as weak libs
-	  for deplib in $dependency_libs; do
-	    func_basename "$deplib"
-            deplib_base=$func_basename_result
-	    case " $weak_libs " in
-	    *" $deplib_base "*) ;;
-	    *) func_append deplibs " $deplib" ;;
-	    esac
-	  done
-	done
-	libs="$dlprefiles"
-      fi
-      if test "$pass" = dlopen; then
-	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
-	deplibs=
-      fi
-
-      for deplib in $libs; do
-	lib=
-	found=no
-	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    func_append compiler_flags " $deplib"
-	    if test "$linkmode" = lib ; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) func_append new_inherited_linker_flags " $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    func_warning "\`-l' is ignored for archives/objects"
-	    continue
-	  fi
-	  func_stripname '-l' '' "$deplib"
-	  name=$func_stripname_result
-	  if test "$linkmode" = lib; then
-	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
-	  else
-	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
-	  fi
-	  for searchdir in $searchdirs; do
-	    for search_ext in .la $std_shrext .so .a; do
-	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
-	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
-		else
-		  found=no
-		fi
-		break 2
-	      fi
-	    done
-	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
-	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
-	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	      case " $predeps $postdeps " in
-	      *" $deplib "*)
-		if func_lalib_p "$lib"; then
-		  library_names=
-		  old_library=
-		  func_source "$lib"
-		  for l in $old_library $library_names; do
-		    ll="$l"
-		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
-		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
-		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
-		      compile_deplibs="$deplib $compile_deplibs"
-		      finalize_deplibs="$deplib $finalize_deplibs"
-		    else
-		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-		    fi
-		    continue
-		  fi
-		fi
-		;;
-	      *) ;;
-	      esac
-	    fi
-	  fi
-	  ;; # -l
-	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) func_append new_inherited_linker_flags " $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-L*)
-	  case $linkmode in
-	  lib)
-	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
-	    newdependency_libs="$deplib $newdependency_libs"
-	    func_stripname '-L' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    func_append newlib_search_path " $func_resolve_sysroot_result"
-	    ;;
-	  prog)
-	    if test "$pass" = conv; then
-	      deplibs="$deplib $deplibs"
-	      continue
-	    fi
-	    if test "$pass" = scan; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    func_stripname '-L' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    func_append newlib_search_path " $func_resolve_sysroot_result"
-	    ;;
-	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
-	    ;;
-	  esac # linkmode
-	  continue
-	  ;; # -L
-	-R*)
-	  if test "$pass" = link; then
-	    func_stripname '-R' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    dir=$func_resolve_sysroot_result
-	    # Make sure the xrpath contains only unique directories.
-	    case "$xrpath " in
-	    *" $dir "*) ;;
-	    *) func_append xrpath " $dir" ;;
-	    esac
-	  fi
-	  deplibs="$deplib $deplibs"
-	  continue
-	  ;;
-	*.la)
-	  func_resolve_sysroot "$deplib"
-	  lib=$func_resolve_sysroot_result
-	  ;;
-	*.$libext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
-	  case $linkmode in
-	  lib)
-	    # Linking convenience modules into shared libraries is allowed,
-	    # but linking other static libraries is non-portable.
-	    case " $dlpreconveniencelibs " in
-	    *" $deplib "*) ;;
-	    *)
-	      valid_a_lib=no
-	      case $deplibs_check_method in
-		match_pattern*)
-		  set dummy $deplibs_check_method; shift
-		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
-		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=yes
-		  fi
-		;;
-		pass_all)
-		  valid_a_lib=yes
-		;;
-	      esac
-	      if test "$valid_a_lib" != yes; then
-		echo
-		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because the file extensions .$libext of this argument makes me believe"
-		echo "*** that it is just a static archive that I should not use here."
-	      else
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
-	      fi
-	      ;;
-	    esac
-	    continue
-	    ;;
-	  prog)
-	    if test "$pass" != link; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    continue
-	    ;;
-	  esac # linkmode
-	  ;; # *.$libext
-	*.lo | *.$objext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
-	      # If there is no dlopen support or we're linking statically,
-	      # we need to preload.
-	      func_append newdlprefiles " $deplib"
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      func_append newdlfiles " $deplib"
-	    fi
-	  fi
-	  continue
-	  ;;
-	%DEPLIBS%)
-	  alldeplibs=yes
-	  continue
-	  ;;
-	esac # case $deplib
-
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
-	fi
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "\`$lib' is not a valid libtool archive"
-
-	func_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
-
-	dlname=
-	dlopen=
-	dlpreopen=
-	libdir=
-	library_names=
-	old_library=
-	inherited_linker_flags=
-	# If the library was installed with an old release of libtool,
-	# it will not redefine variables installed, or shouldnotlink
-	installed=yes
-	shouldnotlink=no
-	avoidtemprpath=
-
-
-	# Read the .la file
-	func_source "$lib"
-
-	# Convert "-framework foo" to "foo.ltframework"
-	if test -n "$inherited_linker_flags"; then
-	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
-	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
-	    case " $new_inherited_linker_flags " in
-	      *" $tmp_inherited_linker_flag "*) ;;
-	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
-	    esac
-	  done
-	fi
-	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-	  test -n "$dlopen" && func_append dlfiles " $dlopen"
-	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
-	fi
-
-	if test "$pass" = conv; then
-	  # Only check for convenience libraries
-	  deplibs="$lib $deplibs"
-	  if test -z "$libdir"; then
-	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for \`$lib'"
-	    fi
-	    # It is a libtool convenience library, so add in its objects.
-	    func_append convenience " $ladir/$objdir/$old_library"
-	    func_append old_convenience " $ladir/$objdir/$old_library"
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    func_fatal_error "\`$lib' is not a convenience library"
-	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done
-	  continue
-	fi # $pass = conv
-
-
-	# Get the name of the library we link against.
-	linklib=
-	if test -n "$old_library" &&
-	   { test "$prefer_static_libs" = yes ||
-	     test "$prefer_static_libs,$installed" = "built,no"; }; then
-	  linklib=$old_library
-	else
-	  for l in $old_library $library_names; do
-	    linklib="$l"
-	  done
-	fi
-	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for \`$lib'"
-	fi
-
-	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
-	  fi
-	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
-	    # If there is no dlname, no dlopen support or we're linking
-	    # statically, we need to preload.  We also need to preload any
-	    # dependent libraries so libltdl's deplib preloader doesn't
-	    # bomb out in the load deplibs phase.
-	    func_append dlprefiles " $lib $dependency_libs"
-	  else
-	    func_append newdlfiles " $lib"
-	  fi
-	  continue
-	fi # $pass = dlopen
-
-	# We need an absolute path.
-	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
-	*)
-	  abs_ladir=`cd "$ladir" && pwd`
-	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of \`$ladir'"
-	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
-	  fi
-	  ;;
-	esac
-	func_basename "$lib"
-	laname="$func_basename_result"
-
-	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
-	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library \`$lib' was moved."
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
-	  else
-	    dir="$lt_sysroot$libdir"
-	    absdir="$lt_sysroot$libdir"
-	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
-	else
-	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    # Remove this search path later
-	    func_append notinst_path " $abs_ladir"
-	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
-	    # Remove this search path later
-	    func_append notinst_path " $abs_ladir"
-	  fi
-	fi # $installed = yes
-	func_stripname 'lib' '.la' "$laname"
-	name=$func_stripname_result
-
-	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir" && test "$linkmode" = prog; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
-	  fi
-	  case "$host" in
-	    # special handling for platforms with PE-DLLs.
-	    *cygwin* | *mingw* | *cegcc* )
-	      # Linker will automatically link against shared library if both
-	      # static and shared are present.  Therefore, ensure we extract
-	      # symbols from the import library if a shared library is present
-	      # (otherwise, the dlopen module name will be incorrect).  We do
-	      # this by putting the import library name into $newdlprefiles.
-	      # We recover the dlopen module name by 'saving' the la file
-	      # name in a special purpose variable, and (later) extracting the
-	      # dlname from the la file.
-	      if test -n "$dlname"; then
-	        func_tr_sh "$dir/$linklib"
-	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
-	        func_append newdlprefiles " $dir/$linklib"
-	      else
-	        func_append newdlprefiles " $dir/$old_library"
-	        # Keep a list of preopened convenience libraries to check
-	        # that they are being used correctly in the link pass.
-	        test -z "$libdir" && \
-	          func_append dlpreconveniencelibs " $dir/$old_library"
-	      fi
-	    ;;
-	    * )
-	      # Prefer using a static library (so that no silly _DYNAMIC symbols
-	      # are required to link).
-	      if test -n "$old_library"; then
-	        func_append newdlprefiles " $dir/$old_library"
-	        # Keep a list of preopened convenience libraries to check
-	        # that they are being used correctly in the link pass.
-	        test -z "$libdir" && \
-	          func_append dlpreconveniencelibs " $dir/$old_library"
-	      # Otherwise, use the dlname, so that lt_dlopen finds it.
-	      elif test -n "$dlname"; then
-	        func_append newdlprefiles " $dir/$dlname"
-	      else
-	        func_append newdlprefiles " $dir/$linklib"
-	      fi
-	    ;;
-	  esac
-	fi # $pass = dlpreopen
-
-	if test -z "$libdir"; then
-	  # Link the convenience library
-	  if test "$linkmode" = lib; then
-	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$dir/$old_library $compile_deplibs"
-	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
-	  else
-	    deplibs="$lib $deplibs" # used for prog,scan pass
-	  fi
-	  continue
-	fi
-
-
-	if test "$linkmode" = prog && test "$pass" != link; then
-	  func_append newlib_search_path " $ladir"
-	  deplibs="$lib $deplibs"
-
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
-	  fi
-
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    case $deplib in
-	    -L*) func_stripname '-L' '' "$deplib"
-	         func_resolve_sysroot "$func_stripname_result"
-	         func_append newlib_search_path " $func_resolve_sysroot_result"
-		 ;;
-	    esac
-	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      # Need to hardcode shared library paths
-	      # or/and link against static libraries
-	      newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done # for deplib
-	  continue
-	fi # $linkmode = prog...
-
-	if test "$linkmode,$pass" = "prog,link"; then
-	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
-	       test -z "$old_library"; }; then
-	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
-	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
-	      *"$absdir:"*) ;;
-	      *) func_append temp_rpath "$absdir:" ;;
-	      esac
-	    fi
-
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) func_append compile_rpath " $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append finalize_rpath " $libdir" ;;
-	      esac
-	      ;;
-	    esac
-	  fi # $linkmode,$pass = prog,link...
-
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
-		 test -n "$library_names"; }; }; then
-	    # We only need to search for static libraries
-	    continue
-	  fi
-	fi
-
-	link_static=no # Whether the deplib will be linked statically
-	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes; then
-	  use_static_libs=no
-	fi
-	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
-	  case $host in
-	  *cygwin* | *mingw* | *cegcc*)
-	      # No point in relinking DLLs because paths are not encoded
-	      func_append notinst_deplibs " $lib"
-	      need_relink=no
-	    ;;
-	  *)
-	    if test "$installed" = no; then
-	      func_append notinst_deplibs " $lib"
-	      need_relink=yes
-	    fi
-	    ;;
-	  esac
-	  # This is a shared library
-
-	  # Warn about portability, can't link against -module's on some
-	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
-	  for dlpremoduletest in $dlprefiles; do
-	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
-	      break
-	    fi
-	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
-	    echo
-	    if test "$linkmode" = prog; then
-	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
-	    else
-	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
-	    fi
-	    $ECHO "*** $linklib is not portable!"
-	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) func_append compile_rpath " $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append finalize_rpath " $libdir" ;;
-	      esac
-	      ;;
-	    esac
-	  fi
-
-	  if test -n "$old_archive_from_expsyms_cmds"; then
-	    # figure out the soname
-	    set dummy $library_names
-	    shift
-	    realname="$1"
-	    shift
-	    libname=`eval "\\$ECHO \"$libname_spec\""`
-	    # use dlname if we got it. it's perfectly good, no?
-	    if test -n "$dlname"; then
-	      soname="$dlname"
-	    elif test -n "$soname_spec"; then
-	      # bleh windows
-	      case $host in
-	      *cygwin* | mingw* | *cegcc*)
-	        func_arith $current - $age
-		major=$func_arith_result
-		versuffix="-$major"
-		;;
-	      esac
-	      eval soname=\"$soname_spec\"
-	    else
-	      soname="$realname"
-	    fi
-
-	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
-	    func_basename "$soroot"
-	    soname="$func_basename_result"
-	    func_stripname 'lib' '.dll' "$soname"
-	    newlib=libimp-$func_stripname_result.a
-
-	    # If the library has no export list, then create one now
-	    if test -f "$output_objdir/$soname-def"; then :
-	    else
-	      func_verbose "extracting exported symbol list from \`$soname'"
-	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
-	    fi
-
-	    # Create $newlib
-	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for \`$soname'"
-	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
-	    fi
-	    # make sure the library variables are pointing to the new library
-	    dir=$output_objdir
-	    linklib=$newlib
-	  fi # test -n "$old_archive_from_expsyms_cmds"
-
-	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    lib_linked=yes
-	    case $hardcode_action in
-	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
-		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
-		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
-		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
-		    # link against it, someone is ignoring the earlier warnings
-		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null ; then
-		      if test "X$dlopenmodule" != "X$lib"; then
-			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library" ; then
-			  echo
-			  echo "*** And there doesn't seem to be a static archive available"
-			  echo "*** The link will probably fail, sorry"
-			else
-			  add="$dir/$old_library"
-			fi
-		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
-		      fi
-		    fi
-		esac
-	      elif test "$hardcode_minus_L" = no; then
-		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
-		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    relink)
-	      if test "$hardcode_direct" = yes &&
-	         test "$hardcode_direct_absolute" = no; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$absdir"
-		# Try looking first in the location we're being installed to.
-		if test -n "$inst_prefix_dir"; then
-		  case $libdir in
-		    [\\/]*)
-		      func_append add_dir " -L$inst_prefix_dir$libdir"
-		      ;;
-		  esac
-		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    *) lib_linked=no ;;
-	    esac
-
-	    if test "$lib_linked" != yes; then
-	      func_fatal_configuration "unsupported hardcode properties"
-	    fi
-
-	    if test -n "$add_shlibpath"; then
-	      case :$compile_shlibpath: in
-	      *":$add_shlibpath:"*) ;;
-	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
-	      esac
-	    fi
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
-	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes &&
-		 test "$hardcode_minus_L" != yes &&
-		 test "$hardcode_shlibpath_var" = yes; then
-		case :$finalize_shlibpath: in
-		*":$libdir:"*) ;;
-		*) func_append finalize_shlibpath "$libdir:" ;;
-		esac
-	      fi
-	    fi
-	  fi
-
-	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes &&
-	       test "$hardcode_direct_absolute" = no; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
-	      case :$finalize_shlibpath: in
-	      *":$libdir:"*) ;;
-	      *) func_append finalize_shlibpath "$libdir:" ;;
-	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
-	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
-	      else
-		add="$libdir/$linklib"
-	      fi
-	    else
-	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
-	      # Try looking first in the location we're being installed to.
-	      if test -n "$inst_prefix_dir"; then
-		case $libdir in
-		  [\\/]*)
-		    func_append add_dir " -L$inst_prefix_dir$libdir"
-		    ;;
-		esac
-	      fi
-	      add="-l$name"
-	    fi
-
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
-	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	    fi
-	  fi
-	elif test "$linkmode" = prog; then
-	  # Here we assume that one of hardcode_direct or hardcode_minus_L
-	  # is not unsupported.  This is valid on all known static and
-	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
-	    compile_deplibs="$dir/$linklib $compile_deplibs"
-	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
-	  else
-	    compile_deplibs="-l$name -L$dir $compile_deplibs"
-	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
-	  fi
-	elif test "$build_libtool_libs" = yes; then
-	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
-	    # We're trying link a shared library against a static one
-	    # but the system doesn't support it.
-
-	    # Just print a warning and add the library to dependency_libs so
-	    # that the program can be linked against the static library.
-	    echo
-	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
-	    echo "*** I have the capability to make that library automatically link in when"
-	    echo "*** you link to this library.  But I can only do this if you have a"
-	    echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
-	      echo "*** But as you try to build a module library, libtool will still create "
-	      echo "*** a static module, that should work as long as the dlopening application"
-	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
-	      if test -z "$global_symbol_pipe"; then
-		echo
-		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	      fi
-	      if test "$build_old_libs" = no; then
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  else
-	    deplibs="$dir/$old_library $deplibs"
-	    link_static=yes
-	  fi
-	fi # link shared/static library?
-
-	if test "$linkmode" = lib; then
-	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
-	    # Extract -R from dependency_libs
-	    temp_deplibs=
-	    for libdir in $dependency_libs; do
-	      case $libdir in
-	      -R*) func_stripname '-R' '' "$libdir"
-	           temp_xrpath=$func_stripname_result
-		   case " $xrpath " in
-		   *" $temp_xrpath "*) ;;
-		   *) func_append xrpath " $temp_xrpath";;
-		   esac;;
-	      *) func_append temp_deplibs " $libdir";;
-	      esac
-	    done
-	    dependency_libs="$temp_deplibs"
-	  fi
-
-	  func_append newlib_search_path " $absdir"
-	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
-	  # ... and its dependency_libs
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    newdependency_libs="$deplib $newdependency_libs"
-	    case $deplib in
-              -L*) func_stripname '-L' '' "$deplib"
-                   func_resolve_sysroot "$func_stripname_result";;
-              *) func_resolve_sysroot "$deplib" ;;
-            esac
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $func_resolve_sysroot_result "*)
-                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $func_resolve_sysroot_result"
-	  done
-
-	  if test "$link_all_deplibs" != no; then
-	    # Add the search paths of all dependency libraries
-	    for deplib in $dependency_libs; do
-	      path=
-	      case $deplib in
-	      -L*) path="$deplib" ;;
-	      *.la)
-	        func_resolve_sysroot "$deplib"
-	        deplib=$func_resolve_sysroot_result
-	        func_dirname "$deplib" "" "."
-		dir=$func_dirname_result
-		# We need an absolute path.
-		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
-		*)
-		  absdir=`cd "$dir" && pwd`
-		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of \`$dir'"
-		    absdir="$dir"
-		  fi
-		  ;;
-		esac
-		if $GREP "^installed=no" $deplib > /dev/null; then
-		case $host in
-		*-*-darwin*)
-		  depdepl=
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
-		      depdepl=$tmp
-		    done
-		    if test -f "$absdir/$objdir/$depdepl" ; then
-		      depdepl="$absdir/$objdir/$depdepl"
-		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
-                      if test -z "$darwin_install_name"; then
-                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
-                      fi
-		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
-		      path=
-		    fi
-		  fi
-		  ;;
-		*)
-		  path="-L$absdir/$objdir"
-		  ;;
-		esac
-		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
-		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
-
-		  path="-L$absdir"
-		fi
-		;;
-	      esac
-	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$path $deplibs" ;;
-	      esac
-	    done
-	  fi # link_all_deplibs != no
-	fi # linkmode = lib
-      done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; then
-	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
-	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
-	else
-	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	fi
-      fi
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
-	# Link the dlpreopened libraries before other libraries
-	for deplib in $save_deplibs; do
-	  deplibs="$deplib $deplibs"
-	done
-      fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
-	  # Make sure lib_search_path contains only unique directories.
-	  lib_search_path=
-	  for dir in $newlib_search_path; do
-	    case "$lib_search_path " in
-	    *" $dir "*) ;;
-	    *) func_append lib_search_path " $dir" ;;
-	    esac
-	  done
-	  newlib_search_path=
-	fi
-
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
-	  vars="compile_deplibs finalize_deplibs"
-	fi
-	for var in $vars dependency_libs; do
-	  # Add libraries to $var in reverse order
-	  eval tmp_libs=\"\$$var\"
-	  new_libs=
-	  for deplib in $tmp_libs; do
-	    # FIXME: Pedantically, this is the right thing to do, so
-	    #        that some nasty dependency loop isn't accidentally
-	    #        broken:
-	    #new_libs="$deplib $new_libs"
-	    # Pragmatically, this seems to cause very few problems in
-	    # practice:
-	    case $deplib in
-	    -L*) new_libs="$deplib $new_libs" ;;
-	    -R*) ;;
-	    *)
-	      # And here is the reason: when a library appears more
-	      # than once as an explicit dependence of a library, or
-	      # is implicitly linked in more than once by the
-	      # compiler, it is considered special, and multiple
-	      # occurrences thereof are not removed.  Compare this
-	      # with having the same library being listed as a
-	      # dependency of multiple other libraries: in this case,
-	      # we know (pedantically, we assume) the library does not
-	      # need to be listed more than once, so we keep only the
-	      # last copy.  This is not always right, but it is rare
-	      # enough that we require users that really mean to play
-	      # such unportable linking tricks to link the library
-	      # using -Wl,-lname, so that libtool does not consider it
-	      # for duplicate removal.
-	      case " $specialdeplibs " in
-	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
-	      *)
-		case " $new_libs " in
-		*" $deplib "*) ;;
-		*) new_libs="$deplib $new_libs" ;;
-		esac
-		;;
-	      esac
-	      ;;
-	    esac
-	  done
-	  tmp_libs=
-	  for deplib in $new_libs; do
-	    case $deplib in
-	    -L*)
-	      case " $tmp_libs " in
-	      *" $deplib "*) ;;
-	      *) func_append tmp_libs " $deplib" ;;
-	      esac
-	      ;;
-	    *) func_append tmp_libs " $deplib" ;;
-	    esac
-	  done
-	  eval $var=\"$tmp_libs\"
-	done # for var
-      fi
-      # Last step: remove runtime libs from dependency_libs
-      # (they stay in deplibs)
-      tmp_libs=
-      for i in $dependency_libs ; do
-	case " $predeps $postdeps $compiler_lib_search_path " in
-	*" $i "*)
-	  i=""
-	  ;;
-	esac
-	if test -n "$i" ; then
-	  func_append tmp_libs " $i"
-	fi
-      done
-      dependency_libs=$tmp_libs
-    done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
-    fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
-    fi
-
-    case $linkmode in
-    oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
-
-      test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
-
-      test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
-
-      test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
-
-      # Now set the variables for building old libraries.
-      build_libtool_libs=no
-      oldlibs="$output"
-      func_append objs "$old_deplibs"
-      ;;
-
-    lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
-      case $outputname in
-      lib*)
-	func_stripname 'lib' '.la' "$outputname"
-	name=$func_stripname_result
-	eval shared_ext=\"$shrext_cmds\"
-	eval libname=\"$libname_spec\"
-	;;
-      *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
-
-	if test "$need_lib_prefix" != no; then
-	  # Add the "lib" prefix for modules if required
-	  func_stripname '' '.la' "$outputname"
-	  name=$func_stripname_result
-	  eval shared_ext=\"$shrext_cmds\"
-	  eval libname=\"$libname_spec\"
-	else
-	  func_stripname '' '.la' "$outputname"
-	  libname=$func_stripname_result
-	fi
-	;;
-      esac
-
-      if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
-	else
-	  echo
-	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
-	  $ECHO "*** objects $objs is not portable!"
-	  func_append libobjs " $objs"
-	fi
-      fi
-
-      test "$dlself" != no && \
-	func_warning "\`-dlopen self' is ignored for libtool libraries"
-
-      set dummy $rpath
-      shift
-      test "$#" -gt 1 && \
-	func_warning "ignoring multiple \`-rpath's for a libtool library"
-
-      install_libdir="$1"
-
-      oldlibs=
-      if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
-	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
-	  # convenience libraries should have the same extension an
-	  # archive normally would.
-	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
-	  build_libtool_libs=convenience
-	  build_old_libs=yes
-	fi
-
-	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
-
-	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
-      else
-
-	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
-	set dummy $vinfo 0 0 0
-	shift
-	IFS="$save_ifs"
-
-	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
-
-	# convert absolute version numbers to libtool ages
-	# this retains compatibility with .la files and attempts
-	# to make the code below a bit more comprehensible
-
-	case $vinfo_number in
-	yes)
-	  number_major="$1"
-	  number_minor="$2"
-	  number_revision="$3"
-	  #
-	  # There are really only two kinds -- those that
-	  # use the current revision as the major version
-	  # and those that subtract age and use age as
-	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
-	  #
-	  case $version_type in
-	  # correct linux to gnu/linux during the next big refactor
-	  darwin|linux|osf|windows|none)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
-	    ;;
-	  freebsd-aout|freebsd-elf|qnx|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
-	    ;;
-	  irix|nonstopux)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_minor"
-	    lt_irix_increment=no
-	    ;;
-	  esac
-	  ;;
-	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
-	  ;;
-	esac
-
-	# Check that each of the things are valid numbers.
-	case $current in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "CURRENT \`$current' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $revision in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "REVISION \`$revision' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $age in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "AGE \`$age' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	if test "$age" -gt "$current"; then
-	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	fi
-
-	# Calculate the version variables.
-	major=
-	versuffix=
-	verstring=
-	case $version_type in
-	none) ;;
-
-	darwin)
-	  # Like Linux, but with the current version available in
-	  # verstring for coding it into the library header
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
-	  # Darwin ld doesn't like 0 for these options...
-	  func_arith $current + 1
-	  minor_current=$func_arith_result
-	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
-	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-	  ;;
-
-	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
-	  ;;
-
-	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
-	  ;;
-
-	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
-	    func_arith $current - $age
-	  else
-	    func_arith $current - $age + 1
-	  fi
-	  major=$func_arith_result
-
-	  case $version_type in
-	    nonstopux) verstring_prefix=nonstopux ;;
-	    *)         verstring_prefix=sgi ;;
-	  esac
-	  verstring="$verstring_prefix$major.$revision"
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$revision
-	  while test "$loop" -ne 0; do
-	    func_arith $revision - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
-	  done
-
-	  # Before this point, $major must not contain `.'.
-	  major=.$major
-	  versuffix="$major.$revision"
-	  ;;
-
-	linux) # correct to gnu/linux during the next big refactor
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
-	  ;;
-
-	osf)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$age
-	  while test "$loop" -ne 0; do
-	    func_arith $current - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
-	  done
-
-	  # Make executables depend on our current version.
-	  func_append verstring ":${current}.0"
-	  ;;
-
-	qnx)
-	  major=".$current"
-	  versuffix=".$current"
-	  ;;
-
-	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
-	  ;;
-
-	windows)
-	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
-	  func_arith $current - $age
-	  major=$func_arith_result
-	  versuffix="-$major"
-	  ;;
-
-	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
-	  ;;
-	esac
-
-	# Clear the version info if we defaulted, and they specified a release.
-	if test -z "$vinfo" && test -n "$release"; then
-	  major=
-	  case $version_type in
-	  darwin)
-	    # we can't check for "0.0" in archive_cmds due to quoting
-	    # problems, so we reset it completely
-	    verstring=
-	    ;;
-	  *)
-	    verstring="0.0"
-	    ;;
-	  esac
-	  if test "$need_version" = no; then
-	    versuffix=
-	  else
-	    versuffix=".0.0"
-	  fi
-	fi
-
-	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
-	  major=
-	  versuffix=
-	  verstring=""
-	fi
-
-	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    func_warning "undefined symbols not allowed in $host shared libraries"
-	    build_libtool_libs=no
-	    build_old_libs=yes
-	  fi
-	else
-	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
-	fi
-
-      fi
-
-      func_generate_dlsyms "$libname" "$libname" "yes"
-      func_append libobjs " $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
-
-      if test "$opt_mode" != relink; then
-	# Remove our outputs, but don't remove object files since they
-	# may have been created when compiling PIC objects.
-	removelist=
-	tempremovelist=`$ECHO "$output_objdir/*"`
-	for p in $tempremovelist; do
-	  case $p in
-	    *.$objext | *.gcno)
-	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
-		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-		 then
-		   continue
-		 fi
-	       fi
-	       func_append removelist " $p"
-	       ;;
-	    *) ;;
-	  esac
-	done
-	test -n "$removelist" && \
-	  func_show_eval "${RM}r \$removelist"
-      fi
-
-      # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
-	func_append oldlibs " $output_objdir/$libname.$libext"
-
-	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
-      fi
-
-      # Eliminate all temporary directories.
-      #for path in $notinst_path; do
-      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
-      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
-      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
-      #done
-
-      if test -n "$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	temp_xrpath=
-	for libdir in $xrpath; do
-	  func_replace_sysroot "$libdir"
-	  func_append temp_xrpath " -R$func_replace_sysroot_result"
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_rpath " $libdir" ;;
-	  esac
-	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
-	  dependency_libs="$temp_xrpath $dependency_libs"
-	fi
-      fi
-
-      # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
-      dlfiles=
-      for lib in $old_dlfiles; do
-	case " $dlprefiles $dlfiles " in
-	*" $lib "*) ;;
-	*) func_append dlfiles " $lib" ;;
-	esac
-      done
-
-      # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
-      dlprefiles=
-      for lib in $old_dlprefiles; do
-	case "$dlprefiles " in
-	*" $lib "*) ;;
-	*) func_append dlprefiles " $lib" ;;
-	esac
-      done
-
-      if test "$build_libtool_libs" = yes; then
-	if test -n "$rpath"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # these systems don't actually have a c library (as such)!
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C library is in the System framework
-	    func_append deplibs " System.ltframework"
-	    ;;
-	  *-*-netbsd*)
-	    # Don't link with libc until the a.out ld.so is fixed.
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    ;;
-	  *)
-	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
-	      func_append deplibs " -lc"
-	    fi
-	    ;;
-	  esac
-	fi
-
-	# Transform deplibs into only deplibs that can be linked in shared.
-	name_save=$name
-	libname_save=$libname
-	release_save=$release
-	versuffix_save=$versuffix
-	major_save=$major
-	# I'm not sure if I'm treating the release correctly.  I think
-	# release should show up in the -l (ie -lgmp5) so we don't want to
-	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
-	newdeplibs=
-	droppeddeps=no
-	case $deplibs_check_method in
-	pass_all)
-	  # Don't check for shared/static.  Everything works.
-	  # This might be a little naive.  We might want to check
-	  # whether the library exists or not.  But this is on
-	  # osf3 & osf4 and I'm not really sure... Just
-	  # implementing what was already the behavior.
-	  newdeplibs=$deplibs
-	  ;;
-	test_compile)
-	  # This code stresses the "libraries are programs" paradigm to its
-	  # limits. Maybe even breaks it.  We compile a program, linking it
-	  # against the deplibs as a proxy for the library.  Then we can check
-	  # whether they linked in statically or dynamically with ldd.
-	  $opt_dry_run || $RM conftest.c
-	  cat > conftest.c <<EOF
-	  int main() { return 0; }
-EOF
-	  $opt_dry_run || $RM conftest
-	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
-	    ldd_output=`ldd conftest`
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		  case " $predeps $postdeps " in
-		  *" $i "*)
-		    func_append newdeplibs " $i"
-		    i=""
-		    ;;
-		  esac
-		fi
-		if test -n "$i" ; then
-		  libname=`eval "\\$ECHO \"$libname_spec\""`
-		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		  set dummy $deplib_matches; shift
-		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		    func_append newdeplibs " $i"
-		  else
-		    droppeddeps=yes
-		    echo
-		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		    echo "*** I have the capability to make that library automatically link in when"
-		    echo "*** you link to this library.  But I can only do this if you have a"
-		    echo "*** shared version of the library, which I believe you do not have"
-		    echo "*** because a test_compile did reveal that the linker did not use it for"
-		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
-		  fi
-		fi
-		;;
-	      *)
-		func_append newdeplibs " $i"
-		;;
-	      esac
-	    done
-	  else
-	    # Error occurred in the first compile.  Let's try to salvage
-	    # the situation: Compile a separate program for each library.
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		$opt_dry_run || $RM conftest
-		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
-		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		    case " $predeps $postdeps " in
-		    *" $i "*)
-		      func_append newdeplibs " $i"
-		      i=""
-		      ;;
-		    esac
-		  fi
-		  if test -n "$i" ; then
-		    libname=`eval "\\$ECHO \"$libname_spec\""`
-		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		    set dummy $deplib_matches; shift
-		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		      func_append newdeplibs " $i"
-		    else
-		      droppeddeps=yes
-		      echo
-		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		      echo "*** I have the capability to make that library automatically link in when"
-		      echo "*** you link to this library.  But I can only do this if you have a"
-		      echo "*** shared version of the library, which you do not appear to have"
-		      echo "*** because a test_compile did reveal that the linker did not use this one"
-		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
-		    fi
-		  fi
-		else
-		  droppeddeps=yes
-		  echo
-		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
-		  echo "*** make it link in!  You will probably need to install it or some"
-		  echo "*** library that it depends on before this library will be fully"
-		  echo "*** functional.  Installing it before continuing would be even better."
-		fi
-		;;
-	      *)
-		func_append newdeplibs " $i"
-		;;
-	      esac
-	    done
-	  fi
-	  ;;
-	file_magic*)
-	  set dummy $deplibs_check_method; shift
-	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		if test -n "$file_magic_glob"; then
-		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
-		else
-		  libnameglob=$libname
-		fi
-		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test "$want_nocaseglob" = yes; then
-		    shopt -s nocaseglob
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		    $nocaseglob
-		  else
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		  fi
-		  for potent_lib in $potential_libs; do
-		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null |
-			 $GREP " -> " >/dev/null; then
-			continue
-		      fi
-		      # The statement above tries to avoid entering an
-		      # endless loop below, in case of cyclic links.
-		      # We might still enter an endless loop, since a link
-		      # loop can be closed while we follow links,
-		      # but so what?
-		      potlib="$potent_lib"
-		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
-			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
-			esac
-		      done
-		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
-			 $SED -e 10q |
-			 $EGREP "$file_magic_regex" > /dev/null; then
-			func_append newdeplibs " $a_deplib"
-			a_deplib=""
-			break 2
-		      fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a file magic. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      func_append newdeplibs " $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	match_pattern*)
-	  set dummy $deplibs_check_method; shift
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
-		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
-		       $EGREP "$match_pattern_regex" > /dev/null; then
-		      func_append newdeplibs " $a_deplib"
-		      a_deplib=""
-		      break 2
-		    fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      func_append newdeplibs " $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	none | unknown | *)
-	  newdeplibs=""
-	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
-	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
-	    done
-	  fi
-	  case $tmp_deplibs in
-	  *[!\	\ ]*)
-	    echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
-	      echo "*** Warning: inter-library dependencies are not supported in this platform."
-	    else
-	      echo "*** Warning: inter-library dependencies are not known to be supported."
-	    fi
-	    echo "*** All declared inter-library dependencies are being dropped."
-	    droppeddeps=yes
-	    ;;
-	  esac
-	  ;;
-	esac
-	versuffix=$versuffix_save
-	major=$major_save
-	release=$release_save
-	libname=$libname_save
-	name=$name_save
-
-	case $host in
-	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library with the System framework
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
-	  ;;
-	esac
-
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
-	    echo
-	    echo "*** Warning: libtool could not satisfy all declared inter-library"
-	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
-	    echo "*** a static module, that should work as long as the dlopening"
-	    echo "*** application is linked with the -dlopen flag."
-	    if test -z "$global_symbol_pipe"; then
-	      echo
-	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
-	      build_libtool_libs=module
-	      build_old_libs=yes
-	    else
-	      build_libtool_libs=no
-	    fi
-	  else
-	    echo "*** The inter-library dependencies that have been dropped here will be"
-	    echo "*** automatically added whenever a program is linked with this library"
-	    echo "*** or is declared to -dlopen it."
-
-	    if test "$allow_undefined" = no; then
-	      echo
-	      echo "*** Since this library must not contain undefined symbols,"
-	      echo "*** because either the platform does not support them or"
-	      echo "*** it was explicitly requested with -no-undefined,"
-	      echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  fi
-	fi
-	# Done checking deplibs!
-	deplibs=$newdeplibs
-      fi
-      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
-      case $host in
-	*-*-darwin*)
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  ;;
-      esac
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $deplibs " in
-	  *" -L$path/$objdir "*)
-	    func_append new_libs " -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) func_append new_libs " $deplib" ;;
-	  esac
-	  ;;
-	*) func_append new_libs " $deplib" ;;
-	esac
-      done
-      deplibs="$new_libs"
-
-      # All the library-specific variables (install_libdir is set above).
-      library_names=
-      old_library=
-      dlname=
-
-      # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	# Remove ${wl} instances when linking with ld.
-	# FIXME: should test the right _cmds variable.
-	case $archive_cmds in
-	  *\$LD\ *) wl= ;;
-        esac
-	if test "$hardcode_into_libs" = yes; then
-	  # Hardcode the library paths
-	  hardcode_libdirs=
-	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
-	  for libdir in $rpath; do
-	    if test -n "$hardcode_libdir_flag_spec"; then
-	      if test -n "$hardcode_libdir_separator"; then
-		func_replace_sysroot "$libdir"
-		libdir=$func_replace_sysroot_result
-		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
-		else
-		  # Just accumulate the unique libdirs.
-		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		    ;;
-		  *)
-		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		    ;;
-		  esac
-		fi
-	      else
-		eval flag=\"$hardcode_libdir_flag_spec\"
-		func_append dep_rpath " $flag"
-	      fi
-	    elif test -n "$runpath_var"; then
-	      case "$perm_rpath " in
-	      *" $libdir "*) ;;
-	      *) func_append perm_rpath " $libdir" ;;
-	      esac
-	    fi
-	  done
-	  # Substitute the hardcoded libdirs into the rpath.
-	  if test -n "$hardcode_libdir_separator" &&
-	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
-	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
-	  fi
-	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
-	    # We should set the runpath_var.
-	    rpath=
-	    for dir in $perm_rpath; do
-	      func_append rpath "$dir:"
-	    done
-	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
-	  fi
-	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
-	fi
-
-	shlibpath="$finalize_shlibpath"
-	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
-	if test -n "$shlibpath"; then
-	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
-	fi
-
-	# Get the real and link names of the library.
-	eval shared_ext=\"$shrext_cmds\"
-	eval library_names=\"$library_names_spec\"
-	set dummy $library_names
-	shift
-	realname="$1"
-	shift
-
-	if test -n "$soname_spec"; then
-	  eval soname=\"$soname_spec\"
-	else
-	  soname="$realname"
-	fi
-	if test -z "$dlname"; then
-	  dlname=$soname
-	fi
-
-	lib="$output_objdir/$realname"
-	linknames=
-	for link
-	do
-	  func_append linknames " $link"
-	done
-
-	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	test "X$libobjs" = "X " && libobjs=
-
-	delfiles=
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols="$output_objdir/$libname.uexp"
-	  func_append delfiles " $export_symbols"
-	fi
-
-	orig_export_symbols=
-	case $host_os in
-	cygwin* | mingw* | cegcc*)
-	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
-	    # exporting using user supplied symfile
-	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
-	      # and it's NOT already a .def file. Must figure out
-	      # which of the given symbols are data symbols and tag
-	      # them as such. So, trigger use of export_symbols_cmds.
-	      # export_symbols gets reassigned inside the "prepare
-	      # the list of exported symbols" if statement, so the
-	      # include_expsyms logic still works.
-	      orig_export_symbols="$export_symbols"
-	      export_symbols=
-	      always_export_symbols=yes
-	    fi
-	  fi
-	  ;;
-	esac
-
-	# Prepare the list of exported symbols
-	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
-	    $opt_dry_run || $RM $export_symbols
-	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
-	    for cmd1 in $cmds; do
-	      IFS="$save_ifs"
-	      # Take the normal branch if the nm_file_list_spec branch
-	      # doesn't work or if tool conversion is not needed.
-	      case $nm_file_list_spec~$to_tool_file_cmd in
-		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
-		  try_normal_branch=yes
-		  eval cmd=\"$cmd1\"
-		  func_len " $cmd"
-		  len=$func_len_result
-		  ;;
-		*)
-		  try_normal_branch=no
-		  ;;
-	      esac
-	      if test "$try_normal_branch" = yes \
-		 && { test "$len" -lt "$max_cmd_len" \
-		      || test "$max_cmd_len" -le -1; }
-	      then
-		func_show_eval "$cmd" 'exit $?'
-		skipped_export=false
-	      elif test -n "$nm_file_list_spec"; then
-		func_basename "$output"
-		output_la=$func_basename_result
-		save_libobjs=$libobjs
-		save_output=$output
-		output=${output_objdir}/${output_la}.nm
-		func_to_tool_file "$output"
-		libobjs=$nm_file_list_spec$func_to_tool_file_result
-		func_append delfiles " $output"
-		func_verbose "creating $NM input file list: $output"
-		for obj in $save_libobjs; do
-		  func_to_tool_file "$obj"
-		  $ECHO "$func_to_tool_file_result"
-		done > "$output"
-		eval cmd=\"$cmd1\"
-		func_show_eval "$cmd" 'exit $?'
-		output=$save_output
-		libobjs=$save_libobjs
-		skipped_export=false
-	      else
-		# The command line is too long to execute in one step.
-		func_verbose "using reloadable object file for export list..."
-		skipped_export=:
-		# Break out early, otherwise skipped_export may be
-		# set to false by a later but shorter cmd.
-		break
-	      fi
-	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-	fi
-
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols="$export_symbols"
-	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
-	fi
-
-	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
-	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
-	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands which not all seds can handle. GNU sed should be fine
-	  # though. Also, the filter scales superlinearly with the number of
-	  # global variables. join(1) would be nice here, but unfortunately
-	  # isn't a blessed tool.
-	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
-	  export_symbols=$output_objdir/$libname.def
-	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	fi
-
-	tmp_deplibs=
-	for test_deplib in $deplibs; do
-	  case " $convenience " in
-	  *" $test_deplib "*) ;;
-	  *)
-	    func_append tmp_deplibs " $test_deplib"
-	    ;;
-	  esac
-	done
-	deplibs="$tmp_deplibs"
-
-	if test -n "$convenience"; then
-	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
-	    test -z "$libobjs"; then
-	    # extract the archives, so we have objects to list.
-	    # TODO: could optimize this to just extract one archive.
-	    whole_archive_flag_spec=
-	  fi
-	  if test -n "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  else
-	    gentop="$output_objdir/${outputname}x"
-	    func_append generated " $gentop"
-
-	    func_extract_archives $gentop $convenience
-	    func_append libobjs " $func_extract_archives_result"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	fi
-
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
-	  eval flag=\"$thread_safe_flag_spec\"
-	  func_append linker_flags " $flag"
-	fi
-
-	# Make a backup of the uninstalled library when relinking
-	if test "$opt_mode" = relink; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
-	fi
-
-	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
-	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	    eval test_cmds=\"$module_expsym_cmds\"
-	    cmds=$module_expsym_cmds
-	  else
-	    eval test_cmds=\"$module_cmds\"
-	    cmds=$module_cmds
-	  fi
-	else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    eval test_cmds=\"$archive_expsym_cmds\"
-	    cmds=$archive_expsym_cmds
-	  else
-	    eval test_cmds=\"$archive_cmds\"
-	    cmds=$archive_cmds
-	  fi
-	fi
-
-	if test "X$skipped_export" != "X:" &&
-	   func_len " $test_cmds" &&
-	   len=$func_len_result &&
-	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  :
-	else
-	  # The command line is too long to link in one step, link piecewise
-	  # or, if using GNU ld and skipped_export is not :, use a linker
-	  # script.
-
-	  # Save the value of $output and $libobjs because we want to
-	  # use them later.  If we have whole_archive_flag_spec, we
-	  # want to use save_libobjs as it was before
-	  # whole_archive_flag_spec was expanded, because we can't
-	  # assume the linker understands whole_archive_flag_spec.
-	  # This may have to be revisited, in case too many
-	  # convenience libraries get linked in and end up exceeding
-	  # the spec.
-	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	  fi
-	  save_output=$output
-	  func_basename "$output"
-	  output_la=$func_basename_result
-
-	  # Clear the reloadable object creation command queue and
-	  # initialize k to one.
-	  test_cmds=
-	  concat_cmds=
-	  objlist=
-	  last_robj=
-	  k=1
-
-	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
-	    output=${output_objdir}/${output_la}.lnkscript
-	    func_verbose "creating GNU ld script: $output"
-	    echo 'INPUT (' > $output
-	    for obj in $save_libobjs
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    echo ')' >> $output
-	    func_append delfiles " $output"
-	    func_to_tool_file "$output"
-	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
-	    output=${output_objdir}/${output_la}.lnk
-	    func_verbose "creating linker input file list: $output"
-	    : > $output
-	    set x $save_libobjs
-	    shift
-	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
-	      firstobj="$1 "
-	      shift
-	    fi
-	    for obj
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    func_append delfiles " $output"
-	    func_to_tool_file "$output"
-	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
-	  else
-	    if test -n "$save_libobjs"; then
-	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-${k}.$objext
-	      eval test_cmds=\"$reload_cmds\"
-	      func_len " $test_cmds"
-	      len0=$func_len_result
-	      len=$len0
-
-	      # Loop over the list of objects to be linked.
-	      for obj in $save_libobjs
-	      do
-		func_len " $obj"
-		func_arith $len + $func_len_result
-		len=$func_arith_result
-		if test "X$objlist" = X ||
-		   test "$len" -lt "$max_cmd_len"; then
-		  func_append objlist " $obj"
-		else
-		  # The command $test_cmds is almost too long, add a
-		  # command to the queue.
-		  if test "$k" -eq 1 ; then
-		    # The first file doesn't have a previous command to add.
-		    reload_objs=$objlist
-		    eval concat_cmds=\"$reload_cmds\"
-		  else
-		    # All subsequent reloadable object files will link in
-		    # the last one created.
-		    reload_objs="$objlist $last_robj"
-		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
-		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
-		  func_arith $k + 1
-		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
-		  objlist=" $obj"
-		  func_len " $last_robj"
-		  func_arith $len0 + $func_len_result
-		  len=$func_arith_result
-		fi
-	      done
-	      # Handle the remaining objects by creating one last
-	      # reloadable object file.  All subsequent reloadable object
-	      # files will link in the last one created.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
-	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
-	      fi
-	      func_append delfiles " $output"
-
-	    else
-	      output=
-	    fi
-
-	    if ${skipped_export-false}; then
-	      func_verbose "generating symbol list for \`$libname.la'"
-	      export_symbols="$output_objdir/$libname.exp"
-	      $opt_dry_run || $RM $export_symbols
-	      libobjs=$output
-	      # Append the command to create the export file.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
-	      if test -n "$last_robj"; then
-		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
-	      fi
-	    fi
-
-	    test -n "$save_libobjs" &&
-	      func_verbose "creating a temporary reloadable object file: $output"
-
-	    # Loop through the commands generated above and execute them.
-	    save_ifs="$IFS"; IFS='~'
-	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
-		  func_quote_for_expand "$cmd"
-		  eval "func_echo $func_quote_for_expand_result"
-	      }
-	      $opt_dry_run || eval "$cmd" || {
-		lt_exit=$?
-
-		# Restore the uninstalled library and exit
-		if test "$opt_mode" = relink; then
-		  ( cd "$output_objdir" && \
-		    $RM "${realname}T" && \
-		    $MV "${realname}U" "$realname" )
-		fi
-
-		exit $lt_exit
-	      }
-	    done
-	    IFS="$save_ifs"
-
-	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-
-          if ${skipped_export-false}; then
-	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols="$export_symbols"
-	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
-	    fi
-
-	    if test -n "$orig_export_symbols"; then
-	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
-	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands which not all seds can handle. GNU sed should be fine
-	      # though. Also, the filter scales superlinearly with the number of
-	      # global variables. join(1) would be nice here, but unfortunately
-	      # isn't a blessed tool.
-	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
-	      export_symbols=$output_objdir/$libname.def
-	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	    fi
-	  fi
-
-	  libobjs=$output
-	  # Restore the value of output.
-	  output=$save_output
-
-	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	  # Expand the library linking commands again to reset the
-	  # value of $libobjs for piecewise linking.
-
-	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
-	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	      cmds=$module_expsym_cmds
-	    else
-	      cmds=$module_cmds
-	    fi
-	  else
-	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	      cmds=$archive_expsym_cmds
-	    else
-	      cmds=$archive_cmds
-	    fi
-	  fi
-	fi
-
-	if test -n "$delfiles"; then
-	  # Append the command to remove temporary files to $cmds.
-	  eval cmds=\"\$cmds~\$RM $delfiles\"
-	fi
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  func_append libobjs " $func_extract_archives_result"
-	  test "X$libobjs" = "X " && libobjs=
-	fi
-
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $opt_silent || {
-	    func_quote_for_expand "$cmd"
-	    eval "func_echo $func_quote_for_expand_result"
-	  }
-	  $opt_dry_run || eval "$cmd" || {
-	    lt_exit=$?
-
-	    # Restore the uninstalled library and exit
-	    if test "$opt_mode" = relink; then
-	      ( cd "$output_objdir" && \
-	        $RM "${realname}T" && \
-		$MV "${realname}U" "$realname" )
-	    fi
-
-	    exit $lt_exit
-	  }
-	done
-	IFS="$save_ifs"
-
-	# Restore the uninstalled library and exit
-	if test "$opt_mode" = relink; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
-	  if test -n "$convenience"; then
-	    if test -z "$whole_archive_flag_spec"; then
-	      func_show_eval '${RM}r "$gentop"'
-	    fi
-	  fi
-
-	  exit $EXIT_SUCCESS
-	fi
-
-	# Create links to the real library.
-	for linkname in $linknames; do
-	  if test "$realname" != "$linkname"; then
-	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
-	  fi
-	done
-
-	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
-	  # On all known operating systems, these are identical.
-	  dlname="$soname"
-	fi
-      fi
-      ;;
-
-    obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
-
-      test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
-
-      test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for objects"
-
-      case $output in
-      *.lo)
-	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
-
-	libobj=$output
-	func_lo2o "$libobj"
-	obj=$func_lo2o_result
-	;;
-      *)
-	libobj=
-	obj="$output"
-	;;
-      esac
-
-      # Delete the old objects.
-      $opt_dry_run || $RM $obj $libobj
-
-      # Objects from convenience libraries.  This assumes
-      # single-version convenience libraries.  Whenever we create
-      # different ones for PIC/non-PIC, this we'll have to duplicate
-      # the extraction.
-      reload_conv_objs=
-      gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
-      if test -n "$convenience"; then
-	if test -n "$whole_archive_flag_spec"; then
-	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
-	else
-	  gentop="$output_objdir/${obj}x"
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $convenience
-	  reload_conv_objs="$reload_objs $func_extract_archives_result"
-	fi
-      fi
-
-      # If we're not building shared, we need to use non_pic_objs
-      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
-
-      # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
-      output="$obj"
-      func_execute_cmds "$reload_cmds" 'exit $?'
-
-      # Exit if we aren't doing a library object file.
-      if test -z "$libobj"; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      if test "$build_libtool_libs" != yes; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	# Create an invalid libtool object if no PIC, so that we don't
-	# accidentally link it into a program.
-	# $show "echo timestamp > $libobj"
-	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
-	exit $EXIT_SUCCESS
-      fi
-
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
-	# Only do commands if we really have different PIC objects.
-	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
-	func_execute_cmds "$reload_cmds" 'exit $?'
-      fi
-
-      if test -n "$gentop"; then
-	func_show_eval '${RM}r "$gentop"'
-      fi
-
-      exit $EXIT_SUCCESS
-      ;;
-
-    prog)
-      case $host in
-	*cygwin*) func_stripname '' '.exe' "$output"
-	          output=$func_stripname_result.exe;;
-      esac
-      test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for programs"
-
-      test "$preload" = yes \
-        && test "$dlopen_support" = unknown \
-	&& test "$dlopen_self" = unknown \
-	&& test "$dlopen_self_static" = unknown && \
-	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
-
-      case $host in
-      *-*-rhapsody* | *-*-darwin1.[012])
-	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	;;
-      esac
-
-      case $host in
-      *-*-darwin*)
-	# Don't allow lazy linking, it breaks C++ global constructors
-	# But is supposedly fixed on 10.4 or later (yay!).
-	if test "$tagname" = CXX ; then
-	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
-	    10.[0123])
-	      func_append compile_command " ${wl}-bind_at_load"
-	      func_append finalize_command " ${wl}-bind_at_load"
-	    ;;
-	  esac
-	fi
-	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	;;
-      esac
-
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $compile_deplibs " in
-	  *" -L$path/$objdir "*)
-	    func_append new_libs " -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $compile_deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) func_append new_libs " $deplib" ;;
-	  esac
-	  ;;
-	*) func_append new_libs " $deplib" ;;
-	esac
-      done
-      compile_deplibs="$new_libs"
-
-
-      func_append compile_command " $compile_deplibs"
-      func_append finalize_command " $finalize_deplibs"
-
-      if test -n "$rpath$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	for libdir in $rpath $xrpath; do
-	  # This is the magic to use -rpath.
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_rpath " $libdir" ;;
-	  esac
-	done
-      fi
-
-      # Now hardcode the library paths
-      rpath=
-      hardcode_libdirs=
-      for libdir in $compile_rpath $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    func_append rpath " $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append perm_rpath " $libdir" ;;
-	  esac
-	fi
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$libdir:"*) ;;
-	  ::) dllsearchpath=$libdir;;
-	  *) func_append dllsearchpath ":$libdir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) func_append dllsearchpath ":$testbindir";;
-	  esac
-	  ;;
-	esac
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      compile_rpath="$rpath"
-
-      rpath=
-      hardcode_libdirs=
-      for libdir in $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    func_append rpath " $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$finalize_perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) func_append finalize_perm_rpath " $libdir" ;;
-	  esac
-	fi
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      finalize_rpath="$rpath"
-
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
-	# Transform all the library objects into standard objects.
-	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
-      fi
-
-      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
-
-      # template prelinking step
-      if test -n "$prelink_cmds"; then
-	func_execute_cmds "$prelink_cmds" 'exit $?'
-      fi
-
-      wrappers_required=yes
-      case $host in
-      *cegcc* | *mingw32ce*)
-        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=no
-        ;;
-      *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
-        ;;
-      *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
-        ;;
-      esac
-      if test "$wrappers_required" = no; then
-	# Replace the output file specification.
-	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
-
-	# We have no uninstalled library dependencies, so finalize right now.
-	exit_status=0
-	func_show_eval "$link_command" 'exit_status=$?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.${objext}"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
-	fi
-
-	exit $exit_status
-      fi
-
-      if test -n "$compile_shlibpath$finalize_shlibpath"; then
-	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
-      fi
-      if test -n "$finalize_shlibpath"; then
-	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
-      fi
-
-      compile_var=
-      finalize_var=
-      if test -n "$runpath_var"; then
-	if test -n "$perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $perm_rpath; do
-	    func_append rpath "$dir:"
-	  done
-	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-	if test -n "$finalize_perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $finalize_perm_rpath; do
-	    func_append rpath "$dir:"
-	  done
-	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-      fi
-
-      if test "$no_install" = yes; then
-	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
-	# Replace the output file specification.
-	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	# Delete the old output file.
-	$opt_dry_run || $RM $output
-	# Link the executable and exit
-	func_show_eval "$link_command" 'exit $?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
-
-	func_warning "this platform does not like uninstalled shared libraries"
-	func_warning "\`$output' will be relinked during installation"
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
-
-      # Replace the output file specification.
-      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
-      # Delete the old output files.
-      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
-      func_show_eval "$link_command" 'exit $?'
-
-      if test -n "$postlink_cmds"; then
-	func_to_tool_file "$output_objdir/$outputname"
-	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	func_execute_cmds "$postlink_cmds" 'exit $?'
-      fi
-
-      # Now create the wrapper script.
-      func_verbose "creating $output"
-
-      # Quote the relink command for shipping.
-      if test -n "$relink_command"; then
-	# Preserve any variables that may affect compiler behavior
-	for var in $variables_saved_for_relink; do
-	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	  elif eval var_value=\$$var; test -z "$var_value"; then
-	    relink_command="$var=; export $var; $relink_command"
-	  else
-	    func_quote_for_eval "$var_value"
-	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	  fi
-	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      fi
-
-      # Only actually do things if not in dry run mode.
-      $opt_dry_run || {
-	# win32 will think the script is a binary if it has
-	# a .exe suffix, so we strip it off here.
-	case $output in
-	  *.exe) func_stripname '' '.exe' "$output"
-	         output=$func_stripname_result ;;
-	esac
-	# test for cygwin because mv fails w/o .exe extensions
-	case $host in
-	  *cygwin*)
-	    exeext=.exe
-	    func_stripname '' '.exe' "$outputname"
-	    outputname=$func_stripname_result ;;
-	  *) exeext= ;;
-	esac
-	case $host in
-	  *cygwin* | *mingw* )
-	    func_dirname_and_basename "$output" "" "."
-	    output_name=$func_basename_result
-	    output_path=$func_dirname_result
-	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
-	    cwrapper="$output_path/$output_name.exe"
-	    $RM $cwrappersource $cwrapper
-	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_cwrapperexe_src > $cwrappersource
-
-	    # The wrapper executable is built using the $host compiler,
-	    # because it contains $host paths and files. If cross-
-	    # compiling, it, like the target executable, must be
-	    # executed on the $host or under an emulation environment.
-	    $opt_dry_run || {
-	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
-	      $STRIP $cwrapper
-	    }
-
-	    # Now, create the wrapper script for func_source use:
-	    func_ltwrapper_scriptname $cwrapper
-	    $RM $func_ltwrapper_scriptname_result
-	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
-	    $opt_dry_run || {
-	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host" ; then
-		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
-	      else
-		func_emit_wrapper no > $func_ltwrapper_scriptname_result
-	      fi
-	    }
-	  ;;
-	  * )
-	    $RM $output
-	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_wrapper no > $output
-	    chmod +x $output
-	  ;;
-	esac
-      }
-      exit $EXIT_SUCCESS
-      ;;
-    esac
-
-    # See if we need to build an old-fashioned archive.
-    for oldlib in $oldlibs; do
-
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save $symfileobj"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
-	  build_libtool_libs=no
-	else
-	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    func_append oldobjs " $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
-
-      if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
-	func_append generated " $gentop"
-
-	func_extract_archives $gentop $addlibs
-	func_append oldobjs " $func_extract_archives_result"
-      fi
-
-      # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
-	cmds=$old_archive_from_new_cmds
-      else
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  func_append generated " $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  func_append oldobjs " $func_extract_archives_result"
-	fi
-
-	# POSIX demands no paths to be encoded in archives.  We have
-	# to avoid creating archives with duplicate basenames if we
-	# might have to extract them afterwards, e.g., when creating a
-	# static archive out of a convenience library, or when linking
-	# the entirety of a libtool archive into another (currently
-	# not supported by libtool).
-	if (for obj in $oldobjs
-	    do
-	      func_basename "$obj"
-	      $ECHO "$func_basename_result"
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	  :
-	else
-	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
-	  func_append generated " $gentop"
-	  func_mkdir_p "$gentop"
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  counter=1
-	  for obj in $save_oldobjs
-	  do
-	    func_basename "$obj"
-	    objbase="$func_basename_result"
-	    case " $oldobjs " in
-	    " ") oldobjs=$obj ;;
-	    *[\ /]"$objbase "*)
-	      while :; do
-		# Make sure we don't pick an alternate name that also
-		# overlaps.
-		newobj=lt$counter-$objbase
-		func_arith $counter + 1
-		counter=$func_arith_result
-		case " $oldobjs " in
-		*[\ /]"$newobj "*) ;;
-		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
-		esac
-	      done
-	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      func_append oldobjs " $gentop/$newobj"
-	      ;;
-	    *) func_append oldobjs " $obj" ;;
-	    esac
-	  done
-	fi
-	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-	tool_oldlib=$func_to_tool_file_result
-	eval cmds=\"$old_archive_cmds\"
-
-	func_len " $cmds"
-	len=$func_len_result
-	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  cmds=$old_archive_cmds
-	elif test -n "$archiver_list_spec"; then
-	  func_verbose "using command file archive linking..."
-	  for obj in $oldobjs
-	  do
-	    func_to_tool_file "$obj"
-	    $ECHO "$func_to_tool_file_result"
-	  done > $output_objdir/$libname.libcmd
-	  func_to_tool_file "$output_objdir/$libname.libcmd"
-	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
-	  cmds=$old_archive_cmds
-	else
-	  # the command line is too long to link in one step, link in parts
-	  func_verbose "using piecewise archive linking..."
-	  save_RANLIB=$RANLIB
-	  RANLIB=:
-	  objlist=
-	  concat_cmds=
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  # Is there a better way of finding the last object in the list?
-	  for obj in $save_oldobjs
-	  do
-	    last_oldobj=$obj
-	  done
-	  eval test_cmds=\"$old_archive_cmds\"
-	  func_len " $test_cmds"
-	  len0=$func_len_result
-	  len=$len0
-	  for obj in $save_oldobjs
-	  do
-	    func_len " $obj"
-	    func_arith $len + $func_len_result
-	    len=$func_arith_result
-	    func_append objlist " $obj"
-	    if test "$len" -lt "$max_cmd_len"; then
-	      :
-	    else
-	      # the above command should be used before it gets too long
-	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
-		RANLIB=$save_RANLIB
-	      fi
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
-	      objlist=
-	      len=$len0
-	    fi
-	  done
-	  RANLIB=$save_RANLIB
-	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
-	    eval cmds=\"\$concat_cmds\"
-	  else
-	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
-	  fi
-	fi
-      fi
-      func_execute_cmds "$cmds" 'exit $?'
-    done
-
-    test -n "$generated" && \
-      func_show_eval "${RM}r$generated"
-
-    # Now create the libtool archive.
-    case $output in
-    *.la)
-      old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
-      func_verbose "creating $output"
-
-      # Preserve any variables that may affect compiler behavior
-      for var in $variables_saved_for_relink; do
-	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	elif eval var_value=\$$var; test -z "$var_value"; then
-	  relink_command="$var=; export $var; $relink_command"
-	else
-	  func_quote_for_eval "$var_value"
-	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	fi
-      done
-      # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
-	relink_command=
-      fi
-
-      # Only create the output if not a dry run.
-      $opt_dry_run || {
-	for installed in no yes; do
-	  if test "$installed" = yes; then
-	    if test -z "$install_libdir"; then
-	      break
-	    fi
-	    output="$output_objdir/$outputname"i
-	    # Replace all uninstalled libtool libraries with the installed ones
-	    newdependency_libs=
-	    for deplib in $dependency_libs; do
-	      case $deplib in
-	      *.la)
-		func_basename "$deplib"
-		name="$func_basename_result"
-		func_resolve_sysroot "$deplib"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$deplib' is not a valid libtool archive"
-		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      -L*)
-		func_stripname -L '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		func_append newdependency_libs " -L$func_replace_sysroot_result"
-		;;
-	      -R*)
-		func_stripname -R '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		func_append newdependency_libs " -R$func_replace_sysroot_result"
-		;;
-	      *) func_append newdependency_libs " $deplib" ;;
-	      esac
-	    done
-	    dependency_libs="$newdependency_libs"
-	    newdlfiles=
-
-	    for lib in $dlfiles; do
-	      case $lib in
-	      *.la)
-	        func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      *) func_append newdlfiles " $lib" ;;
-	      esac
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-	      *.la)
-		# Only pass preopened files to the pseudo-archive (for
-		# eventual linking with the app. that links it) if we
-		# didn't already link the preopened objects directly into
-		# the library:
-		func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      esac
-	    done
-	    dlprefiles="$newdlprefiles"
-	  else
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      func_append newdlfiles " $abs"
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      func_append newdlprefiles " $abs"
-	    done
-	    dlprefiles="$newdlprefiles"
-	  fi
-	  $RM $output
-	  # place dlname in correct position for cygwin
-	  # In fact, it would be nice if we could use this code for all target
-	  # systems that can't hard-code library paths into their executables
-	  # and that have no shared library path variable independent of PATH,
-	  # but it turns out we can't easily determine that from inspecting
-	  # libtool variables, so we have to hard-code the OSs to which it
-	  # applies here; at the moment, that means platforms that use the PE
-	  # object format with DLL files.  See the long comment at the top of
-	  # tests/bindir.at for full details.
-	  tdlname=$dlname
-	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
-	      # If a -bindir argument was supplied, place the dll there.
-	      if test "x$bindir" != x ;
-	      then
-		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result$dlname
-	      else
-		# Otherwise fall back on heuristic.
-		tdlname=../bin/$dlname
-	      fi
-	      ;;
-	  esac
-	  $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that can not go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
-	    $ECHO >> $output "\
-relink_command=\"$relink_command\""
-	  fi
-	done
-      }
-
-      # Do a symbolic link so that the libtool archive can be found in
-      # LD_LIBRARY_PATH before the program is installed.
-      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
-      ;;
-    esac
-    exit $EXIT_SUCCESS
-}
-
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-    func_mode_link ${1+"$@"}
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
-    $opt_debug
-    RM="$nonopt"
-    files=
-    rmforce=
-    exit_status=0
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    for arg
-    do
-      case $arg in
-      -f) func_append RM " $arg"; rmforce=yes ;;
-      -*) func_append RM " $arg" ;;
-      *) func_append files " $arg" ;;
-      esac
-    done
-
-    test -z "$RM" && \
-      func_fatal_help "you must specify an RM program"
-
-    rmdirs=
-
-    for file in $files; do
-      func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	odir="$objdir"
-      else
-	odir="$dir/$objdir"
-      fi
-      func_basename "$file"
-      name="$func_basename_result"
-      test "$opt_mode" = uninstall && odir="$dir"
-
-      # Remember odir for removal later, being careful to avoid duplicates
-      if test "$opt_mode" = clean; then
-	case " $rmdirs " in
-	  *" $odir "*) ;;
-	  *) func_append rmdirs " $odir" ;;
-	esac
-      fi
-
-      # Don't error if the file doesn't exist and rm -f was used.
-      if { test -L "$file"; } >/dev/null 2>&1 ||
-	 { test -h "$file"; } >/dev/null 2>&1 ||
-	 test -f "$file"; then
-	:
-      elif test -d "$file"; then
-	exit_status=1
-	continue
-      elif test "$rmforce" = yes; then
-	continue
-      fi
-
-      rmfiles="$file"
-
-      case $name in
-      *.la)
-	# Possibly a libtool archive, so verify it.
-	if func_lalib_p "$file"; then
-	  func_source $dir/$name
-
-	  # Delete the libtool libraries and symlinks.
-	  for n in $library_names; do
-	    func_append rmfiles " $odir/$n"
-	  done
-	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
-
-	  case "$opt_mode" in
-	  clean)
-	    case " $library_names " in
-	    *" $dlname "*) ;;
-	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
-	    esac
-	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
-	    ;;
-	  uninstall)
-	    if test -n "$library_names"; then
-	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
-	    fi
-
-	    if test -n "$old_library"; then
-	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
-	    fi
-	    # FIXME: should reinstall the best remaining shared library.
-	    ;;
-	  esac
-	fi
-	;;
-
-      *.lo)
-	# Possibly a libtool object, so verify it.
-	if func_lalib_p "$file"; then
-
-	  # Read the .lo file
-	  func_source $dir/$name
-
-	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; then
-	    func_append rmfiles " $dir/$pic_object"
-	  fi
-
-	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" &&
-	     test "$non_pic_object" != none; then
-	    func_append rmfiles " $dir/$non_pic_object"
-	  fi
-	fi
-	;;
-
-      *)
-	if test "$opt_mode" = clean ; then
-	  noexename=$name
-	  case $file in
-	  *.exe)
-	    func_stripname '' '.exe' "$file"
-	    file=$func_stripname_result
-	    func_stripname '' '.exe' "$name"
-	    noexename=$func_stripname_result
-	    # $file with .exe has already been added to rmfiles,
-	    # add $file without .exe
-	    func_append rmfiles " $file"
-	    ;;
-	  esac
-	  # Do a test to see if this is a libtool program.
-	  if func_ltwrapper_p "$file"; then
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      relink_command=
-	      func_source $func_ltwrapper_scriptname_result
-	      func_append rmfiles " $func_ltwrapper_scriptname_result"
-	    else
-	      relink_command=
-	      func_source $dir/$noexename
-	    fi
-
-	    # note $name still contains .exe if it was in $file originally
-	    # as does the version of $file that was added into $rmfiles
-	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
-	      func_append rmfiles " $odir/lt-$name"
-	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      func_append rmfiles " $odir/lt-${noexename}.c"
-	    fi
-	  fi
-	fi
-	;;
-      esac
-      func_show_eval "$RM $rmfiles" 'exit_status=1'
-    done
-
-    # Try to remove the ${objdir}s in the directories where we deleted files
-    for dir in $rmdirs; do
-      if test -d "$dir"; then
-	func_show_eval "rmdir $dir >/dev/null 2>&1"
-      fi
-    done
-
-    exit $exit_status
-}
-
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
-
-test -z "$opt_mode" && {
-  help="$generic_help"
-  func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$opt_mode'"
-
-if test -n "$exec_cmd"; then
-  eval exec "$exec_cmd"
-  exit $EXIT_FAILURE
-fi
-
-exit $exit_status
-
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them.  This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration.  But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
-# vi:sw=2
-
diff --git a/deps/SDL2/build-scripts/mkinstalldirs b/deps/SDL2/build-scripts/mkinstalldirs
deleted file mode 100755
index 8ab885e..0000000
--- a/deps/SDL2/build-scripts/mkinstalldirs
+++ /dev/null
@@ -1,99 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman at prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-errstatus=0
-dirmode=""
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
-
-# process command line arguments
-while test $# -gt 0 ; do
-   case "${1}" in
-     -h | --help | --h* )			# -h for help
-	echo "${usage}" 1>&2; exit 0 ;;
-     -m )					# -m PERM arg
-	shift
-	test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
-	dirmode="${1}"
-	shift ;;
-     -- ) shift; break ;;			# stop option processing
-     -* ) echo "${usage}" 1>&2; exit 1 ;;	# unknown option
-     * )  break ;;				# first non-opt arg
-   esac
-done
-
-for file
-do
-  if test -d "$file"; then
-    shift
-  else
-    break
-  fi
-done
-
-case $# in
-0) exit 0 ;;
-esac
-
-case $dirmode in
-'')
-  if mkdir -p -- . 2>/dev/null; then
-    echo "mkdir -p -- $*"
-    exec mkdir -p -- "$@"
-  fi ;;
-*)
-  if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
-    echo "mkdir -m $dirmode -p -- $*"
-    exec mkdir -m "$dirmode" -p -- "$@"
-  fi ;;
-esac
-
-for file
-do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
-
-   pathcomp=
-   for d
-   do
-     pathcomp="$pathcomp$d"
-     case "$pathcomp" in
-       -* ) pathcomp=./$pathcomp ;;
-     esac
-
-     if test ! -d "$pathcomp"; then
-	echo "mkdir $pathcomp"
-
-	mkdir "$pathcomp" || lasterr=$?
-
-	if test ! -d "$pathcomp"; then
-	  errstatus=$lasterr
-	else
-	  if test ! -z "$dirmode"; then
-	     echo "chmod $dirmode $pathcomp"
-
-	     lasterr=""
-	     chmod "$dirmode" "$pathcomp" || lasterr=$?
-
-	     if test ! -z "$lasterr"; then
-	       errstatus=$lasterr
-	     fi
-	  fi
-	fi
-     fi
-
-     pathcomp="$pathcomp/"
-   done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 3
-# End:
-# mkinstalldirs ends here
diff --git a/deps/SDL2/build-scripts/raspberrypi-buildbot.sh b/deps/SDL2/build-scripts/raspberrypi-buildbot.sh
deleted file mode 100755
index 4c746c0..0000000
--- a/deps/SDL2/build-scripts/raspberrypi-buildbot.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-
-# This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
-#  x86 Linux to Raspberry Pi.
-
-# The final tarball can be unpacked in the root directory of a RPi,
-#  so the SDL2 install lands in /usr/local. Run ldconfig, and then
-#  you should be able to build and run SDL2-based software on your
-#  Pi. Standard configure scripts should be able to find SDL and
-#  build against it, and sdl2-config should work correctly on the
-#  actual device.
-
-TARBALL="$1"
-if [ -z $1 ]; then
-    TARBALL=sdl-raspberrypi.tar.bz2
-fi
-
-OSTYPE=`uname -s`
-if [ "$OSTYPE" != "Linux" ]; then
-    # !!! FIXME
-    echo "This only works on x86 or x64-64 Linux at the moment." 1>&2
-    exit 1
-fi
-
-if [ "x$MAKE" == "x" ]; then
-    NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
-    let NCPU=$NCPU+1
-    MAKE="make -j$NCPU"
-fi
-
-BUILDBOTDIR="raspberrypi-buildbot"
-PARENTDIR="$PWD"
-
-set -e
-set -x
-rm -f $TARBALL
-rm -rf $BUILDBOTDIR
-mkdir -p $BUILDBOTDIR
-pushd $BUILDBOTDIR
-
-SYSROOT="/opt/rpi-sysroot"
-export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
-# -L$SYSROOT/usr/lib/arm-linux-gnueabihf"
-# !!! FIXME: shouldn't have to --disable-* things here.
-../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
-$MAKE
-$MAKE install
-# Fix up a few things to a real install path on a real Raspberry Pi...
-perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
-mkdir -p ./usr
-mv ./rpi-sdl2-installed ./usr/local
-
-popd
-tar -cjvvf $TARBALL -C $BUILDBOTDIR usr
-rm -rf $BUILDBOTDIR
-
-set +x
-echo "All done. Final installable is in $TARBALL ...";
-
-
diff --git a/deps/SDL2/build-scripts/showrev.sh b/deps/SDL2/build-scripts/showrev.sh
deleted file mode 100755
index 2a68fe6..0000000
--- a/deps/SDL2/build-scripts/showrev.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-#
-# Print the current source revision, if available
-
-# FIXME: this prints the tip, which isn't useful if you're on a different
-#  branch, or just not sync'd to the tip.
-hg tip --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1)
diff --git a/deps/SDL2/build-scripts/strip_fPIC.sh b/deps/SDL2/build-scripts/strip_fPIC.sh
deleted file mode 100755
index 8719b89..0000000
--- a/deps/SDL2/build-scripts/strip_fPIC.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-#
-# libtool assumes that the compiler can handle the -fPIC flag
-# This isn't always true (for example, nasm can't handle it)
-command=""
-while [ $# -gt 0 ]; do
-    case "$1" in
-        -?PIC)
-            # Ignore -fPIC and -DPIC options
-            ;;
-        -fno-common)
-            # Ignore -fPIC and -DPIC options
-            ;;
-        *)
-            command="$command $1"
-            ;;
-    esac
-    shift
-done
-echo $command
-exec $command
diff --git a/deps/SDL2/build-scripts/updaterev.sh b/deps/SDL2/build-scripts/updaterev.sh
deleted file mode 100755
index 485d045..0000000
--- a/deps/SDL2/build-scripts/updaterev.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-#
-# Generate a header file with the current source revision
-
-outdir=`pwd`
-cd `dirname $0`
-srcdir=..
-header=$outdir/include/SDL_revision.h
-
-rev=`sh showrev.sh 2>/dev/null`
-if [ "$rev" != "" -a "$rev" != "hg-0:baadf00d" ]; then
-    revnum=`echo $rev | sed 's,hg-\([0-9]*\).*,\1,'`
-    echo "#define SDL_REVISION \"$rev\"" >"$header.new"
-    echo "#define SDL_REVISION_NUMBER $revnum" >>"$header.new"
-    if diff $header $header.new >/dev/null 2>&1; then
-        rm "$header.new"
-    else
-        mv "$header.new" "$header"
-    fi
-fi
diff --git a/deps/SDL2/cmake/macros.cmake b/deps/SDL2/cmake/macros.cmake
deleted file mode 100644
index c234a56..0000000
--- a/deps/SDL2/cmake/macros.cmake
+++ /dev/null
@@ -1,73 +0,0 @@
-macro(SET_OPTION _NAME _DESC)
-  list(APPEND ALLOPTIONS ${_NAME})
-  if(${ARGC} EQUAL 3)
-    set(_DEFLT ${ARGV2})
-  else()
-    set(_DEFLT OFF)
-  endif()
-  option(${_NAME} ${_DESC} ${_DEFLT})
-endmacro()
-
-macro(DEP_OPTION _NAME _DESC _DEFLT _DEPTEST _FAILDFLT)
-  list(APPEND ALLOPTIONS ${_NAME})
-  cmake_dependent_option(${_NAME} ${_DESC} ${_DEFLT} ${_DEPTEST} ${_FAILDFLT})
-endmacro()
-
-macro(OPTION_STRING _NAME _DESC _VALUE)
-  list(APPEND ALLOPTIONS ${_NAME})
-  set(${_NAME} ${_VALUE} CACHE STRING "${_DESC}")
-  set(HAVE_${_NAME} ${_VALUE})
-ENDMACRO()
-
-# Message Output
-macro(MESSAGE_WARN _TEXT)
-  message(STATUS "*** WARNING: ${_TEXT}")
-endmacro()
-
-macro(MESSAGE_ERROR _TEXT)
-  message(FATAL_ERROR "*** ERROR: ${_TEXT}")
-endmacro()
-
-macro(MESSAGE_BOOL_OPTION _NAME _VALUE)
-  if(${_VALUE})
-    message(STATUS "  ${_NAME}:\tON")
-  else()
-    message(STATUS "  ${_NAME}:\tOFF")
-  endif()
-endmacro()
-
-macro(MESSAGE_TESTED_OPTION _NAME)
-  set(_REQVALUE ${${_NAME}})
-  set(_PAD " ")
-  if(${ARGC} EQUAL 2)
-    set(_PAD ${ARGV1})
-  endif()
-  if(NOT HAVE_${_NAME})
-    set(HAVE_${_NAME} OFF)
-  elseif("${HAVE_${_NAME}}" MATCHES "1|TRUE|YES|Y")
-    set(HAVE_${_NAME} ON)
-  endif()
-  message(STATUS "  ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_NAME}}")
-endmacro()
-
-macro(LISTTOSTR _LIST _OUTPUT)
-  if(${ARGC} EQUAL 3)
-    # prefix for each element
-    set(_LPREFIX ${ARGV2})
-  else()
-    set(_LPREFIX "")
-  endif()
-  # Do not use string(REPLACE ";" " ") here to avoid messing up list
-  # entries
-  foreach(_ITEM ${${_LIST}})
-    set(${_OUTPUT} "${_LPREFIX}${_ITEM} ${${_OUTPUT}}")
-  endforeach()
-endmacro()
-
-macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
-  set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
-  set(CMAKE_REQUIRED_DEFINITIONS "-ObjC ${PREV_REQUIRED_DEFS}")
-  CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
-  set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
-endmacro()
-
diff --git a/deps/SDL2/cmake/sdlchecks.cmake b/deps/SDL2/cmake/sdlchecks.cmake
deleted file mode 100644
index fe76378..0000000
--- a/deps/SDL2/cmake/sdlchecks.cmake
+++ /dev/null
@@ -1,869 +0,0 @@
-macro(CheckDLOPEN)
-  check_function_exists(dlopen HAVE_DLOPEN)
-  if(NOT HAVE_DLOPEN)
-    foreach(_LIBNAME dl tdl)
-      check_library_exists("${_LIBNAME}" "dlopen" "" DLOPEN_LIB)
-      if(DLOPEN_LIB)
-        list(APPEND EXTRA_LIBS ${_LIBNAME})
-        set(_DLLIB ${_LIBNAME})
-        set(HAVE_DLOPEN TRUE)
-        break()
-      endif(DLOPEN_LIB)
-    endforeach()
-  endif()
-
-  if(HAVE_DLOPEN)
-    if(_DLLIB)
-      set(CMAKE_REQUIRED_LIBRARIES ${_DLLIB})
-    endif()
-    check_c_source_compiles("
-       #include <dlfcn.h>
-       int main(int argc, char **argv) {
-         void *handle = dlopen(\"\", RTLD_NOW);
-         const char *loaderror = (char *) dlerror();
-       }" HAVE_DLOPEN)
-    set(CMAKE_REQUIRED_LIBRARIES)
-  endif()
-
-  if (HAVE_DLOPEN)
-    set(SDL_LOADSO_DLOPEN 1)
-    set(HAVE_SDL_DLOPEN TRUE)
-    file(GLOB DLOPEN_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dlopen/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${DLOPEN_SOURCES})
-    set(HAVE_SDL_LOADSO TRUE)
-  endif()
-endmacro(CheckDLOPEN)
-
-# Requires:
-# - n/a
-macro(CheckOSS)
-  if(OSS)
-    set(OSS_HEADER_FILE "sys/soundcard.h")
-    check_c_source_compiles("
-        #include <sys/soundcard.h>
-        int main() { int arg = SNDCTL_DSP_SETFRAGMENT; }" OSS_FOUND)
-    if(NOT OSS_FOUND)
-      set(OSS_HEADER_FILE "soundcard.h")
-      check_c_source_compiles("
-          #include <soundcard.h>
-          int main() { int arg = SNDCTL_DSP_SETFRAGMENT; }" OSS_FOUND)
-    endif(NOT OSS_FOUND)
-
-    if(OSS_FOUND)
-      set(HAVE_OSS TRUE)
-      file(GLOB OSS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dsp/*.c)
-      if(OSS_HEADER_FILE STREQUAL "soundcard.h")
-        set(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1)
-      endif(OSS_HEADER_FILE STREQUAL "soundcard.h")
-      set(SDL_AUDIO_DRIVER_OSS 1)
-      set(SOURCE_FILES ${SOURCE_FILES} ${OSS_SOURCES})
-      if(NETBSD OR OPENBSD)
-        list(APPEND EXTRA_LIBS ossaudio)
-      endif(NETBSD OR OPENBSD)
-      set(HAVE_SDL_AUDIO TRUE)
-    endif(OSS_FOUND)
-  endif(OSS)
-endmacro(CheckOSS)
-
-# Requires:
-# - n/a
-# Optional:
-# - ALSA_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckALSA)
-  if(ALSA)
-    CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ASOUNDLIB_H)
-    if(HAVE_ASOUNDLIB_H)
-      CHECK_LIBRARY_EXISTS(asound snd_pcm_open "" HAVE_LIBASOUND)
-      set(HAVE_ALSA TRUE)
-      file(GLOB ALSA_SOURCES ${SDL2_SOURCE_DIR}/src/audio/alsa/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${ALSA_SOURCES})
-      set(SDL_AUDIO_DRIVER_ALSA 1)
-      if(ALSA_SHARED)
-        if(NOT HAVE_DLOPEN)
-          message_warn("You must have SDL_LoadObject() support for dynamic ALSA loading")
-        else()
-          find_library(_ALSA_LIB asound)
-          get_filename_component(F_ALSA_LIB ${_ALSA_LIB} NAME)
-          set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${F_ALSA_LIB}\"")
-          set(HAVE_ALSA_SHARED TRUE)
-        endif(NOT HAVE_DLOPEN)
-      else(ALSA_SHARED)
-        list(APPEND EXTRA_LIBS asound)
-      endif(ALSA_SHARED)
-      set(HAVE_SDL_AUDIO TRUE)
-    endif(HAVE_ASOUNDLIB_H)
-  endif(ALSA)
-endmacro(CheckALSA)
-
-# Requires:
-# - PkgCheckModules
-# Optional:
-# - PULSEAUDIO_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckPulseAudio)
-  if(PULSEAUDIO)
-    pkg_check_modules(PKG_PULSEAUDIO libpulse-simple)
-    if(PKG_PULSEAUDIO_FOUND)
-      set(HAVE_PULSEAUDIO TRUE)
-      file(GLOB PULSEAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/pulseaudio/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${PULSEAUDIO_SOURCES})
-      set(SDL_AUDIO_DRIVER_PULSEAUDIO 1)
-      list(APPEND EXTRA_CFLAGS ${PKG_PULSEAUDIO_CFLAGS})
-      if(PULSEAUDIO_SHARED)
-        if(NOT HAVE_DLOPEN)
-          message_warn("You must have SDL_LoadObject() support for dynamic PulseAudio loading")
-        else()
-          find_library(D_PULSE_LIB pulse-simple)
-          get_filename_component(F_PULSE_LIB ${D_PULSE_LIB} NAME)
-          set(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "\"${F_PULSE_LIB}\"")
-          set(HAVE_PULSEAUDIO_SHARED TRUE)
-        endif(NOT HAVE_DLOPEN)
-      else(PULSEAUDIO_SHARED)
-        list(APPEND EXTRA_LDFLAGS ${PKG_PULSEAUDIO_LDFLAGS})
-      endif(PULSEAUDIO_SHARED)
-      set(HAVE_SDL_AUDIO TRUE)
-    endif(PKG_PULSEAUDIO_FOUND)
-  endif(PULSEAUDIO)
-endmacro(CheckPulseAudio)
-
-# Requires:
-# - PkgCheckModules
-# Optional:
-# - ESD_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckESD)
-  if(ESD)
-    pkg_check_modules(PKG_ESD esound)
-    if(PKG_ESD_FOUND)
-      set(HAVE_ESD TRUE)
-      file(GLOB ESD_SOURCES ${SDL2_SOURCE_DIR}/src/audio/esd/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${ESD_SOURCES})
-      set(SDL_AUDIO_DRIVER_ESD 1)
-      list(APPEND EXTRA_CFLAGS ${PKG_ESD_CFLAGS})
-      if(ESD_SHARED)
-        if(NOT HAVE_DLOPEN)
-          message_warn("You must have SDL_LoadObject() support for dynamic ESD loading")
-        else()
-          find_library(D_ESD_LIB esd)
-          get_filename_component(F_ESD_LIB ${D_ESD_LIB} NAME)
-          set(SDL_AUDIO_DRIVER_ESD_DYNAMIC "\"${F_ESD_LIB}\"")
-          set(HAVE_ESD_SHARED TRUE)
-        endif(NOT HAVE_DLOPEN)
-      else(ESD_SHARED)
-        list(APPEND EXTRA_LDFLAGS ${PKG_ESD_LDFLAGS})
-      endif(ESD_SHARED)
-      set(HAVE_SDL_AUDIO TRUE)
-    endif(PKG_ESD_FOUND)
-  endif(ESD)
-endmacro(CheckESD)
-
-# Requires:
-# - n/a
-# Optional:
-# - ARTS_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckARTS)
-  if(ARTS)
-    find_program(ARTS_CONFIG arts-config)
-    if(ARTS_CONFIG)
-      execute_process(CMD_ARTSCFLAGS ${ARTS_CONFIG} --cflags
-        OUTPUT_VARIABLE ARTS_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-      list(APPEND EXTRA_CFLAGS ${ARTS_CFLAGS})
-      execute_process(CMD_ARTSLIBS ${ARTS_CONFIG} --libs
-        OUTPUT_VARIABLE ARTS_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
-      file(GLOB ARTS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/arts/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${ARTS_SOURCES})
-      set(SDL_AUDIO_DRIVER_ARTS 1)
-      set(HAVE_ARTS TRUE)
-      if(ARTS_SHARED)
-        if(NOT HAVE_DLOPEN)
-          message_warn("You must have SDL_LoadObject() support for dynamic ARTS loading")
-        else()
-          # TODO
-          find_library(D_ARTS_LIB artsc)
-          get_filename_component(F_ARTS_LIB ${D_ARTS_LIB} NAME)
-          set(SDL_AUDIO_DRIVER_ARTS_DYNAMIC "\"${F_ARTS_LIB}\"")
-          set(HAVE_ARTS_SHARED TRUE)
-        endif(NOT HAVE_DLOPEN)
-      else(ARTS_SHARED)
-        list(APPEND EXTRA_LDFLAGS ${ARTS_LIBS})
-      endif(ARTS_SHARED)
-      set(HAVE_SDL_AUDIO TRUE)
-    endif(ARTS_CONFIG)
-  endif(ARTS)
-endmacro(CheckARTS)
-
-# Requires:
-# - n/a
-# Optional:
-# - NAS_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckNAS)
-  if(NAS)
-    # TODO: set include paths properly, so the NAS headers are found
-    check_include_file(audio/audiolib.h HAVE_NAS_H)
-    find_library(D_NAS_LIB audio)
-    if(HAVE_NAS_H AND D_NAS_LIB)
-      set(HAVE_NAS TRUE)
-      file(GLOB NAS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/nas/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${NAS_SOURCES})
-      set(SDL_AUDIO_DRIVER_NAS 1)
-      if(NAS_SHARED)
-        if(NOT HAVE_DLOPEN)
-          message_warn("You must have SDL_LoadObject() support for dynamic NAS loading")
-        else()
-          get_filename_component(F_NAS_LIB ${D_NAS_LIB} NAME)
-          set(SDL_AUDIO_DRIVER_NAS_DYNAMIC "\"${F_NAS_LIB}\"")
-          set(HAVE_NAS_SHARED TRUE)
-        endif(NOT HAVE_DLOPEN)
-      else(NAS_SHARED)
-        list(APPEND EXTRA_LIBS ${D_NAS_LIB})
-      endif(NAS_SHARED)
-      set(HAVE_SDL_AUDIO TRUE)
-    endif(HAVE_NAS_H AND D_NAS_LIB)
-  endif(NAS)
-endmacro(CheckNAS)
-
-# Requires:
-# - n/a
-# Optional:
-# - SNDIO_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckSNDIO)
-  if(SNDIO)
-    # TODO: set include paths properly, so the sndio headers are found
-    check_include_file(sndio.h HAVE_SNDIO_H)
-    find_library(D_SNDIO_LIB audio)
-    if(HAVE_SNDIO_H AND D_SNDIO_LIB)
-      set(HAVE_SNDIO TRUE)
-      file(GLOB SNDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sndio/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${SNDIO_SOURCES})
-      set(SDL_AUDIO_DRIVER_SNDIO 1)
-      if(SNDIO_SHARED)
-        if(NOT HAVE_DLOPEN)
-          message_warn("You must have SDL_LoadObject() support for dynamic sndio loading")
-        else()
-          get_filename_component(F_SNDIO_LIB ${D_SNDIO_LIB} NAME)
-          set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${F_SNDIO_LIB}\"")
-          set(HAVE_SNDIO_SHARED TRUE)
-        endif(NOT HAVE_DLOPEN)
-      else(SNDIO_SHARED)
-        list(APPEND EXTRA_LIBS ${D_SNDIO_LIB})
-      endif(SNDIO_SHARED)
-      set(HAVE_SDL_AUDIO TRUE)
-    endif(HAVE_SNDIO_H AND D_SNDIO_LIB)
-  endif(SNDIO)
-endmacro(CheckSNDIO)
-
-# Requires:
-# - PkgCheckModules
-# Optional:
-# - FUSIONSOUND_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckFusionSound)
-  if(FUSIONSOUND)
-    pkg_check_modules(PKG_FUSIONSOUND fusionsound>=1.0.0)
-    if(PKG_FUSIONSOUND_FOUND)
-      set(HAVE_FUSIONSOUND TRUE)
-      file(GLOB FUSIONSOUND_SOURCES ${SDL2_SOURCE_DIR}/src/audio/fusionsound/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${FUSIONSOUND_SOURCES})
-      set(SDL_AUDIO_DRIVER_FUSIONSOUND 1)
-      list(APPEND EXTRA_CFLAGS ${PKG_FUSIONSOUND_CFLAGS})
-      if(FUSIONSOUND_SHARED)
-        if(NOT HAVE_DLOPEN)
-          message_warn("You must have SDL_LoadObject() support for dynamic FusionSound loading")
-        else()
-          find_library(D_FUSIONSOUND_LIB fusionsound)
-          get_filename_component(F_FUSIONSOUND_LIB ${D_FUSIONSOUND_LIB} NAME)
-          set(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "\"${F_FUSIONSOUND_LIB}\"")
-          set(HAVE_FUSIONSOUND_SHARED TRUE)
-        endif(NOT HAVE_DLOPEN)
-      else(FUSIONSOUND_SHARED)
-        list(APPEND EXTRA_LDFLAGS ${PKG_FUSIONSOUND_LDFLAGS})
-      endif(FUSIONSOUND_SHARED)
-      set(HAVE_SDL_AUDIO TRUE)
-    endif(PKG_FUSIONSOUND_FOUND)
-  endif(FUSIONSOUND)
-endmacro(CheckFusionSound)
-
-# Requires:
-# - n/a
-# Optional:
-# - X11_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckX11)
-  if(VIDEO_X11)
-    foreach(_LIB X11 Xext Xcursor Xinerama Xi Xrandr Xrender Xss Xxf86vm)
-      string(TOUPPER ${_LIB} _LNAME)
-      find_library(${_LNAME}_LIB ${_LIB})
-      if(${_LNAME}_LIB)
-        # reduce the library name for shared linking
-        get_filename_component(_TMP ${${_LNAME}_LIB} NAME)
-        set(${_LNAME}_LIB ${_TMP})
-      endif()
-    endforeach()
-
-    find_path(X_INCLUDEDIR X11/Xlib.h)
-    if(X_INCLUDEDIR)
-      set(X_CFLAGS "-I${X_INCLUDEDIR}")
-    endif()
-
-    check_include_file(X11/Xcursor/Xcursor.h HAVE_XCURSOR_H)
-    check_include_file(X11/extensions/Xinerama.h HAVE_XINERAMA_H)
-    check_include_file(X11/extensions/XInput2.h HAVE_XINPUT_H)
-    check_include_file(X11/extensions/Xrandr.h HAVE_XRANDR_H)
-    check_include_file(X11/extensions/Xrender.h HAVE_XRENDER_H)
-    check_include_file(X11/extensions/scrnsaver.h HAVE_XSS_H)
-    check_include_file(X11/extensions/shape.h HAVE_XSHAPE_H)
-    check_include_files("X11/Xlib.h;X11/extensions/xf86vmode.h" HAVE_XF86VM_H)
-    check_include_files("X11/Xlib.h;X11/Xproto.h;X11/extensions/Xext.h" HAVE_XEXT_H)
-
-    if(X11_LIB)
-      if(NOT HAVE_XEXT_H)
-        message_error("Missing Xext.h, maybe you need to install the libxext-dev package?")
-      endif()
-
-      set(HAVE_VIDEO_X11 TRUE)
-      set(HAVE_SDL_VIDEO TRUE)
-
-      file(GLOB X11_SOURCES ${SDL2_SOURCE_DIR}/src/video/x11/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${X11_SOURCES})
-      set(SDL_VIDEO_DRIVER_X11 1)
-
-      if(HAVE_GCC_FVISIBILITY)
-        set(X11_SYMBOLS_PRIVATE TRUE)
-      else()
-        set(X11_SYMBOLS_PRIVATE FALSE)
-      endif(HAVE_GCC_FVISIBILITY)
-
-      if(APPLE)
-        set(X11_SHARED OFF)
-        set(X11_SYMBOLS_PRIVATE TRUE)
-      endif(APPLE)
-
-      check_function_exists("shmat" HAVE_SHMAT)
-      if(NOT HAVE_SHMAT)
-        check_library_exists(ipc shmat "" HAVE_SHMAT)
-        if(HAVE_SHMAT)
-          list(APPEND EXTRA_LIBS ipc)
-        endif(HAVE_SHMAT)
-        if(NOT HAVE_SHMAT)
-          add_definitions(-DNO_SHARED_MEMORY)
-          set(X_CFLAGS "${X_CFLAGS} -DNO_SHARED_MEMORY")
-        endif(NOT HAVE_SHMAT)
-      endif(NOT HAVE_SHMAT)
-
-      if(X11_SHARED)
-        if(NOT HAVE_DLOPEN)
-          message_warn("You must have SDL_LoadObject() support for dynamic X11 loading")
-          set(HAVE_X11_SHARED FALSE)
-          if(X11_SYMBOLS_PRIVATE)
-            message_warn("You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading")
-            set(HAVE_X11_SHARED TRUE)
-          endif(X11_SYMBOLS_PRIVATE)
-        else(NOT HAVE_DLOPEN)
-          set(HAVE_X11_SHARED TRUE)
-        endif()
-        if(HAVE_X11_SHARED)
-          set(SDL_VIDEO_DRIVER_X11_DYNAMIC "\"${X11_LIB}\"")
-          set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "\"${XEXT_LIB}\"")
-        else(HAVE_X11_SHARED)
-          list(APPEND EXTRA_LIBS ${X11_LIB} ${XEXT_LIB})
-        endif(HAVE_X11_SHARED)
-      endif(X11_SHARED)
-
-      set(SDL_CFLAGS "${SDL_CFLAGS} ${X_CFLAGS}")
-
-      set(CMAKE_REQUIRED_LIBRARIES ${X11_LIB} ${X11_LIB})
-      check_c_source_compiles("
-          #include <X11/Xlib.h>
-          #include <X11/Xproto.h>
-          #include <X11/extensions/Xext.h>
-          #include <X11/extensions/extutil.h>
-          extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
-          int main(int argc, char **argv) {}" HAVE_CONST_XEXT_ADDDISPLAY)
-      if(HAVE_CONST_XEXT_ADDDISPLAY)
-        set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1)
-      endif(HAVE_CONST_XEXT_ADDDISPLAY)
-
-      check_c_source_compiles("
-          #include <X11/Xlib.h>
-          int main(int argc, char **argv) {
-            Display *display;
-            XEvent event;
-            XGenericEventCookie *cookie = &event.xcookie;
-            XNextEvent(display, &event);
-            XGetEventData(display, cookie);
-            XFreeEventData(display, cookie); }" HAVE_XGENERICEVENT)
-      if(HAVE_XGENERICEVENT)
-        set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1)
-      endif(HAVE_XGENERICEVENT)
-
-      check_c_source_compiles("
-          #include <X11/Xlibint.h>
-          extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
-          int main(int argc, char **argv) {}" HAVE_CONST_XDATA32)
-      if(HAVE_CONST_XDATA32)
-        set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1)
-      endif(HAVE_CONST_XDATA32)
-
-      check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM)
-
-      if(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H)
-        set(HAVE_VIDEO_X11_XCURSOR TRUE)
-        if(HAVE_X11_SHARED AND XCURSOR_LIB)
-          set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "\"${XCURSOR_LIB}\"")
-        else(HAVE_X11_SHARED AND XCURSOR_LIB)
-          list(APPEND EXTRA_LIBS ${XCURSOR_LIB})
-        endif(HAVE_X11_SHARED AND XCURSOR_LIB)
-        set(SDL_VIDEO_DRIVER_X11_XCURSOR 1)
-      endif(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H)
-
-      if(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H)
-        set(HAVE_VIDEO_X11_XINERAMA TRUE)
-        if(HAVE_X11_SHARED AND XINERAMA_LIB)
-          set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "\"${XINERAMA_LIB}\"")
-        else(HAVE_X11_SHARED AND XINERAMA_LIB)
-          list(APPEND EXTRA_LIBS ${XINERAMA_LIB})
-        endif(HAVE_X11_SHARED AND XINERAMA_LIB)
-        set(SDL_VIDEO_DRIVER_X11_XINERAMA 1)
-      endif(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H)
-
-      if(VIDEO_X11_XINPUT AND HAVE_XINPUT_H)
-        set(HAVE_VIDEO_X11_XINPUT TRUE)
-        if(HAVE_X11_SHARED AND XI_LIB)
-          set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "\"${XI_LIB}\"")
-        else(HAVE_X11_SHARED AND XI_LIB)
-          list(APPEND EXTRA_LIBS ${XI_LIB})
-        endif(HAVE_X11_SHARED AND XI_LIB)
-        set(SDL_VIDEO_DRIVER_X11_XINPUT2 1)
-
-        # Check for multitouch
-        check_c_source_compiles("
-            #include <X11/Xlib.h>
-            #include <X11/Xproto.h>
-            #include <X11/extensions/XInput2.h>
-            int event_type = XI_TouchBegin;
-            XITouchClassInfo *t;
-            Status XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f)
-            {
-              return (Status)0;
-            }
-            int main(int argc, char **argv) {}" HAVE_XINPUT2_MULTITOUCH)
-        if(HAVE_XINPUT2_MULTITOUCH)
-          set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1)
-        endif(HAVE_XINPUT2_MULTITOUCH)
-      endif(VIDEO_X11_XINPUT AND HAVE_XINPUT_H)
-
-      if(VIDEO_X11_XRANDR AND HAVE_XRANDR_H)
-        if(HAVE_X11_SHARED AND XRANDR_LIB)
-          set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB}\"")
-        else(HAVE_X11_SHARED AND XRANDR_LIB)
-          list(APPEND EXTRA_LIBS ${XRANDR_LIB})
-        endif(HAVE_X11_SHARED AND XRANDR_LIB)
-        set(SDL_VIDEO_DRIVER_X11_XRANDR 1)
-        set(HAVE_VIDEO_X11_XRANDR TRUE)
-      endif(VIDEO_X11_XRANDR AND HAVE_XRANDR_H)
-
-      if(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H)
-        if(HAVE_X11_SHARED AND XSS_LIB)
-          set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "\"${XSS_LIB}\"")
-        else(HAVE_X11_SHARED AND XSS_LIB)
-          list(APPEND EXTRA_LIBS ${XSS_LIB})
-        endif(HAVE_X11_SHARED AND XSS_LIB)
-        set(SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1)
-        set(HAVE_VIDEO_X11_XSCRNSAVER TRUE)
-      endif(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H)
-
-      if(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H)
-        set(SDL_VIDEO_DRIVER_X11_XSHAPE 1)
-        set(HAVE_VIDEO_X11_XSHAPE TRUE)
-      endif(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H)
-
-      if(VIDEO_X11_XVM AND HAVE_XF86VM_H)
-        if(HAVE_X11_SHARED AND XF86VMODE_LIB)
-          set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "\"${XF86VMODE_LIB}\"")
-        else(HAVE_X11_SHARED AND XF86VMODE_LIB)
-          list(APPEND EXTRA_LIBS ${XF86VMODE_LIB})
-        endif(HAVE_X11_SHARED AND XF86VMODE_LIB)
-        set(SDL_VIDEO_DRIVER_X11_XVIDMODE 1)
-        set(HAVE_VIDEO_X11_XVM TRUE)
-      endif(VIDEO_X11_XVM AND HAVE_XF86VM_H)
-
-      set(CMAKE_REQUIRED_LIBRARIES)
-    endif(X11_LIB)
-  endif(VIDEO_X11)
-endmacro(CheckX11)
-
-# Requires:
-# - n/a
-#
-macro(CheckCOCOA)
-  if(VIDEO_COCOA)
-    check_objc_source_compiles("
-        #import <Cocoa/Cocoa.h>
-        int main (int argc, char** argv) {}" HAVE_VIDEO_COCOA)
-    if(HAVE_VIDEO_COCOA)
-      file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m)
-      set_source_files_properties(${COCOA_SOURCES} PROPERTIES LANGUAGE C)
-      set(SOURCE_FILES ${SOURCE_FILES} ${COCOA_SOURCES})
-      set(SDL_VIDEO_DRIVER_COCOA 1)
-      set(HAVE_SDL_VIDEO TRUE)
-    endif(HAVE_VIDEO_COCOA)
-  endif(VIDEO_COCOA)
-endmacro(CheckCOCOA)
-
-# Requires:
-# - PkgCheckModules
-# Optional:
-# - DIRECTFB_SHARED opt
-# - HAVE_DLOPEN opt
-macro(CheckDirectFB)
-  if(VIDEO_DIRECTFB)
-    pkg_check_modules(PKG_DIRECTFB directfb>=1.0.0)
-    if(PKG_DIRECTFB_FOUND)
-      set(HAVE_VIDEO_DIRECTFB TRUE)
-      file(GLOB DIRECTFB_SOURCES ${SDL2_SOURCE_DIR}/src/video/directfb/*.c)
-      set(SOURCE_FILES ${SOURCE_FILES} ${DIRECTFB_SOURCES})
-      set(SDL_VIDEO_DRIVER_DIRECTFB 1)
-      set(SDL_VIDEO_RENDER_DIRECTFB 1)
-      list(APPEND EXTRA_CFLAGS ${PKG_DIRECTFB_CFLAGS})
-      if(DIRECTFB_SHARED)
-        if(NOT HAVE_DLOPEN)
-          message_warn("You must have SDL_LoadObject() support for dynamic DirectFB loading")
-        else()
-          find_library(D_DIRECTFB_LIB directfb)
-          get_filename_component(F_DIRECTFB_LIB ${D_DIRECTFB_LIB} NAME)
-          set(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC "\"${F_DIRECTFB_LIB}\"")
-          set(HAVE_DIRECTFB_SHARED TRUE)
-        endif(NOT HAVE_DLOPEN)
-      else(DIRECTFB_SHARED)
-        list(APPEND EXTRA_LDFLAGS ${PKG_DIRECTFB_LDFLAGS})
-      endif(DIRECTFB_SHARED)
-      set(HAVE_SDL_VIDEO TRUE)
-    endif(PKG_DIRECTFB_FOUND)
-  endif(VIDEO_DIRECTFB)
-endmacro(CheckDirectFB)
-
-# Requires:
-# - nada
-macro(CheckOpenGLX11)
-  if(VIDEO_OPENGL)
-    check_c_source_compiles("
-        #include <GL/gl.h>
-        #include <GL/glx.h>
-        int main(int argc, char** argv) {}" HAVE_VIDEO_OPENGL)
-
-    if(HAVE_VIDEO_OPENGL)
-      set(HAVE_VIDEO_OPENGL TRUE)
-      set(SDL_VIDEO_OPENGL 1)
-      set(SDL_VIDEO_OPENGL_GLX 1)
-      set(SDL_VIDEO_RENDER_OGL 1)
-      list(APPEND EXTRA_LIBS GL)
-    endif(HAVE_VIDEO_OPENGL)
-  endif(VIDEO_OPENGL)
-endmacro(CheckOpenGLX11)
-
-# Requires:
-# - nada
-macro(CheckOpenGLESX11)
-  if(VIDEO_OPENGLES)
-    check_c_source_compiles("
-        #include <EGL/egl.h>
-        int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGL_EGL)
-    if(HAVE_VIDEO_OPENGL_EGL)
-        set(SDL_VIDEO_OPENGL_EGL 1)
-    endif(HAVE_VIDEO_OPENGL_EGL) 
-    check_c_source_compiles("
-      #include <GLES/gl.h>
-      #include <GLES/glext.h>
-      int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V1)
-    if(HAVE_VIDEO_OPENGLES_V1)
-        set(HAVE_VIDEO_OPENGLES TRUE)
-        set(SDL_VIDEO_OPENGL_ES 1)
-        set(SDL_VIDEO_RENDER_OGL_ES 1)
-    endif(HAVE_VIDEO_OPENGLES_V1)
-    check_c_source_compiles("
-      #include <GLES2/gl2.h>
-      #include <GLES2/gl2ext.h>
-      int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V2)
-    if(HAVE_VIDEO_OPENGLES_V2)
-        set(HAVE_VIDEO_OPENGLES TRUE)
-        set(SDL_VIDEO_OPENGL_ES2 1)
-        set(SDL_VIDEO_RENDER_OGL_ES2 1)
-    endif(HAVE_VIDEO_OPENGLES_V2)
-
-  endif(VIDEO_OPENGLES)
-endmacro(CheckOpenGLESX11)
-
-# Rquires:
-# - nada
-# Optional:
-# - THREADS opt
-# Sets:
-# PTHREAD_CFLAGS
-# PTHREAD_LIBS
-macro(CheckPTHREAD)
-  if(PTHREADS)
-    if(LINUX)
-      set(PTHREAD_CFLAGS "-D_REENTRANT")
-      set(PTHREAD_LDFLAGS "-pthread")
-    elseif(BSDI)
-      set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
-      set(PTHREAD_LDFLAGS "")
-    elseif(DARWIN)
-      set(PTHREAD_CFLAGS "-D_THREAD_SAFE")
-      # causes Carbon.p complaints?
-      # set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
-      set(PTHREAD_LDFLAGS "")
-    elseif(FREEBSD)
-      set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
-      set(PTHREAD_LDFLAGS "-pthread")
-    elseif(NETBSD)
-      set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE")
-      set(PTHREAD_LDFLAGS "-lpthread")
-    elseif(OPENBSD)
-      set(PTHREAD_CFLAGS "-D_REENTRANT")
-      set(PTHREAD_LDFLAGS "-pthread")
-    elseif(SOLARIS)
-      set(PTHREAD_CFLAGS "-D_REENTRANT")
-      set(PTHREAD_LDFLAGS "-pthread -lposix4")
-    elseif(SYSV5)
-      set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
-      set(PTHREAD_LDFLAGS "")
-    elseif(AIX)
-      set(PTHREAD_CFLAGS "-D_REENTRANT -mthreads")
-      set(PTHREAD_LDFLAGS "-pthread")
-    elseif(HPUX)
-      set(PTHREAD_CFLAGS "-D_REENTRANT")
-      set(PTHREAD_LDFLAGS "-L/usr/lib -pthread")
-    else()
-      set(PTHREAD_CFLAGS "-D_REENTRANT")
-      set(PTHREAD_LDFLAGS "-lpthread")
-    endif(LINUX)
-
-    # Run some tests
-    set(CMAKE_REQUIRED_FLAGS "${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}")
-    check_c_source_runs("
-        #include <pthread.h>
-        int main(int argc, char** argv) {
-          pthread_attr_t type;
-          pthread_attr_init(&type);
-          return 0;
-        }" HAVE_PTHREADS)
-    if(HAVE_PTHREADS)
-      set(SDL_THREAD_PTHREAD 1)
-      list(APPEND EXTRA_CFLAGS ${PTHREAD_CFLAGS})
-      list(APPEND EXTRA_LDFLAGS ${PTHREAD_LDFLAGS})
-      set(SDL_CFLAGS "${SDL_CFLAGS} ${PTHREAD_CFLAGS}")
-      list(APPEND SDL_LIBS ${PTHREAD_LDFLAGS})
-
-      check_c_source_compiles("
-        #include <pthread.h>
-        int main(int argc, char **argv) {
-          pthread_mutexattr_t attr;
-          pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-          return 0;
-        }" HAVE_RECURSIVE_MUTEXES)
-      if(HAVE_RECURSIVE_MUTEXES)
-        set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1)
-      else(HAVE_RECURSIVE_MUTEXES)
-        check_c_source_compiles("
-            #include <pthread.h>
-            int main(int argc, char **argv) {
-              pthread_mutexattr_t attr;
-              pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-              return 0;
-            }" HAVE_RECURSIVE_MUTEXES_NP)
-        if(HAVE_RECURSIVE_MUTEXES_NP)
-          set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1)
-        endif(HAVE_RECURSIVE_MUTEXES_NP)
-      endif(HAVE_RECURSIVE_MUTEXES)
-
-      if(PTHREADS_SEM)
-        check_c_source_compiles("#include <pthread.h>
-                                 #include <semaphore.h>
-                                 int main(int argc, char **argv) { return 0; }" HAVE_PTHREADS_SEM)
-        if(HAVE_PTHREADS_SEM)
-          check_c_source_compiles("
-              #include <pthread.h>
-              #include <semaphore.h>
-              int main(int argc, char **argv) {
-                  sem_timedwait(NULL, NULL);
-                  return 0;
-              }" HAVE_SEM_TIMEDWAIT)
-        endif(HAVE_PTHREADS_SEM)
-      endif(PTHREADS_SEM)
-
-      check_c_source_compiles("
-          #include <pthread.h>
-          int main(int argc, char** argv) {
-              pthread_spin_trylock(NULL);
-              return 0;
-          }" HAVE_PTHREAD_SPINLOCK)
-
-      check_c_source_compiles("
-          #include <pthread.h>
-          #include <pthread_np.h>
-          int main(int argc, char** argv) { return 0; }" HAVE_PTHREAD_NP_H)
-      check_function_exists(pthread_setname_np HAVE_PTHREAD_setNAME_NP)
-      check_function_exists(pthread_set_name_np HAVE_PTHREAD_set_NAME_NP)
-      set(CMAKE_REQUIRED_FLAGS)
-
-      set(SOURCE_FILES ${SOURCE_FILES}
-          ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c
-          ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_sysmutex.c   # Can be faked, if necessary
-          ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_syscond.c    # Can be faked, if necessary
-          ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systls.c
-          )
-      if(HAVE_PTHREADS_SEM)
-        set(SOURCE_FILES ${SOURCE_FILES}
-            ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_syssem.c)
-      else(HAVE_PTHREADS_SEM)
-        set(SOURCE_FILES ${SOURCE_FILES}
-            ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syssem.c)
-      endif(HAVE_PTHREADS_SEM)
-      set(HAVE_SDL_THREADS TRUE)
-    endif(HAVE_PTHREADS)
-  endif(PTHREADS)
-endmacro(CheckPTHREAD)
-
-# Requires
-# - nada
-# Optional:
-# Sets:
-# USB_LIBS
-# USB_CFLAGS
-macro(CheckUSBHID)
-  check_library_exists(usbhid hid_init "" LIBUSBHID)
-  if(LIBUSBHID)
-    check_include_file(usbhid.h HAVE_USBHID_H)
-    if(HAVE_USBHID_H)
-      set(USB_CFLAGS "-DHAVE_USBHID_H")
-    endif(HAVE_USBHID_H)
-
-    check_include_file(libusbhid.h HAVE_LIBUSBHID_H)
-    if(HAVE_LIBUSBHID_H)
-      set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSBHID_H")
-    endif(HAVE_LIBUSBHID_H)
-    set(USB_LIBS ${USB_LIBS} usbhid)
-  else(LIBUSBHID)
-    check_include_file(usb.h HAVE_USB_H)
-    if(HAVE_USB_H)
-      set(USB_CFLAGS "-DHAVE_USB_H")
-    endif(HAVE_USB_H)
-    check_include_file(libusb.h HAVE_LIBUSB_H)
-    if(HAVE_LIBUSB_H)
-      set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSB_H")
-    endif(HAVE_LIBUSB_H)
-    check_library_exists(usb hid_init "" LIBUSB)
-    if(LIBUSB)
-      set(USB_LIBS ${USB_LIBS} usb)
-    endif(LIBUSB)
-  endif(LIBUSBHID)
-
-  set(CMAKE_REQUIRED_FLAGS "${USB_CFLAGS}")
-  set(CMAKE_REQUIRED_LIBRARIES "${USB_LIBS}")
-  check_c_source_compiles("
-       #include <sys/types.h>
-        #if defined(HAVE_USB_H)
-        #include <usb.h>
-        #endif
-        #ifdef __DragonFly__
-        # include <bus/usb/usb.h>
-        # include <bus/usb/usbhid.h>
-        #else
-        # include <dev/usb/usb.h>
-        # include <dev/usb/usbhid.h>
-        #endif
-        #if defined(HAVE_USBHID_H)
-        #include <usbhid.h>
-        #elif defined(HAVE_LIBUSB_H)
-        #include <libusb.h>
-        #elif defined(HAVE_LIBUSBHID_H)
-        #include <libusbhid.h>
-        #endif
-        int main(int argc, char **argv) {
-          struct report_desc *repdesc;
-          struct usb_ctl_report *repbuf;
-          hid_kind_t hidkind;
-          return 0;
-        }" HAVE_USBHID)
-  if(HAVE_USBHID)
-    check_c_source_compiles("
-          #include <sys/types.h>
-          #if defined(HAVE_USB_H)
-          #include <usb.h>
-          #endif
-          #ifdef __DragonFly__
-          # include <bus/usb/usb.h>
-          # include <bus/usb/usbhid.h>
-          #else
-          # include <dev/usb/usb.h>
-          # include <dev/usb/usbhid.h>
-          #endif
-          #if defined(HAVE_USBHID_H)
-          #include <usbhid.h>
-          #elif defined(HAVE_LIBUSB_H)
-          #include <libusb.h>
-          #elif defined(HAVE_LIBUSBHID_H)
-          #include <libusbhid.h>
-          #endif
-          int main(int argc, char** argv) {
-            struct usb_ctl_report buf;
-            if (buf.ucr_data) { }
-            return 0;
-          }" HAVE_USBHID_UCR_DATA)
-    if(HAVE_USBHID_UCR_DATA)
-      set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_UCR_DATA")
-    endif(HAVE_USBHID_UCR_DATA)
-
-    check_c_source_compiles("
-          #include <sys/types.h>
-          #if defined(HAVE_USB_H)
-          #include <usb.h>
-          #endif
-          #ifdef __DragonFly__
-          #include <bus/usb/usb.h>
-          #include <bus/usb/usbhid.h>
-          #else
-          #include <dev/usb/usb.h>
-          #include <dev/usb/usbhid.h>
-          #endif
-          #if defined(HAVE_USBHID_H)
-          #include <usbhid.h>
-          #elif defined(HAVE_LIBUSB_H)
-          #include <libusb.h>
-          #elif defined(HAVE_LIBUSBHID_H)
-          #include <libusbhid.h>
-          #endif
-          int main(int argc, char **argv) {
-            report_desc_t d;
-            hid_start_parse(d, 1, 1);
-            return 0;
-          }" HAVE_USBHID_NEW)
-    if(HAVE_USBHID_NEW)
-      set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_NEW")
-    endif(HAVE_USBHID_NEW)
-
-    check_c_source_compiles("
-        #include <machine/joystick.h>
-        int main(int argc, char** argv) {
-            struct joystick t;
-            return 0;
-        }" HAVE_MACHINE_JOYSTICK)
-    if(HAVE_MACHINE_JOYSTICK)
-      set(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1)
-    endif(HAVE_MACHINE_JOYSTICK)
-    set(SDL_JOYSTICK_USBHID 1)
-    file(GLOB BSD_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/bsd/*.c)
-    set(SOURCE_FILES ${SOURCE_FILES} ${BSD_JOYSTICK_SOURCES})
-    list(APPEND EXTRA_CFLAGS ${USB_CFLAGS})
-    list(APPEND EXTRA_LIBS ${USB_LIBS})
-    set(HAVE_SDL_JOYSTICK TRUE)
-
-    set(CMAKE_REQUIRED_LIBRARIES)
-    set(CMAKE_REQUIRED_FLAGS)
-  endif(HAVE_USBHID)
-endmacro(CheckUSBHID)
diff --git a/deps/SDL2/configure b/deps/SDL2/configure
deleted file mode 100755
index ba24894..0000000
--- a/deps/SDL2/configure
+++ /dev/null
@@ -1,25253 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
-  # into an infinite loop, continuously re-executing ourselves.
-  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
-    _as_can_reexec=no; export _as_can_reexec;
-    # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
-  fi
-  # We don't want this to propagate to other subprocesses.
-          { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
-  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-"
-  as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
-  exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
-  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
-  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
-  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
-  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-
-  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
-    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
-    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
-    PATH=/empty FPATH=/empty; export PATH FPATH
-    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
-      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
-  if (eval "$as_required") 2>/dev/null; then :
-  as_have_required=yes
-else
-  as_have_required=no
-fi
-  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  as_found=:
-  case $as_dir in #(
-	 /*)
-	   for as_base in sh bash ksh sh5; do
-	     # Try only shells that exist, to save several forks.
-	     as_shell=$as_dir/$as_base
-	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  CONFIG_SHELL=$as_shell as_have_required=yes
-		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  break 2
-fi
-fi
-	   done;;
-       esac
-  as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
-	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
-  CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
-      if test "x$CONFIG_SHELL" != x; then :
-  export CONFIG_SHELL
-             # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
-    if test x$as_have_required = xno; then :
-  $as_echo "$0: This script requires a shell more modern than all"
-  $as_echo "$0: the shells that I found on your system."
-  if test x${ZSH_VERSION+set} = xset ; then
-    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
-    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
-  else
-    $as_echo "$0: Please tell bug-autoconf at gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
-  fi
-  exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
-  as_lineno_1=$LINENO as_lineno_1a=$LINENO
-  as_lineno_2=$LINENO as_lineno_2a=$LINENO
-  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
-  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
-  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
-  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
-  # already done that, so ensure we don't try to do so again and fall
-  # in an infinite loop.  This has already happened in practice.
-  _as_can_reexec=no; export _as_can_reexec
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -pR'
-  fi
-else
-  as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-PACKAGE_URL=
-
-ac_unique_file="README.txt"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-#  include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='LTLIBOBJS
-EXTRA_LDFLAGS
-BUILD_LDFLAGS
-EXTRA_CFLAGS
-BUILD_CFLAGS
-SDLTEST_OBJECTS
-SDLMAIN_OBJECTS
-VERSION_OBJECTS
-OBJECTS
-INCLUDE
-ac_aux_dir
-ENABLE_STATIC_FALSE
-ENABLE_STATIC_TRUE
-ENABLE_SHARED_FALSE
-ENABLE_SHARED_TRUE
-SDL_RLD_FLAGS
-SDL_STATIC_LIBS
-SDL_LIBS
-SDL_CFLAGS
-DIRECTFBCONFIG
-X_EXTRA_LIBS
-X_LIBS
-X_PRE_LIBS
-X_CFLAGS
-XMKMF
-ARTSCONFIG
-PKG_CONFIG
-ESD_LIBS
-ESD_CFLAGS
-ESD_CONFIG
-ALSA_LIBS
-ALSA_CFLAGS
-POW_LIB
-LIBOBJS
-ALLOCA
-WINDRES
-SET_MAKE
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-CXXCPP
-ac_ct_CXX
-CXXFLAGS
-CXX
-LT_AGE
-LT_REVISION
-LT_CURRENT
-LT_RELEASE
-CPP
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-MANIFEST_TOOL
-AWK
-RANLIB
-STRIP
-ac_ct_AR
-AR
-LN_S
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LD
-FGREP
-EGREP
-GREP
-SED
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-LIBTOOL
-OBJDUMP
-DLLTOOL
-AS
-SDL_VERSION
-SDL_BINARY_AGE
-SDL_INTERFACE_AGE
-SDL_MICRO_VERSION
-SDL_MINOR_VERSION
-SDL_MAJOR_VERSION
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_shared
-enable_static
-with_pic
-enable_fast_install
-with_gnu_ld
-with_sysroot
-enable_libtool_lock
-enable_assertions
-enable_dependency_tracking
-enable_libc
-enable_gcc_atomics
-enable_atomic
-enable_audio
-enable_video
-enable_render
-enable_events
-enable_joystick
-enable_haptic
-enable_power
-enable_filesystem
-enable_threads
-enable_timers
-enable_file
-enable_loadso
-enable_cpuinfo
-enable_assembly
-enable_ssemath
-enable_mmx
-enable_3dnow
-enable_sse
-enable_sse2
-enable_altivec
-enable_oss
-enable_alsa
-with_alsa_prefix
-with_alsa_inc_prefix
-enable_alsatest
-enable_alsa_shared
-enable_esd
-with_esd_prefix
-with_esd_exec_prefix
-enable_esdtest
-enable_esd_shared
-enable_pulseaudio
-enable_pulseaudio_shared
-enable_arts
-enable_arts_shared
-enable_nas
-enable_nas_shared
-enable_sndio
-enable_sndio_shared
-enable_diskaudio
-enable_dummyaudio
-enable_video_x11
-with_x
-enable_x11_shared
-enable_video_x11_xcursor
-enable_video_x11_xinerama
-enable_video_x11_xinput
-enable_video_x11_xrandr
-enable_video_x11_scrnsaver
-enable_video_x11_xshape
-enable_video_x11_vm
-enable_video_cocoa
-enable_video_directfb
-enable_directfb_shared
-enable_fusionsound
-enable_fusionsound_shared
-enable_video_dummy
-enable_video_opengl
-enable_video_opengles
-enable_libudev
-enable_dbus
-enable_input_tslib
-enable_pthreads
-enable_pthread_sem
-enable_directx
-enable_sdl_dlopen
-enable_clock_gettime
-enable_rpath
-enable_render_d3d
-'
-      ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP
-CXX
-CXXFLAGS
-CCC
-CXXCPP
-XMKMF'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval $ac_prev=\$ac_option
-    ac_prev=
-    continue
-  fi
-
-  case $ac_option in
-  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *=)   ac_optarg= ;;
-  *)    ac_optarg=yes ;;
-  esac
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_dashdash$ac_option in
-  --)
-    ac_dashdash=yes ;;
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=*)
-    datadir=$ac_optarg ;;
-
-  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
-  | --dataroo | --dataro | --datar)
-    ac_prev=datarootdir ;;
-  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
-  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
-    datarootdir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=no ;;
-
-  -docdir | --docdir | --docdi | --doc | --do)
-    ac_prev=docdir ;;
-  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
-    docdir=$ac_optarg ;;
-
-  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
-    ac_prev=dvidir ;;
-  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
-    dvidir=$ac_optarg ;;
-
-  -enable-* | --enable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=\$ac_optarg ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
-    ac_prev=htmldir ;;
-  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
-  | --ht=*)
-    htmldir=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localedir | --localedir | --localedi | --localed | --locale)
-    ac_prev=localedir ;;
-  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
-    localedir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst | --locals)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
-    ac_prev=pdfdir ;;
-  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
-    pdfdir=$ac_optarg ;;
-
-  -psdir | --psdir | --psdi | --psd | --ps)
-    ac_prev=psdir ;;
-  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
-    psdir=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=\$ac_optarg ;;
-
-  -without-* | --without-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=no ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    case $ac_envvar in #(
-      '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
-    esac
-    eval $ac_envvar=\$ac_optarg
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
-  case $enable_option_checking in
-    no) ;;
-    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
-    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
-  esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
-		datadir sysconfdir sharedstatedir localstatedir includedir \
-		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
-do
-  eval ac_val=\$$ac_var
-  # Remove trailing slashes.
-  case $ac_val in
-    */ )
-      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
-      eval $ac_var=\$ac_val;;
-  esac
-  # Be sure to have absolute directory names.
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* )  continue;;
-    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
-  esac
-  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_myself" : 'X\(//\)[^/]' \| \
-	 X"$as_myself" : 'X\(//\)$' \| \
-	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  srcdir=$ac_confdir
-  if test ! -r "$srcdir/$ac_unique_file"; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
-  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
-	pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
-  srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
-  eval ac_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_env_${ac_var}_value=\$${ac_var}
-  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking ...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --bindir=DIR            user executables [EPREFIX/bin]
-  --sbindir=DIR           system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR        program executables [EPREFIX/libexec]
-  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --libdir=DIR            object code libraries [EPREFIX/lib]
-  --includedir=DIR        C header files [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR           info documentation [DATAROOTDIR/info]
-  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
-  --htmldir=DIR           html documentation [DOCDIR]
-  --dvidir=DIR            dvi documentation [DOCDIR]
-  --pdfdir=DIR            pdf documentation [DOCDIR]
-  --psdir=DIR             ps documentation [DOCDIR]
-_ACEOF
-
-  cat <<\_ACEOF
-
-X features:
-  --x-includes=DIR    X include files are in DIR
-  --x-libraries=DIR   X library files are in DIR
-
-System types:
-  --build=BUILD     configure for building on BUILD [guessed]
-  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
-  cat <<\_ACEOF
-
-Optional Features:
-  --disable-option-checking  ignore unrecognized --enable/--with options
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-shared[=PKGS]  build shared libraries [default=yes]
-  --enable-static[=PKGS]  build static libraries [default=yes]
-  --enable-fast-install[=PKGS]
-                          optimize for fast installation [default=yes]
-  --disable-libtool-lock  avoid locking (might break parallel builds)
-  --enable-assertions     Enable internal sanity checks
-                          (auto/disabled/release/enabled/paranoid)
-                          [[default=auto]]
-  --enable-dependency-tracking
-                          Use gcc -MMD -MT dependency tracking [[default=yes]]
-  --enable-libc           Use the system C library [[default=yes]]
-  --enable-gcc-atomics    Use gcc builtin atomics [[default=yes]]
-  --enable-atomic         Enable the atomic operations subsystem
-                          [[default=yes]]
-  --enable-audio          Enable the audio subsystem [[default=yes]]
-  --enable-video          Enable the video subsystem [[default=yes]]
-  --enable-render         Enable the render subsystem [[default=yes]]
-  --enable-events         Enable the events subsystem [[default=yes]]
-  --enable-joystick       Enable the joystick subsystem [[default=yes]]
-  --enable-haptic         Enable the haptic (force feedback) subsystem
-                          [[default=yes]]
-  --enable-power          Enable the power subsystem [[default=yes]]
-  --enable-filesystem     Enable the filesystem subsystem [[default=yes]]
-  --enable-threads        Enable the threading subsystem [[default=yes]]
-  --enable-timers         Enable the timer subsystem [[default=yes]]
-  --enable-file           Enable the file subsystem [[default=yes]]
-  --enable-loadso         Enable the shared object loading subsystem
-                          [[default=yes]]
-  --enable-cpuinfo        Enable the cpuinfo subsystem [[default=yes]]
-  --enable-atomic         Enable the atomic operations [[default=yes]]
-  --enable-assembly       Enable assembly routines [[default=yes]]
-  --enable-ssemath        Allow GCC to use SSE floating point math
-                          [[default=no]]
-  --enable-mmx            use MMX assembly routines [[default=yes]]
-  --enable-3dnow          use 3DNow! assembly routines [[default=yes]]
-  --enable-sse            use SSE assembly routines [[default=yes]]
-  --enable-sse2           use SSE2 assembly routines [[default=no]]
-  --enable-altivec        use Altivec assembly routines [[default=yes]]
-  --enable-oss            support the OSS audio API [[default=maybe]]
-  --enable-alsa           support the ALSA audio API [[default=yes]]
-  --disable-alsatest      Do not try to compile and run a test Alsa program
-  --enable-alsa-shared    dynamically load ALSA audio support [[default=yes]]
-  --enable-esd            support the Enlightened Sound Daemon [[default=yes]]
-  --disable-esdtest       Do not try to compile and run a test ESD program
-  --enable-esd-shared     dynamically load ESD audio support [[default=yes]]
-  --enable-pulseaudio     use PulseAudio [[default=yes]]
-  --enable-pulseaudio-shared
-                          dynamically load PulseAudio support [[default=yes]]
-  --enable-arts           support the Analog Real Time Synthesizer
-                          [[default=yes]]
-  --enable-arts-shared    dynamically load aRts audio support [[default=yes]]
-  --enable-nas            support the NAS audio API [[default=yes]]
-  --enable-nas-shared     dynamically load NAS audio support [[default=yes]]
-  --enable-sndio          support the sndio audio API [[default=yes]]
-  --enable-sndio-shared   dynamically load sndio audio support [[default=yes]]
-  --enable-diskaudio      support the disk writer audio driver [[default=yes]]
-  --enable-dummyaudio     support the dummy audio driver [[default=yes]]
-  --enable-video-x11      use X11 video driver [[default=yes]]
-  --enable-x11-shared     dynamically load X11 support [[default=maybe]]
-  --enable-video-x11-xcursor
-                          enable X11 Xcursor support [[default=yes]]
-  --enable-video-x11-xinerama
-                          enable X11 Xinerama support [[default=yes]]
-  --enable-video-x11-xinput
-                          enable X11 XInput extension for manymouse, tablets,
-                          etc [[default=yes]]
-  --enable-video-x11-xrandr
-                          enable X11 Xrandr extension for fullscreen
-                          [[default=yes]]
-  --enable-video-x11-scrnsaver
-                          enable X11 screensaver extension [[default=yes]]
-  --enable-video-x11-xshape
-                          enable X11 XShape support [[default=yes]]
-  --enable-video-x11-vm   use X11 VM extension for fullscreen [[default=yes]]
-  --enable-video-cocoa    use Cocoa video driver [[default=yes]]
-  --enable-video-directfb use DirectFB video driver [[default=no]]
-  --enable-directfb-shared
-                          dynamically load directfb support [[default=yes]]
-  --enable-fusionsound    use FusionSound audio driver [[default=no]]
-  --enable-fusionsound-shared
-                          dynamically load fusionsound audio support
-                          [[default=yes]]
-  --enable-video-dummy    use dummy video driver [[default=yes]]
-  --enable-video-opengl   include OpenGL support [[default=yes]]
-  --enable-video-opengles include OpenGL ES support [[default=yes]]
-  --enable-libudev        enable libudev support [[default=yes]]
-  --enable-dbus           enable D-Bus support [[default=yes]]
-  --enable-input-tslib    use the Touchscreen library for input
-                          [[default=yes]]
-  --enable-pthreads       use POSIX threads for multi-threading
-                          [[default=yes]]
-  --enable-pthread-sem    use pthread semaphores [[default=yes]]
-  --enable-directx        use DirectX for Windows audio/video [[default=yes]]
-  --enable-sdl-dlopen     use dlopen for shared object loading [[default=yes]]
-  --enable-clock_gettime  use clock_gettime() instead of gettimeofday() on
-                          UNIX [[default=yes]]
-  --enable-rpath          use an rpath when linking SDL [[default=yes]]
-  --enable-render-d3d     enable the Direct3D render driver [[default=yes]]
-
-Optional Packages:
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
-                          both]
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-sysroot=DIR Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).
-  --with-alsa-prefix=PFX  Prefix where Alsa library is installed(optional)
-  --with-alsa-inc-prefix=PFX  Prefix where include libraries are (optional)
-  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)
-  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)
-  --with-x                use the X Window System
-
-Some influential environment variables:
-  CC          C compiler command
-  CFLAGS      C compiler flags
-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-              nonstandard directory <lib dir>
-  LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
-              you have headers in a nonstandard directory <include dir>
-  CPP         C preprocessor
-  CXX         C++ compiler command
-  CXXFLAGS    C++ compiler flags
-  CXXCPP      C++ preprocessor
-  XMKMF       Path to xmkmf, Makefile generator for X Window System
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" ||
-      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
-      continue
-    ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-    cd "$ac_dir" || { ac_status=$?; continue; }
-    # Check for guested configure.
-    if test -f "$ac_srcdir/configure.gnu"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
-    elif test -f "$ac_srcdir/configure"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure" --help=recursive
-    else
-      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi || ac_status=$?
-    cd "$ac_pwd" || { ac_status=$?; break; }
-  done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
-  cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
-  exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 test -x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-       $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=$ac_status
-fi
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_compile
-
-# ac_fn_cxx_try_cpp LINENO
-# ------------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_cpp
-
-# ac_fn_cxx_try_link LINENO
-# -------------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 test -x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_link
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_header_compiler=yes
-else
-  ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  ac_header_preproc=yes
-else
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
-  yes:no: )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-	 return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-	    return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-
-# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
-# ----------------------------------------------------
-# Tries to find if the field MEMBER exists in type AGGR, after including
-# INCLUDES, setting cache variable VAR accordingly.
-ac_fn_c_check_member ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
-$as_echo_n "checking for $2.$3... " >&6; }
-if eval \${$4+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$5
-int
-main ()
-{
-static $2 ac_aggr;
-if (ac_aggr.$3)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$4=yes"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$5
-int
-main ()
-{
-static $2 ac_aggr;
-if (sizeof ac_aggr.$3)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$4=yes"
-else
-  eval "$4=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$4
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_member
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
-
-  $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    $as_echo "PATH: $as_dir"
-  done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
-  for ac_arg
-  do
-    case $ac_arg in
-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-    | -silent | --silent | --silen | --sile | --sil)
-      continue ;;
-    *\'*)
-      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    case $ac_pass in
-    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
-    2)
-      as_fn_append ac_configure_args1 " '$ac_arg'"
-      if test $ac_must_keep_next = true; then
-	ac_must_keep_next=false # Got value, back to normal.
-      else
-	case $ac_arg in
-	  *=* | --config-cache | -C | -disable-* | --disable-* \
-	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-	  | -with-* | --with-* | -without-* | --without-* | --x)
-	    case "$ac_configure_args0 " in
-	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-	    esac
-	    ;;
-	  -* ) ac_must_keep_next=true ;;
-	esac
-      fi
-      as_fn_append ac_configure_args " '$ac_arg'"
-      ;;
-    esac
-  done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  {
-    echo
-
-    $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
-    echo
-    # The following way of writing the cache mishandles newlines in values,
-(
-  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
-      esac ;;
-    esac
-  done
-  (set) 2>&1 |
-    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      sed -n \
-	"s/'\''/'\''\\\\'\'''\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
-      ;; #(
-    *)
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-)
-    echo
-
-    $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
-    echo
-    for ac_var in $ac_subst_vars
-    do
-      eval ac_val=\$$ac_var
-      case $ac_val in
-      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-      esac
-      $as_echo "$ac_var='\''$ac_val'\''"
-    done | sort
-    echo
-
-    if test -n "$ac_subst_files"; then
-      $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
-      echo
-      for ac_var in $ac_subst_files
-      do
-	eval ac_val=\$$ac_var
-	case $ac_val in
-	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-	esac
-	$as_echo "$ac_var='\''$ac_val'\''"
-      done | sort
-      echo
-    fi
-
-    if test -s confdefs.h; then
-      $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
-      echo
-      cat confdefs.h
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      $as_echo "$as_me: caught signal $ac_signal"
-    $as_echo "$as_me: exit $exit_status"
-  } >&5
-  rm -f core *.core core.conftest.* &&
-    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
-    exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
-  # We do not want a PATH search for config.site.
-  case $CONFIG_SITE in #((
-    -*)  ac_site_file1=./$CONFIG_SITE;;
-    */*) ac_site_file1=$CONFIG_SITE;;
-    *)   ac_site_file1=./$CONFIG_SITE;;
-  esac
-elif test "x$prefix" != xNONE; then
-  ac_site_file1=$prefix/share/config.site
-  ac_site_file2=$prefix/etc/config.site
-else
-  ac_site_file1=$ac_default_prefix/share/config.site
-  ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
-  test "x$ac_site_file" = xNONE && continue
-  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file" \
-      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
-  fi
-done
-
-if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special files
-  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
-  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
-    case $cache_file in
-      [\\/]* | ?:[\\/]* ) . "$cache_file";;
-      *)                      . "./$cache_file";;
-    esac
-  fi
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
-  >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val=\$ac_cv_env_${ac_var}_value
-  eval ac_new_val=\$ac_env_${ac_var}_value
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,set)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,);;
-    *)
-      if test "x$ac_old_val" != "x$ac_new_val"; then
-	# differences in whitespace do not lead to failure.
-	ac_old_val_w=`echo x $ac_old_val`
-	ac_new_val_w=`echo x $ac_new_val`
-	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	  ac_cache_corrupted=:
-	else
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
-	  eval $ac_var=\$ac_old_val
-	fi
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
-$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
-$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
-      fi;;
-  esac
-  # Pass precious variables to config.status.
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-    *) ac_arg=$ac_var=$ac_new_val ;;
-    esac
-    case " $ac_configure_args " in
-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-ac_config_headers="$ac_config_headers include/SDL_config.h"
-
-ac_aux_dir=
-for ac_dir in build-scripts "$srcdir"/build-scripts; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-scripts \"$srcdir\"/build-scripts" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
-
-
-
-
-orig_CFLAGS="$CFLAGS"
-
-#
-# Making releases:
-# Edit include/SDL_version.h and change the version, then:
-#   SDL_MICRO_VERSION += 1;
-#   SDL_INTERFACE_AGE += 1;
-#   SDL_BINARY_AGE += 1;
-# if any functions have been added, set SDL_INTERFACE_AGE to 0.
-# if backwards compatibility has been broken,
-# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
-#
-SDL_MAJOR_VERSION=2
-SDL_MINOR_VERSION=0
-SDL_MICRO_VERSION=1
-SDL_INTERFACE_AGE=0
-SDL_BINARY_AGE=1
-SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
-
-
-
-
-
-
-
-
-# libtool versioning
-case `pwd` in
-  *\ * | *\	*)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.4.2'
-macro_revision='1.3337'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='printf %s\n'
-else
-  # Use this function as a fallback that always works.
-  func_fallback_echo ()
-  {
-    eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-  }
-  ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO ""
-}
-
-case "$ECHO" in
-  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
-  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
-  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  fi
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link_default") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile.  We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
-	;;
-    [ab].out )
-	# We found the default executable, but exeext='' is most
-	# certainly right.
-	break;;
-    *.* )
-	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
-	then :; else
-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	fi
-	# We set ac_cv_exeext here because the later test for it is not
-	# safe: cross compilers may not add the suffix if given an `-o'
-	# argument, so we may need to know it at that point already.
-	# Even if this section looks crufty: it has the advantage of
-	# actually working.
-	break;;
-    * )
-	break;;
-  esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
-  ac_file=''
-fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  break;;
-    * ) break;;
-  esac
-done
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
-  { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-  if { ac_try='./conftest$ac_cv_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  for ac_file in conftest.o conftest.obj conftest.*; do
-  test -f "$ac_file" || continue;
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GCC=yes
-else
-  GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-else
-  CFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-     for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
-     done
-     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     { ac_script=; unset ac_script;}
-     if test -z "$SED"; then
-  ac_path_SED_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
-  # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
-  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo '' >> "conftest.nl"
-    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_SED_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_SED="$ac_path_SED"
-      ac_path_SED_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_SED_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_SED"; then
-    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
-  fi
-else
-  ac_cv_path_SED=$SED
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
-  rm -f conftest.sed
-
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$GREP"; then
-  ac_path_GREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
-  # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_GREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_GREP="$ac_path_GREP"
-      ac_path_GREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_GREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-   then ac_cv_path_EGREP="$GREP -E"
-   else
-     if test -z "$EGREP"; then
-  ac_path_EGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in egrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
-  # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_EGREP="$ac_path_EGREP"
-      ac_path_EGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_EGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_EGREP=$EGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
-   then ac_cv_path_FGREP="$GREP -F"
-   else
-     if test -z "$FGREP"; then
-  ac_path_FGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in fgrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_FGREP" || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
-  # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'FGREP' >> "conftest.nl"
-    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_FGREP="$ac_path_FGREP"
-      ac_path_FGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_FGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_FGREP"; then
-    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_FGREP=$FGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$DUMPBIN"; then :
-    # Let the user override the test.
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in dumpbin "link -dump"
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DUMPBIN"; then
-  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$DUMPBIN" && break
-  done
-fi
-if test -z "$DUMPBIN"; then
-  ac_ct_DUMPBIN=$DUMPBIN
-  for ac_prog in dumpbin "link -dump"
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DUMPBIN"; then
-  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_DUMPBIN" && break
-done
-
-  if test "x$ac_ct_DUMPBIN" = x; then
-    DUMPBIN=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DUMPBIN=$ac_ct_DUMPBIN
-  fi
-fi
-
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
-    *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
-      ;;
-    *)
-      DUMPBIN=:
-      ;;
-    esac
-  fi
-
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
-  cat conftest.out >&5
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-    i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  mint*)
-    # On MiNT this can take a long time and run out of memory.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  os2*)
-    # The test takes a long time on OS/2.
-    lt_cv_sys_max_cmd_len=8192
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
-	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-
-fi
-
-if test -n $lt_cv_sys_max_cmd_len ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-
-
-
-
-
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-
-
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-        ;;
-    esac
-    ;;
-  *-*-cygwin* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_noop
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-        ;;
-    esac
-    ;;
-  * ) # unhandled hosts (and "normal" native builds)
-    lt_cv_to_host_file_cmd=func_convert_file_noop
-    ;;
-esac
-
-fi
-
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  #assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-        ;;
-    esac
-    ;;
-esac
-
-fi
-
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
-      reload_cmds=false
-    fi
-    ;;
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OBJDUMP"; then
-  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
-  ac_ct_OBJDUMP=$OBJDUMP
-  # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OBJDUMP"; then
-  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OBJDUMP="objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OBJDUMP" = x; then
-    OBJDUMP="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OBJDUMP=$ac_ct_OBJDUMP
-  fi
-else
-  OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[45]*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    # Keep this pattern in sync with the one in func_win32_libid.
-    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-cegcc*)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-haiku*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[3-9]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
-  case $host_os in
-  mingw* | pw32*)
-    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-      want_nocaseglob=yes
-    else
-      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
-    fi
-    ;;
-  esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
-  ac_ct_DLLTOOL=$DLLTOOL
-  # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DLLTOOL"; then
-  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_DLLTOOL" = x; then
-    DLLTOOL="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DLLTOOL=$ac_ct_DLLTOOL
-  fi
-else
-  DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
-  case `$DLLTOOL --help 2>&1` in
-  *--identify-strict*)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-    ;;
-  *)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-    ;;
-  esac
-  ;;
-*)
-  # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-  ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in ar
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$AR" && break
-  done
-fi
-if test -z "$AR"; then
-  ac_ct_AR=$AR
-  for ac_prog in ar
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_AR="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_AR" && break
-done
-
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AR=$ac_ct_AR
-  fi
-fi
-
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ar_at_file=no
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  echo conftest.$ac_objext > conftest.lst
-      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
-      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-  (eval $lt_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-      if test "$ac_status" -eq 0; then
-	# Ensure the archiver fails upon bogus file names.
-	rm -f conftest.$ac_objext libconftest.a
-	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
-  (eval $lt_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-	if test "$ac_status" -ne 0; then
-          lt_cv_ar_at_file=@
-        fi
-      fi
-      rm -f conftest.* libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
-
-if test "x$lt_cv_ar_at_file" = xno; then
-  archiver_list_spec=
-else
-  archiver_list_spec=$lt_cv_ar_at_file
-fi
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
-  darwin*)
-    lock_old_archive_extraction=yes ;;
-  *)
-    lock_old_archive_extraction=no ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$AWK" && break
-done
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDEGRST]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[BCDEGRST]'
-  ;;
-osf*)
-  symcode='[BCDEGQRST]'
-  ;;
-solaris*)
-  symcode='[BDRT]'
-  ;;
-sco3.2v5*)
-  symcode='[DT]'
-  ;;
-sysv4.2uw2*)
-  symcode='[DT]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[ABDT]'
-  ;;
-sysv4)
-  symcode='[DFNSTU]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK '"\
-"     {last_section=section; section=\$ 3};"\
-"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
-  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data.  */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-	  cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-LT_DLSYM_CONST struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-	  cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_globsym_save_LIBS=$LIBS
-	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
-	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
-	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
-	    pipe_works=yes
-	  fi
-	  LIBS=$lt_globsym_save_LIBS
-	  CFLAGS=$lt_globsym_save_CFLAGS
-	else
-	  echo "cannot find nm_test_func in $nlist" >&5
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&5
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
-    fi
-  else
-    echo "$progname: failed program was:" >&5
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
-  nm_file_list_spec='@'
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
-
-# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
-  withval=$with_sysroot;
-else
-  with_sysroot=no
-fi
-
-
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
-   if test "$GCC" = yes; then
-     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-   fi
-   ;; #(
- /*)
-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-   ;; #(
- no|'')
-   ;; #(
- *)
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
-   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
-   ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
-
-
-
-
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
-  enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-	HPUX_IA64_MODE="32"
-	;;
-      *ELF-64*)
-	HPUX_IA64_MODE="64"
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -melf32bsmip"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -melf32bmipn32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -melf64bmip"
-	;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -32"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -n32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -64"
-	  ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_i386_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
-	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
-	    LD="${LD-ld} -m elf32ppclinux"
-	    ;;
-	  s390x-*linux*)
-	    LD="${LD-ld} -m elf_s390"
-	    ;;
-	  sparc64-*linux*)
-	    LD="${LD-ld} -m elf32_sparc"
-	    ;;
-	esac
-	;;
-      *64-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_x86_64_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_x86_64"
-	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
-	    LD="${LD-ld} -m elf64ppc"
-	    ;;
-	  s390*-*linux*|s390*-*tpf*)
-	    LD="${LD-ld} -m elf64_s390"
-	    ;;
-	  sparc*-*linux*)
-	    LD="${LD-ld} -m elf64_sparc"
-	    ;;
-	esac
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_cc_needs_belf=yes
-else
-  lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*)
-        case $host in
-        i?86-*-solaris*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        sparc*-*-solaris*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-        esac
-        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
-        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
-        fi
-        ;;
-      *)
-	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-	  LD="${LD-ld} -64"
-	fi
-	;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks="$enable_libtool_lock"
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MANIFEST_TOOL"; then
-  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-if test -n "$MANIFEST_TOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
-  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
-  # Extract the first word of "mt", so it can be a program name with args.
-set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_MANIFEST_TOOL"; then
-  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-if test -n "$ac_ct_MANIFEST_TOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_MANIFEST_TOOL" = x; then
-    MANIFEST_TOOL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
-  fi
-else
-  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-fi
-
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_path_mainfest_tool=no
-  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
-  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-  cat conftest.err >&5
-  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-    lt_cv_path_mainfest_tool=yes
-  fi
-  rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
-  MANIFEST_TOOL=:
-fi
-
-
-
-
-
-
-  case $host_os in
-    rhapsody* | darwin*)
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DSYMUTIL"; then
-  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
-  ac_ct_DSYMUTIL=$DSYMUTIL
-  # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DSYMUTIL"; then
-  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_DSYMUTIL" = x; then
-    DSYMUTIL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DSYMUTIL=$ac_ct_DSYMUTIL
-  fi
-else
-  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NMEDIT"; then
-  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
-  ac_ct_NMEDIT=$NMEDIT
-  # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_NMEDIT"; then
-  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_NMEDIT="nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_NMEDIT" = x; then
-    NMEDIT=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    NMEDIT=$ac_ct_NMEDIT
-  fi
-else
-  NMEDIT="$ac_cv_prog_NMEDIT"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LIPO"; then
-  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_LIPO"; then
-  ac_ct_LIPO=$LIPO
-  # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_LIPO"; then
-  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_LIPO="lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_LIPO" = x; then
-    LIPO=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    LIPO=$ac_ct_LIPO
-  fi
-else
-  LIPO="$ac_cv_prog_LIPO"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OTOOL"; then
-  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
-  ac_ct_OTOOL=$OTOOL
-  # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OTOOL"; then
-  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OTOOL="otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OTOOL" = x; then
-    OTOOL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL=$ac_ct_OTOOL
-  fi
-else
-  OTOOL="$ac_cv_prog_OTOOL"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OTOOL64"; then
-  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
-  ac_ct_OTOOL64=$OTOOL64
-  # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OTOOL64"; then
-  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OTOOL64="otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OTOOL64" = x; then
-    OTOOL64=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL64=$ac_ct_OTOOL64
-  fi
-else
-  OTOOL64="$ac_cv_prog_OTOOL64"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-	# By default we will add the -single_module flag. You can override
-	# by either setting the environment variable LT_MULTI_MODULE
-	# non-empty at configure time, or by adding -multi_module to the
-	# link flags.
-	rm -rf libconftest.dylib*
-	echo "int foo(void){return 1;}" > conftest.c
-	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
-	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-	# If there is a non-empty error log, and "single_module"
-	# appears in it, assume the flag caused a linker warning
-        if test -s conftest.err && $GREP single_module conftest.err; then
-	  cat conftest.err >&5
-	# Otherwise, if the output was created with a 0 exit code from
-	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
-	  lt_cv_apple_cc_single_mod=yes
-	else
-	  cat conftest.err >&5
-	fi
-	rm -rf libconftest.dylib*
-	rm -f conftest.*
-      fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_ld_exported_symbols_list=yes
-else
-  lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-	LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_force_load=no
-      cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
-      echo "$AR cru libconftest.a conftest.o" >&5
-      $AR cru libconftest.a conftest.o 2>&5
-      echo "$RANLIB libconftest.a" >&5
-      $RANLIB libconftest.a 2>&5
-      cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
-      _lt_result=$?
-      if test -s conftest.err && $GREP force_load conftest.err; then
-	cat conftest.err >&5
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
-	lt_cv_ld_force_load=yes
-      else
-	cat conftest.err >&5
-      fi
-        rm -f conftest.err libconftest.a conftest conftest.c
-        rm -rf conftest.dSYM
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
-    case $host_os in
-    rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[012]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CPP=$CPP
-
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in dlfcn.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-# Set options
-enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AS"; then
-  ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AS="${ac_tool_prefix}as"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AS"; then
-  ac_ct_AS=$AS
-  # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AS"; then
-  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_AS="as"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_AS" = x; then
-    AS="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AS=$ac_ct_AS
-  fi
-else
-  AS="$ac_cv_prog_AS"
-fi
-
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
-  ac_ct_DLLTOOL=$DLLTOOL
-  # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DLLTOOL"; then
-  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_DLLTOOL" = x; then
-    DLLTOOL="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DLLTOOL=$ac_ct_DLLTOOL
-  fi
-else
-  DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OBJDUMP"; then
-  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
-  ac_ct_OBJDUMP=$OBJDUMP
-  # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OBJDUMP"; then
-  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OBJDUMP="objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OBJDUMP" = x; then
-    OBJDUMP="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OBJDUMP=$ac_ct_OBJDUMP
-  fi
-else
-  OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-  ;;
-esac
-
-test -z "$AS" && AS=as
-
-
-
-
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-
-        enable_dlopen=no
-
-
-
-            # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
-  enableval=$enable_shared; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
-  # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
-  enableval=$enable_static; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_static=yes
-fi
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
-  withval=$with_pic; lt_p=${PACKAGE-default}
-    case $withval in
-    yes|no) pic_mode=$withval ;;
-    *)
-      pic_mode=default
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
-	if test "X$lt_pkg" = "X$lt_p"; then
-	  pic_mode=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  pic_mode=default
-fi
-
-
-test -z "$pic_mode" && pic_mode=default
-
-
-
-
-
-
-
-  # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
-  enableval=$enable_fast_install; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_fast_install=yes
-fi
-
-
-
-
-
-
-
-
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-_LT_EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-_LT_EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  else
-    MAGIC_CMD=:
-  fi
-fi
-
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
-  case $cc_basename in
-  nvcc*)
-    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
-  *)
-    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
-  esac
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_rtti_exceptions=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
-    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
-    :
-fi
-
-fi
-
-
-
-
-
-
-  lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl='-Wl,'
-    lt_prog_compiler_static='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            lt_prog_compiler_pic='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic='-fno-common'
-      ;;
-
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      lt_prog_compiler_static=
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='-fPIC'
-	;;
-      esac
-      ;;
-
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      lt_prog_compiler_pic='-fPIC'
-      ;;
-    esac
-
-    case $cc_basename in
-    nvcc*) # Cuda Compiler Driver 2.2
-      lt_prog_compiler_wl='-Xlinker '
-      if test -n "$lt_prog_compiler_pic"; then
-        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
-      fi
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static='-Bstatic'
-      else
-	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
-      case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
-      ecc*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-KPIC'
-	lt_prog_compiler_static='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-fPIC'
-	lt_prog_compiler_static='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='--shared'
-	lt_prog_compiler_static='--static'
-	;;
-      nagfor*)
-	# NAG Fortran compiler
-	lt_prog_compiler_wl='-Wl,-Wl,,'
-	lt_prog_compiler_pic='-PIC'
-	lt_prog_compiler_static='-Bstatic'
-	;;
-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-fpic'
-	lt_prog_compiler_static='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static='-non_shared'
-        ;;
-      xl* | bgxl* | bgf* | mpixl*)
-	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-qpic'
-	lt_prog_compiler_static='-qstaticlink'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  lt_prog_compiler_pic='-KPIC'
-	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl=''
-	  ;;
-	*Sun\ F* | *Sun*Fortran*)
-	  lt_prog_compiler_pic='-KPIC'
-	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl='-Qoption ld '
-	  ;;
-	*Sun\ C*)
-	  # Sun C 5.9
-	  lt_prog_compiler_pic='-KPIC'
-	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl='-Wl,'
-	  ;;
-        *Intel*\ [CF]*Compiler*)
-	  lt_prog_compiler_wl='-Wl,'
-	  lt_prog_compiler_pic='-fPIC'
-	  lt_prog_compiler_static='-static'
-	  ;;
-	*Portland\ Group*)
-	  lt_prog_compiler_wl='-Wl,'
-	  lt_prog_compiler_pic='-fpic'
-	  lt_prog_compiler_static='-Bstatic'
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    newsos6)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    rdos*)
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    solaris*)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
-	lt_prog_compiler_wl='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      lt_prog_compiler_wl='-Qoption ld '
-      lt_prog_compiler_pic='-PIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic='-Kconform_pic'
-	lt_prog_compiler_static='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    unicos*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_can_build_shared=no
-      ;;
-
-    uts4*)
-      lt_prog_compiler_pic='-pic'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    *)
-      lt_prog_compiler_can_build_shared=no
-      ;;
-    esac
-  fi
-
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic=
-    ;;
-  *)
-    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-    ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic_works=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works=yes
-     fi
-   fi
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
-    case $lt_prog_compiler_pic in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
-     esac
-else
-    lt_prog_compiler_pic=
-     lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
-    :
-else
-    lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
-  runpath_var=
-  allow_undefined_flag=
-  always_export_symbols=no
-  archive_cmds=
-  archive_expsym_cmds=
-  compiler_needs_object=no
-  enable_shared_with_static_runtimes=no
-  export_dynamic_flag_spec=
-  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  hardcode_automatic=no
-  hardcode_direct=no
-  hardcode_direct_absolute=no
-  hardcode_libdir_flag_spec=
-  hardcode_libdir_separator=
-  hardcode_minus_L=no
-  hardcode_shlibpath_var=unsupported
-  inherit_rpath=no
-  link_all_deplibs=unknown
-  module_cmds=
-  module_expsym_cmds=
-  old_archive_from_new_cmds=
-  old_archive_from_expsyms_cmds=
-  thread_safe_flag_spec=
-  whole_archive_flag_spec=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs=yes
-
-  # On some targets, GNU ld is compatible enough with the native linker
-  # that we're better off using the native interface for both.
-  lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
-    case $host_os in
-      aix*)
-	# The AIX port of GNU ld has always aspired to compatibility
-	# with the native linker.  However, as the warning in the GNU ld
-	# block says, versions before 2.19.5* couldn't really create working
-	# shared libraries, regardless of the interface used.
-	case `$LD -v 2>&1` in
-	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
-	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
-	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
-	  *)
-	    lt_use_gnu_ld_interface=yes
-	    ;;
-	esac
-	;;
-      *)
-	lt_use_gnu_ld_interface=yes
-	;;
-    esac
-  fi
-
-  if test "$lt_use_gnu_ld_interface" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      whole_archive_flag_spec=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='${wl}--export-all-symbols'
-      allow_undefined_flag=unsupported
-      always_export_symbols=no
-      enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      link_all_deplibs=yes
-      ;;
-
-    interix[3-9]*)
-      hardcode_direct=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
-      tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
-	case $cc_basename in
-	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
-	esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
-      then
-	tmp_addflag=' $pic_flag'
-	tmp_sharedflag='-shared'
-	case $cc_basename,$host_cpu in
-        pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95* | pgfortran*)
-					# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	lf95*)				# Lahey Fortran 8.1
-	  whole_archive_flag_spec=
-	  tmp_sharedflag='--shared' ;;
-	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
-	  tmp_sharedflag='-qmkshrobj'
-	  tmp_addflag= ;;
-	nvcc*)	# Cuda Compiler Driver 2.2
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	  compiler_needs_object=yes
-	  ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	  compiler_needs_object=yes
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	esac
-	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-        if test "x$supports_anon_versioning" = xyes; then
-          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-        fi
-
-	case $cc_basename in
-	xlf* | bgf* | bgxlf* | mpixlf*)
-	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
-	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-	  fi
-	  ;;
-	esac
-      else
-        ld_shlibs=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  # For security reasons, it is highly recommended that you always
-	  # use absolute paths for naming shared libraries, and exclude the
-	  # DT_RUNPATH tag from executables and libraries.  But doing so
-	  # requires that you compile everything twice, which is a pain.
-	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  else
-	    ld_shlibs=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-    esac
-
-    if test "$ld_shlibs" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec=
-      export_dynamic_flag_spec=
-      whole_archive_flag_spec=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag=unsupported
-      always_export_symbols=yes
-      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct=unsupported
-      fi
-      ;;
-
-    aix[4-9]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	# Also, AIX nm treats weak defined symbols like other global
-	# defined symbols, whereas GNU nm marks them as "W".
-	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-	    aix_use_runtimelinking=yes
-	    break
-	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds=''
-      hardcode_direct=yes
-      hardcode_direct_absolute=yes
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      file_list_spec='${wl}-f,'
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	  # We have reworked collect2
-	  :
-	  else
-	  # We have old collect2
-	  hardcode_direct=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  hardcode_minus_L=yes
-	  hardcode_libdir_flag_spec='-L$libdir'
-	  hardcode_libdir_separator=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      export_dynamic_flag_spec='${wl}-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  if ${lt_cv_aix_libpath_+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-  lt_aix_libpath_sed='
-      /Import File Strings/,/^$/ {
-	  /^0/ {
-	      s/^0  *\([^ ]*\) *$/\1/
-	      p
-	  }
-      }'
-  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
-  fi
-
-fi
-
-  aix_libpath=$lt_cv_aix_libpath_
-fi
-
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-      else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an
-	 # empty executable.
-	 if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  if ${lt_cv_aix_libpath_+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-  lt_aix_libpath_sed='
-      /Import File Strings/,/^$/ {
-	  /^0/ {
-	      s/^0  *\([^ ]*\) *$/\1/
-	      p
-	  }
-      }'
-  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
-  fi
-
-fi
-
-  aix_libpath=$lt_cv_aix_libpath_
-fi
-
-	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' ${wl}-bernotok'
-	  allow_undefined_flag=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
-	    # We only use this code for GNU lds that support --whole-archive.
-	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	  else
-	    # Exported symbols can be pulled into shared objects from archives
-	    whole_archive_flag_spec='$convenience'
-	  fi
-	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      case $cc_basename in
-      cl*)
-	# Native MSVC
-	hardcode_libdir_flag_spec=' '
-	allow_undefined_flag=unsupported
-	always_export_symbols=yes
-	file_list_spec='@'
-	# Tell ltmain to make .lib files, not .a files.
-	libext=lib
-	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
-	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
-	# The linker will not automatically build a static lib if we build a DLL.
-	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
-	enable_shared_with_static_runtimes=yes
-	exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-	# Don't use ranlib
-	old_postinstall_cmds='chmod 644 $oldlib'
-	postlink_cmds='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
-	;;
-      *)
-	# Assume MSVC wrapper
-	hardcode_libdir_flag_spec=' '
-	allow_undefined_flag=unsupported
-	# Tell ltmain to make .lib files, not .a files.
-	libext=lib
-	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
-	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-	# The linker will automatically build a .lib file if we build a DLL.
-	old_archive_from_new_cmds='true'
-	# FIXME: Should let the user specify the lib program.
-	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-	enable_shared_with_static_runtimes=yes
-	;;
-      esac
-      ;;
-
-    darwin* | rhapsody*)
-
-
-  archive_cmds_need_lc=no
-  hardcode_direct=no
-  hardcode_automatic=yes
-  hardcode_shlibpath_var=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
-  else
-    whole_archive_flag_spec=''
-  fi
-  link_all_deplibs=yes
-  allow_undefined_flag="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-
-  else
-  ld_shlibs=no
-  fi
-
-      ;;
-
-    dgux*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2.*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_direct=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator=:
-	hardcode_direct=yes
-	hardcode_direct_absolute=yes
-	export_dynamic_flag_spec='${wl}-E'
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-
-	  # Older versions of the 11.00 compiler do not understand -b yet
-	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler__b=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS -b"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler__b=yes
-       fi
-     else
-       lt_cv_prog_compiler__b=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
-
-if test x"$lt_cv_prog_compiler__b" = xyes; then
-    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-else
-    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-fi
-
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_direct=no
-	  hardcode_shlibpath_var=no
-	  ;;
-	*)
-	  hardcode_direct=yes
-	  hardcode_direct_absolute=yes
-	  export_dynamic_flag_spec='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	# Try to use the -exported_symbol ld option, if it does not
-	# work, assume that -exports_file does not work either and
-	# implicitly export all symbols.
-	# This should be the same for all languages, so no per-tag cache variable.
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int foo (void) { return 0; }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_irix_exported_symbol=yes
-else
-  lt_cv_irix_exported_symbol=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-           LDFLAGS="$save_LDFLAGS"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-	fi
-      else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      inherit_rpath=yes
-      link_all_deplibs=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    newsos6)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_shlibpath_var=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	hardcode_direct=yes
-	hardcode_shlibpath_var=no
-	hardcode_direct_absolute=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-	fi
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec='-rpath $libdir'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_separator=:
-      ;;
-
-    solaris*)
-      no_undefined_flag=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-	case `$CC -V 2>&1` in
-	*"Compilers 5.0"*)
-	  wlarc=''
-	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-	  ;;
-	*)
-	  wlarc='${wl}'
-	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-	  ;;
-	esac
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_shlibpath_var=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
-	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      link_all_deplibs=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds='$CC -r -o $output$reload_objs'
-	  hardcode_direct=no
-        ;;
-	motorola)
-	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='${wl}-z,text'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-R,$libdir'
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      ld_shlibs=no
-      ;;
-    esac
-
-    if test x$host_vendor = xsni; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	export_dynamic_flag_spec='${wl}-Blargedynsym'
-	;;
-      esac
-    fi
-  fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  $RM conftest*
-	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } 2>conftest.err; then
-	  soname=conftest
-	  lib=conftest
-	  libobjs=conftest.$ac_objext
-	  deplibs=
-	  wl=$lt_prog_compiler_wl
-	  pic_flag=$lt_prog_compiler_pic
-	  compiler_flags=-v
-	  linker_flags=-v
-	  verstring=
-	  output_objdir=.
-	  libname=conftest
-	  lt_save_allow_undefined_flag=$allow_undefined_flag
-	  allow_undefined_flag=
-	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
-  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-	  then
-	    lt_cv_archive_cmds_need_lc=no
-	  else
-	    lt_cv_archive_cmds_need_lc=yes
-	  fi
-	  allow_undefined_flag=$lt_save_allow_undefined_flag
-	else
-	  cat conftest.err 1>&5
-	fi
-	$RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
-      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-if test "$GCC" = yes; then
-  case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
-  esac
-  case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
-  case $lt_search_path_spec in
-  *\;*)
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
-    ;;
-  *)
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
-    ;;
-  esac
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
-      test -d "$lt_sys_path" && \
-	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[lt_foo]++; }
-  if (lt_freq[lt_foo] == 1) { print lt_foo; }
-}'`
-  # AWK program above erroneously prepends '/' to C:/dos/paths
-  # for these hosts.
-  case $host_os in
-    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
-  esac
-  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$cc_basename in
-  yes,*)
-    # gcc
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
-
-      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}'
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    dynamic_linker='Win32 ld.exe'
-    ;;
-
-  *,cl*)
-    # Native MSVC
-    libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
-
-    case $build_os in
-    mingw*)
-      sys_lib_search_path_spec=
-      lt_save_ifs=$IFS
-      IFS=';'
-      for lt_path in $LIB
-      do
-        IFS=$lt_save_ifs
-        # Let DOS variable expansion print the short 8.3 style file name.
-        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-      done
-      IFS=$lt_save_ifs
-      # Convert to MSYS style.
-      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-      ;;
-    cygwin*)
-      # Convert to unix form, then to dos form, then back to unix form
-      # but this time dos style (no spaces!) so that the unix form looks
-      # like /cygdrive/c/PROGRA~1:/cygdr...
-      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      ;;
-    *)
-      sys_lib_search_path_spec="$LIB"
-      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      # FIXME: find the short name or the path components, as spaces are
-      # common. (e.g. "Program Files" -> "PROGRA~1")
-      ;;
-    esac
-
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-    dynamic_linker='Win32 link.exe'
-    ;;
-
-  *)
-    # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    dynamic_linker='Win32 ld.exe'
-    ;;
-  esac
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[23].*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2.*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-haiku*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
-  postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
-  ;;
-
-interix[3-9]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux # correct to gnu/linux during the next big refactor
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-
-  # Some binutils ld are patched to set DT_RUNPATH
-  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
-	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-
-fi
-
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
-   test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-
-
-
-
-  if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
-else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-
-fi
-
-    ;;
-
-  *)
-    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_shl_load=yes
-else
-  ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
-else
-  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
-else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_svld_dlopen=yes
-else
-  ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_dld_link=yes
-else
-  ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-	}
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-	}
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    fi
-    ;;
-  *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-  # Report which library types will actually be built
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-
-
-
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-        ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-
-LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
-LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
-LT_REVISION=$SDL_INTERFACE_AGE
-LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  fi
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GCC=yes
-else
-  GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-else
-  CFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CXX" && break
-done
-
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CXX=$ac_ct_CXX
-  fi
-fi
-
-  fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GXX=yes
-else
-  GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-else
-  CXXFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
-  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-	 CXXFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-func_stripname_cnf ()
-{
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-  esac
-} # func_stripname_cnf
-
-      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
-  if ${ac_cv_prog_CXXCPP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CXXCPP needs to be expanded
-    for CXXCPP in "$CXX -E" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
-  CXXCPP=$ac_cv_prog_CXXCPP
-else
-  ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-else
-  _lt_caught_CXX_error=yes
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-compiler_needs_object_CXX=no
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_direct_absolute_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-inherit_rpath_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-reload_flag_CXX=$reload_flag
-reload_cmds_CXX=$reload_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-  # save warnings/boilerplate of simple test code
-  ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-  ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_CFLAGS=$CFLAGS
-  lt_save_LD=$LD
-  lt_save_GCC=$GCC
-  GCC=$GXX
-  lt_save_with_gnu_ld=$with_gnu_ld
-  lt_save_path_LD=$lt_cv_path_LD
-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-  else
-    $as_unset lt_cv_prog_gnu_ld
-  fi
-  if test -n "${lt_cv_path_LDCXX+set}"; then
-    lt_cv_path_LD=$lt_cv_path_LDCXX
-  else
-    $as_unset lt_cv_path_LD
-  fi
-  test -z "${LDCXX+set}" || LD=$LDCXX
-  CC=${CXX-"c++"}
-  CFLAGS=$CXXFLAGS
-  compiler=$CC
-  compiler_CXX=$CC
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-
-  if test -n "$compiler"; then
-    # We don't want -fno-exception when compiling C++ code, so set the
-    # no_builtin_flag separately
-    if test "$GXX" = yes; then
-      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-    else
-      lt_prog_compiler_no_builtin_flag_CXX=
-    fi
-
-    if test "$GXX" = yes; then
-      # Set up default GNU C++ configuration
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
-      # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-        # If archive_cmds runs LD, not CC, wlarc should be empty
-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-        #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
-
-        # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-	  $GREP 'no-whole-archive' > /dev/null; then
-          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-        else
-          whole_archive_flag_spec_CXX=
-        fi
-      else
-        with_gnu_ld=no
-        wlarc=
-
-        # A generic and very simple default shared library creation
-        # command for GNU C++ for the case where it uses the native
-        # linker, instead of GNU ld.  If possible, this setting should
-        # overridden to take advantage of the native linker features on
-        # the platform it is being used on.
-        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      fi
-
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-    else
-      GXX=no
-      with_gnu_ld=no
-      wlarc=
-    fi
-
-    # PORTME: fill in a description of your system's C++ link characteristics
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-    ld_shlibs_CXX=yes
-    case $host_os in
-      aix3*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-      aix[4-9]*)
-        if test "$host_cpu" = ia64; then
-          # On IA64, the linker does run time linking by default, so we don't
-          # have to do anything special.
-          aix_use_runtimelinking=no
-          exp_sym_flag='-Bexport'
-          no_entry_flag=""
-        else
-          aix_use_runtimelinking=no
-
-          # Test if we are trying to use run time linking or normal
-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
-          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	    for ld_flag in $LDFLAGS; do
-	      case $ld_flag in
-	      *-brtl*)
-	        aix_use_runtimelinking=yes
-	        break
-	        ;;
-	      esac
-	    done
-	    ;;
-          esac
-
-          exp_sym_flag='-bexport'
-          no_entry_flag='-bnoentry'
-        fi
-
-        # When large executables or shared objects are built, AIX ld can
-        # have problems creating the table of contents.  If linking a library
-        # or program results in "error TOC overflow" add -mminimal-toc to
-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-        archive_cmds_CXX=''
-        hardcode_direct_CXX=yes
-        hardcode_direct_absolute_CXX=yes
-        hardcode_libdir_separator_CXX=':'
-        link_all_deplibs_CXX=yes
-        file_list_spec_CXX='${wl}-f,'
-
-        if test "$GXX" = yes; then
-          case $host_os in aix4.[012]|aix4.[012].*)
-          # We only want to do this on AIX 4.2 and lower, the check
-          # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	    # We have reworked collect2
-	    :
-	  else
-	    # We have old collect2
-	    hardcode_direct_CXX=unsupported
-	    # It fails to find uninstalled libraries when the uninstalled
-	    # path is not listed in the libpath.  Setting hardcode_minus_L
-	    # to unsupported forces relinking
-	    hardcode_minus_L_CXX=yes
-	    hardcode_libdir_flag_spec_CXX='-L$libdir'
-	    hardcode_libdir_separator_CXX=
-	  fi
-          esac
-          shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
-	  fi
-        else
-          # not using gcc
-          if test "$host_cpu" = ia64; then
-	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	  # chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-          else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
-	    else
-	      shared_flag='${wl}-bM:SRE'
-	    fi
-          fi
-        fi
-
-        export_dynamic_flag_spec_CXX='${wl}-bexpall'
-        # It seems that -bexpall does not export symbols beginning with
-        # underscore (_), so it is better to generate a list of symbols to
-	# export.
-        always_export_symbols_CXX=yes
-        if test "$aix_use_runtimelinking" = yes; then
-          # Warning - without using the other runtime loading flags (-brtl),
-          # -berok will link without error, but may produce a broken library.
-          allow_undefined_flag_CXX='-berok'
-          # Determine the default libpath from the value encoded in an empty
-          # executable.
-          if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  if ${lt_cv_aix_libpath__CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-  lt_aix_libpath_sed='
-      /Import File Strings/,/^$/ {
-	  /^0/ {
-	      s/^0  *\([^ ]*\) *$/\1/
-	      p
-	  }
-      }'
-  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$lt_cv_aix_libpath__CXX"; then
-    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  if test -z "$lt_cv_aix_libpath__CXX"; then
-    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
-  fi
-
-fi
-
-  aix_libpath=$lt_cv_aix_libpath__CXX
-fi
-
-          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-        else
-          if test "$host_cpu" = ia64; then
-	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
-	    allow_undefined_flag_CXX="-z nodefs"
-	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-          else
-	    # Determine the default libpath from the value encoded in an
-	    # empty executable.
-	    if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  if ${lt_cv_aix_libpath__CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-  lt_aix_libpath_sed='
-      /Import File Strings/,/^$/ {
-	  /^0/ {
-	      s/^0  *\([^ ]*\) *$/\1/
-	      p
-	  }
-      }'
-  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  # Check for a 64-bit object if we didn't find anything.
-  if test -z "$lt_cv_aix_libpath__CXX"; then
-    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  if test -z "$lt_cv_aix_libpath__CXX"; then
-    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
-  fi
-
-fi
-
-  aix_libpath=$lt_cv_aix_libpath__CXX
-fi
-
-	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-	    # Warning - without using the other run time loading flags,
-	    # -berok will link without error, but may produce a broken library.
-	    no_undefined_flag_CXX=' ${wl}-bernotok'
-	    allow_undefined_flag_CXX=' ${wl}-berok'
-	    if test "$with_gnu_ld" = yes; then
-	      # We only use this code for GNU lds that support --whole-archive.
-	      whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	    else
-	      # Exported symbols can be pulled into shared objects from archives
-	      whole_archive_flag_spec_CXX='$convenience'
-	    fi
-	    archive_cmds_need_lc_CXX=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-          fi
-        fi
-        ;;
-
-      beos*)
-	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	  allow_undefined_flag_CXX=unsupported
-	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	  # support --undefined.  This deserves some investigation.  FIXME
-	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	else
-	  ld_shlibs_CXX=no
-	fi
-	;;
-
-      chorus*)
-        case $cc_basename in
-          *)
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	  ;;
-        esac
-        ;;
-
-      cygwin* | mingw* | pw32* | cegcc*)
-	case $GXX,$cc_basename in
-	,cl* | no,cl*)
-	  # Native MSVC
-	  # hardcode_libdir_flag_spec is actually meaningless, as there is
-	  # no search path for DLLs.
-	  hardcode_libdir_flag_spec_CXX=' '
-	  allow_undefined_flag_CXX=unsupported
-	  always_export_symbols_CXX=yes
-	  file_list_spec_CXX='@'
-	  # Tell ltmain to make .lib files, not .a files.
-	  libext=lib
-	  # Tell ltmain to make .dll files, not .so files.
-	  shrext_cmds=".dll"
-	  # FIXME: Setting linknames here is a bad hack.
-	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	    else
-	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	    fi~
-	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	    linknames='
-	  # The linker will not automatically build a static lib if we build a DLL.
-	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
-	  enable_shared_with_static_runtimes_CXX=yes
-	  # Don't use ranlib
-	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
-	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
-	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-	    case $lt_outputfile in
-	      *.exe|*.EXE) ;;
-	      *)
-		lt_outputfile="$lt_outputfile.exe"
-		lt_tool_outputfile="$lt_tool_outputfile.exe"
-		;;
-	    esac~
-	    func_to_tool_file "$lt_outputfile"~
-	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	      $RM "$lt_outputfile.manifest";
-	    fi'
-	  ;;
-	*)
-	  # g++
-	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-	  # as there is no search path for DLLs.
-	  hardcode_libdir_flag_spec_CXX='-L$libdir'
-	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
-	  allow_undefined_flag_CXX=unsupported
-	  always_export_symbols_CXX=no
-	  enable_shared_with_static_runtimes_CXX=yes
-
-	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file (1st line
-	    # is EXPORTS), use it as is; otherwise, prepend...
-	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      cp $export_symbols $output_objdir/$soname.def;
-	    else
-	      echo EXPORTS > $output_objdir/$soname.def;
-	      cat $export_symbols >> $output_objdir/$soname.def;
-	    fi~
-	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	  else
-	    ld_shlibs_CXX=no
-	  fi
-	  ;;
-	esac
-	;;
-      darwin* | rhapsody*)
-
-
-  archive_cmds_need_lc_CXX=no
-  hardcode_direct_CXX=no
-  hardcode_automatic_CXX=yes
-  hardcode_shlibpath_var_CXX=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
-  else
-    whole_archive_flag_spec_CXX=''
-  fi
-  link_all_deplibs_CXX=yes
-  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=func_echo_all
-    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-    fi
-
-  else
-  ld_shlibs_CXX=no
-  fi
-
-	;;
-
-      dgux*)
-        case $cc_basename in
-          ec++*)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          ghcx*)
-	    # Green Hills C++ Compiler
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-        esac
-        ;;
-
-      freebsd2.*)
-        # C++ shared libraries reported to be fairly broken before
-	# switch to ELF
-        ld_shlibs_CXX=no
-        ;;
-
-      freebsd-elf*)
-        archive_cmds_need_lc_CXX=no
-        ;;
-
-      freebsd* | dragonfly*)
-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-        # conventions
-        ld_shlibs_CXX=yes
-        ;;
-
-      gnu*)
-        ;;
-
-      haiku*)
-        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        link_all_deplibs_CXX=yes
-        ;;
-
-      hpux9*)
-        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-        hardcode_libdir_separator_CXX=:
-        export_dynamic_flag_spec_CXX='${wl}-E'
-        hardcode_direct_CXX=yes
-        hardcode_minus_L_CXX=yes # Not in the search PATH,
-				             # but as the default
-				             # location of the library.
-
-        case $cc_basename in
-          CC*)
-            # FIXME: insert proper C++ library support
-            ld_shlibs_CXX=no
-            ;;
-          aCC*)
-            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            # Commands to make compiler produce verbose output that lists
-            # what "hidden" libraries, object files and flags are used when
-            # linking a shared library.
-            #
-            # There doesn't appear to be a way to prevent this compiler from
-            # explicitly linking system object files so we need to strip them
-            # from the output so that they don't get included in the library
-            # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-            ;;
-          *)
-            if test "$GXX" = yes; then
-              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            else
-              # FIXME: insert proper C++ library support
-              ld_shlibs_CXX=no
-            fi
-            ;;
-        esac
-        ;;
-
-      hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-	  hardcode_libdir_separator_CXX=:
-
-          case $host_cpu in
-            hppa*64*|ia64*)
-              ;;
-            *)
-	      export_dynamic_flag_spec_CXX='${wl}-E'
-              ;;
-          esac
-        fi
-        case $host_cpu in
-          hppa*64*|ia64*)
-            hardcode_direct_CXX=no
-            hardcode_shlibpath_var_CXX=no
-            ;;
-          *)
-            hardcode_direct_CXX=yes
-            hardcode_direct_absolute_CXX=yes
-            hardcode_minus_L_CXX=yes # Not in the search PATH,
-					         # but as the default
-					         # location of the library.
-            ;;
-        esac
-
-        case $cc_basename in
-          CC*)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          aCC*)
-	    case $host_cpu in
-	      hppa*64*)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      ia64*)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      *)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	    esac
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
-	        case $host_cpu in
-	          hppa*64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          ia64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          *)
-	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	        esac
-	      fi
-	    else
-	      # FIXME: insert proper C++ library support
-	      ld_shlibs_CXX=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      interix[3-9]*)
-	hardcode_direct_CXX=no
-	hardcode_shlibpath_var_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}-E'
-	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-	# Instead, shared libraries are loaded at an image base (0x10000000 by
-	# default) and relocated if they conflict, which is a slow very memory
-	# consuming and fragmenting process.  To avoid this, we pick a random,
-	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	;;
-      irix5* | irix6*)
-        case $cc_basename in
-          CC*)
-	    # SGI C++
-	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	      else
-	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
-	      fi
-	    fi
-	    link_all_deplibs_CXX=yes
-	    ;;
-        esac
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-        hardcode_libdir_separator_CXX=:
-        inherit_rpath_CXX=yes
-        ;;
-
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	    old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-	    ;;
-	  icpc* | ecpc* )
-	    # Intel C++
-	    with_gnu_ld=yes
-	    # version 8.0 and above of icpc choke on multiply defined symbols
-	    # if we add $predep_objects and $postdep_objects, however 7.1 and
-	    # earlier do not add the objects themselves.
-	    case `$CC -V 2>&1` in
-	      *"Version 7."*)
-	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	      *)  # Version 8.0 or newer
-	        tmp_idyn=
-	        case $host_cpu in
-		  ia64*) tmp_idyn=' -i_dynamic';;
-		esac
-	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	    esac
-	    archive_cmds_need_lc_CXX=no
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	    ;;
-          pgCC* | pgcpp*)
-            # Portland Group C++ compiler
-	    case `$CC -V` in
-	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
-	      prelink_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
-	      old_archive_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-		$RANLIB $oldlib'
-	      archive_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      archive_expsym_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    *) # Version 6 and above use weak symbols
-	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    esac
-
-	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-            ;;
-	  cxx*)
-	    # Compaq C++
-	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-	    runpath_var=LD_RUN_PATH
-	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-	    hardcode_libdir_separator_CXX=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
-	    ;;
-	  xl* | mpixl* | bgxl*)
-	    # IBM XL 8.0 on PPC, with GNU ld
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
-	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	    fi
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      no_undefined_flag_CXX=' -zdefs'
-	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-	      hardcode_libdir_flag_spec_CXX='-R$libdir'
-	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
-	      compiler_needs_object_CXX=yes
-
-	      # Not sure whether something based on
-	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	      # would be better.
-	      output_verbose_link_cmd='func_echo_all'
-
-	      # Archives containing C++ object files must be created using
-	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	      # necessary to make sure instantiated templates are included
-	      # in the archive.
-	      old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-
-      lynxos*)
-        # FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-
-      m88k*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-	;;
-
-      mvs*)
-        case $cc_basename in
-          cxx*)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-	  *)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-	esac
-	;;
-
-      netbsd*)
-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	  archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-	  wlarc=
-	  hardcode_libdir_flag_spec_CXX='-R$libdir'
-	  hardcode_direct_CXX=yes
-	  hardcode_shlibpath_var_CXX=no
-	fi
-	# Workaround some broken pre-1.5 toolchains
-	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-	;;
-
-      *nto* | *qnx*)
-        ld_shlibs_CXX=yes
-	;;
-
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	ld_shlibs_CXX=no
-	;;
-
-      openbsd*)
-	if test -f /usr/libexec/ld.so; then
-	  hardcode_direct_CXX=yes
-	  hardcode_shlibpath_var_CXX=no
-	  hardcode_direct_absolute_CXX=yes
-	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    export_dynamic_flag_spec_CXX='${wl}-E'
-	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-	  fi
-	  output_verbose_link_cmd=func_echo_all
-	else
-	  ld_shlibs_CXX=no
-	fi
-	;;
-
-      osf3* | osf4* | osf5*)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    hardcode_libdir_separator_CXX=:
-
-	    # Archives containing C++ object files must be created using
-	    # the KAI C++ compiler.
-	    case $host in
-	      osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
-	      *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
-	    esac
-	    ;;
-          RCC*)
-	    # Rational C++ 2.4.1
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          cxx*)
-	    case $host in
-	      osf3*)
-	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-		;;
-	      *)
-	        allow_undefined_flag_CXX=' -expect_unresolved \*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
-	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-		;;
-	    esac
-
-	    hardcode_libdir_separator_CXX=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-	    ;;
-	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	      case $host in
-	        osf3*)
-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	        *)
-	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	      esac
-
-	      hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	      hardcode_libdir_separator_CXX=:
-
-	      # Commands to make compiler produce verbose output that lists
-	      # what "hidden" libraries, object files and flags are used when
-	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
-	    else
-	      # FIXME: insert proper C++ library support
-	      ld_shlibs_CXX=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      psos*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-
-      sunos4*)
-        case $cc_basename in
-          CC*)
-	    # Sun C++ 4.x
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          lcc*)
-	    # Lucid
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-        esac
-        ;;
-
-      solaris*)
-        case $cc_basename in
-          CC* | sunCC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-            archive_cmds_need_lc_CXX=yes
-	    no_undefined_flag_CXX=' -zdefs'
-	    archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	    hardcode_libdir_flag_spec_CXX='-R$libdir'
-	    hardcode_shlibpath_var_CXX=no
-	    case $host_os in
-	      solaris2.[0-5] | solaris2.[0-5].*) ;;
-	      *)
-		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
-	        # Supported since Solaris 2.6 (maybe 2.5.1?)
-		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
-	        ;;
-	    esac
-	    link_all_deplibs_CXX=yes
-
-	    output_verbose_link_cmd='func_echo_all'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-	    ;;
-          gcx*)
-	    # Green Hills C++ Compiler
-	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-	    # The C++ compiler must be used to create the archive.
-	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
-	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	        # platform.
-	        archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-	      fi
-
-	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
-	      case $host_os in
-		solaris2.[0-5] | solaris2.[0-5].*) ;;
-		*)
-		  whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-		  ;;
-	      esac
-	    fi
-	    ;;
-        esac
-        ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag_CXX='${wl}-z,text'
-      archive_cmds_need_lc_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      runpath_var='LD_RUN_PATH'
-
-      case $cc_basename in
-        CC*)
-	  archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-      esac
-      ;;
-
-      sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
-	# link with -lc, and that would cause any symbols used from libc to
-	# always be unresolved, which means just about no library would
-	# ever link correctly.  If we're not using GNU ld we use -z text
-	# though, which does catch some bad symbols but isn't as heavy-handed
-	# as -z defs.
-	no_undefined_flag_CXX='${wl}-z,text'
-	allow_undefined_flag_CXX='${wl}-z,nodefs'
-	archive_cmds_need_lc_CXX=no
-	hardcode_shlibpath_var_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
-	hardcode_libdir_separator_CXX=':'
-	link_all_deplibs_CXX=yes
-	export_dynamic_flag_spec_CXX='${wl}-Bexport'
-	runpath_var='LD_RUN_PATH'
-
-	case $cc_basename in
-          CC*)
-	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
-	      '"$old_archive_cmds_CXX"
-	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
-	      '"$reload_cmds_CXX"
-	    ;;
-	  *)
-	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    ;;
-	esac
-      ;;
-
-      tandem*)
-        case $cc_basename in
-          NCC*)
-	    # NonStop-UX NCC 3.20
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-        esac
-        ;;
-
-      vxworks*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-
-      *)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-    esac
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-    test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-    GCC_CXX="$GXX"
-    LD_CXX="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    # Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-_LT_EOF
-
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
-	 prev=$p
-	 continue
-       fi
-
-       # Expand the sysroot to ease extracting the directories later.
-       if test -z "$prev"; then
-         case $p in
-         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
-         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
-         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
-         esac
-       fi
-       case $p in
-       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
-       esac
-       if test "$pre_test_object_deps_done" = no; then
-	 case ${prev} in
-	 -L | -R)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$compiler_lib_search_path_CXX"; then
-	     compiler_lib_search_path_CXX="${prev}${p}"
-	   else
-	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$postdeps_CXX"; then
-	   postdeps_CXX="${prev}${p}"
-	 else
-	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
-	 fi
-       fi
-       prev=
-       ;;
-
-    *.lto.$objext) ;; # Ignore GCC LTO objects
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$predep_objects_CXX"; then
-	   predep_objects_CXX="$p"
-	 else
-	   predep_objects_CXX="$predep_objects_CXX $p"
-	 fi
-       else
-	 if test -z "$postdep_objects_CXX"; then
-	   postdep_objects_CXX="$p"
-	 else
-	   postdep_objects_CXX="$postdep_objects_CXX $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix[3-9]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  predep_objects_CXX=
-  postdep_objects_CXX=
-  postdeps_CXX=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
- compiler_lib_search_dirs_CXX=
-if test -n "${compiler_lib_search_path_CXX}"; then
- compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    lt_prog_compiler_wl_CXX='-Wl,'
-    lt_prog_compiler_static_CXX='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_CXX='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            lt_prog_compiler_pic_CXX='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_CXX='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      lt_prog_compiler_pic_CXX=
-      ;;
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      lt_prog_compiler_static_CXX=
-      ;;
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_CXX=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	;;
-      *)
-	lt_prog_compiler_pic_CXX='-fPIC'
-	;;
-      esac
-      ;;
-    *qnx* | *nto*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic_CXX='-fPIC -shared'
-      ;;
-    *)
-      lt_prog_compiler_pic_CXX='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[4-9]*)
-	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
-	  # AIX 5 now supports IA64 processor
-	  lt_prog_compiler_static_CXX='-Bstatic'
-	else
-	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-      mingw* | cygwin* | os2* | pw32* | cegcc*)
-	# This hack is so that the source file can tell whether it is being
-	# built for inclusion in a dll (and should export symbols for example).
-	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
-	;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
-	      lt_prog_compiler_pic_CXX='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      lt_prog_compiler_pic_CXX='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    lt_prog_compiler_wl_CXX='--backend -Wl,'
-	    lt_prog_compiler_pic_CXX='-fPIC'
-	    ;;
-	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-static'
-	    ;;
-	  icpc* )
-	    # Intel C++, used to be incompatible with GCC.
-	    # ICC 10 doesn't accept -KPIC any more.
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-fPIC'
-	    lt_prog_compiler_static_CXX='-static'
-	    ;;
-	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-fpic'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    lt_prog_compiler_pic_CXX=
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    ;;
-	  xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
-	    # IBM XL 8.0, 9.0 on PPC and BlueGene
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-qpic'
-	    lt_prog_compiler_static_CXX='-qstaticlink'
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      lt_prog_compiler_pic_CXX='-KPIC'
-	      lt_prog_compiler_static_CXX='-Bstatic'
-	      lt_prog_compiler_wl_CXX='-Qoption ld '
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    lt_prog_compiler_pic_CXX='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd*)
-	;;
-      *qnx* | *nto*)
-        # QNX uses GNU C++, but need to define -shared option too, otherwise
-        # it will coredump.
-        lt_prog_compiler_pic_CXX='-fPIC -shared'
-        ;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    lt_prog_compiler_wl_CXX='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    lt_prog_compiler_pic_CXX=
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC* | sunCC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    lt_prog_compiler_wl_CXX='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    lt_prog_compiler_pic_CXX='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    lt_prog_compiler_pic_CXX='-pic'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	lt_prog_compiler_can_build_shared_CXX=no
-	;;
-    esac
-  fi
-
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_CXX=
-    ;;
-  *)
-    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
-    ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
-lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic_works_CXX=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works_CXX=yes
-     fi
-   fi
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
-    case $lt_prog_compiler_pic_CXX in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
-     esac
-else
-    lt_prog_compiler_pic_CXX=
-     lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_static_works_CXX=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works_CXX=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works_CXX=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
-    :
-else
-    lt_prog_compiler_static_CXX=
-fi
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o_CXX=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_CXX=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o_CXX=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_CXX=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
-  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  case $host_os in
-  aix[4-9]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    export_symbols_cmds_CXX="$ltdll_cmds"
-    ;;
-  cygwin* | mingw* | cegcc*)
-    case $cc_basename in
-    cl*)
-      exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
-      ;;
-    *)
-      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
-      ;;
-    esac
-    ;;
-  *)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-    ;;
-  esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-with_gnu_ld_CXX=$with_gnu_ld
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_CXX=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_CXX in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  $RM conftest*
-	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } 2>conftest.err; then
-	  soname=conftest
-	  lib=conftest
-	  libobjs=conftest.$ac_objext
-	  deplibs=
-	  wl=$lt_prog_compiler_wl_CXX
-	  pic_flag=$lt_prog_compiler_pic_CXX
-	  compiler_flags=-v
-	  linker_flags=-v
-	  verstring=
-	  output_objdir=.
-	  libname=conftest
-	  lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
-	  allow_undefined_flag_CXX=
-	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
-  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-	  then
-	    lt_cv_archive_cmds_need_lc_CXX=no
-	  else
-	    lt_cv_archive_cmds_need_lc_CXX=yes
-	  fi
-	  allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
-	else
-	  cat conftest.err 1>&5
-	fi
-	$RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
-      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$cc_basename in
-  yes,*)
-    # gcc
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
-
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}'
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    dynamic_linker='Win32 ld.exe'
-    ;;
-
-  *,cl*)
-    # Native MSVC
-    libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
-
-    case $build_os in
-    mingw*)
-      sys_lib_search_path_spec=
-      lt_save_ifs=$IFS
-      IFS=';'
-      for lt_path in $LIB
-      do
-        IFS=$lt_save_ifs
-        # Let DOS variable expansion print the short 8.3 style file name.
-        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
-        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-      done
-      IFS=$lt_save_ifs
-      # Convert to MSYS style.
-      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
-      ;;
-    cygwin*)
-      # Convert to unix form, then to dos form, then back to unix form
-      # but this time dos style (no spaces!) so that the unix form looks
-      # like /cygdrive/c/PROGRA~1:/cygdr...
-      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
-      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      ;;
-    *)
-      sys_lib_search_path_spec="$LIB"
-      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      # FIXME: find the short name or the path components, as spaces are
-      # common. (e.g. "Program Files" -> "PROGRA~1")
-      ;;
-    esac
-
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-    dynamic_linker='Win32 link.exe'
-    ;;
-
-  *)
-    # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    dynamic_linker='Win32 ld.exe'
-    ;;
-  esac
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[23].*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2.*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-haiku*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
-  postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
-  ;;
-
-interix[3-9]*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux # correct to gnu/linux during the next big refactor
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-
-  # Some binutils ld are patched to set DT_RUNPATH
-  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_shlibpath_overrides_runpath=no
-    save_LDFLAGS=$LDFLAGS
-    save_libdir=$libdir
-    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
-	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-
-fi
-
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" ||
-   test -n "$runpath_var_CXX" ||
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct_CXX" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_CXX=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_CXX=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_CXX=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink ||
-   test "$inherit_rpath_CXX" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-
-
-
-
-
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
-  ./ | .// | /[cC]/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-	  if test $ac_prog = install &&
-	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # AIX install.  It has an incompatible calling convention.
-	    :
-	  elif test $ac_prog = install &&
-	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # program-specific install script used by HP pwplus--don't use.
-	    :
-	  else
-	    rm -rf conftest.one conftest.two conftest.dir
-	    echo one > conftest.one
-	    echo two > conftest.two
-	    mkdir conftest.dir
-	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
-	      test -s conftest.one && test -s conftest.two &&
-	      test -s conftest.dir/conftest.one &&
-	      test -s conftest.dir/conftest.two
-	    then
-	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	      break 3
-	    fi
-	  fi
-	fi
-      done
-    done
-    ;;
-esac
-
-  done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    INSTALL=$ac_install_sh
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
-	@echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
-  *@@@%%%=?*=@@@%%%*)
-    eval ac_cv_prog_make_${ac_make}_set=yes;;
-  *)
-    eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  SET_MAKE=
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
-set dummy ${ac_tool_prefix}windres; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_WINDRES+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$WINDRES"; then
-  ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-WINDRES=$ac_cv_prog_WINDRES
-if test -n "$WINDRES"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
-$as_echo "$WINDRES" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_WINDRES"; then
-  ac_ct_WINDRES=$WINDRES
-  # Extract the first word of "windres", so it can be a program name with args.
-set dummy windres; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_WINDRES"; then
-  ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_WINDRES="windres"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
-if test -n "$ac_ct_WINDRES"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
-$as_echo "$ac_ct_WINDRES" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_WINDRES" = x; then
-    WINDRES=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    WINDRES=$ac_ct_WINDRES
-  fi
-else
-  WINDRES="$ac_cv_prog_WINDRES"
-fi
-
-
-case "$host" in
-    *-*-mingw32*)
-        # Except on msys, where make can't handle full pathnames (bug 1972)
-        ;;
-    *)
-        srcdir=`cd $srcdir && pwd`
-        ;;
-esac
-
-INCLUDE="-I$srcdir/include"
-if test x$srcdir != x.; then
-    INCLUDE="-Iinclude $INCLUDE"
-elif test -d .hg; then
-    as_fn_error $? "
-*** When building from Mercurial you should configure and build in a
-    separate directory so you don't clobber SDL_config.h, SDL_revision.h
-" "$LINENO" 5
-fi
-BASE_CFLAGS=""
-BASE_LDFLAGS=""
-case "$host" in
-    *-*-cygwin*)
-        # We build SDL on cygwin without the UNIX emulation layer
-        save_CFLAGS="$CFLAGS"
-        have_no_cygwin=no
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -mno-cygwin option" >&5
-$as_echo_n "checking for GCC -mno-cygwin option... " >&6; }
-        CFLAGS="$save_CFLAGS -mno-cygwin"
-
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        have_no_cygwin=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_no_cygwin" >&5
-$as_echo "$have_no_cygwin" >&6; }
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_no_cygwin = xyes; then
-            BASE_CFLAGS="-mno-cygwin"
-            BASE_LDFLAGS="-mno-cygwin"
-        fi
-        BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
-        ;;
-esac
-# Uncomment the following line if you want to force SDL and applications
-# built with it to be compiled for a particular architecture.
-#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
-BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
-# The default optimization for SDL is -O3 (Bug #31)
-if test "x$orig_CFLAGS" = x; then
-    BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
-fi
-EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
-BUILD_LDFLAGS="$LDFLAGS"
-EXTRA_LDFLAGS="$BASE_LDFLAGS"
-## These are common directories to find software packages
-#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
-#    if test -d $path/include; then
-#        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
-#    fi
-#    if test -d $path/lib; then
-#        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
-#    fi
-#done
-SDL_CFLAGS="$BASE_CFLAGS"
-SDL_LIBS="-lSDL2 $BASE_LDFLAGS"
-CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
-CFLAGS="$CFLAGS $EXTRA_CFLAGS"
-LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
-
-base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
-
-find_lib()
-{
-    gcc_bin_path=`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
-    gcc_lib_path=`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
-    env_lib_path=`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`
-    if test "$cross_compiling" = yes; then
-        host_lib_path=""
-    else
-        host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
-    fi
-    for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
-        lib=`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`
-        if test x$lib != x; then
-            echo $lib
-            return
-        fi
-    done
-}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this sort of thing.  */
-  typedef int charset[2];
-  const charset cs = { 0, 0 };
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *pcpcc;
-  char **ppc;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  pcpcc = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++pcpcc;
-  ppc = (char**) pcpcc;
-  pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this sort of thing.  */
-    char tx;
-    char *t = &tx;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-    *t++ = 0;
-    if (s) return 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; } bx;
-    struct s *b = &bx; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-    if (!foo) return 0;
-  }
-  return !cs[0] && !zero.x;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_const=yes
-else
-  ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
-$as_echo_n "checking for working volatile... " >&6; }
-if ${ac_cv_c_volatile+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-volatile int x;
-int * volatile y = (int *) 0;
-return !x && !y;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_volatile=yes
-else
-  ac_cv_c_volatile=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
-$as_echo "$ac_cv_c_volatile" >&6; }
-if test $ac_cv_c_volatile = no; then
-
-$as_echo "#define volatile /**/" >>confdefs.h
-
-fi
-
-
-# Check whether --enable-assertions was given.
-if test "${enable_assertions+set}" = set; then :
-  enableval=$enable_assertions;
-else
-  enable_assertions=auto
-fi
-
-case "$enable_assertions" in
-    auto) # Use optimization settings to determine assertion level
-        ;;
-    disabled)
-
-$as_echo "#define SDL_DEFAULT_ASSERT_LEVEL 0" >>confdefs.h
-
-        ;;
-    release)
-
-$as_echo "#define SDL_DEFAULT_ASSERT_LEVEL 1" >>confdefs.h
-
-        ;;
-    enabled)
-
-$as_echo "#define SDL_DEFAULT_ASSERT_LEVEL 2" >>confdefs.h
-
-        ;;
-    paranoid)
-
-$as_echo "#define SDL_DEFAULT_ASSERT_LEVEL 3" >>confdefs.h
-
-        ;;
-    *)
-        as_fn_error $? "*** unknown assertion level. stop." "$LINENO" 5
-        ;;
-esac
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
-  enableval=$enable_dependency_tracking;
-else
-  enable_dependency_tracking=yes
-fi
-
-if test x$enable_dependency_tracking = xyes; then
-    have_gcc_mmd_mt=no
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -MMD -MT option" >&5
-$as_echo_n "checking for GCC -MMD -MT option... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-    #if !defined(__GNUC__) || __GNUC__ < 3
-    #error Dependency tracking requires GCC 3.0 or newer
-    #endif
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-    have_gcc_mmd_mt=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_mmd_mt" >&5
-$as_echo "$have_gcc_mmd_mt" >&6; }
-
-    if test x$have_gcc_mmd_mt = xyes; then
-        DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
-    fi
-fi
-
-# Actually this doesn't work on OpenBSD and BeOS
-#AC_MSG_CHECKING(for linker option --no-undefined)
-#have_no_undefined=no
-#save_LDFLAGS="$LDFLAGS"
-#LDFLAGS="$LDFLAGS -Wl,--no-undefined"
-#AC_TRY_LINK([
-#],[
-#],[
-#have_no_undefined=yes
-#EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
-#])
-#LDFLAGS="$save_LDFLAGS"
-#AC_MSG_RESULT($have_no_undefined)
-
-# Check whether --enable-libc was given.
-if test "${enable_libc+set}" = set; then :
-  enableval=$enable_libc;
-else
-  enable_libc=yes
-fi
-
-if test x$enable_libc = xyes; then
-
-$as_echo "#define HAVE_LIBC 1" >>confdefs.h
-
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-    for ac_header in sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-        ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for M_PI in math.h" >&5
-$as_echo_n "checking for M_PI in math.h... " >&6; }
-if ${ac_cv_define_M_PI+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <math.h>
-#ifdef M_PI
-YES_IS_DEFINED
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "YES_IS_DEFINED" >/dev/null 2>&1; then :
-  ac_cv_define_M_PI=yes
-else
-  ac_cv_define_M_PI=no
-fi
-rm -f conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_M_PI" >&5
-$as_echo "$ac_cv_define_M_PI" >&6; }
-  if test "$ac_cv_define_M_PI" = "yes" ; then
-
-$as_echo "#define HAVE_M_PI /**/" >>confdefs.h
-
-  fi
-
-
-        case "$host" in
-    *-*-cygwin* | *-*-mingw32*)
-        ;;
-    *)
-        # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments.  Useless!
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
-$as_echo_n "checking for working alloca.h... " >&6; }
-if ${ac_cv_working_alloca_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <alloca.h>
-int
-main ()
-{
-char *p = (char *) alloca (2 * sizeof (int));
-			  if (p) return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_working_alloca_h=yes
-else
-  ac_cv_working_alloca_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
-$as_echo "$ac_cv_working_alloca_h" >&6; }
-if test $ac_cv_working_alloca_h = yes; then
-
-$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if ${ac_cv_func_alloca_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-#  include <malloc.h>
-#  define alloca _alloca
-# else
-#  ifdef HAVE_ALLOCA_H
-#   include <alloca.h>
-#  else
-#   ifdef _AIX
- #pragma alloca
-#   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca (size_t);
-#    endif
-#   endif
-#  endif
-# endif
-#endif
-
-int
-main ()
-{
-char *p = (char *) alloca (1);
-				    if (p) return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_alloca_works=yes
-else
-  ac_cv_func_alloca_works=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
-$as_echo "$ac_cv_func_alloca_works" >&6; }
-
-if test $ac_cv_func_alloca_works = yes; then
-
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
-
-else
-  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble.  Some versions do not even contain alloca or
-# contain a buggy version.  If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
-
-ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
-
-$as_echo "#define C_ALLOCA 1" >>confdefs.h
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if ${ac_cv_os_cray+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then :
-  ac_cv_os_cray=yes
-else
-  ac_cv_os_cray=no
-fi
-rm -f conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
-
-    break
-fi
-
-  done
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if ${ac_cv_c_stack_direction+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_c_stack_direction=0
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-find_stack_direction (int *addr, int depth)
-{
-  int dir, dummy = 0;
-  if (! addr)
-    addr = &dummy;
-  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
-  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
-  return dir + dummy;
-}
-
-int
-main (int argc, char **argv)
-{
-  return find_stack_direction (0, argc + !argv + 20) < 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_stack_direction=1
-else
-  ac_cv_c_stack_direction=-1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
-
-
-fi
-
-        ;;
-    esac
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
-$as_echo_n "checking for working memcmp... " >&6; }
-if ${ac_cv_func_memcmp_working+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_memcmp_working=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-
-  /* Some versions of memcmp are not 8-bit clean.  */
-  char c0 = '\100', c1 = '\200', c2 = '\201';
-  if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
-    return 1;
-
-  /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
-     or more and with at least one buffer not starting on a 4-byte boundary.
-     William Lewis provided this test program.   */
-  {
-    char foo[21];
-    char bar[21];
-    int i;
-    for (i = 0; i < 4; i++)
-      {
-	char *a = foo + i;
-	char *b = bar + i;
-	strcpy (a, "--------01111111");
-	strcpy (b, "--------10000000");
-	if (memcmp (a, b, 16) >= 0)
-	  return 1;
-      }
-    return 0;
-  }
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_memcmp_working=yes
-else
-  ac_cv_func_memcmp_working=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
-$as_echo "$ac_cv_func_memcmp_working" >&6; }
-test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
-  *" memcmp.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
- ;;
-esac
-
-
-    if test x$ac_cv_func_memcmp_working = xyes; then
-
-$as_echo "#define HAVE_MEMCMP 1" >>confdefs.h
-
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
-$as_echo_n "checking for working strtod... " >&6; }
-if ${ac_cv_func_strtod+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_strtod=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-$ac_includes_default
-#ifndef strtod
-double strtod ();
-#endif
-int
-main()
-{
-  {
-    /* Some versions of Linux strtod mis-parse strings with leading '+'.  */
-    char *string = " +69";
-    char *term;
-    double value;
-    value = strtod (string, &term);
-    if (value != 69 || term != (string + 4))
-      return 1;
-  }
-
-  {
-    /* Under Solaris 2.4, strtod returns the wrong value for the
-       terminating character under some conditions.  */
-    char *string = "NaN";
-    char *term;
-    strtod (string, &term);
-    if (term != string && *(term - 1) == 0)
-      return 1;
-  }
-  return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_strtod=yes
-else
-  ac_cv_func_strtod=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5
-$as_echo "$ac_cv_func_strtod" >&6; }
-if test $ac_cv_func_strtod = no; then
-  case " $LIBOBJS " in
-  *" strtod.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS strtod.$ac_objext"
- ;;
-esac
-
-ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
-if test "x$ac_cv_func_pow" = xyes; then :
-
-fi
-
-if test $ac_cv_func_pow = no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
-$as_echo_n "checking for pow in -lm... " >&6; }
-if ${ac_cv_lib_m_pow+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pow ();
-int
-main ()
-{
-return pow ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_m_pow=yes
-else
-  ac_cv_lib_m_pow=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
-$as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = xyes; then :
-  POW_LIB=-lm
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
-$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;}
-fi
-
-fi
-
-fi
-
-    if test x$ac_cv_func_strtod = xyes; then
-
-$as_echo "#define HAVE_STRTOD 1" >>confdefs.h
-
-    fi
-    ac_fn_c_check_func "$LINENO" "mprotect" "ac_cv_func_mprotect"
-if test "x$ac_cv_func_mprotect" = xyes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-          #include <sys/types.h>
-          #include <sys/mman.h>
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-
-$as_echo "#define HAVE_MPROTECT 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-    for ac_func in malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
-$as_echo_n "checking for pow in -lm... " >&6; }
-if ${ac_cv_lib_m_pow+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pow ();
-int
-main ()
-{
-return pow ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_m_pow=yes
-else
-  ac_cv_lib_m_pow=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
-$as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = xyes; then :
-  LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"
-fi
-
-    for ac_func in atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5
-$as_echo_n "checking for iconv_open in -liconv... " >&6; }
-if ${ac_cv_lib_iconv_iconv_open+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-liconv  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char iconv_open ();
-int
-main ()
-{
-return iconv_open ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_iconv_iconv_open=yes
-else
-  ac_cv_lib_iconv_iconv_open=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5
-$as_echo "$ac_cv_lib_iconv_iconv_open" >&6; }
-if test "x$ac_cv_lib_iconv_iconv_open" = xyes; then :
-  LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"
-fi
-
-    for ac_func in iconv
-do :
-  ac_fn_c_check_func "$LINENO" "iconv" "ac_cv_func_iconv"
-if test "x$ac_cv_func_iconv" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ICONV 1
-_ACEOF
-
-fi
-done
-
-
-    ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h>
-"
-if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes; then :
-  $as_echo "#define HAVE_SA_SIGACTION 1" >>confdefs.h
-
-fi
-
-fi
-
-
-# Check whether --enable-gcc-atomics was given.
-if test "${enable_gcc_atomics+set}" = set; then :
-  enableval=$enable_gcc_atomics;
-else
-  enable_gcc_atomics=yes
-fi
-
-if test x$enable_gcc_atomics = xyes; then
-    have_gcc_atomics=no
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC builtin atomic operations" >&5
-$as_echo_n "checking for GCC builtin atomic operations... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-
-    int a;
-    void *x, *y, *z;
-    __sync_lock_test_and_set(&a, 4);
-    __sync_lock_test_and_set(&x, y);
-    __sync_fetch_and_add(&a, 1);
-    __sync_bool_compare_and_swap(&a, 5, 10);
-    __sync_bool_compare_and_swap(&x, y, z);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-    have_gcc_atomics=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_atomics" >&5
-$as_echo "$have_gcc_atomics" >&6; }
-
-    if test x$have_gcc_atomics = xyes; then
-
-$as_echo "#define HAVE_GCC_ATOMICS 1" >>confdefs.h
-
-    else
-        # See if we have the minimum operation needed for GCC atomics
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-
-        int a;
-        __sync_lock_test_and_set(&a, 1);
-        __sync_lock_release(&a);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-        have_gcc_sync_lock_test_and_set=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-        if test x$have_gcc_sync_lock_test_and_set = xyes; then
-
-$as_echo "#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1" >>confdefs.h
-
-        fi
-    fi
-fi
-
-# Standard C sources
-SOURCES="$SOURCES $srcdir/src/*.c"
-SOURCES="$SOURCES $srcdir/src/atomic/*.c"
-SOURCES="$SOURCES $srcdir/src/audio/*.c"
-SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
-SOURCES="$SOURCES $srcdir/src/events/*.c"
-SOURCES="$SOURCES $srcdir/src/file/*.c"
-SOURCES="$SOURCES $srcdir/src/haptic/*.c"
-SOURCES="$SOURCES $srcdir/src/joystick/*.c"
-SOURCES="$SOURCES $srcdir/src/libm/*.c"
-SOURCES="$SOURCES $srcdir/src/power/*.c"
-#SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
-SOURCES="$SOURCES $srcdir/src/render/*.c"
-SOURCES="$SOURCES $srcdir/src/render/*/*.c"
-SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
-SOURCES="$SOURCES $srcdir/src/thread/*.c"
-SOURCES="$SOURCES $srcdir/src/timer/*.c"
-SOURCES="$SOURCES $srcdir/src/video/*.c"
-
-
-# Check whether --enable-atomic was given.
-if test "${enable_atomic+set}" = set; then :
-  enableval=$enable_atomic;
-else
-  enable_atomic=yes
-fi
-
-if test x$enable_atomic != xyes; then
-
-$as_echo "#define SDL_ATOMIC_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-audio was given.
-if test "${enable_audio+set}" = set; then :
-  enableval=$enable_audio;
-else
-  enable_audio=yes
-fi
-
-if test x$enable_audio != xyes; then
-
-$as_echo "#define SDL_AUDIO_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-video was given.
-if test "${enable_video+set}" = set; then :
-  enableval=$enable_video;
-else
-  enable_video=yes
-fi
-
-if test x$enable_video != xyes; then
-
-$as_echo "#define SDL_VIDEO_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-render was given.
-if test "${enable_render+set}" = set; then :
-  enableval=$enable_render;
-else
-  enable_render=yes
-fi
-
-if test x$enable_render != xyes; then
-
-$as_echo "#define SDL_RENDER_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-events was given.
-if test "${enable_events+set}" = set; then :
-  enableval=$enable_events;
-else
-  enable_events=yes
-fi
-
-if test x$enable_events != xyes; then
-
-$as_echo "#define SDL_EVENTS_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-joystick was given.
-if test "${enable_joystick+set}" = set; then :
-  enableval=$enable_joystick;
-else
-  enable_joystick=yes
-fi
-
-if test x$enable_joystick != xyes; then
-
-$as_echo "#define SDL_JOYSTICK_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-haptic was given.
-if test "${enable_haptic+set}" = set; then :
-  enableval=$enable_haptic;
-else
-  enable_haptic=yes
-fi
-
-if test x$enable_haptic != xyes; then
-
-$as_echo "#define SDL_HAPTIC_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-power was given.
-if test "${enable_power+set}" = set; then :
-  enableval=$enable_power;
-else
-  enable_power=yes
-fi
-
-if test x$enable_power != xyes; then
-
-$as_echo "#define SDL_POWER_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-filesystem was given.
-if test "${enable_filesystem+set}" = set; then :
-  enableval=$enable_filesystem;
-else
-  enable_filesystem=yes
-fi
-
-if test x$enable_filesystem != xyes; then
-
-$as_echo "#define SDL_FILESYSTEM_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-threads was given.
-if test "${enable_threads+set}" = set; then :
-  enableval=$enable_threads;
-else
-  enable_threads=yes
-fi
-
-if test x$enable_threads != xyes; then
-
-$as_echo "#define SDL_THREADS_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-timers was given.
-if test "${enable_timers+set}" = set; then :
-  enableval=$enable_timers;
-else
-  enable_timers=yes
-fi
-
-if test x$enable_timers != xyes; then
-
-$as_echo "#define SDL_TIMERS_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-file was given.
-if test "${enable_file+set}" = set; then :
-  enableval=$enable_file;
-else
-  enable_file=yes
-fi
-
-if test x$enable_file != xyes; then
-
-$as_echo "#define SDL_FILE_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-loadso was given.
-if test "${enable_loadso+set}" = set; then :
-  enableval=$enable_loadso;
-else
-  enable_loadso=yes
-fi
-
-if test x$enable_loadso != xyes; then
-
-$as_echo "#define SDL_LOADSO_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-cpuinfo was given.
-if test "${enable_cpuinfo+set}" = set; then :
-  enableval=$enable_cpuinfo;
-else
-  enable_cpuinfo=yes
-fi
-
-if test x$enable_cpuinfo != xyes; then
-
-$as_echo "#define SDL_CPUINFO_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-atomic was given.
-if test "${enable_atomic+set}" = set; then :
-  enableval=$enable_atomic;
-else
-  enable_atomic=yes
-fi
-
-if test x$enable_atomic != xyes; then
-
-$as_echo "#define SDL_ATOMIC_DISABLED 1" >>confdefs.h
-
-fi
-# Check whether --enable-assembly was given.
-if test "${enable_assembly+set}" = set; then :
-  enableval=$enable_assembly;
-else
-  enable_assembly=yes
-fi
-
-if test x$enable_assembly = xyes; then
-
-$as_echo "#define SDL_ASSEMBLY_ROUTINES 1" >>confdefs.h
-
-
-    # Make sure that we don't generate floating point code that would
-    # cause illegal instruction exceptions on older processors
-    case "$host" in
-        *-*-darwin*)
-            # Don't need to worry about Apple hardware, it's all SSE capable
-            default_ssemath=yes
-            ;;
-        *64-*-*)
-            # x86 64-bit architectures all have SSE instructions
-            default_ssemath=yes
-            ;;
-        *)
-            default_ssemath=no
-            ;;
-    esac
-    # Check whether --enable-ssemath was given.
-if test "${enable_ssemath+set}" = set; then :
-  enableval=$enable_ssemath;
-else
-  enable_ssemath=$default_ssemath
-fi
-
-    if test x$enable_ssemath = xno; then
-        if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
-        fi
-    fi
-
-        # Check whether --enable-mmx was given.
-if test "${enable_mmx+set}" = set; then :
-  enableval=$enable_mmx;
-else
-  enable_mmx=yes
-fi
-
-    if test x$enable_mmx = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_mmx=no
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -mmmx option" >&5
-$as_echo_n "checking for GCC -mmmx option... " >&6; }
-        mmx_CFLAGS="-mmmx"
-        CFLAGS="$save_CFLAGS $mmx_CFLAGS"
-
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-        #ifdef __MINGW32__
-        #include <_mingw.h>
-        #ifdef __MINGW64_VERSION_MAJOR
-        #include <intrin.h>
-        #else
-        #include <mmintrin.h>
-        #endif
-        #else
-        #include <mmintrin.h>
-        #endif
-        #ifndef __MMX__
-        #error Assembler CPP flag not enabled
-        #endif
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        have_gcc_mmx=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_mmx" >&5
-$as_echo "$have_gcc_mmx" >&6; }
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_mmx = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
-        fi
-    fi
-
-    # Check whether --enable-3dnow was given.
-if test "${enable_3dnow+set}" = set; then :
-  enableval=$enable_3dnow;
-else
-  enable_3dnow=yes
-fi
-
-    if test x$enable_3dnow = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_3dnow=no
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -m3dnow option" >&5
-$as_echo_n "checking for GCC -m3dnow option... " >&6; }
-        amd3dnow_CFLAGS="-m3dnow"
-        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
-
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-        #include <mm3dnow.h>
-        #ifndef __3dNOW__
-        #error Assembler CPP flag not enabled
-        #endif
-
-int
-main ()
-{
-
-        void *p = 0;
-        _m_prefetch(p);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-        have_gcc_3dnow=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_3dnow" >&5
-$as_echo "$have_gcc_3dnow" >&6; }
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_3dnow = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
-        fi
-    fi
-
-    # Check whether --enable-sse was given.
-if test "${enable_sse+set}" = set; then :
-  enableval=$enable_sse;
-else
-  enable_sse=yes
-fi
-
-    if test x$enable_sse = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_sse=no
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -msse option" >&5
-$as_echo_n "checking for GCC -msse option... " >&6; }
-        sse_CFLAGS="-msse"
-        CFLAGS="$save_CFLAGS $sse_CFLAGS"
-
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-        #ifdef __MINGW32__
-        #include <_mingw.h>
-        #ifdef __MINGW64_VERSION_MAJOR
-        #include <intrin.h>
-        #else
-        #include <xmmintrin.h>
-        #endif
-        #else
-        #include <xmmintrin.h>
-        #endif
-        #ifndef __SSE__
-        #error Assembler CPP flag not enabled
-        #endif
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        have_gcc_sse=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_sse" >&5
-$as_echo "$have_gcc_sse" >&6; }
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_sse = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
-        fi
-    fi
-
-    # Check whether --enable-sse2 was given.
-if test "${enable_sse2+set}" = set; then :
-  enableval=$enable_sse2;
-else
-  enable_sse2=$default_ssemath
-fi
-
-    if test x$enable_sse2 = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_sse2=no
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -msse2 option" >&5
-$as_echo_n "checking for GCC -msse2 option... " >&6; }
-        sse2_CFLAGS="-msse2"
-        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
-
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-        #ifdef __MINGW32__
-        #include <_mingw.h>
-        #ifdef __MINGW64_VERSION_MAJOR
-        #include <intrin.h>
-        #else
-        #include <emmintrin.h>
-        #endif
-        #else
-        #include <emmintrin.h>
-        #endif
-        #ifndef __SSE2__
-        #error Assembler CPP flag not enabled
-        #endif
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        have_gcc_sse2=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_sse2" >&5
-$as_echo "$have_gcc_sse2" >&6; }
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_sse2 = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
-        fi
-    fi
-
-    # Check whether --enable-altivec was given.
-if test "${enable_altivec+set}" = set; then :
-  enableval=$enable_altivec;
-else
-  enable_altivec=yes
-fi
-
-    if test x$enable_altivec = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_altivec=no
-        have_altivec_h_hdr=no
-        altivec_CFLAGS="-maltivec"
-        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Altivec with GCC altivec.h and -maltivec option" >&5
-$as_echo_n "checking for Altivec with GCC altivec.h and -maltivec option... " >&6; }
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-        #include <altivec.h>
-        vector unsigned int vzero() {
-            return vec_splat_u32(0);
-        }
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        have_gcc_altivec=yes
-        have_altivec_h_hdr=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_altivec" >&5
-$as_echo "$have_gcc_altivec" >&6; }
-
-        if test x$have_gcc_altivec = xno; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Altivec with GCC -maltivec option" >&5
-$as_echo_n "checking for Altivec with GCC -maltivec option... " >&6; }
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-            vector unsigned int vzero() {
-                return vec_splat_u32(0);
-            }
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-            have_gcc_altivec=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_altivec" >&5
-$as_echo "$have_gcc_altivec" >&6; }
-        fi
-
-        if test x$have_gcc_altivec = xno; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Altivec with GCC altivec.h and -faltivec option" >&5
-$as_echo_n "checking for Altivec with GCC altivec.h and -faltivec option... " >&6; }
-            altivec_CFLAGS="-faltivec"
-            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-            #include <altivec.h>
-            vector unsigned int vzero() {
-                return vec_splat_u32(0);
-            }
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-            have_gcc_altivec=yes
-            have_altivec_h_hdr=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_altivec" >&5
-$as_echo "$have_gcc_altivec" >&6; }
-        fi
-
-        if test x$have_gcc_altivec = xno; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Altivec with GCC -faltivec option" >&5
-$as_echo_n "checking for Altivec with GCC -faltivec option... " >&6; }
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-            vector unsigned int vzero() {
-                return vec_splat_u32(0);
-            }
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-            have_gcc_altivec=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_altivec" >&5
-$as_echo "$have_gcc_altivec" >&6; }
-        fi
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_altivec = xyes; then
-
-$as_echo "#define SDL_ALTIVEC_BLITTERS 1" >>confdefs.h
-
-            if test x$have_altivec_h_hdr = xyes; then
-
-$as_echo "#define HAVE_ALTIVEC_H 1" >>confdefs.h
-
-            fi
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
-        fi
-    fi
-fi
-
-CheckOSS()
-{
-    # Check whether --enable-oss was given.
-if test "${enable_oss+set}" = set; then :
-  enableval=$enable_oss;
-else
-  enable_oss=maybe
-fi
-
-
-    # OpenBSD "has" OSS, but it's not really for app use. They want you to
-    #  use sndio instead. So on there, we default to disabled. You can force
-    #  it on if you really want, though.
-    if test x$enable_oss = xmaybe; then
-        enable_oss=yes
-        case "$host" in
-            *-*-openbsd*)
-                enable_oss=no;;
-        esac
-    fi
-
-    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSS audio support" >&5
-$as_echo_n "checking for OSS audio support... " >&6; }
-        have_oss=no
-        if test x$have_oss != xyes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-              #include <sys/soundcard.h>
-
-int
-main ()
-{
-
-              int arg = SNDCTL_DSP_SETFRAGMENT;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-            have_oss=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        fi
-        if test x$have_oss != xyes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-              #include <soundcard.h>
-
-int
-main ()
-{
-
-              int arg = SNDCTL_DSP_SETFRAGMENT;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-            have_oss=yes
-
-$as_echo "#define SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_oss" >&5
-$as_echo "$have_oss" >&6; }
-        if test x$have_oss = xyes; then
-
-$as_echo "#define SDL_AUDIO_DRIVER_OSS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
-            have_audio=yes
-
-            # We may need to link with ossaudio emulation library
-            case "$host" in
-                *-*-openbsd*|*-*-netbsd*)
-                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
-            esac
-        fi
-    fi
-}
-
-CheckALSA()
-{
-    # Check whether --enable-alsa was given.
-if test "${enable_alsa+set}" = set; then :
-  enableval=$enable_alsa;
-else
-  enable_alsa=yes
-fi
-
-    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
-        alsa_save_CFLAGS="$CFLAGS"
-alsa_save_LDFLAGS="$LDFLAGS"
-alsa_save_LIBS="$LIBS"
-alsa_found=yes
-
-
-# Check whether --with-alsa-prefix was given.
-if test "${with_alsa_prefix+set}" = set; then :
-  withval=$with_alsa_prefix; alsa_prefix="$withval"
-else
-  alsa_prefix=""
-fi
-
-
-
-# Check whether --with-alsa-inc-prefix was given.
-if test "${with_alsa_inc_prefix+set}" = set; then :
-  withval=$with_alsa_inc_prefix; alsa_inc_prefix="$withval"
-else
-  alsa_inc_prefix=""
-fi
-
-
-# Check whether --enable-alsatest was given.
-if test "${enable_alsatest+set}" = set; then :
-  enableval=$enable_alsatest; enable_alsatest="$enableval"
-else
-  enable_alsatest=yes
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA CFLAGS" >&5
-$as_echo_n "checking for ALSA CFLAGS... " >&6; }
-if test "$alsa_inc_prefix" != "" ; then
-	ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
-	CFLAGS="$CFLAGS -I$alsa_inc_prefix"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_CFLAGS" >&5
-$as_echo "$ALSA_CFLAGS" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA LDFLAGS" >&5
-$as_echo_n "checking for ALSA LDFLAGS... " >&6; }
-if test "$alsa_prefix" != "" ; then
-	ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
-	LDFLAGS="$LDFLAGS $ALSA_LIBS"
-fi
-
-ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
-LIBS=`echo $LIBS | sed 's/-lm//'`
-LIBS=`echo $LIBS | sed 's/-ldl//'`
-LIBS=`echo $LIBS | sed 's/-lpthread//'`
-LIBS=`echo $LIBS | sed 's/  //'`
-LIBS="$ALSA_LIBS $LIBS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5
-$as_echo "$ALSA_LIBS" >&6; }
-
-min_alsa_version=0.9.0
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libasound headers version >= $min_alsa_version" >&5
-$as_echo_n "checking for libasound headers version >= $min_alsa_version... " >&6; }
-no_alsa=""
-    alsa_min_major_version=`echo $min_alsa_version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
-    alsa_min_minor_version=`echo $min_alsa_version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
-    alsa_min_micro_version=`echo $min_alsa_version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <alsa/asoundlib.h>
-
-int
-main ()
-{
-
-/* ensure backward compatibility */
-#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
-#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
-#endif
-#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
-#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
-#endif
-#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
-#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
-#endif
-
-#  if(SND_LIB_MAJOR > $alsa_min_major_version)
-  exit(0);
-#  else
-#    if(SND_LIB_MAJOR < $alsa_min_major_version)
-#       error not present
-#    endif
-
-#   if(SND_LIB_MINOR > $alsa_min_minor_version)
-  exit(0);
-#   else
-#     if(SND_LIB_MINOR < $alsa_min_minor_version)
-#          error not present
-#      endif
-
-#      if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
-#        error not present
-#      endif
-#    endif
-#  endif
-exit(0);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5
-$as_echo "found." >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not present." >&5
-$as_echo "not present." >&6; }
-
-   alsa_found=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-if test "x$enable_alsatest" = "xyes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_ctl_open in -lasound" >&5
-$as_echo_n "checking for snd_ctl_open in -lasound... " >&6; }
-if ${ac_cv_lib_asound_snd_ctl_open+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lasound  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char snd_ctl_open ();
-int
-main ()
-{
-return snd_ctl_open ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_asound_snd_ctl_open=yes
-else
-  ac_cv_lib_asound_snd_ctl_open=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_ctl_open" >&5
-$as_echo "$ac_cv_lib_asound_snd_ctl_open" >&6; }
-if test "x$ac_cv_lib_asound_snd_ctl_open" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBASOUND 1
-_ACEOF
-
-  LIBS="-lasound $LIBS"
-
-else
-
-	 alsa_found=no
-
-fi
-
-fi
-
-if test "x$alsa_found" = "xyes" ; then
-   have_alsa=yes
-   LIBS=`echo $LIBS | sed 's/-lasound//g'`
-   LIBS=`echo $LIBS | sed 's/  //'`
-   LIBS="-lasound $LIBS"
-fi
-if test "x$alsa_found" = "xno" ; then
-   have_alsa=no
-   CFLAGS="$alsa_save_CFLAGS"
-   LDFLAGS="$alsa_save_LDFLAGS"
-   LIBS="$alsa_save_LIBS"
-   ALSA_CFLAGS=""
-   ALSA_LIBS=""
-fi
-
-
-
-
-        # Restore all flags from before the ALSA detection runs
-        CFLAGS="$alsa_save_CFLAGS"
-        LDFLAGS="$alsa_save_LDFLAGS"
-        LIBS="$alsa_save_LIBS"
-        if test x$have_alsa = xyes; then
-            # Check whether --enable-alsa-shared was given.
-if test "${enable_alsa_shared+set}" = set; then :
-  enableval=$enable_alsa_shared;
-else
-  enable_alsa_shared=yes
-fi
-
-            alsa_lib=`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
-
-
-$as_echo "#define SDL_AUDIO_DRIVER_ALSA 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
-            if test x$have_loadso != xyes && \
-               test x$enable_alsa_shared = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ALSA loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ALSA loading" >&2;}
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
-                echo "-- dynamic libasound -> $alsa_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC "$alsa_lib"
-_ACEOF
-
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
-            fi
-            have_audio=yes
-        fi
-    fi
-}
-
-CheckESD()
-{
-    # Check whether --enable-esd was given.
-if test "${enable_esd+set}" = set; then :
-  enableval=$enable_esd;
-else
-  enable_esd=yes
-fi
-
-    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
-
-# Check whether --with-esd-prefix was given.
-if test "${with_esd_prefix+set}" = set; then :
-  withval=$with_esd_prefix; esd_prefix="$withval"
-else
-  esd_prefix=""
-fi
-
-
-# Check whether --with-esd-exec-prefix was given.
-if test "${with_esd_exec_prefix+set}" = set; then :
-  withval=$with_esd_exec_prefix; esd_exec_prefix="$withval"
-else
-  esd_exec_prefix=""
-fi
-
-# Check whether --enable-esdtest was given.
-if test "${enable_esdtest+set}" = set; then :
-  enableval=$enable_esdtest;
-else
-  enable_esdtest=yes
-fi
-
-
-  if test x$esd_exec_prefix != x ; then
-     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
-     if test x${ESD_CONFIG+set} != xset ; then
-        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
-     fi
-  fi
-  if test x$esd_prefix != x ; then
-     esd_args="$esd_args --prefix=$esd_prefix"
-     if test x${ESD_CONFIG+set} != xset ; then
-        ESD_CONFIG=$esd_prefix/bin/esd-config
-     fi
-  fi
-
-  # Extract the first word of "esd-config", so it can be a program name with args.
-set dummy esd-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ESD_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ESD_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ESD_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_ESD_CONFIG" && ac_cv_path_ESD_CONFIG="no"
-  ;;
-esac
-fi
-ESD_CONFIG=$ac_cv_path_ESD_CONFIG
-if test -n "$ESD_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ESD_CONFIG" >&5
-$as_echo "$ESD_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  min_esd_version=0.2.8
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ESD - version >= $min_esd_version" >&5
-$as_echo_n "checking for ESD - version >= $min_esd_version... " >&6; }
-  no_esd=""
-  if test "$ESD_CONFIG" = "no" ; then
-    no_esd=yes
-  else
-    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
-    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
-
-    esd_major_version=`$ESD_CONFIG $esd_args --version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
-    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
-    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
-    if test "x$enable_esdtest" = "xyes" ; then
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $ESD_CFLAGS"
-      LIBS="$LIBS $ESD_LIBS"
-      rm -f conf.esdtest
-      if test "$cross_compiling" = yes; then :
-  echo $ac_n "cross compiling; assumed OK... $ac_c"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <esd.h>
-
-char*
-my_strdup (char *str)
-{
-  char *new_str;
-
-  if (str)
-    {
-      new_str = malloc ((strlen (str) + 1) * sizeof(char));
-      strcpy (new_str, str);
-    }
-  else
-    new_str = NULL;
-
-  return new_str;
-}
-
-int main ()
-{
-  int major, minor, micro;
-  char *tmp_version;
-
-  system ("touch conf.esdtest");
-
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = my_strdup("$min_esd_version");
-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string\n", "$min_esd_version");
-     exit(1);
-   }
-
-   if (($esd_major_version > major) ||
-      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
-      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
-    {
-      return 0;
-    }
-  else
-    {
-      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
-      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
-      printf("*** best to upgrade to the required version.\n");
-      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
-      printf("*** to point to the correct copy of esd-config, and remove the file\n");
-      printf("*** config.cache before re-running configure\n");
-      return 1;
-    }
-}
-
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  no_esd=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-  if test "x$no_esd" = x ; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-     have_esd=yes
-  else
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-     if test "$ESD_CONFIG" = "no" ; then
-       echo "*** The esd-config script installed by ESD could not be found"
-       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the ESD_CONFIG environment variable to the"
-       echo "*** full path to esd-config."
-     else
-       if test -f conf.esdtest ; then
-        :
-       else
-          echo "*** Could not run ESD test program, checking why..."
-          CFLAGS="$CFLAGS $ESD_CFLAGS"
-          LIBS="$LIBS $ESD_LIBS"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdio.h>
-#include <esd.h>
-
-int
-main ()
-{
- return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-   echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding ESD or finding the wrong"
-          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-	  echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-else
-   echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
-          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
-          echo "*** may want to edit the esd-config script: $ESD_CONFIG"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-          CFLAGS="$ac_save_CFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     ESD_CFLAGS=""
-     ESD_LIBS=""
-     have_esd=no
-  fi
-
-
-  rm -f conf.esdtest
-
-        if test x$have_esd = xyes; then
-            # Check whether --enable-esd-shared was given.
-if test "${enable_esd_shared+set}" = set; then :
-  enableval=$enable_esd_shared;
-else
-  enable_esd_shared=yes
-fi
-
-            esd_lib=`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
-
-
-$as_echo "#define SDL_AUDIO_DRIVER_ESD 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
-            if test x$have_loadso != xyes && \
-               test x$enable_esd_shared = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ESD loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ESD loading" >&2;}
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
-                echo "-- dynamic libesd -> $esd_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_AUDIO_DRIVER_ESD_DYNAMIC "$esd_lib"
-_ACEOF
-
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
-            fi
-            have_audio=yes
-        fi
-    fi
-}
-
-CheckPulseAudio()
-{
-    # Check whether --enable-pulseaudio was given.
-if test "${enable_pulseaudio+set}" = set; then :
-  enableval=$enable_pulseaudio;
-else
-  enable_pulseaudio=yes
-fi
-
-    if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
-        audio_pulseaudio=no
-
-        PULSEAUDIO_REQUIRED_VERSION=0.9
-
-        # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support" >&5
-$as_echo_n "checking for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support... " >&6; }
-        if test x$PKG_CONFIG != xno; then
-        if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
-                PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
-                PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
-                audio_pulseaudio=yes
-            fi
-        fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $audio_pulseaudio" >&5
-$as_echo "$audio_pulseaudio" >&6; }
-
-        if test x$audio_pulseaudio = xyes; then
-            # Check whether --enable-pulseaudio-shared was given.
-if test "${enable_pulseaudio_shared+set}" = set; then :
-  enableval=$enable_pulseaudio_shared;
-else
-  enable_pulseaudio_shared=yes
-fi
-
-            pulseaudio_lib=`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
-
-
-$as_echo "#define SDL_AUDIO_DRIVER_PULSEAUDIO 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
-            if test x$have_loadso != xyes && \
-               test x$enable_pulseaudio_shared = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic PulseAudio loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic PulseAudio loading" >&2;}
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
-                echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "$pulseaudio_lib"
-_ACEOF
-
-
-                case "$host" in
-                    # On Solaris, pulseaudio must be linked deferred explicitly
-                    # to prevent undefined symbol failures.
-                    *-*-solaris*)
-                        PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
-                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
-                esac
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
-            fi
-            have_audio=yes
-        fi
-    fi
-}
-
-CheckARTSC()
-{
-    # Check whether --enable-arts was given.
-if test "${enable_arts+set}" = set; then :
-  enableval=$enable_arts;
-else
-  enable_arts=yes
-fi
-
-    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
-        # Extract the first word of "artsc-config", so it can be a program name with args.
-set dummy artsc-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ARTSCONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ARTSCONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ARTSCONFIG="$ARTSCONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ARTSCONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ARTSCONFIG=$ac_cv_path_ARTSCONFIG
-if test -n "$ARTSCONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ARTSCONFIG" >&5
-$as_echo "$ARTSCONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-        if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
-            : # arts isn't installed
-        else
-            ARTS_CFLAGS=`$ARTSCONFIG --cflags`
-            ARTS_LIBS=`$ARTSCONFIG --libs`
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aRts development environment" >&5
-$as_echo_n "checking for aRts development environment... " >&6; }
-            audio_arts=no
-            save_CFLAGS="$CFLAGS"
-            CFLAGS="$CFLAGS $ARTS_CFLAGS"
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-             #include <artsc.h>
-
-int
-main ()
-{
-
-             arts_stream_t stream;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-            audio_arts=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            CFLAGS="$save_CFLAGS"
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $audio_arts" >&5
-$as_echo "$audio_arts" >&6; }
-            if test x$audio_arts = xyes; then
-                # Check whether --enable-arts-shared was given.
-if test "${enable_arts_shared+set}" = set; then :
-  enableval=$enable_arts_shared;
-else
-  enable_arts_shared=yes
-fi
-
-                arts_lib=`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
-
-
-$as_echo "#define SDL_AUDIO_DRIVER_ARTS 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
-                EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
-                if test x$have_loadso != xyes && \
-                   test x$enable_arts_shared = xyes; then
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ARTS loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ARTS loading" >&2;}
-                fi
-                if test x$have_loadso = xyes && \
-                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
-                    echo "-- dynamic libartsc -> $arts_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_AUDIO_DRIVER_ARTS_DYNAMIC "$arts_lib"
-_ACEOF
-
-                else
-                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
-                fi
-                have_audio=yes
-            fi
-        fi
-    fi
-}
-
-CheckNAS()
-{
-    # Check whether --enable-nas was given.
-if test "${enable_nas+set}" = set; then :
-  enableval=$enable_nas;
-else
-  enable_nas=yes
-fi
-
-    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
-        ac_fn_c_check_header_mongrel "$LINENO" "audio/audiolib.h" "ac_cv_header_audio_audiolib_h" "$ac_includes_default"
-if test "x$ac_cv_header_audio_audiolib_h" = xyes; then :
-  have_nas_hdr=yes
-fi
-
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AuOpenServer in -laudio" >&5
-$as_echo_n "checking for AuOpenServer in -laudio... " >&6; }
-if ${ac_cv_lib_audio_AuOpenServer+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-laudio  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char AuOpenServer ();
-int
-main ()
-{
-return AuOpenServer ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_audio_AuOpenServer=yes
-else
-  ac_cv_lib_audio_AuOpenServer=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_audio_AuOpenServer" >&5
-$as_echo "$ac_cv_lib_audio_AuOpenServer" >&6; }
-if test "x$ac_cv_lib_audio_AuOpenServer" = xyes; then :
-  have_nas_lib=yes
-fi
-
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NAS audio support" >&5
-$as_echo_n "checking for NAS audio support... " >&6; }
-        have_nas=no
-
-        if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
-            have_nas=yes
-            NAS_LIBS="-laudio"
-
-        elif test -r /usr/X11R6/include/audio/audiolib.h; then
-            have_nas=yes
-            NAS_CFLAGS="-I/usr/X11R6/include/"
-            NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
-
-        fi
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_nas" >&5
-$as_echo "$have_nas" >&6; }
-
-        if test x$have_nas = xyes; then
-            # Check whether --enable-nas-shared was given.
-if test "${enable_nas_shared+set}" = set; then :
-  enableval=$enable_nas_shared;
-else
-  enable_nas_shared=yes
-fi
-
-            nas_lib=`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
-
-            if test x$have_loadso != xyes && \
-               test x$enable_nas_shared = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic NAS loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic NAS loading" >&2;}
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_nas_shared = xyes && test x$nas_lib != x; then
-                echo "-- dynamic libaudio -> $nas_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_AUDIO_DRIVER_NAS_DYNAMIC "$nas_lib"
-_ACEOF
-
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
-            fi
-
-
-$as_echo "#define SDL_AUDIO_DRIVER_NAS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
-            have_audio=yes
-        fi
-    fi
-}
-
-CheckSNDIO()
-{
-    # Check whether --enable-sndio was given.
-if test "${enable_sndio+set}" = set; then :
-  enableval=$enable_sndio;
-else
-  enable_sndio=yes
-fi
-
-    if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
-        ac_fn_c_check_header_mongrel "$LINENO" "sndio.h" "ac_cv_header_sndio_h" "$ac_includes_default"
-if test "x$ac_cv_header_sndio_h" = xyes; then :
-  have_sndio_hdr=yes
-fi
-
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sio_open in -lsndio" >&5
-$as_echo_n "checking for sio_open in -lsndio... " >&6; }
-if ${ac_cv_lib_sndio_sio_open+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsndio  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char sio_open ();
-int
-main ()
-{
-return sio_open ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_sndio_sio_open=yes
-else
-  ac_cv_lib_sndio_sio_open=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sndio_sio_open" >&5
-$as_echo "$ac_cv_lib_sndio_sio_open" >&6; }
-if test "x$ac_cv_lib_sndio_sio_open" = xyes; then :
-  have_sndio_lib=yes
-fi
-
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sndio audio support" >&5
-$as_echo_n "checking for sndio audio support... " >&6; }
-        have_sndio=no
-
-        if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
-            have_sndio=yes
-            SNDIO_LIBS="-lsndio"
-        fi
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sndio" >&5
-$as_echo "$have_sndio" >&6; }
-
-        if test x$have_sndio = xyes; then
-            # Check whether --enable-sndio-shared was given.
-if test "${enable_sndio_shared+set}" = set; then :
-  enableval=$enable_sndio_shared;
-else
-  enable_sndio_shared=yes
-fi
-
-            sndio_lib=`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
-
-            if test x$have_loadso != xyes && \
-               test x$enable_sndio_shared = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&2;}
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
-                echo "-- dynamic libsndio -> $sndio_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "$sndio_lib"
-_ACEOF
-
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
-            fi
-
-
-$as_echo "#define SDL_AUDIO_DRIVER_SNDIO 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
-            have_audio=yes
-        fi
-    fi
-}
-
-CheckDiskAudio()
-{
-    # Check whether --enable-diskaudio was given.
-if test "${enable_diskaudio+set}" = set; then :
-  enableval=$enable_diskaudio;
-else
-  enable_diskaudio=yes
-fi
-
-    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
-
-$as_echo "#define SDL_AUDIO_DRIVER_DISK 1" >>confdefs.h
-
-        SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
-    fi
-}
-
-CheckDummyAudio()
-{
-    # Check whether --enable-dummyaudio was given.
-if test "${enable_dummyaudio+set}" = set; then :
-  enableval=$enable_dummyaudio;
-else
-  enable_dummyaudio=yes
-fi
-
-    if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
-
-$as_echo "#define SDL_AUDIO_DRIVER_DUMMY 1" >>confdefs.h
-
-        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
-    fi
-}
-
-CheckVisibilityHidden()
-{
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -fvisibility=hidden option" >&5
-$as_echo_n "checking for GCC -fvisibility=hidden option... " >&6; }
-    have_gcc_fvisibility=no
-
-    visibility_CFLAGS="-fvisibility=hidden"
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-    #if !defined(__GNUC__) || __GNUC__ < 4
-    #error SDL only uses visibility attributes in GCC 4 or newer
-    #endif
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-    have_gcc_fvisibility=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_fvisibility" >&5
-$as_echo "$have_gcc_fvisibility" >&6; }
-    CFLAGS="$save_CFLAGS"
-
-    if test x$have_gcc_fvisibility = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
-    fi
-}
-
-CheckStackBoundary()
-{
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -mpreferred-stack-boundary option" >&5
-$as_echo_n "checking for GCC -mpreferred-stack-boundary option... " >&6; }
-    have_gcc_preferred_stack_boundary=no
-
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-    int x = 0;
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-    have_gcc_preferred_stack_boundary=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_preferred_stack_boundary" >&5
-$as_echo "$have_gcc_preferred_stack_boundary" >&6; }
-    CFLAGS="$save_CFLAGS"
-
-    if test x$have_gcc_preferred_stack_boundary = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
-    fi
-}
-
-
-CheckWarnAll()
-{
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -Wall option" >&5
-$as_echo_n "checking for GCC -Wall option... " >&6; }
-    have_gcc_Wall=no
-
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$save_CFLAGS -Wall"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-    int x = 0;
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-    have_gcc_Wall=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_Wall" >&5
-$as_echo "$have_gcc_Wall" >&6; }
-    CFLAGS="$save_CFLAGS"
-
-    if test x$have_gcc_Wall = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
-
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for necessary GCC -Wno-multichar option" >&5
-$as_echo_n "checking for necessary GCC -Wno-multichar option... " >&6; }
-        need_gcc_Wno_multichar=no
-        case "$host" in
-            *-*-beos* | *-*-haiku*)
-                need_gcc_Wno_multichar=yes
-                ;;
-        esac
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $need_gcc_Wno_multichar" >&5
-$as_echo "$need_gcc_Wno_multichar" >&6; }
-        if test x$need_gcc_Wno_multichar = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
-        fi
-    fi
-}
-
-
-CheckX11()
-{
-
-
-    # Check whether --enable-video-x11 was given.
-if test "${enable_video_x11+set}" = set; then :
-  enableval=$enable_video_x11;
-else
-  enable_video_x11=yes
-fi
-
-    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
-        case "$host" in
-            *-*-darwin*)
-                # This isn't necessary for X11, but fixes GLX detection
-                if test "x$x_includes" = xNONE && \
-                   test "x$x_libraries" = xNONE && \
-                   test -d /usr/X11R6/include && \
-                   test -d /usr/X11R6/lib; then
-                    x_includes="/usr/X11R6/include"
-                    x_libraries="/usr/X11R6/lib"
-                fi
-                ;;
-        esac
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
-$as_echo_n "checking for X... " >&6; }
-
-
-# Check whether --with-x was given.
-if test "${with_x+set}" = set; then :
-  withval=$with_x;
-fi
-
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
-  # The user explicitly disabled X.
-  have_x=disabled
-else
-  case $x_includes,$x_libraries in #(
-    *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
-    *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=no ac_x_libraries=no
-rm -f -r conftest.dir
-if mkdir conftest.dir; then
-  cd conftest.dir
-  cat >Imakefile <<'_ACEOF'
-incroot:
-	@echo incroot='${INCROOT}'
-usrlibdir:
-	@echo usrlibdir='${USRLIBDIR}'
-libdir:
-	@echo libdir='${LIBDIR}'
-_ACEOF
-  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-    for ac_var in incroot usrlibdir libdir; do
-      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
-    done
-    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl dylib la dll; do
-      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
-	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
-	ac_im_usrlibdir=$ac_im_libdir; break
-      fi
-    done
-    # Screen out bogus values from the imake configuration.  They are
-    # bogus both because they are the default anyway, and because
-    # using them would break gcc on systems where it needs fixed includes.
-    case $ac_im_incroot in
-	/usr/include) ac_x_includes= ;;
-	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
-    esac
-    case $ac_im_usrlibdir in
-	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
-	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
-    esac
-  fi
-  cd ..
-  rm -f -r conftest.dir
-fi
-
-# Standard set of common directories for X headers.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-ac_x_header_dirs='
-/usr/X11/include
-/usr/X11R7/include
-/usr/X11R6/include
-/usr/X11R5/include
-/usr/X11R4/include
-
-/usr/include/X11
-/usr/include/X11R7
-/usr/include/X11R6
-/usr/include/X11R5
-/usr/include/X11R4
-
-/usr/local/X11/include
-/usr/local/X11R7/include
-/usr/local/X11R6/include
-/usr/local/X11R5/include
-/usr/local/X11R4/include
-
-/usr/local/include/X11
-/usr/local/include/X11R7
-/usr/local/include/X11R6
-/usr/local/include/X11R5
-/usr/local/include/X11R4
-
-/usr/X386/include
-/usr/x386/include
-/usr/XFree86/include/X11
-
-/usr/include
-/usr/local/include
-/usr/unsupported/include
-/usr/athena/include
-/usr/local/x11r5/include
-/usr/lpp/Xamples/include
-
-/usr/openwin/include
-/usr/openwin/share/include'
-
-if test "$ac_x_includes" = no; then
-  # Guess where to find include files, by looking for Xlib.h.
-  # First, try using that file with no special directory specified.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
-  for ac_dir in $ac_x_header_dirs; do
-  if test -r "$ac_dir/X11/Xlib.h"; then
-    ac_x_includes=$ac_dir
-    break
-  fi
-done
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-fi # $ac_x_includes = no
-
-if test "$ac_x_libraries" = no; then
-  # Check for the libraries.
-  # See if we find them without any special options.
-  # Don't add to $LIBS permanently.
-  ac_save_LIBS=$LIBS
-  LIBS="-lX11 $LIBS"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-int
-main ()
-{
-XrmInitialize ()
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  LIBS=$ac_save_LIBS
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
-  LIBS=$ac_save_LIBS
-for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
-do
-  # Don't even attempt the hair of trying to link an X program!
-  for ac_extension in a so sl dylib la dll; do
-    if test -r "$ac_dir/libX11.$ac_extension"; then
-      ac_x_libraries=$ac_dir
-      break 2
-    fi
-  done
-done
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi # $ac_x_libraries = no
-
-case $ac_x_includes,$ac_x_libraries in #(
-  no,* | *,no | *\'*)
-    # Didn't find X, or a directory has "'" in its name.
-    ac_cv_have_x="have_x=no";; #(
-  *)
-    # Record where we found X for the cache.
-    ac_cv_have_x="have_x=yes\
-	ac_x_includes='$ac_x_includes'\
-	ac_x_libraries='$ac_x_libraries'"
-esac
-fi
-;; #(
-    *) have_x=yes;;
-  esac
-  eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
-$as_echo "$have_x" >&6; }
-  no_x=yes
-else
-  # If each of the values was on the command line, it overrides each guess.
-  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
-  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
-  # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes\
-	ac_x_includes='$x_includes'\
-	ac_x_libraries='$x_libraries'"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
-$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
-fi
-
-        if test "$no_x" = yes; then
-  # Not all programs may use this symbol, but it does not hurt to define it.
-
-$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
-
-  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
-else
-  if test -n "$x_includes"; then
-    X_CFLAGS="$X_CFLAGS -I$x_includes"
-  fi
-
-  # It would also be nice to do this for all -L options, not just this one.
-  if test -n "$x_libraries"; then
-    X_LIBS="$X_LIBS -L$x_libraries"
-    # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space.  Words are not sufficient . . . .
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
-$as_echo_n "checking whether -R must be followed by a space... " >&6; }
-    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
-    ac_xsave_c_werror_flag=$ac_c_werror_flag
-    ac_c_werror_flag=yes
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       X_LIBS="$X_LIBS -R$x_libraries"
-else
-  LIBS="$ac_xsave_LIBS -R $x_libraries"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	  X_LIBS="$X_LIBS -R $x_libraries"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
-$as_echo "neither works" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    ac_c_werror_flag=$ac_xsave_c_werror_flag
-    LIBS=$ac_xsave_LIBS
-  fi
-
-  # Check for system-dependent libraries X programs must link with.
-  # Do this before checking for the system-independent R6 libraries
-  # (-lICE), since we may need -lsocket or whatever for X linking.
-
-  if test "$ISC" = yes; then
-    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
-  else
-    # Martyn Johnson says this is needed for Ultrix, if the X
-    # libraries were built with DECnet support.  And Karl Berry says
-    # the Alpha needs dnet_stub (dnet does not exist).
-    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XOpenDisplay ();
-int
-main ()
-{
-return XOpenDisplay ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
-if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dnet_dnet_ntoa=yes
-else
-  ac_cv_lib_dnet_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
-fi
-
-    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
-if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet_stub  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dnet_stub_dnet_ntoa=yes
-else
-  ac_cv_lib_dnet_stub_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
-fi
-
-    fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LIBS="$ac_xsave_LIBS"
-
-    # msh at cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
-    # to get the SysV transport functions.
-    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
-    # needs -lnsl.
-    # The nsl library prevents programs from opening the X display
-    # on Irix 5.2, according to T.E. Dickey.
-    # The functions gethostbyname, getservbyname, and inet_addr are
-    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
-    ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes; then :
-
-fi
-
-    if test $ac_cv_func_gethostbyname = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_nsl_gethostbyname=yes
-else
-  ac_cv_lib_nsl_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
-fi
-
-      if test $ac_cv_lib_nsl_gethostbyname = no; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
-$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
-if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_bsd_gethostbyname=yes
-else
-  ac_cv_lib_bsd_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
-$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
-if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
-fi
-
-      fi
-    fi
-
-    # lieder at skyler.mavd.honeywell.com says without -lsocket,
-    # socket/setsockopt and other routines are undefined under SCO ODT
-    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
-    # on later versions), says Simon Leinen: it contains gethostby*
-    # variants that don't use the name server (or something).  -lsocket
-    # must be given before -lnsl if both are needed.  We assume that
-    # if connect needs -lnsl, so does gethostbyname.
-    ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
-if test "x$ac_cv_func_connect" = xyes; then :
-
-fi
-
-    if test $ac_cv_func_connect = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
-$as_echo_n "checking for connect in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_connect+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char connect ();
-int
-main ()
-{
-return connect ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_socket_connect=yes
-else
-  ac_cv_lib_socket_connect=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
-$as_echo "$ac_cv_lib_socket_connect" >&6; }
-if test "x$ac_cv_lib_socket_connect" = xyes; then :
-  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
-fi
-
-    fi
-
-    # Guillermo Gomez says -lposix is necessary on A/UX.
-    ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove"
-if test "x$ac_cv_func_remove" = xyes; then :
-
-fi
-
-    if test $ac_cv_func_remove = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
-$as_echo_n "checking for remove in -lposix... " >&6; }
-if ${ac_cv_lib_posix_remove+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lposix  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char remove ();
-int
-main ()
-{
-return remove ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_posix_remove=yes
-else
-  ac_cv_lib_posix_remove=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
-$as_echo "$ac_cv_lib_posix_remove" >&6; }
-if test "x$ac_cv_lib_posix_remove" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
-fi
-
-    fi
-
-    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
-if test "x$ac_cv_func_shmat" = xyes; then :
-
-fi
-
-    if test $ac_cv_func_shmat = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
-$as_echo_n "checking for shmat in -lipc... " >&6; }
-if ${ac_cv_lib_ipc_shmat+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lipc  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shmat ();
-int
-main ()
-{
-return shmat ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ipc_shmat=yes
-else
-  ac_cv_lib_ipc_shmat=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
-$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
-if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
-fi
-
-    fi
-  fi
-
-  # Check for libraries that X11R6 Xt/Xaw programs need.
-  ac_save_LDFLAGS=$LDFLAGS
-  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
-  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
-  # check for ICE first), but we must link in the order -lSM -lICE or
-  # we get undefined symbols.  So assume we have SM if we have ICE.
-  # These have to be linked with before -lX11, unlike the other
-  # libraries we check for below, so use a different variable.
-  # John Interrante, Karl Berry
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
-$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
-if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char IceConnectionNumber ();
-int
-main ()
-{
-return IceConnectionNumber ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ICE_IceConnectionNumber=yes
-else
-  ac_cv_lib_ICE_IceConnectionNumber=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
-$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
-if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
-  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
-fi
-
-  LDFLAGS=$ac_save_LDFLAGS
-
-fi
-
-        if test x$have_x = xyes; then
-            # Only allow dynamically loaded X11 if the X11 function pointers
-            # will not end up in the global namespace, which causes problems
-            # with other libraries calling X11 functions.
-            x11_symbols_private=$have_gcc_fvisibility
-
-            # Check whether --enable-x11-shared was given.
-if test "${enable_x11_shared+set}" = set; then :
-  enableval=$enable_x11_shared;
-else
-  enable_x11_shared=maybe
-fi
-
-
-            case "$host" in
-                *-*-darwin*)
-                    x11_symbols_private=yes
-                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
-                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
-                    xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
-                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
-                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
-                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
-                    xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
-                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
-                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
-                    ;;
-                *-*-openbsd*)
-                    x11_lib='libX11.so'
-                    x11ext_lib='libXext.so'
-                    xcursor_lib='libXcursor.so'
-                    xinerama_lib='libXinerama.so'
-                    xinput_lib='libXi.so'
-                    xrandr_lib='libXrandr.so'
-                    xrender_lib='libXrender.so'
-                    xss_lib='libXss.so'
-                    xvidmode_lib='libXxf86vm.so'
-                    ;;
-                *)
-                    x11_lib=`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
-                    x11ext_lib=`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
-                    xcursor_lib=`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
-                    xinerama_lib=`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
-                    xinput_lib=`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
-                    xrandr_lib=`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
-                    xrender_lib=`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
-                    xss_lib=`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
-                    xvidmode_lib=`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`
-                    ;;
-            esac
-
-            if test x$ac_cv_func_shmat != xyes; then
-                X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
-            fi
-            CFLAGS="$CFLAGS $X_CFLAGS"
-            LDFLAGS="$LDFLAGS $X_LIBS"
-
-            ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xext.h" "ac_cv_header_X11_extensions_Xext_h" "#include <X11/Xlib.h>
-                             #include <X11/Xproto.h>
-
-"
-if test "x$ac_cv_header_X11_extensions_Xext_h" = xyes; then :
-  have_xext_h_hdr=yes
-else
-  have_xext_h_hdr=no
-fi
-
-
-            if test x$have_xext_h_hdr != xyes; then
-               as_fn_error $? "
-*** Missing Xext.h, maybe you need to install the libxext-dev package?
-               " "$LINENO" 5
-            fi
-
-
-$as_echo "#define SDL_VIDEO_DRIVER_X11 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
-
-            # Needed so SDL applications can include SDL_syswm.h
-            SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
-
-            if test x$enable_x11_shared = xmaybe; then
-                enable_x11_shared=$x11_symbols_private
-            fi
-            if test x$have_loadso != xyes && \
-               test x$enable_x11_shared = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic X11 loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic X11 loading" >&2;}
-                enable_x11_shared=no
-            fi
-            if test x$x11_symbols_private != xyes && \
-               test x$enable_x11_shared = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading" >&5
-$as_echo "$as_me: WARNING: You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading" >&2;}
-                enable_x11_shared=no
-            fi
-
-            if test x$have_loadso = xyes && \
-               test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
-                echo "-- dynamic libX11 -> $x11_lib"
-                echo "-- dynamic libX11ext -> $x11ext_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC "$x11_lib"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "$x11ext_lib"
-_ACEOF
-
-            else
-                enable_x11_shared=no
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
-            fi
-            have_video=yes
-
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const parameter to XextAddDisplay" >&5
-$as_echo_n "checking for const parameter to XextAddDisplay... " >&6; }
-            have_const_param_XextAddDisplay=no
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-              #include <X11/Xlib.h>
-              #include <X11/Xproto.h>
-              #include <X11/extensions/Xext.h>
-              #include <X11/extensions/extutil.h>
-              extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-            have_const_param_XextAddDisplay=yes
-            $as_echo "#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_const_param_XextAddDisplay" >&5
-$as_echo "$have_const_param_XextAddDisplay" >&6; }
-
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const parameter to _XData32" >&5
-$as_echo_n "checking for const parameter to _XData32... " >&6; }
-	    have_const_param_xdata32=no
-	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-	      #include <X11/Xlibint.h>
-	      extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-	    have_const_param_xdata32=yes
-	    $as_echo "#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_const_param_xdata32" >&5
-$as_echo "$have_const_param_xdata32" >&6; }
-
-                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XGenericEvent" >&5
-$as_echo_n "checking for XGenericEvent... " >&6; }
-            have_XGenericEvent=no
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-              	#include <X11/Xlib.h>
-
-int
-main ()
-{
-
-Display *display;
-XEvent event;
-XGenericEventCookie *cookie = &event.xcookie;
-XNextEvent(display, &event);
-XGetEventData(display, cookie);
-XFreeEventData(display, cookie);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-                have_XGenericEvent=yes
-                $as_echo "#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_XGenericEvent" >&5
-$as_echo "$have_XGenericEvent" >&6; }
-
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XkbKeycodeToKeysym in -lX11" >&5
-$as_echo_n "checking for XkbKeycodeToKeysym in -lX11... " >&6; }
-if ${ac_cv_lib_X11_XkbKeycodeToKeysym+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lX11  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XkbKeycodeToKeysym ();
-int
-main ()
-{
-return XkbKeycodeToKeysym ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_X11_XkbKeycodeToKeysym=yes
-else
-  ac_cv_lib_X11_XkbKeycodeToKeysym=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5
-$as_echo "$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6; }
-if test "x$ac_cv_lib_X11_XkbKeycodeToKeysym" = xyes; then :
-
-$as_echo "#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1" >>confdefs.h
-
-fi
-
-
-            # Check whether --enable-video-x11-xcursor was given.
-if test "${enable_video_x11_xcursor+set}" = set; then :
-  enableval=$enable_video_x11_xcursor;
-else
-  enable_video_x11_xcursor=yes
-fi
-
-            if test x$enable_video_x11_xcursor = xyes; then
-                definitely_enable_video_x11_xcursor=no
-                ac_fn_c_check_header_compile "$LINENO" "X11/Xcursor/Xcursor.h" "ac_cv_header_X11_Xcursor_Xcursor_h" "#include <X11/Xlib.h>
-
-"
-if test "x$ac_cv_header_X11_Xcursor_Xcursor_h" = xyes; then :
-  have_xcursor_h_hdr=yes
-else
-  have_xcursor_h_hdr=no
-fi
-
-
-                if test x$have_xcursor_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
-                        echo "-- dynamic libXcursor -> $xcursor_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "$xcursor_lib"
-_ACEOF
-
-                        definitely_enable_video_x11_xcursor=yes
-                    else
-                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XcursorImageCreate in -lXcursor" >&5
-$as_echo_n "checking for XcursorImageCreate in -lXcursor... " >&6; }
-if ${ac_cv_lib_Xcursor_XcursorImageCreate+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXcursor  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XcursorImageCreate ();
-int
-main ()
-{
-return XcursorImageCreate ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xcursor_XcursorImageCreate=yes
-else
-  ac_cv_lib_Xcursor_XcursorImageCreate=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xcursor_XcursorImageCreate" >&5
-$as_echo "$ac_cv_lib_Xcursor_XcursorImageCreate" >&6; }
-if test "x$ac_cv_lib_Xcursor_XcursorImageCreate" = xyes; then :
-  have_xcursor_lib=yes
-fi
-
-                        if test x$have_xcursor_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
-                            definitely_enable_video_x11_xcursor=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_xcursor = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_X11_XCURSOR 1" >>confdefs.h
-
-            fi
-            # Check whether --enable-video-x11-xinerama was given.
-if test "${enable_video_x11_xinerama+set}" = set; then :
-  enableval=$enable_video_x11_xinerama;
-else
-  enable_video_x11_xinerama=yes
-fi
-
-            if test x$enable_video_x11_xinerama = xyes; then
-                definitely_enable_video_x11_xinerama=no
-                ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xinerama.h" "ac_cv_header_X11_extensions_Xinerama_h" "#include <X11/Xlib.h>
-
-"
-if test "x$ac_cv_header_X11_extensions_Xinerama_h" = xyes; then :
-  have_xinerama_h_hdr=yes
-else
-  have_xinerama_h_hdr=no
-fi
-
-
-                if test x$have_xinerama_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
-                        echo "-- dynamic libXinerama -> $xinerama_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "$xinerama_lib"
-_ACEOF
-
-                        definitely_enable_video_x11_xinerama=yes
-                    else
-                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XineramaQueryExtension in -lXinerama" >&5
-$as_echo_n "checking for XineramaQueryExtension in -lXinerama... " >&6; }
-if ${ac_cv_lib_Xinerama_XineramaQueryExtension+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXinerama  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XineramaQueryExtension ();
-int
-main ()
-{
-return XineramaQueryExtension ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xinerama_XineramaQueryExtension=yes
-else
-  ac_cv_lib_Xinerama_XineramaQueryExtension=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xinerama_XineramaQueryExtension" >&5
-$as_echo "$ac_cv_lib_Xinerama_XineramaQueryExtension" >&6; }
-if test "x$ac_cv_lib_Xinerama_XineramaQueryExtension" = xyes; then :
-  have_xinerama_lib=yes
-fi
-
-                        if test x$have_xinerama_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
-                            definitely_enable_video_x11_xinerama=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_xinerama = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_X11_XINERAMA 1" >>confdefs.h
-
-            fi
-            # Check whether --enable-video-x11-xinput was given.
-if test "${enable_video_x11_xinput+set}" = set; then :
-  enableval=$enable_video_x11_xinput;
-else
-  enable_video_x11_xinput=yes
-fi
-
-            if test x$enable_video_x11_xinput = xyes; then
-                definitely_enable_video_x11_xinput=no
-                ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XInput2.h" "ac_cv_header_X11_extensions_XInput2_h" "#include <X11/Xlib.h>
-
-"
-if test "x$ac_cv_header_X11_extensions_XInput2_h" = xyes; then :
-  have_xinput_h_hdr=yes
-else
-  have_xinput_h_hdr=no
-fi
-
-
-                if test x$have_xinput_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
-                        echo "-- dynamic libXi -> $xinput_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "$xinput_lib"
-_ACEOF
-
-                        definitely_enable_video_x11_xinput=yes
-                    else
-                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDevice in -lXi" >&5
-$as_echo_n "checking for XOpenDevice in -lXi... " >&6; }
-if ${ac_cv_lib_Xi_XOpenDevice+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXi  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XOpenDevice ();
-int
-main ()
-{
-return XOpenDevice ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xi_XOpenDevice=yes
-else
-  ac_cv_lib_Xi_XOpenDevice=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xi_XOpenDevice" >&5
-$as_echo "$ac_cv_lib_Xi_XOpenDevice" >&6; }
-if test "x$ac_cv_lib_Xi_XOpenDevice" = xyes; then :
-  have_xinput_lib=yes
-fi
-
-                        if test x$have_xinput_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
-                            definitely_enable_video_x11_xinput=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_xinput = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_X11_XINPUT2 1" >>confdefs.h
-
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xinput2 multitouch" >&5
-$as_echo_n "checking for xinput2 multitouch... " >&6; }
-            	have_xinput2_multitouch=no
-            	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-              		#include <X11/Xlib.h>
-             		#include <X11/Xproto.h>
-			#include <X11/extensions/XInput2.h>
-
-int
-main ()
-{
-
-int event_type = XI_TouchBegin;
-XITouchClassInfo *t;
-Status
-XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f)
-{
-    return (Status)0;
-}
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-            	have_xinput2_multitouch=yes
-            	$as_echo "#define SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_xinput2_multitouch" >&5
-$as_echo "$have_xinput2_multitouch" >&6; }
-            fi
-            # Check whether --enable-video-x11-xrandr was given.
-if test "${enable_video_x11_xrandr+set}" = set; then :
-  enableval=$enable_video_x11_xrandr;
-else
-  enable_video_x11_xrandr=yes
-fi
-
-            if test x$enable_video_x11_xrandr = xyes; then
-                definitely_enable_video_x11_xrandr=no
-                ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "#include <X11/Xlib.h>
-
-"
-if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes; then :
-  have_xrandr_h_hdr=yes
-else
-  have_xrandr_h_hdr=no
-fi
-
-
-                if test x$have_xrandr_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
-                        echo "-- dynamic libXrandr -> $xrandr_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "$xrandr_lib"
-_ACEOF
-
-                        definitely_enable_video_x11_xrandr=yes
-                    else
-                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRQueryExtension in -lXrandr" >&5
-$as_echo_n "checking for XRRQueryExtension in -lXrandr... " >&6; }
-if ${ac_cv_lib_Xrandr_XRRQueryExtension+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXrandr  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XRRQueryExtension ();
-int
-main ()
-{
-return XRRQueryExtension ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xrandr_XRRQueryExtension=yes
-else
-  ac_cv_lib_Xrandr_XRRQueryExtension=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrandr_XRRQueryExtension" >&5
-$as_echo "$ac_cv_lib_Xrandr_XRRQueryExtension" >&6; }
-if test "x$ac_cv_lib_Xrandr_XRRQueryExtension" = xyes; then :
-  have_xrandr_lib=yes
-fi
-
-                        if test x$have_xrandr_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
-                            definitely_enable_video_x11_xrandr=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_xrandr = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_X11_XRANDR 1" >>confdefs.h
-
-            fi
-            # Check whether --enable-video-x11-scrnsaver was given.
-if test "${enable_video_x11_scrnsaver+set}" = set; then :
-  enableval=$enable_video_x11_scrnsaver;
-else
-  enable_video_x11_scrnsaver=yes
-fi
-
-            if test x$enable_video_x11_scrnsaver = xyes; then
-                ac_fn_c_check_header_compile "$LINENO" "X11/extensions/scrnsaver.h" "ac_cv_header_X11_extensions_scrnsaver_h" "#include <X11/Xlib.h>
-
-"
-if test "x$ac_cv_header_X11_extensions_scrnsaver_h" = xyes; then :
-  have_scrnsaver_h_hdr=yes
-else
-  have_scrnsaver_h_hdr=no
-fi
-
-
-                if test x$have_scrnsaver_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
-                        echo "-- dynamic libXss -> $xss_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "$xss_lib"
-_ACEOF
-
-                        definitely_enable_video_x11_scrnsaver=yes
-                    else
-                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverSuspend in -lXss" >&5
-$as_echo_n "checking for XScreenSaverSuspend in -lXss... " >&6; }
-if ${ac_cv_lib_Xss_XScreenSaverSuspend+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXss  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XScreenSaverSuspend ();
-int
-main ()
-{
-return XScreenSaverSuspend ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xss_XScreenSaverSuspend=yes
-else
-  ac_cv_lib_Xss_XScreenSaverSuspend=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xss_XScreenSaverSuspend" >&5
-$as_echo "$ac_cv_lib_Xss_XScreenSaverSuspend" >&6; }
-if test "x$ac_cv_lib_Xss_XScreenSaverSuspend" = xyes; then :
-  have_xss_lib=yes
-fi
-
-                        if test x$have_xss_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
-                            definitely_enable_video_x11_scrnsaver=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_scrnsaver = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1" >>confdefs.h
-
-            fi
-            # Check whether --enable-video-x11-xshape was given.
-if test "${enable_video_x11_xshape+set}" = set; then :
-  enableval=$enable_video_x11_xshape;
-else
-  enable_video_x11_xshape=yes
-fi
-
-            if test x$enable_video_x11_xshape = xyes; then
-                ac_fn_c_check_header_compile "$LINENO" "X11/extensions/shape.h" "ac_cv_header_X11_extensions_shape_h" "#include <X11/Xlib.h>
-
-"
-if test "x$ac_cv_header_X11_extensions_shape_h" = xyes; then :
-  have_shape_h_hdr=yes
-else
-  have_shape_h_hdr=no
-fi
-
-
-                if test x$have_shape_h_hdr = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_X11_XSHAPE 1" >>confdefs.h
-
-                fi
-            fi
-            # Check whether --enable-video-x11-vm was given.
-if test "${enable_video_x11_vm+set}" = set; then :
-  enableval=$enable_video_x11_vm;
-else
-  enable_video_x11_vm=yes
-fi
-
-            if test x$enable_video_x11_vm = xyes; then
-                definitely_enable_video_x11_vm=no
-                ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmode.h" "ac_cv_header_X11_extensions_xf86vmode_h" "#include <X11/Xlib.h>
-
-"
-if test "x$ac_cv_header_X11_extensions_xf86vmode_h" = xyes; then :
-  have_vm_h_hdr=yes
-else
-  have_vm_h_hdr=no
-fi
-
-
-                if test x$have_vm_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
-                        echo "-- dynamic libXxf86vm -> $xvidmode_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "$xvidmode_lib"
-_ACEOF
-
-                        definitely_enable_video_x11_vm=yes
-                    else
-                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86VidModeQueryVersion in -lXxf86vm" >&5
-$as_echo_n "checking for XF86VidModeQueryVersion in -lXxf86vm... " >&6; }
-if ${ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXxf86vm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XF86VidModeQueryVersion ();
-int
-main ()
-{
-return XF86VidModeQueryVersion ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion=yes
-else
-  ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" >&5
-$as_echo "$ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" >&6; }
-if test "x$ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" = xyes; then :
-  have_vm_lib=yes
-fi
-
-                        if test x$have_vm_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
-                            definitely_enable_video_x11_vm=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_vm = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1" >>confdefs.h
-
-            fi
-        fi
-    fi
-}
-
-CheckBWINDOW()
-{
-    if test x$enable_video = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_BWINDOW 1" >>confdefs.h
-
-        SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
-        have_video=yes
-    fi
-}
-
-CheckCOCOA()
-{
-    # Check whether --enable-video-cocoa was given.
-if test "${enable_video_cocoa+set}" = set; then :
-  enableval=$enable_video_cocoa;
-else
-  enable_video_cocoa=yes
-fi
-
-    if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
-        save_CFLAGS="$CFLAGS"
-                CFLAGS="$CFLAGS -x objective-c"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cocoa framework" >&5
-$as_echo_n "checking for Cocoa framework... " >&6; }
-        have_cocoa=no
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-          #import <Cocoa/Cocoa.h>
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        have_cocoa=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cocoa" >&5
-$as_echo "$have_cocoa" >&6; }
-        CFLAGS="$save_CFLAGS"
-        if test x$have_cocoa = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_COCOA 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
-            have_video=yes
-        fi
-    fi
-}
-
-CheckDirectFB()
-{
-    # Check whether --enable-video-directfb was given.
-if test "${enable_video_directfb+set}" = set; then :
-  enableval=$enable_video_directfb;
-else
-  enable_video_directfb=no
-fi
-
-    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
-        video_directfb=no
-
-        DIRECTFB_REQUIRED_VERSION=1.0.0
-        for ac_prog in directfb-config
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_DIRECTFBCONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $DIRECTFBCONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_DIRECTFBCONFIG="$DIRECTFBCONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$prefix/bin:$PATH"
-for as_dir in $as_dummy
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_DIRECTFBCONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-DIRECTFBCONFIG=$ac_cv_path_DIRECTFBCONFIG
-if test -n "$DIRECTFBCONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIRECTFBCONFIG" >&5
-$as_echo "$DIRECTFBCONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$DIRECTFBCONFIG" && break
-done
-test -n "$DIRECTFBCONFIG" || DIRECTFBCONFIG="no"
-
-        if test x$DIRECTFBCONFIG = xno; then
-            # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-            if test x$PKG_CONFIG != xno; then
-                if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
-                    DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
-                    DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
-                    DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb`
-                    video_directfb=yes
-                fi
-            fi
-        else
-            set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
-            NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
-            set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'`
-            HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
-            if test $HAVE_VERSION -ge $NEED_VERSION; then
-                DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
-                DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
-                DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix`
-                video_directfb=yes
-            fi
-        fi
-        if test x$video_directfb = xyes; then
-            # SuSE 11.1 installs directfb-config without directfb-devel
-            save_CPPFLAGS="$CPPFLAGS"
-            CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
-            ac_fn_c_check_header_mongrel "$LINENO" "directfb.h" "ac_cv_header_directfb_h" "$ac_includes_default"
-if test "x$ac_cv_header_directfb_h" = xyes; then :
-  have_directfb_hdr=yes
-else
-  have_directfb_hdr=no
-fi
-
-
-            CPPFLAGS="$save_CPPFLAGS"
-            video_directfb=$have_directfb_hdr
-        fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DirectFB $DIRECTFB_REQUIRED_VERSION support" >&5
-$as_echo_n "checking for DirectFB $DIRECTFB_REQUIRED_VERSION support... " >&6; }
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_directfb" >&5
-$as_echo "$video_directfb" >&6; }
-
-        if test x$video_directfb = xyes; then
-            # Check whether --enable-directfb-shared was given.
-if test "${enable_directfb_shared+set}" = set; then :
-  enableval=$enable_directfb_shared;
-else
-  enable_directfb_shared=yes
-fi
-
-
-
-$as_echo "#define SDL_VIDEO_DRIVER_DIRECTFB 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_RENDER_DIRECTFB 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
-
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for directfb dynamic loading support" >&5
-$as_echo_n "checking for directfb dynamic loading support... " >&6; }
-            directfb_shared=no
-            directfb_lib=`find_lib "libdirectfb.so.*" "$DIRECTFB_LIBS"`
-            # | sed 's/.*\/\(.*\)/\1/; q'`]
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"directfb $directfb_lib\"" >&5
-$as_echo "$as_me: WARNING: \"directfb $directfb_lib\"" >&2;}
-            if test x$have_loadso != xyes && \
-               test x$enable_directfb_shared = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic directfb loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic directfb loading" >&2;}
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
-                directfb_shared=yes
-                echo "-- $directfb_lib_spec -> $directfb_lib"
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC "$directfb_lib"
-_ACEOF
-
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
-            fi
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $directfb_shared" >&5
-$as_echo "$directfb_shared" >&6; }
-            have_video=yes
-        fi
-    fi
-}
-
-CheckFusionSound()
-{
-    # Check whether --enable-fusionsound was given.
-if test "${enable_fusionsound+set}" = set; then :
-  enableval=$enable_fusionsound;
-else
-  enable_fusionsound=no
-fi
-
-    if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
-        fusionsound=no
-
-        FUSIONSOUND_REQUIRED_VERSION=1.1.1
-
-        # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FusionSound $FUSIONSOUND_REQUIRED_VERSION support" >&5
-$as_echo_n "checking for FusionSound $FUSIONSOUND_REQUIRED_VERSION support... " >&6; }
-        if test x$PKG_CONFIG != xno; then
-            if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
-                FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
-                FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
-                fusionsound=yes
-            fi
-        fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fusionsound" >&5
-$as_echo "$fusionsound" >&6; }
-
-        if test x$fusionsound = xyes; then
-
-$as_echo "#define SDL_AUDIO_DRIVER_FUSIONSOUND 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
-
-            # Check whether --enable-fusionsound-shared was given.
-if test "${enable_fusionsound_shared+set}" = set; then :
-  enableval=$enable_fusionsound_shared;
-else
-  enable_fusionsound_shared=yes
-fi
-
-            fusionsound_shared=no
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FusionSound dynamic loading support" >&5
-$as_echo_n "checking for FusionSound dynamic loading support... " >&6; }
-            if test x$have_loadso != xyes && \
-               test x$enable_fusionsound_shared = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic fusionsound loading" >&5
-$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic fusionsound loading" >&2;}
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_fusionsound_shared = xyes; then
-
-cat >>confdefs.h <<_ACEOF
-#define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so"
-_ACEOF
-
-                fusionsound_shared=yes
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
-            fi
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fusionsound_shared" >&5
-$as_echo "$fusionsound_shared" >&6; }
-
-            have_audio=yes
-        fi
-    fi
-}
-
-CheckDummyVideo()
-{
-    # Check whether --enable-video-dummy was given.
-if test "${enable_video_dummy+set}" = set; then :
-  enableval=$enable_video_dummy;
-else
-  enable_video_dummy=yes
-fi
-
-    if test x$enable_video_dummy = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_DUMMY 1" >>confdefs.h
-
-        SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
-        have_video=yes
-    fi
-}
-
-# Check whether --enable-video-opengl was given.
-if test "${enable_video_opengl+set}" = set; then :
-  enableval=$enable_video_opengl;
-else
-  enable_video_opengl=yes
-fi
-
-
-CheckOpenGLX11()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL (GLX) support" >&5
-$as_echo_n "checking for OpenGL (GLX) support... " >&6; }
-        video_opengl=no
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-         #include <GL/gl.h>
-         #include <GL/glx.h>
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        video_opengl=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengl" >&5
-$as_echo "$video_opengl" >&6; }
-        if test x$video_opengl = xyes; then
-
-$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_OPENGL_GLX 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h
-
-        fi
-    fi
-}
-
-# Check whether --enable-video-opengles was given.
-if test "${enable_video_opengles+set}" = set; then :
-  enableval=$enable_video_opengles;
-else
-  enable_video_opengles=yes
-fi
-
-
-CheckOpenGLESX11()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGL support" >&5
-$as_echo_n "checking for EGL support... " >&6; }
-        video_opengl_egl=no
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-         #include <EGL/egl.h>
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        video_opengl_egl=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengl_egl" >&5
-$as_echo "$video_opengl_egl" >&6; }
-        if test x$video_opengl_egl = xyes; then
-
-$as_echo "#define SDL_VIDEO_OPENGL_EGL 1" >>confdefs.h
-
-        fi
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES v1 headers" >&5
-$as_echo_n "checking for OpenGL ES v1 headers... " >&6; }
-        video_opengles_v1=no
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-         #include <GLES/gl.h>
-         #include <GLES/glext.h>
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        video_opengles_v1=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengles_v1" >&5
-$as_echo "$video_opengles_v1" >&6; }
-        if test x$video_opengles_v1 = xyes; then
-
-$as_echo "#define SDL_VIDEO_OPENGL_ES 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_RENDER_OGL_ES 1" >>confdefs.h
-
-        fi
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES v2 headers" >&5
-$as_echo_n "checking for OpenGL ES v2 headers... " >&6; }
-        video_opengles_v2=no
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-         #include <GLES2/gl2.h>
-         #include <GLES2/gl2ext.h>
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        video_opengles_v2=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengles_v2" >&5
-$as_echo "$video_opengles_v2" >&6; }
-        if test x$video_opengles_v2 = xyes; then
-
-$as_echo "#define SDL_VIDEO_OPENGL_ES2 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_RENDER_OGL_ES2 1" >>confdefs.h
-
-        fi
-    fi
-}
-
-CheckWINDOWSGL()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
-
-$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_OPENGL_WGL 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h
-
-    fi
-}
-
-CheckBeGL()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
-
-$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_OPENGL_BGL 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h
-
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
-    fi
-}
-
-CheckMacGL()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
-
-$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_OPENGL_CGL 1" >>confdefs.h
-
-
-$as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h
-
-        case "$host" in
-            *-*-darwin*)
-                if test x$enable_video_cocoa = xyes; then
-                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
-                fi
-        esac
-    fi
-}
-
-CheckInputEvents()
-{
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux 2.4 unified input interface" >&5
-$as_echo_n "checking for Linux 2.4 unified input interface... " >&6; }
-        use_input_events=no
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-          #include <linux/input.h>
-
-int
-main ()
-{
-
-          #ifndef EVIOCGNAME
-          #error EVIOCGNAME() ioctl not available
-          #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        use_input_events=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_input_events" >&5
-$as_echo "$use_input_events" >&6; }
-        if test x$use_input_events = xyes; then
-
-$as_echo "#define SDL_INPUT_LINUXEV 1" >>confdefs.h
-
-        fi
-}
-
-CheckInputKD()
-{
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux kd.h" >&5
-$as_echo_n "checking for Linux kd.h... " >&6; }
-    use_input_kd=no
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-      #include <linux/kd.h>
-      #include <linux/keyboard.h>
-
-int
-main ()
-{
-
-        struct kbentry kbe;
-        kbe.kb_table = KG_CTRL;
-        ioctl(0, KDGKBENT, &kbe);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-    use_input_kd=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_input_kd" >&5
-$as_echo "$use_input_kd" >&6; }
-    if test x$use_input_kd = xyes; then
-
-$as_echo "#define SDL_INPUT_LINUXKD 1" >>confdefs.h
-
-    fi
-}
-
-CheckLibUDev()
-{
-    # Check whether --enable-libudev was given.
-if test "${enable_libudev+set}" = set; then :
-  enableval=$enable_libudev;
-else
-  enable_libudev=yes
-fi
-
-    if test x$enable_libudev = xyes; then
-        ac_fn_c_check_header_mongrel "$LINENO" "libudev.h" "ac_cv_header_libudev_h" "$ac_includes_default"
-if test "x$ac_cv_header_libudev_h" = xyes; then :
-  have_libudev_h_hdr=yes
-else
-  have_libudev_h_hdr=no
-fi
-
-
-        if test x$have_libudev_h_hdr = xyes; then
-
-$as_echo "#define HAVE_LIBUDEV_H 1" >>confdefs.h
-
-        fi
-    fi
-}
-
-CheckDBus()
-{
-    # Check whether --enable-dbus was given.
-if test "${enable_dbus+set}" = set; then :
-  enableval=$enable_dbus;
-else
-  enable_dbus=yes
-fi
-
-    if test x$enable_dbus = xyes; then
-        # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-        if test x$PKG_CONFIG != xno; then
-            DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1`
-            save_CFLAGS="$CFLAGS"
-            CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
-            ac_fn_c_check_header_mongrel "$LINENO" "dbus/dbus.h" "ac_cv_header_dbus_dbus_h" "$ac_includes_default"
-if test "x$ac_cv_header_dbus_dbus_h" = xyes; then :
-  have_dbus_dbus_h_hdr=yes
-else
-  have_dbus_dbus_h_hdr=no
-fi
-
-
-            CFLAGS="$save_CFLAGS"
-            if test x$have_dbus_dbus_h_hdr = xyes; then
-
-$as_echo "#define HAVE_DBUS_DBUS_H 1" >>confdefs.h
-
-                EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
-            fi
-        fi
-    fi
-}
-
-CheckTslib()
-{
-    # Check whether --enable-input-tslib was given.
-if test "${enable_input_tslib+set}" = set; then :
-  enableval=$enable_input_tslib;
-else
-  enable_input_tslib=yes
-fi
-
-    if test x$enable_input_tslib = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Touchscreen library support" >&5
-$as_echo_n "checking for Touchscreen library support... " >&6; }
-        enable_input_tslib=no
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-          #include "tslib.h"
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        enable_input_tslib=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_input_tslib" >&5
-$as_echo "$enable_input_tslib" >&6; }
-        if test x$enable_input_tslib = xyes; then
-
-$as_echo "#define SDL_INPUT_TSLIB 1" >>confdefs.h
-
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
-        fi
-    fi
-}
-
-CheckPTHREAD()
-{
-        # Check whether --enable-pthreads was given.
-if test "${enable_pthreads+set}" = set; then :
-  enableval=$enable_pthreads;
-else
-  enable_pthreads=yes
-fi
-
-        # Check whether --enable-pthread-sem was given.
-if test "${enable_pthread_sem+set}" = set; then :
-  enableval=$enable_pthread_sem;
-else
-  enable_pthread_sem=yes
-fi
-
-    case "$host" in
-        *-*-linux*|*-*-uclinux*)
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lpthread"
-            ;;
-        *-*-bsdi*)
-            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
-            pthread_lib=""
-            ;;
-        *-*-darwin*)
-            pthread_cflags="-D_THREAD_SAFE"
-# causes Carbon.p complaints?
-#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
-            ;;
-        *-*-freebsd*|*-*-dragonfly*)
-            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
-            pthread_lib="-pthread"
-            ;;
-        *-*-netbsd*)
-            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
-            pthread_lib="-lpthread"
-            ;;
-        *-*-openbsd*)
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-pthread"
-            ;;
-        *-*-solaris2.9)
-            # From Solaris 9+, posix4's preferred name is rt.
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lpthread -lrt"
-            ;;
-        *-*-solaris2.10)
-            # Solaris 10+ merged pthread into libc.
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lrt"
-            ;;
-        *-*-solaris*)
-            # Solaris 11+ merged rt into libc.
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib=""
-            ;;
-        *-*-sysv5*)
-            pthread_cflags="-D_REENTRANT -Kthread"
-            pthread_lib=""
-            ;;
-        *-*-aix*)
-            pthread_cflags="-D_REENTRANT -mthreads"
-            pthread_lib="-lpthread"
-            ;;
-        *-*-hpux11*)
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-L/usr/lib -lpthread"
-            ;;
-        *)
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lpthread"
-            ;;
-    esac
-    if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
-        # Save the original compiler flags and libraries
-        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
-        # Add the pthread compiler flags and libraries
-        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
-        # Check to see if we have pthread support on this system
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthreads" >&5
-$as_echo_n "checking for pthreads... " >&6; }
-        use_pthreads=no
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-         #include <pthread.h>
-
-int
-main ()
-{
-
-         pthread_attr_t type;
-         pthread_attr_init(&type);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-        use_pthreads=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_pthreads" >&5
-$as_echo "$use_pthreads" >&6; }
-        # Restore the compiler flags and libraries
-        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
-
-        # Do futher testing if we have pthread support...
-        if test x$use_pthreads = xyes; then
-
-$as_echo "#define SDL_THREAD_PTHREAD 1" >>confdefs.h
-
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
-            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
-            SDL_LIBS="$SDL_LIBS $pthread_lib"
-
-            # Save the original compiler flags and libraries
-            ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
-            # Add the pthread compiler flags and libraries
-            CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
-
-            # Check to see if recursive mutexes are available
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recursive mutexes" >&5
-$as_echo_n "checking for recursive mutexes... " >&6; }
-            has_recursive_mutexes=no
-            if test x$has_recursive_mutexes = xno; then
-                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                  #include <pthread.h>
-
-int
-main ()
-{
-
-                  pthread_mutexattr_t attr;
-                  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-                has_recursive_mutexes=yes
-
-$as_echo "#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            fi
-            if test x$has_recursive_mutexes = xno; then
-                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                  #include <pthread.h>
-
-int
-main ()
-{
-
-                  pthread_mutexattr_t attr;
-                  pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-                has_recursive_mutexes=yes
-
-$as_echo "#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            fi
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_recursive_mutexes" >&5
-$as_echo "$has_recursive_mutexes" >&6; }
-
-            # Check to see if pthread semaphore support is missing
-            if test x$enable_pthread_sem = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread semaphores" >&5
-$as_echo_n "checking for pthread semaphores... " >&6; }
-                have_pthread_sem=no
-                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                  #include <pthread.h>
-                  #include <semaphore.h>
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-                have_pthread_sem=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_pthread_sem" >&5
-$as_echo "$have_pthread_sem" >&6; }
-            fi
-            if test x$have_pthread_sem = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_timedwait" >&5
-$as_echo_n "checking for sem_timedwait... " >&6; }
-                have_sem_timedwait=no
-                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                  #include <pthread.h>
-                  #include <semaphore.h>
-
-int
-main ()
-{
-
-                  sem_timedwait(NULL, NULL);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-                have_sem_timedwait=yes
-                $as_echo "#define HAVE_SEM_TIMEDWAIT 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sem_timedwait" >&5
-$as_echo "$have_sem_timedwait" >&6; }
-            fi
-
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_spin_trylock" >&5
-$as_echo_n "checking for pthread_spin_trylock... " >&6; }
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_spin_trylock ();
-int
-main ()
-{
-return pthread_spin_trylock ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-              has_pthread_spin_trylock=yes
-
-$as_echo "#define HAVE_PTHREAD_SPINLOCK 1" >>confdefs.h
-
-
-else
-
-              has_pthread_spin_trylock=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_pthread_spin_trylock" >&5
-$as_echo "$has_pthread_spin_trylock" >&6; }
-
-            ac_fn_c_check_header_compile "$LINENO" "pthread_np.h" "ac_cv_header_pthread_np_h" " #include <pthread.h>
-"
-if test "x$ac_cv_header_pthread_np_h" = xyes; then :
-  have_pthread_np_h=yes
-else
-  have_pthread_np_h=no
-fi
-
-
-            if test x$have_pthread_np_h = xyes; then
-
-$as_echo "#define HAVE_PTHREAD_NP_H 1" >>confdefs.h
-
-            fi
-
-            # Check to see if pthread naming is available
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np" >&5
-$as_echo_n "checking for pthread_setname_np... " >&6; }
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_setname_np ();
-int
-main ()
-{
-return pthread_setname_np ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-              has_pthread_setname_np=yes
-
-$as_echo "#define HAVE_PTHREAD_SETNAME_NP 1" >>confdefs.h
-
-
-else
-
-              has_pthread_setname_np=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_pthread_setname_np" >&5
-$as_echo "$has_pthread_setname_np" >&6; }
-
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_set_name_np" >&5
-$as_echo_n "checking for pthread_set_name_np... " >&6; }
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_set_name_np ();
-int
-main ()
-{
-return pthread_set_name_np ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-              has_pthread_set_name_np=yes
-
-$as_echo "#define HAVE_PTHREAD_SET_NAME_NP 1" >>confdefs.h
-
-
-else
-
-              has_pthread_set_name_np=no
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_pthread_set_name_np" >&5
-$as_echo "$has_pthread_set_name_np" >&6; }
-
-            # Restore the compiler flags and libraries
-            CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
-
-            # Basic thread creation functions
-            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
-
-            # Semaphores
-            # We can fake these with mutexes and condition variables if necessary
-            if test x$have_pthread_sem = xyes; then
-                SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
-            else
-                SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
-            fi
-
-            # Mutexes
-            # We can fake these with semaphores if necessary
-            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
-
-            # Condition variables
-            # We can fake these with semaphores and mutexes if necessary
-            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
-
-            # Thread local storage
-            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
-
-            have_threads=yes
-        fi
-    fi
-}
-
-CheckWINDOWS()
-{
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Windows compiler" >&5
-$as_echo_n "checking Windows compiler... " >&6; }
-    have_win32_gcc=no
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-     #include <windows.h>
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-    have_win32_gcc=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_win32_gcc" >&5
-$as_echo "$have_win32_gcc" >&6; }
-    if test x$have_win32_gcc != xyes; then
-       as_fn_error $? "
-*** Your compiler ($CC) does not produce Windows executables!
-       " "$LINENO" 5
-    fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking Windows CE" >&5
-$as_echo_n "checking Windows CE... " >&6; }
-    have_wince=no
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
-#error This is not Windows CE
-#endif
-
-int
-main ()
-{
-
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-    have_wince=yes
-       as_fn_error $? "
-*** Sorry, Windows CE is no longer supported.
-       " "$LINENO" 5
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_wince" >&5
-$as_echo "$have_wince" >&6; }
-
-    # This fixes Windows stack alignment with newer GCC
-    CheckStackBoundary
-}
-
-CheckDIRECTX()
-{
-    # Check whether --enable-directx was given.
-if test "${enable_directx+set}" = set; then :
-  enableval=$enable_directx;
-else
-  enable_directx=yes
-fi
-
-    if test x$enable_directx = xyes; then
-        ac_fn_c_check_header_mongrel "$LINENO" "d3d9.h" "ac_cv_header_d3d9_h" "$ac_includes_default"
-if test "x$ac_cv_header_d3d9_h" = xyes; then :
-  have_d3d=yes
-fi
-
-
-        ac_fn_c_check_header_mongrel "$LINENO" "ddraw.h" "ac_cv_header_ddraw_h" "$ac_includes_default"
-if test "x$ac_cv_header_ddraw_h" = xyes; then :
-  have_ddraw=yes
-fi
-
-
-        ac_fn_c_check_header_mongrel "$LINENO" "dsound.h" "ac_cv_header_dsound_h" "$ac_includes_default"
-if test "x$ac_cv_header_dsound_h" = xyes; then :
-  have_dsound=yes
-fi
-
-
-        ac_fn_c_check_header_mongrel "$LINENO" "dinput.h" "ac_cv_header_dinput_h" "$ac_includes_default"
-if test "x$ac_cv_header_dinput_h" = xyes; then :
-  have_dinput=yes
-fi
-
-
-        ac_fn_c_check_header_mongrel "$LINENO" "xaudio2.h" "ac_cv_header_xaudio2_h" "$ac_includes_default"
-if test "x$ac_cv_header_xaudio2_h" = xyes; then :
-  have_xaudio2=yes
-fi
-
-
-
-        # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
-        # FIXME:  ...so force it off for now.
-        case "$host" in
-            *-*-cygwin*)
-            have_dinput=false
-            ;;
-        esac
-    fi
-}
-
-CheckDLOPEN()
-{
-    # Check whether --enable-sdl-dlopen was given.
-if test "${enable_sdl_dlopen+set}" = set; then :
-  enableval=$enable_sdl_dlopen;
-else
-  enable_sdl_dlopen=yes
-fi
-
-    if test x$enable_sdl_dlopen = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen" >&5
-$as_echo_n "checking for dlopen... " >&6; }
-        have_dlopen=no
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-         #include <dlfcn.h>
-
-int
-main ()
-{
-
-         void *handle = dlopen("", RTLD_NOW);
-         const char *loaderror = (char *) dlerror();
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-        have_dlopen=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_dlopen" >&5
-$as_echo "$have_dlopen" >&6; }
-
-        if test x$have_dlopen = xyes; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lc" >&5
-$as_echo_n "checking for dlopen in -lc... " >&6; }
-if ${ac_cv_lib_c_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_c_dlopen=yes
-else
-  ac_cv_lib_c_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_dlopen" >&5
-$as_echo "$ac_cv_lib_c_dlopen" >&6; }
-if test "x$ac_cv_lib_c_dlopen" = xyes; then :
-  EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
-else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lltdl" >&5
-$as_echo_n "checking for dlopen in -lltdl... " >&6; }
-if ${ac_cv_lib_ltdl_dlopen+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lltdl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ltdl_dlopen=yes
-else
-  ac_cv_lib_ltdl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_dlopen" >&5
-$as_echo "$ac_cv_lib_ltdl_dlopen" >&6; }
-if test "x$ac_cv_lib_ltdl_dlopen" = xyes; then :
-  EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl"
-fi
-
-fi
-
-fi
-
-
-$as_echo "#define SDL_LOADSO_DLOPEN 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
-            have_loadso=yes
-        fi
-    fi
-}
-
-CheckUSBHID()
-{
-    case "$host" in
-        *-*-*bsd*)
-            if test x$enable_joystick = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusbhid" >&5
-$as_echo_n "checking for hid_init in -lusbhid... " >&6; }
-if ${ac_cv_lib_usbhid_hid_init+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lusbhid  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char hid_init ();
-int
-main ()
-{
-return hid_init ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_usbhid_hid_init=yes
-else
-  ac_cv_lib_usbhid_hid_init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usbhid_hid_init" >&5
-$as_echo "$ac_cv_lib_usbhid_hid_init" >&6; }
-if test "x$ac_cv_lib_usbhid_hid_init" = xyes; then :
-  have_libusbhid=yes
-fi
-
-                if test x$have_libusbhid = xyes; then
-                    ac_fn_c_check_header_mongrel "$LINENO" "usbhid.h" "ac_cv_header_usbhid_h" "$ac_includes_default"
-if test "x$ac_cv_header_usbhid_h" = xyes; then :
-  USB_CFLAGS="-DHAVE_USBHID_H"
-fi
-
-
-                    ac_fn_c_check_header_mongrel "$LINENO" "libusbhid.h" "ac_cv_header_libusbhid_h" "$ac_includes_default"
-if test "x$ac_cv_header_libusbhid_h" = xyes; then :
-  USB_CFLAGS="-DHAVE_LIBUSBHID_H"
-fi
-
-
-                    USB_LIBS="$USB_LIBS -lusbhid"
-                else
-                    ac_fn_c_check_header_mongrel "$LINENO" "usb.h" "ac_cv_header_usb_h" "$ac_includes_default"
-if test "x$ac_cv_header_usb_h" = xyes; then :
-  USB_CFLAGS="-DHAVE_USB_H"
-fi
-
-
-                    ac_fn_c_check_header_mongrel "$LINENO" "libusb.h" "ac_cv_header_libusb_h" "$ac_includes_default"
-if test "x$ac_cv_header_libusb_h" = xyes; then :
-  USB_CFLAGS="-DHAVE_LIBUSB_H"
-fi
-
-
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusb" >&5
-$as_echo_n "checking for hid_init in -lusb... " >&6; }
-if ${ac_cv_lib_usb_hid_init+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lusb  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char hid_init ();
-int
-main ()
-{
-return hid_init ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_usb_hid_init=yes
-else
-  ac_cv_lib_usb_hid_init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_hid_init" >&5
-$as_echo "$ac_cv_lib_usb_hid_init" >&6; }
-if test "x$ac_cv_lib_usb_hid_init" = xyes; then :
-  USB_LIBS="$USB_LIBS -lusb"
-fi
-
-                fi
-
-                save_CFLAGS="$CFLAGS"
-                CFLAGS="$CFLAGS $USB_CFLAGS"
-
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usbhid" >&5
-$as_echo_n "checking for usbhid... " >&6; }
-                have_usbhid=no
-                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                  #include <sys/types.h>
-                  #if defined(HAVE_USB_H)
-                  #include <usb.h>
-                  #endif
-                  #ifdef __DragonFly__
-                  # include <bus/usb/usb.h>
-                  # include <bus/usb/usbhid.h>
-                  #else
-                  # include <dev/usb/usb.h>
-                  # include <dev/usb/usbhid.h>
-                  #endif
-                  #if defined(HAVE_USBHID_H)
-                  #include <usbhid.h>
-                  #elif defined(HAVE_LIBUSB_H)
-                  #include <libusb.h>
-                  #elif defined(HAVE_LIBUSBHID_H)
-                  #include <libusbhid.h>
-                  #endif
-
-int
-main ()
-{
-
-                  struct report_desc *repdesc;
-                  struct usb_ctl_report *repbuf;
-                  hid_kind_t hidkind;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-                have_usbhid=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid" >&5
-$as_echo "$have_usbhid" >&6; }
-
-                if test x$have_usbhid = xyes; then
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ucr_data member of usb_ctl_report" >&5
-$as_echo_n "checking for ucr_data member of usb_ctl_report... " >&6; }
-                    have_usbhid_ucr_data=no
-                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                      #include <sys/types.h>
-                      #if defined(HAVE_USB_H)
-                      #include <usb.h>
-                      #endif
-                      #ifdef __DragonFly__
-                      # include <bus/usb/usb.h>
-                      # include <bus/usb/usbhid.h>
-                      #else
-                      # include <dev/usb/usb.h>
-                      # include <dev/usb/usbhid.h>
-                      #endif
-                      #if defined(HAVE_USBHID_H)
-                      #include <usbhid.h>
-                      #elif defined(HAVE_LIBUSB_H)
-                      #include <libusb.h>
-                      #elif defined(HAVE_LIBUSBHID_H)
-                      #include <libusbhid.h>
-                      #endif
-
-int
-main ()
-{
-
-                      struct usb_ctl_report buf;
-                      if (buf.ucr_data) { }
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-                    have_usbhid_ucr_data=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-                    if test x$have_usbhid_ucr_data = xyes; then
-                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
-                    fi
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid_ucr_data" >&5
-$as_echo "$have_usbhid_ucr_data" >&6; }
-
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new usbhid API" >&5
-$as_echo_n "checking for new usbhid API... " >&6; }
-                    have_usbhid_new=no
-                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                      #include <sys/types.h>
-                      #if defined(HAVE_USB_H)
-                      #include <usb.h>
-                      #endif
-                      #ifdef __DragonFly__
-                      #include <bus/usb/usb.h>
-                      #include <bus/usb/usbhid.h>
-                      #else
-                      #include <dev/usb/usb.h>
-                      #include <dev/usb/usbhid.h>
-                      #endif
-                      #if defined(HAVE_USBHID_H)
-                      #include <usbhid.h>
-                      #elif defined(HAVE_LIBUSB_H)
-                      #include <libusb.h>
-                      #elif defined(HAVE_LIBUSBHID_H)
-                      #include <libusbhid.h>
-                      #endif
-
-int
-main ()
-{
-
-                      report_desc_t d;
-                      hid_start_parse(d, 1, 1);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-                    have_usbhid_new=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-                    if test x$have_usbhid_new = xyes; then
-                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
-                    fi
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid_new" >&5
-$as_echo "$have_usbhid_new" >&6; }
-
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct joystick in machine/joystick.h" >&5
-$as_echo_n "checking for struct joystick in machine/joystick.h... " >&6; }
-                    have_machine_joystick=no
-                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                      #include <machine/joystick.h>
-
-int
-main ()
-{
-
-                      struct joystick t;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-                    have_machine_joystick=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-                    if test x$have_machine_joystick = xyes; then
-
-$as_echo "#define SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1" >>confdefs.h
-
-                    fi
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_machine_joystick" >&5
-$as_echo "$have_machine_joystick" >&6; }
-
-
-$as_echo "#define SDL_JOYSTICK_USBHID 1" >>confdefs.h
-
-                    SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
-                    EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
-                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
-                    have_joystick=yes
-                fi
-                CFLAGS="$save_CFLAGS"
-            fi
-        ;;
-    esac
-}
-
-CheckClockGettime()
-{
-    # Check whether --enable-clock_gettime was given.
-if test "${enable_clock_gettime+set}" = set; then :
-  enableval=$enable_clock_gettime;
-else
-  enable_clock_gettime=yes
-fi
-
-    if test x$enable_clock_gettime = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
-$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if ${ac_cv_lib_rt_clock_gettime+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lrt  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char clock_gettime ();
-int
-main ()
-{
-return clock_gettime ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_rt_clock_gettime=yes
-else
-  ac_cv_lib_rt_clock_gettime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
-$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
-  have_clock_gettime=yes
-fi
-
-        if test x$have_clock_gettime = xyes; then
-
-$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
-
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
-        else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lc" >&5
-$as_echo_n "checking for clock_gettime in -lc... " >&6; }
-if ${ac_cv_lib_c_clock_gettime+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char clock_gettime ();
-int
-main ()
-{
-return clock_gettime ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_c_clock_gettime=yes
-else
-  ac_cv_lib_c_clock_gettime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_clock_gettime" >&5
-$as_echo "$ac_cv_lib_c_clock_gettime" >&6; }
-if test "x$ac_cv_lib_c_clock_gettime" = xyes; then :
-  have_clock_gettime=yes
-fi
-
-            if test x$have_clock_gettime = xyes; then
-
-$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
-
-               EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
-            fi
-        fi
-    fi
-}
-
-CheckLinuxVersion()
-{
-    ac_fn_c_check_header_mongrel "$LINENO" "linux/version.h" "ac_cv_header_linux_version_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_version_h" = xyes; then :
-  have_linux_version_h=yes
-fi
-
-
-    if test x$have_linux_version_h = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
-    fi
-}
-
-CheckRPATH()
-{
-    # Check whether --enable-rpath was given.
-if test "${enable_rpath+set}" = set; then :
-  enableval=$enable_rpath;
-else
-  enable_rpath=yes
-fi
-
-}
-
-case "$host" in
-    *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*)
-        case "$host" in
-            *-raspberry-linux*)
-                # Raspberry Pi
-                ARCH=linux
-                RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
-                RPI_LDFLAGS="-L/opt/vc/lib -lbcm_host"
-                CFLAGS="$CFLAGS $RPI_CFLAGS"
-                SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
-                EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
-                SDL_LIBS="$SDL_LIBS $RPI_LDFLAGS"
-
-                if test x$enable_video = xyes; then
-                    SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
-                    $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
-                fi
-                ;;
-            *-*-linux*)         ARCH=linux ;;
-            *-*-uclinux*)       ARCH=linux ;;
-            *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
-            *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
-            *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
-            *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
-            *-*-bsdi*)          ARCH=bsdi ;;
-            *-*-freebsd*)       ARCH=freebsd ;;
-            *-*-dragonfly*)     ARCH=freebsd ;;
-            *-*-netbsd*)        ARCH=netbsd ;;
-            *-*-openbsd*)       ARCH=openbsd ;;
-            *-*-sysv5*)         ARCH=sysv5 ;;
-            *-*-solaris*)       ARCH=solaris ;;
-            *-*-hpux*)          ARCH=hpux ;;
-            *-*-aix*)           ARCH=aix ;;
-            *-*-minix*)         ARCH=minix ;;
-        esac
-        CheckVisibilityHidden
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckDLOPEN
-        CheckOSS
-        CheckALSA
-        CheckPulseAudio
-        CheckARTSC
-        CheckESD
-        CheckNAS
-        CheckSNDIO
-        CheckX11
-        CheckDirectFB
-        CheckFusionSound
-        CheckOpenGLX11
-        CheckOpenGLESX11
-        CheckLibUDev
-        CheckDBus
-        CheckInputEvents
-        CheckInputKD
-        CheckTslib
-        CheckUSBHID
-        CheckPTHREAD
-        CheckClockGettime
-        CheckLinuxVersion
-        CheckRPATH
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-          case $ARCH in
-            sysv5|solaris|hpux)
-
-$as_echo "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
-                have_audio=yes
-            ;;
-            netbsd)  # Don't use this on OpenBSD, it's busted.
-
-$as_echo "#define SDL_AUDIO_DRIVER_BSD 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
-                have_audio=yes
-            ;;
-            aix)
-
-$as_echo "#define SDL_AUDIO_DRIVER_PAUDIO 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
-                have_audio=yes
-            ;;
-          esac
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-          case $ARCH in
-            linux)
-
-$as_echo "#define SDL_JOYSTICK_LINUX 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
-                have_joystick=yes
-            ;;
-          esac
-        fi
-        # Set up files for the haptic library
-        if test x$enable_haptic = xyes; then
-           if test x$use_input_events = xyes; then
-             case $ARCH in
-               linux)
-
-$as_echo "#define SDL_HAPTIC_LINUX 1" >>confdefs.h
-
-                   SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
-                   have_haptic=yes
-               ;;
-             esac
-           fi
-        fi
-        # Set up files for the power library
-        if test x$enable_power = xyes; then
-             case $ARCH in
-               linux)
-
-$as_echo "#define SDL_POWER_LINUX 1" >>confdefs.h
-
-                   SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
-                   have_power=yes
-               ;;
-             esac
-        fi
-        # Set up files for the filesystem library
-        if test x$enable_filesystem = xyes; then
-
-$as_echo "#define SDL_FILESYSTEM_UNIX 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
-            have_filesystem=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-
-$as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
-            have_timers=yes
-        fi
-        # Set up files for udev hotplugging support
-        if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
-            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"
-        fi
-        # Set up files for evdev input
-        if test x$use_input_events = xyes; then
-            SOURCES="$SOURCES $srcdir/src/input/evdev/*.c"
-        fi
-        ;;
-    *-*-cygwin* | *-*-mingw32*)
-        ARCH=win32
-        if test "$build" != "$host"; then # cross-compiling
-            # Default cross-compile location
-            ac_default_prefix=/usr/local/cross-tools/$host
-        else
-            # Look for the location of the tools and install there
-            if test "$BUILD_PREFIX" != ""; then
-                ac_default_prefix=$BUILD_PREFIX
-            fi
-        fi
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckWINDOWS
-        CheckWINDOWSGL
-        CheckDIRECTX
-
-        # Set up the core platform files
-        SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
-
-        # Set up files for the video library
-        if test x$enable_video = xyes; then
-
-$as_echo "#define SDL_VIDEO_DRIVER_WINDOWS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
-            have_video=yes
-            # Check whether --enable-render-d3d was given.
-if test "${enable_render_d3d+set}" = set; then :
-  enableval=$enable_render_d3d;
-else
-  enable_render_d3d=yes
-fi
-
-            if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
-
-$as_echo "#define SDL_VIDEO_RENDER_D3D 1" >>confdefs.h
-
-            fi
-        fi
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-
-$as_echo "#define SDL_AUDIO_DRIVER_WINMM 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
-            if test x$have_dsound = xyes; then
-
-$as_echo "#define SDL_AUDIO_DRIVER_DSOUND 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
-            fi
-            if test x$have_xaudio2 = xyes; then
-
-$as_echo "#define SDL_AUDIO_DRIVER_XAUDIO2 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
-            fi
-            have_audio=yes
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-            if test x$have_dinput = xyes; then
-
-$as_echo "#define SDL_JOYSTICK_DINPUT 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/joystick/windows/SDL_dxjoystick.c"
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
-            else
-
-$as_echo "#define SDL_JOYSTICK_WINMM 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/joystick/windows/SDL_mmjoystick.c"
-            fi
-            have_joystick=yes
-        fi
-        if test x$enable_haptic = xyes; then
-            if test x$have_dinput = xyes; then
-
-$as_echo "#define SDL_HAPTIC_DINPUT 1" >>confdefs.h
-
-                SOURCES="$SOURCES $srcdir/src/haptic/windows/SDL_syshaptic.c"
-                have_haptic=yes
-            fi
-        fi
-        if test x$enable_power = xyes; then
-
-$as_echo "#define SDL_POWER_WINDOWS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
-            have_power=yes
-        fi
-        if test x$enable_filesystem = xyes; then
-
-$as_echo "#define SDL_FILESYSTEM_WINDOWS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
-            have_filesystem=yes
-        fi
-        # Set up files for the thread library
-        if test x$enable_threads = xyes; then
-
-$as_echo "#define SDL_THREAD_WINDOWS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/thread/windows/*.c"
-            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
-            have_threads=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-
-$as_echo "#define SDL_TIMER_WINDOWS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/timer/windows/*.c"
-            have_timers=yes
-        fi
-        # Set up files for the shared object loading library
-        if test x$enable_loadso = xyes; then
-
-$as_echo "#define SDL_LOADSO_WINDOWS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
-            have_loadso=yes
-        fi
-        # Set up the system libraries we need
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -XCClinker -static-libgcc"
-        # The Windows platform requires special setup
-        VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
-        SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
-        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
-        SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
-
-        # Check to see if this is a mingw or cygwin build
-        have_mingw32=
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmingw32" >&5
-$as_echo_n "checking for main in -lmingw32... " >&6; }
-if ${ac_cv_lib_mingw32_main+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmingw32  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_mingw32_main=yes
-else
-  ac_cv_lib_mingw32_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mingw32_main" >&5
-$as_echo "$ac_cv_lib_mingw32_main" >&6; }
-if test "x$ac_cv_lib_mingw32_main" = xyes; then :
-  have_mingw32=yes
-fi
-
-        if test x$have_mingw32 = xyes; then
-            SDL_LIBS="-lmingw32 $SDL_LIBS"
-        else
-            SDL_LIBS="-lcygwin $SDL_LIBS"
-        fi
-        ;;
-    *-*-beos* | *-*-haiku*)
-        ARCH=beos
-        ac_default_prefix=/boot/common
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckBWINDOW
-        CheckBeGL
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-
-$as_echo "#define SDL_AUDIO_DRIVER_BEOSAUDIO 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
-            have_audio=yes
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-
-$as_echo "#define SDL_JOYSTICK_BEOS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
-            have_joystick=yes
-        fi
-        # Set up files for the thread library
-        if test x$enable_threads = xyes; then
-
-$as_echo "#define SDL_THREAD_BEOS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
-            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
-            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
-            have_threads=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-
-$as_echo "#define SDL_TIMER_BEOS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
-            have_timers=yes
-        fi
-        # Set up files for the shared object loading library
-        if test x$enable_loadso = xyes; then
-
-$as_echo "#define SDL_LOADSO_BEOS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
-            have_loadso=yes
-        fi
-        # Set up files for the system power library
-        if test x$enable_power = xyes; then
-
-$as_echo "#define SDL_POWER_BEOS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/power/beos/*.c"
-            have_power=yes
-        fi
-        # Set up files for the system filesystem library
-        if test x$enable_filesystem = xyes; then
-
-$as_echo "#define SDL_FILESYSTEM_BEOS 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/filesystem/beos/*.cc"
-            have_filesystem=yes
-        fi
-        # The BeOS platform requires special setup.
-        SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
-        ;;
-    arm*-apple-darwin*)
-        # iOS - We are not writing anything to confdefs.h because you have to replace
-        # SDL_config.h for SDL_config_iphoneos.h anyway
-        ARCH=ios
-
-        CheckVisibilityHidden
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckDLOPEN
-        CheckCOCOA
-        CheckPTHREAD
-
-
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c"
-            have_audio=yes
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-            SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
-            have_joystick=yes
-        fi
-        # Set up files for the haptic library
-        #if test x$enable_haptic = xyes; then
-        #    SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
-        #    have_haptic=yes
-        #    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
-        #fi
-        # Set up files for the power library
-        if test x$enable_power = xyes; then
-            SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
-            have_power=yes
-        fi
-        # Set up files for the filesystem library
-        if test x$enable_filesystem = xyes; then
-            SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
-            have_filesystem=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
-            have_timers=yes
-        fi
-        # Set up additional files for the file library
-        if test x$enable_file = xyes; then
-            SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
-        fi
-        # The iOS platform requires special setup.
-        SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics"
-        ;;
-    *-*-darwin* )
-        # This could be either full "Mac OS X", or plain "Darwin" which is
-        # just the OS X kernel sans upper layers like Carbon and Cocoa.
-        # Next line is broken, and a few files below require Mac OS X (full)
-        ARCH=macosx
-
-        # Mac OS X builds with both the Carbon and OSX APIs at the moment
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
-
-        CheckVisibilityHidden
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckDLOPEN
-        CheckCOCOA
-        CheckX11
-        CheckMacGL
-        CheckOpenGLX11
-        CheckPTHREAD
-
-        # Good optimization on Mac OS X, yes...
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -falign-loops=16"
-
-        # Need this or things might misbuild on a G3.
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
-
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-
-$as_echo "#define SDL_AUDIO_DRIVER_COREAUDIO 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c"
-            have_audio=yes
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-
-$as_echo "#define SDL_JOYSTICK_IOKIT 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
-            have_joystick=yes
-        fi
-        # Set up files for the haptic library
-        if test x$enable_haptic = xyes; then
-
-$as_echo "#define SDL_HAPTIC_IOKIT 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
-            have_haptic=yes
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
-        fi
-        # Set up files for the power library
-        if test x$enable_power = xyes; then
-
-$as_echo "#define SDL_POWER_MACOSX 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
-            have_power=yes
-        fi
-        # Set up files for the filesystem library
-        if test x$enable_filesystem = xyes; then
-
-$as_echo "#define SDL_FILESYSTEM_COCOA 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
-            have_filesystem=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-
-$as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h
-
-            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
-            have_timers=yes
-        fi
-        # Set up additional files for the file library
-        if test x$enable_file = xyes; then
-            SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
-        fi
-        # The Mac OS X platform requires special setup.
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
-        # If audio is used, add the AudioUnit framework
-        if test x$enable_audio = xyes; then
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
-        fi
-        ;;
-    *)
-        as_fn_error $? "
-*** Unsupported host:  Please add to configure.in
-        " "$LINENO" 5
-        ;;
-esac
-
-CheckWarnAll
-
-# Verify that we have all the platform specific files we need
-
-if test x$have_joystick != xyes; then
-    if test x$enable_joystick = xyes; then
-
-$as_echo "#define SDL_JOYSTICK_DISABLED 1" >>confdefs.h
-
-    fi
-    SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
-fi
-if test x$have_haptic != xyes; then
-    if test x$enable_haptic = xyes; then
-
-$as_echo "#define SDL_HAPTIC_DISABLED 1" >>confdefs.h
-
-    fi
-    SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
-fi
-if test x$have_threads != xyes; then
-    if test x$enable_threads = xyes; then
-
-$as_echo "#define SDL_THREADS_DISABLED 1" >>confdefs.h
-
-    fi
-    SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
-fi
-if test x$have_timers != xyes; then
-    if test x$enable_timers = xyes; then
-
-$as_echo "#define SDL_TIMERS_DISABLED 1" >>confdefs.h
-
-    fi
-    SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
-fi
-if test x$have_filesystem != xyes; then
-    if test x$enable_filesystem = xyes; then
-
-$as_echo "#define SDL_FILESYSTEM_DISABLED 1" >>confdefs.h
-
-    fi
-    SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
-fi
-if test x$have_loadso != xyes; then
-    if test x$enable_loadso = xyes; then
-
-$as_echo "#define SDL_LOADSO_DISABLED 1" >>confdefs.h
-
-    fi
-    SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
-fi
-if test x$SDLMAIN_SOURCES = x; then
-    SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
-fi
-SDLTEST_SOURCES="$srcdir/src/test/*.c"
-
-OBJECTS=`echo $SOURCES`
-DEPENDS=`echo $SOURCES | tr ' ' '\n'`
-for EXT in asm cc m c S; do
-    OBJECTS=`echo "$OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.'$EXT',$(objects)/\1.lo,g'`
-    DEPENDS=`echo "$DEPENDS" | sed "s,^\\([^ ]*\\)/\\([^ ]*\\)\\.$EXT\\$,\\\\
-\\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
-	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
-done
-
-VERSION_OBJECTS=`echo $VERSION_SOURCES`
-VERSION_DEPENDS=`echo $VERSION_SOURCES`
-VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.rc,$(objects)/\1.o,g'`
-VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.rc,\\\\
-\\$(objects)/\\2.o: \\1/\\2.rc\\\\
-	\\$(WINDRES) \\$< \\$@,g"`
-
-SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
-SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
-SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.c,$(objects)/\1.o,g'`
-SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.c,\\\\
-\\$(objects)/\\2.o: \\1/\\2.c\\\\
-	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
-
-SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
-SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
-SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.c,$(objects)/\1.o,g'`
-SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.c,\\\\
-\\$(objects)/\\2.o: \\1/\\2.c\\\\
-	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
-
-# Set runtime shared library paths as needed
-
-if test "x$enable_rpath" = "xyes"; then
-  if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
-    SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
-  fi
-  if test $ARCH = solaris; then
-    SDL_RLD_FLAGS="-R\${libdir}"
-  fi
-else
-  SDL_RLD_FLAGS=""
-fi
-
-SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
-
-
-
-
-
-if test x$enable_shared = xyes; then
-    ENABLE_SHARED_TRUE=
-    ENABLE_SHARED_FALSE="#"
-else
-    ENABLE_SHARED_TRUE="#"
-    ENABLE_SHARED_FALSE=
-fi
-if test x$enable_static = xyes; then
-    ENABLE_STATIC_TRUE=
-    ENABLE_STATIC_FALSE="#"
-else
-    ENABLE_STATIC_TRUE="#"
-    ENABLE_STATIC_FALSE=
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-cat >Makefile.rules <<__EOF__
-
-# Build rules for objects
--include \$(OBJECTS:.lo=.d)
-
-# Special dependency for SDL.c, since it depends on SDL_revision.h
-$srcdir/src/SDL.c: update-revision
-$DEPENDS
-$VERSION_DEPENDS
-$SDLMAIN_DEPENDS
-$SDLTEST_DEPENDS
-__EOF__
-
-ac_config_files="$ac_config_files Makefile:Makefile.in:Makefile.rules sdl2-config SDL2.spec sdl2.pc"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
-  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
-      esac ;;
-    esac
-  done
-
-  (set) 2>&1 |
-    case $as_nl`(ac_space=' '; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      # `set' does not quote correctly, so add quotes: double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \.
-      sed -n \
-	"s/'/'\\\\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;; #(
-    *)
-      # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-) |
-  sed '
-     /^ac_cv_env_/b end
-     t clear
-     :clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
-     t end
-     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
-  if test -w "$cache_file"; then
-    if test "x$cache_file" != "x/dev/null"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
-      if test ! -f "$cache_file" || test -h "$cache_file"; then
-	cat confcache >"$cache_file"
-      else
-        case $cache_file in #(
-        */* | ?:*)
-	  mv -f confcache "$cache_file"$$ &&
-	  mv -f "$cache_file"$$ "$cache_file" ;; #(
-        *)
-	  mv -f confcache "$cache_file" ;;
-	esac
-      fi
-    fi
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-  fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
-  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
-  #    will be set to the directory where LIBOBJS objects are built.
-  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -pR'
-  fi
-else
-  as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration.  Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number and configuration settings, then exit
-      --config     print configuration, then exit
-  -q, --quiet, --silent
-                   do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-      --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
-      --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.69,
-  with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=?*)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  --*=)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=
-    ac_shift=:
-    ;;
-  *)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    $as_echo "$ac_cs_version"; exit ;;
-  --config | --confi | --conf | --con | --co | --c )
-    $as_echo "$ac_cs_config"; exit ;;
-  --debug | --debu | --deb | --de | --d | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    '') as_fn_error $? "missing file argument" ;;
-    esac
-    as_fn_append CONFIG_FILES " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --he | --h)
-    # Conflict between --help and --header
-    as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
-  --help | --hel | -h )
-    $as_echo "$ac_cs_usage"; exit ;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
-  *) as_fn_append ac_config_targets " $1"
-     ac_need_defaults=false ;;
-
-  esac
-  shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
-  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-  shift
-  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
-  CONFIG_SHELL='$SHELL'
-  export CONFIG_SHELL
-  exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-  $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
-AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`'
-DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
-enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
-SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
-ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
-PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
-host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
-host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
-host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
-build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
-build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
-build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
-SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
-Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
-GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
-EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
-FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
-LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
-NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
-LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
-exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
-AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
-STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
-lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
-CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
-compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
-GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
-objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
-need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
-LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
-libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
-version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
-install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
-striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
-predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
-postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
-predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
-postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
-LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
-reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
-reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
-GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
-inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
-always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
-include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
-prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
-predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
-postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
-predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
-postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
-
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in AS \
-DLLTOOL \
-OBJDUMP \
-SHELL \
-ECHO \
-PATH_SEPARATOR \
-SED \
-GREP \
-EGREP \
-FGREP \
-LD \
-NM \
-LN_S \
-lt_SP2NL \
-lt_NL2SP \
-reload_flag \
-deplibs_check_method \
-file_magic_cmd \
-file_magic_glob \
-want_nocaseglob \
-sharedlib_from_linklib_cmd \
-AR \
-AR_FLAGS \
-archiver_list_spec \
-STRIP \
-RANLIB \
-CC \
-CFLAGS \
-compiler \
-lt_cv_sys_global_symbol_pipe \
-lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_c_name_address \
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-nm_file_list_spec \
-lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_pic \
-lt_prog_compiler_wl \
-lt_prog_compiler_static \
-lt_cv_prog_compiler_c_o \
-need_locks \
-MANIFEST_TOOL \
-DSYMUTIL \
-NMEDIT \
-LIPO \
-OTOOL \
-OTOOL64 \
-shrext_cmds \
-export_dynamic_flag_spec \
-whole_archive_flag_spec \
-compiler_needs_object \
-with_gnu_ld \
-allow_undefined_flag \
-no_undefined_flag \
-hardcode_libdir_flag_spec \
-hardcode_libdir_separator \
-exclude_expsyms \
-include_expsyms \
-file_list_spec \
-variables_saved_for_relink \
-libname_spec \
-library_names_spec \
-soname_spec \
-install_override_mode \
-finish_eval \
-old_striplib \
-striplib \
-compiler_lib_search_dirs \
-predep_objects \
-postdep_objects \
-predeps \
-postdeps \
-compiler_lib_search_path \
-LD_CXX \
-reload_flag_CXX \
-compiler_CXX \
-lt_prog_compiler_no_builtin_flag_CXX \
-lt_prog_compiler_pic_CXX \
-lt_prog_compiler_wl_CXX \
-lt_prog_compiler_static_CXX \
-lt_cv_prog_compiler_c_o_CXX \
-export_dynamic_flag_spec_CXX \
-whole_archive_flag_spec_CXX \
-compiler_needs_object_CXX \
-with_gnu_ld_CXX \
-allow_undefined_flag_CXX \
-no_undefined_flag_CXX \
-hardcode_libdir_flag_spec_CXX \
-hardcode_libdir_separator_CXX \
-exclude_expsyms_CXX \
-include_expsyms_CXX \
-file_list_spec_CXX \
-compiler_lib_search_dirs_CXX \
-predep_objects_CXX \
-postdep_objects_CXX \
-predeps_CXX \
-postdeps_CXX \
-compiler_lib_search_path_CXX; do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in reload_cmds \
-old_postinstall_cmds \
-old_postuninstall_cmds \
-old_archive_cmds \
-extract_expsyms_cmds \
-old_archive_from_new_cmds \
-old_archive_from_expsyms_cmds \
-archive_cmds \
-archive_expsym_cmds \
-module_cmds \
-module_expsym_cmds \
-export_symbols_cmds \
-prelink_cmds \
-postlink_cmds \
-postinstall_cmds \
-postuninstall_cmds \
-finish_cmds \
-sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec \
-reload_cmds_CXX \
-old_archive_cmds_CXX \
-old_archive_from_new_cmds_CXX \
-old_archive_from_expsyms_cmds_CXX \
-archive_cmds_CXX \
-archive_expsym_cmds_CXX \
-module_cmds_CXX \
-module_expsym_cmds_CXX \
-export_symbols_cmds_CXX \
-prelink_cmds_CXX \
-postlink_cmds_CXX; do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
-    *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
-    RM='$RM'
-    ofile='$ofile'
-
-
-
-
-
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
-  case $ac_config_target in
-    "include/SDL_config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/SDL_config.h" ;;
-    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:Makefile.in:Makefile.rules" ;;
-    "sdl2-config") CONFIG_FILES="$CONFIG_FILES sdl2-config" ;;
-    "SDL2.spec") CONFIG_FILES="$CONFIG_FILES SDL2.spec" ;;
-    "sdl2.pc") CONFIG_FILES="$CONFIG_FILES sdl2.pc" ;;
-
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
-  esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
-  tmp= ac_tmp=
-  trap 'exit_status=$?
-  : "${ac_tmp:=$tmp}"
-  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
-  trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
-  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -d "$tmp"
-}  ||
-{
-  tmp=./conf$$-$RANDOM
-  (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
-  eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\\r'
-else
-  ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
-  echo "cat >conf$$subs.awk <<_ACEOF" &&
-  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
-  echo "_ACEOF"
-} >conf$$subs.sh ||
-  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  . ./conf$$subs.sh ||
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
-  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
-  if test $ac_delim_n = $ac_delim_num; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
-  N
-  s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
-  for (key in S) S_is_set[key] = 1
-  FS = ""
-
-}
-{
-  line = $ 0
-  nfields = split(line, field, "@")
-  substed = 0
-  len = length(field[1])
-  for (i = 2; i < nfields; i++) {
-    key = field[i]
-    keylen = length(key)
-    if (S_is_set[key]) {
-      value = S[key]
-      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
-      len += length(value) + length(field[++i])
-      substed = 1
-    } else
-      len += 1 + keylen
-  }
-
-  print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
-  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
-  cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
-  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
-h
-s///
-s/^/:/
-s/[	 ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[	 ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[	 ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
-  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_tt"; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any.  Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  for (key in D) D_is_set[key] = 1
-  FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
-  line = \$ 0
-  split(line, arg, " ")
-  if (arg[1] == "#") {
-    defundef = arg[2]
-    mac1 = arg[3]
-  } else {
-    defundef = substr(arg[1], 2)
-    mac1 = arg[2]
-  }
-  split(mac1, mac2, "(") #)
-  macro = mac2[1]
-  prefix = substr(line, 1, index(line, defundef) - 1)
-  if (D_is_set[macro]) {
-    # Preserve the white space surrounding the "#".
-    print prefix "define", macro P[macro] D[macro]
-    next
-  } else {
-    # Replace #undef with comments.  This is necessary, for example,
-    # in the case of _POSIX_SOURCE, which is predefined and required
-    # on some systems where configure will not decide to define it.
-    if (defundef == "undef") {
-      print "/*", prefix defundef, macro, "*/"
-      next
-    }
-  }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
-  case $ac_tag in
-  :[FHLC]) ac_mode=$ac_tag; continue;;
-  esac
-  case $ac_mode$ac_tag in
-  :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
-  :[FH]-) ac_tag=-:-;;
-  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
-  esac
-  ac_save_IFS=$IFS
-  IFS=:
-  set x $ac_tag
-  IFS=$ac_save_IFS
-  shift
-  ac_file=$1
-  shift
-
-  case $ac_mode in
-  :L) ac_source=$1;;
-  :[FH])
-    ac_file_inputs=
-    for ac_f
-    do
-      case $ac_f in
-      -) ac_f="$ac_tmp/stdin";;
-      *) # Look for the file first in the build tree, then in the source tree
-	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
-	 # because $ac_f cannot contain `:'.
-	 test -f "$ac_f" ||
-	   case $ac_f in
-	   [\\/$]*) false;;
-	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
-	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
-      esac
-      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      as_fn_append ac_file_inputs " '$ac_f'"
-    done
-
-    # Let's still pretend it is `configure' which instantiates (i.e., don't
-    # use $as_me), people would be surprised to read:
-    #    /* config.h.  Generated by config.status.  */
-    configure_input='Generated from '`
-	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
-	`' by configure.'
-    if test x"$ac_file" != x-; then
-      configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
-    fi
-    # Neutralize special characters interpreted by sed in replacement strings.
-    case $configure_input in #(
-    *\&* | *\|* | *\\* )
-       ac_sed_conf_input=`$as_echo "$configure_input" |
-       sed 's/[\\\\&|]/\\\\&/g'`;; #(
-    *) ac_sed_conf_input=$configure_input;;
-    esac
-
-    case $ac_tag in
-    *:-:* | *:-) cat >"$ac_tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
-    esac
-    ;;
-  esac
-
-  ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  as_dir="$ac_dir"; as_fn_mkdir_p
-  ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
-  case $ac_mode in
-  :F)
-  #
-  # CONFIG_FILE
-  #
-
-  case $INSTALL in
-  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
-  esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
-  p
-  q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  ac_datarootdir_hack='
-  s&@datadir@&$datadir&g
-  s&@docdir@&$docdir&g
-  s&@infodir@&$infodir&g
-  s&@localedir@&$localedir&g
-  s&@mandir@&$mandir&g
-  s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
-  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
-      "$ac_tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&2;}
-
-  rm -f "$ac_tmp/stdin"
-  case $ac_file in
-  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
-  esac \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-  :H)
-  #
-  # CONFIG_HEADER
-  #
-  if test x"$ac_file" != x-; then
-    {
-      $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
-    } >"$ac_tmp/config.h" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
-    else
-      rm -f "$ac_file"
-      mv "$ac_tmp/config.h" "$ac_file" \
-	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    fi
-  else
-    $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error $? "could not create -" "$LINENO" 5
-  fi
- ;;
-
-  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
-  esac
-
-
-  case $ac_file$ac_mode in
-    "libtool":C)
-
-    # See if we are running on zsh, and set the options which allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile="${ofile}T"
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags="CXX "
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Which release of libtool.m4 was used?
-macro_version=$macro_version
-macro_revision=$macro_revision
-
-# Assembler program.
-AS=$lt_AS
-
-# DLL creation program.
-DLLTOOL=$lt_DLLTOOL
-
-# Object dumper program.
-OBJDUMP=$lt_OBJDUMP
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# What type of objects to build.
-pic_mode=$pic_mode
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# An echo program that protects backslashes.
-ECHO=$lt_ECHO
-
-# The PATH separator for the build system.
-PATH_SEPARATOR=$lt_PATH_SEPARATOR
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="\$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP=$lt_GREP
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# A literal string matcher.
-FGREP=$lt_FGREP
-
-# A BSD- or MS-compatible name lister.
-NM=$lt_NM
-
-# Whether we need soft or hard links.
-LN_S=$lt_LN_S
-
-# What is the maximum length of a command?
-max_cmd_len=$max_cmd_len
-
-# Object file suffix (normally "o").
-objext=$ac_objext
-
-# Executable file suffix (normally "").
-exeext=$exeext
-
-# whether the shell understands "unset".
-lt_unset=$lt_unset
-
-# turn spaces into newlines.
-SP2NL=$lt_lt_SP2NL
-
-# turn newlines into spaces.
-NL2SP=$lt_lt_NL2SP
-
-# convert \$build file names to \$host format.
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-
-# convert \$build files to toolchain format.
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method = "file_magic".
-file_magic_cmd=$lt_file_magic_cmd
-
-# How to find potential files when deplibs_check_method = "file_magic".
-file_magic_glob=$lt_file_magic_glob
-
-# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-want_nocaseglob=$lt_want_nocaseglob
-
-# Command to associate shared and link libraries.
-sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-
-# The archiver.
-AR=$lt_AR
-
-# Flags to create an archive.
-AR_FLAGS=$lt_AR_FLAGS
-
-# How to feed a file listing to the archiver.
-archiver_list_spec=$lt_archiver_list_spec
-
-# A symbol stripping program.
-STRIP=$lt_STRIP
-
-# Commands used to install an old-style archive.
-RANLIB=$lt_RANLIB
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=$lock_old_archive_extraction
-
-# A C compiler.
-LTCC=$lt_CC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_CFLAGS
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-
-# Specify filename containing input files for \$NM.
-nm_file_list_spec=$lt_nm_file_list_spec
-
-# The root where to search for dependent libraries,and in which our libraries should be installed.
-lt_sysroot=$lt_sysroot
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=$MAGIC_CMD
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Manifest tool.
-MANIFEST_TOOL=$lt_MANIFEST_TOOL
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=$lt_DSYMUTIL
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=$lt_NMEDIT
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=$lt_LIPO
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=$lt_OTOOL
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=$lt_OTOOL64
-
-# Old archive suffix (normally "a").
-libext=$libext
-
-# Shared library suffix (normally ".so").
-shrext_cmds=$lt_shrext_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink=$lt_variables_saved_for_relink
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Library versioning type.
-version_type=$version_type
-
-# Shared library runtime path variable.
-runpath_var=$runpath_var
-
-# Shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=$lt_install_override_mode
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=$lt_postinstall_cmds
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=$lt_finish_eval
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds
-
-# A language specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects
-postdep_objects=$lt_postdep_objects
-predeps=$lt_predeps
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" \
-     || (rm -f "$cfgfile"; exit 1)
-
-  if test x"$xsi_shell" = xyes; then
-  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\    # positional parameters, so assign one to ordinary parameter first.\
-\    func_stripname_result=${3}\
-\    func_stripname_result=${func_stripname_result#"${1}"}\
-\    func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\    func_split_long_opt_name=${1%%=*}\
-\    func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\    func_split_short_opt_arg=${1#??}\
-\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\    case ${1} in\
-\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\      *)    func_lo2o_result=${1} ;;\
-\    esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
-    func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
-    func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
-    func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
-    eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\    func_quote_for_eval "${2}"\
-\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
-   mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-
-
-    cat <<_LT_EOF >> "$ofile"
-
-# ### BEGIN LIBTOOL TAG CONFIG: CXX
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag_CXX
-reload_cmds=$lt_reload_cmds_CXX
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds_CXX
-
-# A language specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object_CXX
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld_CXX
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute_CXX
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath_CXX
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds_CXX
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds_CXX
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec_CXX
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects_CXX
-postdep_objects=$lt_postdep_objects_CXX
-predeps=$lt_predeps_CXX
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# ### END LIBTOOL TAG CONFIG: CXX
-_LT_EOF
-
- ;;
-
-  esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
-  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded.  So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status.  When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
-  ac_cs_success=:
-  ac_config_status_args=
-  test "$silent" = yes &&
-    ac_config_status_args="$ac_config_status_args --quiet"
-  exec 5>/dev/null
-  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
-  exec 5>>config.log
-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
-  # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
-chmod a+x sdl2-config
diff --git a/deps/SDL2/configure.in b/deps/SDL2/configure.in
deleted file mode 100644
index 5c56f00..0000000
--- a/deps/SDL2/configure.in
+++ /dev/null
@@ -1,2964 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(README.txt)
-AC_CONFIG_HEADER(include/SDL_config.h)
-AC_CONFIG_AUX_DIR(build-scripts)
-AC_CONFIG_MACRO_DIR([acinclude])
-
-dnl Save the CFLAGS to see whether they were passed in or generated
-orig_CFLAGS="$CFLAGS"
-
-dnl Set various version strings - taken gratefully from the GTk sources
-#
-# Making releases:
-# Edit include/SDL_version.h and change the version, then:
-#   SDL_MICRO_VERSION += 1;
-#   SDL_INTERFACE_AGE += 1;
-#   SDL_BINARY_AGE += 1;
-# if any functions have been added, set SDL_INTERFACE_AGE to 0.
-# if backwards compatibility has been broken,
-# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
-#
-SDL_MAJOR_VERSION=2
-SDL_MINOR_VERSION=0
-SDL_MICRO_VERSION=1
-SDL_INTERFACE_AGE=0
-SDL_BINARY_AGE=1
-SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
-
-AC_SUBST(SDL_MAJOR_VERSION)
-AC_SUBST(SDL_MINOR_VERSION)
-AC_SUBST(SDL_MICRO_VERSION)
-AC_SUBST(SDL_INTERFACE_AGE)
-AC_SUBST(SDL_BINARY_AGE)
-AC_SUBST(SDL_VERSION)
-
-# libtool versioning
-LT_INIT([win32-dll])
-
-LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
-LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
-LT_REVISION=$SDL_INTERFACE_AGE
-LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
-m4_pattern_allow([^LT_])
-
-AC_SUBST(LT_RELEASE)
-AC_SUBST(LT_CURRENT)
-AC_SUBST(LT_REVISION)
-AC_SUBST(LT_AGE)
-
-dnl Detect the canonical build and host environments
-dnl AC_CANONICAL_HOST
-
-dnl Check for tools
-AC_PROG_LIBTOOL
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
-AC_CHECK_TOOL(WINDRES, [windres], [:])
-
-dnl Make sure that srcdir is a full pathname
-case "$host" in
-    *-*-mingw32*)
-        # Except on msys, where make can't handle full pathnames (bug 1972)
-        ;;
-    *)
-        srcdir=`cd $srcdir && pwd`
-        ;;
-esac
-
-dnl Set up the compiler and linker flags
-INCLUDE="-I$srcdir/include"
-if test x$srcdir != x.; then
-    INCLUDE="-Iinclude $INCLUDE"
-elif test -d .hg; then
-    AC_MSG_ERROR([
-*** When building from Mercurial you should configure and build in a
-    separate directory so you don't clobber SDL_config.h, SDL_revision.h
-])
-fi
-BASE_CFLAGS=""
-BASE_LDFLAGS=""
-case "$host" in
-    *-*-cygwin*)
-        # We build SDL on cygwin without the UNIX emulation layer
-        save_CFLAGS="$CFLAGS"
-        have_no_cygwin=no
-        AC_MSG_CHECKING(for GCC -mno-cygwin option)
-        CFLAGS="$save_CFLAGS -mno-cygwin"
-
-        AC_TRY_COMPILE([
-        ],[
-        ],[
-        have_no_cygwin=yes
-        ])
-        AC_MSG_RESULT($have_no_cygwin)
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_no_cygwin = xyes; then
-            BASE_CFLAGS="-mno-cygwin"
-            BASE_LDFLAGS="-mno-cygwin"
-        fi
-        BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
-        ;;
-esac
-# Uncomment the following line if you want to force SDL and applications
-# built with it to be compiled for a particular architecture.
-#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]")
-BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H"
-# The default optimization for SDL is -O3 (Bug #31)
-if test "x$orig_CFLAGS" = x; then
-    BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'`
-fi
-EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
-BUILD_LDFLAGS="$LDFLAGS"
-EXTRA_LDFLAGS="$BASE_LDFLAGS"
-## These are common directories to find software packages
-#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
-#    if test -d $path/include; then
-#        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
-#    fi
-#    if test -d $path/lib; then
-#        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
-#    fi
-#done
-SDL_CFLAGS="$BASE_CFLAGS"
-SDL_LIBS="-lSDL2 $BASE_LDFLAGS"
-CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
-CFLAGS="$CFLAGS $EXTRA_CFLAGS"
-LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
-
-dnl set this to use on systems that use lib64 instead of lib
-base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
-
-dnl Function to find a library in the compiler search path
-find_lib()
-{
-    gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
-    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
-    env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
-    if test "$cross_compiling" = yes; then
-        host_lib_path=""
-    else
-        host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
-    fi
-    for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
-        lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
-        if test x$lib != x; then
-            echo $lib
-            return
-        fi
-    done
-}
-
-dnl Check for compiler characteristics
-AC_C_CONST
-AC_C_INLINE
-AC_C_VOLATILE
-
-dnl See whether we want assertions for debugging/sanity checking SDL itself.
-AC_ARG_ENABLE(assertions,
-AC_HELP_STRING([--enable-assertions],
-               [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]),
-              , enable_assertions=auto)
-case "$enable_assertions" in
-    auto) # Use optimization settings to determine assertion level
-        ;;
-    disabled)
-        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ])
-        ;;
-    release)
-        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ])
-        ;;
-    enabled)
-        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ])
-        ;;
-    paranoid)
-        AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ])
-        ;;
-    *)
-        AC_MSG_ERROR([*** unknown assertion level. stop.])
-        ;;
-esac
-
-dnl See whether we can use gcc style dependency tracking
-AC_ARG_ENABLE(dependency-tracking,
-AC_HELP_STRING([--enable-dependency-tracking],
-               [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
-              , enable_dependency_tracking=yes)
-if test x$enable_dependency_tracking = xyes; then
-    have_gcc_mmd_mt=no
-    AC_MSG_CHECKING(for GCC -MMD -MT option)
-    AC_TRY_COMPILE([
-    #if !defined(__GNUC__) || __GNUC__ < 3
-    #error Dependency tracking requires GCC 3.0 or newer
-    #endif
-    ],[
-    ],[
-    have_gcc_mmd_mt=yes
-    ])
-    AC_MSG_RESULT($have_gcc_mmd_mt)
-
-    if test x$have_gcc_mmd_mt = xyes; then
-        DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
-    fi
-fi
-
-# Actually this doesn't work on OpenBSD and BeOS
-#AC_MSG_CHECKING(for linker option --no-undefined)
-#have_no_undefined=no
-#save_LDFLAGS="$LDFLAGS"
-#LDFLAGS="$LDFLAGS -Wl,--no-undefined"
-#AC_TRY_LINK([
-#],[
-#],[
-#have_no_undefined=yes
-#EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
-#])
-#LDFLAGS="$save_LDFLAGS"
-#AC_MSG_RESULT($have_no_undefined)
-
-dnl See whether we are allowed to use the system C library
-AC_ARG_ENABLE(libc,
-AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
-              , enable_libc=yes)
-if test x$enable_libc = xyes; then
-    AC_DEFINE(HAVE_LIBC, 1, [ ])
-
-    dnl Check for C library headers
-    AC_HEADER_STDC
-    AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h)
-
-    dnl Check for typedefs, structures, etc.
-    AC_TYPE_SIZE_T
-
-    dnl Check for defines
-    AC_CHECK_DEFINE(M_PI, math.h)
-
-    dnl Checks for library functions.
-    case "$host" in
-    *-*-cygwin* | *-*-mingw32*)
-        ;;
-    *)
-        AC_FUNC_ALLOCA
-        ;;
-    esac
-
-    AC_FUNC_MEMCMP
-    if test x$ac_cv_func_memcmp_working = xyes; then
-        AC_DEFINE(HAVE_MEMCMP, 1, [ ])
-    fi
-    AC_FUNC_STRTOD
-    if test x$ac_cv_func_strtod = xyes; then
-        AC_DEFINE(HAVE_STRTOD, 1, [ ])
-    fi
-    AC_CHECK_FUNC(mprotect,
-        AC_TRY_COMPILE([
-          #include <sys/types.h>
-          #include <sys/mman.h>
-        ],[
-        ],[
-        AC_DEFINE(HAVE_MPROTECT, 1, [ ])
-        ]),
-    )
-    AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname)
-
-    AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
-    AC_CHECK_FUNCS(atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt)
-
-    AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
-    AC_CHECK_FUNCS(iconv)
-
-    AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
-fi
-
-dnl AC_CHECK_SIZEOF(void*)
-
-dnl See whether we can use gcc atomic operations on this architecture
-AC_ARG_ENABLE(gcc-atomics,
-AC_HELP_STRING([--enable-gcc-atomics],
-               [Use gcc builtin atomics [[default=yes]]]),
-              , enable_gcc_atomics=yes)
-if test x$enable_gcc_atomics = xyes; then
-    have_gcc_atomics=no
-    AC_MSG_CHECKING(for GCC builtin atomic operations)
-    AC_TRY_LINK([
-    ],[
-    int a;
-    void *x, *y, *z;
-    __sync_lock_test_and_set(&a, 4);
-    __sync_lock_test_and_set(&x, y);
-    __sync_fetch_and_add(&a, 1);
-    __sync_bool_compare_and_swap(&a, 5, 10);
-    __sync_bool_compare_and_swap(&x, y, z);
-    ],[
-    have_gcc_atomics=yes
-    ])
-    AC_MSG_RESULT($have_gcc_atomics)
-
-    if test x$have_gcc_atomics = xyes; then
-        AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ])
-    else
-        # See if we have the minimum operation needed for GCC atomics
-        AC_TRY_LINK([
-        ],[
-        int a;
-        __sync_lock_test_and_set(&a, 1);
-        __sync_lock_release(&a);
-        ],[
-        have_gcc_sync_lock_test_and_set=yes
-        ])
-        if test x$have_gcc_sync_lock_test_and_set = xyes; then
-            AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ])
-        fi
-    fi
-fi
-
-# Standard C sources
-SOURCES="$SOURCES $srcdir/src/*.c"
-SOURCES="$SOURCES $srcdir/src/atomic/*.c"
-SOURCES="$SOURCES $srcdir/src/audio/*.c"
-SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
-SOURCES="$SOURCES $srcdir/src/events/*.c"
-SOURCES="$SOURCES $srcdir/src/file/*.c"
-SOURCES="$SOURCES $srcdir/src/haptic/*.c"
-SOURCES="$SOURCES $srcdir/src/joystick/*.c"
-SOURCES="$SOURCES $srcdir/src/libm/*.c"
-SOURCES="$SOURCES $srcdir/src/power/*.c"
-#SOURCES="$SOURCES $srcdir/src/filesystem/*.c"
-SOURCES="$SOURCES $srcdir/src/render/*.c"
-SOURCES="$SOURCES $srcdir/src/render/*/*.c"
-SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
-SOURCES="$SOURCES $srcdir/src/thread/*.c"
-SOURCES="$SOURCES $srcdir/src/timer/*.c"
-SOURCES="$SOURCES $srcdir/src/video/*.c"
-
-dnl Enable/disable various subsystems of the SDL library
-
-AC_ARG_ENABLE(atomic,
-AC_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]),
-              , enable_atomic=yes)
-if test x$enable_atomic != xyes; then
-    AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(audio,
-AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
-              , enable_audio=yes)
-if test x$enable_audio != xyes; then
-    AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(video,
-AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
-              , enable_video=yes)
-if test x$enable_video != xyes; then
-    AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(render,
-AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
-              , enable_render=yes)
-if test x$enable_render != xyes; then
-    AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(events,
-AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
-              , enable_events=yes)
-if test x$enable_events != xyes; then
-    AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(joystick,
-AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
-              , enable_joystick=yes)
-if test x$enable_joystick != xyes; then
-    AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(haptic,
-AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
-              , enable_haptic=yes)
-if test x$enable_haptic != xyes; then
-    AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(power,
-AC_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]),
-              , enable_power=yes)
-if test x$enable_power != xyes; then
-    AC_DEFINE(SDL_POWER_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(filesystem,
-AC_HELP_STRING([--enable-filesystem], [Enable the filesystem subsystem [[default=yes]]]),
-              , enable_filesystem=yes)
-if test x$enable_filesystem != xyes; then
-    AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(threads,
-AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
-              , enable_threads=yes)
-if test x$enable_threads != xyes; then
-    AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(timers,
-AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
-              , enable_timers=yes)
-if test x$enable_timers != xyes; then
-    AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(file,
-AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
-              , enable_file=yes)
-if test x$enable_file != xyes; then
-    AC_DEFINE(SDL_FILE_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(loadso,
-AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
-              , enable_loadso=yes)
-if test x$enable_loadso != xyes; then
-    AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(cpuinfo,
-AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
-              , enable_cpuinfo=yes)
-if test x$enable_cpuinfo != xyes; then
-    AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(atomic,
-AC_HELP_STRING([--enable-atomic], [Enable the atomic operations [[default=yes]]]),
-              , enable_atomic=yes)
-if test x$enable_atomic != xyes; then
-    AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ])
-fi
-AC_ARG_ENABLE(assembly,
-AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
-              , enable_assembly=yes)
-if test x$enable_assembly = xyes; then
-    AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ])
-
-    # Make sure that we don't generate floating point code that would
-    # cause illegal instruction exceptions on older processors
-    case "$host" in
-        *-*-darwin*)
-            # Don't need to worry about Apple hardware, it's all SSE capable
-            default_ssemath=yes
-            ;;
-        *64-*-*)
-            # x86 64-bit architectures all have SSE instructions
-            default_ssemath=yes
-            ;;
-        *)
-            default_ssemath=no
-            ;;
-    esac
-    AC_ARG_ENABLE(ssemath,
-AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=no]]]),
-                  , enable_ssemath=$default_ssemath)
-    if test x$enable_ssemath = xno; then
-        if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387"
-        fi
-    fi
-
-    dnl Check for various instruction support
-    AC_ARG_ENABLE(mmx,
-AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
-                  , enable_mmx=yes)
-    if test x$enable_mmx = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_mmx=no
-        AC_MSG_CHECKING(for GCC -mmmx option)
-        mmx_CFLAGS="-mmmx"
-        CFLAGS="$save_CFLAGS $mmx_CFLAGS"
-
-        AC_TRY_COMPILE([
-        #ifdef __MINGW32__
-        #include <_mingw.h>
-        #ifdef __MINGW64_VERSION_MAJOR
-        #include <intrin.h>
-        #else
-        #include <mmintrin.h>
-        #endif
-        #else
-        #include <mmintrin.h>
-        #endif
-        #ifndef __MMX__
-        #error Assembler CPP flag not enabled
-        #endif
-        ],[
-        ],[
-        have_gcc_mmx=yes
-        ])
-        AC_MSG_RESULT($have_gcc_mmx)
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_mmx = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
-        fi
-    fi
-
-    AC_ARG_ENABLE(3dnow,
-AC_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]),
-                  , enable_3dnow=yes)
-    if test x$enable_3dnow = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_3dnow=no
-        AC_MSG_CHECKING(for GCC -m3dnow option)
-        amd3dnow_CFLAGS="-m3dnow"
-        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
-
-        AC_TRY_LINK([
-        #include <mm3dnow.h>
-        #ifndef __3dNOW__
-        #error Assembler CPP flag not enabled
-        #endif
-        ],[
-        void *p = 0;
-        _m_prefetch(p);
-        ],[
-        have_gcc_3dnow=yes
-        ])
-        AC_MSG_RESULT($have_gcc_3dnow)
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_3dnow = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
-        fi
-    fi
-
-    AC_ARG_ENABLE(sse,
-AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
-                  , enable_sse=yes)
-    if test x$enable_sse = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_sse=no
-        AC_MSG_CHECKING(for GCC -msse option)
-        sse_CFLAGS="-msse"
-        CFLAGS="$save_CFLAGS $sse_CFLAGS"
-
-        AC_TRY_COMPILE([
-        #ifdef __MINGW32__
-        #include <_mingw.h>
-        #ifdef __MINGW64_VERSION_MAJOR
-        #include <intrin.h>
-        #else
-        #include <xmmintrin.h>
-        #endif
-        #else
-        #include <xmmintrin.h>
-        #endif
-        #ifndef __SSE__
-        #error Assembler CPP flag not enabled
-        #endif
-        ],[
-        ],[
-        have_gcc_sse=yes
-        ])
-        AC_MSG_RESULT($have_gcc_sse)
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_sse = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
-        fi
-    fi
-
-    AC_ARG_ENABLE(sse2,
-AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=no]]]),
-                  , enable_sse2=$default_ssemath)
-    if test x$enable_sse2 = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_sse2=no
-        AC_MSG_CHECKING(for GCC -msse2 option)
-        sse2_CFLAGS="-msse2"
-        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
-
-        AC_TRY_COMPILE([
-        #ifdef __MINGW32__
-        #include <_mingw.h>
-        #ifdef __MINGW64_VERSION_MAJOR
-        #include <intrin.h>
-        #else
-        #include <emmintrin.h>
-        #endif
-        #else
-        #include <emmintrin.h>
-        #endif
-        #ifndef __SSE2__
-        #error Assembler CPP flag not enabled
-        #endif
-        ],[
-        ],[
-        have_gcc_sse2=yes
-        ])
-        AC_MSG_RESULT($have_gcc_sse2)
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_sse2 = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
-        fi
-    fi
-
-    AC_ARG_ENABLE(altivec,
-AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
-                  , enable_altivec=yes)
-    if test x$enable_altivec = xyes; then
-        save_CFLAGS="$CFLAGS"
-        have_gcc_altivec=no
-        have_altivec_h_hdr=no
-        altivec_CFLAGS="-maltivec"
-        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
-
-        AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
-        AC_TRY_COMPILE([
-        #include <altivec.h>
-        vector unsigned int vzero() {
-            return vec_splat_u32(0);
-        }
-        ],[
-        ],[
-        have_gcc_altivec=yes
-        have_altivec_h_hdr=yes
-        ])
-        AC_MSG_RESULT($have_gcc_altivec)
-
-        if test x$have_gcc_altivec = xno; then
-            AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
-            AC_TRY_COMPILE([
-            vector unsigned int vzero() {
-                return vec_splat_u32(0);
-            }
-            ],[
-            ],[
-            have_gcc_altivec=yes
-            ])
-            AC_MSG_RESULT($have_gcc_altivec)
-        fi
-
-        if test x$have_gcc_altivec = xno; then
-            AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
-            altivec_CFLAGS="-faltivec"
-            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
-            AC_TRY_COMPILE([
-            #include <altivec.h>
-            vector unsigned int vzero() {
-                return vec_splat_u32(0);
-            }
-            ],[
-            ],[
-            have_gcc_altivec=yes
-            have_altivec_h_hdr=yes
-            ])
-            AC_MSG_RESULT($have_gcc_altivec)
-        fi
-
-        if test x$have_gcc_altivec = xno; then
-            AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
-            AC_TRY_COMPILE([
-            vector unsigned int vzero() {
-                return vec_splat_u32(0);
-            }
-            ],[
-            ],[
-            have_gcc_altivec=yes
-            ])
-            AC_MSG_RESULT($have_gcc_altivec)
-        fi
-        CFLAGS="$save_CFLAGS"
-
-        if test x$have_gcc_altivec = xyes; then
-            AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ])
-            if test x$have_altivec_h_hdr = xyes; then
-              AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ])
-            fi
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
-        fi
-    fi
-fi
-
-dnl See if the OSS audio interface is supported
-CheckOSS()
-{
-    AC_ARG_ENABLE(oss,
-AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]),
-                  , enable_oss=maybe)
-
-    # OpenBSD "has" OSS, but it's not really for app use. They want you to
-    #  use sndio instead. So on there, we default to disabled. You can force
-    #  it on if you really want, though.
-    if test x$enable_oss = xmaybe; then
-        enable_oss=yes
-        case "$host" in
-            *-*-openbsd*)
-                enable_oss=no;;
-        esac
-    fi
-
-    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
-        AC_MSG_CHECKING(for OSS audio support)
-        have_oss=no
-        if test x$have_oss != xyes; then
-            AC_TRY_COMPILE([
-              #include <sys/soundcard.h>
-            ],[
-              int arg = SNDCTL_DSP_SETFRAGMENT;
-            ],[
-            have_oss=yes
-            ])
-        fi
-        if test x$have_oss != xyes; then
-            AC_TRY_COMPILE([
-              #include <soundcard.h>
-            ],[
-              int arg = SNDCTL_DSP_SETFRAGMENT;
-            ],[
-            have_oss=yes
-            AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
-            ])
-        fi
-        AC_MSG_RESULT($have_oss)
-        if test x$have_oss = xyes; then
-            AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
-            have_audio=yes
-
-            # We may need to link with ossaudio emulation library
-            case "$host" in
-                *-*-openbsd*|*-*-netbsd*)
-                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
-            esac
-        fi
-    fi
-}
-
-dnl See if the ALSA audio interface is supported
-CheckALSA()
-{
-    AC_ARG_ENABLE(alsa,
-AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
-                  , enable_alsa=yes)
-    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
-        AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
-        # Restore all flags from before the ALSA detection runs
-        CFLAGS="$alsa_save_CFLAGS"
-        LDFLAGS="$alsa_save_LDFLAGS"
-        LIBS="$alsa_save_LIBS"
-        if test x$have_alsa = xyes; then
-            AC_ARG_ENABLE(alsa-shared,
-AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
-                          , enable_alsa_shared=yes)
-            alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
-            AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
-            if test x$have_loadso != xyes && \
-               test x$enable_alsa_shared = xyes; then
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
-                echo "-- dynamic libasound -> $alsa_lib"
-                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ])
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
-            fi
-            have_audio=yes
-        fi
-    fi
-}
-
-dnl Find the ESD includes and libraries
-CheckESD()
-{
-    AC_ARG_ENABLE(esd,
-AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
-                  , enable_esd=yes)
-    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
-        AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
-        if test x$have_esd = xyes; then
-            AC_ARG_ENABLE(esd-shared,
-AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
-                          , enable_esd_shared=yes)
-            esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
-            AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
-            if test x$have_loadso != xyes && \
-               test x$enable_esd_shared = xyes; then
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
-                echo "-- dynamic libesd -> $esd_lib"
-                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ])
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
-            fi
-            have_audio=yes
-        fi
-    fi
-}
-
-dnl Find PulseAudio
-CheckPulseAudio()
-{
-    AC_ARG_ENABLE(pulseaudio,
-AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
-                  , enable_pulseaudio=yes)
-    if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
-        audio_pulseaudio=no
-
-        PULSEAUDIO_REQUIRED_VERSION=0.9
-
-        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-        AC_MSG_CHECKING(for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support)
-        if test x$PKG_CONFIG != xno; then
-        if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then
-                PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
-                PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple`
-                audio_pulseaudio=yes
-            fi
-        fi
-        AC_MSG_RESULT($audio_pulseaudio)
-
-        if test x$audio_pulseaudio = xyes; then
-            AC_ARG_ENABLE(pulseaudio-shared,
-AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
-                          , enable_pulseaudio_shared=yes)
-            pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
-            AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS"
-            if test x$have_loadso != xyes && \
-               test x$enable_pulseaudio_shared = xyes; then
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then
-                echo "-- dynamic libpulse-simple -> $pulseaudio_lib"
-                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ])
-
-                case "$host" in
-                    # On Solaris, pulseaudio must be linked deferred explicitly
-                    # to prevent undefined symbol failures.
-                    *-*-solaris*)
-                        PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'`
-                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred"
-                esac
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS"
-            fi
-            have_audio=yes
-        fi
-    fi
-}
-
-CheckARTSC()
-{
-    AC_ARG_ENABLE(arts,
-AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
-                  , enable_arts=yes)
-    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
-        AC_PATH_PROG(ARTSCONFIG, artsc-config)
-        if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
-            : # arts isn't installed
-        else
-            ARTS_CFLAGS=`$ARTSCONFIG --cflags`
-            ARTS_LIBS=`$ARTSCONFIG --libs`
-            AC_MSG_CHECKING(for aRts development environment)
-            audio_arts=no
-            save_CFLAGS="$CFLAGS"
-            CFLAGS="$CFLAGS $ARTS_CFLAGS"
-            AC_TRY_COMPILE([
-             #include <artsc.h>
-            ],[
-             arts_stream_t stream;
-            ],[
-            audio_arts=yes
-            ])
-            CFLAGS="$save_CFLAGS"
-            AC_MSG_RESULT($audio_arts)
-            if test x$audio_arts = xyes; then
-                AC_ARG_ENABLE(arts-shared,
-AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
-                              , enable_arts_shared=yes)
-                arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
-                AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
-                EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
-                if test x$have_loadso != xyes && \
-                   test x$enable_arts_shared = xyes; then
-                    AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
-                fi
-                if test x$have_loadso = xyes && \
-                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
-                    echo "-- dynamic libartsc -> $arts_lib"
-                    AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ])
-                else
-                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
-                fi
-                have_audio=yes
-            fi
-        fi
-    fi
-}
-
-dnl See if the NAS audio interface is supported
-CheckNAS()
-{
-    AC_ARG_ENABLE(nas,
-AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
-                  , enable_nas=yes)
-    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
-        AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
-        AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
-
-        AC_MSG_CHECKING(for NAS audio support)
-        have_nas=no
-
-        if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
-            have_nas=yes
-            NAS_LIBS="-laudio"
-
-        elif test -r /usr/X11R6/include/audio/audiolib.h; then
-            have_nas=yes
-            NAS_CFLAGS="-I/usr/X11R6/include/"
-            NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
-
-        fi
-
-        AC_MSG_RESULT($have_nas)
-
-        if test x$have_nas = xyes; then
-            AC_ARG_ENABLE(nas-shared,
-AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
-                          , enable_nas_shared=yes)
-            nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
-            if test x$have_loadso != xyes && \
-               test x$enable_nas_shared = xyes; then
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_nas_shared = xyes && test x$nas_lib != x; then
-                echo "-- dynamic libaudio -> $nas_lib"
-                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ])
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
-            fi
-
-            AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
-            have_audio=yes
-        fi
-    fi
-}
-
-dnl See if the sndio audio interface is supported
-CheckSNDIO()
-{
-    AC_ARG_ENABLE(sndio,
-AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
-                  , enable_sndio=yes)
-    if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
-        AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
-        AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
-
-        AC_MSG_CHECKING(for sndio audio support)
-        have_sndio=no
-
-        if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
-            have_sndio=yes
-            SNDIO_LIBS="-lsndio"
-        fi
-
-        AC_MSG_RESULT($have_sndio)
-
-        if test x$have_sndio = xyes; then
-            AC_ARG_ENABLE(sndio-shared,
-AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
-                          , enable_sndio_shared=yes)
-            sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
-            if test x$have_loadso != xyes && \
-               test x$enable_sndio_shared = xyes; then
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
-                echo "-- dynamic libsndio -> $sndio_lib"
-                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
-            fi
-
-            AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
-            have_audio=yes
-        fi
-    fi
-}
-
-dnl rcg07142001 See if the user wants the disk writer audio driver...
-CheckDiskAudio()
-{
-    AC_ARG_ENABLE(diskaudio,
-AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
-                  , enable_diskaudio=yes)
-    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
-        AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ])
-        SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
-    fi
-}
-
-dnl rcg03142006 See if the user wants the dummy audio driver...
-CheckDummyAudio()
-{
-    AC_ARG_ENABLE(dummyaudio,
-AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
-                  , enable_dummyaudio=yes)
-    if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
-        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ])
-        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
-    fi
-}
-
-dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
-dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
-CheckVisibilityHidden()
-{
-    AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
-    have_gcc_fvisibility=no
-
-    visibility_CFLAGS="-fvisibility=hidden"
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
-    AC_TRY_COMPILE([
-    #if !defined(__GNUC__) || __GNUC__ < 4
-    #error SDL only uses visibility attributes in GCC 4 or newer
-    #endif
-    ],[
-    ],[
-    have_gcc_fvisibility=yes
-    ])
-    AC_MSG_RESULT($have_gcc_fvisibility)
-    CFLAGS="$save_CFLAGS"
-
-    if test x$have_gcc_fvisibility = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
-    fi
-}
-
-dnl See if GCC's -mpreferred-stack-boundary is supported.
-dnl  Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296
-CheckStackBoundary()
-{
-    AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option)
-    have_gcc_preferred_stack_boundary=no
-
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2"
-    AC_TRY_COMPILE([
-    int x = 0;
-    ],[
-    ],[
-    have_gcc_preferred_stack_boundary=yes
-    ])
-    AC_MSG_RESULT($have_gcc_preferred_stack_boundary)
-    CFLAGS="$save_CFLAGS"
-
-    if test x$have_gcc_preferred_stack_boundary = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
-    fi
-}
-
-
-dnl See if GCC's -Wall is supported.
-CheckWarnAll()
-{
-    AC_MSG_CHECKING(for GCC -Wall option)
-    have_gcc_Wall=no
-
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$save_CFLAGS -Wall"
-    AC_TRY_COMPILE([
-    int x = 0;
-    ],[
-    ],[
-    have_gcc_Wall=yes
-    ])
-    AC_MSG_RESULT($have_gcc_Wall)
-    CFLAGS="$save_CFLAGS"
-
-    if test x$have_gcc_Wall = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
-
-        dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
-        AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
-        need_gcc_Wno_multichar=no
-        case "$host" in
-            *-*-beos* | *-*-haiku*)
-                need_gcc_Wno_multichar=yes
-                ;;
-        esac
-        AC_MSG_RESULT($need_gcc_Wno_multichar)
-        if test x$need_gcc_Wno_multichar = xyes; then
-            EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
-        fi
-    fi
-}
-
-
-dnl Find the X11 include and library directories
-CheckX11()
-{
-
-
-    AC_ARG_ENABLE(video-x11,
-AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
-                  , enable_video_x11=yes)
-    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
-        case "$host" in
-            *-*-darwin*)
-                # This isn't necessary for X11, but fixes GLX detection
-                if test "x$x_includes" = xNONE && \
-                   test "x$x_libraries" = xNONE && \
-                   test -d /usr/X11R6/include && \
-                   test -d /usr/X11R6/lib; then
-                    x_includes="/usr/X11R6/include"
-                    x_libraries="/usr/X11R6/lib"
-                fi
-                ;;
-        esac
-        AC_PATH_X
-        AC_PATH_XTRA
-        if test x$have_x = xyes; then
-            # Only allow dynamically loaded X11 if the X11 function pointers
-            # will not end up in the global namespace, which causes problems
-            # with other libraries calling X11 functions.
-            x11_symbols_private=$have_gcc_fvisibility
-
-            AC_ARG_ENABLE(x11-shared,
-AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
-                          , enable_x11_shared=maybe)
-
-            case "$host" in
-                *-*-darwin*)
-                    x11_symbols_private=yes
-                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
-                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
-                    xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
-                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
-                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
-                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
-                    xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
-                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
-                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
-                    ;;
-                *-*-openbsd*)
-                    x11_lib='libX11.so'
-                    x11ext_lib='libXext.so'
-                    xcursor_lib='libXcursor.so'
-                    xinerama_lib='libXinerama.so'
-                    xinput_lib='libXi.so'
-                    xrandr_lib='libXrandr.so'
-                    xrender_lib='libXrender.so'
-                    xss_lib='libXss.so'
-                    xvidmode_lib='libXxf86vm.so'
-                    ;;
-                *)
-                    x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
-                    x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
-                    xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
-                    xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
-                    xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
-                    xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
-                    xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
-                    xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
-                    xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
-                    ;;
-            esac
-
-            if test x$ac_cv_func_shmat != xyes; then
-                X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
-            fi
-            CFLAGS="$CFLAGS $X_CFLAGS"
-            LDFLAGS="$LDFLAGS $X_LIBS"
-
-            AC_CHECK_HEADER(X11/extensions/Xext.h,
-                            have_xext_h_hdr=yes,
-                            have_xext_h_hdr=no,
-                            [#include <X11/Xlib.h>
-                             #include <X11/Xproto.h>
-                            ])
-            if test x$have_xext_h_hdr != xyes; then
-               AC_MSG_ERROR([
-*** Missing Xext.h, maybe you need to install the libxext-dev package?
-               ])
-            fi
-
-            AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
-
-            # Needed so SDL applications can include SDL_syswm.h
-            SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
-
-            if test x$enable_x11_shared = xmaybe; then
-                enable_x11_shared=$x11_symbols_private
-            fi
-            if test x$have_loadso != xyes && \
-               test x$enable_x11_shared = xyes; then
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
-                enable_x11_shared=no
-            fi
-            if test x$x11_symbols_private != xyes && \
-               test x$enable_x11_shared = xyes; then
-                AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
-                enable_x11_shared=no
-            fi
-
-            if test x$have_loadso = xyes && \
-               test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
-                echo "-- dynamic libX11 -> $x11_lib"
-                echo "-- dynamic libX11ext -> $x11ext_lib"
-                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ])
-                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ])
-            else
-                enable_x11_shared=no
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
-            fi
-            have_video=yes
-
-            AC_MSG_CHECKING(for const parameter to XextAddDisplay)
-            have_const_param_XextAddDisplay=no
-            AC_TRY_COMPILE([
-              #include <X11/Xlib.h>
-              #include <X11/Xproto.h>
-              #include <X11/extensions/Xext.h>
-              #include <X11/extensions/extutil.h>
-              extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f);
-            ],[
-            ],[
-            have_const_param_XextAddDisplay=yes
-            AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY)
-            ])
-            AC_MSG_RESULT($have_const_param_XextAddDisplay)
-
-            AC_MSG_CHECKING(for const parameter to _XData32)
-	    have_const_param_xdata32=no
-	    AC_TRY_COMPILE([
-	      #include <X11/Xlibint.h>
-	      extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len);
-	    ],[
-	    ],[
-	    have_const_param_xdata32=yes
-	    AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32)
-	    ])
-	    AC_MSG_RESULT($have_const_param_xdata32)
-
-            dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent]))
-            AC_MSG_CHECKING([for XGenericEvent])
-            have_XGenericEvent=no
-            AC_TRY_COMPILE([
-              	#include <X11/Xlib.h>
-            ],[
-Display *display;
-XEvent event;
-XGenericEventCookie *cookie = &event.xcookie;
-XNextEvent(display, &event);
-XGetEventData(display, cookie);
-XFreeEventData(display, cookie);
-            ],[
-                have_XGenericEvent=yes
-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS)
-            ])
-            AC_MSG_RESULT($have_XGenericEvent)
-
-            AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym]))
-
-            AC_ARG_ENABLE(video-x11-xcursor,
-AC_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]),
-                            , enable_video_x11_xcursor=yes)
-            if test x$enable_video_x11_xcursor = xyes; then
-                definitely_enable_video_x11_xcursor=no
-                AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
-                                have_xcursor_h_hdr=yes,
-                                have_xcursor_h_hdr=no,
-                                [#include <X11/Xlib.h>
-                                ])
-                if test x$have_xcursor_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then
-                        echo "-- dynamic libXcursor -> $xcursor_lib"
-                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ])
-                        definitely_enable_video_x11_xcursor=yes
-                    else
-                        AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes)
-                        if test x$have_xcursor_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor"
-                            definitely_enable_video_x11_xcursor=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_xcursor = xyes; then
-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ])
-            fi
-            AC_ARG_ENABLE(video-x11-xinerama,
-AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
-                            , enable_video_x11_xinerama=yes)
-            if test x$enable_video_x11_xinerama = xyes; then
-                definitely_enable_video_x11_xinerama=no
-                AC_CHECK_HEADER(X11/extensions/Xinerama.h,
-                                have_xinerama_h_hdr=yes,
-                                have_xinerama_h_hdr=no,
-                                [#include <X11/Xlib.h>
-                                ])
-                if test x$have_xinerama_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then
-                        echo "-- dynamic libXinerama -> $xinerama_lib"
-                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ])
-                        definitely_enable_video_x11_xinerama=yes
-                    else
-                        AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes)
-                        if test x$have_xinerama_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama"
-                            definitely_enable_video_x11_xinerama=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_xinerama = xyes; then
-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ])
-            fi
-            AC_ARG_ENABLE(video-x11-xinput,
-AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
-                            , enable_video_x11_xinput=yes)
-            if test x$enable_video_x11_xinput = xyes; then
-                definitely_enable_video_x11_xinput=no
-                AC_CHECK_HEADER(X11/extensions/XInput2.h,
-                                have_xinput_h_hdr=yes,
-                                have_xinput_h_hdr=no,
-                                [#include <X11/Xlib.h>
-                                ])
-                if test x$have_xinput_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
-                        echo "-- dynamic libXi -> $xinput_lib"
-                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ])
-                        definitely_enable_video_x11_xinput=yes
-                    else
-                        AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
-                        if test x$have_xinput_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
-                            definitely_enable_video_x11_xinput=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_xinput = xyes; then
-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ])
-                AC_MSG_CHECKING(for xinput2 multitouch)
-            	have_xinput2_multitouch=no
-            	AC_TRY_COMPILE([
-              		#include <X11/Xlib.h>
-             		#include <X11/Xproto.h>
-			#include <X11/extensions/XInput2.h>
-            	],[
-int event_type = XI_TouchBegin;
-XITouchClassInfo *t;
-Status 
-XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f)
-{
-    return (Status)0;
-}
-            	],[
-            	have_xinput2_multitouch=yes
-            	AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH)
-            	])
-            	AC_MSG_RESULT($have_xinput2_multitouch)
-            fi
-            AC_ARG_ENABLE(video-x11-xrandr,
-AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
-                            , enable_video_x11_xrandr=yes)
-            if test x$enable_video_x11_xrandr = xyes; then
-                definitely_enable_video_x11_xrandr=no
-                AC_CHECK_HEADER(X11/extensions/Xrandr.h,
-                                have_xrandr_h_hdr=yes,
-                                have_xrandr_h_hdr=no,
-                                [#include <X11/Xlib.h>
-                                ])
-                if test x$have_xrandr_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
-                        echo "-- dynamic libXrandr -> $xrandr_lib"
-                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ])
-                        definitely_enable_video_x11_xrandr=yes
-                    else
-                        AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
-                        if test x$have_xrandr_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr"
-                            definitely_enable_video_x11_xrandr=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_xrandr = xyes; then
-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ])
-            fi
-            AC_ARG_ENABLE(video-x11-scrnsaver,
-AC_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]),
-                            , enable_video_x11_scrnsaver=yes)
-            if test x$enable_video_x11_scrnsaver = xyes; then
-                AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
-                                have_scrnsaver_h_hdr=yes,
-                                have_scrnsaver_h_hdr=no,
-                                [#include <X11/Xlib.h>
-                                ])
-                if test x$have_scrnsaver_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then
-                        echo "-- dynamic libXss -> $xss_lib"
-                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ])
-                        definitely_enable_video_x11_scrnsaver=yes
-                    else
-                        AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes)
-                        if test x$have_xss_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss"
-                            definitely_enable_video_x11_scrnsaver=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_scrnsaver = xyes; then
-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ])
-            fi
-            AC_ARG_ENABLE(video-x11-xshape,
-AC_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]),
-                            , enable_video_x11_xshape=yes)
-            if test x$enable_video_x11_xshape = xyes; then
-                AC_CHECK_HEADER(X11/extensions/shape.h,
-                                have_shape_h_hdr=yes,
-                                have_shape_h_hdr=no,
-                                [#include <X11/Xlib.h>
-                                ])
-                if test x$have_shape_h_hdr = xyes; then
-                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ])
-                fi
-            fi
-            AC_ARG_ENABLE(video-x11-vm,
-AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
-                            , enable_video_x11_vm=yes)
-            if test x$enable_video_x11_vm = xyes; then
-                definitely_enable_video_x11_vm=no
-                AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
-                                have_vm_h_hdr=yes,
-                                have_vm_h_hdr=no,
-                                [#include <X11/Xlib.h>
-                                ])
-                if test x$have_vm_h_hdr = xyes; then
-                    if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then
-                        echo "-- dynamic libXxf86vm -> $xvidmode_lib"
-                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ])
-                        definitely_enable_video_x11_vm=yes
-                    else
-                        AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes)
-                        if test x$have_vm_lib = xyes ; then
-                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm"
-                            definitely_enable_video_x11_vm=yes
-                        fi
-                    fi
-                fi
-            fi
-            if test x$definitely_enable_video_x11_vm = xyes; then
-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ])
-            fi
-        fi
-    fi
-}
-
-dnl Set up the BWindow video driver if enabled
-CheckBWINDOW()
-{
-    if test x$enable_video = xyes; then
-        AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW, 1, [ ])
-        SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
-        have_video=yes
-    fi
-}
-
-dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
-CheckCOCOA()
-{
-    AC_ARG_ENABLE(video-cocoa,
-AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
-                  , enable_video_cocoa=yes)
-    if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
-        save_CFLAGS="$CFLAGS"
-        dnl work around that we don't have Objective-C support in autoconf
-        CFLAGS="$CFLAGS -x objective-c"
-        AC_MSG_CHECKING(for Cocoa framework)
-        have_cocoa=no
-        AC_TRY_COMPILE([
-          #import <Cocoa/Cocoa.h>
-        ],[
-        ],[
-        have_cocoa=yes
-        ])
-        AC_MSG_RESULT($have_cocoa)
-        CFLAGS="$save_CFLAGS"
-        if test x$have_cocoa = xyes; then
-            AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
-            have_video=yes
-        fi
-    fi
-}
-
-dnl Find DirectFB
-CheckDirectFB()
-{
-    AC_ARG_ENABLE(video-directfb,
-AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]),
-                  , enable_video_directfb=no)
-    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
-        video_directfb=no
-
-        DIRECTFB_REQUIRED_VERSION=1.0.0
-        AC_PATH_PROGS(DIRECTFBCONFIG, directfb-config, no, [$prefix/bin:$PATH])
-        if test x$DIRECTFBCONFIG = xno; then
-            AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-            if test x$PKG_CONFIG != xno; then
-                if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
-                    DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
-                    DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
-                    DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb`
-                    video_directfb=yes
-                fi
-            fi
-        else
-            set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
-            NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
-            set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'`
-            HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
-            if test $HAVE_VERSION -ge $NEED_VERSION; then
-                DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
-                DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
-                DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix`
-                video_directfb=yes
-            fi
-        fi
-        if test x$video_directfb = xyes; then
-            # SuSE 11.1 installs directfb-config without directfb-devel
-            save_CPPFLAGS="$CPPFLAGS"
-            CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS"
-            AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
-            CPPFLAGS="$save_CPPFLAGS"
-            video_directfb=$have_directfb_hdr
-        fi
-        AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
-        AC_MSG_RESULT($video_directfb)
-
-        if test x$video_directfb = xyes; then
-            AC_ARG_ENABLE(directfb-shared,
-AC_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
-                              , enable_directfb_shared=yes)
-
-            AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ])
-            AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
-
-            AC_MSG_CHECKING(for directfb dynamic loading support)
-            directfb_shared=no
-            directfb_lib=[`find_lib "libdirectfb.so.*" "$DIRECTFB_LIBS"`]
-            # | sed 's/.*\/\(.*\)/\1/; q'`]
-AC_MSG_WARN("directfb $directfb_lib")
-            if test x$have_loadso != xyes && \
-               test x$enable_directfb_shared = xyes; then
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
-                directfb_shared=yes
-                echo "-- $directfb_lib_spec -> $directfb_lib"
-                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ])
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
-            fi
-            AC_MSG_RESULT($directfb_shared)
-            have_video=yes
-        fi
-    fi
-}
-
-dnl Find FusionSound
-CheckFusionSound()
-{
-    AC_ARG_ENABLE(fusionsound,
-AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
-                  , enable_fusionsound=no)
-    if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
-        fusionsound=no
-
-        FUSIONSOUND_REQUIRED_VERSION=1.1.1
-
-        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-        AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support)
-        if test x$PKG_CONFIG != xno; then
-            if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
-                FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
-                FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
-                fusionsound=yes
-            fi
-        fi
-        AC_MSG_RESULT($fusionsound)
-
-        if test x$fusionsound = xyes; then
-            AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
-            
-            AC_ARG_ENABLE(fusionsound-shared,
-AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
-                          , enable_fusionsound_shared=yes)
-            fusionsound_shared=no
-            AC_MSG_CHECKING(for FusionSound dynamic loading support)
-            if test x$have_loadso != xyes && \
-               test x$enable_fusionsound_shared = xyes; then
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_fusionsound_shared = xyes; then
-                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
-                fusionsound_shared=yes
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
-            fi
-            AC_MSG_RESULT($fusionsound_shared)
-            
-            have_audio=yes
-        fi
-    fi
-}
-
-dnl rcg04172001 Set up the Null video driver.
-CheckDummyVideo()
-{
-    AC_ARG_ENABLE(video-dummy,
-AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
-                  , enable_video_dummy=yes)
-    if test x$enable_video_dummy = xyes; then
-        AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ])
-        SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
-        have_video=yes
-    fi
-}
-
-dnl Check to see if OpenGL support is desired
-AC_ARG_ENABLE(video-opengl,
-AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
-              , enable_video_opengl=yes)
-
-dnl Find OpenGL
-CheckOpenGLX11()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
-        AC_MSG_CHECKING(for OpenGL (GLX) support)
-        video_opengl=no
-        AC_TRY_COMPILE([
-         #include <GL/gl.h>
-         #include <GL/glx.h>
-        ],[
-        ],[
-        video_opengl=yes
-        ])
-        AC_MSG_RESULT($video_opengl)
-        if test x$video_opengl = xyes; then
-            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
-            AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ])
-            AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
-        fi
-    fi
-}
-
-dnl Check to see if OpenGL ES support is desired
-AC_ARG_ENABLE(video-opengles,
-AC_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]),
-              , enable_video_opengles=yes)
-
-dnl Find OpenGL ES
-CheckOpenGLESX11()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
-        AC_MSG_CHECKING(for EGL support)
-        video_opengl_egl=no
-        AC_TRY_COMPILE([
-         #include <EGL/egl.h>
-        ],[
-        ],[
-        video_opengl_egl=yes
-        ])
-        AC_MSG_RESULT($video_opengl_egl)
-        if test x$video_opengl_egl = xyes; then
-            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
-        fi
-            
-        AC_MSG_CHECKING(for OpenGL ES v1 headers)
-        video_opengles_v1=no
-        AC_TRY_COMPILE([
-         #include <GLES/gl.h>
-         #include <GLES/glext.h>
-        ],[
-        ],[
-        video_opengles_v1=yes
-        ])
-        AC_MSG_RESULT($video_opengles_v1)
-        if test x$video_opengles_v1 = xyes; then
-            AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
-            AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
-        fi
-        
-        AC_MSG_CHECKING(for OpenGL ES v2 headers)
-        video_opengles_v2=no
-        AC_TRY_COMPILE([
-         #include <GLES2/gl2.h>
-         #include <GLES2/gl2ext.h>
-        ],[
-        ],[
-        video_opengles_v2=yes
-        ])
-        AC_MSG_RESULT($video_opengles_v2)
-        if test x$video_opengles_v2 = xyes; then
-            AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
-            AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
-        fi
-    fi
-}
-
-dnl Check for Windows OpenGL
-CheckWINDOWSGL()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
-        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
-        AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ])
-        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
-    fi
-}
-
-dnl Check for BeOS OpenGL
-CheckBeGL()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
-        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
-        AC_DEFINE(SDL_VIDEO_OPENGL_BGL, 1, [ ])
-        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
-    fi
-}
-
-dnl Check for MacOS OpenGL
-CheckMacGL()
-{
-    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
-        AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
-        AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ])
-        AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ])
-        case "$host" in
-            *-*-darwin*)
-                if test x$enable_video_cocoa = xyes; then
-                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
-                fi
-        esac
-    fi
-}
-
-dnl See if we can use the new unified event interface in Linux 2.4
-CheckInputEvents()
-{
-    dnl Check for Linux 2.4 unified input event interface support
-        AC_MSG_CHECKING(for Linux 2.4 unified input interface)
-        use_input_events=no
-        AC_TRY_COMPILE([
-          #include <linux/input.h>
-        ],[
-          #ifndef EVIOCGNAME
-          #error EVIOCGNAME() ioctl not available
-          #endif
-        ],[
-        use_input_events=yes
-        ])
-        AC_MSG_RESULT($use_input_events)
-        if test x$use_input_events = xyes; then
-            AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ])
-        fi
-}
-
-dnl See if we can use the kernel kd.h header
-CheckInputKD()
-{
-
-    AC_MSG_CHECKING(for Linux kd.h)
-    use_input_kd=no
-    AC_TRY_COMPILE([
-      #include <linux/kd.h>
-      #include <linux/keyboard.h>
-    ],[
-        struct kbentry kbe;
-        kbe.kb_table = KG_CTRL;
-        ioctl(0, KDGKBENT, &kbe);
-    ],[
-    use_input_kd=yes
-    ])
-    AC_MSG_RESULT($use_input_kd)
-    if test x$use_input_kd = xyes; then
-        AC_DEFINE(SDL_INPUT_LINUXKD, 1, [ ])
-    fi
-}
-
-dnl See if the platform offers libudev for device enumeration and hotplugging.
-CheckLibUDev()
-{
-    AC_ARG_ENABLE(libudev,
-AC_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
-                        , enable_libudev=yes)
-    if test x$enable_libudev = xyes; then
-        AC_CHECK_HEADER(libudev.h,
-                        have_libudev_h_hdr=yes,
-                        have_libudev_h_hdr=no)
-        if test x$have_libudev_h_hdr = xyes; then
-            AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
-        fi
-    fi
-}
-
-dnl See if the platform offers libdbus for various IPC techniques.
-CheckDBus()
-{
-    AC_ARG_ENABLE(dbus,
-AC_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]),
-                        , enable_dbus=yes)
-    if test x$enable_dbus = xyes; then
-        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-        if test x$PKG_CONFIG != xno; then
-            DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1`
-            save_CFLAGS="$CFLAGS"
-            CFLAGS="$save_CFLAGS $DBUS_CFLAGS"
-            AC_CHECK_HEADER(dbus/dbus.h,
-                            have_dbus_dbus_h_hdr=yes,
-                            have_dbus_dbus_h_hdr=no)
-            CFLAGS="$save_CFLAGS"
-            if test x$have_dbus_dbus_h_hdr = xyes; then
-                AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ])
-                EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS"
-            fi
-        fi
-    fi
-}
-
-dnl See if we can use the Touchscreen input library
-CheckTslib()
-{
-    AC_ARG_ENABLE(input-tslib,
-AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
-                  , enable_input_tslib=yes)
-    if test x$enable_input_tslib = xyes; then
-        AC_MSG_CHECKING(for Touchscreen library support)
-        enable_input_tslib=no
-        AC_TRY_COMPILE([
-          #include "tslib.h"
-        ],[
-        ],[
-        enable_input_tslib=yes
-        ])
-        AC_MSG_RESULT($enable_input_tslib)
-        if test x$enable_input_tslib = xyes; then
-            AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ])
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
-        fi
-    fi
-}
-
-dnl See what type of thread model to use on Linux and Solaris
-CheckPTHREAD()
-{
-    dnl Check for pthread support
-    AC_ARG_ENABLE(pthreads,
-AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
-                  , enable_pthreads=yes)
-    dnl This is used on Linux for glibc binary compatibility (Doh!)
-    AC_ARG_ENABLE(pthread-sem,
-AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
-                  , enable_pthread_sem=yes)
-    case "$host" in
-        *-*-linux*|*-*-uclinux*)
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lpthread"
-            ;;
-        *-*-bsdi*)
-            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
-            pthread_lib=""
-            ;;
-        *-*-darwin*)
-            pthread_cflags="-D_THREAD_SAFE"
-# causes Carbon.p complaints?
-#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
-            ;;
-        *-*-freebsd*|*-*-dragonfly*)
-            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
-            pthread_lib="-pthread"
-            ;;
-        *-*-netbsd*)
-            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
-            pthread_lib="-lpthread"
-            ;;
-        *-*-openbsd*)
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-pthread"
-            ;;
-        *-*-solaris2.9)
-            # From Solaris 9+, posix4's preferred name is rt.
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lpthread -lrt"
-            ;;
-        *-*-solaris2.10)
-            # Solaris 10+ merged pthread into libc.
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lrt"
-            ;;
-        *-*-solaris*)
-            # Solaris 11+ merged rt into libc.
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib=""
-            ;;
-        *-*-sysv5*)
-            pthread_cflags="-D_REENTRANT -Kthread"
-            pthread_lib=""
-            ;;
-        *-*-aix*)
-            pthread_cflags="-D_REENTRANT -mthreads"
-            pthread_lib="-lpthread"
-            ;;
-        *-*-hpux11*)
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-L/usr/lib -lpthread"
-            ;;
-        *)
-            pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lpthread"
-            ;;
-    esac
-    if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
-        # Save the original compiler flags and libraries
-        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
-        # Add the pthread compiler flags and libraries
-        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
-        # Check to see if we have pthread support on this system
-        AC_MSG_CHECKING(for pthreads)
-        use_pthreads=no
-        AC_TRY_LINK([
-         #include <pthread.h>
-        ],[
-         pthread_attr_t type;
-         pthread_attr_init(&type);
-        ],[
-        use_pthreads=yes
-        ])
-        AC_MSG_RESULT($use_pthreads)
-        # Restore the compiler flags and libraries
-        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
-
-        # Do futher testing if we have pthread support...
-        if test x$use_pthreads = xyes; then
-            AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ])
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
-            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
-            SDL_LIBS="$SDL_LIBS $pthread_lib"
-
-            # Save the original compiler flags and libraries
-            ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
-            # Add the pthread compiler flags and libraries
-            CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
-
-            # Check to see if recursive mutexes are available
-            AC_MSG_CHECKING(for recursive mutexes)
-            has_recursive_mutexes=no
-            if test x$has_recursive_mutexes = xno; then
-                AC_TRY_COMPILE([
-                  #include <pthread.h>
-                ],[
-                  pthread_mutexattr_t attr;
-                  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-                ],[
-                has_recursive_mutexes=yes
-                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ])
-                ])
-            fi
-            if test x$has_recursive_mutexes = xno; then
-                AC_TRY_COMPILE([
-                  #include <pthread.h>
-                ],[
-                  pthread_mutexattr_t attr;
-                  pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
-                ],[
-                has_recursive_mutexes=yes
-                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ])
-                ])
-            fi
-            AC_MSG_RESULT($has_recursive_mutexes)
-
-            # Check to see if pthread semaphore support is missing
-            if test x$enable_pthread_sem = xyes; then
-                AC_MSG_CHECKING(for pthread semaphores)
-                have_pthread_sem=no
-                AC_TRY_COMPILE([
-                  #include <pthread.h>
-                  #include <semaphore.h>
-                ],[
-                ],[
-                have_pthread_sem=yes
-                ])
-                AC_MSG_RESULT($have_pthread_sem)
-            fi
-            if test x$have_pthread_sem = xyes; then
-                AC_MSG_CHECKING(for sem_timedwait)
-                have_sem_timedwait=no
-                AC_TRY_LINK([
-                  #include <pthread.h>
-                  #include <semaphore.h>
-                ],[
-                  sem_timedwait(NULL, NULL);
-                ],[
-                have_sem_timedwait=yes
-                AC_DEFINE(HAVE_SEM_TIMEDWAIT)
-                ])
-                AC_MSG_RESULT($have_sem_timedwait)
-            fi
-
-            AC_MSG_CHECKING(for pthread_spin_trylock)
-            AC_TRY_LINK_FUNC(pthread_spin_trylock, [
-              has_pthread_spin_trylock=yes
-              AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ])
-            ],[
-              has_pthread_spin_trylock=no
-            ])
-            AC_MSG_RESULT($has_pthread_spin_trylock)
-
-            AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include <pthread.h> ])
-            if test x$have_pthread_np_h = xyes; then
-                AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ])
-            fi
-
-            # Check to see if pthread naming is available
-            AC_MSG_CHECKING(for pthread_setname_np)
-            AC_TRY_LINK_FUNC(pthread_setname_np, [
-              has_pthread_setname_np=yes
-              AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ])
-            ],[
-              has_pthread_setname_np=no
-            ])
-            AC_MSG_RESULT($has_pthread_setname_np)
-
-            AC_MSG_CHECKING(for pthread_set_name_np)
-            AC_TRY_LINK_FUNC(pthread_set_name_np, [
-              has_pthread_set_name_np=yes
-              AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ])
-            ],[
-              has_pthread_set_name_np=no
-            ])
-            AC_MSG_RESULT($has_pthread_set_name_np)
-
-            # Restore the compiler flags and libraries
-            CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
-
-            # Basic thread creation functions
-            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
-
-            # Semaphores
-            # We can fake these with mutexes and condition variables if necessary
-            if test x$have_pthread_sem = xyes; then
-                SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
-            else
-                SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
-            fi
-
-            # Mutexes
-            # We can fake these with semaphores if necessary
-            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
-
-            # Condition variables
-            # We can fake these with semaphores and mutexes if necessary
-            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
-
-            # Thread local storage
-            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c"
-
-            have_threads=yes
-        fi
-    fi
-}
-
-dnl Determine whether the compiler can produce Windows executables
-CheckWINDOWS()
-{
-    AC_MSG_CHECKING(Windows compiler)
-    have_win32_gcc=no
-    AC_TRY_COMPILE([
-     #include <windows.h>
-    ],[
-    ],[
-    have_win32_gcc=yes
-    ])
-    AC_MSG_RESULT($have_win32_gcc)
-    if test x$have_win32_gcc != xyes; then
-       AC_MSG_ERROR([
-*** Your compiler ($CC) does not produce Windows executables!
-       ])
-    fi
-
-    AC_MSG_CHECKING(Windows CE)
-    have_wince=no
-    AC_TRY_COMPILE([
-#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__)
-#error This is not Windows CE
-#endif
-    ],[
-    ],[
-    have_wince=yes
-       AC_MSG_ERROR([
-*** Sorry, Windows CE is no longer supported.
-       ])
-    ])
-    AC_MSG_RESULT($have_wince)
-
-    # This fixes Windows stack alignment with newer GCC
-    CheckStackBoundary
-}
-
-dnl Find the DirectX includes and libraries
-CheckDIRECTX()
-{
-    AC_ARG_ENABLE(directx,
-AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]),
-                  , enable_directx=yes)
-    if test x$enable_directx = xyes; then
-        AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
-        AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
-        AC_CHECK_HEADER(dsound.h, have_dsound=yes)
-        AC_CHECK_HEADER(dinput.h, have_dinput=yes)
-        AC_CHECK_HEADER(xaudio2.h, have_xaudio2=yes)
-
-        # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
-        # FIXME:  ...so force it off for now.
-        case "$host" in
-            *-*-cygwin*)
-            have_dinput=false
-            ;;
-        esac
-    fi
-}
-
-dnl Check for the dlfcn.h interface for dynamically loading objects
-CheckDLOPEN()
-{
-    AC_ARG_ENABLE(sdl-dlopen,
-AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
-                  , enable_sdl_dlopen=yes)
-    if test x$enable_sdl_dlopen = xyes; then
-        AC_MSG_CHECKING(for dlopen)
-        have_dlopen=no
-        AC_TRY_COMPILE([
-         #include <dlfcn.h>
-        ],[
-         void *handle = dlopen("", RTLD_NOW);
-         const char *loaderror = (char *) dlerror();
-        ],[
-        have_dlopen=yes
-        ])
-        AC_MSG_RESULT($have_dlopen)
-
-        if test x$have_dlopen = xyes; then
-            AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
-               AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
-                  AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
-            AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
-            have_loadso=yes
-        fi
-    fi
-}
-
-dnl Check for the usbhid(3) library on *BSD
-CheckUSBHID()
-{
-    case "$host" in
-        *-*-*bsd*)
-            if test x$enable_joystick = xyes; then
-                AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
-                if test x$have_libusbhid = xyes; then
-                    AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
-                    AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
-                    USB_LIBS="$USB_LIBS -lusbhid"
-                else
-                    AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
-                    AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
-                    AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
-                fi
-                    
-                save_CFLAGS="$CFLAGS"
-                CFLAGS="$CFLAGS $USB_CFLAGS"
-
-                AC_MSG_CHECKING(for usbhid)
-                have_usbhid=no
-                AC_TRY_COMPILE([
-                  #include <sys/types.h>
-                  #if defined(HAVE_USB_H)
-                  #include <usb.h>
-                  #endif
-                  #ifdef __DragonFly__
-                  # include <bus/usb/usb.h>
-                  # include <bus/usb/usbhid.h>
-                  #else
-                  # include <dev/usb/usb.h>
-                  # include <dev/usb/usbhid.h>
-                  #endif
-                  #if defined(HAVE_USBHID_H)
-                  #include <usbhid.h>
-                  #elif defined(HAVE_LIBUSB_H)
-                  #include <libusb.h>
-                  #elif defined(HAVE_LIBUSBHID_H)
-                  #include <libusbhid.h>
-                  #endif
-                ],[
-                  struct report_desc *repdesc;
-                  struct usb_ctl_report *repbuf;
-                  hid_kind_t hidkind;
-                ],[
-                have_usbhid=yes
-                ])
-                AC_MSG_RESULT($have_usbhid)
-
-                if test x$have_usbhid = xyes; then
-                    AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
-                    have_usbhid_ucr_data=no
-                    AC_TRY_COMPILE([
-                      #include <sys/types.h>
-                      #if defined(HAVE_USB_H)
-                      #include <usb.h>
-                      #endif
-                      #ifdef __DragonFly__
-                      # include <bus/usb/usb.h>
-                      # include <bus/usb/usbhid.h>
-                      #else
-                      # include <dev/usb/usb.h>
-                      # include <dev/usb/usbhid.h>
-                      #endif
-                      #if defined(HAVE_USBHID_H)
-                      #include <usbhid.h>
-                      #elif defined(HAVE_LIBUSB_H)
-                      #include <libusb.h>
-                      #elif defined(HAVE_LIBUSBHID_H)
-                      #include <libusbhid.h>
-                      #endif
-                    ],[
-                      struct usb_ctl_report buf;
-                      if (buf.ucr_data) { }
-                    ],[
-                    have_usbhid_ucr_data=yes
-                    ])
-                    if test x$have_usbhid_ucr_data = xyes; then
-                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
-                    fi
-                    AC_MSG_RESULT($have_usbhid_ucr_data)
-                    
-                    AC_MSG_CHECKING(for new usbhid API)
-                    have_usbhid_new=no
-                    AC_TRY_COMPILE([
-                      #include <sys/types.h>
-                      #if defined(HAVE_USB_H)
-                      #include <usb.h>
-                      #endif
-                      #ifdef __DragonFly__
-                      #include <bus/usb/usb.h>
-                      #include <bus/usb/usbhid.h>
-                      #else
-                      #include <dev/usb/usb.h>
-                      #include <dev/usb/usbhid.h>
-                      #endif
-                      #if defined(HAVE_USBHID_H)
-                      #include <usbhid.h>
-                      #elif defined(HAVE_LIBUSB_H)
-                      #include <libusb.h>
-                      #elif defined(HAVE_LIBUSBHID_H)
-                      #include <libusbhid.h>
-                      #endif
-                    ],[
-                      report_desc_t d;
-                      hid_start_parse(d, 1, 1);
-                    ],[
-                    have_usbhid_new=yes
-                    ])
-                    if test x$have_usbhid_new = xyes; then
-                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
-                    fi
-                    AC_MSG_RESULT($have_usbhid_new)
-
-                    AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
-                    have_machine_joystick=no
-                    AC_TRY_COMPILE([
-                      #include <machine/joystick.h>
-                    ],[
-                      struct joystick t;
-                    ],[
-                    have_machine_joystick=yes
-                    ])
-                    if test x$have_machine_joystick = xyes; then
-                        AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ])
-                    fi
-                    AC_MSG_RESULT($have_machine_joystick)
-
-                    AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ])
-                    SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
-                    EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
-                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
-                    have_joystick=yes
-                fi
-                CFLAGS="$save_CFLAGS"
-            fi
-        ;;
-    esac
-}
-
-dnl Check for clock_gettime()
-CheckClockGettime()
-{
-    AC_ARG_ENABLE(clock_gettime,
-AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]),
-                  , enable_clock_gettime=yes)
-    if test x$enable_clock_gettime = xyes; then
-        AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
-        if test x$have_clock_gettime = xyes; then
-            AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
-        else
-            AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes)
-            if test x$have_clock_gettime = xyes; then
-               AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ])
-               EXTRA_LDFLAGS="$EXTRA_LDFLAGS"
-            fi
-        fi
-    fi
-}
-
-dnl Check for a valid linux/version.h
-CheckLinuxVersion()
-{
-    AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
-    if test x$have_linux_version_h = xyes; then
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
-    fi
-}
-
-dnl Check if we want to use RPATH
-CheckRPATH()
-{
-    AC_ARG_ENABLE(rpath,
-AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
-                  , enable_rpath=yes)
-}
-
-dnl Set up the configuration based on the host platform!
-case "$host" in
-    *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*)
-        case "$host" in
-            *-raspberry-linux*)
-                # Raspberry Pi
-                ARCH=linux
-                RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
-                RPI_LDFLAGS="-L/opt/vc/lib -lbcm_host"
-                CFLAGS="$CFLAGS $RPI_CFLAGS"
-                SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
-                EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
-                SDL_LIBS="$SDL_LIBS $RPI_LDFLAGS"
-
-                if test x$enable_video = xyes; then
-                    SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
-                    $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
-                fi
-                ;;
-            *-*-linux*)         ARCH=linux ;;
-            *-*-uclinux*)       ARCH=linux ;;
-            *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
-            *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
-            *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
-            *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
-            *-*-bsdi*)          ARCH=bsdi ;;
-            *-*-freebsd*)       ARCH=freebsd ;;
-            *-*-dragonfly*)     ARCH=freebsd ;;
-            *-*-netbsd*)        ARCH=netbsd ;;
-            *-*-openbsd*)       ARCH=openbsd ;;
-            *-*-sysv5*)         ARCH=sysv5 ;;
-            *-*-solaris*)       ARCH=solaris ;;
-            *-*-hpux*)          ARCH=hpux ;;
-            *-*-aix*)           ARCH=aix ;;
-            *-*-minix*)         ARCH=minix ;;
-        esac
-        CheckVisibilityHidden
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckDLOPEN
-        CheckOSS
-        CheckALSA
-        CheckPulseAudio
-        CheckARTSC
-        CheckESD
-        CheckNAS
-        CheckSNDIO
-        CheckX11
-        CheckDirectFB
-        CheckFusionSound
-        CheckOpenGLX11
-        CheckOpenGLESX11
-        CheckLibUDev
-        CheckDBus
-        CheckInputEvents
-        CheckInputKD
-        CheckTslib
-        CheckUSBHID
-        CheckPTHREAD
-        CheckClockGettime
-        CheckLinuxVersion
-        CheckRPATH
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-          case $ARCH in
-            sysv5|solaris|hpux)
-                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
-                have_audio=yes
-            ;;
-            netbsd)  # Don't use this on OpenBSD, it's busted.
-                AC_DEFINE(SDL_AUDIO_DRIVER_BSD, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
-                have_audio=yes
-            ;;
-            aix)
-                AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
-                have_audio=yes
-            ;;
-          esac
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-          case $ARCH in
-            linux)
-                AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
-                have_joystick=yes
-            ;;
-          esac
-        fi
-        # Set up files for the haptic library
-        if test x$enable_haptic = xyes; then
-           if test x$use_input_events = xyes; then
-             case $ARCH in
-               linux)
-                   AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ])
-                   SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
-                   have_haptic=yes
-               ;;
-             esac
-           fi
-        fi
-        # Set up files for the power library
-        if test x$enable_power = xyes; then
-             case $ARCH in
-               linux)
-                   AC_DEFINE(SDL_POWER_LINUX, 1, [ ])
-                   SOURCES="$SOURCES $srcdir/src/power/linux/*.c"
-                   have_power=yes
-               ;;
-             esac
-        fi
-        # Set up files for the filesystem library
-        if test x$enable_filesystem = xyes; then
-            AC_DEFINE(SDL_FILESYSTEM_UNIX, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/filesystem/unix/*.c"
-            have_filesystem=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
-            have_timers=yes
-        fi
-        # Set up files for udev hotplugging support
-        if test x$enable_libudev = xyes && test x$have_libudev_h_hdr = xyes; then
-            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_udev.c"               
-        fi
-        # Set up files for evdev input
-        if test x$use_input_events = xyes; then
-            SOURCES="$SOURCES $srcdir/src/input/evdev/*.c"               
-        fi
-        ;;
-    *-*-cygwin* | *-*-mingw32*)
-        ARCH=win32
-        if test "$build" != "$host"; then # cross-compiling
-            # Default cross-compile location
-            ac_default_prefix=/usr/local/cross-tools/$host
-        else
-            # Look for the location of the tools and install there
-            if test "$BUILD_PREFIX" != ""; then
-                ac_default_prefix=$BUILD_PREFIX
-            fi
-        fi
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckWINDOWS
-        CheckWINDOWSGL
-        CheckDIRECTX
-
-        # Set up the core platform files
-        SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
-
-        # Set up files for the video library
-        if test x$enable_video = xyes; then
-            AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
-            have_video=yes
-            AC_ARG_ENABLE(render-d3d,
-AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
-                                , enable_render_d3d=yes)
-            if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
-                AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
-            fi
-        fi
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-            AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
-            if test x$have_dsound = xyes; then
-                AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
-            fi
-            if test x$have_xaudio2 = xyes; then
-                AC_DEFINE(SDL_AUDIO_DRIVER_XAUDIO2, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
-            fi
-            have_audio=yes
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-            if test x$have_dinput = xyes; then
-                AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/joystick/windows/SDL_dxjoystick.c"
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
-            else
-                AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/joystick/windows/SDL_mmjoystick.c"
-            fi
-            have_joystick=yes
-        fi
-        if test x$enable_haptic = xyes; then
-            if test x$have_dinput = xyes; then
-                AC_DEFINE(SDL_HAPTIC_DINPUT, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/haptic/windows/SDL_syshaptic.c"
-                have_haptic=yes
-            fi
-        fi
-        if test x$enable_power = xyes; then
-            AC_DEFINE(SDL_POWER_WINDOWS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c"
-            have_power=yes
-        fi
-        if test x$enable_filesystem = xyes; then
-            AC_DEFINE(SDL_FILESYSTEM_WINDOWS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/filesystem/windows/SDL_sysfilesystem.c"
-            have_filesystem=yes
-        fi
-        # Set up files for the thread library
-        if test x$enable_threads = xyes; then
-            AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/thread/windows/*.c"
-            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
-            have_threads=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-            AC_DEFINE(SDL_TIMER_WINDOWS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/timer/windows/*.c"
-            have_timers=yes
-        fi
-        # Set up files for the shared object loading library
-        if test x$enable_loadso = xyes; then
-            AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
-            have_loadso=yes
-        fi
-        # Set up the system libraries we need
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -XCClinker -static-libgcc"
-        # The Windows platform requires special setup
-        VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
-        SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
-        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
-        SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
-
-        # Check to see if this is a mingw or cygwin build
-        have_mingw32=
-        AC_CHECK_LIB(mingw32, main, [have_mingw32=yes])
-        if test x$have_mingw32 = xyes; then
-            SDL_LIBS="-lmingw32 $SDL_LIBS"
-        else
-            SDL_LIBS="-lcygwin $SDL_LIBS"
-        fi
-        ;;
-    *-*-beos* | *-*-haiku*)
-        ARCH=beos
-        ac_default_prefix=/boot/common
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckBWINDOW
-        CheckBeGL
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-            AC_DEFINE(SDL_AUDIO_DRIVER_BEOSAUDIO, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
-            have_audio=yes
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-            AC_DEFINE(SDL_JOYSTICK_BEOS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
-            have_joystick=yes
-        fi
-        # Set up files for the thread library
-        if test x$enable_threads = xyes; then
-            AC_DEFINE(SDL_THREAD_BEOS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
-            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
-            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
-            have_threads=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-            AC_DEFINE(SDL_TIMER_BEOS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
-            have_timers=yes
-        fi
-        # Set up files for the shared object loading library
-        if test x$enable_loadso = xyes; then
-            AC_DEFINE(SDL_LOADSO_BEOS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
-            have_loadso=yes
-        fi
-        # Set up files for the system power library
-        if test x$enable_power = xyes; then
-            AC_DEFINE(SDL_POWER_BEOS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/power/beos/*.c"
-            have_power=yes
-        fi
-        # Set up files for the system filesystem library
-        if test x$enable_filesystem = xyes; then
-            AC_DEFINE(SDL_FILESYSTEM_BEOS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/filesystem/beos/*.cc"
-            have_filesystem=yes
-        fi
-        # The BeOS platform requires special setup.
-        SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
-        ;;
-    arm*-apple-darwin*)
-        # iOS - We are not writing anything to confdefs.h because you have to replace
-        # SDL_config.h for SDL_config_iphoneos.h anyway
-        ARCH=ios
-
-        CheckVisibilityHidden
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckDLOPEN
-        CheckCOCOA
-        CheckPTHREAD
-
-
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c"
-            have_audio=yes
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-            SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m"
-            have_joystick=yes
-        fi
-        # Set up files for the haptic library
-        #if test x$enable_haptic = xyes; then
-        #    SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
-        #    have_haptic=yes
-        #    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
-        #fi
-        # Set up files for the power library
-        if test x$enable_power = xyes; then
-            SOURCES="$SOURCES $srcdir/src/power/uikit/*.m"
-            have_power=yes
-        fi
-        # Set up files for the filesystem library
-        if test x$enable_filesystem = xyes; then
-            SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
-            have_filesystem=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
-            have_timers=yes
-        fi
-        # Set up additional files for the file library
-        if test x$enable_file = xyes; then
-            SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
-        fi
-        # The iOS platform requires special setup.
-        SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics"
-        ;;
-    *-*-darwin* )
-        # This could be either full "Mac OS X", or plain "Darwin" which is
-        # just the OS X kernel sans upper layers like Carbon and Cocoa.
-        # Next line is broken, and a few files below require Mac OS X (full)
-        ARCH=macosx
-
-        # Mac OS X builds with both the Carbon and OSX APIs at the moment
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
-
-        CheckVisibilityHidden
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckDLOPEN
-        CheckCOCOA
-        CheckX11
-        CheckMacGL
-        CheckOpenGLX11
-        CheckPTHREAD
-
-        # Good optimization on Mac OS X, yes...
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -falign-loops=16"
-
-        # Need this or things might misbuild on a G3.
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
-
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c"
-            have_audio=yes
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-            AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
-            have_joystick=yes
-        fi
-        # Set up files for the haptic library
-        if test x$enable_haptic = xyes; then
-            AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
-            have_haptic=yes
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
-        fi
-        # Set up files for the power library
-        if test x$enable_power = xyes; then
-            AC_DEFINE(SDL_POWER_MACOSX, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/power/macosx/*.c"
-            have_power=yes
-        fi
-        # Set up files for the filesystem library
-        if test x$enable_filesystem = xyes; then
-            AC_DEFINE(SDL_FILESYSTEM_COCOA, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/filesystem/cocoa/*.m"
-            have_filesystem=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-            AC_DEFINE(SDL_TIMER_UNIX, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
-            have_timers=yes
-        fi
-        # Set up additional files for the file library
-        if test x$enable_file = xyes; then
-            SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m"
-        fi
-        # The Mac OS X platform requires special setup.
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
-        # If audio is used, add the AudioUnit framework
-        if test x$enable_audio = xyes; then
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
-        fi
-        ;;
-    *)
-        AC_MSG_ERROR([
-*** Unsupported host:  Please add to configure.in
-        ])
-        ;;
-esac
-
-dnl Do this on all platforms, after everything else.
-CheckWarnAll
-
-# Verify that we have all the platform specific files we need
-
-if test x$have_joystick != xyes; then
-    if test x$enable_joystick = xyes; then
-        AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ])
-    fi
-    SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
-fi
-if test x$have_haptic != xyes; then
-    if test x$enable_haptic = xyes; then
-        AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ])
-    fi
-    SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
-fi
-if test x$have_threads != xyes; then
-    if test x$enable_threads = xyes; then
-        AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
-    fi
-    SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
-fi
-if test x$have_timers != xyes; then
-    if test x$enable_timers = xyes; then
-        AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ])
-    fi
-    SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
-fi
-if test x$have_filesystem != xyes; then
-    if test x$enable_filesystem = xyes; then
-        AC_DEFINE(SDL_FILESYSTEM_DISABLED, 1, [ ])
-    fi
-    SOURCES="$SOURCES $srcdir/src/filesystem/dummy/*.c"
-fi
-if test x$have_loadso != xyes; then
-    if test x$enable_loadso = xyes; then
-        AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ])
-    fi
-    SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
-fi
-if test x$SDLMAIN_SOURCES = x; then
-    SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
-fi
-SDLTEST_SOURCES="$srcdir/src/test/*.c"
-
-OBJECTS=`echo $SOURCES`
-DEPENDS=`echo $SOURCES | tr ' ' '\n'`
-for EXT in asm cc m c S; do
-    OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
-    DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\
-\\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
-	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
-done
-
-VERSION_OBJECTS=`echo $VERSION_SOURCES`
-VERSION_DEPENDS=`echo $VERSION_SOURCES`
-VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
-VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
-\\$(objects)/\\2.o: \\1/\\2.rc\\\\
-	\\$(WINDRES) \\$< \\$@,g"`
-
-SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
-SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
-SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
-SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
-\\$(objects)/\\2.o: \\1/\\2.c\\\\
-	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
-
-SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
-SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
-SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
-SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
-\\$(objects)/\\2.o: \\1/\\2.c\\\\
-	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
-
-# Set runtime shared library paths as needed
-
-if test "x$enable_rpath" = "xyes"; then
-  if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
-    SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
-  fi
-  if test $ARCH = solaris; then
-    SDL_RLD_FLAGS="-R\${libdir}"
-  fi
-else
-  SDL_RLD_FLAGS=""
-fi
-
-SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
-
-dnl Expand the cflags and libraries needed by apps using SDL
-AC_SUBST(SDL_CFLAGS)
-AC_SUBST(SDL_LIBS)
-AC_SUBST(SDL_STATIC_LIBS)
-AC_SUBST(SDL_RLD_FLAGS)
-if test x$enable_shared = xyes; then
-    ENABLE_SHARED_TRUE=
-    ENABLE_SHARED_FALSE="#"
-else
-    ENABLE_SHARED_TRUE="#"
-    ENABLE_SHARED_FALSE=
-fi
-if test x$enable_static = xyes; then
-    ENABLE_STATIC_TRUE=
-    ENABLE_STATIC_FALSE="#"
-else
-    ENABLE_STATIC_TRUE="#"
-    ENABLE_STATIC_FALSE=
-fi
-AC_SUBST(ENABLE_SHARED_TRUE)
-AC_SUBST(ENABLE_SHARED_FALSE)
-AC_SUBST(ENABLE_STATIC_TRUE)
-AC_SUBST(ENABLE_STATIC_FALSE)
-
-dnl Expand the sources and objects needed to build the library
-AC_SUBST(ac_aux_dir)
-AC_SUBST(INCLUDE)
-AC_SUBST(OBJECTS)
-AC_SUBST(VERSION_OBJECTS)
-AC_SUBST(SDLMAIN_OBJECTS)
-AC_SUBST(SDLTEST_OBJECTS)
-AC_SUBST(BUILD_CFLAGS)
-AC_SUBST(EXTRA_CFLAGS)
-AC_SUBST(BUILD_LDFLAGS)
-AC_SUBST(EXTRA_LDFLAGS)
-AC_SUBST(WINDRES)
-
-cat >Makefile.rules <<__EOF__
-
-# Build rules for objects
--include \$(OBJECTS:.lo=.d)
-
-# Special dependency for SDL.c, since it depends on SDL_revision.h
-$srcdir/src/SDL.c: update-revision
-$DEPENDS
-$VERSION_DEPENDS
-$SDLMAIN_DEPENDS
-$SDLTEST_DEPENDS
-__EOF__
-
-AC_CONFIG_FILES([
-    Makefile:Makefile.in:Makefile.rules sdl2-config SDL2.spec sdl2.pc
-])
-AC_OUTPUT
-chmod a+x sdl2-config
diff --git a/deps/SDL2/debian/changelog b/deps/SDL2/debian/changelog
deleted file mode 100644
index 8e9dd49..0000000
--- a/deps/SDL2/debian/changelog
+++ /dev/null
@@ -1,72 +0,0 @@
-libsdl2 (2.0.1) UNRELEASED; urgency=low
-
-  * Updated SDL to version 2.0.1
-
- -- Sam Lantinga <slouken at libsdl.org>  Wed, 23 Oct 2013 16:31:38 -0800
-
-libsdl2 (2.0.0) UNRELEASED; urgency=low
-
-  * SDL is now a native debian package.
-  * Removed udeb package
-  * Disabled DirectFB support by default, to avoid runtime dependencies
-
- -- Sam Lantinga <slouken at libsdl.org>  Fri, 15 Feb 2013 08:55:04 -0800
-
-libsdl2 (2.0.0~20130127-1) UNRELEASED; urgency=low
-
-  * New upstream snapshot.
-
- -- Sam Hocevar <sho at debian.org>  Wed, 30 Jan 2013 23:01:12 +0100
-
-libsdl2 (2.0.0~20130103-1) unstable; urgency=low
-
-  [ Manuel A. Fernandez Montecelo ]
-  * debian/control:
-    - Updating maintainers/permissions:
-      - Add myself and Felix Geyer
-    - Update Build-Depends:
-      - Remove a few obsolete items
-      - Add items added lately to libsdl1.2, such as libts (touch screen)
-        support
-    - Add "libsdl2-dbg", analog to libsdl1.2-dbg
-    - Change "XC-Package-Type: udeb" to "Package-Type"
-  * debian/compat: set level 9
-  * debian/source/format: Set to "3.0 (quilt)"
-    - Remove README.source, not needed with new format
-  * debian/sdl2-config.1: Fix typo, "progams"->"programs"
-  * debian/libsdl2-dev.install:
-    - Remove "usr/lib/*/*.la", discouraged
-    - Add man pages: "usr/share/man/man3/*"
-  * debian/libsdl2-dev.manpages: add file to install local "sdl2-config.1"
-  * debian/sources: Removed, possible obsolete file from long ago?
-  * debian/copyright:
-    - Upstream updated to zlib/libpng
-    - Copyright-file format conversion to 1.0
-    - Complete revamp and detailed research about copyright and licenses used,
-      it's very messy but hopefully complete
-
-  [ Felix Geyer ]
-  * Simplify debian/rules by using dh(1).
-
- -- Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>  Sun, 27 Jan 2013 16:40:49 +0100
-
-libsdl2 (2.0~20120220c-1) experimental; urgency=low
-
-  * Upstream version was renamed to 2.0 (Closes: #669367).
-  * New upstream snapshot (Closes: #671506).
-  * This package no longer conflicts with libsdl-1.2.
-  * debian/rules: add multiarch support (Closes: #669364).
-
-  * debian/patches/fix_joystick_misc_axes.diff: fix a joystick remapping
-    bug causing some axes to malfunction.
-  * debian/patches/external_header_paths.diff: provide additional CFLAGS
-    so that headers such as SDL_syswm.h can be included (Closes: #669363).
-
- -- Sam Hocevar <sho at debian.org>  Thu, 17 May 2012 19:03:59 +0200
-
-libsdl-1.3 (1.3.0~20111204-1) experimental; urgency=low
-
-  * Initial upload from upstream snapshot.
-
- -- Sam Hocevar <sho at debian.org>  Sun, 04 Dec 2011 14:35:05 +0100
-
diff --git a/deps/SDL2/debian/compat b/deps/SDL2/debian/compat
deleted file mode 100644
index ec63514..0000000
--- a/deps/SDL2/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/deps/SDL2/debian/control b/deps/SDL2/debian/control
deleted file mode 100644
index e116e9b..0000000
--- a/deps/SDL2/debian/control
+++ /dev/null
@@ -1,75 +0,0 @@
-Source: libsdl2
-Priority: optional
-Section: libs
-Maintainer: Debian SDL packages maintainers <pkg-sdl-maintainers at lists.alioth.debian.org>
-Uploaders: Barry deFreese <bdefreese at debian.org>,
-           Sam Hocevar <sho at debian.org>,
-           Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>,
-           Felix Geyer <fgeyer at debian.org>,
-           Sam Lantinga <slouken at libsdl.org>
-Standards-Version: 3.9.3
-Build-Depends: debhelper (>= 9),
-               dh-autoreconf,
-               dpkg-dev (>= 1.16.1~),
-               libasound2-dev [linux-any],
-               libgl1-mesa-dev,
-               libpulse-dev,
-               libudev-dev [linux-any],
-               libdbus-1-dev [linux-any],
-               libusb2-dev [kfreebsd-any],
-               libusbhid-dev [kfreebsd-any],
-               libx11-dev,
-               libxcursor-dev,
-               libxext-dev,
-               libxi-dev,
-               libxinerama-dev,
-               libxrandr-dev,
-               libxss-dev,
-               libxt-dev,
-               libxxf86vm-dev
-Homepage: http://www.libsdl.org/
-
-Package: libsdl2
-Architecture: any
-Multi-Arch: same
-Pre-Depends: ${misc:Pre-Depends}
-Depends: ${misc:Depends},
-         ${shlibs:Depends},
-         libudev0 [linux-any],
-         libdbus-1-3 [linux-any]
-Conflicts: libsdl-1.3-0
-Replaces: libsdl-1.3-0
-Description: Simple DirectMedia Layer
- SDL is a library that allows programs portable low level access to
- a video framebuffer, audio output, mouse, and keyboard.
- .
- This package contains the shared library, compiled with X11 graphics drivers and OSS, ALSA and PulseAudio sound drivers.
-
-Package: libsdl2-dev
-Section: libdevel
-Architecture: any
-Multi-Arch: same
-Depends: ${misc:Depends},
-         libsdl2 (= ${binary:Version}),
-         libc6-dev,
-         libgl1-mesa-dev
-Conflicts: libsdl-1.3-dev
-Replaces: libsdl-1.3-dev
-Description: Simple DirectMedia Layer development files
- SDL is a library that allows programs portable low level access to a video
- framebuffer, audio output, mouse, and keyboard.
- .
- This package contains files needed if you wish to use the SDL library in your own programs.
-
-Package: libsdl2-dbg
-Priority: extra
-Section: debug
-Architecture: any
-Multi-Arch: same
-Depends: ${misc:Depends},
-         libsdl2 (= ${binary:Version}),
-Description: Simple DirectMedia Layer debug files
- SDL is a library that allows programs portable low level access to a video
- framebuffer, audio output, mouse, and keyboard.
- .
- This package contains the debug symbols for the SDL library.
diff --git a/deps/SDL2/debian/copyright b/deps/SDL2/debian/copyright
deleted file mode 100644
index a53d19b..0000000
--- a/deps/SDL2/debian/copyright
+++ /dev/null
@@ -1,362 +0,0 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: SDL
-Upstream-Contact: Sam Lantinga <slouken at libsdl.org>
-Source: http://www.libsdl.org/
-
-Files: *
-Copyright: 1997-2012 Sam Lantinga <slouken at libsdl.org>
-License: zlib/libpng
-
-Files: src/libm/*
-Copyright: 1993 by Sun Microsystems, Inc. All rights reserved.
-License: SunPro
-
-Files: src/main/windows/SDL_windows_main.c
-Copyright: 1998 Sam Lantinga
-License: PublicDomain_Sam_Lantinga
-Comment: SDL_main.c, placed in the public domain by Sam Lantinga  4/13/98
-
-Files: src/render/mmx.h
-Copyright: 1997-99 by H. Dietz and R. Fisher
-License: zlib/libpng
-Comment:
-  Copyright but no mention to license.
-  .
-  Included since long ago with SDL (and its Debian package) under directory
-  src/video/mmx.h
-
-Files: src/render/SDL_yuv_sw.c
-Copyright: 1995 Erik Corry
-           1995 The Regents of the University of California
-           1995 Brown University
-License: BrownUn_UnCalifornia_ErikCorry
-
-Files: src/stdlib/SDL_qsort.c
-Copyright: 1998 Gareth McCaughan
-License: Gareth_McCaughan
-
-Files: src/test/SDL_test_md5.c
-Copyright: 1997-2012 Sam Lantinga <slouken at libsdl.org>
-           1990 RSA Data Security, Inc.
-License: zlib/libpng and RSA_Data_Security
-
-Files: src/thread/windows/win_ce_semaphore.c
-Copyright: 1998, Johnson M. Hart (with corrections 2001 by Rainer Loritz)
-License: Johnson_M._Hart
-
-Files: src/video/x11/imKStoUCS.c
-       src/video/x11/imKStoUCS.h
-Copyright: 1994-2003 The XFree86 Project, Inc.
-License: MIT/X11
-
-Files: test/testhaptic.c
-Copyright: 1997-2011 Sam Lantinga <slouken at libsdl.org>
-           2008 Edgar Simo Serra
-License: BSD_3_clause
-
-Files: test/testrumble.c
-Copyright: 1997-2011 Sam Lantinga <slouken at libsdl.org>
-           2011 Edgar Simo Serra
-License: BSD_3_clause
-
-Files: test/shapes/*
-Copyright: none
-License: zlib/libpng
-Comment: No specific information about the images
-
-Files: Xcode/TemplatesForXcode*/*/main.c
-Copyright: none
-License: zlib/libpng
-Comment: SDL files, no copyright or license notice
-
-Files: Xcode/TemplatesForXcode*/*/atlantis/*
-Copyright: 1993, 1994, Silicon Graphics, Inc.
-License: SGI_atlantis
-
-Files: Xcode/TemplatesForXcode*/*/atlantis/atlantis.c
-Copyright: 1994 Mark J. Kilgard
-           1993, 1994, Silicon Graphics, Inc.
-License: SGI_atlantis
-Comment: See license for full copyright notice, this one is the same except for
- the additional copyright holder
-
-Files: Xcode/SDLTest/sdlcommon_prefix.h
-Copyright: 2003 Darrell Walisser
-License: zlib/libpng
-Comment:
- Created by Darrell Walisser on Wed Aug 06 2003.
- Copyright (c) 2003 __MyCompanyName__. All rights reserved.
-
-Files: debian/*
-Copyright: 2011-2012, Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>
-           2011-2012, Felix Geyer <debfx-pkg at fobos.de>
-           2011, Roman Vasiyarov <rvasiyarov at gmail.com>
-           2010, Jon Dowland <jmtd at debian.org>
-           2009, Barry deFreese <bdefreese at debian.org>
-           2007-2008, Aurelien Jarno <aurel32 at debian.org>
-           2007-2008, Sam Hocevar (Debian packages) <sam+deb at zoy.org>
-           2002-2007, Josselin Mouette <joss at debian.org>
-           2001, Christian T. Steigies <cts at debian.org>
-           2001, Branden Robinson <branden at debian.org>
-License: LGPL-2.1+
-
-
-License: zlib/libpng
- This software is provided 'as-is', without any express or implied
- warranty.  In no event will the authors be held liable for any damages
- arising from the use of this software.
- .
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
- .
- 1. The origin of this software must not be misrepresented; you must not
-    claim that you wrote the original software. If you use this software
-    in a product, an acknowledgment in the product documentation would be
-    appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
-    misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-License: LGPL-2.1+
- This program 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.
- .
- On Debian systems, the complete text of version 2.1 of the GNU Lesser
- Public License can be found in '/usr/share/common-licenses/LGPL-2.1'.
-
-License: MIT/X11
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is fur-
- nished to do so, subject to the following conditions:
- .
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- .
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
- NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
- XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
- NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- .
- Except as contained in this notice, the name of the XFree86 Project shall not
- be used in advertising or otherwise to promote the sale, use or other deal-
- ings in this Software without prior written authorization from the XFree86
- Project.
-
-License: BSD_3_clause
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-     * Redistributions of source code must retain the above copyright
-       notice, this list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright
-       notice, this list of conditions and the following disclaimer in the
-       documentation and/or other materials provided with the distribution.
-     * Neither the name of the LibQxt project nor the
-       names of its contributors may be used to endorse or promote products
-       derived from this software without specific prior written permission.
- .
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-Comment:
-  Copyright (C) 1997-2011 Sam Lantinga <slouken at libsdl.org>
-  .
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-  .
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely.
-  .
-  .
-  Copyright (c) 2011, Edgar Simo Serra
-  All rights reserved.
-  .
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are met:
-  .
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of the Simple Directmedia Layer (SDL) nor the names of
-      its contributors may be used to endorse or promote products derived from
-      this software without specific prior written permission.
-  .
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-License: BrownUn_UnCalifornia_ErikCorry
- /* This code was derived from code carrying the following copyright notices:
-  * Copyright (c) 1995 The Regents of the University of California.
-  * All rights reserved.
-  *
-  * Permission to use, copy, modify, and distribute this software and its
-  * documentation for any purpose, without fee, and without written agreement is
-  * hereby granted, provided that the above copyright notice and the following
-  * two paragraphs appear in all copies of this software.
-  *
-  * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
-  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
-  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
-  * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-  *
-  * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
-  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
-  * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
-  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-  *
-  * Copyright (c) 1995 Erik Corry
-  * All rights reserved.
-  *
-  * Permission to use, copy, modify, and distribute this software and its
-  * documentation for any purpose, without fee, and without written agreement is
-  * hereby granted, provided that the above copyright notice and the following
-  * two paragraphs appear in all copies of this software.
-  *
-  * IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-  * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
-  * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED
-  * OF THE POSSIBILITY OF SUCH DAMAGE.
-  *
-  * ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
-  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-  * PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
-  * BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
-  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-  *
-  * Portions of this software Copyright (c) 1995 Brown University.
-  * All rights reserved.
-  *
-  * Permission to use, copy, modify, and distribute this software and its
-  * documentation for any purpose, without fee, and without written agreement
-  * is hereby granted, provided that the above copyright notice and the
-  * following two paragraphs appear in all copies of this software.
-  *
-  * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR
-  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
-  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN
-  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-  *
-  * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
-  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-  * PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
-  * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
-  * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-  */
-
-License: Gareth_McCaughan
-  You may use it in anything you like; you may make money
-  out of it; you may distribute it in object form or as
-  part of an executable without including source code;
-  you don't have to credit me. (But it would be nice if
-  you did.)
-
-License: Johnson_M._Hart
-  Permission is granted for any and all use providing that this
-  copyright is properly acknowledged.
-  There are no assurances of suitability for any use whatsoever.
-
-License: SunPro
-  Developed at SunPro, a Sun Microsystems, Inc. business.
-  Permission to use, copy, modify, and distribute this
-  software is freely granted, provided that this notice
-  is preserved.
-
-License: PublicDomain_Sam_Lantinga
- Placed in the public domain by Sam Lantinga  4/13/98
-
-License: PublicDomain_Edgar_Simo
- Written by Edgar Simo "bobbens"
- .
- Released under Public Domain.
-
-License: RSA_Data_Security
- ***********************************************************************
- ** utl_md5.c -- the source code for MD5 routines                      **
- ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
- ** Created: 2/17/90 RLR                                              **
- ** Revised: 1/91 SRD,AJ,BSK,JT Reference C ver., 7/10 constant corr. **
- ***********************************************************************
- ***********************************************************************
- ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
- **                                                                   **
- ** License to copy and use this software is granted provided that    **
- ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
- ** Digest Algorithm" in all material mentioning or referencing this  **
- ** software or this function.                                        **
- **                                                                   **
- ** License is also granted to make and use derivative works          **
- ** provided that such works are identified as "derived from the RSA  **
- ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
- ** material mentioning or referencing the derived work.              **
- **                                                                   **
- ** RSA Data Security, Inc. makes no representations concerning       **
- ** either the merchantability of this software or the suitability    **
- ** of this software for any particular purpose.  It is provided "as  **
- ** is" without express or implied warranty of any kind.              **
- **                                                                   **
- ** These notices must be retained in any copies of any part of this  **
- ** documentation and/or software.                                    **
- ***********************************************************************
-
-License: SGI_atlantis
- (c) Copyright 1993, 1994, Silicon Graphics, Inc.
- ALL RIGHTS RESERVED
- Permission to use, copy, modify, and distribute this software for
- any purpose and without fee is hereby granted, provided that the above
- copyright notice appear in all copies and that both the copyright notice
- and this permission notice appear in supporting documentation, and that
- the name of Silicon Graphics, Inc. not be used in advertising
- or publicity pertaining to distribution of the software without specific,
- written prior permission.
- .
- THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
- GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
- ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- .
- US Government Users Restricted Rights
- Use, duplication, or disclosure by the Government is subject to
- restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- (c)(1)(ii) of the Rights in Technical Data and Computer Software
- clause at DFARS 252.227-7013 and/or in similar or successor
- clauses in the FAR or the DOD or NASA FAR Supplement.
- Unpublished-- rights reserved under the copyright laws of the
- United States.  Contractor/manufacturer is Silicon Graphics,
- Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
- .
- OpenGL(TM) is a trademark of Silicon Graphics, Inc.
diff --git a/deps/SDL2/debian/docs b/deps/SDL2/debian/docs
deleted file mode 100644
index 2e2e9c4..0000000
--- a/deps/SDL2/debian/docs
+++ /dev/null
@@ -1,4 +0,0 @@
-BUGS.txt
-CREDITS.txt
-README.txt
-README-SDL.txt
diff --git a/deps/SDL2/debian/libsdl2-dev.install b/deps/SDL2/debian/libsdl2-dev.install
deleted file mode 100644
index 7f99ff4..0000000
--- a/deps/SDL2/debian/libsdl2-dev.install
+++ /dev/null
@@ -1,8 +0,0 @@
-usr/bin/sdl2-config
-usr/include/SDL2
-usr/lib/*/libSDL2*.so
-usr/lib/*/libSDL2.a
-usr/lib/*/libSDL2main.a
-usr/lib/*/libSDL2_test.a
-usr/lib/*/pkgconfig/sdl2.pc
-usr/share/aclocal/sdl2.m4
diff --git a/deps/SDL2/debian/libsdl2-dev.manpages b/deps/SDL2/debian/libsdl2-dev.manpages
deleted file mode 100644
index 150752c..0000000
--- a/deps/SDL2/debian/libsdl2-dev.manpages
+++ /dev/null
@@ -1 +0,0 @@
-debian/sdl2-config.1
diff --git a/deps/SDL2/debian/libsdl2.install b/deps/SDL2/debian/libsdl2.install
deleted file mode 100644
index e4193c7..0000000
--- a/deps/SDL2/debian/libsdl2.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/*/libSDL2-2.0.so.0*
diff --git a/deps/SDL2/debian/rules b/deps/SDL2/debian/rules
deleted file mode 100755
index 3f4d8e6..0000000
--- a/deps/SDL2/debian/rules
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/make -f
-
-DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-
-confflags = --disable-rpath --disable-video-directfb \
-            --disable-nas --disable-esd --disable-arts \
-            --disable-alsa-shared --disable-pulseaudio-shared \
-            --disable-x11-shared
-
-%:
-	dh $@ --parallel
-
-override_dh_auto_configure:
-	dh_auto_configure -Bbuilddir/all -- $(confflags)
-
-override_dh_auto_build:
-	dh_auto_build -Bbuilddir/all
-	tar czf debian/examples.tar.gz test
-
-override_dh_auto_install:
-	dh_auto_install -Bbuilddir/all
-
-override_dh_auto_clean:
-	dh_auto_clean -Bbuilddir/all
-	rm -f debian/examples.tar.gz
-
-override_dh_install:
-	dh_install --remaining-packages --fail-missing -XlibSDL2.la
-
-override_dh_installexamples:
-	dh_installexamples -plibsdl2-dev debian/examples.tar.gz
-	dh_installexamples --remaining-packages
-
-override_dh_link:
-        # to address lintian warning
-        # W: libsdl2-2.0-0: dev-pkg-without-shlib-symlink usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.0.0 usr/lib/x86_64-linux-gnu/libSDL2-2.0.so
-	dh_link -plibsdl2-dev usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so.0.0.0 usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so
-
-override_dh_strip:
-	dh_strip --dbg-package=libsdl2-dbg
diff --git a/deps/SDL2/debian/sdl2-config.1 b/deps/SDL2/debian/sdl2-config.1
deleted file mode 100644
index c4f4106..0000000
--- a/deps/SDL2/debian/sdl2-config.1
+++ /dev/null
@@ -1,86 +0,0 @@
-.TH sdl2-config 1 "2012-02-20" "SDL 2.0"
-.SH NAME
-sdl2-config \- script to get information about the installed version of SDL
-.SH SYNOPSIS
-.B sdl2-config
-[ --prefix=
-.IR DIR ]
-[ --exec-prefix=
-.IR DIR ]
-[ --version ] [ --libs | --library-libs | --plugin-libs ] [ --cflags ]
-.SH DESCRIPTION
-.B sdl2-config
-is a tool that is used to configure and determine the compiler and linker
-flags that should be used to compile and link programs, libraries, and
-plugins that use SDL.  It is also used internally by the m4 macros that are
-included with SDL.
-.SH OPTIONS
-.TP
-.B --cflags
-Print the compiler flags that are necessary to compile a program or library
-that uses SDL.
-.TP
-.BI --exec-prefix= DIR
-If specified, use
-.I DIR
-instead of the installation exec prefix that SDL was build with when
-computing the output for the --cflags, --libs, --library-libs, and
---plugin-libs options.  This option must be specified before any of the
---cflags, --libs, --library-libs, and --plugin-libs options.
-.TP
-.B --libs
-Print the linker flags that are necessary to link a program that uses SDL.
-.TP
-.B --static-libs
-Print the linker flags that are necessary to statically link a program that uses SDL.
-.TP
-.B --library-libs
-Print the linker flags that are necessary to link a library that uses SDL.
-(This excludes any static objects required for linking, since these must be
-linked only by executable programs.)
-.TP
-.B --plugin-libs
-Print the linker flags that are necessary to link an SDL-using object that
-is to be accessed via
-.IR dlopen (3).
-This may include static objects with PIC symbol information.  This option
-should
-.B not
-be used for ordinary shared libraries or standalone applications.
-.TP
-.BI --prefix= DIR
-If specified, use PREFIX instead of the installation prefix that SDL was
-built with when computing the output for the --cflags, --libs,
---library-libs, and --plugin-libs options.  This option is also used for
-the exec prefix if --exec-prefix was not specified.  This option must be
-specified before any of the --cflags, --libs, --library-libs, and
---plugin-libs options.
-.TP
-.B --version
-Prints the currently installed version of SDL on standard output.
-.SH EXAMPLES
-.TP
-gcc -o main.o $(sdl2-config --cflags) main.c
-is how you might use
-.B sdl2-config
-to compile a C source file for an executable program.
-.TP
-gcc -o my_app $(sdl2-config --libs) main.o util.o
-is how you might use
-.B sdl2-config
-to link compiled objects into an executable program.
-.TP
-gcc -o libSDL_nifty-2.0.so.0.0.1 $(sdl --library-libs) read.o write.o munge.o
-is how you might use
-.B sdl2-config
-to link compiled objects into a shared library.
-.TP
-gcc -o libnifty_xmms.so $(sdl --plugin-libs) stream.o blit.o deinterlace.o
-is how you might use
-.B sdl2-config
-to link compiled objects into a plugin for use by another program.
-.SH AUTHOR
-The Simple DirectMedia Layer (SDL) library was written by Sam Lantinga.
-.PP
-This manual page was written by Branden Robinson, originally for Progeny
-Linux Systems, Inc., and the Debian Project.
diff --git a/deps/SDL2/debian/source/format b/deps/SDL2/debian/source/format
deleted file mode 100644
index 89ae9db..0000000
--- a/deps/SDL2/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (native)
diff --git a/deps/SDL2/debian/watch b/deps/SDL2/debian/watch
deleted file mode 100644
index 07dc201..0000000
--- a/deps/SDL2/debian/watch
+++ /dev/null
@@ -1,2 +0,0 @@
-version=3
-http://www.libsdl.org/release/SDL-([\d.]+)\.tar\.gz
diff --git a/deps/SDL2/include/SDL.h b/deps/SDL2/include/SDL.h
deleted file mode 100644
index c0c067c..0000000
--- a/deps/SDL2/include/SDL.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL.h
- *
- *  Main include header for the SDL library
- */
-
-/**
- *  \mainpage Simple DirectMedia Layer (SDL)
- *
- *  http://www.libsdl.org/
- *
- *  \section intro_sec Introduction
- *
- *  Simple DirectMedia Layer is a cross-platform development library designed
- *  to provide low level access to audio, keyboard, mouse, joystick, and
- *  graphics hardware via OpenGL and Direct3D. It is used by video playback
- *  software, emulators, and popular games including Valve's award winning
- *  catalog and many Humble Bundle games.
- *
- *  SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
- *  Support for other platforms may be found in the source code.
- *
- *  SDL is written in C, works natively with C++, and there are bindings 
- *  available for several other languages, including C# and Python.
- *
- *  This library is distributed under the zlib license, which can be found
- *  in the file "COPYING.txt".
- *
- *  The best way to learn how to use SDL is to check out the header files in
- *  the "include" subdirectory and the programs in the "test" subdirectory.
- *  The header files and test programs are well commented and always up to date.
- *  More documentation and FAQs are available online at:
- *      http://wiki.libsdl.org/
- *
- *  If you need help with the library, or just want to discuss SDL related
- *  issues, you can join the developers mailing list:
- *      http://www.libsdl.org/mailing-list.php
- *
- *  Enjoy!
- *      Sam Lantinga                (slouken at libsdl.org)
- */
-
-#ifndef _SDL_H
-#define _SDL_H
-
-#include "SDL_main.h"
-#include "SDL_stdinc.h"
-#include "SDL_assert.h"
-#include "SDL_atomic.h"
-#include "SDL_audio.h"
-#include "SDL_clipboard.h"
-#include "SDL_cpuinfo.h"
-#include "SDL_endian.h"
-#include "SDL_error.h"
-#include "SDL_events.h"
-#include "SDL_filesystem.h"
-#include "SDL_joystick.h"
-#include "SDL_gamecontroller.h"
-#include "SDL_haptic.h"
-#include "SDL_hints.h"
-#include "SDL_loadso.h"
-#include "SDL_log.h"
-#include "SDL_messagebox.h"
-#include "SDL_mutex.h"
-#include "SDL_power.h"
-#include "SDL_render.h"
-#include "SDL_rwops.h"
-#include "SDL_system.h"
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "SDL_version.h"
-#include "SDL_video.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* As of version 0.5, SDL is loaded dynamically into the application */
-
-/**
- *  \name SDL_INIT_*
- *
- *  These are the flags which may be passed to SDL_Init().  You should
- *  specify the subsystems which you will be using in your application.
- */
-/* @{ */
-#define SDL_INIT_TIMER          0x00000001
-#define SDL_INIT_AUDIO          0x00000010
-#define SDL_INIT_VIDEO          0x00000020  /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
-#define SDL_INIT_JOYSTICK       0x00000200  /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
-#define SDL_INIT_HAPTIC         0x00001000
-#define SDL_INIT_GAMECONTROLLER 0x00002000  /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
-#define SDL_INIT_EVENTS         0x00004000
-#define SDL_INIT_NOPARACHUTE    0x00100000  /**< Don't catch fatal signals */
-#define SDL_INIT_EVERYTHING ( \
-                SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
-                SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
-            )
-/* @} */
-
-/**
- *  This function initializes  the subsystems specified by \c flags
- *  Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
- *  signal handlers for some commonly ignored fatal signals (like SIGSEGV).
- */
-extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
-
-/**
- *  This function initializes specific SDL subsystems
- */
-extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
-
-/**
- *  This function cleans up specific SDL subsystems
- */
-extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
-
-/**
- *  This function returns a mask of the specified subsystems which have
- *  previously been initialized.
- *
- *  If \c flags is 0, it returns a mask of all initialized subsystems.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
-
-/**
- *  This function cleans up all initialized subsystems. You should
- *  call it upon all exit conditions.
- */
-extern DECLSPEC void SDLCALL SDL_Quit(void);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_H */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_assert.h b/deps/SDL2/include/SDL_assert.h
deleted file mode 100644
index 4329434..0000000
--- a/deps/SDL2/include/SDL_assert.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_assert_h
-#define _SDL_assert_h
-
-#include "SDL_config.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef SDL_ASSERT_LEVEL
-#ifdef SDL_DEFAULT_ASSERT_LEVEL
-#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
-#elif defined(_DEBUG) || defined(DEBUG) || \
-      (defined(__GNUC__) && !defined(__OPTIMIZE__))
-#define SDL_ASSERT_LEVEL 2
-#else
-#define SDL_ASSERT_LEVEL 1
-#endif
-#endif /* SDL_ASSERT_LEVEL */
-
-/*
-These are macros and not first class functions so that the debugger breaks
-on the assertion line and not in some random guts of SDL, and so each
-assert can have unique static variables associated with it.
-*/
-
-#if defined(_MSC_VER)
-/* Don't include intrin.h here because it contains C++ code */
-    extern void __cdecl __debugbreak(void);
-    #define SDL_TriggerBreakpoint() __debugbreak()
-#elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
-    #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
-#elif defined(HAVE_SIGNAL_H)
-    #include <signal.h>
-    #define SDL_TriggerBreakpoint() raise(SIGTRAP)
-#else
-    /* How do we trigger breakpoints on this platform? */
-    #define SDL_TriggerBreakpoint()
-#endif
-
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
-#   define SDL_FUNCTION __func__
-#elif ((__GNUC__ >= 2) || defined(_MSC_VER))
-#   define SDL_FUNCTION __FUNCTION__
-#else
-#   define SDL_FUNCTION "???"
-#endif
-#define SDL_FILE    __FILE__
-#define SDL_LINE    __LINE__
-
-/*
-sizeof (x) makes the compiler still parse the expression even without
-assertions enabled, so the code is always checked at compile time, but
-doesn't actually generate code for it, so there are no side effects or
-expensive checks at run time, just the constant size of what x WOULD be,
-which presumably gets optimized out as unused.
-This also solves the problem of...
-
-    int somevalue = blah();
-    SDL_assert(somevalue == 1);
-
-...which would cause compiles to complain that somevalue is unused if we
-disable assertions.
-*/
-
-#ifdef _MSC_VER  /* stupid /W4 warnings. */
-#define SDL_NULL_WHILE_LOOP_CONDITION (-1 == __LINE__)
-#else
-#define SDL_NULL_WHILE_LOOP_CONDITION (0)
-#endif
-
-#define SDL_disabled_assert(condition) \
-    do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
-
-typedef enum
-{
-    SDL_ASSERTION_RETRY,  /**< Retry the assert immediately. */
-    SDL_ASSERTION_BREAK,  /**< Make the debugger trigger a breakpoint. */
-    SDL_ASSERTION_ABORT,  /**< Terminate the program. */
-    SDL_ASSERTION_IGNORE,  /**< Ignore the assert. */
-    SDL_ASSERTION_ALWAYS_IGNORE  /**< Ignore the assert from now on. */
-} SDL_assert_state;
-
-typedef struct SDL_assert_data
-{
-    int always_ignore;
-    unsigned int trigger_count;
-    const char *condition;
-    const char *filename;
-    int linenum;
-    const char *function;
-    const struct SDL_assert_data *next;
-} SDL_assert_data;
-
-#if (SDL_ASSERT_LEVEL > 0)
-
-/* Never call this directly. Use the SDL_assert* macros. */
-extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *,
-                                                             const char *,
-                                                             const char *, int);
-
-/* the do {} while(0) avoids dangling else problems:
-    if (x) SDL_assert(y); else blah();
-       ... without the do/while, the "else" could attach to this macro's "if".
-   We try to handle just the minimum we need here in a macro...the loop,
-   the static vars, and break points. The heavy lifting is handled in
-   SDL_ReportAssertion(), in SDL_assert.c.
-*/
-#define SDL_enabled_assert(condition) \
-    do { \
-        while ( !(condition) ) { \
-            static struct SDL_assert_data assert_data = { \
-                0, 0, #condition, 0, 0, 0, 0 \
-            }; \
-            const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \
-                                                               SDL_FUNCTION, \
-                                                               SDL_FILE, \
-                                                               SDL_LINE); \
-            if (state == SDL_ASSERTION_RETRY) { \
-                continue; /* go again. */ \
-            } else if (state == SDL_ASSERTION_BREAK) { \
-                SDL_TriggerBreakpoint(); \
-            } \
-            break; /* not retrying. */ \
-        } \
-    } while (SDL_NULL_WHILE_LOOP_CONDITION)
-
-#endif  /* enabled assertions support code */
-
-/* Enable various levels of assertions. */
-#if SDL_ASSERT_LEVEL == 0   /* assertions disabled */
-#   define SDL_assert(condition) SDL_disabled_assert(condition)
-#   define SDL_assert_release(condition) SDL_disabled_assert(condition)
-#   define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
-#elif SDL_ASSERT_LEVEL == 1  /* release settings. */
-#   define SDL_assert(condition) SDL_disabled_assert(condition)
-#   define SDL_assert_release(condition) SDL_enabled_assert(condition)
-#   define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
-#elif SDL_ASSERT_LEVEL == 2  /* normal settings. */
-#   define SDL_assert(condition) SDL_enabled_assert(condition)
-#   define SDL_assert_release(condition) SDL_enabled_assert(condition)
-#   define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
-#elif SDL_ASSERT_LEVEL == 3  /* paranoid settings. */
-#   define SDL_assert(condition) SDL_enabled_assert(condition)
-#   define SDL_assert_release(condition) SDL_enabled_assert(condition)
-#   define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
-#else
-#   error Unknown assertion level.
-#endif
-
-/* this assertion is never disabled at any level. */
-#define SDL_assert_always(condition) SDL_enabled_assert(condition)
-
-
-typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)(
-                                 const SDL_assert_data* data, void* userdata);
-
-/**
- *  \brief Set an application-defined assertion handler.
- *
- *  This allows an app to show its own assertion UI and/or force the
- *  response to an assertion failure. If the app doesn't provide this, SDL
- *  will try to do the right thing, popping up a system-specific GUI dialog,
- *  and probably minimizing any fullscreen windows.
- *
- *  This callback may fire from any thread, but it runs wrapped in a mutex, so
- *  it will only fire from one thread at a time.
- *
- *  Setting the callback to NULL restores SDL's original internal handler.
- *
- *  This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
- *
- *  \return SDL_assert_state value of how to handle the assertion failure.
- *
- *  \param handler Callback function, called when an assertion fails.
- *  \param userdata A pointer passed to the callback as-is.
- */
-extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
-                                            SDL_AssertionHandler handler,
-                                            void *userdata);
-
-/**
- *  \brief Get a list of all assertion failures.
- *
- *  Get all assertions triggered since last call to SDL_ResetAssertionReport(),
- *  or the start of the program.
- *
- *  The proper way to examine this data looks something like this:
- *
- *  <code>
- *  const SDL_assert_data *item = SDL_GetAssertionReport();
- *  while (item) {
- *      printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
- *             item->condition, item->function, item->filename,
- *             item->linenum, item->trigger_count,
- *             item->always_ignore ? "yes" : "no");
- *      item = item->next;
- *  }
- *  </code>
- *
- *  \return List of all assertions.
- *  \sa SDL_ResetAssertionReport
- */
-extern DECLSPEC const SDL_assert_data * SDLCALL SDL_GetAssertionReport(void);
-
-/**
- *  \brief Reset the list of all assertion failures.
- *
- *  Reset list of all assertions triggered.
- *
- *  \sa SDL_GetAssertionReport
- */
-extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_assert_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_atomic.h b/deps/SDL2/include/SDL_atomic.h
deleted file mode 100644
index 48b0053..0000000
--- a/deps/SDL2/include/SDL_atomic.h
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- * \file SDL_atomic.h
- *
- * Atomic operations.
- *
- * IMPORTANT:
- * If you are not an expert in concurrent lockless programming, you should
- * only be using the atomic lock and reference counting functions in this
- * file.  In all other cases you should be protecting your data structures
- * with full mutexes.
- *
- * The list of "safe" functions to use are:
- *  SDL_AtomicLock()
- *  SDL_AtomicUnlock()
- *  SDL_AtomicIncRef()
- *  SDL_AtomicDecRef()
- *
- * Seriously, here be dragons!
- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- *
- * You can find out a little more about lockless programming and the
- * subtle issues that can arise here:
- * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
- *
- * There's also lots of good information here:
- * http://www.1024cores.net/home/lock-free-algorithms
- * http://preshing.com/
- *
- * These operations may or may not actually be implemented using
- * processor specific atomic operations. When possible they are
- * implemented as true processor specific atomic operations. When that
- * is not possible the are implemented using locks that *do* use the
- * available atomic operations.
- *
- * All of the atomic operations that modify memory are full memory barriers.
- */
-
-#ifndef _SDL_atomic_h_
-#define _SDL_atomic_h_
-
-#include "SDL_stdinc.h"
-#include "SDL_platform.h"
-
-#include "begin_code.h"
-
-/* Need to do this here because intrin.h has C++ code in it */
-/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
-#if defined(_MSC_VER) && (_MSC_VER >= 1500)
-#include <intrin.h>
-#define HAVE_MSC_ATOMICS 1
-#endif
-
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \name SDL AtomicLock
- *
- * The atomic locks are efficient spinlocks using CPU instructions,
- * but are vulnerable to starvation and can spin forever if a thread
- * holding a lock has been terminated.  For this reason you should
- * minimize the code executed inside an atomic lock and never do
- * expensive things like API or system calls while holding them.
- *
- * The atomic locks are not safe to lock recursively.
- *
- * Porting Note:
- * The spin lock functions and type are required and can not be
- * emulated because they are used in the atomic emulation code.
- */
-/* @{ */
-
-typedef int SDL_SpinLock;
-
-/**
- * \brief Try to lock a spin lock by setting it to a non-zero value.
- *
- * \param lock Points to the lock.
- *
- * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
-
-/**
- * \brief Lock a spin lock by setting it to a non-zero value.
- *
- * \param lock Points to the lock.
- */
-extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
-
-/**
- * \brief Unlock a spin lock by setting it to 0. Always returns immediately
- *
- * \param lock Points to the lock.
- */
-extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
-
-/* @} *//* SDL AtomicLock */
-
-
-/**
- * The compiler barrier prevents the compiler from reordering
- * reads and writes to globally visible variables across the call.
- */
-#if defined(_MSC_VER) && (_MSC_VER > 1200)
-void _ReadWriteBarrier(void);
-#pragma intrinsic(_ReadWriteBarrier)
-#define SDL_CompilerBarrier()   _ReadWriteBarrier()
-#elif defined(__GNUC__)
-#define SDL_CompilerBarrier()   __asm__ __volatile__ ("" : : : "memory")
-#else
-#define SDL_CompilerBarrier()   \
-{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
-#endif
-
-/**
- * Memory barriers are designed to prevent reads and writes from being
- * reordered by the compiler and being seen out of order on multi-core CPUs.
- *
- * A typical pattern would be for thread A to write some data and a flag,
- * and for thread B to read the flag and get the data. In this case you
- * would insert a release barrier between writing the data and the flag,
- * guaranteeing that the data write completes no later than the flag is
- * written, and you would insert an acquire barrier between reading the
- * flag and reading the data, to ensure that all the reads associated
- * with the flag have completed.
- *
- * In this pattern you should always see a release barrier paired with
- * an acquire barrier and you should gate the data reads/writes with a
- * single flag variable.
- *
- * For more information on these semantics, take a look at the blog post:
- * http://preshing.com/20120913/acquire-and-release-semantics
- */
-#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
-#define SDL_MemoryBarrierRelease()   __asm__ __volatile__ ("lwsync" : : : "memory")
-#define SDL_MemoryBarrierAcquire()   __asm__ __volatile__ ("lwsync" : : : "memory")
-#elif defined(__GNUC__) && defined(__arm__)
-#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
-#define SDL_MemoryBarrierRelease()   __asm__ __volatile__ ("dmb ish" : : : "memory")
-#define SDL_MemoryBarrierAcquire()   __asm__ __volatile__ ("dmb ish" : : : "memory")
-#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
-#ifdef __thumb__
-/* The mcr instruction isn't available in thumb mode, use real functions */
-extern DECLSPEC void SDLCALL SDL_MemoryBarrierRelease();
-extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquire();
-#else
-#define SDL_MemoryBarrierRelease()   __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
-#define SDL_MemoryBarrierAcquire()   __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
-#endif /* __thumb__ */
-#else
-#define SDL_MemoryBarrierRelease()   __asm__ __volatile__ ("" : : : "memory")
-#define SDL_MemoryBarrierAcquire()   __asm__ __volatile__ ("" : : : "memory")
-#endif /* __GNUC__ && __arm__ */
-#else
-/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
-#define SDL_MemoryBarrierRelease()  SDL_CompilerBarrier()
-#define SDL_MemoryBarrierAcquire()  SDL_CompilerBarrier()
-#endif
-
-
-/* Platform specific optimized versions of the atomic functions,
- * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE
- */
-#if defined(SDL_ATOMIC_DISABLED) && SDL_ATOMIC_DISABLED
-#define SDL_DISABLE_ATOMIC_INLINE
-#endif
-#ifndef SDL_DISABLE_ATOMIC_INLINE
-
-#ifdef HAVE_MSC_ATOMICS
-
-#define SDL_AtomicSet(a, v)     _InterlockedExchange((long*)&(a)->value, (v))
-#define SDL_AtomicAdd(a, v)     _InterlockedExchangeAdd((long*)&(a)->value, (v))
-#define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange((long*)&(a)->value, (newval), (oldval)) == (oldval))
-#define SDL_AtomicSetPtr(a, v)  _InterlockedExchangePointer((a), (v))
-#if _M_IX86
-#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchange((long*)(a), (long)(newval), (long)(oldval)) == (long)(oldval))
-#else
-#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchangePointer((a), (newval), (oldval)) == (oldval))
-#endif
-
-#elif defined(__MACOSX__)
-#include <libkern/OSAtomic.h>
-
-#define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((oldval), (newval), &(a)->value)
-#ifdef __LP64__
-#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap64Barrier((int64_t)(oldval), (int64_t)(newval), (int64_t*)(a))
-#else
-#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((int32_t)(oldval), (int32_t)(newval), (int32_t*)(a))
-#endif
-
-#elif defined(HAVE_GCC_ATOMICS)
-
-#define SDL_AtomicSet(a, v)     __sync_lock_test_and_set(&(a)->value, v)
-#define SDL_AtomicAdd(a, v)     __sync_fetch_and_add(&(a)->value, v)
-#define SDL_AtomicSetPtr(a, v)  __sync_lock_test_and_set(a, v)
-#define SDL_AtomicCAS(a, oldval, newval) __sync_bool_compare_and_swap(&(a)->value, oldval, newval)
-#define SDL_AtomicCASPtr(a, oldval, newval) __sync_bool_compare_and_swap(a, oldval, newval)
-
-#endif
-
-#endif /* !SDL_DISABLE_ATOMIC_INLINE */
-
-
-/**
- * \brief A type representing an atomic integer value.  It is a struct
- *        so people don't accidentally use numeric operations on it.
- */
-#ifndef SDL_atomic_t_defined
-typedef struct { int value; } SDL_atomic_t;
-#endif
-
-/**
- * \brief Set an atomic variable to a new value if it is currently an old value.
- *
- * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
- *
- * \note If you don't know what this function is for, you shouldn't use it!
-*/
-#ifndef SDL_AtomicCAS
-extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
-#endif
-
-/**
- * \brief Set an atomic variable to a value.
- *
- * \return The previous value of the atomic variable.
- */
-#ifndef SDL_AtomicSet
-SDL_FORCE_INLINE int SDL_AtomicSet(SDL_atomic_t *a, int v)
-{
-    int value;
-    do {
-        value = a->value;
-    } while (!SDL_AtomicCAS(a, value, v));
-    return value;
-}
-#endif
-
-/**
- * \brief Get the value of an atomic variable
- */
-#ifndef SDL_AtomicGet
-SDL_FORCE_INLINE int SDL_AtomicGet(SDL_atomic_t *a)
-{
-    int value = a->value;
-    SDL_CompilerBarrier();
-    return value;
-}
-#endif
-
-/**
- * \brief Add to an atomic variable.
- *
- * \return The previous value of the atomic variable.
- *
- * \note This same style can be used for any number operation
- */
-#ifndef SDL_AtomicAdd
-SDL_FORCE_INLINE int SDL_AtomicAdd(SDL_atomic_t *a, int v)
-{
-    int value;
-    do {
-        value = a->value;
-    } while (!SDL_AtomicCAS(a, value, (value + v)));
-    return value;
-}
-#endif
-
-/**
- * \brief Increment an atomic variable used as a reference count.
- */
-#ifndef SDL_AtomicIncRef
-#define SDL_AtomicIncRef(a)    SDL_AtomicAdd(a, 1)
-#endif
-
-/**
- * \brief Decrement an atomic variable used as a reference count.
- *
- * \return SDL_TRUE if the variable reached zero after decrementing,
- *         SDL_FALSE otherwise
- */
-#ifndef SDL_AtomicDecRef
-#define SDL_AtomicDecRef(a)    (SDL_AtomicAdd(a, -1) == 1)
-#endif
-
-/**
- * \brief Set a pointer to a new value if it is currently an old value.
- *
- * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
- *
- * \note If you don't know what this function is for, you shouldn't use it!
-*/
-#ifndef SDL_AtomicCASPtr
-extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void* *a, void *oldval, void *newval);
-#endif
-
-/**
- * \brief Set a pointer to a value atomically.
- *
- * \return The previous value of the pointer.
- */
-#ifndef SDL_AtomicSetPtr
-SDL_FORCE_INLINE void* SDL_AtomicSetPtr(void* *a, void* v)
-{
-    void* value;
-    do {
-        value = *a;
-    } while (!SDL_AtomicCASPtr(a, value, v));
-    return value;
-}
-#endif
-
-/**
- * \brief Get the value of a pointer atomically.
- */
-#ifndef SDL_AtomicGetPtr
-SDL_FORCE_INLINE void* SDL_AtomicGetPtr(void* *a)
-{
-    void* value = *a;
-    SDL_CompilerBarrier();
-    return value;
-}
-#endif
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-
-#include "close_code.h"
-
-#endif /* _SDL_atomic_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_audio.h b/deps/SDL2/include/SDL_audio.h
deleted file mode 100644
index b9da236..0000000
--- a/deps/SDL2/include/SDL_audio.h
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_audio.h
- *
- *  Access to the raw audio mixing buffer for the SDL library.
- */
-
-#ifndef _SDL_audio_h
-#define _SDL_audio_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_endian.h"
-#include "SDL_mutex.h"
-#include "SDL_thread.h"
-#include "SDL_rwops.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief Audio format flags.
- *
- *  These are what the 16 bits in SDL_AudioFormat currently mean...
- *  (Unspecified bits are always zero).
- *
- *  \verbatim
-    ++-----------------------sample is signed if set
-    ||
-    ||       ++-----------sample is bigendian if set
-    ||       ||
-    ||       ||          ++---sample is float if set
-    ||       ||          ||
-    ||       ||          || +---sample bit size---+
-    ||       ||          || |                     |
-    15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
-    \endverbatim
- *
- *  There are macros in SDL 2.0 and later to query these bits.
- */
-typedef Uint16 SDL_AudioFormat;
-
-/**
- *  \name Audio flags
- */
-/* @{ */
-
-#define SDL_AUDIO_MASK_BITSIZE       (0xFF)
-#define SDL_AUDIO_MASK_DATATYPE      (1<<8)
-#define SDL_AUDIO_MASK_ENDIAN        (1<<12)
-#define SDL_AUDIO_MASK_SIGNED        (1<<15)
-#define SDL_AUDIO_BITSIZE(x)         (x & SDL_AUDIO_MASK_BITSIZE)
-#define SDL_AUDIO_ISFLOAT(x)         (x & SDL_AUDIO_MASK_DATATYPE)
-#define SDL_AUDIO_ISBIGENDIAN(x)     (x & SDL_AUDIO_MASK_ENDIAN)
-#define SDL_AUDIO_ISSIGNED(x)        (x & SDL_AUDIO_MASK_SIGNED)
-#define SDL_AUDIO_ISINT(x)           (!SDL_AUDIO_ISFLOAT(x))
-#define SDL_AUDIO_ISLITTLEENDIAN(x)  (!SDL_AUDIO_ISBIGENDIAN(x))
-#define SDL_AUDIO_ISUNSIGNED(x)      (!SDL_AUDIO_ISSIGNED(x))
-
-/**
- *  \name Audio format flags
- *
- *  Defaults to LSB byte order.
- */
-/* @{ */
-#define AUDIO_U8        0x0008  /**< Unsigned 8-bit samples */
-#define AUDIO_S8        0x8008  /**< Signed 8-bit samples */
-#define AUDIO_U16LSB    0x0010  /**< Unsigned 16-bit samples */
-#define AUDIO_S16LSB    0x8010  /**< Signed 16-bit samples */
-#define AUDIO_U16MSB    0x1010  /**< As above, but big-endian byte order */
-#define AUDIO_S16MSB    0x9010  /**< As above, but big-endian byte order */
-#define AUDIO_U16       AUDIO_U16LSB
-#define AUDIO_S16       AUDIO_S16LSB
-/* @} */
-
-/**
- *  \name int32 support
- */
-/* @{ */
-#define AUDIO_S32LSB    0x8020  /**< 32-bit integer samples */
-#define AUDIO_S32MSB    0x9020  /**< As above, but big-endian byte order */
-#define AUDIO_S32       AUDIO_S32LSB
-/* @} */
-
-/**
- *  \name float32 support
- */
-/* @{ */
-#define AUDIO_F32LSB    0x8120  /**< 32-bit floating point samples */
-#define AUDIO_F32MSB    0x9120  /**< As above, but big-endian byte order */
-#define AUDIO_F32       AUDIO_F32LSB
-/* @} */
-
-/**
- *  \name Native audio byte ordering
- */
-/* @{ */
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define AUDIO_U16SYS    AUDIO_U16LSB
-#define AUDIO_S16SYS    AUDIO_S16LSB
-#define AUDIO_S32SYS    AUDIO_S32LSB
-#define AUDIO_F32SYS    AUDIO_F32LSB
-#else
-#define AUDIO_U16SYS    AUDIO_U16MSB
-#define AUDIO_S16SYS    AUDIO_S16MSB
-#define AUDIO_S32SYS    AUDIO_S32MSB
-#define AUDIO_F32SYS    AUDIO_F32MSB
-#endif
-/* @} */
-
-/**
- *  \name Allow change flags
- *
- *  Which audio format changes are allowed when opening a device.
- */
-/* @{ */
-#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE    0x00000001
-#define SDL_AUDIO_ALLOW_FORMAT_CHANGE       0x00000002
-#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE     0x00000004
-#define SDL_AUDIO_ALLOW_ANY_CHANGE          (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
-/* @} */
-
-/* @} *//* Audio flags */
-
-/**
- *  This function is called when the audio device needs more data.
- *
- *  \param userdata An application-specific parameter saved in
- *                  the SDL_AudioSpec structure
- *  \param stream A pointer to the audio data buffer.
- *  \param len    The length of that buffer in bytes.
- *
- *  Once the callback returns, the buffer will no longer be valid.
- *  Stereo samples are stored in a LRLRLR ordering.
- */
-typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
-                                            int len);
-
-/**
- *  The calculated values in this structure are calculated by SDL_OpenAudio().
- */
-typedef struct SDL_AudioSpec
-{
-    int freq;                   /**< DSP frequency -- samples per second */
-    SDL_AudioFormat format;     /**< Audio data format */
-    Uint8 channels;             /**< Number of channels: 1 mono, 2 stereo */
-    Uint8 silence;              /**< Audio buffer silence value (calculated) */
-    Uint16 samples;             /**< Audio buffer size in samples (power of 2) */
-    Uint16 padding;             /**< Necessary for some compile environments */
-    Uint32 size;                /**< Audio buffer size in bytes (calculated) */
-    SDL_AudioCallback callback;
-    void *userdata;
-} SDL_AudioSpec;
-
-
-struct SDL_AudioCVT;
-typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
-                                          SDL_AudioFormat format);
-
-/**
- *  A structure to hold a set of audio conversion filters and buffers.
- */
-#ifdef __GNUC__
-/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't
-   pad it out to 88 bytes to guarantee ABI compatibility between compilers.
-   vvv
-   The next time we rev the ABI, make sure to size the ints and add padding.
-*/
-#define SDL_AUDIOCVT_PACKED __attribute__((packed))
-#else
-#define SDL_AUDIOCVT_PACKED
-#endif
-/* */
-typedef struct SDL_AudioCVT
-{
-    int needed;                 /**< Set to 1 if conversion possible */
-    SDL_AudioFormat src_format; /**< Source audio format */
-    SDL_AudioFormat dst_format; /**< Target audio format */
-    double rate_incr;           /**< Rate conversion increment */
-    Uint8 *buf;                 /**< Buffer to hold entire audio data */
-    int len;                    /**< Length of original audio buffer */
-    int len_cvt;                /**< Length of converted audio buffer */
-    int len_mult;               /**< buffer must be len*len_mult big */
-    double len_ratio;           /**< Given len, final size is len*len_ratio */
-    SDL_AudioFilter filters[10];        /**< Filter list */
-    int filter_index;           /**< Current audio conversion function */
-} SDL_AUDIOCVT_PACKED SDL_AudioCVT;
-
-
-/* Function prototypes */
-
-/**
- *  \name Driver discovery functions
- *
- *  These functions return the list of built in audio drivers, in the
- *  order that they are normally initialized by default.
- */
-/* @{ */
-extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
-extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
-/* @} */
-
-/**
- *  \name Initialization and cleanup
- *
- *  \internal These functions are used internally, and should not be used unless
- *            you have a specific need to specify the audio driver you want to
- *            use.  You should normally use SDL_Init() or SDL_InitSubSystem().
- */
-/* @{ */
-extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
-extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
-/* @} */
-
-/**
- *  This function returns the name of the current audio driver, or NULL
- *  if no driver has been initialized.
- */
-extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
-
-/**
- *  This function opens the audio device with the desired parameters, and
- *  returns 0 if successful, placing the actual hardware parameters in the
- *  structure pointed to by \c obtained.  If \c obtained is NULL, the audio
- *  data passed to the callback function will be guaranteed to be in the
- *  requested format, and will be automatically converted to the hardware
- *  audio format if necessary.  This function returns -1 if it failed
- *  to open the audio device, or couldn't set up the audio thread.
- *
- *  When filling in the desired audio spec structure,
- *    - \c desired->freq should be the desired audio frequency in samples-per-
- *      second.
- *    - \c desired->format should be the desired audio format.
- *    - \c desired->samples is the desired size of the audio buffer, in
- *      samples.  This number should be a power of two, and may be adjusted by
- *      the audio driver to a value more suitable for the hardware.  Good values
- *      seem to range between 512 and 8096 inclusive, depending on the
- *      application and CPU speed.  Smaller values yield faster response time,
- *      but can lead to underflow if the application is doing heavy processing
- *      and cannot fill the audio buffer in time.  A stereo sample consists of
- *      both right and left channels in LR ordering.
- *      Note that the number of samples is directly related to time by the
- *      following formula:  \code ms = (samples*1000)/freq \endcode
- *    - \c desired->size is the size in bytes of the audio buffer, and is
- *      calculated by SDL_OpenAudio().
- *    - \c desired->silence is the value used to set the buffer to silence,
- *      and is calculated by SDL_OpenAudio().
- *    - \c desired->callback should be set to a function that will be called
- *      when the audio device is ready for more data.  It is passed a pointer
- *      to the audio buffer, and the length in bytes of the audio buffer.
- *      This function usually runs in a separate thread, and so you should
- *      protect data structures that it accesses by calling SDL_LockAudio()
- *      and SDL_UnlockAudio() in your code.
- *    - \c desired->userdata is passed as the first parameter to your callback
- *      function.
- *
- *  The audio device starts out playing silence when it's opened, and should
- *  be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
- *  for your audio callback function to be called.  Since the audio driver
- *  may modify the requested size of the audio buffer, you should allocate
- *  any local mixing buffers after you open the audio device.
- */
-extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
-                                          SDL_AudioSpec * obtained);
-
-/**
- *  SDL Audio Device IDs.
- *
- *  A successful call to SDL_OpenAudio() is always device id 1, and legacy
- *  SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
- *  always returns devices >= 2 on success. The legacy calls are good both
- *  for backwards compatibility and when you don't care about multiple,
- *  specific, or capture devices.
- */
-typedef Uint32 SDL_AudioDeviceID;
-
-/**
- *  Get the number of available devices exposed by the current driver.
- *  Only valid after a successfully initializing the audio subsystem.
- *  Returns -1 if an explicit list of devices can't be determined; this is
- *  not an error. For example, if SDL is set up to talk to a remote audio
- *  server, it can't list every one available on the Internet, but it will
- *  still allow a specific host to be specified to SDL_OpenAudioDevice().
- *
- *  In many common cases, when this function returns a value <= 0, it can still
- *  successfully open the default device (NULL for first argument of
- *  SDL_OpenAudioDevice()).
- */
-extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
-
-/**
- *  Get the human-readable name of a specific audio device.
- *  Must be a value between 0 and (number of audio devices-1).
- *  Only valid after a successfully initializing the audio subsystem.
- *  The values returned by this function reflect the latest call to
- *  SDL_GetNumAudioDevices(); recall that function to redetect available
- *  hardware.
- *
- *  The string returned by this function is UTF-8 encoded, read-only, and
- *  managed internally. You are not to free it. If you need to keep the
- *  string for any length of time, you should make your own copy of it, as it
- *  will be invalid next time any of several other SDL functions is called.
- */
-extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
-                                                           int iscapture);
-
-
-/**
- *  Open a specific audio device. Passing in a device name of NULL requests
- *  the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
- *
- *  The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but
- *  some drivers allow arbitrary and driver-specific strings, such as a
- *  hostname/IP address for a remote audio server, or a filename in the
- *  diskaudio driver.
- *
- *  \return 0 on error, a valid device ID that is >= 2 on success.
- *
- *  SDL_OpenAudio(), unlike this function, always acts on device ID 1.
- */
-extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char
-                                                              *device,
-                                                              int iscapture,
-                                                              const
-                                                              SDL_AudioSpec *
-                                                              desired,
-                                                              SDL_AudioSpec *
-                                                              obtained,
-                                                              int
-                                                              allowed_changes);
-
-
-
-/**
- *  \name Audio state
- *
- *  Get the current audio state.
- */
-/* @{ */
-typedef enum
-{
-    SDL_AUDIO_STOPPED = 0,
-    SDL_AUDIO_PLAYING,
-    SDL_AUDIO_PAUSED
-} SDL_AudioStatus;
-extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void);
-
-extern DECLSPEC SDL_AudioStatus SDLCALL
-SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev);
-/* @} *//* Audio State */
-
-/**
- *  \name Pause audio functions
- *
- *  These functions pause and unpause the audio callback processing.
- *  They should be called with a parameter of 0 after opening the audio
- *  device to start playing sound.  This is so you can safely initialize
- *  data for your callback function after opening the audio device.
- *  Silence will be written to the audio device during the pause.
- */
-/* @{ */
-extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
-extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
-                                                  int pause_on);
-/* @} *//* Pause audio functions */
-
-/**
- *  This function loads a WAVE from the data source, automatically freeing
- *  that source if \c freesrc is non-zero.  For example, to load a WAVE file,
- *  you could do:
- *  \code
- *      SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
- *  \endcode
- *
- *  If this function succeeds, it returns the given SDL_AudioSpec,
- *  filled with the audio data format of the wave data, and sets
- *  \c *audio_buf to a malloc()'d buffer containing the audio data,
- *  and sets \c *audio_len to the length of that audio buffer, in bytes.
- *  You need to free the audio buffer with SDL_FreeWAV() when you are
- *  done with it.
- *
- *  This function returns NULL and sets the SDL error message if the
- *  wave file cannot be opened, uses an unknown data format, or is
- *  corrupt.  Currently raw and MS-ADPCM WAVE files are supported.
- */
-extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
-                                                      int freesrc,
-                                                      SDL_AudioSpec * spec,
-                                                      Uint8 ** audio_buf,
-                                                      Uint32 * audio_len);
-
-/**
- *  Loads a WAV from a file.
- *  Compatibility convenience function.
- */
-#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
-    SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
-
-/**
- *  This function frees data previously allocated with SDL_LoadWAV_RW()
- */
-extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf);
-
-/**
- *  This function takes a source format and rate and a destination format
- *  and rate, and initializes the \c cvt structure with information needed
- *  by SDL_ConvertAudio() to convert a buffer of audio data from one format
- *  to the other.
- *
- *  \return -1 if the format conversion is not supported, 0 if there's
- *  no conversion needed, or 1 if the audio filter is set up.
- */
-extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
-                                              SDL_AudioFormat src_format,
-                                              Uint8 src_channels,
-                                              int src_rate,
-                                              SDL_AudioFormat dst_format,
-                                              Uint8 dst_channels,
-                                              int dst_rate);
-
-/**
- *  Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(),
- *  created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of
- *  audio data in the source format, this function will convert it in-place
- *  to the desired format.
- *
- *  The data conversion may expand the size of the audio data, so the buffer
- *  \c cvt->buf should be allocated after the \c cvt structure is initialized by
- *  SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.
- */
-extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt);
-
-#define SDL_MIX_MAXVOLUME 128
-/**
- *  This takes two audio buffers of the playing audio format and mixes
- *  them, performing addition, volume adjustment, and overflow clipping.
- *  The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME
- *  for full audio volume.  Note this does not change hardware volume.
- *  This is provided for convenience -- you can mix your own audio data.
- */
-extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src,
-                                          Uint32 len, int volume);
-
-/**
- *  This works like SDL_MixAudio(), but you specify the audio format instead of
- *  using the format of audio device 1. Thus it can be used when no audio
- *  device is open at all.
- */
-extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
-                                                const Uint8 * src,
-                                                SDL_AudioFormat format,
-                                                Uint32 len, int volume);
-
-/**
- *  \name Audio lock functions
- *
- *  The lock manipulated by these functions protects the callback function.
- *  During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that
- *  the callback function is not running.  Do not call these from the callback
- *  function or you will cause deadlock.
- */
-/* @{ */
-extern DECLSPEC void SDLCALL SDL_LockAudio(void);
-extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev);
-extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
-extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev);
-/* @} *//* Audio lock functions */
-
-/**
- *  This function shuts down audio processing and closes the audio device.
- */
-extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
-extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_audio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_bits.h b/deps/SDL2/include/SDL_bits.h
deleted file mode 100644
index b1ed20b..0000000
--- a/deps/SDL2/include/SDL_bits.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_bits.h
- *
- *  Functions for fiddling with bits and bitmasks.
- */
-
-#ifndef _SDL_bits_h
-#define _SDL_bits_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \file SDL_bits.h
- */
-
-/**
- *  Get the index of the most significant bit. Result is undefined when called
- *  with 0. This operation can also be stated as "count leading zeroes" and
- *  "log base 2".
- *
- *  \return Index of the most significant bit, or -1 if the value is 0.
- */
-SDL_FORCE_INLINE int
-SDL_MostSignificantBitIndex32(Uint32 x)
-{
-#if defined(__GNUC__) && __GNUC__ >= 4
-    /* Count Leading Zeroes builtin in GCC.
-     * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
-     */
-    if (x == 0) {
-        return -1;
-    }
-    return 31 - __builtin_clz(x);
-#else
-    /* Based off of Bit Twiddling Hacks by Sean Eron Anderson
-     * <seander at cs.stanford.edu>, released in the public domain.
-     * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
-     */
-    const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
-    const int    S[] = {1, 2, 4, 8, 16};
-
-    int msbIndex = 0;
-    int i;
-
-    if (x == 0) {
-        return -1;
-    }
-
-    for (i = 4; i >= 0; i--)
-    {
-        if (x & b[i])
-        {
-            x >>= S[i];
-            msbIndex |= S[i];
-        }
-    }
-
-    return msbIndex;
-#endif
-}
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_bits_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_blendmode.h b/deps/SDL2/include/SDL_blendmode.h
deleted file mode 100644
index 85aa474..0000000
--- a/deps/SDL2/include/SDL_blendmode.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_blendmode.h
- *
- *  Header file declaring the SDL_BlendMode enumeration
- */
-
-#ifndef _SDL_blendmode_h
-#define _SDL_blendmode_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief The blend mode used in SDL_RenderCopy() and drawing operations.
- */
-typedef enum
-{
-    SDL_BLENDMODE_NONE = 0x00000000,     /**< no blending
-                                              dstRGBA = srcRGBA */
-    SDL_BLENDMODE_BLEND = 0x00000001,    /**< alpha blending
-                                              dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
-                                              dstA = srcA + (dstA * (1-srcA)) */
-    SDL_BLENDMODE_ADD = 0x00000002,      /**< additive blending
-                                              dstRGB = (srcRGB * srcA) + dstRGB
-                                              dstA = dstA */
-    SDL_BLENDMODE_MOD = 0x00000004       /**< color modulate
-                                              dstRGB = srcRGB * dstRGB
-                                              dstA = dstA */
-} SDL_BlendMode;
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_video_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_clipboard.h b/deps/SDL2/include/SDL_clipboard.h
deleted file mode 100644
index 1f5742d..0000000
--- a/deps/SDL2/include/SDL_clipboard.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- * \file SDL_clipboard.h
- *
- * Include file for SDL clipboard handling
- */
-
-#ifndef _SDL_clipboard_h
-#define _SDL_clipboard_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Function prototypes */
-
-/**
- * \brief Put UTF-8 text into the clipboard
- *
- * \sa SDL_GetClipboardText()
- */
-extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
-
-/**
- * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
- *
- * \sa SDL_SetClipboardText()
- */
-extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
-
-/**
- * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
- *
- * \sa SDL_GetClipboardText()
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_clipboard_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_config.h b/deps/SDL2/include/SDL_config.h
deleted file mode 100644
index 7cbedf5..0000000
--- a/deps/SDL2/include/SDL_config.h
+++ /dev/null
@@ -1,322 +0,0 @@
-/* include/SDL_config.h.  Generated from SDL_config.h.in by configure.  */
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_h
-#define _SDL_config_h
-
-/**
- *  \file SDL_config.h.in
- *
- *  This is a set of defines to configure the SDL features
- */
-
-/* General platform specific identifiers */
-#include "SDL_platform.h"
-
-/* Make sure that this isn't included by Visual C++ */
-#ifdef _MSC_VER
-#error You should run hg revert SDL_config.h 
-#endif
-
-/* C language features */
-/* #undef const */
-/* #undef inline */
-/* #undef volatile */
-
-/* C datatypes */
-#ifdef __LP64__
-#define SIZEOF_VOIDP 8
-#else
-#define SIZEOF_VOIDP 4
-#endif
-#define HAVE_GCC_ATOMICS 1
-/* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */
-#define HAVE_PTHREAD_SPINLOCK 1
-
-/* Comment this if you want to build without any C library requirements */
-#define HAVE_LIBC 1
-#if HAVE_LIBC
-
-/* Useful headers */
-#define HAVE_ALLOCA_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
-#define HAVE_ICONV_H 1
-#define HAVE_SIGNAL_H 1
-/* #undef HAVE_ALTIVEC_H */
-/* #undef HAVE_PTHREAD_NP_H */
-/* #undef HAVE_LIBUDEV_H */
-#define HAVE_DBUS_DBUS_H 1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_UNSETENV 1
-#endif
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_BCOPY 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-/* #undef HAVE_STRLCPY */
-/* #undef HAVE_STRLCAT */
-#define HAVE_STRDUP 1
-/* #undef HAVE__STRREV */
-/* #undef HAVE__STRUPR */
-/* #undef HAVE__STRLWR */
-/* #undef HAVE_INDEX */
-/* #undef HAVE_RINDEX */
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-/* #undef HAVE_ITOA */
-/* #undef HAVE__LTOA */
-/* #undef HAVE__UITOA */
-/* #undef HAVE__ULTOA */
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-/* #undef HAVE__I64TOA */
-/* #undef HAVE__UI64TOA */
-#define HAVE_STRTOLL 1
-#define HAVE_STRTOULL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-/* #undef HAVE__STRICMP */
-#define HAVE_STRCASECMP 1
-/* #undef HAVE__STRNICMP */
-#define HAVE_STRNCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF 1
-#define HAVE_VSNPRINTF 1
-#define HAVE_M_PI /**/
-#define HAVE_ATAN 1
-#define HAVE_ATAN2 1
-#define HAVE_CEIL 1
-#define HAVE_COPYSIGN 1
-#define HAVE_COS 1
-#define HAVE_COSF 1
-#define HAVE_FABS 1
-#define HAVE_FLOOR 1
-#define HAVE_LOG 1
-#define HAVE_POW 1
-#define HAVE_SCALBN 1
-#define HAVE_SIN 1
-#define HAVE_SINF 1
-#define HAVE_SQRT 1
-#define HAVE_FSEEKO 1
-#define HAVE_FSEEKO64 1
-#define HAVE_SIGACTION 1
-#define HAVE_SA_SIGACTION 1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP 1
-#define HAVE_SYSCONF 1
-/* #undef HAVE_SYSCTLBYNAME */
-#define HAVE_CLOCK_GETTIME 1
-/* #undef HAVE_GETPAGESIZE */
-#define HAVE_MPROTECT 1
-#define HAVE_ICONV 1
-#define HAVE_PTHREAD_SETNAME_NP 1
-/* #undef HAVE_PTHREAD_SET_NAME_NP */
-#define HAVE_SEM_TIMEDWAIT 1
-
-#else
-#define HAVE_STDARG_H 1
-#define HAVE_STDDEF_H 1
-#define HAVE_STDINT_H 1
-#endif /* HAVE_LIBC */
-
-/* SDL internal assertion support */
-/* #undef SDL_DEFAULT_ASSERT_LEVEL */
-
-/* Allow disabling of core subsystems */
-/* #undef SDL_ATOMIC_DISABLED */
-/* #undef SDL_AUDIO_DISABLED */
-#define SDL_CPUINFO_DISABLED 1
-#define SDL_EVENTS_DISABLED 1
-#define SDL_FILE_DISABLED 1
-#define SDL_JOYSTICK_DISABLED 1
-#define SDL_HAPTIC_DISABLED 1
-#define SDL_LOADSO_DISABLED 1
-#define SDL_RENDER_DISABLED 1
-/* #undef SDL_THREADS_DISABLED */
-#define SDL_TIMERS_DISABLED 1
-#define SDL_VIDEO_DISABLED 1
-#define SDL_POWER_DISABLED 1
-/* #undef SDL_FILESYSTEM_DISABLED */
-
-/* Enable various audio drivers */
-/* #undef SDL_AUDIO_DRIVER_ALSA */
-/* #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
-/* #undef SDL_AUDIO_DRIVER_ARTS */
-/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
-/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO */
-/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC */
-/* #undef SDL_AUDIO_DRIVER_BEOSAUDIO */
-/* #undef SDL_AUDIO_DRIVER_BSD */
-/* #undef SDL_AUDIO_DRIVER_COREAUDIO */
-#define SDL_AUDIO_DRIVER_DISK 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
-/* #undef SDL_AUDIO_DRIVER_XAUDIO2 */
-/* #undef SDL_AUDIO_DRIVER_DSOUND */
-/* #undef SDL_AUDIO_DRIVER_ESD */
-/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
-/* #undef SDL_AUDIO_DRIVER_NAS */
-/* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */
-/* #undef SDL_AUDIO_DRIVER_SNDIO */
-/* #undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC */
-#define SDL_AUDIO_DRIVER_OSS 1
-/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
-/* #undef SDL_AUDIO_DRIVER_PAUDIO */
-/* #undef SDL_AUDIO_DRIVER_QSA */
-/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
-/* #undef SDL_AUDIO_DRIVER_WINMM */
-/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND */
-/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */
-
-/* Enable various input drivers */
-#define SDL_INPUT_LINUXEV 1
-#define SDL_INPUT_LINUXKD 1
-/* #undef SDL_INPUT_TSLIB */
-/* #undef SDL_JOYSTICK_BEOS */
-/* #undef SDL_JOYSTICK_DINPUT */
-/* #undef SDL_JOYSTICK_DUMMY */
-/* #undef SDL_JOYSTICK_IOKIT */
-/* #undef SDL_JOYSTICK_LINUX */
-/* #undef SDL_JOYSTICK_WINMM */
-/* #undef SDL_JOYSTICK_USBHID */
-/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
-/* #undef SDL_HAPTIC_DUMMY */
-/* #undef SDL_HAPTIC_LINUX */
-/* #undef SDL_HAPTIC_IOKIT */
-/* #undef SDL_HAPTIC_DINPUT */
-
-/* Enable various shared object loading systems */
-/* #undef SDL_LOADSO_BEOS */
-#define SDL_LOADSO_DLOPEN 1
-/* #undef SDL_LOADSO_DUMMY */
-/* #undef SDL_LOADSO_LDG */
-/* #undef SDL_LOADSO_WINDOWS */
-
-/* Enable various threading systems */
-/* #undef SDL_THREAD_BEOS */
-#define SDL_THREAD_PTHREAD 1
-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
-/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
-/* #undef SDL_THREAD_WINDOWS */
-
-/* Enable various timer systems */
-/* #undef SDL_TIMER_BEOS */
-/* #undef SDL_TIMER_DUMMY */
-/* #undef SDL_TIMER_UNIX */
-/* #undef SDL_TIMER_WINDOWS */
-
-/* Enable various video drivers */
-/* #undef SDL_VIDEO_DRIVER_BWINDOW */
-/* #undef SDL_VIDEO_DRIVER_COCOA */
-/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
-/* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */
-#define SDL_VIDEO_DRIVER_DUMMY 1
-/* #undef SDL_VIDEO_DRIVER_WINDOWS */
-/* #undef SDL_VIDEO_DRIVER_X11 */
-/* #undef SDL_VIDEO_DRIVER_RPI */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE */
-/* #undef SDL_VIDEO_DRIVER_X11_XCURSOR */
-/* #undef SDL_VIDEO_DRIVER_X11_XINERAMA */
-/* #undef SDL_VIDEO_DRIVER_X11_XINPUT2 */
-/* #undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH */
-/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */
-/* #undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER */
-/* #undef SDL_VIDEO_DRIVER_X11_XSHAPE */
-/* #undef SDL_VIDEO_DRIVER_X11_XVIDMODE */
-/* #undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */
-/* #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 */
-/* #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY */
-/* #undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM */
-
-/* #undef SDL_VIDEO_RENDER_D3D */
-/* #undef SDL_VIDEO_RENDER_OGL */
-/* #undef SDL_VIDEO_RENDER_OGL_ES */
-/* #undef SDL_VIDEO_RENDER_OGL_ES2 */
-/* #undef SDL_VIDEO_RENDER_DIRECTFB */
-
-/* Enable OpenGL support */
-/* #undef SDL_VIDEO_OPENGL */
-/* #undef SDL_VIDEO_OPENGL_ES */
-/* #undef SDL_VIDEO_OPENGL_ES2 */
-/* #undef SDL_VIDEO_OPENGL_BGL */
-/* #undef SDL_VIDEO_OPENGL_CGL */
-/* #undef SDL_VIDEO_OPENGL_EGL */
-/* #undef SDL_VIDEO_OPENGL_GLX */
-/* #undef SDL_VIDEO_OPENGL_WGL */
-/* #undef SDL_VIDEO_OPENGL_OSMESA */
-/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
-
-/* Enable system power support */
-/* #undef SDL_POWER_LINUX */
-/* #undef SDL_POWER_WINDOWS */
-/* #undef SDL_POWER_MACOSX */
-/* #undef SDL_POWER_BEOS */
-/* #undef SDL_POWER_HARDWIRED */
-
-/* Enable system filesystem support */
-/* #undef SDL_FILESYSTEM_BEOS */
-/* #undef SDL_FILESYSTEM_COCOA */
-/* #undef SDL_FILESYSTEM_DUMMY */
-#define SDL_FILESYSTEM_UNIX 1
-/* #undef SDL_FILESYSTEM_WINDOWS */
-
-/* Enable assembly routines */
-#define SDL_ASSEMBLY_ROUTINES 1
-/* #undef SDL_ALTIVEC_BLITTERS */
-
-#endif /* _SDL_config_h */
diff --git a/deps/SDL2/include/SDL_config.h.cmake b/deps/SDL2/include/SDL_config.h.cmake
deleted file mode 100644
index 66107e4..0000000
--- a/deps/SDL2/include/SDL_config.h.cmake
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_h
-#define _SDL_config_h
-
-/**
- *  \file SDL_config.h.in
- *
- *  This is a set of defines to configure the SDL features
- */
-
-/* General platform specific identifiers */
-#include "SDL_platform.h"
-
-/* C language features */
-#cmakedefine const @HAVE_CONST@
-#cmakedefine inline @HAVE_INLINE@
-#cmakedefine volatile @HAVE_VOLATILE@
-
-/* C datatypes */
-/* Define SIZEOF_VOIDP for 64/32 architectures */
-#ifdef __LP64__
-#define SIZEOF_VOIDP 8
-#else
-#define SIZEOF_VOIDP 4
-#endif
-
-#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@
-#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@
-#cmakedefine HAVE_PTHREAD_SPINLOCK @HAVE_PTHREAD_SPINLOCK@
-
-/* Comment this if you want to build without any C library requirements */
-#cmakedefine HAVE_LIBC 1
-#if HAVE_LIBC
-
-/* Useful headers */
-#cmakedefine HAVE_ALLOCA_H 1
-#cmakedefine HAVE_SYS_TYPES_H 1
-#cmakedefine HAVE_STDIO_H 1
-#cmakedefine STDC_HEADERS 1
-#cmakedefine HAVE_STDLIB_H 1
-#cmakedefine HAVE_STDARG_H 1
-#cmakedefine HAVE_MALLOC_H 1
-#cmakedefine HAVE_MEMORY_H 1
-#cmakedefine HAVE_STRING_H 1
-#cmakedefine HAVE_STRINGS_H 1
-#cmakedefine HAVE_INTTYPES_H 1
-#cmakedefine HAVE_STDINT_H 1
-#cmakedefine HAVE_CTYPE_H 1
-#cmakedefine HAVE_MATH_H 1
-#cmakedefine HAVE_ICONV_H 1
-#cmakedefine HAVE_SIGNAL_H 1
-#cmakedefine HAVE_ALTIVEC_H 1
-#cmakedefine HAVE_PTHREAD_NP_H 1
-#cmakedefine HAVE_LIBUDEV_H 1
-#cmakedefine HAVE_DBUS_DBUS_H 1
-
-/* C library functions */
-#cmakedefine HAVE_MALLOC 1
-#cmakedefine HAVE_CALLOC 1
-#cmakedefine HAVE_REALLOC 1
-#cmakedefine HAVE_FREE 1
-#cmakedefine HAVE_ALLOCA 1
-#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
-#cmakedefine HAVE_GETENV 1
-#cmakedefine HAVE_SETENV 1
-#cmakedefine HAVE_PUTENV 1
-#cmakedefine HAVE_UNSETENV 1
-#endif
-#cmakedefine HAVE_QSORT 1
-#cmakedefine HAVE_ABS 1
-#cmakedefine HAVE_BCOPY 1
-#cmakedefine HAVE_MEMSET 1
-#cmakedefine HAVE_MEMCPY 1
-#cmakedefine HAVE_MEMMOVE 1
-#cmakedefine HAVE_MEMCMP 1
-#cmakedefine HAVE_STRLEN 1
-#cmakedefine HAVE_STRLCPY 1
-#cmakedefine HAVE_STRLCAT 1
-#cmakedefine HAVE_STRDUP 1
-#cmakedefine HAVE__STRREV 1
-#cmakedefine HAVE__STRUPR 1
-#cmakedefine HAVE__STRLWR 1
-#cmakedefine HAVE_INDEX 1
-#cmakedefine HAVE_RINDEX 1
-#cmakedefine HAVE_STRCHR 1
-#cmakedefine HAVE_STRRCHR 1
-#cmakedefine HAVE_STRSTR 1
-#cmakedefine HAVE_ITOA 1
-#cmakedefine HAVE__LTOA 1
-#cmakedefine HAVE__UITOA 1
-#cmakedefine HAVE__ULTOA 1
-#cmakedefine HAVE_STRTOL 1
-#cmakedefine HAVE_STRTOUL 1
-#cmakedefine HAVE__I64TOA 1
-#cmakedefine HAVE__UI64TOA 1
-#cmakedefine HAVE_STRTOLL 1
-#cmakedefine HAVE_STRTOULL 1
-#cmakedefine HAVE_STRTOD 1
-#cmakedefine HAVE_ATOI 1
-#cmakedefine HAVE_ATOF 1
-#cmakedefine HAVE_STRCMP 1
-#cmakedefine HAVE_STRNCMP 1
-#cmakedefine HAVE__STRICMP 1
-#cmakedefine HAVE_STRCASECMP 1
-#cmakedefine HAVE__STRNICMP 1
-#cmakedefine HAVE_STRNCASECMP 1
-#cmakedefine HAVE_SSCANF 1
-#cmakedefine HAVE_SNPRINTF 1
-#cmakedefine HAVE_VSNPRINTF 1
-#cmakedefine HAVE_M_PI 1
-#cmakedefine HAVE_ATAN 1
-#cmakedefine HAVE_ATAN2 1
-#cmakedefine HAVE_CEIL 1
-#cmakedefine HAVE_COPYSIGN 1
-#cmakedefine HAVE_COS 1
-#cmakedefine HAVE_COSF 1
-#cmakedefine HAVE_FABS 1
-#cmakedefine HAVE_FLOOR 1
-#cmakedefine HAVE_LOG 1
-#cmakedefine HAVE_POW 1
-#cmakedefine HAVE_SCALBN 1
-#cmakedefine HAVE_SIN 1
-#cmakedefine HAVE_SINF 1
-#cmakedefine HAVE_SQRT 1
-#cmakedefine HAVE_FSEEKO 1
-#cmakedefine HAVE_FSEEKO64 1
-#cmakedefine HAVE_SIGACTION 1
-#cmakedefine HAVE_SA_SIGACTION 1
-#cmakedefine HAVE_SETJMP 1
-#cmakedefine HAVE_NANOSLEEP 1
-#cmakedefine HAVE_SYSCONF 1
-#cmakedefine HAVE_SYSCTLBYNAME 1
-#cmakedefine HAVE_CLOCK_GETTIME 1
-#cmakedefine HAVE_GETPAGESIZE 1
-#cmakedefine HAVE_MPROTECT 1
-#cmakedefine HAVE_ICONV 1
-#cmakedefine HAVE_PTHREAD_SETNAME_NP 1
-#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1
-#cmakedefine HAVE_SEM_TIMEDWAIT 1
-#elif __WIN32__
-#cmakedefine HAVE_STDARG_H 1
-#cmakedefine HAVE_STDDEF_H 1
-#else
-/* We may need some replacement for stdarg.h here */
-#include <stdarg.h>
-#endif /* HAVE_LIBC */
-
-/* SDL internal assertion support */
-#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@
-
-/* Allow disabling of core subsystems */
-#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@
-#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@
-#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@
-#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@
-#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@
-#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@
-#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@
-#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@
-#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@
-#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@
-#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@
-#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@
-#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@
-#cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@
-
-/* Enable various audio drivers */
-#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@
-#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@
-#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@
-#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_BEOSAUDIO @SDL_AUDIO_DRIVER_BEOSAUDIO@
-#cmakedefine SDL_AUDIO_DRIVER_BSD @SDL_AUDIO_DRIVER_BSD@
-#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@
-#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@
-#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@
-#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@
-#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@
-#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@
-#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@
-#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@
-#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@
-#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@
-#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@
-#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@
-#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@
-#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@
-#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@
-#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@
-
-/* Enable various input drivers */
-#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
-#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@
-#cmakedefine SDL_JOYSTICK_BEOS @SDL_JOYSTICK_BEOS@
-#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
-#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@
-#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@
-#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@
-#cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@
-#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@
-#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@
-#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@
-#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
-#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
-#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
-
-/* Enable various shared object loading systems */
-#cmakedefine SDL_LOADSO_BEOS @SDL_LOADSO_BEOS@
-#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
-#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@
-#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@
-#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@
-
-/* Enable various threading systems */
-#cmakedefine SDL_THREAD_BEOS @SDL_THREAD_BEOS@
-#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@
-#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@
-#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@
-#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@
-
-/* Enable various timer systems */
-#cmakedefine SDL_TIMER_BEOS @SDL_TIMER_BEOS@
-#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@
-#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@
-#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@
-#cmakedefine SDL_TIMER_WINCE @SDL_TIMER_WINCE@
-
-/* Enable various video drivers */
-#cmakedefine SDL_VIDEO_DRIVER_BWINDOW @SDL_VIDEO_DRIVER_BWINDOW@
-#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@
-#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@
-#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@
-#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@
-#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@
-#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@
-#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@
-#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32@
-#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@
-#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@
-
-#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@
-#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@
-#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@
-#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@
-#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@
-
-/* Enable OpenGL support */
-#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@
-#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@
-#cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@
-#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@
-#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@
-#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@
-#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@
-#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@
-#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@
-#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@
-
-/* Enable system power support */
-#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@
-#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@
-#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@
-#cmakedefine SDL_POWER_BEOS @SDL_POWER_BEOS@
-#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@
-
-/* Enable system filesystem support */
-#cmakedefine SDL_FILESYSTEM_BEOS @SDL_FILESYSTEM_BEOS@
-#cmakedefine SDL_FILESYSTEM_COCOA @SDL_FILESYSTEM_COCOA@
-#cmakedefine SDL_FILESYSTEM_DUMMY @SDL_FILESYSTEM_DUMMY@
-#cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@
-#cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@
-
-/* Enable assembly routines */
-#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@
-#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
-
-
-/* Platform specific definitions */
-#if !defined(__WIN32__)
-#  if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
-typedef unsigned int size_t;
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-typedef unsigned long uintptr_t;
-#  endif /* if (stdint.h isn't available) */
-#else /* __WIN32__ */
-#  if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
-#    if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
-#define HAVE_STDINT_H	1
-#    elif defined(_MSC_VER)
-typedef signed __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef signed __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef signed __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#      ifndef _UINTPTR_T_DEFINED
-#        ifdef  _WIN64
-typedef unsigned __int64 uintptr_t;
-#          else
-typedef unsigned int uintptr_t;
-#        endif
-#define _UINTPTR_T_DEFINED
-#      endif
-/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
-#      if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
-#define DWORD_PTR DWORD
-#      endif
-#      if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
-#define LONG_PTR LONG
-#      endif
-#    else /* !__GNUC__ && !_MSC_VER */
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-#      ifndef _SIZE_T_DEFINED_
-#define _SIZE_T_DEFINED_
-typedef unsigned int size_t;
-#      endif
-typedef unsigned int uintptr_t;
-#    endif /* __GNUC__ || _MSC_VER */
-#  endif /* !_STDINT_H_ && !HAVE_STDINT_H */
-#endif /* __WIN32__ */
-
-#endif /* _SDL_config_h */
diff --git a/deps/SDL2/include/SDL_config.h.in b/deps/SDL2/include/SDL_config.h.in
deleted file mode 100644
index b2daf6f..0000000
--- a/deps/SDL2/include/SDL_config.h.in
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_h
-#define _SDL_config_h
-
-/**
- *  \file SDL_config.h.in
- *
- *  This is a set of defines to configure the SDL features
- */
-
-/* General platform specific identifiers */
-#include "SDL_platform.h"
-
-/* Make sure that this isn't included by Visual C++ */
-#ifdef _MSC_VER
-#error You should run hg revert SDL_config.h 
-#endif
-
-/* C language features */
-#undef const
-#undef inline
-#undef volatile
-
-/* C datatypes */
-#ifdef __LP64__
-#define SIZEOF_VOIDP 8
-#else
-#define SIZEOF_VOIDP 4
-#endif
-#undef HAVE_GCC_ATOMICS
-#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET
-#undef HAVE_PTHREAD_SPINLOCK
-
-/* Comment this if you want to build without any C library requirements */
-#undef HAVE_LIBC
-#if HAVE_LIBC
-
-/* Useful headers */
-#undef HAVE_ALLOCA_H
-#undef HAVE_SYS_TYPES_H
-#undef HAVE_STDIO_H
-#undef STDC_HEADERS
-#undef HAVE_STDLIB_H
-#undef HAVE_STDARG_H
-#undef HAVE_MALLOC_H
-#undef HAVE_MEMORY_H
-#undef HAVE_STRING_H
-#undef HAVE_STRINGS_H
-#undef HAVE_INTTYPES_H
-#undef HAVE_STDINT_H
-#undef HAVE_CTYPE_H
-#undef HAVE_MATH_H
-#undef HAVE_ICONV_H
-#undef HAVE_SIGNAL_H
-#undef HAVE_ALTIVEC_H
-#undef HAVE_PTHREAD_NP_H
-#undef HAVE_LIBUDEV_H
-#undef HAVE_DBUS_DBUS_H
-
-/* C library functions */
-#undef HAVE_MALLOC
-#undef HAVE_CALLOC
-#undef HAVE_REALLOC
-#undef HAVE_FREE
-#undef HAVE_ALLOCA
-#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
-#undef HAVE_GETENV
-#undef HAVE_SETENV
-#undef HAVE_PUTENV
-#undef HAVE_UNSETENV
-#endif
-#undef HAVE_QSORT
-#undef HAVE_ABS
-#undef HAVE_BCOPY
-#undef HAVE_MEMSET
-#undef HAVE_MEMCPY
-#undef HAVE_MEMMOVE
-#undef HAVE_MEMCMP
-#undef HAVE_STRLEN
-#undef HAVE_STRLCPY
-#undef HAVE_STRLCAT
-#undef HAVE_STRDUP
-#undef HAVE__STRREV
-#undef HAVE__STRUPR
-#undef HAVE__STRLWR
-#undef HAVE_INDEX
-#undef HAVE_RINDEX
-#undef HAVE_STRCHR
-#undef HAVE_STRRCHR
-#undef HAVE_STRSTR
-#undef HAVE_ITOA
-#undef HAVE__LTOA
-#undef HAVE__UITOA
-#undef HAVE__ULTOA
-#undef HAVE_STRTOL
-#undef HAVE_STRTOUL
-#undef HAVE__I64TOA
-#undef HAVE__UI64TOA
-#undef HAVE_STRTOLL
-#undef HAVE_STRTOULL
-#undef HAVE_STRTOD
-#undef HAVE_ATOI
-#undef HAVE_ATOF
-#undef HAVE_STRCMP
-#undef HAVE_STRNCMP
-#undef HAVE__STRICMP
-#undef HAVE_STRCASECMP
-#undef HAVE__STRNICMP
-#undef HAVE_STRNCASECMP
-#undef HAVE_SSCANF
-#undef HAVE_SNPRINTF
-#undef HAVE_VSNPRINTF
-#undef HAVE_M_PI
-#undef HAVE_ATAN
-#undef HAVE_ATAN2
-#undef HAVE_CEIL
-#undef HAVE_COPYSIGN
-#undef HAVE_COS
-#undef HAVE_COSF
-#undef HAVE_FABS
-#undef HAVE_FLOOR
-#undef HAVE_LOG
-#undef HAVE_POW
-#undef HAVE_SCALBN
-#undef HAVE_SIN
-#undef HAVE_SINF
-#undef HAVE_SQRT
-#undef HAVE_FSEEKO
-#undef HAVE_FSEEKO64
-#undef HAVE_SIGACTION
-#undef HAVE_SA_SIGACTION
-#undef HAVE_SETJMP
-#undef HAVE_NANOSLEEP
-#undef HAVE_SYSCONF
-#undef HAVE_SYSCTLBYNAME
-#undef HAVE_CLOCK_GETTIME
-#undef HAVE_GETPAGESIZE
-#undef HAVE_MPROTECT
-#undef HAVE_ICONV
-#undef HAVE_PTHREAD_SETNAME_NP
-#undef HAVE_PTHREAD_SET_NAME_NP
-#undef HAVE_SEM_TIMEDWAIT
-
-#else
-#define HAVE_STDARG_H   1
-#define HAVE_STDDEF_H   1
-#define HAVE_STDINT_H   1
-#endif /* HAVE_LIBC */
-
-/* SDL internal assertion support */
-#undef SDL_DEFAULT_ASSERT_LEVEL
-
-/* Allow disabling of core subsystems */
-#undef SDL_ATOMIC_DISABLED
-#undef SDL_AUDIO_DISABLED
-#undef SDL_CPUINFO_DISABLED
-#undef SDL_EVENTS_DISABLED
-#undef SDL_FILE_DISABLED
-#undef SDL_JOYSTICK_DISABLED
-#undef SDL_HAPTIC_DISABLED
-#undef SDL_LOADSO_DISABLED
-#undef SDL_RENDER_DISABLED
-#undef SDL_THREADS_DISABLED
-#undef SDL_TIMERS_DISABLED
-#undef SDL_VIDEO_DISABLED
-#undef SDL_POWER_DISABLED
-#undef SDL_FILESYSTEM_DISABLED
-
-/* Enable various audio drivers */
-#undef SDL_AUDIO_DRIVER_ALSA
-#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-#undef SDL_AUDIO_DRIVER_ARTS
-#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
-#undef SDL_AUDIO_DRIVER_PULSEAUDIO
-#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
-#undef SDL_AUDIO_DRIVER_BEOSAUDIO
-#undef SDL_AUDIO_DRIVER_BSD
-#undef SDL_AUDIO_DRIVER_COREAUDIO
-#undef SDL_AUDIO_DRIVER_DISK
-#undef SDL_AUDIO_DRIVER_DUMMY
-#undef SDL_AUDIO_DRIVER_XAUDIO2
-#undef SDL_AUDIO_DRIVER_DSOUND
-#undef SDL_AUDIO_DRIVER_ESD
-#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
-#undef SDL_AUDIO_DRIVER_NAS
-#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
-#undef SDL_AUDIO_DRIVER_SNDIO
-#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
-#undef SDL_AUDIO_DRIVER_OSS
-#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
-#undef SDL_AUDIO_DRIVER_PAUDIO
-#undef SDL_AUDIO_DRIVER_QSA
-#undef SDL_AUDIO_DRIVER_SUNAUDIO
-#undef SDL_AUDIO_DRIVER_WINMM
-#undef SDL_AUDIO_DRIVER_FUSIONSOUND
-#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
-
-/* Enable various input drivers */
-#undef SDL_INPUT_LINUXEV
-#undef SDL_INPUT_LINUXKD
-#undef SDL_INPUT_TSLIB
-#undef SDL_JOYSTICK_BEOS
-#undef SDL_JOYSTICK_DINPUT
-#undef SDL_JOYSTICK_DUMMY
-#undef SDL_JOYSTICK_IOKIT
-#undef SDL_JOYSTICK_LINUX
-#undef SDL_JOYSTICK_WINMM
-#undef SDL_JOYSTICK_USBHID
-#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
-#undef SDL_HAPTIC_DUMMY
-#undef SDL_HAPTIC_LINUX
-#undef SDL_HAPTIC_IOKIT
-#undef SDL_HAPTIC_DINPUT
-
-/* Enable various shared object loading systems */
-#undef SDL_LOADSO_BEOS
-#undef SDL_LOADSO_DLOPEN
-#undef SDL_LOADSO_DUMMY
-#undef SDL_LOADSO_LDG
-#undef SDL_LOADSO_WINDOWS
-
-/* Enable various threading systems */
-#undef SDL_THREAD_BEOS
-#undef SDL_THREAD_PTHREAD
-#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
-#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
-#undef SDL_THREAD_WINDOWS
-
-/* Enable various timer systems */
-#undef SDL_TIMER_BEOS
-#undef SDL_TIMER_DUMMY
-#undef SDL_TIMER_UNIX
-#undef SDL_TIMER_WINDOWS
-
-/* Enable various video drivers */
-#undef SDL_VIDEO_DRIVER_BWINDOW
-#undef SDL_VIDEO_DRIVER_COCOA
-#undef SDL_VIDEO_DRIVER_DIRECTFB
-#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
-#undef SDL_VIDEO_DRIVER_DUMMY
-#undef SDL_VIDEO_DRIVER_WINDOWS
-#undef SDL_VIDEO_DRIVER_X11
-#undef SDL_VIDEO_DRIVER_RPI
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE
-#undef SDL_VIDEO_DRIVER_X11_XCURSOR
-#undef SDL_VIDEO_DRIVER_X11_XINERAMA
-#undef SDL_VIDEO_DRIVER_X11_XINPUT2
-#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
-#undef SDL_VIDEO_DRIVER_X11_XRANDR
-#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER
-#undef SDL_VIDEO_DRIVER_X11_XSHAPE
-#undef SDL_VIDEO_DRIVER_X11_XVIDMODE
-#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
-#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
-#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY
-#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
-
-#undef SDL_VIDEO_RENDER_D3D
-#undef SDL_VIDEO_RENDER_OGL
-#undef SDL_VIDEO_RENDER_OGL_ES
-#undef SDL_VIDEO_RENDER_OGL_ES2
-#undef SDL_VIDEO_RENDER_DIRECTFB
-
-/* Enable OpenGL support */
-#undef SDL_VIDEO_OPENGL
-#undef SDL_VIDEO_OPENGL_ES
-#undef SDL_VIDEO_OPENGL_ES2
-#undef SDL_VIDEO_OPENGL_BGL
-#undef SDL_VIDEO_OPENGL_CGL
-#undef SDL_VIDEO_OPENGL_EGL
-#undef SDL_VIDEO_OPENGL_GLX
-#undef SDL_VIDEO_OPENGL_WGL
-#undef SDL_VIDEO_OPENGL_OSMESA
-#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
-
-/* Enable system power support */
-#undef SDL_POWER_LINUX
-#undef SDL_POWER_WINDOWS
-#undef SDL_POWER_MACOSX
-#undef SDL_POWER_BEOS
-#undef SDL_POWER_HARDWIRED
-
-/* Enable system filesystem support */
-#undef SDL_FILESYSTEM_BEOS
-#undef SDL_FILESYSTEM_COCOA
-#undef SDL_FILESYSTEM_DUMMY
-#undef SDL_FILESYSTEM_UNIX
-#undef SDL_FILESYSTEM_WINDOWS
-
-/* Enable assembly routines */
-#undef SDL_ASSEMBLY_ROUTINES
-#undef SDL_ALTIVEC_BLITTERS
-
-#endif /* _SDL_config_h */
diff --git a/deps/SDL2/include/SDL_config_android.h b/deps/SDL2/include/SDL_config_android.h
deleted file mode 100644
index 0826415..0000000
--- a/deps/SDL2/include/SDL_config_android.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_android_h
-#define _SDL_config_android_h
-
-#include "SDL_platform.h"
-
-/**
- *  \file SDL_config_android.h
- *
- *  This is a configuration that can be used to build SDL for Android
- */
-
-#include <stdarg.h>
-
-#define HAVE_GCC_ATOMICS    1
-
-#define HAVE_ALLOCA_H       1
-#define HAVE_SYS_TYPES_H    1
-#define HAVE_STDIO_H    1
-#define STDC_HEADERS    1
-#define HAVE_STRING_H   1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H   1
-#define HAVE_CTYPE_H    1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H   1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC    1
-#define HAVE_FREE   1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_SETENV 1
-#define HAVE_UNSETENV   1
-#define HAVE_QSORT  1
-#define HAVE_ABS    1
-#define HAVE_BCOPY  1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE    1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRLCPY    1
-#define HAVE_STRLCAT    1
-#define HAVE_STRDUP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR    1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL    1
-#define HAVE_STRTOLL    1
-#define HAVE_STRTOULL   1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI   1
-#define HAVE_ATOF   1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP    1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF   1
-#define HAVE_VSNPRINTF  1
-#define HAVE_M_PI   1
-#define HAVE_ATAN   1
-#define HAVE_ATAN2  1
-#define HAVE_CEIL   1
-#define HAVE_COPYSIGN   1
-#define HAVE_COS    1
-#define HAVE_COSF   1
-#define HAVE_FABS   1
-#define HAVE_FLOOR  1
-#define HAVE_LOG    1
-#define HAVE_POW    1
-#define HAVE_SCALBN 1
-#define HAVE_SIN    1
-#define HAVE_SINF   1
-#define HAVE_SQRT   1
-#define HAVE_SIGACTION  1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP  1
-#define HAVE_SYSCONF    1
-
-#define SIZEOF_VOIDP 4
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_ANDROID    1
-#define SDL_AUDIO_DRIVER_DUMMY  1
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_ANDROID    1
-#define SDL_HAPTIC_DUMMY    1
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_DLOPEN   1
-
-/* Enable various threading systems */
-#define SDL_THREAD_PTHREAD  1
-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX  1
-
-/* Enable various timer systems */
-#define SDL_TIMER_UNIX  1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_ANDROID 1
-
-/* Enable OpenGL ES */
-#define SDL_VIDEO_OPENGL_ES 1
-#define SDL_VIDEO_OPENGL_EGL 1
-#define SDL_VIDEO_RENDER_OGL_ES 1
-#define SDL_VIDEO_RENDER_OGL_ES2    1
-
-/* Enable system power support */
-#define SDL_POWER_ANDROID 1
-
-/* !!! FIXME: what does Android do for filesystem stuff? */
-#define SDL_FILESYSTEM_DUMMY   1
-
-#endif /* _SDL_config_android_h */
diff --git a/deps/SDL2/include/SDL_config_iphoneos.h b/deps/SDL2/include/SDL_config_iphoneos.h
deleted file mode 100644
index ade2966..0000000
--- a/deps/SDL2/include/SDL_config_iphoneos.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_iphoneos_h
-#define _SDL_config_iphoneos_h
-
-#include "SDL_platform.h"
-
-#ifdef __LP64__
-#define SIZEOF_VOIDP 8
-#else
-#define SIZEOF_VOIDP 4
-#endif
-
-#define HAVE_GCC_ATOMICS    1
-
-#define HAVE_ALLOCA_H       1
-#define HAVE_SYS_TYPES_H    1
-#define HAVE_STDIO_H    1
-#define STDC_HEADERS    1
-#define HAVE_STRING_H   1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H   1
-#define HAVE_CTYPE_H    1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H   1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC    1
-#define HAVE_FREE   1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_SETENV 1
-#define HAVE_UNSETENV   1
-#define HAVE_QSORT  1
-#define HAVE_ABS    1
-#define HAVE_BCOPY  1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE    1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRLCPY    1
-#define HAVE_STRLCAT    1
-#define HAVE_STRDUP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR    1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL    1
-#define HAVE_STRTOLL    1
-#define HAVE_STRTOULL   1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI   1
-#define HAVE_ATOF   1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP    1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF   1
-#define HAVE_VSNPRINTF  1
-#define HAVE_M_PI   1
-#define HAVE_ATAN   1
-#define HAVE_ATAN2  1
-#define HAVE_CEIL   1
-#define HAVE_COPYSIGN   1
-#define HAVE_COS    1
-#define HAVE_COSF   1
-#define HAVE_FABS   1
-#define HAVE_FLOOR  1
-#define HAVE_LOG    1
-#define HAVE_POW    1
-#define HAVE_SCALBN 1
-#define HAVE_SIN    1
-#define HAVE_SINF   1
-#define HAVE_SQRT   1
-#define HAVE_SIGACTION  1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP  1
-#define HAVE_SYSCONF    1
-#define HAVE_SYSCTLBYNAME 1
-
-/* enable iPhone version of Core Audio driver */
-#define SDL_AUDIO_DRIVER_COREAUDIO 1
-/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
-#define SDL_AUDIO_DRIVER_DUMMY  1
-
-/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
-#define SDL_HAPTIC_DISABLED 1
-
-/* Enable Unix style SO loading */
-/* Technically this works, but it violates the iPhone developer agreement */
-/* #define SDL_LOADSO_DLOPEN 1 */
-
-/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
-#define SDL_LOADSO_DISABLED 1
-
-/* Enable various threading systems */
-#define SDL_THREAD_PTHREAD  1
-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX  1
-
-/* Enable various timer systems */
-#define SDL_TIMER_UNIX  1
-
-/* Supported video drivers */
-#define SDL_VIDEO_DRIVER_UIKIT  1
-#define SDL_VIDEO_DRIVER_DUMMY  1
-
-/* enable OpenGL ES */
-#define SDL_VIDEO_OPENGL_ES 1
-#define SDL_VIDEO_RENDER_OGL_ES 1
-#define SDL_VIDEO_RENDER_OGL_ES2    1
-
-/* Enable system power support */
-#define SDL_POWER_UIKIT 1
-
-/* enable iPhone keyboard support */
-#define SDL_IPHONE_KEYBOARD 1
-
-/* enable joystick subsystem */
-#define SDL_JOYSTICK_DISABLED 0
-
-/* Set max recognized G-force from accelerometer
-   See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed
- */
-#define SDL_IPHONE_MAX_GFORCE 5.0
-
-/* enable filesystem support */
-#define SDL_FILESYSTEM_COCOA   1
-
-#endif /* _SDL_config_iphoneos_h */
diff --git a/deps/SDL2/include/SDL_config_macosx.h b/deps/SDL2/include/SDL_config_macosx.h
deleted file mode 100644
index 9f2f76e..0000000
--- a/deps/SDL2/include/SDL_config_macosx.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_macosx_h
-#define _SDL_config_macosx_h
-
-#include "SDL_platform.h"
-
-/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
-#include <AvailabilityMacros.h>
-
-/* This is a set of defines to configure the SDL features */
-
-#ifdef __LP64__
-    #define SIZEOF_VOIDP 8
-#else
-    #define SIZEOF_VOIDP 4
-#endif
-
-/* Useful headers */
-#define HAVE_ALLOCA_H       1
-#define HAVE_SYS_TYPES_H    1
-#define HAVE_STDIO_H    1
-#define STDC_HEADERS    1
-#define HAVE_STRING_H   1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H   1
-#define HAVE_CTYPE_H    1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H   1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC    1
-#define HAVE_FREE   1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_UNSETENV   1
-#define HAVE_QSORT  1
-#define HAVE_ABS    1
-#define HAVE_BCOPY  1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE    1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRLCPY    1
-#define HAVE_STRLCAT    1
-#define HAVE_STRDUP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR    1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL    1
-#define HAVE_STRTOLL    1
-#define HAVE_STRTOULL   1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI   1
-#define HAVE_ATOF   1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP    1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF   1
-#define HAVE_VSNPRINTF  1
-#define HAVE_CEIL   1
-#define HAVE_COPYSIGN   1
-#define HAVE_COS    1
-#define HAVE_COSF   1
-#define HAVE_FABS   1
-#define HAVE_FLOOR  1
-#define HAVE_LOG    1
-#define HAVE_POW    1
-#define HAVE_SCALBN 1
-#define HAVE_SIN    1
-#define HAVE_SINF   1
-#define HAVE_SQRT   1
-#define HAVE_SIGACTION  1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP  1
-#define HAVE_SYSCONF    1
-#define HAVE_SYSCTLBYNAME 1
-#define HAVE_ATAN 1
-#define HAVE_ATAN2 1
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_COREAUDIO  1
-#define SDL_AUDIO_DRIVER_DISK   1
-#define SDL_AUDIO_DRIVER_DUMMY  1
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_IOKIT  1
-#define SDL_HAPTIC_IOKIT    1
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_DLOPEN   1
-
-/* Enable various threading systems */
-#define SDL_THREAD_PTHREAD  1
-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX  1
-
-/* Enable various timer systems */
-#define SDL_TIMER_UNIX  1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_COCOA  1
-#define SDL_VIDEO_DRIVER_DUMMY  1
-#undef SDL_VIDEO_DRIVER_X11
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
-#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
-#define SDL_VIDEO_DRIVER_X11_XRANDR 1
-#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
-#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
-#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
-#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
-
-#ifdef MAC_OS_X_VERSION_10_8
-/*
- * No matter the versions targeted, this is the 10.8 or later SDK, so you have
- *  to use the external Xquartz, which is a more modern Xlib. Previous SDKs
- *  used an older Xlib.
- */
-#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
-#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
-#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
-#endif
-
-#ifndef SDL_VIDEO_RENDER_OGL
-#define SDL_VIDEO_RENDER_OGL    1
-#endif
-
-/* Enable OpenGL support */
-#ifndef SDL_VIDEO_OPENGL
-#define SDL_VIDEO_OPENGL    1
-#endif
-#ifndef SDL_VIDEO_OPENGL_CGL
-#define SDL_VIDEO_OPENGL_CGL    1
-#endif
-#ifndef SDL_VIDEO_OPENGL_GLX
-#define SDL_VIDEO_OPENGL_GLX    1
-#endif
-
-/* Enable system power support */
-#define SDL_POWER_MACOSX 1
-
-/* enable filesystem support */
-#define SDL_FILESYSTEM_COCOA   1
-
-/* Enable assembly routines */
-#define SDL_ASSEMBLY_ROUTINES   1
-#ifdef __ppc__
-#define SDL_ALTIVEC_BLITTERS    1
-#endif
-
-#endif /* _SDL_config_macosx_h */
diff --git a/deps/SDL2/include/SDL_config_minimal.h b/deps/SDL2/include/SDL_config_minimal.h
deleted file mode 100644
index 3248bdd..0000000
--- a/deps/SDL2/include/SDL_config_minimal.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_minimal_h
-#define _SDL_config_minimal_h
-
-#include "SDL_platform.h"
-
-/**
- *  \file SDL_config_minimal.h
- *
- *  This is the minimal configuration that can be used to build SDL.
- */
-
-#define HAVE_STDARG_H   1
-#define HAVE_STDDEF_H   1
-
-/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
-#if defined(_MSC_VER) && (_MSC_VER < 1600)
-/* Here are some reasonable defaults */
-typedef unsigned int size_t;
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-typedef unsigned long uintptr_t;
-#else
-#define HAVE_STDINT_H 1
-#endif /* Visual Studio 2008 */
-
-#ifdef __GNUC__
-#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
-#endif
-
-/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
-#define SDL_AUDIO_DRIVER_DUMMY  1
-
-/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
-#define SDL_JOYSTICK_DISABLED   1
-
-/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
-#define SDL_HAPTIC_DISABLED 1
-
-/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
-#define SDL_LOADSO_DISABLED 1
-
-/* Enable the stub thread support (src/thread/generic/\*.c) */
-#define SDL_THREADS_DISABLED    1
-
-/* Enable the stub timer support (src/timer/dummy/\*.c) */
-#define SDL_TIMERS_DISABLED 1
-
-/* Enable the dummy video driver (src/video/dummy/\*.c) */
-#define SDL_VIDEO_DRIVER_DUMMY  1
-
-/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */
-#define SDL_FILESYSTEM_DUMMY  1
-
-#endif /* _SDL_config_minimal_h */
diff --git a/deps/SDL2/include/SDL_config_pandora.h b/deps/SDL2/include/SDL_config_pandora.h
deleted file mode 100644
index 4bfad48..0000000
--- a/deps/SDL2/include/SDL_config_pandora.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_h
-#define _SDL_config_h
-
-/* This is a set of defines to configure the SDL features */
-
-/* General platform specific identifiers */
-#include "SDL_platform.h"
-
-#ifdef __LP64__
-#define SIZEOF_VOIDP 8
-#else
-#define SIZEOF_VOIDP 4
-#endif
-
-#define SDL_BYTEORDER 1234
-
-#define HAVE_ALLOCA_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
-#define HAVE_ICONV_H 1
-#define HAVE_SIGNAL_H 1
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_UNSETENV 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_BCOPY 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_STRLEN 1
-#define HAVE_STRDUP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRTOLL 1
-#define HAVE_STRTOULL 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF 1
-#define HAVE_VSNPRINTF 1
-#define HAVE_M_PI 1
-#define HAVE_CEIL 1
-#define HAVE_COPYSIGN 1
-#define HAVE_COS 1
-#define HAVE_COSF 1
-#define HAVE_FABS 1
-#define HAVE_FLOOR 1
-#define HAVE_LOG 1
-#define HAVE_SCALBN 1
-#define HAVE_SIN 1
-#define HAVE_SINF 1
-#define HAVE_SQRT 1
-#define HAVE_SIGACTION 1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP 1
-
-#define SDL_AUDIO_DRIVER_DUMMY 1
-#define SDL_AUDIO_DRIVER_OSS 1
-
-#define SDL_INPUT_LINUXEV 1
-#define SDL_INPUT_TSLIB 1
-#define SDL_JOYSTICK_LINUX 1
-#define SDL_HAPTIC_LINUX 1
-
-#define SDL_LOADSO_DLOPEN 1
-
-#define SDL_THREAD_PTHREAD 1
-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
-
-#define SDL_TIMER_UNIX 1
-#define SDL_FILESYSTEM_UNIX 1
-
-#define SDL_VIDEO_DRIVER_DUMMY 1
-#define SDL_VIDEO_DRIVER_X11 1
-#define SDL_VIDEO_DRIVER_PANDORA 1
-#define SDL_VIDEO_RENDER_OGL_ES 1
-#define SDL_VIDEO_OPENGL_ES 1
-
-#endif /* _SDL_config_h */
diff --git a/deps/SDL2/include/SDL_config_psp.h b/deps/SDL2/include/SDL_config_psp.h
deleted file mode 100644
index 31ac2b2..0000000
--- a/deps/SDL2/include/SDL_config_psp.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_psp_h
-#define _SDL_config_psp_h
-
-#include "SDL_platform.h"
-
-
-
-#ifdef __GNUC__
-#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
-#endif
-
-#define HAVE_GCC_ATOMICS    1
-
-#define HAVE_ALLOCA_H       1
-#define HAVE_SYS_TYPES_H    1
-#define HAVE_STDIO_H    1
-#define STDC_HEADERS    1
-#define HAVE_STRING_H   1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H   1
-#define HAVE_CTYPE_H    1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H   1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC    1
-#define HAVE_FREE   1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_SETENV 1
-#define HAVE_UNSETENV   1
-#define HAVE_QSORT  1
-#define HAVE_ABS    1
-#define HAVE_BCOPY  1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE    1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRLCPY    1
-#define HAVE_STRLCAT    1
-#define HAVE_STRDUP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR    1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL    1
-#define HAVE_STRTOLL    1
-#define HAVE_STRTOULL   1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI   1
-#define HAVE_ATOF   1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP    1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF   1
-#define HAVE_VSNPRINTF  1
-#define HAVE_M_PI   1
-#define HAVE_ATAN   1
-#define HAVE_ATAN2  1
-#define HAVE_CEIL   1
-#define HAVE_COPYSIGN   1
-#define HAVE_COS    1
-#define HAVE_COSF   1
-#define HAVE_FABS   1
-#define HAVE_FLOOR  1
-#define HAVE_LOG    1
-#define HAVE_POW    1
-#define HAVE_SCALBN 1
-#define HAVE_SIN    1
-#define HAVE_SINF   1
-#define HAVE_SQRT   1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP  1
-/* #define HAVE_SYSCONF  1 */
-/* #define HAVE_SIGACTION    1 */
-
-
-/* PSP isn't that sophisticated */
-#define LACKS_SYS_MMAN_H 1
-
-/* Enable the stub thread support (src/thread/psp/\*.c) */
-#define SDL_THREAD_PSP  1
-
-/* Enable the stub timer support (src/timer/psp/\*.c) */
-#define SDL_TIMERS_PSP  1
-
-/* Enable the stub joystick driver (src/joystick/psp/\*.c) */
-#define SDL_JOYSTICK_PSP        1
-
-/* Enable the stub audio driver (src/audio/psp/\*.c) */
-#define SDL_AUDIO_DRIVER_PSP    1
-
-/* PSP video dirver */
-#define SDL_VIDEO_DRIVER_PSP   1
-
-/* PSP render dirver */
-#define SDL_VIDEO_RENDER_PSP   1
-
-#define SDL_POWER_PSP          1
-
-/* !!! FIXME: what does PSP do for filesystem stuff? */
-#define SDL_FILESYSTEM_DUMMY   1
-
-/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */
-#define SDL_HAPTIC_DISABLED    1
-
-/* PSP can't load shared object (src/loadso/dummy/\*.c) */
-#define SDL_LOADSO_DISABLED    1
-
-
-#endif /* _SDL_config_psp_h */
diff --git a/deps/SDL2/include/SDL_config_windows.h b/deps/SDL2/include/SDL_config_windows.h
deleted file mode 100644
index 4d5c7c2..0000000
--- a/deps/SDL2/include/SDL_config_windows.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_windows_h
-#define _SDL_config_windows_h
-
-#include "SDL_platform.h"
-
-/* This is a set of defines to configure the SDL features */
-
-#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
-#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
-#define HAVE_STDINT_H   1
-#elif defined(_MSC_VER)
-typedef signed __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef signed __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef signed __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#ifndef _UINTPTR_T_DEFINED
-#ifdef  _WIN64
-typedef unsigned __int64 uintptr_t;
-#else
-typedef unsigned int uintptr_t;
-#endif
-#define _UINTPTR_T_DEFINED
-#endif
-/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
-#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
-#define DWORD_PTR DWORD
-#endif
-#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
-#define LONG_PTR LONG
-#endif
-#else /* !__GNUC__ && !_MSC_VER */
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-#ifndef _SIZE_T_DEFINED_
-#define _SIZE_T_DEFINED_
-typedef unsigned int size_t;
-#endif
-typedef unsigned int uintptr_t;
-#endif /* __GNUC__ || _MSC_VER */
-#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
-
-#ifdef _WIN64
-# define SIZEOF_VOIDP 8
-#else
-# define SIZEOF_VOIDP 4
-#endif
-
-/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
-#ifdef HAVE_LIBC
-/* Useful headers */
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STRING_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H 1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE__STRREV 1
-#define HAVE__STRUPR 1
-#define HAVE__STRLWR 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE__LTOA 1
-#define HAVE__ULTOA 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE__STRICMP 1
-#define HAVE__STRNICMP 1
-#define HAVE_ATAN 1
-#define HAVE_ATAN2 1
-#define HAVE_CEIL 1
-#define HAVE_COS 1
-#define HAVE_COSF 1
-#define HAVE_FABS 1
-#define HAVE_FLOOR 1
-#define HAVE_LOG 1
-#define HAVE_POW 1
-#define HAVE_SIN 1
-#define HAVE_SINF 1
-#define HAVE_SQRT 1
-#if _MSC_VER >= 1800
-#define HAVE_STRTOLL 1
-#define HAVE_SSCANF 1
-#define HAVE_COPYSIGN 1
-#define HAVE_SCALBN 1
-#endif
-#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
-#define HAVE_M_PI 1
-#endif
-#else
-#define HAVE_STDARG_H   1
-#define HAVE_STDDEF_H   1
-#endif
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_DSOUND 1
-#define SDL_AUDIO_DRIVER_XAUDIO2    1
-#define SDL_AUDIO_DRIVER_WINMM  1
-#define SDL_AUDIO_DRIVER_DISK   1
-#define SDL_AUDIO_DRIVER_DUMMY  1
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_DINPUT 1
-#define SDL_HAPTIC_DINPUT   1
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_WINDOWS  1
-
-/* Enable various threading systems */
-#define SDL_THREAD_WINDOWS  1
-
-/* Enable various timer systems */
-#define SDL_TIMER_WINDOWS   1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_DUMMY  1
-#define SDL_VIDEO_DRIVER_WINDOWS    1
-
-#ifndef SDL_VIDEO_RENDER_D3D
-#define SDL_VIDEO_RENDER_D3D    1
-#endif
-
-/* Enable OpenGL support */
-#ifndef SDL_VIDEO_OPENGL
-#define SDL_VIDEO_OPENGL    1
-#endif
-#ifndef SDL_VIDEO_OPENGL_WGL
-#define SDL_VIDEO_OPENGL_WGL    1
-#endif
-#ifndef SDL_VIDEO_RENDER_OGL
-#define SDL_VIDEO_RENDER_OGL    1
-#endif
-
-/* Enable system power support */
-#define SDL_POWER_WINDOWS 1
-
-/* Enable filesystem support */
-#define SDL_FILESYSTEM_WINDOWS  1
-
-/* Enable assembly routines (Win64 doesn't have inline asm) */
-#ifndef _WIN64
-#define SDL_ASSEMBLY_ROUTINES   1
-#endif
-
-#endif /* _SDL_config_windows_h */
diff --git a/deps/SDL2/include/SDL_config_wiz.h b/deps/SDL2/include/SDL_config_wiz.h
deleted file mode 100644
index 9be04d9..0000000
--- a/deps/SDL2/include/SDL_config_wiz.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_config_h
-#define _SDL_config_h
-
-/* This is a set of defines to configure the SDL features */
-
-/* General platform specific identifiers */
-#include "SDL_platform.h"
-
-#define SDL_BYTEORDER 1234
-
-#define HAVE_ALLOCA_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
-#define HAVE_ICONV_H 1
-#define HAVE_SIGNAL_H 1
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_UNSETENV 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_BCOPY 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_STRLEN 1
-#define HAVE_STRDUP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRTOLL 1
-#define HAVE_STRTOULL 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF 1
-#define HAVE_VSNPRINTF 1
-#define HAVE_M_PI 1
-#define HAVE_CEIL 1
-#define HAVE_COPYSIGN 1
-#define HAVE_COS 1
-#define HAVE_COSF 1
-#define HAVE_FABS 1
-#define HAVE_FLOOR 1
-#define HAVE_LOG 1
-#define HAVE_SCALBN 1
-#define HAVE_SIN 1
-#define HAVE_SINF 1
-#define HAVE_SQRT 1
-#define HAVE_SIGACTION 1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP 1
-#define HAVE_POW 1
-
-#define SDL_CDROM_DISABLED 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
-#define SDL_AUDIO_DRIVER_OSS 1
-
-#define SDL_INPUT_LINUXEV 1
-#define SDL_INPUT_TSLIB 1
-#define SDL_JOYSTICK_LINUX 1
-#define SDL_HAPTIC_LINUX 1
-
-#define SDL_LOADSO_DLOPEN 1
-
-#define SDL_THREAD_PTHREAD 1
-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
-
-#define SDL_TIMER_UNIX 1
-
-#define SDL_VIDEO_DRIVER_DUMMY 1
-#define SDL_VIDEO_DRIVER_PANDORA 1
-#define SDL_VIDEO_RENDER_OGL_ES 1
-#define SDL_VIDEO_OPENGL_ES 1
-
-#endif /* _SDL_config_h */
diff --git a/deps/SDL2/include/SDL_copying.h b/deps/SDL2/include/SDL_copying.h
deleted file mode 100644
index 3a8fb75..0000000
--- a/deps/SDL2/include/SDL_copying.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
diff --git a/deps/SDL2/include/SDL_cpuinfo.h b/deps/SDL2/include/SDL_cpuinfo.h
deleted file mode 100644
index 6d72bbb..0000000
--- a/deps/SDL2/include/SDL_cpuinfo.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_cpuinfo.h
- *
- *  CPU feature detection for SDL.
- */
-
-#ifndef _SDL_cpuinfo_h
-#define _SDL_cpuinfo_h
-
-#include "SDL_stdinc.h"
-
-/* Need to do this here because intrin.h has C++ code in it */
-/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
-#if defined(_MSC_VER) && (_MSC_VER >= 1500)
-#include <intrin.h>
-#ifndef _WIN64
-#define __MMX__
-#define __3dNOW__
-#endif
-#define __SSE__
-#define __SSE2__
-#elif defined(__MINGW64_VERSION_MAJOR)
-#include <intrin.h>
-#else
-#ifdef __ALTIVEC__
-#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__)
-#include <altivec.h>
-#undef pixel
-#endif
-#endif
-#ifdef __MMX__
-#include <mmintrin.h>
-#endif
-#ifdef __3dNOW__
-#include <mm3dnow.h>
-#endif
-#ifdef __SSE__
-#include <xmmintrin.h>
-#endif
-#ifdef __SSE2__
-#include <emmintrin.h>
-#endif
-#endif
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* This is a guess for the cacheline size used for padding.
- * Most x86 processors have a 64 byte cache line.
- * The 64-bit PowerPC processors have a 128 byte cache line.
- * We'll use the larger value to be generally safe.
- */
-#define SDL_CACHELINE_SIZE  128
-
-/**
- *  This function returns the number of CPU cores available.
- */
-extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
-
-/**
- *  This function returns the L1 cache line size of the CPU
- *
- *  This is useful for determining multi-threaded structure padding
- *  or SIMD prefetch sizes.
- */
-extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
-
-/**
- *  This function returns true if the CPU has the RDTSC instruction.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
-
-/**
- *  This function returns true if the CPU has AltiVec features.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
-
-/**
- *  This function returns true if the CPU has MMX features.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
-
-/**
- *  This function returns true if the CPU has 3DNow! features.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
-
-/**
- *  This function returns true if the CPU has SSE features.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
-
-/**
- *  This function returns true if the CPU has SSE2 features.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
-
-/**
- *  This function returns true if the CPU has SSE3 features.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
-
-/**
- *  This function returns true if the CPU has SSE4.1 features.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
-
-/**
- *  This function returns true if the CPU has SSE4.2 features.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
-
-/**
- *  This function returns the amount of RAM configured in the system, in MB.
- */
-extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_cpuinfo_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_endian.h b/deps/SDL2/include/SDL_endian.h
deleted file mode 100644
index 3450316..0000000
--- a/deps/SDL2/include/SDL_endian.h
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_endian.h
- *
- *  Functions for reading and writing endian-specific values
- */
-
-#ifndef _SDL_endian_h
-#define _SDL_endian_h
-
-#include "SDL_stdinc.h"
-
-/**
- *  \name The two types of endianness
- */
-/* @{ */
-#define SDL_LIL_ENDIAN  1234
-#define SDL_BIG_ENDIAN  4321
-/* @} */
-
-#ifndef SDL_BYTEORDER           /* Not defined in SDL_config.h? */
-#ifdef __linux__
-#include <endian.h>
-#define SDL_BYTEORDER  __BYTE_ORDER
-#else /* __linux __ */
-#if defined(__hppa__) || \
-    defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
-    (defined(__MIPS__) && defined(__MISPEB__)) || \
-    defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
-    defined(__sparc__)
-#define SDL_BYTEORDER   SDL_BIG_ENDIAN
-#else
-#define SDL_BYTEORDER   SDL_LIL_ENDIAN
-#endif
-#endif /* __linux __ */
-#endif /* !SDL_BYTEORDER */
-
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \file SDL_endian.h
- */
-#if defined(__GNUC__) && defined(__i386__) && \
-   !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
-SDL_FORCE_INLINE Uint16
-SDL_Swap16(Uint16 x)
-{
-  __asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
-    return x;
-}
-#elif defined(__GNUC__) && defined(__x86_64__)
-SDL_FORCE_INLINE Uint16
-SDL_Swap16(Uint16 x)
-{
-  __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
-    return x;
-}
-#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
-SDL_FORCE_INLINE Uint16
-SDL_Swap16(Uint16 x)
-{
-    int result;
-
-  __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
-    return (Uint16)result;
-}
-#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
-SDL_FORCE_INLINE Uint16
-SDL_Swap16(Uint16 x)
-{
-  __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
-    return x;
-}
-#else
-SDL_FORCE_INLINE Uint16
-SDL_Swap16(Uint16 x)
-{
-    return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
-}
-#endif
-
-#if defined(__GNUC__) && defined(__i386__)
-SDL_FORCE_INLINE Uint32
-SDL_Swap32(Uint32 x)
-{
-  __asm__("bswap %0": "=r"(x):"0"(x));
-    return x;
-}
-#elif defined(__GNUC__) && defined(__x86_64__)
-SDL_FORCE_INLINE Uint32
-SDL_Swap32(Uint32 x)
-{
-  __asm__("bswapl %0": "=r"(x):"0"(x));
-    return x;
-}
-#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
-SDL_FORCE_INLINE Uint32
-SDL_Swap32(Uint32 x)
-{
-    Uint32 result;
-
-  __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x));
-  __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x));
-  __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x));
-    return result;
-}
-#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
-SDL_FORCE_INLINE Uint32
-SDL_Swap32(Uint32 x)
-{
-  __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
-    return x;
-}
-#else
-SDL_FORCE_INLINE Uint32
-SDL_Swap32(Uint32 x)
-{
-    return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
-                                    ((x >> 8) & 0x0000FF00) | (x >> 24)));
-}
-#endif
-
-#if defined(__GNUC__) && defined(__i386__)
-SDL_FORCE_INLINE Uint64
-SDL_Swap64(Uint64 x)
-{
-    union
-    {
-        struct
-        {
-            Uint32 a, b;
-        } s;
-        Uint64 u;
-    } v;
-    v.u = x;
-  __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a),
-            "1"(v.s.
-                b));
-    return v.u;
-}
-#elif defined(__GNUC__) && defined(__x86_64__)
-SDL_FORCE_INLINE Uint64
-SDL_Swap64(Uint64 x)
-{
-  __asm__("bswapq %0": "=r"(x):"0"(x));
-    return x;
-}
-#else
-SDL_FORCE_INLINE Uint64
-SDL_Swap64(Uint64 x)
-{
-    Uint32 hi, lo;
-
-    /* Separate into high and low 32-bit values and swap them */
-    lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
-    x >>= 32;
-    hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
-    x = SDL_Swap32(lo);
-    x <<= 32;
-    x |= SDL_Swap32(hi);
-    return (x);
-}
-#endif
-
-
-SDL_FORCE_INLINE float
-SDL_SwapFloat(float x)
-{
-    union
-    {
-        float f;
-        Uint32 ui32;
-    } swapper;
-    swapper.f = x;
-    swapper.ui32 = SDL_Swap32(swapper.ui32);
-    return swapper.f;
-}
-
-
-/**
- *  \name Swap to native
- *  Byteswap item from the specified endianness to the native endianness.
- */
-/* @{ */
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define SDL_SwapLE16(X) (X)
-#define SDL_SwapLE32(X) (X)
-#define SDL_SwapLE64(X) (X)
-#define SDL_SwapFloatLE(X)  (X)
-#define SDL_SwapBE16(X) SDL_Swap16(X)
-#define SDL_SwapBE32(X) SDL_Swap32(X)
-#define SDL_SwapBE64(X) SDL_Swap64(X)
-#define SDL_SwapFloatBE(X)  SDL_SwapFloat(X)
-#else
-#define SDL_SwapLE16(X) SDL_Swap16(X)
-#define SDL_SwapLE32(X) SDL_Swap32(X)
-#define SDL_SwapLE64(X) SDL_Swap64(X)
-#define SDL_SwapFloatLE(X)  SDL_SwapFloat(X)
-#define SDL_SwapBE16(X) (X)
-#define SDL_SwapBE32(X) (X)
-#define SDL_SwapBE64(X) (X)
-#define SDL_SwapFloatBE(X)  (X)
-#endif
-/* @} *//* Swap to native */
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_endian_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_error.h b/deps/SDL2/include/SDL_error.h
deleted file mode 100644
index 2b8bb41..0000000
--- a/deps/SDL2/include/SDL_error.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_error.h
- *
- *  Simple error message routines for SDL.
- */
-
-#ifndef _SDL_error_h
-#define _SDL_error_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Public functions */
-/* SDL_SetError() unconditionally returns -1. */
-extern DECLSPEC int SDLCALL SDL_SetError(const char *fmt, ...);
-extern DECLSPEC const char *SDLCALL SDL_GetError(void);
-extern DECLSPEC void SDLCALL SDL_ClearError(void);
-
-/**
- *  \name Internal error functions
- *
- *  \internal
- *  Private error reporting function - used internally.
- */
-/* @{ */
-#define SDL_OutOfMemory()   SDL_Error(SDL_ENOMEM)
-#define SDL_Unsupported()   SDL_Error(SDL_UNSUPPORTED)
-#define SDL_InvalidParamError(param)    SDL_SetError("Parameter '%s' is invalid", (param))
-typedef enum
-{
-    SDL_ENOMEM,
-    SDL_EFREAD,
-    SDL_EFWRITE,
-    SDL_EFSEEK,
-    SDL_UNSUPPORTED,
-    SDL_LASTERROR
-} SDL_errorcode;
-/* SDL_Error() unconditionally returns -1. */
-extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
-/* @} *//* Internal error functions */
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_error_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_events.h b/deps/SDL2/include/SDL_events.h
deleted file mode 100644
index c089030..0000000
--- a/deps/SDL2/include/SDL_events.h
+++ /dev/null
@@ -1,720 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_events.h
- *
- *  Include file for SDL event handling.
- */
-
-#ifndef _SDL_events_h
-#define _SDL_events_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_video.h"
-#include "SDL_keyboard.h"
-#include "SDL_mouse.h"
-#include "SDL_joystick.h"
-#include "SDL_gamecontroller.h"
-#include "SDL_quit.h"
-#include "SDL_gesture.h"
-#include "SDL_touch.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* General keyboard/mouse state definitions */
-#define SDL_RELEASED    0
-#define SDL_PRESSED 1
-
-/**
- * \brief The types of events that can be delivered.
- */
-typedef enum
-{
-    SDL_FIRSTEVENT     = 0,     /**< Unused (do not remove) */
-
-    /* Application events */
-    SDL_QUIT           = 0x100, /**< User-requested quit */
-
-    /* These application events have special meaning on iOS, see README-ios.txt for details */
-    SDL_APP_TERMINATING,        /**< The application is being terminated by the OS
-                                     Called on iOS in applicationWillTerminate()
-                                     Called on Android in onDestroy()
-                                */
-    SDL_APP_LOWMEMORY,          /**< The application is low on memory, free memory if possible.
-                                     Called on iOS in applicationDidReceiveMemoryWarning()
-                                     Called on Android in onLowMemory()
-                                */
-    SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background
-                                     Called on iOS in applicationWillResignActive()
-                                     Called on Android in onPause()
-                                */
-    SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time
-                                     Called on iOS in applicationDidEnterBackground()
-                                     Called on Android in onPause()
-                                */
-    SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground
-                                     Called on iOS in applicationWillEnterForeground()
-                                     Called on Android in onResume()
-                                */
-    SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive
-                                     Called on iOS in applicationDidBecomeActive()
-                                     Called on Android in onResume()
-                                */
-
-    /* Window events */
-    SDL_WINDOWEVENT    = 0x200, /**< Window state change */
-    SDL_SYSWMEVENT,             /**< System specific event */
-
-    /* Keyboard events */
-    SDL_KEYDOWN        = 0x300, /**< Key pressed */
-    SDL_KEYUP,                  /**< Key released */
-    SDL_TEXTEDITING,            /**< Keyboard text editing (composition) */
-    SDL_TEXTINPUT,              /**< Keyboard text input */
-
-    /* Mouse events */
-    SDL_MOUSEMOTION    = 0x400, /**< Mouse moved */
-    SDL_MOUSEBUTTONDOWN,        /**< Mouse button pressed */
-    SDL_MOUSEBUTTONUP,          /**< Mouse button released */
-    SDL_MOUSEWHEEL,             /**< Mouse wheel motion */
-
-    /* Joystick events */
-    SDL_JOYAXISMOTION  = 0x600, /**< Joystick axis motion */
-    SDL_JOYBALLMOTION,          /**< Joystick trackball motion */
-    SDL_JOYHATMOTION,           /**< Joystick hat position change */
-    SDL_JOYBUTTONDOWN,          /**< Joystick button pressed */
-    SDL_JOYBUTTONUP,            /**< Joystick button released */
-    SDL_JOYDEVICEADDED,         /**< A new joystick has been inserted into the system */
-    SDL_JOYDEVICEREMOVED,       /**< An opened joystick has been removed */
-
-    /* Game controller events */
-    SDL_CONTROLLERAXISMOTION  = 0x650, /**< Game controller axis motion */
-    SDL_CONTROLLERBUTTONDOWN,          /**< Game controller button pressed */
-    SDL_CONTROLLERBUTTONUP,            /**< Game controller button released */
-    SDL_CONTROLLERDEVICEADDED,         /**< A new Game controller has been inserted into the system */
-    SDL_CONTROLLERDEVICEREMOVED,       /**< An opened Game controller has been removed */
-    SDL_CONTROLLERDEVICEREMAPPED,      /**< The controller mapping was updated */
-
-    /* Touch events */
-    SDL_FINGERDOWN      = 0x700,
-    SDL_FINGERUP,
-    SDL_FINGERMOTION,
-
-    /* Gesture events */
-    SDL_DOLLARGESTURE   = 0x800,
-    SDL_DOLLARRECORD,
-    SDL_MULTIGESTURE,
-
-    /* Clipboard events */
-    SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
-
-    /* Drag and drop events */
-    SDL_DROPFILE        = 0x1000, /**< The system requests a file open */
-
-    /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
-     *  and should be allocated with SDL_RegisterEvents()
-     */
-    SDL_USEREVENT    = 0x8000,
-
-    /**
-     *  This last event is only for bounding internal arrays
-     */
-    SDL_LASTEVENT    = 0xFFFF
-} SDL_EventType;
-
-/**
- *  \brief Fields shared by every event
- */
-typedef struct SDL_CommonEvent
-{
-    Uint32 type;
-    Uint32 timestamp;
-} SDL_CommonEvent;
-
-/**
- *  \brief Window state change event data (event.window.*)
- */
-typedef struct SDL_WindowEvent
-{
-    Uint32 type;        /**< ::SDL_WINDOWEVENT */
-    Uint32 timestamp;
-    Uint32 windowID;    /**< The associated window */
-    Uint8 event;        /**< ::SDL_WindowEventID */
-    Uint8 padding1;
-    Uint8 padding2;
-    Uint8 padding3;
-    Sint32 data1;       /**< event dependent data */
-    Sint32 data2;       /**< event dependent data */
-} SDL_WindowEvent;
-
-/**
- *  \brief Keyboard button event structure (event.key.*)
- */
-typedef struct SDL_KeyboardEvent
-{
-    Uint32 type;        /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
-    Uint32 timestamp;
-    Uint32 windowID;    /**< The window with keyboard focus, if any */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
-    Uint8 repeat;       /**< Non-zero if this is a key repeat */
-    Uint8 padding2;
-    Uint8 padding3;
-    SDL_Keysym keysym;  /**< The key that was pressed or released */
-} SDL_KeyboardEvent;
-
-#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
-/**
- *  \brief Keyboard text editing event structure (event.edit.*)
- */
-typedef struct SDL_TextEditingEvent
-{
-    Uint32 type;                                /**< ::SDL_TEXTEDITING */
-    Uint32 timestamp;
-    Uint32 windowID;                            /**< The window with keyboard focus, if any */
-    char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
-    Sint32 start;                               /**< The start cursor of selected editing text */
-    Sint32 length;                              /**< The length of selected editing text */
-} SDL_TextEditingEvent;
-
-
-#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
-/**
- *  \brief Keyboard text input event structure (event.text.*)
- */
-typedef struct SDL_TextInputEvent
-{
-    Uint32 type;                              /**< ::SDL_TEXTINPUT */
-    Uint32 timestamp;
-    Uint32 windowID;                          /**< The window with keyboard focus, if any */
-    char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text */
-} SDL_TextInputEvent;
-
-/**
- *  \brief Mouse motion event structure (event.motion.*)
- */
-typedef struct SDL_MouseMotionEvent
-{
-    Uint32 type;        /**< ::SDL_MOUSEMOTION */
-    Uint32 timestamp;
-    Uint32 windowID;    /**< The window with mouse focus, if any */
-    Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
-    Uint32 state;       /**< The current button state */
-    Sint32 x;           /**< X coordinate, relative to window */
-    Sint32 y;           /**< Y coordinate, relative to window */
-    Sint32 xrel;        /**< The relative motion in the X direction */
-    Sint32 yrel;        /**< The relative motion in the Y direction */
-} SDL_MouseMotionEvent;
-
-/**
- *  \brief Mouse button event structure (event.button.*)
- */
-typedef struct SDL_MouseButtonEvent
-{
-    Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
-    Uint32 timestamp;
-    Uint32 windowID;    /**< The window with mouse focus, if any */
-    Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
-    Uint8 button;       /**< The mouse button index */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
-    Uint8 padding1;
-    Uint8 padding2;
-    Sint32 x;           /**< X coordinate, relative to window */
-    Sint32 y;           /**< Y coordinate, relative to window */
-} SDL_MouseButtonEvent;
-
-/**
- *  \brief Mouse wheel event structure (event.wheel.*)
- */
-typedef struct SDL_MouseWheelEvent
-{
-    Uint32 type;        /**< ::SDL_MOUSEWHEEL */
-    Uint32 timestamp;
-    Uint32 windowID;    /**< The window with mouse focus, if any */
-    Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
-    Sint32 x;           /**< The amount scrolled horizontally */
-    Sint32 y;           /**< The amount scrolled vertically */
-} SDL_MouseWheelEvent;
-
-/**
- *  \brief Joystick axis motion event structure (event.jaxis.*)
- */
-typedef struct SDL_JoyAxisEvent
-{
-    Uint32 type;        /**< ::SDL_JOYAXISMOTION */
-    Uint32 timestamp;
-    SDL_JoystickID which; /**< The joystick instance id */
-    Uint8 axis;         /**< The joystick axis index */
-    Uint8 padding1;
-    Uint8 padding2;
-    Uint8 padding3;
-    Sint16 value;       /**< The axis value (range: -32768 to 32767) */
-    Uint16 padding4;
-} SDL_JoyAxisEvent;
-
-/**
- *  \brief Joystick trackball motion event structure (event.jball.*)
- */
-typedef struct SDL_JoyBallEvent
-{
-    Uint32 type;        /**< ::SDL_JOYBALLMOTION */
-    Uint32 timestamp;
-    SDL_JoystickID which; /**< The joystick instance id */
-    Uint8 ball;         /**< The joystick trackball index */
-    Uint8 padding1;
-    Uint8 padding2;
-    Uint8 padding3;
-    Sint16 xrel;        /**< The relative motion in the X direction */
-    Sint16 yrel;        /**< The relative motion in the Y direction */
-} SDL_JoyBallEvent;
-
-/**
- *  \brief Joystick hat position change event structure (event.jhat.*)
- */
-typedef struct SDL_JoyHatEvent
-{
-    Uint32 type;        /**< ::SDL_JOYHATMOTION */
-    Uint32 timestamp;
-    SDL_JoystickID which; /**< The joystick instance id */
-    Uint8 hat;          /**< The joystick hat index */
-    Uint8 value;        /**< The hat position value.
-                         *   \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
-                         *   \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
-                         *   \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
-                         *
-                         *   Note that zero means the POV is centered.
-                         */
-    Uint8 padding1;
-    Uint8 padding2;
-} SDL_JoyHatEvent;
-
-/**
- *  \brief Joystick button event structure (event.jbutton.*)
- */
-typedef struct SDL_JoyButtonEvent
-{
-    Uint32 type;        /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
-    Uint32 timestamp;
-    SDL_JoystickID which; /**< The joystick instance id */
-    Uint8 button;       /**< The joystick button index */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
-    Uint8 padding1;
-    Uint8 padding2;
-} SDL_JoyButtonEvent;
-
-/**
- *  \brief Joystick device event structure (event.jdevice.*)
- */
-typedef struct SDL_JoyDeviceEvent
-{
-    Uint32 type;        /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
-    Uint32 timestamp;
-    Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
-} SDL_JoyDeviceEvent;
-
-
-/**
- *  \brief Game controller axis motion event structure (event.caxis.*)
- */
-typedef struct SDL_ControllerAxisEvent
-{
-    Uint32 type;        /**< ::SDL_CONTROLLERAXISMOTION */
-    Uint32 timestamp;
-    SDL_JoystickID which; /**< The joystick instance id */
-    Uint8 axis;         /**< The controller axis (SDL_GameControllerAxis) */
-    Uint8 padding1;
-    Uint8 padding2;
-    Uint8 padding3;
-    Sint16 value;       /**< The axis value (range: -32768 to 32767) */
-    Uint16 padding4;
-} SDL_ControllerAxisEvent;
-
-
-/**
- *  \brief Game controller button event structure (event.cbutton.*)
- */
-typedef struct SDL_ControllerButtonEvent
-{
-    Uint32 type;        /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
-    Uint32 timestamp;
-    SDL_JoystickID which; /**< The joystick instance id */
-    Uint8 button;       /**< The controller button (SDL_GameControllerButton) */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
-    Uint8 padding1;
-    Uint8 padding2;
-} SDL_ControllerButtonEvent;
-
-
-/**
- *  \brief Controller device event structure (event.cdevice.*)
- */
-typedef struct SDL_ControllerDeviceEvent
-{
-    Uint32 type;        /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
-    Uint32 timestamp;
-    Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
-} SDL_ControllerDeviceEvent;
-
-
-/**
- *  \brief Touch finger event structure (event.tfinger.*)
- */
-typedef struct SDL_TouchFingerEvent
-{
-    Uint32 type;        /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
-    Uint32 timestamp;
-    SDL_TouchID touchId; /**< The touch device id */
-    SDL_FingerID fingerId;
-    float x;            /**< Normalized in the range 0...1 */
-    float y;            /**< Normalized in the range 0...1 */
-    float dx;           /**< Normalized in the range 0...1 */
-    float dy;           /**< Normalized in the range 0...1 */
-    float pressure;     /**< Normalized in the range 0...1 */
-} SDL_TouchFingerEvent;
-
-
-/**
- *  \brief Multiple Finger Gesture Event (event.mgesture.*)
- */
-typedef struct SDL_MultiGestureEvent
-{
-    Uint32 type;        /**< ::SDL_MULTIGESTURE */
-    Uint32 timestamp;
-    SDL_TouchID touchId; /**< The touch device index */
-    float dTheta;
-    float dDist;
-    float x;
-    float y;
-    Uint16 numFingers;
-    Uint16 padding;
-} SDL_MultiGestureEvent;
-
-
-/**
- * \brief Dollar Gesture Event (event.dgesture.*)
- */
-typedef struct SDL_DollarGestureEvent
-{
-    Uint32 type;        /**< ::SDL_DOLLARGESTURE */
-    Uint32 timestamp;
-    SDL_TouchID touchId; /**< The touch device id */
-    SDL_GestureID gestureId;
-    Uint32 numFingers;
-    float error;
-    float x;            /**< Normalized center of gesture */
-    float y;            /**< Normalized center of gesture */
-} SDL_DollarGestureEvent;
-
-
-/**
- *  \brief An event used to request a file open by the system (event.drop.*)
- *         This event is disabled by default, you can enable it with SDL_EventState()
- *  \note If you enable this event, you must free the filename in the event.
- */
-typedef struct SDL_DropEvent
-{
-    Uint32 type;        /**< ::SDL_DROPFILE */
-    Uint32 timestamp;
-    char *file;         /**< The file name, which should be freed with SDL_free() */
-} SDL_DropEvent;
-
-
-/**
- *  \brief The "quit requested" event
- */
-typedef struct SDL_QuitEvent
-{
-    Uint32 type;        /**< ::SDL_QUIT */
-    Uint32 timestamp;
-} SDL_QuitEvent;
-
-/**
- *  \brief OS Specific event
- */
-typedef struct SDL_OSEvent
-{
-    Uint32 type;        /**< ::SDL_QUIT */
-    Uint32 timestamp;
-} SDL_OSEvent;
-
-/**
- *  \brief A user-defined event type (event.user.*)
- */
-typedef struct SDL_UserEvent
-{
-    Uint32 type;        /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
-    Uint32 timestamp;
-    Uint32 windowID;    /**< The associated window if any */
-    Sint32 code;        /**< User defined event code */
-    void *data1;        /**< User defined data pointer */
-    void *data2;        /**< User defined data pointer */
-} SDL_UserEvent;
-
-
-struct SDL_SysWMmsg;
-typedef struct SDL_SysWMmsg SDL_SysWMmsg;
-
-/**
- *  \brief A video driver dependent system event (event.syswm.*)
- *         This event is disabled by default, you can enable it with SDL_EventState()
- *
- *  \note If you want to use this event, you should include SDL_syswm.h.
- */
-typedef struct SDL_SysWMEvent
-{
-    Uint32 type;        /**< ::SDL_SYSWMEVENT */
-    Uint32 timestamp;
-    SDL_SysWMmsg *msg;  /**< driver dependent data, defined in SDL_syswm.h */
-} SDL_SysWMEvent;
-
-/**
- *  \brief General event structure
- */
-typedef union SDL_Event
-{
-    Uint32 type;                    /**< Event type, shared with all events */
-    SDL_CommonEvent common;         /**< Common event data */
-    SDL_WindowEvent window;         /**< Window event data */
-    SDL_KeyboardEvent key;          /**< Keyboard event data */
-    SDL_TextEditingEvent edit;      /**< Text editing event data */
-    SDL_TextInputEvent text;        /**< Text input event data */
-    SDL_MouseMotionEvent motion;    /**< Mouse motion event data */
-    SDL_MouseButtonEvent button;    /**< Mouse button event data */
-    SDL_MouseWheelEvent wheel;      /**< Mouse wheel event data */
-    SDL_JoyAxisEvent jaxis;         /**< Joystick axis event data */
-    SDL_JoyBallEvent jball;         /**< Joystick ball event data */
-    SDL_JoyHatEvent jhat;           /**< Joystick hat event data */
-    SDL_JoyButtonEvent jbutton;     /**< Joystick button event data */
-    SDL_JoyDeviceEvent jdevice;     /**< Joystick device change event data */
-    SDL_ControllerAxisEvent caxis;      /**< Game Controller axis event data */
-    SDL_ControllerButtonEvent cbutton;  /**< Game Controller button event data */
-    SDL_ControllerDeviceEvent cdevice;  /**< Game Controller device event data */
-    SDL_QuitEvent quit;             /**< Quit request event data */
-    SDL_UserEvent user;             /**< Custom event data */
-    SDL_SysWMEvent syswm;           /**< System dependent window event data */
-    SDL_TouchFingerEvent tfinger;   /**< Touch finger event data */
-    SDL_MultiGestureEvent mgesture; /**< Gesture event data */
-    SDL_DollarGestureEvent dgesture; /**< Gesture event data */
-    SDL_DropEvent drop;             /**< Drag and drop event data */
-
-    /* This is necessary for ABI compatibility between Visual C++ and GCC
-       Visual C++ will respect the push pack pragma and use 52 bytes for
-       this structure, and GCC will use the alignment of the largest datatype
-       within the union, which is 8 bytes.
-
-       So... we'll add padding to force the size to be 56 bytes for both.
-    */
-    Uint8 padding[56];
-} SDL_Event;
-
-
-/* Function prototypes */
-
-/**
- *  Pumps the event loop, gathering events from the input devices.
- *
- *  This function updates the event queue and internal input device state.
- *
- *  This should only be run in the thread that sets the video mode.
- */
-extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
-
-/* @{ */
-typedef enum
-{
-    SDL_ADDEVENT,
-    SDL_PEEKEVENT,
-    SDL_GETEVENT
-} SDL_eventaction;
-
-/**
- *  Checks the event queue for messages and optionally returns them.
- *
- *  If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
- *  the back of the event queue.
- *
- *  If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
- *  of the event queue, within the specified minimum and maximum type,
- *  will be returned and will not be removed from the queue.
- *
- *  If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
- *  of the event queue, within the specified minimum and maximum type,
- *  will be returned and will be removed from the queue.
- *
- *  \return The number of events actually stored, or -1 if there was an error.
- *
- *  This function is thread-safe.
- */
-extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
-                                           SDL_eventaction action,
-                                           Uint32 minType, Uint32 maxType);
-/* @} */
-
-/**
- *  Checks to see if certain event types are in the event queue.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
-extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
-
-/**
- *  This function clears events from the event queue
- */
-extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
-extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
-
-/**
- *  \brief Polls for currently pending events.
- *
- *  \return 1 if there are any pending events, or 0 if there are none available.
- *
- *  \param event If not NULL, the next event is removed from the queue and
- *               stored in that area.
- */
-extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
-
-/**
- *  \brief Waits indefinitely for the next available event.
- *
- *  \return 1, or 0 if there was an error while waiting for events.
- *
- *  \param event If not NULL, the next event is removed from the queue and
- *               stored in that area.
- */
-extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
-
-/**
- *  \brief Waits until the specified timeout (in milliseconds) for the next
- *         available event.
- *
- *  \return 1, or 0 if there was an error while waiting for events.
- *
- *  \param event If not NULL, the next event is removed from the queue and
- *               stored in that area.
- *  \param timeout The timeout (in milliseconds) to wait for next event.
- */
-extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
-                                                 int timeout);
-
-/**
- *  \brief Add an event to the event queue.
- *
- *  \return 1 on success, 0 if the event was filtered, or -1 if the event queue
- *          was full or there was some other error.
- */
-extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
-
-typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
-
-/**
- *  Sets up a filter to process all events before they change internal state and
- *  are posted to the internal event queue.
- *
- *  The filter is prototyped as:
- *  \code
- *      int SDL_EventFilter(void *userdata, SDL_Event * event);
- *  \endcode
- *
- *  If the filter returns 1, then the event will be added to the internal queue.
- *  If it returns 0, then the event will be dropped from the queue, but the
- *  internal state will still be updated.  This allows selective filtering of
- *  dynamically arriving events.
- *
- *  \warning  Be very careful of what you do in the event filter function, as
- *            it may run in a different thread!
- *
- *  There is one caveat when dealing with the ::SDL_QuitEvent event type.  The
- *  event filter is only called when the window manager desires to close the
- *  application window.  If the event filter returns 1, then the window will
- *  be closed, otherwise the window will remain open if possible.
- *
- *  If the quit event is generated by an interrupt signal, it will bypass the
- *  internal queue and be delivered to the application at the next event poll.
- */
-extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
-                                                void *userdata);
-
-/**
- *  Return the current event filter - can be used to "chain" filters.
- *  If there is no event filter set, this function returns SDL_FALSE.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
-                                                    void **userdata);
-
-/**
- *  Add a function which is called when an event is added to the queue.
- */
-extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
-                                               void *userdata);
-
-/**
- *  Remove an event watch function added with SDL_AddEventWatch()
- */
-extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
-                                               void *userdata);
-
-/**
- *  Run the filter function on the current event queue, removing any
- *  events for which the filter returns 0.
- */
-extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
-                                              void *userdata);
-
-/* @{ */
-#define SDL_QUERY   -1
-#define SDL_IGNORE   0
-#define SDL_DISABLE  0
-#define SDL_ENABLE   1
-
-/**
- *  This function allows you to set the state of processing certain events.
- *   - If \c state is set to ::SDL_IGNORE, that event will be automatically
- *     dropped from the event queue and will not event be filtered.
- *   - If \c state is set to ::SDL_ENABLE, that event will be processed
- *     normally.
- *   - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
- *     current processing state of the specified event.
- */
-extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
-/* @} */
-#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
-
-/**
- *  This function allocates a set of user-defined events, and returns
- *  the beginning event number for that set of events.
- *
- *  If there aren't enough user-defined events left, this function
- *  returns (Uint32)-1
- */
-extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_events_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_filesystem.h b/deps/SDL2/include/SDL_filesystem.h
deleted file mode 100644
index ea8a1b5..0000000
--- a/deps/SDL2/include/SDL_filesystem.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_filesystem.h
- *
- *  \brief Include file for filesystem SDL API functions
- */
-
-#ifndef _SDL_filesystem_h
-#define _SDL_filesystem_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief Get the path where the application resides.
- *
- * Get the "base path". This is the directory where the application was run
- *  from, which is probably the installation directory, and may or may not
- *  be the process's current working directory.
- *
- * This returns an absolute path in UTF-8 encoding, and is guaranteed to
- *  end with a path separator ('\\' on Windows, '/' most other places).
- *
- * The pointer returned by this function is owned by you. Please call
- *  SDL_free() on the pointer when you are done with it, or it will be a
- *  memory leak. This is not necessarily a fast call, though, so you should
- *  call this once near startup and save the string if you need it.
- *
- * Some platforms can't determine the application's path, and on other
- *  platforms, this might be meaningless. In such cases, this function will
- *  return NULL.
- *
- *  \return String of base dir in UTF-8 encoding, or NULL on error.
- *
- * \sa SDL_GetPrefPath
- */
-extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
-
-/**
- * \brief Get the user-and-app-specific path where files can be written.
- *
- * Get the "pref dir". This is meant to be where users can write personal
- *  files (preferences and save games, etc) that are specific to your
- *  application. This directory is unique per user, per application.
- *
- * This function will decide the appropriate location in the native filesystem,
- *  create the directory if necessary, and return a string of the absolute
- *  path to the directory in UTF-8 encoding.
- *
- * On Windows, the string might look like:
- *  "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\"
- *
- * On Linux, the string might look like:
- *  "/home/bob/.local/share/My Program Name/"
- *
- * On Mac OS X, the string might look like:
- *  "/Users/bob/Library/Application Support/My Program Name/"
- *
- * (etc.)
- *
- * You specify the name of your organization (if it's not a real organization,
- *  your name or an Internet domain you own might do) and the name of your
- *  application. These should be untranslated proper names.
- *
- * Both the org and app strings may become part of a directory name, so
- *  please follow these rules:
- *
- *    - Try to use the same org string (including case-sensitivity) for
- *      all your applications that use this function.
- *    - Always use a unique app string for each one, and make sure it never
- *      changes for an app once you've decided on it.
- *    - Unicode characters are legal, as long as it's UTF-8 encoded, but...
- *    - ...only use letters, numbers, and spaces. Avoid punctuation like
- *      "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
- *
- * This returns an absolute path in UTF-8 encoding, and is guaranteed to
- *  end with a path separator ('\\' on Windows, '/' most other places).
- *
- * The pointer returned by this function is owned by you. Please call
- *  SDL_free() on the pointer when you are done with it, or it will be a
- *  memory leak. This is not necessarily a fast call, though, so you should
- *  call this once near startup and save the string if you need it.
- *
- * You should assume the path returned by this function is the only safe
- *  place to write files (and that SDL_GetBasePath(), while it might be
- *  writable, or even the parent of the returned path, aren't where you
- *  should be writing things).
- *
- * Some platforms can't determine the pref path, and on other
- *  platforms, this might be meaningless. In such cases, this function will
- *  return NULL.
- *
- *   \param org The name of your organization.
- *   \param app The name of your application.
- *  \return UTF-8 string of user dir in platform-dependent notation. NULL
- *          if there's a problem (creating directory failed, etc).
- *
- * \sa SDL_GetBasePath
- */
-extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_system_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_gamecontroller.h b/deps/SDL2/include/SDL_gamecontroller.h
deleted file mode 100644
index e55749c..0000000
--- a/deps/SDL2/include/SDL_gamecontroller.h
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_gamecontroller.h
- *
- *  Include file for SDL game controller event handling
- */
-
-#ifndef _SDL_gamecontroller_h
-#define _SDL_gamecontroller_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_joystick.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \file SDL_gamecontroller.h
- *
- *  In order to use these functions, SDL_Init() must have been called
- *  with the ::SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
- *  for game controllers, and load appropriate drivers.
- *
- *  If you would like to receive controller updates while the application
- *  is in the background, you should set the following hint before calling
- *  SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
- */
-
-/* The gamecontroller structure used to identify an SDL game controller */
-struct _SDL_GameController;
-typedef struct _SDL_GameController SDL_GameController;
-
-
-typedef enum
-{
-    SDL_CONTROLLER_BINDTYPE_NONE = 0,
-    SDL_CONTROLLER_BINDTYPE_BUTTON,
-    SDL_CONTROLLER_BINDTYPE_AXIS,
-    SDL_CONTROLLER_BINDTYPE_HAT
-} SDL_GameControllerBindType;
-
-/**
- *  Get the SDL joystick layer binding for this controller button/axis mapping
- */
-typedef struct SDL_GameControllerButtonBind
-{
-    SDL_GameControllerBindType bindType;
-    union
-    {
-        int button;
-        int axis;
-        struct {
-            int hat;
-            int hat_mask;
-        } hat;
-    } value;
-
-} SDL_GameControllerButtonBind;
-
-
-/**
- *  To count the number of game controllers in the system for the following:
- *  int nJoysticks = SDL_NumJoysticks();
- *  int nGameControllers = 0;
- *  for ( int i = 0; i < nJoysticks; i++ ) {
- *      if ( SDL_IsGameController(i) ) {
- *          nGameControllers++;
- *      }
- *  }
- *
- *  Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
- *  guid,name,mappings
- *
- *  Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
- *  Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
- *  The mapping format for joystick is:
- *      bX - a joystick button, index X
- *      hX.Y - hat X with value Y
- *      aX - axis X of the joystick
- *  Buttons can be used as a controller axis and vice versa.
- *
- *  This string shows an example of a valid mapping for a controller
- *  "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
- *
- */
-
-/**
- *  Add or update an existing mapping configuration
- *
- * \return 1 if mapping is added, 0 if updated, -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString );
-
-/**
- *  Get a mapping string for a GUID
- *
- *  \return the mapping string.  Must be freed with SDL_free.  Returns NULL if no mapping is available
- */
-extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid );
-
-/**
- *  Get a mapping string for an open GameController
- *
- *  \return the mapping string.  Must be freed with SDL_free.  Returns NULL if no mapping is available
- */
-extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller );
-
-/**
- *  Is the joystick on this index supported by the game controller interface?
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
-
-
-/**
- *  Get the implementation dependent name of a game controller.
- *  This can be called before any controllers are opened.
- *  If no name can be found, this function returns NULL.
- */
-extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
-
-/**
- *  Open a game controller for use.
- *  The index passed as an argument refers to the N'th game controller on the system.
- *  This index is the value which will identify this controller in future controller
- *  events.
- *
- *  \return A controller identifier, or NULL if an error occurred.
- */
-extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index);
-
-/**
- *  Return the name for this currently opened controller
- */
-extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
-
-/**
- *  Returns SDL_TRUE if the controller has been opened and currently connected,
- *  or SDL_FALSE if it has not.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller);
-
-/**
- *  Get the underlying joystick object used by a controller
- */
-extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller);
-
-/**
- *  Enable/disable controller event polling.
- *
- *  If controller events are disabled, you must call SDL_GameControllerUpdate()
- *  yourself and check the state of the controller when you want controller
- *  information.
- *
- *  The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
- */
-extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
-
-/**
- *  Update the current state of the open game controllers.
- *
- *  This is called automatically by the event loop if any game controller
- *  events are enabled.
- */
-extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
-
-
-/**
- *  The list of axes available from a controller
- */
-typedef enum
-{
-    SDL_CONTROLLER_AXIS_INVALID = -1,
-    SDL_CONTROLLER_AXIS_LEFTX,
-    SDL_CONTROLLER_AXIS_LEFTY,
-    SDL_CONTROLLER_AXIS_RIGHTX,
-    SDL_CONTROLLER_AXIS_RIGHTY,
-    SDL_CONTROLLER_AXIS_TRIGGERLEFT,
-    SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
-    SDL_CONTROLLER_AXIS_MAX
-} SDL_GameControllerAxis;
-
-/**
- *  turn this string into a axis mapping
- */
-extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString);
-
-/**
- *  turn this axis enum into a string mapping
- */
-extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis);
-
-/**
- *  Get the SDL joystick layer binding for this controller button mapping
- */
-extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
-SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
-                                 SDL_GameControllerAxis axis);
-
-/**
- *  Get the current state of an axis control on a game controller.
- *
- *  The state is a value ranging from -32768 to 32767.
- *
- *  The axis indices start at index 0.
- */
-extern DECLSPEC Sint16 SDLCALL
-SDL_GameControllerGetAxis(SDL_GameController *gamecontroller,
-                          SDL_GameControllerAxis axis);
-
-/**
- *  The list of buttons available from a controller
- */
-typedef enum
-{
-    SDL_CONTROLLER_BUTTON_INVALID = -1,
-    SDL_CONTROLLER_BUTTON_A,
-    SDL_CONTROLLER_BUTTON_B,
-    SDL_CONTROLLER_BUTTON_X,
-    SDL_CONTROLLER_BUTTON_Y,
-    SDL_CONTROLLER_BUTTON_BACK,
-    SDL_CONTROLLER_BUTTON_GUIDE,
-    SDL_CONTROLLER_BUTTON_START,
-    SDL_CONTROLLER_BUTTON_LEFTSTICK,
-    SDL_CONTROLLER_BUTTON_RIGHTSTICK,
-    SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
-    SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
-    SDL_CONTROLLER_BUTTON_DPAD_UP,
-    SDL_CONTROLLER_BUTTON_DPAD_DOWN,
-    SDL_CONTROLLER_BUTTON_DPAD_LEFT,
-    SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
-    SDL_CONTROLLER_BUTTON_MAX
-} SDL_GameControllerButton;
-
-/**
- *  turn this string into a button mapping
- */
-extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString);
-
-/**
- *  turn this button enum into a string mapping
- */
-extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button);
-
-/**
- *  Get the SDL joystick layer binding for this controller button mapping
- */
-extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
-SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
-                                   SDL_GameControllerButton button);
-
-
-/**
- *  Get the current state of a button on a game controller.
- *
- *  The button indices start at index 0.
- */
-extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller,
-                                                          SDL_GameControllerButton button);
-
-/**
- *  Close a controller previously opened with SDL_GameControllerOpen().
- */
-extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_gamecontroller_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_gesture.h b/deps/SDL2/include/SDL_gesture.h
deleted file mode 100644
index 21f10ea..0000000
--- a/deps/SDL2/include/SDL_gesture.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_gesture.h
- *
- *  Include file for SDL gesture event handling.
- */
-
-#ifndef _SDL_gesture_h
-#define _SDL_gesture_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_video.h"
-
-#include "SDL_touch.h"
-
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef Sint64 SDL_GestureID;
-
-/* Function prototypes */
-
-/**
- *  \brief Begin Recording a gesture on the specified touch, or all touches (-1)
- *
- *
- */
-extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
-
-
-/**
- *  \brief Save all currently loaded Dollar Gesture templates
- *
- *
- */
-extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *src);
-
-/**
- *  \brief Save a currently loaded Dollar Gesture template
- *
- *
- */
-extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *src);
-
-
-/**
- *  \brief Load Dollar Gesture templates from a file
- *
- *
- */
-extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_gesture_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_haptic.h b/deps/SDL2/include/SDL_haptic.h
deleted file mode 100644
index a029eb9..0000000
--- a/deps/SDL2/include/SDL_haptic.h
+++ /dev/null
@@ -1,1225 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_haptic.h
- *
- *  \brief The SDL Haptic subsystem allows you to control haptic (force feedback)
- *         devices.
- *
- *  The basic usage is as follows:
- *   - Initialize the Subsystem (::SDL_INIT_HAPTIC).
- *   - Open a Haptic Device.
- *    - SDL_HapticOpen() to open from index.
- *    - SDL_HapticOpenFromJoystick() to open from an existing joystick.
- *   - Create an effect (::SDL_HapticEffect).
- *   - Upload the effect with SDL_HapticNewEffect().
- *   - Run the effect with SDL_HapticRunEffect().
- *   - (optional) Free the effect with SDL_HapticDestroyEffect().
- *   - Close the haptic device with SDL_HapticClose().
- *
- * \par Simple rumble example:
- * \code
- *    SDL_Haptic *haptic;
- *
- *    // Open the device
- *    haptic = SDL_HapticOpen( 0 );
- *    if (haptic == NULL)
- *       return -1;
- *
- *    // Initialize simple rumble
- *    if (SDL_HapticRumbleInit( haptic ) != 0)
- *       return -1;
- *
- *    // Play effect at 50% strength for 2 seconds
- *    if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0)
- *       return -1;
- *    SDL_Delay( 2000 );
- *
- *    // Clean up
- *    SDL_HapticClose( haptic );
- * \endcode
- *
- * \par Complete example:
- * \code
- * int test_haptic( SDL_Joystick * joystick ) {
- *    SDL_Haptic *haptic;
- *    SDL_HapticEffect effect;
- *    int effect_id;
- *
- *    // Open the device
- *    haptic = SDL_HapticOpenFromJoystick( joystick );
- *    if (haptic == NULL) return -1; // Most likely joystick isn't haptic
- *
- *    // See if it can do sine waves
- *    if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) {
- *       SDL_HapticClose(haptic); // No sine effect
- *       return -1;
- *    }
- *
- *    // Create the effect
- *    memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
- *    effect.type = SDL_HAPTIC_SINE;
- *    effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates
- *    effect.periodic.direction.dir[0] = 18000; // Force comes from south
- *    effect.periodic.period = 1000; // 1000 ms
- *    effect.periodic.magnitude = 20000; // 20000/32767 strength
- *    effect.periodic.length = 5000; // 5 seconds long
- *    effect.periodic.attack_length = 1000; // Takes 1 second to get max strength
- *    effect.periodic.fade_length = 1000; // Takes 1 second to fade away
- *
- *    // Upload the effect
- *    effect_id = SDL_HapticNewEffect( haptic, &effect );
- *
- *    // Test the effect
- *    SDL_HapticRunEffect( haptic, effect_id, 1 );
- *    SDL_Delay( 5000); // Wait for the effect to finish
- *
- *    // We destroy the effect, although closing the device also does this
- *    SDL_HapticDestroyEffect( haptic, effect_id );
- *
- *    // Close the device
- *    SDL_HapticClose(haptic);
- *
- *    return 0; // Success
- * }
- * \endcode
- *
- * You can also find out more information on my blog:
- * http://bobbens.dyndns.org/journal/2010/sdl_haptic/
- *
- * \author Edgar Simo Serra
- */
-
-#ifndef _SDL_haptic_h
-#define _SDL_haptic_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_joystick.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- *  \typedef SDL_Haptic
- *
- *  \brief The haptic structure used to identify an SDL haptic.
- *
- *  \sa SDL_HapticOpen
- *  \sa SDL_HapticOpenFromJoystick
- *  \sa SDL_HapticClose
- */
-struct _SDL_Haptic;
-typedef struct _SDL_Haptic SDL_Haptic;
-
-
-/**
- *  \name Haptic features
- *
- *  Different haptic features a device can have.
- */
-/* @{ */
-
-/**
- *  \name Haptic effects
- */
-/* @{ */
-
-/**
- *  \brief Constant effect supported.
- *
- *  Constant haptic effect.
- *
- *  \sa SDL_HapticCondition
- */
-#define SDL_HAPTIC_CONSTANT   (1<<0)
-
-/**
- *  \brief Sine wave effect supported.
- *
- *  Periodic haptic effect that simulates sine waves.
- *
- *  \sa SDL_HapticPeriodic
- */
-#define SDL_HAPTIC_SINE       (1<<1)
-
-/**
- *  \brief Left/Right effect supported.
- *
- *  Haptic effect for direct control over high/low frequency motors.
- *
- *  \sa SDL_HapticLeftRight
- * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry,
- *          we ran out of bits, and this is important for XInput devices.
- */
-#define SDL_HAPTIC_LEFTRIGHT     (1<<2)
-
-/* !!! FIXME: put this back when we have more bits in 2.1 */
-/* #define SDL_HAPTIC_SQUARE     (1<<2) */
-
-/**
- *  \brief Triangle wave effect supported.
- *
- *  Periodic haptic effect that simulates triangular waves.
- *
- *  \sa SDL_HapticPeriodic
- */
-#define SDL_HAPTIC_TRIANGLE   (1<<3)
-
-/**
- *  \brief Sawtoothup wave effect supported.
- *
- *  Periodic haptic effect that simulates saw tooth up waves.
- *
- *  \sa SDL_HapticPeriodic
- */
-#define SDL_HAPTIC_SAWTOOTHUP (1<<4)
-
-/**
- *  \brief Sawtoothdown wave effect supported.
- *
- *  Periodic haptic effect that simulates saw tooth down waves.
- *
- *  \sa SDL_HapticPeriodic
- */
-#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5)
-
-/**
- *  \brief Ramp effect supported.
- *
- *  Ramp haptic effect.
- *
- *  \sa SDL_HapticRamp
- */
-#define SDL_HAPTIC_RAMP       (1<<6)
-
-/**
- *  \brief Spring effect supported - uses axes position.
- *
- *  Condition haptic effect that simulates a spring.  Effect is based on the
- *  axes position.
- *
- *  \sa SDL_HapticCondition
- */
-#define SDL_HAPTIC_SPRING     (1<<7)
-
-/**
- *  \brief Damper effect supported - uses axes velocity.
- *
- *  Condition haptic effect that simulates dampening.  Effect is based on the
- *  axes velocity.
- *
- *  \sa SDL_HapticCondition
- */
-#define SDL_HAPTIC_DAMPER     (1<<8)
-
-/**
- *  \brief Inertia effect supported - uses axes acceleration.
- *
- *  Condition haptic effect that simulates inertia.  Effect is based on the axes
- *  acceleration.
- *
- *  \sa SDL_HapticCondition
- */
-#define SDL_HAPTIC_INERTIA    (1<<9)
-
-/**
- *  \brief Friction effect supported - uses axes movement.
- *
- *  Condition haptic effect that simulates friction.  Effect is based on the
- *  axes movement.
- *
- *  \sa SDL_HapticCondition
- */
-#define SDL_HAPTIC_FRICTION   (1<<10)
-
-/**
- *  \brief Custom effect is supported.
- *
- *  User defined custom haptic effect.
- */
-#define SDL_HAPTIC_CUSTOM     (1<<11)
-
-/* @} *//* Haptic effects */
-
-/* These last few are features the device has, not effects */
-
-/**
- *  \brief Device can set global gain.
- *
- *  Device supports setting the global gain.
- *
- *  \sa SDL_HapticSetGain
- */
-#define SDL_HAPTIC_GAIN       (1<<12)
-
-/**
- *  \brief Device can set autocenter.
- *
- *  Device supports setting autocenter.
- *
- *  \sa SDL_HapticSetAutocenter
- */
-#define SDL_HAPTIC_AUTOCENTER (1<<13)
-
-/**
- *  \brief Device can be queried for effect status.
- *
- *  Device can be queried for effect status.
- *
- *  \sa SDL_HapticGetEffectStatus
- */
-#define SDL_HAPTIC_STATUS     (1<<14)
-
-/**
- *  \brief Device can be paused.
- *
- *  \sa SDL_HapticPause
- *  \sa SDL_HapticUnpause
- */
-#define SDL_HAPTIC_PAUSE      (1<<15)
-
-
-/**
- * \name Direction encodings
- */
-/* @{ */
-
-/**
- *  \brief Uses polar coordinates for the direction.
- *
- *  \sa SDL_HapticDirection
- */
-#define SDL_HAPTIC_POLAR      0
-
-/**
- *  \brief Uses cartesian coordinates for the direction.
- *
- *  \sa SDL_HapticDirection
- */
-#define SDL_HAPTIC_CARTESIAN  1
-
-/**
- *  \brief Uses spherical coordinates for the direction.
- *
- *  \sa SDL_HapticDirection
- */
-#define SDL_HAPTIC_SPHERICAL  2
-
-/* @} *//* Direction encodings */
-
-/* @} *//* Haptic features */
-
-/*
- * Misc defines.
- */
-
-/**
- * \brief Used to play a device an infinite number of times.
- *
- * \sa SDL_HapticRunEffect
- */
-#define SDL_HAPTIC_INFINITY   4294967295U
-
-
-/**
- *  \brief Structure that represents a haptic direction.
- *
- *  Directions can be specified by:
- *   - ::SDL_HAPTIC_POLAR : Specified by polar coordinates.
- *   - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates.
- *   - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates.
- *
- *  Cardinal directions of the haptic device are relative to the positioning
- *  of the device.  North is considered to be away from the user.
- *
- *  The following diagram represents the cardinal directions:
- *  \verbatim
-                 .--.
-                 |__| .-------.
-                 |=.| |.-----.|
-                 |--| ||     ||
-                 |  | |'-----'|
-                 |__|~')_____('
-                   [ COMPUTER ]
-
-
-                     North (0,-1)
-                         ^
-                         |
-                         |
-    (1,0)  West <----[ HAPTIC ]----> East (-1,0)
-                         |
-                         |
-                         v
-                      South (0,1)
-
-
-                      [ USER ]
-                        \|||/
-                        (o o)
-                  ---ooO-(_)-Ooo---
-    \endverbatim
- *
- *  If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a
- *  degree starting north and turning clockwise.  ::SDL_HAPTIC_POLAR only uses
- *  the first \c dir parameter.  The cardinal directions would be:
- *   - North: 0 (0 degrees)
- *   - East: 9000 (90 degrees)
- *   - South: 18000 (180 degrees)
- *   - West: 27000 (270 degrees)
- *
- *  If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions
- *  (X axis, Y axis and Z axis (with 3 axes)).  ::SDL_HAPTIC_CARTESIAN uses
- *  the first three \c dir parameters.  The cardinal directions would be:
- *   - North:  0,-1, 0
- *   - East:  -1, 0, 0
- *   - South:  0, 1, 0
- *   - West:   1, 0, 0
- *
- *  The Z axis represents the height of the effect if supported, otherwise
- *  it's unused.  In cartesian encoding (1, 2) would be the same as (2, 4), you
- *  can use any multiple you want, only the direction matters.
- *
- *  If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations.
- *  The first two \c dir parameters are used.  The \c dir parameters are as
- *  follows (all values are in hundredths of degrees):
- *   - Degrees from (1, 0) rotated towards (0, 1).
- *   - Degrees towards (0, 0, 1) (device needs at least 3 axes).
- *
- *
- *  Example of force coming from the south with all encodings (force coming
- *  from the south means the user will have to pull the stick to counteract):
- *  \code
- *  SDL_HapticDirection direction;
- *
- *  // Cartesian directions
- *  direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding.
- *  direction.dir[0] = 0; // X position
- *  direction.dir[1] = 1; // Y position
- *  // Assuming the device has 2 axes, we don't need to specify third parameter.
- *
- *  // Polar directions
- *  direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding.
- *  direction.dir[0] = 18000; // Polar only uses first parameter
- *
- *  // Spherical coordinates
- *  direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding
- *  direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters.
- *  \endcode
- *
- *  \sa SDL_HAPTIC_POLAR
- *  \sa SDL_HAPTIC_CARTESIAN
- *  \sa SDL_HAPTIC_SPHERICAL
- *  \sa SDL_HapticEffect
- *  \sa SDL_HapticNumAxes
- */
-typedef struct SDL_HapticDirection
-{
-    Uint8 type;         /**< The type of encoding. */
-    Sint32 dir[3];      /**< The encoded direction. */
-} SDL_HapticDirection;
-
-
-/**
- *  \brief A structure containing a template for a Constant effect.
- *
- *  The struct is exclusive to the ::SDL_HAPTIC_CONSTANT effect.
- *
- *  A constant effect applies a constant force in the specified direction
- *  to the joystick.
- *
- *  \sa SDL_HAPTIC_CONSTANT
- *  \sa SDL_HapticEffect
- */
-typedef struct SDL_HapticConstant
-{
-    /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_CONSTANT */
-    SDL_HapticDirection direction;  /**< Direction of the effect. */
-
-    /* Replay */
-    Uint32 length;          /**< Duration of the effect. */
-    Uint16 delay;           /**< Delay before starting the effect. */
-
-    /* Trigger */
-    Uint16 button;          /**< Button that triggers the effect. */
-    Uint16 interval;        /**< How soon it can be triggered again after button. */
-
-    /* Constant */
-    Sint16 level;           /**< Strength of the constant effect. */
-
-    /* Envelope */
-    Uint16 attack_length;   /**< Duration of the attack. */
-    Uint16 attack_level;    /**< Level at the start of the attack. */
-    Uint16 fade_length;     /**< Duration of the fade. */
-    Uint16 fade_level;      /**< Level at the end of the fade. */
-} SDL_HapticConstant;
-
-/**
- *  \brief A structure containing a template for a Periodic effect.
- *
- *  The struct handles the following effects:
- *   - ::SDL_HAPTIC_SINE
- *   - ::SDL_HAPTIC_LEFTRIGHT
- *   - ::SDL_HAPTIC_TRIANGLE
- *   - ::SDL_HAPTIC_SAWTOOTHUP
- *   - ::SDL_HAPTIC_SAWTOOTHDOWN
- *
- *  A periodic effect consists in a wave-shaped effect that repeats itself
- *  over time.  The type determines the shape of the wave and the parameters
- *  determine the dimensions of the wave.
- *
- *  Phase is given by hundredth of a cycle meaning that giving the phase a value
- *  of 9000 will displace it 25% of its period.  Here are sample values:
- *   -     0: No phase displacement.
- *   -  9000: Displaced 25% of its period.
- *   - 18000: Displaced 50% of its period.
- *   - 27000: Displaced 75% of its period.
- *   - 36000: Displaced 100% of its period, same as 0, but 0 is preferred.
- *
- *  Examples:
- *  \verbatim
-    SDL_HAPTIC_SINE
-      __      __      __      __
-     /  \    /  \    /  \    /
-    /    \__/    \__/    \__/
-
-    SDL_HAPTIC_SQUARE
-     __    __    __    __    __
-    |  |  |  |  |  |  |  |  |  |
-    |  |__|  |__|  |__|  |__|  |
-
-    SDL_HAPTIC_TRIANGLE
-      /\    /\    /\    /\    /\
-     /  \  /  \  /  \  /  \  /
-    /    \/    \/    \/    \/
-
-    SDL_HAPTIC_SAWTOOTHUP
-      /|  /|  /|  /|  /|  /|  /|
-     / | / | / | / | / | / | / |
-    /  |/  |/  |/  |/  |/  |/  |
-
-    SDL_HAPTIC_SAWTOOTHDOWN
-    \  |\  |\  |\  |\  |\  |\  |
-     \ | \ | \ | \ | \ | \ | \ |
-      \|  \|  \|  \|  \|  \|  \|
-    \endverbatim
- *
- *  \sa SDL_HAPTIC_SINE
- *  \sa SDL_HAPTIC_LEFTRIGHT
- *  \sa SDL_HAPTIC_TRIANGLE
- *  \sa SDL_HAPTIC_SAWTOOTHUP
- *  \sa SDL_HAPTIC_SAWTOOTHDOWN
- *  \sa SDL_HapticEffect
- */
-typedef struct SDL_HapticPeriodic
-{
-    /* Header */
-    Uint16 type;        /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT,
-                             ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or
-                             ::SDL_HAPTIC_SAWTOOTHDOWN */
-    SDL_HapticDirection direction;  /**< Direction of the effect. */
-
-    /* Replay */
-    Uint32 length;      /**< Duration of the effect. */
-    Uint16 delay;       /**< Delay before starting the effect. */
-
-    /* Trigger */
-    Uint16 button;      /**< Button that triggers the effect. */
-    Uint16 interval;    /**< How soon it can be triggered again after button. */
-
-    /* Periodic */
-    Uint16 period;      /**< Period of the wave. */
-    Sint16 magnitude;   /**< Peak value. */
-    Sint16 offset;      /**< Mean value of the wave. */
-    Uint16 phase;       /**< Horizontal shift given by hundredth of a cycle. */
-
-    /* Envelope */
-    Uint16 attack_length;   /**< Duration of the attack. */
-    Uint16 attack_level;    /**< Level at the start of the attack. */
-    Uint16 fade_length; /**< Duration of the fade. */
-    Uint16 fade_level;  /**< Level at the end of the fade. */
-} SDL_HapticPeriodic;
-
-/**
- *  \brief A structure containing a template for a Condition effect.
- *
- *  The struct handles the following effects:
- *   - ::SDL_HAPTIC_SPRING: Effect based on axes position.
- *   - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity.
- *   - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
- *   - ::SDL_HAPTIC_FRICTION: Effect based on axes movement.
- *
- *  Direction is handled by condition internals instead of a direction member.
- *  The condition effect specific members have three parameters.  The first
- *  refers to the X axis, the second refers to the Y axis and the third
- *  refers to the Z axis.  The right terms refer to the positive side of the
- *  axis and the left terms refer to the negative side of the axis.  Please
- *  refer to the ::SDL_HapticDirection diagram for which side is positive and
- *  which is negative.
- *
- *  \sa SDL_HapticDirection
- *  \sa SDL_HAPTIC_SPRING
- *  \sa SDL_HAPTIC_DAMPER
- *  \sa SDL_HAPTIC_INERTIA
- *  \sa SDL_HAPTIC_FRICTION
- *  \sa SDL_HapticEffect
- */
-typedef struct SDL_HapticCondition
-{
-    /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER,
-                                 ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */
-    SDL_HapticDirection direction;  /**< Direction of the effect - Not used ATM. */
-
-    /* Replay */
-    Uint32 length;          /**< Duration of the effect. */
-    Uint16 delay;           /**< Delay before starting the effect. */
-
-    /* Trigger */
-    Uint16 button;          /**< Button that triggers the effect. */
-    Uint16 interval;        /**< How soon it can be triggered again after button. */
-
-    /* Condition */
-    Uint16 right_sat[3];    /**< Level when joystick is to the positive side. */
-    Uint16 left_sat[3];     /**< Level when joystick is to the negative side. */
-    Sint16 right_coeff[3];  /**< How fast to increase the force towards the positive side. */
-    Sint16 left_coeff[3];   /**< How fast to increase the force towards the negative side. */
-    Uint16 deadband[3];     /**< Size of the dead zone. */
-    Sint16 center[3];       /**< Position of the dead zone. */
-} SDL_HapticCondition;
-
-/**
- *  \brief A structure containing a template for a Ramp effect.
- *
- *  This struct is exclusively for the ::SDL_HAPTIC_RAMP effect.
- *
- *  The ramp effect starts at start strength and ends at end strength.
- *  It augments in linear fashion.  If you use attack and fade with a ramp
- *  the effects get added to the ramp effect making the effect become
- *  quadratic instead of linear.
- *
- *  \sa SDL_HAPTIC_RAMP
- *  \sa SDL_HapticEffect
- */
-typedef struct SDL_HapticRamp
-{
-    /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_RAMP */
-    SDL_HapticDirection direction;  /**< Direction of the effect. */
-
-    /* Replay */
-    Uint32 length;          /**< Duration of the effect. */
-    Uint16 delay;           /**< Delay before starting the effect. */
-
-    /* Trigger */
-    Uint16 button;          /**< Button that triggers the effect. */
-    Uint16 interval;        /**< How soon it can be triggered again after button. */
-
-    /* Ramp */
-    Sint16 start;           /**< Beginning strength level. */
-    Sint16 end;             /**< Ending strength level. */
-
-    /* Envelope */
-    Uint16 attack_length;   /**< Duration of the attack. */
-    Uint16 attack_level;    /**< Level at the start of the attack. */
-    Uint16 fade_length;     /**< Duration of the fade. */
-    Uint16 fade_level;      /**< Level at the end of the fade. */
-} SDL_HapticRamp;
-
-/**
- * \brief A structure containing a template for a Left/Right effect.
- *
- * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect.
- *
- * The Left/Right effect is used to explicitly control the large and small
- * motors, commonly found in modern game controllers. One motor is high
- * frequency, the other is low frequency.
- *
- * \sa SDL_HAPTIC_LEFTRIGHT
- * \sa SDL_HapticEffect
- */
-typedef struct SDL_HapticLeftRight
-{
-    /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_LEFTRIGHT */
-
-    /* Replay */
-    Uint32 length;          /**< Duration of the effect. */
-
-    /* Rumble */
-    Uint16 large_magnitude; /**< Control of the large controller motor. */
-    Uint16 small_magnitude; /**< Control of the small controller motor. */
-} SDL_HapticLeftRight;
-
-/**
- *  \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
- *
- *  A custom force feedback effect is much like a periodic effect, where the
- *  application can define its exact shape.  You will have to allocate the
- *  data yourself.  Data should consist of channels * samples Uint16 samples.
- *
- *  If channels is one, the effect is rotated using the defined direction.
- *  Otherwise it uses the samples in data for the different axes.
- *
- *  \sa SDL_HAPTIC_CUSTOM
- *  \sa SDL_HapticEffect
- */
-typedef struct SDL_HapticCustom
-{
-    /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_CUSTOM */
-    SDL_HapticDirection direction;  /**< Direction of the effect. */
-
-    /* Replay */
-    Uint32 length;          /**< Duration of the effect. */
-    Uint16 delay;           /**< Delay before starting the effect. */
-
-    /* Trigger */
-    Uint16 button;          /**< Button that triggers the effect. */
-    Uint16 interval;        /**< How soon it can be triggered again after button. */
-
-    /* Custom */
-    Uint8 channels;         /**< Axes to use, minimum of one. */
-    Uint16 period;          /**< Sample periods. */
-    Uint16 samples;         /**< Amount of samples. */
-    Uint16 *data;           /**< Should contain channels*samples items. */
-
-    /* Envelope */
-    Uint16 attack_length;   /**< Duration of the attack. */
-    Uint16 attack_level;    /**< Level at the start of the attack. */
-    Uint16 fade_length;     /**< Duration of the fade. */
-    Uint16 fade_level;      /**< Level at the end of the fade. */
-} SDL_HapticCustom;
-
-/**
- *  \brief The generic template for any haptic effect.
- *
- *  All values max at 32767 (0x7FFF).  Signed values also can be negative.
- *  Time values unless specified otherwise are in milliseconds.
- *
- *  You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767
- *  value.  Neither delay, interval, attack_length nor fade_length support
- *  ::SDL_HAPTIC_INFINITY.  Fade will also not be used since effect never ends.
- *
- *  Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of
- *  ::SDL_HAPTIC_INFINITY.
- *
- *  Button triggers may not be supported on all devices, it is advised to not
- *  use them if possible.  Buttons start at index 1 instead of index 0 like
- *  the joystick.
- *
- *  If both attack_length and fade_level are 0, the envelope is not used,
- *  otherwise both values are used.
- *
- *  Common parts:
- *  \code
- *  // Replay - All effects have this
- *  Uint32 length;        // Duration of effect (ms).
- *  Uint16 delay;         // Delay before starting effect.
- *
- *  // Trigger - All effects have this
- *  Uint16 button;        // Button that triggers effect.
- *  Uint16 interval;      // How soon before effect can be triggered again.
- *
- *  // Envelope - All effects except condition effects have this
- *  Uint16 attack_length; // Duration of the attack (ms).
- *  Uint16 attack_level;  // Level at the start of the attack.
- *  Uint16 fade_length;   // Duration of the fade out (ms).
- *  Uint16 fade_level;    // Level at the end of the fade.
- *  \endcode
- *
- *
- *  Here we have an example of a constant effect evolution in time:
- *  \verbatim
-    Strength
-    ^
-    |
-    |    effect level -->  _________________
-    |                     /                 \
-    |                    /                   \
-    |                   /                     \
-    |                  /                       \
-    | attack_level --> |                        \
-    |                  |                        |  <---  fade_level
-    |
-    +--------------------------------------------------> Time
-                       [--]                 [---]
-                       attack_length        fade_length
-
-    [------------------][-----------------------]
-    delay               length
-    \endverbatim
- *
- *  Note either the attack_level or the fade_level may be above the actual
- *  effect level.
- *
- *  \sa SDL_HapticConstant
- *  \sa SDL_HapticPeriodic
- *  \sa SDL_HapticCondition
- *  \sa SDL_HapticRamp
- *  \sa SDL_HapticLeftRight
- *  \sa SDL_HapticCustom
- */
-typedef union SDL_HapticEffect
-{
-    /* Common for all force feedback effects */
-    Uint16 type;                    /**< Effect type. */
-    SDL_HapticConstant constant;    /**< Constant effect. */
-    SDL_HapticPeriodic periodic;    /**< Periodic effect. */
-    SDL_HapticCondition condition;  /**< Condition effect. */
-    SDL_HapticRamp ramp;            /**< Ramp effect. */
-    SDL_HapticLeftRight leftright;  /**< Left/Right effect. */
-    SDL_HapticCustom custom;        /**< Custom effect. */
-} SDL_HapticEffect;
-
-
-/* Function prototypes */
-/**
- *  \brief Count the number of haptic devices attached to the system.
- *
- *  \return Number of haptic devices detected on the system.
- */
-extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
-
-/**
- *  \brief Get the implementation dependent name of a Haptic device.
- *
- *  This can be called before any joysticks are opened.
- *  If no name can be found, this function returns NULL.
- *
- *  \param device_index Index of the device to get its name.
- *  \return Name of the device or NULL on error.
- *
- *  \sa SDL_NumHaptics
- */
-extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
-
-/**
- *  \brief Opens a Haptic device for usage.
- *
- *  The index passed as an argument refers to the N'th Haptic device on this
- *  system.
- *
- *  When opening a haptic device, its gain will be set to maximum and
- *  autocenter will be disabled.  To modify these values use
- *  SDL_HapticSetGain() and SDL_HapticSetAutocenter().
- *
- *  \param device_index Index of the device to open.
- *  \return Device identifier or NULL on error.
- *
- *  \sa SDL_HapticIndex
- *  \sa SDL_HapticOpenFromMouse
- *  \sa SDL_HapticOpenFromJoystick
- *  \sa SDL_HapticClose
- *  \sa SDL_HapticSetGain
- *  \sa SDL_HapticSetAutocenter
- *  \sa SDL_HapticPause
- *  \sa SDL_HapticStopAll
- */
-extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index);
-
-/**
- *  \brief Checks if the haptic device at index has been opened.
- *
- *  \param device_index Index to check to see if it has been opened.
- *  \return 1 if it has been opened or 0 if it hasn't.
- *
- *  \sa SDL_HapticOpen
- *  \sa SDL_HapticIndex
- */
-extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index);
-
-/**
- *  \brief Gets the index of a haptic device.
- *
- *  \param haptic Haptic device to get the index of.
- *  \return The index of the haptic device or -1 on error.
- *
- *  \sa SDL_HapticOpen
- *  \sa SDL_HapticOpened
- */
-extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic);
-
-/**
- *  \brief Gets whether or not the current mouse has haptic capabilities.
- *
- *  \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
- *
- *  \sa SDL_HapticOpenFromMouse
- */
-extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void);
-
-/**
- *  \brief Tries to open a haptic device from the current mouse.
- *
- *  \return The haptic device identifier or NULL on error.
- *
- *  \sa SDL_MouseIsHaptic
- *  \sa SDL_HapticOpen
- */
-extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void);
-
-/**
- *  \brief Checks to see if a joystick has haptic features.
- *
- *  \param joystick Joystick to test for haptic capabilities.
- *  \return 1 if the joystick is haptic, 0 if it isn't
- *          or -1 if an error ocurred.
- *
- *  \sa SDL_HapticOpenFromJoystick
- */
-extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick);
-
-/**
- *  \brief Opens a Haptic device for usage from a Joystick device.
- *
- *  You must still close the haptic device seperately.  It will not be closed
- *  with the joystick.
- *
- *  When opening from a joystick you should first close the haptic device before
- *  closing the joystick device.  If not, on some implementations the haptic
- *  device will also get unallocated and you'll be unable to use force feedback
- *  on that device.
- *
- *  \param joystick Joystick to create a haptic device from.
- *  \return A valid haptic device identifier on success or NULL on error.
- *
- *  \sa SDL_HapticOpen
- *  \sa SDL_HapticClose
- */
-extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick *
-                                                               joystick);
-
-/**
- *  \brief Closes a Haptic device previously opened with SDL_HapticOpen().
- *
- *  \param haptic Haptic device to close.
- */
-extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic);
-
-/**
- *  \brief Returns the number of effects a haptic device can store.
- *
- *  On some platforms this isn't fully supported, and therefore is an
- *  approximation.  Always check to see if your created effect was actually
- *  created and do not rely solely on SDL_HapticNumEffects().
- *
- *  \param haptic The haptic device to query effect max.
- *  \return The number of effects the haptic device can store or
- *          -1 on error.
- *
- *  \sa SDL_HapticNumEffectsPlaying
- *  \sa SDL_HapticQuery
- */
-extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic);
-
-/**
- *  \brief Returns the number of effects a haptic device can play at the same
- *         time.
- *
- *  This is not supported on all platforms, but will always return a value.
- *  Added here for the sake of completeness.
- *
- *  \param haptic The haptic device to query maximum playing effects.
- *  \return The number of effects the haptic device can play at the same time
- *          or -1 on error.
- *
- *  \sa SDL_HapticNumEffects
- *  \sa SDL_HapticQuery
- */
-extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
-
-/**
- *  \brief Gets the haptic devices supported features in bitwise matter.
- *
- *  Example:
- *  \code
- *  if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) {
- *      printf("We have constant haptic effect!");
- *  }
- *  \endcode
- *
- *  \param haptic The haptic device to query.
- *  \return Haptic features in bitwise manner (OR'd).
- *
- *  \sa SDL_HapticNumEffects
- *  \sa SDL_HapticEffectSupported
- */
-extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);
-
-
-/**
- *  \brief Gets the number of haptic axes the device has.
- *
- *  \sa SDL_HapticDirection
- */
-extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic);
-
-/**
- *  \brief Checks to see if effect is supported by haptic.
- *
- *  \param haptic Haptic device to check on.
- *  \param effect Effect to check to see if it is supported.
- *  \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
- *
- *  \sa SDL_HapticQuery
- *  \sa SDL_HapticNewEffect
- */
-extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic,
-                                                      SDL_HapticEffect *
-                                                      effect);
-
-/**
- *  \brief Creates a new haptic effect on the device.
- *
- *  \param haptic Haptic device to create the effect on.
- *  \param effect Properties of the effect to create.
- *  \return The id of the effect on success or -1 on error.
- *
- *  \sa SDL_HapticUpdateEffect
- *  \sa SDL_HapticRunEffect
- *  \sa SDL_HapticDestroyEffect
- */
-extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
-                                                SDL_HapticEffect * effect);
-
-/**
- *  \brief Updates the properties of an effect.
- *
- *  Can be used dynamically, although behaviour when dynamically changing
- *  direction may be strange.  Specifically the effect may reupload itself
- *  and start playing from the start.  You cannot change the type either when
- *  running SDL_HapticUpdateEffect().
- *
- *  \param haptic Haptic device that has the effect.
- *  \param effect Effect to update.
- *  \param data New effect properties to use.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticNewEffect
- *  \sa SDL_HapticRunEffect
- *  \sa SDL_HapticDestroyEffect
- */
-extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
-                                                   int effect,
-                                                   SDL_HapticEffect * data);
-
-/**
- *  \brief Runs the haptic effect on its associated haptic device.
- *
- *  If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
- *  repeating the envelope (attack and fade) every time.  If you only want the
- *  effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
- *  parameter.
- *
- *  \param haptic Haptic device to run the effect on.
- *  \param effect Identifier of the haptic effect to run.
- *  \param iterations Number of iterations to run the effect. Use
- *         ::SDL_HAPTIC_INFINITY for infinity.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticStopEffect
- *  \sa SDL_HapticDestroyEffect
- *  \sa SDL_HapticGetEffectStatus
- */
-extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
-                                                int effect,
-                                                Uint32 iterations);
-
-/**
- *  \brief Stops the haptic effect on its associated haptic device.
- *
- *  \param haptic Haptic device to stop the effect on.
- *  \param effect Identifier of the effect to stop.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticRunEffect
- *  \sa SDL_HapticDestroyEffect
- */
-extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic,
-                                                 int effect);
-
-/**
- *  \brief Destroys a haptic effect on the device.
- *
- *  This will stop the effect if it's running.  Effects are automatically
- *  destroyed when the device is closed.
- *
- *  \param haptic Device to destroy the effect on.
- *  \param effect Identifier of the effect to destroy.
- *
- *  \sa SDL_HapticNewEffect
- */
-extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic,
-                                                     int effect);
-
-/**
- *  \brief Gets the status of the current effect on the haptic device.
- *
- *  Device must support the ::SDL_HAPTIC_STATUS feature.
- *
- *  \param haptic Haptic device to query the effect status on.
- *  \param effect Identifier of the effect to query its status.
- *  \return 0 if it isn't playing, 1 if it is playing or -1 on error.
- *
- *  \sa SDL_HapticRunEffect
- *  \sa SDL_HapticStopEffect
- */
-extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic,
-                                                      int effect);
-
-/**
- *  \brief Sets the global gain of the device.
- *
- *  Device must support the ::SDL_HAPTIC_GAIN feature.
- *
- *  The user may specify the maximum gain by setting the environment variable
- *  SDL_HAPTIC_GAIN_MAX which should be between 0 and 100.  All calls to
- *  SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the
- *  maximum.
- *
- *  \param haptic Haptic device to set the gain on.
- *  \param gain Value to set the gain to, should be between 0 and 100.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticQuery
- */
-extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain);
-
-/**
- *  \brief Sets the global autocenter of the device.
- *
- *  Autocenter should be between 0 and 100.  Setting it to 0 will disable
- *  autocentering.
- *
- *  Device must support the ::SDL_HAPTIC_AUTOCENTER feature.
- *
- *  \param haptic Haptic device to set autocentering on.
- *  \param autocenter Value to set autocenter to, 0 disables autocentering.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticQuery
- */
-extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic,
-                                                    int autocenter);
-
-/**
- *  \brief Pauses a haptic device.
- *
- *  Device must support the ::SDL_HAPTIC_PAUSE feature.  Call
- *  SDL_HapticUnpause() to resume playback.
- *
- *  Do not modify the effects nor add new ones while the device is paused.
- *  That can cause all sorts of weird errors.
- *
- *  \param haptic Haptic device to pause.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticUnpause
- */
-extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic);
-
-/**
- *  \brief Unpauses a haptic device.
- *
- *  Call to unpause after SDL_HapticPause().
- *
- *  \param haptic Haptic device to pause.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticPause
- */
-extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic);
-
-/**
- *  \brief Stops all the currently playing effects on a haptic device.
- *
- *  \param haptic Haptic device to stop.
- *  \return 0 on success or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic);
-
-/**
- *  \brief Checks to see if rumble is supported on a haptic device.
- *
- *  \param haptic Haptic device to check to see if it supports rumble.
- *  \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
- *
- *  \sa SDL_HapticRumbleInit
- *  \sa SDL_HapticRumblePlay
- *  \sa SDL_HapticRumbleStop
- */
-extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
-
-/**
- *  \brief Initializes the haptic device for simple rumble playback.
- *
- *  \param haptic Haptic device to initialize for simple rumble playback.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticOpen
- *  \sa SDL_HapticRumbleSupported
- *  \sa SDL_HapticRumblePlay
- *  \sa SDL_HapticRumbleStop
- */
-extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
-
-/**
- *  \brief Runs simple rumble on a haptic device
- *
- *  \param haptic Haptic device to play rumble effect on.
- *  \param strength Strength of the rumble to play as a 0-1 float value.
- *  \param length Length of the rumble to play in milliseconds.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticRumbleSupported
- *  \sa SDL_HapticRumbleInit
- *  \sa SDL_HapticRumbleStop
- */
-extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length );
-
-/**
- *  \brief Stops the simple rumble on a haptic device.
- *
- *  \param haptic Haptic to stop the rumble on.
- *  \return 0 on success or -1 on error.
- *
- *  \sa SDL_HapticRumbleSupported
- *  \sa SDL_HapticRumbleInit
- *  \sa SDL_HapticRumblePlay
- */
-extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_haptic_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_hints.h b/deps/SDL2/include/SDL_hints.h
deleted file mode 100644
index dac928e..0000000
--- a/deps/SDL2/include/SDL_hints.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_hints.h
- *
- *  Official documentation for SDL configuration variables
- *
- *  This file contains functions to set and get configuration hints,
- *  as well as listing each of them alphabetically.
- *
- *  The convention for naming hints is SDL_HINT_X, where "SDL_X" is
- *  the environment variable that can be used to override the default.
- *
- *  In general these hints are just that - they may or may not be
- *  supported or applicable on any given platform, but they provide
- *  a way for an application or user to give the library a hint as
- *  to how they would like the library to work.
- */
-
-#ifndef _SDL_hints_h
-#define _SDL_hints_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief  A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.
- *
- *  SDL can try to accelerate the SDL screen surface by using streaming
- *  textures with a 3D rendering engine.  This variable controls whether and
- *  how this is done.
- *
- *  This variable can be set to the following values:
- *    "0"       - Disable 3D acceleration
- *    "1"       - Enable 3D acceleration, using the default renderer.
- *    "X"       - Enable 3D acceleration, using X where X is one of the valid rendering drivers.  (e.g. "direct3d", "opengl", etc.)
- *
- *  By default SDL tries to make a best guess for each platform whether
- *  to use acceleration or not.
- */
-#define SDL_HINT_FRAMEBUFFER_ACCELERATION   "SDL_FRAMEBUFFER_ACCELERATION"
-
-/**
- *  \brief  A variable specifying which render driver to use.
- *
- *  If the application doesn't pick a specific renderer to use, this variable
- *  specifies the name of the preferred renderer.  If the preferred renderer
- *  can't be initialized, the normal default renderer is used.
- *
- *  This variable is case insensitive and can be set to the following values:
- *    "direct3d"
- *    "opengl"
- *    "opengles2"
- *    "opengles"
- *    "software"
- *
- *  The default varies by platform, but it's the first one in the list that
- *  is available on the current platform.
- */
-#define SDL_HINT_RENDER_DRIVER              "SDL_RENDER_DRIVER"
-
-/**
- *  \brief  A variable controlling whether the OpenGL render driver uses shaders if they are available.
- *
- *  This variable can be set to the following values:
- *    "0"       - Disable shaders
- *    "1"       - Enable shaders
- *
- *  By default shaders are used if OpenGL supports them.
- */
-#define SDL_HINT_RENDER_OPENGL_SHADERS      "SDL_RENDER_OPENGL_SHADERS"
-
-/**
- *  \brief  A variable controlling whether the Direct3D device is initialized for thread-safe operations.
- *
- *  This variable can be set to the following values:
- *    "0"       - Thread-safety is not enabled (faster)
- *    "1"       - Thread-safety is enabled
- *
- *  By default the Direct3D device is created with thread-safety disabled.
- */
-#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE"
-
-/**
- *  \brief  A variable controlling the scaling quality
- *
- *  This variable can be set to the following values:
- *    "0" or "nearest" - Nearest pixel sampling
- *    "1" or "linear"  - Linear filtering (supported by OpenGL and Direct3D)
- *    "2" or "best"    - Currently this is the same as "linear"
- *
- *  By default nearest pixel sampling is used
- */
-#define SDL_HINT_RENDER_SCALE_QUALITY       "SDL_RENDER_SCALE_QUALITY"
-
-/**
- *  \brief  A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing.
- *
- *  This variable can be set to the following values:
- *    "0"       - Disable vsync
- *    "1"       - Enable vsync
- *
- *  By default SDL does not sync screen surface updates with vertical refresh.
- */
-#define SDL_HINT_RENDER_VSYNC               "SDL_RENDER_VSYNC"
-
-/**
- *  \brief  A variable controlling whether the X11 VidMode extension should be used.
- *
- *  This variable can be set to the following values:
- *    "0"       - Disable XVidMode
- *    "1"       - Enable XVidMode
- *
- *  By default SDL will use XVidMode if it is available.
- */
-#define SDL_HINT_VIDEO_X11_XVIDMODE         "SDL_VIDEO_X11_XVIDMODE"
-
-/**
- *  \brief  A variable controlling whether the X11 Xinerama extension should be used.
- *
- *  This variable can be set to the following values:
- *    "0"       - Disable Xinerama
- *    "1"       - Enable Xinerama
- *
- *  By default SDL will use Xinerama if it is available.
- */
-#define SDL_HINT_VIDEO_X11_XINERAMA         "SDL_VIDEO_X11_XINERAMA"
-
-/**
- *  \brief  A variable controlling whether the X11 XRandR extension should be used.
- *
- *  This variable can be set to the following values:
- *    "0"       - Disable XRandR
- *    "1"       - Enable XRandR
- *
- *  By default SDL will not use XRandR because of window manager issues.
- */
-#define SDL_HINT_VIDEO_X11_XRANDR           "SDL_VIDEO_X11_XRANDR"
-
-/**
- *  \brief  A variable controlling whether grabbing input grabs the keyboard
- *
- *  This variable can be set to the following values:
- *    "0"       - Grab will affect only the mouse
- *    "1"       - Grab will affect mouse and keyboard
- *
- *  By default SDL will not grab the keyboard so system shortcuts still work.
- */
-#define SDL_HINT_GRAB_KEYBOARD              "SDL_GRAB_KEYBOARD"
-
-/**
- *  \brief Minimize your SDL_Window if it loses key focus when in Fullscreen mode. Defaults to true.
- *
- */
-#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS   "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
-
-
-/**
- *  \brief  A variable controlling whether the idle timer is disabled on iOS.
- *
- *  When an iOS app does not receive touches for some time, the screen is
- *  dimmed automatically. For games where the accelerometer is the only input
- *  this is problematic. This functionality can be disabled by setting this
- *  hint.
- *
- *  This variable can be set to the following values:
- *    "0"       - Enable idle timer
- *    "1"       - Disable idle timer
- */
-#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED"
-
-/**
- *  \brief  A variable controlling which orientations are allowed on iOS.
- *
- *  In some circumstances it is necessary to be able to explicitly control
- *  which UI orientations are allowed.
- *
- *  This variable is a space delimited list of the following values:
- *    "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
- */
-#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
-
-
-/**
- *  \brief  A variable that lets you disable the detection and use of Xinput gamepad devices
- *
- *  The variable can be set to the following values:
- *    "0"       - Disable XInput timer (only uses direct input)
- *    "1"       - Enable XInput timer (the default)
- */
-#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED"
-
-
-/**
- *  \brief  A variable that lets you manually hint extra gamecontroller db entries
- *
- *  The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
- *
- *  This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
- *  You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
- */
-#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
-
-
-/**
- *  \brief  A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
- *
- *  The variable can be set to the following values:
- *    "0"       - Disable joystick & gamecontroller input events when the
- *                application is in the background.
- *    "1"       - Enable joystick & gamecontroller input events when the
- *                application is in the backgroumd.
- *
- *  The default value is "0".  This hint may be set at any time.
- */
-#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
-
-
-/**
- *  \brief If set to 0 then never set the top most bit on a SDL Window, even if the video mode expects it.
- *      This is a debugging aid for developers and not expected to be used by end users. The default is "1"
- *
- *  This variable can be set to the following values:
- *    "0"       - don't allow topmost
- *    "1"       - allow topmost
- */
-#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST"
-
-
-/**
- *  \brief A variable that controls the timer resolution, in milliseconds.
- *
- *  The higher resolution the timer, the more frequently the CPU services
- *  timer interrupts, and the more precise delays are, but this takes up
- *  power and CPU time.  This hint is only used on Windows 7 and earlier.
- *
- *  See this blog post for more information:
- *  http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/
- *
- *  If this variable is set to "0", the system timer resolution is not set.
- *
- *  The default value is "1". This hint may be set at any time.
- */
-#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION"
-
-
-/**
- *  \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac)
- */
-#define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED"
-
-
-/**
- *  \brief  An enumeration of hint priorities
- */
-typedef enum
-{
-    SDL_HINT_DEFAULT,
-    SDL_HINT_NORMAL,
-    SDL_HINT_OVERRIDE
-} SDL_HintPriority;
-
-
-/**
- *  \brief Set a hint with a specific priority
- *
- *  The priority controls the behavior when setting a hint that already
- *  has a value.  Hints will replace existing hints of their priority and
- *  lower.  Environment variables are considered to have override priority.
- *
- *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
-                                                         const char *value,
-                                                         SDL_HintPriority priority);
-
-/**
- *  \brief Set a hint with normal priority
- *
- *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
-                                             const char *value);
-
-/**
- *  \brief Get a hint
- *
- *  \return The string value of a hint variable.
- */
-extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
-
-/**
- *  \brief Add a function to watch a particular hint
- *
- *  \param name The hint to watch
- *  \param callback The function to call when the hint value changes
- *  \param userdata A pointer to pass to the callback function
- */
-typedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue);
-extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name,
-                                                 SDL_HintCallback callback,
-                                                 void *userdata);
-
-/**
- *  \brief Remove a function watching a particular hint
- *
- *  \param name The hint being watched
- *  \param callback The function being called when the hint value changes
- *  \param userdata A pointer being passed to the callback function
- */
-extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
-                                                 SDL_HintCallback callback,
-                                                 void *userdata);
-
-/**
- *  \brief  Clear all hints
- *
- *  This function is called during SDL_Quit() to free stored hints.
- */
-extern DECLSPEC void SDLCALL SDL_ClearHints(void);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_hints_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_joystick.h b/deps/SDL2/include/SDL_joystick.h
deleted file mode 100644
index b0e4b5d..0000000
--- a/deps/SDL2/include/SDL_joystick.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_joystick.h
- *
- *  Include file for SDL joystick event handling
- *
- * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks, with the exact joystick
- *   behind a device_index changing as joysticks are plugged and unplugged.
- *
- * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
- *   then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
- *
- * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
- *   the device (a X360 wired controller for example). This identifier is platform dependent.
- *
- *
- */
-
-#ifndef _SDL_joystick_h
-#define _SDL_joystick_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \file SDL_joystick.h
- *
- *  In order to use these functions, SDL_Init() must have been called
- *  with the ::SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
- *  for joysticks, and load appropriate drivers.
- *
- *  If you would like to receive joystick updates while the application
- *  is in the background, you should set the following hint before calling
- *  SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
- */
-
-/* The joystick structure used to identify an SDL joystick */
-struct _SDL_Joystick;
-typedef struct _SDL_Joystick SDL_Joystick;
-
-/* A structure that encodes the stable unique id for a joystick device */
-typedef struct {
-    Uint8 data[16];
-} SDL_JoystickGUID;
-
-typedef Sint32 SDL_JoystickID;
-
-
-/* Function prototypes */
-/**
- *  Count the number of joysticks attached to the system right now
- */
-extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
-
-/**
- *  Get the implementation dependent name of a joystick.
- *  This can be called before any joysticks are opened.
- *  If no name can be found, this function returns NULL.
- */
-extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
-
-/**
- *  Open a joystick for use.
- *  The index passed as an argument refers tothe N'th joystick on the system.
- *  This index is the value which will identify this joystick in future joystick
- *  events.
- *
- *  \return A joystick identifier, or NULL if an error occurred.
- */
-extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
-
-/**
- *  Return the name for this currently opened joystick.
- *  If no name can be found, this function returns NULL.
- */
-extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
-
-/**
- *  Return the GUID for the joystick at this index
- */
-extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
-
-/**
- *  Return the GUID for this opened joystick
- */
-extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick);
-
-/**
- *  Return a string representation for this guid. pszGUID must point to at least 33 bytes
- *  (32 for the string plus a NULL terminator).
- */
-extern DECLSPEC void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
-
-/**
- *  convert a string into a joystick formatted guid
- */
-extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
-
-/**
- *  Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick);
-
-/**
- *  Get the instance ID of an opened joystick or -1 if the joystick is invalid.
- */
-extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick);
-
-/**
- *  Get the number of general axis controls on a joystick.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick);
-
-/**
- *  Get the number of trackballs on a joystick.
- *
- *  Joystick trackballs have only relative motion events associated
- *  with them and their state cannot be polled.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick);
-
-/**
- *  Get the number of POV hats on a joystick.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick);
-
-/**
- *  Get the number of buttons on a joystick.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick);
-
-/**
- *  Update the current state of the open joysticks.
- *
- *  This is called automatically by the event loop if any joystick
- *  events are enabled.
- */
-extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
-
-/**
- *  Enable/disable joystick event polling.
- *
- *  If joystick events are disabled, you must call SDL_JoystickUpdate()
- *  yourself and check the state of the joystick when you want joystick
- *  information.
- *
- *  The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
-
-/**
- *  Get the current state of an axis control on a joystick.
- *
- *  The state is a value ranging from -32768 to 32767.
- *
- *  The axis indices start at index 0.
- */
-extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
-                                                   int axis);
-
-/**
- *  \name Hat positions
- */
-/* @{ */
-#define SDL_HAT_CENTERED    0x00
-#define SDL_HAT_UP      0x01
-#define SDL_HAT_RIGHT       0x02
-#define SDL_HAT_DOWN        0x04
-#define SDL_HAT_LEFT        0x08
-#define SDL_HAT_RIGHTUP     (SDL_HAT_RIGHT|SDL_HAT_UP)
-#define SDL_HAT_RIGHTDOWN   (SDL_HAT_RIGHT|SDL_HAT_DOWN)
-#define SDL_HAT_LEFTUP      (SDL_HAT_LEFT|SDL_HAT_UP)
-#define SDL_HAT_LEFTDOWN    (SDL_HAT_LEFT|SDL_HAT_DOWN)
-/* @} */
-
-/**
- *  Get the current state of a POV hat on a joystick.
- *
- *  The hat indices start at index 0.
- *
- *  \return The return value is one of the following positions:
- *           - ::SDL_HAT_CENTERED
- *           - ::SDL_HAT_UP
- *           - ::SDL_HAT_RIGHT
- *           - ::SDL_HAT_DOWN
- *           - ::SDL_HAT_LEFT
- *           - ::SDL_HAT_RIGHTUP
- *           - ::SDL_HAT_RIGHTDOWN
- *           - ::SDL_HAT_LEFTUP
- *           - ::SDL_HAT_LEFTDOWN
- */
-extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick,
-                                                 int hat);
-
-/**
- *  Get the ball axis change since the last poll.
- *
- *  \return 0, or -1 if you passed it invalid parameters.
- *
- *  The ball indices start at index 0.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick,
-                                                int ball, int *dx, int *dy);
-
-/**
- *  Get the current state of a button on a joystick.
- *
- *  The button indices start at index 0.
- */
-extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick,
-                                                    int button);
-
-/**
- *  Close a joystick previously opened with SDL_JoystickOpen().
- */
-extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_joystick_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_keyboard.h b/deps/SDL2/include/SDL_keyboard.h
deleted file mode 100644
index e10f9fd..0000000
--- a/deps/SDL2/include/SDL_keyboard.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_keyboard.h
- *
- *  Include file for SDL keyboard event handling
- */
-
-#ifndef _SDL_keyboard_h
-#define _SDL_keyboard_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_keycode.h"
-#include "SDL_video.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief The SDL keysym structure, used in key events.
- *
- *  \note  If you are looking for translated character input, see the ::SDL_TEXTINPUT event.
- */
-typedef struct SDL_Keysym
-{
-    SDL_Scancode scancode;      /**< SDL physical key code - see ::SDL_Scancode for details */
-    SDL_Keycode sym;            /**< SDL virtual key code - see ::SDL_Keycode for details */
-    Uint16 mod;                 /**< current key modifiers */
-    Uint32 unused;
-} SDL_Keysym;
-
-/* Function prototypes */
-
-/**
- *  \brief Get the window which currently has keyboard focus.
- */
-extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
-
-/**
- *  \brief Get a snapshot of the current state of the keyboard.
- *
- *  \param numkeys if non-NULL, receives the length of the returned array.
- *
- *  \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
- *
- *  \b Example:
- *  \code
- *  const Uint8 *state = SDL_GetKeyboardState(NULL);
- *  if ( state[SDL_SCANCODE_RETURN] )   {
- *      printf("<RETURN> is pressed.\n");
- *  }
- *  \endcode
- */
-extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
-
-/**
- *  \brief Get the current key modifier state for the keyboard.
- */
-extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
-
-/**
- *  \brief Set the current key modifier state for the keyboard.
- *
- *  \note This does not change the keyboard state, only the key modifier flags.
- */
-extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
-
-/**
- *  \brief Get the key code corresponding to the given scancode according
- *         to the current keyboard layout.
- *
- *  See ::SDL_Keycode for details.
- *
- *  \sa SDL_GetKeyName()
- */
-extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
-
-/**
- *  \brief Get the scancode corresponding to the given key code according to the
- *         current keyboard layout.
- *
- *  See ::SDL_Scancode for details.
- *
- *  \sa SDL_GetScancodeName()
- */
-extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
-
-/**
- *  \brief Get a human-readable name for a scancode.
- *
- *  \return A pointer to the name for the scancode.
- *          If the scancode doesn't have a name, this function returns
- *          an empty string ("").
- *
- *  \sa SDL_Scancode
- */
-extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
-
-/**
- *  \brief Get a scancode from a human-readable name
- *
- *  \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
- *
- *  \sa SDL_Scancode
- */
-extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
-
-/**
- *  \brief Get a human-readable name for a key.
- *
- *  \return A pointer to a UTF-8 string that stays valid at least until the next
- *          call to this function. If you need it around any longer, you must
- *          copy it.  If the key doesn't have a name, this function returns an
- *          empty string ("").
- *
- *  \sa SDL_Key
- */
-extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
-
-/**
- *  \brief Get a key code from a human-readable name
- *
- *  \return key code, or SDLK_UNKNOWN if the name wasn't recognized
- *
- *  \sa SDL_Keycode
- */
-extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
-
-/**
- *  \brief Start accepting Unicode text input events.
- *         This function will show the on-screen keyboard if supported.
- *
- *  \sa SDL_StopTextInput()
- *  \sa SDL_SetTextInputRect()
- *  \sa SDL_HasScreenKeyboardSupport()
- */
-extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
-
-/**
- *  \brief Return whether or not Unicode text input events are enabled.
- *
- *  \sa SDL_StartTextInput()
- *  \sa SDL_StopTextInput()
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
-
-/**
- *  \brief Stop receiving any text input events.
- *         This function will hide the on-screen keyboard if supported.
- *
- *  \sa SDL_StartTextInput()
- *  \sa SDL_HasScreenKeyboardSupport()
- */
-extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
-
-/**
- *  \brief Set the rectangle used to type Unicode text inputs.
- *         This is used as a hint for IME and on-screen keyboard placement.
- *
- *  \sa SDL_StartTextInput()
- */
-extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
-
-/**
- *  \brief Returns whether the platform has some screen keyboard support.
- *
- *  \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
- *
- *  \note Not all screen keyboard functions are supported on all platforms.
- *
- *  \sa SDL_IsScreenKeyboardShown()
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
-
-/**
- *  \brief Returns whether the screen keyboard is shown for given window.
- *
- *  \param window The window for which screen keyboard should be queried.
- *
- *  \return SDL_TRUE if screen keyboard is shown else SDL_FALSE.
- *
- *  \sa SDL_HasScreenKeyboardSupport()
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_keyboard_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_keycode.h b/deps/SDL2/include/SDL_keycode.h
deleted file mode 100644
index de584e1..0000000
--- a/deps/SDL2/include/SDL_keycode.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_keycode.h
- *
- *  Defines constants which identify keyboard keys and modifiers.
- */
-
-#ifndef _SDL_keycode_h
-#define _SDL_keycode_h
-
-#include "SDL_stdinc.h"
-#include "SDL_scancode.h"
-
-/**
- *  \brief The SDL virtual key representation.
- *
- *  Values of this type are used to represent keyboard keys using the current
- *  layout of the keyboard.  These values include Unicode values representing
- *  the unmodified character that would be generated by pressing the key, or
- *  an SDLK_* constant for those keys that do not generate characters.
- */
-typedef Sint32 SDL_Keycode;
-
-#define SDLK_SCANCODE_MASK (1<<30)
-#define SDL_SCANCODE_TO_KEYCODE(X)  (X | SDLK_SCANCODE_MASK)
-
-enum
-{
-    SDLK_UNKNOWN = 0,
-
-    SDLK_RETURN = '\r',
-    SDLK_ESCAPE = '\033',
-    SDLK_BACKSPACE = '\b',
-    SDLK_TAB = '\t',
-    SDLK_SPACE = ' ',
-    SDLK_EXCLAIM = '!',
-    SDLK_QUOTEDBL = '"',
-    SDLK_HASH = '#',
-    SDLK_PERCENT = '%',
-    SDLK_DOLLAR = '$',
-    SDLK_AMPERSAND = '&',
-    SDLK_QUOTE = '\'',
-    SDLK_LEFTPAREN = '(',
-    SDLK_RIGHTPAREN = ')',
-    SDLK_ASTERISK = '*',
-    SDLK_PLUS = '+',
-    SDLK_COMMA = ',',
-    SDLK_MINUS = '-',
-    SDLK_PERIOD = '.',
-    SDLK_SLASH = '/',
-    SDLK_0 = '0',
-    SDLK_1 = '1',
-    SDLK_2 = '2',
-    SDLK_3 = '3',
-    SDLK_4 = '4',
-    SDLK_5 = '5',
-    SDLK_6 = '6',
-    SDLK_7 = '7',
-    SDLK_8 = '8',
-    SDLK_9 = '9',
-    SDLK_COLON = ':',
-    SDLK_SEMICOLON = ';',
-    SDLK_LESS = '<',
-    SDLK_EQUALS = '=',
-    SDLK_GREATER = '>',
-    SDLK_QUESTION = '?',
-    SDLK_AT = '@',
-    /*
-       Skip uppercase letters
-     */
-    SDLK_LEFTBRACKET = '[',
-    SDLK_BACKSLASH = '\\',
-    SDLK_RIGHTBRACKET = ']',
-    SDLK_CARET = '^',
-    SDLK_UNDERSCORE = '_',
-    SDLK_BACKQUOTE = '`',
-    SDLK_a = 'a',
-    SDLK_b = 'b',
-    SDLK_c = 'c',
-    SDLK_d = 'd',
-    SDLK_e = 'e',
-    SDLK_f = 'f',
-    SDLK_g = 'g',
-    SDLK_h = 'h',
-    SDLK_i = 'i',
-    SDLK_j = 'j',
-    SDLK_k = 'k',
-    SDLK_l = 'l',
-    SDLK_m = 'm',
-    SDLK_n = 'n',
-    SDLK_o = 'o',
-    SDLK_p = 'p',
-    SDLK_q = 'q',
-    SDLK_r = 'r',
-    SDLK_s = 's',
-    SDLK_t = 't',
-    SDLK_u = 'u',
-    SDLK_v = 'v',
-    SDLK_w = 'w',
-    SDLK_x = 'x',
-    SDLK_y = 'y',
-    SDLK_z = 'z',
-
-    SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK),
-
-    SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1),
-    SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2),
-    SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3),
-    SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4),
-    SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5),
-    SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6),
-    SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7),
-    SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8),
-    SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9),
-    SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10),
-    SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11),
-    SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12),
-
-    SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN),
-    SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK),
-    SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE),
-    SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
-    SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
-    SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
-    SDLK_DELETE = '\177',
-    SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
-    SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
-    SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
-    SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT),
-    SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN),
-    SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP),
-
-    SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR),
-    SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE),
-    SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY),
-    SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS),
-    SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS),
-    SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER),
-    SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1),
-    SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2),
-    SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3),
-    SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4),
-    SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5),
-    SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6),
-    SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7),
-    SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8),
-    SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9),
-    SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0),
-    SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD),
-
-    SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION),
-    SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER),
-    SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS),
-    SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13),
-    SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14),
-    SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15),
-    SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16),
-    SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17),
-    SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18),
-    SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19),
-    SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20),
-    SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21),
-    SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22),
-    SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23),
-    SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24),
-    SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE),
-    SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP),
-    SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU),
-    SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT),
-    SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP),
-    SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN),
-    SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO),
-    SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT),
-    SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY),
-    SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE),
-    SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND),
-    SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE),
-    SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP),
-    SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN),
-    SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA),
-    SDLK_KP_EQUALSAS400 =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400),
-
-    SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE),
-    SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ),
-    SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL),
-    SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR),
-    SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR),
-    SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2),
-    SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR),
-    SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT),
-    SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER),
-    SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN),
-    SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL),
-    SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL),
-
-    SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00),
-    SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000),
-    SDLK_THOUSANDSSEPARATOR =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR),
-    SDLK_DECIMALSEPARATOR =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR),
-    SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT),
-    SDLK_CURRENCYSUBUNIT =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT),
-    SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN),
-    SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN),
-    SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE),
-    SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE),
-    SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB),
-    SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE),
-    SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A),
-    SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B),
-    SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C),
-    SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D),
-    SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E),
-    SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F),
-    SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR),
-    SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER),
-    SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT),
-    SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS),
-    SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER),
-    SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND),
-    SDLK_KP_DBLAMPERSAND =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND),
-    SDLK_KP_VERTICALBAR =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR),
-    SDLK_KP_DBLVERTICALBAR =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR),
-    SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON),
-    SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH),
-    SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE),
-    SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT),
-    SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM),
-    SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE),
-    SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL),
-    SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR),
-    SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD),
-    SDLK_KP_MEMSUBTRACT =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT),
-    SDLK_KP_MEMMULTIPLY =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY),
-    SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE),
-    SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS),
-    SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR),
-    SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY),
-    SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY),
-    SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL),
-    SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL),
-    SDLK_KP_HEXADECIMAL =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL),
-
-    SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL),
-    SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT),
-    SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT),
-    SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI),
-    SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL),
-    SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT),
-    SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT),
-    SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI),
-
-    SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE),
-
-    SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT),
-    SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV),
-    SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP),
-    SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY),
-    SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE),
-    SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT),
-    SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW),
-    SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL),
-    SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR),
-    SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER),
-    SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH),
-    SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME),
-    SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK),
-    SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD),
-    SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP),
-    SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH),
-    SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS),
-
-    SDLK_BRIGHTNESSDOWN =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN),
-    SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP),
-    SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH),
-    SDLK_KBDILLUMTOGGLE =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE),
-    SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
-    SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
-    SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
-    SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP)
-};
-
-/**
- * \brief Enumeration of valid key mods (possibly OR'd together).
- */
-typedef enum
-{
-    KMOD_NONE = 0x0000,
-    KMOD_LSHIFT = 0x0001,
-    KMOD_RSHIFT = 0x0002,
-    KMOD_LCTRL = 0x0040,
-    KMOD_RCTRL = 0x0080,
-    KMOD_LALT = 0x0100,
-    KMOD_RALT = 0x0200,
-    KMOD_LGUI = 0x0400,
-    KMOD_RGUI = 0x0800,
-    KMOD_NUM = 0x1000,
-    KMOD_CAPS = 0x2000,
-    KMOD_MODE = 0x4000,
-    KMOD_RESERVED = 0x8000
-} SDL_Keymod;
-
-#define KMOD_CTRL   (KMOD_LCTRL|KMOD_RCTRL)
-#define KMOD_SHIFT  (KMOD_LSHIFT|KMOD_RSHIFT)
-#define KMOD_ALT    (KMOD_LALT|KMOD_RALT)
-#define KMOD_GUI    (KMOD_LGUI|KMOD_RGUI)
-
-#endif /* _SDL_keycode_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_loadso.h b/deps/SDL2/include/SDL_loadso.h
deleted file mode 100644
index 790d0a7..0000000
--- a/deps/SDL2/include/SDL_loadso.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_loadso.h
- *
- *  System dependent library loading routines
- *
- *  Some things to keep in mind:
- *  \li These functions only work on C function names.  Other languages may
- *      have name mangling and intrinsic language support that varies from
- *      compiler to compiler.
- *  \li Make sure you declare your function pointers with the same calling
- *      convention as the actual library function.  Your code will crash
- *      mysteriously if you do not do this.
- *  \li Avoid namespace collisions.  If you load a symbol from the library,
- *      it is not defined whether or not it goes into the global symbol
- *      namespace for the application.  If it does and it conflicts with
- *      symbols in your code or other shared libraries, you will not get
- *      the results you expect. :)
- */
-
-#ifndef _SDL_loadso_h
-#define _SDL_loadso_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  This function dynamically loads a shared object and returns a pointer
- *  to the object handle (or NULL if there was an error).
- *  The 'sofile' parameter is a system dependent name of the object file.
- */
-extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
-
-/**
- *  Given an object handle, this function looks up the address of the
- *  named function in the shared object and returns it.  This address
- *  is no longer valid after calling SDL_UnloadObject().
- */
-extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
-                                               const char *name);
-
-/**
- *  Unload a shared object from memory.
- */
-extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_loadso_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_log.h b/deps/SDL2/include/SDL_log.h
deleted file mode 100644
index 79ae4cd..0000000
--- a/deps/SDL2/include/SDL_log.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_log.h
- *
- *  Simple log messages with categories and priorities.
- *
- *  By default logs are quiet, but if you're debugging SDL you might want:
- *
- *      SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
- *
- *  Here's where the messages go on different platforms:
- *      Windows: debug output stream
- *      Android: log output
- *      Others: standard error output (stderr)
- */
-
-#ifndef _SDL_log_h
-#define _SDL_log_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- *  \brief The maximum size of a log message
- *
- *  Messages longer than the maximum size will be truncated
- */
-#define SDL_MAX_LOG_MESSAGE 4096
-
-/**
- *  \brief The predefined log categories
- *
- *  By default the application category is enabled at the INFO level,
- *  the assert category is enabled at the WARN level, test is enabled
- *  at the VERBOSE level and all other categories are enabled at the
- *  CRITICAL level.
- */
-enum
-{
-    SDL_LOG_CATEGORY_APPLICATION,
-    SDL_LOG_CATEGORY_ERROR,
-    SDL_LOG_CATEGORY_ASSERT,
-    SDL_LOG_CATEGORY_SYSTEM,
-    SDL_LOG_CATEGORY_AUDIO,
-    SDL_LOG_CATEGORY_VIDEO,
-    SDL_LOG_CATEGORY_RENDER,
-    SDL_LOG_CATEGORY_INPUT,
-    SDL_LOG_CATEGORY_TEST,
-
-    /* Reserved for future SDL library use */
-    SDL_LOG_CATEGORY_RESERVED1,
-    SDL_LOG_CATEGORY_RESERVED2,
-    SDL_LOG_CATEGORY_RESERVED3,
-    SDL_LOG_CATEGORY_RESERVED4,
-    SDL_LOG_CATEGORY_RESERVED5,
-    SDL_LOG_CATEGORY_RESERVED6,
-    SDL_LOG_CATEGORY_RESERVED7,
-    SDL_LOG_CATEGORY_RESERVED8,
-    SDL_LOG_CATEGORY_RESERVED9,
-    SDL_LOG_CATEGORY_RESERVED10,
-
-    /* Beyond this point is reserved for application use, e.g.
-       enum {
-           MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
-           MYAPP_CATEGORY_AWESOME2,
-           MYAPP_CATEGORY_AWESOME3,
-           ...
-       };
-     */
-    SDL_LOG_CATEGORY_CUSTOM
-};
-
-/**
- *  \brief The predefined log priorities
- */
-typedef enum
-{
-    SDL_LOG_PRIORITY_VERBOSE = 1,
-    SDL_LOG_PRIORITY_DEBUG,
-    SDL_LOG_PRIORITY_INFO,
-    SDL_LOG_PRIORITY_WARN,
-    SDL_LOG_PRIORITY_ERROR,
-    SDL_LOG_PRIORITY_CRITICAL,
-    SDL_NUM_LOG_PRIORITIES
-} SDL_LogPriority;
-
-
-/**
- *  \brief Set the priority of all log categories
- */
-extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
-
-/**
- *  \brief Set the priority of a particular log category
- */
-extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
-                                                SDL_LogPriority priority);
-
-/**
- *  \brief Get the priority of a particular log category
- */
-extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
-
-/**
- *  \brief Reset all priorities to default.
- *
- *  \note This is called in SDL_Quit().
- */
-extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
-
-/**
- *  \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
- */
-extern DECLSPEC void SDLCALL SDL_Log(const char *fmt, ...);
-
-/**
- *  \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
- */
-extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, const char *fmt, ...);
-
-/**
- *  \brief Log a message with SDL_LOG_PRIORITY_DEBUG
- */
-extern DECLSPEC void SDLCALL SDL_LogDebug(int category, const char *fmt, ...);
-
-/**
- *  \brief Log a message with SDL_LOG_PRIORITY_INFO
- */
-extern DECLSPEC void SDLCALL SDL_LogInfo(int category, const char *fmt, ...);
-
-/**
- *  \brief Log a message with SDL_LOG_PRIORITY_WARN
- */
-extern DECLSPEC void SDLCALL SDL_LogWarn(int category, const char *fmt, ...);
-
-/**
- *  \brief Log a message with SDL_LOG_PRIORITY_ERROR
- */
-extern DECLSPEC void SDLCALL SDL_LogError(int category, const char *fmt, ...);
-
-/**
- *  \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
- */
-extern DECLSPEC void SDLCALL SDL_LogCritical(int category, const char *fmt, ...);
-
-/**
- *  \brief Log a message with the specified category and priority.
- */
-extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
-                                            SDL_LogPriority priority,
-                                            const char *fmt, ...);
-
-/**
- *  \brief Log a message with the specified category and priority.
- */
-extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
-                                             SDL_LogPriority priority,
-                                             const char *fmt, va_list ap);
-
-/**
- *  \brief The prototype for the log output function
- */
-typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
-
-/**
- *  \brief Get the current log output function.
- */
-extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
-
-/**
- *  \brief This function allows you to replace the default log output
- *         function with one of your own.
- */
-extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_log_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_main.h b/deps/SDL2/include/SDL_main.h
deleted file mode 100644
index b7e4a10..0000000
--- a/deps/SDL2/include/SDL_main.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_main_h
-#define _SDL_main_h
-
-#include "SDL_stdinc.h"
-
-/**
- *  \file SDL_main.h
- *
- *  Redefine main() on some platforms so that it is called by SDL.
- */
-
-#ifndef SDL_MAIN_HANDLED
-#if defined(__WIN32__)
-/* On Windows SDL provides WinMain(), which parses the command line and passes
-   the arguments to your main function.
-
-   If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
- */
-#define SDL_MAIN_AVAILABLE
-
-#elif defined(__IPHONEOS__)
-/* On iOS SDL provides a main function that creates an application delegate
-   and starts the iOS application run loop.
-
-   See src/video/uikit/SDL_uikitappdelegate.m for more details.
- */
-#define SDL_MAIN_NEEDED
-
-#elif defined(__ANDROID__)
-/* On Android SDL provides a Java class in SDLActivity.java that is the
-   main activity entry point.
-
-   See README-android.txt for more details on extending that class.
- */
-#define SDL_MAIN_NEEDED
-
-#endif
-#endif /* SDL_MAIN_HANDLED */
-
-#ifdef __cplusplus
-#define C_LINKAGE   "C"
-#else
-#define C_LINKAGE
-#endif /* __cplusplus */
-
-/**
- *  \file SDL_main.h
- *
- *  The application's main() function must be called with C linkage,
- *  and should be declared like this:
- *  \code
- *  #ifdef __cplusplus
- *  extern "C"
- *  #endif
- *  int main(int argc, char *argv[])
- *  {
- *  }
- *  \endcode
- */
-
-#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
-#define main    SDL_main
-#endif
-
-/**
- *  The prototype for the application's main() function
- */
-extern C_LINKAGE int SDL_main(int argc, char *argv[]);
-
-
-#include "begin_code.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  This is called by the real SDL main function to let the rest of the
- *  library know that initialization was done properly.
- *
- *  Calling this yourself without knowing what you're doing can cause
- *  crashes and hard to diagnose problems with your application.
- */
-extern DECLSPEC void SDL_SetMainReady(void);
-
-#ifdef __WIN32__
-
-/**
- *  This can be called to set the application class at startup
- */
-extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
-                                            void *hInst);
-extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
-
-#endif /* __WIN32__ */
-
-
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_main_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_messagebox.h b/deps/SDL2/include/SDL_messagebox.h
deleted file mode 100644
index cb1a1cc..0000000
--- a/deps/SDL2/include/SDL_messagebox.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_messagebox_h
-#define _SDL_messagebox_h
-
-#include "SDL_stdinc.h"
-#include "SDL_video.h"      /* For SDL_Window */
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief SDL_MessageBox flags. If supported will display warning icon, etc.
- */
-typedef enum
-{
-    SDL_MESSAGEBOX_ERROR        = 0x00000010,   /**< error dialog */
-    SDL_MESSAGEBOX_WARNING      = 0x00000020,   /**< warning dialog */
-    SDL_MESSAGEBOX_INFORMATION  = 0x00000040    /**< informational dialog */
-} SDL_MessageBoxFlags;
-
-/**
- * \brief Flags for SDL_MessageBoxButtonData.
- */
-typedef enum
-{
-    SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001,  /**< Marks the default button when return is hit */
-    SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002   /**< Marks the default button when escape is hit */
-} SDL_MessageBoxButtonFlags;
-
-/**
- *  \brief Individual button data.
- */
-typedef struct
-{
-    Uint32 flags;       /**< ::SDL_MessageBoxButtonFlags */
-    int buttonid;       /**< User defined button id (value returned via SDL_ShowMessageBox) */
-    const char * text;  /**< The UTF-8 button text */
-} SDL_MessageBoxButtonData;
-
-/**
- * \brief RGB value used in a message box color scheme
- */
-typedef struct
-{
-    Uint8 r, g, b;
-} SDL_MessageBoxColor;
-
-typedef enum
-{
-    SDL_MESSAGEBOX_COLOR_BACKGROUND,
-    SDL_MESSAGEBOX_COLOR_TEXT,
-    SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
-    SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
-    SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
-    SDL_MESSAGEBOX_COLOR_MAX
-} SDL_MessageBoxColorType;
-
-/**
- * \brief A set of colors to use for message box dialogs
- */
-typedef struct
-{
-    SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX];
-} SDL_MessageBoxColorScheme;
-
-/**
- *  \brief MessageBox structure containing title, text, window, etc.
- */
-typedef struct
-{
-    Uint32 flags;                       /**< ::SDL_MessageBoxFlags */
-    SDL_Window *window;                 /**< Parent window, can be NULL */
-    const char *title;                  /**< UTF-8 title */
-    const char *message;                /**< UTF-8 message text */
-
-    int numbuttons;
-    const SDL_MessageBoxButtonData *buttons;
-
-    const SDL_MessageBoxColorScheme *colorScheme;   /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */
-} SDL_MessageBoxData;
-
-/**
- *  \brief Create a modal message box.
- *
- *  \param messageboxdata The SDL_MessageBoxData structure with title, text, etc.
- *  \param buttonid The pointer to which user id of hit button should be copied.
- *
- *  \return -1 on error, otherwise 0 and buttonid contains user id of button
- *          hit or -1 if dialog was closed.
- *
- *  \note This function should be called on the thread that created the parent
- *        window, or on the main thread if the messagebox has no parent.  It will
- *        block execution of that thread until the user clicks a button or
- *        closes the messagebox.
- */
-extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
-
-/**
- *  \brief Create a simple modal message box
- *
- *  \param flags    ::SDL_MessageBoxFlags
- *  \param title    UTF-8 title text
- *  \param message  UTF-8 message text
- *  \param window   The parent window, or NULL for no parent
- *
- *  \return 0 on success, -1 on error
- *
- *  \sa SDL_ShowMessageBox
- */
-extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_messagebox_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_mouse.h b/deps/SDL2/include/SDL_mouse.h
deleted file mode 100644
index 36c29e9..0000000
--- a/deps/SDL2/include/SDL_mouse.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_mouse.h
- *
- *  Include file for SDL mouse event handling.
- */
-
-#ifndef _SDL_mouse_h
-#define _SDL_mouse_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_video.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct SDL_Cursor SDL_Cursor;   /* Implementation dependent */
-
-/**
- * \brief Cursor types for SDL_CreateSystemCursor.
- */
-typedef enum
-{
-    SDL_SYSTEM_CURSOR_ARROW,     /**< Arrow */
-    SDL_SYSTEM_CURSOR_IBEAM,     /**< I-beam */
-    SDL_SYSTEM_CURSOR_WAIT,      /**< Wait */
-    SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */
-    SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */
-    SDL_SYSTEM_CURSOR_SIZENWSE,  /**< Double arrow pointing northwest and southeast */
-    SDL_SYSTEM_CURSOR_SIZENESW,  /**< Double arrow pointing northeast and southwest */
-    SDL_SYSTEM_CURSOR_SIZEWE,    /**< Double arrow pointing west and east */
-    SDL_SYSTEM_CURSOR_SIZENS,    /**< Double arrow pointing north and south */
-    SDL_SYSTEM_CURSOR_SIZEALL,   /**< Four pointed arrow pointing north, south, east, and west */
-    SDL_SYSTEM_CURSOR_NO,        /**< Slashed circle or crossbones */
-    SDL_SYSTEM_CURSOR_HAND,      /**< Hand */
-    SDL_NUM_SYSTEM_CURSORS
-} SDL_SystemCursor;
-
-/* Function prototypes */
-
-/**
- *  \brief Get the window which currently has mouse focus.
- */
-extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
-
-/**
- *  \brief Retrieve the current state of the mouse.
- *
- *  The current button state is returned as a button bitmask, which can
- *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
- *  mouse cursor position relative to the focus window for the currently
- *  selected mouse.  You can pass NULL for either x or y.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
-
-/**
- *  \brief Retrieve the relative state of the mouse.
- *
- *  The current button state is returned as a button bitmask, which can
- *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
- *  mouse deltas since the last call to SDL_GetRelativeMouseState().
- */
-extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
-
-/**
- *  \brief Moves the mouse to the given position within the window.
- *
- *  \param window The window to move the mouse into, or NULL for the current mouse focus
- *  \param x The x coordinate within the window
- *  \param y The y coordinate within the window
- *
- *  \note This function generates a mouse motion event
- */
-extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
-                                                   int x, int y);
-
-/**
- *  \brief Set relative mouse mode.
- *
- *  \param enabled Whether or not to enable relative mode
- *
- *  \return 0 on success, or -1 if relative mode is not supported.
- *
- *  While the mouse is in relative mode, the cursor is hidden, and the
- *  driver will try to report continuous motion in the current window.
- *  Only relative motion events will be delivered, the mouse position
- *  will not change.
- *
- *  \note This function will flush any pending mouse motion.
- *
- *  \sa SDL_GetRelativeMouseMode()
- */
-extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
-
-/**
- *  \brief Query whether relative mouse mode is enabled.
- *
- *  \sa SDL_SetRelativeMouseMode()
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
-
-/**
- *  \brief Create a cursor, using the specified bitmap data and
- *         mask (in MSB format).
- *
- *  The cursor width must be a multiple of 8 bits.
- *
- *  The cursor is created in black and white according to the following:
- *  <table>
- *  <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
- *  <tr><td>  0   </td><td>  1   </td><td> White </td></tr>
- *  <tr><td>  1   </td><td>  1   </td><td> Black </td></tr>
- *  <tr><td>  0   </td><td>  0   </td><td> Transparent </td></tr>
- *  <tr><td>  1   </td><td>  0   </td><td> Inverted color if possible, black
- *                                         if not. </td></tr>
- *  </table>
- *
- *  \sa SDL_FreeCursor()
- */
-extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
-                                                     const Uint8 * mask,
-                                                     int w, int h, int hot_x,
-                                                     int hot_y);
-
-/**
- *  \brief Create a color cursor.
- *
- *  \sa SDL_FreeCursor()
- */
-extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
-                                                          int hot_x,
-                                                          int hot_y);
-
-/**
- *  \brief Create a system cursor.
- *
- *  \sa SDL_FreeCursor()
- */
-extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
-
-/**
- *  \brief Set the active cursor.
- */
-extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
-
-/**
- *  \brief Return the active cursor.
- */
-extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
-
-/**
- *  \brief Return the default cursor.
- */
-extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
-
-/**
- *  \brief Frees a cursor created with SDL_CreateCursor().
- *
- *  \sa SDL_CreateCursor()
- */
-extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
-
-/**
- *  \brief Toggle whether or not the cursor is shown.
- *
- *  \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
- *                state.
- *
- *  \return 1 if the cursor is shown, or 0 if the cursor is hidden.
- */
-extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
-
-/**
- *  Used as a mask when testing buttons in buttonstate.
- *   - Button 1:  Left mouse button
- *   - Button 2:  Middle mouse button
- *   - Button 3:  Right mouse button
- */
-#define SDL_BUTTON(X)       (1 << ((X)-1))
-#define SDL_BUTTON_LEFT     1
-#define SDL_BUTTON_MIDDLE   2
-#define SDL_BUTTON_RIGHT    3
-#define SDL_BUTTON_X1       4
-#define SDL_BUTTON_X2       5
-#define SDL_BUTTON_LMASK    SDL_BUTTON(SDL_BUTTON_LEFT)
-#define SDL_BUTTON_MMASK    SDL_BUTTON(SDL_BUTTON_MIDDLE)
-#define SDL_BUTTON_RMASK    SDL_BUTTON(SDL_BUTTON_RIGHT)
-#define SDL_BUTTON_X1MASK   SDL_BUTTON(SDL_BUTTON_X1)
-#define SDL_BUTTON_X2MASK   SDL_BUTTON(SDL_BUTTON_X2)
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_mouse_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_mutex.h b/deps/SDL2/include/SDL_mutex.h
deleted file mode 100644
index 2b5df0e..0000000
--- a/deps/SDL2/include/SDL_mutex.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_mutex_h
-#define _SDL_mutex_h
-
-/**
- *  \file SDL_mutex.h
- *
- *  Functions to provide thread synchronization primitives.
- */
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  Synchronization functions which can time out return this value
- *  if they time out.
- */
-#define SDL_MUTEX_TIMEDOUT  1
-
-/**
- *  This is the timeout value which corresponds to never time out.
- */
-#define SDL_MUTEX_MAXWAIT   (~(Uint32)0)
-
-
-/**
- *  \name Mutex functions
- */
-/* @{ */
-
-/* The SDL mutex structure, defined in SDL_sysmutex.c */
-struct SDL_mutex;
-typedef struct SDL_mutex SDL_mutex;
-
-/**
- *  Create a mutex, initialized unlocked.
- */
-extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
-
-/**
- *  Lock the mutex.
- *
- *  \return 0, or -1 on error.
- */
-#define SDL_mutexP(m)   SDL_LockMutex(m)
-extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
-
-/**
- *  Try to lock the mutex
- *
- *  \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
-
-/**
- *  Unlock the mutex.
- *
- *  \return 0, or -1 on error.
- *
- *  \warning It is an error to unlock a mutex that has not been locked by
- *           the current thread, and doing so results in undefined behavior.
- */
-#define SDL_mutexV(m)   SDL_UnlockMutex(m)
-extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
-
-/**
- *  Destroy a mutex.
- */
-extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex);
-
-/* @} *//* Mutex functions */
-
-
-/**
- *  \name Semaphore functions
- */
-/* @{ */
-
-/* The SDL semaphore structure, defined in SDL_syssem.c */
-struct SDL_semaphore;
-typedef struct SDL_semaphore SDL_sem;
-
-/**
- *  Create a semaphore, initialized with value, returns NULL on failure.
- */
-extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
-
-/**
- *  Destroy a semaphore.
- */
-extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem);
-
-/**
- *  This function suspends the calling thread until the semaphore pointed
- *  to by \c sem has a positive count. It then atomically decreases the
- *  semaphore count.
- */
-extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem);
-
-/**
- *  Non-blocking variant of SDL_SemWait().
- *
- *  \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would
- *          block, and -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
-
-/**
- *  Variant of SDL_SemWait() with a timeout in milliseconds.
- *
- *  \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not
- *          succeed in the allotted time, and -1 on error.
- *
- *  \warning On some platforms this function is implemented by looping with a
- *           delay of 1 ms, and so should be avoided if possible.
- */
-extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
-
-/**
- *  Atomically increases the semaphore's count (not blocking).
- *
- *  \return 0, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem);
-
-/**
- *  Returns the current count of the semaphore.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem);
-
-/* @} *//* Semaphore functions */
-
-
-/**
- *  \name Condition variable functions
- */
-/* @{ */
-
-/* The SDL condition variable structure, defined in SDL_syscond.c */
-struct SDL_cond;
-typedef struct SDL_cond SDL_cond;
-
-/**
- *  Create a condition variable.
- *
- *  Typical use of condition variables:
- *
- *  Thread A:
- *    SDL_LockMutex(lock);
- *    while ( ! condition ) {
- *        SDL_CondWait(cond, lock);
- *    }
- *    SDL_UnlockMutex(lock);
- *
- *  Thread B:
- *    SDL_LockMutex(lock);
- *    ...
- *    condition = true;
- *    ...
- *    SDL_CondSignal(cond);
- *    SDL_UnlockMutex(lock);
- *
- *  There is some discussion whether to signal the condition variable
- *  with the mutex locked or not.  There is some potential performance
- *  benefit to unlocking first on some platforms, but there are some
- *  potential race conditions depending on how your code is structured.
- *
- *  In general it's safer to signal the condition variable while the
- *  mutex is locked.
- */
-extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
-
-/**
- *  Destroy a condition variable.
- */
-extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond);
-
-/**
- *  Restart one of the threads that are waiting on the condition variable.
- *
- *  \return 0 or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond);
-
-/**
- *  Restart all threads that are waiting on the condition variable.
- *
- *  \return 0 or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
-
-/**
- *  Wait on the condition variable, unlocking the provided mutex.
- *
- *  \warning The mutex must be locked before entering this function!
- *
- *  The mutex is re-locked once the condition variable is signaled.
- *
- *  \return 0 when it is signaled, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
-
-/**
- *  Waits for at most \c ms milliseconds, and returns 0 if the condition
- *  variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
- *  signaled in the allotted time, and -1 on error.
- *
- *  \warning On some platforms this function is implemented by looping with a
- *           delay of 1 ms, and so should be avoided if possible.
- */
-extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond,
-                                                SDL_mutex * mutex, Uint32 ms);
-
-/* @} *//* Condition variable functions */
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_mutex_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_name.h b/deps/SDL2/include/SDL_name.h
deleted file mode 100644
index d0469e1..0000000
--- a/deps/SDL2/include/SDL_name.h
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#ifndef _SDLname_h_
-#define _SDLname_h_
-
-#if defined(__STDC__) || defined(__cplusplus)
-#define NeedFunctionPrototypes 1
-#endif
-
-#define SDL_NAME(X) SDL_##X
-
-#endif /* _SDLname_h_ */
diff --git a/deps/SDL2/include/SDL_opengl.h b/deps/SDL2/include/SDL_opengl.h
deleted file mode 100644
index 2f120aa..0000000
--- a/deps/SDL2/include/SDL_opengl.h
+++ /dev/null
@@ -1,11126 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_opengl.h
- *
- *  This is a simple file to encapsulate the OpenGL API headers.
- */
-
-#ifndef _SDL_opengl_h
-#define _SDL_opengl_h
-
-#include "SDL_config.h"
-
-#ifndef __IPHONEOS__
-
-#ifdef __WIN32__
-#define WIN32_LEAN_AND_MEAN
-#ifndef NOMINMAX
-#define NOMINMAX                /* Don't defined min() and max() */
-#endif
-#include <windows.h>
-#endif
-
-#ifdef __glext_h_
-/* Someone has already included glext.h */
-#define NO_SDL_GLEXT
-#endif
-#ifndef NO_SDL_GLEXT
-#define __glext_h_              /* Don't let gl.h include glext.h */
-#endif
-#if defined(__MACOSX__)
-#include <OpenGL/gl.h>          /* Header File For The OpenGL Library */
-#define __X_GL_H
-#else
-#include <GL/gl.h>              /* Header File For The OpenGL Library */
-#endif
-#ifndef NO_SDL_GLEXT
-#undef __glext_h_
-#endif
-
-/**
- *  \file SDL_opengl.h
- *
- *  This file is included because glext.h is not available on some systems.
- *  If you don't want this version included, simply define ::NO_SDL_GLEXT.
- *
- *  The latest version is available from:
- *      http://www.opengl.org/registry/
- */
-
-/**
- *  \def NO_SDL_GLEXT
- *
- *  Define this if you have your own version of glext.h and want to disable the
- *  version included in SDL_opengl.h.
- */
-
-#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY)
-#ifndef __glext_h_
-#define __glext_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** Copyright (c) 2007-2010 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-**
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-/* Header file version number, required by OpenGL ABI for Linux */
-/* glext.h last updated $Date: 2010-08-03 01:30:25 -0700 (Tue, 03 Aug 2010) $ */
-/* Current version at http://www.opengl.org/registry/ */
-#define GL_GLEXT_VERSION 64
-/* Function declaration macros - to move into glplatform.h */
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-/*************************************************************/
-
-#ifndef GL_VERSION_1_2
-#define GL_UNSIGNED_BYTE_3_3_2            0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
-#define GL_UNSIGNED_INT_8_8_8_8           0x8035
-#define GL_UNSIGNED_INT_10_10_10_2        0x8036
-#define GL_TEXTURE_BINDING_3D             0x806A
-#define GL_PACK_SKIP_IMAGES               0x806B
-#define GL_PACK_IMAGE_HEIGHT              0x806C
-#define GL_UNPACK_SKIP_IMAGES             0x806D
-#define GL_UNPACK_IMAGE_HEIGHT            0x806E
-#define GL_TEXTURE_3D                     0x806F
-#define GL_PROXY_TEXTURE_3D               0x8070
-#define GL_TEXTURE_DEPTH                  0x8071
-#define GL_TEXTURE_WRAP_R                 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE            0x8073
-#define GL_UNSIGNED_BYTE_2_3_3_REV        0x8362
-#define GL_UNSIGNED_SHORT_5_6_5           0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV       0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV     0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV     0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV       0x8367
-#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
-#define GL_BGR                            0x80E0
-#define GL_BGRA                           0x80E1
-#define GL_MAX_ELEMENTS_VERTICES          0x80E8
-#define GL_MAX_ELEMENTS_INDICES           0x80E9
-#define GL_CLAMP_TO_EDGE                  0x812F
-#define GL_TEXTURE_MIN_LOD                0x813A
-#define GL_TEXTURE_MAX_LOD                0x813B
-#define GL_TEXTURE_BASE_LEVEL             0x813C
-#define GL_TEXTURE_MAX_LEVEL              0x813D
-#define GL_SMOOTH_POINT_SIZE_RANGE        0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY  0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE        0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY  0x0B23
-#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
-#endif
-
-#ifndef GL_VERSION_1_2_DEPRECATED
-#define GL_RESCALE_NORMAL                 0x803A
-#define GL_LIGHT_MODEL_COLOR_CONTROL      0x81F8
-#define GL_SINGLE_COLOR                   0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR        0x81FA
-#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
-#endif
-
-#ifndef GL_ARB_imaging
-#define GL_CONSTANT_COLOR                 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
-#define GL_CONSTANT_ALPHA                 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
-#define GL_BLEND_COLOR                    0x8005
-#define GL_FUNC_ADD                       0x8006
-#define GL_MIN                            0x8007
-#define GL_MAX                            0x8008
-#define GL_BLEND_EQUATION                 0x8009
-#define GL_FUNC_SUBTRACT                  0x800A
-#define GL_FUNC_REVERSE_SUBTRACT          0x800B
-#endif
-
-#ifndef GL_ARB_imaging_DEPRECATED
-#define GL_CONVOLUTION_1D                 0x8010
-#define GL_CONVOLUTION_2D                 0x8011
-#define GL_SEPARABLE_2D                   0x8012
-#define GL_CONVOLUTION_BORDER_MODE        0x8013
-#define GL_CONVOLUTION_FILTER_SCALE       0x8014
-#define GL_CONVOLUTION_FILTER_BIAS        0x8015
-#define GL_REDUCE                         0x8016
-#define GL_CONVOLUTION_FORMAT             0x8017
-#define GL_CONVOLUTION_WIDTH              0x8018
-#define GL_CONVOLUTION_HEIGHT             0x8019
-#define GL_MAX_CONVOLUTION_WIDTH          0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT         0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE     0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE   0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE    0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE   0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS      0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS    0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS     0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS    0x8023
-#define GL_HISTOGRAM                      0x8024
-#define GL_PROXY_HISTOGRAM                0x8025
-#define GL_HISTOGRAM_WIDTH                0x8026
-#define GL_HISTOGRAM_FORMAT               0x8027
-#define GL_HISTOGRAM_RED_SIZE             0x8028
-#define GL_HISTOGRAM_GREEN_SIZE           0x8029
-#define GL_HISTOGRAM_BLUE_SIZE            0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE           0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE       0x802C
-#define GL_HISTOGRAM_SINK                 0x802D
-#define GL_MINMAX                         0x802E
-#define GL_MINMAX_FORMAT                  0x802F
-#define GL_MINMAX_SINK                    0x8030
-#define GL_TABLE_TOO_LARGE                0x8031
-#define GL_COLOR_MATRIX                   0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH       0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH   0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE    0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE  0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE   0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE  0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS     0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS   0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS    0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS   0x80BB
-#define GL_COLOR_TABLE                    0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE   0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE  0x80D2
-#define GL_PROXY_COLOR_TABLE              0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE              0x80D6
-#define GL_COLOR_TABLE_BIAS               0x80D7
-#define GL_COLOR_TABLE_FORMAT             0x80D8
-#define GL_COLOR_TABLE_WIDTH              0x80D9
-#define GL_COLOR_TABLE_RED_SIZE           0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE         0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE          0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE         0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE     0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE     0x80DF
-#define GL_CONSTANT_BORDER                0x8151
-#define GL_REPLICATE_BORDER               0x8153
-#define GL_CONVOLUTION_BORDER_COLOR       0x8154
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_TEXTURE0                       0x84C0
-#define GL_TEXTURE1                       0x84C1
-#define GL_TEXTURE2                       0x84C2
-#define GL_TEXTURE3                       0x84C3
-#define GL_TEXTURE4                       0x84C4
-#define GL_TEXTURE5                       0x84C5
-#define GL_TEXTURE6                       0x84C6
-#define GL_TEXTURE7                       0x84C7
-#define GL_TEXTURE8                       0x84C8
-#define GL_TEXTURE9                       0x84C9
-#define GL_TEXTURE10                      0x84CA
-#define GL_TEXTURE11                      0x84CB
-#define GL_TEXTURE12                      0x84CC
-#define GL_TEXTURE13                      0x84CD
-#define GL_TEXTURE14                      0x84CE
-#define GL_TEXTURE15                      0x84CF
-#define GL_TEXTURE16                      0x84D0
-#define GL_TEXTURE17                      0x84D1
-#define GL_TEXTURE18                      0x84D2
-#define GL_TEXTURE19                      0x84D3
-#define GL_TEXTURE20                      0x84D4
-#define GL_TEXTURE21                      0x84D5
-#define GL_TEXTURE22                      0x84D6
-#define GL_TEXTURE23                      0x84D7
-#define GL_TEXTURE24                      0x84D8
-#define GL_TEXTURE25                      0x84D9
-#define GL_TEXTURE26                      0x84DA
-#define GL_TEXTURE27                      0x84DB
-#define GL_TEXTURE28                      0x84DC
-#define GL_TEXTURE29                      0x84DD
-#define GL_TEXTURE30                      0x84DE
-#define GL_TEXTURE31                      0x84DF
-#define GL_ACTIVE_TEXTURE                 0x84E0
-#define GL_MULTISAMPLE                    0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE            0x809F
-#define GL_SAMPLE_COVERAGE                0x80A0
-#define GL_SAMPLE_BUFFERS                 0x80A8
-#define GL_SAMPLES                        0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
-#define GL_TEXTURE_CUBE_MAP               0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP         0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
-#define GL_COMPRESSED_RGB                 0x84ED
-#define GL_COMPRESSED_RGBA                0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT       0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE  0x86A0
-#define GL_TEXTURE_COMPRESSED             0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
-#define GL_CLAMP_TO_BORDER                0x812D
-#endif
-
-#ifndef GL_VERSION_1_3_DEPRECATED
-#define GL_CLIENT_ACTIVE_TEXTURE          0x84E1
-#define GL_MAX_TEXTURE_UNITS              0x84E2
-#define GL_TRANSPOSE_MODELVIEW_MATRIX     0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX    0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX       0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX         0x84E6
-#define GL_MULTISAMPLE_BIT                0x20000000
-#define GL_NORMAL_MAP                     0x8511
-#define GL_REFLECTION_MAP                 0x8512
-#define GL_COMPRESSED_ALPHA               0x84E9
-#define GL_COMPRESSED_LUMINANCE           0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA     0x84EB
-#define GL_COMPRESSED_INTENSITY           0x84EC
-#define GL_COMBINE                        0x8570
-#define GL_COMBINE_RGB                    0x8571
-#define GL_COMBINE_ALPHA                  0x8572
-#define GL_SOURCE0_RGB                    0x8580
-#define GL_SOURCE1_RGB                    0x8581
-#define GL_SOURCE2_RGB                    0x8582
-#define GL_SOURCE0_ALPHA                  0x8588
-#define GL_SOURCE1_ALPHA                  0x8589
-#define GL_SOURCE2_ALPHA                  0x858A
-#define GL_OPERAND0_RGB                   0x8590
-#define GL_OPERAND1_RGB                   0x8591
-#define GL_OPERAND2_RGB                   0x8592
-#define GL_OPERAND0_ALPHA                 0x8598
-#define GL_OPERAND1_ALPHA                 0x8599
-#define GL_OPERAND2_ALPHA                 0x859A
-#define GL_RGB_SCALE                      0x8573
-#define GL_ADD_SIGNED                     0x8574
-#define GL_INTERPOLATE                    0x8575
-#define GL_SUBTRACT                       0x84E7
-#define GL_CONSTANT                       0x8576
-#define GL_PRIMARY_COLOR                  0x8577
-#define GL_PREVIOUS                       0x8578
-#define GL_DOT3_RGB                       0x86AE
-#define GL_DOT3_RGBA                      0x86AF
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_BLEND_DST_RGB                  0x80C8
-#define GL_BLEND_SRC_RGB                  0x80C9
-#define GL_BLEND_DST_ALPHA                0x80CA
-#define GL_BLEND_SRC_ALPHA                0x80CB
-#define GL_POINT_FADE_THRESHOLD_SIZE      0x8128
-#define GL_DEPTH_COMPONENT16              0x81A5
-#define GL_DEPTH_COMPONENT24              0x81A6
-#define GL_DEPTH_COMPONENT32              0x81A7
-#define GL_MIRRORED_REPEAT                0x8370
-#define GL_MAX_TEXTURE_LOD_BIAS           0x84FD
-#define GL_TEXTURE_LOD_BIAS               0x8501
-#define GL_INCR_WRAP                      0x8507
-#define GL_DECR_WRAP                      0x8508
-#define GL_TEXTURE_DEPTH_SIZE             0x884A
-#define GL_TEXTURE_COMPARE_MODE           0x884C
-#define GL_TEXTURE_COMPARE_FUNC           0x884D
-#endif
-
-#ifndef GL_VERSION_1_4_DEPRECATED
-#define GL_POINT_SIZE_MIN                 0x8126
-#define GL_POINT_SIZE_MAX                 0x8127
-#define GL_POINT_DISTANCE_ATTENUATION     0x8129
-#define GL_GENERATE_MIPMAP                0x8191
-#define GL_GENERATE_MIPMAP_HINT           0x8192
-#define GL_FOG_COORDINATE_SOURCE          0x8450
-#define GL_FOG_COORDINATE                 0x8451
-#define GL_FRAGMENT_DEPTH                 0x8452
-#define GL_CURRENT_FOG_COORDINATE         0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE      0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE    0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER   0x8456
-#define GL_FOG_COORDINATE_ARRAY           0x8457
-#define GL_COLOR_SUM                      0x8458
-#define GL_CURRENT_SECONDARY_COLOR        0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE     0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE     0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE   0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER  0x845D
-#define GL_SECONDARY_COLOR_ARRAY          0x845E
-#define GL_TEXTURE_FILTER_CONTROL         0x8500
-#define GL_DEPTH_TEXTURE_MODE             0x884B
-#define GL_COMPARE_R_TO_TEXTURE           0x884E
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_BUFFER_SIZE                    0x8764
-#define GL_BUFFER_USAGE                   0x8765
-#define GL_QUERY_COUNTER_BITS             0x8864
-#define GL_CURRENT_QUERY                  0x8865
-#define GL_QUERY_RESULT                   0x8866
-#define GL_QUERY_RESULT_AVAILABLE         0x8867
-#define GL_ARRAY_BUFFER                   0x8892
-#define GL_ELEMENT_ARRAY_BUFFER           0x8893
-#define GL_ARRAY_BUFFER_BINDING           0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_READ_ONLY                      0x88B8
-#define GL_WRITE_ONLY                     0x88B9
-#define GL_READ_WRITE                     0x88BA
-#define GL_BUFFER_ACCESS                  0x88BB
-#define GL_BUFFER_MAPPED                  0x88BC
-#define GL_BUFFER_MAP_POINTER             0x88BD
-#define GL_STREAM_DRAW                    0x88E0
-#define GL_STREAM_READ                    0x88E1
-#define GL_STREAM_COPY                    0x88E2
-#define GL_STATIC_DRAW                    0x88E4
-#define GL_STATIC_READ                    0x88E5
-#define GL_STATIC_COPY                    0x88E6
-#define GL_DYNAMIC_DRAW                   0x88E8
-#define GL_DYNAMIC_READ                   0x88E9
-#define GL_DYNAMIC_COPY                   0x88EA
-#define GL_SAMPLES_PASSED                 0x8914
-#endif
-
-#ifndef GL_VERSION_1_5_DEPRECATED
-#define GL_VERTEX_ARRAY_BUFFER_BINDING    0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING    0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING     0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING     0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING    0x889E
-#define GL_FOG_COORD_SRC                  0x8450
-#define GL_FOG_COORD                      0x8451
-#define GL_CURRENT_FOG_COORD              0x8453
-#define GL_FOG_COORD_ARRAY_TYPE           0x8454
-#define GL_FOG_COORD_ARRAY_STRIDE         0x8455
-#define GL_FOG_COORD_ARRAY_POINTER        0x8456
-#define GL_FOG_COORD_ARRAY                0x8457
-#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
-#define GL_SRC0_RGB                       0x8580
-#define GL_SRC1_RGB                       0x8581
-#define GL_SRC2_RGB                       0x8582
-#define GL_SRC0_ALPHA                     0x8588
-#define GL_SRC1_ALPHA                     0x8589
-#define GL_SRC2_ALPHA                     0x858A
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_BLEND_EQUATION_RGB             0x8009
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
-#define GL_CURRENT_VERTEX_ATTRIB          0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE      0x8642
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
-#define GL_STENCIL_BACK_FUNC              0x8800
-#define GL_STENCIL_BACK_FAIL              0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
-#define GL_MAX_DRAW_BUFFERS               0x8824
-#define GL_DRAW_BUFFER0                   0x8825
-#define GL_DRAW_BUFFER1                   0x8826
-#define GL_DRAW_BUFFER2                   0x8827
-#define GL_DRAW_BUFFER3                   0x8828
-#define GL_DRAW_BUFFER4                   0x8829
-#define GL_DRAW_BUFFER5                   0x882A
-#define GL_DRAW_BUFFER6                   0x882B
-#define GL_DRAW_BUFFER7                   0x882C
-#define GL_DRAW_BUFFER8                   0x882D
-#define GL_DRAW_BUFFER9                   0x882E
-#define GL_DRAW_BUFFER10                  0x882F
-#define GL_DRAW_BUFFER11                  0x8830
-#define GL_DRAW_BUFFER12                  0x8831
-#define GL_DRAW_BUFFER13                  0x8832
-#define GL_DRAW_BUFFER14                  0x8833
-#define GL_DRAW_BUFFER15                  0x8834
-#define GL_BLEND_EQUATION_ALPHA           0x883D
-#define GL_MAX_VERTEX_ATTRIBS             0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
-#define GL_FRAGMENT_SHADER                0x8B30
-#define GL_VERTEX_SHADER                  0x8B31
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  0x8B4A
-#define GL_MAX_VARYING_FLOATS             0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_SHADER_TYPE                    0x8B4F
-#define GL_FLOAT_VEC2                     0x8B50
-#define GL_FLOAT_VEC3                     0x8B51
-#define GL_FLOAT_VEC4                     0x8B52
-#define GL_INT_VEC2                       0x8B53
-#define GL_INT_VEC3                       0x8B54
-#define GL_INT_VEC4                       0x8B55
-#define GL_BOOL                           0x8B56
-#define GL_BOOL_VEC2                      0x8B57
-#define GL_BOOL_VEC3                      0x8B58
-#define GL_BOOL_VEC4                      0x8B59
-#define GL_FLOAT_MAT2                     0x8B5A
-#define GL_FLOAT_MAT3                     0x8B5B
-#define GL_FLOAT_MAT4                     0x8B5C
-#define GL_SAMPLER_1D                     0x8B5D
-#define GL_SAMPLER_2D                     0x8B5E
-#define GL_SAMPLER_3D                     0x8B5F
-#define GL_SAMPLER_CUBE                   0x8B60
-#define GL_SAMPLER_1D_SHADOW              0x8B61
-#define GL_SAMPLER_2D_SHADOW              0x8B62
-#define GL_DELETE_STATUS                  0x8B80
-#define GL_COMPILE_STATUS                 0x8B81
-#define GL_LINK_STATUS                    0x8B82
-#define GL_VALIDATE_STATUS                0x8B83
-#define GL_INFO_LOG_LENGTH                0x8B84
-#define GL_ATTACHED_SHADERS               0x8B85
-#define GL_ACTIVE_UNIFORMS                0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
-#define GL_SHADER_SOURCE_LENGTH           0x8B88
-#define GL_ACTIVE_ATTRIBUTES              0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
-#define GL_CURRENT_PROGRAM                0x8B8D
-#define GL_POINT_SPRITE_COORD_ORIGIN      0x8CA0
-#define GL_LOWER_LEFT                     0x8CA1
-#define GL_UPPER_LEFT                     0x8CA2
-#define GL_STENCIL_BACK_REF               0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
-#endif
-
-#ifndef GL_VERSION_2_0_DEPRECATED
-#define GL_VERTEX_PROGRAM_TWO_SIDE        0x8643
-#define GL_POINT_SPRITE                   0x8861
-#define GL_COORD_REPLACE                  0x8862
-#define GL_MAX_TEXTURE_COORDS             0x8871
-#endif
-
-#ifndef GL_VERSION_2_1
-#define GL_PIXEL_PACK_BUFFER              0x88EB
-#define GL_PIXEL_UNPACK_BUFFER            0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING      0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING    0x88EF
-#define GL_FLOAT_MAT2x3                   0x8B65
-#define GL_FLOAT_MAT2x4                   0x8B66
-#define GL_FLOAT_MAT3x2                   0x8B67
-#define GL_FLOAT_MAT3x4                   0x8B68
-#define GL_FLOAT_MAT4x2                   0x8B69
-#define GL_FLOAT_MAT4x3                   0x8B6A
-#define GL_SRGB                           0x8C40
-#define GL_SRGB8                          0x8C41
-#define GL_SRGB_ALPHA                     0x8C42
-#define GL_SRGB8_ALPHA8                   0x8C43
-#define GL_COMPRESSED_SRGB                0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA          0x8C49
-#endif
-
-#ifndef GL_VERSION_2_1_DEPRECATED
-#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
-#define GL_SLUMINANCE_ALPHA               0x8C44
-#define GL_SLUMINANCE8_ALPHA8             0x8C45
-#define GL_SLUMINANCE                     0x8C46
-#define GL_SLUMINANCE8                    0x8C47
-#define GL_COMPRESSED_SLUMINANCE          0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA    0x8C4B
-#endif
-
-#ifndef GL_VERSION_3_0
-#define GL_COMPARE_REF_TO_TEXTURE         0x884E
-#define GL_CLIP_DISTANCE0                 0x3000
-#define GL_CLIP_DISTANCE1                 0x3001
-#define GL_CLIP_DISTANCE2                 0x3002
-#define GL_CLIP_DISTANCE3                 0x3003
-#define GL_CLIP_DISTANCE4                 0x3004
-#define GL_CLIP_DISTANCE5                 0x3005
-#define GL_CLIP_DISTANCE6                 0x3006
-#define GL_CLIP_DISTANCE7                 0x3007
-#define GL_MAX_CLIP_DISTANCES             0x0D32
-#define GL_MAJOR_VERSION                  0x821B
-#define GL_MINOR_VERSION                  0x821C
-#define GL_NUM_EXTENSIONS                 0x821D
-#define GL_CONTEXT_FLAGS                  0x821E
-#define GL_DEPTH_BUFFER                   0x8223
-#define GL_STENCIL_BUFFER                 0x8224
-#define GL_COMPRESSED_RED                 0x8225
-#define GL_COMPRESSED_RG                  0x8226
-#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
-#define GL_RGBA32F                        0x8814
-#define GL_RGB32F                         0x8815
-#define GL_RGBA16F                        0x881A
-#define GL_RGB16F                         0x881B
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER    0x88FD
-#define GL_MAX_ARRAY_TEXTURE_LAYERS       0x88FF
-#define GL_MIN_PROGRAM_TEXEL_OFFSET       0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET       0x8905
-#define GL_CLAMP_READ_COLOR               0x891C
-#define GL_FIXED_ONLY                     0x891D
-#define GL_MAX_VARYING_COMPONENTS         0x8B4B
-#define GL_TEXTURE_1D_ARRAY               0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY         0x8C19
-#define GL_TEXTURE_2D_ARRAY               0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY         0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY       0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY       0x8C1D
-#define GL_R11F_G11F_B10F                 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV   0x8C3B
-#define GL_RGB9_E5                        0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV       0x8C3E
-#define GL_TEXTURE_SHARED_SIZE            0x8C3F
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS    0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
-#define GL_PRIMITIVES_GENERATED           0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
-#define GL_RASTERIZER_DISCARD             0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS            0x8C8C
-#define GL_SEPARATE_ATTRIBS               0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER      0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
-#define GL_RGBA32UI                       0x8D70
-#define GL_RGB32UI                        0x8D71
-#define GL_RGBA16UI                       0x8D76
-#define GL_RGB16UI                        0x8D77
-#define GL_RGBA8UI                        0x8D7C
-#define GL_RGB8UI                         0x8D7D
-#define GL_RGBA32I                        0x8D82
-#define GL_RGB32I                         0x8D83
-#define GL_RGBA16I                        0x8D88
-#define GL_RGB16I                         0x8D89
-#define GL_RGBA8I                         0x8D8E
-#define GL_RGB8I                          0x8D8F
-#define GL_RED_INTEGER                    0x8D94
-#define GL_GREEN_INTEGER                  0x8D95
-#define GL_BLUE_INTEGER                   0x8D96
-#define GL_RGB_INTEGER                    0x8D98
-#define GL_RGBA_INTEGER                   0x8D99
-#define GL_BGR_INTEGER                    0x8D9A
-#define GL_BGRA_INTEGER                   0x8D9B
-#define GL_SAMPLER_1D_ARRAY               0x8DC0
-#define GL_SAMPLER_2D_ARRAY               0x8DC1
-#define GL_SAMPLER_1D_ARRAY_SHADOW        0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW        0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW            0x8DC5
-#define GL_UNSIGNED_INT_VEC2              0x8DC6
-#define GL_UNSIGNED_INT_VEC3              0x8DC7
-#define GL_UNSIGNED_INT_VEC4              0x8DC8
-#define GL_INT_SAMPLER_1D                 0x8DC9
-#define GL_INT_SAMPLER_2D                 0x8DCA
-#define GL_INT_SAMPLER_3D                 0x8DCB
-#define GL_INT_SAMPLER_CUBE               0x8DCC
-#define GL_INT_SAMPLER_1D_ARRAY           0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY           0x8DCF
-#define GL_UNSIGNED_INT_SAMPLER_1D        0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D        0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D        0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE      0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY  0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY  0x8DD7
-#define GL_QUERY_WAIT                     0x8E13
-#define GL_QUERY_NO_WAIT                  0x8E14
-#define GL_QUERY_BY_REGION_WAIT           0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT        0x8E16
-#define GL_BUFFER_ACCESS_FLAGS            0x911F
-#define GL_BUFFER_MAP_LENGTH              0x9120
-#define GL_BUFFER_MAP_OFFSET              0x9121
-/* Reuse tokens from ARB_depth_buffer_float */
-/* reuse GL_DEPTH_COMPONENT32F */
-/* reuse GL_DEPTH32F_STENCIL8 */
-/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */
-/* Reuse tokens from ARB_framebuffer_object */
-/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
-/* reuse GL_FRAMEBUFFER_DEFAULT */
-/* reuse GL_FRAMEBUFFER_UNDEFINED */
-/* reuse GL_DEPTH_STENCIL_ATTACHMENT */
-/* reuse GL_INDEX */
-/* reuse GL_MAX_RENDERBUFFER_SIZE */
-/* reuse GL_DEPTH_STENCIL */
-/* reuse GL_UNSIGNED_INT_24_8 */
-/* reuse GL_DEPTH24_STENCIL8 */
-/* reuse GL_TEXTURE_STENCIL_SIZE */
-/* reuse GL_TEXTURE_RED_TYPE */
-/* reuse GL_TEXTURE_GREEN_TYPE */
-/* reuse GL_TEXTURE_BLUE_TYPE */
-/* reuse GL_TEXTURE_ALPHA_TYPE */
-/* reuse GL_TEXTURE_DEPTH_TYPE */
-/* reuse GL_UNSIGNED_NORMALIZED */
-/* reuse GL_FRAMEBUFFER_BINDING */
-/* reuse GL_DRAW_FRAMEBUFFER_BINDING */
-/* reuse GL_RENDERBUFFER_BINDING */
-/* reuse GL_READ_FRAMEBUFFER */
-/* reuse GL_DRAW_FRAMEBUFFER */
-/* reuse GL_READ_FRAMEBUFFER_BINDING */
-/* reuse GL_RENDERBUFFER_SAMPLES */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
-/* reuse GL_FRAMEBUFFER_COMPLETE */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
-/* reuse GL_FRAMEBUFFER_UNSUPPORTED */
-/* reuse GL_MAX_COLOR_ATTACHMENTS */
-/* reuse GL_COLOR_ATTACHMENT0 */
-/* reuse GL_COLOR_ATTACHMENT1 */
-/* reuse GL_COLOR_ATTACHMENT2 */
-/* reuse GL_COLOR_ATTACHMENT3 */
-/* reuse GL_COLOR_ATTACHMENT4 */
-/* reuse GL_COLOR_ATTACHMENT5 */
-/* reuse GL_COLOR_ATTACHMENT6 */
-/* reuse GL_COLOR_ATTACHMENT7 */
-/* reuse GL_COLOR_ATTACHMENT8 */
-/* reuse GL_COLOR_ATTACHMENT9 */
-/* reuse GL_COLOR_ATTACHMENT10 */
-/* reuse GL_COLOR_ATTACHMENT11 */
-/* reuse GL_COLOR_ATTACHMENT12 */
-/* reuse GL_COLOR_ATTACHMENT13 */
-/* reuse GL_COLOR_ATTACHMENT14 */
-/* reuse GL_COLOR_ATTACHMENT15 */
-/* reuse GL_DEPTH_ATTACHMENT */
-/* reuse GL_STENCIL_ATTACHMENT */
-/* reuse GL_FRAMEBUFFER */
-/* reuse GL_RENDERBUFFER */
-/* reuse GL_RENDERBUFFER_WIDTH */
-/* reuse GL_RENDERBUFFER_HEIGHT */
-/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */
-/* reuse GL_STENCIL_INDEX1 */
-/* reuse GL_STENCIL_INDEX4 */
-/* reuse GL_STENCIL_INDEX8 */
-/* reuse GL_STENCIL_INDEX16 */
-/* reuse GL_RENDERBUFFER_RED_SIZE */
-/* reuse GL_RENDERBUFFER_GREEN_SIZE */
-/* reuse GL_RENDERBUFFER_BLUE_SIZE */
-/* reuse GL_RENDERBUFFER_ALPHA_SIZE */
-/* reuse GL_RENDERBUFFER_DEPTH_SIZE */
-/* reuse GL_RENDERBUFFER_STENCIL_SIZE */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
-/* reuse GL_MAX_SAMPLES */
-/* Reuse tokens from ARB_framebuffer_sRGB */
-/* reuse GL_FRAMEBUFFER_SRGB */
-/* Reuse tokens from ARB_half_float_vertex */
-/* reuse GL_HALF_FLOAT */
-/* Reuse tokens from ARB_map_buffer_range */
-/* reuse GL_MAP_READ_BIT */
-/* reuse GL_MAP_WRITE_BIT */
-/* reuse GL_MAP_INVALIDATE_RANGE_BIT */
-/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */
-/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */
-/* reuse GL_MAP_UNSYNCHRONIZED_BIT */
-/* Reuse tokens from ARB_texture_compression_rgtc */
-/* reuse GL_COMPRESSED_RED_RGTC1 */
-/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */
-/* reuse GL_COMPRESSED_RG_RGTC2 */
-/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */
-/* Reuse tokens from ARB_texture_rg */
-/* reuse GL_RG */
-/* reuse GL_RG_INTEGER */
-/* reuse GL_R8 */
-/* reuse GL_R16 */
-/* reuse GL_RG8 */
-/* reuse GL_RG16 */
-/* reuse GL_R16F */
-/* reuse GL_R32F */
-/* reuse GL_RG16F */
-/* reuse GL_RG32F */
-/* reuse GL_R8I */
-/* reuse GL_R8UI */
-/* reuse GL_R16I */
-/* reuse GL_R16UI */
-/* reuse GL_R32I */
-/* reuse GL_R32UI */
-/* reuse GL_RG8I */
-/* reuse GL_RG8UI */
-/* reuse GL_RG16I */
-/* reuse GL_RG16UI */
-/* reuse GL_RG32I */
-/* reuse GL_RG32UI */
-/* Reuse tokens from ARB_vertex_array_object */
-/* reuse GL_VERTEX_ARRAY_BINDING */
-#endif
-
-#ifndef GL_VERSION_3_0_DEPRECATED
-#define GL_CLAMP_VERTEX_COLOR             0x891A
-#define GL_CLAMP_FRAGMENT_COLOR           0x891B
-#define GL_ALPHA_INTEGER                  0x8D97
-/* Reuse tokens from ARB_framebuffer_object */
-/* reuse GL_TEXTURE_LUMINANCE_TYPE */
-/* reuse GL_TEXTURE_INTENSITY_TYPE */
-#endif
-
-#ifndef GL_VERSION_3_1
-#define GL_SAMPLER_2D_RECT                0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW         0x8B64
-#define GL_SAMPLER_BUFFER                 0x8DC2
-#define GL_INT_SAMPLER_2D_RECT            0x8DCD
-#define GL_INT_SAMPLER_BUFFER             0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT   0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER    0x8DD8
-#define GL_TEXTURE_BUFFER                 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE        0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER         0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT          0x8C2E
-#define GL_TEXTURE_RECTANGLE              0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE      0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE        0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE     0x84F8
-#define GL_RED_SNORM                      0x8F90
-#define GL_RG_SNORM                       0x8F91
-#define GL_RGB_SNORM                      0x8F92
-#define GL_RGBA_SNORM                     0x8F93
-#define GL_R8_SNORM                       0x8F94
-#define GL_RG8_SNORM                      0x8F95
-#define GL_RGB8_SNORM                     0x8F96
-#define GL_RGBA8_SNORM                    0x8F97
-#define GL_R16_SNORM                      0x8F98
-#define GL_RG16_SNORM                     0x8F99
-#define GL_RGB16_SNORM                    0x8F9A
-#define GL_RGBA16_SNORM                   0x8F9B
-#define GL_SIGNED_NORMALIZED              0x8F9C
-#define GL_PRIMITIVE_RESTART              0x8F9D
-#define GL_PRIMITIVE_RESTART_INDEX        0x8F9E
-/* Reuse tokens from ARB_copy_buffer */
-/* reuse GL_COPY_READ_BUFFER */
-/* reuse GL_COPY_WRITE_BUFFER */
-/* Reuse tokens from ARB_draw_instanced (none) */
-/* Reuse tokens from ARB_uniform_buffer_object */
-/* reuse GL_UNIFORM_BUFFER */
-/* reuse GL_UNIFORM_BUFFER_BINDING */
-/* reuse GL_UNIFORM_BUFFER_START */
-/* reuse GL_UNIFORM_BUFFER_SIZE */
-/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */
-/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */
-/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */
-/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */
-/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */
-/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */
-/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */
-/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */
-/* reuse GL_ACTIVE_UNIFORM_BLOCKS */
-/* reuse GL_UNIFORM_TYPE */
-/* reuse GL_UNIFORM_SIZE */
-/* reuse GL_UNIFORM_NAME_LENGTH */
-/* reuse GL_UNIFORM_BLOCK_INDEX */
-/* reuse GL_UNIFORM_OFFSET */
-/* reuse GL_UNIFORM_ARRAY_STRIDE */
-/* reuse GL_UNIFORM_MATRIX_STRIDE */
-/* reuse GL_UNIFORM_IS_ROW_MAJOR */
-/* reuse GL_UNIFORM_BLOCK_BINDING */
-/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */
-/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */
-/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */
-/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */
-/* reuse GL_INVALID_INDEX */
-#endif
-
-#ifndef GL_VERSION_3_2
-#define GL_CONTEXT_CORE_PROFILE_BIT       0x00000001
-#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
-#define GL_LINES_ADJACENCY                0x000A
-#define GL_LINE_STRIP_ADJACENCY           0x000B
-#define GL_TRIANGLES_ADJACENCY            0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY       0x000D
-#define GL_PROGRAM_POINT_SIZE             0x8642
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
-#define GL_GEOMETRY_SHADER                0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT          0x8916
-#define GL_GEOMETRY_INPUT_TYPE            0x8917
-#define GL_GEOMETRY_OUTPUT_TYPE           0x8918
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES   0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
-#define GL_MAX_VERTEX_OUTPUT_COMPONENTS   0x9122
-#define GL_MAX_GEOMETRY_INPUT_COMPONENTS  0x9123
-#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
-#define GL_MAX_FRAGMENT_INPUT_COMPONENTS  0x9125
-#define GL_CONTEXT_PROFILE_MASK           0x9126
-/* reuse GL_MAX_VARYING_COMPONENTS */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
-/* Reuse tokens from ARB_depth_clamp */
-/* reuse GL_DEPTH_CLAMP */
-/* Reuse tokens from ARB_draw_elements_base_vertex (none) */
-/* Reuse tokens from ARB_fragment_coord_conventions (none) */
-/* Reuse tokens from ARB_provoking_vertex */
-/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
-/* reuse GL_FIRST_VERTEX_CONVENTION */
-/* reuse GL_LAST_VERTEX_CONVENTION */
-/* reuse GL_PROVOKING_VERTEX */
-/* Reuse tokens from ARB_seamless_cube_map */
-/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */
-/* Reuse tokens from ARB_sync */
-/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */
-/* reuse GL_OBJECT_TYPE */
-/* reuse GL_SYNC_CONDITION */
-/* reuse GL_SYNC_STATUS */
-/* reuse GL_SYNC_FLAGS */
-/* reuse GL_SYNC_FENCE */
-/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */
-/* reuse GL_UNSIGNALED */
-/* reuse GL_SIGNALED */
-/* reuse GL_ALREADY_SIGNALED */
-/* reuse GL_TIMEOUT_EXPIRED */
-/* reuse GL_CONDITION_SATISFIED */
-/* reuse GL_WAIT_FAILED */
-/* reuse GL_TIMEOUT_IGNORED */
-/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */
-/* reuse GL_TIMEOUT_IGNORED */
-/* Reuse tokens from ARB_texture_multisample */
-/* reuse GL_SAMPLE_POSITION */
-/* reuse GL_SAMPLE_MASK */
-/* reuse GL_SAMPLE_MASK_VALUE */
-/* reuse GL_MAX_SAMPLE_MASK_WORDS */
-/* reuse GL_TEXTURE_2D_MULTISAMPLE */
-/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */
-/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */
-/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_TEXTURE_SAMPLES */
-/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */
-/* reuse GL_SAMPLER_2D_MULTISAMPLE */
-/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */
-/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */
-/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
-/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */
-/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */
-/* reuse GL_MAX_INTEGER_SAMPLES */
-/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */
-#endif
-
-#ifndef GL_VERSION_3_3
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR    0x88FE
-/* Reuse tokens from ARB_blend_func_extended */
-/* reuse GL_SRC1_COLOR */
-/* reuse GL_ONE_MINUS_SRC1_COLOR */
-/* reuse GL_ONE_MINUS_SRC1_ALPHA */
-/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */
-/* Reuse tokens from ARB_explicit_attrib_location (none) */
-/* Reuse tokens from ARB_occlusion_query2 */
-/* reuse GL_ANY_SAMPLES_PASSED */
-/* Reuse tokens from ARB_sampler_objects */
-/* reuse GL_SAMPLER_BINDING */
-/* Reuse tokens from ARB_shader_bit_encoding (none) */
-/* Reuse tokens from ARB_texture_rgb10_a2ui */
-/* reuse GL_RGB10_A2UI */
-/* Reuse tokens from ARB_texture_swizzle */
-/* reuse GL_TEXTURE_SWIZZLE_R */
-/* reuse GL_TEXTURE_SWIZZLE_G */
-/* reuse GL_TEXTURE_SWIZZLE_B */
-/* reuse GL_TEXTURE_SWIZZLE_A */
-/* reuse GL_TEXTURE_SWIZZLE_RGBA */
-/* Reuse tokens from ARB_timer_query */
-/* reuse GL_TIME_ELAPSED */
-/* reuse GL_TIMESTAMP */
-/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */
-/* reuse GL_INT_2_10_10_10_REV */
-#endif
-
-#ifndef GL_VERSION_4_0
-#define GL_SAMPLE_SHADING                 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE       0x8C37
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
-#define GL_TEXTURE_CUBE_MAP_ARRAY         0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY   0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY         0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW  0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY     0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
-/* Reuse tokens from ARB_texture_query_lod (none) */
-/* Reuse tokens from ARB_draw_buffers_blend (none) */
-/* Reuse tokens from ARB_draw_indirect */
-/* reuse GL_DRAW_INDIRECT_BUFFER */
-/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */
-/* Reuse tokens from ARB_gpu_shader5 */
-/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */
-/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */
-/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */
-/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */
-/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */
-/* reuse GL_MAX_VERTEX_STREAMS */
-/* Reuse tokens from ARB_gpu_shader_fp64 */
-/* reuse GL_DOUBLE_VEC2 */
-/* reuse GL_DOUBLE_VEC3 */
-/* reuse GL_DOUBLE_VEC4 */
-/* reuse GL_DOUBLE_MAT2 */
-/* reuse GL_DOUBLE_MAT3 */
-/* reuse GL_DOUBLE_MAT4 */
-/* reuse GL_DOUBLE_MAT2x3 */
-/* reuse GL_DOUBLE_MAT2x4 */
-/* reuse GL_DOUBLE_MAT3x2 */
-/* reuse GL_DOUBLE_MAT3x4 */
-/* reuse GL_DOUBLE_MAT4x2 */
-/* reuse GL_DOUBLE_MAT4x3 */
-/* Reuse tokens from ARB_shader_subroutine */
-/* reuse GL_ACTIVE_SUBROUTINES */
-/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */
-/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */
-/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */
-/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */
-/* reuse GL_MAX_SUBROUTINES */
-/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */
-/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */
-/* reuse GL_COMPATIBLE_SUBROUTINES */
-/* Reuse tokens from ARB_tessellation_shader */
-/* reuse GL_PATCHES */
-/* reuse GL_PATCH_VERTICES */
-/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */
-/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */
-/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */
-/* reuse GL_TESS_GEN_MODE */
-/* reuse GL_TESS_GEN_SPACING */
-/* reuse GL_TESS_GEN_VERTEX_ORDER */
-/* reuse GL_TESS_GEN_POINT_MODE */
-/* reuse GL_ISOLINES */
-/* reuse GL_FRACTIONAL_ODD */
-/* reuse GL_FRACTIONAL_EVEN */
-/* reuse GL_MAX_PATCH_VERTICES */
-/* reuse GL_MAX_TESS_GEN_LEVEL */
-/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */
-/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */
-/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_PATCH_COMPONENTS */
-/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */
-/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */
-/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */
-/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */
-/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */
-/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */
-/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */
-/* reuse GL_TESS_EVALUATION_SHADER */
-/* reuse GL_TESS_CONTROL_SHADER */
-/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */
-/* Reuse tokens from ARB_transform_feedback2 */
-/* reuse GL_TRANSFORM_FEEDBACK */
-/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
-/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
-/* reuse GL_TRANSFORM_FEEDBACK_BINDING */
-/* Reuse tokens from ARB_transform_feedback3 */
-/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */
-/* reuse GL_MAX_VERTEX_STREAMS */
-#endif
-
-#ifndef GL_VERSION_4_1
-/* Reuse tokens from ARB_ES2_compatibility */
-/* reuse GL_FIXED */
-/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */
-/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */
-/* reuse GL_LOW_FLOAT */
-/* reuse GL_MEDIUM_FLOAT */
-/* reuse GL_HIGH_FLOAT */
-/* reuse GL_LOW_INT */
-/* reuse GL_MEDIUM_INT */
-/* reuse GL_HIGH_INT */
-/* reuse GL_SHADER_COMPILER */
-/* reuse GL_NUM_SHADER_BINARY_FORMATS */
-/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */
-/* reuse GL_MAX_VARYING_VECTORS */
-/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */
-/* Reuse tokens from ARB_get_program_binary */
-/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
-/* reuse GL_PROGRAM_BINARY_LENGTH */
-/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */
-/* reuse GL_PROGRAM_BINARY_FORMATS */
-/* Reuse tokens from ARB_separate_shader_objects */
-/* reuse GL_VERTEX_SHADER_BIT */
-/* reuse GL_FRAGMENT_SHADER_BIT */
-/* reuse GL_GEOMETRY_SHADER_BIT */
-/* reuse GL_TESS_CONTROL_SHADER_BIT */
-/* reuse GL_TESS_EVALUATION_SHADER_BIT */
-/* reuse GL_ALL_SHADER_BITS */
-/* reuse GL_PROGRAM_SEPARABLE */
-/* reuse GL_ACTIVE_PROGRAM */
-/* reuse GL_PROGRAM_PIPELINE_BINDING */
-/* Reuse tokens from ARB_shader_precision (none) */
-/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */
-/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */
-/* reuse GL_MAX_VIEWPORTS */
-/* reuse GL_VIEWPORT_SUBPIXEL_BITS */
-/* reuse GL_VIEWPORT_BOUNDS_RANGE */
-/* reuse GL_LAYER_PROVOKING_VERTEX */
-/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */
-/* reuse GL_UNDEFINED_VERTEX */
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_TEXTURE0_ARB                   0x84C0
-#define GL_TEXTURE1_ARB                   0x84C1
-#define GL_TEXTURE2_ARB                   0x84C2
-#define GL_TEXTURE3_ARB                   0x84C3
-#define GL_TEXTURE4_ARB                   0x84C4
-#define GL_TEXTURE5_ARB                   0x84C5
-#define GL_TEXTURE6_ARB                   0x84C6
-#define GL_TEXTURE7_ARB                   0x84C7
-#define GL_TEXTURE8_ARB                   0x84C8
-#define GL_TEXTURE9_ARB                   0x84C9
-#define GL_TEXTURE10_ARB                  0x84CA
-#define GL_TEXTURE11_ARB                  0x84CB
-#define GL_TEXTURE12_ARB                  0x84CC
-#define GL_TEXTURE13_ARB                  0x84CD
-#define GL_TEXTURE14_ARB                  0x84CE
-#define GL_TEXTURE15_ARB                  0x84CF
-#define GL_TEXTURE16_ARB                  0x84D0
-#define GL_TEXTURE17_ARB                  0x84D1
-#define GL_TEXTURE18_ARB                  0x84D2
-#define GL_TEXTURE19_ARB                  0x84D3
-#define GL_TEXTURE20_ARB                  0x84D4
-#define GL_TEXTURE21_ARB                  0x84D5
-#define GL_TEXTURE22_ARB                  0x84D6
-#define GL_TEXTURE23_ARB                  0x84D7
-#define GL_TEXTURE24_ARB                  0x84D8
-#define GL_TEXTURE25_ARB                  0x84D9
-#define GL_TEXTURE26_ARB                  0x84DA
-#define GL_TEXTURE27_ARB                  0x84DB
-#define GL_TEXTURE28_ARB                  0x84DC
-#define GL_TEXTURE29_ARB                  0x84DD
-#define GL_TEXTURE30_ARB                  0x84DE
-#define GL_TEXTURE31_ARB                  0x84DF
-#define GL_ACTIVE_TEXTURE_ARB             0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB      0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB          0x84E2
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB   0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX_ARB     0x84E6
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_MULTISAMPLE_ARB                0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB   0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB        0x809F
-#define GL_SAMPLE_COVERAGE_ARB            0x80A0
-#define GL_SAMPLE_BUFFERS_ARB             0x80A8
-#define GL_SAMPLES_ARB                    0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB      0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB     0x80AB
-#define GL_MULTISAMPLE_BIT_ARB            0x20000000
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_NORMAL_MAP_ARB                 0x8511
-#define GL_REFLECTION_MAP_ARB             0x8512
-#define GL_TEXTURE_CUBE_MAP_ARB           0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARB   0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB     0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB  0x851C
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_COMPRESSED_ALPHA_ARB           0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB       0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB       0x84EC
-#define GL_COMPRESSED_RGB_ARB             0x84ED
-#define GL_COMPRESSED_RGBA_ARB            0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB   0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB         0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_ARB            0x812D
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_POINT_SIZE_MIN_ARB             0x8126
-#define GL_POINT_SIZE_MAX_ARB             0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_ARB  0x8128
-#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_MAX_VERTEX_UNITS_ARB           0x86A4
-#define GL_ACTIVE_VERTEX_UNITS_ARB        0x86A5
-#define GL_WEIGHT_SUM_UNITY_ARB           0x86A6
-#define GL_VERTEX_BLEND_ARB               0x86A7
-#define GL_CURRENT_WEIGHT_ARB             0x86A8
-#define GL_WEIGHT_ARRAY_TYPE_ARB          0x86A9
-#define GL_WEIGHT_ARRAY_STRIDE_ARB        0x86AA
-#define GL_WEIGHT_ARRAY_SIZE_ARB          0x86AB
-#define GL_WEIGHT_ARRAY_POINTER_ARB       0x86AC
-#define GL_WEIGHT_ARRAY_ARB               0x86AD
-#define GL_MODELVIEW0_ARB                 0x1700
-#define GL_MODELVIEW1_ARB                 0x850A
-#define GL_MODELVIEW2_ARB                 0x8722
-#define GL_MODELVIEW3_ARB                 0x8723
-#define GL_MODELVIEW4_ARB                 0x8724
-#define GL_MODELVIEW5_ARB                 0x8725
-#define GL_MODELVIEW6_ARB                 0x8726
-#define GL_MODELVIEW7_ARB                 0x8727
-#define GL_MODELVIEW8_ARB                 0x8728
-#define GL_MODELVIEW9_ARB                 0x8729
-#define GL_MODELVIEW10_ARB                0x872A
-#define GL_MODELVIEW11_ARB                0x872B
-#define GL_MODELVIEW12_ARB                0x872C
-#define GL_MODELVIEW13_ARB                0x872D
-#define GL_MODELVIEW14_ARB                0x872E
-#define GL_MODELVIEW15_ARB                0x872F
-#define GL_MODELVIEW16_ARB                0x8730
-#define GL_MODELVIEW17_ARB                0x8731
-#define GL_MODELVIEW18_ARB                0x8732
-#define GL_MODELVIEW19_ARB                0x8733
-#define GL_MODELVIEW20_ARB                0x8734
-#define GL_MODELVIEW21_ARB                0x8735
-#define GL_MODELVIEW22_ARB                0x8736
-#define GL_MODELVIEW23_ARB                0x8737
-#define GL_MODELVIEW24_ARB                0x8738
-#define GL_MODELVIEW25_ARB                0x8739
-#define GL_MODELVIEW26_ARB                0x873A
-#define GL_MODELVIEW27_ARB                0x873B
-#define GL_MODELVIEW28_ARB                0x873C
-#define GL_MODELVIEW29_ARB                0x873D
-#define GL_MODELVIEW30_ARB                0x873E
-#define GL_MODELVIEW31_ARB                0x873F
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_MATRIX_PALETTE_ARB             0x8840
-#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
-#define GL_MAX_PALETTE_MATRICES_ARB       0x8842
-#define GL_CURRENT_PALETTE_MATRIX_ARB     0x8843
-#define GL_MATRIX_INDEX_ARRAY_ARB         0x8844
-#define GL_CURRENT_MATRIX_INDEX_ARB       0x8845
-#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB    0x8846
-#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB    0x8847
-#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB  0x8848
-#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_COMBINE_ARB                    0x8570
-#define GL_COMBINE_RGB_ARB                0x8571
-#define GL_COMBINE_ALPHA_ARB              0x8572
-#define GL_SOURCE0_RGB_ARB                0x8580
-#define GL_SOURCE1_RGB_ARB                0x8581
-#define GL_SOURCE2_RGB_ARB                0x8582
-#define GL_SOURCE0_ALPHA_ARB              0x8588
-#define GL_SOURCE1_ALPHA_ARB              0x8589
-#define GL_SOURCE2_ALPHA_ARB              0x858A
-#define GL_OPERAND0_RGB_ARB               0x8590
-#define GL_OPERAND1_RGB_ARB               0x8591
-#define GL_OPERAND2_RGB_ARB               0x8592
-#define GL_OPERAND0_ALPHA_ARB             0x8598
-#define GL_OPERAND1_ALPHA_ARB             0x8599
-#define GL_OPERAND2_ALPHA_ARB             0x859A
-#define GL_RGB_SCALE_ARB                  0x8573
-#define GL_ADD_SIGNED_ARB                 0x8574
-#define GL_INTERPOLATE_ARB                0x8575
-#define GL_SUBTRACT_ARB                   0x84E7
-#define GL_CONSTANT_ARB                   0x8576
-#define GL_PRIMARY_COLOR_ARB              0x8577
-#define GL_PREVIOUS_ARB                   0x8578
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_DOT3_RGB_ARB                   0x86AE
-#define GL_DOT3_RGBA_ARB                  0x86AF
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_ARB            0x8370
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_DEPTH_COMPONENT16_ARB          0x81A5
-#define GL_DEPTH_COMPONENT24_ARB          0x81A6
-#define GL_DEPTH_COMPONENT32_ARB          0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB         0x884A
-#define GL_DEPTH_TEXTURE_MODE_ARB         0x884B
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_TEXTURE_COMPARE_MODE_ARB       0x884C
-#define GL_TEXTURE_COMPARE_FUNC_ARB       0x884D
-#define GL_COMPARE_R_TO_TEXTURE_ARB       0x884E
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
-#endif
-
-#ifndef GL_ARB_window_pos
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_COLOR_SUM_ARB                  0x8458
-#define GL_VERTEX_PROGRAM_ARB             0x8620
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB   0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB   0x8625
-#define GL_CURRENT_VERTEX_ATTRIB_ARB      0x8626
-#define GL_PROGRAM_LENGTH_ARB             0x8627
-#define GL_PROGRAM_STRING_ARB             0x8628
-#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
-#define GL_MAX_PROGRAM_MATRICES_ARB       0x862F
-#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
-#define GL_CURRENT_MATRIX_ARB             0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB  0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB    0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
-#define GL_PROGRAM_ERROR_POSITION_ARB     0x864B
-#define GL_PROGRAM_BINDING_ARB            0x8677
-#define GL_MAX_VERTEX_ATTRIBS_ARB         0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
-#define GL_PROGRAM_ERROR_STRING_ARB       0x8874
-#define GL_PROGRAM_FORMAT_ASCII_ARB       0x8875
-#define GL_PROGRAM_FORMAT_ARB             0x8876
-#define GL_PROGRAM_INSTRUCTIONS_ARB       0x88A0
-#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB   0x88A1
-#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
-#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
-#define GL_PROGRAM_TEMPORARIES_ARB        0x88A4
-#define GL_MAX_PROGRAM_TEMPORARIES_ARB    0x88A5
-#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
-#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
-#define GL_PROGRAM_PARAMETERS_ARB         0x88A8
-#define GL_MAX_PROGRAM_PARAMETERS_ARB     0x88A9
-#define GL_PROGRAM_NATIVE_PARAMETERS_ARB  0x88AA
-#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
-#define GL_PROGRAM_ATTRIBS_ARB            0x88AC
-#define GL_MAX_PROGRAM_ATTRIBS_ARB        0x88AD
-#define GL_PROGRAM_NATIVE_ATTRIBS_ARB     0x88AE
-#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
-#define GL_PROGRAM_ADDRESS_REGISTERS_ARB  0x88B0
-#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
-#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
-#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
-#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
-#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
-#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
-#define GL_TRANSPOSE_CURRENT_MATRIX_ARB   0x88B7
-#define GL_MATRIX0_ARB                    0x88C0
-#define GL_MATRIX1_ARB                    0x88C1
-#define GL_MATRIX2_ARB                    0x88C2
-#define GL_MATRIX3_ARB                    0x88C3
-#define GL_MATRIX4_ARB                    0x88C4
-#define GL_MATRIX5_ARB                    0x88C5
-#define GL_MATRIX6_ARB                    0x88C6
-#define GL_MATRIX7_ARB                    0x88C7
-#define GL_MATRIX8_ARB                    0x88C8
-#define GL_MATRIX9_ARB                    0x88C9
-#define GL_MATRIX10_ARB                   0x88CA
-#define GL_MATRIX11_ARB                   0x88CB
-#define GL_MATRIX12_ARB                   0x88CC
-#define GL_MATRIX13_ARB                   0x88CD
-#define GL_MATRIX14_ARB                   0x88CE
-#define GL_MATRIX15_ARB                   0x88CF
-#define GL_MATRIX16_ARB                   0x88D0
-#define GL_MATRIX17_ARB                   0x88D1
-#define GL_MATRIX18_ARB                   0x88D2
-#define GL_MATRIX19_ARB                   0x88D3
-#define GL_MATRIX20_ARB                   0x88D4
-#define GL_MATRIX21_ARB                   0x88D5
-#define GL_MATRIX22_ARB                   0x88D6
-#define GL_MATRIX23_ARB                   0x88D7
-#define GL_MATRIX24_ARB                   0x88D8
-#define GL_MATRIX25_ARB                   0x88D9
-#define GL_MATRIX26_ARB                   0x88DA
-#define GL_MATRIX27_ARB                   0x88DB
-#define GL_MATRIX28_ARB                   0x88DC
-#define GL_MATRIX29_ARB                   0x88DD
-#define GL_MATRIX30_ARB                   0x88DE
-#define GL_MATRIX31_ARB                   0x88DF
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_FRAGMENT_PROGRAM_ARB           0x8804
-#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB   0x8805
-#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB   0x8806
-#define GL_PROGRAM_TEX_INDIRECTIONS_ARB   0x8807
-#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
-#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
-#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
-#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
-#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
-#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
-#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
-#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
-#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
-#define GL_MAX_TEXTURE_COORDS_ARB         0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB    0x8872
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_BUFFER_SIZE_ARB                0x8764
-#define GL_BUFFER_USAGE_ARB               0x8765
-#define GL_ARRAY_BUFFER_ARB               0x8892
-#define GL_ELEMENT_ARRAY_BUFFER_ARB       0x8893
-#define GL_ARRAY_BUFFER_BINDING_ARB       0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
-#define GL_READ_ONLY_ARB                  0x88B8
-#define GL_WRITE_ONLY_ARB                 0x88B9
-#define GL_READ_WRITE_ARB                 0x88BA
-#define GL_BUFFER_ACCESS_ARB              0x88BB
-#define GL_BUFFER_MAPPED_ARB              0x88BC
-#define GL_BUFFER_MAP_POINTER_ARB         0x88BD
-#define GL_STREAM_DRAW_ARB                0x88E0
-#define GL_STREAM_READ_ARB                0x88E1
-#define GL_STREAM_COPY_ARB                0x88E2
-#define GL_STATIC_DRAW_ARB                0x88E4
-#define GL_STATIC_READ_ARB                0x88E5
-#define GL_STATIC_COPY_ARB                0x88E6
-#define GL_DYNAMIC_DRAW_ARB               0x88E8
-#define GL_DYNAMIC_READ_ARB               0x88E9
-#define GL_DYNAMIC_COPY_ARB               0x88EA
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_QUERY_COUNTER_BITS_ARB         0x8864
-#define GL_CURRENT_QUERY_ARB              0x8865
-#define GL_QUERY_RESULT_ARB               0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ARB     0x8867
-#define GL_SAMPLES_PASSED_ARB             0x8914
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_PROGRAM_OBJECT_ARB             0x8B40
-#define GL_SHADER_OBJECT_ARB              0x8B48
-#define GL_OBJECT_TYPE_ARB                0x8B4E
-#define GL_OBJECT_SUBTYPE_ARB             0x8B4F
-#define GL_FLOAT_VEC2_ARB                 0x8B50
-#define GL_FLOAT_VEC3_ARB                 0x8B51
-#define GL_FLOAT_VEC4_ARB                 0x8B52
-#define GL_INT_VEC2_ARB                   0x8B53
-#define GL_INT_VEC3_ARB                   0x8B54
-#define GL_INT_VEC4_ARB                   0x8B55
-#define GL_BOOL_ARB                       0x8B56
-#define GL_BOOL_VEC2_ARB                  0x8B57
-#define GL_BOOL_VEC3_ARB                  0x8B58
-#define GL_BOOL_VEC4_ARB                  0x8B59
-#define GL_FLOAT_MAT2_ARB                 0x8B5A
-#define GL_FLOAT_MAT3_ARB                 0x8B5B
-#define GL_FLOAT_MAT4_ARB                 0x8B5C
-#define GL_SAMPLER_1D_ARB                 0x8B5D
-#define GL_SAMPLER_2D_ARB                 0x8B5E
-#define GL_SAMPLER_3D_ARB                 0x8B5F
-#define GL_SAMPLER_CUBE_ARB               0x8B60
-#define GL_SAMPLER_1D_SHADOW_ARB          0x8B61
-#define GL_SAMPLER_2D_SHADOW_ARB          0x8B62
-#define GL_SAMPLER_2D_RECT_ARB            0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB     0x8B64
-#define GL_OBJECT_DELETE_STATUS_ARB       0x8B80
-#define GL_OBJECT_COMPILE_STATUS_ARB      0x8B81
-#define GL_OBJECT_LINK_STATUS_ARB         0x8B82
-#define GL_OBJECT_VALIDATE_STATUS_ARB     0x8B83
-#define GL_OBJECT_INFO_LOG_LENGTH_ARB     0x8B84
-#define GL_OBJECT_ATTACHED_OBJECTS_ARB    0x8B85
-#define GL_OBJECT_ACTIVE_UNIFORMS_ARB     0x8B86
-#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
-#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_VERTEX_SHADER_ARB              0x8B31
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
-#define GL_MAX_VARYING_FLOATS_ARB         0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
-#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB   0x8B89
-#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_FRAGMENT_SHADER_ARB            0x8B30
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_SHADING_LANGUAGE_VERSION_ARB   0x8B8C
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_POINT_SPRITE_ARB               0x8861
-#define GL_COORD_REPLACE_ARB              0x8862
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ARB           0x8824
-#define GL_DRAW_BUFFER0_ARB               0x8825
-#define GL_DRAW_BUFFER1_ARB               0x8826
-#define GL_DRAW_BUFFER2_ARB               0x8827
-#define GL_DRAW_BUFFER3_ARB               0x8828
-#define GL_DRAW_BUFFER4_ARB               0x8829
-#define GL_DRAW_BUFFER5_ARB               0x882A
-#define GL_DRAW_BUFFER6_ARB               0x882B
-#define GL_DRAW_BUFFER7_ARB               0x882C
-#define GL_DRAW_BUFFER8_ARB               0x882D
-#define GL_DRAW_BUFFER9_ARB               0x882E
-#define GL_DRAW_BUFFER10_ARB              0x882F
-#define GL_DRAW_BUFFER11_ARB              0x8830
-#define GL_DRAW_BUFFER12_ARB              0x8831
-#define GL_DRAW_BUFFER13_ARB              0x8832
-#define GL_DRAW_BUFFER14_ARB              0x8833
-#define GL_DRAW_BUFFER15_ARB              0x8834
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_ARB          0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_ARB  0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_ARB    0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_RGBA_FLOAT_MODE_ARB            0x8820
-#define GL_CLAMP_VERTEX_COLOR_ARB         0x891A
-#define GL_CLAMP_FRAGMENT_COLOR_ARB       0x891B
-#define GL_CLAMP_READ_COLOR_ARB           0x891C
-#define GL_FIXED_ONLY_ARB                 0x891D
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_HALF_FLOAT_ARB                 0x140B
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_TEXTURE_RED_TYPE_ARB           0x8C10
-#define GL_TEXTURE_GREEN_TYPE_ARB         0x8C11
-#define GL_TEXTURE_BLUE_TYPE_ARB          0x8C12
-#define GL_TEXTURE_ALPHA_TYPE_ARB         0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE_ARB     0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE_ARB     0x8C15
-#define GL_TEXTURE_DEPTH_TYPE_ARB         0x8C16
-#define GL_UNSIGNED_NORMALIZED_ARB        0x8C17
-#define GL_RGBA32F_ARB                    0x8814
-#define GL_RGB32F_ARB                     0x8815
-#define GL_ALPHA32F_ARB                   0x8816
-#define GL_INTENSITY32F_ARB               0x8817
-#define GL_LUMINANCE32F_ARB               0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB         0x8819
-#define GL_RGBA16F_ARB                    0x881A
-#define GL_RGB16F_ARB                     0x881B
-#define GL_ALPHA16F_ARB                   0x881C
-#define GL_INTENSITY16F_ARB               0x881D
-#define GL_LUMINANCE16F_ARB               0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB         0x881F
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_ARB          0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_ARB        0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_ARB  0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
-#endif
-
-#ifndef GL_ARB_depth_buffer_float
-#define GL_DEPTH_COMPONENT32F             0x8CAC
-#define GL_DEPTH32F_STENCIL8              0x8CAD
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-#endif
-
-#ifndef GL_ARB_draw_instanced
-#endif
-
-#ifndef GL_ARB_framebuffer_object
-#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
-#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
-#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
-#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
-#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
-#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
-#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
-#define GL_FRAMEBUFFER_DEFAULT            0x8218
-#define GL_FRAMEBUFFER_UNDEFINED          0x8219
-#define GL_DEPTH_STENCIL_ATTACHMENT       0x821A
-#define GL_MAX_RENDERBUFFER_SIZE          0x84E8
-#define GL_DEPTH_STENCIL                  0x84F9
-#define GL_UNSIGNED_INT_24_8              0x84FA
-#define GL_DEPTH24_STENCIL8               0x88F0
-#define GL_TEXTURE_STENCIL_SIZE           0x88F1
-#define GL_TEXTURE_RED_TYPE               0x8C10
-#define GL_TEXTURE_GREEN_TYPE             0x8C11
-#define GL_TEXTURE_BLUE_TYPE              0x8C12
-#define GL_TEXTURE_ALPHA_TYPE             0x8C13
-#define GL_TEXTURE_DEPTH_TYPE             0x8C16
-#define GL_UNSIGNED_NORMALIZED            0x8C17
-#define GL_FRAMEBUFFER_BINDING            0x8CA6
-#define GL_DRAW_FRAMEBUFFER_BINDING       GL_FRAMEBUFFER_BINDING
-#define GL_RENDERBUFFER_BINDING           0x8CA7
-#define GL_READ_FRAMEBUFFER               0x8CA8
-#define GL_DRAW_FRAMEBUFFER               0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING       0x8CAA
-#define GL_RENDERBUFFER_SAMPLES           0x8CAB
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE           0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED        0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS          0x8CDF
-#define GL_COLOR_ATTACHMENT0              0x8CE0
-#define GL_COLOR_ATTACHMENT1              0x8CE1
-#define GL_COLOR_ATTACHMENT2              0x8CE2
-#define GL_COLOR_ATTACHMENT3              0x8CE3
-#define GL_COLOR_ATTACHMENT4              0x8CE4
-#define GL_COLOR_ATTACHMENT5              0x8CE5
-#define GL_COLOR_ATTACHMENT6              0x8CE6
-#define GL_COLOR_ATTACHMENT7              0x8CE7
-#define GL_COLOR_ATTACHMENT8              0x8CE8
-#define GL_COLOR_ATTACHMENT9              0x8CE9
-#define GL_COLOR_ATTACHMENT10             0x8CEA
-#define GL_COLOR_ATTACHMENT11             0x8CEB
-#define GL_COLOR_ATTACHMENT12             0x8CEC
-#define GL_COLOR_ATTACHMENT13             0x8CED
-#define GL_COLOR_ATTACHMENT14             0x8CEE
-#define GL_COLOR_ATTACHMENT15             0x8CEF
-#define GL_DEPTH_ATTACHMENT               0x8D00
-#define GL_STENCIL_ATTACHMENT             0x8D20
-#define GL_FRAMEBUFFER                    0x8D40
-#define GL_RENDERBUFFER                   0x8D41
-#define GL_RENDERBUFFER_WIDTH             0x8D42
-#define GL_RENDERBUFFER_HEIGHT            0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
-#define GL_STENCIL_INDEX1                 0x8D46
-#define GL_STENCIL_INDEX4                 0x8D47
-#define GL_STENCIL_INDEX8                 0x8D48
-#define GL_STENCIL_INDEX16                0x8D49
-#define GL_RENDERBUFFER_RED_SIZE          0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE        0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE         0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
-#define GL_MAX_SAMPLES                    0x8D57
-#endif
-
-#ifndef GL_ARB_framebuffer_object_DEPRECATED
-#define GL_INDEX                          0x8222
-#define GL_TEXTURE_LUMINANCE_TYPE         0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE         0x8C15
-#endif
-
-#ifndef GL_ARB_framebuffer_sRGB
-#define GL_FRAMEBUFFER_SRGB               0x8DB9
-#endif
-
-#ifndef GL_ARB_geometry_shader4
-#define GL_LINES_ADJACENCY_ARB            0x000A
-#define GL_LINE_STRIP_ADJACENCY_ARB       0x000B
-#define GL_TRIANGLES_ADJACENCY_ARB        0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY_ARB   0x000D
-#define GL_PROGRAM_POINT_SIZE_ARB         0x8642
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
-#define GL_GEOMETRY_SHADER_ARB            0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT_ARB      0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_ARB        0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_ARB       0x8DDC
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
-/* reuse GL_MAX_VARYING_COMPONENTS */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
-#endif
-
-#ifndef GL_ARB_half_float_vertex
-#define GL_HALF_FLOAT                     0x140B
-#endif
-
-#ifndef GL_ARB_instanced_arrays
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
-#endif
-
-#ifndef GL_ARB_map_buffer_range
-#define GL_MAP_READ_BIT                   0x0001
-#define GL_MAP_WRITE_BIT                  0x0002
-#define GL_MAP_INVALIDATE_RANGE_BIT       0x0004
-#define GL_MAP_INVALIDATE_BUFFER_BIT      0x0008
-#define GL_MAP_FLUSH_EXPLICIT_BIT         0x0010
-#define GL_MAP_UNSYNCHRONIZED_BIT         0x0020
-#endif
-
-#ifndef GL_ARB_texture_buffer_object
-#define GL_TEXTURE_BUFFER_ARB             0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB    0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_ARB     0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_ARB      0x8C2E
-#endif
-
-#ifndef GL_ARB_texture_compression_rgtc
-#define GL_COMPRESSED_RED_RGTC1           0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1    0x8DBC
-#define GL_COMPRESSED_RG_RGTC2            0x8DBD
-#define GL_COMPRESSED_SIGNED_RG_RGTC2     0x8DBE
-#endif
-
-#ifndef GL_ARB_texture_rg
-#define GL_RG                             0x8227
-#define GL_RG_INTEGER                     0x8228
-#define GL_R8                             0x8229
-#define GL_R16                            0x822A
-#define GL_RG8                            0x822B
-#define GL_RG16                           0x822C
-#define GL_R16F                           0x822D
-#define GL_R32F                           0x822E
-#define GL_RG16F                          0x822F
-#define GL_RG32F                          0x8230
-#define GL_R8I                            0x8231
-#define GL_R8UI                           0x8232
-#define GL_R16I                           0x8233
-#define GL_R16UI                          0x8234
-#define GL_R32I                           0x8235
-#define GL_R32UI                          0x8236
-#define GL_RG8I                           0x8237
-#define GL_RG8UI                          0x8238
-#define GL_RG16I                          0x8239
-#define GL_RG16UI                         0x823A
-#define GL_RG32I                          0x823B
-#define GL_RG32UI                         0x823C
-#endif
-
-#ifndef GL_ARB_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING           0x85B5
-#endif
-
-#ifndef GL_ARB_uniform_buffer_object
-#define GL_UNIFORM_BUFFER                 0x8A11
-#define GL_UNIFORM_BUFFER_BINDING         0x8A28
-#define GL_UNIFORM_BUFFER_START           0x8A29
-#define GL_UNIFORM_BUFFER_SIZE            0x8A2A
-#define GL_MAX_VERTEX_UNIFORM_BLOCKS      0x8A2B
-#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS    0x8A2C
-#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS    0x8A2D
-#define GL_MAX_COMBINED_UNIFORM_BLOCKS    0x8A2E
-#define GL_MAX_UNIFORM_BUFFER_BINDINGS    0x8A2F
-#define GL_MAX_UNIFORM_BLOCK_SIZE         0x8A30
-#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
-#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
-#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
-#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
-#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
-#define GL_ACTIVE_UNIFORM_BLOCKS          0x8A36
-#define GL_UNIFORM_TYPE                   0x8A37
-#define GL_UNIFORM_SIZE                   0x8A38
-#define GL_UNIFORM_NAME_LENGTH            0x8A39
-#define GL_UNIFORM_BLOCK_INDEX            0x8A3A
-#define GL_UNIFORM_OFFSET                 0x8A3B
-#define GL_UNIFORM_ARRAY_STRIDE           0x8A3C
-#define GL_UNIFORM_MATRIX_STRIDE          0x8A3D
-#define GL_UNIFORM_IS_ROW_MAJOR           0x8A3E
-#define GL_UNIFORM_BLOCK_BINDING          0x8A3F
-#define GL_UNIFORM_BLOCK_DATA_SIZE        0x8A40
-#define GL_UNIFORM_BLOCK_NAME_LENGTH      0x8A41
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS  0x8A42
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
-#define GL_INVALID_INDEX                  0xFFFFFFFFu
-#endif
-
-#ifndef GL_ARB_compatibility
-/* ARB_compatibility just defines tokens from core 3.0 */
-#endif
-
-#ifndef GL_ARB_copy_buffer
-#define GL_COPY_READ_BUFFER               0x8F36
-#define GL_COPY_WRITE_BUFFER              0x8F37
-#endif
-
-#ifndef GL_ARB_shader_texture_lod
-#endif
-
-#ifndef GL_ARB_depth_clamp
-#define GL_DEPTH_CLAMP                    0x864F
-#endif
-
-#ifndef GL_ARB_draw_elements_base_vertex
-#endif
-
-#ifndef GL_ARB_fragment_coord_conventions
-#endif
-
-#ifndef GL_ARB_provoking_vertex
-#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
-#define GL_FIRST_VERTEX_CONVENTION        0x8E4D
-#define GL_LAST_VERTEX_CONVENTION         0x8E4E
-#define GL_PROVOKING_VERTEX               0x8E4F
-#endif
-
-#ifndef GL_ARB_seamless_cube_map
-#define GL_TEXTURE_CUBE_MAP_SEAMLESS      0x884F
-#endif
-
-#ifndef GL_ARB_sync
-#define GL_MAX_SERVER_WAIT_TIMEOUT        0x9111
-#define GL_OBJECT_TYPE                    0x9112
-#define GL_SYNC_CONDITION                 0x9113
-#define GL_SYNC_STATUS                    0x9114
-#define GL_SYNC_FLAGS                     0x9115
-#define GL_SYNC_FENCE                     0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE     0x9117
-#define GL_UNSIGNALED                     0x9118
-#define GL_SIGNALED                       0x9119
-#define GL_ALREADY_SIGNALED               0x911A
-#define GL_TIMEOUT_EXPIRED                0x911B
-#define GL_CONDITION_SATISFIED            0x911C
-#define GL_WAIT_FAILED                    0x911D
-#define GL_SYNC_FLUSH_COMMANDS_BIT        0x00000001
-#define GL_TIMEOUT_IGNORED                0xFFFFFFFFFFFFFFFFull
-#endif
-
-#ifndef GL_ARB_texture_multisample
-#define GL_SAMPLE_POSITION                0x8E50
-#define GL_SAMPLE_MASK                    0x8E51
-#define GL_SAMPLE_MASK_VALUE              0x8E52
-#define GL_MAX_SAMPLE_MASK_WORDS          0x8E59
-#define GL_TEXTURE_2D_MULTISAMPLE         0x9100
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE   0x9101
-#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY   0x9102
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
-#define GL_TEXTURE_SAMPLES                0x9106
-#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
-#define GL_SAMPLER_2D_MULTISAMPLE         0x9108
-#define GL_INT_SAMPLER_2D_MULTISAMPLE     0x9109
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
-#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY   0x910B
-#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
-#define GL_MAX_COLOR_TEXTURE_SAMPLES      0x910E
-#define GL_MAX_DEPTH_TEXTURE_SAMPLES      0x910F
-#define GL_MAX_INTEGER_SAMPLES            0x9110
-#endif
-
-#ifndef GL_ARB_vertex_array_bgra
-/* reuse GL_BGRA */
-#endif
-
-#ifndef GL_ARB_draw_buffers_blend
-#endif
-
-#ifndef GL_ARB_sample_shading
-#define GL_SAMPLE_SHADING_ARB             0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE_ARB   0x8C37
-#endif
-
-#ifndef GL_ARB_texture_cube_map_array
-#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB     0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB     0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
-#endif
-
-#ifndef GL_ARB_texture_gather
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
-#endif
-
-#ifndef GL_ARB_texture_query_lod
-#endif
-
-#ifndef GL_ARB_shading_language_include
-#define GL_SHADER_INCLUDE_ARB             0x8DAE
-#define GL_NAMED_STRING_LENGTH_ARB        0x8DE9
-#define GL_NAMED_STRING_TYPE_ARB          0x8DEA
-#endif
-
-#ifndef GL_ARB_texture_compression_bptc
-#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
-#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
-#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
-#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
-#endif
-
-#ifndef GL_ARB_blend_func_extended
-#define GL_SRC1_COLOR                     0x88F9
-/* reuse GL_SRC1_ALPHA */
-#define GL_ONE_MINUS_SRC1_COLOR           0x88FA
-#define GL_ONE_MINUS_SRC1_ALPHA           0x88FB
-#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS   0x88FC
-#endif
-
-#ifndef GL_ARB_explicit_attrib_location
-#endif
-
-#ifndef GL_ARB_occlusion_query2
-#define GL_ANY_SAMPLES_PASSED             0x8C2F
-#endif
-
-#ifndef GL_ARB_sampler_objects
-#define GL_SAMPLER_BINDING                0x8919
-#endif
-
-#ifndef GL_ARB_shader_bit_encoding
-#endif
-
-#ifndef GL_ARB_texture_rgb10_a2ui
-#define GL_RGB10_A2UI                     0x906F
-#endif
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_TEXTURE_SWIZZLE_R              0x8E42
-#define GL_TEXTURE_SWIZZLE_G              0x8E43
-#define GL_TEXTURE_SWIZZLE_B              0x8E44
-#define GL_TEXTURE_SWIZZLE_A              0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA           0x8E46
-#endif
-
-#ifndef GL_ARB_timer_query
-#define GL_TIME_ELAPSED                   0x88BF
-#define GL_TIMESTAMP                      0x8E28
-#endif
-
-#ifndef GL_ARB_vertex_type_2_10_10_10_rev
-/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */
-#define GL_INT_2_10_10_10_REV             0x8D9F
-#endif
-
-#ifndef GL_ARB_draw_indirect
-#define GL_DRAW_INDIRECT_BUFFER           0x8F3F
-#define GL_DRAW_INDIRECT_BUFFER_BINDING   0x8F43
-#endif
-
-#ifndef GL_ARB_gpu_shader5
-#define GL_GEOMETRY_SHADER_INVOCATIONS    0x887F
-#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
-#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
-/* reuse GL_MAX_VERTEX_STREAMS */
-#endif
-
-#ifndef GL_ARB_gpu_shader_fp64
-/* reuse GL_DOUBLE */
-#define GL_DOUBLE_VEC2                    0x8FFC
-#define GL_DOUBLE_VEC3                    0x8FFD
-#define GL_DOUBLE_VEC4                    0x8FFE
-#define GL_DOUBLE_MAT2                    0x8F46
-#define GL_DOUBLE_MAT3                    0x8F47
-#define GL_DOUBLE_MAT4                    0x8F48
-#define GL_DOUBLE_MAT2x3                  0x8F49
-#define GL_DOUBLE_MAT2x4                  0x8F4A
-#define GL_DOUBLE_MAT3x2                  0x8F4B
-#define GL_DOUBLE_MAT3x4                  0x8F4C
-#define GL_DOUBLE_MAT4x2                  0x8F4D
-#define GL_DOUBLE_MAT4x3                  0x8F4E
-#endif
-
-#ifndef GL_ARB_shader_subroutine
-#define GL_ACTIVE_SUBROUTINES             0x8DE5
-#define GL_ACTIVE_SUBROUTINE_UNIFORMS     0x8DE6
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
-#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH   0x8E48
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49
-#define GL_MAX_SUBROUTINES                0x8DE7
-#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
-#define GL_NUM_COMPATIBLE_SUBROUTINES     0x8E4A
-#define GL_COMPATIBLE_SUBROUTINES         0x8E4B
-/* reuse GL_UNIFORM_SIZE */
-/* reuse GL_UNIFORM_NAME_LENGTH */
-#endif
-
-#ifndef GL_ARB_tessellation_shader
-#define GL_PATCHES                        0x000E
-#define GL_PATCH_VERTICES                 0x8E72
-#define GL_PATCH_DEFAULT_INNER_LEVEL      0x8E73
-#define GL_PATCH_DEFAULT_OUTER_LEVEL      0x8E74
-#define GL_TESS_CONTROL_OUTPUT_VERTICES   0x8E75
-#define GL_TESS_GEN_MODE                  0x8E76
-#define GL_TESS_GEN_SPACING               0x8E77
-#define GL_TESS_GEN_VERTEX_ORDER          0x8E78
-#define GL_TESS_GEN_POINT_MODE            0x8E79
-/* reuse GL_TRIANGLES */
-/* reuse GL_QUADS */
-#define GL_ISOLINES                       0x8E7A
-/* reuse GL_EQUAL */
-#define GL_FRACTIONAL_ODD                 0x8E7B
-#define GL_FRACTIONAL_EVEN                0x8E7C
-/* reuse GL_CCW */
-/* reuse GL_CW */
-#define GL_MAX_PATCH_VERTICES             0x8E7D
-#define GL_MAX_TESS_GEN_LEVEL             0x8E7E
-#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
-#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
-#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
-#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
-#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
-#define GL_MAX_TESS_PATCH_COMPONENTS      0x8E84
-#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
-#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
-#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
-#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
-#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
-#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
-#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
-#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
-#define GL_TESS_EVALUATION_SHADER         0x8E87
-#define GL_TESS_CONTROL_SHADER            0x8E88
-#endif
-
-#ifndef GL_ARB_texture_buffer_object_rgb32
-/* reuse GL_RGB32F */
-/* reuse GL_RGB32UI */
-/* reuse GL_RGB32I */
-#endif
-
-#ifndef GL_ARB_transform_feedback2
-#define GL_TRANSFORM_FEEDBACK             0x8E22
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING     0x8E25
-#endif
-
-#ifndef GL_ARB_transform_feedback3
-#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
-#define GL_MAX_VERTEX_STREAMS             0x8E71
-#endif
-
-#ifndef GL_ARB_ES2_compatibility
-#define GL_FIXED                          0x140C
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_LOW_FLOAT                      0x8DF0
-#define GL_MEDIUM_FLOAT                   0x8DF1
-#define GL_HIGH_FLOAT                     0x8DF2
-#define GL_LOW_INT                        0x8DF3
-#define GL_MEDIUM_INT                     0x8DF4
-#define GL_HIGH_INT                       0x8DF5
-#define GL_SHADER_COMPILER                0x8DFA
-#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
-#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB
-#define GL_MAX_VARYING_VECTORS            0x8DFC
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD
-#endif
-
-#ifndef GL_ARB_get_program_binary
-#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
-#define GL_PROGRAM_BINARY_LENGTH          0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS     0x87FE
-#define GL_PROGRAM_BINARY_FORMATS         0x87FF
-#endif
-
-#ifndef GL_ARB_separate_shader_objects
-#define GL_VERTEX_SHADER_BIT              0x00000001
-#define GL_FRAGMENT_SHADER_BIT            0x00000002
-#define GL_GEOMETRY_SHADER_BIT            0x00000004
-#define GL_TESS_CONTROL_SHADER_BIT        0x00000008
-#define GL_TESS_EVALUATION_SHADER_BIT     0x00000010
-#define GL_ALL_SHADER_BITS                0xFFFFFFFF
-#define GL_PROGRAM_SEPARABLE              0x8258
-#define GL_ACTIVE_PROGRAM                 0x8259
-#define GL_PROGRAM_PIPELINE_BINDING       0x825A
-#endif
-
-#ifndef GL_ARB_shader_precision
-#endif
-
-#ifndef GL_ARB_vertex_attrib_64bit
-/* reuse GL_RGB32I */
-/* reuse GL_DOUBLE_VEC2 */
-/* reuse GL_DOUBLE_VEC3 */
-/* reuse GL_DOUBLE_VEC4 */
-/* reuse GL_DOUBLE_MAT2 */
-/* reuse GL_DOUBLE_MAT3 */
-/* reuse GL_DOUBLE_MAT4 */
-/* reuse GL_DOUBLE_MAT2x3 */
-/* reuse GL_DOUBLE_MAT2x4 */
-/* reuse GL_DOUBLE_MAT3x2 */
-/* reuse GL_DOUBLE_MAT3x4 */
-/* reuse GL_DOUBLE_MAT4x2 */
-/* reuse GL_DOUBLE_MAT4x3 */
-#endif
-
-#ifndef GL_ARB_viewport_array
-/* reuse GL_SCISSOR_BOX */
-/* reuse GL_VIEWPORT */
-/* reuse GL_DEPTH_RANGE */
-/* reuse GL_SCISSOR_TEST */
-#define GL_MAX_VIEWPORTS                  0x825B
-#define GL_VIEWPORT_SUBPIXEL_BITS         0x825C
-#define GL_VIEWPORT_BOUNDS_RANGE          0x825D
-#define GL_LAYER_PROVOKING_VERTEX         0x825E
-#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
-#define GL_UNDEFINED_VERTEX               0x8260
-/* reuse GL_FIRST_VERTEX_CONVENTION */
-/* reuse GL_LAST_VERTEX_CONVENTION */
-/* reuse GL_PROVOKING_VERTEX */
-#endif
-
-#ifndef GL_ARB_cl_event
-#define GL_SYNC_CL_EVENT_ARB              0x8240
-#define GL_SYNC_CL_EVENT_COMPLETE_ARB     0x8241
-#endif
-
-#ifndef GL_ARB_debug_output
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB   0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION_ARB    0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM_ARB  0x8245
-#define GL_DEBUG_SOURCE_API_ARB           0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB   0x8249
-#define GL_DEBUG_SOURCE_APPLICATION_ARB   0x824A
-#define GL_DEBUG_SOURCE_OTHER_ARB         0x824B
-#define GL_DEBUG_TYPE_ERROR_ARB           0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY_ARB     0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE_ARB     0x8250
-#define GL_DEBUG_TYPE_OTHER_ARB           0x8251
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB   0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB  0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_ARB      0x9145
-#define GL_DEBUG_SEVERITY_HIGH_ARB        0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_ARB      0x9147
-#define GL_DEBUG_SEVERITY_LOW_ARB         0x9148
-#endif
-
-#ifndef GL_ARB_robustness
-/* reuse GL_NO_ERROR */
-#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define GL_LOSE_CONTEXT_ON_RESET_ARB      0x8252
-#define GL_GUILTY_CONTEXT_RESET_ARB       0x8253
-#define GL_INNOCENT_CONTEXT_RESET_ARB     0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_ARB      0x8255
-#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define GL_NO_RESET_NOTIFICATION_ARB      0x8261
-#endif
-
-#ifndef GL_ARB_shader_stencil_export
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_ABGR_EXT                       0x8000
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_CONSTANT_COLOR_EXT             0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR_EXT   0x8002
-#define GL_CONSTANT_ALPHA_EXT             0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT   0x8004
-#define GL_BLEND_COLOR_EXT                0x8005
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_POLYGON_OFFSET_EXT             0x8037
-#define GL_POLYGON_OFFSET_FACTOR_EXT      0x8038
-#define GL_POLYGON_OFFSET_BIAS_EXT        0x8039
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_ALPHA4_EXT                     0x803B
-#define GL_ALPHA8_EXT                     0x803C
-#define GL_ALPHA12_EXT                    0x803D
-#define GL_ALPHA16_EXT                    0x803E
-#define GL_LUMINANCE4_EXT                 0x803F
-#define GL_LUMINANCE8_EXT                 0x8040
-#define GL_LUMINANCE12_EXT                0x8041
-#define GL_LUMINANCE16_EXT                0x8042
-#define GL_LUMINANCE4_ALPHA4_EXT          0x8043
-#define GL_LUMINANCE6_ALPHA2_EXT          0x8044
-#define GL_LUMINANCE8_ALPHA8_EXT          0x8045
-#define GL_LUMINANCE12_ALPHA4_EXT         0x8046
-#define GL_LUMINANCE12_ALPHA12_EXT        0x8047
-#define GL_LUMINANCE16_ALPHA16_EXT        0x8048
-#define GL_INTENSITY_EXT                  0x8049
-#define GL_INTENSITY4_EXT                 0x804A
-#define GL_INTENSITY8_EXT                 0x804B
-#define GL_INTENSITY12_EXT                0x804C
-#define GL_INTENSITY16_EXT                0x804D
-#define GL_RGB2_EXT                       0x804E
-#define GL_RGB4_EXT                       0x804F
-#define GL_RGB5_EXT                       0x8050
-#define GL_RGB8_EXT                       0x8051
-#define GL_RGB10_EXT                      0x8052
-#define GL_RGB12_EXT                      0x8053
-#define GL_RGB16_EXT                      0x8054
-#define GL_RGBA2_EXT                      0x8055
-#define GL_RGBA4_EXT                      0x8056
-#define GL_RGB5_A1_EXT                    0x8057
-#define GL_RGBA8_EXT                      0x8058
-#define GL_RGB10_A2_EXT                   0x8059
-#define GL_RGBA12_EXT                     0x805A
-#define GL_RGBA16_EXT                     0x805B
-#define GL_TEXTURE_RED_SIZE_EXT           0x805C
-#define GL_TEXTURE_GREEN_SIZE_EXT         0x805D
-#define GL_TEXTURE_BLUE_SIZE_EXT          0x805E
-#define GL_TEXTURE_ALPHA_SIZE_EXT         0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE_EXT     0x8060
-#define GL_TEXTURE_INTENSITY_SIZE_EXT     0x8061
-#define GL_REPLACE_EXT                    0x8062
-#define GL_PROXY_TEXTURE_1D_EXT           0x8063
-#define GL_PROXY_TEXTURE_2D_EXT           0x8064
-#define GL_TEXTURE_TOO_LARGE_EXT          0x8065
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_PACK_SKIP_IMAGES_EXT           0x806B
-#define GL_PACK_IMAGE_HEIGHT_EXT          0x806C
-#define GL_UNPACK_SKIP_IMAGES_EXT         0x806D
-#define GL_UNPACK_IMAGE_HEIGHT_EXT        0x806E
-#define GL_TEXTURE_3D_EXT                 0x806F
-#define GL_PROXY_TEXTURE_3D_EXT           0x8070
-#define GL_TEXTURE_DEPTH_EXT              0x8071
-#define GL_TEXTURE_WRAP_R_EXT             0x8072
-#define GL_MAX_3D_TEXTURE_SIZE_EXT        0x8073
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_FILTER4_SGIS                   0x8146
-#define GL_TEXTURE_FILTER4_SIZE_SGIS      0x8147
-#endif
-
-#ifndef GL_EXT_subtexture
-#endif
-
-#ifndef GL_EXT_copy_texture
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_HISTOGRAM_EXT                  0x8024
-#define GL_PROXY_HISTOGRAM_EXT            0x8025
-#define GL_HISTOGRAM_WIDTH_EXT            0x8026
-#define GL_HISTOGRAM_FORMAT_EXT           0x8027
-#define GL_HISTOGRAM_RED_SIZE_EXT         0x8028
-#define GL_HISTOGRAM_GREEN_SIZE_EXT       0x8029
-#define GL_HISTOGRAM_BLUE_SIZE_EXT        0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE_EXT       0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT   0x802C
-#define GL_HISTOGRAM_SINK_EXT             0x802D
-#define GL_MINMAX_EXT                     0x802E
-#define GL_MINMAX_FORMAT_EXT              0x802F
-#define GL_MINMAX_SINK_EXT                0x8030
-#define GL_TABLE_TOO_LARGE_EXT            0x8031
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_CONVOLUTION_1D_EXT             0x8010
-#define GL_CONVOLUTION_2D_EXT             0x8011
-#define GL_SEPARABLE_2D_EXT               0x8012
-#define GL_CONVOLUTION_BORDER_MODE_EXT    0x8013
-#define GL_CONVOLUTION_FILTER_SCALE_EXT   0x8014
-#define GL_CONVOLUTION_FILTER_BIAS_EXT    0x8015
-#define GL_REDUCE_EXT                     0x8016
-#define GL_CONVOLUTION_FORMAT_EXT         0x8017
-#define GL_CONVOLUTION_WIDTH_EXT          0x8018
-#define GL_CONVOLUTION_HEIGHT_EXT         0x8019
-#define GL_MAX_CONVOLUTION_WIDTH_EXT      0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT_EXT     0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS_EXT  0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
-#endif
-
-#ifndef GL_SGI_color_matrix
-#define GL_COLOR_MATRIX_SGI               0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH_SGI   0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_COLOR_TABLE_SGI                0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
-#define GL_PROXY_COLOR_TABLE_SGI          0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
-#define GL_COLOR_TABLE_SCALE_SGI          0x80D6
-#define GL_COLOR_TABLE_BIAS_SGI           0x80D7
-#define GL_COLOR_TABLE_FORMAT_SGI         0x80D8
-#define GL_COLOR_TABLE_WIDTH_SGI          0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_SGI       0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_SGI     0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_SGI      0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_SGI     0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_PIXEL_TEXTURE_SGIS             0x8353
-#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
-#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
-#define GL_PIXEL_GROUP_COLOR_SGIS         0x8356
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_PIXEL_TEX_GEN_SGIX             0x8139
-#define GL_PIXEL_TEX_GEN_MODE_SGIX        0x832B
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_PACK_SKIP_VOLUMES_SGIS         0x8130
-#define GL_PACK_IMAGE_DEPTH_SGIS          0x8131
-#define GL_UNPACK_SKIP_VOLUMES_SGIS       0x8132
-#define GL_UNPACK_IMAGE_DEPTH_SGIS        0x8133
-#define GL_TEXTURE_4D_SGIS                0x8134
-#define GL_PROXY_TEXTURE_4D_SGIS          0x8135
-#define GL_TEXTURE_4DSIZE_SGIS            0x8136
-#define GL_TEXTURE_WRAP_Q_SGIS            0x8137
-#define GL_MAX_4D_TEXTURE_SIZE_SGIS       0x8138
-#define GL_TEXTURE_4D_BINDING_SGIS        0x814F
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_TEXTURE_COLOR_TABLE_SGI        0x80BC
-#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI  0x80BD
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_CMYK_EXT                       0x800C
-#define GL_CMYKA_EXT                      0x800D
-#define GL_PACK_CMYK_HINT_EXT             0x800E
-#define GL_UNPACK_CMYK_HINT_EXT           0x800F
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_TEXTURE_PRIORITY_EXT           0x8066
-#define GL_TEXTURE_RESIDENT_EXT           0x8067
-#define GL_TEXTURE_1D_BINDING_EXT         0x8068
-#define GL_TEXTURE_2D_BINDING_EXT         0x8069
-#define GL_TEXTURE_3D_BINDING_EXT         0x806A
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_DETAIL_TEXTURE_2D_SGIS         0x8095
-#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
-#define GL_LINEAR_DETAIL_SGIS             0x8097
-#define GL_LINEAR_DETAIL_ALPHA_SGIS       0x8098
-#define GL_LINEAR_DETAIL_COLOR_SGIS       0x8099
-#define GL_DETAIL_TEXTURE_LEVEL_SGIS      0x809A
-#define GL_DETAIL_TEXTURE_MODE_SGIS       0x809B
-#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_LINEAR_SHARPEN_SGIS            0x80AD
-#define GL_LINEAR_SHARPEN_ALPHA_SGIS      0x80AE
-#define GL_LINEAR_SHARPEN_COLOR_SGIS      0x80AF
-#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_UNSIGNED_BYTE_3_3_2_EXT        0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4_EXT     0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1_EXT     0x8034
-#define GL_UNSIGNED_INT_8_8_8_8_EXT       0x8035
-#define GL_UNSIGNED_INT_10_10_10_2_EXT    0x8036
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_TEXTURE_MIN_LOD_SGIS           0x813A
-#define GL_TEXTURE_MAX_LOD_SGIS           0x813B
-#define GL_TEXTURE_BASE_LEVEL_SGIS        0x813C
-#define GL_TEXTURE_MAX_LEVEL_SGIS         0x813D
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_MULTISAMPLE_SGIS               0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_SGIS      0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_SGIS       0x809F
-#define GL_SAMPLE_MASK_SGIS               0x80A0
-#define GL_1PASS_SGIS                     0x80A1
-#define GL_2PASS_0_SGIS                   0x80A2
-#define GL_2PASS_1_SGIS                   0x80A3
-#define GL_4PASS_0_SGIS                   0x80A4
-#define GL_4PASS_1_SGIS                   0x80A5
-#define GL_4PASS_2_SGIS                   0x80A6
-#define GL_4PASS_3_SGIS                   0x80A7
-#define GL_SAMPLE_BUFFERS_SGIS            0x80A8
-#define GL_SAMPLES_SGIS                   0x80A9
-#define GL_SAMPLE_MASK_VALUE_SGIS         0x80AA
-#define GL_SAMPLE_MASK_INVERT_SGIS        0x80AB
-#define GL_SAMPLE_PATTERN_SGIS            0x80AC
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_RESCALE_NORMAL_EXT             0x803A
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_VERTEX_ARRAY_EXT               0x8074
-#define GL_NORMAL_ARRAY_EXT               0x8075
-#define GL_COLOR_ARRAY_EXT                0x8076
-#define GL_INDEX_ARRAY_EXT                0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT        0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT            0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT          0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT          0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT        0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT         0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT          0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT        0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT         0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT           0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT           0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT         0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT          0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT           0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT         0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT          0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT   0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT   0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT  0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT     0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT      0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT       0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT       0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT        0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT        0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT    0x8093
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_GENERATE_MIPMAP_SGIS           0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS      0x8192
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_LINEAR_CLIPMAP_LINEAR_SGIX     0x8170
-#define GL_TEXTURE_CLIPMAP_CENTER_SGIX    0x8171
-#define GL_TEXTURE_CLIPMAP_FRAME_SGIX     0x8172
-#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX    0x8173
-#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
-#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
-#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX     0x8176
-#define GL_MAX_CLIPMAP_DEPTH_SGIX         0x8177
-#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
-#define GL_NEAREST_CLIPMAP_NEAREST_SGIX   0x844D
-#define GL_NEAREST_CLIPMAP_LINEAR_SGIX    0x844E
-#define GL_LINEAR_CLIPMAP_NEAREST_SGIX    0x844F
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_TEXTURE_COMPARE_SGIX           0x819A
-#define GL_TEXTURE_COMPARE_OPERATOR_SGIX  0x819B
-#define GL_TEXTURE_LEQUAL_R_SGIX          0x819C
-#define GL_TEXTURE_GEQUAL_R_SGIX          0x819D
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_CLAMP_TO_EDGE_SGIS             0x812F
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_SGIS           0x812D
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_FUNC_ADD_EXT                   0x8006
-#define GL_MIN_EXT                        0x8007
-#define GL_MAX_EXT                        0x8008
-#define GL_BLEND_EQUATION_EXT             0x8009
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_FUNC_SUBTRACT_EXT              0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_EXT      0x800B
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_INTERLACE_SGIX                 0x8094
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
-#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
-#define GL_PIXEL_TILE_WIDTH_SGIX          0x8140
-#define GL_PIXEL_TILE_HEIGHT_SGIX         0x8141
-#define GL_PIXEL_TILE_GRID_WIDTH_SGIX     0x8142
-#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX    0x8143
-#define GL_PIXEL_TILE_GRID_DEPTH_SGIX     0x8144
-#define GL_PIXEL_TILE_CACHE_SIZE_SGIX     0x8145
-#endif
-
-#ifndef GL_SGIS_texture_select
-#define GL_DUAL_ALPHA4_SGIS               0x8110
-#define GL_DUAL_ALPHA8_SGIS               0x8111
-#define GL_DUAL_ALPHA12_SGIS              0x8112
-#define GL_DUAL_ALPHA16_SGIS              0x8113
-#define GL_DUAL_LUMINANCE4_SGIS           0x8114
-#define GL_DUAL_LUMINANCE8_SGIS           0x8115
-#define GL_DUAL_LUMINANCE12_SGIS          0x8116
-#define GL_DUAL_LUMINANCE16_SGIS          0x8117
-#define GL_DUAL_INTENSITY4_SGIS           0x8118
-#define GL_DUAL_INTENSITY8_SGIS           0x8119
-#define GL_DUAL_INTENSITY12_SGIS          0x811A
-#define GL_DUAL_INTENSITY16_SGIS          0x811B
-#define GL_DUAL_LUMINANCE_ALPHA4_SGIS     0x811C
-#define GL_DUAL_LUMINANCE_ALPHA8_SGIS     0x811D
-#define GL_QUAD_ALPHA4_SGIS               0x811E
-#define GL_QUAD_ALPHA8_SGIS               0x811F
-#define GL_QUAD_LUMINANCE4_SGIS           0x8120
-#define GL_QUAD_LUMINANCE8_SGIS           0x8121
-#define GL_QUAD_INTENSITY4_SGIS           0x8122
-#define GL_QUAD_INTENSITY8_SGIS           0x8123
-#define GL_DUAL_TEXTURE_SELECT_SGIS       0x8124
-#define GL_QUAD_TEXTURE_SELECT_SGIS       0x8125
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SPRITE_SGIX                    0x8148
-#define GL_SPRITE_MODE_SGIX               0x8149
-#define GL_SPRITE_AXIS_SGIX               0x814A
-#define GL_SPRITE_TRANSLATION_SGIX        0x814B
-#define GL_SPRITE_AXIAL_SGIX              0x814C
-#define GL_SPRITE_OBJECT_ALIGNED_SGIX     0x814D
-#define GL_SPRITE_EYE_ALIGNED_SGIX        0x814E
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_POINT_SIZE_MIN_EXT             0x8126
-#define GL_POINT_SIZE_MAX_EXT             0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_EXT  0x8128
-#define GL_DISTANCE_ATTENUATION_EXT       0x8129
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_POINT_SIZE_MIN_SGIS            0x8126
-#define GL_POINT_SIZE_MAX_SGIS            0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
-#define GL_DISTANCE_ATTENUATION_SGIS      0x8129
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
-#define GL_INSTRUMENT_MEASUREMENTS_SGIX   0x8181
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_POST_TEXTURE_FILTER_BIAS_SGIX  0x8179
-#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
-#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
-#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_FRAMEZOOM_SGIX                 0x818B
-#define GL_FRAMEZOOM_FACTOR_SGIX          0x818C
-#define GL_MAX_FRAMEZOOM_FACTOR_SGIX      0x818D
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#endif
-
-#ifndef GL_FfdMaskSGIX
-#define GL_TEXTURE_DEFORMATION_BIT_SGIX   0x00000001
-#define GL_GEOMETRY_DEFORMATION_BIT_SGIX  0x00000002
-#endif
-
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_GEOMETRY_DEFORMATION_SGIX      0x8194
-#define GL_TEXTURE_DEFORMATION_SGIX       0x8195
-#define GL_DEFORMATIONS_MASK_SGIX         0x8196
-#define GL_MAX_DEFORMATION_ORDER_SGIX     0x8197
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_REFERENCE_PLANE_SGIX           0x817D
-#define GL_REFERENCE_PLANE_EQUATION_SGIX  0x817E
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_DEPTH_COMPONENT16_SGIX         0x81A5
-#define GL_DEPTH_COMPONENT24_SGIX         0x81A6
-#define GL_DEPTH_COMPONENT32_SGIX         0x81A7
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_FOG_FUNC_SGIS                  0x812A
-#define GL_FOG_FUNC_POINTS_SGIS           0x812B
-#define GL_MAX_FOG_FUNC_POINTS_SGIS       0x812C
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_FOG_OFFSET_SGIX                0x8198
-#define GL_FOG_OFFSET_VALUE_SGIX          0x8199
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_IMAGE_SCALE_X_HP               0x8155
-#define GL_IMAGE_SCALE_Y_HP               0x8156
-#define GL_IMAGE_TRANSLATE_X_HP           0x8157
-#define GL_IMAGE_TRANSLATE_Y_HP           0x8158
-#define GL_IMAGE_ROTATE_ANGLE_HP          0x8159
-#define GL_IMAGE_ROTATE_ORIGIN_X_HP       0x815A
-#define GL_IMAGE_ROTATE_ORIGIN_Y_HP       0x815B
-#define GL_IMAGE_MAG_FILTER_HP            0x815C
-#define GL_IMAGE_MIN_FILTER_HP            0x815D
-#define GL_IMAGE_CUBIC_WEIGHT_HP          0x815E
-#define GL_CUBIC_HP                       0x815F
-#define GL_AVERAGE_HP                     0x8160
-#define GL_IMAGE_TRANSFORM_2D_HP          0x8161
-#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
-#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_IGNORE_BORDER_HP               0x8150
-#define GL_CONSTANT_BORDER_HP             0x8151
-#define GL_REPLICATE_BORDER_HP            0x8153
-#define GL_CONVOLUTION_BORDER_COLOR_HP    0x8154
-#endif
-
-#ifndef GL_INGR_palette_buffer
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_TEXTURE_ENV_BIAS_SGIX          0x80BE
-#endif
-
-#ifndef GL_EXT_color_subtable
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_VERTEX_DATA_HINT_PGI           0x1A22A
-#define GL_VERTEX_CONSISTENT_HINT_PGI     0x1A22B
-#define GL_MATERIAL_SIDE_HINT_PGI         0x1A22C
-#define GL_MAX_VERTEX_HINT_PGI            0x1A22D
-#define GL_COLOR3_BIT_PGI                 0x00010000
-#define GL_COLOR4_BIT_PGI                 0x00020000
-#define GL_EDGEFLAG_BIT_PGI               0x00040000
-#define GL_INDEX_BIT_PGI                  0x00080000
-#define GL_MAT_AMBIENT_BIT_PGI            0x00100000
-#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
-#define GL_MAT_DIFFUSE_BIT_PGI            0x00400000
-#define GL_MAT_EMISSION_BIT_PGI           0x00800000
-#define GL_MAT_COLOR_INDEXES_BIT_PGI      0x01000000
-#define GL_MAT_SHININESS_BIT_PGI          0x02000000
-#define GL_MAT_SPECULAR_BIT_PGI           0x04000000
-#define GL_NORMAL_BIT_PGI                 0x08000000
-#define GL_TEXCOORD1_BIT_PGI              0x10000000
-#define GL_TEXCOORD2_BIT_PGI              0x20000000
-#define GL_TEXCOORD3_BIT_PGI              0x40000000
-#define GL_TEXCOORD4_BIT_PGI              0x80000000
-#define GL_VERTEX23_BIT_PGI               0x00000004
-#define GL_VERTEX4_BIT_PGI                0x00000008
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PREFER_DOUBLEBUFFER_HINT_PGI   0x1A1F8
-#define GL_CONSERVE_MEMORY_HINT_PGI       0x1A1FD
-#define GL_RECLAIM_MEMORY_HINT_PGI        0x1A1FE
-#define GL_NATIVE_GRAPHICS_HANDLE_PGI     0x1A202
-#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
-#define GL_NATIVE_GRAPHICS_END_HINT_PGI   0x1A204
-#define GL_ALWAYS_FAST_HINT_PGI           0x1A20C
-#define GL_ALWAYS_SOFT_HINT_PGI           0x1A20D
-#define GL_ALLOW_DRAW_OBJ_HINT_PGI        0x1A20E
-#define GL_ALLOW_DRAW_WIN_HINT_PGI        0x1A20F
-#define GL_ALLOW_DRAW_FRG_HINT_PGI        0x1A210
-#define GL_ALLOW_DRAW_MEM_HINT_PGI        0x1A211
-#define GL_STRICT_DEPTHFUNC_HINT_PGI      0x1A216
-#define GL_STRICT_LIGHTING_HINT_PGI       0x1A217
-#define GL_STRICT_SCISSOR_HINT_PGI        0x1A218
-#define GL_FULL_STIPPLE_HINT_PGI          0x1A219
-#define GL_CLIP_NEAR_HINT_PGI             0x1A220
-#define GL_CLIP_FAR_HINT_PGI              0x1A221
-#define GL_WIDE_LINE_HINT_PGI             0x1A222
-#define GL_BACK_NORMALS_HINT_PGI          0x1A223
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_COLOR_INDEX1_EXT               0x80E2
-#define GL_COLOR_INDEX2_EXT               0x80E3
-#define GL_COLOR_INDEX4_EXT               0x80E4
-#define GL_COLOR_INDEX8_EXT               0x80E5
-#define GL_COLOR_INDEX12_EXT              0x80E6
-#define GL_COLOR_INDEX16_EXT              0x80E7
-#define GL_TEXTURE_INDEX_SIZE_EXT         0x80ED
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT  0x80F0
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_LIST_PRIORITY_SGIX             0x8182
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_IR_INSTRUMENT1_SGIX            0x817F
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_CALLIGRAPHIC_FRAGMENT_SGIX     0x8183
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_TEXTURE_LOD_BIAS_S_SGIX        0x818E
-#define GL_TEXTURE_LOD_BIAS_T_SGIX        0x818F
-#define GL_TEXTURE_LOD_BIAS_R_SGIX        0x8190
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SHADOW_AMBIENT_SGIX            0x80BF
-#endif
-
-#ifndef GL_EXT_index_texture
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_INDEX_MATERIAL_EXT             0x81B8
-#define GL_INDEX_MATERIAL_PARAMETER_EXT   0x81B9
-#define GL_INDEX_MATERIAL_FACE_EXT        0x81BA
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_INDEX_TEST_EXT                 0x81B5
-#define GL_INDEX_TEST_FUNC_EXT            0x81B6
-#define GL_INDEX_TEST_REF_EXT             0x81B7
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_IUI_V2F_EXT                    0x81AD
-#define GL_IUI_V3F_EXT                    0x81AE
-#define GL_IUI_N3F_V2F_EXT                0x81AF
-#define GL_IUI_N3F_V3F_EXT                0x81B0
-#define GL_T2F_IUI_V2F_EXT                0x81B1
-#define GL_T2F_IUI_V3F_EXT                0x81B2
-#define GL_T2F_IUI_N3F_V2F_EXT            0x81B3
-#define GL_T2F_IUI_N3F_V3F_EXT            0x81B4
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT   0x81A8
-#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT   0x81A9
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_CULL_VERTEX_EXT                0x81AA
-#define GL_CULL_VERTEX_EYE_POSITION_EXT   0x81AB
-#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_YCRCB_422_SGIX                 0x81BB
-#define GL_YCRCB_444_SGIX                 0x81BC
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_FRAGMENT_LIGHTING_SGIX         0x8400
-#define GL_FRAGMENT_COLOR_MATERIAL_SGIX   0x8401
-#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
-#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
-#define GL_MAX_FRAGMENT_LIGHTS_SGIX       0x8404
-#define GL_MAX_ACTIVE_LIGHTS_SGIX         0x8405
-#define GL_CURRENT_RASTER_NORMAL_SGIX     0x8406
-#define GL_LIGHT_ENV_MODE_SGIX            0x8407
-#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
-#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
-#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
-#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
-#define GL_FRAGMENT_LIGHT0_SGIX           0x840C
-#define GL_FRAGMENT_LIGHT1_SGIX           0x840D
-#define GL_FRAGMENT_LIGHT2_SGIX           0x840E
-#define GL_FRAGMENT_LIGHT3_SGIX           0x840F
-#define GL_FRAGMENT_LIGHT4_SGIX           0x8410
-#define GL_FRAGMENT_LIGHT5_SGIX           0x8411
-#define GL_FRAGMENT_LIGHT6_SGIX           0x8412
-#define GL_FRAGMENT_LIGHT7_SGIX           0x8413
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_RASTER_POSITION_UNCLIPPED_IBM  0x19262
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_TEXTURE_LIGHTING_MODE_HP       0x8167
-#define GL_TEXTURE_POST_SPECULAR_HP       0x8168
-#define GL_TEXTURE_PRE_SPECULAR_HP        0x8169
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_MAX_ELEMENTS_VERTICES_EXT      0x80E8
-#define GL_MAX_ELEMENTS_INDICES_EXT       0x80E9
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_PHONG_WIN                      0x80EA
-#define GL_PHONG_HINT_WIN                 0x80EB
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_FOG_SPECULAR_TEXTURE_WIN       0x80EC
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_FRAGMENT_MATERIAL_EXT          0x8349
-#define GL_FRAGMENT_NORMAL_EXT            0x834A
-#define GL_FRAGMENT_COLOR_EXT             0x834C
-#define GL_ATTENUATION_EXT                0x834D
-#define GL_SHADOW_ATTENUATION_EXT         0x834E
-#define GL_TEXTURE_APPLICATION_MODE_EXT   0x834F
-#define GL_TEXTURE_LIGHT_EXT              0x8350
-#define GL_TEXTURE_MATERIAL_FACE_EXT      0x8351
-#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
-/* reuse GL_FRAGMENT_DEPTH_EXT */
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_ALPHA_MIN_SGIX                 0x8320
-#define GL_ALPHA_MAX_SGIX                 0x8321
-#endif
-
-#ifndef GL_SGIX_impact_pixel_texture
-#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX   0x8184
-#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX     0x8185
-#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX     0x8186
-#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
-#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
-#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX    0x8189
-#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX    0x818A
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_BGR_EXT                        0x80E0
-#define GL_BGRA_EXT                       0x80E1
-#endif
-
-#ifndef GL_SGIX_async
-#define GL_ASYNC_MARKER_SGIX              0x8329
-#endif
-
-#ifndef GL_SGIX_async_pixel
-#define GL_ASYNC_TEX_IMAGE_SGIX           0x835C
-#define GL_ASYNC_DRAW_PIXELS_SGIX         0x835D
-#define GL_ASYNC_READ_PIXELS_SGIX         0x835E
-#define GL_MAX_ASYNC_TEX_IMAGE_SGIX       0x835F
-#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX     0x8360
-#define GL_MAX_ASYNC_READ_PIXELS_SGIX     0x8361
-#endif
-
-#ifndef GL_SGIX_async_histogram
-#define GL_ASYNC_HISTOGRAM_SGIX           0x832C
-#define GL_MAX_ASYNC_HISTOGRAM_SGIX       0x832D
-#endif
-
-#ifndef GL_INTEL_texture_scissor
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_PARALLEL_ARRAYS_INTEL          0x83F4
-#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
-#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
-#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
-#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_OCCLUSION_TEST_HP              0x8165
-#define GL_OCCLUSION_TEST_RESULT_HP       0x8166
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_PIXEL_TRANSFORM_2D_EXT         0x8330
-#define GL_PIXEL_MAG_FILTER_EXT           0x8331
-#define GL_PIXEL_MIN_FILTER_EXT           0x8332
-#define GL_PIXEL_CUBIC_WEIGHT_EXT         0x8333
-#define GL_CUBIC_EXT                      0x8334
-#define GL_AVERAGE_EXT                    0x8335
-#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
-#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
-#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT  0x8338
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_SHARED_TEXTURE_PALETTE_EXT     0x81FB
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT  0x81F8
-#define GL_SINGLE_COLOR_EXT               0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT    0x81FA
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_COLOR_SUM_EXT                  0x8458
-#define GL_CURRENT_SECONDARY_COLOR_EXT    0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
-#define GL_SECONDARY_COLOR_ARRAY_EXT      0x845E
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_PERTURB_EXT                    0x85AE
-#define GL_TEXTURE_NORMAL_EXT             0x85AF
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_FOG_COORDINATE_SOURCE_EXT      0x8450
-#define GL_FOG_COORDINATE_EXT             0x8451
-#define GL_FRAGMENT_DEPTH_EXT             0x8452
-#define GL_CURRENT_FOG_COORDINATE_EXT     0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT  0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
-#define GL_FOG_COORDINATE_ARRAY_EXT       0x8457
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_SCREEN_COORDINATES_REND        0x8490
-#define GL_INVERTED_SCREEN_W_REND         0x8491
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_TANGENT_ARRAY_EXT              0x8439
-#define GL_BINORMAL_ARRAY_EXT             0x843A
-#define GL_CURRENT_TANGENT_EXT            0x843B
-#define GL_CURRENT_BINORMAL_EXT           0x843C
-#define GL_TANGENT_ARRAY_TYPE_EXT         0x843E
-#define GL_TANGENT_ARRAY_STRIDE_EXT       0x843F
-#define GL_BINORMAL_ARRAY_TYPE_EXT        0x8440
-#define GL_BINORMAL_ARRAY_STRIDE_EXT      0x8441
-#define GL_TANGENT_ARRAY_POINTER_EXT      0x8442
-#define GL_BINORMAL_ARRAY_POINTER_EXT     0x8443
-#define GL_MAP1_TANGENT_EXT               0x8444
-#define GL_MAP2_TANGENT_EXT               0x8445
-#define GL_MAP1_BINORMAL_EXT              0x8446
-#define GL_MAP2_BINORMAL_EXT              0x8447
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_COMBINE_EXT                    0x8570
-#define GL_COMBINE_RGB_EXT                0x8571
-#define GL_COMBINE_ALPHA_EXT              0x8572
-#define GL_RGB_SCALE_EXT                  0x8573
-#define GL_ADD_SIGNED_EXT                 0x8574
-#define GL_INTERPOLATE_EXT                0x8575
-#define GL_CONSTANT_EXT                   0x8576
-#define GL_PRIMARY_COLOR_EXT              0x8577
-#define GL_PREVIOUS_EXT                   0x8578
-#define GL_SOURCE0_RGB_EXT                0x8580
-#define GL_SOURCE1_RGB_EXT                0x8581
-#define GL_SOURCE2_RGB_EXT                0x8582
-#define GL_SOURCE0_ALPHA_EXT              0x8588
-#define GL_SOURCE1_ALPHA_EXT              0x8589
-#define GL_SOURCE2_ALPHA_EXT              0x858A
-#define GL_OPERAND0_RGB_EXT               0x8590
-#define GL_OPERAND1_RGB_EXT               0x8591
-#define GL_OPERAND2_RGB_EXT               0x8592
-#define GL_OPERAND0_ALPHA_EXT             0x8598
-#define GL_OPERAND1_ALPHA_EXT             0x8599
-#define GL_OPERAND2_ALPHA_EXT             0x859A
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_TRANSFORM_HINT_APPLE           0x85B1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_FOG_SCALE_SGIX                 0x81FC
-#define GL_FOG_SCALE_VALUE_SGIX           0x81FD
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_UNPACK_CONSTANT_DATA_SUNX      0x81D5
-#define GL_TEXTURE_CONSTANT_DATA_SUNX     0x81D6
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_GLOBAL_ALPHA_SUN               0x81D9
-#define GL_GLOBAL_ALPHA_FACTOR_SUN        0x81DA
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_RESTART_SUN                    0x0001
-#define GL_REPLACE_MIDDLE_SUN             0x0002
-#define GL_REPLACE_OLDEST_SUN             0x0003
-#define GL_TRIANGLE_LIST_SUN              0x81D7
-#define GL_REPLACEMENT_CODE_SUN           0x81D8
-#define GL_REPLACEMENT_CODE_ARRAY_SUN     0x85C0
-#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
-#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
-#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
-#define GL_R1UI_V3F_SUN                   0x85C4
-#define GL_R1UI_C4UB_V3F_SUN              0x85C5
-#define GL_R1UI_C3F_V3F_SUN               0x85C6
-#define GL_R1UI_N3F_V3F_SUN               0x85C7
-#define GL_R1UI_C4F_N3F_V3F_SUN           0x85C8
-#define GL_R1UI_T2F_V3F_SUN               0x85C9
-#define GL_R1UI_T2F_N3F_V3F_SUN           0x85CA
-#define GL_R1UI_T2F_C4F_N3F_V3F_SUN       0x85CB
-#endif
-
-#ifndef GL_SUN_vertex
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_BLEND_DST_RGB_EXT              0x80C8
-#define GL_BLEND_SRC_RGB_EXT              0x80C9
-#define GL_BLEND_DST_ALPHA_EXT            0x80CA
-#define GL_BLEND_SRC_ALPHA_EXT            0x80CB
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_RED_MIN_CLAMP_INGR             0x8560
-#define GL_GREEN_MIN_CLAMP_INGR           0x8561
-#define GL_BLUE_MIN_CLAMP_INGR            0x8562
-#define GL_ALPHA_MIN_CLAMP_INGR           0x8563
-#define GL_RED_MAX_CLAMP_INGR             0x8564
-#define GL_GREEN_MAX_CLAMP_INGR           0x8565
-#define GL_BLUE_MAX_CLAMP_INGR            0x8566
-#define GL_ALPHA_MAX_CLAMP_INGR           0x8567
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INTERLACE_READ_INGR            0x8568
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_INCR_WRAP_EXT                  0x8507
-#define GL_DECR_WRAP_EXT                  0x8508
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_422_EXT                        0x80CC
-#define GL_422_REV_EXT                    0x80CD
-#define GL_422_AVERAGE_EXT                0x80CE
-#define GL_422_REV_AVERAGE_EXT            0x80CF
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NORMAL_MAP_NV                  0x8511
-#define GL_REFLECTION_MAP_NV              0x8512
-#endif
-
-#ifndef GL_EXT_texture_cube_map
-#define GL_NORMAL_MAP_EXT                 0x8511
-#define GL_REFLECTION_MAP_EXT             0x8512
-#define GL_TEXTURE_CUBE_MAP_EXT           0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_EXT   0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_EXT     0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT  0x851C
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_WRAP_BORDER_SUN                0x81D4
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT       0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT     0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT           0x8501
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_MODELVIEW0_STACK_DEPTH_EXT     GL_MODELVIEW_STACK_DEPTH
-#define GL_MODELVIEW1_STACK_DEPTH_EXT     0x8502
-#define GL_MODELVIEW0_MATRIX_EXT          GL_MODELVIEW_MATRIX
-#define GL_MODELVIEW1_MATRIX_EXT          0x8506
-#define GL_VERTEX_WEIGHTING_EXT           0x8509
-#define GL_MODELVIEW0_EXT                 GL_MODELVIEW
-#define GL_MODELVIEW1_EXT                 0x850A
-#define GL_CURRENT_VERTEX_WEIGHT_EXT      0x850B
-#define GL_VERTEX_WEIGHT_ARRAY_EXT        0x850C
-#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT   0x850D
-#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT   0x850E
-#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
-#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_MAX_SHININESS_NV               0x8504
-#define GL_MAX_SPOT_EXPONENT_NV           0x8505
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_NV          0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV   0x851E
-#define GL_VERTEX_ARRAY_RANGE_VALID_NV    0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_NV  0x8521
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_REGISTER_COMBINERS_NV          0x8522
-#define GL_VARIABLE_A_NV                  0x8523
-#define GL_VARIABLE_B_NV                  0x8524
-#define GL_VARIABLE_C_NV                  0x8525
-#define GL_VARIABLE_D_NV                  0x8526
-#define GL_VARIABLE_E_NV                  0x8527
-#define GL_VARIABLE_F_NV                  0x8528
-#define GL_VARIABLE_G_NV                  0x8529
-#define GL_CONSTANT_COLOR0_NV             0x852A
-#define GL_CONSTANT_COLOR1_NV             0x852B
-#define GL_PRIMARY_COLOR_NV               0x852C
-#define GL_SECONDARY_COLOR_NV             0x852D
-#define GL_SPARE0_NV                      0x852E
-#define GL_SPARE1_NV                      0x852F
-#define GL_DISCARD_NV                     0x8530
-#define GL_E_TIMES_F_NV                   0x8531
-#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
-#define GL_UNSIGNED_IDENTITY_NV           0x8536
-#define GL_UNSIGNED_INVERT_NV             0x8537
-#define GL_EXPAND_NORMAL_NV               0x8538
-#define GL_EXPAND_NEGATE_NV               0x8539
-#define GL_HALF_BIAS_NORMAL_NV            0x853A
-#define GL_HALF_BIAS_NEGATE_NV            0x853B
-#define GL_SIGNED_IDENTITY_NV             0x853C
-#define GL_SIGNED_NEGATE_NV               0x853D
-#define GL_SCALE_BY_TWO_NV                0x853E
-#define GL_SCALE_BY_FOUR_NV               0x853F
-#define GL_SCALE_BY_ONE_HALF_NV           0x8540
-#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV   0x8541
-#define GL_COMBINER_INPUT_NV              0x8542
-#define GL_COMBINER_MAPPING_NV            0x8543
-#define GL_COMBINER_COMPONENT_USAGE_NV    0x8544
-#define GL_COMBINER_AB_DOT_PRODUCT_NV     0x8545
-#define GL_COMBINER_CD_DOT_PRODUCT_NV     0x8546
-#define GL_COMBINER_MUX_SUM_NV            0x8547
-#define GL_COMBINER_SCALE_NV              0x8548
-#define GL_COMBINER_BIAS_NV               0x8549
-#define GL_COMBINER_AB_OUTPUT_NV          0x854A
-#define GL_COMBINER_CD_OUTPUT_NV          0x854B
-#define GL_COMBINER_SUM_OUTPUT_NV         0x854C
-#define GL_MAX_GENERAL_COMBINERS_NV       0x854D
-#define GL_NUM_GENERAL_COMBINERS_NV       0x854E
-#define GL_COLOR_SUM_CLAMP_NV             0x854F
-#define GL_COMBINER0_NV                   0x8550
-#define GL_COMBINER1_NV                   0x8551
-#define GL_COMBINER2_NV                   0x8552
-#define GL_COMBINER3_NV                   0x8553
-#define GL_COMBINER4_NV                   0x8554
-#define GL_COMBINER5_NV                   0x8555
-#define GL_COMBINER6_NV                   0x8556
-#define GL_COMBINER7_NV                   0x8557
-/* reuse GL_TEXTURE0_ARB */
-/* reuse GL_TEXTURE1_ARB */
-/* reuse GL_ZERO */
-/* reuse GL_NONE */
-/* reuse GL_FOG */
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_FOG_DISTANCE_MODE_NV           0x855A
-#define GL_EYE_RADIAL_NV                  0x855B
-#define GL_EYE_PLANE_ABSOLUTE_NV          0x855C
-/* reuse GL_EYE_PLANE */
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_EMBOSS_LIGHT_NV                0x855D
-#define GL_EMBOSS_CONSTANT_NV             0x855E
-#define GL_EMBOSS_MAP_NV                  0x855F
-#endif
-
-#ifndef GL_NV_blend_square
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_COMBINE4_NV                    0x8503
-#define GL_SOURCE3_RGB_NV                 0x8583
-#define GL_SOURCE3_ALPHA_NV               0x858B
-#define GL_OPERAND3_RGB_NV                0x8593
-#define GL_OPERAND3_ALPHA_NV              0x859B
-#endif
-
-#ifndef GL_MESA_resize_buffers
-#endif
-
-#ifndef GL_MESA_window_pos
-#endif
-
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_CULL_VERTEX_IBM                103050
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_VERTEX_ARRAY_LIST_IBM          103070
-#define GL_NORMAL_ARRAY_LIST_IBM          103071
-#define GL_COLOR_ARRAY_LIST_IBM           103072
-#define GL_INDEX_ARRAY_LIST_IBM           103073
-#define GL_TEXTURE_COORD_ARRAY_LIST_IBM   103074
-#define GL_EDGE_FLAG_ARRAY_LIST_IBM       103075
-#define GL_FOG_COORDINATE_ARRAY_LIST_IBM  103076
-#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
-#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM   103080
-#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM   103081
-#define GL_COLOR_ARRAY_LIST_STRIDE_IBM    103082
-#define GL_INDEX_ARRAY_LIST_STRIDE_IBM    103083
-#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
-#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
-#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
-#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_PACK_SUBSAMPLE_RATE_SGIX       0x85A0
-#define GL_UNPACK_SUBSAMPLE_RATE_SGIX     0x85A1
-#define GL_PIXEL_SUBSAMPLE_4444_SGIX      0x85A2
-#define GL_PIXEL_SUBSAMPLE_2424_SGIX      0x85A3
-#define GL_PIXEL_SUBSAMPLE_4242_SGIX      0x85A4
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_YCRCB_SGIX                     0x8318
-#define GL_YCRCBA_SGIX                    0x8319
-#endif
-
-#ifndef GL_SGI_depth_pass_instrument
-#define GL_DEPTH_PASS_INSTRUMENT_SGIX     0x8310
-#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
-#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_COMPRESSED_RGB_FXT1_3DFX       0x86B0
-#define GL_COMPRESSED_RGBA_FXT1_3DFX      0x86B1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_MULTISAMPLE_3DFX               0x86B2
-#define GL_SAMPLE_BUFFERS_3DFX            0x86B3
-#define GL_SAMPLES_3DFX                   0x86B4
-#define GL_MULTISAMPLE_BIT_3DFX           0x20000000
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_MULTISAMPLE_EXT                0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_EXT       0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT        0x809F
-#define GL_SAMPLE_MASK_EXT                0x80A0
-#define GL_1PASS_EXT                      0x80A1
-#define GL_2PASS_0_EXT                    0x80A2
-#define GL_2PASS_1_EXT                    0x80A3
-#define GL_4PASS_0_EXT                    0x80A4
-#define GL_4PASS_1_EXT                    0x80A5
-#define GL_4PASS_2_EXT                    0x80A6
-#define GL_4PASS_3_EXT                    0x80A7
-#define GL_SAMPLE_BUFFERS_EXT             0x80A8
-#define GL_SAMPLES_EXT                    0x80A9
-#define GL_SAMPLE_MASK_VALUE_EXT          0x80AA
-#define GL_SAMPLE_MASK_INVERT_EXT         0x80AB
-#define GL_SAMPLE_PATTERN_EXT             0x80AC
-#define GL_MULTISAMPLE_BIT_EXT            0x20000000
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_VERTEX_PRECLIP_SGIX            0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX       0x83EF
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_CONVOLUTION_HINT_SGIX          0x8316
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_PACK_RESAMPLE_SGIX             0x842C
-#define GL_UNPACK_RESAMPLE_SGIX           0x842D
-#define GL_RESAMPLE_REPLICATE_SGIX        0x842E
-#define GL_RESAMPLE_ZERO_FILL_SGIX        0x842F
-#define GL_RESAMPLE_DECIMATE_SGIX         0x8430
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_EYE_DISTANCE_TO_POINT_SGIS     0x81F0
-#define GL_OBJECT_DISTANCE_TO_POINT_SGIS  0x81F1
-#define GL_EYE_DISTANCE_TO_LINE_SGIS      0x81F2
-#define GL_OBJECT_DISTANCE_TO_LINE_SGIS   0x81F3
-#define GL_EYE_POINT_SGIS                 0x81F4
-#define GL_OBJECT_POINT_SGIS              0x81F5
-#define GL_EYE_LINE_SGIS                  0x81F6
-#define GL_OBJECT_LINE_SGIS               0x81F7
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_TEXTURE_COLOR_WRITEMASK_SGIS   0x81EF
-#endif
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_DOT3_RGB_EXT                   0x8740
-#define GL_DOT3_RGBA_EXT                  0x8741
-#endif
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_MIRROR_CLAMP_ATI               0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_ATI       0x8743
-#endif
-
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV               0x84F2
-#define GL_FENCE_STATUS_NV                0x84F3
-#define GL_FENCE_CONDITION_NV             0x84F4
-#endif
-
-#ifndef GL_IBM_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_IBM            0x8370
-#endif
-
-#ifndef GL_NV_evaluators
-#define GL_EVAL_2D_NV                     0x86C0
-#define GL_EVAL_TRIANGULAR_2D_NV          0x86C1
-#define GL_MAP_TESSELLATION_NV            0x86C2
-#define GL_MAP_ATTRIB_U_ORDER_NV          0x86C3
-#define GL_MAP_ATTRIB_V_ORDER_NV          0x86C4
-#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
-#define GL_EVAL_VERTEX_ATTRIB0_NV         0x86C6
-#define GL_EVAL_VERTEX_ATTRIB1_NV         0x86C7
-#define GL_EVAL_VERTEX_ATTRIB2_NV         0x86C8
-#define GL_EVAL_VERTEX_ATTRIB3_NV         0x86C9
-#define GL_EVAL_VERTEX_ATTRIB4_NV         0x86CA
-#define GL_EVAL_VERTEX_ATTRIB5_NV         0x86CB
-#define GL_EVAL_VERTEX_ATTRIB6_NV         0x86CC
-#define GL_EVAL_VERTEX_ATTRIB7_NV         0x86CD
-#define GL_EVAL_VERTEX_ATTRIB8_NV         0x86CE
-#define GL_EVAL_VERTEX_ATTRIB9_NV         0x86CF
-#define GL_EVAL_VERTEX_ATTRIB10_NV        0x86D0
-#define GL_EVAL_VERTEX_ATTRIB11_NV        0x86D1
-#define GL_EVAL_VERTEX_ATTRIB12_NV        0x86D2
-#define GL_EVAL_VERTEX_ATTRIB13_NV        0x86D3
-#define GL_EVAL_VERTEX_ATTRIB14_NV        0x86D4
-#define GL_EVAL_VERTEX_ATTRIB15_NV        0x86D5
-#define GL_MAX_MAP_TESSELLATION_NV        0x86D6
-#define GL_MAX_RATIONAL_EVAL_ORDER_NV     0x86D7
-#endif
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_DEPTH_STENCIL_NV               0x84F9
-#define GL_UNSIGNED_INT_24_8_NV           0x84FA
-#endif
-
-#ifndef GL_NV_register_combiners2
-#define GL_PER_STAGE_CONSTANTS_NV         0x8535
-#endif
-
-#ifndef GL_NV_texture_compression_vtc
-#endif
-
-#ifndef GL_NV_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_NV           0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV   0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV     0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV  0x84F8
-#endif
-
-#ifndef GL_NV_texture_shader
-#define GL_OFFSET_TEXTURE_RECTANGLE_NV    0x864C
-#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
-#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
-#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV      0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV  0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV          0x86DC
-#define GL_SHADER_CONSISTENT_NV           0x86DD
-#define GL_TEXTURE_SHADER_NV              0x86DE
-#define GL_SHADER_OPERATION_NV            0x86DF
-#define GL_CULL_MODES_NV                  0x86E0
-#define GL_OFFSET_TEXTURE_MATRIX_NV       0x86E1
-#define GL_OFFSET_TEXTURE_SCALE_NV        0x86E2
-#define GL_OFFSET_TEXTURE_BIAS_NV         0x86E3
-#define GL_OFFSET_TEXTURE_2D_MATRIX_NV    GL_OFFSET_TEXTURE_MATRIX_NV
-#define GL_OFFSET_TEXTURE_2D_SCALE_NV     GL_OFFSET_TEXTURE_SCALE_NV
-#define GL_OFFSET_TEXTURE_2D_BIAS_NV      GL_OFFSET_TEXTURE_BIAS_NV
-#define GL_PREVIOUS_TEXTURE_INPUT_NV      0x86E4
-#define GL_CONST_EYE_NV                   0x86E5
-#define GL_PASS_THROUGH_NV                0x86E6
-#define GL_CULL_FRAGMENT_NV               0x86E7
-#define GL_OFFSET_TEXTURE_2D_NV           0x86E8
-#define GL_DEPENDENT_AR_TEXTURE_2D_NV     0x86E9
-#define GL_DEPENDENT_GB_TEXTURE_2D_NV     0x86EA
-#define GL_DOT_PRODUCT_NV                 0x86EC
-#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV   0x86ED
-#define GL_DOT_PRODUCT_TEXTURE_2D_NV      0x86EE
-#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
-#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
-#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
-#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
-#define GL_HILO_NV                        0x86F4
-#define GL_DSDT_NV                        0x86F5
-#define GL_DSDT_MAG_NV                    0x86F6
-#define GL_DSDT_MAG_VIB_NV                0x86F7
-#define GL_HILO16_NV                      0x86F8
-#define GL_SIGNED_HILO_NV                 0x86F9
-#define GL_SIGNED_HILO16_NV               0x86FA
-#define GL_SIGNED_RGBA_NV                 0x86FB
-#define GL_SIGNED_RGBA8_NV                0x86FC
-#define GL_SIGNED_RGB_NV                  0x86FE
-#define GL_SIGNED_RGB8_NV                 0x86FF
-#define GL_SIGNED_LUMINANCE_NV            0x8701
-#define GL_SIGNED_LUMINANCE8_NV           0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV      0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV    0x8704
-#define GL_SIGNED_ALPHA_NV                0x8705
-#define GL_SIGNED_ALPHA8_NV               0x8706
-#define GL_SIGNED_INTENSITY_NV            0x8707
-#define GL_SIGNED_INTENSITY8_NV           0x8708
-#define GL_DSDT8_NV                       0x8709
-#define GL_DSDT8_MAG8_NV                  0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV       0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV   0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-#define GL_HI_SCALE_NV                    0x870E
-#define GL_LO_SCALE_NV                    0x870F
-#define GL_DS_SCALE_NV                    0x8710
-#define GL_DT_SCALE_NV                    0x8711
-#define GL_MAGNITUDE_SCALE_NV             0x8712
-#define GL_VIBRANCE_SCALE_NV              0x8713
-#define GL_HI_BIAS_NV                     0x8714
-#define GL_LO_BIAS_NV                     0x8715
-#define GL_DS_BIAS_NV                     0x8716
-#define GL_DT_BIAS_NV                     0x8717
-#define GL_MAGNITUDE_BIAS_NV              0x8718
-#define GL_VIBRANCE_BIAS_NV               0x8719
-#define GL_TEXTURE_BORDER_VALUES_NV       0x871A
-#define GL_TEXTURE_HI_SIZE_NV             0x871B
-#define GL_TEXTURE_LO_SIZE_NV             0x871C
-#define GL_TEXTURE_DS_SIZE_NV             0x871D
-#define GL_TEXTURE_DT_SIZE_NV             0x871E
-#define GL_TEXTURE_MAG_SIZE_NV            0x871F
-#endif
-
-#ifndef GL_NV_texture_shader2
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV      0x86EF
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
-#endif
-
-#ifndef GL_NV_vertex_program
-#define GL_VERTEX_PROGRAM_NV              0x8620
-#define GL_VERTEX_STATE_PROGRAM_NV        0x8621
-#define GL_ATTRIB_ARRAY_SIZE_NV           0x8623
-#define GL_ATTRIB_ARRAY_STRIDE_NV         0x8624
-#define GL_ATTRIB_ARRAY_TYPE_NV           0x8625
-#define GL_CURRENT_ATTRIB_NV              0x8626
-#define GL_PROGRAM_LENGTH_NV              0x8627
-#define GL_PROGRAM_STRING_NV              0x8628
-#define GL_MODELVIEW_PROJECTION_NV        0x8629
-#define GL_IDENTITY_NV                    0x862A
-#define GL_INVERSE_NV                     0x862B
-#define GL_TRANSPOSE_NV                   0x862C
-#define GL_INVERSE_TRANSPOSE_NV           0x862D
-#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
-#define GL_MAX_TRACK_MATRICES_NV          0x862F
-#define GL_MATRIX0_NV                     0x8630
-#define GL_MATRIX1_NV                     0x8631
-#define GL_MATRIX2_NV                     0x8632
-#define GL_MATRIX3_NV                     0x8633
-#define GL_MATRIX4_NV                     0x8634
-#define GL_MATRIX5_NV                     0x8635
-#define GL_MATRIX6_NV                     0x8636
-#define GL_MATRIX7_NV                     0x8637
-#define GL_CURRENT_MATRIX_STACK_DEPTH_NV  0x8640
-#define GL_CURRENT_MATRIX_NV              0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_NV   0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_NV     0x8643
-#define GL_PROGRAM_PARAMETER_NV           0x8644
-#define GL_ATTRIB_ARRAY_POINTER_NV        0x8645
-#define GL_PROGRAM_TARGET_NV              0x8646
-#define GL_PROGRAM_RESIDENT_NV            0x8647
-#define GL_TRACK_MATRIX_NV                0x8648
-#define GL_TRACK_MATRIX_TRANSFORM_NV      0x8649
-#define GL_VERTEX_PROGRAM_BINDING_NV      0x864A
-#define GL_PROGRAM_ERROR_POSITION_NV      0x864B
-#define GL_VERTEX_ATTRIB_ARRAY0_NV        0x8650
-#define GL_VERTEX_ATTRIB_ARRAY1_NV        0x8651
-#define GL_VERTEX_ATTRIB_ARRAY2_NV        0x8652
-#define GL_VERTEX_ATTRIB_ARRAY3_NV        0x8653
-#define GL_VERTEX_ATTRIB_ARRAY4_NV        0x8654
-#define GL_VERTEX_ATTRIB_ARRAY5_NV        0x8655
-#define GL_VERTEX_ATTRIB_ARRAY6_NV        0x8656
-#define GL_VERTEX_ATTRIB_ARRAY7_NV        0x8657
-#define GL_VERTEX_ATTRIB_ARRAY8_NV        0x8658
-#define GL_VERTEX_ATTRIB_ARRAY9_NV        0x8659
-#define GL_VERTEX_ATTRIB_ARRAY10_NV       0x865A
-#define GL_VERTEX_ATTRIB_ARRAY11_NV       0x865B
-#define GL_VERTEX_ATTRIB_ARRAY12_NV       0x865C
-#define GL_VERTEX_ATTRIB_ARRAY13_NV       0x865D
-#define GL_VERTEX_ATTRIB_ARRAY14_NV       0x865E
-#define GL_VERTEX_ATTRIB_ARRAY15_NV       0x865F
-#define GL_MAP1_VERTEX_ATTRIB0_4_NV       0x8660
-#define GL_MAP1_VERTEX_ATTRIB1_4_NV       0x8661
-#define GL_MAP1_VERTEX_ATTRIB2_4_NV       0x8662
-#define GL_MAP1_VERTEX_ATTRIB3_4_NV       0x8663
-#define GL_MAP1_VERTEX_ATTRIB4_4_NV       0x8664
-#define GL_MAP1_VERTEX_ATTRIB5_4_NV       0x8665
-#define GL_MAP1_VERTEX_ATTRIB6_4_NV       0x8666
-#define GL_MAP1_VERTEX_ATTRIB7_4_NV       0x8667
-#define GL_MAP1_VERTEX_ATTRIB8_4_NV       0x8668
-#define GL_MAP1_VERTEX_ATTRIB9_4_NV       0x8669
-#define GL_MAP1_VERTEX_ATTRIB10_4_NV      0x866A
-#define GL_MAP1_VERTEX_ATTRIB11_4_NV      0x866B
-#define GL_MAP1_VERTEX_ATTRIB12_4_NV      0x866C
-#define GL_MAP1_VERTEX_ATTRIB13_4_NV      0x866D
-#define GL_MAP1_VERTEX_ATTRIB14_4_NV      0x866E
-#define GL_MAP1_VERTEX_ATTRIB15_4_NV      0x866F
-#define GL_MAP2_VERTEX_ATTRIB0_4_NV       0x8670
-#define GL_MAP2_VERTEX_ATTRIB1_4_NV       0x8671
-#define GL_MAP2_VERTEX_ATTRIB2_4_NV       0x8672
-#define GL_MAP2_VERTEX_ATTRIB3_4_NV       0x8673
-#define GL_MAP2_VERTEX_ATTRIB4_4_NV       0x8674
-#define GL_MAP2_VERTEX_ATTRIB5_4_NV       0x8675
-#define GL_MAP2_VERTEX_ATTRIB6_4_NV       0x8676
-#define GL_MAP2_VERTEX_ATTRIB7_4_NV       0x8677
-#define GL_MAP2_VERTEX_ATTRIB8_4_NV       0x8678
-#define GL_MAP2_VERTEX_ATTRIB9_4_NV       0x8679
-#define GL_MAP2_VERTEX_ATTRIB10_4_NV      0x867A
-#define GL_MAP2_VERTEX_ATTRIB11_4_NV      0x867B
-#define GL_MAP2_VERTEX_ATTRIB12_4_NV      0x867C
-#define GL_MAP2_VERTEX_ATTRIB13_4_NV      0x867D
-#define GL_MAP2_VERTEX_ATTRIB14_4_NV      0x867E
-#define GL_MAP2_VERTEX_ATTRIB15_4_NV      0x867F
-#endif
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_TEXTURE_MAX_CLAMP_S_SGIX       0x8369
-#define GL_TEXTURE_MAX_CLAMP_T_SGIX       0x836A
-#define GL_TEXTURE_MAX_CLAMP_R_SGIX       0x836B
-#endif
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SCALEBIAS_HINT_SGIX            0x8322
-#endif
-
-#ifndef GL_OML_interlace
-#define GL_INTERLACE_OML                  0x8980
-#define GL_INTERLACE_READ_OML             0x8981
-#endif
-
-#ifndef GL_OML_subsample
-#define GL_FORMAT_SUBSAMPLE_24_24_OML     0x8982
-#define GL_FORMAT_SUBSAMPLE_244_244_OML   0x8983
-#endif
-
-#ifndef GL_OML_resample
-#define GL_PACK_RESAMPLE_OML              0x8984
-#define GL_UNPACK_RESAMPLE_OML            0x8985
-#define GL_RESAMPLE_REPLICATE_OML         0x8986
-#define GL_RESAMPLE_ZERO_FILL_OML         0x8987
-#define GL_RESAMPLE_AVERAGE_OML           0x8988
-#define GL_RESAMPLE_DECIMATE_OML          0x8989
-#endif
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_DEPTH_STENCIL_TO_RGBA_NV       0x886E
-#define GL_DEPTH_STENCIL_TO_BGRA_NV       0x886F
-#endif
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_BUMP_ROT_MATRIX_ATI            0x8775
-#define GL_BUMP_ROT_MATRIX_SIZE_ATI       0x8776
-#define GL_BUMP_NUM_TEX_UNITS_ATI         0x8777
-#define GL_BUMP_TEX_UNITS_ATI             0x8778
-#define GL_DUDV_ATI                       0x8779
-#define GL_DU8DV8_ATI                     0x877A
-#define GL_BUMP_ENVMAP_ATI                0x877B
-#define GL_BUMP_TARGET_ATI                0x877C
-#endif
-
-#ifndef GL_ATI_fragment_shader
-#define GL_FRAGMENT_SHADER_ATI            0x8920
-#define GL_REG_0_ATI                      0x8921
-#define GL_REG_1_ATI                      0x8922
-#define GL_REG_2_ATI                      0x8923
-#define GL_REG_3_ATI                      0x8924
-#define GL_REG_4_ATI                      0x8925
-#define GL_REG_5_ATI                      0x8926
-#define GL_REG_6_ATI                      0x8927
-#define GL_REG_7_ATI                      0x8928
-#define GL_REG_8_ATI                      0x8929
-#define GL_REG_9_ATI                      0x892A
-#define GL_REG_10_ATI                     0x892B
-#define GL_REG_11_ATI                     0x892C
-#define GL_REG_12_ATI                     0x892D
-#define GL_REG_13_ATI                     0x892E
-#define GL_REG_14_ATI                     0x892F
-#define GL_REG_15_ATI                     0x8930
-#define GL_REG_16_ATI                     0x8931
-#define GL_REG_17_ATI                     0x8932
-#define GL_REG_18_ATI                     0x8933
-#define GL_REG_19_ATI                     0x8934
-#define GL_REG_20_ATI                     0x8935
-#define GL_REG_21_ATI                     0x8936
-#define GL_REG_22_ATI                     0x8937
-#define GL_REG_23_ATI                     0x8938
-#define GL_REG_24_ATI                     0x8939
-#define GL_REG_25_ATI                     0x893A
-#define GL_REG_26_ATI                     0x893B
-#define GL_REG_27_ATI                     0x893C
-#define GL_REG_28_ATI                     0x893D
-#define GL_REG_29_ATI                     0x893E
-#define GL_REG_30_ATI                     0x893F
-#define GL_REG_31_ATI                     0x8940
-#define GL_CON_0_ATI                      0x8941
-#define GL_CON_1_ATI                      0x8942
-#define GL_CON_2_ATI                      0x8943
-#define GL_CON_3_ATI                      0x8944
-#define GL_CON_4_ATI                      0x8945
-#define GL_CON_5_ATI                      0x8946
-#define GL_CON_6_ATI                      0x8947
-#define GL_CON_7_ATI                      0x8948
-#define GL_CON_8_ATI                      0x8949
-#define GL_CON_9_ATI                      0x894A
-#define GL_CON_10_ATI                     0x894B
-#define GL_CON_11_ATI                     0x894C
-#define GL_CON_12_ATI                     0x894D
-#define GL_CON_13_ATI                     0x894E
-#define GL_CON_14_ATI                     0x894F
-#define GL_CON_15_ATI                     0x8950
-#define GL_CON_16_ATI                     0x8951
-#define GL_CON_17_ATI                     0x8952
-#define GL_CON_18_ATI                     0x8953
-#define GL_CON_19_ATI                     0x8954
-#define GL_CON_20_ATI                     0x8955
-#define GL_CON_21_ATI                     0x8956
-#define GL_CON_22_ATI                     0x8957
-#define GL_CON_23_ATI                     0x8958
-#define GL_CON_24_ATI                     0x8959
-#define GL_CON_25_ATI                     0x895A
-#define GL_CON_26_ATI                     0x895B
-#define GL_CON_27_ATI                     0x895C
-#define GL_CON_28_ATI                     0x895D
-#define GL_CON_29_ATI                     0x895E
-#define GL_CON_30_ATI                     0x895F
-#define GL_CON_31_ATI                     0x8960
-#define GL_MOV_ATI                        0x8961
-#define GL_ADD_ATI                        0x8963
-#define GL_MUL_ATI                        0x8964
-#define GL_SUB_ATI                        0x8965
-#define GL_DOT3_ATI                       0x8966
-#define GL_DOT4_ATI                       0x8967
-#define GL_MAD_ATI                        0x8968
-#define GL_LERP_ATI                       0x8969
-#define GL_CND_ATI                        0x896A
-#define GL_CND0_ATI                       0x896B
-#define GL_DOT2_ADD_ATI                   0x896C
-#define GL_SECONDARY_INTERPOLATOR_ATI     0x896D
-#define GL_NUM_FRAGMENT_REGISTERS_ATI     0x896E
-#define GL_NUM_FRAGMENT_CONSTANTS_ATI     0x896F
-#define GL_NUM_PASSES_ATI                 0x8970
-#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI  0x8971
-#define GL_NUM_INSTRUCTIONS_TOTAL_ATI     0x8972
-#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
-#define GL_NUM_LOOPBACK_COMPONENTS_ATI    0x8974
-#define GL_COLOR_ALPHA_PAIRING_ATI        0x8975
-#define GL_SWIZZLE_STR_ATI                0x8976
-#define GL_SWIZZLE_STQ_ATI                0x8977
-#define GL_SWIZZLE_STR_DR_ATI             0x8978
-#define GL_SWIZZLE_STQ_DQ_ATI             0x8979
-#define GL_SWIZZLE_STRQ_ATI               0x897A
-#define GL_SWIZZLE_STRQ_DQ_ATI            0x897B
-#define GL_RED_BIT_ATI                    0x00000001
-#define GL_GREEN_BIT_ATI                  0x00000002
-#define GL_BLUE_BIT_ATI                   0x00000004
-#define GL_2X_BIT_ATI                     0x00000001
-#define GL_4X_BIT_ATI                     0x00000002
-#define GL_8X_BIT_ATI                     0x00000004
-#define GL_HALF_BIT_ATI                   0x00000008
-#define GL_QUARTER_BIT_ATI                0x00000010
-#define GL_EIGHTH_BIT_ATI                 0x00000020
-#define GL_SATURATE_BIT_ATI               0x00000040
-#define GL_COMP_BIT_ATI                   0x00000002
-#define GL_NEGATE_BIT_ATI                 0x00000004
-#define GL_BIAS_BIT_ATI                   0x00000008
-#endif
-
-#ifndef GL_ATI_pn_triangles
-#define GL_PN_TRIANGLES_ATI               0x87F0
-#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
-#define GL_PN_TRIANGLES_POINT_MODE_ATI    0x87F2
-#define GL_PN_TRIANGLES_NORMAL_MODE_ATI   0x87F3
-#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
-#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
-#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
-#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
-#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
-#endif
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_STATIC_ATI                     0x8760
-#define GL_DYNAMIC_ATI                    0x8761
-#define GL_PRESERVE_ATI                   0x8762
-#define GL_DISCARD_ATI                    0x8763
-#define GL_OBJECT_BUFFER_SIZE_ATI         0x8764
-#define GL_OBJECT_BUFFER_USAGE_ATI        0x8765
-#define GL_ARRAY_OBJECT_BUFFER_ATI        0x8766
-#define GL_ARRAY_OBJECT_OFFSET_ATI        0x8767
-#endif
-
-#ifndef GL_EXT_vertex_shader
-#define GL_VERTEX_SHADER_EXT              0x8780
-#define GL_VERTEX_SHADER_BINDING_EXT      0x8781
-#define GL_OP_INDEX_EXT                   0x8782
-#define GL_OP_NEGATE_EXT                  0x8783
-#define GL_OP_DOT3_EXT                    0x8784
-#define GL_OP_DOT4_EXT                    0x8785
-#define GL_OP_MUL_EXT                     0x8786
-#define GL_OP_ADD_EXT                     0x8787
-#define GL_OP_MADD_EXT                    0x8788
-#define GL_OP_FRAC_EXT                    0x8789
-#define GL_OP_MAX_EXT                     0x878A
-#define GL_OP_MIN_EXT                     0x878B
-#define GL_OP_SET_GE_EXT                  0x878C
-#define GL_OP_SET_LT_EXT                  0x878D
-#define GL_OP_CLAMP_EXT                   0x878E
-#define GL_OP_FLOOR_EXT                   0x878F
-#define GL_OP_ROUND_EXT                   0x8790
-#define GL_OP_EXP_BASE_2_EXT              0x8791
-#define GL_OP_LOG_BASE_2_EXT              0x8792
-#define GL_OP_POWER_EXT                   0x8793
-#define GL_OP_RECIP_EXT                   0x8794
-#define GL_OP_RECIP_SQRT_EXT              0x8795
-#define GL_OP_SUB_EXT                     0x8796
-#define GL_OP_CROSS_PRODUCT_EXT           0x8797
-#define GL_OP_MULTIPLY_MATRIX_EXT         0x8798
-#define GL_OP_MOV_EXT                     0x8799
-#define GL_OUTPUT_VERTEX_EXT              0x879A
-#define GL_OUTPUT_COLOR0_EXT              0x879B
-#define GL_OUTPUT_COLOR1_EXT              0x879C
-#define GL_OUTPUT_TEXTURE_COORD0_EXT      0x879D
-#define GL_OUTPUT_TEXTURE_COORD1_EXT      0x879E
-#define GL_OUTPUT_TEXTURE_COORD2_EXT      0x879F
-#define GL_OUTPUT_TEXTURE_COORD3_EXT      0x87A0
-#define GL_OUTPUT_TEXTURE_COORD4_EXT      0x87A1
-#define GL_OUTPUT_TEXTURE_COORD5_EXT      0x87A2
-#define GL_OUTPUT_TEXTURE_COORD6_EXT      0x87A3
-#define GL_OUTPUT_TEXTURE_COORD7_EXT      0x87A4
-#define GL_OUTPUT_TEXTURE_COORD8_EXT      0x87A5
-#define GL_OUTPUT_TEXTURE_COORD9_EXT      0x87A6
-#define GL_OUTPUT_TEXTURE_COORD10_EXT     0x87A7
-#define GL_OUTPUT_TEXTURE_COORD11_EXT     0x87A8
-#define GL_OUTPUT_TEXTURE_COORD12_EXT     0x87A9
-#define GL_OUTPUT_TEXTURE_COORD13_EXT     0x87AA
-#define GL_OUTPUT_TEXTURE_COORD14_EXT     0x87AB
-#define GL_OUTPUT_TEXTURE_COORD15_EXT     0x87AC
-#define GL_OUTPUT_TEXTURE_COORD16_EXT     0x87AD
-#define GL_OUTPUT_TEXTURE_COORD17_EXT     0x87AE
-#define GL_OUTPUT_TEXTURE_COORD18_EXT     0x87AF
-#define GL_OUTPUT_TEXTURE_COORD19_EXT     0x87B0
-#define GL_OUTPUT_TEXTURE_COORD20_EXT     0x87B1
-#define GL_OUTPUT_TEXTURE_COORD21_EXT     0x87B2
-#define GL_OUTPUT_TEXTURE_COORD22_EXT     0x87B3
-#define GL_OUTPUT_TEXTURE_COORD23_EXT     0x87B4
-#define GL_OUTPUT_TEXTURE_COORD24_EXT     0x87B5
-#define GL_OUTPUT_TEXTURE_COORD25_EXT     0x87B6
-#define GL_OUTPUT_TEXTURE_COORD26_EXT     0x87B7
-#define GL_OUTPUT_TEXTURE_COORD27_EXT     0x87B8
-#define GL_OUTPUT_TEXTURE_COORD28_EXT     0x87B9
-#define GL_OUTPUT_TEXTURE_COORD29_EXT     0x87BA
-#define GL_OUTPUT_TEXTURE_COORD30_EXT     0x87BB
-#define GL_OUTPUT_TEXTURE_COORD31_EXT     0x87BC
-#define GL_OUTPUT_FOG_EXT                 0x87BD
-#define GL_SCALAR_EXT                     0x87BE
-#define GL_VECTOR_EXT                     0x87BF
-#define GL_MATRIX_EXT                     0x87C0
-#define GL_VARIANT_EXT                    0x87C1
-#define GL_INVARIANT_EXT                  0x87C2
-#define GL_LOCAL_CONSTANT_EXT             0x87C3
-#define GL_LOCAL_EXT                      0x87C4
-#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
-#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
-#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
-#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
-#define GL_MAX_VERTEX_SHADER_LOCALS_EXT   0x87C9
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
-#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
-#define GL_VERTEX_SHADER_VARIANTS_EXT     0x87D0
-#define GL_VERTEX_SHADER_INVARIANTS_EXT   0x87D1
-#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
-#define GL_VERTEX_SHADER_LOCALS_EXT       0x87D3
-#define GL_VERTEX_SHADER_OPTIMIZED_EXT    0x87D4
-#define GL_X_EXT                          0x87D5
-#define GL_Y_EXT                          0x87D6
-#define GL_Z_EXT                          0x87D7
-#define GL_W_EXT                          0x87D8
-#define GL_NEGATIVE_X_EXT                 0x87D9
-#define GL_NEGATIVE_Y_EXT                 0x87DA
-#define GL_NEGATIVE_Z_EXT                 0x87DB
-#define GL_NEGATIVE_W_EXT                 0x87DC
-#define GL_ZERO_EXT                       0x87DD
-#define GL_ONE_EXT                        0x87DE
-#define GL_NEGATIVE_ONE_EXT               0x87DF
-#define GL_NORMALIZED_RANGE_EXT           0x87E0
-#define GL_FULL_RANGE_EXT                 0x87E1
-#define GL_CURRENT_VERTEX_EXT             0x87E2
-#define GL_MVP_MATRIX_EXT                 0x87E3
-#define GL_VARIANT_VALUE_EXT              0x87E4
-#define GL_VARIANT_DATATYPE_EXT           0x87E5
-#define GL_VARIANT_ARRAY_STRIDE_EXT       0x87E6
-#define GL_VARIANT_ARRAY_TYPE_EXT         0x87E7
-#define GL_VARIANT_ARRAY_EXT              0x87E8
-#define GL_VARIANT_ARRAY_POINTER_EXT      0x87E9
-#define GL_INVARIANT_VALUE_EXT            0x87EA
-#define GL_INVARIANT_DATATYPE_EXT         0x87EB
-#define GL_LOCAL_CONSTANT_VALUE_EXT       0x87EC
-#define GL_LOCAL_CONSTANT_DATATYPE_EXT    0x87ED
-#endif
-
-#ifndef GL_ATI_vertex_streams
-#define GL_MAX_VERTEX_STREAMS_ATI         0x876B
-#define GL_VERTEX_STREAM0_ATI             0x876C
-#define GL_VERTEX_STREAM1_ATI             0x876D
-#define GL_VERTEX_STREAM2_ATI             0x876E
-#define GL_VERTEX_STREAM3_ATI             0x876F
-#define GL_VERTEX_STREAM4_ATI             0x8770
-#define GL_VERTEX_STREAM5_ATI             0x8771
-#define GL_VERTEX_STREAM6_ATI             0x8772
-#define GL_VERTEX_STREAM7_ATI             0x8773
-#define GL_VERTEX_SOURCE_ATI              0x8774
-#endif
-
-#ifndef GL_ATI_element_array
-#define GL_ELEMENT_ARRAY_ATI              0x8768
-#define GL_ELEMENT_ARRAY_TYPE_ATI         0x8769
-#define GL_ELEMENT_ARRAY_POINTER_ATI      0x876A
-#endif
-
-#ifndef GL_SUN_mesh_array
-#define GL_QUAD_MESH_SUN                  0x8614
-#define GL_TRIANGLE_MESH_SUN              0x8615
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SLICE_ACCUM_SUN                0x85CC
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_MULTISAMPLE_FILTER_HINT_NV     0x8534
-#endif
-
-#ifndef GL_NV_depth_clamp
-#define GL_DEPTH_CLAMP_NV                 0x864F
-#endif
-
-#ifndef GL_NV_occlusion_query
-#define GL_PIXEL_COUNTER_BITS_NV          0x8864
-#define GL_CURRENT_OCCLUSION_QUERY_ID_NV  0x8865
-#define GL_PIXEL_COUNT_NV                 0x8866
-#define GL_PIXEL_COUNT_AVAILABLE_NV       0x8867
-#endif
-
-#ifndef GL_NV_point_sprite
-#define GL_POINT_SPRITE_NV                0x8861
-#define GL_COORD_REPLACE_NV               0x8862
-#define GL_POINT_SPRITE_R_MODE_NV         0x8863
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
-#define GL_OFFSET_HILO_TEXTURE_2D_NV      0x8854
-#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
-#define GL_DEPENDENT_HILO_TEXTURE_2D_NV   0x8858
-#define GL_DEPENDENT_RGB_TEXTURE_3D_NV    0x8859
-#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
-#define GL_DOT_PRODUCT_PASS_THROUGH_NV    0x885B
-#define GL_DOT_PRODUCT_TEXTURE_1D_NV      0x885C
-#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
-#define GL_HILO8_NV                       0x885E
-#define GL_SIGNED_HILO8_NV                0x885F
-#define GL_FORCE_BLUE_TO_ONE_NV           0x8860
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_STENCIL_TEST_TWO_SIDE_EXT      0x8910
-#define GL_ACTIVE_STENCIL_FACE_EXT        0x8911
-#endif
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_TEXT_FRAGMENT_SHADER_ATI       0x8200
-#endif
-
-#ifndef GL_APPLE_client_storage
-#define GL_UNPACK_CLIENT_STORAGE_APPLE    0x85B2
-#endif
-
-#ifndef GL_APPLE_element_array
-#define GL_ELEMENT_ARRAY_APPLE            0x8A0C
-#define GL_ELEMENT_ARRAY_TYPE_APPLE       0x8A0D
-#define GL_ELEMENT_ARRAY_POINTER_APPLE    0x8A0E
-#endif
-
-#ifndef GL_APPLE_fence
-#define GL_DRAW_PIXELS_APPLE              0x8A0A
-#define GL_FENCE_APPLE                    0x8A0B
-#endif
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING_APPLE     0x85B5
-#endif
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_APPLE       0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
-#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
-#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
-#define GL_STORAGE_CLIENT_APPLE           0x85B4
-#define GL_STORAGE_CACHED_APPLE           0x85BE
-#define GL_STORAGE_SHARED_APPLE           0x85BF
-#endif
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_YCBCR_422_APPLE                0x85B9
-#define GL_UNSIGNED_SHORT_8_8_APPLE       0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE   0x85BB
-#endif
-
-#ifndef GL_S3_s3tc
-#define GL_RGB_S3TC                       0x83A0
-#define GL_RGB4_S3TC                      0x83A1
-#define GL_RGBA_S3TC                      0x83A2
-#define GL_RGBA4_S3TC                     0x83A3
-#endif
-
-#ifndef GL_ATI_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ATI           0x8824
-#define GL_DRAW_BUFFER0_ATI               0x8825
-#define GL_DRAW_BUFFER1_ATI               0x8826
-#define GL_DRAW_BUFFER2_ATI               0x8827
-#define GL_DRAW_BUFFER3_ATI               0x8828
-#define GL_DRAW_BUFFER4_ATI               0x8829
-#define GL_DRAW_BUFFER5_ATI               0x882A
-#define GL_DRAW_BUFFER6_ATI               0x882B
-#define GL_DRAW_BUFFER7_ATI               0x882C
-#define GL_DRAW_BUFFER8_ATI               0x882D
-#define GL_DRAW_BUFFER9_ATI               0x882E
-#define GL_DRAW_BUFFER10_ATI              0x882F
-#define GL_DRAW_BUFFER11_ATI              0x8830
-#define GL_DRAW_BUFFER12_ATI              0x8831
-#define GL_DRAW_BUFFER13_ATI              0x8832
-#define GL_DRAW_BUFFER14_ATI              0x8833
-#define GL_DRAW_BUFFER15_ATI              0x8834
-#endif
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_TYPE_RGBA_FLOAT_ATI            0x8820
-#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
-#endif
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_MODULATE_ADD_ATI               0x8744
-#define GL_MODULATE_SIGNED_ADD_ATI        0x8745
-#define GL_MODULATE_SUBTRACT_ATI          0x8746
-#endif
-
-#ifndef GL_ATI_texture_float
-#define GL_RGBA_FLOAT32_ATI               0x8814
-#define GL_RGB_FLOAT32_ATI                0x8815
-#define GL_ALPHA_FLOAT32_ATI              0x8816
-#define GL_INTENSITY_FLOAT32_ATI          0x8817
-#define GL_LUMINANCE_FLOAT32_ATI          0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_ATI    0x8819
-#define GL_RGBA_FLOAT16_ATI               0x881A
-#define GL_RGB_FLOAT16_ATI                0x881B
-#define GL_ALPHA_FLOAT16_ATI              0x881C
-#define GL_INTENSITY_FLOAT16_ATI          0x881D
-#define GL_LUMINANCE_FLOAT16_ATI          0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_ATI    0x881F
-#endif
-
-#ifndef GL_NV_float_buffer
-#define GL_FLOAT_R_NV                     0x8880
-#define GL_FLOAT_RG_NV                    0x8881
-#define GL_FLOAT_RGB_NV                   0x8882
-#define GL_FLOAT_RGBA_NV                  0x8883
-#define GL_FLOAT_R16_NV                   0x8884
-#define GL_FLOAT_R32_NV                   0x8885
-#define GL_FLOAT_RG16_NV                  0x8886
-#define GL_FLOAT_RG32_NV                  0x8887
-#define GL_FLOAT_RGB16_NV                 0x8888
-#define GL_FLOAT_RGB32_NV                 0x8889
-#define GL_FLOAT_RGBA16_NV                0x888A
-#define GL_FLOAT_RGBA32_NV                0x888B
-#define GL_TEXTURE_FLOAT_COMPONENTS_NV    0x888C
-#define GL_FLOAT_CLEAR_COLOR_VALUE_NV     0x888D
-#define GL_FLOAT_RGBA_MODE_NV             0x888E
-#endif
-
-#ifndef GL_NV_fragment_program
-#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
-#define GL_FRAGMENT_PROGRAM_NV            0x8870
-#define GL_MAX_TEXTURE_COORDS_NV          0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_NV     0x8872
-#define GL_FRAGMENT_PROGRAM_BINDING_NV    0x8873
-#define GL_PROGRAM_ERROR_STRING_NV        0x8874
-#endif
-
-#ifndef GL_NV_half_float
-#define GL_HALF_FLOAT_NV                  0x140B
-#endif
-
-#ifndef GL_NV_pixel_data_range
-#define GL_WRITE_PIXEL_DATA_RANGE_NV      0x8878
-#define GL_READ_PIXEL_DATA_RANGE_NV       0x8879
-#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
-#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
-#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
-#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
-#endif
-
-#ifndef GL_NV_primitive_restart
-#define GL_PRIMITIVE_RESTART_NV           0x8558
-#define GL_PRIMITIVE_RESTART_INDEX_NV     0x8559
-#endif
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
-#endif
-
-#ifndef GL_NV_vertex_program2
-#endif
-
-#ifndef GL_ATI_map_object_buffer
-#endif
-
-#ifndef GL_ATI_separate_stencil
-#define GL_STENCIL_BACK_FUNC_ATI          0x8800
-#define GL_STENCIL_BACK_FAIL_ATI          0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
-#endif
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#endif
-
-#ifndef GL_OES_read_format
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-#endif
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_DEPTH_BOUNDS_TEST_EXT          0x8890
-#define GL_DEPTH_BOUNDS_EXT               0x8891
-#endif
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_MIRROR_CLAMP_EXT               0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_EXT       0x8743
-#define GL_MIRROR_CLAMP_TO_BORDER_EXT     0x8912
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_BLEND_EQUATION_RGB_EXT         0x8009
-#define GL_BLEND_EQUATION_ALPHA_EXT       0x883D
-#endif
-
-#ifndef GL_MESA_pack_invert
-#define GL_PACK_INVERT_MESA               0x8758
-#endif
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_UNSIGNED_SHORT_8_8_MESA        0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_MESA    0x85BB
-#define GL_YCBCR_MESA                     0x8757
-#endif
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_EXT          0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_EXT        0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_EXT  0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
-#endif
-
-#ifndef GL_NV_fragment_program_option
-#endif
-
-#ifndef GL_NV_fragment_program2
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV      0x88F5
-#define GL_MAX_PROGRAM_IF_DEPTH_NV        0x88F6
-#define GL_MAX_PROGRAM_LOOP_DEPTH_NV      0x88F7
-#define GL_MAX_PROGRAM_LOOP_COUNT_NV      0x88F8
-#endif
-
-#ifndef GL_NV_vertex_program2_option
-/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
-/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
-#endif
-
-#ifndef GL_NV_vertex_program3
-/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
-#define GL_MAX_RENDERBUFFER_SIZE_EXT      0x84E8
-#define GL_FRAMEBUFFER_BINDING_EXT        0x8CA6
-#define GL_RENDERBUFFER_BINDING_EXT       0x8CA7
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE_EXT       0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED_EXT    0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS_EXT      0x8CDF
-#define GL_COLOR_ATTACHMENT0_EXT          0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT          0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT          0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT          0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT          0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT          0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT          0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT          0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT          0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT          0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT         0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT         0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT         0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT         0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT         0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT         0x8CEF
-#define GL_DEPTH_ATTACHMENT_EXT           0x8D00
-#define GL_STENCIL_ATTACHMENT_EXT         0x8D20
-#define GL_FRAMEBUFFER_EXT                0x8D40
-#define GL_RENDERBUFFER_EXT               0x8D41
-#define GL_RENDERBUFFER_WIDTH_EXT         0x8D42
-#define GL_RENDERBUFFER_HEIGHT_EXT        0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
-#define GL_STENCIL_INDEX1_EXT             0x8D46
-#define GL_STENCIL_INDEX4_EXT             0x8D47
-#define GL_STENCIL_INDEX8_EXT             0x8D48
-#define GL_STENCIL_INDEX16_EXT            0x8D49
-#define GL_RENDERBUFFER_RED_SIZE_EXT      0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_EXT    0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_EXT     0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE_EXT    0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE_EXT    0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE_EXT  0x8D55
-#endif
-
-#ifndef GL_GREMEDY_string_marker
-#endif
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_DEPTH_STENCIL_EXT              0x84F9
-#define GL_UNSIGNED_INT_24_8_EXT          0x84FA
-#define GL_DEPTH24_STENCIL8_EXT           0x88F0
-#define GL_TEXTURE_STENCIL_SIZE_EXT       0x88F1
-#endif
-
-#ifndef GL_EXT_stencil_clear_tag
-#define GL_STENCIL_TAG_BITS_EXT           0x88F2
-#define GL_STENCIL_CLEAR_TAG_VALUE_EXT    0x88F3
-#endif
-
-#ifndef GL_EXT_texture_sRGB
-#define GL_SRGB_EXT                       0x8C40
-#define GL_SRGB8_EXT                      0x8C41
-#define GL_SRGB_ALPHA_EXT                 0x8C42
-#define GL_SRGB8_ALPHA8_EXT               0x8C43
-#define GL_SLUMINANCE_ALPHA_EXT           0x8C44
-#define GL_SLUMINANCE8_ALPHA8_EXT         0x8C45
-#define GL_SLUMINANCE_EXT                 0x8C46
-#define GL_SLUMINANCE8_EXT                0x8C47
-#define GL_COMPRESSED_SRGB_EXT            0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA_EXT      0x8C49
-#define GL_COMPRESSED_SLUMINANCE_EXT      0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
-#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT  0x8C4C
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
-#endif
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_READ_FRAMEBUFFER_EXT           0x8CA8
-#define GL_DRAW_FRAMEBUFFER_EXT           0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_EXT   GL_FRAMEBUFFER_BINDING_EXT
-#define GL_READ_FRAMEBUFFER_BINDING_EXT   0x8CAA
-#endif
-
-#ifndef GL_EXT_framebuffer_multisample
-#define GL_RENDERBUFFER_SAMPLES_EXT       0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
-#define GL_MAX_SAMPLES_EXT                0x8D57
-#endif
-
-#ifndef GL_MESAX_texture_stack
-#define GL_TEXTURE_1D_STACK_MESAX         0x8759
-#define GL_TEXTURE_2D_STACK_MESAX         0x875A
-#define GL_PROXY_TEXTURE_1D_STACK_MESAX   0x875B
-#define GL_PROXY_TEXTURE_2D_STACK_MESAX   0x875C
-#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
-#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
-#endif
-
-#ifndef GL_EXT_timer_query
-#define GL_TIME_ELAPSED_EXT               0x88BF
-#endif
-
-#ifndef GL_EXT_gpu_program_parameters
-#endif
-
-#ifndef GL_APPLE_flush_buffer_range
-#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
-#define GL_BUFFER_FLUSHING_UNMAP_APPLE    0x8A13
-#endif
-
-#ifndef GL_NV_gpu_program4
-#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV    0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV    0x8905
-#define GL_PROGRAM_ATTRIB_COMPONENTS_NV   0x8906
-#define GL_PROGRAM_RESULT_COMPONENTS_NV   0x8907
-#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
-#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
-#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
-#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
-#endif
-
-#ifndef GL_NV_geometry_program4
-#define GL_LINES_ADJACENCY_EXT            0x000A
-#define GL_LINE_STRIP_ADJACENCY_EXT       0x000B
-#define GL_TRIANGLES_ADJACENCY_EXT        0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY_EXT   0x000D
-#define GL_GEOMETRY_PROGRAM_NV            0x8C26
-#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
-#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
-#define GL_GEOMETRY_VERTICES_OUT_EXT      0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_EXT        0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_EXT       0x8DDC
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
-#define GL_PROGRAM_POINT_SIZE_EXT         0x8642
-#endif
-
-#ifndef GL_EXT_geometry_shader4
-#define GL_GEOMETRY_SHADER_EXT            0x8DD9
-/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */
-/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */
-/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */
-/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
-#define GL_MAX_VARYING_COMPONENTS_EXT     0x8B4B
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
-/* reuse GL_LINES_ADJACENCY_EXT */
-/* reuse GL_LINE_STRIP_ADJACENCY_EXT */
-/* reuse GL_TRIANGLES_ADJACENCY_EXT */
-/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */
-/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
-/* reuse GL_PROGRAM_POINT_SIZE_EXT */
-#endif
-
-#ifndef GL_NV_vertex_program4
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
-#endif
-
-#ifndef GL_EXT_gpu_shader4
-#define GL_SAMPLER_1D_ARRAY_EXT           0x8DC0
-#define GL_SAMPLER_2D_ARRAY_EXT           0x8DC1
-#define GL_SAMPLER_BUFFER_EXT             0x8DC2
-#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT    0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT    0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW_EXT        0x8DC5
-#define GL_UNSIGNED_INT_VEC2_EXT          0x8DC6
-#define GL_UNSIGNED_INT_VEC3_EXT          0x8DC7
-#define GL_UNSIGNED_INT_VEC4_EXT          0x8DC8
-#define GL_INT_SAMPLER_1D_EXT             0x8DC9
-#define GL_INT_SAMPLER_2D_EXT             0x8DCA
-#define GL_INT_SAMPLER_3D_EXT             0x8DCB
-#define GL_INT_SAMPLER_CUBE_EXT           0x8DCC
-#define GL_INT_SAMPLER_2D_RECT_EXT        0x8DCD
-#define GL_INT_SAMPLER_1D_ARRAY_EXT       0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY_EXT       0x8DCF
-#define GL_INT_SAMPLER_BUFFER_EXT         0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_1D_EXT    0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D_EXT    0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D_EXT    0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT  0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
-#endif
-
-#ifndef GL_EXT_draw_instanced
-#endif
-
-#ifndef GL_EXT_packed_float
-#define GL_R11F_G11F_B10F_EXT             0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
-#define GL_RGBA_SIGNED_COMPONENTS_EXT     0x8C3C
-#endif
-
-#ifndef GL_EXT_texture_array
-#define GL_TEXTURE_1D_ARRAY_EXT           0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY_EXT     0x8C19
-#define GL_TEXTURE_2D_ARRAY_EXT           0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY_EXT     0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY_EXT   0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY_EXT   0x8C1D
-#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT   0x88FF
-#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
-/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
-#endif
-
-#ifndef GL_EXT_texture_buffer_object
-#define GL_TEXTURE_BUFFER_EXT             0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT    0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_EXT     0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_EXT      0x8C2E
-#endif
-
-#ifndef GL_EXT_texture_compression_latc
-#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
-#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
-#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
-#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
-#endif
-
-#ifndef GL_EXT_texture_compression_rgtc
-#define GL_COMPRESSED_RED_RGTC1_EXT       0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
-#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
-#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
-#endif
-
-#ifndef GL_EXT_texture_shared_exponent
-#define GL_RGB9_E5_EXT                    0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT   0x8C3E
-#define GL_TEXTURE_SHARED_SIZE_EXT        0x8C3F
-#endif
-
-#ifndef GL_NV_depth_buffer_float
-#define GL_DEPTH_COMPONENT32F_NV          0x8DAB
-#define GL_DEPTH32F_STENCIL8_NV           0x8DAC
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
-#define GL_DEPTH_BUFFER_FLOAT_MODE_NV     0x8DAF
-#endif
-
-#ifndef GL_NV_fragment_program4
-#endif
-
-#ifndef GL_NV_framebuffer_multisample_coverage
-#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
-#define GL_RENDERBUFFER_COLOR_SAMPLES_NV  0x8E10
-#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
-#define GL_MULTISAMPLE_COVERAGE_MODES_NV  0x8E12
-#endif
-
-#ifndef GL_EXT_framebuffer_sRGB
-#define GL_FRAMEBUFFER_SRGB_EXT           0x8DB9
-#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT   0x8DBA
-#endif
-
-#ifndef GL_NV_geometry_shader4
-#endif
-
-#ifndef GL_NV_parameter_buffer_object
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
-#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
-#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
-#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
-#endif
-
-#ifndef GL_EXT_draw_buffers2
-#endif
-
-#ifndef GL_NV_transform_feedback
-#define GL_BACK_PRIMARY_COLOR_NV          0x8C77
-#define GL_BACK_SECONDARY_COLOR_NV        0x8C78
-#define GL_TEXTURE_COORD_NV               0x8C79
-#define GL_CLIP_DISTANCE_NV               0x8C7A
-#define GL_VERTEX_ID_NV                   0x8C7B
-#define GL_PRIMITIVE_ID_NV                0x8C7C
-#define GL_GENERIC_ATTRIB_NV              0x8C7D
-#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV  0x8C7E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
-#define GL_ACTIVE_VARYINGS_NV             0x8C81
-#define GL_ACTIVE_VARYING_MAX_LENGTH_NV   0x8C82
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
-#define GL_TRANSFORM_FEEDBACK_RECORD_NV   0x8C86
-#define GL_PRIMITIVES_GENERATED_NV        0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
-#define GL_RASTERIZER_DISCARD_NV          0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS_NV         0x8C8C
-#define GL_SEPARATE_ATTRIBS_NV            0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER_NV   0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
-#define GL_LAYER_NV                       0x8DAA
-#define GL_NEXT_BUFFER_NV                 -2
-#define GL_SKIP_COMPONENTS4_NV            -3
-#define GL_SKIP_COMPONENTS3_NV            -4
-#define GL_SKIP_COMPONENTS2_NV            -5
-#define GL_SKIP_COMPONENTS1_NV            -6
-#endif
-
-#ifndef GL_EXT_bindable_uniform
-#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
-#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
-#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
-#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT  0x8DED
-#define GL_UNIFORM_BUFFER_EXT             0x8DEE
-#define GL_UNIFORM_BUFFER_BINDING_EXT     0x8DEF
-#endif
-
-#ifndef GL_EXT_texture_integer
-#define GL_RGBA32UI_EXT                   0x8D70
-#define GL_RGB32UI_EXT                    0x8D71
-#define GL_ALPHA32UI_EXT                  0x8D72
-#define GL_INTENSITY32UI_EXT              0x8D73
-#define GL_LUMINANCE32UI_EXT              0x8D74
-#define GL_LUMINANCE_ALPHA32UI_EXT        0x8D75
-#define GL_RGBA16UI_EXT                   0x8D76
-#define GL_RGB16UI_EXT                    0x8D77
-#define GL_ALPHA16UI_EXT                  0x8D78
-#define GL_INTENSITY16UI_EXT              0x8D79
-#define GL_LUMINANCE16UI_EXT              0x8D7A
-#define GL_LUMINANCE_ALPHA16UI_EXT        0x8D7B
-#define GL_RGBA8UI_EXT                    0x8D7C
-#define GL_RGB8UI_EXT                     0x8D7D
-#define GL_ALPHA8UI_EXT                   0x8D7E
-#define GL_INTENSITY8UI_EXT               0x8D7F
-#define GL_LUMINANCE8UI_EXT               0x8D80
-#define GL_LUMINANCE_ALPHA8UI_EXT         0x8D81
-#define GL_RGBA32I_EXT                    0x8D82
-#define GL_RGB32I_EXT                     0x8D83
-#define GL_ALPHA32I_EXT                   0x8D84
-#define GL_INTENSITY32I_EXT               0x8D85
-#define GL_LUMINANCE32I_EXT               0x8D86
-#define GL_LUMINANCE_ALPHA32I_EXT         0x8D87
-#define GL_RGBA16I_EXT                    0x8D88
-#define GL_RGB16I_EXT                     0x8D89
-#define GL_ALPHA16I_EXT                   0x8D8A
-#define GL_INTENSITY16I_EXT               0x8D8B
-#define GL_LUMINANCE16I_EXT               0x8D8C
-#define GL_LUMINANCE_ALPHA16I_EXT         0x8D8D
-#define GL_RGBA8I_EXT                     0x8D8E
-#define GL_RGB8I_EXT                      0x8D8F
-#define GL_ALPHA8I_EXT                    0x8D90
-#define GL_INTENSITY8I_EXT                0x8D91
-#define GL_LUMINANCE8I_EXT                0x8D92
-#define GL_LUMINANCE_ALPHA8I_EXT          0x8D93
-#define GL_RED_INTEGER_EXT                0x8D94
-#define GL_GREEN_INTEGER_EXT              0x8D95
-#define GL_BLUE_INTEGER_EXT               0x8D96
-#define GL_ALPHA_INTEGER_EXT              0x8D97
-#define GL_RGB_INTEGER_EXT                0x8D98
-#define GL_RGBA_INTEGER_EXT               0x8D99
-#define GL_BGR_INTEGER_EXT                0x8D9A
-#define GL_BGRA_INTEGER_EXT               0x8D9B
-#define GL_LUMINANCE_INTEGER_EXT          0x8D9C
-#define GL_LUMINANCE_ALPHA_INTEGER_EXT    0x8D9D
-#define GL_RGBA_INTEGER_MODE_EXT          0x8D9E
-#endif
-
-#ifndef GL_GREMEDY_frame_terminator
-#endif
-
-#ifndef GL_NV_conditional_render
-#define GL_QUERY_WAIT_NV                  0x8E13
-#define GL_QUERY_NO_WAIT_NV               0x8E14
-#define GL_QUERY_BY_REGION_WAIT_NV        0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT_NV     0x8E16
-#endif
-
-#ifndef GL_NV_present_video
-#define GL_FRAME_NV                       0x8E26
-#define GL_FIELDS_NV                      0x8E27
-#define GL_CURRENT_TIME_NV                0x8E28
-#define GL_NUM_FILL_STREAMS_NV            0x8E29
-#define GL_PRESENT_TIME_NV                0x8E2A
-#define GL_PRESENT_DURATION_NV            0x8E2B
-#endif
-
-#ifndef GL_EXT_transform_feedback
-#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT  0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
-#define GL_INTERLEAVED_ATTRIBS_EXT        0x8C8C
-#define GL_SEPARATE_ATTRIBS_EXT           0x8C8D
-#define GL_PRIMITIVES_GENERATED_EXT       0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
-#define GL_RASTERIZER_DISCARD_EXT         0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
-#endif
-
-#ifndef GL_EXT_direct_state_access
-#define GL_PROGRAM_MATRIX_EXT             0x8E2D
-#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT   0x8E2E
-#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
-#endif
-
-#ifndef GL_EXT_vertex_array_bgra
-/* reuse GL_BGRA */
-#endif
-
-#ifndef GL_EXT_texture_swizzle
-#define GL_TEXTURE_SWIZZLE_R_EXT          0x8E42
-#define GL_TEXTURE_SWIZZLE_G_EXT          0x8E43
-#define GL_TEXTURE_SWIZZLE_B_EXT          0x8E44
-#define GL_TEXTURE_SWIZZLE_A_EXT          0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA_EXT       0x8E46
-#endif
-
-#ifndef GL_NV_explicit_multisample
-#define GL_SAMPLE_POSITION_NV             0x8E50
-#define GL_SAMPLE_MASK_NV                 0x8E51
-#define GL_SAMPLE_MASK_VALUE_NV           0x8E52
-#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
-#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
-#define GL_TEXTURE_RENDERBUFFER_NV        0x8E55
-#define GL_SAMPLER_RENDERBUFFER_NV        0x8E56
-#define GL_INT_SAMPLER_RENDERBUFFER_NV    0x8E57
-#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
-#define GL_MAX_SAMPLE_MASK_WORDS_NV       0x8E59
-#endif
-
-#ifndef GL_NV_transform_feedback2
-#define GL_TRANSFORM_FEEDBACK_NV          0x8E22
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING_NV  0x8E25
-#endif
-
-#ifndef GL_ATI_meminfo
-#define GL_VBO_FREE_MEMORY_ATI            0x87FB
-#define GL_TEXTURE_FREE_MEMORY_ATI        0x87FC
-#define GL_RENDERBUFFER_FREE_MEMORY_ATI   0x87FD
-#endif
-
-#ifndef GL_AMD_performance_monitor
-#define GL_COUNTER_TYPE_AMD               0x8BC0
-#define GL_COUNTER_RANGE_AMD              0x8BC1
-#define GL_UNSIGNED_INT64_AMD             0x8BC2
-#define GL_PERCENTAGE_AMD                 0x8BC3
-#define GL_PERFMON_RESULT_AVAILABLE_AMD   0x8BC4
-#define GL_PERFMON_RESULT_SIZE_AMD        0x8BC5
-#define GL_PERFMON_RESULT_AMD             0x8BC6
-#endif
-
-#ifndef GL_AMD_texture_texture4
-#endif
-
-#ifndef GL_AMD_vertex_shader_tesselator
-#define GL_SAMPLER_BUFFER_AMD             0x9001
-#define GL_INT_SAMPLER_BUFFER_AMD         0x9002
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003
-#define GL_TESSELLATION_MODE_AMD          0x9004
-#define GL_TESSELLATION_FACTOR_AMD        0x9005
-#define GL_DISCRETE_AMD                   0x9006
-#define GL_CONTINUOUS_AMD                 0x9007
-#endif
-
-#ifndef GL_EXT_provoking_vertex
-#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C
-#define GL_FIRST_VERTEX_CONVENTION_EXT    0x8E4D
-#define GL_LAST_VERTEX_CONVENTION_EXT     0x8E4E
-#define GL_PROVOKING_VERTEX_EXT           0x8E4F
-#endif
-
-#ifndef GL_EXT_texture_snorm
-#define GL_ALPHA_SNORM                    0x9010
-#define GL_LUMINANCE_SNORM                0x9011
-#define GL_LUMINANCE_ALPHA_SNORM          0x9012
-#define GL_INTENSITY_SNORM                0x9013
-#define GL_ALPHA8_SNORM                   0x9014
-#define GL_LUMINANCE8_SNORM               0x9015
-#define GL_LUMINANCE8_ALPHA8_SNORM        0x9016
-#define GL_INTENSITY8_SNORM               0x9017
-#define GL_ALPHA16_SNORM                  0x9018
-#define GL_LUMINANCE16_SNORM              0x9019
-#define GL_LUMINANCE16_ALPHA16_SNORM      0x901A
-#define GL_INTENSITY16_SNORM              0x901B
-/* reuse GL_RED_SNORM */
-/* reuse GL_RG_SNORM */
-/* reuse GL_RGB_SNORM */
-/* reuse GL_RGBA_SNORM */
-/* reuse GL_R8_SNORM */
-/* reuse GL_RG8_SNORM */
-/* reuse GL_RGB8_SNORM */
-/* reuse GL_RGBA8_SNORM */
-/* reuse GL_R16_SNORM */
-/* reuse GL_RG16_SNORM */
-/* reuse GL_RGB16_SNORM */
-/* reuse GL_RGBA16_SNORM */
-/* reuse GL_SIGNED_NORMALIZED */
-#endif
-
-#ifndef GL_AMD_draw_buffers_blend
-#endif
-
-#ifndef GL_APPLE_texture_range
-#define GL_TEXTURE_RANGE_LENGTH_APPLE     0x85B7
-#define GL_TEXTURE_RANGE_POINTER_APPLE    0x85B8
-#define GL_TEXTURE_STORAGE_HINT_APPLE     0x85BC
-#define GL_STORAGE_PRIVATE_APPLE          0x85BD
-/* reuse GL_STORAGE_CACHED_APPLE */
-/* reuse GL_STORAGE_SHARED_APPLE */
-#endif
-
-#ifndef GL_APPLE_float_pixels
-#define GL_HALF_APPLE                     0x140B
-#define GL_RGBA_FLOAT32_APPLE             0x8814
-#define GL_RGB_FLOAT32_APPLE              0x8815
-#define GL_ALPHA_FLOAT32_APPLE            0x8816
-#define GL_INTENSITY_FLOAT32_APPLE        0x8817
-#define GL_LUMINANCE_FLOAT32_APPLE        0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE  0x8819
-#define GL_RGBA_FLOAT16_APPLE             0x881A
-#define GL_RGB_FLOAT16_APPLE              0x881B
-#define GL_ALPHA_FLOAT16_APPLE            0x881C
-#define GL_INTENSITY_FLOAT16_APPLE        0x881D
-#define GL_LUMINANCE_FLOAT16_APPLE        0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE  0x881F
-#define GL_COLOR_FLOAT_APPLE              0x8A0F
-#endif
-
-#ifndef GL_APPLE_vertex_program_evaluators
-#define GL_VERTEX_ATTRIB_MAP1_APPLE       0x8A00
-#define GL_VERTEX_ATTRIB_MAP2_APPLE       0x8A01
-#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE  0x8A02
-#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03
-#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04
-#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05
-#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE  0x8A06
-#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07
-#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08
-#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09
-#endif
-
-#ifndef GL_APPLE_aux_depth_stencil
-#define GL_AUX_DEPTH_STENCIL_APPLE        0x8A14
-#endif
-
-#ifndef GL_APPLE_object_purgeable
-#define GL_BUFFER_OBJECT_APPLE            0x85B3
-#define GL_RELEASED_APPLE                 0x8A19
-#define GL_VOLATILE_APPLE                 0x8A1A
-#define GL_RETAINED_APPLE                 0x8A1B
-#define GL_UNDEFINED_APPLE                0x8A1C
-#define GL_PURGEABLE_APPLE                0x8A1D
-#endif
-
-#ifndef GL_APPLE_row_bytes
-#define GL_PACK_ROW_BYTES_APPLE           0x8A15
-#define GL_UNPACK_ROW_BYTES_APPLE         0x8A16
-#endif
-
-#ifndef GL_APPLE_rgb_422
-#define GL_RGB_422_APPLE                  0x8A1F
-/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */
-/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */
-#endif
-
-#ifndef GL_NV_video_capture
-#define GL_VIDEO_BUFFER_NV                0x9020
-#define GL_VIDEO_BUFFER_BINDING_NV        0x9021
-#define GL_FIELD_UPPER_NV                 0x9022
-#define GL_FIELD_LOWER_NV                 0x9023
-#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV   0x9024
-#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
-#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
-#define GL_LAST_VIDEO_CAPTURE_STATUS_NV   0x9027
-#define GL_VIDEO_BUFFER_PITCH_NV          0x9028
-#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
-#define GL_VIDEO_COLOR_CONVERSION_MAX_NV  0x902A
-#define GL_VIDEO_COLOR_CONVERSION_MIN_NV  0x902B
-#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
-#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
-#define GL_PARTIAL_SUCCESS_NV             0x902E
-#define GL_SUCCESS_NV                     0x902F
-#define GL_FAILURE_NV                     0x9030
-#define GL_YCBYCR8_422_NV                 0x9031
-#define GL_YCBAYCR8A_4224_NV              0x9032
-#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV  0x9033
-#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
-#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV  0x9035
-#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
-#define GL_Z4Y12Z4CB12Z4CR12_444_NV       0x9037
-#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV   0x9038
-#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV  0x9039
-#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
-#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
-#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
-#endif
-
-#ifndef GL_NV_copy_image
-#endif
-
-#ifndef GL_EXT_separate_shader_objects
-#define GL_ACTIVE_PROGRAM_EXT             0x8B8D
-#endif
-
-#ifndef GL_NV_parameter_buffer_object2
-#endif
-
-#ifndef GL_NV_shader_buffer_load
-#define GL_BUFFER_GPU_ADDRESS_NV          0x8F1D
-#define GL_GPU_ADDRESS_NV                 0x8F34
-#define GL_MAX_SHADER_BUFFER_ADDRESS_NV   0x8F35
-#endif
-
-#ifndef GL_NV_vertex_buffer_unified_memory
-#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
-#define GL_ELEMENT_ARRAY_UNIFIED_NV       0x8F1F
-#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
-#define GL_VERTEX_ARRAY_ADDRESS_NV        0x8F21
-#define GL_NORMAL_ARRAY_ADDRESS_NV        0x8F22
-#define GL_COLOR_ARRAY_ADDRESS_NV         0x8F23
-#define GL_INDEX_ARRAY_ADDRESS_NV         0x8F24
-#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
-#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV     0x8F26
-#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
-#define GL_FOG_COORD_ARRAY_ADDRESS_NV     0x8F28
-#define GL_ELEMENT_ARRAY_ADDRESS_NV       0x8F29
-#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV  0x8F2A
-#define GL_VERTEX_ARRAY_LENGTH_NV         0x8F2B
-#define GL_NORMAL_ARRAY_LENGTH_NV         0x8F2C
-#define GL_COLOR_ARRAY_LENGTH_NV          0x8F2D
-#define GL_INDEX_ARRAY_LENGTH_NV          0x8F2E
-#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV  0x8F2F
-#define GL_EDGE_FLAG_ARRAY_LENGTH_NV      0x8F30
-#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
-#define GL_FOG_COORD_ARRAY_LENGTH_NV      0x8F32
-#define GL_ELEMENT_ARRAY_LENGTH_NV        0x8F33
-#define GL_DRAW_INDIRECT_UNIFIED_NV       0x8F40
-#define GL_DRAW_INDIRECT_ADDRESS_NV       0x8F41
-#define GL_DRAW_INDIRECT_LENGTH_NV        0x8F42
-#endif
-
-#ifndef GL_NV_texture_barrier
-#endif
-
-#ifndef GL_AMD_shader_stencil_export
-#endif
-
-#ifndef GL_AMD_seamless_cubemap_per_texture
-/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */
-#endif
-
-#ifndef GL_AMD_conservative_depth
-#endif
-
-#ifndef GL_EXT_shader_image_load_store
-#define GL_MAX_IMAGE_UNITS_EXT            0x8F38
-#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39
-#define GL_IMAGE_BINDING_NAME_EXT         0x8F3A
-#define GL_IMAGE_BINDING_LEVEL_EXT        0x8F3B
-#define GL_IMAGE_BINDING_LAYERED_EXT      0x8F3C
-#define GL_IMAGE_BINDING_LAYER_EXT        0x8F3D
-#define GL_IMAGE_BINDING_ACCESS_EXT       0x8F3E
-#define GL_IMAGE_1D_EXT                   0x904C
-#define GL_IMAGE_2D_EXT                   0x904D
-#define GL_IMAGE_3D_EXT                   0x904E
-#define GL_IMAGE_2D_RECT_EXT              0x904F
-#define GL_IMAGE_CUBE_EXT                 0x9050
-#define GL_IMAGE_BUFFER_EXT               0x9051
-#define GL_IMAGE_1D_ARRAY_EXT             0x9052
-#define GL_IMAGE_2D_ARRAY_EXT             0x9053
-#define GL_IMAGE_CUBE_MAP_ARRAY_EXT       0x9054
-#define GL_IMAGE_2D_MULTISAMPLE_EXT       0x9055
-#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056
-#define GL_INT_IMAGE_1D_EXT               0x9057
-#define GL_INT_IMAGE_2D_EXT               0x9058
-#define GL_INT_IMAGE_3D_EXT               0x9059
-#define GL_INT_IMAGE_2D_RECT_EXT          0x905A
-#define GL_INT_IMAGE_CUBE_EXT             0x905B
-#define GL_INT_IMAGE_BUFFER_EXT           0x905C
-#define GL_INT_IMAGE_1D_ARRAY_EXT         0x905D
-#define GL_INT_IMAGE_2D_ARRAY_EXT         0x905E
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT   0x905F
-#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT   0x9060
-#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061
-#define GL_UNSIGNED_INT_IMAGE_1D_EXT      0x9062
-#define GL_UNSIGNED_INT_IMAGE_2D_EXT      0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D_EXT      0x9064
-#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065
-#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT    0x9066
-#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT  0x9067
-#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C
-#define GL_MAX_IMAGE_SAMPLES_EXT          0x906D
-#define GL_IMAGE_BINDING_FORMAT_EXT       0x906E
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT  0x00000002
-#define GL_UNIFORM_BARRIER_BIT_EXT        0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT  0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020
-#define GL_COMMAND_BARRIER_BIT_EXT        0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT   0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT  0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT_EXT    0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000
-#define GL_ALL_BARRIER_BITS_EXT           0xFFFFFFFF
-#endif
-
-#ifndef GL_EXT_vertex_attrib_64bit
-/* reuse GL_DOUBLE */
-#define GL_DOUBLE_VEC2_EXT                0x8FFC
-#define GL_DOUBLE_VEC3_EXT                0x8FFD
-#define GL_DOUBLE_VEC4_EXT                0x8FFE
-#define GL_DOUBLE_MAT2_EXT                0x8F46
-#define GL_DOUBLE_MAT3_EXT                0x8F47
-#define GL_DOUBLE_MAT4_EXT                0x8F48
-#define GL_DOUBLE_MAT2x3_EXT              0x8F49
-#define GL_DOUBLE_MAT2x4_EXT              0x8F4A
-#define GL_DOUBLE_MAT3x2_EXT              0x8F4B
-#define GL_DOUBLE_MAT3x4_EXT              0x8F4C
-#define GL_DOUBLE_MAT4x2_EXT              0x8F4D
-#define GL_DOUBLE_MAT4x3_EXT              0x8F4E
-#endif
-
-#ifndef GL_NV_gpu_program5
-#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
-#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
-#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44
-#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV  0x8F45
-#endif
-
-#ifndef GL_NV_gpu_shader5
-#define GL_INT64_NV                       0x140E
-#define GL_UNSIGNED_INT64_NV              0x140F
-#define GL_INT8_NV                        0x8FE0
-#define GL_INT8_VEC2_NV                   0x8FE1
-#define GL_INT8_VEC3_NV                   0x8FE2
-#define GL_INT8_VEC4_NV                   0x8FE3
-#define GL_INT16_NV                       0x8FE4
-#define GL_INT16_VEC2_NV                  0x8FE5
-#define GL_INT16_VEC3_NV                  0x8FE6
-#define GL_INT16_VEC4_NV                  0x8FE7
-#define GL_INT64_VEC2_NV                  0x8FE9
-#define GL_INT64_VEC3_NV                  0x8FEA
-#define GL_INT64_VEC4_NV                  0x8FEB
-#define GL_UNSIGNED_INT8_NV               0x8FEC
-#define GL_UNSIGNED_INT8_VEC2_NV          0x8FED
-#define GL_UNSIGNED_INT8_VEC3_NV          0x8FEE
-#define GL_UNSIGNED_INT8_VEC4_NV          0x8FEF
-#define GL_UNSIGNED_INT16_NV              0x8FF0
-#define GL_UNSIGNED_INT16_VEC2_NV         0x8FF1
-#define GL_UNSIGNED_INT16_VEC3_NV         0x8FF2
-#define GL_UNSIGNED_INT16_VEC4_NV         0x8FF3
-#define GL_UNSIGNED_INT64_VEC2_NV         0x8FF5
-#define GL_UNSIGNED_INT64_VEC3_NV         0x8FF6
-#define GL_UNSIGNED_INT64_VEC4_NV         0x8FF7
-#define GL_FLOAT16_NV                     0x8FF8
-#define GL_FLOAT16_VEC2_NV                0x8FF9
-#define GL_FLOAT16_VEC3_NV                0x8FFA
-#define GL_FLOAT16_VEC4_NV                0x8FFB
-/* reuse GL_PATCHES */
-#endif
-
-#ifndef GL_NV_shader_buffer_store
-#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010
-/* reuse GL_READ_WRITE */
-/* reuse GL_WRITE_ONLY */
-#endif
-
-#ifndef GL_NV_tessellation_program5
-#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV   0x86D8
-#define GL_TESS_CONTROL_PROGRAM_NV        0x891E
-#define GL_TESS_EVALUATION_PROGRAM_NV     0x891F
-#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74
-#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75
-#endif
-
-#ifndef GL_NV_vertex_attrib_integer_64bit
-/* reuse GL_INT64_NV */
-/* reuse GL_UNSIGNED_INT64_NV */
-#endif
-
-#ifndef GL_NV_multisample_coverage
-#define GL_COVERAGE_SAMPLES_NV            0x80A9
-#define GL_COLOR_SAMPLES_NV               0x8E20
-#endif
-
-#ifndef GL_AMD_name_gen_delete
-#define GL_DATA_BUFFER_AMD                0x9151
-#define GL_PERFORMANCE_MONITOR_AMD        0x9152
-#define GL_QUERY_OBJECT_AMD               0x9153
-#define GL_VERTEX_ARRAY_OBJECT_AMD        0x9154
-#define GL_SAMPLER_OBJECT_AMD             0x9155
-#endif
-
-#ifndef GL_AMD_debug_output
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD  0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_AMD      0x9145
-#define GL_DEBUG_SEVERITY_HIGH_AMD        0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_AMD      0x9147
-#define GL_DEBUG_SEVERITY_LOW_AMD         0x9148
-#define GL_DEBUG_CATEGORY_API_ERROR_AMD   0x9149
-#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A
-#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B
-#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C
-#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D
-#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E
-#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F
-#define GL_DEBUG_CATEGORY_OTHER_AMD       0x9150
-#endif
-
-#ifndef GL_NV_vdpau_interop
-#define GL_SURFACE_STATE_NV               0x86EB
-#define GL_SURFACE_REGISTERED_NV          0x86FD
-#define GL_SURFACE_MAPPED_NV              0x8700
-#define GL_WRITE_DISCARD_NV               0x88BE
-#endif
-
-#ifndef GL_AMD_transform_feedback3_lines_triangles
-#endif
-
-
-/*************************************************************/
-
-#include <stddef.h>
-#ifndef GL_VERSION_2_0
-/* GL type for program/shader text */
-typedef char GLchar;
-#endif
-
-#ifndef GL_VERSION_1_5
-/* GL types for handling large vertex buffer objects */
-#if defined(__APPLE__)
-typedef long GLintptr;
-typedef long GLsizeiptr;
-#else
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-#endif
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-/* GL types for handling large vertex buffer objects */
-#if defined(__APPLE__)
-typedef long GLintptrARB;
-typedef long GLsizeiptrARB;
-#else
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-#endif
-#endif
-
-#ifndef GL_ARB_shader_objects
-/* GL types for program/shader text and shader object handles */
-typedef char GLcharARB;
-#if defined(__APPLE__)
-typedef void *GLhandleARB;
-#else
-typedef unsigned int GLhandleARB;
-#endif
-#endif
-
-/* GL type for "half" precision (s10e5) float data in host memory */
-#ifndef GL_ARB_half_float_pixel
-typedef unsigned short GLhalfARB;
-#endif
-
-#ifndef GL_NV_half_float
-typedef unsigned short GLhalfNV;
-#endif
-
-#ifndef GLEXT_64_TYPES_DEFINED
-/* This code block is duplicated in glxext.h, so must be protected */
-#define GLEXT_64_TYPES_DEFINED
-/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
-/* (as used in the GL_EXT_timer_query extension). */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#include <inttypes.h>
-#elif defined(__sun__) || defined(__digital__)
-#include <inttypes.h>
-#if defined(__STDC__)
-#if defined(__arch64__) || defined(_LP64)
-typedef long int int64_t;
-typedef unsigned long int uint64_t;
-#else
-typedef long long int int64_t;
-typedef unsigned long long int uint64_t;
-#endif /* __arch64__ */
-#endif /* __STDC__ */
-#elif defined( __VMS ) || defined(__sgi)
-#include <inttypes.h>
-#elif defined(__SCO__) || defined(__USLC__)
-#include <stdint.h>
-#elif defined(__UNIXOS2__) || defined(__SOL64__)
-typedef long int int32_t;
-typedef long long int int64_t;
-typedef unsigned long long int uint64_t;
-#elif defined(_WIN32) && defined(__GNUC__)
-#include <stdint.h>
-#elif defined(_WIN32)
-typedef __int32 int32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#else
-/* Fallback if nothing above works */
-#include <inttypes.h>
-#endif
-#endif
-
-#ifndef GL_EXT_timer_query
-typedef int64_t GLint64EXT;
-typedef uint64_t GLuint64EXT;
-#endif
-
-#ifndef GL_ARB_sync
-typedef int64_t GLint64;
-typedef uint64_t GLuint64;
-typedef struct __GLsync *GLsync;
-#endif
-
-#ifndef GL_ARB_cl_event
-/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */
-struct _cl_context;
-struct _cl_event;
-#endif
-
-#ifndef GL_ARB_debug_output
-typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-#endif
-
-#ifndef GL_AMD_debug_output
-typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-#endif
-
-#ifndef GL_NV_vdpau_interop
-typedef GLintptr GLvdpauSurfaceNV;
-#endif
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GLAPI void APIENTRY glBlendEquation (GLenum mode);
-GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_VERSION_1_2_DEPRECATED
-#define GL_VERSION_1_2_DEPRECATED 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table);
-GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params);
-GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params);
-GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image);
-GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glResetHistogram (GLenum target);
-GLAPI void APIENTRY glResetMinmax (GLenum target);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_VERSION_1_3 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTexture (GLenum texture);
-GLAPI void APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_VERSION_1_3_DEPRECATED
-#define GL_VERSION_1_3_DEPRECATED 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClientActiveTexture (GLenum texture);
-GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s);
-GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s);
-GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s);
-GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s);
-GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t);
-GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t);
-GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t);
-GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t);
-GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r);
-GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m);
-GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m);
-GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m);
-GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_VERSION_1_4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param);
-GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_VERSION_1_4_DEPRECATED
-#define GL_VERSION_1_4_DEPRECATED 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogCoordf (GLfloat coord);
-GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord);
-GLAPI void APIENTRY glFogCoordd (GLdouble coord);
-GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord);
-GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v);
-GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v);
-GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v);
-GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue);
-GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v);
-GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue);
-GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v);
-GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v);
-GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue);
-GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v);
-GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue);
-GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v);
-GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y);
-GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y);
-GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y);
-GLAPI void APIENTRY glWindowPos2iv (const GLint *v);
-GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y);
-GLAPI void APIENTRY glWindowPos2sv (const GLshort *v);
-GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glWindowPos3iv (const GLint *v);
-GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glWindowPos3sv (const GLshort *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_VERSION_1_5 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsQuery (GLuint id);
-GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id);
-GLAPI void APIENTRY glEndQuery (GLenum target);
-GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
-GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
-GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer);
-GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access);
-GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);
-GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_VERSION_2_0 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);
-GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
-GLAPI void APIENTRY glCompileShader (GLuint shader);
-GLAPI GLuint APIENTRY glCreateProgram (void);
-GLAPI GLuint APIENTRY glCreateShader (GLenum type);
-GLAPI void APIENTRY glDeleteProgram (GLuint program);
-GLAPI void APIENTRY glDeleteShader (GLuint shader);
-GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);
-GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index);
-GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);
-GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
-GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer);
-GLAPI GLboolean APIENTRY glIsProgram (GLuint program);
-GLAPI GLboolean APIENTRY glIsShader (GLuint shader);
-GLAPI void APIENTRY glLinkProgram (GLuint program);
-GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
-GLAPI void APIENTRY glUseProgram (GLuint program);
-GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0);
-GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glUniform1i (GLint location, GLint v0);
-GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glValidateProgram (GLuint program);
-GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_VERSION_2_1
-#define GL_VERSION_2_1 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-#endif
-
-#ifndef GL_VERSION_3_0
-#define GL_VERSION_3_0 1
-/* OpenGL 3.0 also reuses entry points from these extensions: */
-/* ARB_framebuffer_object */
-/* ARB_map_buffer_range */
-/* ARB_vertex_array_object */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
-GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
-GLAPI void APIENTRY glEnablei (GLenum target, GLuint index);
-GLAPI void APIENTRY glDisablei (GLenum target, GLuint index);
-GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index);
-GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedback (void);
-GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
-GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp);
-GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode);
-GLAPI void APIENTRY glEndConditionalRender (void);
-GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x);
-GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y);
-GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x);
-GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);
-GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
-GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0);
-GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
-GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
-GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
-typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
-typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
-typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
-typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
-#endif
-
-#ifndef GL_VERSION_3_1
-#define GL_VERSION_3_1 1
-/* OpenGL 3.1 also reuses entry points from these extensions: */
-/* ARB_copy_buffer */
-/* ARB_uniform_buffer_object */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
-GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
-#endif
-
-#ifndef GL_VERSION_3_2
-#define GL_VERSION_3_2 1
-/* OpenGL 3.2 also reuses entry points from these extensions: */
-/* ARB_draw_elements_base_vertex */
-/* ARB_provoking_vertex */
-/* ARB_sync */
-/* ARB_texture_multisample */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
-GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-#endif
-
-#ifndef GL_VERSION_3_3
-#define GL_VERSION_3_3 1
-/* OpenGL 3.3 also reuses entry points from these extensions: */
-/* ARB_blend_func_extended */
-/* ARB_sampler_objects */
-/* ARB_explicit_attrib_location, but it has none */
-/* ARB_occlusion_query2 (no entry points) */
-/* ARB_shader_bit_encoding (no entry points) */
-/* ARB_texture_rgb10_a2ui (no entry points) */
-/* ARB_texture_swizzle (no entry points) */
-/* ARB_timer_query */
-/* ARB_vertex_type_2_10_10_10_rev */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
-#endif
-
-#ifndef GL_VERSION_4_0
-#define GL_VERSION_4_0 1
-/* OpenGL 4.0 also reuses entry points from these extensions: */
-/* ARB_texture_query_lod (no entry points) */
-/* ARB_draw_indirect */
-/* ARB_gpu_shader5 (no entry points) */
-/* ARB_gpu_shader_fp64 */
-/* ARB_shader_subroutine */
-/* ARB_tessellation_shader */
-/* ARB_texture_buffer_object_rgb32 (no entry points) */
-/* ARB_texture_cube_map_array (no entry points) */
-/* ARB_texture_gather (no entry points) */
-/* ARB_transform_feedback2 */
-/* ARB_transform_feedback3 */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMinSampleShading (GLclampf value);
-GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif
-
-#ifndef GL_VERSION_4_1
-#define GL_VERSION_4_1 1
-/* OpenGL 4.1 also reuses entry points from these extensions: */
-/* ARB_ES2_compatibility */
-/* ARB_get_program_binary */
-/* ARB_separate_shader_objects */
-/* ARB_shader_precision (no entry points) */
-/* ARB_vertex_attrib_64bit */
-/* ARB_viewport_array */
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTextureARB (GLenum texture);
-GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture);
-GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s);
-GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s);
-GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s);
-GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s);
-GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t);
-GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t);
-GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t);
-GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t);
-GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r);
-GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r);
-GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v);
-GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v);
-GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v);
-GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q);
-GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v);
-GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_ARB_transpose_matrix 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m);
-GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m);
-GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m);
-GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_ARB_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleCoverageARB (GLclampf value, GLboolean invert);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_ARB_texture_cube_map 1
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_ARB_texture_compression 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_ARB_texture_border_clamp 1
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_ARB_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_ARB_vertex_blend 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights);
-GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights);
-GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights);
-GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights);
-GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights);
-GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights);
-GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights);
-GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights);
-GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glVertexBlendARB (GLint count);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
-typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_ARB_matrix_palette 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index);
-GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices);
-GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices);
-GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices);
-GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_ARB_texture_env_combine 1
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#define GL_ARB_texture_env_crossbar 1
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_ARB_texture_env_dot3 1
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_ARB_texture_mirrored_repeat 1
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_ARB_depth_texture 1
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_ARB_shadow 1
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_ARB_shadow_ambient 1
-#endif
-
-#ifndef GL_ARB_window_pos
-#define GL_ARB_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y);
-GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y);
-GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y);
-GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v);
-GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y);
-GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v);
-GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v);
-GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_ARB_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index);
-GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index);
-GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program);
-GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs);
-GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string);
-GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer);
-GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_ARB_fragment_program 1
-/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_ARB_vertex_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer);
-GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers);
-GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers);
-GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer);
-GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
-GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
-GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access);
-GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target);
-GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_ARB_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id);
-GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id);
-GLAPI void APIENTRY glEndQueryARB (GLenum target);
-GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_ARB_shader_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj);
-GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname);
-GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj);
-GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType);
-GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
-GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj);
-GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
-GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj);
-GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj);
-GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj);
-GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj);
-GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0);
-GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0);
-GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
-GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name);
-GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params);
-GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params);
-GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
-typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
-typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
-typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
-typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_ARB_vertex_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name);
-GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_ARB_fragment_shader 1
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_ARB_shading_language_100 1
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#define GL_ARB_texture_non_power_of_two 1
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_ARB_point_sprite 1
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#define GL_ARB_fragment_program_shadow 1
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_ARB_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_ARB_texture_rectangle 1
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_ARB_color_buffer_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_ARB_half_float_pixel 1
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 1
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_ARB_pixel_buffer_object 1
-#endif
-
-#ifndef GL_ARB_depth_buffer_float
-#define GL_ARB_depth_buffer_float 1
-#endif
-
-#ifndef GL_ARB_draw_instanced
-#define GL_ARB_draw_instanced 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_ARB_framebuffer_object
-#define GL_ARB_framebuffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
-GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer);
-GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
-GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
-GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target);
-GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGenerateMipmap (GLenum target);
-GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-#endif
-
-#ifndef GL_ARB_framebuffer_sRGB
-#define GL_ARB_framebuffer_sRGB 1
-#endif
-
-#ifndef GL_ARB_geometry_shader4
-#define GL_ARB_geometry_shader4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value);
-GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif
-
-#ifndef GL_ARB_half_float_vertex
-#define GL_ARB_half_float_vertex 1
-#endif
-
-#ifndef GL_ARB_instanced_arrays
-#define GL_ARB_instanced_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
-#endif
-
-#ifndef GL_ARB_map_buffer_range
-#define GL_ARB_map_buffer_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-#endif
-
-#ifndef GL_ARB_texture_buffer_object
-#define GL_ARB_texture_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-#endif
-
-#ifndef GL_ARB_texture_compression_rgtc
-#define GL_ARB_texture_compression_rgtc 1
-#endif
-
-#ifndef GL_ARB_texture_rg
-#define GL_ARB_texture_rg 1
-#endif
-
-#ifndef GL_ARB_vertex_array_object
-#define GL_ARB_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArray (GLuint array);
-GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
-GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
-GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
-#endif
-
-#ifndef GL_ARB_uniform_buffer_object
-#define GL_ARB_uniform_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
-GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
-GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
-GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
-typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
-typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-#endif
-
-#ifndef GL_ARB_compatibility
-#define GL_ARB_compatibility 1
-#endif
-
-#ifndef GL_ARB_copy_buffer
-#define GL_ARB_copy_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-#endif
-
-#ifndef GL_ARB_shader_texture_lod
-#define GL_ARB_shader_texture_lod 1
-#endif
-
-#ifndef GL_ARB_depth_clamp
-#define GL_ARB_depth_clamp 1
-#endif
-
-#ifndef GL_ARB_draw_elements_base_vertex
-#define GL_ARB_draw_elements_base_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex);
-GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex);
-#endif
-
-#ifndef GL_ARB_fragment_coord_conventions
-#define GL_ARB_fragment_coord_conventions 1
-#endif
-
-#ifndef GL_ARB_provoking_vertex
-#define GL_ARB_provoking_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProvokingVertex (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
-#endif
-
-#ifndef GL_ARB_seamless_cube_map
-#define GL_ARB_seamless_cube_map 1
-#endif
-
-#ifndef GL_ARB_sync
-#define GL_ARB_sync 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
-GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
-GLAPI void APIENTRY glDeleteSync (GLsync sync);
-GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
-GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
-typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
-typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
-typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
-typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-#endif
-
-#ifndef GL_ARB_texture_multisample
-#define GL_ARB_texture_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
-GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
-typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);
-#endif
-
-#ifndef GL_ARB_vertex_array_bgra
-#define GL_ARB_vertex_array_bgra 1
-#endif
-
-#ifndef GL_ARB_draw_buffers_blend
-#define GL_ARB_draw_buffers_blend 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-#endif
-
-#ifndef GL_ARB_sample_shading
-#define GL_ARB_sample_shading 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMinSampleShadingARB (GLclampf value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value);
-#endif
-
-#ifndef GL_ARB_texture_cube_map_array
-#define GL_ARB_texture_cube_map_array 1
-#endif
-
-#ifndef GL_ARB_texture_gather
-#define GL_ARB_texture_gather 1
-#endif
-
-#ifndef GL_ARB_texture_query_lod
-#define GL_ARB_texture_query_lod 1
-#endif
-
-#ifndef GL_ARB_shading_language_include
-#define GL_ARB_shading_language_include 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
-GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name);
-GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
-GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name);
-GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
-GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
-typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
-typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
-typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_ARB_texture_compression_bptc
-#define GL_ARB_texture_compression_bptc 1
-#endif
-
-#ifndef GL_ARB_blend_func_extended
-#define GL_ARB_blend_func_extended 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
-#endif
-
-#ifndef GL_ARB_explicit_attrib_location
-#define GL_ARB_explicit_attrib_location 1
-#endif
-
-#ifndef GL_ARB_occlusion_query2
-#define GL_ARB_occlusion_query2 1
-#endif
-
-#ifndef GL_ARB_sampler_objects
-#define GL_ARB_sampler_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
-GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
-GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler);
-GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);
-GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
-GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
-GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
-GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);
-GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);
-GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
-typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
-typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
-typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_ARB_texture_rgb10_a2ui
-#define GL_ARB_texture_rgb10_a2ui 1
-#endif
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_ARB_texture_swizzle 1
-#endif
-
-#ifndef GL_ARB_timer_query
-#define GL_ARB_timer_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target);
-GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params);
-GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
-#endif
-
-#ifndef GL_ARB_vertex_type_2_10_10_10_rev
-#define GL_ARB_vertex_type_2_10_10_10_rev 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value);
-GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value);
-GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords);
-GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords);
-GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords);
-GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color);
-GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color);
-GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value);
-typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
-typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords);
-typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
-#endif
-
-#ifndef GL_ARB_draw_indirect
-#define GL_ARB_draw_indirect 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect);
-GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect);
-#endif
-
-#ifndef GL_ARB_gpu_shader5
-#define GL_ARB_gpu_shader5 1
-#endif
-
-#ifndef GL_ARB_gpu_shader_fp64
-#define GL_ARB_gpu_shader_fp64 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x);
-GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
-typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params);
-#endif
-
-#ifndef GL_ARB_shader_subroutine
-#define GL_ARB_shader_subroutine 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
-GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
-GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
-GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
-GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
-GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
-typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
-typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
-#endif
-
-#ifndef GL_ARB_tessellation_shader
-#define GL_ARB_tessellation_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value);
-GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
-typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values);
-#endif
-
-#ifndef GL_ARB_texture_buffer_object_rgb32
-#define GL_ARB_texture_buffer_object_rgb32 1
-#endif
-
-#ifndef GL_ARB_transform_feedback2
-#define GL_ARB_transform_feedback2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
-GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id);
-GLAPI void APIENTRY glPauseTransformFeedback (void);
-GLAPI void APIENTRY glResumeTransformFeedback (void);
-GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
-typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
-#endif
-
-#ifndef GL_ARB_transform_feedback3
-#define GL_ARB_transform_feedback3 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream);
-GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id);
-GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);
-GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
-typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_ARB_ES2_compatibility
-#define GL_ARB_ES2_compatibility 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReleaseShaderCompiler (void);
-GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
-GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-GLAPI void APIENTRY glDepthRangef (GLclampf n, GLclampf f);
-GLAPI void APIENTRY glClearDepthf (GLclampf d);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
-typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
-typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f);
-typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLclampf d);
-#endif
-
-#ifndef GL_ARB_get_program_binary
-#define GL_ARB_get_program_binary 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
-GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
-typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
-#endif
-
-#ifndef GL_ARB_separate_shader_objects
-#define GL_ARB_separate_shader_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
-GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
-GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* *strings);
-GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
-GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
-GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
-GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
-GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
-GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0);
-GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
-GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1);
-GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
-GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
-GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline);
-GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* *strings);
-typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
-typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-#endif
-
-#ifndef GL_ARB_vertex_attrib_64bit
-#define GL_ARB_vertex_attrib_64bit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-#endif
-
-#ifndef GL_ARB_viewport_array
-#define GL_ARB_viewport_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v);
-GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v);
-GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLclampd *v);
-GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLclampd n, GLclampd f);
-GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);
-GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);
-typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd *v);
-typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f);
-typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
-#endif
-
-#ifndef GL_ARB_cl_event
-#define GL_ARB_cl_event 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
-#endif
-
-#ifndef GL_ARB_debug_output
-#define GL_ARB_debug_output 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam);
-GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam);
-typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-#endif
-
-#ifndef GL_ARB_robustness
-#define GL_ARB_robustness 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);
-GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
-GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
-GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
-GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values);
-GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values);
-GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values);
-GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern);
-GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
-GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
-GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
-GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
-GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
-GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
-GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
-typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
-typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
-typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values);
-typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values);
-typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern);
-typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
-typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
-typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
-typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
-typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
-#endif
-
-#ifndef GL_ARB_shader_stencil_export
-#define GL_ARB_shader_stencil_export 1
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_EXT_abgr 1
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_EXT_blend_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_EXT_texture 1
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_EXT_texture3D 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_SGIS_texture_filter4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights);
-GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
-typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#endif
-
-#ifndef GL_EXT_subtexture
-#define GL_EXT_subtexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_EXT_copy_texture
-#define GL_EXT_copy_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_EXT_histogram 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink);
-GLAPI void APIENTRY glResetHistogramEXT (GLenum target);
-GLAPI void APIENTRY glResetMinmaxEXT (GLenum target);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_EXT_convolution 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params);
-GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params);
-GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image);
-GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-#endif
-
-#ifndef GL_SGI_color_matrix
-#define GL_SGI_color_matrix 1
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_SGI_color_table 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table);
-GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_SGIX_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_SGIS_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param);
-GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_SGIS_texture4D 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_SGI_texture_color_table 1
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_EXT_cmyka 1
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_EXT_texture_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences);
-GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture);
-GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures);
-GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures);
-GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture);
-GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
-typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
-typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
-typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_SGIS_detail_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_SGIS_sharpen_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_EXT_packed_pixels 1
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_SGIS_texture_lod 1
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_SGIS_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_EXT_rescale_normal 1
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_EXT_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glArrayElementEXT (GLint i);
-GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer);
-GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params);
-GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
-typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
-typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_SGIS_generate_mipmap 1
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_SGIX_clipmap 1
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_SGIX_shadow 1
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_SGIS_texture_edge_clamp 1
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_SGIS_texture_border_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationEXT (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_EXT_blend_subtract 1
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_SGIX_interlace 1
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_SGIX_pixel_tiles 1
-#endif
-
-#ifndef GL_SGIX_texture_select
-#define GL_SGIX_texture_select 1
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SGIX_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param);
-GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_SGIX_texture_multi_buffer 1
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_SGIS_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_SGIX_instruments 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
-GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer);
-GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p);
-GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker);
-GLAPI void APIENTRY glStartInstrumentsSGIX (void);
-GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
-typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
-typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
-typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_SGIX_texture_scale_bias 1
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_SGIX_framezoom 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameZoomSGIX (GLint factor);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTagSampleBufferSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_SGIX_polynomial_ffd 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
-GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
-GLAPI void APIENTRY glDeformSGIX (GLbitfield mask);
-GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
-typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_SGIX_reference_plane 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushRasterSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_SGIX_depth_texture 1
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_SGIS_fog_function 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points);
-GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_SGIX_fog_offset 1
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_HP_image_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_HP_convolution_border_modes 1
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_SGIX_texture_add_env 1
-#endif
-
-#ifndef GL_EXT_color_subtable
-#define GL_EXT_color_subtable 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_PGI_vertex_hints 1
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PGI_misc_hints 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_EXT_paletted_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data);
-GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_EXT_clip_volume_hint 1
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_SGIX_list_priority 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params);
-GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param);
-GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_SGIX_calligraphic_fragment 1
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_SGIX_texture_lod_bias 1
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-#endif
-
-#ifndef GL_EXT_index_texture
-#define GL_EXT_index_texture 1
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_EXT_index_material 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_EXT_index_func 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_EXT_index_array_formats 1
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count);
-GLAPI void APIENTRY glUnlockArraysEXT (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_SGIX_ycrcb 1
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_SGIX_fragment_lighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode);
-GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param);
-GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param);
-GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param);
-GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params);
-GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_HP_texture_lighting 1
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_EXT_draw_range_elements 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_WIN_phong_shading 1
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_WIN_specular_fog 1
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_EXT_light_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glApplyTextureEXT (GLenum mode);
-GLAPI void APIENTRY glTextureLightEXT (GLenum pname);
-GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_SGIX_blend_alpha_minmax 1
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_EXT_bgra 1
-#endif
-
-#ifndef GL_SGIX_async
-#define GL_SGIX_async 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker);
-GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp);
-GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp);
-GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range);
-GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range);
-GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
-typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
-typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
-typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
-typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
-typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
-#endif
-
-#ifndef GL_SGIX_async_pixel
-#define GL_SGIX_async_pixel 1
-#endif
-
-#ifndef GL_SGIX_async_histogram
-#define GL_SGIX_async_histogram 1
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_INTEL_parallel_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
-GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer);
-GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
-GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_HP_occlusion_test 1
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_EXT_pixel_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_EXT_shared_texture_palette 1
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_EXT_separate_specular_color 1
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v);
-GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v);
-GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v);
-GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue);
-GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v);
-GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue);
-GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v);
-GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v);
-GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue);
-GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v);
-GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue);
-GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v);
-GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_EXT_texture_perturb_normal 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord);
-GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord);
-GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord);
-GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord);
-GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_REND_screen_coordinates 1
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_EXT_coordinate_frame 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz);
-GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v);
-GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz);
-GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v);
-GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz);
-GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v);
-GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz);
-GLAPI void APIENTRY glTangent3ivEXT (const GLint *v);
-GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz);
-GLAPI void APIENTRY glTangent3svEXT (const GLshort *v);
-GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz);
-GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v);
-GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz);
-GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v);
-GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz);
-GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v);
-GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz);
-GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v);
-GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz);
-GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v);
-GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
-typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
-typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
-typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
-typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
-typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
-typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
-typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
-typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
-typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
-typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_EXT_texture_env_combine 1
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_APPLE_transform_hint 1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_SGIX_fog_scale 1
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_SUNX_constant_data 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFinishTextureSUNX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_SUN_global_alpha 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor);
-GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor);
-GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor);
-GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor);
-GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor);
-GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor);
-GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor);
-GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_SUN_triangle_list 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code);
-GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code);
-GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code);
-GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code);
-GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code);
-GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code);
-GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_SUN_vertex
-#define GL_SUN_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v);
-GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-
-#ifndef GL_INGR_blend_func_separate
-#define GL_INGR_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_INGR_color_clamp 1
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INGR_interlace_read 1
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_EXT_stencil_wrap 1
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_EXT_422_pixels 1
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NV_texgen_reflection 1
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_SUN_convolution_border_modes 1
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_EXT_vertex_weighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight);
-GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight);
-GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_NV_light_max_exponent 1
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
-GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_NV_register_combiners 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param);
-GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params);
-GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param);
-GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_NV_fog_distance 1
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_NV_texgen_emboss 1
-#endif
-
-#ifndef GL_NV_blend_square
-#define GL_NV_blend_square 1
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_NV_texture_env_combine4 1
-#endif
-
-#ifndef GL_MESA_resize_buffers
-#define GL_MESA_resize_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glResizeBuffersMESA (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
-#endif
-
-#ifndef GL_MESA_window_pos
-#define GL_MESA_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y);
-GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y);
-GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y);
-GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v);
-GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y);
-GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v);
-GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v);
-GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v);
-GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v);
-GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v);
-GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v);
-GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#define GL_IBM_multimode_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_IBM_vertex_array_lists 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_SGIX_subsample 1
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_SGIX_ycrcba 1
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#define GL_SGIX_ycrcb_subsample 1
-#endif
-
-#ifndef GL_SGIX_depth_pass_instrument
-#define GL_SGIX_depth_pass_instrument 1
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_3DFX_texture_compression_FXT1 1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_3DFX_multisample 1
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#define GL_3DFX_tbuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_EXT_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert);
-GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_SGIX_vertex_preclip 1
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_SGIX_resample 1
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_SGIS_point_line_texgen 1
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_SGIS_texture_color_mask 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#endif
-
-#ifndef GL_SGIX_igloo_interface
-#define GL_SGIX_igloo_interface 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
-#endif
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_EXT_texture_env_dot3 1
-#endif
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_ATI_texture_mirror_once 1
-#endif
-
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
-GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
-GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence);
-GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence);
-GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
-GLAPI void APIENTRY glFinishFenceNV (GLuint fence);
-GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-#endif
-
-#ifndef GL_NV_evaluators
-#define GL_NV_evaluators 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
-GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
-GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
-typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
-#endif
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_NV_packed_depth_stencil 1
-#endif
-
-#ifndef GL_NV_register_combiners2
-#define GL_NV_register_combiners2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_NV_texture_compression_vtc
-#define GL_NV_texture_compression_vtc 1
-#endif
-
-#ifndef GL_NV_texture_rectangle
-#define GL_NV_texture_rectangle 1
-#endif
-
-#ifndef GL_NV_texture_shader
-#define GL_NV_texture_shader 1
-#endif
-
-#ifndef GL_NV_texture_shader2
-#define GL_NV_texture_shader2 1
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_NV_vertex_array_range2 1
-#endif
-
-#ifndef GL_NV_vertex_program
-#define GL_NV_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences);
-GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params);
-GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs);
-GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program);
-GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer);
-GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id);
-GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLuint count, const GLdouble *v);
-GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLuint count, const GLfloat *v);
-GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);
-GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x);
-GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x);
-GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v);
-GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
-typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
-#endif
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_SGIX_texture_coordinate_clamp 1
-#endif
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SGIX_scalebias_hint 1
-#endif
-
-#ifndef GL_OML_interlace
-#define GL_OML_interlace 1
-#endif
-
-#ifndef GL_OML_subsample
-#define GL_OML_subsample 1
-#endif
-
-#ifndef GL_OML_resample
-#define GL_OML_resample 1
-#endif
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_NV_copy_depth_to_color 1
-#endif
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_ATI_envmap_bumpmap 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param);
-GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param);
-GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param);
-GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-#endif
-
-#ifndef GL_ATI_fragment_shader
-#define GL_ATI_fragment_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range);
-GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id);
-GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id);
-GLAPI void APIENTRY glBeginFragmentShaderATI (void);
-GLAPI void APIENTRY glEndFragmentShaderATI (void);
-GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle);
-GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle);
-GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
-typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
-#endif
-
-#ifndef GL_ATI_pn_triangles
-#define GL_ATI_pn_triangles 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param);
-GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
-#endif
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_ATI_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage);
-GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer);
-GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
-GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params);
-GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer);
-GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params);
-GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
-typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_EXT_vertex_shader
-#define GL_EXT_vertex_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginVertexShaderEXT (void);
-GLAPI void APIENTRY glEndVertexShaderEXT (void);
-GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id);
-GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range);
-GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id);
-GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1);
-GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num);
-GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num);
-GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
-GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr);
-GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr);
-GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr);
-GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr);
-GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr);
-GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr);
-GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr);
-GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr);
-GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr);
-GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr);
-GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
-GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id);
-GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id);
-GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value);
-GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value);
-GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value);
-GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value);
-GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value);
-GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap);
-GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
-GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data);
-GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
-GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data);
-GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
-GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data);
-GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
-GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
-GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data);
-GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
-typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
-typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
-typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
-typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
-typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
-typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
-typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
-typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
-typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
-typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-#endif
-
-#ifndef GL_ATI_vertex_streams
-#define GL_ATI_vertex_streams 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x);
-GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x);
-GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x);
-GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x);
-GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y);
-GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y);
-GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y);
-GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z);
-GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
-GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords);
-GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
-GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords);
-GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz);
-GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords);
-GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
-GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords);
-GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
-GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords);
-GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream);
-GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param);
-GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
-#endif
-
-#ifndef GL_ATI_element_array
-#define GL_ATI_element_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer);
-GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count);
-GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
-#endif
-
-#ifndef GL_SUN_mesh_array
-#define GL_SUN_mesh_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SUN_slice_accum 1
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_NV_multisample_filter_hint 1
-#endif
-
-#ifndef GL_NV_depth_clamp
-#define GL_NV_depth_clamp 1
-#endif
-
-#ifndef GL_NV_occlusion_query
-#define GL_NV_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids);
-GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids);
-GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id);
-GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id);
-GLAPI void APIENTRY glEndOcclusionQueryNV (void);
-GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_NV_point_sprite
-#define GL_NV_point_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param);
-GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_NV_texture_shader3 1
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#define GL_NV_vertex_program1_1 1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#define GL_EXT_shadow_funcs 1
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_EXT_stencil_two_side 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
-#endif
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_ATI_text_fragment_shader 1
-#endif
-
-#ifndef GL_APPLE_client_storage
-#define GL_APPLE_client_storage 1
-#endif
-
-#ifndef GL_APPLE_element_array
-#define GL_APPLE_element_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer);
-GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count);
-GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
-#endif
-
-#ifndef GL_APPLE_fence
-#define GL_APPLE_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences);
-GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences);
-GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence);
-GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence);
-GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence);
-GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence);
-GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name);
-GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
-typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
-typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
-#endif
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_APPLE_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array);
-GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays);
-GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays);
-GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-#endif
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_APPLE_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
-GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
-GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_APPLE_ycbcr_422 1
-#endif
-
-#ifndef GL_S3_s3tc
-#define GL_S3_s3tc 1
-#endif
-
-#ifndef GL_ATI_draw_buffers
-#define GL_ATI_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_ATI_pixel_format_float 1
-/* This is really a WGL extension, but defines some associated GL enums.
- * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
- */
-#endif
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_ATI_texture_env_combine3 1
-#endif
-
-#ifndef GL_ATI_texture_float
-#define GL_ATI_texture_float 1
-#endif
-
-#ifndef GL_NV_float_buffer
-#define GL_NV_float_buffer 1
-#endif
-
-#ifndef GL_NV_fragment_program
-#define GL_NV_fragment_program 1
-/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-#endif
-
-#ifndef GL_NV_half_float
-#define GL_NV_half_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y);
-GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z);
-GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
-GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
-GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s);
-GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t);
-GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r);
-GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s);
-GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t);
-GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
-GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v);
-GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog);
-GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog);
-GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v);
-GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight);
-GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight);
-GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x);
-GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y);
-GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
-GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
-typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
-typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
-typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
-typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-#endif
-
-#ifndef GL_NV_pixel_data_range
-#define GL_NV_pixel_data_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer);
-GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
-#endif
-
-#ifndef GL_NV_primitive_restart
-#define GL_NV_primitive_restart 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPrimitiveRestartNV (void);
-GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
-#endif
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_NV_texture_expand_normal 1
-#endif
-
-#ifndef GL_NV_vertex_program2
-#define GL_NV_vertex_program2 1
-#endif
-
-#ifndef GL_ATI_map_object_buffer
-#define GL_ATI_map_object_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer);
-GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-#endif
-
-#ifndef GL_ATI_separate_stencil
-#define GL_ATI_separate_stencil 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-#endif
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#define GL_ATI_vertex_attrib_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-#endif
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_EXT_depth_bounds_test 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
-#endif
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_EXT_texture_mirror_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_EXT_blend_equation_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
-#endif
-
-#ifndef GL_MESA_pack_invert
-#define GL_MESA_pack_invert 1
-#endif
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_MESA_ycbcr_texture 1
-#endif
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_EXT_pixel_buffer_object 1
-#endif
-
-#ifndef GL_NV_fragment_program_option
-#define GL_NV_fragment_program_option 1
-#endif
-
-#ifndef GL_NV_fragment_program2
-#define GL_NV_fragment_program2 1
-#endif
-
-#ifndef GL_NV_vertex_program2_option
-#define GL_NV_vertex_program2_option 1
-#endif
-
-#ifndef GL_NV_vertex_program3
-#define GL_NV_vertex_program3 1
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_EXT_framebuffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer);
-GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers);
-GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers);
-GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer);
-GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer);
-GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers);
-GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers);
-GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target);
-GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
-#endif
-
-#ifndef GL_GREMEDY_string_marker
-#define GL_GREMEDY_string_marker 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
-#endif
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_EXT_packed_depth_stencil 1
-#endif
-
-#ifndef GL_EXT_stencil_clear_tag
-#define GL_EXT_stencil_clear_tag 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
-#endif
-
-#ifndef GL_EXT_texture_sRGB
-#define GL_EXT_texture_sRGB 1
-#endif
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_EXT_framebuffer_blit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-#endif
-
-#ifndef GL_EXT_framebuffer_multisample
-#define GL_EXT_framebuffer_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_MESAX_texture_stack
-#define GL_MESAX_texture_stack 1
-#endif
-
-#ifndef GL_EXT_timer_query
-#define GL_EXT_timer_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params);
-GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
-#endif
-
-#ifndef GL_EXT_gpu_program_parameters
-#define GL_EXT_gpu_program_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-#endif
-
-#ifndef GL_APPLE_flush_buffer_range
-#define GL_APPLE_flush_buffer_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
-#endif
-
-#ifndef GL_NV_gpu_program4
-#define GL_NV_gpu_program4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
-GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
-GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
-GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
-GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params);
-GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params);
-GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params);
-GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
-#endif
-
-#ifndef GL_NV_geometry_program4
-#define GL_NV_geometry_program4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);
-GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-#endif
-
-#ifndef GL_EXT_geometry_shader4
-#define GL_EXT_geometry_shader4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
-#endif
-
-#ifndef GL_NV_vertex_program4
-#define GL_NV_vertex_program4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x);
-GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y);
-GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z);
-GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x);
-GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y);
-GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z);
-GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v);
-GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v);
-GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v);
-GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v);
-GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v);
-GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v);
-GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_EXT_gpu_shader4
-#define GL_EXT_gpu_shader4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params);
-GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
-GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
-GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-#endif
-
-#ifndef GL_EXT_draw_instanced
-#define GL_EXT_draw_instanced 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_EXT_packed_float
-#define GL_EXT_packed_float 1
-#endif
-
-#ifndef GL_EXT_texture_array
-#define GL_EXT_texture_array 1
-#endif
-
-#ifndef GL_EXT_texture_buffer_object
-#define GL_EXT_texture_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-#endif
-
-#ifndef GL_EXT_texture_compression_latc
-#define GL_EXT_texture_compression_latc 1
-#endif
-
-#ifndef GL_EXT_texture_compression_rgtc
-#define GL_EXT_texture_compression_rgtc 1
-#endif
-
-#ifndef GL_EXT_texture_shared_exponent
-#define GL_EXT_texture_shared_exponent 1
-#endif
-
-#ifndef GL_NV_depth_buffer_float
-#define GL_NV_depth_buffer_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
-GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
-#endif
-
-#ifndef GL_NV_fragment_program4
-#define GL_NV_fragment_program4 1
-#endif
-
-#ifndef GL_NV_framebuffer_multisample_coverage
-#define GL_NV_framebuffer_multisample_coverage 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_EXT_framebuffer_sRGB
-#define GL_EXT_framebuffer_sRGB 1
-#endif
-
-#ifndef GL_NV_geometry_shader4
-#define GL_NV_geometry_shader4 1
-#endif
-
-#ifndef GL_NV_parameter_buffer_object
-#define GL_NV_parameter_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
-GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
-#endif
-
-#ifndef GL_EXT_draw_buffers2
-#define GL_EXT_draw_buffers2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data);
-GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data);
-GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index);
-GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index);
-GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);
-typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
-#endif
-
-#ifndef GL_NV_transform_feedback
-#define GL_NV_transform_feedback 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedbackNV (void);
-GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode);
-GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
-GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name);
-GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name);
-GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location);
-GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
-typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
-#endif
-
-#ifndef GL_EXT_bindable_uniform
-#define GL_EXT_bindable_uniform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer);
-GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location);
-GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
-typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
-#endif
-
-#ifndef GL_EXT_texture_integer
-#define GL_EXT_texture_integer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha);
-GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
-typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-#endif
-
-#ifndef GL_GREMEDY_frame_terminator
-#define GL_GREMEDY_frame_terminator 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameTerminatorGREMEDY (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
-#endif
-
-#ifndef GL_NV_conditional_render
-#define GL_NV_conditional_render 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);
-GLAPI void APIENTRY glEndConditionalRenderNV (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
-typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
-#endif
-
-#ifndef GL_NV_present_video
-#define GL_NV_present_video 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
-GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
-GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params);
-GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
-typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
-typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params);
-#endif
-
-#ifndef GL_EXT_transform_feedback
-#define GL_EXT_transform_feedback 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode);
-GLAPI void APIENTRY glEndTransformFeedbackEXT (void);
-GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer);
-GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
-GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
-typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
-typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
-typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-#endif
-
-#ifndef GL_EXT_direct_state_access
-#define GL_EXT_direct_state_access 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask);
-GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask);
-GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
-GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void APIENTRY glMatrixPopEXT (GLenum mode);
-GLAPI void APIENTRY glMatrixPushEXT (GLenum mode);
-GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);
-GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);
-GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
-GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
-GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture);
-GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index);
-GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index);
-GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
-GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
-GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
-GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
-GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param);
-GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data);
-GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data);
-GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data);
-GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img);
-GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
-GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
-GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params);
-GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params);
-GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string);
-GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params);
-GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params);
-GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params);
-GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params);
-GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
-GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
-GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);
-GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);
-GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);
-GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
-GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);
-GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);
-GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
-GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
-GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access);
-GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer);
-GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
-GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length);
-GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params);
-GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
-GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
-GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
-GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params);
-GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target);
-GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target);
-GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target);
-GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode);
-GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs);
-GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode);
-GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
-GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
-GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
-GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
-GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer);
-GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x);
-GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
-typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
-typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
-typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
-typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
-typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data);
-typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params);
-typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params);
-typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
-typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
-typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
-typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
-typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params);
-typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);
-typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
-typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
-#endif
-
-#ifndef GL_EXT_vertex_array_bgra
-#define GL_EXT_vertex_array_bgra 1
-#endif
-
-#ifndef GL_EXT_texture_swizzle
-#define GL_EXT_texture_swizzle 1
-#endif
-
-#ifndef GL_NV_explicit_multisample
-#define GL_NV_explicit_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val);
-GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask);
-GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val);
-typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
-typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);
-#endif
-
-#ifndef GL_NV_transform_feedback2
-#define GL_NV_transform_feedback2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id);
-GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids);
-GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids);
-GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id);
-GLAPI void APIENTRY glPauseTransformFeedbackNV (void);
-GLAPI void APIENTRY glResumeTransformFeedbackNV (void);
-GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids);
-typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);
-typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);
-#endif
-
-#ifndef GL_ATI_meminfo
-#define GL_ATI_meminfo 1
-#endif
-
-#ifndef GL_AMD_performance_monitor
-#define GL_AMD_performance_monitor 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
-GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
-GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
-GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
-GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor);
-GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
-typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
-typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
-typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
-typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
-#endif
-
-#ifndef GL_AMD_texture_texture4
-#define GL_AMD_texture_texture4 1
-#endif
-
-#ifndef GL_AMD_vertex_shader_tesselator
-#define GL_AMD_vertex_shader_tesselator 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor);
-GLAPI void APIENTRY glTessellationModeAMD (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
-typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_provoking_vertex
-#define GL_EXT_provoking_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_texture_snorm
-#define GL_EXT_texture_snorm 1
-#endif
-
-#ifndef GL_AMD_draw_buffers_blend
-#define GL_AMD_draw_buffers_blend 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst);
-GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode);
-GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-#endif
-
-#ifndef GL_APPLE_texture_range
-#define GL_APPLE_texture_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer);
-GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_APPLE_float_pixels
-#define GL_APPLE_float_pixels 1
-#endif
-
-#ifndef GL_APPLE_vertex_program_evaluators
-#define GL_APPLE_vertex_program_evaluators 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname);
-GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname);
-GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname);
-GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-#endif
-
-#ifndef GL_APPLE_aux_depth_stencil
-#define GL_APPLE_aux_depth_stencil 1
-#endif
-
-#ifndef GL_APPLE_object_purgeable
-#define GL_APPLE_object_purgeable 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
-GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
-GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_APPLE_row_bytes
-#define GL_APPLE_row_bytes 1
-#endif
-
-#ifndef GL_APPLE_rgb_422
-#define GL_APPLE_rgb_422 1
-#endif
-
-#ifndef GL_NV_video_capture
-#define GL_NV_video_capture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot);
-GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
-GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
-GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot);
-GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
-GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
-GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
-GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
-GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
-GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
-GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
-typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
-typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
-typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
-#endif
-
-#ifndef GL_NV_copy_image
-#define GL_NV_copy_image 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-#endif
-
-#ifndef GL_EXT_separate_shader_objects
-#define GL_EXT_separate_shader_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program);
-GLAPI void APIENTRY glActiveProgramEXT (GLuint program);
-GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
-typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
-#endif
-
-#ifndef GL_NV_parameter_buffer_object2
-#define GL_NV_parameter_buffer_object2 1
-#endif
-
-#ifndef GL_NV_shader_buffer_load
-#define GL_NV_shader_buffer_load 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access);
-GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target);
-GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target);
-GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access);
-GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer);
-GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer);
-GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result);
-GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value);
-GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);
-GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value);
-GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
-typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
-typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);
-typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
-typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
-typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#endif
-
-#ifndef GL_NV_vertex_buffer_unified_memory
-#define GL_NV_vertex_buffer_unified_memory 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
-GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride);
-GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride);
-GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride);
-GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride);
-GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
-GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
-GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
-typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
-typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
-#endif
-
-#ifndef GL_NV_texture_barrier
-#define GL_NV_texture_barrier 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureBarrierNV (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
-#endif
-
-#ifndef GL_AMD_shader_stencil_export
-#define GL_AMD_shader_stencil_export 1
-#endif
-
-#ifndef GL_AMD_seamless_cubemap_per_texture
-#define GL_AMD_seamless_cubemap_per_texture 1
-#endif
-
-#ifndef GL_AMD_conservative_depth
-#define GL_AMD_conservative_depth 1
-#endif
-
-#ifndef GL_EXT_shader_image_load_store
-#define GL_EXT_shader_image_load_store 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
-GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
-typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);
-#endif
-
-#ifndef GL_EXT_vertex_attrib_64bit
-#define GL_EXT_vertex_attrib_64bit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x);
-GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y);
-GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v);
-GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params);
-GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-#endif
-
-#ifndef GL_NV_gpu_program5
-#define GL_NV_gpu_program5 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params);
-GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param);
-#endif
-
-#ifndef GL_NV_gpu_shader5
-#define GL_NV_gpu_shader5 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
-GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
-GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
-GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
-GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
-GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
-GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
-GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
-GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
-GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
-typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
-#endif
-
-#ifndef GL_NV_shader_buffer_store
-#define GL_NV_shader_buffer_store 1
-#endif
-
-#ifndef GL_NV_tessellation_program5
-#define GL_NV_tessellation_program5 1
-#endif
-
-#ifndef GL_NV_vertex_attrib_integer_64bit
-#define GL_NV_vertex_attrib_integer_64bit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x);
-GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y);
-GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x);
-GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y);
-GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v);
-GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params);
-GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params);
-GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
-#endif
-
-#ifndef GL_NV_multisample_coverage
-#define GL_NV_multisample_coverage 1
-#endif
-
-#ifndef GL_AMD_name_gen_delete
-#define GL_AMD_name_gen_delete 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names);
-GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names);
-GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names);
-typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names);
-typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);
-#endif
-
-#ifndef GL_AMD_debug_output
-#define GL_AMD_debug_output 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
-GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam);
-GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
-typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam);
-typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
-#endif
-
-#ifndef GL_NV_vdpau_interop
-#define GL_NV_vdpau_interop 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
-GLAPI void APIENTRY glVDPAUFiniNV (void);
-GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
-GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);
-GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);
-GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
-GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
-typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void);
-typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
-typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
-typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
-typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
-typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
-typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
-#endif
-
-#ifndef GL_AMD_transform_feedback3_lines_triangles
-#define GL_AMD_transform_feedback3_lines_triangles 1
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-#endif /* NO_SDL_GLEXT */
-
-#endif /* !__IPHONEOS__ */
-
-#endif /* _SDL_opengl_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_opengles.h b/deps/SDL2/include/SDL_opengles.h
deleted file mode 100644
index 00e60f5..0000000
--- a/deps/SDL2/include/SDL_opengles.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_opengles.h
- *
- *  This is a simple file to encapsulate the OpenGL ES 1.X API headers.
- */
-
-#ifdef __IPHONEOS__
-#include <OpenGLES/ES1/gl.h>
-#include <OpenGLES/ES1/glext.h>
-#else
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
diff --git a/deps/SDL2/include/SDL_opengles2.h b/deps/SDL2/include/SDL_opengles2.h
deleted file mode 100644
index 7697626..0000000
--- a/deps/SDL2/include/SDL_opengles2.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_opengles.h
- *
- *  This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
- */
-
-#ifdef __IPHONEOS__
-#include <OpenGLES/ES2/gl.h>
-#include <OpenGLES/ES2/glext.h>
-#else
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
diff --git a/deps/SDL2/include/SDL_pixels.h b/deps/SDL2/include/SDL_pixels.h
deleted file mode 100644
index 99fcd9a..0000000
--- a/deps/SDL2/include/SDL_pixels.h
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_pixels.h
- *
- *  Header for the enumerated pixel format definitions.
- */
-
-#ifndef _SDL_pixels_h
-#define _SDL_pixels_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \name Transparency definitions
- *
- *  These define alpha as the opacity of a surface.
- */
-/* @{ */
-#define SDL_ALPHA_OPAQUE 255
-#define SDL_ALPHA_TRANSPARENT 0
-/* @} */
-
-/** Pixel type. */
-enum
-{
-    SDL_PIXELTYPE_UNKNOWN,
-    SDL_PIXELTYPE_INDEX1,
-    SDL_PIXELTYPE_INDEX4,
-    SDL_PIXELTYPE_INDEX8,
-    SDL_PIXELTYPE_PACKED8,
-    SDL_PIXELTYPE_PACKED16,
-    SDL_PIXELTYPE_PACKED32,
-    SDL_PIXELTYPE_ARRAYU8,
-    SDL_PIXELTYPE_ARRAYU16,
-    SDL_PIXELTYPE_ARRAYU32,
-    SDL_PIXELTYPE_ARRAYF16,
-    SDL_PIXELTYPE_ARRAYF32
-};
-
-/** Bitmap pixel order, high bit -> low bit. */
-enum
-{
-    SDL_BITMAPORDER_NONE,
-    SDL_BITMAPORDER_4321,
-    SDL_BITMAPORDER_1234
-};
-
-/** Packed component order, high bit -> low bit. */
-enum
-{
-    SDL_PACKEDORDER_NONE,
-    SDL_PACKEDORDER_XRGB,
-    SDL_PACKEDORDER_RGBX,
-    SDL_PACKEDORDER_ARGB,
-    SDL_PACKEDORDER_RGBA,
-    SDL_PACKEDORDER_XBGR,
-    SDL_PACKEDORDER_BGRX,
-    SDL_PACKEDORDER_ABGR,
-    SDL_PACKEDORDER_BGRA
-};
-
-/** Array component order, low byte -> high byte. */
-enum
-{
-    SDL_ARRAYORDER_NONE,
-    SDL_ARRAYORDER_RGB,
-    SDL_ARRAYORDER_RGBA,
-    SDL_ARRAYORDER_ARGB,
-    SDL_ARRAYORDER_BGR,
-    SDL_ARRAYORDER_BGRA,
-    SDL_ARRAYORDER_ABGR
-};
-
-/** Packed component layout. */
-enum
-{
-    SDL_PACKEDLAYOUT_NONE,
-    SDL_PACKEDLAYOUT_332,
-    SDL_PACKEDLAYOUT_4444,
-    SDL_PACKEDLAYOUT_1555,
-    SDL_PACKEDLAYOUT_5551,
-    SDL_PACKEDLAYOUT_565,
-    SDL_PACKEDLAYOUT_8888,
-    SDL_PACKEDLAYOUT_2101010,
-    SDL_PACKEDLAYOUT_1010102
-};
-
-#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
-
-#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
-    ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
-     ((bits) << 8) | ((bytes) << 0))
-
-#define SDL_PIXELFLAG(X)    (((X) >> 28) & 0x0F)
-#define SDL_PIXELTYPE(X)    (((X) >> 24) & 0x0F)
-#define SDL_PIXELORDER(X)   (((X) >> 20) & 0x0F)
-#define SDL_PIXELLAYOUT(X)  (((X) >> 16) & 0x0F)
-#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
-#define SDL_BYTESPERPIXEL(X) \
-    (SDL_ISPIXELFORMAT_FOURCC(X) ? \
-        ((((X) == SDL_PIXELFORMAT_YUY2) || \
-          ((X) == SDL_PIXELFORMAT_UYVY) || \
-          ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
-
-#define SDL_ISPIXELFORMAT_INDEXED(format)   \
-    (!SDL_ISPIXELFORMAT_FOURCC(format) && \
-     ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
-      (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
-      (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
-
-#define SDL_ISPIXELFORMAT_ALPHA(format)   \
-    (!SDL_ISPIXELFORMAT_FOURCC(format) && \
-     ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
-      (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
-      (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
-      (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)))
-
-/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
-#define SDL_ISPIXELFORMAT_FOURCC(format)    \
-    ((format) && (SDL_PIXELFLAG(format) != 1))
-
-/* Note: If you modify this list, update SDL_GetPixelFormatName() */
-enum
-{
-    SDL_PIXELFORMAT_UNKNOWN,
-    SDL_PIXELFORMAT_INDEX1LSB =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
-                               1, 0),
-    SDL_PIXELFORMAT_INDEX1MSB =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
-                               1, 0),
-    SDL_PIXELFORMAT_INDEX4LSB =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
-                               4, 0),
-    SDL_PIXELFORMAT_INDEX4MSB =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
-                               4, 0),
-    SDL_PIXELFORMAT_INDEX8 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
-    SDL_PIXELFORMAT_RGB332 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
-                               SDL_PACKEDLAYOUT_332, 8, 1),
-    SDL_PIXELFORMAT_RGB444 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
-                               SDL_PACKEDLAYOUT_4444, 12, 2),
-    SDL_PIXELFORMAT_RGB555 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
-                               SDL_PACKEDLAYOUT_1555, 15, 2),
-    SDL_PIXELFORMAT_BGR555 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
-                               SDL_PACKEDLAYOUT_1555, 15, 2),
-    SDL_PIXELFORMAT_ARGB4444 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
-                               SDL_PACKEDLAYOUT_4444, 16, 2),
-    SDL_PIXELFORMAT_RGBA4444 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
-                               SDL_PACKEDLAYOUT_4444, 16, 2),
-    SDL_PIXELFORMAT_ABGR4444 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
-                               SDL_PACKEDLAYOUT_4444, 16, 2),
-    SDL_PIXELFORMAT_BGRA4444 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
-                               SDL_PACKEDLAYOUT_4444, 16, 2),
-    SDL_PIXELFORMAT_ARGB1555 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
-                               SDL_PACKEDLAYOUT_1555, 16, 2),
-    SDL_PIXELFORMAT_RGBA5551 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
-                               SDL_PACKEDLAYOUT_5551, 16, 2),
-    SDL_PIXELFORMAT_ABGR1555 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
-                               SDL_PACKEDLAYOUT_1555, 16, 2),
-    SDL_PIXELFORMAT_BGRA5551 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
-                               SDL_PACKEDLAYOUT_5551, 16, 2),
-    SDL_PIXELFORMAT_RGB565 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
-                               SDL_PACKEDLAYOUT_565, 16, 2),
-    SDL_PIXELFORMAT_BGR565 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
-                               SDL_PACKEDLAYOUT_565, 16, 2),
-    SDL_PIXELFORMAT_RGB24 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
-                               24, 3),
-    SDL_PIXELFORMAT_BGR24 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
-                               24, 3),
-    SDL_PIXELFORMAT_RGB888 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
-                               SDL_PACKEDLAYOUT_8888, 24, 4),
-    SDL_PIXELFORMAT_RGBX8888 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
-                               SDL_PACKEDLAYOUT_8888, 24, 4),
-    SDL_PIXELFORMAT_BGR888 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
-                               SDL_PACKEDLAYOUT_8888, 24, 4),
-    SDL_PIXELFORMAT_BGRX8888 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
-                               SDL_PACKEDLAYOUT_8888, 24, 4),
-    SDL_PIXELFORMAT_ARGB8888 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
-                               SDL_PACKEDLAYOUT_8888, 32, 4),
-    SDL_PIXELFORMAT_RGBA8888 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
-                               SDL_PACKEDLAYOUT_8888, 32, 4),
-    SDL_PIXELFORMAT_ABGR8888 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
-                               SDL_PACKEDLAYOUT_8888, 32, 4),
-    SDL_PIXELFORMAT_BGRA8888 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
-                               SDL_PACKEDLAYOUT_8888, 32, 4),
-    SDL_PIXELFORMAT_ARGB2101010 =
-        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
-                               SDL_PACKEDLAYOUT_2101010, 32, 4),
-
-    SDL_PIXELFORMAT_YV12 =      /**< Planar mode: Y + V + U  (3 planes) */
-        SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
-    SDL_PIXELFORMAT_IYUV =      /**< Planar mode: Y + U + V  (3 planes) */
-        SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
-    SDL_PIXELFORMAT_YUY2 =      /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
-        SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
-    SDL_PIXELFORMAT_UYVY =      /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
-        SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
-    SDL_PIXELFORMAT_YVYU =      /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
-        SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U')
-};
-
-typedef struct SDL_Color
-{
-    Uint8 r;
-    Uint8 g;
-    Uint8 b;
-    Uint8 a;
-} SDL_Color;
-#define SDL_Colour SDL_Color
-
-typedef struct SDL_Palette
-{
-    int ncolors;
-    SDL_Color *colors;
-    Uint32 version;
-    int refcount;
-} SDL_Palette;
-
-/**
- *  \note Everything in the pixel format structure is read-only.
- */
-typedef struct SDL_PixelFormat
-{
-    Uint32 format;
-    SDL_Palette *palette;
-    Uint8 BitsPerPixel;
-    Uint8 BytesPerPixel;
-    Uint8 padding[2];
-    Uint32 Rmask;
-    Uint32 Gmask;
-    Uint32 Bmask;
-    Uint32 Amask;
-    Uint8 Rloss;
-    Uint8 Gloss;
-    Uint8 Bloss;
-    Uint8 Aloss;
-    Uint8 Rshift;
-    Uint8 Gshift;
-    Uint8 Bshift;
-    Uint8 Ashift;
-    int refcount;
-    struct SDL_PixelFormat *next;
-} SDL_PixelFormat;
-
-/**
- * \brief Get the human readable name of a pixel format
- */
-extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
-
-/**
- *  \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
- *
- *  \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
- *
- *  \sa SDL_MasksToPixelFormatEnum()
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
-                                                            int *bpp,
-                                                            Uint32 * Rmask,
-                                                            Uint32 * Gmask,
-                                                            Uint32 * Bmask,
-                                                            Uint32 * Amask);
-
-/**
- *  \brief Convert a bpp and RGBA masks to an enumerated pixel format.
- *
- *  \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
- *          wasn't possible.
- *
- *  \sa SDL_PixelFormatEnumToMasks()
- */
-extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
-                                                          Uint32 Rmask,
-                                                          Uint32 Gmask,
-                                                          Uint32 Bmask,
-                                                          Uint32 Amask);
-
-/**
- *  \brief Create an SDL_PixelFormat structure from a pixel format enum.
- */
-extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
-
-/**
- *  \brief Free an SDL_PixelFormat structure.
- */
-extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
-
-/**
- *  \brief Create a palette structure with the specified number of color
- *         entries.
- *
- *  \return A new palette, or NULL if there wasn't enough memory.
- *
- *  \note The palette entries are initialized to white.
- *
- *  \sa SDL_FreePalette()
- */
-extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
-
-/**
- *  \brief Set the palette for a pixel format structure.
- */
-extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
-                                                      SDL_Palette *palette);
-
-/**
- *  \brief Set a range of colors in a palette.
- *
- *  \param palette    The palette to modify.
- *  \param colors     An array of colors to copy into the palette.
- *  \param firstcolor The index of the first palette entry to modify.
- *  \param ncolors    The number of entries to modify.
- *
- *  \return 0 on success, or -1 if not all of the colors could be set.
- */
-extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
-                                                 const SDL_Color * colors,
-                                                 int firstcolor, int ncolors);
-
-/**
- *  \brief Free a palette created with SDL_AllocPalette().
- *
- *  \sa SDL_AllocPalette()
- */
-extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
-
-/**
- *  \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
- *
- *  \sa SDL_MapRGBA
- */
-extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
-                                          Uint8 r, Uint8 g, Uint8 b);
-
-/**
- *  \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
- *
- *  \sa SDL_MapRGB
- */
-extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
-                                           Uint8 r, Uint8 g, Uint8 b,
-                                           Uint8 a);
-
-/**
- *  \brief Get the RGB components from a pixel of the specified format.
- *
- *  \sa SDL_GetRGBA
- */
-extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
-                                        const SDL_PixelFormat * format,
-                                        Uint8 * r, Uint8 * g, Uint8 * b);
-
-/**
- *  \brief Get the RGBA components from a pixel of the specified format.
- *
- *  \sa SDL_GetRGB
- */
-extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
-                                         const SDL_PixelFormat * format,
-                                         Uint8 * r, Uint8 * g, Uint8 * b,
-                                         Uint8 * a);
-
-/**
- *  \brief Calculate a 256 entry gamma ramp for a gamma value.
- */
-extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_pixels_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_platform.h b/deps/SDL2/include/SDL_platform.h
deleted file mode 100644
index a40c41e..0000000
--- a/deps/SDL2/include/SDL_platform.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_platform.h
- *
- *  Try to get a standard set of platform defines.
- */
-
-#ifndef _SDL_platform_h
-#define _SDL_platform_h
-
-#if defined(_AIX)
-#undef __AIX__
-#define __AIX__     1
-#endif
-#if defined(__BEOS__)
-#undef __BEOS__
-#define __BEOS__    1
-#endif
-#if defined(__HAIKU__)
-#undef __HAIKU__
-#define __HAIKU__   1
-#endif
-#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
-#undef __BSDI__
-#define __BSDI__    1
-#endif
-#if defined(_arch_dreamcast)
-#undef __DREAMCAST__
-#define __DREAMCAST__   1
-#endif
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-#undef __FREEBSD__
-#define __FREEBSD__ 1
-#endif
-#if defined(hpux) || defined(__hpux) || defined(__hpux__)
-#undef __HPUX__
-#define __HPUX__    1
-#endif
-#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
-#undef __IRIX__
-#define __IRIX__    1
-#endif
-#if defined(linux) || defined(__linux) || defined(__linux__)
-#undef __LINUX__
-#define __LINUX__   1
-#endif
-#if defined(ANDROID)
-#undef __ANDROID__
-#undef __LINUX__ /* do we need to do this? */
-#define __ANDROID__ 1
-#endif
-
-#if defined(__APPLE__)
-/* lets us know what version of Mac OS X we're compiling on */
-#include "AvailabilityMacros.h"
-#include "TargetConditionals.h"
-#if TARGET_OS_IPHONE
-/* if compiling for iPhone */
-#undef __IPHONEOS__
-#define __IPHONEOS__ 1
-#undef __MACOSX__
-#else
-/* if not compiling for iPhone */
-#undef __MACOSX__
-#define __MACOSX__  1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
-# error SDL for Mac OS X only supports deploying on 10.5 and above.
-#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-# error SDL for Mac OS X must be built with a 10.6 SDK or above.
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */
-#endif /* TARGET_OS_IPHONE */
-#endif /* defined(__APPLE__) */
-
-#if defined(__NetBSD__)
-#undef __NETBSD__
-#define __NETBSD__  1
-#endif
-#if defined(__OpenBSD__)
-#undef __OPENBSD__
-#define __OPENBSD__ 1
-#endif
-#if defined(__OS2__)
-#undef __OS2__
-#define __OS2__     1
-#endif
-#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
-#undef __OSF__
-#define __OSF__     1
-#endif
-#if defined(__QNXNTO__)
-#undef __QNXNTO__
-#define __QNXNTO__  1
-#endif
-#if defined(riscos) || defined(__riscos) || defined(__riscos__)
-#undef __RISCOS__
-#define __RISCOS__  1
-#endif
-#if defined(__SVR4)
-#undef __SOLARIS__
-#define __SOLARIS__ 1
-#endif
-#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
-#undef __WINDOWS__
-#define __WINDOWS__   1
-#endif
-#if defined(__WINDOWS__)
-#undef __WIN32__
-#define __WIN32__ 1
-#endif
-#if defined(__PSP__)
-#undef __PSP__
-#define __PSP__ 1
-#endif
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief Gets the name of the platform.
- */
-extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_platform_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_power.h b/deps/SDL2/include/SDL_power.h
deleted file mode 100644
index 4f70c5b..0000000
--- a/deps/SDL2/include/SDL_power.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_power_h
-#define _SDL_power_h
-
-/**
- *  \file SDL_power.h
- *
- *  Header for the SDL power management routines.
- */
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief The basic state for the system's power supply.
- */
-typedef enum
-{
-    SDL_POWERSTATE_UNKNOWN,      /**< cannot determine power status */
-    SDL_POWERSTATE_ON_BATTERY,   /**< Not plugged in, running on the battery */
-    SDL_POWERSTATE_NO_BATTERY,   /**< Plugged in, no battery available */
-    SDL_POWERSTATE_CHARGING,     /**< Plugged in, charging battery */
-    SDL_POWERSTATE_CHARGED       /**< Plugged in, battery charged */
-} SDL_PowerState;
-
-
-/**
- *  \brief Get the current power supply details.
- *
- *  \param secs Seconds of battery life left. You can pass a NULL here if
- *              you don't care. Will return -1 if we can't determine a
- *              value, or we're not running on a battery.
- *
- *  \param pct Percentage of battery life left, between 0 and 100. You can
- *             pass a NULL here if you don't care. Will return -1 if we
- *             can't determine a value, or we're not running on a battery.
- *
- *  \return The state of the battery (if any).
- */
-extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_power_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_quit.h b/deps/SDL2/include/SDL_quit.h
deleted file mode 100644
index 485e42d..0000000
--- a/deps/SDL2/include/SDL_quit.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_quit.h
- *
- *  Include file for SDL quit event handling.
- */
-
-#ifndef _SDL_quit_h
-#define _SDL_quit_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-/**
- *  \file SDL_quit.h
- *
- *  An ::SDL_QUIT event is generated when the user tries to close the application
- *  window.  If it is ignored or filtered out, the window will remain open.
- *  If it is not ignored or filtered, it is queued normally and the window
- *  is allowed to close.  When the window is closed, screen updates will
- *  complete, but have no effect.
- *
- *  SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
- *  and SIGTERM (system termination request), if handlers do not already
- *  exist, that generate ::SDL_QUIT events as well.  There is no way
- *  to determine the cause of an ::SDL_QUIT event, but setting a signal
- *  handler in your application will override the default generation of
- *  quit events for that signal.
- *
- *  \sa SDL_Quit()
- */
-
-/* There are no functions directly affecting the quit event */
-
-#define SDL_QuitRequested() \
-        (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
-
-#endif /* _SDL_quit_h */
diff --git a/deps/SDL2/include/SDL_rect.h b/deps/SDL2/include/SDL_rect.h
deleted file mode 100644
index 7132e1b..0000000
--- a/deps/SDL2/include/SDL_rect.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_rect.h
- *
- *  Header file for SDL_rect definition and management functions.
- */
-
-#ifndef _SDL_rect_h
-#define _SDL_rect_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_pixels.h"
-#include "SDL_rwops.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief  The structure that defines a point
- *
- *  \sa SDL_EnclosePoints
- */
-typedef struct SDL_Point
-{
-    int x;
-    int y;
-} SDL_Point;
-
-/**
- *  \brief A rectangle, with the origin at the upper left.
- *
- *  \sa SDL_RectEmpty
- *  \sa SDL_RectEquals
- *  \sa SDL_HasIntersection
- *  \sa SDL_IntersectRect
- *  \sa SDL_UnionRect
- *  \sa SDL_EnclosePoints
- */
-typedef struct SDL_Rect
-{
-    int x, y;
-    int w, h;
-} SDL_Rect;
-
-/**
- *  \brief Returns true if the rectangle has no area.
- */
-SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
-{
-    return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
-}
-
-/**
- *  \brief Returns true if the two rectangles are equal.
- */
-SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
-{
-    return (a && b && (a->x == b->x) && (a->y == b->y) &&
-            (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
-}
-
-/**
- *  \brief Determine whether two rectangles intersect.
- *
- *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
-                                                     const SDL_Rect * B);
-
-/**
- *  \brief Calculate the intersection of two rectangles.
- *
- *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
-                                                   const SDL_Rect * B,
-                                                   SDL_Rect * result);
-
-/**
- *  \brief Calculate the union of two rectangles.
- */
-extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
-                                           const SDL_Rect * B,
-                                           SDL_Rect * result);
-
-/**
- *  \brief Calculate a minimal rectangle enclosing a set of points
- *
- *  \return SDL_TRUE if any points were within the clipping rect
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
-                                                   int count,
-                                                   const SDL_Rect * clip,
-                                                   SDL_Rect * result);
-
-/**
- *  \brief Calculate the intersection of a rectangle and line segment.
- *
- *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
-                                                          rect, int *X1,
-                                                          int *Y1, int *X2,
-                                                          int *Y2);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_rect_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_render.h b/deps/SDL2/include/SDL_render.h
deleted file mode 100644
index a765dc7..0000000
--- a/deps/SDL2/include/SDL_render.h
+++ /dev/null
@@ -1,870 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_render.h
- *
- *  Header file for SDL 2D rendering functions.
- *
- *  This API supports the following features:
- *      * single pixel points
- *      * single pixel lines
- *      * filled rectangles
- *      * texture images
- *
- *  The primitives may be drawn in opaque, blended, or additive modes.
- *
- *  The texture images may be drawn in opaque, blended, or additive modes.
- *  They can have an additional color tint or alpha modulation applied to
- *  them, and may also be stretched with linear interpolation.
- *
- *  This API is designed to accelerate simple 2D operations. You may
- *  want more functionality such as polygons and particle effects and
- *  in that case you should use SDL's OpenGL/Direct3D support or one
- *  of the many good 3D engines.
- *
- *  These functions must be called from the main thread.
- *  See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995
- */
-
-#ifndef _SDL_render_h
-#define _SDL_render_h
-
-#include "SDL_stdinc.h"
-#include "SDL_rect.h"
-#include "SDL_video.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief Flags used when creating a rendering context
- */
-typedef enum
-{
-    SDL_RENDERER_SOFTWARE = 0x00000001,         /**< The renderer is a software fallback */
-    SDL_RENDERER_ACCELERATED = 0x00000002,      /**< The renderer uses hardware
-                                                     acceleration */
-    SDL_RENDERER_PRESENTVSYNC = 0x00000004,     /**< Present is synchronized
-                                                     with the refresh rate */
-    SDL_RENDERER_TARGETTEXTURE = 0x00000008     /**< The renderer supports
-                                                     rendering to texture */
-} SDL_RendererFlags;
-
-/**
- *  \brief Information on the capabilities of a render driver or context.
- */
-typedef struct SDL_RendererInfo
-{
-    const char *name;           /**< The name of the renderer */
-    Uint32 flags;               /**< Supported ::SDL_RendererFlags */
-    Uint32 num_texture_formats; /**< The number of available texture formats */
-    Uint32 texture_formats[16]; /**< The available texture formats */
-    int max_texture_width;      /**< The maximimum texture width */
-    int max_texture_height;     /**< The maximimum texture height */
-} SDL_RendererInfo;
-
-/**
- *  \brief The access pattern allowed for a texture.
- */
-typedef enum
-{
-    SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
-    SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
-    SDL_TEXTUREACCESS_TARGET     /**< Texture can be used as a render target */
-} SDL_TextureAccess;
-
-/**
- *  \brief The texture channel modulation used in SDL_RenderCopy().
- */
-typedef enum
-{
-    SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
-    SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
-    SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
-} SDL_TextureModulate;
-
-/**
- *  \brief Flip constants for SDL_RenderCopyEx
- */
-typedef enum
-{
-    SDL_FLIP_NONE = 0x00000000,     /**< Do not flip */
-    SDL_FLIP_HORIZONTAL = 0x00000001,    /**< flip horizontally */
-    SDL_FLIP_VERTICAL = 0x00000002     /**< flip vertically */
-} SDL_RendererFlip;
-
-/**
- *  \brief A structure representing rendering state
- */
-struct SDL_Renderer;
-typedef struct SDL_Renderer SDL_Renderer;
-
-/**
- *  \brief An efficient driver-specific representation of pixel data
- */
-struct SDL_Texture;
-typedef struct SDL_Texture SDL_Texture;
-
-
-/* Function prototypes */
-
-/**
- *  \brief Get the number of 2D rendering drivers available for the current
- *         display.
- *
- *  A render driver is a set of code that handles rendering and texture
- *  management on a particular display.  Normally there is only one, but
- *  some drivers may have several available with different capabilities.
- *
- *  \sa SDL_GetRenderDriverInfo()
- *  \sa SDL_CreateRenderer()
- */
-extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
-
-/**
- *  \brief Get information about a specific 2D rendering driver for the current
- *         display.
- *
- *  \param index The index of the driver to query information about.
- *  \param info  A pointer to an SDL_RendererInfo struct to be filled with
- *               information on the rendering driver.
- *
- *  \return 0 on success, -1 if the index was out of range.
- *
- *  \sa SDL_CreateRenderer()
- */
-extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
-                                                    SDL_RendererInfo * info);
-
-/**
- *  \brief Create a window and default renderer
- *
- *  \param width    The width of the window
- *  \param height   The height of the window
- *  \param window_flags The flags used to create the window
- *  \param window   A pointer filled with the window, or NULL on error
- *  \param renderer A pointer filled with the renderer, or NULL on error
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(
-                                int width, int height, Uint32 window_flags,
-                                SDL_Window **window, SDL_Renderer **renderer);
-
-
-/**
- *  \brief Create a 2D rendering context for a window.
- *
- *  \param window The window where rendering is displayed.
- *  \param index    The index of the rendering driver to initialize, or -1 to
- *                  initialize the first one supporting the requested flags.
- *  \param flags    ::SDL_RendererFlags.
- *
- *  \return A valid rendering context or NULL if there was an error.
- *
- *  \sa SDL_CreateSoftwareRenderer()
- *  \sa SDL_GetRendererInfo()
- *  \sa SDL_DestroyRenderer()
- */
-extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
-                                               int index, Uint32 flags);
-
-/**
- *  \brief Create a 2D software rendering context for a surface.
- *
- *  \param surface The surface where rendering is done.
- *
- *  \return A valid rendering context or NULL if there was an error.
- *
- *  \sa SDL_CreateRenderer()
- *  \sa SDL_DestroyRenderer()
- */
-extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
-
-/**
- *  \brief Get the renderer associated with a window.
- */
-extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window);
-
-/**
- *  \brief Get information about a rendering context.
- */
-extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
-                                                SDL_RendererInfo * info);
-
-/**
- *  \brief Get the output size of a rendering context.
- */
-extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer,
-                                                      int *w, int *h);
-
-/**
- *  \brief Create a texture for a rendering context.
- *
- *  \param renderer The renderer.
- *  \param format The format of the texture.
- *  \param access One of the enumerated values in ::SDL_TextureAccess.
- *  \param w      The width of the texture in pixels.
- *  \param h      The height of the texture in pixels.
- *
- *  \return The created texture is returned, or 0 if no rendering context was
- *          active,  the format was unsupported, or the width or height were out
- *          of range.
- *
- *  \sa SDL_QueryTexture()
- *  \sa SDL_UpdateTexture()
- *  \sa SDL_DestroyTexture()
- */
-extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer,
-                                                        Uint32 format,
-                                                        int access, int w,
-                                                        int h);
-
-/**
- *  \brief Create a texture from an existing surface.
- *
- *  \param renderer The renderer.
- *  \param surface The surface containing pixel data used to fill the texture.
- *
- *  \return The created texture is returned, or 0 on error.
- *
- *  \note The surface is not modified or freed by this function.
- *
- *  \sa SDL_QueryTexture()
- *  \sa SDL_DestroyTexture()
- */
-extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
-
-/**
- *  \brief Query the attributes of a texture
- *
- *  \param texture A texture to be queried.
- *  \param format  A pointer filled in with the raw format of the texture.  The
- *                 actual format may differ, but pixel transfers will use this
- *                 format.
- *  \param access  A pointer filled in with the actual access to the texture.
- *  \param w       A pointer filled in with the width of the texture in pixels.
- *  \param h       A pointer filled in with the height of the texture in pixels.
- *
- *  \return 0 on success, or -1 if the texture is not valid.
- */
-extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
-                                             Uint32 * format, int *access,
-                                             int *w, int *h);
-
-/**
- *  \brief Set an additional color value used in render copy operations.
- *
- *  \param texture The texture to update.
- *  \param r       The red color value multiplied into copy operations.
- *  \param g       The green color value multiplied into copy operations.
- *  \param b       The blue color value multiplied into copy operations.
- *
- *  \return 0 on success, or -1 if the texture is not valid or color modulation
- *          is not supported.
- *
- *  \sa SDL_GetTextureColorMod()
- */
-extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
-                                                   Uint8 r, Uint8 g, Uint8 b);
-
-
-/**
- *  \brief Get the additional color value used in render copy operations.
- *
- *  \param texture The texture to query.
- *  \param r         A pointer filled in with the current red color value.
- *  \param g         A pointer filled in with the current green color value.
- *  \param b         A pointer filled in with the current blue color value.
- *
- *  \return 0 on success, or -1 if the texture is not valid.
- *
- *  \sa SDL_SetTextureColorMod()
- */
-extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
-                                                   Uint8 * r, Uint8 * g,
-                                                   Uint8 * b);
-
-/**
- *  \brief Set an additional alpha value used in render copy operations.
- *
- *  \param texture The texture to update.
- *  \param alpha     The alpha value multiplied into copy operations.
- *
- *  \return 0 on success, or -1 if the texture is not valid or alpha modulation
- *          is not supported.
- *
- *  \sa SDL_GetTextureAlphaMod()
- */
-extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
-                                                   Uint8 alpha);
-
-/**
- *  \brief Get the additional alpha value used in render copy operations.
- *
- *  \param texture The texture to query.
- *  \param alpha     A pointer filled in with the current alpha value.
- *
- *  \return 0 on success, or -1 if the texture is not valid.
- *
- *  \sa SDL_SetTextureAlphaMod()
- */
-extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
-                                                   Uint8 * alpha);
-
-/**
- *  \brief Set the blend mode used for texture copy operations.
- *
- *  \param texture The texture to update.
- *  \param blendMode ::SDL_BlendMode to use for texture blending.
- *
- *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
- *          not supported.
- *
- *  \note If the blend mode is not supported, the closest supported mode is
- *        chosen.
- *
- *  \sa SDL_GetTextureBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
-                                                    SDL_BlendMode blendMode);
-
-/**
- *  \brief Get the blend mode used for texture copy operations.
- *
- *  \param texture   The texture to query.
- *  \param blendMode A pointer filled in with the current blend mode.
- *
- *  \return 0 on success, or -1 if the texture is not valid.
- *
- *  \sa SDL_SetTextureBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
-                                                    SDL_BlendMode *blendMode);
-
-/**
- *  \brief Update the given texture rectangle with new pixel data.
- *
- *  \param texture   The texture to update
- *  \param rect      A pointer to the rectangle of pixels to update, or NULL to
- *                   update the entire texture.
- *  \param pixels    The raw pixel data.
- *  \param pitch     The number of bytes between rows of pixel data.
- *
- *  \return 0 on success, or -1 if the texture is not valid.
- *
- *  \note This is a fairly slow function.
- */
-extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
-                                              const SDL_Rect * rect,
-                                              const void *pixels, int pitch);
-
-/**
- *  \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
- *
- *  \param texture   The texture to update
- *  \param rect      A pointer to the rectangle of pixels to update, or NULL to
- *                   update the entire texture.
- *  \param Yplane    The raw pixel data for the Y plane.
- *  \param Ypitch    The number of bytes between rows of pixel data for the Y plane.
- *  \param Uplane    The raw pixel data for the U plane.
- *  \param Upitch    The number of bytes between rows of pixel data for the U plane.
- *  \param Vplane    The raw pixel data for the V plane.
- *  \param Vpitch    The number of bytes between rows of pixel data for the V plane.
- *
- *  \return 0 on success, or -1 if the texture is not valid.
- *
- *  \note You can use SDL_UpdateTexture() as long as your pixel data is
- *        a contiguous block of Y and U/V planes in the proper order, but
- *        this function is available if your pixel data is not contiguous.
- */
-extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture,
-                                                 const SDL_Rect * rect,
-                                                 const Uint8 *Yplane, int Ypitch,
-                                                 const Uint8 *Uplane, int Upitch,
-                                                 const Uint8 *Vplane, int Vpitch);
-
-/**
- *  \brief Lock a portion of the texture for write-only pixel access.
- *
- *  \param texture   The texture to lock for access, which was created with
- *                   ::SDL_TEXTUREACCESS_STREAMING.
- *  \param rect      A pointer to the rectangle to lock for access. If the rect
- *                   is NULL, the entire texture will be locked.
- *  \param pixels    This is filled in with a pointer to the locked pixels,
- *                   appropriately offset by the locked area.
- *  \param pitch     This is filled in with the pitch of the locked pixels.
- *
- *  \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
- *
- *  \sa SDL_UnlockTexture()
- */
-extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
-                                            const SDL_Rect * rect,
-                                            void **pixels, int *pitch);
-
-/**
- *  \brief Unlock a texture, uploading the changes to video memory, if needed.
- *
- *  \sa SDL_LockTexture()
- */
-extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
-
-/**
- * \brief Determines whether a window supports the use of render targets
- *
- * \param renderer The renderer that will be checked
- *
- * \return SDL_TRUE if supported, SDL_FALSE if not.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
-
-/**
- * \brief Set a texture as the current rendering target.
- *
- * \param renderer The renderer.
- * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
- *
- * \return 0 on success, or -1 on error
- *
- *  \sa SDL_GetRenderTarget()
- */
-extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
-                                                SDL_Texture *texture);
-
-/**
- * \brief Get the current render target or NULL for the default render target.
- *
- * \return The current render target
- *
- *  \sa SDL_SetRenderTarget()
- */
-extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer);
-
-/**
- *  \brief Set device independent resolution for rendering
- *
- *  \param renderer The renderer for which resolution should be set.
- *  \param w      The width of the logical resolution
- *  \param h      The height of the logical resolution
- *
- *  This function uses the viewport and scaling functionality to allow a fixed logical
- *  resolution for rendering, regardless of the actual output resolution.  If the actual
- *  output resolution doesn't have the same aspect ratio the output rendering will be
- *  centered within the output display.
- *
- *  If the output display is a window, mouse events in the window will be filtered
- *  and scaled so they seem to arrive within the logical resolution.
- *
- *  \note If this function results in scaling or subpixel drawing by the
- *        rendering backend, it will be handled using the appropriate
- *        quality hints.
- *
- *  \sa SDL_RenderGetLogicalSize()
- *  \sa SDL_RenderSetScale()
- *  \sa SDL_RenderSetViewport()
- */
-extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h);
-
-/**
- *  \brief Get device independent resolution for rendering
- *
- *  \param renderer The renderer from which resolution should be queried.
- *  \param w      A pointer filled with the width of the logical resolution
- *  \param h      A pointer filled with the height of the logical resolution
- *
- *  \sa SDL_RenderSetLogicalSize()
- */
-extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h);
-
-/**
- *  \brief Set the drawing area for rendering on the current target.
- *
- *  \param renderer The renderer for which the drawing area should be set.
- *  \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
- *
- *  The x,y of the viewport rect represents the origin for rendering.
- *
- *  \return 0 on success, or -1 on error
- *
- *  \note If the window associated with the renderer is resized, the viewport is automatically reset.
- *
- *  \sa SDL_RenderGetViewport()
- *  \sa SDL_RenderSetLogicalSize()
- */
-extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
-                                                  const SDL_Rect * rect);
-
-/**
- *  \brief Get the drawing area for the current target.
- *
- *  \sa SDL_RenderSetViewport()
- */
-extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
-                                                   SDL_Rect * rect);
-
-/**
- *  \brief Set the clip rectangle for the current target.
- *
- *  \param renderer The renderer for which clip rectangle should be set.
- *  \param rect   A pointer to the rectangle to set as the clip rectangle, or
- *                NULL to disable clipping.
- *
- *  \return 0 on success, or -1 on error
- *
- *  \sa SDL_RenderGetClipRect()
- */
-extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
-                                                  const SDL_Rect * rect);
-
-/**
- *  \brief Get the clip rectangle for the current target.
- *
- *  \param renderer The renderer from which clip rectangle should be queried.
- *  \param rect   A pointer filled in with the current clip rectangle, or
- *                an empty rectangle if clipping is disabled.
- *
- *  \sa SDL_RenderSetClipRect()
- */
-extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer,
-                                                   SDL_Rect * rect);
-
-/**
- *  \brief Set the drawing scale for rendering on the current target.
- *
- *  \param renderer The renderer for which the drawing scale should be set.
- *  \param scaleX The horizontal scaling factor
- *  \param scaleY The vertical scaling factor
- *
- *  The drawing coordinates are scaled by the x/y scaling factors
- *  before they are used by the renderer.  This allows resolution
- *  independent drawing with a single coordinate system.
- *
- *  \note If this results in scaling or subpixel drawing by the
- *        rendering backend, it will be handled using the appropriate
- *        quality hints.  For best results use integer scaling factors.
- *
- *  \sa SDL_RenderGetScale()
- *  \sa SDL_RenderSetLogicalSize()
- */
-extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer,
-                                               float scaleX, float scaleY);
-
-/**
- *  \brief Get the drawing scale for the current target.
- *
- *  \param renderer The renderer from which drawing scale should be queried.
- *  \param scaleX A pointer filled in with the horizontal scaling factor
- *  \param scaleY A pointer filled in with the vertical scaling factor
- *
- *  \sa SDL_RenderSetScale()
- */
-extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer,
-                                               float *scaleX, float *scaleY);
-
-/**
- *  \brief Set the color used for drawing operations (Rect, Line and Clear).
- *
- *  \param renderer The renderer for which drawing color should be set.
- *  \param r The red value used to draw on the rendering target.
- *  \param g The green value used to draw on the rendering target.
- *  \param b The blue value used to draw on the rendering target.
- *  \param a The alpha value used to draw on the rendering target, usually
- *           ::SDL_ALPHA_OPAQUE (255).
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer,
-                                           Uint8 r, Uint8 g, Uint8 b,
-                                           Uint8 a);
-
-/**
- *  \brief Get the color used for drawing operations (Rect, Line and Clear).
- *
- *  \param renderer The renderer from which drawing color should be queried.
- *  \param r A pointer to the red value used to draw on the rendering target.
- *  \param g A pointer to the green value used to draw on the rendering target.
- *  \param b A pointer to the blue value used to draw on the rendering target.
- *  \param a A pointer to the alpha value used to draw on the rendering target,
- *           usually ::SDL_ALPHA_OPAQUE (255).
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer,
-                                           Uint8 * r, Uint8 * g, Uint8 * b,
-                                           Uint8 * a);
-
-/**
- *  \brief Set the blend mode used for drawing operations (Fill and Line).
- *
- *  \param renderer The renderer for which blend mode should be set.
- *  \param blendMode ::SDL_BlendMode to use for blending.
- *
- *  \return 0 on success, or -1 on error
- *
- *  \note If the blend mode is not supported, the closest supported mode is
- *        chosen.
- *
- *  \sa SDL_GetRenderDrawBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
-                                                       SDL_BlendMode blendMode);
-
-/**
- *  \brief Get the blend mode used for drawing operations.
- *
- *  \param renderer The renderer from which blend mode should be queried.
- *  \param blendMode A pointer filled in with the current blend mode.
- *
- *  \return 0 on success, or -1 on error
- *
- *  \sa SDL_SetRenderDrawBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
-                                                       SDL_BlendMode *blendMode);
-
-/**
- *  \brief Clear the current rendering target with the drawing color
- *
- *  This function clears the entire rendering target, ignoring the viewport.
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
-
-/**
- *  \brief Draw a point on the current rendering target.
- *
- *  \param renderer The renderer which should draw a point.
- *  \param x The x coordinate of the point.
- *  \param y The y coordinate of the point.
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer,
-                                                int x, int y);
-
-/**
- *  \brief Draw multiple points on the current rendering target.
- *
- *  \param renderer The renderer which should draw multiple points.
- *  \param points The points to draw
- *  \param count The number of points to draw
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer,
-                                                 const SDL_Point * points,
-                                                 int count);
-
-/**
- *  \brief Draw a line on the current rendering target.
- *
- *  \param renderer The renderer which should draw a line.
- *  \param x1 The x coordinate of the start point.
- *  \param y1 The y coordinate of the start point.
- *  \param x2 The x coordinate of the end point.
- *  \param y2 The y coordinate of the end point.
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer,
-                                               int x1, int y1, int x2, int y2);
-
-/**
- *  \brief Draw a series of connected lines on the current rendering target.
- *
- *  \param renderer The renderer which should draw multiple lines.
- *  \param points The points along the lines
- *  \param count The number of points, drawing count-1 lines
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer,
-                                                const SDL_Point * points,
-                                                int count);
-
-/**
- *  \brief Draw a rectangle on the current rendering target.
- *
- *  \param renderer The renderer which should draw a rectangle.
- *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer,
-                                               const SDL_Rect * rect);
-
-/**
- *  \brief Draw some number of rectangles on the current rendering target.
- *
- *  \param renderer The renderer which should draw multiple rectangles.
- *  \param rects A pointer to an array of destination rectangles.
- *  \param count The number of rectangles.
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
-                                                const SDL_Rect * rects,
-                                                int count);
-
-/**
- *  \brief Fill a rectangle on the current rendering target with the drawing color.
- *
- *  \param renderer The renderer which should fill a rectangle.
- *  \param rect A pointer to the destination rectangle, or NULL for the entire
- *              rendering target.
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer,
-                                               const SDL_Rect * rect);
-
-/**
- *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
- *
- *  \param renderer The renderer which should fill multiple rectangles.
- *  \param rects A pointer to an array of destination rectangles.
- *  \param count The number of rectangles.
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
-                                                const SDL_Rect * rects,
-                                                int count);
-
-/**
- *  \brief Copy a portion of the texture to the current rendering target.
- *
- *  \param renderer The renderer which should copy parts of a texture.
- *  \param texture The source texture.
- *  \param srcrect   A pointer to the source rectangle, or NULL for the entire
- *                   texture.
- *  \param dstrect   A pointer to the destination rectangle, or NULL for the
- *                   entire rendering target.
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
-                                           SDL_Texture * texture,
-                                           const SDL_Rect * srcrect,
-                                           const SDL_Rect * dstrect);
-
-/**
- *  \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
- *
- *  \param renderer The renderer which should copy parts of a texture.
- *  \param texture The source texture.
- *  \param srcrect   A pointer to the source rectangle, or NULL for the entire
- *                   texture.
- *  \param dstrect   A pointer to the destination rectangle, or NULL for the
- *                   entire rendering target.
- *  \param angle    An angle in degrees that indicates the rotation that will be applied to dstrect
- *  \param center   A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done aroud dstrect.w/2, dstrect.h/2)
- *  \param flip     An SDL_RendererFlip value stating which flipping actions should be performed on the texture
- *
- *  \return 0 on success, or -1 on error
- */
-extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer,
-                                           SDL_Texture * texture,
-                                           const SDL_Rect * srcrect,
-                                           const SDL_Rect * dstrect,
-                                           const double angle,
-                                           const SDL_Point *center,
-                                           const SDL_RendererFlip flip);
-
-/**
- *  \brief Read pixels from the current rendering target.
- *
- *  \param renderer The renderer from which pixels should be read.
- *  \param rect   A pointer to the rectangle to read, or NULL for the entire
- *                render target.
- *  \param format The desired format of the pixel data, or 0 to use the format
- *                of the rendering target
- *  \param pixels A pointer to be filled in with the pixel data
- *  \param pitch  The pitch of the pixels parameter.
- *
- *  \return 0 on success, or -1 if pixel reading is not supported.
- *
- *  \warning This is a very slow operation, and should not be used frequently.
- */
-extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
-                                                 const SDL_Rect * rect,
-                                                 Uint32 format,
-                                                 void *pixels, int pitch);
-
-/**
- *  \brief Update the screen with rendering performed.
- */
-extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer);
-
-/**
- *  \brief Destroy the specified texture.
- *
- *  \sa SDL_CreateTexture()
- *  \sa SDL_CreateTextureFromSurface()
- */
-extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
-
-/**
- *  \brief Destroy the rendering context for a window and free associated
- *         textures.
- *
- *  \sa SDL_CreateRenderer()
- */
-extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
-
-
-/**
- *  \brief Bind the texture to the current OpenGL/ES/ES2 context for use with
- *         OpenGL instructions.
- *
- *  \param texture  The SDL texture to bind
- *  \param texw     A pointer to a float that will be filled with the texture width
- *  \param texh     A pointer to a float that will be filled with the texture height
- *
- *  \return 0 on success, or -1 if the operation is not supported
- */
-extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh);
-
-/**
- *  \brief Unbind a texture from the current OpenGL/ES/ES2 context.
- *
- *  \param texture  The SDL texture to unbind
- *
- *  \return 0 on success, or -1 if the operation is not supported
- */
-extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_render_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_revision.h b/deps/SDL2/include/SDL_revision.h
deleted file mode 100644
index fe3a9fc..0000000
--- a/deps/SDL2/include/SDL_revision.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define SDL_REVISION "hg-7890:c031abe0b287"
-#define SDL_REVISION_NUMBER 7890
diff --git a/deps/SDL2/include/SDL_rwops.h b/deps/SDL2/include/SDL_rwops.h
deleted file mode 100644
index d257442..0000000
--- a/deps/SDL2/include/SDL_rwops.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_rwops.h
- *
- *  This file provides a general interface for SDL to read and write
- *  data streams.  It can easily be extended to files, memory, etc.
- */
-
-#ifndef _SDL_rwops_h
-#define _SDL_rwops_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* RWops Types */
-#define SDL_RWOPS_UNKNOWN   0   /* Unknown stream type */
-#define SDL_RWOPS_WINFILE   1   /* Win32 file */
-#define SDL_RWOPS_STDFILE   2   /* Stdio file */
-#define SDL_RWOPS_JNIFILE   3   /* Android asset */
-#define SDL_RWOPS_MEMORY    4   /* Memory stream */
-#define SDL_RWOPS_MEMORY_RO 5   /* Read-Only memory stream */
-
-/**
- * This is the read/write operation structure -- very basic.
- */
-typedef struct SDL_RWops
-{
-    /**
-     *  Return the size of the file in this rwops, or -1 if unknown
-     */
-    Sint64 (SDLCALL * size) (struct SDL_RWops * context);
-
-    /**
-     *  Seek to \c offset relative to \c whence, one of stdio's whence values:
-     *  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
-     *
-     *  \return the final offset in the data stream, or -1 on error.
-     */
-    Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset,
-                             int whence);
-
-    /**
-     *  Read up to \c maxnum objects each of size \c size from the data
-     *  stream to the area pointed at by \c ptr.
-     *
-     *  \return the number of objects read, or 0 at error or end of file.
-     */
-    size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr,
-                             size_t size, size_t maxnum);
-
-    /**
-     *  Write exactly \c num objects each of size \c size from the area
-     *  pointed at by \c ptr to data stream.
-     *
-     *  \return the number of objects written, or 0 at error or end of file.
-     */
-    size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
-                              size_t size, size_t num);
-
-    /**
-     *  Close and free an allocated SDL_RWops structure.
-     *
-     *  \return 0 if successful or -1 on write error when flushing data.
-     */
-    int (SDLCALL * close) (struct SDL_RWops * context);
-
-    Uint32 type;
-    union
-    {
-#if defined(ANDROID)
-        struct
-        {
-            void *fileNameRef;
-            void *inputStreamRef;
-            void *readableByteChannelRef;
-            void *readMethod;
-            void *assetFileDescriptorRef;
-            long position;
-            long size;
-            long offset;
-            int fd;
-        } androidio;
-#elif defined(__WIN32__)
-        struct
-        {
-            SDL_bool append;
-            void *h;
-            struct
-            {
-                void *data;
-                size_t size;
-                size_t left;
-            } buffer;
-        } windowsio;
-#endif
-
-#ifdef HAVE_STDIO_H
-        struct
-        {
-            SDL_bool autoclose;
-            FILE *fp;
-        } stdio;
-#endif
-        struct
-        {
-            Uint8 *base;
-            Uint8 *here;
-            Uint8 *stop;
-        } mem;
-        struct
-        {
-            void *data1;
-            void *data2;
-        } unknown;
-    } hidden;
-
-} SDL_RWops;
-
-
-/**
- *  \name RWFrom functions
- *
- *  Functions to create SDL_RWops structures from various data streams.
- */
-/* @{ */
-
-extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
-                                                  const char *mode);
-
-#ifdef HAVE_STDIO_H
-extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
-                                                SDL_bool autoclose);
-#else
-extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
-                                                SDL_bool autoclose);
-#endif
-
-extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
-extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
-                                                      int size);
-
-/* @} *//* RWFrom functions */
-
-
-extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
-extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
-
-#define RW_SEEK_SET 0       /**< Seek from the beginning of data */
-#define RW_SEEK_CUR 1       /**< Seek relative to current read point */
-#define RW_SEEK_END 2       /**< Seek relative to the end of data */
-
-/**
- *  \name Read/write macros
- *
- *  Macros to easily read and write from an SDL_RWops structure.
- */
-/* @{ */
-#define SDL_RWsize(ctx)         (ctx)->size(ctx)
-#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
-#define SDL_RWtell(ctx)         (ctx)->seek(ctx, 0, RW_SEEK_CUR)
-#define SDL_RWread(ctx, ptr, size, n)   (ctx)->read(ctx, ptr, size, n)
-#define SDL_RWwrite(ctx, ptr, size, n)  (ctx)->write(ctx, ptr, size, n)
-#define SDL_RWclose(ctx)        (ctx)->close(ctx)
-/* @} *//* Read/write macros */
-
-
-/**
- *  \name Read endian functions
- *
- *  Read an item of the specified endianness and return in native format.
- */
-/* @{ */
-extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
-extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
-extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
-extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
-extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
-extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
-extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
-/* @} *//* Read endian functions */
-
-/**
- *  \name Write endian functions
- *
- *  Write an item of native format to the specified endianness.
- */
-/* @{ */
-extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
-extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
-extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
-extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
-extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
-extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
-extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
-/* @} *//* Write endian functions */
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_rwops_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_scancode.h b/deps/SDL2/include/SDL_scancode.h
deleted file mode 100644
index 00b47a3..0000000
--- a/deps/SDL2/include/SDL_scancode.h
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_scancode.h
- *
- *  Defines keyboard scancodes.
- */
-
-#ifndef _SDL_scancode_h
-#define _SDL_scancode_h
-
-#include "SDL_stdinc.h"
-
-/**
- *  \brief The SDL keyboard scancode representation.
- *
- *  Values of this type are used to represent keyboard keys, among other places
- *  in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
- *  SDL_Event structure.
- *
- *  The values in this enumeration are based on the USB usage page standard:
- *  http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf
- */
-typedef enum
-{
-    SDL_SCANCODE_UNKNOWN = 0,
-
-    /**
-     *  \name Usage page 0x07
-     *
-     *  These values are from usage page 0x07 (USB keyboard page).
-     */
-    /* @{ */
-
-    SDL_SCANCODE_A = 4,
-    SDL_SCANCODE_B = 5,
-    SDL_SCANCODE_C = 6,
-    SDL_SCANCODE_D = 7,
-    SDL_SCANCODE_E = 8,
-    SDL_SCANCODE_F = 9,
-    SDL_SCANCODE_G = 10,
-    SDL_SCANCODE_H = 11,
-    SDL_SCANCODE_I = 12,
-    SDL_SCANCODE_J = 13,
-    SDL_SCANCODE_K = 14,
-    SDL_SCANCODE_L = 15,
-    SDL_SCANCODE_M = 16,
-    SDL_SCANCODE_N = 17,
-    SDL_SCANCODE_O = 18,
-    SDL_SCANCODE_P = 19,
-    SDL_SCANCODE_Q = 20,
-    SDL_SCANCODE_R = 21,
-    SDL_SCANCODE_S = 22,
-    SDL_SCANCODE_T = 23,
-    SDL_SCANCODE_U = 24,
-    SDL_SCANCODE_V = 25,
-    SDL_SCANCODE_W = 26,
-    SDL_SCANCODE_X = 27,
-    SDL_SCANCODE_Y = 28,
-    SDL_SCANCODE_Z = 29,
-
-    SDL_SCANCODE_1 = 30,
-    SDL_SCANCODE_2 = 31,
-    SDL_SCANCODE_3 = 32,
-    SDL_SCANCODE_4 = 33,
-    SDL_SCANCODE_5 = 34,
-    SDL_SCANCODE_6 = 35,
-    SDL_SCANCODE_7 = 36,
-    SDL_SCANCODE_8 = 37,
-    SDL_SCANCODE_9 = 38,
-    SDL_SCANCODE_0 = 39,
-
-    SDL_SCANCODE_RETURN = 40,
-    SDL_SCANCODE_ESCAPE = 41,
-    SDL_SCANCODE_BACKSPACE = 42,
-    SDL_SCANCODE_TAB = 43,
-    SDL_SCANCODE_SPACE = 44,
-
-    SDL_SCANCODE_MINUS = 45,
-    SDL_SCANCODE_EQUALS = 46,
-    SDL_SCANCODE_LEFTBRACKET = 47,
-    SDL_SCANCODE_RIGHTBRACKET = 48,
-    SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return
-                                  *   key on ISO keyboards and at the right end
-                                  *   of the QWERTY row on ANSI keyboards.
-                                  *   Produces REVERSE SOLIDUS (backslash) and
-                                  *   VERTICAL LINE in a US layout, REVERSE
-                                  *   SOLIDUS and VERTICAL LINE in a UK Mac
-                                  *   layout, NUMBER SIGN and TILDE in a UK
-                                  *   Windows layout, DOLLAR SIGN and POUND SIGN
-                                  *   in a Swiss German layout, NUMBER SIGN and
-                                  *   APOSTROPHE in a German layout, GRAVE
-                                  *   ACCENT and POUND SIGN in a French Mac
-                                  *   layout, and ASTERISK and MICRO SIGN in a
-                                  *   French Windows layout.
-                                  */
-    SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code
-                                  *   instead of 49 for the same key, but all
-                                  *   OSes I've seen treat the two codes
-                                  *   identically. So, as an implementor, unless
-                                  *   your keyboard generates both of those
-                                  *   codes and your OS treats them differently,
-                                  *   you should generate SDL_SCANCODE_BACKSLASH
-                                  *   instead of this code. As a user, you
-                                  *   should not rely on this code because SDL
-                                  *   will never generate it with most (all?)
-                                  *   keyboards.
-                                  */
-    SDL_SCANCODE_SEMICOLON = 51,
-    SDL_SCANCODE_APOSTROPHE = 52,
-    SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI
-                              *   and ISO keyboards). Produces GRAVE ACCENT and
-                              *   TILDE in a US Windows layout and in US and UK
-                              *   Mac layouts on ANSI keyboards, GRAVE ACCENT
-                              *   and NOT SIGN in a UK Windows layout, SECTION
-                              *   SIGN and PLUS-MINUS SIGN in US and UK Mac
-                              *   layouts on ISO keyboards, SECTION SIGN and
-                              *   DEGREE SIGN in a Swiss German layout (Mac:
-                              *   only on ISO keyboards), CIRCUMFLEX ACCENT and
-                              *   DEGREE SIGN in a German layout (Mac: only on
-                              *   ISO keyboards), SUPERSCRIPT TWO and TILDE in a
-                              *   French Windows layout, COMMERCIAL AT and
-                              *   NUMBER SIGN in a French Mac layout on ISO
-                              *   keyboards, and LESS-THAN SIGN and GREATER-THAN
-                              *   SIGN in a Swiss German, German, or French Mac
-                              *   layout on ANSI keyboards.
-                              */
-    SDL_SCANCODE_COMMA = 54,
-    SDL_SCANCODE_PERIOD = 55,
-    SDL_SCANCODE_SLASH = 56,
-
-    SDL_SCANCODE_CAPSLOCK = 57,
-
-    SDL_SCANCODE_F1 = 58,
-    SDL_SCANCODE_F2 = 59,
-    SDL_SCANCODE_F3 = 60,
-    SDL_SCANCODE_F4 = 61,
-    SDL_SCANCODE_F5 = 62,
-    SDL_SCANCODE_F6 = 63,
-    SDL_SCANCODE_F7 = 64,
-    SDL_SCANCODE_F8 = 65,
-    SDL_SCANCODE_F9 = 66,
-    SDL_SCANCODE_F10 = 67,
-    SDL_SCANCODE_F11 = 68,
-    SDL_SCANCODE_F12 = 69,
-
-    SDL_SCANCODE_PRINTSCREEN = 70,
-    SDL_SCANCODE_SCROLLLOCK = 71,
-    SDL_SCANCODE_PAUSE = 72,
-    SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
-                                   does send code 73, not 117) */
-    SDL_SCANCODE_HOME = 74,
-    SDL_SCANCODE_PAGEUP = 75,
-    SDL_SCANCODE_DELETE = 76,
-    SDL_SCANCODE_END = 77,
-    SDL_SCANCODE_PAGEDOWN = 78,
-    SDL_SCANCODE_RIGHT = 79,
-    SDL_SCANCODE_LEFT = 80,
-    SDL_SCANCODE_DOWN = 81,
-    SDL_SCANCODE_UP = 82,
-
-    SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards
-                                     */
-    SDL_SCANCODE_KP_DIVIDE = 84,
-    SDL_SCANCODE_KP_MULTIPLY = 85,
-    SDL_SCANCODE_KP_MINUS = 86,
-    SDL_SCANCODE_KP_PLUS = 87,
-    SDL_SCANCODE_KP_ENTER = 88,
-    SDL_SCANCODE_KP_1 = 89,
-    SDL_SCANCODE_KP_2 = 90,
-    SDL_SCANCODE_KP_3 = 91,
-    SDL_SCANCODE_KP_4 = 92,
-    SDL_SCANCODE_KP_5 = 93,
-    SDL_SCANCODE_KP_6 = 94,
-    SDL_SCANCODE_KP_7 = 95,
-    SDL_SCANCODE_KP_8 = 96,
-    SDL_SCANCODE_KP_9 = 97,
-    SDL_SCANCODE_KP_0 = 98,
-    SDL_SCANCODE_KP_PERIOD = 99,
-
-    SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
-                                        *   keyboards have over ANSI ones,
-                                        *   located between left shift and Y.
-                                        *   Produces GRAVE ACCENT and TILDE in a
-                                        *   US or UK Mac layout, REVERSE SOLIDUS
-                                        *   (backslash) and VERTICAL LINE in a
-                                        *   US or UK Windows layout, and
-                                        *   LESS-THAN SIGN and GREATER-THAN SIGN
-                                        *   in a Swiss German, German, or French
-                                        *   layout. */
-    SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */
-    SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag,
-                               *   not a physical key - but some Mac keyboards
-                               *   do have a power key. */
-    SDL_SCANCODE_KP_EQUALS = 103,
-    SDL_SCANCODE_F13 = 104,
-    SDL_SCANCODE_F14 = 105,
-    SDL_SCANCODE_F15 = 106,
-    SDL_SCANCODE_F16 = 107,
-    SDL_SCANCODE_F17 = 108,
-    SDL_SCANCODE_F18 = 109,
-    SDL_SCANCODE_F19 = 110,
-    SDL_SCANCODE_F20 = 111,
-    SDL_SCANCODE_F21 = 112,
-    SDL_SCANCODE_F22 = 113,
-    SDL_SCANCODE_F23 = 114,
-    SDL_SCANCODE_F24 = 115,
-    SDL_SCANCODE_EXECUTE = 116,
-    SDL_SCANCODE_HELP = 117,
-    SDL_SCANCODE_MENU = 118,
-    SDL_SCANCODE_SELECT = 119,
-    SDL_SCANCODE_STOP = 120,
-    SDL_SCANCODE_AGAIN = 121,   /**< redo */
-    SDL_SCANCODE_UNDO = 122,
-    SDL_SCANCODE_CUT = 123,
-    SDL_SCANCODE_COPY = 124,
-    SDL_SCANCODE_PASTE = 125,
-    SDL_SCANCODE_FIND = 126,
-    SDL_SCANCODE_MUTE = 127,
-    SDL_SCANCODE_VOLUMEUP = 128,
-    SDL_SCANCODE_VOLUMEDOWN = 129,
-/* not sure whether there's a reason to enable these */
-/*     SDL_SCANCODE_LOCKINGCAPSLOCK = 130,  */
-/*     SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
-/*     SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
-    SDL_SCANCODE_KP_COMMA = 133,
-    SDL_SCANCODE_KP_EQUALSAS400 = 134,
-
-    SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see
-                                            footnotes in USB doc */
-    SDL_SCANCODE_INTERNATIONAL2 = 136,
-    SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */
-    SDL_SCANCODE_INTERNATIONAL4 = 138,
-    SDL_SCANCODE_INTERNATIONAL5 = 139,
-    SDL_SCANCODE_INTERNATIONAL6 = 140,
-    SDL_SCANCODE_INTERNATIONAL7 = 141,
-    SDL_SCANCODE_INTERNATIONAL8 = 142,
-    SDL_SCANCODE_INTERNATIONAL9 = 143,
-    SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */
-    SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */
-    SDL_SCANCODE_LANG3 = 146, /**< Katakana */
-    SDL_SCANCODE_LANG4 = 147, /**< Hiragana */
-    SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */
-    SDL_SCANCODE_LANG6 = 149, /**< reserved */
-    SDL_SCANCODE_LANG7 = 150, /**< reserved */
-    SDL_SCANCODE_LANG8 = 151, /**< reserved */
-    SDL_SCANCODE_LANG9 = 152, /**< reserved */
-
-    SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
-    SDL_SCANCODE_SYSREQ = 154,
-    SDL_SCANCODE_CANCEL = 155,
-    SDL_SCANCODE_CLEAR = 156,
-    SDL_SCANCODE_PRIOR = 157,
-    SDL_SCANCODE_RETURN2 = 158,
-    SDL_SCANCODE_SEPARATOR = 159,
-    SDL_SCANCODE_OUT = 160,
-    SDL_SCANCODE_OPER = 161,
-    SDL_SCANCODE_CLEARAGAIN = 162,
-    SDL_SCANCODE_CRSEL = 163,
-    SDL_SCANCODE_EXSEL = 164,
-
-    SDL_SCANCODE_KP_00 = 176,
-    SDL_SCANCODE_KP_000 = 177,
-    SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
-    SDL_SCANCODE_DECIMALSEPARATOR = 179,
-    SDL_SCANCODE_CURRENCYUNIT = 180,
-    SDL_SCANCODE_CURRENCYSUBUNIT = 181,
-    SDL_SCANCODE_KP_LEFTPAREN = 182,
-    SDL_SCANCODE_KP_RIGHTPAREN = 183,
-    SDL_SCANCODE_KP_LEFTBRACE = 184,
-    SDL_SCANCODE_KP_RIGHTBRACE = 185,
-    SDL_SCANCODE_KP_TAB = 186,
-    SDL_SCANCODE_KP_BACKSPACE = 187,
-    SDL_SCANCODE_KP_A = 188,
-    SDL_SCANCODE_KP_B = 189,
-    SDL_SCANCODE_KP_C = 190,
-    SDL_SCANCODE_KP_D = 191,
-    SDL_SCANCODE_KP_E = 192,
-    SDL_SCANCODE_KP_F = 193,
-    SDL_SCANCODE_KP_XOR = 194,
-    SDL_SCANCODE_KP_POWER = 195,
-    SDL_SCANCODE_KP_PERCENT = 196,
-    SDL_SCANCODE_KP_LESS = 197,
-    SDL_SCANCODE_KP_GREATER = 198,
-    SDL_SCANCODE_KP_AMPERSAND = 199,
-    SDL_SCANCODE_KP_DBLAMPERSAND = 200,
-    SDL_SCANCODE_KP_VERTICALBAR = 201,
-    SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
-    SDL_SCANCODE_KP_COLON = 203,
-    SDL_SCANCODE_KP_HASH = 204,
-    SDL_SCANCODE_KP_SPACE = 205,
-    SDL_SCANCODE_KP_AT = 206,
-    SDL_SCANCODE_KP_EXCLAM = 207,
-    SDL_SCANCODE_KP_MEMSTORE = 208,
-    SDL_SCANCODE_KP_MEMRECALL = 209,
-    SDL_SCANCODE_KP_MEMCLEAR = 210,
-    SDL_SCANCODE_KP_MEMADD = 211,
-    SDL_SCANCODE_KP_MEMSUBTRACT = 212,
-    SDL_SCANCODE_KP_MEMMULTIPLY = 213,
-    SDL_SCANCODE_KP_MEMDIVIDE = 214,
-    SDL_SCANCODE_KP_PLUSMINUS = 215,
-    SDL_SCANCODE_KP_CLEAR = 216,
-    SDL_SCANCODE_KP_CLEARENTRY = 217,
-    SDL_SCANCODE_KP_BINARY = 218,
-    SDL_SCANCODE_KP_OCTAL = 219,
-    SDL_SCANCODE_KP_DECIMAL = 220,
-    SDL_SCANCODE_KP_HEXADECIMAL = 221,
-
-    SDL_SCANCODE_LCTRL = 224,
-    SDL_SCANCODE_LSHIFT = 225,
-    SDL_SCANCODE_LALT = 226, /**< alt, option */
-    SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */
-    SDL_SCANCODE_RCTRL = 228,
-    SDL_SCANCODE_RSHIFT = 229,
-    SDL_SCANCODE_RALT = 230, /**< alt gr, option */
-    SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */
-
-    SDL_SCANCODE_MODE = 257,    /**< I'm not sure if this is really not covered
-                                 *   by any of the above, but since there's a
-                                 *   special KMOD_MODE for it I'm adding it here
-                                 */
-
-    /* @} *//* Usage page 0x07 */
-
-    /**
-     *  \name Usage page 0x0C
-     *
-     *  These values are mapped from usage page 0x0C (USB consumer page).
-     */
-    /* @{ */
-
-    SDL_SCANCODE_AUDIONEXT = 258,
-    SDL_SCANCODE_AUDIOPREV = 259,
-    SDL_SCANCODE_AUDIOSTOP = 260,
-    SDL_SCANCODE_AUDIOPLAY = 261,
-    SDL_SCANCODE_AUDIOMUTE = 262,
-    SDL_SCANCODE_MEDIASELECT = 263,
-    SDL_SCANCODE_WWW = 264,
-    SDL_SCANCODE_MAIL = 265,
-    SDL_SCANCODE_CALCULATOR = 266,
-    SDL_SCANCODE_COMPUTER = 267,
-    SDL_SCANCODE_AC_SEARCH = 268,
-    SDL_SCANCODE_AC_HOME = 269,
-    SDL_SCANCODE_AC_BACK = 270,
-    SDL_SCANCODE_AC_FORWARD = 271,
-    SDL_SCANCODE_AC_STOP = 272,
-    SDL_SCANCODE_AC_REFRESH = 273,
-    SDL_SCANCODE_AC_BOOKMARKS = 274,
-
-    /* @} *//* Usage page 0x0C */
-
-    /**
-     *  \name Walther keys
-     *
-     *  These are values that Christian Walther added (for mac keyboard?).
-     */
-    /* @{ */
-
-    SDL_SCANCODE_BRIGHTNESSDOWN = 275,
-    SDL_SCANCODE_BRIGHTNESSUP = 276,
-    SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display
-                                           switch, video mode switch */
-    SDL_SCANCODE_KBDILLUMTOGGLE = 278,
-    SDL_SCANCODE_KBDILLUMDOWN = 279,
-    SDL_SCANCODE_KBDILLUMUP = 280,
-    SDL_SCANCODE_EJECT = 281,
-    SDL_SCANCODE_SLEEP = 282,
-
-    SDL_SCANCODE_APP1 = 283,
-    SDL_SCANCODE_APP2 = 284,
-
-    /* @} *//* Walther keys */
-
-    /* Add any other keys here. */
-
-    SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
-                                 for array bounds */
-} SDL_Scancode;
-
-#endif /* _SDL_scancode_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_shape.h b/deps/SDL2/include/SDL_shape.h
deleted file mode 100644
index 63f850c..0000000
--- a/deps/SDL2/include/SDL_shape.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_shape_h
-#define _SDL_shape_h
-
-#include "SDL_stdinc.h"
-#include "SDL_pixels.h"
-#include "SDL_rect.h"
-#include "SDL_surface.h"
-#include "SDL_video.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** \file SDL_shape.h
- *
- * Header file for the shaped window API.
- */
-
-#define SDL_NONSHAPEABLE_WINDOW -1
-#define SDL_INVALID_SHAPE_ARGUMENT -2
-#define SDL_WINDOW_LACKS_SHAPE -3
-
-/**
- *  \brief Create a window that can be shaped with the specified position, dimensions, and flags.
- *
- *  \param title The title of the window, in UTF-8 encoding.
- *  \param x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *               ::SDL_WINDOWPOS_UNDEFINED.
- *  \param y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *               ::SDL_WINDOWPOS_UNDEFINED.
- *  \param w     The width of the window.
- *  \param h     The height of the window.
- *  \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
- *               ::SDL_WINDOW_OPENGL,     ::SDL_WINDOW_INPUT_GRABBED,
- *               ::SDL_WINDOW_HIDDEN,     ::SDL_WINDOW_RESIZABLE,
- *               ::SDL_WINDOW_MAXIMIZED,  ::SDL_WINDOW_MINIMIZED,
- *       ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
- *
- *  \return The window created, or NULL if window creation failed.
- *
- *  \sa SDL_DestroyWindow()
- */
-extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
-
-/**
- * \brief Return whether the given window is a shaped window.
- *
- * \param window The window to query for being shaped.
- *
- * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
- * \sa SDL_CreateShapedWindow
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window);
-
-/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
-typedef enum {
-    /** \brief The default mode, a binarized alpha cutoff of 1. */
-    ShapeModeDefault,
-    /** \brief A binarized alpha cutoff with a given integer value. */
-    ShapeModeBinarizeAlpha,
-    /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */
-    ShapeModeReverseBinarizeAlpha,
-    /** \brief A color key is applied. */
-    ShapeModeColorKey
-} WindowShapeMode;
-
-#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha)
-
-/** \brief A union containing parameters for shaped windows. */
-typedef union {
-    /** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */
-    Uint8 binarizationCutoff;
-    SDL_Color colorKey;
-} SDL_WindowShapeParams;
-
-/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */
-typedef struct SDL_WindowShapeMode {
-    /** \brief The mode of these window-shape parameters. */
-    WindowShapeMode mode;
-    /** \brief Window-shape parameters. */
-    SDL_WindowShapeParams parameters;
-} SDL_WindowShapeMode;
-
-/**
- * \brief Set the shape and parameters of a shaped window.
- *
- * \param window The shaped window whose parameters should be set.
- * \param shape A surface encoding the desired shape for the window.
- * \param shape_mode The parameters to set for the shaped window.
- *
- * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
- *           if the SDL_Window* given does not reference a valid shaped window.
- *
- * \sa SDL_WindowShapeMode
- * \sa SDL_GetShapedWindowMode.
- */
-extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
-
-/**
- * \brief Get the shape parameters of a shaped window.
- *
- * \param window The shaped window whose parameters should be retrieved.
- * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
- *
- * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
- *           data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
- *           the SDL_Window* given is a shapeable window currently lacking a shape.
- *
- * \sa SDL_WindowShapeMode
- * \sa SDL_SetWindowShape
- */
-extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_shape_h */
diff --git a/deps/SDL2/include/SDL_stdinc.h b/deps/SDL2/include/SDL_stdinc.h
deleted file mode 100644
index 8f17d55..0000000
--- a/deps/SDL2/include/SDL_stdinc.h
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_stdinc.h
- *
- *  This is a general header that includes C language support.
- */
-
-#ifndef _SDL_stdinc_h
-#define _SDL_stdinc_h
-
-#include "SDL_config.h"
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if defined(STDC_HEADERS)
-# include <stdlib.h>
-# include <stddef.h>
-# include <stdarg.h>
-#else
-# if defined(HAVE_STDLIB_H)
-#  include <stdlib.h>
-# elif defined(HAVE_MALLOC_H)
-#  include <malloc.h>
-# endif
-# if defined(HAVE_STDDEF_H)
-#  include <stddef.h>
-# endif
-# if defined(HAVE_STDARG_H)
-#  include <stdarg.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
-#  include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if defined(HAVE_INTTYPES_H)
-# include <inttypes.h>
-#elif defined(HAVE_STDINT_H)
-# include <stdint.h>
-#endif
-#ifdef HAVE_CTYPE_H
-# include <ctype.h>
-#endif
-#ifdef HAVE_MATH_H
-# include <math.h>
-#endif
-#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
-# include <iconv.h>
-#endif
-
-/**
- *  The number of elements in an array.
- */
-#define SDL_arraysize(array)    (sizeof(array)/sizeof(array[0]))
-#define SDL_TABLESIZE(table)    SDL_arraysize(table)
-
-/**
- *  \name Cast operators
- *
- *  Use proper C++ casts when compiled as C++ to be compatible with the option
- *  -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
- */
-/* @{ */
-#ifdef __cplusplus
-#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
-#define SDL_static_cast(type, expression) static_cast<type>(expression)
-#define SDL_const_cast(type, expression) const_cast<type>(expression)
-#else
-#define SDL_reinterpret_cast(type, expression) ((type)(expression))
-#define SDL_static_cast(type, expression) ((type)(expression))
-#define SDL_const_cast(type, expression) ((type)(expression))
-#endif
-/* @} *//* Cast operators */
-
-/* Define a four character code as a Uint32 */
-#define SDL_FOURCC(A, B, C, D) \
-    ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
-     (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
-     (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
-     (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
-
-/**
- *  \name Basic data types
- */
-/* @{ */
-
-typedef enum
-{
-    SDL_FALSE = 0,
-    SDL_TRUE = 1
-} SDL_bool;
-
-/**
- * \brief A signed 8-bit integer type.
- */
-typedef int8_t Sint8;
-/**
- * \brief An unsigned 8-bit integer type.
- */
-typedef uint8_t Uint8;
-/**
- * \brief A signed 16-bit integer type.
- */
-typedef int16_t Sint16;
-/**
- * \brief An unsigned 16-bit integer type.
- */
-typedef uint16_t Uint16;
-/**
- * \brief A signed 32-bit integer type.
- */
-typedef int32_t Sint32;
-/**
- * \brief An unsigned 32-bit integer type.
- */
-typedef uint32_t Uint32;
-
-/**
- * \brief A signed 64-bit integer type.
- */
-typedef int64_t Sint64;
-/**
- * \brief An unsigned 64-bit integer type.
- */
-typedef uint64_t Uint64;
-
-/* @} *//* Basic data types */
-
-
-#define SDL_COMPILE_TIME_ASSERT(name, x)               \
-       typedef int SDL_dummy_ ## name[(x) * 2 - 1]
-/** \cond */
-#ifndef DOXYGEN_SHOULD_IGNORE_THIS
-SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
-SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
-SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
-SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
-SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
-SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
-SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
-SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
-#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
-/** \endcond */
-
-/* Check to make sure enums are the size of ints, for structure packing.
-   For both Watcom C/C++ and Borland C/C++ the compiler option that makes
-   enums having the size of an int must be enabled.
-   This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
-*/
-
-/** \cond */
-#ifndef DOXYGEN_SHOULD_IGNORE_THIS
-#if !defined(__ANDROID__)
-   /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
-typedef enum
-{
-    DUMMY_ENUM_VALUE
-} SDL_DUMMY_ENUM;
-
-SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
-#endif
-#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
-/** \endcond */
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(HAVE_ALLOCA) && !defined(alloca)
-# if defined(HAVE_ALLOCA_H)
-#  include <alloca.h>
-# elif defined(__GNUC__)
-#  define alloca __builtin_alloca
-# elif defined(_MSC_VER)
-#  include <malloc.h>
-#  define alloca _alloca
-# elif defined(__WATCOMC__)
-#  include <malloc.h>
-# elif defined(__BORLANDC__)
-#  include <malloc.h>
-# elif defined(__DMC__)
-#  include <stdlib.h>
-# elif defined(__AIX__)
-#pragma alloca
-# elif defined(__MRC__)
-void *alloca(unsigned);
-# else
-char *alloca();
-# endif
-#endif
-#ifdef HAVE_ALLOCA
-#define SDL_stack_alloc(type, count)    (type*)alloca(sizeof(type)*(count))
-#define SDL_stack_free(data)
-#else
-#define SDL_stack_alloc(type, count)    (type*)SDL_malloc(sizeof(type)*(count))
-#define SDL_stack_free(data)            SDL_free(data)
-#endif
-
-extern DECLSPEC void *SDLCALL SDL_malloc(size_t size);
-extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size);
-extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size);
-extern DECLSPEC void SDLCALL SDL_free(void *mem);
-
-extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
-extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
-
-extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
-
-extern DECLSPEC int SDLCALL SDL_abs(int x);
-
-/* !!! FIXME: these have side effects. You probably shouldn't use them. */
-/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */
-#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
-#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
-
-extern DECLSPEC int SDLCALL SDL_isdigit(int x);
-extern DECLSPEC int SDLCALL SDL_isspace(int x);
-extern DECLSPEC int SDLCALL SDL_toupper(int x);
-extern DECLSPEC int SDLCALL SDL_tolower(int x);
-
-extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len);
-
-#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
-#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
-
-/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
-SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t dwords)
-{
-#if defined(__GNUC__) && defined(i386)
-    int u0, u1, u2;
-    __asm__ __volatile__ (
-        "cld \n\t"
-        "rep ; stosl \n\t"
-        : "=&D" (u0), "=&a" (u1), "=&c" (u2)
-        : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords))
-        : "memory"
-    );
-#else
-    size_t _n = (dwords + 3) / 4;
-    Uint32 *_p = SDL_static_cast(Uint32 *, dst);
-    Uint32 _val = (val);
-    if (dwords == 0)
-        return;
-    switch (dwords % 4)
-    {
-        case 0: do {    *_p++ = _val;
-        case 3:         *_p++ = _val;
-        case 2:         *_p++ = _val;
-        case 1:         *_p++ = _val;
-        } while ( --_n );
-    }
-#endif
-}
-
-
-extern DECLSPEC void *SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
-
-SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t dwords)
-{
-    return SDL_memcpy(dst, src, dwords * 4);
-}
-
-extern DECLSPEC void *SDLCALL SDL_memmove(void *dst, const void *src, size_t len);
-extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
-
-extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
-extern DECLSPEC size_t SDLCALL SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen);
-extern DECLSPEC size_t SDLCALL SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen);
-
-extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str);
-extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
-extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes);
-extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
-extern DECLSPEC char *SDLCALL SDL_strdup(const char *str);
-extern DECLSPEC char *SDLCALL SDL_strrev(char *str);
-extern DECLSPEC char *SDLCALL SDL_strupr(char *str);
-extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
-extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
-extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
-extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
-
-extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
-extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
-extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
-extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix);
-extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix);
-extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix);
-
-extern DECLSPEC int SDLCALL SDL_atoi(const char *str);
-extern DECLSPEC double SDLCALL SDL_atof(const char *str);
-extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base);
-extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
-extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base);
-extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base);
-extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp);
-
-extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
-extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
-extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
-extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len);
-
-extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
-extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
-extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
-
-#ifndef HAVE_M_PI
-#ifndef M_PI
-#define M_PI    3.14159265358979323846264338327950288   /* pi */
-#endif
-#endif
-
-extern DECLSPEC double SDLCALL SDL_atan(double x);
-extern DECLSPEC double SDLCALL SDL_atan2(double x, double y);
-extern DECLSPEC double SDLCALL SDL_ceil(double x);
-extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
-extern DECLSPEC double SDLCALL SDL_cos(double x);
-extern DECLSPEC float SDLCALL SDL_cosf(float x);
-extern DECLSPEC double SDLCALL SDL_fabs(double x);
-extern DECLSPEC double SDLCALL SDL_floor(double x);
-extern DECLSPEC double SDLCALL SDL_log(double x);
-extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
-extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
-extern DECLSPEC double SDLCALL SDL_sin(double x);
-extern DECLSPEC float SDLCALL SDL_sinf(float x);
-extern DECLSPEC double SDLCALL SDL_sqrt(double x);
-
-/* The SDL implementation of iconv() returns these error codes */
-#define SDL_ICONV_ERROR     (size_t)-1
-#define SDL_ICONV_E2BIG     (size_t)-2
-#define SDL_ICONV_EILSEQ    (size_t)-3
-#define SDL_ICONV_EINVAL    (size_t)-4
-
-/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */
-typedef struct _SDL_iconv_t *SDL_iconv_t;
-extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode,
-                                                   const char *fromcode);
-extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
-extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
-                                         size_t * inbytesleft, char **outbuf,
-                                         size_t * outbytesleft);
-/**
- *  This function converts a string between encodings in one pass, returning a
- *  string that must be freed with SDL_free() or NULL on error.
- */
-extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
-                                               const char *fromcode,
-                                               const char *inbuf,
-                                               size_t inbytesleft);
-#define SDL_iconv_utf8_locale(S)    SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
-#define SDL_iconv_utf8_ucs2(S)      (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
-#define SDL_iconv_utf8_ucs4(S)      (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_stdinc_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_surface.h b/deps/SDL2/include/SDL_surface.h
deleted file mode 100644
index e18153a..0000000
--- a/deps/SDL2/include/SDL_surface.h
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_surface.h
- *
- *  Header file for ::SDL_Surface definition and management functions.
- */
-
-#ifndef _SDL_surface_h
-#define _SDL_surface_h
-
-#include "SDL_stdinc.h"
-#include "SDL_pixels.h"
-#include "SDL_rect.h"
-#include "SDL_blendmode.h"
-#include "SDL_rwops.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \name Surface flags
- *
- *  These are the currently supported flags for the ::SDL_Surface.
- *
- *  \internal
- *  Used internally (read-only).
- */
-/* @{ */
-#define SDL_SWSURFACE       0           /**< Just here for compatibility */
-#define SDL_PREALLOC        0x00000001  /**< Surface uses preallocated memory */
-#define SDL_RLEACCEL        0x00000002  /**< Surface is RLE encoded */
-#define SDL_DONTFREE        0x00000004  /**< Surface is referenced internally */
-/* @} *//* Surface flags */
-
-/**
- *  Evaluates to true if the surface needs to be locked before access.
- */
-#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
-
-/**
- * \brief A collection of pixels used in software blitting.
- *
- * \note  This structure should be treated as read-only, except for \c pixels,
- *        which, if not NULL, contains the raw pixel data for the surface.
- */
-typedef struct SDL_Surface
-{
-    Uint32 flags;               /**< Read-only */
-    SDL_PixelFormat *format;    /**< Read-only */
-    int w, h;                   /**< Read-only */
-    int pitch;                  /**< Read-only */
-    void *pixels;               /**< Read-write */
-
-    /** Application data associated with the surface */
-    void *userdata;             /**< Read-write */
-
-    /** information needed for surfaces requiring locks */
-    int locked;                 /**< Read-only */
-    void *lock_data;            /**< Read-only */
-
-    /** clipping information */
-    SDL_Rect clip_rect;         /**< Read-only */
-
-    /** info for fast blit mapping to other surfaces */
-    struct SDL_BlitMap *map;    /**< Private */
-
-    /** Reference count -- used when freeing surface */
-    int refcount;               /**< Read-mostly */
-} SDL_Surface;
-
-/**
- * \brief The type of function used for surface blitting functions.
- */
-typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
-                         struct SDL_Surface * dst, SDL_Rect * dstrect);
-
-/**
- *  Allocate and free an RGB surface.
- *
- *  If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
- *  If the depth is greater than 8 bits, the pixel format is set using the
- *  flags '[RGB]mask'.
- *
- *  If the function runs out of memory, it will return NULL.
- *
- *  \param flags The \c flags are obsolete and should be set to 0.
- *  \param width The width in pixels of the surface to create.
- *  \param height The height in pixels of the surface to create.
- *  \param depth The depth in bits of the surface to create.
- *  \param Rmask The red mask of the surface to create.
- *  \param Gmask The green mask of the surface to create.
- *  \param Bmask The blue mask of the surface to create.
- *  \param Amask The alpha mask of the surface to create.
- */
-extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
-    (Uint32 flags, int width, int height, int depth,
-     Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
-extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
-                                                              int width,
-                                                              int height,
-                                                              int depth,
-                                                              int pitch,
-                                                              Uint32 Rmask,
-                                                              Uint32 Gmask,
-                                                              Uint32 Bmask,
-                                                              Uint32 Amask);
-extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
-
-/**
- *  \brief Set the palette used by a surface.
- *
- *  \return 0, or -1 if the surface format doesn't use a palette.
- *
- *  \note A single palette can be shared with many surfaces.
- */
-extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
-                                                  SDL_Palette * palette);
-
-/**
- *  \brief Sets up a surface for directly accessing the pixels.
- *
- *  Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
- *  to and read from \c surface->pixels, using the pixel format stored in
- *  \c surface->format.  Once you are done accessing the surface, you should
- *  use SDL_UnlockSurface() to release it.
- *
- *  Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
- *  to 0, then you can read and write to the surface at any time, and the
- *  pixel format of the surface will not change.
- *
- *  No operating system or library calls should be made between lock/unlock
- *  pairs, as critical system locks may be held during this time.
- *
- *  SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
- *
- *  \sa SDL_UnlockSurface()
- */
-extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
-/** \sa SDL_LockSurface() */
-extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
-
-/**
- *  Load a surface from a seekable SDL data stream (memory or file).
- *
- *  If \c freesrc is non-zero, the stream will be closed after being read.
- *
- *  The new surface should be freed with SDL_FreeSurface().
- *
- *  \return the new surface, or NULL if there was an error.
- */
-extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
-                                                    int freesrc);
-
-/**
- *  Load a surface from a file.
- *
- *  Convenience macro.
- */
-#define SDL_LoadBMP(file)   SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
-
-/**
- *  Save a surface to a seekable SDL data stream (memory or file).
- *
- *  If \c freedst is non-zero, the stream will be closed after being written.
- *
- *  \return 0 if successful or -1 if there was an error.
- */
-extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
-    (SDL_Surface * surface, SDL_RWops * dst, int freedst);
-
-/**
- *  Save a surface to a file.
- *
- *  Convenience macro.
- */
-#define SDL_SaveBMP(surface, file) \
-        SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
-
-/**
- *  \brief Sets the RLE acceleration hint for a surface.
- *
- *  \return 0 on success, or -1 if the surface is not valid
- *
- *  \note If RLE is enabled, colorkey and alpha blending blits are much faster,
- *        but the surface must be locked before directly accessing the pixels.
- */
-extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
-                                              int flag);
-
-/**
- *  \brief Sets the color key (transparent pixel) in a blittable surface.
- *
- *  \param surface The surface to update
- *  \param flag Non-zero to enable colorkey and 0 to disable colorkey
- *  \param key The transparent pixel in the native surface format
- *
- *  \return 0 on success, or -1 if the surface is not valid
- *
- *  You can pass SDL_RLEACCEL to enable RLE accelerated blits.
- */
-extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
-                                            int flag, Uint32 key);
-
-/**
- *  \brief Gets the color key (transparent pixel) in a blittable surface.
- *
- *  \param surface The surface to update
- *  \param key A pointer filled in with the transparent pixel in the native
- *             surface format
- *
- *  \return 0 on success, or -1 if the surface is not valid or colorkey is not
- *          enabled.
- */
-extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
-                                            Uint32 * key);
-
-/**
- *  \brief Set an additional color value used in blit operations.
- *
- *  \param surface The surface to update.
- *  \param r The red color value multiplied into blit operations.
- *  \param g The green color value multiplied into blit operations.
- *  \param b The blue color value multiplied into blit operations.
- *
- *  \return 0 on success, or -1 if the surface is not valid.
- *
- *  \sa SDL_GetSurfaceColorMod()
- */
-extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
-                                                   Uint8 r, Uint8 g, Uint8 b);
-
-
-/**
- *  \brief Get the additional color value used in blit operations.
- *
- *  \param surface The surface to query.
- *  \param r A pointer filled in with the current red color value.
- *  \param g A pointer filled in with the current green color value.
- *  \param b A pointer filled in with the current blue color value.
- *
- *  \return 0 on success, or -1 if the surface is not valid.
- *
- *  \sa SDL_SetSurfaceColorMod()
- */
-extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
-                                                   Uint8 * r, Uint8 * g,
-                                                   Uint8 * b);
-
-/**
- *  \brief Set an additional alpha value used in blit operations.
- *
- *  \param surface The surface to update.
- *  \param alpha The alpha value multiplied into blit operations.
- *
- *  \return 0 on success, or -1 if the surface is not valid.
- *
- *  \sa SDL_GetSurfaceAlphaMod()
- */
-extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
-                                                   Uint8 alpha);
-
-/**
- *  \brief Get the additional alpha value used in blit operations.
- *
- *  \param surface The surface to query.
- *  \param alpha A pointer filled in with the current alpha value.
- *
- *  \return 0 on success, or -1 if the surface is not valid.
- *
- *  \sa SDL_SetSurfaceAlphaMod()
- */
-extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
-                                                   Uint8 * alpha);
-
-/**
- *  \brief Set the blend mode used for blit operations.
- *
- *  \param surface The surface to update.
- *  \param blendMode ::SDL_BlendMode to use for blit blending.
- *
- *  \return 0 on success, or -1 if the parameters are not valid.
- *
- *  \sa SDL_GetSurfaceBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
-                                                    SDL_BlendMode blendMode);
-
-/**
- *  \brief Get the blend mode used for blit operations.
- *
- *  \param surface   The surface to query.
- *  \param blendMode A pointer filled in with the current blend mode.
- *
- *  \return 0 on success, or -1 if the surface is not valid.
- *
- *  \sa SDL_SetSurfaceBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
-                                                    SDL_BlendMode *blendMode);
-
-/**
- *  Sets the clipping rectangle for the destination surface in a blit.
- *
- *  If the clip rectangle is NULL, clipping will be disabled.
- *
- *  If the clip rectangle doesn't intersect the surface, the function will
- *  return SDL_FALSE and blits will be completely clipped.  Otherwise the
- *  function returns SDL_TRUE and blits to the surface will be clipped to
- *  the intersection of the surface area and the clipping rectangle.
- *
- *  Note that blits are automatically clipped to the edges of the source
- *  and destination surfaces.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
-                                                 const SDL_Rect * rect);
-
-/**
- *  Gets the clipping rectangle for the destination surface in a blit.
- *
- *  \c rect must be a pointer to a valid rectangle which will be filled
- *  with the correct values.
- */
-extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
-                                             SDL_Rect * rect);
-
-/**
- *  Creates a new surface of the specified format, and then copies and maps
- *  the given surface to it so the blit of the converted surface will be as
- *  fast as possible.  If this function fails, it returns NULL.
- *
- *  The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
- *  semantics.  You can also pass ::SDL_RLEACCEL in the flags parameter and
- *  SDL will try to RLE accelerate colorkey and alpha blits in the resulting
- *  surface.
- */
-extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
-    (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags);
-extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
-    (SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
-
-/**
- * \brief Copy a block of pixels of one format to another format
- *
- *  \return 0 on success, or -1 if there was an error
- */
-extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
-                                              Uint32 src_format,
-                                              const void * src, int src_pitch,
-                                              Uint32 dst_format,
-                                              void * dst, int dst_pitch);
-
-/**
- *  Performs a fast fill of the given rectangle with \c color.
- *
- *  If \c rect is NULL, the whole surface will be filled with \c color.
- *
- *  The color should be a pixel of the format used by the surface, and
- *  can be generated by the SDL_MapRGB() function.
- *
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_FillRect
-    (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
-extern DECLSPEC int SDLCALL SDL_FillRects
-    (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
-
-/**
- *  Performs a fast blit from the source surface to the destination surface.
- *
- *  This assumes that the source and destination rectangles are
- *  the same size.  If either \c srcrect or \c dstrect are NULL, the entire
- *  surface (\c src or \c dst) is copied.  The final blit rectangles are saved
- *  in \c srcrect and \c dstrect after all clipping is performed.
- *
- *  \return If the blit is successful, it returns 0, otherwise it returns -1.
- *
- *  The blit function should not be called on a locked surface.
- *
- *  The blit semantics for surfaces with and without blending and colorkey
- *  are defined as follows:
- *  \verbatim
-    RGBA->RGB:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source alpha-channel and per-surface alpha)
-        SDL_SRCCOLORKEY ignored.
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy RGB.
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        RGB values of the source color key, ignoring alpha in the
-        comparison.
-
-    RGB->RGBA:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source per-surface alpha)
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy RGB, set destination alpha to source per-surface alpha value.
-      both:
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        source color key.
-
-    RGBA->RGBA:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source alpha-channel and per-surface alpha)
-        SDL_SRCCOLORKEY ignored.
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy all of RGBA to the destination.
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        RGB values of the source color key, ignoring alpha in the
-        comparison.
-
-    RGB->RGB:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source per-surface alpha)
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy RGB.
-      both:
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        source color key.
-    \endverbatim
- *
- *  You should call SDL_BlitSurface() unless you know exactly how SDL
- *  blitting works internally and how to use the other blit functions.
- */
-#define SDL_BlitSurface SDL_UpperBlit
-
-/**
- *  This is the public blit function, SDL_BlitSurface(), and it performs
- *  rectangle validation and clipping before passing it to SDL_LowerBlit()
- */
-extern DECLSPEC int SDLCALL SDL_UpperBlit
-    (SDL_Surface * src, const SDL_Rect * srcrect,
-     SDL_Surface * dst, SDL_Rect * dstrect);
-
-/**
- *  This is a semi-private blit function and it performs low-level surface
- *  blitting only.
- */
-extern DECLSPEC int SDLCALL SDL_LowerBlit
-    (SDL_Surface * src, SDL_Rect * srcrect,
-     SDL_Surface * dst, SDL_Rect * dstrect);
-
-/**
- *  \brief Perform a fast, low quality, stretch blit between two surfaces of the
- *         same pixel format.
- *
- *  \note This function uses a static buffer, and is not thread-safe.
- */
-extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
-                                            const SDL_Rect * srcrect,
-                                            SDL_Surface * dst,
-                                            const SDL_Rect * dstrect);
-
-#define SDL_BlitScaled SDL_UpperBlitScaled
-
-/**
- *  This is the public scaled blit function, SDL_BlitScaled(), and it performs
- *  rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
- */
-extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
-    (SDL_Surface * src, const SDL_Rect * srcrect,
-    SDL_Surface * dst, SDL_Rect * dstrect);
-
-/**
- *  This is a semi-private blit function and it performs low-level surface
- *  scaled blitting only.
- */
-extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
-    (SDL_Surface * src, SDL_Rect * srcrect,
-    SDL_Surface * dst, SDL_Rect * dstrect);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_surface_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_system.h b/deps/SDL2/include/SDL_system.h
deleted file mode 100644
index 9af2a4c..0000000
--- a/deps/SDL2/include/SDL_system.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_system.h
- *
- *  Include file for platform specific SDL API functions
- */
-
-#ifndef _SDL_system_h
-#define _SDL_system_h
-
-#include "SDL_stdinc.h"
-#include "SDL_keyboard.h"
-#include "SDL_render.h"
-#include "SDL_video.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Platform specific functions for Windows */
-#ifdef __WIN32__
-
-/* Returns the D3D9 adapter index that matches the specified display index.
-   This adapter index can be passed to IDirect3D9::CreateDevice and controls
-   on which monitor a full screen application will appear.
-*/
-extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
-
-/* Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
-   Once you are done using the device, you should release it to avoid a resource leak.
- */
-typedef struct IDirect3DDevice9 IDirect3DDevice9;
-extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
-
-#endif /* __WIN32__ */
-
-
-/* Platform specific functions for iOS */
-#if defined(__IPHONEOS__) && __IPHONEOS__
-
-extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
-extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
-
-#endif /* __IPHONEOS__ */
-
-
-/* Platform specific functions for Android */
-#if defined(__ANDROID__) && __ANDROID__
-
-/* Get the JNI environment for the current thread
-   This returns JNIEnv*, but the prototype is void* so we don't need jni.h
- */
-extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
-
-/* Get the SDL Activity object for the application
-   This returns jobject, but the prototype is void* so we don't need jni.h
-   The jobject returned by SDL_AndroidGetActivity is a local reference.
-   It is the caller's responsibility to properly release it
-   (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
- */
-extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
-
-/* See the official Android developer guide for more information:
-   http://developer.android.com/guide/topics/data/data-storage.html
-*/
-#define SDL_ANDROID_EXTERNAL_STORAGE_READ   0x01
-#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
-
-/* Get the path used for internal storage for this application.
-   This path is unique to your application and cannot be written to
-   by other applications.
- */
-extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
-
-/* Get the current state of external storage, a bitmask of these values:
-    SDL_ANDROID_EXTERNAL_STORAGE_READ
-    SDL_ANDROID_EXTERNAL_STORAGE_WRITE
-   If external storage is currently unavailable, this will return 0.
-*/
-extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();
-
-/* Get the path used for external storage for this application.
-   This path is unique to your application, but is public and can be
-   written to by other applications.
- */
-extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();
-
-#endif /* __ANDROID__ */
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_system_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_syswm.h b/deps/SDL2/include/SDL_syswm.h
deleted file mode 100644
index 5e4454f..0000000
--- a/deps/SDL2/include/SDL_syswm.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_syswm.h
- *
- *  Include file for SDL custom system window manager hooks.
- */
-
-#ifndef _SDL_syswm_h
-#define _SDL_syswm_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_video.h"
-#include "SDL_version.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \file SDL_syswm.h
- *
- *  Your application has access to a special type of event ::SDL_SYSWMEVENT,
- *  which contains window-manager specific information and arrives whenever
- *  an unhandled window event occurs.  This event is ignored by default, but
- *  you can enable it with SDL_EventState().
- */
-#ifdef SDL_PROTOTYPES_ONLY
-struct SDL_SysWMinfo;
-#else
-
-#if defined(SDL_VIDEO_DRIVER_WINDOWS)
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
-/* This is the structure for custom window manager events */
-#if defined(SDL_VIDEO_DRIVER_X11)
-#if defined(__APPLE__) && defined(__MACH__)
-/* conflicts with Quickdraw.h */
-#define Cursor X11Cursor
-#endif
-
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-
-#if defined(__APPLE__) && defined(__MACH__)
-/* matches the re-define above */
-#undef Cursor
-#endif
-
-#endif /* defined(SDL_VIDEO_DRIVER_X11) */
-
-#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
-#include <directfb.h>
-#endif
-
-#if defined(SDL_VIDEO_DRIVER_COCOA)
-#ifdef __OBJC__
-#include <Cocoa/Cocoa.h>
-#else
-typedef struct _NSWindow NSWindow;
-#endif
-#endif
-
-#if defined(SDL_VIDEO_DRIVER_UIKIT)
-#ifdef __OBJC__
-#include <UIKit/UIKit.h>
-#else
-typedef struct _UIWindow UIWindow;
-#endif
-#endif
-
-/**
- *  These are the various supported windowing subsystems
- */
-typedef enum
-{
-    SDL_SYSWM_UNKNOWN,
-    SDL_SYSWM_WINDOWS,
-    SDL_SYSWM_X11,
-    SDL_SYSWM_DIRECTFB,
-    SDL_SYSWM_COCOA,
-    SDL_SYSWM_UIKIT,
-} SDL_SYSWM_TYPE;
-
-/**
- *  The custom event structure.
- */
-struct SDL_SysWMmsg
-{
-    SDL_version version;
-    SDL_SYSWM_TYPE subsystem;
-    union
-    {
-#if defined(SDL_VIDEO_DRIVER_WINDOWS)
-        struct {
-            HWND hwnd;                  /**< The window for the message */
-            UINT msg;                   /**< The type of message */
-            WPARAM wParam;              /**< WORD message parameter */
-            LPARAM lParam;              /**< LONG message parameter */
-        } win;
-#endif
-#if defined(SDL_VIDEO_DRIVER_X11)
-        struct {
-            XEvent event;
-        } x11;
-#endif
-#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
-        struct {
-            DFBEvent event;
-        } dfb;
-#endif
-#if defined(SDL_VIDEO_DRIVER_COCOA)
-        struct
-        {
-            /* No Cocoa window events yet */
-        } cocoa;
-#endif
-#if defined(SDL_VIDEO_DRIVER_UIKIT)
-        struct
-        {
-            /* No UIKit window events yet */
-        } uikit;
-#endif
-        /* Can't have an empty union */
-        int dummy;
-    } msg;
-};
-
-/**
- *  The custom window manager information structure.
- *
- *  When this structure is returned, it holds information about which
- *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
- */
-struct SDL_SysWMinfo
-{
-    SDL_version version;
-    SDL_SYSWM_TYPE subsystem;
-    union
-    {
-#if defined(SDL_VIDEO_DRIVER_WINDOWS)
-        struct
-        {
-            HWND window;                /**< The window handle */
-        } win;
-#endif
-#if defined(SDL_VIDEO_DRIVER_X11)
-        struct
-        {
-            Display *display;           /**< The X11 display */
-            Window window;              /**< The X11 window */
-        } x11;
-#endif
-#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
-        struct
-        {
-            IDirectFB *dfb;             /**< The directfb main interface */
-            IDirectFBWindow *window;    /**< The directfb window handle */
-            IDirectFBSurface *surface;  /**< The directfb client surface */
-        } dfb;
-#endif
-#if defined(SDL_VIDEO_DRIVER_COCOA)
-        struct
-        {
-            NSWindow *window;           /* The Cocoa window */
-        } cocoa;
-#endif
-#if defined(SDL_VIDEO_DRIVER_UIKIT)
-        struct
-        {
-            UIWindow *window;           /* The UIKit window */
-        } uikit;
-#endif
-        /* Can't have an empty union */
-        int dummy;
-    } info;
-};
-
-#endif /* SDL_PROTOTYPES_ONLY */
-
-typedef struct SDL_SysWMinfo SDL_SysWMinfo;
-
-/* Function prototypes */
-/**
- *  \brief This function allows access to driver-dependent window information.
- *
- *  \param window The window about which information is being requested
- *  \param info This structure must be initialized with the SDL version, and is
- *              then filled in with information about the given window.
- *
- *  \return SDL_TRUE if the function is implemented and the version member of
- *          the \c info struct is valid, SDL_FALSE otherwise.
- *
- *  You typically use this function like this:
- *  \code
- *  SDL_SysWMinfo info;
- *  SDL_VERSION(&info.version);
- *  if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
- *  \endcode
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
-                                                     SDL_SysWMinfo * info);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_syswm_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test.h b/deps/SDL2/include/SDL_test.h
deleted file mode 100644
index 7e0de08..0000000
--- a/deps/SDL2/include/SDL_test.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-#ifndef _SDL_test_h
-#define _SDL_test_h
-
-#include "SDL.h"
-#include "SDL_test_common.h"
-#include "SDL_test_font.h"
-#include "SDL_test_random.h"
-#include "SDL_test_fuzzer.h"
-#include "SDL_test_crc32.h"
-#include "SDL_test_md5.h"
-#include "SDL_test_log.h"
-#include "SDL_test_assert.h"
-#include "SDL_test_harness.h"
-#include "SDL_test_images.h"
-#include "SDL_test_compare.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Global definitions */
-
-/*
- * Note: Maximum size of SDLTest log message is less than SDLs limit
- * to ensure we can fit additional information such as the timestamp.
- */
-#define SDLTEST_MAX_LOGMESSAGE_LENGTH   3584
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_assert.h b/deps/SDL2/include/SDL_test_assert.h
deleted file mode 100644
index beba16f..0000000
--- a/deps/SDL2/include/SDL_test_assert.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_assert.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/*
- *
- * Assert API for test code and test cases
- *
- */
-
-#ifndef _SDL_test_assert_h
-#define _SDL_test_assert_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief Fails the assert.
- */
-#define ASSERT_FAIL     0
-
-/**
- * \brief Passes the assert.
- */
-#define ASSERT_PASS     1
-
-/**
- * \brief Assert that logs and break execution flow on failures.
- *
- * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
- * \param assertDescription Message to log with the assert describing it.
- */
-void SDLTest_Assert(int assertCondition, const char *assertDescription, ...);
-
-/**
- * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
- *
- * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
- * \param assertDescription Message to log with the assert describing it.
- *
- * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired.
- */
-int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...);
-
-/**
- * \brief Explicitely pass without checking an assertion condition. Updates assertion counter.
- *
- * \param assertDescription Message to log with the assert describing it.
- */
-void SDLTest_AssertPass(const char *assertDescription, ...);
-
-/**
- * \brief Resets the assert summary counters to zero.
- */
-void SDLTest_ResetAssertSummary();
-
-/**
- * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
- */
-void SDLTest_LogAssertSummary();
-
-
-/**
- * \brief Converts the current assert summary state to a test result.
- *
- * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
- */
-int SDLTest_AssertSummaryToTestResult();
-
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_assert_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_common.h b/deps/SDL2/include/SDL_test_common.h
deleted file mode 100644
index 57f3114..0000000
--- a/deps/SDL2/include/SDL_test_common.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_common.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/* Ported from original test\common.h file. */
-
-#ifndef _SDL_test_common_h
-#define _SDL_test_common_h
-
-#include "SDL.h"
-
-#if defined(__PSP__)
-#define DEFAULT_WINDOW_WIDTH  480
-#define DEFAULT_WINDOW_HEIGHT 272
-#else
-#define DEFAULT_WINDOW_WIDTH  640
-#define DEFAULT_WINDOW_HEIGHT 480
-#endif
-
-#define VERBOSE_VIDEO   0x00000001
-#define VERBOSE_MODES   0x00000002
-#define VERBOSE_RENDER  0x00000004
-#define VERBOSE_EVENT   0x00000008
-#define VERBOSE_AUDIO   0x00000010
-
-typedef struct
-{
-    /* SDL init flags */
-    char **argv;
-    Uint32 flags;
-    Uint32 verbose;
-
-    /* Video info */
-    const char *videodriver;
-    int display;
-    const char *window_title;
-    const char *window_icon;
-    Uint32 window_flags;
-    int window_x;
-    int window_y;
-    int window_w;
-    int window_h;
-    int window_minW;
-    int window_minH;
-    int window_maxW;
-    int window_maxH;
-    int logical_w;
-    int logical_h;
-    float scale;
-    int depth;
-    int refresh_rate;
-    int num_windows;
-    SDL_Window **windows;
-
-    /* Renderer info */
-    const char *renderdriver;
-    Uint32 render_flags;
-    SDL_bool skip_renderer;
-    SDL_Renderer **renderers;
-
-    /* Audio info */
-    const char *audiodriver;
-    SDL_AudioSpec audiospec;
-
-    /* GL settings */
-    int gl_red_size;
-    int gl_green_size;
-    int gl_blue_size;
-    int gl_alpha_size;
-    int gl_buffer_size;
-    int gl_depth_size;
-    int gl_stencil_size;
-    int gl_double_buffer;
-    int gl_accum_red_size;
-    int gl_accum_green_size;
-    int gl_accum_blue_size;
-    int gl_accum_alpha_size;
-    int gl_stereo;
-    int gl_multisamplebuffers;
-    int gl_multisamplesamples;
-    int gl_retained_backing;
-    int gl_accelerated;
-    int gl_major_version;
-    int gl_minor_version;
-    int gl_debug;
-    int gl_profile_mask;
-} SDLTest_CommonState;
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Function prototypes */
-
-/**
- * \brief Parse command line parameters and create common state.
- *
- * \param argv Array of command line parameters
- * \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO)
- *
- * \returns Returns a newly allocated common state object.
- */
-SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
-
-/**
- * \brief Process one common argument.
- *
- * \param state The common state describing the test window to create.
- * \param index The index of the argument to process in argv[].
- *
- * \returns The number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error.
- */
-int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
-
-/**
- * \brief Returns common usage information
- *
- * \param state The common state describing the test window to create.
- *
- * \returns String with usage information
- */
-const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
-
-/**
- * \brief Open test window.
- *
- * \param state The common state describing the test window to create.
- *
- * \returns True if initialization succeeded, false otherwise
- */
-SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
-
-/**
- * \brief Common event handler for test windows.
- *
- * \param state The common state used to create test window.
- * \param event The event to handle.
- * \param done Flag indicating we are done.
- *
- */
-void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done);
-
-/**
- * \brief Close test window.
- *
- * \param state The common state used to create test window.
- *
- */
-void SDLTest_CommonQuit(SDLTest_CommonState * state);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_common_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_compare.h b/deps/SDL2/include/SDL_test_compare.h
deleted file mode 100644
index 98ca8ce..0000000
--- a/deps/SDL2/include/SDL_test_compare.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_compare.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/*
-
- Defines comparison functions (i.e. for surfaces).
-
-*/
-
-#ifndef _SDL_test_compare_h
-#define _SDL_test_compare_h
-
-#include "SDL.h"
-
-#include "SDL_test_images.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief Compares a surface and with reference image data for equality
- *
- * \param surface Surface used in comparison
- * \param referenceSurface Test Surface used in comparison
- * \param allowable_error Allowable difference (squared) in blending accuracy.
- *
- * \returns 0 if comparison succeeded, >0 (=number of pixels where comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ.
- */
-int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_compare_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_crc32.h b/deps/SDL2/include/SDL_test_crc32.h
deleted file mode 100644
index f0a84a4..0000000
--- a/deps/SDL2/include/SDL_test_crc32.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_crc32.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/*
-
- Implements CRC32 calculations (default output is Perl String::CRC32 compatible).
-
-*/
-
-#ifndef _SDL_test_crc32_h
-#define _SDL_test_crc32_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* ------------ Definitions --------- */
-
-/* Definition shared by all CRC routines */
-
-#ifndef CrcUint32
- #define CrcUint32  unsigned int
-#endif
-#ifndef CrcUint8
- #define CrcUint8   unsigned char
-#endif
-
-#ifdef ORIGINAL_METHOD
- #define CRC32_POLY 0x04c11db7   /* AUTODIN II, Ethernet, & FDDI */
-#else
- #define CRC32_POLY 0xEDB88320   /* Perl String::CRC32 compatible */
-#endif
-
-/**
- * Data structure for CRC32 (checksum) computation
- */
-  typedef struct {
-    CrcUint32    crc32_table[256]; /* CRC table */
-  } SDLTest_Crc32Context;
-
-/* ---------- Function Prototypes ------------- */
-
-/**
- * /brief Initialize the CRC context
- *
- * Note: The function initializes the crc table required for all crc calculations.
- *
- * /param crcContext        pointer to context variable
- *
- * /returns 0 for OK, -1 on error
- *
- */
- int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
-
-
-/**
- * /brief calculate a crc32 from a data block
- *
- * /param crcContext         pointer to context variable
- * /param inBuf              input buffer to checksum
- * /param inLen              length of input buffer
- * /param crc32              pointer to Uint32 to store the final CRC into
- *
- * /returns 0 for OK, -1 on error
- *
- */
-int SDLTest_crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
-
-/* Same routine broken down into three steps */
-int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
-int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
-int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
-
-
-/**
- * /brief clean up CRC context
- *
- * /param crcContext        pointer to context variable
- *
- * /returns 0 for OK, -1 on error
- *
-*/
-
-int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_crc32_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_font.h b/deps/SDL2/include/SDL_test_font.h
deleted file mode 100644
index aa9286b..0000000
--- a/deps/SDL2/include/SDL_test_font.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_font.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-#ifndef _SDL_test_font_h
-#define _SDL_test_font_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Function prototypes */
-
-/**
- *  \brief Draw a string in the currently set font.
- *
- *  \param renderer The renderer to draw on.
- *  \param x The X coordinate of the upper left corner of the string.
- *  \param y The Y coordinate of the upper left corner of the string.
- *  \param s The string to draw.
- *
- *  \returns Returns 0 on success, -1 on failure.
- */
-int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_font_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_fuzzer.h b/deps/SDL2/include/SDL_test_fuzzer.h
deleted file mode 100644
index a528ddc..0000000
--- a/deps/SDL2/include/SDL_test_fuzzer.h
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_fuzzer.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/*
-
-  Data generators for fuzzing test data in a reproducible way.
-
-*/
-
-#ifndef _SDL_test_fuzzer_h
-#define _SDL_test_fuzzer_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
-  Based on GSOC code by Markus Kauppila <markus.kauppila at gmail.com>
-*/
-
-
-/**
- * \file
- * Note: The fuzzer implementation uses a static instance of random context
- * internally which makes it thread-UNsafe.
- */
-
-/**
- * Initializes the fuzzer for a test
- *
- * /param execKey Execution "Key" that initializes the random number generator uniquely for the test.
- *
- */
-void SDLTest_FuzzerInit(Uint64 execKey);
-
-
-/**
- * Returns a random Uint8
- *
- * \returns Generated integer
- */
-Uint8 SDLTest_RandomUint8();
-
-/**
- * Returns a random Sint8
- *
- * \returns Generated signed integer
- */
-Sint8 SDLTest_RandomSint8();
-
-
-/**
- * Returns a random Uint16
- *
- * \returns Generated integer
- */
-Uint16 SDLTest_RandomUint16();
-
-/**
- * Returns a random Sint16
- *
- * \returns Generated signed integer
- */
-Sint16 SDLTest_RandomSint16();
-
-
-/**
- * Returns a random integer
- *
- * \returns Generated integer
- */
-Sint32 SDLTest_RandomSint32();
-
-
-/**
- * Returns a random positive integer
- *
- * \returns Generated integer
- */
-Uint32 SDLTest_RandomUint32();
-
-/**
- * Returns random Uint64.
- *
- * \returns Generated integer
- */
-Uint64 SDLTest_RandomUint64();
-
-
-/**
- * Returns random Sint64.
- *
- * \returns Generated signed integer
- */
-Sint64 SDLTest_RandomSint64();
-
-/**
- * \returns random float in range [0.0 - 1.0[
- */
-float SDLTest_RandomUnitFloat();
-
-/**
- * \returns random double in range [0.0 - 1.0[
- */
-double SDLTest_RandomUnitDouble();
-
-/**
- * \returns random float.
- *
- */
-float SDLTest_RandomFloat();
-
-/**
- * \returns random double.
- *
- */
-double SDLTest_RandomDouble();
-
-/**
- * Returns a random boundary value for Uint8 within the given boundaries.
- * Boundaries are inclusive, see the usage examples below. If validDomain
- * is true, the function will only return valid boundaries, otherwise non-valid
- * boundaries are also possible.
- * If boundary1 > boundary2, the values are swapped
- *
- * Usage examples:
- * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
- * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
- * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100
- * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set)
- *
- * \param boundary1 Lower boundary limit
- * \param boundary2 Upper boundary limit
- * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
- *
- * \returns Random boundary value for the given range and domain or 0 with error set
- */
-Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
-
-/**
- * Returns a random boundary value for Uint16 within the given boundaries.
- * Boundaries are inclusive, see the usage examples below. If validDomain
- * is true, the function will only return valid boundaries, otherwise non-valid
- * boundaries are also possible.
- * If boundary1 > boundary2, the values are swapped
- *
- * Usage examples:
- * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
- * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
- * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100
- * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set)
- *
- * \param boundary1 Lower boundary limit
- * \param boundary2 Upper boundary limit
- * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
- *
- * \returns Random boundary value for the given range and domain or 0 with error set
- */
-Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
-
-/**
- * Returns a random boundary value for Uint32 within the given boundaries.
- * Boundaries are inclusive, see the usage examples below. If validDomain
- * is true, the function will only return valid boundaries, otherwise non-valid
- * boundaries are also possible.
- * If boundary1 > boundary2, the values are swapped
- *
- * Usage examples:
- * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
- * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
- * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100
- * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set)
- *
- * \param boundary1 Lower boundary limit
- * \param boundary2 Upper boundary limit
- * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
- *
- * \returns Random boundary value for the given range and domain or 0 with error set
- */
-Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
-
-/**
- * Returns a random boundary value for Uint64 within the given boundaries.
- * Boundaries are inclusive, see the usage examples below. If validDomain
- * is true, the function will only return valid boundaries, otherwise non-valid
- * boundaries are also possible.
- * If boundary1 > boundary2, the values are swapped
- *
- * Usage examples:
- * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
- * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
- * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100
- * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set)
- *
- * \param boundary1 Lower boundary limit
- * \param boundary2 Upper boundary limit
- * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
- *
- * \returns Random boundary value for the given range and domain or 0 with error set
- */
-Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
-
-/**
- * Returns a random boundary value for Sint8 within the given boundaries.
- * Boundaries are inclusive, see the usage examples below. If validDomain
- * is true, the function will only return valid boundaries, otherwise non-valid
- * boundaries are also possible.
- * If boundary1 > boundary2, the values are swapped
- *
- * Usage examples:
- * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
- * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
- * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100
- * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set
- *
- * \param boundary1 Lower boundary limit
- * \param boundary2 Upper boundary limit
- * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
- *
- * \returns Random boundary value for the given range and domain or SINT8_MIN with error set
- */
-Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
-
-
-/**
- * Returns a random boundary value for Sint16 within the given boundaries.
- * Boundaries are inclusive, see the usage examples below. If validDomain
- * is true, the function will only return valid boundaries, otherwise non-valid
- * boundaries are also possible.
- * If boundary1 > boundary2, the values are swapped
- *
- * Usage examples:
- * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
- * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
- * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100
- * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set
- *
- * \param boundary1 Lower boundary limit
- * \param boundary2 Upper boundary limit
- * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
- *
- * \returns Random boundary value for the given range and domain or SINT16_MIN with error set
- */
-Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
-
-/**
- * Returns a random boundary value for Sint32 within the given boundaries.
- * Boundaries are inclusive, see the usage examples below. If validDomain
- * is true, the function will only return valid boundaries, otherwise non-valid
- * boundaries are also possible.
- * If boundary1 > boundary2, the values are swapped
- *
- * Usage examples:
- * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
- * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
- * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100
- * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value)
- *
- * \param boundary1 Lower boundary limit
- * \param boundary2 Upper boundary limit
- * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
- *
- * \returns Random boundary value for the given range and domain or SINT32_MIN with error set
- */
-Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
-
-/**
- * Returns a random boundary value for Sint64 within the given boundaries.
- * Boundaries are inclusive, see the usage examples below. If validDomain
- * is true, the function will only return valid boundaries, otherwise non-valid
- * boundaries are also possible.
- * If boundary1 > boundary2, the values are swapped
- *
- * Usage examples:
- * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
- * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
- * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100
- * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set
- *
- * \param boundary1 Lower boundary limit
- * \param boundary2 Upper boundary limit
- * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
- *
- * \returns Random boundary value for the given range and domain or SINT64_MIN with error set
- */
-Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
-
-
-/**
- * Returns integer in range [min, max] (inclusive).
- * Min and max values can be negative values.
- * If Max in smaller tham min, then the values are swapped.
- * Min and max are the same value, that value will be returned.
- *
- * \param min Minimum inclusive value of returned random number
- * \param max Maximum inclusive value of returned random number
- *
- * \returns Generated random integer in range
- */
-Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
-
-
-/**
- * Generates random null-terminated string. The minimum length for
- * the string is 1 character, maximum length for the string is 255
- * characters and it can contain ASCII characters from 32 to 126.
- *
- * Note: Returned string needs to be deallocated.
- *
- * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated.
- */
-char * SDLTest_RandomAsciiString();
-
-
-/**
- * Generates random null-terminated string. The maximum length for
- * the string is defined by the maxLength parameter.
- * String can contain ASCII characters from 32 to 126.
- *
- * Note: Returned string needs to be deallocated.
- *
- * \param maxLength The maximum length of the generated string.
- *
- * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated.
- */
-char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
-
-
-/**
- * Generates random null-terminated string. The length for
- * the string is defined by the size parameter.
- * String can contain ASCII characters from 32 to 126.
- *
- * Note: Returned string needs to be deallocated.
- *
- * \param size The length of the generated string
- *
- * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated.
- */
-char * SDLTest_RandomAsciiStringOfSize(int size);
-
-/**
- * Returns the invocation count for the fuzzer since last ...FuzzerInit.
- */
-int SDLTest_GetFuzzerInvocationCount();
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_fuzzer_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_harness.h b/deps/SDL2/include/SDL_test_harness.h
deleted file mode 100644
index 935038e..0000000
--- a/deps/SDL2/include/SDL_test_harness.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_harness.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/*
-  Defines types for test case definitions and the test execution harness API.
-
-  Based on original GSOC code by Markus Kauppila <markus.kauppila at gmail.com>
-*/
-
-#ifndef _SDL_test_harness_h
-#define _SDL_test_harness_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* ! Definitions for test case structures */
-#define TEST_ENABLED  1
-#define TEST_DISABLED 0
-
-/* ! Definition of all the possible test return values of the test case method */
-#define TEST_ABORTED        -1
-#define TEST_STARTED         0
-#define TEST_COMPLETED       1
-#define TEST_SKIPPED         2
-
-/* ! Definition of all the possible test results for the harness */
-#define TEST_RESULT_PASSED              0
-#define TEST_RESULT_FAILED              1
-#define TEST_RESULT_NO_ASSERT           2
-#define TEST_RESULT_SKIPPED             3
-#define TEST_RESULT_SETUP_FAILURE       4
-
-/* !< Function pointer to a test case setup function (run before every test) */
-typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
-
-/* !< Function pointer to a test case function */
-typedef int (*SDLTest_TestCaseFp)(void *arg);
-
-/* !< Function pointer to a test case teardown function (run after every test) */
-typedef void  (*SDLTest_TestCaseTearDownFp)(void *arg);
-
-/**
- * Holds information about a single test case.
- */
-typedef struct SDLTest_TestCaseReference {
-    /* !< Func2Stress */
-    SDLTest_TestCaseFp testCase;
-    /* !< Short name (or function name) "Func2Stress" */
-    char *name;
-    /* !< Long name or full description "This test pushes func2() to the limit." */
-    char *description;
-    /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */
-    int enabled;
-} SDLTest_TestCaseReference;
-
-/**
- * Holds information about a test suite (multiple test cases).
- */
-typedef struct SDLTest_TestSuiteReference {
-    /* !< "PlatformSuite" */
-    char *name;
-    /* !< The function that is run before each test. NULL skips. */
-    SDLTest_TestCaseSetUpFp testSetUp;
-    /* !< The test cases that are run as part of the suite. Last item should be NULL. */
-    const SDLTest_TestCaseReference **testCases;
-    /* !< The function that is run after each test. NULL skips. */
-    SDLTest_TestCaseTearDownFp testTearDown;
-} SDLTest_TestSuiteReference;
-
-
-/**
- * \brief Execute a test suite using the given run seed and execution key.
- *
- * \param testSuites Suites containing the test case.
- * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one.
- * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one.
- * \param filter Filter specification. NULL disables. Case sensitive.
- * \param testIterations Number of iterations to run each test case.
- *
- * \returns Test run result; 0 when all tests passed, 1 if any tests failed.
- */
-int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_harness_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_images.h b/deps/SDL2/include/SDL_test_images.h
deleted file mode 100644
index 21cf39f..0000000
--- a/deps/SDL2/include/SDL_test_images.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_images.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/*
-
- Defines some images for tests.
-
-*/
-
-#ifndef _SDL_test_images_h
-#define _SDL_test_images_h
-
-#include "SDL.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *Type for test images.
- */
-typedef struct SDLTest_SurfaceImage_s {
-  int width;
-  int height;
-  unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
-  const char *pixel_data;
-} SDLTest_SurfaceImage_t;
-
-/* Test images */
-SDL_Surface *SDLTest_ImageBlit();
-SDL_Surface *SDLTest_ImageBlitColor();
-SDL_Surface *SDLTest_ImageBlitAlpha();
-SDL_Surface *SDLTest_ImageBlitBlendAdd();
-SDL_Surface *SDLTest_ImageBlitBlend();
-SDL_Surface *SDLTest_ImageBlitBlendMod();
-SDL_Surface *SDLTest_ImageBlitBlendNone();
-SDL_Surface *SDLTest_ImageBlitBlendAll();
-SDL_Surface *SDLTest_ImageFace();
-SDL_Surface *SDLTest_ImagePrimitives();
-SDL_Surface *SDLTest_ImagePrimitivesBlend();
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_images_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_log.h b/deps/SDL2/include/SDL_test_log.h
deleted file mode 100644
index a581d2e..0000000
--- a/deps/SDL2/include/SDL_test_log.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_log.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/*
- *
- *  Wrapper to log in the TEST category
- *
- */
-
-#ifndef _SDL_test_log_h
-#define _SDL_test_log_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief Prints given message with a timestamp in the TEST category and INFO priority.
- *
- * \param fmt Message to be logged
- */
-void SDLTest_Log(const char *fmt, ...);
-
-/**
- * \brief Prints given message with a timestamp in the TEST category and the ERROR priority.
- *
- * \param fmt Message to be logged
- */
-void SDLTest_LogError(const char *fmt, ...);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_log_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_md5.h b/deps/SDL2/include/SDL_test_md5.h
deleted file mode 100644
index b0d4b7b..0000000
--- a/deps/SDL2/include/SDL_test_md5.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_md5.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/*
- ***********************************************************************
- ** Header file for implementation of MD5                             **
- ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
- ** Created: 2/17/90 RLR                                              **
- ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version               **
- ** Revised (for MD5): RLR 4/27/91                                    **
- **   -- G modified to have y&~z instead of y&z                       **
- **   -- FF, GG, HH modified to add in last register done             **
- **   -- Access pattern: round 2 works mod 5, round 3 works mod 3     **
- **   -- distinct additive constant for each step                     **
- **   -- round 4 added, working mod 7                                 **
- ***********************************************************************
-*/
-
-/*
- ***********************************************************************
- **  Message-digest routines:                                         **
- **  To form the message digest for a message M                       **
- **    (1) Initialize a context buffer mdContext using MD5Init        **
- **    (2) Call MD5Update on mdContext and M                          **
- **    (3) Call MD5Final on mdContext                                 **
- **  The message digest is now in mdContext->digest[0...15]           **
- ***********************************************************************
-*/
-
-#ifndef _SDL_test_md5_h
-#define _SDL_test_md5_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ------------ Definitions --------- */
-
-/* typedef a 32-bit type */
-  typedef unsigned long int MD5UINT4;
-
-/* Data structure for MD5 (Message-Digest) computation */
-  typedef struct {
-    MD5UINT4  i[2];     /* number of _bits_ handled mod 2^64 */
-    MD5UINT4  buf[4];       /* scratch buffer */
-    unsigned char in[64];   /* input buffer */
-    unsigned char digest[16];   /* actual digest after Md5Final call */
-  } SDLTest_Md5Context;
-
-/* ---------- Function Prototypes ------------- */
-
-/**
- * /brief initialize the context
- *
- * /param  mdContext        pointer to context variable
- *
- * Note: The function initializes the message-digest context
- *       mdContext. Call before each new use of the context -
- *       all fields are set to zero.
- */
- void SDLTest_Md5Init(SDLTest_Md5Context * mdContext);
-
-
-/**
- * /brief update digest from variable length data
- *
- * /param  mdContext       pointer to context variable
- * /param  inBuf           pointer to data array/string
- * /param  inLen           length of data array/string
- *
- * Note: The function updates the message-digest context to account
- *       for the presence of each of the characters inBuf[0..inLen-1]
- *       in the message whose digest is being computed.
-*/
-
- void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf,
-                 unsigned int inLen);
-
-
-/*
- * /brief complete digest computation
- *
- * /param mdContext     pointer to context variable
- *
- * Note: The function terminates the message-digest computation and
- *       ends with the desired message digest in mdContext.digest[0..15].
- *       Always call before using the digest[] variable.
-*/
-
- void SDLTest_Md5Final(SDLTest_Md5Context * mdContext);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_md5_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_test_random.h b/deps/SDL2/include/SDL_test_random.h
deleted file mode 100644
index ce6192c..0000000
--- a/deps/SDL2/include/SDL_test_random.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_test_random.h
- *
- *  Include file for SDL test framework.
- *
- *  This code is a part of the SDL2_test library, not the main SDL library.
- */
-
-/*
-
- A "32-bit Multiply with carry random number generator. Very fast.
- Includes a list of recommended multipliers.
-
- multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32.
- period: (a*2^31)-1
-
-*/
-
-#ifndef _SDL_test_random_h
-#define _SDL_test_random_h
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* --- Definitions */
-
-/*
- * Macros that return a random number in a specific format.
- */
-#define SDLTest_RandomInt(c)        ((int)SDLTest_Random(c))
-
-/*
- * Context structure for the random number generator state.
- */
-  typedef struct {
-    unsigned int a;
-    unsigned int x;
-    unsigned int c;
-    unsigned int ah;
-    unsigned int al;
-  } SDLTest_RandomContext;
-
-
-/* --- Function prototypes */
-
-/**
- *  \brief Initialize random number generator with two integers.
- *
- *  Note: The random sequence of numbers returned by ...Random() is the
- *  same for the same two integers and has a period of 2^31.
- *
- *  \param rndContext     pointer to context structure
- *  \param xi         integer that defines the random sequence
- *  \param ci         integer that defines the random sequence
- *
- */
- void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
-                  unsigned int ci);
-
-/**
- *  \brief Initialize random number generator based on current system time.
- *
- *  \param rndContext     pointer to context structure
- *
- */
- void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
-
-
-/**
- *  \brief Initialize random number generator based on current system time.
- *
- *  Note: ...RandomInit() or ...RandomInitTime() must have been called
- *  before using this function.
- *
- *  \param rndContext     pointer to context structure
- *
- *  \returns A random number (32bit unsigned integer)
- *
- */
- unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_test_random_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_thread.h b/deps/SDL2/include/SDL_thread.h
deleted file mode 100644
index f248c3d..0000000
--- a/deps/SDL2/include/SDL_thread.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_thread_h
-#define _SDL_thread_h
-
-/**
- *  \file SDL_thread.h
- *
- *  Header for the SDL thread management routines.
- */
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-/* Thread synchronization primitives */
-#include "SDL_atomic.h"
-#include "SDL_mutex.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The SDL thread structure, defined in SDL_thread.c */
-struct SDL_Thread;
-typedef struct SDL_Thread SDL_Thread;
-
-/* The SDL thread ID */
-typedef unsigned long SDL_threadID;
-
-/* Thread local storage ID, 0 is the invalid ID */
-typedef unsigned int SDL_TLSID;
-
-/**
- *  The SDL thread priority.
- *
- *  \note On many systems you require special privileges to set high priority.
- */
-typedef enum {
-    SDL_THREAD_PRIORITY_LOW,
-    SDL_THREAD_PRIORITY_NORMAL,
-    SDL_THREAD_PRIORITY_HIGH
-} SDL_ThreadPriority;
-
-/**
- *  The function passed to SDL_CreateThread().
- *  It is passed a void* user context parameter and returns an int.
- */
-typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
-
-#if defined(__WIN32__) && !defined(HAVE_LIBC)
-/**
- *  \file SDL_thread.h
- *
- *  We compile SDL into a DLL. This means, that it's the DLL which
- *  creates a new thread for the calling process with the SDL_CreateThread()
- *  API. There is a problem with this, that only the RTL of the SDL.DLL will
- *  be initialized for those threads, and not the RTL of the calling
- *  application!
- *
- *  To solve this, we make a little hack here.
- *
- *  We'll always use the caller's _beginthread() and _endthread() APIs to
- *  start a new thread. This way, if it's the SDL.DLL which uses this API,
- *  then the RTL of SDL.DLL will be used to create the new thread, and if it's
- *  the application, then the RTL of the application will be used.
- *
- *  So, in short:
- *  Always use the _beginthread() and _endthread() of the calling runtime
- *  library!
- */
-#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
-#include <process.h>            /* This has _beginthread() and _endthread() defined! */
-
-typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
-                                                        unsigned (__stdcall *
-                                                                  func) (void
-                                                                         *),
-                                                        void *arg, unsigned,
-                                                        unsigned *threadID);
-typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
-
-/**
- *  Create a thread.
- */
-extern DECLSPEC SDL_Thread *SDLCALL
-SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
-                 pfnSDL_CurrentBeginThread pfnBeginThread,
-                 pfnSDL_CurrentEndThread pfnEndThread);
-
-/**
- *  Create a thread.
- */
-#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
-
-#else
-
-/**
- *  Create a thread.
- *
- *   Thread naming is a little complicated: Most systems have very small
- *    limits for the string length (BeOS has 32 bytes, Linux currently has 16,
- *    Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
- *    have to see what happens with your system's debugger. The name should be
- *    UTF-8 (but using the naming limits of C identifiers is a better bet).
- *   There are no requirements for thread naming conventions, so long as the
- *    string is null-terminated UTF-8, but these guidelines are helpful in
- *    choosing a name:
- *
- *    http://stackoverflow.com/questions/149932/naming-conventions-for-threads
- *
- *   If a system imposes requirements, SDL will try to munge the string for
- *    it (truncate, etc), but the original string contents will be available
- *    from SDL_GetThreadName().
- */
-extern DECLSPEC SDL_Thread *SDLCALL
-SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
-
-#endif
-
-/**
- * Get the thread name, as it was specified in SDL_CreateThread().
- *  This function returns a pointer to a UTF-8 string that names the
- *  specified thread, or NULL if it doesn't have a name. This is internal
- *  memory, not to be free()'d by the caller, and remains valid until the
- *  specified thread is cleaned up by SDL_WaitThread().
- */
-extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
-
-/**
- *  Get the thread identifier for the current thread.
- */
-extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
-
-/**
- *  Get the thread identifier for the specified thread.
- *
- *  Equivalent to SDL_ThreadID() if the specified thread is NULL.
- */
-extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
-
-/**
- *  Set the priority for the current thread
- */
-extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
-
-/**
- *  Wait for a thread to finish.
- *
- *  The return code for the thread function is placed in the area
- *  pointed to by \c status, if \c status is not NULL.
- */
-extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
-
-/**
- *  \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
- *
- *  \return The newly created thread local storage identifier, or 0 on error
- *
- *  \code
- *  static SDL_SpinLock tls_lock;
- *  static SDL_TLSID thread_local_storage;
- * 
- *  void SetMyThreadData(void *value)
- *  {
- *      if (!thread_local_storage) {
- *          SDL_AtomicLock(&tls_lock);
- *          if (!thread_local_storage) {
- *              thread_local_storage = SDL_TLSCreate();
- *          }
- *          SDL_AtomicUnLock(&tls_lock);
- *      }
- *      SDL_TLSSet(thread_local_storage, value);
- *  }
- *  
- *  void *GetMyThreadData(void)
- *  {
- *      return SDL_TLSGet(thread_local_storage);
- *  }
- *  \endcode
- *
- *  \sa SDL_TLSGet()
- *  \sa SDL_TLSSet()
- */
-extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
-
-/**
- *  \brief Get the value associated with a thread local storage ID for the current thread.
- *
- *  \param id The thread local storage ID
- *
- *  \return The value associated with the ID for the current thread, or NULL if no value has been set.
- *
- *  \sa SDL_TLSCreate()
- *  \sa SDL_TLSSet()
- */
-extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
-
-/**
- *  \brief Set the value associated with a thread local storage ID for the current thread.
- *
- *  \param id The thread local storage ID
- *  \param value The value to associate with the ID for the current thread
- *  \param destructor A function called when the thread exits, to free the value.
- *
- *  \return 0 on success, -1 on error
- *
- *  \sa SDL_TLSCreate()
- *  \sa SDL_TLSGet()
- */
-extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void*));
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_thread_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_timer.h b/deps/SDL2/include/SDL_timer.h
deleted file mode 100644
index 28ab415..0000000
--- a/deps/SDL2/include/SDL_timer.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_timer_h
-#define _SDL_timer_h
-
-/**
- *  \file SDL_timer.h
- *
- *  Header for the SDL time management routines.
- */
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief Get the number of milliseconds since the SDL library initialization.
- *
- * \note This value wraps if the program runs for more than ~49 days.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
-
-/**
- * \brief Compare SDL ticks values, and return true if A has passed B
- *
- * e.g. if you want to wait 100 ms, you could do this:
- *  Uint32 timeout = SDL_GetTicks() + 100;
- *  while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
- *      ... do work until timeout has elapsed
- *  }
- */
-#define SDL_TICKS_PASSED(A, B)  ((Sint32)((B) - (A)) <= 0)
-
-/**
- * \brief Get the current value of the high resolution counter
- */
-extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
-
-/**
- * \brief Get the count per second of the high resolution counter
- */
-extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
-
-/**
- * \brief Wait a specified number of milliseconds before returning.
- */
-extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
-
-/**
- *  Function prototype for the timer callback function.
- *
- *  The callback function is passed the current timer interval and returns
- *  the next timer interval.  If the returned value is the same as the one
- *  passed in, the periodic alarm continues, otherwise a new alarm is
- *  scheduled.  If the callback returns 0, the periodic alarm is cancelled.
- */
-typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
-
-/**
- * Definition of the timer ID type.
- */
-typedef int SDL_TimerID;
-
-/**
- * \brief Add a new timer to the pool of timers already running.
- *
- * \return A timer ID, or NULL when an error occurs.
- */
-extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
-                                                 SDL_TimerCallback callback,
-                                                 void *param);
-
-/**
- * \brief Remove a timer knowing its ID.
- *
- * \return A boolean value indicating success or failure.
- *
- * \warning It is not safe to remove a timer multiple times.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_timer_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_touch.h b/deps/SDL2/include/SDL_touch.h
deleted file mode 100644
index 9e6d7c6..0000000
--- a/deps/SDL2/include/SDL_touch.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_touch.h
- *
- *  Include file for SDL touch event handling.
- */
-
-#ifndef _SDL_touch_h
-#define _SDL_touch_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_video.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef Sint64 SDL_TouchID;
-typedef Sint64 SDL_FingerID;
-
-typedef struct SDL_Finger
-{
-    SDL_FingerID id;
-    float x;
-    float y;
-    float pressure;
-} SDL_Finger;
-
-/* Used as the device ID for mouse events simulated with touch input */
-#define SDL_TOUCH_MOUSEID ((Uint32)-1)
-
-
-/* Function prototypes */
-
-/**
- *  \brief Get the number of registered touch devices.
- */
-extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
-
-/**
- *  \brief Get the touch ID with the given index, or 0 if the index is invalid.
- */
-extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
-
-/**
- *  \brief Get the number of active fingers for a given touch device.
- */
-extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
-
-/**
- *  \brief Get the finger object of the given touch, with the given index.
- */
-extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_touch_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_types.h b/deps/SDL2/include/SDL_types.h
deleted file mode 100644
index bb485cd..0000000
--- a/deps/SDL2/include/SDL_types.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_types.h
- *
- *  \deprecated
- */
-
-/* DEPRECATED */
-#include "SDL_stdinc.h"
diff --git a/deps/SDL2/include/SDL_version.h b/deps/SDL2/include/SDL_version.h
deleted file mode 100644
index dc52c85..0000000
--- a/deps/SDL2/include/SDL_version.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_version.h
- *
- *  This header defines the current SDL version.
- */
-
-#ifndef _SDL_version_h
-#define _SDL_version_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief Information the version of SDL in use.
- *
- *  Represents the library's version as three levels: major revision
- *  (increments with massive changes, additions, and enhancements),
- *  minor revision (increments with backwards-compatible changes to the
- *  major revision), and patchlevel (increments with fixes to the minor
- *  revision).
- *
- *  \sa SDL_VERSION
- *  \sa SDL_GetVersion
- */
-typedef struct SDL_version
-{
-    Uint8 major;        /**< major version */
-    Uint8 minor;        /**< minor version */
-    Uint8 patch;        /**< update version */
-} SDL_version;
-
-/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
-*/
-#define SDL_MAJOR_VERSION   2
-#define SDL_MINOR_VERSION   0
-#define SDL_PATCHLEVEL      1
-
-/**
- *  \brief Macro to determine SDL version program was compiled against.
- *
- *  This macro fills in a SDL_version structure with the version of the
- *  library you compiled against. This is determined by what header the
- *  compiler uses. Note that if you dynamically linked the library, you might
- *  have a slightly newer or older version at runtime. That version can be
- *  determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
- *  is not a macro.
- *
- *  \param x A pointer to a SDL_version struct to initialize.
- *
- *  \sa SDL_version
- *  \sa SDL_GetVersion
- */
-#define SDL_VERSION(x)                          \
-{                                   \
-    (x)->major = SDL_MAJOR_VERSION;                 \
-    (x)->minor = SDL_MINOR_VERSION;                 \
-    (x)->patch = SDL_PATCHLEVEL;                    \
-}
-
-/**
- *  This macro turns the version numbers into a numeric value:
- *  \verbatim
-    (1,2,3) -> (1203)
-    \endverbatim
- *
- *  This assumes that there will never be more than 100 patchlevels.
- */
-#define SDL_VERSIONNUM(X, Y, Z)                     \
-    ((X)*1000 + (Y)*100 + (Z))
-
-/**
- *  This is the version number macro for the current SDL version.
- */
-#define SDL_COMPILEDVERSION \
-    SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
-
-/**
- *  This macro will evaluate to true if compiled with SDL at least X.Y.Z.
- */
-#define SDL_VERSION_ATLEAST(X, Y, Z) \
-    (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
-
-/**
- *  \brief Get the version of SDL that is linked against your program.
- *
- *  If you are linking to SDL dynamically, then it is possible that the
- *  current version will be different than the version you compiled against.
- *  This function returns the current version, while SDL_VERSION() is a
- *  macro that tells you what version you compiled with.
- *
- *  \code
- *  SDL_version compiled;
- *  SDL_version linked;
- *
- *  SDL_VERSION(&compiled);
- *  SDL_GetVersion(&linked);
- *  printf("We compiled against SDL version %d.%d.%d ...\n",
- *         compiled.major, compiled.minor, compiled.patch);
- *  printf("But we linked against SDL version %d.%d.%d.\n",
- *         linked.major, linked.minor, linked.patch);
- *  \endcode
- *
- *  This function may be called safely at any time, even before SDL_Init().
- *
- *  \sa SDL_VERSION
- */
-extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
-
-/**
- *  \brief Get the code revision of SDL that is linked against your program.
- *
- *  Returns an arbitrary string (a hash value) uniquely identifying the
- *  exact revision of the SDL library in use, and is only useful in comparing
- *  against other revisions. It is NOT an incrementing number.
- */
-extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
-
-/**
- *  \brief Get the revision number of SDL that is linked against your program.
- *
- *  Returns a number uniquely identifying the exact revision of the SDL
- *  library in use. It is an incrementing number based on commits to
- *  hg.libsdl.org.
- */
-extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_version_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/SDL_video.h b/deps/SDL2/include/SDL_video.h
deleted file mode 100644
index 4a53f9b..0000000
--- a/deps/SDL2/include/SDL_video.h
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file SDL_video.h
- *
- *  Header file for SDL video functions.
- */
-
-#ifndef _SDL_video_h
-#define _SDL_video_h
-
-#include "SDL_stdinc.h"
-#include "SDL_pixels.h"
-#include "SDL_rect.h"
-#include "SDL_surface.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- *  \brief  The structure that defines a display mode
- *
- *  \sa SDL_GetNumDisplayModes()
- *  \sa SDL_GetDisplayMode()
- *  \sa SDL_GetDesktopDisplayMode()
- *  \sa SDL_GetCurrentDisplayMode()
- *  \sa SDL_GetClosestDisplayMode()
- *  \sa SDL_SetWindowDisplayMode()
- *  \sa SDL_GetWindowDisplayMode()
- */
-typedef struct
-{
-    Uint32 format;              /**< pixel format */
-    int w;                      /**< width */
-    int h;                      /**< height */
-    int refresh_rate;           /**< refresh rate (or zero for unspecified) */
-    void *driverdata;           /**< driver-specific data, initialize to 0 */
-} SDL_DisplayMode;
-
-/**
- *  \brief The type used to identify a window
- *
- *  \sa SDL_CreateWindow()
- *  \sa SDL_CreateWindowFrom()
- *  \sa SDL_DestroyWindow()
- *  \sa SDL_GetWindowData()
- *  \sa SDL_GetWindowFlags()
- *  \sa SDL_GetWindowGrab()
- *  \sa SDL_GetWindowPosition()
- *  \sa SDL_GetWindowSize()
- *  \sa SDL_GetWindowTitle()
- *  \sa SDL_HideWindow()
- *  \sa SDL_MaximizeWindow()
- *  \sa SDL_MinimizeWindow()
- *  \sa SDL_RaiseWindow()
- *  \sa SDL_RestoreWindow()
- *  \sa SDL_SetWindowData()
- *  \sa SDL_SetWindowFullscreen()
- *  \sa SDL_SetWindowGrab()
- *  \sa SDL_SetWindowIcon()
- *  \sa SDL_SetWindowPosition()
- *  \sa SDL_SetWindowSize()
- *  \sa SDL_SetWindowBordered()
- *  \sa SDL_SetWindowTitle()
- *  \sa SDL_ShowWindow()
- */
-typedef struct SDL_Window SDL_Window;
-
-/**
- *  \brief The flags on a window
- *
- *  \sa SDL_GetWindowFlags()
- */
-typedef enum
-{
-    SDL_WINDOW_FULLSCREEN = 0x00000001,         /**< fullscreen window */
-    SDL_WINDOW_OPENGL = 0x00000002,             /**< window usable with OpenGL context */
-    SDL_WINDOW_SHOWN = 0x00000004,              /**< window is visible */
-    SDL_WINDOW_HIDDEN = 0x00000008,             /**< window is not visible */
-    SDL_WINDOW_BORDERLESS = 0x00000010,         /**< no window decoration */
-    SDL_WINDOW_RESIZABLE = 0x00000020,          /**< window can be resized */
-    SDL_WINDOW_MINIMIZED = 0x00000040,          /**< window is minimized */
-    SDL_WINDOW_MAXIMIZED = 0x00000080,          /**< window is maximized */
-    SDL_WINDOW_INPUT_GRABBED = 0x00000100,      /**< window has grabbed input focus */
-    SDL_WINDOW_INPUT_FOCUS = 0x00000200,        /**< window has input focus */
-    SDL_WINDOW_MOUSE_FOCUS = 0x00000400,        /**< window has mouse focus */
-    SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ),
-    SDL_WINDOW_FOREIGN = 0x00000800,            /**< window not created by SDL */
-    SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000       /**< window should be created in high-DPI mode if supported */
-} SDL_WindowFlags;
-
-/**
- *  \brief Used to indicate that you don't care what the window position is.
- */
-#define SDL_WINDOWPOS_UNDEFINED_MASK    0x1FFF0000
-#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X)  (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
-#define SDL_WINDOWPOS_UNDEFINED         SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
-#define SDL_WINDOWPOS_ISUNDEFINED(X)    \
-            (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
-
-/**
- *  \brief Used to indicate that the window position should be centered.
- */
-#define SDL_WINDOWPOS_CENTERED_MASK    0x2FFF0000
-#define SDL_WINDOWPOS_CENTERED_DISPLAY(X)  (SDL_WINDOWPOS_CENTERED_MASK|(X))
-#define SDL_WINDOWPOS_CENTERED         SDL_WINDOWPOS_CENTERED_DISPLAY(0)
-#define SDL_WINDOWPOS_ISCENTERED(X)    \
-            (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
-
-/**
- *  \brief Event subtype for window events
- */
-typedef enum
-{
-    SDL_WINDOWEVENT_NONE,           /**< Never used */
-    SDL_WINDOWEVENT_SHOWN,          /**< Window has been shown */
-    SDL_WINDOWEVENT_HIDDEN,         /**< Window has been hidden */
-    SDL_WINDOWEVENT_EXPOSED,        /**< Window has been exposed and should be
-                                         redrawn */
-    SDL_WINDOWEVENT_MOVED,          /**< Window has been moved to data1, data2
-                                     */
-    SDL_WINDOWEVENT_RESIZED,        /**< Window has been resized to data1xdata2 */
-    SDL_WINDOWEVENT_SIZE_CHANGED,   /**< The window size has changed, either as a result of an API call or through the system or user changing the window size. */
-    SDL_WINDOWEVENT_MINIMIZED,      /**< Window has been minimized */
-    SDL_WINDOWEVENT_MAXIMIZED,      /**< Window has been maximized */
-    SDL_WINDOWEVENT_RESTORED,       /**< Window has been restored to normal size
-                                         and position */
-    SDL_WINDOWEVENT_ENTER,          /**< Window has gained mouse focus */
-    SDL_WINDOWEVENT_LEAVE,          /**< Window has lost mouse focus */
-    SDL_WINDOWEVENT_FOCUS_GAINED,   /**< Window has gained keyboard focus */
-    SDL_WINDOWEVENT_FOCUS_LOST,     /**< Window has lost keyboard focus */
-    SDL_WINDOWEVENT_CLOSE           /**< The window manager requests that the
-                                         window be closed */
-} SDL_WindowEventID;
-
-/**
- *  \brief An opaque handle to an OpenGL context.
- */
-typedef void *SDL_GLContext;
-
-/**
- *  \brief OpenGL configuration attributes
- */
-typedef enum
-{
-    SDL_GL_RED_SIZE,
-    SDL_GL_GREEN_SIZE,
-    SDL_GL_BLUE_SIZE,
-    SDL_GL_ALPHA_SIZE,
-    SDL_GL_BUFFER_SIZE,
-    SDL_GL_DOUBLEBUFFER,
-    SDL_GL_DEPTH_SIZE,
-    SDL_GL_STENCIL_SIZE,
-    SDL_GL_ACCUM_RED_SIZE,
-    SDL_GL_ACCUM_GREEN_SIZE,
-    SDL_GL_ACCUM_BLUE_SIZE,
-    SDL_GL_ACCUM_ALPHA_SIZE,
-    SDL_GL_STEREO,
-    SDL_GL_MULTISAMPLEBUFFERS,
-    SDL_GL_MULTISAMPLESAMPLES,
-    SDL_GL_ACCELERATED_VISUAL,
-    SDL_GL_RETAINED_BACKING,
-    SDL_GL_CONTEXT_MAJOR_VERSION,
-    SDL_GL_CONTEXT_MINOR_VERSION,
-    SDL_GL_CONTEXT_EGL,
-    SDL_GL_CONTEXT_FLAGS,
-    SDL_GL_CONTEXT_PROFILE_MASK,
-    SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
-    SDL_GL_FRAMEBUFFER_SRGB_CAPABLE
-} SDL_GLattr;
-
-typedef enum
-{
-    SDL_GL_CONTEXT_PROFILE_CORE           = 0x0001,
-    SDL_GL_CONTEXT_PROFILE_COMPATIBILITY  = 0x0002,
-    SDL_GL_CONTEXT_PROFILE_ES             = 0x0004 /* GLX_CONTEXT_ES2_PROFILE_BIT_EXT */
-} SDL_GLprofile;
-
-typedef enum
-{
-    SDL_GL_CONTEXT_DEBUG_FLAG              = 0x0001,
-    SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
-    SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG      = 0x0004,
-    SDL_GL_CONTEXT_RESET_ISOLATION_FLAG    = 0x0008
-} SDL_GLcontextFlag;
-
-
-/* Function prototypes */
-
-/**
- *  \brief Get the number of video drivers compiled into SDL
- *
- *  \sa SDL_GetVideoDriver()
- */
-extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
-
-/**
- *  \brief Get the name of a built in video driver.
- *
- *  \note The video drivers are presented in the order in which they are
- *        normally checked during initialization.
- *
- *  \sa SDL_GetNumVideoDrivers()
- */
-extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
-
-/**
- *  \brief Initialize the video subsystem, optionally specifying a video driver.
- *
- *  \param driver_name Initialize a specific driver by name, or NULL for the
- *                     default video driver.
- *
- *  \return 0 on success, -1 on error
- *
- *  This function initializes the video subsystem; setting up a connection
- *  to the window manager, etc, and determines the available display modes
- *  and pixel formats, but does not initialize a window or graphics mode.
- *
- *  \sa SDL_VideoQuit()
- */
-extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name);
-
-/**
- *  \brief Shuts down the video subsystem.
- *
- *  This function closes all windows, and restores the original video mode.
- *
- *  \sa SDL_VideoInit()
- */
-extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
-
-/**
- *  \brief Returns the name of the currently initialized video driver.
- *
- *  \return The name of the current video driver or NULL if no driver
- *          has been initialized
- *
- *  \sa SDL_GetNumVideoDrivers()
- *  \sa SDL_GetVideoDriver()
- */
-extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
-
-/**
- *  \brief Returns the number of available video displays.
- *
- *  \sa SDL_GetDisplayBounds()
- */
-extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
-
-/**
- *  \brief Get the name of a display in UTF-8 encoding
- *
- *  \return The name of a display, or NULL for an invalid display index.
- *
- *  \sa SDL_GetNumVideoDisplays()
- */
-extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex);
-
-/**
- *  \brief Get the desktop area represented by a display, with the primary
- *         display located at 0,0
- *
- *  \return 0 on success, or -1 if the index is out of range.
- *
- *  \sa SDL_GetNumVideoDisplays()
- */
-extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect);
-
-/**
- *  \brief Returns the number of available display modes.
- *
- *  \sa SDL_GetDisplayMode()
- */
-extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex);
-
-/**
- *  \brief Fill in information about a specific display mode.
- *
- *  \note The display modes are sorted in this priority:
- *        \li bits per pixel -> more colors to fewer colors
- *        \li width -> largest to smallest
- *        \li height -> largest to smallest
- *        \li refresh rate -> highest to lowest
- *
- *  \sa SDL_GetNumDisplayModes()
- */
-extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex,
-                                               SDL_DisplayMode * mode);
-
-/**
- *  \brief Fill in information about the desktop display mode.
- */
-extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode);
-
-/**
- *  \brief Fill in information about the current display mode.
- */
-extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode);
-
-
-/**
- *  \brief Get the closest match to the requested display mode.
- *
- *  \param displayIndex The index of display from which mode should be queried.
- *  \param mode The desired display mode
- *  \param closest A pointer to a display mode to be filled in with the closest
- *                 match of the available display modes.
- *
- *  \return The passed in value \c closest, or NULL if no matching video mode
- *          was available.
- *
- *  The available display modes are scanned, and \c closest is filled in with the
- *  closest mode matching the requested mode and returned.  The mode format and
- *  refresh_rate default to the desktop mode if they are 0.  The modes are
- *  scanned with size being first priority, format being second priority, and
- *  finally checking the refresh_rate.  If all the available modes are too
- *  small, then NULL is returned.
- *
- *  \sa SDL_GetNumDisplayModes()
- *  \sa SDL_GetDisplayMode()
- */
-extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
-
-/**
- *  \brief Get the display index associated with a window.
- *
- *  \return the display index of the display containing the center of the
- *          window, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window);
-
-/**
- *  \brief Set the display mode used when a fullscreen window is visible.
- *
- *  By default the window's dimensions and the desktop format and refresh rate
- *  are used.
- *
- *  \param window The window for which the display mode should be set.
- *  \param mode The mode to use, or NULL for the default mode.
- *
- *  \return 0 on success, or -1 if setting the display mode failed.
- *
- *  \sa SDL_GetWindowDisplayMode()
- *  \sa SDL_SetWindowFullscreen()
- */
-extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window,
-                                                     const SDL_DisplayMode
-                                                         * mode);
-
-/**
- *  \brief Fill in information about the display mode used when a fullscreen
- *         window is visible.
- *
- *  \sa SDL_SetWindowDisplayMode()
- *  \sa SDL_SetWindowFullscreen()
- */
-extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window,
-                                                     SDL_DisplayMode * mode);
-
-/**
- *  \brief Get the pixel format associated with the window.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
-
-/**
- *  \brief Create a window with the specified position, dimensions, and flags.
- *
- *  \param title The title of the window, in UTF-8 encoding.
- *  \param x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *               ::SDL_WINDOWPOS_UNDEFINED.
- *  \param y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *               ::SDL_WINDOWPOS_UNDEFINED.
- *  \param w     The width of the window.
- *  \param h     The height of the window.
- *  \param flags The flags for the window, a mask of any of the following:
- *               ::SDL_WINDOW_FULLSCREEN,    ::SDL_WINDOW_OPENGL,
- *               ::SDL_WINDOW_HIDDEN,        ::SDL_WINDOW_BORDERLESS,
- *               ::SDL_WINDOW_RESIZABLE,     ::SDL_WINDOW_MAXIMIZED,
- *               ::SDL_WINDOW_MINIMIZED,     ::SDL_WINDOW_INPUT_GRABBED,
- *               ::SDL_WINDOW_ALLOW_HIGHDPI.
- *
- *  \return The id of the window created, or zero if window creation failed.
- *
- *  \sa SDL_DestroyWindow()
- */
-extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title,
-                                                      int x, int y, int w,
-                                                      int h, Uint32 flags);
-
-/**
- *  \brief Create an SDL window from an existing native window.
- *
- *  \param data A pointer to driver-dependent window creation data
- *
- *  \return The id of the window created, or zero if window creation failed.
- *
- *  \sa SDL_DestroyWindow()
- */
-extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data);
-
-/**
- *  \brief Get the numeric ID of a window, for logging purposes.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window);
-
-/**
- *  \brief Get a window from a stored ID, or NULL if it doesn't exist.
- */
-extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id);
-
-/**
- *  \brief Get the window flags.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window);
-
-/**
- *  \brief Set the title of a window, in UTF-8 format.
- *
- *  \sa SDL_GetWindowTitle()
- */
-extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window,
-                                                const char *title);
-
-/**
- *  \brief Get the title of a window, in UTF-8 format.
- *
- *  \sa SDL_SetWindowTitle()
- */
-extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window);
-
-/**
- *  \brief Set the icon for a window.
- *
- *  \param window The window for which the icon should be set.
- *  \param icon The icon for the window.
- */
-extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window,
-                                               SDL_Surface * icon);
-
-/**
- *  \brief Associate an arbitrary named pointer with a window.
- *
- *  \param window   The window to associate with the pointer.
- *  \param name     The name of the pointer.
- *  \param userdata The associated pointer.
- *
- *  \return The previous value associated with 'name'
- *
- *  \note The name is case-sensitive.
- *
- *  \sa SDL_GetWindowData()
- */
-extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window,
-                                                const char *name,
-                                                void *userdata);
-
-/**
- *  \brief Retrieve the data pointer associated with a window.
- *
- *  \param window   The window to query.
- *  \param name     The name of the pointer.
- *
- *  \return The value associated with 'name'
- *
- *  \sa SDL_SetWindowData()
- */
-extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window,
-                                                const char *name);
-
-/**
- *  \brief Set the position of a window.
- *
- *  \param window   The window to reposition.
- *  \param x        The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
-                    ::SDL_WINDOWPOS_UNDEFINED.
- *  \param y        The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
-                    ::SDL_WINDOWPOS_UNDEFINED.
- *
- *  \note The window coordinate origin is the upper left of the display.
- *
- *  \sa SDL_GetWindowPosition()
- */
-extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window,
-                                                   int x, int y);
-
-/**
- *  \brief Get the position of a window.
- *
- *  \param window   The window to query.
- *  \param x        Pointer to variable for storing the x position, may be NULL
- *  \param y        Pointer to variable for storing the y position, may be NULL
- *
- *  \sa SDL_SetWindowPosition()
- */
-extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window,
-                                                   int *x, int *y);
-
-/**
- *  \brief Set the size of a window's client area.
- *
- *  \param window   The window to resize.
- *  \param w        The width of the window, must be >0
- *  \param h        The height of the window, must be >0
- *
- *  \note You can't change the size of a fullscreen window, it automatically
- *        matches the size of the display mode.
- *
- *  \sa SDL_GetWindowSize()
- */
-extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w,
-                                               int h);
-
-/**
- *  \brief Get the size of a window's client area.
- *
- *  \param window   The window to query.
- *  \param w        Pointer to variable for storing the width, may be NULL
- *  \param h        Pointer to variable for storing the height, may be NULL
- *
- *  \sa SDL_SetWindowSize()
- */
-extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w,
-                                               int *h);
-
-/**
- *  \brief Set the minimum size of a window's client area.
- *
- *  \param window    The window to set a new minimum size.
- *  \param min_w     The minimum width of the window, must be >0
- *  \param min_h     The minimum height of the window, must be >0
- *
- *  \note You can't change the minimum size of a fullscreen window, it
- *        automatically matches the size of the display mode.
- *
- *  \sa SDL_GetWindowMinimumSize()
- *  \sa SDL_SetWindowMaximumSize()
- */
-extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window,
-                                                      int min_w, int min_h);
-
-/**
- *  \brief Get the minimum size of a window's client area.
- *
- *  \param window   The window to query.
- *  \param w        Pointer to variable for storing the minimum width, may be NULL
- *  \param h        Pointer to variable for storing the minimum height, may be NULL
- *
- *  \sa SDL_GetWindowMaximumSize()
- *  \sa SDL_SetWindowMinimumSize()
- */
-extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window,
-                                                      int *w, int *h);
-
-/**
- *  \brief Set the maximum size of a window's client area.
- *
- *  \param window    The window to set a new maximum size.
- *  \param max_w     The maximum width of the window, must be >0
- *  \param max_h     The maximum height of the window, must be >0
- *
- *  \note You can't change the maximum size of a fullscreen window, it
- *        automatically matches the size of the display mode.
- *
- *  \sa SDL_GetWindowMaximumSize()
- *  \sa SDL_SetWindowMinimumSize()
- */
-extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window,
-                                                      int max_w, int max_h);
-
-/**
- *  \brief Get the maximum size of a window's client area.
- *
- *  \param window   The window to query.
- *  \param w        Pointer to variable for storing the maximum width, may be NULL
- *  \param h        Pointer to variable for storing the maximum height, may be NULL
- *
- *  \sa SDL_GetWindowMinimumSize()
- *  \sa SDL_SetWindowMaximumSize()
- */
-extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window,
-                                                      int *w, int *h);
-
-/**
- *  \brief Set the border state of a window.
- *
- *  This will add or remove the window's SDL_WINDOW_BORDERLESS flag and
- *  add or remove the border from the actual window. This is a no-op if the
- *  window's border already matches the requested state.
- *
- *  \param window The window of which to change the border state.
- *  \param bordered SDL_FALSE to remove border, SDL_TRUE to add border.
- *
- *  \note You can't change the border state of a fullscreen window.
- *
- *  \sa SDL_GetWindowFlags()
- */
-extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window,
-                                                   SDL_bool bordered);
-
-/**
- *  \brief Show a window.
- *
- *  \sa SDL_HideWindow()
- */
-extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window);
-
-/**
- *  \brief Hide a window.
- *
- *  \sa SDL_ShowWindow()
- */
-extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window);
-
-/**
- *  \brief Raise a window above other windows and set the input focus.
- */
-extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window);
-
-/**
- *  \brief Make a window as large as possible.
- *
- *  \sa SDL_RestoreWindow()
- */
-extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window);
-
-/**
- *  \brief Minimize a window to an iconic representation.
- *
- *  \sa SDL_RestoreWindow()
- */
-extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window);
-
-/**
- *  \brief Restore the size and position of a minimized or maximized window.
- *
- *  \sa SDL_MaximizeWindow()
- *  \sa SDL_MinimizeWindow()
- */
-extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window);
-
-/**
- *  \brief Set a window's fullscreen state.
- *
- *  \return 0 on success, or -1 if setting the display mode failed.
- *
- *  \sa SDL_SetWindowDisplayMode()
- *  \sa SDL_GetWindowDisplayMode()
- */
-extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
-                                                    Uint32 flags);
-
-/**
- *  \brief Get the SDL surface associated with the window.
- *
- *  \return The window's framebuffer surface, or NULL on error.
- *
- *  A new surface will be created with the optimal format for the window,
- *  if necessary. This surface will be freed when the window is destroyed.
- *
- *  \note You may not combine this with 3D or the rendering API on this window.
- *
- *  \sa SDL_UpdateWindowSurface()
- *  \sa SDL_UpdateWindowSurfaceRects()
- */
-extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window);
-
-/**
- *  \brief Copy the window surface to the screen.
- *
- *  \return 0 on success, or -1 on error.
- *
- *  \sa SDL_GetWindowSurface()
- *  \sa SDL_UpdateWindowSurfaceRects()
- */
-extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window);
-
-/**
- *  \brief Copy a number of rectangles on the window surface to the screen.
- *
- *  \return 0 on success, or -1 on error.
- *
- *  \sa SDL_GetWindowSurface()
- *  \sa SDL_UpdateWindowSurfaceRect()
- */
-extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
-                                                         const SDL_Rect * rects,
-                                                         int numrects);
-
-/**
- *  \brief Set a window's input grab mode.
- *
- *  \param window The window for which the input grab mode should be set.
- *  \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
- *
- *  \sa SDL_GetWindowGrab()
- */
-extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window,
-                                               SDL_bool grabbed);
-
-/**
- *  \brief Get a window's input grab mode.
- *
- *  \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
- *
- *  \sa SDL_SetWindowGrab()
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window);
-
-/**
- *  \brief Set the brightness (gamma correction) for a window.
- *
- *  \return 0 on success, or -1 if setting the brightness isn't supported.
- *
- *  \sa SDL_GetWindowBrightness()
- *  \sa SDL_SetWindowGammaRamp()
- */
-extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness);
-
-/**
- *  \brief Get the brightness (gamma correction) for a window.
- *
- *  \return The last brightness value passed to SDL_SetWindowBrightness()
- *
- *  \sa SDL_SetWindowBrightness()
- */
-extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window);
-
-/**
- *  \brief Set the gamma ramp for a window.
- *
- *  \param window The window for which the gamma ramp should be set.
- *  \param red The translation table for the red channel, or NULL.
- *  \param green The translation table for the green channel, or NULL.
- *  \param blue The translation table for the blue channel, or NULL.
- *
- *  \return 0 on success, or -1 if gamma ramps are unsupported.
- *
- *  Set the gamma translation table for the red, green, and blue channels
- *  of the video hardware.  Each table is an array of 256 16-bit quantities,
- *  representing a mapping between the input and output for that channel.
- *  The input is the index into the array, and the output is the 16-bit
- *  gamma value at that index, scaled to the output color precision.
- *
- *  \sa SDL_GetWindowGammaRamp()
- */
-extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window,
-                                                   const Uint16 * red,
-                                                   const Uint16 * green,
-                                                   const Uint16 * blue);
-
-/**
- *  \brief Get the gamma ramp for a window.
- *
- *  \param window The window from which the gamma ramp should be queried.
- *  \param red   A pointer to a 256 element array of 16-bit quantities to hold
- *               the translation table for the red channel, or NULL.
- *  \param green A pointer to a 256 element array of 16-bit quantities to hold
- *               the translation table for the green channel, or NULL.
- *  \param blue  A pointer to a 256 element array of 16-bit quantities to hold
- *               the translation table for the blue channel, or NULL.
- *
- *  \return 0 on success, or -1 if gamma ramps are unsupported.
- *
- *  \sa SDL_SetWindowGammaRamp()
- */
-extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window,
-                                                   Uint16 * red,
-                                                   Uint16 * green,
-                                                   Uint16 * blue);
-
-/**
- *  \brief Destroy a window.
- */
-extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);
-
-
-/**
- *  \brief Returns whether the screensaver is currently enabled (default on).
- *
- *  \sa SDL_EnableScreenSaver()
- *  \sa SDL_DisableScreenSaver()
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void);
-
-/**
- *  \brief Allow the screen to be blanked by a screensaver
- *
- *  \sa SDL_IsScreenSaverEnabled()
- *  \sa SDL_DisableScreenSaver()
- */
-extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void);
-
-/**
- *  \brief Prevent the screen from being blanked by a screensaver
- *
- *  \sa SDL_IsScreenSaverEnabled()
- *  \sa SDL_EnableScreenSaver()
- */
-extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void);
-
-
-/**
- *  \name OpenGL support functions
- */
-/* @{ */
-
-/**
- *  \brief Dynamically load an OpenGL library.
- *
- *  \param path The platform dependent OpenGL library name, or NULL to open the
- *              default OpenGL library.
- *
- *  \return 0 on success, or -1 if the library couldn't be loaded.
- *
- *  This should be done after initializing the video driver, but before
- *  creating any OpenGL windows.  If no OpenGL library is loaded, the default
- *  library will be loaded upon creation of the first OpenGL window.
- *
- *  \note If you do this, you need to retrieve all of the GL functions used in
- *        your program from the dynamic library using SDL_GL_GetProcAddress().
- *
- *  \sa SDL_GL_GetProcAddress()
- *  \sa SDL_GL_UnloadLibrary()
- */
-extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
-
-/**
- *  \brief Get the address of an OpenGL function.
- */
-extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
-
-/**
- *  \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
- *
- *  \sa SDL_GL_LoadLibrary()
- */
-extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
-
-/**
- *  \brief Return true if an OpenGL extension is supported for the current
- *         context.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
-                                                           *extension);
-
-/**
- *  \brief Set an OpenGL window attribute before window creation.
- */
-extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
-
-/**
- *  \brief Get the actual value for an attribute from the current context.
- */
-extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
-
-/**
- *  \brief Create an OpenGL context for use with an OpenGL window, and make it
- *         current.
- *
- *  \sa SDL_GL_DeleteContext()
- */
-extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *
-                                                           window);
-
-/**
- *  \brief Set up an OpenGL context for rendering into an OpenGL window.
- *
- *  \note The context must have been created with a compatible window.
- */
-extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window,
-                                               SDL_GLContext context);
-
-/**
- *  \brief Get the currently active OpenGL window.
- */
-extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void);
-
-/**
- *  \brief Get the currently active OpenGL context.
- */
-extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
-
-/**
- *  \brief Get the size of a window's underlying drawable (for use with glViewport).
- *
- *  \param window   Window from which the drawable size should be queried
- *  \param w        Pointer to variable for storing the width, may be NULL
- *  \param h        Pointer to variable for storing the height, may be NULL
- *
- * This may differ from SDL_GetWindowSize if we're rendering to a high-DPI
- * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
- * platform with high-DPI support (Apple calls this "Retina"), and not disabled
- * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
- *
- *  \sa SDL_GetWindowSize()
- *  \sa SDL_CreateWindow()
- */
-extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w,
-                                                    int *h);
-
-/**
- *  \brief Set the swap interval for the current OpenGL context.
- *
- *  \param interval 0 for immediate updates, 1 for updates synchronized with the
- *                  vertical retrace. If the system supports it, you may
- *                  specify -1 to allow late swaps to happen immediately
- *                  instead of waiting for the next retrace.
- *
- *  \return 0 on success, or -1 if setting the swap interval is not supported.
- *
- *  \sa SDL_GL_GetSwapInterval()
- */
-extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
-
-/**
- *  \brief Get the swap interval for the current OpenGL context.
- *
- *  \return 0 if there is no vertical retrace synchronization, 1 if the buffer
- *          swap is synchronized with the vertical retrace, and -1 if late
- *          swaps happen immediately instead of waiting for the next retrace.
- *          If the system can't determine the swap interval, or there isn't a
- *          valid current context, this will return 0 as a safe default.
- *
- *  \sa SDL_GL_SetSwapInterval()
- */
-extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
-
-/**
- * \brief Swap the OpenGL buffers for a window, if double-buffering is
- *        supported.
- */
-extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window);
-
-/**
- *  \brief Delete an OpenGL context.
- *
- *  \sa SDL_GL_CreateContext()
- */
-extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
-
-/* @} *//* OpenGL support functions */
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_video_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/include/begin_code.h b/deps/SDL2/include/begin_code.h
deleted file mode 100644
index 968a540..0000000
--- a/deps/SDL2/include/begin_code.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file begin_code.h
- *
- *  This file sets things up for C dynamic library function definitions,
- *  static inlined functions, and structures aligned at 4-byte alignment.
- *  If you don't like ugly C preprocessor code, don't look at this file. :)
- */
-
-/* This shouldn't be nested -- included it around code only. */
-#ifdef _begin_code_h
-#error Nested inclusion of begin_code.h
-#endif
-#define _begin_code_h
-
-#ifndef SDL_DEPRECATED
-#  if (__GNUC__ >= 4)  /* technically, this arrived in gcc 3.1, but oh well. */
-#    define SDL_DEPRECATED __attribute__((deprecated))
-#  else
-#    define SDL_DEPRECATED
-#  endif
-#endif
-
-/* Some compilers use a special export keyword */
-#ifndef DECLSPEC
-# if defined(__WIN32__)
-#  ifdef __BORLANDC__
-#   ifdef BUILD_SDL
-#    define DECLSPEC
-#   else
-#    define DECLSPEC    __declspec(dllimport)
-#   endif
-#  else
-#   define DECLSPEC __declspec(dllexport)
-#  endif
-# else
-#  if defined(__GNUC__) && __GNUC__ >= 4
-#   define DECLSPEC __attribute__ ((visibility("default")))
-#  elif defined(__GNUC__) && __GNUC__ >= 2
-#   define DECLSPEC __declspec(dllexport)
-#  else
-#   define DECLSPEC
-#  endif
-# endif
-#endif
-
-/* By default SDL uses the C calling convention */
-#ifndef SDLCALL
-#if defined(__WIN32__) && !defined(__GNUC__)
-#define SDLCALL __cdecl
-#else
-#define SDLCALL
-#endif
-#endif /* SDLCALL */
-
-/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
-#ifdef __SYMBIAN32__
-#undef DECLSPEC
-#define DECLSPEC
-#endif /* __SYMBIAN32__ */
-
-/* Force structure packing at 4 byte alignment.
-   This is necessary if the header is included in code which has structure
-   packing set to an alternate value, say for loading structures from disk.
-   The packing is reset to the previous value in close_code.h
- */
-#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
-#ifdef _MSC_VER
-#pragma warning(disable: 4103)
-#endif
-#ifdef __BORLANDC__
-#pragma nopackwarning
-#endif
-#ifdef _M_X64
-/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
-#pragma pack(push,8)
-#else
-#pragma pack(push,4)
-#endif
-#endif /* Compiler needs structure packing set */
-
-#ifndef SDL_INLINE
-#if defined(__GNUC__)
-#define SDL_INLINE __inline__
-#elif defined(_MSC_VER) || defined(__BORLANDC__) || \
-      defined(__DMC__) || defined(__SC__) || \
-      defined(__WATCOMC__) || defined(__LCC__) || \
-      defined(__DECC)
-#define SDL_INLINE __inline
-#ifndef __inline__
-#define __inline__ __inline
-#endif
-#else
-#define SDL_INLINE inline
-#ifndef __inline__
-#define __inline__ inline
-#endif
-#endif
-#endif /* SDL_INLINE not defined */
-
-#ifndef SDL_FORCE_INLINE
-#if defined(_MSC_VER)
-#define SDL_FORCE_INLINE __forceinline
-#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
-#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
-#else
-#define SDL_FORCE_INLINE static SDL_INLINE
-#endif
-#endif /* SDL_FORCE_INLINE not defined */
-
-/* Apparently this is needed by several Windows compilers */
-#if !defined(__MACH__)
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void *)0)
-#endif
-#endif /* NULL */
-#endif /* ! Mac OS X - breaks precompiled headers */
diff --git a/deps/SDL2/include/close_code.h b/deps/SDL2/include/close_code.h
deleted file mode 100644
index 4901482..0000000
--- a/deps/SDL2/include/close_code.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- *  \file close_code.h
- *
- *  This file reverses the effects of begin_code.h and should be included
- *  after you finish any function and structure declarations in your headers
- */
-
-#undef _begin_code_h
-
-/* Reset structure packing at previous byte alignment */
-#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__)  || defined(__BORLANDC__)
-#ifdef __BORLANDC__
-#pragma nopackwarning
-#endif
-#pragma pack(pop)
-#endif /* Compiler needs structure packing set */
diff --git a/deps/SDL2/include/doxyfile b/deps/SDL2/include/doxyfile
deleted file mode 100644
index 495dbc1..0000000
--- a/deps/SDL2/include/doxyfile
+++ /dev/null
@@ -1,1555 +0,0 @@
-# Doxyfile 1.5.9
-
-# 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 (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file 
-# that follow. The default is UTF-8 which is also the encoding used for all 
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
-# iconv built into libc) for the transcoding. See 
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = SDL
-
-# 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         = 2.0.0
-
-# 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       = .
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
-# 4096 sub-directories (in 2 levels) under the output directory of each output 
-# format and will distribute the generated files over these directories. 
-# Enabling this option can be useful when feeding doxygen a huge amount of 
-# source files, where putting all generated files in the same directory would 
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS         = YES
-
-# 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: 
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, 
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE        = English
-
-# 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
-
-# This tag implements a quasi-intelligent brief description abbreviator 
-# that is used to form the text in various listings. Each string 
-# in this list, if found as the leading text of the brief description, will be 
-# stripped from the text and the result after processing the whole list, is 
-# used as the annotated text. Otherwise, the brief description is used as-is. 
-# If left blank, the following values are used ("$name" is automatically 
-# replaced with the name of the entity): "The $name class" "The $name widget" 
-# "The $name file" "is" "provides" "specifies" "contains" 
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF       = "The $name class" \
-                         "The $name widget" \
-                         "The $name file" \
-                         is \
-                         provides \
-                         specifies \
-                         contains \
-                         represents \
-                         a \
-                         an \
-                         the
-
-# 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    = YES
-
-# 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. The tag can be used to show relative paths in the file list. 
-# If left blank the directory from which doxygen is run is used as the 
-# path to strip.
-
-STRIP_FROM_PATH        =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
-# the path mentioned in the documentation of a class, which tells 
-# the reader which header file to include in order to use a class. 
-# If left blank only the name of the header file containing the class 
-# definition is used. Otherwise one should specify the include paths that 
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH    = 
-
-# 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 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 regular Qt-style comments 
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF      = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
-# interpret the first line (until the first dot) of a Qt-style 
-# comment as the brief description. If set to NO, the comments 
-# will behave just like regular Qt-style comments (thus requiring 
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF           = NO
-
-# 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 INHERIT_DOCS tag is set to YES (the default) then an undocumented 
-# member inherits the documentation from any documented member that it 
-# re-implements.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
-# a new page for each member. If set to NO, the documentation of a member will 
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES  = 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
-
-# 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                = "defined=\"\def\"" \
-                         "discussion=\"\par Discussion:\n\""
-
-# 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 OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
-# sources only. Doxygen will then generate output that is more tailored for 
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
-# sources. Doxygen will then generate output that is tailored for 
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it parses. 
-# With this tag you can assign which parser to use for a given extension. 
-# Doxygen has a built-in mapping, but you can override or extend it using this tag. 
-# The format is ext=language, where ext is a file extension, and language is one of 
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set
-# FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING      = 
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
-# to include (a tag file for) the STL sources as input, then you should 
-# set this tag to YES in order to let doxygen match functions declarations and 
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
-# func(std::string) {}). This also make the inheritance and collaboration 
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT    = YES
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to 
-# enable parsing support.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
-# Doxygen will parse them like normal C++ but will assume all classes use public 
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter 
-# and setter methods for a property. Setting this option to YES (the default) 
-# will make doxygen to replace the get and set methods by a property in the 
-# documentation. This will only work if the methods are indeed getting or 
-# setting a simple type. If this is not the case, or you want to show the 
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT   = 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
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
-# the same type (for instance a group of public functions) to be put as a 
-# subgroup of that type (e.g. under the Public Functions section). Set it to 
-# NO to prevent subgrouping. Alternatively, this can be done per class using 
-# the \nosubgrouping command.
-
-SUBGROUPING            = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
-# is documented as struct, union, or enum with the name of the typedef. So 
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
-# with name TypeT. When disabled the typedef will appear as a member of a file, 
-# namespace, or class. And the struct will be named TypeS. This can typically 
-# be useful for C code in case the coding convention dictates that all compound 
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT   = YES
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 
-# determine which symbols to keep in memory and which to flush to disk. 
-# When the cache is full, less often used symbols will be written to disk. 
-# For small to medium size projects (<1000 input files) the default value is 
-# probably good enough. For larger projects a too small cache size can cause 
-# doxygen to be busy swapping symbols to and from disk most of the time 
-# causing a significant performance penality. 
-# If the system has enough physical memory increasing the cache will improve the 
-# performance by keeping more symbols in memory. Note that the value works on 
-# a logarithmic scale so increasing the size by one will rougly double the 
-# memory usage. The cache size is given by this formula: 
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE      = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# 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
-
-# This flag is only useful for Objective-C code. When set to YES local 
-# methods, which are defined in the implementation section but not in 
-# the interface are included in the documentation. 
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS  = YES
-
-# If this flag is set to YES, the members of anonymous namespaces will be 
-# extracted and appear in the documentation as a namespace called 
-# 'anonymous_namespace{file}', where file will be replaced with the base 
-# name of the file that contains the anonymous namespace. By default 
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES   = 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 classes 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
-
-# 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          = YES
-
-# 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 
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_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 SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
-# will put a list of the files that are included by a file in the documentation 
-# of that file.
-
-SHOW_INCLUDE_FILES     = 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 the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
-# brief documentation of file, namespace and class members alphabetically 
-# by member name. If set to NO (the default) the members will appear in 
-# declaration order.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
-# hierarchy of group names into alphabetical order. If set to NO (the default) 
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
-# sorted by fully-qualified names, including namespaces. If set to 
-# NO (the default), the class list will be sorted only by class name, 
-# not including the namespace part. 
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 
-# Note: This option applies only to the class list, not to the 
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# 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
-
-# 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 consists 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
-
-# If the sources in your project are distributed over multiple directories 
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES       = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
-# This will remove the Files entry from the Quick Index and from the 
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
-# Namespaces page.  This will remove the Namespaces entry from the Quick Index 
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES        = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
-# doxygen should invoke to get the current version for each file (typically from 
-# the version control system). Doxygen will invoke the program by executing (via 
-# popen()) the command <command> <input-file>, where <command> is the value of 
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
-# provided by doxygen. Whatever the program writes to standard output 
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER    = 
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 
-# doxygen. The layout file controls the global structure of the generated output files 
-# in an output format independent way. The create the layout file that represents 
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a 
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name 
-# of the layout file.
-
-LAYOUT_FILE            = 
-
-#---------------------------------------------------------------------------
-# 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
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
-# potential errors in the documentation, such as not documenting some 
-# parameters in a documented function, or documenting parameters that 
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for 
-# functions that are documented, but have no documentation for their parameters 
-# or return value. If set to NO (the default) doxygen will only warn about 
-# wrong or incomplete parameter documentation, but not about the absence of 
-# documentation.
-
-WARN_NO_PARAMDOC       = 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. Optionally the format may contain 
-# $version, which will be replaced by the version of the file (if it could 
-# be obtained via FILE_VERSION_FILTER)
-
-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           = ./doxygen_warn.txt
-
-#---------------------------------------------------------------------------
-# 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                  = .
-
-# This tag can be used to specify the character encoding of the source files 
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
-# also the default input encoding. Doxygen uses libiconv (or the iconv built 
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
-# the list of possible encodings.
-
-INPUT_ENCODING         = UTF-8
-
-# 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 *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS          = *.c \
-                         *.cc \
-                         *.cxx \
-                         *.cpp \
-                         *.c++ \
-                         *.d \
-                         *.java \
-                         *.ii \
-                         *.ixx \
-                         *.ipp \
-                         *.i++ \
-                         *.inl \
-                         *.h \
-                         *.hh \
-                         *.hxx \
-                         *.hpp \
-                         *.h++ \
-                         *.idl \
-                         *.odl \
-                         *.cs \
-                         *.php \
-                         *.php3 \
-                         *.inc \
-                         *.m \
-                         *.mm \
-                         *.dox \
-                         *.py \
-                         *.f90 \
-                         *.f \
-                         *.vhd \
-                         *.vhdl \
-                         *.h.in \
-                         *.h.default
-
-# 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                = ../doxy \
-                         ../test \
-                         ../Xcode \
-                         ../VisualC \
-                         ../VisualCE \
-                         ../Xcode-iOS
-
-# 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. Note that the wildcards are matched 
-# against the file with absolute path, so to exclude all test directories 
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
-# (namespaces, classes, functions, etc.) that should be excluded from the 
-# output. The symbol name can be a fully qualified name, a word, or if the 
-# wildcard * is used, a substring. Examples: ANamespace, AClass, 
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS        = 
-
-# 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      = YES
-
-# 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.  If FILTER_PATTERNS is specified, this tag will be 
-# ignored.
-
-INPUT_FILTER           = 
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
-# basis.  Doxygen will compare the file name with each pattern and apply the 
-# filter if there is a match.  The filters are a list of the form: 
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
-# is applied to all files.
-
-FILTER_PATTERNS        = 
-
-# 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. 
-# Note: To get rid of all source code in the generated output, make sure also 
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER         = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body 
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES         = YES
-
-# 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    = NO
-
-# If the REFERENCED_BY_RELATION tag is set to YES 
-# 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 
-# then for each documented function all documented entities 
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = YES
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 
-# link to the source code.  Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code 
-# will point to the HTML generated by the htags(1) tool instead of doxygen 
-# built-in source browser. The htags tool is part of GNU's global source 
-# tagging system (see http://www.gnu.org/software/global/global.html). You 
-# will need version 4.8.6 or higher.
-
-USE_HTAGS              = 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
-
-#---------------------------------------------------------------------------
-# 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          = SDL_ \
-                         SDL
-
-#---------------------------------------------------------------------------
-# 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. Note that doxygen will try to copy 
-# the style sheet file to the HTML output directory, so don't put your own 
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-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 HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
-# documentation will contain sections that can be hidden and shown after the 
-# page has loaded. For this to work a browser that supports 
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS  = YES
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files 
-# will be generated that can be used as input for Apple's Xcode 3 
-# integrated development environment, introduced with OSX 10.5 (Leopard). 
-# To create a documentation set, doxygen will generate a Makefile in the 
-# HTML output directory. Running make will produce the docset in that 
-# directory and running "make install" will install the docset in 
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
-# it at startup. 
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET        = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
-# feed. A documentation feed provides an umbrella under which multiple 
-# documentation sets from a single provider (such as a company or product suite) 
-# can be grouped.
-
-DOCSET_FEEDNAME        = "SDL 2.0 Doxygen"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
-# should uniquely identify the documentation set bundle. This should be a 
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID       = org.libsdl.sdl20
-
-# 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 compiled 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 directory.
-
-CHM_FILE               = ./sdl20.chm
-
-# 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 CHM_INDEX_ENCODING 
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file 
-# content.
-
-CHM_INDEX_ENCODING     = 
-
-# 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             = YES
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 
-# are set, an additional index file will be generated that can be used as input for 
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 
-# HTML documentation.
-
-GENERATE_QHP           = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
-# be used to specify the file name of the resulting .qch file. 
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE               = 
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating 
-# Qt Help Project output. For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE          = 
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
-# Qt Help Project output. For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER     = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 
-# For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME   = 
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS  = 
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 
-# filter section matches. 
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS  = 
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
-# be used to specify the location of Qt's qhelpgenerator. 
-# If non-empty doxygen will try to run qhelpgenerator on the generated 
-# .qhp file.
-
-QHG_LOCATION           = 
-
-# 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   = 1
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 
-# structure should be generated to display hierarchical information. 
-# If the tag value is set to FRAME, 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, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
-# probably better off using the HTML help feature. Other possible values 
-# for this tag are: HIERARCHIES, which will generate the Groups, Directories, 
-# and Class Hierarchy pages using a tree view instead of an ordered list; 
-# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which 
-# disables this behavior completely. For backwards compatibility with previous 
-# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE 
-# respectively.
-
-GENERATE_TREEVIEW      = ALL
-
-# 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
-
-# Use this tag to change the font size of Latex formulas included 
-# as images in the HTML documentation. The default is 10. Note that 
-# when you change the font size after a successful doxygen run you need 
-# to manually remove any form_*.png images from the HTML output directory 
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE       = 10
-
-#---------------------------------------------------------------------------
-# 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         = NO
-
-# 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         = YES
-
-# 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           = YES
-
-# 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
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
-# include the index chapters (such as File Index, Compound Index, etc.) 
-# in the output.
-
-LATEX_HIDE_INDICES     = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE      = 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 assignments. 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.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML 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 `xml' will be used as the default path.
-
-XML_OUTPUT             = xml
-
-# 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                = 
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
-# dump the program listings (including syntax highlighting 
-# and cross-referencing information) to the XML output. Note that 
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# 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_DEFINED 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. To prevent a macro definition from being 
-# undefined via #undef or recursively expanded use the := operator 
-# instead of the = operator.
-
-PREDEFINED             = DOXYGEN_SHOULD_IGNORE_THIS=1 \
-                         DECLSPEC= \
-                         SDLCALL= \
-                         _WIN32=1
-
-# 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      = 
-
-# 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::additions related to external references   
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles. 
-# Optionally an initial location of the external documentation 
-# can be added for each tagfile. The format of a tag file without 
-# this location is as follows: 
-#   TAGFILES = file1 file2 ... 
-# Adding location for the tag files is done as follows: 
-#   TAGFILES = file1=loc1 "file2 = loc2" ... 
-# where "loc1" and "loc2" can be relative or absolute paths or 
-# URLs. If a location is present for each tag, the installdox tool 
-# does not have to be run to correct the links. 
-# Note that each tag file must have a unique name 
-# (where the name does NOT include the path) 
-# If a tag file is not located in the directory in which doxygen 
-# is run, you must also specify the path to the tagfile here.
-
-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       = ./SDL.tag
-
-# 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              = c:\Perl\bin\perl.exe
-
-#---------------------------------------------------------------------------
-# 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 superseded by the HAVE_DOT option below. This is only a 
-# fallback. It is recommended to install and use dot, since it yields more 
-# powerful graphs.
-
-CLASS_DIAGRAMS         = YES
-
-# You can define message sequence charts within doxygen comments using the \msc 
-# command. Doxygen will then run the mscgen tool (see 
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
-# the mscgen tool resides. If left empty the tool is assumed to be found in the 
-# default search path.
-
-MSCGEN_PATH            = 
-
-# 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               = YES
-
-# By default doxygen will write a font called FreeSans.ttf to the output 
-# directory and reference it in all dot files that doxygen generates. This 
-# font does not include all possible unicode characters however, so when you need 
-# these (or just want a differently looking font) you can specify the font name 
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font, 
-# which can be done by putting it in a standard location or by setting the 
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 
-# containing the font.
-
-DOT_FONTNAME           = FreeSans
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 
-# The default size is 10pt.
-
-DOT_FONTSIZE           = 10
-
-# By default doxygen will tell dot to use the output directory to look for the 
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a 
-# different font using DOT_FONTNAME you can set the path where dot 
-# can find it using this tag.
-
-DOT_FONTPATH           = 
-
-# 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 the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
-# collaboration diagrams in a style similar to the OMG's Unified Modeling 
-# Language.
-
-UML_LOOK               = NO
-
-# 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 CALL_GRAPH and HAVE_DOT options are set to YES then 
-# doxygen will generate a call dependency graph for every global function 
-# or class method. Note that enabling this option will significantly increase 
-# the time of a run. So in most cases it will be better to enable call graphs 
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
-# doxygen will generate a caller dependency graph for every global function 
-# or class method. Note that enabling this option will significantly increase 
-# the time of a run. So in most cases it will be better to enable caller 
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH           = NO
-
-# 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
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
-# then doxygen will show the dependencies a directory has on other directories 
-# in a graphical way. The dependency relations are determined by the #include 
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH        = 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 in 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 DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
-# nodes that will be shown in the graph. If the number of nodes in a graph 
-# becomes larger than this value, doxygen will truncate the graph, which is 
-# visualized by representing a node as a red box. Note that doxygen if the 
-# number of direct children of the root node in a graph is already larger than 
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES    = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
-# graphs generated by dot. A depth value of 3 means that only nodes reachable 
-# from the root by following a path via at most 3 edges will be shown. Nodes 
-# that lay further from the root node will be omitted. Note that setting this 
-# option to 1 or 2 may greatly reduce the computation time needed for large 
-# code bases. Also note that the size of a graph can be further restricted by 
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH    = 2
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
-# background. This is disabled by default, because dot on Windows does not 
-# seem to support this out of the box. Warning: Depending on the platform used, 
-# enabling this option may lead to badly anti-aliased labels on the edges of 
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT        = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
-# files in one run (i.e. multiple -o and -T options on the command line). This 
-# makes dot run faster, but since only newer versions of dot (>1.8.10) 
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS      = YES
-
-# 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 intermediate dot files that are used to generate 
-# the various graphs.
-
-DOT_CLEANUP            = YES
-
-#---------------------------------------------------------------------------
-# Options 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
diff --git a/deps/SDL2/libtool b/deps/SDL2/libtool
deleted file mode 100755
index 9d050e8..0000000
--- a/deps/SDL2/libtool
+++ /dev/null
@@ -1,10243 +0,0 @@
-#! /bin/bash
-
-# libtool - Provide generalized library-building support services.
-# Generated automatically by config.status () 
-# Libtool was configured on host andy-bx:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags="CXX "
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Which release of libtool.m4 was used?
-macro_version=2.4.2
-macro_revision=1.3337
-
-# Assembler program.
-AS="as"
-
-# DLL creation program.
-DLLTOOL="false"
-
-# Object dumper program.
-OBJDUMP="objdump"
-
-# Whether or not to build shared libraries.
-build_libtool_libs=no
-
-# Whether or not to build static libraries.
-build_old_libs=yes
-
-# What type of objects to build.
-pic_mode=yes
-
-# Whether or not to optimize for fast installation.
-fast_install=needless
-
-# Shell to use when invoking shell scripts.
-SHELL="/bin/bash"
-
-# An echo program that protects backslashes.
-ECHO="printf %s\\n"
-
-# The PATH separator for the build system.
-PATH_SEPARATOR=":"
-
-# The host system.
-host_alias=
-host=x86_64-unknown-linux-gnu
-host_os=linux-gnu
-
-# The build system.
-build_alias=
-build=x86_64-unknown-linux-gnu
-build_os=linux-gnu
-
-# A sed program that does not truncate output.
-SED="/bin/sed"
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP="/bin/grep"
-
-# An ERE matcher.
-EGREP="/bin/grep -E"
-
-# A literal string matcher.
-FGREP="/bin/grep -F"
-
-# A BSD- or MS-compatible name lister.
-NM="/usr/bin/nm -B"
-
-# Whether we need soft or hard links.
-LN_S="ln -s"
-
-# What is the maximum length of a command?
-max_cmd_len=3458764513820540925
-
-# Object file suffix (normally "o").
-objext=o
-
-# Executable file suffix (normally "").
-exeext=
-
-# whether the shell understands "unset".
-lt_unset=unset
-
-# turn spaces into newlines.
-SP2NL="tr \\040 \\012"
-
-# turn newlines into spaces.
-NL2SP="tr \\015\\012 \\040\\040"
-
-# convert $build file names to $host format.
-to_host_file_cmd=func_convert_file_noop
-
-# convert $build files to toolchain format.
-to_tool_file_cmd=func_convert_file_noop
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method="pass_all"
-
-# Command to use when deplibs_check_method = "file_magic".
-file_magic_cmd="\$MAGIC_CMD"
-
-# How to find potential files when deplibs_check_method = "file_magic".
-file_magic_glob=""
-
-# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-want_nocaseglob="no"
-
-# Command to associate shared and link libraries.
-sharedlib_from_linklib_cmd="printf %s\\n"
-
-# The archiver.
-AR="ar"
-
-# Flags to create an archive.
-AR_FLAGS="cru"
-
-# How to feed a file listing to the archiver.
-archiver_list_spec="@"
-
-# A symbol stripping program.
-STRIP="strip"
-
-# Commands used to install an old-style archive.
-RANLIB="ranlib"
-old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
-old_postuninstall_cmds=""
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=no
-
-# A C compiler.
-LTCC="gcc"
-
-# LTCC compiler flags.
-LTCFLAGS="-g -O2 -Iinclude -I/home/andy/dev/libgroove/deps/SDL2/include "
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe="sed -n -e 's/^.*[	 ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[	 ][	 ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p'"
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"lib\\2\", (void *) \\&\\2},/p'"
-
-# Specify filename containing input files for $NM.
-nm_file_list_spec="@"
-
-# The root where to search for dependent libraries,and in which our libraries should be installed.
-lt_sysroot=
-
-# The name of the directory that contains temporary libtool files.
-objdir=.libs
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=file
-
-# Must we lock files when doing compilation?
-need_locks="no"
-
-# Manifest tool.
-MANIFEST_TOOL=":"
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=""
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=""
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=""
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=""
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=""
-
-# Old archive suffix (normally "a").
-libext=a
-
-# Shared library suffix (normally ".so").
-shrext_cmds=".so"
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=""
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=no
-
-# Do we need a version for libraries?
-need_version=no
-
-# Library versioning type.
-version_type=linux
-
-# Shared library runtime path variable.
-runpath_var=LD_RUN_PATH
-
-# Shared library path variable.
-shlibpath_var=LD_LIBRARY_PATH
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=no
-
-# Format of library name prefix.
-libname_spec="lib\$name"
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
-
-# The coded name of the library, if different from the real name.
-soname_spec="\${libname}\${release}\${shared_ext}\$major"
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=""
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=""
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=""
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=""
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=yes
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/4.8 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib "
-
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/lib/nvidia-settings-319-updates /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa-egl /usr/lib/nvidia-319-updates /usr/lib32/nvidia-319-updates "
-
-# Whether dlopen is supported.
-dlopen_support=unknown
-
-# Whether dlopen of programs is supported.
-dlopen_self=unknown
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=unknown
-
-# Commands to strip libraries.
-old_striplib="strip --strip-debug"
-striplib="strip --strip-unneeded"
-
-
-# The linker used to build libraries.
-LD="/usr/bin/ld -m elf_x86_64"
-
-# How to create reloadable object files.
-reload_flag=" -r"
-reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
-
-# Commands used to build an old-style archive.
-old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
-
-# A language specific compiler.
-CC="gcc"
-
-# Is the compiler the GNU compiler?
-with_gcc=yes
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=" -fno-builtin"
-
-# Additional compiler flags for building library objects.
-pic_flag=" -fPIC -DPIC"
-
-# How to pass a linker flag through the compiler.
-wl="-Wl,"
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag="-static"
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o="yes"
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=yes
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=no
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec="\${wl}--export-dynamic"
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object="no"
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=""
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=""
-
-# Commands used to build a shared archive.
-archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
-archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
-	    cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
-	    echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
-	    \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=""
-module_expsym_cmds=""
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld="yes"
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=""
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=""
-
-# Flag to hardcode $libdir into a binary during linking.
-# This must work even if $libdir does not exist
-hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=""
-
-# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=no
-
-# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=no
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=no
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=unsupported
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=no
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=no
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=unknown
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=no
-
-# The commands to list exported symbols.
-export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
-
-# Symbols that must always be exported.
-include_expsyms=""
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=""
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=""
-
-# Specify filename containing input files.
-file_list_spec=""
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=immediate
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=""
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=""
-postdep_objects=""
-predeps=""
-postdeps=""
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=""
-
-# ### END LIBTOOL CONFIG
-
-
-# libtool (GNU libtool) 2.4.2
-# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-#       --config             show all configuration variables
-#       --debug              enable verbose shell tracing
-#   -n, --dry-run            display commands without modifying any files
-#       --features           display basic configuration information and exit
-#       --mode=MODE          use operation mode MODE
-#       --preserve-dup-deps  don't remove duplicate dependency libraries
-#       --quiet, --silent    don't print informational messages
-#       --no-quiet, --no-silent
-#                            print informational messages (default)
-#       --no-warn            don't display warning messages
-#       --tag=TAG            use configuration variables from tag TAG
-#   -v, --verbose            print more informational messages than default
-#       --no-verbose         don't print the extra informational messages
-#       --version            print version information
-#   -h, --help, --help-all   print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-#         clean              remove files from the build directory
-#         compile            compile a source file into a libtool object
-#         execute            automatically set library path, then run a program
-#         finish             complete the installation of libtool libraries
-#         install            install libraries or executables
-#         link               create a library or an executable
-#         uninstall          remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.  When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-#         host-triplet:	$host
-#         shell:		$SHELL
-#         compiler:		$LTCC
-#         compiler flags:		$LTCFLAGS
-#         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2
-#         automake:	$automake_version
-#         autoconf:	$autoconf_version
-#
-# Report bugs to <bug-libtool at gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
-
-PROGRAM=libtool
-PACKAGE=libtool
-VERSION=2.4.2
-TIMESTAMP=""
-package_revision=1.3337
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
-  eval "if test \"\${$lt_var+set}\" = set; then
-          save_$lt_var=\$$lt_var
-          $lt_var=C
-	  export $lt_var
-	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
-	fi"
-done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
-
-$lt_unset CDPATH
-
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-
-
-: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
-
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-} # Extended-shell func_dirname implementation
-
-
-# func_basename file
-func_basename ()
-{
-    func_basename_result="${1##*/}"
-} # Extended-shell func_basename implementation
-
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-    func_basename_result="${1##*/}"
-} # Extended-shell func_dirname_and_basename implementation
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary parameter first.
-    func_stripname_result=${3}
-    func_stripname_result=${func_stripname_result#"${1}"}
-    func_stripname_result=${func_stripname_result%"${2}"}
-} # Extended-shell func_stripname implementation
-
-
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
-		s@/\./@/@g
-		t dotsl
-		s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
-
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-#             value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
-  # Start from root dir and reassemble the path.
-  func_normal_abspath_result=
-  func_normal_abspath_tpath=$1
-  func_normal_abspath_altnamespace=
-  case $func_normal_abspath_tpath in
-    "")
-      # Empty path, that just means $cwd.
-      func_stripname '' '/' "`pwd`"
-      func_normal_abspath_result=$func_stripname_result
-      return
-    ;;
-    # The next three entries are used to spot a run of precisely
-    # two leading slashes without using negated character classes;
-    # we take advantage of case's first-match behaviour.
-    ///*)
-      # Unusual form of absolute path, do nothing.
-    ;;
-    //*)
-      # Not necessarily an ordinary path; POSIX reserves leading '//'
-      # and for example Cygwin uses it to access remote file shares
-      # over CIFS/SMB, so we conserve a leading double slash if found.
-      func_normal_abspath_altnamespace=/
-    ;;
-    /*)
-      # Absolute path, do nothing.
-    ;;
-    *)
-      # Relative path, prepend $cwd.
-      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-    ;;
-  esac
-  # Cancel out all the simple stuff to save iterations.  We also want
-  # the path to end with a slash for ease of parsing, so make sure
-  # there is one (and only one) here.
-  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
-  while :; do
-    # Processed it all yet?
-    if test "$func_normal_abspath_tpath" = / ; then
-      # If we ascended to the root using ".." the result may be empty now.
-      if test -z "$func_normal_abspath_result" ; then
-        func_normal_abspath_result=/
-      fi
-      break
-    fi
-    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcar"`
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcdr"`
-    # Figure out what to do with it
-    case $func_normal_abspath_tcomponent in
-      "")
-        # Trailing empty path component, ignore it.
-      ;;
-      ..)
-        # Parent dir; strip last assembled component from result.
-        func_dirname "$func_normal_abspath_result"
-        func_normal_abspath_result=$func_dirname_result
-      ;;
-      *)
-        # Actual path component, append it.
-        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
-      ;;
-    esac
-  done
-  # Restore leading double-slash if one was found on entry.
-  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
-
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-#             value returned in "$func_relative_path_result"
-func_relative_path ()
-{
-  func_relative_path_result=
-  func_normal_abspath "$1"
-  func_relative_path_tlibdir=$func_normal_abspath_result
-  func_normal_abspath "$2"
-  func_relative_path_tbindir=$func_normal_abspath_result
-
-  # Ascend the tree starting from libdir
-  while :; do
-    # check if we have found a prefix of bindir
-    case $func_relative_path_tbindir in
-      $func_relative_path_tlibdir)
-        # found an exact match
-        func_relative_path_tcancelled=
-        break
-        ;;
-      $func_relative_path_tlibdir*)
-        # found a matching prefix
-        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-        func_relative_path_tcancelled=$func_stripname_result
-        if test -z "$func_relative_path_result"; then
-          func_relative_path_result=.
-        fi
-        break
-        ;;
-      *)
-        func_dirname $func_relative_path_tlibdir
-        func_relative_path_tlibdir=${func_dirname_result}
-        if test "x$func_relative_path_tlibdir" = x ; then
-          # Have to descend all the way to the root!
-          func_relative_path_result=../$func_relative_path_result
-          func_relative_path_tcancelled=$func_relative_path_tbindir
-          break
-        fi
-        func_relative_path_result=../$func_relative_path_result
-        ;;
-    esac
-  done
-
-  # Now calculate path; take care to avoid doubling-up slashes.
-  func_stripname '' '/' "$func_relative_path_result"
-  func_relative_path_result=$func_stripname_result
-  func_stripname '/' '/' "$func_relative_path_tcancelled"
-  if test "x$func_stripname_result" != x ; then
-    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
-  fi
-
-  # Normalisation. If bindir is libdir, return empty string,
-  # else relative path ending with a slash; either way, target
-  # file name can be directly appended.
-  if test ! -z "$func_relative_path_result"; then
-    func_stripname './' '' "$func_relative_path_result/"
-    func_relative_path_result=$func_stripname_result
-  fi
-}
-
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
-  [\\/]*|[A-Za-z]:\\*) ;;
-  *[\\/]*)
-     progdir=$func_dirname_result
-     progdir=`cd "$progdir" && pwd`
-     progpath="$progdir/$progname"
-     ;;
-  *)
-     save_IFS="$IFS"
-     IFS=${PATH_SEPARATOR-:}
-     for progdir in $PATH; do
-       IFS="$save_IFS"
-       test -x "$progdir/$progname" && break
-     done
-     IFS="$save_IFS"
-     test -n "$progdir" || progdir=`pwd`
-     progpath="$progdir/$progname"
-     ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
-
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
-  s/$bs4/&\\
-/g
-  s/^$bs2$dollar/$bs&/
-  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
-  s/\n//g"
-
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
-
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
-
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
-
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
-
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
-
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
-    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
-
-    # bash bug again:
-    :
-}
-
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
-
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    func_error ${1+"$@"}
-    func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information."  ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
-    $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_mkdir_p directory-path
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
-    my_directory_path="$1"
-    my_dir_list=
-
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
-
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
-      esac
-
-      # While some portion of DIR does not yet exist...
-      while test ! -d "$my_directory_path"; do
-        # ...make a list in topmost first order.  Use a colon delimited
-	# list incase some portion of path contains whitespace.
-        my_dir_list="$my_directory_path:$my_dir_list"
-
-        # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
-
-        # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
-      done
-      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
-
-      save_mkdir_p_IFS="$IFS"; IFS=':'
-      for my_dir in $my_dir_list; do
-	IFS="$save_mkdir_p_IFS"
-        # mkdir can fail with a `File exist' error if two processes
-        # try to create one of the directories concurrently.  Don't
-        # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
-      done
-      IFS="$save_mkdir_p_IFS"
-
-      # Bail out if we (or some other process) failed to create a directory.
-      test -d "$my_directory_path" || \
-        func_fatal_error "Failed to create \`$1'"
-    fi
-}
-
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
-
-    if test "$opt_dry_run" = ":"; then
-      # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
-    else
-
-      # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
-      if test ! -d "$my_tmpdir"; then
-        # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
-
-        save_mktempdir_umask=`umask`
-        umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_mktempdir_umask
-      fi
-
-      # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || \
-        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
-    fi
-
-    $ECHO "$my_tmpdir"
-}
-
-
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
-{
-    case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
-      *)
-        func_quote_for_eval_unquoted_result="$1" ;;
-    esac
-
-    case $func_quote_for_eval_unquoted_result in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting, command substitution and and variable
-      # expansion for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
-        ;;
-      *)
-        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
-    esac
-}
-
-
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
-    case $1 in
-      *[\\\`\"]*)
-	my_arg=`$ECHO "$1" | $SED \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        my_arg="$1" ;;
-    esac
-
-    case $my_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        my_arg="\"$my_arg\""
-        ;;
-    esac
-
-    func_quote_for_expand_result="$my_arg"
-}
-
-
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
-
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
-
-    if ${opt_dry_run-false}; then :; else
-      eval "$my_cmd"
-      my_status=$?
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
-
-
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
-
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
-
-    if ${opt_dry_run-false}; then :; else
-      eval "$lt_user_locale
-	    $my_cmd"
-      my_status=$?
-      eval "$lt_safe_locale"
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
-
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result.  All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
-  case $1 in
-  [0-9]* | *[!a-zA-Z0-9_]*)
-    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
-    ;;
-  * )
-    func_tr_sh_result=$1
-    ;;
-  esac
-}
-
-
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
-    $opt_debug
-
-    $SED -n '/(C)/!b go
-	:more
-	/\./!{
-	  N
-	  s/\n# / /
-	  b more
-	}
-	:go
-	/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //
-	s/^# *$//
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
-        p
-     }' < "$progpath"
-     exit $?
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    echo
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
-}
-
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
-func_help ()
-{
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/# Report bugs to/ {
-	:print
-        s/^# //
-	s/^# *$//
-	s*\$progname*'$progname'*
-	s*\$host*'"$host"'*
-	s*\$SHELL*'"$SHELL"'*
-	s*\$LTCC*'"$LTCC"'*
-	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-	s*\$LD*'"$LD"'*
-	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
-	p
-	d
-     }
-     /^# .* home page:/b print
-     /^# General help using/b print
-     ' < "$progpath"
-    ret=$?
-    if test -z "$1"; then
-      exit $ret
-    fi
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
-    $opt_debug
-
-    func_error "missing argument for $1."
-    exit_cmd=exit
-}
-
-
-# func_split_short_opt shortopt
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
-{
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
-} # Extended-shell func_split_short_opt implementation
-
-
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
-{
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}
-} # Extended-shell func_split_long_opt implementation
-
-exit_cmd=:
-
-
-
-
-
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
-
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-    eval "${1}+=\${2}"
-} # Extended-shell func_append implementation
-
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
-    func_quote_for_eval "${2}"
-    eval "${1}+=\\ \$func_quote_for_eval_result"
-} # Extended-shell func_append_quoted implementation
-
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-    func_arith_result=$(( $* ))
-} # Extended-shell func_arith implementation
-
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-    func_len_result=${#1}
-} # Extended-shell func_len implementation
-
-
-# func_lo2o object
-func_lo2o ()
-{
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac
-} # Extended-shell func_lo2o implementation
-
-
-# func_xform libobj-or-source
-func_xform ()
-{
-    func_xform_result=${1%.*}.lo
-} # Extended-shell func_xform implementation
-
-
-# func_fatal_configuration arg...
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
-    func_error ${1+"$@"}
-    func_error "See the $PACKAGE documentation for more information."
-    func_fatal_error "Fatal configuration error."
-}
-
-
-# func_config
-# Display the configuration for all the tags in this script.
-func_config ()
-{
-    re_begincf='^# ### BEGIN LIBTOOL'
-    re_endcf='^# ### END LIBTOOL'
-
-    # Default configuration.
-    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
-    # Now print the configurations for the tags.
-    for tagname in $taglist; do
-      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
-    done
-
-    exit $?
-}
-
-# func_features
-# Display the features supported by this script.
-func_features ()
-{
-    echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
-      echo "enable shared libraries"
-    else
-      echo "disable shared libraries"
-    fi
-    if test "$build_old_libs" = yes; then
-      echo "enable static libraries"
-    else
-      echo "disable static libraries"
-    fi
-
-    exit $?
-}
-
-# func_enable_tag tagname
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
-  # Global variable:
-  tagname="$1"
-
-  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-  sed_extractcf="/$re_begincf/,/$re_endcf/p"
-
-  # Validate tagname.
-  case $tagname in
-    *[!-_A-Za-z0-9,/]*)
-      func_fatal_error "invalid tag name: $tagname"
-      ;;
-  esac
-
-  # Don't test for the "default" C tag, as we know it's
-  # there but not specially marked.
-  case $tagname in
-    CC) ;;
-    *)
-      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	taglist="$taglist $tagname"
-
-	# Evaluate the configuration.  Be careful to quote the path
-	# and the sed script, to avoid splitting on whitespace, but
-	# also don't use non-portable quotes within backquotes within
-	# quotes we have to do it in 2 steps:
-	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	eval "$extractedcf"
-      else
-	func_error "ignoring unknown tag $tagname"
-      fi
-      ;;
-  esac
-}
-
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      else
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
-    fi
-
-    exit $EXIT_MISMATCH
-  fi
-}
-
-
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
-  shift; set dummy --mode clean ${1+"$@"}; shift
-  ;;
-compile|compil|compi|comp|com|co|c)
-  shift; set dummy --mode compile ${1+"$@"}; shift
-  ;;
-execute|execut|execu|exec|exe|ex|e)
-  shift; set dummy --mode execute ${1+"$@"}; shift
-  ;;
-finish|finis|fini|fin|fi|f)
-  shift; set dummy --mode finish ${1+"$@"}; shift
-  ;;
-install|instal|insta|inst|ins|in|i)
-  shift; set dummy --mode install ${1+"$@"}; shift
-  ;;
-link|lin|li|l)
-  shift; set dummy --mode link ${1+"$@"}; shift
-  ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-  shift; set dummy --mode uninstall ${1+"$@"}; shift
-  ;;
-esac
-
-
-
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
-
-
-# Parse options once, thoroughly.  This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
-{
-  # this just eases exit handling
-  while test $# -gt 0; do
-    opt="$1"
-    shift
-    case $opt in
-      --debug|-x)	opt_debug='set -x'
-			func_echo "enabling shell trace mode"
-			$opt_debug
-			;;
-      --dry-run|--dryrun|-n)
-			opt_dry_run=:
-			;;
-      --config)
-			opt_config=:
-func_config
-			;;
-      --dlopen|-dlopen)
-			optarg="$1"
-			opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
-			shift
-			;;
-      --preserve-dup-deps)
-			opt_preserve_dup_deps=:
-			;;
-      --features)
-			opt_features=:
-func_features
-			;;
-      --finish)
-			opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
-			;;
-      --help)
-			opt_help=:
-			;;
-      --help-all)
-			opt_help_all=:
-opt_help=': help-all'
-			;;
-      --mode)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_mode="$optarg"
-case $optarg in
-  # Valid mode arguments:
-  clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-  # Catch anything else as an error
-  *) func_error "invalid argument for $opt"
-     exit_cmd=exit
-     break
-     ;;
-esac
-			shift
-			;;
-      --no-silent|--no-quiet)
-			opt_silent=false
-preserve_args+=" $opt"
-			;;
-      --no-warning|--no-warn)
-			opt_warning=false
-preserve_args+=" $opt"
-			;;
-      --no-verbose)
-			opt_verbose=false
-preserve_args+=" $opt"
-			;;
-      --silent|--quiet)
-			opt_silent=:
-preserve_args+=" $opt"
-        opt_verbose=false
-			;;
-      --verbose|-v)
-			opt_verbose=:
-preserve_args+=" $opt"
-opt_silent=false
-			;;
-      --tag)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_tag="$optarg"
-preserve_args+=" $opt $optarg"
-func_enable_tag "$optarg"
-			shift
-			;;
-
-      -\?|-h)		func_usage				;;
-      --help)		func_help				;;
-      --version)	func_version				;;
-
-      # Separate optargs to long options:
-      --*=*)
-			func_split_long_opt "$opt"
-			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      # Separate non-argument short options:
-      -\?*|-h*|-n*|-v*)
-			func_split_short_opt "$opt"
-			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      --)		break					;;
-      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
-      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
-    esac
-  done
-
-  # Validate options:
-
-  # save first non-option argument
-  if test "$#" -gt 0; then
-    nonopt="$opt"
-    shift
-  fi
-
-  # preserve --debug
-  test "$opt_debug" = : || preserve_args+=" --debug"
-
-  case $host in
-    *cygwin* | *mingw* | *pw32* | *cegcc*)
-      # don't eliminate duplications in $postdeps and $predeps
-      opt_duplicate_compiler_generated_deps=:
-      ;;
-    *)
-      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-      ;;
-  esac
-
-  $opt_help || {
-    # Sanity checks first:
-    func_check_version_match
-
-    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-      func_fatal_configuration "not configured to build any kind of library"
-    fi
-
-    # Darwin sucks
-    eval std_shrext=\"$shrext_cmds\"
-
-    # Only execute mode is allowed to have -dlopen flags.
-    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
-      func_error "unrecognized option \`-dlopen'"
-      $ECHO "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    # Change the help message to a mode-specific one.
-    generic_help="$help"
-    help="Try \`$progname --help --mode=$opt_mode' for more information."
-  }
-
-
-  # Bail if the options were screwed
-  $exit_cmd $EXIT_FAILURE
-}
-
-
-
-
-## ----------- ##
-##    Main.    ##
-## ----------- ##
-
-# func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
-    test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null \
-        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs.  To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if `file' does not exist.
-func_lalib_unsafe_p ()
-{
-    lalib_p=no
-    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
-	for lalib_p_l in 1 2 3 4
-	do
-	    read lalib_p_line
-	    case "$lalib_p_line" in
-		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
-	    esac
-	done
-	exec 0<&5 5<&-
-    fi
-    test "$lalib_p" = yes
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
-    func_lalib_p "$1"
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
-    func_ltwrapper_exec_suffix=
-    case $1 in
-    *.exe) ;;
-    *) func_ltwrapper_exec_suffix=.exe ;;
-    esac
-    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
-    func_dirname_and_basename "$1" "" "."
-    func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
-    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
-    $opt_debug
-    save_ifs=$IFS; IFS='~'
-    for cmd in $1; do
-      IFS=$save_ifs
-      eval cmd=\"$cmd\"
-      func_show_eval "$cmd" "${2-:}"
-    done
-    IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
-    $opt_debug
-    case $1 in
-    */* | *\\*)	. "$1" ;;
-    *)		. "./$1" ;;
-    esac
-}
-
-
-# func_resolve_sysroot PATH
-# Replace a leading = in PATH with a sysroot.  Store the result into
-# func_resolve_sysroot_result
-func_resolve_sysroot ()
-{
-  func_resolve_sysroot_result=$1
-  case $func_resolve_sysroot_result in
-  =*)
-    func_stripname '=' '' "$func_resolve_sysroot_result"
-    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
-    ;;
-  esac
-}
-
-# func_replace_sysroot PATH
-# If PATH begins with the sysroot, replace it with = and
-# store the result into func_replace_sysroot_result.
-func_replace_sysroot ()
-{
-  case "$lt_sysroot:$1" in
-  ?*:"$lt_sysroot"*)
-    func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result="=$func_stripname_result"
-    ;;
-  *)
-    # Including no sysroot.
-    func_replace_sysroot_result=$1
-    ;;
-  esac
-}
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
-    $opt_debug
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-	func_append_quoted CC_quoted "$arg"
-      done
-      CC_expanded=`func_echo_all $CC`
-      CC_quoted_expanded=`func_echo_all $CC_quoted`
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-	for z in $available_tags; do
-	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
-	    CC_quoted=
-	    for arg in $CC; do
-	      # Double-quote args containing other shell metacharacters.
-	      func_append_quoted CC_quoted "$arg"
-	    done
-	    CC_expanded=`func_echo_all $CC`
-	    CC_quoted_expanded=`func_echo_all $CC_quoted`
-	    case "$@ " in
-	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
-	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with \`--tag'"
-#	else
-#	  func_verbose "using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
-{
-    write_libobj=${1}
-    if test "$build_libtool_libs" = yes; then
-      write_lobj=\'${2}\'
-    else
-      write_lobj=none
-    fi
-
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
-    else
-      write_oldobj=none
-    fi
-
-    $opt_dry_run || {
-      cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
-      $MV "${write_libobj}T" "${write_libobj}"
-    }
-}
-
-
-##################################################
-# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-##################################################
-
-# func_convert_core_file_wine_to_w32 ARG
-# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-# correctly configured wine environment available, with the winepath program
-# in $build's $PATH.
-#
-# ARG is the $build file name to be converted to w32 format.
-# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-# be empty on error (or when ARG is empty)
-func_convert_core_file_wine_to_w32 ()
-{
-  $opt_debug
-  func_convert_core_file_wine_to_w32_result="$1"
-  if test -n "$1"; then
-    # Unfortunately, winepath does not exit with a non-zero error code, so we
-    # are forced to check the contents of stdout. On the other hand, if the
-    # command is not found, the shell will set an exit code of 127 and print
-    # *an error message* to stdout. So we must check for both error code of
-    # zero AND non-empty stdout, which explains the odd construction:
-    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
-      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$lt_sed_naive_backslashify"`
-    else
-      func_convert_core_file_wine_to_w32_result=
-    fi
-  fi
-}
-# end: func_convert_core_file_wine_to_w32
-
-
-# func_convert_core_path_wine_to_w32 ARG
-# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
-#
-# ARG is path to be converted from $build format to win32.
-# Result is available in $func_convert_core_path_wine_to_w32_result.
-# Unconvertible file (directory) names in ARG are skipped; if no directory names
-# are convertible, then the result may be empty.
-func_convert_core_path_wine_to_w32 ()
-{
-  $opt_debug
-  # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=""
-  if test -n "$1"; then
-    oldIFS=$IFS
-    IFS=:
-    for func_convert_core_path_wine_to_w32_f in $1; do
-      IFS=$oldIFS
-      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
-        if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
-        else
-          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
-        fi
-      fi
-    done
-    IFS=$oldIFS
-  fi
-}
-# end: func_convert_core_path_wine_to_w32
-
-
-# func_cygpath ARGS...
-# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-# (2), returns the Cygwin file name or path in func_cygpath_result (input
-# file name or path is assumed to be in w32 format, as previously converted
-# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-# or path in func_cygpath_result (input file name or path is assumed to be in
-# Cygwin format). Returns an empty string on error.
-#
-# ARGS are passed to cygpath, with the last one being the file name or path to
-# be converted.
-#
-# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-# environment variable; do not put it in $PATH.
-func_cygpath ()
-{
-  $opt_debug
-  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
-    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
-    if test "$?" -ne 0; then
-      # on failure, ensure result is empty
-      func_cygpath_result=
-    fi
-  else
-    func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
-  fi
-}
-#end: func_cygpath
-
-
-# func_convert_core_msys_to_w32 ARG
-# Convert file name or path ARG from MSYS format to w32 format.  Return
-# result in func_convert_core_msys_to_w32_result.
-func_convert_core_msys_to_w32 ()
-{
-  $opt_debug
-  # awkward: cmd appends spaces to result
-  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
-}
-#end: func_convert_core_msys_to_w32
-
-
-# func_convert_file_check ARG1 ARG2
-# Verify that ARG1 (a file name in $build format) was converted to $host
-# format in ARG2. Otherwise, emit an error message, but continue (resetting
-# func_to_host_file_result to ARG1).
-func_convert_file_check ()
-{
-  $opt_debug
-  if test -z "$2" && test -n "$1" ; then
-    func_error "Could not determine host file name corresponding to"
-    func_error "  \`$1'"
-    func_error "Continuing, but uninstalled executables may not work."
-    # Fallback:
-    func_to_host_file_result="$1"
-  fi
-}
-# end func_convert_file_check
-
-
-# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-# Verify that FROM_PATH (a path in $build format) was converted to $host
-# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-# func_to_host_file_result to a simplistic fallback value (see below).
-func_convert_path_check ()
-{
-  $opt_debug
-  if test -z "$4" && test -n "$3"; then
-    func_error "Could not determine the host path corresponding to"
-    func_error "  \`$3'"
-    func_error "Continuing, but uninstalled executables may not work."
-    # Fallback.  This is a deliberately simplistic "conversion" and
-    # should not be "improved".  See libtool.info.
-    if test "x$1" != "x$2"; then
-      lt_replace_pathsep_chars="s|$1|$2|g"
-      func_to_host_path_result=`echo "$3" |
-        $SED -e "$lt_replace_pathsep_chars"`
-    else
-      func_to_host_path_result="$3"
-    fi
-  fi
-}
-# end func_convert_path_check
-
-
-# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-# and appending REPL if ORIG matches BACKPAT.
-func_convert_path_front_back_pathsep ()
-{
-  $opt_debug
-  case $4 in
-  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
-    ;;
-  esac
-  case $4 in
-  $2 ) func_to_host_path_result+="$3"
-    ;;
-  esac
-}
-# end func_convert_path_front_back_pathsep
-
-
-##################################################
-# $build to $host FILE NAME CONVERSION FUNCTIONS #
-##################################################
-# invoked via `$to_host_file_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# Result will be available in $func_to_host_file_result.
-
-
-# func_to_host_file ARG
-# Converts the file name ARG from $build format to $host format. Return result
-# in func_to_host_file_result.
-func_to_host_file ()
-{
-  $opt_debug
-  $to_host_file_cmd "$1"
-}
-# end func_to_host_file
-
-
-# func_to_tool_file ARG LAZY
-# converts the file name ARG from $build format to toolchain format. Return
-# result in func_to_tool_file_result.  If the conversion in use is listed
-# in (the comma separated) LAZY, no conversion takes place.
-func_to_tool_file ()
-{
-  $opt_debug
-  case ,$2, in
-    *,"$to_tool_file_cmd",*)
-      func_to_tool_file_result=$1
-      ;;
-    *)
-      $to_tool_file_cmd "$1"
-      func_to_tool_file_result=$func_to_host_file_result
-      ;;
-  esac
-}
-# end func_to_tool_file
-
-
-# func_convert_file_noop ARG
-# Copy ARG to func_to_host_file_result.
-func_convert_file_noop ()
-{
-  func_to_host_file_result="$1"
-}
-# end func_convert_file_noop
-
-
-# func_convert_file_msys_to_w32 ARG
-# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_file_result.
-func_convert_file_msys_to_w32 ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_w32
-
-
-# func_convert_file_cygwin_to_w32 ARG
-# Convert file name ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_file_cygwin_to_w32 ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
-    # LT_CYGPATH in this case.
-    func_to_host_file_result=`cygpath -m "$1"`
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_cygwin_to_w32
-
-
-# func_convert_file_nix_to_w32 ARG
-# Convert file name ARG from *nix to w32 format.  Requires a wine environment
-# and a working winepath. Returns result in func_to_host_file_result.
-func_convert_file_nix_to_w32 ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_w32
-
-
-# func_convert_file_msys_to_cygwin ARG
-# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_file_msys_to_cygwin ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    func_convert_core_msys_to_w32 "$1"
-    func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_cygwin
-
-
-# func_convert_file_nix_to_cygwin ARG
-# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
-# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
-# in func_to_host_file_result.
-func_convert_file_nix_to_cygwin ()
-{
-  $opt_debug
-  func_to_host_file_result="$1"
-  if test -n "$1"; then
-    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
-    func_convert_core_file_wine_to_w32 "$1"
-    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
-  fi
-  func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_cygwin
-
-
-#############################################
-# $build to $host PATH CONVERSION FUNCTIONS #
-#############################################
-# invoked via `$to_host_path_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# The result will be available in $func_to_host_path_result.
-#
-# Path separators are also converted from $build format to $host format.  If
-# ARG begins or ends with a path separator character, it is preserved (but
-# converted to $host format) on output.
-#
-# All path conversion functions are named using the following convention:
-#   file name conversion function    : func_convert_file_X_to_Y ()
-#   path conversion function         : func_convert_path_X_to_Y ()
-# where, for any given $build/$host combination the 'X_to_Y' value is the
-# same.  If conversion functions are added for new $build/$host combinations,
-# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-# will break.
-
-
-# func_init_to_host_path_cmd
-# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-# appropriate value, based on the value of $to_host_file_cmd.
-to_host_path_cmd=
-func_init_to_host_path_cmd ()
-{
-  $opt_debug
-  if test -z "$to_host_path_cmd"; then
-    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd="func_convert_path_${func_stripname_result}"
-  fi
-}
-
-
-# func_to_host_path ARG
-# Converts the path ARG from $build format to $host format. Return result
-# in func_to_host_path_result.
-func_to_host_path ()
-{
-  $opt_debug
-  func_init_to_host_path_cmd
-  $to_host_path_cmd "$1"
-}
-# end func_to_host_path
-
-
-# func_convert_path_noop ARG
-# Copy ARG to func_to_host_path_result.
-func_convert_path_noop ()
-{
-  func_to_host_path_result="$1"
-}
-# end func_convert_path_noop
-
-
-# func_convert_path_msys_to_w32 ARG
-# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper.  Returns result in
-# func_to_host_path_result.
-func_convert_path_msys_to_w32 ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # Remove leading and trailing path separator characters from ARG.  MSYS
-    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
-    # and winepath ignores them completely.
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_msys_to_w32
-
-
-# func_convert_path_cygwin_to_w32 ARG
-# Convert path ARG from Cygwin to w32 format.  Returns result in
-# func_to_host_file_result.
-func_convert_path_cygwin_to_w32 ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_cygwin_to_w32
-
-
-# func_convert_path_nix_to_w32 ARG
-# Convert path ARG from *nix to w32 format.  Requires a wine environment and
-# a working winepath.  Returns result in func_to_host_file_result.
-func_convert_path_nix_to_w32 ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
-    func_convert_path_check : ";" \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-  fi
-}
-# end func_convert_path_nix_to_w32
-
-
-# func_convert_path_msys_to_cygwin ARG
-# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_path_msys_to_cygwin ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # See func_convert_path_msys_to_w32:
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
-    func_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_msys_to_cygwin
-
-
-# func_convert_path_nix_to_cygwin ARG
-# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
-# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
-# func_to_host_file_result.
-func_convert_path_nix_to_cygwin ()
-{
-  $opt_debug
-  func_to_host_path_result="$1"
-  if test -n "$1"; then
-    # Remove leading and trailing path separator characters from
-    # ARG. msys behavior is inconsistent here, cygpath turns them
-    # into '.;' and ';.', and winepath ignores them completely.
-    func_stripname : : "$1"
-    func_to_host_path_tmp1=$func_stripname_result
-    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
-    func_convert_path_check : : \
-      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-  fi
-}
-# end func_convert_path_nix_to_cygwin
-
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
-    $opt_debug
-    # Get the compilation command and the source file.
-    base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
-    suppress_opt=yes
-    suppress_output=
-    arg_mode=normal
-    libobj=
-    later=
-    pie_flag=
-
-    for arg
-    do
-      case $arg_mode in
-      arg  )
-	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
-	arg_mode=normal
-	;;
-
-      target )
-	libobj="$arg"
-	arg_mode=normal
-	continue
-	;;
-
-      normal )
-	# Accept any command-line options.
-	case $arg in
-	-o)
-	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
-	  arg_mode=target
-	  continue
-	  ;;
-
-	-pie | -fpie | -fPIE)
-          pie_flag+=" $arg"
-	  continue
-	  ;;
-
-	-shared | -static | -prefer-pic | -prefer-non-pic)
-	  later+=" $arg"
-	  continue
-	  ;;
-
-	-no-suppress)
-	  suppress_opt=no
-	  continue
-	  ;;
-
-	-Xcompiler)
-	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
-	  continue      #  The current "srcfile" will either be retained or
-	  ;;            #  replaced later.  I would guess that would be a bug.
-
-	-Wc,*)
-	  func_stripname '-Wc,' '' "$arg"
-	  args=$func_stripname_result
-	  lastarg=
-	  save_ifs="$IFS"; IFS=','
-	  for arg in $args; do
-	    IFS="$save_ifs"
-	    func_append_quoted lastarg "$arg"
-	  done
-	  IFS="$save_ifs"
-	  func_stripname ' ' '' "$lastarg"
-	  lastarg=$func_stripname_result
-
-	  # Add the arguments to base_compile.
-	  base_compile+=" $lastarg"
-	  continue
-	  ;;
-
-	*)
-	  # Accept the current argument as the source file.
-	  # The previous "srcfile" becomes the current argument.
-	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
-	  ;;
-	esac  #  case $arg
-	;;
-      esac    #  case $arg_mode
-
-      # Aesthetically quote the previous argument.
-      func_append_quoted base_compile "$lastarg"
-    done # for arg
-
-    case $arg_mode in
-    arg)
-      func_fatal_error "you must specify an argument for -Xcompile"
-      ;;
-    target)
-      func_fatal_error "you must specify a target with \`-o'"
-      ;;
-    *)
-      # Get the name of the library object.
-      test -z "$libobj" && {
-	func_basename "$srcfile"
-	libobj="$func_basename_result"
-      }
-      ;;
-    esac
-
-    # Recognize several different file suffixes.
-    # If the user specifies -o file.o, it is replaced with file.lo
-    case $libobj in
-    *.[cCFSifmso] | \
-    *.ada | *.adb | *.ads | *.asm | \
-    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
-      func_xform "$libobj"
-      libobj=$func_xform_result
-      ;;
-    esac
-
-    case $libobj in
-    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
-    *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
-      ;;
-    esac
-
-    func_infer_tag $base_compile
-
-    for arg in $later; do
-      case $arg in
-      -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
-	build_old_libs=no
-	continue
-	;;
-
-      -static)
-	build_libtool_libs=no
-	build_old_libs=yes
-	continue
-	;;
-
-      -prefer-pic)
-	pic_mode=yes
-	continue
-	;;
-
-      -prefer-non-pic)
-	pic_mode=no
-	continue
-	;;
-      esac
-    done
-
-    func_quote_for_eval "$libobj"
-    test "X$libobj" != "X$func_quote_for_eval_result" \
-      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name \`$libobj' may not contain shell special characters."
-    func_dirname_and_basename "$obj" "/" ""
-    objname="$func_basename_result"
-    xdir="$func_dirname_result"
-    lobj=${xdir}$objdir/$objname
-
-    test -z "$base_compile" && \
-      func_fatal_help "you must specify a compilation command"
-
-    # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
-      removelist="$obj $lobj $libobj ${libobj}T"
-    else
-      removelist="$lobj $libobj ${libobj}T"
-    fi
-
-    # On Cygwin there's no "real" PIC flag so we must build both object types
-    case $host_os in
-    cygwin* | mingw* | pw32* | os2* | cegcc*)
-      pic_mode=default
-      ;;
-    esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
-      # non-PIC code in shared libraries is not supported
-      pic_mode=default
-    fi
-
-    # Calculate the filename of the output object if compiler does
-    # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
-    else
-      output_obj=
-      need_locks=no
-      lockfile=
-    fi
-
-    # Lock this critical section if it is needed
-    # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
-      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-	func_echo "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    elif test "$need_locks" = warn; then
-      if test -f "$lockfile"; then
-	$ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-      removelist+=" $output_obj"
-      $ECHO "$srcfile" > "$lockfile"
-    fi
-
-    $opt_dry_run || $RM $removelist
-    removelist+=" $lockfile"
-    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
-    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
-    srcfile=$func_to_tool_file_result
-    func_quote_for_eval "$srcfile"
-    qsrcfile=$func_quote_for_eval_result
-
-    # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
-      # Without this assignment, base_compile gets emptied.
-      fbsd_hideous_sh_bug=$base_compile
-
-      if test "$pic_mode" != no; then
-	command="$base_compile $qsrcfile $pic_flag"
-      else
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      fi
-
-      func_mkdir_p "$xdir$objdir"
-
-      if test -z "$output_obj"; then
-	# Place PIC objects in $objdir
-	command+=" -o $lobj"
-      fi
-
-      func_show_eval_locale "$command"	\
-          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
-
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed, then go on to compile the next one
-      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	func_show_eval '$MV "$output_obj" "$lobj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-
-      # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
-	suppress_output=' >/dev/null 2>&1'
-      fi
-    fi
-
-    # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
-	# Don't build PIC code
-	command="$base_compile $qsrcfile$pie_flag"
-      else
-	command="$base_compile $qsrcfile $pic_flag"
-      fi
-      if test "$compiler_c_o" = yes; then
-	command+=" -o $obj"
-      fi
-
-      # Suppress compiler output if we already did a PIC compilation.
-      command+="$suppress_output"
-      func_show_eval_locale "$command" \
-        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed
-      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	func_show_eval '$MV "$output_obj" "$obj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-    fi
-
-    $opt_dry_run || {
-      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
-      # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
-	removelist=$lockfile
-        $RM "$lockfile"
-      fi
-    }
-
-    exit $EXIT_SUCCESS
-}
-
-$opt_help || {
-  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
-    # We need to display help for each of the modes.
-    case $opt_mode in
-      "")
-        # Generic help is extracted from the usage comments
-        # at the start of this file.
-        func_help
-        ;;
-
-      clean)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      compile)
-      $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -no-suppress      do not suppress compiler output for multiple passes
-  -prefer-pic       try to build PIC objects only
-  -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a \`.o' file suitable for static linking
-  -static           only build a \`.o' file suitable for static linking
-  -Wc,FLAG          pass FLAG directly to the compiler
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
-        ;;
-
-      execute)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-        ;;
-
-      finish)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
-        ;;
-
-      install)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
-  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-        ;;
-
-      link)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -avoid-version    do not add a version suffix if possible
-  -bindir BINDIR    specify path to binaries directory (for systems where
-                    libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -export-symbols SYMFILE
-                    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-                    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -no-install       link a not-installable executable
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -shared           only do dynamic linking of libtool libraries
-  -shrext SUFFIX    override the standard shared library file extension
-  -static           do not do any dynamic linking of uninstalled libtool libraries
-  -static-libtool-libs
-                    do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-  -weak LIBNAME     declare that the target provides the LIBNAME interface
-  -Wc,FLAG
-  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
-  -Wl,FLAG
-  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
-  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
-        ;;
-
-      uninstall)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      *)
-        func_fatal_help "invalid operation mode \`$opt_mode'"
-        ;;
-    esac
-
-    echo
-    $ECHO "Try \`$progname --help' for more information about other modes."
-}
-
-# Now that we've collected a possible --mode arg, show help if necessary
-if $opt_help; then
-  if test "$opt_help" = :; then
-    func_mode_help
-  else
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	func_mode_help
-      done
-    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
-    {
-      func_help noexit
-      for opt_mode in compile link execute install finish uninstall clean; do
-	echo
-	func_mode_help
-      done
-    } |
-    sed '1d
-      /^When reporting/,/^Report/{
-	H
-	d
-      }
-      $x
-      /information about other modes/d
-      /more detailed .*MODE/d
-      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
-  fi
-  exit $?
-fi
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
-    $opt_debug
-    # The first argument is the command name.
-    cmd="$nonopt"
-    test -z "$cmd" && \
-      func_fatal_help "you must specify a COMMAND"
-
-    # Handle -dlopen flags immediately.
-    for file in $opt_dlopen; do
-      test -f "$file" \
-	|| func_fatal_help "\`$file' is not a file"
-
-      dir=
-      case $file in
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$lib' is not a valid libtool archive"
-
-	# Read the libtool library.
-	dlname=
-	library_names=
-	func_source "$file"
-
-	# Skip this library if it cannot be dlopened.
-	if test -z "$dlname"; then
-	  # Warn if it was a shared library.
-	  test -n "$library_names" && \
-	    func_warning "\`$file' was not linked with \`-export-dynamic'"
-	  continue
-	fi
-
-	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
-
-	if test -f "$dir/$objdir/$dlname"; then
-	  dir+="/$objdir"
-	else
-	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
-	  fi
-	fi
-	;;
-
-      *.lo)
-	# Just add the directory containing the .lo file.
-	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
-	;;
-
-      *)
-	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
-	continue
-	;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -* | *.la | *.lo ) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if func_ltwrapper_script_p "$file"; then
-	  func_source "$file"
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	elif func_ltwrapper_executable_p "$file"; then
-	  func_ltwrapper_scriptname "$file"
-	  func_source "$func_ltwrapper_scriptname_result"
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      func_append_quoted args "$file"
-    done
-
-    if test "X$opt_dry_run" = Xfalse; then
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
-
-      # Restore saved environment variables
-      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-      do
-	eval "if test \"\${save_$lt_var+set}\" = set; then
-                $lt_var=\$save_$lt_var; export $lt_var
-	      else
-		$lt_unset $lt_var
-	      fi"
-      done
-
-      # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
-    fi
-}
-
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
-    $opt_debug
-    libs=
-    libdirs=
-    admincmds=
-
-    for opt in "$nonopt" ${1+"$@"}
-    do
-      if test -d "$opt"; then
-	libdirs+=" $opt"
-
-      elif test -f "$opt"; then
-	if func_lalib_unsafe_p "$opt"; then
-	  libs+=" $opt"
-	else
-	  func_warning "\`$opt' is not a valid libtool archive"
-	fi
-
-      else
-	func_fatal_error "invalid argument \`$opt'"
-      fi
-    done
-
-    if test -n "$libs"; then
-      if test -n "$lt_sysroot"; then
-        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
-        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
-      else
-        sysroot_cmd=
-      fi
-
-      # Remove sysroot references
-      if $opt_dry_run; then
-        for lib in $libs; do
-          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
-        done
-      else
-        tmpdir=`func_mktempdir`
-        for lib in $libs; do
-	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
-	    > $tmpdir/tmp-la
-	  mv -f $tmpdir/tmp-la $lib
-	done
-        ${RM}r "$tmpdir"
-      fi
-    fi
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $opt_dry_run || eval "$cmds" || admincmds+="
-       $cmds"
-	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      echo "----------------------------------------------------------------------"
-      echo "Libraries have been installed in:"
-      for libdir in $libdirs; do
-	$ECHO "   $libdir"
-      done
-      echo
-      echo "If you ever happen to want to link against installed libraries"
-      echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
-      echo "flag during linking and do at least one of the following:"
-      if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-	echo "     during execution"
-      fi
-      if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
-	echo "     during linking"
-      fi
-      if test -n "$hardcode_libdir_flag_spec"; then
-	libdir=LIBDIR
-	eval flag=\"$hardcode_libdir_flag_spec\"
-
-	$ECHO "   - use the \`$flag' linker flag"
-      fi
-      if test -n "$admincmds"; then
-	$ECHO "   - have your system administrator run these commands:$admincmds"
-      fi
-      if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-      fi
-      echo
-
-      echo "See any operating system documentation about shared libraries for"
-      case $host in
-	solaris2.[6789]|solaris2.1[0-9])
-	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
-	  echo "pages."
-	  ;;
-	*)
-	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
-	  ;;
-      esac
-      echo "----------------------------------------------------------------------"
-    fi
-    exit $EXIT_SUCCESS
-}
-
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
-    $opt_debug
-    # There may be an optional sh(1) argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
-       # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac; then
-      # Aesthetically quote it.
-      func_quote_for_eval "$nonopt"
-      install_prog="$func_quote_for_eval_result "
-      arg=$1
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    func_quote_for_eval "$arg"
-    install_prog+="$func_quote_for_eval_result"
-    install_shared_prog=$install_prog
-    case " $install_prog " in
-      *[\\\ /]cp\ *) install_cp=: ;;
-      *) install_cp=false ;;
-    esac
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=no
-    stripme=
-    no_mode=:
-    for arg
-    do
-      arg2=
-      if test -n "$dest"; then
-	files+=" $dest"
-	dest=$arg
-	continue
-      fi
-
-      case $arg in
-      -d) isdir=yes ;;
-      -f)
-	if $install_cp; then :; else
-	  prev=$arg
-	fi
-	;;
-      -g | -m | -o)
-	prev=$arg
-	;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
-	;;
-      *)
-	# If the previous option needed an argument, then skip it.
-	if test -n "$prev"; then
-	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
-	    arg2=$install_override_mode
-	    no_mode=false
-	  fi
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
-	;;
-      esac
-
-      # Aesthetically quote the argument.
-      func_quote_for_eval "$arg"
-      install_prog+=" $func_quote_for_eval_result"
-      if test -n "$arg2"; then
-	func_quote_for_eval "$arg2"
-      fi
-      install_shared_prog+=" $func_quote_for_eval_result"
-    done
-
-    test -z "$install_prog" && \
-      func_fatal_help "you must specify an install program"
-
-    test -n "$prev" && \
-      func_fatal_help "the \`$prev' option requires an argument"
-
-    if test -n "$install_override_mode" && $no_mode; then
-      if $install_cp; then :; else
-	func_quote_for_eval "$install_override_mode"
-	install_shared_prog+=" -m $func_quote_for_eval_result"
-      fi
-    fi
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	func_fatal_help "no file or destination specified"
-      else
-	func_fatal_help "you must specify a destination"
-      fi
-    fi
-
-    # Strip any trailing slash from the destination.
-    func_stripname '' '/' "$dest"
-    dest=$func_stripname_result
-
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
-      destname=
-    else
-      func_dirname_and_basename "$dest" "" "."
-      destdir="$func_dirname_result"
-      destname="$func_basename_result"
-
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files; shift
-      test "$#" -gt 1 && \
-	func_fatal_help "\`$dest' is not a directory"
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
-	  ;;
-	esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	staticlibs+=" $file"
-	;;
-
-      *.la)
-	func_resolve_sysroot "$file"
-	file=$func_resolve_sysroot_result
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$file' is not a valid libtool archive"
-
-	library_names=
-	old_library=
-	relink_command=
-	func_source "$file"
-
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
-	  *" $libdir "*) ;;
-	  *) current_libdirs+=" $libdir" ;;
-	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
-	  *" $libdir "*) ;;
-	  *) future_libdirs+=" $libdir" ;;
-	  esac
-	fi
-
-	func_dirname "$file" "/" ""
-	dir="$func_dirname_result"
-	dir+="$objdir"
-
-	if test -n "$relink_command"; then
-	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # are installed into $libdir/../bin (currently, that works fine)
-	  # but it's something to keep an eye on.
-	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
-	  else
-	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
-	  fi
-
-	  func_warning "relinking \`$file'"
-	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
-	fi
-
-	# See the names of the shared library.
-	set dummy $library_names; shift
-	if test -n "$1"; then
-	  realname="$1"
-	  shift
-
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
-
-	  # Install the shared library and build the symlinks.
-	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
-	      'exit $?'
-	  tstripme="$stripme"
-	  case $host_os in
-	  cygwin* | mingw* | pw32* | cegcc*)
-	    case $realname in
-	    *.dll.a)
-	      tstripme=""
-	      ;;
-	    esac
-	    ;;
-	  esac
-	  if test -n "$tstripme" && test -n "$striplib"; then
-	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
-	  fi
-
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
-	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
-	    # so we also need to try rm && ln -s.
-	    for linkname
-	    do
-	      test "$linkname" != "$realname" \
-		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
-	    done
-	  fi
-
-	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
-	  func_execute_cmds "$postinstall_cmds" 'exit $?'
-	fi
-
-	# Install the pseudo-library for information purposes.
-	func_basename "$file"
-	name="$func_basename_result"
-	instname="$dir/$name"i
-	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
-	# Maybe install the static library, too.
-	test -n "$old_library" && staticlibs+=" $dir/$old_library"
-	;;
-
-      *.lo)
-	# Install (i.e. copy) a libtool object.
-
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
-	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  func_lo2o "$destfile"
-	  staticdest=$func_lo2o_result
-	  ;;
-	*.$objext)
-	  staticdest="$destfile"
-	  destfile=
-	  ;;
-	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	test -n "$destfile" && \
-	  func_show_eval "$install_prog $file $destfile" 'exit $?'
-
-	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
-	  # Deduce the name of the old-style object file.
-	  func_lo2o "$file"
-	  staticobj=$func_lo2o_result
-	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
-	fi
-	exit $EXIT_SUCCESS
-	;;
-
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
-	fi
-
-	# If the file is missing, and there is a .exe on the end, strip it
-	# because it is most likely a libtool script we actually want to
-	# install
-	stripped_ext=""
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      func_stripname '' '.exe' "$file"
-	      file=$func_stripname_result
-	      stripped_ext=".exe"
-	    fi
-	    ;;
-	esac
-
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin* | *mingw*)
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      wrapper=$func_ltwrapper_scriptname_result
-	    else
-	      func_stripname '' '.exe' "$file"
-	      wrapper=$func_stripname_result
-	    fi
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if func_ltwrapper_script_p "$wrapper"; then
-	  notinst_deplibs=
-	  relink_command=
-
-	  func_source "$wrapper"
-
-	  # Check the variables that should have been set.
-	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
-
-	  finalize=yes
-	  for lib in $notinst_deplibs; do
-	    # Check to see that each library is installed.
-	    libdir=
-	    if test -f "$lib"; then
-	      func_source "$lib"
-	    fi
-	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
-	    fi
-	  done
-
-	  relink_command=
-	  func_source "$wrapper"
-
-	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
-	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
-	        tmpdir=`func_mktempdir`
-		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
-	        # Replace the output file specification.
-	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
-
-	        $opt_silent || {
-	          func_quote_for_expand "$relink_command"
-		  eval "func_echo $func_quote_for_expand_result"
-	        }
-	        if eval "$relink_command"; then :
-	          else
-		  func_error "error: relink \`$file' with the above command before installing it"
-		  $opt_dry_run || ${RM}r "$tmpdir"
-		  continue
-	        fi
-	        file="$outputname"
-	      else
-	        func_warning "cannot relink \`$file'"
-	      fi
-	    }
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
-
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    func_stripname '' '.exe' "$destfile"
-	    destfile=$func_stripname_result
-	    ;;
-	  esac
-	  ;;
-	esac
-	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
-	$opt_dry_run || if test -n "$outputname"; then
-	  ${RM}r "$tmpdir"
-	fi
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      func_basename "$file"
-      name="$func_basename_result"
-
-      # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
-      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-      tool_oldlib=$func_to_tool_file_result
-
-      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
-      fi
-
-      # Do each command in the postinstall commands.
-      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
-    done
-
-    test -n "$future_libdirs" && \
-      func_warning "remember to run \`$progname --finish$future_libdirs'"
-
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
-    else
-      exit $EXIT_SUCCESS
-    fi
-}
-
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
-    $opt_debug
-    my_outputname="$1"
-    my_originator="$2"
-    my_pic_p="${3-no}"
-    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
-    my_dlsyms=
-
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-      if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
-      else
-	func_error "not configured to extract global symbols from dlpreopened files"
-      fi
-    fi
-
-    if test -n "$my_dlsyms"; then
-      case $my_dlsyms in
-      "") ;;
-      *.c)
-	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
-
-	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
-	# Parse the name list into a source file.
-	func_verbose "creating $output_objdir/$my_dlsyms"
-
-	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
-#endif
-
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT_DLSYM_CONST
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data.  */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-/* External symbol declarations for the compiler. */\
-"
-
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
-
-	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
-	  # Add our own program objects to the symbol list.
-	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	  for progfile in $progfiles; do
-	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
-	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -n "$exclude_expsyms"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  if test -n "$export_symbols_regex"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  # Prepare the list of exported symbols
-	  if test -z "$export_symbols"; then
-	    export_symbols="$output_objdir/$outputname.exp"
-	    $opt_dry_run || {
-	      $RM $export_symbols
-	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-	      case $host in
-	      *cygwin* | *mingw* | *cegcc* )
-                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-	        ;;
-	      esac
-	    }
-	  else
-	    $opt_dry_run || {
-	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	      case $host in
-	        *cygwin* | *mingw* | *cegcc* )
-	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-	          ;;
-	      esac
-	    }
-	  fi
-	fi
-
-	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
-	  func_basename "$dlprefile"
-	  name="$func_basename_result"
-          case $host in
-	    *cygwin* | *mingw* | *cegcc* )
-	      # if an import library, we need to obtain dlname
-	      if func_win32_import_lib_p "$dlprefile"; then
-	        func_tr_sh "$dlprefile"
-	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=""
-	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
-	          # Use subshell, to avoid clobbering current variable values
-	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname" ; then
-	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename="$func_basename_result"
-	          else
-	            # no lafile. user explicitly requested -dlpreopen <import library>.
-	            $sharedlib_from_linklib_cmd "$dlprefile"
-	            dlprefile_dlbasename=$sharedlib_from_linklib_result
-	          fi
-	        fi
-	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename" ; then
-	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
-	          else
-	            func_warning "Could not compute DLL name from $name"
-	            eval '$ECHO ": $name " >> "$nlist"'
-	          fi
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
-	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
-	        }
-	      else # not an import lib
-	        $opt_dry_run || {
-	          eval '$ECHO ": $name " >> "$nlist"'
-	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	        }
-	      fi
-	    ;;
-	    *)
-	      $opt_dry_run || {
-	        eval '$ECHO ": $name " >> "$nlist"'
-	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	      }
-	    ;;
-          esac
-	done
-
-	$opt_dry_run || {
-	  # Make sure we have at least an empty file.
-	  test -f "$nlist" || : > "$nlist"
-
-	  if test -n "$exclude_expsyms"; then
-	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	    $MV "$nlist"T "$nlist"
-	  fi
-
-	  # Try sorting and uniquifying the output.
-	  if $GREP -v "^: " < "$nlist" |
-	      if sort -k 3 </dev/null >/dev/null 2>&1; then
-		sort -k 3
-	      else
-		sort +2
-	      fi |
-	      uniq > "$nlist"S; then
-	    :
-	  else
-	    $GREP -v "^: " < "$nlist" > "$nlist"S
-	  fi
-
-	  if test -f "$nlist"S; then
-	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
-	  else
-	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
-	  fi
-
-	  echo >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols.  */
-typedef struct {
-  const char *name;
-  void *address;
-} lt_dlsymlist;
-extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
-LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
-
-	  case $need_lib_prefix in
-	  no)
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  *)
-	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  esac
-	  echo >> "$output_objdir/$my_dlsyms" "\
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	} # !$opt_dry_run
-
-	pic_flag_for_symtable=
-	case "$compile_command " in
-	*" -static "*) ;;
-	*)
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
-	  *-*-hpux*)
-	    pic_flag_for_symtable=" $pic_flag"  ;;
-	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
-	    ;;
-	  esac
-	  ;;
-	esac
-	symtab_cflags=
-	for arg in $LTCFLAGS; do
-	  case $arg in
-	  -pie | -fpie | -fPIE) ;;
-	  *) symtab_cflags+=" $arg" ;;
-	  esac
-	done
-
-	# Now compile the dynamic symbol file.
-	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
-	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
-
-	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
-	case $host in
-	*cygwin* | *mingw* | *cegcc* )
-	  if test -f "$output_objdir/$my_outputname.def"; then
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	  else
-	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  fi
-	  ;;
-	*)
-	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
-	  ;;
-	esac
-	;;
-      *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
-	;;
-      esac
-    else
-      # We keep going just in case the user didn't refer to
-      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-      # really was required.
-
-      # Nullify the symbol file.
-      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
-      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
-    fi
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-# Despite the name, also deal with 64 bit binaries.
-func_win32_libid ()
-{
-  $opt_debug
-  win32_libid_type="unknown"
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      func_to_tool_file "$1" func_convert_file_msys_to_w32
-      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	$SED -n -e '
-	    1,100{
-		/ I /{
-		    s,.*,import,
-		    p
-		    q
-		}
-	    }'`
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
-    esac
-    ;;
-  esac
-  $ECHO "$win32_libid_type"
-}
-
-# func_cygming_dll_for_implib ARG
-#
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib ()
-{
-  $opt_debug
-  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-}
-
-# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-#
-# The is the core of a fallback implementation of a
-# platform-specific function to extract the name of the
-# DLL associated with the specified import library LIBNAME.
-#
-# SECTION_NAME is either .idata$6 or .idata$7, depending
-# on the platform and compiler that created the implib.
-#
-# Echos the name of the DLL associated with the
-# specified import library.
-func_cygming_dll_for_implib_fallback_core ()
-{
-  $opt_debug
-  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
-  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
-    $SED '/^Contents of section '"$match_literal"':/{
-      # Place marker at beginning of archive member dllname section
-      s/.*/====MARK====/
-      p
-      d
-    }
-    # These lines can sometimes be longer than 43 characters, but
-    # are always uninteresting
-    /:[	 ]*file format pe[i]\{,1\}-/d
-    /^In archive [^:]*:/d
-    # Ensure marker is printed
-    /^====MARK====/p
-    # Remove all lines with less than 43 characters
-    /^.\{43\}/!d
-    # From remaining lines, remove first 43 characters
-    s/^.\{43\}//' |
-    $SED -n '
-      # Join marker and all lines until next marker into a single line
-      /^====MARK====/ b para
-      H
-      $ b para
-      b
-      :para
-      x
-      s/\n//g
-      # Remove the marker
-      s/^====MARK====//
-      # Remove trailing dots and whitespace
-      s/[\. \t]*$//
-      # Print
-      /./p' |
-    # we now have a list, one entry per line, of the stringified
-    # contents of the appropriate section of all members of the
-    # archive which possess that section. Heuristic: eliminate
-    # all those which have a first or second character that is
-    # a '.' (that is, objdump's representation of an unprintable
-    # character.) This should work for all archives with less than
-    # 0x302f exports -- but will fail for DLLs whose name actually
-    # begins with a literal '.' or a single character followed by
-    # a '.'.
-    #
-    # Of those that remain, print the first one.
-    $SED -e '/^\./d;/^.\./d;q'
-}
-
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
-# func_cygming_dll_for_implib_fallback ARG
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-#
-# This fallback implementation is for use when $DLLTOOL
-# does not support the --identify-strict option.
-# Invoked by eval'ing the libtool variable
-#    $sharedlib_from_linklib_cmd
-# Result is available in the variable
-#    $sharedlib_from_linklib_result
-func_cygming_dll_for_implib_fallback ()
-{
-  $opt_debug
-  if func_cygming_gnu_implib_p "$1" ; then
-    # binutils import library
-    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1" ; then
-    # ms-generated import library
-    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
-  else
-    # unknown
-    sharedlib_from_linklib_result=""
-  fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
-    $opt_debug
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-    if test "$lock_old_archive_extraction" = yes; then
-      lockfile=$f_ex_an_ar_oldlib.lock
-      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-	func_echo "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    fi
-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
-		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test "$lock_old_archive_extraction" = yes; then
-      $opt_dry_run || rm -f "$lockfile"
-    fi
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
-    fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
-    $opt_debug
-    my_gentop="$1"; shift
-    my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
-
-    for my_xlib in $my_oldlibs; do
-      # Extract the objects.
-      case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
-      my_xlib_u=$my_xlib
-      while :; do
-        case " $extracted_archives " in
-	*" $my_xlib_u "*)
-	  func_arith $extracted_serial + 1
-	  extracted_serial=$func_arith_result
-	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-	*) break ;;
-	esac
-      done
-      extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
-
-      func_mkdir_p "$my_xdir"
-
-      case $host in
-      *-darwin*)
-	func_verbose "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	$opt_dry_run || {
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
-	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
-	  if test -n "$darwin_arches"; then
-	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
-	    darwin_arch=
-	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
-	      cd "$darwin_curdir"
-	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
-	    done # $darwin_arches
-            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
-	    darwin_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
-	      $LIPO -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    $RM -rf unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd $darwin_orig_dir
-	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	} # !$opt_dry_run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-	;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
-    done
-
-    func_extract_archives_result="$my_oldobjs"
-}
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable.  Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory.  This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
-	func_emit_wrapper_arg1=${1-no}
-
-	$ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variables:
-  generated_by_libtool_version='$macro_version'
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$ECHO are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    file=\"\$0\""
-
-    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
-    $ECHO "\
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-    ECHO=\"$qECHO\"
-  fi
-
-# Very basic option parsing. These options are (a) specific to
-# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
-# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
-# this pattern).
-#
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
-#
-# The first argument to this parsing function should be the
-# script's $0 value, followed by "$@".
-lt_option_debug=
-func_parse_lt_options ()
-{
-  lt_script_arg0=\$0
-  shift
-  for lt_opt
-  do
-    case \"\$lt_opt\" in
-    --lt-debug) lt_option_debug=1 ;;
-    --lt-dump-script)
-        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
-        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
-        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
-        cat \"\$lt_dump_D/\$lt_dump_F\"
-        exit 0
-      ;;
-    --lt-*)
-        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
-        exit 1
-      ;;
-    esac
-  done
-
-  # Print the debug banner immediately:
-  if test -n \"\$lt_option_debug\"; then
-    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
-  fi
-}
-
-# Used when --lt-debug. Prints its arguments to stdout
-# (redirection is the responsibility of the caller)
-func_lt_dump_args ()
-{
-  lt_dump_args_N=1;
-  for lt_arg
-  do
-    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
-    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
-  done
-}
-
-# Core function for launching the target application
-func_exec_program_core ()
-{
-"
-  case $host in
-  # Backslashes separate directories on plain windows
-  *-*-mingw | *-*-os2* | *-cegcc*)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-    ;;
-
-  *)
-    $ECHO "\
-      if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
-        func_lt_dump_args \${1+\"\$@\"} 1>&2
-      fi
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-    ;;
-  esac
-  $ECHO "\
-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-      exit 1
-}
-
-# A function to encapsulate launching the target application
-# Strips options in the --lt-* namespace from \$@ and
-# launches target application with the remaining arguments.
-func_exec_program ()
-{
-  case \" \$* \" in
-  *\\ --lt-*)
-    for lt_wr_arg
-    do
-      case \$lt_wr_arg in
-      --lt-*) ;;
-      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-      esac
-      shift
-    done ;;
-  esac
-  func_exec_program_core \${1+\"\$@\"}
-}
-
-  # Parse options
-  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
-  done
-
-  # Usually 'no', except on cygwin/mingw when embedded into
-  # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
-  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
-    # special case for '.'
-    if test \"\$thisdir\" = \".\"; then
-      thisdir=\`pwd\`
-    fi
-    # remove .libs from thisdir
-    case \"\$thisdir\" in
-    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
-    $objdir )   thisdir=. ;;
-    esac
-  fi
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
-	if test "$fast_install" = yes; then
-	  $ECHO "\
-  program=lt-'$outputname'$exeext
-  progdir=\"\$thisdir/$objdir\"
-
-  if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
-    file=\"\$\$-\$program\"
-
-    if test ! -d \"\$progdir\"; then
-      $MKDIR \"\$progdir\"
-    else
-      $RM \"\$progdir/\$file\"
-    fi"
-
-	  $ECHO "\
-
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	$ECHO \"\$relink_command_output\" >&2
-	$RM \"\$progdir/\$file\"
-	exit 1
-      fi
-    fi
-
-    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $RM \"\$progdir/\$program\";
-      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $RM \"\$progdir/\$file\"
-  fi"
-	else
-	  $ECHO "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
-	fi
-
-	$ECHO "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# fixup the dll searchpath if we need to.
-	#
-	# Fix the DLL searchpath if we need to.  Do this before prepending
-	# to shlibpath, because on Windows, both are PATH and uninstalled
-	# libraries must come first.
-	if test -n "$dllsearchpath"; then
-	  $ECHO "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
-
-	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $ECHO "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
-
-    export $shlibpath_var
-"
-	fi
-
-	$ECHO "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-      func_exec_program \${1+\"\$@\"}
-    fi
-  else
-    # The program doesn't exist.
-    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
-    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
-    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit 1
-  fi
-fi\
-"
-}
-
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
-	cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-*/
-EOF
-	    cat <<"EOF"
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-#  include <io.h>
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-/* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
-# ifdef __STRICT_ANSI__
-int _putenv (const char *);
-# endif
-#elif defined(__CYGWIN__)
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
-/* #elif defined (other platforms) ... */
-#endif
-
-/* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
-# define setmode _setmode
-# define stat    _stat
-# define chmod   _chmod
-# define getcwd  _getcwd
-# define putenv  _putenv
-# define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-#  define _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#elif defined(__MINGW32__)
-# define setmode _setmode
-# define stat    _stat
-# define chmod   _chmod
-# define getcwd  _getcwd
-# define putenv  _putenv
-#elif defined(__CYGWIN__)
-# define HAVE_SETENV
-# define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
-#endif
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-/* path handling portability macros */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-#if defined(LT_DEBUGWRAPPER)
-static int lt_debug = 1;
-#else
-static int lt_debug = 0;
-#endif
-
-const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-void lt_fatal (const char *file, int line, const char *message, ...);
-static const char *nonnull (const char *s);
-static const char *nonempty (const char *s);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-char **prepare_spawn (char **argv);
-void lt_dump_script (FILE *f);
-EOF
-
-	    cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
-	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-              func_to_host_path "$temp_rpath"
-	      cat <<EOF
-const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * LIB_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test -n "$dllsearchpath"; then
-              func_to_host_path "$dllsearchpath:"
-	      cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test "$fast_install" = yes; then
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
-	    else
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
-	    fi
-
-
-	    cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX         "--lt-"
-
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
-
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int  newargc;
-  char *tmp_pathspec;
-  char *actual_cwrapper_path;
-  char *actual_cwrapper_name;
-  char *target_name;
-  char *lt_argv_zero;
-  intptr_t rval = 127;
-
-  int i;
-
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
-
-  /* very simple arg parsing; don't want to rely on getopt
-   * also, copy all non cwrapper options to newargz, except
-   * argz[0], which is handled differently
-   */
-  newargc=0;
-  for (i = 1; i < argc; i++)
-    {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
-	{
-EOF
-	    case "$host" in
-	      *mingw* | *cygwin* )
-		# make stdout use "unix" line endings
-		echo "          setmode(1,_O_BINARY);"
-		;;
-	      esac
-
-	    cat <<"EOF"
-	  lt_dump_script (stdout);
-	  return 0;
-	}
-      if (strcmp (argv[i], debug_opt) == 0)
-	{
-          lt_debug = 1;
-          continue;
-	}
-      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
-        {
-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-             namespace, but it is not one of the ones we know about and
-             have already dealt with, above (inluding dump-script), then
-             report an error. Otherwise, targets might begin to believe
-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-             namespace. The first time any user complains about this, we'll
-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-             or a configure.ac-settable value.
-           */
-          lt_fatal (__FILE__, __LINE__,
-		    "unrecognized %s option: '%s'",
-                    ltwrapper_option_prefix, argv[i]);
-        }
-      /* otherwise ... */
-      newargz[++newargc] = xstrdup (argv[i]);
-    }
-  newargz[++newargc] = NULL;
-
-EOF
-	    cat <<EOF
-  /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
-EOF
-	    cat <<"EOF"
-  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
-
-  tmp_pathspec = find_executable (argv[0]);
-  if (tmp_pathspec == NULL)
-    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (before symlink chase) at: %s\n",
-		  tmp_pathspec);
-
-  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-  lt_debugprintf (__FILE__, __LINE__,
-                  "(main) found exe (after symlink chase) at: %s\n",
-		  actual_cwrapper_path);
-  XFREE (tmp_pathspec);
-
-  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
-  strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
-  /* wrapper name transforms */
-  strendzap (actual_cwrapper_name, ".exe");
-  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
-  XFREE (actual_cwrapper_name);
-  actual_cwrapper_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  /* target_name transforms -- use actual target program name; might have lt- prefix */
-  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
-  strendzap (target_name, ".exe");
-  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
-  XFREE (target_name);
-  target_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(main) libtool target name: %s\n",
-		  target_name);
-EOF
-
-	    cat <<EOF
-  newargz[0] =
-    XMALLOC (char, (strlen (actual_cwrapper_path) +
-		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
-  strcpy (newargz[0], actual_cwrapper_path);
-  strcat (newargz[0], "$objdir");
-  strcat (newargz[0], "/");
-EOF
-
-	    cat <<"EOF"
-  /* stop here, and copy so we don't have to do this twice */
-  tmp_pathspec = xstrdup (newargz[0]);
-
-  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
-  strcat (newargz[0], actual_cwrapper_name);
-
-  /* DO want the lt- prefix here if it exists, so use target_name */
-  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
-  XFREE (tmp_pathspec);
-  tmp_pathspec = NULL;
-EOF
-
-	    case $host_os in
-	      mingw*)
-	    cat <<"EOF"
-  {
-    char* p;
-    while ((p = strchr (newargz[0], '\\')) != NULL)
-      {
-	*p = '/';
-      }
-    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
-      {
-	*p = '/';
-      }
-  }
-EOF
-	    ;;
-	    esac
-
-	    cat <<"EOF"
-  XFREE (target_name);
-  XFREE (actual_cwrapper_path);
-  XFREE (actual_cwrapper_name);
-
-  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
-  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
-  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
-     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
-     because on Windows, both *_VARNAMEs are PATH but uninstalled
-     libraries must come first. */
-  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-
-  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
-		  nonnull (lt_argv_zero));
-  for (i = 0; i < newargc; i++)
-    {
-      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
-		      i, nonnull (newargz[i]));
-    }
-
-EOF
-
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-  /* execv doesn't actually work on mingw as expected on unix */
-  newargz = prepare_spawn (newargz);
-  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
-  if (rval == -1)
-    {
-      /* failed to start process */
-      lt_debugprintf (__FILE__, __LINE__,
-		      "(main) failed to launch target \"%s\": %s\n",
-		      lt_argv_zero, nonnull (strerror (errno)));
-      return 127;
-    }
-  return rval;
-EOF
-		;;
-	      *)
-		cat <<"EOF"
-  execv (lt_argv_zero, newargz);
-  return rval; /* =127, but avoids unused variable warning */
-EOF
-		;;
-	    esac
-
-	    cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
-  void *p = (void *) malloc (num);
-  if (!p)
-    lt_fatal (__FILE__, __LINE__, "memory exhausted");
-
-  return p;
-}
-
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
-			  string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
-  const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
-    name += 2;
-#endif
-
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
-
-int
-check_executable (const char *path)
-{
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if ((stat (path, &st) >= 0)
-      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
-    return 1;
-  else
-    return 0;
-}
-
-int
-make_executable (const char *path)
-{
-  int rval = 0;
-  struct stat st;
-
-  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
-                  nonempty (path));
-  if ((!path) || (!*path))
-    return 0;
-
-  if (stat (path, &st) >= 0)
-    {
-      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
-    }
-  return rval;
-}
-
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise
-   Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
-  int has_slash = 0;
-  const char *p;
-  const char *p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  int tmp_len;
-  char *concat_name;
-
-  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
-                  nonempty (wrapper));
-
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
-
-  /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable (concat_name))
-	return concat_name;
-      XFREE (concat_name);
-    }
-  else
-    {
-#endif
-      if (IS_DIR_SEPARATOR (wrapper[0]))
-	{
-	  concat_name = xstrdup (wrapper);
-	  if (check_executable (concat_name))
-	    return concat_name;
-	  XFREE (concat_name);
-	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-    }
-#endif
-
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-      {
-	has_slash = 1;
-	break;
-      }
-  if (!has_slash)
-    {
-      /* no slashes; search PATH */
-      const char *path = getenv ("PATH");
-      if (path != NULL)
-	{
-	  for (p = path; *p; p = p_next)
-	    {
-	      const char *q;
-	      size_t p_len;
-	      for (q = p; *q; q++)
-		if (IS_PATH_SEPARATOR (*q))
-		  break;
-	      p_len = q - p;
-	      p_next = (*q == '\0' ? q : q + 1);
-	      if (p_len == 0)
-		{
-		  /* empty path: current directory */
-		  if (getcwd (tmp, LT_PATHMAX) == NULL)
-		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-                              nonnull (strerror (errno)));
-		  tmp_len = strlen (tmp);
-		  concat_name =
-		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, tmp, tmp_len);
-		  concat_name[tmp_len] = '/';
-		  strcpy (concat_name + tmp_len + 1, wrapper);
-		}
-	      else
-		{
-		  concat_name =
-		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, p, p_len);
-		  concat_name[p_len] = '/';
-		  strcpy (concat_name + p_len + 1, wrapper);
-		}
-	      if (check_executable (concat_name))
-		return concat_name;
-	      XFREE (concat_name);
-	    }
-	}
-      /* not found in PATH; assume curdir */
-    }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-              nonnull (strerror (errno)));
-  tmp_len = strlen (tmp);
-  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
-
-  if (check_executable (concat_name))
-    return concat_name;
-  XFREE (concat_name);
-  return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
-  return xstrdup (pathspec);
-#else
-  char buf[LT_PATHMAX];
-  struct stat s;
-  char *tmp_pathspec = xstrdup (pathspec);
-  char *p;
-  int has_symlinks = 0;
-  while (strlen (tmp_pathspec) && !has_symlinks)
-    {
-      lt_debugprintf (__FILE__, __LINE__,
-		      "checking path component for symlinks: %s\n",
-		      tmp_pathspec);
-      if (lstat (tmp_pathspec, &s) == 0)
-	{
-	  if (S_ISLNK (s.st_mode) != 0)
-	    {
-	      has_symlinks = 1;
-	      break;
-	    }
-
-	  /* search backwards for last DIR_SEPARATOR */
-	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
-	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    p--;
-	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    {
-	      /* no more DIR_SEPARATORS left */
-	      break;
-	    }
-	  *p = '\0';
-	}
-      else
-	{
-	  lt_fatal (__FILE__, __LINE__,
-		    "error accessing file \"%s\": %s",
-		    tmp_pathspec, nonnull (strerror (errno)));
-	}
-    }
-  XFREE (tmp_pathspec);
-
-  if (!has_symlinks)
-    {
-      return xstrdup (pathspec);
-    }
-
-  tmp_pathspec = realpath (pathspec, buf);
-  if (tmp_pathspec == 0)
-    {
-      lt_fatal (__FILE__, __LINE__,
-		"could not follow symlinks for %s", pathspec);
-    }
-  return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
-  size_t len, patlen;
-
-  assert (str != NULL);
-  assert (pat != NULL);
-
-  len = strlen (str);
-  patlen = strlen (pat);
-
-  if (patlen <= len)
-    {
-      str += len - patlen;
-      if (strcmp (str, pat) == 0)
-	*str = '\0';
-    }
-  return str;
-}
-
-void
-lt_debugprintf (const char *file, int line, const char *fmt, ...)
-{
-  va_list args;
-  if (lt_debug)
-    {
-      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
-      va_start (args, fmt);
-      (void) vfprintf (stderr, fmt, args);
-      va_end (args);
-    }
-}
-
-static void
-lt_error_core (int exit_status, const char *file,
-	       int line, const char *mode,
-	       const char *message, va_list ap)
-{
-  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
-
-  if (exit_status >= 0)
-    exit (exit_status);
-}
-
-void
-lt_fatal (const char *file, int line, const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
-  va_end (ap);
-}
-
-static const char *
-nonnull (const char *s)
-{
-  return s ? s : "(null)";
-}
-
-static const char *
-nonempty (const char *s)
-{
-  return (s && !*s) ? "(empty)" : nonnull (s);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_setenv) setting '%s' to '%s'\n",
-                  nonnull (name), nonnull (value));
-  {
-#ifdef HAVE_SETENV
-    /* always make a copy, for consistency with !HAVE_SETENV */
-    char *str = xstrdup (value);
-    setenv (name, str, 1);
-#else
-    int len = strlen (name) + 1 + strlen (value) + 1;
-    char *str = XMALLOC (char, len);
-    sprintf (str, "%s=%s", name, value);
-    if (putenv (str) != EXIT_SUCCESS)
-      {
-        XFREE (str);
-      }
-#endif
-  }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
-  char *new_value;
-  if (orig_value && *orig_value)
-    {
-      int orig_value_len = strlen (orig_value);
-      int add_len = strlen (add);
-      new_value = XMALLOC (char, add_len + orig_value_len + 1);
-      if (to_end)
-        {
-          strcpy (new_value, orig_value);
-          strcpy (new_value + orig_value_len, add);
-        }
-      else
-        {
-          strcpy (new_value, add);
-          strcpy (new_value + add_len, orig_value);
-        }
-    }
-  else
-    {
-      new_value = xstrdup (add);
-    }
-  return new_value;
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      /* some systems can't cope with a ':'-terminated path #' */
-      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
-        {
-          new_value[len-1] = '\0';
-        }
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
-  lt_debugprintf (__FILE__, __LINE__,
-		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-                  nonnull (name), nonnull (value));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-EOF
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-
-/* Prepares an argument vector before calling spawn().
-   Note that spawn() does not by itself call the command interpreter
-     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
-      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-         GetVersionEx(&v);
-         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
-      }) ? "cmd.exe" : "command.com").
-   Instead it simply concatenates the arguments, separated by ' ', and calls
-   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
-   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
-   special way:
-   - Space and tab are interpreted as delimiters. They are not treated as
-     delimiters if they are surrounded by double quotes: "...".
-   - Unescaped double quotes are removed from the input. Their only effect is
-     that within double quotes, space and tab are treated like normal
-     characters.
-   - Backslashes not followed by double quotes are not special.
-   - But 2*n+1 backslashes followed by a double quote become
-     n backslashes followed by a double quote (n >= 0):
-       \" -> "
-       \\\" -> \"
-       \\\\\" -> \\"
- */
-#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-char **
-prepare_spawn (char **argv)
-{
-  size_t argc;
-  char **new_argv;
-  size_t i;
-
-  /* Count number of arguments.  */
-  for (argc = 0; argv[argc] != NULL; argc++)
-    ;
-
-  /* Allocate new argument vector.  */
-  new_argv = XMALLOC (char *, argc + 1);
-
-  /* Put quoted arguments into the new argument vector.  */
-  for (i = 0; i < argc; i++)
-    {
-      const char *string = argv[i];
-
-      if (string[0] == '\0')
-	new_argv[i] = xstrdup ("\"\"");
-      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
-	{
-	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
-	  size_t length;
-	  unsigned int backslashes;
-	  const char *s;
-	  char *quoted_string;
-	  char *p;
-
-	  length = 0;
-	  backslashes = 0;
-	  if (quote_around)
-	    length++;
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		length += backslashes + 1;
-	      length++;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    length += backslashes + 1;
-
-	  quoted_string = XMALLOC (char, length + 1);
-
-	  p = quoted_string;
-	  backslashes = 0;
-	  if (quote_around)
-	    *p++ = '"';
-	  for (s = string; *s != '\0'; s++)
-	    {
-	      char c = *s;
-	      if (c == '"')
-		{
-		  unsigned int j;
-		  for (j = backslashes + 1; j > 0; j--)
-		    *p++ = '\\';
-		}
-	      *p++ = c;
-	      if (c == '\\')
-		backslashes++;
-	      else
-		backslashes = 0;
-	    }
-	  if (quote_around)
-	    {
-	      unsigned int j;
-	      for (j = backslashes; j > 0; j--)
-		*p++ = '\\';
-	      *p++ = '"';
-	    }
-	  *p = '\0';
-
-	  new_argv[i] = quoted_string;
-	}
-      else
-	new_argv[i] = (char *) string;
-    }
-  new_argv[argc] = NULL;
-
-  return new_argv;
-}
-EOF
-		;;
-	    esac
-
-            cat <<"EOF"
-void lt_dump_script (FILE* f)
-{
-EOF
-	    func_emit_wrapper yes |
-	      $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/  fputs ("\1", f);/p
-g
-D'
-            cat <<"EOF"
-}
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_win32_import_lib_p ARG
-# True if ARG is an import lib, as indicated by $file_magic_cmd
-func_win32_import_lib_p ()
-{
-    $opt_debug
-    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
-    *import*) : ;;
-    *) false ;;
-    esac
-}
-
-# func_mode_link arg...
-func_mode_link ()
-{
-    $opt_debug
-    case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-      # It is impossible to link a dll without this setting, and
-      # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
-      # flag for every libtool invocation.
-      # allow_undefined=no
-
-      # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
-      # even a static library is built.  For now, we need to specify
-      # -no-undefined on the libtool link line when we can be certain
-      # that all symbols are satisfied, otherwise we get a static library.
-      allow_undefined=yes
-      ;;
-    *)
-      allow_undefined=yes
-      ;;
-    esac
-    libtool_args=$nonopt
-    base_compile="$nonopt $@"
-    compile_command=$nonopt
-    finalize_command=$nonopt
-
-    compile_rpath=
-    finalize_rpath=
-    compile_shlibpath=
-    finalize_shlibpath=
-    convenience=
-    old_convenience=
-    deplibs=
-    old_deplibs=
-    compiler_flags=
-    linker_flags=
-    dllsearchpath=
-    lib_search_path=`pwd`
-    inst_prefix_dir=
-    new_inherited_linker_flags=
-
-    avoid_version=no
-    bindir=
-    dlfiles=
-    dlprefiles=
-    dlself=no
-    export_dynamic=no
-    export_symbols=
-    export_symbols_regex=
-    generated=
-    libobjs=
-    ltlibs=
-    module=no
-    no_install=no
-    objs=
-    non_pic_objects=
-    precious_files_regex=
-    prefer_static_libs=no
-    preload=no
-    prev=
-    prevarg=
-    release=
-    rpath=
-    xrpath=
-    perm_rpath=
-    temp_rpath=
-    thread_safe=no
-    vinfo=
-    vinfo_number=no
-    weak_libs=
-    single_module="${wl}-single_module"
-    func_infer_tag $base_compile
-
-    # We need to know -static, to get the right output filenames.
-    for arg
-    do
-      case $arg in
-      -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
-	build_old_libs=no
-	break
-	;;
-      -all-static | -static | -static-libtool-libs)
-	case $arg in
-	-all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
-	    func_warning "complete static linking is impossible in this configuration"
-	  fi
-	  if test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	-static)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=built
-	  ;;
-	-static-libtool-libs)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	esac
-	build_libtool_libs=no
-	build_old_libs=yes
-	break
-	;;
-      esac
-    done
-
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
-    # Go through the arguments, transforming them on the way.
-    while test "$#" -gt 0; do
-      arg="$1"
-      shift
-      func_quote_for_eval "$arg"
-      qarg=$func_quote_for_eval_unquoted_result
-      libtool_args+=" $func_quote_for_eval_result"
-
-      # If the previous option needs an argument, assign it.
-      if test -n "$prev"; then
-	case $prev in
-	output)
-	  compile_command+=" @OUTPUT@"
-	  finalize_command+=" @OUTPUT@"
-	  ;;
-	esac
-
-	case $prev in
-	bindir)
-	  bindir="$arg"
-	  prev=
-	  continue
-	  ;;
-	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
-	    # Add the symbol object into the linking commands.
-	    compile_command+=" @SYMFILE@"
-	    finalize_command+=" @SYMFILE@"
-	    preload=yes
-	  fi
-	  case $arg in
-	  *.la | *.lo) ;;  # We handle these cases below.
-	  force)
-	    if test "$dlself" = no; then
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  self)
-	    if test "$prev" = dlprefiles; then
-	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
-	      dlself=yes
-	    else
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  *)
-	    if test "$prev" = dlfiles; then
-	      dlfiles+=" $arg"
-	    else
-	      dlprefiles+=" $arg"
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  esac
-	  ;;
-	expsyms)
-	  export_symbols="$arg"
-	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
-	  prev=
-	  continue
-	  ;;
-	expsyms_regex)
-	  export_symbols_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	framework)
-	  case $host in
-	    *-*-darwin*)
-	      case "$deplibs " in
-		*" $qarg.ltframework "*) ;;
-		*) deplibs+=" $qarg.ltframework" # this is fixed later
-		   ;;
-	      esac
-	      ;;
-	  esac
-	  prev=
-	  continue
-	  ;;
-	inst_prefix)
-	  inst_prefix_dir="$arg"
-	  prev=
-	  continue
-	  ;;
-	objectlist)
-	  if test -f "$arg"; then
-	    save_arg=$arg
-	    moreargs=
-	    for fil in `cat "$save_arg"`
-	    do
-#	      moreargs+=" $fil"
-	      arg=$fil
-	      # A libtool-controlled object.
-
-	      # Check to see that this really is a libtool object.
-	      if func_lalib_unsafe_p "$arg"; then
-		pic_object=
-		non_pic_object=
-
-		# Read the .lo file
-		func_source "$arg"
-
-		if test -z "$pic_object" ||
-		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none &&
-		   test "$non_pic_object" = none; then
-		  func_fatal_error "cannot find name of object for \`$arg'"
-		fi
-
-		# Extract subdirectory from the argument.
-		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
-
-		if test "$pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
-
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		      dlfiles+=" $pic_object"
-		      prev=
-		      continue
-		    else
-		      # If libtool objects are unsupported, then we need to preload.
-		      prev=dlprefiles
-		    fi
-		  fi
-
-		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
-		    # Preload the old-style object.
-		    dlprefiles+=" $pic_object"
-		    prev=
-		  fi
-
-		  # A PIC object.
-		  libobjs+=" $pic_object"
-		  arg="$pic_object"
-		fi
-
-		# Non-PIC object.
-		if test "$non_pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
-
-		  # A standard non-PIC object
-		  non_pic_objects+=" $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
-		  fi
-		else
-		  # If the PIC object exists, use it instead.
-		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
-		  non_pic_objects+=" $non_pic_object"
-		fi
-	      else
-		# Only an error if not doing a dry-run.
-		if $opt_dry_run; then
-		  # Extract subdirectory from the argument.
-		  func_dirname "$arg" "/" ""
-		  xdir="$func_dirname_result"
-
-		  func_lo2o "$arg"
-		  pic_object=$xdir$objdir/$func_lo2o_result
-		  non_pic_object=$xdir$func_lo2o_result
-		  libobjs+=" $pic_object"
-		  non_pic_objects+=" $non_pic_object"
-	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
-		fi
-	      fi
-	    done
-	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
-	  fi
-	  arg=$save_arg
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	release)
-	  release="-$arg"
-	  prev=
-	  continue
-	  ;;
-	rpath | xrpath)
-	  # We need an absolute path.
-	  case $arg in
-	  [\\/]* | [A-Za-z]:[\\/]*) ;;
-	  *)
-	    func_fatal_error "only absolute run-paths are allowed"
-	    ;;
-	  esac
-	  if test "$prev" = rpath; then
-	    case "$rpath " in
-	    *" $arg "*) ;;
-	    *) rpath+=" $arg" ;;
-	    esac
-	  else
-	    case "$xrpath " in
-	    *" $arg "*) ;;
-	    *) xrpath+=" $arg" ;;
-	    esac
-	  fi
-	  prev=
-	  continue
-	  ;;
-	shrext)
-	  shrext_cmds="$arg"
-	  prev=
-	  continue
-	  ;;
-	weak)
-	  weak_libs+=" $arg"
-	  prev=
-	  continue
-	  ;;
-	xcclinker)
-	  linker_flags+=" $qarg"
-	  compiler_flags+=" $qarg"
-	  prev=
-	  compile_command+=" $qarg"
-	  finalize_command+=" $qarg"
-	  continue
-	  ;;
-	xcompiler)
-	  compiler_flags+=" $qarg"
-	  prev=
-	  compile_command+=" $qarg"
-	  finalize_command+=" $qarg"
-	  continue
-	  ;;
-	xlinker)
-	  linker_flags+=" $qarg"
-	  compiler_flags+=" $wl$qarg"
-	  prev=
-	  compile_command+=" $wl$qarg"
-	  finalize_command+=" $wl$qarg"
-	  continue
-	  ;;
-	*)
-	  eval "$prev=\"\$arg\""
-	  prev=
-	  continue
-	  ;;
-	esac
-      fi # test -n "$prev"
-
-      prevarg="$arg"
-
-      case $arg in
-      -all-static)
-	if test -n "$link_static_flag"; then
-	  # See comment for -static flag below, for more details.
-	  compile_command+=" $link_static_flag"
-	  finalize_command+=" $link_static_flag"
-	fi
-	continue
-	;;
-
-      -allow-undefined)
-	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
-	;;
-
-      -avoid-version)
-	avoid_version=yes
-	continue
-	;;
-
-      -bindir)
-	prev=bindir
-	continue
-	;;
-
-      -dlopen)
-	prev=dlfiles
-	continue
-	;;
-
-      -dlpreopen)
-	prev=dlprefiles
-	continue
-	;;
-
-      -export-dynamic)
-	export_dynamic=yes
-	continue
-	;;
-
-      -export-symbols | -export-symbols-regex)
-	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	  func_fatal_error "more than one -exported-symbols argument is not allowed"
-	fi
-	if test "X$arg" = "X-export-symbols"; then
-	  prev=expsyms
-	else
-	  prev=expsyms_regex
-	fi
-	continue
-	;;
-
-      -framework)
-	prev=framework
-	continue
-	;;
-
-      -inst-prefix-dir)
-	prev=inst_prefix
-	continue
-	;;
-
-      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
-      # so, if we see these flags be careful not to treat them like -L
-      -L[A-Z][A-Z]*:*)
-	case $with_gcc/$host in
-	no/*-*-irix* | /*-*-irix*)
-	  compile_command+=" $arg"
-	  finalize_command+=" $arg"
-	  ;;
-	esac
-	continue
-	;;
-
-      -L*)
-	func_stripname "-L" '' "$arg"
-	if test -z "$func_stripname_result"; then
-	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between \`-L' and \`$1'"
-	  else
-	    func_fatal_error "need path for \`-L' option"
-	  fi
-	fi
-	func_resolve_sysroot "$func_stripname_result"
-	dir=$func_resolve_sysroot_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  absdir=`cd "$dir" && pwd`
-	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
-	  ;;
-	esac
-	case "$deplibs " in
-	*" -L$dir "* | *" $arg "*)
-	  # Will only happen for absolute or sysroot arguments
-	  ;;
-	*)
-	  # Preserve sysroot, but never include relative directories
-	  case $dir in
-	    [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;;
-	    *) deplibs+=" -L$dir" ;;
-	  esac
-	  lib_search_path+=" $dir"
-	  ;;
-	esac
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$dir:"*) ;;
-	  ::) dllsearchpath=$dir;;
-	  *) dllsearchpath+=":$dir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath+=":$testbindir";;
-	  esac
-	  ;;
-	esac
-	continue
-	;;
-
-      -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # These systems don't actually have a C or math library (as such)
-	    continue
-	    ;;
-	  *-*-os2*)
-	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C and math libraries are in the System framework
-	    deplibs+=" System.ltframework"
-	    continue
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  esac
-	elif test "X$arg" = "X-lc_r"; then
-	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	   # Do not include libc_r directly, use -pthread flag.
-	   continue
-	   ;;
-	 esac
-	fi
-	deplibs+=" $arg"
-	continue
-	;;
-
-      -module)
-	module=yes
-	continue
-	;;
-
-      # Tru64 UNIX uses -model [arg] to determine the layout of C++
-      # classes, name mangling, and exception handling.
-      # Darwin uses the -arch flag to determine output architecture.
-      -model|-arch|-isysroot|--sysroot)
-	compiler_flags+=" $arg"
-	compile_command+=" $arg"
-	finalize_command+=" $arg"
-	prev=xcompiler
-	continue
-	;;
-
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	compiler_flags+=" $arg"
-	compile_command+=" $arg"
-	finalize_command+=" $arg"
-	case "$new_inherited_linker_flags " in
-	    *" $arg "*) ;;
-	    * ) new_inherited_linker_flags+=" $arg" ;;
-	esac
-	continue
-	;;
-
-      -multi_module)
-	single_module="${wl}-multi_module"
-	continue
-	;;
-
-      -no-fast-install)
-	fast_install=no
-	continue
-	;;
-
-      -no-install)
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
-	  # The PATH hackery in wrapper scripts is required on Windows
-	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "\`-no-install' is ignored for $host"
-	  func_warning "assuming \`-no-fast-install' instead"
-	  fast_install=no
-	  ;;
-	*) no_install=yes ;;
-	esac
-	continue
-	;;
-
-      -no-undefined)
-	allow_undefined=no
-	continue
-	;;
-
-      -objectlist)
-	prev=objectlist
-	continue
-	;;
-
-      -o) prev=output ;;
-
-      -precious-files-regex)
-	prev=precious_regex
-	continue
-	;;
-
-      -release)
-	prev=release
-	continue
-	;;
-
-      -rpath)
-	prev=rpath
-	continue
-	;;
-
-      -R)
-	prev=xrpath
-	continue
-	;;
-
-      -R*)
-	func_stripname '-R' '' "$arg"
-	dir=$func_stripname_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	=*)
-	  func_stripname '=' '' "$dir"
-	  dir=$lt_sysroot$func_stripname_result
-	  ;;
-	*)
-	  func_fatal_error "only absolute run-paths are allowed"
-	  ;;
-	esac
-	case "$xrpath " in
-	*" $dir "*) ;;
-	*) xrpath+=" $dir" ;;
-	esac
-	continue
-	;;
-
-      -shared)
-	# The effects of -shared are defined in a previous loop.
-	continue
-	;;
-
-      -shrext)
-	prev=shrext
-	continue
-	;;
-
-      -static | -static-libtool-libs)
-	# The effects of -static are defined in a previous loop.
-	# We used to do the same as -all-static on platforms that
-	# didn't have a PIC flag, but the assumption that the effects
-	# would be equivalent was wrong.  It would break on at least
-	# Digital Unix and AIX.
-	continue
-	;;
-
-      -thread-safe)
-	thread_safe=yes
-	continue
-	;;
-
-      -version-info)
-	prev=vinfo
-	continue
-	;;
-
-      -version-number)
-	prev=vinfo
-	vinfo_number=yes
-	continue
-	;;
-
-      -weak)
-        prev=weak
-	continue
-	;;
-
-      -Wc,*)
-	func_stripname '-Wc,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-          func_quote_for_eval "$flag"
-	  arg+=" $func_quote_for_eval_result"
-	  compiler_flags+=" $func_quote_for_eval_result"
-	done
-	IFS="$save_ifs"
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Wl,*)
-	func_stripname '-Wl,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-          func_quote_for_eval "$flag"
-	  arg+=" $wl$func_quote_for_eval_result"
-	  compiler_flags+=" $wl$func_quote_for_eval_result"
-	  linker_flags+=" $func_quote_for_eval_result"
-	done
-	IFS="$save_ifs"
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Xcompiler)
-	prev=xcompiler
-	continue
-	;;
-
-      -Xlinker)
-	prev=xlinker
-	continue
-	;;
-
-      -XCClinker)
-	prev=xcclinker
-	continue
-	;;
-
-      # -msg_* for osf cc
-      -msg_*)
-	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-
-      # Flags to be passed through unchanged, with rationale:
-      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
-      # -r[0-9][0-9]*        specify processor for the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
-      # +DA*, +DD*           enable 64-bit mode for the HP compiler
-      # -q*                  compiler args for the IBM compiler
-      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
-      # -F/path              path to uninstalled frameworks, gcc on darwin
-      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
-      # @file                GCC response files
-      # -tp=*                Portland pgcc target processor selection
-      # --sysroot=*          for sysroot support
-      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
-        func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-        compile_command+=" $arg"
-        finalize_command+=" $arg"
-        compiler_flags+=" $arg"
-        continue
-        ;;
-
-      # Some other compiler flag.
-      -* | +*)
-        func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-
-      *.$objext)
-	# A standard object.
-	objs+=" $arg"
-	;;
-
-      *.lo)
-	# A libtool-controlled object.
-
-	# Check to see that this really is a libtool object.
-	if func_lalib_unsafe_p "$arg"; then
-	  pic_object=
-	  non_pic_object=
-
-	  # Read the .lo file
-	  func_source "$arg"
-
-	  if test -z "$pic_object" ||
-	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none &&
-	     test "$non_pic_object" = none; then
-	    func_fatal_error "cannot find name of object for \`$arg'"
-	  fi
-
-	  # Extract subdirectory from the argument.
-	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
-
-	  if test "$pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
-
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		dlfiles+=" $pic_object"
-		prev=
-		continue
-	      else
-		# If libtool objects are unsupported, then we need to preload.
-		prev=dlprefiles
-	      fi
-	    fi
-
-	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
-	      # Preload the old-style object.
-	      dlprefiles+=" $pic_object"
-	      prev=
-	    fi
-
-	    # A PIC object.
-	    libobjs+=" $pic_object"
-	    arg="$pic_object"
-	  fi
-
-	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
-
-	    # A standard non-PIC object
-	    non_pic_objects+=" $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
-	    fi
-	  else
-	    # If the PIC object exists, use it instead.
-	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
-	    non_pic_objects+=" $non_pic_object"
-	  fi
-	else
-	  # Only an error if not doing a dry-run.
-	  if $opt_dry_run; then
-	    # Extract subdirectory from the argument.
-	    func_dirname "$arg" "/" ""
-	    xdir="$func_dirname_result"
-
-	    func_lo2o "$arg"
-	    pic_object=$xdir$objdir/$func_lo2o_result
-	    non_pic_object=$xdir$func_lo2o_result
-	    libobjs+=" $pic_object"
-	    non_pic_objects+=" $non_pic_object"
-	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
-	  fi
-	fi
-	;;
-
-      *.$libext)
-	# An archive.
-	deplibs+=" $arg"
-	old_deplibs+=" $arg"
-	continue
-	;;
-
-      *.la)
-	# A libtool-controlled library.
-
-	func_resolve_sysroot "$arg"
-	if test "$prev" = dlfiles; then
-	  # This library was specified with -dlopen.
-	  dlfiles+=" $func_resolve_sysroot_result"
-	  prev=
-	elif test "$prev" = dlprefiles; then
-	  # The library was specified with -dlpreopen.
-	  dlprefiles+=" $func_resolve_sysroot_result"
-	  prev=
-	else
-	  deplibs+=" $func_resolve_sysroot_result"
-	fi
-	continue
-	;;
-
-      # Some other compiler argument.
-      *)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-      esac # arg
-
-      # Now actually substitute the argument into the commands.
-      if test -n "$arg"; then
-	compile_command+=" $arg"
-	finalize_command+=" $arg"
-      fi
-    done # argument parsing loop
-
-    test -n "$prev" && \
-      func_fatal_help "the \`$prevarg' option requires an argument"
-
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
-      eval arg=\"$export_dynamic_flag_spec\"
-      compile_command+=" $arg"
-      finalize_command+=" $arg"
-    fi
-
-    oldlibs=
-    # calculate the name of the file, without its directory
-    func_basename "$output"
-    outputname="$func_basename_result"
-    libobjs_save="$libobjs"
-
-    if test -n "$shlibpath_var"; then
-      # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
-    else
-      shlib_search_path=
-    fi
-    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
-    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
-    func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
-    func_to_tool_file "$output_objdir/"
-    tool_output_objdir=$func_to_tool_file_result
-    # Create the object directory.
-    func_mkdir_p "$output_objdir"
-
-    # Determine the type of output
-    case $output in
-    "")
-      func_fatal_help "you must specify an output file"
-      ;;
-    *.$libext) linkmode=oldlib ;;
-    *.lo | *.$objext) linkmode=obj ;;
-    *.la) linkmode=lib ;;
-    *) linkmode=prog ;; # Anything else should be a program.
-    esac
-
-    specialdeplibs=
-
-    libs=
-    # Find all interdependent deplibs by searching for libraries
-    # that are linked more than once (e.g. -la -lb -la)
-    for deplib in $deplibs; do
-      if $opt_preserve_dup_deps ; then
-	case "$libs " in
-	*" $deplib "*) specialdeplibs+=" $deplib" ;;
-	esac
-      fi
-      libs+=" $deplib"
-    done
-
-    if test "$linkmode" = lib; then
-      libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
-      # Compute libraries that are listed more than once in $predeps
-      # $postdeps and mark them as special (i.e., whose duplicates are
-      # not to be eliminated).
-      pre_post_deps=
-      if $opt_duplicate_compiler_generated_deps; then
-	for pre_post_dep in $predeps $postdeps; do
-	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) specialdeplibs+=" $pre_post_deps" ;;
-	  esac
-	  pre_post_deps+=" $pre_post_dep"
-	done
-      fi
-      pre_post_deps=
-    fi
-
-    deplibs=
-    newdependency_libs=
-    newlib_search_path=
-    need_relink=no # whether we're linking any uninstalled libtool libraries
-    notinst_deplibs= # not-installed libtool libraries
-    notinst_path= # paths that contain not-installed libtool libraries
-
-    case $linkmode in
-    lib)
-	passes="conv dlpreopen link"
-	for file in $dlfiles $dlprefiles; do
-	  case $file in
-	  *.la) ;;
-	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
-	    ;;
-	  esac
-	done
-	;;
-    prog)
-	compile_deplibs=
-	finalize_deplibs=
-	alldeplibs=no
-	newdlfiles=
-	newdlprefiles=
-	passes="conv scan dlopen dlpreopen link"
-	;;
-    *)  passes="conv"
-	;;
-    esac
-
-    for pass in $passes; do
-      # The preopen pass in lib mode reverses $deplibs; put it back here
-      # so that -L comes before libs that need it for instance...
-      if test "$linkmode,$pass" = "lib,link"; then
-	## FIXME: Find the place where the list is rebuilt in the wrong
-	##        order, and fix it there properly
-        tmp_deplibs=
-	for deplib in $deplibs; do
-	  tmp_deplibs="$deplib $tmp_deplibs"
-	done
-	deplibs="$tmp_deplibs"
-      fi
-
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
-	deplibs=
-      fi
-      if test "$linkmode" = prog; then
-	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
-	esac
-      fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
-	# Collect and forward deplibs of preopened libtool libs
-	for lib in $dlprefiles; do
-	  # Ignore non-libtool-libs
-	  dependency_libs=
-	  func_resolve_sysroot "$lib"
-	  case $lib in
-	  *.la)	func_source "$func_resolve_sysroot_result" ;;
-	  esac
-
-	  # Collect preopened libtool deplibs, except any this library
-	  # has declared as weak libs
-	  for deplib in $dependency_libs; do
-	    func_basename "$deplib"
-            deplib_base=$func_basename_result
-	    case " $weak_libs " in
-	    *" $deplib_base "*) ;;
-	    *) deplibs+=" $deplib" ;;
-	    esac
-	  done
-	done
-	libs="$dlprefiles"
-      fi
-      if test "$pass" = dlopen; then
-	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
-	deplibs=
-      fi
-
-      for deplib in $libs; do
-	lib=
-	found=no
-	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    compiler_flags+=" $deplib"
-	    if test "$linkmode" = lib ; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags+=" $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    func_warning "\`-l' is ignored for archives/objects"
-	    continue
-	  fi
-	  func_stripname '-l' '' "$deplib"
-	  name=$func_stripname_result
-	  if test "$linkmode" = lib; then
-	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
-	  else
-	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
-	  fi
-	  for searchdir in $searchdirs; do
-	    for search_ext in .la $std_shrext .so .a; do
-	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
-	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
-		else
-		  found=no
-		fi
-		break 2
-	      fi
-	    done
-	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
-	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
-	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	      case " $predeps $postdeps " in
-	      *" $deplib "*)
-		if func_lalib_p "$lib"; then
-		  library_names=
-		  old_library=
-		  func_source "$lib"
-		  for l in $old_library $library_names; do
-		    ll="$l"
-		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
-		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
-		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
-		      compile_deplibs="$deplib $compile_deplibs"
-		      finalize_deplibs="$deplib $finalize_deplibs"
-		    else
-		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-		    fi
-		    continue
-		  fi
-		fi
-		;;
-	      *) ;;
-	      esac
-	    fi
-	  fi
-	  ;; # -l
-	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags+=" $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-L*)
-	  case $linkmode in
-	  lib)
-	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
-	    newdependency_libs="$deplib $newdependency_libs"
-	    func_stripname '-L' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    newlib_search_path+=" $func_resolve_sysroot_result"
-	    ;;
-	  prog)
-	    if test "$pass" = conv; then
-	      deplibs="$deplib $deplibs"
-	      continue
-	    fi
-	    if test "$pass" = scan; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    func_stripname '-L' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    newlib_search_path+=" $func_resolve_sysroot_result"
-	    ;;
-	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
-	    ;;
-	  esac # linkmode
-	  continue
-	  ;; # -L
-	-R*)
-	  if test "$pass" = link; then
-	    func_stripname '-R' '' "$deplib"
-	    func_resolve_sysroot "$func_stripname_result"
-	    dir=$func_resolve_sysroot_result
-	    # Make sure the xrpath contains only unique directories.
-	    case "$xrpath " in
-	    *" $dir "*) ;;
-	    *) xrpath+=" $dir" ;;
-	    esac
-	  fi
-	  deplibs="$deplib $deplibs"
-	  continue
-	  ;;
-	*.la)
-	  func_resolve_sysroot "$deplib"
-	  lib=$func_resolve_sysroot_result
-	  ;;
-	*.$libext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
-	  case $linkmode in
-	  lib)
-	    # Linking convenience modules into shared libraries is allowed,
-	    # but linking other static libraries is non-portable.
-	    case " $dlpreconveniencelibs " in
-	    *" $deplib "*) ;;
-	    *)
-	      valid_a_lib=no
-	      case $deplibs_check_method in
-		match_pattern*)
-		  set dummy $deplibs_check_method; shift
-		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
-		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=yes
-		  fi
-		;;
-		pass_all)
-		  valid_a_lib=yes
-		;;
-	      esac
-	      if test "$valid_a_lib" != yes; then
-		echo
-		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because the file extensions .$libext of this argument makes me believe"
-		echo "*** that it is just a static archive that I should not use here."
-	      else
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
-	      fi
-	      ;;
-	    esac
-	    continue
-	    ;;
-	  prog)
-	    if test "$pass" != link; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    continue
-	    ;;
-	  esac # linkmode
-	  ;; # *.$libext
-	*.lo | *.$objext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
-	      # If there is no dlopen support or we're linking statically,
-	      # we need to preload.
-	      newdlprefiles+=" $deplib"
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      newdlfiles+=" $deplib"
-	    fi
-	  fi
-	  continue
-	  ;;
-	%DEPLIBS%)
-	  alldeplibs=yes
-	  continue
-	  ;;
-	esac # case $deplib
-
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
-	fi
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "\`$lib' is not a valid libtool archive"
-
-	func_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
-
-	dlname=
-	dlopen=
-	dlpreopen=
-	libdir=
-	library_names=
-	old_library=
-	inherited_linker_flags=
-	# If the library was installed with an old release of libtool,
-	# it will not redefine variables installed, or shouldnotlink
-	installed=yes
-	shouldnotlink=no
-	avoidtemprpath=
-
-
-	# Read the .la file
-	func_source "$lib"
-
-	# Convert "-framework foo" to "foo.ltframework"
-	if test -n "$inherited_linker_flags"; then
-	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
-	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
-	    case " $new_inherited_linker_flags " in
-	      *" $tmp_inherited_linker_flag "*) ;;
-	      *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";;
-	    esac
-	  done
-	fi
-	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-	  test -n "$dlopen" && dlfiles+=" $dlopen"
-	  test -n "$dlpreopen" && dlprefiles+=" $dlpreopen"
-	fi
-
-	if test "$pass" = conv; then
-	  # Only check for convenience libraries
-	  deplibs="$lib $deplibs"
-	  if test -z "$libdir"; then
-	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for \`$lib'"
-	    fi
-	    # It is a libtool convenience library, so add in its objects.
-	    convenience+=" $ladir/$objdir/$old_library"
-	    old_convenience+=" $ladir/$objdir/$old_library"
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    func_fatal_error "\`$lib' is not a convenience library"
-	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs+=" $deplib" ;;
-	      esac
-	    fi
-	    tmp_libs+=" $deplib"
-	  done
-	  continue
-	fi # $pass = conv
-
-
-	# Get the name of the library we link against.
-	linklib=
-	if test -n "$old_library" &&
-	   { test "$prefer_static_libs" = yes ||
-	     test "$prefer_static_libs,$installed" = "built,no"; }; then
-	  linklib=$old_library
-	else
-	  for l in $old_library $library_names; do
-	    linklib="$l"
-	  done
-	fi
-	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for \`$lib'"
-	fi
-
-	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
-	  fi
-	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
-	    # If there is no dlname, no dlopen support or we're linking
-	    # statically, we need to preload.  We also need to preload any
-	    # dependent libraries so libltdl's deplib preloader doesn't
-	    # bomb out in the load deplibs phase.
-	    dlprefiles+=" $lib $dependency_libs"
-	  else
-	    newdlfiles+=" $lib"
-	  fi
-	  continue
-	fi # $pass = dlopen
-
-	# We need an absolute path.
-	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
-	*)
-	  abs_ladir=`cd "$ladir" && pwd`
-	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of \`$ladir'"
-	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
-	  fi
-	  ;;
-	esac
-	func_basename "$lib"
-	laname="$func_basename_result"
-
-	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
-	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library \`$lib' was moved."
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
-	  else
-	    dir="$lt_sysroot$libdir"
-	    absdir="$lt_sysroot$libdir"
-	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
-	else
-	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    # Remove this search path later
-	    notinst_path+=" $abs_ladir"
-	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
-	    # Remove this search path later
-	    notinst_path+=" $abs_ladir"
-	  fi
-	fi # $installed = yes
-	func_stripname 'lib' '.la' "$laname"
-	name=$func_stripname_result
-
-	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir" && test "$linkmode" = prog; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
-	  fi
-	  case "$host" in
-	    # special handling for platforms with PE-DLLs.
-	    *cygwin* | *mingw* | *cegcc* )
-	      # Linker will automatically link against shared library if both
-	      # static and shared are present.  Therefore, ensure we extract
-	      # symbols from the import library if a shared library is present
-	      # (otherwise, the dlopen module name will be incorrect).  We do
-	      # this by putting the import library name into $newdlprefiles.
-	      # We recover the dlopen module name by 'saving' the la file
-	      # name in a special purpose variable, and (later) extracting the
-	      # dlname from the la file.
-	      if test -n "$dlname"; then
-	        func_tr_sh "$dir/$linklib"
-	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
-	        newdlprefiles+=" $dir/$linklib"
-	      else
-	        newdlprefiles+=" $dir/$old_library"
-	        # Keep a list of preopened convenience libraries to check
-	        # that they are being used correctly in the link pass.
-	        test -z "$libdir" && \
-	          dlpreconveniencelibs+=" $dir/$old_library"
-	      fi
-	    ;;
-	    * )
-	      # Prefer using a static library (so that no silly _DYNAMIC symbols
-	      # are required to link).
-	      if test -n "$old_library"; then
-	        newdlprefiles+=" $dir/$old_library"
-	        # Keep a list of preopened convenience libraries to check
-	        # that they are being used correctly in the link pass.
-	        test -z "$libdir" && \
-	          dlpreconveniencelibs+=" $dir/$old_library"
-	      # Otherwise, use the dlname, so that lt_dlopen finds it.
-	      elif test -n "$dlname"; then
-	        newdlprefiles+=" $dir/$dlname"
-	      else
-	        newdlprefiles+=" $dir/$linklib"
-	      fi
-	    ;;
-	  esac
-	fi # $pass = dlpreopen
-
-	if test -z "$libdir"; then
-	  # Link the convenience library
-	  if test "$linkmode" = lib; then
-	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$dir/$old_library $compile_deplibs"
-	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
-	  else
-	    deplibs="$lib $deplibs" # used for prog,scan pass
-	  fi
-	  continue
-	fi
-
-
-	if test "$linkmode" = prog && test "$pass" != link; then
-	  newlib_search_path+=" $ladir"
-	  deplibs="$lib $deplibs"
-
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
-	  fi
-
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    case $deplib in
-	    -L*) func_stripname '-L' '' "$deplib"
-	         func_resolve_sysroot "$func_stripname_result"
-	         newlib_search_path+=" $func_resolve_sysroot_result"
-		 ;;
-	    esac
-	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      # Need to hardcode shared library paths
-	      # or/and link against static libraries
-	      newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs+=" $deplib" ;;
-	      esac
-	    fi
-	    tmp_libs+=" $deplib"
-	  done # for deplib
-	  continue
-	fi # $linkmode = prog...
-
-	if test "$linkmode,$pass" = "prog,link"; then
-	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
-	       test -z "$old_library"; }; then
-	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
-	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
-	      *"$absdir:"*) ;;
-	      *) temp_rpath+="$absdir:" ;;
-	      esac
-	    fi
-
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) compile_rpath+=" $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) finalize_rpath+=" $libdir" ;;
-	      esac
-	      ;;
-	    esac
-	  fi # $linkmode,$pass = prog,link...
-
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
-		 test -n "$library_names"; }; }; then
-	    # We only need to search for static libraries
-	    continue
-	  fi
-	fi
-
-	link_static=no # Whether the deplib will be linked statically
-	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes; then
-	  use_static_libs=no
-	fi
-	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
-	  case $host in
-	  *cygwin* | *mingw* | *cegcc*)
-	      # No point in relinking DLLs because paths are not encoded
-	      notinst_deplibs+=" $lib"
-	      need_relink=no
-	    ;;
-	  *)
-	    if test "$installed" = no; then
-	      notinst_deplibs+=" $lib"
-	      need_relink=yes
-	    fi
-	    ;;
-	  esac
-	  # This is a shared library
-
-	  # Warn about portability, can't link against -module's on some
-	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
-	  for dlpremoduletest in $dlprefiles; do
-	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
-	      break
-	    fi
-	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
-	    echo
-	    if test "$linkmode" = prog; then
-	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
-	    else
-	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
-	    fi
-	    $ECHO "*** $linklib is not portable!"
-	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) compile_rpath+=" $absdir" ;;
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) finalize_rpath+=" $libdir" ;;
-	      esac
-	      ;;
-	    esac
-	  fi
-
-	  if test -n "$old_archive_from_expsyms_cmds"; then
-	    # figure out the soname
-	    set dummy $library_names
-	    shift
-	    realname="$1"
-	    shift
-	    libname=`eval "\\$ECHO \"$libname_spec\""`
-	    # use dlname if we got it. it's perfectly good, no?
-	    if test -n "$dlname"; then
-	      soname="$dlname"
-	    elif test -n "$soname_spec"; then
-	      # bleh windows
-	      case $host in
-	      *cygwin* | mingw* | *cegcc*)
-	        func_arith $current - $age
-		major=$func_arith_result
-		versuffix="-$major"
-		;;
-	      esac
-	      eval soname=\"$soname_spec\"
-	    else
-	      soname="$realname"
-	    fi
-
-	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
-	    func_basename "$soroot"
-	    soname="$func_basename_result"
-	    func_stripname 'lib' '.dll' "$soname"
-	    newlib=libimp-$func_stripname_result.a
-
-	    # If the library has no export list, then create one now
-	    if test -f "$output_objdir/$soname-def"; then :
-	    else
-	      func_verbose "extracting exported symbol list from \`$soname'"
-	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
-	    fi
-
-	    # Create $newlib
-	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for \`$soname'"
-	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
-	    fi
-	    # make sure the library variables are pointing to the new library
-	    dir=$output_objdir
-	    linklib=$newlib
-	  fi # test -n "$old_archive_from_expsyms_cmds"
-
-	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    lib_linked=yes
-	    case $hardcode_action in
-	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
-		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
-		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
-		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
-		    # link against it, someone is ignoring the earlier warnings
-		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null ; then
-		      if test "X$dlopenmodule" != "X$lib"; then
-			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library" ; then
-			  echo
-			  echo "*** And there doesn't seem to be a static archive available"
-			  echo "*** The link will probably fail, sorry"
-			else
-			  add="$dir/$old_library"
-			fi
-		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
-		      fi
-		    fi
-		esac
-	      elif test "$hardcode_minus_L" = no; then
-		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
-		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    relink)
-	      if test "$hardcode_direct" = yes &&
-	         test "$hardcode_direct_absolute" = no; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$absdir"
-		# Try looking first in the location we're being installed to.
-		if test -n "$inst_prefix_dir"; then
-		  case $libdir in
-		    [\\/]*)
-		      add_dir+=" -L$inst_prefix_dir$libdir"
-		      ;;
-		  esac
-		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    *) lib_linked=no ;;
-	    esac
-
-	    if test "$lib_linked" != yes; then
-	      func_fatal_configuration "unsupported hardcode properties"
-	    fi
-
-	    if test -n "$add_shlibpath"; then
-	      case :$compile_shlibpath: in
-	      *":$add_shlibpath:"*) ;;
-	      *) compile_shlibpath+="$add_shlibpath:" ;;
-	      esac
-	    fi
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
-	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes &&
-		 test "$hardcode_minus_L" != yes &&
-		 test "$hardcode_shlibpath_var" = yes; then
-		case :$finalize_shlibpath: in
-		*":$libdir:"*) ;;
-		*) finalize_shlibpath+="$libdir:" ;;
-		esac
-	      fi
-	    fi
-	  fi
-
-	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes &&
-	       test "$hardcode_direct_absolute" = no; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
-	      case :$finalize_shlibpath: in
-	      *":$libdir:"*) ;;
-	      *) finalize_shlibpath+="$libdir:" ;;
-	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
-	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
-	      else
-		add="$libdir/$linklib"
-	      fi
-	    else
-	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
-	      # Try looking first in the location we're being installed to.
-	      if test -n "$inst_prefix_dir"; then
-		case $libdir in
-		  [\\/]*)
-		    add_dir+=" -L$inst_prefix_dir$libdir"
-		    ;;
-		esac
-	      fi
-	      add="-l$name"
-	    fi
-
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
-	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	    fi
-	  fi
-	elif test "$linkmode" = prog; then
-	  # Here we assume that one of hardcode_direct or hardcode_minus_L
-	  # is not unsupported.  This is valid on all known static and
-	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
-	    compile_deplibs="$dir/$linklib $compile_deplibs"
-	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
-	  else
-	    compile_deplibs="-l$name -L$dir $compile_deplibs"
-	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
-	  fi
-	elif test "$build_libtool_libs" = yes; then
-	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
-	    # We're trying link a shared library against a static one
-	    # but the system doesn't support it.
-
-	    # Just print a warning and add the library to dependency_libs so
-	    # that the program can be linked against the static library.
-	    echo
-	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
-	    echo "*** I have the capability to make that library automatically link in when"
-	    echo "*** you link to this library.  But I can only do this if you have a"
-	    echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
-	      echo "*** But as you try to build a module library, libtool will still create "
-	      echo "*** a static module, that should work as long as the dlopening application"
-	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
-	      if test -z "$global_symbol_pipe"; then
-		echo
-		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	      fi
-	      if test "$build_old_libs" = no; then
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  else
-	    deplibs="$dir/$old_library $deplibs"
-	    link_static=yes
-	  fi
-	fi # link shared/static library?
-
-	if test "$linkmode" = lib; then
-	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
-	    # Extract -R from dependency_libs
-	    temp_deplibs=
-	    for libdir in $dependency_libs; do
-	      case $libdir in
-	      -R*) func_stripname '-R' '' "$libdir"
-	           temp_xrpath=$func_stripname_result
-		   case " $xrpath " in
-		   *" $temp_xrpath "*) ;;
-		   *) xrpath+=" $temp_xrpath";;
-		   esac;;
-	      *) temp_deplibs+=" $libdir";;
-	      esac
-	    done
-	    dependency_libs="$temp_deplibs"
-	  fi
-
-	  newlib_search_path+=" $absdir"
-	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
-	  # ... and its dependency_libs
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    newdependency_libs="$deplib $newdependency_libs"
-	    case $deplib in
-              -L*) func_stripname '-L' '' "$deplib"
-                   func_resolve_sysroot "$func_stripname_result";;
-              *) func_resolve_sysroot "$deplib" ;;
-            esac
-	    if $opt_preserve_dup_deps ; then
-	      case "$tmp_libs " in
-	      *" $func_resolve_sysroot_result "*)
-                specialdeplibs+=" $func_resolve_sysroot_result" ;;
-	      esac
-	    fi
-	    tmp_libs+=" $func_resolve_sysroot_result"
-	  done
-
-	  if test "$link_all_deplibs" != no; then
-	    # Add the search paths of all dependency libraries
-	    for deplib in $dependency_libs; do
-	      path=
-	      case $deplib in
-	      -L*) path="$deplib" ;;
-	      *.la)
-	        func_resolve_sysroot "$deplib"
-	        deplib=$func_resolve_sysroot_result
-	        func_dirname "$deplib" "" "."
-		dir=$func_dirname_result
-		# We need an absolute path.
-		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
-		*)
-		  absdir=`cd "$dir" && pwd`
-		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of \`$dir'"
-		    absdir="$dir"
-		  fi
-		  ;;
-		esac
-		if $GREP "^installed=no" $deplib > /dev/null; then
-		case $host in
-		*-*-darwin*)
-		  depdepl=
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
-		      depdepl=$tmp
-		    done
-		    if test -f "$absdir/$objdir/$depdepl" ; then
-		      depdepl="$absdir/$objdir/$depdepl"
-		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
-                      if test -z "$darwin_install_name"; then
-                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
-                      fi
-		      compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}"
-		      path=
-		    fi
-		  fi
-		  ;;
-		*)
-		  path="-L$absdir/$objdir"
-		  ;;
-		esac
-		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
-		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
-
-		  path="-L$absdir"
-		fi
-		;;
-	      esac
-	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$path $deplibs" ;;
-	      esac
-	    done
-	  fi # link_all_deplibs != no
-	fi # linkmode = lib
-      done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; then
-	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
-	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
-	else
-	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	fi
-      fi
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
-	# Link the dlpreopened libraries before other libraries
-	for deplib in $save_deplibs; do
-	  deplibs="$deplib $deplibs"
-	done
-      fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
-	  # Make sure lib_search_path contains only unique directories.
-	  lib_search_path=
-	  for dir in $newlib_search_path; do
-	    case "$lib_search_path " in
-	    *" $dir "*) ;;
-	    *) lib_search_path+=" $dir" ;;
-	    esac
-	  done
-	  newlib_search_path=
-	fi
-
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
-	  vars="compile_deplibs finalize_deplibs"
-	fi
-	for var in $vars dependency_libs; do
-	  # Add libraries to $var in reverse order
-	  eval tmp_libs=\"\$$var\"
-	  new_libs=
-	  for deplib in $tmp_libs; do
-	    # FIXME: Pedantically, this is the right thing to do, so
-	    #        that some nasty dependency loop isn't accidentally
-	    #        broken:
-	    #new_libs="$deplib $new_libs"
-	    # Pragmatically, this seems to cause very few problems in
-	    # practice:
-	    case $deplib in
-	    -L*) new_libs="$deplib $new_libs" ;;
-	    -R*) ;;
-	    *)
-	      # And here is the reason: when a library appears more
-	      # than once as an explicit dependence of a library, or
-	      # is implicitly linked in more than once by the
-	      # compiler, it is considered special, and multiple
-	      # occurrences thereof are not removed.  Compare this
-	      # with having the same library being listed as a
-	      # dependency of multiple other libraries: in this case,
-	      # we know (pedantically, we assume) the library does not
-	      # need to be listed more than once, so we keep only the
-	      # last copy.  This is not always right, but it is rare
-	      # enough that we require users that really mean to play
-	      # such unportable linking tricks to link the library
-	      # using -Wl,-lname, so that libtool does not consider it
-	      # for duplicate removal.
-	      case " $specialdeplibs " in
-	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
-	      *)
-		case " $new_libs " in
-		*" $deplib "*) ;;
-		*) new_libs="$deplib $new_libs" ;;
-		esac
-		;;
-	      esac
-	      ;;
-	    esac
-	  done
-	  tmp_libs=
-	  for deplib in $new_libs; do
-	    case $deplib in
-	    -L*)
-	      case " $tmp_libs " in
-	      *" $deplib "*) ;;
-	      *) tmp_libs+=" $deplib" ;;
-	      esac
-	      ;;
-	    *) tmp_libs+=" $deplib" ;;
-	    esac
-	  done
-	  eval $var=\"$tmp_libs\"
-	done # for var
-      fi
-      # Last step: remove runtime libs from dependency_libs
-      # (they stay in deplibs)
-      tmp_libs=
-      for i in $dependency_libs ; do
-	case " $predeps $postdeps $compiler_lib_search_path " in
-	*" $i "*)
-	  i=""
-	  ;;
-	esac
-	if test -n "$i" ; then
-	  tmp_libs+=" $i"
-	fi
-      done
-      dependency_libs=$tmp_libs
-    done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
-    fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
-    fi
-
-    case $linkmode in
-    oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
-
-      test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
-
-      test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
-
-      test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
-
-      # Now set the variables for building old libraries.
-      build_libtool_libs=no
-      oldlibs="$output"
-      objs+="$old_deplibs"
-      ;;
-
-    lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
-      case $outputname in
-      lib*)
-	func_stripname 'lib' '.la' "$outputname"
-	name=$func_stripname_result
-	eval shared_ext=\"$shrext_cmds\"
-	eval libname=\"$libname_spec\"
-	;;
-      *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
-
-	if test "$need_lib_prefix" != no; then
-	  # Add the "lib" prefix for modules if required
-	  func_stripname '' '.la' "$outputname"
-	  name=$func_stripname_result
-	  eval shared_ext=\"$shrext_cmds\"
-	  eval libname=\"$libname_spec\"
-	else
-	  func_stripname '' '.la' "$outputname"
-	  libname=$func_stripname_result
-	fi
-	;;
-      esac
-
-      if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
-	else
-	  echo
-	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
-	  $ECHO "*** objects $objs is not portable!"
-	  libobjs+=" $objs"
-	fi
-      fi
-
-      test "$dlself" != no && \
-	func_warning "\`-dlopen self' is ignored for libtool libraries"
-
-      set dummy $rpath
-      shift
-      test "$#" -gt 1 && \
-	func_warning "ignoring multiple \`-rpath's for a libtool library"
-
-      install_libdir="$1"
-
-      oldlibs=
-      if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
-	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
-	  # convenience libraries should have the same extension an
-	  # archive normally would.
-	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
-	  build_libtool_libs=convenience
-	  build_old_libs=yes
-	fi
-
-	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
-
-	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
-      else
-
-	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
-	set dummy $vinfo 0 0 0
-	shift
-	IFS="$save_ifs"
-
-	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
-
-	# convert absolute version numbers to libtool ages
-	# this retains compatibility with .la files and attempts
-	# to make the code below a bit more comprehensible
-
-	case $vinfo_number in
-	yes)
-	  number_major="$1"
-	  number_minor="$2"
-	  number_revision="$3"
-	  #
-	  # There are really only two kinds -- those that
-	  # use the current revision as the major version
-	  # and those that subtract age and use age as
-	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
-	  #
-	  case $version_type in
-	  # correct linux to gnu/linux during the next big refactor
-	  darwin|linux|osf|windows|none)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
-	    ;;
-	  freebsd-aout|freebsd-elf|qnx|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
-	    ;;
-	  irix|nonstopux)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_minor"
-	    lt_irix_increment=no
-	    ;;
-	  esac
-	  ;;
-	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
-	  ;;
-	esac
-
-	# Check that each of the things are valid numbers.
-	case $current in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "CURRENT \`$current' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $revision in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "REVISION \`$revision' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $age in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "AGE \`$age' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	if test "$age" -gt "$current"; then
-	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	fi
-
-	# Calculate the version variables.
-	major=
-	versuffix=
-	verstring=
-	case $version_type in
-	none) ;;
-
-	darwin)
-	  # Like Linux, but with the current version available in
-	  # verstring for coding it into the library header
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
-	  # Darwin ld doesn't like 0 for these options...
-	  func_arith $current + 1
-	  minor_current=$func_arith_result
-	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
-	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-	  ;;
-
-	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
-	  ;;
-
-	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
-	  ;;
-
-	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
-	    func_arith $current - $age
-	  else
-	    func_arith $current - $age + 1
-	  fi
-	  major=$func_arith_result
-
-	  case $version_type in
-	    nonstopux) verstring_prefix=nonstopux ;;
-	    *)         verstring_prefix=sgi ;;
-	  esac
-	  verstring="$verstring_prefix$major.$revision"
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$revision
-	  while test "$loop" -ne 0; do
-	    func_arith $revision - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
-	  done
-
-	  # Before this point, $major must not contain `.'.
-	  major=.$major
-	  versuffix="$major.$revision"
-	  ;;
-
-	linux) # correct to gnu/linux during the next big refactor
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
-	  ;;
-
-	osf)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$age
-	  while test "$loop" -ne 0; do
-	    func_arith $current - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
-	  done
-
-	  # Make executables depend on our current version.
-	  verstring+=":${current}.0"
-	  ;;
-
-	qnx)
-	  major=".$current"
-	  versuffix=".$current"
-	  ;;
-
-	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
-	  ;;
-
-	windows)
-	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
-	  func_arith $current - $age
-	  major=$func_arith_result
-	  versuffix="-$major"
-	  ;;
-
-	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
-	  ;;
-	esac
-
-	# Clear the version info if we defaulted, and they specified a release.
-	if test -z "$vinfo" && test -n "$release"; then
-	  major=
-	  case $version_type in
-	  darwin)
-	    # we can't check for "0.0" in archive_cmds due to quoting
-	    # problems, so we reset it completely
-	    verstring=
-	    ;;
-	  *)
-	    verstring="0.0"
-	    ;;
-	  esac
-	  if test "$need_version" = no; then
-	    versuffix=
-	  else
-	    versuffix=".0.0"
-	  fi
-	fi
-
-	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
-	  major=
-	  versuffix=
-	  verstring=""
-	fi
-
-	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    func_warning "undefined symbols not allowed in $host shared libraries"
-	    build_libtool_libs=no
-	    build_old_libs=yes
-	  fi
-	else
-	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
-	fi
-
-      fi
-
-      func_generate_dlsyms "$libname" "$libname" "yes"
-      libobjs+=" $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
-
-      if test "$opt_mode" != relink; then
-	# Remove our outputs, but don't remove object files since they
-	# may have been created when compiling PIC objects.
-	removelist=
-	tempremovelist=`$ECHO "$output_objdir/*"`
-	for p in $tempremovelist; do
-	  case $p in
-	    *.$objext | *.gcno)
-	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
-		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-		 then
-		   continue
-		 fi
-	       fi
-	       removelist+=" $p"
-	       ;;
-	    *) ;;
-	  esac
-	done
-	test -n "$removelist" && \
-	  func_show_eval "${RM}r \$removelist"
-      fi
-
-      # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
-	oldlibs+=" $output_objdir/$libname.$libext"
-
-	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
-      fi
-
-      # Eliminate all temporary directories.
-      #for path in $notinst_path; do
-      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
-      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
-      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
-      #done
-
-      if test -n "$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	temp_xrpath=
-	for libdir in $xrpath; do
-	  func_replace_sysroot "$libdir"
-	  temp_xrpath+=" -R$func_replace_sysroot_result"
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_rpath+=" $libdir" ;;
-	  esac
-	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
-	  dependency_libs="$temp_xrpath $dependency_libs"
-	fi
-      fi
-
-      # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
-      dlfiles=
-      for lib in $old_dlfiles; do
-	case " $dlprefiles $dlfiles " in
-	*" $lib "*) ;;
-	*) dlfiles+=" $lib" ;;
-	esac
-      done
-
-      # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
-      dlprefiles=
-      for lib in $old_dlprefiles; do
-	case "$dlprefiles " in
-	*" $lib "*) ;;
-	*) dlprefiles+=" $lib" ;;
-	esac
-      done
-
-      if test "$build_libtool_libs" = yes; then
-	if test -n "$rpath"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
-	    # these systems don't actually have a c library (as such)!
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C library is in the System framework
-	    deplibs+=" System.ltframework"
-	    ;;
-	  *-*-netbsd*)
-	    # Don't link with libc until the a.out ld.so is fixed.
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    ;;
-	  *)
-	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
-	      deplibs+=" -lc"
-	    fi
-	    ;;
-	  esac
-	fi
-
-	# Transform deplibs into only deplibs that can be linked in shared.
-	name_save=$name
-	libname_save=$libname
-	release_save=$release
-	versuffix_save=$versuffix
-	major_save=$major
-	# I'm not sure if I'm treating the release correctly.  I think
-	# release should show up in the -l (ie -lgmp5) so we don't want to
-	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
-	newdeplibs=
-	droppeddeps=no
-	case $deplibs_check_method in
-	pass_all)
-	  # Don't check for shared/static.  Everything works.
-	  # This might be a little naive.  We might want to check
-	  # whether the library exists or not.  But this is on
-	  # osf3 & osf4 and I'm not really sure... Just
-	  # implementing what was already the behavior.
-	  newdeplibs=$deplibs
-	  ;;
-	test_compile)
-	  # This code stresses the "libraries are programs" paradigm to its
-	  # limits. Maybe even breaks it.  We compile a program, linking it
-	  # against the deplibs as a proxy for the library.  Then we can check
-	  # whether they linked in statically or dynamically with ldd.
-	  $opt_dry_run || $RM conftest.c
-	  cat > conftest.c <<EOF
-	  int main() { return 0; }
-EOF
-	  $opt_dry_run || $RM conftest
-	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
-	    ldd_output=`ldd conftest`
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		  case " $predeps $postdeps " in
-		  *" $i "*)
-		    newdeplibs+=" $i"
-		    i=""
-		    ;;
-		  esac
-		fi
-		if test -n "$i" ; then
-		  libname=`eval "\\$ECHO \"$libname_spec\""`
-		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		  set dummy $deplib_matches; shift
-		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		    newdeplibs+=" $i"
-		  else
-		    droppeddeps=yes
-		    echo
-		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		    echo "*** I have the capability to make that library automatically link in when"
-		    echo "*** you link to this library.  But I can only do this if you have a"
-		    echo "*** shared version of the library, which I believe you do not have"
-		    echo "*** because a test_compile did reveal that the linker did not use it for"
-		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
-		  fi
-		fi
-		;;
-	      *)
-		newdeplibs+=" $i"
-		;;
-	      esac
-	    done
-	  else
-	    # Error occurred in the first compile.  Let's try to salvage
-	    # the situation: Compile a separate program for each library.
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		$opt_dry_run || $RM conftest
-		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
-		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		    case " $predeps $postdeps " in
-		    *" $i "*)
-		      newdeplibs+=" $i"
-		      i=""
-		      ;;
-		    esac
-		  fi
-		  if test -n "$i" ; then
-		    libname=`eval "\\$ECHO \"$libname_spec\""`
-		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		    set dummy $deplib_matches; shift
-		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		      newdeplibs+=" $i"
-		    else
-		      droppeddeps=yes
-		      echo
-		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		      echo "*** I have the capability to make that library automatically link in when"
-		      echo "*** you link to this library.  But I can only do this if you have a"
-		      echo "*** shared version of the library, which you do not appear to have"
-		      echo "*** because a test_compile did reveal that the linker did not use this one"
-		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
-		    fi
-		  fi
-		else
-		  droppeddeps=yes
-		  echo
-		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
-		  echo "*** make it link in!  You will probably need to install it or some"
-		  echo "*** library that it depends on before this library will be fully"
-		  echo "*** functional.  Installing it before continuing would be even better."
-		fi
-		;;
-	      *)
-		newdeplibs+=" $i"
-		;;
-	      esac
-	    done
-	  fi
-	  ;;
-	file_magic*)
-	  set dummy $deplibs_check_method; shift
-	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  newdeplibs+=" $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		if test -n "$file_magic_glob"; then
-		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
-		else
-		  libnameglob=$libname
-		fi
-		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test "$want_nocaseglob" = yes; then
-		    shopt -s nocaseglob
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		    $nocaseglob
-		  else
-		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-		  fi
-		  for potent_lib in $potential_libs; do
-		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null |
-			 $GREP " -> " >/dev/null; then
-			continue
-		      fi
-		      # The statement above tries to avoid entering an
-		      # endless loop below, in case of cyclic links.
-		      # We might still enter an endless loop, since a link
-		      # loop can be closed while we follow links,
-		      # but so what?
-		      potlib="$potent_lib"
-		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
-			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
-			esac
-		      done
-		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
-			 $SED -e 10q |
-			 $EGREP "$file_magic_regex" > /dev/null; then
-			newdeplibs+=" $a_deplib"
-			a_deplib=""
-			break 2
-		      fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a file magic. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      newdeplibs+=" $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	match_pattern*)
-	  set dummy $deplibs_check_method; shift
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  newdeplibs+=" $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
-		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
-		       $EGREP "$match_pattern_regex" > /dev/null; then
-		      newdeplibs+=" $a_deplib"
-		      a_deplib=""
-		      break 2
-		    fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		echo
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		echo "*** I have the capability to make that library automatically link in when"
-		echo "*** you link to this library.  But I can only do this if you have a"
-		echo "*** shared version of the library, which you do not appear to have"
-		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      newdeplibs+=" $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	none | unknown | *)
-	  newdeplibs=""
-	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
-	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
-	    done
-	  fi
-	  case $tmp_deplibs in
-	  *[!\	\ ]*)
-	    echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
-	      echo "*** Warning: inter-library dependencies are not supported in this platform."
-	    else
-	      echo "*** Warning: inter-library dependencies are not known to be supported."
-	    fi
-	    echo "*** All declared inter-library dependencies are being dropped."
-	    droppeddeps=yes
-	    ;;
-	  esac
-	  ;;
-	esac
-	versuffix=$versuffix_save
-	major=$major_save
-	release=$release_save
-	libname=$libname_save
-	name=$name_save
-
-	case $host in
-	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library with the System framework
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
-	  ;;
-	esac
-
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
-	    echo
-	    echo "*** Warning: libtool could not satisfy all declared inter-library"
-	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
-	    echo "*** a static module, that should work as long as the dlopening"
-	    echo "*** application is linked with the -dlopen flag."
-	    if test -z "$global_symbol_pipe"; then
-	      echo
-	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
-	      build_libtool_libs=module
-	      build_old_libs=yes
-	    else
-	      build_libtool_libs=no
-	    fi
-	  else
-	    echo "*** The inter-library dependencies that have been dropped here will be"
-	    echo "*** automatically added whenever a program is linked with this library"
-	    echo "*** or is declared to -dlopen it."
-
-	    if test "$allow_undefined" = no; then
-	      echo
-	      echo "*** Since this library must not contain undefined symbols,"
-	      echo "*** because either the platform does not support them or"
-	      echo "*** it was explicitly requested with -no-undefined,"
-	      echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  fi
-	fi
-	# Done checking deplibs!
-	deplibs=$newdeplibs
-      fi
-      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
-      case $host in
-	*-*-darwin*)
-	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  ;;
-      esac
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $deplibs " in
-	  *" -L$path/$objdir "*)
-	    new_libs+=" -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) new_libs+=" $deplib" ;;
-	  esac
-	  ;;
-	*) new_libs+=" $deplib" ;;
-	esac
-      done
-      deplibs="$new_libs"
-
-      # All the library-specific variables (install_libdir is set above).
-      library_names=
-      old_library=
-      dlname=
-
-      # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	# Remove ${wl} instances when linking with ld.
-	# FIXME: should test the right _cmds variable.
-	case $archive_cmds in
-	  *\$LD\ *) wl= ;;
-        esac
-	if test "$hardcode_into_libs" = yes; then
-	  # Hardcode the library paths
-	  hardcode_libdirs=
-	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
-	  for libdir in $rpath; do
-	    if test -n "$hardcode_libdir_flag_spec"; then
-	      if test -n "$hardcode_libdir_separator"; then
-		func_replace_sysroot "$libdir"
-		libdir=$func_replace_sysroot_result
-		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
-		else
-		  # Just accumulate the unique libdirs.
-		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		    ;;
-		  *)
-		    hardcode_libdirs+="$hardcode_libdir_separator$libdir"
-		    ;;
-		  esac
-		fi
-	      else
-		eval flag=\"$hardcode_libdir_flag_spec\"
-		dep_rpath+=" $flag"
-	      fi
-	    elif test -n "$runpath_var"; then
-	      case "$perm_rpath " in
-	      *" $libdir "*) ;;
-	      *) perm_rpath+=" $libdir" ;;
-	      esac
-	    fi
-	  done
-	  # Substitute the hardcoded libdirs into the rpath.
-	  if test -n "$hardcode_libdir_separator" &&
-	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
-	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
-	  fi
-	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
-	    # We should set the runpath_var.
-	    rpath=
-	    for dir in $perm_rpath; do
-	      rpath+="$dir:"
-	    done
-	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
-	  fi
-	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
-	fi
-
-	shlibpath="$finalize_shlibpath"
-	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
-	if test -n "$shlibpath"; then
-	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
-	fi
-
-	# Get the real and link names of the library.
-	eval shared_ext=\"$shrext_cmds\"
-	eval library_names=\"$library_names_spec\"
-	set dummy $library_names
-	shift
-	realname="$1"
-	shift
-
-	if test -n "$soname_spec"; then
-	  eval soname=\"$soname_spec\"
-	else
-	  soname="$realname"
-	fi
-	if test -z "$dlname"; then
-	  dlname=$soname
-	fi
-
-	lib="$output_objdir/$realname"
-	linknames=
-	for link
-	do
-	  linknames+=" $link"
-	done
-
-	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	test "X$libobjs" = "X " && libobjs=
-
-	delfiles=
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols="$output_objdir/$libname.uexp"
-	  delfiles+=" $export_symbols"
-	fi
-
-	orig_export_symbols=
-	case $host_os in
-	cygwin* | mingw* | cegcc*)
-	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
-	    # exporting using user supplied symfile
-	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
-	      # and it's NOT already a .def file. Must figure out
-	      # which of the given symbols are data symbols and tag
-	      # them as such. So, trigger use of export_symbols_cmds.
-	      # export_symbols gets reassigned inside the "prepare
-	      # the list of exported symbols" if statement, so the
-	      # include_expsyms logic still works.
-	      orig_export_symbols="$export_symbols"
-	      export_symbols=
-	      always_export_symbols=yes
-	    fi
-	  fi
-	  ;;
-	esac
-
-	# Prepare the list of exported symbols
-	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
-	    $opt_dry_run || $RM $export_symbols
-	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
-	    for cmd1 in $cmds; do
-	      IFS="$save_ifs"
-	      # Take the normal branch if the nm_file_list_spec branch
-	      # doesn't work or if tool conversion is not needed.
-	      case $nm_file_list_spec~$to_tool_file_cmd in
-		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
-		  try_normal_branch=yes
-		  eval cmd=\"$cmd1\"
-		  func_len " $cmd"
-		  len=$func_len_result
-		  ;;
-		*)
-		  try_normal_branch=no
-		  ;;
-	      esac
-	      if test "$try_normal_branch" = yes \
-		 && { test "$len" -lt "$max_cmd_len" \
-		      || test "$max_cmd_len" -le -1; }
-	      then
-		func_show_eval "$cmd" 'exit $?'
-		skipped_export=false
-	      elif test -n "$nm_file_list_spec"; then
-		func_basename "$output"
-		output_la=$func_basename_result
-		save_libobjs=$libobjs
-		save_output=$output
-		output=${output_objdir}/${output_la}.nm
-		func_to_tool_file "$output"
-		libobjs=$nm_file_list_spec$func_to_tool_file_result
-		delfiles+=" $output"
-		func_verbose "creating $NM input file list: $output"
-		for obj in $save_libobjs; do
-		  func_to_tool_file "$obj"
-		  $ECHO "$func_to_tool_file_result"
-		done > "$output"
-		eval cmd=\"$cmd1\"
-		func_show_eval "$cmd" 'exit $?'
-		output=$save_output
-		libobjs=$save_libobjs
-		skipped_export=false
-	      else
-		# The command line is too long to execute in one step.
-		func_verbose "using reloadable object file for export list..."
-		skipped_export=:
-		# Break out early, otherwise skipped_export may be
-		# set to false by a later but shorter cmd.
-		break
-	      fi
-	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-	fi
-
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols="$export_symbols"
-	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
-	fi
-
-	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
-	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
-	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands which not all seds can handle. GNU sed should be fine
-	  # though. Also, the filter scales superlinearly with the number of
-	  # global variables. join(1) would be nice here, but unfortunately
-	  # isn't a blessed tool.
-	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	  delfiles+=" $export_symbols $output_objdir/$libname.filter"
-	  export_symbols=$output_objdir/$libname.def
-	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	fi
-
-	tmp_deplibs=
-	for test_deplib in $deplibs; do
-	  case " $convenience " in
-	  *" $test_deplib "*) ;;
-	  *)
-	    tmp_deplibs+=" $test_deplib"
-	    ;;
-	  esac
-	done
-	deplibs="$tmp_deplibs"
-
-	if test -n "$convenience"; then
-	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
-	    test -z "$libobjs"; then
-	    # extract the archives, so we have objects to list.
-	    # TODO: could optimize this to just extract one archive.
-	    whole_archive_flag_spec=
-	  fi
-	  if test -n "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  else
-	    gentop="$output_objdir/${outputname}x"
-	    generated+=" $gentop"
-
-	    func_extract_archives $gentop $convenience
-	    libobjs+=" $func_extract_archives_result"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	fi
-
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
-	  eval flag=\"$thread_safe_flag_spec\"
-	  linker_flags+=" $flag"
-	fi
-
-	# Make a backup of the uninstalled library when relinking
-	if test "$opt_mode" = relink; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
-	fi
-
-	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
-	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	    eval test_cmds=\"$module_expsym_cmds\"
-	    cmds=$module_expsym_cmds
-	  else
-	    eval test_cmds=\"$module_cmds\"
-	    cmds=$module_cmds
-	  fi
-	else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    eval test_cmds=\"$archive_expsym_cmds\"
-	    cmds=$archive_expsym_cmds
-	  else
-	    eval test_cmds=\"$archive_cmds\"
-	    cmds=$archive_cmds
-	  fi
-	fi
-
-	if test "X$skipped_export" != "X:" &&
-	   func_len " $test_cmds" &&
-	   len=$func_len_result &&
-	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  :
-	else
-	  # The command line is too long to link in one step, link piecewise
-	  # or, if using GNU ld and skipped_export is not :, use a linker
-	  # script.
-
-	  # Save the value of $output and $libobjs because we want to
-	  # use them later.  If we have whole_archive_flag_spec, we
-	  # want to use save_libobjs as it was before
-	  # whole_archive_flag_spec was expanded, because we can't
-	  # assume the linker understands whole_archive_flag_spec.
-	  # This may have to be revisited, in case too many
-	  # convenience libraries get linked in and end up exceeding
-	  # the spec.
-	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	  fi
-	  save_output=$output
-	  func_basename "$output"
-	  output_la=$func_basename_result
-
-	  # Clear the reloadable object creation command queue and
-	  # initialize k to one.
-	  test_cmds=
-	  concat_cmds=
-	  objlist=
-	  last_robj=
-	  k=1
-
-	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
-	    output=${output_objdir}/${output_la}.lnkscript
-	    func_verbose "creating GNU ld script: $output"
-	    echo 'INPUT (' > $output
-	    for obj in $save_libobjs
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    echo ')' >> $output
-	    delfiles+=" $output"
-	    func_to_tool_file "$output"
-	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
-	    output=${output_objdir}/${output_la}.lnk
-	    func_verbose "creating linker input file list: $output"
-	    : > $output
-	    set x $save_libobjs
-	    shift
-	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
-	      firstobj="$1 "
-	      shift
-	    fi
-	    for obj
-	    do
-	      func_to_tool_file "$obj"
-	      $ECHO "$func_to_tool_file_result" >> $output
-	    done
-	    delfiles+=" $output"
-	    func_to_tool_file "$output"
-	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
-	  else
-	    if test -n "$save_libobjs"; then
-	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-${k}.$objext
-	      eval test_cmds=\"$reload_cmds\"
-	      func_len " $test_cmds"
-	      len0=$func_len_result
-	      len=$len0
-
-	      # Loop over the list of objects to be linked.
-	      for obj in $save_libobjs
-	      do
-		func_len " $obj"
-		func_arith $len + $func_len_result
-		len=$func_arith_result
-		if test "X$objlist" = X ||
-		   test "$len" -lt "$max_cmd_len"; then
-		  objlist+=" $obj"
-		else
-		  # The command $test_cmds is almost too long, add a
-		  # command to the queue.
-		  if test "$k" -eq 1 ; then
-		    # The first file doesn't have a previous command to add.
-		    reload_objs=$objlist
-		    eval concat_cmds=\"$reload_cmds\"
-		  else
-		    # All subsequent reloadable object files will link in
-		    # the last one created.
-		    reload_objs="$objlist $last_robj"
-		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
-		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
-		  func_arith $k + 1
-		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
-		  objlist=" $obj"
-		  func_len " $last_robj"
-		  func_arith $len0 + $func_len_result
-		  len=$func_arith_result
-		fi
-	      done
-	      # Handle the remaining objects by creating one last
-	      # reloadable object file.  All subsequent reloadable object
-	      # files will link in the last one created.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
-	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
-	      fi
-	      delfiles+=" $output"
-
-	    else
-	      output=
-	    fi
-
-	    if ${skipped_export-false}; then
-	      func_verbose "generating symbol list for \`$libname.la'"
-	      export_symbols="$output_objdir/$libname.exp"
-	      $opt_dry_run || $RM $export_symbols
-	      libobjs=$output
-	      # Append the command to create the export file.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
-	      if test -n "$last_robj"; then
-		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
-	      fi
-	    fi
-
-	    test -n "$save_libobjs" &&
-	      func_verbose "creating a temporary reloadable object file: $output"
-
-	    # Loop through the commands generated above and execute them.
-	    save_ifs="$IFS"; IFS='~'
-	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
-		  func_quote_for_expand "$cmd"
-		  eval "func_echo $func_quote_for_expand_result"
-	      }
-	      $opt_dry_run || eval "$cmd" || {
-		lt_exit=$?
-
-		# Restore the uninstalled library and exit
-		if test "$opt_mode" = relink; then
-		  ( cd "$output_objdir" && \
-		    $RM "${realname}T" && \
-		    $MV "${realname}U" "$realname" )
-		fi
-
-		exit $lt_exit
-	      }
-	    done
-	    IFS="$save_ifs"
-
-	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-
-          if ${skipped_export-false}; then
-	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols="$export_symbols"
-	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
-	    fi
-
-	    if test -n "$orig_export_symbols"; then
-	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
-	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands which not all seds can handle. GNU sed should be fine
-	      # though. Also, the filter scales superlinearly with the number of
-	      # global variables. join(1) would be nice here, but unfortunately
-	      # isn't a blessed tool.
-	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	      delfiles+=" $export_symbols $output_objdir/$libname.filter"
-	      export_symbols=$output_objdir/$libname.def
-	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	    fi
-	  fi
-
-	  libobjs=$output
-	  # Restore the value of output.
-	  output=$save_output
-
-	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	  # Expand the library linking commands again to reset the
-	  # value of $libobjs for piecewise linking.
-
-	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
-	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	      cmds=$module_expsym_cmds
-	    else
-	      cmds=$module_cmds
-	    fi
-	  else
-	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	      cmds=$archive_expsym_cmds
-	    else
-	      cmds=$archive_cmds
-	    fi
-	  fi
-	fi
-
-	if test -n "$delfiles"; then
-	  # Append the command to remove temporary files to $cmds.
-	  eval cmds=\"\$cmds~\$RM $delfiles\"
-	fi
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  generated+=" $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  libobjs+=" $func_extract_archives_result"
-	  test "X$libobjs" = "X " && libobjs=
-	fi
-
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $opt_silent || {
-	    func_quote_for_expand "$cmd"
-	    eval "func_echo $func_quote_for_expand_result"
-	  }
-	  $opt_dry_run || eval "$cmd" || {
-	    lt_exit=$?
-
-	    # Restore the uninstalled library and exit
-	    if test "$opt_mode" = relink; then
-	      ( cd "$output_objdir" && \
-	        $RM "${realname}T" && \
-		$MV "${realname}U" "$realname" )
-	    fi
-
-	    exit $lt_exit
-	  }
-	done
-	IFS="$save_ifs"
-
-	# Restore the uninstalled library and exit
-	if test "$opt_mode" = relink; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
-	  if test -n "$convenience"; then
-	    if test -z "$whole_archive_flag_spec"; then
-	      func_show_eval '${RM}r "$gentop"'
-	    fi
-	  fi
-
-	  exit $EXIT_SUCCESS
-	fi
-
-	# Create links to the real library.
-	for linkname in $linknames; do
-	  if test "$realname" != "$linkname"; then
-	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
-	  fi
-	done
-
-	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
-	  # On all known operating systems, these are identical.
-	  dlname="$soname"
-	fi
-      fi
-      ;;
-
-    obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
-
-      test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
-
-      test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for objects"
-
-      case $output in
-      *.lo)
-	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
-
-	libobj=$output
-	func_lo2o "$libobj"
-	obj=$func_lo2o_result
-	;;
-      *)
-	libobj=
-	obj="$output"
-	;;
-      esac
-
-      # Delete the old objects.
-      $opt_dry_run || $RM $obj $libobj
-
-      # Objects from convenience libraries.  This assumes
-      # single-version convenience libraries.  Whenever we create
-      # different ones for PIC/non-PIC, this we'll have to duplicate
-      # the extraction.
-      reload_conv_objs=
-      gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
-      if test -n "$convenience"; then
-	if test -n "$whole_archive_flag_spec"; then
-	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
-	else
-	  gentop="$output_objdir/${obj}x"
-	  generated+=" $gentop"
-
-	  func_extract_archives $gentop $convenience
-	  reload_conv_objs="$reload_objs $func_extract_archives_result"
-	fi
-      fi
-
-      # If we're not building shared, we need to use non_pic_objs
-      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
-
-      # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
-      output="$obj"
-      func_execute_cmds "$reload_cmds" 'exit $?'
-
-      # Exit if we aren't doing a library object file.
-      if test -z "$libobj"; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      if test "$build_libtool_libs" != yes; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	# Create an invalid libtool object if no PIC, so that we don't
-	# accidentally link it into a program.
-	# $show "echo timestamp > $libobj"
-	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
-	exit $EXIT_SUCCESS
-      fi
-
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
-	# Only do commands if we really have different PIC objects.
-	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
-	func_execute_cmds "$reload_cmds" 'exit $?'
-      fi
-
-      if test -n "$gentop"; then
-	func_show_eval '${RM}r "$gentop"'
-      fi
-
-      exit $EXIT_SUCCESS
-      ;;
-
-    prog)
-      case $host in
-	*cygwin*) func_stripname '' '.exe' "$output"
-	          output=$func_stripname_result.exe;;
-      esac
-      test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for programs"
-
-      test "$preload" = yes \
-        && test "$dlopen_support" = unknown \
-	&& test "$dlopen_self" = unknown \
-	&& test "$dlopen_self_static" = unknown && \
-	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
-
-      case $host in
-      *-*-rhapsody* | *-*-darwin1.[012])
-	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
-	;;
-      esac
-
-      case $host in
-      *-*-darwin*)
-	# Don't allow lazy linking, it breaks C++ global constructors
-	# But is supposedly fixed on 10.4 or later (yay!).
-	if test "$tagname" = CXX ; then
-	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
-	    10.[0123])
-	      compile_command+=" ${wl}-bind_at_load"
-	      finalize_command+=" ${wl}-bind_at_load"
-	    ;;
-	  esac
-	fi
-	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
-	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	;;
-      esac
-
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $compile_deplibs " in
-	  *" -L$path/$objdir "*)
-	    new_libs+=" -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $compile_deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) new_libs+=" $deplib" ;;
-	  esac
-	  ;;
-	*) new_libs+=" $deplib" ;;
-	esac
-      done
-      compile_deplibs="$new_libs"
-
-
-      compile_command+=" $compile_deplibs"
-      finalize_command+=" $finalize_deplibs"
-
-      if test -n "$rpath$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	for libdir in $rpath $xrpath; do
-	  # This is the magic to use -rpath.
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_rpath+=" $libdir" ;;
-	  esac
-	done
-      fi
-
-      # Now hardcode the library paths
-      rpath=
-      hardcode_libdirs=
-      for libdir in $compile_rpath $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		hardcode_libdirs+="$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath+=" $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) perm_rpath+=" $libdir" ;;
-	  esac
-	fi
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$libdir:"*) ;;
-	  ::) dllsearchpath=$libdir;;
-	  *) dllsearchpath+=":$libdir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath+=":$testbindir";;
-	  esac
-	  ;;
-	esac
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      compile_rpath="$rpath"
-
-      rpath=
-      hardcode_libdirs=
-      for libdir in $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		hardcode_libdirs+="$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath+=" $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$finalize_perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_perm_rpath+=" $libdir" ;;
-	  esac
-	fi
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      finalize_rpath="$rpath"
-
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
-	# Transform all the library objects into standard objects.
-	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
-	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
-      fi
-
-      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
-
-      # template prelinking step
-      if test -n "$prelink_cmds"; then
-	func_execute_cmds "$prelink_cmds" 'exit $?'
-      fi
-
-      wrappers_required=yes
-      case $host in
-      *cegcc* | *mingw32ce*)
-        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=no
-        ;;
-      *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
-        ;;
-      *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
-        ;;
-      esac
-      if test "$wrappers_required" = no; then
-	# Replace the output file specification.
-	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
-
-	# We have no uninstalled library dependencies, so finalize right now.
-	exit_status=0
-	func_show_eval "$link_command" 'exit_status=$?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.${objext}"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
-	fi
-
-	exit $exit_status
-      fi
-
-      if test -n "$compile_shlibpath$finalize_shlibpath"; then
-	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
-      fi
-      if test -n "$finalize_shlibpath"; then
-	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
-      fi
-
-      compile_var=
-      finalize_var=
-      if test -n "$runpath_var"; then
-	if test -n "$perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $perm_rpath; do
-	    rpath+="$dir:"
-	  done
-	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-	if test -n "$finalize_perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $finalize_perm_rpath; do
-	    rpath+="$dir:"
-	  done
-	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-      fi
-
-      if test "$no_install" = yes; then
-	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
-	# Replace the output file specification.
-	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	# Delete the old output file.
-	$opt_dry_run || $RM $output
-	# Link the executable and exit
-	func_show_eval "$link_command" 'exit $?'
-
-	if test -n "$postlink_cmds"; then
-	  func_to_tool_file "$output"
-	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	  func_execute_cmds "$postlink_cmds" 'exit $?'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
-
-	func_warning "this platform does not like uninstalled shared libraries"
-	func_warning "\`$output' will be relinked during installation"
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
-
-      # Replace the output file specification.
-      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
-      # Delete the old output files.
-      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
-      func_show_eval "$link_command" 'exit $?'
-
-      if test -n "$postlink_cmds"; then
-	func_to_tool_file "$output_objdir/$outputname"
-	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-	func_execute_cmds "$postlink_cmds" 'exit $?'
-      fi
-
-      # Now create the wrapper script.
-      func_verbose "creating $output"
-
-      # Quote the relink command for shipping.
-      if test -n "$relink_command"; then
-	# Preserve any variables that may affect compiler behavior
-	for var in $variables_saved_for_relink; do
-	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	  elif eval var_value=\$$var; test -z "$var_value"; then
-	    relink_command="$var=; export $var; $relink_command"
-	  else
-	    func_quote_for_eval "$var_value"
-	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	  fi
-	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      fi
-
-      # Only actually do things if not in dry run mode.
-      $opt_dry_run || {
-	# win32 will think the script is a binary if it has
-	# a .exe suffix, so we strip it off here.
-	case $output in
-	  *.exe) func_stripname '' '.exe' "$output"
-	         output=$func_stripname_result ;;
-	esac
-	# test for cygwin because mv fails w/o .exe extensions
-	case $host in
-	  *cygwin*)
-	    exeext=.exe
-	    func_stripname '' '.exe' "$outputname"
-	    outputname=$func_stripname_result ;;
-	  *) exeext= ;;
-	esac
-	case $host in
-	  *cygwin* | *mingw* )
-	    func_dirname_and_basename "$output" "" "."
-	    output_name=$func_basename_result
-	    output_path=$func_dirname_result
-	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
-	    cwrapper="$output_path/$output_name.exe"
-	    $RM $cwrappersource $cwrapper
-	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_cwrapperexe_src > $cwrappersource
-
-	    # The wrapper executable is built using the $host compiler,
-	    # because it contains $host paths and files. If cross-
-	    # compiling, it, like the target executable, must be
-	    # executed on the $host or under an emulation environment.
-	    $opt_dry_run || {
-	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
-	      $STRIP $cwrapper
-	    }
-
-	    # Now, create the wrapper script for func_source use:
-	    func_ltwrapper_scriptname $cwrapper
-	    $RM $func_ltwrapper_scriptname_result
-	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
-	    $opt_dry_run || {
-	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host" ; then
-		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
-	      else
-		func_emit_wrapper no > $func_ltwrapper_scriptname_result
-	      fi
-	    }
-	  ;;
-	  * )
-	    $RM $output
-	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_wrapper no > $output
-	    chmod +x $output
-	  ;;
-	esac
-      }
-      exit $EXIT_SUCCESS
-      ;;
-    esac
-
-    # See if we need to build an old-fashioned archive.
-    for oldlib in $oldlibs; do
-
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save $symfileobj"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
-	  build_libtool_libs=no
-	else
-	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    oldobjs+=" $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
-
-      if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
-	generated+=" $gentop"
-
-	func_extract_archives $gentop $addlibs
-	oldobjs+=" $func_extract_archives_result"
-      fi
-
-      # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
-	cmds=$old_archive_from_new_cmds
-      else
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  generated+=" $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  oldobjs+=" $func_extract_archives_result"
-	fi
-
-	# POSIX demands no paths to be encoded in archives.  We have
-	# to avoid creating archives with duplicate basenames if we
-	# might have to extract them afterwards, e.g., when creating a
-	# static archive out of a convenience library, or when linking
-	# the entirety of a libtool archive into another (currently
-	# not supported by libtool).
-	if (for obj in $oldobjs
-	    do
-	      func_basename "$obj"
-	      $ECHO "$func_basename_result"
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	  :
-	else
-	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
-	  generated+=" $gentop"
-	  func_mkdir_p "$gentop"
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  counter=1
-	  for obj in $save_oldobjs
-	  do
-	    func_basename "$obj"
-	    objbase="$func_basename_result"
-	    case " $oldobjs " in
-	    " ") oldobjs=$obj ;;
-	    *[\ /]"$objbase "*)
-	      while :; do
-		# Make sure we don't pick an alternate name that also
-		# overlaps.
-		newobj=lt$counter-$objbase
-		func_arith $counter + 1
-		counter=$func_arith_result
-		case " $oldobjs " in
-		*[\ /]"$newobj "*) ;;
-		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
-		esac
-	      done
-	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      oldobjs+=" $gentop/$newobj"
-	      ;;
-	    *) oldobjs+=" $obj" ;;
-	    esac
-	  done
-	fi
-	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-	tool_oldlib=$func_to_tool_file_result
-	eval cmds=\"$old_archive_cmds\"
-
-	func_len " $cmds"
-	len=$func_len_result
-	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  cmds=$old_archive_cmds
-	elif test -n "$archiver_list_spec"; then
-	  func_verbose "using command file archive linking..."
-	  for obj in $oldobjs
-	  do
-	    func_to_tool_file "$obj"
-	    $ECHO "$func_to_tool_file_result"
-	  done > $output_objdir/$libname.libcmd
-	  func_to_tool_file "$output_objdir/$libname.libcmd"
-	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
-	  cmds=$old_archive_cmds
-	else
-	  # the command line is too long to link in one step, link in parts
-	  func_verbose "using piecewise archive linking..."
-	  save_RANLIB=$RANLIB
-	  RANLIB=:
-	  objlist=
-	  concat_cmds=
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  # Is there a better way of finding the last object in the list?
-	  for obj in $save_oldobjs
-	  do
-	    last_oldobj=$obj
-	  done
-	  eval test_cmds=\"$old_archive_cmds\"
-	  func_len " $test_cmds"
-	  len0=$func_len_result
-	  len=$len0
-	  for obj in $save_oldobjs
-	  do
-	    func_len " $obj"
-	    func_arith $len + $func_len_result
-	    len=$func_arith_result
-	    objlist+=" $obj"
-	    if test "$len" -lt "$max_cmd_len"; then
-	      :
-	    else
-	      # the above command should be used before it gets too long
-	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
-		RANLIB=$save_RANLIB
-	      fi
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
-	      objlist=
-	      len=$len0
-	    fi
-	  done
-	  RANLIB=$save_RANLIB
-	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
-	    eval cmds=\"\$concat_cmds\"
-	  else
-	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
-	  fi
-	fi
-      fi
-      func_execute_cmds "$cmds" 'exit $?'
-    done
-
-    test -n "$generated" && \
-      func_show_eval "${RM}r$generated"
-
-    # Now create the libtool archive.
-    case $output in
-    *.la)
-      old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
-      func_verbose "creating $output"
-
-      # Preserve any variables that may affect compiler behavior
-      for var in $variables_saved_for_relink; do
-	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	elif eval var_value=\$$var; test -z "$var_value"; then
-	  relink_command="$var=; export $var; $relink_command"
-	else
-	  func_quote_for_eval "$var_value"
-	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	fi
-      done
-      # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
-	relink_command=
-      fi
-
-      # Only create the output if not a dry run.
-      $opt_dry_run || {
-	for installed in no yes; do
-	  if test "$installed" = yes; then
-	    if test -z "$install_libdir"; then
-	      break
-	    fi
-	    output="$output_objdir/$outputname"i
-	    # Replace all uninstalled libtool libraries with the installed ones
-	    newdependency_libs=
-	    for deplib in $dependency_libs; do
-	      case $deplib in
-	      *.la)
-		func_basename "$deplib"
-		name="$func_basename_result"
-		func_resolve_sysroot "$deplib"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$deplib' is not a valid libtool archive"
-		newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      -L*)
-		func_stripname -L '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		newdependency_libs+=" -L$func_replace_sysroot_result"
-		;;
-	      -R*)
-		func_stripname -R '' "$deplib"
-		func_replace_sysroot "$func_stripname_result"
-		newdependency_libs+=" -R$func_replace_sysroot_result"
-		;;
-	      *) newdependency_libs+=" $deplib" ;;
-	      esac
-	    done
-	    dependency_libs="$newdependency_libs"
-	    newdlfiles=
-
-	    for lib in $dlfiles; do
-	      case $lib in
-	      *.la)
-	        func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlfiles+=" ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      *) newdlfiles+=" $lib" ;;
-	      esac
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-	      *.la)
-		# Only pass preopened files to the pseudo-archive (for
-		# eventual linking with the app. that links it) if we
-		# didn't already link the preopened objects directly into
-		# the library:
-		func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name"
-		;;
-	      esac
-	    done
-	    dlprefiles="$newdlprefiles"
-	  else
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      newdlfiles+=" $abs"
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      newdlprefiles+=" $abs"
-	    done
-	    dlprefiles="$newdlprefiles"
-	  fi
-	  $RM $output
-	  # place dlname in correct position for cygwin
-	  # In fact, it would be nice if we could use this code for all target
-	  # systems that can't hard-code library paths into their executables
-	  # and that have no shared library path variable independent of PATH,
-	  # but it turns out we can't easily determine that from inspecting
-	  # libtool variables, so we have to hard-code the OSs to which it
-	  # applies here; at the moment, that means platforms that use the PE
-	  # object format with DLL files.  See the long comment at the top of
-	  # tests/bindir.at for full details.
-	  tdlname=$dlname
-	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
-	      # If a -bindir argument was supplied, place the dll there.
-	      if test "x$bindir" != x ;
-	      then
-		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result$dlname
-	      else
-		# Otherwise fall back on heuristic.
-		tdlname=../bin/$dlname
-	      fi
-	      ;;
-	  esac
-	  $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that can not go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
-	    $ECHO >> $output "\
-relink_command=\"$relink_command\""
-	  fi
-	done
-      }
-
-      # Do a symbolic link so that the libtool archive can be found in
-      # LD_LIBRARY_PATH before the program is installed.
-      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
-      ;;
-    esac
-    exit $EXIT_SUCCESS
-}
-
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-    func_mode_link ${1+"$@"}
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
-    $opt_debug
-    RM="$nonopt"
-    files=
-    rmforce=
-    exit_status=0
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    for arg
-    do
-      case $arg in
-      -f) RM+=" $arg"; rmforce=yes ;;
-      -*) RM+=" $arg" ;;
-      *) files+=" $arg" ;;
-      esac
-    done
-
-    test -z "$RM" && \
-      func_fatal_help "you must specify an RM program"
-
-    rmdirs=
-
-    for file in $files; do
-      func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	odir="$objdir"
-      else
-	odir="$dir/$objdir"
-      fi
-      func_basename "$file"
-      name="$func_basename_result"
-      test "$opt_mode" = uninstall && odir="$dir"
-
-      # Remember odir for removal later, being careful to avoid duplicates
-      if test "$opt_mode" = clean; then
-	case " $rmdirs " in
-	  *" $odir "*) ;;
-	  *) rmdirs+=" $odir" ;;
-	esac
-      fi
-
-      # Don't error if the file doesn't exist and rm -f was used.
-      if { test -L "$file"; } >/dev/null 2>&1 ||
-	 { test -h "$file"; } >/dev/null 2>&1 ||
-	 test -f "$file"; then
-	:
-      elif test -d "$file"; then
-	exit_status=1
-	continue
-      elif test "$rmforce" = yes; then
-	continue
-      fi
-
-      rmfiles="$file"
-
-      case $name in
-      *.la)
-	# Possibly a libtool archive, so verify it.
-	if func_lalib_p "$file"; then
-	  func_source $dir/$name
-
-	  # Delete the libtool libraries and symlinks.
-	  for n in $library_names; do
-	    rmfiles+=" $odir/$n"
-	  done
-	  test -n "$old_library" && rmfiles+=" $odir/$old_library"
-
-	  case "$opt_mode" in
-	  clean)
-	    case " $library_names " in
-	    *" $dlname "*) ;;
-	    *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;;
-	    esac
-	    test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i"
-	    ;;
-	  uninstall)
-	    if test -n "$library_names"; then
-	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
-	    fi
-
-	    if test -n "$old_library"; then
-	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
-	    fi
-	    # FIXME: should reinstall the best remaining shared library.
-	    ;;
-	  esac
-	fi
-	;;
-
-      *.lo)
-	# Possibly a libtool object, so verify it.
-	if func_lalib_p "$file"; then
-
-	  # Read the .lo file
-	  func_source $dir/$name
-
-	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; then
-	    rmfiles+=" $dir/$pic_object"
-	  fi
-
-	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" &&
-	     test "$non_pic_object" != none; then
-	    rmfiles+=" $dir/$non_pic_object"
-	  fi
-	fi
-	;;
-
-      *)
-	if test "$opt_mode" = clean ; then
-	  noexename=$name
-	  case $file in
-	  *.exe)
-	    func_stripname '' '.exe' "$file"
-	    file=$func_stripname_result
-	    func_stripname '' '.exe' "$name"
-	    noexename=$func_stripname_result
-	    # $file with .exe has already been added to rmfiles,
-	    # add $file without .exe
-	    rmfiles+=" $file"
-	    ;;
-	  esac
-	  # Do a test to see if this is a libtool program.
-	  if func_ltwrapper_p "$file"; then
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      relink_command=
-	      func_source $func_ltwrapper_scriptname_result
-	      rmfiles+=" $func_ltwrapper_scriptname_result"
-	    else
-	      relink_command=
-	      func_source $dir/$noexename
-	    fi
-
-	    # note $name still contains .exe if it was in $file originally
-	    # as does the version of $file that was added into $rmfiles
-	    rmfiles+=" $odir/$name $odir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
-	      rmfiles+=" $odir/lt-$name"
-	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      rmfiles+=" $odir/lt-${noexename}.c"
-	    fi
-	  fi
-	fi
-	;;
-      esac
-      func_show_eval "$RM $rmfiles" 'exit_status=1'
-    done
-
-    # Try to remove the ${objdir}s in the directories where we deleted files
-    for dir in $rmdirs; do
-      if test -d "$dir"; then
-	func_show_eval "rmdir $dir >/dev/null 2>&1"
-      fi
-    done
-
-    exit $exit_status
-}
-
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
-
-test -z "$opt_mode" && {
-  help="$generic_help"
-  func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$opt_mode'"
-
-if test -n "$exec_cmd"; then
-  eval exec "$exec_cmd"
-  exit $EXIT_FAILURE
-fi
-
-exit $exit_status
-
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them.  This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration.  But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
-# vi:sw=2
-
-
-# ### BEGIN LIBTOOL TAG CONFIG: CXX
-
-# The linker used to build libraries.
-LD="/usr/bin/ld -m elf_x86_64"
-
-# How to create reloadable object files.
-reload_flag=" -r"
-reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
-
-# Commands used to build an old-style archive.
-old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
-
-# A language specific compiler.
-CC="g++"
-
-# Is the compiler the GNU compiler?
-with_gcc=yes
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=" -fno-builtin"
-
-# Additional compiler flags for building library objects.
-pic_flag=" -fPIC -DPIC"
-
-# How to pass a linker flag through the compiler.
-wl="-Wl,"
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag="-static"
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o="yes"
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=no
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=no
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec="\${wl}--export-dynamic"
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object="no"
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=""
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=""
-
-# Commands used to build a shared archive.
-archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
-archive_expsym_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=""
-module_expsym_cmds=""
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld="yes"
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=""
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=""
-
-# Flag to hardcode $libdir into a binary during linking.
-# This must work even if $libdir does not exist
-hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=""
-
-# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=no
-
-# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=no
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=no
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=unsupported
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=no
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=no
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=unknown
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=no
-
-# The commands to list exported symbols.
-export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
-
-# Symbols that must always be exported.
-include_expsyms=""
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=""
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=""
-
-# Specify filename containing input files.
-file_list_spec=""
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=immediate
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs="/usr/lib/gcc/x86_64-linux-gnu/4.8 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /usr/lib/gcc/x86_64-linux-gnu/4.8/../../.."
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o"
-postdep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o"
-predeps=""
-postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path="-L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.."
-
-# ### END LIBTOOL TAG CONFIG: CXX
diff --git a/deps/SDL2/sdl2-config b/deps/SDL2/sdl2-config
deleted file mode 100755
index 3053ce8..0000000
--- a/deps/SDL2/sdl2-config
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-prefix=/home/andy/dev/libgroove/deps/SDL2/build
-exec_prefix=${prefix}
-exec_prefix_set=no
-libdir=${exec_prefix}/lib
-
-#usage="\
-#Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
-usage="\
-Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
-
-if test $# -eq 0; then
-      echo "${usage}" 1>&2
-      exit 1
-fi
-
-while test $# -gt 0; do
-  case "$1" in
-  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
-  esac
-
-  case $1 in
-    --prefix=*)
-      prefix=$optarg
-      if test $exec_prefix_set = no ; then
-        exec_prefix=$optarg
-      fi
-      ;;
-    --prefix)
-      echo $prefix
-      ;;
-    --exec-prefix=*)
-      exec_prefix=$optarg
-      exec_prefix_set=yes
-      ;;
-    --exec-prefix)
-      echo $exec_prefix
-      ;;
-    --version)
-      echo 2.0.1
-      ;;
-    --cflags)
-      echo -I${prefix}/include/SDL2  -D_REENTRANT
-      ;;
-#    --libs)
-#      echo -L${exec_prefix}/lib -Wl,-rpath,${libdir} -lSDL2  -lpthread
-#      ;;
-#    --static-libs)
-    --libs|--static-libs)
-      echo -L${exec_prefix}/lib -Wl,-rpath,${libdir} -lSDL2  -lpthread  -lm -ldl -lpthread -lrt
-      ;;
-    *)
-      echo "${usage}" 1>&2
-      exit 1
-      ;;
-  esac
-  shift
-done
diff --git a/deps/SDL2/sdl2-config.in b/deps/SDL2/sdl2-config.in
deleted file mode 100644
index 254a345..0000000
--- a/deps/SDL2/sdl2-config.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-exec_prefix_set=no
-libdir=@libdir@
-
- at ENABLE_STATIC_FALSE@usage="\
- at ENABLE_STATIC_FALSE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
- at ENABLE_STATIC_TRUE@usage="\
- at ENABLE_STATIC_TRUE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
-
-if test $# -eq 0; then
-      echo "${usage}" 1>&2
-      exit 1
-fi
-
-while test $# -gt 0; do
-  case "$1" in
-  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
-  esac
-
-  case $1 in
-    --prefix=*)
-      prefix=$optarg
-      if test $exec_prefix_set = no ; then
-        exec_prefix=$optarg
-      fi
-      ;;
-    --prefix)
-      echo $prefix
-      ;;
-    --exec-prefix=*)
-      exec_prefix=$optarg
-      exec_prefix_set=yes
-      ;;
-    --exec-prefix)
-      echo $exec_prefix
-      ;;
-    --version)
-      echo @SDL_VERSION@
-      ;;
-    --cflags)
-      echo -I at includedir@/SDL2 @SDL_CFLAGS@
-      ;;
- at ENABLE_SHARED_TRUE@    --libs)
- at ENABLE_SHARED_TRUE@      echo -L at libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
- at ENABLE_SHARED_TRUE@      ;;
- at ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@    --static-libs)
- at ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@    --libs|--static-libs)
- at ENABLE_STATIC_TRUE@      echo -L at libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@
- at ENABLE_STATIC_TRUE@      ;;
-    *)
-      echo "${usage}" 1>&2
-      exit 1
-      ;;
-  esac
-  shift
-done
diff --git a/deps/SDL2/sdl2.m4 b/deps/SDL2/sdl2.m4
deleted file mode 100644
index a03b2d2..0000000
--- a/deps/SDL2/sdl2.m4
+++ /dev/null
@@ -1,202 +0,0 @@
-# Configure paths for SDL
-# Sam Lantinga 9/21/99
-# stolen from Manish Singh
-# stolen back from Frank Belew
-# stolen from Manish Singh
-# Shamelessly stolen from Owen Taylor
-
-# serial 1
-
-dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
-dnl
-AC_DEFUN([AM_PATH_SDL2],
-[dnl 
-dnl Get the cflags and libraries from the sdl2-config script
-dnl
-AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
-            sdl_prefix="$withval", sdl_prefix="")
-AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
-            sdl_exec_prefix="$withval", sdl_exec_prefix="")
-AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
-		    , enable_sdltest=yes)
-
-  min_sdl_version=ifelse([$1], ,2.0.0,$1)
-
-  if test "x$sdl_prefix$sdl_exec_prefix" = x ; then
-    PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version],
-           [sdl_pc=yes],
-           [sdl_pc=no])
-  else
-    sdl_pc=no
-    if test x$sdl_exec_prefix != x ; then
-      sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
-      if test x${SDL2_CONFIG+set} != xset ; then
-        SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config
-      fi
-    fi
-    if test x$sdl_prefix != x ; then
-      sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
-      if test x${SDL2_CONFIG+set} != xset ; then
-        SDL2_CONFIG=$sdl_prefix/bin/sdl2-config
-      fi
-    fi
-  fi
-
-  if test "x$sdl_pc" = xyes ; then
-    no_sdl=""
-    SDL2_CONFIG="pkg-config sdl2"
-  else
-    as_save_PATH="$PATH"
-    if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
-      PATH="$prefix/bin:$prefix/usr/bin:$PATH"
-    fi
-    AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no, [$PATH])
-    PATH="$as_save_PATH"
-    AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
-    no_sdl=""
-
-    if test "$SDL2_CONFIG" = "no" ; then
-      no_sdl=yes
-    else
-      SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags`
-      SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs`
-
-      sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \
-             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-      sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \
-             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-      sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \
-             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-      if test "x$enable_sdltest" = "xyes" ; then
-        ac_save_CFLAGS="$CFLAGS"
-        ac_save_CXXFLAGS="$CXXFLAGS"
-        ac_save_LIBS="$LIBS"
-        CFLAGS="$CFLAGS $SDL_CFLAGS"
-        CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
-        LIBS="$LIBS $SDL_LIBS"
-dnl
-dnl Now check if the installed SDL is sufficiently new. (Also sanity
-dnl checks the results of sdl2-config to some extent
-dnl
-      rm -f conf.sdltest
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "SDL.h"
-
-char*
-my_strdup (char *str)
-{
-  char *new_str;
-  
-  if (str)
-    {
-      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
-      strcpy (new_str, str);
-    }
-  else
-    new_str = NULL;
-  
-  return new_str;
-}
-
-int main (int argc, char *argv[])
-{
-  int major, minor, micro;
-  char *tmp_version;
-
-  /* This hangs on some systems (?)
-  system ("touch conf.sdltest");
-  */
-  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
-
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = my_strdup("$min_sdl_version");
-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string\n", "$min_sdl_version");
-     exit(1);
-   }
-
-   if (($sdl_major_version > major) ||
-      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
-      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
-    {
-      return 0;
-    }
-  else
-    {
-      printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
-      printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro);
-      printf("*** best to upgrade to the required version.\n");
-      printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n");
-      printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
-      printf("*** config.cache before re-running configure\n");
-      return 1;
-    }
-}
-
-],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-        CFLAGS="$ac_save_CFLAGS"
-        CXXFLAGS="$ac_save_CXXFLAGS"
-        LIBS="$ac_save_LIBS"
-      fi
-    fi
-    if test "x$no_sdl" = x ; then
-      AC_MSG_RESULT(yes)
-    else
-      AC_MSG_RESULT(no)
-    fi
-  fi
-  if test "x$no_sdl" = x ; then
-     ifelse([$2], , :, [$2])
-  else
-     if test "$SDL2_CONFIG" = "no" ; then
-       echo "*** The sdl2-config script installed by SDL could not be found"
-       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the SDL2_CONFIG environment variable to the"
-       echo "*** full path to sdl2-config."
-     else
-       if test -f conf.sdltest ; then
-        :
-       else
-          echo "*** Could not run SDL test program, checking why..."
-          CFLAGS="$CFLAGS $SDL_CFLAGS"
-          CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
-          LIBS="$LIBS $SDL_LIBS"
-          AC_TRY_LINK([
-#include <stdio.h>
-#include "SDL.h"
-
-int main(int argc, char *argv[])
-{ return 0; }
-#undef  main
-#define main K_and_R_C_main
-],      [ return 0; ],
-        [ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding SDL or finding the wrong"
-          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-	  echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
-          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
-          echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ])
-          CFLAGS="$ac_save_CFLAGS"
-          CXXFLAGS="$ac_save_CXXFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     SDL_CFLAGS=""
-     SDL_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  AC_SUBST(SDL_CFLAGS)
-  AC_SUBST(SDL_LIBS)
-  rm -f conf.sdltest
-])
diff --git a/deps/SDL2/sdl2.pc b/deps/SDL2/sdl2.pc
deleted file mode 100644
index 112ef13..0000000
--- a/deps/SDL2/sdl2.pc
+++ /dev/null
@@ -1,15 +0,0 @@
-# sdl pkg-config source file
-
-prefix=/home/andy/dev/libgroove/deps/SDL2/build
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
-
-Name: sdl2
-Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
-Version: 2.0.1
-Requires:
-Conflicts:
-Libs: -L${libdir} -Wl,-rpath,${libdir} -lSDL2  -lpthread
-Libs.private: -lSDL2  -lpthread  -lm -ldl -lpthread -lrt
-Cflags: -I${includedir}/SDL2  -D_REENTRANT
diff --git a/deps/SDL2/sdl2.pc.in b/deps/SDL2/sdl2.pc.in
deleted file mode 100644
index b11667d..0000000
--- a/deps/SDL2/sdl2.pc.in
+++ /dev/null
@@ -1,15 +0,0 @@
-# sdl pkg-config source file
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: sdl2
-Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
-Version: @SDL_VERSION@
-Requires:
-Conflicts:
-Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
-Libs.private: @SDL_STATIC_LIBS@
-Cflags: -I${includedir}/SDL2 @SDL_CFLAGS@
diff --git a/deps/SDL2/src/SDL.c b/deps/SDL2/src/SDL.c
deleted file mode 100644
index 0f6de9f..0000000
--- a/deps/SDL2/src/SDL.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(__WIN32__)
-#include "core/windows/SDL_windows.h"
-#endif
-
-/* Initialization code for SDL */
-
-#include "SDL.h"
-#include "SDL_bits.h"
-#include "SDL_revision.h"
-#include "SDL_assert_c.h"
-#include "events/SDL_events_c.h"
-#include "haptic/SDL_haptic_c.h"
-#include "joystick/SDL_joystick_c.h"
-
-/* Initialization/Cleanup routines */
-#if !SDL_TIMERS_DISABLED
-extern int SDL_TimerInit(void);
-extern void SDL_TimerQuit(void);
-extern void SDL_InitTicks(void);
-#endif
-#if SDL_VIDEO_DRIVER_WINDOWS
-extern int SDL_HelperWindowCreate(void);
-extern int SDL_HelperWindowDestroy(void);
-#endif
-
-
-/* The initialized subsystems */
-#ifdef SDL_MAIN_NEEDED
-static SDL_bool SDL_MainIsReady = SDL_FALSE;
-#else
-static SDL_bool SDL_MainIsReady = SDL_TRUE;
-#endif
-static SDL_bool SDL_bInMainQuit = SDL_FALSE;
-static Uint8 SDL_SubsystemRefCount[ 32 ];
-
-/* Private helper to increment a subsystem's ref counter. */
-static void
-SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem)
-{
-    int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
-    SDL_assert(SDL_SubsystemRefCount[subsystem_index] < 255);
-    ++SDL_SubsystemRefCount[subsystem_index];
-}
-
-/* Private helper to decrement a subsystem's ref counter. */
-static void
-SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem)
-{
-    int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
-    if (SDL_SubsystemRefCount[subsystem_index] > 0) {
-        --SDL_SubsystemRefCount[subsystem_index];
-    }
-}
-
-/* Private helper to check if a system needs init. */
-static SDL_bool
-SDL_PrivateShouldInitSubsystem(Uint32 subsystem)
-{
-    int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
-    SDL_assert(SDL_SubsystemRefCount[subsystem_index] < 255);
-    return (SDL_SubsystemRefCount[subsystem_index] == 0);
-}
-
-/* Private helper to check if a system needs to be quit. */
-static SDL_bool
-SDL_PrivateShouldQuitSubsystem(Uint32 subsystem) {
-    int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
-    if (SDL_SubsystemRefCount[subsystem_index] == 0) {
-      return SDL_FALSE;
-    }
-
-    /* If we're in SDL_Quit, we shut down every subsystem, even if refcount
-     * isn't zero.
-     */
-    return SDL_SubsystemRefCount[subsystem_index] == 1 || SDL_bInMainQuit;
-}
-
-void
-SDL_SetMainReady(void)
-{
-    SDL_MainIsReady = SDL_TRUE;
-}
-
-int
-SDL_InitSubSystem(Uint32 flags)
-{
-    if (!SDL_MainIsReady) {
-        SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?");
-        return -1;
-    }
-
-    /* Clear the error message */
-    SDL_ClearError();
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-    if (SDL_HelperWindowCreate() < 0) {
-        return -1;
-    }
-#endif
-
-#if !SDL_TIMERS_DISABLED
-    SDL_InitTicks();
-#endif
-
-    if ((flags & SDL_INIT_GAMECONTROLLER)) {
-        /* game controller implies joystick */
-        flags |= SDL_INIT_JOYSTICK;
-    }
-
-    if ((flags & (SDL_INIT_VIDEO|SDL_INIT_JOYSTICK))) {
-        /* video or joystick implies events */
-        flags |= SDL_INIT_EVENTS;
-    }
-
-    /* Initialize the event subsystem */
-    if ((flags & SDL_INIT_EVENTS)) {
-#if !SDL_EVENTS_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_EVENTS)) {
-            if (SDL_StartEventLoop() < 0) {
-                return (-1);
-            }
-            SDL_QuitInit();
-        }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_EVENTS);
-#else
-        return SDL_SetError("SDL not built with events support");
-#endif
-    }
-
-    /* Initialize the timer subsystem */
-    if ((flags & SDL_INIT_TIMER)){
-#if !SDL_TIMERS_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_TIMER)) {
-            if (SDL_TimerInit() < 0) {
-                return (-1);
-            }
-        }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_TIMER);
-#else
-        return SDL_SetError("SDL not built with timer support");
-#endif
-    }
-
-    /* Initialize the video subsystem */
-    if ((flags & SDL_INIT_VIDEO)){
-#if !SDL_VIDEO_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_VIDEO)) {
-            if (SDL_VideoInit(NULL) < 0) {
-                return (-1);
-            }
-        }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_VIDEO);
-#else
-        return SDL_SetError("SDL not built with video support");
-#endif
-    }
-
-    /* Initialize the audio subsystem */
-    if ((flags & SDL_INIT_AUDIO)){
-#if !SDL_AUDIO_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_AUDIO)) {
-            if (SDL_AudioInit(NULL) < 0) {
-                return (-1);
-            }
-        }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_AUDIO);
-#else
-        return SDL_SetError("SDL not built with audio support");
-#endif
-    }
-
-    /* Initialize the joystick subsystem */
-    if ((flags & SDL_INIT_JOYSTICK)){
-#if !SDL_JOYSTICK_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_JOYSTICK)) {
-           if (SDL_JoystickInit() < 0) {
-               return (-1);
-           }
-        }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_JOYSTICK);
-#else
-        return SDL_SetError("SDL not built with joystick support");
-#endif
-    }
-
-    if ((flags & SDL_INIT_GAMECONTROLLER)){
-#if !SDL_JOYSTICK_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_GAMECONTROLLER)) {
-            if (SDL_GameControllerInit() < 0) {
-                return (-1);
-            }
-        }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_GAMECONTROLLER);
-#else
-        return SDL_SetError("SDL not built with joystick support");
-#endif
-    }
-
-    /* Initialize the haptic subsystem */
-    if ((flags & SDL_INIT_HAPTIC)){
-#if !SDL_HAPTIC_DISABLED
-        if (SDL_PrivateShouldInitSubsystem(SDL_INIT_HAPTIC)) {
-            if (SDL_HapticInit() < 0) {
-                return (-1);
-            }
-        }
-        SDL_PrivateSubsystemRefCountIncr(SDL_INIT_HAPTIC);
-#else
-        return SDL_SetError("SDL not built with haptic (force feedback) support");
-#endif
-    }
-
-    return (0);
-}
-
-int
-SDL_Init(Uint32 flags)
-{
-    return SDL_InitSubSystem(flags);
-}
-
-void
-SDL_QuitSubSystem(Uint32 flags)
-{
-    /* Shut down requested initialized subsystems */
-#if !SDL_JOYSTICK_DISABLED
-    if ((flags & SDL_INIT_GAMECONTROLLER)) {
-        /* game controller implies joystick */
-        flags |= SDL_INIT_JOYSTICK;
-
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_GAMECONTROLLER)) {
-            SDL_GameControllerQuit();
-        }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_GAMECONTROLLER);
-    }
-
-    if ((flags & SDL_INIT_JOYSTICK)) {
-        /* joystick implies events */
-        flags |= SDL_INIT_EVENTS;
-
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_JOYSTICK)) {
-            SDL_JoystickQuit();
-        }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_JOYSTICK);
-    }
-#endif
-
-#if !SDL_HAPTIC_DISABLED
-    if ((flags & SDL_INIT_HAPTIC)) {
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_HAPTIC)) {
-            SDL_HapticQuit();
-        }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_HAPTIC);
-    }
-#endif
-
-#if !SDL_AUDIO_DISABLED
-    if ((flags & SDL_INIT_AUDIO)) {
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_AUDIO)) {
-            SDL_AudioQuit();
-        }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_AUDIO);
-    }
-#endif
-
-#if !SDL_VIDEO_DISABLED
-    if ((flags & SDL_INIT_VIDEO)) {
-        /* video implies events */
-        flags |= SDL_INIT_EVENTS;
-
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_VIDEO)) {
-            SDL_VideoQuit();
-        }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_VIDEO);
-    }
-#endif
-
-#if !SDL_TIMERS_DISABLED
-    if ((flags & SDL_INIT_TIMER)) {
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_TIMER)) {
-            SDL_TimerQuit();
-        }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_TIMER);
-    }
-#endif
-
-#if !SDL_EVENTS_DISABLED
-    if ((flags & SDL_INIT_EVENTS)) {
-        if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_EVENTS)) {
-            SDL_QuitQuit();
-            SDL_StopEventLoop();
-        }
-        SDL_PrivateSubsystemRefCountDecr(SDL_INIT_EVENTS);
-    }
-#endif
-}
-
-Uint32
-SDL_WasInit(Uint32 flags)
-{
-    int i;
-    int num_subsystems = SDL_arraysize(SDL_SubsystemRefCount);
-    Uint32 initialized = 0;
-
-    if (!flags) {
-        flags = SDL_INIT_EVERYTHING;
-    }
-
-    num_subsystems = SDL_min(num_subsystems, SDL_MostSignificantBitIndex32(flags) + 1);
-
-    /* Iterate over each bit in flags, and check the matching subsystem. */
-    for (i = 0; i < num_subsystems; ++i) {
-        if ((flags & 1) && SDL_SubsystemRefCount[i] > 0) {
-            initialized |= (1 << i);
-        }
-
-        flags >>= 1;
-    }
-
-    return initialized;
-}
-
-void
-SDL_Quit(void)
-{
-    SDL_bInMainQuit = SDL_TRUE;
-
-    /* Quit all subsystems */
-#if SDL_VIDEO_DRIVER_WINDOWS
-    SDL_HelperWindowDestroy();
-#endif
-    SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
-
-    SDL_ClearHints();
-    SDL_AssertionsQuit();
-    SDL_LogResetPriorities();
-
-    /* Now that every subsystem has been quit, we reset the subsystem refcount
-     * and the list of initialized subsystems.
-     */
-    SDL_memset( SDL_SubsystemRefCount, 0x0, sizeof(SDL_SubsystemRefCount) );
-
-    SDL_bInMainQuit = SDL_FALSE;
-}
-
-/* Get the library version number */
-void
-SDL_GetVersion(SDL_version * ver)
-{
-    SDL_VERSION(ver);
-}
-
-/* Get the library source revision */
-const char *
-SDL_GetRevision(void)
-{
-    return SDL_REVISION;
-}
-
-/* Get the library source revision number */
-int
-SDL_GetRevisionNumber(void)
-{
-    return SDL_REVISION_NUMBER;
-}
-
-/* Get the name of the platform */
-const char *
-SDL_GetPlatform()
-{
-#if __AIX__
-    return "AIX";
-#elif __ANDROID__
-    return "Android";
-#elif __BEOS__
-    return "BeOS";
-#elif __BSDI__
-    return "BSDI";
-#elif __DREAMCAST__
-    return "Dreamcast";
-#elif __FREEBSD__
-    return "FreeBSD";
-#elif __HAIKU__
-    return "Haiku";
-#elif __HPUX__
-    return "HP-UX";
-#elif __IRIX__
-    return "Irix";
-#elif __LINUX__
-    return "Linux";
-#elif __MINT__
-    return "Atari MiNT";
-#elif __MACOS__
-    return "MacOS Classic";
-#elif __MACOSX__
-    return "Mac OS X";
-#elif __NETBSD__
-    return "NetBSD";
-#elif __OPENBSD__
-    return "OpenBSD";
-#elif __OS2__
-    return "OS/2";
-#elif __OSF__
-    return "OSF/1";
-#elif __QNXNTO__
-    return "QNX Neutrino";
-#elif __RISCOS__
-    return "RISC OS";
-#elif __SOLARIS__
-    return "Solaris";
-#elif __WIN32__
-    return "Windows";
-#elif __IPHONEOS__
-    return "iOS";
-#elif __PSP__
-    return "PlayStation Portable";
-#else
-    return "Unknown (see SDL_platform.h)";
-#endif
-}
-
-#if defined(__WIN32__)
-
-#if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL))
-/* Need to include DllMain() on Watcom C for some reason.. */
-
-BOOL APIENTRY
-_DllMainCRTStartup(HANDLE hModule,
-                   DWORD ul_reason_for_call, LPVOID lpReserved)
-{
-    switch (ul_reason_for_call) {
-    case DLL_PROCESS_ATTACH:
-    case DLL_THREAD_ATTACH:
-    case DLL_THREAD_DETACH:
-    case DLL_PROCESS_DETACH:
-        break;
-    }
-    return TRUE;
-}
-#endif /* building DLL with Watcom C */
-
-#endif /* __WIN32__ */
-
-/* vi: set sts=4 ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/SDL_assert.c b/deps/SDL2/src/SDL_assert.c
deleted file mode 100644
index 41c6ad6..0000000
--- a/deps/SDL2/src/SDL_assert.c
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(__WIN32__)
-#include "core/windows/SDL_windows.h"
-#endif
-
-#include "SDL.h"
-#include "SDL_atomic.h"
-#include "SDL_messagebox.h"
-#include "SDL_video.h"
-#include "SDL_assert.h"
-#include "SDL_assert_c.h"
-#include "video/SDL_sysvideo.h"
-
-#ifdef __WIN32__
-#ifndef WS_OVERLAPPEDWINDOW
-#define WS_OVERLAPPEDWINDOW 0
-#endif
-#else  /* fprintf, _exit(), etc. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#endif
-
-static SDL_assert_state
-SDL_PromptAssertion(const SDL_assert_data *data, void *userdata);
-
-/*
- * We keep all triggered assertions in a singly-linked list so we can
- *  generate a report later.
- */
-static SDL_assert_data *triggered_assertions = NULL;
-
-static SDL_mutex *assertion_mutex = NULL;
-static SDL_AssertionHandler assertion_handler = SDL_PromptAssertion;
-static void *assertion_userdata = NULL;
-
-#ifdef __GNUC__
-static void
-debug_print(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
-#endif
-
-static void
-debug_print(const char *fmt, ...)
-{
-    va_list ap;
-    va_start(ap, fmt);
-    SDL_LogMessageV(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_WARN, fmt, ap);
-    va_end(ap);
-}
-
-
-static void SDL_AddAssertionToReport(SDL_assert_data *data)
-{
-    /* (data) is always a static struct defined with the assert macros, so
-       we don't have to worry about copying or allocating them. */
-    data->trigger_count++;
-    if (data->trigger_count == 1) {  /* not yet added? */
-        data->next = triggered_assertions;
-        triggered_assertions = data;
-    }
-}
-
-
-static void SDL_GenerateAssertionReport(void)
-{
-    const SDL_assert_data *item = triggered_assertions;
-
-    /* only do this if the app hasn't assigned an assertion handler. */
-    if ((item != NULL) && (assertion_handler != SDL_PromptAssertion)) {
-        debug_print("\n\nSDL assertion report.\n");
-        debug_print("All SDL assertions between last init/quit:\n\n");
-
-        while (item != NULL) {
-            debug_print(
-                "'%s'\n"
-                "    * %s (%s:%d)\n"
-                "    * triggered %u time%s.\n"
-                "    * always ignore: %s.\n",
-                item->condition, item->function, item->filename,
-                item->linenum, item->trigger_count,
-                (item->trigger_count == 1) ? "" : "s",
-                item->always_ignore ? "yes" : "no");
-            item = item->next;
-        }
-        debug_print("\n");
-
-        SDL_ResetAssertionReport();
-    }
-}
-
-static void SDL_ExitProcess(int exitcode)
-{
-#ifdef __WIN32__
-    ExitProcess(exitcode);
-#else
-    _exit(exitcode);
-#endif
-}
-
-static void SDL_AbortAssertion(void)
-{
-    SDL_Quit();
-    SDL_ExitProcess(42);
-}
-
-
-static SDL_assert_state
-SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
-{
-#ifdef __WIN32__
-    #define ENDLINE "\r\n"
-#else
-    #define ENDLINE "\n"
-#endif
-
-    const char *envr;
-    SDL_assert_state state = SDL_ASSERTION_ABORT;
-    SDL_Window *window;
-    SDL_MessageBoxData messagebox;
-    SDL_MessageBoxButtonData buttons[] = {
-        {   0,  SDL_ASSERTION_RETRY,            "Retry" },
-        {   0,  SDL_ASSERTION_BREAK,            "Break" },
-        {   0,  SDL_ASSERTION_ABORT,            "Abort" },
-        {   SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT,
-                SDL_ASSERTION_IGNORE,           "Ignore" },
-        {   SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT,
-                SDL_ASSERTION_ALWAYS_IGNORE,    "Always Ignore" }
-    };
-    char *message;
-    int selected;
-
-    (void) userdata;  /* unused in default handler. */
-
-    message = SDL_stack_alloc(char, SDL_MAX_LOG_MESSAGE);
-    if (!message) {
-        /* Uh oh, we're in real trouble now... */
-        return SDL_ASSERTION_ABORT;
-    }
-    SDL_snprintf(message, SDL_MAX_LOG_MESSAGE,
-                 "Assertion failure at %s (%s:%d), triggered %u %s:" ENDLINE
-                    "  '%s'",
-                 data->function, data->filename, data->linenum,
-                 data->trigger_count, (data->trigger_count == 1) ? "time" : "times",
-                 data->condition);
-
-    debug_print("\n\n%s\n\n", message);
-
-    /* let env. variable override, so unit tests won't block in a GUI. */
-    envr = SDL_getenv("SDL_ASSERT");
-    if (envr != NULL) {
-        SDL_stack_free(message);
-
-        if (SDL_strcmp(envr, "abort") == 0) {
-            return SDL_ASSERTION_ABORT;
-        } else if (SDL_strcmp(envr, "break") == 0) {
-            return SDL_ASSERTION_BREAK;
-        } else if (SDL_strcmp(envr, "retry") == 0) {
-            return SDL_ASSERTION_RETRY;
-        } else if (SDL_strcmp(envr, "ignore") == 0) {
-            return SDL_ASSERTION_IGNORE;
-        } else if (SDL_strcmp(envr, "always_ignore") == 0) {
-            return SDL_ASSERTION_ALWAYS_IGNORE;
-        } else {
-            return SDL_ASSERTION_ABORT;  /* oh well. */
-        }
-    }
-
-    /* Leave fullscreen mode, if possible (scary!) */
-    window = SDL_GetFocusWindow();
-    if (window) {
-        if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) {
-            SDL_MinimizeWindow(window);
-        } else {
-            /* !!! FIXME: ungrab the input if we're not fullscreen? */
-            /* No need to mess with the window */
-            window = NULL;
-        }
-    }
-
-    /* Show a messagebox if we can, otherwise fall back to stdio */
-    SDL_zero(messagebox);
-    messagebox.flags = SDL_MESSAGEBOX_WARNING;
-    messagebox.window = window;
-    messagebox.title = "Assertion Failed";
-    messagebox.message = message;
-    messagebox.numbuttons = SDL_arraysize(buttons);
-    messagebox.buttons = buttons;
-
-    if (SDL_ShowMessageBox(&messagebox, &selected) == 0) {
-        if (selected == -1) {
-            state = SDL_ASSERTION_IGNORE;
-        } else {
-            state = (SDL_assert_state)selected;
-        }
-    }
-#ifdef HAVE_STDIO_H
-    else
-    {
-        /* this is a little hacky. */
-        for ( ; ; ) {
-            char buf[32];
-            fprintf(stderr, "Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] : ");
-            fflush(stderr);
-            if (fgets(buf, sizeof (buf), stdin) == NULL) {
-                break;
-            }
-
-            if (SDL_strcmp(buf, "a") == 0) {
-                state = SDL_ASSERTION_ABORT;
-                break;
-            } else if (SDL_strcmp(buf, "b") == 0) {
-                state = SDL_ASSERTION_BREAK;
-                break;
-            } else if (SDL_strcmp(buf, "r") == 0) {
-                state = SDL_ASSERTION_RETRY;
-                break;
-            } else if (SDL_strcmp(buf, "i") == 0) {
-                state = SDL_ASSERTION_IGNORE;
-                break;
-            } else if (SDL_strcmp(buf, "A") == 0) {
-                state = SDL_ASSERTION_ALWAYS_IGNORE;
-                break;
-            }
-        }
-    }
-#endif /* HAVE_STDIO_H */
-
-    /* Re-enter fullscreen mode */
-    if (window) {
-        SDL_RestoreWindow(window);
-    }
-
-    SDL_stack_free(message);
-
-    return state;
-}
-
-
-SDL_assert_state
-SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file,
-                    int line)
-{
-    static int assertion_running = 0;
-    static SDL_SpinLock spinlock = 0;
-    SDL_assert_state state = SDL_ASSERTION_IGNORE;
-
-    SDL_AtomicLock(&spinlock);
-    if (assertion_mutex == NULL) { /* never called SDL_Init()? */
-        assertion_mutex = SDL_CreateMutex();
-        if (assertion_mutex == NULL) {
-            SDL_AtomicUnlock(&spinlock);
-            return SDL_ASSERTION_IGNORE;   /* oh well, I guess. */
-        }
-    }
-    SDL_AtomicUnlock(&spinlock);
-
-    if (SDL_LockMutex(assertion_mutex) < 0) {
-        return SDL_ASSERTION_IGNORE;   /* oh well, I guess. */
-    }
-
-    /* doing this because Visual C is upset over assigning in the macro. */
-    if (data->trigger_count == 0) {
-        data->function = func;
-        data->filename = file;
-        data->linenum = line;
-    }
-
-    SDL_AddAssertionToReport(data);
-
-    assertion_running++;
-    if (assertion_running > 1) {   /* assert during assert! Abort. */
-        if (assertion_running == 2) {
-            SDL_AbortAssertion();
-        } else if (assertion_running == 3) {  /* Abort asserted! */
-            SDL_ExitProcess(42);
-        } else {
-            while (1) { /* do nothing but spin; what else can you do?! */ }
-        }
-    }
-
-    if (!data->always_ignore) {
-        state = assertion_handler(data, assertion_userdata);
-    }
-
-    switch (state)
-    {
-        case SDL_ASSERTION_ABORT:
-            SDL_AbortAssertion();
-            return SDL_ASSERTION_IGNORE;  /* shouldn't return, but oh well. */
-
-        case SDL_ASSERTION_ALWAYS_IGNORE:
-            state = SDL_ASSERTION_IGNORE;
-            data->always_ignore = 1;
-            break;
-
-        case SDL_ASSERTION_IGNORE:
-        case SDL_ASSERTION_RETRY:
-        case SDL_ASSERTION_BREAK:
-            break;  /* macro handles these. */
-    }
-
-    assertion_running--;
-    SDL_UnlockMutex(assertion_mutex);
-
-    return state;
-}
-
-
-void SDL_AssertionsQuit(void)
-{
-    SDL_GenerateAssertionReport();
-    if (assertion_mutex != NULL) {
-        SDL_DestroyMutex(assertion_mutex);
-        assertion_mutex = NULL;
-    }
-}
-
-void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata)
-{
-    if (handler != NULL) {
-        assertion_handler = handler;
-        assertion_userdata = userdata;
-    } else {
-        assertion_handler = SDL_PromptAssertion;
-        assertion_userdata = NULL;
-    }
-}
-
-const SDL_assert_data *SDL_GetAssertionReport(void)
-{
-    return triggered_assertions;
-}
-
-void SDL_ResetAssertionReport(void)
-{
-    SDL_assert_data *next = NULL;
-    SDL_assert_data *item;
-    for (item = triggered_assertions; item != NULL; item = next) {
-        next = (SDL_assert_data *) item->next;
-        item->always_ignore = SDL_FALSE;
-        item->trigger_count = 0;
-        item->next = NULL;
-    }
-
-    triggered_assertions = NULL;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/SDL_assert_c.h b/deps/SDL2/src/SDL_assert_c.h
deleted file mode 100644
index 29802c0..0000000
--- a/deps/SDL2/src/SDL_assert_c.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-extern void SDL_AssertionsQuit(void);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/SDL_error.c b/deps/SDL2/src/SDL_error.c
deleted file mode 100644
index 98ef84a..0000000
--- a/deps/SDL2/src/SDL_error.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Simple error handling in SDL */
-
-#include "SDL_log.h"
-#include "SDL_error.h"
-#include "SDL_error_c.h"
-
-
-/* Routine to get the thread-specific error variable */
-#if SDL_THREADS_DISABLED
-/* The default (non-thread-safe) global error variable */
-static SDL_error SDL_global_error;
-#define SDL_GetErrBuf() (&SDL_global_error)
-#else
-extern SDL_error *SDL_GetErrBuf(void);
-#endif /* SDL_THREADS_DISABLED */
-
-#define SDL_ERRBUFIZE   1024
-
-/* Private functions */
-
-static const char *
-SDL_LookupString(const char *key)
-{
-    /* FIXME: Add code to lookup key in language string hash-table */
-    return key;
-}
-
-/* Public functions */
-
-int
-SDL_SetError(const char *fmt, ...)
-{
-    va_list ap;
-    SDL_error *error;
-
-    /* Ignore call if invalid format pointer was passed */
-    if (fmt == NULL) return -1;
-
-    /* Copy in the key, mark error as valid */
-    error = SDL_GetErrBuf();
-    error->error = 1;
-    SDL_strlcpy((char *) error->key, fmt, sizeof(error->key));
-
-    va_start(ap, fmt);
-    error->argc = 0;
-    while (*fmt) {
-        if (*fmt++ == '%') {
-            while (*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) {
-                ++fmt;
-            }
-            switch (*fmt++) {
-            case 0:            /* Malformed format string.. */
-                --fmt;
-                break;
-            case 'c':
-            case 'i':
-            case 'd':
-            case 'u':
-            case 'o':
-            case 'x':
-            case 'X':
-                error->args[error->argc++].value_i = va_arg(ap, int);
-                break;
-            case 'f':
-                error->args[error->argc++].value_f = va_arg(ap, double);
-                break;
-            case 'p':
-                error->args[error->argc++].value_ptr = va_arg(ap, void *);
-                break;
-            case 's':
-                {
-                    int i = error->argc;
-                    const char *str = va_arg(ap, const char *);
-                    if (str == NULL)
-                        str = "(null)";
-                    SDL_strlcpy((char *) error->args[i].buf, str,
-                                ERR_MAX_STRLEN);
-                    error->argc++;
-                }
-                break;
-            default:
-                break;
-            }
-            if (error->argc >= ERR_MAX_ARGS) {
-                break;
-            }
-        }
-    }
-    va_end(ap);
-
-    /* If we are in debug mode, print out an error message */
-    SDL_LogError(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError());
-
-    return -1;
-}
-
-/* This function has a bit more overhead than most error functions
-   so that it supports internationalization and thread-safe errors.
-*/
-static char *
-SDL_GetErrorMsg(char *errstr, unsigned int maxlen)
-{
-    SDL_error *error;
-
-    /* Clear the error string */
-    *errstr = '\0';
-    --maxlen;
-
-    /* Get the thread-safe error, and print it out */
-    error = SDL_GetErrBuf();
-    if (error->error) {
-        const char *fmt;
-        char *msg = errstr;
-        int len;
-        int argi;
-
-        fmt = SDL_LookupString(error->key);
-        argi = 0;
-        while (*fmt && (maxlen > 0)) {
-            if (*fmt == '%') {
-                char tmp[32], *spot = tmp;
-                *spot++ = *fmt++;
-                while ((*fmt == '.' || (*fmt >= '0' && *fmt <= '9'))
-                       && spot < (tmp + SDL_arraysize(tmp) - 2)) {
-                    *spot++ = *fmt++;
-                }
-                *spot++ = *fmt++;
-                *spot++ = '\0';
-                switch (spot[-2]) {
-                case '%':
-                    *msg++ = '%';
-                    maxlen -= 1;
-                    break;
-                case 'c':
-                case 'i':
-                case 'd':
-                case 'u':
-                case 'o':
-                case 'x':
-                case 'X':
-                    len =
-                        SDL_snprintf(msg, maxlen, tmp,
-                                     error->args[argi++].value_i);
-                    msg += len;
-                    maxlen -= len;
-                    break;
-                case 'f':
-                    len =
-                        SDL_snprintf(msg, maxlen, tmp,
-                                     error->args[argi++].value_f);
-                    msg += len;
-                    maxlen -= len;
-                    break;
-                case 'p':
-                    len =
-                        SDL_snprintf(msg, maxlen, tmp,
-                                     error->args[argi++].value_ptr);
-                    msg += len;
-                    maxlen -= len;
-                    break;
-                case 's':
-                    len =
-                        SDL_snprintf(msg, maxlen, tmp,
-                                     SDL_LookupString(error->args[argi++].
-                                                      buf));
-                    msg += len;
-                    maxlen -= len;
-                    break;
-                }
-            } else {
-                *msg++ = *fmt++;
-                maxlen -= 1;
-            }
-        }
-        *msg = 0;               /* NULL terminate the string */
-    }
-    return (errstr);
-}
-
-/* Available for backwards compatibility */
-const char *
-SDL_GetError(void)
-{
-    static char errmsg[SDL_ERRBUFIZE];
-
-    return SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE);
-}
-
-void
-SDL_ClearError(void)
-{
-    SDL_error *error;
-
-    error = SDL_GetErrBuf();
-    error->error = 0;
-}
-
-/* Very common errors go here */
-int
-SDL_Error(SDL_errorcode code)
-{
-    switch (code) {
-    case SDL_ENOMEM:
-        return SDL_SetError("Out of memory");
-    case SDL_EFREAD:
-        return SDL_SetError("Error reading from datastream");
-    case SDL_EFWRITE:
-        return SDL_SetError("Error writing to datastream");
-    case SDL_EFSEEK:
-        return SDL_SetError("Error seeking in datastream");
-    case SDL_UNSUPPORTED:
-        return SDL_SetError("That operation is not supported");
-    default:
-        return SDL_SetError("Unknown SDL error");
-    }
-}
-
-#ifdef TEST_ERROR
-int
-main(int argc, char *argv[])
-{
-    char buffer[BUFSIZ + 1];
-
-    SDL_SetError("Hi there!");
-    printf("Error 1: %s\n", SDL_GetError());
-    SDL_ClearError();
-    SDL_memset(buffer, '1', BUFSIZ);
-    buffer[BUFSIZ] = 0;
-    SDL_SetError("This is the error: %s (%f)", buffer, 1.0);
-    printf("Error 2: %s\n", SDL_GetError());
-    exit(0);
-}
-#endif
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/SDL_error_c.h b/deps/SDL2/src/SDL_error_c.h
deleted file mode 100644
index 2014cc1..0000000
--- a/deps/SDL2/src/SDL_error_c.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This file defines a structure that carries language-independent
-   error messages
-*/
-
-#ifndef _SDL_error_c_h
-#define _SDL_error_c_h
-
-#define ERR_MAX_STRLEN  128
-#define ERR_MAX_ARGS    5
-
-typedef struct SDL_error
-{
-    /* This is a numeric value corresponding to the current error */
-    int error;
-
-    /* This is a key used to index into a language hashtable containing
-       internationalized versions of the SDL error messages.  If the key
-       is not in the hashtable, or no hashtable is available, the key is
-       used directly as an error message format string.
-     */
-    char key[ERR_MAX_STRLEN];
-
-    /* These are the arguments for the error functions */
-    int argc;
-    union
-    {
-        void *value_ptr;
-#if 0                           /* What is a character anyway?  (UNICODE issues) */
-        unsigned char value_c;
-#endif
-        int value_i;
-        double value_f;
-        char buf[ERR_MAX_STRLEN];
-    } args[ERR_MAX_ARGS];
-} SDL_error;
-
-/* Defined in SDL_thread.c */
-extern SDL_error *SDL_GetErrBuf(void);
-
-#endif /* _SDL_error_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/SDL_hints.c b/deps/SDL2/src/SDL_hints.c
deleted file mode 100644
index a1eae9f..0000000
--- a/deps/SDL2/src/SDL_hints.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_hints.h"
-#include "SDL_error.h"
-
-
-/* Assuming there aren't many hints set and they aren't being queried in
-   critical performance paths, we'll just use linked lists here.
- */
-typedef struct SDL_HintWatch {
-    SDL_HintCallback callback;
-    void *userdata;
-    struct SDL_HintWatch *next;
-} SDL_HintWatch;
-
-typedef struct SDL_Hint {
-    char *name;
-    char *value;
-    SDL_HintPriority priority;
-    SDL_HintWatch *callbacks;
-    struct SDL_Hint *next;
-} SDL_Hint;
-
-static SDL_Hint *SDL_hints;
-
-SDL_bool
-SDL_SetHintWithPriority(const char *name, const char *value,
-                        SDL_HintPriority priority)
-{
-    const char *env;
-    SDL_Hint *hint;
-    SDL_HintWatch *entry;
-
-    if (!name || !value) {
-        return SDL_FALSE;
-    }
-
-    env = SDL_getenv(name);
-    if (env && priority < SDL_HINT_OVERRIDE) {
-        return SDL_FALSE;
-    }
-
-    for (hint = SDL_hints; hint; hint = hint->next) {
-        if (SDL_strcmp(name, hint->name) == 0) {
-            if (priority < hint->priority) {
-                return SDL_FALSE;
-            }
-            if (!hint->value || !value || SDL_strcmp(hint->value, value) != 0) {
-                for (entry = hint->callbacks; entry; ) {
-                    /* Save the next entry in case this one is deleted */
-                    SDL_HintWatch *next = entry->next;
-                    entry->callback(entry->userdata, name, hint->value, value);
-                    entry = next;
-                }
-                SDL_free(hint->value);
-                hint->value = value ? SDL_strdup(value) : NULL;
-            }
-            hint->priority = priority;
-            return SDL_TRUE;
-        }
-    }
-
-    /* Couldn't find the hint, add a new one */
-    hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
-    if (!hint) {
-        return SDL_FALSE;
-    }
-    hint->name = SDL_strdup(name);
-    hint->value = value ? SDL_strdup(value) : NULL;
-    hint->priority = priority;
-    hint->callbacks = NULL;
-    hint->next = SDL_hints;
-    SDL_hints = hint;
-    return SDL_TRUE;
-}
-
-SDL_bool
-SDL_SetHint(const char *name, const char *value)
-{
-    return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL);
-}
-
-const char *
-SDL_GetHint(const char *name)
-{
-    const char *env;
-    SDL_Hint *hint;
-
-    env = SDL_getenv(name);
-    for (hint = SDL_hints; hint; hint = hint->next) {
-        if (SDL_strcmp(name, hint->name) == 0) {
-            if (!env || hint->priority == SDL_HINT_OVERRIDE) {
-                return hint->value;
-            }
-            break;
-        }
-    }
-    return env;
-}
-
-void
-SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
-{
-    SDL_Hint *hint;
-    SDL_HintWatch *entry;
-    const char *value;
-
-    if (!name || !*name) {
-        SDL_InvalidParamError("name");
-        return;
-    }
-    if (!callback) {
-        SDL_InvalidParamError("callback");
-        return;
-    }
-
-    SDL_DelHintCallback(name, callback, userdata);
-
-    entry = (SDL_HintWatch *)SDL_malloc(sizeof(*entry));
-    entry->callback = callback;
-    entry->userdata = userdata;
-
-    for (hint = SDL_hints; hint; hint = hint->next) {
-        if (SDL_strcmp(name, hint->name) == 0) {
-            break;
-        }
-    }
-    if (!hint) {
-        /* Need to add a hint entry for this watcher */
-        hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
-        if (!hint) {
-            return;
-        }
-        hint->name = SDL_strdup(name);
-        hint->value = NULL;
-        hint->priority = SDL_HINT_DEFAULT;
-        hint->callbacks = NULL;
-        hint->next = SDL_hints;
-        SDL_hints = hint;
-    }
-
-    /* Add it to the callbacks for this hint */
-    entry->next = hint->callbacks;
-    hint->callbacks = entry;
-
-    /* Now call it with the current value */
-    value = SDL_GetHint(name);
-    callback(userdata, name, value, value);
-}
-
-void
-SDL_DelHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
-{
-    SDL_Hint *hint;
-    SDL_HintWatch *entry, *prev;
-
-    for (hint = SDL_hints; hint; hint = hint->next) {
-        if (SDL_strcmp(name, hint->name) == 0) {
-            prev = NULL;
-            for (entry = hint->callbacks; entry; entry = entry->next) {
-                if (callback == entry->callback && userdata == entry->userdata) {
-                    if (prev) {
-                        prev->next = entry->next;
-                    } else {
-                        hint->callbacks = entry->next;
-                    }
-                    SDL_free(entry);
-                    break;
-                }
-                prev = entry;
-            }
-            return;
-        }
-    }
-}
-
-void SDL_ClearHints(void)
-{
-    SDL_Hint *hint;
-    SDL_HintWatch *entry;
-
-    while (SDL_hints) {
-        hint = SDL_hints;
-        SDL_hints = hint->next;
-
-        SDL_free(hint->name);
-        SDL_free(hint->value);
-        for (entry = hint->callbacks; entry; ) {
-            SDL_HintWatch *freeable = entry;
-            entry = entry->next;
-            SDL_free(freeable);
-        }
-        SDL_free(hint);
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/SDL_log.c b/deps/SDL2/src/SDL_log.c
deleted file mode 100644
index 18611ca..0000000
--- a/deps/SDL2/src/SDL_log.c
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(__WIN32__)
-#include "core/windows/SDL_windows.h"
-#endif
-
-/* Simple log messages in SDL */
-
-#include "SDL_log.h"
-
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#if defined(__ANDROID__)
-#include <android/log.h>
-#endif
-
-#define DEFAULT_PRIORITY                SDL_LOG_PRIORITY_CRITICAL
-#define DEFAULT_ASSERT_PRIORITY         SDL_LOG_PRIORITY_WARN
-#define DEFAULT_APPLICATION_PRIORITY    SDL_LOG_PRIORITY_INFO
-#define DEFAULT_TEST_PRIORITY           SDL_LOG_PRIORITY_VERBOSE
-
-/* Forward definition of error function */
-extern int SDL_SetError(const char *fmt, ...);
-
-typedef struct SDL_LogLevel
-{
-    int category;
-    SDL_LogPriority priority;
-    struct SDL_LogLevel *next;
-} SDL_LogLevel;
-
-/* The default log output function */
-static void SDL_LogOutput(void *userdata,
-                          int category, SDL_LogPriority priority,
-                          const char *message);
-
-static SDL_LogLevel *SDL_loglevels;
-static SDL_LogPriority SDL_default_priority = DEFAULT_PRIORITY;
-static SDL_LogPriority SDL_assert_priority = DEFAULT_ASSERT_PRIORITY;
-static SDL_LogPriority SDL_application_priority = DEFAULT_APPLICATION_PRIORITY;
-static SDL_LogPriority SDL_test_priority = DEFAULT_TEST_PRIORITY;
-static SDL_LogOutputFunction SDL_log_function = SDL_LogOutput;
-static void *SDL_log_userdata = NULL;
-
-static const char *SDL_priority_prefixes[SDL_NUM_LOG_PRIORITIES] = {
-    NULL,
-    "VERBOSE",
-    "DEBUG",
-    "INFO",
-    "WARN",
-    "ERROR",
-    "CRITICAL"
-};
-
-#ifdef __ANDROID__
-static const char *SDL_category_prefixes[SDL_LOG_CATEGORY_RESERVED1] = {
-    "APP",
-    "ERROR",
-    "SYSTEM",
-    "AUDIO",
-    "VIDEO",
-    "RENDER",
-    "INPUT"
-};
-
-static int SDL_android_priority[SDL_NUM_LOG_PRIORITIES] = {
-    ANDROID_LOG_UNKNOWN,
-    ANDROID_LOG_VERBOSE,
-    ANDROID_LOG_DEBUG,
-    ANDROID_LOG_INFO,
-    ANDROID_LOG_WARN,
-    ANDROID_LOG_ERROR,
-    ANDROID_LOG_FATAL
-};
-#endif /* __ANDROID__ */
-
-
-void
-SDL_LogSetAllPriority(SDL_LogPriority priority)
-{
-    SDL_LogLevel *entry;
-
-    for (entry = SDL_loglevels; entry; entry = entry->next) {
-        entry->priority = priority;
-    }
-    SDL_default_priority = priority;
-    SDL_assert_priority = priority;
-    SDL_application_priority = priority;
-}
-
-void
-SDL_LogSetPriority(int category, SDL_LogPriority priority)
-{
-    SDL_LogLevel *entry;
-
-    for (entry = SDL_loglevels; entry; entry = entry->next) {
-        if (entry->category == category) {
-            entry->priority = priority;
-            return;
-        }
-    }
-
-    /* Create a new entry */
-    entry = (SDL_LogLevel *)SDL_malloc(sizeof(*entry));
-    if (entry) {
-        entry->category = category;
-        entry->priority = priority;
-        entry->next = SDL_loglevels;
-        SDL_loglevels = entry;
-    }
-}
-
-SDL_LogPriority
-SDL_LogGetPriority(int category)
-{
-    SDL_LogLevel *entry;
-
-    for (entry = SDL_loglevels; entry; entry = entry->next) {
-        if (entry->category == category) {
-            return entry->priority;
-        }
-    }
-
-    if (category == SDL_LOG_CATEGORY_TEST) {
-        return SDL_test_priority;
-    } else if (category == SDL_LOG_CATEGORY_APPLICATION) {
-        return SDL_application_priority;
-    } else if (category == SDL_LOG_CATEGORY_ASSERT) {
-        return SDL_assert_priority;
-    } else {
-        return SDL_default_priority;
-    }
-}
-
-void
-SDL_LogResetPriorities(void)
-{
-    SDL_LogLevel *entry;
-
-    while (SDL_loglevels) {
-        entry = SDL_loglevels;
-        SDL_loglevels = entry->next;
-        SDL_free(entry);
-    }
-
-    SDL_default_priority = DEFAULT_PRIORITY;
-    SDL_assert_priority = DEFAULT_ASSERT_PRIORITY;
-    SDL_application_priority = DEFAULT_APPLICATION_PRIORITY;
-    SDL_test_priority = DEFAULT_TEST_PRIORITY;
-}
-
-void
-SDL_Log(const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap);
-    va_end(ap);
-}
-
-void
-SDL_LogVerbose(int category, const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    SDL_LogMessageV(category, SDL_LOG_PRIORITY_VERBOSE, fmt, ap);
-    va_end(ap);
-}
-
-void
-SDL_LogDebug(int category, const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    SDL_LogMessageV(category, SDL_LOG_PRIORITY_DEBUG, fmt, ap);
-    va_end(ap);
-}
-
-void
-SDL_LogInfo(int category, const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    SDL_LogMessageV(category, SDL_LOG_PRIORITY_INFO, fmt, ap);
-    va_end(ap);
-}
-
-void
-SDL_LogWarn(int category, const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    SDL_LogMessageV(category, SDL_LOG_PRIORITY_WARN, fmt, ap);
-    va_end(ap);
-}
-
-void
-SDL_LogError(int category, const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    SDL_LogMessageV(category, SDL_LOG_PRIORITY_ERROR, fmt, ap);
-    va_end(ap);
-}
-
-void
-SDL_LogCritical(int category, const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    SDL_LogMessageV(category, SDL_LOG_PRIORITY_CRITICAL, fmt, ap);
-    va_end(ap);
-}
-
-void
-SDL_LogMessage(int category, SDL_LogPriority priority, const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    SDL_LogMessageV(category, priority, fmt, ap);
-    va_end(ap);
-}
-
-#ifdef __ANDROID__
-static const char *
-GetCategoryPrefix(int category)
-{
-    if (category < SDL_LOG_CATEGORY_RESERVED1) {
-        return SDL_category_prefixes[category];
-    }
-    if (category < SDL_LOG_CATEGORY_CUSTOM) {
-        return "RESERVED";
-    }
-    return "CUSTOM";
-}
-#endif /* __ANDROID__ */
-
-void
-SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap)
-{
-    char *message;
-    size_t len;
-
-    /* Nothing to do if we don't have an output function */
-    if (!SDL_log_function) {
-        return;
-    }
-
-    /* Make sure we don't exceed array bounds */
-    if ((int)priority < 0 || priority >= SDL_NUM_LOG_PRIORITIES) {
-        return;
-    }
-
-    /* See if we want to do anything with this message */
-    if (priority < SDL_LogGetPriority(category)) {
-        return;
-    }
-
-    message = SDL_stack_alloc(char, SDL_MAX_LOG_MESSAGE);
-    if (!message) {
-        return;
-    }
-
-    SDL_vsnprintf(message, SDL_MAX_LOG_MESSAGE, fmt, ap);
-
-    /* Chop off final endline. */
-    len = SDL_strlen(message);
-    if ((len > 0) && (message[len-1] == '\n')) {
-        message[--len] = '\0';
-        if ((len > 0) && (message[len-1] == '\r')) {  /* catch "\r\n", too. */
-            message[--len] = '\0';
-        }
-    }
-
-    SDL_log_function(SDL_log_userdata, category, priority, message);
-    SDL_stack_free(message);
-}
-
-#if defined(__WIN32__)
-/* Flag tracking the attachment of the console: 0=unattached, 1=attached, -1=error */
-static int consoleAttached = 0;
-
-/* Handle to stderr output of console. */
-static HANDLE stderrHandle = NULL;
-#endif
-
-static void
-SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
-              const char *message)
-{
-#if defined(__WIN32__)
-    /* Way too many allocations here, urgh */
-    /* Note: One can't call SDL_SetError here, since that function itself logs. */
-    {
-        char *output;
-        size_t length;
-        LPTSTR tstr;
-        BOOL attachResult;
-        DWORD attachError;
-        unsigned long charsWritten; 
-
-        /* Maybe attach console and get stderr handle */
-        if (consoleAttached == 0) {
-            attachResult = AttachConsole(ATTACH_PARENT_PROCESS);
-            if (!attachResult) {
-                    attachError = GetLastError();
-                    if (attachError == ERROR_INVALID_HANDLE) {
-                        OutputDebugString(TEXT("Parent process has no console\r\n"));
-                        consoleAttached = -1;
-                    } else if (attachError == ERROR_GEN_FAILURE) {
-                         OutputDebugString(TEXT("Could not attach to console of parent process\r\n"));
-                         consoleAttached = -1;
-                    } else if (attachError == ERROR_ACCESS_DENIED) {  
-                         /* Already attached */
-                        consoleAttached = 1;
-                    } else {
-                        OutputDebugString(TEXT("Error attaching console\r\n"));
-                        consoleAttached = -1;
-                    }
-                } else {
-                    /* Newly attached */
-                    consoleAttached = 1;
-                }
-			
-                if (consoleAttached == 1) {
-                        stderrHandle = GetStdHandle(STD_ERROR_HANDLE);
-                }
-        }
-
-        length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1 + 1 + 1;
-        output = SDL_stack_alloc(char, length);
-        SDL_snprintf(output, length, "%s: %s\r\n", SDL_priority_prefixes[priority], message);
-        tstr = WIN_UTF8ToString(output);
-        
-        /* Output to debugger */
-        OutputDebugString(tstr);
-       
-        /* Screen output to stderr, if console was attached. */
-        if (consoleAttached == 1) {
-                if (!WriteConsole(stderrHandle, tstr, lstrlen(tstr), &charsWritten, NULL)) {
-                    OutputDebugString(TEXT("Error calling WriteConsole\r\n"));
-                }
-                if (charsWritten == ERROR_NOT_ENOUGH_MEMORY) {
-                    OutputDebugString(TEXT("Insufficient heap memory to write message\r\n"));
-                }
-        }
-
-        SDL_free(tstr);
-        SDL_stack_free(output);
-    }
-#elif defined(__ANDROID__)
-    {
-        char tag[32];
-
-        SDL_snprintf(tag, SDL_arraysize(tag), "SDL/%s", GetCategoryPrefix(category));
-        __android_log_write(SDL_android_priority[priority], tag, message);
-    }
-#elif defined(__APPLE__) && defined(SDL_VIDEO_DRIVER_COCOA)
-    /* Technically we don't need SDL_VIDEO_DRIVER_COCOA, but that's where this function is defined for now.
-    */
-    extern void SDL_NSLog(const char *text);
-    {
-        char *text;
-
-        text = SDL_stack_alloc(char, SDL_MAX_LOG_MESSAGE);
-        if (text) {
-            SDL_snprintf(text, SDL_MAX_LOG_MESSAGE, "%s: %s", SDL_priority_prefixes[priority], message);
-            SDL_NSLog(text);
-            SDL_stack_free(text);
-            return;
-        }
-    }
-#elif defined(__PSP__)
-    {
-        FILE*        pFile;
-        pFile = fopen ("SDL_Log.txt", "a");
-        fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message);
-        fclose (pFile);
-    }
-#endif
-#if HAVE_STDIO_H
-    fprintf(stderr, "%s: %s\n", SDL_priority_prefixes[priority], message);
-#endif
-}
-
-void
-SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata)
-{
-    if (callback) {
-        *callback = SDL_log_function;
-    }
-    if (userdata) {
-        *userdata = SDL_log_userdata;
-    }
-}
-
-void
-SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata)
-{
-    SDL_log_function = callback;
-    SDL_log_userdata = userdata;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/atomic/SDL_atomic.c b/deps/SDL2/src/atomic/SDL_atomic.c
deleted file mode 100644
index e9b636f..0000000
--- a/deps/SDL2/src/atomic/SDL_atomic.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_atomic.h"
-
-/* Note that we undefine the atomic operations here, in case they are
-   defined as compiler intrinsics while building SDL but the library user
-   doesn't have that compiler.  That way we always have a working set of
-   atomic operations built into the library.
-*/
-#undef SDL_AtomicCAS
-#undef SDL_AtomicCASPtr
-
-/*
-  If any of the operations are not provided then we must emulate some
-  of them. That means we need a nice implementation of spin locks
-  that avoids the "one big lock" problem. We use a vector of spin
-  locks and pick which one to use based on the address of the operand
-  of the function.
-
-  To generate the index of the lock we first shift by 3 bits to get
-  rid on the zero bits that result from 32 and 64 bit allignment of
-  data. We then mask off all but 5 bits and use those 5 bits as an
-  index into the table.
-
-  Picking the lock this way insures that accesses to the same data at
-  the same time will go to the same lock. OTOH, accesses to different
-  data have only a 1/32 chance of hitting the same lock. That should
-  pretty much eliminate the chances of several atomic operations on
-  different data from waiting on the same "big lock". If it isn't
-  then the table of locks can be expanded to a new size so long as
-  the new size is a power of two.
-
-  Contributed by Bob Pendleton, bob at pendleton.com
-*/
-
-static SDL_SpinLock locks[32];
-
-static SDL_INLINE void
-enterLock(void *a)
-{
-    uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f);
-
-    SDL_AtomicLock(&locks[index]);
-}
-
-static SDL_INLINE void
-leaveLock(void *a)
-{
-    uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f);
-
-    SDL_AtomicUnlock(&locks[index]);
-}
-
-DECLSPEC SDL_bool SDLCALL
-SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
-{
-    SDL_bool retval = SDL_FALSE;
-
-    enterLock(a);
-    if (a->value == oldval) {
-        a->value = newval;
-        retval = SDL_TRUE;
-    }
-    leaveLock(a);
-
-    return retval;
-}
-
-DECLSPEC SDL_bool SDLCALL
-SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
-{
-    SDL_bool retval = SDL_FALSE;
-
-    enterLock(a);
-    if (*a == oldval) {
-        *a = newval;
-        retval = SDL_TRUE;
-    }
-    leaveLock(a);
-
-    return retval;
-}
-
-#if defined(__GNUC__) && defined(__arm__) && \
-   (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__))
-__asm__(
-"   .align 2\n"
-"   .globl _SDL_MemoryBarrierRelease\n"
-"   .globl _SDL_MemoryBarrierAcquire\n"
-"_SDL_MemoryBarrierRelease:\n"
-"_SDL_MemoryBarrierAcquire:\n"
-"   mov r0, #0\n"
-"   mcr p15, 0, r0, c7, c10, 5\n"
-"   bx lr\n"
-);
-#endif /* __GNUC__ && __arm__ && ARMV6 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/atomic/SDL_spinlock.c b/deps/SDL2/src/atomic/SDL_spinlock.c
deleted file mode 100644
index 0826a3f..0000000
--- a/deps/SDL2/src/atomic/SDL_spinlock.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef __WIN32__
-#include "../core/windows/SDL_windows.h"
-#endif
-
-#include "SDL_atomic.h"
-#include "SDL_mutex.h"
-#include "SDL_timer.h"
-
-
-/* This function is where all the magic happens... */
-SDL_bool
-SDL_AtomicTryLock(SDL_SpinLock *lock)
-{
-#if SDL_ATOMIC_DISABLED
-    /* Terrible terrible damage */
-    static SDL_mutex *_spinlock_mutex;
-
-    if (!_spinlock_mutex) {
-        /* Race condition on first lock... */
-        _spinlock_mutex = SDL_CreateMutex();
-    }
-    SDL_LockMutex(_spinlock_mutex);
-    if (*lock == 0) {
-        *lock = 1;
-        SDL_UnlockMutex(_spinlock_mutex);
-        return SDL_TRUE;
-    } else {
-        SDL_UnlockMutex(_spinlock_mutex);
-        return SDL_FALSE;
-    }
-
-#elif defined(_MSC_VER)
-    SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long));
-    return (InterlockedExchange((long*)lock, 1) == 0);
-
-#elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
-    return (__sync_lock_test_and_set(lock, 1) == 0);
-
-#elif defined(__GNUC__) && defined(__arm__) && \
-        (defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \
-         defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__) || \
-         defined(__ARM_ARCH_5TEJ__))
-    int result;
-    __asm__ __volatile__ (
-        "swp %0, %1, [%2]\n"
-        : "=&r,&r" (result) : "r,0" (1), "r,r" (lock) : "memory");
-    return (result == 0);
-
-#elif defined(__GNUC__) && defined(__arm__)
-    int result;
-    __asm__ __volatile__ (
-        "ldrex %0, [%2]\nteq   %0, #0\nstrexeq %0, %1, [%2]"
-        : "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory");
-    return (result == 0);
-
-#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
-    int result;
-    __asm__ __volatile__(
-        "lock ; xchgl %0, (%1)\n"
-        : "=r" (result) : "r" (lock), "0" (1) : "cc", "memory");
-    return (result == 0);
-
-#elif defined(__MACOSX__) || defined(__IPHONEOS__)
-    /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */
-    return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
-
-#elif HAVE_PTHREAD_SPINLOCK
-    /* pthread instructions */
-    return (pthread_spin_trylock(lock) == 0);
-
-#else
-#error Please implement for your platform.
-    return SDL_FALSE;
-#endif
-}
-
-void
-SDL_AtomicLock(SDL_SpinLock *lock)
-{
-    /* FIXME: Should we have an eventual timeout? */
-    while (!SDL_AtomicTryLock(lock)) {
-        SDL_Delay(0);
-    }
-}
-
-void
-SDL_AtomicUnlock(SDL_SpinLock *lock)
-{
-#if defined(_MSC_VER)
-    _ReadWriteBarrier();
-    *lock = 0;
-
-#elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
-    __sync_lock_release(lock);
-
-#elif HAVE_PTHREAD_SPINLOCK
-    pthread_spin_unlock(lock);
-
-#else
-    *lock = 0;
-#endif
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_audio.c b/deps/SDL2/src/audio/SDL_audio.c
deleted file mode 100644
index 5631bb2..0000000
--- a/deps/SDL2/src/audio/SDL_audio.c
+++ /dev/null
@@ -1,1283 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include "SDL.h"
-#include "SDL_audio.h"
-#include "SDL_audio_c.h"
-#include "SDL_audiomem.h"
-#include "SDL_sysaudio.h"
-
-#define _THIS SDL_AudioDevice *_this
-
-static SDL_AudioDriver current_audio;
-static SDL_AudioDevice *open_devices[16];
-
-/* !!! FIXME: These are wordy and unlocalized... */
-#define DEFAULT_OUTPUT_DEVNAME "System audio output device"
-#define DEFAULT_INPUT_DEVNAME "System audio capture device"
-
-
-/*
- * Not all of these will be compiled and linked in, but it's convenient
- *  to have a complete list here and saves yet-another block of #ifdefs...
- *  Please see bootstrap[], below, for the actual #ifdef mess.
- */
-extern AudioBootStrap BSD_AUDIO_bootstrap;
-extern AudioBootStrap DSP_bootstrap;
-extern AudioBootStrap ALSA_bootstrap;
-extern AudioBootStrap PULSEAUDIO_bootstrap;
-extern AudioBootStrap QSAAUDIO_bootstrap;
-extern AudioBootStrap SUNAUDIO_bootstrap;
-extern AudioBootStrap ARTS_bootstrap;
-extern AudioBootStrap ESD_bootstrap;
-extern AudioBootStrap NAS_bootstrap;
-extern AudioBootStrap XAUDIO2_bootstrap;
-extern AudioBootStrap DSOUND_bootstrap;
-extern AudioBootStrap WINMM_bootstrap;
-extern AudioBootStrap PAUDIO_bootstrap;
-extern AudioBootStrap BEOSAUDIO_bootstrap;
-extern AudioBootStrap COREAUDIO_bootstrap;
-extern AudioBootStrap SNDMGR_bootstrap;
-extern AudioBootStrap DISKAUD_bootstrap;
-extern AudioBootStrap DUMMYAUD_bootstrap;
-extern AudioBootStrap DCAUD_bootstrap;
-extern AudioBootStrap DART_bootstrap;
-extern AudioBootStrap NDSAUD_bootstrap;
-extern AudioBootStrap FUSIONSOUND_bootstrap;
-extern AudioBootStrap ANDROIDAUD_bootstrap;
-extern AudioBootStrap PSPAUD_bootstrap;
-extern AudioBootStrap SNDIO_bootstrap;
-
-/* Available audio drivers */
-static const AudioBootStrap *const bootstrap[] = {
-#if SDL_AUDIO_DRIVER_PULSEAUDIO
-    &PULSEAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_ALSA
-    &ALSA_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_SNDIO
-    &SNDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_BSD
-    &BSD_AUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_OSS
-    &DSP_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_QSA
-    &QSAAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_SUNAUDIO
-    &SUNAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_ARTS
-    &ARTS_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_ESD
-    &ESD_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_NAS
-    &NAS_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_XAUDIO2
-    &XAUDIO2_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_DSOUND
-    &DSOUND_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_WINMM
-    &WINMM_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_PAUDIO
-    &PAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_BEOSAUDIO
-    &BEOSAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_COREAUDIO
-    &COREAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_DISK
-    &DISKAUD_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_DUMMY
-    &DUMMYAUD_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_FUSIONSOUND
-    &FUSIONSOUND_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_ANDROID
-    &ANDROIDAUD_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_PSP
-    &PSPAUD_bootstrap,
-#endif
-    NULL
-};
-
-static SDL_AudioDevice *
-get_audio_device(SDL_AudioDeviceID id)
-{
-    id--;
-    if ((id >= SDL_arraysize(open_devices)) || (open_devices[id] == NULL)) {
-        SDL_SetError("Invalid audio device ID");
-        return NULL;
-    }
-
-    return open_devices[id];
-}
-
-
-/* stubs for audio drivers that don't need a specific entry point... */
-static void
-SDL_AudioDetectDevices_Default(int iscapture, SDL_AddAudioDevice addfn)
-{                               /* no-op. */
-}
-
-static void
-SDL_AudioThreadInit_Default(_THIS)
-{                               /* no-op. */
-}
-
-static void
-SDL_AudioWaitDevice_Default(_THIS)
-{                               /* no-op. */
-}
-
-static void
-SDL_AudioPlayDevice_Default(_THIS)
-{                               /* no-op. */
-}
-
-static Uint8 *
-SDL_AudioGetDeviceBuf_Default(_THIS)
-{
-    return NULL;
-}
-
-static void
-SDL_AudioWaitDone_Default(_THIS)
-{                               /* no-op. */
-}
-
-static void
-SDL_AudioCloseDevice_Default(_THIS)
-{                               /* no-op. */
-}
-
-static void
-SDL_AudioDeinitialize_Default(void)
-{                               /* no-op. */
-}
-
-static int
-SDL_AudioOpenDevice_Default(_THIS, const char *devname, int iscapture)
-{
-    return -1;
-}
-
-static void
-SDL_AudioLockDevice_Default(SDL_AudioDevice * device)
-{
-    if (device->thread && (SDL_ThreadID() == device->threadid)) {
-        return;
-    }
-    SDL_LockMutex(device->mixer_lock);
-}
-
-static void
-SDL_AudioUnlockDevice_Default(SDL_AudioDevice * device)
-{
-    if (device->thread && (SDL_ThreadID() == device->threadid)) {
-        return;
-    }
-    SDL_UnlockMutex(device->mixer_lock);
-}
-
-
-static void
-finalize_audio_entry_points(void)
-{
-    /*
-     * Fill in stub functions for unused driver entry points. This lets us
-     *  blindly call them without having to check for validity first.
-     */
-
-#define FILL_STUB(x) \
-        if (current_audio.impl.x == NULL) { \
-            current_audio.impl.x = SDL_Audio##x##_Default; \
-        }
-    FILL_STUB(DetectDevices);
-    FILL_STUB(OpenDevice);
-    FILL_STUB(ThreadInit);
-    FILL_STUB(WaitDevice);
-    FILL_STUB(PlayDevice);
-    FILL_STUB(GetDeviceBuf);
-    FILL_STUB(WaitDone);
-    FILL_STUB(CloseDevice);
-    FILL_STUB(LockDevice);
-    FILL_STUB(UnlockDevice);
-    FILL_STUB(Deinitialize);
-#undef FILL_STUB
-}
-
-/* Streaming functions (for when the input and output buffer sizes are different) */
-/* Write [length] bytes from buf into the streamer */
-static void
-SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length)
-{
-    int i;
-
-    for (i = 0; i < length; ++i) {
-        stream->buffer[stream->write_pos] = buf[i];
-        ++stream->write_pos;
-    }
-}
-
-/* Read [length] bytes out of the streamer into buf */
-static void
-SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length)
-{
-    int i;
-
-    for (i = 0; i < length; ++i) {
-        buf[i] = stream->buffer[stream->read_pos];
-        ++stream->read_pos;
-    }
-}
-
-static int
-SDL_StreamLength(SDL_AudioStreamer * stream)
-{
-    return (stream->write_pos - stream->read_pos) % stream->max_len;
-}
-
-/* Initialize the stream by allocating the buffer and setting the read/write heads to the beginning */
-#if 0
-static int
-SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence)
-{
-    /* First try to allocate the buffer */
-    stream->buffer = (Uint8 *) SDL_malloc(max_len);
-    if (stream->buffer == NULL) {
-        return -1;
-    }
-
-    stream->max_len = max_len;
-    stream->read_pos = 0;
-    stream->write_pos = 0;
-
-    /* Zero out the buffer */
-    SDL_memset(stream->buffer, silence, max_len);
-
-    return 0;
-}
-#endif
-
-/* Deinitialize the stream simply by freeing the buffer */
-static void
-SDL_StreamDeinit(SDL_AudioStreamer * stream)
-{
-    SDL_free(stream->buffer);
-}
-
-#if defined(ANDROID)
-#include <android/log.h>
-#endif
-
-/* The general mixing thread function */
-int SDLCALL
-SDL_RunAudio(void *devicep)
-{
-    SDL_AudioDevice *device = (SDL_AudioDevice *) devicep;
-    Uint8 *stream;
-    int stream_len;
-    void *udata;
-    void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len);
-    Uint32 delay;
-    /* For streaming when the buffer sizes don't match up */
-    Uint8 *istream;
-    int istream_len = 0;
-
-    /* The audio mixing is always a high priority thread */
-    SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);
-
-    /* Perform any thread setup */
-    device->threadid = SDL_ThreadID();
-    current_audio.impl.ThreadInit(device);
-
-    /* Set up the mixing function */
-    fill = device->spec.callback;
-    udata = device->spec.userdata;
-
-    /* By default do not stream */
-    device->use_streamer = 0;
-
-    if (device->convert.needed) {
-#if 0                           /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */
-        /* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */
-        if (device->convert.len_mult != 1 || device->convert.len_div != 1) {
-            /* The streamer's maximum length should be twice whichever is larger: spec.size or len_cvt */
-            stream_max_len = 2 * device->spec.size;
-            if (device->convert.len_mult > device->convert.len_div) {
-                stream_max_len *= device->convert.len_mult;
-                stream_max_len /= device->convert.len_div;
-            }
-            if (SDL_StreamInit(&device->streamer, stream_max_len, silence) <
-                0)
-                return -1;
-            device->use_streamer = 1;
-
-            /* istream_len should be the length of what we grab from the callback and feed to conversion,
-               so that we get close to spec_size. I.e. we want device.spec_size = istream_len * u / d
-             */
-            istream_len =
-                device->spec.size * device->convert.len_div /
-                device->convert.len_mult;
-        }
-#endif
-        stream_len = device->convert.len;
-    } else {
-        stream_len = device->spec.size;
-    }
-
-    /* Calculate the delay while paused */
-    delay = ((device->spec.samples * 1000) / device->spec.freq);
-
-    /* Determine if the streamer is necessary here */
-    if (device->use_streamer == 1) {
-        /* This code is almost the same as the old code. The difference is, instead of reading
-           directly from the callback into "stream", then converting and sending the audio off,
-           we go: callback -> "istream" -> (conversion) -> streamer -> stream -> device.
-           However, reading and writing with streamer are done separately:
-           - We only call the callback and write to the streamer when the streamer does not
-           contain enough samples to output to the device.
-           - We only read from the streamer and tell the device to play when the streamer
-           does have enough samples to output.
-           This allows us to perform resampling in the conversion step, where the output of the
-           resampling process can be any number. We will have to see what a good size for the
-           stream's maximum length is, but I suspect 2*max(len_cvt, stream_len) is a good figure.
-         */
-        while (device->enabled) {
-
-            if (device->paused) {
-                SDL_Delay(delay);
-                continue;
-            }
-
-            /* Only read in audio if the streamer doesn't have enough already (if it does not have enough samples to output) */
-            if (SDL_StreamLength(&device->streamer) < stream_len) {
-                /* Set up istream */
-                if (device->convert.needed) {
-                    if (device->convert.buf) {
-                        istream = device->convert.buf;
-                    } else {
-                        continue;
-                    }
-                } else {
-/* FIXME: Ryan, this is probably wrong.  I imagine we don't want to get
- * a device buffer both here and below in the stream output.
- */
-                    istream = current_audio.impl.GetDeviceBuf(device);
-                    if (istream == NULL) {
-                        istream = device->fake_stream;
-                    }
-                }
-
-                /* Read from the callback into the _input_ stream */
-                SDL_LockMutex(device->mixer_lock);
-                (*fill) (udata, istream, istream_len);
-                SDL_UnlockMutex(device->mixer_lock);
-
-                /* Convert the audio if necessary and write to the streamer */
-                if (device->convert.needed) {
-                    SDL_ConvertAudio(&device->convert);
-                    if (istream == NULL) {
-                        istream = device->fake_stream;
-                    }
-                    /* SDL_memcpy(istream, device->convert.buf, device->convert.len_cvt); */
-                    SDL_StreamWrite(&device->streamer, device->convert.buf,
-                                    device->convert.len_cvt);
-                } else {
-                    SDL_StreamWrite(&device->streamer, istream, istream_len);
-                }
-            }
-
-            /* Only output audio if the streamer has enough to output */
-            if (SDL_StreamLength(&device->streamer) >= stream_len) {
-                /* Set up the output stream */
-                if (device->convert.needed) {
-                    if (device->convert.buf) {
-                        stream = device->convert.buf;
-                    } else {
-                        continue;
-                    }
-                } else {
-                    stream = current_audio.impl.GetDeviceBuf(device);
-                    if (stream == NULL) {
-                        stream = device->fake_stream;
-                    }
-                }
-
-                /* Now read from the streamer */
-                SDL_StreamRead(&device->streamer, stream, stream_len);
-
-                /* Ready current buffer for play and change current buffer */
-                if (stream != device->fake_stream) {
-                    current_audio.impl.PlayDevice(device);
-                    /* Wait for an audio buffer to become available */
-                    current_audio.impl.WaitDevice(device);
-                } else {
-                    SDL_Delay(delay);
-                }
-            }
-
-        }
-    } else {
-        /* Otherwise, do not use the streamer. This is the old code. */
-        const int silence = (int) device->spec.silence;
-
-        /* Loop, filling the audio buffers */
-        while (device->enabled) {
-
-            /* Fill the current buffer with sound */
-            if (device->convert.needed) {
-                if (device->convert.buf) {
-                    stream = device->convert.buf;
-                } else {
-                    continue;
-                }
-            } else {
-                stream = current_audio.impl.GetDeviceBuf(device);
-                if (stream == NULL) {
-                    stream = device->fake_stream;
-                }
-            }
-
-            SDL_LockMutex(device->mixer_lock);
-            if (device->paused) {
-                SDL_memset(stream, silence, stream_len);
-            } else {
-                (*fill) (udata, stream, stream_len);
-            }
-            SDL_UnlockMutex(device->mixer_lock);
-
-            /* Convert the audio if necessary */
-            if (device->convert.needed) {
-                SDL_ConvertAudio(&device->convert);
-                stream = current_audio.impl.GetDeviceBuf(device);
-                if (stream == NULL) {
-                    stream = device->fake_stream;
-                }
-                SDL_memcpy(stream, device->convert.buf,
-                           device->convert.len_cvt);
-            }
-
-            /* Ready current buffer for play and change current buffer */
-            if (stream != device->fake_stream) {
-                current_audio.impl.PlayDevice(device);
-                /* Wait for an audio buffer to become available */
-                current_audio.impl.WaitDevice(device);
-            } else {
-                SDL_Delay(delay);
-            }
-        }
-    }
-
-    /* Wait for the audio to drain.. */
-    current_audio.impl.WaitDone(device);
-
-    /* If necessary, deinit the streamer */
-    if (device->use_streamer == 1)
-        SDL_StreamDeinit(&device->streamer);
-
-    return (0);
-}
-
-
-static SDL_AudioFormat
-SDL_ParseAudioFormat(const char *string)
-{
-#define CHECK_FMT_STRING(x) if (SDL_strcmp(string, #x) == 0) return AUDIO_##x
-    CHECK_FMT_STRING(U8);
-    CHECK_FMT_STRING(S8);
-    CHECK_FMT_STRING(U16LSB);
-    CHECK_FMT_STRING(S16LSB);
-    CHECK_FMT_STRING(U16MSB);
-    CHECK_FMT_STRING(S16MSB);
-    CHECK_FMT_STRING(U16SYS);
-    CHECK_FMT_STRING(S16SYS);
-    CHECK_FMT_STRING(U16);
-    CHECK_FMT_STRING(S16);
-    CHECK_FMT_STRING(S32LSB);
-    CHECK_FMT_STRING(S32MSB);
-    CHECK_FMT_STRING(S32SYS);
-    CHECK_FMT_STRING(S32);
-    CHECK_FMT_STRING(F32LSB);
-    CHECK_FMT_STRING(F32MSB);
-    CHECK_FMT_STRING(F32SYS);
-    CHECK_FMT_STRING(F32);
-#undef CHECK_FMT_STRING
-    return 0;
-}
-
-int
-SDL_GetNumAudioDrivers(void)
-{
-    return (SDL_arraysize(bootstrap) - 1);
-}
-
-const char *
-SDL_GetAudioDriver(int index)
-{
-    if (index >= 0 && index < SDL_GetNumAudioDrivers()) {
-        return (bootstrap[index]->name);
-    }
-    return (NULL);
-}
-
-int
-SDL_AudioInit(const char *driver_name)
-{
-    int i = 0;
-    int initialized = 0;
-    int tried_to_init = 0;
-
-    if (SDL_WasInit(SDL_INIT_AUDIO)) {
-        SDL_AudioQuit();        /* shutdown driver if already running. */
-    }
-
-    SDL_memset(&current_audio, '\0', sizeof(current_audio));
-    SDL_memset(open_devices, '\0', sizeof(open_devices));
-
-    /* Select the proper audio driver */
-    if (driver_name == NULL) {
-        driver_name = SDL_getenv("SDL_AUDIODRIVER");
-    }
-
-    for (i = 0; (!initialized) && (bootstrap[i]); ++i) {
-        /* make sure we should even try this driver before doing so... */
-        const AudioBootStrap *backend = bootstrap[i];
-        if ((driver_name && (SDL_strncasecmp(backend->name, driver_name, SDL_strlen(driver_name)) != 0)) ||
-            (!driver_name && backend->demand_only)) {
-            continue;
-        }
-
-        tried_to_init = 1;
-        SDL_memset(&current_audio, 0, sizeof(current_audio));
-        current_audio.name = backend->name;
-        current_audio.desc = backend->desc;
-        initialized = backend->init(&current_audio.impl);
-    }
-
-    if (!initialized) {
-        /* specific drivers will set the error message if they fail... */
-        if (!tried_to_init) {
-            if (driver_name) {
-                SDL_SetError("Audio target '%s' not available", driver_name);
-            } else {
-                SDL_SetError("No available audio device");
-            }
-        }
-
-        SDL_memset(&current_audio, 0, sizeof(current_audio));
-        return (-1);            /* No driver was available, so fail. */
-    }
-
-    finalize_audio_entry_points();
-
-    return (0);
-}
-
-/*
- * Get the current audio driver name
- */
-const char *
-SDL_GetCurrentAudioDriver()
-{
-    return current_audio.name;
-}
-
-static void
-free_device_list(char ***devices, int *devCount)
-{
-    int i = *devCount;
-    if ((i > 0) && (*devices != NULL)) {
-        while (i--) {
-            SDL_free((*devices)[i]);
-        }
-    }
-
-    SDL_free(*devices);
-
-    *devices = NULL;
-    *devCount = 0;
-}
-
-static
-void SDL_AddCaptureAudioDevice(const char *_name)
-{
-    char *name = NULL;
-    void *ptr = SDL_realloc(current_audio.inputDevices,
-                          (current_audio.inputDeviceCount+1) * sizeof(char*));
-    if (ptr == NULL) {
-        return;  /* oh well. */
-    }
-
-    current_audio.inputDevices = (char **) ptr;
-    name = SDL_strdup(_name);  /* if this returns NULL, that's okay. */
-    current_audio.inputDevices[current_audio.inputDeviceCount++] = name;
-}
-
-static
-void SDL_AddOutputAudioDevice(const char *_name)
-{
-    char *name = NULL;
-    void *ptr = SDL_realloc(current_audio.outputDevices,
-                          (current_audio.outputDeviceCount+1) * sizeof(char*));
-    if (ptr == NULL) {
-        return;  /* oh well. */
-    }
-
-    current_audio.outputDevices = (char **) ptr;
-    name = SDL_strdup(_name);  /* if this returns NULL, that's okay. */
-    current_audio.outputDevices[current_audio.outputDeviceCount++] = name;
-}
-
-
-int
-SDL_GetNumAudioDevices(int iscapture)
-{
-    int retval = 0;
-
-    if (!SDL_WasInit(SDL_INIT_AUDIO)) {
-        return -1;
-    }
-
-    if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) {
-        return 0;
-    }
-
-    if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) {
-        return 1;
-    }
-
-    if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) {
-        return 1;
-    }
-
-    if (iscapture) {
-        free_device_list(&current_audio.inputDevices,
-                         &current_audio.inputDeviceCount);
-        current_audio.impl.DetectDevices(iscapture, SDL_AddCaptureAudioDevice);
-        retval = current_audio.inputDeviceCount;
-    } else {
-        free_device_list(&current_audio.outputDevices,
-                         &current_audio.outputDeviceCount);
-        current_audio.impl.DetectDevices(iscapture, SDL_AddOutputAudioDevice);
-        retval = current_audio.outputDeviceCount;
-    }
-
-    return retval;
-}
-
-
-const char *
-SDL_GetAudioDeviceName(int index, int iscapture)
-{
-    if (!SDL_WasInit(SDL_INIT_AUDIO)) {
-        SDL_SetError("Audio subsystem is not initialized");
-        return NULL;
-    }
-
-    if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) {
-        SDL_SetError("No capture support");
-        return NULL;
-    }
-
-    if (index < 0) {
-        goto no_such_device;
-    }
-
-    if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) {
-        return DEFAULT_INPUT_DEVNAME;
-    }
-
-    if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) {
-        return DEFAULT_OUTPUT_DEVNAME;
-    }
-
-    if (iscapture) {
-        if (index >= current_audio.inputDeviceCount) {
-            goto no_such_device;
-        }
-        return current_audio.inputDevices[index];
-    } else {
-        if (index >= current_audio.outputDeviceCount) {
-            goto no_such_device;
-        }
-        return current_audio.outputDevices[index];
-    }
-
-no_such_device:
-    SDL_SetError("No such device");
-    return NULL;
-}
-
-
-static void
-close_audio_device(SDL_AudioDevice * device)
-{
-    device->enabled = 0;
-    if (device->thread != NULL) {
-        SDL_WaitThread(device->thread, NULL);
-    }
-    if (device->mixer_lock != NULL) {
-        SDL_DestroyMutex(device->mixer_lock);
-    }
-    SDL_FreeAudioMem(device->fake_stream);
-    if (device->convert.needed) {
-        SDL_FreeAudioMem(device->convert.buf);
-    }
-    if (device->opened) {
-        current_audio.impl.CloseDevice(device);
-        device->opened = 0;
-    }
-    SDL_FreeAudioMem(device);
-}
-
-
-/*
- * Sanity check desired AudioSpec for SDL_OpenAudio() in (orig).
- *  Fills in a sanitized copy in (prepared).
- *  Returns non-zero if okay, zero on fatal parameters in (orig).
- */
-static int
-prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared)
-{
-    SDL_memcpy(prepared, orig, sizeof(SDL_AudioSpec));
-
-    if (orig->callback == NULL) {
-        SDL_SetError("SDL_OpenAudio() passed a NULL callback");
-        return 0;
-    }
-
-    if (orig->freq == 0) {
-        const char *env = SDL_getenv("SDL_AUDIO_FREQUENCY");
-        if ((!env) || ((prepared->freq = SDL_atoi(env)) == 0)) {
-            prepared->freq = 22050;     /* a reasonable default */
-        }
-    }
-
-    if (orig->format == 0) {
-        const char *env = SDL_getenv("SDL_AUDIO_FORMAT");
-        if ((!env) || ((prepared->format = SDL_ParseAudioFormat(env)) == 0)) {
-            prepared->format = AUDIO_S16;       /* a reasonable default */
-        }
-    }
-
-    switch (orig->channels) {
-    case 0:{
-            const char *env = SDL_getenv("SDL_AUDIO_CHANNELS");
-            if ((!env) || ((prepared->channels = (Uint8) SDL_atoi(env)) == 0)) {
-                prepared->channels = 2; /* a reasonable default */
-            }
-            break;
-        }
-    case 1:                    /* Mono */
-    case 2:                    /* Stereo */
-    case 4:                    /* surround */
-    case 6:                    /* surround with center and lfe */
-        break;
-    default:
-        SDL_SetError("Unsupported number of audio channels.");
-        return 0;
-    }
-
-    if (orig->samples == 0) {
-        const char *env = SDL_getenv("SDL_AUDIO_SAMPLES");
-        if ((!env) || ((prepared->samples = (Uint16) SDL_atoi(env)) == 0)) {
-            /* Pick a default of ~46 ms at desired frequency */
-            /* !!! FIXME: remove this when the non-Po2 resampling is in. */
-            const int samples = (prepared->freq / 1000) * 46;
-            int power2 = 1;
-            while (power2 < samples) {
-                power2 *= 2;
-            }
-            prepared->samples = power2;
-        }
-    }
-
-    /* Calculate the silence and size of the audio specification */
-    SDL_CalculateAudioSpec(prepared);
-
-    return 1;
-}
-
-
-static SDL_AudioDeviceID
-open_audio_device(const char *devname, int iscapture,
-                  const SDL_AudioSpec * desired, SDL_AudioSpec * obtained,
-                  int allowed_changes, int min_id)
-{
-    SDL_AudioDeviceID id = 0;
-    SDL_AudioSpec _obtained;
-    SDL_AudioDevice *device;
-    SDL_bool build_cvt;
-    int i = 0;
-
-    if (!SDL_WasInit(SDL_INIT_AUDIO)) {
-        SDL_SetError("Audio subsystem is not initialized");
-        return 0;
-    }
-
-    if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) {
-        SDL_SetError("No capture support");
-        return 0;
-    }
-
-    if (!obtained) {
-        obtained = &_obtained;
-    }
-    if (!prepare_audiospec(desired, obtained)) {
-        return 0;
-    }
-
-    /* If app doesn't care about a specific device, let the user override. */
-    if (devname == NULL) {
-        devname = SDL_getenv("SDL_AUDIO_DEVICE_NAME");
-    }
-
-    /*
-     * Catch device names at the high level for the simple case...
-     * This lets us have a basic "device enumeration" for systems that
-     *  don't have multiple devices, but makes sure the device name is
-     *  always NULL when it hits the low level.
-     *
-     * Also make sure that the simple case prevents multiple simultaneous
-     *  opens of the default system device.
-     */
-
-    if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) {
-        if ((devname) && (SDL_strcmp(devname, DEFAULT_INPUT_DEVNAME) != 0)) {
-            SDL_SetError("No such device");
-            return 0;
-        }
-        devname = NULL;
-
-        for (i = 0; i < SDL_arraysize(open_devices); i++) {
-            if ((open_devices[i]) && (open_devices[i]->iscapture)) {
-                SDL_SetError("Audio device already open");
-                return 0;
-            }
-        }
-    }
-
-    if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) {
-        if ((devname) && (SDL_strcmp(devname, DEFAULT_OUTPUT_DEVNAME) != 0)) {
-            SDL_SetError("No such device");
-            return 0;
-        }
-        devname = NULL;
-
-        for (i = 0; i < SDL_arraysize(open_devices); i++) {
-            if ((open_devices[i]) && (!open_devices[i]->iscapture)) {
-                SDL_SetError("Audio device already open");
-                return 0;
-            }
-        }
-    }
-
-    device = (SDL_AudioDevice *) SDL_AllocAudioMem(sizeof(SDL_AudioDevice));
-    if (device == NULL) {
-        SDL_OutOfMemory();
-        return 0;
-    }
-    SDL_memset(device, '\0', sizeof(SDL_AudioDevice));
-    device->spec = *obtained;
-    device->enabled = 1;
-    device->paused = 1;
-    device->iscapture = iscapture;
-
-    /* Create a semaphore for locking the sound buffers */
-    if (!current_audio.impl.SkipMixerLock) {
-        device->mixer_lock = SDL_CreateMutex();
-        if (device->mixer_lock == NULL) {
-            close_audio_device(device);
-            SDL_SetError("Couldn't create mixer lock");
-            return 0;
-        }
-    }
-
-    /* force a device detection if we haven't done one yet. */
-    if ( ((iscapture) && (current_audio.inputDevices == NULL)) ||
-         ((!iscapture) && (current_audio.outputDevices == NULL)) )
-        SDL_GetNumAudioDevices(iscapture);
-
-    if (current_audio.impl.OpenDevice(device, devname, iscapture) < 0) {
-        close_audio_device(device);
-        return 0;
-    }
-    device->opened = 1;
-
-    /* Allocate a fake audio memory buffer */
-    device->fake_stream = (Uint8 *)SDL_AllocAudioMem(device->spec.size);
-    if (device->fake_stream == NULL) {
-        close_audio_device(device);
-        SDL_OutOfMemory();
-        return 0;
-    }
-
-    /* See if we need to do any conversion */
-    build_cvt = SDL_FALSE;
-    if (obtained->freq != device->spec.freq) {
-        if (allowed_changes & SDL_AUDIO_ALLOW_FREQUENCY_CHANGE) {
-            obtained->freq = device->spec.freq;
-        } else {
-            build_cvt = SDL_TRUE;
-        }
-    }
-    if (obtained->format != device->spec.format) {
-        if (allowed_changes & SDL_AUDIO_ALLOW_FORMAT_CHANGE) {
-            obtained->format = device->spec.format;
-        } else {
-            build_cvt = SDL_TRUE;
-        }
-    }
-    if (obtained->channels != device->spec.channels) {
-        if (allowed_changes & SDL_AUDIO_ALLOW_CHANNELS_CHANGE) {
-            obtained->channels = device->spec.channels;
-        } else {
-            build_cvt = SDL_TRUE;
-        }
-    }
-
-    /* If the audio driver changes the buffer size, accept it.
-       This needs to be done after the format is modified above,
-       otherwise it might not have the correct buffer size.
-     */
-    if (device->spec.samples != obtained->samples) {
-        obtained->samples = device->spec.samples;
-        SDL_CalculateAudioSpec(obtained);
-    }
-
-    if (build_cvt) {
-        /* Build an audio conversion block */
-        if (SDL_BuildAudioCVT(&device->convert,
-                              obtained->format, obtained->channels,
-                              obtained->freq,
-                              device->spec.format, device->spec.channels,
-                              device->spec.freq) < 0) {
-            close_audio_device(device);
-            return 0;
-        }
-        if (device->convert.needed) {
-            device->convert.len = (int) (((double) device->spec.size) /
-                                         device->convert.len_ratio);
-
-            device->convert.buf =
-                (Uint8 *) SDL_AllocAudioMem(device->convert.len *
-                                            device->convert.len_mult);
-            if (device->convert.buf == NULL) {
-                close_audio_device(device);
-                SDL_OutOfMemory();
-                return 0;
-            }
-        }
-    }
-
-    /* Find an available device ID and store the structure... */
-    for (id = min_id - 1; id < SDL_arraysize(open_devices); id++) {
-        if (open_devices[id] == NULL) {
-            open_devices[id] = device;
-            break;
-        }
-    }
-
-    if (id == SDL_arraysize(open_devices)) {
-        SDL_SetError("Too many open audio devices");
-        close_audio_device(device);
-        return 0;
-    }
-
-    /* Start the audio thread if necessary */
-    if (!current_audio.impl.ProvidesOwnCallbackThread) {
-        /* Start the audio thread */
-        char name[64];
-        SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) (id + 1));
-/* !!! FIXME: this is nasty. */
-#if defined(__WIN32__) && !defined(HAVE_LIBC)
-#undef SDL_CreateThread
-        device->thread = SDL_CreateThread(SDL_RunAudio, name, device, NULL, NULL);
-#else
-        device->thread = SDL_CreateThread(SDL_RunAudio, name, device);
-#endif
-        if (device->thread == NULL) {
-            SDL_CloseAudioDevice(id + 1);
-            SDL_SetError("Couldn't create audio thread");
-            return 0;
-        }
-    }
-
-    return id + 1;
-}
-
-
-int
-SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained)
-{
-    SDL_AudioDeviceID id = 0;
-
-    /* Start up the audio driver, if necessary. This is legacy behaviour! */
-    if (!SDL_WasInit(SDL_INIT_AUDIO)) {
-        if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
-            return (-1);
-        }
-    }
-
-    /* SDL_OpenAudio() is legacy and can only act on Device ID #1. */
-    if (open_devices[0] != NULL) {
-        SDL_SetError("Audio device is already opened");
-        return (-1);
-    }
-
-    if (obtained) {
-        id = open_audio_device(NULL, 0, desired, obtained,
-                               SDL_AUDIO_ALLOW_ANY_CHANGE, 1);
-    } else {
-        id = open_audio_device(NULL, 0, desired, desired, 0, 1);
-    }
-
-    SDL_assert((id == 0) || (id == 1));
-    return ((id == 0) ? -1 : 0);
-}
-
-SDL_AudioDeviceID
-SDL_OpenAudioDevice(const char *device, int iscapture,
-                    const SDL_AudioSpec * desired, SDL_AudioSpec * obtained,
-                    int allowed_changes)
-{
-    return open_audio_device(device, iscapture, desired, obtained,
-                             allowed_changes, 2);
-}
-
-SDL_AudioStatus
-SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid)
-{
-    SDL_AudioDevice *device = get_audio_device(devid);
-    SDL_AudioStatus status = SDL_AUDIO_STOPPED;
-    if (device && device->enabled) {
-        if (device->paused) {
-            status = SDL_AUDIO_PAUSED;
-        } else {
-            status = SDL_AUDIO_PLAYING;
-        }
-    }
-    return (status);
-}
-
-
-SDL_AudioStatus
-SDL_GetAudioStatus(void)
-{
-    return SDL_GetAudioDeviceStatus(1);
-}
-
-void
-SDL_PauseAudioDevice(SDL_AudioDeviceID devid, int pause_on)
-{
-    SDL_AudioDevice *device = get_audio_device(devid);
-    if (device) {
-        current_audio.impl.LockDevice(device);
-        device->paused = pause_on;
-        current_audio.impl.UnlockDevice(device);
-    }
-}
-
-void
-SDL_PauseAudio(int pause_on)
-{
-    SDL_PauseAudioDevice(1, pause_on);
-}
-
-
-void
-SDL_LockAudioDevice(SDL_AudioDeviceID devid)
-{
-    /* Obtain a lock on the mixing buffers */
-    SDL_AudioDevice *device = get_audio_device(devid);
-    if (device) {
-        current_audio.impl.LockDevice(device);
-    }
-}
-
-void
-SDL_LockAudio(void)
-{
-    SDL_LockAudioDevice(1);
-}
-
-void
-SDL_UnlockAudioDevice(SDL_AudioDeviceID devid)
-{
-    /* Obtain a lock on the mixing buffers */
-    SDL_AudioDevice *device = get_audio_device(devid);
-    if (device) {
-        current_audio.impl.UnlockDevice(device);
-    }
-}
-
-void
-SDL_UnlockAudio(void)
-{
-    SDL_UnlockAudioDevice(1);
-}
-
-void
-SDL_CloseAudioDevice(SDL_AudioDeviceID devid)
-{
-    SDL_AudioDevice *device = get_audio_device(devid);
-    if (device) {
-        close_audio_device(device);
-        open_devices[devid - 1] = NULL;
-    }
-}
-
-void
-SDL_CloseAudio(void)
-{
-    SDL_CloseAudioDevice(1);
-}
-
-void
-SDL_AudioQuit(void)
-{
-    SDL_AudioDeviceID i;
-
-    if (!current_audio.name) {  /* not initialized?! */
-        return;
-    }
-
-    for (i = 0; i < SDL_arraysize(open_devices); i++) {
-        if (open_devices[i] != NULL) {
-            SDL_CloseAudioDevice(i+1);
-        }
-    }
-
-    /* Free the driver data */
-    current_audio.impl.Deinitialize();
-    free_device_list(&current_audio.outputDevices,
-                     &current_audio.outputDeviceCount);
-    free_device_list(&current_audio.inputDevices,
-                     &current_audio.inputDeviceCount);
-    SDL_memset(&current_audio, '\0', sizeof(current_audio));
-    SDL_memset(open_devices, '\0', sizeof(open_devices));
-}
-
-#define NUM_FORMATS 10
-static int format_idx;
-static int format_idx_sub;
-static SDL_AudioFormat format_list[NUM_FORMATS][NUM_FORMATS] = {
-    {AUDIO_U8, AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB,
-     AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB},
-    {AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB,
-     AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB},
-    {AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S32LSB,
-     AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8},
-    {AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S32MSB,
-     AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8},
-    {AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S32LSB,
-     AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8},
-    {AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_S32MSB,
-     AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8},
-    {AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S16LSB,
-     AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8},
-    {AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S16MSB,
-     AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8},
-    {AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S16LSB,
-     AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8},
-    {AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_S16MSB,
-     AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8},
-};
-
-SDL_AudioFormat
-SDL_FirstAudioFormat(SDL_AudioFormat format)
-{
-    for (format_idx = 0; format_idx < NUM_FORMATS; ++format_idx) {
-        if (format_list[format_idx][0] == format) {
-            break;
-        }
-    }
-    format_idx_sub = 0;
-    return (SDL_NextAudioFormat());
-}
-
-SDL_AudioFormat
-SDL_NextAudioFormat(void)
-{
-    if ((format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS)) {
-        return (0);
-    }
-    return (format_list[format_idx][format_idx_sub++]);
-}
-
-void
-SDL_CalculateAudioSpec(SDL_AudioSpec * spec)
-{
-    switch (spec->format) {
-    case AUDIO_U8:
-        spec->silence = 0x80;
-        break;
-    default:
-        spec->silence = 0x00;
-        break;
-    }
-    spec->size = SDL_AUDIO_BITSIZE(spec->format) / 8;
-    spec->size *= spec->channels;
-    spec->size *= spec->samples;
-}
-
-
-/*
- * Moved here from SDL_mixer.c, since it relies on internals of an opened
- *  audio device (and is deprecated, by the way!).
- */
-void
-SDL_MixAudio(Uint8 * dst, const Uint8 * src, Uint32 len, int volume)
-{
-    /* Mix the user-level audio format */
-    SDL_AudioDevice *device = get_audio_device(1);
-    if (device != NULL) {
-        SDL_AudioFormat format;
-        if (device->convert.needed) {
-            format = device->convert.src_format;
-        } else {
-            format = device->spec.format;
-        }
-        SDL_MixAudioFormat(dst, src, format, len, volume);
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_audio_c.h b/deps/SDL2/src/audio/SDL_audio_c.h
deleted file mode 100644
index 6abae30..0000000
--- a/deps/SDL2/src/audio/SDL_audio_c.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */
-
-/* Functions to get a list of "close" audio formats */
-extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format);
-extern SDL_AudioFormat SDL_NextAudioFormat(void);
-
-/* Function to calculate the size and silence for a SDL_AudioSpec */
-extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec);
-
-/* The actual mixing thread function */
-extern int SDLCALL SDL_RunAudio(void *audiop);
-
-/* this is used internally to access some autogenerated code. */
-typedef struct
-{
-    SDL_AudioFormat src_fmt;
-    SDL_AudioFormat dst_fmt;
-    SDL_AudioFilter filter;
-} SDL_AudioTypeFilters;
-extern const SDL_AudioTypeFilters sdl_audio_type_filters[];
-
-/* this is used internally to access some autogenerated code. */
-typedef struct
-{
-    SDL_AudioFormat fmt;
-    int channels;
-    int upsample;
-    int multiple;
-    SDL_AudioFilter filter;
-} SDL_AudioRateFilters;
-extern const SDL_AudioRateFilters sdl_audio_rate_filters[];
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_audiocvt.c b/deps/SDL2/src/audio/SDL_audiocvt.c
deleted file mode 100644
index fc23b5d..0000000
--- a/deps/SDL2/src/audio/SDL_audiocvt.c
+++ /dev/null
@@ -1,1081 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Functions for audio drivers to perform runtime conversion of audio format */
-
-#include "SDL_audio.h"
-#include "SDL_audio_c.h"
-
-#include "SDL_assert.h"
-
-/* #define DEBUG_CONVERT */
-
-/* Effectively mix right and left channels into a single channel */
-static void SDLCALL
-SDL_ConvertMono(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    Sint32 sample;
-
-#ifdef DEBUG_CONVERT
-    fprintf(stderr, "Converting to mono\n");
-#endif
-    switch (format & (SDL_AUDIO_MASK_SIGNED | SDL_AUDIO_MASK_BITSIZE)) {
-    case AUDIO_U8:
-        {
-            Uint8 *src, *dst;
-
-            src = cvt->buf;
-            dst = cvt->buf;
-            for (i = cvt->len_cvt / 2; i; --i) {
-                sample = src[0] + src[1];
-                *dst = (Uint8) (sample / 2);
-                src += 2;
-                dst += 1;
-            }
-        }
-        break;
-
-    case AUDIO_S8:
-        {
-            Sint8 *src, *dst;
-
-            src = (Sint8 *) cvt->buf;
-            dst = (Sint8 *) cvt->buf;
-            for (i = cvt->len_cvt / 2; i; --i) {
-                sample = src[0] + src[1];
-                *dst = (Sint8) (sample / 2);
-                src += 2;
-                dst += 1;
-            }
-        }
-        break;
-
-    case AUDIO_U16:
-        {
-            Uint8 *src, *dst;
-
-            src = cvt->buf;
-            dst = cvt->buf;
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    sample = (Uint16) ((src[0] << 8) | src[1]) +
-                        (Uint16) ((src[2] << 8) | src[3]);
-                    sample /= 2;
-                    dst[1] = (sample & 0xFF);
-                    sample >>= 8;
-                    dst[0] = (sample & 0xFF);
-                    src += 4;
-                    dst += 2;
-                }
-            } else {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    sample = (Uint16) ((src[1] << 8) | src[0]) +
-                        (Uint16) ((src[3] << 8) | src[2]);
-                    sample /= 2;
-                    dst[0] = (sample & 0xFF);
-                    sample >>= 8;
-                    dst[1] = (sample & 0xFF);
-                    src += 4;
-                    dst += 2;
-                }
-            }
-        }
-        break;
-
-    case AUDIO_S16:
-        {
-            Uint8 *src, *dst;
-
-            src = cvt->buf;
-            dst = cvt->buf;
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    sample = (Sint16) ((src[0] << 8) | src[1]) +
-                        (Sint16) ((src[2] << 8) | src[3]);
-                    sample /= 2;
-                    dst[1] = (sample & 0xFF);
-                    sample >>= 8;
-                    dst[0] = (sample & 0xFF);
-                    src += 4;
-                    dst += 2;
-                }
-            } else {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    sample = (Sint16) ((src[1] << 8) | src[0]) +
-                        (Sint16) ((src[3] << 8) | src[2]);
-                    sample /= 2;
-                    dst[0] = (sample & 0xFF);
-                    sample >>= 8;
-                    dst[1] = (sample & 0xFF);
-                    src += 4;
-                    dst += 2;
-                }
-            }
-        }
-        break;
-
-    case AUDIO_S32:
-        {
-            const Uint32 *src = (const Uint32 *) cvt->buf;
-            Uint32 *dst = (Uint32 *) cvt->buf;
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 8; i; --i, src += 2) {
-                    const Sint64 added =
-                        (((Sint64) (Sint32) SDL_SwapBE32(src[0])) +
-                         ((Sint64) (Sint32) SDL_SwapBE32(src[1])));
-                    *(dst++) = SDL_SwapBE32((Uint32) ((Sint32) (added / 2)));
-                }
-            } else {
-                for (i = cvt->len_cvt / 8; i; --i, src += 2) {
-                    const Sint64 added =
-                        (((Sint64) (Sint32) SDL_SwapLE32(src[0])) +
-                         ((Sint64) (Sint32) SDL_SwapLE32(src[1])));
-                    *(dst++) = SDL_SwapLE32((Uint32) ((Sint32) (added / 2)));
-                }
-            }
-        }
-        break;
-
-    case AUDIO_F32:
-        {
-            const float *src = (const float *) cvt->buf;
-            float *dst = (float *) cvt->buf;
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 8; i; --i, src += 2) {
-                    const float src1 = SDL_SwapFloatBE(src[0]);
-                    const float src2 = SDL_SwapFloatBE(src[1]);
-                    const double added = ((double) src1) + ((double) src2);
-                    const float halved = (float) (added * 0.5);
-                    *(dst++) = SDL_SwapFloatBE(halved);
-                }
-            } else {
-                for (i = cvt->len_cvt / 8; i; --i, src += 2) {
-                    const float src1 = SDL_SwapFloatLE(src[0]);
-                    const float src2 = SDL_SwapFloatLE(src[1]);
-                    const double added = ((double) src1) + ((double) src2);
-                    const float halved = (float) (added * 0.5);
-                    *(dst++) = SDL_SwapFloatLE(halved);
-                }
-            }
-        }
-        break;
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-
-/* Discard top 4 channels */
-static void SDLCALL
-SDL_ConvertStrip(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-
-#ifdef DEBUG_CONVERT
-    fprintf(stderr, "Converting down from 6 channels to stereo\n");
-#endif
-
-#define strip_chans_6_to_2(type) \
-    { \
-        const type *src = (const type *) cvt->buf; \
-        type *dst = (type *) cvt->buf; \
-        for (i = cvt->len_cvt / (sizeof (type) * 6); i; --i) { \
-            dst[0] = src[0]; \
-            dst[1] = src[1]; \
-            src += 6; \
-            dst += 2; \
-        } \
-    }
-
-    /* this function only cares about typesize, and data as a block of bits. */
-    switch (SDL_AUDIO_BITSIZE(format)) {
-    case 8:
-        strip_chans_6_to_2(Uint8);
-        break;
-    case 16:
-        strip_chans_6_to_2(Uint16);
-        break;
-    case 32:
-        strip_chans_6_to_2(Uint32);
-        break;
-    }
-
-#undef strip_chans_6_to_2
-
-    cvt->len_cvt /= 3;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-
-/* Discard top 2 channels of 6 */
-static void SDLCALL
-SDL_ConvertStrip_2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-
-#ifdef DEBUG_CONVERT
-    fprintf(stderr, "Converting 6 down to quad\n");
-#endif
-
-#define strip_chans_6_to_4(type) \
-    { \
-        const type *src = (const type *) cvt->buf; \
-        type *dst = (type *) cvt->buf; \
-        for (i = cvt->len_cvt / (sizeof (type) * 6); i; --i) { \
-            dst[0] = src[0]; \
-            dst[1] = src[1]; \
-            dst[2] = src[2]; \
-            dst[3] = src[3]; \
-            src += 6; \
-            dst += 4; \
-        } \
-    }
-
-    /* this function only cares about typesize, and data as a block of bits. */
-    switch (SDL_AUDIO_BITSIZE(format)) {
-    case 8:
-        strip_chans_6_to_4(Uint8);
-        break;
-    case 16:
-        strip_chans_6_to_4(Uint16);
-        break;
-    case 32:
-        strip_chans_6_to_4(Uint32);
-        break;
-    }
-
-#undef strip_chans_6_to_4
-
-    cvt->len_cvt /= 6;
-    cvt->len_cvt *= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-/* Duplicate a mono channel to both stereo channels */
-static void SDLCALL
-SDL_ConvertStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-
-#ifdef DEBUG_CONVERT
-    fprintf(stderr, "Converting to stereo\n");
-#endif
-
-#define dup_chans_1_to_2(type) \
-    { \
-        const type *src = (const type *) (cvt->buf + cvt->len_cvt); \
-        type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \
-        for (i = cvt->len_cvt / sizeof(type); i; --i) { \
-            src -= 1; \
-            dst -= 2; \
-            dst[0] = dst[1] = *src; \
-        } \
-    }
-
-    /* this function only cares about typesize, and data as a block of bits. */
-    switch (SDL_AUDIO_BITSIZE(format)) {
-    case 8:
-        dup_chans_1_to_2(Uint8);
-        break;
-    case 16:
-        dup_chans_1_to_2(Uint16);
-        break;
-    case 32:
-        dup_chans_1_to_2(Uint32);
-        break;
-    }
-
-#undef dup_chans_1_to_2
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-
-/* Duplicate a stereo channel to a pseudo-5.1 stream */
-static void SDLCALL
-SDL_ConvertSurround(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-
-#ifdef DEBUG_CONVERT
-    fprintf(stderr, "Converting stereo to surround\n");
-#endif
-
-    switch (format & (SDL_AUDIO_MASK_SIGNED | SDL_AUDIO_MASK_BITSIZE)) {
-    case AUDIO_U8:
-        {
-            Uint8 *src, *dst, lf, rf, ce;
-
-            src = (Uint8 *) (cvt->buf + cvt->len_cvt);
-            dst = (Uint8 *) (cvt->buf + cvt->len_cvt * 3);
-            for (i = cvt->len_cvt; i; --i) {
-                dst -= 6;
-                src -= 2;
-                lf = src[0];
-                rf = src[1];
-                ce = (lf / 2) + (rf / 2);
-                dst[0] = lf;
-                dst[1] = rf;
-                dst[2] = lf - ce;
-                dst[3] = rf - ce;
-                dst[4] = ce;
-                dst[5] = ce;
-            }
-        }
-        break;
-
-    case AUDIO_S8:
-        {
-            Sint8 *src, *dst, lf, rf, ce;
-
-            src = (Sint8 *) cvt->buf + cvt->len_cvt;
-            dst = (Sint8 *) cvt->buf + cvt->len_cvt * 3;
-            for (i = cvt->len_cvt; i; --i) {
-                dst -= 6;
-                src -= 2;
-                lf = src[0];
-                rf = src[1];
-                ce = (lf / 2) + (rf / 2);
-                dst[0] = lf;
-                dst[1] = rf;
-                dst[2] = lf - ce;
-                dst[3] = rf - ce;
-                dst[4] = ce;
-                dst[5] = ce;
-            }
-        }
-        break;
-
-    case AUDIO_U16:
-        {
-            Uint8 *src, *dst;
-            Uint16 lf, rf, ce, lr, rr;
-
-            src = cvt->buf + cvt->len_cvt;
-            dst = cvt->buf + cvt->len_cvt * 3;
-
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    dst -= 12;
-                    src -= 4;
-                    lf = (Uint16) ((src[0] << 8) | src[1]);
-                    rf = (Uint16) ((src[2] << 8) | src[3]);
-                    ce = (lf / 2) + (rf / 2);
-                    rr = lf - ce;
-                    lr = rf - ce;
-                    dst[1] = (lf & 0xFF);
-                    dst[0] = ((lf >> 8) & 0xFF);
-                    dst[3] = (rf & 0xFF);
-                    dst[2] = ((rf >> 8) & 0xFF);
-
-                    dst[1 + 4] = (lr & 0xFF);
-                    dst[0 + 4] = ((lr >> 8) & 0xFF);
-                    dst[3 + 4] = (rr & 0xFF);
-                    dst[2 + 4] = ((rr >> 8) & 0xFF);
-
-                    dst[1 + 8] = (ce & 0xFF);
-                    dst[0 + 8] = ((ce >> 8) & 0xFF);
-                    dst[3 + 8] = (ce & 0xFF);
-                    dst[2 + 8] = ((ce >> 8) & 0xFF);
-                }
-            } else {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    dst -= 12;
-                    src -= 4;
-                    lf = (Uint16) ((src[1] << 8) | src[0]);
-                    rf = (Uint16) ((src[3] << 8) | src[2]);
-                    ce = (lf / 2) + (rf / 2);
-                    rr = lf - ce;
-                    lr = rf - ce;
-                    dst[0] = (lf & 0xFF);
-                    dst[1] = ((lf >> 8) & 0xFF);
-                    dst[2] = (rf & 0xFF);
-                    dst[3] = ((rf >> 8) & 0xFF);
-
-                    dst[0 + 4] = (lr & 0xFF);
-                    dst[1 + 4] = ((lr >> 8) & 0xFF);
-                    dst[2 + 4] = (rr & 0xFF);
-                    dst[3 + 4] = ((rr >> 8) & 0xFF);
-
-                    dst[0 + 8] = (ce & 0xFF);
-                    dst[1 + 8] = ((ce >> 8) & 0xFF);
-                    dst[2 + 8] = (ce & 0xFF);
-                    dst[3 + 8] = ((ce >> 8) & 0xFF);
-                }
-            }
-        }
-        break;
-
-    case AUDIO_S16:
-        {
-            Uint8 *src, *dst;
-            Sint16 lf, rf, ce, lr, rr;
-
-            src = cvt->buf + cvt->len_cvt;
-            dst = cvt->buf + cvt->len_cvt * 3;
-
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    dst -= 12;
-                    src -= 4;
-                    lf = (Sint16) ((src[0] << 8) | src[1]);
-                    rf = (Sint16) ((src[2] << 8) | src[3]);
-                    ce = (lf / 2) + (rf / 2);
-                    rr = lf - ce;
-                    lr = rf - ce;
-                    dst[1] = (lf & 0xFF);
-                    dst[0] = ((lf >> 8) & 0xFF);
-                    dst[3] = (rf & 0xFF);
-                    dst[2] = ((rf >> 8) & 0xFF);
-
-                    dst[1 + 4] = (lr & 0xFF);
-                    dst[0 + 4] = ((lr >> 8) & 0xFF);
-                    dst[3 + 4] = (rr & 0xFF);
-                    dst[2 + 4] = ((rr >> 8) & 0xFF);
-
-                    dst[1 + 8] = (ce & 0xFF);
-                    dst[0 + 8] = ((ce >> 8) & 0xFF);
-                    dst[3 + 8] = (ce & 0xFF);
-                    dst[2 + 8] = ((ce >> 8) & 0xFF);
-                }
-            } else {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    dst -= 12;
-                    src -= 4;
-                    lf = (Sint16) ((src[1] << 8) | src[0]);
-                    rf = (Sint16) ((src[3] << 8) | src[2]);
-                    ce = (lf / 2) + (rf / 2);
-                    rr = lf - ce;
-                    lr = rf - ce;
-                    dst[0] = (lf & 0xFF);
-                    dst[1] = ((lf >> 8) & 0xFF);
-                    dst[2] = (rf & 0xFF);
-                    dst[3] = ((rf >> 8) & 0xFF);
-
-                    dst[0 + 4] = (lr & 0xFF);
-                    dst[1 + 4] = ((lr >> 8) & 0xFF);
-                    dst[2 + 4] = (rr & 0xFF);
-                    dst[3 + 4] = ((rr >> 8) & 0xFF);
-
-                    dst[0 + 8] = (ce & 0xFF);
-                    dst[1 + 8] = ((ce >> 8) & 0xFF);
-                    dst[2 + 8] = (ce & 0xFF);
-                    dst[3 + 8] = ((ce >> 8) & 0xFF);
-                }
-            }
-        }
-        break;
-
-    case AUDIO_S32:
-        {
-            Sint32 lf, rf, ce;
-            const Uint32 *src = (const Uint32 *) cvt->buf + cvt->len_cvt;
-            Uint32 *dst = (Uint32 *) cvt->buf + cvt->len_cvt * 3;
-
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 8; i; --i) {
-                    dst -= 6;
-                    src -= 2;
-                    lf = (Sint32) SDL_SwapBE32(src[0]);
-                    rf = (Sint32) SDL_SwapBE32(src[1]);
-                    ce = (lf / 2) + (rf / 2);
-                    dst[0] = SDL_SwapBE32((Uint32) lf);
-                    dst[1] = SDL_SwapBE32((Uint32) rf);
-                    dst[2] = SDL_SwapBE32((Uint32) (lf - ce));
-                    dst[3] = SDL_SwapBE32((Uint32) (rf - ce));
-                    dst[4] = SDL_SwapBE32((Uint32) ce);
-                    dst[5] = SDL_SwapBE32((Uint32) ce);
-                }
-            } else {
-                for (i = cvt->len_cvt / 8; i; --i) {
-                    dst -= 6;
-                    src -= 2;
-                    lf = (Sint32) SDL_SwapLE32(src[0]);
-                    rf = (Sint32) SDL_SwapLE32(src[1]);
-                    ce = (lf / 2) + (rf / 2);
-                    dst[0] = src[0];
-                    dst[1] = src[1];
-                    dst[2] = SDL_SwapLE32((Uint32) (lf - ce));
-                    dst[3] = SDL_SwapLE32((Uint32) (rf - ce));
-                    dst[4] = SDL_SwapLE32((Uint32) ce);
-                    dst[5] = SDL_SwapLE32((Uint32) ce);
-                }
-            }
-        }
-        break;
-
-    case AUDIO_F32:
-        {
-            float lf, rf, ce;
-            const float *src = (const float *) cvt->buf + cvt->len_cvt;
-            float *dst = (float *) cvt->buf + cvt->len_cvt * 3;
-
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 8; i; --i) {
-                    dst -= 6;
-                    src -= 2;
-                    lf = SDL_SwapFloatBE(src[0]);
-                    rf = SDL_SwapFloatBE(src[1]);
-                    ce = (lf * 0.5f) + (rf * 0.5f);
-                    dst[0] = src[0];
-                    dst[1] = src[1];
-                    dst[2] = SDL_SwapFloatBE(lf - ce);
-                    dst[3] = SDL_SwapFloatBE(rf - ce);
-                    dst[4] = dst[5] = SDL_SwapFloatBE(ce);
-                }
-            } else {
-                for (i = cvt->len_cvt / 8; i; --i) {
-                    dst -= 6;
-                    src -= 2;
-                    lf = SDL_SwapFloatLE(src[0]);
-                    rf = SDL_SwapFloatLE(src[1]);
-                    ce = (lf * 0.5f) + (rf * 0.5f);
-                    dst[0] = src[0];
-                    dst[1] = src[1];
-                    dst[2] = SDL_SwapFloatLE(lf - ce);
-                    dst[3] = SDL_SwapFloatLE(rf - ce);
-                    dst[4] = dst[5] = SDL_SwapFloatLE(ce);
-                }
-            }
-        }
-        break;
-
-    }
-    cvt->len_cvt *= 3;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-
-/* Duplicate a stereo channel to a pseudo-4.0 stream */
-static void SDLCALL
-SDL_ConvertSurround_4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-
-#ifdef DEBUG_CONVERT
-    fprintf(stderr, "Converting stereo to quad\n");
-#endif
-
-    switch (format & (SDL_AUDIO_MASK_SIGNED | SDL_AUDIO_MASK_BITSIZE)) {
-    case AUDIO_U8:
-        {
-            Uint8 *src, *dst, lf, rf, ce;
-
-            src = (Uint8 *) (cvt->buf + cvt->len_cvt);
-            dst = (Uint8 *) (cvt->buf + cvt->len_cvt * 2);
-            for (i = cvt->len_cvt; i; --i) {
-                dst -= 4;
-                src -= 2;
-                lf = src[0];
-                rf = src[1];
-                ce = (lf / 2) + (rf / 2);
-                dst[0] = lf;
-                dst[1] = rf;
-                dst[2] = lf - ce;
-                dst[3] = rf - ce;
-            }
-        }
-        break;
-
-    case AUDIO_S8:
-        {
-            Sint8 *src, *dst, lf, rf, ce;
-
-            src = (Sint8 *) cvt->buf + cvt->len_cvt;
-            dst = (Sint8 *) cvt->buf + cvt->len_cvt * 2;
-            for (i = cvt->len_cvt; i; --i) {
-                dst -= 4;
-                src -= 2;
-                lf = src[0];
-                rf = src[1];
-                ce = (lf / 2) + (rf / 2);
-                dst[0] = lf;
-                dst[1] = rf;
-                dst[2] = lf - ce;
-                dst[3] = rf - ce;
-            }
-        }
-        break;
-
-    case AUDIO_U16:
-        {
-            Uint8 *src, *dst;
-            Uint16 lf, rf, ce, lr, rr;
-
-            src = cvt->buf + cvt->len_cvt;
-            dst = cvt->buf + cvt->len_cvt * 2;
-
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    dst -= 8;
-                    src -= 4;
-                    lf = (Uint16) ((src[0] << 8) | src[1]);
-                    rf = (Uint16) ((src[2] << 8) | src[3]);
-                    ce = (lf / 2) + (rf / 2);
-                    rr = lf - ce;
-                    lr = rf - ce;
-                    dst[1] = (lf & 0xFF);
-                    dst[0] = ((lf >> 8) & 0xFF);
-                    dst[3] = (rf & 0xFF);
-                    dst[2] = ((rf >> 8) & 0xFF);
-
-                    dst[1 + 4] = (lr & 0xFF);
-                    dst[0 + 4] = ((lr >> 8) & 0xFF);
-                    dst[3 + 4] = (rr & 0xFF);
-                    dst[2 + 4] = ((rr >> 8) & 0xFF);
-                }
-            } else {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    dst -= 8;
-                    src -= 4;
-                    lf = (Uint16) ((src[1] << 8) | src[0]);
-                    rf = (Uint16) ((src[3] << 8) | src[2]);
-                    ce = (lf / 2) + (rf / 2);
-                    rr = lf - ce;
-                    lr = rf - ce;
-                    dst[0] = (lf & 0xFF);
-                    dst[1] = ((lf >> 8) & 0xFF);
-                    dst[2] = (rf & 0xFF);
-                    dst[3] = ((rf >> 8) & 0xFF);
-
-                    dst[0 + 4] = (lr & 0xFF);
-                    dst[1 + 4] = ((lr >> 8) & 0xFF);
-                    dst[2 + 4] = (rr & 0xFF);
-                    dst[3 + 4] = ((rr >> 8) & 0xFF);
-                }
-            }
-        }
-        break;
-
-    case AUDIO_S16:
-        {
-            Uint8 *src, *dst;
-            Sint16 lf, rf, ce, lr, rr;
-
-            src = cvt->buf + cvt->len_cvt;
-            dst = cvt->buf + cvt->len_cvt * 2;
-
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    dst -= 8;
-                    src -= 4;
-                    lf = (Sint16) ((src[0] << 8) | src[1]);
-                    rf = (Sint16) ((src[2] << 8) | src[3]);
-                    ce = (lf / 2) + (rf / 2);
-                    rr = lf - ce;
-                    lr = rf - ce;
-                    dst[1] = (lf & 0xFF);
-                    dst[0] = ((lf >> 8) & 0xFF);
-                    dst[3] = (rf & 0xFF);
-                    dst[2] = ((rf >> 8) & 0xFF);
-
-                    dst[1 + 4] = (lr & 0xFF);
-                    dst[0 + 4] = ((lr >> 8) & 0xFF);
-                    dst[3 + 4] = (rr & 0xFF);
-                    dst[2 + 4] = ((rr >> 8) & 0xFF);
-                }
-            } else {
-                for (i = cvt->len_cvt / 4; i; --i) {
-                    dst -= 8;
-                    src -= 4;
-                    lf = (Sint16) ((src[1] << 8) | src[0]);
-                    rf = (Sint16) ((src[3] << 8) | src[2]);
-                    ce = (lf / 2) + (rf / 2);
-                    rr = lf - ce;
-                    lr = rf - ce;
-                    dst[0] = (lf & 0xFF);
-                    dst[1] = ((lf >> 8) & 0xFF);
-                    dst[2] = (rf & 0xFF);
-                    dst[3] = ((rf >> 8) & 0xFF);
-
-                    dst[0 + 4] = (lr & 0xFF);
-                    dst[1 + 4] = ((lr >> 8) & 0xFF);
-                    dst[2 + 4] = (rr & 0xFF);
-                    dst[3 + 4] = ((rr >> 8) & 0xFF);
-                }
-            }
-        }
-        break;
-
-    case AUDIO_S32:
-        {
-            const Uint32 *src = (const Uint32 *) (cvt->buf + cvt->len_cvt);
-            Uint32 *dst = (Uint32 *) (cvt->buf + cvt->len_cvt * 2);
-            Sint32 lf, rf, ce;
-
-            if (SDL_AUDIO_ISBIGENDIAN(format)) {
-                for (i = cvt->len_cvt / 8; i; --i) {
-                    dst -= 4;
-                    src -= 2;
-                    lf = (Sint32) SDL_SwapBE32(src[0]);
-                    rf = (Sint32) SDL_SwapBE32(src[1]);
-                    ce = (lf / 2) + (rf / 2);
-                    dst[0] = src[0];
-                    dst[1] = src[1];
-                    dst[2] = SDL_SwapBE32((Uint32) (lf - ce));
-                    dst[3] = SDL_SwapBE32((Uint32) (rf - ce));
-                }
-            } else {
-                for (i = cvt->len_cvt / 8; i; --i) {
-                    dst -= 4;
-                    src -= 2;
-                    lf = (Sint32) SDL_SwapLE32(src[0]);
-                    rf = (Sint32) SDL_SwapLE32(src[1]);
-                    ce = (lf / 2) + (rf / 2);
-                    dst[0] = src[0];
-                    dst[1] = src[1];
-                    dst[2] = SDL_SwapLE32((Uint32) (lf - ce));
-                    dst[3] = SDL_SwapLE32((Uint32) (rf - ce));
-                }
-            }
-        }
-        break;
-    }
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-
-int
-SDL_ConvertAudio(SDL_AudioCVT * cvt)
-{
-    /* !!! FIXME: (cvt) should be const; stack-copy it here. */
-    /* !!! FIXME: (actually, we can't...len_cvt needs to be updated. Grr.) */
-
-    /* Make sure there's data to convert */
-    if (cvt->buf == NULL) {
-        SDL_SetError("No buffer allocated for conversion");
-        return (-1);
-    }
-    /* Return okay if no conversion is necessary */
-    cvt->len_cvt = cvt->len;
-    if (cvt->filters[0] == NULL) {
-        return (0);
-    }
-
-    /* Set up the conversion and go! */
-    cvt->filter_index = 0;
-    cvt->filters[0] (cvt, cvt->src_format);
-    return (0);
-}
-
-
-static SDL_AudioFilter
-SDL_HandTunedTypeCVT(SDL_AudioFormat src_fmt, SDL_AudioFormat dst_fmt)
-{
-    /*
-     * Fill in any future conversions that are specialized to a
-     *  processor, platform, compiler, or library here.
-     */
-
-    return NULL;                /* no specialized converter code available. */
-}
-
-
-/*
- * Find a converter between two data types. We try to select a hand-tuned
- *  asm/vectorized/optimized function first, and then fallback to an
- *  autogenerated function that is customized to convert between two
- *  specific data types.
- */
-static int
-SDL_BuildAudioTypeCVT(SDL_AudioCVT * cvt,
-                      SDL_AudioFormat src_fmt, SDL_AudioFormat dst_fmt)
-{
-    if (src_fmt != dst_fmt) {
-        const Uint16 src_bitsize = SDL_AUDIO_BITSIZE(src_fmt);
-        const Uint16 dst_bitsize = SDL_AUDIO_BITSIZE(dst_fmt);
-        SDL_AudioFilter filter = SDL_HandTunedTypeCVT(src_fmt, dst_fmt);
-
-        /* No hand-tuned converter? Try the autogenerated ones. */
-        if (filter == NULL) {
-            int i;
-            for (i = 0; sdl_audio_type_filters[i].filter != NULL; i++) {
-                const SDL_AudioTypeFilters *filt = &sdl_audio_type_filters[i];
-                if ((filt->src_fmt == src_fmt) && (filt->dst_fmt == dst_fmt)) {
-                    filter = filt->filter;
-                    break;
-                }
-            }
-
-            if (filter == NULL) {
-                SDL_SetError("No conversion available for these formats");
-                return -1;
-            }
-        }
-
-        /* Update (cvt) with filter details... */
-        cvt->filters[cvt->filter_index++] = filter;
-        if (src_bitsize < dst_bitsize) {
-            const int mult = (dst_bitsize / src_bitsize);
-            cvt->len_mult *= mult;
-            cvt->len_ratio *= mult;
-        } else if (src_bitsize > dst_bitsize) {
-            cvt->len_ratio /= (src_bitsize / dst_bitsize);
-        }
-
-        return 1;               /* added a converter. */
-    }
-
-    return 0;                   /* no conversion necessary. */
-}
-
-
-static SDL_AudioFilter
-SDL_HandTunedResampleCVT(SDL_AudioCVT * cvt, int dst_channels,
-                         int src_rate, int dst_rate)
-{
-    /*
-     * Fill in any future conversions that are specialized to a
-     *  processor, platform, compiler, or library here.
-     */
-
-    return NULL;                /* no specialized converter code available. */
-}
-
-static int
-SDL_FindFrequencyMultiple(const int src_rate, const int dst_rate)
-{
-    int retval = 0;
-
-    /* If we only built with the arbitrary resamplers, ignore multiples. */
-#if !LESS_RESAMPLERS
-    int lo, hi;
-    int div;
-
-    SDL_assert(src_rate != 0);
-    SDL_assert(dst_rate != 0);
-    SDL_assert(src_rate != dst_rate);
-
-    if (src_rate < dst_rate) {
-        lo = src_rate;
-        hi = dst_rate;
-    } else {
-        lo = dst_rate;
-        hi = src_rate;
-    }
-
-    /* zero means "not a supported multiple" ... we only do 2x and 4x. */
-    if ((hi % lo) != 0)
-        return 0;               /* not a multiple. */
-
-    div = hi / lo;
-    retval = ((div == 2) || (div == 4)) ? div : 0;
-#endif
-
-    return retval;
-}
-
-static int
-SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, int dst_channels,
-                          int src_rate, int dst_rate)
-{
-    if (src_rate != dst_rate) {
-        SDL_AudioFilter filter = SDL_HandTunedResampleCVT(cvt, dst_channels,
-                                                          src_rate, dst_rate);
-
-        /* No hand-tuned converter? Try the autogenerated ones. */
-        if (filter == NULL) {
-            int i;
-            const int upsample = (src_rate < dst_rate) ? 1 : 0;
-            const int multiple =
-                SDL_FindFrequencyMultiple(src_rate, dst_rate);
-
-            for (i = 0; sdl_audio_rate_filters[i].filter != NULL; i++) {
-                const SDL_AudioRateFilters *filt = &sdl_audio_rate_filters[i];
-                if ((filt->fmt == cvt->dst_format) &&
-                    (filt->channels == dst_channels) &&
-                    (filt->upsample == upsample) &&
-                    (filt->multiple == multiple)) {
-                    filter = filt->filter;
-                    break;
-                }
-            }
-
-            if (filter == NULL) {
-                SDL_SetError("No conversion available for these rates");
-                return -1;
-            }
-        }
-
-        /* Update (cvt) with filter details... */
-        cvt->filters[cvt->filter_index++] = filter;
-        if (src_rate < dst_rate) {
-            const double mult = ((double) dst_rate) / ((double) src_rate);
-            cvt->len_mult *= (int) SDL_ceil(mult);
-            cvt->len_ratio *= mult;
-        } else {
-            cvt->len_ratio /= ((double) src_rate) / ((double) dst_rate);
-        }
-
-        return 1;               /* added a converter. */
-    }
-
-    return 0;                   /* no conversion necessary. */
-}
-
-
-/* Creates a set of audio filters to convert from one format to another.
-   Returns -1 if the format conversion is not supported, 0 if there's
-   no conversion needed, or 1 if the audio filter is set up.
-*/
-
-int
-SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
-                  SDL_AudioFormat src_fmt, Uint8 src_channels, int src_rate,
-                  SDL_AudioFormat dst_fmt, Uint8 dst_channels, int dst_rate)
-{
-    /*
-     * !!! FIXME: reorder filters based on which grow/shrink the buffer.
-     * !!! FIXME: ideally, we should do everything that shrinks the buffer
-     * !!! FIXME: first, so we don't have to process as many bytes in a given
-     * !!! FIXME: filter and abuse the CPU cache less. This might not be as
-     * !!! FIXME: good in practice as it sounds in theory, though.
-     */
-
-    /* Sanity check target pointer */
-    if (cvt == NULL) {
-        return SDL_InvalidParamError("cvt");
-    }
-
-    /* there are no unsigned types over 16 bits, so catch this up front. */
-    if ((SDL_AUDIO_BITSIZE(src_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(src_fmt))) {
-        return SDL_SetError("Invalid source format");
-    }
-    if ((SDL_AUDIO_BITSIZE(dst_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(dst_fmt))) {
-        return SDL_SetError("Invalid destination format");
-    }
-
-    /* prevent possible divisions by zero, etc. */
-    if ((src_channels == 0) || (dst_channels == 0)) {
-        return SDL_SetError("Source or destination channels is zero");
-    }
-    if ((src_rate == 0) || (dst_rate == 0)) {
-        return SDL_SetError("Source or destination rate is zero");
-    }
-#ifdef DEBUG_CONVERT
-    printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n",
-           src_fmt, dst_fmt, src_channels, dst_channels, src_rate, dst_rate);
-#endif
-
-    /* Start off with no conversion necessary */
-    SDL_zerop(cvt);
-    cvt->src_format = src_fmt;
-    cvt->dst_format = dst_fmt;
-    cvt->needed = 0;
-    cvt->filter_index = 0;
-    cvt->filters[0] = NULL;
-    cvt->len_mult = 1;
-    cvt->len_ratio = 1.0;
-    cvt->rate_incr = ((double) dst_rate) / ((double) src_rate);
-
-    /* Convert data types, if necessary. Updates (cvt). */
-    if (SDL_BuildAudioTypeCVT(cvt, src_fmt, dst_fmt) == -1) {
-        return -1;              /* shouldn't happen, but just in case... */
-    }
-
-    /* Channel conversion */
-    if (src_channels != dst_channels) {
-        if ((src_channels == 1) && (dst_channels > 1)) {
-            cvt->filters[cvt->filter_index++] = SDL_ConvertStereo;
-            cvt->len_mult *= 2;
-            src_channels = 2;
-            cvt->len_ratio *= 2;
-        }
-        if ((src_channels == 2) && (dst_channels == 6)) {
-            cvt->filters[cvt->filter_index++] = SDL_ConvertSurround;
-            src_channels = 6;
-            cvt->len_mult *= 3;
-            cvt->len_ratio *= 3;
-        }
-        if ((src_channels == 2) && (dst_channels == 4)) {
-            cvt->filters[cvt->filter_index++] = SDL_ConvertSurround_4;
-            src_channels = 4;
-            cvt->len_mult *= 2;
-            cvt->len_ratio *= 2;
-        }
-        while ((src_channels * 2) <= dst_channels) {
-            cvt->filters[cvt->filter_index++] = SDL_ConvertStereo;
-            cvt->len_mult *= 2;
-            src_channels *= 2;
-            cvt->len_ratio *= 2;
-        }
-        if ((src_channels == 6) && (dst_channels <= 2)) {
-            cvt->filters[cvt->filter_index++] = SDL_ConvertStrip;
-            src_channels = 2;
-            cvt->len_ratio /= 3;
-        }
-        if ((src_channels == 6) && (dst_channels == 4)) {
-            cvt->filters[cvt->filter_index++] = SDL_ConvertStrip_2;
-            src_channels = 4;
-            cvt->len_ratio /= 2;
-        }
-        /* This assumes that 4 channel audio is in the format:
-           Left {front/back} + Right {front/back}
-           so converting to L/R stereo works properly.
-         */
-        while (((src_channels % 2) == 0) &&
-               ((src_channels / 2) >= dst_channels)) {
-            cvt->filters[cvt->filter_index++] = SDL_ConvertMono;
-            src_channels /= 2;
-            cvt->len_ratio /= 2;
-        }
-        if (src_channels != dst_channels) {
-            /* Uh oh.. */ ;
-        }
-    }
-
-    /* Do rate conversion, if necessary. Updates (cvt). */
-    if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) ==
-        -1) {
-        return -1;              /* shouldn't happen, but just in case... */
-    }
-
-    /* Set up the filter information */
-    if (cvt->filter_index != 0) {
-        cvt->needed = 1;
-        cvt->src_format = src_fmt;
-        cvt->dst_format = dst_fmt;
-        cvt->len = 0;
-        cvt->buf = NULL;
-        cvt->filters[cvt->filter_index] = NULL;
-    }
-    return (cvt->needed);
-}
-
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_audiodev.c b/deps/SDL2/src/audio/SDL_audiodev.c
deleted file mode 100644
index af45a8b..0000000
--- a/deps/SDL2/src/audio/SDL_audiodev.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Get the name of the audio device we use for output */
-
-#if SDL_AUDIO_DRIVER_BSD || SDL_AUDIO_DRIVER_OSS || SDL_AUDIO_DRIVER_SUNAUDIO
-
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h> /* For close() */
-
-#include "SDL_stdinc.h"
-#include "SDL_audiodev_c.h"
-
-#ifndef _PATH_DEV_DSP
-#if defined(__NETBSD__) || defined(__OPENBSD__)
-#define _PATH_DEV_DSP  "/dev/audio"
-#else
-#define _PATH_DEV_DSP  "/dev/dsp"
-#endif
-#endif
-#ifndef _PATH_DEV_DSP24
-#define _PATH_DEV_DSP24 "/dev/sound/dsp"
-#endif
-#ifndef _PATH_DEV_AUDIO
-#define _PATH_DEV_AUDIO "/dev/audio"
-#endif
-
-static SDL_INLINE void
-test_device(const char *fname, int flags, int (*test) (int fd),
-            SDL_AddAudioDevice addfn)
-{
-    struct stat sb;
-    if ((stat(fname, &sb) == 0) && (S_ISCHR(sb.st_mode))) {
-        const int audio_fd = open(fname, flags, 0);
-        if (audio_fd >= 0) {
-            if (test(audio_fd)) {
-                addfn(fname);
-            }
-            close(audio_fd);
-        }
-    }
-}
-
-static int
-test_stub(int fd)
-{
-    return 1;
-}
-
-void
-SDL_EnumUnixAudioDevices(int iscapture, int classic, int (*test)(int fd),
-                         SDL_AddAudioDevice addfn)
-{
-    const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT);
-    const char *audiodev;
-    char audiopath[1024];
-
-    if (test == NULL)
-        test = test_stub;
-
-    /* Figure out what our audio device is */
-    if (((audiodev = SDL_getenv("SDL_PATH_DSP")) == NULL) &&
-        ((audiodev = SDL_getenv("AUDIODEV")) == NULL)) {
-        if (classic) {
-            audiodev = _PATH_DEV_AUDIO;
-        } else {
-            struct stat sb;
-
-            /* Added support for /dev/sound/\* in Linux 2.4 */
-            if (((stat("/dev/sound", &sb) == 0) && S_ISDIR(sb.st_mode))
-                && ((stat(_PATH_DEV_DSP24, &sb) == 0)
-                    && S_ISCHR(sb.st_mode))) {
-                audiodev = _PATH_DEV_DSP24;
-            } else {
-                audiodev = _PATH_DEV_DSP;
-            }
-        }
-    }
-    test_device(audiodev, flags, test, addfn);
-
-    if (SDL_strlen(audiodev) < (sizeof(audiopath) - 3)) {
-        int instance = 0;
-        while (instance++ <= 64) {
-            SDL_snprintf(audiopath, SDL_arraysize(audiopath),
-                         "%s%d", audiodev, instance);
-            test_device(audiopath, flags, test, addfn);
-        }
-    }
-}
-
-#endif /* Audio driver selection */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_audiodev_c.h b/deps/SDL2/src/audio/SDL_audiodev_c.h
deleted file mode 100644
index d439926..0000000
--- a/deps/SDL2/src/audio/SDL_audiodev_c.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL.h"
-#include "SDL_config.h"
-#include "SDL_sysaudio.h"
-
-/* Open the audio device for playback, and don't block if busy */
-/* #define USE_BLOCKING_WRITES */
-
-#ifdef USE_BLOCKING_WRITES
-#define OPEN_FLAGS_OUTPUT O_WRONLY
-#define OPEN_FLAGS_INPUT O_RDONLY
-#else
-#define OPEN_FLAGS_OUTPUT (O_WRONLY|O_NONBLOCK)
-#define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK)
-#endif
-
-void SDL_EnumUnixAudioDevices(int iscapture, int classic,
-                              int (*test) (int fd), SDL_AddAudioDevice addfn);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_audiomem.h b/deps/SDL2/src/audio/SDL_audiomem.h
deleted file mode 100644
index 8c027c3..0000000
--- a/deps/SDL2/src/audio/SDL_audiomem.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#define SDL_AllocAudioMem   SDL_malloc
-#define SDL_FreeAudioMem    SDL_free
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_audiotypecvt.c b/deps/SDL2/src/audio/SDL_audiotypecvt.c
deleted file mode 100644
index 6245c53..0000000
--- a/deps/SDL2/src/audio/SDL_audiotypecvt.c
+++ /dev/null
@@ -1,16015 +0,0 @@
-/* DO NOT EDIT!  This file is generated by sdlgenaudiocvt.pl */
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-#include "SDL_audio.h"
-#include "SDL_audio_c.h"
-
-#ifndef DEBUG_CONVERT
-#define DEBUG_CONVERT 0
-#endif
-
-
-/* If you can guarantee your data and need space, you can eliminate code... */
-
-/* Just build the arbitrary resamplers if you're saving code space. */
-#ifndef LESS_RESAMPLERS
-#define LESS_RESAMPLERS 0
-#endif
-
-/* Don't build any resamplers if you're REALLY saving code space. */
-#ifndef NO_RESAMPLERS
-#define NO_RESAMPLERS 0
-#endif
-
-/* Don't build any type converters if you're saving code space. */
-#ifndef NO_CONVERTERS
-#define NO_CONVERTERS 0
-#endif
-
-
-/* *INDENT-OFF* */
-
-#define DIVBY127 0.0078740157480315f
-#define DIVBY32767 3.05185094759972e-05f
-#define DIVBY2147483647 4.6566128752458e-10f
-
-#if !NO_CONVERTERS
-
-static void SDLCALL
-SDL_Convert_U8_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Sint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S8.\n");
-#endif
-
-    src = (const Uint8 *) cvt->buf;
-    dst = (Sint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
-        const Sint8 val = ((*src) ^ 0x80);
-        *dst = ((Sint8) val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16LSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Uint16 val = (((Uint16) *src) << 8);
-        *dst = SDL_SwapLE16(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16LSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
-        *dst = ((Sint16) SDL_SwapLE16(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16MSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Uint16 val = (((Uint16) *src) << 8);
-        *dst = SDL_SwapBE16(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16MSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
-        *dst = ((Sint16) SDL_SwapBE16(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32LSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
-        *dst = ((Sint32) SDL_SwapLE32(val));
-    }
-
-    cvt->len_cvt *= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32MSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
-        *dst = ((Sint32) SDL_SwapBE32(val));
-    }
-
-    cvt->len_cvt *= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32LSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const float val = ((((float) *src) * DIVBY127) - 1.0f);
-        *dst = SDL_SwapFloatLE(val);
-    }
-
-    cvt->len_cvt *= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32MSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const float val = ((((float) *src) * DIVBY127) - 1.0f);
-        *dst = SDL_SwapFloatBE(val);
-    }
-
-    cvt->len_cvt *= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Uint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U8.\n");
-#endif
-
-    src = (const Uint8 *) cvt->buf;
-    dst = (Uint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
-        const Uint8 val = ((((Sint8) *src)) ^ 0x80);
-        *dst = val;
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16LSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
-        *dst = SDL_SwapLE16(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16LSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
-        *dst = ((Sint16) SDL_SwapLE16(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16MSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
-        *dst = SDL_SwapBE16(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16MSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
-        *dst = ((Sint16) SDL_SwapBE16(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32LSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
-        *dst = ((Sint32) SDL_SwapLE32(val));
-    }
-
-    cvt->len_cvt *= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32MSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
-        *dst = ((Sint32) SDL_SwapBE32(val));
-    }
-
-    cvt->len_cvt *= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32LSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const float val = (((float) ((Sint8) *src)) * DIVBY127);
-        *dst = SDL_SwapFloatLE(val);
-    }
-
-    cvt->len_cvt *= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint8 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32MSB.\n");
-#endif
-
-    src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
-        const float val = (((float) ((Sint8) *src)) * DIVBY127);
-        *dst = SDL_SwapFloatBE(val);
-    }
-
-    cvt->len_cvt *= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U8.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint8 val = ((Uint8) (SDL_SwapLE16(*src) >> 8));
-        *dst = val;
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S8.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint8 val = ((Sint8) (((SDL_SwapLE16(*src)) ^ 0x8000) >> 8));
-        *dst = ((Sint8) val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16LSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
-        *dst = ((Sint16) SDL_SwapLE16(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U16MSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint16 val = SDL_SwapLE16(*src);
-        *dst = SDL_SwapBE16(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16MSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
-        *dst = ((Sint16) SDL_SwapBE16(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32LSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
-        *dst = ((Sint32) SDL_SwapLE32(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32MSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
-        *dst = ((Sint32) SDL_SwapBE32(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32LSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f);
-        *dst = SDL_SwapFloatLE(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32MSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f);
-        *dst = SDL_SwapFloatBE(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U8.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000) >> 8));
-        *dst = val;
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S8.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint8 val = ((Sint8) (((Sint16) SDL_SwapLE16(*src)) >> 8));
-        *dst = ((Sint8) val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16LSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
-        *dst = SDL_SwapLE16(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16MSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
-        *dst = SDL_SwapBE16(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S16MSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) SDL_SwapLE16(*src));
-        *dst = ((Sint16) SDL_SwapBE16(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32LSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
-        *dst = ((Sint32) SDL_SwapLE32(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32MSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
-        *dst = ((Sint32) SDL_SwapBE32(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32LSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
-        *dst = SDL_SwapFloatLE(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32MSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
-        *dst = SDL_SwapFloatBE(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U8.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint8 val = ((Uint8) (SDL_SwapBE16(*src) >> 8));
-        *dst = val;
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S8.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint8 val = ((Sint8) (((SDL_SwapBE16(*src)) ^ 0x8000) >> 8));
-        *dst = ((Sint8) val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U16LSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint16 val = SDL_SwapBE16(*src);
-        *dst = SDL_SwapLE16(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16LSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
-        *dst = ((Sint16) SDL_SwapLE16(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16MSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
-        *dst = ((Sint16) SDL_SwapBE16(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32LSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
-        *dst = ((Sint32) SDL_SwapLE32(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32MSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
-        *dst = ((Sint32) SDL_SwapBE32(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32LSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f);
-        *dst = SDL_SwapFloatLE(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_U16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32MSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f);
-        *dst = SDL_SwapFloatBE(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U8.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000) >> 8));
-        *dst = val;
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S8.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint8 val = ((Sint8) (((Sint16) SDL_SwapBE16(*src)) >> 8));
-        *dst = ((Sint8) val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16LSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
-        *dst = SDL_SwapLE16(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S16LSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) SDL_SwapBE16(*src));
-        *dst = ((Sint16) SDL_SwapLE16(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16MSB.\n");
-#endif
-
-    src = (const Uint16 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
-        const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
-        *dst = SDL_SwapBE16(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32LSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
-        *dst = ((Sint32) SDL_SwapLE32(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32MSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
-        *dst = ((Sint32) SDL_SwapBE32(val));
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32LSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
-        *dst = SDL_SwapFloatLE(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint16 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32MSB.\n");
-#endif
-
-    src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1;
-    for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
-        const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
-        *dst = SDL_SwapFloatBE(val);
-    }
-
-    cvt->len_cvt *= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Uint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U8.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Uint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 24));
-        *dst = val;
-    }
-
-    cvt->len_cvt /= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Sint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S8.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Sint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Sint8 val = ((Sint8) (((Sint32) SDL_SwapLE32(*src)) >> 24));
-        *dst = ((Sint8) val);
-    }
-
-    cvt->len_cvt /= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16LSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
-        *dst = SDL_SwapLE16(val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16LSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
-        *dst = ((Sint16) SDL_SwapLE16(val));
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16MSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
-        *dst = SDL_SwapBE16(val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16MSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
-        *dst = ((Sint16) SDL_SwapBE16(val));
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S32MSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Sint32 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Sint32 val = ((Sint32) SDL_SwapLE32(*src));
-        *dst = ((Sint32) SDL_SwapBE32(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32LSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (float *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
-        *dst = SDL_SwapFloatLE(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32MSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (float *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
-        *dst = SDL_SwapFloatBE(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Uint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U8.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Uint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 24));
-        *dst = val;
-    }
-
-    cvt->len_cvt /= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Sint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S8.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Sint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Sint8 val = ((Sint8) (((Sint32) SDL_SwapBE32(*src)) >> 24));
-        *dst = ((Sint8) val);
-    }
-
-    cvt->len_cvt /= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16LSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
-        *dst = SDL_SwapLE16(val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16LSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
-        *dst = ((Sint16) SDL_SwapLE16(val));
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16MSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
-        *dst = SDL_SwapBE16(val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16MSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
-        *dst = ((Sint16) SDL_SwapBE16(val));
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S32LSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (Sint32 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const Sint32 val = ((Sint32) SDL_SwapBE32(*src));
-        *dst = ((Sint32) SDL_SwapLE32(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32LSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (float *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
-        *dst = SDL_SwapFloatLE(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_S32MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const Uint32 *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32MSB.\n");
-#endif
-
-    src = (const Uint32 *) cvt->buf;
-    dst = (float *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
-        const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
-        *dst = SDL_SwapFloatBE(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Uint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U8.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Uint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Uint8 val = ((Uint8) ((SDL_SwapFloatLE(*src) + 1.0f) * 127.0f));
-        *dst = val;
-    }
-
-    cvt->len_cvt /= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S8.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint8 val = ((Sint8) (SDL_SwapFloatLE(*src) * 127.0f));
-        *dst = ((Sint8) val);
-    }
-
-    cvt->len_cvt /= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16LSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f));
-        *dst = SDL_SwapLE16(val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16LSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
-        *dst = ((Sint16) SDL_SwapLE16(val));
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16MSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f));
-        *dst = SDL_SwapBE16(val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16MSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
-        *dst = ((Sint16) SDL_SwapBE16(val));
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32LSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint32 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
-        *dst = ((Sint32) SDL_SwapLE32(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32MSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint32 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
-        *dst = ((Sint32) SDL_SwapBE32(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_F32MSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (float *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const float val = SDL_SwapFloatLE(*src);
-        *dst = SDL_SwapFloatBE(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Uint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U8.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Uint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Uint8 val = ((Uint8) ((SDL_SwapFloatBE(*src) + 1.0f) * 127.0f));
-        *dst = val;
-    }
-
-    cvt->len_cvt /= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint8 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S8.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint8 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint8 val = ((Sint8) (SDL_SwapFloatBE(*src) * 127.0f));
-        *dst = ((Sint8) val);
-    }
-
-    cvt->len_cvt /= 4;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16LSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f));
-        *dst = SDL_SwapLE16(val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16LSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
-        *dst = ((Sint16) SDL_SwapLE16(val));
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Uint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16MSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Uint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f));
-        *dst = SDL_SwapBE16(val);
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint16 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16MSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint16 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
-        *dst = ((Sint16) SDL_SwapBE16(val));
-    }
-
-    cvt->len_cvt /= 2;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32LSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint32 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
-        *dst = ((Sint32) SDL_SwapLE32(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    Sint32 *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32MSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (Sint32 *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
-        *dst = ((Sint32) SDL_SwapBE32(val));
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
-    }
-}
-
-static void SDLCALL
-SDL_Convert_F32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const float *src;
-    float *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_F32LSB.\n");
-#endif
-
-    src = (const float *) cvt->buf;
-    dst = (float *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
-        const float val = SDL_SwapFloatBE(*src);
-        *dst = SDL_SwapFloatLE(val);
-    }
-
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
-    }
-}
-
-#endif  /* !NO_CONVERTERS */
-
-
-const SDL_AudioTypeFilters sdl_audio_type_filters[] =
-{
-#if !NO_CONVERTERS
-    { AUDIO_U8, AUDIO_S8, SDL_Convert_U8_to_S8 },
-    { AUDIO_U8, AUDIO_U16LSB, SDL_Convert_U8_to_U16LSB },
-    { AUDIO_U8, AUDIO_S16LSB, SDL_Convert_U8_to_S16LSB },
-    { AUDIO_U8, AUDIO_U16MSB, SDL_Convert_U8_to_U16MSB },
-    { AUDIO_U8, AUDIO_S16MSB, SDL_Convert_U8_to_S16MSB },
-    { AUDIO_U8, AUDIO_S32LSB, SDL_Convert_U8_to_S32LSB },
-    { AUDIO_U8, AUDIO_S32MSB, SDL_Convert_U8_to_S32MSB },
-    { AUDIO_U8, AUDIO_F32LSB, SDL_Convert_U8_to_F32LSB },
-    { AUDIO_U8, AUDIO_F32MSB, SDL_Convert_U8_to_F32MSB },
-    { AUDIO_S8, AUDIO_U8, SDL_Convert_S8_to_U8 },
-    { AUDIO_S8, AUDIO_U16LSB, SDL_Convert_S8_to_U16LSB },
-    { AUDIO_S8, AUDIO_S16LSB, SDL_Convert_S8_to_S16LSB },
-    { AUDIO_S8, AUDIO_U16MSB, SDL_Convert_S8_to_U16MSB },
-    { AUDIO_S8, AUDIO_S16MSB, SDL_Convert_S8_to_S16MSB },
-    { AUDIO_S8, AUDIO_S32LSB, SDL_Convert_S8_to_S32LSB },
-    { AUDIO_S8, AUDIO_S32MSB, SDL_Convert_S8_to_S32MSB },
-    { AUDIO_S8, AUDIO_F32LSB, SDL_Convert_S8_to_F32LSB },
-    { AUDIO_S8, AUDIO_F32MSB, SDL_Convert_S8_to_F32MSB },
-    { AUDIO_U16LSB, AUDIO_U8, SDL_Convert_U16LSB_to_U8 },
-    { AUDIO_U16LSB, AUDIO_S8, SDL_Convert_U16LSB_to_S8 },
-    { AUDIO_U16LSB, AUDIO_S16LSB, SDL_Convert_U16LSB_to_S16LSB },
-    { AUDIO_U16LSB, AUDIO_U16MSB, SDL_Convert_U16LSB_to_U16MSB },
-    { AUDIO_U16LSB, AUDIO_S16MSB, SDL_Convert_U16LSB_to_S16MSB },
-    { AUDIO_U16LSB, AUDIO_S32LSB, SDL_Convert_U16LSB_to_S32LSB },
-    { AUDIO_U16LSB, AUDIO_S32MSB, SDL_Convert_U16LSB_to_S32MSB },
-    { AUDIO_U16LSB, AUDIO_F32LSB, SDL_Convert_U16LSB_to_F32LSB },
-    { AUDIO_U16LSB, AUDIO_F32MSB, SDL_Convert_U16LSB_to_F32MSB },
-    { AUDIO_S16LSB, AUDIO_U8, SDL_Convert_S16LSB_to_U8 },
-    { AUDIO_S16LSB, AUDIO_S8, SDL_Convert_S16LSB_to_S8 },
-    { AUDIO_S16LSB, AUDIO_U16LSB, SDL_Convert_S16LSB_to_U16LSB },
-    { AUDIO_S16LSB, AUDIO_U16MSB, SDL_Convert_S16LSB_to_U16MSB },
-    { AUDIO_S16LSB, AUDIO_S16MSB, SDL_Convert_S16LSB_to_S16MSB },
-    { AUDIO_S16LSB, AUDIO_S32LSB, SDL_Convert_S16LSB_to_S32LSB },
-    { AUDIO_S16LSB, AUDIO_S32MSB, SDL_Convert_S16LSB_to_S32MSB },
-    { AUDIO_S16LSB, AUDIO_F32LSB, SDL_Convert_S16LSB_to_F32LSB },
-    { AUDIO_S16LSB, AUDIO_F32MSB, SDL_Convert_S16LSB_to_F32MSB },
-    { AUDIO_U16MSB, AUDIO_U8, SDL_Convert_U16MSB_to_U8 },
-    { AUDIO_U16MSB, AUDIO_S8, SDL_Convert_U16MSB_to_S8 },
-    { AUDIO_U16MSB, AUDIO_U16LSB, SDL_Convert_U16MSB_to_U16LSB },
-    { AUDIO_U16MSB, AUDIO_S16LSB, SDL_Convert_U16MSB_to_S16LSB },
-    { AUDIO_U16MSB, AUDIO_S16MSB, SDL_Convert_U16MSB_to_S16MSB },
-    { AUDIO_U16MSB, AUDIO_S32LSB, SDL_Convert_U16MSB_to_S32LSB },
-    { AUDIO_U16MSB, AUDIO_S32MSB, SDL_Convert_U16MSB_to_S32MSB },
-    { AUDIO_U16MSB, AUDIO_F32LSB, SDL_Convert_U16MSB_to_F32LSB },
-    { AUDIO_U16MSB, AUDIO_F32MSB, SDL_Convert_U16MSB_to_F32MSB },
-    { AUDIO_S16MSB, AUDIO_U8, SDL_Convert_S16MSB_to_U8 },
-    { AUDIO_S16MSB, AUDIO_S8, SDL_Convert_S16MSB_to_S8 },
-    { AUDIO_S16MSB, AUDIO_U16LSB, SDL_Convert_S16MSB_to_U16LSB },
-    { AUDIO_S16MSB, AUDIO_S16LSB, SDL_Convert_S16MSB_to_S16LSB },
-    { AUDIO_S16MSB, AUDIO_U16MSB, SDL_Convert_S16MSB_to_U16MSB },
-    { AUDIO_S16MSB, AUDIO_S32LSB, SDL_Convert_S16MSB_to_S32LSB },
-    { AUDIO_S16MSB, AUDIO_S32MSB, SDL_Convert_S16MSB_to_S32MSB },
-    { AUDIO_S16MSB, AUDIO_F32LSB, SDL_Convert_S16MSB_to_F32LSB },
-    { AUDIO_S16MSB, AUDIO_F32MSB, SDL_Convert_S16MSB_to_F32MSB },
-    { AUDIO_S32LSB, AUDIO_U8, SDL_Convert_S32LSB_to_U8 },
-    { AUDIO_S32LSB, AUDIO_S8, SDL_Convert_S32LSB_to_S8 },
-    { AUDIO_S32LSB, AUDIO_U16LSB, SDL_Convert_S32LSB_to_U16LSB },
-    { AUDIO_S32LSB, AUDIO_S16LSB, SDL_Convert_S32LSB_to_S16LSB },
-    { AUDIO_S32LSB, AUDIO_U16MSB, SDL_Convert_S32LSB_to_U16MSB },
-    { AUDIO_S32LSB, AUDIO_S16MSB, SDL_Convert_S32LSB_to_S16MSB },
-    { AUDIO_S32LSB, AUDIO_S32MSB, SDL_Convert_S32LSB_to_S32MSB },
-    { AUDIO_S32LSB, AUDIO_F32LSB, SDL_Convert_S32LSB_to_F32LSB },
-    { AUDIO_S32LSB, AUDIO_F32MSB, SDL_Convert_S32LSB_to_F32MSB },
-    { AUDIO_S32MSB, AUDIO_U8, SDL_Convert_S32MSB_to_U8 },
-    { AUDIO_S32MSB, AUDIO_S8, SDL_Convert_S32MSB_to_S8 },
-    { AUDIO_S32MSB, AUDIO_U16LSB, SDL_Convert_S32MSB_to_U16LSB },
-    { AUDIO_S32MSB, AUDIO_S16LSB, SDL_Convert_S32MSB_to_S16LSB },
-    { AUDIO_S32MSB, AUDIO_U16MSB, SDL_Convert_S32MSB_to_U16MSB },
-    { AUDIO_S32MSB, AUDIO_S16MSB, SDL_Convert_S32MSB_to_S16MSB },
-    { AUDIO_S32MSB, AUDIO_S32LSB, SDL_Convert_S32MSB_to_S32LSB },
-    { AUDIO_S32MSB, AUDIO_F32LSB, SDL_Convert_S32MSB_to_F32LSB },
-    { AUDIO_S32MSB, AUDIO_F32MSB, SDL_Convert_S32MSB_to_F32MSB },
-    { AUDIO_F32LSB, AUDIO_U8, SDL_Convert_F32LSB_to_U8 },
-    { AUDIO_F32LSB, AUDIO_S8, SDL_Convert_F32LSB_to_S8 },
-    { AUDIO_F32LSB, AUDIO_U16LSB, SDL_Convert_F32LSB_to_U16LSB },
-    { AUDIO_F32LSB, AUDIO_S16LSB, SDL_Convert_F32LSB_to_S16LSB },
-    { AUDIO_F32LSB, AUDIO_U16MSB, SDL_Convert_F32LSB_to_U16MSB },
-    { AUDIO_F32LSB, AUDIO_S16MSB, SDL_Convert_F32LSB_to_S16MSB },
-    { AUDIO_F32LSB, AUDIO_S32LSB, SDL_Convert_F32LSB_to_S32LSB },
-    { AUDIO_F32LSB, AUDIO_S32MSB, SDL_Convert_F32LSB_to_S32MSB },
-    { AUDIO_F32LSB, AUDIO_F32MSB, SDL_Convert_F32LSB_to_F32MSB },
-    { AUDIO_F32MSB, AUDIO_U8, SDL_Convert_F32MSB_to_U8 },
-    { AUDIO_F32MSB, AUDIO_S8, SDL_Convert_F32MSB_to_S8 },
-    { AUDIO_F32MSB, AUDIO_U16LSB, SDL_Convert_F32MSB_to_U16LSB },
-    { AUDIO_F32MSB, AUDIO_S16LSB, SDL_Convert_F32MSB_to_S16LSB },
-    { AUDIO_F32MSB, AUDIO_U16MSB, SDL_Convert_F32MSB_to_U16MSB },
-    { AUDIO_F32MSB, AUDIO_S16MSB, SDL_Convert_F32MSB_to_S16MSB },
-    { AUDIO_F32MSB, AUDIO_S32LSB, SDL_Convert_F32MSB_to_S32LSB },
-    { AUDIO_F32MSB, AUDIO_S32MSB, SDL_Convert_F32MSB_to_S32MSB },
-    { AUDIO_F32MSB, AUDIO_F32LSB, SDL_Convert_F32MSB_to_F32LSB },
-#endif  /* !NO_CONVERTERS */
-    { 0, 0, NULL }
-};
-
-
-#if !NO_RESAMPLERS
-
-static void SDLCALL
-SDL_Upsample_U8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 16;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Uint8 sample0 = src[0];
-    Uint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = sample0;
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 16;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Uint8 sample0 = src[0];
-    Uint8 last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = sample0;
-            dst++;
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Uint8 sample1 = src[1];
-    Uint8 sample0 = src[0];
-    Uint8 last_sample1 = sample1;
-    Uint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = sample1;
-        dst[0] = sample0;
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Uint8 sample0 = src[0];
-    Uint8 sample1 = src[1];
-    Uint8 last_sample0 = sample0;
-    Uint8 last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = sample0;
-            dst[1] = sample1;
-            dst += 2;
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Uint8 sample3 = src[3];
-    Uint8 sample2 = src[2];
-    Uint8 sample1 = src[1];
-    Uint8 sample0 = src[0];
-    Uint8 last_sample3 = sample3;
-    Uint8 last_sample2 = sample2;
-    Uint8 last_sample1 = sample1;
-    Uint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = sample3;
-        dst[2] = sample2;
-        dst[1] = sample1;
-        dst[0] = sample0;
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
-            sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
-            sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Uint8 sample0 = src[0];
-    Uint8 sample1 = src[1];
-    Uint8 sample2 = src[2];
-    Uint8 sample3 = src[3];
-    Uint8 last_sample0 = sample0;
-    Uint8 last_sample1 = sample1;
-    Uint8 last_sample2 = sample2;
-    Uint8 last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = sample0;
-            dst[1] = sample1;
-            dst[2] = sample2;
-            dst[3] = sample3;
-            dst += 4;
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
-            sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
-            sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 96;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Uint8 sample5 = src[5];
-    Uint8 sample4 = src[4];
-    Uint8 sample3 = src[3];
-    Uint8 sample2 = src[2];
-    Uint8 sample1 = src[1];
-    Uint8 sample0 = src[0];
-    Uint8 last_sample5 = sample5;
-    Uint8 last_sample4 = sample4;
-    Uint8 last_sample3 = sample3;
-    Uint8 last_sample2 = sample2;
-    Uint8 last_sample1 = sample1;
-    Uint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = sample5;
-        dst[4] = sample4;
-        dst[3] = sample3;
-        dst[2] = sample2;
-        dst[1] = sample1;
-        dst[0] = sample0;
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
-            sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
-            sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
-            sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
-            sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 96;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Uint8 sample0 = src[0];
-    Uint8 sample1 = src[1];
-    Uint8 sample2 = src[2];
-    Uint8 sample3 = src[3];
-    Uint8 sample4 = src[4];
-    Uint8 sample5 = src[5];
-    Uint8 last_sample0 = sample0;
-    Uint8 last_sample1 = sample1;
-    Uint8 last_sample2 = sample2;
-    Uint8 last_sample3 = sample3;
-    Uint8 last_sample4 = sample4;
-    Uint8 last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = sample0;
-            dst[1] = sample1;
-            dst[2] = sample2;
-            dst[3] = sample3;
-            dst[4] = sample4;
-            dst[5] = sample5;
-            dst += 6;
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
-            sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
-            sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
-            sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
-            sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Uint8 sample7 = src[7];
-    Uint8 sample6 = src[6];
-    Uint8 sample5 = src[5];
-    Uint8 sample4 = src[4];
-    Uint8 sample3 = src[3];
-    Uint8 sample2 = src[2];
-    Uint8 sample1 = src[1];
-    Uint8 sample0 = src[0];
-    Uint8 last_sample7 = sample7;
-    Uint8 last_sample6 = sample6;
-    Uint8 last_sample5 = sample5;
-    Uint8 last_sample4 = sample4;
-    Uint8 last_sample3 = sample3;
-    Uint8 last_sample2 = sample2;
-    Uint8 last_sample1 = sample1;
-    Uint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = sample7;
-        dst[6] = sample6;
-        dst[5] = sample5;
-        dst[4] = sample4;
-        dst[3] = sample3;
-        dst[2] = sample2;
-        dst[1] = sample1;
-        dst[0] = sample0;
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1);
-            sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1);
-            sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
-            sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
-            sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
-            sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
-            sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Uint8 sample0 = src[0];
-    Uint8 sample1 = src[1];
-    Uint8 sample2 = src[2];
-    Uint8 sample3 = src[3];
-    Uint8 sample4 = src[4];
-    Uint8 sample5 = src[5];
-    Uint8 sample6 = src[6];
-    Uint8 sample7 = src[7];
-    Uint8 last_sample0 = sample0;
-    Uint8 last_sample1 = sample1;
-    Uint8 last_sample2 = sample2;
-    Uint8 last_sample3 = sample3;
-    Uint8 last_sample4 = sample4;
-    Uint8 last_sample5 = sample5;
-    Uint8 last_sample6 = sample6;
-    Uint8 last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = sample0;
-            dst[1] = sample1;
-            dst[2] = sample2;
-            dst[3] = sample3;
-            dst[4] = sample4;
-            dst[5] = sample5;
-            dst[6] = sample6;
-            dst[7] = sample7;
-            dst += 8;
-            sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1);
-            sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1);
-            sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1);
-            sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1);
-            sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1);
-            sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1);
-            sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1);
-            sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 16;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = ((Sint8) sample0);
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 16;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint8) sample0);
-            dst++;
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint8 sample1 = ((Sint8) src[1]);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 last_sample1 = sample1;
-    Sint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = ((Sint8) sample1);
-        dst[0] = ((Sint8) sample0);
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 sample1 = ((Sint8) src[1]);
-    Sint8 last_sample0 = sample0;
-    Sint8 last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint8) sample0);
-            dst[1] = ((Sint8) sample1);
-            dst += 2;
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint8 sample3 = ((Sint8) src[3]);
-    Sint8 sample2 = ((Sint8) src[2]);
-    Sint8 sample1 = ((Sint8) src[1]);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 last_sample3 = sample3;
-    Sint8 last_sample2 = sample2;
-    Sint8 last_sample1 = sample1;
-    Sint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = ((Sint8) sample3);
-        dst[2] = ((Sint8) sample2);
-        dst[1] = ((Sint8) sample1);
-        dst[0] = ((Sint8) sample0);
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
-            sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
-            sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 sample1 = ((Sint8) src[1]);
-    Sint8 sample2 = ((Sint8) src[2]);
-    Sint8 sample3 = ((Sint8) src[3]);
-    Sint8 last_sample0 = sample0;
-    Sint8 last_sample1 = sample1;
-    Sint8 last_sample2 = sample2;
-    Sint8 last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint8) sample0);
-            dst[1] = ((Sint8) sample1);
-            dst[2] = ((Sint8) sample2);
-            dst[3] = ((Sint8) sample3);
-            dst += 4;
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
-            sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
-            sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 96;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint8 sample5 = ((Sint8) src[5]);
-    Sint8 sample4 = ((Sint8) src[4]);
-    Sint8 sample3 = ((Sint8) src[3]);
-    Sint8 sample2 = ((Sint8) src[2]);
-    Sint8 sample1 = ((Sint8) src[1]);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 last_sample5 = sample5;
-    Sint8 last_sample4 = sample4;
-    Sint8 last_sample3 = sample3;
-    Sint8 last_sample2 = sample2;
-    Sint8 last_sample1 = sample1;
-    Sint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = ((Sint8) sample5);
-        dst[4] = ((Sint8) sample4);
-        dst[3] = ((Sint8) sample3);
-        dst[2] = ((Sint8) sample2);
-        dst[1] = ((Sint8) sample1);
-        dst[0] = ((Sint8) sample0);
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
-            sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
-            sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
-            sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
-            sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 96;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 sample1 = ((Sint8) src[1]);
-    Sint8 sample2 = ((Sint8) src[2]);
-    Sint8 sample3 = ((Sint8) src[3]);
-    Sint8 sample4 = ((Sint8) src[4]);
-    Sint8 sample5 = ((Sint8) src[5]);
-    Sint8 last_sample0 = sample0;
-    Sint8 last_sample1 = sample1;
-    Sint8 last_sample2 = sample2;
-    Sint8 last_sample3 = sample3;
-    Sint8 last_sample4 = sample4;
-    Sint8 last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint8) sample0);
-            dst[1] = ((Sint8) sample1);
-            dst[2] = ((Sint8) sample2);
-            dst[3] = ((Sint8) sample3);
-            dst[4] = ((Sint8) sample4);
-            dst[5] = ((Sint8) sample5);
-            dst += 6;
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
-            sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
-            sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
-            sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
-            sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint8 sample7 = ((Sint8) src[7]);
-    Sint8 sample6 = ((Sint8) src[6]);
-    Sint8 sample5 = ((Sint8) src[5]);
-    Sint8 sample4 = ((Sint8) src[4]);
-    Sint8 sample3 = ((Sint8) src[3]);
-    Sint8 sample2 = ((Sint8) src[2]);
-    Sint8 sample1 = ((Sint8) src[1]);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 last_sample7 = sample7;
-    Sint8 last_sample6 = sample6;
-    Sint8 last_sample5 = sample5;
-    Sint8 last_sample4 = sample4;
-    Sint8 last_sample3 = sample3;
-    Sint8 last_sample2 = sample2;
-    Sint8 last_sample1 = sample1;
-    Sint8 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = ((Sint8) sample7);
-        dst[6] = ((Sint8) sample6);
-        dst[5] = ((Sint8) sample5);
-        dst[4] = ((Sint8) sample4);
-        dst[3] = ((Sint8) sample3);
-        dst[2] = ((Sint8) sample2);
-        dst[1] = ((Sint8) sample1);
-        dst[0] = ((Sint8) sample0);
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1);
-            sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1);
-            sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
-            sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
-            sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
-            sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
-            sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint8 sample0 = ((Sint8) src[0]);
-    Sint8 sample1 = ((Sint8) src[1]);
-    Sint8 sample2 = ((Sint8) src[2]);
-    Sint8 sample3 = ((Sint8) src[3]);
-    Sint8 sample4 = ((Sint8) src[4]);
-    Sint8 sample5 = ((Sint8) src[5]);
-    Sint8 sample6 = ((Sint8) src[6]);
-    Sint8 sample7 = ((Sint8) src[7]);
-    Sint8 last_sample0 = sample0;
-    Sint8 last_sample1 = sample1;
-    Sint8 last_sample2 = sample2;
-    Sint8 last_sample3 = sample3;
-    Sint8 last_sample4 = sample4;
-    Sint8 last_sample5 = sample5;
-    Sint8 last_sample6 = sample6;
-    Sint8 last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint8) sample0);
-            dst[1] = ((Sint8) sample1);
-            dst[2] = ((Sint8) sample2);
-            dst[3] = ((Sint8) sample3);
-            dst[4] = ((Sint8) sample4);
-            dst[5] = ((Sint8) sample5);
-            dst[6] = ((Sint8) sample6);
-            dst[7] = ((Sint8) sample7);
-            dst += 8;
-            sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1);
-            sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1);
-            sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1);
-            sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1);
-            sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1);
-            sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1);
-            sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1);
-            sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = SDL_SwapLE16(sample0);
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapLE16(sample0);
-            dst++;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample1 = SDL_SwapLE16(src[1]);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = SDL_SwapLE16(sample1);
-        dst[0] = SDL_SwapLE16(sample0);
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 sample1 = SDL_SwapLE16(src[1]);
-    Uint16 last_sample0 = sample0;
-    Uint16 last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapLE16(sample0);
-            dst[1] = SDL_SwapLE16(sample1);
-            dst += 2;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample3 = SDL_SwapLE16(src[3]);
-    Uint16 sample2 = SDL_SwapLE16(src[2]);
-    Uint16 sample1 = SDL_SwapLE16(src[1]);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = SDL_SwapLE16(sample3);
-        dst[2] = SDL_SwapLE16(sample2);
-        dst[1] = SDL_SwapLE16(sample1);
-        dst[0] = SDL_SwapLE16(sample0);
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 sample1 = SDL_SwapLE16(src[1]);
-    Uint16 sample2 = SDL_SwapLE16(src[2]);
-    Uint16 sample3 = SDL_SwapLE16(src[3]);
-    Uint16 last_sample0 = sample0;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapLE16(sample0);
-            dst[1] = SDL_SwapLE16(sample1);
-            dst[2] = SDL_SwapLE16(sample2);
-            dst[3] = SDL_SwapLE16(sample3);
-            dst += 4;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 192;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample5 = SDL_SwapLE16(src[5]);
-    Uint16 sample4 = SDL_SwapLE16(src[4]);
-    Uint16 sample3 = SDL_SwapLE16(src[3]);
-    Uint16 sample2 = SDL_SwapLE16(src[2]);
-    Uint16 sample1 = SDL_SwapLE16(src[1]);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 last_sample5 = sample5;
-    Uint16 last_sample4 = sample4;
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = SDL_SwapLE16(sample5);
-        dst[4] = SDL_SwapLE16(sample4);
-        dst[3] = SDL_SwapLE16(sample3);
-        dst[2] = SDL_SwapLE16(sample2);
-        dst[1] = SDL_SwapLE16(sample1);
-        dst[0] = SDL_SwapLE16(sample0);
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
-            sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 192;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 sample1 = SDL_SwapLE16(src[1]);
-    Uint16 sample2 = SDL_SwapLE16(src[2]);
-    Uint16 sample3 = SDL_SwapLE16(src[3]);
-    Uint16 sample4 = SDL_SwapLE16(src[4]);
-    Uint16 sample5 = SDL_SwapLE16(src[5]);
-    Uint16 last_sample0 = sample0;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample4 = sample4;
-    Uint16 last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapLE16(sample0);
-            dst[1] = SDL_SwapLE16(sample1);
-            dst[2] = SDL_SwapLE16(sample2);
-            dst[3] = SDL_SwapLE16(sample3);
-            dst[4] = SDL_SwapLE16(sample4);
-            dst[5] = SDL_SwapLE16(sample5);
-            dst += 6;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
-            sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample7 = SDL_SwapLE16(src[7]);
-    Uint16 sample6 = SDL_SwapLE16(src[6]);
-    Uint16 sample5 = SDL_SwapLE16(src[5]);
-    Uint16 sample4 = SDL_SwapLE16(src[4]);
-    Uint16 sample3 = SDL_SwapLE16(src[3]);
-    Uint16 sample2 = SDL_SwapLE16(src[2]);
-    Uint16 sample1 = SDL_SwapLE16(src[1]);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 last_sample7 = sample7;
-    Uint16 last_sample6 = sample6;
-    Uint16 last_sample5 = sample5;
-    Uint16 last_sample4 = sample4;
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = SDL_SwapLE16(sample7);
-        dst[6] = SDL_SwapLE16(sample6);
-        dst[5] = SDL_SwapLE16(sample5);
-        dst[4] = SDL_SwapLE16(sample4);
-        dst[3] = SDL_SwapLE16(sample3);
-        dst[2] = SDL_SwapLE16(sample2);
-        dst[1] = SDL_SwapLE16(sample1);
-        dst[0] = SDL_SwapLE16(sample0);
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1);
-            sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1);
-            sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
-            sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapLE16(src[0]);
-    Uint16 sample1 = SDL_SwapLE16(src[1]);
-    Uint16 sample2 = SDL_SwapLE16(src[2]);
-    Uint16 sample3 = SDL_SwapLE16(src[3]);
-    Uint16 sample4 = SDL_SwapLE16(src[4]);
-    Uint16 sample5 = SDL_SwapLE16(src[5]);
-    Uint16 sample6 = SDL_SwapLE16(src[6]);
-    Uint16 sample7 = SDL_SwapLE16(src[7]);
-    Uint16 last_sample0 = sample0;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample4 = sample4;
-    Uint16 last_sample5 = sample5;
-    Uint16 last_sample6 = sample6;
-    Uint16 last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapLE16(sample0);
-            dst[1] = SDL_SwapLE16(sample1);
-            dst[2] = SDL_SwapLE16(sample2);
-            dst[3] = SDL_SwapLE16(sample3);
-            dst[4] = SDL_SwapLE16(sample4);
-            dst[5] = SDL_SwapLE16(sample5);
-            dst[6] = SDL_SwapLE16(sample6);
-            dst[7] = SDL_SwapLE16(sample7);
-            dst += 8;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1);
-            sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1);
-            sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1);
-            sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-            dst++;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = ((Sint16) SDL_SwapLE16(sample1));
-        dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
-    Sint16 last_sample0 = sample0;
-    Sint16 last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-            dst[1] = ((Sint16) SDL_SwapLE16(sample1));
-            dst += 2;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
-    Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
-    Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = ((Sint16) SDL_SwapLE16(sample3));
-        dst[2] = ((Sint16) SDL_SwapLE16(sample2));
-        dst[1] = ((Sint16) SDL_SwapLE16(sample1));
-        dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
-    Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
-    Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
-    Sint16 last_sample0 = sample0;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-            dst[1] = ((Sint16) SDL_SwapLE16(sample1));
-            dst[2] = ((Sint16) SDL_SwapLE16(sample2));
-            dst[3] = ((Sint16) SDL_SwapLE16(sample3));
-            dst += 4;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 192;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
-    Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
-    Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
-    Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
-    Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 last_sample5 = sample5;
-    Sint16 last_sample4 = sample4;
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = ((Sint16) SDL_SwapLE16(sample5));
-        dst[4] = ((Sint16) SDL_SwapLE16(sample4));
-        dst[3] = ((Sint16) SDL_SwapLE16(sample3));
-        dst[2] = ((Sint16) SDL_SwapLE16(sample2));
-        dst[1] = ((Sint16) SDL_SwapLE16(sample1));
-        dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
-            sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 192;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
-    Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
-    Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
-    Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
-    Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
-    Sint16 last_sample0 = sample0;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample4 = sample4;
-    Sint16 last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-            dst[1] = ((Sint16) SDL_SwapLE16(sample1));
-            dst[2] = ((Sint16) SDL_SwapLE16(sample2));
-            dst[3] = ((Sint16) SDL_SwapLE16(sample3));
-            dst[4] = ((Sint16) SDL_SwapLE16(sample4));
-            dst[5] = ((Sint16) SDL_SwapLE16(sample5));
-            dst += 6;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
-            sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7]));
-    Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6]));
-    Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
-    Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
-    Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
-    Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
-    Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 last_sample7 = sample7;
-    Sint16 last_sample6 = sample6;
-    Sint16 last_sample5 = sample5;
-    Sint16 last_sample4 = sample4;
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = ((Sint16) SDL_SwapLE16(sample7));
-        dst[6] = ((Sint16) SDL_SwapLE16(sample6));
-        dst[5] = ((Sint16) SDL_SwapLE16(sample5));
-        dst[4] = ((Sint16) SDL_SwapLE16(sample4));
-        dst[3] = ((Sint16) SDL_SwapLE16(sample3));
-        dst[2] = ((Sint16) SDL_SwapLE16(sample2));
-        dst[1] = ((Sint16) SDL_SwapLE16(sample1));
-        dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
-            sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
-            sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
-            sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0]));
-    Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1]));
-    Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2]));
-    Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3]));
-    Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4]));
-    Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5]));
-    Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6]));
-    Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7]));
-    Sint16 last_sample0 = sample0;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample4 = sample4;
-    Sint16 last_sample5 = sample5;
-    Sint16 last_sample6 = sample6;
-    Sint16 last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapLE16(sample0));
-            dst[1] = ((Sint16) SDL_SwapLE16(sample1));
-            dst[2] = ((Sint16) SDL_SwapLE16(sample2));
-            dst[3] = ((Sint16) SDL_SwapLE16(sample3));
-            dst[4] = ((Sint16) SDL_SwapLE16(sample4));
-            dst[5] = ((Sint16) SDL_SwapLE16(sample5));
-            dst[6] = ((Sint16) SDL_SwapLE16(sample6));
-            dst[7] = ((Sint16) SDL_SwapLE16(sample7));
-            dst += 8;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
-            sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
-            sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
-            sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = SDL_SwapBE16(sample0);
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapBE16(sample0);
-            dst++;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample1 = SDL_SwapBE16(src[1]);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = SDL_SwapBE16(sample1);
-        dst[0] = SDL_SwapBE16(sample0);
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 sample1 = SDL_SwapBE16(src[1]);
-    Uint16 last_sample0 = sample0;
-    Uint16 last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapBE16(sample0);
-            dst[1] = SDL_SwapBE16(sample1);
-            dst += 2;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample3 = SDL_SwapBE16(src[3]);
-    Uint16 sample2 = SDL_SwapBE16(src[2]);
-    Uint16 sample1 = SDL_SwapBE16(src[1]);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = SDL_SwapBE16(sample3);
-        dst[2] = SDL_SwapBE16(sample2);
-        dst[1] = SDL_SwapBE16(sample1);
-        dst[0] = SDL_SwapBE16(sample0);
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 sample1 = SDL_SwapBE16(src[1]);
-    Uint16 sample2 = SDL_SwapBE16(src[2]);
-    Uint16 sample3 = SDL_SwapBE16(src[3]);
-    Uint16 last_sample0 = sample0;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapBE16(sample0);
-            dst[1] = SDL_SwapBE16(sample1);
-            dst[2] = SDL_SwapBE16(sample2);
-            dst[3] = SDL_SwapBE16(sample3);
-            dst += 4;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 192;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample5 = SDL_SwapBE16(src[5]);
-    Uint16 sample4 = SDL_SwapBE16(src[4]);
-    Uint16 sample3 = SDL_SwapBE16(src[3]);
-    Uint16 sample2 = SDL_SwapBE16(src[2]);
-    Uint16 sample1 = SDL_SwapBE16(src[1]);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 last_sample5 = sample5;
-    Uint16 last_sample4 = sample4;
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = SDL_SwapBE16(sample5);
-        dst[4] = SDL_SwapBE16(sample4);
-        dst[3] = SDL_SwapBE16(sample3);
-        dst[2] = SDL_SwapBE16(sample2);
-        dst[1] = SDL_SwapBE16(sample1);
-        dst[0] = SDL_SwapBE16(sample0);
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
-            sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 192;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 sample1 = SDL_SwapBE16(src[1]);
-    Uint16 sample2 = SDL_SwapBE16(src[2]);
-    Uint16 sample3 = SDL_SwapBE16(src[3]);
-    Uint16 sample4 = SDL_SwapBE16(src[4]);
-    Uint16 sample5 = SDL_SwapBE16(src[5]);
-    Uint16 last_sample0 = sample0;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample4 = sample4;
-    Uint16 last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapBE16(sample0);
-            dst[1] = SDL_SwapBE16(sample1);
-            dst[2] = SDL_SwapBE16(sample2);
-            dst[3] = SDL_SwapBE16(sample3);
-            dst[4] = SDL_SwapBE16(sample4);
-            dst[5] = SDL_SwapBE16(sample5);
-            dst += 6;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
-            sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Uint16 sample7 = SDL_SwapBE16(src[7]);
-    Uint16 sample6 = SDL_SwapBE16(src[6]);
-    Uint16 sample5 = SDL_SwapBE16(src[5]);
-    Uint16 sample4 = SDL_SwapBE16(src[4]);
-    Uint16 sample3 = SDL_SwapBE16(src[3]);
-    Uint16 sample2 = SDL_SwapBE16(src[2]);
-    Uint16 sample1 = SDL_SwapBE16(src[1]);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 last_sample7 = sample7;
-    Uint16 last_sample6 = sample6;
-    Uint16 last_sample5 = sample5;
-    Uint16 last_sample4 = sample4;
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = SDL_SwapBE16(sample7);
-        dst[6] = SDL_SwapBE16(sample6);
-        dst[5] = SDL_SwapBE16(sample5);
-        dst[4] = SDL_SwapBE16(sample4);
-        dst[3] = SDL_SwapBE16(sample3);
-        dst[2] = SDL_SwapBE16(sample2);
-        dst[1] = SDL_SwapBE16(sample1);
-        dst[0] = SDL_SwapBE16(sample0);
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1);
-            sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1);
-            sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
-            sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Uint16 sample0 = SDL_SwapBE16(src[0]);
-    Uint16 sample1 = SDL_SwapBE16(src[1]);
-    Uint16 sample2 = SDL_SwapBE16(src[2]);
-    Uint16 sample3 = SDL_SwapBE16(src[3]);
-    Uint16 sample4 = SDL_SwapBE16(src[4]);
-    Uint16 sample5 = SDL_SwapBE16(src[5]);
-    Uint16 sample6 = SDL_SwapBE16(src[6]);
-    Uint16 sample7 = SDL_SwapBE16(src[7]);
-    Uint16 last_sample0 = sample0;
-    Uint16 last_sample1 = sample1;
-    Uint16 last_sample2 = sample2;
-    Uint16 last_sample3 = sample3;
-    Uint16 last_sample4 = sample4;
-    Uint16 last_sample5 = sample5;
-    Uint16 last_sample6 = sample6;
-    Uint16 last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapBE16(sample0);
-            dst[1] = SDL_SwapBE16(sample1);
-            dst[2] = SDL_SwapBE16(sample2);
-            dst[3] = SDL_SwapBE16(sample3);
-            dst[4] = SDL_SwapBE16(sample4);
-            dst[5] = SDL_SwapBE16(sample5);
-            dst[6] = SDL_SwapBE16(sample6);
-            dst[7] = SDL_SwapBE16(sample7);
-            dst += 8;
-            sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1);
-            sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1);
-            sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1);
-            sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1);
-            sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 32;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-            dst++;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = ((Sint16) SDL_SwapBE16(sample1));
-        dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
-    Sint16 last_sample0 = sample0;
-    Sint16 last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-            dst[1] = ((Sint16) SDL_SwapBE16(sample1));
-            dst += 2;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
-    Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
-    Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = ((Sint16) SDL_SwapBE16(sample3));
-        dst[2] = ((Sint16) SDL_SwapBE16(sample2));
-        dst[1] = ((Sint16) SDL_SwapBE16(sample1));
-        dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
-    Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
-    Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
-    Sint16 last_sample0 = sample0;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-            dst[1] = ((Sint16) SDL_SwapBE16(sample1));
-            dst[2] = ((Sint16) SDL_SwapBE16(sample2));
-            dst[3] = ((Sint16) SDL_SwapBE16(sample3));
-            dst += 4;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 192;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
-    Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
-    Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
-    Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
-    Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 last_sample5 = sample5;
-    Sint16 last_sample4 = sample4;
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = ((Sint16) SDL_SwapBE16(sample5));
-        dst[4] = ((Sint16) SDL_SwapBE16(sample4));
-        dst[3] = ((Sint16) SDL_SwapBE16(sample3));
-        dst[2] = ((Sint16) SDL_SwapBE16(sample2));
-        dst[1] = ((Sint16) SDL_SwapBE16(sample1));
-        dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
-            sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 192;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
-    Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
-    Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
-    Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
-    Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
-    Sint16 last_sample0 = sample0;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample4 = sample4;
-    Sint16 last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-            dst[1] = ((Sint16) SDL_SwapBE16(sample1));
-            dst[2] = ((Sint16) SDL_SwapBE16(sample2));
-            dst[3] = ((Sint16) SDL_SwapBE16(sample3));
-            dst[4] = ((Sint16) SDL_SwapBE16(sample4));
-            dst[5] = ((Sint16) SDL_SwapBE16(sample5));
-            dst += 6;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
-            sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7]));
-    Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6]));
-    Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
-    Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
-    Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
-    Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
-    Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 last_sample7 = sample7;
-    Sint16 last_sample6 = sample6;
-    Sint16 last_sample5 = sample5;
-    Sint16 last_sample4 = sample4;
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = ((Sint16) SDL_SwapBE16(sample7));
-        dst[6] = ((Sint16) SDL_SwapBE16(sample6));
-        dst[5] = ((Sint16) SDL_SwapBE16(sample5));
-        dst[4] = ((Sint16) SDL_SwapBE16(sample4));
-        dst[3] = ((Sint16) SDL_SwapBE16(sample3));
-        dst[2] = ((Sint16) SDL_SwapBE16(sample2));
-        dst[1] = ((Sint16) SDL_SwapBE16(sample1));
-        dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
-            sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
-            sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
-            sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0]));
-    Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1]));
-    Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2]));
-    Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3]));
-    Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4]));
-    Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5]));
-    Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6]));
-    Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7]));
-    Sint16 last_sample0 = sample0;
-    Sint16 last_sample1 = sample1;
-    Sint16 last_sample2 = sample2;
-    Sint16 last_sample3 = sample3;
-    Sint16 last_sample4 = sample4;
-    Sint16 last_sample5 = sample5;
-    Sint16 last_sample6 = sample6;
-    Sint16 last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint16) SDL_SwapBE16(sample0));
-            dst[1] = ((Sint16) SDL_SwapBE16(sample1));
-            dst[2] = ((Sint16) SDL_SwapBE16(sample2));
-            dst[3] = ((Sint16) SDL_SwapBE16(sample3));
-            dst[4] = ((Sint16) SDL_SwapBE16(sample4));
-            dst[5] = ((Sint16) SDL_SwapBE16(sample5));
-            dst[6] = ((Sint16) SDL_SwapBE16(sample6));
-            dst[7] = ((Sint16) SDL_SwapBE16(sample7));
-            dst += 8;
-            sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1);
-            sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1);
-            sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1);
-            sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1);
-            sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1);
-            sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1);
-            sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1);
-            sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-            dst++;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = ((Sint32) SDL_SwapLE32(sample1));
-        dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
-    Sint32 last_sample0 = sample0;
-    Sint32 last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-            dst[1] = ((Sint32) SDL_SwapLE32(sample1));
-            dst += 2;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
-    Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
-    Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = ((Sint32) SDL_SwapLE32(sample3));
-        dst[2] = ((Sint32) SDL_SwapLE32(sample2));
-        dst[1] = ((Sint32) SDL_SwapLE32(sample1));
-        dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
-    Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
-    Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
-    Sint32 last_sample0 = sample0;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-            dst[1] = ((Sint32) SDL_SwapLE32(sample1));
-            dst[2] = ((Sint32) SDL_SwapLE32(sample2));
-            dst[3] = ((Sint32) SDL_SwapLE32(sample3));
-            dst += 4;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 384;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
-    Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
-    Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
-    Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
-    Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 last_sample5 = sample5;
-    Sint32 last_sample4 = sample4;
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = ((Sint32) SDL_SwapLE32(sample5));
-        dst[4] = ((Sint32) SDL_SwapLE32(sample4));
-        dst[3] = ((Sint32) SDL_SwapLE32(sample3));
-        dst[2] = ((Sint32) SDL_SwapLE32(sample2));
-        dst[1] = ((Sint32) SDL_SwapLE32(sample1));
-        dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
-            sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 384;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
-    Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
-    Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
-    Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
-    Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
-    Sint32 last_sample0 = sample0;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample4 = sample4;
-    Sint32 last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-            dst[1] = ((Sint32) SDL_SwapLE32(sample1));
-            dst[2] = ((Sint32) SDL_SwapLE32(sample2));
-            dst[3] = ((Sint32) SDL_SwapLE32(sample3));
-            dst[4] = ((Sint32) SDL_SwapLE32(sample4));
-            dst[5] = ((Sint32) SDL_SwapLE32(sample5));
-            dst += 6;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
-            sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 512;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7]));
-    Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6]));
-    Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
-    Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
-    Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
-    Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
-    Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 last_sample7 = sample7;
-    Sint32 last_sample6 = sample6;
-    Sint32 last_sample5 = sample5;
-    Sint32 last_sample4 = sample4;
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = ((Sint32) SDL_SwapLE32(sample7));
-        dst[6] = ((Sint32) SDL_SwapLE32(sample6));
-        dst[5] = ((Sint32) SDL_SwapLE32(sample5));
-        dst[4] = ((Sint32) SDL_SwapLE32(sample4));
-        dst[3] = ((Sint32) SDL_SwapLE32(sample3));
-        dst[2] = ((Sint32) SDL_SwapLE32(sample2));
-        dst[1] = ((Sint32) SDL_SwapLE32(sample1));
-        dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
-            sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
-            sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
-            sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 512;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0]));
-    Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1]));
-    Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2]));
-    Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3]));
-    Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4]));
-    Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5]));
-    Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6]));
-    Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7]));
-    Sint32 last_sample0 = sample0;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample4 = sample4;
-    Sint32 last_sample5 = sample5;
-    Sint32 last_sample6 = sample6;
-    Sint32 last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapLE32(sample0));
-            dst[1] = ((Sint32) SDL_SwapLE32(sample1));
-            dst[2] = ((Sint32) SDL_SwapLE32(sample2));
-            dst[3] = ((Sint32) SDL_SwapLE32(sample3));
-            dst[4] = ((Sint32) SDL_SwapLE32(sample4));
-            dst[5] = ((Sint32) SDL_SwapLE32(sample5));
-            dst[6] = ((Sint32) SDL_SwapLE32(sample6));
-            dst[7] = ((Sint32) SDL_SwapLE32(sample7));
-            dst += 8;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
-            sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
-            sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
-            sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-            dst++;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = ((Sint32) SDL_SwapBE32(sample1));
-        dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
-    Sint32 last_sample0 = sample0;
-    Sint32 last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-            dst[1] = ((Sint32) SDL_SwapBE32(sample1));
-            dst += 2;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
-    Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
-    Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = ((Sint32) SDL_SwapBE32(sample3));
-        dst[2] = ((Sint32) SDL_SwapBE32(sample2));
-        dst[1] = ((Sint32) SDL_SwapBE32(sample1));
-        dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
-    Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
-    Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
-    Sint32 last_sample0 = sample0;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-            dst[1] = ((Sint32) SDL_SwapBE32(sample1));
-            dst[2] = ((Sint32) SDL_SwapBE32(sample2));
-            dst[3] = ((Sint32) SDL_SwapBE32(sample3));
-            dst += 4;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 384;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
-    Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
-    Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
-    Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
-    Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 last_sample5 = sample5;
-    Sint32 last_sample4 = sample4;
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = ((Sint32) SDL_SwapBE32(sample5));
-        dst[4] = ((Sint32) SDL_SwapBE32(sample4));
-        dst[3] = ((Sint32) SDL_SwapBE32(sample3));
-        dst[2] = ((Sint32) SDL_SwapBE32(sample2));
-        dst[1] = ((Sint32) SDL_SwapBE32(sample1));
-        dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
-            sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 384;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
-    Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
-    Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
-    Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
-    Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
-    Sint32 last_sample0 = sample0;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample4 = sample4;
-    Sint32 last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-            dst[1] = ((Sint32) SDL_SwapBE32(sample1));
-            dst[2] = ((Sint32) SDL_SwapBE32(sample2));
-            dst[3] = ((Sint32) SDL_SwapBE32(sample3));
-            dst[4] = ((Sint32) SDL_SwapBE32(sample4));
-            dst[5] = ((Sint32) SDL_SwapBE32(sample5));
-            dst += 6;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
-            sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 512;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7]));
-    Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6]));
-    Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
-    Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
-    Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
-    Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
-    Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 last_sample7 = sample7;
-    Sint32 last_sample6 = sample6;
-    Sint32 last_sample5 = sample5;
-    Sint32 last_sample4 = sample4;
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = ((Sint32) SDL_SwapBE32(sample7));
-        dst[6] = ((Sint32) SDL_SwapBE32(sample6));
-        dst[5] = ((Sint32) SDL_SwapBE32(sample5));
-        dst[4] = ((Sint32) SDL_SwapBE32(sample4));
-        dst[3] = ((Sint32) SDL_SwapBE32(sample3));
-        dst[2] = ((Sint32) SDL_SwapBE32(sample2));
-        dst[1] = ((Sint32) SDL_SwapBE32(sample1));
-        dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
-            sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
-            sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
-            sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 512;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0]));
-    Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1]));
-    Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2]));
-    Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3]));
-    Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4]));
-    Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5]));
-    Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6]));
-    Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7]));
-    Sint32 last_sample0 = sample0;
-    Sint32 last_sample1 = sample1;
-    Sint32 last_sample2 = sample2;
-    Sint32 last_sample3 = sample3;
-    Sint32 last_sample4 = sample4;
-    Sint32 last_sample5 = sample5;
-    Sint32 last_sample6 = sample6;
-    Sint32 last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = ((Sint32) SDL_SwapBE32(sample0));
-            dst[1] = ((Sint32) SDL_SwapBE32(sample1));
-            dst[2] = ((Sint32) SDL_SwapBE32(sample2));
-            dst[3] = ((Sint32) SDL_SwapBE32(sample3));
-            dst[4] = ((Sint32) SDL_SwapBE32(sample4));
-            dst[5] = ((Sint32) SDL_SwapBE32(sample5));
-            dst[6] = ((Sint32) SDL_SwapBE32(sample6));
-            dst[7] = ((Sint32) SDL_SwapBE32(sample7));
-            dst += 8;
-            sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1);
-            sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1);
-            sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1);
-            sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1);
-            sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1);
-            sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1);
-            sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1);
-            sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 1;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
-    const float *target = ((const float *) cvt->buf);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = SDL_SwapFloatLE(sample0);
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatLE(sample0);
-            dst++;
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
-    const float *target = ((const float *) cvt->buf);
-    float sample1 = SDL_SwapFloatLE(src[1]);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float last_sample1 = sample1;
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = SDL_SwapFloatLE(sample1);
-        dst[0] = SDL_SwapFloatLE(sample0);
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float sample1 = SDL_SwapFloatLE(src[1]);
-    float last_sample0 = sample0;
-    float last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatLE(sample0);
-            dst[1] = SDL_SwapFloatLE(sample1);
-            dst += 2;
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
-    const float *target = ((const float *) cvt->buf);
-    float sample3 = SDL_SwapFloatLE(src[3]);
-    float sample2 = SDL_SwapFloatLE(src[2]);
-    float sample1 = SDL_SwapFloatLE(src[1]);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float last_sample3 = sample3;
-    float last_sample2 = sample2;
-    float last_sample1 = sample1;
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = SDL_SwapFloatLE(sample3);
-        dst[2] = SDL_SwapFloatLE(sample2);
-        dst[1] = SDL_SwapFloatLE(sample1);
-        dst[0] = SDL_SwapFloatLE(sample0);
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float sample1 = SDL_SwapFloatLE(src[1]);
-    float sample2 = SDL_SwapFloatLE(src[2]);
-    float sample3 = SDL_SwapFloatLE(src[3]);
-    float last_sample0 = sample0;
-    float last_sample1 = sample1;
-    float last_sample2 = sample2;
-    float last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatLE(sample0);
-            dst[1] = SDL_SwapFloatLE(sample1);
-            dst[2] = SDL_SwapFloatLE(sample2);
-            dst[3] = SDL_SwapFloatLE(sample3);
-            dst += 4;
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 384;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 6;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
-    const float *target = ((const float *) cvt->buf);
-    float sample5 = SDL_SwapFloatLE(src[5]);
-    float sample4 = SDL_SwapFloatLE(src[4]);
-    float sample3 = SDL_SwapFloatLE(src[3]);
-    float sample2 = SDL_SwapFloatLE(src[2]);
-    float sample1 = SDL_SwapFloatLE(src[1]);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float last_sample5 = sample5;
-    float last_sample4 = sample4;
-    float last_sample3 = sample3;
-    float last_sample2 = sample2;
-    float last_sample1 = sample1;
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = SDL_SwapFloatLE(sample5);
-        dst[4] = SDL_SwapFloatLE(sample4);
-        dst[3] = SDL_SwapFloatLE(sample3);
-        dst[2] = SDL_SwapFloatLE(sample2);
-        dst[1] = SDL_SwapFloatLE(sample1);
-        dst[0] = SDL_SwapFloatLE(sample0);
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
-            sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 384;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float sample1 = SDL_SwapFloatLE(src[1]);
-    float sample2 = SDL_SwapFloatLE(src[2]);
-    float sample3 = SDL_SwapFloatLE(src[3]);
-    float sample4 = SDL_SwapFloatLE(src[4]);
-    float sample5 = SDL_SwapFloatLE(src[5]);
-    float last_sample0 = sample0;
-    float last_sample1 = sample1;
-    float last_sample2 = sample2;
-    float last_sample3 = sample3;
-    float last_sample4 = sample4;
-    float last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatLE(sample0);
-            dst[1] = SDL_SwapFloatLE(sample1);
-            dst[2] = SDL_SwapFloatLE(sample2);
-            dst[3] = SDL_SwapFloatLE(sample3);
-            dst[4] = SDL_SwapFloatLE(sample4);
-            dst[5] = SDL_SwapFloatLE(sample5);
-            dst += 6;
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
-            sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 512;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 8;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
-    const float *target = ((const float *) cvt->buf);
-    float sample7 = SDL_SwapFloatLE(src[7]);
-    float sample6 = SDL_SwapFloatLE(src[6]);
-    float sample5 = SDL_SwapFloatLE(src[5]);
-    float sample4 = SDL_SwapFloatLE(src[4]);
-    float sample3 = SDL_SwapFloatLE(src[3]);
-    float sample2 = SDL_SwapFloatLE(src[2]);
-    float sample1 = SDL_SwapFloatLE(src[1]);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float last_sample7 = sample7;
-    float last_sample6 = sample6;
-    float last_sample5 = sample5;
-    float last_sample4 = sample4;
-    float last_sample3 = sample3;
-    float last_sample2 = sample2;
-    float last_sample1 = sample1;
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = SDL_SwapFloatLE(sample7);
-        dst[6] = SDL_SwapFloatLE(sample6);
-        dst[5] = SDL_SwapFloatLE(sample5);
-        dst[4] = SDL_SwapFloatLE(sample4);
-        dst[3] = SDL_SwapFloatLE(sample3);
-        dst[2] = SDL_SwapFloatLE(sample2);
-        dst[1] = SDL_SwapFloatLE(sample1);
-        dst[0] = SDL_SwapFloatLE(sample0);
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5);
-            sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5);
-            sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
-            sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 512;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatLE(src[0]);
-    float sample1 = SDL_SwapFloatLE(src[1]);
-    float sample2 = SDL_SwapFloatLE(src[2]);
-    float sample3 = SDL_SwapFloatLE(src[3]);
-    float sample4 = SDL_SwapFloatLE(src[4]);
-    float sample5 = SDL_SwapFloatLE(src[5]);
-    float sample6 = SDL_SwapFloatLE(src[6]);
-    float sample7 = SDL_SwapFloatLE(src[7]);
-    float last_sample0 = sample0;
-    float last_sample1 = sample1;
-    float last_sample2 = sample2;
-    float last_sample3 = sample3;
-    float last_sample4 = sample4;
-    float last_sample5 = sample5;
-    float last_sample6 = sample6;
-    float last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatLE(sample0);
-            dst[1] = SDL_SwapFloatLE(sample1);
-            dst[2] = SDL_SwapFloatLE(sample2);
-            dst[3] = SDL_SwapFloatLE(sample3);
-            dst[4] = SDL_SwapFloatLE(sample4);
-            dst[5] = SDL_SwapFloatLE(sample5);
-            dst[6] = SDL_SwapFloatLE(sample6);
-            dst[7] = SDL_SwapFloatLE(sample7);
-            dst += 8;
-            sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5);
-            sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5);
-            sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5);
-            sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 1;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
-    const float *target = ((const float *) cvt->buf);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[0] = SDL_SwapFloatBE(sample0);
-        dst--;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src--;
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 64;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float last_sample0 = sample0;
-    while (dst < target) {
-        src++;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatBE(sample0);
-            dst++;
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample0 = sample0;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
-    const float *target = ((const float *) cvt->buf);
-    float sample1 = SDL_SwapFloatBE(src[1]);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float last_sample1 = sample1;
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[1] = SDL_SwapFloatBE(sample1);
-        dst[0] = SDL_SwapFloatBE(sample0);
-        dst -= 2;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 2;
-            sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 128;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float sample1 = SDL_SwapFloatBE(src[1]);
-    float last_sample0 = sample0;
-    float last_sample1 = sample1;
-    while (dst < target) {
-        src += 2;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatBE(sample0);
-            dst[1] = SDL_SwapFloatBE(sample1);
-            dst += 2;
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
-    const float *target = ((const float *) cvt->buf);
-    float sample3 = SDL_SwapFloatBE(src[3]);
-    float sample2 = SDL_SwapFloatBE(src[2]);
-    float sample1 = SDL_SwapFloatBE(src[1]);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float last_sample3 = sample3;
-    float last_sample2 = sample2;
-    float last_sample1 = sample1;
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[3] = SDL_SwapFloatBE(sample3);
-        dst[2] = SDL_SwapFloatBE(sample2);
-        dst[1] = SDL_SwapFloatBE(sample1);
-        dst[0] = SDL_SwapFloatBE(sample0);
-        dst -= 4;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 4;
-            sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 256;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float sample1 = SDL_SwapFloatBE(src[1]);
-    float sample2 = SDL_SwapFloatBE(src[2]);
-    float sample3 = SDL_SwapFloatBE(src[3]);
-    float last_sample0 = sample0;
-    float last_sample1 = sample1;
-    float last_sample2 = sample2;
-    float last_sample3 = sample3;
-    while (dst < target) {
-        src += 4;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatBE(sample0);
-            dst[1] = SDL_SwapFloatBE(sample1);
-            dst[2] = SDL_SwapFloatBE(sample2);
-            dst[3] = SDL_SwapFloatBE(sample3);
-            dst += 4;
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 384;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 6;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
-    const float *target = ((const float *) cvt->buf);
-    float sample5 = SDL_SwapFloatBE(src[5]);
-    float sample4 = SDL_SwapFloatBE(src[4]);
-    float sample3 = SDL_SwapFloatBE(src[3]);
-    float sample2 = SDL_SwapFloatBE(src[2]);
-    float sample1 = SDL_SwapFloatBE(src[1]);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float last_sample5 = sample5;
-    float last_sample4 = sample4;
-    float last_sample3 = sample3;
-    float last_sample2 = sample2;
-    float last_sample1 = sample1;
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[5] = SDL_SwapFloatBE(sample5);
-        dst[4] = SDL_SwapFloatBE(sample4);
-        dst[3] = SDL_SwapFloatBE(sample3);
-        dst[2] = SDL_SwapFloatBE(sample2);
-        dst[1] = SDL_SwapFloatBE(sample1);
-        dst[0] = SDL_SwapFloatBE(sample0);
-        dst -= 6;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 6;
-            sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
-            sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 384;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float sample1 = SDL_SwapFloatBE(src[1]);
-    float sample2 = SDL_SwapFloatBE(src[2]);
-    float sample3 = SDL_SwapFloatBE(src[3]);
-    float sample4 = SDL_SwapFloatBE(src[4]);
-    float sample5 = SDL_SwapFloatBE(src[5]);
-    float last_sample0 = sample0;
-    float last_sample1 = sample1;
-    float last_sample2 = sample2;
-    float last_sample3 = sample3;
-    float last_sample4 = sample4;
-    float last_sample5 = sample5;
-    while (dst < target) {
-        src += 6;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatBE(sample0);
-            dst[1] = SDL_SwapFloatBE(sample1);
-            dst[2] = SDL_SwapFloatBE(sample2);
-            dst[3] = SDL_SwapFloatBE(sample3);
-            dst[4] = SDL_SwapFloatBE(sample4);
-            dst[5] = SDL_SwapFloatBE(sample5);
-            dst += 6;
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
-            sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 512;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 8;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
-    const float *target = ((const float *) cvt->buf);
-    float sample7 = SDL_SwapFloatBE(src[7]);
-    float sample6 = SDL_SwapFloatBE(src[6]);
-    float sample5 = SDL_SwapFloatBE(src[5]);
-    float sample4 = SDL_SwapFloatBE(src[4]);
-    float sample3 = SDL_SwapFloatBE(src[3]);
-    float sample2 = SDL_SwapFloatBE(src[2]);
-    float sample1 = SDL_SwapFloatBE(src[1]);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float last_sample7 = sample7;
-    float last_sample6 = sample6;
-    float last_sample5 = sample5;
-    float last_sample4 = sample4;
-    float last_sample3 = sample3;
-    float last_sample2 = sample2;
-    float last_sample1 = sample1;
-    float last_sample0 = sample0;
-    while (dst >= target) {
-        dst[7] = SDL_SwapFloatBE(sample7);
-        dst[6] = SDL_SwapFloatBE(sample6);
-        dst[5] = SDL_SwapFloatBE(sample5);
-        dst[4] = SDL_SwapFloatBE(sample4);
-        dst[3] = SDL_SwapFloatBE(sample3);
-        dst[2] = SDL_SwapFloatBE(sample2);
-        dst[1] = SDL_SwapFloatBE(sample1);
-        dst[0] = SDL_SwapFloatBE(sample0);
-        dst -= 8;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            src -= 8;
-            sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5);
-            sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5);
-            sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
-            sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            last_sample7 = sample7;
-            last_sample6 = sample6;
-            last_sample5 = sample5;
-            last_sample4 = sample4;
-            last_sample3 = sample3;
-            last_sample2 = sample2;
-            last_sample1 = sample1;
-            last_sample0 = sample0;
-            eps -= dstsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - 512;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    float sample0 = SDL_SwapFloatBE(src[0]);
-    float sample1 = SDL_SwapFloatBE(src[1]);
-    float sample2 = SDL_SwapFloatBE(src[2]);
-    float sample3 = SDL_SwapFloatBE(src[3]);
-    float sample4 = SDL_SwapFloatBE(src[4]);
-    float sample5 = SDL_SwapFloatBE(src[5]);
-    float sample6 = SDL_SwapFloatBE(src[6]);
-    float sample7 = SDL_SwapFloatBE(src[7]);
-    float last_sample0 = sample0;
-    float last_sample1 = sample1;
-    float last_sample2 = sample2;
-    float last_sample3 = sample3;
-    float last_sample4 = sample4;
-    float last_sample5 = sample5;
-    float last_sample6 = sample6;
-    float last_sample7 = sample7;
-    while (dst < target) {
-        src += 8;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-            dst[0] = SDL_SwapFloatBE(sample0);
-            dst[1] = SDL_SwapFloatBE(sample1);
-            dst[2] = SDL_SwapFloatBE(sample2);
-            dst[3] = SDL_SwapFloatBE(sample3);
-            dst[4] = SDL_SwapFloatBE(sample4);
-            dst[5] = SDL_SwapFloatBE(sample5);
-            dst[6] = SDL_SwapFloatBE(sample6);
-            dst[7] = SDL_SwapFloatBE(sample7);
-            dst += 8;
-            sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5);
-            sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5);
-            sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5);
-            sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5);
-            sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5);
-            sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5);
-            sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5);
-            sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5);
-            last_sample0 = sample0;
-            last_sample1 = sample1;
-            last_sample2 = sample2;
-            last_sample3 = sample3;
-            last_sample4 = sample4;
-            last_sample5 = sample5;
-            last_sample6 = sample6;
-            last_sample7 = sample7;
-            eps -= srcsize;
-        }
-    }
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-
-#if !LESS_RESAMPLERS
-
-static void SDLCALL
-SDL_Upsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U8, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1 * 2;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        src--;
-        dst[1] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Uint8) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U8, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        src += 2;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U8, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1 * 4;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        src--;
-        dst[3] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[2] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[0] = (Uint8) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U8, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        src += 4;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U8, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2 * 2;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample0 = (Sint16) src[0];
-        src -= 2;
-        dst[3] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) sample1;
-        dst[0] = (Uint8) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U8, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    Sint16 last_sample1 = (Sint16) src[1];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        const Sint16 sample1 = (Sint16) src[1];
-        src += 4;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U8, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2 * 4;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample0 = (Sint16) src[0];
-        src -= 2;
-        dst[7] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[6] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[5] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[2] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Uint8) sample1;
-        dst[0] = (Uint8) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U8, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    Sint16 last_sample1 = (Sint16) src[1];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        const Sint16 sample1 = (Sint16) src[1];
-        src += 8;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U8, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4 * 2;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample0 = (Sint16) src[0];
-        src -= 4;
-        dst[7] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Uint8) sample3;
-        dst[2] = (Uint8) sample2;
-        dst[1] = (Uint8) sample1;
-        dst[0] = (Uint8) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U8, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample3 = (Sint16) src[3];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample3 = (Sint16) src[3];
-        src += 8;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U8, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4 * 4;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample0 = (Sint16) src[0];
-        src -= 4;
-        dst[15] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[14] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[13] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[12] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[11] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[6] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[5] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Uint8) sample3;
-        dst[2] = (Uint8) sample2;
-        dst[1] = (Uint8) sample1;
-        dst[0] = (Uint8) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U8, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample3 = (Sint16) src[3];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample3 = (Sint16) src[3];
-        src += 16;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U8, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6 * 2;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample5 = (Sint16) src[5];
-    Sint16 last_sample4 = (Sint16) src[4];
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample5 = (Sint16) src[5];
-        const Sint16 sample4 = (Sint16) src[4];
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample0 = (Sint16) src[0];
-        src -= 6;
-        dst[11] = (Uint8) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Uint8) sample5;
-        dst[4] = (Uint8) sample4;
-        dst[3] = (Uint8) sample3;
-        dst[2] = (Uint8) sample2;
-        dst[1] = (Uint8) sample1;
-        dst[0] = (Uint8) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U8, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample4 = (Sint16) src[4];
-    Sint16 last_sample5 = (Sint16) src[5];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample4 = (Sint16) src[4];
-        const Sint16 sample5 = (Sint16) src[5];
-        src += 12;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U8, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6 * 4;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample5 = (Sint16) src[5];
-    Sint16 last_sample4 = (Sint16) src[4];
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample5 = (Sint16) src[5];
-        const Sint16 sample4 = (Sint16) src[4];
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample0 = (Sint16) src[0];
-        src -= 6;
-        dst[23] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[22] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[21] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[20] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[19] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[18] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[17] = (Uint8) ((sample5 + last_sample5) >> 1);
-        dst[16] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[15] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[14] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[13] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[12] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[11] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
-        dst[10] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
-        dst[9] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[8] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[7] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[6] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[5] = (Uint8) sample5;
-        dst[4] = (Uint8) sample4;
-        dst[3] = (Uint8) sample3;
-        dst[2] = (Uint8) sample2;
-        dst[1] = (Uint8) sample1;
-        dst[0] = (Uint8) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U8, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample4 = (Sint16) src[4];
-    Sint16 last_sample5 = (Sint16) src[5];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample4 = (Sint16) src[4];
-        const Sint16 sample5 = (Sint16) src[5];
-        src += 24;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U8, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8 * 2;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample7 = (Sint16) src[7];
-    Sint16 last_sample6 = (Sint16) src[6];
-    Sint16 last_sample5 = (Sint16) src[5];
-    Sint16 last_sample4 = (Sint16) src[4];
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample7 = (Sint16) src[7];
-        const Sint16 sample6 = (Sint16) src[6];
-        const Sint16 sample5 = (Sint16) src[5];
-        const Sint16 sample4 = (Sint16) src[4];
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample0 = (Sint16) src[0];
-        src -= 8;
-        dst[15] = (Uint8) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Uint8) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Uint8) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Uint8) sample7;
-        dst[6] = (Uint8) sample6;
-        dst[5] = (Uint8) sample5;
-        dst[4] = (Uint8) sample4;
-        dst[3] = (Uint8) sample3;
-        dst[2] = (Uint8) sample2;
-        dst[1] = (Uint8) sample1;
-        dst[0] = (Uint8) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U8, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample4 = (Sint16) src[4];
-    Sint16 last_sample5 = (Sint16) src[5];
-    Sint16 last_sample6 = (Sint16) src[6];
-    Sint16 last_sample7 = (Sint16) src[7];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample4 = (Sint16) src[4];
-        const Sint16 sample5 = (Sint16) src[5];
-        const Sint16 sample6 = (Sint16) src[6];
-        const Sint16 sample7 = (Sint16) src[7];
-        src += 16;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Uint8) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Uint8) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U8, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8 * 4;
-    const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Uint8 *target = ((const Uint8 *) cvt->buf);
-    Sint16 last_sample7 = (Sint16) src[7];
-    Sint16 last_sample6 = (Sint16) src[6];
-    Sint16 last_sample5 = (Sint16) src[5];
-    Sint16 last_sample4 = (Sint16) src[4];
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample0 = (Sint16) src[0];
-    while (dst >= target) {
-        const Sint16 sample7 = (Sint16) src[7];
-        const Sint16 sample6 = (Sint16) src[6];
-        const Sint16 sample5 = (Sint16) src[5];
-        const Sint16 sample4 = (Sint16) src[4];
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample0 = (Sint16) src[0];
-        src -= 8;
-        dst[31] = (Uint8) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[30] = (Uint8) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[29] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[28] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[27] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[26] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[25] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[24] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[23] = (Uint8) ((sample7 + last_sample7) >> 1);
-        dst[22] = (Uint8) ((sample6 + last_sample6) >> 1);
-        dst[21] = (Uint8) ((sample5 + last_sample5) >> 1);
-        dst[20] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[19] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[18] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[17] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[16] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[15] = (Uint8) (((3 * sample7) + last_sample7) >> 2);
-        dst[14] = (Uint8) (((3 * sample6) + last_sample6) >> 2);
-        dst[13] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
-        dst[12] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
-        dst[11] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Uint8) sample7;
-        dst[6] = (Uint8) sample6;
-        dst[5] = (Uint8) sample5;
-        dst[4] = (Uint8) sample4;
-        dst[3] = (Uint8) sample3;
-        dst[2] = (Uint8) sample2;
-        dst[1] = (Uint8) sample1;
-        dst[0] = (Uint8) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U8, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint8 *dst = (Uint8 *) cvt->buf;
-    const Uint8 *src = (Uint8 *) cvt->buf;
-    const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) src[0];
-    Sint16 last_sample1 = (Sint16) src[1];
-    Sint16 last_sample2 = (Sint16) src[2];
-    Sint16 last_sample3 = (Sint16) src[3];
-    Sint16 last_sample4 = (Sint16) src[4];
-    Sint16 last_sample5 = (Sint16) src[5];
-    Sint16 last_sample6 = (Sint16) src[6];
-    Sint16 last_sample7 = (Sint16) src[7];
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) src[0];
-        const Sint16 sample1 = (Sint16) src[1];
-        const Sint16 sample2 = (Sint16) src[2];
-        const Sint16 sample3 = (Sint16) src[3];
-        const Sint16 sample4 = (Sint16) src[4];
-        const Sint16 sample5 = (Sint16) src[5];
-        const Sint16 sample6 = (Sint16) src[6];
-        const Sint16 sample7 = (Sint16) src[7];
-        src += 32;
-        dst[0] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint8) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Uint8) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Uint8) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S8, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1 * 2;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src--;
-        dst[1] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint8) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S8, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src += 2;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S8, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1 * 4;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src--;
-        dst[3] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[2] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[0] = (Sint8) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S8, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src += 4;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S8, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2 * 2;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src -= 2;
-        dst[3] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) sample1;
-        dst[0] = (Sint8) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S8, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        src += 4;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S8, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2 * 4;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src -= 2;
-        dst[7] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[6] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[5] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[2] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint8) sample1;
-        dst[0] = (Sint8) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S8, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        src += 8;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S8, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4 * 2;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src -= 4;
-        dst[7] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint8) sample3;
-        dst[2] = (Sint8) sample2;
-        dst[1] = (Sint8) sample1;
-        dst[0] = (Sint8) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S8, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        src += 8;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S8, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4 * 4;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src -= 4;
-        dst[15] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[14] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[13] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[12] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[11] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[6] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[5] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint8) sample3;
-        dst[2] = (Sint8) sample2;
-        dst[1] = (Sint8) sample1;
-        dst[0] = (Sint8) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S8, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        src += 16;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S8, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6 * 2;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
-        const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src -= 6;
-        dst[11] = (Sint8) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint8) sample5;
-        dst[4] = (Sint8) sample4;
-        dst[3] = (Sint8) sample3;
-        dst[2] = (Sint8) sample2;
-        dst[1] = (Sint8) sample1;
-        dst[0] = (Sint8) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S8, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
-    Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
-        const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
-        src += 12;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S8, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6 * 4;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
-        const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src -= 6;
-        dst[23] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[22] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[21] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[20] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[19] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[18] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[17] = (Sint8) ((sample5 + last_sample5) >> 1);
-        dst[16] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[15] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[14] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[13] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[12] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[11] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
-        dst[10] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
-        dst[9] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[8] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[7] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[6] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[5] = (Sint8) sample5;
-        dst[4] = (Sint8) sample4;
-        dst[3] = (Sint8) sample3;
-        dst[2] = (Sint8) sample2;
-        dst[1] = (Sint8) sample1;
-        dst[0] = (Sint8) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S8, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
-    Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
-        const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
-        src += 24;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S8, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8 * 2;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
-    Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
-    Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
-        const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
-        const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
-        const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src -= 8;
-        dst[15] = (Sint8) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint8) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint8) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint8) sample7;
-        dst[6] = (Sint8) sample6;
-        dst[5] = (Sint8) sample5;
-        dst[4] = (Sint8) sample4;
-        dst[3] = (Sint8) sample3;
-        dst[2] = (Sint8) sample2;
-        dst[1] = (Sint8) sample1;
-        dst[0] = (Sint8) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S8, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
-    Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
-    Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
-        const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
-        const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
-        const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
-        src += 16;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint8) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint8) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S8, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8 * 4;
-    const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint8 *target = ((const Sint8 *) cvt->buf);
-    Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
-    Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
-    Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    while (dst >= target) {
-        const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
-        const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
-        const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
-        const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        src -= 8;
-        dst[31] = (Sint8) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[30] = (Sint8) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[29] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[28] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[27] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[26] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[25] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[24] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[23] = (Sint8) ((sample7 + last_sample7) >> 1);
-        dst[22] = (Sint8) ((sample6 + last_sample6) >> 1);
-        dst[21] = (Sint8) ((sample5 + last_sample5) >> 1);
-        dst[20] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[19] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[18] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[17] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[16] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[15] = (Sint8) (((3 * sample7) + last_sample7) >> 2);
-        dst[14] = (Sint8) (((3 * sample6) + last_sample6) >> 2);
-        dst[13] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
-        dst[12] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
-        dst[11] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint8) sample7;
-        dst[6] = (Sint8) sample6;
-        dst[5] = (Sint8) sample5;
-        dst[4] = (Sint8) sample4;
-        dst[3] = (Sint8) sample3;
-        dst[2] = (Sint8) sample2;
-        dst[1] = (Sint8) sample1;
-        dst[0] = (Sint8) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S8, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint8 *dst = (Sint8 *) cvt->buf;
-    const Sint8 *src = (Sint8 *) cvt->buf;
-    const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize);
-    Sint16 last_sample0 = (Sint16) ((Sint8) src[0]);
-    Sint16 last_sample1 = (Sint16) ((Sint8) src[1]);
-    Sint16 last_sample2 = (Sint16) ((Sint8) src[2]);
-    Sint16 last_sample3 = (Sint16) ((Sint8) src[3]);
-    Sint16 last_sample4 = (Sint16) ((Sint8) src[4]);
-    Sint16 last_sample5 = (Sint16) ((Sint8) src[5]);
-    Sint16 last_sample6 = (Sint16) ((Sint8) src[6]);
-    Sint16 last_sample7 = (Sint16) ((Sint8) src[7]);
-    while (dst < target) {
-        const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
-        const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
-        const Sint16 sample2 = (Sint16) ((Sint8) src[2]);
-        const Sint16 sample3 = (Sint16) ((Sint8) src[3]);
-        const Sint16 sample4 = (Sint16) ((Sint8) src[4]);
-        const Sint16 sample5 = (Sint16) ((Sint8) src[5]);
-        const Sint16 sample6 = (Sint16) ((Sint8) src[6]);
-        const Sint16 sample7 = (Sint16) ((Sint8) src[7]);
-        src += 32;
-        dst[0] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint8) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint8) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint8) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src--;
-        dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Uint16) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src += 2;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src--;
-        dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[0] = (Uint16) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src += 4;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src -= 2;
-        dst[3] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        src += 4;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src -= 2;
-        dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        src += 8;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src -= 4;
-        dst[7] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        src += 8;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src -= 4;
-        dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        src += 16;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
-        const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src -= 6;
-        dst[11] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Uint16) sample5;
-        dst[4] = (Uint16) sample4;
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
-        const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
-        src += 12;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
-        const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src -= 6;
-        dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[17] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[16] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[15] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[14] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[13] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[12] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[5] = (Uint16) sample5;
-        dst[4] = (Uint16) sample4;
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
-        const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
-        src += 24;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
-    Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
-        const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
-        const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
-        const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src -= 8;
-        dst[15] = (Uint16) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Uint16) sample7;
-        dst[6] = (Uint16) sample6;
-        dst[5] = (Uint16) sample5;
-        dst[4] = (Uint16) sample4;
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
-    Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
-        const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
-        const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
-        const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
-        src += 16;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
-    Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
-        const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
-        const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
-        const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        src -= 8;
-        dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[23] = (Uint16) ((sample7 + last_sample7) >> 1);
-        dst[22] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[21] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[20] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[19] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[18] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[17] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[16] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
-        dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
-        dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Uint16) sample7;
-        dst[6] = (Uint16) sample6;
-        dst[5] = (Uint16) sample5;
-        dst[4] = (Uint16) sample4;
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]);
-    Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]);
-    Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]);
-        const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]);
-        const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]);
-        const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]);
-        const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]);
-        src += 32;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src--;
-        dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint16) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src += 2;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src--;
-        dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[0] = (Sint16) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src += 4;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src -= 2;
-        dst[3] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        src += 4;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src -= 2;
-        dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        src += 8;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src -= 4;
-        dst[7] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        src += 8;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src -= 4;
-        dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        src += 16;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src -= 6;
-        dst[11] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint16) sample5;
-        dst[4] = (Sint16) sample4;
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-        src += 12;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src -= 6;
-        dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[17] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[16] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[15] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[14] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[13] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[12] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[5] = (Sint16) sample5;
-        dst[4] = (Sint16) sample4;
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-        src += 24;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-    Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-        const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src -= 8;
-        dst[15] = (Sint16) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint16) sample7;
-        dst[6] = (Sint16) sample6;
-        dst[5] = (Sint16) sample5;
-        dst[4] = (Sint16) sample4;
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
-    Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-        const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
-        const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-        src += 16;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-    Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-        const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        src -= 8;
-        dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[23] = (Sint16) ((sample7 + last_sample7) >> 1);
-        dst[22] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[21] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[20] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[19] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[18] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[17] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[16] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
-        dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
-        dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint16) sample7;
-        dst[6] = (Sint16) sample6;
-        dst[5] = (Sint16) sample5;
-        dst[4] = (Sint16) sample4;
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-    Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
-    Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5]));
-        const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6]));
-        const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7]));
-        src += 32;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src--;
-        dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Uint16) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src += 2;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src--;
-        dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[0] = (Uint16) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src += 4;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src -= 2;
-        dst[3] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        src += 4;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src -= 2;
-        dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        src += 8;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src -= 4;
-        dst[7] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        src += 8;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src -= 4;
-        dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        src += 16;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
-        const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src -= 6;
-        dst[11] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Uint16) sample5;
-        dst[4] = (Uint16) sample4;
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
-        const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
-        src += 12;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
-        const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src -= 6;
-        dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[17] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[16] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[15] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[14] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[13] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[12] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[5] = (Uint16) sample5;
-        dst[4] = (Uint16) sample4;
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
-        const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
-        src += 24;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 2;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
-    Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
-        const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
-        const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
-        const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src -= 8;
-        dst[15] = (Uint16) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Uint16) sample7;
-        dst[6] = (Uint16) sample6;
-        dst[5] = (Uint16) sample5;
-        dst[4] = (Uint16) sample4;
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
-    Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
-        const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
-        const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
-        const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
-        src += 16;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 4;
-    const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Uint16 *target = ((const Uint16 *) cvt->buf);
-    Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
-    Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    while (dst >= target) {
-        const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
-        const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
-        const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
-        const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        src -= 8;
-        dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[23] = (Uint16) ((sample7 + last_sample7) >> 1);
-        dst[22] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[21] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[20] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[19] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[18] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[17] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[16] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
-        dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
-        dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Uint16) sample7;
-        dst[6] = (Uint16) sample6;
-        dst[5] = (Uint16) sample5;
-        dst[4] = (Uint16) sample4;
-        dst[3] = (Uint16) sample3;
-        dst[2] = (Uint16) sample2;
-        dst[1] = (Uint16) sample1;
-        dst[0] = (Uint16) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Uint16 *dst = (Uint16 *) cvt->buf;
-    const Uint16 *src = (Uint16 *) cvt->buf;
-    const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]);
-    Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]);
-    Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]);
-    Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]);
-    Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]);
-    Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]);
-    Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]);
-    Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]);
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
-        const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
-        const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]);
-        const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]);
-        const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]);
-        const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]);
-        const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]);
-        const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]);
-        src += 32;
-        dst[0] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Uint16) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src--;
-        dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint16) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src += 2;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src--;
-        dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[0] = (Sint16) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src += 4;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src -= 2;
-        dst[3] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        src += 4;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src -= 2;
-        dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        src += 8;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src -= 4;
-        dst[7] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        src += 8;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src -= 4;
-        dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        src += 16;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src -= 6;
-        dst[11] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint16) sample5;
-        dst[4] = (Sint16) sample4;
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-        src += 12;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src -= 6;
-        dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[17] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[16] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[15] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[14] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[13] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[12] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[5] = (Sint16) sample5;
-        dst[4] = (Sint16) sample4;
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-        src += 24;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 2;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-    Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-        const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src -= 8;
-        dst[15] = (Sint16) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint16) sample7;
-        dst[6] = (Sint16) sample6;
-        dst[5] = (Sint16) sample5;
-        dst[4] = (Sint16) sample4;
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
-    Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-        const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
-        const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-        src += 16;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 4;
-    const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint16 *target = ((const Sint16 *) cvt->buf);
-    Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-    Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    while (dst >= target) {
-        const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-        const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        src -= 8;
-        dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[23] = (Sint16) ((sample7 + last_sample7) >> 1);
-        dst[22] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[21] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[20] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[19] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[18] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[17] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[16] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
-        dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
-        dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint16) sample7;
-        dst[6] = (Sint16) sample6;
-        dst[5] = (Sint16) sample5;
-        dst[4] = (Sint16) sample4;
-        dst[3] = (Sint16) sample3;
-        dst[2] = (Sint16) sample2;
-        dst[1] = (Sint16) sample1;
-        dst[0] = (Sint16) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint16 *dst = (Sint16 *) cvt->buf;
-    const Sint16 *src = (Sint16 *) cvt->buf;
-    const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize);
-    Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-    Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-    Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-    Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-    Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-    Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-    Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
-    Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-    while (dst < target) {
-        const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
-        const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
-        const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2]));
-        const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3]));
-        const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4]));
-        const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5]));
-        const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6]));
-        const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7]));
-        src += 32;
-        dst[0] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint16) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src--;
-        dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint32) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src += 2;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src--;
-        dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[0] = (Sint32) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src += 4;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src -= 2;
-        dst[3] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        src += 4;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src -= 2;
-        dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        src += 8;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src -= 4;
-        dst[7] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        src += 8;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src -= 4;
-        dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        src += 16;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src -= 6;
-        dst[11] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint32) sample5;
-        dst[4] = (Sint32) sample4;
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-        src += 12;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src -= 6;
-        dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[17] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[16] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[15] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[14] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[13] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[12] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
-        dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
-        dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[5] = (Sint32) sample5;
-        dst[4] = (Sint32) sample4;
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-        src += 24;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-    Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-        const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src -= 8;
-        dst[15] = (Sint32) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint32) sample7;
-        dst[6] = (Sint32) sample6;
-        dst[5] = (Sint32) sample5;
-        dst[4] = (Sint32) sample4;
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
-    Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-        const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
-        const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-        src += 16;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-    Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-        const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        src -= 8;
-        dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[23] = (Sint32) ((sample7 + last_sample7) >> 1);
-        dst[22] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[21] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[20] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[19] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[18] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[17] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[16] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
-        dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
-        dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
-        dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
-        dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint32) sample7;
-        dst[6] = (Sint32) sample6;
-        dst[5] = (Sint32) sample5;
-        dst[4] = (Sint32) sample4;
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-    Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
-    Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5]));
-        const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6]));
-        const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7]));
-        src += 32;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src--;
-        dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint32) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src += 2;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src--;
-        dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[0] = (Sint32) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src += 4;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src -= 2;
-        dst[3] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        src += 4;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src -= 2;
-        dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        src += 8;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src -= 4;
-        dst[7] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        src += 8;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src -= 4;
-        dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        src += 16;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src -= 6;
-        dst[11] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint32) sample5;
-        dst[4] = (Sint32) sample4;
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-        src += 12;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src -= 6;
-        dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[17] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[16] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[15] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[14] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[13] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[12] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
-        dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
-        dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[5] = (Sint32) sample5;
-        dst[4] = (Sint32) sample4;
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-        src += 24;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 2;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-    Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-        const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src -= 8;
-        dst[15] = (Sint32) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint32) sample7;
-        dst[6] = (Sint32) sample6;
-        dst[5] = (Sint32) sample5;
-        dst[4] = (Sint32) sample4;
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
-    Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-        const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
-        const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-        src += 16;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 4;
-    const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
-    const Sint32 *target = ((const Sint32 *) cvt->buf);
-    Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-    Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    while (dst >= target) {
-        const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-        const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        src -= 8;
-        dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
-        dst[23] = (Sint32) ((sample7 + last_sample7) >> 1);
-        dst[22] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[21] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[20] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[19] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[18] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[17] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[16] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
-        dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
-        dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
-        dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
-        dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint32) sample7;
-        dst[6] = (Sint32) sample6;
-        dst[5] = (Sint32) sample5;
-        dst[4] = (Sint32) sample4;
-        dst[3] = (Sint32) sample3;
-        dst[2] = (Sint32) sample2;
-        dst[1] = (Sint32) sample1;
-        dst[0] = (Sint32) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    Sint32 *dst = (Sint32 *) cvt->buf;
-    const Sint32 *src = (Sint32 *) cvt->buf;
-    const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize);
-    Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-    Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-    Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-    Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-    Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-    Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-    Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
-    Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-    while (dst < target) {
-        const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
-        const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
-        const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2]));
-        const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3]));
-        const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4]));
-        const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5]));
-        const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6]));
-        const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7]));
-        src += 32;
-        dst[0] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[3] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[4] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[5] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[6] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[7] = (Sint32) ((sample7 + last_sample7) >> 1);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src--;
-        dst[1] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[0] = (float) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src += 2;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src--;
-        dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[2] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[0] = (float) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src += 4;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src -= 2;
-        dst[3] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        src += 4;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src -= 2;
-        dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[5] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[4] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        src += 8;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src -= 4;
-        dst[7] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[6] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[5] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[4] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        src += 8;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src -= 4;
-        dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[11] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[10] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[9] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[8] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        src += 16;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample5 = (double) SDL_SwapFloatLE(src[5]);
-        const double sample4 = (double) SDL_SwapFloatLE(src[4]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src -= 6;
-        dst[11] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[10] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[9] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[8] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[7] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[6] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[5] = (float) sample5;
-        dst[4] = (float) sample4;
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
-    double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample4 = (double) SDL_SwapFloatLE(src[4]);
-        const double sample5 = (double) SDL_SwapFloatLE(src[5]);
-        src += 12;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[4] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[5] = (float) ((sample5 + last_sample5) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample5 = (double) SDL_SwapFloatLE(src[5]);
-        const double sample4 = (double) SDL_SwapFloatLE(src[4]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src -= 6;
-        dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
-        dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
-        dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[17] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[16] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[15] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[14] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[13] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[12] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
-        dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
-        dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[5] = (float) sample5;
-        dst[4] = (float) sample4;
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
-    double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample4 = (double) SDL_SwapFloatLE(src[4]);
-        const double sample5 = (double) SDL_SwapFloatLE(src[5]);
-        src += 24;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[4] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[5] = (float) ((sample5 + last_sample5) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
-    double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
-    double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample7 = (double) SDL_SwapFloatLE(src[7]);
-        const double sample6 = (double) SDL_SwapFloatLE(src[6]);
-        const double sample5 = (double) SDL_SwapFloatLE(src[5]);
-        const double sample4 = (double) SDL_SwapFloatLE(src[4]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src -= 8;
-        dst[15] = (float) ((sample7 + last_sample7) * 0.5);
-        dst[14] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[13] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[12] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[11] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[10] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[9] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[8] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[7] = (float) sample7;
-        dst[6] = (float) sample6;
-        dst[5] = (float) sample5;
-        dst[4] = (float) sample4;
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
-    double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
-    double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample4 = (double) SDL_SwapFloatLE(src[4]);
-        const double sample5 = (double) SDL_SwapFloatLE(src[5]);
-        const double sample6 = (double) SDL_SwapFloatLE(src[6]);
-        const double sample7 = (double) SDL_SwapFloatLE(src[7]);
-        src += 16;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[4] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[5] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[6] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[7] = (float) ((sample7 + last_sample7) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
-    double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
-    double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    while (dst >= target) {
-        const double sample7 = (double) SDL_SwapFloatLE(src[7]);
-        const double sample6 = (double) SDL_SwapFloatLE(src[6]);
-        const double sample5 = (double) SDL_SwapFloatLE(src[5]);
-        const double sample4 = (double) SDL_SwapFloatLE(src[4]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        src -= 8;
-        dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
-        dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
-        dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
-        dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
-        dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[23] = (float) ((sample7 + last_sample7) * 0.5);
-        dst[22] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[21] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[20] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[19] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[18] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[17] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[16] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
-        dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
-        dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
-        dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
-        dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[7] = (float) sample7;
-        dst[6] = (float) sample6;
-        dst[5] = (float) sample5;
-        dst[4] = (float) sample4;
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatLE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatLE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatLE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatLE(src[3]);
-    double last_sample4 = (double) SDL_SwapFloatLE(src[4]);
-    double last_sample5 = (double) SDL_SwapFloatLE(src[5]);
-    double last_sample6 = (double) SDL_SwapFloatLE(src[6]);
-    double last_sample7 = (double) SDL_SwapFloatLE(src[7]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatLE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatLE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatLE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatLE(src[3]);
-        const double sample4 = (double) SDL_SwapFloatLE(src[4]);
-        const double sample5 = (double) SDL_SwapFloatLE(src[5]);
-        const double sample6 = (double) SDL_SwapFloatLE(src[6]);
-        const double sample7 = (double) SDL_SwapFloatLE(src[7]);
-        src += 32;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[4] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[5] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[6] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[7] = (float) ((sample7 + last_sample7) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src--;
-        dst[1] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[0] = (float) sample0;
-        last_sample0 = sample0;
-        dst -= 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src += 2;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src--;
-        dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[2] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[0] = (float) sample0;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 1 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src += 4;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        last_sample0 = sample0;
-        dst++;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src -= 2;
-        dst[3] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        src += 4;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src -= 2;
-        dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[5] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[4] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 2 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        src += 8;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        dst += 2;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src -= 4;
-        dst[7] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[6] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[5] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[4] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        src += 8;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src -= 4;
-        dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[11] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[10] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[9] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[8] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 4 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        src += 16;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        dst += 4;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample5 = (double) SDL_SwapFloatBE(src[5]);
-        const double sample4 = (double) SDL_SwapFloatBE(src[4]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src -= 6;
-        dst[11] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[10] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[9] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[8] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[7] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[6] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[5] = (float) sample5;
-        dst[4] = (float) sample4;
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 12;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
-    double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample4 = (double) SDL_SwapFloatBE(src[4]);
-        const double sample5 = (double) SDL_SwapFloatBE(src[5]);
-        src += 12;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[4] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[5] = (float) ((sample5 + last_sample5) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample5 = (double) SDL_SwapFloatBE(src[5]);
-        const double sample4 = (double) SDL_SwapFloatBE(src[4]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src -= 6;
-        dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
-        dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
-        dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[17] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[16] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[15] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[14] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[13] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[12] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
-        dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
-        dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[5] = (float) sample5;
-        dst[4] = (float) sample4;
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 24;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 6 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
-    double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample4 = (double) SDL_SwapFloatBE(src[4]);
-        const double sample5 = (double) SDL_SwapFloatBE(src[5]);
-        src += 24;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[4] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[5] = (float) ((sample5 + last_sample5) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        dst += 6;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 2;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 2;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
-    double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
-    double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample7 = (double) SDL_SwapFloatBE(src[7]);
-        const double sample6 = (double) SDL_SwapFloatBE(src[6]);
-        const double sample5 = (double) SDL_SwapFloatBE(src[5]);
-        const double sample4 = (double) SDL_SwapFloatBE(src[4]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src -= 8;
-        dst[15] = (float) ((sample7 + last_sample7) * 0.5);
-        dst[14] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[13] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[12] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[11] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[10] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[9] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[8] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[7] = (float) sample7;
-        dst[6] = (float) sample6;
-        dst[5] = (float) sample5;
-        dst[4] = (float) sample4;
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 16;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 2;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
-    double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
-    double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample4 = (double) SDL_SwapFloatBE(src[4]);
-        const double sample5 = (double) SDL_SwapFloatBE(src[5]);
-        const double sample6 = (double) SDL_SwapFloatBE(src[6]);
-        const double sample7 = (double) SDL_SwapFloatBE(src[7]);
-        src += 16;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[4] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[5] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[6] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[7] = (float) ((sample7 + last_sample7) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Upsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt * 4;
-    float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 4;
-    const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
-    const float *target = ((const float *) cvt->buf);
-    double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
-    double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
-    double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    while (dst >= target) {
-        const double sample7 = (double) SDL_SwapFloatBE(src[7]);
-        const double sample6 = (double) SDL_SwapFloatBE(src[6]);
-        const double sample5 = (double) SDL_SwapFloatBE(src[5]);
-        const double sample4 = (double) SDL_SwapFloatBE(src[4]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        src -= 8;
-        dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
-        dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
-        dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
-        dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
-        dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
-        dst[23] = (float) ((sample7 + last_sample7) * 0.5);
-        dst[22] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[21] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[20] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[19] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[18] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[17] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[16] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
-        dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
-        dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
-        dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
-        dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[7] = (float) sample7;
-        dst[6] = (float) sample6;
-        dst[5] = (float) sample5;
-        dst[4] = (float) sample4;
-        dst[3] = (float) sample3;
-        dst[2] = (float) sample2;
-        dst[1] = (float) sample1;
-        dst[0] = (float) sample0;
-        last_sample7 = sample7;
-        last_sample6 = sample6;
-        last_sample5 = sample5;
-        last_sample4 = sample4;
-        last_sample3 = sample3;
-        last_sample2 = sample2;
-        last_sample1 = sample1;
-        last_sample0 = sample0;
-        dst -= 32;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-static void SDLCALL
-SDL_Downsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 8 channels.\n");
-#endif
-
-    const int dstsize = cvt->len_cvt / 4;
-    float *dst = (float *) cvt->buf;
-    const float *src = (float *) cvt->buf;
-    const float *target = (const float *) (cvt->buf + dstsize);
-    double last_sample0 = (double) SDL_SwapFloatBE(src[0]);
-    double last_sample1 = (double) SDL_SwapFloatBE(src[1]);
-    double last_sample2 = (double) SDL_SwapFloatBE(src[2]);
-    double last_sample3 = (double) SDL_SwapFloatBE(src[3]);
-    double last_sample4 = (double) SDL_SwapFloatBE(src[4]);
-    double last_sample5 = (double) SDL_SwapFloatBE(src[5]);
-    double last_sample6 = (double) SDL_SwapFloatBE(src[6]);
-    double last_sample7 = (double) SDL_SwapFloatBE(src[7]);
-    while (dst < target) {
-        const double sample0 = (double) SDL_SwapFloatBE(src[0]);
-        const double sample1 = (double) SDL_SwapFloatBE(src[1]);
-        const double sample2 = (double) SDL_SwapFloatBE(src[2]);
-        const double sample3 = (double) SDL_SwapFloatBE(src[3]);
-        const double sample4 = (double) SDL_SwapFloatBE(src[4]);
-        const double sample5 = (double) SDL_SwapFloatBE(src[5]);
-        const double sample6 = (double) SDL_SwapFloatBE(src[6]);
-        const double sample7 = (double) SDL_SwapFloatBE(src[7]);
-        src += 32;
-        dst[0] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[3] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[4] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[5] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[6] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[7] = (float) ((sample7 + last_sample7) * 0.5);
-        last_sample0 = sample0;
-        last_sample1 = sample1;
-        last_sample2 = sample2;
-        last_sample3 = sample3;
-        last_sample4 = sample4;
-        last_sample5 = sample5;
-        last_sample6 = sample6;
-        last_sample7 = sample7;
-        dst += 8;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-#endif  /* !LESS_RESAMPLERS */
-#endif  /* !NO_RESAMPLERS */
-
-
-const SDL_AudioRateFilters sdl_audio_rate_filters[] =
-{
-#if !NO_RESAMPLERS
-    { AUDIO_U8, 1, 0, 0, SDL_Downsample_U8_1c },
-    { AUDIO_U8, 1, 1, 0, SDL_Upsample_U8_1c },
-    { AUDIO_U8, 2, 0, 0, SDL_Downsample_U8_2c },
-    { AUDIO_U8, 2, 1, 0, SDL_Upsample_U8_2c },
-    { AUDIO_U8, 4, 0, 0, SDL_Downsample_U8_4c },
-    { AUDIO_U8, 4, 1, 0, SDL_Upsample_U8_4c },
-    { AUDIO_U8, 6, 0, 0, SDL_Downsample_U8_6c },
-    { AUDIO_U8, 6, 1, 0, SDL_Upsample_U8_6c },
-    { AUDIO_U8, 8, 0, 0, SDL_Downsample_U8_8c },
-    { AUDIO_U8, 8, 1, 0, SDL_Upsample_U8_8c },
-    { AUDIO_S8, 1, 0, 0, SDL_Downsample_S8_1c },
-    { AUDIO_S8, 1, 1, 0, SDL_Upsample_S8_1c },
-    { AUDIO_S8, 2, 0, 0, SDL_Downsample_S8_2c },
-    { AUDIO_S8, 2, 1, 0, SDL_Upsample_S8_2c },
-    { AUDIO_S8, 4, 0, 0, SDL_Downsample_S8_4c },
-    { AUDIO_S8, 4, 1, 0, SDL_Upsample_S8_4c },
-    { AUDIO_S8, 6, 0, 0, SDL_Downsample_S8_6c },
-    { AUDIO_S8, 6, 1, 0, SDL_Upsample_S8_6c },
-    { AUDIO_S8, 8, 0, 0, SDL_Downsample_S8_8c },
-    { AUDIO_S8, 8, 1, 0, SDL_Upsample_S8_8c },
-    { AUDIO_U16LSB, 1, 0, 0, SDL_Downsample_U16LSB_1c },
-    { AUDIO_U16LSB, 1, 1, 0, SDL_Upsample_U16LSB_1c },
-    { AUDIO_U16LSB, 2, 0, 0, SDL_Downsample_U16LSB_2c },
-    { AUDIO_U16LSB, 2, 1, 0, SDL_Upsample_U16LSB_2c },
-    { AUDIO_U16LSB, 4, 0, 0, SDL_Downsample_U16LSB_4c },
-    { AUDIO_U16LSB, 4, 1, 0, SDL_Upsample_U16LSB_4c },
-    { AUDIO_U16LSB, 6, 0, 0, SDL_Downsample_U16LSB_6c },
-    { AUDIO_U16LSB, 6, 1, 0, SDL_Upsample_U16LSB_6c },
-    { AUDIO_U16LSB, 8, 0, 0, SDL_Downsample_U16LSB_8c },
-    { AUDIO_U16LSB, 8, 1, 0, SDL_Upsample_U16LSB_8c },
-    { AUDIO_S16LSB, 1, 0, 0, SDL_Downsample_S16LSB_1c },
-    { AUDIO_S16LSB, 1, 1, 0, SDL_Upsample_S16LSB_1c },
-    { AUDIO_S16LSB, 2, 0, 0, SDL_Downsample_S16LSB_2c },
-    { AUDIO_S16LSB, 2, 1, 0, SDL_Upsample_S16LSB_2c },
-    { AUDIO_S16LSB, 4, 0, 0, SDL_Downsample_S16LSB_4c },
-    { AUDIO_S16LSB, 4, 1, 0, SDL_Upsample_S16LSB_4c },
-    { AUDIO_S16LSB, 6, 0, 0, SDL_Downsample_S16LSB_6c },
-    { AUDIO_S16LSB, 6, 1, 0, SDL_Upsample_S16LSB_6c },
-    { AUDIO_S16LSB, 8, 0, 0, SDL_Downsample_S16LSB_8c },
-    { AUDIO_S16LSB, 8, 1, 0, SDL_Upsample_S16LSB_8c },
-    { AUDIO_U16MSB, 1, 0, 0, SDL_Downsample_U16MSB_1c },
-    { AUDIO_U16MSB, 1, 1, 0, SDL_Upsample_U16MSB_1c },
-    { AUDIO_U16MSB, 2, 0, 0, SDL_Downsample_U16MSB_2c },
-    { AUDIO_U16MSB, 2, 1, 0, SDL_Upsample_U16MSB_2c },
-    { AUDIO_U16MSB, 4, 0, 0, SDL_Downsample_U16MSB_4c },
-    { AUDIO_U16MSB, 4, 1, 0, SDL_Upsample_U16MSB_4c },
-    { AUDIO_U16MSB, 6, 0, 0, SDL_Downsample_U16MSB_6c },
-    { AUDIO_U16MSB, 6, 1, 0, SDL_Upsample_U16MSB_6c },
-    { AUDIO_U16MSB, 8, 0, 0, SDL_Downsample_U16MSB_8c },
-    { AUDIO_U16MSB, 8, 1, 0, SDL_Upsample_U16MSB_8c },
-    { AUDIO_S16MSB, 1, 0, 0, SDL_Downsample_S16MSB_1c },
-    { AUDIO_S16MSB, 1, 1, 0, SDL_Upsample_S16MSB_1c },
-    { AUDIO_S16MSB, 2, 0, 0, SDL_Downsample_S16MSB_2c },
-    { AUDIO_S16MSB, 2, 1, 0, SDL_Upsample_S16MSB_2c },
-    { AUDIO_S16MSB, 4, 0, 0, SDL_Downsample_S16MSB_4c },
-    { AUDIO_S16MSB, 4, 1, 0, SDL_Upsample_S16MSB_4c },
-    { AUDIO_S16MSB, 6, 0, 0, SDL_Downsample_S16MSB_6c },
-    { AUDIO_S16MSB, 6, 1, 0, SDL_Upsample_S16MSB_6c },
-    { AUDIO_S16MSB, 8, 0, 0, SDL_Downsample_S16MSB_8c },
-    { AUDIO_S16MSB, 8, 1, 0, SDL_Upsample_S16MSB_8c },
-    { AUDIO_S32LSB, 1, 0, 0, SDL_Downsample_S32LSB_1c },
-    { AUDIO_S32LSB, 1, 1, 0, SDL_Upsample_S32LSB_1c },
-    { AUDIO_S32LSB, 2, 0, 0, SDL_Downsample_S32LSB_2c },
-    { AUDIO_S32LSB, 2, 1, 0, SDL_Upsample_S32LSB_2c },
-    { AUDIO_S32LSB, 4, 0, 0, SDL_Downsample_S32LSB_4c },
-    { AUDIO_S32LSB, 4, 1, 0, SDL_Upsample_S32LSB_4c },
-    { AUDIO_S32LSB, 6, 0, 0, SDL_Downsample_S32LSB_6c },
-    { AUDIO_S32LSB, 6, 1, 0, SDL_Upsample_S32LSB_6c },
-    { AUDIO_S32LSB, 8, 0, 0, SDL_Downsample_S32LSB_8c },
-    { AUDIO_S32LSB, 8, 1, 0, SDL_Upsample_S32LSB_8c },
-    { AUDIO_S32MSB, 1, 0, 0, SDL_Downsample_S32MSB_1c },
-    { AUDIO_S32MSB, 1, 1, 0, SDL_Upsample_S32MSB_1c },
-    { AUDIO_S32MSB, 2, 0, 0, SDL_Downsample_S32MSB_2c },
-    { AUDIO_S32MSB, 2, 1, 0, SDL_Upsample_S32MSB_2c },
-    { AUDIO_S32MSB, 4, 0, 0, SDL_Downsample_S32MSB_4c },
-    { AUDIO_S32MSB, 4, 1, 0, SDL_Upsample_S32MSB_4c },
-    { AUDIO_S32MSB, 6, 0, 0, SDL_Downsample_S32MSB_6c },
-    { AUDIO_S32MSB, 6, 1, 0, SDL_Upsample_S32MSB_6c },
-    { AUDIO_S32MSB, 8, 0, 0, SDL_Downsample_S32MSB_8c },
-    { AUDIO_S32MSB, 8, 1, 0, SDL_Upsample_S32MSB_8c },
-    { AUDIO_F32LSB, 1, 0, 0, SDL_Downsample_F32LSB_1c },
-    { AUDIO_F32LSB, 1, 1, 0, SDL_Upsample_F32LSB_1c },
-    { AUDIO_F32LSB, 2, 0, 0, SDL_Downsample_F32LSB_2c },
-    { AUDIO_F32LSB, 2, 1, 0, SDL_Upsample_F32LSB_2c },
-    { AUDIO_F32LSB, 4, 0, 0, SDL_Downsample_F32LSB_4c },
-    { AUDIO_F32LSB, 4, 1, 0, SDL_Upsample_F32LSB_4c },
-    { AUDIO_F32LSB, 6, 0, 0, SDL_Downsample_F32LSB_6c },
-    { AUDIO_F32LSB, 6, 1, 0, SDL_Upsample_F32LSB_6c },
-    { AUDIO_F32LSB, 8, 0, 0, SDL_Downsample_F32LSB_8c },
-    { AUDIO_F32LSB, 8, 1, 0, SDL_Upsample_F32LSB_8c },
-    { AUDIO_F32MSB, 1, 0, 0, SDL_Downsample_F32MSB_1c },
-    { AUDIO_F32MSB, 1, 1, 0, SDL_Upsample_F32MSB_1c },
-    { AUDIO_F32MSB, 2, 0, 0, SDL_Downsample_F32MSB_2c },
-    { AUDIO_F32MSB, 2, 1, 0, SDL_Upsample_F32MSB_2c },
-    { AUDIO_F32MSB, 4, 0, 0, SDL_Downsample_F32MSB_4c },
-    { AUDIO_F32MSB, 4, 1, 0, SDL_Upsample_F32MSB_4c },
-    { AUDIO_F32MSB, 6, 0, 0, SDL_Downsample_F32MSB_6c },
-    { AUDIO_F32MSB, 6, 1, 0, SDL_Upsample_F32MSB_6c },
-    { AUDIO_F32MSB, 8, 0, 0, SDL_Downsample_F32MSB_8c },
-    { AUDIO_F32MSB, 8, 1, 0, SDL_Upsample_F32MSB_8c },
-#if !LESS_RESAMPLERS
-    { AUDIO_U8, 1, 0, 2, SDL_Downsample_U8_1c_x2 },
-    { AUDIO_U8, 1, 1, 2, SDL_Upsample_U8_1c_x2 },
-    { AUDIO_U8, 1, 0, 4, SDL_Downsample_U8_1c_x4 },
-    { AUDIO_U8, 1, 1, 4, SDL_Upsample_U8_1c_x4 },
-    { AUDIO_U8, 2, 0, 2, SDL_Downsample_U8_2c_x2 },
-    { AUDIO_U8, 2, 1, 2, SDL_Upsample_U8_2c_x2 },
-    { AUDIO_U8, 2, 0, 4, SDL_Downsample_U8_2c_x4 },
-    { AUDIO_U8, 2, 1, 4, SDL_Upsample_U8_2c_x4 },
-    { AUDIO_U8, 4, 0, 2, SDL_Downsample_U8_4c_x2 },
-    { AUDIO_U8, 4, 1, 2, SDL_Upsample_U8_4c_x2 },
-    { AUDIO_U8, 4, 0, 4, SDL_Downsample_U8_4c_x4 },
-    { AUDIO_U8, 4, 1, 4, SDL_Upsample_U8_4c_x4 },
-    { AUDIO_U8, 6, 0, 2, SDL_Downsample_U8_6c_x2 },
-    { AUDIO_U8, 6, 1, 2, SDL_Upsample_U8_6c_x2 },
-    { AUDIO_U8, 6, 0, 4, SDL_Downsample_U8_6c_x4 },
-    { AUDIO_U8, 6, 1, 4, SDL_Upsample_U8_6c_x4 },
-    { AUDIO_U8, 8, 0, 2, SDL_Downsample_U8_8c_x2 },
-    { AUDIO_U8, 8, 1, 2, SDL_Upsample_U8_8c_x2 },
-    { AUDIO_U8, 8, 0, 4, SDL_Downsample_U8_8c_x4 },
-    { AUDIO_U8, 8, 1, 4, SDL_Upsample_U8_8c_x4 },
-    { AUDIO_S8, 1, 0, 2, SDL_Downsample_S8_1c_x2 },
-    { AUDIO_S8, 1, 1, 2, SDL_Upsample_S8_1c_x2 },
-    { AUDIO_S8, 1, 0, 4, SDL_Downsample_S8_1c_x4 },
-    { AUDIO_S8, 1, 1, 4, SDL_Upsample_S8_1c_x4 },
-    { AUDIO_S8, 2, 0, 2, SDL_Downsample_S8_2c_x2 },
-    { AUDIO_S8, 2, 1, 2, SDL_Upsample_S8_2c_x2 },
-    { AUDIO_S8, 2, 0, 4, SDL_Downsample_S8_2c_x4 },
-    { AUDIO_S8, 2, 1, 4, SDL_Upsample_S8_2c_x4 },
-    { AUDIO_S8, 4, 0, 2, SDL_Downsample_S8_4c_x2 },
-    { AUDIO_S8, 4, 1, 2, SDL_Upsample_S8_4c_x2 },
-    { AUDIO_S8, 4, 0, 4, SDL_Downsample_S8_4c_x4 },
-    { AUDIO_S8, 4, 1, 4, SDL_Upsample_S8_4c_x4 },
-    { AUDIO_S8, 6, 0, 2, SDL_Downsample_S8_6c_x2 },
-    { AUDIO_S8, 6, 1, 2, SDL_Upsample_S8_6c_x2 },
-    { AUDIO_S8, 6, 0, 4, SDL_Downsample_S8_6c_x4 },
-    { AUDIO_S8, 6, 1, 4, SDL_Upsample_S8_6c_x4 },
-    { AUDIO_S8, 8, 0, 2, SDL_Downsample_S8_8c_x2 },
-    { AUDIO_S8, 8, 1, 2, SDL_Upsample_S8_8c_x2 },
-    { AUDIO_S8, 8, 0, 4, SDL_Downsample_S8_8c_x4 },
-    { AUDIO_S8, 8, 1, 4, SDL_Upsample_S8_8c_x4 },
-    { AUDIO_U16LSB, 1, 0, 2, SDL_Downsample_U16LSB_1c_x2 },
-    { AUDIO_U16LSB, 1, 1, 2, SDL_Upsample_U16LSB_1c_x2 },
-    { AUDIO_U16LSB, 1, 0, 4, SDL_Downsample_U16LSB_1c_x4 },
-    { AUDIO_U16LSB, 1, 1, 4, SDL_Upsample_U16LSB_1c_x4 },
-    { AUDIO_U16LSB, 2, 0, 2, SDL_Downsample_U16LSB_2c_x2 },
-    { AUDIO_U16LSB, 2, 1, 2, SDL_Upsample_U16LSB_2c_x2 },
-    { AUDIO_U16LSB, 2, 0, 4, SDL_Downsample_U16LSB_2c_x4 },
-    { AUDIO_U16LSB, 2, 1, 4, SDL_Upsample_U16LSB_2c_x4 },
-    { AUDIO_U16LSB, 4, 0, 2, SDL_Downsample_U16LSB_4c_x2 },
-    { AUDIO_U16LSB, 4, 1, 2, SDL_Upsample_U16LSB_4c_x2 },
-    { AUDIO_U16LSB, 4, 0, 4, SDL_Downsample_U16LSB_4c_x4 },
-    { AUDIO_U16LSB, 4, 1, 4, SDL_Upsample_U16LSB_4c_x4 },
-    { AUDIO_U16LSB, 6, 0, 2, SDL_Downsample_U16LSB_6c_x2 },
-    { AUDIO_U16LSB, 6, 1, 2, SDL_Upsample_U16LSB_6c_x2 },
-    { AUDIO_U16LSB, 6, 0, 4, SDL_Downsample_U16LSB_6c_x4 },
-    { AUDIO_U16LSB, 6, 1, 4, SDL_Upsample_U16LSB_6c_x4 },
-    { AUDIO_U16LSB, 8, 0, 2, SDL_Downsample_U16LSB_8c_x2 },
-    { AUDIO_U16LSB, 8, 1, 2, SDL_Upsample_U16LSB_8c_x2 },
-    { AUDIO_U16LSB, 8, 0, 4, SDL_Downsample_U16LSB_8c_x4 },
-    { AUDIO_U16LSB, 8, 1, 4, SDL_Upsample_U16LSB_8c_x4 },
-    { AUDIO_S16LSB, 1, 0, 2, SDL_Downsample_S16LSB_1c_x2 },
-    { AUDIO_S16LSB, 1, 1, 2, SDL_Upsample_S16LSB_1c_x2 },
-    { AUDIO_S16LSB, 1, 0, 4, SDL_Downsample_S16LSB_1c_x4 },
-    { AUDIO_S16LSB, 1, 1, 4, SDL_Upsample_S16LSB_1c_x4 },
-    { AUDIO_S16LSB, 2, 0, 2, SDL_Downsample_S16LSB_2c_x2 },
-    { AUDIO_S16LSB, 2, 1, 2, SDL_Upsample_S16LSB_2c_x2 },
-    { AUDIO_S16LSB, 2, 0, 4, SDL_Downsample_S16LSB_2c_x4 },
-    { AUDIO_S16LSB, 2, 1, 4, SDL_Upsample_S16LSB_2c_x4 },
-    { AUDIO_S16LSB, 4, 0, 2, SDL_Downsample_S16LSB_4c_x2 },
-    { AUDIO_S16LSB, 4, 1, 2, SDL_Upsample_S16LSB_4c_x2 },
-    { AUDIO_S16LSB, 4, 0, 4, SDL_Downsample_S16LSB_4c_x4 },
-    { AUDIO_S16LSB, 4, 1, 4, SDL_Upsample_S16LSB_4c_x4 },
-    { AUDIO_S16LSB, 6, 0, 2, SDL_Downsample_S16LSB_6c_x2 },
-    { AUDIO_S16LSB, 6, 1, 2, SDL_Upsample_S16LSB_6c_x2 },
-    { AUDIO_S16LSB, 6, 0, 4, SDL_Downsample_S16LSB_6c_x4 },
-    { AUDIO_S16LSB, 6, 1, 4, SDL_Upsample_S16LSB_6c_x4 },
-    { AUDIO_S16LSB, 8, 0, 2, SDL_Downsample_S16LSB_8c_x2 },
-    { AUDIO_S16LSB, 8, 1, 2, SDL_Upsample_S16LSB_8c_x2 },
-    { AUDIO_S16LSB, 8, 0, 4, SDL_Downsample_S16LSB_8c_x4 },
-    { AUDIO_S16LSB, 8, 1, 4, SDL_Upsample_S16LSB_8c_x4 },
-    { AUDIO_U16MSB, 1, 0, 2, SDL_Downsample_U16MSB_1c_x2 },
-    { AUDIO_U16MSB, 1, 1, 2, SDL_Upsample_U16MSB_1c_x2 },
-    { AUDIO_U16MSB, 1, 0, 4, SDL_Downsample_U16MSB_1c_x4 },
-    { AUDIO_U16MSB, 1, 1, 4, SDL_Upsample_U16MSB_1c_x4 },
-    { AUDIO_U16MSB, 2, 0, 2, SDL_Downsample_U16MSB_2c_x2 },
-    { AUDIO_U16MSB, 2, 1, 2, SDL_Upsample_U16MSB_2c_x2 },
-    { AUDIO_U16MSB, 2, 0, 4, SDL_Downsample_U16MSB_2c_x4 },
-    { AUDIO_U16MSB, 2, 1, 4, SDL_Upsample_U16MSB_2c_x4 },
-    { AUDIO_U16MSB, 4, 0, 2, SDL_Downsample_U16MSB_4c_x2 },
-    { AUDIO_U16MSB, 4, 1, 2, SDL_Upsample_U16MSB_4c_x2 },
-    { AUDIO_U16MSB, 4, 0, 4, SDL_Downsample_U16MSB_4c_x4 },
-    { AUDIO_U16MSB, 4, 1, 4, SDL_Upsample_U16MSB_4c_x4 },
-    { AUDIO_U16MSB, 6, 0, 2, SDL_Downsample_U16MSB_6c_x2 },
-    { AUDIO_U16MSB, 6, 1, 2, SDL_Upsample_U16MSB_6c_x2 },
-    { AUDIO_U16MSB, 6, 0, 4, SDL_Downsample_U16MSB_6c_x4 },
-    { AUDIO_U16MSB, 6, 1, 4, SDL_Upsample_U16MSB_6c_x4 },
-    { AUDIO_U16MSB, 8, 0, 2, SDL_Downsample_U16MSB_8c_x2 },
-    { AUDIO_U16MSB, 8, 1, 2, SDL_Upsample_U16MSB_8c_x2 },
-    { AUDIO_U16MSB, 8, 0, 4, SDL_Downsample_U16MSB_8c_x4 },
-    { AUDIO_U16MSB, 8, 1, 4, SDL_Upsample_U16MSB_8c_x4 },
-    { AUDIO_S16MSB, 1, 0, 2, SDL_Downsample_S16MSB_1c_x2 },
-    { AUDIO_S16MSB, 1, 1, 2, SDL_Upsample_S16MSB_1c_x2 },
-    { AUDIO_S16MSB, 1, 0, 4, SDL_Downsample_S16MSB_1c_x4 },
-    { AUDIO_S16MSB, 1, 1, 4, SDL_Upsample_S16MSB_1c_x4 },
-    { AUDIO_S16MSB, 2, 0, 2, SDL_Downsample_S16MSB_2c_x2 },
-    { AUDIO_S16MSB, 2, 1, 2, SDL_Upsample_S16MSB_2c_x2 },
-    { AUDIO_S16MSB, 2, 0, 4, SDL_Downsample_S16MSB_2c_x4 },
-    { AUDIO_S16MSB, 2, 1, 4, SDL_Upsample_S16MSB_2c_x4 },
-    { AUDIO_S16MSB, 4, 0, 2, SDL_Downsample_S16MSB_4c_x2 },
-    { AUDIO_S16MSB, 4, 1, 2, SDL_Upsample_S16MSB_4c_x2 },
-    { AUDIO_S16MSB, 4, 0, 4, SDL_Downsample_S16MSB_4c_x4 },
-    { AUDIO_S16MSB, 4, 1, 4, SDL_Upsample_S16MSB_4c_x4 },
-    { AUDIO_S16MSB, 6, 0, 2, SDL_Downsample_S16MSB_6c_x2 },
-    { AUDIO_S16MSB, 6, 1, 2, SDL_Upsample_S16MSB_6c_x2 },
-    { AUDIO_S16MSB, 6, 0, 4, SDL_Downsample_S16MSB_6c_x4 },
-    { AUDIO_S16MSB, 6, 1, 4, SDL_Upsample_S16MSB_6c_x4 },
-    { AUDIO_S16MSB, 8, 0, 2, SDL_Downsample_S16MSB_8c_x2 },
-    { AUDIO_S16MSB, 8, 1, 2, SDL_Upsample_S16MSB_8c_x2 },
-    { AUDIO_S16MSB, 8, 0, 4, SDL_Downsample_S16MSB_8c_x4 },
-    { AUDIO_S16MSB, 8, 1, 4, SDL_Upsample_S16MSB_8c_x4 },
-    { AUDIO_S32LSB, 1, 0, 2, SDL_Downsample_S32LSB_1c_x2 },
-    { AUDIO_S32LSB, 1, 1, 2, SDL_Upsample_S32LSB_1c_x2 },
-    { AUDIO_S32LSB, 1, 0, 4, SDL_Downsample_S32LSB_1c_x4 },
-    { AUDIO_S32LSB, 1, 1, 4, SDL_Upsample_S32LSB_1c_x4 },
-    { AUDIO_S32LSB, 2, 0, 2, SDL_Downsample_S32LSB_2c_x2 },
-    { AUDIO_S32LSB, 2, 1, 2, SDL_Upsample_S32LSB_2c_x2 },
-    { AUDIO_S32LSB, 2, 0, 4, SDL_Downsample_S32LSB_2c_x4 },
-    { AUDIO_S32LSB, 2, 1, 4, SDL_Upsample_S32LSB_2c_x4 },
-    { AUDIO_S32LSB, 4, 0, 2, SDL_Downsample_S32LSB_4c_x2 },
-    { AUDIO_S32LSB, 4, 1, 2, SDL_Upsample_S32LSB_4c_x2 },
-    { AUDIO_S32LSB, 4, 0, 4, SDL_Downsample_S32LSB_4c_x4 },
-    { AUDIO_S32LSB, 4, 1, 4, SDL_Upsample_S32LSB_4c_x4 },
-    { AUDIO_S32LSB, 6, 0, 2, SDL_Downsample_S32LSB_6c_x2 },
-    { AUDIO_S32LSB, 6, 1, 2, SDL_Upsample_S32LSB_6c_x2 },
-    { AUDIO_S32LSB, 6, 0, 4, SDL_Downsample_S32LSB_6c_x4 },
-    { AUDIO_S32LSB, 6, 1, 4, SDL_Upsample_S32LSB_6c_x4 },
-    { AUDIO_S32LSB, 8, 0, 2, SDL_Downsample_S32LSB_8c_x2 },
-    { AUDIO_S32LSB, 8, 1, 2, SDL_Upsample_S32LSB_8c_x2 },
-    { AUDIO_S32LSB, 8, 0, 4, SDL_Downsample_S32LSB_8c_x4 },
-    { AUDIO_S32LSB, 8, 1, 4, SDL_Upsample_S32LSB_8c_x4 },
-    { AUDIO_S32MSB, 1, 0, 2, SDL_Downsample_S32MSB_1c_x2 },
-    { AUDIO_S32MSB, 1, 1, 2, SDL_Upsample_S32MSB_1c_x2 },
-    { AUDIO_S32MSB, 1, 0, 4, SDL_Downsample_S32MSB_1c_x4 },
-    { AUDIO_S32MSB, 1, 1, 4, SDL_Upsample_S32MSB_1c_x4 },
-    { AUDIO_S32MSB, 2, 0, 2, SDL_Downsample_S32MSB_2c_x2 },
-    { AUDIO_S32MSB, 2, 1, 2, SDL_Upsample_S32MSB_2c_x2 },
-    { AUDIO_S32MSB, 2, 0, 4, SDL_Downsample_S32MSB_2c_x4 },
-    { AUDIO_S32MSB, 2, 1, 4, SDL_Upsample_S32MSB_2c_x4 },
-    { AUDIO_S32MSB, 4, 0, 2, SDL_Downsample_S32MSB_4c_x2 },
-    { AUDIO_S32MSB, 4, 1, 2, SDL_Upsample_S32MSB_4c_x2 },
-    { AUDIO_S32MSB, 4, 0, 4, SDL_Downsample_S32MSB_4c_x4 },
-    { AUDIO_S32MSB, 4, 1, 4, SDL_Upsample_S32MSB_4c_x4 },
-    { AUDIO_S32MSB, 6, 0, 2, SDL_Downsample_S32MSB_6c_x2 },
-    { AUDIO_S32MSB, 6, 1, 2, SDL_Upsample_S32MSB_6c_x2 },
-    { AUDIO_S32MSB, 6, 0, 4, SDL_Downsample_S32MSB_6c_x4 },
-    { AUDIO_S32MSB, 6, 1, 4, SDL_Upsample_S32MSB_6c_x4 },
-    { AUDIO_S32MSB, 8, 0, 2, SDL_Downsample_S32MSB_8c_x2 },
-    { AUDIO_S32MSB, 8, 1, 2, SDL_Upsample_S32MSB_8c_x2 },
-    { AUDIO_S32MSB, 8, 0, 4, SDL_Downsample_S32MSB_8c_x4 },
-    { AUDIO_S32MSB, 8, 1, 4, SDL_Upsample_S32MSB_8c_x4 },
-    { AUDIO_F32LSB, 1, 0, 2, SDL_Downsample_F32LSB_1c_x2 },
-    { AUDIO_F32LSB, 1, 1, 2, SDL_Upsample_F32LSB_1c_x2 },
-    { AUDIO_F32LSB, 1, 0, 4, SDL_Downsample_F32LSB_1c_x4 },
-    { AUDIO_F32LSB, 1, 1, 4, SDL_Upsample_F32LSB_1c_x4 },
-    { AUDIO_F32LSB, 2, 0, 2, SDL_Downsample_F32LSB_2c_x2 },
-    { AUDIO_F32LSB, 2, 1, 2, SDL_Upsample_F32LSB_2c_x2 },
-    { AUDIO_F32LSB, 2, 0, 4, SDL_Downsample_F32LSB_2c_x4 },
-    { AUDIO_F32LSB, 2, 1, 4, SDL_Upsample_F32LSB_2c_x4 },
-    { AUDIO_F32LSB, 4, 0, 2, SDL_Downsample_F32LSB_4c_x2 },
-    { AUDIO_F32LSB, 4, 1, 2, SDL_Upsample_F32LSB_4c_x2 },
-    { AUDIO_F32LSB, 4, 0, 4, SDL_Downsample_F32LSB_4c_x4 },
-    { AUDIO_F32LSB, 4, 1, 4, SDL_Upsample_F32LSB_4c_x4 },
-    { AUDIO_F32LSB, 6, 0, 2, SDL_Downsample_F32LSB_6c_x2 },
-    { AUDIO_F32LSB, 6, 1, 2, SDL_Upsample_F32LSB_6c_x2 },
-    { AUDIO_F32LSB, 6, 0, 4, SDL_Downsample_F32LSB_6c_x4 },
-    { AUDIO_F32LSB, 6, 1, 4, SDL_Upsample_F32LSB_6c_x4 },
-    { AUDIO_F32LSB, 8, 0, 2, SDL_Downsample_F32LSB_8c_x2 },
-    { AUDIO_F32LSB, 8, 1, 2, SDL_Upsample_F32LSB_8c_x2 },
-    { AUDIO_F32LSB, 8, 0, 4, SDL_Downsample_F32LSB_8c_x4 },
-    { AUDIO_F32LSB, 8, 1, 4, SDL_Upsample_F32LSB_8c_x4 },
-    { AUDIO_F32MSB, 1, 0, 2, SDL_Downsample_F32MSB_1c_x2 },
-    { AUDIO_F32MSB, 1, 1, 2, SDL_Upsample_F32MSB_1c_x2 },
-    { AUDIO_F32MSB, 1, 0, 4, SDL_Downsample_F32MSB_1c_x4 },
-    { AUDIO_F32MSB, 1, 1, 4, SDL_Upsample_F32MSB_1c_x4 },
-    { AUDIO_F32MSB, 2, 0, 2, SDL_Downsample_F32MSB_2c_x2 },
-    { AUDIO_F32MSB, 2, 1, 2, SDL_Upsample_F32MSB_2c_x2 },
-    { AUDIO_F32MSB, 2, 0, 4, SDL_Downsample_F32MSB_2c_x4 },
-    { AUDIO_F32MSB, 2, 1, 4, SDL_Upsample_F32MSB_2c_x4 },
-    { AUDIO_F32MSB, 4, 0, 2, SDL_Downsample_F32MSB_4c_x2 },
-    { AUDIO_F32MSB, 4, 1, 2, SDL_Upsample_F32MSB_4c_x2 },
-    { AUDIO_F32MSB, 4, 0, 4, SDL_Downsample_F32MSB_4c_x4 },
-    { AUDIO_F32MSB, 4, 1, 4, SDL_Upsample_F32MSB_4c_x4 },
-    { AUDIO_F32MSB, 6, 0, 2, SDL_Downsample_F32MSB_6c_x2 },
-    { AUDIO_F32MSB, 6, 1, 2, SDL_Upsample_F32MSB_6c_x2 },
-    { AUDIO_F32MSB, 6, 0, 4, SDL_Downsample_F32MSB_6c_x4 },
-    { AUDIO_F32MSB, 6, 1, 4, SDL_Upsample_F32MSB_6c_x4 },
-    { AUDIO_F32MSB, 8, 0, 2, SDL_Downsample_F32MSB_8c_x2 },
-    { AUDIO_F32MSB, 8, 1, 2, SDL_Upsample_F32MSB_8c_x2 },
-    { AUDIO_F32MSB, 8, 0, 4, SDL_Downsample_F32MSB_8c_x4 },
-    { AUDIO_F32MSB, 8, 1, 4, SDL_Upsample_F32MSB_8c_x4 },
-#endif  /* !LESS_RESAMPLERS */
-#endif  /* !NO_RESAMPLERS */
-    { 0, 0, 0, 0, NULL }
-};
-
-/* 390 converters generated. */
-
-/* *INDENT-ON* */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_mixer.c b/deps/SDL2/src/audio/SDL_mixer.c
deleted file mode 100644
index 3790759..0000000
--- a/deps/SDL2/src/audio/SDL_mixer.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This provides the default mixing callback for the SDL audio routines */
-
-#include "SDL_cpuinfo.h"
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "SDL_sysaudio.h"
-
-/* This table is used to add two sound values together and pin
- * the value to avoid overflow.  (used with permission from ARDI)
- * Changed to use 0xFE instead of 0xFF for better sound quality.
- */
-static const Uint8 mix8[] = {
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
-    0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
-    0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
-    0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24,
-    0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
-    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
-    0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
-    0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
-    0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B,
-    0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
-    0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
-    0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C,
-    0x7D, 0x7E, 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-    0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92,
-    0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D,
-    0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8,
-    0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3,
-    0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE,
-    0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9,
-    0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4,
-    0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
-    0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA,
-    0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5,
-    0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
-    0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE
-};
-
-/* The volume ranges from 0 - 128 */
-#define ADJUST_VOLUME(s, v) (s = (s*v)/SDL_MIX_MAXVOLUME)
-#define ADJUST_VOLUME_U8(s, v)  (s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128)
-
-
-void
-SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format,
-                   Uint32 len, int volume)
-{
-    if (volume == 0) {
-        return;
-    }
-
-    switch (format) {
-
-    case AUDIO_U8:
-        {
-#if defined(__GNUC__) && defined(__M68000__) && !defined(__mcoldfire__) && defined(SDL_ASSEMBLY_ROUTINES)
-            SDL_MixAudio_m68k_U8((char *) dst, (char *) src,
-                                 (unsigned long) len, (long) volume,
-                                 (char *) mix8);
-#else
-            Uint8 src_sample;
-
-            while (len--) {
-                src_sample = *src;
-                ADJUST_VOLUME_U8(src_sample, volume);
-                *dst = mix8[*dst + src_sample];
-                ++dst;
-                ++src;
-            }
-#endif
-        }
-        break;
-
-    case AUDIO_S8:
-        {
-            Sint8 *dst8, *src8;
-            Sint8 src_sample;
-            int dst_sample;
-            const int max_audioval = ((1 << (8 - 1)) - 1);
-            const int min_audioval = -(1 << (8 - 1));
-
-            src8 = (Sint8 *) src;
-            dst8 = (Sint8 *) dst;
-            while (len--) {
-                src_sample = *src8;
-                ADJUST_VOLUME(src_sample, volume);
-                dst_sample = *dst8 + src_sample;
-                if (dst_sample > max_audioval) {
-                    *dst8 = max_audioval;
-                } else if (dst_sample < min_audioval) {
-                    *dst8 = min_audioval;
-                } else {
-                    *dst8 = dst_sample;
-                }
-                ++dst8;
-                ++src8;
-            }
-        }
-        break;
-
-    case AUDIO_S16LSB:
-        {
-            Sint16 src1, src2;
-            int dst_sample;
-            const int max_audioval = ((1 << (16 - 1)) - 1);
-            const int min_audioval = -(1 << (16 - 1));
-
-            len /= 2;
-            while (len--) {
-                src1 = ((src[1]) << 8 | src[0]);
-                ADJUST_VOLUME(src1, volume);
-                src2 = ((dst[1]) << 8 | dst[0]);
-                src += 2;
-                dst_sample = src1 + src2;
-                if (dst_sample > max_audioval) {
-                    dst_sample = max_audioval;
-                } else if (dst_sample < min_audioval) {
-                    dst_sample = min_audioval;
-                }
-                dst[0] = dst_sample & 0xFF;
-                dst_sample >>= 8;
-                dst[1] = dst_sample & 0xFF;
-                dst += 2;
-            }
-        }
-        break;
-
-    case AUDIO_S16MSB:
-        {
-#if defined(__GNUC__) && defined(__M68000__) && !defined(__mcoldfire__) && defined(SDL_ASSEMBLY_ROUTINES)
-            SDL_MixAudio_m68k_S16MSB((short *) dst, (short *) src,
-                                     (unsigned long) len, (long) volume);
-#else
-            Sint16 src1, src2;
-            int dst_sample;
-            const int max_audioval = ((1 << (16 - 1)) - 1);
-            const int min_audioval = -(1 << (16 - 1));
-
-            len /= 2;
-            while (len--) {
-                src1 = ((src[0]) << 8 | src[1]);
-                ADJUST_VOLUME(src1, volume);
-                src2 = ((dst[0]) << 8 | dst[1]);
-                src += 2;
-                dst_sample = src1 + src2;
-                if (dst_sample > max_audioval) {
-                    dst_sample = max_audioval;
-                } else if (dst_sample < min_audioval) {
-                    dst_sample = min_audioval;
-                }
-                dst[1] = dst_sample & 0xFF;
-                dst_sample >>= 8;
-                dst[0] = dst_sample & 0xFF;
-                dst += 2;
-            }
-#endif
-        }
-        break;
-
-    case AUDIO_S32LSB:
-        {
-            const Uint32 *src32 = (Uint32 *) src;
-            Uint32 *dst32 = (Uint32 *) dst;
-            Sint64 src1, src2;
-            Sint64 dst_sample;
-            const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1);
-            const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1));
-
-            len /= 4;
-            while (len--) {
-                src1 = (Sint64) ((Sint32) SDL_SwapLE32(*src32));
-                src32++;
-                ADJUST_VOLUME(src1, volume);
-                src2 = (Sint64) ((Sint32) SDL_SwapLE32(*dst32));
-                dst_sample = src1 + src2;
-                if (dst_sample > max_audioval) {
-                    dst_sample = max_audioval;
-                } else if (dst_sample < min_audioval) {
-                    dst_sample = min_audioval;
-                }
-                *(dst32++) = SDL_SwapLE32((Uint32) ((Sint32) dst_sample));
-            }
-        }
-        break;
-
-    case AUDIO_S32MSB:
-        {
-            const Uint32 *src32 = (Uint32 *) src;
-            Uint32 *dst32 = (Uint32 *) dst;
-            Sint64 src1, src2;
-            Sint64 dst_sample;
-            const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1);
-            const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1));
-
-            len /= 4;
-            while (len--) {
-                src1 = (Sint64) ((Sint32) SDL_SwapBE32(*src32));
-                src32++;
-                ADJUST_VOLUME(src1, volume);
-                src2 = (Sint64) ((Sint32) SDL_SwapBE32(*dst32));
-                dst_sample = src1 + src2;
-                if (dst_sample > max_audioval) {
-                    dst_sample = max_audioval;
-                } else if (dst_sample < min_audioval) {
-                    dst_sample = min_audioval;
-                }
-                *(dst32++) = SDL_SwapBE32((Uint32) ((Sint32) dst_sample));
-            }
-        }
-        break;
-
-    case AUDIO_F32LSB:
-        {
-            const float fmaxvolume = 1.0f / ((float) SDL_MIX_MAXVOLUME);
-            const float fvolume = (float) volume;
-            const float *src32 = (float *) src;
-            float *dst32 = (float *) dst;
-            float src1, src2;
-            double dst_sample;
-            /* !!! FIXME: are these right? */
-            const double max_audioval = 3.402823466e+38F;
-            const double min_audioval = -3.402823466e+38F;
-
-            len /= 4;
-            while (len--) {
-                src1 = ((SDL_SwapFloatLE(*src32) * fvolume) * fmaxvolume);
-                src2 = SDL_SwapFloatLE(*dst32);
-                src32++;
-
-                dst_sample = ((double) src1) + ((double) src2);
-                if (dst_sample > max_audioval) {
-                    dst_sample = max_audioval;
-                } else if (dst_sample < min_audioval) {
-                    dst_sample = min_audioval;
-                }
-                *(dst32++) = SDL_SwapFloatLE((float) dst_sample);
-            }
-        }
-        break;
-
-    case AUDIO_F32MSB:
-        {
-            const float fmaxvolume = 1.0f / ((float) SDL_MIX_MAXVOLUME);
-            const float fvolume = (float) volume;
-            const float *src32 = (float *) src;
-            float *dst32 = (float *) dst;
-            float src1, src2;
-            double dst_sample;
-            /* !!! FIXME: are these right? */
-            const double max_audioval = 3.402823466e+38F;
-            const double min_audioval = -3.402823466e+38F;
-
-            len /= 4;
-            while (len--) {
-                src1 = ((SDL_SwapFloatBE(*src32) * fvolume) * fmaxvolume);
-                src2 = SDL_SwapFloatBE(*dst32);
-                src32++;
-
-                dst_sample = ((double) src1) + ((double) src2);
-                if (dst_sample > max_audioval) {
-                    dst_sample = max_audioval;
-                } else if (dst_sample < min_audioval) {
-                    dst_sample = min_audioval;
-                }
-                *(dst32++) = SDL_SwapFloatBE((float) dst_sample);
-            }
-        }
-        break;
-
-    default:                   /* If this happens... FIXME! */
-        SDL_SetError("SDL_MixAudio(): unknown audio format");
-        return;
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_sysaudio.h b/deps/SDL2/src/audio/SDL_sysaudio.h
deleted file mode 100644
index 83919c6..0000000
--- a/deps/SDL2/src/audio/SDL_sysaudio.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_sysaudio_h
-#define _SDL_sysaudio_h
-
-#include "SDL_mutex.h"
-#include "SDL_thread.h"
-
-/* The SDL audio driver */
-typedef struct SDL_AudioDevice SDL_AudioDevice;
-#define _THIS   SDL_AudioDevice *_this
-
-/* Used by audio targets during DetectDevices() */
-typedef void (*SDL_AddAudioDevice)(const char *name);
-
-typedef struct SDL_AudioDriverImpl
-{
-    void (*DetectDevices) (int iscapture, SDL_AddAudioDevice addfn);
-    int (*OpenDevice) (_THIS, const char *devname, int iscapture);
-    void (*ThreadInit) (_THIS); /* Called by audio thread at start */
-    void (*WaitDevice) (_THIS);
-    void (*PlayDevice) (_THIS);
-    Uint8 *(*GetDeviceBuf) (_THIS);
-    void (*WaitDone) (_THIS);
-    void (*CloseDevice) (_THIS);
-    void (*LockDevice) (_THIS);
-    void (*UnlockDevice) (_THIS);
-    void (*Deinitialize) (void);
-
-    /* !!! FIXME: add pause(), so we can optimize instead of mixing silence. */
-
-    /* Some flags to push duplicate code into the core and reduce #ifdefs. */
-    int ProvidesOwnCallbackThread;
-    int SkipMixerLock;  /* !!! FIXME: do we need this anymore? */
-    int HasCaptureSupport;
-    int OnlyHasDefaultOutputDevice;
-    int OnlyHasDefaultInputDevice;
-} SDL_AudioDriverImpl;
-
-
-typedef struct SDL_AudioDriver
-{
-    /* * * */
-    /* The name of this audio driver */
-    const char *name;
-
-    /* * * */
-    /* The description of this audio driver */
-    const char *desc;
-
-    SDL_AudioDriverImpl impl;
-
-    char **outputDevices;
-    int outputDeviceCount;
-
-    char **inputDevices;
-    int inputDeviceCount;
-} SDL_AudioDriver;
-
-
-/* Streamer */
-typedef struct
-{
-    Uint8 *buffer;
-    int max_len;                /* the maximum length in bytes */
-    int read_pos, write_pos;    /* the position of the write and read heads in bytes */
-} SDL_AudioStreamer;
-
-
-/* Define the SDL audio driver structure */
-struct SDL_AudioDevice
-{
-    /* * * */
-    /* Data common to all devices */
-
-    /* The current audio specification (shared with audio thread) */
-    SDL_AudioSpec spec;
-
-    /* An audio conversion block for audio format emulation */
-    SDL_AudioCVT convert;
-
-    /* The streamer, if sample rate conversion necessitates it */
-    int use_streamer;
-    SDL_AudioStreamer streamer;
-
-    /* Current state flags */
-    int iscapture;
-    int enabled;
-    int paused;
-    int opened;
-
-    /* Fake audio buffer for when the audio hardware is busy */
-    Uint8 *fake_stream;
-
-    /* A semaphore for locking the mixing buffers */
-    SDL_mutex *mixer_lock;
-
-    /* A thread to feed the audio device */
-    SDL_Thread *thread;
-    SDL_threadID threadid;
-
-    /* * * */
-    /* Data private to this driver */
-    struct SDL_PrivateAudioData *hidden;
-};
-#undef _THIS
-
-typedef struct AudioBootStrap
-{
-    const char *name;
-    const char *desc;
-    int (*init) (SDL_AudioDriverImpl * impl);
-    int demand_only;  /* 1==request explicitly, or it won't be available. */
-} AudioBootStrap;
-
-#endif /* _SDL_sysaudio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_wave.c b/deps/SDL2/src/audio/SDL_wave.c
deleted file mode 100644
index fac24cb..0000000
--- a/deps/SDL2/src/audio/SDL_wave.c
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Microsoft WAVE file loading routines */
-
-#include "SDL_audio.h"
-#include "SDL_wave.h"
-
-
-static int ReadChunk(SDL_RWops * src, Chunk * chunk);
-
-struct MS_ADPCM_decodestate
-{
-    Uint8 hPredictor;
-    Uint16 iDelta;
-    Sint16 iSamp1;
-    Sint16 iSamp2;
-};
-static struct MS_ADPCM_decoder
-{
-    WaveFMT wavefmt;
-    Uint16 wSamplesPerBlock;
-    Uint16 wNumCoef;
-    Sint16 aCoeff[7][2];
-    /* * * */
-    struct MS_ADPCM_decodestate state[2];
-} MS_ADPCM_state;
-
-static int
-InitMS_ADPCM(WaveFMT * format)
-{
-    Uint8 *rogue_feel;
-    int i;
-
-    /* Set the rogue pointer to the MS_ADPCM specific data */
-    MS_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding);
-    MS_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels);
-    MS_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency);
-    MS_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate);
-    MS_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign);
-    MS_ADPCM_state.wavefmt.bitspersample =
-        SDL_SwapLE16(format->bitspersample);
-    rogue_feel = (Uint8 *) format + sizeof(*format);
-    if (sizeof(*format) == 16) {
-        /* const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
-        rogue_feel += sizeof(Uint16);
-    }
-    MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
-    rogue_feel += sizeof(Uint16);
-    MS_ADPCM_state.wNumCoef = ((rogue_feel[1] << 8) | rogue_feel[0]);
-    rogue_feel += sizeof(Uint16);
-    if (MS_ADPCM_state.wNumCoef != 7) {
-        SDL_SetError("Unknown set of MS_ADPCM coefficients");
-        return (-1);
-    }
-    for (i = 0; i < MS_ADPCM_state.wNumCoef; ++i) {
-        MS_ADPCM_state.aCoeff[i][0] = ((rogue_feel[1] << 8) | rogue_feel[0]);
-        rogue_feel += sizeof(Uint16);
-        MS_ADPCM_state.aCoeff[i][1] = ((rogue_feel[1] << 8) | rogue_feel[0]);
-        rogue_feel += sizeof(Uint16);
-    }
-    return (0);
-}
-
-static Sint32
-MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state,
-                Uint8 nybble, Sint16 * coeff)
-{
-    const Sint32 max_audioval = ((1 << (16 - 1)) - 1);
-    const Sint32 min_audioval = -(1 << (16 - 1));
-    const Sint32 adaptive[] = {
-        230, 230, 230, 230, 307, 409, 512, 614,
-        768, 614, 512, 409, 307, 230, 230, 230
-    };
-    Sint32 new_sample, delta;
-
-    new_sample = ((state->iSamp1 * coeff[0]) +
-                  (state->iSamp2 * coeff[1])) / 256;
-    if (nybble & 0x08) {
-        new_sample += state->iDelta * (nybble - 0x10);
-    } else {
-        new_sample += state->iDelta * nybble;
-    }
-    if (new_sample < min_audioval) {
-        new_sample = min_audioval;
-    } else if (new_sample > max_audioval) {
-        new_sample = max_audioval;
-    }
-    delta = ((Sint32) state->iDelta * adaptive[nybble]) / 256;
-    if (delta < 16) {
-        delta = 16;
-    }
-    state->iDelta = (Uint16) delta;
-    state->iSamp2 = state->iSamp1;
-    state->iSamp1 = (Sint16) new_sample;
-    return (new_sample);
-}
-
-static int
-MS_ADPCM_decode(Uint8 ** audio_buf, Uint32 * audio_len)
-{
-    struct MS_ADPCM_decodestate *state[2];
-    Uint8 *freeable, *encoded, *decoded;
-    Sint32 encoded_len, samplesleft;
-    Sint8 nybble, stereo;
-    Sint16 *coeff[2];
-    Sint32 new_sample;
-
-    /* Allocate the proper sized output buffer */
-    encoded_len = *audio_len;
-    encoded = *audio_buf;
-    freeable = *audio_buf;
-    *audio_len = (encoded_len / MS_ADPCM_state.wavefmt.blockalign) *
-        MS_ADPCM_state.wSamplesPerBlock *
-        MS_ADPCM_state.wavefmt.channels * sizeof(Sint16);
-    *audio_buf = (Uint8 *) SDL_malloc(*audio_len);
-    if (*audio_buf == NULL) {
-        return SDL_OutOfMemory();
-    }
-    decoded = *audio_buf;
-
-    /* Get ready... Go! */
-    stereo = (MS_ADPCM_state.wavefmt.channels == 2);
-    state[0] = &MS_ADPCM_state.state[0];
-    state[1] = &MS_ADPCM_state.state[stereo];
-    while (encoded_len >= MS_ADPCM_state.wavefmt.blockalign) {
-        /* Grab the initial information for this block */
-        state[0]->hPredictor = *encoded++;
-        if (stereo) {
-            state[1]->hPredictor = *encoded++;
-        }
-        state[0]->iDelta = ((encoded[1] << 8) | encoded[0]);
-        encoded += sizeof(Sint16);
-        if (stereo) {
-            state[1]->iDelta = ((encoded[1] << 8) | encoded[0]);
-            encoded += sizeof(Sint16);
-        }
-        state[0]->iSamp1 = ((encoded[1] << 8) | encoded[0]);
-        encoded += sizeof(Sint16);
-        if (stereo) {
-            state[1]->iSamp1 = ((encoded[1] << 8) | encoded[0]);
-            encoded += sizeof(Sint16);
-        }
-        state[0]->iSamp2 = ((encoded[1] << 8) | encoded[0]);
-        encoded += sizeof(Sint16);
-        if (stereo) {
-            state[1]->iSamp2 = ((encoded[1] << 8) | encoded[0]);
-            encoded += sizeof(Sint16);
-        }
-        coeff[0] = MS_ADPCM_state.aCoeff[state[0]->hPredictor];
-        coeff[1] = MS_ADPCM_state.aCoeff[state[1]->hPredictor];
-
-        /* Store the two initial samples we start with */
-        decoded[0] = state[0]->iSamp2 & 0xFF;
-        decoded[1] = state[0]->iSamp2 >> 8;
-        decoded += 2;
-        if (stereo) {
-            decoded[0] = state[1]->iSamp2 & 0xFF;
-            decoded[1] = state[1]->iSamp2 >> 8;
-            decoded += 2;
-        }
-        decoded[0] = state[0]->iSamp1 & 0xFF;
-        decoded[1] = state[0]->iSamp1 >> 8;
-        decoded += 2;
-        if (stereo) {
-            decoded[0] = state[1]->iSamp1 & 0xFF;
-            decoded[1] = state[1]->iSamp1 >> 8;
-            decoded += 2;
-        }
-
-        /* Decode and store the other samples in this block */
-        samplesleft = (MS_ADPCM_state.wSamplesPerBlock - 2) *
-            MS_ADPCM_state.wavefmt.channels;
-        while (samplesleft > 0) {
-            nybble = (*encoded) >> 4;
-            new_sample = MS_ADPCM_nibble(state[0], nybble, coeff[0]);
-            decoded[0] = new_sample & 0xFF;
-            new_sample >>= 8;
-            decoded[1] = new_sample & 0xFF;
-            decoded += 2;
-
-            nybble = (*encoded) & 0x0F;
-            new_sample = MS_ADPCM_nibble(state[1], nybble, coeff[1]);
-            decoded[0] = new_sample & 0xFF;
-            new_sample >>= 8;
-            decoded[1] = new_sample & 0xFF;
-            decoded += 2;
-
-            ++encoded;
-            samplesleft -= 2;
-        }
-        encoded_len -= MS_ADPCM_state.wavefmt.blockalign;
-    }
-    SDL_free(freeable);
-    return (0);
-}
-
-struct IMA_ADPCM_decodestate
-{
-    Sint32 sample;
-    Sint8 index;
-};
-static struct IMA_ADPCM_decoder
-{
-    WaveFMT wavefmt;
-    Uint16 wSamplesPerBlock;
-    /* * * */
-    struct IMA_ADPCM_decodestate state[2];
-} IMA_ADPCM_state;
-
-static int
-InitIMA_ADPCM(WaveFMT * format)
-{
-    Uint8 *rogue_feel;
-
-    /* Set the rogue pointer to the IMA_ADPCM specific data */
-    IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding);
-    IMA_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels);
-    IMA_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency);
-    IMA_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate);
-    IMA_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign);
-    IMA_ADPCM_state.wavefmt.bitspersample =
-        SDL_SwapLE16(format->bitspersample);
-    rogue_feel = (Uint8 *) format + sizeof(*format);
-    if (sizeof(*format) == 16) {
-        /* const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
-        rogue_feel += sizeof(Uint16);
-    }
-    IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
-    return (0);
-}
-
-static Sint32
-IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state, Uint8 nybble)
-{
-    const Sint32 max_audioval = ((1 << (16 - 1)) - 1);
-    const Sint32 min_audioval = -(1 << (16 - 1));
-    const int index_table[16] = {
-        -1, -1, -1, -1,
-        2, 4, 6, 8,
-        -1, -1, -1, -1,
-        2, 4, 6, 8
-    };
-    const Sint32 step_table[89] = {
-        7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31,
-        34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130,
-        143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408,
-        449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282,
-        1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327,
-        3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630,
-        9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350,
-        22385, 24623, 27086, 29794, 32767
-    };
-    Sint32 delta, step;
-
-    /* Compute difference and new sample value */
-    if (state->index > 88) {
-        state->index = 88;
-    } else if (state->index < 0) {
-        state->index = 0;
-    }
-    step = step_table[state->index];
-    delta = step >> 3;
-    if (nybble & 0x04)
-        delta += step;
-    if (nybble & 0x02)
-        delta += (step >> 1);
-    if (nybble & 0x01)
-        delta += (step >> 2);
-    if (nybble & 0x08)
-        delta = -delta;
-    state->sample += delta;
-
-    /* Update index value */
-    state->index += index_table[nybble];
-
-    /* Clamp output sample */
-    if (state->sample > max_audioval) {
-        state->sample = max_audioval;
-    } else if (state->sample < min_audioval) {
-        state->sample = min_audioval;
-    }
-    return (state->sample);
-}
-
-/* Fill the decode buffer with a channel block of data (8 samples) */
-static void
-Fill_IMA_ADPCM_block(Uint8 * decoded, Uint8 * encoded,
-                     int channel, int numchannels,
-                     struct IMA_ADPCM_decodestate *state)
-{
-    int i;
-    Sint8 nybble;
-    Sint32 new_sample;
-
-    decoded += (channel * 2);
-    for (i = 0; i < 4; ++i) {
-        nybble = (*encoded) & 0x0F;
-        new_sample = IMA_ADPCM_nibble(state, nybble);
-        decoded[0] = new_sample & 0xFF;
-        new_sample >>= 8;
-        decoded[1] = new_sample & 0xFF;
-        decoded += 2 * numchannels;
-
-        nybble = (*encoded) >> 4;
-        new_sample = IMA_ADPCM_nibble(state, nybble);
-        decoded[0] = new_sample & 0xFF;
-        new_sample >>= 8;
-        decoded[1] = new_sample & 0xFF;
-        decoded += 2 * numchannels;
-
-        ++encoded;
-    }
-}
-
-static int
-IMA_ADPCM_decode(Uint8 ** audio_buf, Uint32 * audio_len)
-{
-    struct IMA_ADPCM_decodestate *state;
-    Uint8 *freeable, *encoded, *decoded;
-    Sint32 encoded_len, samplesleft;
-    unsigned int c, channels;
-
-    /* Check to make sure we have enough variables in the state array */
-    channels = IMA_ADPCM_state.wavefmt.channels;
-    if (channels > SDL_arraysize(IMA_ADPCM_state.state)) {
-        SDL_SetError("IMA ADPCM decoder can only handle %d channels",
-                     SDL_arraysize(IMA_ADPCM_state.state));
-        return (-1);
-    }
-    state = IMA_ADPCM_state.state;
-
-    /* Allocate the proper sized output buffer */
-    encoded_len = *audio_len;
-    encoded = *audio_buf;
-    freeable = *audio_buf;
-    *audio_len = (encoded_len / IMA_ADPCM_state.wavefmt.blockalign) *
-        IMA_ADPCM_state.wSamplesPerBlock *
-        IMA_ADPCM_state.wavefmt.channels * sizeof(Sint16);
-    *audio_buf = (Uint8 *) SDL_malloc(*audio_len);
-    if (*audio_buf == NULL) {
-        return SDL_OutOfMemory();
-    }
-    decoded = *audio_buf;
-
-    /* Get ready... Go! */
-    while (encoded_len >= IMA_ADPCM_state.wavefmt.blockalign) {
-        /* Grab the initial information for this block */
-        for (c = 0; c < channels; ++c) {
-            /* Fill the state information for this block */
-            state[c].sample = ((encoded[1] << 8) | encoded[0]);
-            encoded += 2;
-            if (state[c].sample & 0x8000) {
-                state[c].sample -= 0x10000;
-            }
-            state[c].index = *encoded++;
-            /* Reserved byte in buffer header, should be 0 */
-            if (*encoded++ != 0) {
-                /* Uh oh, corrupt data?  Buggy code? */ ;
-            }
-
-            /* Store the initial sample we start with */
-            decoded[0] = (Uint8) (state[c].sample & 0xFF);
-            decoded[1] = (Uint8) (state[c].sample >> 8);
-            decoded += 2;
-        }
-
-        /* Decode and store the other samples in this block */
-        samplesleft = (IMA_ADPCM_state.wSamplesPerBlock - 1) * channels;
-        while (samplesleft > 0) {
-            for (c = 0; c < channels; ++c) {
-                Fill_IMA_ADPCM_block(decoded, encoded,
-                                     c, channels, &state[c]);
-                encoded += 4;
-                samplesleft -= 8;
-            }
-            decoded += (channels * 8 * 2);
-        }
-        encoded_len -= IMA_ADPCM_state.wavefmt.blockalign;
-    }
-    SDL_free(freeable);
-    return (0);
-}
-
-SDL_AudioSpec *
-SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
-               SDL_AudioSpec * spec, Uint8 ** audio_buf, Uint32 * audio_len)
-{
-    int was_error;
-    Chunk chunk;
-    int lenread;
-    int IEEE_float_encoded, MS_ADPCM_encoded, IMA_ADPCM_encoded;
-    int samplesize;
-
-    /* WAV magic header */
-    Uint32 RIFFchunk;
-    Uint32 wavelen = 0;
-    Uint32 WAVEmagic;
-    Uint32 headerDiff = 0;
-
-    /* FMT chunk */
-    WaveFMT *format = NULL;
-
-    SDL_zero(chunk);
-
-    /* Make sure we are passed a valid data source */
-    was_error = 0;
-    if (src == NULL) {
-        was_error = 1;
-        goto done;
-    }
-
-    /* Check the magic header */
-    RIFFchunk = SDL_ReadLE32(src);
-    wavelen = SDL_ReadLE32(src);
-    if (wavelen == WAVE) {      /* The RIFFchunk has already been read */
-        WAVEmagic = wavelen;
-        wavelen = RIFFchunk;
-        RIFFchunk = RIFF;
-    } else {
-        WAVEmagic = SDL_ReadLE32(src);
-    }
-    if ((RIFFchunk != RIFF) || (WAVEmagic != WAVE)) {
-        SDL_SetError("Unrecognized file type (not WAVE)");
-        was_error = 1;
-        goto done;
-    }
-    headerDiff += sizeof(Uint32);       /* for WAVE */
-
-    /* Read the audio data format chunk */
-    chunk.data = NULL;
-    do {
-        SDL_free(chunk.data);
-        chunk.data = NULL;
-        lenread = ReadChunk(src, &chunk);
-        if (lenread < 0) {
-            was_error = 1;
-            goto done;
-        }
-        /* 2 Uint32's for chunk header+len, plus the lenread */
-        headerDiff += lenread + 2 * sizeof(Uint32);
-    } while ((chunk.magic == FACT) || (chunk.magic == LIST));
-
-    /* Decode the audio data format */
-    format = (WaveFMT *) chunk.data;
-    if (chunk.magic != FMT) {
-        SDL_SetError("Complex WAVE files not supported");
-        was_error = 1;
-        goto done;
-    }
-    IEEE_float_encoded = MS_ADPCM_encoded = IMA_ADPCM_encoded = 0;
-    switch (SDL_SwapLE16(format->encoding)) {
-    case PCM_CODE:
-        /* We can understand this */
-        break;
-    case IEEE_FLOAT_CODE:
-        IEEE_float_encoded = 1;
-        /* We can understand this */
-        break;
-    case MS_ADPCM_CODE:
-        /* Try to understand this */
-        if (InitMS_ADPCM(format) < 0) {
-            was_error = 1;
-            goto done;
-        }
-        MS_ADPCM_encoded = 1;
-        break;
-    case IMA_ADPCM_CODE:
-        /* Try to understand this */
-        if (InitIMA_ADPCM(format) < 0) {
-            was_error = 1;
-            goto done;
-        }
-        IMA_ADPCM_encoded = 1;
-        break;
-    case MP3_CODE:
-        SDL_SetError("MPEG Layer 3 data not supported",
-                     SDL_SwapLE16(format->encoding));
-        was_error = 1;
-        goto done;
-    default:
-        SDL_SetError("Unknown WAVE data format: 0x%.4x",
-                     SDL_SwapLE16(format->encoding));
-        was_error = 1;
-        goto done;
-    }
-    SDL_memset(spec, 0, (sizeof *spec));
-    spec->freq = SDL_SwapLE32(format->frequency);
-
-    if (IEEE_float_encoded) {
-        if ((SDL_SwapLE16(format->bitspersample)) != 32) {
-            was_error = 1;
-        } else {
-            spec->format = AUDIO_F32;
-        }
-    } else {
-        switch (SDL_SwapLE16(format->bitspersample)) {
-        case 4:
-            if (MS_ADPCM_encoded || IMA_ADPCM_encoded) {
-                spec->format = AUDIO_S16;
-            } else {
-                was_error = 1;
-            }
-            break;
-        case 8:
-            spec->format = AUDIO_U8;
-            break;
-        case 16:
-            spec->format = AUDIO_S16;
-            break;
-        case 32:
-            spec->format = AUDIO_S32;
-            break;
-        default:
-            was_error = 1;
-            break;
-        }
-    }
-
-    if (was_error) {
-        SDL_SetError("Unknown %d-bit PCM data format",
-                     SDL_SwapLE16(format->bitspersample));
-        goto done;
-    }
-    spec->channels = (Uint8) SDL_SwapLE16(format->channels);
-    spec->samples = 4096;       /* Good default buffer size */
-
-    /* Read the audio data chunk */
-    *audio_buf = NULL;
-    do {
-        SDL_free(*audio_buf);
-        *audio_buf = NULL;
-        lenread = ReadChunk(src, &chunk);
-        if (lenread < 0) {
-            was_error = 1;
-            goto done;
-        }
-        *audio_len = lenread;
-        *audio_buf = chunk.data;
-        if (chunk.magic != DATA)
-            headerDiff += lenread + 2 * sizeof(Uint32);
-    } while (chunk.magic != DATA);
-    headerDiff += 2 * sizeof(Uint32);   /* for the data chunk and len */
-
-    if (MS_ADPCM_encoded) {
-        if (MS_ADPCM_decode(audio_buf, audio_len) < 0) {
-            was_error = 1;
-            goto done;
-        }
-    }
-    if (IMA_ADPCM_encoded) {
-        if (IMA_ADPCM_decode(audio_buf, audio_len) < 0) {
-            was_error = 1;
-            goto done;
-        }
-    }
-
-    /* Don't return a buffer that isn't a multiple of samplesize */
-    samplesize = ((SDL_AUDIO_BITSIZE(spec->format)) / 8) * spec->channels;
-    *audio_len &= ~(samplesize - 1);
-
-  done:
-    SDL_free(format);
-    if (src) {
-        if (freesrc) {
-            SDL_RWclose(src);
-        } else {
-            /* seek to the end of the file (given by the RIFF chunk) */
-            SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
-        }
-    }
-    if (was_error) {
-        spec = NULL;
-    }
-    return (spec);
-}
-
-/* Since the WAV memory is allocated in the shared library, it must also
-   be freed here.  (Necessary under Win32, VC++)
- */
-void
-SDL_FreeWAV(Uint8 * audio_buf)
-{
-    SDL_free(audio_buf);
-}
-
-static int
-ReadChunk(SDL_RWops * src, Chunk * chunk)
-{
-    chunk->magic = SDL_ReadLE32(src);
-    chunk->length = SDL_ReadLE32(src);
-    chunk->data = (Uint8 *) SDL_malloc(chunk->length);
-    if (chunk->data == NULL) {
-        return SDL_OutOfMemory();
-    }
-    if (SDL_RWread(src, chunk->data, chunk->length, 1) != 1) {
-        SDL_free(chunk->data);
-        chunk->data = NULL;
-        return SDL_Error(SDL_EFREAD);
-    }
-    return (chunk->length);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/SDL_wave.h b/deps/SDL2/src/audio/SDL_wave.h
deleted file mode 100644
index d82399c..0000000
--- a/deps/SDL2/src/audio/SDL_wave.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* WAVE files are little-endian */
-
-/*******************************************/
-/* Define values for Microsoft WAVE format */
-/*******************************************/
-#define RIFF            0x46464952      /* "RIFF" */
-#define WAVE            0x45564157      /* "WAVE" */
-#define FACT            0x74636166      /* "fact" */
-#define LIST            0x5453494c      /* "LIST" */
-#define FMT             0x20746D66      /* "fmt " */
-#define DATA            0x61746164      /* "data" */
-#define PCM_CODE        0x0001
-#define MS_ADPCM_CODE   0x0002
-#define IEEE_FLOAT_CODE 0x0003
-#define IMA_ADPCM_CODE  0x0011
-#define MP3_CODE        0x0055
-#define WAVE_MONO       1
-#define WAVE_STEREO     2
-
-/* Normally, these three chunks come consecutively in a WAVE file */
-typedef struct WaveFMT
-{
-/* Not saved in the chunk we read:
-    Uint32  FMTchunk;
-    Uint32  fmtlen;
-*/
-    Uint16 encoding;
-    Uint16 channels;            /* 1 = mono, 2 = stereo */
-    Uint32 frequency;           /* One of 11025, 22050, or 44100 Hz */
-    Uint32 byterate;            /* Average bytes per second */
-    Uint16 blockalign;          /* Bytes per sample block */
-    Uint16 bitspersample;       /* One of 8, 12, 16, or 4 for ADPCM */
-} WaveFMT;
-
-/* The general chunk found in the WAVE file */
-typedef struct Chunk
-{
-    Uint32 magic;
-    Uint32 length;
-    Uint8 *data;
-} Chunk;
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/alsa/SDL_alsa_audio.c b/deps/SDL2/src/audio/alsa/SDL_alsa_audio.c
deleted file mode 100644
index 5ff4cef..0000000
--- a/deps/SDL2/src/audio/alsa/SDL_alsa_audio.c
+++ /dev/null
@@ -1,685 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_ALSA
-
-/* Allow access to a raw mixing buffer */
-
-#include <sys/types.h>
-#include <signal.h>             /* For kill() */
-#include <errno.h>
-#include <string.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_alsa_audio.h"
-
-#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-#include "SDL_loadso.h"
-#endif
-
-static int (*ALSA_snd_pcm_open)
-  (snd_pcm_t **, const char *, snd_pcm_stream_t, int);
-static int (*ALSA_snd_pcm_close) (snd_pcm_t * pcm);
-static snd_pcm_sframes_t(*ALSA_snd_pcm_writei)
-  (snd_pcm_t *, const void *, snd_pcm_uframes_t);
-static int (*ALSA_snd_pcm_recover) (snd_pcm_t *, int, int);
-static int (*ALSA_snd_pcm_prepare) (snd_pcm_t *);
-static int (*ALSA_snd_pcm_drain) (snd_pcm_t *);
-static const char *(*ALSA_snd_strerror) (int);
-static size_t(*ALSA_snd_pcm_hw_params_sizeof) (void);
-static size_t(*ALSA_snd_pcm_sw_params_sizeof) (void);
-static void (*ALSA_snd_pcm_hw_params_copy)
-  (snd_pcm_hw_params_t *, const snd_pcm_hw_params_t *);
-static int (*ALSA_snd_pcm_hw_params_any) (snd_pcm_t *, snd_pcm_hw_params_t *);
-static int (*ALSA_snd_pcm_hw_params_set_access)
-  (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_access_t);
-static int (*ALSA_snd_pcm_hw_params_set_format)
-  (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_format_t);
-static int (*ALSA_snd_pcm_hw_params_set_channels)
-  (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int);
-static int (*ALSA_snd_pcm_hw_params_get_channels)
-  (const snd_pcm_hw_params_t *, unsigned int *);
-static int (*ALSA_snd_pcm_hw_params_set_rate_near)
-  (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *);
-static int (*ALSA_snd_pcm_hw_params_set_period_size_near)
-  (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *);
-static int (*ALSA_snd_pcm_hw_params_get_period_size)
-  (const snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *);
-static int (*ALSA_snd_pcm_hw_params_set_periods_near)
-  (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *);
-static int (*ALSA_snd_pcm_hw_params_get_periods)
-  (const snd_pcm_hw_params_t *, unsigned int *, int *);
-static int (*ALSA_snd_pcm_hw_params_set_buffer_size_near)
-  (snd_pcm_t *pcm, snd_pcm_hw_params_t *, snd_pcm_uframes_t *);
-static int (*ALSA_snd_pcm_hw_params_get_buffer_size)
-  (const snd_pcm_hw_params_t *, snd_pcm_uframes_t *);
-static int (*ALSA_snd_pcm_hw_params) (snd_pcm_t *, snd_pcm_hw_params_t *);
-static int (*ALSA_snd_pcm_sw_params_current) (snd_pcm_t *,
-                                              snd_pcm_sw_params_t *);
-static int (*ALSA_snd_pcm_sw_params_set_start_threshold)
-  (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t);
-static int (*ALSA_snd_pcm_sw_params) (snd_pcm_t *, snd_pcm_sw_params_t *);
-static int (*ALSA_snd_pcm_nonblock) (snd_pcm_t *, int);
-static int (*ALSA_snd_pcm_wait)(snd_pcm_t *, int);
-static int (*ALSA_snd_pcm_sw_params_set_avail_min)
-  (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t);
-
-#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-#define snd_pcm_hw_params_sizeof ALSA_snd_pcm_hw_params_sizeof
-#define snd_pcm_sw_params_sizeof ALSA_snd_pcm_sw_params_sizeof
-
-static const char *alsa_library = SDL_AUDIO_DRIVER_ALSA_DYNAMIC;
-static void *alsa_handle = NULL;
-
-static int
-load_alsa_sym(const char *fn, void **addr)
-{
-    *addr = SDL_LoadFunction(alsa_handle, fn);
-    if (*addr == NULL) {
-        /* Don't call SDL_SetError(): SDL_LoadFunction already did. */
-        return 0;
-    }
-
-    return 1;
-}
-
-/* cast funcs to char* first, to please GCC's strict aliasing rules. */
-#define SDL_ALSA_SYM(x) \
-    if (!load_alsa_sym(#x, (void **) (char *) &ALSA_##x)) return -1
-#else
-#define SDL_ALSA_SYM(x) ALSA_##x = x
-#endif
-
-static int
-load_alsa_syms(void)
-{
-    SDL_ALSA_SYM(snd_pcm_open);
-    SDL_ALSA_SYM(snd_pcm_close);
-    SDL_ALSA_SYM(snd_pcm_writei);
-    SDL_ALSA_SYM(snd_pcm_recover);
-    SDL_ALSA_SYM(snd_pcm_prepare);
-    SDL_ALSA_SYM(snd_pcm_drain);
-    SDL_ALSA_SYM(snd_strerror);
-    SDL_ALSA_SYM(snd_pcm_hw_params_sizeof);
-    SDL_ALSA_SYM(snd_pcm_sw_params_sizeof);
-    SDL_ALSA_SYM(snd_pcm_hw_params_copy);
-    SDL_ALSA_SYM(snd_pcm_hw_params_any);
-    SDL_ALSA_SYM(snd_pcm_hw_params_set_access);
-    SDL_ALSA_SYM(snd_pcm_hw_params_set_format);
-    SDL_ALSA_SYM(snd_pcm_hw_params_set_channels);
-    SDL_ALSA_SYM(snd_pcm_hw_params_get_channels);
-    SDL_ALSA_SYM(snd_pcm_hw_params_set_rate_near);
-    SDL_ALSA_SYM(snd_pcm_hw_params_set_period_size_near);
-    SDL_ALSA_SYM(snd_pcm_hw_params_get_period_size);
-    SDL_ALSA_SYM(snd_pcm_hw_params_set_periods_near);
-    SDL_ALSA_SYM(snd_pcm_hw_params_get_periods);
-    SDL_ALSA_SYM(snd_pcm_hw_params_set_buffer_size_near);
-    SDL_ALSA_SYM(snd_pcm_hw_params_get_buffer_size);
-    SDL_ALSA_SYM(snd_pcm_hw_params);
-    SDL_ALSA_SYM(snd_pcm_sw_params_current);
-    SDL_ALSA_SYM(snd_pcm_sw_params_set_start_threshold);
-    SDL_ALSA_SYM(snd_pcm_sw_params);
-    SDL_ALSA_SYM(snd_pcm_nonblock);
-    SDL_ALSA_SYM(snd_pcm_wait);
-    SDL_ALSA_SYM(snd_pcm_sw_params_set_avail_min);
-    return 0;
-}
-
-#undef SDL_ALSA_SYM
-
-#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-
-static void
-UnloadALSALibrary(void)
-{
-    if (alsa_handle != NULL) {
-        SDL_UnloadObject(alsa_handle);
-        alsa_handle = NULL;
-    }
-}
-
-static int
-LoadALSALibrary(void)
-{
-    int retval = 0;
-    if (alsa_handle == NULL) {
-        alsa_handle = SDL_LoadObject(alsa_library);
-        if (alsa_handle == NULL) {
-            retval = -1;
-            /* Don't call SDL_SetError(): SDL_LoadObject already did. */
-        } else {
-            retval = load_alsa_syms();
-            if (retval < 0) {
-                UnloadALSALibrary();
-            }
-        }
-    }
-    return retval;
-}
-
-#else
-
-static void
-UnloadALSALibrary(void)
-{
-}
-
-static int
-LoadALSALibrary(void)
-{
-    load_alsa_syms();
-    return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
-
-static const char *
-get_audio_device(int channels)
-{
-    const char *device;
-
-    device = SDL_getenv("AUDIODEV");    /* Is there a standard variable name? */
-    if (device == NULL) {
-        switch (channels) {
-        case 6:
-            device = "plug:surround51";
-            break;
-        case 4:
-            device = "plug:surround40";
-            break;
-        default:
-            device = "default";
-            break;
-        }
-    }
-    return device;
-}
-
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-ALSA_WaitDevice(_THIS)
-{
-    /* We're in blocking mode, so there's nothing to do here */
-}
-
-
-/* !!! FIXME: is there a channel swizzler in alsalib instead? */
-/*
- * http://bugzilla.libsdl.org/show_bug.cgi?id=110
- * "For Linux ALSA, this is FL-FR-RL-RR-C-LFE
- *  and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-RL-RR"
- */
-#define SWIZ6(T) \
-    T *ptr = (T *) this->hidden->mixbuf; \
-    Uint32 i; \
-    for (i = 0; i < this->spec.samples; i++, ptr += 6) { \
-        T tmp; \
-        tmp = ptr[2]; ptr[2] = ptr[4]; ptr[4] = tmp; \
-        tmp = ptr[3]; ptr[3] = ptr[5]; ptr[5] = tmp; \
-    }
-
-static SDL_INLINE void
-swizzle_alsa_channels_6_64bit(_THIS)
-{
-    SWIZ6(Uint64);
-}
-
-static SDL_INLINE void
-swizzle_alsa_channels_6_32bit(_THIS)
-{
-    SWIZ6(Uint32);
-}
-
-static SDL_INLINE void
-swizzle_alsa_channels_6_16bit(_THIS)
-{
-    SWIZ6(Uint16);
-}
-
-static SDL_INLINE void
-swizzle_alsa_channels_6_8bit(_THIS)
-{
-    SWIZ6(Uint8);
-}
-
-#undef SWIZ6
-
-
-/*
- * Called right before feeding this->hidden->mixbuf to the hardware. Swizzle
- *  channels from Windows/Mac order to the format alsalib will want.
- */
-static SDL_INLINE void
-swizzle_alsa_channels(_THIS)
-{
-    if (this->spec.channels == 6) {
-        const Uint16 fmtsize = (this->spec.format & 0xFF);      /* bits/channel. */
-        if (fmtsize == 16)
-            swizzle_alsa_channels_6_16bit(this);
-        else if (fmtsize == 8)
-            swizzle_alsa_channels_6_8bit(this);
-        else if (fmtsize == 32)
-            swizzle_alsa_channels_6_32bit(this);
-        else if (fmtsize == 64)
-            swizzle_alsa_channels_6_64bit(this);
-    }
-
-    /* !!! FIXME: update this for 7.1 if needed, later. */
-}
-
-
-static void
-ALSA_PlayDevice(_THIS)
-{
-    int status;
-    const Uint8 *sample_buf = (const Uint8 *) this->hidden->mixbuf;
-    const int frame_size = (((int) (this->spec.format & 0xFF)) / 8) *
-                                this->spec.channels;
-    snd_pcm_uframes_t frames_left = ((snd_pcm_uframes_t) this->spec.samples);
-
-    swizzle_alsa_channels(this);
-
-    while ( frames_left > 0 && this->enabled ) {
-        /* !!! FIXME: This works, but needs more testing before going live */
-        /* ALSA_snd_pcm_wait(this->hidden->pcm_handle, -1); */
-        status = ALSA_snd_pcm_writei(this->hidden->pcm_handle,
-                                     sample_buf, frames_left);
-
-        if (status < 0) {
-            if (status == -EAGAIN) {
-                /* Apparently snd_pcm_recover() doesn't handle this case -
-                   does it assume snd_pcm_wait() above? */
-                SDL_Delay(1);
-                continue;
-            }
-            status = ALSA_snd_pcm_recover(this->hidden->pcm_handle, status, 0);
-            if (status < 0) {
-                /* Hmm, not much we can do - abort */
-                fprintf(stderr, "ALSA write failed (unrecoverable): %s\n",
-                        ALSA_snd_strerror(status));
-                this->enabled = 0;
-                return;
-            }
-            continue;
-        }
-        sample_buf += status * frame_size;
-        frames_left -= status;
-    }
-}
-
-static Uint8 *
-ALSA_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-static void
-ALSA_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->pcm_handle) {
-            ALSA_snd_pcm_drain(this->hidden->pcm_handle);
-            ALSA_snd_pcm_close(this->hidden->pcm_handle);
-            this->hidden->pcm_handle = NULL;
-        }
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static int
-ALSA_finalize_hardware(_THIS, snd_pcm_hw_params_t *hwparams, int override)
-{
-    int status;
-    snd_pcm_uframes_t bufsize;
-
-    /* "set" the hardware with the desired parameters */
-    status = ALSA_snd_pcm_hw_params(this->hidden->pcm_handle, hwparams);
-    if ( status < 0 ) {
-        return(-1);
-    }
-
-    /* Get samples for the actual buffer size */
-    status = ALSA_snd_pcm_hw_params_get_buffer_size(hwparams, &bufsize);
-    if ( status < 0 ) {
-        return(-1);
-    }
-    if ( !override && bufsize != this->spec.samples * 2 ) {
-        return(-1);
-    }
-
-    /* !!! FIXME: Is this safe to do? */
-    this->spec.samples = bufsize / 2;
-
-    /* This is useful for debugging */
-    if ( SDL_getenv("SDL_AUDIO_ALSA_DEBUG") ) {
-        snd_pcm_uframes_t persize = 0;
-        unsigned int periods = 0;
-
-        ALSA_snd_pcm_hw_params_get_period_size(hwparams, &persize, NULL);
-        ALSA_snd_pcm_hw_params_get_periods(hwparams, &periods, NULL);
-
-        fprintf(stderr,
-            "ALSA: period size = %ld, periods = %u, buffer size = %lu\n",
-            persize, periods, bufsize);
-    }
-
-    return(0);
-}
-
-static int
-ALSA_set_period_size(_THIS, snd_pcm_hw_params_t *params, int override)
-{
-    const char *env;
-    int status;
-    snd_pcm_hw_params_t *hwparams;
-    snd_pcm_uframes_t frames;
-    unsigned int periods;
-
-    /* Copy the hardware parameters for this setup */
-    snd_pcm_hw_params_alloca(&hwparams);
-    ALSA_snd_pcm_hw_params_copy(hwparams, params);
-
-    if ( !override ) {
-        env = SDL_getenv("SDL_AUDIO_ALSA_SET_PERIOD_SIZE");
-        if ( env ) {
-            override = SDL_atoi(env);
-            if ( override == 0 ) {
-                return(-1);
-            }
-        }
-    }
-
-    frames = this->spec.samples;
-    status = ALSA_snd_pcm_hw_params_set_period_size_near(
-                this->hidden->pcm_handle, hwparams, &frames, NULL);
-    if ( status < 0 ) {
-        return(-1);
-    }
-
-    periods = 2;
-    status = ALSA_snd_pcm_hw_params_set_periods_near(
-                this->hidden->pcm_handle, hwparams, &periods, NULL);
-    if ( status < 0 ) {
-        return(-1);
-    }
-
-    return ALSA_finalize_hardware(this, hwparams, override);
-}
-
-static int
-ALSA_set_buffer_size(_THIS, snd_pcm_hw_params_t *params, int override)
-{
-    const char *env;
-    int status;
-    snd_pcm_hw_params_t *hwparams;
-    snd_pcm_uframes_t frames;
-
-    /* Copy the hardware parameters for this setup */
-    snd_pcm_hw_params_alloca(&hwparams);
-    ALSA_snd_pcm_hw_params_copy(hwparams, params);
-
-    if ( !override ) {
-        env = SDL_getenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE");
-        if ( env ) {
-            override = SDL_atoi(env);
-            if ( override == 0 ) {
-                return(-1);
-            }
-        }
-    }
-
-    frames = this->spec.samples * 2;
-    status = ALSA_snd_pcm_hw_params_set_buffer_size_near(
-                    this->hidden->pcm_handle, hwparams, &frames);
-    if ( status < 0 ) {
-        return(-1);
-    }
-
-    return ALSA_finalize_hardware(this, hwparams, override);
-}
-
-static int
-ALSA_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    int status = 0;
-    snd_pcm_t *pcm_handle = NULL;
-    snd_pcm_hw_params_t *hwparams = NULL;
-    snd_pcm_sw_params_t *swparams = NULL;
-    snd_pcm_format_t format = 0;
-    SDL_AudioFormat test_format = 0;
-    unsigned int rate = 0;
-    unsigned int channels = 0;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Open the audio device */
-    /* Name of device should depend on # channels in spec */
-    status = ALSA_snd_pcm_open(&pcm_handle,
-                               get_audio_device(this->spec.channels),
-                               SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
-
-    if (status < 0) {
-        ALSA_CloseDevice(this);
-        return SDL_SetError("ALSA: Couldn't open audio device: %s",
-                            ALSA_snd_strerror(status));
-    }
-
-    this->hidden->pcm_handle = pcm_handle;
-
-    /* Figure out what the hardware is capable of */
-    snd_pcm_hw_params_alloca(&hwparams);
-    status = ALSA_snd_pcm_hw_params_any(pcm_handle, hwparams);
-    if (status < 0) {
-        ALSA_CloseDevice(this);
-        return SDL_SetError("ALSA: Couldn't get hardware config: %s",
-                            ALSA_snd_strerror(status));
-    }
-
-    /* SDL only uses interleaved sample output */
-    status = ALSA_snd_pcm_hw_params_set_access(pcm_handle, hwparams,
-                                               SND_PCM_ACCESS_RW_INTERLEAVED);
-    if (status < 0) {
-        ALSA_CloseDevice(this);
-        return SDL_SetError("ALSA: Couldn't set interleaved access: %s",
-                     ALSA_snd_strerror(status));
-    }
-
-    /* Try for a closest match on audio format */
-    status = -1;
-    for (test_format = SDL_FirstAudioFormat(this->spec.format);
-         test_format && (status < 0);) {
-        status = 0;             /* if we can't support a format, it'll become -1. */
-        switch (test_format) {
-        case AUDIO_U8:
-            format = SND_PCM_FORMAT_U8;
-            break;
-        case AUDIO_S8:
-            format = SND_PCM_FORMAT_S8;
-            break;
-        case AUDIO_S16LSB:
-            format = SND_PCM_FORMAT_S16_LE;
-            break;
-        case AUDIO_S16MSB:
-            format = SND_PCM_FORMAT_S16_BE;
-            break;
-        case AUDIO_U16LSB:
-            format = SND_PCM_FORMAT_U16_LE;
-            break;
-        case AUDIO_U16MSB:
-            format = SND_PCM_FORMAT_U16_BE;
-            break;
-        case AUDIO_S32LSB:
-            format = SND_PCM_FORMAT_S32_LE;
-            break;
-        case AUDIO_S32MSB:
-            format = SND_PCM_FORMAT_S32_BE;
-            break;
-        case AUDIO_F32LSB:
-            format = SND_PCM_FORMAT_FLOAT_LE;
-            break;
-        case AUDIO_F32MSB:
-            format = SND_PCM_FORMAT_FLOAT_BE;
-            break;
-        default:
-            status = -1;
-            break;
-        }
-        if (status >= 0) {
-            status = ALSA_snd_pcm_hw_params_set_format(pcm_handle,
-                                                       hwparams, format);
-        }
-        if (status < 0) {
-            test_format = SDL_NextAudioFormat();
-        }
-    }
-    if (status < 0) {
-        ALSA_CloseDevice(this);
-        return SDL_SetError("ALSA: Couldn't find any hardware audio formats");
-    }
-    this->spec.format = test_format;
-
-    /* Set the number of channels */
-    status = ALSA_snd_pcm_hw_params_set_channels(pcm_handle, hwparams,
-                                                 this->spec.channels);
-    channels = this->spec.channels;
-    if (status < 0) {
-        status = ALSA_snd_pcm_hw_params_get_channels(hwparams, &channels);
-        if (status < 0) {
-            ALSA_CloseDevice(this);
-            return SDL_SetError("ALSA: Couldn't set audio channels");
-        }
-        this->spec.channels = channels;
-    }
-
-    /* Set the audio rate */
-    rate = this->spec.freq;
-    status = ALSA_snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams,
-                                                  &rate, NULL);
-    if (status < 0) {
-        ALSA_CloseDevice(this);
-        return SDL_SetError("ALSA: Couldn't set audio frequency: %s",
-                            ALSA_snd_strerror(status));
-    }
-    this->spec.freq = rate;
-
-    /* Set the buffer size, in samples */
-    if ( ALSA_set_period_size(this, hwparams, 0) < 0 &&
-         ALSA_set_buffer_size(this, hwparams, 0) < 0 ) {
-        /* Failed to set desired buffer size, do the best you can... */
-        if ( ALSA_set_period_size(this, hwparams, 1) < 0 ) {
-            ALSA_CloseDevice(this);
-            return SDL_SetError("Couldn't set hardware audio parameters: %s", ALSA_snd_strerror(status));
-        }
-    }
-    /* Set the software parameters */
-    snd_pcm_sw_params_alloca(&swparams);
-    status = ALSA_snd_pcm_sw_params_current(pcm_handle, swparams);
-    if (status < 0) {
-        ALSA_CloseDevice(this);
-        return SDL_SetError("ALSA: Couldn't get software config: %s",
-                            ALSA_snd_strerror(status));
-    }
-    status = ALSA_snd_pcm_sw_params_set_avail_min(pcm_handle, swparams, this->spec.samples);
-    if (status < 0) {
-        ALSA_CloseDevice(this);
-        return SDL_SetError("Couldn't set minimum available samples: %s",
-                            ALSA_snd_strerror(status));
-    }
-    status =
-        ALSA_snd_pcm_sw_params_set_start_threshold(pcm_handle, swparams, 1);
-    if (status < 0) {
-        ALSA_CloseDevice(this);
-        return SDL_SetError("ALSA: Couldn't set start threshold: %s",
-                            ALSA_snd_strerror(status));
-    }
-    status = ALSA_snd_pcm_sw_params(pcm_handle, swparams);
-    if (status < 0) {
-        ALSA_CloseDevice(this);
-        return SDL_SetError("Couldn't set software audio parameters: %s",
-                            ALSA_snd_strerror(status));
-    }
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Allocate mixing buffer */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        ALSA_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen);
-
-    /* Switch to blocking mode for playback */
-    ALSA_snd_pcm_nonblock(pcm_handle, 0);
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-static void
-ALSA_Deinitialize(void)
-{
-    UnloadALSALibrary();
-}
-
-static int
-ALSA_Init(SDL_AudioDriverImpl * impl)
-{
-    if (LoadALSALibrary() < 0) {
-        return 0;
-    }
-
-    /* Set the function pointers */
-    impl->OpenDevice = ALSA_OpenDevice;
-    impl->WaitDevice = ALSA_WaitDevice;
-    impl->GetDeviceBuf = ALSA_GetDeviceBuf;
-    impl->PlayDevice = ALSA_PlayDevice;
-    impl->CloseDevice = ALSA_CloseDevice;
-    impl->Deinitialize = ALSA_Deinitialize;
-    impl->OnlyHasDefaultOutputDevice = 1;       /* !!! FIXME: Add device enum! */
-
-    return 1;   /* this audio target is available. */
-}
-
-
-AudioBootStrap ALSA_bootstrap = {
-    "alsa", "ALSA PCM audio", ALSA_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_ALSA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/alsa/SDL_alsa_audio.h b/deps/SDL2/src/audio/alsa/SDL_alsa_audio.h
deleted file mode 100644
index 31c6534..0000000
--- a/deps/SDL2/src/audio/alsa/SDL_alsa_audio.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_ALSA_audio_h
-#define _SDL_ALSA_audio_h
-
-#include <alsa/asoundlib.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The audio device handle */
-    snd_pcm_t *pcm_handle;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-};
-
-#endif /* _SDL_ALSA_audio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/android/SDL_androidaudio.c b/deps/SDL2/src/audio/android/SDL_androidaudio.c
deleted file mode 100644
index 94e27f3..0000000
--- a/deps/SDL2/src/audio/android/SDL_androidaudio.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_ANDROID
-
-/* Output audio to Android */
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "SDL_androidaudio.h"
-
-#include "../../core/android/SDL_android.h"
-
-#include <android/log.h>
-
-static void * audioDevice;
-
-static int
-AndroidAUD_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    SDL_AudioFormat test_format;
-
-    if (iscapture) {
-        /* TODO: implement capture */
-        return SDL_SetError("Capture not supported on Android");
-    }
-
-    if (audioDevice != NULL) {
-        return SDL_SetError("Only one audio device at a time please!");
-    }
-
-    audioDevice = this;
-
-    test_format = SDL_FirstAudioFormat(this->spec.format);
-    while (test_format != 0) { /* no "UNKNOWN" constant */
-        if ((test_format == AUDIO_U8) || (test_format == AUDIO_S16LSB)) {
-            this->spec.format = test_format;
-            break;
-        }
-        test_format = SDL_NextAudioFormat();
-    }
-
-    if (test_format == 0) {
-        /* Didn't find a compatible format :( */
-        return SDL_SetError("No compatible audio format!");
-    }
-
-    if (this->spec.channels > 1) {
-        this->spec.channels = 2;
-    } else {
-        this->spec.channels = 1;
-    }
-
-    if (this->spec.freq < 8000) {
-        this->spec.freq = 8000;
-    }
-    if (this->spec.freq > 48000) {
-        this->spec.freq = 48000;
-    }
-
-    /* TODO: pass in/return a (Java) device ID, also whether we're opening for input or output */
-    this->spec.samples = Android_JNI_OpenAudioDevice(this->spec.freq, this->spec.format == AUDIO_U8 ? 0 : 1, this->spec.channels, this->spec.samples);
-    SDL_CalculateAudioSpec(&this->spec);
-
-    if (this->spec.samples == 0) {
-        /* Init failed? */
-        return SDL_SetError("Java-side initialization failed!");
-    }
-
-    return 0;
-}
-
-static void
-AndroidAUD_PlayDevice(_THIS)
-{
-    Android_JNI_WriteAudioBuffer();
-}
-
-static Uint8 *
-AndroidAUD_GetDeviceBuf(_THIS)
-{
-    return Android_JNI_GetAudioBuffer();
-}
-
-static void
-AndroidAUD_CloseDevice(_THIS)
-{
-    /* At this point SDL_CloseAudioDevice via close_audio_device took care of terminating the audio thread
-       so it's safe to terminate the Java side buffer and AudioTrack
-     */
-    Android_JNI_CloseAudioDevice();
-
-    if (audioDevice == this) {
-        audioDevice = NULL;
-    }
-}
-
-static int
-AndroidAUD_Init(SDL_AudioDriverImpl * impl)
-{
-    /* Set the function pointers */
-    impl->OpenDevice = AndroidAUD_OpenDevice;
-    impl->PlayDevice = AndroidAUD_PlayDevice;
-    impl->GetDeviceBuf = AndroidAUD_GetDeviceBuf;
-    impl->CloseDevice = AndroidAUD_CloseDevice;
-
-    /* and the capabilities */
-    impl->HasCaptureSupport = 0; /* TODO */
-    impl->OnlyHasDefaultOutputDevice = 1;
-    impl->OnlyHasDefaultInputDevice = 1;
-
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap ANDROIDAUD_bootstrap = {
-    "android", "SDL Android audio driver", AndroidAUD_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/deps/SDL2/src/audio/android/SDL_androidaudio.h b/deps/SDL2/src/audio/android/SDL_androidaudio.h
deleted file mode 100644
index c02ad1a..0000000
--- a/deps/SDL2/src/audio/android/SDL_androidaudio.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_androidaudio_h
-#define _SDL_androidaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-};
-
-static void AndroidAUD_CloseDevice(_THIS);
-
-#endif /* _SDL_androidaudio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/arts/SDL_artsaudio.c b/deps/SDL2/src/audio/arts/SDL_artsaudio.c
deleted file mode 100644
index 7e835c1..0000000
--- a/deps/SDL2/src/audio/arts/SDL_artsaudio.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_ARTS
-
-/* Allow access to a raw mixing buffer */
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#include <unistd.h>
-#include <errno.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_artsaudio.h"
-
-#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-#else
-#define SDL_NAME(X)	X
-#endif
-
-#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
-
-static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
-static void *arts_handle = NULL;
-
-/* !!! FIXME: I hate this SDL_NAME clutter...it makes everything so messy! */
-static int (*SDL_NAME(arts_init)) (void);
-static void (*SDL_NAME(arts_free)) (void);
-static arts_stream_t(*SDL_NAME(arts_play_stream)) (int rate, int bits,
-                                                   int channels,
-                                                   const char *name);
-static int (*SDL_NAME(arts_stream_set)) (arts_stream_t s,
-                                         arts_parameter_t param, int value);
-static int (*SDL_NAME(arts_stream_get)) (arts_stream_t s,
-                                         arts_parameter_t param);
-static int (*SDL_NAME(arts_write)) (arts_stream_t s, const void *buffer,
-                                    int count);
-static void (*SDL_NAME(arts_close_stream)) (arts_stream_t s);
-static int (*SDL_NAME(arts_suspend))(void);
-static int (*SDL_NAME(arts_suspended)) (void);
-static const char *(*SDL_NAME(arts_error_text)) (int errorcode);
-
-#define SDL_ARTS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) }
-static struct
-{
-    const char *name;
-    void **func;
-} arts_functions[] = {
-/* *INDENT-OFF* */
-    SDL_ARTS_SYM(arts_init),
-    SDL_ARTS_SYM(arts_free),
-    SDL_ARTS_SYM(arts_play_stream),
-    SDL_ARTS_SYM(arts_stream_set),
-    SDL_ARTS_SYM(arts_stream_get),
-    SDL_ARTS_SYM(arts_write),
-    SDL_ARTS_SYM(arts_close_stream),
-    SDL_ARTS_SYM(arts_suspend),
-    SDL_ARTS_SYM(arts_suspended),
-    SDL_ARTS_SYM(arts_error_text),
-/* *INDENT-ON* */
-};
-
-#undef SDL_ARTS_SYM
-
-static void
-UnloadARTSLibrary()
-{
-    if (arts_handle != NULL) {
-        SDL_UnloadObject(arts_handle);
-        arts_handle = NULL;
-    }
-}
-
-static int
-LoadARTSLibrary(void)
-{
-    int i, retval = -1;
-
-    if (arts_handle == NULL) {
-        arts_handle = SDL_LoadObject(arts_library);
-        if (arts_handle != NULL) {
-            retval = 0;
-            for (i = 0; i < SDL_arraysize(arts_functions); ++i) {
-                *arts_functions[i].func =
-                    SDL_LoadFunction(arts_handle, arts_functions[i].name);
-                if (!*arts_functions[i].func) {
-                    retval = -1;
-                    UnloadARTSLibrary();
-                    break;
-                }
-            }
-        }
-    }
-
-    return retval;
-}
-
-#else
-
-static void
-UnloadARTSLibrary()
-{
-    return;
-}
-
-static int
-LoadARTSLibrary(void)
-{
-    return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-ARTS_WaitDevice(_THIS)
-{
-    Sint32 ticks;
-
-    /* Check to see if the thread-parent process is still alive */
-    {
-        static int cnt = 0;
-        /* Note that this only works with thread implementations
-           that use a different process id for each thread.
-         */
-        /* Check every 10 loops */
-        if (this->hidden->parent && (((++cnt) % 10) == 0)) {
-            if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) {
-                this->enabled = 0;
-            }
-        }
-    }
-
-    /* Use timer for general audio synchronization */
-    ticks =
-        ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS;
-    if (ticks > 0) {
-        SDL_Delay(ticks);
-    }
-}
-
-static void
-ARTS_PlayDevice(_THIS)
-{
-    /* Write the audio data */
-    int written = SDL_NAME(arts_write) (this->hidden->stream,
-                                        this->hidden->mixbuf,
-                                        this->hidden->mixlen);
-
-    /* If timer synchronization is enabled, set the next write frame */
-    if (this->hidden->frame_ticks) {
-        this->hidden->next_frame += this->hidden->frame_ticks;
-    }
-
-    /* If we couldn't write, assume fatal error for now */
-    if (written < 0) {
-        this->enabled = 0;
-    }
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static void
-ARTS_WaitDone(_THIS)
-{
-    /* !!! FIXME: camp here until buffer drains... SDL_Delay(???); */
-}
-
-
-static Uint8 *
-ARTS_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-
-static void
-ARTS_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->stream) {
-            SDL_NAME(arts_close_stream) (this->hidden->stream);
-            this->hidden->stream = 0;
-        }
-        SDL_NAME(arts_free) ();
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static int
-ARTS_Suspend(void)
-{
-    const Uint32 abortms = SDL_GetTicks() + 3000; /* give up after 3 secs */
-    while ( (!SDL_NAME(arts_suspended)()) && !SDL_TICKS_PASSED(SDL_GetTicks(), abortms) ) {
-        if ( SDL_NAME(arts_suspend)() ) {
-            break;
-        }
-    }
-    return SDL_NAME(arts_suspended)();
-}
-
-static int
-ARTS_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    int rc = 0;
-    int bits = 0, frag_spec = 0;
-    SDL_AudioFormat test_format = 0, format = 0;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Try for a closest match on audio format */
-    for (test_format = SDL_FirstAudioFormat(this->spec.format);
-         !format && test_format;) {
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
-        switch (test_format) {
-        case AUDIO_U8:
-            bits = 8;
-            format = 1;
-            break;
-        case AUDIO_S16LSB:
-            bits = 16;
-            format = 1;
-            break;
-        default:
-            format = 0;
-            break;
-        }
-        if (!format) {
-            test_format = SDL_NextAudioFormat();
-        }
-    }
-    if (format == 0) {
-        ARTS_CloseDevice(this);
-        return SDL_SetError("Couldn't find any hardware audio formats");
-    }
-    this->spec.format = test_format;
-
-    if ((rc = SDL_NAME(arts_init) ()) != 0) {
-        ARTS_CloseDevice(this);
-        return SDL_SetError("Unable to initialize ARTS: %s",
-                            SDL_NAME(arts_error_text) (rc));
-    }
-
-    if (!ARTS_Suspend()) {
-        ARTS_CloseDevice(this);
-        return SDL_SetError("ARTS can not open audio device");
-    }
-
-    this->hidden->stream = SDL_NAME(arts_play_stream) (this->spec.freq,
-                                                       bits,
-                                                       this->spec.channels,
-                                                       "SDL");
-
-    /* Play nothing so we have at least one write (server bug workaround). */
-    SDL_NAME(arts_write) (this->hidden->stream, "", 0);
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Determine the power of two of the fragment size */
-    for (frag_spec = 0; (0x01 << frag_spec) < this->spec.size; ++frag_spec);
-    if ((0x01 << frag_spec) != this->spec.size) {
-        ARTS_CloseDevice(this);
-        return SDL_SetError("Fragment size must be a power of two");
-    }
-    frag_spec |= 0x00020000;    /* two fragments, for low latency */
-
-#ifdef ARTS_P_PACKET_SETTINGS
-    SDL_NAME(arts_stream_set) (this->hidden->stream,
-                               ARTS_P_PACKET_SETTINGS, frag_spec);
-#else
-    SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_SIZE,
-                               frag_spec & 0xffff);
-    SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_COUNT,
-                               frag_spec >> 16);
-#endif
-    this->spec.size = SDL_NAME(arts_stream_get) (this->hidden->stream,
-                                                 ARTS_P_PACKET_SIZE);
-
-    /* Allocate mixing buffer */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        ARTS_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-    /* Get the parent process id (we're the parent of the audio thread) */
-    this->hidden->parent = getpid();
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-
-static void
-ARTS_Deinitialize(void)
-{
-    UnloadARTSLibrary();
-}
-
-
-static int
-ARTS_Init(SDL_AudioDriverImpl * impl)
-{
-    if (LoadARTSLibrary() < 0) {
-        return 0;
-    } else {
-        if (SDL_NAME(arts_init) () != 0) {
-            UnloadARTSLibrary();
-            SDL_SetError("ARTS: arts_init failed (no audio server?)");
-            return 0;
-        }
-
-        /* Play a stream so aRts doesn't crash */
-        if (ARTS_Suspend()) {
-            arts_stream_t stream;
-            stream = SDL_NAME(arts_play_stream) (44100, 16, 2, "SDL");
-            SDL_NAME(arts_write) (stream, "", 0);
-            SDL_NAME(arts_close_stream) (stream);
-        }
-
-        SDL_NAME(arts_free) ();
-    }
-
-    /* Set the function pointers */
-    impl->OpenDevice = ARTS_OpenDevice;
-    impl->PlayDevice = ARTS_PlayDevice;
-    impl->WaitDevice = ARTS_WaitDevice;
-    impl->GetDeviceBuf = ARTS_GetDeviceBuf;
-    impl->CloseDevice = ARTS_CloseDevice;
-    impl->WaitDone = ARTS_WaitDone;
-    impl->Deinitialize = ARTS_Deinitialize;
-    impl->OnlyHasDefaultOutputDevice = 1;
-
-    return 1;   /* this audio target is available. */
-}
-
-
-AudioBootStrap ARTS_bootstrap = {
-    "arts", "Analog RealTime Synthesizer", ARTS_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_ARTS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/arts/SDL_artsaudio.h b/deps/SDL2/src/audio/arts/SDL_artsaudio.h
deleted file mode 100644
index 1387cc5..0000000
--- a/deps/SDL2/src/audio/arts/SDL_artsaudio.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_artscaudio_h
-#define _SDL_artscaudio_h
-
-#include <artsc.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The stream descriptor for the audio device */
-    arts_stream_t stream;
-
-    /* The parent process id, to detect when application quits */
-    pid_t parent;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-
-    /* Support for audio timing using a timer, in addition to select() */
-    float frame_ticks;
-    float next_frame;
-};
-#define FUDGE_TICKS 10      /* The scheduler overhead ticks per frame */
-
-#endif /* _SDL_artscaudio_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/baudio/SDL_beaudio.cc b/deps/SDL2/src/audio/baudio/SDL_beaudio.cc
deleted file mode 100644
index e2edf85..0000000
--- a/deps/SDL2/src/audio/baudio/SDL_beaudio.cc
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_BEOSAUDIO
-
-/* Allow access to the audio stream on BeOS */
-
-#include <SoundPlayer.h>
-
-#include "../../main/beos/SDL_BeApp.h"
-
-extern "C"
-{
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-#include "../../thread/beos/SDL_systhread_c.h"
-#include "SDL_beaudio.h"
-
-}
-
-
-/* !!! FIXME: have the callback call the higher level to avoid code dupe. */
-/* The BeOS callback for handling the audio buffer */
-static void
-FillSound(void *device, void *stream, size_t len,
-          const media_raw_audio_format & format)
-{
-    SDL_AudioDevice *audio = (SDL_AudioDevice *) device;
-
-    /* Only do soemthing if audio is enabled */
-    if (!audio->enabled)
-        return;
-
-    if (!audio->paused) {
-        if (audio->convert.needed) {
-            SDL_LockMutex(audio->mixer_lock);
-            (*audio->spec.callback) (audio->spec.userdata,
-                                     (Uint8 *) audio->convert.buf,
-                                     audio->convert.len);
-            SDL_UnlockMutex(audio->mixer_lock);
-            SDL_ConvertAudio(&audio->convert);
-            SDL_memcpy(stream, audio->convert.buf, audio->convert.len_cvt);
-        } else {
-            SDL_LockMutex(audio->mixer_lock);
-            (*audio->spec.callback) (audio->spec.userdata,
-                                     (Uint8 *) stream, len);
-            SDL_UnlockMutex(audio->mixer_lock);
-        }
-    }
-}
-
-static void
-BEOSAUDIO_CloseDevice(_THIS)
-{
-    if (_this->hidden != NULL) {
-        if (_this->hidden->audio_obj) {
-            _this->hidden->audio_obj->Stop();
-            delete _this->hidden->audio_obj;
-            _this->hidden->audio_obj = NULL;
-        }
-
-        delete _this->hidden;
-        _this->hidden = NULL;
-    }
-}
-
-static int
-BEOSAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    int valid_datatype = 0;
-    media_raw_audio_format format;
-    SDL_AudioFormat test_format = SDL_FirstAudioFormat(_this->spec.format);
-
-    /* Initialize all variables that we clean on shutdown */
-    _this->hidden = new SDL_PrivateAudioData;
-    if (_this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(_this->hidden, 0, (sizeof *_this->hidden));
-
-    /* Parse the audio format and fill the Be raw audio format */
-    SDL_memset(&format, '\0', sizeof(media_raw_audio_format));
-    format.byte_order = B_MEDIA_LITTLE_ENDIAN;
-    format.frame_rate = (float) _this->spec.freq;
-    format.channel_count = _this->spec.channels;        /* !!! FIXME: support > 2? */
-    while ((!valid_datatype) && (test_format)) {
-        valid_datatype = 1;
-        _this->spec.format = test_format;
-        switch (test_format) {
-        case AUDIO_S8:
-            format.format = media_raw_audio_format::B_AUDIO_CHAR;
-            break;
-
-        case AUDIO_U8:
-            format.format = media_raw_audio_format::B_AUDIO_UCHAR;
-            break;
-
-        case AUDIO_S16LSB:
-            format.format = media_raw_audio_format::B_AUDIO_SHORT;
-            break;
-
-        case AUDIO_S16MSB:
-            format.format = media_raw_audio_format::B_AUDIO_SHORT;
-            format.byte_order = B_MEDIA_BIG_ENDIAN;
-            break;
-
-        case AUDIO_S32LSB:
-            format.format = media_raw_audio_format::B_AUDIO_INT;
-            break;
-
-        case AUDIO_S32MSB:
-            format.format = media_raw_audio_format::B_AUDIO_INT;
-            format.byte_order = B_MEDIA_BIG_ENDIAN;
-            break;
-
-        case AUDIO_F32LSB:
-            format.format = media_raw_audio_format::B_AUDIO_FLOAT;
-            break;
-
-        case AUDIO_F32MSB:
-            format.format = media_raw_audio_format::B_AUDIO_FLOAT;
-            format.byte_order = B_MEDIA_BIG_ENDIAN;
-            break;
-
-        default:
-            valid_datatype = 0;
-            test_format = SDL_NextAudioFormat();
-            break;
-        }
-    }
-
-    if (!valid_datatype) {      /* shouldn't happen, but just in case... */
-        BEOSAUDIO_CloseDevice(_this);
-        return SDL_SetError("Unsupported audio format");
-    }
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&_this->spec);
-
-    format.buffer_size = _this->spec.size;
-
-    /* Subscribe to the audio stream (creates a new thread) */
-    sigset_t omask;
-    SDL_MaskSignals(&omask);
-    _this->hidden->audio_obj = new BSoundPlayer(&format, "SDL Audio",
-                                                FillSound, NULL, _this);
-    SDL_UnmaskSignals(&omask);
-
-    if (_this->hidden->audio_obj->Start() == B_NO_ERROR) {
-        _this->hidden->audio_obj->SetHasData(true);
-    } else {
-        BEOSAUDIO_CloseDevice(_this);
-        return SDL_SetError("Unable to start Be audio");
-    }
-
-    /* We're running! */
-    return 0;
-}
-
-static void
-BEOSAUDIO_Deinitialize(void)
-{
-    SDL_QuitBeApp();
-}
-
-static int
-BEOSAUDIO_Init(SDL_AudioDriverImpl * impl)
-{
-    /* Initialize the Be Application, if it's not already started */
-    if (SDL_InitBeApp() < 0) {
-        return 0;
-    }
-
-    /* Set the function pointers */
-    impl->OpenDevice = BEOSAUDIO_OpenDevice;
-    impl->CloseDevice = BEOSAUDIO_CloseDevice;
-    impl->Deinitialize = BEOSAUDIO_Deinitialize;
-    impl->ProvidesOwnCallbackThread = 1;
-    impl->OnlyHasDefaultOutputDevice = 1;
-
-    return 1;   /* this audio target is available. */
-}
-
-extern "C"
-{
-    extern AudioBootStrap BEOSAUDIO_bootstrap;
-}
-AudioBootStrap BEOSAUDIO_bootstrap = {
-    "baudio", "BeOS BSoundPlayer", BEOSAUDIO_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_BEOSAUDIO */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/baudio/SDL_beaudio.h b/deps/SDL2/src/audio/baudio/SDL_beaudio.h
deleted file mode 100644
index 61f9dec..0000000
--- a/deps/SDL2/src/audio/baudio/SDL_beaudio.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_beaudio_h
-#define _SDL_beaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *_this
-
-struct SDL_PrivateAudioData
-{
-    BSoundPlayer *audio_obj;
-};
-
-#endif /* _SDL_beaudio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/bsd/SDL_bsdaudio.c b/deps/SDL2/src/audio/bsd/SDL_bsdaudio.c
deleted file mode 100644
index 6694683..0000000
--- a/deps/SDL2/src/audio/bsd/SDL_bsdaudio.c
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_BSD
-
-/*
- * Driver for native OpenBSD/NetBSD audio(4).
- * vedge at vedge.com.ar.
- */
-
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/audioio.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_bsdaudio.h"
-
-/* Use timer for synchronization */
-/* #define USE_TIMER_SYNC */
-
-/* #define DEBUG_AUDIO */
-/* #define DEBUG_AUDIO_STREAM */
-
-
-static void
-BSDAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
-{
-    SDL_EnumUnixAudioDevices(iscapture, 0, NULL, addfn);
-}
-
-
-static void
-BSDAUDIO_Status(_THIS)
-{
-#ifdef DEBUG_AUDIO
-    /* *INDENT-OFF* */
-    audio_info_t info;
-
-    if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) {
-        fprintf(stderr, "AUDIO_GETINFO failed.\n");
-        return;
-    }
-    fprintf(stderr, "\n"
-            "[play/record info]\n"
-            "buffer size	:   %d bytes\n"
-            "sample rate	:   %i Hz\n"
-            "channels	:   %i\n"
-            "precision	:   %i-bit\n"
-            "encoding	:   0x%x\n"
-            "seek		:   %i\n"
-            "sample count	:   %i\n"
-            "EOF count	:   %i\n"
-            "paused		:   %s\n"
-            "error occured	:   %s\n"
-            "waiting		:   %s\n"
-            "active		:   %s\n"
-            "",
-            info.play.buffer_size,
-            info.play.sample_rate,
-            info.play.channels,
-            info.play.precision,
-            info.play.encoding,
-            info.play.seek,
-            info.play.samples,
-            info.play.eof,
-            info.play.pause ? "yes" : "no",
-            info.play.error ? "yes" : "no",
-            info.play.waiting ? "yes" : "no",
-            info.play.active ? "yes" : "no");
-
-    fprintf(stderr, "\n"
-            "[audio info]\n"
-            "monitor_gain	:   %i\n"
-            "hw block size	:   %d bytes\n"
-            "hi watermark	:   %i\n"
-            "lo watermark	:   %i\n"
-            "audio mode	:   %s\n"
-            "",
-            info.monitor_gain,
-            info.blocksize,
-            info.hiwat, info.lowat,
-            (info.mode == AUMODE_PLAY) ? "PLAY"
-            : (info.mode = AUMODE_RECORD) ? "RECORD"
-            : (info.mode == AUMODE_PLAY_ALL ? "PLAY_ALL" : "?"));
-    /* *INDENT-ON* */
-#endif /* DEBUG_AUDIO */
-}
-
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-BSDAUDIO_WaitDevice(_THIS)
-{
-#ifndef USE_BLOCKING_WRITES     /* Not necessary when using blocking writes */
-    /* See if we need to use timed audio synchronization */
-    if (this->hidden->frame_ticks) {
-        /* Use timer for general audio synchronization */
-        Sint32 ticks;
-
-        ticks = ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS;
-        if (ticks > 0) {
-            SDL_Delay(ticks);
-        }
-    } else {
-        /* Use select() for audio synchronization */
-        fd_set fdset;
-        struct timeval timeout;
-
-        FD_ZERO(&fdset);
-        FD_SET(this->hidden->audio_fd, &fdset);
-        timeout.tv_sec = 10;
-        timeout.tv_usec = 0;
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Waiting for audio to get ready\n");
-#endif
-        if (select(this->hidden->audio_fd + 1, NULL, &fdset, NULL, &timeout)
-            <= 0) {
-            const char *message =
-                "Audio timeout - buggy audio driver? (disabled)";
-            /* In general we should never print to the screen,
-               but in this case we have no other way of letting
-               the user know what happened.
-             */
-            fprintf(stderr, "SDL: %s\n", message);
-            this->enabled = 0;
-            /* Don't try to close - may hang */
-            this->hidden->audio_fd = -1;
-#ifdef DEBUG_AUDIO
-            fprintf(stderr, "Done disabling audio\n");
-#endif
-        }
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Ready!\n");
-#endif
-    }
-#endif /* !USE_BLOCKING_WRITES */
-}
-
-static void
-BSDAUDIO_PlayDevice(_THIS)
-{
-    int written, p = 0;
-
-    /* Write the audio data, checking for EAGAIN on broken audio drivers */
-    do {
-        written = write(this->hidden->audio_fd,
-                        &this->hidden->mixbuf[p], this->hidden->mixlen - p);
-
-        if (written > 0)
-            p += written;
-        if (written == -1 && errno != 0 && errno != EAGAIN && errno != EINTR) {
-            /* Non recoverable error has occurred. It should be reported!!! */
-            perror("audio");
-            break;
-        }
-
-        if (p < written
-            || ((written < 0) && ((errno == 0) || (errno == EAGAIN)))) {
-            SDL_Delay(1);       /* Let a little CPU time go by */
-        }
-    } while (p < written);
-
-    /* If timer synchronization is enabled, set the next write frame */
-    if (this->hidden->frame_ticks) {
-        this->hidden->next_frame += this->hidden->frame_ticks;
-    }
-
-    /* If we couldn't write, assume fatal error for now */
-    if (written < 0) {
-        this->enabled = 0;
-    }
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static Uint8 *
-BSDAUDIO_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-static void
-BSDAUDIO_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->audio_fd >= 0) {
-            close(this->hidden->audio_fd);
-            this->hidden->audio_fd = -1;
-        }
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static int
-BSDAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT);
-    SDL_AudioFormat format = 0;
-    audio_info_t info;
-
-    /* We don't care what the devname is...we'll try to open anything. */
-    /*  ...but default to first name in the list... */
-    if (devname == NULL) {
-        devname = SDL_GetAudioDeviceName(0, iscapture);
-        if (devname == NULL) {
-            return SDL_SetError("No such audio device");
-        }
-    }
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Open the audio device */
-    this->hidden->audio_fd = open(devname, flags, 0);
-    if (this->hidden->audio_fd < 0) {
-        return SDL_SetError("Couldn't open %s: %s", devname, strerror(errno));
-    }
-
-    AUDIO_INITINFO(&info);
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Set to play mode */
-    info.mode = AUMODE_PLAY;
-    if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) < 0) {
-        BSDAUDIO_CloseDevice(this);
-        return SDL_SetError("Couldn't put device into play mode");
-    }
-
-    AUDIO_INITINFO(&info);
-    for (format = SDL_FirstAudioFormat(this->spec.format);
-         format; format = SDL_NextAudioFormat()) {
-        switch (format) {
-        case AUDIO_U8:
-            info.play.encoding = AUDIO_ENCODING_ULINEAR;
-            info.play.precision = 8;
-            break;
-        case AUDIO_S8:
-            info.play.encoding = AUDIO_ENCODING_SLINEAR;
-            info.play.precision = 8;
-            break;
-        case AUDIO_S16LSB:
-            info.play.encoding = AUDIO_ENCODING_SLINEAR_LE;
-            info.play.precision = 16;
-            break;
-        case AUDIO_S16MSB:
-            info.play.encoding = AUDIO_ENCODING_SLINEAR_BE;
-            info.play.precision = 16;
-            break;
-        case AUDIO_U16LSB:
-            info.play.encoding = AUDIO_ENCODING_ULINEAR_LE;
-            info.play.precision = 16;
-            break;
-        case AUDIO_U16MSB:
-            info.play.encoding = AUDIO_ENCODING_ULINEAR_BE;
-            info.play.precision = 16;
-            break;
-        default:
-            continue;
-        }
-
-        if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == 0) {
-            break;
-        }
-    }
-
-    if (!format) {
-        BSDAUDIO_CloseDevice(this);
-        return SDL_SetError("No supported encoding for 0x%x", this->spec.format);
-    }
-
-    this->spec.format = format;
-
-    AUDIO_INITINFO(&info);
-    info.play.channels = this->spec.channels;
-    if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == -1) {
-        this->spec.channels = 1;
-    }
-    AUDIO_INITINFO(&info);
-    info.play.sample_rate = this->spec.freq;
-    info.blocksize = this->spec.size;
-    info.hiwat = 5;
-    info.lowat = 3;
-    (void) ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info);
-    (void) ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info);
-    this->spec.freq = info.play.sample_rate;
-    /* Allocate mixing buffer */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        BSDAUDIO_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-    BSDAUDIO_Status(this);
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-static int
-BSDAUDIO_Init(SDL_AudioDriverImpl * impl)
-{
-    /* Set the function pointers */
-    impl->DetectDevices = BSDAUDIO_DetectDevices;
-    impl->OpenDevice = BSDAUDIO_OpenDevice;
-    impl->PlayDevice = BSDAUDIO_PlayDevice;
-    impl->WaitDevice = BSDAUDIO_WaitDevice;
-    impl->GetDeviceBuf = BSDAUDIO_GetDeviceBuf;
-    impl->CloseDevice = BSDAUDIO_CloseDevice;
-
-    return 1;   /* this audio target is available. */
-}
-
-
-AudioBootStrap BSD_AUDIO_bootstrap = {
-    "bsd", "BSD audio", BSDAUDIO_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_BSD */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/bsd/SDL_bsdaudio.h b/deps/SDL2/src/audio/bsd/SDL_bsdaudio.h
deleted file mode 100644
index b64be31..0000000
--- a/deps/SDL2/src/audio/bsd/SDL_bsdaudio.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_bsdaudio_h
-#define _SDL_bsdaudio_h
-
-#include "../SDL_sysaudio.h"
-
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The file descriptor for the audio device */
-    int audio_fd;
-
-    /* The parent process id, to detect when application quits */
-    pid_t parent;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-
-    /* Support for audio timing using a timer, in addition to select() */
-    float frame_ticks;
-    float next_frame;
-};
-
-#define FUDGE_TICKS 10      /* The scheduler overhead ticks per frame */
-
-#endif /* _SDL_bsdaudio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/coreaudio/SDL_coreaudio.c b/deps/SDL2/src/audio/coreaudio/SDL_coreaudio.c
deleted file mode 100644
index a35135a..0000000
--- a/deps/SDL2/src/audio/coreaudio/SDL_coreaudio.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-#include "SDL_coreaudio.h"
-#include "SDL_assert.h"
-
-#define DEBUG_COREAUDIO 0
-
-static void COREAUDIO_CloseDevice(_THIS);
-
-#define CHECK_RESULT(msg) \
-    if (result != noErr) { \
-        COREAUDIO_CloseDevice(this); \
-        SDL_SetError("CoreAudio error (%s): %d", msg, (int) result); \
-        return 0; \
-    }
-
-#if MACOSX_COREAUDIO
-typedef void (*addDevFn)(const char *name, AudioDeviceID devId, void *data);
-
-static void
-addToDevList(const char *name, AudioDeviceID devId, void *data)
-{
-    SDL_AddAudioDevice addfn = (SDL_AddAudioDevice) data;
-    addfn(name);
-}
-
-typedef struct
-{
-    const char *findname;
-    AudioDeviceID devId;
-    int found;
-} FindDevIdData;
-
-static void
-findDevId(const char *name, AudioDeviceID devId, void *_data)
-{
-    FindDevIdData *data = (FindDevIdData *) _data;
-    if (!data->found) {
-        if (SDL_strcmp(name, data->findname) == 0) {
-            data->found = 1;
-            data->devId = devId;
-        }
-    }
-}
-
-static void
-build_device_list(int iscapture, addDevFn addfn, void *addfndata)
-{
-    OSStatus result = noErr;
-    UInt32 size = 0;
-    AudioDeviceID *devs = NULL;
-    UInt32 i = 0;
-    UInt32 max = 0;
-
-    AudioObjectPropertyAddress addr = {
-        kAudioHardwarePropertyDevices,
-        kAudioObjectPropertyScopeGlobal,
-        kAudioObjectPropertyElementMaster
-    };
-
-    result = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &addr,
-                                            0, NULL, &size);
-    if (result != kAudioHardwareNoError)
-        return;
-
-    devs = (AudioDeviceID *) alloca(size);
-    if (devs == NULL)
-        return;
-
-    result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr,
-                                        0, NULL, &size, devs);
-    if (result != kAudioHardwareNoError)
-        return;
-
-    max = size / sizeof (AudioDeviceID);
-    for (i = 0; i < max; i++) {
-        CFStringRef cfstr = NULL;
-        char *ptr = NULL;
-        AudioDeviceID dev = devs[i];
-        AudioBufferList *buflist = NULL;
-        int usable = 0;
-        CFIndex len = 0;
-
-        addr.mScope = iscapture ? kAudioDevicePropertyScopeInput :
-                        kAudioDevicePropertyScopeOutput;
-        addr.mSelector = kAudioDevicePropertyStreamConfiguration;
-
-        result = AudioObjectGetPropertyDataSize(dev, &addr, 0, NULL, &size);
-        if (result != noErr)
-            continue;
-
-        buflist = (AudioBufferList *) SDL_malloc(size);
-        if (buflist == NULL)
-            continue;
-
-        result = AudioObjectGetPropertyData(dev, &addr, 0, NULL,
-                                            &size, buflist);
-
-        if (result == noErr) {
-            UInt32 j;
-            for (j = 0; j < buflist->mNumberBuffers; j++) {
-                if (buflist->mBuffers[j].mNumberChannels > 0) {
-                    usable = 1;
-                    break;
-                }
-            }
-        }
-
-        SDL_free(buflist);
-
-        if (!usable)
-            continue;
-
-        addr.mSelector = kAudioObjectPropertyName;
-        size = sizeof (CFStringRef);
-        result = AudioObjectGetPropertyData(dev, &addr, 0, NULL, &size, &cfstr);
-        if (result != kAudioHardwareNoError)
-            continue;
-
-        len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr),
-                                                kCFStringEncodingUTF8);
-
-        ptr = (char *) SDL_malloc(len + 1);
-        usable = ((ptr != NULL) &&
-                  (CFStringGetCString
-                   (cfstr, ptr, len + 1, kCFStringEncodingUTF8)));
-
-        CFRelease(cfstr);
-
-        if (usable) {
-            len = strlen(ptr);
-            /* Some devices have whitespace at the end...trim it. */
-            while ((len > 0) && (ptr[len - 1] == ' ')) {
-                len--;
-            }
-            usable = (len > 0);
-        }
-
-        if (usable) {
-            ptr[len] = '\0';
-
-#if DEBUG_COREAUDIO
-            printf("COREAUDIO: Found %s device #%d: '%s' (devid %d)\n",
-                   ((iscapture) ? "capture" : "output"),
-                   (int) *devCount, ptr, (int) dev);
-#endif
-            addfn(ptr, dev, addfndata);
-        }
-        SDL_free(ptr);  /* addfn() would have copied the string. */
-    }
-}
-
-static void
-COREAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
-{
-    build_device_list(iscapture, addToDevList, addfn);
-}
-
-static int
-find_device_by_name(_THIS, const char *devname, int iscapture)
-{
-    AudioDeviceID devid = 0;
-    OSStatus result = noErr;
-    UInt32 size = 0;
-    UInt32 alive = 0;
-    pid_t pid = 0;
-
-    AudioObjectPropertyAddress addr = {
-        0,
-        kAudioObjectPropertyScopeGlobal,
-        kAudioObjectPropertyElementMaster
-    };
-
-    if (devname == NULL) {
-        size = sizeof (AudioDeviceID);
-        addr.mSelector =
-            ((iscapture) ? kAudioHardwarePropertyDefaultInputDevice :
-            kAudioHardwarePropertyDefaultOutputDevice);
-        result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr,
-                                            0, NULL, &size, &devid);
-        CHECK_RESULT("AudioHardwareGetProperty (default device)");
-    } else {
-        FindDevIdData data;
-        SDL_zero(data);
-        data.findname = devname;
-        build_device_list(iscapture, findDevId, &data);
-        if (!data.found) {
-            SDL_SetError("CoreAudio: No such audio device.");
-            return 0;
-        }
-        devid = data.devId;
-    }
-
-    addr.mSelector = kAudioDevicePropertyDeviceIsAlive;
-    addr.mScope = iscapture ? kAudioDevicePropertyScopeInput :
-                    kAudioDevicePropertyScopeOutput;
-
-    size = sizeof (alive);
-    result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &alive);
-    CHECK_RESULT
-        ("AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)");
-
-    if (!alive) {
-        SDL_SetError("CoreAudio: requested device exists, but isn't alive.");
-        return 0;
-    }
-
-    addr.mSelector = kAudioDevicePropertyHogMode;
-    size = sizeof (pid);
-    result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &pid);
-
-    /* some devices don't support this property, so errors are fine here. */
-    if ((result == noErr) && (pid != -1)) {
-        SDL_SetError("CoreAudio: requested device is being hogged.");
-        return 0;
-    }
-
-    this->hidden->deviceID = devid;
-    return 1;
-}
-#endif
-
-/* The CoreAudio callback */
-static OSStatus
-outputCallback(void *inRefCon,
-               AudioUnitRenderActionFlags * ioActionFlags,
-               const AudioTimeStamp * inTimeStamp,
-               UInt32 inBusNumber, UInt32 inNumberFrames,
-               AudioBufferList * ioData)
-{
-    SDL_AudioDevice *this = (SDL_AudioDevice *) inRefCon;
-    AudioBuffer *abuf;
-    UInt32 remaining, len;
-    void *ptr;
-    UInt32 i;
-
-    /* Only do anything if audio is enabled and not paused */
-    if (!this->enabled || this->paused) {
-        for (i = 0; i < ioData->mNumberBuffers; i++) {
-            abuf = &ioData->mBuffers[i];
-            SDL_memset(abuf->mData, this->spec.silence, abuf->mDataByteSize);
-        }
-        return 0;
-    }
-
-    /* No SDL conversion should be needed here, ever, since we accept
-       any input format in OpenAudio, and leave the conversion to CoreAudio.
-     */
-    /*
-       SDL_assert(!this->convert.needed);
-       SDL_assert(this->spec.channels == ioData->mNumberChannels);
-     */
-
-    for (i = 0; i < ioData->mNumberBuffers; i++) {
-        abuf = &ioData->mBuffers[i];
-        remaining = abuf->mDataByteSize;
-        ptr = abuf->mData;
-        while (remaining > 0) {
-            if (this->hidden->bufferOffset >= this->hidden->bufferSize) {
-                /* Generate the data */
-                SDL_LockMutex(this->mixer_lock);
-                (*this->spec.callback)(this->spec.userdata,
-                            this->hidden->buffer, this->hidden->bufferSize);
-                SDL_UnlockMutex(this->mixer_lock);
-                this->hidden->bufferOffset = 0;
-            }
-
-            len = this->hidden->bufferSize - this->hidden->bufferOffset;
-            if (len > remaining)
-                len = remaining;
-            SDL_memcpy(ptr, (char *)this->hidden->buffer +
-                       this->hidden->bufferOffset, len);
-            ptr = (char *)ptr + len;
-            remaining -= len;
-            this->hidden->bufferOffset += len;
-        }
-    }
-
-    return 0;
-}
-
-static OSStatus
-inputCallback(void *inRefCon,
-              AudioUnitRenderActionFlags * ioActionFlags,
-              const AudioTimeStamp * inTimeStamp,
-              UInt32 inBusNumber, UInt32 inNumberFrames,
-              AudioBufferList * ioData)
-{
-    /* err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); */
-    /* !!! FIXME: write me! */
-    return noErr;
-}
-
-
-static void
-COREAUDIO_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        if (this->hidden->audioUnitOpened) {
-            OSStatus result = noErr;
-            AURenderCallbackStruct callback;
-            const AudioUnitElement output_bus = 0;
-            const AudioUnitElement input_bus = 1;
-            const int iscapture = this->iscapture;
-            const AudioUnitElement bus =
-                ((iscapture) ? input_bus : output_bus);
-            const AudioUnitScope scope =
-                ((iscapture) ? kAudioUnitScope_Output :
-                 kAudioUnitScope_Input);
-
-            /* stop processing the audio unit */
-            result = AudioOutputUnitStop(this->hidden->audioUnit);
-
-            /* Remove the input callback */
-            SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct));
-            result = AudioUnitSetProperty(this->hidden->audioUnit,
-                                          kAudioUnitProperty_SetRenderCallback,
-                                          scope, bus, &callback,
-                                          sizeof(callback));
-
-            #if MACOSX_COREAUDIO
-            CloseComponent(this->hidden->audioUnit);
-            #else
-            AudioComponentInstanceDispose(this->hidden->audioUnit);
-            #endif
-
-            this->hidden->audioUnitOpened = 0;
-        }
-        SDL_free(this->hidden->buffer);
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-
-static int
-prepare_audiounit(_THIS, const char *devname, int iscapture,
-                  const AudioStreamBasicDescription * strdesc)
-{
-    OSStatus result = noErr;
-    AURenderCallbackStruct callback;
-#if MACOSX_COREAUDIO
-    ComponentDescription desc;
-    Component comp = NULL;
-#else
-    AudioComponentDescription desc;
-    AudioComponent comp = NULL;
-#endif
-    const AudioUnitElement output_bus = 0;
-    const AudioUnitElement input_bus = 1;
-    const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus);
-    const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output :
-                                  kAudioUnitScope_Input);
-
-#if MACOSX_COREAUDIO
-    if (!find_device_by_name(this, devname, iscapture)) {
-        SDL_SetError("Couldn't find requested CoreAudio device");
-        return 0;
-    }
-#endif
-
-    SDL_zero(desc);
-    desc.componentType = kAudioUnitType_Output;
-    desc.componentManufacturer = kAudioUnitManufacturer_Apple;
-
-#if MACOSX_COREAUDIO
-    desc.componentSubType = kAudioUnitSubType_DefaultOutput;
-    comp = FindNextComponent(NULL, &desc);
-#else
-    desc.componentSubType = kAudioUnitSubType_RemoteIO;
-    comp = AudioComponentFindNext(NULL, &desc);
-#endif
-
-    if (comp == NULL) {
-        SDL_SetError("Couldn't find requested CoreAudio component");
-        return 0;
-    }
-
-    /* Open & initialize the audio unit */
-#if MACOSX_COREAUDIO
-    result = OpenAComponent(comp, &this->hidden->audioUnit);
-    CHECK_RESULT("OpenAComponent");
-#else
-    /*
-       AudioComponentInstanceNew only available on iPhone OS 2.0 and Mac OS X 10.6
-       We can't use OpenAComponent on iPhone because it is not present
-     */
-    result = AudioComponentInstanceNew(comp, &this->hidden->audioUnit);
-    CHECK_RESULT("AudioComponentInstanceNew");
-#endif
-
-    this->hidden->audioUnitOpened = 1;
-
-#if MACOSX_COREAUDIO
-    result = AudioUnitSetProperty(this->hidden->audioUnit,
-                                  kAudioOutputUnitProperty_CurrentDevice,
-                                  kAudioUnitScope_Global, 0,
-                                  &this->hidden->deviceID,
-                                  sizeof(AudioDeviceID));
-    CHECK_RESULT
-        ("AudioUnitSetProperty (kAudioOutputUnitProperty_CurrentDevice)");
-#endif
-
-    /* Set the data format of the audio unit. */
-    result = AudioUnitSetProperty(this->hidden->audioUnit,
-                                  kAudioUnitProperty_StreamFormat,
-                                  scope, bus, strdesc, sizeof(*strdesc));
-    CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)");
-
-    /* Set the audio callback */
-    SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct));
-    callback.inputProc = ((iscapture) ? inputCallback : outputCallback);
-    callback.inputProcRefCon = this;
-    result = AudioUnitSetProperty(this->hidden->audioUnit,
-                                  kAudioUnitProperty_SetRenderCallback,
-                                  scope, bus, &callback, sizeof(callback));
-    CHECK_RESULT
-        ("AudioUnitSetProperty (kAudioUnitProperty_SetRenderCallback)");
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Allocate a sample buffer */
-    this->hidden->bufferOffset = this->hidden->bufferSize = this->spec.size;
-    this->hidden->buffer = SDL_malloc(this->hidden->bufferSize);
-
-    result = AudioUnitInitialize(this->hidden->audioUnit);
-    CHECK_RESULT("AudioUnitInitialize");
-
-    /* Finally, start processing of the audio unit */
-    result = AudioOutputUnitStart(this->hidden->audioUnit);
-    CHECK_RESULT("AudioOutputUnitStart");
-
-    /* We're running! */
-    return 1;
-}
-
-
-static int
-COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    AudioStreamBasicDescription strdesc;
-    SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
-    int valid_datatype = 0;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Setup a AudioStreamBasicDescription with the requested format */
-    SDL_memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription));
-    strdesc.mFormatID = kAudioFormatLinearPCM;
-    strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked;
-    strdesc.mChannelsPerFrame = this->spec.channels;
-    strdesc.mSampleRate = this->spec.freq;
-    strdesc.mFramesPerPacket = 1;
-
-    while ((!valid_datatype) && (test_format)) {
-        this->spec.format = test_format;
-        /* Just a list of valid SDL formats, so people don't pass junk here. */
-        switch (test_format) {
-        case AUDIO_U8:
-        case AUDIO_S8:
-        case AUDIO_U16LSB:
-        case AUDIO_S16LSB:
-        case AUDIO_U16MSB:
-        case AUDIO_S16MSB:
-        case AUDIO_S32LSB:
-        case AUDIO_S32MSB:
-        case AUDIO_F32LSB:
-        case AUDIO_F32MSB:
-            valid_datatype = 1;
-            strdesc.mBitsPerChannel = SDL_AUDIO_BITSIZE(this->spec.format);
-            if (SDL_AUDIO_ISBIGENDIAN(this->spec.format))
-                strdesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
-
-            if (SDL_AUDIO_ISFLOAT(this->spec.format))
-                strdesc.mFormatFlags |= kLinearPCMFormatFlagIsFloat;
-            else if (SDL_AUDIO_ISSIGNED(this->spec.format))
-                strdesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
-            break;
-        }
-    }
-
-    if (!valid_datatype) {      /* shouldn't happen, but just in case... */
-        COREAUDIO_CloseDevice(this);
-        return SDL_SetError("Unsupported audio format");
-    }
-
-    strdesc.mBytesPerFrame =
-        strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8;
-    strdesc.mBytesPerPacket =
-        strdesc.mBytesPerFrame * strdesc.mFramesPerPacket;
-
-    if (!prepare_audiounit(this, devname, iscapture, &strdesc)) {
-        COREAUDIO_CloseDevice(this);
-        return -1;      /* prepare_audiounit() will call SDL_SetError()... */
-    }
-
-    return 0;   /* good to go. */
-}
-
-static int
-COREAUDIO_Init(SDL_AudioDriverImpl * impl)
-{
-    /* Set the function pointers */
-    impl->OpenDevice = COREAUDIO_OpenDevice;
-    impl->CloseDevice = COREAUDIO_CloseDevice;
-
-#if MACOSX_COREAUDIO
-    impl->DetectDevices = COREAUDIO_DetectDevices;
-#else
-    impl->OnlyHasDefaultOutputDevice = 1;
-
-    /* Set category to ambient sound so that other music continues playing.
-       You can change this at runtime in your own code if you need different
-       behavior.  If this is common, we can add an SDL hint for this.
-    */
-    AudioSessionInitialize(NULL, NULL, NULL, nil);
-    UInt32 category = kAudioSessionCategory_AmbientSound;
-    AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(UInt32), &category);
-#endif
-
-    impl->ProvidesOwnCallbackThread = 1;
-
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap COREAUDIO_bootstrap = {
-    "coreaudio", "CoreAudio", COREAUDIO_Init, 0
-};
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/coreaudio/SDL_coreaudio.h b/deps/SDL2/src/audio/coreaudio/SDL_coreaudio.h
deleted file mode 100644
index 2f0db5b..0000000
--- a/deps/SDL2/src/audio/coreaudio/SDL_coreaudio.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_coreaudio_h
-#define _SDL_coreaudio_h
-
-#include "../SDL_sysaudio.h"
-
-#if !defined(__IPHONEOS__)
-#define MACOSX_COREAUDIO 1
-#endif
-
-#if MACOSX_COREAUDIO
-#include <CoreAudio/CoreAudio.h>
-#include <CoreServices/CoreServices.h>
-#else
-#include <AudioToolbox/AudioToolbox.h>
-#endif
-
-#include <AudioUnit/AudioUnit.h>
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    AudioUnit audioUnit;
-    int audioUnitOpened;
-    void *buffer;
-    UInt32 bufferOffset;
-    UInt32 bufferSize;
-#if MACOSX_COREAUDIO
-    AudioDeviceID deviceID;
-#endif
-};
-
-#endif /* _SDL_coreaudio_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/directsound/SDL_directsound.c b/deps/SDL2/src/audio/directsound/SDL_directsound.c
deleted file mode 100644
index 86563a6..0000000
--- a/deps/SDL2/src/audio/directsound/SDL_directsound.c
+++ /dev/null
@@ -1,550 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_DSOUND
-
-/* Allow access to a raw mixing buffer */
-
-#include "SDL_timer.h"
-#include "SDL_loadso.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "SDL_directsound.h"
-
-#ifndef WAVE_FORMAT_IEEE_FLOAT
-#define WAVE_FORMAT_IEEE_FLOAT 0x0003
-#endif
-
-/* DirectX function pointers for audio */
-static void* DSoundDLL = NULL;
-typedef HRESULT(WINAPI*fnDirectSoundCreate8)(LPGUID,LPDIRECTSOUND*,LPUNKNOWN);
-typedef HRESULT(WINAPI*fnDirectSoundEnumerateW)(LPDSENUMCALLBACKW, LPVOID);
-typedef HRESULT(WINAPI*fnDirectSoundCaptureEnumerateW)(LPDSENUMCALLBACKW,LPVOID);
-static fnDirectSoundCreate8 pDirectSoundCreate8 = NULL;
-static fnDirectSoundEnumerateW pDirectSoundEnumerateW = NULL;
-static fnDirectSoundCaptureEnumerateW pDirectSoundCaptureEnumerateW = NULL;
-
-static void
-DSOUND_Unload(void)
-{
-    pDirectSoundCreate8 = NULL;
-    pDirectSoundEnumerateW = NULL;
-    pDirectSoundCaptureEnumerateW = NULL;
-
-    if (DSoundDLL != NULL) {
-        SDL_UnloadObject(DSoundDLL);
-        DSoundDLL = NULL;
-    }
-}
-
-
-static int
-DSOUND_Load(void)
-{
-    int loaded = 0;
-
-    DSOUND_Unload();
-
-    DSoundDLL = SDL_LoadObject("DSOUND.DLL");
-    if (DSoundDLL == NULL) {
-        SDL_SetError("DirectSound: failed to load DSOUND.DLL");
-    } else {
-        /* Now make sure we have DirectX 8 or better... */
-        #define DSOUNDLOAD(f) { \
-            p##f = (fn##f) SDL_LoadFunction(DSoundDLL, #f); \
-            if (!p##f) loaded = 0; \
-        }
-        loaded = 1;  /* will reset if necessary. */
-        DSOUNDLOAD(DirectSoundCreate8);
-        DSOUNDLOAD(DirectSoundEnumerateW);
-        DSOUNDLOAD(DirectSoundCaptureEnumerateW);
-        #undef DSOUNDLOAD
-
-        if (!loaded) {
-            SDL_SetError("DirectSound: System doesn't appear to have DX8.");
-        }
-    }
-
-    if (!loaded) {
-        DSOUND_Unload();
-    }
-
-    return loaded;
-}
-
-static int
-SetDSerror(const char *function, int code)
-{
-    static const char *error;
-    static char errbuf[1024];
-
-    errbuf[0] = 0;
-    switch (code) {
-    case E_NOINTERFACE:
-        error = "Unsupported interface -- Is DirectX 8.0 or later installed?";
-        break;
-    case DSERR_ALLOCATED:
-        error = "Audio device in use";
-        break;
-    case DSERR_BADFORMAT:
-        error = "Unsupported audio format";
-        break;
-    case DSERR_BUFFERLOST:
-        error = "Mixing buffer was lost";
-        break;
-    case DSERR_CONTROLUNAVAIL:
-        error = "Control requested is not available";
-        break;
-    case DSERR_INVALIDCALL:
-        error = "Invalid call for the current state";
-        break;
-    case DSERR_INVALIDPARAM:
-        error = "Invalid parameter";
-        break;
-    case DSERR_NODRIVER:
-        error = "No audio device found";
-        break;
-    case DSERR_OUTOFMEMORY:
-        error = "Out of memory";
-        break;
-    case DSERR_PRIOLEVELNEEDED:
-        error = "Caller doesn't have priority";
-        break;
-    case DSERR_UNSUPPORTED:
-        error = "Function not supported";
-        break;
-    default:
-        SDL_snprintf(errbuf, SDL_arraysize(errbuf),
-                     "%s: Unknown DirectSound error: 0x%x", function, code);
-        break;
-    }
-    if (!errbuf[0]) {
-        SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function,
-                     error);
-    }
-    return SDL_SetError("%s", errbuf);
-}
-
-
-static BOOL CALLBACK
-FindAllDevs(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID data)
-{
-    SDL_AddAudioDevice addfn = (SDL_AddAudioDevice) data;
-    if (guid != NULL) {  /* skip default device */
-        char *str = WIN_StringToUTF8(desc);
-        if (str != NULL) {
-            addfn(str);
-            SDL_free(str);  /* addfn() makes a copy of this string. */
-        }
-    }
-    return TRUE;  /* keep enumerating. */
-}
-
-static void
-DSOUND_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
-{
-    if (iscapture) {
-        pDirectSoundCaptureEnumerateW(FindAllDevs, addfn);
-    } else {
-        pDirectSoundEnumerateW(FindAllDevs, addfn);
-    }
-}
-
-
-static void
-DSOUND_WaitDevice(_THIS)
-{
-    DWORD status = 0;
-    DWORD cursor = 0;
-    DWORD junk = 0;
-    HRESULT result = DS_OK;
-
-    /* Semi-busy wait, since we have no way of getting play notification
-       on a primary mixing buffer located in hardware (DirectX 5.0)
-     */
-    result = IDirectSoundBuffer_GetCurrentPosition(this->hidden->mixbuf,
-                                                   &junk, &cursor);
-    if (result != DS_OK) {
-        if (result == DSERR_BUFFERLOST) {
-            IDirectSoundBuffer_Restore(this->hidden->mixbuf);
-        }
-#ifdef DEBUG_SOUND
-        SetDSerror("DirectSound GetCurrentPosition", result);
-#endif
-        return;
-    }
-
-    while ((cursor / this->hidden->mixlen) == this->hidden->lastchunk) {
-        /* FIXME: find out how much time is left and sleep that long */
-        SDL_Delay(1);
-
-        /* Try to restore a lost sound buffer */
-        IDirectSoundBuffer_GetStatus(this->hidden->mixbuf, &status);
-        if ((status & DSBSTATUS_BUFFERLOST)) {
-            IDirectSoundBuffer_Restore(this->hidden->mixbuf);
-            IDirectSoundBuffer_GetStatus(this->hidden->mixbuf, &status);
-            if ((status & DSBSTATUS_BUFFERLOST)) {
-                break;
-            }
-        }
-        if (!(status & DSBSTATUS_PLAYING)) {
-            result = IDirectSoundBuffer_Play(this->hidden->mixbuf, 0, 0,
-                                             DSBPLAY_LOOPING);
-            if (result == DS_OK) {
-                continue;
-            }
-#ifdef DEBUG_SOUND
-            SetDSerror("DirectSound Play", result);
-#endif
-            return;
-        }
-
-        /* Find out where we are playing */
-        result = IDirectSoundBuffer_GetCurrentPosition(this->hidden->mixbuf,
-                                                       &junk, &cursor);
-        if (result != DS_OK) {
-            SetDSerror("DirectSound GetCurrentPosition", result);
-            return;
-        }
-    }
-}
-
-static void
-DSOUND_PlayDevice(_THIS)
-{
-    /* Unlock the buffer, allowing it to play */
-    if (this->hidden->locked_buf) {
-        IDirectSoundBuffer_Unlock(this->hidden->mixbuf,
-                                  this->hidden->locked_buf,
-                                  this->hidden->mixlen, NULL, 0);
-    }
-
-}
-
-static Uint8 *
-DSOUND_GetDeviceBuf(_THIS)
-{
-    DWORD cursor = 0;
-    DWORD junk = 0;
-    HRESULT result = DS_OK;
-    DWORD rawlen = 0;
-
-    /* Figure out which blocks to fill next */
-    this->hidden->locked_buf = NULL;
-    result = IDirectSoundBuffer_GetCurrentPosition(this->hidden->mixbuf,
-                                                   &junk, &cursor);
-    if (result == DSERR_BUFFERLOST) {
-        IDirectSoundBuffer_Restore(this->hidden->mixbuf);
-        result = IDirectSoundBuffer_GetCurrentPosition(this->hidden->mixbuf,
-                                                       &junk, &cursor);
-    }
-    if (result != DS_OK) {
-        SetDSerror("DirectSound GetCurrentPosition", result);
-        return (NULL);
-    }
-    cursor /= this->hidden->mixlen;
-#ifdef DEBUG_SOUND
-    /* Detect audio dropouts */
-    {
-        DWORD spot = cursor;
-        if (spot < this->hidden->lastchunk) {
-            spot += this->hidden->num_buffers;
-        }
-        if (spot > this->hidden->lastchunk + 1) {
-            fprintf(stderr, "Audio dropout, missed %d fragments\n",
-                    (spot - (this->hidden->lastchunk + 1)));
-        }
-    }
-#endif
-    this->hidden->lastchunk = cursor;
-    cursor = (cursor + 1) % this->hidden->num_buffers;
-    cursor *= this->hidden->mixlen;
-
-    /* Lock the audio buffer */
-    result = IDirectSoundBuffer_Lock(this->hidden->mixbuf, cursor,
-                                     this->hidden->mixlen,
-                                     (LPVOID *) & this->hidden->locked_buf,
-                                     &rawlen, NULL, &junk, 0);
-    if (result == DSERR_BUFFERLOST) {
-        IDirectSoundBuffer_Restore(this->hidden->mixbuf);
-        result = IDirectSoundBuffer_Lock(this->hidden->mixbuf, cursor,
-                                         this->hidden->mixlen,
-                                         (LPVOID *) & this->
-                                         hidden->locked_buf, &rawlen, NULL,
-                                         &junk, 0);
-    }
-    if (result != DS_OK) {
-        SetDSerror("DirectSound Lock", result);
-        return (NULL);
-    }
-    return (this->hidden->locked_buf);
-}
-
-static void
-DSOUND_WaitDone(_THIS)
-{
-    Uint8 *stream = DSOUND_GetDeviceBuf(this);
-
-    /* Wait for the playing chunk to finish */
-    if (stream != NULL) {
-        SDL_memset(stream, this->spec.silence, this->hidden->mixlen);
-        DSOUND_PlayDevice(this);
-    }
-    DSOUND_WaitDevice(this);
-
-    /* Stop the looping sound buffer */
-    IDirectSoundBuffer_Stop(this->hidden->mixbuf);
-}
-
-static void
-DSOUND_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        if (this->hidden->sound != NULL) {
-            if (this->hidden->mixbuf != NULL) {
-                /* Clean up the audio buffer */
-                IDirectSoundBuffer_Release(this->hidden->mixbuf);
-                this->hidden->mixbuf = NULL;
-            }
-            IDirectSound_Release(this->hidden->sound);
-            this->hidden->sound = NULL;
-        }
-
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-/* This function tries to create a secondary audio buffer, and returns the
-   number of audio chunks available in the created buffer.
-*/
-static int
-CreateSecondary(_THIS, HWND focus)
-{
-    LPDIRECTSOUND sndObj = this->hidden->sound;
-    LPDIRECTSOUNDBUFFER *sndbuf = &this->hidden->mixbuf;
-    Uint32 chunksize = this->spec.size;
-    const int numchunks = 8;
-    HRESULT result = DS_OK;
-    DSBUFFERDESC format;
-    LPVOID pvAudioPtr1, pvAudioPtr2;
-    DWORD dwAudioBytes1, dwAudioBytes2;
-    WAVEFORMATEX wfmt;
-
-    SDL_zero(wfmt);
-
-    if (SDL_AUDIO_ISFLOAT(this->spec.format)) {
-        wfmt.wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
-    } else {
-        wfmt.wFormatTag = WAVE_FORMAT_PCM;
-    }
-
-    wfmt.wBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format);
-    wfmt.nChannels = this->spec.channels;
-    wfmt.nSamplesPerSec = this->spec.freq;
-    wfmt.nBlockAlign = wfmt.nChannels * (wfmt.wBitsPerSample / 8);
-    wfmt.nAvgBytesPerSec = wfmt.nSamplesPerSec * wfmt.nBlockAlign;
-
-    /* Update the fragment size as size in bytes */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Try to set primary mixing privileges */
-    if (focus) {
-        result = IDirectSound_SetCooperativeLevel(sndObj,
-                                                  focus, DSSCL_PRIORITY);
-    } else {
-        result = IDirectSound_SetCooperativeLevel(sndObj,
-                                                  GetDesktopWindow(),
-                                                  DSSCL_NORMAL);
-    }
-    if (result != DS_OK) {
-        return SetDSerror("DirectSound SetCooperativeLevel", result);
-    }
-
-    /* Try to create the secondary buffer */
-    SDL_zero(format);
-    format.dwSize = sizeof(format);
-    format.dwFlags = DSBCAPS_GETCURRENTPOSITION2;
-    if (!focus) {
-        format.dwFlags |= DSBCAPS_GLOBALFOCUS;
-    } else {
-        format.dwFlags |= DSBCAPS_STICKYFOCUS;
-    }
-    format.dwBufferBytes = numchunks * chunksize;
-    if ((format.dwBufferBytes < DSBSIZE_MIN) ||
-        (format.dwBufferBytes > DSBSIZE_MAX)) {
-        return SDL_SetError("Sound buffer size must be between %d and %d",
-                            DSBSIZE_MIN / numchunks, DSBSIZE_MAX / numchunks);
-    }
-    format.dwReserved = 0;
-    format.lpwfxFormat = &wfmt;
-    result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);
-    if (result != DS_OK) {
-        return SetDSerror("DirectSound CreateSoundBuffer", result);
-    }
-    IDirectSoundBuffer_SetFormat(*sndbuf, &wfmt);
-
-    /* Silence the initial audio buffer */
-    result = IDirectSoundBuffer_Lock(*sndbuf, 0, format.dwBufferBytes,
-                                     (LPVOID *) & pvAudioPtr1, &dwAudioBytes1,
-                                     (LPVOID *) & pvAudioPtr2, &dwAudioBytes2,
-                                     DSBLOCK_ENTIREBUFFER);
-    if (result == DS_OK) {
-        SDL_memset(pvAudioPtr1, this->spec.silence, dwAudioBytes1);
-        IDirectSoundBuffer_Unlock(*sndbuf,
-                                  (LPVOID) pvAudioPtr1, dwAudioBytes1,
-                                  (LPVOID) pvAudioPtr2, dwAudioBytes2);
-    }
-
-    /* We're ready to go */
-    return (numchunks);
-}
-
-typedef struct FindDevGUIDData
-{
-    const char *devname;
-    GUID guid;
-    int found;
-} FindDevGUIDData;
-
-static BOOL CALLBACK
-FindDevGUID(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID _data)
-{
-    if (guid != NULL) {  /* skip the default device. */
-        FindDevGUIDData *data = (FindDevGUIDData *) _data;
-        char *str = WIN_StringToUTF8(desc);
-        const int match = (SDL_strcmp(str, data->devname) == 0);
-        SDL_free(str);
-        if (match) {
-            data->found = 1;
-            SDL_memcpy(&data->guid, guid, sizeof (data->guid));
-            return FALSE;  /* found it! stop enumerating. */
-        }
-    }
-    return TRUE;  /* keep enumerating. */
-}
-
-static int
-DSOUND_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    HRESULT result;
-    SDL_bool valid_format = SDL_FALSE;
-    SDL_bool tried_format = SDL_FALSE;
-    SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
-    FindDevGUIDData devguid;
-    LPGUID guid = NULL;
-
-    if (devname != NULL) {
-        devguid.found = 0;
-        devguid.devname = devname;
-        if (iscapture)
-            pDirectSoundCaptureEnumerateW(FindDevGUID, &devguid);
-        else
-            pDirectSoundEnumerateW(FindDevGUID, &devguid);
-
-        if (!devguid.found) {
-            return SDL_SetError("DirectSound: Requested device not found");
-        }
-        guid = &devguid.guid;
-    }
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Open the audio device */
-    result = pDirectSoundCreate8(guid, &this->hidden->sound, NULL);
-    if (result != DS_OK) {
-        DSOUND_CloseDevice(this);
-        return SetDSerror("DirectSoundCreate", result);
-    }
-
-    while ((!valid_format) && (test_format)) {
-        switch (test_format) {
-        case AUDIO_U8:
-        case AUDIO_S16:
-        case AUDIO_S32:
-        case AUDIO_F32:
-            tried_format = SDL_TRUE;
-            this->spec.format = test_format;
-            this->hidden->num_buffers = CreateSecondary(this, NULL);
-            if (this->hidden->num_buffers > 0) {
-                valid_format = SDL_TRUE;
-            }
-            break;
-        }
-        test_format = SDL_NextAudioFormat();
-    }
-
-    if (!valid_format) {
-        DSOUND_CloseDevice(this);
-        if (tried_format) {
-            return -1;  /* CreateSecondary() should have called SDL_SetError(). */
-        }
-        return SDL_SetError("DirectSound: Unsupported audio format");
-    }
-
-    /* The buffer will auto-start playing in DSOUND_WaitDevice() */
-    this->hidden->mixlen = this->spec.size;
-
-    return 0;                   /* good to go. */
-}
-
-
-static void
-DSOUND_Deinitialize(void)
-{
-    DSOUND_Unload();
-}
-
-
-static int
-DSOUND_Init(SDL_AudioDriverImpl * impl)
-{
-    if (!DSOUND_Load()) {
-        return 0;
-    }
-
-    /* Set the function pointers */
-    impl->DetectDevices = DSOUND_DetectDevices;
-    impl->OpenDevice = DSOUND_OpenDevice;
-    impl->PlayDevice = DSOUND_PlayDevice;
-    impl->WaitDevice = DSOUND_WaitDevice;
-    impl->WaitDone = DSOUND_WaitDone;
-    impl->GetDeviceBuf = DSOUND_GetDeviceBuf;
-    impl->CloseDevice = DSOUND_CloseDevice;
-    impl->Deinitialize = DSOUND_Deinitialize;
-
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap DSOUND_bootstrap = {
-    "directsound", "DirectSound", DSOUND_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_DSOUND */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/directsound/SDL_directsound.h b/deps/SDL2/src/audio/directsound/SDL_directsound.h
deleted file mode 100644
index 758299f..0000000
--- a/deps/SDL2/src/audio/directsound/SDL_directsound.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_directsound_h
-#define _SDL_directsound_h
-
-#include "directx.h"
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-/* The DirectSound objects */
-struct SDL_PrivateAudioData
-{
-    LPDIRECTSOUND sound;
-    LPDIRECTSOUNDBUFFER mixbuf;
-    int num_buffers;
-    int mixlen;
-    DWORD lastchunk;
-    Uint8 *locked_buf;
-};
-
-#endif /* _SDL_directsound_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/directsound/directx.h b/deps/SDL2/src/audio/directsound/directx.h
deleted file mode 100644
index 963d2b8..0000000
--- a/deps/SDL2/src/audio/directsound/directx.h
+++ /dev/null
@@ -1,81 +0,0 @@
-
-#ifndef _directx_h
-#define _directx_h
-
-/* Include all of the DirectX 8.0 headers and adds any necessary tweaks */
-
-#include "../../core/windows/SDL_windows.h"
-#include <mmsystem.h>
-#ifndef WIN32
-#define WIN32
-#endif
-#undef  WINNT
-
-/* Far pointers don't exist in 32-bit code */
-#ifndef FAR
-#define FAR
-#endif
-
-/* Error codes not yet included in Win32 API header files */
-#ifndef MAKE_HRESULT
-#define MAKE_HRESULT(sev,fac,code) \
-    ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))))
-#endif
-
-#ifndef S_OK
-#define S_OK        (HRESULT)0x00000000L
-#endif
-
-#ifndef SUCCEEDED
-#define SUCCEEDED(x)    ((HRESULT)(x) >= 0)
-#endif
-#ifndef FAILED
-#define FAILED(x)   ((HRESULT)(x)<0)
-#endif
-
-#ifndef E_FAIL
-#define E_FAIL      (HRESULT)0x80000008L
-#endif
-#ifndef E_NOINTERFACE
-#define E_NOINTERFACE   (HRESULT)0x80004002L
-#endif
-#ifndef E_OUTOFMEMORY
-#define E_OUTOFMEMORY   (HRESULT)0x8007000EL
-#endif
-#ifndef E_INVALIDARG
-#define E_INVALIDARG    (HRESULT)0x80070057L
-#endif
-#ifndef E_NOTIMPL
-#define E_NOTIMPL   (HRESULT)0x80004001L
-#endif
-#ifndef REGDB_E_CLASSNOTREG
-#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L
-#endif
-
-/* Severity codes */
-#ifndef SEVERITY_ERROR
-#define SEVERITY_ERROR  1
-#endif
-
-/* Error facility codes */
-#ifndef FACILITY_WIN32
-#define FACILITY_WIN32  7
-#endif
-
-#ifndef FIELD_OFFSET
-#define FIELD_OFFSET(type, field)    ((LONG)&(((type *)0)->field))
-#endif
-
-/* DirectX headers (if it isn't included, I haven't tested it yet)
- */
-/* We need these defines to mark what version of DirectX API we use */
-#define DIRECTDRAW_VERSION  0x0700
-#define DIRECTSOUND_VERSION 0x0800
-#define DIRECTINPUT_VERSION 0x0500
-
-#include <ddraw.h>
-#include <dsound.h>
-#include <dinput.h>
-
-#endif /* _directx_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/disk/SDL_diskaudio.c b/deps/SDL2/src/audio/disk/SDL_diskaudio.c
deleted file mode 100644
index 0dc650e..0000000
--- a/deps/SDL2/src/audio/disk/SDL_diskaudio.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_DISK
-
-/* Output raw audio data to a file. */
-
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#include "SDL_rwops.h"
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_diskaudio.h"
-
-/* environment variables and defaults. */
-#define DISKENVR_OUTFILE         "SDL_DISKAUDIOFILE"
-#define DISKDEFAULT_OUTFILE      "sdlaudio.raw"
-#define DISKENVR_WRITEDELAY      "SDL_DISKAUDIODELAY"
-#define DISKDEFAULT_WRITEDELAY   150
-
-static const char *
-DISKAUD_GetOutputFilename(const char *devname)
-{
-    if (devname == NULL) {
-        devname = SDL_getenv(DISKENVR_OUTFILE);
-        if (devname == NULL) {
-            devname = DISKDEFAULT_OUTFILE;
-        }
-    }
-    return devname;
-}
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-DISKAUD_WaitDevice(_THIS)
-{
-    SDL_Delay(this->hidden->write_delay);
-}
-
-static void
-DISKAUD_PlayDevice(_THIS)
-{
-    size_t written;
-
-    /* Write the audio data */
-    written = SDL_RWwrite(this->hidden->output,
-                          this->hidden->mixbuf, 1, this->hidden->mixlen);
-
-    /* If we couldn't write, assume fatal error for now */
-    if (written != this->hidden->mixlen) {
-        this->enabled = 0;
-    }
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static Uint8 *
-DISKAUD_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-static void
-DISKAUD_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->output != NULL) {
-            SDL_RWclose(this->hidden->output);
-            this->hidden->output = NULL;
-        }
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static int
-DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    const char *envr = SDL_getenv(DISKENVR_WRITEDELAY);
-    const char *fname = DISKAUD_GetOutputFilename(devname);
-
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc(sizeof(*this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, sizeof(*this->hidden));
-
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->write_delay =
-        (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY;
-
-    /* Open the audio device */
-    this->hidden->output = SDL_RWFromFile(fname, "wb");
-    if (this->hidden->output == NULL) {
-        DISKAUD_CloseDevice(this);
-        return -1;
-    }
-
-    /* Allocate mixing buffer */
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        DISKAUD_CloseDevice(this);
-        return -1;
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-#if HAVE_STDIO_H
-    fprintf(stderr,
-            "WARNING: You are using the SDL disk writer audio driver!\n"
-            " Writing to file [%s].\n", fname);
-#endif
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-static int
-DISKAUD_Init(SDL_AudioDriverImpl * impl)
-{
-    /* Set the function pointers */
-    impl->OpenDevice = DISKAUD_OpenDevice;
-    impl->WaitDevice = DISKAUD_WaitDevice;
-    impl->PlayDevice = DISKAUD_PlayDevice;
-    impl->GetDeviceBuf = DISKAUD_GetDeviceBuf;
-    impl->CloseDevice = DISKAUD_CloseDevice;
-
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap DISKAUD_bootstrap = {
-    "disk", "direct-to-disk audio", DISKAUD_Init, 1
-};
-
-#endif /* SDL_AUDIO_DRIVER_DISK */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/disk/SDL_diskaudio.h b/deps/SDL2/src/audio/disk/SDL_diskaudio.h
deleted file mode 100644
index 7e5b484..0000000
--- a/deps/SDL2/src/audio/disk/SDL_diskaudio.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_diskaudio_h
-#define _SDL_diskaudio_h
-
-#include "SDL_rwops.h"
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The file descriptor for the audio device */
-    SDL_RWops *output;
-    Uint8 *mixbuf;
-    Uint32 mixlen;
-    Uint32 write_delay;
-};
-
-#endif /* _SDL_diskaudio_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/dsp/SDL_dspaudio.c b/deps/SDL2/src/audio/dsp/SDL_dspaudio.c
deleted file mode 100644
index e319017..0000000
--- a/deps/SDL2/src/audio/dsp/SDL_dspaudio.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_OSS
-
-/* Allow access to a raw mixing buffer */
-
-#include <stdio.h>              /* For perror() */
-#include <string.h>             /* For strerror() */
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-
-#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
-/* This is installed on some systems */
-#include <soundcard.h>
-#else
-/* This is recommended by OSS */
-#include <sys/soundcard.h>
-#endif
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_dspaudio.h"
-
-
-static void
-DSP_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
-{
-    SDL_EnumUnixAudioDevices(iscapture, 0, NULL, addfn);
-}
-
-
-static void
-DSP_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->audio_fd >= 0) {
-            close(this->hidden->audio_fd);
-            this->hidden->audio_fd = -1;
-        }
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-
-static int
-DSP_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT);
-    int format;
-    int value;
-    int frag_spec;
-    SDL_AudioFormat test_format;
-
-    /* We don't care what the devname is...we'll try to open anything. */
-    /*  ...but default to first name in the list... */
-    if (devname == NULL) {
-        devname = SDL_GetAudioDeviceName(0, iscapture);
-        if (devname == NULL) {
-            return SDL_SetError("No such audio device");
-        }
-    }
-
-    /* Make sure fragment size stays a power of 2, or OSS fails. */
-    /* I don't know which of these are actually legal values, though... */
-    if (this->spec.channels > 8)
-        this->spec.channels = 8;
-    else if (this->spec.channels > 4)
-        this->spec.channels = 4;
-    else if (this->spec.channels > 2)
-        this->spec.channels = 2;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Open the audio device */
-    this->hidden->audio_fd = open(devname, flags, 0);
-    if (this->hidden->audio_fd < 0) {
-        DSP_CloseDevice(this);
-        return SDL_SetError("Couldn't open %s: %s", devname, strerror(errno));
-    }
-    this->hidden->mixbuf = NULL;
-
-    /* Make the file descriptor use blocking writes with fcntl() */
-    {
-        long ctlflags;
-        ctlflags = fcntl(this->hidden->audio_fd, F_GETFL);
-        ctlflags &= ~O_NONBLOCK;
-        if (fcntl(this->hidden->audio_fd, F_SETFL, ctlflags) < 0) {
-            DSP_CloseDevice(this);
-            return SDL_SetError("Couldn't set audio blocking mode");
-        }
-    }
-
-    /* Get a list of supported hardware formats */
-    if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0) {
-        perror("SNDCTL_DSP_GETFMTS");
-        DSP_CloseDevice(this);
-        return SDL_SetError("Couldn't get audio format list");
-    }
-
-    /* Try for a closest match on audio format */
-    format = 0;
-    for (test_format = SDL_FirstAudioFormat(this->spec.format);
-         !format && test_format;) {
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
-        switch (test_format) {
-        case AUDIO_U8:
-            if (value & AFMT_U8) {
-                format = AFMT_U8;
-            }
-            break;
-        case AUDIO_S16LSB:
-            if (value & AFMT_S16_LE) {
-                format = AFMT_S16_LE;
-            }
-            break;
-        case AUDIO_S16MSB:
-            if (value & AFMT_S16_BE) {
-                format = AFMT_S16_BE;
-            }
-            break;
-#if 0
-/*
- * These formats are not used by any real life systems so they are not
- * needed here.
- */
-        case AUDIO_S8:
-            if (value & AFMT_S8) {
-                format = AFMT_S8;
-            }
-            break;
-        case AUDIO_U16LSB:
-            if (value & AFMT_U16_LE) {
-                format = AFMT_U16_LE;
-            }
-            break;
-        case AUDIO_U16MSB:
-            if (value & AFMT_U16_BE) {
-                format = AFMT_U16_BE;
-            }
-            break;
-#endif
-        default:
-            format = 0;
-            break;
-        }
-        if (!format) {
-            test_format = SDL_NextAudioFormat();
-        }
-    }
-    if (format == 0) {
-        DSP_CloseDevice(this);
-        return SDL_SetError("Couldn't find any hardware audio formats");
-    }
-    this->spec.format = test_format;
-
-    /* Set the audio format */
-    value = format;
-    if ((ioctl(this->hidden->audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) ||
-        (value != format)) {
-        perror("SNDCTL_DSP_SETFMT");
-        DSP_CloseDevice(this);
-        return SDL_SetError("Couldn't set audio format");
-    }
-
-    /* Set the number of channels of output */
-    value = this->spec.channels;
-    if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_CHANNELS, &value) < 0) {
-        perror("SNDCTL_DSP_CHANNELS");
-        DSP_CloseDevice(this);
-        return SDL_SetError("Cannot set the number of channels");
-    }
-    this->spec.channels = value;
-
-    /* Set the DSP frequency */
-    value = this->spec.freq;
-    if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_SPEED, &value) < 0) {
-        perror("SNDCTL_DSP_SPEED");
-        DSP_CloseDevice(this);
-        return SDL_SetError("Couldn't set audio frequency");
-    }
-    this->spec.freq = value;
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Determine the power of two of the fragment size */
-    for (frag_spec = 0; (0x01U << frag_spec) < this->spec.size; ++frag_spec);
-    if ((0x01U << frag_spec) != this->spec.size) {
-        DSP_CloseDevice(this);
-        return SDL_SetError("Fragment size must be a power of two");
-    }
-    frag_spec |= 0x00020000;    /* two fragments, for low latency */
-
-    /* Set the audio buffering parameters */
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Requesting %d fragments of size %d\n",
-            (frag_spec >> 16), 1 << (frag_spec & 0xFFFF));
-#endif
-    if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0) {
-        perror("SNDCTL_DSP_SETFRAGMENT");
-    }
-#ifdef DEBUG_AUDIO
-    {
-        audio_buf_info info;
-        ioctl(this->hidden->audio_fd, SNDCTL_DSP_GETOSPACE, &info);
-        fprintf(stderr, "fragments = %d\n", info.fragments);
-        fprintf(stderr, "fragstotal = %d\n", info.fragstotal);
-        fprintf(stderr, "fragsize = %d\n", info.fragsize);
-        fprintf(stderr, "bytes = %d\n", info.bytes);
-    }
-#endif
-
-    /* Allocate mixing buffer */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        DSP_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-
-static void
-DSP_PlayDevice(_THIS)
-{
-    const Uint8 *mixbuf = this->hidden->mixbuf;
-    const int mixlen = this->hidden->mixlen;
-    if (write(this->hidden->audio_fd, mixbuf, mixlen) == -1) {
-        perror("Audio write");
-        this->enabled = 0;
-    }
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Wrote %d bytes of audio data\n", mixlen);
-#endif
-}
-
-static Uint8 *
-DSP_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-static int
-DSP_Init(SDL_AudioDriverImpl * impl)
-{
-    /* Set the function pointers */
-    impl->DetectDevices = DSP_DetectDevices;
-    impl->OpenDevice = DSP_OpenDevice;
-    impl->PlayDevice = DSP_PlayDevice;
-    impl->GetDeviceBuf = DSP_GetDeviceBuf;
-    impl->CloseDevice = DSP_CloseDevice;
-
-    return 1;   /* this audio target is available. */
-}
-
-
-AudioBootStrap DSP_bootstrap = {
-    "dsp", "OSS /dev/dsp standard audio", DSP_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_OSS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/dsp/SDL_dspaudio.h b/deps/SDL2/src/audio/dsp/SDL_dspaudio.h
deleted file mode 100644
index 62ed45f..0000000
--- a/deps/SDL2/src/audio/dsp/SDL_dspaudio.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dspaudio_h
-#define _SDL_dspaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The file descriptor for the audio device */
-    int audio_fd;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-};
-#define FUDGE_TICKS 10      /* The scheduler overhead ticks per frame */
-
-#endif /* _SDL_dspaudio_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/dummy/SDL_dummyaudio.c b/deps/SDL2/src/audio/dummy/SDL_dummyaudio.c
deleted file mode 100644
index c3e8ea4..0000000
--- a/deps/SDL2/src/audio/dummy/SDL_dummyaudio.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Output audio to nowhere... */
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "SDL_dummyaudio.h"
-
-static int
-DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    return 0;                   /* always succeeds. */
-}
-
-static int
-DUMMYAUD_Init(SDL_AudioDriverImpl * impl)
-{
-    /* Set the function pointers */
-    impl->OpenDevice = DUMMYAUD_OpenDevice;
-    impl->OnlyHasDefaultOutputDevice = 1;
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap DUMMYAUD_bootstrap = {
-    "dummy", "SDL dummy audio driver", DUMMYAUD_Init, 1
-};
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/dummy/SDL_dummyaudio.h b/deps/SDL2/src/audio/dummy/SDL_dummyaudio.h
deleted file mode 100644
index c0015a5..0000000
--- a/deps/SDL2/src/audio/dummy/SDL_dummyaudio.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dummyaudio_h
-#define _SDL_dummyaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The file descriptor for the audio device */
-    Uint8 *mixbuf;
-    Uint32 mixlen;
-    Uint32 write_delay;
-    Uint32 initial_calls;
-};
-
-#endif /* _SDL_dummyaudio_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/esd/SDL_esdaudio.c b/deps/SDL2/src/audio/esd/SDL_esdaudio.c
deleted file mode 100644
index 8bba640..0000000
--- a/deps/SDL2/src/audio/esd/SDL_esdaudio.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_ESD
-
-/* Allow access to an ESD network stream mixing buffer */
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
-#include <esd.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_esdaudio.h"
-
-#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-#else
-#define SDL_NAME(X) X
-#endif
-
-#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
-
-static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC;
-static void *esd_handle = NULL;
-
-static int (*SDL_NAME(esd_open_sound)) (const char *host);
-static int (*SDL_NAME(esd_close)) (int esd);
-static int (*SDL_NAME(esd_play_stream)) (esd_format_t format, int rate,
-                                         const char *host, const char *name);
-
-#define SDL_ESD_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) }
-static struct
-{
-    const char *name;
-    void **func;
-} const esd_functions[] = {
-    SDL_ESD_SYM(esd_open_sound),
-    SDL_ESD_SYM(esd_close), SDL_ESD_SYM(esd_play_stream),
-};
-
-#undef SDL_ESD_SYM
-
-static void
-UnloadESDLibrary()
-{
-    if (esd_handle != NULL) {
-        SDL_UnloadObject(esd_handle);
-        esd_handle = NULL;
-    }
-}
-
-static int
-LoadESDLibrary(void)
-{
-    int i, retval = -1;
-
-    if (esd_handle == NULL) {
-        esd_handle = SDL_LoadObject(esd_library);
-        if (esd_handle) {
-            retval = 0;
-            for (i = 0; i < SDL_arraysize(esd_functions); ++i) {
-                *esd_functions[i].func =
-                    SDL_LoadFunction(esd_handle, esd_functions[i].name);
-                if (!*esd_functions[i].func) {
-                    retval = -1;
-                    UnloadESDLibrary();
-                    break;
-                }
-            }
-        }
-    }
-    return retval;
-}
-
-#else
-
-static void
-UnloadESDLibrary()
-{
-    return;
-}
-
-static int
-LoadESDLibrary(void)
-{
-    return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */
-
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-ESD_WaitDevice(_THIS)
-{
-    Sint32 ticks;
-
-    /* Check to see if the thread-parent process is still alive */
-    {
-        static int cnt = 0;
-        /* Note that this only works with thread implementations
-           that use a different process id for each thread.
-         */
-        /* Check every 10 loops */
-        if (this->hidden->parent && (((++cnt) % 10) == 0)) {
-            if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) {
-                this->enabled = 0;
-            }
-        }
-    }
-
-    /* Use timer for general audio synchronization */
-    ticks = ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS;
-    if (ticks > 0) {
-        SDL_Delay(ticks);
-    }
-}
-
-static void
-ESD_PlayDevice(_THIS)
-{
-    int written = 0;
-
-    /* Write the audio data, checking for EAGAIN on broken audio drivers */
-    do {
-        written = write(this->hidden->audio_fd,
-                        this->hidden->mixbuf, this->hidden->mixlen);
-        if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) {
-            SDL_Delay(1);       /* Let a little CPU time go by */
-        }
-    } while ((written < 0) &&
-             ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));
-
-    /* Set the next write frame */
-    this->hidden->next_frame += this->hidden->frame_ticks;
-
-    /* If we couldn't write, assume fatal error for now */
-    if (written < 0) {
-        this->enabled = 0;
-    }
-}
-
-static Uint8 *
-ESD_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-static void
-ESD_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->audio_fd >= 0) {
-            SDL_NAME(esd_close) (this->hidden->audio_fd);
-            this->hidden->audio_fd = -1;
-        }
-
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-/* Try to get the name of the program */
-static char *
-get_progname(void)
-{
-    char *progname = NULL;
-#ifdef __LINUX__
-    FILE *fp;
-    static char temp[BUFSIZ];
-
-    SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid());
-    fp = fopen(temp, "r");
-    if (fp != NULL) {
-        if (fgets(temp, sizeof(temp) - 1, fp)) {
-            progname = SDL_strrchr(temp, '/');
-            if (progname == NULL) {
-                progname = temp;
-            } else {
-                progname = progname + 1;
-            }
-        }
-        fclose(fp);
-    }
-#endif
-    return (progname);
-}
-
-
-static int
-ESD_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    esd_format_t format = (ESD_STREAM | ESD_PLAY);
-    SDL_AudioFormat test_format = 0;
-    int found = 0;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-    this->hidden->audio_fd = -1;
-
-    /* Convert audio spec to the ESD audio format */
-    /* Try for a closest match on audio format */
-    for (test_format = SDL_FirstAudioFormat(this->spec.format);
-         !found && test_format; test_format = SDL_NextAudioFormat()) {
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
-        found = 1;
-        switch (test_format) {
-        case AUDIO_U8:
-            format |= ESD_BITS8;
-            break;
-        case AUDIO_S16SYS:
-            format |= ESD_BITS16;
-            break;
-        default:
-            found = 0;
-            break;
-        }
-    }
-
-    if (!found) {
-        ESD_CloseDevice(this);
-        return SDL_SetError("Couldn't find any hardware audio formats");
-    }
-
-    if (this->spec.channels == 1) {
-        format |= ESD_MONO;
-    } else {
-        format |= ESD_STEREO;
-    }
-#if 0
-    this->spec.samples = ESD_BUF_SIZE;  /* Darn, no way to change this yet */
-#endif
-
-    /* Open a connection to the ESD audio server */
-    this->hidden->audio_fd =
-        SDL_NAME(esd_play_stream) (format, this->spec.freq, NULL,
-                                   get_progname());
-
-    if (this->hidden->audio_fd < 0) {
-        ESD_CloseDevice(this);
-        return SDL_SetError("Couldn't open ESD connection");
-    }
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-    this->hidden->frame_ticks =
-        (float) (this->spec.samples * 1000) / this->spec.freq;
-    this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks;
-
-    /* Allocate mixing buffer */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        ESD_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-    /* Get the parent process id (we're the parent of the audio thread) */
-    this->hidden->parent = getpid();
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-static void
-ESD_Deinitialize(void)
-{
-    UnloadESDLibrary();
-}
-
-static int
-ESD_Init(SDL_AudioDriverImpl * impl)
-{
-    if (LoadESDLibrary() < 0) {
-        return 0;
-    } else {
-        int connection = 0;
-
-        /* Don't start ESD if it's not running */
-        SDL_setenv("ESD_NO_SPAWN", "1", 0);
-
-        connection = SDL_NAME(esd_open_sound) (NULL);
-        if (connection < 0) {
-            UnloadESDLibrary();
-            SDL_SetError("ESD: esd_open_sound failed (no audio server?)");
-            return 0;
-        }
-        SDL_NAME(esd_close) (connection);
-    }
-
-    /* Set the function pointers */
-    impl->OpenDevice = ESD_OpenDevice;
-    impl->PlayDevice = ESD_PlayDevice;
-    impl->WaitDevice = ESD_WaitDevice;
-    impl->GetDeviceBuf = ESD_GetDeviceBuf;
-    impl->CloseDevice = ESD_CloseDevice;
-    impl->Deinitialize = ESD_Deinitialize;
-    impl->OnlyHasDefaultOutputDevice = 1;
-
-    return 1;   /* this audio target is available. */
-}
-
-
-AudioBootStrap ESD_bootstrap = {
-    "esd", "Enlightened Sound Daemon", ESD_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_ESD */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/esd/SDL_esdaudio.h b/deps/SDL2/src/audio/esd/SDL_esdaudio.h
deleted file mode 100644
index 26bea9c..0000000
--- a/deps/SDL2/src/audio/esd/SDL_esdaudio.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_esdaudio_h
-#define _SDL_esdaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The file descriptor for the audio device */
-    int audio_fd;
-
-    /* The parent process id, to detect when application quits */
-    pid_t parent;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-
-    /* Support for audio timing using a timer */
-    float frame_ticks;
-    float next_frame;
-};
-#define FUDGE_TICKS 10      /* The scheduler overhead ticks per frame */
-
-#endif /* _SDL_esdaudio_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/fusionsound/SDL_fsaudio.c b/deps/SDL2/src/audio/fusionsound/SDL_fsaudio.c
deleted file mode 100644
index 49ad2c1..0000000
--- a/deps/SDL2/src/audio/fusionsound/SDL_fsaudio.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_FUSIONSOUND
-
-/* Allow access to a raw mixing buffer */
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#include <unistd.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_fsaudio.h"
-
-#include <fusionsound/fusionsound_version.h>
-
-/* #define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so" */
-
-#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-#else
-#define SDL_NAME(X) X
-#endif
-
-#if (FUSIONSOUND_MAJOR_VERSION == 1) && (FUSIONSOUND_MINOR_VERSION < 1)
-typedef DFBResult DirectResult;
-#endif
-
-/* Buffers to use - more than 2 gives a lot of latency */
-#define FUSION_BUFFERS              (2)
-
-#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
-
-static const char *fs_library = SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC;
-static void *fs_handle = NULL;
-
-static DirectResult (*SDL_NAME(FusionSoundInit)) (int *argc, char *(*argv[]));
-static DirectResult (*SDL_NAME(FusionSoundCreate)) (IFusionSound **
-                                                   ret_interface);
-
-#define SDL_FS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) }
-static struct
-{
-    const char *name;
-    void **func;
-} fs_functions[] = {
-/* *INDENT-OFF* */
-    SDL_FS_SYM(FusionSoundInit),
-    SDL_FS_SYM(FusionSoundCreate),
-/* *INDENT-ON* */
-};
-
-#undef SDL_FS_SYM
-
-static void
-UnloadFusionSoundLibrary()
-{
-    if (fs_handle != NULL) {
-        SDL_UnloadObject(fs_handle);
-        fs_handle = NULL;
-    }
-}
-
-static int
-LoadFusionSoundLibrary(void)
-{
-    int i, retval = -1;
-
-    if (fs_handle == NULL) {
-        fs_handle = SDL_LoadObject(fs_library);
-        if (fs_handle != NULL) {
-            retval = 0;
-            for (i = 0; i < SDL_arraysize(fs_functions); ++i) {
-                *fs_functions[i].func =
-                    SDL_LoadFunction(fs_handle, fs_functions[i].name);
-                if (!*fs_functions[i].func) {
-                    retval = -1;
-                    UnloadFusionSoundLibrary();
-                    break;
-                }
-            }
-        }
-    }
-
-    return retval;
-}
-
-#else
-
-static void
-UnloadFusionSoundLibrary()
-{
-    return;
-}
-
-static int
-LoadFusionSoundLibrary(void)
-{
-    return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-SDL_FS_WaitDevice(_THIS)
-{
-    this->hidden->stream->Wait(this->hidden->stream,
-                               this->hidden->mixsamples);
-}
-
-static void
-SDL_FS_PlayDevice(_THIS)
-{
-    DirectResult ret;
-
-    ret = this->hidden->stream->Write(this->hidden->stream,
-                                      this->hidden->mixbuf,
-                                      this->hidden->mixsamples);
-    /* If we couldn't write, assume fatal error for now */
-    if (ret) {
-        this->enabled = 0;
-    }
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen);
-#endif
-}
-
-static void
-SDL_FS_WaitDone(_THIS)
-{
-    this->hidden->stream->Wait(this->hidden->stream,
-                               this->hidden->mixsamples * FUSION_BUFFERS);
-}
-
-
-static Uint8 *
-SDL_FS_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-
-static void
-SDL_FS_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->stream) {
-            this->hidden->stream->Release(this->hidden->stream);
-            this->hidden->stream = NULL;
-        }
-        if (this->hidden->fs) {
-            this->hidden->fs->Release(this->hidden->fs);
-            this->hidden->fs = NULL;
-        }
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-
-static int
-SDL_FS_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    int bytes;
-    SDL_AudioFormat test_format = 0, format = 0;
-    FSSampleFormat fs_format;
-    FSStreamDescription desc;
-    DirectResult ret;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Try for a closest match on audio format */
-    for (test_format = SDL_FirstAudioFormat(this->spec.format);
-         !format && test_format;) {
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
-        switch (test_format) {
-        case AUDIO_U8:
-            fs_format = FSSF_U8;
-            bytes = 1;
-            format = 1;
-            break;
-        case AUDIO_S16SYS:
-            fs_format = FSSF_S16;
-            bytes = 2;
-            format = 1;
-            break;
-        case AUDIO_S32SYS:
-            fs_format = FSSF_S32;
-            bytes = 4;
-            format = 1;
-            break;
-        case AUDIO_F32SYS:
-            fs_format = FSSF_FLOAT;
-            bytes = 4;
-            format = 1;
-            break;
-        default:
-            format = 0;
-            break;
-        }
-        if (!format) {
-            test_format = SDL_NextAudioFormat();
-        }
-    }
-
-    if (format == 0) {
-        SDL_FS_CloseDevice(this);
-        return SDL_SetError("Couldn't find any hardware audio formats");
-    }
-    this->spec.format = test_format;
-
-    /* Retrieve the main sound interface. */
-    ret = SDL_NAME(FusionSoundCreate) (&this->hidden->fs);
-    if (ret) {
-        SDL_FS_CloseDevice(this);
-        return SDL_SetError("Unable to initialize FusionSound: %d", ret);
-    }
-
-    this->hidden->mixsamples = this->spec.size / bytes / this->spec.channels;
-
-    /* Fill stream description. */
-    desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE |
-        FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT | FSSDF_PREBUFFER;
-    desc.samplerate = this->spec.freq;
-    desc.buffersize = this->spec.size * FUSION_BUFFERS;
-    desc.channels = this->spec.channels;
-    desc.prebuffer = 10;
-    desc.sampleformat = fs_format;
-
-    ret =
-        this->hidden->fs->CreateStream(this->hidden->fs, &desc,
-                                       &this->hidden->stream);
-    if (ret) {
-        SDL_FS_CloseDevice(this);
-        return SDL_SetError("Unable to create FusionSoundStream: %d", ret);
-    }
-
-    /* See what we got */
-    desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE |
-        FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT;
-    ret = this->hidden->stream->GetDescription(this->hidden->stream, &desc);
-
-    this->spec.freq = desc.samplerate;
-    this->spec.size =
-        desc.buffersize / FUSION_BUFFERS * bytes * desc.channels;
-    this->spec.channels = desc.channels;
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Allocate mixing buffer */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        SDL_FS_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-
-static void
-SDL_FS_Deinitialize(void)
-{
-    UnloadFusionSoundLibrary();
-}
-
-
-static int
-SDL_FS_Init(SDL_AudioDriverImpl * impl)
-{
-    if (LoadFusionSoundLibrary() < 0) {
-        return 0;
-    } else {
-        DirectResult ret;
-
-        ret = SDL_NAME(FusionSoundInit) (NULL, NULL);
-        if (ret) {
-            UnloadFusionSoundLibrary();
-            SDL_SetError
-                ("FusionSound: SDL_FS_init failed (FusionSoundInit: %d)",
-                 ret);
-            return 0;
-        }
-    }
-
-    /* Set the function pointers */
-    impl->OpenDevice = SDL_FS_OpenDevice;
-    impl->PlayDevice = SDL_FS_PlayDevice;
-    impl->WaitDevice = SDL_FS_WaitDevice;
-    impl->GetDeviceBuf = SDL_FS_GetDeviceBuf;
-    impl->CloseDevice = SDL_FS_CloseDevice;
-    impl->WaitDone = SDL_FS_WaitDone;
-    impl->Deinitialize = SDL_FS_Deinitialize;
-    impl->OnlyHasDefaultOutputDevice = 1;
-
-    return 1;   /* this audio target is available. */
-}
-
-
-AudioBootStrap FUSIONSOUND_bootstrap = {
-    "fusionsound", "FusionSound", SDL_FS_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/fusionsound/SDL_fsaudio.h b/deps/SDL2/src/audio/fusionsound/SDL_fsaudio.h
deleted file mode 100644
index 7f22775..0000000
--- a/deps/SDL2/src/audio/fusionsound/SDL_fsaudio.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_fsaudio_h
-#define _SDL_fsaudio_h
-
-#include <fusionsound/fusionsound.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* Interface */
-    IFusionSound *fs;
-
-    /* The stream interface for the audio device */
-    IFusionSoundStream *stream;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-    int mixsamples;
-
-};
-
-#endif /* _SDL_fsaudio_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/nas/SDL_nasaudio.c b/deps/SDL2/src/audio/nas/SDL_nasaudio.c
deleted file mode 100644
index c2bf677..0000000
--- a/deps/SDL2/src/audio/nas/SDL_nasaudio.c
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_NAS
-
-/* Allow access to a raw mixing buffer */
-
-#include <signal.h>
-#include <unistd.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "SDL_loadso.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_nasaudio.h"
-
-static struct SDL_PrivateAudioData *this2 = NULL;
-
-
-static void (*NAS_AuCloseServer) (AuServer *);
-static void (*NAS_AuNextEvent) (AuServer *, AuBool, AuEvent *);
-static AuBool(*NAS_AuDispatchEvent) (AuServer *, AuEvent *);
-static AuFlowID(*NAS_AuCreateFlow) (AuServer *, AuStatus *);
-static void (*NAS_AuStartFlow) (AuServer *, AuFlowID, AuStatus *);
-static void (*NAS_AuSetElements)
-  (AuServer *, AuFlowID, AuBool, int, AuElement *, AuStatus *);
-static void (*NAS_AuWriteElement)
-  (AuServer *, AuFlowID, int, AuUint32, AuPointer, AuBool, AuStatus *);
-static AuServer *(*NAS_AuOpenServer)
-  (_AuConst char *, int, _AuConst char *, int, _AuConst char *, char **);
-static AuEventHandlerRec *(*NAS_AuRegisterEventHandler)
-  (AuServer *, AuMask, int, AuID, AuEventHandlerCallback, AuPointer);
-
-
-#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
-
-static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC;
-static void *nas_handle = NULL;
-
-static int
-load_nas_sym(const char *fn, void **addr)
-{
-    *addr = SDL_LoadFunction(nas_handle, fn);
-    if (*addr == NULL) {
-        return 0;
-    }
-    return 1;
-}
-
-/* cast funcs to char* first, to please GCC's strict aliasing rules. */
-#define SDL_NAS_SYM(x) \
-    if (!load_nas_sym(#x, (void **) (char *) &NAS_##x)) return -1
-#else
-#define SDL_NAS_SYM(x) NAS_##x = x
-#endif
-
-static int
-load_nas_syms(void)
-{
-    SDL_NAS_SYM(AuCloseServer);
-    SDL_NAS_SYM(AuNextEvent);
-    SDL_NAS_SYM(AuDispatchEvent);
-    SDL_NAS_SYM(AuCreateFlow);
-    SDL_NAS_SYM(AuStartFlow);
-    SDL_NAS_SYM(AuSetElements);
-    SDL_NAS_SYM(AuWriteElement);
-    SDL_NAS_SYM(AuOpenServer);
-    SDL_NAS_SYM(AuRegisterEventHandler);
-    return 0;
-}
-
-#undef SDL_NAS_SYM
-
-#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
-
-static void
-UnloadNASLibrary(void)
-{
-    if (nas_handle != NULL) {
-        SDL_UnloadObject(nas_handle);
-        nas_handle = NULL;
-    }
-}
-
-static int
-LoadNASLibrary(void)
-{
-    int retval = 0;
-    if (nas_handle == NULL) {
-        nas_handle = SDL_LoadObject(nas_library);
-        if (nas_handle == NULL) {
-            /* Copy error string so we can use it in a new SDL_SetError(). */
-            const char *origerr = SDL_GetError();
-            const size_t len = SDL_strlen(origerr) + 1;
-            char *err = (char *) alloca(len);
-            SDL_strlcpy(err, origerr, len);
-            retval = -1;
-            SDL_SetError("NAS: SDL_LoadObject('%s') failed: %s\n",
-                         nas_library, err);
-        } else {
-            retval = load_nas_syms();
-            if (retval < 0) {
-                UnloadNASLibrary();
-            }
-        }
-    }
-    return retval;
-}
-
-#else
-
-static void
-UnloadNASLibrary(void)
-{
-}
-
-static int
-LoadNASLibrary(void)
-{
-    load_nas_syms();
-    return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_NAS_DYNAMIC */
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-NAS_WaitDevice(_THIS)
-{
-    while (this->hidden->buf_free < this->hidden->mixlen) {
-        AuEvent ev;
-        NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev);
-        NAS_AuDispatchEvent(this->hidden->aud, &ev);
-    }
-}
-
-static void
-NAS_PlayDevice(_THIS)
-{
-    while (this->hidden->mixlen > this->hidden->buf_free) {
-        /*
-         * We think the buffer is full? Yikes! Ask the server for events,
-         *  in the hope that some of them is LowWater events telling us more
-         *  of the buffer is free now than what we think.
-         */
-        AuEvent ev;
-        NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev);
-        NAS_AuDispatchEvent(this->hidden->aud, &ev);
-    }
-    this->hidden->buf_free -= this->hidden->mixlen;
-
-    /* Write the audio data */
-    NAS_AuWriteElement(this->hidden->aud, this->hidden->flow, 0,
-                       this->hidden->mixlen, this->hidden->mixbuf, AuFalse,
-                       NULL);
-
-    this->hidden->written += this->hidden->mixlen;
-
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen);
-#endif
-}
-
-static Uint8 *
-NAS_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-static void
-NAS_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->aud) {
-            NAS_AuCloseServer(this->hidden->aud);
-            this->hidden->aud = 0;
-        }
-        SDL_free(this->hidden);
-        this2 = this->hidden = NULL;
-    }
-}
-
-static unsigned char
-sdlformat_to_auformat(unsigned int fmt)
-{
-    switch (fmt) {
-    case AUDIO_U8:
-        return AuFormatLinearUnsigned8;
-    case AUDIO_S8:
-        return AuFormatLinearSigned8;
-    case AUDIO_U16LSB:
-        return AuFormatLinearUnsigned16LSB;
-    case AUDIO_U16MSB:
-        return AuFormatLinearUnsigned16MSB;
-    case AUDIO_S16LSB:
-        return AuFormatLinearSigned16LSB;
-    case AUDIO_S16MSB:
-        return AuFormatLinearSigned16MSB;
-    }
-    return AuNone;
-}
-
-static AuBool
-event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd)
-{
-    switch (ev->type) {
-    case AuEventTypeElementNotify:
-        {
-            AuElementNotifyEvent *event = (AuElementNotifyEvent *) ev;
-
-            switch (event->kind) {
-            case AuElementNotifyKindLowWater:
-                if (this2->buf_free >= 0) {
-                    this2->really += event->num_bytes;
-                    gettimeofday(&this2->last_tv, 0);
-                    this2->buf_free += event->num_bytes;
-                } else {
-                    this2->buf_free = event->num_bytes;
-                }
-                break;
-            case AuElementNotifyKindState:
-                switch (event->cur_state) {
-                case AuStatePause:
-                    if (event->reason != AuReasonUser) {
-                        if (this2->buf_free >= 0) {
-                            this2->really += event->num_bytes;
-                            gettimeofday(&this2->last_tv, 0);
-                            this2->buf_free += event->num_bytes;
-                        } else {
-                            this2->buf_free = event->num_bytes;
-                        }
-                    }
-                    break;
-                }
-            }
-        }
-    }
-    return AuTrue;
-}
-
-static AuDeviceID
-find_device(_THIS, int nch)
-{
-    /* These "Au" things are all macros, not functions... */
-    int i;
-    for (i = 0; i < AuServerNumDevices(this->hidden->aud); i++) {
-        if ((AuDeviceKind(AuServerDevice(this->hidden->aud, i)) ==
-             AuComponentKindPhysicalOutput) &&
-            AuDeviceNumTracks(AuServerDevice(this->hidden->aud, i)) == nch) {
-            return AuDeviceIdentifier(AuServerDevice(this->hidden->aud, i));
-        }
-    }
-    return AuNone;
-}
-
-static int
-NAS_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    AuElement elms[3];
-    int buffer_size;
-    SDL_AudioFormat test_format, format;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Try for a closest match on audio format */
-    format = 0;
-    for (test_format = SDL_FirstAudioFormat(this->spec.format);
-         !format && test_format;) {
-        format = sdlformat_to_auformat(test_format);
-        if (format == AuNone) {
-            test_format = SDL_NextAudioFormat();
-        }
-    }
-    if (format == 0) {
-        NAS_CloseDevice(this);
-        return SDL_SetError("NAS: Couldn't find any hardware audio formats");
-    }
-    this->spec.format = test_format;
-
-    this->hidden->aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL);
-    if (this->hidden->aud == 0) {
-        NAS_CloseDevice(this);
-        return SDL_SetError("NAS: Couldn't open connection to NAS server");
-    }
-
-    this->hidden->dev = find_device(this, this->spec.channels);
-    if ((this->hidden->dev == AuNone)
-        || (!(this->hidden->flow = NAS_AuCreateFlow(this->hidden->aud, 0)))) {
-        NAS_CloseDevice(this);
-        return SDL_SetError("NAS: Couldn't find a fitting device on NAS server");
-    }
-
-    buffer_size = this->spec.freq;
-    if (buffer_size < 4096)
-        buffer_size = 4096;
-
-    if (buffer_size > 32768)
-        buffer_size = 32768;    /* So that the buffer won't get unmanageably big. */
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    this2 = this->hidden;
-
-    AuMakeElementImportClient(elms, this->spec.freq, format,
-                              this->spec.channels, AuTrue, buffer_size,
-                              buffer_size / 4, 0, NULL);
-    AuMakeElementExportDevice(elms + 1, 0, this->hidden->dev, this->spec.freq,
-                              AuUnlimitedSamples, 0, NULL);
-    NAS_AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, 2, elms,
-                      NULL);
-    NAS_AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0,
-                               this->hidden->flow, event_handler,
-                               (AuPointer) NULL);
-
-    NAS_AuStartFlow(this->hidden->aud, this->hidden->flow, NULL);
-
-    /* Allocate mixing buffer */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        NAS_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-static void
-NAS_Deinitialize(void)
-{
-    UnloadNASLibrary();
-}
-
-static int
-NAS_Init(SDL_AudioDriverImpl * impl)
-{
-    if (LoadNASLibrary() < 0) {
-        return 0;
-    } else {
-        AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL);
-        if (aud == NULL) {
-            SDL_SetError("NAS: AuOpenServer() failed (no audio server?)");
-            return 0;
-        }
-        NAS_AuCloseServer(aud);
-    }
-
-    /* Set the function pointers */
-    impl->OpenDevice = NAS_OpenDevice;
-    impl->PlayDevice = NAS_PlayDevice;
-    impl->WaitDevice = NAS_WaitDevice;
-    impl->GetDeviceBuf = NAS_GetDeviceBuf;
-    impl->CloseDevice = NAS_CloseDevice;
-    impl->Deinitialize = NAS_Deinitialize;
-    impl->OnlyHasDefaultOutputDevice = 1;       /* !!! FIXME: is this true? */
-
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap NAS_bootstrap = {
-    "nas", "Network Audio System", NAS_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_NAS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/nas/SDL_nasaudio.h b/deps/SDL2/src/audio/nas/SDL_nasaudio.h
deleted file mode 100644
index 85bd761..0000000
--- a/deps/SDL2/src/audio/nas/SDL_nasaudio.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_nasaudio_h
-#define _SDL_nasaudio_h
-
-#ifdef __sgi
-#include <nas/audiolib.h>
-#else
-#include <audio/audiolib.h>
-#endif
-#include <sys/time.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    AuServer *aud;
-    AuFlowID flow;
-    AuDeviceID dev;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-
-    int written;
-    int really;
-    int bps;
-    struct timeval last_tv;
-    int buf_free;
-};
-#endif /* _SDL_nasaudio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/paudio/SDL_paudio.c b/deps/SDL2/src/audio/paudio/SDL_paudio.c
deleted file mode 100644
index 8a248af..0000000
--- a/deps/SDL2/src/audio/paudio/SDL_paudio.c
+++ /dev/null
@@ -1,541 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_PAUDIO
-
-/* Allow access to a raw mixing buffer */
-
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "SDL_stdinc.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_paudio.h"
-
-#define DEBUG_AUDIO 0
-
-/* A conflict within AIX 4.3.3 <sys/> headers and probably others as well.
- * I guess nobody ever uses audio... Shame over AIX header files.  */
-#include <sys/machine.h>
-#undef BIG_ENDIAN
-#include <sys/audio.h>
-
-/* Open the audio device for playback, and don't block if busy */
-/* #define OPEN_FLAGS   (O_WRONLY|O_NONBLOCK) */
-#define OPEN_FLAGS  O_WRONLY
-
-/* Get the name of the audio device we use for output */
-
-#ifndef _PATH_DEV_DSP
-#define _PATH_DEV_DSP   "/dev/%caud%c/%c"
-#endif
-
-static char devsettings[][3] = {
-    {'p', '0', '1'}, {'p', '0', '2'}, {'p', '0', '3'}, {'p', '0', '4'},
-    {'p', '1', '1'}, {'p', '1', '2'}, {'p', '1', '3'}, {'p', '1', '4'},
-    {'p', '2', '1'}, {'p', '2', '2'}, {'p', '2', '3'}, {'p', '2', '4'},
-    {'p', '3', '1'}, {'p', '3', '2'}, {'p', '3', '3'}, {'p', '3', '4'},
-    {'b', '0', '1'}, {'b', '0', '2'}, {'b', '0', '3'}, {'b', '0', '4'},
-    {'b', '1', '1'}, {'b', '1', '2'}, {'b', '1', '3'}, {'b', '1', '4'},
-    {'b', '2', '1'}, {'b', '2', '2'}, {'b', '2', '3'}, {'b', '2', '4'},
-    {'b', '3', '1'}, {'b', '3', '2'}, {'b', '3', '3'}, {'b', '3', '4'},
-    {'\0', '\0', '\0'}
-};
-
-static int
-OpenUserDefinedDevice(char *path, int maxlen, int flags)
-{
-    const char *audiodev;
-    int fd;
-
-    /* Figure out what our audio device is */
-    if ((audiodev = SDL_getenv("SDL_PATH_DSP")) == NULL) {
-        audiodev = SDL_getenv("AUDIODEV");
-    }
-    if (audiodev == NULL) {
-        return -1;
-    }
-    fd = open(audiodev, flags, 0);
-    if (path != NULL) {
-        SDL_strlcpy(path, audiodev, maxlen);
-        path[maxlen - 1] = '\0';
-    }
-    return fd;
-}
-
-static int
-OpenAudioPath(char *path, int maxlen, int flags, int classic)
-{
-    struct stat sb;
-    int cycle = 0;
-    int fd = OpenUserDefinedDevice(path, maxlen, flags);
-
-    if (fd != -1) {
-        return fd;
-    }
-
-    /* !!! FIXME: do we really need a table here? */
-    while (devsettings[cycle][0] != '\0') {
-        char audiopath[1024];
-        SDL_snprintf(audiopath, SDL_arraysize(audiopath),
-                     _PATH_DEV_DSP,
-                     devsettings[cycle][0],
-                     devsettings[cycle][1], devsettings[cycle][2]);
-
-        if (stat(audiopath, &sb) == 0) {
-            fd = open(audiopath, flags, 0);
-            if (fd > 0) {
-                if (path != NULL) {
-                    SDL_strlcpy(path, audiopath, maxlen);
-                }
-                return fd;
-            }
-        }
-    }
-    return -1;
-}
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-PAUDIO_WaitDevice(_THIS)
-{
-    fd_set fdset;
-
-    /* See if we need to use timed audio synchronization */
-    if (this->hidden->frame_ticks) {
-        /* Use timer for general audio synchronization */
-        Sint32 ticks;
-
-        ticks = ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS;
-        if (ticks > 0) {
-            SDL_Delay(ticks);
-        }
-    } else {
-        audio_buffer paud_bufinfo;
-
-        /* Use select() for audio synchronization */
-        struct timeval timeout;
-        FD_ZERO(&fdset);
-        FD_SET(this->hidden->audio_fd, &fdset);
-
-        if (ioctl(this->hidden->audio_fd, AUDIO_BUFFER, &paud_bufinfo) < 0) {
-#ifdef DEBUG_AUDIO
-            fprintf(stderr, "Couldn't get audio buffer information\n");
-#endif
-            timeout.tv_sec = 10;
-            timeout.tv_usec = 0;
-        } else {
-            long ms_in_buf = paud_bufinfo.write_buf_time;
-            timeout.tv_sec = ms_in_buf / 1000;
-            ms_in_buf = ms_in_buf - timeout.tv_sec * 1000;
-            timeout.tv_usec = ms_in_buf * 1000;
-#ifdef DEBUG_AUDIO
-            fprintf(stderr,
-                    "Waiting for write_buf_time=%ld,%ld\n",
-                    timeout.tv_sec, timeout.tv_usec);
-#endif
-        }
-
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Waiting for audio to get ready\n");
-#endif
-        if (select(this->hidden->audio_fd + 1, NULL, &fdset, NULL, &timeout)
-            <= 0) {
-            const char *message =
-                "Audio timeout - buggy audio driver? (disabled)";
-            /*
-             * In general we should never print to the screen,
-             * but in this case we have no other way of letting
-             * the user know what happened.
-             */
-            fprintf(stderr, "SDL: %s - %s\n", strerror(errno), message);
-            this->enabled = 0;
-            /* Don't try to close - may hang */
-            this->hidden->audio_fd = -1;
-#ifdef DEBUG_AUDIO
-            fprintf(stderr, "Done disabling audio\n");
-#endif
-        }
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Ready!\n");
-#endif
-    }
-}
-
-static void
-PAUDIO_PlayDevice(_THIS)
-{
-    int written = 0;
-    const Uint8 *mixbuf = this->hidden->mixbuf;
-    const size_t mixlen = this->hidden->mixlen;
-
-    /* Write the audio data, checking for EAGAIN on broken audio drivers */
-    do {
-        written = write(this->hidden->audio_fd, mixbuf, mixlen);
-        if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) {
-            SDL_Delay(1);       /* Let a little CPU time go by */
-        }
-    } while ((written < 0) &&
-             ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));
-
-    /* If timer synchronization is enabled, set the next write frame */
-    if (this->hidden->frame_ticks) {
-        this->hidden->next_frame += this->hidden->frame_ticks;
-    }
-
-    /* If we couldn't write, assume fatal error for now */
-    if (written < 0) {
-        this->enabled = 0;
-    }
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static Uint8 *
-PAUDIO_GetDeviceBuf(_THIS)
-{
-    return this->hidden->mixbuf;
-}
-
-static void
-PAUDIO_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->audio_fd >= 0) {
-            close(this->hidden->audio_fd);
-            this->hidden->audio_fd = -1;
-        }
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static int
-PAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    const char *workaround = SDL_getenv("SDL_DSP_NOSELECT");
-    char audiodev[1024];
-    const char *err = NULL;
-    int format;
-    int bytes_per_sample;
-    SDL_AudioFormat test_format;
-    audio_init paud_init;
-    audio_buffer paud_bufinfo;
-    audio_status paud_status;
-    audio_control paud_control;
-    audio_change paud_change;
-    int fd = -1;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Open the audio device */
-    fd = OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
-    this->hidden->audio_fd = fd;
-    if (fd < 0) {
-        PAUDIO_CloseDevice(this);
-        return SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
-    }
-
-    /*
-     * We can't set the buffer size - just ask the device for the maximum
-     * that we can have.
-     */
-    if (ioctl(fd, AUDIO_BUFFER, &paud_bufinfo) < 0) {
-        PAUDIO_CloseDevice(this);
-        return SDL_SetError("Couldn't get audio buffer information");
-    }
-
-    if (this->spec.channels > 1)
-        this->spec.channels = 2;
-    else
-        this->spec.channels = 1;
-
-    /*
-     * Fields in the audio_init structure:
-     *
-     * Ignored by us:
-     *
-     * paud.loadpath[LOAD_PATH]; * DSP code to load, MWave chip only?
-     * paud.slot_number;         * slot number of the adapter
-     * paud.device_id;           * adapter identification number
-     *
-     * Input:
-     *
-     * paud.srate;           * the sampling rate in Hz
-     * paud.bits_per_sample; * 8, 16, 32, ...
-     * paud.bsize;           * block size for this rate
-     * paud.mode;            * ADPCM, PCM, MU_LAW, A_LAW, SOURCE_MIX
-     * paud.channels;        * 1=mono, 2=stereo
-     * paud.flags;           * FIXED - fixed length data
-     *                       * LEFT_ALIGNED, RIGHT_ALIGNED (var len only)
-     *                       * TWOS_COMPLEMENT - 2's complement data
-     *                       * SIGNED - signed? comment seems wrong in sys/audio.h
-     *                       * BIG_ENDIAN
-     * paud.operation;       * PLAY, RECORD
-     *
-     * Output:
-     *
-     * paud.flags;           * PITCH            - pitch is supported
-     *                       * INPUT            - input is supported
-     *                       * OUTPUT           - output is supported
-     *                       * MONITOR          - monitor is supported
-     *                       * VOLUME           - volume is supported
-     *                       * VOLUME_DELAY     - volume delay is supported
-     *                       * BALANCE          - balance is supported
-     *                       * BALANCE_DELAY    - balance delay is supported
-     *                       * TREBLE           - treble control is supported
-     *                       * BASS             - bass control is supported
-     *                       * BESTFIT_PROVIDED - best fit returned
-     *                       * LOAD_CODE        - DSP load needed
-     * paud.rc;              * NO_PLAY         - DSP code can't do play requests
-     *                       * NO_RECORD       - DSP code can't do record requests
-     *                       * INVALID_REQUEST - request was invalid
-     *                       * CONFLICT        - conflict with open's flags
-     *                       * OVERLOADED      - out of DSP MIPS or memory
-     * paud.position_resolution; * smallest increment for position
-     */
-
-    paud_init.srate = this->spec.freq;
-    paud_init.mode = PCM;
-    paud_init.operation = PLAY;
-    paud_init.channels = this->spec.channels;
-
-    /* Try for a closest match on audio format */
-    format = 0;
-    for (test_format = SDL_FirstAudioFormat(this->spec.format);
-         !format && test_format;) {
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
-        switch (test_format) {
-        case AUDIO_U8:
-            bytes_per_sample = 1;
-            paud_init.bits_per_sample = 8;
-            paud_init.flags = TWOS_COMPLEMENT | FIXED;
-            format = 1;
-            break;
-        case AUDIO_S8:
-            bytes_per_sample = 1;
-            paud_init.bits_per_sample = 8;
-            paud_init.flags = SIGNED | TWOS_COMPLEMENT | FIXED;
-            format = 1;
-            break;
-        case AUDIO_S16LSB:
-            bytes_per_sample = 2;
-            paud_init.bits_per_sample = 16;
-            paud_init.flags = SIGNED | TWOS_COMPLEMENT | FIXED;
-            format = 1;
-            break;
-        case AUDIO_S16MSB:
-            bytes_per_sample = 2;
-            paud_init.bits_per_sample = 16;
-            paud_init.flags = BIG_ENDIAN | SIGNED | TWOS_COMPLEMENT | FIXED;
-            format = 1;
-            break;
-        case AUDIO_U16LSB:
-            bytes_per_sample = 2;
-            paud_init.bits_per_sample = 16;
-            paud_init.flags = TWOS_COMPLEMENT | FIXED;
-            format = 1;
-            break;
-        case AUDIO_U16MSB:
-            bytes_per_sample = 2;
-            paud_init.bits_per_sample = 16;
-            paud_init.flags = BIG_ENDIAN | TWOS_COMPLEMENT | FIXED;
-            format = 1;
-            break;
-        default:
-            break;
-        }
-        if (!format) {
-            test_format = SDL_NextAudioFormat();
-        }
-    }
-    if (format == 0) {
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Couldn't find any hardware audio formats\n");
-#endif
-        PAUDIO_CloseDevice(this);
-        return SDL_SetError("Couldn't find any hardware audio formats");
-    }
-    this->spec.format = test_format;
-
-    /*
-     * We know the buffer size and the max number of subsequent writes
-     *  that can be pending. If more than one can pend, allow the application
-     *  to do something like double buffering between our write buffer and
-     *  the device's own buffer that we are filling with write() anyway.
-     *
-     * We calculate this->spec.samples like this because
-     *  SDL_CalculateAudioSpec() will give put paud_bufinfo.write_buf_cap
-     *  (or paud_bufinfo.write_buf_cap/2) into this->spec.size in return.
-     */
-    if (paud_bufinfo.request_buf_cap == 1) {
-        this->spec.samples = paud_bufinfo.write_buf_cap
-            / bytes_per_sample / this->spec.channels;
-    } else {
-        this->spec.samples = paud_bufinfo.write_buf_cap
-            / bytes_per_sample / this->spec.channels / 2;
-    }
-    paud_init.bsize = bytes_per_sample * this->spec.channels;
-
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /*
-     * The AIX paud device init can't modify the values of the audio_init
-     * structure that we pass to it. So we don't need any recalculation
-     * of this stuff and no reinit call as in linux dsp code.
-     *
-     * /dev/paud supports all of the encoding formats, so we don't need
-     * to do anything like reopening the device, either.
-     */
-    if (ioctl(fd, AUDIO_INIT, &paud_init) < 0) {
-        switch (paud_init.rc) {
-        case 1:
-            err = "Couldn't set audio format: DSP can't do play requests";
-            break;
-        case 2:
-            err = "Couldn't set audio format: DSP can't do record requests";
-            break;
-        case 4:
-            err = "Couldn't set audio format: request was invalid";
-            break;
-        case 5:
-            err = "Couldn't set audio format: conflict with open's flags";
-            break;
-        case 6:
-            err = "Couldn't set audio format: out of DSP MIPS or memory";
-            break;
-        default:
-            err = "Couldn't set audio format: not documented in sys/audio.h";
-            break;
-        }
-    }
-
-    if (err != NULL) {
-        PAUDIO_CloseDevice(this);
-        return SDL_SetError("Paudio: %s", err);
-    }
-
-    /* Allocate mixing buffer */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        PAUDIO_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-    /*
-     * Set some paramters: full volume, first speaker that we can find.
-     * Ignore the other settings for now.
-     */
-    paud_change.input = AUDIO_IGNORE;   /* the new input source */
-    paud_change.output = OUTPUT_1;      /* EXTERNAL_SPEAKER,INTERNAL_SPEAKER,OUTPUT_1 */
-    paud_change.monitor = AUDIO_IGNORE; /* the new monitor state */
-    paud_change.volume = 0x7fffffff;    /* volume level [0-0x7fffffff] */
-    paud_change.volume_delay = AUDIO_IGNORE;    /* the new volume delay */
-    paud_change.balance = 0x3fffffff;   /* the new balance */
-    paud_change.balance_delay = AUDIO_IGNORE;   /* the new balance delay */
-    paud_change.treble = AUDIO_IGNORE;  /* the new treble state */
-    paud_change.bass = AUDIO_IGNORE;    /* the new bass state */
-    paud_change.pitch = AUDIO_IGNORE;   /* the new pitch state */
-
-    paud_control.ioctl_request = AUDIO_CHANGE;
-    paud_control.request_info = (char *) &paud_change;
-    if (ioctl(fd, AUDIO_CONTROL, &paud_control) < 0) {
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Can't change audio display settings\n");
-#endif
-    }
-
-    /*
-     * Tell the device to expect data. Actual start will wait for
-     * the first write() call.
-     */
-    paud_control.ioctl_request = AUDIO_START;
-    paud_control.position = 0;
-    if (ioctl(fd, AUDIO_CONTROL, &paud_control) < 0) {
-        PAUDIO_CloseDevice(this);
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Can't start audio play\n");
-#endif
-        return SDL_SetError("Can't start audio play");
-    }
-
-    /* Check to see if we need to use select() workaround */
-    if (workaround != NULL) {
-        this->hidden->frame_ticks = (float) (this->spec.samples * 1000) /
-            this->spec.freq;
-        this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks;
-    }
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-static int
-PAUDIO_Init(SDL_AudioDriverImpl * impl)
-{
-    /* !!! FIXME: not right for device enum? */
-    int fd = OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
-    if (fd < 0) {
-        SDL_SetError("PAUDIO: Couldn't open audio device");
-        return 0;
-    }
-    close(fd);
-
-    /* Set the function pointers */
-    impl->OpenDevice = DSP_OpenDevice;
-    impl->PlayDevice = DSP_PlayDevice;
-    impl->PlayDevice = DSP_WaitDevice;
-    impl->GetDeviceBuf = DSP_GetDeviceBuf;
-    impl->CloseDevice = DSP_CloseDevice;
-    impl->OnlyHasDefaultOutputDevice = 1;       /* !!! FIXME: add device enum! */
-
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap PAUDIO_bootstrap = {
-    "paud", "AIX Paudio", PAUDIO_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_PAUDIO */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/paudio/SDL_paudio.h b/deps/SDL2/src/audio/paudio/SDL_paudio.h
deleted file mode 100644
index 7be1ed6..0000000
--- a/deps/SDL2/src/audio/paudio/SDL_paudio.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_paudaudio_h
-#define _SDL_paudaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The file descriptor for the audio device */
-    int audio_fd;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-
-    /* Support for audio timing using a timer, in addition to select() */
-    float frame_ticks;
-    float next_frame;
-};
-#define FUDGE_TICKS 10      /* The scheduler overhead ticks per frame */
-
-#endif /* _SDL_paudaudio_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/psp/SDL_pspaudio.c b/deps/SDL2/src/audio/psp/SDL_pspaudio.c
deleted file mode 100644
index 8576d95..0000000
--- a/deps/SDL2/src/audio/psp/SDL_pspaudio.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <malloc.h>
-
-#include "SDL_audio.h"
-#include "SDL_error.h"
-#include "SDL_timer.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "../SDL_sysaudio.h"
-#include "SDL_pspaudio.h"
-
-#include <pspaudio.h>
-#include <pspthreadman.h>
-
-/* The tag name used by PSP audio */
-#define PSPAUD_DRIVER_NAME         "psp"
-
-static int
-PSPAUD_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    int format, mixlen, i;
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc(sizeof(*this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, sizeof(*this->hidden));
-    switch (this->spec.format & 0xff) {
-        case 8:
-        case 16:
-            this->spec.format = AUDIO_S16LSB;
-            break;
-        default:
-            return SDL_SetError("Unsupported audio format");
-    }
-
-    /* The sample count must be a multiple of 64. */
-    this->spec.samples = PSP_AUDIO_SAMPLE_ALIGN(this->spec.samples);
-    this->spec.freq = 44100;
-
-    /* Update the fragment size as size in bytes. */
-/*  SDL_CalculateAudioSpec(this->spec); MOD */
-    switch (this->spec.format) {
-    case AUDIO_U8:
-        this->spec.silence = 0x80;
-        break;
-    default:
-        this->spec.silence = 0x00;
-        break;
-    }
-    this->spec.size = SDL_AUDIO_BITSIZE(this->spec.format) / 8;
-    this->spec.size *= this->spec.channels;
-    this->spec.size *= this->spec.samples;
-
-/* ========================================== */
-
-    /* Allocate the mixing buffer.  Its size and starting address must
-       be a multiple of 64 bytes.  Our sample count is already a multiple of
-       64, so spec->size should be a multiple of 64 as well. */
-    mixlen = this->spec.size * NUM_BUFFERS;
-    this->hidden->rawbuf = (Uint8 *) memalign(64, mixlen);
-    if (this->hidden->rawbuf == NULL) {
-        return SDL_SetError("Couldn't allocate mixing buffer");
-    }
-
-    /* Setup the hardware channel. */
-    if (this->spec.channels == 1) {
-        format = PSP_AUDIO_FORMAT_MONO;
-    } else {
-        format = PSP_AUDIO_FORMAT_STEREO;
-    }
-    this->hidden->channel = sceAudioChReserve(PSP_AUDIO_NEXT_CHANNEL, this->spec.samples, format);
-    if (this->hidden->channel < 0) {
-        free(this->hidden->rawbuf);
-        this->hidden->rawbuf = NULL;
-        return SDL_SetError("Couldn't reserve hardware channel");
-    }
-
-    memset(this->hidden->rawbuf, 0, mixlen);
-    for (i = 0; i < NUM_BUFFERS; i++) {
-        this->hidden->mixbufs[i] = &this->hidden->rawbuf[i * this->spec.size];
-    }
-
-    this->hidden->next_buffer = 0;
-    return 0;
-}
-
-static void PSPAUD_PlayDevice(_THIS)
-{
-    Uint8 *mixbuf = this->hidden->mixbufs[this->hidden->next_buffer];
-
-    if (this->spec.channels == 1) {
-        sceAudioOutputBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, mixbuf);
-    } else {
-        sceAudioOutputPannedBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, mixbuf);
-    }
-
-    this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS;
-}
-
-/* This function waits until it is possible to write a full sound buffer */
-static void PSPAUD_WaitDevice(_THIS)
-{
-    /* Because we block when sending audio, there's no need for this function to do anything. */
-}
-static Uint8 *PSPAUD_GetDeviceBuf(_THIS)
-{
-    return this->hidden->mixbufs[this->hidden->next_buffer];
-}
-
-static void PSPAUD_CloseDevice(_THIS)
-{
-    if (this->hidden->channel >= 0) {
-        sceAudioChRelease(this->hidden->channel);
-        this->hidden->channel = -1;
-    }
-
-    if (this->hidden->rawbuf != NULL) {
-        free(this->hidden->rawbuf);
-        this->hidden->rawbuf = NULL;
-    }
-}
-static void PSPAUD_ThreadInit(_THIS)
-{
-    /* Increase the priority of this audio thread by 1 to put it
-       ahead of other SDL threads. */
-    SceUID thid;
-    SceKernelThreadInfo status;
-    thid = sceKernelGetThreadId();
-    status.size = sizeof(SceKernelThreadInfo);
-    if (sceKernelReferThreadStatus(thid, &status) == 0) {
-        sceKernelChangeThreadPriority(thid, status.currentPriority - 1);
-    }
-}
-
-
-static int
-PSPAUD_Init(SDL_AudioDriverImpl * impl)
-{
-
-    /* Set the function pointers */
-    impl->OpenDevice = PSPAUD_OpenDevice;
-    impl->PlayDevice = PSPAUD_PlayDevice;
-    impl->WaitDevice = PSPAUD_WaitDevice;
-    impl->GetDeviceBuf = PSPAUD_GetDeviceBuf;
-    impl->WaitDone = PSPAUD_WaitDevice;
-    impl->CloseDevice = PSPAUD_CloseDevice;
-    impl->ThreadInit = PSPAUD_ThreadInit;
-
-    /* PSP audio device */
-    impl->OnlyHasDefaultOutputDevice = 1;
-/*
-    impl->HasCaptureSupport = 1;
-
-    impl->OnlyHasDefaultInputDevice = 1;
-*/
-    /*
-    impl->DetectDevices = DSOUND_DetectDevices;
-    impl->Deinitialize = DSOUND_Deinitialize;
-    */
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap PSPAUD_bootstrap = {
-    "psp", "PSP audio driver", PSPAUD_Init, 0
-};
-
- /* SDL_AUDI */
-
-
-
diff --git a/deps/SDL2/src/audio/psp/SDL_pspaudio.h b/deps/SDL2/src/audio/psp/SDL_pspaudio.h
deleted file mode 100644
index 139476c..0000000
--- a/deps/SDL2/src/audio/psp/SDL_pspaudio.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_pspaudio_h
-#define _SDL_pspaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS   SDL_AudioDevice *this
-
-#define NUM_BUFFERS 2
-
-struct SDL_PrivateAudioData {
-    /* The hardware output channel. */
-    int     channel;
-    /* The raw allocated mixing buffer. */
-    Uint8   *rawbuf;
-    /* Individual mixing buffers. */
-    Uint8   *mixbufs[NUM_BUFFERS];
-    /* Index of the next available mixing buffer. */
-    int     next_buffer;
-};
-
-#endif /* _SDL_pspaudio_h */
-/* vim: ts=4 sw=4
- */
diff --git a/deps/SDL2/src/audio/pulseaudio/SDL_pulseaudio.c b/deps/SDL2/src/audio/pulseaudio/SDL_pulseaudio.c
deleted file mode 100644
index 5923eae..0000000
--- a/deps/SDL2/src/audio/pulseaudio/SDL_pulseaudio.c
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-  The PulseAudio target for SDL 1.3 is based on the 1.3 arts target, with
-   the appropriate parts replaced with the 1.2 PulseAudio target code. This
-   was the cleanest way to move it to 1.3. The 1.2 target was written by
-   Stéphan Kochen: stephan .a.t. kochen.nl
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_PULSEAUDIO
-
-/* Allow access to a raw mixing buffer */
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#include <unistd.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <pulse/pulseaudio.h>
-#include <pulse/simple.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_pulseaudio.h"
-#include "SDL_loadso.h"
-
-#if (PA_API_VERSION < 12)
-/** Return non-zero if the passed state is one of the connected states */
-static SDL_INLINE int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
-    return
-        x == PA_CONTEXT_CONNECTING ||
-        x == PA_CONTEXT_AUTHORIZING ||
-        x == PA_CONTEXT_SETTING_NAME ||
-        x == PA_CONTEXT_READY;
-}
-/** Return non-zero if the passed state is one of the connected states */
-static SDL_INLINE int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
-    return
-        x == PA_STREAM_CREATING ||
-        x == PA_STREAM_READY;
-}
-#endif /* pulseaudio <= 0.9.10 */
-
-
-static const char *(*PULSEAUDIO_pa_get_library_version) (void);
-static pa_simple *(*PULSEAUDIO_pa_simple_new) (const char *, const char *,
-    pa_stream_direction_t, const char *, const char *, const pa_sample_spec *,
-    const pa_channel_map *, const pa_buffer_attr *, int *);
-static void (*PULSEAUDIO_pa_simple_free) (pa_simple *);
-static pa_channel_map *(*PULSEAUDIO_pa_channel_map_init_auto) (
-    pa_channel_map *, unsigned, pa_channel_map_def_t);
-static const char * (*PULSEAUDIO_pa_strerror) (int);
-static pa_mainloop * (*PULSEAUDIO_pa_mainloop_new) (void);
-static pa_mainloop_api * (*PULSEAUDIO_pa_mainloop_get_api) (pa_mainloop *);
-static int (*PULSEAUDIO_pa_mainloop_iterate) (pa_mainloop *, int, int *);
-static void (*PULSEAUDIO_pa_mainloop_free) (pa_mainloop *);
-
-static pa_operation_state_t (*PULSEAUDIO_pa_operation_get_state) (
-    pa_operation *);
-static void (*PULSEAUDIO_pa_operation_cancel) (pa_operation *);
-static void (*PULSEAUDIO_pa_operation_unref) (pa_operation *);
-
-static pa_context * (*PULSEAUDIO_pa_context_new) (pa_mainloop_api *,
-    const char *);
-static int (*PULSEAUDIO_pa_context_connect) (pa_context *, const char *,
-    pa_context_flags_t, const pa_spawn_api *);
-static pa_context_state_t (*PULSEAUDIO_pa_context_get_state) (pa_context *);
-static void (*PULSEAUDIO_pa_context_disconnect) (pa_context *);
-static void (*PULSEAUDIO_pa_context_unref) (pa_context *);
-
-static pa_stream * (*PULSEAUDIO_pa_stream_new) (pa_context *, const char *,
-    const pa_sample_spec *, const pa_channel_map *);
-static int (*PULSEAUDIO_pa_stream_connect_playback) (pa_stream *, const char *,
-    const pa_buffer_attr *, pa_stream_flags_t, pa_cvolume *, pa_stream *);
-static pa_stream_state_t (*PULSEAUDIO_pa_stream_get_state) (pa_stream *);
-static size_t (*PULSEAUDIO_pa_stream_writable_size) (pa_stream *);
-static int (*PULSEAUDIO_pa_stream_write) (pa_stream *, const void *, size_t,
-    pa_free_cb_t, int64_t, pa_seek_mode_t);
-static pa_operation * (*PULSEAUDIO_pa_stream_drain) (pa_stream *,
-    pa_stream_success_cb_t, void *);
-static int (*PULSEAUDIO_pa_stream_disconnect) (pa_stream *);
-static void (*PULSEAUDIO_pa_stream_unref) (pa_stream *);
-
-static int load_pulseaudio_syms(void);
-
-
-#ifdef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
-
-static const char *pulseaudio_library = SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC;
-static void *pulseaudio_handle = NULL;
-
-static int
-load_pulseaudio_sym(const char *fn, void **addr)
-{
-    *addr = SDL_LoadFunction(pulseaudio_handle, fn);
-    if (*addr == NULL) {
-        /* Don't call SDL_SetError(): SDL_LoadFunction already did. */
-        return 0;
-    }
-
-    return 1;
-}
-
-/* cast funcs to char* first, to please GCC's strict aliasing rules. */
-#define SDL_PULSEAUDIO_SYM(x) \
-    if (!load_pulseaudio_sym(#x, (void **) (char *) &PULSEAUDIO_##x)) return -1
-
-static void
-UnloadPulseAudioLibrary(void)
-{
-    if (pulseaudio_handle != NULL) {
-        SDL_UnloadObject(pulseaudio_handle);
-        pulseaudio_handle = NULL;
-    }
-}
-
-static int
-LoadPulseAudioLibrary(void)
-{
-    int retval = 0;
-    if (pulseaudio_handle == NULL) {
-        pulseaudio_handle = SDL_LoadObject(pulseaudio_library);
-        if (pulseaudio_handle == NULL) {
-            retval = -1;
-            /* Don't call SDL_SetError(): SDL_LoadObject already did. */
-        } else {
-            retval = load_pulseaudio_syms();
-            if (retval < 0) {
-                UnloadPulseAudioLibrary();
-            }
-        }
-    }
-    return retval;
-}
-
-#else
-
-#define SDL_PULSEAUDIO_SYM(x) PULSEAUDIO_##x = x
-
-static void
-UnloadPulseAudioLibrary(void)
-{
-}
-
-static int
-LoadPulseAudioLibrary(void)
-{
-    load_pulseaudio_syms();
-    return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC */
-
-
-static int
-load_pulseaudio_syms(void)
-{
-    SDL_PULSEAUDIO_SYM(pa_get_library_version);
-    SDL_PULSEAUDIO_SYM(pa_simple_new);
-    SDL_PULSEAUDIO_SYM(pa_simple_free);
-    SDL_PULSEAUDIO_SYM(pa_mainloop_new);
-    SDL_PULSEAUDIO_SYM(pa_mainloop_get_api);
-    SDL_PULSEAUDIO_SYM(pa_mainloop_iterate);
-    SDL_PULSEAUDIO_SYM(pa_mainloop_free);
-    SDL_PULSEAUDIO_SYM(pa_operation_get_state);
-    SDL_PULSEAUDIO_SYM(pa_operation_cancel);
-    SDL_PULSEAUDIO_SYM(pa_operation_unref);
-    SDL_PULSEAUDIO_SYM(pa_context_new);
-    SDL_PULSEAUDIO_SYM(pa_context_connect);
-    SDL_PULSEAUDIO_SYM(pa_context_get_state);
-    SDL_PULSEAUDIO_SYM(pa_context_disconnect);
-    SDL_PULSEAUDIO_SYM(pa_context_unref);
-    SDL_PULSEAUDIO_SYM(pa_stream_new);
-    SDL_PULSEAUDIO_SYM(pa_stream_connect_playback);
-    SDL_PULSEAUDIO_SYM(pa_stream_get_state);
-    SDL_PULSEAUDIO_SYM(pa_stream_writable_size);
-    SDL_PULSEAUDIO_SYM(pa_stream_write);
-    SDL_PULSEAUDIO_SYM(pa_stream_drain);
-    SDL_PULSEAUDIO_SYM(pa_stream_disconnect);
-    SDL_PULSEAUDIO_SYM(pa_stream_unref);
-    SDL_PULSEAUDIO_SYM(pa_channel_map_init_auto);
-    SDL_PULSEAUDIO_SYM(pa_strerror);
-    return 0;
-}
-
-
-/* Check to see if we can connect to PulseAudio */
-static SDL_bool
-CheckPulseAudioAvailable()
-{
-    pa_simple *s;
-    pa_sample_spec ss;
-
-    ss.format = PA_SAMPLE_S16NE;
-    ss.channels = 1;
-    ss.rate = 22050;
-
-    s = PULSEAUDIO_pa_simple_new(NULL, "SDL", PA_STREAM_PLAYBACK, NULL,
-                                 "Test", &ss, NULL, NULL, NULL);
-    if (s) {
-        PULSEAUDIO_pa_simple_free(s);
-        return SDL_TRUE;
-    } else {
-        return SDL_FALSE;
-    }
-}
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-PULSEAUDIO_WaitDevice(_THIS)
-{
-    struct SDL_PrivateAudioData *h = this->hidden;
-
-    while(1) {
-        if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY ||
-            PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY ||
-            PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) {
-            this->enabled = 0;
-            return;
-        }
-        if (PULSEAUDIO_pa_stream_writable_size(h->stream) >= h->mixlen) {
-            return;
-        }
-    }
-}
-
-static void
-PULSEAUDIO_PlayDevice(_THIS)
-{
-    /* Write the audio data */
-    struct SDL_PrivateAudioData *h = this->hidden;
-    if (PULSEAUDIO_pa_stream_write(h->stream, h->mixbuf, h->mixlen, NULL, 0LL,
-                                   PA_SEEK_RELATIVE) < 0) {
-        this->enabled = 0;
-    }
-}
-
-static void
-stream_drain_complete(pa_stream *s, int success, void *userdata)
-{
-    /* no-op for pa_stream_drain() to use for callback. */
-}
-
-static void
-PULSEAUDIO_WaitDone(_THIS)
-{
-    struct SDL_PrivateAudioData *h = this->hidden;
-    pa_operation *o;
-
-    o = PULSEAUDIO_pa_stream_drain(h->stream, stream_drain_complete, NULL);
-    if (!o) {
-        return;
-    }
-
-    while (PULSEAUDIO_pa_operation_get_state(o) != PA_OPERATION_DONE) {
-        if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY ||
-            PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY ||
-            PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) {
-            PULSEAUDIO_pa_operation_cancel(o);
-            break;
-        }
-    }
-
-    PULSEAUDIO_pa_operation_unref(o);
-}
-
-
-
-static Uint8 *
-PULSEAUDIO_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-
-static void
-PULSEAUDIO_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if (this->hidden->stream) {
-            PULSEAUDIO_pa_stream_disconnect(this->hidden->stream);
-            PULSEAUDIO_pa_stream_unref(this->hidden->stream);
-            this->hidden->stream = NULL;
-        }
-        if (this->hidden->context != NULL) {
-            PULSEAUDIO_pa_context_disconnect(this->hidden->context);
-            PULSEAUDIO_pa_context_unref(this->hidden->context);
-            this->hidden->context = NULL;
-        }
-        if (this->hidden->mainloop != NULL) {
-            PULSEAUDIO_pa_mainloop_free(this->hidden->mainloop);
-            this->hidden->mainloop = NULL;
-        }
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-
-static SDL_INLINE int
-squashVersion(const int major, const int minor, const int patch)
-{
-    return ((major & 0xFF) << 16) | ((minor & 0xFF) << 8) | (patch & 0xFF);
-}
-
-/* Workaround for older pulse: pa_context_new() must have non-NULL appname */
-static const char *
-getAppName(void)
-{
-    const char *verstr = PULSEAUDIO_pa_get_library_version();
-    if (verstr != NULL) {
-        int maj, min, patch;
-        if (SDL_sscanf(verstr, "%d.%d.%d", &maj, &min, &patch) == 3) {
-            if (squashVersion(maj, min, patch) >= squashVersion(0, 9, 15)) {
-                return NULL;  /* 0.9.15+ handles NULL correctly. */
-            }
-        }
-    }
-    return "SDL Application";  /* oh well. */
-}
-
-static int
-PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    struct SDL_PrivateAudioData *h = NULL;
-    Uint16 test_format = 0;
-    pa_sample_spec paspec;
-    pa_buffer_attr paattr;
-    pa_channel_map pacmap;
-    pa_stream_flags_t flags = 0;
-    int state = 0;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-    h = this->hidden;
-
-    paspec.format = PA_SAMPLE_INVALID;
-
-    /* Try for a closest match on audio format */
-    for (test_format = SDL_FirstAudioFormat(this->spec.format);
-         (paspec.format == PA_SAMPLE_INVALID) && test_format;) {
-#ifdef DEBUG_AUDIO
-        fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
-        switch (test_format) {
-        case AUDIO_U8:
-            paspec.format = PA_SAMPLE_U8;
-            break;
-        case AUDIO_S16LSB:
-            paspec.format = PA_SAMPLE_S16LE;
-            break;
-        case AUDIO_S16MSB:
-            paspec.format = PA_SAMPLE_S16BE;
-            break;
-        case AUDIO_S32LSB:
-            paspec.format = PA_SAMPLE_S32LE;
-            break;
-        case AUDIO_S32MSB:
-            paspec.format = PA_SAMPLE_S32BE;
-            break;
-        case AUDIO_F32LSB:
-            paspec.format = PA_SAMPLE_FLOAT32LE;
-            break;
-        case AUDIO_F32MSB:
-            paspec.format = PA_SAMPLE_FLOAT32BE;
-            break;
-        default:
-            paspec.format = PA_SAMPLE_INVALID;
-            break;
-        }
-        if (paspec.format == PA_SAMPLE_INVALID) {
-            test_format = SDL_NextAudioFormat();
-        }
-    }
-    if (paspec.format == PA_SAMPLE_INVALID) {
-        PULSEAUDIO_CloseDevice(this);
-        return SDL_SetError("Couldn't find any hardware audio formats");
-    }
-    this->spec.format = test_format;
-
-    /* Calculate the final parameters for this audio specification */
-#ifdef PA_STREAM_ADJUST_LATENCY
-    this->spec.samples /= 2; /* Mix in smaller chunck to avoid underruns */
-#endif
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Allocate mixing buffer */
-    h->mixlen = this->spec.size;
-    h->mixbuf = (Uint8 *) SDL_AllocAudioMem(h->mixlen);
-    if (h->mixbuf == NULL) {
-        PULSEAUDIO_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(h->mixbuf, this->spec.silence, this->spec.size);
-
-    paspec.channels = this->spec.channels;
-    paspec.rate = this->spec.freq;
-
-    /* Reduced prebuffering compared to the defaults. */
-#ifdef PA_STREAM_ADJUST_LATENCY
-    /* 2x original requested bufsize */
-    paattr.tlength = h->mixlen * 4;
-    paattr.prebuf = -1;
-    paattr.maxlength = -1;
-    /* -1 can lead to pa_stream_writable_size() >= mixlen never being true */
-    paattr.minreq = h->mixlen;
-    flags = PA_STREAM_ADJUST_LATENCY;
-#else
-    paattr.tlength = h->mixlen*2;
-    paattr.prebuf = h->mixlen*2;
-    paattr.maxlength = h->mixlen*2;
-    paattr.minreq = h->mixlen;
-#endif
-
-    /* The SDL ALSA output hints us that we use Windows' channel mapping */
-    /* http://bugzilla.libsdl.org/show_bug.cgi?id=110 */
-    PULSEAUDIO_pa_channel_map_init_auto(&pacmap, this->spec.channels,
-                                        PA_CHANNEL_MAP_WAVEEX);
-
-    /* Set up a new main loop */
-    if (!(h->mainloop = PULSEAUDIO_pa_mainloop_new())) {
-        PULSEAUDIO_CloseDevice(this);
-        return SDL_SetError("pa_mainloop_new() failed");
-    }
-
-    h->mainloop_api = PULSEAUDIO_pa_mainloop_get_api(h->mainloop);
-    h->context = PULSEAUDIO_pa_context_new(h->mainloop_api, getAppName());
-    if (!h->context) {
-        PULSEAUDIO_CloseDevice(this);
-        return SDL_SetError("pa_context_new() failed");
-    }
-
-    /* Connect to the PulseAudio server */
-    if (PULSEAUDIO_pa_context_connect(h->context, NULL, 0, NULL) < 0) {
-        PULSEAUDIO_CloseDevice(this);
-        return SDL_SetError("Could not setup connection to PulseAudio");
-    }
-
-    do {
-        if (PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) {
-            PULSEAUDIO_CloseDevice(this);
-            return SDL_SetError("pa_mainloop_iterate() failed");
-        }
-        state = PULSEAUDIO_pa_context_get_state(h->context);
-        if (!PA_CONTEXT_IS_GOOD(state)) {
-            PULSEAUDIO_CloseDevice(this);
-            return SDL_SetError("Could not connect to PulseAudio");
-        }
-    } while (state != PA_CONTEXT_READY);
-
-    h->stream = PULSEAUDIO_pa_stream_new(
-        h->context,
-        "Simple DirectMedia Layer", /* stream description */
-        &paspec,    /* sample format spec */
-        &pacmap     /* channel map */
-        );
-
-    if (h->stream == NULL) {
-        PULSEAUDIO_CloseDevice(this);
-        return SDL_SetError("Could not set up PulseAudio stream");
-    }
-
-    if (PULSEAUDIO_pa_stream_connect_playback(h->stream, NULL, &paattr, flags,
-            NULL, NULL) < 0) {
-        PULSEAUDIO_CloseDevice(this);
-        return SDL_SetError("Could not connect PulseAudio stream");
-    }
-
-    do {
-        if (PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) {
-            PULSEAUDIO_CloseDevice(this);
-            return SDL_SetError("pa_mainloop_iterate() failed");
-        }
-        state = PULSEAUDIO_pa_stream_get_state(h->stream);
-        if (!PA_STREAM_IS_GOOD(state)) {
-            PULSEAUDIO_CloseDevice(this);
-            return SDL_SetError("Could not create to PulseAudio stream");
-        }
-    } while (state != PA_STREAM_READY);
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-
-static void
-PULSEAUDIO_Deinitialize(void)
-{
-    UnloadPulseAudioLibrary();
-}
-
-static int
-PULSEAUDIO_Init(SDL_AudioDriverImpl * impl)
-{
-    if (LoadPulseAudioLibrary() < 0) {
-        return 0;
-    }
-
-    if (!CheckPulseAudioAvailable()) {
-        UnloadPulseAudioLibrary();
-        return 0;
-    }
-
-    /* Set the function pointers */
-    impl->OpenDevice = PULSEAUDIO_OpenDevice;
-    impl->PlayDevice = PULSEAUDIO_PlayDevice;
-    impl->WaitDevice = PULSEAUDIO_WaitDevice;
-    impl->GetDeviceBuf = PULSEAUDIO_GetDeviceBuf;
-    impl->CloseDevice = PULSEAUDIO_CloseDevice;
-    impl->WaitDone = PULSEAUDIO_WaitDone;
-    impl->Deinitialize = PULSEAUDIO_Deinitialize;
-    impl->OnlyHasDefaultOutputDevice = 1;
-
-    return 1;   /* this audio target is available. */
-}
-
-
-AudioBootStrap PULSEAUDIO_bootstrap = {
-    "pulseaudio", "PulseAudio", PULSEAUDIO_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_PULSEAUDIO */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/pulseaudio/SDL_pulseaudio.h b/deps/SDL2/src/audio/pulseaudio/SDL_pulseaudio.h
deleted file mode 100644
index cb96039..0000000
--- a/deps/SDL2/src/audio/pulseaudio/SDL_pulseaudio.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_pulseaudio_h
-#define _SDL_pulseaudio_h
-
-#include <pulse/simple.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* pulseaudio structures */
-    pa_mainloop *mainloop;
-    pa_mainloop_api *mainloop_api;
-    pa_context *context;
-    pa_stream *stream;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-};
-
-#endif /* _SDL_pulseaudio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/qsa/SDL_qsa_audio.c b/deps/SDL2/src/audio/qsa/SDL_qsa_audio.c
deleted file mode 100644
index 78f69c0..0000000
--- a/deps/SDL2/src/audio/qsa/SDL_qsa_audio.c
+++ /dev/null
@@ -1,857 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_QSA
-
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sched.h>
-#include <sys/select.h>
-#include <sys/neutrino.h>
-#include <sys/asoundlib.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_qsa_audio.h"
-
-/* default channel communication parameters */
-#define DEFAULT_CPARAMS_RATE   44100
-#define DEFAULT_CPARAMS_VOICES 1
-
-#define DEFAULT_CPARAMS_FRAG_SIZE 4096
-#define DEFAULT_CPARAMS_FRAGS_MIN 1
-#define DEFAULT_CPARAMS_FRAGS_MAX 1
-
-#define QSA_NO_WORKAROUNDS  0x00000000
-#define QSA_MMAP_WORKAROUND 0x00000001
-
-struct BuggyCards
-{
-    char *cardname;
-    unsigned long bugtype;
-};
-
-#define QSA_WA_CARDS             3
-#define QSA_MAX_CARD_NAME_LENGTH 33
-
-struct BuggyCards buggycards[QSA_WA_CARDS] = {
-    {"Sound Blaster Live!", QSA_MMAP_WORKAROUND},
-    {"Vortex 8820", QSA_MMAP_WORKAROUND},
-    {"Vortex 8830", QSA_MMAP_WORKAROUND},
-};
-
-/* List of found devices */
-#define QSA_MAX_DEVICES       32
-#define QSA_MAX_NAME_LENGTH   81+16     /* Hardcoded in QSA, can't be changed */
-
-typedef struct _QSA_Device
-{
-    char name[QSA_MAX_NAME_LENGTH];     /* Long audio device name for SDL  */
-    int cardno;
-    int deviceno;
-} QSA_Device;
-
-QSA_Device qsa_playback_device[QSA_MAX_DEVICES];
-uint32_t qsa_playback_devices;
-
-QSA_Device qsa_capture_device[QSA_MAX_DEVICES];
-uint32_t qsa_capture_devices;
-
-static SDL_INLINE int
-QSA_SetError(const char *fn, int status)
-{
-    return SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status));
-}
-
-/* card names check to apply the workarounds */
-static int
-QSA_CheckBuggyCards(_THIS, unsigned long checkfor)
-{
-    char scardname[QSA_MAX_CARD_NAME_LENGTH];
-    int it;
-
-    if (snd_card_get_name
-        (this->hidden->cardno, scardname, QSA_MAX_CARD_NAME_LENGTH - 1) < 0) {
-        return 0;
-    }
-
-    for (it = 0; it < QSA_WA_CARDS; it++) {
-        if (SDL_strcmp(buggycards[it].cardname, scardname) == 0) {
-            if (buggycards[it].bugtype == checkfor) {
-                return 1;
-            }
-        }
-    }
-
-    return 0;
-}
-
-/* !!! FIXME: does this need to be here? Does the SDL version not work? */
-static void
-QSA_ThreadInit(_THIS)
-{
-    struct sched_param param;
-    int status;
-
-    /* Increase default 10 priority to 25 to avoid jerky sound */
-    status = SchedGet(0, 0, &param);
-    param.sched_priority = param.sched_curpriority + 15;
-    status = SchedSet(0, 0, SCHED_NOCHANGE, &param);
-}
-
-/* PCM channel parameters initialize function */
-static void
-QSA_InitAudioParams(snd_pcm_channel_params_t * cpars)
-{
-    SDL_memset(cpars, 0, sizeof(snd_pcm_channel_params_t));
-
-    cpars->channel = SND_PCM_CHANNEL_PLAYBACK;
-    cpars->mode = SND_PCM_MODE_BLOCK;
-    cpars->start_mode = SND_PCM_START_DATA;
-    cpars->stop_mode = SND_PCM_STOP_STOP;
-    cpars->format.format = SND_PCM_SFMT_S16_LE;
-    cpars->format.interleave = 1;
-    cpars->format.rate = DEFAULT_CPARAMS_RATE;
-    cpars->format.voices = DEFAULT_CPARAMS_VOICES;
-    cpars->buf.block.frag_size = DEFAULT_CPARAMS_FRAG_SIZE;
-    cpars->buf.block.frags_min = DEFAULT_CPARAMS_FRAGS_MIN;
-    cpars->buf.block.frags_max = DEFAULT_CPARAMS_FRAGS_MAX;
-}
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-QSA_WaitDevice(_THIS)
-{
-    fd_set wfds;
-    fd_set rfds;
-    int selectret;
-    struct timeval timeout;
-
-    if (!this->hidden->iscapture) {
-        FD_ZERO(&wfds);
-        FD_SET(this->hidden->audio_fd, &wfds);
-    } else {
-        FD_ZERO(&rfds);
-        FD_SET(this->hidden->audio_fd, &rfds);
-    }
-
-    do {
-        /* Setup timeout for playing one fragment equal to 2 seconds          */
-        /* If timeout occured than something wrong with hardware or driver    */
-        /* For example, Vortex 8820 audio driver stucks on second DAC because */
-        /* it doesn't exist !                                                 */
-        timeout.tv_sec = 2;
-        timeout.tv_usec = 0;
-        this->hidden->timeout_on_wait = 0;
-
-        if (!this->hidden->iscapture) {
-            selectret =
-                select(this->hidden->audio_fd + 1, NULL, &wfds, NULL,
-                       &timeout);
-        } else {
-            selectret =
-                select(this->hidden->audio_fd + 1, &rfds, NULL, NULL,
-                       &timeout);
-        }
-
-        switch (selectret) {
-        case -1:
-            {
-                SDL_SetError("QSA: select() failed: %s", strerror(errno));
-                return;
-            }
-            break;
-        case 0:
-            {
-                SDL_SetError("QSA: timeout on buffer waiting occured");
-                this->hidden->timeout_on_wait = 1;
-                return;
-            }
-            break;
-        default:
-            {
-                if (!this->hidden->iscapture) {
-                    if (FD_ISSET(this->hidden->audio_fd, &wfds)) {
-                        return;
-                    }
-                } else {
-                    if (FD_ISSET(this->hidden->audio_fd, &rfds)) {
-                        return;
-                    }
-                }
-            }
-            break;
-        }
-    } while (1);
-}
-
-static void
-QSA_PlayDevice(_THIS)
-{
-    snd_pcm_channel_status_t cstatus;
-    int written;
-    int status;
-    int towrite;
-    void *pcmbuffer;
-
-    if ((!this->enabled) || (!this->hidden)) {
-        return;
-    }
-
-    towrite = this->spec.size;
-    pcmbuffer = this->hidden->pcm_buf;
-
-    /* Write the audio data, checking for EAGAIN (buffer full) and underrun */
-    do {
-        written =
-            snd_pcm_plugin_write(this->hidden->audio_handle, pcmbuffer,
-                                 towrite);
-        if (written != towrite) {
-            /* Check if samples playback got stuck somewhere in hardware or in */
-            /* the audio device driver */
-            if ((errno == EAGAIN) && (written == 0)) {
-                if (this->hidden->timeout_on_wait != 0) {
-                    SDL_SetError("QSA: buffer playback timeout");
-                    return;
-                }
-            }
-
-            /* Check for errors or conditions */
-            if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
-                /* Let a little CPU time go by and try to write again */
-                SDL_Delay(1);
-
-                /* if we wrote some data */
-                towrite -= written;
-                pcmbuffer += written * this->spec.channels;
-                continue;
-            } else {
-                if ((errno == EINVAL) || (errno == EIO)) {
-                    SDL_memset(&cstatus, 0, sizeof(cstatus));
-                    if (!this->hidden->iscapture) {
-                        cstatus.channel = SND_PCM_CHANNEL_PLAYBACK;
-                    } else {
-                        cstatus.channel = SND_PCM_CHANNEL_CAPTURE;
-                    }
-
-                    status =
-                        snd_pcm_plugin_status(this->hidden->audio_handle,
-                                              &cstatus);
-                    if (status < 0) {
-                        QSA_SetError("snd_pcm_plugin_status", status);
-                        return;
-                    }
-
-                    if ((cstatus.status == SND_PCM_STATUS_UNDERRUN) ||
-                        (cstatus.status == SND_PCM_STATUS_READY)) {
-                        if (!this->hidden->iscapture) {
-                            status =
-                                snd_pcm_plugin_prepare(this->hidden->
-                                                       audio_handle,
-                                                       SND_PCM_CHANNEL_PLAYBACK);
-                        } else {
-                            status =
-                                snd_pcm_plugin_prepare(this->hidden->
-                                                       audio_handle,
-                                                       SND_PCM_CHANNEL_CAPTURE);
-                        }
-                        if (status < 0) {
-                            QSA_SetError("snd_pcm_plugin_prepare", status);
-                            return;
-                        }
-                    }
-                    continue;
-                } else {
-                    return;
-                }
-            }
-        } else {
-            /* we wrote all remaining data */
-            towrite -= written;
-            pcmbuffer += written * this->spec.channels;
-        }
-    } while ((towrite > 0) && (this->enabled));
-
-    /* If we couldn't write, assume fatal error for now */
-    if (towrite != 0) {
-        this->enabled = 0;
-    }
-}
-
-static Uint8 *
-QSA_GetDeviceBuf(_THIS)
-{
-    return this->hidden->pcm_buf;
-}
-
-static void
-QSA_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        if (this->hidden->audio_handle != NULL) {
-            if (!this->hidden->iscapture) {
-                /* Finish playing available samples */
-                snd_pcm_plugin_flush(this->hidden->audio_handle,
-                                     SND_PCM_CHANNEL_PLAYBACK);
-            } else {
-                /* Cancel unread samples during capture */
-                snd_pcm_plugin_flush(this->hidden->audio_handle,
-                                     SND_PCM_CHANNEL_CAPTURE);
-            }
-            snd_pcm_close(this->hidden->audio_handle);
-            this->hidden->audio_handle = NULL;
-        }
-
-        SDL_FreeAudioMem(this->hidden->pcm_buf);
-        this->hidden->pcm_buf = NULL;
-
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static int
-QSA_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    int status = 0;
-    int format = 0;
-    SDL_AudioFormat test_format = 0;
-    int found = 0;
-    snd_pcm_channel_setup_t csetup;
-    snd_pcm_channel_params_t cparams;
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden =
-        (struct SDL_PrivateAudioData *) SDL_calloc(1,
-                                                   (sizeof
-                                                    (struct
-                                                     SDL_PrivateAudioData)));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, sizeof(struct SDL_PrivateAudioData));
-
-    /* Initialize channel transfer parameters to default */
-    QSA_InitAudioParams(&cparams);
-
-    /* Initialize channel direction: capture or playback */
-    this->hidden->iscapture = iscapture;
-
-    /* Find deviceid and cardid by device name for playback */
-    if ((!this->hidden->iscapture) && (devname != NULL)) {
-        uint32_t device;
-        int32_t status;
-
-        /* Search in the playback devices */
-        device = 0;
-        do {
-            status = SDL_strcmp(qsa_playback_device[device].name, devname);
-            if (status == 0) {
-                /* Found requested device */
-                this->hidden->deviceno = qsa_playback_device[device].deviceno;
-                this->hidden->cardno = qsa_playback_device[device].cardno;
-                break;
-            }
-            device++;
-            if (device >= qsa_playback_devices) {
-                QSA_CloseDevice(this);
-                return SDL_SetError("No such playback device");
-            }
-        } while (1);
-    }
-
-    /* Find deviceid and cardid by device name for capture */
-    if ((this->hidden->iscapture) && (devname != NULL)) {
-        /* Search in the capture devices */
-        uint32_t device;
-        int32_t status;
-
-        /* Searching in the playback devices */
-        device = 0;
-        do {
-            status = SDL_strcmp(qsa_capture_device[device].name, devname);
-            if (status == 0) {
-                /* Found requested device */
-                this->hidden->deviceno = qsa_capture_device[device].deviceno;
-                this->hidden->cardno = qsa_capture_device[device].cardno;
-                break;
-            }
-            device++;
-            if (device >= qsa_capture_devices) {
-                QSA_CloseDevice(this);
-                return SDL_SetError("No such capture device");
-            }
-        } while (1);
-    }
-
-    /* Check if SDL requested default audio device */
-    if (devname == NULL) {
-        /* Open system default audio device */
-        if (!this->hidden->iscapture) {
-            status = snd_pcm_open_preferred(&this->hidden->audio_handle,
-                                            &this->hidden->cardno,
-                                            &this->hidden->deviceno,
-                                            SND_PCM_OPEN_PLAYBACK);
-        } else {
-            status = snd_pcm_open_preferred(&this->hidden->audio_handle,
-                                            &this->hidden->cardno,
-                                            &this->hidden->deviceno,
-                                            SND_PCM_OPEN_CAPTURE);
-        }
-    } else {
-        /* Open requested audio device */
-        if (!this->hidden->iscapture) {
-            status =
-                snd_pcm_open(&this->hidden->audio_handle,
-                             this->hidden->cardno, this->hidden->deviceno,
-                             SND_PCM_OPEN_PLAYBACK);
-        } else {
-            status =
-                snd_pcm_open(&this->hidden->audio_handle,
-                             this->hidden->cardno, this->hidden->deviceno,
-                             SND_PCM_OPEN_CAPTURE);
-        }
-    }
-
-    /* Check if requested device is opened */
-    if (status < 0) {
-        this->hidden->audio_handle = NULL;
-        QSA_CloseDevice(this);
-        return QSA_SetError("snd_pcm_open", status);
-    }
-
-    if (!QSA_CheckBuggyCards(this, QSA_MMAP_WORKAROUND)) {
-        /* Disable QSA MMAP plugin for buggy audio drivers */
-        status =
-            snd_pcm_plugin_set_disable(this->hidden->audio_handle,
-                                       PLUGIN_DISABLE_MMAP);
-        if (status < 0) {
-            QSA_CloseDevice(this);
-            return QSA_SetError("snd_pcm_plugin_set_disable", status);
-        }
-    }
-
-    /* Try for a closest match on audio format */
-    format = 0;
-    /* can't use format as SND_PCM_SFMT_U8 = 0 in qsa */
-    found = 0;
-
-    for (test_format = SDL_FirstAudioFormat(this->spec.format); !found;) {
-        /* if match found set format to equivalent QSA format */
-        switch (test_format) {
-        case AUDIO_U8:
-            {
-                format = SND_PCM_SFMT_U8;
-                found = 1;
-            }
-            break;
-        case AUDIO_S8:
-            {
-                format = SND_PCM_SFMT_S8;
-                found = 1;
-            }
-            break;
-        case AUDIO_S16LSB:
-            {
-                format = SND_PCM_SFMT_S16_LE;
-                found = 1;
-            }
-            break;
-        case AUDIO_S16MSB:
-            {
-                format = SND_PCM_SFMT_S16_BE;
-                found = 1;
-            }
-            break;
-        case AUDIO_U16LSB:
-            {
-                format = SND_PCM_SFMT_U16_LE;
-                found = 1;
-            }
-            break;
-        case AUDIO_U16MSB:
-            {
-                format = SND_PCM_SFMT_U16_BE;
-                found = 1;
-            }
-            break;
-        case AUDIO_S32LSB:
-            {
-                format = SND_PCM_SFMT_S32_LE;
-                found = 1;
-            }
-            break;
-        case AUDIO_S32MSB:
-            {
-                format = SND_PCM_SFMT_S32_BE;
-                found = 1;
-            }
-            break;
-        case AUDIO_F32LSB:
-            {
-                format = SND_PCM_SFMT_FLOAT_LE;
-                found = 1;
-            }
-            break;
-        case AUDIO_F32MSB:
-            {
-                format = SND_PCM_SFMT_FLOAT_BE;
-                found = 1;
-            }
-            break;
-        default:
-            {
-                break;
-            }
-        }
-
-        if (!found) {
-            test_format = SDL_NextAudioFormat();
-        }
-    }
-
-    /* assumes test_format not 0 on success */
-    if (test_format == 0) {
-        QSA_CloseDevice(this);
-        return SDL_SetError("QSA: Couldn't find any hardware audio formats");
-    }
-
-    this->spec.format = test_format;
-
-    /* Set the audio format */
-    cparams.format.format = format;
-
-    /* Set mono/stereo/4ch/6ch/8ch audio */
-    cparams.format.voices = this->spec.channels;
-
-    /* Set rate */
-    cparams.format.rate = this->spec.freq;
-
-    /* Setup the transfer parameters according to cparams */
-    status = snd_pcm_plugin_params(this->hidden->audio_handle, &cparams);
-    if (status < 0) {
-        QSA_CloseDevice(this);
-        return QSA_SetError("snd_pcm_channel_params", status);
-    }
-
-    /* Make sure channel is setup right one last time */
-    SDL_memset(&csetup, 0, sizeof(csetup));
-    if (!this->hidden->iscapture) {
-        csetup.channel = SND_PCM_CHANNEL_PLAYBACK;
-    } else {
-        csetup.channel = SND_PCM_CHANNEL_CAPTURE;
-    }
-
-    /* Setup an audio channel */
-    if (snd_pcm_plugin_setup(this->hidden->audio_handle, &csetup) < 0) {
-        QSA_CloseDevice(this);
-        return SDL_SetError("QSA: Unable to setup channel");
-    }
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    this->hidden->pcm_len = this->spec.size;
-
-    if (this->hidden->pcm_len == 0) {
-        this->hidden->pcm_len =
-            csetup.buf.block.frag_size * this->spec.channels *
-            (snd_pcm_format_width(format) / 8);
-    }
-
-    /*
-     * Allocate memory to the audio buffer and initialize with silence
-     *  (Note that buffer size must be a multiple of fragment size, so find
-     *  closest multiple)
-     */
-    this->hidden->pcm_buf =
-        (Uint8 *) SDL_AllocAudioMem(this->hidden->pcm_len);
-    if (this->hidden->pcm_buf == NULL) {
-        QSA_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->pcm_buf, this->spec.silence,
-               this->hidden->pcm_len);
-
-    /* get the file descriptor */
-    if (!this->hidden->iscapture) {
-        this->hidden->audio_fd =
-            snd_pcm_file_descriptor(this->hidden->audio_handle,
-                                    SND_PCM_CHANNEL_PLAYBACK);
-    } else {
-        this->hidden->audio_fd =
-            snd_pcm_file_descriptor(this->hidden->audio_handle,
-                                    SND_PCM_CHANNEL_CAPTURE);
-    }
-
-    if (this->hidden->audio_fd < 0) {
-        QSA_CloseDevice(this);
-        return QSA_SetError("snd_pcm_file_descriptor", status);
-    }
-
-    /* Prepare an audio channel */
-    if (!this->hidden->iscapture) {
-        /* Prepare audio playback */
-        status =
-            snd_pcm_plugin_prepare(this->hidden->audio_handle,
-                                   SND_PCM_CHANNEL_PLAYBACK);
-    } else {
-        /* Prepare audio capture */
-        status =
-            snd_pcm_plugin_prepare(this->hidden->audio_handle,
-                                   SND_PCM_CHANNEL_CAPTURE);
-    }
-
-    if (status < 0) {
-        QSA_CloseDevice(this);
-        return QSA_SetError("snd_pcm_plugin_prepare", status);
-    }
-
-    /* We're really ready to rock and roll. :-) */
-    return 0;
-}
-
-static void
-QSA_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
-{
-    uint32_t it;
-    uint32_t cards;
-    uint32_t devices;
-    int32_t status;
-
-    /* Detect amount of available devices       */
-    /* this value can be changed in the runtime */
-    cards = snd_cards();
-
-    /* If io-audio manager is not running we will get 0 as number */
-    /* of available audio devices                                 */
-    if (cards == 0) {
-        /* We have no any available audio devices */
-        return;
-    }
-
-    /* Find requested devices by type */
-    if (!iscapture) {
-        /* Playback devices enumeration requested */
-        for (it = 0; it < cards; it++) {
-            devices = 0;
-            do {
-                status =
-                    snd_card_get_longname(it,
-                                          qsa_playback_device
-                                          [qsa_playback_devices].name,
-                                          QSA_MAX_NAME_LENGTH);
-                if (status == EOK) {
-                    snd_pcm_t *handle;
-
-                    /* Add device number to device name */
-                    sprintf(qsa_playback_device[qsa_playback_devices].name +
-                            SDL_strlen(qsa_playback_device
-                                       [qsa_playback_devices].name), " d%d",
-                            devices);
-
-                    /* Store associated card number id */
-                    qsa_playback_device[qsa_playback_devices].cardno = it;
-
-                    /* Check if this device id could play anything */
-                    status =
-                        snd_pcm_open(&handle, it, devices,
-                                     SND_PCM_OPEN_PLAYBACK);
-                    if (status == EOK) {
-                        qsa_playback_device[qsa_playback_devices].deviceno =
-                            devices;
-                        status = snd_pcm_close(handle);
-                        if (status == EOK) {
-                            addfn(qsa_playback_device[qsa_playback_devices].name);
-                            qsa_playback_devices++;
-                        }
-                    } else {
-                        /* Check if we got end of devices list */
-                        if (status == -ENOENT) {
-                            break;
-                        }
-                    }
-                } else {
-                    break;
-                }
-
-                /* Check if we reached maximum devices count */
-                if (qsa_playback_devices >= QSA_MAX_DEVICES) {
-                    break;
-                }
-                devices++;
-            } while (1);
-
-            /* Check if we reached maximum devices count */
-            if (qsa_playback_devices >= QSA_MAX_DEVICES) {
-                break;
-            }
-        }
-    } else {
-        /* Capture devices enumeration requested */
-        for (it = 0; it < cards; it++) {
-            devices = 0;
-            do {
-                status =
-                    snd_card_get_longname(it,
-                                          qsa_capture_device
-                                          [qsa_capture_devices].name,
-                                          QSA_MAX_NAME_LENGTH);
-                if (status == EOK) {
-                    snd_pcm_t *handle;
-
-                    /* Add device number to device name */
-                    sprintf(qsa_capture_device[qsa_capture_devices].name +
-                            SDL_strlen(qsa_capture_device
-                                       [qsa_capture_devices].name), " d%d",
-                            devices);
-
-                    /* Store associated card number id */
-                    qsa_capture_device[qsa_capture_devices].cardno = it;
-
-                    /* Check if this device id could play anything */
-                    status =
-                        snd_pcm_open(&handle, it, devices,
-                                     SND_PCM_OPEN_CAPTURE);
-                    if (status == EOK) {
-                        qsa_capture_device[qsa_capture_devices].deviceno =
-                            devices;
-                        status = snd_pcm_close(handle);
-                        if (status == EOK) {
-                            addfn(qsa_capture_device[qsa_capture_devices].name);
-                            qsa_capture_devices++;
-                        }
-                    } else {
-                        /* Check if we got end of devices list */
-                        if (status == -ENOENT) {
-                            break;
-                        }
-                    }
-
-                    /* Check if we reached maximum devices count */
-                    if (qsa_capture_devices >= QSA_MAX_DEVICES) {
-                        break;
-                    }
-                } else {
-                    break;
-                }
-                devices++;
-            } while (1);
-
-            /* Check if we reached maximum devices count */
-            if (qsa_capture_devices >= QSA_MAX_DEVICES) {
-                break;
-            }
-        }
-    }
-}
-
-static void
-QSA_WaitDone(_THIS)
-{
-    if (!this->hidden->iscapture) {
-        if (this->hidden->audio_handle != NULL) {
-            /* Wait till last fragment is played and stop channel */
-            snd_pcm_plugin_flush(this->hidden->audio_handle,
-                                 SND_PCM_CHANNEL_PLAYBACK);
-        }
-    } else {
-        if (this->hidden->audio_handle != NULL) {
-            /* Discard all unread data and stop channel */
-            snd_pcm_plugin_flush(this->hidden->audio_handle,
-                                 SND_PCM_CHANNEL_CAPTURE);
-        }
-    }
-}
-
-static void
-QSA_Deinitialize(void)
-{
-    /* Clear devices array on shutdown */
-    SDL_memset(qsa_playback_device, 0x00,
-               sizeof(QSA_Device) * QSA_MAX_DEVICES);
-    SDL_memset(qsa_capture_device, 0x00,
-               sizeof(QSA_Device) * QSA_MAX_DEVICES);
-    qsa_playback_devices = 0;
-    qsa_capture_devices = 0;
-}
-
-static int
-QSA_Init(SDL_AudioDriverImpl * impl)
-{
-    snd_pcm_t *handle = NULL;
-    int32_t status = 0;
-
-    /* Clear devices array */
-    SDL_memset(qsa_playback_device, 0x00,
-               sizeof(QSA_Device) * QSA_MAX_DEVICES);
-    SDL_memset(qsa_capture_device, 0x00,
-               sizeof(QSA_Device) * QSA_MAX_DEVICES);
-    qsa_playback_devices = 0;
-    qsa_capture_devices = 0;
-
-    /* Set function pointers                                     */
-    /* DeviceLock and DeviceUnlock functions are used default,   */
-    /* provided by SDL, which uses pthread_mutex for lock/unlock */
-    impl->DetectDevices = QSA_DetectDevices;
-    impl->OpenDevice = QSA_OpenDevice;
-    impl->ThreadInit = QSA_ThreadInit;
-    impl->WaitDevice = QSA_WaitDevice;
-    impl->PlayDevice = QSA_PlayDevice;
-    impl->GetDeviceBuf = QSA_GetDeviceBuf;
-    impl->CloseDevice = QSA_CloseDevice;
-    impl->WaitDone = QSA_WaitDone;
-    impl->Deinitialize = QSA_Deinitialize;
-    impl->LockDevice = NULL;
-    impl->UnlockDevice = NULL;
-
-    impl->OnlyHasDefaultOutputDevice = 0;
-    impl->ProvidesOwnCallbackThread = 0;
-    impl->SkipMixerLock = 0;
-    impl->HasCaptureSupport = 1;
-    impl->OnlyHasDefaultOutputDevice = 0;
-    impl->OnlyHasDefaultInputDevice = 0;
-
-    /* Check if io-audio manager is running or not */
-    status = snd_cards();
-    if (status == 0) {
-        /* if no, return immediately */
-        return 1;
-    }
-
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap QSAAUDIO_bootstrap = {
-    "qsa", "QNX QSA Audio", QSA_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_QSA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/qsa/SDL_qsa_audio.h b/deps/SDL2/src/audio/qsa/SDL_qsa_audio.h
deleted file mode 100644
index 1717d08..0000000
--- a/deps/SDL2/src/audio/qsa/SDL_qsa_audio.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#ifndef __SDL_QSA_AUDIO_H__
-#define __SDL_QSA_AUDIO_H__
-
-#include <sys/asoundlib.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice* this
-
-struct SDL_PrivateAudioData
-{
-    /* SDL capture state */
-    int iscapture;
-
-    /* The audio device handle */
-    int cardno;
-    int deviceno;
-    snd_pcm_t *audio_handle;
-
-    /* The audio file descriptor */
-    int audio_fd;
-
-    /* Select timeout status */
-    uint32_t timeout_on_wait;
-
-    /* Raw mixing buffer */
-    Uint8 *pcm_buf;
-    Uint32 pcm_len;
-};
-
-#endif /* __SDL_QSA_AUDIO_H__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/sdlgenaudiocvt.pl b/deps/SDL2/src/audio/sdlgenaudiocvt.pl
deleted file mode 100755
index 474ce81..0000000
--- a/deps/SDL2/src/audio/sdlgenaudiocvt.pl
+++ /dev/null
@@ -1,760 +0,0 @@
-#!/usr/bin/perl -w
-
-use warnings;
-use strict;
-
-my @audiotypes = qw(
-    U8
-    S8
-    U16LSB
-    S16LSB
-    U16MSB
-    S16MSB
-    S32LSB
-    S32MSB
-    F32LSB
-    F32MSB
-);
-
-my @channels = ( 1, 2, 4, 6, 8 );
-my %funcs;
-my $custom_converters = 0;
-
-
-sub getTypeConvertHashId {
-    my ($from, $to) = @_;
-    return "TYPECONVERTER $from/$to";
-}
-
-
-sub getResamplerHashId {
-    my ($from, $channels, $upsample, $multiple) = @_;
-    return "RESAMPLER $from/$channels/$upsample/$multiple";
-}
-
-
-sub outputHeader {
-    print <<EOF;
-/* DO NOT EDIT!  This file is generated by sdlgenaudiocvt.pl */
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken\@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-#include "SDL_audio.h"
-#include "SDL_audio_c.h"
-
-#ifndef DEBUG_CONVERT
-#define DEBUG_CONVERT 0
-#endif
-
-
-/* If you can guarantee your data and need space, you can eliminate code... */
-
-/* Just build the arbitrary resamplers if you're saving code space. */
-#ifndef LESS_RESAMPLERS
-#define LESS_RESAMPLERS 0
-#endif
-
-/* Don't build any resamplers if you're REALLY saving code space. */
-#ifndef NO_RESAMPLERS
-#define NO_RESAMPLERS 0
-#endif
-
-/* Don't build any type converters if you're saving code space. */
-#ifndef NO_CONVERTERS
-#define NO_CONVERTERS 0
-#endif
-
-
-/* *INDENT-OFF* */
-
-EOF
-
-    my @vals = ( 127, 32767, 2147483647 );
-    foreach (@vals) {
-        my $val = $_;
-        my $fval = 1.0 / $val;
-        print("#define DIVBY${val} ${fval}f\n");
-    }
-
-    print("\n");
-}
-
-sub outputFooter {
-    print <<EOF;
-/* $custom_converters converters generated. */
-
-/* *INDENT-ON* */
-
-/* vi: set ts=4 sw=4 expandtab: */
-EOF
-}
-
-sub splittype {
-    my $t = shift;
-    my ($signed, $size, $endian) = $t =~ /([USF])(\d+)([LM]SB|)/;
-    my $float = ($signed eq 'F') ? 1 : 0;
-    $signed = (($float) or ($signed eq 'S')) ? 1 : 0;
-    $endian = 'NONE' if ($endian eq '');
-
-    my $ctype = '';
-    if ($float) {
-        $ctype = (($size == 32) ? 'float' : 'double');
-    } else {
-        $ctype = (($signed) ? 'S' : 'U') . "int${size}";
-    }
-
-    return ($signed, $float, $size, $endian, $ctype);
-}
-
-sub getSwapFunc {
-    my ($size, $signed, $float, $endian, $val) = @_;
-    my $BEorLE = (($endian eq 'MSB') ? 'BE' : 'LE');
-    my $code = '';
-
-    if ($float) {
-        $code = "SDL_SwapFloat${BEorLE}($val)";
-    } else {
-        if ($size > 8) {
-            $code = "SDL_Swap${BEorLE}${size}($val)";
-        } else {
-            $code = $val;
-        }
-
-        if (($signed) and (!$float)) {
-            $code = "((Sint${size}) $code)";
-        }
-    }
-
-    return "${code}";
-}
-
-
-sub maxIntVal {
-    my $size = shift;
-    if ($size == 8) {
-        return 0x7F;
-    } elsif ($size == 16) {
-        return 0x7FFF;
-    } elsif ($size == 32) {
-        return 0x7FFFFFFF;
-    }
-
-    die("bug in script.\n");
-}
-
-sub getFloatToIntMult {
-    my $size = shift;
-    my $val = maxIntVal($size) . '.0';
-    $val .= 'f' if ($size < 32);
-    return $val;
-}
-
-sub getIntToFloatDivBy {
-    my $size = shift;
-    return 'DIVBY' . maxIntVal($size);
-}
-
-sub getSignFlipVal {
-    my $size = shift;
-    if ($size == 8) {
-        return '0x80';
-    } elsif ($size == 16) {
-        return '0x8000';
-    } elsif ($size == 32) {
-        return '0x80000000';
-    }
-
-    die("bug in script.\n");
-}
-
-sub buildCvtFunc {
-    my ($from, $to) = @_;
-    my ($fsigned, $ffloat, $fsize, $fendian, $fctype) = splittype($from);
-    my ($tsigned, $tfloat, $tsize, $tendian, $tctype) = splittype($to);
-    my $diffs = 0;
-    $diffs++ if ($fsize != $tsize);
-    $diffs++ if ($fsigned != $tsigned);
-    $diffs++ if ($ffloat != $tfloat);
-    $diffs++ if ($fendian ne $tendian);
-
-    return if ($diffs == 0);
-
-    my $hashid = getTypeConvertHashId($from, $to);
-    if (1) { # !!! FIXME: if ($diffs > 1) {
-        my $sym = "SDL_Convert_${from}_to_${to}";
-        $funcs{$hashid} = $sym;
-        $custom_converters++;
-
-        # Always unsigned for ints, for possible byteswaps.
-        my $srctype = (($ffloat) ? 'float' : "Uint${fsize}");
-
-        print <<EOF;
-static void SDLCALL
-${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-    int i;
-    const $srctype *src;
-    $tctype *dst;
-
-#if DEBUG_CONVERT
-    fprintf(stderr, "Converting AUDIO_${from} to AUDIO_${to}.\\n");
-#endif
-
-EOF
-
-        if ($fsize < $tsize) {
-            my $mult = $tsize / $fsize;
-            print <<EOF;
-    src = ((const $srctype *) (cvt->buf + cvt->len_cvt)) - 1;
-    dst = (($tctype *) (cvt->buf + cvt->len_cvt * $mult)) - 1;
-    for (i = cvt->len_cvt / sizeof ($srctype); i; --i, --src, --dst) {
-EOF
-        } else {
-            print <<EOF;
-    src = (const $srctype *) cvt->buf;
-    dst = ($tctype *) cvt->buf;
-    for (i = cvt->len_cvt / sizeof ($srctype); i; --i, ++src, ++dst) {
-EOF
-        }
-
-        # Have to convert to/from float/int.
-        # !!! FIXME: cast through double for int32<->float?
-        my $code = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, '*src');
-        if ($ffloat != $tfloat) {
-            if ($ffloat) {
-                my $mult = getFloatToIntMult($tsize);
-                if (!$tsigned) {   # bump from -1.0f/1.0f to 0.0f/2.0f
-                    $code = "($code + 1.0f)";
-                }
-                $code = "(($tctype) ($code * $mult))";
-            } else {
-                # $divby will be the reciprocal, to avoid pipeline stalls
-                #  from floating point division...so multiply it.
-                my $divby = getIntToFloatDivBy($fsize);
-                $code = "(((float) $code) * $divby)";
-                if (!$fsigned) {   # bump from 0.0f/2.0f to -1.0f/1.0f.
-                    $code = "($code - 1.0f)";
-                }
-            }
-        } else {
-            # All integer conversions here.
-            if ($fsigned != $tsigned) {
-                my $signflipval = getSignFlipVal($fsize);
-                $code = "(($code) ^ $signflipval)";
-            }
-
-            my $shiftval = abs($fsize - $tsize);
-            if ($fsize < $tsize) {
-                $code = "((($tctype) $code) << $shiftval)";
-            } elsif ($fsize > $tsize) {
-                $code = "(($tctype) ($code >> $shiftval))";
-            }
-        }
-
-        my $swap = getSwapFunc($tsize, $tsigned, $tfloat, $tendian, 'val');
-
-        print <<EOF;
-        const $tctype val = $code;
-        *dst = ${swap};
-    }
-
-EOF
-
-        if ($fsize > $tsize) {
-            my $divby = $fsize / $tsize;
-            print("    cvt->len_cvt /= $divby;\n");
-        } elsif ($fsize < $tsize) {
-            my $mult = $tsize / $fsize;
-            print("    cvt->len_cvt *= $mult;\n");
-        }
-
-        print <<EOF;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, AUDIO_$to);
-    }
-}
-
-EOF
-
-    } else {
-        if ($fsigned != $tsigned) {
-            $funcs{$hashid} = 'SDL_ConvertSigned';
-        } elsif ($ffloat != $tfloat) {
-            $funcs{$hashid} = 'SDL_ConvertFloat';
-        } elsif ($fsize != $tsize) {
-            $funcs{$hashid} = 'SDL_ConvertSize';
-        } elsif ($fendian ne $tendian) {
-            $funcs{$hashid} = 'SDL_ConvertEndian';
-        } else {
-            die("error in script.\n");
-        }
-    }
-}
-
-
-sub buildTypeConverters {
-    print "#if !NO_CONVERTERS\n\n";
-    foreach (@audiotypes) {
-        my $from = $_;
-        foreach (@audiotypes) {
-            my $to = $_;
-            buildCvtFunc($from, $to);
-        }
-    }
-    print "#endif  /* !NO_CONVERTERS */\n\n\n";
-
-    print "const SDL_AudioTypeFilters sdl_audio_type_filters[] =\n{\n";
-    print "#if !NO_CONVERTERS\n";
-    foreach (@audiotypes) {
-        my $from = $_;
-        foreach (@audiotypes) {
-            my $to = $_;
-            if ($from ne $to) {
-                my $hashid = getTypeConvertHashId($from, $to);
-                my $sym = $funcs{$hashid};
-                print("    { AUDIO_$from, AUDIO_$to, $sym },\n");
-            }
-        }
-    }
-    print "#endif  /* !NO_CONVERTERS */\n";
-
-    print("    { 0, 0, NULL }\n");
-    print "};\n\n\n";
-}
-
-sub getBiggerCtype {
-    my ($isfloat, $size) = @_;
-
-    if ($isfloat) {
-        if ($size == 32) {
-            return 'double';
-        }
-        die("bug in script.\n");
-    }
-
-    if ($size == 8) {
-        return 'Sint16';
-    } elsif ($size == 16) {
-        return 'Sint32'
-    } elsif ($size == 32) {
-        return 'Sint64'
-    }
-
-    die("bug in script.\n");
-}
-
-
-# These handle arbitrary resamples...44100Hz to 48000Hz, for example.
-# Man, this code is skanky.
-sub buildArbitraryResampleFunc {
-    # !!! FIXME: we do a lot of unnecessary and ugly casting in here, due to getSwapFunc().
-    my ($from, $channels, $upsample) = @_;
-    my ($fsigned, $ffloat, $fsize, $fendian, $fctype) = splittype($from);
-
-    my $bigger = getBiggerCtype($ffloat, $fsize);
-    my $interp = ($ffloat) ? '* 0.5' : '>> 1';
-
-    my $resample = ($upsample) ? 'Upsample' : 'Downsample';
-    my $hashid = getResamplerHashId($from, $channels, $upsample, 0);
-    my $sym = "SDL_${resample}_${from}_${channels}c";
-    $funcs{$hashid} = $sym;
-    $custom_converters++;
-
-    my $fudge = $fsize * $channels * 2;  # !!! FIXME
-    my $eps_adjust = ($upsample) ? 'dstsize' : 'srcsize';
-    my $incr = '';
-    my $incr2 = '';
-
-
-    # !!! FIXME: DEBUG_CONVERT should report frequencies.
-    print <<EOF;
-static void SDLCALL
-${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "$resample arbitrary (x%f) AUDIO_${from}, ${channels} channels.\\n", cvt->rate_incr);
-#endif
-
-    const int srcsize = cvt->len_cvt - $fudge;
-    const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
-    register int eps = 0;
-EOF
-
-    my $endcomparison = '!=';
-
-    # Upsampling (growing the buffer) needs to work backwards, since we
-    #  overwrite the buffer as we go.
-    if ($upsample) {
-        $endcomparison = '>=';  # dst > target
-        print <<EOF;
-    $fctype *dst = (($fctype *) (cvt->buf + dstsize)) - $channels;
-    const $fctype *src = (($fctype *) (cvt->buf + cvt->len_cvt)) - $channels;
-    const $fctype *target = ((const $fctype *) cvt->buf);
-EOF
-    } else {
-        $endcomparison = '<';  # dst < target
-        print <<EOF;
-    $fctype *dst = ($fctype *) cvt->buf;
-    const $fctype *src = ($fctype *) cvt->buf;
-    const $fctype *target = (const $fctype *) (cvt->buf + dstsize);
-EOF
-    }
-
-    for (my $i = 0; $i < $channels; $i++) {
-        my $idx = ($upsample) ? (($channels - $i) - 1) : $i;
-        my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "src[$idx]");
-        print <<EOF;
-    $fctype sample${idx} = $val;
-EOF
-    }
-
-    for (my $i = 0; $i < $channels; $i++) {
-        my $idx = ($upsample) ? (($channels - $i) - 1) : $i;
-        print <<EOF;
-    $fctype last_sample${idx} = sample${idx};
-EOF
-    }
-
-    print <<EOF;
-    while (dst $endcomparison target) {
-EOF
-
-    if ($upsample) {
-        for (my $i = 0; $i < $channels; $i++) {
-            # !!! FIXME: don't do this swap every write, just when the samples change.
-            my $idx = (($channels - $i) - 1);
-            my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "sample${idx}");
-            print <<EOF;
-        dst[$idx] = $val;
-EOF
-        }
-
-        $incr = ($channels == 1) ? 'dst--' : "dst -= $channels";
-        $incr2 = ($channels == 1) ? 'src--' : "src -= $channels";
-
-        print <<EOF;
-        $incr;
-        eps += srcsize;
-        if ((eps << 1) >= dstsize) {
-            $incr2;
-EOF
-    } else {  # downsample.
-        $incr = ($channels == 1) ? 'src++' : "src += $channels";
-        print <<EOF;
-        $incr;
-        eps += dstsize;
-        if ((eps << 1) >= srcsize) {
-EOF
-        for (my $i = 0; $i < $channels; $i++) {
-            my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "sample${i}");
-            print <<EOF;
-            dst[$i] = $val;
-EOF
-        }
-
-        $incr = ($channels == 1) ? 'dst++' : "dst += $channels";
-        print <<EOF;
-            $incr;
-EOF
-    }
-
-    for (my $i = 0; $i < $channels; $i++) {
-        my $idx = ($upsample) ? (($channels - $i) - 1) : $i;
-        my $swapped = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "src[$idx]");
-        print <<EOF;
-            sample${idx} = ($fctype) (((($bigger) $swapped) + (($bigger) last_sample${idx})) $interp);
-EOF
-    }
-
-    for (my $i = 0; $i < $channels; $i++) {
-        my $idx = ($upsample) ? (($channels - $i) - 1) : $i;
-        print <<EOF;
-            last_sample${idx} = sample${idx};
-EOF
-    }
-
-    print <<EOF;
-            eps -= $eps_adjust;
-        }
-    }
-EOF
-
-        print <<EOF;
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-EOF
-
-}
-
-# These handle clean resamples...doubling and quadrupling the sample rate, etc.
-sub buildMultipleResampleFunc {
-    # !!! FIXME: we do a lot of unnecessary and ugly casting in here, due to getSwapFunc().
-    my ($from, $channels, $upsample, $multiple) = @_;
-    my ($fsigned, $ffloat, $fsize, $fendian, $fctype) = splittype($from);
-
-    my $bigger = getBiggerCtype($ffloat, $fsize);
-    my $interp = ($ffloat) ? '* 0.5' : '>> 1';
-    my $interp2 = ($ffloat) ? '* 0.25' : '>> 2';
-    my $mult3 = ($ffloat) ? '3.0' : '3';
-    my $lencvtop = ($upsample) ? '*' : '/';
-
-    my $resample = ($upsample) ? 'Upsample' : 'Downsample';
-    my $hashid = getResamplerHashId($from, $channels, $upsample, $multiple);
-    my $sym = "SDL_${resample}_${from}_${channels}c_x${multiple}";
-    $funcs{$hashid} = $sym;
-    $custom_converters++;
-
-    # !!! FIXME: DEBUG_CONVERT should report frequencies.
-    print <<EOF;
-static void SDLCALL
-${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format)
-{
-#if DEBUG_CONVERT
-    fprintf(stderr, "$resample (x${multiple}) AUDIO_${from}, ${channels} channels.\\n");
-#endif
-
-    const int dstsize = cvt->len_cvt $lencvtop $multiple;
-EOF
-
-    my $endcomparison = '!=';
-
-    # Upsampling (growing the buffer) needs to work backwards, since we
-    #  overwrite the buffer as we go.
-    if ($upsample) {
-        $endcomparison = '>=';  # dst > target
-        print <<EOF;
-    $fctype *dst = (($fctype *) (cvt->buf + dstsize)) - $channels * $multiple;
-    const $fctype *src = (($fctype *) (cvt->buf + cvt->len_cvt)) - $channels;
-    const $fctype *target = ((const $fctype *) cvt->buf);
-EOF
-    } else {
-        $endcomparison = '<';  # dst < target
-        print <<EOF;
-    $fctype *dst = ($fctype *) cvt->buf;
-    const $fctype *src = ($fctype *) cvt->buf;
-    const $fctype *target = (const $fctype *) (cvt->buf + dstsize);
-EOF
-    }
-
-    for (my $i = 0; $i < $channels; $i++) {
-        my $idx = ($upsample) ? (($channels - $i) - 1) : $i;
-        my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "src[$idx]");
-        print <<EOF;
-    $bigger last_sample${idx} = ($bigger) $val;
-EOF
-    }
-
-    print <<EOF;
-    while (dst $endcomparison target) {
-EOF
-
-    for (my $i = 0; $i < $channels; $i++) {
-        my $idx = ($upsample) ? (($channels - $i) - 1) : $i;
-        my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "src[$idx]");
-        print <<EOF;
-        const $bigger sample${idx} = ($bigger) $val;
-EOF
-    }
-
-    my $incr = '';
-    if ($upsample) {
-        $incr = ($channels == 1) ? 'src--' : "src -= $channels";
-    } else {
-        my $amount = $channels * $multiple;
-        $incr = "src += $amount";  # can't ever be 1, so no "++" version.
-    }
-
-
-    print <<EOF;
-        $incr;
-EOF
-
-    # !!! FIXME: This really begs for some Altivec or SSE, etc.
-    if ($upsample) {
-        if ($multiple == 2) {
-            for (my $i = $channels-1; $i >= 0; $i--) {
-                my $dsti = $i + $channels;
-                print <<EOF;
-        dst[$dsti] = ($fctype) ((sample${i} + last_sample${i}) $interp);
-EOF
-            }
-            for (my $i = $channels-1; $i >= 0; $i--) {
-                my $dsti = $i;
-                print <<EOF;
-        dst[$dsti] = ($fctype) sample${i};
-EOF
-            }
-        } elsif ($multiple == 4) {
-            for (my $i = $channels-1; $i >= 0; $i--) {
-                my $dsti = $i + ($channels * 3);
-                print <<EOF;
-        dst[$dsti] = ($fctype) ((sample${i} + ($mult3 * last_sample${i})) $interp2);
-EOF
-            }
-
-            for (my $i = $channels-1; $i >= 0; $i--) {
-                my $dsti = $i + ($channels * 2);
-                print <<EOF;
-        dst[$dsti] = ($fctype) ((sample${i} + last_sample${i}) $interp);
-EOF
-            }
-
-            for (my $i = $channels-1; $i >= 0; $i--) {
-                my $dsti = $i + ($channels * 1);
-                print <<EOF;
-        dst[$dsti] = ($fctype) ((($mult3 * sample${i}) + last_sample${i}) $interp2);
-EOF
-            }
-
-            for (my $i = $channels-1; $i >= 0; $i--) {
-                my $dsti = $i + ($channels * 0);
-                print <<EOF;
-        dst[$dsti] = ($fctype) sample${i};
-EOF
-            }
-        } else {
-            die('bug in program.');  # we only handle x2 and x4.
-        }
-    } else {  # downsample.
-        if ($multiple == 2) {
-            for (my $i = 0; $i < $channels; $i++) {
-                print <<EOF;
-        dst[$i] = ($fctype) ((sample${i} + last_sample${i}) $interp);
-EOF
-            }
-        } elsif ($multiple == 4) {
-            # !!! FIXME: interpolate all 4 samples?
-            for (my $i = 0; $i < $channels; $i++) {
-                print <<EOF;
-        dst[$i] = ($fctype) ((sample${i} + last_sample${i}) $interp);
-EOF
-            }
-        } else {
-            die('bug in program.');  # we only handle x2 and x4.
-        }
-    }
-
-    for (my $i = 0; $i < $channels; $i++) {
-        my $idx = ($upsample) ? (($channels - $i) - 1) : $i;
-        print <<EOF;
-        last_sample${idx} = sample${idx};
-EOF
-    }
-
-    if ($upsample) {
-        my $amount = $channels * $multiple;
-        $incr = "dst -= $amount";  # can't ever be 1, so no "--" version.
-    } else {
-        $incr = ($channels == 1) ? 'dst++' : "dst += $channels";
-    }
-
-    print <<EOF;
-        $incr;
-    }
-
-    cvt->len_cvt = dstsize;
-    if (cvt->filters[++cvt->filter_index]) {
-        cvt->filters[cvt->filter_index] (cvt, format);
-    }
-}
-
-EOF
-
-}
-
-sub buildResamplers {
-    print "#if !NO_RESAMPLERS\n\n";
-    foreach (@audiotypes) {
-        my $from = $_;
-        foreach (@channels) {
-            my $channel = $_;
-            buildArbitraryResampleFunc($from, $channel, 1);
-            buildArbitraryResampleFunc($from, $channel, 0);
-        }
-    }
-
-    print "\n#if !LESS_RESAMPLERS\n\n";
-    foreach (@audiotypes) {
-        my $from = $_;
-        foreach (@channels) {
-            my $channel = $_;
-            for (my $multiple = 2; $multiple <= 4; $multiple += 2) {
-                buildMultipleResampleFunc($from, $channel, 1, $multiple);
-                buildMultipleResampleFunc($from, $channel, 0, $multiple);
-            }
-        }
-    }
-
-    print "#endif  /* !LESS_RESAMPLERS */\n";
-    print "#endif  /* !NO_RESAMPLERS */\n\n\n";
-
-    print "const SDL_AudioRateFilters sdl_audio_rate_filters[] =\n{\n";
-    print "#if !NO_RESAMPLERS\n";
-    foreach (@audiotypes) {
-        my $from = $_;
-        foreach (@channels) {
-            my $channel = $_;
-            for (my $upsample = 0; $upsample <= 1; $upsample++) {
-                my $hashid = getResamplerHashId($from, $channel, $upsample, 0);
-                my $sym = $funcs{$hashid};
-                print("    { AUDIO_$from, $channel, $upsample, 0, $sym },\n");
-            }
-        }
-    }
-
-    print "#if !LESS_RESAMPLERS\n";
-    foreach (@audiotypes) {
-        my $from = $_;
-        foreach (@channels) {
-            my $channel = $_;
-            for (my $multiple = 2; $multiple <= 4; $multiple += 2) {
-                for (my $upsample = 0; $upsample <= 1; $upsample++) {
-                    my $hashid = getResamplerHashId($from, $channel, $upsample, $multiple);
-                    my $sym = $funcs{$hashid};
-                    print("    { AUDIO_$from, $channel, $upsample, $multiple, $sym },\n");
-                }
-            }
-        }
-    }
-
-    print "#endif  /* !LESS_RESAMPLERS */\n";
-    print "#endif  /* !NO_RESAMPLERS */\n";
-    print("    { 0, 0, 0, 0, NULL }\n");
-    print "};\n\n";
-}
-
-
-# mainline ...
-
-outputHeader();
-buildTypeConverters();
-buildResamplers();
-outputFooter();
-
-exit 0;
-
-# end of sdlgenaudiocvt.pl ...
-
diff --git a/deps/SDL2/src/audio/sndio/SDL_sndioaudio.c b/deps/SDL2/src/audio/sndio/SDL_sndioaudio.c
deleted file mode 100644
index 309472d..0000000
--- a/deps/SDL2/src/audio/sndio/SDL_sndioaudio.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_SNDIO
-
-/* OpenBSD sndio target */
-
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#include <unistd.h>
-
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_sndioaudio.h"
-
-#ifdef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
-#include "SDL_loadso.h"
-#endif
-
-static struct sio_hdl * (*SNDIO_sio_open)(const char *, unsigned int, int);
-static void (*SNDIO_sio_close)(struct sio_hdl *);
-static int (*SNDIO_sio_setpar)(struct sio_hdl *, struct sio_par *);
-static int (*SNDIO_sio_getpar)(struct sio_hdl *, struct sio_par *);
-static int (*SNDIO_sio_start)(struct sio_hdl *);
-static int (*SNDIO_sio_stop)(struct sio_hdl *);
-static size_t (*SNDIO_sio_read)(struct sio_hdl *, void *, size_t);
-static size_t (*SNDIO_sio_write)(struct sio_hdl *, const void *, size_t);
-static void (*SNDIO_sio_initpar)(struct sio_par *);
-
-#ifdef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
-static const char *sndio_library = SDL_AUDIO_DRIVER_SNDIO_DYNAMIC;
-static void *sndio_handle = NULL;
-
-static int
-load_sndio_sym(const char *fn, void **addr)
-{
-    *addr = SDL_LoadFunction(sndio_handle, fn);
-    if (*addr == NULL) {
-        /* Don't call SDL_SetError(): SDL_LoadFunction already did. */
-        return 0;
-    }
-
-    return 1;
-}
-
-/* cast funcs to char* first, to please GCC's strict aliasing rules. */
-#define SDL_SNDIO_SYM(x) \
-    if (!load_sndio_sym(#x, (void **) (char *) &SNDIO_##x)) return -1
-#else
-#define SDL_SNDIO_SYM(x) SNDIO_##x = x
-#endif
-
-static int
-load_sndio_syms(void)
-{
-    SDL_SNDIO_SYM(sio_open);
-    SDL_SNDIO_SYM(sio_close);
-    SDL_SNDIO_SYM(sio_setpar);
-    SDL_SNDIO_SYM(sio_getpar);
-    SDL_SNDIO_SYM(sio_start);
-    SDL_SNDIO_SYM(sio_stop);
-    SDL_SNDIO_SYM(sio_read);
-    SDL_SNDIO_SYM(sio_write);
-    SDL_SNDIO_SYM(sio_initpar);
-    return 0;
-}
-
-#undef SDL_SNDIO_SYM
-
-#ifdef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
-
-static void
-UnloadSNDIOLibrary(void)
-{
-    if (sndio_handle != NULL) {
-        SDL_UnloadObject(sndio_handle);
-        sndio_handle = NULL;
-    }
-}
-
-static int
-LoadSNDIOLibrary(void)
-{
-    int retval = 0;
-    if (sndio_handle == NULL) {
-        sndio_handle = SDL_LoadObject(sndio_library);
-        if (sndio_handle == NULL) {
-            retval = -1;
-            /* Don't call SDL_SetError(): SDL_LoadObject already did. */
-        } else {
-            retval = load_sndio_syms();
-            if (retval < 0) {
-                UnloadSNDIOLibrary();
-            }
-        }
-    }
-    return retval;
-}
-
-#else
-
-static void
-UnloadSNDIOLibrary(void)
-{
-}
-
-static int
-LoadSNDIOLibrary(void)
-{
-    load_sndio_syms();
-    return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_SNDIO_DYNAMIC */
-
-
-
-
-static void
-SNDIO_WaitDevice(_THIS)
-{
-    /* no-op; SNDIO_sio_write() blocks if necessary. */
-}
-
-static void
-SNDIO_PlayDevice(_THIS)
-{
-    const int written = SNDIO_sio_write(this->hidden->dev,
-                                        this->hidden->mixbuf,
-                                        this->hidden->mixlen);
-
-    /* If we couldn't write, assume fatal error for now */
-    if ( written == 0 ) {
-        this->enabled = 0;
-    }
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static Uint8 *
-SNDIO_GetDeviceBuf(_THIS)
-{
-    return this->hidden->mixbuf;
-}
-
-static void
-SNDIO_WaitDone(_THIS)
-{
-    SNDIO_sio_stop(this->hidden->dev);
-}
-
-static void
-SNDIO_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        if ( this->hidden->dev != NULL ) {
-            SNDIO_sio_close(this->hidden->dev);
-            this->hidden->dev = NULL;
-        }
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static int
-SNDIO_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
-    struct sio_par par;
-    int status;
-
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc(sizeof(*this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, sizeof(*this->hidden));
-
-    this->hidden->mixlen = this->spec.size;
-
-    /* !!! FIXME: SIO_DEVANY can be a specific device... */
-    if ((this->hidden->dev = SNDIO_sio_open(NULL, SIO_PLAY, 0)) == NULL) {
-        SNDIO_CloseDevice(this);
-        return SDL_SetError("sio_open() failed");
-    }
-
-    SNDIO_sio_initpar(&par);
-
-    par.rate = this->spec.freq;
-    par.pchan = this->spec.channels;
-    par.round = this->spec.samples;
-    par.appbufsz = par.round * 2;
-
-    /* Try for a closest match on audio format */
-    status = -1;
-    while (test_format && (status < 0)) {
-        if (!SDL_AUDIO_ISFLOAT(test_format)) {
-            par.le = SDL_AUDIO_ISLITTLEENDIAN(test_format) ? 1 : 0;
-            par.sig = SDL_AUDIO_ISSIGNED(test_format) ? 1 : 0;
-            par.bits = SDL_AUDIO_BITSIZE(test_format);
-
-            if (SNDIO_sio_setpar(this->hidden->dev, &par) == 1) {
-                status = 0;
-                break;
-            }
-        }
-        test_format = SDL_NextAudioFormat();
-    }
-
-    if (status < 0) {
-        SNDIO_CloseDevice(this);
-        return SDL_SetError("sndio: Couldn't find any hardware audio formats");
-    }
-
-    if (SNDIO_sio_getpar(this->hidden->dev, &par) == 0) {
-        SNDIO_CloseDevice(this);
-        return SDL_SetError("sio_getpar() failed");
-    }
-
-    if ((par.bits == 32) && (par.sig) && (par.le))
-        this->spec.format = AUDIO_S32LSB;
-    else if ((par.bits == 32) && (par.sig) && (!par.le))
-        this->spec.format = AUDIO_S32MSB;
-    else if ((par.bits == 16) && (par.sig) && (par.le))
-        this->spec.format = AUDIO_S16LSB;
-    else if ((par.bits == 16) && (par.sig) && (!par.le))
-        this->spec.format = AUDIO_S16MSB;
-    else if ((par.bits == 16) && (!par.sig) && (par.le))
-        this->spec.format = AUDIO_U16LSB;
-    else if ((par.bits == 16) && (!par.sig) && (!par.le))
-        this->spec.format = AUDIO_U16MSB;
-    else if ((par.bits == 8) && (par.sig))
-        this->spec.format = AUDIO_S8;
-    else if ((par.bits == 8) && (!par.sig))
-        this->spec.format = AUDIO_U8;
-    else {
-        SNDIO_CloseDevice(this);
-        return SDL_SetError("sndio: Got unsupported hardware audio format.");
-    }
-
-    this->spec.freq = par.rate;
-    this->spec.channels = par.pchan;
-    this->spec.samples = par.round;
-
-    /* Calculate the final parameters for this audio specification */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Allocate mixing buffer */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        SNDIO_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen);
-
-    if (!SNDIO_sio_start(this->hidden->dev)) {
-        return SDL_SetError("sio_start() failed");
-    }
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-static void
-SNDIO_Deinitialize(void)
-{
-    UnloadSNDIOLibrary();
-}
-
-static int
-SNDIO_Init(SDL_AudioDriverImpl * impl)
-{
-    if (LoadSNDIOLibrary() < 0) {
-        return 0;
-    }
-
-    /* Set the function pointers */
-    impl->OpenDevice = SNDIO_OpenDevice;
-    impl->WaitDevice = SNDIO_WaitDevice;
-    impl->PlayDevice = SNDIO_PlayDevice;
-    impl->GetDeviceBuf = SNDIO_GetDeviceBuf;
-    impl->WaitDone = SNDIO_WaitDone;
-    impl->CloseDevice = SNDIO_CloseDevice;
-    impl->Deinitialize = SNDIO_Deinitialize;
-    impl->OnlyHasDefaultOutputDevice = 1;  /* !!! FIXME: sndio can handle multiple devices. */
-
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap SNDIO_bootstrap = {
-    "sndio", "OpenBSD sndio", SNDIO_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_SNDIO */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/sndio/SDL_sndioaudio.h b/deps/SDL2/src/audio/sndio/SDL_sndioaudio.h
deleted file mode 100644
index 94e1542..0000000
--- a/deps/SDL2/src/audio/sndio/SDL_sndioaudio.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_sndioaudio_h
-#define _SDL_sndioaudio_h
-
-#include <sndio.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The audio device handle */
-    struct sio_hdl *dev;
-
-    /* Raw mixing buffer */
-    Uint8 *mixbuf;
-    int mixlen;
-};
-
-#endif /* _SDL_sndioaudio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/sun/SDL_sunaudio.c b/deps/SDL2/src/audio/sun/SDL_sunaudio.c
deleted file mode 100644
index 98acf44..0000000
--- a/deps/SDL2/src/audio/sun/SDL_sunaudio.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_SUNAUDIO
-
-/* Allow access to a raw mixing buffer */
-
-#include <fcntl.h>
-#include <errno.h>
-#ifdef __NETBSD__
-#include <sys/ioctl.h>
-#include <sys/audioio.h>
-#endif
-#ifdef __SVR4
-#include <sys/audioio.h>
-#else
-#include <sys/time.h>
-#include <sys/types.h>
-#endif
-#include <unistd.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_sunaudio.h"
-
-/* Open the audio device for playback, and don't block if busy */
-
-#if defined(AUDIO_GETINFO) && !defined(AUDIO_GETBUFINFO)
-#define AUDIO_GETBUFINFO AUDIO_GETINFO
-#endif
-
-/* Audio driver functions */
-static Uint8 snd2au(int sample);
-
-/* Audio driver bootstrap functions */
-static void
-SUNAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
-{
-    SDL_EnumUnixAudioDevices(iscapture, 1, (int (*)(int fd)) NULL, addfn);
-}
-
-#ifdef DEBUG_AUDIO
-void
-CheckUnderflow(_THIS)
-{
-#ifdef AUDIO_GETBUFINFO
-    audio_info_t info;
-    int left;
-
-    ioctl(this->hidden->audio_fd, AUDIO_GETBUFINFO, &info);
-    left = (this->hidden->written - info.play.samples);
-    if (this->hidden->written && (left == 0)) {
-        fprintf(stderr, "audio underflow!\n");
-    }
-#endif
-}
-#endif
-
-static void
-SUNAUDIO_WaitDevice(_THIS)
-{
-#ifdef AUDIO_GETBUFINFO
-#define SLEEP_FUDGE 10      /* 10 ms scheduling fudge factor */
-    audio_info_t info;
-    Sint32 left;
-
-    ioctl(this->hidden->audio_fd, AUDIO_GETBUFINFO, &info);
-    left = (this->hidden->written - info.play.samples);
-    if (left > this->hidden->fragsize) {
-        Sint32 sleepy;
-
-        sleepy = ((left - this->hidden->fragsize) / this->hidden->frequency);
-        sleepy -= SLEEP_FUDGE;
-        if (sleepy > 0) {
-            SDL_Delay(sleepy);
-        }
-    }
-#else
-    fd_set fdset;
-
-    FD_ZERO(&fdset);
-    FD_SET(this->hidden->audio_fd, &fdset);
-    select(this->hidden->audio_fd + 1, NULL, &fdset, NULL, NULL);
-#endif
-}
-
-static void
-SUNAUDIO_PlayDevice(_THIS)
-{
-    /* Write the audio data */
-    if (this->hidden->ulaw_only) {
-        /* Assuming that this->spec.freq >= 8000 Hz */
-        int accum, incr, pos;
-        Uint8 *aubuf;
-
-        accum = 0;
-        incr = this->spec.freq / 8;
-        aubuf = this->hidden->ulaw_buf;
-        switch (this->hidden->audio_fmt & 0xFF) {
-        case 8:
-            {
-                Uint8 *sndbuf;
-
-                sndbuf = this->hidden->mixbuf;
-                for (pos = 0; pos < this->hidden->fragsize; ++pos) {
-                    *aubuf = snd2au((0x80 - *sndbuf) * 64);
-                    accum += incr;
-                    while (accum > 0) {
-                        accum -= 1000;
-                        sndbuf += 1;
-                    }
-                    aubuf += 1;
-                }
-            }
-            break;
-        case 16:
-            {
-                Sint16 *sndbuf;
-
-                sndbuf = (Sint16 *) this->hidden->mixbuf;
-                for (pos = 0; pos < this->hidden->fragsize; ++pos) {
-                    *aubuf = snd2au(*sndbuf / 4);
-                    accum += incr;
-                    while (accum > 0) {
-                        accum -= 1000;
-                        sndbuf += 1;
-                    }
-                    aubuf += 1;
-                }
-            }
-            break;
-        }
-#ifdef DEBUG_AUDIO
-        CheckUnderflow(this);
-#endif
-        if (write(this->hidden->audio_fd, this->hidden->ulaw_buf,
-            this->hidden->fragsize) < 0) {
-            /* Assume fatal error, for now */
-            this->enabled = 0;
-        }
-        this->hidden->written += this->hidden->fragsize;
-    } else {
-#ifdef DEBUG_AUDIO
-        CheckUnderflow(this);
-#endif
-        if (write(this->hidden->audio_fd, this->hidden->mixbuf,
-            this->spec.size) < 0) {
-            /* Assume fatal error, for now */
-            this->enabled = 0;
-        }
-        this->hidden->written += this->hidden->fragsize;
-    }
-}
-
-static Uint8 *
-SUNAUDIO_GetDeviceBuf(_THIS)
-{
-    return (this->hidden->mixbuf);
-}
-
-static void
-SUNAUDIO_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        SDL_FreeAudioMem(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-        SDL_free(this->hidden->ulaw_buf);
-        this->hidden->ulaw_buf = NULL;
-        if (this->hidden->audio_fd >= 0) {
-            close(this->hidden->audio_fd);
-            this->hidden->audio_fd = -1;
-        }
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static int
-SUNAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT);
-    SDL_AudioFormat format = 0;
-    audio_info_t info;
-
-    /* We don't care what the devname is...we'll try to open anything. */
-    /*  ...but default to first name in the list... */
-    if (devname == NULL) {
-        devname = SDL_GetAudioDeviceName(0, iscapture);
-        if (devname == NULL) {
-            return SDL_SetError("No such audio device");
-        }
-    }
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Open the audio device */
-    this->hidden->audio_fd = open(devname, flags, 0);
-    if (this->hidden->audio_fd < 0) {
-        return SDL_SetError("Couldn't open %s: %s", devname, strerror(errno));
-    }
-
-#ifdef AUDIO_SETINFO
-    int enc;
-#endif
-    int desired_freq = this->spec.freq;
-
-    /* Determine the audio parameters from the AudioSpec */
-    switch (SDL_AUDIO_BITSIZE(this->spec.format)) {
-
-    case 8:
-        {                       /* Unsigned 8 bit audio data */
-            this->spec.format = AUDIO_U8;
-#ifdef AUDIO_SETINFO
-            enc = AUDIO_ENCODING_LINEAR8;
-#endif
-        }
-        break;
-
-    case 16:
-        {                       /* Signed 16 bit audio data */
-            this->spec.format = AUDIO_S16SYS;
-#ifdef AUDIO_SETINFO
-            enc = AUDIO_ENCODING_LINEAR;
-#endif
-        }
-        break;
-
-    default:
-        {
-            /* !!! FIXME: fallback to conversion on unsupported types! */
-            return SDL_SetError("Unsupported audio format");
-        }
-    }
-    this->hidden->audio_fmt = this->spec.format;
-
-    this->hidden->ulaw_only = 0;    /* modern Suns do support linear audio */
-#ifdef AUDIO_SETINFO
-    for (;;) {
-        audio_info_t info;
-        AUDIO_INITINFO(&info);  /* init all fields to "no change" */
-
-        /* Try to set the requested settings */
-        info.play.sample_rate = this->spec.freq;
-        info.play.channels = this->spec.channels;
-        info.play.precision = (enc == AUDIO_ENCODING_ULAW)
-            ? 8 : this->spec.format & 0xff;
-        info.play.encoding = enc;
-        if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == 0) {
-
-            /* Check to be sure we got what we wanted */
-            if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) {
-                return SDL_SetError("Error getting audio parameters: %s",
-                                    strerror(errno));
-            }
-            if (info.play.encoding == enc
-                && info.play.precision == (this->spec.format & 0xff)
-                && info.play.channels == this->spec.channels) {
-                /* Yow! All seems to be well! */
-                this->spec.freq = info.play.sample_rate;
-                break;
-            }
-        }
-
-        switch (enc) {
-        case AUDIO_ENCODING_LINEAR8:
-            /* unsigned 8bit apparently not supported here */
-            enc = AUDIO_ENCODING_LINEAR;
-            this->spec.format = AUDIO_S16SYS;
-            break;              /* try again */
-
-        case AUDIO_ENCODING_LINEAR:
-            /* linear 16bit didn't work either, resort to µ-law */
-            enc = AUDIO_ENCODING_ULAW;
-            this->spec.channels = 1;
-            this->spec.freq = 8000;
-            this->spec.format = AUDIO_U8;
-            this->hidden->ulaw_only = 1;
-            break;
-
-        default:
-            /* oh well... */
-            return SDL_SetError("Error setting audio parameters: %s",
-                                strerror(errno));
-        }
-    }
-#endif /* AUDIO_SETINFO */
-    this->hidden->written = 0;
-
-    /* We can actually convert on-the-fly to U-Law */
-    if (this->hidden->ulaw_only) {
-        this->spec.freq = desired_freq;
-        this->hidden->fragsize = (this->spec.samples * 1000) /
-            (this->spec.freq / 8);
-        this->hidden->frequency = 8;
-        this->hidden->ulaw_buf = (Uint8 *) SDL_malloc(this->hidden->fragsize);
-        if (this->hidden->ulaw_buf == NULL) {
-            return SDL_OutOfMemory();
-        }
-        this->spec.channels = 1;
-    } else {
-        this->hidden->fragsize = this->spec.samples;
-        this->hidden->frequency = this->spec.freq / 1000;
-    }
-#ifdef DEBUG_AUDIO
-    fprintf(stderr, "Audio device %s U-Law only\n",
-            this->hidden->ulaw_only ? "is" : "is not");
-    fprintf(stderr, "format=0x%x chan=%d freq=%d\n",
-            this->spec.format, this->spec.channels, this->spec.freq);
-#endif
-
-    /* Update the fragment size as size in bytes */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Allocate mixing buffer */
-    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->spec.size);
-    if (this->hidden->mixbuf == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
-
-    /* We're ready to rock and roll. :-) */
-    return 0;
-}
-
-/************************************************************************/
-/* This function (snd2au()) copyrighted:                                */
-/************************************************************************/
-/*      Copyright 1989 by Rich Gopstein and Harris Corporation          */
-/*                                                                      */
-/*      Permission to use, copy, modify, and distribute this software   */
-/*      and its documentation for any purpose and without fee is        */
-/*      hereby granted, provided that the above copyright notice        */
-/*      appears in all copies and that both that copyright notice and   */
-/*      this permission notice appear in supporting documentation, and  */
-/*      that the name of Rich Gopstein and Harris Corporation not be    */
-/*      used in advertising or publicity pertaining to distribution     */
-/*      of the software without specific, written prior permission.     */
-/*      Rich Gopstein and Harris Corporation make no representations    */
-/*      about the suitability of this software for any purpose.  It     */
-/*      provided "as is" without express or implied warranty.           */
-/************************************************************************/
-
-static Uint8
-snd2au(int sample)
-{
-
-    int mask;
-
-    if (sample < 0) {
-        sample = -sample;
-        mask = 0x7f;
-    } else {
-        mask = 0xff;
-    }
-
-    if (sample < 32) {
-        sample = 0xF0 | (15 - sample / 2);
-    } else if (sample < 96) {
-        sample = 0xE0 | (15 - (sample - 32) / 4);
-    } else if (sample < 224) {
-        sample = 0xD0 | (15 - (sample - 96) / 8);
-    } else if (sample < 480) {
-        sample = 0xC0 | (15 - (sample - 224) / 16);
-    } else if (sample < 992) {
-        sample = 0xB0 | (15 - (sample - 480) / 32);
-    } else if (sample < 2016) {
-        sample = 0xA0 | (15 - (sample - 992) / 64);
-    } else if (sample < 4064) {
-        sample = 0x90 | (15 - (sample - 2016) / 128);
-    } else if (sample < 8160) {
-        sample = 0x80 | (15 - (sample - 4064) / 256);
-    } else {
-        sample = 0x80;
-    }
-    return (mask & sample);
-}
-
-static int
-SUNAUDIO_Init(SDL_AudioDriverImpl * impl)
-{
-    /* Set the function pointers */
-    impl->DetectDevices = SUNAUDIO_DetectDevices;
-    impl->OpenDevice = SUNAUDIO_OpenDevice;
-    impl->PlayDevice = SUNAUDIO_PlayDevice;
-    impl->WaitDevice = SUNAUDIO_WaitDevice;
-    impl->GetDeviceBuf = SUNAUDIO_GetDeviceBuf;
-    impl->CloseDevice = SUNAUDIO_CloseDevice;
-
-    return 1; /* this audio target is available. */
-}
-
-AudioBootStrap SUNAUDIO_bootstrap = {
-    "audio", "UNIX /dev/audio interface", SUNAUDIO_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_SUNAUDIO */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/sun/SDL_sunaudio.h b/deps/SDL2/src/audio/sun/SDL_sunaudio.h
deleted file mode 100644
index 9b92266..0000000
--- a/deps/SDL2/src/audio/sun/SDL_sunaudio.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_sunaudio_h
-#define _SDL_sunaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
-    /* The file descriptor for the audio device */
-    int audio_fd;
-
-    SDL_AudioFormat audio_fmt;  /* The app audio format */
-    Uint8 *mixbuf;              /* The app mixing buffer */
-    int ulaw_only;              /* Flag -- does hardware only output U-law? */
-    Uint8 *ulaw_buf;            /* The U-law mixing buffer */
-    Sint32 written;             /* The number of samples written */
-    int fragsize;               /* The audio fragment size in samples */
-    int frequency;              /* The audio frequency in KHz */
-};
-
-#endif /* _SDL_sunaudio_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/winmm/SDL_winmm.c b/deps/SDL2/src/audio/winmm/SDL_winmm.c
deleted file mode 100644
index 4220afd..0000000
--- a/deps/SDL2/src/audio/winmm/SDL_winmm.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_WINMM
-
-/* Allow access to a raw mixing buffer */
-
-#include "../../core/windows/SDL_windows.h"
-#include <mmsystem.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "SDL_winmm.h"
-
-#ifndef WAVE_FORMAT_IEEE_FLOAT
-#define WAVE_FORMAT_IEEE_FLOAT 0x0003
-#endif
-
-#define DETECT_DEV_IMPL(typ, capstyp) \
-static void DetectWave##typ##Devs(SDL_AddAudioDevice addfn) { \
-    const UINT devcount = wave##typ##GetNumDevs(); \
-    capstyp caps; \
-    UINT i; \
-    for (i = 0; i < devcount; i++) { \
-        if (wave##typ##GetDevCaps(i,&caps,sizeof(caps))==MMSYSERR_NOERROR) { \
-            char *name = WIN_StringToUTF8(caps.szPname); \
-            if (name != NULL) { \
-                addfn(name); \
-                SDL_free(name); \
-            } \
-        } \
-    } \
-}
-
-DETECT_DEV_IMPL(Out, WAVEOUTCAPS)
-DETECT_DEV_IMPL(In, WAVEINCAPS)
-
-static void
-WINMM_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
-{
-    if (iscapture) {
-        DetectWaveInDevs(addfn);
-    } else {
-        DetectWaveOutDevs(addfn);
-    }
-}
-
-static void CALLBACK
-CaptureSound(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance,
-          DWORD_PTR dwParam1, DWORD_PTR dwParam2)
-{
-    SDL_AudioDevice *this = (SDL_AudioDevice *) dwInstance;
-
-    /* Only service "buffer is filled" messages */
-    if (uMsg != WIM_DATA)
-        return;
-
-    /* Signal that we have a new buffer of data */
-    ReleaseSemaphore(this->hidden->audio_sem, 1, NULL);
-}
-
-
-/* The Win32 callback for filling the WAVE device */
-static void CALLBACK
-FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
-          DWORD_PTR dwParam1, DWORD_PTR dwParam2)
-{
-    SDL_AudioDevice *this = (SDL_AudioDevice *) dwInstance;
-
-    /* Only service "buffer done playing" messages */
-    if (uMsg != WOM_DONE)
-        return;
-
-    /* Signal that we are done playing a buffer */
-    ReleaseSemaphore(this->hidden->audio_sem, 1, NULL);
-}
-
-static int
-SetMMerror(char *function, MMRESULT code)
-{
-    size_t len;
-    char errbuf[MAXERRORLENGTH];
-    wchar_t werrbuf[MAXERRORLENGTH];
-
-    SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
-    len = SDL_strlen(errbuf);
-
-    waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH - len);
-    WideCharToMultiByte(CP_ACP, 0, werrbuf, -1, errbuf + len,
-                        MAXERRORLENGTH - len, NULL, NULL);
-
-    return SDL_SetError("%s", errbuf);
-}
-
-static void
-WINMM_WaitDevice(_THIS)
-{
-    /* Wait for an audio chunk to finish */
-    WaitForSingleObject(this->hidden->audio_sem, INFINITE);
-}
-
-static Uint8 *
-WINMM_GetDeviceBuf(_THIS)
-{
-    return (Uint8 *) (this->hidden->
-                      wavebuf[this->hidden->next_buffer].lpData);
-}
-
-static void
-WINMM_PlayDevice(_THIS)
-{
-    /* Queue it up */
-    waveOutWrite(this->hidden->hout,
-                 &this->hidden->wavebuf[this->hidden->next_buffer],
-                 sizeof(this->hidden->wavebuf[0]));
-    this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS;
-}
-
-static void
-WINMM_WaitDone(_THIS)
-{
-    int i, left;
-
-    do {
-        left = NUM_BUFFERS;
-        for (i = 0; i < NUM_BUFFERS; ++i) {
-            if (this->hidden->wavebuf[i].dwFlags & WHDR_DONE) {
-                --left;
-            }
-        }
-        if (left > 0) {
-            SDL_Delay(100);
-        }
-    } while (left > 0);
-}
-
-static void
-WINMM_CloseDevice(_THIS)
-{
-    /* Close up audio */
-    if (this->hidden != NULL) {
-        int i;
-
-        if (this->hidden->audio_sem) {
-            CloseHandle(this->hidden->audio_sem);
-            this->hidden->audio_sem = 0;
-        }
-
-        /* Clean up mixing buffers */
-        for (i = 0; i < NUM_BUFFERS; ++i) {
-            if (this->hidden->wavebuf[i].dwUser != 0xFFFF) {
-                waveOutUnprepareHeader(this->hidden->hout,
-                                       &this->hidden->wavebuf[i],
-                                       sizeof(this->hidden->wavebuf[i]));
-                this->hidden->wavebuf[i].dwUser = 0xFFFF;
-            }
-        }
-
-        /* Free raw mixing buffer */
-        SDL_free(this->hidden->mixbuf);
-        this->hidden->mixbuf = NULL;
-
-        if (this->hidden->hin) {
-            waveInClose(this->hidden->hin);
-            this->hidden->hin = 0;
-        }
-
-        if (this->hidden->hout) {
-            waveOutClose(this->hidden->hout);
-            this->hidden->hout = 0;
-        }
-
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static SDL_bool
-PrepWaveFormat(_THIS, UINT_PTR devId, WAVEFORMATEX *pfmt, const int iscapture)
-{
-    SDL_zerop(pfmt);
-
-    if (SDL_AUDIO_ISFLOAT(this->spec.format)) {
-        pfmt->wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
-    } else {
-        pfmt->wFormatTag = WAVE_FORMAT_PCM;
-    }
-    pfmt->wBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format);
-
-    pfmt->nChannels = this->spec.channels;
-    pfmt->nSamplesPerSec = this->spec.freq;
-    pfmt->nBlockAlign = pfmt->nChannels * (pfmt->wBitsPerSample / 8);
-    pfmt->nAvgBytesPerSec = pfmt->nSamplesPerSec * pfmt->nBlockAlign;
-
-    if (iscapture) {
-        return (waveInOpen(0, devId, pfmt, 0, 0, WAVE_FORMAT_QUERY) == 0);
-    } else {
-        return (waveOutOpen(0, devId, pfmt, 0, 0, WAVE_FORMAT_QUERY) == 0);
-    }
-}
-
-static int
-WINMM_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
-    int valid_datatype = 0;
-    MMRESULT result;
-    WAVEFORMATEX waveformat;
-    UINT_PTR devId = WAVE_MAPPER;  /* WAVE_MAPPER == choose system's default */
-    char *utf8 = NULL;
-    int i;
-
-    if (devname != NULL) {  /* specific device requested? */
-        if (iscapture) {
-            const int devcount = (int) waveInGetNumDevs();
-            WAVEINCAPS caps;
-            for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) {
-                result = waveInGetDevCaps(i, &caps, sizeof (caps));
-                if (result != MMSYSERR_NOERROR)
-                    continue;
-                else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL)
-                    continue;
-                else if (SDL_strcmp(devname, utf8) == 0)
-                    devId = (UINT_PTR) i;
-                SDL_free(utf8);
-            }
-        } else {
-            const int devcount = (int) waveOutGetNumDevs();
-            WAVEOUTCAPS caps;
-            for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) {
-                result = waveOutGetDevCaps(i, &caps, sizeof (caps));
-                if (result != MMSYSERR_NOERROR)
-                    continue;
-                else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL)
-                    continue;
-                else if (SDL_strcmp(devname, utf8) == 0)
-                    devId = (UINT_PTR) i;
-                SDL_free(utf8);
-            }
-        }
-
-        if (devId == WAVE_MAPPER) {
-            return SDL_SetError("Requested device not found");
-        }
-    }
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    /* Initialize the wavebuf structures for closing */
-    for (i = 0; i < NUM_BUFFERS; ++i)
-        this->hidden->wavebuf[i].dwUser = 0xFFFF;
-
-    if (this->spec.channels > 2)
-        this->spec.channels = 2;        /* !!! FIXME: is this right? */
-
-    /* Check the buffer size -- minimum of 1/4 second (word aligned) */
-    if (this->spec.samples < (this->spec.freq / 4))
-        this->spec.samples = ((this->spec.freq / 4) + 3) & ~3;
-
-    while ((!valid_datatype) && (test_format)) {
-        switch (test_format) {
-        case AUDIO_U8:
-        case AUDIO_S16:
-        case AUDIO_S32:
-        case AUDIO_F32:
-            this->spec.format = test_format;
-            if (PrepWaveFormat(this, devId, &waveformat, iscapture)) {
-                valid_datatype = 1;
-            } else {
-                test_format = SDL_NextAudioFormat();
-            }
-            break;
-
-        default:
-            test_format = SDL_NextAudioFormat();
-            break;
-        }
-    }
-
-    if (!valid_datatype) {
-        WINMM_CloseDevice(this);
-        return SDL_SetError("Unsupported audio format");
-    }
-
-    /* Update the fragment size as size in bytes */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* Open the audio device */
-    if (iscapture) {
-        result = waveInOpen(&this->hidden->hin, devId, &waveformat,
-                             (DWORD_PTR) CaptureSound, (DWORD_PTR) this,
-                             CALLBACK_FUNCTION);
-    } else {
-        result = waveOutOpen(&this->hidden->hout, devId, &waveformat,
-                             (DWORD_PTR) FillSound, (DWORD_PTR) this,
-                             CALLBACK_FUNCTION);
-    }
-
-    if (result != MMSYSERR_NOERROR) {
-        WINMM_CloseDevice(this);
-        return SetMMerror("waveOutOpen()", result);
-    }
-#ifdef SOUND_DEBUG
-    /* Check the sound device we retrieved */
-    {
-        WAVEOUTCAPS caps;
-
-        result = waveOutGetDevCaps((UINT) this->hidden->hout,
-                                   &caps, sizeof(caps));
-        if (result != MMSYSERR_NOERROR) {
-            WINMM_CloseDevice(this);
-            return SetMMerror("waveOutGetDevCaps()", result);
-        }
-        printf("Audio device: %s\n", caps.szPname);
-    }
-#endif
-
-    /* Create the audio buffer semaphore */
-    this->hidden->audio_sem =
-        CreateSemaphore(NULL, NUM_BUFFERS - 1, NUM_BUFFERS, NULL);
-    if (this->hidden->audio_sem == NULL) {
-        WINMM_CloseDevice(this);
-        return SDL_SetError("Couldn't create semaphore");
-    }
-
-    /* Create the sound buffers */
-    this->hidden->mixbuf =
-        (Uint8 *) SDL_malloc(NUM_BUFFERS * this->spec.size);
-    if (this->hidden->mixbuf == NULL) {
-        WINMM_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    for (i = 0; i < NUM_BUFFERS; ++i) {
-        SDL_memset(&this->hidden->wavebuf[i], 0,
-                   sizeof(this->hidden->wavebuf[i]));
-        this->hidden->wavebuf[i].dwBufferLength = this->spec.size;
-        this->hidden->wavebuf[i].dwFlags = WHDR_DONE;
-        this->hidden->wavebuf[i].lpData =
-            (LPSTR) & this->hidden->mixbuf[i * this->spec.size];
-        result = waveOutPrepareHeader(this->hidden->hout,
-                                      &this->hidden->wavebuf[i],
-                                      sizeof(this->hidden->wavebuf[i]));
-        if (result != MMSYSERR_NOERROR) {
-            WINMM_CloseDevice(this);
-            return SetMMerror("waveOutPrepareHeader()", result);
-        }
-    }
-
-    return 0;                   /* Ready to go! */
-}
-
-
-static int
-WINMM_Init(SDL_AudioDriverImpl * impl)
-{
-    /* Set the function pointers */
-    impl->DetectDevices = WINMM_DetectDevices;
-    impl->OpenDevice = WINMM_OpenDevice;
-    impl->PlayDevice = WINMM_PlayDevice;
-    impl->WaitDevice = WINMM_WaitDevice;
-    impl->WaitDone = WINMM_WaitDone;
-    impl->GetDeviceBuf = WINMM_GetDeviceBuf;
-    impl->CloseDevice = WINMM_CloseDevice;
-
-    return 1;   /* this audio target is available. */
-}
-
-AudioBootStrap WINMM_bootstrap = {
-    "winmm", "Windows Waveform Audio", WINMM_Init, 0
-};
-
-#endif /* SDL_AUDIO_DRIVER_WINMM */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/winmm/SDL_winmm.h b/deps/SDL2/src/audio/winmm/SDL_winmm.h
deleted file mode 100644
index 5a0574d..0000000
--- a/deps/SDL2/src/audio/winmm/SDL_winmm.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_winmm_h
-#define _SDL_winmm_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-#define NUM_BUFFERS 2           /* -- Don't lower this! */
-
-struct SDL_PrivateAudioData
-{
-    HWAVEOUT hout;
-    HWAVEIN hin;
-    HANDLE audio_sem;
-    Uint8 *mixbuf;              /* The raw allocated mixing buffer */
-    WAVEHDR wavebuf[NUM_BUFFERS];       /* Wave audio fragments */
-    int next_buffer;
-};
-
-#endif /* _SDL_winmm_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/audio/xaudio2/SDL_xaudio2.c b/deps/SDL2/src/audio/xaudio2/SDL_xaudio2.c
deleted file mode 100644
index 557c3bb..0000000
--- a/deps/SDL2/src/audio/xaudio2/SDL_xaudio2.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_AUDIO_DRIVER_XAUDIO2
-
-#include "../../core/windows/SDL_windows.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-#include "SDL_assert.h"
-
-#ifdef __GNUC__
-/* The configure script already did any necessary checking */
-#  define SDL_XAUDIO2_HAS_SDK 1
-#else
-#include <dxsdkver.h> /* XAudio2 exists as of the March 2008 DirectX SDK */
-#if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284))
-#  pragma message("Your DirectX SDK is too old. Disabling XAudio2 support.")
-#else
-#  define SDL_XAUDIO2_HAS_SDK 1
-#endif
-#endif /* __GNUC__ */
-
-#ifdef SDL_XAUDIO2_HAS_SDK
-
-#define INITGUID 1
-#include <xaudio2.h>
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS   SDL_AudioDevice *this
-
-/* Fixes bug 1210 where some versions of gcc need named parameters */
-#ifdef __GNUC__
-#ifdef THIS
-#undef THIS
-#endif
-#define THIS    INTERFACE *p
-#ifdef THIS_
-#undef THIS_
-#endif
-#define THIS_   INTERFACE *p,
-#endif
-
-struct SDL_PrivateAudioData
-{
-    IXAudio2 *ixa2;
-    IXAudio2SourceVoice *source;
-    IXAudio2MasteringVoice *mastering;
-    HANDLE semaphore;
-    Uint8 *mixbuf;
-    int mixlen;
-    Uint8 *nextbuf;
-};
-
-
-static void
-XAUDIO2_DetectDevices(int iscapture, SDL_AddAudioDevice addfn)
-{
-    IXAudio2 *ixa2 = NULL;
-    UINT32 devcount = 0;
-    UINT32 i = 0;
-
-    if (iscapture) {
-        SDL_SetError("XAudio2: capture devices unsupported.");
-        return;
-    } else if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) {
-        SDL_SetError("XAudio2: XAudio2Create() failed at detection.");
-        return;
-    } else if (IXAudio2_GetDeviceCount(ixa2, &devcount) != S_OK) {
-        SDL_SetError("XAudio2: IXAudio2::GetDeviceCount() failed.");
-        IXAudio2_Release(ixa2);
-        return;
-    }
-
-    for (i = 0; i < devcount; i++) {
-        XAUDIO2_DEVICE_DETAILS details;
-        if (IXAudio2_GetDeviceDetails(ixa2, i, &details) == S_OK) {
-            char *str = WIN_StringToUTF8(details.DisplayName);
-            if (str != NULL) {
-                addfn(str);
-                SDL_free(str);  /* addfn() made a copy of the string. */
-            }
-        }
-    }
-
-    IXAudio2_Release(ixa2);
-}
-
-static void STDMETHODCALLTYPE
-VoiceCBOnBufferEnd(THIS_ void *data)
-{
-    /* Just signal the SDL audio thread and get out of XAudio2's way. */
-    SDL_AudioDevice *this = (SDL_AudioDevice *) data;
-    ReleaseSemaphore(this->hidden->semaphore, 1, NULL);
-}
-
-static void STDMETHODCALLTYPE
-VoiceCBOnVoiceError(THIS_ void *data, HRESULT Error)
-{
-    /* !!! FIXME: attempt to recover, or mark device disconnected. */
-    SDL_assert(0 && "write me!");
-}
-
-/* no-op callbacks... */
-static void STDMETHODCALLTYPE VoiceCBOnStreamEnd(THIS) {}
-static void STDMETHODCALLTYPE VoiceCBOnVoiceProcessPassStart(THIS_ UINT32 b) {}
-static void STDMETHODCALLTYPE VoiceCBOnVoiceProcessPassEnd(THIS) {}
-static void STDMETHODCALLTYPE VoiceCBOnBufferStart(THIS_ void *data) {}
-static void STDMETHODCALLTYPE VoiceCBOnLoopEnd(THIS_ void *data) {}
-
-
-static Uint8 *
-XAUDIO2_GetDeviceBuf(_THIS)
-{
-    return this->hidden->nextbuf;
-}
-
-static void
-XAUDIO2_PlayDevice(_THIS)
-{
-    XAUDIO2_BUFFER buffer;
-    Uint8 *mixbuf = this->hidden->mixbuf;
-    Uint8 *nextbuf = this->hidden->nextbuf;
-    const int mixlen = this->hidden->mixlen;
-    IXAudio2SourceVoice *source = this->hidden->source;
-    HRESULT result = S_OK;
-
-    if (!this->enabled) { /* shutting down? */
-        return;
-    }
-
-    /* Submit the next filled buffer */
-    SDL_zero(buffer);
-    buffer.AudioBytes = mixlen;
-    buffer.pAudioData = nextbuf;
-    buffer.pContext = this;
-
-    if (nextbuf == mixbuf) {
-        nextbuf += mixlen;
-    } else {
-        nextbuf = mixbuf;
-    }
-    this->hidden->nextbuf = nextbuf;
-
-    result = IXAudio2SourceVoice_SubmitSourceBuffer(source, &buffer, NULL);
-    if (result == XAUDIO2_E_DEVICE_INVALIDATED) {
-        /* !!! FIXME: possibly disconnected or temporary lost. Recover? */
-    }
-
-    if (result != S_OK) {  /* uhoh, panic! */
-        IXAudio2SourceVoice_FlushSourceBuffers(source);
-        this->enabled = 0;
-    }
-}
-
-static void
-XAUDIO2_WaitDevice(_THIS)
-{
-    if (this->enabled) {
-        WaitForSingleObject(this->hidden->semaphore, INFINITE);
-    }
-}
-
-static void
-XAUDIO2_WaitDone(_THIS)
-{
-    IXAudio2SourceVoice *source = this->hidden->source;
-    XAUDIO2_VOICE_STATE state;
-    SDL_assert(!this->enabled);  /* flag that stops playing. */
-    IXAudio2SourceVoice_Discontinuity(source);
-    IXAudio2SourceVoice_GetState(source, &state);
-    while (state.BuffersQueued > 0) {
-        WaitForSingleObject(this->hidden->semaphore, INFINITE);
-        IXAudio2SourceVoice_GetState(source, &state);
-    }
-}
-
-
-static void
-XAUDIO2_CloseDevice(_THIS)
-{
-    if (this->hidden != NULL) {
-        IXAudio2 *ixa2 = this->hidden->ixa2;
-        IXAudio2SourceVoice *source = this->hidden->source;
-        IXAudio2MasteringVoice *mastering = this->hidden->mastering;
-
-        if (source != NULL) {
-            IXAudio2SourceVoice_Stop(source, 0, XAUDIO2_COMMIT_NOW);
-            IXAudio2SourceVoice_FlushSourceBuffers(source);
-            IXAudio2SourceVoice_DestroyVoice(source);
-        }
-        if (ixa2 != NULL) {
-            IXAudio2_StopEngine(ixa2);
-        }
-        if (mastering != NULL) {
-            IXAudio2MasteringVoice_DestroyVoice(mastering);
-        }
-        if (ixa2 != NULL) {
-            IXAudio2_Release(ixa2);
-        }
-        SDL_free(this->hidden->mixbuf);
-        if (this->hidden->semaphore != NULL) {
-            CloseHandle(this->hidden->semaphore);
-        }
-
-        SDL_free(this->hidden);
-        this->hidden = NULL;
-    }
-}
-
-static int
-XAUDIO2_OpenDevice(_THIS, const char *devname, int iscapture)
-{
-    HRESULT result = S_OK;
-    WAVEFORMATEX waveformat;
-    int valid_format = 0;
-    SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
-    IXAudio2 *ixa2 = NULL;
-    IXAudio2SourceVoice *source = NULL;
-    UINT32 devId = 0;  /* 0 == system default device. */
-
-    static IXAudio2VoiceCallbackVtbl callbacks_vtable = {
-        VoiceCBOnVoiceProcessPassStart,
-        VoiceCBOnVoiceProcessPassEnd,
-        VoiceCBOnStreamEnd,
-        VoiceCBOnBufferStart,
-        VoiceCBOnBufferEnd,
-        VoiceCBOnLoopEnd,
-        VoiceCBOnVoiceError
-    };
-
-    static IXAudio2VoiceCallback callbacks = { &callbacks_vtable };
-
-    if (iscapture) {
-        return SDL_SetError("XAudio2: capture devices unsupported.");
-    } else if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) {
-        return SDL_SetError("XAudio2: XAudio2Create() failed at open.");
-    }
-
-    if (devname != NULL) {
-        UINT32 devcount = 0;
-        UINT32 i = 0;
-
-        if (IXAudio2_GetDeviceCount(ixa2, &devcount) != S_OK) {
-            IXAudio2_Release(ixa2);
-            return SDL_SetError("XAudio2: IXAudio2_GetDeviceCount() failed.");
-        }
-        for (i = 0; i < devcount; i++) {
-            XAUDIO2_DEVICE_DETAILS details;
-            if (IXAudio2_GetDeviceDetails(ixa2, i, &details) == S_OK) {
-                char *str = WIN_StringToUTF8(details.DisplayName);
-                if (str != NULL) {
-                    const int match = (SDL_strcmp(str, devname) == 0);
-                    SDL_free(str);
-                    if (match) {
-                        devId = i;
-                        break;
-                    }
-                }
-            }
-        }
-
-        if (i == devcount) {
-            IXAudio2_Release(ixa2);
-            return SDL_SetError("XAudio2: Requested device not found.");
-        }
-    }
-
-    /* Initialize all variables that we clean on shutdown */
-    this->hidden = (struct SDL_PrivateAudioData *)
-        SDL_malloc((sizeof *this->hidden));
-    if (this->hidden == NULL) {
-        IXAudio2_Release(ixa2);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
-    this->hidden->ixa2 = ixa2;
-    this->hidden->semaphore = CreateSemaphore(NULL, 1, 2, NULL);
-    if (this->hidden->semaphore == NULL) {
-        XAUDIO2_CloseDevice(this);
-        return SDL_SetError("XAudio2: CreateSemaphore() failed!");
-    }
-
-    while ((!valid_format) && (test_format)) {
-        switch (test_format) {
-        case AUDIO_U8:
-        case AUDIO_S16:
-        case AUDIO_S32:
-        case AUDIO_F32:
-            this->spec.format = test_format;
-            valid_format = 1;
-            break;
-        }
-        test_format = SDL_NextAudioFormat();
-    }
-
-    if (!valid_format) {
-        XAUDIO2_CloseDevice(this);
-        return SDL_SetError("XAudio2: Unsupported audio format");
-    }
-
-    /* Update the fragment size as size in bytes */
-    SDL_CalculateAudioSpec(&this->spec);
-
-    /* We feed a Source, it feeds the Mastering, which feeds the device. */
-    this->hidden->mixlen = this->spec.size;
-    this->hidden->mixbuf = (Uint8 *) SDL_malloc(2 * this->hidden->mixlen);
-    if (this->hidden->mixbuf == NULL) {
-        XAUDIO2_CloseDevice(this);
-        return SDL_OutOfMemory();
-    }
-    this->hidden->nextbuf = this->hidden->mixbuf;
-    SDL_memset(this->hidden->mixbuf, 0, 2 * this->hidden->mixlen);
-
-    /* We use XAUDIO2_DEFAULT_CHANNELS instead of this->spec.channels. On
-       Xbox360, this means 5.1 output, but on Windows, it means "figure out
-       what the system has." It might be preferable to let XAudio2 blast
-       stereo output to appropriate surround sound configurations
-       instead of clamping to 2 channels, even though we'll configure the
-       Source Voice for whatever number of channels you supply. */
-    result = IXAudio2_CreateMasteringVoice(ixa2, &this->hidden->mastering,
-                                           XAUDIO2_DEFAULT_CHANNELS,
-                                           this->spec.freq, 0, devId, NULL);
-    if (result != S_OK) {
-        XAUDIO2_CloseDevice(this);
-        return SDL_SetError("XAudio2: Couldn't create mastering voice");
-    }
-
-    SDL_zero(waveformat);
-    if (SDL_AUDIO_ISFLOAT(this->spec.format)) {
-        waveformat.wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
-    } else {
-        waveformat.wFormatTag = WAVE_FORMAT_PCM;
-    }
-    waveformat.wBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format);
-    waveformat.nChannels = this->spec.channels;
-    waveformat.nSamplesPerSec = this->spec.freq;
-    waveformat.nBlockAlign =
-        waveformat.nChannels * (waveformat.wBitsPerSample / 8);
-    waveformat.nAvgBytesPerSec =
-        waveformat.nSamplesPerSec * waveformat.nBlockAlign;
-
-    result = IXAudio2_CreateSourceVoice(ixa2, &source, &waveformat,
-                                        XAUDIO2_VOICE_NOSRC |
-                                        XAUDIO2_VOICE_NOPITCH,
-                                        1.0f, &callbacks, NULL, NULL);
-    if (result != S_OK) {
-        XAUDIO2_CloseDevice(this);
-        return SDL_SetError("XAudio2: Couldn't create source voice");
-    }
-    this->hidden->source = source;
-
-    /* Start everything playing! */
-    result = IXAudio2_StartEngine(ixa2);
-    if (result != S_OK) {
-        XAUDIO2_CloseDevice(this);
-        return SDL_SetError("XAudio2: Couldn't start engine");
-    }
-
-    result = IXAudio2SourceVoice_Start(source, 0, XAUDIO2_COMMIT_NOW);
-    if (result != S_OK) {
-        XAUDIO2_CloseDevice(this);
-        return SDL_SetError("XAudio2: Couldn't start source voice");
-    }
-
-    return 0; /* good to go. */
-}
-
-static void
-XAUDIO2_Deinitialize(void)
-{
-    WIN_CoUninitialize();
-}
-
-#endif  /* SDL_XAUDIO2_HAS_SDK */
-
-
-static int
-XAUDIO2_Init(SDL_AudioDriverImpl * impl)
-{
-#ifndef SDL_XAUDIO2_HAS_SDK
-    SDL_SetError("XAudio2: SDL was built without XAudio2 support (old DirectX SDK).");
-    return 0;  /* no XAudio2 support, ever. Update your SDK! */
-#else
-    /* XAudio2Create() is a macro that uses COM; we don't load the .dll */
-    IXAudio2 *ixa2 = NULL;
-    if (FAILED(WIN_CoInitialize())) {
-        SDL_SetError("XAudio2: CoInitialize() failed");
-        return 0;
-    }
-
-    if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) {
-        WIN_CoUninitialize();
-        SDL_SetError("XAudio2: XAudio2Create() failed at initialization");
-        return 0;  /* not available. */
-    }
-    IXAudio2_Release(ixa2);
-
-    /* Set the function pointers */
-    impl->DetectDevices = XAUDIO2_DetectDevices;
-    impl->OpenDevice = XAUDIO2_OpenDevice;
-    impl->PlayDevice = XAUDIO2_PlayDevice;
-    impl->WaitDevice = XAUDIO2_WaitDevice;
-    impl->WaitDone = XAUDIO2_WaitDone;
-    impl->GetDeviceBuf = XAUDIO2_GetDeviceBuf;
-    impl->CloseDevice = XAUDIO2_CloseDevice;
-    impl->Deinitialize = XAUDIO2_Deinitialize;
-
-    return 1;   /* this audio target is available. */
-#endif
-}
-
-AudioBootStrap XAUDIO2_bootstrap = {
-    "xaudio2", "XAudio2", XAUDIO2_Init, 0
-};
-
-#endif  /* SDL_AUDIO_DRIVER_XAUDIO2 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/core/android/SDL_android.c b/deps/SDL2/src/core/android/SDL_android.c
deleted file mode 100644
index 763715e..0000000
--- a/deps/SDL2/src/core/android/SDL_android.c
+++ /dev/null
@@ -1,1422 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-#include "SDL_stdinc.h"
-#include "SDL_assert.h"
-#include "SDL_log.h"
-
-#ifdef __ANDROID__
-
-#include "SDL_system.h"
-#include "SDL_android.h"
-#include <EGL/egl.h>
-
-#include "../../events/SDL_events_c.h"
-#include "../../video/android/SDL_androidkeyboard.h"
-#include "../../video/android/SDL_androidtouch.h"
-#include "../../video/android/SDL_androidvideo.h"
-#include "../../video/android/SDL_androidwindow.h"
-
-#include <android/log.h>
-#include <pthread.h>
-#include <sys/types.h>
-#include <unistd.h>
-#define LOG_TAG "SDL_android"
-/* #define LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) */
-/* #define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) */
-#define LOGI(...) do {} while (false)
-#define LOGE(...) do {} while (false)
-
-/* Uncomment this to log messages entering and exiting methods in this file */
-/* #define DEBUG_JNI */
-
-static void Android_JNI_ThreadDestroyed(void*);
-
-/*******************************************************************************
- This file links the Java side of Android with libsdl
-*******************************************************************************/
-#include <jni.h>
-#include <android/log.h>
-#include <stdbool.h>
-
-
-/*******************************************************************************
-                               Globals
-*******************************************************************************/
-static pthread_key_t mThreadKey;
-static JavaVM* mJavaVM;
-
-/* Main activity */
-static jclass mActivityClass;
-
-/* method signatures */
-static jmethodID midGetNativeSurface;
-static jmethodID midFlipBuffers;
-static jmethodID midAudioInit;
-static jmethodID midAudioWriteShortBuffer;
-static jmethodID midAudioWriteByteBuffer;
-static jmethodID midAudioQuit;
-
-/* Accelerometer data storage */
-static float fLastAccelerometer[3];
-static bool bHasNewData;
-
-/*******************************************************************************
-                 Functions called by JNI
-*******************************************************************************/
-
-/* Library init */
-jint JNI_OnLoad(JavaVM* vm, void* reserved)
-{
-    JNIEnv *env;
-    mJavaVM = vm;
-    LOGI("JNI_OnLoad called");
-    if ((*mJavaVM)->GetEnv(mJavaVM, (void**) &env, JNI_VERSION_1_4) != JNI_OK) {
-        LOGE("Failed to get the environment using GetEnv()");
-        return -1;
-    }
-    /*
-     * Create mThreadKey so we can keep track of the JNIEnv assigned to each thread
-     * Refer to http://developer.android.com/guide/practices/design/jni.html for the rationale behind this
-     */
-    if (pthread_key_create(&mThreadKey, Android_JNI_ThreadDestroyed)) {
-        __android_log_print(ANDROID_LOG_ERROR, "SDL", "Error initializing pthread key");
-    }
-    else {
-        Android_JNI_SetupThread();
-    }
-
-    return JNI_VERSION_1_4;
-}
-
-/* Called before SDL_main() to initialize JNI bindings */
-void SDL_Android_Init(JNIEnv* mEnv, jclass cls)
-{
-    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()");
-
-    Android_JNI_SetupThread();
-
-    mActivityClass = (jclass)((*mEnv)->NewGlobalRef(mEnv, cls));
-
-    midGetNativeSurface = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
-                                "getNativeSurface","()Landroid/view/Surface;");
-    midFlipBuffers = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
-                                "flipBuffers","()V");
-    midAudioInit = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
-                                "audioInit", "(IZZI)I");
-    midAudioWriteShortBuffer = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
-                                "audioWriteShortBuffer", "([S)V");
-    midAudioWriteByteBuffer = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
-                                "audioWriteByteBuffer", "([B)V");
-    midAudioQuit = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
-                                "audioQuit", "()V");
-
-    bHasNewData = false;
-
-    if(!midGetNativeSurface || !midFlipBuffers || !midAudioInit ||
-       !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit) {
-        __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly");
-    }
-    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init() finished!");
-}
-
-/* Resize */
-void Java_org_libsdl_app_SDLActivity_onNativeResize(
-                                    JNIEnv* env, jclass jcls,
-                                    jint width, jint height, jint format)
-{
-    Android_SetScreenResolution(width, height, format);
-}
-
-
-/* Surface Created */
-void Java_org_libsdl_app_SDLActivity_onNativeSurfaceChanged(JNIEnv* env, jclass jcls)
-{
-    SDL_WindowData *data;
-    SDL_VideoDevice *_this;
-
-    if (Android_Window == NULL || Android_Window->driverdata == NULL ) {
-        return;
-    }
-    
-    _this =  SDL_GetVideoDevice();
-    data =  (SDL_WindowData *) Android_Window->driverdata;
-    
-    /* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */
-    if (data->egl_surface == EGL_NO_SURFACE) {
-        if(data->native_window) {
-            ANativeWindow_release(data->native_window);
-        }
-        data->native_window = Android_JNI_GetNativeWindow();
-        data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->native_window);
-    }
-    
-    /* GL Context handling is done in the event loop because this function is run from the Java thread */
-    
-}
-
-/* Surface Destroyed */
-void Java_org_libsdl_app_SDLActivity_onNativeSurfaceDestroyed(JNIEnv* env, jclass jcls)
-{
-    /* We have to clear the current context and destroy the egl surface here
-     * Otherwise there's BAD_NATIVE_WINDOW errors coming from eglCreateWindowSurface on resume
-     * Ref: http://stackoverflow.com/questions/8762589/eglcreatewindowsurface-on-ics-and-switching-from-2d-to-3d
-     */
-    SDL_WindowData *data;
-    SDL_VideoDevice *_this;
-    
-    if (Android_Window == NULL || Android_Window->driverdata == NULL ) {
-        return;
-    }
-    
-    _this =  SDL_GetVideoDevice();
-    data = (SDL_WindowData *) Android_Window->driverdata;
-    
-    if (data->egl_surface != EGL_NO_SURFACE) {
-        SDL_EGL_MakeCurrent(_this, NULL, NULL);
-        SDL_EGL_DestroySurface(_this, data->egl_surface);
-        data->egl_surface = EGL_NO_SURFACE;
-    }
-    
-    /* GL Context handling is done in the event loop because this function is run from the Java thread */
-
-}
-
-void Java_org_libsdl_app_SDLActivity_nativeFlipBuffers(JNIEnv* env, jclass jcls)
-{
-    SDL_GL_SwapWindow(Android_Window);
-}
-
-/* Keydown */
-void Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
-                                    JNIEnv* env, jclass jcls, jint keycode)
-{
-    Android_OnKeyDown(keycode);
-}
-
-/* Keyup */
-void Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
-                                    JNIEnv* env, jclass jcls, jint keycode)
-{
-    Android_OnKeyUp(keycode);
-}
-
-/* Keyboard Focus Lost */
-void Java_org_libsdl_app_SDLActivity_onNativeKeyboardFocusLost(
-                                    JNIEnv* env, jclass jcls)
-{
-    /* Calling SDL_StopTextInput will take care of hiding the keyboard and cleaning up the DummyText widget */
-    SDL_StopTextInput();
-}
-
-
-/* Touch */
-void Java_org_libsdl_app_SDLActivity_onNativeTouch(
-                                    JNIEnv* env, jclass jcls,
-                                    jint touch_device_id_in, jint pointer_finger_id_in,
-                                    jint action, jfloat x, jfloat y, jfloat p)
-{
-    Android_OnTouch(touch_device_id_in, pointer_finger_id_in, action, x, y, p);
-}
-
-/* Accelerometer */
-void Java_org_libsdl_app_SDLActivity_onNativeAccel(
-                                    JNIEnv* env, jclass jcls,
-                                    jfloat x, jfloat y, jfloat z)
-{
-    fLastAccelerometer[0] = x;
-    fLastAccelerometer[1] = y;
-    fLastAccelerometer[2] = z;
-    bHasNewData = true;
-}
-
-/* Low memory */
-void Java_org_libsdl_app_SDLActivity_nativeLowMemory(
-                                    JNIEnv* env, jclass cls)
-{
-    SDL_SendAppEvent(SDL_APP_LOWMEMORY);
-}
-
-/* Quit */
-void Java_org_libsdl_app_SDLActivity_nativeQuit(
-                                    JNIEnv* env, jclass cls)
-{
-    /* Inject a SDL_QUIT event */
-    SDL_SendQuit();
-    SDL_SendAppEvent(SDL_APP_TERMINATING);
-}
-
-/* Pause */
-void Java_org_libsdl_app_SDLActivity_nativePause(
-                                    JNIEnv* env, jclass cls)
-{
-    if (Android_Window) {
-        /* Signal the pause semaphore so the event loop knows to pause and (optionally) block itself */
-        if (!SDL_SemValue(Android_PauseSem)) SDL_SemPost(Android_PauseSem);
-        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
-        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
-    }
-
-    __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativePause()");
-    SDL_SendAppEvent(SDL_APP_WILLENTERBACKGROUND);
-    SDL_SendAppEvent(SDL_APP_DIDENTERBACKGROUND);
-}
-
-/* Resume */
-void Java_org_libsdl_app_SDLActivity_nativeResume(
-                                    JNIEnv* env, jclass cls)
-{
-    __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()");
-    SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND);
-    SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND);
-
-    if (Android_Window) {
-        /* Signal the resume semaphore so the event loop knows to resume and restore the GL Context
-         * We can't restore the GL Context here because it needs to be done on the SDL main thread
-         * and this function will be called from the Java thread instead.
-         */
-        if (!SDL_SemValue(Android_ResumeSem)) SDL_SemPost(Android_ResumeSem);
-        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
-        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESTORED, 0, 0);
-    }
-}
-
-void Java_org_libsdl_app_SDLInputConnection_nativeCommitText(
-                                    JNIEnv* env, jclass cls,
-                                    jstring text, jint newCursorPosition)
-{
-    const char *utftext = (*env)->GetStringUTFChars(env, text, NULL);
-
-    SDL_SendKeyboardText(utftext);
-
-    (*env)->ReleaseStringUTFChars(env, text, utftext);
-}
-
-void Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText(
-                                    JNIEnv* env, jclass cls,
-                                    jstring text, jint newCursorPosition)
-{
-    const char *utftext = (*env)->GetStringUTFChars(env, text, NULL);
-
-    SDL_SendEditingText(utftext, 0, 0);
-
-    (*env)->ReleaseStringUTFChars(env, text, utftext);
-}
-
-
-
-/*******************************************************************************
-             Functions called by SDL into Java
-*******************************************************************************/
-
-static int s_active = 0;
-struct LocalReferenceHolder
-{
-    JNIEnv *m_env;
-    const char *m_func;
-};
-
-static struct LocalReferenceHolder LocalReferenceHolder_Setup(const char *func)
-{
-    struct LocalReferenceHolder refholder;
-    refholder.m_env = NULL;
-    refholder.m_func = func;
-#ifdef DEBUG_JNI
-    SDL_Log("Entering function %s", func);
-#endif
-    return refholder;
-}
-
-static SDL_bool LocalReferenceHolder_Init(struct LocalReferenceHolder *refholder, JNIEnv *env)
-{
-    const int capacity = 16;
-    if ((*env)->PushLocalFrame(env, capacity) < 0) {
-        SDL_SetError("Failed to allocate enough JVM local references");
-        return SDL_FALSE;
-    }
-    ++s_active;
-    refholder->m_env = env;
-    return SDL_TRUE;
-}
-
-static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder)
-{
-#ifdef DEBUG_JNI
-    SDL_Log("Leaving function %s", refholder->m_func);
-#endif
-    if (refholder->m_env) {
-        JNIEnv* env = refholder->m_env;
-        (*env)->PopLocalFrame(env, NULL);
-        --s_active;
-    }
-}
-
-static SDL_bool LocalReferenceHolder_IsActive()
-{
-    return s_active > 0;    
-}
-
-ANativeWindow* Android_JNI_GetNativeWindow(void)
-{
-    ANativeWindow* anw;
-    jobject s;
-    JNIEnv *env = Android_JNI_GetEnv();
-
-    s = (*env)->CallStaticObjectMethod(env, mActivityClass, midGetNativeSurface);
-    anw = ANativeWindow_fromSurface(env, s);
-    (*env)->DeleteLocalRef(env, s);
-  
-    return anw;
-}
-
-void Android_JNI_SwapWindow()
-{
-    JNIEnv *mEnv = Android_JNI_GetEnv();
-    (*mEnv)->CallStaticVoidMethod(mEnv, mActivityClass, midFlipBuffers);
-}
-
-void Android_JNI_SetActivityTitle(const char *title)
-{
-    jmethodID mid;
-    JNIEnv *mEnv = Android_JNI_GetEnv();
-    mid = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,"setActivityTitle","(Ljava/lang/String;)Z");
-    if (mid) {
-        jstring jtitle = (jstring)((*mEnv)->NewStringUTF(mEnv, title));
-        (*mEnv)->CallStaticBooleanMethod(mEnv, mActivityClass, mid, jtitle);
-        (*mEnv)->DeleteLocalRef(mEnv, jtitle);
-    }
-}
-
-SDL_bool Android_JNI_GetAccelerometerValues(float values[3])
-{
-    int i;
-    SDL_bool retval = SDL_FALSE;
-
-    if (bHasNewData) {
-        for (i = 0; i < 3; ++i) {
-            values[i] = fLastAccelerometer[i];
-        }
-        bHasNewData = false;
-        retval = SDL_TRUE;
-    }
-
-    return retval;
-}
-
-static void Android_JNI_ThreadDestroyed(void* value) {
-    /* The thread is being destroyed, detach it from the Java VM and set the mThreadKey value to NULL as required */
-    JNIEnv *env = (JNIEnv*) value;
-    if (env != NULL) {
-        (*mJavaVM)->DetachCurrentThread(mJavaVM);
-        pthread_setspecific(mThreadKey, NULL);
-    }
-}
-
-JNIEnv* Android_JNI_GetEnv(void) {
-    /* From http://developer.android.com/guide/practices/jni.html
-     * All threads are Linux threads, scheduled by the kernel.
-     * They're usually started from managed code (using Thread.start), but they can also be created elsewhere and then
-     * attached to the JavaVM. For example, a thread started with pthread_create can be attached with the
-     * JNI AttachCurrentThread or AttachCurrentThreadAsDaemon functions. Until a thread is attached, it has no JNIEnv,
-     * and cannot make JNI calls.
-     * Attaching a natively-created thread causes a java.lang.Thread object to be constructed and added to the "main"
-     * ThreadGroup, making it visible to the debugger. Calling AttachCurrentThread on an already-attached thread
-     * is a no-op.
-     * Note: You can call this function any number of times for the same thread, there's no harm in it
-     */
-
-    JNIEnv *env;
-    int status = (*mJavaVM)->AttachCurrentThread(mJavaVM, &env, NULL);
-    if(status < 0) {
-        LOGE("failed to attach current thread");
-        return 0;
-    }
-
-    return env;
-}
-
-int Android_JNI_SetupThread(void) {
-    /* From http://developer.android.com/guide/practices/jni.html
-     * Threads attached through JNI must call DetachCurrentThread before they exit. If coding this directly is awkward,
-     * in Android 2.0 (Eclair) and higher you can use pthread_key_create to define a destructor function that will be
-     * called before the thread exits, and call DetachCurrentThread from there. (Use that key with pthread_setspecific
-     * to store the JNIEnv in thread-local-storage; that way it'll be passed into your destructor as the argument.)
-     * Note: The destructor is not called unless the stored value is != NULL
-     * Note: You can call this function any number of times for the same thread, there's no harm in it
-     *       (except for some lost CPU cycles)
-     */
-    JNIEnv *env = Android_JNI_GetEnv();
-    pthread_setspecific(mThreadKey, (void*) env);
-    return 1;
-}
-
-/*
- * Audio support
- */
-static jboolean audioBuffer16Bit = JNI_FALSE;
-static jboolean audioBufferStereo = JNI_FALSE;
-static jobject audioBuffer = NULL;
-static void* audioBufferPinned = NULL;
-
-int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames)
-{
-    int audioBufferFrames;
-
-    JNIEnv *env = Android_JNI_GetEnv();
-
-    if (!env) {
-        LOGE("callback_handler: failed to attach current thread");
-    }
-    Android_JNI_SetupThread();
-
-    __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device");
-    audioBuffer16Bit = is16Bit;
-    audioBufferStereo = channelCount > 1;
-
-    if ((*env)->CallStaticIntMethod(env, mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames) != 0) {
-        /* Error during audio initialization */
-        __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: error on AudioTrack initialization!");
-        return 0;
-    }
-
-    /* Allocating the audio buffer from the Java side and passing it as the return value for audioInit no longer works on
-     * Android >= 4.2 due to a "stale global reference" error. So now we allocate this buffer directly from this side. */
-
-    if (is16Bit) {
-        jshortArray audioBufferLocal = (*env)->NewShortArray(env, desiredBufferFrames * (audioBufferStereo ? 2 : 1));
-        if (audioBufferLocal) {
-            audioBuffer = (*env)->NewGlobalRef(env, audioBufferLocal);
-            (*env)->DeleteLocalRef(env, audioBufferLocal);
-        }
-    }
-    else {
-        jbyteArray audioBufferLocal = (*env)->NewByteArray(env, desiredBufferFrames * (audioBufferStereo ? 2 : 1));
-        if (audioBufferLocal) {
-            audioBuffer = (*env)->NewGlobalRef(env, audioBufferLocal);
-            (*env)->DeleteLocalRef(env, audioBufferLocal);
-        }
-    }
-
-    if (audioBuffer == NULL) {
-        __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: could not allocate an audio buffer!");
-        return 0;
-    }
-
-    jboolean isCopy = JNI_FALSE;
-    if (audioBuffer16Bit) {
-        audioBufferPinned = (*env)->GetShortArrayElements(env, (jshortArray)audioBuffer, &isCopy);
-        audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)audioBuffer);
-    } else {
-        audioBufferPinned = (*env)->GetByteArrayElements(env, (jbyteArray)audioBuffer, &isCopy);
-        audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)audioBuffer);
-    }
-    if (audioBufferStereo) {
-        audioBufferFrames /= 2;
-    }
-
-    return audioBufferFrames;
-}
-
-void * Android_JNI_GetAudioBuffer()
-{
-    return audioBufferPinned;
-}
-
-void Android_JNI_WriteAudioBuffer()
-{
-    JNIEnv *mAudioEnv = Android_JNI_GetEnv();
-
-    if (audioBuffer16Bit) {
-        (*mAudioEnv)->ReleaseShortArrayElements(mAudioEnv, (jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT);
-        (*mAudioEnv)->CallStaticVoidMethod(mAudioEnv, mActivityClass, midAudioWriteShortBuffer, (jshortArray)audioBuffer);
-    } else {
-        (*mAudioEnv)->ReleaseByteArrayElements(mAudioEnv, (jbyteArray)audioBuffer, (jbyte *)audioBufferPinned, JNI_COMMIT);
-        (*mAudioEnv)->CallStaticVoidMethod(mAudioEnv, mActivityClass, midAudioWriteByteBuffer, (jbyteArray)audioBuffer);
-    }
-
-    /* JNI_COMMIT means the changes are committed to the VM but the buffer remains pinned */
-}
-
-void Android_JNI_CloseAudioDevice()
-{
-    JNIEnv *env = Android_JNI_GetEnv();
-
-    (*env)->CallStaticVoidMethod(env, mActivityClass, midAudioQuit);
-
-    if (audioBuffer) {
-        (*env)->DeleteGlobalRef(env, audioBuffer);
-        audioBuffer = NULL;
-        audioBufferPinned = NULL;
-    }
-}
-
-/* Test for an exception and call SDL_SetError with its detail if one occurs */
-/* If the parameter silent is truthy then SDL_SetError() will not be called. */
-static bool Android_JNI_ExceptionOccurred(bool silent)
-{
-    SDL_assert(LocalReferenceHolder_IsActive());
-    JNIEnv *mEnv = Android_JNI_GetEnv();
-
-    jthrowable exception = (*mEnv)->ExceptionOccurred(mEnv);
-    if (exception != NULL) {
-        jmethodID mid;
-
-        /* Until this happens most JNI operations have undefined behaviour */
-        (*mEnv)->ExceptionClear(mEnv);
-
-        if (!silent) {
-            jclass exceptionClass = (*mEnv)->GetObjectClass(mEnv, exception);
-            jclass classClass = (*mEnv)->FindClass(mEnv, "java/lang/Class");
-
-            mid = (*mEnv)->GetMethodID(mEnv, classClass, "getName", "()Ljava/lang/String;");
-            jstring exceptionName = (jstring)(*mEnv)->CallObjectMethod(mEnv, exceptionClass, mid);
-            const char* exceptionNameUTF8 = (*mEnv)->GetStringUTFChars(mEnv, exceptionName, 0);
-
-            mid = (*mEnv)->GetMethodID(mEnv, exceptionClass, "getMessage", "()Ljava/lang/String;");
-            jstring exceptionMessage = (jstring)(*mEnv)->CallObjectMethod(mEnv, exception, mid);
-
-            if (exceptionMessage != NULL) {
-                const char* exceptionMessageUTF8 = (*mEnv)->GetStringUTFChars(mEnv, exceptionMessage, 0);
-                SDL_SetError("%s: %s", exceptionNameUTF8, exceptionMessageUTF8);
-                (*mEnv)->ReleaseStringUTFChars(mEnv, exceptionMessage, exceptionMessageUTF8);
-            } else {
-                SDL_SetError("%s", exceptionNameUTF8);
-            }
-
-            (*mEnv)->ReleaseStringUTFChars(mEnv, exceptionName, exceptionNameUTF8);
-        }
-
-        return true;
-    }
-
-    return false;
-}
-
-static int Internal_Android_JNI_FileOpen(SDL_RWops* ctx)
-{
-    struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
-
-    int result = 0;
-
-    jmethodID mid;
-    jobject context;
-    jobject assetManager;
-    jobject inputStream;
-    jclass channels;
-    jobject readableByteChannel;
-    jstring fileNameJString;
-    jobject fd;
-    jclass fdCls;
-    jfieldID descriptor;
-
-    JNIEnv *mEnv = Android_JNI_GetEnv();
-    if (!LocalReferenceHolder_Init(&refs, mEnv)) {
-        goto failure;
-    }
-
-    fileNameJString = (jstring)ctx->hidden.androidio.fileNameRef;
-    ctx->hidden.androidio.position = 0;
-
-    /* context = SDLActivity.getContext(); */
-    mid = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
-            "getContext","()Landroid/content/Context;");
-    context = (*mEnv)->CallStaticObjectMethod(mEnv, mActivityClass, mid);
-
-
-    /* assetManager = context.getAssets(); */
-    mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, context),
-            "getAssets", "()Landroid/content/res/AssetManager;");
-    assetManager = (*mEnv)->CallObjectMethod(mEnv, context, mid);
-
-    /* First let's try opening the file to obtain an AssetFileDescriptor.
-    * This method reads the files directly from the APKs using standard *nix calls
-    */
-    mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, assetManager), "openFd", "(Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;");
-    inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString);
-    if (Android_JNI_ExceptionOccurred(true)) {
-        goto fallback;
-    }
-
-    mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getStartOffset", "()J");
-    ctx->hidden.androidio.offset = (*mEnv)->CallLongMethod(mEnv, inputStream, mid);
-    if (Android_JNI_ExceptionOccurred(true)) {
-        goto fallback;
-    }
-
-    mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getDeclaredLength", "()J");
-    ctx->hidden.androidio.size = (*mEnv)->CallLongMethod(mEnv, inputStream, mid);
-    if (Android_JNI_ExceptionOccurred(true)) {
-        goto fallback;
-    }
-
-    mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getFileDescriptor", "()Ljava/io/FileDescriptor;");
-    fd = (*mEnv)->CallObjectMethod(mEnv, inputStream, mid);
-    fdCls = (*mEnv)->GetObjectClass(mEnv, fd);
-    descriptor = (*mEnv)->GetFieldID(mEnv, fdCls, "descriptor", "I");
-    ctx->hidden.androidio.fd = (*mEnv)->GetIntField(mEnv, fd, descriptor);
-    ctx->hidden.androidio.assetFileDescriptorRef = (*mEnv)->NewGlobalRef(mEnv, inputStream);
-
-    /* Seek to the correct offset in the file. */
-    lseek(ctx->hidden.androidio.fd, (off_t)ctx->hidden.androidio.offset, SEEK_SET);
-
-    if (false) {
-fallback:
-        /* Disabled log message because of spam on the Nexus 7 */
-        /* __android_log_print(ANDROID_LOG_DEBUG, "SDL", "Falling back to legacy InputStream method for opening file"); */
-
-        /* Try the old method using InputStream */
-        ctx->hidden.androidio.assetFileDescriptorRef = NULL;
-
-        /* inputStream = assetManager.open(<filename>); */
-        mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, assetManager),
-                "open", "(Ljava/lang/String;I)Ljava/io/InputStream;");
-        inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString, 1 /* ACCESS_RANDOM */);
-        if (Android_JNI_ExceptionOccurred(false)) {
-            goto failure;
-        }
-
-        ctx->hidden.androidio.inputStreamRef = (*mEnv)->NewGlobalRef(mEnv, inputStream);
-
-        /* Despite all the visible documentation on [Asset]InputStream claiming
-         * that the .available() method is not guaranteed to return the entire file
-         * size, comments in <sdk>/samples/<ver>/ApiDemos/src/com/example/ ...
-         * android/apis/content/ReadAsset.java imply that Android's
-         * AssetInputStream.available() /will/ always return the total file size
-        */
-        
-        /* size = inputStream.available(); */
-        mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream),
-                "available", "()I");
-        ctx->hidden.androidio.size = (long)(*mEnv)->CallIntMethod(mEnv, inputStream, mid);
-        if (Android_JNI_ExceptionOccurred(false)) {
-            goto failure;
-        }
-
-        /* readableByteChannel = Channels.newChannel(inputStream); */
-        channels = (*mEnv)->FindClass(mEnv, "java/nio/channels/Channels");
-        mid = (*mEnv)->GetStaticMethodID(mEnv, channels,
-                "newChannel",
-                "(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;");
-        readableByteChannel = (*mEnv)->CallStaticObjectMethod(
-                mEnv, channels, mid, inputStream);
-        if (Android_JNI_ExceptionOccurred(false)) {
-            goto failure;
-        }
-
-        ctx->hidden.androidio.readableByteChannelRef =
-            (*mEnv)->NewGlobalRef(mEnv, readableByteChannel);
-
-        /* Store .read id for reading purposes */
-        mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, readableByteChannel),
-                "read", "(Ljava/nio/ByteBuffer;)I");
-        ctx->hidden.androidio.readMethod = mid;
-    }
-
-    if (false) {
-failure:
-        result = -1;
-
-        (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.fileNameRef);
-
-        if(ctx->hidden.androidio.inputStreamRef != NULL) {
-            (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.inputStreamRef);
-        }
-
-        if(ctx->hidden.androidio.readableByteChannelRef != NULL) {
-            (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.readableByteChannelRef);
-        }
-
-        if(ctx->hidden.androidio.assetFileDescriptorRef != NULL) {
-            (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.assetFileDescriptorRef);
-        }
-
-    }
-    
-    LocalReferenceHolder_Cleanup(&refs);
-    return result;
-}
-
-int Android_JNI_FileOpen(SDL_RWops* ctx,
-        const char* fileName, const char* mode)
-{
-    struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
-    JNIEnv *mEnv = Android_JNI_GetEnv();
-    int retval;
-
-    if (!LocalReferenceHolder_Init(&refs, mEnv)) {
-        LocalReferenceHolder_Cleanup(&refs);        
-        return -1;
-    }
-
-    if (!ctx) {
-        LocalReferenceHolder_Cleanup(&refs);
-        return -1;
-    }
-
-    jstring fileNameJString = (*mEnv)->NewStringUTF(mEnv, fileName);
-    ctx->hidden.androidio.fileNameRef = (*mEnv)->NewGlobalRef(mEnv, fileNameJString);
-    ctx->hidden.androidio.inputStreamRef = NULL;
-    ctx->hidden.androidio.readableByteChannelRef = NULL;
-    ctx->hidden.androidio.readMethod = NULL;
-    ctx->hidden.androidio.assetFileDescriptorRef = NULL;
-
-    retval = Internal_Android_JNI_FileOpen(ctx);
-    LocalReferenceHolder_Cleanup(&refs);
-    return retval;
-}
-
-size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer,
-        size_t size, size_t maxnum)
-{
-    struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
-
-    if (ctx->hidden.androidio.assetFileDescriptorRef) {
-        size_t bytesMax = size * maxnum;
-        if (ctx->hidden.androidio.size != -1 /* UNKNOWN_LENGTH */ && ctx->hidden.androidio.position + bytesMax > ctx->hidden.androidio.size) {
-            bytesMax = ctx->hidden.androidio.size - ctx->hidden.androidio.position;
-        }
-        size_t result = read(ctx->hidden.androidio.fd, buffer, bytesMax );
-        if (result > 0) {
-            ctx->hidden.androidio.position += result;
-            LocalReferenceHolder_Cleanup(&refs);
-            return result / size;
-        }
-        LocalReferenceHolder_Cleanup(&refs);
-        return 0;
-    } else {
-        jlong bytesRemaining = (jlong) (size * maxnum);
-        jlong bytesMax = (jlong) (ctx->hidden.androidio.size -  ctx->hidden.androidio.position);
-        int bytesRead = 0;
-
-        /* Don't read more bytes than those that remain in the file, otherwise we get an exception */
-        if (bytesRemaining >  bytesMax) bytesRemaining = bytesMax;
-
-        JNIEnv *mEnv = Android_JNI_GetEnv();
-        if (!LocalReferenceHolder_Init(&refs, mEnv)) {
-            LocalReferenceHolder_Cleanup(&refs);            
-            return 0;
-        }
-
-        jobject readableByteChannel = (jobject)ctx->hidden.androidio.readableByteChannelRef;
-        jmethodID readMethod = (jmethodID)ctx->hidden.androidio.readMethod;
-        jobject byteBuffer = (*mEnv)->NewDirectByteBuffer(mEnv, buffer, bytesRemaining);
-
-        while (bytesRemaining > 0) {
-            /* result = readableByteChannel.read(...); */
-            int result = (*mEnv)->CallIntMethod(mEnv, readableByteChannel, readMethod, byteBuffer);
-
-            if (Android_JNI_ExceptionOccurred(false)) {
-                LocalReferenceHolder_Cleanup(&refs);            
-                return 0;
-            }
-
-            if (result < 0) {
-                break;
-            }
-
-            bytesRemaining -= result;
-            bytesRead += result;
-            ctx->hidden.androidio.position += result;
-        }
-        LocalReferenceHolder_Cleanup(&refs);                    
-        return bytesRead / size;
-    }
-}
-
-size_t Android_JNI_FileWrite(SDL_RWops* ctx, const void* buffer,
-        size_t size, size_t num)
-{
-    SDL_SetError("Cannot write to Android package filesystem");
-    return 0;
-}
-
-static int Internal_Android_JNI_FileClose(SDL_RWops* ctx, bool release)
-{
-    struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
-
-    int result = 0;
-    JNIEnv *mEnv = Android_JNI_GetEnv();
-
-    if (!LocalReferenceHolder_Init(&refs, mEnv)) {
-        LocalReferenceHolder_Cleanup(&refs);
-        return SDL_SetError("Failed to allocate enough JVM local references");
-    }
-
-    if (ctx) {
-        if (release) {
-            (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.fileNameRef);
-        }
-
-        if (ctx->hidden.androidio.assetFileDescriptorRef) {
-            jobject inputStream = (jobject)ctx->hidden.androidio.assetFileDescriptorRef;
-            jmethodID mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream),
-                    "close", "()V");
-            (*mEnv)->CallVoidMethod(mEnv, inputStream, mid);
-            (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.assetFileDescriptorRef);
-            if (Android_JNI_ExceptionOccurred(false)) {
-                result = -1;
-            }
-        }
-        else {
-            jobject inputStream = (jobject)ctx->hidden.androidio.inputStreamRef;
-
-            /* inputStream.close(); */
-            jmethodID mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream),
-                    "close", "()V");
-            (*mEnv)->CallVoidMethod(mEnv, inputStream, mid);
-            (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.inputStreamRef);
-            (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.readableByteChannelRef);
-            if (Android_JNI_ExceptionOccurred(false)) {
-                result = -1;
-            }
-        }
-
-        if (release) {
-            SDL_FreeRW(ctx);
-        }
-    }
-
-    LocalReferenceHolder_Cleanup(&refs);
-    return result;
-}
-
-
-Sint64 Android_JNI_FileSize(SDL_RWops* ctx)
-{
-    return ctx->hidden.androidio.size;
-}
-
-Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence)
-{
-    if (ctx->hidden.androidio.assetFileDescriptorRef) {
-        switch (whence) {
-            case RW_SEEK_SET:
-                if (ctx->hidden.androidio.size != -1 /* UNKNOWN_LENGTH */ && offset > ctx->hidden.androidio.size) offset = ctx->hidden.androidio.size;
-                offset += ctx->hidden.androidio.offset;
-                break;
-            case RW_SEEK_CUR:
-                offset += ctx->hidden.androidio.position;
-                if (ctx->hidden.androidio.size != -1 /* UNKNOWN_LENGTH */ && offset > ctx->hidden.androidio.size) offset = ctx->hidden.androidio.size;
-                offset += ctx->hidden.androidio.offset;
-                break;
-            case RW_SEEK_END:
-                offset = ctx->hidden.androidio.offset + ctx->hidden.androidio.size + offset;
-                break;
-            default:
-                return SDL_SetError("Unknown value for 'whence'");
-        }
-        whence = SEEK_SET;
-
-        off_t ret = lseek(ctx->hidden.androidio.fd, (off_t)offset, SEEK_SET);
-        if (ret == -1) return -1;
-        ctx->hidden.androidio.position = ret - ctx->hidden.androidio.offset;
-    } else {
-        Sint64 newPosition;
-
-        switch (whence) {
-            case RW_SEEK_SET:
-                newPosition = offset;
-                break;
-            case RW_SEEK_CUR:
-                newPosition = ctx->hidden.androidio.position + offset;
-                break;
-            case RW_SEEK_END:
-                newPosition = ctx->hidden.androidio.size + offset;
-                break;
-            default:
-                return SDL_SetError("Unknown value for 'whence'");
-        }
-
-        /* Validate the new position */
-        if (newPosition < 0) {
-            return SDL_Error(SDL_EFSEEK);
-        }
-        if (newPosition > ctx->hidden.androidio.size) {
-            newPosition = ctx->hidden.androidio.size;
-        }
-
-        Sint64 movement = newPosition - ctx->hidden.androidio.position;
-        if (movement > 0) {
-            unsigned char buffer[4096];
-
-            /* The easy case where we're seeking forwards */
-            while (movement > 0) {
-                Sint64 amount = sizeof (buffer);
-                if (amount > movement) {
-                    amount = movement;
-                }
-                size_t result = Android_JNI_FileRead(ctx, buffer, 1, amount);
-                if (result <= 0) {
-                    /* Failed to read/skip the required amount, so fail */
-                    return -1;
-                }
-
-                movement -= result;
-            }
-
-        } else if (movement < 0) {
-            /* We can't seek backwards so we have to reopen the file and seek */
-            /* forwards which obviously isn't very efficient */
-            Internal_Android_JNI_FileClose(ctx, false);
-            Internal_Android_JNI_FileOpen(ctx);
-            Android_JNI_FileSeek(ctx, newPosition, RW_SEEK_SET);
-        }
-    }
-
-    return ctx->hidden.androidio.position;
-
-}
-
-int Android_JNI_FileClose(SDL_RWops* ctx)
-{
-    return Internal_Android_JNI_FileClose(ctx, true);
-}
-
-/* returns a new global reference which needs to be released later */
-static jobject Android_JNI_GetSystemServiceObject(const char* name)
-{
-    struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
-    JNIEnv* env = Android_JNI_GetEnv();
-    jobject retval = NULL;
-
-    if (!LocalReferenceHolder_Init(&refs, env)) {
-        LocalReferenceHolder_Cleanup(&refs);
-        return NULL;
-    }
-
-    jstring service = (*env)->NewStringUTF(env, name);
-
-    jmethodID mid;
-
-    mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;");
-    jobject context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid);
-
-    mid = (*env)->GetMethodID(env, mActivityClass, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;");
-    jobject manager = (*env)->CallObjectMethod(env, context, mid, service);
-
-    (*env)->DeleteLocalRef(env, service);
-
-    retval = manager ? (*env)->NewGlobalRef(env, manager) : NULL;
-    LocalReferenceHolder_Cleanup(&refs);
-    return retval;
-}
-
-#define SETUP_CLIPBOARD(error) \
-    struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); \
-    JNIEnv* env = Android_JNI_GetEnv(); \
-    if (!LocalReferenceHolder_Init(&refs, env)) { \
-        LocalReferenceHolder_Cleanup(&refs); \
-        return error; \
-    } \
-    jobject clipboard = Android_JNI_GetSystemServiceObject("clipboard"); \
-    if (!clipboard) { \
-        LocalReferenceHolder_Cleanup(&refs); \
-        return error; \
-    }
-
-#define CLEANUP_CLIPBOARD() \
-    LocalReferenceHolder_Cleanup(&refs);
-
-int Android_JNI_SetClipboardText(const char* text)
-{
-    SETUP_CLIPBOARD(-1)
-
-    jmethodID mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, clipboard), "setText", "(Ljava/lang/CharSequence;)V");
-    jstring string = (*env)->NewStringUTF(env, text);
-    (*env)->CallVoidMethod(env, clipboard, mid, string);
-    (*env)->DeleteGlobalRef(env, clipboard);
-    (*env)->DeleteLocalRef(env, string);
-
-    CLEANUP_CLIPBOARD();
-
-    return 0;
-}
-
-char* Android_JNI_GetClipboardText()
-{
-    SETUP_CLIPBOARD(SDL_strdup(""))
-
-    jmethodID mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, clipboard), "getText", "()Ljava/lang/CharSequence;");
-    jobject sequence = (*env)->CallObjectMethod(env, clipboard, mid);
-    (*env)->DeleteGlobalRef(env, clipboard);
-    if (sequence) {
-        mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, sequence), "toString", "()Ljava/lang/String;");
-        jstring string = (jstring)((*env)->CallObjectMethod(env, sequence, mid));
-        const char* utf = (*env)->GetStringUTFChars(env, string, 0);
-        if (utf) {
-            char* text = SDL_strdup(utf);
-            (*env)->ReleaseStringUTFChars(env, string, utf);
-
-            CLEANUP_CLIPBOARD();
-
-            return text;
-        }
-    }
-
-    CLEANUP_CLIPBOARD();    
-
-    return SDL_strdup("");
-}
-
-SDL_bool Android_JNI_HasClipboardText()
-{
-    SETUP_CLIPBOARD(SDL_FALSE)
-
-    jmethodID mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, clipboard), "hasText", "()Z");
-    jboolean has = (*env)->CallBooleanMethod(env, clipboard, mid);
-    (*env)->DeleteGlobalRef(env, clipboard);
-
-    CLEANUP_CLIPBOARD();
-    
-    return has ? SDL_TRUE : SDL_FALSE;
-}
-
-
-/* returns 0 on success or -1 on error (others undefined then)
- * returns truthy or falsy value in plugged, charged and battery
- * returns the value in seconds and percent or -1 if not available
- */
-int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent)
-{
-    struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
-    JNIEnv* env = Android_JNI_GetEnv();
-    if (!LocalReferenceHolder_Init(&refs, env)) {
-        LocalReferenceHolder_Cleanup(&refs);
-        return -1;
-    }
-
-    jmethodID mid;
-
-    mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;");
-    jobject context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid);
-
-    jstring action = (*env)->NewStringUTF(env, "android.intent.action.BATTERY_CHANGED");
-
-    jclass cls = (*env)->FindClass(env, "android/content/IntentFilter");
-
-    mid = (*env)->GetMethodID(env, cls, "<init>", "(Ljava/lang/String;)V");
-    jobject filter = (*env)->NewObject(env, cls, mid, action);
-
-    (*env)->DeleteLocalRef(env, action);
-
-    mid = (*env)->GetMethodID(env, mActivityClass, "registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;");
-    jobject intent = (*env)->CallObjectMethod(env, context, mid, NULL, filter);
-
-    (*env)->DeleteLocalRef(env, filter);
-
-    cls = (*env)->GetObjectClass(env, intent);
-
-    jstring iname;
-    jmethodID imid = (*env)->GetMethodID(env, cls, "getIntExtra", "(Ljava/lang/String;I)I");
-
-#define GET_INT_EXTRA(var, key) \
-    iname = (*env)->NewStringUTF(env, key); \
-    int var = (*env)->CallIntMethod(env, intent, imid, iname, -1); \
-    (*env)->DeleteLocalRef(env, iname);
-
-    jstring bname;
-    jmethodID bmid = (*env)->GetMethodID(env, cls, "getBooleanExtra", "(Ljava/lang/String;Z)Z");
-
-#define GET_BOOL_EXTRA(var, key) \
-    bname = (*env)->NewStringUTF(env, key); \
-    int var = (*env)->CallBooleanMethod(env, intent, bmid, bname, JNI_FALSE); \
-    (*env)->DeleteLocalRef(env, bname);
-
-    if (plugged) {
-        GET_INT_EXTRA(plug, "plugged") /* == BatteryManager.EXTRA_PLUGGED (API 5) */
-        if (plug == -1) {
-            LocalReferenceHolder_Cleanup(&refs);
-            return -1;
-        }
-        /* 1 == BatteryManager.BATTERY_PLUGGED_AC */
-        /* 2 == BatteryManager.BATTERY_PLUGGED_USB */
-        *plugged = (0 < plug) ? 1 : 0;
-    }
-
-    if (charged) {
-        GET_INT_EXTRA(status, "status") /* == BatteryManager.EXTRA_STATUS (API 5) */
-        if (status == -1) {
-            LocalReferenceHolder_Cleanup(&refs);
-            return -1;
-        }
-        /* 5 == BatteryManager.BATTERY_STATUS_FULL */
-        *charged = (status == 5) ? 1 : 0;
-    }
-
-    if (battery) {
-        GET_BOOL_EXTRA(present, "present") /* == BatteryManager.EXTRA_PRESENT (API 5) */
-        *battery = present ? 1 : 0;
-    }
-
-    if (seconds) {
-        *seconds = -1; /* not possible */
-    }
-
-    if (percent) {
-        GET_INT_EXTRA(level, "level") /* == BatteryManager.EXTRA_LEVEL (API 5) */
-        GET_INT_EXTRA(scale, "scale") /* == BatteryManager.EXTRA_SCALE (API 5) */
-        if ((level == -1) || (scale == -1)) {
-            LocalReferenceHolder_Cleanup(&refs);
-            return -1;
-        }
-        *percent = level * 100 / scale;
-    }
-
-    (*env)->DeleteLocalRef(env, intent);
-
-    LocalReferenceHolder_Cleanup(&refs);
-    return 0;
-}
-
-/* returns number of found touch devices as return value and ids in parameter ids */
-int Android_JNI_GetTouchDeviceIds(int **ids) {
-    JNIEnv *env = Android_JNI_GetEnv();
-    jint sources = 4098; /* == InputDevice.SOURCE_TOUCHSCREEN */
-    jmethodID mid = (*env)->GetStaticMethodID(env, mActivityClass, "inputGetInputDeviceIds", "(I)[I");
-    jintArray array = (jintArray) (*env)->CallStaticObjectMethod(env, mActivityClass, mid, sources);
-    int number = 0;
-    *ids = NULL;
-    if (array) {
-        number = (int) (*env)->GetArrayLength(env, array);
-        if (0 < number) {
-            jint* elements = (*env)->GetIntArrayElements(env, array, NULL);
-            if (elements) {
-                int i;
-                *ids = SDL_malloc(number * sizeof (**ids));
-                for (i = 0; i < number; ++i) { /* not assuming sizeof (jint) == sizeof (int) */
-                    (*ids)[i] = elements[i];
-                }
-                (*env)->ReleaseIntArrayElements(env, array, elements, JNI_ABORT);
-            }
-        }
-        (*env)->DeleteLocalRef(env, array);
-    }
-    return number;
-}
-
-/* sends message to be handled on the UI event dispatch thread */
-int Android_JNI_SendMessage(int command, int param)
-{
-    JNIEnv *env = Android_JNI_GetEnv();
-    if (!env) {
-        return -1;
-    }
-    jmethodID mid = (*env)->GetStaticMethodID(env, mActivityClass, "sendMessage", "(II)Z");
-    if (!mid) {
-        return -1;
-    }
-    jboolean success = (*env)->CallStaticBooleanMethod(env, mActivityClass, mid, command, param);
-    return success ? 0 : -1;
-}
-
-void Android_JNI_ShowTextInput(SDL_Rect *inputRect)
-{
-    JNIEnv *env = Android_JNI_GetEnv();
-    if (!env) {
-        return;
-    }
-
-    jmethodID mid = (*env)->GetStaticMethodID(env, mActivityClass, "showTextInput", "(IIII)Z");
-    if (!mid) {
-        return;
-    }
-    (*env)->CallStaticBooleanMethod(env, mActivityClass, mid,
-                               inputRect->x,
-                               inputRect->y,
-                               inputRect->w,
-                               inputRect->h );
-}
-
-void Android_JNI_HideTextInput()
-{
-    /* has to match Activity constant */
-    const int COMMAND_TEXTEDIT_HIDE = 3;
-    Android_JNI_SendMessage(COMMAND_TEXTEDIT_HIDE, 0);
-}
-
-/*
-//////////////////////////////////////////////////////////////////////////////
-//
-// Functions exposed to SDL applications in SDL_system.h
-//////////////////////////////////////////////////////////////////////////////
-*/
-
-void *SDL_AndroidGetJNIEnv()
-{
-    return Android_JNI_GetEnv();
-}
-
-
-
-void *SDL_AndroidGetActivity()
-{
-    /* See SDL_system.h for caveats on using this function. */
-
-    jmethodID mid;
-
-    JNIEnv *env = Android_JNI_GetEnv();
-    if (!env) {
-        return NULL;
-    }
-
-    /* return SDLActivity.getContext(); */
-    mid = (*env)->GetStaticMethodID(env, mActivityClass,
-            "getContext","()Landroid/content/Context;");
-    return (*env)->CallStaticObjectMethod(env, mActivityClass, mid);
-}
-
-const char * SDL_AndroidGetInternalStoragePath()
-{
-    static char *s_AndroidInternalFilesPath = NULL;
-
-    if (!s_AndroidInternalFilesPath) {
-        struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
-        jmethodID mid;
-        jobject context;
-        jobject fileObject;
-        jstring pathString;
-        const char *path;
-
-        JNIEnv *env = Android_JNI_GetEnv();
-        if (!LocalReferenceHolder_Init(&refs, env)) {
-            LocalReferenceHolder_Cleanup(&refs);
-            return NULL;
-        }
-
-        /* context = SDLActivity.getContext(); */
-        mid = (*env)->GetStaticMethodID(env, mActivityClass,
-                "getContext","()Landroid/content/Context;");
-        context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid);
-
-        /* fileObj = context.getFilesDir(); */
-        mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context),
-                "getFilesDir", "()Ljava/io/File;");
-        fileObject = (*env)->CallObjectMethod(env, context, mid);
-        if (!fileObject) {
-            SDL_SetError("Couldn't get internal directory");
-            LocalReferenceHolder_Cleanup(&refs);
-            return NULL;
-        }
-
-        /* path = fileObject.getAbsolutePath(); */
-        mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject),
-                "getAbsolutePath", "()Ljava/lang/String;");
-        pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid);
-
-        path = (*env)->GetStringUTFChars(env, pathString, NULL);
-        s_AndroidInternalFilesPath = SDL_strdup(path);
-        (*env)->ReleaseStringUTFChars(env, pathString, path);
-
-        LocalReferenceHolder_Cleanup(&refs);
-    }
-    return s_AndroidInternalFilesPath;
-}
-
-int SDL_AndroidGetExternalStorageState()
-{
-    struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
-    jmethodID mid;
-    jclass cls;
-    jstring stateString;
-    const char *state;
-    int stateFlags;
-
-    JNIEnv *env = Android_JNI_GetEnv();
-    if (!LocalReferenceHolder_Init(&refs, env)) {
-        LocalReferenceHolder_Cleanup(&refs);
-        return 0;
-    }
-
-    cls = (*env)->FindClass(env, "android/os/Environment");
-    mid = (*env)->GetStaticMethodID(env, cls,
-            "getExternalStorageState", "()Ljava/lang/String;");
-    stateString = (jstring)(*env)->CallStaticObjectMethod(env, cls, mid);
-
-    state = (*env)->GetStringUTFChars(env, stateString, NULL);
-
-    /* Print an info message so people debugging know the storage state */
-    __android_log_print(ANDROID_LOG_INFO, "SDL", "external storage state: %s", state);
-
-    if (SDL_strcmp(state, "mounted") == 0) {
-        stateFlags = SDL_ANDROID_EXTERNAL_STORAGE_READ |
-                     SDL_ANDROID_EXTERNAL_STORAGE_WRITE;
-    } else if (SDL_strcmp(state, "mounted_ro") == 0) {
-        stateFlags = SDL_ANDROID_EXTERNAL_STORAGE_READ;
-    } else {
-        stateFlags = 0;
-    }
-    (*env)->ReleaseStringUTFChars(env, stateString, state);
-
-    LocalReferenceHolder_Cleanup(&refs);
-    return stateFlags;
-}
-
-const char * SDL_AndroidGetExternalStoragePath()
-{
-    static char *s_AndroidExternalFilesPath = NULL;
-
-    if (!s_AndroidExternalFilesPath) {
-        struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
-        jmethodID mid;
-        jobject context;
-        jobject fileObject;
-        jstring pathString;
-        const char *path;
-
-        JNIEnv *env = Android_JNI_GetEnv();
-        if (!LocalReferenceHolder_Init(&refs, env)) {
-            LocalReferenceHolder_Cleanup(&refs);
-            return NULL;
-        }
-
-        /* context = SDLActivity.getContext(); */
-        mid = (*env)->GetStaticMethodID(env, mActivityClass,
-                "getContext","()Landroid/content/Context;");
-        context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid);
-
-        /* fileObj = context.getExternalFilesDir(); */
-        mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context),
-                "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;");
-        fileObject = (*env)->CallObjectMethod(env, context, mid, NULL);
-        if (!fileObject) {
-            SDL_SetError("Couldn't get external directory");
-            LocalReferenceHolder_Cleanup(&refs);
-            return NULL;
-        }
-
-        /* path = fileObject.getAbsolutePath(); */
-        mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject),
-                "getAbsolutePath", "()Ljava/lang/String;");
-        pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid);
-
-        path = (*env)->GetStringUTFChars(env, pathString, NULL);
-        s_AndroidExternalFilesPath = SDL_strdup(path);
-        (*env)->ReleaseStringUTFChars(env, pathString, path);
-
-        LocalReferenceHolder_Cleanup(&refs);
-    }
-    return s_AndroidExternalFilesPath;
-}
-
-#endif /* __ANDROID__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/deps/SDL2/src/core/android/SDL_android.h b/deps/SDL2/src/core/android/SDL_android.h
deleted file mode 100644
index 6181a15..0000000
--- a/deps/SDL2/src/core/android/SDL_android.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-/* *INDENT-OFF* */
-extern "C" {
-/* *INDENT-ON* */
-#endif
-
-#include <EGL/eglplatform.h>
-#include <android/native_window_jni.h>
-
-#include "SDL_rect.h"
-
-/* Interface from the SDL library into the Android Java activity */
-/* extern SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion, int red, int green, int blue, int alpha, int buffer, int depth, int stencil, int buffers, int samples);
-extern SDL_bool Android_JNI_DeleteContext(void); */
-extern void Android_JNI_SwapWindow();
-extern void Android_JNI_SetActivityTitle(const char *title);
-extern SDL_bool Android_JNI_GetAccelerometerValues(float values[3]);
-extern void Android_JNI_ShowTextInput(SDL_Rect *inputRect);
-extern void Android_JNI_HideTextInput();
-extern ANativeWindow* Android_JNI_GetNativeWindow(void);
-
-/* Audio support */
-extern int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames);
-extern void* Android_JNI_GetAudioBuffer();
-extern void Android_JNI_WriteAudioBuffer();
-extern void Android_JNI_CloseAudioDevice();
-
-#include "SDL_rwops.h"
-
-int Android_JNI_FileOpen(SDL_RWops* ctx, const char* fileName, const char* mode);
-Sint64 Android_JNI_FileSize(SDL_RWops* ctx);
-Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence);
-size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, size_t size, size_t maxnum);
-size_t Android_JNI_FileWrite(SDL_RWops* ctx, const void* buffer, size_t size, size_t num);
-int Android_JNI_FileClose(SDL_RWops* ctx);
-
-/* Clipboard support */
-int Android_JNI_SetClipboardText(const char* text);
-char* Android_JNI_GetClipboardText();
-SDL_bool Android_JNI_HasClipboardText();
-
-/* Power support */
-int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent);
-
-/* Touch support */
-int Android_JNI_GetTouchDeviceIds(int **ids);
-
-/* Threads */
-#include <jni.h>
-JNIEnv *Android_JNI_GetEnv(void);
-int Android_JNI_SetupThread(void);
-
-/* Generic messages */
-int Android_JNI_SendMessage(int command, int param);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-/* *INDENT-OFF* */
-}
-/* *INDENT-ON* */
-#endif
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/core/linux/SDL_udev.c b/deps/SDL2/src/core/linux/SDL_udev.c
deleted file mode 100644
index c08c287..0000000
--- a/deps/SDL2/src/core/linux/SDL_udev.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* 
- * To list the properties of a device, try something like:
- * udevadm info -a -n snd/hwC0D0 (for a sound card)
- * udevadm info --query=all -n input/event3 (for a keyboard, mouse, etc)
- * udevadm info --query=property -n input/event2
- */
-
-#include "SDL_udev.h"
-
-#ifdef SDL_USE_LIBUDEV
-
-static char* SDL_UDEV_LIBS[] = { "libudev.so.1", "libudev.so.0" };
-
-#define _THIS SDL_UDEV_PrivateData *_this
-static _THIS = NULL;
-
-#include "SDL.h"
-
-static SDL_bool SDL_UDEV_load_sym(const char *fn, void **addr);
-static int SDL_UDEV_load_syms(void);
-static SDL_bool SDL_UDEV_hotplug_update_available(void);
-static void device_event(SDL_UDEV_deviceevent type, struct udev_device *dev);
-
-static SDL_bool
-SDL_UDEV_load_sym(const char *fn, void **addr)
-{
-    *addr = SDL_LoadFunction(_this->udev_handle, fn);
-    if (*addr == NULL) {
-        /* Don't call SDL_SetError(): SDL_LoadFunction already did. */
-        return SDL_FALSE;
-    }
-
-    return SDL_TRUE;
-}
-
-static int
-SDL_UDEV_load_syms(void)
-{
-    /* cast funcs to char* first, to please GCC's strict aliasing rules. */
-    #define SDL_UDEV_SYM(x) \
-        if (!SDL_UDEV_load_sym(#x, (void **) (char *) & _this->x)) return -1
-
-    SDL_UDEV_SYM(udev_device_get_action);
-    SDL_UDEV_SYM(udev_device_get_devnode);
-    SDL_UDEV_SYM(udev_device_get_subsystem);
-    SDL_UDEV_SYM(udev_device_get_property_value);
-    SDL_UDEV_SYM(udev_device_new_from_syspath);
-    SDL_UDEV_SYM(udev_device_unref);
-    SDL_UDEV_SYM(udev_enumerate_add_match_property);
-    SDL_UDEV_SYM(udev_enumerate_add_match_subsystem);
-    SDL_UDEV_SYM(udev_enumerate_get_list_entry);
-    SDL_UDEV_SYM(udev_enumerate_new);
-    SDL_UDEV_SYM(udev_enumerate_scan_devices);
-    SDL_UDEV_SYM(udev_enumerate_unref);
-    SDL_UDEV_SYM(udev_list_entry_get_name);
-    SDL_UDEV_SYM(udev_list_entry_get_next);
-    SDL_UDEV_SYM(udev_monitor_enable_receiving);
-    SDL_UDEV_SYM(udev_monitor_filter_add_match_subsystem_devtype);
-    SDL_UDEV_SYM(udev_monitor_get_fd);
-    SDL_UDEV_SYM(udev_monitor_new_from_netlink);
-    SDL_UDEV_SYM(udev_monitor_receive_device);
-    SDL_UDEV_SYM(udev_monitor_unref);
-    SDL_UDEV_SYM(udev_new);
-    SDL_UDEV_SYM(udev_unref);
-    SDL_UDEV_SYM(udev_device_new_from_devnum);
-    SDL_UDEV_SYM(udev_device_get_devnum);
-    #undef SDL_UDEV_SYM
-
-    return 0;
-}
-
-static SDL_bool
-SDL_UDEV_hotplug_update_available(void)
-{
-    if (_this->udev_mon != NULL) {
-        const int fd = _this->udev_monitor_get_fd(_this->udev_mon);
-        fd_set fds;
-        struct timeval tv;
-
-        FD_ZERO(&fds);
-        FD_SET(fd, &fds);
-        tv.tv_sec = 0;
-        tv.tv_usec = 0;
-        if ((select(fd+1, &fds, NULL, NULL, &tv) > 0) && (FD_ISSET(fd, &fds))) {
-            return SDL_TRUE;
-        }
-    }
-    return SDL_FALSE;
-}
-
-
-int
-SDL_UDEV_Init(void)
-{
-    int retval = 0;
-    
-    if (_this == NULL) {
-        _this = (SDL_UDEV_PrivateData *) SDL_calloc(1, sizeof(*_this));
-        if(_this == NULL) {
-            return SDL_OutOfMemory();
-        }
-        
-        retval = SDL_UDEV_LoadLibrary();
-        if (retval < 0) {
-            SDL_UDEV_Quit();
-            return retval;
-        }
-        
-        /* Set up udev monitoring 
-         * Listen for input devices (mouse, keyboard, joystick, etc) and sound devices
-         */
-        
-        _this->udev = _this->udev_new();
-        if (_this->udev == NULL) {
-            SDL_UDEV_Quit();
-            return SDL_SetError("udev_new() failed");
-        }
-
-        _this->udev_mon = _this->udev_monitor_new_from_netlink(_this->udev, "udev");
-        if (_this->udev_mon == NULL) {
-            SDL_UDEV_Quit();
-            return SDL_SetError("udev_monitor_new_from_netlink() failed");
-        }
-        
-        _this->udev_monitor_filter_add_match_subsystem_devtype(_this->udev_mon, "input", NULL);
-        _this->udev_monitor_filter_add_match_subsystem_devtype(_this->udev_mon, "sound", NULL);
-        _this->udev_monitor_enable_receiving(_this->udev_mon);
-        
-        /* Do an initial scan of existing devices */
-        SDL_UDEV_Scan();
-
-    }
-    
-    _this->ref_count += 1;
-    
-    return retval;
-}
-
-void
-SDL_UDEV_Quit(void)
-{
-    SDL_UDEV_CallbackList *item;
-    
-    if (_this == NULL) {
-        return;
-    }
-    
-    _this->ref_count -= 1;
-    
-    if (_this->ref_count < 1) {
-        
-        if (_this->udev_mon != NULL) {
-            _this->udev_monitor_unref(_this->udev_mon);
-            _this->udev_mon = NULL;
-        }
-        if (_this->udev != NULL) {
-            _this->udev_unref(_this->udev);
-            _this->udev = NULL;
-        }
-        
-        /* Remove existing devices */
-        while (_this->first != NULL) {
-            item = _this->first;
-            _this->first = _this->first->next;
-            SDL_free(item);
-        }
-        
-        SDL_UDEV_UnloadLibrary();
-        SDL_free(_this);
-        _this = NULL;
-    }
-}
-
-void
-SDL_UDEV_Scan(void)
-{
-    struct udev_enumerate *enumerate = NULL;
-    struct udev_list_entry *devs = NULL;
-    struct udev_list_entry *item = NULL;  
-    
-    if (_this == NULL) {
-        return;
-    }
-   
-    enumerate = _this->udev_enumerate_new(_this->udev);
-    if (enumerate == NULL) {
-        SDL_UDEV_Quit();
-        SDL_SetError("udev_monitor_new_from_netlink() failed");
-        return;
-    }
-    
-    _this->udev_enumerate_add_match_subsystem(enumerate, "input");
-    _this->udev_enumerate_add_match_subsystem(enumerate, "sound");
-    
-    _this->udev_enumerate_scan_devices(enumerate);
-    devs = _this->udev_enumerate_get_list_entry(enumerate);
-    for (item = devs; item; item = _this->udev_list_entry_get_next(item)) {
-        const char *path = _this->udev_list_entry_get_name(item);
-        struct udev_device *dev = _this->udev_device_new_from_syspath(_this->udev, path);
-        if (dev != NULL) {
-            device_event(SDL_UDEV_DEVICEADDED, dev);
-            _this->udev_device_unref(dev);
-        }
-    }
-
-    _this->udev_enumerate_unref(enumerate);
-}
-
-
-void
-SDL_UDEV_UnloadLibrary(void)
-{
-    if (_this == NULL) {
-        return;
-    }
-    
-    if (_this->udev_handle != NULL) {
-        SDL_UnloadObject(_this->udev_handle);
-        _this->udev_handle = NULL;
-    }
-}
-
-int
-SDL_UDEV_LoadLibrary(void)
-{
-    int retval = 0, i;
-    
-    if (_this == NULL) {
-        return SDL_SetError("UDEV not initialized");
-    }
-    
-   
-    if (_this->udev_handle == NULL) {
-        for( i = 0 ; i < SDL_arraysize(SDL_UDEV_LIBS); i++) {
-            _this->udev_handle = SDL_LoadObject(SDL_UDEV_LIBS[i]);
-            if (_this->udev_handle != NULL) {
-                retval = SDL_UDEV_load_syms();
-                if (retval < 0) {
-                    SDL_UDEV_UnloadLibrary();
-                }
-                else {
-                    break;
-                }
-            }
-        }
-        
-        if (_this->udev_handle == NULL) {
-            retval = -1;
-            /* Don't call SDL_SetError(): SDL_LoadObject already did. */
-        }
-    }
-
-    return retval;
-}
-
-static void 
-device_event(SDL_UDEV_deviceevent type, struct udev_device *dev) 
-{
-    const char *subsystem;
-    const char *val = NULL;
-    int devclass = 0;
-    const char *path;
-    SDL_UDEV_CallbackList *item;
-    
-    path = _this->udev_device_get_devnode(dev);
-    if (path == NULL) {
-        return;
-    }
-    
-    subsystem = _this->udev_device_get_subsystem(dev);
-    if (SDL_strcmp(subsystem, "sound") == 0) {
-        devclass = SDL_UDEV_DEVICE_SOUND;
-    } else if (SDL_strcmp(subsystem, "input") == 0) {
-        val = _this->udev_device_get_property_value(dev, "ID_INPUT_JOYSTICK");
-        if (val != NULL && SDL_strcmp(val, "1") == 0 ) {
-            devclass |= SDL_UDEV_DEVICE_JOYSTICK;
-        }
-        
-        val = _this->udev_device_get_property_value(dev, "ID_INPUT_MOUSE");
-        if (val != NULL && SDL_strcmp(val, "1") == 0 ) {
-            devclass |= SDL_UDEV_DEVICE_MOUSE;
-        }
-
-        val = _this->udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD");
-        if (val != NULL && SDL_strcmp(val, "1") == 0 ) {
-            devclass |= SDL_UDEV_DEVICE_KEYBOARD;
-        }
-
-        if (devclass == 0) {
-            return;
-        }
-    } else {
-        return;
-    }
-    
-    /* Process callbacks */
-    for (item = _this->first; item != NULL; item = item->next) {
-        item->callback(type, devclass, path);
-    }
-}
-
-void 
-SDL_UDEV_Poll(void)
-{
-    struct udev_device *dev = NULL;
-    const char *action = NULL;
-
-    if (_this == NULL) {
-        return;
-    }
-
-    while (SDL_UDEV_hotplug_update_available()) {
-        dev = _this->udev_monitor_receive_device(_this->udev_mon);
-        if (dev == NULL) {
-            break;
-        }
-        action = _this->udev_device_get_action(dev);
-
-        if (SDL_strcmp(action, "add") == 0) {
-            device_event(SDL_UDEV_DEVICEADDED, dev);
-        } else if (SDL_strcmp(action, "remove") == 0) {
-            device_event(SDL_UDEV_DEVICEREMOVED, dev);
-        }
-        
-        _this->udev_device_unref(dev);
-    }
-}
-
-int 
-SDL_UDEV_AddCallback(SDL_UDEV_Callback cb)
-{
-    SDL_UDEV_CallbackList *item;
-    item = (SDL_UDEV_CallbackList *) SDL_calloc(1, sizeof (SDL_UDEV_CallbackList));
-    if (item == NULL) {
-        return SDL_OutOfMemory();
-    }
-    
-    item->callback = cb;
-
-    if (_this->last == NULL) {
-        _this->first = _this->last = item;
-    } else {
-        _this->last->next = item;
-        _this->last = item;
-    }
-    
-    return 1;
-}
-
-void 
-SDL_UDEV_DelCallback(SDL_UDEV_Callback cb)
-{
-    SDL_UDEV_CallbackList *item;
-    SDL_UDEV_CallbackList *prev = NULL;
-
-    for (item = _this->first; item != NULL; item = item->next) {
-        /* found it, remove it. */
-        if (item->callback == cb) {
-            if (prev != NULL) {
-                prev->next = item->next;
-            } else {
-                SDL_assert(_this->first == item);
-                _this->first = item->next;
-            }
-            if (item == _this->last) {
-                _this->last = prev;
-            }
-            SDL_free(item);
-            return;
-        }
-        prev = item;
-    }
-    
-}
-
-
-#endif /* SDL_USE_LIBUDEV */
diff --git a/deps/SDL2/src/core/linux/SDL_udev.h b/deps/SDL2/src/core/linux/SDL_udev.h
deleted file mode 100644
index 1c26f11..0000000
--- a/deps/SDL2/src/core/linux/SDL_udev.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#ifndef _SDL_udev_h
-#define _SDL_udev_h
-
-#if HAVE_LIBUDEV_H
-
-#ifndef SDL_USE_LIBUDEV
-#define SDL_USE_LIBUDEV 1
-#endif
-
-#include "SDL_loadso.h"
-#include "SDL_events.h"
-#include <libudev.h>
-#include <sys/time.h>
-#include <sys/types.h>
-
-/**
- *  \brief Device type
- */
-
-typedef enum
-{
-    SDL_UDEV_DEVICEADDED = 0x0001,
-    SDL_UDEV_DEVICEREMOVED
-} SDL_UDEV_deviceevent;
-
-/* A device can be any combination of these classes */
-typedef enum
-{
-    SDL_UDEV_DEVICE_MOUSE       = 0x0001,
-    SDL_UDEV_DEVICE_KEYBOARD    = 0x0002,
-    SDL_UDEV_DEVICE_JOYSTICK    = 0x0004,
-    SDL_UDEV_DEVICE_SOUND       = 0x0008
-} SDL_UDEV_deviceclass;
-
-typedef void (*SDL_UDEV_Callback)(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath);
-
-typedef struct SDL_UDEV_CallbackList {
-    SDL_UDEV_Callback callback;
-    struct SDL_UDEV_CallbackList *next;
-} SDL_UDEV_CallbackList;
-
-typedef struct SDL_UDEV_PrivateData
-{
-    const char *udev_library;
-    void *udev_handle;
-    struct udev *udev;
-    struct udev_monitor *udev_mon;
-    int ref_count;
-    SDL_UDEV_CallbackList *first, *last;
-    
-    /* Function pointers */
-    const char *(*udev_device_get_action)(struct udev_device *);
-    const char *(*udev_device_get_devnode)(struct udev_device *);
-    const char *(*udev_device_get_subsystem)(struct udev_device *);
-    const char *(*udev_device_get_property_value)(struct udev_device *, const char *);
-    struct udev_device *(*udev_device_new_from_syspath)(struct udev *, const char *);
-    void (*udev_device_unref)(struct udev_device *);
-    int (*udev_enumerate_add_match_property)(struct udev_enumerate *, const char *, const char *);
-    int (*udev_enumerate_add_match_subsystem)(struct udev_enumerate *, const char *);
-    struct udev_list_entry *(*udev_enumerate_get_list_entry)(struct udev_enumerate *);
-    struct udev_enumerate *(*udev_enumerate_new)(struct udev *);
-    int (*udev_enumerate_scan_devices)(struct udev_enumerate *);
-    void (*udev_enumerate_unref)(struct udev_enumerate *);
-    const char *(*udev_list_entry_get_name)(struct udev_list_entry *);
-    struct udev_list_entry *(*udev_list_entry_get_next)(struct udev_list_entry *);
-    int (*udev_monitor_enable_receiving)(struct udev_monitor *);
-    int (*udev_monitor_filter_add_match_subsystem_devtype)(struct udev_monitor *, const char *, const char *);
-    int (*udev_monitor_get_fd)(struct udev_monitor *);
-    struct udev_monitor *(*udev_monitor_new_from_netlink)(struct udev *, const char *);
-    struct udev_device *(*udev_monitor_receive_device)(struct udev_monitor *);
-    void (*udev_monitor_unref)(struct udev_monitor *);
-    struct udev *(*udev_new)(void);
-    void (*udev_unref)(struct udev *);
-    struct udev_device * (*udev_device_new_from_devnum)(struct udev *udev, char type, dev_t devnum);
-    dev_t (*udev_device_get_devnum) (struct udev_device *udev_device);
-} SDL_UDEV_PrivateData;
-
-extern int SDL_UDEV_Init(void);
-extern void SDL_UDEV_Quit(void);
-extern void SDL_UDEV_UnloadLibrary(void);
-extern int SDL_UDEV_LoadLibrary(void);
-extern void SDL_UDEV_Poll(void);
-extern void SDL_UDEV_Scan(void);
-extern int SDL_UDEV_AddCallback(SDL_UDEV_Callback cb);
-extern void SDL_UDEV_DelCallback(SDL_UDEV_Callback cb);
-
-
-
-
-#endif /* HAVE_LIBUDEV_H */
-
-#endif /* _SDL_udev_h */
diff --git a/deps/SDL2/src/core/windows/SDL_windows.c b/deps/SDL2/src/core/windows/SDL_windows.c
deleted file mode 100644
index 6ac86a6..0000000
--- a/deps/SDL2/src/core/windows/SDL_windows.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef __WIN32__
-
-#include "SDL_windows.h"
-#include "SDL_error.h"
-#include "SDL_assert.h"
-
-#include <objbase.h>  /* for CoInitialize/CoUninitialize */
-
-/* Sets an error message based on GetLastError() */
-int
-WIN_SetError(const char *prefix)
-{
-    TCHAR buffer[1024];
-    char *message;
-    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
-                  buffer, SDL_arraysize(buffer), NULL);
-    message = WIN_StringToUTF8(buffer);
-    SDL_SetError("%s%s%s", prefix ? prefix : "", prefix ? ": " : "", message);
-    SDL_free(message);
-    return -1;
-}
-
-HRESULT
-WIN_CoInitialize(void)
-{
-    const HRESULT hr = CoInitialize(NULL);
-
-    /* S_FALSE means success, but someone else already initialized. */
-    /* You still need to call CoUninitialize in this case! */
-    if (hr == S_FALSE) {
-        return S_OK;
-    }
-
-    return hr;
-}
-
-void
-WIN_CoUninitialize(void)
-{
-    CoUninitialize();
-}
-
-#endif /* __WIN32__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/core/windows/SDL_windows.h b/deps/SDL2/src/core/windows/SDL_windows.h
deleted file mode 100644
index 90cd6b2..0000000
--- a/deps/SDL2/src/core/windows/SDL_windows.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* This is an include file for windows.h with the SDL build settings */
-
-#ifndef _INCLUDED_WINDOWS_H
-#define _INCLUDED_WINDOWS_H
-
-#define WIN32_LEAN_AND_MEAN
-#define STRICT
-#ifndef UNICODE
-#define UNICODE 1
-#endif
-#undef _WIN32_WINNT
-#define _WIN32_WINNT  0x501   /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */
-
-#include <windows.h>
-
-/* Routines to convert from UTF8 to native Windows text */
-#if UNICODE
-#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UTF-16LE", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
-#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UTF-16LE", "UTF-8", (char *)(S), SDL_strlen(S)+1)
-#else
-/* !!! FIXME: UTF8ToString() can just be a SDL_strdup() here. */
-#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)(S), (SDL_strlen(S)+1))
-#define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1)
-#endif
-
-/* Sets an error message based on GetLastError(). Always return -1. */
-extern int WIN_SetError(const char *prefix);
-
-/* Wrap up the oddities of CoInitialize() into a common function. */
-extern HRESULT WIN_CoInitialize(void);
-extern void WIN_CoUninitialize(void);
-
-#endif /* _INCLUDED_WINDOWS_H */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/cpuinfo/SDL_cpuinfo.c b/deps/SDL2/src/cpuinfo/SDL_cpuinfo.c
deleted file mode 100644
index fcb6006..0000000
--- a/deps/SDL2/src/cpuinfo/SDL_cpuinfo.c
+++ /dev/null
@@ -1,682 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(__WIN32__)
-#include "../core/windows/SDL_windows.h"
-#endif
-
-/* CPU feature detection for SDL */
-
-#include "SDL_cpuinfo.h"
-
-#ifdef HAVE_SYSCONF
-#include <unistd.h>
-#endif
-#ifdef HAVE_SYSCTLBYNAME
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#endif
-#if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
-#include <sys/sysctl.h>         /* For AltiVec check */
-#elif defined(__OpenBSD__) && defined(__powerpc__)
-#include <sys/param.h>
-#include <sys/sysctl.h> /* For AltiVec check */
-#include <machine/cpu.h>
-#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
-#include <signal.h>
-#include <setjmp.h>
-#endif
-
-#define CPU_HAS_RDTSC   0x00000001
-#define CPU_HAS_ALTIVEC 0x00000002
-#define CPU_HAS_MMX     0x00000004
-#define CPU_HAS_3DNOW   0x00000008
-#define CPU_HAS_SSE     0x00000010
-#define CPU_HAS_SSE2    0x00000020
-#define CPU_HAS_SSE3    0x00000040
-#define CPU_HAS_SSE41   0x00000100
-#define CPU_HAS_SSE42   0x00000200
-
-#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__ && !__OpenBSD__
-/* This is the brute force way of detecting instruction sets...
-   the idea is borrowed from the libmpeg2 library - thanks!
- */
-static jmp_buf jmpbuf;
-static void
-illegal_instruction(int sig)
-{
-    longjmp(jmpbuf, 1);
-}
-#endif /* HAVE_SETJMP */
-
-static SDL_INLINE int
-CPU_haveCPUID(void)
-{
-    int has_CPUID = 0;
-/* *INDENT-OFF* */
-#if defined(__GNUC__) && defined(i386)
-    __asm__ (
-"        pushfl                      # Get original EFLAGS             \n"
-"        popl    %%eax                                                 \n"
-"        movl    %%eax,%%ecx                                           \n"
-"        xorl    $0x200000,%%eax     # Flip ID bit in EFLAGS           \n"
-"        pushl   %%eax               # Save new EFLAGS value on stack  \n"
-"        popfl                       # Replace current EFLAGS value    \n"
-"        pushfl                      # Get new EFLAGS                  \n"
-"        popl    %%eax               # Store new EFLAGS in EAX         \n"
-"        xorl    %%ecx,%%eax         # Can not toggle ID bit,          \n"
-"        jz      1f                  # Processor=80486                 \n"
-"        movl    $1,%0               # We have CPUID support           \n"
-"1:                                                                    \n"
-    : "=m" (has_CPUID)
-    :
-    : "%eax", "%ecx"
-    );
-#elif defined(__GNUC__) && defined(__x86_64__)
-/* Technically, if this is being compiled under __x86_64__ then it has 
-CPUid by definition.  But it's nice to be able to prove it.  :)      */
-    __asm__ (
-"        pushfq                      # Get original EFLAGS             \n"
-"        popq    %%rax                                                 \n"
-"        movq    %%rax,%%rcx                                           \n"
-"        xorl    $0x200000,%%eax     # Flip ID bit in EFLAGS           \n"
-"        pushq   %%rax               # Save new EFLAGS value on stack  \n"
-"        popfq                       # Replace current EFLAGS value    \n"
-"        pushfq                      # Get new EFLAGS                  \n"
-"        popq    %%rax               # Store new EFLAGS in EAX         \n"
-"        xorl    %%ecx,%%eax         # Can not toggle ID bit,          \n"
-"        jz      1f                  # Processor=80486                 \n"
-"        movl    $1,%0               # We have CPUID support           \n"
-"1:                                                                    \n"
-    : "=m" (has_CPUID)
-    :
-    : "%rax", "%rcx"
-    );
-#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
-    __asm {
-        pushfd                      ; Get original EFLAGS
-        pop     eax
-        mov     ecx, eax
-        xor     eax, 200000h        ; Flip ID bit in EFLAGS
-        push    eax                 ; Save new EFLAGS value on stack
-        popfd                       ; Replace current EFLAGS value
-        pushfd                      ; Get new EFLAGS
-        pop     eax                 ; Store new EFLAGS in EAX
-        xor     eax, ecx            ; Can not toggle ID bit,
-        jz      done                ; Processor=80486
-        mov     has_CPUID,1         ; We have CPUID support
-done:
-    }
-#elif defined(__sun) && defined(__i386)
-    __asm (
-"       pushfl                 \n"
-"       popl    %eax           \n"
-"       movl    %eax,%ecx      \n"
-"       xorl    $0x200000,%eax \n"
-"       pushl   %eax           \n"
-"       popfl                  \n"
-"       pushfl                 \n"
-"       popl    %eax           \n"
-"       xorl    %ecx,%eax      \n"
-"       jz      1f             \n"
-"       movl    $1,-8(%ebp)    \n"
-"1:                            \n"
-    );
-#elif defined(__sun) && defined(__amd64)
-    __asm (
-"       pushfq                 \n"
-"       popq    %rax           \n"
-"       movq    %rax,%rcx      \n"
-"       xorl    $0x200000,%eax \n"
-"       pushq   %rax           \n"
-"       popfq                  \n"
-"       pushfq                 \n"
-"       popq    %rax           \n"
-"       xorl    %ecx,%eax      \n"
-"       jz      1f             \n"
-"       movl    $1,-8(%rbp)    \n"
-"1:                            \n"
-    );
-#endif
-/* *INDENT-ON* */
-    return has_CPUID;
-}
-
-#if defined(__GNUC__) && defined(i386)
-#define cpuid(func, a, b, c, d) \
-    __asm__ __volatile__ ( \
-"        pushl %%ebx        \n" \
-"        cpuid              \n" \
-"        movl %%ebx, %%esi  \n" \
-"        popl %%ebx         \n" : \
-            "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (func))
-#elif defined(__GNUC__) && defined(__x86_64__)
-#define cpuid(func, a, b, c, d) \
-    __asm__ __volatile__ ( \
-"        pushq %%rbx        \n" \
-"        cpuid              \n" \
-"        movq %%rbx, %%rsi  \n" \
-"        popq %%rbx         \n" : \
-            "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (func))
-#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
-#define cpuid(func, a, b, c, d) \
-    __asm { \
-        __asm mov eax, func \
-        __asm cpuid \
-        __asm mov a, eax \
-        __asm mov b, ebx \
-        __asm mov c, ecx \
-        __asm mov d, edx \
-    }
-#else
-#define cpuid(func, a, b, c, d) \
-    a = b = c = d = 0
-#endif
-
-static SDL_INLINE int
-CPU_getCPUIDFeatures(void)
-{
-    int features = 0;
-    int a, b, c, d;
-
-    cpuid(0, a, b, c, d);
-    if (a >= 1) {
-        cpuid(1, a, b, c, d);
-        features = d;
-    }
-    return features;
-}
-
-static SDL_INLINE int
-CPU_haveRDTSC(void)
-{
-    if (CPU_haveCPUID()) {
-        return (CPU_getCPUIDFeatures() & 0x00000010);
-    }
-    return 0;
-}
-
-static SDL_INLINE int
-CPU_haveAltiVec(void)
-{
-    volatile int altivec = 0;
-#if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__))
-#ifdef __OpenBSD__
-    int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC };
-#else
-    int selectors[2] = { CTL_HW, HW_VECTORUNIT };
-#endif
-    int hasVectorUnit = 0;
-    size_t length = sizeof(hasVectorUnit);
-    int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
-    if (0 == error)
-        altivec = (hasVectorUnit != 0);
-#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
-    void (*handler) (int sig);
-    handler = signal(SIGILL, illegal_instruction);
-    if (setjmp(jmpbuf) == 0) {
-        asm volatile ("mtspr 256, %0\n\t" "vand %%v0, %%v0, %%v0"::"r" (-1));
-        altivec = 1;
-    }
-    signal(SIGILL, handler);
-#endif
-    return altivec;
-}
-
-static SDL_INLINE int
-CPU_haveMMX(void)
-{
-    if (CPU_haveCPUID()) {
-        return (CPU_getCPUIDFeatures() & 0x00800000);
-    }
-    return 0;
-}
-
-static SDL_INLINE int
-CPU_have3DNow(void)
-{
-    if (CPU_haveCPUID()) {
-        int a, b, c, d;
-
-        cpuid(0x80000000, a, b, c, d);
-        if (a >= 0x80000001) {
-            cpuid(0x80000001, a, b, c, d);
-            return (d & 0x80000000);
-        }
-    }
-    return 0;
-}
-
-static SDL_INLINE int
-CPU_haveSSE(void)
-{
-    if (CPU_haveCPUID()) {
-        return (CPU_getCPUIDFeatures() & 0x02000000);
-    }
-    return 0;
-}
-
-static SDL_INLINE int
-CPU_haveSSE2(void)
-{
-    if (CPU_haveCPUID()) {
-        return (CPU_getCPUIDFeatures() & 0x04000000);
-    }
-    return 0;
-}
-
-static SDL_INLINE int
-CPU_haveSSE3(void)
-{
-    if (CPU_haveCPUID()) {
-        int a, b, c, d;
-
-        cpuid(0, a, b, c, d);
-        if (a >= 1) {
-            cpuid(1, a, b, c, d);
-            return (c & 0x00000001);
-        }
-    }
-    return 0;
-}
-
-static SDL_INLINE int
-CPU_haveSSE41(void)
-{
-    if (CPU_haveCPUID()) {
-        int a, b, c, d;
-
-        cpuid(1, a, b, c, d);
-        if (a >= 1) {
-            cpuid(1, a, b, c, d);
-            return (c & 0x00080000);
-        }
-    }
-    return 0;
-}
-
-static SDL_INLINE int
-CPU_haveSSE42(void)
-{
-    if (CPU_haveCPUID()) {
-        int a, b, c, d;
-
-        cpuid(1, a, b, c, d);
-        if (a >= 1) {
-            cpuid(1, a, b, c, d);
-            return (c & 0x00100000);
-        }
-    }
-    return 0;
-}
-
-static int SDL_CPUCount = 0;
-
-int
-SDL_GetCPUCount(void)
-{
-    if (!SDL_CPUCount) {
-#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
-        if (SDL_CPUCount <= 0) {
-            SDL_CPUCount = (int)sysconf(_SC_NPROCESSORS_ONLN);
-        }
-#endif
-#ifdef HAVE_SYSCTLBYNAME
-        if (SDL_CPUCount <= 0) {
-            size_t size = sizeof(SDL_CPUCount);
-            sysctlbyname("hw.ncpu", &SDL_CPUCount, &size, NULL, 0);
-        }
-#endif
-#ifdef __WIN32__
-        if (SDL_CPUCount <= 0) {
-            SYSTEM_INFO info;
-            GetSystemInfo(&info);
-            SDL_CPUCount = info.dwNumberOfProcessors;
-        }
-#endif
-        /* There has to be at least 1, right? :) */
-        if (SDL_CPUCount <= 0) {
-            SDL_CPUCount = 1;
-        }
-    }
-    return SDL_CPUCount;
-}
-
-/* Oh, such a sweet sweet trick, just not very useful. :) */
-static const char *
-SDL_GetCPUType(void)
-{
-    static char SDL_CPUType[13];
-
-    if (!SDL_CPUType[0]) {
-        int i = 0;
-        int a, b, c, d;
-
-        if (CPU_haveCPUID()) {
-            cpuid(0x00000000, a, b, c, d);
-            SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-            SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-            SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-            SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-            SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-            SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-            SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-            SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-            SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-            SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-            SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-            SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-        }
-        if (!SDL_CPUType[0]) {
-            SDL_strlcpy(SDL_CPUType, "Unknown", sizeof(SDL_CPUType));
-        }
-    }
-    return SDL_CPUType;
-}
-
-
-#ifdef TEST_MAIN  /* !!! FIXME: only used for test at the moment. */
-static const char *
-SDL_GetCPUName(void)
-{
-    static char SDL_CPUName[48];
-
-    if (!SDL_CPUName[0]) {
-        int i = 0;
-        int a, b, c, d;
-
-        if (CPU_haveCPUID()) {
-            cpuid(0x80000000, a, b, c, d);
-            if (a >= 0x80000004) {
-                cpuid(0x80000002, a, b, c, d);
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                cpuid(0x80000003, a, b, c, d);
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                cpuid(0x80000004, a, b, c, d);
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
-            }
-        }
-        if (!SDL_CPUName[0]) {
-            SDL_strlcpy(SDL_CPUName, "Unknown", sizeof(SDL_CPUName));
-        }
-    }
-    return SDL_CPUName;
-}
-#endif
-
-int
-SDL_GetCPUCacheLineSize(void)
-{
-    const char *cpuType = SDL_GetCPUType();
-
-    if (SDL_strcmp(cpuType, "GenuineIntel") == 0) {
-        int a, b, c, d;
-
-        cpuid(0x00000001, a, b, c, d);
-        return (((b >> 8) & 0xff) * 8);
-    } else if (SDL_strcmp(cpuType, "AuthenticAMD") == 0) {
-        int a, b, c, d;
-
-        cpuid(0x80000005, a, b, c, d);
-        return (c & 0xff);
-    } else {
-        /* Just make a guess here... */
-        return SDL_CACHELINE_SIZE;
-    }
-}
-
-static Uint32 SDL_CPUFeatures = 0xFFFFFFFF;
-
-static Uint32
-SDL_GetCPUFeatures(void)
-{
-    if (SDL_CPUFeatures == 0xFFFFFFFF) {
-        SDL_CPUFeatures = 0;
-        if (CPU_haveRDTSC()) {
-            SDL_CPUFeatures |= CPU_HAS_RDTSC;
-        }
-        if (CPU_haveAltiVec()) {
-            SDL_CPUFeatures |= CPU_HAS_ALTIVEC;
-        }
-        if (CPU_haveMMX()) {
-            SDL_CPUFeatures |= CPU_HAS_MMX;
-        }
-        if (CPU_have3DNow()) {
-            SDL_CPUFeatures |= CPU_HAS_3DNOW;
-        }
-        if (CPU_haveSSE()) {
-            SDL_CPUFeatures |= CPU_HAS_SSE;
-        }
-        if (CPU_haveSSE2()) {
-            SDL_CPUFeatures |= CPU_HAS_SSE2;
-        }
-        if (CPU_haveSSE3()) {
-            SDL_CPUFeatures |= CPU_HAS_SSE3;
-        }
-        if (CPU_haveSSE41()) {
-            SDL_CPUFeatures |= CPU_HAS_SSE41;
-        }
-        if (CPU_haveSSE42()) {
-            SDL_CPUFeatures |= CPU_HAS_SSE42;
-        }
-    }
-    return SDL_CPUFeatures;
-}
-
-SDL_bool
-SDL_HasRDTSC(void)
-{
-    if (SDL_GetCPUFeatures() & CPU_HAS_RDTSC) {
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-SDL_bool
-SDL_HasAltiVec(void)
-{
-    if (SDL_GetCPUFeatures() & CPU_HAS_ALTIVEC) {
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-SDL_bool
-SDL_HasMMX(void)
-{
-    if (SDL_GetCPUFeatures() & CPU_HAS_MMX) {
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-SDL_bool
-SDL_Has3DNow(void)
-{
-    if (SDL_GetCPUFeatures() & CPU_HAS_3DNOW) {
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-SDL_bool
-SDL_HasSSE(void)
-{
-    if (SDL_GetCPUFeatures() & CPU_HAS_SSE) {
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-SDL_bool
-SDL_HasSSE2(void)
-{
-    if (SDL_GetCPUFeatures() & CPU_HAS_SSE2) {
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-SDL_bool
-SDL_HasSSE3(void)
-{
-    if (SDL_GetCPUFeatures() & CPU_HAS_SSE3) {
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-SDL_bool
-SDL_HasSSE41(void)
-{
-    if (SDL_GetCPUFeatures() & CPU_HAS_SSE41) {
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-SDL_bool
-SDL_HasSSE42(void)
-{
-    if (SDL_GetCPUFeatures() & CPU_HAS_SSE42) {
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-static int SDL_SystemRAM = 0;
-
-int
-SDL_GetSystemRAM(void)
-{
-    if (!SDL_SystemRAM) {
-#if defined(HAVE_SYSCONF) && defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE)
-        if (SDL_SystemRAM <= 0) {
-            SDL_SystemRAM = (int)((Sint64)sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / (1024*1024));
-        }
-#endif
-#ifdef HAVE_SYSCTLBYNAME
-        if (SDL_SystemRAM <= 0) {
-#ifdef __FreeBSD__
-#ifdef HW_REALMEM
-            int mib[2] = {CTL_HW, HW_REALMEM};
-#else
-            /* might only report up to 2 GiB */
-            int mib[2] = {CTL_HW, HW_PHYSMEM};
-#endif /* HW_REALMEM */
-#else
-            int mib[2] = {CTL_HW, HW_MEMSIZE};
-#endif /* __FreeBSD__ */
-            Uint64 memsize = 0;
-            size_t len = sizeof(memsize);
-            
-            if (sysctl(mib, 2, &memsize, &len, NULL, 0) == 0) {
-                SDL_SystemRAM = (int)(memsize / (1024*1024));
-            }
-        }
-#endif
-#ifdef __WIN32__
-        if (SDL_SystemRAM <= 0) {
-            MEMORYSTATUSEX stat;
-            stat.dwLength = sizeof(stat);
-            if (GlobalMemoryStatusEx(&stat)) {
-                SDL_SystemRAM = (int)(stat.ullTotalPhys / (1024 * 1024));
-            }
-        }
-#endif
-    }
-    return SDL_SystemRAM;
-}
-
-
-#ifdef TEST_MAIN
-
-#include <stdio.h>
-
-int
-main()
-{
-    printf("CPU count: %d\n", SDL_GetCPUCount());
-    printf("CPU type: %s\n", SDL_GetCPUType());
-    printf("CPU name: %s\n", SDL_GetCPUName());
-    printf("CacheLine size: %d\n", SDL_GetCPUCacheLineSize());
-    printf("RDTSC: %d\n", SDL_HasRDTSC());
-    printf("Altivec: %d\n", SDL_HasAltiVec());
-    printf("MMX: %d\n", SDL_HasMMX());
-    printf("3DNow: %d\n", SDL_Has3DNow());
-    printf("SSE: %d\n", SDL_HasSSE());
-    printf("SSE2: %d\n", SDL_HasSSE2());
-    printf("SSE3: %d\n", SDL_HasSSE3());
-    printf("SSE4.1: %d\n", SDL_HasSSE41());
-    printf("SSE4.2: %d\n", SDL_HasSSE42());
-    printf("RAM: %d MB\n", SDL_GetSystemRAM());
-    return 0;
-}
-
-#endif /* TEST_MAIN */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_clipboardevents.c b/deps/SDL2/src/events/SDL_clipboardevents.c
deleted file mode 100644
index 99ead8f..0000000
--- a/deps/SDL2/src/events/SDL_clipboardevents.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Clipboard event handling code for SDL */
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-#include "SDL_clipboardevents_c.h"
-
-
-int
-SDL_SendClipboardUpdate(void)
-{
-    int posted;
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(SDL_CLIPBOARDUPDATE) == SDL_ENABLE) {
-        SDL_Event event;
-        event.type = SDL_CLIPBOARDUPDATE;
-
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    return (posted);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_clipboardevents_c.h b/deps/SDL2/src/events/SDL_clipboardevents_c.h
deleted file mode 100644
index 4f320f0..0000000
--- a/deps/SDL2/src/events/SDL_clipboardevents_c.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_clipboardevents_c_h
-#define _SDL_clipboardevents_c_h
-
-extern int SDL_SendClipboardUpdate(void);
-
-#endif /* _SDL_clipboardevents_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_dropevents.c b/deps/SDL2/src/events/SDL_dropevents.c
deleted file mode 100644
index 1ce2f1c..0000000
--- a/deps/SDL2/src/events/SDL_dropevents.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Drag and drop event handling code for SDL */
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-#include "SDL_dropevents_c.h"
-
-
-int
-SDL_SendDropFile(const char *file)
-{
-    int posted;
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
-        SDL_Event event;
-        event.type = SDL_DROPFILE;
-        event.drop.file = SDL_strdup(file);
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    return (posted);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_dropevents_c.h b/deps/SDL2/src/events/SDL_dropevents_c.h
deleted file mode 100644
index d658e44..0000000
--- a/deps/SDL2/src/events/SDL_dropevents_c.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dropevents_c_h
-#define _SDL_dropevents_c_h
-
-extern int SDL_SendDropFile(const char *file);
-
-#endif /* _SDL_dropevents_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_events.c b/deps/SDL2/src/events/SDL_events.c
deleted file mode 100644
index 9984503..0000000
--- a/deps/SDL2/src/events/SDL_events.c
+++ /dev/null
@@ -1,640 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* General event handling code for SDL */
-
-#include "SDL.h"
-#include "SDL_events.h"
-#include "SDL_syswm.h"
-#include "SDL_thread.h"
-#include "SDL_events_c.h"
-#include "../timer/SDL_timer_c.h"
-#if !SDL_JOYSTICK_DISABLED
-#include "../joystick/SDL_joystick_c.h"
-#endif
-#include "../video/SDL_sysvideo.h"
-
-/* An arbitrary limit so we don't have unbounded growth */
-#define SDL_MAX_QUEUED_EVENTS   65535
-
-/* Public data -- the event filter */
-SDL_EventFilter SDL_EventOK = NULL;
-void *SDL_EventOKParam;
-
-typedef struct SDL_EventWatcher {
-    SDL_EventFilter callback;
-    void *userdata;
-    struct SDL_EventWatcher *next;
-} SDL_EventWatcher;
-
-static SDL_EventWatcher *SDL_event_watchers = NULL;
-
-typedef struct {
-    Uint32 bits[8];
-} SDL_DisabledEventBlock;
-
-static SDL_DisabledEventBlock *SDL_disabled_events[256];
-static Uint32 SDL_userevents = SDL_USEREVENT;
-
-/* Private data -- event queue */
-typedef struct _SDL_EventEntry
-{
-    SDL_Event event;
-    SDL_SysWMmsg msg;
-    struct _SDL_EventEntry *prev;
-    struct _SDL_EventEntry *next;
-} SDL_EventEntry;
-
-typedef struct _SDL_SysWMEntry
-{
-    SDL_SysWMmsg msg;
-    struct _SDL_SysWMEntry *next;
-} SDL_SysWMEntry;
-
-static struct
-{
-    SDL_mutex *lock;
-    volatile SDL_bool active;
-    volatile int count;
-    SDL_EventEntry *head;
-    SDL_EventEntry *tail;
-    SDL_EventEntry *free;
-    SDL_SysWMEntry *wmmsg_used;
-    SDL_SysWMEntry *wmmsg_free;
-} SDL_EventQ = { NULL, SDL_TRUE };
-
-
-static SDL_INLINE SDL_bool
-SDL_ShouldPollJoystick()
-{
-#if !SDL_JOYSTICK_DISABLED
-    if ((!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] ||
-         SDL_JoystickEventState(SDL_QUERY)) &&
-        SDL_PrivateJoystickNeedsPolling()) {
-        return SDL_TRUE;
-    }
-#endif
-    return SDL_FALSE;
-}
-
-/* Public functions */
-
-void
-SDL_StopEventLoop(void)
-{
-    int i;
-    SDL_EventEntry *entry;
-    SDL_SysWMEntry *wmmsg;
-
-    if (SDL_EventQ.lock) {
-        SDL_LockMutex(SDL_EventQ.lock);
-    }
-
-    SDL_EventQ.active = SDL_FALSE;
-
-    /* Clean out EventQ */
-    for (entry = SDL_EventQ.head; entry; ) {
-        SDL_EventEntry *next = entry->next;
-        SDL_free(entry);
-        entry = next;
-    }
-    for (entry = SDL_EventQ.free; entry; ) {
-        SDL_EventEntry *next = entry->next;
-        SDL_free(entry);
-        entry = next;
-    }
-    for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg; ) {
-        SDL_SysWMEntry *next = wmmsg->next;
-        SDL_free(wmmsg);
-        wmmsg = next;
-    }
-    for (wmmsg = SDL_EventQ.wmmsg_free; wmmsg; ) {
-        SDL_SysWMEntry *next = wmmsg->next;
-        SDL_free(wmmsg);
-        wmmsg = next;
-    }
-    SDL_EventQ.count = 0;
-    SDL_EventQ.head = NULL;
-    SDL_EventQ.tail = NULL;
-    SDL_EventQ.free = NULL;
-    SDL_EventQ.wmmsg_used = NULL;
-    SDL_EventQ.wmmsg_free = NULL;
-
-    /* Clear disabled event state */
-    for (i = 0; i < SDL_arraysize(SDL_disabled_events); ++i) {
-        SDL_free(SDL_disabled_events[i]);
-        SDL_disabled_events[i] = NULL;
-    }
-
-    while (SDL_event_watchers) {
-        SDL_EventWatcher *tmp = SDL_event_watchers;
-        SDL_event_watchers = tmp->next;
-        SDL_free(tmp);
-    }
-    SDL_EventOK = NULL;
-
-    if (SDL_EventQ.lock) {
-        SDL_UnlockMutex(SDL_EventQ.lock);
-        SDL_DestroyMutex(SDL_EventQ.lock);
-        SDL_EventQ.lock = NULL;
-    }
-}
-
-/* This function (and associated calls) may be called more than once */
-int
-SDL_StartEventLoop(void)
-{
-    /* We'll leave the event queue alone, since we might have gotten
-       some important events at launch (like SDL_DROPFILE)
-
-       FIXME: Does this introduce any other bugs with events at startup?
-     */
-
-    /* Create the lock and set ourselves active */
-#if !SDL_THREADS_DISABLED
-    if (!SDL_EventQ.lock) {
-        SDL_EventQ.lock = SDL_CreateMutex();
-    }
-    if (SDL_EventQ.lock == NULL) {
-        return (-1);
-    }
-#endif /* !SDL_THREADS_DISABLED */
-
-    /* Process most event types */
-    SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
-    SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
-    SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
-
-    SDL_EventQ.active = SDL_TRUE;
-
-    return (0);
-}
-
-
-/* Add an event to the event queue -- called with the queue locked */
-static int
-SDL_AddEvent(SDL_Event * event)
-{
-    SDL_EventEntry *entry;
-
-    if (SDL_EventQ.count >= SDL_MAX_QUEUED_EVENTS) {
-        SDL_SetError("Event queue is full (%d events)", SDL_EventQ.count);
-        return 0;
-    }
-
-    if (SDL_EventQ.free == NULL) {
-        entry = (SDL_EventEntry *)SDL_malloc(sizeof(*entry));
-        if (!entry) {
-            return 0;
-        }
-    } else {
-        entry = SDL_EventQ.free;
-        SDL_EventQ.free = entry->next;
-    }
-
-    entry->event = *event;
-    if (event->type == SDL_SYSWMEVENT) {
-        entry->msg = *event->syswm.msg;
-        entry->event.syswm.msg = &entry->msg;
-    }
-
-    if (SDL_EventQ.tail) {
-        SDL_EventQ.tail->next = entry;
-        entry->prev = SDL_EventQ.tail;
-        SDL_EventQ.tail = entry;
-        entry->next = NULL;
-    } else {
-        SDL_assert(!SDL_EventQ.head);
-        SDL_EventQ.head = entry;
-        SDL_EventQ.tail = entry;
-        entry->prev = NULL;
-        entry->next = NULL;
-    }
-    ++SDL_EventQ.count;
-
-    return 1;
-}
-
-/* Remove an event from the queue -- called with the queue locked */
-static void
-SDL_CutEvent(SDL_EventEntry *entry)
-{
-    if (entry->prev) {
-        entry->prev->next = entry->next;
-    }
-    if (entry->next) {
-        entry->next->prev = entry->prev;
-    }
-
-    if (entry == SDL_EventQ.head) {
-        SDL_assert(entry->prev == NULL);
-        SDL_EventQ.head = entry->next;
-    }
-    if (entry == SDL_EventQ.tail) {
-        SDL_assert(entry->next == NULL);
-        SDL_EventQ.tail = entry->prev;
-    }
-
-    entry->next = SDL_EventQ.free;
-    SDL_EventQ.free = entry;
-    SDL_assert(SDL_EventQ.count > 0);
-    --SDL_EventQ.count;
-}
-
-/* Lock the event queue, take a peep at it, and unlock it */
-int
-SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action,
-               Uint32 minType, Uint32 maxType)
-{
-    int i, used;
-
-    /* Don't look after we've quit */
-    if (!SDL_EventQ.active) {
-        /* We get a few spurious events at shutdown, so don't warn then */
-        if (action != SDL_ADDEVENT) {
-            SDL_SetError("The event system has been shut down");
-        }
-        return (-1);
-    }
-    /* Lock the event queue */
-    used = 0;
-    if (!SDL_EventQ.lock || SDL_LockMutex(SDL_EventQ.lock) == 0) {
-        if (action == SDL_ADDEVENT) {
-            for (i = 0; i < numevents; ++i) {
-                used += SDL_AddEvent(&events[i]);
-            }
-        } else {
-            SDL_EventEntry *entry, *next;
-            SDL_SysWMEntry *wmmsg, *wmmsg_next;
-            SDL_Event tmpevent;
-            Uint32 type;
-
-            /* If 'events' is NULL, just see if they exist */
-            if (events == NULL) {
-                action = SDL_PEEKEVENT;
-                numevents = 1;
-                events = &tmpevent;
-            }
-
-            /* Clean out any used wmmsg data
-               FIXME: Do we want to retain the data for some period of time?
-             */
-            for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg; wmmsg = wmmsg_next) {
-                wmmsg_next = wmmsg->next;
-                wmmsg->next = SDL_EventQ.wmmsg_free;
-                SDL_EventQ.wmmsg_free = wmmsg;
-            }
-            SDL_EventQ.wmmsg_used = NULL;
-
-            for (entry = SDL_EventQ.head; entry && used < numevents; entry = next) {
-                next = entry->next;
-                type = entry->event.type;
-                if (minType <= type && type <= maxType) {
-                    events[used] = entry->event;
-                    if (entry->event.type == SDL_SYSWMEVENT) {
-                        /* We need to copy the wmmsg somewhere safe.
-                           For now we'll guarantee it's valid at least until
-                           the next call to SDL_PeepEvents()
-                         */
-                        SDL_SysWMEntry *wmmsg;
-                        if (SDL_EventQ.wmmsg_free) {
-                            wmmsg = SDL_EventQ.wmmsg_free;
-                            SDL_EventQ.wmmsg_free = wmmsg->next;
-                        } else {
-                            wmmsg = (SDL_SysWMEntry *)SDL_malloc(sizeof(*wmmsg));
-                        }
-                        wmmsg->msg = *entry->event.syswm.msg;
-                        wmmsg->next = SDL_EventQ.wmmsg_used;
-                        SDL_EventQ.wmmsg_used = wmmsg;
-                        events[used].syswm.msg = &wmmsg->msg;
-                    }
-                    ++used;
-
-                    if (action == SDL_GETEVENT) {
-                        SDL_CutEvent(entry);
-                    }
-                }
-            }
-        }
-        SDL_UnlockMutex(SDL_EventQ.lock);
-    } else {
-        return SDL_SetError("Couldn't lock event queue");
-    }
-    return (used);
-}
-
-SDL_bool
-SDL_HasEvent(Uint32 type)
-{
-    return (SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, type, type) > 0);
-}
-
-SDL_bool
-SDL_HasEvents(Uint32 minType, Uint32 maxType)
-{
-    return (SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, minType, maxType) > 0);
-}
-
-void
-SDL_FlushEvent(Uint32 type)
-{
-    SDL_FlushEvents(type, type);
-}
-
-void
-SDL_FlushEvents(Uint32 minType, Uint32 maxType)
-{
-    /* Don't look after we've quit */
-    if (!SDL_EventQ.active) {
-        return;
-    }
-
-    /* Make sure the events are current */
-#if 0
-    /* Actually, we can't do this since we might be flushing while processing
-       a resize event, and calling this might trigger further resize events.
-    */
-    SDL_PumpEvents();
-#endif
-
-    /* Lock the event queue */
-    if (SDL_LockMutex(SDL_EventQ.lock) == 0) {
-        SDL_EventEntry *entry, *next;
-        Uint32 type;
-        for (entry = SDL_EventQ.head; entry; entry = next) {
-            next = entry->next;
-            type = entry->event.type;
-            if (minType <= type && type <= maxType) {
-                SDL_CutEvent(entry);
-            }
-        }
-        SDL_UnlockMutex(SDL_EventQ.lock);
-    }
-}
-
-/* Run the system dependent event loops */
-void
-SDL_PumpEvents(void)
-{
-    SDL_VideoDevice *_this = SDL_GetVideoDevice();
-
-    /* Get events from the video subsystem */
-    if (_this) {
-        _this->PumpEvents(_this);
-    }
-#if !SDL_JOYSTICK_DISABLED
-    /* Check for joystick state change */
-    if (SDL_ShouldPollJoystick()) {
-        SDL_JoystickUpdate();
-    }
-#endif
-}
-
-/* Public functions */
-
-int
-SDL_PollEvent(SDL_Event * event)
-{
-    return SDL_WaitEventTimeout(event, 0);
-}
-
-int
-SDL_WaitEvent(SDL_Event * event)
-{
-    return SDL_WaitEventTimeout(event, -1);
-}
-
-int
-SDL_WaitEventTimeout(SDL_Event * event, int timeout)
-{
-    Uint32 expiration = 0;
-
-    if (timeout > 0)
-        expiration = SDL_GetTicks() + timeout;
-
-    for (;;) {
-        SDL_PumpEvents();
-        switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) {
-        case -1:
-            return 0;
-        case 1:
-            return 1;
-        case 0:
-            if (timeout == 0) {
-                /* Polling and no events, just return */
-                return 0;
-            }
-            if (timeout > 0 && SDL_TICKS_PASSED(SDL_GetTicks(), expiration)) {
-                /* Timeout expired and no events */
-                return 0;
-            }
-            SDL_Delay(10);
-            break;
-        }
-    }
-}
-
-int
-SDL_PushEvent(SDL_Event * event)
-{
-    SDL_EventWatcher *curr;
-
-    event->common.timestamp = SDL_GetTicks();
-
-    if (SDL_EventOK && !SDL_EventOK(SDL_EventOKParam, event)) {
-        return 0;
-    }
-
-    for (curr = SDL_event_watchers; curr; curr = curr->next) {
-        curr->callback(curr->userdata, event);
-    }
-
-    if (SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0, 0) <= 0) {
-        return -1;
-    }
-
-    SDL_GestureProcessEvent(event);
-
-    return 1;
-}
-
-void
-SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
-{
-    /* Set filter and discard pending events */
-    SDL_EventOK = NULL;
-    SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT);
-    SDL_EventOKParam = userdata;
-    SDL_EventOK = filter;
-}
-
-SDL_bool
-SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata)
-{
-    if (filter) {
-        *filter = SDL_EventOK;
-    }
-    if (userdata) {
-        *userdata = SDL_EventOKParam;
-    }
-    return SDL_EventOK ? SDL_TRUE : SDL_FALSE;
-}
-
-/* FIXME: This is not thread-safe yet */
-void
-SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
-{
-    SDL_EventWatcher *watcher;
-
-    watcher = (SDL_EventWatcher *)SDL_malloc(sizeof(*watcher));
-    if (!watcher) {
-        /* Uh oh... */
-        return;
-    }
-    watcher->callback = filter;
-    watcher->userdata = userdata;
-    watcher->next = SDL_event_watchers;
-    SDL_event_watchers = watcher;
-}
-
-/* FIXME: This is not thread-safe yet */
-void
-SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
-{
-    SDL_EventWatcher *prev = NULL;
-    SDL_EventWatcher *curr;
-
-    for (curr = SDL_event_watchers; curr; prev = curr, curr = curr->next) {
-        if (curr->callback == filter && curr->userdata == userdata) {
-            if (prev) {
-                prev->next = curr->next;
-            } else {
-                SDL_event_watchers = curr->next;
-            }
-            SDL_free(curr);
-            break;
-        }
-    }
-}
-
-void
-SDL_FilterEvents(SDL_EventFilter filter, void *userdata)
-{
-    if (SDL_LockMutex(SDL_EventQ.lock) == 0) {
-        SDL_EventEntry *entry, *next;
-        for (entry = SDL_EventQ.head; entry; entry = next) {
-            next = entry->next;
-            if (!filter(userdata, &entry->event)) {
-                SDL_CutEvent(entry);
-            }
-        }
-        SDL_UnlockMutex(SDL_EventQ.lock);
-    }
-}
-
-Uint8
-SDL_EventState(Uint32 type, int state)
-{
-    Uint8 current_state;
-    Uint8 hi = ((type >> 8) & 0xff);
-    Uint8 lo = (type & 0xff);
-
-    if (SDL_disabled_events[hi] &&
-        (SDL_disabled_events[hi]->bits[lo/32] & (1 << (lo&31)))) {
-        current_state = SDL_DISABLE;
-    } else {
-        current_state = SDL_ENABLE;
-    }
-
-    if (state != current_state)
-    {
-        switch (state) {
-        case SDL_DISABLE:
-            /* Disable this event type and discard pending events */
-            if (!SDL_disabled_events[hi]) {
-                SDL_disabled_events[hi] = (SDL_DisabledEventBlock*) SDL_calloc(1, sizeof(SDL_DisabledEventBlock));
-                if (!SDL_disabled_events[hi]) {
-                    /* Out of memory, nothing we can do... */
-                    break;
-                }
-            }
-            SDL_disabled_events[hi]->bits[lo/32] |= (1 << (lo&31));
-            SDL_FlushEvent(type);
-            break;
-        case SDL_ENABLE:
-            SDL_disabled_events[hi]->bits[lo/32] &= ~(1 << (lo&31));
-            break;
-        default:
-            /* Querying state... */
-            break;
-        }
-    }
-
-    return current_state;
-}
-
-Uint32
-SDL_RegisterEvents(int numevents)
-{
-    Uint32 event_base;
-
-    if ((numevents > 0) && (SDL_userevents+numevents <= SDL_LASTEVENT)) {
-        event_base = SDL_userevents;
-        SDL_userevents += numevents;
-    } else {
-        event_base = (Uint32)-1;
-    }
-    return event_base;
-}
-
-int
-SDL_SendAppEvent(SDL_EventType eventType)
-{
-    int posted;
-
-    posted = 0;
-    if (SDL_GetEventState(eventType) == SDL_ENABLE) {
-        SDL_Event event;
-        event.type = eventType;
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    return (posted);
-}
-
-int
-SDL_SendSysWMEvent(SDL_SysWMmsg * message)
-{
-    int posted;
-
-    posted = 0;
-    if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) {
-        SDL_Event event;
-        SDL_memset(&event, 0, sizeof(event));
-        event.type = SDL_SYSWMEVENT;
-        event.syswm.msg = message;
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    /* Update internal event state */
-    return (posted);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_events_c.h b/deps/SDL2/src/events/SDL_events_c.h
deleted file mode 100644
index f365ee3..0000000
--- a/deps/SDL2/src/events/SDL_events_c.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_events.c */
-#include "SDL_events.h"
-#include "SDL_thread.h"
-#include "SDL_clipboardevents_c.h"
-#include "SDL_dropevents_c.h"
-#include "SDL_gesture_c.h"
-#include "SDL_keyboard_c.h"
-#include "SDL_mouse_c.h"
-#include "SDL_touch_c.h"
-#include "SDL_windowevents_c.h"
-
-/* Start and stop the event processing loop */
-extern int SDL_StartEventLoop(void);
-extern void SDL_StopEventLoop(void);
-extern void SDL_QuitInterrupt(void);
-
-extern int SDL_SendAppEvent(SDL_EventType eventType);
-extern int SDL_SendSysWMEvent(SDL_SysWMmsg * message);
-
-extern int SDL_QuitInit(void);
-extern int SDL_SendQuit(void);
-extern void SDL_QuitQuit(void);
-
-/* The event filter function */
-extern SDL_EventFilter SDL_EventOK;
-extern void *SDL_EventOKParam;
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_gesture.c b/deps/SDL2/src/events/SDL_gesture.c
deleted file mode 100644
index 20ce57b..0000000
--- a/deps/SDL2/src/events/SDL_gesture.c
+++ /dev/null
@@ -1,647 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-/* General mouse handling code for SDL */
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-#include "SDL_gesture_c.h"
-
-#if !defined(__PSP__)
-#include <memory.h>
-#endif
-
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-
-/* TODO: Replace with malloc */
-
-#define MAXPATHSIZE 1024
-
-#define DOLLARNPOINTS 64
-#define DOLLARSIZE 256
-
-#define ENABLE_DOLLAR
-
-#define PHI 0.618033989
-
-typedef struct {
-    float x,y;
-} SDL_FloatPoint;
-
-typedef struct {
-    float length;
-
-    int numPoints;
-    SDL_FloatPoint p[MAXPATHSIZE];
-} SDL_DollarPath;
-
-typedef struct {
-    SDL_FloatPoint path[DOLLARNPOINTS];
-    unsigned long hash;
-} SDL_DollarTemplate;
-
-typedef struct {
-    SDL_TouchID id;
-    SDL_FloatPoint centroid;
-    SDL_DollarPath dollarPath;
-    Uint16 numDownFingers;
-
-    int numDollarTemplates;
-    SDL_DollarTemplate *dollarTemplate;
-
-    SDL_bool recording;
-} SDL_GestureTouch;
-
-SDL_GestureTouch *SDL_gestureTouch;
-int SDL_numGestureTouches = 0;
-SDL_bool recordAll;
-
-#if 0
-static void PrintPath(SDL_FloatPoint *path)
-{
-    int i;
-    printf("Path:");
-    for (i=0; i<DOLLARNPOINTS; i++) {
-        printf(" (%f,%f)",path[i].x,path[i].y);
-    }
-    printf("\n");
-}
-#endif
-
-int SDL_RecordGesture(SDL_TouchID touchId)
-{
-    int i;
-    if (touchId < 0) recordAll = SDL_TRUE;
-    for (i = 0; i < SDL_numGestureTouches; i++) {
-        if ((touchId < 0) || (SDL_gestureTouch[i].id == touchId)) {
-            SDL_gestureTouch[i].recording = SDL_TRUE;
-            if (touchId >= 0)
-                return 1;
-        }
-    }
-    return (touchId < 0);
-}
-
-static unsigned long SDL_HashDollar(SDL_FloatPoint* points)
-{
-    unsigned long hash = 5381;
-    int i;
-    for (i = 0; i < DOLLARNPOINTS; i++) {
-        hash = ((hash<<5) + hash) + (unsigned long)points[i].x;
-        hash = ((hash<<5) + hash) + (unsigned long)points[i].y;
-    }
-    return hash;
-}
-
-
-static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops * src)
-{
-    if (src == NULL) return 0;
-
-
-    /* No Longer storing the Hash, rehash on load */
-    /* if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0; */
-
-    if (SDL_RWwrite(src,templ->path,
-                    sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS)
-        return 0;
-
-    return 1;
-}
-
-
-int SDL_SaveAllDollarTemplates(SDL_RWops *src)
-{
-    int i,j,rtrn = 0;
-    for (i = 0; i < SDL_numGestureTouches; i++) {
-        SDL_GestureTouch* touch = &SDL_gestureTouch[i];
-        for (j = 0; j < touch->numDollarTemplates; j++) {
-            rtrn += SaveTemplate(&touch->dollarTemplate[i],src);
-        }
-    }
-    return rtrn;
-}
-
-int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *src)
-{
-    int i,j;
-    for (i = 0; i < SDL_numGestureTouches; i++) {
-        SDL_GestureTouch* touch = &SDL_gestureTouch[i];
-        for (j = 0; j < touch->numDollarTemplates; j++) {
-            if (touch->dollarTemplate[i].hash == gestureId) {
-                return SaveTemplate(&touch->dollarTemplate[i],src);
-            }
-        }
-    }
-    return SDL_SetError("Unknown gestureId");
-}
-
-/* path is an already sampled set of points
-Returns the index of the gesture on success, or -1 */
-static int SDL_AddDollarGesture_one(SDL_GestureTouch* inTouch, SDL_FloatPoint* path)
-{
-    SDL_DollarTemplate* dollarTemplate;
-    SDL_DollarTemplate *templ;
-    int index;
-
-    index = inTouch->numDollarTemplates;
-    dollarTemplate =
-        (SDL_DollarTemplate *)SDL_realloc(inTouch->dollarTemplate,
-                                          (index + 1) *
-                                          sizeof(SDL_DollarTemplate));
-    if (!dollarTemplate) {
-        return SDL_OutOfMemory();
-    }
-    inTouch->dollarTemplate = dollarTemplate;
-
-    templ = &inTouch->dollarTemplate[index];
-    SDL_memcpy(templ->path, path, DOLLARNPOINTS*sizeof(SDL_FloatPoint));
-    templ->hash = SDL_HashDollar(templ->path);
-    inTouch->numDollarTemplates++;
-
-    return index;
-}
-
-static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path)
-{
-    int index = -1;
-    int i = 0;
-    if (inTouch == NULL) {
-        if (SDL_numGestureTouches == 0) return -1;
-        for (i = 0; i < SDL_numGestureTouches; i++) {
-            inTouch = &SDL_gestureTouch[i];
-            index = SDL_AddDollarGesture_one(inTouch, path);
-            if (index < 0)
-                return -1;
-        }
-        /* Use the index of the last one added. */
-        return index;
-    } else {
-        return SDL_AddDollarGesture_one(inTouch, path);
-    }
-    return -1;
-}
-
-int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src)
-{
-    int i,loaded = 0;
-    SDL_GestureTouch *touch = NULL;
-    if (src == NULL) return 0;
-    if (touchId >= 0) {
-        for (i = 0; i < SDL_numGestureTouches; i++)
-            if (SDL_gestureTouch[i].id == touchId)
-                touch = &SDL_gestureTouch[i];
-        if (touch == NULL) return -1;
-    }
-
-    while (1) {
-        SDL_DollarTemplate templ;
-
-        if (SDL_RWread(src,templ.path,sizeof(templ.path[0]),DOLLARNPOINTS) <
-           DOLLARNPOINTS) break;
-
-        if (touchId >= 0) {
-            /* printf("Adding loaded gesture to 1 touch\n"); */
-            if (SDL_AddDollarGesture(touch, templ.path) >= 0)
-                loaded++;
-        }
-        else {
-            /* printf("Adding to: %i touches\n",SDL_numGestureTouches); */
-            for (i = 0; i < SDL_numGestureTouches; i++) {
-                touch = &SDL_gestureTouch[i];
-                /* printf("Adding loaded gesture to + touches\n"); */
-                /* TODO: What if this fails? */
-                SDL_AddDollarGesture(touch,templ.path);
-            }
-            loaded++;
-        }
-    }
-
-    return loaded;
-}
-
-
-static float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang)
-{
-    /*  SDL_FloatPoint p[DOLLARNPOINTS]; */
-    float dist = 0;
-    SDL_FloatPoint p;
-    int i;
-    for (i = 0; i < DOLLARNPOINTS; i++) {
-        p.x = (float)(points[i].x * SDL_cos(ang) - points[i].y * SDL_sin(ang));
-        p.y = (float)(points[i].x * SDL_sin(ang) + points[i].y * SDL_cos(ang));
-        dist += (float)(SDL_sqrt((p.x-templ[i].x)*(p.x-templ[i].x)+
-                                 (p.y-templ[i].y)*(p.y-templ[i].y)));
-    }
-    return dist/DOLLARNPOINTS;
-
-}
-
-static float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ)
-{
-    /*------------BEGIN DOLLAR BLACKBOX------------------
-      -TRANSLATED DIRECTLY FROM PSUDEO-CODE AVAILABLE AT-
-      -"http://depts.washington.edu/aimgroup/proj/dollar/"
-    */
-    double ta = -M_PI/4;
-    double tb = M_PI/4;
-    double dt = M_PI/90;
-    float x1 = (float)(PHI*ta + (1-PHI)*tb);
-    float f1 = dollarDifference(points,templ,x1);
-    float x2 = (float)((1-PHI)*ta + PHI*tb);
-    float f2 = dollarDifference(points,templ,x2);
-    while (SDL_fabs(ta-tb) > dt) {
-        if (f1 < f2) {
-            tb = x2;
-            x2 = x1;
-            f2 = f1;
-            x1 = (float)(PHI*ta + (1-PHI)*tb);
-            f1 = dollarDifference(points,templ,x1);
-        }
-        else {
-            ta = x1;
-            x1 = x2;
-            f1 = f2;
-            x2 = (float)((1-PHI)*ta + PHI*tb);
-            f2 = dollarDifference(points,templ,x2);
-        }
-    }
-    /*
-      if (f1 <= f2)
-          printf("Min angle (x1): %f\n",x1);
-      else if (f1 >  f2)
-          printf("Min angle (x2): %f\n",x2);
-    */
-    return SDL_min(f1,f2);
-}
-
-/* DollarPath contains raw points, plus (possibly) the calculated length */
-static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points)
-{
-    int i;
-    float interval;
-    float dist;
-    int numPoints = 0;
-    SDL_FloatPoint centroid;
-    float xmin,xmax,ymin,ymax;
-    float ang;
-    float w,h;
-    float length = path->length;
-
-    /* Calculate length if it hasn't already been done */
-    if (length <= 0) {
-        for (i=1;i < path->numPoints; i++) {
-            float dx = path->p[i  ].x - path->p[i-1].x;
-            float dy = path->p[i  ].y - path->p[i-1].y;
-            length += (float)(SDL_sqrt(dx*dx+dy*dy));
-        }
-    }
-
-    /* Resample */
-    interval = length/(DOLLARNPOINTS - 1);
-    dist = interval;
-
-    centroid.x = 0;centroid.y = 0;
-
-    /* printf("(%f,%f)\n",path->p[path->numPoints-1].x,path->p[path->numPoints-1].y); */
-    for (i = 1; i < path->numPoints; i++) {
-        float d = (float)(SDL_sqrt((path->p[i-1].x-path->p[i].x)*(path->p[i-1].x-path->p[i].x)+
-                                   (path->p[i-1].y-path->p[i].y)*(path->p[i-1].y-path->p[i].y)));
-        /* printf("d = %f dist = %f/%f\n",d,dist,interval); */
-        while (dist + d > interval) {
-            points[numPoints].x = path->p[i-1].x +
-                ((interval-dist)/d)*(path->p[i].x-path->p[i-1].x);
-            points[numPoints].y = path->p[i-1].y +
-                ((interval-dist)/d)*(path->p[i].y-path->p[i-1].y);
-            centroid.x += points[numPoints].x;
-            centroid.y += points[numPoints].y;
-            numPoints++;
-
-            dist -= interval;
-        }
-        dist += d;
-    }
-    if (numPoints < DOLLARNPOINTS-1) {
-        SDL_SetError("ERROR: NumPoints = %i\n",numPoints);
-        return 0;
-    }
-    /* copy the last point */
-    points[DOLLARNPOINTS-1] = path->p[path->numPoints-1];
-    numPoints = DOLLARNPOINTS;
-
-    centroid.x /= numPoints;
-    centroid.y /= numPoints;
-
-    /* printf("Centroid (%f,%f)",centroid.x,centroid.y); */
-    /* Rotate Points so point 0 is left of centroid and solve for the bounding box */
-    xmin = centroid.x;
-    xmax = centroid.x;
-    ymin = centroid.y;
-    ymax = centroid.y;
-
-    ang = (float)(SDL_atan2(centroid.y - points[0].y,
-                            centroid.x - points[0].x));
-
-    for (i = 0; i<numPoints; i++) {
-        float px = points[i].x;
-        float py = points[i].y;
-        points[i].x = (float)((px - centroid.x)*SDL_cos(ang) -
-                              (py - centroid.y)*SDL_sin(ang) + centroid.x);
-        points[i].y = (float)((px - centroid.x)*SDL_sin(ang) +
-                              (py - centroid.y)*SDL_cos(ang) + centroid.y);
-
-
-        if (points[i].x < xmin) xmin = points[i].x;
-        if (points[i].x > xmax) xmax = points[i].x;
-        if (points[i].y < ymin) ymin = points[i].y;
-        if (points[i].y > ymax) ymax = points[i].y;
-    }
-
-    /* Scale points to DOLLARSIZE, and translate to the origin */
-    w = xmax-xmin;
-    h = ymax-ymin;
-
-    for (i=0; i<numPoints; i++) {
-        points[i].x = (points[i].x - centroid.x)*DOLLARSIZE/w;
-        points[i].y = (points[i].y - centroid.y)*DOLLARSIZE/h;
-    }
-    return numPoints;
-}
-
-static float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_GestureTouch* touch)
-{
-    SDL_FloatPoint points[DOLLARNPOINTS];
-    int i;
-    float bestDiff = 10000;
-
-    SDL_memset(points, 0, sizeof(points));
-
-    dollarNormalize(path,points);
-
-    /* PrintPath(points); */
-    *bestTempl = -1;
-    for (i = 0; i < touch->numDollarTemplates; i++) {
-        float diff = bestDollarDifference(points,touch->dollarTemplate[i].path);
-        if (diff < bestDiff) {bestDiff = diff; *bestTempl = i;}
-    }
-    return bestDiff;
-}
-
-int SDL_GestureAddTouch(SDL_TouchID touchId)
-{
-    SDL_GestureTouch *gestureTouch = (SDL_GestureTouch *)SDL_realloc(SDL_gestureTouch,
-                                                                     (SDL_numGestureTouches + 1) *
-                                                                     sizeof(SDL_GestureTouch));
-
-    if (!gestureTouch) {
-        return SDL_OutOfMemory();
-    }
-
-    SDL_gestureTouch = gestureTouch;
-
-    SDL_gestureTouch[SDL_numGestureTouches].numDownFingers = 0;
-    SDL_gestureTouch[SDL_numGestureTouches].id = touchId;
-
-    SDL_gestureTouch[SDL_numGestureTouches].numDollarTemplates = 0;
-
-    SDL_gestureTouch[SDL_numGestureTouches].recording = SDL_FALSE;
-
-    SDL_numGestureTouches++;
-    return 0;
-}
-
-static SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id)
-{
-    int i;
-    for (i = 0; i < SDL_numGestureTouches; i++) {
-        /* printf("%i ?= %i\n",SDL_gestureTouch[i].id,id); */
-        if (SDL_gestureTouch[i].id == id)
-            return &SDL_gestureTouch[i];
-    }
-    return NULL;
-}
-
-int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist)
-{
-    SDL_Event event;
-    event.mgesture.type = SDL_MULTIGESTURE;
-    event.mgesture.touchId = touch->id;
-    event.mgesture.x = touch->centroid.x;
-    event.mgesture.y = touch->centroid.y;
-    event.mgesture.dTheta = dTheta;
-    event.mgesture.dDist = dDist;
-    event.mgesture.numFingers = touch->numDownFingers;
-    return SDL_PushEvent(&event) > 0;
-}
-
-static int SDL_SendGestureDollar(SDL_GestureTouch* touch,
-                          SDL_GestureID gestureId,float error)
-{
-    SDL_Event event;
-    event.dgesture.type = SDL_DOLLARGESTURE;
-    event.dgesture.touchId = touch->id;
-    event.mgesture.x = touch->centroid.x;
-    event.mgesture.y = touch->centroid.y;
-    event.dgesture.gestureId = gestureId;
-    event.dgesture.error = error;
-    /* A finger came up to trigger this event. */
-    event.dgesture.numFingers = touch->numDownFingers + 1;
-    return SDL_PushEvent(&event) > 0;
-}
-
-
-static int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId)
-{
-    SDL_Event event;
-    event.dgesture.type = SDL_DOLLARRECORD;
-    event.dgesture.touchId = touch->id;
-    event.dgesture.gestureId = gestureId;
-    return SDL_PushEvent(&event) > 0;
-}
-
-
-void SDL_GestureProcessEvent(SDL_Event* event)
-{
-    float x,y;
-    SDL_FloatPoint path[DOLLARNPOINTS];
-    int index;
-    int i;
-    float pathDx, pathDy;
-    SDL_FloatPoint lastP;
-    SDL_FloatPoint lastCentroid;
-    float lDist;
-    float Dist;
-    float dtheta;
-    float dDist;
-
-    if (event->type == SDL_FINGERMOTION ||
-        event->type == SDL_FINGERDOWN ||
-        event->type == SDL_FINGERUP) {
-        SDL_GestureTouch* inTouch = SDL_GetGestureTouch(event->tfinger.touchId);
-
-        /* Shouldn't be possible */
-        if (inTouch == NULL) return;
-
-        x = event->tfinger.x;
-        y = event->tfinger.y;
-
-        /* Finger Up */
-        if (event->type == SDL_FINGERUP) {
-            inTouch->numDownFingers--;
-
-#ifdef ENABLE_DOLLAR
-            if (inTouch->recording) {
-                inTouch->recording = SDL_FALSE;
-                dollarNormalize(&inTouch->dollarPath,path);
-                /* PrintPath(path); */
-                if (recordAll) {
-                    index = SDL_AddDollarGesture(NULL,path);
-                    for (i = 0; i < SDL_numGestureTouches; i++)
-                        SDL_gestureTouch[i].recording = SDL_FALSE;
-                }
-                else {
-                    index = SDL_AddDollarGesture(inTouch,path);
-                }
-
-                if (index >= 0) {
-                    SDL_SendDollarRecord(inTouch,inTouch->dollarTemplate[index].hash);
-                }
-                else {
-                    SDL_SendDollarRecord(inTouch,-1);
-                }
-            }
-            else {
-                int bestTempl;
-                float error;
-                error = dollarRecognize(&inTouch->dollarPath,
-                                        &bestTempl,inTouch);
-                if (bestTempl >= 0){
-                    /* Send Event */
-                    unsigned long gestureId = inTouch->dollarTemplate[bestTempl].hash;
-                    SDL_SendGestureDollar(inTouch,gestureId,error);
-                    /* printf ("%s\n",);("Dollar error: %f\n",error); */
-                }
-            }
-#endif
-            /* inTouch->gestureLast[j] = inTouch->gestureLast[inTouch->numDownFingers]; */
-            if (inTouch->numDownFingers > 0) {
-                inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers+1)-
-                                       x)/inTouch->numDownFingers;
-                inTouch->centroid.y = (inTouch->centroid.y*(inTouch->numDownFingers+1)-
-                                       y)/inTouch->numDownFingers;
-            }
-        }
-        else if (event->type == SDL_FINGERMOTION) {
-            float dx = event->tfinger.dx;
-            float dy = event->tfinger.dy;
-#ifdef ENABLE_DOLLAR
-            SDL_DollarPath* path = &inTouch->dollarPath;
-            if (path->numPoints < MAXPATHSIZE) {
-                path->p[path->numPoints].x = inTouch->centroid.x;
-                path->p[path->numPoints].y = inTouch->centroid.y;
-                pathDx =
-                    (path->p[path->numPoints].x-path->p[path->numPoints-1].x);
-                pathDy =
-                    (path->p[path->numPoints].y-path->p[path->numPoints-1].y);
-                path->length += (float)SDL_sqrt(pathDx*pathDx + pathDy*pathDy);
-                path->numPoints++;
-            }
-#endif
-            lastP.x = x - dx;
-            lastP.y = y - dy;
-            lastCentroid = inTouch->centroid;
-
-            inTouch->centroid.x += dx/inTouch->numDownFingers;
-            inTouch->centroid.y += dy/inTouch->numDownFingers;
-            /* printf("Centrid : (%f,%f)\n",inTouch->centroid.x,inTouch->centroid.y); */
-            if (inTouch->numDownFingers > 1) {
-                SDL_FloatPoint lv; /* Vector from centroid to last x,y position */
-                SDL_FloatPoint v; /* Vector from centroid to current x,y position */
-                /* lv = inTouch->gestureLast[j].cv; */
-                lv.x = lastP.x - lastCentroid.x;
-                lv.y = lastP.y - lastCentroid.y;
-                lDist = (float)SDL_sqrt(lv.x*lv.x + lv.y*lv.y);
-                /* printf("lDist = %f\n",lDist); */
-                v.x = x - inTouch->centroid.x;
-                v.y = y - inTouch->centroid.y;
-                /* inTouch->gestureLast[j].cv = v; */
-                Dist = (float)SDL_sqrt(v.x*v.x+v.y*v.y);
-                /* SDL_cos(dTheta) = (v . lv)/(|v| * |lv|) */
-
-                /* Normalize Vectors to simplify angle calculation */
-                lv.x/=lDist;
-                lv.y/=lDist;
-                v.x/=Dist;
-                v.y/=Dist;
-                dtheta = (float)SDL_atan2(lv.x*v.y - lv.y*v.x,lv.x*v.x + lv.y*v.y);
-
-                dDist = (Dist - lDist);
-                if (lDist == 0) {dDist = 0;dtheta = 0;} /* To avoid impossible values */
-
-                /* inTouch->gestureLast[j].dDist = dDist;
-                inTouch->gestureLast[j].dtheta = dtheta;
-
-                printf("dDist = %f, dTheta = %f\n",dDist,dtheta);
-                gdtheta = gdtheta*.9 + dtheta*.1;
-                gdDist  =  gdDist*.9 +  dDist*.1
-                knob.r += dDist/numDownFingers;
-                knob.ang += dtheta;
-                printf("thetaSum = %f, distSum = %f\n",gdtheta,gdDist);
-                printf("id: %i dTheta = %f, dDist = %f\n",j,dtheta,dDist); */
-                SDL_SendGestureMulti(inTouch,dtheta,dDist);
-            }
-            else {
-                /* inTouch->gestureLast[j].dDist = 0;
-                inTouch->gestureLast[j].dtheta = 0;
-                inTouch->gestureLast[j].cv.x = 0;
-                inTouch->gestureLast[j].cv.y = 0; */
-            }
-            /* inTouch->gestureLast[j].f.p.x = x;
-            inTouch->gestureLast[j].f.p.y = y;
-            break;
-            pressure? */
-        }
-
-        if (event->type == SDL_FINGERDOWN) {
-
-            inTouch->numDownFingers++;
-            inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers - 1)+
-                                   x)/inTouch->numDownFingers;
-            inTouch->centroid.y = (inTouch->centroid.y*(inTouch->numDownFingers - 1)+
-                                   y)/inTouch->numDownFingers;
-            /* printf("Finger Down: (%f,%f). Centroid: (%f,%f\n",x,y,
-                 inTouch->centroid.x,inTouch->centroid.y); */
-
-#ifdef ENABLE_DOLLAR
-            inTouch->dollarPath.length = 0;
-            inTouch->dollarPath.p[0].x = x;
-            inTouch->dollarPath.p[0].y = y;
-            inTouch->dollarPath.numPoints = 1;
-#endif
-        }
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_gesture_c.h b/deps/SDL2/src/events/SDL_gesture_c.h
deleted file mode 100644
index 08ba2e8..0000000
--- a/deps/SDL2/src/events/SDL_gesture_c.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_gesture_c_h
-#define _SDL_gesture_c_h
-
-extern int SDL_GestureAddTouch(SDL_TouchID touchId);
-
-extern void SDL_GestureProcessEvent(SDL_Event* event);
-
-extern int SDL_RecordGesture(SDL_TouchID touchId);
-
-#endif /* _SDL_gesture_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_keyboard.c b/deps/SDL2/src/events/SDL_keyboard.c
deleted file mode 100644
index 34d94d0..0000000
--- a/deps/SDL2/src/events/SDL_keyboard.c
+++ /dev/null
@@ -1,1013 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* General keyboard handling code for SDL */
-
-#include "SDL_timer.h"
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-#include "../video/SDL_sysvideo.h"
-
-
-/* #define DEBUG_KEYBOARD */
-
-/* Global keyboard information */
-
-typedef struct SDL_Keyboard SDL_Keyboard;
-
-struct SDL_Keyboard
-{
-    /* Data common to all keyboards */
-    SDL_Window *focus;
-    Uint16 modstate;
-    Uint8 keystate[SDL_NUM_SCANCODES];
-    SDL_Keycode keymap[SDL_NUM_SCANCODES];
-};
-
-static SDL_Keyboard SDL_keyboard;
-
-static const SDL_Keycode SDL_default_keymap[SDL_NUM_SCANCODES] = {
-    0, 0, 0, 0,
-    'a',
-    'b',
-    'c',
-    'd',
-    'e',
-    'f',
-    'g',
-    'h',
-    'i',
-    'j',
-    'k',
-    'l',
-    'm',
-    'n',
-    'o',
-    'p',
-    'q',
-    'r',
-    's',
-    't',
-    'u',
-    'v',
-    'w',
-    'x',
-    'y',
-    'z',
-    '1',
-    '2',
-    '3',
-    '4',
-    '5',
-    '6',
-    '7',
-    '8',
-    '9',
-    '0',
-    SDLK_RETURN,
-    SDLK_ESCAPE,
-    SDLK_BACKSPACE,
-    SDLK_TAB,
-    SDLK_SPACE,
-    '-',
-    '=',
-    '[',
-    ']',
-    '\\',
-    '#',
-    ';',
-    '\'',
-    '`',
-    ',',
-    '.',
-    '/',
-    SDLK_CAPSLOCK,
-    SDLK_F1,
-    SDLK_F2,
-    SDLK_F3,
-    SDLK_F4,
-    SDLK_F5,
-    SDLK_F6,
-    SDLK_F7,
-    SDLK_F8,
-    SDLK_F9,
-    SDLK_F10,
-    SDLK_F11,
-    SDLK_F12,
-    SDLK_PRINTSCREEN,
-    SDLK_SCROLLLOCK,
-    SDLK_PAUSE,
-    SDLK_INSERT,
-    SDLK_HOME,
-    SDLK_PAGEUP,
-    SDLK_DELETE,
-    SDLK_END,
-    SDLK_PAGEDOWN,
-    SDLK_RIGHT,
-    SDLK_LEFT,
-    SDLK_DOWN,
-    SDLK_UP,
-    SDLK_NUMLOCKCLEAR,
-    SDLK_KP_DIVIDE,
-    SDLK_KP_MULTIPLY,
-    SDLK_KP_MINUS,
-    SDLK_KP_PLUS,
-    SDLK_KP_ENTER,
-    SDLK_KP_1,
-    SDLK_KP_2,
-    SDLK_KP_3,
-    SDLK_KP_4,
-    SDLK_KP_5,
-    SDLK_KP_6,
-    SDLK_KP_7,
-    SDLK_KP_8,
-    SDLK_KP_9,
-    SDLK_KP_0,
-    SDLK_KP_PERIOD,
-    0,
-    SDLK_APPLICATION,
-    SDLK_POWER,
-    SDLK_KP_EQUALS,
-    SDLK_F13,
-    SDLK_F14,
-    SDLK_F15,
-    SDLK_F16,
-    SDLK_F17,
-    SDLK_F18,
-    SDLK_F19,
-    SDLK_F20,
-    SDLK_F21,
-    SDLK_F22,
-    SDLK_F23,
-    SDLK_F24,
-    SDLK_EXECUTE,
-    SDLK_HELP,
-    SDLK_MENU,
-    SDLK_SELECT,
-    SDLK_STOP,
-    SDLK_AGAIN,
-    SDLK_UNDO,
-    SDLK_CUT,
-    SDLK_COPY,
-    SDLK_PASTE,
-    SDLK_FIND,
-    SDLK_MUTE,
-    SDLK_VOLUMEUP,
-    SDLK_VOLUMEDOWN,
-    0, 0, 0,
-    SDLK_KP_COMMA,
-    SDLK_KP_EQUALSAS400,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    SDLK_ALTERASE,
-    SDLK_SYSREQ,
-    SDLK_CANCEL,
-    SDLK_CLEAR,
-    SDLK_PRIOR,
-    SDLK_RETURN2,
-    SDLK_SEPARATOR,
-    SDLK_OUT,
-    SDLK_OPER,
-    SDLK_CLEARAGAIN,
-    SDLK_CRSEL,
-    SDLK_EXSEL,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    SDLK_KP_00,
-    SDLK_KP_000,
-    SDLK_THOUSANDSSEPARATOR,
-    SDLK_DECIMALSEPARATOR,
-    SDLK_CURRENCYUNIT,
-    SDLK_CURRENCYSUBUNIT,
-    SDLK_KP_LEFTPAREN,
-    SDLK_KP_RIGHTPAREN,
-    SDLK_KP_LEFTBRACE,
-    SDLK_KP_RIGHTBRACE,
-    SDLK_KP_TAB,
-    SDLK_KP_BACKSPACE,
-    SDLK_KP_A,
-    SDLK_KP_B,
-    SDLK_KP_C,
-    SDLK_KP_D,
-    SDLK_KP_E,
-    SDLK_KP_F,
-    SDLK_KP_XOR,
-    SDLK_KP_POWER,
-    SDLK_KP_PERCENT,
-    SDLK_KP_LESS,
-    SDLK_KP_GREATER,
-    SDLK_KP_AMPERSAND,
-    SDLK_KP_DBLAMPERSAND,
-    SDLK_KP_VERTICALBAR,
-    SDLK_KP_DBLVERTICALBAR,
-    SDLK_KP_COLON,
-    SDLK_KP_HASH,
-    SDLK_KP_SPACE,
-    SDLK_KP_AT,
-    SDLK_KP_EXCLAM,
-    SDLK_KP_MEMSTORE,
-    SDLK_KP_MEMRECALL,
-    SDLK_KP_MEMCLEAR,
-    SDLK_KP_MEMADD,
-    SDLK_KP_MEMSUBTRACT,
-    SDLK_KP_MEMMULTIPLY,
-    SDLK_KP_MEMDIVIDE,
-    SDLK_KP_PLUSMINUS,
-    SDLK_KP_CLEAR,
-    SDLK_KP_CLEARENTRY,
-    SDLK_KP_BINARY,
-    SDLK_KP_OCTAL,
-    SDLK_KP_DECIMAL,
-    SDLK_KP_HEXADECIMAL,
-    0, 0,
-    SDLK_LCTRL,
-    SDLK_LSHIFT,
-    SDLK_LALT,
-    SDLK_LGUI,
-    SDLK_RCTRL,
-    SDLK_RSHIFT,
-    SDLK_RALT,
-    SDLK_RGUI,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    SDLK_MODE,
-    SDLK_AUDIONEXT,
-    SDLK_AUDIOPREV,
-    SDLK_AUDIOSTOP,
-    SDLK_AUDIOPLAY,
-    SDLK_AUDIOMUTE,
-    SDLK_MEDIASELECT,
-    SDLK_WWW,
-    SDLK_MAIL,
-    SDLK_CALCULATOR,
-    SDLK_COMPUTER,
-    SDLK_AC_SEARCH,
-    SDLK_AC_HOME,
-    SDLK_AC_BACK,
-    SDLK_AC_FORWARD,
-    SDLK_AC_STOP,
-    SDLK_AC_REFRESH,
-    SDLK_AC_BOOKMARKS,
-    SDLK_BRIGHTNESSDOWN,
-    SDLK_BRIGHTNESSUP,
-    SDLK_DISPLAYSWITCH,
-    SDLK_KBDILLUMTOGGLE,
-    SDLK_KBDILLUMDOWN,
-    SDLK_KBDILLUMUP,
-    SDLK_EJECT,
-    SDLK_SLEEP,
-};
-
-static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = {
-    NULL, NULL, NULL, NULL,
-    "A",
-    "B",
-    "C",
-    "D",
-    "E",
-    "F",
-    "G",
-    "H",
-    "I",
-    "J",
-    "K",
-    "L",
-    "M",
-    "N",
-    "O",
-    "P",
-    "Q",
-    "R",
-    "S",
-    "T",
-    "U",
-    "V",
-    "W",
-    "X",
-    "Y",
-    "Z",
-    "1",
-    "2",
-    "3",
-    "4",
-    "5",
-    "6",
-    "7",
-    "8",
-    "9",
-    "0",
-    "Return",
-    "Escape",
-    "Backspace",
-    "Tab",
-    "Space",
-    "-",
-    "=",
-    "[",
-    "]",
-    "\\",
-    "#",
-    ";",
-    "'",
-    "`",
-    ",",
-    ".",
-    "/",
-    "CapsLock",
-    "F1",
-    "F2",
-    "F3",
-    "F4",
-    "F5",
-    "F6",
-    "F7",
-    "F8",
-    "F9",
-    "F10",
-    "F11",
-    "F12",
-    "PrintScreen",
-    "ScrollLock",
-    "Pause",
-    "Insert",
-    "Home",
-    "PageUp",
-    "Delete",
-    "End",
-    "PageDown",
-    "Right",
-    "Left",
-    "Down",
-    "Up",
-    "Numlock",
-    "Keypad /",
-    "Keypad *",
-    "Keypad -",
-    "Keypad +",
-    "Keypad Enter",
-    "Keypad 1",
-    "Keypad 2",
-    "Keypad 3",
-    "Keypad 4",
-    "Keypad 5",
-    "Keypad 6",
-    "Keypad 7",
-    "Keypad 8",
-    "Keypad 9",
-    "Keypad 0",
-    "Keypad .",
-    NULL,
-    "Application",
-    "Power",
-    "Keypad =",
-    "F13",
-    "F14",
-    "F15",
-    "F16",
-    "F17",
-    "F18",
-    "F19",
-    "F20",
-    "F21",
-    "F22",
-    "F23",
-    "F24",
-    "Execute",
-    "Help",
-    "Menu",
-    "Select",
-    "Stop",
-    "Again",
-    "Undo",
-    "Cut",
-    "Copy",
-    "Paste",
-    "Find",
-    "Mute",
-    "VolumeUp",
-    "VolumeDown",
-    NULL, NULL, NULL,
-    "Keypad ,",
-    "Keypad = (AS400)",
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL, NULL, NULL,
-    "AltErase",
-    "SysReq",
-    "Cancel",
-    "Clear",
-    "Prior",
-    "Return",
-    "Separator",
-    "Out",
-    "Oper",
-    "Clear / Again",
-    "CrSel",
-    "ExSel",
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    "Keypad 00",
-    "Keypad 000",
-    "ThousandsSeparator",
-    "DecimalSeparator",
-    "CurrencyUnit",
-    "CurrencySubUnit",
-    "Keypad (",
-    "Keypad )",
-    "Keypad {",
-    "Keypad }",
-    "Keypad Tab",
-    "Keypad Backspace",
-    "Keypad A",
-    "Keypad B",
-    "Keypad C",
-    "Keypad D",
-    "Keypad E",
-    "Keypad F",
-    "Keypad XOR",
-    "Keypad ^",
-    "Keypad %",
-    "Keypad <",
-    "Keypad >",
-    "Keypad &",
-    "Keypad &&",
-    "Keypad |",
-    "Keypad ||",
-    "Keypad :",
-    "Keypad #",
-    "Keypad Space",
-    "Keypad @",
-    "Keypad !",
-    "Keypad MemStore",
-    "Keypad MemRecall",
-    "Keypad MemClear",
-    "Keypad MemAdd",
-    "Keypad MemSubtract",
-    "Keypad MemMultiply",
-    "Keypad MemDivide",
-    "Keypad +/-",
-    "Keypad Clear",
-    "Keypad ClearEntry",
-    "Keypad Binary",
-    "Keypad Octal",
-    "Keypad Decimal",
-    "Keypad Hexadecimal",
-    NULL, NULL,
-    "Left Ctrl",
-    "Left Shift",
-    "Left Alt",
-    "Left GUI",
-    "Right Ctrl",
-    "Right Shift",
-    "Right Alt",
-    "Right GUI",
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-    NULL,
-    "ModeSwitch",
-    "AudioNext",
-    "AudioPrev",
-    "AudioStop",
-    "AudioPlay",
-    "AudioMute",
-    "MediaSelect",
-    "WWW",
-    "Mail",
-    "Calculator",
-    "Computer",
-    "AC Search",
-    "AC Home",
-    "AC Back",
-    "AC Forward",
-    "AC Stop",
-    "AC Refresh",
-    "AC Bookmarks",
-    "BrightnessDown",
-    "BrightnessUp",
-    "DisplaySwitch",
-    "KBDIllumToggle",
-    "KBDIllumDown",
-    "KBDIllumUp",
-    "Eject",
-    "Sleep",
-};
-
-/* Taken from SDL_iconv() */
-char *
-SDL_UCS4ToUTF8(Uint32 ch, char *dst)
-{
-    Uint8 *p = (Uint8 *) dst;
-    if (ch <= 0x7F) {
-        *p = (Uint8) ch;
-        ++dst;
-    } else if (ch <= 0x7FF) {
-        p[0] = 0xC0 | (Uint8) ((ch >> 6) & 0x1F);
-        p[1] = 0x80 | (Uint8) (ch & 0x3F);
-        dst += 2;
-    } else if (ch <= 0xFFFF) {
-        p[0] = 0xE0 | (Uint8) ((ch >> 12) & 0x0F);
-        p[1] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
-        p[2] = 0x80 | (Uint8) (ch & 0x3F);
-        dst += 3;
-    } else if (ch <= 0x1FFFFF) {
-        p[0] = 0xF0 | (Uint8) ((ch >> 18) & 0x07);
-        p[1] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
-        p[2] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
-        p[3] = 0x80 | (Uint8) (ch & 0x3F);
-        dst += 4;
-    } else if (ch <= 0x3FFFFFF) {
-        p[0] = 0xF8 | (Uint8) ((ch >> 24) & 0x03);
-        p[1] = 0x80 | (Uint8) ((ch >> 18) & 0x3F);
-        p[2] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
-        p[3] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
-        p[4] = 0x80 | (Uint8) (ch & 0x3F);
-        dst += 5;
-    } else {
-        p[0] = 0xFC | (Uint8) ((ch >> 30) & 0x01);
-        p[1] = 0x80 | (Uint8) ((ch >> 24) & 0x3F);
-        p[2] = 0x80 | (Uint8) ((ch >> 18) & 0x3F);
-        p[3] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
-        p[4] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
-        p[5] = 0x80 | (Uint8) (ch & 0x3F);
-        dst += 6;
-    }
-    return dst;
-}
-
-/* Public functions */
-int
-SDL_KeyboardInit(void)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-
-    /* Set the default keymap */
-    SDL_memcpy(keyboard->keymap, SDL_default_keymap, sizeof(SDL_default_keymap));
-    return (0);
-}
-
-void
-SDL_ResetKeyboard(void)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-    SDL_Scancode scancode;
-
-#ifdef DEBUG_KEYBOARD
-    printf("Resetting keyboard\n");
-#endif
-    for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) {
-        if (keyboard->keystate[scancode] == SDL_PRESSED) {
-            SDL_SendKeyboardKey(SDL_RELEASED, scancode);
-        }
-    }
-}
-
-void
-SDL_GetDefaultKeymap(SDL_Keycode * keymap)
-{
-    SDL_memcpy(keymap, SDL_default_keymap, sizeof(SDL_default_keymap));
-}
-
-void
-SDL_SetKeymap(int start, SDL_Keycode * keys, int length)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-
-    if (start < 0 || start + length > SDL_NUM_SCANCODES) {
-        return;
-    }
-
-    SDL_memcpy(&keyboard->keymap[start], keys, sizeof(*keys) * length);
-}
-
-void
-SDL_SetScancodeName(SDL_Scancode scancode, const char *name)
-{
-    SDL_scancode_names[scancode] = name;
-}
-
-SDL_Window *
-SDL_GetKeyboardFocus(void)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-
-    return keyboard->focus;
-}
-
-void
-SDL_SetKeyboardFocus(SDL_Window * window)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-
-    if (keyboard->focus && !window) {
-        /* We won't get anymore keyboard messages, so reset keyboard state */
-        SDL_ResetKeyboard();
-    }
-
-    /* See if the current window has lost focus */
-    if (keyboard->focus && keyboard->focus != window) {
-        SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_LOST,
-                            0, 0);
-
-        /* Ensures IME compositions are committed */
-        if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
-            SDL_VideoDevice *video = SDL_GetVideoDevice();
-            if (video && video->StopTextInput) {
-                video->StopTextInput(video);
-            }
-        }
-    }
-
-    keyboard->focus = window;
-
-    if (keyboard->focus) {
-        SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_GAINED,
-                            0, 0);
-
-        if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
-            SDL_VideoDevice *video = SDL_GetVideoDevice();
-            if (video && video->StartTextInput) {
-                video->StartTextInput(video);
-            }
-        }
-    }
-}
-
-int
-SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-    int posted;
-    Uint16 modstate;
-    Uint32 type;
-    Uint8 repeat;
-
-    if (!scancode) {
-        return 0;
-    }
-#ifdef DEBUG_KEYBOARD
-    printf("The '%s' key has been %s\n", SDL_GetScancodeName(scancode),
-           state == SDL_PRESSED ? "pressed" : "released");
-#endif
-    if (state == SDL_PRESSED) {
-        modstate = keyboard->modstate;
-        switch (scancode) {
-        case SDL_SCANCODE_NUMLOCKCLEAR:
-            keyboard->modstate ^= KMOD_NUM;
-            break;
-        case SDL_SCANCODE_CAPSLOCK:
-            keyboard->modstate ^= KMOD_CAPS;
-            break;
-        case SDL_SCANCODE_LCTRL:
-            keyboard->modstate |= KMOD_LCTRL;
-            break;
-        case SDL_SCANCODE_RCTRL:
-            keyboard->modstate |= KMOD_RCTRL;
-            break;
-        case SDL_SCANCODE_LSHIFT:
-            keyboard->modstate |= KMOD_LSHIFT;
-            break;
-        case SDL_SCANCODE_RSHIFT:
-            keyboard->modstate |= KMOD_RSHIFT;
-            break;
-        case SDL_SCANCODE_LALT:
-            keyboard->modstate |= KMOD_LALT;
-            break;
-        case SDL_SCANCODE_RALT:
-            keyboard->modstate |= KMOD_RALT;
-            break;
-        case SDL_SCANCODE_LGUI:
-            keyboard->modstate |= KMOD_LGUI;
-            break;
-        case SDL_SCANCODE_RGUI:
-            keyboard->modstate |= KMOD_RGUI;
-            break;
-        case SDL_SCANCODE_MODE:
-            keyboard->modstate |= KMOD_MODE;
-            break;
-        default:
-            break;
-        }
-    } else {
-        switch (scancode) {
-        case SDL_SCANCODE_NUMLOCKCLEAR:
-        case SDL_SCANCODE_CAPSLOCK:
-            break;
-        case SDL_SCANCODE_LCTRL:
-            keyboard->modstate &= ~KMOD_LCTRL;
-            break;
-        case SDL_SCANCODE_RCTRL:
-            keyboard->modstate &= ~KMOD_RCTRL;
-            break;
-        case SDL_SCANCODE_LSHIFT:
-            keyboard->modstate &= ~KMOD_LSHIFT;
-            break;
-        case SDL_SCANCODE_RSHIFT:
-            keyboard->modstate &= ~KMOD_RSHIFT;
-            break;
-        case SDL_SCANCODE_LALT:
-            keyboard->modstate &= ~KMOD_LALT;
-            break;
-        case SDL_SCANCODE_RALT:
-            keyboard->modstate &= ~KMOD_RALT;
-            break;
-        case SDL_SCANCODE_LGUI:
-            keyboard->modstate &= ~KMOD_LGUI;
-            break;
-        case SDL_SCANCODE_RGUI:
-            keyboard->modstate &= ~KMOD_RGUI;
-            break;
-        case SDL_SCANCODE_MODE:
-            keyboard->modstate &= ~KMOD_MODE;
-            break;
-        default:
-            break;
-        }
-        modstate = keyboard->modstate;
-    }
-
-    /* Figure out what type of event this is */
-    switch (state) {
-    case SDL_PRESSED:
-        type = SDL_KEYDOWN;
-        break;
-    case SDL_RELEASED:
-        type = SDL_KEYUP;
-        break;
-    default:
-        /* Invalid state -- bail */
-        return 0;
-    }
-
-    /* Drop events that don't change state */
-    repeat = (state && keyboard->keystate[scancode]);
-    if (keyboard->keystate[scancode] == state && !repeat) {
-#if 0
-        printf("Keyboard event didn't change state - dropped!\n");
-#endif
-        return 0;
-    }
-
-    /* Update internal keyboard state */
-    keyboard->keystate[scancode] = state;
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(type) == SDL_ENABLE) {
-        SDL_Event event;
-        event.key.type = type;
-        event.key.state = state;
-        event.key.repeat = repeat;
-        event.key.keysym.scancode = scancode;
-        event.key.keysym.sym = keyboard->keymap[scancode];
-        event.key.keysym.mod = modstate;
-        event.key.windowID = keyboard->focus ? keyboard->focus->id : 0;
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    return (posted);
-}
-
-int
-SDL_SendKeyboardText(const char *text)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-    int posted;
-
-    /* Don't post text events for unprintable characters */
-    if ((unsigned char)*text < ' ' || *text == 127) {
-        return 0;
-    }
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) {
-        SDL_Event event;
-        event.text.type = SDL_TEXTINPUT;
-        event.text.windowID = keyboard->focus ? keyboard->focus->id : 0;
-        SDL_utf8strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    return (posted);
-}
-
-int
-SDL_SendEditingText(const char *text, int start, int length)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-    int posted;
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(SDL_TEXTEDITING) == SDL_ENABLE) {
-        SDL_Event event;
-        event.edit.type = SDL_TEXTEDITING;
-        event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0;
-        event.edit.start = start;
-        event.edit.length = length;
-        SDL_utf8strlcpy(event.edit.text, text, SDL_arraysize(event.edit.text));
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    return (posted);
-}
-
-void
-SDL_KeyboardQuit(void)
-{
-}
-
-const Uint8 *
-SDL_GetKeyboardState(int *numkeys)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-
-    if (numkeys != (int *) 0) {
-        *numkeys = SDL_NUM_SCANCODES;
-    }
-    return keyboard->keystate;
-}
-
-SDL_Keymod
-SDL_GetModState(void)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-
-    return keyboard->modstate;
-}
-
-void
-SDL_SetModState(SDL_Keymod modstate)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-
-    keyboard->modstate = modstate;
-}
-
-SDL_Keycode
-SDL_GetKeyFromScancode(SDL_Scancode scancode)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-
-    if (scancode < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) {
-          SDL_InvalidParamError("scancode");
-          return 0;
-    }
-
-    return keyboard->keymap[scancode];
-}
-
-SDL_Scancode
-SDL_GetScancodeFromKey(SDL_Keycode key)
-{
-    SDL_Keyboard *keyboard = &SDL_keyboard;
-    SDL_Scancode scancode;
-
-    for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES;
-         ++scancode) {
-        if (keyboard->keymap[scancode] == key) {
-            return scancode;
-        }
-    }
-    return SDL_SCANCODE_UNKNOWN;
-}
-
-const char *
-SDL_GetScancodeName(SDL_Scancode scancode)
-{
-    const char *name;
-    if (scancode < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) {
-          SDL_InvalidParamError("scancode");
-          return "";
-    }
-
-    name = SDL_scancode_names[scancode];
-    if (name)
-        return name;
-    else
-        return "";
-}
-
-SDL_Scancode SDL_GetScancodeFromName(const char *name)
-{
-    int i;
-
-    if (!name || !*name) {
-            SDL_InvalidParamError("name");
-        return SDL_SCANCODE_UNKNOWN;
-    }
-
-    for (i = 0; i < SDL_arraysize(SDL_scancode_names); ++i) {
-        if (!SDL_scancode_names[i]) {
-            continue;
-        }
-        if (SDL_strcasecmp(name, SDL_scancode_names[i]) == 0) {
-            return (SDL_Scancode)i;
-        }
-    }
-
-    SDL_InvalidParamError("name");
-    return SDL_SCANCODE_UNKNOWN;
-}
-
-const char *
-SDL_GetKeyName(SDL_Keycode key)
-{
-    static char name[8];
-    char *end;
-
-    if (key & SDLK_SCANCODE_MASK) {
-        return
-            SDL_GetScancodeName((SDL_Scancode) (key & ~SDLK_SCANCODE_MASK));
-    }
-
-    switch (key) {
-    case SDLK_RETURN:
-        return SDL_GetScancodeName(SDL_SCANCODE_RETURN);
-    case SDLK_ESCAPE:
-        return SDL_GetScancodeName(SDL_SCANCODE_ESCAPE);
-    case SDLK_BACKSPACE:
-        return SDL_GetScancodeName(SDL_SCANCODE_BACKSPACE);
-    case SDLK_TAB:
-        return SDL_GetScancodeName(SDL_SCANCODE_TAB);
-    case SDLK_SPACE:
-        return SDL_GetScancodeName(SDL_SCANCODE_SPACE);
-    case SDLK_DELETE:
-        return SDL_GetScancodeName(SDL_SCANCODE_DELETE);
-    default:
-        /* Unaccented letter keys on latin keyboards are normally
-           labeled in upper case (and probably on others like Greek or
-           Cyrillic too, so if you happen to know for sure, please
-           adapt this). */
-        if (key >= 'a' && key <= 'z') {
-            key -= 32;
-        }
-
-        end = SDL_UCS4ToUTF8((Uint32) key, name);
-        *end = '\0';
-        return name;
-    }
-}
-
-SDL_Keycode
-SDL_GetKeyFromName(const char *name)
-{
-    SDL_Keycode key;
-
-        /* Check input */
-        if (name == NULL) return SDLK_UNKNOWN;
-
-    /* If it's a single UTF-8 character, then that's the keycode itself */
-    key = *(const unsigned char *)name;
-    if (key >= 0xF0) {
-        if (SDL_strlen(name) == 4) {
-            int i = 0;
-            key  = (Uint16)(name[i]&0x07) << 18;
-            key |= (Uint16)(name[++i]&0x3F) << 12;
-            key |= (Uint16)(name[++i]&0x3F) << 6;
-            key |= (Uint16)(name[++i]&0x3F);
-            return key;
-        }
-        return SDLK_UNKNOWN;
-    } else if (key >= 0xE0) {
-        if (SDL_strlen(name) == 3) {
-            int i = 0;
-            key  = (Uint16)(name[i]&0x0F) << 12;
-            key |= (Uint16)(name[++i]&0x3F) << 6;
-            key |= (Uint16)(name[++i]&0x3F);
-            return key;
-        }
-        return SDLK_UNKNOWN;
-    } else if (key >= 0xC0) {
-        if (SDL_strlen(name) == 2) {
-            int i = 0;
-            key  = (Uint16)(name[i]&0x1F) << 6;
-            key |= (Uint16)(name[++i]&0x3F);
-            return key;
-        }
-        return SDLK_UNKNOWN;
-    } else {
-        if (SDL_strlen(name) == 1) {
-            if (key >= 'A' && key <= 'Z') {
-                key += 32;
-            }
-            return key;
-        }
-
-        /* Get the scancode for this name, and the associated keycode */
-        return SDL_default_keymap[SDL_GetScancodeFromName(name)];
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_keyboard_c.h b/deps/SDL2/src/events/SDL_keyboard_c.h
deleted file mode 100644
index cd9f1bb..0000000
--- a/deps/SDL2/src/events/SDL_keyboard_c.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_keyboard_c_h
-#define _SDL_keyboard_c_h
-
-#include "SDL_keycode.h"
-#include "SDL_events.h"
-
-/* Initialize the keyboard subsystem */
-extern int SDL_KeyboardInit(void);
-
-/* Clear the state of the keyboard */
-extern void SDL_ResetKeyboard(void);
-
-/* Get the default keymap */
-extern void SDL_GetDefaultKeymap(SDL_Keycode * keymap);
-
-/* Set the mapping of scancode to key codes */
-extern void SDL_SetKeymap(int start, SDL_Keycode * keys, int length);
-
-/* Set a platform-dependent key name, overriding the default platform-agnostic
-   name. Encoded as UTF-8. The string is not copied, thus the pointer given to
-   this function must stay valid forever (or at least until the call to
-   VideoQuit()). */
-extern void SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
-
-/* Set the keyboard focus window */
-extern void SDL_SetKeyboardFocus(SDL_Window * window);
-
-/* Send a keyboard key event */
-extern int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode);
-
-/* Send keyboard text input */
-extern int SDL_SendKeyboardText(const char *text);
-
-/* Send editing text for selected range from start to end */
-extern int SDL_SendEditingText(const char *text, int start, int end);
-
-/* Shutdown the keyboard subsystem */
-extern void SDL_KeyboardQuit(void);
-
-/* Convert to UTF-8 */
-extern char *SDL_UCS4ToUTF8(Uint32 ch, char *dst);
-
-#endif /* _SDL_keyboard_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_mouse.c b/deps/SDL2/src/events/SDL_mouse.c
deleted file mode 100644
index 0886f54..0000000
--- a/deps/SDL2/src/events/SDL_mouse.c
+++ /dev/null
@@ -1,721 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* General mouse handling code for SDL */
-
-#include "SDL_assert.h"
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-#include "default_cursor.h"
-#include "../video/SDL_sysvideo.h"
-
-/* #define DEBUG_MOUSE */
-
-/* The mouse state */
-static SDL_Mouse SDL_mouse;
-
-static int
-SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y);
-
-/* Public functions */
-int
-SDL_MouseInit(void)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    mouse->cursor_shown = SDL_TRUE;
-
-    return (0);
-}
-
-void
-SDL_SetDefaultCursor(SDL_Cursor * cursor)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    mouse->def_cursor = cursor;
-    if (!mouse->cur_cursor) {
-        SDL_SetCursor(cursor);
-    }
-}
-
-SDL_Mouse *
-SDL_GetMouse(void)
-{
-    return &SDL_mouse;
-}
-
-SDL_Window *
-SDL_GetMouseFocus(void)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    return mouse->focus;
-}
-
-void
-SDL_ResetMouse(void)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    Uint8 i;
-
-#ifdef DEBUG_MOUSE
-    printf("Resetting mouse\n");
-#endif
-    for (i = 1; i <= sizeof(mouse->buttonstate)*8; ++i) {
-        if (mouse->buttonstate & SDL_BUTTON(i)) {
-            SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, i);
-        }
-    }
-    SDL_assert(mouse->buttonstate == 0);
-}
-
-void
-SDL_SetMouseFocus(SDL_Window * window)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    if (mouse->focus == window) {
-        return;
-    }
-
-    /* Actually, this ends up being a bad idea, because most operating
-       systems have an implicit grab when you press the mouse button down
-       so you can drag things out of the window and then get the mouse up
-       when it happens.  So, #if 0...
-    */
-#if 0
-    if (mouse->focus && !window) {
-        /* We won't get anymore mouse messages, so reset mouse state */
-        SDL_ResetMouse();
-    }
-#endif
-
-    /* See if the current window has lost focus */
-    if (mouse->focus) {
-        SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_LEAVE, 0, 0);
-    }
-
-    mouse->focus = window;
-
-    if (mouse->focus) {
-        SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_ENTER, 0, 0);
-    }
-
-    /* Update cursor visibility */
-    SDL_SetCursor(NULL);
-}
-
-/* Check to see if we need to synthesize focus events */
-static SDL_bool
-SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    int w, h;
-    SDL_bool inWindow;
-
-    SDL_GetWindowSize(window, &w, &h);
-    if (x < 0 || y < 0 || x >= w || y >= h) {
-        inWindow = SDL_FALSE;
-    } else {
-        inWindow = SDL_TRUE;
-    }
-
-/* Linux doesn't give you mouse events outside your window unless you grab
-   the pointer.
-
-   Windows doesn't give you mouse events outside your window unless you call
-   SetCapture().
-
-   Both of these are slightly scary changes, so for now we'll punt and if the
-   mouse leaves the window you'll lose mouse focus and reset button state.
-*/
-#ifdef SUPPORT_DRAG_OUTSIDE_WINDOW
-    if (!inWindow && !buttonstate) {
-#else
-    if (!inWindow) {
-#endif
-        if (window == mouse->focus) {
-#ifdef DEBUG_MOUSE
-            printf("Mouse left window, synthesizing move & focus lost event\n");
-#endif
-            SDL_PrivateSendMouseMotion(window, mouse->mouseID, 0, x, y);
-            SDL_SetMouseFocus(NULL);
-        }
-        return SDL_FALSE;
-    }
-
-    if (window != mouse->focus) {
-#ifdef DEBUG_MOUSE
-         printf("Mouse entered window, synthesizing focus gain & move event\n");
-#endif
-         SDL_SetMouseFocus(window);
-         SDL_PrivateSendMouseMotion(window, mouse->mouseID, 0, x, y);
-    }
-    return SDL_TRUE;
-}
-
-int
-SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y)
-{
-    if (window && !relative) {
-        SDL_Mouse *mouse = SDL_GetMouse();
-        if (!SDL_UpdateMouseFocus(window, x, y, mouse->buttonstate)) {
-            return 0;
-        }
-    }
-
-    return SDL_PrivateSendMouseMotion(window, mouseID, relative, x, y);
-}
-
-static int
-SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    int posted;
-    int xrel;
-    int yrel;
-    int x_max = 0, y_max = 0;
-
-    /* relative motion is calculated regarding the system cursor last position */
-    if (relative) {
-        xrel = x;
-        yrel = y;
-        x = (mouse->last_x + x);
-        y = (mouse->last_y + y);
-    } else {
-        xrel = x - mouse->last_x;
-        yrel = y - mouse->last_y;
-    }
-
-    /* Drop events that don't change state */
-    if (!xrel && !yrel) {
-#ifdef DEBUG_MOUSE
-        printf("Mouse event didn't change state - dropped!\n");
-#endif
-        return 0;
-    }
-
-    /* Update internal mouse coordinates */
-    if (mouse->relative_mode == SDL_FALSE) {
-        mouse->x = x;
-        mouse->y = y;
-    } else {
-        mouse->x += xrel;
-        mouse->y += yrel;
-    }
-
-    SDL_GetWindowSize(mouse->focus, &x_max, &y_max);
-    --x_max;
-    --y_max;
-
-    /* make sure that the pointers find themselves inside the windows */
-    if (mouse->x > x_max) {
-        mouse->x = x_max;
-    }
-    if (mouse->x < 0) {
-        mouse->x = 0;
-    }
-
-    if (mouse->y > y_max) {
-        mouse->y = y_max;
-    }
-    if (mouse->y < 0) {
-        mouse->y = 0;
-    }
-
-    mouse->xdelta += xrel;
-    mouse->ydelta += yrel;
-
-    /* Move the mouse cursor, if needed */
-    if (mouse->cursor_shown && !mouse->relative_mode &&
-        mouse->MoveCursor && mouse->cur_cursor) {
-        mouse->MoveCursor(mouse->cur_cursor);
-    }
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(SDL_MOUSEMOTION) == SDL_ENABLE) {
-        SDL_Event event;
-        event.motion.type = SDL_MOUSEMOTION;
-        event.motion.windowID = mouse->focus ? mouse->focus->id : 0;
-        event.motion.which = mouseID;
-        event.motion.state = mouse->buttonstate;
-        event.motion.x = mouse->x;
-        event.motion.y = mouse->y;
-        event.motion.xrel = xrel;
-        event.motion.yrel = yrel;
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    /* Use unclamped values if we're getting events outside the window */
-    mouse->last_x = x;
-    mouse->last_y = y;
-    return posted;
-}
-
-int
-SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    int posted;
-    Uint32 type;
-    Uint32 buttonstate = mouse->buttonstate;
-
-    /* Figure out which event to perform */
-    switch (state) {
-    case SDL_PRESSED:
-        type = SDL_MOUSEBUTTONDOWN;
-        buttonstate |= SDL_BUTTON(button);
-        break;
-    case SDL_RELEASED:
-        type = SDL_MOUSEBUTTONUP;
-        buttonstate &= ~SDL_BUTTON(button);
-        break;
-    default:
-        /* Invalid state -- bail */
-        return 0;
-    }
-
-    /* We do this after calculating buttonstate so button presses gain focus */
-    if (window && state == SDL_PRESSED) {
-        SDL_UpdateMouseFocus(window, mouse->x, mouse->y, buttonstate);
-    }
-
-    if (buttonstate == mouse->buttonstate) {
-        /* Ignore this event, no state change */
-        return 0;
-    }
-    mouse->buttonstate = buttonstate;
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(type) == SDL_ENABLE) {
-        SDL_Event event;
-        event.type = type;
-        event.button.windowID = mouse->focus ? mouse->focus->id : 0;
-        event.button.which = mouseID;
-        event.button.state = state;
-        event.button.button = button;
-        event.button.x = mouse->x;
-        event.button.y = mouse->y;
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-
-    /* We do this after dispatching event so button releases can lose focus */
-    if (window && state == SDL_RELEASED) {
-        SDL_UpdateMouseFocus(window, mouse->x, mouse->y, buttonstate);
-    }
-
-    return posted;
-}
-
-int
-SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    int posted;
-
-    if (window) {
-        SDL_SetMouseFocus(window);
-    }
-
-    if (!x && !y) {
-        return 0;
-    }
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(SDL_MOUSEWHEEL) == SDL_ENABLE) {
-        SDL_Event event;
-        event.type = SDL_MOUSEWHEEL;
-        event.wheel.windowID = mouse->focus ? mouse->focus->id : 0;
-        event.wheel.which = mouseID;
-        event.wheel.x = x;
-        event.wheel.y = y;
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    return posted;
-}
-
-void
-SDL_MouseQuit(void)
-{
-    SDL_Cursor *cursor, *next;
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    SDL_ShowCursor(1);
-
-    cursor = mouse->cursors;
-    while (cursor) {
-        next = cursor->next;
-        SDL_FreeCursor(cursor);
-        cursor = next;
-    }
-
-    if (mouse->def_cursor && mouse->FreeCursor) {
-        mouse->FreeCursor(mouse->def_cursor);
-    }
-
-    SDL_zerop(mouse);
-}
-
-Uint32
-SDL_GetMouseState(int *x, int *y)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    if (x) {
-        *x = mouse->x;
-    }
-    if (y) {
-        *y = mouse->y;
-    }
-    return mouse->buttonstate;
-}
-
-Uint32
-SDL_GetRelativeMouseState(int *x, int *y)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    if (x) {
-        *x = mouse->xdelta;
-    }
-    if (y) {
-        *y = mouse->ydelta;
-    }
-    mouse->xdelta = 0;
-    mouse->ydelta = 0;
-    return mouse->buttonstate;
-}
-
-void
-SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    if ( window == NULL )
-        window = mouse->focus;
-
-    if ( window == NULL )
-        return;
-
-    if (mouse->WarpMouse) {
-        mouse->WarpMouse(window, x, y);
-    } else {
-        SDL_SendMouseMotion(window, mouse->mouseID, 0, x, y);
-    }
-}
-
-int
-SDL_SetRelativeMouseMode(SDL_bool enabled)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    SDL_Window *focusWindow = SDL_GetKeyboardFocus();
-    int original_x = mouse->x, original_y = mouse->y;
-
-    if (enabled == mouse->relative_mode) {
-        return 0;
-    }
-
-    if (!mouse->SetRelativeMouseMode) {
-        return SDL_Unsupported();
-    }
-
-    if (enabled && focusWindow) {
-        /* Center it in the focused window to prevent clicks from going through
-         * to background windows.
-         */
-        SDL_SetMouseFocus(focusWindow);
-        SDL_WarpMouseInWindow(focusWindow, focusWindow->w/2, focusWindow->h/2);
-    }
-
-    if (mouse->SetRelativeMouseMode(enabled) < 0) {
-        return -1;
-    }
-
-    /* Set the relative mode */
-    mouse->relative_mode = enabled;
-
-    if (enabled) {
-        /* Save the expected mouse position */
-        mouse->original_x = original_x;
-        mouse->original_y = original_y;
-    } else if (mouse->focus) {
-        /* Restore the expected mouse position */
-        SDL_WarpMouseInWindow(mouse->focus, mouse->original_x, mouse->original_y);
-    }
-
-    /* Flush pending mouse motion */
-    SDL_FlushEvent(SDL_MOUSEMOTION);
-
-    /* Update cursor visibility */
-    SDL_SetCursor(NULL);
-
-    return 0;
-}
-
-SDL_bool
-SDL_GetRelativeMouseMode()
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    return mouse->relative_mode;
-}
-
-SDL_Cursor *
-SDL_CreateCursor(const Uint8 * data, const Uint8 * mask,
-                 int w, int h, int hot_x, int hot_y)
-{
-    SDL_Surface *surface;
-    SDL_Cursor *cursor;
-    int x, y;
-    Uint32 *pixel;
-    Uint8 datab = 0, maskb = 0;
-    const Uint32 black = 0xFF000000;
-    const Uint32 white = 0xFFFFFFFF;
-    const Uint32 transparent = 0x00000000;
-
-    /* Make sure the width is a multiple of 8 */
-    w = ((w + 7) & ~7);
-
-    /* Create the surface from a bitmap */
-    surface = SDL_CreateRGBSurface(0, w, h, 32,
-                                   0x00FF0000,
-                                   0x0000FF00,
-                                   0x000000FF,
-                                   0xFF000000);
-    if (!surface) {
-        return NULL;
-    }
-    for (y = 0; y < h; ++y) {
-        pixel = (Uint32 *) ((Uint8 *) surface->pixels + y * surface->pitch);
-        for (x = 0; x < w; ++x) {
-            if ((x % 8) == 0) {
-                datab = *data++;
-                maskb = *mask++;
-            }
-            if (maskb & 0x80) {
-                *pixel++ = (datab & 0x80) ? black : white;
-            } else {
-                *pixel++ = (datab & 0x80) ? black : transparent;
-            }
-            datab <<= 1;
-            maskb <<= 1;
-        }
-    }
-
-    cursor = SDL_CreateColorCursor(surface, hot_x, hot_y);
-
-    SDL_FreeSurface(surface);
-
-    return cursor;
-}
-
-SDL_Cursor *
-SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    SDL_Surface *temp = NULL;
-    SDL_Cursor *cursor;
-
-    if (!surface) {
-        SDL_SetError("Passed NULL cursor surface");
-        return NULL;
-    }
-
-    if (!mouse->CreateCursor) {
-        SDL_SetError("Cursors are not currently supported");
-        return NULL;
-    }
-
-    /* Sanity check the hot spot */
-    if ((hot_x < 0) || (hot_y < 0) ||
-        (hot_x >= surface->w) || (hot_y >= surface->h)) {
-        SDL_SetError("Cursor hot spot doesn't lie within cursor");
-        return NULL;
-    }
-
-    if (surface->format->format != SDL_PIXELFORMAT_ARGB8888) {
-        temp = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ARGB8888, 0);
-        if (!temp) {
-            return NULL;
-        }
-        surface = temp;
-    }
-
-    cursor = mouse->CreateCursor(surface, hot_x, hot_y);
-    if (cursor) {
-        cursor->next = mouse->cursors;
-        mouse->cursors = cursor;
-    }
-
-    SDL_FreeSurface(temp);
-
-    return cursor;
-}
-
-SDL_Cursor *
-SDL_CreateSystemCursor(SDL_SystemCursor id)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    SDL_Cursor *cursor;
-
-    if (!mouse->CreateSystemCursor) {
-        SDL_SetError("CreateSystemCursor is not currently supported");
-        return NULL;
-    }
-
-    cursor = mouse->CreateSystemCursor(id);
-    if (cursor) {
-        cursor->next = mouse->cursors;
-        mouse->cursors = cursor;
-    }
-
-    return cursor;
-}
-
-/* SDL_SetCursor(NULL) can be used to force the cursor redraw,
-   if this is desired for any reason.  This is used when setting
-   the video mode and when the SDL window gains the mouse focus.
- */
-void
-SDL_SetCursor(SDL_Cursor * cursor)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    /* Set the new cursor */
-    if (cursor) {
-        /* Make sure the cursor is still valid for this mouse */
-        if (cursor != mouse->def_cursor) {
-            SDL_Cursor *found;
-            for (found = mouse->cursors; found; found = found->next) {
-                if (found == cursor) {
-                    break;
-                }
-            }
-            if (!found) {
-                SDL_SetError("Cursor not associated with the current mouse");
-                return;
-            }
-        }
-        mouse->cur_cursor = cursor;
-    } else {
-        if (mouse->focus) {
-            cursor = mouse->cur_cursor;
-        } else {
-            cursor = mouse->def_cursor;
-        }
-    }
-
-    if (cursor && mouse->cursor_shown && !mouse->relative_mode) {
-        if (mouse->ShowCursor) {
-            mouse->ShowCursor(cursor);
-        }
-    } else {
-        if (mouse->ShowCursor) {
-            mouse->ShowCursor(NULL);
-        }
-    }
-}
-
-SDL_Cursor *
-SDL_GetCursor(void)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    if (!mouse) {
-        return NULL;
-    }
-    return mouse->cur_cursor;
-}
-
-SDL_Cursor *
-SDL_GetDefaultCursor(void)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    if (!mouse) {
-        return NULL;
-    }
-    return mouse->def_cursor;
-}
-
-void
-SDL_FreeCursor(SDL_Cursor * cursor)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    SDL_Cursor *curr, *prev;
-
-    if (!cursor) {
-        return;
-    }
-
-    if (cursor == mouse->def_cursor) {
-        return;
-    }
-    if (cursor == mouse->cur_cursor) {
-        SDL_SetCursor(mouse->def_cursor);
-    }
-
-    for (prev = NULL, curr = mouse->cursors; curr;
-         prev = curr, curr = curr->next) {
-        if (curr == cursor) {
-            if (prev) {
-                prev->next = curr->next;
-            } else {
-                mouse->cursors = curr->next;
-            }
-
-            if (mouse->FreeCursor) {
-                mouse->FreeCursor(curr);
-            }
-            return;
-        }
-    }
-}
-
-int
-SDL_ShowCursor(int toggle)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    SDL_bool shown;
-
-    if (!mouse) {
-        return 0;
-    }
-
-    shown = mouse->cursor_shown;
-    if (toggle >= 0) {
-        if (toggle) {
-            mouse->cursor_shown = SDL_TRUE;
-        } else {
-            mouse->cursor_shown = SDL_FALSE;
-        }
-        if (mouse->cursor_shown != shown) {
-            SDL_SetCursor(NULL);
-        }
-    }
-    return shown;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_mouse_c.h b/deps/SDL2/src/events/SDL_mouse_c.h
deleted file mode 100644
index a8faa2e..0000000
--- a/deps/SDL2/src/events/SDL_mouse_c.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_mouse_c_h
-#define _SDL_mouse_c_h
-
-#include "SDL_mouse.h"
-
-typedef Uint32 SDL_MouseID;
-
-struct SDL_Cursor
-{
-    struct SDL_Cursor *next;
-    void *driverdata;
-};
-
-typedef struct
-{
-    /* Create a cursor from a surface */
-    SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y);
-
-    /* Create a system cursor */
-    SDL_Cursor *(*CreateSystemCursor) (SDL_SystemCursor id);
-
-    /* Show the specified cursor, or hide if cursor is NULL */
-    int (*ShowCursor) (SDL_Cursor * cursor);
-
-    /* This is called when a mouse motion event occurs */
-    void (*MoveCursor) (SDL_Cursor * cursor);
-
-    /* Free a window manager cursor */
-    void (*FreeCursor) (SDL_Cursor * cursor);
-
-    /* Warp the mouse to (x,y) */
-    void (*WarpMouse) (SDL_Window * window, int x, int y);
-
-    /* Set relative mode */
-    int (*SetRelativeMouseMode) (SDL_bool enabled);
-
-    /* Data common to all mice */
-    SDL_MouseID mouseID;
-    SDL_Window *focus;
-    int x;
-    int y;
-    int xdelta;
-    int ydelta;
-    int last_x, last_y;         /* the last reported x and y coordinates */
-    Uint32 buttonstate;
-    SDL_bool relative_mode;
-    /* the x and y coordinates when relative mode was activated */
-    int original_x, original_y;
-
-    SDL_Cursor *cursors;
-    SDL_Cursor *def_cursor;
-    SDL_Cursor *cur_cursor;
-    SDL_bool cursor_shown;
-
-    /* Driver-dependent data. */
-    void *driverdata;
-} SDL_Mouse;
-
-
-/* Initialize the mouse subsystem */
-extern int SDL_MouseInit(void);
-
-/* Get the mouse state structure */
-SDL_Mouse *SDL_GetMouse(void);
-
-/* Set the default mouse cursor */
-extern void SDL_SetDefaultCursor(SDL_Cursor * cursor);
-
-/* Set the mouse focus window */
-extern void SDL_SetMouseFocus(SDL_Window * window);
-
-/* Send a mouse motion event */
-extern int SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y);
-
-/* Send a mouse button event */
-extern int SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button);
-
-/* Send a mouse wheel event */
-extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y);
-
-/* Shutdown the mouse subsystem */
-extern void SDL_MouseQuit(void);
-
-#endif /* _SDL_mouse_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_quit.c b/deps/SDL2/src/events/SDL_quit.c
deleted file mode 100644
index 5e9f8ad..0000000
--- a/deps/SDL2/src/events/SDL_quit.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* General quit handling code for SDL */
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-
-
-#ifdef HAVE_SIGNAL_H
-static void
-SDL_HandleSIG(int sig)
-{
-    /* Reset the signal handler */
-    signal(sig, SDL_HandleSIG);
-
-    /* Signal a quit interrupt */
-    SDL_SendQuit();
-}
-#endif /* HAVE_SIGNAL_H */
-
-/* Public functions */
-int
-SDL_QuitInit(void)
-{
-#ifdef HAVE_SIGACTION
-    struct sigaction action;
-    sigaction(SIGINT, NULL, &action);
-#ifdef HAVE_SA_SIGACTION
-    if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
-#else
-    if ( action.sa_handler == SIG_DFL ) {
-#endif
-        action.sa_handler = SDL_HandleSIG;
-        sigaction(SIGINT, &action, NULL);
-    }
-    sigaction(SIGTERM, NULL, &action);
-
-#ifdef HAVE_SA_SIGACTION
-    if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
-#else
-    if ( action.sa_handler == SIG_DFL ) {
-#endif
-        action.sa_handler = SDL_HandleSIG;
-        sigaction(SIGTERM, &action, NULL);
-    }
-#elif HAVE_SIGNAL_H
-    void (*ohandler) (int);
-
-    /* Both SIGINT and SIGTERM are translated into quit interrupts */
-    ohandler = signal(SIGINT, SDL_HandleSIG);
-    if (ohandler != SIG_DFL)
-        signal(SIGINT, ohandler);
-    ohandler = signal(SIGTERM, SDL_HandleSIG);
-    if (ohandler != SIG_DFL)
-        signal(SIGTERM, ohandler);
-#endif /* HAVE_SIGNAL_H */
-
-    /* That's it! */
-    return (0);
-}
-
-void
-SDL_QuitQuit(void)
-{
-#ifdef HAVE_SIGACTION
-    struct sigaction action;
-    sigaction(SIGINT, NULL, &action);
-    if ( action.sa_handler == SDL_HandleSIG ) {
-        action.sa_handler = SIG_DFL;
-        sigaction(SIGINT, &action, NULL);
-    }
-    sigaction(SIGTERM, NULL, &action);
-    if ( action.sa_handler == SDL_HandleSIG ) {
-        action.sa_handler = SIG_DFL;
-        sigaction(SIGTERM, &action, NULL);
-    }
-#elif HAVE_SIGNAL_H
-    void (*ohandler) (int);
-
-    ohandler = signal(SIGINT, SIG_DFL);
-    if (ohandler != SDL_HandleSIG)
-        signal(SIGINT, ohandler);
-    ohandler = signal(SIGTERM, SIG_DFL);
-    if (ohandler != SDL_HandleSIG)
-        signal(SIGTERM, ohandler);
-#endif /* HAVE_SIGNAL_H */
-}
-
-/* This function returns 1 if it's okay to close the application window */
-int
-SDL_SendQuit(void)
-{
-    return SDL_SendAppEvent(SDL_QUIT);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_sysevents.h b/deps/SDL2/src/events/SDL_sysevents.h
deleted file mode 100644
index c2f1e09..0000000
--- a/deps/SDL2/src/events/SDL_sysevents.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "../video/SDL_sysvideo.h"
-
-/* Useful functions and variables from SDL_sysevents.c */
-
-#if defined(__BEOS__) || defined(__HAIKU__) 
-/* The Be and Haiku event loops run in a separate thread */
-#define MUST_THREAD_EVENTS
-#endif
-
-#ifdef __WIN32__              /* Windows doesn't allow a separate event thread */
-#define CANT_THREAD_EVENTS
-#endif
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_touch.c b/deps/SDL2/src/events/SDL_touch.c
deleted file mode 100644
index 1874ba7..0000000
--- a/deps/SDL2/src/events/SDL_touch.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* General touch handling code for SDL */
-
-#include "SDL_assert.h"
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-
-
-static int SDL_num_touch = 0;
-static SDL_Touch **SDL_touchDevices = NULL;
-
-
-/* Public functions */
-int
-SDL_TouchInit(void)
-{
-    return (0);
-}
-
-int
-SDL_GetNumTouchDevices(void)
-{
-    return SDL_num_touch;
-}
-
-SDL_TouchID
-SDL_GetTouchDevice(int index)
-{
-    if (index < 0 || index >= SDL_num_touch) {
-        SDL_SetError("Unknown touch device");
-        return 0;
-    }
-    return SDL_touchDevices[index]->id;
-}
-
-static int
-SDL_GetTouchIndex(SDL_TouchID id)
-{
-    int index;
-    SDL_Touch *touch;
-
-    for (index = 0; index < SDL_num_touch; ++index) {
-        touch = SDL_touchDevices[index];
-        if (touch->id == id) {
-            return index;
-        }
-    }
-    return -1;
-}
-
-SDL_Touch *
-SDL_GetTouch(SDL_TouchID id)
-{
-    int index = SDL_GetTouchIndex(id);
-    if (index < 0 || index >= SDL_num_touch) {
-        SDL_SetError("Unknown touch device");
-        return NULL;
-    }
-    return SDL_touchDevices[index];
-}
-
-static int
-SDL_GetFingerIndex(const SDL_Touch * touch, SDL_FingerID fingerid)
-{
-    int index;
-    for (index = 0; index < touch->num_fingers; ++index) {
-        if (touch->fingers[index]->id == fingerid) {
-            return index;
-        }
-    }
-    return -1;
-}
-
-SDL_Finger *
-SDL_GetFinger(const SDL_Touch * touch, SDL_FingerID id)
-{
-    int index = SDL_GetFingerIndex(touch, id);
-    if (index < 0 || index >= touch->num_fingers) {
-        return NULL;
-    }
-    return touch->fingers[index];
-}
-
-int
-SDL_GetNumTouchFingers(SDL_TouchID touchID)
-{
-    SDL_Touch *touch = SDL_GetTouch(touchID);
-    if (touch) {
-        return touch->num_fingers;
-    }
-    return 0;
-}
-
-SDL_Finger *
-SDL_GetTouchFinger(SDL_TouchID touchID, int index)
-{
-    SDL_Touch *touch = SDL_GetTouch(touchID);
-    if (!touch) {
-        return NULL;
-    }
-    if (index < 0 || index >= touch->num_fingers) {
-        SDL_SetError("Unknown touch finger");
-        return NULL;
-    }
-    return touch->fingers[index];
-}
-
-int
-SDL_AddTouch(SDL_TouchID touchID, const char *name)
-{
-    SDL_Touch **touchDevices;
-    int index;
-
-    index = SDL_GetTouchIndex(touchID);
-    if (index >= 0) {
-        return index;
-    }
-
-    /* Add the touch to the list of touch */
-    touchDevices = (SDL_Touch **) SDL_realloc(SDL_touchDevices,
-                                      (SDL_num_touch + 1) * sizeof(*touchDevices));
-    if (!touchDevices) {
-        return SDL_OutOfMemory();
-    }
-
-    SDL_touchDevices = touchDevices;
-    index = SDL_num_touch++;
-
-    SDL_touchDevices[index] = (SDL_Touch *) SDL_malloc(sizeof(*SDL_touchDevices[index]));
-    if (!SDL_touchDevices[index]) {
-        return SDL_OutOfMemory();
-    }
-
-    /* we're setting the touch properties */
-    SDL_touchDevices[index]->id = touchID;
-    SDL_touchDevices[index]->num_fingers = 0;
-    SDL_touchDevices[index]->max_fingers = 0;
-    SDL_touchDevices[index]->fingers = NULL;
-
-    /* Record this touch device for gestures */
-    /* We could do this on the fly in the gesture code if we wanted */
-    SDL_GestureAddTouch(touchID);
-
-    return index;
-}
-
-static int
-SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure)
-{
-    SDL_Finger *finger;
-
-    if (touch->num_fingers == touch->max_fingers) {
-        SDL_Finger **new_fingers;
-        new_fingers = (SDL_Finger **)SDL_realloc(touch->fingers, (touch->max_fingers+1)*sizeof(*touch->fingers));
-        if (!new_fingers) {
-            return SDL_OutOfMemory();
-        }
-        touch->fingers = new_fingers;
-        touch->fingers[touch->max_fingers] = (SDL_Finger *)SDL_malloc(sizeof(*finger));
-        if (!touch->fingers[touch->max_fingers]) {
-            return SDL_OutOfMemory();
-        }
-        touch->max_fingers++;
-    }
-
-    finger = touch->fingers[touch->num_fingers++];
-    finger->id = fingerid;
-    finger->x = x;
-    finger->y = y;
-    finger->pressure = pressure;
-    return 0;
-}
-
-static int
-SDL_DelFinger(SDL_Touch* touch, SDL_FingerID fingerid)
-{
-    SDL_Finger *temp;
-
-    int index = SDL_GetFingerIndex(touch, fingerid);
-    if (index < 0) {
-        return -1;
-    }
-
-    touch->num_fingers--;
-    temp = touch->fingers[index];
-    touch->fingers[index] = touch->fingers[touch->num_fingers];
-    touch->fingers[touch->num_fingers] = temp;
-    return 0;
-}
-
-int
-SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid,
-              SDL_bool down, float x, float y, float pressure)
-{
-    int posted;
-    SDL_Finger *finger;
-
-    SDL_Touch* touch = SDL_GetTouch(id);
-    if (!touch) {
-        return -1;
-    }
-
-    finger = SDL_GetFinger(touch, fingerid);
-    if (down) {
-        if (finger) {
-            /* This finger is already down */
-            return 0;
-        }
-
-        if (SDL_AddFinger(touch, fingerid, x, y, pressure) < 0) {
-            return 0;
-        }
-
-        posted = 0;
-        if (SDL_GetEventState(SDL_FINGERDOWN) == SDL_ENABLE) {
-            SDL_Event event;
-            event.tfinger.type = SDL_FINGERDOWN;
-            event.tfinger.touchId = id;
-            event.tfinger.fingerId = fingerid;
-            event.tfinger.x = x;
-            event.tfinger.y = y;
-            event.tfinger.dx = 0;
-            event.tfinger.dy = 0;
-            event.tfinger.pressure = pressure;
-            posted = (SDL_PushEvent(&event) > 0);
-        }
-    } else {
-        if (!finger) {
-            /* This finger is already up */
-            return 0;
-        }
-
-        posted = 0;
-        if (SDL_GetEventState(SDL_FINGERUP) == SDL_ENABLE) {
-            SDL_Event event;
-            event.tfinger.type = SDL_FINGERUP;
-            event.tfinger.touchId =  id;
-            event.tfinger.fingerId = fingerid;
-            /* I don't trust the coordinates passed on fingerUp */
-            event.tfinger.x = finger->x;
-            event.tfinger.y = finger->y;
-            event.tfinger.dx = 0;
-            event.tfinger.dy = 0;
-            event.tfinger.pressure = pressure;
-            posted = (SDL_PushEvent(&event) > 0);
-        }
-
-        SDL_DelFinger(touch, fingerid);
-    }
-    return posted;
-}
-
-int
-SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid,
-                    float x, float y, float pressure)
-{
-    SDL_Touch *touch;
-    SDL_Finger *finger;
-    int posted;
-    float xrel, yrel, prel;
-
-    touch = SDL_GetTouch(id);
-    if (!touch) {
-        return -1;
-    }
-
-    finger = SDL_GetFinger(touch,fingerid);
-    if (!finger) {
-        return SDL_SendTouch(id, fingerid, SDL_TRUE, x, y, pressure);
-    }
-
-    xrel = x - finger->x;
-    yrel = y - finger->y;
-    prel = pressure - finger->pressure;
-
-    /* Drop events that don't change state */
-    if (!xrel && !yrel && !prel) {
-#if 0
-        printf("Touch event didn't change state - dropped!\n");
-#endif
-        return 0;
-    }
-
-    /* Update internal touch coordinates */
-    finger->x = x;
-    finger->y = y;
-    finger->pressure = pressure;
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(SDL_FINGERMOTION) == SDL_ENABLE) {
-        SDL_Event event;
-        event.tfinger.type = SDL_FINGERMOTION;
-        event.tfinger.touchId = id;
-        event.tfinger.fingerId = fingerid;
-        event.tfinger.x = x;
-        event.tfinger.y = y;
-        event.tfinger.dx = xrel;
-        event.tfinger.dy = yrel;
-        event.tfinger.pressure = pressure;
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-    return posted;
-}
-
-void
-SDL_DelTouch(SDL_TouchID id)
-{
-    int i;
-    int index = SDL_GetTouchIndex(id);
-    SDL_Touch *touch = SDL_GetTouch(id);
-
-    if (!touch) {
-        return;
-    }
-
-    for (i = 0; i < touch->max_fingers; ++i) {
-        SDL_free(touch->fingers[i]);
-    }
-    SDL_free(touch->fingers);
-    SDL_free(touch);
-
-    SDL_num_touch--;
-    SDL_touchDevices[index] = SDL_touchDevices[SDL_num_touch];
-}
-
-void
-SDL_TouchQuit(void)
-{
-    int i;
-
-    for (i = SDL_num_touch; i--; ) {
-        SDL_DelTouch(SDL_touchDevices[i]->id);
-    }
-    SDL_assert(SDL_num_touch == 0);
-
-    SDL_free(SDL_touchDevices);
-    SDL_touchDevices = NULL;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_touch_c.h b/deps/SDL2/src/events/SDL_touch_c.h
deleted file mode 100644
index d0a2cf2..0000000
--- a/deps/SDL2/src/events/SDL_touch_c.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-#include "../../include/SDL_touch.h"
-
-#ifndef _SDL_touch_c_h
-#define _SDL_touch_c_h
-
-typedef struct SDL_Touch
-{
-    SDL_TouchID id;
-    int num_fingers;
-    int max_fingers;
-    SDL_Finger** fingers;
-} SDL_Touch;
-
-
-/* Initialize the touch subsystem */
-extern int SDL_TouchInit(void);
-
-/* Add a touch, returning the index of the touch, or -1 if there was an error. */
-extern int SDL_AddTouch(SDL_TouchID id, const char *name);
-
-/* Get the touch with a given id */
-extern SDL_Touch *SDL_GetTouch(SDL_TouchID id);
-
-/* Send a touch down/up event for a touch */
-extern int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid,
-                         SDL_bool down, float x, float y, float pressure);
-
-/* Send a touch motion event for a touch */
-extern int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid,
-                               float x, float y, float pressure);
-
-/* Remove a touch */
-extern void SDL_DelTouch(SDL_TouchID id);
-
-/* Shutdown the touch subsystem */
-extern void SDL_TouchQuit(void);
-
-#endif /* _SDL_touch_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_windowevents.c b/deps/SDL2/src/events/SDL_windowevents.c
deleted file mode 100644
index 9011f68..0000000
--- a/deps/SDL2/src/events/SDL_windowevents.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Window event handling code for SDL */
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-#include "SDL_mouse_c.h"
-#include "../video/SDL_sysvideo.h"
-
-
-static int
-RemovePendingResizedEvents(void * userdata, SDL_Event *event)
-{
-    SDL_Event *new_event = (SDL_Event *)userdata;
-
-    if (event->type == SDL_WINDOWEVENT &&
-        event->window.event == SDL_WINDOWEVENT_RESIZED &&
-        event->window.windowID == new_event->window.windowID) {
-        /* We're about to post a new size event, drop the old one */
-        return 0;
-    }
-    return 1;
-}
-
-static int
-RemovePendingSizeChangedEvents(void * userdata, SDL_Event *event)
-{
-    SDL_Event *new_event = (SDL_Event *)userdata;
-
-    if (event->type == SDL_WINDOWEVENT &&
-        event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED &&
-        event->window.windowID == new_event->window.windowID) {
-        /* We're about to post a new size event, drop the old one */
-        return 0;
-    }
-    return 1;
-}
-
-static int
-RemovePendingMoveEvents(void * userdata, SDL_Event *event)
-{
-    SDL_Event *new_event = (SDL_Event *)userdata;
-
-    if (event->type == SDL_WINDOWEVENT &&
-        event->window.event == SDL_WINDOWEVENT_MOVED &&
-        event->window.windowID == new_event->window.windowID) {
-        /* We're about to post a new move event, drop the old one */
-        return 0;
-    }
-    return 1;
-}
-
-int
-SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
-                    int data2)
-{
-    int posted;
-
-    if (!window) {
-        return 0;
-    }
-    switch (windowevent) {
-    case SDL_WINDOWEVENT_SHOWN:
-        if (window->flags & SDL_WINDOW_SHOWN) {
-            return 0;
-        }
-        window->flags &= ~SDL_WINDOW_HIDDEN;
-        window->flags |= SDL_WINDOW_SHOWN;
-        SDL_OnWindowShown(window);
-        break;
-    case SDL_WINDOWEVENT_HIDDEN:
-        if (!(window->flags & SDL_WINDOW_SHOWN)) {
-            return 0;
-        }
-        window->flags &= ~SDL_WINDOW_SHOWN;
-        window->flags |= SDL_WINDOW_HIDDEN;
-        SDL_OnWindowHidden(window);
-        break;
-    case SDL_WINDOWEVENT_MOVED:
-        if (SDL_WINDOWPOS_ISUNDEFINED(data1) ||
-            SDL_WINDOWPOS_ISUNDEFINED(data2)) {
-            return 0;
-        }
-        if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
-            window->windowed.x = data1;
-            window->windowed.y = data2;
-        }
-        if (data1 == window->x && data2 == window->y) {
-            return 0;
-        }
-        window->x = data1;
-        window->y = data2;
-        break;
-    case SDL_WINDOWEVENT_RESIZED:
-        if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
-            window->windowed.w = data1;
-            window->windowed.h = data2;
-        }
-        if (data1 == window->w && data2 == window->h) {
-            return 0;
-        }
-        window->w = data1;
-        window->h = data2;
-        SDL_OnWindowResized(window);
-        break;
-    case SDL_WINDOWEVENT_MINIMIZED:
-        if (window->flags & SDL_WINDOW_MINIMIZED) {
-            return 0;
-        }
-        window->flags |= SDL_WINDOW_MINIMIZED;
-        SDL_OnWindowMinimized(window);
-        break;
-    case SDL_WINDOWEVENT_MAXIMIZED:
-        if (window->flags & SDL_WINDOW_MAXIMIZED) {
-            return 0;
-        }
-        window->flags |= SDL_WINDOW_MAXIMIZED;
-        break;
-    case SDL_WINDOWEVENT_RESTORED:
-        if (!(window->flags & (SDL_WINDOW_MINIMIZED | SDL_WINDOW_MAXIMIZED))) {
-            return 0;
-        }
-        window->flags &= ~(SDL_WINDOW_MINIMIZED | SDL_WINDOW_MAXIMIZED);
-        SDL_OnWindowRestored(window);
-        break;
-    case SDL_WINDOWEVENT_ENTER:
-        if (window->flags & SDL_WINDOW_MOUSE_FOCUS) {
-            return 0;
-        }
-        window->flags |= SDL_WINDOW_MOUSE_FOCUS;
-        SDL_OnWindowEnter(window);
-        break;
-    case SDL_WINDOWEVENT_LEAVE:
-        if (!(window->flags & SDL_WINDOW_MOUSE_FOCUS)) {
-            return 0;
-        }
-        window->flags &= ~SDL_WINDOW_MOUSE_FOCUS;
-        SDL_OnWindowLeave(window);
-        break;
-    case SDL_WINDOWEVENT_FOCUS_GAINED:
-        if (window->flags & SDL_WINDOW_INPUT_FOCUS) {
-            return 0;
-        }
-        window->flags |= SDL_WINDOW_INPUT_FOCUS;
-        SDL_OnWindowFocusGained(window);
-        break;
-    case SDL_WINDOWEVENT_FOCUS_LOST:
-        if (!(window->flags & SDL_WINDOW_INPUT_FOCUS)) {
-            return 0;
-        }
-        window->flags &= ~SDL_WINDOW_INPUT_FOCUS;
-        SDL_OnWindowFocusLost(window);
-        break;
-    }
-
-    /* Post the event, if desired */
-    posted = 0;
-    if (SDL_GetEventState(SDL_WINDOWEVENT) == SDL_ENABLE) {
-        SDL_Event event;
-        event.type = SDL_WINDOWEVENT;
-        event.window.event = windowevent;
-        event.window.data1 = data1;
-        event.window.data2 = data2;
-        event.window.windowID = window->id;
-
-        /* Fixes queue overflow with resize events that aren't processed */
-        if (windowevent == SDL_WINDOWEVENT_RESIZED) {
-            SDL_FilterEvents(RemovePendingResizedEvents, &event);
-        }
-        if (windowevent == SDL_WINDOWEVENT_SIZE_CHANGED) {
-            SDL_FilterEvents(RemovePendingSizeChangedEvents, &event);
-        }
-        if (windowevent == SDL_WINDOWEVENT_MOVED) {
-            SDL_FilterEvents(RemovePendingMoveEvents, &event);
-        }
-
-        posted = (SDL_PushEvent(&event) > 0);
-    }
-
-    if (windowevent == SDL_WINDOWEVENT_CLOSE) {
-        if ( !window->prev && !window->next ) {
-            /* This is the last window in the list so send the SDL_QUIT event */
-            SDL_SendQuit();
-        }
-    }
-
-    return (posted);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/SDL_windowevents_c.h b/deps/SDL2/src/events/SDL_windowevents_c.h
deleted file mode 100644
index 0d14a03..0000000
--- a/deps/SDL2/src/events/SDL_windowevents_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_windowevents_c_h
-#define _SDL_windowevents_c_h
-
-extern int SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent,
-                               int data1, int data2);
-
-#endif /* _SDL_windowevents_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/blank_cursor.h b/deps/SDL2/src/events/blank_cursor.h
deleted file mode 100644
index 6efb474..0000000
--- a/deps/SDL2/src/events/blank_cursor.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * A default blank 8x8 cursor                                                */
-
-#define BLANK_CWIDTH    8
-#define BLANK_CHEIGHT   8
-#define BLANK_CHOTX 0
-#define BLANK_CHOTY 0
-
-static const unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-static const unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/default_cursor.h b/deps/SDL2/src/events/default_cursor.h
deleted file mode 100644
index 8c2dcfc..0000000
--- a/deps/SDL2/src/events/default_cursor.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Default cursor - it happens to be the Mac cursor, but could be anything   */
-
-#define DEFAULT_CWIDTH  16
-#define DEFAULT_CHEIGHT 16
-#define DEFAULT_CHOTX   0
-#define DEFAULT_CHOTY   0
-
-/* Added a real MacOS cursor, at the request of Luc-Olivier de Charrière */
-#define USE_MACOS_CURSOR
-
-#ifdef USE_MACOS_CURSOR
-
-static const unsigned char default_cdata[] = {
-    0x00, 0x00,
-    0x40, 0x00,
-    0x60, 0x00,
-    0x70, 0x00,
-    0x78, 0x00,
-    0x7C, 0x00,
-    0x7E, 0x00,
-    0x7F, 0x00,
-    0x7F, 0x80,
-    0x7C, 0x00,
-    0x6C, 0x00,
-    0x46, 0x00,
-    0x06, 0x00,
-    0x03, 0x00,
-    0x03, 0x00,
-    0x00, 0x00
-};
-
-static const unsigned char default_cmask[] = {
-    0xC0, 0x00,
-    0xE0, 0x00,
-    0xF0, 0x00,
-    0xF8, 0x00,
-    0xFC, 0x00,
-    0xFE, 0x00,
-    0xFF, 0x00,
-    0xFF, 0x80,
-    0xFF, 0xC0,
-    0xFF, 0xE0,
-    0xFE, 0x00,
-    0xEF, 0x00,
-    0xCF, 0x00,
-    0x87, 0x80,
-    0x07, 0x80,
-    0x03, 0x00
-};
-
-#else
-
-static const unsigned char default_cdata[] = {
-    0x00, 0x00,
-    0x40, 0x00,
-    0x60, 0x00,
-    0x70, 0x00,
-    0x78, 0x00,
-    0x7C, 0x00,
-    0x7E, 0x00,
-    0x7F, 0x00,
-    0x7F, 0x80,
-    0x7C, 0x00,
-    0x6C, 0x00,
-    0x46, 0x00,
-    0x06, 0x00,
-    0x03, 0x00,
-    0x03, 0x00,
-    0x00, 0x00
-};
-
-static const unsigned char default_cmask[] = {
-    0x40, 0x00,
-    0xE0, 0x00,
-    0xF0, 0x00,
-    0xF8, 0x00,
-    0xFC, 0x00,
-    0xFE, 0x00,
-    0xFF, 0x00,
-    0xFF, 0x80,
-    0xFF, 0xC0,
-    0xFF, 0x80,
-    0xFE, 0x00,
-    0xEF, 0x00,
-    0x4F, 0x00,
-    0x07, 0x80,
-    0x07, 0x80,
-    0x03, 0x00
-};
-
-#endif /* TRUE_MACINTOSH_CURSOR */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/events/scancodes_darwin.h b/deps/SDL2/src/events/scancodes_darwin.h
deleted file mode 100644
index 77c728b..0000000
--- a/deps/SDL2/src/events/scancodes_darwin.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* Mac virtual key code to SDL scancode mapping table
-   Sources:
-   - Inside Macintosh: Text <http://developer.apple.com/documentation/mac/Text/Text-571.html>
-   - Apple USB keyboard driver source <http://darwinsource.opendarwin.org/10.4.6.ppc/IOHIDFamily-172.8/IOHIDFamily/Cosmo_USB2ADB.c>
-   - experimentation on various ADB and USB ISO keyboards and one ADB ANSI keyboard
-*/
-/* *INDENT-OFF* */
-static const SDL_Scancode darwin_scancode_table[] = {
-    /*   0 */   SDL_SCANCODE_A,
-    /*   1 */   SDL_SCANCODE_S,
-    /*   2 */   SDL_SCANCODE_D,
-    /*   3 */   SDL_SCANCODE_F,
-    /*   4 */   SDL_SCANCODE_H,
-    /*   5 */   SDL_SCANCODE_G,
-    /*   6 */   SDL_SCANCODE_Z,
-    /*   7 */   SDL_SCANCODE_X,
-    /*   8 */   SDL_SCANCODE_C,
-    /*   9 */   SDL_SCANCODE_V,
-    /*  10 */   SDL_SCANCODE_NONUSBACKSLASH, /* SDL_SCANCODE_NONUSBACKSLASH on ANSI and JIS keyboards (if this key would exist there), SDL_SCANCODE_GRAVE on ISO. (The USB keyboard driver actually translates these usage codes to different virtual key codes depending on whether the keyboard is ISO/ANSI/JIS. That's why you have to help it identify the keyboard type when you plug in a PC USB keyboard. It's a historical thing - ADB keyboards are wired this way.) */
-    /*  11 */   SDL_SCANCODE_B,
-    /*  12 */   SDL_SCANCODE_Q,
-    /*  13 */   SDL_SCANCODE_W,
-    /*  14 */   SDL_SCANCODE_E,
-    /*  15 */   SDL_SCANCODE_R,
-    /*  16 */   SDL_SCANCODE_Y,
-    /*  17 */   SDL_SCANCODE_T,
-    /*  18 */   SDL_SCANCODE_1,
-    /*  19 */   SDL_SCANCODE_2,
-    /*  20 */   SDL_SCANCODE_3,
-    /*  21 */   SDL_SCANCODE_4,
-    /*  22 */   SDL_SCANCODE_6,
-    /*  23 */   SDL_SCANCODE_5,
-    /*  24 */   SDL_SCANCODE_EQUALS,
-    /*  25 */   SDL_SCANCODE_9,
-    /*  26 */   SDL_SCANCODE_7,
-    /*  27 */   SDL_SCANCODE_MINUS,
-    /*  28 */   SDL_SCANCODE_8,
-    /*  29 */   SDL_SCANCODE_0,
-    /*  30 */   SDL_SCANCODE_RIGHTBRACKET,
-    /*  31 */   SDL_SCANCODE_O,
-    /*  32 */   SDL_SCANCODE_U,
-    /*  33 */   SDL_SCANCODE_LEFTBRACKET,
-    /*  34 */   SDL_SCANCODE_I,
-    /*  35 */   SDL_SCANCODE_P,
-    /*  36 */   SDL_SCANCODE_RETURN,
-    /*  37 */   SDL_SCANCODE_L,
-    /*  38 */   SDL_SCANCODE_J,
-    /*  39 */   SDL_SCANCODE_APOSTROPHE,
-    /*  40 */   SDL_SCANCODE_K,
-    /*  41 */   SDL_SCANCODE_SEMICOLON,
-    /*  42 */   SDL_SCANCODE_BACKSLASH,
-    /*  43 */   SDL_SCANCODE_COMMA,
-    /*  44 */   SDL_SCANCODE_SLASH,
-    /*  45 */   SDL_SCANCODE_N,
-    /*  46 */   SDL_SCANCODE_M,
-    /*  47 */   SDL_SCANCODE_PERIOD,
-    /*  48 */   SDL_SCANCODE_TAB,
-    /*  49 */   SDL_SCANCODE_SPACE,
-    /*  50 */   SDL_SCANCODE_GRAVE, /* SDL_SCANCODE_GRAVE on ANSI and JIS keyboards, SDL_SCANCODE_NONUSBACKSLASH on ISO (see comment about virtual key code 10 above) */
-    /*  51 */   SDL_SCANCODE_BACKSPACE,
-    /*  52 */   SDL_SCANCODE_KP_ENTER, /* keyboard enter on portables */
-    /*  53 */   SDL_SCANCODE_ESCAPE,
-    /*  54 */   SDL_SCANCODE_RGUI,
-    /*  55 */   SDL_SCANCODE_LGUI,
-    /*  56 */   SDL_SCANCODE_LSHIFT,
-    /*  57 */   SDL_SCANCODE_CAPSLOCK,
-    /*  58 */   SDL_SCANCODE_LALT,
-    /*  59 */   SDL_SCANCODE_LCTRL,
-    /*  60 */   SDL_SCANCODE_RSHIFT,
-    /*  61 */   SDL_SCANCODE_RALT,
-    /*  62 */   SDL_SCANCODE_RCTRL,
-    /*  63 */   SDL_SCANCODE_RGUI, /* fn on portables, acts as a hardware-level modifier already, so we don't generate events for it, also XK_Meta_R */
-    /*  64 */   SDL_SCANCODE_F17,
-    /*  65 */   SDL_SCANCODE_KP_PERIOD,
-    /*  66 */   SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */
-    /*  67 */   SDL_SCANCODE_KP_MULTIPLY,
-    /*  68 */   SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */
-    /*  69 */   SDL_SCANCODE_KP_PLUS,
-    /*  70 */   SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */
-    /*  71 */   SDL_SCANCODE_NUMLOCKCLEAR,
-    /*  72 */   SDL_SCANCODE_VOLUMEUP,
-    /*  73 */   SDL_SCANCODE_VOLUMEDOWN,
-    /*  74 */   SDL_SCANCODE_MUTE,
-    /*  75 */   SDL_SCANCODE_KP_DIVIDE,
-    /*  76 */   SDL_SCANCODE_KP_ENTER, /* keypad enter on external keyboards, fn-return on portables */
-    /*  77 */   SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */
-    /*  78 */   SDL_SCANCODE_KP_MINUS,
-    /*  79 */   SDL_SCANCODE_F18,
-    /*  80 */   SDL_SCANCODE_F19,
-    /*  81 */   SDL_SCANCODE_KP_EQUALS,
-    /*  82 */   SDL_SCANCODE_KP_0,
-    /*  83 */   SDL_SCANCODE_KP_1,
-    /*  84 */   SDL_SCANCODE_KP_2,
-    /*  85 */   SDL_SCANCODE_KP_3,
-    /*  86 */   SDL_SCANCODE_KP_4,
-    /*  87 */   SDL_SCANCODE_KP_5,
-    /*  88 */   SDL_SCANCODE_KP_6,
-    /*  89 */   SDL_SCANCODE_KP_7,
-    /*  90 */   SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */
-    /*  91 */   SDL_SCANCODE_KP_8,
-    /*  92 */   SDL_SCANCODE_KP_9,
-    /*  93 */   SDL_SCANCODE_INTERNATIONAL3, /* Cosmo_USB2ADB.c says "Yen (JIS)" */
-    /*  94 */   SDL_SCANCODE_INTERNATIONAL1, /* Cosmo_USB2ADB.c says "Ro (JIS)" */
-    /*  95 */   SDL_SCANCODE_KP_COMMA, /* Cosmo_USB2ADB.c says ", JIS only" */
-    /*  96 */   SDL_SCANCODE_F5,
-    /*  97 */   SDL_SCANCODE_F6,
-    /*  98 */   SDL_SCANCODE_F7,
-    /*  99 */   SDL_SCANCODE_F3,
-    /* 100 */   SDL_SCANCODE_F8,
-    /* 101 */   SDL_SCANCODE_F9,
-    /* 102 */   SDL_SCANCODE_LANG2, /* Cosmo_USB2ADB.c says "Eisu" */
-    /* 103 */   SDL_SCANCODE_F11,
-    /* 104 */   SDL_SCANCODE_LANG1, /* Cosmo_USB2ADB.c says "Kana" */
-    /* 105 */   SDL_SCANCODE_PRINTSCREEN, /* On ADB keyboards, this key is labeled "F13/print screen". Problem: USB has different usage codes for these two functions. On Apple USB keyboards, the key is labeled "F13" and sends the F13 usage code (SDL_SCANCODE_F13). I decided to use SDL_SCANCODE_PRINTSCREEN here nevertheless since SDL applications are more likely to assume the presence of a print screen key than an F13 key. */
-    /* 106 */   SDL_SCANCODE_F16,
-    /* 107 */   SDL_SCANCODE_SCROLLLOCK, /* F14/scroll lock, see comment about F13/print screen above */
-    /* 108 */   SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */
-    /* 109 */   SDL_SCANCODE_F10,
-    /* 110 */   SDL_SCANCODE_APPLICATION, /* windows contextual menu key, fn-enter on portables */
-    /* 111 */   SDL_SCANCODE_F12,
-    /* 112 */   SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */
-    /* 113 */   SDL_SCANCODE_PAUSE, /* F15/pause, see comment about F13/print screen above */
-    /* 114 */   SDL_SCANCODE_INSERT, /* the key is actually labeled "help" on Apple keyboards, and works as such in Mac OS, but it sends the "insert" usage code even on Apple USB keyboards */
-    /* 115 */   SDL_SCANCODE_HOME,
-    /* 116 */   SDL_SCANCODE_PAGEUP,
-    /* 117 */   SDL_SCANCODE_DELETE,
-    /* 118 */   SDL_SCANCODE_F4,
-    /* 119 */   SDL_SCANCODE_END,
-    /* 120 */   SDL_SCANCODE_F2,
-    /* 121 */   SDL_SCANCODE_PAGEDOWN,
-    /* 122 */   SDL_SCANCODE_F1,
-    /* 123 */   SDL_SCANCODE_LEFT,
-    /* 124 */   SDL_SCANCODE_RIGHT,
-    /* 125 */   SDL_SCANCODE_DOWN,
-    /* 126 */   SDL_SCANCODE_UP,
-    /* 127 */   SDL_SCANCODE_POWER
-};
-/* *INDENT-ON* */
diff --git a/deps/SDL2/src/events/scancodes_linux.h b/deps/SDL2/src/events/scancodes_linux.h
deleted file mode 100644
index 4d819da..0000000
--- a/deps/SDL2/src/events/scancodes_linux.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../include/SDL_scancode.h"
-
-/* Linux virtual key code to SDL_Keycode mapping table
-   Sources:
-   - Linux kernel source input.h
-*/
-/* *INDENT-OFF* */
-static SDL_Scancode const linux_scancode_table[] = {
-    /*  0 */    SDL_SCANCODE_UNKNOWN,
-    /*  1 */    SDL_SCANCODE_ESCAPE,
-    /*  2 */    SDL_SCANCODE_1,
-    /*  3 */    SDL_SCANCODE_2,
-    /*  4 */    SDL_SCANCODE_3,
-    /*  5 */    SDL_SCANCODE_4,
-    /*  6 */    SDL_SCANCODE_5,
-    /*  7 */    SDL_SCANCODE_6,
-    /*  8 */    SDL_SCANCODE_7,
-    /*  9 */    SDL_SCANCODE_8,
-    /*  10 */    SDL_SCANCODE_9,
-    /*  11 */    SDL_SCANCODE_0,
-    /*  12 */    SDL_SCANCODE_MINUS,
-    /*  13 */    SDL_SCANCODE_EQUALS,
-    /*  14 */    SDL_SCANCODE_BACKSPACE,
-    /*  15 */    SDL_SCANCODE_TAB,
-    /*  16 */    SDL_SCANCODE_Q,
-    /*  17 */    SDL_SCANCODE_W,
-    /*  18 */    SDL_SCANCODE_E,
-    /*  19 */    SDL_SCANCODE_R,
-    /*  20 */    SDL_SCANCODE_T,
-    /*  21 */    SDL_SCANCODE_Y,
-    /*  22 */    SDL_SCANCODE_U,
-    /*  23 */    SDL_SCANCODE_I,
-    /*  24 */    SDL_SCANCODE_O,
-    /*  25 */    SDL_SCANCODE_P,
-    /*  26 */    SDL_SCANCODE_LEFTBRACKET,
-    /*  27 */    SDL_SCANCODE_RIGHTBRACKET,
-    /*  28 */    SDL_SCANCODE_RETURN,
-    /*  29 */    SDL_SCANCODE_LCTRL,
-    /*  30 */    SDL_SCANCODE_A,
-    /*  31 */    SDL_SCANCODE_S,
-    /*  32 */    SDL_SCANCODE_D,
-    /*  33 */    SDL_SCANCODE_F,
-    /*  34 */    SDL_SCANCODE_G,
-    /*  35 */    SDL_SCANCODE_H,
-    /*  36 */    SDL_SCANCODE_J,
-    /*  37 */    SDL_SCANCODE_K,
-    /*  38 */    SDL_SCANCODE_L,
-    /*  39 */    SDL_SCANCODE_SEMICOLON,
-    /*  40 */    SDL_SCANCODE_APOSTROPHE,
-    /*  41 */    SDL_SCANCODE_GRAVE,
-    /*  42 */    SDL_SCANCODE_LSHIFT,
-    /*  43 */    SDL_SCANCODE_BACKSLASH,
-    /*  44 */    SDL_SCANCODE_Z,
-    /*  45 */    SDL_SCANCODE_X,
-    /*  46 */    SDL_SCANCODE_C,
-    /*  47 */    SDL_SCANCODE_V,
-    /*  48 */    SDL_SCANCODE_B,
-    /*  49 */    SDL_SCANCODE_N,
-    /*  50 */    SDL_SCANCODE_M,
-    /*  51 */    SDL_SCANCODE_COMMA,
-    /*  52 */    SDL_SCANCODE_PERIOD,
-    /*  53 */    SDL_SCANCODE_SLASH,
-    /*  54 */    SDL_SCANCODE_RSHIFT,
-    /*  55 */    SDL_SCANCODE_KP_MULTIPLY,
-    /*  56 */    SDL_SCANCODE_LALT,
-    /*  57 */    SDL_SCANCODE_SPACE,
-    /*  58 */    SDL_SCANCODE_CAPSLOCK,
-    /*  59 */    SDL_SCANCODE_F1,
-    /*  60 */    SDL_SCANCODE_F2,
-    /*  61 */    SDL_SCANCODE_F3,
-    /*  62 */    SDL_SCANCODE_F4,
-    /*  63 */    SDL_SCANCODE_F5,
-    /*  64 */    SDL_SCANCODE_F6,
-    /*  65 */    SDL_SCANCODE_F7,
-    /*  66 */    SDL_SCANCODE_F8,
-    /*  67 */    SDL_SCANCODE_F9,
-    /*  68 */    SDL_SCANCODE_F10,
-    /*  69 */    SDL_SCANCODE_NUMLOCKCLEAR,
-    /*  70 */    SDL_SCANCODE_SCROLLLOCK,
-    /*  71 */    SDL_SCANCODE_KP_7,
-    /*  72 */    SDL_SCANCODE_KP_8,
-    /*  73 */    SDL_SCANCODE_KP_9,
-    /*  74 */    SDL_SCANCODE_KP_MINUS,
-    /*  75 */    SDL_SCANCODE_KP_4,
-    /*  76 */    SDL_SCANCODE_KP_5,
-    /*  77 */    SDL_SCANCODE_KP_6,
-    /*  78 */    SDL_SCANCODE_KP_PLUS,
-    /*  79 */    SDL_SCANCODE_KP_1,
-    /*  80 */    SDL_SCANCODE_KP_2,
-    /*  81 */    SDL_SCANCODE_KP_3,
-    /*  82 */    SDL_SCANCODE_KP_0,
-    /*  83 */    SDL_SCANCODE_KP_PERIOD,
-    0,
-    /*  85 */    SDL_SCANCODE_UNKNOWN, /* KEY_ZENKAKUHANKAKU */
-    /*  86 */    SDL_SCANCODE_NONUSBACKSLASH, /* KEY_102ND */
-    /*  87 */    SDL_SCANCODE_F11,
-    /*  88 */    SDL_SCANCODE_F12,
-    /*  89 */    SDL_SCANCODE_INTERNATIONAL1, /* KEY_RO */
-    /*  90 */    SDL_SCANCODE_LANG3, /* KEY_KATAKANA */
-    /*  91 */    SDL_SCANCODE_LANG4, /* KEY_HIRAGANA */
-    /*  92 */    SDL_SCANCODE_INTERNATIONAL4, /* KEY_HENKAN */
-    /*  93 */    SDL_SCANCODE_INTERNATIONAL2, /* KEY_KATAKANAHIRAGANA */
-    /*  94 */    SDL_SCANCODE_INTERNATIONAL5, /* KEY_MUHENKAN */
-    /*  95 */    SDL_SCANCODE_INTERNATIONAL5, /* KEY_KPJPCOMMA */
-    /*  96 */    SDL_SCANCODE_KP_ENTER,
-    /*  97 */    SDL_SCANCODE_RCTRL,
-    /*  98 */    SDL_SCANCODE_KP_DIVIDE,
-    /*  99 */    SDL_SCANCODE_SYSREQ,
-    /*  100 */    SDL_SCANCODE_RALT,
-    /*  101 */    SDL_SCANCODE_UNKNOWN, /* KEY_LINEFEED */
-    /*  102 */    SDL_SCANCODE_HOME,
-    /*  103 */    SDL_SCANCODE_UP,
-    /*  104 */    SDL_SCANCODE_PAGEUP,
-    /*  105 */    SDL_SCANCODE_LEFT,
-    /*  106 */    SDL_SCANCODE_RIGHT,
-    /*  107 */    SDL_SCANCODE_END,
-    /*  108 */    SDL_SCANCODE_DOWN,
-    /*  109 */    SDL_SCANCODE_PAGEDOWN,
-    /*  110 */    SDL_SCANCODE_INSERT,
-    /*  111 */    SDL_SCANCODE_DELETE,
-    /*  112 */    SDL_SCANCODE_UNKNOWN, /* KEY_MACRO */
-    /*  113 */    SDL_SCANCODE_MUTE,
-    /*  114 */    SDL_SCANCODE_VOLUMEDOWN,
-    /*  115 */    SDL_SCANCODE_VOLUMEUP,
-    /*  116 */    SDL_SCANCODE_POWER,
-    /*  117 */    SDL_SCANCODE_KP_EQUALS,
-    /*  118 */    SDL_SCANCODE_KP_PLUSMINUS,
-    /*  119 */    SDL_SCANCODE_PAUSE,
-    0,
-    /*  121 */    SDL_SCANCODE_KP_COMMA,
-    /*  122 */    SDL_SCANCODE_LANG1, /* KEY_HANGUEL */
-    /*  123 */    SDL_SCANCODE_LANG2, /* KEY_HANJA */
-    /*  124 */    SDL_SCANCODE_INTERNATIONAL3, /* KEY_YEN */
-    /*  125 */    SDL_SCANCODE_LGUI,
-    /*  126 */    SDL_SCANCODE_RGUI,
-    /*  127 */    SDL_SCANCODE_UNKNOWN, /* KEY_COMPOSE */
-    /*  128 */    SDL_SCANCODE_STOP,
-    /*  129 */    SDL_SCANCODE_AGAIN,
-    /*  130 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROPS */
-    /*  131 */    SDL_SCANCODE_UNDO,
-    /*  132 */    SDL_SCANCODE_UNKNOWN, /* KEY_FRONT */
-    /*  133 */    SDL_SCANCODE_COPY,
-    /*  134 */    SDL_SCANCODE_UNKNOWN, /* KEY_OPEN */
-    /*  135 */    SDL_SCANCODE_PASTE,
-    /*  136 */    SDL_SCANCODE_FIND,
-    /*  137 */    SDL_SCANCODE_CUT,
-    /*  138 */    SDL_SCANCODE_HELP,
-    /*  139 */    SDL_SCANCODE_MENU,
-    /*  140 */    SDL_SCANCODE_CALCULATOR,
-    /*  141 */    SDL_SCANCODE_UNKNOWN, /* KEY_SETUP */
-    /*  142 */    SDL_SCANCODE_SLEEP,
-    /*  143 */    SDL_SCANCODE_UNKNOWN, /* KEY_WAKEUP */
-    /*  144 */    SDL_SCANCODE_UNKNOWN, /* KEY_FILE */
-    /*  145 */    SDL_SCANCODE_UNKNOWN, /* KEY_SENDFILE */
-    /*  146 */    SDL_SCANCODE_UNKNOWN, /* KEY_DELETEFILE */
-    /*  147 */    SDL_SCANCODE_UNKNOWN, /* KEY_XFER */
-    /*  148 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROG1 */
-    /*  149 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROG2 */
-    /*  150 */    SDL_SCANCODE_UNKNOWN, /* KEY_WWW */
-    /*  151 */    SDL_SCANCODE_UNKNOWN, /* KEY_MSDOS */
-    /*  152 */    SDL_SCANCODE_UNKNOWN, /* KEY_COFFEE */
-    /*  153 */    SDL_SCANCODE_UNKNOWN, /* KEY_DIRECTION */
-    /*  154 */    SDL_SCANCODE_UNKNOWN, /* KEY_CYCLEWINDOWS */
-    /*  155 */    SDL_SCANCODE_MAIL,
-    /*  156 */    SDL_SCANCODE_AC_BOOKMARKS,
-    /*  157 */    SDL_SCANCODE_COMPUTER,
-    /*  158 */    SDL_SCANCODE_AC_BACK,
-    /*  159 */    SDL_SCANCODE_AC_FORWARD,
-    /*  160 */    SDL_SCANCODE_UNKNOWN, /* KEY_CLOSECD */
-    /*  161 */    SDL_SCANCODE_EJECT, /* KEY_EJECTCD */
-    /*  162 */    SDL_SCANCODE_UNKNOWN, /* KEY_EJECTCLOSECD */
-    /*  163 */    SDL_SCANCODE_AUDIONEXT, /* KEY_NEXTSONG */
-    /*  164 */    SDL_SCANCODE_AUDIOPLAY, /* KEY_PLAYPAUSE */
-    /*  165 */    SDL_SCANCODE_AUDIOPREV, /* KEY_PREVIOUSSONG */
-    /*  166 */    SDL_SCANCODE_UNKNOWN, /* KEY_STOPCD */
-    /*  167 */    SDL_SCANCODE_UNKNOWN, /* KEY_RECORD */
-    /*  168 */    SDL_SCANCODE_UNKNOWN, /* KEY_REWIND */
-    /*  169 */    SDL_SCANCODE_UNKNOWN, /* KEY_PHONE */
-    /*  170 */    SDL_SCANCODE_UNKNOWN, /* KEY_ISO */
-    /*  171 */    SDL_SCANCODE_UNKNOWN, /* KEY_CONFIG */
-    /*  172 */    SDL_SCANCODE_AC_HOME,
-    /*  173 */    SDL_SCANCODE_AC_REFRESH,
-    /*  174 */    SDL_SCANCODE_UNKNOWN, /* KEY_EXIT */
-    /*  175 */    SDL_SCANCODE_UNKNOWN, /* KEY_MOVE */
-    /*  176 */    SDL_SCANCODE_UNKNOWN, /* KEY_EDIT */
-    /*  177 */    SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLUP */
-    /*  178 */    SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLDOWN */
-    /*  179 */    SDL_SCANCODE_KP_LEFTPAREN,
-    /*  180 */    SDL_SCANCODE_KP_RIGHTPAREN,
-    /*  181 */    SDL_SCANCODE_UNKNOWN, /* KEY_NEW */
-    /*  182 */    SDL_SCANCODE_UNKNOWN, /* KEY_REDO */
-    /*  183 */    SDL_SCANCODE_F13,
-    /*  184 */    SDL_SCANCODE_F14,
-    /*  185 */    SDL_SCANCODE_F15,
-    /*  186 */    SDL_SCANCODE_F16,
-    /*  187 */    SDL_SCANCODE_F17,
-    /*  188 */    SDL_SCANCODE_F18,
-    /*  189 */    SDL_SCANCODE_F19,
-    /*  190 */    SDL_SCANCODE_F20,
-    /*  191 */    SDL_SCANCODE_F21,
-    /*  192 */    SDL_SCANCODE_F22,
-    /*  193 */    SDL_SCANCODE_F23,
-    /*  194 */    SDL_SCANCODE_F24,
-    0, 0, 0, 0,
-    /*  200 */    SDL_SCANCODE_UNKNOWN, /* KEY_PLAYCD */
-    /*  201 */    SDL_SCANCODE_UNKNOWN, /* KEY_PAUSECD */
-    /*  202 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROG3 */
-    /*  203 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROG4 */
-    0,
-    /*  205 */    SDL_SCANCODE_UNKNOWN, /* KEY_SUSPEND */
-    /*  206 */    SDL_SCANCODE_UNKNOWN, /* KEY_CLOSE */
-    /*  207 */    SDL_SCANCODE_UNKNOWN, /* KEY_PLAY */
-    /*  208 */    SDL_SCANCODE_UNKNOWN, /* KEY_FASTFORWARD */
-    /*  209 */    SDL_SCANCODE_UNKNOWN, /* KEY_BASSBOOST */
-    /*  210 */    SDL_SCANCODE_UNKNOWN, /* KEY_PRINT */
-    /*  211 */    SDL_SCANCODE_UNKNOWN, /* KEY_HP */
-    /*  212 */    SDL_SCANCODE_UNKNOWN, /* KEY_CAMERA */
-    /*  213 */    SDL_SCANCODE_UNKNOWN, /* KEY_SOUND */
-    /*  214 */    SDL_SCANCODE_UNKNOWN, /* KEY_QUESTION */
-    /*  215 */    SDL_SCANCODE_UNKNOWN, /* KEY_EMAIL */
-    /*  216 */    SDL_SCANCODE_UNKNOWN, /* KEY_CHAT */
-    /*  217 */    SDL_SCANCODE_AC_SEARCH,
-    /*  218 */    SDL_SCANCODE_UNKNOWN, /* KEY_CONNECT */
-    /*  219 */    SDL_SCANCODE_UNKNOWN, /* KEY_FINANCE */
-    /*  220 */    SDL_SCANCODE_UNKNOWN, /* KEY_SPORT */
-    /*  221 */    SDL_SCANCODE_UNKNOWN, /* KEY_SHOP */
-    /*  222 */    SDL_SCANCODE_ALTERASE,
-    /*  223 */    SDL_SCANCODE_CANCEL,
-    /*  224 */    SDL_SCANCODE_BRIGHTNESSDOWN,
-    /*  225 */    SDL_SCANCODE_BRIGHTNESSUP,
-    /*  226 */    SDL_SCANCODE_UNKNOWN, /* KEY_MEDIA */
-    /*  227 */    SDL_SCANCODE_DISPLAYSWITCH, /* KEY_SWITCHVIDEOMODE */
-    /*  228 */    SDL_SCANCODE_KBDILLUMTOGGLE,
-    /*  229 */    SDL_SCANCODE_KBDILLUMDOWN,
-    /*  230 */    SDL_SCANCODE_KBDILLUMUP,
-    /*  231 */    SDL_SCANCODE_UNKNOWN, /* KEY_SEND */
-    /*  232 */    SDL_SCANCODE_UNKNOWN, /* KEY_REPLY */
-    /*  233 */    SDL_SCANCODE_UNKNOWN, /* KEY_FORWARDMAIL */
-    /*  234 */    SDL_SCANCODE_UNKNOWN, /* KEY_SAVE */
-    /*  235 */    SDL_SCANCODE_UNKNOWN, /* KEY_DOCUMENTS */
-    /*  236 */    SDL_SCANCODE_UNKNOWN, /* KEY_BATTERY */
-};
-/* *INDENT-ON* */
diff --git a/deps/SDL2/src/events/scancodes_windows.h b/deps/SDL2/src/events/scancodes_windows.h
deleted file mode 100644
index 3462e14..0000000
--- a/deps/SDL2/src/events/scancodes_windows.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../include/SDL_scancode.h"
-
-/* Windows scancode to SDL scancode mapping table */
-/* derived from Microsoft scan code document, http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc */
-
-/* *INDENT-OFF* */
-static const SDL_Scancode windows_scancode_table[] = 
-{ 
-	/*	0						1							2							3							4						5							6							7 */
-	/*	8						9							A							B							C						D							E							F */
-	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_ESCAPE,		SDL_SCANCODE_1,				SDL_SCANCODE_2,				SDL_SCANCODE_3,			SDL_SCANCODE_4,				SDL_SCANCODE_5,				SDL_SCANCODE_6,			/* 0 */
-	SDL_SCANCODE_7,				SDL_SCANCODE_8,				SDL_SCANCODE_9,				SDL_SCANCODE_0,				SDL_SCANCODE_MINUS,		SDL_SCANCODE_EQUALS,		SDL_SCANCODE_BACKSPACE,		SDL_SCANCODE_TAB,		/* 0 */
-
-	SDL_SCANCODE_Q,				SDL_SCANCODE_W,				SDL_SCANCODE_E,				SDL_SCANCODE_R,				SDL_SCANCODE_T,			SDL_SCANCODE_Y,				SDL_SCANCODE_U,				SDL_SCANCODE_I,			/* 1 */
-	SDL_SCANCODE_O,				SDL_SCANCODE_P,				SDL_SCANCODE_LEFTBRACKET,	SDL_SCANCODE_RIGHTBRACKET,	SDL_SCANCODE_RETURN,	SDL_SCANCODE_LCTRL,			SDL_SCANCODE_A,				SDL_SCANCODE_S,			/* 1 */
-
-	SDL_SCANCODE_D,				SDL_SCANCODE_F,				SDL_SCANCODE_G,				SDL_SCANCODE_H,				SDL_SCANCODE_J,			SDL_SCANCODE_K,				SDL_SCANCODE_L,				SDL_SCANCODE_SEMICOLON,	/* 2 */
-	SDL_SCANCODE_APOSTROPHE,	SDL_SCANCODE_GRAVE,			SDL_SCANCODE_LSHIFT,		SDL_SCANCODE_BACKSLASH,		SDL_SCANCODE_Z,			SDL_SCANCODE_X,				SDL_SCANCODE_C,				SDL_SCANCODE_V,			/* 2 */
-
-	SDL_SCANCODE_B,				SDL_SCANCODE_N,				SDL_SCANCODE_M,				SDL_SCANCODE_COMMA,			SDL_SCANCODE_PERIOD,	SDL_SCANCODE_SLASH,			SDL_SCANCODE_RSHIFT,		SDL_SCANCODE_PRINTSCREEN,/* 3 */
-	SDL_SCANCODE_LALT,			SDL_SCANCODE_SPACE,			SDL_SCANCODE_CAPSLOCK,		SDL_SCANCODE_F1,			SDL_SCANCODE_F2,		SDL_SCANCODE_F3,			SDL_SCANCODE_F4,			SDL_SCANCODE_F5,		/* 3 */
-
-	SDL_SCANCODE_F6,			SDL_SCANCODE_F7,			SDL_SCANCODE_F8,			SDL_SCANCODE_F9,			SDL_SCANCODE_F10,		SDL_SCANCODE_NUMLOCKCLEAR,	SDL_SCANCODE_SCROLLLOCK,	SDL_SCANCODE_HOME,		/* 4 */
-	SDL_SCANCODE_UP,			SDL_SCANCODE_PAGEUP,		SDL_SCANCODE_KP_MINUS,		SDL_SCANCODE_LEFT,			SDL_SCANCODE_KP_5,		SDL_SCANCODE_RIGHT,			SDL_SCANCODE_KP_PLUS,		SDL_SCANCODE_END,		/* 4 */
-
-	SDL_SCANCODE_DOWN,			SDL_SCANCODE_PAGEDOWN,		SDL_SCANCODE_INSERT,		SDL_SCANCODE_DELETE,		SDL_SCANCODE_UNKNOWN,	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_NONUSBACKSLASH,SDL_SCANCODE_F11,		/* 5 */
-	SDL_SCANCODE_F12,			SDL_SCANCODE_PAUSE,			SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_LGUI,			SDL_SCANCODE_RGUI,		SDL_SCANCODE_APPLICATION,	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	/* 5 */
-
-	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_F13,		SDL_SCANCODE_F14,			SDL_SCANCODE_F15,			SDL_SCANCODE_F16,		/* 6 */
-	SDL_SCANCODE_F17,			SDL_SCANCODE_F18,			SDL_SCANCODE_F19,			SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	/* 6 */
-	
-	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	/* 7 */
-	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN	/* 7 */
-};
-/* *INDENT-ON* */
diff --git a/deps/SDL2/src/events/scancodes_xfree86.h b/deps/SDL2/src/events/scancodes_xfree86.h
deleted file mode 100644
index fadcfbf..0000000
--- a/deps/SDL2/src/events/scancodes_xfree86.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../include/SDL_scancode.h"
-
-/* XFree86 key code to SDL scancode mapping table
-   Sources:
-   - atKeyNames.h from XFree86 source code
-*/
-/* *INDENT-OFF* */
-static const SDL_Scancode xfree86_scancode_table[] = {
-    /*  0 */    SDL_SCANCODE_UNKNOWN,
-    /*  1 */    SDL_SCANCODE_ESCAPE,
-    /*  2 */    SDL_SCANCODE_1,
-    /*  3 */    SDL_SCANCODE_2,
-    /*  4 */    SDL_SCANCODE_3,
-    /*  5 */    SDL_SCANCODE_4,
-    /*  6 */    SDL_SCANCODE_5,
-    /*  7 */    SDL_SCANCODE_6,
-    /*  8 */    SDL_SCANCODE_7,
-    /*  9 */    SDL_SCANCODE_8,
-    /*  10 */   SDL_SCANCODE_9,
-    /*  11 */   SDL_SCANCODE_0,
-    /*  12 */   SDL_SCANCODE_MINUS,
-    /*  13 */   SDL_SCANCODE_EQUALS,
-    /*  14 */   SDL_SCANCODE_BACKSPACE,
-    /*  15 */   SDL_SCANCODE_TAB,
-    /*  16 */   SDL_SCANCODE_Q,
-    /*  17 */   SDL_SCANCODE_W,
-    /*  18 */   SDL_SCANCODE_E,
-    /*  19 */   SDL_SCANCODE_R,
-    /*  20 */   SDL_SCANCODE_T,
-    /*  21 */   SDL_SCANCODE_Y,
-    /*  22 */   SDL_SCANCODE_U,
-    /*  23 */   SDL_SCANCODE_I,
-    /*  24 */   SDL_SCANCODE_O,
-    /*  25 */   SDL_SCANCODE_P,
-    /*  26 */   SDL_SCANCODE_LEFTBRACKET,
-    /*  27 */   SDL_SCANCODE_RIGHTBRACKET,
-    /*  28 */   SDL_SCANCODE_RETURN,
-    /*  29 */   SDL_SCANCODE_LCTRL,
-    /*  30 */   SDL_SCANCODE_A,
-    /*  31 */   SDL_SCANCODE_S,
-    /*  32 */   SDL_SCANCODE_D,
-    /*  33 */   SDL_SCANCODE_F,
-    /*  34 */   SDL_SCANCODE_G,
-    /*  35 */   SDL_SCANCODE_H,
-    /*  36 */   SDL_SCANCODE_J,
-    /*  37 */   SDL_SCANCODE_K,
-    /*  38 */   SDL_SCANCODE_L,
-    /*  39 */   SDL_SCANCODE_SEMICOLON,
-    /*  40 */   SDL_SCANCODE_APOSTROPHE,
-    /*  41 */   SDL_SCANCODE_GRAVE,
-    /*  42 */   SDL_SCANCODE_LSHIFT,
-    /*  43 */   SDL_SCANCODE_BACKSLASH,
-    /*  44 */   SDL_SCANCODE_Z,
-    /*  45 */   SDL_SCANCODE_X,
-    /*  46 */   SDL_SCANCODE_C,
-    /*  47 */   SDL_SCANCODE_V,
-    /*  48 */   SDL_SCANCODE_B,
-    /*  49 */   SDL_SCANCODE_N,
-    /*  50 */   SDL_SCANCODE_M,
-    /*  51 */   SDL_SCANCODE_COMMA,
-    /*  52 */   SDL_SCANCODE_PERIOD,
-    /*  53 */   SDL_SCANCODE_SLASH,
-    /*  54 */   SDL_SCANCODE_RSHIFT,
-    /*  55 */   SDL_SCANCODE_KP_MULTIPLY,
-    /*  56 */   SDL_SCANCODE_LALT,
-    /*  57 */   SDL_SCANCODE_SPACE,
-    /*  58 */   SDL_SCANCODE_CAPSLOCK,
-    /*  59 */   SDL_SCANCODE_F1,
-    /*  60 */   SDL_SCANCODE_F2,
-    /*  61 */   SDL_SCANCODE_F3,
-    /*  62 */   SDL_SCANCODE_F4,
-    /*  63 */   SDL_SCANCODE_F5,
-    /*  64 */   SDL_SCANCODE_F6,
-    /*  65 */   SDL_SCANCODE_F7,
-    /*  66 */   SDL_SCANCODE_F8,
-    /*  67 */   SDL_SCANCODE_F9,
-    /*  68 */   SDL_SCANCODE_F10,
-    /*  69 */   SDL_SCANCODE_NUMLOCKCLEAR,
-    /*  70 */   SDL_SCANCODE_SCROLLLOCK,
-    /*  71 */   SDL_SCANCODE_KP_7,
-    /*  72 */   SDL_SCANCODE_KP_8,
-    /*  73 */   SDL_SCANCODE_KP_9,
-    /*  74 */   SDL_SCANCODE_KP_MINUS,
-    /*  75 */   SDL_SCANCODE_KP_4,
-    /*  76 */   SDL_SCANCODE_KP_5,
-    /*  77 */   SDL_SCANCODE_KP_6,
-    /*  78 */   SDL_SCANCODE_KP_PLUS,
-    /*  79 */   SDL_SCANCODE_KP_1,
-    /*  80 */   SDL_SCANCODE_KP_2,
-    /*  81 */   SDL_SCANCODE_KP_3,
-    /*  82 */   SDL_SCANCODE_KP_0,
-    /*  83 */   SDL_SCANCODE_KP_PERIOD,
-    /*  84 */   SDL_SCANCODE_SYSREQ,
-    /*  85 */   SDL_SCANCODE_MODE,
-    /*  86 */   SDL_SCANCODE_NONUSBACKSLASH,
-    /*  87 */   SDL_SCANCODE_F11,
-    /*  88 */   SDL_SCANCODE_F12,
-    /*  89 */   SDL_SCANCODE_HOME,
-    /*  90 */   SDL_SCANCODE_UP,
-    /*  91 */   SDL_SCANCODE_PAGEUP,
-    /*  92 */   SDL_SCANCODE_LEFT,
-    /*  93 */   SDL_SCANCODE_BRIGHTNESSDOWN, /* on PowerBook G4 / KEY_Begin */
-    /*  94 */   SDL_SCANCODE_RIGHT,
-    /*  95 */   SDL_SCANCODE_END,
-    /*  96 */   SDL_SCANCODE_DOWN,
-    /*  97 */   SDL_SCANCODE_PAGEDOWN,
-    /*  98 */   SDL_SCANCODE_INSERT,
-    /*  99 */   SDL_SCANCODE_DELETE,
-    /*  100 */  SDL_SCANCODE_KP_ENTER,
-    /*  101 */  SDL_SCANCODE_RCTRL,
-    /*  102 */  SDL_SCANCODE_PAUSE,
-    /*  103 */  SDL_SCANCODE_PRINTSCREEN,
-    /*  104 */  SDL_SCANCODE_KP_DIVIDE,
-    /*  105 */  SDL_SCANCODE_RALT,
-    /*  106 */  SDL_SCANCODE_UNKNOWN, /* BREAK */
-    /*  107 */  SDL_SCANCODE_LGUI,
-    /*  108 */  SDL_SCANCODE_RGUI,
-    /*  109 */  SDL_SCANCODE_APPLICATION,
-    /*  110 */  SDL_SCANCODE_F13,
-    /*  111 */  SDL_SCANCODE_F14,
-    /*  112 */  SDL_SCANCODE_F15,
-    /*  113 */  SDL_SCANCODE_F16,
-    /*  114 */  SDL_SCANCODE_F17,
-    /*  115 */  SDL_SCANCODE_UNKNOWN,
-    /*  116 */  SDL_SCANCODE_UNKNOWN, /* is translated to XK_ISO_Level3_Shift by my X server, but I have no keyboard that generates this code, so I don't know what the correct SDL_SCANCODE_* for it is */
-    /*  117 */  SDL_SCANCODE_UNKNOWN,
-    /*  118 */  SDL_SCANCODE_KP_EQUALS,
-    /*  119 */  SDL_SCANCODE_UNKNOWN,
-    /*  120 */  SDL_SCANCODE_UNKNOWN,
-    /*  121 */  SDL_SCANCODE_UNKNOWN,
-    /*  122 */  SDL_SCANCODE_UNKNOWN,
-    /*  123 */  SDL_SCANCODE_UNKNOWN,
-    /*  124 */  SDL_SCANCODE_UNKNOWN,
-    /*  125 */  SDL_SCANCODE_INTERNATIONAL3, /* Yen */
-    /*  126 */  SDL_SCANCODE_UNKNOWN,
-    /*  127 */  SDL_SCANCODE_UNKNOWN,
-    /*  128 */  SDL_SCANCODE_UNKNOWN,
-    /*  129 */  SDL_SCANCODE_UNKNOWN,
-    /*  130 */  SDL_SCANCODE_UNKNOWN,
-    /*  131 */  SDL_SCANCODE_UNKNOWN,
-    /*  132 */  SDL_SCANCODE_POWER,
-    /*  133 */  SDL_SCANCODE_MUTE,
-    /*  134 */  SDL_SCANCODE_VOLUMEDOWN,
-    /*  135 */  SDL_SCANCODE_VOLUMEUP,
-    /*  136 */  SDL_SCANCODE_HELP,
-    /*  137 */  SDL_SCANCODE_STOP,
-    /*  138 */  SDL_SCANCODE_AGAIN,
-    /*  139 */  SDL_SCANCODE_UNKNOWN, /* PROPS */
-    /*  140 */  SDL_SCANCODE_UNDO,
-    /*  141 */  SDL_SCANCODE_UNKNOWN, /* FRONT */
-    /*  142 */  SDL_SCANCODE_COPY,
-    /*  143 */  SDL_SCANCODE_UNKNOWN, /* OPEN */
-    /*  144 */  SDL_SCANCODE_PASTE,
-    /*  145 */  SDL_SCANCODE_FIND,
-    /*  146 */  SDL_SCANCODE_CUT,
-};
-
-/* for wireless usb keyboard (manufacturer TRUST) without numpad. */
-static const SDL_Scancode xfree86_scancode_table2[] = {
-    /*  0 */    SDL_SCANCODE_UNKNOWN,
-    /*  1 */    SDL_SCANCODE_ESCAPE,
-    /*  2 */    SDL_SCANCODE_1,
-    /*  3 */    SDL_SCANCODE_2,
-    /*  4 */    SDL_SCANCODE_3,
-    /*  5 */    SDL_SCANCODE_4,
-    /*  6 */    SDL_SCANCODE_5,
-    /*  7 */    SDL_SCANCODE_6,
-    /*  8 */    SDL_SCANCODE_7,
-    /*  9 */    SDL_SCANCODE_8,
-    /*  10 */   SDL_SCANCODE_9,
-    /*  11 */   SDL_SCANCODE_0,
-    /*  12 */   SDL_SCANCODE_MINUS,
-    /*  13 */   SDL_SCANCODE_EQUALS,
-    /*  14 */   SDL_SCANCODE_BACKSPACE,
-    /*  15 */   SDL_SCANCODE_TAB,
-    /*  16 */   SDL_SCANCODE_Q,
-    /*  17 */   SDL_SCANCODE_W,
-    /*  18 */   SDL_SCANCODE_E,
-    /*  19 */   SDL_SCANCODE_R,
-    /*  20 */   SDL_SCANCODE_T,
-    /*  21 */   SDL_SCANCODE_Y,
-    /*  22 */   SDL_SCANCODE_U,
-    /*  23 */   SDL_SCANCODE_I,
-    /*  24 */   SDL_SCANCODE_O,
-    /*  25 */   SDL_SCANCODE_P,
-    /*  26 */   SDL_SCANCODE_LEFTBRACKET,
-    /*  27 */   SDL_SCANCODE_RIGHTBRACKET,
-    /*  28 */   SDL_SCANCODE_RETURN,
-    /*  29 */   SDL_SCANCODE_LCTRL,
-    /*  30 */   SDL_SCANCODE_A,
-    /*  31 */   SDL_SCANCODE_S,
-    /*  32 */   SDL_SCANCODE_D,
-    /*  33 */   SDL_SCANCODE_F,
-    /*  34 */   SDL_SCANCODE_G,
-    /*  35 */   SDL_SCANCODE_H,
-    /*  36 */   SDL_SCANCODE_J,
-    /*  37 */   SDL_SCANCODE_K,
-    /*  38 */   SDL_SCANCODE_L,
-    /*  39 */   SDL_SCANCODE_SEMICOLON,
-    /*  40 */   SDL_SCANCODE_APOSTROPHE,
-    /*  41 */   SDL_SCANCODE_GRAVE,
-    /*  42 */   SDL_SCANCODE_LSHIFT,
-    /*  43 */   SDL_SCANCODE_BACKSLASH,
-    /*  44 */   SDL_SCANCODE_Z,
-    /*  45 */   SDL_SCANCODE_X,
-    /*  46 */   SDL_SCANCODE_C,
-    /*  47 */   SDL_SCANCODE_V,
-    /*  48 */   SDL_SCANCODE_B,
-    /*  49 */   SDL_SCANCODE_N,
-    /*  50 */   SDL_SCANCODE_M,
-    /*  51 */   SDL_SCANCODE_COMMA,
-    /*  52 */   SDL_SCANCODE_PERIOD,
-    /*  53 */   SDL_SCANCODE_SLASH,
-    /*  54 */   SDL_SCANCODE_RSHIFT,
-    /*  55 */   SDL_SCANCODE_KP_MULTIPLY,
-    /*  56 */   SDL_SCANCODE_LALT,
-    /*  57 */   SDL_SCANCODE_SPACE,
-    /*  58 */   SDL_SCANCODE_CAPSLOCK,
-    /*  59 */   SDL_SCANCODE_F1,
-    /*  60 */   SDL_SCANCODE_F2,
-    /*  61 */   SDL_SCANCODE_F3,
-    /*  62 */   SDL_SCANCODE_F4,
-    /*  63 */   SDL_SCANCODE_F5,
-    /*  64 */   SDL_SCANCODE_F6,
-    /*  65 */   SDL_SCANCODE_F7,
-    /*  66 */   SDL_SCANCODE_F8,
-    /*  67 */   SDL_SCANCODE_F9,
-    /*  68 */   SDL_SCANCODE_F10,
-    /*  69 */   SDL_SCANCODE_NUMLOCKCLEAR,
-    /*  70 */   SDL_SCANCODE_SCROLLLOCK,
-    /*  71 */   SDL_SCANCODE_KP_7,
-    /*  72 */   SDL_SCANCODE_KP_8,
-    /*  73 */   SDL_SCANCODE_KP_9,
-    /*  74 */   SDL_SCANCODE_KP_MINUS,
-    /*  75 */   SDL_SCANCODE_KP_4,
-    /*  76 */   SDL_SCANCODE_KP_5,
-    /*  77 */   SDL_SCANCODE_KP_6,
-    /*  78 */   SDL_SCANCODE_KP_PLUS,
-    /*  79 */   SDL_SCANCODE_KP_1,
-    /*  80 */   SDL_SCANCODE_KP_2,
-    /*  81 */   SDL_SCANCODE_KP_3,
-    /*  82 */   SDL_SCANCODE_KP_0,
-    /*  83 */   SDL_SCANCODE_KP_PERIOD,
-    /*  84 */   SDL_SCANCODE_SYSREQ,    /* ???? */
-    /*  85 */   SDL_SCANCODE_MODE,      /* ???? */
-    /*  86 */   SDL_SCANCODE_NONUSBACKSLASH,
-    /*  87 */   SDL_SCANCODE_F11,
-    /*  88 */   SDL_SCANCODE_F12,
-    /*  89 */   SDL_SCANCODE_UNKNOWN,
-    /*  90 */   SDL_SCANCODE_UNKNOWN,   /* Katakana */
-    /*  91 */   SDL_SCANCODE_UNKNOWN,   /* Hiragana */
-    /*  92 */   SDL_SCANCODE_UNKNOWN,   /* Henkan_Mode */
-    /*  93 */   SDL_SCANCODE_UNKNOWN,   /* Hiragana_Katakana */
-    /*  94 */   SDL_SCANCODE_UNKNOWN,   /* Muhenkan */
-    /*  95 */   SDL_SCANCODE_UNKNOWN,
-    /*  96 */   SDL_SCANCODE_KP_ENTER,
-    /*  97 */   SDL_SCANCODE_RCTRL,
-    /*  98 */   SDL_SCANCODE_KP_DIVIDE,
-    /*  99 */   SDL_SCANCODE_PRINTSCREEN,
-    /* 100 */   SDL_SCANCODE_RALT,      /* ISO_Level3_Shift, ALTGR, RALT */
-    /* 101 */   SDL_SCANCODE_UNKNOWN,   /* Linefeed */
-    /* 102 */   SDL_SCANCODE_HOME,
-    /* 103 */   SDL_SCANCODE_UP,
-    /* 104 */   SDL_SCANCODE_PAGEUP,
-    /* 105 */   SDL_SCANCODE_LEFT,
-    /* 106 */   SDL_SCANCODE_RIGHT,
-    /* 107 */   SDL_SCANCODE_END,
-    /* 108 */   SDL_SCANCODE_DOWN,
-    /* 109 */   SDL_SCANCODE_PAGEDOWN,
-    /* 110 */   SDL_SCANCODE_INSERT,
-    /* 111 */   SDL_SCANCODE_DELETE,
-    /* 112 */   SDL_SCANCODE_UNKNOWN,
-    /* 113 */   SDL_SCANCODE_MUTE,
-    /* 114 */   SDL_SCANCODE_VOLUMEDOWN,
-    /* 115 */   SDL_SCANCODE_VOLUMEUP,
-    /* 116 */   SDL_SCANCODE_POWER,
-    /* 117 */   SDL_SCANCODE_KP_EQUALS,
-    /* 118 */   SDL_SCANCODE_UNKNOWN,   /* plusminus */
-    /* 119 */   SDL_SCANCODE_PAUSE,
-    /* 120 */   SDL_SCANCODE_UNKNOWN,   /* XF86LaunchA */
-    /* 121 */   SDL_SCANCODE_UNKNOWN,   /* KP_Decimal */
-    /* 122 */   SDL_SCANCODE_UNKNOWN,   /* Hangul */
-    /* 123 */   SDL_SCANCODE_UNKNOWN,   /* Hangul_Hanja */
-    /* 124 */   SDL_SCANCODE_UNKNOWN,
-    /* 125 */   SDL_SCANCODE_LGUI,
-    /* 126 */   SDL_SCANCODE_RGUI,
-    /* 127 */   SDL_SCANCODE_APPLICATION,
-    /* 128 */   SDL_SCANCODE_CANCEL,
-    /* 129 */   SDL_SCANCODE_AGAIN,
-    /* 130 */   SDL_SCANCODE_UNKNOWN,   /* SunProps */
-    /* 131 */   SDL_SCANCODE_UNDO,
-    /* 132 */   SDL_SCANCODE_UNKNOWN,   /* SunFront */
-    /* 133 */   SDL_SCANCODE_COPY,
-    /* 134 */   SDL_SCANCODE_UNKNOWN,   /* SunOpen */
-    /* 135 */   SDL_SCANCODE_PASTE,
-    /* 136 */   SDL_SCANCODE_FIND,
-    /* 137 */   SDL_SCANCODE_CUT,
-    /* 138 */   SDL_SCANCODE_HELP,
-    /* 139 */   SDL_SCANCODE_UNKNOWN,   /* XF86MenuKB */
-    /* 140 */   SDL_SCANCODE_CALCULATOR,
-    /* 141 */   SDL_SCANCODE_UNKNOWN,
-    /* 142 */   SDL_SCANCODE_SLEEP,
-    /* 143 */   SDL_SCANCODE_UNKNOWN,   /* XF86WakeUp */
-    /* 144 */   SDL_SCANCODE_UNKNOWN,   /* XF86Explorer */
-    /* 145 */   SDL_SCANCODE_UNKNOWN,   /* XF86Send */
-    /* 146 */   SDL_SCANCODE_UNKNOWN,
-    /* 147 */   SDL_SCANCODE_UNKNOWN,   /* XF86Xfer */
-    /* 148 */   SDL_SCANCODE_APP1,      /* XF86Launch1 */
-    /* 149 */   SDL_SCANCODE_APP2,      /* XF86Launch2 */
-    /* 150 */   SDL_SCANCODE_WWW,
-    /* 151 */   SDL_SCANCODE_UNKNOWN,   /* XF86DOS */
-    /* 152 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScreenSaver */
-    /* 153 */   SDL_SCANCODE_UNKNOWN,
-    /* 154 */   SDL_SCANCODE_UNKNOWN,   /* XF86RotateWindows */
-    /* 155 */   SDL_SCANCODE_MAIL,
-    /* 156 */   SDL_SCANCODE_AC_BOOKMARKS,   /* XF86Favorites */
-    /* 157 */   SDL_SCANCODE_COMPUTER,
-    /* 158 */   SDL_SCANCODE_AC_BACK,
-    /* 159 */   SDL_SCANCODE_AC_FORWARD,
-    /* 160 */   SDL_SCANCODE_UNKNOWN,
-    /* 161 */   SDL_SCANCODE_EJECT,
-    /* 162 */   SDL_SCANCODE_EJECT,
-    /* 163 */   SDL_SCANCODE_AUDIONEXT,
-    /* 164 */   SDL_SCANCODE_AUDIOPLAY,
-    /* 165 */   SDL_SCANCODE_AUDIOPREV,
-    /* 166 */   SDL_SCANCODE_AUDIOSTOP,
-    /* 167 */   SDL_SCANCODE_UNKNOWN,   /* XF86AudioRecord */
-    /* 168 */   SDL_SCANCODE_UNKNOWN,   /* XF86AudioRewind */
-    /* 169 */   SDL_SCANCODE_UNKNOWN,   /* XF86Phone */
-    /* 170 */   SDL_SCANCODE_UNKNOWN,
-    /* 171 */   SDL_SCANCODE_F13,       /* XF86Tools */
-    /* 172 */   SDL_SCANCODE_AC_HOME,
-    /* 173 */   SDL_SCANCODE_AC_REFRESH,
-    /* 174 */   SDL_SCANCODE_UNKNOWN,   /* XF86Close */
-    /* 175 */   SDL_SCANCODE_UNKNOWN,
-    /* 176 */   SDL_SCANCODE_UNKNOWN,
-    /* 177 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollUp */
-    /* 178 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollDown */
-    /* 179 */   SDL_SCANCODE_UNKNOWN,   /* parenleft */
-    /* 180 */   SDL_SCANCODE_UNKNOWN,   /* parenright */
-    /* 181 */   SDL_SCANCODE_UNKNOWN,   /* XF86New */
-    /* 182 */   SDL_SCANCODE_AGAIN,
-    /* 183 */   SDL_SCANCODE_F13,       /* XF86Tools */
-    /* 184 */   SDL_SCANCODE_F14,       /* XF86Launch5 */
-    /* 185 */   SDL_SCANCODE_F15,       /* XF86Launch6 */
-    /* 186 */   SDL_SCANCODE_F16,       /* XF86Launch7 */
-    /* 187 */   SDL_SCANCODE_F17,       /* XF86Launch8 */
-    /* 188 */   SDL_SCANCODE_F18,       /* XF86Launch9 */
-    /* 189 */   SDL_SCANCODE_F19,       /* null keysym */
-    /* 190 */   SDL_SCANCODE_UNKNOWN,
-    /* 191 */   SDL_SCANCODE_UNKNOWN,
-    /* 192 */   SDL_SCANCODE_UNKNOWN,   /* XF86TouchpadToggle */
-    /* 193 */   SDL_SCANCODE_UNKNOWN,
-    /* 194 */   SDL_SCANCODE_UNKNOWN,
-    /* 195 */   SDL_SCANCODE_MODE,
-    /* 196 */   SDL_SCANCODE_UNKNOWN,
-    /* 197 */   SDL_SCANCODE_UNKNOWN,
-    /* 198 */   SDL_SCANCODE_UNKNOWN,
-    /* 199 */   SDL_SCANCODE_UNKNOWN,
-    /* 200 */   SDL_SCANCODE_AUDIOPLAY,
-    /* 201 */   SDL_SCANCODE_UNKNOWN,   /* XF86AudioPause */
-    /* 202 */   SDL_SCANCODE_UNKNOWN,   /* XF86Launch3 */
-    /* 203 */   SDL_SCANCODE_UNKNOWN,   /* XF86Launch4 */
-    /* 204 */   SDL_SCANCODE_UNKNOWN,   /* XF86LaunchB */
-    /* 205 */   SDL_SCANCODE_UNKNOWN,   /* XF86Suspend */
-    /* 206 */   SDL_SCANCODE_UNKNOWN,   /* XF86Close */
-    /* 207 */   SDL_SCANCODE_AUDIOPLAY,
-    /* 208 */   SDL_SCANCODE_AUDIONEXT,
-    /* 209 */   SDL_SCANCODE_UNKNOWN,
-    /* 210 */   SDL_SCANCODE_PRINTSCREEN,
-    /* 211 */   SDL_SCANCODE_UNKNOWN,
-    /* 212 */   SDL_SCANCODE_UNKNOWN,   /* XF86WebCam */
-    /* 213 */   SDL_SCANCODE_UNKNOWN,
-    /* 214 */   SDL_SCANCODE_UNKNOWN,
-    /* 215 */   SDL_SCANCODE_MAIL,
-    /* 216 */   SDL_SCANCODE_UNKNOWN,
-    /* 217 */   SDL_SCANCODE_AC_SEARCH,
-    /* 218 */   SDL_SCANCODE_UNKNOWN,
-    /* 219 */   SDL_SCANCODE_UNKNOWN,   /* XF86Finance */
-    /* 220 */   SDL_SCANCODE_UNKNOWN,
-    /* 221 */   SDL_SCANCODE_UNKNOWN,   /* XF86Shop */
-    /* 222 */   SDL_SCANCODE_UNKNOWN,
-    /* 223 */   SDL_SCANCODE_STOP,
-    /* 224 */   SDL_SCANCODE_BRIGHTNESSDOWN,
-    /* 225 */   SDL_SCANCODE_BRIGHTNESSUP,
-    /* 226 */   SDL_SCANCODE_MEDIASELECT,
-    /* 227 */   SDL_SCANCODE_DISPLAYSWITCH,
-    /* 228 */   SDL_SCANCODE_KBDILLUMTOGGLE,
-    /* 229 */   SDL_SCANCODE_KBDILLUMDOWN,
-    /* 230 */   SDL_SCANCODE_KBDILLUMUP,
-    /* 231 */   SDL_SCANCODE_UNKNOWN,   /* XF86Send */
-    /* 232 */   SDL_SCANCODE_UNKNOWN,   /* XF86Reply */
-    /* 233 */   SDL_SCANCODE_UNKNOWN,   /* XF86MailForward */
-    /* 234 */   SDL_SCANCODE_UNKNOWN,   /* XF86Save */
-    /* 235 */   SDL_SCANCODE_UNKNOWN,   /* XF86Documents */
-    /* 236 */   SDL_SCANCODE_UNKNOWN,   /* XF86Battery */
-    /* 237 */   SDL_SCANCODE_UNKNOWN,   /* XF86Bluetooth */
-    /* 238 */   SDL_SCANCODE_UNKNOWN,   /* XF86WLAN */
-};
-
-/* *INDENT-ON* */
diff --git a/deps/SDL2/src/file/SDL_rwops.c b/deps/SDL2/src/file/SDL_rwops.c
deleted file mode 100644
index d71dbfd..0000000
--- a/deps/SDL2/src/file/SDL_rwops.c
+++ /dev/null
@@ -1,758 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-/* Need this so Linux systems define fseek64o, ftell64o and off64_t */
-#define _LARGEFILE64_SOURCE
-#include "SDL_config.h"
-
-#if defined(__WIN32__)
-#include "../core/windows/SDL_windows.h"
-#endif
-
-
-/* This file provides a general interface for SDL to read and write
-   data sources.  It can easily be extended to files, memory, etc.
-*/
-
-#include "SDL_endian.h"
-#include "SDL_rwops.h"
-
-#ifdef __APPLE__
-#include "cocoa/SDL_rwopsbundlesupport.h"
-#endif /* __APPLE__ */
-
-#ifdef ANDROID
-#include "../core/android/SDL_android.h"
-#include "SDL_system.h"
-#endif
-
-#ifdef __WIN32__
-
-/* Functions to read/write Win32 API file pointers */
-
-#ifndef INVALID_SET_FILE_POINTER
-#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
-#endif
-
-#define READAHEAD_BUFFER_SIZE   1024
-
-static int SDLCALL
-windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
-{
-    UINT old_error_mode;
-    HANDLE h;
-    DWORD r_right, w_right;
-    DWORD must_exist, truncate;
-    int a_mode;
-
-    if (!context)
-        return -1;              /* failed (invalid call) */
-
-    context->hidden.windowsio.h = INVALID_HANDLE_VALUE;   /* mark this as unusable */
-    context->hidden.windowsio.buffer.data = NULL;
-    context->hidden.windowsio.buffer.size = 0;
-    context->hidden.windowsio.buffer.left = 0;
-
-    /* "r" = reading, file must exist */
-    /* "w" = writing, truncate existing, file may not exist */
-    /* "r+"= reading or writing, file must exist            */
-    /* "a" = writing, append file may not exist             */
-    /* "a+"= append + read, file may not exist              */
-    /* "w+" = read, write, truncate. file may not exist    */
-
-    must_exist = (SDL_strchr(mode, 'r') != NULL) ? OPEN_EXISTING : 0;
-    truncate = (SDL_strchr(mode, 'w') != NULL) ? CREATE_ALWAYS : 0;
-    r_right = (SDL_strchr(mode, '+') != NULL
-               || must_exist) ? GENERIC_READ : 0;
-    a_mode = (SDL_strchr(mode, 'a') != NULL) ? OPEN_ALWAYS : 0;
-    w_right = (a_mode || SDL_strchr(mode, '+')
-               || truncate) ? GENERIC_WRITE : 0;
-
-    if (!r_right && !w_right)   /* inconsistent mode */
-        return -1;              /* failed (invalid call) */
-
-    context->hidden.windowsio.buffer.data =
-        (char *) SDL_malloc(READAHEAD_BUFFER_SIZE);
-    if (!context->hidden.windowsio.buffer.data) {
-        return SDL_OutOfMemory();
-    }
-    /* Do not open a dialog box if failure */
-    old_error_mode =
-        SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
-
-    {
-        LPTSTR tstr = WIN_UTF8ToString(filename);
-        h = CreateFile(tstr, (w_right | r_right),
-                       (w_right) ? 0 : FILE_SHARE_READ, NULL,
-                       (must_exist | truncate | a_mode),
-                       FILE_ATTRIBUTE_NORMAL, NULL);
-        SDL_free(tstr);
-    }
-
-    /* restore old behavior */
-    SetErrorMode(old_error_mode);
-
-    if (h == INVALID_HANDLE_VALUE) {
-        SDL_free(context->hidden.windowsio.buffer.data);
-        context->hidden.windowsio.buffer.data = NULL;
-        SDL_SetError("Couldn't open %s", filename);
-        return -2;              /* failed (CreateFile) */
-    }
-    context->hidden.windowsio.h = h;
-    context->hidden.windowsio.append = a_mode ? SDL_TRUE : SDL_FALSE;
-
-    return 0;                   /* ok */
-}
-
-static Sint64 SDLCALL
-windows_file_size(SDL_RWops * context)
-{
-    LARGE_INTEGER size;
-
-    if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) {
-        return SDL_SetError("windows_file_size: invalid context/file not opened");
-    }
-
-    if (!GetFileSizeEx(context->hidden.windowsio.h, &size)) {
-        return WIN_SetError("windows_file_size");
-    }
-
-    return size.QuadPart;
-}
-
-static Sint64 SDLCALL
-windows_file_seek(SDL_RWops * context, Sint64 offset, int whence)
-{
-    DWORD windowswhence;
-    LARGE_INTEGER windowsoffset;
-
-    if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) {
-        return SDL_SetError("windows_file_seek: invalid context/file not opened");
-    }
-
-    /* FIXME: We may be able to satisfy the seek within buffered data */
-    if (whence == RW_SEEK_CUR && context->hidden.windowsio.buffer.left) {
-        offset -= (long)context->hidden.windowsio.buffer.left;
-    }
-    context->hidden.windowsio.buffer.left = 0;
-
-    switch (whence) {
-    case RW_SEEK_SET:
-        windowswhence = FILE_BEGIN;
-        break;
-    case RW_SEEK_CUR:
-        windowswhence = FILE_CURRENT;
-        break;
-    case RW_SEEK_END:
-        windowswhence = FILE_END;
-        break;
-    default:
-        return SDL_SetError("windows_file_seek: Unknown value for 'whence'");
-    }
-
-    windowsoffset.QuadPart = offset;
-    if (!SetFilePointerEx(context->hidden.windowsio.h, windowsoffset, &windowsoffset, windowswhence)) {
-        return WIN_SetError("windows_file_seek");
-    }
-    return windowsoffset.QuadPart;
-}
-
-static size_t SDLCALL
-windows_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
-{
-    size_t total_need;
-    size_t total_read = 0;
-    size_t read_ahead;
-    DWORD byte_read;
-
-    total_need = size * maxnum;
-
-    if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE
-        || !total_need)
-        return 0;
-
-    if (context->hidden.windowsio.buffer.left > 0) {
-        void *data = (char *) context->hidden.windowsio.buffer.data +
-            context->hidden.windowsio.buffer.size -
-            context->hidden.windowsio.buffer.left;
-        read_ahead =
-            SDL_min(total_need, context->hidden.windowsio.buffer.left);
-        SDL_memcpy(ptr, data, read_ahead);
-        context->hidden.windowsio.buffer.left -= read_ahead;
-
-        if (read_ahead == total_need) {
-            return maxnum;
-        }
-        ptr = (char *) ptr + read_ahead;
-        total_need -= read_ahead;
-        total_read += read_ahead;
-    }
-
-    if (total_need < READAHEAD_BUFFER_SIZE) {
-        if (!ReadFile
-            (context->hidden.windowsio.h, context->hidden.windowsio.buffer.data,
-             READAHEAD_BUFFER_SIZE, &byte_read, NULL)) {
-            SDL_Error(SDL_EFREAD);
-            return 0;
-        }
-        read_ahead = SDL_min(total_need, (int) byte_read);
-        SDL_memcpy(ptr, context->hidden.windowsio.buffer.data, read_ahead);
-        context->hidden.windowsio.buffer.size = byte_read;
-        context->hidden.windowsio.buffer.left = byte_read - read_ahead;
-        total_read += read_ahead;
-    } else {
-        if (!ReadFile
-            (context->hidden.windowsio.h, ptr, (DWORD)total_need, &byte_read, NULL)) {
-            SDL_Error(SDL_EFREAD);
-            return 0;
-        }
-        total_read += byte_read;
-    }
-    return (total_read / size);
-}
-
-static size_t SDLCALL
-windows_file_write(SDL_RWops * context, const void *ptr, size_t size,
-                 size_t num)
-{
-
-    size_t total_bytes;
-    DWORD byte_written;
-    size_t nwritten;
-
-    total_bytes = size * num;
-
-    if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE
-        || total_bytes <= 0 || !size)
-        return 0;
-
-    if (context->hidden.windowsio.buffer.left) {
-        SetFilePointer(context->hidden.windowsio.h,
-                       -(LONG)context->hidden.windowsio.buffer.left, NULL,
-                       FILE_CURRENT);
-        context->hidden.windowsio.buffer.left = 0;
-    }
-
-    /* if in append mode, we must go to the EOF before write */
-    if (context->hidden.windowsio.append) {
-        if (SetFilePointer(context->hidden.windowsio.h, 0L, NULL, FILE_END) ==
-            INVALID_SET_FILE_POINTER) {
-            SDL_Error(SDL_EFWRITE);
-            return 0;
-        }
-    }
-
-    if (!WriteFile
-        (context->hidden.windowsio.h, ptr, (DWORD)total_bytes, &byte_written, NULL)) {
-        SDL_Error(SDL_EFWRITE);
-        return 0;
-    }
-
-    nwritten = byte_written / size;
-    return nwritten;
-}
-
-static int SDLCALL
-windows_file_close(SDL_RWops * context)
-{
-
-    if (context) {
-        if (context->hidden.windowsio.h != INVALID_HANDLE_VALUE) {
-            CloseHandle(context->hidden.windowsio.h);
-            context->hidden.windowsio.h = INVALID_HANDLE_VALUE;   /* to be sure */
-        }
-        SDL_free(context->hidden.windowsio.buffer.data);
-        context->hidden.windowsio.buffer.data = NULL;
-        SDL_FreeRW(context);
-    }
-    return (0);
-}
-#endif /* __WIN32__ */
-
-#ifdef HAVE_STDIO_H
-
-/* Functions to read/write stdio file pointers */
-
-static Sint64 SDLCALL
-stdio_size(SDL_RWops * context)
-{
-    Sint64 pos, size;
-
-    pos = SDL_RWseek(context, 0, RW_SEEK_CUR);
-    if (pos < 0) {
-        return -1;
-    }
-    size = SDL_RWseek(context, 0, RW_SEEK_END);
-
-    SDL_RWseek(context, pos, RW_SEEK_SET);
-    return size;
-}
-
-static Sint64 SDLCALL
-stdio_seek(SDL_RWops * context, Sint64 offset, int whence)
-{
-#ifdef HAVE_FSEEKO64
-    if (fseeko64(context->hidden.stdio.fp, (off64_t)offset, whence) == 0) {
-        return ftello64(context->hidden.stdio.fp);
-    }
-#elif defined(HAVE_FSEEKO)
-    if (fseeko(context->hidden.stdio.fp, (off_t)offset, whence) == 0) {
-        return ftello(context->hidden.stdio.fp);
-    }
-#else
-    if (fseek(context->hidden.stdio.fp, offset, whence) == 0) {
-        return (ftell(context->hidden.stdio.fp));
-    }
-#endif
-    return SDL_Error(SDL_EFSEEK);
-}
-
-static size_t SDLCALL
-stdio_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
-{
-    size_t nread;
-
-    nread = fread(ptr, size, maxnum, context->hidden.stdio.fp);
-    if (nread == 0 && ferror(context->hidden.stdio.fp)) {
-        SDL_Error(SDL_EFREAD);
-    }
-    return (nread);
-}
-
-static size_t SDLCALL
-stdio_write(SDL_RWops * context, const void *ptr, size_t size, size_t num)
-{
-    size_t nwrote;
-
-    nwrote = fwrite(ptr, size, num, context->hidden.stdio.fp);
-    if (nwrote == 0 && ferror(context->hidden.stdio.fp)) {
-        SDL_Error(SDL_EFWRITE);
-    }
-    return (nwrote);
-}
-
-static int SDLCALL
-stdio_close(SDL_RWops * context)
-{
-    int status = 0;
-    if (context) {
-        if (context->hidden.stdio.autoclose) {
-            /* WARNING:  Check the return value here! */
-            if (fclose(context->hidden.stdio.fp) != 0) {
-                status = SDL_Error(SDL_EFWRITE);
-            }
-        }
-        SDL_FreeRW(context);
-    }
-    return status;
-}
-#endif /* !HAVE_STDIO_H */
-
-/* Functions to read/write memory pointers */
-
-static Sint64 SDLCALL
-mem_size(SDL_RWops * context)
-{
-    return (Sint64)(context->hidden.mem.stop - context->hidden.mem.base);
-}
-
-static Sint64 SDLCALL
-mem_seek(SDL_RWops * context, Sint64 offset, int whence)
-{
-    Uint8 *newpos;
-
-    switch (whence) {
-    case RW_SEEK_SET:
-        newpos = context->hidden.mem.base + offset;
-        break;
-    case RW_SEEK_CUR:
-        newpos = context->hidden.mem.here + offset;
-        break;
-    case RW_SEEK_END:
-        newpos = context->hidden.mem.stop + offset;
-        break;
-    default:
-        return SDL_SetError("Unknown value for 'whence'");
-    }
-    if (newpos < context->hidden.mem.base) {
-        newpos = context->hidden.mem.base;
-    }
-    if (newpos > context->hidden.mem.stop) {
-        newpos = context->hidden.mem.stop;
-    }
-    context->hidden.mem.here = newpos;
-    return (Sint64)(context->hidden.mem.here - context->hidden.mem.base);
-}
-
-static size_t SDLCALL
-mem_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
-{
-    size_t total_bytes;
-    size_t mem_available;
-
-    total_bytes = (maxnum * size);
-    if ((maxnum <= 0) || (size <= 0)
-        || ((total_bytes / maxnum) != (size_t) size)) {
-        return 0;
-    }
-
-    mem_available = (context->hidden.mem.stop - context->hidden.mem.here);
-    if (total_bytes > mem_available) {
-        total_bytes = mem_available;
-    }
-
-    SDL_memcpy(ptr, context->hidden.mem.here, total_bytes);
-    context->hidden.mem.here += total_bytes;
-
-    return (total_bytes / size);
-}
-
-static size_t SDLCALL
-mem_write(SDL_RWops * context, const void *ptr, size_t size, size_t num)
-{
-    if ((context->hidden.mem.here + (num * size)) > context->hidden.mem.stop) {
-        num = (context->hidden.mem.stop - context->hidden.mem.here) / size;
-    }
-    SDL_memcpy(context->hidden.mem.here, ptr, num * size);
-    context->hidden.mem.here += num * size;
-    return (num);
-}
-
-static size_t SDLCALL
-mem_writeconst(SDL_RWops * context, const void *ptr, size_t size, size_t num)
-{
-    SDL_SetError("Can't write to read-only memory");
-    return (0);
-}
-
-static int SDLCALL
-mem_close(SDL_RWops * context)
-{
-    if (context) {
-        SDL_FreeRW(context);
-    }
-    return (0);
-}
-
-
-/* Functions to create SDL_RWops structures from various data sources */
-
-SDL_RWops *
-SDL_RWFromFile(const char *file, const char *mode)
-{
-    SDL_RWops *rwops = NULL;
-    if (!file || !*file || !mode || !*mode) {
-        SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
-        return NULL;
-    }
-#if defined(ANDROID)
-#ifdef HAVE_STDIO_H
-    /* Try to open the file on the filesystem first */
-    if (*file == '/') {
-        FILE *fp = fopen(file, mode);
-        if (fp) {
-            return SDL_RWFromFP(fp, 1);
-        }
-    } else {
-        /* Try opening it from internal storage if it's a relative path */
-        char *path;
-        FILE *fp;
-
-        path = SDL_stack_alloc(char, PATH_MAX);
-        if (path) {
-            SDL_snprintf(path, PATH_MAX, "%s/%s",
-                         SDL_AndroidGetInternalStoragePath(), file);
-            fp = fopen(path, mode);
-            SDL_stack_free(path);
-            if (fp) {
-                return SDL_RWFromFP(fp, 1);
-            }
-        }
-    }
-#endif /* HAVE_STDIO_H */
-
-    /* Try to open the file from the asset system */
-    rwops = SDL_AllocRW();
-    if (!rwops)
-        return NULL;            /* SDL_SetError already setup by SDL_AllocRW() */
-    if (Android_JNI_FileOpen(rwops, file, mode) < 0) {
-        SDL_FreeRW(rwops);
-        return NULL;
-    }
-    rwops->size = Android_JNI_FileSize;
-    rwops->seek = Android_JNI_FileSeek;
-    rwops->read = Android_JNI_FileRead;
-    rwops->write = Android_JNI_FileWrite;
-    rwops->close = Android_JNI_FileClose;
-    rwops->type = SDL_RWOPS_JNIFILE;
-
-#elif defined(__WIN32__)
-    rwops = SDL_AllocRW();
-    if (!rwops)
-        return NULL;            /* SDL_SetError already setup by SDL_AllocRW() */
-    if (windows_file_open(rwops, file, mode) < 0) {
-        SDL_FreeRW(rwops);
-        return NULL;
-    }
-    rwops->size = windows_file_size;
-    rwops->seek = windows_file_seek;
-    rwops->read = windows_file_read;
-    rwops->write = windows_file_write;
-    rwops->close = windows_file_close;
-    rwops->type = SDL_RWOPS_WINFILE;
-
-#elif HAVE_STDIO_H
-    {
-        #ifdef __APPLE__
-        FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode);
-        #else
-        FILE *fp = fopen(file, mode);
-        #endif
-        if (fp == NULL) {
-            SDL_SetError("Couldn't open %s", file);
-        } else {
-            rwops = SDL_RWFromFP(fp, 1);
-        }
-    }
-#else
-    SDL_SetError("SDL not compiled with stdio support");
-#endif /* !HAVE_STDIO_H */
-
-    return (rwops);
-}
-
-#ifdef HAVE_STDIO_H
-SDL_RWops *
-SDL_RWFromFP(FILE * fp, SDL_bool autoclose)
-{
-    SDL_RWops *rwops = NULL;
-
-    rwops = SDL_AllocRW();
-    if (rwops != NULL) {
-        rwops->size = stdio_size;
-        rwops->seek = stdio_seek;
-        rwops->read = stdio_read;
-        rwops->write = stdio_write;
-        rwops->close = stdio_close;
-        rwops->hidden.stdio.fp = fp;
-        rwops->hidden.stdio.autoclose = autoclose;
-        rwops->type = SDL_RWOPS_STDFILE;
-    }
-    return (rwops);
-}
-#else
-SDL_RWops *
-SDL_RWFromFP(void * fp, SDL_bool autoclose)
-{
-    SDL_SetError("SDL not compiled with stdio support");
-    return NULL;
-}
-#endif /* HAVE_STDIO_H */
-
-SDL_RWops *
-SDL_RWFromMem(void *mem, int size)
-{
-    SDL_RWops *rwops = NULL;
-    if (!mem) {
-      SDL_InvalidParamError("mem");
-      return (rwops);
-    }
-    if (!size) {
-      SDL_InvalidParamError("size");
-      return (rwops);
-    }
-
-    rwops = SDL_AllocRW();
-    if (rwops != NULL) {
-        rwops->size = mem_size;
-        rwops->seek = mem_seek;
-        rwops->read = mem_read;
-        rwops->write = mem_write;
-        rwops->close = mem_close;
-        rwops->hidden.mem.base = (Uint8 *) mem;
-        rwops->hidden.mem.here = rwops->hidden.mem.base;
-        rwops->hidden.mem.stop = rwops->hidden.mem.base + size;
-        rwops->type = SDL_RWOPS_MEMORY;
-    }
-    return (rwops);
-}
-
-SDL_RWops *
-SDL_RWFromConstMem(const void *mem, int size)
-{
-    SDL_RWops *rwops = NULL;
-    if (!mem) {
-      SDL_InvalidParamError("mem");
-      return (rwops);
-    }
-    if (!size) {
-      SDL_InvalidParamError("size");
-      return (rwops);
-    }
-
-    rwops = SDL_AllocRW();
-    if (rwops != NULL) {
-        rwops->size = mem_size;
-        rwops->seek = mem_seek;
-        rwops->read = mem_read;
-        rwops->write = mem_writeconst;
-        rwops->close = mem_close;
-        rwops->hidden.mem.base = (Uint8 *) mem;
-        rwops->hidden.mem.here = rwops->hidden.mem.base;
-        rwops->hidden.mem.stop = rwops->hidden.mem.base + size;
-        rwops->type = SDL_RWOPS_MEMORY_RO;
-    }
-    return (rwops);
-}
-
-SDL_RWops *
-SDL_AllocRW(void)
-{
-    SDL_RWops *area;
-
-    area = (SDL_RWops *) SDL_malloc(sizeof *area);
-    if (area == NULL) {
-        SDL_OutOfMemory();
-    } else {
-        area->type = SDL_RWOPS_UNKNOWN;
-    }
-    return (area);
-}
-
-void
-SDL_FreeRW(SDL_RWops * area)
-{
-    SDL_free(area);
-}
-
-/* Functions for dynamically reading and writing endian-specific values */
-
-Uint8
-SDL_ReadU8(SDL_RWops * src)
-{
-    Uint8 value = 0;
-
-    SDL_RWread(src, &value, (sizeof value), 1);
-    return value;
-}
-
-Uint16
-SDL_ReadLE16(SDL_RWops * src)
-{
-    Uint16 value = 0;
-
-    SDL_RWread(src, &value, (sizeof value), 1);
-    return (SDL_SwapLE16(value));
-}
-
-Uint16
-SDL_ReadBE16(SDL_RWops * src)
-{
-    Uint16 value = 0;
-
-    SDL_RWread(src, &value, (sizeof value), 1);
-    return (SDL_SwapBE16(value));
-}
-
-Uint32
-SDL_ReadLE32(SDL_RWops * src)
-{
-    Uint32 value = 0;
-
-    SDL_RWread(src, &value, (sizeof value), 1);
-    return (SDL_SwapLE32(value));
-}
-
-Uint32
-SDL_ReadBE32(SDL_RWops * src)
-{
-    Uint32 value = 0;
-
-    SDL_RWread(src, &value, (sizeof value), 1);
-    return (SDL_SwapBE32(value));
-}
-
-Uint64
-SDL_ReadLE64(SDL_RWops * src)
-{
-    Uint64 value = 0;
-
-    SDL_RWread(src, &value, (sizeof value), 1);
-    return (SDL_SwapLE64(value));
-}
-
-Uint64
-SDL_ReadBE64(SDL_RWops * src)
-{
-    Uint64 value = 0;
-
-    SDL_RWread(src, &value, (sizeof value), 1);
-    return (SDL_SwapBE64(value));
-}
-
-size_t
-SDL_WriteU8(SDL_RWops * dst, Uint8 value)
-{
-    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-
-size_t
-SDL_WriteLE16(SDL_RWops * dst, Uint16 value)
-{
-    value = SDL_SwapLE16(value);
-    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-
-size_t
-SDL_WriteBE16(SDL_RWops * dst, Uint16 value)
-{
-    value = SDL_SwapBE16(value);
-    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-
-size_t
-SDL_WriteLE32(SDL_RWops * dst, Uint32 value)
-{
-    value = SDL_SwapLE32(value);
-    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-
-size_t
-SDL_WriteBE32(SDL_RWops * dst, Uint32 value)
-{
-    value = SDL_SwapBE32(value);
-    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-
-size_t
-SDL_WriteLE64(SDL_RWops * dst, Uint64 value)
-{
-    value = SDL_SwapLE64(value);
-    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-
-size_t
-SDL_WriteBE64(SDL_RWops * dst, Uint64 value)
-{
-    value = SDL_SwapBE64(value);
-    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.h b/deps/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.h
deleted file mode 100644
index 6929904..0000000
--- a/deps/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifdef __APPLE__
-
-#include <stdio.h>
-
-#ifndef SDL_rwopsbundlesupport_h
-#define SDL_rwopsbundlesupport_h
-FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode);
-#endif
-#endif
diff --git a/deps/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.m b/deps/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.m
deleted file mode 100644
index 8ec0220..0000000
--- a/deps/SDL2/src/file/cocoa/SDL_rwopsbundlesupport.m
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifdef __APPLE__
-#import <Foundation/Foundation.h>
-
-#include "SDL_rwopsbundlesupport.h"
-
-/* For proper OS X applications, the resources are contained inside the application bundle.
- So the strategy is to first check the application bundle for the file, then fallback to the current working directory.
- Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app.
- We might want to use bundle identifiers, e.g. org.libsdl.sdl to get the bundle for the framework,
- but we would somehow need to know what the bundle identifiers we need to search are.
- Also, note the bundle layouts are different for iPhone and Mac.
-*/
-FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode)
-{
-    FILE* fp = NULL;
-
-    /* If the file mode is writable, skip all the bundle stuff because generally the bundle is read-only. */
-    if(strcmp("r", mode) && strcmp("rb", mode))
-    {
-        return fopen(file, mode);
-    }
-
-    NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init];
-
-
-    NSFileManager* file_manager = [NSFileManager defaultManager];
-    NSString* resource_path = [[NSBundle mainBundle] resourcePath];
-
-    NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)];
-
-    NSString* full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component];
-    if([file_manager fileExistsAtPath:full_path_with_file_to_try])
-    {
-        fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode);
-    }
-    else
-    {
-        fp = fopen(file, mode);
-    }
-
-    [autorelease_pool drain];
-
-    return fp;
-}
-#endif
diff --git a/deps/SDL2/src/filesystem/beos/SDL_sysfilesystem.cc b/deps/SDL2/src/filesystem/beos/SDL_sysfilesystem.cc
deleted file mode 100644
index dc7a970..0000000
--- a/deps/SDL2/src/filesystem/beos/SDL_sysfilesystem.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_FILESYSTEM_BEOS
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent filesystem routines                                */
-
-#include <os/kernel/image.h>
-#include <os/storage/Directory.h>
-#include <os/storage/Entry.h>
-#include <os/storage/Path.h>
-
-#include "SDL_error.h"
-#include "SDL_stdinc.h"
-#include "SDL_assert.h"
-#include "SDL_filesystem.h"
-
-char *
-SDL_GetBasePath(void)
-{
-    image_info info;
-    int32 cookie = 0;
-
-    while (get_next_image_info(0, &cookie, &info) == B_OK) {
-        if (info.type == B_APP_IMAGE) {
-            break;
-        }
-    }
-
-    BEntry entry(info.name, true);
-    BPath path;
-    status_t rc = entry.GetPath(&path);  /* (path) now has binary's path. */
-    SDL_assert(rc == B_OK);
-    rc = path.GetParent(&path); /* chop filename, keep directory. */
-    SDL_assert(rc == B_OK);
-    const char *str = path.Path();
-    SDL_assert(str != NULL);
-
-    const size_t len = SDL_strlen(str);
-    char *retval = (char *) SDL_malloc(len + 2);
-    if (!retval) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    SDL_memcpy(retval, str, len);
-    retval[len] = '/';
-    retval[len+1] = '\0';
-    return retval;
-}
-
-
-char *
-SDL_GetPrefPath(const char *org, const char *app)
-{
-    // !!! FIXME: is there a better way to do this?
-    const char *home = SDL_getenv("HOME");
-    const char *append = "config/settings/";
-    const size_t len = SDL_strlen(home) + SDL_strlen(append) + SDL_strlen(org) + SDL_strlen(app) + 3;
-    char *retval = (char *) SDL_malloc(len);
-    if (!retval) {
-        SDL_OutOfMemory();
-    } else {
-        SDL_snprintf(retval, len, "%s%s%s/%s/", home, append, org, app);
-        create_directory(retval, 0700);  // BeOS api: creates missing dirs
-    }
-
-    return retval;
-}
-
-#endif /* SDL_FILESYSTEM_BEOS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/filesystem/cocoa/SDL_sysfilesystem.m b/deps/SDL2/src/filesystem/cocoa/SDL_sysfilesystem.m
deleted file mode 100644
index 760830a..0000000
--- a/deps/SDL2/src/filesystem/cocoa/SDL_sysfilesystem.m
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_FILESYSTEM_COCOA
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent filesystem routines                                */
-
-#include <Foundation/Foundation.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include "SDL_error.h"
-#include "SDL_stdinc.h"
-#include "SDL_filesystem.h"
-
-char *
-SDL_GetBasePath(void)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSBundle *bundle = [NSBundle mainBundle];
-    const char* baseType = [[[bundle infoDictionary] objectForKey:@"SDL_FILESYSTEM_BASE_DIR_TYPE"] UTF8String];
-    const char *base = NULL;
-    char *retval = NULL;
-    if (baseType == NULL) {
-        baseType = "resource";
-    }
-    if (SDL_strcasecmp(baseType, "bundle")==0) {
-        base = [[bundle bundlePath] fileSystemRepresentation];
-    } else if (SDL_strcasecmp(baseType, "parent")==0) {
-        base = [[[bundle bundlePath] stringByDeletingLastPathComponent] fileSystemRepresentation];
-    } else {
-        /* this returns the exedir for non-bundled  and the resourceDir for bundled apps */
-        base = [[bundle resourcePath] fileSystemRepresentation];
-    }
-    if (base) {
-        const size_t len = SDL_strlen(base) + 2;
-        retval = (char *) SDL_malloc(len);
-        if (retval == NULL) {
-            SDL_OutOfMemory();
-        } else {
-            SDL_snprintf(retval, len, "%s/", base);
-        }
-    }
-
-    [pool release];
-    return retval;
-}
-
-char *
-SDL_GetPrefPath(const char *org, const char *app)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSArray *array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
-    char *retval = NULL;
-
-    if ([array count] > 0) {  /* we only want the first item in the list. */
-        NSString *str = [array objectAtIndex:0];
-        const char *base = [str fileSystemRepresentation];
-        if (base) {
-            const size_t len = SDL_strlen(base) + SDL_strlen(app) + 4;
-            retval = (char *) SDL_malloc(len);
-            if (retval == NULL) {
-                SDL_OutOfMemory();
-            } else {
-                char *ptr;
-                SDL_snprintf(retval, len, "%s/%s/%s/", base, org, app);
-                for (ptr = retval+1; *ptr; ptr++) {
-                    if (*ptr == '/') {
-                        *ptr = '\0';
-                        mkdir(retval, 0700);
-                        *ptr = '/';
-                    }
-                }
-                mkdir(retval, 0700);
-            }
-        }
-    }
-
-    [pool release];
-    return retval;
-}
-
-#endif /* SDL_FILESYSTEM_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/filesystem/dummy/SDL_sysfilesystem.c b/deps/SDL2/src/filesystem/dummy/SDL_sysfilesystem.c
deleted file mode 100644
index a6bd577..0000000
--- a/deps/SDL2/src/filesystem/dummy/SDL_sysfilesystem.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_FILESYSTEM_DUMMY
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent filesystem routines                                */
-
-#include "SDL_error.h"
-#include "SDL_filesystem.h"
-
-char *
-SDL_GetBasePath(void)
-{
-    SDL_Unsupported();
-    return NULL;
-}
-
-char *
-SDL_GetPrefPath(const char *org, const char *app)
-{
-    SDL_Unsupported();
-    return NULL;
-}
-
-#endif /* SDL_FILESYSTEM_DUMMY */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/filesystem/unix/SDL_sysfilesystem.c b/deps/SDL2/src/filesystem/unix/SDL_sysfilesystem.c
deleted file mode 100644
index 0f6e62e..0000000
--- a/deps/SDL2/src/filesystem/unix/SDL_sysfilesystem.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_FILESYSTEM_UNIX
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent filesystem routines                                */
-
-#include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <limits.h>
-
-#ifdef __FREEBSD__
-#include <sys/sysctl.h>
-#endif
-
-#include "SDL_error.h"
-#include "SDL_stdinc.h"
-#include "SDL_filesystem.h"
-
-static char *
-readSymLink(const char *path)
-{
-    char *retval = NULL;
-    ssize_t len = 64;
-    ssize_t rc = -1;
-
-    while (1)
-    {
-        char *ptr = (char *) SDL_realloc(retval, (size_t) len);
-        if (ptr == NULL) {
-            SDL_OutOfMemory();
-            break;
-        }
-
-        retval = ptr;
-
-        rc = readlink(path, retval, len);
-        if (rc == -1) {
-            break;  /* not a symlink, i/o error, etc. */
-        } else if (rc < len) {
-            retval[rc] = '\0';  /* readlink doesn't null-terminate. */
-            return retval;  /* we're good to go. */
-        }
-
-        len *= 2;  /* grow buffer, try again. */
-    }
-
-    SDL_free(retval);
-    return NULL;
-}
-
-
-char *
-SDL_GetBasePath(void)
-{
-    char *retval = NULL;
-
-#if defined(__FREEBSD__)
-    char fullpath[PATH_MAX];
-    size_t buflen = sizeof (fullpath);
-    const int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
-    if (sysctl(mib, SDL_arraysize(mib), fullpath, &buflen, NULL, 0) != -1) {
-        retval = SDL_strdup(fullpath);
-        if (!retval) {
-            SDL_OutOfMemory();
-            return NULL;
-        }
-    }
-#elif defined(__SOLARIS__)
-    const char *path = getexecname();
-    if ((path != NULL) && (path[0] == '/')) { /* must be absolute path... */
-        retval = SDL_strdup(path);
-        if (!retval) {
-            SDL_OutOfMemory();
-            return NULL;
-        }
-    }
-#endif
-
-    /* is a Linux-style /proc filesystem available? */
-    if (!retval && (access("/proc", F_OK) == 0)) {
-#if defined(__FREEBSD__)
-        retval = readSymLink("/proc/curproc/file");
-#elif defined(__NETBSD__)
-        retval = readSymLink("/proc/curproc/exe");
-#else
-        retval = readSymLink("/proc/self/exe");  /* linux. */
-#endif
-        if (retval == NULL) {
-            /* older kernels don't have /proc/self ... try PID version... */
-            char path[64];
-            const int rc = (int) SDL_snprintf(path, sizeof(path),
-                                              "/proc/%llu/exe",
-                                              (unsigned long long) getpid());
-            if ( (rc > 0) && (rc < sizeof(path)) ) {
-                retval = readSymLink(path);
-            }
-        }
-    }
-
-    /* If we had access to argv[0] here, we could check it for a path,
-        or troll through $PATH looking for it, too. */
-
-    if (retval != NULL) { /* chop off filename. */
-        char *ptr = SDL_strrchr(retval, '/');
-        if (ptr != NULL) {
-            *(ptr+1) = '\0';
-        } else {  /* shouldn't happen, but just in case... */
-            SDL_free(retval);
-            retval = NULL;
-        }
-    }
-
-    if (retval != NULL) {
-        /* try to shrink buffer... */
-        char *ptr = (char *) SDL_realloc(retval, strlen(retval) + 1);
-        if (ptr != NULL)
-            retval = ptr;  /* oh well if it failed. */
-    }
-
-    return retval;
-}
-
-char *
-SDL_GetPrefPath(const char *org, const char *app)
-{
-    /*
-     * We use XDG's base directory spec, even if you're not on Linux.
-     *  This isn't strictly correct, but the results are relatively sane
-     *  in any case.
-     *
-     * http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
-     */
-    const char *envr = SDL_getenv("XDG_DATA_HOME");
-    const char *append;
-    char *retval = NULL;
-    char *ptr = NULL;
-    size_t len = 0;
-
-    if (!envr) {
-        /* You end up with "$HOME/.local/share/Game Name 2" */
-        envr = SDL_getenv("HOME");
-        if (!envr) {
-            /* we could take heroic measures with /etc/passwd, but oh well. */
-            SDL_SetError("neither XDG_DATA_HOME nor HOME environment is set");
-            return NULL;
-        }
-        append = "/.local/share/";
-    } else {
-        append = "/";
-    }
-
-    len = SDL_strlen(envr);
-    if (envr[len - 1] == '/')
-        append += 1;
-
-    len += SDL_strlen(append) + SDL_strlen(org) + SDL_strlen(app) + 3;
-    retval = (char *) SDL_malloc(len);
-    if (!retval) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    SDL_snprintf(retval, len, "%s%s%s/%s/", envr, append, org, app);
-
-    for (ptr = retval+1; *ptr; ptr++) {
-        if (*ptr == '/') {
-            *ptr = '\0';
-            if (mkdir(retval, 0700) != 0 && errno != EEXIST)
-                goto error;
-            *ptr = '/';
-        }
-    }
-    if (mkdir(retval, 0700) != 0 && errno != EEXIST) {
-error:
-        SDL_SetError("Couldn't create directory '%s': ", retval, strerror(errno));
-        SDL_free(retval);
-        return NULL;
-    }
-
-    return retval;
-}
-
-#endif /* SDL_FILESYSTEM_UNIX */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/filesystem/windows/SDL_sysfilesystem.c b/deps/SDL2/src/filesystem/windows/SDL_sysfilesystem.c
deleted file mode 100644
index 7b101ff..0000000
--- a/deps/SDL2/src/filesystem/windows/SDL_sysfilesystem.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_FILESYSTEM_WINDOWS
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent filesystem routines                                */
-
-#include "../../core/windows/SDL_windows.h"
-#include <shlobj.h>
-
-#include "SDL_assert.h"
-#include "SDL_error.h"
-#include "SDL_stdinc.h"
-#include "SDL_filesystem.h"
-
-char *
-SDL_GetBasePath(void)
-{
-    TCHAR path[MAX_PATH];
-    const DWORD len = GetModuleFileName(NULL, path, SDL_arraysize(path));
-    size_t i;
-
-    SDL_assert(len < SDL_arraysize(path));
-
-    if (len == 0) {
-        WIN_SetError("Couldn't locate our .exe");
-        return NULL;
-    }
-
-    for (i = len-1; i > 0; i--) {
-        if (path[i] == '\\') {
-            break;
-        }
-    }
-
-    SDL_assert(i > 0); /* Should have been an absolute path. */
-    path[i+1] = '\0';  /* chop off filename. */
-    return WIN_StringToUTF8(path);
-}
-
-char *
-SDL_GetPrefPath(const char *org, const char *app)
-{
-    /*
-     * Vista and later has a new API for this, but SHGetFolderPath works there,
-     *  and apparently just wraps the new API. This is the new way to do it:
-     *
-     *     SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_CREATE,
-     *                          NULL, &wszPath);
-     */
-
-    TCHAR path[MAX_PATH];
-    char *utf8 = NULL;
-    char *retval = NULL;
-
-    if (!SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, path))) {
-        WIN_SetError("Couldn't locate our prefpath");
-        return NULL;
-    }
-
-    utf8 = WIN_StringToUTF8(path);
-    if (utf8) {
-        const size_t len = SDL_strlen(utf8) + SDL_strlen(org) + SDL_strlen(app) + 4;
-        retval = (char *) SDL_malloc(len);
-        if (!retval) {
-            SDL_free(utf8);
-            SDL_OutOfMemory();
-            return NULL;
-        }
-        SDL_snprintf(retval, len, "%s\\%s\\%s\\", utf8, org, app);
-        SDL_free(utf8);
-    }
-
-    return retval;
-}
-
-#endif /* SDL_FILESYSTEM_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/haptic/SDL_haptic.c b/deps/SDL2/src/haptic/SDL_haptic.c
deleted file mode 100644
index 33dd427..0000000
--- a/deps/SDL2/src/haptic/SDL_haptic.c
+++ /dev/null
@@ -1,838 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_syshaptic.h"
-#include "SDL_haptic_c.h"
-#include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */
-#include "SDL_assert.h"
-
-Uint8 SDL_numhaptics = 0;
-SDL_Haptic **SDL_haptics = NULL;
-
-
-/*
- * Initializes the Haptic devices.
- */
-int
-SDL_HapticInit(void)
-{
-    int arraylen;
-    int status;
-
-    SDL_numhaptics = 0;
-    status = SDL_SYS_HapticInit();
-    if (status >= 0) {
-        arraylen = (status + 1) * sizeof(*SDL_haptics);
-        SDL_haptics = (SDL_Haptic **) SDL_malloc(arraylen);
-        if (SDL_haptics == NULL) {      /* Out of memory. */
-            SDL_numhaptics = 0;
-        } else {
-            SDL_memset(SDL_haptics, 0, arraylen);
-            SDL_numhaptics = status;
-        }
-        status = 0;
-    }
-
-    return status;
-}
-
-
-/*
- * Checks to see if the haptic device is valid
- */
-static int
-ValidHaptic(SDL_Haptic * haptic)
-{
-    int i;
-    int valid;
-
-    valid = 0;
-    if (haptic != NULL) {
-        for (i = 0; i < SDL_numhaptics; i++) {
-            if (SDL_haptics[i] == haptic) {
-                valid = 1;
-                break;
-            }
-        }
-    }
-
-    /* Create the error here. */
-    if (valid == 0) {
-        SDL_SetError("Haptic: Invalid haptic device identifier");
-    }
-
-    return valid;
-}
-
-
-/*
- * Returns the number of available devices.
- */
-int
-SDL_NumHaptics(void)
-{
-    return SDL_numhaptics;
-}
-
-
-/*
- * Gets the name of a Haptic device by index.
- */
-const char *
-SDL_HapticName(int device_index)
-{
-    if ((device_index < 0) || (device_index >= SDL_numhaptics)) {
-        SDL_SetError("Haptic: There are %d haptic devices available",
-                     SDL_numhaptics);
-        return NULL;
-    }
-    return SDL_SYS_HapticName(device_index);
-}
-
-
-/*
- * Opens a Haptic device.
- */
-SDL_Haptic *
-SDL_HapticOpen(int device_index)
-{
-    int i;
-    SDL_Haptic *haptic;
-
-    if ((device_index < 0) || (device_index >= SDL_numhaptics)) {
-        SDL_SetError("Haptic: There are %d haptic devices available",
-                     SDL_numhaptics);
-        return NULL;
-    }
-
-    /* If the haptic is already open, return it */
-    for (i = 0; SDL_haptics[i]; i++) {
-        if (device_index == SDL_haptics[i]->index) {
-            haptic = SDL_haptics[i];
-            ++haptic->ref_count;
-            return haptic;
-        }
-    }
-
-    /* Create the haptic device */
-    haptic = (SDL_Haptic *) SDL_malloc((sizeof *haptic));
-    if (haptic == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    /* Initialize the haptic device */
-    SDL_memset(haptic, 0, (sizeof *haptic));
-    haptic->rumble_id = -1;
-    haptic->index = device_index;
-    if (SDL_SYS_HapticOpen(haptic) < 0) {
-        SDL_free(haptic);
-        return NULL;
-    }
-
-    /* Add haptic to list */
-    for (i = 0; SDL_haptics[i]; i++)
-        /* Skip to next haptic */ ;
-    if (i >= SDL_numhaptics) {
-        SDL_free(haptic);
-        SDL_SetError("Haptic: Trying to add device past the number originally detected");
-        return NULL;
-    }
-    SDL_haptics[i] = haptic;
-    ++haptic->ref_count;
-
-    /* Disable autocenter and set gain to max. */
-    if (haptic->supported & SDL_HAPTIC_GAIN)
-        SDL_HapticSetGain(haptic, 100);
-    if (haptic->supported & SDL_HAPTIC_AUTOCENTER)
-        SDL_HapticSetAutocenter(haptic, 0);
-
-    return haptic;
-}
-
-
-/*
- * Returns 1 if the device has been opened.
- */
-int
-SDL_HapticOpened(int device_index)
-{
-    int i, opened;
-
-    /* Make sure it's valid. */
-    if ((device_index < 0) || (device_index >= SDL_numhaptics)) {
-        SDL_SetError("Haptic: There are %d haptic devices available",
-                     SDL_numhaptics);
-        return 0;
-    }
-
-    opened = 0;
-    for (i = 0; SDL_haptics[i]; i++) {
-        if (SDL_haptics[i]->index == (Uint8) device_index) {
-            opened = 1;
-            break;
-        }
-    }
-    return opened;
-}
-
-
-/*
- * Returns the index to a haptic device.
- */
-int
-SDL_HapticIndex(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    return haptic->index;
-}
-
-
-/*
- * Returns SDL_TRUE if mouse is haptic, SDL_FALSE if it isn't.
- */
-int
-SDL_MouseIsHaptic(void)
-{
-    if (SDL_SYS_HapticMouse() < 0)
-        return SDL_FALSE;
-    return SDL_TRUE;
-}
-
-
-/*
- * Returns the haptic device if mouse is haptic or NULL elsewise.
- */
-SDL_Haptic *
-SDL_HapticOpenFromMouse(void)
-{
-    int device_index;
-
-    device_index = SDL_SYS_HapticMouse();
-
-    if (device_index < 0) {
-        SDL_SetError("Haptic: Mouse isn't a haptic device.");
-        return NULL;
-    }
-
-    return SDL_HapticOpen(device_index);
-}
-
-
-/*
- * Returns SDL_TRUE if joystick has haptic features.
- */
-int
-SDL_JoystickIsHaptic(SDL_Joystick * joystick)
-{
-    int ret;
-
-    /* Must be a valid joystick */
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return -1;
-    }
-
-    ret = SDL_SYS_JoystickIsHaptic(joystick);
-
-    if (ret > 0)
-        return SDL_TRUE;
-    else if (ret == 0)
-        return SDL_FALSE;
-    else
-        return -1;
-}
-
-
-/*
- * Opens a haptic device from a joystick.
- */
-SDL_Haptic *
-SDL_HapticOpenFromJoystick(SDL_Joystick * joystick)
-{
-    int i;
-    SDL_Haptic *haptic;
-
-    /* Make sure there is room. */
-    if (SDL_numhaptics <= 0) {
-        SDL_SetError("Haptic: There are %d haptic devices available",
-                     SDL_numhaptics);
-        return NULL;
-    }
-
-    /* Must be a valid joystick */
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        SDL_SetError("Haptic: Joystick isn't valid.");
-        return NULL;
-    }
-
-    /* Joystick must be haptic */
-    if (SDL_SYS_JoystickIsHaptic(joystick) <= 0) {
-        SDL_SetError("Haptic: Joystick isn't a haptic device.");
-        return NULL;
-    }
-
-    /* Check to see if joystick's haptic is already open */
-    for (i = 0; SDL_haptics[i]; i++) {
-        if (SDL_SYS_JoystickSameHaptic(SDL_haptics[i], joystick)) {
-            haptic = SDL_haptics[i];
-            ++haptic->ref_count;
-            return haptic;
-        }
-    }
-
-    /* Create the haptic device */
-    haptic = (SDL_Haptic *) SDL_malloc((sizeof *haptic));
-    if (haptic == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    /* Initialize the haptic device */
-    SDL_memset(haptic, 0, sizeof(SDL_Haptic));
-    haptic->rumble_id = -1;
-    if (SDL_SYS_HapticOpenFromJoystick(haptic, joystick) < 0) {
-        SDL_free(haptic);
-        return NULL;
-    }
-
-    /* Add haptic to list */
-    for (i = 0; SDL_haptics[i]; i++)
-        /* Skip to next haptic */ ;
-    if (i >= SDL_numhaptics) {
-        SDL_free(haptic);
-        SDL_SetError("Haptic: Trying to add device past the number originally detected");
-        return NULL;
-    }
-    SDL_haptics[i] = haptic;
-    ++haptic->ref_count;
-
-    return haptic;
-}
-
-
-/*
- * Closes a SDL_Haptic device.
- */
-void
-SDL_HapticClose(SDL_Haptic * haptic)
-{
-    int i;
-
-    /* Must be valid */
-    if (!ValidHaptic(haptic)) {
-        return;
-    }
-
-    /* Check if it's still in use */
-    if (--haptic->ref_count < 0) {
-        return;
-    }
-
-    /* Close it, properly removing effects if needed */
-    for (i = 0; i < haptic->neffects; i++) {
-        if (haptic->effects[i].hweffect != NULL) {
-            SDL_HapticDestroyEffect(haptic, i);
-        }
-    }
-    SDL_SYS_HapticClose(haptic);
-
-    /* Remove from the list */
-    for (i = 0; SDL_haptics[i]; ++i) {
-        if (haptic == SDL_haptics[i]) {
-            SDL_haptics[i] = NULL;
-            SDL_memcpy(&SDL_haptics[i], &SDL_haptics[i + 1],
-                       (SDL_numhaptics - i) * sizeof(haptic));
-            break;
-        }
-    }
-
-    /* Free */
-    SDL_free(haptic);
-}
-
-/*
- * Cleans up after the subsystem.
- */
-void
-SDL_HapticQuit(void)
-{
-    SDL_SYS_HapticQuit();
-    SDL_free(SDL_haptics);
-    SDL_haptics = NULL;
-    SDL_numhaptics = 0;
-}
-
-/*
- * Returns the number of effects a haptic device has.
- */
-int
-SDL_HapticNumEffects(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    return haptic->neffects;
-}
-
-
-/*
- * Returns the number of effects a haptic device can play.
- */
-int
-SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    return haptic->nplaying;
-}
-
-
-/*
- * Returns supported effects by the device.
- */
-unsigned int
-SDL_HapticQuery(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return 0; /* same as if no effects were supported */
-    }
-
-    return haptic->supported;
-}
-
-
-/*
- * Returns the number of axis on the device.
- */
-int
-SDL_HapticNumAxes(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    return haptic->naxes;
-}
-
-/*
- * Checks to see if the device can support the effect.
- */
-int
-SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    if ((haptic->supported & effect->type) != 0)
-        return SDL_TRUE;
-    return SDL_FALSE;
-}
-
-/*
- * Creates a new haptic effect.
- */
-int
-SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect)
-{
-    int i;
-
-    /* Check for device validity. */
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    /* Check to see if effect is supported */
-    if (SDL_HapticEffectSupported(haptic, effect) == SDL_FALSE) {
-        return SDL_SetError("Haptic: Effect not supported by haptic device.");
-    }
-
-    /* See if there's a free slot */
-    for (i = 0; i < haptic->neffects; i++) {
-        if (haptic->effects[i].hweffect == NULL) {
-
-            /* Now let the backend create the real effect */
-            if (SDL_SYS_HapticNewEffect(haptic, &haptic->effects[i], effect)
-                != 0) {
-                return -1;      /* Backend failed to create effect */
-            }
-
-            SDL_memcpy(&haptic->effects[i].effect, effect,
-                       sizeof(SDL_HapticEffect));
-            return i;
-        }
-    }
-
-    return SDL_SetError("Haptic: Device has no free space left.");
-}
-
-/*
- * Checks to see if an effect is valid.
- */
-static int
-ValidEffect(SDL_Haptic * haptic, int effect)
-{
-    if ((effect < 0) || (effect >= haptic->neffects)) {
-        SDL_SetError("Haptic: Invalid effect identifier.");
-        return 0;
-    }
-    return 1;
-}
-
-/*
- * Updates an effect.
- */
-int
-SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect,
-                       SDL_HapticEffect * data)
-{
-    if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) {
-        return -1;
-    }
-
-    /* Can't change type dynamically. */
-    if (data->type != haptic->effects[effect].effect.type) {
-        return SDL_SetError("Haptic: Updating effect type is illegal.");
-    }
-
-    /* Updates the effect */
-    if (SDL_SYS_HapticUpdateEffect(haptic, &haptic->effects[effect], data) <
-        0) {
-        return -1;
-    }
-
-    SDL_memcpy(&haptic->effects[effect].effect, data,
-               sizeof(SDL_HapticEffect));
-    return 0;
-}
-
-
-/*
- * Runs the haptic effect on the device.
- */
-int
-SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, Uint32 iterations)
-{
-    if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) {
-        return -1;
-    }
-
-    /* Run the effect */
-    if (SDL_SYS_HapticRunEffect(haptic, &haptic->effects[effect], iterations)
-        < 0) {
-        return -1;
-    }
-
-    return 0;
-}
-
-/*
- * Stops the haptic effect on the device.
- */
-int
-SDL_HapticStopEffect(SDL_Haptic * haptic, int effect)
-{
-    if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) {
-        return -1;
-    }
-
-    /* Stop the effect */
-    if (SDL_SYS_HapticStopEffect(haptic, &haptic->effects[effect]) < 0) {
-        return -1;
-    }
-
-    return 0;
-}
-
-/*
- * Gets rid of a haptic effect.
- */
-void
-SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect)
-{
-    if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) {
-        return;
-    }
-
-    /* Not allocated */
-    if (haptic->effects[effect].hweffect == NULL) {
-        return;
-    }
-
-    SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]);
-}
-
-/*
- * Gets the status of a haptic effect.
- */
-int
-SDL_HapticGetEffectStatus(SDL_Haptic * haptic, int effect)
-{
-    if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) {
-        return -1;
-    }
-
-    if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) {
-        return SDL_SetError("Haptic: Device does not support status queries.");
-    }
-
-    return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]);
-}
-
-/*
- * Sets the global gain of the device.
- */
-int
-SDL_HapticSetGain(SDL_Haptic * haptic, int gain)
-{
-    const char *env;
-    int real_gain, max_gain;
-
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    if ((haptic->supported & SDL_HAPTIC_GAIN) == 0) {
-        return SDL_SetError("Haptic: Device does not support setting gain.");
-    }
-
-    if ((gain < 0) || (gain > 100)) {
-        return SDL_SetError("Haptic: Gain must be between 0 and 100.");
-    }
-
-    /* We use the envvar to get the maximum gain. */
-    env = SDL_getenv("SDL_HAPTIC_GAIN_MAX");
-    if (env != NULL) {
-        max_gain = SDL_atoi(env);
-
-        /* Check for sanity. */
-        if (max_gain < 0)
-            max_gain = 0;
-        else if (max_gain > 100)
-            max_gain = 100;
-
-        /* We'll scale it linearly with SDL_HAPTIC_GAIN_MAX */
-        real_gain = (gain * max_gain) / 100;
-    } else {
-        real_gain = gain;
-    }
-
-    if (SDL_SYS_HapticSetGain(haptic, real_gain) < 0) {
-        return -1;
-    }
-
-    return 0;
-}
-
-/*
- * Makes the device autocenter, 0 disables.
- */
-int
-SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    if ((haptic->supported & SDL_HAPTIC_AUTOCENTER) == 0) {
-        return SDL_SetError("Haptic: Device does not support setting autocenter.");
-    }
-
-    if ((autocenter < 0) || (autocenter > 100)) {
-        return SDL_SetError("Haptic: Autocenter must be between 0 and 100.");
-    }
-
-    if (SDL_SYS_HapticSetAutocenter(haptic, autocenter) < 0) {
-        return -1;
-    }
-
-    return 0;
-}
-
-/*
- * Pauses the haptic device.
- */
-int
-SDL_HapticPause(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) {
-        return SDL_SetError("Haptic: Device does not support setting pausing.");
-    }
-
-    return SDL_SYS_HapticPause(haptic);
-}
-
-/*
- * Unpauses the haptic device.
- */
-int
-SDL_HapticUnpause(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) {
-        return 0;               /* Not going to be paused, so we pretend it's unpaused. */
-    }
-
-    return SDL_SYS_HapticUnpause(haptic);
-}
-
-/*
- * Stops all the currently playing effects.
- */
-int
-SDL_HapticStopAll(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    return SDL_SYS_HapticStopAll(haptic);
-}
-
-/*
- * Checks to see if rumble is supported.
- */
-int
-SDL_HapticRumbleSupported(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    /* Most things can use SINE, but XInput only has LEFTRIGHT. */
-    return ((haptic->supported & (SDL_HAPTIC_SINE|SDL_HAPTIC_LEFTRIGHT)) != 0);
-}
-
-/*
- * Initializes the haptic device for simple rumble playback.
- */
-int
-SDL_HapticRumbleInit(SDL_Haptic * haptic)
-{
-    SDL_HapticEffect *efx = &haptic->rumble_effect;
-
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    /* Already allocated. */
-    if (haptic->rumble_id >= 0) {
-        return 0;
-    }
-
-    SDL_zerop(efx);
-    if (haptic->supported & SDL_HAPTIC_SINE) {
-        efx->type = SDL_HAPTIC_SINE;
-        efx->periodic.period = 1000;
-        efx->periodic.magnitude = 0x4000;
-        efx->periodic.length = 5000;
-        efx->periodic.attack_length = 0;
-        efx->periodic.fade_length = 0;
-    } else if (haptic->supported & SDL_HAPTIC_LEFTRIGHT) {  /* XInput? */
-        efx->type = SDL_HAPTIC_LEFTRIGHT;
-        efx->leftright.length = 5000;
-        efx->leftright.large_magnitude = 0x4000;
-        efx->leftright.small_magnitude = 0x4000;
-    } else {
-        return SDL_SetError("Device doesn't support rumble");
-    }
-
-    haptic->rumble_id = SDL_HapticNewEffect(haptic, &haptic->rumble_effect);
-    if (haptic->rumble_id >= 0) {
-        return 0;
-    }
-    return -1;
-}
-
-/*
- * Runs simple rumble on a haptic device
- */
-int
-SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
-{
-    SDL_HapticEffect *efx;
-    Sint16 magnitude;
-
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    if (haptic->rumble_id < 0) {
-        return SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
-    }
-
-    /* Clamp strength. */
-    if (strength > 1.0f) {
-        strength = 1.0f;
-    } else if (strength < 0.0f) {
-        strength = 0.0f;
-    }
-    magnitude = (Sint16)(32767.0f*strength);
-
-    efx = &haptic->rumble_effect;
-    if (efx->type == SDL_HAPTIC_SINE) {
-        efx->periodic.magnitude = magnitude;
-        efx->periodic.length = length;
-    } else if (efx->type == SDL_HAPTIC_LEFTRIGHT) {
-        efx->leftright.small_magnitude = efx->leftright.large_magnitude = magnitude;
-        efx->leftright.length = length;
-    } else {
-        SDL_assert(0 && "This should have been caught elsewhere");
-    }
-
-    if (SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect) < 0) {
-        return -1;
-    }
-
-    return SDL_HapticRunEffect(haptic, haptic->rumble_id, 1);
-}
-
-/*
- * Stops the simple rumble on a haptic device.
- */
-int
-SDL_HapticRumbleStop(SDL_Haptic * haptic)
-{
-    if (!ValidHaptic(haptic)) {
-        return -1;
-    }
-
-    if (haptic->rumble_id < 0) {
-        return SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
-    }
-
-    return SDL_HapticStopEffect(haptic, haptic->rumble_id);
-}
-
diff --git a/deps/SDL2/src/haptic/SDL_haptic_c.h b/deps/SDL2/src/haptic/SDL_haptic_c.h
deleted file mode 100644
index 678a08f..0000000
--- a/deps/SDL2/src/haptic/SDL_haptic_c.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-extern int SDL_HapticInit(void);
-extern void SDL_HapticQuit(void);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/haptic/SDL_syshaptic.h b/deps/SDL2/src/haptic/SDL_syshaptic.h
deleted file mode 100644
index ac5198f..0000000
--- a/deps/SDL2/src/haptic/SDL_syshaptic.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#include "SDL_haptic.h"
-
-
-/*
- * Number of haptic devices on the system.
- */
-extern Uint8 SDL_numhaptics;
-
-
-struct haptic_effect
-{
-    SDL_HapticEffect effect;    /* The current event */
-    struct haptic_hweffect *hweffect;   /* The hardware behind the event */
-};
-
-/*
- * The real SDL_Haptic struct.
- */
-struct _SDL_Haptic
-{
-    Uint8 index;                /* Stores index it is attached to */
-
-    struct haptic_effect *effects;      /* Allocated effects */
-    int neffects;               /* Maximum amount of effects */
-    int nplaying;               /* Maximum amount of effects to play at the same time */
-    unsigned int supported;     /* Supported effects */
-    int naxes;                  /* Number of axes on the device. */
-
-    struct haptic_hwdata *hwdata;       /* Driver dependent */
-    int ref_count;              /* Count for multiple opens */
-
-    int rumble_id;              /* ID of rumble effect for simple rumble API. */
-    SDL_HapticEffect rumble_effect; /* Rumble effect. */
-};
-
-/*
- * Scans the system for haptic devices.
- *
- * Returns number of devices on success, -1 on error.
- */
-extern int SDL_SYS_HapticInit(void);
-
-/*
- * Gets the device dependent name of the haptic device
- */
-extern const char *SDL_SYS_HapticName(int index);
-
-/*
- * Opens the haptic device for usage.  The haptic device should have
- * the index value set previously.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticOpen(SDL_Haptic * haptic);
-
-/*
- * Returns the index of the haptic core pointer or -1 if none is found.
- */
-int SDL_SYS_HapticMouse(void);
-
-/*
- * Checks to see if the joystick has haptic capabilities.
- *
- * Returns >0 if haptic capabilities are detected, 0 if haptic
- * capabilities aren't detected and -1 on error.
- */
-extern int SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick);
-
-/*
- * Opens the haptic device for usage using the same device as
- * the joystick.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic,
-                                          SDL_Joystick * joystick);
-/*
- * Checks to see if haptic device and joystick device are the same.
- *
- * Returns 1 if they are the same, 0 if they aren't.
- */
-extern int SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic,
-                                      SDL_Joystick * joystick);
-
-/*
- * Closes a haptic device after usage.
- */
-extern void SDL_SYS_HapticClose(SDL_Haptic * haptic);
-
-/*
- * Performs a cleanup on the haptic subsystem.
- */
-extern void SDL_SYS_HapticQuit(void);
-
-/*
- * Creates a new haptic effect on the haptic device using base
- * as a template for the effect.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticNewEffect(SDL_Haptic * haptic,
-                                   struct haptic_effect *effect,
-                                   SDL_HapticEffect * base);
-
-/*
- * Updates the haptic effect on the haptic device using data
- * as a template.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic,
-                                      struct haptic_effect *effect,
-                                      SDL_HapticEffect * data);
-
-/*
- * Runs the effect on the haptic device.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticRunEffect(SDL_Haptic * haptic,
-                                   struct haptic_effect *effect,
-                                   Uint32 iterations);
-
-/*
- * Stops the effect on the haptic device.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticStopEffect(SDL_Haptic * haptic,
-                                    struct haptic_effect *effect);
-
-/*
- * Cleanups up the effect on the haptic device.
- */
-extern void SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic,
-                                        struct haptic_effect *effect);
-
-/*
- * Queries the device for the status of effect.
- *
- * Returns 0 if device is stopped, >0 if device is playing and
- * -1 on error.
- */
-extern int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic,
-                                         struct haptic_effect *effect);
-
-/*
- * Sets the global gain of the haptic device.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain);
-
-/*
- * Sets the autocenter feature of the haptic device.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter);
-
-/*
- * Pauses the haptic device.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticPause(SDL_Haptic * haptic);
-
-/*
- * Unpauses the haptic device.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticUnpause(SDL_Haptic * haptic);
-
-/*
- * Stops all the currently playing haptic effects on the device.
- *
- * Returns 0 on success, -1 on error.
- */
-extern int SDL_SYS_HapticStopAll(SDL_Haptic * haptic);
diff --git a/deps/SDL2/src/haptic/darwin/SDL_syshaptic.c b/deps/SDL2/src/haptic/darwin/SDL_syshaptic.c
deleted file mode 100644
index c999a77..0000000
--- a/deps/SDL2/src/haptic/darwin/SDL_syshaptic.c
+++ /dev/null
@@ -1,1300 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_HAPTIC_IOKIT
-
-#include "SDL_haptic.h"
-#include "../SDL_syshaptic.h"
-#include "SDL_joystick.h"
-#include "../../joystick/SDL_sysjoystick.h"     /* For the real SDL_Joystick */
-#include "../../joystick/darwin/SDL_sysjoystick_c.h"    /* For joystick hwdata */
-
-#include <IOKit/IOKitLib.h>
-#include <IOKit/hid/IOHIDKeys.h>
-#include <IOKit/hid/IOHIDUsageTables.h>
-#include <ForceFeedback/ForceFeedback.h>
-#include <ForceFeedback/ForceFeedbackConstants.h>
-
-#ifndef IO_OBJECT_NULL
-#define IO_OBJECT_NULL  ((io_service_t)0)
-#endif
-
-#define MAX_HAPTICS  32
-
-
-/*
- * List of available haptic devices.
- */
-static struct
-{
-    char name[256];             /* Name of the device. */
-
-    io_service_t dev;           /* Node we use to create the device. */
-    SDL_Haptic *haptic;         /* Haptic currently associated with it. */
-
-    /* Usage pages for determining if it's a mouse or not. */
-    long usage;
-    long usagePage;
-} SDL_hapticlist[MAX_HAPTICS];
-
-
-/*
- * Haptic system hardware data.
- */
-struct haptic_hwdata
-{
-    FFDeviceObjectReference device;     /* Hardware device. */
-    UInt8 axes[3];
-};
-
-
-/*
- * Haptic system effect data.
- */
-struct haptic_hweffect
-{
-    FFEffectObjectReference ref;        /* Reference. */
-    struct FFEFFECT effect;     /* Hardware effect. */
-};
-
-/*
- * Prototypes.
- */
-static void SDL_SYS_HapticFreeFFEFFECT(FFEFFECT * effect, int type);
-static int HIDGetDeviceProduct(io_service_t dev, char *name);
-
-
-/*
- * Like strerror but for force feedback errors.
- */
-static const char *
-FFStrError(HRESULT err)
-{
-    switch (err) {
-    case FFERR_DEVICEFULL:
-        return "device full";
-        /* This should be valid, but for some reason isn't defined... */
-        /* case FFERR_DEVICENOTREG:
-           return "device not registered"; */
-    case FFERR_DEVICEPAUSED:
-        return "device paused";
-    case FFERR_DEVICERELEASED:
-        return "device released";
-    case FFERR_EFFECTPLAYING:
-        return "effect playing";
-    case FFERR_EFFECTTYPEMISMATCH:
-        return "effect type mismatch";
-    case FFERR_EFFECTTYPENOTSUPPORTED:
-        return "effect type not supported";
-    case FFERR_GENERIC:
-        return "undetermined error";
-    case FFERR_HASEFFECTS:
-        return "device has effects";
-    case FFERR_INCOMPLETEEFFECT:
-        return "incomplete effect";
-    case FFERR_INTERNAL:
-        return "internal fault";
-    case FFERR_INVALIDDOWNLOADID:
-        return "invalid download id";
-    case FFERR_INVALIDPARAM:
-        return "invalid parameter";
-    case FFERR_MOREDATA:
-        return "more data";
-    case FFERR_NOINTERFACE:
-        return "interface not supported";
-    case FFERR_NOTDOWNLOADED:
-        return "effect is not downloaded";
-    case FFERR_NOTINITIALIZED:
-        return "object has not been initialized";
-    case FFERR_OUTOFMEMORY:
-        return "out of memory";
-    case FFERR_UNPLUGGED:
-        return "device is unplugged";
-    case FFERR_UNSUPPORTED:
-        return "function call unsupported";
-    case FFERR_UNSUPPORTEDAXIS:
-        return "axis unsupported";
-
-    default:
-        return "unknown error";
-    }
-}
-
-
-/*
- * Initializes the haptic subsystem.
- */
-int
-SDL_SYS_HapticInit(void)
-{
-    int numhaptics;
-    IOReturn result;
-    io_iterator_t iter;
-    CFDictionaryRef match;
-    io_service_t device;
-    CFMutableDictionaryRef hidProperties;
-    CFTypeRef refCF;
-
-    /* Clear all the memory. */
-    SDL_memset(SDL_hapticlist, 0, sizeof(SDL_hapticlist));
-
-    /* Get HID devices. */
-    match = IOServiceMatching(kIOHIDDeviceKey);
-    if (match == NULL) {
-        return SDL_SetError("Haptic: Failed to get IOServiceMatching.");
-    }
-
-    /* Now search I/O Registry for matching devices. */
-    result = IOServiceGetMatchingServices(kIOMasterPortDefault, match, &iter);
-    if (result != kIOReturnSuccess) {
-        return SDL_SetError("Haptic: Couldn't create a HID object iterator.");
-    }
-    /* IOServiceGetMatchingServices consumes dictionary. */
-
-    if (!IOIteratorIsValid(iter)) {     /* No iterator. */
-        return 0;
-    }
-
-    numhaptics = 0;
-    while ((device = IOIteratorNext(iter)) != IO_OBJECT_NULL) {
-
-        /* Check for force feedback. */
-        if (FFIsForceFeedback(device) == FF_OK) {
-
-            /* Set basic device data. */
-            HIDGetDeviceProduct(device, SDL_hapticlist[numhaptics].name);
-            SDL_hapticlist[numhaptics].dev = device;
-            SDL_hapticlist[numhaptics].haptic = NULL;
-
-            /* Set usage pages. */
-            hidProperties = 0;
-            refCF = 0;
-            result = IORegistryEntryCreateCFProperties(device,
-                                                       &hidProperties,
-                                                       kCFAllocatorDefault,
-                                                       kNilOptions);
-            if ((result == KERN_SUCCESS) && hidProperties) {
-                refCF =
-                    CFDictionaryGetValue(hidProperties,
-                                         CFSTR(kIOHIDPrimaryUsagePageKey));
-                if (refCF) {
-                    if (!CFNumberGetValue(refCF, kCFNumberLongType,
-                                          &SDL_hapticlist[numhaptics].
-                                          usagePage))
-                        SDL_SetError
-                            ("Haptic: Recieving device's usage page.");
-                    refCF =
-                        CFDictionaryGetValue(hidProperties,
-                                             CFSTR(kIOHIDPrimaryUsageKey));
-                    if (refCF) {
-                        if (!CFNumberGetValue(refCF, kCFNumberLongType,
-                                              &SDL_hapticlist[numhaptics].
-                                              usage))
-                            SDL_SetError("Haptic: Recieving device's usage.");
-                    }
-                }
-                CFRelease(hidProperties);
-            }
-
-            /* Device has been added. */
-            numhaptics++;
-        } else {                /* Free the unused device. */
-            IOObjectRelease(device);
-        }
-
-        /* Reached haptic limit. */
-        if (numhaptics >= MAX_HAPTICS)
-            break;
-    }
-    IOObjectRelease(iter);
-
-    return numhaptics;
-}
-
-
-/*
- * Return the name of a haptic device, does not need to be opened.
- */
-const char *
-SDL_SYS_HapticName(int index)
-{
-    return SDL_hapticlist[index].name;
-}
-
-/*
- * Gets the device's product name.
- */
-static int
-HIDGetDeviceProduct(io_service_t dev, char *name)
-{
-    CFMutableDictionaryRef hidProperties, usbProperties;
-    io_registry_entry_t parent1, parent2;
-    kern_return_t ret;
-
-    hidProperties = usbProperties = 0;
-
-    ret = IORegistryEntryCreateCFProperties(dev, &hidProperties,
-                                            kCFAllocatorDefault, kNilOptions);
-    if ((ret != KERN_SUCCESS) || !hidProperties) {
-        return SDL_SetError("Haptic: Unable to create CFProperties.");
-    }
-
-    /* Mac OS X currently is not mirroring all USB properties to HID page so need to look at USB device page also
-     * get dictionary for USB properties: step up two levels and get CF dictionary for USB properties
-     */
-    if ((KERN_SUCCESS ==
-         IORegistryEntryGetParentEntry(dev, kIOServicePlane, &parent1))
-        && (KERN_SUCCESS ==
-            IORegistryEntryGetParentEntry(parent1, kIOServicePlane, &parent2))
-        && (KERN_SUCCESS ==
-            IORegistryEntryCreateCFProperties(parent2, &usbProperties,
-                                              kCFAllocatorDefault,
-                                              kNilOptions))) {
-        if (usbProperties) {
-            CFTypeRef refCF = 0;
-            /* get device info
-             * try hid dictionary first, if fail then go to USB dictionary
-             */
-
-
-            /* Get product name */
-            refCF =
-                CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDProductKey));
-            if (!refCF)
-                refCF =
-                    CFDictionaryGetValue(usbProperties,
-                                         CFSTR("USB Product Name"));
-            if (refCF) {
-                if (!CFStringGetCString(refCF, name, 256,
-                                        CFStringGetSystemEncoding())) {
-                    return SDL_SetError
-                        ("Haptic: CFStringGetCString error retrieving pDevice->product.");
-                }
-            }
-
-            CFRelease(usbProperties);
-        } else {
-            return SDL_SetError
-                ("Haptic: IORegistryEntryCreateCFProperties failed to create usbProperties.");
-        }
-
-        /* Release stuff. */
-        if (kIOReturnSuccess != IOObjectRelease(parent2)) {
-            SDL_SetError("Haptic: IOObjectRelease error with parent2.");
-        }
-        if (kIOReturnSuccess != IOObjectRelease(parent1)) {
-            SDL_SetError("Haptic: IOObjectRelease error with parent1.");
-        }
-    } else {
-        return SDL_SetError("Haptic: Error getting registry entries.");
-    }
-
-    return 0;
-}
-
-
-#define FF_TEST(ff, s) \
-if (features.supportedEffects & (ff)) supported |= (s)
-/*
- * Gets supported features.
- */
-static unsigned int
-GetSupportedFeatures(SDL_Haptic * haptic)
-{
-    HRESULT ret;
-    FFDeviceObjectReference device;
-    FFCAPABILITIES features;
-    unsigned int supported;
-    Uint32 val;
-
-    device = haptic->hwdata->device;
-
-    ret = FFDeviceGetForceFeedbackCapabilities(device, &features);
-    if (ret != FF_OK) {
-        return SDL_SetError("Haptic: Unable to get device's supported features.");
-    }
-
-    supported = 0;
-
-    /* Get maximum effects. */
-    haptic->neffects = features.storageCapacity;
-    haptic->nplaying = features.playbackCapacity;
-
-    /* Test for effects. */
-    FF_TEST(FFCAP_ET_CONSTANTFORCE, SDL_HAPTIC_CONSTANT);
-    FF_TEST(FFCAP_ET_RAMPFORCE, SDL_HAPTIC_RAMP);
-    /* !!! FIXME: put this back when we have more bits in 2.1 */
-    /* FF_TEST(FFCAP_ET_SQUARE, SDL_HAPTIC_SQUARE); */
-    FF_TEST(FFCAP_ET_SINE, SDL_HAPTIC_SINE);
-    FF_TEST(FFCAP_ET_TRIANGLE, SDL_HAPTIC_TRIANGLE);
-    FF_TEST(FFCAP_ET_SAWTOOTHUP, SDL_HAPTIC_SAWTOOTHUP);
-    FF_TEST(FFCAP_ET_SAWTOOTHDOWN, SDL_HAPTIC_SAWTOOTHDOWN);
-    FF_TEST(FFCAP_ET_SPRING, SDL_HAPTIC_SPRING);
-    FF_TEST(FFCAP_ET_DAMPER, SDL_HAPTIC_DAMPER);
-    FF_TEST(FFCAP_ET_INERTIA, SDL_HAPTIC_INERTIA);
-    FF_TEST(FFCAP_ET_FRICTION, SDL_HAPTIC_FRICTION);
-    FF_TEST(FFCAP_ET_CUSTOMFORCE, SDL_HAPTIC_CUSTOM);
-
-    /* Check if supports gain. */
-    ret = FFDeviceGetForceFeedbackProperty(device, FFPROP_FFGAIN,
-                                           &val, sizeof(val));
-    if (ret == FF_OK)
-        supported |= SDL_HAPTIC_GAIN;
-    else if (ret != FFERR_UNSUPPORTED) {
-        return SDL_SetError("Haptic: Unable to get if device supports gain: %s.",
-                            FFStrError(ret));
-    }
-
-    /* Checks if supports autocenter. */
-    ret = FFDeviceGetForceFeedbackProperty(device, FFPROP_AUTOCENTER,
-                                           &val, sizeof(val));
-    if (ret == FF_OK)
-        supported |= SDL_HAPTIC_AUTOCENTER;
-    else if (ret != FFERR_UNSUPPORTED) {
-        return SDL_SetError
-            ("Haptic: Unable to get if device supports autocenter: %s.",
-             FFStrError(ret));
-    }
-
-    /* Check for axes, we have an artificial limit on axes */
-    haptic->naxes = ((features.numFfAxes) > 3) ? 3 : features.numFfAxes;
-    /* Actually store the axes we want to use */
-    SDL_memcpy(haptic->hwdata->axes, features.ffAxes,
-               haptic->naxes * sizeof(Uint8));
-
-    /* Always supported features. */
-    supported |= SDL_HAPTIC_STATUS | SDL_HAPTIC_PAUSE;
-
-    haptic->supported = supported;
-    return 0;;
-}
-
-
-/*
- * Opens the haptic device from the file descriptor.
- */
-static int
-SDL_SYS_HapticOpenFromService(SDL_Haptic * haptic, io_service_t service)
-{
-    HRESULT ret;
-    int ret2;
-
-    /* Allocate the hwdata */
-    haptic->hwdata = (struct haptic_hwdata *)
-        SDL_malloc(sizeof(*haptic->hwdata));
-    if (haptic->hwdata == NULL) {
-        SDL_OutOfMemory();
-        goto creat_err;
-    }
-    SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
-
-    /* Open the device */
-    ret = FFCreateDevice(service, &haptic->hwdata->device);
-    if (ret != FF_OK) {
-        SDL_SetError("Haptic: Unable to create device from service: %s.",
-                     FFStrError(ret));
-        goto creat_err;
-    }
-
-    /* Get supported features. */
-    ret2 = GetSupportedFeatures(haptic);
-    if (ret2 < 0) {
-        goto open_err;
-    }
-
-
-    /* Reset and then enable actuators. */
-    ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
-                                           FFSFFC_RESET);
-    if (ret != FF_OK) {
-        SDL_SetError("Haptic: Unable to reset device: %s.", FFStrError(ret));
-        goto open_err;
-    }
-    ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
-                                           FFSFFC_SETACTUATORSON);
-    if (ret != FF_OK) {
-        SDL_SetError("Haptic: Unable to enable actuators: %s.",
-                     FFStrError(ret));
-        goto open_err;
-    }
-
-
-    /* Allocate effects memory. */
-    haptic->effects = (struct haptic_effect *)
-        SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects);
-    if (haptic->effects == NULL) {
-        SDL_OutOfMemory();
-        goto open_err;
-    }
-    /* Clear the memory */
-    SDL_memset(haptic->effects, 0,
-               sizeof(struct haptic_effect) * haptic->neffects);
-
-    return 0;
-
-    /* Error handling */
-  open_err:
-    FFReleaseDevice(haptic->hwdata->device);
-  creat_err:
-    if (haptic->hwdata != NULL) {
-        free(haptic->hwdata);
-        haptic->hwdata = NULL;
-    }
-    return -1;
-
-}
-
-
-/*
- * Opens a haptic device for usage.
- */
-int
-SDL_SYS_HapticOpen(SDL_Haptic * haptic)
-{
-    return SDL_SYS_HapticOpenFromService(haptic,
-                                         SDL_hapticlist[haptic->index].dev);
-}
-
-
-/*
- * Opens a haptic device from first mouse it finds for usage.
- */
-int
-SDL_SYS_HapticMouse(void)
-{
-    int i;
-
-    for (i = 0; i < SDL_numhaptics; i++) {
-        if ((SDL_hapticlist[i].usagePage == kHIDPage_GenericDesktop) &&
-            (SDL_hapticlist[i].usage == kHIDUsage_GD_Mouse))
-            return i;
-    }
-
-    return -1;
-}
-
-
-/*
- * Checks to see if a joystick has haptic features.
- */
-int
-SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
-{
-    if (joystick->hwdata->ffservice != 0)
-        return SDL_TRUE;
-    return SDL_FALSE;
-}
-
-
-/*
- * Checks to see if the haptic device and joystick are in reality the same.
- */
-int
-SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
-{
-    if (IOObjectIsEqualTo((io_object_t) ((size_t)haptic->hwdata->device),
-                          joystick->hwdata->ffservice))
-        return 1;
-    return 0;
-}
-
-
-/*
- * Opens a SDL_Haptic from a SDL_Joystick.
- */
-int
-SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
-{
-    int i;
-    for (i=0; i<SDL_numhaptics; i++) {
-       if (IOObjectIsEqualTo((io_object_t) SDL_hapticlist[i].dev,
-                             joystick->hwdata->ffservice)) {
-           haptic->index = i;
-           break;
-       }
-    }
-    if (i >= SDL_numhaptics) {
-       return -1;
-    }
-
-    return SDL_SYS_HapticOpenFromService(haptic, joystick->hwdata->ffservice);
-}
-
-
-/*
- * Closes the haptic device.
- */
-void
-SDL_SYS_HapticClose(SDL_Haptic * haptic)
-{
-    if (haptic->hwdata) {
-
-        /* Free Effects. */
-        SDL_free(haptic->effects);
-        haptic->effects = NULL;
-        haptic->neffects = 0;
-
-        /* Clean up */
-        FFReleaseDevice(haptic->hwdata->device);
-
-        /* Free */
-        SDL_free(haptic->hwdata);
-        haptic->hwdata = NULL;
-    }
-}
-
-
-/*
- * Clean up after system specific haptic stuff
- */
-void
-SDL_SYS_HapticQuit(void)
-{
-    int i;
-
-    for (i = 0; i < SDL_numhaptics; i++) {
-        /* Opened and not closed haptics are leaked, this is on purpose.
-         * Close your haptic devices after usage. */
-
-        /* Free the io_service_t */
-        IOObjectRelease(SDL_hapticlist[i].dev);
-    }
-}
-
-
-/*
- * Converts an SDL trigger button to an FFEFFECT trigger button.
- */
-static DWORD
-FFGetTriggerButton(Uint16 button)
-{
-    DWORD dwTriggerButton;
-
-    dwTriggerButton = FFEB_NOTRIGGER;
-
-    if (button != 0) {
-        dwTriggerButton = FFJOFS_BUTTON(button - 1);
-    }
-
-    return dwTriggerButton;
-}
-
-
-/*
- * Sets the direction.
- */
-static int
-SDL_SYS_SetDirection(FFEFFECT * effect, SDL_HapticDirection * dir, int naxes)
-{
-    LONG *rglDir;
-
-    /* Handle no axes a part. */
-    if (naxes == 0) {
-        effect->dwFlags |= FFEFF_SPHERICAL;     /* Set as default. */
-        effect->rglDirection = NULL;
-        return 0;
-    }
-
-    /* Has axes. */
-    rglDir = SDL_malloc(sizeof(LONG) * naxes);
-    if (rglDir == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(rglDir, 0, sizeof(LONG) * naxes);
-    effect->rglDirection = rglDir;
-
-    switch (dir->type) {
-    case SDL_HAPTIC_POLAR:
-        effect->dwFlags |= FFEFF_POLAR;
-        rglDir[0] = dir->dir[0];
-        return 0;
-    case SDL_HAPTIC_CARTESIAN:
-        effect->dwFlags |= FFEFF_CARTESIAN;
-        rglDir[0] = dir->dir[0];
-        if (naxes > 1)
-            rglDir[1] = dir->dir[1];
-        if (naxes > 2)
-            rglDir[2] = dir->dir[2];
-        return 0;
-    case SDL_HAPTIC_SPHERICAL:
-        effect->dwFlags |= FFEFF_SPHERICAL;
-        rglDir[0] = dir->dir[0];
-        if (naxes > 1)
-            rglDir[1] = dir->dir[1];
-        if (naxes > 2)
-            rglDir[2] = dir->dir[2];
-        return 0;
-
-    default:
-        return SDL_SetError("Haptic: Unknown direction type.");
-    }
-}
-
-
-/* Clamps and converts. */
-#define CCONVERT(x)   (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF)
-/* Just converts. */
-#define CONVERT(x)    (((x)*10000) / 0x7FFF)
-/*
- * Creates the FFEFFECT from a SDL_HapticEffect.
- */
-static int
-SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest,
-                   SDL_HapticEffect * src)
-{
-    int i;
-    FFCONSTANTFORCE *constant;
-    FFPERIODIC *periodic;
-    FFCONDITION *condition;     /* Actually an array of conditions - one per axis. */
-    FFRAMPFORCE *ramp;
-    FFCUSTOMFORCE *custom;
-    FFENVELOPE *envelope;
-    SDL_HapticConstant *hap_constant;
-    SDL_HapticPeriodic *hap_periodic;
-    SDL_HapticCondition *hap_condition;
-    SDL_HapticRamp *hap_ramp;
-    SDL_HapticCustom *hap_custom;
-    DWORD *axes;
-
-    /* Set global stuff. */
-    SDL_memset(dest, 0, sizeof(FFEFFECT));
-    dest->dwSize = sizeof(FFEFFECT);    /* Set the structure size. */
-    dest->dwSamplePeriod = 0;   /* Not used by us. */
-    dest->dwGain = 10000;       /* Gain is set globally, not locally. */
-    dest->dwFlags = FFEFF_OBJECTOFFSETS;        /* Seems obligatory. */
-
-    /* Envelope. */
-    envelope = SDL_malloc(sizeof(FFENVELOPE));
-    if (envelope == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(envelope, 0, sizeof(FFENVELOPE));
-    dest->lpEnvelope = envelope;
-    envelope->dwSize = sizeof(FFENVELOPE);      /* Always should be this. */
-
-    /* Axes. */
-    dest->cAxes = haptic->naxes;
-    if (dest->cAxes > 0) {
-        axes = SDL_malloc(sizeof(DWORD) * dest->cAxes);
-        if (axes == NULL) {
-            return SDL_OutOfMemory();
-        }
-        axes[0] = haptic->hwdata->axes[0];      /* Always at least one axis. */
-        if (dest->cAxes > 1) {
-            axes[1] = haptic->hwdata->axes[1];
-        }
-        if (dest->cAxes > 2) {
-            axes[2] = haptic->hwdata->axes[2];
-        }
-        dest->rgdwAxes = axes;
-    }
-
-
-    /* The big type handling switch, even bigger then Linux's version. */
-    switch (src->type) {
-    case SDL_HAPTIC_CONSTANT:
-        hap_constant = &src->constant;
-        constant = SDL_malloc(sizeof(FFCONSTANTFORCE));
-        if (constant == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(constant, 0, sizeof(FFCONSTANTFORCE));
-
-        /* Specifics */
-        constant->lMagnitude = CONVERT(hap_constant->level);
-        dest->cbTypeSpecificParams = sizeof(FFCONSTANTFORCE);
-        dest->lpvTypeSpecificParams = constant;
-
-        /* Generics */
-        dest->dwDuration = hap_constant->length * 1000; /* In microseconds. */
-        dest->dwTriggerButton = FFGetTriggerButton(hap_constant->button);
-        dest->dwTriggerRepeatInterval = hap_constant->interval;
-        dest->dwStartDelay = hap_constant->delay * 1000;        /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_constant->direction, dest->cAxes)
-            < 0) {
-            return -1;
-        }
-
-        /* Envelope */
-        if ((hap_constant->attack_length == 0)
-            && (hap_constant->fade_length == 0)) {
-            SDL_free(envelope);
-            dest->lpEnvelope = NULL;
-        } else {
-            envelope->dwAttackLevel = CCONVERT(hap_constant->attack_level);
-            envelope->dwAttackTime = hap_constant->attack_length * 1000;
-            envelope->dwFadeLevel = CCONVERT(hap_constant->fade_level);
-            envelope->dwFadeTime = hap_constant->fade_length * 1000;
-        }
-
-        break;
-
-    case SDL_HAPTIC_SINE:
-    /* !!! FIXME: put this back when we have more bits in 2.1 */
-    /* case SDL_HAPTIC_SQUARE: */
-    case SDL_HAPTIC_TRIANGLE:
-    case SDL_HAPTIC_SAWTOOTHUP:
-    case SDL_HAPTIC_SAWTOOTHDOWN:
-        hap_periodic = &src->periodic;
-        periodic = SDL_malloc(sizeof(FFPERIODIC));
-        if (periodic == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(periodic, 0, sizeof(FFPERIODIC));
-
-        /* Specifics */
-        periodic->dwMagnitude = CONVERT(hap_periodic->magnitude);
-        periodic->lOffset = CONVERT(hap_periodic->offset);
-        periodic->dwPhase = hap_periodic->phase;
-        periodic->dwPeriod = hap_periodic->period * 1000;
-        dest->cbTypeSpecificParams = sizeof(FFPERIODIC);
-        dest->lpvTypeSpecificParams = periodic;
-
-        /* Generics */
-        dest->dwDuration = hap_periodic->length * 1000; /* In microseconds. */
-        dest->dwTriggerButton = FFGetTriggerButton(hap_periodic->button);
-        dest->dwTriggerRepeatInterval = hap_periodic->interval;
-        dest->dwStartDelay = hap_periodic->delay * 1000;        /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_periodic->direction, dest->cAxes)
-            < 0) {
-            return -1;
-        }
-
-        /* Envelope */
-        if ((hap_periodic->attack_length == 0)
-            && (hap_periodic->fade_length == 0)) {
-            SDL_free(envelope);
-            dest->lpEnvelope = NULL;
-        } else {
-            envelope->dwAttackLevel = CCONVERT(hap_periodic->attack_level);
-            envelope->dwAttackTime = hap_periodic->attack_length * 1000;
-            envelope->dwFadeLevel = CCONVERT(hap_periodic->fade_level);
-            envelope->dwFadeTime = hap_periodic->fade_length * 1000;
-        }
-
-        break;
-
-    case SDL_HAPTIC_SPRING:
-    case SDL_HAPTIC_DAMPER:
-    case SDL_HAPTIC_INERTIA:
-    case SDL_HAPTIC_FRICTION:
-        hap_condition = &src->condition;
-        condition = SDL_malloc(sizeof(FFCONDITION) * dest->cAxes);
-        if (condition == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(condition, 0, sizeof(FFCONDITION));
-
-        /* Specifics */
-        for (i = 0; i < dest->cAxes; i++) {
-            condition[i].lOffset = CONVERT(hap_condition->center[i]);
-            condition[i].lPositiveCoefficient =
-                CONVERT(hap_condition->right_coeff[i]);
-            condition[i].lNegativeCoefficient =
-                CONVERT(hap_condition->left_coeff[i]);
-            condition[i].dwPositiveSaturation =
-                CCONVERT(hap_condition->right_sat[i]);
-            condition[i].dwNegativeSaturation =
-                CCONVERT(hap_condition->left_sat[i]);
-            condition[i].lDeadBand = CCONVERT(hap_condition->deadband[i]);
-        }
-        dest->cbTypeSpecificParams = sizeof(FFCONDITION) * dest->cAxes;
-        dest->lpvTypeSpecificParams = condition;
-
-        /* Generics */
-        dest->dwDuration = hap_condition->length * 1000;        /* In microseconds. */
-        dest->dwTriggerButton = FFGetTriggerButton(hap_condition->button);
-        dest->dwTriggerRepeatInterval = hap_condition->interval;
-        dest->dwStartDelay = hap_condition->delay * 1000;       /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_condition->direction, dest->cAxes)
-            < 0) {
-            return -1;
-        }
-
-        /* Envelope - Not actually supported by most CONDITION implementations. */
-        SDL_free(dest->lpEnvelope);
-        dest->lpEnvelope = NULL;
-
-        break;
-
-    case SDL_HAPTIC_RAMP:
-        hap_ramp = &src->ramp;
-        ramp = SDL_malloc(sizeof(FFRAMPFORCE));
-        if (ramp == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(ramp, 0, sizeof(FFRAMPFORCE));
-
-        /* Specifics */
-        ramp->lStart = CONVERT(hap_ramp->start);
-        ramp->lEnd = CONVERT(hap_ramp->end);
-        dest->cbTypeSpecificParams = sizeof(FFRAMPFORCE);
-        dest->lpvTypeSpecificParams = ramp;
-
-        /* Generics */
-        dest->dwDuration = hap_ramp->length * 1000;     /* In microseconds. */
-        dest->dwTriggerButton = FFGetTriggerButton(hap_ramp->button);
-        dest->dwTriggerRepeatInterval = hap_ramp->interval;
-        dest->dwStartDelay = hap_ramp->delay * 1000;    /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_ramp->direction, dest->cAxes) < 0) {
-            return -1;
-        }
-
-        /* Envelope */
-        if ((hap_ramp->attack_length == 0) && (hap_ramp->fade_length == 0)) {
-            SDL_free(envelope);
-            dest->lpEnvelope = NULL;
-        } else {
-            envelope->dwAttackLevel = CCONVERT(hap_ramp->attack_level);
-            envelope->dwAttackTime = hap_ramp->attack_length * 1000;
-            envelope->dwFadeLevel = CCONVERT(hap_ramp->fade_level);
-            envelope->dwFadeTime = hap_ramp->fade_length * 1000;
-        }
-
-        break;
-
-    case SDL_HAPTIC_CUSTOM:
-        hap_custom = &src->custom;
-        custom = SDL_malloc(sizeof(FFCUSTOMFORCE));
-        if (custom == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(custom, 0, sizeof(FFCUSTOMFORCE));
-
-        /* Specifics */
-        custom->cChannels = hap_custom->channels;
-        custom->dwSamplePeriod = hap_custom->period * 1000;
-        custom->cSamples = hap_custom->samples;
-        custom->rglForceData =
-            SDL_malloc(sizeof(LONG) * custom->cSamples * custom->cChannels);
-        for (i = 0; i < hap_custom->samples * hap_custom->channels; i++) {      /* Copy data. */
-            custom->rglForceData[i] = CCONVERT(hap_custom->data[i]);
-        }
-        dest->cbTypeSpecificParams = sizeof(FFCUSTOMFORCE);
-        dest->lpvTypeSpecificParams = custom;
-
-        /* Generics */
-        dest->dwDuration = hap_custom->length * 1000;   /* In microseconds. */
-        dest->dwTriggerButton = FFGetTriggerButton(hap_custom->button);
-        dest->dwTriggerRepeatInterval = hap_custom->interval;
-        dest->dwStartDelay = hap_custom->delay * 1000;  /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_custom->direction, dest->cAxes) <
-            0) {
-            return -1;
-        }
-
-        /* Envelope */
-        if ((hap_custom->attack_length == 0)
-            && (hap_custom->fade_length == 0)) {
-            SDL_free(envelope);
-            dest->lpEnvelope = NULL;
-        } else {
-            envelope->dwAttackLevel = CCONVERT(hap_custom->attack_level);
-            envelope->dwAttackTime = hap_custom->attack_length * 1000;
-            envelope->dwFadeLevel = CCONVERT(hap_custom->fade_level);
-            envelope->dwFadeTime = hap_custom->fade_length * 1000;
-        }
-
-        break;
-
-
-    default:
-        return SDL_SetError("Haptic: Unknown effect type.");
-    }
-
-    return 0;
-}
-
-
-/*
- * Frees an FFEFFECT allocated by SDL_SYS_ToFFEFFECT.
- */
-static void
-SDL_SYS_HapticFreeFFEFFECT(FFEFFECT * effect, int type)
-{
-    FFCUSTOMFORCE *custom;
-
-    SDL_free(effect->lpEnvelope);
-    effect->lpEnvelope = NULL;
-    SDL_free(effect->rgdwAxes);
-    effect->rgdwAxes = NULL;
-    if (effect->lpvTypeSpecificParams != NULL) {
-        if (type == SDL_HAPTIC_CUSTOM) {        /* Must free the custom data. */
-            custom = (FFCUSTOMFORCE *) effect->lpvTypeSpecificParams;
-            SDL_free(custom->rglForceData);
-            custom->rglForceData = NULL;
-        }
-        SDL_free(effect->lpvTypeSpecificParams);
-        effect->lpvTypeSpecificParams = NULL;
-    }
-    SDL_free(effect->rglDirection);
-    effect->rglDirection = NULL;
-}
-
-
-/*
- * Gets the effect type from the generic SDL haptic effect wrapper.
- */
-CFUUIDRef
-SDL_SYS_HapticEffectType(Uint16 type)
-{
-    switch (type) {
-    case SDL_HAPTIC_CONSTANT:
-        return kFFEffectType_ConstantForce_ID;
-
-    case SDL_HAPTIC_RAMP:
-        return kFFEffectType_RampForce_ID;
-
-    /* !!! FIXME: put this back when we have more bits in 2.1 */
-    /* case SDL_HAPTIC_SQUARE:
-        return kFFEffectType_Square_ID; */
-
-    case SDL_HAPTIC_SINE:
-        return kFFEffectType_Sine_ID;
-
-    case SDL_HAPTIC_TRIANGLE:
-        return kFFEffectType_Triangle_ID;
-
-    case SDL_HAPTIC_SAWTOOTHUP:
-        return kFFEffectType_SawtoothUp_ID;
-
-    case SDL_HAPTIC_SAWTOOTHDOWN:
-        return kFFEffectType_SawtoothDown_ID;
-
-    case SDL_HAPTIC_SPRING:
-        return kFFEffectType_Spring_ID;
-
-    case SDL_HAPTIC_DAMPER:
-        return kFFEffectType_Damper_ID;
-
-    case SDL_HAPTIC_INERTIA:
-        return kFFEffectType_Inertia_ID;
-
-    case SDL_HAPTIC_FRICTION:
-        return kFFEffectType_Friction_ID;
-
-    case SDL_HAPTIC_CUSTOM:
-        return kFFEffectType_CustomForce_ID;
-
-    default:
-        SDL_SetError("Haptic: Unknown effect type.");
-        return NULL;
-    }
-}
-
-
-/*
- * Creates a new haptic effect.
- */
-int
-SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
-                        SDL_HapticEffect * base)
-{
-    HRESULT ret;
-    CFUUIDRef type;
-
-    /* Alloc the effect. */
-    effect->hweffect = (struct haptic_hweffect *)
-        SDL_malloc(sizeof(struct haptic_hweffect));
-    if (effect->hweffect == NULL) {
-        SDL_OutOfMemory();
-        goto err_hweffect;
-    }
-
-    /* Get the type. */
-    type = SDL_SYS_HapticEffectType(base->type);
-    if (type == NULL) {
-        goto err_hweffect;
-    }
-
-    /* Get the effect. */
-    if (SDL_SYS_ToFFEFFECT(haptic, &effect->hweffect->effect, base) < 0) {
-        goto err_effectdone;
-    }
-
-    /* Create the actual effect. */
-    ret = FFDeviceCreateEffect(haptic->hwdata->device, type,
-                               &effect->hweffect->effect,
-                               &effect->hweffect->ref);
-    if (ret != FF_OK) {
-        SDL_SetError("Haptic: Unable to create effect: %s.", FFStrError(ret));
-        goto err_effectdone;
-    }
-
-    return 0;
-
-  err_effectdone:
-    SDL_SYS_HapticFreeFFEFFECT(&effect->hweffect->effect, base->type);
-  err_hweffect:
-    SDL_free(effect->hweffect);
-    effect->hweffect = NULL;
-    return -1;
-}
-
-
-/*
- * Updates an effect.
- */
-int
-SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic,
-                           struct haptic_effect *effect,
-                           SDL_HapticEffect * data)
-{
-    HRESULT ret;
-    FFEffectParameterFlag flags;
-    FFEFFECT temp;
-
-    /* Get the effect. */
-    SDL_memset(&temp, 0, sizeof(FFEFFECT));
-    if (SDL_SYS_ToFFEFFECT(haptic, &temp, data) < 0) {
-        goto err_update;
-    }
-
-    /* Set the flags.  Might be worthwhile to diff temp with loaded effect and
-     *  only change those parameters. */
-    flags = FFEP_DIRECTION |
-        FFEP_DURATION |
-        FFEP_ENVELOPE |
-        FFEP_STARTDELAY |
-        FFEP_TRIGGERBUTTON |
-        FFEP_TRIGGERREPEATINTERVAL | FFEP_TYPESPECIFICPARAMS;
-
-    /* Create the actual effect. */
-    ret = FFEffectSetParameters(effect->hweffect->ref, &temp, flags);
-    if (ret != FF_OK) {
-        SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret));
-        goto err_update;
-    }
-
-    /* Copy it over. */
-    SDL_SYS_HapticFreeFFEFFECT(&effect->hweffect->effect, data->type);
-    SDL_memcpy(&effect->hweffect->effect, &temp, sizeof(FFEFFECT));
-
-    return 0;
-
-  err_update:
-    SDL_SYS_HapticFreeFFEFFECT(&temp, data->type);
-    return -1;
-}
-
-
-/*
- * Runs an effect.
- */
-int
-SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
-                        Uint32 iterations)
-{
-    HRESULT ret;
-    Uint32 iter;
-
-    /* Check if it's infinite. */
-    if (iterations == SDL_HAPTIC_INFINITY) {
-        iter = FF_INFINITE;
-    } else
-        iter = iterations;
-
-    /* Run the effect. */
-    ret = FFEffectStart(effect->hweffect->ref, iter, 0);
-    if (ret != FF_OK) {
-        return SDL_SetError("Haptic: Unable to run the effect: %s.",
-                            FFStrError(ret));
-    }
-
-    return 0;
-}
-
-
-/*
- * Stops an effect.
- */
-int
-SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
-{
-    HRESULT ret;
-
-    ret = FFEffectStop(effect->hweffect->ref);
-    if (ret != FF_OK) {
-        return SDL_SetError("Haptic: Unable to stop the effect: %s.",
-                            FFStrError(ret));
-    }
-
-    return 0;
-}
-
-
-/*
- * Frees the effect.
- */
-void
-SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
-{
-    HRESULT ret;
-
-    ret =
-        FFDeviceReleaseEffect(haptic->hwdata->device, effect->hweffect->ref);
-    if (ret != FF_OK) {
-        SDL_SetError("Haptic: Error removing the effect from the device: %s.",
-                     FFStrError(ret));
-    }
-    SDL_SYS_HapticFreeFFEFFECT(&effect->hweffect->effect,
-                               effect->effect.type);
-    SDL_free(effect->hweffect);
-    effect->hweffect = NULL;
-}
-
-
-/*
- * Gets the status of a haptic effect.
- */
-int
-SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic,
-                              struct haptic_effect *effect)
-{
-    HRESULT ret;
-    FFEffectStatusFlag status;
-
-    ret = FFEffectGetEffectStatus(effect->hweffect->ref, &status);
-    if (ret != FF_OK) {
-        SDL_SetError("Haptic: Unable to get effect status: %s.",
-                     FFStrError(ret));
-        return -1;
-    }
-
-    if (status == 0)
-        return SDL_FALSE;
-    return SDL_TRUE;            /* Assume it's playing or emulated. */
-}
-
-
-/*
- * Sets the gain.
- */
-int
-SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain)
-{
-    HRESULT ret;
-    Uint32 val;
-
-    val = gain * 100;           /* Mac OS X uses 0 to 10,000 */
-    ret =
-        FFDeviceSetForceFeedbackProperty(haptic->hwdata->device,
-                                         FFPROP_FFGAIN, &val);
-    if (ret != FF_OK) {
-        return SDL_SetError("Haptic: Error setting gain: %s.", FFStrError(ret));
-    }
-
-    return 0;
-}
-
-
-/*
- * Sets the autocentering.
- */
-int
-SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
-{
-    HRESULT ret;
-    Uint32 val;
-
-    /* Mac OS X only has 0 (off) and 1 (on) */
-    if (autocenter == 0)
-        val = 0;
-    else
-        val = 1;
-
-    ret = FFDeviceSetForceFeedbackProperty(haptic->hwdata->device,
-                                           FFPROP_AUTOCENTER, &val);
-    if (ret != FF_OK) {
-        return SDL_SetError("Haptic: Error setting autocenter: %s.",
-                            FFStrError(ret));
-    }
-
-    return 0;
-}
-
-
-/*
- * Pauses the device.
- */
-int
-SDL_SYS_HapticPause(SDL_Haptic * haptic)
-{
-    HRESULT ret;
-
-    ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
-                                           FFSFFC_PAUSE);
-    if (ret != FF_OK) {
-        return SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
-    }
-
-    return 0;
-}
-
-
-/*
- * Unpauses the device.
- */
-int
-SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
-{
-    HRESULT ret;
-
-    ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
-                                           FFSFFC_CONTINUE);
-    if (ret != FF_OK) {
-        return SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
-    }
-
-    return 0;
-}
-
-
-/*
- * Stops all currently playing effects.
- */
-int
-SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
-{
-    HRESULT ret;
-
-    ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
-                                           FFSFFC_STOPALL);
-    if (ret != FF_OK) {
-        return SDL_SetError("Haptic: Error stopping device: %s.", FFStrError(ret));
-    }
-
-    return 0;
-}
-
-
-#endif /* SDL_HAPTIC_IOKIT */
diff --git a/deps/SDL2/src/haptic/dummy/SDL_syshaptic.c b/deps/SDL2/src/haptic/dummy/SDL_syshaptic.c
deleted file mode 100644
index 29084eb..0000000
--- a/deps/SDL2/src/haptic/dummy/SDL_syshaptic.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(SDL_HAPTIC_DUMMY) || defined(SDL_HAPTIC_DISABLED)
-
-#include "SDL_haptic.h"
-#include "../SDL_syshaptic.h"
-
-
-static int
-SDL_SYS_LogicError(void)
-{
-    return SDL_SetError("Logic error: No haptic devices available.");
-}
-
-
-int
-SDL_SYS_HapticInit(void)
-{
-    return 0;
-}
-
-
-const char *
-SDL_SYS_HapticName(int index)
-{
-    SDL_SYS_LogicError();
-    return NULL;
-}
-
-
-int
-SDL_SYS_HapticOpen(SDL_Haptic * haptic)
-{
-    return SDL_SYS_LogicError();
-}
-
-
-int
-SDL_SYS_HapticMouse(void)
-{
-    return -1;
-}
-
-
-int
-SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
-{
-    return 0;
-}
-
-
-int
-SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
-{
-    return SDL_SYS_LogicError();
-}
-
-
-int
-SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
-{
-    return 0;
-}
-
-
-void
-SDL_SYS_HapticClose(SDL_Haptic * haptic)
-{
-    return;
-}
-
-
-void
-SDL_SYS_HapticQuit(void)
-{
-    return;
-}
-
-
-int
-SDL_SYS_HapticNewEffect(SDL_Haptic * haptic,
-                        struct haptic_effect *effect, SDL_HapticEffect * base)
-{
-    return SDL_SYS_LogicError();
-}
-
-
-int
-SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic,
-                           struct haptic_effect *effect,
-                           SDL_HapticEffect * data)
-{
-    return SDL_SYS_LogicError();
-}
-
-
-int
-SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
-                        Uint32 iterations)
-{
-    return SDL_SYS_LogicError();
-}
-
-
-int
-SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
-{
-    return SDL_SYS_LogicError();
-}
-
-
-void
-SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
-{
-    SDL_SYS_LogicError();
-    return;
-}
-
-
-int
-SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic,
-                              struct haptic_effect *effect)
-{
-    return SDL_SYS_LogicError();
-}
-
-
-int
-SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain)
-{
-    return SDL_SYS_LogicError();
-}
-
-
-int
-SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
-{
-    return SDL_SYS_LogicError();
-}
-
-int
-SDL_SYS_HapticPause(SDL_Haptic * haptic)
-{
-    return SDL_SYS_LogicError();
-}
-
-int
-SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
-{
-    return SDL_SYS_LogicError();
-}
-
-int
-SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
-{
-    return SDL_SYS_LogicError();
-}
-
-#endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */
diff --git a/deps/SDL2/src/haptic/linux/SDL_syshaptic.c b/deps/SDL2/src/haptic/linux/SDL_syshaptic.c
deleted file mode 100644
index e209d05..0000000
--- a/deps/SDL2/src/haptic/linux/SDL_syshaptic.c
+++ /dev/null
@@ -1,1001 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_HAPTIC_LINUX
-
-#include "SDL_haptic.h"
-#include "../SDL_syshaptic.h"
-#include "SDL_joystick.h"
-#include "../../joystick/SDL_sysjoystick.h"     /* For the real SDL_Joystick */
-#include "../../joystick/linux/SDL_sysjoystick_c.h"     /* For joystick hwdata */
-
-#include <unistd.h>             /* close */
-#include <linux/input.h>        /* Force feedback linux stuff. */
-#include <fcntl.h>              /* O_RDWR */
-#include <limits.h>             /* INT_MAX */
-#include <errno.h>              /* errno, strerror */
-#include <math.h>               /* atan2 */
-#include <sys/stat.h>           /* stat */
-
-/* Just in case. */
-#ifndef M_PI
-#  define M_PI     3.14159265358979323846
-#endif
-
-
-#define MAX_HAPTICS  32         /* It's doubtful someone has more then 32 evdev */
-
-
-/*
- * List of available haptic devices.
- */
-static struct
-{
-    char *fname;                /* Dev path name (like /dev/input/event1) */
-    SDL_Haptic *haptic;         /* Assosciated haptic. */
-} SDL_hapticlist[MAX_HAPTICS];
-
-
-/*
- * Haptic system hardware data.
- */
-struct haptic_hwdata
-{
-    int fd;                     /* File descriptor of the device. */
-    char *fname;                /* Points to the name in SDL_hapticlist. */
-};
-
-
-/*
- * Haptic system effect data.
- */
-struct haptic_hweffect
-{
-    struct ff_effect effect;    /* The linux kernel effect structure. */
-};
-
-
-
-#define test_bit(nr, addr) \
-   (((1UL << ((nr) & 31)) & (((const unsigned int *) addr)[(nr) >> 5])) != 0)
-#define EV_TEST(ev,f) \
-   if (test_bit((ev), features)) ret |= (f);
-/*
- * Test whether a device has haptic properties.
- * Returns available properties or 0 if there are none.
- */
-static int
-EV_IsHaptic(int fd)
-{
-    unsigned int ret;
-    unsigned long features[1 + FF_MAX / sizeof(unsigned long)];
-
-    /* Ask device for what it has. */
-    ret = 0;
-    if (ioctl(fd, EVIOCGBIT(EV_FF, sizeof(features)), features) < 0) {
-        return SDL_SetError("Haptic: Unable to get device's features: %s",
-                            strerror(errno));
-    }
-
-    /* Convert supported features to SDL_HAPTIC platform-neutral features. */
-    EV_TEST(FF_CONSTANT, SDL_HAPTIC_CONSTANT);
-    EV_TEST(FF_SINE, SDL_HAPTIC_SINE);
-    /* !!! FIXME: put this back when we have more bits in 2.1 */
-    /* EV_TEST(FF_SQUARE, SDL_HAPTIC_SQUARE); */
-    EV_TEST(FF_TRIANGLE, SDL_HAPTIC_TRIANGLE);
-    EV_TEST(FF_SAW_UP, SDL_HAPTIC_SAWTOOTHUP);
-    EV_TEST(FF_SAW_DOWN, SDL_HAPTIC_SAWTOOTHDOWN);
-    EV_TEST(FF_RAMP, SDL_HAPTIC_RAMP);
-    EV_TEST(FF_SPRING, SDL_HAPTIC_SPRING);
-    EV_TEST(FF_FRICTION, SDL_HAPTIC_FRICTION);
-    EV_TEST(FF_DAMPER, SDL_HAPTIC_DAMPER);
-    EV_TEST(FF_INERTIA, SDL_HAPTIC_INERTIA);
-    EV_TEST(FF_CUSTOM, SDL_HAPTIC_CUSTOM);
-    EV_TEST(FF_GAIN, SDL_HAPTIC_GAIN);
-    EV_TEST(FF_AUTOCENTER, SDL_HAPTIC_AUTOCENTER);
-    EV_TEST(FF_RUMBLE, SDL_HAPTIC_LEFTRIGHT);
-
-    /* Return what it supports. */
-    return ret;
-}
-
-
-/*
- * Tests whether a device is a mouse or not.
- */
-static int
-EV_IsMouse(int fd)
-{
-    unsigned long argp[40];
-
-    /* Ask for supported features. */
-    if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(argp)), argp) < 0) {
-        return -1;
-    }
-
-    /* Currently we only test for BTN_MOUSE which can give fake positives. */
-    if (test_bit(BTN_MOUSE, argp) != 0) {
-        return 1;
-    }
-
-    return 0;
-}
-
-/*
- * Initializes the haptic subsystem by finding available devices.
- */
-int
-SDL_SYS_HapticInit(void)
-{
-    const char joydev_pattern[] = "/dev/input/event%d";
-    dev_t dev_nums[MAX_HAPTICS];
-    char path[PATH_MAX];
-    struct stat sb;
-    int fd;
-    int i, j, k;
-    int duplicate;
-    int numhaptics;
-
-    numhaptics = 0;
-
-    /*
-     * Limit amount of checks to MAX_HAPTICS since we may or may not have
-     * permission to some or all devices.
-     */
-    i = 0;
-    for (j = 0; j < MAX_HAPTICS; ++j) {
-
-        snprintf(path, PATH_MAX, joydev_pattern, i++);
-
-        /* check to see if file exists */
-        if (stat(path, &sb) != 0)
-            break;
-
-        /* check for duplicates */
-        duplicate = 0;
-        for (k = 0; (k < numhaptics) && !duplicate; ++k) {
-            if (sb.st_rdev == dev_nums[k]) {
-                duplicate = 1;
-            }
-        }
-        if (duplicate) {
-            continue;
-        }
-
-        /* try to open */
-        fd = open(path, O_RDWR, 0);
-        if (fd < 0)
-            continue;
-
-#ifdef DEBUG_INPUT_EVENTS
-        printf("Checking %s\n", path);
-#endif
-
-        /* see if it works */
-        if (EV_IsHaptic(fd) > 0) {
-            SDL_hapticlist[numhaptics].fname = SDL_strdup(path);
-            SDL_hapticlist[numhaptics].haptic = NULL;
-            dev_nums[numhaptics] = sb.st_rdev;
-            ++numhaptics;
-        }
-        close(fd);
-    }
-
-    return numhaptics;
-}
-
-
-/*
- * Gets the name from a file descriptor.
- */
-static const char *
-SDL_SYS_HapticNameFromFD(int fd)
-{
-    static char namebuf[128];
-
-    /* We use the evdev name ioctl. */
-    if (ioctl(fd, EVIOCGNAME(sizeof(namebuf)), namebuf) <= 0) {
-        return NULL;
-    }
-
-    return namebuf;
-}
-
-
-/*
- * Return the name of a haptic device, does not need to be opened.
- */
-const char *
-SDL_SYS_HapticName(int index)
-{
-    int fd;
-    const char *name;
-
-    /* Open the haptic device. */
-    name = NULL;
-    fd = open(SDL_hapticlist[index].fname, O_RDONLY, 0);
-
-    if (fd >= 0) {
-
-        name = SDL_SYS_HapticNameFromFD(fd);
-        if (name == NULL) {
-            /* No name found, return device character device */
-            name = SDL_hapticlist[index].fname;
-        }
-    }
-    close(fd);
-
-    return name;
-}
-
-
-/*
- * Opens the haptic device from the file descriptor.
- */
-static int
-SDL_SYS_HapticOpenFromFD(SDL_Haptic * haptic, int fd)
-{
-    /* Allocate the hwdata */
-    haptic->hwdata = (struct haptic_hwdata *)
-        SDL_malloc(sizeof(*haptic->hwdata));
-    if (haptic->hwdata == NULL) {
-        SDL_OutOfMemory();
-        goto open_err;
-    }
-    SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
-
-    /* Set the data. */
-    haptic->hwdata->fd = fd;
-    haptic->supported = EV_IsHaptic(fd);
-    haptic->naxes = 2;          /* Hardcoded for now, not sure if it's possible to find out. */
-
-    /* Set the effects */
-    if (ioctl(fd, EVIOCGEFFECTS, &haptic->neffects) < 0) {
-        SDL_SetError("Haptic: Unable to query device memory: %s",
-                     strerror(errno));
-        goto open_err;
-    }
-    haptic->nplaying = haptic->neffects;        /* Linux makes no distinction. */
-    haptic->effects = (struct haptic_effect *)
-        SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects);
-    if (haptic->effects == NULL) {
-        SDL_OutOfMemory();
-        goto open_err;
-    }
-    /* Clear the memory */
-    SDL_memset(haptic->effects, 0,
-               sizeof(struct haptic_effect) * haptic->neffects);
-
-    return 0;
-
-    /* Error handling */
-  open_err:
-    close(fd);
-    if (haptic->hwdata != NULL) {
-        free(haptic->hwdata);
-        haptic->hwdata = NULL;
-    }
-    return -1;
-}
-
-
-/*
- * Opens a haptic device for usage.
- */
-int
-SDL_SYS_HapticOpen(SDL_Haptic * haptic)
-{
-    int fd;
-    int ret;
-
-    /* Open the character device */
-    fd = open(SDL_hapticlist[haptic->index].fname, O_RDWR, 0);
-    if (fd < 0) {
-        return SDL_SetError("Haptic: Unable to open %s: %s",
-                            SDL_hapticlist[haptic->index], strerror(errno));
-    }
-
-    /* Try to create the haptic. */
-    ret = SDL_SYS_HapticOpenFromFD(haptic, fd); /* Already closes on error. */
-    if (ret < 0) {
-        return -1;
-    }
-
-    /* Set the fname. */
-    haptic->hwdata->fname = SDL_hapticlist[haptic->index].fname;
-    return 0;
-}
-
-
-/*
- * Opens a haptic device from first mouse it finds for usage.
- */
-int
-SDL_SYS_HapticMouse(void)
-{
-    int fd;
-    int i;
-
-    for (i = 0; i < SDL_numhaptics; i++) {
-
-        /* Open the device. */
-        fd = open(SDL_hapticlist[i].fname, O_RDWR, 0);
-        if (fd < 0) {
-            return SDL_SetError("Haptic: Unable to open %s: %s",
-                                SDL_hapticlist[i], strerror(errno));
-        }
-
-        /* Is it a mouse? */
-        if (EV_IsMouse(fd)) {
-            close(fd);
-            return i;
-        }
-
-        close(fd);
-    }
-
-    return -1;
-}
-
-
-/*
- * Checks to see if a joystick has haptic features.
- */
-int
-SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
-{
-    return EV_IsHaptic(joystick->hwdata->fd);
-}
-
-
-/*
- * Checks to see if the haptic device and joystick are in reality the same.
- */
-int
-SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
-{
-    /* We are assuming Linux is using evdev which should trump the old
-     * joystick methods. */
-    if (SDL_strcmp(joystick->hwdata->fname, haptic->hwdata->fname) == 0) {
-        return 1;
-    }
-    return 0;
-}
-
-
-/*
- * Opens a SDL_Haptic from a SDL_Joystick.
- */
-int
-SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
-{
-    int i;
-    int fd;
-    int ret;
-
-
-    /* Find the joystick in the haptic list. */
-    for (i = 0; i < MAX_HAPTICS; i++) {
-        if (SDL_hapticlist[i].fname != NULL) {
-            if (SDL_strcmp(SDL_hapticlist[i].fname, joystick->hwdata->fname)
-                == 0) {
-                haptic->index = i;
-                break;
-            }
-        }
-    }
-    if (i >= MAX_HAPTICS) {
-        return SDL_SetError("Haptic: Joystick doesn't have Haptic capabilities");
-    }
-
-    fd = open(joystick->hwdata->fname, O_RDWR, 0);
-    if (fd < 0) {
-        return SDL_SetError("Haptic: Unable to open %s: %s",
-                            joystick->hwdata->fname, strerror(errno));
-    }
-    ret = SDL_SYS_HapticOpenFromFD(haptic, fd); /* Already closes on error. */
-    if (ret < 0) {
-        return -1;
-    }
-
-    haptic->hwdata->fname = SDL_hapticlist[haptic->index].fname;
-    return 0;
-}
-
-
-/*
- * Closes the haptic device.
- */
-void
-SDL_SYS_HapticClose(SDL_Haptic * haptic)
-{
-    if (haptic->hwdata) {
-
-        /* Free effects. */
-        SDL_free(haptic->effects);
-        haptic->effects = NULL;
-        haptic->neffects = 0;
-
-        /* Clean up */
-        close(haptic->hwdata->fd);
-
-        /* Free */
-        SDL_free(haptic->hwdata);
-        haptic->hwdata = NULL;
-    }
-
-    /* Clear the rest. */
-    SDL_memset(haptic, 0, sizeof(SDL_Haptic));
-}
-
-
-/*
- * Clean up after system specific haptic stuff
- */
-void
-SDL_SYS_HapticQuit(void)
-{
-    int i;
-
-    for (i = 0; SDL_hapticlist[i].fname != NULL; i++) {
-        /* Opened and not closed haptics are leaked, this is on purpose.
-         * Close your haptic devices after usage. */
-
-        SDL_free(SDL_hapticlist[i].fname);
-    }
-    SDL_hapticlist[0].fname = NULL;
-}
-
-
-/*
- * Converts an SDL button to a ff_trigger button.
- */
-static Uint16
-SDL_SYS_ToButton(Uint16 button)
-{
-    Uint16 ff_button;
-
-    ff_button = 0;
-
-    /*
-     * Not sure what the proper syntax is because this actually isn't implemented
-     * in the current kernel from what I've seen (2.6.26).
-     */
-    if (button != 0) {
-        ff_button = BTN_GAMEPAD + button - 1;
-    }
-
-    return ff_button;
-}
-
-
-/*
- * Returns the ff_effect usable direction from a SDL_HapticDirection.
- */
-static Uint16
-SDL_SYS_ToDirection(SDL_HapticDirection * dir)
-{
-    Uint32 tmp;
-    float f;                    /* Ideally we'd use fixed point math instead of floats... */
-
-    switch (dir->type) {
-    case SDL_HAPTIC_POLAR:
-        /* Linux directions start from south.
-                (and range from 0 to 0xFFFF)
-                   Quoting include/linux/input.h, line 926:
-                   Direction of the effect is encoded as follows:
-                        0 deg -> 0x0000 (down)
-                        90 deg -> 0x4000 (left)
-                        180 deg -> 0x8000 (up)
-                        270 deg -> 0xC000 (right)
-                    */
-        tmp = (((18000 + dir->dir[0]) % 36000) * 0xFFFF) / 36000; /* convert to range [0,0xFFFF] */
-        return (Uint16) tmp;
-
-       case SDL_HAPTIC_SPHERICAL:
-            /*
-                We convert to polar, because that's the only supported direction on Linux.
-                The first value of a spherical direction is practically the same as a
-                Polar direction, except that we have to add 90 degrees. It is the angle
-                from EAST {1,0} towards SOUTH {0,1}.
-                --> add 9000
-                --> finally add 18000 and convert to [0,0xFFFF] as in case SDL_HAPTIC_POLAR.
-            */
-            tmp = ((dir->dir[0]) + 9000) % 36000;    /* Convert to polars */
-        tmp = (((18000 + tmp) % 36000) * 0xFFFF) / 36000; /* convert to range [0,0xFFFF] */
-        return (Uint16) tmp;
-
-    case SDL_HAPTIC_CARTESIAN:
-        f = atan2(dir->dir[1], dir->dir[0]);
-                    /*
-                      atan2 takes the parameters: Y-axis-value and X-axis-value (in that order)
-                       - Y-axis-value is the second coordinate (from center to SOUTH)
-                       - X-axis-value is the first coordinate (from center to EAST)
-                        We add 36000, because atan2 also returns negative values. Then we practically
-                        have the first spherical value. Therefore we proceed as in case
-                        SDL_HAPTIC_SPHERICAL and add another 9000 to get the polar value.
-                      --> add 45000 in total
-                      --> finally add 18000 and convert to [0,0xFFFF] as in case SDL_HAPTIC_POLAR.
-                    */
-                tmp = (((int) (f * 18000. / M_PI)) + 45000) % 36000;
-        tmp = (((18000 + tmp) % 36000) * 0xFFFF) / 36000; /* convert to range [0,0xFFFF] */
-        return (Uint16) tmp;
-
-    default:
-        return (Uint16) SDL_SetError("Haptic: Unsupported direction type.");
-    }
-
-    return 0;
-}
-
-
-#define  CLAMP(x)    (((x) > 32767) ? 32767 : x)
-/*
- * Initializes the Linux effect struct from a haptic_effect.
- * Values above 32767 (for unsigned) are unspecified so we must clamp.
- */
-static int
-SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src)
-{
-    Uint32 tmp;
-    SDL_HapticConstant *constant;
-    SDL_HapticPeriodic *periodic;
-    SDL_HapticCondition *condition;
-    SDL_HapticRamp *ramp;
-    SDL_HapticLeftRight *leftright;
-
-    /* Clear up */
-    SDL_memset(dest, 0, sizeof(struct ff_effect));
-
-    switch (src->type) {
-    case SDL_HAPTIC_CONSTANT:
-        constant = &src->constant;
-
-        /* Header */
-        dest->type = FF_CONSTANT;
-        dest->direction = SDL_SYS_ToDirection(&constant->direction);
-        if (dest->direction == (Uint16) - 1)
-            return -1;
-
-        /* Replay */
-        dest->replay.length = (constant->length == SDL_HAPTIC_INFINITY) ?
-            0 : CLAMP(constant->length);
-        dest->replay.delay = CLAMP(constant->delay);
-
-        /* Trigger */
-        dest->trigger.button = SDL_SYS_ToButton(constant->button);
-        dest->trigger.interval = CLAMP(constant->interval);
-
-        /* Constant */
-        dest->u.constant.level = constant->level;
-
-        /* Envelope */
-        dest->u.constant.envelope.attack_length =
-            CLAMP(constant->attack_length);
-        dest->u.constant.envelope.attack_level =
-            CLAMP(constant->attack_level);
-        dest->u.constant.envelope.fade_length = CLAMP(constant->fade_length);
-        dest->u.constant.envelope.fade_level = CLAMP(constant->fade_level);
-
-        break;
-
-    case SDL_HAPTIC_SINE:
-    /* !!! FIXME: put this back when we have more bits in 2.1 */
-    /* case SDL_HAPTIC_SQUARE: */
-    case SDL_HAPTIC_TRIANGLE:
-    case SDL_HAPTIC_SAWTOOTHUP:
-    case SDL_HAPTIC_SAWTOOTHDOWN:
-        periodic = &src->periodic;
-
-        /* Header */
-        dest->type = FF_PERIODIC;
-        dest->direction = SDL_SYS_ToDirection(&periodic->direction);
-        if (dest->direction == (Uint16) - 1)
-            return -1;
-
-        /* Replay */
-        dest->replay.length = (periodic->length == SDL_HAPTIC_INFINITY) ?
-            0 : CLAMP(periodic->length);
-        dest->replay.delay = CLAMP(periodic->delay);
-
-        /* Trigger */
-        dest->trigger.button = SDL_SYS_ToButton(periodic->button);
-        dest->trigger.interval = CLAMP(periodic->interval);
-
-        /* Periodic */
-        if (periodic->type == SDL_HAPTIC_SINE)
-            dest->u.periodic.waveform = FF_SINE;
-        /* !!! FIXME: put this back when we have more bits in 2.1 */
-        /* else if (periodic->type == SDL_HAPTIC_SQUARE)
-            dest->u.periodic.waveform = FF_SQUARE; */
-        else if (periodic->type == SDL_HAPTIC_TRIANGLE)
-            dest->u.periodic.waveform = FF_TRIANGLE;
-        else if (periodic->type == SDL_HAPTIC_SAWTOOTHUP)
-            dest->u.periodic.waveform = FF_SAW_UP;
-        else if (periodic->type == SDL_HAPTIC_SAWTOOTHDOWN)
-            dest->u.periodic.waveform = FF_SAW_DOWN;
-        dest->u.periodic.period = CLAMP(periodic->period);
-        dest->u.periodic.magnitude = periodic->magnitude;
-        dest->u.periodic.offset = periodic->offset;
-        /* Phase is calculated based of offset from period and then clamped. */
-        tmp = ((periodic->phase % 36000) * dest->u.periodic.period) / 36000;
-        dest->u.periodic.phase = CLAMP(tmp);
-
-        /* Envelope */
-        dest->u.periodic.envelope.attack_length =
-            CLAMP(periodic->attack_length);
-        dest->u.periodic.envelope.attack_level =
-            CLAMP(periodic->attack_level);
-        dest->u.periodic.envelope.fade_length = CLAMP(periodic->fade_length);
-        dest->u.periodic.envelope.fade_level = CLAMP(periodic->fade_level);
-
-        break;
-
-    case SDL_HAPTIC_SPRING:
-    case SDL_HAPTIC_DAMPER:
-    case SDL_HAPTIC_INERTIA:
-    case SDL_HAPTIC_FRICTION:
-        condition = &src->condition;
-
-        /* Header */
-        if (condition->type == SDL_HAPTIC_SPRING)
-            dest->type = FF_SPRING;
-        else if (condition->type == SDL_HAPTIC_DAMPER)
-            dest->type = FF_DAMPER;
-        else if (condition->type == SDL_HAPTIC_INERTIA)
-            dest->type = FF_INERTIA;
-        else if (condition->type == SDL_HAPTIC_FRICTION)
-            dest->type = FF_FRICTION;
-        dest->direction = 0;    /* Handled by the condition-specifics. */
-
-        /* Replay */
-        dest->replay.length = (condition->length == SDL_HAPTIC_INFINITY) ?
-            0 : CLAMP(condition->length);
-        dest->replay.delay = CLAMP(condition->delay);
-
-        /* Trigger */
-        dest->trigger.button = SDL_SYS_ToButton(condition->button);
-        dest->trigger.interval = CLAMP(condition->interval);
-
-        /* Condition */
-        /* X axis */
-        dest->u.condition[0].right_saturation =
-            CLAMP(condition->right_sat[0]);
-        dest->u.condition[0].left_saturation = CLAMP(condition->left_sat[0]);
-        dest->u.condition[0].right_coeff = condition->right_coeff[0];
-        dest->u.condition[0].left_coeff = condition->left_coeff[0];
-        dest->u.condition[0].deadband = CLAMP(condition->deadband[0]);
-        dest->u.condition[0].center = condition->center[0];
-        /* Y axis */
-        dest->u.condition[1].right_saturation =
-            CLAMP(condition->right_sat[1]);
-        dest->u.condition[1].left_saturation = CLAMP(condition->left_sat[1]);
-        dest->u.condition[1].right_coeff = condition->right_coeff[1];
-        dest->u.condition[1].left_coeff = condition->left_coeff[1];
-        dest->u.condition[1].deadband = CLAMP(condition->deadband[1]);
-        dest->u.condition[1].center = condition->center[1];
-
-        /*
-         * There is no envelope in the linux force feedback api for conditions.
-         */
-
-        break;
-
-    case SDL_HAPTIC_RAMP:
-        ramp = &src->ramp;
-
-        /* Header */
-        dest->type = FF_RAMP;
-        dest->direction = SDL_SYS_ToDirection(&ramp->direction);
-        if (dest->direction == (Uint16) - 1)
-            return -1;
-
-        /* Replay */
-        dest->replay.length = (ramp->length == SDL_HAPTIC_INFINITY) ?
-            0 : CLAMP(ramp->length);
-        dest->replay.delay = CLAMP(ramp->delay);
-
-        /* Trigger */
-        dest->trigger.button = SDL_SYS_ToButton(ramp->button);
-        dest->trigger.interval = CLAMP(ramp->interval);
-
-        /* Ramp */
-        dest->u.ramp.start_level = ramp->start;
-        dest->u.ramp.end_level = ramp->end;
-
-        /* Envelope */
-        dest->u.ramp.envelope.attack_length = CLAMP(ramp->attack_length);
-        dest->u.ramp.envelope.attack_level = CLAMP(ramp->attack_level);
-        dest->u.ramp.envelope.fade_length = CLAMP(ramp->fade_length);
-        dest->u.ramp.envelope.fade_level = CLAMP(ramp->fade_level);
-
-        break;
-
-    case SDL_HAPTIC_LEFTRIGHT:
-        leftright = &src->leftright;
-
-        /* Header */
-        dest->type = FF_RUMBLE;
-        dest->direction = 0;
-
-        /* Replay */
-        dest->replay.length = (leftright->length == SDL_HAPTIC_INFINITY) ?
-            0 : CLAMP(leftright->length);
-
-        /* Trigger */
-        dest->trigger.button = 0;
-        dest->trigger.interval = 0;
-
-        /* Rumble */
-        dest->u.rumble.strong_magnitude = leftright->large_magnitude;
-        dest->u.rumble.weak_magnitude = leftright->small_magnitude;
-
-	break;
-
-
-    default:
-        return SDL_SetError("Haptic: Unknown effect type.");
-    }
-
-    return 0;
-}
-
-
-/*
- * Creates a new haptic effect.
- */
-int
-SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
-                        SDL_HapticEffect * base)
-{
-    struct ff_effect *linux_effect;
-
-    /* Allocate the hardware effect */
-    effect->hweffect = (struct haptic_hweffect *)
-        SDL_malloc(sizeof(struct haptic_hweffect));
-    if (effect->hweffect == NULL) {
-        return SDL_OutOfMemory();
-    }
-
-    /* Prepare the ff_effect */
-    linux_effect = &effect->hweffect->effect;
-    if (SDL_SYS_ToFFEffect(linux_effect, base) != 0) {
-        goto new_effect_err;
-    }
-    linux_effect->id = -1;      /* Have the kernel give it an id */
-
-    /* Upload the effect */
-    if (ioctl(haptic->hwdata->fd, EVIOCSFF, linux_effect) < 0) {
-        SDL_SetError("Haptic: Error uploading effect to the device: %s",
-                     strerror(errno));
-        goto new_effect_err;
-    }
-
-    return 0;
-
-  new_effect_err:
-    free(effect->hweffect);
-    effect->hweffect = NULL;
-    return -1;
-}
-
-
-/*
- * Updates an effect.
- *
- * Note: Dynamically updating the direction can in some cases force
- * the effect to restart and run once.
- */
-int
-SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic,
-                           struct haptic_effect *effect,
-                           SDL_HapticEffect * data)
-{
-    struct ff_effect linux_effect;
-
-    /* Create the new effect */
-    if (SDL_SYS_ToFFEffect(&linux_effect, data) != 0) {
-        return -1;
-    }
-    linux_effect.id = effect->hweffect->effect.id;
-
-    /* See if it can be uploaded. */
-    if (ioctl(haptic->hwdata->fd, EVIOCSFF, &linux_effect) < 0) {
-        return SDL_SetError("Haptic: Error updating the effect: %s",
-                            strerror(errno));
-    }
-
-    /* Copy the new effect into memory. */
-    SDL_memcpy(&effect->hweffect->effect, &linux_effect,
-               sizeof(struct ff_effect));
-
-    return effect->hweffect->effect.id;
-}
-
-
-/*
- * Runs an effect.
- */
-int
-SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
-                        Uint32 iterations)
-{
-    struct input_event run;
-
-    /* Prepare to run the effect */
-    run.type = EV_FF;
-    run.code = effect->hweffect->effect.id;
-    /* We don't actually have infinity here, so we just do INT_MAX which is pretty damn close. */
-    run.value = (iterations > INT_MAX) ? INT_MAX : iterations;
-
-    if (write(haptic->hwdata->fd, (const void *) &run, sizeof(run)) < 0) {
-        return SDL_SetError("Haptic: Unable to run the effect: %s", strerror(errno));
-    }
-
-    return 0;
-}
-
-
-/*
- * Stops an effect.
- */
-int
-SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
-{
-    struct input_event stop;
-
-    stop.type = EV_FF;
-    stop.code = effect->hweffect->effect.id;
-    stop.value = 0;
-
-    if (write(haptic->hwdata->fd, (const void *) &stop, sizeof(stop)) < 0) {
-        return SDL_SetError("Haptic: Unable to stop the effect: %s",
-                            strerror(errno));
-    }
-
-    return 0;
-}
-
-
-/*
- * Frees the effect.
- */
-void
-SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
-{
-    if (ioctl(haptic->hwdata->fd, EVIOCRMFF, effect->hweffect->effect.id) < 0) {
-        SDL_SetError("Haptic: Error removing the effect from the device: %s",
-                     strerror(errno));
-    }
-    SDL_free(effect->hweffect);
-    effect->hweffect = NULL;
-}
-
-
-/*
- * Gets the status of a haptic effect.
- */
-int
-SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic,
-                              struct haptic_effect *effect)
-{
-#if 0                           /* Not supported atm. */
-    struct input_event ie;
-
-    ie.type = EV_FF;
-    ie.type = EV_FF_STATUS;
-    ie.code = effect->hweffect->effect.id;
-
-    if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) {
-        return SDL_SetError("Haptic: Error getting device status.");
-    }
-
-    return 0;
-#endif
-
-    return -1;
-}
-
-
-/*
- * Sets the gain.
- */
-int
-SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain)
-{
-    struct input_event ie;
-
-    ie.type = EV_FF;
-    ie.code = FF_GAIN;
-    ie.value = (0xFFFFUL * gain) / 100;
-
-    if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) {
-        return SDL_SetError("Haptic: Error setting gain: %s", strerror(errno));
-    }
-
-    return 0;
-}
-
-
-/*
- * Sets the autocentering.
- */
-int
-SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
-{
-    struct input_event ie;
-
-    ie.type = EV_FF;
-    ie.code = FF_AUTOCENTER;
-    ie.value = (0xFFFFUL * autocenter) / 100;
-
-    if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) {
-        return SDL_SetError("Haptic: Error setting autocenter: %s", strerror(errno));
-    }
-
-    return 0;
-}
-
-
-/*
- * Pausing is not supported atm by linux.
- */
-int
-SDL_SYS_HapticPause(SDL_Haptic * haptic)
-{
-    return -1;
-}
-
-
-/*
- * Unpausing is not supported atm by linux.
- */
-int
-SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
-{
-    return -1;
-}
-
-
-/*
- * Stops all the currently playing effects.
- */
-int
-SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
-{
-    int i, ret;
-
-    /* Linux does not support this natively so we have to loop. */
-    for (i = 0; i < haptic->neffects; i++) {
-        if (haptic->effects[i].hweffect != NULL) {
-            ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]);
-            if (ret < 0) {
-                return SDL_SetError
-                    ("Haptic: Error while trying to stop all playing effects.");
-            }
-        }
-    }
-    return 0;
-}
-
-
-#endif /* SDL_HAPTIC_LINUX */
diff --git a/deps/SDL2/src/haptic/windows/SDL_syshaptic.c b/deps/SDL2/src/haptic/windows/SDL_syshaptic.c
deleted file mode 100644
index 1506235..0000000
--- a/deps/SDL2/src/haptic/windows/SDL_syshaptic.c
+++ /dev/null
@@ -1,1584 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_HAPTIC_DINPUT
-
-#include "SDL_assert.h"
-#include "SDL_thread.h"
-#include "SDL_mutex.h"
-#include "SDL_timer.h"
-#include "SDL_hints.h"
-#include "SDL_haptic.h"
-#include "../SDL_syshaptic.h"
-#include "SDL_joystick.h"
-#include "../../joystick/SDL_sysjoystick.h"     /* For the real SDL_Joystick */
-#include "../../joystick/windows/SDL_dxjoystick_c.h"      /* For joystick hwdata */
-
-#define MAX_HAPTICS  32
-
-/*
- * List of available haptic devices.
- */
-static struct
-{
-    DIDEVICEINSTANCE instance;
-    char *name;
-    SDL_Haptic *haptic;
-    DIDEVCAPS capabilities;
-    Uint8 bXInputHaptic; /* Supports force feedback via XInput. */
-    Uint8 userid; /* XInput userid index for this joystick */
-} SDL_hapticlist[MAX_HAPTICS];
-
-
-/*
- * Haptic system hardware data.
- */
-struct haptic_hwdata
-{
-    LPDIRECTINPUTDEVICE8 device;
-    DWORD axes[3];              /* Axes to use. */
-    SDL_bool is_joystick;       /* Device is loaded as joystick. */
-    Uint8 bXInputHaptic; /* Supports force feedback via XInput. */
-    Uint8 userid; /* XInput userid index for this joystick */
-    SDL_Thread *thread;
-    SDL_mutex *mutex;
-    volatile Uint32 stopTicks;
-    volatile int stopThread;
-};
-
-
-/*
- * Haptic system effect data.
- */
-struct haptic_hweffect
-{
-    DIEFFECT effect;
-    LPDIRECTINPUTEFFECT ref;
-    XINPUT_VIBRATION vibration;
-};
-
-
-/*
- * Internal stuff.
- */
-static SDL_bool coinitialized = SDL_FALSE;
-static LPDIRECTINPUT8 dinput = NULL;
-static SDL_bool loaded_xinput = SDL_FALSE;
-
-
-/*
- * External stuff.
- */
-extern HWND SDL_HelperWindow;
-
-
-/*
- * Prototypes.
- */
-static int DI_SetError(const char *str, HRESULT err);
-static int DI_GUIDIsSame(const GUID * a, const GUID * b);
-static int SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic,
-                                          DIDEVICEINSTANCE instance);
-static int SDL_SYS_HapticOpenFromDevice8(SDL_Haptic * haptic,
-                                         LPDIRECTINPUTDEVICE8 device8,
-                                         SDL_bool is_joystick);
-static int SDL_SYS_HapticOpenFromXInput(SDL_Haptic * haptic, Uint8 userid);
-static DWORD DIGetTriggerButton(Uint16 button);
-static int SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir,
-                                int naxes);
-static int SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest,
-                              SDL_HapticEffect * src);
-static void SDL_SYS_HapticFreeDIEFFECT(DIEFFECT * effect, int type);
-static REFGUID SDL_SYS_HapticEffectType(SDL_HapticEffect * effect);
-static int SDLCALL SDL_RunXInputHaptic(void *arg);
-
-/* Callbacks. */
-static BOOL CALLBACK EnumHapticsCallback(const DIDEVICEINSTANCE *
-                                         pdidInstance, VOID * pContext);
-static BOOL CALLBACK DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv);
-
-
-/*
- * Like SDL_SetError but for DX error codes.
- */
-static int
-DI_SetError(const char *str, HRESULT err)
-{
-    /*
-       SDL_SetError("Haptic: %s - %s: %s", str,
-       DXGetErrorString8A(err), DXGetErrorDescription8A(err));
-     */
-    return SDL_SetError("Haptic error %s", str);
-}
-
-
-/*
- * Checks to see if two GUID are the same.
- */
-static int
-DI_GUIDIsSame(const GUID * a, const GUID * b)
-{
-    return (SDL_memcmp(a, b, sizeof (GUID)) == 0);
-}
-
-
-/*
- * Initializes the haptic subsystem.
- */
-int
-SDL_SYS_HapticInit(void)
-{
-    const char *env = SDL_GetHint(SDL_HINT_XINPUT_ENABLED);
-    HRESULT ret;
-    HINSTANCE instance;
-
-    if (dinput != NULL) {       /* Already open. */
-        return SDL_SetError("Haptic: SubSystem already open.");
-    }
-
-    /* Clear all the memory. */
-    SDL_memset(SDL_hapticlist, 0, sizeof(SDL_hapticlist));
-
-    SDL_numhaptics = 0;
-
-    ret = WIN_CoInitialize();
-    if (FAILED(ret)) {
-        return DI_SetError("Coinitialize", ret);
-    }
-
-    coinitialized = SDL_TRUE;
-
-    ret = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER,
-                           &IID_IDirectInput8, (LPVOID) & dinput);
-    if (FAILED(ret)) {
-        SDL_SYS_HapticQuit();
-        return DI_SetError("CoCreateInstance", ret);
-    }
-
-    /* Because we used CoCreateInstance, we need to Initialize it, first. */
-    instance = GetModuleHandle(NULL);
-    if (instance == NULL) {
-        SDL_SYS_HapticQuit();
-        return SDL_SetError("GetModuleHandle() failed with error code %d.",
-                            GetLastError());
-    }
-    ret = IDirectInput8_Initialize(dinput, instance, DIRECTINPUT_VERSION);
-    if (FAILED(ret)) {
-        SDL_SYS_HapticQuit();
-        return DI_SetError("Initializing DirectInput device", ret);
-    }
-
-    /* Look for haptic devices. */
-    ret = IDirectInput8_EnumDevices(dinput,
-                                   0,
-                                   EnumHapticsCallback,
-                                   NULL,
-                                   DIEDFL_FORCEFEEDBACK |
-                                   DIEDFL_ATTACHEDONLY);
-    if (FAILED(ret)) {
-        SDL_SYS_HapticQuit();
-        return DI_SetError("Enumerating DirectInput devices", ret);
-    }
-
-    if (!env || SDL_atoi(env)) {
-        loaded_xinput = (WIN_LoadXInputDLL() == 0);
-    }
-
-    if (loaded_xinput) {
-        DWORD i;
-        const SDL_bool bIs14OrLater = (SDL_XInputVersion >= ((1<<16)|4));
-
-        for (i = 0; (i < SDL_XINPUT_MAX_DEVICES) && (SDL_numhaptics < MAX_HAPTICS); i++) {
-            XINPUT_CAPABILITIES caps;
-            if (XINPUTGETCAPABILITIES(i, XINPUT_FLAG_GAMEPAD, &caps) == ERROR_SUCCESS) {
-                if ((!bIs14OrLater) || (caps.Flags & XINPUT_CAPS_FFB_SUPPORTED)) {
-                    /* !!! FIXME: I'm not bothering to query for a real name right now. */
-                    char buf[64];
-                    SDL_snprintf(buf, sizeof (buf), "XInput Controller #%u", i+1);
-                    SDL_hapticlist[SDL_numhaptics].name = SDL_strdup(buf);
-                    SDL_hapticlist[SDL_numhaptics].bXInputHaptic = 1;
-                    SDL_hapticlist[SDL_numhaptics].userid = (Uint8) i;
-                    SDL_numhaptics++;
-                }
-            }
-        }
-    }
-
-    return SDL_numhaptics;
-}
-
-/*
- * Callback to find the haptic devices.
- */
-static BOOL CALLBACK
-EnumHapticsCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext)
-{
-    HRESULT ret;
-    LPDIRECTINPUTDEVICE8 device;
-
-    /* Copy the instance over, useful for creating devices. */
-    SDL_memcpy(&SDL_hapticlist[SDL_numhaptics].instance, pdidInstance,
-               sizeof(DIDEVICEINSTANCE));
-
-    /* Open the device */
-    ret = IDirectInput8_CreateDevice(dinput, &pdidInstance->guidInstance,
-                                    &device, NULL);
-    if (FAILED(ret)) {
-        /* DI_SetError("Creating DirectInput device",ret); */
-        return DIENUM_CONTINUE;
-    }
-
-    /* Get capabilities. */
-    SDL_hapticlist[SDL_numhaptics].capabilities.dwSize = sizeof(DIDEVCAPS);
-    ret = IDirectInputDevice8_GetCapabilities(device,
-                                             &SDL_hapticlist[SDL_numhaptics].
-                                             capabilities);
-    if (FAILED(ret)) {
-        /* DI_SetError("Getting device capabilities",ret); */
-        IDirectInputDevice8_Release(device);
-        return DIENUM_CONTINUE;
-    }
-
-    /* Copy the name */
-    SDL_hapticlist[SDL_numhaptics].name = WIN_StringToUTF8(SDL_hapticlist[SDL_numhaptics].instance.tszProductName);
-
-    /* Close up device and count it. */
-    IDirectInputDevice8_Release(device);
-    SDL_numhaptics++;
-
-    /* Watch out for hard limit. */
-    if (SDL_numhaptics >= MAX_HAPTICS)
-        return DIENUM_STOP;
-
-    return DIENUM_CONTINUE;
-}
-
-
-/*
- * Return the name of a haptic device, does not need to be opened.
- */
-const char *
-SDL_SYS_HapticName(int index)
-{
-    return SDL_hapticlist[index].name;
-}
-
-
-/*
- * Callback to get all supported effects.
- */
-#define EFFECT_TEST(e,s)               \
-if (DI_GUIDIsSame(&pei->guid, &(e)))   \
-   haptic->supported |= (s)
-static BOOL CALLBACK
-DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv)
-{
-    /* Prepare the haptic device. */
-    SDL_Haptic *haptic = (SDL_Haptic *) pv;
-
-    /* Get supported. */
-    EFFECT_TEST(GUID_Spring, SDL_HAPTIC_SPRING);
-    EFFECT_TEST(GUID_Damper, SDL_HAPTIC_DAMPER);
-    EFFECT_TEST(GUID_Inertia, SDL_HAPTIC_INERTIA);
-    EFFECT_TEST(GUID_Friction, SDL_HAPTIC_FRICTION);
-    EFFECT_TEST(GUID_ConstantForce, SDL_HAPTIC_CONSTANT);
-    EFFECT_TEST(GUID_CustomForce, SDL_HAPTIC_CUSTOM);
-    EFFECT_TEST(GUID_Sine, SDL_HAPTIC_SINE);
-    /* !!! FIXME: put this back when we have more bits in 2.1 */
-    /* EFFECT_TEST(GUID_Square, SDL_HAPTIC_SQUARE); */
-    EFFECT_TEST(GUID_Triangle, SDL_HAPTIC_TRIANGLE);
-    EFFECT_TEST(GUID_SawtoothUp, SDL_HAPTIC_SAWTOOTHUP);
-    EFFECT_TEST(GUID_SawtoothDown, SDL_HAPTIC_SAWTOOTHDOWN);
-    EFFECT_TEST(GUID_RampForce, SDL_HAPTIC_RAMP);
-
-    /* Check for more. */
-    return DIENUM_CONTINUE;
-}
-
-
-/*
- * Callback to get supported axes.
- */
-static BOOL CALLBACK
-DI_DeviceObjectCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef)
-{
-    SDL_Haptic *haptic = (SDL_Haptic *) pvRef;
-
-    if ((dev->dwType & DIDFT_AXIS) && (dev->dwFlags & DIDOI_FFACTUATOR)) {
-
-        haptic->hwdata->axes[haptic->naxes] = dev->dwOfs;
-        haptic->naxes++;
-
-        /* Currently using the artificial limit of 3 axes. */
-        if (haptic->naxes >= 3) {
-            return DIENUM_STOP;
-        }
-    }
-
-    return DIENUM_CONTINUE;
-}
-
-
-/*
- * Opens the haptic device from the file descriptor.
- *
- *    Steps:
- *       - Open temporary DirectInputDevice interface.
- *       - Create DirectInputDevice8 interface.
- *       - Release DirectInputDevice interface.
- *       - Call SDL_SYS_HapticOpenFromDevice8
- */
-static int
-SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, DIDEVICEINSTANCE instance)
-{
-    HRESULT ret;
-    int ret2;
-    LPDIRECTINPUTDEVICE8 device;
-    LPDIRECTINPUTDEVICE8 device8;
-
-    /* Open the device */
-    ret = IDirectInput8_CreateDevice(dinput, &instance.guidInstance,
-                                    &device, NULL);
-    if (FAILED(ret)) {
-        DI_SetError("Creating DirectInput device", ret);
-        return -1;
-    }
-
-    /* Now get the IDirectInputDevice8 interface, instead. */
-    ret = IDirectInputDevice8_QueryInterface(device,
-                                            &IID_IDirectInputDevice8,
-                                            (LPVOID *) &device8);
-    /* Done with the temporary one now. */
-    IDirectInputDevice8_Release(device);
-    if (FAILED(ret)) {
-        DI_SetError("Querying DirectInput interface", ret);
-        return -1;
-    }
-
-    ret2 = SDL_SYS_HapticOpenFromDevice8(haptic, device8, SDL_FALSE);
-    if (ret2 < 0) {
-        IDirectInputDevice8_Release(device8);
-        return -1;
-    }
-
-    return 0;
-}
-
-static int
-SDL_SYS_HapticOpenFromXInput(SDL_Haptic * haptic, Uint8 userid)
-{
-    char threadName[32];
-    XINPUT_VIBRATION vibration = { 0, 0 };  /* stop any current vibration */
-    XINPUTSETSTATE(userid, &vibration);
-
-    haptic->supported = SDL_HAPTIC_LEFTRIGHT;
-
-    haptic->neffects = 1;
-    haptic->nplaying = 1;
-
-    /* Prepare effects memory. */
-    haptic->effects = (struct haptic_effect *)
-        SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects);
-    if (haptic->effects == NULL) {
-        return SDL_OutOfMemory();
-    }
-    /* Clear the memory */
-    SDL_memset(haptic->effects, 0,
-               sizeof(struct haptic_effect) * haptic->neffects);
-
-    haptic->hwdata = (struct haptic_hwdata *) SDL_malloc(sizeof(*haptic->hwdata));
-    if (haptic->hwdata == NULL) {
-        SDL_free(haptic->effects);
-        haptic->effects = NULL;
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
-
-    haptic->hwdata->bXInputHaptic = 1;
-    haptic->hwdata->userid = userid;
-
-    haptic->hwdata->mutex = SDL_CreateMutex();
-    if (haptic->hwdata->mutex == NULL) {
-        SDL_free(haptic->effects);
-        SDL_free(haptic->hwdata);
-        haptic->effects = NULL;
-        return SDL_SetError("Couldn't create XInput haptic mutex");
-    }
-
-    SDL_snprintf(threadName, sizeof (threadName), "SDLXInputDev%d", (int) userid);
-
-#if defined(__WIN32__) && !defined(HAVE_LIBC)  /* !!! FIXME: this is nasty. */
-    #undef SDL_CreateThread
-    haptic->hwdata->thread = SDL_CreateThread(SDL_RunXInputHaptic, threadName, haptic->hwdata, NULL, NULL);
-#else
-    haptic->hwdata->thread = SDL_CreateThread(SDL_RunXInputHaptic, threadName, haptic->hwdata);
-#endif
-    if (haptic->hwdata->thread == NULL) {
-        SDL_DestroyMutex(haptic->hwdata->mutex);
-        SDL_free(haptic->effects);
-        SDL_free(haptic->hwdata);
-        haptic->effects = NULL;
-        return SDL_SetError("Couldn't create XInput haptic thread");
-    }
-
-    return 0;
- }
-
-/*
- * Opens the haptic device from the file descriptor.
- *
- *    Steps:
- *       - Set cooperative level.
- *       - Set data format.
- *       - Acquire exclusiveness.
- *       - Reset actuators.
- *       - Get supported features.
- */
-static int
-SDL_SYS_HapticOpenFromDevice8(SDL_Haptic * haptic,
-                              LPDIRECTINPUTDEVICE8 device8, SDL_bool is_joystick)
-{
-    HRESULT ret;
-    DIPROPDWORD dipdw;
-
-    /* Allocate the hwdata */
-    haptic->hwdata = (struct haptic_hwdata *)SDL_malloc(sizeof(*haptic->hwdata));
-    if (haptic->hwdata == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
-
-    /* We'll use the device8 from now on. */
-    haptic->hwdata->device = device8;
-    haptic->hwdata->is_joystick = is_joystick;
-
-    /* Grab it exclusively to use force feedback stuff. */
-    ret = IDirectInputDevice8_SetCooperativeLevel(haptic->hwdata->device,
-                                                  SDL_HelperWindow,
-                                                  DISCL_EXCLUSIVE |
-                                                  DISCL_BACKGROUND);
-    if (FAILED(ret)) {
-        DI_SetError("Setting cooperative level to exclusive", ret);
-        goto acquire_err;
-    }
-
-    /* Set data format. */
-    ret = IDirectInputDevice8_SetDataFormat(haptic->hwdata->device,
-                                            &c_dfDIJoystick2);
-    if (FAILED(ret)) {
-        DI_SetError("Setting data format", ret);
-        goto acquire_err;
-    }
-
-    /* Get number of axes. */
-    ret = IDirectInputDevice8_EnumObjects(haptic->hwdata->device,
-                                          DI_DeviceObjectCallback,
-                                          haptic, DIDFT_AXIS);
-    if (FAILED(ret)) {
-        DI_SetError("Getting device axes", ret);
-        goto acquire_err;
-    }
-
-    /* Acquire the device. */
-    ret = IDirectInputDevice8_Acquire(haptic->hwdata->device);
-    if (FAILED(ret)) {
-        DI_SetError("Acquiring DirectInput device", ret);
-        goto acquire_err;
-    }
-
-    /* Reset all actuators - just in case. */
-    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
-                                                       DISFFC_RESET);
-    if (FAILED(ret)) {
-        DI_SetError("Resetting device", ret);
-        goto acquire_err;
-    }
-
-    /* Enabling actuators. */
-    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
-                                                       DISFFC_SETACTUATORSON);
-    if (FAILED(ret)) {
-        DI_SetError("Enabling actuators", ret);
-        goto acquire_err;
-    }
-
-    /* Get supported effects. */
-    ret = IDirectInputDevice8_EnumEffects(haptic->hwdata->device,
-                                          DI_EffectCallback, haptic,
-                                          DIEFT_ALL);
-    if (FAILED(ret)) {
-        DI_SetError("Enumerating supported effects", ret);
-        goto acquire_err;
-    }
-    if (haptic->supported == 0) {       /* Error since device supports nothing. */
-        SDL_SetError("Haptic: Internal error on finding supported effects.");
-        goto acquire_err;
-    }
-
-    /* Check autogain and autocenter. */
-    dipdw.diph.dwSize = sizeof(DIPROPDWORD);
-    dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
-    dipdw.diph.dwObj = 0;
-    dipdw.diph.dwHow = DIPH_DEVICE;
-    dipdw.dwData = 10000;
-    ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
-                                          DIPROP_FFGAIN, &dipdw.diph);
-    if (!FAILED(ret)) {         /* Gain is supported. */
-        haptic->supported |= SDL_HAPTIC_GAIN;
-    }
-    dipdw.diph.dwObj = 0;
-    dipdw.diph.dwHow = DIPH_DEVICE;
-    dipdw.dwData = DIPROPAUTOCENTER_OFF;
-    ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
-                                          DIPROP_AUTOCENTER, &dipdw.diph);
-    if (!FAILED(ret)) {         /* Autocenter is supported. */
-        haptic->supported |= SDL_HAPTIC_AUTOCENTER;
-    }
-
-    /* Status is always supported. */
-    haptic->supported |= SDL_HAPTIC_STATUS | SDL_HAPTIC_PAUSE;
-
-    /* Check maximum effects. */
-    haptic->neffects = 128;     /* This is not actually supported as thus under windows,
-                                   there is no way to tell the number of EFFECTS that a
-                                   device can hold, so we'll just use a "random" number
-                                   instead and put warnings in SDL_haptic.h */
-    haptic->nplaying = 128;     /* Even more impossible to get this then neffects. */
-
-    /* Prepare effects memory. */
-    haptic->effects = (struct haptic_effect *)
-        SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects);
-    if (haptic->effects == NULL) {
-        SDL_OutOfMemory();
-        goto acquire_err;
-    }
-    /* Clear the memory */
-    SDL_memset(haptic->effects, 0,
-               sizeof(struct haptic_effect) * haptic->neffects);
-
-    return 0;
-
-    /* Error handling */
-  acquire_err:
-    IDirectInputDevice8_Unacquire(haptic->hwdata->device);
-    return -1;
-
-}
-
-
-/*
- * Opens a haptic device for usage.
- */
-int
-SDL_SYS_HapticOpen(SDL_Haptic * haptic)
-{
-    if (SDL_hapticlist[haptic->index].bXInputHaptic) {
-        return SDL_SYS_HapticOpenFromXInput(haptic, SDL_hapticlist[haptic->index].userid);
-    }
-
-    return SDL_SYS_HapticOpenFromInstance(haptic, SDL_hapticlist[haptic->index].instance);
-}
-
-
-/*
- * Opens a haptic device from first mouse it finds for usage.
- */
-int
-SDL_SYS_HapticMouse(void)
-{
-    int i;
-
-    /* Grab the first mouse haptic device we find. */
-    for (i = 0; i < SDL_numhaptics; i++) {
-        if (SDL_hapticlist[i].capabilities.dwDevType == DI8DEVCLASS_POINTER ) {
-            return i;
-        }
-    }
-
-    return -1;
-}
-
-
-/*
- * Checks to see if a joystick has haptic features.
- */
-int
-SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
-{
-    const struct joystick_hwdata *hwdata = joystick->hwdata;
-    return ( (hwdata->bXInputHaptic) ||
-             ((hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) != 0) );
-}
-
-
-/*
- * Checks to see if the haptic device and joystick are in reality the same.
- */
-int
-SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
-{
-    if (joystick->hwdata->bXInputHaptic != haptic->hwdata->bXInputHaptic) {
-        return 0;  /* one is XInput, one is not; not the same device. */
-    } else if (joystick->hwdata->bXInputHaptic) {  /* XInput */
-        return (haptic->hwdata->userid == joystick->hwdata->userid);
-    } else {  /* DirectInput */
-        HRESULT ret;
-        DIDEVICEINSTANCE hap_instance, joy_instance;
-
-        hap_instance.dwSize = sizeof(DIDEVICEINSTANCE);
-        joy_instance.dwSize = sizeof(DIDEVICEINSTANCE);
-
-        /* Get the device instances. */
-        ret = IDirectInputDevice8_GetDeviceInfo(haptic->hwdata->device,
-                                            &hap_instance);
-        if (FAILED(ret)) {
-            return 0;
-        }
-        ret = IDirectInputDevice8_GetDeviceInfo(joystick->hwdata->InputDevice,
-                                                &joy_instance);
-        if (FAILED(ret)) {
-            return 0;
-        }
-
-        if (DI_GUIDIsSame(&hap_instance.guidInstance, &joy_instance.guidInstance))
-            return 1;
-    }
-
-    return 0;
-}
-
-
-/*
- * Opens a SDL_Haptic from a SDL_Joystick.
- */
-int
-SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
-{
-    int i;
-    HRESULT idret;
-    DIDEVICEINSTANCE joy_instance;
-    joy_instance.dwSize = sizeof(DIDEVICEINSTANCE);
-
-    /* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */
-    if (joystick->hwdata->bXInputDevice) {
-        const Uint8 userid = joystick->hwdata->userid;
-        for (i=0; i<SDL_numhaptics; i++) {
-            if ((SDL_hapticlist[i].bXInputHaptic) && (SDL_hapticlist[i].userid == userid)) {
-                SDL_assert(joystick->hwdata->bXInputHaptic);
-                haptic->index = i;
-                return SDL_SYS_HapticOpenFromXInput(haptic, SDL_hapticlist[haptic->index].userid);
-            }
-        }
-    } else {
-        for (i=0; i<SDL_numhaptics; i++) {
-            idret = IDirectInputDevice8_GetDeviceInfo(joystick->hwdata->InputDevice, &joy_instance);
-            if (FAILED(idret)) {
-                return -1;
-            }
-            if (DI_GUIDIsSame(&SDL_hapticlist[i].instance.guidInstance,
-                              &joy_instance.guidInstance)) {
-                haptic->index = i;
-                return SDL_SYS_HapticOpenFromDevice8(haptic, joystick->hwdata->InputDevice, SDL_TRUE);
-            }
-        }
-    }
-    /* No match to our haptic list */
-    return -1;
-}
-
-
-/*
- * Closes the haptic device.
- */
-void
-SDL_SYS_HapticClose(SDL_Haptic * haptic)
-{
-    if (haptic->hwdata) {
-
-        /* Free effects. */
-        SDL_free(haptic->effects);
-        haptic->effects = NULL;
-        haptic->neffects = 0;
-
-        /* Clean up */
-        if (haptic->hwdata->bXInputHaptic) {
-            haptic->hwdata->stopThread = 1;
-            SDL_WaitThread(haptic->hwdata->thread, NULL);
-            SDL_DestroyMutex(haptic->hwdata->mutex);
-        } else {
-            IDirectInputDevice8_Unacquire(haptic->hwdata->device);
-            /* Only release if isn't grabbed by a joystick. */
-            if (haptic->hwdata->is_joystick == 0) {
-                IDirectInputDevice8_Release(haptic->hwdata->device);
-            }
-        }
-
-        /* Free */
-        SDL_free(haptic->hwdata);
-        haptic->hwdata = NULL;
-    }
-}
-
-
-/*
- * Clean up after system specific haptic stuff
- */
-void
-SDL_SYS_HapticQuit(void)
-{
-    int i;
-
-    if (loaded_xinput) {
-        WIN_UnloadXInputDLL();
-        loaded_xinput = SDL_FALSE;
-    }
-
-    for (i = 0; i < SDL_arraysize(SDL_hapticlist); ++i) {
-        SDL_free(SDL_hapticlist[i].name);
-        SDL_hapticlist[i].name = NULL;
-    }
-
-    if (dinput != NULL) {
-        IDirectInput8_Release(dinput);
-        dinput = NULL;
-    }
-
-    if (coinitialized) {
-        WIN_CoUninitialize();
-        coinitialized = SDL_FALSE;
-    }
-}
-
-
-/*
- * Converts an SDL trigger button to an DIEFFECT trigger button.
- */
-static DWORD
-DIGetTriggerButton(Uint16 button)
-{
-    DWORD dwTriggerButton;
-
-    dwTriggerButton = DIEB_NOTRIGGER;
-
-    if (button != 0) {
-        dwTriggerButton = DIJOFS_BUTTON(button - 1);
-    }
-
-    return dwTriggerButton;
-}
-
-
-/*
- * Sets the direction.
- */
-static int
-SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir, int naxes)
-{
-    LONG *rglDir;
-
-    /* Handle no axes a part. */
-    if (naxes == 0) {
-        effect->dwFlags |= DIEFF_SPHERICAL;     /* Set as default. */
-        effect->rglDirection = NULL;
-        return 0;
-    }
-
-    /* Has axes. */
-    rglDir = SDL_malloc(sizeof(LONG) * naxes);
-    if (rglDir == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(rglDir, 0, sizeof(LONG) * naxes);
-    effect->rglDirection = rglDir;
-
-    switch (dir->type) {
-    case SDL_HAPTIC_POLAR:
-        effect->dwFlags |= DIEFF_POLAR;
-        rglDir[0] = dir->dir[0];
-        return 0;
-    case SDL_HAPTIC_CARTESIAN:
-        effect->dwFlags |= DIEFF_CARTESIAN;
-        rglDir[0] = dir->dir[0];
-        if (naxes > 1)
-            rglDir[1] = dir->dir[1];
-        if (naxes > 2)
-            rglDir[2] = dir->dir[2];
-        return 0;
-    case SDL_HAPTIC_SPHERICAL:
-        effect->dwFlags |= DIEFF_SPHERICAL;
-        rglDir[0] = dir->dir[0];
-        if (naxes > 1)
-            rglDir[1] = dir->dir[1];
-        if (naxes > 2)
-            rglDir[2] = dir->dir[2];
-        return 0;
-
-    default:
-        return SDL_SetError("Haptic: Unknown direction type.");
-    }
-}
-
-#define CONVERT(x)   (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF)
-/*
- * Creates the DIEFFECT from a SDL_HapticEffect.
- */
-static int
-SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest,
-                   SDL_HapticEffect * src)
-{
-    int i;
-    DICONSTANTFORCE *constant;
-    DIPERIODIC *periodic;
-    DICONDITION *condition;     /* Actually an array of conditions - one per axis. */
-    DIRAMPFORCE *ramp;
-    DICUSTOMFORCE *custom;
-    DIENVELOPE *envelope;
-    SDL_HapticConstant *hap_constant;
-    SDL_HapticPeriodic *hap_periodic;
-    SDL_HapticCondition *hap_condition;
-    SDL_HapticRamp *hap_ramp;
-    SDL_HapticCustom *hap_custom;
-    DWORD *axes;
-
-    /* Set global stuff. */
-    SDL_memset(dest, 0, sizeof(DIEFFECT));
-    dest->dwSize = sizeof(DIEFFECT);    /* Set the structure size. */
-    dest->dwSamplePeriod = 0;   /* Not used by us. */
-    dest->dwGain = 10000;       /* Gain is set globally, not locally. */
-    dest->dwFlags = DIEFF_OBJECTOFFSETS;        /* Seems obligatory. */
-
-    /* Envelope. */
-    envelope = SDL_malloc(sizeof(DIENVELOPE));
-    if (envelope == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(envelope, 0, sizeof(DIENVELOPE));
-    dest->lpEnvelope = envelope;
-    envelope->dwSize = sizeof(DIENVELOPE);      /* Always should be this. */
-
-    /* Axes. */
-    dest->cAxes = haptic->naxes;
-    if (dest->cAxes > 0) {
-        axes = SDL_malloc(sizeof(DWORD) * dest->cAxes);
-        if (axes == NULL) {
-            return SDL_OutOfMemory();
-        }
-        axes[0] = haptic->hwdata->axes[0];      /* Always at least one axis. */
-        if (dest->cAxes > 1) {
-            axes[1] = haptic->hwdata->axes[1];
-        }
-        if (dest->cAxes > 2) {
-            axes[2] = haptic->hwdata->axes[2];
-        }
-        dest->rgdwAxes = axes;
-    }
-
-
-    /* The big type handling switch, even bigger then Linux's version. */
-    switch (src->type) {
-    case SDL_HAPTIC_CONSTANT:
-        hap_constant = &src->constant;
-        constant = SDL_malloc(sizeof(DICONSTANTFORCE));
-        if (constant == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(constant, 0, sizeof(DICONSTANTFORCE));
-
-        /* Specifics */
-        constant->lMagnitude = CONVERT(hap_constant->level);
-        dest->cbTypeSpecificParams = sizeof(DICONSTANTFORCE);
-        dest->lpvTypeSpecificParams = constant;
-
-        /* Generics */
-        dest->dwDuration = hap_constant->length * 1000; /* In microseconds. */
-        dest->dwTriggerButton = DIGetTriggerButton(hap_constant->button);
-        dest->dwTriggerRepeatInterval = hap_constant->interval;
-        dest->dwStartDelay = hap_constant->delay * 1000;        /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_constant->direction, dest->cAxes)
-            < 0) {
-            return -1;
-        }
-
-        /* Envelope */
-        if ((hap_constant->attack_length == 0)
-            && (hap_constant->fade_length == 0)) {
-            SDL_free(dest->lpEnvelope);
-            dest->lpEnvelope = NULL;
-        } else {
-            envelope->dwAttackLevel = CONVERT(hap_constant->attack_level);
-            envelope->dwAttackTime = hap_constant->attack_length * 1000;
-            envelope->dwFadeLevel = CONVERT(hap_constant->fade_level);
-            envelope->dwFadeTime = hap_constant->fade_length * 1000;
-        }
-
-        break;
-
-    case SDL_HAPTIC_SINE:
-    /* !!! FIXME: put this back when we have more bits in 2.1 */
-    /* case SDL_HAPTIC_SQUARE: */
-    case SDL_HAPTIC_TRIANGLE:
-    case SDL_HAPTIC_SAWTOOTHUP:
-    case SDL_HAPTIC_SAWTOOTHDOWN:
-        hap_periodic = &src->periodic;
-        periodic = SDL_malloc(sizeof(DIPERIODIC));
-        if (periodic == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(periodic, 0, sizeof(DIPERIODIC));
-
-        /* Specifics */
-        periodic->dwMagnitude = CONVERT(hap_periodic->magnitude);
-        periodic->lOffset = CONVERT(hap_periodic->offset);
-        periodic->dwPhase = hap_periodic->phase;
-        periodic->dwPeriod = hap_periodic->period * 1000;
-        dest->cbTypeSpecificParams = sizeof(DIPERIODIC);
-        dest->lpvTypeSpecificParams = periodic;
-
-        /* Generics */
-        dest->dwDuration = hap_periodic->length * 1000; /* In microseconds. */
-        dest->dwTriggerButton = DIGetTriggerButton(hap_periodic->button);
-        dest->dwTriggerRepeatInterval = hap_periodic->interval;
-        dest->dwStartDelay = hap_periodic->delay * 1000;        /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_periodic->direction, dest->cAxes)
-            < 0) {
-            return -1;
-        }
-
-        /* Envelope */
-        if ((hap_periodic->attack_length == 0)
-            && (hap_periodic->fade_length == 0)) {
-            SDL_free(dest->lpEnvelope);
-            dest->lpEnvelope = NULL;
-        } else {
-            envelope->dwAttackLevel = CONVERT(hap_periodic->attack_level);
-            envelope->dwAttackTime = hap_periodic->attack_length * 1000;
-            envelope->dwFadeLevel = CONVERT(hap_periodic->fade_level);
-            envelope->dwFadeTime = hap_periodic->fade_length * 1000;
-        }
-
-        break;
-
-    case SDL_HAPTIC_SPRING:
-    case SDL_HAPTIC_DAMPER:
-    case SDL_HAPTIC_INERTIA:
-    case SDL_HAPTIC_FRICTION:
-        hap_condition = &src->condition;
-        condition = SDL_malloc(sizeof(DICONDITION) * dest->cAxes);
-        if (condition == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(condition, 0, sizeof(DICONDITION));
-
-        /* Specifics */
-        for (i = 0; i < (int) dest->cAxes; i++) {
-            condition[i].lOffset = CONVERT(hap_condition->center[i]);
-            condition[i].lPositiveCoefficient =
-                CONVERT(hap_condition->right_coeff[i]);
-            condition[i].lNegativeCoefficient =
-                CONVERT(hap_condition->left_coeff[i]);
-            condition[i].dwPositiveSaturation =
-                CONVERT(hap_condition->right_sat[i]);
-            condition[i].dwNegativeSaturation =
-                CONVERT(hap_condition->left_sat[i]);
-            condition[i].lDeadBand = CONVERT(hap_condition->deadband[i]);
-        }
-        dest->cbTypeSpecificParams = sizeof(DICONDITION) * dest->cAxes;
-        dest->lpvTypeSpecificParams = condition;
-
-        /* Generics */
-        dest->dwDuration = hap_condition->length * 1000;        /* In microseconds. */
-        dest->dwTriggerButton = DIGetTriggerButton(hap_condition->button);
-        dest->dwTriggerRepeatInterval = hap_condition->interval;
-        dest->dwStartDelay = hap_condition->delay * 1000;       /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_condition->direction, dest->cAxes)
-            < 0) {
-            return -1;
-        }
-
-        /* Envelope - Not actually supported by most CONDITION implementations. */
-        SDL_free(dest->lpEnvelope);
-        dest->lpEnvelope = NULL;
-
-        break;
-
-    case SDL_HAPTIC_RAMP:
-        hap_ramp = &src->ramp;
-        ramp = SDL_malloc(sizeof(DIRAMPFORCE));
-        if (ramp == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(ramp, 0, sizeof(DIRAMPFORCE));
-
-        /* Specifics */
-        ramp->lStart = CONVERT(hap_ramp->start);
-        ramp->lEnd = CONVERT(hap_ramp->end);
-        dest->cbTypeSpecificParams = sizeof(DIRAMPFORCE);
-        dest->lpvTypeSpecificParams = ramp;
-
-        /* Generics */
-        dest->dwDuration = hap_ramp->length * 1000;     /* In microseconds. */
-        dest->dwTriggerButton = DIGetTriggerButton(hap_ramp->button);
-        dest->dwTriggerRepeatInterval = hap_ramp->interval;
-        dest->dwStartDelay = hap_ramp->delay * 1000;    /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_ramp->direction, dest->cAxes) < 0) {
-            return -1;
-        }
-
-        /* Envelope */
-        if ((hap_ramp->attack_length == 0) && (hap_ramp->fade_length == 0)) {
-            SDL_free(dest->lpEnvelope);
-            dest->lpEnvelope = NULL;
-        } else {
-            envelope->dwAttackLevel = CONVERT(hap_ramp->attack_level);
-            envelope->dwAttackTime = hap_ramp->attack_length * 1000;
-            envelope->dwFadeLevel = CONVERT(hap_ramp->fade_level);
-            envelope->dwFadeTime = hap_ramp->fade_length * 1000;
-        }
-
-        break;
-
-    case SDL_HAPTIC_CUSTOM:
-        hap_custom = &src->custom;
-        custom = SDL_malloc(sizeof(DICUSTOMFORCE));
-        if (custom == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(custom, 0, sizeof(DICUSTOMFORCE));
-
-        /* Specifics */
-        custom->cChannels = hap_custom->channels;
-        custom->dwSamplePeriod = hap_custom->period * 1000;
-        custom->cSamples = hap_custom->samples;
-        custom->rglForceData =
-            SDL_malloc(sizeof(LONG) * custom->cSamples * custom->cChannels);
-        for (i = 0; i < hap_custom->samples * hap_custom->channels; i++) {      /* Copy data. */
-            custom->rglForceData[i] = CONVERT(hap_custom->data[i]);
-        }
-        dest->cbTypeSpecificParams = sizeof(DICUSTOMFORCE);
-        dest->lpvTypeSpecificParams = custom;
-
-        /* Generics */
-        dest->dwDuration = hap_custom->length * 1000;   /* In microseconds. */
-        dest->dwTriggerButton = DIGetTriggerButton(hap_custom->button);
-        dest->dwTriggerRepeatInterval = hap_custom->interval;
-        dest->dwStartDelay = hap_custom->delay * 1000;  /* In microseconds. */
-
-        /* Direction. */
-        if (SDL_SYS_SetDirection(dest, &hap_custom->direction, dest->cAxes) <
-            0) {
-            return -1;
-        }
-
-        /* Envelope */
-        if ((hap_custom->attack_length == 0)
-            && (hap_custom->fade_length == 0)) {
-            SDL_free(dest->lpEnvelope);
-            dest->lpEnvelope = NULL;
-        } else {
-            envelope->dwAttackLevel = CONVERT(hap_custom->attack_level);
-            envelope->dwAttackTime = hap_custom->attack_length * 1000;
-            envelope->dwFadeLevel = CONVERT(hap_custom->fade_level);
-            envelope->dwFadeTime = hap_custom->fade_length * 1000;
-        }
-
-        break;
-
-
-    default:
-        return SDL_SetError("Haptic: Unknown effect type.");
-    }
-
-    return 0;
-}
-
-
-/*
- * Frees an DIEFFECT allocated by SDL_SYS_ToDIEFFECT.
- */
-static void
-SDL_SYS_HapticFreeDIEFFECT(DIEFFECT * effect, int type)
-{
-    DICUSTOMFORCE *custom;
-
-    SDL_free(effect->lpEnvelope);
-    effect->lpEnvelope = NULL;
-    SDL_free(effect->rgdwAxes);
-    effect->rgdwAxes = NULL;
-    if (effect->lpvTypeSpecificParams != NULL) {
-        if (type == SDL_HAPTIC_CUSTOM) {        /* Must free the custom data. */
-            custom = (DICUSTOMFORCE *) effect->lpvTypeSpecificParams;
-            SDL_free(custom->rglForceData);
-            custom->rglForceData = NULL;
-        }
-        SDL_free(effect->lpvTypeSpecificParams);
-        effect->lpvTypeSpecificParams = NULL;
-    }
-    SDL_free(effect->rglDirection);
-    effect->rglDirection = NULL;
-}
-
-
-/*
- * Gets the effect type from the generic SDL haptic effect wrapper.
- */
-static REFGUID
-SDL_SYS_HapticEffectType(SDL_HapticEffect * effect)
-{
-    switch (effect->type) {
-    case SDL_HAPTIC_CONSTANT:
-        return &GUID_ConstantForce;
-
-    case SDL_HAPTIC_RAMP:
-        return &GUID_RampForce;
-
-    /* !!! FIXME: put this back when we have more bits in 2.1 */
-    /* case SDL_HAPTIC_SQUARE:
-        return &GUID_Square; */
-
-    case SDL_HAPTIC_SINE:
-        return &GUID_Sine;
-
-    case SDL_HAPTIC_TRIANGLE:
-        return &GUID_Triangle;
-
-    case SDL_HAPTIC_SAWTOOTHUP:
-        return &GUID_SawtoothUp;
-
-    case SDL_HAPTIC_SAWTOOTHDOWN:
-        return &GUID_SawtoothDown;
-
-    case SDL_HAPTIC_SPRING:
-        return &GUID_Spring;
-
-    case SDL_HAPTIC_DAMPER:
-        return &GUID_Damper;
-
-    case SDL_HAPTIC_INERTIA:
-        return &GUID_Inertia;
-
-    case SDL_HAPTIC_FRICTION:
-        return &GUID_Friction;
-
-    case SDL_HAPTIC_CUSTOM:
-        return &GUID_CustomForce;
-
-    default:
-        return NULL;
-    }
-}
-
-
-/*
- * Creates a new haptic effect.
- */
-int
-SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
-                        SDL_HapticEffect * base)
-{
-    HRESULT ret;
-    REFGUID type = SDL_SYS_HapticEffectType(base);
-
-    if ((type == NULL) && (!haptic->hwdata->bXInputHaptic)) {
-        SDL_SetError("Haptic: Unknown effect type.");
-        goto err_hweffect;
-    }
-
-    /* Alloc the effect. */
-    effect->hweffect = (struct haptic_hweffect *)
-        SDL_malloc(sizeof(struct haptic_hweffect));
-    if (effect->hweffect == NULL) {
-        SDL_OutOfMemory();
-        goto err_hweffect;
-    }
-
-    SDL_zerop(effect->hweffect);
-
-    if (haptic->hwdata->bXInputHaptic) {
-        SDL_assert(base->type == SDL_HAPTIC_LEFTRIGHT);  /* should catch this at higher level */
-        return SDL_SYS_HapticUpdateEffect(haptic, effect, base);
-    }
-
-    /* Get the effect. */
-    if (SDL_SYS_ToDIEFFECT(haptic, &effect->hweffect->effect, base) < 0) {
-        goto err_effectdone;
-    }
-
-    /* Create the actual effect. */
-    ret = IDirectInputDevice8_CreateEffect(haptic->hwdata->device, type,
-                                           &effect->hweffect->effect,
-                                           &effect->hweffect->ref, NULL);
-    if (FAILED(ret)) {
-        DI_SetError("Unable to create effect", ret);
-        goto err_effectdone;
-    }
-
-    return 0;
-
-  err_effectdone:
-    SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, base->type);
-  err_hweffect:
-    SDL_free(effect->hweffect);
-    effect->hweffect = NULL;
-    return -1;
-}
-
-
-/*
- * Updates an effect.
- */
-int
-SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic,
-                           struct haptic_effect *effect,
-                           SDL_HapticEffect * data)
-{
-    HRESULT ret;
-    DWORD flags;
-    DIEFFECT temp;
-
-    if (haptic->hwdata->bXInputHaptic) {
-        XINPUT_VIBRATION *vib = &effect->hweffect->vibration;
-        SDL_assert(data->type == SDL_HAPTIC_LEFTRIGHT);
-        vib->wLeftMotorSpeed = data->leftright.large_magnitude;
-        vib->wRightMotorSpeed = data->leftright.small_magnitude;
-        SDL_LockMutex(haptic->hwdata->mutex);
-        if (haptic->hwdata->stopTicks) {  /* running right now? Update it. */
-            XINPUTSETSTATE(haptic->hwdata->userid, vib);
-        }
-        SDL_UnlockMutex(haptic->hwdata->mutex);
-        return 0;
-    }
-
-    /* Get the effect. */
-    SDL_memset(&temp, 0, sizeof(DIEFFECT));
-    if (SDL_SYS_ToDIEFFECT(haptic, &temp, data) < 0) {
-        goto err_update;
-    }
-
-    /* Set the flags.  Might be worthwhile to diff temp with loaded effect and
-     *  only change those parameters. */
-    flags = DIEP_DIRECTION |
-        DIEP_DURATION |
-        DIEP_ENVELOPE |
-        DIEP_STARTDELAY |
-        DIEP_TRIGGERBUTTON |
-        DIEP_TRIGGERREPEATINTERVAL | DIEP_TYPESPECIFICPARAMS;
-
-    /* Create the actual effect. */
-    ret =
-        IDirectInputEffect_SetParameters(effect->hweffect->ref, &temp, flags);
-    if (FAILED(ret)) {
-        DI_SetError("Unable to update effect", ret);
-        goto err_update;
-    }
-
-    /* Copy it over. */
-    SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, data->type);
-    SDL_memcpy(&effect->hweffect->effect, &temp, sizeof(DIEFFECT));
-
-    return 0;
-
-  err_update:
-    SDL_SYS_HapticFreeDIEFFECT(&temp, data->type);
-    return -1;
-}
-
-
-/*
- * Runs an effect.
- */
-int
-SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect,
-                        Uint32 iterations)
-{
-    HRESULT ret;
-    DWORD iter;
-
-    if (haptic->hwdata->bXInputHaptic) {
-        XINPUT_VIBRATION *vib = &effect->hweffect->vibration;
-        SDL_assert(effect->effect.type == SDL_HAPTIC_LEFTRIGHT);  /* should catch this at higher level */
-        SDL_LockMutex(haptic->hwdata->mutex);
-        if(effect->effect.leftright.length == SDL_HAPTIC_INFINITY || iterations == SDL_HAPTIC_INFINITY) {
-            haptic->hwdata->stopTicks = SDL_HAPTIC_INFINITY;
-        } else if ((!effect->effect.leftright.length) || (!iterations)) {
-            /* do nothing. Effect runs for zero milliseconds. */
-        } else {
-            haptic->hwdata->stopTicks = SDL_GetTicks() + (effect->effect.leftright.length * iterations);
-            if ((haptic->hwdata->stopTicks == SDL_HAPTIC_INFINITY) || (haptic->hwdata->stopTicks == 0)) {
-                haptic->hwdata->stopTicks = 1;  /* fix edge cases. */
-            }
-        }
-        SDL_UnlockMutex(haptic->hwdata->mutex);
-        return (XINPUTSETSTATE(haptic->hwdata->userid, vib) == ERROR_SUCCESS) ? 0 : -1;
-    }
-
-    /* Check if it's infinite. */
-    if (iterations == SDL_HAPTIC_INFINITY) {
-        iter = INFINITE;
-    } else
-        iter = iterations;
-
-    /* Run the effect. */
-    ret = IDirectInputEffect_Start(effect->hweffect->ref, iter, 0);
-    if (FAILED(ret)) {
-        return DI_SetError("Running the effect", ret);
-    }
-
-    return 0;
-}
-
-
-/*
- * Stops an effect.
- */
-int
-SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
-{
-    HRESULT ret;
-
-    if (haptic->hwdata->bXInputHaptic) {
-        XINPUT_VIBRATION vibration = { 0, 0 };
-        SDL_LockMutex(haptic->hwdata->mutex);
-        haptic->hwdata->stopTicks = 0;
-        SDL_UnlockMutex(haptic->hwdata->mutex);
-        return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS) ? 0 : -1;
-    }
-
-    ret = IDirectInputEffect_Stop(effect->hweffect->ref);
-    if (FAILED(ret)) {
-        return DI_SetError("Unable to stop effect", ret);
-    }
-
-    return 0;
-}
-
-
-/*
- * Frees the effect.
- */
-void
-SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
-{
-    HRESULT ret;
-
-    if (haptic->hwdata->bXInputHaptic) {
-        SDL_SYS_HapticStopEffect(haptic, effect);
-    } else {
-        ret = IDirectInputEffect_Unload(effect->hweffect->ref);
-        if (FAILED(ret)) {
-            DI_SetError("Removing effect from the device", ret);
-        }
-        SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect,
-                                   effect->effect.type);
-    }
-    SDL_free(effect->hweffect);
-    effect->hweffect = NULL;
-}
-
-
-/*
- * Gets the status of a haptic effect.
- */
-int
-SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic,
-                              struct haptic_effect *effect)
-{
-    HRESULT ret;
-    DWORD status;
-
-    ret = IDirectInputEffect_GetEffectStatus(effect->hweffect->ref, &status);
-    if (FAILED(ret)) {
-        return DI_SetError("Getting effect status", ret);
-    }
-
-    if (status == 0)
-        return SDL_FALSE;
-    return SDL_TRUE;
-}
-
-
-/*
- * Sets the gain.
- */
-int
-SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain)
-{
-    HRESULT ret;
-    DIPROPDWORD dipdw;
-
-    /* Create the weird structure thingy. */
-    dipdw.diph.dwSize = sizeof(DIPROPDWORD);
-    dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
-    dipdw.diph.dwObj = 0;
-    dipdw.diph.dwHow = DIPH_DEVICE;
-    dipdw.dwData = gain * 100;  /* 0 to 10,000 */
-
-    /* Try to set the autocenter. */
-    ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
-                                          DIPROP_FFGAIN, &dipdw.diph);
-    if (FAILED(ret)) {
-        return DI_SetError("Setting gain", ret);
-    }
-
-    return 0;
-}
-
-
-/*
- * Sets the autocentering.
- */
-int
-SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
-{
-    HRESULT ret;
-    DIPROPDWORD dipdw;
-
-    /* Create the weird structure thingy. */
-    dipdw.diph.dwSize = sizeof(DIPROPDWORD);
-    dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
-    dipdw.diph.dwObj = 0;
-    dipdw.diph.dwHow = DIPH_DEVICE;
-    dipdw.dwData = (autocenter == 0) ? DIPROPAUTOCENTER_OFF :
-        DIPROPAUTOCENTER_ON;
-
-    /* Try to set the autocenter. */
-    ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
-                                          DIPROP_AUTOCENTER, &dipdw.diph);
-    if (FAILED(ret)) {
-        return DI_SetError("Setting autocenter", ret);
-    }
-
-    return 0;
-}
-
-
-/*
- * Pauses the device.
- */
-int
-SDL_SYS_HapticPause(SDL_Haptic * haptic)
-{
-    HRESULT ret;
-
-    /* Pause the device. */
-    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
-                                                       DISFFC_PAUSE);
-    if (FAILED(ret)) {
-        return DI_SetError("Pausing the device", ret);
-    }
-
-    return 0;
-}
-
-
-/*
- * Pauses the device.
- */
-int
-SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
-{
-    HRESULT ret;
-
-    /* Unpause the device. */
-    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
-                                                       DISFFC_CONTINUE);
-    if (FAILED(ret)) {
-        return DI_SetError("Pausing the device", ret);
-    }
-
-    return 0;
-}
-
-
-/*
- * Stops all the playing effects on the device.
- */
-int
-SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
-{
-    HRESULT ret;
-
-    if (haptic->hwdata->bXInputHaptic) {
-        XINPUT_VIBRATION vibration = { 0, 0 };
-        SDL_LockMutex(haptic->hwdata->mutex);
-        haptic->hwdata->stopTicks = 0;
-        SDL_UnlockMutex(haptic->hwdata->mutex);
-        return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS) ? 0 : -1;
-    }
-
-    /* Try to stop the effects. */
-    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
-                                                       DISFFC_STOPALL);
-    if (FAILED(ret)) {
-        return DI_SetError("Stopping the device", ret);
-    }
-
-    return 0;
-}
-
-
-/* !!! FIXME: this is a hack, remove this later. */
-/* Since XInput doesn't offer a way to vibrate for X time, we hook into
- *  SDL_PumpEvents() to check if it's time to stop vibrating with some
- *  frequency.
- * In practice, this works for 99% of use cases. But in an ideal world,
- *  we do this in a separate thread so that:
- *    - we aren't bound to when the app chooses to pump the event queue.
- *    - we aren't adding more polling to the event queue
- *    - we can emulate all the haptic effects correctly (start on a delay,
- *      mix multiple effects, etc).
- *
- * Mostly, this is here to get rumbling to work, and all the other features
- *  are absent in the XInput path for now.  :(
- */
-static int SDLCALL
-SDL_RunXInputHaptic(void *arg)
-{
-    struct haptic_hwdata *hwdata = (struct haptic_hwdata *) arg;
-
-    while (!hwdata->stopThread) {
-        SDL_Delay(50);
-        SDL_LockMutex(hwdata->mutex);
-        /* If we're currently running and need to stop... */
-        if (hwdata->stopTicks) {
-            if ((hwdata->stopTicks != SDL_HAPTIC_INFINITY) && SDL_TICKS_PASSED(SDL_GetTicks(), hwdata->stopTicks)) {
-                XINPUT_VIBRATION vibration = { 0, 0 };
-                hwdata->stopTicks = 0;
-                XINPUTSETSTATE(hwdata->userid, &vibration);
-            }
-        }
-        SDL_UnlockMutex(hwdata->mutex);
-    }
-
-    return 0;
-}
-
-#endif /* SDL_HAPTIC_DINPUT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/input/evdev/SDL_evdev.c b/deps/SDL2/src/input/evdev/SDL_evdev.c
deleted file mode 100644
index 92dc4fe..0000000
--- a/deps/SDL2/src/input/evdev/SDL_evdev.c
+++ /dev/null
@@ -1,805 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_INPUT_LINUXEV
-
-/* This is based on the linux joystick driver */
-/* References: https://www.kernel.org/doc/Documentation/input/input.txt 
- *             https://www.kernel.org/doc/Documentation/input/event-codes.txt
- *             /usr/include/linux/input.h
- *             The evtest application is also useful to debug the protocol
- */
-
-
-#include "SDL_evdev.h"
-#define _THIS SDL_EVDEV_PrivateData *_this
-static _THIS = NULL;
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <limits.h>             /* For the definition of PATH_MAX */
-#include <linux/input.h>
-#ifdef SDL_INPUT_LINUXKD
-#include <linux/kd.h>
-#include <linux/keyboard.h>
-#endif
-
-
-/* We need this to prevent keystrokes from appear in the console */
-#ifndef KDSKBMUTE
-#define KDSKBMUTE 0x4B51
-#endif
-#ifndef KDSKBMODE
-#define KDSKBMODE 0x4B45
-#endif
-#ifndef K_OFF
-#define K_OFF 0x04
-#endif
-
-#include "SDL.h"
-#include "SDL_assert.h"
-#include "SDL_endian.h"
-#include "../../core/linux/SDL_udev.h"
-#include "SDL_scancode.h"
-#include "../../events/SDL_events_c.h"
-
-/* This isn't defined in older Linux kernel headers */
-#ifndef SYN_DROPPED
-#define SYN_DROPPED 3
-#endif
-
-static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode);
-static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item);
-static int SDL_EVDEV_device_removed(const char *devpath);
-
-#if SDL_USE_LIBUDEV
-static int SDL_EVDEV_device_added(const char *devpath);
-void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath);
-#endif /* SDL_USE_LIBUDEV */
-
-static SDL_Scancode EVDEV_Keycodes[] = {
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_RESERVED        0 */
-    SDL_SCANCODE_ESCAPE,        /*  KEY_ESC         1 */
-    SDL_SCANCODE_1,             /*  KEY_1           2 */
-    SDL_SCANCODE_2,             /*  KEY_2           3 */
-    SDL_SCANCODE_3,             /*  KEY_3           4 */
-    SDL_SCANCODE_4,             /*  KEY_4           5 */
-    SDL_SCANCODE_5,             /*  KEY_5           6 */
-    SDL_SCANCODE_6,             /*  KEY_6           7 */
-    SDL_SCANCODE_7,             /*  KEY_7           8 */
-    SDL_SCANCODE_8,             /*  KEY_8           9 */
-    SDL_SCANCODE_9,             /*  KEY_9           10 */
-    SDL_SCANCODE_0,             /*  KEY_0           11 */
-    SDL_SCANCODE_MINUS,         /*  KEY_MINUS       12 */
-    SDL_SCANCODE_EQUALS,        /*  KEY_EQUAL       13 */
-    SDL_SCANCODE_BACKSPACE,     /*  KEY_BACKSPACE       14 */
-    SDL_SCANCODE_TAB,           /*  KEY_TAB         15 */
-    SDL_SCANCODE_Q,             /*  KEY_Q           16 */
-    SDL_SCANCODE_W,             /*  KEY_W           17 */
-    SDL_SCANCODE_E,             /*  KEY_E           18 */
-    SDL_SCANCODE_R,             /*  KEY_R           19 */
-    SDL_SCANCODE_T,             /*  KEY_T           20 */
-    SDL_SCANCODE_Y,             /*  KEY_Y           21 */
-    SDL_SCANCODE_U,             /*  KEY_U           22 */
-    SDL_SCANCODE_I,             /*  KEY_I           23 */
-    SDL_SCANCODE_O,             /*  KEY_O           24 */
-    SDL_SCANCODE_P,             /*  KEY_P           25 */
-    SDL_SCANCODE_LEFTBRACKET,   /*  KEY_LEFTBRACE       26 */
-    SDL_SCANCODE_RIGHTBRACKET,  /*  KEY_RIGHTBRACE      27 */
-    SDL_SCANCODE_RETURN,        /*  KEY_ENTER       28 */
-    SDL_SCANCODE_LCTRL,         /*  KEY_LEFTCTRL        29 */
-    SDL_SCANCODE_A,             /*  KEY_A           30 */
-    SDL_SCANCODE_S,             /*  KEY_S           31 */
-    SDL_SCANCODE_D,             /*  KEY_D           32 */
-    SDL_SCANCODE_F,             /*  KEY_F           33 */
-    SDL_SCANCODE_G,             /*  KEY_G           34 */
-    SDL_SCANCODE_H,             /*  KEY_H           35 */
-    SDL_SCANCODE_J,             /*  KEY_J           36 */
-    SDL_SCANCODE_K,             /*  KEY_K           37 */
-    SDL_SCANCODE_L,             /*  KEY_L           38 */
-    SDL_SCANCODE_SEMICOLON,     /*  KEY_SEMICOLON       39 */
-    SDL_SCANCODE_APOSTROPHE,    /*  KEY_APOSTROPHE      40 */
-    SDL_SCANCODE_GRAVE,         /*  KEY_GRAVE       41 */
-    SDL_SCANCODE_LSHIFT,        /*  KEY_LEFTSHIFT       42 */
-    SDL_SCANCODE_BACKSLASH,     /*  KEY_BACKSLASH       43 */
-    SDL_SCANCODE_Z,             /*  KEY_Z           44 */
-    SDL_SCANCODE_X,             /*  KEY_X           45 */
-    SDL_SCANCODE_C,             /*  KEY_C           46 */
-    SDL_SCANCODE_V,             /*  KEY_V           47 */
-    SDL_SCANCODE_B,             /*  KEY_B           48 */
-    SDL_SCANCODE_N,             /*  KEY_N           49 */
-    SDL_SCANCODE_M,             /*  KEY_M           50 */
-    SDL_SCANCODE_COMMA,         /*  KEY_COMMA       51 */
-    SDL_SCANCODE_PERIOD,        /*  KEY_DOT         52 */
-    SDL_SCANCODE_SLASH,         /*  KEY_SLASH       53 */
-    SDL_SCANCODE_RSHIFT,        /*  KEY_RIGHTSHIFT      54 */
-    SDL_SCANCODE_KP_MULTIPLY,   /*  KEY_KPASTERISK      55 */
-    SDL_SCANCODE_LALT,          /*  KEY_LEFTALT     56 */
-    SDL_SCANCODE_SPACE,         /*  KEY_SPACE       57 */
-    SDL_SCANCODE_CAPSLOCK,      /*  KEY_CAPSLOCK        58 */
-    SDL_SCANCODE_F1,            /*  KEY_F1          59 */
-    SDL_SCANCODE_F2,            /*  KEY_F2          60 */
-    SDL_SCANCODE_F3,            /*  KEY_F3          61 */
-    SDL_SCANCODE_F4,            /*  KEY_F4          62 */
-    SDL_SCANCODE_F5,            /*  KEY_F5          63 */
-    SDL_SCANCODE_F6,            /*  KEY_F6          64 */
-    SDL_SCANCODE_F7,            /*  KEY_F7          65 */
-    SDL_SCANCODE_F8,            /*  KEY_F8          66 */
-    SDL_SCANCODE_F9,            /*  KEY_F9          67 */
-    SDL_SCANCODE_F10,           /*  KEY_F10         68 */
-    SDL_SCANCODE_NUMLOCKCLEAR,  /*  KEY_NUMLOCK     69 */
-    SDL_SCANCODE_SCROLLLOCK,    /*  KEY_SCROLLLOCK      70 */
-    SDL_SCANCODE_KP_7,          /*  KEY_KP7         71 */
-    SDL_SCANCODE_KP_8,          /*  KEY_KP8         72 */
-    SDL_SCANCODE_KP_9,          /*  KEY_KP9         73 */
-    SDL_SCANCODE_KP_MINUS,      /*  KEY_KPMINUS     74 */
-    SDL_SCANCODE_KP_4,          /*  KEY_KP4         75 */
-    SDL_SCANCODE_KP_5,          /*  KEY_KP5         76 */
-    SDL_SCANCODE_KP_6,          /*  KEY_KP6         77 */
-    SDL_SCANCODE_KP_PLUS,       /*  KEY_KPPLUS      78 */
-    SDL_SCANCODE_KP_1,          /*  KEY_KP1         79 */
-    SDL_SCANCODE_KP_2,          /*  KEY_KP2         80 */
-    SDL_SCANCODE_KP_3,          /*  KEY_KP3         81 */
-    SDL_SCANCODE_KP_0,          /*  KEY_KP0         82 */
-    SDL_SCANCODE_KP_PERIOD,     /*  KEY_KPDOT       83 */
-    SDL_SCANCODE_UNKNOWN,       /*  84 */
-    SDL_SCANCODE_LANG5,         /*  KEY_ZENKAKUHANKAKU  85 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_102ND       86 */
-    SDL_SCANCODE_F11,           /*  KEY_F11         87 */
-    SDL_SCANCODE_F12,           /*  KEY_F12         88 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_RO          89 */
-    SDL_SCANCODE_LANG3,         /*  KEY_KATAKANA        90 */
-    SDL_SCANCODE_LANG4,         /*  KEY_HIRAGANA        91 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_HENKAN      92 */
-    SDL_SCANCODE_LANG3,         /*  KEY_KATAKANAHIRAGANA    93 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_MUHENKAN        94 */
-    SDL_SCANCODE_KP_COMMA,      /*  KEY_KPJPCOMMA       95 */
-    SDL_SCANCODE_KP_ENTER,      /*  KEY_KPENTER     96 */
-    SDL_SCANCODE_RCTRL,         /*  KEY_RIGHTCTRL       97 */
-    SDL_SCANCODE_KP_DIVIDE,     /*  KEY_KPSLASH     98 */
-    SDL_SCANCODE_SYSREQ,        /*  KEY_SYSRQ       99 */
-    SDL_SCANCODE_RALT,          /*  KEY_RIGHTALT        100 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_LINEFEED        101 */
-    SDL_SCANCODE_HOME,          /*  KEY_HOME        102 */
-    SDL_SCANCODE_UP,            /*  KEY_UP          103 */
-    SDL_SCANCODE_PAGEUP,        /*  KEY_PAGEUP      104 */
-    SDL_SCANCODE_LEFT,          /*  KEY_LEFT        105 */
-    SDL_SCANCODE_RIGHT,         /*  KEY_RIGHT       106 */
-    SDL_SCANCODE_END,           /*  KEY_END         107 */
-    SDL_SCANCODE_DOWN,          /*  KEY_DOWN        108 */
-    SDL_SCANCODE_PAGEDOWN,      /*  KEY_PAGEDOWN        109 */
-    SDL_SCANCODE_INSERT,        /*  KEY_INSERT      110 */
-    SDL_SCANCODE_DELETE,        /*  KEY_DELETE      111 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_MACRO       112 */
-    SDL_SCANCODE_MUTE,          /*  KEY_MUTE        113 */
-    SDL_SCANCODE_VOLUMEDOWN,    /*  KEY_VOLUMEDOWN      114 */
-    SDL_SCANCODE_VOLUMEUP,      /*  KEY_VOLUMEUP        115 */
-    SDL_SCANCODE_POWER,         /*  KEY_POWER       116 SC System Power Down */
-    SDL_SCANCODE_KP_EQUALS,     /*  KEY_KPEQUAL     117 */
-    SDL_SCANCODE_KP_MINUS,      /*  KEY_KPPLUSMINUS     118 */
-    SDL_SCANCODE_PAUSE,         /*  KEY_PAUSE       119 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SCALE       120 AL Compiz Scale (Expose) */
-    SDL_SCANCODE_KP_COMMA,      /*  KEY_KPCOMMA     121 */
-    SDL_SCANCODE_LANG1,         /*  KEY_HANGEUL,KEY_HANGUEL 122 */
-    SDL_SCANCODE_LANG2,         /*  KEY_HANJA       123 */
-    SDL_SCANCODE_INTERNATIONAL3,/*  KEY_YEN         124 */
-    SDL_SCANCODE_LGUI,          /*  KEY_LEFTMETA        125 */
-    SDL_SCANCODE_RGUI,          /*  KEY_RIGHTMETA       126 */
-    SDL_SCANCODE_APPLICATION,   /*  KEY_COMPOSE     127 */
-    SDL_SCANCODE_STOP,          /*  KEY_STOP        128 AC Stop */
-    SDL_SCANCODE_AGAIN,         /*  KEY_AGAIN       129 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_PROPS       130 AC Properties */
-    SDL_SCANCODE_UNDO,          /*  KEY_UNDO        131 AC Undo */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_FRONT       132 */
-    SDL_SCANCODE_COPY,          /*  KEY_COPY        133 AC Copy */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_OPEN        134 AC Open */
-    SDL_SCANCODE_PASTE,         /*  KEY_PASTE       135 AC Paste */
-    SDL_SCANCODE_FIND,          /*  KEY_FIND        136 AC Search */
-    SDL_SCANCODE_CUT,           /*  KEY_CUT         137 AC Cut */
-    SDL_SCANCODE_HELP,          /*  KEY_HELP        138 AL Integrated Help Center */
-    SDL_SCANCODE_MENU,          /*  KEY_MENU        139 Menu (show menu) */
-    SDL_SCANCODE_CALCULATOR,    /*  KEY_CALC        140 AL Calculator */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SETUP       141 */
-    SDL_SCANCODE_SLEEP,         /*  KEY_SLEEP       142 SC System Sleep */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_WAKEUP      143 System Wake Up */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_FILE        144 AL Local Machine Browser */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SENDFILE        145 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_DELETEFILE      146 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_XFER        147 */
-    SDL_SCANCODE_APP1,          /*  KEY_PROG1       148 */
-    SDL_SCANCODE_APP1,          /*  KEY_PROG2       149 */
-    SDL_SCANCODE_WWW,           /*  KEY_WWW         150 AL Internet Browser */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_MSDOS       151 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_COFFEE,KEY_SCREENLOCK      152 AL Terminal Lock/Screensaver */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_DIRECTION       153 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_CYCLEWINDOWS    154 */
-    SDL_SCANCODE_MAIL,          /*  KEY_MAIL        155 */
-    SDL_SCANCODE_AC_BOOKMARKS,  /*  KEY_BOOKMARKS       156 AC Bookmarks */
-    SDL_SCANCODE_COMPUTER,      /*  KEY_COMPUTER        157 */
-    SDL_SCANCODE_AC_BACK,       /*  KEY_BACK        158 AC Back */
-    SDL_SCANCODE_AC_FORWARD,    /*  KEY_FORWARD     159 AC Forward */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_CLOSECD     160 */
-    SDL_SCANCODE_EJECT,         /*  KEY_EJECTCD     161 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_EJECTCLOSECD    162 */
-    SDL_SCANCODE_AUDIONEXT,     /*  KEY_NEXTSONG        163 */
-    SDL_SCANCODE_AUDIOPLAY,     /*  KEY_PLAYPAUSE       164 */
-    SDL_SCANCODE_AUDIOPREV,     /*  KEY_PREVIOUSSONG    165 */
-    SDL_SCANCODE_AUDIOSTOP,     /*  KEY_STOPCD      166 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_RECORD      167 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_REWIND      168 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_PHONE       169 Media Select Telephone */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_ISO         170 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_CONFIG      171 AL Consumer Control Configuration */
-    SDL_SCANCODE_AC_HOME,       /*  KEY_HOMEPAGE        172 AC Home */
-    SDL_SCANCODE_AC_REFRESH,    /*  KEY_REFRESH     173 AC Refresh */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_EXIT        174 AC Exit */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_MOVE        175 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_EDIT        176 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SCROLLUP        177 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SCROLLDOWN      178 */
-    SDL_SCANCODE_KP_LEFTPAREN,  /*  KEY_KPLEFTPAREN     179 */
-    SDL_SCANCODE_KP_RIGHTPAREN, /*  KEY_KPRIGHTPAREN    180 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_NEW         181 AC New */
-    SDL_SCANCODE_AGAIN,         /*  KEY_REDO        182 AC Redo/Repeat */
-    SDL_SCANCODE_F13,           /*  KEY_F13         183 */
-    SDL_SCANCODE_F14,           /*  KEY_F14         184 */
-    SDL_SCANCODE_F15,           /*  KEY_F15         185 */
-    SDL_SCANCODE_F16,           /*  KEY_F16         186 */
-    SDL_SCANCODE_F17,           /*  KEY_F17         187 */
-    SDL_SCANCODE_F18,           /*  KEY_F18         188 */
-    SDL_SCANCODE_F19,           /*  KEY_F19         189 */
-    SDL_SCANCODE_F20,           /*  KEY_F20         190 */
-    SDL_SCANCODE_F21,           /*  KEY_F21         191 */
-    SDL_SCANCODE_F22,           /*  KEY_F22         192 */
-    SDL_SCANCODE_F23,           /*  KEY_F23         193 */
-    SDL_SCANCODE_F24,           /*  KEY_F24         194 */
-    SDL_SCANCODE_UNKNOWN,       /*  195 */
-    SDL_SCANCODE_UNKNOWN,       /*  196 */
-    SDL_SCANCODE_UNKNOWN,       /*  197 */
-    SDL_SCANCODE_UNKNOWN,       /*  198 */
-    SDL_SCANCODE_UNKNOWN,       /*  199 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_PLAYCD      200 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_PAUSECD     201 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_PROG3       202 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_PROG4       203 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_DASHBOARD       204 AL Dashboard */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SUSPEND     205 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_CLOSE       206 AC Close */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_PLAY        207 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_FASTFORWARD     208 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_BASSBOOST       209 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_PRINT       210 AC Print */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_HP          211 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_CAMERA      212 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SOUND       213 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_QUESTION        214 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_EMAIL       215 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_CHAT        216 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SEARCH      217 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_CONNECT     218 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_FINANCE     219 AL Checkbook/Finance */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SPORT       220 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SHOP        221 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_ALTERASE        222 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_CANCEL      223 AC Cancel */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_BRIGHTNESSDOWN  224 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_BRIGHTNESSUP    225 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_MEDIA       226 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SWITCHVIDEOMODE 227 Cycle between available video outputs (Monitor/LCD/TV-out/etc) */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_KBDILLUMTOGGLE  228 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_KBDILLUMDOWN    229 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_KBDILLUMUP      230 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SEND        231 AC Send */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_REPLY       232 AC Reply */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_FORWARDMAIL     233 AC Forward Msg */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_SAVE        234 AC Save */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_DOCUMENTS       235 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_BATTERY     236  */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_BLUETOOTH       237 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_WLAN        238 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_UWB         239 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_UNKNOWN     240 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_VIDEO_NEXT      241 drive next video source */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_VIDEO_PREV      242 drive previous video source */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_BRIGHTNESS_CYCLE    243 brightness up, after max is min */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_BRIGHTNESS_ZERO 244 brightness off, use ambient */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_DISPLAY_OFF     245 display device to off state */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_WIMAX       246 */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_RFKILL      247 Key that controls all radios */
-    SDL_SCANCODE_UNKNOWN,       /*  KEY_MICMUTE     248 Mute / unmute the microphone */
-};
-
-static Uint8 EVDEV_MouseButtons[] = {
-    SDL_BUTTON_LEFT,            /*  BTN_LEFT        0x110 */
-    SDL_BUTTON_RIGHT,           /*  BTN_RIGHT       0x111 */
-    SDL_BUTTON_MIDDLE,          /*  BTN_MIDDLE      0x112 */
-    SDL_BUTTON_X1,              /*  BTN_SIDE        0x113 */
-    SDL_BUTTON_X2,              /*  BTN_EXTRA       0x114 */
-    SDL_BUTTON_X2 + 1,          /*  BTN_FORWARD     0x115 */
-    SDL_BUTTON_X2 + 2,          /*  BTN_BACK        0x116 */
-    SDL_BUTTON_X2 + 3           /*  BTN_TASK        0x117 */
-};
-
-static char* EVDEV_consoles[] = {
-    "/proc/self/fd/0",
-    "/dev/tty",
-    "/dev/tty0",
-    "/dev/tty1",
-    "/dev/tty2",
-    "/dev/tty3",
-    "/dev/tty4",
-    "/dev/tty5",
-    "/dev/tty6",
-    "/dev/vc/0",
-    "/dev/console"
-};
-
-#define IS_CONSOLE(fd) isatty (fd) && ioctl(fd, KDGKBTYPE, &arg) == 0 && ((arg == KB_101) || (arg == KB_84))
-
-static int SDL_EVDEV_get_console_fd(void)
-{
-    int fd, i;
-    char arg = 0;
-    
-    /* Try a few consoles to see which one we have read access to */
-    
-    for( i = 0; i < SDL_arraysize(EVDEV_consoles); i++) {
-        fd = open(EVDEV_consoles[i], O_RDONLY);
-        if (fd >= 0) {
-            if (IS_CONSOLE(fd)) return fd;
-            close(fd);
-        }
-    }
-    
-    /* Try stdin, stdout, stderr */
-    
-    for( fd = 0; fd < 3; fd++) {
-        if (IS_CONSOLE(fd)) return fd;
-    }
-    
-    /* We won't be able to send SDL_TEXTINPUT events */
-    return -1;
-}
-
-/* Prevent keystrokes from reaching the tty */
-static int SDL_EVDEV_mute_keyboard(int tty, int *kb_mode)
-{
-    char arg;
-    
-    *kb_mode = 0; /* FIXME: Is this a sane default in case KDGKBMODE fails? */
-    if (!IS_CONSOLE(tty)) {
-        return SDL_SetError("Tried to mute an invalid tty");
-    }
-    ioctl(tty, KDGKBMODE, kb_mode); /* It's not fatal if this fails */
-    if (ioctl(tty, KDSKBMUTE, 1) && ioctl(tty, KDSKBMODE, K_OFF)) {
-        return SDL_SetError("EVDEV: Failed muting keyboard");
-    }
-    
-    return 0;  
-}
-
-/* Restore the keyboard mode for given tty */
-static void SDL_EVDEV_unmute_keyboard(int tty, int kb_mode)
-{
-    if (ioctl(tty, KDSKBMUTE, 0) && ioctl(tty, KDSKBMODE, kb_mode)) {
-        SDL_Log("EVDEV: Failed restoring keyboard mode");
-    }
-}
-
-/* Read /sys/class/tty/tty0/active and open the tty */
-static int SDL_EVDEV_get_active_tty()
-{
-    int fd, len;
-    char ttyname[NAME_MAX + 1];
-    char ttypath[PATH_MAX+1] = "/dev/";
-    char arg;
-    
-    fd = open("/sys/class/tty/tty0/active", O_RDONLY);
-    if (fd < 0) {
-        return SDL_SetError("Could not determine which tty is active");
-    }
-    
-    len = read(fd, ttyname, NAME_MAX);
-    close(fd);
-    
-    if (len <= 0) {
-        return SDL_SetError("Could not read which tty is active");
-    }
-    
-    if (ttyname[len-1] == '\n') {
-        ttyname[len-1] = '\0';
-    }
-    else {
-        ttyname[len] = '\0';
-    }
-    
-    SDL_strlcat(ttypath, ttyname, PATH_MAX);
-    fd = open(ttypath, O_RDWR | O_NOCTTY);
-    if (fd < 0) {
-        return SDL_SetError("Could not open tty: %s", ttypath);
-    }
-    
-    if (!IS_CONSOLE(fd)) {
-        close(fd);
-        return SDL_SetError("Invalid tty obtained: %s", ttypath);
-    }
-
-    return fd;  
-}
-
-int
-SDL_EVDEV_Init(void)
-{
-    int retval = 0;
-    
-    if (_this == NULL) {
-        
-        _this = (SDL_EVDEV_PrivateData *) SDL_calloc(1, sizeof(*_this));
-        if(_this == NULL) {
-            return SDL_OutOfMemory();
-        }
-
-#if SDL_USE_LIBUDEV
-        if (SDL_UDEV_Init() < 0) {
-            SDL_free(_this);
-            _this = NULL;
-            return -1;
-        }
-
-        /* Set up the udev callback */
-        if ( SDL_UDEV_AddCallback(SDL_EVDEV_udev_callback) < 0) {
-            SDL_EVDEV_Quit();
-            return -1;
-        }
-        
-        /* Force a scan to build the initial device list */
-        SDL_UDEV_Scan();
-#else
-        /* TODO: Scan the devices manually, like a caveman */
-#endif /* SDL_USE_LIBUDEV */
-        
-        /* We need a physical terminal (not PTS) to be able to translate key code to symbols via the kernel tables */
-        _this->console_fd = SDL_EVDEV_get_console_fd();
-        
-        /* Mute the keyboard so keystrokes only generate evdev events and do not leak through to the console */
-        _this->tty = STDIN_FILENO;
-        if (SDL_EVDEV_mute_keyboard(_this->tty, &_this->kb_mode) < 0) {
-            /* stdin is not a tty, probably we were launched remotely, so we try to disable the active tty */
-            _this->tty = SDL_EVDEV_get_active_tty();
-            if (_this->tty >= 0) {
-                if (SDL_EVDEV_mute_keyboard(_this->tty, &_this->kb_mode) < 0) {
-                    close(_this->tty);
-                    _this->tty = -1;
-                }
-            }
-        }
-    }
-    
-    _this->ref_count += 1;
-    
-    return retval;
-}
-
-void
-SDL_EVDEV_Quit(void)
-{
-    if (_this == NULL) {
-        return;
-    }
-    
-    _this->ref_count -= 1;
-    
-    if (_this->ref_count < 1) {
-        
-#if SDL_USE_LIBUDEV
-        SDL_UDEV_DelCallback(SDL_EVDEV_udev_callback);
-        SDL_UDEV_Quit();
-#endif /* SDL_USE_LIBUDEV */
-       
-        if (_this->console_fd >= 0) {
-            close(_this->console_fd);
-        }
-        
-        if (_this->tty >= 0) {
-            SDL_EVDEV_unmute_keyboard(_this->tty, _this->kb_mode);
-            close(_this->tty);
-        }
-        
-        /* Remove existing devices */
-        while(_this->first != NULL) {
-            SDL_EVDEV_device_removed(_this->first->path);
-        }
-        
-        SDL_assert(_this->first == NULL);
-        SDL_assert(_this->last == NULL);
-        SDL_assert(_this->numdevices == 0);
-        
-        SDL_free(_this);
-        _this = NULL;
-    }
-}
-
-#if SDL_USE_LIBUDEV
-void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath)
-{
-    if (devpath == NULL) {
-        return;
-    }
-    
-    if (!(udev_class & (SDL_UDEV_DEVICE_MOUSE|SDL_UDEV_DEVICE_KEYBOARD))) {
-        return;
-    }
-
-    switch( udev_type ) {
-    case SDL_UDEV_DEVICEADDED:
-        SDL_EVDEV_device_added(devpath);
-        break;
-            
-    case SDL_UDEV_DEVICEREMOVED:
-        SDL_EVDEV_device_removed(devpath);
-        break;
-            
-    default:
-        break;
-    }
-}
-
-#endif /* SDL_USE_LIBUDEV */
-
-void 
-SDL_EVDEV_Poll(void)
-{
-    struct input_event events[32];
-    int i, len;
-    SDL_evdevlist_item *item;
-    SDL_Scancode scan_code;
-    int mouse_button;
-    SDL_Mouse *mouse;
-#ifdef SDL_INPUT_LINUXKD
-    Uint16 modstate;
-    struct kbentry kbe;
-    static char keysym[8];
-    char *end;
-    Uint32 kval;
-#endif
-
-#if SDL_USE_LIBUDEV
-    SDL_UDEV_Poll();
-#endif
-
-    mouse = SDL_GetMouse();
-
-    for (item = _this->first; item != NULL; item = item->next) {
-        while ((len = read(item->fd, events, (sizeof events))) > 0) {
-            len /= sizeof(events[0]);
-            for (i = 0; i < len; ++i) {
-                switch (events[i].type) {
-                case EV_KEY:
-                    if (events[i].code >= BTN_MOUSE && events[i].code < BTN_MOUSE + SDL_arraysize(EVDEV_MouseButtons)) {
-                        mouse_button = events[i].code - BTN_MOUSE;
-                        if (events[i].value == 0) {
-                            SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, EVDEV_MouseButtons[mouse_button]);
-                        } else if (events[i].value == 1) {
-                            SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_PRESSED, EVDEV_MouseButtons[mouse_button]);
-                        }
-                        break;
-                    }
-
-                    /* Probably keyboard */
-                    scan_code = SDL_EVDEV_translate_keycode(events[i].code);
-                    if (scan_code != SDL_SCANCODE_UNKNOWN) {
-                        if (events[i].value == 0) {
-                            SDL_SendKeyboardKey(SDL_RELEASED, scan_code);
-                        } else if (events[i].value == 1 || events[i].value == 2 /* Key repeated */ ) {
-                            SDL_SendKeyboardKey(SDL_PRESSED, scan_code);
-#ifdef SDL_INPUT_LINUXKD
-                            if (_this->console_fd >= 0) {
-                                kbe.kb_index = events[i].code;
-                                /* Convert the key to an UTF-8 char */
-                                /* Ref: http://www.linuxjournal.com/article/2783 */
-                                modstate = SDL_GetModState();
-                                kbe.kb_table = 0;
-                                
-                                /* Ref: http://graphics.stanford.edu/~seander/bithacks.html#ConditionalSetOrClearBitsWithoutBranching */
-                                kbe.kb_table |= -( (modstate & KMOD_LCTRL) != 0) & (1 << KG_CTRLL | 1 << KG_CTRL);
-                                kbe.kb_table |= -( (modstate & KMOD_RCTRL) != 0) & (1 << KG_CTRLR | 1 << KG_CTRL);
-                                kbe.kb_table |= -( (modstate & KMOD_LSHIFT) != 0) & (1 << KG_SHIFTL | 1 << KG_SHIFT);
-                                kbe.kb_table |= -( (modstate & KMOD_RSHIFT) != 0) & (1 << KG_SHIFTR | 1 << KG_SHIFT);
-                                kbe.kb_table |= -( (modstate & KMOD_LALT) != 0) & (1 << KG_ALT);
-                                kbe.kb_table |= -( (modstate & KMOD_RALT) != 0) & (1 << KG_ALTGR);
-
-                                if (ioctl(_this->console_fd, KDGKBENT, (unsigned long)&kbe) == 0 && 
-                                    ((KTYP(kbe.kb_value) == KT_LATIN) || (KTYP(kbe.kb_value) == KT_ASCII) || (KTYP(kbe.kb_value) == KT_LETTER))) 
-                                {
-                                    kval = KVAL(kbe.kb_value);
-                                    
-                                    /* While there's a KG_CAPSSHIFT symbol, it's not useful to build the table index with it
-                                     * because 1 << KG_CAPSSHIFT overflows the 8 bits of kb_table 
-                                     * So, we do the CAPS LOCK logic here. Note that isalpha depends on the locale!
-                                     */
-                                    if ( modstate & KMOD_CAPS && isalpha(kval) ) {
-                                        if ( isupper(kval) ) {
-                                            kval = tolower(kval);
-                                        } else {
-                                            kval = toupper(kval);
-                                        }
-                                    }
-                                     
-                                    /* Convert to UTF-8 and send */
-                                    end = SDL_UCS4ToUTF8( kval, keysym);
-                                    *end = '\0';
-                                    SDL_SendKeyboardText(keysym);
-                                }
-                            }
-#endif /* SDL_INPUT_LINUXKD */
-                        }
-                    }
-                    break;
-                case EV_ABS:
-                    switch(events[i].code) {
-                    case ABS_X:
-                        SDL_SendMouseMotion(mouse->focus, mouse->mouseID, SDL_FALSE, events[i].value, mouse->y);
-                        break;
-                    case ABS_Y:
-                        SDL_SendMouseMotion(mouse->focus, mouse->mouseID, SDL_FALSE, mouse->x, events[i].value);
-                        break;
-                    default:
-                        break;
-                    }
-                    break;
-                case EV_REL:
-                    switch(events[i].code) {
-                    case REL_X:
-                        SDL_SendMouseMotion(mouse->focus, mouse->mouseID, SDL_TRUE, events[i].value, 0);
-                        break;
-                    case REL_Y:
-                        SDL_SendMouseMotion(mouse->focus, mouse->mouseID, SDL_TRUE, 0, events[i].value);
-                        break;
-                    case REL_WHEEL:
-                        SDL_SendMouseWheel(mouse->focus, mouse->mouseID, 0, events[i].value);
-                        break;
-                    case REL_HWHEEL:
-                        SDL_SendMouseWheel(mouse->focus, mouse->mouseID, events[i].value, 0);
-                        break;
-                    default:
-                        break;
-                    }
-                    break;
-                case EV_SYN:
-                    switch (events[i].code) {
-                    case SYN_DROPPED:
-                        SDL_EVDEV_sync_device(item);
-                        break;
-                    default:
-                        break;
-                    }
-                    break;
-                }
-            }
-        }    
-    }
-}
-
-static SDL_Scancode
-SDL_EVDEV_translate_keycode(int keycode)
-{
-    SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;
-
-    if (keycode < SDL_arraysize(EVDEV_Keycodes)) {
-        scancode = EVDEV_Keycodes[keycode];
-    }
-    if (scancode == SDL_SCANCODE_UNKNOWN) {
-        SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list <sdl at libsdl.org> EVDEV KeyCode %d \n", keycode);
-    }
-    return scancode;
-}
-
-static void
-SDL_EVDEV_sync_device(SDL_evdevlist_item *item) 
-{
-    /* TODO: get full state of device and report whatever is required */
-}
-
-#if SDL_USE_LIBUDEV
-static int
-SDL_EVDEV_device_added(const char *devpath)
-{
-    SDL_evdevlist_item *item;
-
-    /* Check to make sure it's not already in list. */
-    for (item = _this->first; item != NULL; item = item->next) {
-        if (strcmp(devpath, item->path) == 0) {
-            return -1;  /* already have this one */
-        }
-    }
-    
-    item = (SDL_evdevlist_item *) SDL_calloc(1, sizeof (SDL_evdevlist_item));
-    if (item == NULL) {
-        return SDL_OutOfMemory();
-    }
-
-    item->fd = open(devpath, O_RDONLY, 0);
-    if (item->fd < 0) {
-        SDL_free(item);
-        return SDL_SetError("Unable to open %s", devpath);
-    }
-    
-    item->path = SDL_strdup(devpath);
-    if (item->path == NULL) {
-        close(item->fd);
-        SDL_free(item);
-        return SDL_OutOfMemory();
-    }
-    
-    /* Non blocking read mode */
-    fcntl(item->fd, F_SETFL, O_NONBLOCK);
-    
-    if (_this->last == NULL) {
-        _this->first = _this->last = item;
-    } else {
-        _this->last->next = item;
-        _this->last = item;
-    }
-    
-    SDL_EVDEV_sync_device(item);
-    
-    return _this->numdevices++;
-}
-#endif /* SDL_USE_LIBUDEV */
-
-static int
-SDL_EVDEV_device_removed(const char *devpath)
-{
-    SDL_evdevlist_item *item;
-    SDL_evdevlist_item *prev = NULL;
-
-    for (item = _this->first; item != NULL; item = item->next) {
-        /* found it, remove it. */
-        if ( strcmp(devpath, item->path) ==0 ) {
-            if (prev != NULL) {
-                prev->next = item->next;
-            } else {
-                SDL_assert(_this->first == item);
-                _this->first = item->next;
-            }
-            if (item == _this->last) {
-                _this->last = prev;
-            }
-            close(item->fd);
-            SDL_free(item->path);
-            SDL_free(item);
-            _this->numdevices--;
-            return 0;
-        }
-        prev = item;
-    }
-
-    return -1;
-}
-
-
-#endif /* SDL_INPUT_LINUXEV */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/deps/SDL2/src/input/evdev/SDL_evdev.h b/deps/SDL2/src/input/evdev/SDL_evdev.h
deleted file mode 100644
index b9311d4..0000000
--- a/deps/SDL2/src/input/evdev/SDL_evdev.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#ifndef _SDL_evdev_h
-#define _SDL_evdev_h
-
-#ifdef SDL_INPUT_LINUXEV
-
-#include "SDL_events.h"
-#include <sys/stat.h>
-
-typedef struct SDL_evdevlist_item
-{
-    char *path;
-    int fd;
-    struct SDL_evdevlist_item *next;
-} SDL_evdevlist_item;
-
-typedef struct SDL_EVDEV_PrivateData
-{
-    SDL_evdevlist_item *first;
-    SDL_evdevlist_item *last;
-    int numdevices;
-    int ref_count;
-    int console_fd;
-    int kb_mode;
-    int tty;
-} SDL_EVDEV_PrivateData;
-
-extern int SDL_EVDEV_Init(void);
-extern void SDL_EVDEV_Quit(void);
-extern void SDL_EVDEV_Poll(void);
-
-
-#endif /* SDL_INPUT_LINUXEV */
-
-#endif /* _SDL_evdev_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/SDL_gamecontroller.c b/deps/SDL2/src/joystick/SDL_gamecontroller.c
deleted file mode 100644
index 603d4db..0000000
--- a/deps/SDL2/src/joystick/SDL_gamecontroller.c
+++ /dev/null
@@ -1,1249 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This is the game controller API for Simple DirectMedia Layer */
-
-#include "SDL_events.h"
-#include "SDL_assert.h"
-#include "SDL_sysjoystick.h"
-#include "SDL_hints.h"
-#include "SDL_gamecontrollerdb.h"
-
-#if !SDL_EVENTS_DISABLED
-#include "../events/SDL_events_c.h"
-#endif
-#define ABS(_x) ((_x) < 0 ? -(_x) : (_x))
-
-
-/* a list of currently opened game controllers */
-static SDL_GameController *SDL_gamecontrollers = NULL;
-
-/* keep track of the hat and mask value that transforms this hat movement into a button/axis press */
-struct _SDL_HatMapping
-{
-    int hat;
-    Uint8 mask;
-};
-
-#define k_nMaxReverseEntries 20
-
-/**
- * We are encoding the "HAT" as 0xhm. where h == hat ID and m == mask
- * MAX 4 hats supported
- */
-#define k_nMaxHatEntries 0x3f + 1
-
-/* our in memory mapping db between joystick objects and controller mappings */
-struct _SDL_ControllerMapping
-{
-    SDL_JoystickGUID guid;
-    const char *name;
-
-    /* mapping of axis/button id to controller version */
-    int axes[SDL_CONTROLLER_AXIS_MAX];
-    int buttonasaxis[SDL_CONTROLLER_AXIS_MAX];
-
-    int buttons[SDL_CONTROLLER_BUTTON_MAX];
-    int axesasbutton[SDL_CONTROLLER_BUTTON_MAX];
-    struct _SDL_HatMapping hatasbutton[SDL_CONTROLLER_BUTTON_MAX];
-
-    /* reverse mapping, joystick indices to buttons */
-    SDL_GameControllerAxis raxes[k_nMaxReverseEntries];
-    SDL_GameControllerAxis rbuttonasaxis[k_nMaxReverseEntries];
-
-    SDL_GameControllerButton rbuttons[k_nMaxReverseEntries];
-    SDL_GameControllerButton raxesasbutton[k_nMaxReverseEntries];
-    SDL_GameControllerButton rhatasbutton[k_nMaxHatEntries];
-
-};
-
-
-/* our hard coded list of mapping support */
-typedef struct _ControllerMapping_t
-{
-    SDL_JoystickGUID guid;
-    char *name;
-    char *mapping;
-    struct _ControllerMapping_t *next;
-} ControllerMapping_t;
-
-static ControllerMapping_t *s_pSupportedControllers = NULL;
-#ifdef SDL_JOYSTICK_DINPUT
-static ControllerMapping_t *s_pXInputMapping = NULL;
-#endif
-
-/* The SDL game controller structure */
-struct _SDL_GameController
-{
-    SDL_Joystick *joystick; /* underlying joystick device */
-    int ref_count;
-    Uint8 hatState[4]; /* the current hat state for this controller */
-    struct _SDL_ControllerMapping mapping; /* the mapping object for this controller */
-    struct _SDL_GameController *next; /* pointer to next game controller we have allocated */
-};
-
-
-int SDL_PrivateGameControllerAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis, Sint16 value);
-int SDL_PrivateGameControllerButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button, Uint8 state);
-
-/*
- * Event filter to fire controller events from joystick ones
- */
-int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
-{
-    switch( event->type )
-    {
-    case SDL_JOYAXISMOTION:
-        {
-            SDL_GameController *controllerlist;
-
-            if ( event->jaxis.axis >= k_nMaxReverseEntries ) break;
-
-            controllerlist = SDL_gamecontrollers;
-            while ( controllerlist )
-            {
-                if ( controllerlist->joystick->instance_id == event->jaxis.which )
-                {
-                    if ( controllerlist->mapping.raxes[event->jaxis.axis] >= 0 ) /* simple axis to axis, send it through */
-                    {
-                        SDL_GameControllerAxis axis = controllerlist->mapping.raxes[event->jaxis.axis];
-                        Sint16 value = event->jaxis.value;
-                        switch (axis)
-                        {
-                            case SDL_CONTROLLER_AXIS_TRIGGERLEFT:
-                            case SDL_CONTROLLER_AXIS_TRIGGERRIGHT:
-                                /* Shift it to be 0 - 32767. */
-                                value = value / 2 + 16384;
-                            default:
-                                break;
-                        }
-                        SDL_PrivateGameControllerAxis( controllerlist, axis, value );
-                    }
-                    else if ( controllerlist->mapping.raxesasbutton[event->jaxis.axis] >= 0 ) /* simulate an axis as a button */
-                    {
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.raxesasbutton[event->jaxis.axis], ABS(event->jaxis.value) > 32768/2 ? SDL_PRESSED : SDL_RELEASED );
-                    }
-                    break;
-                }
-                controllerlist = controllerlist->next;
-            }
-        }
-        break;
-    case SDL_JOYBUTTONDOWN:
-    case SDL_JOYBUTTONUP:
-        {
-            SDL_GameController *controllerlist;
-
-            if ( event->jbutton.button >= k_nMaxReverseEntries ) break;
-
-            controllerlist = SDL_gamecontrollers;
-            while ( controllerlist )
-            {
-                if ( controllerlist->joystick->instance_id == event->jbutton.which )
-                {
-                    if ( controllerlist->mapping.rbuttons[event->jbutton.button] >= 0 ) /* simple button as button */
-                    {
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rbuttons[event->jbutton.button], event->jbutton.state );
-                    }
-                    else if ( controllerlist->mapping.rbuttonasaxis[event->jbutton.button] >= 0 ) /* an button pretending to be an axis */
-                    {
-                        SDL_PrivateGameControllerAxis( controllerlist, controllerlist->mapping.rbuttonasaxis[event->jbutton.button], event->jbutton.state > 0 ? 32767 : 0 );
-                    }
-                    break;
-                }
-                controllerlist = controllerlist->next;
-            }
-        }
-        break;
-    case SDL_JOYHATMOTION:
-        {
-            SDL_GameController *controllerlist;
-
-            if ( event->jhat.hat >= 4 ) break;
-
-            controllerlist = SDL_gamecontrollers;
-            while ( controllerlist )
-            {
-                if ( controllerlist->joystick->instance_id == event->jhat.which )
-                {
-                    Uint8 bSame = controllerlist->hatState[event->jhat.hat] & event->jhat.value;
-                    /* Get list of removed bits (button release) */
-                    Uint8 bChanged = controllerlist->hatState[event->jhat.hat] ^ bSame;
-                    /* the hat idx in the high nibble */
-                    int bHighHat = event->jhat.hat << 4;
-
-                    if ( bChanged & SDL_HAT_DOWN )
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_DOWN], SDL_RELEASED );
-                    if ( bChanged & SDL_HAT_UP )
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_UP], SDL_RELEASED );
-                    if ( bChanged & SDL_HAT_LEFT )
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_LEFT], SDL_RELEASED );
-                    if ( bChanged & SDL_HAT_RIGHT )
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_RIGHT], SDL_RELEASED );
-
-                    /* Get list of added bits (button press) */
-                    bChanged = event->jhat.value ^ bSame;
-
-                    if ( bChanged & SDL_HAT_DOWN )
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_DOWN], SDL_PRESSED );
-                    if ( bChanged & SDL_HAT_UP )
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_UP], SDL_PRESSED );
-                    if ( bChanged & SDL_HAT_LEFT )
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_LEFT], SDL_PRESSED );
-                    if ( bChanged & SDL_HAT_RIGHT )
-                        SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_RIGHT], SDL_PRESSED );
-
-                    /* update our state cache */
-                    controllerlist->hatState[event->jhat.hat] = event->jhat.value;
-
-                    break;
-                }
-                controllerlist = controllerlist->next;
-            }
-        }
-        break;
-    case SDL_JOYDEVICEADDED:
-        {
-            if ( SDL_IsGameController(event->jdevice.which ) )
-            {
-                SDL_Event deviceevent;
-                deviceevent.type = SDL_CONTROLLERDEVICEADDED;
-                deviceevent.cdevice.which = event->jdevice.which;
-                SDL_PushEvent(&deviceevent);
-            }
-        }
-        break;
-    case SDL_JOYDEVICEREMOVED:
-        {
-            SDL_GameController *controllerlist = SDL_gamecontrollers;
-            while ( controllerlist )
-            {
-                if ( controllerlist->joystick->instance_id == event->jdevice.which )
-                {
-                    SDL_Event deviceevent;
-                    deviceevent.type = SDL_CONTROLLERDEVICEREMOVED;
-                    deviceevent.cdevice.which = event->jdevice.which;
-                    SDL_PushEvent(&deviceevent);
-                    break;
-                }
-                controllerlist = controllerlist->next;
-            }
-        }
-        break;
-    default:
-        break;
-    }
-
-    return 1;
-}
-
-/*
- * Helper function to scan the mappings database for a controller with the specified GUID
- */
-ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID *guid)
-{
-    ControllerMapping_t *pSupportedController = s_pSupportedControllers;
-    while ( pSupportedController )
-    {
-        if ( !SDL_memcmp( guid, &pSupportedController->guid, sizeof(*guid) ) )
-        {
-            return pSupportedController;
-        }
-        pSupportedController = pSupportedController->next;
-    }
-    return NULL;
-}
-
-/*
- * Helper function to determine pre-calculated offset to certain joystick mappings
- */
-ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
-{
-#ifdef SDL_JOYSTICK_DINPUT
-    if ( SDL_SYS_IsXInputDeviceIndex(device_index) && s_pXInputMapping )
-    {
-        return s_pXInputMapping;
-    }
-    else
-#endif
-    {
-        SDL_JoystickGUID jGUID = SDL_JoystickGetDeviceGUID( device_index );
-        return SDL_PrivateGetControllerMappingForGUID(&jGUID);
-    }
-
-    return NULL;
-}
-
-static const char* map_StringForControllerAxis[] = {
-    "leftx",
-    "lefty",
-    "rightx",
-    "righty",
-    "lefttrigger",
-    "righttrigger",
-    NULL
-};
-
-/*
- * convert a string to its enum equivalent
- */
-SDL_GameControllerAxis SDL_GameControllerGetAxisFromString( const char *pchString )
-{
-    int entry;
-    if ( !pchString || !pchString[0] )
-        return SDL_CONTROLLER_AXIS_INVALID;
-
-    for ( entry = 0; map_StringForControllerAxis[entry]; ++entry)
-    {
-        if ( !SDL_strcasecmp( pchString, map_StringForControllerAxis[entry] ) )
-            return entry;
-    }
-    return SDL_CONTROLLER_AXIS_INVALID;
-}
-
-/*
- * convert an enum to its string equivalent
- */
-const char* SDL_GameControllerGetStringForAxis( SDL_GameControllerAxis axis )
-{
-    if (axis > SDL_CONTROLLER_AXIS_INVALID && axis < SDL_CONTROLLER_AXIS_MAX)
-    {
-        return map_StringForControllerAxis[axis];
-    }
-    return NULL;
-}
-
-static const char* map_StringForControllerButton[] = {
-    "a",
-    "b",
-    "x",
-    "y",
-    "back",
-    "guide",
-    "start",
-    "leftstick",
-    "rightstick",
-    "leftshoulder",
-    "rightshoulder",
-    "dpup",
-    "dpdown",
-    "dpleft",
-    "dpright",
-    NULL
-};
-
-/*
- * convert a string to its enum equivalent
- */
-SDL_GameControllerButton SDL_GameControllerGetButtonFromString( const char *pchString )
-{
-    int entry;
-    if ( !pchString || !pchString[0] )
-        return SDL_CONTROLLER_BUTTON_INVALID;
-
-    for ( entry = 0; map_StringForControllerButton[entry]; ++entry)
-    {
-        if ( !SDL_strcasecmp( pchString, map_StringForControllerButton[entry] ) )
-        return entry;
-    }
-    return SDL_CONTROLLER_BUTTON_INVALID;
-}
-
-/*
- * convert an enum to its string equivalent
- */
-const char* SDL_GameControllerGetStringForButton( SDL_GameControllerButton axis )
-{
-    if (axis > SDL_CONTROLLER_BUTTON_INVALID && axis < SDL_CONTROLLER_BUTTON_MAX)
-    {
-        return map_StringForControllerButton[axis];
-    }
-    return NULL;
-}
-
-/*
- * given a controller button name and a joystick name update our mapping structure with it
- */
-void SDL_PrivateGameControllerParseButton( const char *szGameButton, const char *szJoystickButton, struct _SDL_ControllerMapping *pMapping )
-{
-    int iSDLButton = 0;
-    SDL_GameControllerButton button;
-    SDL_GameControllerAxis axis;
-    button = SDL_GameControllerGetButtonFromString( szGameButton );
-    axis = SDL_GameControllerGetAxisFromString( szGameButton );
-    iSDLButton = SDL_atoi( &szJoystickButton[1] );
-
-    if ( szJoystickButton[0] == 'a' )
-    {
-        if ( iSDLButton >= k_nMaxReverseEntries )
-        {
-            SDL_SetError("Axis index too large: %d", iSDLButton );
-            return;
-        }
-        if ( axis != SDL_CONTROLLER_AXIS_INVALID )
-        {
-            pMapping->axes[ axis ] = iSDLButton;
-            pMapping->raxes[ iSDLButton ] = axis;
-        }
-        else if ( button != SDL_CONTROLLER_BUTTON_INVALID )
-        {
-            pMapping->axesasbutton[ button ] = iSDLButton;
-            pMapping->raxesasbutton[ iSDLButton ] = button;
-        }
-        else
-        {
-            SDL_assert( !"How did we get here?" );
-        }
-
-    }
-    else if ( szJoystickButton[0] == 'b' )
-    {
-        if ( iSDLButton >= k_nMaxReverseEntries )
-        {
-            SDL_SetError("Button index too large: %d", iSDLButton );
-            return;
-        }
-        if ( button != SDL_CONTROLLER_BUTTON_INVALID )
-        {
-            pMapping->buttons[ button ] = iSDLButton;
-            pMapping->rbuttons[ iSDLButton ] = button;
-        }
-        else if ( axis != SDL_CONTROLLER_AXIS_INVALID )
-        {
-            pMapping->buttonasaxis[ axis ] = iSDLButton;
-            pMapping->rbuttonasaxis[ iSDLButton ] = axis;
-        }
-        else
-        {
-            SDL_assert( !"How did we get here?" );
-        }
-    }
-    else if ( szJoystickButton[0] == 'h' )
-    {
-        int hat = SDL_atoi( &szJoystickButton[1] );
-        int mask = SDL_atoi( &szJoystickButton[3] );
-        if (hat >= 4) {
-            SDL_SetError("Hat index too large: %d", iSDLButton );
-        }
-
-        if ( button != SDL_CONTROLLER_BUTTON_INVALID )
-        {
-            int ridx;
-            pMapping->hatasbutton[ button ].hat = hat;
-            pMapping->hatasbutton[ button ].mask = mask;
-            ridx = (hat << 4) | mask;
-            pMapping->rhatasbutton[ ridx ] = button;
-        }
-        else if ( axis != SDL_CONTROLLER_AXIS_INVALID )
-        {
-            SDL_assert( !"Support hat as axis" );
-        }
-        else
-        {
-            SDL_assert( !"How did we get here?" );
-        }
-    }
-}
-
-
-/*
- * given a controller mapping string update our mapping object
- */
-static void
-SDL_PrivateGameControllerParseControllerConfigString( struct _SDL_ControllerMapping *pMapping, const char *pchString )
-{
-    char szGameButton[20];
-    char szJoystickButton[20];
-    SDL_bool bGameButton = SDL_TRUE;
-    int i = 0;
-    const char *pchPos = pchString;
-
-    SDL_memset( szGameButton, 0x0, sizeof(szGameButton) );
-    SDL_memset( szJoystickButton, 0x0, sizeof(szJoystickButton) );
-
-    while ( pchPos && *pchPos )
-    {
-        if ( *pchPos == ':' )
-        {
-            i = 0;
-            bGameButton = SDL_FALSE;
-        }
-        else if ( *pchPos == ' ' )
-        {
-
-        }
-        else if ( *pchPos == ',' )
-        {
-            i = 0;
-            bGameButton = SDL_TRUE;
-            SDL_PrivateGameControllerParseButton( szGameButton, szJoystickButton, pMapping );
-            SDL_memset( szGameButton, 0x0, sizeof(szGameButton) );
-            SDL_memset( szJoystickButton, 0x0, sizeof(szJoystickButton) );
-
-        }
-        else if ( bGameButton )
-        {
-            if ( i >=  sizeof(szGameButton))
-            {
-                SDL_SetError( "Button name too large: %s", szGameButton );
-                return;
-            }
-            szGameButton[i] = *pchPos;
-            i++;
-        }
-        else
-        {
-            if ( i >=  sizeof(szJoystickButton))
-            {
-                SDL_SetError( "Joystick button name too large: %s", szJoystickButton );
-                return;
-            }
-            szJoystickButton[i] = *pchPos;
-            i++;
-        }
-        pchPos++;
-    }
-
-    SDL_PrivateGameControllerParseButton( szGameButton, szJoystickButton, pMapping );
-
-}
-
-/*
- * Make a new button mapping struct
- */
-void SDL_PrivateLoadButtonMapping( struct _SDL_ControllerMapping *pMapping, SDL_JoystickGUID guid, const char *pchName, const char *pchMapping )
-{
-    int j;
-
-    pMapping->guid = guid;
-    pMapping->name = pchName;
-
-    /* set all the button mappings to non defaults */
-    for ( j = 0; j < SDL_CONTROLLER_AXIS_MAX; j++ )
-    {
-        pMapping->axes[j] = -1;
-        pMapping->buttonasaxis[j] = -1;
-    }
-    for ( j = 0; j < SDL_CONTROLLER_BUTTON_MAX; j++ )
-    {
-        pMapping->buttons[j] = -1;
-        pMapping->axesasbutton[j] = -1;
-        pMapping->hatasbutton[j].hat = -1;
-    }
-
-    for ( j = 0; j < k_nMaxReverseEntries; j++ )
-    {
-        pMapping->raxes[j] = SDL_CONTROLLER_AXIS_INVALID;
-        pMapping->rbuttonasaxis[j] = SDL_CONTROLLER_AXIS_INVALID;
-        pMapping->rbuttons[j] = SDL_CONTROLLER_BUTTON_INVALID;
-        pMapping->raxesasbutton[j] = SDL_CONTROLLER_BUTTON_INVALID;
-    }
-
-    for (j = 0; j < k_nMaxHatEntries; j++)
-    {
-        pMapping->rhatasbutton[j] = SDL_CONTROLLER_BUTTON_INVALID;
-    }
-
-    SDL_PrivateGameControllerParseControllerConfigString( pMapping, pchMapping );
-}
-
-
-/*
- * grab the guid string from a mapping string
- */
-char *SDL_PrivateGetControllerGUIDFromMappingString( const char *pMapping )
-{
-    const char *pFirstComma = SDL_strchr( pMapping, ',' );
-    if ( pFirstComma )
-    {
-        char *pchGUID = SDL_malloc( pFirstComma - pMapping + 1 );
-        if ( !pchGUID )
-        {
-            SDL_OutOfMemory();
-            return NULL;
-        }
-        SDL_memcpy( pchGUID, pMapping, pFirstComma - pMapping );
-        pchGUID[ pFirstComma - pMapping ] = 0;
-        return pchGUID;
-    }
-    return NULL;
-}
-
-
-/*
- * grab the name string from a mapping string
- */
-char *SDL_PrivateGetControllerNameFromMappingString( const char *pMapping )
-{
-    const char *pFirstComma, *pSecondComma;
-    char *pchName;
-
-    pFirstComma = SDL_strchr( pMapping, ',' );
-    if ( !pFirstComma )
-        return NULL;
-
-    pSecondComma = SDL_strchr( pFirstComma + 1, ',' );
-    if ( !pSecondComma )
-        return NULL;
-
-    pchName = SDL_malloc( pSecondComma - pFirstComma );
-    if ( !pchName )
-    {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    SDL_memcpy( pchName, pFirstComma + 1, pSecondComma - pFirstComma );
-    pchName[ pSecondComma - pFirstComma - 1 ] = 0;
-    return pchName;
-}
-
-
-/*
- * grab the button mapping string from a mapping string
- */
-char *SDL_PrivateGetControllerMappingFromMappingString( const char *pMapping )
-{
-    const char *pFirstComma, *pSecondComma;
-
-    pFirstComma = SDL_strchr( pMapping, ',' );
-    if ( !pFirstComma )
-        return NULL;
-
-    pSecondComma = SDL_strchr( pFirstComma + 1, ',' );
-    if ( !pSecondComma )
-        return NULL;
-
-    return SDL_strdup(pSecondComma + 1); /* mapping is everything after the 3rd comma */
-}
-
-void SDL_PrivateGameControllerRefreshMapping( ControllerMapping_t *pControllerMapping )
-{
-    SDL_GameController *gamecontrollerlist = SDL_gamecontrollers;
-    while ( gamecontrollerlist )
-    {
-        if ( !SDL_memcmp( &gamecontrollerlist->mapping.guid, &pControllerMapping->guid, sizeof(pControllerMapping->guid) ) )
-        {
-            SDL_Event event;
-            event.type = SDL_CONTROLLERDEVICEREMAPPED;
-            event.cdevice.which = gamecontrollerlist->joystick->instance_id;
-            SDL_PushEvent(&event);
-
-            /* Not really threadsafe.  Should this lock access within SDL_GameControllerEventWatcher? */
-            SDL_PrivateLoadButtonMapping(&gamecontrollerlist->mapping, pControllerMapping->guid, pControllerMapping->name, pControllerMapping->mapping);
-        }
-
-        gamecontrollerlist = gamecontrollerlist->next;
-    }
-}
-
-/*
- * Add or update an entry into the Mappings Database
- */
-int
-SDL_GameControllerAddMapping( const char *mappingString )
-{
-    char *pchGUID;
-    char *pchName;
-    char *pchMapping;
-    SDL_JoystickGUID jGUID;
-    ControllerMapping_t *pControllerMapping;
-#ifdef SDL_JOYSTICK_DINPUT
-    SDL_bool is_xinput_mapping = SDL_FALSE;
-#endif
-
-    pchGUID = SDL_PrivateGetControllerGUIDFromMappingString( mappingString );
-    if (!pchGUID) {
-        return -1;
-    }
-#ifdef SDL_JOYSTICK_DINPUT
-    if ( !SDL_strcasecmp( pchGUID, "xinput" ) ) {
-        is_xinput_mapping = SDL_TRUE;
-    }
-#endif
-    jGUID = SDL_JoystickGetGUIDFromString(pchGUID);
-    SDL_free(pchGUID);
-
-    pControllerMapping = SDL_PrivateGetControllerMappingForGUID(&jGUID);
-
-    pchName = SDL_PrivateGetControllerNameFromMappingString( mappingString );
-    if (!pchName) return -1;
-
-    pchMapping = SDL_PrivateGetControllerMappingFromMappingString( mappingString );
-    if (!pchMapping) {
-        SDL_free( pchName );
-        return -1;
-    }
-
-    if (pControllerMapping) {
-        /* Update existing mapping */
-        SDL_free( pControllerMapping->name );
-        pControllerMapping->name = pchName;
-        SDL_free( pControllerMapping->mapping );
-        pControllerMapping->mapping = pchMapping;
-        /* refresh open controllers */
-        SDL_PrivateGameControllerRefreshMapping( pControllerMapping );
-        return 0;
-    } else {
-        pControllerMapping = SDL_malloc( sizeof(*pControllerMapping) );
-        if (!pControllerMapping) {
-            SDL_free( pchName );
-            SDL_free( pchMapping );
-            return SDL_OutOfMemory();
-        }
-#ifdef SDL_JOYSTICK_DINPUT
-        if ( is_xinput_mapping )
-        {
-            s_pXInputMapping = pControllerMapping;
-        }
-#endif
-        pControllerMapping->guid = jGUID;
-        pControllerMapping->name = pchName;
-        pControllerMapping->mapping = pchMapping;
-        pControllerMapping->next = s_pSupportedControllers;
-        s_pSupportedControllers = pControllerMapping;
-        return 1;
-    }
-}
-
-/*
- * Get the mapping string for this GUID
- */
-char *
-SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid )
-{
-    char *pMappingString = NULL;
-    ControllerMapping_t *mapping = SDL_PrivateGetControllerMappingForGUID(&guid);
-    if (mapping) {
-        char pchGUID[33];
-        size_t needed;
-        SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID));
-        /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */
-        needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1;
-        pMappingString = SDL_malloc( needed );
-        SDL_snprintf( pMappingString, needed, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping );
-    }
-    return pMappingString;
-}
-
-/*
- * Get the mapping string for this device
- */
-char *
-SDL_GameControllerMapping( SDL_GameController * gamecontroller )
-{
-    return SDL_GameControllerMappingForGUID( gamecontroller->mapping.guid );
-}
-
-static void
-SDL_GameControllerLoadHints()
-{
-    const char *hint = SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG);
-    if ( hint && hint[0] ) {
-        size_t nchHints = SDL_strlen( hint );
-        char *pUserMappings = SDL_malloc( nchHints + 1 );
-        char *pTempMappings = pUserMappings;
-        SDL_memcpy( pUserMappings, hint, nchHints );
-        while ( pUserMappings ) {
-            char *pchNewLine = NULL;
-
-            pchNewLine = SDL_strchr( pUserMappings, '\n' );
-            if ( pchNewLine )
-                *pchNewLine = '\0';
-
-            SDL_GameControllerAddMapping( pUserMappings );
-
-            if ( pchNewLine )
-                pUserMappings = pchNewLine + 1;
-            else
-                pUserMappings = NULL;
-        }
-        SDL_free(pTempMappings);
-    }
-}
-
-/*
- * Initialize the game controller system, mostly load our DB of controller config mappings
- */
-int
-SDL_GameControllerInit(void)
-{
-    int i = 0;
-    const char *pMappingString = NULL;
-    s_pSupportedControllers = NULL;
-    pMappingString = s_ControllerMappings[i];
-    while ( pMappingString )
-    {
-        SDL_GameControllerAddMapping( pMappingString );
-
-        i++;
-        pMappingString = s_ControllerMappings[i];
-    }
-
-    /* load in any user supplied config */
-    SDL_GameControllerLoadHints();
-
-    /* watch for joy events and fire controller ones if needed */
-    SDL_AddEventWatch( SDL_GameControllerEventWatcher, NULL );
-
-    return (0);
-}
-
-
-/*
- * Get the implementation dependent name of a controller
- */
-const char *
-SDL_GameControllerNameForIndex(int device_index)
-{
-    ControllerMapping_t *pSupportedController =  SDL_PrivateGetControllerMapping(device_index);
-    if ( pSupportedController )
-    {
-        return pSupportedController->name;
-    }
-    return NULL;
-}
-
-
-/*
- * Return 1 if the joystick at this device index is a supported controller
- */
-SDL_bool
-SDL_IsGameController(int device_index)
-{
-    ControllerMapping_t *pSupportedController =  SDL_PrivateGetControllerMapping(device_index);
-    if ( pSupportedController )
-    {
-        return SDL_TRUE;
-    }
-
-    return SDL_FALSE;
-}
-
-/*
- * Open a controller for use - the index passed as an argument refers to
- * the N'th controller on the system.  This index is the value which will
- * identify this controller in future controller events.
- *
- * This function returns a controller identifier, or NULL if an error occurred.
- */
-SDL_GameController *
-SDL_GameControllerOpen(int device_index)
-{
-    SDL_GameController *gamecontroller;
-    SDL_GameController *gamecontrollerlist;
-    ControllerMapping_t *pSupportedController = NULL;
-
-    if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
-        SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
-        return (NULL);
-    }
-
-    gamecontrollerlist = SDL_gamecontrollers;
-    /* If the controller is already open, return it */
-    while ( gamecontrollerlist )
-    {
-        if ( SDL_SYS_GetInstanceIdOfDeviceIndex(device_index) == gamecontrollerlist->joystick->instance_id ) {
-                gamecontroller = gamecontrollerlist;
-                ++gamecontroller->ref_count;
-                return (gamecontroller);
-        }
-        gamecontrollerlist = gamecontrollerlist->next;
-    }
-
-    /* Find a controller mapping */
-    pSupportedController =  SDL_PrivateGetControllerMapping(device_index);
-    if ( !pSupportedController ) {
-        SDL_SetError("Couldn't find mapping for device (%d)", device_index );
-        return (NULL);
-    }
-
-    /* Create and initialize the joystick */
-    gamecontroller = (SDL_GameController *) SDL_malloc((sizeof *gamecontroller));
-    if (gamecontroller == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    SDL_memset(gamecontroller, 0, (sizeof *gamecontroller));
-    gamecontroller->joystick = SDL_JoystickOpen(device_index);
-    if ( !gamecontroller->joystick ) {
-        SDL_free(gamecontroller);
-        return NULL;
-    }
-
-    SDL_PrivateLoadButtonMapping( &gamecontroller->mapping, pSupportedController->guid, pSupportedController->name, pSupportedController->mapping );
-
-    /* Add joystick to list */
-    ++gamecontroller->ref_count;
-    /* Link the joystick in the list */
-    gamecontroller->next = SDL_gamecontrollers;
-    SDL_gamecontrollers = gamecontroller;
-
-    SDL_SYS_JoystickUpdate( gamecontroller->joystick );
-
-    return (gamecontroller);
-}
-
-/*
- * Manually pump for controller updates.
- */
-void
-SDL_GameControllerUpdate(void)
-{
-    /* Just for API completeness; the joystick API does all the work. */
-    SDL_JoystickUpdate();
-}
-
-
-/*
- * Get the current state of an axis control on a controller
- */
-Sint16
-SDL_GameControllerGetAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis)
-{
-    if ( !gamecontroller )
-        return 0;
-
-    if (gamecontroller->mapping.axes[axis] >= 0 )
-    {
-        Sint16 value = ( SDL_JoystickGetAxis( gamecontroller->joystick, gamecontroller->mapping.axes[axis]) );
-        switch (axis)
-        {
-            case SDL_CONTROLLER_AXIS_TRIGGERLEFT:
-            case SDL_CONTROLLER_AXIS_TRIGGERRIGHT:
-                /* Shift it to be 0 - 32767. */
-                value = value / 2 + 16384;
-            default:
-                break;
-        }
-        return value;
-    }
-    else if (gamecontroller->mapping.buttonasaxis[axis] >= 0 )
-    {
-        Uint8 value;
-        value = SDL_JoystickGetButton( gamecontroller->joystick, gamecontroller->mapping.buttonasaxis[axis] );
-        if ( value > 0 )
-            return 32767;
-        return 0;
-    }
-    return 0;
-}
-
-
-/*
- * Get the current state of a button on a controller
- */
-Uint8
-SDL_GameControllerGetButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button)
-{
-    if ( !gamecontroller )
-        return 0;
-
-    if ( gamecontroller->mapping.buttons[button] >= 0 )
-    {
-        return ( SDL_JoystickGetButton( gamecontroller->joystick, gamecontroller->mapping.buttons[button] ) );
-    }
-    else if ( gamecontroller->mapping.axesasbutton[button] >= 0 )
-    {
-        Sint16 value;
-        value = SDL_JoystickGetAxis( gamecontroller->joystick, gamecontroller->mapping.axesasbutton[button] );
-        if ( ABS(value) > 32768/2 )
-            return 1;
-        return 0;
-    }
-    else if ( gamecontroller->mapping.hatasbutton[button].hat >= 0 )
-    {
-        Uint8 value;
-        value = SDL_JoystickGetHat( gamecontroller->joystick, gamecontroller->mapping.hatasbutton[button].hat );
-
-        if ( value & gamecontroller->mapping.hatasbutton[button].mask )
-            return 1;
-        return 0;
-    }
-
-    return 0;
-}
-
-/*
- * Return if the joystick in question is currently attached to the system,
- *  \return 0 if not plugged in, 1 if still present.
- */
-SDL_bool
-SDL_GameControllerGetAttached( SDL_GameController * gamecontroller )
-{
-    if ( !gamecontroller )
-        return SDL_FALSE;
-
-    return SDL_JoystickGetAttached(gamecontroller->joystick);
-}
-
-
-/*
- * Get the number of multi-dimensional axis controls on a joystick
- */
-const char *
-SDL_GameControllerName(SDL_GameController * gamecontroller)
-{
-    if ( !gamecontroller )
-        return NULL;
-
-    return (gamecontroller->mapping.name);
-}
-
-
-/*
- * Get the joystick for this controller
- */
-SDL_Joystick *SDL_GameControllerGetJoystick(SDL_GameController * gamecontroller)
-{
-    if ( !gamecontroller )
-        return NULL;
-
-    return gamecontroller->joystick;
-}
-
-/**
- * Get the SDL joystick layer binding for this controller axis mapping
- */
-SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis)
-{
-    SDL_GameControllerButtonBind bind;
-    SDL_memset( &bind, 0x0, sizeof(bind) );
-
-    if ( !gamecontroller || axis == SDL_CONTROLLER_AXIS_INVALID )
-        return bind;
-
-    if (gamecontroller->mapping.axes[axis] >= 0 )
-    {
-        bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
-        bind.value.button = gamecontroller->mapping.axes[axis];
-    }
-    else if (gamecontroller->mapping.buttonasaxis[axis] >= 0 )
-    {
-        bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
-        bind.value.button = gamecontroller->mapping.buttonasaxis[axis];
-    }
-
-    return bind;
-}
-
-
-/**
- * Get the SDL joystick layer binding for this controller button mapping
- */
-SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button)
-{
-    SDL_GameControllerButtonBind bind;
-    SDL_memset( &bind, 0x0, sizeof(bind) );
-
-    if ( !gamecontroller || button == SDL_CONTROLLER_BUTTON_INVALID )
-        return bind;
-
-    if ( gamecontroller->mapping.buttons[button] >= 0 )
-    {
-        bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
-        bind.value.button = gamecontroller->mapping.buttons[button];
-    }
-    else if ( gamecontroller->mapping.axesasbutton[button] >= 0 )
-    {
-        bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
-        bind.value.axis = gamecontroller->mapping.axesasbutton[button];
-    }
-    else if ( gamecontroller->mapping.hatasbutton[button].hat >= 0 )
-    {
-        bind.bindType = SDL_CONTROLLER_BINDTYPE_HAT;
-        bind.value.hat.hat = gamecontroller->mapping.hatasbutton[button].hat;
-        bind.value.hat.hat_mask = gamecontroller->mapping.hatasbutton[button].mask;
-    }
-
-    return bind;
-}
-
-
-/*
- * Close a joystick previously opened with SDL_JoystickOpen()
- */
-void
-SDL_GameControllerClose(SDL_GameController * gamecontroller)
-{
-    SDL_GameController *gamecontrollerlist, *gamecontrollerlistprev;
-
-    if ( !gamecontroller )
-        return;
-
-    /* First decrement ref count */
-    if (--gamecontroller->ref_count > 0) {
-        return;
-    }
-
-    SDL_JoystickClose( gamecontroller->joystick );
-
-    gamecontrollerlist = SDL_gamecontrollers;
-    gamecontrollerlistprev = NULL;
-    while ( gamecontrollerlist )
-    {
-        if (gamecontroller == gamecontrollerlist)
-        {
-            if ( gamecontrollerlistprev )
-            {
-                /* unlink this entry */
-                gamecontrollerlistprev->next = gamecontrollerlist->next;
-            }
-            else
-            {
-                SDL_gamecontrollers = gamecontroller->next;
-            }
-
-            break;
-        }
-        gamecontrollerlistprev = gamecontrollerlist;
-        gamecontrollerlist = gamecontrollerlist->next;
-    }
-
-    SDL_free(gamecontroller);
-}
-
-
-/*
- * Quit the controller subsystem
- */
-void
-SDL_GameControllerQuit(void)
-{
-    ControllerMapping_t *pControllerMap;
-    while ( SDL_gamecontrollers )
-    {
-        SDL_gamecontrollers->ref_count = 1;
-        SDL_GameControllerClose(SDL_gamecontrollers);
-    }
-
-    while ( s_pSupportedControllers )
-    {
-        pControllerMap = s_pSupportedControllers;
-        s_pSupportedControllers = s_pSupportedControllers->next;
-        SDL_free( pControllerMap->name );
-        SDL_free( pControllerMap );
-    }
-
-    SDL_DelEventWatch( SDL_GameControllerEventWatcher, NULL );
-
-}
-
-/*
- * Event filter to transform joystick events into appropriate game controller ones
- */
-int
-SDL_PrivateGameControllerAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis, Sint16 value)
-{
-    int posted;
-
-    /* translate the event, if desired */
-    posted = 0;
-#if !SDL_EVENTS_DISABLED
-    if (SDL_GetEventState(SDL_CONTROLLERAXISMOTION) == SDL_ENABLE) {
-        SDL_Event event;
-        event.type = SDL_CONTROLLERAXISMOTION;
-        event.caxis.which = gamecontroller->joystick->instance_id;
-        event.caxis.axis = axis;
-        event.caxis.value = value;
-        posted = SDL_PushEvent(&event) == 1;
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-    return (posted);
-}
-
-
-/*
- * Event filter to transform joystick events into appropriate game controller ones
- */
-int
-SDL_PrivateGameControllerButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button, Uint8 state)
-{
-    int posted;
-#if !SDL_EVENTS_DISABLED
-    SDL_Event event;
-
-    if ( button == SDL_CONTROLLER_BUTTON_INVALID )
-        return (0);
-
-    switch (state) {
-    case SDL_PRESSED:
-        event.type = SDL_CONTROLLERBUTTONDOWN;
-        break;
-    case SDL_RELEASED:
-        event.type = SDL_CONTROLLERBUTTONUP;
-        break;
-    default:
-        /* Invalid state -- bail */
-        return (0);
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-
-    /* translate the event, if desired */
-    posted = 0;
-#if !SDL_EVENTS_DISABLED
-    if (SDL_GetEventState(event.type) == SDL_ENABLE) {
-        event.cbutton.which = gamecontroller->joystick->instance_id;
-        event.cbutton.button = button;
-        event.cbutton.state = state;
-        posted = SDL_PushEvent(&event) == 1;
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-    return (posted);
-}
-
-/*
- * Turn off controller events
- */
-int
-SDL_GameControllerEventState(int state)
-{
-#if SDL_EVENTS_DISABLED
-    return SDL_IGNORE;
-#else
-    const Uint32 event_list[] = {
-        SDL_CONTROLLERAXISMOTION, SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP,
-        SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED,
-    };
-    unsigned int i;
-
-    switch (state) {
-    case SDL_QUERY:
-        state = SDL_IGNORE;
-        for (i = 0; i < SDL_arraysize(event_list); ++i) {
-            state = SDL_EventState(event_list[i], SDL_QUERY);
-            if (state == SDL_ENABLE) {
-                break;
-            }
-        }
-        break;
-    default:
-        for (i = 0; i < SDL_arraysize(event_list); ++i) {
-            SDL_EventState(event_list[i], state);
-        }
-        break;
-    }
-    return (state);
-#endif /* SDL_EVENTS_DISABLED */
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/SDL_gamecontrollerdb.h b/deps/SDL2/src/joystick/SDL_gamecontrollerdb.h
deleted file mode 100644
index 7f6c7b2..0000000
--- a/deps/SDL2/src/joystick/SDL_gamecontrollerdb.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-
-/* Default mappings we support
-
-   The easiest way to generate a new mapping is to start Steam in Big Picture
-   mode, configure your joystick and then look in config/config.vdf in your
-   Steam installation directory for the "SDL_GamepadBind" entry.
- */
-static const char *s_ControllerMappings [] =
-{
-#ifdef SDL_JOYSTICK_DINPUT
-    "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
-    "ffff0000000000000000504944564944,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
-    "6d0416c2000000000000504944564944,Generic DirectInput Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
-	"6d0419c2000000000000504944564944,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */
-    "88880803000000000000504944564944,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,",
-    "4c056802000000000000504944564944,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
-    "25090500000000000000504944564944,PS3 DualShock,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,",
-    "xinput,X360 Controller,a:b10,b:b11,back:b5,dpdown:b1,dpleft:b2,dpright:b3,dpup:b0,guide:b14,leftshoulder:b8,leftstick:b6,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b7,righttrigger:a5,rightx:a2,righty:a3,start:b4,x:b12,y:b13,",
-#elif defined(__MACOSX__)
-    "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
-    "6d0400000000000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */
-    "6d0400000000000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
-    "6d040000000000001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,",
-    "6d0400000000000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* This includes F710 in DInput mode and the "Logitech Cordless RumblePad 2", at the very least. */
-    "4c050000000000006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
-    "5e040000000000008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,",
-#elif defined(__LINUX__)
-    "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
-    "03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,",
-    "030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
-    "030000006d0400001dc2000014400000,Logitech F310 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
-    "030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
-    "030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */
-    "030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
-    "030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
-    "030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
-    "030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
-    "030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
-#endif
-    NULL
-};
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/SDL_joystick.c b/deps/SDL2/src/joystick/SDL_joystick.c
deleted file mode 100644
index 3906ec2..0000000
--- a/deps/SDL2/src/joystick/SDL_joystick.c
+++ /dev/null
@@ -1,854 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This is the joystick API for Simple DirectMedia Layer */
-
-#include "SDL.h"
-#include "SDL_events.h"
-#include "SDL_sysjoystick.h"
-#include "SDL_assert.h"
-#include "SDL_hints.h"
-
-#if !SDL_EVENTS_DISABLED
-#include "../events/SDL_events_c.h"
-#endif
-
-static SDL_bool SDL_joystick_allows_background_events = SDL_FALSE;
-static SDL_Joystick *SDL_joysticks = NULL;
-static SDL_Joystick *SDL_updating_joystick = NULL;
-
-static void
-SDL_JoystickAllowBackgroundEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
-{
-    if (hint && *hint == '1') {
-        SDL_joystick_allows_background_events = SDL_TRUE;
-    } else {
-        SDL_joystick_allows_background_events = SDL_FALSE;
-    }
-}
-
-int
-SDL_JoystickInit(void)
-{
-    int status;
-
-    /* See if we should allow joystick events while in the background */
-    SDL_AddHintCallback(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
-                        SDL_JoystickAllowBackgroundEventsChanged, NULL);
-
-#if !SDL_EVENTS_DISABLED
-    if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0) {
-        return -1;
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-
-    status = SDL_SYS_JoystickInit();
-    if (status >= 0) {
-        status = 0;
-    }
-    return (status);
-}
-
-/*
- * Count the number of joysticks attached to the system
- */
-int
-SDL_NumJoysticks(void)
-{
-    return SDL_SYS_NumJoysticks();
-}
-
-/*
- * Get the implementation dependent name of a joystick
- */
-const char *
-SDL_JoystickNameForIndex(int device_index)
-{
-    if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
-        SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
-        return (NULL);
-    }
-    return (SDL_SYS_JoystickNameForDeviceIndex(device_index));
-}
-
-/*
- * Open a joystick for use - the index passed as an argument refers to
- * the N'th joystick on the system.  This index is the value which will
- * identify this joystick in future joystick events.
- *
- * This function returns a joystick identifier, or NULL if an error occurred.
- */
-SDL_Joystick *
-SDL_JoystickOpen(int device_index)
-{
-    SDL_Joystick *joystick;
-    SDL_Joystick *joysticklist;
-    const char *joystickname = NULL;
-
-    if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
-        SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
-        return (NULL);
-    }
-
-    joysticklist = SDL_joysticks;
-    /* If the joystick is already open, return it
-    * it is important that we have a single joystick * for each instance id
-    */
-    while ( joysticklist )
-    {
-        if ( SDL_SYS_GetInstanceIdOfDeviceIndex(device_index) == joysticklist->instance_id ) {
-                joystick = joysticklist;
-                ++joystick->ref_count;
-                return (joystick);
-        }
-        joysticklist = joysticklist->next;
-    }
-
-    /* Create and initialize the joystick */
-    joystick = (SDL_Joystick *) SDL_malloc((sizeof *joystick));
-    if (joystick == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    SDL_memset(joystick, 0, (sizeof *joystick));
-    if (SDL_SYS_JoystickOpen(joystick, device_index) < 0) {
-        SDL_free(joystick);
-        return NULL;
-    }
-
-    joystickname = SDL_SYS_JoystickNameForDeviceIndex( device_index );
-    if ( joystickname )
-        joystick->name = SDL_strdup( joystickname );
-    else
-        joystick->name = NULL;
-
-    if (joystick->naxes > 0) {
-        joystick->axes = (Sint16 *) SDL_malloc
-            (joystick->naxes * sizeof(Sint16));
-    }
-    if (joystick->nhats > 0) {
-        joystick->hats = (Uint8 *) SDL_malloc
-            (joystick->nhats * sizeof(Uint8));
-    }
-    if (joystick->nballs > 0) {
-        joystick->balls = (struct balldelta *) SDL_malloc
-            (joystick->nballs * sizeof(*joystick->balls));
-    }
-    if (joystick->nbuttons > 0) {
-        joystick->buttons = (Uint8 *) SDL_malloc
-            (joystick->nbuttons * sizeof(Uint8));
-    }
-    if (((joystick->naxes > 0) && !joystick->axes)
-        || ((joystick->nhats > 0) && !joystick->hats)
-        || ((joystick->nballs > 0) && !joystick->balls)
-        || ((joystick->nbuttons > 0) && !joystick->buttons)) {
-        SDL_OutOfMemory();
-        SDL_JoystickClose(joystick);
-        return NULL;
-    }
-    if (joystick->axes) {
-        SDL_memset(joystick->axes, 0, joystick->naxes * sizeof(Sint16));
-    }
-    if (joystick->hats) {
-        SDL_memset(joystick->hats, 0, joystick->nhats * sizeof(Uint8));
-    }
-    if (joystick->balls) {
-        SDL_memset(joystick->balls, 0,
-            joystick->nballs * sizeof(*joystick->balls));
-    }
-    if (joystick->buttons) {
-        SDL_memset(joystick->buttons, 0, joystick->nbuttons * sizeof(Uint8));
-    }
-
-    /* Add joystick to list */
-    ++joystick->ref_count;
-    /* Link the joystick in the list */
-    joystick->next = SDL_joysticks;
-    SDL_joysticks = joystick;
-
-    SDL_SYS_JoystickUpdate( joystick );
-
-    return (joystick);
-}
-
-
-/*
- * Checks to make sure the joystick is valid.
- */
-int
-SDL_PrivateJoystickValid(SDL_Joystick * joystick)
-{
-    int valid;
-
-    if ( joystick == NULL ) {
-        SDL_SetError("Joystick hasn't been opened yet");
-        valid = 0;
-    } else {
-        valid = 1;
-    }
-
-    if ( joystick && joystick->closed )
-    {
-        valid = 0;
-    }
-
-    return valid;
-}
-
-/*
- * Get the number of multi-dimensional axis controls on a joystick
- */
-int
-SDL_JoystickNumAxes(SDL_Joystick * joystick)
-{
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (-1);
-    }
-    return (joystick->naxes);
-}
-
-/*
- * Get the number of hats on a joystick
- */
-int
-SDL_JoystickNumHats(SDL_Joystick * joystick)
-{
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (-1);
-    }
-    return (joystick->nhats);
-}
-
-/*
- * Get the number of trackballs on a joystick
- */
-int
-SDL_JoystickNumBalls(SDL_Joystick * joystick)
-{
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (-1);
-    }
-    return (joystick->nballs);
-}
-
-/*
- * Get the number of buttons on a joystick
- */
-int
-SDL_JoystickNumButtons(SDL_Joystick * joystick)
-{
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (-1);
-    }
-    return (joystick->nbuttons);
-}
-
-/*
- * Get the current state of an axis control on a joystick
- */
-Sint16
-SDL_JoystickGetAxis(SDL_Joystick * joystick, int axis)
-{
-    Sint16 state;
-
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (0);
-    }
-    if (axis < joystick->naxes) {
-        state = joystick->axes[axis];
-    } else {
-        SDL_SetError("Joystick only has %d axes", joystick->naxes);
-        state = 0;
-    }
-    return (state);
-}
-
-/*
- * Get the current state of a hat on a joystick
- */
-Uint8
-SDL_JoystickGetHat(SDL_Joystick * joystick, int hat)
-{
-    Uint8 state;
-
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (0);
-    }
-    if (hat < joystick->nhats) {
-        state = joystick->hats[hat];
-    } else {
-        SDL_SetError("Joystick only has %d hats", joystick->nhats);
-        state = 0;
-    }
-    return (state);
-}
-
-/*
- * Get the ball axis change since the last poll
- */
-int
-SDL_JoystickGetBall(SDL_Joystick * joystick, int ball, int *dx, int *dy)
-{
-    int retval;
-
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (-1);
-    }
-
-    retval = 0;
-    if (ball < joystick->nballs) {
-        if (dx) {
-            *dx = joystick->balls[ball].dx;
-        }
-        if (dy) {
-            *dy = joystick->balls[ball].dy;
-        }
-        joystick->balls[ball].dx = 0;
-        joystick->balls[ball].dy = 0;
-    } else {
-        return SDL_SetError("Joystick only has %d balls", joystick->nballs);
-    }
-    return (retval);
-}
-
-/*
- * Get the current state of a button on a joystick
- */
-Uint8
-SDL_JoystickGetButton(SDL_Joystick * joystick, int button)
-{
-    Uint8 state;
-
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (0);
-    }
-    if (button < joystick->nbuttons) {
-        state = joystick->buttons[button];
-    } else {
-        SDL_SetError("Joystick only has %d buttons", joystick->nbuttons);
-        state = 0;
-    }
-    return (state);
-}
-
-/*
- * Return if the joystick in question is currently attached to the system,
- *  \return SDL_FALSE if not plugged in, SDL_TRUE if still present.
- */
-SDL_bool
-SDL_JoystickGetAttached(SDL_Joystick * joystick)
-{
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return SDL_FALSE;
-    }
-
-    return SDL_SYS_JoystickAttached(joystick);
-}
-
-/*
- * Get the instance id for this opened joystick
- */
-SDL_JoystickID
-SDL_JoystickInstanceID(SDL_Joystick * joystick)
-{
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (-1);
-    }
-
-    return (joystick->instance_id);
-}
-
-/*
- * Get the friendly name of this joystick
- */
-const char *
-SDL_JoystickName(SDL_Joystick * joystick)
-{
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        return (NULL);
-    }
-
-    return (joystick->name);
-}
-
-/*
- * Close a joystick previously opened with SDL_JoystickOpen()
- */
-void
-SDL_JoystickClose(SDL_Joystick * joystick)
-{
-    SDL_Joystick *joysticklist;
-    SDL_Joystick *joysticklistprev;
-
-    if (!joystick) {
-        return;
-    }
-
-    /* First decrement ref count */
-    if (--joystick->ref_count > 0) {
-        return;
-    }
-
-    if (joystick == SDL_updating_joystick) {
-        return;
-    }
-
-    SDL_SYS_JoystickClose(joystick);
-
-    joysticklist = SDL_joysticks;
-    joysticklistprev = NULL;
-    while ( joysticklist )
-    {
-        if (joystick == joysticklist)
-        {
-            if ( joysticklistprev )
-            {
-                /* unlink this entry */
-                joysticklistprev->next = joysticklist->next;
-            }
-            else
-            {
-                SDL_joysticks = joystick->next;
-            }
-
-            break;
-        }
-        joysticklistprev = joysticklist;
-        joysticklist = joysticklist->next;
-    }
-
-    SDL_free(joystick->name);
-
-    /* Free the data associated with this joystick */
-    SDL_free(joystick->axes);
-    SDL_free(joystick->hats);
-    SDL_free(joystick->balls);
-    SDL_free(joystick->buttons);
-    SDL_free(joystick);
-}
-
-void
-SDL_JoystickQuit(void)
-{
-    /* Make sure we're not getting called in the middle of updating joysticks */
-    SDL_assert(!SDL_updating_joystick);
-
-    /* Stop the event polling */
-    while ( SDL_joysticks )
-    {
-        SDL_joysticks->ref_count = 1;
-        SDL_JoystickClose(SDL_joysticks);
-    }
-
-    /* Quit the joystick setup */
-    SDL_SYS_JoystickQuit();
-
-#if !SDL_EVENTS_DISABLED
-    SDL_QuitSubSystem(SDL_INIT_EVENTS);
-#endif
-}
-
-
-static SDL_bool
-SDL_PrivateJoystickShouldIgnoreEvent()
-{
-    if (SDL_joystick_allows_background_events)
-    {
-        return SDL_FALSE;
-    }
-
-    if (SDL_WasInit(SDL_INIT_VIDEO)) {
-        if (SDL_GetKeyboardFocus() == NULL) {
-            /* Video is initialized and we don't have focus, ignore the event. */
-            return SDL_TRUE;
-        } else {
-            return SDL_FALSE;
-        }
-    }
-
-    /* Video subsystem wasn't initialized, always allow the event */
-    return SDL_FALSE;
-}
-
-/* These are global for SDL_sysjoystick.c and SDL_events.c */
-
-int
-SDL_PrivateJoystickAxis(SDL_Joystick * joystick, Uint8 axis, Sint16 value)
-{
-    int posted;
-
-    /* Make sure we're not getting garbage events */
-    if (axis >= joystick->naxes) {
-        return 0;
-    }
-
-    /* Update internal joystick state */
-    if (value == joystick->axes[axis]) {
-        return 0;
-    }
-    joystick->axes[axis] = value;
-
-    /* We ignore events if we don't have keyboard focus, except for centering
-     * events.
-     */
-    if (SDL_PrivateJoystickShouldIgnoreEvent()) {
-        if (!(joystick->closed && joystick->uncentered)) {
-            return 0;
-        }
-    }
-
-    /* Post the event, if desired */
-    posted = 0;
-#if !SDL_EVENTS_DISABLED
-    if (SDL_GetEventState(SDL_JOYAXISMOTION) == SDL_ENABLE) {
-        SDL_Event event;
-        event.type = SDL_JOYAXISMOTION;
-        event.jaxis.which = joystick->instance_id;
-        event.jaxis.axis = axis;
-        event.jaxis.value = value;
-        posted = SDL_PushEvent(&event) == 1;
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-    return (posted);
-}
-
-int
-SDL_PrivateJoystickHat(SDL_Joystick * joystick, Uint8 hat, Uint8 value)
-{
-    int posted;
-
-    /* Make sure we're not getting garbage events */
-    if (hat >= joystick->nhats) {
-        return 0;
-    }
-
-    /* Update internal joystick state */
-    joystick->hats[hat] = value;
-
-    /* We ignore events if we don't have keyboard focus, except for centering
-     * events.
-     */
-    if (SDL_PrivateJoystickShouldIgnoreEvent()) {
-        if (!(joystick->closed && joystick->uncentered)) {
-            return 0;
-        }
-    }
-
-
-    /* Post the event, if desired */
-    posted = 0;
-#if !SDL_EVENTS_DISABLED
-    if (SDL_GetEventState(SDL_JOYHATMOTION) == SDL_ENABLE) {
-        SDL_Event event;
-        event.jhat.type = SDL_JOYHATMOTION;
-        event.jhat.which = joystick->instance_id;
-        event.jhat.hat = hat;
-        event.jhat.value = value;
-        posted = SDL_PushEvent(&event) == 1;
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-    return (posted);
-}
-
-int
-SDL_PrivateJoystickBall(SDL_Joystick * joystick, Uint8 ball,
-                        Sint16 xrel, Sint16 yrel)
-{
-    int posted;
-
-    /* Make sure we're not getting garbage events */
-    if (ball >= joystick->nballs) {
-        return 0;
-    }
-
-    /* We ignore events if we don't have keyboard focus. */
-    if (SDL_PrivateJoystickShouldIgnoreEvent()) {
-        return 0;
-    }
-
-    /* Update internal mouse state */
-    joystick->balls[ball].dx += xrel;
-    joystick->balls[ball].dy += yrel;
-
-    /* Post the event, if desired */
-    posted = 0;
-#if !SDL_EVENTS_DISABLED
-    if (SDL_GetEventState(SDL_JOYBALLMOTION) == SDL_ENABLE) {
-        SDL_Event event;
-        event.jball.type = SDL_JOYBALLMOTION;
-        event.jball.which = joystick->instance_id;
-        event.jball.ball = ball;
-        event.jball.xrel = xrel;
-        event.jball.yrel = yrel;
-        posted = SDL_PushEvent(&event) == 1;
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-    return (posted);
-}
-
-int
-SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state)
-{
-    int posted;
-#if !SDL_EVENTS_DISABLED
-    SDL_Event event;
-
-    switch (state) {
-    case SDL_PRESSED:
-        event.type = SDL_JOYBUTTONDOWN;
-        break;
-    case SDL_RELEASED:
-        event.type = SDL_JOYBUTTONUP;
-        break;
-    default:
-        /* Invalid state -- bail */
-        return (0);
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-
-    /* Make sure we're not getting garbage events */
-    if (button >= joystick->nbuttons) {
-        return 0;
-    }
-
-    /* We ignore events if we don't have keyboard focus, except for button
-     * release. */
-    if (state == SDL_PRESSED && SDL_PrivateJoystickShouldIgnoreEvent()) {
-        return 0;
-    }
-
-    /* Update internal joystick state */
-    joystick->buttons[button] = state;
-
-    /* Post the event, if desired */
-    posted = 0;
-#if !SDL_EVENTS_DISABLED
-    if (SDL_GetEventState(event.type) == SDL_ENABLE) {
-        event.jbutton.which = joystick->instance_id;
-        event.jbutton.button = button;
-        event.jbutton.state = state;
-        posted = SDL_PushEvent(&event) == 1;
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-    return (posted);
-}
-
-void
-SDL_JoystickUpdate(void)
-{
-    SDL_Joystick *joystick;
-
-    joystick = SDL_joysticks;
-    while ( joystick )
-    {
-        SDL_Joystick *joysticknext;
-        /* save off the next pointer, the Update call may cause a joystick removed event
-         * and cause our joystick pointer to be freed
-         */
-        joysticknext = joystick->next;
-
-        SDL_updating_joystick = joystick;
-
-        SDL_SYS_JoystickUpdate( joystick );
-
-        if ( joystick->closed && joystick->uncentered )
-        {
-            int i;
-
-            /* Tell the app that everything is centered/unpressed...  */
-            for (i = 0; i < joystick->naxes; i++)
-                SDL_PrivateJoystickAxis(joystick, i, 0);
-
-            for (i = 0; i < joystick->nbuttons; i++)
-                SDL_PrivateJoystickButton(joystick, i, 0);
-
-            for (i = 0; i < joystick->nhats; i++)
-                SDL_PrivateJoystickHat(joystick, i, SDL_HAT_CENTERED);
-
-            joystick->uncentered = 0;
-        }
-
-        SDL_updating_joystick = NULL;
-
-        /* If the joystick was closed while updating, free it here */
-        if ( joystick->ref_count <= 0 ) {
-            SDL_JoystickClose(joystick);
-        }
-
-        joystick = joysticknext;
-    }
-
-    /* this needs to happen AFTER walking the joystick list above, so that any
-       dangling hardware data from removed devices can be free'd
-     */
-    SDL_SYS_JoystickDetect();
-}
-
-int
-SDL_JoystickEventState(int state)
-{
-#if SDL_EVENTS_DISABLED
-    return SDL_DISABLE;
-#else
-    const Uint32 event_list[] = {
-        SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYHATMOTION,
-        SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP, SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED
-    };
-    unsigned int i;
-
-    switch (state) {
-    case SDL_QUERY:
-        state = SDL_DISABLE;
-        for (i = 0; i < SDL_arraysize(event_list); ++i) {
-            state = SDL_EventState(event_list[i], SDL_QUERY);
-            if (state == SDL_ENABLE) {
-                break;
-            }
-        }
-        break;
-    default:
-        for (i = 0; i < SDL_arraysize(event_list); ++i) {
-            SDL_EventState(event_list[i], state);
-        }
-        break;
-    }
-    return (state);
-#endif /* SDL_EVENTS_DISABLED */
-}
-
-/* return 1 if you want to run the joystick update loop this frame, used by hotplug support */
-SDL_bool
-SDL_PrivateJoystickNeedsPolling()
-{
-    if (SDL_joysticks != NULL) {
-        return SDL_TRUE;
-    } else {
-        return SDL_SYS_JoystickNeedsPolling();
-    }
-}
-
-
-/* return the guid for this index */
-SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index)
-{
-    if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) {
-        SDL_JoystickGUID emptyGUID;
-        SDL_SetError("There are %d joysticks available", SDL_NumJoysticks());
-        SDL_zero( emptyGUID );
-        return emptyGUID;
-    }
-    return SDL_SYS_JoystickGetDeviceGUID( device_index );
-}
-
-/* return the guid for this opened device */
-SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick * joystick)
-{
-    if (!SDL_PrivateJoystickValid(joystick)) {
-        SDL_JoystickGUID emptyGUID;
-        SDL_zero( emptyGUID );
-        return emptyGUID;
-    }
-    return SDL_SYS_JoystickGetGUID( joystick );
-}
-
-/* convert the guid to a printable string */
-void SDL_JoystickGetGUIDString( SDL_JoystickGUID guid, char *pszGUID, int cbGUID )
-{
-    static const char k_rgchHexToASCII[] = "0123456789abcdef";
-    int i;
-
-    if ((pszGUID == NULL) || (cbGUID <= 0)) {
-        return;
-    }
-
-    for ( i = 0; i < sizeof(guid.data) && i < (cbGUID-1)/2; i++ )
-    {
-        /* each input byte writes 2 ascii chars, and might write a null byte. */
-        /* If we don't have room for next input byte, stop */
-        unsigned char c = guid.data[i];
-
-        *pszGUID++ = k_rgchHexToASCII[ c >> 4 ];
-        *pszGUID++ = k_rgchHexToASCII[ c & 0x0F ];
-    }
-    *pszGUID = '\0';
-}
-
-
-/*-----------------------------------------------------------------------------
- * Purpose: Returns the 4 bit nibble for a hex character
- * Input  : c -
- * Output : unsigned char
- *-----------------------------------------------------------------------------*/
-static unsigned char nibble( char c )
-{
-    if ( ( c >= '0' ) &&
-        ( c <= '9' ) )
-    {
-        return (unsigned char)(c - '0');
-    }
-
-    if ( ( c >= 'A' ) &&
-        ( c <= 'F' ) )
-    {
-        return (unsigned char)(c - 'A' + 0x0a);
-    }
-
-    if ( ( c >= 'a' ) &&
-        ( c <= 'f' ) )
-    {
-        return (unsigned char)(c - 'a' + 0x0a);
-    }
-
-    /* received an invalid character, and no real way to return an error */
-    /* AssertMsg1( false, "Q_nibble invalid hex character '%c' ", c ); */
-    return 0;
-}
-
-
-/* convert the string version of a joystick guid to the struct */
-SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const char *pchGUID)
-{
-    SDL_JoystickGUID guid;
-    int maxoutputbytes= sizeof(guid);
-    size_t len = SDL_strlen( pchGUID );
-    Uint8 *p;
-    int i;
-
-    /* Make sure it's even */
-    len = ( len ) & ~0x1;
-
-    SDL_memset( &guid, 0x00, sizeof(guid) );
-
-    p = (Uint8 *)&guid;
-    for ( i = 0;
-        ( i < len ) && ( ( p - (Uint8 *)&guid ) < maxoutputbytes );
-        i+=2, p++ )
-    {
-        *p = ( nibble( pchGUID[i] ) << 4 ) | nibble( pchGUID[i+1] );
-    }
-
-    return guid;
-}
-
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/SDL_joystick_c.h b/deps/SDL2/src/joystick/SDL_joystick_c.h
deleted file mode 100644
index 38bc785..0000000
--- a/deps/SDL2/src/joystick/SDL_joystick_c.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_joystick.c */
-#include "SDL_joystick.h"
-
-/* Initialization and shutdown functions */
-extern int SDL_JoystickInit(void);
-extern void SDL_JoystickQuit(void);
-
-/* Initialization and shutdown functions */
-extern int SDL_GameControllerInit(void);
-extern void SDL_GameControllerQuit(void);
-
-
-/* Internal event queueing functions */
-extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick,
-                                   Uint8 axis, Sint16 value);
-extern int SDL_PrivateJoystickBall(SDL_Joystick * joystick,
-                                   Uint8 ball, Sint16 xrel, Sint16 yrel);
-extern int SDL_PrivateJoystickHat(SDL_Joystick * joystick,
-                                  Uint8 hat, Uint8 value);
-extern int SDL_PrivateJoystickButton(SDL_Joystick * joystick,
-                                     Uint8 button, Uint8 state);
-
-/* Helper function to let lower sys layer tell the event system if the joystick code needs to think */
-extern SDL_bool SDL_PrivateJoystickNeedsPolling();
-
-/* Internal sanity checking functions */
-extern int SDL_PrivateJoystickValid(SDL_Joystick * joystick);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/SDL_sysjoystick.h b/deps/SDL2/src/joystick/SDL_sysjoystick.h
deleted file mode 100644
index 3aeaf08..0000000
--- a/deps/SDL2/src/joystick/SDL_sysjoystick.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This is the system specific header for the SDL joystick API */
-
-#include "SDL_joystick.h"
-#include "SDL_joystick_c.h"
-
-/* The SDL joystick structure */
-struct _SDL_Joystick
-{
-    SDL_JoystickID instance_id; /* Device instance, monotonically increasing from 0 */
-    char *name;                 /* Joystick name - system dependent */
-
-    int naxes;                  /* Number of axis controls on the joystick */
-    Sint16 *axes;               /* Current axis states */
-
-    int nhats;                  /* Number of hats on the joystick */
-    Uint8 *hats;                /* Current hat states */
-
-    int nballs;                 /* Number of trackballs on the joystick */
-    struct balldelta {
-        int dx;
-        int dy;
-    } *balls;                   /* Current ball motion deltas */
-
-    int nbuttons;               /* Number of buttons on the joystick */
-    Uint8 *buttons;             /* Current button states */
-
-    struct joystick_hwdata *hwdata;     /* Driver dependent information */
-
-    int ref_count;              /* Reference count for multiple opens */
-
-    Uint8 closed;               /* 1 if this device is no longer valid */
-    Uint8 uncentered;           /* 1 if this device needs to have its state reset to 0 */
-    struct _SDL_Joystick *next; /* pointer to next joystick we have allocated */
-};
-
-/* Function to scan the system for joysticks.
- * Joystick 0 should be the system default joystick.
- * This function should return the number of available joysticks, or -1
- * on an unrecoverable fatal error.
- */
-extern int SDL_SYS_JoystickInit(void);
-
-/* Function to return the number of joystick devices plugged in right now */
-extern int SDL_SYS_NumJoysticks();
-
-/* Function to cause any queued joystick insertions to be processed */
-extern void SDL_SYS_JoystickDetect();
-
-/* Function to determine if the joystick loop needs to run right now */
-extern SDL_bool SDL_SYS_JoystickNeedsPolling();
-
-/* Function to get the device-dependent name of a joystick */
-extern const char *SDL_SYS_JoystickNameForDeviceIndex(int device_index);
-
-/* Function to get the current instance id of the joystick located at device_index */
-extern SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index);
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-extern int SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index);
-
-/* Function to query if the joystick is currently attached
- *   It returns 1 if attached, 0 otherwise.
- */
-extern SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick * joystick);
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-extern void SDL_SYS_JoystickUpdate(SDL_Joystick * joystick);
-
-/* Function to close a joystick after use */
-extern void SDL_SYS_JoystickClose(SDL_Joystick * joystick);
-
-/* Function to perform any system-specific joystick related cleanup */
-extern void SDL_SYS_JoystickQuit(void);
-
-/* Function to return the stable GUID for a plugged in device */
-extern SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID(int device_index);
-
-/* Function to return the stable GUID for a opened joystick */
-extern SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick);
-
-#ifdef SDL_JOYSTICK_DINPUT
-/* Function to get the current instance id of the joystick located at device_index */
-extern SDL_bool SDL_SYS_IsXInputDeviceIndex( int device_index );
-extern SDL_bool SDL_SYS_IsXInputJoystick(SDL_Joystick * joystick);
-#endif
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/android/SDL_sysjoystick.c b/deps/SDL2/src/joystick/android/SDL_sysjoystick.c
deleted file mode 100644
index adaca52..0000000
--- a/deps/SDL2/src/joystick/android/SDL_sysjoystick.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_ANDROID
-
-/* This is the system specific header for the SDL joystick API */
-#include <stdio.h>              /* For the definition of NULL */
-
-#include "SDL_error.h"
-#include "SDL_events.h"
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-#include "../../core/android/SDL_android.h"
-
-static const char *accelerometerName = "Android accelerometer";
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int
-SDL_SYS_JoystickInit(void)
-{
-    return (1);
-}
-
-int SDL_SYS_NumJoysticks()
-{
-    return 1;
-}
-
-void SDL_SYS_JoystickDetect()
-{
-}
-
-SDL_bool SDL_SYS_JoystickNeedsPolling()
-{
-    return SDL_FALSE;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *
-SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
-    return accelerometerName;
-}
-
-/* Function to perform the mapping from device index to the instance id for this index */
-SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
-    return device_index;
-}
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
-{
-    if (device_index == 0) {
-        joystick->nbuttons = 0;
-        joystick->nhats = 0;
-        joystick->nballs = 0;
-        joystick->naxes = 3;
-        return 0;
-    } else {
-        SDL_SetError("No joystick available with that index");
-        return (-1);
-    }
-}
-
-/* Function to determine is this joystick is attached to the system right now */
-SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
-{
-    return SDL_TRUE;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-{
-    int i;
-    Sint16 value;
-    float values[3];
-
-    if (Android_JNI_GetAccelerometerValues(values)) {
-        for ( i = 0; i < 3; i++ ) {
-            value = (Sint16)(values[i] * 32767.0f);
-            SDL_PrivateJoystickAxis(joystick, i, value);
-        }
-    }
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-{
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void
-SDL_SYS_JoystickQuit(void)
-{
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = joystick->name;
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-#endif /* SDL_JOYSTICK_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/beos/SDL_bejoystick.cc b/deps/SDL2/src/joystick/beos/SDL_bejoystick.cc
deleted file mode 100644
index c324581..0000000
--- a/deps/SDL2/src/joystick/beos/SDL_bejoystick.cc
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_BEOS
-
-/* This is the system specific header for the SDL joystick API */
-
-#include <be/support/String.h>
-#include <be/device/Joystick.h>
-
-extern "C"
-{
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-
-/* The maximum number of joysticks we'll detect */
-#define MAX_JOYSTICKS	16
-
-/* A list of available joysticks */
-    static char *SDL_joyport[MAX_JOYSTICKS];
-    static char *SDL_joyname[MAX_JOYSTICKS];
-
-/* The private structure used to keep track of a joystick */
-    struct joystick_hwdata
-    {
-        BJoystick *stick;
-        uint8 *new_hats;
-        int16 *new_axes;
-    };
-
-    static int SDL_SYS_numjoysticks = 0;
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-    int SDL_SYS_JoystickInit(void)
-    {
-        BJoystick joystick;
-        int i;
-        int32 nports;
-        char name[B_OS_NAME_LENGTH];
-
-        /* Search for attached joysticks */
-          nports = joystick.CountDevices();
-          SDL_SYS_numjoysticks = 0;
-          SDL_memset(SDL_joyport, 0, (sizeof SDL_joyport));
-          SDL_memset(SDL_joyname, 0, (sizeof SDL_joyname));
-        for (i = 0; (SDL_SYS_numjoysticks < MAX_JOYSTICKS) && (i < nports); ++i)
-        {
-            if (joystick.GetDeviceName(i, name) == B_OK) {
-                if (joystick.Open(name) != B_ERROR) {
-                    BString stick_name;
-                      joystick.GetControllerName(&stick_name);
-                      SDL_joyport[SDL_SYS_numjoysticks] = strdup(name);
-                      SDL_joyname[SDL_SYS_numjoysticks] = strdup(stick_name.String());
-                      SDL_SYS_numjoysticks++;
-                      joystick.Close();
-                }
-            }
-        }
-        return (SDL_SYS_numjoysticks);
-    }
-
-    int SDL_SYS_NumJoysticks()
-    {
-        return SDL_SYS_numjoysticks;
-    }
-
-    void SDL_SYS_JoystickDetect()
-    {
-    }
-
-    SDL_bool SDL_SYS_JoystickNeedsPolling()
-    {
-        return SDL_FALSE;
-    }
-
-/* Function to get the device-dependent name of a joystick */
-    const char *SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-    {
-        return SDL_joyname[device_index];
-    }
-
-/* Function to perform the mapping from device index to the instance id for this index */
-    SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-    {
-        return device_index;
-    }
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-    int SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
-    {
-        BJoystick *stick;
-
-        /* Create the joystick data structure */
-        joystick->instance_id = device_index;
-        joystick->hwdata = (struct joystick_hwdata *)
-            SDL_malloc(sizeof(*joystick->hwdata));
-        if (joystick->hwdata == NULL) {
-            return SDL_OutOfMemory();
-        }
-        SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
-        stick = new BJoystick;
-        joystick->hwdata->stick = stick;
-
-        /* Open the requested joystick for use */
-        if (stick->Open(SDL_joyport[device_index]) == B_ERROR) {
-            SDL_SYS_JoystickClose(joystick);
-            return SDL_SetError("Unable to open joystick");
-        }
-
-        /* Set the joystick to calibrated mode */
-        stick->EnableCalibration();
-
-        /* Get the number of buttons, hats, and axes on the joystick */
-        joystick->nbuttons = stick->CountButtons();
-        joystick->naxes = stick->CountAxes();
-        joystick->nhats = stick->CountHats();
-
-        joystick->hwdata->new_axes = (int16 *)
-            SDL_malloc(joystick->naxes * sizeof(int16));
-        joystick->hwdata->new_hats = (uint8 *)
-            SDL_malloc(joystick->nhats * sizeof(uint8));
-        if (!joystick->hwdata->new_hats || !joystick->hwdata->new_axes) {
-            SDL_SYS_JoystickClose(joystick);
-            return SDL_OutOfMemory();
-        }
-
-        /* We're done! */
-        return (0);
-    }
-
-/* Function to determine is this joystick is attached to the system right now */
-    SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
-    {
-        return SDL_TRUE;
-    }
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-    void SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-    {
-        static const Uint8 hat_map[9] = {
-            SDL_HAT_CENTERED,
-            SDL_HAT_UP,
-            SDL_HAT_RIGHTUP,
-            SDL_HAT_RIGHT,
-            SDL_HAT_RIGHTDOWN,
-            SDL_HAT_DOWN,
-            SDL_HAT_LEFTDOWN,
-            SDL_HAT_LEFT,
-            SDL_HAT_LEFTUP
-        };
-        const int JITTER = (32768 / 10);        /* 10% jitter threshold (ok?) */
-
-        BJoystick *stick;
-        int i, change;
-        int16 *axes;
-        uint8 *hats;
-        uint32 buttons;
-
-        /* Set up data pointers */
-        stick = joystick->hwdata->stick;
-        axes = joystick->hwdata->new_axes;
-        hats = joystick->hwdata->new_hats;
-
-        /* Get the new joystick state */
-        stick->Update();
-        stick->GetAxisValues(axes);
-        stick->GetHatValues(hats);
-        buttons = stick->ButtonValues();
-
-        /* Generate axis motion events */
-        for (i = 0; i < joystick->naxes; ++i) {
-            change = ((int32) axes[i] - joystick->axes[i]);
-            if ((change > JITTER) || (change < -JITTER)) {
-                SDL_PrivateJoystickAxis(joystick, i, axes[i]);
-            }
-        }
-
-        /* Generate hat change events */
-        for (i = 0; i < joystick->nhats; ++i) {
-            if (hats[i] != joystick->hats[i]) {
-                SDL_PrivateJoystickHat(joystick, i, hat_map[hats[i]]);
-            }
-        }
-
-        /* Generate button events */
-        for (i = 0; i < joystick->nbuttons; ++i) {
-            if ((buttons & 0x01) != joystick->buttons[i]) {
-                SDL_PrivateJoystickButton(joystick, i, (buttons & 0x01));
-            }
-            buttons >>= 1;
-        }
-    }
-
-/* Function to close a joystick after use */
-    void SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-    {
-        if (joystick->hwdata) {
-            joystick->hwdata->stick->Close();
-            delete joystick->hwdata->stick;
-            SDL_free(joystick->hwdata->new_hats);
-            SDL_free(joystick->hwdata->new_axes);
-            SDL_free(joystick->hwdata);
-            joystick->hwdata = NULL;
-        }
-    }
-
-/* Function to perform any system-specific joystick related cleanup */
-    void SDL_SYS_JoystickQuit(void)
-    {
-        int i;
-
-        for (i = 0; SDL_joyport[i]; ++i) {
-            SDL_free(SDL_joyport[i]);
-        }
-        SDL_joyport[0] = NULL;
-
-        for (i = 0; SDL_joyname[i]; ++i) {
-            SDL_free(SDL_joyname[i]);
-        }
-        SDL_joyname[0] = NULL;
-    }
-
-    SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-    {
-        SDL_JoystickGUID guid;
-        /* the GUID is just the first 16 chars of the name for now */
-        const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
-        SDL_zero( guid );
-        SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-        return guid;
-    }
-
-    SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-    {
-        SDL_JoystickGUID guid;
-        /* the GUID is just the first 16 chars of the name for now */
-        const char *name = joystick->name;
-        SDL_zero( guid );
-        SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-        return guid;
-    }
-
-};                              // extern "C"
-
-#endif /* SDL_JOYSTICK_BEOS */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/bsd/SDL_sysjoystick.c b/deps/SDL2/src/joystick/bsd/SDL_sysjoystick.c
deleted file mode 100644
index 41a8693..0000000
--- a/deps/SDL2/src/joystick/bsd/SDL_sysjoystick.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_USBHID
-
-/*
- * Joystick driver for the uhid(4) interface found in OpenBSD,
- * NetBSD and FreeBSD.
- *
- * Maintainer: <vedge at csoft.org>
- */
-
-#include <sys/param.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#ifndef __FreeBSD_kernel_version
-#define __FreeBSD_kernel_version __FreeBSD_version
-#endif
-
-#if defined(HAVE_USB_H)
-#include <usb.h>
-#endif
-#ifdef __DragonFly__
-#include <bus/usb/usb.h>
-#include <bus/usb/usbhid.h>
-#else
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-#endif
-
-#if defined(HAVE_USBHID_H)
-#include <usbhid.h>
-#elif defined(HAVE_LIBUSB_H)
-#include <libusb.h>
-#elif defined(HAVE_LIBUSBHID_H)
-#include <libusbhid.h>
-#endif
-
-#if defined(__FREEBSD__) || defined(__FreeBSD_kernel__)
-#ifndef __DragonFly__
-#include <osreldate.h>
-#endif
-#if __FreeBSD_kernel_version > 800063
-#include <dev/usb/usb_ioctl.h>
-#endif
-#include <sys/joystick.h>
-#endif
-
-#if SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
-#include <machine/joystick.h>
-#endif
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-#define MAX_UHID_JOYS   16
-#define MAX_JOY_JOYS    2
-#define MAX_JOYS    (MAX_UHID_JOYS + MAX_JOY_JOYS)
-
-
-struct report
-{
-#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)
-    void *buf; /* Buffer */
-#elif defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
-    struct usb_gen_descriptor *buf; /* Buffer */
-#else
-    struct usb_ctl_report *buf; /* Buffer */
-#endif
-    size_t size;                /* Buffer size */
-    int rid;                    /* Report ID */
-    enum
-    {
-        SREPORT_UNINIT,
-        SREPORT_CLEAN,
-        SREPORT_DIRTY
-    } status;
-};
-
-static struct
-{
-    int uhid_report;
-    hid_kind_t kind;
-    const char *name;
-} const repinfo[] = {
-    {UHID_INPUT_REPORT, hid_input, "input"},
-    {UHID_OUTPUT_REPORT, hid_output, "output"},
-    {UHID_FEATURE_REPORT, hid_feature, "feature"}
-};
-
-enum
-{
-    REPORT_INPUT = 0,
-    REPORT_OUTPUT = 1,
-    REPORT_FEATURE = 2
-};
-
-enum
-{
-    JOYAXE_X,
-    JOYAXE_Y,
-    JOYAXE_Z,
-    JOYAXE_SLIDER,
-    JOYAXE_WHEEL,
-    JOYAXE_RX,
-    JOYAXE_RY,
-    JOYAXE_RZ,
-    JOYAXE_count
-};
-
-struct joystick_hwdata
-{
-    int fd;
-    char *path;
-    enum
-    {
-        BSDJOY_UHID,            /* uhid(4) */
-        BSDJOY_JOY              /* joy(4) */
-    } type;
-    struct report_desc *repdesc;
-    struct report inreport;
-    int axis_map[JOYAXE_count]; /* map present JOYAXE_* to 0,1,.. */
-};
-
-static char *joynames[MAX_JOYS];
-static char *joydevnames[MAX_JOYS];
-
-static int report_alloc(struct report *, struct report_desc *, int);
-static void report_free(struct report *);
-
-#if defined(USBHID_UCR_DATA) || (defined(__FreeBSD_kernel__) && __FreeBSD_kernel_version <= 800063)
-#define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
-#elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000))
-#define REP_BUF_DATA(rep) ((rep)->buf)
-#elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063))
-#define REP_BUF_DATA(rep) ((rep)->buf->ugd_data)
-#else
-#define REP_BUF_DATA(rep) ((rep)->buf->data)
-#endif
-
-static int SDL_SYS_numjoysticks = 0;
-
-int
-SDL_SYS_JoystickInit(void)
-{
-    char s[16];
-    int i, fd;
-
-    SDL_SYS_numjoysticks = 0;
-
-    SDL_memset(joynames, 0, sizeof(joynames));
-    SDL_memset(joydevnames, 0, sizeof(joydevnames));
-
-    for (i = 0; i < MAX_UHID_JOYS; i++) {
-        SDL_Joystick nj;
-
-        SDL_snprintf(s, SDL_arraysize(s), "/dev/uhid%d", i);
-
-        joynames[SDL_SYS_numjoysticks] = strdup(s);
-
-        if (SDL_SYS_JoystickOpen(&nj, SDL_SYS_numjoysticks) == 0) {
-            SDL_SYS_JoystickClose(&nj);
-            SDL_SYS_numjoysticks++;
-        } else {
-            SDL_free(joynames[SDL_SYS_numjoysticks]);
-            joynames[SDL_SYS_numjoysticks] = NULL;
-        }
-    }
-    for (i = 0; i < MAX_JOY_JOYS; i++) {
-        SDL_snprintf(s, SDL_arraysize(s), "/dev/joy%d", i);
-        fd = open(s, O_RDONLY);
-        if (fd != -1) {
-            joynames[SDL_SYS_numjoysticks++] = strdup(s);
-            close(fd);
-        }
-    }
-
-    /* Read the default USB HID usage table. */
-    hid_init(NULL);
-
-    return (SDL_SYS_numjoysticks);
-}
-
-int SDL_SYS_NumJoysticks()
-{
-    return SDL_SYS_numjoysticks;
-}
-
-void SDL_SYS_JoystickDetect()
-{
-}
-
-SDL_bool SDL_SYS_JoystickNeedsPolling()
-{
-    return SDL_FALSE;
-}
-
-const char *
-SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
-    if (joydevnames[device_index] != NULL) {
-        return (joydevnames[device_index]);
-    }
-    return (joynames[device_index]);
-}
-
-/* Function to perform the mapping from device index to the instance id for this index */
-SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
-    return device_index;
-}
-
-static int
-usage_to_joyaxe(unsigned usage)
-{
-    int joyaxe;
-    switch (usage) {
-    case HUG_X:
-        joyaxe = JOYAXE_X;
-        break;
-    case HUG_Y:
-        joyaxe = JOYAXE_Y;
-        break;
-    case HUG_Z:
-        joyaxe = JOYAXE_Z;
-        break;
-    case HUG_SLIDER:
-        joyaxe = JOYAXE_SLIDER;
-        break;
-    case HUG_WHEEL:
-        joyaxe = JOYAXE_WHEEL;
-        break;
-    case HUG_RX:
-        joyaxe = JOYAXE_RX;
-        break;
-    case HUG_RY:
-        joyaxe = JOYAXE_RY;
-        break;
-    case HUG_RZ:
-        joyaxe = JOYAXE_RZ;
-        break;
-    default:
-        joyaxe = -1;
-    }
-    return joyaxe;
-}
-
-static unsigned
-hatval_to_sdl(Sint32 hatval)
-{
-    static const unsigned hat_dir_map[8] = {
-        SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_RIGHT, SDL_HAT_RIGHTDOWN,
-        SDL_HAT_DOWN, SDL_HAT_LEFTDOWN, SDL_HAT_LEFT, SDL_HAT_LEFTUP
-    };
-    unsigned result;
-    if ((hatval & 7) == hatval)
-        result = hat_dir_map[hatval];
-    else
-        result = SDL_HAT_CENTERED;
-    return result;
-}
-
-
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joy, int device_index)
-{
-    char *path = joynames[device_index];
-    struct joystick_hwdata *hw;
-    struct hid_item hitem;
-    struct hid_data *hdata;
-    struct report *rep;
-    int fd;
-    int i;
-
-    fd = open(path, O_RDONLY);
-    if (fd == -1) {
-        return SDL_SetError("%s: %s", path, strerror(errno));
-    }
-
-    joy->instance_id = device_index;
-    hw = (struct joystick_hwdata *)
-        SDL_malloc(sizeof(struct joystick_hwdata));
-    if (hw == NULL) {
-        close(fd);
-        return SDL_OutOfMemory();
-    }
-    joy->hwdata = hw;
-    hw->fd = fd;
-    hw->path = strdup(path);
-    if (!SDL_strncmp(path, "/dev/joy", 8)) {
-        hw->type = BSDJOY_JOY;
-        joy->naxes = 2;
-        joy->nbuttons = 2;
-        joy->nhats = 0;
-        joy->nballs = 0;
-        joydevnames[device_index] = strdup("Gameport joystick");
-        goto usbend;
-    } else {
-        hw->type = BSDJOY_UHID;
-    }
-
-    {
-        int ax;
-        for (ax = 0; ax < JOYAXE_count; ax++)
-            hw->axis_map[ax] = -1;
-    }
-    hw->repdesc = hid_get_report_desc(fd);
-    if (hw->repdesc == NULL) {
-        SDL_SetError("%s: USB_GET_REPORT_DESC: %s", hw->path,
-                     strerror(errno));
-        goto usberr;
-    }
-    rep = &hw->inreport;
-#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) || defined(__FreeBSD_kernel__)
-    rep->rid = hid_get_report_id(fd);
-    if (rep->rid < 0) {
-#else
-    if (ioctl(fd, USB_GET_REPORT_ID, &rep->rid) < 0) {
-#endif
-        rep->rid = -1;          /* XXX */
-    }
-    if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) {
-        goto usberr;
-    }
-    if (rep->size <= 0) {
-        SDL_SetError("%s: Input report descriptor has invalid length",
-                     hw->path);
-        goto usberr;
-    }
-#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
-    hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
-#else
-    hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
-#endif
-    if (hdata == NULL) {
-        SDL_SetError("%s: Cannot start HID parser", hw->path);
-        goto usberr;
-    }
-    joy->naxes = 0;
-    joy->nbuttons = 0;
-    joy->nhats = 0;
-    joy->nballs = 0;
-    for (i = 0; i < JOYAXE_count; i++)
-        hw->axis_map[i] = -1;
-
-    while (hid_get_item(hdata, &hitem) > 0) {
-        char *sp;
-        const char *s;
-
-        switch (hitem.kind) {
-        case hid_collection:
-            switch (HID_PAGE(hitem.usage)) {
-            case HUP_GENERIC_DESKTOP:
-                switch (HID_USAGE(hitem.usage)) {
-                case HUG_JOYSTICK:
-                case HUG_GAME_PAD:
-                    s = hid_usage_in_page(hitem.usage);
-                    sp = SDL_malloc(SDL_strlen(s) + 5);
-                    SDL_snprintf(sp, SDL_strlen(s) + 5, "%s (%d)",
-                                 s, device_index);
-                    joydevnames[device_index] = sp;
-                }
-            }
-            break;
-        case hid_input:
-            switch (HID_PAGE(hitem.usage)) {
-            case HUP_GENERIC_DESKTOP:
-                {
-                    unsigned usage = HID_USAGE(hitem.usage);
-                    int joyaxe = usage_to_joyaxe(usage);
-                    if (joyaxe >= 0) {
-                        hw->axis_map[joyaxe] = 1;
-                    } else if (usage == HUG_HAT_SWITCH) {
-                        joy->nhats++;
-                    }
-                    break;
-                }
-            case HUP_BUTTON:
-                joy->nbuttons++;
-                break;
-            default:
-                break;
-            }
-            break;
-        default:
-            break;
-        }
-    }
-    hid_end_parse(hdata);
-    for (i = 0; i < JOYAXE_count; i++)
-        if (hw->axis_map[i] > 0)
-            hw->axis_map[i] = joy->naxes++;
-
-  usbend:
-    /* The poll blocks the event thread. */
-    fcntl(fd, F_SETFL, O_NONBLOCK);
-
-    return (0);
-  usberr:
-    close(hw->fd);
-    SDL_free(hw->path);
-    SDL_free(hw);
-    return (-1);
-}
-
-/* Function to determine is this joystick is attached to the system right now */
-SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
-{
-    return SDL_TRUE;
-}
-
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joy)
-{
-    struct hid_item hitem;
-    struct hid_data *hdata;
-    struct report *rep;
-    int nbutton, naxe = -1;
-    Sint32 v;
-
-#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__)
-    struct joystick gameport;
-    static int x, y, xmin = 0xffff, ymin = 0xffff, xmax = 0, ymax = 0;
-
-    if (joy->hwdata->type == BSDJOY_JOY) {
-        while (read(joy->hwdata->fd, &gameport, sizeof gameport) == sizeof gameport) {
-            if (abs(x - gameport.x) > 8) {
-                x = gameport.x;
-                if (x < xmin) {
-                    xmin = x;
-                }
-                if (x > xmax) {
-                    xmax = x;
-                }
-                if (xmin == xmax) {
-                    xmin--;
-                    xmax++;
-                }
-                v = (Sint32) x;
-                v -= (xmax + xmin + 1) / 2;
-                v *= 32768 / ((xmax - xmin + 1) / 2);
-                SDL_PrivateJoystickAxis(joy, 0, v);
-            }
-            if (abs(y - gameport.y) > 8) {
-                y = gameport.y;
-                if (y < ymin) {
-                    ymin = y;
-                }
-                if (y > ymax) {
-                    ymax = y;
-                }
-                if (ymin == ymax) {
-                    ymin--;
-                    ymax++;
-                }
-                v = (Sint32) y;
-                v -= (ymax + ymin + 1) / 2;
-                v *= 32768 / ((ymax - ymin + 1) / 2);
-                SDL_PrivateJoystickAxis(joy, 1, v);
-            }
-            if (gameport.b1 != joy->buttons[0]) {
-                SDL_PrivateJoystickButton(joy, 0, gameport.b1);
-            }
-            if (gameport.b2 != joy->buttons[1]) {
-                SDL_PrivateJoystickButton(joy, 1, gameport.b2);
-            }
-        }
-        return;
-    }
-#endif /* defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
-
-    rep = &joy->hwdata->inreport;
-
-    while (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) == rep->size) {
-#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
-        hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
-#else
-        hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
-#endif
-        if (hdata == NULL) {
-            /*fprintf(stderr, "%s: Cannot start HID parser\n", joy->hwdata->path);*/
-            continue;
-        }
-
-        for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) {
-            switch (hitem.kind) {
-            case hid_input:
-                switch (HID_PAGE(hitem.usage)) {
-                case HUP_GENERIC_DESKTOP:
-                    {
-                        unsigned usage = HID_USAGE(hitem.usage);
-                        int joyaxe = usage_to_joyaxe(usage);
-                        if (joyaxe >= 0) {
-                            naxe = joy->hwdata->axis_map[joyaxe];
-                            /* scaleaxe */
-                            v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
-                            v -= (hitem.logical_maximum +
-                                  hitem.logical_minimum + 1) / 2;
-                            v *= 32768 /
-                                ((hitem.logical_maximum -
-                                  hitem.logical_minimum + 1) / 2);
-                            if (v != joy->axes[naxe]) {
-                                SDL_PrivateJoystickAxis(joy, naxe, v);
-                            }
-                        } else if (usage == HUG_HAT_SWITCH) {
-                            v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
-                            SDL_PrivateJoystickHat(joy, 0,
-                                                   hatval_to_sdl(v) -
-                                                   hitem.logical_minimum);
-                        }
-                        break;
-                    }
-                case HUP_BUTTON:
-                    v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem);
-                    if (joy->buttons[nbutton] != v) {
-                        SDL_PrivateJoystickButton(joy, nbutton, v);
-                    }
-                    nbutton++;
-                    break;
-                default:
-                    continue;
-                }
-                break;
-            default:
-                break;
-            }
-        }
-        hid_end_parse(hdata);
-    }
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joy)
-{
-    if (SDL_strncmp(joy->hwdata->path, "/dev/joy", 8)) {
-        report_free(&joy->hwdata->inreport);
-        hid_dispose_report_desc(joy->hwdata->repdesc);
-    }
-    close(joy->hwdata->fd);
-    SDL_free(joy->hwdata->path);
-    SDL_free(joy->hwdata);
-
-    return;
-}
-
-void
-SDL_SYS_JoystickQuit(void)
-{
-    int i;
-
-    for (i = 0; i < MAX_JOYS; i++) {
-        SDL_free(joynames[i]);
-        SDL_free(joydevnames[i]);
-    }
-
-    return;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = joystick->name;
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-static int
-report_alloc(struct report *r, struct report_desc *rd, int repind)
-{
-    int len;
-
-#ifdef __DragonFly__
-    len = hid_report_size(rd, r->rid, repinfo[repind].kind);
-#elif __FREEBSD__
-# if (__FreeBSD_kernel_version >= 460000) || defined(__FreeBSD_kernel__)
-#  if (__FreeBSD_kernel_version <= 500111)
-    len = hid_report_size(rd, r->rid, repinfo[repind].kind);
-#  else
-    len = hid_report_size(rd, repinfo[repind].kind, r->rid);
-#  endif
-# else
-    len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
-# endif
-#else
-# ifdef USBHID_NEW
-    len = hid_report_size(rd, repinfo[repind].kind, r->rid);
-# else
-    len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
-# endif
-#endif
-
-    if (len < 0) {
-        return SDL_SetError("Negative HID report size");
-    }
-    r->size = len;
-
-    if (r->size > 0) {
-#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)
-        r->buf = SDL_malloc(r->size);
-#else
-        r->buf = SDL_malloc(sizeof(*r->buf) - sizeof(REP_BUF_DATA(r)) +
-                            r->size);
-#endif
-        if (r->buf == NULL) {
-            return SDL_OutOfMemory();
-        }
-    } else {
-        r->buf = NULL;
-    }
-
-    r->status = SREPORT_CLEAN;
-    return 0;
-}
-
-static void
-report_free(struct report *r)
-{
-    SDL_free(r->buf);
-    r->status = SREPORT_UNINIT;
-}
-
-#endif /* SDL_JOYSTICK_USBHID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/darwin/SDL_sysjoystick.c b/deps/SDL2/src/joystick/darwin/SDL_sysjoystick.c
deleted file mode 100644
index 55ec41e..0000000
--- a/deps/SDL2/src/joystick/darwin/SDL_sysjoystick.c
+++ /dev/null
@@ -1,1157 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_IOKIT
-
-/* SDL joystick driver for Darwin / Mac OS X, based on the IOKit HID API */
-/* Written 2001 by Max Horn */
-
-#include <unistd.h>
-#include <ctype.h>
-#include <sysexits.h>
-#include <mach/mach.h>
-#include <mach/mach_error.h>
-#include <IOKit/IOKitLib.h>
-#include <IOKit/IOCFPlugIn.h>
-#ifdef MACOS_10_0_4
-#include <IOKit/hidsystem/IOHIDUsageTables.h>
-#else
-/* The header was moved here in Mac OS X 10.1 */
-#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
-#endif
-#include <IOKit/hid/IOHIDLib.h>
-#include <IOKit/hid/IOHIDKeys.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <Carbon/Carbon.h>      /* for NewPtrClear, DisposePtr */
-#include <IOKit/IOMessage.h>
-
-/* For force feedback testing. */
-#include <ForceFeedback/ForceFeedback.h>
-#include <ForceFeedback/ForceFeedbackConstants.h>
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-#include "SDL_sysjoystick_c.h"
-#include "SDL_events.h"
-#if !SDL_EVENTS_DISABLED
-#include "../../events/SDL_events_c.h"
-#endif
-
-
-/* Linked list of all available devices */
-static recDevice *gpDeviceList = NULL;
-/* OSX reference to the notification object that tells us about device insertion/removal */
-IONotificationPortRef notificationPort = 0;
-/* if 1 then a device was added since the last update call */
-static SDL_bool s_bDeviceAdded = SDL_FALSE;
-static SDL_bool s_bDeviceRemoved = SDL_FALSE;
-
-/* static incrementing counter for new joystick devices seen on the system. Devices should start with index 0 */
-static int s_joystick_instance_id = -1;
-
-static void
-HIDReportErrorNum(char *strError, long numError)
-{
-    SDL_SetError(strError);
-}
-
-static void HIDGetCollectionElements(CFMutableDictionaryRef deviceProperties,
-                                     recDevice * pDevice);
-
-/* returns current value for element, polling element
- * will return 0 on error conditions which should be accounted for by application
- */
-
-static SInt32
-HIDGetElementValue(recDevice * pDevice, recElement * pElement)
-{
-    IOReturn result = kIOReturnSuccess;
-    IOHIDEventStruct hidEvent;
-    hidEvent.value = 0;
-
-    if (NULL != pDevice && NULL != pElement && NULL != pDevice->interface) {
-        result =
-            (*(pDevice->interface))->getElementValue(pDevice->interface,
-                                                     pElement->cookie,
-                                                     &hidEvent);
-        if (kIOReturnSuccess == result) {
-            /* record min and max for auto calibration */
-            if (hidEvent.value < pElement->minReport)
-                pElement->minReport = hidEvent.value;
-            if (hidEvent.value > pElement->maxReport)
-                pElement->maxReport = hidEvent.value;
-        }
-    }
-
-    /* auto user scale */
-    return hidEvent.value;
-}
-
-static SInt32
-HIDScaledCalibratedValue(recDevice * pDevice, recElement * pElement,
-                         long min, long max)
-{
-    float deviceScale = max - min;
-    float readScale = pElement->maxReport - pElement->minReport;
-    SInt32 value = HIDGetElementValue(pDevice, pElement);
-    if (readScale == 0)
-        return value;           /* no scaling at all */
-    else
-        return ((value - pElement->minReport) * deviceScale / readScale) +
-            min;
-}
-
-
-static void
-HIDRemovalCallback(void *target, IOReturn result, void *refcon, void *sender)
-{
-    recDevice *device = (recDevice *) refcon;
-    device->removed = 1;
-    s_bDeviceRemoved = SDL_TRUE;
-}
-
-
-/* Called by the io port notifier on removal of this device
- */
-void JoystickDeviceWasRemovedCallback( void * refcon, io_service_t service, natural_t messageType, void * messageArgument )
-{
-    if( messageType == kIOMessageServiceIsTerminated && refcon )
-    {
-        recDevice *device = (recDevice *) refcon;
-        device->removed = 1;
-        s_bDeviceRemoved = SDL_TRUE;
-    }
-}
-
-
-/* Create and open an interface to device, required prior to extracting values or building queues.
- * Note: application now owns the device and must close and release it prior to exiting
- */
-
-static IOReturn
-HIDCreateOpenDeviceInterface(io_object_t hidDevice, recDevice * pDevice)
-{
-    IOReturn result = kIOReturnSuccess;
-    HRESULT plugInResult = S_OK;
-    SInt32 score = 0;
-    IOCFPlugInInterface **ppPlugInInterface = NULL;
-
-    if (NULL == pDevice->interface) {
-        result =
-            IOCreatePlugInInterfaceForService(hidDevice,
-                                              kIOHIDDeviceUserClientTypeID,
-                                              kIOCFPlugInInterfaceID,
-                                              &ppPlugInInterface, &score);
-        if (kIOReturnSuccess == result) {
-            /* Call a method of the intermediate plug-in to create the device interface */
-            plugInResult =
-                (*ppPlugInInterface)->QueryInterface(ppPlugInInterface,
-                                                     CFUUIDGetUUIDBytes
-                                                     (kIOHIDDeviceInterfaceID),
-                                                     (void *)
-                                                     &(pDevice->interface));
-            if (S_OK != plugInResult)
-                HIDReportErrorNum
-                    ("Couldn't query HID class device interface from plugInInterface",
-                     plugInResult);
-            (*ppPlugInInterface)->Release(ppPlugInInterface);
-        } else
-            HIDReportErrorNum
-                ("Failed to create **plugInInterface via IOCreatePlugInInterfaceForService.",
-                 result);
-    }
-    if (NULL != pDevice->interface) {
-        result = (*(pDevice->interface))->open(pDevice->interface, 0);
-        if (kIOReturnSuccess != result)
-            HIDReportErrorNum
-                ("Failed to open pDevice->interface via open.", result);
-        else
-        {
-            pDevice->portIterator = 0;
-
-            /* It's okay if this fails, we have another detection method below */
-            (*(pDevice->interface))->setRemovalCallback(pDevice->interface,
-                                                        HIDRemovalCallback,
-                                                        pDevice, pDevice);
-
-            /* now connect notification for new devices */
-            pDevice->notificationPort = IONotificationPortCreate(kIOMasterPortDefault);
-
-            CFRunLoopAddSource(CFRunLoopGetCurrent(),
-                               IONotificationPortGetRunLoopSource(pDevice->notificationPort),
-                               kCFRunLoopDefaultMode);
-
-            /* Register for notifications when a serial port is added to the system */
-            result = IOServiceAddInterestNotification(pDevice->notificationPort,
-                                                      hidDevice,
-                                                      kIOGeneralInterest,
-                                                      JoystickDeviceWasRemovedCallback,
-                                                      pDevice,
-                                                      &pDevice->portIterator);
-            if (kIOReturnSuccess != result) {
-                HIDReportErrorNum
-                    ("Failed to register for removal callback.", result);
-            }
-        }
-
-    }
-    return result;
-}
-
-/* Closes and releases interface to device, should be done prior to exiting application
- * Note: will have no affect if device or interface do not exist
- * application will "own" the device if interface is not closed
- * (device may have to be plug and re-plugged in different location to get it working again without a restart)
- */
-
-static IOReturn
-HIDCloseReleaseInterface(recDevice * pDevice)
-{
-    IOReturn result = kIOReturnSuccess;
-
-    if ((NULL != pDevice) && (NULL != pDevice->interface)) {
-        /* close the interface */
-        result = (*(pDevice->interface))->close(pDevice->interface);
-        if (kIOReturnNotOpen == result) {
-            /* do nothing as device was not opened, thus can't be closed */
-        } else if (kIOReturnSuccess != result)
-            HIDReportErrorNum("Failed to close IOHIDDeviceInterface.",
-                              result);
-        /* release the interface */
-        result = (*(pDevice->interface))->Release(pDevice->interface);
-        if (kIOReturnSuccess != result)
-            HIDReportErrorNum("Failed to release IOHIDDeviceInterface.",
-                              result);
-        pDevice->interface = NULL;
-
-        if ( pDevice->portIterator )
-        {
-            IOObjectRelease( pDevice->portIterator );
-            pDevice->portIterator = 0;
-        }
-    }
-    return result;
-}
-
-/* extracts actual specific element information from each element CF dictionary entry */
-
-static void
-HIDGetElementInfo(CFTypeRef refElement, recElement * pElement)
-{
-    long number;
-    CFTypeRef refType;
-
-    refType = CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementCookieKey));
-    if (refType && CFNumberGetValue(refType, kCFNumberLongType, &number))
-        pElement->cookie = (IOHIDElementCookie) number;
-    refType = CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementMinKey));
-    if (refType && CFNumberGetValue(refType, kCFNumberLongType, &number))
-        pElement->minReport = pElement->min = number;
-    pElement->maxReport = pElement->min;
-    refType = CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementMaxKey));
-    if (refType && CFNumberGetValue(refType, kCFNumberLongType, &number))
-        pElement->maxReport = pElement->max = number;
-/*
-    TODO: maybe should handle the following stuff somehow?
-
-    refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMinKey));
-    if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
-        pElement->scaledMin = number;
-    refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMaxKey));
-    if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
-        pElement->scaledMax = number;
-    refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementSizeKey));
-    if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
-        pElement->size = number;
-    refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsRelativeKey));
-    if (refType)
-        pElement->relative = CFBooleanGetValue (refType);
-    refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsWrappingKey));
-    if (refType)
-        pElement->wrapping = CFBooleanGetValue (refType);
-    refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsNonLinearKey));
-    if (refType)
-        pElement->nonLinear = CFBooleanGetValue (refType);
-    refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasPreferedStateKey));
-    if (refType)
-        pElement->preferredState = CFBooleanGetValue (refType);
-    refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasNullStateKey));
-    if (refType)
-        pElement->nullState = CFBooleanGetValue (refType);
-*/
-}
-
-/* examines CF dictionary value in device element hierarchy to determine if it is element of interest or a collection of more elements
- * if element of interest allocate storage, add to list and retrieve element specific info
- * if collection then pass on to deconstruction collection into additional individual elements
- */
-
-static void
-HIDAddElement(CFTypeRef refElement, recDevice * pDevice)
-{
-    recElement *element = NULL;
-    recElement **headElement = NULL;
-    long elementType, usagePage, usage;
-    CFTypeRef refElementType =
-        CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementTypeKey));
-    CFTypeRef refUsagePage =
-        CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementUsagePageKey));
-    CFTypeRef refUsage =
-        CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementUsageKey));
-
-
-    if ((refElementType)
-        &&
-        (CFNumberGetValue(refElementType, kCFNumberLongType, &elementType))) {
-        /* look at types of interest */
-        if ((elementType == kIOHIDElementTypeInput_Misc)
-            || (elementType == kIOHIDElementTypeInput_Button)
-            || (elementType == kIOHIDElementTypeInput_Axis)) {
-            if (refUsagePage
-                && CFNumberGetValue(refUsagePage, kCFNumberLongType,
-                                    &usagePage) && refUsage
-                && CFNumberGetValue(refUsage, kCFNumberLongType, &usage)) {
-                switch (usagePage) {    /* only interested in kHIDPage_GenericDesktop and kHIDPage_Button */
-                case kHIDPage_GenericDesktop:
-                    {
-                        switch (usage) {        /* look at usage to determine function */
-                        case kHIDUsage_GD_X:
-                        case kHIDUsage_GD_Y:
-                        case kHIDUsage_GD_Z:
-                        case kHIDUsage_GD_Rx:
-                        case kHIDUsage_GD_Ry:
-                        case kHIDUsage_GD_Rz:
-                        case kHIDUsage_GD_Slider:
-                        case kHIDUsage_GD_Dial:
-                        case kHIDUsage_GD_Wheel:
-                            element = (recElement *)
-                                NewPtrClear(sizeof(recElement));
-                            if (element) {
-                                pDevice->axes++;
-                                headElement = &(pDevice->firstAxis);
-                            }
-                            break;
-                        case kHIDUsage_GD_Hatswitch:
-                            element = (recElement *)
-                                NewPtrClear(sizeof(recElement));
-                            if (element) {
-                                pDevice->hats++;
-                                headElement = &(pDevice->firstHat);
-                            }
-                            break;
-                        }
-                    }
-                    break;
-                case kHIDPage_Simulation:
-                    switch (usage) {
-                        case kHIDUsage_Sim_Rudder:
-                        case kHIDUsage_Sim_Throttle:
-                            element = (recElement *)
-                                NewPtrClear(sizeof(recElement));
-                            if (element) {
-                                pDevice->axes++;
-                                headElement = &(pDevice->firstAxis);
-                            }
-                            break;
-
-                        default:
-                            break;
-                    }
-                    break;
-                case kHIDPage_Button:
-                    element = (recElement *)
-                        NewPtrClear(sizeof(recElement));
-                    if (element) {
-                        pDevice->buttons++;
-                        headElement = &(pDevice->firstButton);
-                    }
-                    break;
-                default:
-                    break;
-                }
-            }
-        } else if (kIOHIDElementTypeCollection == elementType)
-            HIDGetCollectionElements((CFMutableDictionaryRef) refElement,
-                                     pDevice);
-    }
-
-    if (element && headElement) {       /* add to list */
-        recElement *elementPrevious = NULL;
-        recElement *elementCurrent = *headElement;
-        while (elementCurrent && usage >= elementCurrent->usage) {
-            elementPrevious = elementCurrent;
-            elementCurrent = elementCurrent->pNext;
-        }
-        if (elementPrevious) {
-            elementPrevious->pNext = element;
-        } else {
-            *headElement = element;
-        }
-        element->usagePage = usagePage;
-        element->usage = usage;
-        element->pNext = elementCurrent;
-        HIDGetElementInfo(refElement, element);
-        pDevice->elements++;
-    }
-}
-
-/* collects information from each array member in device element list (each array member = element) */
-
-static void
-HIDGetElementsCFArrayHandler(const void *value, void *parameter)
-{
-    if (CFGetTypeID(value) == CFDictionaryGetTypeID())
-        HIDAddElement((CFTypeRef) value, (recDevice *) parameter);
-}
-
-/* handles retrieval of element information from arrays of elements in device IO registry information */
-
-static void
-HIDGetElements(CFTypeRef refElementCurrent, recDevice * pDevice)
-{
-    CFTypeID type = CFGetTypeID(refElementCurrent);
-    if (type == CFArrayGetTypeID()) {   /* if element is an array */
-        CFRange range = { 0, CFArrayGetCount(refElementCurrent) };
-        /* CountElementsCFArrayHandler called for each array member */
-        CFArrayApplyFunction(refElementCurrent, range,
-                             HIDGetElementsCFArrayHandler, pDevice);
-    }
-}
-
-/* handles extracting element information from element collection CF types
- * used from top level element decoding and hierarchy deconstruction to flatten device element list
- */
-
-static void
-HIDGetCollectionElements(CFMutableDictionaryRef deviceProperties,
-                         recDevice * pDevice)
-{
-    CFTypeRef refElementTop =
-        CFDictionaryGetValue(deviceProperties, CFSTR(kIOHIDElementKey));
-    if (refElementTop)
-        HIDGetElements(refElementTop, pDevice);
-}
-
-/* use top level element usage page and usage to discern device usage page and usage setting appropriate vlaues in device record */
-
-static void
-HIDTopLevelElementHandler(const void *value, void *parameter)
-{
-    CFTypeRef refCF = 0;
-    if (CFGetTypeID(value) != CFDictionaryGetTypeID())
-        return;
-    refCF = CFDictionaryGetValue(value, CFSTR(kIOHIDElementUsagePageKey));
-    if (!CFNumberGetValue
-        (refCF, kCFNumberLongType, &((recDevice *) parameter)->usagePage))
-        SDL_SetError("CFNumberGetValue error retrieving pDevice->usagePage.");
-    refCF = CFDictionaryGetValue(value, CFSTR(kIOHIDElementUsageKey));
-    if (!CFNumberGetValue
-        (refCF, kCFNumberLongType, &((recDevice *) parameter)->usage))
-        SDL_SetError("CFNumberGetValue error retrieving pDevice->usage.");
-}
-
-/* extracts device info from CF dictionary records in IO registry */
-
-static void
-HIDGetDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef hidProperties,
-                 recDevice * pDevice)
-{
-    CFMutableDictionaryRef usbProperties = 0;
-    io_registry_entry_t parent1, parent2;
-
-    /* Mac OS X currently is not mirroring all USB properties to HID page so need to look at USB device page also
-     * get dictionary for USB properties: step up two levels and get CF dictionary for USB properties
-     */
-    if ((KERN_SUCCESS == IORegistryEntryGetParentEntry(hidDevice, kIOServicePlane, &parent1))
-        && (KERN_SUCCESS == IORegistryEntryGetParentEntry(parent1, kIOServicePlane, &parent2))
-        && (KERN_SUCCESS == IORegistryEntryCreateCFProperties(parent2, &usbProperties, kCFAllocatorDefault, kNilOptions))) {
-        if (usbProperties) {
-            CFTypeRef refCF = 0;
-            /* get device info
-             * try hid dictionary first, if fail then go to usb dictionary
-             */
-
-            /* get product name */
-            refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDProductKey));
-            if (!refCF) {
-                refCF = CFDictionaryGetValue(usbProperties, CFSTR("USB Product Name"));
-            }
-            if (refCF) {
-                if (!CFStringGetCString(refCF, pDevice->product, 256, CFStringGetSystemEncoding())) {
-                    SDL_SetError("CFStringGetCString error retrieving pDevice->product.");
-                }
-            }
-
-            /* get usage page and usage */
-            refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDPrimaryUsagePageKey));
-            if (refCF) {
-                if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usagePage)) {
-                    SDL_SetError("CFNumberGetValue error retrieving pDevice->usagePage.");
-                }
-
-                refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDPrimaryUsageKey));
-                if (refCF) {
-                    if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usage)) {
-                        SDL_SetError("CFNumberGetValue error retrieving pDevice->usage.");
-                    }
-                }
-            }
-
-            refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDVendorIDKey));
-            if (refCF) {
-                if (!CFNumberGetValue(refCF, kCFNumberLongType, &pDevice->guid.data[0])) {
-                    SDL_SetError("CFNumberGetValue error retrieving pDevice->guid[0]");
-                }
-            }
-
-            refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDProductIDKey));
-            if (refCF) {
-                if (!CFNumberGetValue(refCF, kCFNumberLongType, &pDevice->guid.data[8])) {
-                    SDL_SetError("CFNumberGetValue error retrieving pDevice->guid[8]");
-                }
-            }
-
-            /* Check to make sure we have a vendor and product ID
-               If we don't, use the same algorithm as the Linux code for Bluetooth devices */
-            {
-                Uint32 *guid32 = (Uint32*)pDevice->guid.data;
-                if (!guid32[0] && !guid32[1]) {
-                    const Uint16 BUS_BLUETOOTH = 0x05;
-                    Uint16 *guid16 = (Uint16 *)guid32;
-                    *guid16++ = BUS_BLUETOOTH;
-                    *guid16++ = 0;
-                    SDL_strlcpy((char*)guid16, pDevice->product, sizeof(pDevice->guid.data) - 4);
-                }
-            }
-
-            /* If we don't have a vendor and product ID this is probably a Bluetooth device */
-
-            if (NULL == refCF) {    /* get top level element HID usage page or usage */
-                /* use top level element instead */
-                CFTypeRef refCFTopElement = 0;
-                refCFTopElement = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDElementKey));
-                {
-                    /* refCFTopElement points to an array of element dictionaries */
-                    CFRange range = { 0, CFArrayGetCount(refCFTopElement) };
-                    CFArrayApplyFunction(refCFTopElement, range, HIDTopLevelElementHandler, pDevice);
-                }
-            }
-
-            CFRelease(usbProperties);
-        } else {
-            SDL_SetError("IORegistryEntryCreateCFProperties failed to create usbProperties.");
-        }
-
-        if (kIOReturnSuccess != IOObjectRelease(parent2)) {
-            SDL_SetError("IOObjectRelease error with parent2");
-        }
-        if (kIOReturnSuccess != IOObjectRelease(parent1)) {
-            SDL_SetError("IOObjectRelease error with parent1");
-        }
-    }
-}
-
-
-static recDevice *
-HIDBuildDevice(io_object_t hidDevice)
-{
-    recDevice *pDevice = (recDevice *) NewPtrClear(sizeof(recDevice));
-    if (pDevice) {
-        /* get dictionary for HID properties */
-        CFMutableDictionaryRef hidProperties = 0;
-        kern_return_t result =
-            IORegistryEntryCreateCFProperties(hidDevice, &hidProperties,
-                                              kCFAllocatorDefault,
-                                              kNilOptions);
-        if ((result == KERN_SUCCESS) && hidProperties) {
-            /* create device interface */
-            result = HIDCreateOpenDeviceInterface(hidDevice, pDevice);
-            if (kIOReturnSuccess == result) {
-                HIDGetDeviceInfo(hidDevice, hidProperties, pDevice);    /* hidDevice used to find parents in registry tree */
-                HIDGetCollectionElements(hidProperties, pDevice);
-            } else {
-                DisposePtr((Ptr) pDevice);
-                pDevice = NULL;
-            }
-            CFRelease(hidProperties);
-        } else {
-            DisposePtr((Ptr) pDevice);
-            pDevice = NULL;
-        }
-    }
-    return pDevice;
-}
-
-/* disposes of the element list associated with a device and the memory associated with the list
- */
-
-static void
-HIDDisposeElementList(recElement ** elementList)
-{
-    recElement *pElement = *elementList;
-    while (pElement) {
-        recElement *pElementNext = pElement->pNext;
-        DisposePtr((Ptr) pElement);
-        pElement = pElementNext;
-    }
-    *elementList = NULL;
-}
-
-/* disposes of a single device, closing and releaseing interface, freeing memory fro device and elements, setting device pointer to NULL
- * all your device no longer belong to us... (i.e., you do not 'own' the device anymore)
- */
-
-static recDevice *
-HIDDisposeDevice(recDevice ** ppDevice)
-{
-    kern_return_t result = KERN_SUCCESS;
-    recDevice *pDeviceNext = NULL;
-    if (*ppDevice) {
-        /* save next device prior to disposing of this device */
-        pDeviceNext = (*ppDevice)->pNext;
-
-        /* free posible io_service_t */
-        if ((*ppDevice)->ffservice) {
-            IOObjectRelease((*ppDevice)->ffservice);
-            (*ppDevice)->ffservice = 0;
-        }
-
-        /* free element lists */
-        HIDDisposeElementList(&(*ppDevice)->firstAxis);
-        HIDDisposeElementList(&(*ppDevice)->firstButton);
-        HIDDisposeElementList(&(*ppDevice)->firstHat);
-
-        result = HIDCloseReleaseInterface(*ppDevice);   /* function sanity checks interface value (now application does not own device) */
-        if (kIOReturnSuccess != result)
-            HIDReportErrorNum
-                ("HIDCloseReleaseInterface failed when trying to dipose device.",
-                 result);
-        DisposePtr((Ptr) * ppDevice);
-        *ppDevice = NULL;
-    }
-    return pDeviceNext;
-}
-
-
-/* Given an io_object_t from OSX adds a joystick device to our list if appropriate
- */
-int
-AddDeviceHelper( io_object_t ioHIDDeviceObject )
-{
-    recDevice *device;
-
-    /* build a device record */
-    device = HIDBuildDevice(ioHIDDeviceObject);
-    if (!device)
-        return 0;
-
-    /* Filter device list to non-keyboard/mouse stuff */
-    if ((device->usagePage != kHIDPage_GenericDesktop) ||
-        ((device->usage != kHIDUsage_GD_Joystick &&
-          device->usage != kHIDUsage_GD_GamePad &&
-          device->usage != kHIDUsage_GD_MultiAxisController))) {
-
-        /* release memory for the device */
-        HIDDisposeDevice(&device);
-        DisposePtr((Ptr) device);
-        return 0;
-    }
-
-    /* Allocate an instance ID for this device */
-    device->instance_id = ++s_joystick_instance_id;
-
-    /* We have to do some storage of the io_service_t for
-     * SDL_HapticOpenFromJoystick */
-    if (FFIsForceFeedback(ioHIDDeviceObject) == FF_OK) {
-        device->ffservice = ioHIDDeviceObject;
-    } else {
-        device->ffservice = 0;
-    }
-
-    device->send_open_event = 1;
-    s_bDeviceAdded = SDL_TRUE;
-
-    /* Add device to the end of the list */
-    if ( !gpDeviceList )
-    {
-        gpDeviceList = device;
-    }
-    else
-    {
-        recDevice *curdevice;
-
-        curdevice = gpDeviceList;
-        while ( curdevice->pNext )
-        {
-            curdevice = curdevice->pNext;
-        }
-        curdevice->pNext = device;
-    }
-
-    return 1;
-}
-
-
-/* Called by our IO port notifier on the master port when a HID device is inserted, we iterate
- *  and check for new joysticks
- */
-void JoystickDeviceWasAddedCallback( void *refcon, io_iterator_t iterator )
-{
-    io_object_t ioHIDDeviceObject = 0;
-
-    while ( ( ioHIDDeviceObject = IOIteratorNext(iterator) ) )
-    {
-        if ( ioHIDDeviceObject )
-        {
-            AddDeviceHelper( ioHIDDeviceObject );
-        }
-    }
-}
-
-
-/* Function to scan the system for joysticks.
- * Joystick 0 should be the system default joystick.
- * This function should return the number of available joysticks, or -1
- * on an unrecoverable fatal error.
- */
-int
-SDL_SYS_JoystickInit(void)
-{
-    IOReturn result = kIOReturnSuccess;
-    mach_port_t masterPort = 0;
-    io_iterator_t hidObjectIterator = 0;
-    CFMutableDictionaryRef hidMatchDictionary = NULL;
-    io_object_t ioHIDDeviceObject = 0;
-    io_iterator_t portIterator = 0;
-
-    if (gpDeviceList) {
-        return SDL_SetError("Joystick: Device list already inited.");
-    }
-
-    result = IOMasterPort(bootstrap_port, &masterPort);
-    if (kIOReturnSuccess != result) {
-        return SDL_SetError("Joystick: IOMasterPort error with bootstrap_port.");
-    }
-
-    /* Set up a matching dictionary to search I/O Registry by class name for all HID class devices. */
-    hidMatchDictionary = IOServiceMatching(kIOHIDDeviceKey);
-    if (hidMatchDictionary) {
-        /* Add key for device type (joystick, in this case) to refine the matching dictionary. */
-
-        /* NOTE: we now perform this filtering later
-           UInt32 usagePage = kHIDPage_GenericDesktop;
-           UInt32 usage = kHIDUsage_GD_Joystick;
-           CFNumberRef refUsage = NULL, refUsagePage = NULL;
-
-           refUsage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usage);
-           CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsageKey), refUsage);
-           refUsagePage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usagePage);
-           CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsagePageKey), refUsagePage);
-         */
-    } else {
-        return SDL_SetError
-            ("Joystick: Failed to get HID CFMutableDictionaryRef via IOServiceMatching.");
-    }
-
-    /* Now search I/O Registry for matching devices. */
-    result =
-        IOServiceGetMatchingServices(masterPort, hidMatchDictionary,
-                                     &hidObjectIterator);
-    /* Check for errors */
-    if (kIOReturnSuccess != result) {
-        return SDL_SetError("Joystick: Couldn't create a HID object iterator.");
-    }
-    if (!hidObjectIterator) {   /* there are no joysticks */
-        gpDeviceList = NULL;
-        return 0;
-    }
-    /* IOServiceGetMatchingServices consumes a reference to the dictionary, so we don't need to release the dictionary ref. */
-
-    /* build flat linked list of devices from device iterator */
-
-    gpDeviceList = NULL;
-
-    while ((ioHIDDeviceObject = IOIteratorNext(hidObjectIterator))) {
-        AddDeviceHelper( ioHIDDeviceObject );
-    }
-    result = IOObjectRelease(hidObjectIterator);        /* release the iterator */
-
-    /* now connect notification for new devices */
-    notificationPort = IONotificationPortCreate(masterPort);
-    hidMatchDictionary = IOServiceMatching(kIOHIDDeviceKey);
-
-    CFRunLoopAddSource(CFRunLoopGetCurrent(),
-                       IONotificationPortGetRunLoopSource(notificationPort),
-                       kCFRunLoopDefaultMode);
-
-    /* Register for notifications when a serial port is added to the system */
-    result = IOServiceAddMatchingNotification(notificationPort,
-                                                            kIOFirstMatchNotification,
-                                                            hidMatchDictionary,
-                                                            JoystickDeviceWasAddedCallback,
-                                                            NULL,
-                                                            &portIterator);
-    while (IOIteratorNext(portIterator)) {}; /* Run out the iterator or notifications won't start (you can also use it to iterate the available devices). */
-
-    return SDL_SYS_NumJoysticks();
-}
-
-/* Function to return the number of joystick devices plugged in right now */
-int
-SDL_SYS_NumJoysticks()
-{
-    recDevice *device = gpDeviceList;
-    int nJoySticks = 0;
-
-    while ( device )
-    {
-        if ( !device->removed )
-            nJoySticks++;
-        device = device->pNext;
-    }
-
-    return nJoySticks;
-}
-
-/* Function to cause any queued joystick insertions to be processed
- */
-void
-SDL_SYS_JoystickDetect()
-{
-    if ( s_bDeviceAdded || s_bDeviceRemoved )
-    {
-        recDevice *device = gpDeviceList;
-        s_bDeviceAdded = SDL_FALSE;
-        s_bDeviceRemoved = SDL_FALSE;
-        int device_index = 0;
-        /* send notifications */
-        while ( device )
-        {
-            if ( device->send_open_event )
-            {
-                device->send_open_event = 0;
-#if !SDL_EVENTS_DISABLED
-                SDL_Event event;
-                event.type = SDL_JOYDEVICEADDED;
-
-                if (SDL_GetEventState(event.type) == SDL_ENABLE) {
-                    event.jdevice.which = device_index;
-                    if ((SDL_EventOK == NULL)
-                        || (*SDL_EventOK) (SDL_EventOKParam, &event)) {
-                        SDL_PushEvent(&event);
-                    }
-                }
-#endif /* !SDL_EVENTS_DISABLED */
-
-            }
-
-            if ( device->removed )
-            {
-                recDevice *removeDevice = device;
-                if ( gpDeviceList == removeDevice )
-                {
-                    device = device->pNext;
-                    gpDeviceList = device;
-                }
-                else
-                {
-                    device = gpDeviceList;
-                    while ( device->pNext != removeDevice )
-                    {
-                        device = device->pNext;
-                    }
-
-                    device->pNext = removeDevice->pNext;
-                }
-
-#if !SDL_EVENTS_DISABLED
-                SDL_Event event;
-                event.type = SDL_JOYDEVICEREMOVED;
-
-                if (SDL_GetEventState(event.type) == SDL_ENABLE) {
-                    event.jdevice.which = removeDevice->instance_id;
-                    if ((SDL_EventOK == NULL)
-                        || (*SDL_EventOK) (SDL_EventOKParam, &event)) {
-                        SDL_PushEvent(&event);
-                    }
-                }
-
-                DisposePtr((Ptr) removeDevice);
-#endif /* !SDL_EVENTS_DISABLED */
-
-            }
-            else
-            {
-                device = device->pNext;
-                device_index++;
-            }
-        }
-    }
-}
-
-SDL_bool
-SDL_SYS_JoystickNeedsPolling()
-{
-    return s_bDeviceAdded || s_bDeviceRemoved;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *
-SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
-    recDevice *device = gpDeviceList;
-
-    for (; device_index > 0; device_index--)
-        device = device->pNext;
-
-    return device->product;
-}
-
-/* Function to return the instance id of the joystick at device_index
- */
-SDL_JoystickID
-SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
-    recDevice *device = gpDeviceList;
-    int index;
-
-    for (index = device_index; index > 0; index--)
-        device = device->pNext;
-
-    return device->instance_id;
-}
-
-/* Function to open a joystick for use.
- * The joystick to open is specified by the index field of the joystick.
- * This should fill the nbuttons and naxes fields of the joystick structure.
- * It returns 0, or -1 if there is an error.
- */
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
-{
-    recDevice *device = gpDeviceList;
-    int index;
-
-    for (index = device_index; index > 0; index--)
-        device = device->pNext;
-
-    joystick->instance_id = device->instance_id;
-    joystick->hwdata = device;
-    joystick->name = device->product;
-
-    joystick->naxes = device->axes;
-    joystick->nhats = device->hats;
-    joystick->nballs = 0;
-    joystick->nbuttons = device->buttons;
-    return 0;
-}
-
-/* Function to query if the joystick is currently attached
- *   It returns 1 if attached, 0 otherwise.
- */
-SDL_bool
-SDL_SYS_JoystickAttached(SDL_Joystick * joystick)
-{
-    recDevice *device = gpDeviceList;
-
-    while ( device )
-    {
-        if ( joystick->instance_id == device->instance_id )
-            return SDL_TRUE;
-
-        device = device->pNext;
-    }
-
-    return SDL_FALSE;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-{
-    recDevice *device = joystick->hwdata;
-    recElement *element;
-    SInt32 value, range;
-    int i;
-
-    if ( !device )
-        return;
-
-    if (device->removed) {      /* device was unplugged; ignore it. */
-        recDevice *devicelist = gpDeviceList;
-        joystick->closed = 1;
-        joystick->uncentered = 1;
-
-        if ( devicelist == device )
-        {
-            gpDeviceList = device->pNext;
-        }
-        else
-        {
-            while ( devicelist->pNext != device )
-            {
-                devicelist = devicelist->pNext;
-            }
-
-            devicelist->pNext = device->pNext;
-        }
-
-        DisposePtr((Ptr) device);
-        joystick->hwdata = NULL;
-
-#if !SDL_EVENTS_DISABLED
-        SDL_Event event;
-        event.type = SDL_JOYDEVICEREMOVED;
-
-        if (SDL_GetEventState(event.type) == SDL_ENABLE) {
-            event.jdevice.which = joystick->instance_id;
-            if ((SDL_EventOK == NULL)
-                || (*SDL_EventOK) (SDL_EventOKParam, &event)) {
-                SDL_PushEvent(&event);
-            }
-        }
-#endif /* !SDL_EVENTS_DISABLED */
-
-        return;
-    }
-
-    element = device->firstAxis;
-    i = 0;
-    while (element) {
-        value = HIDScaledCalibratedValue(device, element, -32768, 32767);
-        if (value != joystick->axes[i])
-            SDL_PrivateJoystickAxis(joystick, i, value);
-        element = element->pNext;
-        ++i;
-    }
-
-    element = device->firstButton;
-    i = 0;
-    while (element) {
-        value = HIDGetElementValue(device, element);
-        if (value > 1)          /* handle pressure-sensitive buttons */
-            value = 1;
-        if (value != joystick->buttons[i])
-            SDL_PrivateJoystickButton(joystick, i, value);
-        element = element->pNext;
-        ++i;
-    }
-
-    element = device->firstHat;
-    i = 0;
-    while (element) {
-        Uint8 pos = 0;
-
-        range = (element->max - element->min + 1);
-        value = HIDGetElementValue(device, element) - element->min;
-        if (range == 4)         /* 4 position hatswitch - scale up value */
-            value *= 2;
-        else if (range != 8)    /* Neither a 4 nor 8 positions - fall back to default position (centered) */
-            value = -1;
-        switch (value) {
-        case 0:
-            pos = SDL_HAT_UP;
-            break;
-        case 1:
-            pos = SDL_HAT_RIGHTUP;
-            break;
-        case 2:
-            pos = SDL_HAT_RIGHT;
-            break;
-        case 3:
-            pos = SDL_HAT_RIGHTDOWN;
-            break;
-        case 4:
-            pos = SDL_HAT_DOWN;
-            break;
-        case 5:
-            pos = SDL_HAT_LEFTDOWN;
-            break;
-        case 6:
-            pos = SDL_HAT_LEFT;
-            break;
-        case 7:
-            pos = SDL_HAT_LEFTUP;
-            break;
-        default:
-            /* Every other value is mapped to center. We do that because some
-             * joysticks use 8 and some 15 for this value, and apparently
-             * there are even more variants out there - so we try to be generous.
-             */
-            pos = SDL_HAT_CENTERED;
-            break;
-        }
-        if (pos != joystick->hats[i])
-            SDL_PrivateJoystickHat(joystick, i, pos);
-        element = element->pNext;
-        ++i;
-    }
-
-    return;
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-{
-    joystick->closed = 1;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void
-SDL_SYS_JoystickQuit(void)
-{
-    while (NULL != gpDeviceList)
-        gpDeviceList = HIDDisposeDevice(&gpDeviceList);
-
-    if ( notificationPort )
-    {
-        IONotificationPortDestroy( notificationPort );
-        notificationPort = 0;
-    }
-}
-
-
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
-    recDevice *device = gpDeviceList;
-    int index;
-
-    for (index = device_index; index > 0; index--)
-        device = device->pNext;
-
-    return device->guid;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick *joystick)
-{
-    return joystick->hwdata->guid;
-}
-
-#endif /* SDL_JOYSTICK_IOKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/darwin/SDL_sysjoystick_c.h b/deps/SDL2/src/joystick/darwin/SDL_sysjoystick_c.h
deleted file mode 100644
index f99dbd8..0000000
--- a/deps/SDL2/src/joystick/darwin/SDL_sysjoystick_c.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef SDL_JOYSTICK_IOKIT_H
-
-
-#include <IOKit/hid/IOHIDLib.h>
-#include <IOKit/hid/IOHIDKeys.h>
-#include <IOKit/IOKitLib.h>
-
-
-struct recElement
-{
-    IOHIDElementCookie cookie;  /* unique value which identifies element, will NOT change */
-    long usagePage, usage;      /* HID usage */
-    long min;                   /* reported min value possible */
-    long max;                   /* reported max value possible */
-#if 0
-    /* TODO: maybe should handle the following stuff somehow? */
-
-    long scaledMin;             /* reported scaled min value possible */
-    long scaledMax;             /* reported scaled max value possible */
-    long size;                  /* size in bits of data return from element */
-    Boolean relative;           /* are reports relative to last report (deltas) */
-    Boolean wrapping;           /* does element wrap around (one value higher than max is min) */
-    Boolean nonLinear;          /* are the values reported non-linear relative to element movement */
-    Boolean preferredState;     /* does element have a preferred state (such as a button) */
-    Boolean nullState;          /* does element have null state */
-#endif                          /* 0 */
-
-    /* runtime variables used for auto-calibration */
-    long minReport;             /* min returned value */
-    long maxReport;             /* max returned value */
-
-    struct recElement *pNext;   /* next element in list */
-};
-typedef struct recElement recElement;
-
-struct joystick_hwdata
-{
-    io_service_t ffservice;     /* Interface for force feedback, 0 = no ff */
-    IOHIDDeviceInterface **interface;   /* interface to device, NULL = no interface */
-    IONotificationPortRef notificationPort; /* port to be notified on joystick removal */
-    io_iterator_t portIterator; /* iterator for removal callback */
-
-    char product[256];          /* name of product */
-    long usage;                 /* usage page from IOUSBHID Parser.h which defines general usage */
-    long usagePage;             /* usage within above page from IOUSBHID Parser.h which defines specific usage */
-
-    long axes;                  /* number of axis (calculated, not reported by device) */
-    long buttons;               /* number of buttons (calculated, not reported by device) */
-    long hats;                  /* number of hat switches (calculated, not reported by device) */
-    long elements;              /* number of total elements (should be total of above) (calculated, not reported by device) */
-
-    recElement *firstAxis;
-    recElement *firstButton;
-    recElement *firstHat;
-
-    int removed;
-    int uncentered;
-
-    int instance_id;
-    SDL_JoystickGUID guid;
-    Uint8 send_open_event;      /* 1 if we need to send an Added event for this device */
-
-    struct joystick_hwdata *pNext;      /* next device */
-};
-typedef struct joystick_hwdata recDevice;
-
-
-#endif /* SDL_JOYSTICK_IOKIT_H */
diff --git a/deps/SDL2/src/joystick/dummy/SDL_sysjoystick.c b/deps/SDL2/src/joystick/dummy/SDL_sysjoystick.c
deleted file mode 100644
index 7dd9153..0000000
--- a/deps/SDL2/src/joystick/dummy/SDL_sysjoystick.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED)
-
-/* This is the system specific header for the SDL joystick API */
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-/* Function to scan the system for joysticks.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int
-SDL_SYS_JoystickInit(void)
-{
-    return (0);
-}
-
-int SDL_SYS_NumJoysticks()
-{
-    return 0;
-}
-
-void SDL_SYS_JoystickDetect()
-{
-}
-
-SDL_bool SDL_SYS_JoystickNeedsPolling()
-{
-    return SDL_FALSE;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *
-SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
-    SDL_SetError("Logic error: No joysticks available");
-    return (NULL);
-}
-
-/* Function to perform the mapping from device index to the instance id for this index */
-SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
-    return device_index;
-}
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
-{
-    return SDL_SetError("Logic error: No joysticks available");
-}
-
-/* Function to determine is this joystick is attached to the system right now */
-SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
-{
-    return SDL_TRUE;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-{
-    return;
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-{
-    return;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void
-SDL_SYS_JoystickQuit(void)
-{
-    return;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = joystick->name;
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-#endif /* SDL_JOYSTICK_DUMMY || SDL_JOYSTICK_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/iphoneos/SDLUIAccelerationDelegate.h b/deps/SDL2/src/joystick/iphoneos/SDLUIAccelerationDelegate.h
deleted file mode 100644
index 733357b..0000000
--- a/deps/SDL2/src/joystick/iphoneos/SDLUIAccelerationDelegate.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#import <UIKit/UIKit.h>
-#import <SDL_types.h>
-
-/* *INDENT-OFF* */
- at interface SDLUIAccelerationDelegate: NSObject <UIAccelerometerDelegate> {
-
-	UIAccelerationValue x, y, z;
-	BOOL isRunning;
-	BOOL hasNewData;
-	
-}
-
-+(SDLUIAccelerationDelegate *)sharedDelegate;
--(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration;
--(void)getLastOrientation:(Sint16 *)data;
--(void)startup;
--(void)shutdown;
--(BOOL)isRunning;
--(BOOL)hasNewData;
--(void)setHasNewData:(BOOL)value;
-
- at end
-/* *INDENT-ON* */
diff --git a/deps/SDL2/src/joystick/iphoneos/SDLUIAccelerationDelegate.m b/deps/SDL2/src/joystick/iphoneos/SDLUIAccelerationDelegate.m
deleted file mode 100644
index 0037c58..0000000
--- a/deps/SDL2/src/joystick/iphoneos/SDLUIAccelerationDelegate.m
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#import "SDLUIAccelerationDelegate.h"
-/* needed for SDL_IPHONE_MAX_GFORCE macro */
-#import "../../../include/SDL_config_iphoneos.h"
-
-static SDLUIAccelerationDelegate *sharedDelegate=nil;
-
- at implementation SDLUIAccelerationDelegate
-
-/*
-    Returns a shared instance of the SDLUIAccelerationDelegate, creating the shared delegate if it doesn't exist yet.
-*/
-+(SDLUIAccelerationDelegate *)sharedDelegate {
-    if (sharedDelegate == nil) {
-        sharedDelegate = [[SDLUIAccelerationDelegate alloc] init];
-    }
-    return sharedDelegate;
-}
-/*
-    UIAccelerometerDelegate delegate method.  Invoked by the UIAccelerometer instance when it has new data for us.
-    We just take the data and mark that we have new data available so that the joystick system will pump it to the
-    events system when SDL_SYS_JoystickUpdate is called.
-*/
--(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
-
-    x = acceleration.x;
-    y = acceleration.y;
-    z = acceleration.z;
-
-    hasNewData = YES;
-}
-/*
-    getLastOrientation -- put last obtained accelerometer data into Sint16 array
-
-    Called from the joystick system when it needs the accelerometer data.
-    Function grabs the last data sent to the accelerometer and converts it
-    from floating point to Sint16, which is what the joystick system expects.
-
-    To do the conversion, the data is first clamped onto the interval
-    [-SDL_IPHONE_MAX_G_FORCE, SDL_IPHONE_MAX_G_FORCE], then the data is multiplied
-    by MAX_SINT16 so that it is mapped to the full range of an Sint16.
-
-    You can customize the clamped range of this function by modifying the
-    SDL_IPHONE_MAX_GFORCE macro in SDL_config_iphoneos.h.
-
-    Once converted to Sint16, the accelerometer data no longer has coherent units.
-    You can convert the data back to units of g-force by multiplying it
-    in your application's code by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
- */
--(void)getLastOrientation:(Sint16 *)data {
-
-    #define MAX_SINT16 0x7FFF
-
-    /* clamp the data */
-    if (x > SDL_IPHONE_MAX_GFORCE) x = SDL_IPHONE_MAX_GFORCE;
-    else if (x < -SDL_IPHONE_MAX_GFORCE) x = -SDL_IPHONE_MAX_GFORCE;
-    if (y > SDL_IPHONE_MAX_GFORCE) y = SDL_IPHONE_MAX_GFORCE;
-    else if (y < -SDL_IPHONE_MAX_GFORCE) y = -SDL_IPHONE_MAX_GFORCE;
-    if (z > SDL_IPHONE_MAX_GFORCE) z = SDL_IPHONE_MAX_GFORCE;
-    else if (z < -SDL_IPHONE_MAX_GFORCE) z = -SDL_IPHONE_MAX_GFORCE;
-
-    /* pass in data mapped to range of SInt16 */
-    data[0] = (x / SDL_IPHONE_MAX_GFORCE) * MAX_SINT16;
-    data[1] = (y / SDL_IPHONE_MAX_GFORCE) * MAX_SINT16;
-    data[2] = (z / SDL_IPHONE_MAX_GFORCE) * MAX_SINT16;
-
-}
-
-/*
-    Initialize SDLUIAccelerationDelegate.  Since we don't have any data yet,
-    just set our last received data to zero, and indicate we don't have any;
-*/
--(id)init {
-    self = [super init];
-    x = y = z = 0.0;
-    hasNewData = NO;
-    return self;
-}
-
--(void)dealloc {
-    sharedDelegate = nil;
-    [self shutdown];
-    [super dealloc];
-}
-
-/*
-    Lets our delegate start receiving accelerometer updates.
-*/
--(void)startup {
-    [UIAccelerometer sharedAccelerometer].delegate = self;
-    isRunning = YES;
-}
-/*
-    Stops our delegate from receiving accelerometer updates.
-*/
--(void)shutdown {
-    if ([UIAccelerometer sharedAccelerometer].delegate == self) {
-        [UIAccelerometer sharedAccelerometer].delegate = nil;
-    }
-    isRunning = NO;
-}
-/*
-    Our we currently receiving accelerometer updates?
-*/
--(BOOL)isRunning {
-    return isRunning;
-}
-/*
-    Do we have any data that hasn't been pumped into SDL's event system?
-*/
--(BOOL)hasNewData {
-    return hasNewData;
-}
-/*
-    When the joystick system grabs the new data, it sets this to NO.
-*/
--(void)setHasNewData:(BOOL)value {
-    hasNewData = value;
-}
-
- at end
diff --git a/deps/SDL2/src/joystick/iphoneos/SDL_sysjoystick.m b/deps/SDL2/src/joystick/iphoneos/SDL_sysjoystick.m
deleted file mode 100644
index 6082389..0000000
--- a/deps/SDL2/src/joystick/iphoneos/SDL_sysjoystick.m
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This is the system specific header for the SDL joystick API */
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-#import "SDLUIAccelerationDelegate.h"
-
-const char *accelerometerName = "iPhone accelerometer";
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int
-SDL_SYS_JoystickInit(void)
-{
-    return (1);
-}
-
-int SDL_SYS_NumJoysticks()
-{
-    return 1;
-}
-
-void SDL_SYS_JoystickDetect()
-{
-}
-
-SDL_bool SDL_SYS_JoystickNeedsPolling()
-{
-    return SDL_FALSE;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *
-SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
-    return accelerometerName;
-}
-
-/* Function to perform the mapping from device index to the instance id for this index */
-SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
-    return device_index;
-}
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
-{
-    joystick->naxes = 3;
-    joystick->nhats = 0;
-    joystick->nballs = 0;
-    joystick->nbuttons = 0;
-    [[SDLUIAccelerationDelegate sharedDelegate] startup];
-    return 0;
-}
-
-/* Function to determine is this joystick is attached to the system right now */
-SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
-{
-    return SDL_TRUE;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-{
-
-    Sint16 orientation[3];
-
-    if ([[SDLUIAccelerationDelegate sharedDelegate] hasNewData]) {
-
-        [[SDLUIAccelerationDelegate sharedDelegate] getLastOrientation: orientation];
-        [[SDLUIAccelerationDelegate sharedDelegate] setHasNewData: NO];
-
-        SDL_PrivateJoystickAxis(joystick, 0, orientation[0]);
-        SDL_PrivateJoystickAxis(joystick, 1, -orientation[1]);
-        SDL_PrivateJoystickAxis(joystick, 2, orientation[2]);
-
-    }
-
-    return;
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-{
-    if ([[SDLUIAccelerationDelegate sharedDelegate] isRunning]) {
-        [[SDLUIAccelerationDelegate sharedDelegate] shutdown];
-    }
-    SDL_SetError("No joystick open with that index");
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void
-SDL_SYS_JoystickQuit(void)
-{
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = joystick->name;
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/linux/SDL_sysjoystick.c b/deps/SDL2/src/joystick/linux/SDL_sysjoystick.c
deleted file mode 100644
index 72fa52c..0000000
--- a/deps/SDL2/src/joystick/linux/SDL_sysjoystick.c
+++ /dev/null
@@ -1,876 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_LINUX
-
-#ifndef SDL_INPUT_LINUXEV
-#error SDL now requires a Linux 2.4+ kernel with /dev/input/event support.
-#endif
-
-/* This is the system specific header for the SDL joystick API */
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <limits.h>             /* For the definition of PATH_MAX */
-#include <linux/joystick.h>
-
-#include "SDL_assert.h"
-#include "SDL_joystick.h"
-#include "SDL_endian.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-#include "SDL_sysjoystick_c.h"
-
-/* !!! FIXME: move this somewhere else. */
-#if !SDL_EVENTS_DISABLED
-#include "../../events/SDL_events_c.h"
-#endif
-
-/* This isn't defined in older Linux kernel headers */
-#ifndef SYN_DROPPED
-#define SYN_DROPPED 3
-#endif
-
-#include "../../core/linux/SDL_udev.h"
-
-static int MaybeAddDevice(const char *path);
-#if SDL_USE_LIBUDEV
-static int MaybeRemoveDevice(const char *path);
-void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath);
-#endif /* SDL_USE_LIBUDEV */
-
-
-/* A linked list of available joysticks */
-typedef struct SDL_joylist_item
-{
-    int device_instance;
-    char *path;   /* "/dev/input/event2" or whatever */
-    char *name;   /* "SideWinder 3D Pro" or whatever */
-    SDL_JoystickGUID guid;
-    dev_t devnum;
-    struct joystick_hwdata *hwdata;
-    struct SDL_joylist_item *next;
-} SDL_joylist_item;
-
-static SDL_joylist_item *SDL_joylist = NULL;
-static SDL_joylist_item *SDL_joylist_tail = NULL;
-static int numjoysticks = 0;
-static int instance_counter = 0;
-
-#define test_bit(nr, addr) \
-    (((1UL << ((nr) % (sizeof(long) * 8))) & ((addr)[(nr) / (sizeof(long) * 8)])) != 0)
-#define NBITS(x) ((((x)-1)/(sizeof(long) * 8))+1)
-
-static int
-IsJoystick(int fd, char *namebuf, const size_t namebuflen, SDL_JoystickGUID *guid)
-{
-    unsigned long evbit[NBITS(EV_MAX)] = { 0 };
-    unsigned long keybit[NBITS(KEY_MAX)] = { 0 };
-    unsigned long absbit[NBITS(ABS_MAX)] = { 0 };
-    struct input_id inpid;
-    Uint16 *guid16 = (Uint16 *) ((char *) &guid->data);
-
-    if ((ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) ||
-        (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) ||
-        (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) {
-        return (0);
-    }
-
-    if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) &&
-          test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit))) {
-        return 0;
-    }
-
-    if (ioctl(fd, EVIOCGNAME(namebuflen), namebuf) < 0) {
-        return 0;
-    }
-
-    if (ioctl(fd, EVIOCGID, &inpid) < 0) {
-        return 0;
-    }
-
-#ifdef DEBUG_JOYSTICK
-    printf("Joystick: %s, bustype = %d, vendor = 0x%x, product = 0x%x, version = %d\n", namebuf, inpid.bustype, inpid.vendor, inpid.product, inpid.version);
-#endif
-
-    SDL_memset(guid->data, 0, sizeof(guid->data));
-
-    /* We only need 16 bits for each of these; space them out to fill 128. */
-    /* Byteswap so devices get same GUID on little/big endian platforms. */
-    *(guid16++) = SDL_SwapLE16(inpid.bustype);
-    *(guid16++) = 0;
-
-    if (inpid.vendor && inpid.product && inpid.version) {
-        *(guid16++) = SDL_SwapLE16(inpid.vendor);
-        *(guid16++) = 0;
-        *(guid16++) = SDL_SwapLE16(inpid.product);
-        *(guid16++) = 0;
-        *(guid16++) = SDL_SwapLE16(inpid.version);
-        *(guid16++) = 0;
-    } else {
-        SDL_strlcpy((char*)guid16, namebuf, sizeof(guid->data) - 4);
-    }
-
-    return 1;
-}
-
-#if SDL_USE_LIBUDEV
-void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath)
-{
-    if (devpath == NULL || !(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) {
-        return;
-    }
-    
-    switch( udev_type )
-    {
-        case SDL_UDEV_DEVICEADDED:
-            MaybeAddDevice(devpath);
-            break;
-            
-        case SDL_UDEV_DEVICEREMOVED:
-            MaybeRemoveDevice(devpath);
-            break;
-            
-        default:
-            break;
-    }
-    
-}
-#endif /* SDL_USE_LIBUDEV */
-
-
-/* !!! FIXME: I would love to dump this code and use libudev instead. */
-static int
-MaybeAddDevice(const char *path)
-{
-    struct stat sb;
-    int fd = -1;
-    int isstick = 0;
-    char namebuf[128];
-    SDL_JoystickGUID guid;
-    SDL_joylist_item *item;
-#if !SDL_EVENTS_DISABLED
-    SDL_Event event;
-#endif
-
-    if (path == NULL) {
-        return -1;
-    }
-
-    if (stat(path, &sb) == -1) {
-        return -1;
-    }
-
-    /* Check to make sure it's not already in list. */
-    for (item = SDL_joylist; item != NULL; item = item->next) {
-        if (sb.st_rdev == item->devnum) {
-            return -1;  /* already have this one */
-        }
-    }
-
-    fd = open(path, O_RDONLY, 0);
-    if (fd < 0) {
-        return -1;
-    }
-
-#ifdef DEBUG_INPUT_EVENTS
-    printf("Checking %s\n", path);
-#endif
-
-    isstick = IsJoystick(fd, namebuf, sizeof (namebuf), &guid);
-    close(fd);
-    if (!isstick) {
-        return -1;
-    }
-
-    item = (SDL_joylist_item *) SDL_malloc(sizeof (SDL_joylist_item));
-    if (item == NULL) {
-        return -1;
-    }
-
-    SDL_zerop(item);
-    item->devnum = sb.st_rdev;
-    item->path = SDL_strdup(path);
-    item->name = SDL_strdup(namebuf);
-    item->guid = guid;
-
-    if ( (item->path == NULL) || (item->name == NULL) ) {
-         SDL_free(item->path);
-         SDL_free(item->name);
-         SDL_free(item);
-         return -1;
-    }
-
-    item->device_instance = instance_counter++;
-    if (SDL_joylist_tail == NULL) {
-        SDL_joylist = SDL_joylist_tail = item;
-    } else {
-        SDL_joylist_tail->next = item;
-        SDL_joylist_tail = item;
-    }
-
-    /* !!! FIXME: Move this to an SDL_PrivateJoyDeviceAdded() function? */
-#if !SDL_EVENTS_DISABLED
-    event.type = SDL_JOYDEVICEADDED;
-
-    if (SDL_GetEventState(event.type) == SDL_ENABLE) {
-        event.jdevice.which = numjoysticks;
-        if ( (SDL_EventOK == NULL) ||
-             (*SDL_EventOK) (SDL_EventOKParam, &event) ) {
-            SDL_PushEvent(&event);
-        }
-    }
-#endif /* !SDL_EVENTS_DISABLED */
-
-    return numjoysticks++;
-}
-
-#if SDL_USE_LIBUDEV
-/* !!! FIXME: I would love to dump this code and use libudev instead. */
-static int
-MaybeRemoveDevice(const char *path)
-{
-    SDL_joylist_item *item;
-    SDL_joylist_item *prev = NULL;
-#if !SDL_EVENTS_DISABLED
-    SDL_Event event;
-#endif
-
-    if (path == NULL) {
-        return -1;
-    }
-
-    for (item = SDL_joylist; item != NULL; item = item->next) {
-        /* found it, remove it. */
-        if (SDL_strcmp(path, item->path) == 0) {
-            const int retval = item->device_instance;
-            if (item->hwdata) {
-                item->hwdata->item = NULL;
-            }
-            if (prev != NULL) {
-                prev->next = item->next;
-            } else {
-                SDL_assert(SDL_joylist == item);
-                SDL_joylist = item->next;
-            }
-            if (item == SDL_joylist_tail) {
-                SDL_joylist_tail = prev;
-            }
-
-            /* !!! FIXME: Move this to an SDL_PrivateJoyDeviceRemoved() function? */
-#if !SDL_EVENTS_DISABLED
-            event.type = SDL_JOYDEVICEREMOVED;
-
-            if (SDL_GetEventState(event.type) == SDL_ENABLE) {
-                event.jdevice.which = item->device_instance;
-                if ( (SDL_EventOK == NULL) ||
-                     (*SDL_EventOK) (SDL_EventOKParam, &event) ) {
-                    SDL_PushEvent(&event);
-                }
-            }
-#endif /* !SDL_EVENTS_DISABLED */
-
-            SDL_free(item->path);
-            SDL_free(item->name);
-            SDL_free(item);
-            numjoysticks--;
-            return retval;
-        }
-        prev = item;
-    }
-
-    return -1;
-}
-#endif
-
-static int
-JoystickInitWithoutUdev(void)
-{
-    int i;
-    char path[PATH_MAX];
-
-    /* !!! FIXME: only finds sticks if they're called /dev/input/event[0..31] */
-    /* !!! FIXME:  we could at least readdir() through /dev/input...? */
-    /* !!! FIXME:  (or delete this and rely on libudev?) */
-    for (i = 0; i < 32; i++) {
-        SDL_snprintf(path, SDL_arraysize(path), "/dev/input/event%d", i);
-        MaybeAddDevice(path);
-    }
-
-    return numjoysticks;
-}
-
-
-#if SDL_USE_LIBUDEV
-static int
-JoystickInitWithUdev(void)
-{
-
-    if (SDL_UDEV_Init() < 0) {
-        return SDL_SetError("Could not initialize UDEV");
-    }
-
-    /* Set up the udev callback */
-    if ( SDL_UDEV_AddCallback(joystick_udev_callback) < 0) {
-        SDL_UDEV_Quit();
-        return SDL_SetError("Could not set up joystick <-> udev callback");
-    }
-    
-    /* Force a scan to build the initial device list */
-    SDL_UDEV_Scan();
-
-    return numjoysticks;
-}
-#endif
-
-int
-SDL_SYS_JoystickInit(void)
-{
-    /* First see if the user specified one or more joysticks to use */
-    if (SDL_getenv("SDL_JOYSTICK_DEVICE") != NULL) {
-        char *envcopy, *envpath, *delim;
-        envcopy = SDL_strdup(SDL_getenv("SDL_JOYSTICK_DEVICE"));
-        envpath = envcopy;
-        while (envpath != NULL) {
-            delim = SDL_strchr(envpath, ':');
-            if (delim != NULL) {
-                *delim++ = '\0';
-            }
-            MaybeAddDevice(envpath);
-            envpath = delim;
-        }
-        SDL_free(envcopy);
-    }
-
-#if SDL_USE_LIBUDEV
-    return JoystickInitWithUdev();
-#endif
-
-    return JoystickInitWithoutUdev();
-}
-
-int SDL_SYS_NumJoysticks()
-{
-    return numjoysticks;
-}
-
-void SDL_SYS_JoystickDetect()
-{
-#if SDL_USE_LIBUDEV
-    SDL_UDEV_Poll();
-#endif
-    
-}
-
-SDL_bool SDL_SYS_JoystickNeedsPolling()
-{
-#if SDL_USE_LIBUDEV
-    return SDL_TRUE;
-#endif
-    
-    return SDL_FALSE;
-}
-
-static SDL_joylist_item *
-JoystickByDevIndex(int device_index)
-{
-    SDL_joylist_item *item = SDL_joylist;
-
-    if ((device_index < 0) || (device_index >= numjoysticks)) {
-        return NULL;
-    }
-
-    while (device_index > 0) {
-        SDL_assert(item != NULL);
-        device_index--;
-        item = item->next;
-    }
-
-    return item;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *
-SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
-    return JoystickByDevIndex(device_index)->name;
-}
-
-/* Function to perform the mapping from device index to the instance id for this index */
-SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
-    return JoystickByDevIndex(device_index)->device_instance;
-}
-
-static int
-allocate_hatdata(SDL_Joystick * joystick)
-{
-    int i;
-
-    joystick->hwdata->hats =
-        (struct hwdata_hat *) SDL_malloc(joystick->nhats *
-                                         sizeof(struct hwdata_hat));
-    if (joystick->hwdata->hats == NULL) {
-        return (-1);
-    }
-    for (i = 0; i < joystick->nhats; ++i) {
-        joystick->hwdata->hats[i].axis[0] = 1;
-        joystick->hwdata->hats[i].axis[1] = 1;
-    }
-    return (0);
-}
-
-static int
-allocate_balldata(SDL_Joystick * joystick)
-{
-    int i;
-
-    joystick->hwdata->balls =
-        (struct hwdata_ball *) SDL_malloc(joystick->nballs *
-                                          sizeof(struct hwdata_ball));
-    if (joystick->hwdata->balls == NULL) {
-        return (-1);
-    }
-    for (i = 0; i < joystick->nballs; ++i) {
-        joystick->hwdata->balls[i].axis[0] = 0;
-        joystick->hwdata->balls[i].axis[1] = 0;
-    }
-    return (0);
-}
-
-static void
-ConfigJoystick(SDL_Joystick * joystick, int fd)
-{
-    int i, t;
-    unsigned long keybit[NBITS(KEY_MAX)] = { 0 };
-    unsigned long absbit[NBITS(ABS_MAX)] = { 0 };
-    unsigned long relbit[NBITS(REL_MAX)] = { 0 };
-
-    /* See if this device uses the new unified event API */
-    if ((ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) >= 0) &&
-        (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0) &&
-        (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(relbit)), relbit) >= 0)) {
-
-        /* Get the number of buttons, axes, and other thingamajigs */
-        for (i = BTN_JOYSTICK; i < KEY_MAX; ++i) {
-            if (test_bit(i, keybit)) {
-#ifdef DEBUG_INPUT_EVENTS
-                printf("Joystick has button: 0x%x\n", i);
-#endif
-                joystick->hwdata->key_map[i - BTN_MISC] = joystick->nbuttons;
-                ++joystick->nbuttons;
-            }
-        }
-        for (i = BTN_MISC; i < BTN_JOYSTICK; ++i) {
-            if (test_bit(i, keybit)) {
-#ifdef DEBUG_INPUT_EVENTS
-                printf("Joystick has button: 0x%x\n", i);
-#endif
-                joystick->hwdata->key_map[i - BTN_MISC] = joystick->nbuttons;
-                ++joystick->nbuttons;
-            }
-        }
-        for (i = 0; i < ABS_MISC; ++i) {
-            /* Skip hats */
-            if (i == ABS_HAT0X) {
-                i = ABS_HAT3Y;
-                continue;
-            }
-            if (test_bit(i, absbit)) {
-                struct input_absinfo absinfo;
-
-                if (ioctl(fd, EVIOCGABS(i), &absinfo) < 0)
-                    continue;
-#ifdef DEBUG_INPUT_EVENTS
-                printf("Joystick has absolute axis: %x\n", i);
-                printf("Values = { %d, %d, %d, %d, %d }\n",
-                       absinfo.value, absinfo.minimum, absinfo.maximum,
-                       absinfo.fuzz, absinfo.flat);
-#endif /* DEBUG_INPUT_EVENTS */
-                joystick->hwdata->abs_map[i] = joystick->naxes;
-                if (absinfo.minimum == absinfo.maximum) {
-                    joystick->hwdata->abs_correct[i].used = 0;
-                } else {
-                    joystick->hwdata->abs_correct[i].used = 1;
-                    joystick->hwdata->abs_correct[i].coef[0] =
-                        (absinfo.maximum + absinfo.minimum) - 2 * absinfo.flat;
-                    joystick->hwdata->abs_correct[i].coef[1] =
-                        (absinfo.maximum + absinfo.minimum) + 2 * absinfo.flat;
-                    t = ((absinfo.maximum - absinfo.minimum) - 4 * absinfo.flat);
-                    if (t != 0) {
-                        joystick->hwdata->abs_correct[i].coef[2] =
-                            (1 << 28) / t;
-                    } else {
-                        joystick->hwdata->abs_correct[i].coef[2] = 0;
-                    }
-                }
-                ++joystick->naxes;
-            }
-        }
-        for (i = ABS_HAT0X; i <= ABS_HAT3Y; i += 2) {
-            if (test_bit(i, absbit) || test_bit(i + 1, absbit)) {
-#ifdef DEBUG_INPUT_EVENTS
-                printf("Joystick has hat %d\n", (i - ABS_HAT0X) / 2);
-#endif
-                ++joystick->nhats;
-            }
-        }
-        if (test_bit(REL_X, relbit) || test_bit(REL_Y, relbit)) {
-            ++joystick->nballs;
-        }
-
-        /* Allocate data to keep track of these thingamajigs */
-        if (joystick->nhats > 0) {
-            if (allocate_hatdata(joystick) < 0) {
-                joystick->nhats = 0;
-            }
-        }
-        if (joystick->nballs > 0) {
-            if (allocate_balldata(joystick) < 0) {
-                joystick->nballs = 0;
-            }
-        }
-    }
-}
-
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
-{
-    SDL_joylist_item *item = JoystickByDevIndex(device_index);
-    char *fname = NULL;
-    int fd = -1;
-
-    if (item == NULL) {
-        return SDL_SetError("No such device");
-    }
-
-    fname = item->path;
-    fd = open(fname, O_RDONLY, 0);
-    if (fd < 0) {
-        return SDL_SetError("Unable to open %s", fname);
-    }
-
-    joystick->instance_id = item->device_instance;
-    joystick->hwdata = (struct joystick_hwdata *)
-        SDL_malloc(sizeof(*joystick->hwdata));
-    if (joystick->hwdata == NULL) {
-        close(fd);
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
-    joystick->hwdata->item = item;
-    joystick->hwdata->guid = item->guid;
-    joystick->hwdata->fd = fd;
-    joystick->hwdata->fname = SDL_strdup(item->path);
-    if (joystick->hwdata->fname == NULL) {
-        SDL_free(joystick->hwdata);
-        joystick->hwdata = NULL;
-        close(fd);
-        return SDL_OutOfMemory();
-    }
-
-    SDL_assert(item->hwdata == NULL);
-    item->hwdata = joystick->hwdata;
-
-    /* Set the joystick to non-blocking read mode */
-    fcntl(fd, F_SETFL, O_NONBLOCK);
-
-    /* Get the number of buttons and axes on the joystick */
-    ConfigJoystick(joystick, fd);
-
-    /* mark joystick as fresh and ready */
-    joystick->hwdata->fresh = 1;
-
-    return (0);
-}
-
-/* Function to determine is this joystick is attached to the system right now */
-SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
-{
-    return !joystick->closed && (joystick->hwdata->item != NULL);
-}
-
-static SDL_INLINE void
-HandleHat(SDL_Joystick * stick, Uint8 hat, int axis, int value)
-{
-    struct hwdata_hat *the_hat;
-    const Uint8 position_map[3][3] = {
-        {SDL_HAT_LEFTUP, SDL_HAT_UP, SDL_HAT_RIGHTUP},
-        {SDL_HAT_LEFT, SDL_HAT_CENTERED, SDL_HAT_RIGHT},
-        {SDL_HAT_LEFTDOWN, SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN}
-    };
-
-    the_hat = &stick->hwdata->hats[hat];
-    if (value < 0) {
-        value = 0;
-    } else if (value == 0) {
-        value = 1;
-    } else if (value > 0) {
-        value = 2;
-    }
-    if (value != the_hat->axis[axis]) {
-        the_hat->axis[axis] = value;
-        SDL_PrivateJoystickHat(stick, hat,
-                               position_map[the_hat->
-                                            axis[1]][the_hat->axis[0]]);
-    }
-}
-
-static SDL_INLINE void
-HandleBall(SDL_Joystick * stick, Uint8 ball, int axis, int value)
-{
-    stick->hwdata->balls[ball].axis[axis] += value;
-}
-
-
-static SDL_INLINE int
-AxisCorrect(SDL_Joystick * joystick, int which, int value)
-{
-    struct axis_correct *correct;
-
-    correct = &joystick->hwdata->abs_correct[which];
-    if (correct->used) {
-        value *= 2;
-        if (value > correct->coef[0]) {
-            if (value < correct->coef[1]) {
-                return 0;
-            }
-            value -= correct->coef[1];
-        } else {
-            value -= correct->coef[0];
-        }
-        value *= correct->coef[2];
-        value >>= 13;
-    }
-
-    /* Clamp and return */
-    if (value < -32768)
-        return -32768;
-    if (value > 32767)
-        return 32767;
-
-    return value;
-}
-
-static SDL_INLINE void
-PollAllValues(SDL_Joystick * joystick)
-{
-    struct input_absinfo absinfo;
-    int a, b = 0;
-
-    /* Poll all axis */
-    for (a = ABS_X; b < ABS_MAX; a++) {
-        switch (a) {
-        case ABS_HAT0X:
-        case ABS_HAT0Y:
-        case ABS_HAT1X:
-        case ABS_HAT1Y:
-        case ABS_HAT2X:
-        case ABS_HAT2Y:
-        case ABS_HAT3X:
-        case ABS_HAT3Y:
-            /* ingore hats */
-            break;
-        default:
-            if (joystick->hwdata->abs_correct[b].used) {
-                if (ioctl(joystick->hwdata->fd, EVIOCGABS(a), &absinfo) >= 0) {
-                    absinfo.value = AxisCorrect(joystick, b, absinfo.value);
-
-#ifdef DEBUG_INPUT_EVENTS
-                    printf("Joystick : Re-read Axis %d (%d) val= %d\n",
-                        joystick->hwdata->abs_map[b], a, absinfo.value);
-#endif
-                    SDL_PrivateJoystickAxis(joystick,
-                            joystick->hwdata->abs_map[b],
-                            absinfo.value);
-                }
-            }
-            b++;
-        }
-    }
-}
-
-static SDL_INLINE void
-HandleInputEvents(SDL_Joystick * joystick)
-{
-    struct input_event events[32];
-    int i, len;
-    int code;
-
-    if (joystick->hwdata->fresh) {
-        PollAllValues(joystick);
-        joystick->hwdata->fresh = 0;
-    }
-
-    while ((len = read(joystick->hwdata->fd, events, (sizeof events))) > 0) {
-        len /= sizeof(events[0]);
-        for (i = 0; i < len; ++i) {
-            code = events[i].code;
-            switch (events[i].type) {
-            case EV_KEY:
-                if (code >= BTN_MISC) {
-                    code -= BTN_MISC;
-                    SDL_PrivateJoystickButton(joystick,
-                                              joystick->hwdata->key_map[code],
-                                              events[i].value);
-                }
-                break;
-            case EV_ABS:
-                if (code >= ABS_MISC) {
-                    break;
-                }
-
-                switch (code) {
-                case ABS_HAT0X:
-                case ABS_HAT0Y:
-                case ABS_HAT1X:
-                case ABS_HAT1Y:
-                case ABS_HAT2X:
-                case ABS_HAT2Y:
-                case ABS_HAT3X:
-                case ABS_HAT3Y:
-                    code -= ABS_HAT0X;
-                    HandleHat(joystick, code / 2, code % 2, events[i].value);
-                    break;
-                default:
-                    events[i].value =
-                        AxisCorrect(joystick, code, events[i].value);
-                    SDL_PrivateJoystickAxis(joystick,
-                                            joystick->hwdata->abs_map[code],
-                                            events[i].value);
-                    break;
-                }
-                break;
-            case EV_REL:
-                switch (code) {
-                case REL_X:
-                case REL_Y:
-                    code -= REL_X;
-                    HandleBall(joystick, code / 2, code % 2, events[i].value);
-                    break;
-                default:
-                    break;
-                }
-                break;
-            case EV_SYN:
-                switch (code) {
-                case SYN_DROPPED :
-#ifdef DEBUG_INPUT_EVENTS
-                    printf("Event SYN_DROPPED detected\n");
-#endif
-                    PollAllValues(joystick);
-                    break;
-                default:
-                    break;
-                }
-            default:
-                break;
-            }
-        }
-    }
-}
-
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-{
-    int i;
-
-    HandleInputEvents(joystick);
-
-    /* Deliver ball motion updates */
-    for (i = 0; i < joystick->nballs; ++i) {
-        int xrel, yrel;
-
-        xrel = joystick->hwdata->balls[i].axis[0];
-        yrel = joystick->hwdata->balls[i].axis[1];
-        if (xrel || yrel) {
-            joystick->hwdata->balls[i].axis[0] = 0;
-            joystick->hwdata->balls[i].axis[1] = 0;
-            SDL_PrivateJoystickBall(joystick, (Uint8) i, xrel, yrel);
-        }
-    }
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-{
-    if (joystick->hwdata) {
-        close(joystick->hwdata->fd);
-        if (joystick->hwdata->item) {
-            joystick->hwdata->item->hwdata = NULL;
-        }
-        SDL_free(joystick->hwdata->hats);
-        SDL_free(joystick->hwdata->balls);
-        SDL_free(joystick->hwdata->fname);
-        SDL_free(joystick->hwdata);
-        joystick->hwdata = NULL;
-    }
-    joystick->closed = 1;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void
-SDL_SYS_JoystickQuit(void)
-{
-    SDL_joylist_item *item = NULL;
-    SDL_joylist_item *next = NULL;
-
-    for (item = SDL_joylist; item; item = next) {
-        next = item->next;
-        SDL_free(item->path);
-        SDL_free(item->name);
-        SDL_free(item);
-    }
-
-    SDL_joylist = SDL_joylist_tail = NULL;
-
-    numjoysticks = 0;
-    instance_counter = 0;
-
-#if SDL_USE_LIBUDEV
-    SDL_UDEV_DelCallback(joystick_udev_callback);
-    SDL_UDEV_Quit();
-#endif
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
-    return JoystickByDevIndex(device_index)->guid;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-{
-    return joystick->hwdata->guid;
-}
-
-#endif /* SDL_JOYSTICK_LINUX */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/linux/SDL_sysjoystick_c.h b/deps/SDL2/src/joystick/linux/SDL_sysjoystick_c.h
deleted file mode 100644
index 4e942b5..0000000
--- a/deps/SDL2/src/joystick/linux/SDL_sysjoystick_c.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include <linux/input.h>
-
-struct SDL_joylist_item;
-
-/* The private structure used to keep track of a joystick */
-struct joystick_hwdata
-{
-    int fd;
-    struct SDL_joylist_item *item;
-    SDL_JoystickGUID guid;
-    char *fname;                /* Used in haptic subsystem */
-
-    /* The current Linux joystick driver maps hats to two axes */
-    struct hwdata_hat
-    {
-        int axis[2];
-    } *hats;
-    /* The current Linux joystick driver maps balls to two axes */
-    struct hwdata_ball
-    {
-        int axis[2];
-    } *balls;
-
-    /* Support for the Linux 2.4 unified input interface */
-    Uint8 key_map[KEY_MAX - BTN_MISC];
-    Uint8 abs_map[ABS_MAX];
-    struct axis_correct
-    {
-        int used;
-        int coef[3];
-    } abs_correct[ABS_MAX];
-
-    int fresh;
-};
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/psp/SDL_sysjoystick.c b/deps/SDL2/src/joystick/psp/SDL_sysjoystick.c
deleted file mode 100644
index b953372..0000000
--- a/deps/SDL2/src/joystick/psp/SDL_sysjoystick.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* This is the system specific header for the SDL joystick API */
-#include <pspctrl.h>
-#include <pspkernel.h>
-
-#include <stdio.h>      /* For the definition of NULL */
-#include <stdlib.h>
-
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-#include "SDL_events.h"
-#include "SDL_error.h"
-#include "SDL_thread.h"
-#include "SDL_mutex.h"
-#include "SDL_timer.h"
-
-/* Current pad state */
-static SceCtrlData pad = { .Lx = 0, .Ly = 0, .Buttons = 0 };
-static SDL_sem *pad_sem = NULL;
-static SDL_Thread *thread = NULL;
-static int running = 0;
-static const enum PspCtrlButtons button_map[] = {
-    PSP_CTRL_TRIANGLE, PSP_CTRL_CIRCLE, PSP_CTRL_CROSS, PSP_CTRL_SQUARE,
-    PSP_CTRL_LTRIGGER, PSP_CTRL_RTRIGGER,
-    PSP_CTRL_DOWN, PSP_CTRL_LEFT, PSP_CTRL_UP, PSP_CTRL_RIGHT,
-    PSP_CTRL_SELECT, PSP_CTRL_START, PSP_CTRL_HOME, PSP_CTRL_HOLD };
-static int analog_map[256];  /* Map analog inputs to -32768 -> 32767 */
-
-typedef struct
-{
-  int x;
-  int y;
-} point;
-
-/* 4 points define the bezier-curve. */
-static point a = { 0, 0 };
-static point b = { 50, 0  };
-static point c = { 78, 32767 };
-static point d = { 128, 32767 };
-
-/* simple linear interpolation between two points */
-static SDL_INLINE void lerp (point *dest, point *a, point *b, float t)
-{
-    dest->x = a->x + (b->x - a->x)*t;
-    dest->y = a->y + (b->y - a->y)*t;
-}
-
-/* evaluate a point on a bezier-curve. t goes from 0 to 1.0 */
-static int calc_bezier_y(float t)
-{
-    point ab, bc, cd, abbc, bccd, dest;
-    lerp (&ab, &a, &b, t);           /* point between a and b */
-    lerp (&bc, &b, &c, t);           /* point between b and c */
-    lerp (&cd, &c, &d, t);           /* point between c and d */
-    lerp (&abbc, &ab, &bc, t);       /* point between ab and bc */
-    lerp (&bccd, &bc, &cd, t);       /* point between bc and cd */
-    lerp (&dest, &abbc, &bccd, t);   /* point on the bezier-curve */
-    return dest.y;
-}
-
-/*
- * Collect pad data about once per frame
- */
-int JoystickUpdate(void *data)
-{
-    while (running) {
-        SDL_SemWait(pad_sem);
-        sceCtrlPeekBufferPositive(&pad, 1);
-        SDL_SemPost(pad_sem);
-        /* Delay 1/60th of a second */
-        sceKernelDelayThread(1000000 / 60);
-    }
-    return 0;
-}
-
-
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
- * It should return number of joysticks, or -1 on an unrecoverable fatal error.
- */
-int SDL_SYS_JoystickInit(void)
-{
-    int i;
-
-/*  SDL_numjoysticks = 1; */
-
-    /* Setup input */
-    sceCtrlSetSamplingCycle(0);
-    sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
-
-    /* Start thread to read data */
-    if((pad_sem =  SDL_CreateSemaphore(1)) == NULL) {
-        return SDL_SetError("Can't create input semaphore");
-    }
-    running = 1;
-    if((thread = SDL_CreateThread(JoystickUpdate, "JoySitckThread",NULL)) == NULL) {
-        return SDL_SetError("Can't create input thread");
-    }
-
-    /* Create an accurate map from analog inputs (0 to 255)
-       to SDL joystick positions (-32768 to 32767) */
-    for (i = 0; i < 128; i++)
-    {
-        float t = (float)i/127.0f;
-        analog_map[i+128] = calc_bezier_y(t);
-        analog_map[127-i] = -1 * analog_map[i+128];
-    }
-
-    return 1;
-}
-
-int SDL_SYS_NumJoysticks()
-{
-    return 1;
-}
-
-void SDL_SYS_JoystickDetect()
-{
-}
-
-SDL_bool SDL_SYS_JoystickNeedsPolling()
-{
-    return SDL_FALSE;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char * SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
-    return "PSP builtin joypad";
-}
-
-/* Function to perform the mapping from device index to the instance id for this index */
-SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
-    return device_index;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
-    if (index == 0)
-        return "PSP controller";
-
-    SDL_SetError("No joystick available with that index");
-    return(NULL);
-}
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick, int device_index)
-{
-    joystick->nbuttons = 14;
-    joystick->naxes = 2;
-    joystick->nhats = 0;
-
-    return 0;
-}
-
-/* Function to determine is this joystick is attached to the system right now */
-SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
-{
-    return SDL_TRUE;
-}
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
-    int i;
-    enum PspCtrlButtons buttons;
-    enum PspCtrlButtons changed;
-    unsigned char x, y;
-    static enum PspCtrlButtons old_buttons = 0;
-    static unsigned char old_x = 0, old_y = 0;
-
-    SDL_SemWait(pad_sem);
-    buttons = pad.Buttons;
-    x = pad.Lx;
-    y = pad.Ly;
-    SDL_SemPost(pad_sem);
-
-    /* Axes */
-    if(old_x != x) {
-        SDL_PrivateJoystickAxis(joystick, 0, analog_map[x]);
-        old_x = x;
-    }
-    if(old_y != y) {
-        SDL_PrivateJoystickAxis(joystick, 1, analog_map[y]);
-        old_y = y;
-    }
-
-    /* Buttons */
-    changed = old_buttons ^ buttons;
-    old_buttons = buttons;
-    if(changed) {
-        for(i=0; i<sizeof(button_map)/sizeof(button_map[0]); i++) {
-            if(changed & button_map[i]) {
-                SDL_PrivateJoystickButton(
-                    joystick, i,
-                    (buttons & button_map[i]) ?
-                    SDL_PRESSED : SDL_RELEASED);
-            }
-        }
-    }
-
-    sceKernelDelayThread(0);
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
-    /* Do nothing. */
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void SDL_SYS_JoystickQuit(void)
-{
-    /* Cleanup Threads and Semaphore. */
-    running = 0;
-    SDL_WaitThread(thread, NULL);
-    SDL_DestroySemaphore(pad_sem);
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = joystick->name;
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-/* vim: ts=4 sw=4
- */
diff --git a/deps/SDL2/src/joystick/sort_controllers.py b/deps/SDL2/src/joystick/sort_controllers.py
deleted file mode 100755
index 344a423..0000000
--- a/deps/SDL2/src/joystick/sort_controllers.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-#
-# Script to sort the game controller database entries in SDL_gamecontroller.c
-
-import re
-
-
-filename = "SDL_gamecontrollerdb.h"
-input = open(filename)
-output = open(filename + ".new", "w")
-parsing_controllers = False
-controllers = []
-controller_guids = {}
-split_pattern = re.compile(r'([^"]*")([^,]*,)([^,]*,)([^"]*)(".*)')
-
-def save_controller(line):
-    global controllers
-    match = split_pattern.match(line)
-    entry = [ match.group(1), match.group(2), match.group(3) ]
-    bindings = sorted(match.group(4).split(","))
-    if (bindings[0] == ""):
-        bindings.pop(0)
-    entry.extend(",".join(bindings) + ",")
-    entry.append(match.group(5))
-    controllers.append(entry)
-
-def write_controllers():
-    global controllers
-    global controller_guids
-    for entry in sorted(controllers, key=lambda entry: entry[2]):
-        line = "".join(entry) + "\n"
-        if (entry[1] in controller_guids):
-            print "Warning: entry '%s' is duplicate of entry '%s'" % (entry[2], controller_guids[entry[1]][2])
-        controller_guids[entry[1]] = entry
-
-        output.write(line)
-    controllers = []
-    controller_guids = {}
-
-for line in input:
-    if ( parsing_controllers ):
-        if (line.startswith("{")):
-            output.write(line)
-        elif (line.startswith("#endif")):
-            parsing_controllers = False
-            write_controllers()
-            output.write(line)
-        elif (line.startswith("#")):
-            print "Parsing " + line.strip()
-            write_controllers()
-            output.write(line)
-        else:
-            save_controller(line)
-    else:
-        if (line.startswith("static const char *s_ControllerMappings")):
-            parsing_controllers = True
-
-        output.write(line)
-
-output.close()
-print "Finished writing %s.new" % filename
diff --git a/deps/SDL2/src/joystick/windows/SDL_dxjoystick.c b/deps/SDL2/src/joystick/windows/SDL_dxjoystick.c
deleted file mode 100644
index d8149a3..0000000
--- a/deps/SDL2/src/joystick/windows/SDL_dxjoystick.c
+++ /dev/null
@@ -1,1651 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_DINPUT
-
-/* DirectInput joystick driver; written by Glenn Maynard, based on Andrei de
- * A. Formiga's WINMM driver.
- *
- * Hats and sliders are completely untested; the app I'm writing this for mostly
- * doesn't use them and I don't own any joysticks with them.
- *
- * We don't bother to use event notification here.  It doesn't seem to work
- * with polled devices, and it's fine to call IDirectInputDevice8_GetDeviceData and
- * let it return 0 events. */
-
-#include "SDL_error.h"
-#include "SDL_assert.h"
-#include "SDL_events.h"
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "SDL_mutex.h"
-#include "SDL_events.h"
-#include "SDL_hints.h"
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#if !SDL_EVENTS_DISABLED
-#include "../../events/SDL_events_c.h"
-#endif
-
-#define INITGUID /* Only set here, if set twice will cause mingw32 to break. */
-#include "SDL_dxjoystick_c.h"
-
-#ifndef DIDFT_OPTIONAL
-#define DIDFT_OPTIONAL      0x80000000
-#endif
-
-DEFINE_GUID(GUID_DEVINTERFACE_HID, 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30);
-
-
-#define INPUT_QSIZE 32      /* Buffer up to 32 input messages */
-#define AXIS_MIN    -32768  /* minimum value for axis coordinate */
-#define AXIS_MAX    32767   /* maximum value for axis coordinate */
-#define JOY_AXIS_THRESHOLD  (((AXIS_MAX)-(AXIS_MIN))/100)   /* 1% motion */
-
-/* external variables referenced. */
-extern HWND SDL_HelperWindow;
-
-
-/* local variables */
-static SDL_bool coinitialized = SDL_FALSE;
-static LPDIRECTINPUT8 dinput = NULL;
-static SDL_bool s_bDeviceAdded = SDL_FALSE;
-static SDL_bool s_bDeviceRemoved = SDL_FALSE;
-static SDL_JoystickID s_nInstanceID = -1;
-static SDL_cond *s_condJoystickThread = NULL;
-static SDL_mutex *s_mutexJoyStickEnum = NULL;
-static SDL_Thread *s_threadJoystick = NULL;
-static SDL_bool s_bJoystickThreadQuit = SDL_FALSE;
-static SDL_bool s_bXInputEnabled = SDL_TRUE;
-
-XInputGetState_t SDL_XInputGetState = NULL;
-XInputSetState_t SDL_XInputSetState = NULL;
-XInputGetCapabilities_t SDL_XInputGetCapabilities = NULL;
-DWORD SDL_XInputVersion = 0;
-
-static HANDLE s_pXInputDLL = 0;
-static int s_XInputDLLRefCount = 0;
-
-int
-WIN_LoadXInputDLL(void)
-{
-    DWORD version = 0;
-
-    if (s_pXInputDLL) {
-        SDL_assert(s_XInputDLLRefCount > 0);
-        s_XInputDLLRefCount++;
-        return 0;  /* already loaded */
-    }
-
-    version = (1 << 16) | 4;
-    s_pXInputDLL = LoadLibrary( L"XInput1_4.dll" );  /* 1.4 Ships with Windows 8. */
-    if (!s_pXInputDLL) {
-        version = (1 << 16) | 3;
-        s_pXInputDLL = LoadLibrary( L"XInput1_3.dll" );  /* 1.3 Ships with Vista and Win7, can be installed as a redistributable component. */
-    }
-    if (!s_pXInputDLL) {
-        s_pXInputDLL = LoadLibrary( L"bin\\XInput1_3.dll" );
-    }
-    if (!s_pXInputDLL) {
-        return -1;
-    }
-
-    SDL_assert(s_XInputDLLRefCount == 0);
-    SDL_XInputVersion = version;
-    s_XInputDLLRefCount = 1;
-
-    /* 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think... */
-    SDL_XInputGetState = (XInputGetState_t)GetProcAddress( (HMODULE)s_pXInputDLL, (LPCSTR)100 );
-    SDL_XInputSetState = (XInputSetState_t)GetProcAddress( (HMODULE)s_pXInputDLL, "XInputSetState" );
-    SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress( (HMODULE)s_pXInputDLL, "XInputGetCapabilities" );
-    if ( !SDL_XInputGetState || !SDL_XInputSetState || !SDL_XInputGetCapabilities ) {
-        WIN_UnloadXInputDLL();
-        return -1;
-    }
-
-    return 0;
-}
-
-void
-WIN_UnloadXInputDLL(void)
-{
-    if ( s_pXInputDLL ) {
-        SDL_assert(s_XInputDLLRefCount > 0);
-        if (--s_XInputDLLRefCount == 0) {
-            FreeLibrary( s_pXInputDLL );
-            s_pXInputDLL = NULL;
-        }
-    } else {
-        SDL_assert(s_XInputDLLRefCount == 0);
-    }
-}
-
-
-extern HRESULT(WINAPI * DInputCreate) (HINSTANCE hinst, DWORD dwVersion,
-                                       LPDIRECTINPUT * ppDI,
-                                       LPUNKNOWN punkOuter);
-struct JoyStick_DeviceData_
-{
-    SDL_JoystickGUID guid;
-    DIDEVICEINSTANCE dxdevice;
-    char *joystickname;
-    Uint8 send_add_event;
-    SDL_JoystickID nInstanceID;
-    SDL_bool bXInputDevice;
-    Uint8 XInputUserId;
-    struct JoyStick_DeviceData_ *pNext;
-};
-
-typedef struct JoyStick_DeviceData_ JoyStick_DeviceData;
-
-static JoyStick_DeviceData *SYS_Joystick;    /* array to hold joystick ID values */
-
-/* local prototypes */
-static int SetDIerror(const char *function, HRESULT code);
-static BOOL CALLBACK EnumJoysticksCallback(const DIDEVICEINSTANCE *
-                                           pdidInstance, VOID * pContext);
-static BOOL CALLBACK EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE dev,
-                                            LPVOID pvRef);
-static void SortDevObjects(SDL_Joystick *joystick);
-static Uint8 TranslatePOV(DWORD value);
-static int SDL_PrivateJoystickAxis_Int(SDL_Joystick * joystick, Uint8 axis,
-                                       Sint16 value);
-static int SDL_PrivateJoystickHat_Int(SDL_Joystick * joystick, Uint8 hat,
-                                      Uint8 value);
-static int SDL_PrivateJoystickButton_Int(SDL_Joystick * joystick,
-                                         Uint8 button, Uint8 state);
-
-/* Taken from Wine - Thanks! */
-DIOBJECTDATAFORMAT dfDIJoystick2[] = {
-  { &GUID_XAxis,DIJOFS_X,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_YAxis,DIJOFS_Y,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_ZAxis,DIJOFS_Z,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RxAxis,DIJOFS_RX,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RyAxis,DIJOFS_RY,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RzAxis,DIJOFS_RZ,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_Slider,DIJOFS_SLIDER(0),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_Slider,DIJOFS_SLIDER(1),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_POV,DIJOFS_POV(0),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0},
-  { &GUID_POV,DIJOFS_POV(1),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0},
-  { &GUID_POV,DIJOFS_POV(2),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0},
-  { &GUID_POV,DIJOFS_POV(3),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(0),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(1),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(2),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(3),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(4),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(5),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(6),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(7),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(8),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(9),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(10),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(11),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(12),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(13),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(14),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(15),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(16),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(17),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(18),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(19),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(20),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(21),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(22),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(23),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(24),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(25),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(26),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(27),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(28),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(29),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(30),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(31),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(32),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(33),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(34),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(35),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(36),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(37),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(38),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(39),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(40),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(41),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(42),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(43),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(44),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(45),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(46),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(47),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(48),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(49),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(50),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(51),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(52),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(53),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(54),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(55),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(56),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(57),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(58),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(59),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(60),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(61),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(62),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(63),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(64),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(65),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(66),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(67),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(68),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(69),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(70),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(71),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(72),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(73),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(74),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(75),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(76),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(77),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(78),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(79),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(80),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(81),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(82),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(83),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(84),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(85),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(86),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(87),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(88),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(89),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(90),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(91),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(92),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(93),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(94),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(95),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(96),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(97),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(98),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(99),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(100),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(101),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(102),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(103),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(104),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(105),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(106),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(107),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(108),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(109),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(110),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(111),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(112),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(113),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(114),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(115),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(116),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(117),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(118),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(119),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(120),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(121),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(122),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(123),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(124),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(125),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(126),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { NULL,DIJOFS_BUTTON(127),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
-  { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lVX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lVY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lVZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lVRx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lVRy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lVRz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglVSlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglVSlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lAX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lAY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lAZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lARx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lARy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lARz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglASlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglASlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lFX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lFY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lFZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lFRx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lFRy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lFRz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglFSlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglFSlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
-};
-
-const DIDATAFORMAT c_dfDIJoystick2 = {
-    sizeof(DIDATAFORMAT),
-    sizeof(DIOBJECTDATAFORMAT),
-    DIDF_ABSAXIS,
-    sizeof(DIJOYSTATE2),
-    SDL_arraysize(dfDIJoystick2),
-    dfDIJoystick2
-};
-
-
-/* Convert a DirectInput return code to a text message */
-static int
-SetDIerror(const char *function, HRESULT code)
-{
-    /*
-    return SDL_SetError("%s() [%s]: %s", function,
-                 DXGetErrorString9A(code), DXGetErrorDescription9A(code));
-     */
-    return SDL_SetError("%s() DirectX error %d", function, code);
-}
-
-
-#define SAFE_RELEASE(p)                             \
-{                                                   \
-    if (p) {                                        \
-        (p)->lpVtbl->Release((p));                  \
-        (p) = 0;                                    \
-    }                                               \
-}
-
-DEFINE_GUID(IID_ValveStreamingGamepad,  MAKELONG( 0x28DE, 0x11FF ),0x0000,0x0000,0x00,0x00,0x50,0x49,0x44,0x56,0x49,0x44);
-DEFINE_GUID(IID_X360WiredGamepad,  MAKELONG( 0x045E, 0x02A1 ),0x0000,0x0000,0x00,0x00,0x50,0x49,0x44,0x56,0x49,0x44);
-DEFINE_GUID(IID_X360WirelessGamepad,  MAKELONG( 0x045E, 0x028E ),0x0000,0x0000,0x00,0x00,0x50,0x49,0x44,0x56,0x49,0x44);
-
-static PRAWINPUTDEVICELIST SDL_RawDevList = NULL;
-static UINT SDL_RawDevListCount = 0;
-
-static SDL_bool
-SDL_IsXInputDevice( const GUID* pGuidProductFromDirectInput )
-{
-    static const GUID *s_XInputProductGUID[] = {
-        &IID_ValveStreamingGamepad,
-        &IID_X360WiredGamepad,   /* Microsoft's wired X360 controller for Windows. */
-        &IID_X360WirelessGamepad /* Microsoft's wireless X360 controller for Windows. */
-    };
-
-    size_t iDevice;
-    UINT i;
-
-    if (!s_bXInputEnabled) {
-        return SDL_FALSE;
-    }
-
-    /* Check for well known XInput device GUIDs */
-    /* This lets us skip RAWINPUT for popular devices. Also, we need to do this for the Valve Streaming Gamepad because it's virtualized and doesn't show up in the device list. */
-    for ( iDevice = 0; iDevice < SDL_arraysize(s_XInputProductGUID); ++iDevice ) {
-        if (SDL_memcmp(pGuidProductFromDirectInput, s_XInputProductGUID[iDevice], sizeof(GUID)) == 0) {
-            return SDL_TRUE;
-        }
-    }
-
-    /* Go through RAWINPUT (WinXP and later) to find HID devices. */
-    /* Cache this if we end up using it. */
-    if (SDL_RawDevList == NULL) {
-        if ((GetRawInputDeviceList(NULL, &SDL_RawDevListCount, sizeof (RAWINPUTDEVICELIST)) == -1) || (!SDL_RawDevListCount)) {
-            return SDL_FALSE;  /* oh well. */
-        }
-
-        SDL_RawDevList = (PRAWINPUTDEVICELIST) SDL_malloc(sizeof (RAWINPUTDEVICELIST) * SDL_RawDevListCount);
-        if (SDL_RawDevList == NULL) {
-            SDL_OutOfMemory();
-            return SDL_FALSE;
-        }
-
-        if (GetRawInputDeviceList(SDL_RawDevList, &SDL_RawDevListCount, sizeof (RAWINPUTDEVICELIST)) == -1) {
-             SDL_free(SDL_RawDevList);
-             SDL_RawDevList = NULL;
-             return SDL_FALSE;  /* oh well. */
-        }
-    }
-
-    for (i = 0; i < SDL_RawDevListCount; i++) {
-        RID_DEVICE_INFO rdi;
-        char devName[128];
-        UINT rdiSize = sizeof (rdi);
-        UINT nameSize = SDL_arraysize(devName);
-
-        rdi.cbSize = sizeof (rdi);
-        if ( (SDL_RawDevList[i].dwType == RIM_TYPEHID) &&
-             (GetRawInputDeviceInfoA(SDL_RawDevList[i].hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) != ((UINT)-1)) &&
-             (MAKELONG(rdi.hid.dwVendorId, rdi.hid.dwProductId) == ((LONG)pGuidProductFromDirectInput->Data1)) &&
-             (GetRawInputDeviceInfoA(SDL_RawDevList[i].hDevice, RIDI_DEVICENAME, devName, &nameSize) != ((UINT)-1)) &&
-             (SDL_strstr(devName, "IG_") != NULL) ) {
-             return SDL_TRUE;
-        }
-    }
-
-    return SDL_FALSE;
-}
-
-
-static SDL_bool s_bWindowsDeviceChanged = SDL_FALSE;
-
-/* windowproc for our joystick detect thread message only window, to detect any USB device addition/removal
- */
-LRESULT CALLBACK SDL_PrivateJoystickDetectProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)    {
-    switch (message)    {
-    case WM_DEVICECHANGE:
-        switch (wParam) {
-        case DBT_DEVICEARRIVAL:
-            if (((DEV_BROADCAST_HDR*)lParam)->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)    {
-                s_bWindowsDeviceChanged = SDL_TRUE;
-            }
-            break;
-        case DBT_DEVICEREMOVECOMPLETE:
-            if (((DEV_BROADCAST_HDR*)lParam)->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)    {
-                s_bWindowsDeviceChanged = SDL_TRUE;
-            }
-            break;
-        }
-        return 0;
-    }
-
-    return DefWindowProc (hwnd, message, wParam, lParam);
-}
-
-
-DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, \
-    0xC0, 0x4F, 0xB9, 0x51, 0xED);
-
-/* Function/thread to scan the system for joysticks.
- */
-static int
-SDL_JoystickThread(void *_data)
-{
-    HWND messageWindow = 0;
-    HDEVNOTIFY hNotify = 0;
-    DEV_BROADCAST_DEVICEINTERFACE dbh;
-    SDL_bool bOpenedXInputDevices[SDL_XINPUT_MAX_DEVICES];
-    WNDCLASSEX wincl;
-
-    SDL_zero(bOpenedXInputDevices);
-
-    WIN_CoInitialize();
-
-    SDL_memset( &wincl, 0x0, sizeof(wincl) );
-    wincl.hInstance = GetModuleHandle( NULL );
-    wincl.lpszClassName = L"Message";
-    wincl.lpfnWndProc = SDL_PrivateJoystickDetectProc;      /* This function is called by windows */
-    wincl.cbSize = sizeof (WNDCLASSEX);
-
-    if (!RegisterClassEx (&wincl))
-    {
-        return SDL_SetError("Failed to create register class for joystick autodetect.", GetLastError());
-    }
-
-    messageWindow = (HWND)CreateWindowEx( 0,  L"Message", NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL );
-    if ( !messageWindow )
-    {
-        return SDL_SetError("Failed to create message window for joystick autodetect.", GetLastError());
-    }
-
-    SDL_zero(dbh);
-
-    dbh.dbcc_size = sizeof(dbh);
-    dbh.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
-    dbh.dbcc_classguid = GUID_DEVINTERFACE_HID;
-
-    hNotify = RegisterDeviceNotification( messageWindow, &dbh, DEVICE_NOTIFY_WINDOW_HANDLE );
-    if ( !hNotify )
-    {
-        return SDL_SetError("Failed to create notify device for joystick autodetect.", GetLastError());
-    }
-
-    SDL_LockMutex( s_mutexJoyStickEnum );
-    while ( s_bJoystickThreadQuit == SDL_FALSE )
-    {
-        MSG messages;
-        SDL_bool bXInputChanged = SDL_FALSE;
-
-        SDL_CondWaitTimeout( s_condJoystickThread, s_mutexJoyStickEnum, 300 );
-
-        while ( s_bJoystickThreadQuit == SDL_FALSE && PeekMessage(&messages, messageWindow, 0, 0, PM_NOREMOVE) )
-        {
-            if ( GetMessage(&messages, messageWindow, 0, 0) != 0 )  {
-                TranslateMessage(&messages);
-                DispatchMessage(&messages);
-            }
-        }
-
-        if ( s_bXInputEnabled && XINPUTGETCAPABILITIES ) {
-            /* scan for any change in XInput devices */
-            Uint8 userId;
-            for (userId = 0; userId < SDL_XINPUT_MAX_DEVICES; userId++) {
-                XINPUT_CAPABILITIES capabilities;
-                const DWORD result = XINPUTGETCAPABILITIES( userId, XINPUT_FLAG_GAMEPAD, &capabilities );
-                const SDL_bool available = (result == ERROR_SUCCESS);
-                if (bOpenedXInputDevices[userId] != available) {
-                    bXInputChanged = SDL_TRUE;
-                    bOpenedXInputDevices[userId] = available;
-                }
-            }
-        }
-
-        if (s_bWindowsDeviceChanged || bXInputChanged) {
-            SDL_UnlockMutex( s_mutexJoyStickEnum );  /* let main thread go while we SDL_Delay(). */
-            SDL_Delay( 300 ); /* wait for direct input to find out about this device */
-            SDL_LockMutex( s_mutexJoyStickEnum );
-
-            s_bDeviceRemoved = SDL_TRUE;
-            s_bDeviceAdded = SDL_TRUE;
-            s_bWindowsDeviceChanged = SDL_FALSE;
-        }
-    }
-    SDL_UnlockMutex( s_mutexJoyStickEnum );
-
-    if ( hNotify )
-        UnregisterDeviceNotification( hNotify );
-
-    if ( messageWindow )
-        DestroyWindow( messageWindow );
-
-    UnregisterClass( wincl.lpszClassName, wincl.hInstance );
-    messageWindow = 0;
-    WIN_CoUninitialize();
-    return 1;
-}
-
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int
-SDL_SYS_JoystickInit(void)
-{
-    HRESULT result;
-    HINSTANCE instance;
-    const char *env = SDL_GetHint(SDL_HINT_XINPUT_ENABLED);
-    if (env && !SDL_atoi(env)) {
-        s_bXInputEnabled = SDL_FALSE;
-    }
-
-    result = WIN_CoInitialize();
-    if (FAILED(result)) {
-        return SetDIerror("CoInitialize", result);
-    }
-
-    coinitialized = SDL_TRUE;
-
-    result = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER,
-                              &IID_IDirectInput8, (LPVOID)&dinput);
-
-    if (FAILED(result)) {
-        SDL_SYS_JoystickQuit();
-        return SetDIerror("CoCreateInstance", result);
-    }
-
-    /* Because we used CoCreateInstance, we need to Initialize it, first. */
-    instance = GetModuleHandle(NULL);
-    if (instance == NULL) {
-        SDL_SYS_JoystickQuit();
-        return SDL_SetError("GetModuleHandle() failed with error code %d.", GetLastError());
-    }
-    result = IDirectInput8_Initialize(dinput, instance, DIRECTINPUT_VERSION);
-
-    if (FAILED(result)) {
-        SDL_SYS_JoystickQuit();
-        return SetDIerror("IDirectInput::Initialize", result);
-    }
-
-    if ((s_bXInputEnabled) && (WIN_LoadXInputDLL() == -1)) {
-        s_bXInputEnabled = SDL_FALSE;  /* oh well. */
-    }
-
-    s_mutexJoyStickEnum = SDL_CreateMutex();
-    s_condJoystickThread = SDL_CreateCond();
-    s_bDeviceAdded = SDL_TRUE; /* force a scan of the system for joysticks this first time */
-
-    SDL_SYS_JoystickDetect();
-
-    if ( !s_threadJoystick )
-    {
-        s_bJoystickThreadQuit = SDL_FALSE;
-        /* spin up the thread to detect hotplug of devices */
-#if defined(__WIN32__) && !defined(HAVE_LIBC)
-#undef SDL_CreateThread
-        s_threadJoystick= SDL_CreateThread( SDL_JoystickThread, "SDL_joystick", NULL, NULL, NULL );
-#else
-        s_threadJoystick = SDL_CreateThread( SDL_JoystickThread, "SDL_joystick", NULL );
-#endif
-    }
-        return SDL_SYS_NumJoysticks();
-}
-
-/* return the number of joysticks that are connected right now */
-int SDL_SYS_NumJoysticks()
-{
-    int nJoysticks = 0;
-    JoyStick_DeviceData *device = SYS_Joystick;
-    while ( device )
-    {
-        nJoysticks++;
-        device = device->pNext;
-    }
-
-    return nJoysticks;
-}
-
-/* helper function for direct input, gets called for each connected joystick */
-static BOOL CALLBACK
-    EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext)
-{
-    JoyStick_DeviceData *pNewJoystick;
-    JoyStick_DeviceData *pPrevJoystick = NULL;
-
-    if (SDL_IsXInputDevice( &pdidInstance->guidProduct )) {
-        return DIENUM_CONTINUE;  /* ignore XInput devices here, keep going. */
-    }
-
-    pNewJoystick = *(JoyStick_DeviceData **)pContext;
-    while ( pNewJoystick )
-    {
-        if ( !SDL_memcmp( &pNewJoystick->dxdevice.guidInstance, &pdidInstance->guidInstance, sizeof(pNewJoystick->dxdevice.guidInstance) ) )
-        {
-            /* if we are replacing the front of the list then update it */
-            if ( pNewJoystick == *(JoyStick_DeviceData **)pContext )
-            {
-                *(JoyStick_DeviceData **)pContext = pNewJoystick->pNext;
-            }
-            else if ( pPrevJoystick )
-            {
-                pPrevJoystick->pNext = pNewJoystick->pNext;
-            }
-
-            pNewJoystick->pNext = SYS_Joystick;
-            SYS_Joystick = pNewJoystick;
-
-            return DIENUM_CONTINUE; /* already have this joystick loaded, just keep going */
-        }
-
-        pPrevJoystick = pNewJoystick;
-        pNewJoystick = pNewJoystick->pNext;
-    }
-
-    pNewJoystick = (JoyStick_DeviceData *)SDL_malloc( sizeof(JoyStick_DeviceData) );
-    if (!pNewJoystick) {
-        return DIENUM_CONTINUE; /* better luck next time? */
-    }
-
-    SDL_zerop(pNewJoystick);
-    pNewJoystick->joystickname = WIN_StringToUTF8(pdidInstance->tszProductName);
-    if (!pNewJoystick->joystickname) {
-        SDL_free(pNewJoystick);
-        return DIENUM_CONTINUE; /* better luck next time? */
-    }
-
-    SDL_memcpy(&(pNewJoystick->dxdevice), pdidInstance,
-        sizeof(DIDEVICEINSTANCE));
-
-    pNewJoystick->XInputUserId = INVALID_XINPUT_USERID;
-    pNewJoystick->send_add_event = 1;
-    pNewJoystick->nInstanceID = ++s_nInstanceID;
-    SDL_memcpy( &pNewJoystick->guid, &pdidInstance->guidProduct, sizeof(pNewJoystick->guid) );
-    pNewJoystick->pNext = SYS_Joystick;
-    SYS_Joystick = pNewJoystick;
-
-    s_bDeviceAdded = SDL_TRUE;
-
-    return DIENUM_CONTINUE; /* get next device, please */
-}
-
-static void
-AddXInputDevice(const Uint8 userid, JoyStick_DeviceData **pContext)
-{
-    char name[32];
-    JoyStick_DeviceData *pPrevJoystick = NULL;
-    JoyStick_DeviceData *pNewJoystick = *pContext;
-
-    while (pNewJoystick) {
-        if ((pNewJoystick->bXInputDevice) && (pNewJoystick->XInputUserId == userid)) {
-            /* if we are replacing the front of the list then update it */
-            if (pNewJoystick == *pContext) {
-                *pContext = pNewJoystick->pNext;
-            } else if (pPrevJoystick) {
-                pPrevJoystick->pNext = pNewJoystick->pNext;
-            }
-
-            pNewJoystick->pNext = SYS_Joystick;
-            SYS_Joystick = pNewJoystick;
-            return;   /* already in the list. */
-        }
-
-        pPrevJoystick = pNewJoystick;
-        pNewJoystick = pNewJoystick->pNext;
-    }
-
-    pNewJoystick = (JoyStick_DeviceData *) SDL_malloc(sizeof (JoyStick_DeviceData));
-    if (!pNewJoystick) {
-        return; /* better luck next time? */
-    }
-    SDL_zerop(pNewJoystick);
-
-    SDL_snprintf(name, sizeof (name), "XInput Controller #%u", ((unsigned int) userid) + 1);
-    pNewJoystick->joystickname = SDL_strdup(name);
-    if (!pNewJoystick->joystickname) {
-        SDL_free(pNewJoystick);
-        return; /* better luck next time? */
-    }
-
-    pNewJoystick->bXInputDevice = SDL_TRUE;
-    pNewJoystick->XInputUserId = userid;
-    pNewJoystick->send_add_event = 1;
-    pNewJoystick->nInstanceID = ++s_nInstanceID;
-    pNewJoystick->pNext = SYS_Joystick;
-    SYS_Joystick = pNewJoystick;
-
-    s_bDeviceAdded = SDL_TRUE;
-}
-
-static void
-EnumXInputDevices(JoyStick_DeviceData **pContext)
-{
-    if (s_bXInputEnabled) {
-        int iuserid;
-        /* iterate in reverse, so these are in the final list in ascending numeric order. */
-        for (iuserid = SDL_XINPUT_MAX_DEVICES-1; iuserid >= 0; iuserid--) {
-            const Uint8 userid = (Uint8) iuserid;
-            XINPUT_CAPABILITIES capabilities;
-            if (XINPUTGETCAPABILITIES(userid, XINPUT_FLAG_GAMEPAD, &capabilities) == ERROR_SUCCESS) {
-                /* Current version of XInput mistakenly returns 0 as the Type. Ignore it and ensure the subtype is a gamepad. */
-                /* !!! FIXME: we might want to support steering wheels or guitars or whatever laster. */
-                if (capabilities.SubType == XINPUT_DEVSUBTYPE_GAMEPAD) {
-                    AddXInputDevice(userid, pContext);
-                }
-            }
-        }
-    }
-}
-
-
-/* detect any new joysticks being inserted into the system */
-void SDL_SYS_JoystickDetect()
-{
-    JoyStick_DeviceData *pCurList = NULL;
-    /* only enum the devices if the joystick thread told us something changed */
-    if ( s_bDeviceAdded || s_bDeviceRemoved )
-    {
-        SDL_LockMutex( s_mutexJoyStickEnum );
-
-        s_bDeviceAdded = SDL_FALSE;
-        s_bDeviceRemoved = SDL_FALSE;
-
-        pCurList = SYS_Joystick;
-        SYS_Joystick = NULL;
-
-        /* Look for DirectInput joysticks, wheels, head trackers, gamepads, etc.. */
-        IDirectInput8_EnumDevices(dinput,
-            DI8DEVCLASS_GAMECTRL,
-            EnumJoysticksCallback,
-            &pCurList, DIEDFL_ATTACHEDONLY);
-
-        SDL_free(SDL_RawDevList);  /* in case we used this in DirectInput enumerator. */
-        SDL_RawDevList = NULL;
-        SDL_RawDevListCount = 0;
-
-        /* Look for XInput devices. Do this last, so they're first in the final list. */
-        EnumXInputDevices(&pCurList);
-
-        SDL_UnlockMutex( s_mutexJoyStickEnum );
-    }
-
-    if ( pCurList )
-    {
-        while ( pCurList )
-        {
-            JoyStick_DeviceData *pListNext = NULL;
-#if !SDL_EVENTS_DISABLED
-            SDL_Event event;
-            event.type = SDL_JOYDEVICEREMOVED;
-
-            if (SDL_GetEventState(event.type) == SDL_ENABLE) {
-                event.jdevice.which = pCurList->nInstanceID;
-                if ((SDL_EventOK == NULL)
-                    || (*SDL_EventOK) (SDL_EventOKParam, &event)) {
-                        SDL_PushEvent(&event);
-                }
-            }
-#endif /* !SDL_EVENTS_DISABLED */
-
-            pListNext = pCurList->pNext;
-            SDL_free(pCurList->joystickname);
-            SDL_free(pCurList);
-            pCurList = pListNext;
-        }
-
-    }
-
-    if ( s_bDeviceAdded )
-    {
-        JoyStick_DeviceData *pNewJoystick;
-        int device_index = 0;
-        s_bDeviceAdded = SDL_FALSE;
-        pNewJoystick = SYS_Joystick;
-        while ( pNewJoystick )
-        {
-            if ( pNewJoystick->send_add_event )
-            {
-#if !SDL_EVENTS_DISABLED
-                SDL_Event event;
-                event.type = SDL_JOYDEVICEADDED;
-
-                if (SDL_GetEventState(event.type) == SDL_ENABLE) {
-                    event.jdevice.which = device_index;
-                    if ((SDL_EventOK == NULL)
-                        || (*SDL_EventOK) (SDL_EventOKParam, &event)) {
-                            SDL_PushEvent(&event);
-                    }
-                }
-#endif /* !SDL_EVENTS_DISABLED */
-                pNewJoystick->send_add_event = 0;
-            }
-            device_index++;
-            pNewJoystick = pNewJoystick->pNext;
-        }
-    }
-}
-
-/* we need to poll if we have pending hotplug device changes or connected devices */
-SDL_bool SDL_SYS_JoystickNeedsPolling()
-{
-    /* we have a new device or one was pulled, we need to think this frame please */
-    if ( s_bDeviceAdded || s_bDeviceRemoved )
-        return SDL_TRUE;
-
-    return SDL_FALSE;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *
-SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
-    JoyStick_DeviceData *device = SYS_Joystick;
-
-    for (; device_index > 0; device_index--)
-        device = device->pNext;
-
-    return device->joystickname;
-}
-
-/* Function to perform the mapping between current device instance and this joysticks instance id */
-SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
-    JoyStick_DeviceData *device = SYS_Joystick;
-    int index;
-
-    for (index = device_index; index > 0; index--)
-        device = device->pNext;
-
-    return device->nInstanceID;
-}
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
-{
-    HRESULT result;
-    JoyStick_DeviceData *joystickdevice = SYS_Joystick;
-
-    for (; device_index > 0; device_index--)
-        joystickdevice = joystickdevice->pNext;
-
-    /* allocate memory for system specific hardware data */
-    joystick->instance_id = joystickdevice->nInstanceID;
-    joystick->closed = 0;
-    joystick->hwdata =
-        (struct joystick_hwdata *) SDL_malloc(sizeof(struct joystick_hwdata));
-    if (joystick->hwdata == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_zerop(joystick->hwdata);
-
-    if (joystickdevice->bXInputDevice) {
-        const SDL_bool bIs14OrLater = (SDL_XInputVersion >= ((1<<16)|4));
-        const Uint8 userId = joystickdevice->XInputUserId;
-        XINPUT_CAPABILITIES capabilities;
-
-        SDL_assert(s_bXInputEnabled);
-        SDL_assert(XINPUTGETCAPABILITIES);
-        SDL_assert(userId >= 0);
-        SDL_assert(userId < SDL_XINPUT_MAX_DEVICES);
-
-        joystick->hwdata->bXInputDevice = SDL_TRUE;
-
-        if (XINPUTGETCAPABILITIES(userId, XINPUT_FLAG_GAMEPAD, &capabilities) != ERROR_SUCCESS) {
-            SDL_free(joystick->hwdata);
-            joystick->hwdata = NULL;
-            return SDL_SetError("Failed to obtain XInput device capabilities. Device disconnected?");
-        } else {
-            /* Current version of XInput mistakenly returns 0 as the Type. Ignore it and ensure the subtype is a gamepad. */
-            SDL_assert(capabilities.SubType == XINPUT_DEVSUBTYPE_GAMEPAD);
-            if ((!bIs14OrLater) || (capabilities.Flags & XINPUT_CAPS_FFB_SUPPORTED)) {
-                joystick->hwdata->bXInputHaptic = SDL_TRUE;
-            }
-            joystick->hwdata->userid = userId;
-
-            /* The XInput API has a hard coded button/axis mapping, so we just match it */
-            joystick->naxes = 6;
-            joystick->nbuttons = 15;
-            joystick->nballs = 0;
-            joystick->nhats = 0;
-		}
-    } else {  /* use DirectInput, not XInput. */
-        LPDIRECTINPUTDEVICE8 device;
-        DIPROPDWORD dipdw;
-
-        joystick->hwdata->buffered = 1;
-        joystick->hwdata->removed = 0;
-        joystick->hwdata->Capabilities.dwSize = sizeof(DIDEVCAPS);
-        joystick->hwdata->guid = joystickdevice->guid;
-
-        SDL_zero(dipdw);
-        dipdw.diph.dwSize = sizeof(DIPROPDWORD);
-        dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
-
-        result =
-            IDirectInput8_CreateDevice(dinput,
-                                      &(joystickdevice->dxdevice.guidInstance), &device, NULL);
-        if (FAILED(result)) {
-            return SetDIerror("IDirectInput::CreateDevice", result);
-        }
-
-        /* Now get the IDirectInputDevice8 interface, instead. */
-        result = IDirectInputDevice8_QueryInterface(device,
-                                                   &IID_IDirectInputDevice8,
-                                                   (LPVOID *) & joystick->
-                                                   hwdata->InputDevice);
-        /* We are done with this object.  Use the stored one from now on. */
-        IDirectInputDevice8_Release(device);
-
-        if (FAILED(result)) {
-            return SetDIerror("IDirectInputDevice8::QueryInterface", result);
-        }
-
-        /* Acquire shared access. Exclusive access is required for forces,
-         * though. */
-        result =
-            IDirectInputDevice8_SetCooperativeLevel(joystick->hwdata->
-                                                    InputDevice, SDL_HelperWindow,
-                                                    DISCL_NONEXCLUSIVE |
-                                                    DISCL_BACKGROUND);
-        if (FAILED(result)) {
-            return SetDIerror("IDirectInputDevice8::SetCooperativeLevel", result);
-        }
-
-        /* Use the extended data structure: DIJOYSTATE2. */
-        result =
-            IDirectInputDevice8_SetDataFormat(joystick->hwdata->InputDevice,
-                                              &c_dfDIJoystick2);
-        if (FAILED(result)) {
-            return SetDIerror("IDirectInputDevice8::SetDataFormat", result);
-        }
-
-        /* Get device capabilities */
-        result =
-            IDirectInputDevice8_GetCapabilities(joystick->hwdata->InputDevice,
-                                                &joystick->hwdata->Capabilities);
-
-        if (FAILED(result)) {
-            return SetDIerror("IDirectInputDevice8::GetCapabilities", result);
-        }
-
-        /* Force capable? */
-        if (joystick->hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) {
-
-            result = IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
-
-            if (FAILED(result)) {
-                return SetDIerror("IDirectInputDevice8::Acquire", result);
-            }
-
-            /* reset all accuators. */
-            result =
-                IDirectInputDevice8_SendForceFeedbackCommand(joystick->hwdata->
-                                                             InputDevice,
-                                                             DISFFC_RESET);
-
-            /* Not necessarily supported, ignore if not supported.
-            if (FAILED(result)) {
-                return SetDIerror("IDirectInputDevice8::SendForceFeedbackCommand", result);
-            }
-            */
-
-            result = IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice);
-
-            if (FAILED(result)) {
-                return SetDIerror("IDirectInputDevice8::Unacquire", result);
-            }
-
-            /* Turn on auto-centering for a ForceFeedback device (until told
-             * otherwise). */
-            dipdw.diph.dwObj = 0;
-            dipdw.diph.dwHow = DIPH_DEVICE;
-            dipdw.dwData = DIPROPAUTOCENTER_ON;
-
-            result =
-                IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice,
-                                                DIPROP_AUTOCENTER, &dipdw.diph);
-
-            /* Not necessarily supported, ignore if not supported.
-            if (FAILED(result)) {
-                return SetDIerror("IDirectInputDevice8::SetProperty", result);
-            }
-            */
-        }
-
-        /* What buttons and axes does it have? */
-        IDirectInputDevice8_EnumObjects(joystick->hwdata->InputDevice,
-                                        EnumDevObjectsCallback, joystick,
-                                        DIDFT_BUTTON | DIDFT_AXIS | DIDFT_POV);
-
-        /* Reorder the input objects. Some devices do not report the X axis as
-         * the first axis, for example. */
-        SortDevObjects(joystick);
-
-        dipdw.diph.dwObj = 0;
-        dipdw.diph.dwHow = DIPH_DEVICE;
-        dipdw.dwData = INPUT_QSIZE;
-
-        /* Set the buffer size */
-        result =
-            IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice,
-                                            DIPROP_BUFFERSIZE, &dipdw.diph);
-
-        if (result == DI_POLLEDDEVICE) {
-            /* This device doesn't support buffering, so we're forced
-             * to use less reliable polling. */
-            joystick->hwdata->buffered = 0;
-        } else if (FAILED(result)) {
-            return SetDIerror("IDirectInputDevice8::SetProperty", result);
-        }
-    }
-    return (0);
-}
-
-/* return true if this joystick is plugged in right now */
-SDL_bool SDL_SYS_JoystickAttached( SDL_Joystick * joystick )
-{
-    return joystick->closed == 0 && joystick->hwdata->removed == 0;
-}
-
-
-/* Sort using the data offset into the DInput struct.
- * This gives a reasonable ordering for the inputs. */
-static int
-SortDevFunc(const void *a, const void *b)
-{
-    const input_t *inputA = (const input_t*)a;
-    const input_t *inputB = (const input_t*)b;
-
-    if (inputA->ofs < inputB->ofs)
-        return -1;
-    if (inputA->ofs > inputB->ofs)
-        return 1;
-    return 0;
-}
-
-/* Sort the input objects and recalculate the indices for each input. */
-static void
-SortDevObjects(SDL_Joystick *joystick)
-{
-    input_t *inputs = joystick->hwdata->Inputs;
-    int nButtons = 0;
-    int nHats = 0;
-    int nAxis = 0;
-    int n;
-
-    SDL_qsort(inputs, joystick->hwdata->NumInputs, sizeof(input_t), SortDevFunc);
-
-    for (n = 0; n < joystick->hwdata->NumInputs; n++)
-    {
-        switch (inputs[n].type)
-        {
-        case BUTTON:
-            inputs[n].num = nButtons;
-            nButtons++;
-            break;
-
-        case HAT:
-            inputs[n].num = nHats;
-            nHats++;
-            break;
-
-        case AXIS:
-            inputs[n].num = nAxis;
-            nAxis++;
-            break;
-        }
-    }
-}
-
-static BOOL CALLBACK
-EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef)
-{
-    SDL_Joystick *joystick = (SDL_Joystick *) pvRef;
-    HRESULT result;
-    input_t *in = &joystick->hwdata->Inputs[joystick->hwdata->NumInputs];
-
-    if (dev->dwType & DIDFT_BUTTON) {
-        in->type = BUTTON;
-        in->num = joystick->nbuttons;
-        in->ofs = DIJOFS_BUTTON( in->num );
-        joystick->nbuttons++;
-    } else if (dev->dwType & DIDFT_POV) {
-        in->type = HAT;
-        in->num = joystick->nhats;
-        in->ofs = DIJOFS_POV( in->num );
-        joystick->nhats++;
-    } else if (dev->dwType & DIDFT_AXIS) {
-        DIPROPRANGE diprg;
-        DIPROPDWORD dilong;
-
-        in->type = AXIS;
-        in->num = joystick->naxes;
-        /* work our the axis this guy maps too, thanks for the code icculus! */
-        if ( !SDL_memcmp( &dev->guidType, &GUID_XAxis, sizeof(dev->guidType) ) )
-            in->ofs = DIJOFS_X;
-        else if ( !SDL_memcmp( &dev->guidType, &GUID_YAxis, sizeof(dev->guidType) ) )
-            in->ofs = DIJOFS_Y;
-        else if ( !SDL_memcmp( &dev->guidType, &GUID_ZAxis, sizeof(dev->guidType) ) )
-            in->ofs = DIJOFS_Z;
-        else if ( !SDL_memcmp( &dev->guidType, &GUID_RxAxis, sizeof(dev->guidType) ) )
-            in->ofs = DIJOFS_RX;
-        else if ( !SDL_memcmp( &dev->guidType, &GUID_RyAxis, sizeof(dev->guidType) ) )
-            in->ofs = DIJOFS_RY;
-        else if ( !SDL_memcmp( &dev->guidType, &GUID_RzAxis, sizeof(dev->guidType) ) )
-            in->ofs = DIJOFS_RZ;
-        else if ( !SDL_memcmp( &dev->guidType, &GUID_Slider, sizeof(dev->guidType) ) )
-        {
-            in->ofs = DIJOFS_SLIDER( joystick->hwdata->NumSliders );
-            ++joystick->hwdata->NumSliders;
-        }
-        else
-        {
-             return DIENUM_CONTINUE; /* not an axis we can grok */
-        }
-
-        diprg.diph.dwSize = sizeof(diprg);
-        diprg.diph.dwHeaderSize = sizeof(diprg.diph);
-        diprg.diph.dwObj = dev->dwType;
-        diprg.diph.dwHow = DIPH_BYID;
-        diprg.lMin = AXIS_MIN;
-        diprg.lMax = AXIS_MAX;
-
-        result =
-            IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice,
-                                            DIPROP_RANGE, &diprg.diph);
-        if (FAILED(result)) {
-            return DIENUM_CONTINUE;     /* don't use this axis */
-        }
-
-        /* Set dead zone to 0. */
-        dilong.diph.dwSize = sizeof(dilong);
-        dilong.diph.dwHeaderSize = sizeof(dilong.diph);
-        dilong.diph.dwObj = dev->dwType;
-        dilong.diph.dwHow = DIPH_BYID;
-        dilong.dwData = 0;
-        result =
-            IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice,
-                                            DIPROP_DEADZONE, &dilong.diph);
-        if (FAILED(result)) {
-            return DIENUM_CONTINUE;     /* don't use this axis */
-        }
-
-        joystick->naxes++;
-    } else {
-        /* not supported at this time */
-        return DIENUM_CONTINUE;
-    }
-
-    joystick->hwdata->NumInputs++;
-
-    if (joystick->hwdata->NumInputs == MAX_INPUTS) {
-        return DIENUM_STOP;     /* too many */
-    }
-
-    return DIENUM_CONTINUE;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void
-SDL_SYS_JoystickUpdate_Polled(SDL_Joystick * joystick)
-{
-    DIJOYSTATE2 state;
-    HRESULT result;
-    int i;
-
-    result =
-        IDirectInputDevice8_GetDeviceState(joystick->hwdata->InputDevice,
-                                           sizeof(DIJOYSTATE2), &state);
-    if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) {
-        IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
-        result =
-            IDirectInputDevice8_GetDeviceState(joystick->hwdata->InputDevice,
-                                               sizeof(DIJOYSTATE2), &state);
-    }
-
-    if ( result != DI_OK )
-    {
-        joystick->hwdata->send_remove_event = 1;
-        joystick->hwdata->removed = 1;
-        return;
-    }
-
-    /* Set each known axis, button and POV. */
-    for (i = 0; i < joystick->hwdata->NumInputs; ++i) {
-        const input_t *in = &joystick->hwdata->Inputs[i];
-
-        switch (in->type) {
-        case AXIS:
-            switch (in->ofs) {
-            case DIJOFS_X:
-                SDL_PrivateJoystickAxis_Int(joystick, in->num,
-                                            (Sint16) state.lX);
-                break;
-            case DIJOFS_Y:
-                SDL_PrivateJoystickAxis_Int(joystick, in->num,
-                                            (Sint16) state.lY);
-                break;
-            case DIJOFS_Z:
-                SDL_PrivateJoystickAxis_Int(joystick, in->num,
-                                            (Sint16) state.lZ);
-                break;
-            case DIJOFS_RX:
-                SDL_PrivateJoystickAxis_Int(joystick, in->num,
-                                            (Sint16) state.lRx);
-                break;
-            case DIJOFS_RY:
-                SDL_PrivateJoystickAxis_Int(joystick, in->num,
-                                            (Sint16) state.lRy);
-                break;
-            case DIJOFS_RZ:
-                SDL_PrivateJoystickAxis_Int(joystick, in->num,
-                                            (Sint16) state.lRz);
-                break;
-            case DIJOFS_SLIDER(0):
-                SDL_PrivateJoystickAxis_Int(joystick, in->num,
-                                            (Sint16) state.rglSlider[0]);
-                break;
-            case DIJOFS_SLIDER(1):
-                SDL_PrivateJoystickAxis_Int(joystick, in->num,
-                                            (Sint16) state.rglSlider[1]);
-                break;
-            }
-
-            break;
-
-        case BUTTON:
-            SDL_PrivateJoystickButton_Int(joystick, in->num,
-                                          (Uint8) (state.
-                                                   rgbButtons[in->ofs -
-                                                              DIJOFS_BUTTON0]
-                                                   ? SDL_PRESSED :
-                                                   SDL_RELEASED));
-            break;
-        case HAT:
-            {
-                Uint8 pos = TranslatePOV(state.rgdwPOV[in->ofs -
-                                                       DIJOFS_POV(0)]);
-                SDL_PrivateJoystickHat_Int(joystick, in->num, pos);
-                break;
-            }
-        }
-    }
-}
-
-void
-SDL_SYS_JoystickUpdate_Buffered(SDL_Joystick * joystick)
-{
-    int i;
-    HRESULT result;
-    DWORD numevents;
-    DIDEVICEOBJECTDATA evtbuf[INPUT_QSIZE];
-
-    numevents = INPUT_QSIZE;
-    result =
-        IDirectInputDevice8_GetDeviceData(joystick->hwdata->InputDevice,
-                                          sizeof(DIDEVICEOBJECTDATA), evtbuf,
-                                          &numevents, 0);
-    if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) {
-        IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
-        result =
-            IDirectInputDevice8_GetDeviceData(joystick->hwdata->InputDevice,
-                                              sizeof(DIDEVICEOBJECTDATA),
-                                              evtbuf, &numevents, 0);
-    }
-
-    /* Handle the events or punt */
-    if (FAILED(result))
-    {
-        joystick->hwdata->send_remove_event = 1;
-        joystick->hwdata->removed = 1;
-        return;
-    }
-
-    for (i = 0; i < (int) numevents; ++i) {
-        int j;
-
-        for (j = 0; j < joystick->hwdata->NumInputs; ++j) {
-            const input_t *in = &joystick->hwdata->Inputs[j];
-
-            if (evtbuf[i].dwOfs != in->ofs)
-                continue;
-
-            switch (in->type) {
-            case AXIS:
-                SDL_PrivateJoystickAxis(joystick, in->num,
-                                        (Sint16) evtbuf[i].dwData);
-                break;
-            case BUTTON:
-                SDL_PrivateJoystickButton(joystick, in->num,
-                                          (Uint8) (evtbuf[i].
-                                                   dwData ? SDL_PRESSED :
-                                                   SDL_RELEASED));
-                break;
-            case HAT:
-                {
-                    Uint8 pos = TranslatePOV(evtbuf[i].dwData);
-                    SDL_PrivateJoystickHat(joystick, in->num, pos);
-                }
-            }
-        }
-    }
-}
-
-
-/* Function to return > 0 if a bit array of buttons differs after applying a mask
-*/
-int ButtonChanged( int ButtonsNow, int ButtonsPrev, int ButtonMask )
-{
-    return ( ButtonsNow & ButtonMask ) != ( ButtonsPrev & ButtonMask );
-}
-
-/* Function to update the state of a XInput style joystick.
-*/
-void
-SDL_SYS_JoystickUpdate_XInput(SDL_Joystick * joystick)
-{
-    HRESULT result;
-
-    if ( !XINPUTGETSTATE )
-        return;
-
-    result = XINPUTGETSTATE( joystick->hwdata->userid, &joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot] );
-    if ( result == ERROR_DEVICE_NOT_CONNECTED )
-    {
-        joystick->hwdata->send_remove_event = 1;
-        joystick->hwdata->removed = 1;
-        return;
-    }
-
-    /* only fire events if the data changed from last time */
-    if ( joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot].dwPacketNumber != 0
-        && joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot].dwPacketNumber != joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot^1].dwPacketNumber )
-    {
-        XINPUT_STATE_EX *pXInputState = &joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot];
-        XINPUT_STATE_EX *pXInputStatePrev = &joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot ^ 1];
-
-        SDL_PrivateJoystickAxis( joystick, 0, (Sint16)pXInputState->Gamepad.sThumbLX );
-        SDL_PrivateJoystickAxis( joystick, 1, (Sint16)(-SDL_max(-32767, pXInputState->Gamepad.sThumbLY)) );
-        SDL_PrivateJoystickAxis( joystick, 2, (Sint16)pXInputState->Gamepad.sThumbRX );
-        SDL_PrivateJoystickAxis( joystick, 3, (Sint16)(-SDL_max(-32767, pXInputState->Gamepad.sThumbRY)) );
-        SDL_PrivateJoystickAxis( joystick, 4, (Sint16)(((int)pXInputState->Gamepad.bLeftTrigger*65535/255) - 32768));
-        SDL_PrivateJoystickAxis( joystick, 5, (Sint16)(((int)pXInputState->Gamepad.bRightTrigger*65535/255) - 32768));
-
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_DPAD_UP ) )
-            SDL_PrivateJoystickButton(joystick, 0, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP ? SDL_PRESSED :  SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_DPAD_DOWN ) )
-            SDL_PrivateJoystickButton(joystick, 1, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN ? SDL_PRESSED :    SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_DPAD_LEFT ) )
-            SDL_PrivateJoystickButton(joystick, 2, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT ? SDL_PRESSED :    SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_DPAD_RIGHT ) )
-            SDL_PrivateJoystickButton(joystick, 3, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT ? SDL_PRESSED :   SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_START ) )
-            SDL_PrivateJoystickButton(joystick, 4, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_START ? SDL_PRESSED :    SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_BACK ) )
-            SDL_PrivateJoystickButton(joystick, 5, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_BACK ? SDL_PRESSED : SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_LEFT_THUMB ) )
-            SDL_PrivateJoystickButton(joystick, 6, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB ? SDL_PRESSED :   SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_RIGHT_THUMB ) )
-            SDL_PrivateJoystickButton(joystick, 7, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB ? SDL_PRESSED :  SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_LEFT_SHOULDER ) )
-            SDL_PrivateJoystickButton(joystick, 8, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER ? SDL_PRESSED :    SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_RIGHT_SHOULDER ) )
-            SDL_PrivateJoystickButton(joystick, 9, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER ? SDL_PRESSED :   SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_A ) )
-            SDL_PrivateJoystickButton(joystick, 10, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_A ? SDL_PRESSED :   SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_B ) )
-            SDL_PrivateJoystickButton(joystick, 11, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_B ? SDL_PRESSED :   SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_X ) )
-            SDL_PrivateJoystickButton(joystick, 12, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_X ? SDL_PRESSED :   SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_Y ) )
-            SDL_PrivateJoystickButton(joystick, 13, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_Y ? SDL_PRESSED :   SDL_RELEASED );
-        if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons,  0x400 ) )
-            SDL_PrivateJoystickButton(joystick, 14, pXInputState->Gamepad.wButtons & 0x400 ? SDL_PRESSED :  SDL_RELEASED ); /* 0x400 is the undocumented code for the guide button */
-
-        joystick->hwdata->currentXInputSlot ^= 1;
-
-    }
-}
-
-
-static Uint8
-TranslatePOV(DWORD value)
-{
-    const int HAT_VALS[] = {
-        SDL_HAT_UP,
-        SDL_HAT_UP | SDL_HAT_RIGHT,
-        SDL_HAT_RIGHT,
-        SDL_HAT_DOWN | SDL_HAT_RIGHT,
-        SDL_HAT_DOWN,
-        SDL_HAT_DOWN | SDL_HAT_LEFT,
-        SDL_HAT_LEFT,
-        SDL_HAT_UP | SDL_HAT_LEFT
-    };
-
-    if (LOWORD(value) == 0xFFFF)
-        return SDL_HAT_CENTERED;
-
-    /* Round the value up: */
-    value += 4500 / 2;
-    value %= 36000;
-    value /= 4500;
-
-    if (value >= 8)
-        return SDL_HAT_CENTERED;        /* shouldn't happen */
-
-    return HAT_VALS[value];
-}
-
-/* SDL_PrivateJoystick* doesn't discard duplicate events, so we need to
- * do it. */
-static int
-SDL_PrivateJoystickAxis_Int(SDL_Joystick * joystick, Uint8 axis, Sint16 value)
-{
-    if (joystick->axes[axis] != value)
-        return SDL_PrivateJoystickAxis(joystick, axis, value);
-    return 0;
-}
-
-static int
-SDL_PrivateJoystickHat_Int(SDL_Joystick * joystick, Uint8 hat, Uint8 value)
-{
-    if (joystick->hats[hat] != value)
-        return SDL_PrivateJoystickHat(joystick, hat, value);
-    return 0;
-}
-
-static int
-SDL_PrivateJoystickButton_Int(SDL_Joystick * joystick, Uint8 button,
-                              Uint8 state)
-{
-    if (joystick->buttons[button] != state)
-        return SDL_PrivateJoystickButton(joystick, button, state);
-    return 0;
-}
-
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-{
-    HRESULT result;
-
-    if ( joystick->closed || !joystick->hwdata )
-        return;
-
-    if (joystick->hwdata->bXInputDevice)
-    {
-        SDL_SYS_JoystickUpdate_XInput(joystick);
-    }
-    else
-    {
-        result = IDirectInputDevice8_Poll(joystick->hwdata->InputDevice);
-        if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) {
-            IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
-            IDirectInputDevice8_Poll(joystick->hwdata->InputDevice);
-        }
-
-        if (joystick->hwdata->buffered)
-            SDL_SYS_JoystickUpdate_Buffered(joystick);
-        else
-            SDL_SYS_JoystickUpdate_Polled(joystick);
-    }
-
-    if ( joystick->hwdata->removed )
-    {
-        joystick->closed = 1;
-        joystick->uncentered = 1;
-    }
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-{
-    if (!joystick->hwdata->bXInputDevice) {
-        IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice);
-        IDirectInputDevice8_Release(joystick->hwdata->InputDevice);
-    }
-
-    /* free system specific hardware data */
-    SDL_free(joystick->hwdata);
-
-    joystick->closed = 1;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void
-SDL_SYS_JoystickQuit(void)
-{
-    JoyStick_DeviceData *device = SYS_Joystick;
-
-    while ( device )
-    {
-        JoyStick_DeviceData *device_next = device->pNext;
-        SDL_free(device->joystickname);
-        SDL_free(device);
-        device = device_next;
-    }
-    SYS_Joystick = NULL;
-
-    if ( s_threadJoystick )
-    {
-        SDL_LockMutex( s_mutexJoyStickEnum );
-        s_bJoystickThreadQuit = SDL_TRUE;
-        SDL_CondBroadcast( s_condJoystickThread ); /* signal the joystick thread to quit */
-        SDL_UnlockMutex( s_mutexJoyStickEnum );
-        SDL_WaitThread( s_threadJoystick, NULL ); /* wait for it to bugger off */
-
-        SDL_DestroyMutex( s_mutexJoyStickEnum );
-        SDL_DestroyCond( s_condJoystickThread );
-        s_condJoystickThread= NULL;
-        s_mutexJoyStickEnum = NULL;
-        s_threadJoystick = NULL;
-    }
-
-    if (dinput != NULL) {
-        IDirectInput8_Release(dinput);
-        dinput = NULL;
-    }
-
-    if (coinitialized) {
-        WIN_CoUninitialize();
-        coinitialized = SDL_FALSE;
-    }
-
-    if (s_bXInputEnabled) {
-        WIN_UnloadXInputDLL();
-    }
-}
-
-/* return the stable device guid for this device index */
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
-    JoyStick_DeviceData *device = SYS_Joystick;
-    int index;
-
-    for (index = device_index; index > 0; index--)
-        device = device->pNext;
-
-    return device->guid;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-{
-    return joystick->hwdata->guid;
-}
-
-/* return SDL_TRUE if this device is using XInput */
-SDL_bool SDL_SYS_IsXInputDeviceIndex(int device_index)
-{
-    JoyStick_DeviceData *device = SYS_Joystick;
-    int index;
-
-    for (index = device_index; index > 0; index--)
-        device = device->pNext;
-
-    return device->bXInputDevice;
-}
-
-/* return SDL_TRUE if this device was opened with XInput */
-SDL_bool SDL_SYS_IsXInputJoystick(SDL_Joystick * joystick)
-{
-	return joystick->hwdata->bXInputDevice;
-}
-
-#endif /* SDL_JOYSTICK_DINPUT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/joystick/windows/SDL_dxjoystick_c.h b/deps/SDL2/src/joystick/windows/SDL_dxjoystick_c.h
deleted file mode 100644
index 1a4703e..0000000
--- a/deps/SDL2/src/joystick/windows/SDL_dxjoystick_c.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef SDL_JOYSTICK_DINPUT_H
-
-/* DirectInput joystick driver; written by Glenn Maynard, based on Andrei de
- * A. Formiga's WINMM driver.
- *
- * Hats and sliders are completely untested; the app I'm writing this for mostly
- * doesn't use them and I don't own any joysticks with them.
- *
- * We don't bother to use event notification here.  It doesn't seem to work
- * with polled devices, and it's fine to call IDirectInputDevice2_GetDeviceData and
- * let it return 0 events. */
-
-#include "../../core/windows/SDL_windows.h"
-
-#define DIRECTINPUT_VERSION 0x0800      /* Need version 7 for force feedback. Need version 8 so IDirectInput8_EnumDevices doesn't leak like a sieve... */
-#include <dinput.h>
-#define COBJMACROS
-#include <wbemcli.h>
-#include <oleauto.h>
-#include <xinput.h>
-#include <devguid.h>
-#include <dbt.h>
-
-
-#ifndef XUSER_MAX_COUNT
-#define XUSER_MAX_COUNT 4
-#endif
-#ifndef XUSER_INDEX_ANY
-#define XUSER_INDEX_ANY     0x000000FF
-#endif
-#ifndef XINPUT_CAPS_FFB_SUPPORTED
-#define XINPUT_CAPS_FFB_SUPPORTED 0x0001
-#endif
-
-
-/* typedef's for XInput structs we use */
-typedef struct
-{
-    WORD wButtons;
-    BYTE bLeftTrigger;
-    BYTE bRightTrigger;
-    SHORT sThumbLX;
-    SHORT sThumbLY;
-    SHORT sThumbRX;
-    SHORT sThumbRY;
-    DWORD dwPaddingReserved;
-} XINPUT_GAMEPAD_EX;
-
-typedef struct
-{
-    DWORD dwPacketNumber;
-    XINPUT_GAMEPAD_EX Gamepad;
-} XINPUT_STATE_EX;
-
-/* Forward decl's for XInput API's we load dynamically and use if available */
-typedef DWORD (WINAPI *XInputGetState_t)
-    (
-    DWORD         dwUserIndex,  /* [in] Index of the gamer associated with the device */
-    XINPUT_STATE_EX* pState     /* [out] Receives the current state */
-    );
-
-typedef DWORD (WINAPI *XInputSetState_t)
-    (
-    DWORD             dwUserIndex,  /* [in] Index of the gamer associated with the device */
-    XINPUT_VIBRATION* pVibration    /* [in, out] The vibration information to send to the controller */
-    );
-
-typedef DWORD (WINAPI *XInputGetCapabilities_t)
-    (
-    DWORD                dwUserIndex,   /* [in] Index of the gamer associated with the device */
-    DWORD                dwFlags,       /* [in] Input flags that identify the device type */
-    XINPUT_CAPABILITIES* pCapabilities  /* [out] Receives the capabilities */
-    );
-
-extern int WIN_LoadXInputDLL(void);
-extern void WIN_UnloadXInputDLL(void);
-
-extern XInputGetState_t SDL_XInputGetState;
-extern XInputSetState_t SDL_XInputSetState;
-extern XInputGetCapabilities_t SDL_XInputGetCapabilities;
-extern DWORD SDL_XInputVersion;  /* ((major << 16) & 0xFF00) | (minor & 0xFF) */
-
-#define XINPUTGETSTATE          SDL_XInputGetState
-#define XINPUTSETSTATE          SDL_XInputSetState
-#define XINPUTGETCAPABILITIES   SDL_XInputGetCapabilities
-#define INVALID_XINPUT_USERID   XUSER_INDEX_ANY
-#define SDL_XINPUT_MAX_DEVICES  XUSER_MAX_COUNT
-
-#define MAX_INPUTS  256     /* each joystick can have up to 256 inputs */
-
-
-/* local types */
-typedef enum Type
-{ BUTTON, AXIS, HAT } Type;
-
-typedef struct input_t
-{
-    /* DirectInput offset for this input type: */
-    DWORD ofs;
-
-    /* Button, axis or hat: */
-    Type type;
-
-    /* SDL input offset: */
-    Uint8 num;
-} input_t;
-
-/* The private structure used to keep track of a joystick */
-struct joystick_hwdata
-{
-    LPDIRECTINPUTDEVICE8 InputDevice;
-    DIDEVCAPS Capabilities;
-    int buffered;
-    SDL_JoystickGUID guid;
-
-    input_t Inputs[MAX_INPUTS];
-    int NumInputs;
-    int NumSliders;
-    Uint8 removed;
-    Uint8 send_remove_event;
-    Uint8 bXInputDevice; /* 1 if this device supports using the xinput API rather than DirectInput */
-    Uint8 bXInputHaptic; /* Supports force feedback via XInput. */
-    Uint8 userid; /* XInput userid index for this joystick */
-    Uint8 currentXInputSlot; /* the current position to write to in XInputState below, used so we can compare old and new values */
-    XINPUT_STATE_EX XInputState[2];
-};
-
-#endif /* SDL_JOYSTICK_DINPUT_H */
diff --git a/deps/SDL2/src/joystick/windows/SDL_mmjoystick.c b/deps/SDL2/src/joystick/windows/SDL_mmjoystick.c
deleted file mode 100644
index e012d44..0000000
--- a/deps/SDL2/src/joystick/windows/SDL_mmjoystick.c
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_WINMM
-
-/* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */
-
-#include "../../core/windows/SDL_windows.h"
-#include <mmsystem.h>
-#include <regstr.h>
-
-#include "SDL_events.h"
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-#ifdef REGSTR_VAL_JOYOEMNAME 
-#undef REGSTR_VAL_JOYOEMNAME 
-#endif
-#define REGSTR_VAL_JOYOEMNAME "OEMName"
-
-#define MAX_JOYSTICKS   16
-#define MAX_AXES    6       /* each joystick can have up to 6 axes */
-#define MAX_BUTTONS 32      /* and 32 buttons                      */
-#define AXIS_MIN    -32768  /* minimum value for axis coordinate */
-#define AXIS_MAX    32767   /* maximum value for axis coordinate */
-/* limit axis to 256 possible positions to filter out noise */
-#define JOY_AXIS_THRESHOLD      (((AXIS_MAX)-(AXIS_MIN))/256)
-#define JOY_BUTTON_FLAG(n)  (1<<n)
-
-
-/* array to hold joystick ID values */
-static UINT SYS_JoystickID[MAX_JOYSTICKS];
-static JOYCAPSA SYS_Joystick[MAX_JOYSTICKS];
-static char *SYS_JoystickName[MAX_JOYSTICKS];
-
-/* The private structure used to keep track of a joystick */
-struct joystick_hwdata
-{
-    /* joystick ID */
-    UINT id;
-
-    /* values used to translate device-specific coordinates into
-       SDL-standard ranges */
-    struct _transaxis
-    {
-        int offset;
-        float scale;
-    } transaxis[6];
-};
-
-/* Convert a Windows Multimedia API return code to a text message */
-static void SetMMerror(char *function, int code);
-
-
-static char *
-GetJoystickName(int index, const char *szRegKey)
-{
-    /* added 7/24/2004 by Eckhard Stolberg */
-    /*
-       see if there is a joystick for the current
-       index (1-16) listed in the registry
-     */
-    char *name = NULL;
-    HKEY hTopKey;
-    HKEY hKey;
-    DWORD regsize;
-    LONG regresult;
-    char regkey[256];
-    char regvalue[256];
-    char regname[256];
-
-    SDL_snprintf(regkey, SDL_arraysize(regkey), "%s\\%s\\%s",
-                 REGSTR_PATH_JOYCONFIG, szRegKey, REGSTR_KEY_JOYCURR);
-    hTopKey = HKEY_LOCAL_MACHINE;
-    regresult = RegOpenKeyExA(hTopKey, regkey, 0, KEY_READ, &hKey);
-    if (regresult != ERROR_SUCCESS) {
-        hTopKey = HKEY_CURRENT_USER;
-        regresult = RegOpenKeyExA(hTopKey, regkey, 0, KEY_READ, &hKey);
-    }
-    if (regresult != ERROR_SUCCESS) {
-        return NULL;
-    }
-
-    /* find the registry key name for the joystick's properties */
-    regsize = sizeof(regname);
-    SDL_snprintf(regvalue, SDL_arraysize(regvalue), "Joystick%d%s", index + 1,
-                 REGSTR_VAL_JOYOEMNAME);
-    regresult =
-        RegQueryValueExA(hKey, regvalue, 0, 0, (LPBYTE) regname, &regsize);
-    RegCloseKey(hKey);
-
-    if (regresult != ERROR_SUCCESS) {
-        return NULL;
-    }
-
-    /* open that registry key */
-    SDL_snprintf(regkey, SDL_arraysize(regkey), "%s\\%s", REGSTR_PATH_JOYOEM,
-                 regname);
-    regresult = RegOpenKeyExA(hTopKey, regkey, 0, KEY_READ, &hKey);
-    if (regresult != ERROR_SUCCESS) {
-        return NULL;
-    }
-
-    /* find the size for the OEM name text */
-    regsize = sizeof(regvalue);
-    regresult =
-        RegQueryValueExA(hKey, REGSTR_VAL_JOYOEMNAME, 0, 0, NULL, &regsize);
-    if (regresult == ERROR_SUCCESS) {
-        /* allocate enough memory for the OEM name text ... */
-        name = (char *) SDL_malloc(regsize);
-        if (name) {
-            /* ... and read it from the registry */
-            regresult = RegQueryValueExA(hKey,
-                                         REGSTR_VAL_JOYOEMNAME, 0, 0,
-                                         (LPBYTE) name, &regsize);
-        }
-    }
-    RegCloseKey(hKey);
-
-    return (name);
-}
-
-static int SDL_SYS_numjoysticks = 0;
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int
-SDL_SYS_JoystickInit(void)
-{
-    int i;
-    int maxdevs;
-    JOYINFOEX joyinfo;
-    JOYCAPSA joycaps;
-    MMRESULT result;
-
-    /* Reset the joystick ID & name mapping tables */
-    for (i = 0; i < MAX_JOYSTICKS; ++i) {
-        SYS_JoystickID[i] = 0;
-        SYS_JoystickName[i] = NULL;
-    }
-
-    /* Loop over all potential joystick devices */
-    SDL_SYS_numjoysticks = 0;
-    maxdevs = joyGetNumDevs();
-    for (i = JOYSTICKID1; i < maxdevs && SDL_SYS_numjoysticks < MAX_JOYSTICKS; ++i) {
-
-        joyinfo.dwSize = sizeof(joyinfo);
-        joyinfo.dwFlags = JOY_RETURNALL;
-        result = joyGetPosEx(i, &joyinfo);
-        if (result == JOYERR_NOERROR) {
-            result = joyGetDevCapsA(i, &joycaps, sizeof(joycaps));
-            if (result == JOYERR_NOERROR) {
-                SYS_JoystickID[SDL_SYS_numjoysticks] = i;
-                SYS_Joystick[SDL_SYS_numjoysticks] = joycaps;
-                SYS_JoystickName[SDL_SYS_numjoysticks] =
-                    GetJoystickName(i, joycaps.szRegKey);
-                SDL_SYS_numjoysticks++;
-            }
-        }
-    }
-    return (SDL_SYS_numjoysticks);
-}
-
-int SDL_SYS_NumJoysticks()
-{
-    return SDL_SYS_numjoysticks;
-}
-
-void SDL_SYS_JoystickDetect()
-{
-}
-
-SDL_bool SDL_SYS_JoystickNeedsPolling()
-{
-    return SDL_FALSE;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *
-SDL_SYS_JoystickNameForDeviceIndex(int device_index)
-{
-    if (SYS_JoystickName[device_index] != NULL) {
-        return (SYS_JoystickName[device_index]);
-    } else {
-        return (SYS_Joystick[device_index].szPname);
-    }
-}
-
-/* Function to perform the mapping from device index to the instance id for this index */
-SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
-{
-    return device_index;
-}
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
-{
-    int index, i;
-    int caps_flags[MAX_AXES - 2] =
-        { JOYCAPS_HASZ, JOYCAPS_HASR, JOYCAPS_HASU, JOYCAPS_HASV };
-    int axis_min[MAX_AXES], axis_max[MAX_AXES];
-
-
-    /* shortcut */
-    index = device_index;
-    axis_min[0] = SYS_Joystick[index].wXmin;
-    axis_max[0] = SYS_Joystick[index].wXmax;
-    axis_min[1] = SYS_Joystick[index].wYmin;
-    axis_max[1] = SYS_Joystick[index].wYmax;
-    axis_min[2] = SYS_Joystick[index].wZmin;
-    axis_max[2] = SYS_Joystick[index].wZmax;
-    axis_min[3] = SYS_Joystick[index].wRmin;
-    axis_max[3] = SYS_Joystick[index].wRmax;
-    axis_min[4] = SYS_Joystick[index].wUmin;
-    axis_max[4] = SYS_Joystick[index].wUmax;
-    axis_min[5] = SYS_Joystick[index].wVmin;
-    axis_max[5] = SYS_Joystick[index].wVmax;
-
-    /* allocate memory for system specific hardware data */
-    joystick->instance_id = device_index;
-    joystick->hwdata =
-        (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
-    if (joystick->hwdata == NULL) {
-        return SDL_OutOfMemory();
-    }
-    SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
-
-    /* set hardware data */
-    joystick->hwdata->id = SYS_JoystickID[index];
-    for (i = 0; i < MAX_AXES; ++i) {
-        if ((i < 2) || (SYS_Joystick[index].wCaps & caps_flags[i - 2])) {
-            joystick->hwdata->transaxis[i].offset = AXIS_MIN - axis_min[i];
-            joystick->hwdata->transaxis[i].scale =
-                (float) (AXIS_MAX - AXIS_MIN) / (axis_max[i] - axis_min[i]);
-        } else {
-            joystick->hwdata->transaxis[i].offset = 0;
-            joystick->hwdata->transaxis[i].scale = 1.0; /* Just in case */
-        }
-    }
-
-    /* fill nbuttons, naxes, and nhats fields */
-    joystick->nbuttons = SYS_Joystick[index].wNumButtons;
-    joystick->naxes = SYS_Joystick[index].wNumAxes;
-    if (SYS_Joystick[index].wCaps & JOYCAPS_HASPOV) {
-        joystick->nhats = 1;
-    } else {
-        joystick->nhats = 0;
-    }
-    return (0);
-}
-
-/* Function to determine is this joystick is attached to the system right now */
-SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
-{
-    return SDL_TRUE;
-}
-
-static Uint8
-TranslatePOV(DWORD value)
-{
-    Uint8 pos;
-
-    pos = SDL_HAT_CENTERED;
-    if (value != JOY_POVCENTERED) {
-        if ((value > JOY_POVLEFT) || (value < JOY_POVRIGHT)) {
-            pos |= SDL_HAT_UP;
-        }
-        if ((value > JOY_POVFORWARD) && (value < JOY_POVBACKWARD)) {
-            pos |= SDL_HAT_RIGHT;
-        }
-        if ((value > JOY_POVRIGHT) && (value < JOY_POVLEFT)) {
-            pos |= SDL_HAT_DOWN;
-        }
-        if (value > JOY_POVBACKWARD) {
-            pos |= SDL_HAT_LEFT;
-        }
-    }
-    return (pos);
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-{
-    MMRESULT result;
-    int i;
-    DWORD flags[MAX_AXES] = { JOY_RETURNX, JOY_RETURNY, JOY_RETURNZ,
-        JOY_RETURNR, JOY_RETURNU, JOY_RETURNV
-    };
-    DWORD pos[MAX_AXES];
-    struct _transaxis *transaxis;
-    int value, change;
-    JOYINFOEX joyinfo;
-
-    joyinfo.dwSize = sizeof(joyinfo);
-    joyinfo.dwFlags = JOY_RETURNALL | JOY_RETURNPOVCTS;
-    if (!joystick->hats) {
-        joyinfo.dwFlags &= ~(JOY_RETURNPOV | JOY_RETURNPOVCTS);
-    }
-    result = joyGetPosEx(joystick->hwdata->id, &joyinfo);
-    if (result != JOYERR_NOERROR) {
-        SetMMerror("joyGetPosEx", result);
-        return;
-    }
-
-    /* joystick motion events */
-    pos[0] = joyinfo.dwXpos;
-    pos[1] = joyinfo.dwYpos;
-    pos[2] = joyinfo.dwZpos;
-    pos[3] = joyinfo.dwRpos;
-    pos[4] = joyinfo.dwUpos;
-    pos[5] = joyinfo.dwVpos;
-
-    transaxis = joystick->hwdata->transaxis;
-    for (i = 0; i < joystick->naxes; i++) {
-        if (joyinfo.dwFlags & flags[i]) {
-            value =
-                (int) (((float) pos[i] +
-                        transaxis[i].offset) * transaxis[i].scale);
-            change = (value - joystick->axes[i]);
-            if ((change < -JOY_AXIS_THRESHOLD)
-                || (change > JOY_AXIS_THRESHOLD)) {
-                SDL_PrivateJoystickAxis(joystick, (Uint8) i, (Sint16) value);
-            }
-        }
-    }
-
-    /* joystick button events */
-    if (joyinfo.dwFlags & JOY_RETURNBUTTONS) {
-        for (i = 0; i < joystick->nbuttons; ++i) {
-            if (joyinfo.dwButtons & JOY_BUTTON_FLAG(i)) {
-                if (!joystick->buttons[i]) {
-                    SDL_PrivateJoystickButton(joystick, (Uint8) i,
-                                              SDL_PRESSED);
-                }
-            } else {
-                if (joystick->buttons[i]) {
-                    SDL_PrivateJoystickButton(joystick, (Uint8) i,
-                                              SDL_RELEASED);
-                }
-            }
-        }
-    }
-
-    /* joystick hat events */
-    if (joyinfo.dwFlags & JOY_RETURNPOV) {
-        Uint8 pos;
-
-        pos = TranslatePOV(joyinfo.dwPOV);
-        if (pos != joystick->hats[0]) {
-            SDL_PrivateJoystickHat(joystick, 0, pos);
-        }
-    }
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-{
-    /* free system specific hardware data */
-    SDL_free(joystick->hwdata);
-    joystick->hwdata = NULL;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void
-SDL_SYS_JoystickQuit(void)
-{
-    int i;
-    for (i = 0; i < MAX_JOYSTICKS; i++) {
-        SDL_free(SYS_JoystickName[i]);
-        SYS_JoystickName[i] = NULL;
-    }
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
-{
-    SDL_JoystickGUID guid;
-    /* the GUID is just the first 16 chars of the name for now */
-    const char *name = joystick->name;
-    SDL_zero( guid );
-    SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
-    return guid;
-}
-
-
-/* implementation functions */
-void
-SetMMerror(char *function, int code)
-{
-    static char *error;
-    static char errbuf[1024];
-
-    errbuf[0] = 0;
-    switch (code) {
-    case MMSYSERR_NODRIVER:
-        error = "Joystick driver not present";
-        break;
-
-    case MMSYSERR_INVALPARAM:
-    case JOYERR_PARMS:
-        error = "Invalid parameter(s)";
-        break;
-
-    case MMSYSERR_BADDEVICEID:
-        error = "Bad device ID";
-        break;
-
-    case JOYERR_UNPLUGGED:
-        error = "Joystick not attached";
-        break;
-
-    case JOYERR_NOCANDO:
-        error = "Can't capture joystick input";
-        break;
-
-    default:
-        SDL_snprintf(errbuf, SDL_arraysize(errbuf),
-                     "%s: Unknown Multimedia system error: 0x%x",
-                     function, code);
-        break;
-    }
-
-    if (!errbuf[0]) {
-        SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function,
-                     error);
-    }
-    SDL_SetError("%s", errbuf);
-}
-
-#endif /* SDL_JOYSTICK_WINMM */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/libm/e_atan2.c b/deps/SDL2/src/libm/e_atan2.c
deleted file mode 100644
index f7b91a3..0000000
--- a/deps/SDL2/src/libm/e_atan2.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* __ieee754_atan2(y,x)
- * Method :
- *	1. Reduce y to positive by atan2(y,x)=-atan2(-y,x).
- *	2. Reduce x to positive by (if x and y are unexceptional):
- *		ARG (x+iy) = arctan(y/x)   	   ... if x > 0,
- *		ARG (x+iy) = pi - arctan[y/(-x)]   ... if x < 0,
- *
- * Special cases:
- *
- *	ATAN2((anything), NaN ) is NaN;
- *	ATAN2(NAN , (anything) ) is NaN;
- *	ATAN2(+-0, +(anything but NaN)) is +-0  ;
- *	ATAN2(+-0, -(anything but NaN)) is +-pi ;
- *	ATAN2(+-(anything but 0 and NaN), 0) is +-pi/2;
- *	ATAN2(+-(anything but INF and NaN), +INF) is +-0 ;
- *	ATAN2(+-(anything but INF and NaN), -INF) is +-pi;
- *	ATAN2(+-INF,+INF ) is +-pi/4 ;
- *	ATAN2(+-INF,-INF ) is +-3pi/4;
- *	ATAN2(+-INF, (anything but,0,NaN, and INF)) is +-pi/2;
- *
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-static const double
-tiny  = 1.0e-300,
-zero  = 0.0,
-pi_o_4  = 7.8539816339744827900E-01, /* 0x3FE921FB, 0x54442D18 */
-pi_o_2  = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */
-pi      = 3.1415926535897931160E+00, /* 0x400921FB, 0x54442D18 */
-pi_lo   = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
-
-double attribute_hidden __ieee754_atan2(double y, double x)
-{
-	double z;
-	int32_t k,m,hx,hy,ix,iy;
-	u_int32_t lx,ly;
-
-	EXTRACT_WORDS(hx,lx,x);
-	ix = hx&0x7fffffff;
-	EXTRACT_WORDS(hy,ly,y);
-	iy = hy&0x7fffffff;
-	if(((ix|((lx|-(int32_t)lx)>>31))>0x7ff00000)||
-	   ((iy|((ly|-(int32_t)ly)>>31))>0x7ff00000))	/* x or y is NaN */
-	   return x+y;
-	if(((hx-0x3ff00000)|lx)==0) return atan(y);   /* x=1.0 */
-	m = ((hy>>31)&1)|((hx>>30)&2);	/* 2*sign(x)+sign(y) */
-
-    /* when y = 0 */
-	if((iy|ly)==0) {
-	    switch(m) {
-		case 0:
-		case 1: return y; 	/* atan(+-0,+anything)=+-0 */
-		case 2: return  pi+tiny;/* atan(+0,-anything) = pi */
-		case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */
-	    }
-	}
-    /* when x = 0 */
-	if((ix|lx)==0) return (hy<0)?  -pi_o_2-tiny: pi_o_2+tiny;
-
-    /* when x is INF */
-	if(ix==0x7ff00000) {
-	    if(iy==0x7ff00000) {
-		switch(m) {
-		    case 0: return  pi_o_4+tiny;/* atan(+INF,+INF) */
-		    case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */
-		    case 2: return  3.0*pi_o_4+tiny;/* atan(+INF,-INF) */
-		    case 3: return -3.0*pi_o_4-tiny;/* atan(-INF,-INF) */
-		}
-	    } else {
-		switch(m) {
-		    case 0: return  zero  ;	/* atan(+...,+INF) */
-		    case 1: return -zero  ;	/* atan(-...,+INF) */
-		    case 2: return  pi+tiny  ;	/* atan(+...,-INF) */
-		    case 3: return -pi-tiny  ;	/* atan(-...,-INF) */
-		}
-	    }
-	}
-    /* when y is INF */
-	if(iy==0x7ff00000) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
-
-    /* compute y/x */
-	k = (iy-ix)>>20;
-	if(k > 60) z=pi_o_2+0.5*pi_lo; 	/* |y/x| >  2**60 */
-	else if(hx<0&&k<-60) z=0.0; 	/* |y|/x < -2**60 */
-	else z=atan(fabs(y/x));		/* safe to do y/x */
-	switch (m) {
-	    case 0: return       z  ;	/* atan(+,+) */
-	    case 1: {
-	    	      u_int32_t zh;
-		      GET_HIGH_WORD(zh,z);
-		      SET_HIGH_WORD(z,zh ^ 0x80000000);
-		    }
-		    return       z  ;	/* atan(-,+) */
-	    case 2: return  pi-(z-pi_lo);/* atan(+,-) */
-	    default: /* case 3 */
-	    	    return  (z-pi_lo)-pi;/* atan(-,-) */
-	}
-}
diff --git a/deps/SDL2/src/libm/e_log.c b/deps/SDL2/src/libm/e_log.c
deleted file mode 100644
index da64138..0000000
--- a/deps/SDL2/src/libm/e_log.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/* @(#)e_log.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: e_log.c,v 1.8 1995/05/10 20:45:49 jtc Exp $";
-#endif
-
-/* __ieee754_log(x)
- * Return the logrithm of x
- *
- * Method :
- *   1. Argument Reduction: find k and f such that
- *			x = 2^k * (1+f),
- *	   where  sqrt(2)/2 < 1+f < sqrt(2) .
- *
- *   2. Approximation of log(1+f).
- *	Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
- *		 = 2s + 2/3 s**3 + 2/5 s**5 + .....,
- *	     	 = 2s + s*R
- *      We use a special Reme algorithm on [0,0.1716] to generate
- * 	a polynomial of degree 14 to approximate R The maximum error
- *	of this polynomial approximation is bounded by 2**-58.45. In
- *	other words,
- *		        2      4      6      8      10      12      14
- *	    R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s  +Lg6*s  +Lg7*s
- *  	(the values of Lg1 to Lg7 are listed in the program)
- *	and
- *	    |      2          14          |     -58.45
- *	    | Lg1*s +...+Lg7*s    -  R(z) | <= 2
- *	    |                             |
- *	Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
- *	In order to guarantee error in log below 1ulp, we compute log
- *	by
- *		log(1+f) = f - s*(f - R)	(if f is not too large)
- *		log(1+f) = f - (hfsq - s*(hfsq+R)).	(better accuracy)
- *
- *	3. Finally,  log(x) = k*ln2 + log(1+f).
- *			    = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
- *	   Here ln2 is split into two floating point number:
- *			ln2_hi + ln2_lo,
- *	   where n*ln2_hi is always exact for |n| < 2000.
- *
- * Special cases:
- *	log(x) is NaN with signal if x < 0 (including -INF) ;
- *	log(+INF) is +INF; log(0) is -INF with signal;
- *	log(NaN) is that NaN with no signal.
- *
- * Accuracy:
- *	according to an error analysis, the error is always less than
- *	1 ulp (unit in the last place).
- *
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-  ln2_hi = 6.93147180369123816490e-01,  /* 3fe62e42 fee00000 */
-    ln2_lo = 1.90821492927058770002e-10,        /* 3dea39ef 35793c76 */
-    two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
-    Lg1 = 6.666666666666735130e-01,     /* 3FE55555 55555593 */
-    Lg2 = 3.999999999940941908e-01,     /* 3FD99999 9997FA04 */
-    Lg3 = 2.857142874366239149e-01,     /* 3FD24924 94229359 */
-    Lg4 = 2.222219843214978396e-01,     /* 3FCC71C5 1D8E78AF */
-    Lg5 = 1.818357216161805012e-01,     /* 3FC74664 96CB03DE */
-    Lg6 = 1.531383769920937332e-01,     /* 3FC39A09 D078C69F */
-    Lg7 = 1.479819860511658591e-01;     /* 3FC2F112 DF3E5244 */
-
-#ifdef __STDC__
-static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
-
-#ifdef __STDC__
-double attribute_hidden
-__ieee754_log(double x)
-#else
-double attribute_hidden
-__ieee754_log(x)
-     double x;
-#endif
-{
-    double hfsq, f, s, z, R, w, t1, t2, dk;
-    int32_t k, hx, i, j;
-    u_int32_t lx;
-
-    EXTRACT_WORDS(hx, lx, x);
-
-    k = 0;
-    if (hx < 0x00100000) {      /* x < 2**-1022  */
-        if (((hx & 0x7fffffff) | lx) == 0)
-            return -two54 / zero;       /* log(+-0)=-inf */
-        if (hx < 0)
-            return (x - x) / zero;      /* log(-#) = NaN */
-        k -= 54;
-        x *= two54;             /* subnormal number, scale up x */
-        GET_HIGH_WORD(hx, x);
-    }
-    if (hx >= 0x7ff00000)
-        return x + x;
-    k += (hx >> 20) - 1023;
-    hx &= 0x000fffff;
-    i = (hx + 0x95f64) & 0x100000;
-    SET_HIGH_WORD(x, hx | (i ^ 0x3ff00000));    /* normalize x or x/2 */
-    k += (i >> 20);
-    f = x - 1.0;
-    if ((0x000fffff & (2 + hx)) < 3) {  /* |f| < 2**-20 */
-        if (f == zero) {
-            if (k == 0)
-                return zero;
-            else {
-                dk = (double) k;
-                return dk * ln2_hi + dk * ln2_lo;
-            }
-        }
-        R = f * f * (0.5 - 0.33333333333333333 * f);
-        if (k == 0)
-            return f - R;
-        else {
-            dk = (double) k;
-            return dk * ln2_hi - ((R - dk * ln2_lo) - f);
-        }
-    }
-    s = f / (2.0 + f);
-    dk = (double) k;
-    z = s * s;
-    i = hx - 0x6147a;
-    w = z * z;
-    j = 0x6b851 - hx;
-    t1 = w * (Lg2 + w * (Lg4 + w * Lg6));
-    t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));
-    i |= j;
-    R = t2 + t1;
-    if (i > 0) {
-        hfsq = 0.5 * f * f;
-        if (k == 0)
-            return f - (hfsq - s * (hfsq + R));
-        else
-            return dk * ln2_hi - ((hfsq - (s * (hfsq + R) + dk * ln2_lo)) -
-                                  f);
-    } else {
-        if (k == 0)
-            return f - s * (f - R);
-        else
-            return dk * ln2_hi - ((s * (f - R) - dk * ln2_lo) - f);
-    }
-}
diff --git a/deps/SDL2/src/libm/e_pow.c b/deps/SDL2/src/libm/e_pow.c
deleted file mode 100644
index 686da2e..0000000
--- a/deps/SDL2/src/libm/e_pow.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/* @(#)e_pow.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_pow.c,v 1.9 1995/05/12 04:57:32 jtc Exp $";
-#endif
-
-/* __ieee754_pow(x,y) return x**y
- *
- *		      n
- * Method:  Let x =  2   * (1+f)
- *	1. Compute and return log2(x) in two pieces:
- *		log2(x) = w1 + w2,
- *	   where w1 has 53-24 = 29 bit trailing zeros.
- *	2. Perform y*log2(x) = n+y' by simulating muti-precision
- *	   arithmetic, where |y'|<=0.5.
- *	3. Return x**y = 2**n*exp(y'*log2)
- *
- * Special cases:
- *	1.  (anything) ** 0  is 1
- *	2.  (anything) ** 1  is itself
- *	3.  (anything) ** NAN is NAN
- *	4.  NAN ** (anything except 0) is NAN
- *	5.  +-(|x| > 1) **  +INF is +INF
- *	6.  +-(|x| > 1) **  -INF is +0
- *	7.  +-(|x| < 1) **  +INF is +0
- *	8.  +-(|x| < 1) **  -INF is +INF
- *	9.  +-1         ** +-INF is NAN
- *	10. +0 ** (+anything except 0, NAN)               is +0
- *	11. -0 ** (+anything except 0, NAN, odd integer)  is +0
- *	12. +0 ** (-anything except 0, NAN)               is +INF
- *	13. -0 ** (-anything except 0, NAN, odd integer)  is +INF
- *	14. -0 ** (odd integer) = -( +0 ** (odd integer) )
- *	15. +INF ** (+anything except 0,NAN) is +INF
- *	16. +INF ** (-anything except 0,NAN) is +0
- *	17. -INF ** (anything)  = -0 ** (-anything)
- *	18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer)
- *	19. (-anything except 0 and inf) ** (non-integer) is NAN
- *
- * Accuracy:
- *	pow(x,y) returns x**y nearly rounded. In particular
- *			pow(integer,integer)
- *	always returns the correct integer provided it is
- *	representable.
- *
- * Constants :
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(scalbn)
-    libm_hidden_proto(fabs)
-#ifdef __STDC__
-     static const double
-#else
-     static double
-#endif
-       bp[] = { 1.0, 1.5, }, dp_h[] = {
-     0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */
-
-         dp_l[] = {
-     0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */
-
-         zero = 0.0, one = 1.0, two = 2.0, two53 = 9007199254740992.0,  /* 0x43400000, 0x00000000 */
-         huge_val = 1.0e300, tiny = 1.0e-300,
-         /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */
-         L1 = 5.99999999999994648725e-01,       /* 0x3FE33333, 0x33333303 */
-         L2 = 4.28571428578550184252e-01,       /* 0x3FDB6DB6, 0xDB6FABFF */
-         L3 = 3.33333329818377432918e-01,       /* 0x3FD55555, 0x518F264D */
-         L4 = 2.72728123808534006489e-01,       /* 0x3FD17460, 0xA91D4101 */
-         L5 = 2.30660745775561754067e-01,       /* 0x3FCD864A, 0x93C9DB65 */
-         L6 = 2.06975017800338417784e-01,       /* 0x3FCA7E28, 0x4A454EEF */
-         P1 = 1.66666666666666019037e-01,       /* 0x3FC55555, 0x5555553E */
-         P2 = -2.77777777770155933842e-03,      /* 0xBF66C16C, 0x16BEBD93 */
-         P3 = 6.61375632143793436117e-05,       /* 0x3F11566A, 0xAF25DE2C */
-         P4 = -1.65339022054652515390e-06,      /* 0xBEBBBD41, 0xC5D26BF1 */
-         P5 = 4.13813679705723846039e-08,       /* 0x3E663769, 0x72BEA4D0 */
-         lg2 = 6.93147180559945286227e-01,      /* 0x3FE62E42, 0xFEFA39EF */
-         lg2_h = 6.93147182464599609375e-01,    /* 0x3FE62E43, 0x00000000 */
-         lg2_l = -1.90465429995776804525e-09,   /* 0xBE205C61, 0x0CA86C39 */
-         ovt = 8.0085662595372944372e-0017,     /* -(1024-log2(ovfl+.5ulp)) */
-         cp = 9.61796693925975554329e-01,       /* 0x3FEEC709, 0xDC3A03FD =2/(3ln2) */
-         cp_h = 9.61796700954437255859e-01,     /* 0x3FEEC709, 0xE0000000 =(float)cp */
-         cp_l = -7.02846165095275826516e-09,    /* 0xBE3E2FE0, 0x145B01F5 =tail of cp_h */
-         ivln2 = 1.44269504088896338700e+00,    /* 0x3FF71547, 0x652B82FE =1/ln2 */
-         ivln2_h = 1.44269502162933349609e+00,  /* 0x3FF71547, 0x60000000 =24b 1/ln2 */
-         ivln2_l = 1.92596299112661746887e-08;  /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail */
-
-#ifdef __STDC__
-     double attribute_hidden __ieee754_pow(double x, double y)
-#else
-     double attribute_hidden __ieee754_pow(x, y)
-     double x, y;
-#endif
-     {
-         double z, ax, z_h, z_l, p_h, p_l;
-         double y1, t1, t2, r, s, t, u, v, w;
-         int32_t i, j, k, yisint, n;
-         int32_t hx, hy, ix, iy;
-         u_int32_t lx, ly;
-
-         EXTRACT_WORDS(hx, lx, x);
-         EXTRACT_WORDS(hy, ly, y);
-         ix = hx & 0x7fffffff;
-         iy = hy & 0x7fffffff;
-
-         /* y==zero: x**0 = 1 */
-         if ((iy | ly) == 0)
-             return one;
-
-         /* +-NaN return x+y */
-         if (ix > 0x7ff00000 || ((ix == 0x7ff00000) && (lx != 0)) ||
-             iy > 0x7ff00000 || ((iy == 0x7ff00000) && (ly != 0)))
-             return x + y;
-
-         /* determine if y is an odd int when x < 0
-          * yisint = 0       ... y is not an integer
-          * yisint = 1       ... y is an odd int
-          * yisint = 2       ... y is an even int
-          */
-         yisint = 0;
-         if (hx < 0) {
-             if (iy >= 0x43400000)
-                 yisint = 2;    /* even integer y */
-             else if (iy >= 0x3ff00000) {
-                 k = (iy >> 20) - 0x3ff;        /* exponent */
-                 if (k > 20) {
-                     j = ly >> (52 - k);
-                     if ((j << (52 - k)) == ly)
-                         yisint = 2 - (j & 1);
-                 } else if (ly == 0) {
-                     j = iy >> (20 - k);
-                     if ((j << (20 - k)) == iy)
-                         yisint = 2 - (j & 1);
-                 }
-             }
-         }
-
-         /* special value of y */
-         if (ly == 0) {
-             if (iy == 0x7ff00000) {    /* y is +-inf */
-                 if (((ix - 0x3ff00000) | lx) == 0)
-                     return y - y;      /* inf**+-1 is NaN */
-                 else if (ix >= 0x3ff00000)     /* (|x|>1)**+-inf = inf,0 */
-                     return (hy >= 0) ? y : zero;
-                 else           /* (|x|<1)**-,+inf = inf,0 */
-                     return (hy < 0) ? -y : zero;
-             }
-             if (iy == 0x3ff00000) {    /* y is  +-1 */
-                 if (hy < 0)
-                     return one / x;
-                 else
-                     return x;
-             }
-             if (hy == 0x40000000)
-                 return x * x;  /* y is  2 */
-             if (hy == 0x3fe00000) {    /* y is  0.5 */
-                 if (hx >= 0)   /* x >= +0 */
-                     return __ieee754_sqrt(x);
-             }
-         }
-
-         ax = fabs(x);
-         /* special value of x */
-         if (lx == 0) {
-             if (ix == 0x7ff00000 || ix == 0 || ix == 0x3ff00000) {
-                 z = ax;        /* x is +-0,+-inf,+-1 */
-                 if (hy < 0)
-                     z = one / z;       /* z = (1/|x|) */
-                 if (hx < 0) {
-                     if (((ix - 0x3ff00000) | yisint) == 0) {
-                         z = (z - z) / (z - z); /* (-1)**non-int is NaN */
-                     } else if (yisint == 1)
-                         z = -z;        /* (x<0)**odd = -(|x|**odd) */
-                 }
-                 return z;
-             }
-         }
-
-         /* (x<0)**(non-int) is NaN */
-         if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0)
-             return (x - x) / (x - x);
-
-         /* |y| is huge */
-         if (iy > 0x41e00000) { /* if |y| > 2**31 */
-             if (iy > 0x43f00000) {     /* if |y| > 2**64, must o/uflow */
-                 if (ix <= 0x3fefffff)
-                     return (hy < 0) ? huge_val * huge_val : tiny * tiny;
-                 if (ix >= 0x3ff00000)
-                     return (hy > 0) ? huge_val * huge_val : tiny * tiny;
-             }
-             /* over/underflow if x is not close to one */
-             if (ix < 0x3fefffff)
-                 return (hy < 0) ? huge_val * huge_val : tiny * tiny;
-             if (ix > 0x3ff00000)
-                 return (hy > 0) ? huge_val * huge_val : tiny * tiny;
-             /* now |1-x| is tiny <= 2**-20, suffice to compute
-                log(x) by x-x^2/2+x^3/3-x^4/4 */
-             t = x - 1;         /* t has 20 trailing zeros */
-             w = (t * t) * (0.5 - t * (0.3333333333333333333333 - t * 0.25));
-             u = ivln2_h * t;   /* ivln2_h has 21 sig. bits */
-             v = t * ivln2_l - w * ivln2;
-             t1 = u + v;
-             SET_LOW_WORD(t1, 0);
-             t2 = v - (t1 - u);
-         } else {
-             double s2, s_h, s_l, t_h, t_l;
-             n = 0;
-             /* take care subnormal number */
-             if (ix < 0x00100000) {
-                 ax *= two53;
-                 n -= 53;
-                 GET_HIGH_WORD(ix, ax);
-             }
-             n += ((ix) >> 20) - 0x3ff;
-             j = ix & 0x000fffff;
-             /* determine interval */
-             ix = j | 0x3ff00000;       /* normalize ix */
-             if (j <= 0x3988E)
-                 k = 0;         /* |x|<sqrt(3/2) */
-             else if (j < 0xBB67A)
-                 k = 1;         /* |x|<sqrt(3)   */
-             else {
-                 k = 0;
-                 n += 1;
-                 ix -= 0x00100000;
-             }
-             SET_HIGH_WORD(ax, ix);
-
-             /* compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */
-             u = ax - bp[k];    /* bp[0]=1.0, bp[1]=1.5 */
-             v = one / (ax + bp[k]);
-             s = u * v;
-             s_h = s;
-             SET_LOW_WORD(s_h, 0);
-             /* t_h=ax+bp[k] High */
-             t_h = zero;
-             SET_HIGH_WORD(t_h,
-                           ((ix >> 1) | 0x20000000) + 0x00080000 + (k << 18));
-             t_l = ax - (t_h - bp[k]);
-             s_l = v * ((u - s_h * t_h) - s_h * t_l);
-             /* compute log(ax) */
-             s2 = s * s;
-             r = s2 * s2 * (L1 +
-                            s2 * (L2 +
-                                  s2 * (L3 +
-                                        s2 * (L4 + s2 * (L5 + s2 * L6)))));
-             r += s_l * (s_h + s);
-             s2 = s_h * s_h;
-             t_h = 3.0 + s2 + r;
-             SET_LOW_WORD(t_h, 0);
-             t_l = r - ((t_h - 3.0) - s2);
-             /* u+v = s*(1+...) */
-             u = s_h * t_h;
-             v = s_l * t_h + t_l * s;
-             /* 2/(3log2)*(s+...) */
-             p_h = u + v;
-             SET_LOW_WORD(p_h, 0);
-             p_l = v - (p_h - u);
-             z_h = cp_h * p_h;  /* cp_h+cp_l = 2/(3*log2) */
-             z_l = cp_l * p_h + p_l * cp + dp_l[k];
-             /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */
-             t = (double) n;
-             t1 = (((z_h + z_l) + dp_h[k]) + t);
-             SET_LOW_WORD(t1, 0);
-             t2 = z_l - (((t1 - t) - dp_h[k]) - z_h);
-         }
-
-         s = one;               /* s (sign of result -ve**odd) = -1 else = 1 */
-         if (((((u_int32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
-             s = -one;          /* (-ve)**(odd int) */
-
-         /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
-         y1 = y;
-         SET_LOW_WORD(y1, 0);
-         p_l = (y - y1) * t1 + y * t2;
-         p_h = y1 * t1;
-         z = p_l + p_h;
-         EXTRACT_WORDS(j, i, z);
-         if (j >= 0x40900000) { /* z >= 1024 */
-             if (((j - 0x40900000) | i) != 0)   /* if z > 1024 */
-                 return s * huge_val * huge_val;        /* overflow */
-             else {
-                 if (p_l + ovt > z - p_h)
-                     return s * huge_val * huge_val;    /* overflow */
-             }
-         } else if ((j & 0x7fffffff) >= 0x4090cc00) {   /* z <= -1075 */
-             if (((j - 0xc090cc00) | i) != 0)   /* z < -1075 */
-                 return s * tiny * tiny;        /* underflow */
-             else {
-                 if (p_l <= z - p_h)
-                     return s * tiny * tiny;    /* underflow */
-             }
-         }
-         /*
-          * compute 2**(p_h+p_l)
-          */
-         i = j & 0x7fffffff;
-         k = (i >> 20) - 0x3ff;
-         n = 0;
-         if (i > 0x3fe00000) {  /* if |z| > 0.5, set n = [z+0.5] */
-             n = j + (0x00100000 >> (k + 1));
-             k = ((n & 0x7fffffff) >> 20) - 0x3ff;      /* new k for n */
-             t = zero;
-             SET_HIGH_WORD(t, n & ~(0x000fffff >> k));
-             n = ((n & 0x000fffff) | 0x00100000) >> (20 - k);
-             if (j < 0)
-                 n = -n;
-             p_h -= t;
-         }
-         t = p_l + p_h;
-         SET_LOW_WORD(t, 0);
-         u = t * lg2_h;
-         v = (p_l - (t - p_h)) * lg2 + t * lg2_l;
-         z = u + v;
-         w = v - (z - u);
-         t = z * z;
-         t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));
-         r = (z * t1) / (t1 - two) - (w + z * w);
-         z = one - (r - z);
-         GET_HIGH_WORD(j, z);
-         j += (n << 20);
-         if ((j >> 20) <= 0)
-             z = scalbn(z, n);  /* subnormal output */
-         else
-             SET_HIGH_WORD(z, j);
-         return s * z;
-     }
diff --git a/deps/SDL2/src/libm/e_rem_pio2.c b/deps/SDL2/src/libm/e_rem_pio2.c
deleted file mode 100644
index a8ffe31..0000000
--- a/deps/SDL2/src/libm/e_rem_pio2.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/* @(#)e_rem_pio2.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: e_rem_pio2.c,v 1.8 1995/05/10 20:46:02 jtc Exp $";
-#endif
-
-/* __ieee754_rem_pio2(x,y)
- *
- * return the remainder of x rem pi/2 in y[0]+y[1]
- * use __kernel_rem_pio2()
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(fabs)
-
-/*
- * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
- */
-#ifdef __STDC__
-     static const int32_t two_over_pi[] = {
-#else
-     static int32_t two_over_pi[] = {
-#endif
-         0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62,
-         0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A,
-         0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129,
-         0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41,
-         0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8,
-         0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF,
-         0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5,
-         0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08,
-         0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3,
-         0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880,
-         0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B,
-     };
-
-#ifdef __STDC__
-static const int32_t npio2_hw[] = {
-#else
-static int32_t npio2_hw[] = {
-#endif
-    0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C,
-    0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C,
-    0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A,
-    0x403DD85A, 0x403F6A7A, 0x40407E4C, 0x4041475C, 0x4042106C, 0x4042D97C,
-    0x4043A28C, 0x40446B9C, 0x404534AC, 0x4045FDBB, 0x4046C6CB, 0x40478FDB,
-    0x404858EB, 0x404921FB,
-};
-
-/*
- * invpio2:  53 bits of 2/pi
- * pio2_1:   first  33 bit of pi/2
- * pio2_1t:  pi/2 - pio2_1
- * pio2_2:   second 33 bit of pi/2
- * pio2_2t:  pi/2 - (pio2_1+pio2_2)
- * pio2_3:   third  33 bit of pi/2
- * pio2_3t:  pi/2 - (pio2_1+pio2_2+pio2_3)
- */
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-  zero = 0.00000000000000000000e+00,    /* 0x00000000, 0x00000000 */
-    half = 5.00000000000000000000e-01,  /* 0x3FE00000, 0x00000000 */
-    two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
-    invpio2 = 6.36619772367581382433e-01,       /* 0x3FE45F30, 0x6DC9C883 */
-    pio2_1 = 1.57079632673412561417e+00,        /* 0x3FF921FB, 0x54400000 */
-    pio2_1t = 6.07710050650619224932e-11,       /* 0x3DD0B461, 0x1A626331 */
-    pio2_2 = 6.07710050630396597660e-11,        /* 0x3DD0B461, 0x1A600000 */
-    pio2_2t = 2.02226624879595063154e-21,       /* 0x3BA3198A, 0x2E037073 */
-    pio2_3 = 2.02226624871116645580e-21,        /* 0x3BA3198A, 0x2E000000 */
-    pio2_3t = 8.47842766036889956997e-32;       /* 0x397B839A, 0x252049C1 */
-
-#ifdef __STDC__
-int32_t attribute_hidden
-__ieee754_rem_pio2(double x, double *y)
-#else
-int32_t attribute_hidden
-__ieee754_rem_pio2(x, y)
-     double x, y[];
-#endif
-{
-    double z = 0.0, w, t, r, fn;
-    double tx[3];
-    int32_t e0, i, j, nx, n, ix, hx;
-    u_int32_t low;
-
-    GET_HIGH_WORD(hx, x);       /* high word of x */
-    ix = hx & 0x7fffffff;
-    if (ix <= 0x3fe921fb) {     /* |x| ~<= pi/4 , no need for reduction */
-        y[0] = x;
-        y[1] = 0;
-        return 0;
-    }
-    if (ix < 0x4002d97c) {      /* |x| < 3pi/4, special case with n=+-1 */
-        if (hx > 0) {
-            z = x - pio2_1;
-            if (ix != 0x3ff921fb) {     /* 33+53 bit pi is good enough */
-                y[0] = z - pio2_1t;
-                y[1] = (z - y[0]) - pio2_1t;
-            } else {            /* near pi/2, use 33+33+53 bit pi */
-                z -= pio2_2;
-                y[0] = z - pio2_2t;
-                y[1] = (z - y[0]) - pio2_2t;
-            }
-            return 1;
-        } else {                /* negative x */
-            z = x + pio2_1;
-            if (ix != 0x3ff921fb) {     /* 33+53 bit pi is good enough */
-                y[0] = z + pio2_1t;
-                y[1] = (z - y[0]) + pio2_1t;
-            } else {            /* near pi/2, use 33+33+53 bit pi */
-                z += pio2_2;
-                y[0] = z + pio2_2t;
-                y[1] = (z - y[0]) + pio2_2t;
-            }
-            return -1;
-        }
-    }
-    if (ix <= 0x413921fb) {     /* |x| ~<= 2^19*(pi/2), medium size */
-        t = fabs(x);
-        n = (int32_t) (t * invpio2 + half);
-        fn = (double) n;
-        r = t - fn * pio2_1;
-        w = fn * pio2_1t;       /* 1st round good to 85 bit */
-        if (n < 32 && ix != npio2_hw[n - 1]) {
-            y[0] = r - w;       /* quick check no cancellation */
-        } else {
-            u_int32_t high;
-            j = ix >> 20;
-            y[0] = r - w;
-            GET_HIGH_WORD(high, y[0]);
-            i = j - ((high >> 20) & 0x7ff);
-            if (i > 16) {       /* 2nd iteration needed, good to 118 */
-                t = r;
-                w = fn * pio2_2;
-                r = t - w;
-                w = fn * pio2_2t - ((t - r) - w);
-                y[0] = r - w;
-                GET_HIGH_WORD(high, y[0]);
-                i = j - ((high >> 20) & 0x7ff);
-                if (i > 49) {   /* 3rd iteration need, 151 bits acc */
-                    t = r;      /* will cover all possible cases */
-                    w = fn * pio2_3;
-                    r = t - w;
-                    w = fn * pio2_3t - ((t - r) - w);
-                    y[0] = r - w;
-                }
-            }
-        }
-        y[1] = (r - y[0]) - w;
-        if (hx < 0) {
-            y[0] = -y[0];
-            y[1] = -y[1];
-            return -n;
-        } else
-            return n;
-    }
-    /*
-     * all other (large) arguments
-     */
-    if (ix >= 0x7ff00000) {     /* x is inf or NaN */
-        y[0] = y[1] = x - x;
-        return 0;
-    }
-    /* set z = scalbn(|x|,ilogb(x)-23) */
-    GET_LOW_WORD(low, x);
-    SET_LOW_WORD(z, low);
-    e0 = (ix >> 20) - 1046;     /* e0 = ilogb(z)-23; */
-    SET_HIGH_WORD(z, ix - ((int32_t) (e0 << 20)));
-    for (i = 0; i < 2; i++) {
-        tx[i] = (double) ((int32_t) (z));
-        z = (z - tx[i]) * two24;
-    }
-    tx[2] = z;
-    nx = 3;
-    while (tx[nx - 1] == zero)
-        nx--;                   /* skip zero term */
-    n = __kernel_rem_pio2(tx, y, e0, nx, 2, two_over_pi);
-    if (hx < 0) {
-        y[0] = -y[0];
-        y[1] = -y[1];
-        return -n;
-    }
-    return n;
-}
diff --git a/deps/SDL2/src/libm/e_sqrt.c b/deps/SDL2/src/libm/e_sqrt.c
deleted file mode 100644
index b8b8bec..0000000
--- a/deps/SDL2/src/libm/e_sqrt.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/* @(#)e_sqrt.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: e_sqrt.c,v 1.8 1995/05/10 20:46:17 jtc Exp $";
-#endif
-
-/* __ieee754_sqrt(x)
- * Return correctly rounded sqrt.
- *           ------------------------------------------
- *	     |  Use the hardware sqrt if you have one |
- *           ------------------------------------------
- * Method:
- *   Bit by bit method using integer arithmetic. (Slow, but portable)
- *   1. Normalization
- *	Scale x to y in [1,4) with even powers of 2:
- *	find an integer k such that  1 <= (y=x*2^(2k)) < 4, then
- *		sqrt(x) = 2^k * sqrt(y)
- *   2. Bit by bit computation
- *	Let q  = sqrt(y) truncated to i bit after binary point (q = 1),
- *	     i							 0
- *                                     i+1         2
- *	    s  = 2*q , and	y  =  2   * ( y - q  ).		(1)
- *	     i      i            i                 i
- *
- *	To compute q    from q , one checks whether
- *		    i+1       i
- *
- *			      -(i+1) 2
- *			(q + 2      ) <= y.			(2)
- *     			  i
- *							      -(i+1)
- *	If (2) is false, then q   = q ; otherwise q   = q  + 2      .
- *		 	       i+1   i             i+1   i
- *
- *	With some algebric manipulation, it is not difficult to see
- *	that (2) is equivalent to
- *                             -(i+1)
- *			s  +  2       <= y			(3)
- *			 i                i
- *
- *	The advantage of (3) is that s  and y  can be computed by
- *				      i      i
- *	the following recurrence formula:
- *	    if (3) is false
- *
- *	    s     =  s  ,	y    = y   ;			(4)
- *	     i+1      i		 i+1    i
- *
- *	    otherwise,
- *                         -i                     -(i+1)
- *	    s	  =  s  + 2  ,  y    = y  -  s  - 2  		(5)
- *           i+1      i          i+1    i     i
- *
- *	One may easily use induction to prove (4) and (5).
- *	Note. Since the left hand side of (3) contain only i+2 bits,
- *	      it does not necessary to do a full (53-bit) comparison
- *	      in (3).
- *   3. Final rounding
- *	After generating the 53 bits result, we compute one more bit.
- *	Together with the remainder, we can decide whether the
- *	result is exact, bigger than 1/2ulp, or less than 1/2ulp
- *	(it will never equal to 1/2ulp).
- *	The rounding mode can be detected by checking whether
- *	huge + tiny is equal to huge, and whether huge - tiny is
- *	equal to huge for some floating point number "huge" and "tiny".
- *
- * Special cases:
- *	sqrt(+-0) = +-0 	... exact
- *	sqrt(inf) = inf
- *	sqrt(-ve) = NaN		... with invalid signal
- *	sqrt(NaN) = NaN		... with invalid signal for signaling NaN
- *
- * Other methods : see the appended file at the end of the program below.
- *---------------
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-#ifdef __STDC__
-static const double one = 1.0, tiny = 1.0e-300;
-#else
-static double one = 1.0, tiny = 1.0e-300;
-#endif
-
-#ifdef __STDC__
-double attribute_hidden
-__ieee754_sqrt(double x)
-#else
-double attribute_hidden
-__ieee754_sqrt(x)
-     double x;
-#endif
-{
-    double z;
-    int32_t sign = (int) 0x80000000;
-    int32_t ix0, s0, q, m, t, i;
-    u_int32_t r, t1, s1, ix1, q1;
-
-    EXTRACT_WORDS(ix0, ix1, x);
-
-    /* take care of Inf and NaN */
-    if ((ix0 & 0x7ff00000) == 0x7ff00000) {
-        return x * x + x;       /* sqrt(NaN)=NaN, sqrt(+inf)=+inf
-                                   sqrt(-inf)=sNaN */
-    }
-    /* take care of zero */
-    if (ix0 <= 0) {
-        if (((ix0 & (~sign)) | ix1) == 0)
-            return x;           /* sqrt(+-0) = +-0 */
-        else if (ix0 < 0)
-            return (x - x) / (x - x);   /* sqrt(-ve) = sNaN */
-    }
-    /* normalize x */
-    m = (ix0 >> 20);
-    if (m == 0) {               /* subnormal x */
-        while (ix0 == 0) {
-            m -= 21;
-            ix0 |= (ix1 >> 11);
-            ix1 <<= 21;
-        }
-        for (i = 0; (ix0 & 0x00100000) == 0; i++)
-            ix0 <<= 1;
-        m -= i - 1;
-        ix0 |= (ix1 >> (32 - i));
-        ix1 <<= i;
-    }
-    m -= 1023;                  /* unbias exponent */
-    ix0 = (ix0 & 0x000fffff) | 0x00100000;
-    if (m & 1) {                /* odd m, double x to make it even */
-        ix0 += ix0 + ((ix1 & sign) >> 31);
-        ix1 += ix1;
-    }
-    m >>= 1;                    /* m = [m/2] */
-
-    /* generate sqrt(x) bit by bit */
-    ix0 += ix0 + ((ix1 & sign) >> 31);
-    ix1 += ix1;
-    q = q1 = s0 = s1 = 0;       /* [q,q1] = sqrt(x) */
-    r = 0x00200000;             /* r = moving bit from right to left */
-
-    while (r != 0) {
-        t = s0 + r;
-        if (t <= ix0) {
-            s0 = t + r;
-            ix0 -= t;
-            q += r;
-        }
-        ix0 += ix0 + ((ix1 & sign) >> 31);
-        ix1 += ix1;
-        r >>= 1;
-    }
-
-    r = sign;
-    while (r != 0) {
-        t1 = s1 + r;
-        t = s0;
-        if ((t < ix0) || ((t == ix0) && (t1 <= ix1))) {
-            s1 = t1 + r;
-            if (((t1 & sign) == sign) && (s1 & sign) == 0)
-                s0 += 1;
-            ix0 -= t;
-            if (ix1 < t1)
-                ix0 -= 1;
-            ix1 -= t1;
-            q1 += r;
-        }
-        ix0 += ix0 + ((ix1 & sign) >> 31);
-        ix1 += ix1;
-        r >>= 1;
-    }
-
-    /* use floating add to find out rounding direction */
-    if ((ix0 | ix1) != 0) {
-        z = one - tiny;         /* trigger inexact flag */
-        if (z >= one) {
-            z = one + tiny;
-            if (q1 == (u_int32_t) 0xffffffff) {
-                q1 = 0;
-                q += 1;
-            } else if (z > one) {
-                if (q1 == (u_int32_t) 0xfffffffe)
-                    q += 1;
-                q1 += 2;
-            } else
-                q1 += (q1 & 1);
-        }
-    }
-    ix0 = (q >> 1) + 0x3fe00000;
-    ix1 = q1 >> 1;
-    if ((q & 1) == 1)
-        ix1 |= sign;
-    ix0 += (m << 20);
-    INSERT_WORDS(z, ix0, ix1);
-    return z;
-}
-
-/*
-Other methods  (use floating-point arithmetic)
--------------
-(This is a copy of a drafted paper by Prof W. Kahan
-and K.C. Ng, written in May, 1986)
-
-	Two algorithms are given here to implement sqrt(x)
-	(IEEE double precision arithmetic) in software.
-	Both supply sqrt(x) correctly rounded. The first algorithm (in
-	Section A) uses newton iterations and involves four divisions.
-	The second one uses reciproot iterations to avoid division, but
-	requires more multiplications. Both algorithms need the ability
-	to chop results of arithmetic operations instead of round them,
-	and the INEXACT flag to indicate when an arithmetic operation
-	is executed exactly with no roundoff error, all part of the
-	standard (IEEE 754-1985). The ability to perform shift, add,
-	subtract and logical AND operations upon 32-bit words is needed
-	too, though not part of the standard.
-
-A.  sqrt(x) by Newton Iteration
-
-   (1)	Initial approximation
-
-	Let x0 and x1 be the leading and the trailing 32-bit words of
-	a floating point number x (in IEEE double format) respectively
-
-	    1    11		     52				  ...widths
-	   ------------------------------------------------------
-	x: |s|	  e     |	      f				|
-	   ------------------------------------------------------
-	      msb    lsb  msb				      lsb ...order
-
-
-	     ------------------------  	     ------------------------
-	x0:  |s|   e    |    f1     |	 x1: |          f2           |
-	     ------------------------  	     ------------------------
-
-	By performing shifts and subtracts on x0 and x1 (both regarded
-	as integers), we obtain an 8-bit approximation of sqrt(x) as
-	follows.
-
-		k  := (x0>>1) + 0x1ff80000;
-		y0 := k - T1[31&(k>>15)].	... y ~ sqrt(x) to 8 bits
-	Here k is a 32-bit integer and T1[] is an integer array containing
-	correction terms. Now magically the floating value of y (y's
-	leading 32-bit word is y0, the value of its trailing word is 0)
-	approximates sqrt(x) to almost 8-bit.
-
-	Value of T1:
-	static int T1[32]= {
-	0,	1024,	3062,	5746,	9193,	13348,	18162,	23592,
-	29598,	36145,	43202,	50740,	58733,	67158,	75992,	85215,
-	83599,	71378,	60428,	50647,	41945,	34246,	27478,	21581,
-	16499,	12183,	8588,	5674,	3403,	1742,	661,	130,};
-
-    (2)	Iterative refinement
-
-	Apply Heron's rule three times to y, we have y approximates
-	sqrt(x) to within 1 ulp (Unit in the Last Place):
-
-		y := (y+x/y)/2		... almost 17 sig. bits
-		y := (y+x/y)/2		... almost 35 sig. bits
-		y := y-(y-x/y)/2	... within 1 ulp
-
-
-	Remark 1.
-	    Another way to improve y to within 1 ulp is:
-
-		y := (y+x/y)		... almost 17 sig. bits to 2*sqrt(x)
-		y := y - 0x00100006	... almost 18 sig. bits to sqrt(x)
-
-				2
-			    (x-y )*y
-		y := y + 2* ----------	...within 1 ulp
-			       2
-			     3y  + x
-
-
-	This formula has one division fewer than the one above; however,
-	it requires more multiplications and additions. Also x must be
-	scaled in advance to avoid spurious overflow in evaluating the
-	expression 3y*y+x. Hence it is not recommended uless division
-	is slow. If division is very slow, then one should use the
-	reciproot algorithm given in section B.
-
-    (3) Final adjustment
-
-	By twiddling y's last bit it is possible to force y to be
-	correctly rounded according to the prevailing rounding mode
-	as follows. Let r and i be copies of the rounding mode and
-	inexact flag before entering the square root program. Also we
-	use the expression y+-ulp for the next representable floating
-	numbers (up and down) of y. Note that y+-ulp = either fixed
-	point y+-1, or multiply y by nextafter(1,+-inf) in chopped
-	mode.
-
-		I := FALSE;	... reset INEXACT flag I
-		R := RZ;	... set rounding mode to round-toward-zero
-		z := x/y;	... chopped quotient, possibly inexact
-		If(not I) then {	... if the quotient is exact
-		    if(z=y) {
-		        I := i;	 ... restore inexact flag
-		        R := r;  ... restore rounded mode
-		        return sqrt(x):=y.
-		    } else {
-			z := z - ulp;	... special rounding
-		    }
-		}
-		i := TRUE;		... sqrt(x) is inexact
-		If (r=RN) then z=z+ulp	... rounded-to-nearest
-		If (r=RP) then {	... round-toward-+inf
-		    y = y+ulp; z=z+ulp;
-		}
-		y := y+z;		... chopped sum
-		y0:=y0-0x00100000;	... y := y/2 is correctly rounded.
-	        I := i;	 		... restore inexact flag
-	        R := r;  		... restore rounded mode
-	        return sqrt(x):=y.
-
-    (4)	Special cases
-
-	Square root of +inf, +-0, or NaN is itself;
-	Square root of a negative number is NaN with invalid signal.
-
-
-B.  sqrt(x) by Reciproot Iteration
-
-   (1)	Initial approximation
-
-	Let x0 and x1 be the leading and the trailing 32-bit words of
-	a floating point number x (in IEEE double format) respectively
-	(see section A). By performing shifs and subtracts on x0 and y0,
-	we obtain a 7.8-bit approximation of 1/sqrt(x) as follows.
-
-	    k := 0x5fe80000 - (x0>>1);
-	    y0:= k - T2[63&(k>>14)].	... y ~ 1/sqrt(x) to 7.8 bits
-
-	Here k is a 32-bit integer and T2[] is an integer array
-	containing correction terms. Now magically the floating
-	value of y (y's leading 32-bit word is y0, the value of
-	its trailing word y1 is set to zero) approximates 1/sqrt(x)
-	to almost 7.8-bit.
-
-	Value of T2:
-	static int T2[64]= {
-	0x1500,	0x2ef8,	0x4d67,	0x6b02,	0x87be,	0xa395,	0xbe7a,	0xd866,
-	0xf14a,	0x1091b,0x11fcd,0x13552,0x14999,0x15c98,0x16e34,0x17e5f,
-	0x18d03,0x19a01,0x1a545,0x1ae8a,0x1b5c4,0x1bb01,0x1bfde,0x1c28d,
-	0x1c2de,0x1c0db,0x1ba73,0x1b11c,0x1a4b5,0x1953d,0x18266,0x16be0,
-	0x1683e,0x179d8,0x18a4d,0x19992,0x1a789,0x1b445,0x1bf61,0x1c989,
-	0x1d16d,0x1d77b,0x1dddf,0x1e2ad,0x1e5bf,0x1e6e8,0x1e654,0x1e3cd,
-	0x1df2a,0x1d635,0x1cb16,0x1be2c,0x1ae4e,0x19bde,0x1868e,0x16e2e,
-	0x1527f,0x1334a,0x11051,0xe951,	0xbe01,	0x8e0d,	0x5924,	0x1edd,};
-
-    (2)	Iterative refinement
-
-	Apply Reciproot iteration three times to y and multiply the
-	result by x to get an approximation z that matches sqrt(x)
-	to about 1 ulp. To be exact, we will have
-		-1ulp < sqrt(x)-z<1.0625ulp.
-
-	... set rounding mode to Round-to-nearest
-	   y := y*(1.5-0.5*x*y*y)	... almost 15 sig. bits to 1/sqrt(x)
-	   y := y*((1.5-2^-30)+0.5*x*y*y)... about 29 sig. bits to 1/sqrt(x)
-	... special arrangement for better accuracy
-	   z := x*y			... 29 bits to sqrt(x), with z*y<1
-	   z := z + 0.5*z*(1-z*y)	... about 1 ulp to sqrt(x)
-
-	Remark 2. The constant 1.5-2^-30 is chosen to bias the error so that
-	(a) the term z*y in the final iteration is always less than 1;
-	(b) the error in the final result is biased upward so that
-		-1 ulp < sqrt(x) - z < 1.0625 ulp
-	    instead of |sqrt(x)-z|<1.03125ulp.
-
-    (3)	Final adjustment
-
-	By twiddling y's last bit it is possible to force y to be
-	correctly rounded according to the prevailing rounding mode
-	as follows. Let r and i be copies of the rounding mode and
-	inexact flag before entering the square root program. Also we
-	use the expression y+-ulp for the next representable floating
-	numbers (up and down) of y. Note that y+-ulp = either fixed
-	point y+-1, or multiply y by nextafter(1,+-inf) in chopped
-	mode.
-
-	R := RZ;		... set rounding mode to round-toward-zero
-	switch(r) {
-	    case RN:		... round-to-nearest
-	       if(x<= z*(z-ulp)...chopped) z = z - ulp; else
-	       if(x<= z*(z+ulp)...chopped) z = z; else z = z+ulp;
-	       break;
-	    case RZ:case RM:	... round-to-zero or round-to--inf
-	       R:=RP;		... reset rounding mod to round-to-+inf
-	       if(x<z*z ... rounded up) z = z - ulp; else
-	       if(x>=(z+ulp)*(z+ulp) ...rounded up) z = z+ulp;
-	       break;
-	    case RP:		... round-to-+inf
-	       if(x>(z+ulp)*(z+ulp)...chopped) z = z+2*ulp; else
-	       if(x>z*z ...chopped) z = z+ulp;
-	       break;
-	}
-
-	Remark 3. The above comparisons can be done in fixed point. For
-	example, to compare x and w=z*z chopped, it suffices to compare
-	x1 and w1 (the trailing parts of x and w), regarding them as
-	two's complement integers.
-
-	...Is z an exact square root?
-	To determine whether z is an exact square root of x, let z1 be the
-	trailing part of z, and also let x0 and x1 be the leading and
-	trailing parts of x.
-
-	If ((z1&0x03ffffff)!=0)	... not exact if trailing 26 bits of z!=0
-	    I := 1;		... Raise Inexact flag: z is not exact
-	else {
-	    j := 1 - [(x0>>20)&1]	... j = logb(x) mod 2
-	    k := z1 >> 26;		... get z's 25-th and 26-th
-					    fraction bits
-	    I := i or (k&j) or ((k&(j+j+1))!=(x1&3));
-	}
-	R:= r		... restore rounded mode
-	return sqrt(x):=z.
-
-	If multiplication is cheaper then the foregoing red tape, the
-	Inexact flag can be evaluated by
-
-	    I := i;
-	    I := (z*z!=x) or I.
-
-	Note that z*z can overwrite I; this value must be sensed if it is
-	True.
-
-	Remark 4. If z*z = x exactly, then bit 25 to bit 0 of z1 must be
-	zero.
-
-		    --------------------
-		z1: |        f2        |
-		    --------------------
-		bit 31		   bit 0
-
-	Further more, bit 27 and 26 of z1, bit 0 and 1 of x1, and the odd
-	or even of logb(x) have the following relations:
-
-	-------------------------------------------------
-	bit 27,26 of z1		bit 1,0 of x1	logb(x)
-	-------------------------------------------------
-	00			00		odd and even
-	01			01		even
-	10			10		odd
-	10			00		even
-	11			01		even
-	-------------------------------------------------
-
-    (4)	Special cases (see (4) of Section A).
-
- */
diff --git a/deps/SDL2/src/libm/k_cos.c b/deps/SDL2/src/libm/k_cos.c
deleted file mode 100644
index 64c50e3..0000000
--- a/deps/SDL2/src/libm/k_cos.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/* @(#)k_cos.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: k_cos.c,v 1.8 1995/05/10 20:46:22 jtc Exp $";
-#endif
-
-/*
- * __kernel_cos( x,  y )
- * kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164
- * Input x is assumed to be bounded by ~pi/4 in magnitude.
- * Input y is the tail of x.
- *
- * Algorithm
- *	1. Since cos(-x) = cos(x), we need only to consider positive x.
- *	2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0.
- *	3. cos(x) is approximated by a polynomial of degree 14 on
- *	   [0,pi/4]
- *		  	                 4            14
- *	   	cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x
- *	   where the remez error is
- *
- * 	|              2     4     6     8     10    12     14 |     -58
- * 	|cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x  +C6*x  )| <= 2
- * 	|    					               |
- *
- * 	               4     6     8     10    12     14
- *	4. let r = C1*x +C2*x +C3*x +C4*x +C5*x  +C6*x  , then
- *	       cos(x) = 1 - x*x/2 + r
- *	   since cos(x+y) ~ cos(x) - sin(x)*y
- *			  ~ cos(x) - x*y,
- *	   a correction term is necessary in cos(x) and hence
- *		cos(x+y) = 1 - (x*x/2 - (r - x*y))
- *	   For better accuracy when x > 0.3, let qx = |x|/4 with
- *	   the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125.
- *	   Then
- *		cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)).
- *	   Note that 1-qx and (x*x/2-qx) is EXACT here, and the
- *	   magnitude of the latter is at least a quarter of x*x/2,
- *	   thus, reducing the rounding error in the subtraction.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-  one = 1.00000000000000000000e+00,     /* 0x3FF00000, 0x00000000 */
-    C1 = 4.16666666666666019037e-02,    /* 0x3FA55555, 0x5555554C */
-    C2 = -1.38888888888741095749e-03,   /* 0xBF56C16C, 0x16C15177 */
-    C3 = 2.48015872894767294178e-05,    /* 0x3EFA01A0, 0x19CB1590 */
-    C4 = -2.75573143513906633035e-07,   /* 0xBE927E4F, 0x809C52AD */
-    C5 = 2.08757232129817482790e-09,    /* 0x3E21EE9E, 0xBDB4B1C4 */
-    C6 = -1.13596475577881948265e-11;   /* 0xBDA8FAE9, 0xBE8838D4 */
-
-#ifdef __STDC__
-double attribute_hidden
-__kernel_cos(double x, double y)
-#else
-double attribute_hidden
-__kernel_cos(x, y)
-     double x, y;
-#endif
-{
-    double a, hz, z, r, qx;
-    int32_t ix;
-    GET_HIGH_WORD(ix, x);
-    ix &= 0x7fffffff;           /* ix = |x|'s high word */
-    if (ix < 0x3e400000) {      /* if x < 2**27 */
-        if (((int) x) == 0)
-            return one;         /* generate inexact */
-    }
-    z = x * x;
-    r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * C6)))));
-    if (ix < 0x3FD33333)        /* if |x| < 0.3 */
-        return one - (0.5 * z - (z * r - x * y));
-    else {
-        if (ix > 0x3fe90000) {  /* x > 0.78125 */
-            qx = 0.28125;
-        } else {
-            INSERT_WORDS(qx, ix - 0x00200000, 0);       /* x/4 */
-        }
-        hz = 0.5 * z - qx;
-        a = one - qx;
-        return a - (hz - (z * r - x * y));
-    }
-}
diff --git a/deps/SDL2/src/libm/k_rem_pio2.c b/deps/SDL2/src/libm/k_rem_pio2.c
deleted file mode 100644
index f881d35..0000000
--- a/deps/SDL2/src/libm/k_rem_pio2.c
+++ /dev/null
@@ -1,358 +0,0 @@
-/* @(#)k_rem_pio2.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $";
-#endif
-
-/*
- * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
- * double x[],y[]; int e0,nx,prec; int ipio2[];
- *
- * __kernel_rem_pio2 return the last three digits of N with
- *		y = x - N*pi/2
- * so that |y| < pi/2.
- *
- * The method is to compute the integer (mod 8) and fraction parts of
- * (2/pi)*x without doing the full multiplication. In general we
- * skip the part of the product that are known to be a huge integer (
- * more accurately, = 0 mod 8 ). Thus the number of operations are
- * independent of the exponent of the input.
- *
- * (2/pi) is represented by an array of 24-bit integers in ipio2[].
- *
- * Input parameters:
- * 	x[]	The input value (must be positive) is broken into nx
- *		pieces of 24-bit integers in double precision format.
- *		x[i] will be the i-th 24 bit of x. The scaled exponent
- *		of x[0] is given in input parameter e0 (i.e., x[0]*2^e0
- *		match x's up to 24 bits.
- *
- *		Example of breaking a double positive z into x[0]+x[1]+x[2]:
- *			e0 = ilogb(z)-23
- *			z  = scalbn(z,-e0)
- *		for i = 0,1,2
- *			x[i] = floor(z)
- *			z    = (z-x[i])*2**24
- *
- *
- *	y[]	ouput result in an array of double precision numbers.
- *		The dimension of y[] is:
- *			24-bit  precision	1
- *			53-bit  precision	2
- *			64-bit  precision	2
- *			113-bit precision	3
- *		The actual value is the sum of them. Thus for 113-bit
- *		precison, one may have to do something like:
- *
- *		long double t,w,r_head, r_tail;
- *		t = (long double)y[2] + (long double)y[1];
- *		w = (long double)y[0];
- *		r_head = t+w;
- *		r_tail = w - (r_head - t);
- *
- *	e0	The exponent of x[0]
- *
- *	nx	dimension of x[]
- *
- *  	prec	an integer indicating the precision:
- *			0	24  bits (single)
- *			1	53  bits (double)
- *			2	64  bits (extended)
- *			3	113 bits (quad)
- *
- *	ipio2[]
- *		integer array, contains the (24*i)-th to (24*i+23)-th
- *		bit of 2/pi after binary point. The corresponding
- *		floating value is
- *
- *			ipio2[i] * 2^(-24(i+1)).
- *
- * External function:
- *	double scalbn(), floor();
- *
- *
- * Here is the description of some local variables:
- *
- * 	jk	jk+1 is the initial number of terms of ipio2[] needed
- *		in the computation. The recommended value is 2,3,4,
- *		6 for single, double, extended,and quad.
- *
- * 	jz	local integer variable indicating the number of
- *		terms of ipio2[] used.
- *
- *	jx	nx - 1
- *
- *	jv	index for pointing to the suitable ipio2[] for the
- *		computation. In general, we want
- *			( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8
- *		is an integer. Thus
- *			e0-3-24*jv >= 0 or (e0-3)/24 >= jv
- *		Hence jv = max(0,(e0-3)/24).
- *
- *	jp	jp+1 is the number of terms in PIo2[] needed, jp = jk.
- *
- * 	q[]	double array with integral value, representing the
- *		24-bits chunk of the product of x and 2/pi.
- *
- *	q0	the corresponding exponent of q[0]. Note that the
- *		exponent for q[i] would be q0-24*i.
- *
- *	PIo2[]	double precision array, obtained by cutting pi/2
- *		into 24 bits chunks.
- *
- *	f[]	ipio2[] in floating point
- *
- *	iq[]	integer array by breaking up q[] in 24-bits chunk.
- *
- *	fq[]	final product of x*(2/pi) in fq[0],..,fq[jk]
- *
- *	ih	integer. If >0 it indicates q[] is >= 0.5, hence
- *		it also indicates the *sign* of the result.
- *
- */
-
-
-/*
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(scalbn)
-    libm_hidden_proto(floor)
-#ifdef __STDC__
-     static const int init_jk[] = { 2, 3, 4, 6 };       /* initial value for jk */
-#else
-     static int init_jk[] = { 2, 3, 4, 6 };
-#endif
-
-#ifdef __STDC__
-static const double PIo2[] = {
-#else
-static double PIo2[] = {
-#endif
-    1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */
-    7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */
-    5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */
-    3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */
-    1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */
-    1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */
-    2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */
-    2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */
-};
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-  zero = 0.0, one = 1.0, two24 = 1.67772160000000000000e+07,    /* 0x41700000, 0x00000000 */
-    twon24 = 5.96046447753906250000e-08;        /* 0x3E700000, 0x00000000 */
-
-#ifdef __STDC__
-int attribute_hidden
-__kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec,
-                  const int32_t * ipio2)
-#else
-int attribute_hidden
-__kernel_rem_pio2(x, y, e0, nx, prec, ipio2)
-     double x[], y[];
-     int e0, nx, prec;
-     int32_t ipio2[];
-#endif
-{
-    int32_t jz, jx, jv, jp, jk, carry, n, iq[20], i, j, k, m, q0, ih;
-    double z, fw, f[20], fq[20], q[20];
-
-    /* initialize jk */
-    jk = init_jk[prec];
-    jp = jk;
-
-    /* determine jx,jv,q0, note that 3>q0 */
-    jx = nx - 1;
-    jv = (e0 - 3) / 24;
-    if (jv < 0)
-        jv = 0;
-    q0 = e0 - 24 * (jv + 1);
-
-    /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */
-    j = jv - jx;
-    m = jx + jk;
-    for (i = 0; i <= m; i++, j++)
-        f[i] = (j < 0) ? zero : (double) ipio2[j];
-
-    /* compute q[0],q[1],...q[jk] */
-    for (i = 0; i <= jk; i++) {
-        for (j = 0, fw = 0.0; j <= jx; j++)
-            fw += x[j] * f[jx + i - j];
-        q[i] = fw;
-    }
-
-    jz = jk;
-  recompute:
-    /* distill q[] into iq[] reversingly */
-    for (i = 0, j = jz, z = q[jz]; j > 0; i++, j--) {
-        fw = (double) ((int32_t) (twon24 * z));
-        iq[i] = (int32_t) (z - two24 * fw);
-        z = q[j - 1] + fw;
-    }
-
-    /* compute n */
-    z = scalbn(z, q0);          /* actual value of z */
-    z -= 8.0 * floor(z * 0.125);        /* trim off integer >= 8 */
-    n = (int32_t) z;
-    z -= (double) n;
-    ih = 0;
-    if (q0 > 0) {               /* need iq[jz-1] to determine n */
-        i = (iq[jz - 1] >> (24 - q0));
-        n += i;
-        iq[jz - 1] -= i << (24 - q0);
-        ih = iq[jz - 1] >> (23 - q0);
-    } else if (q0 == 0)
-        ih = iq[jz - 1] >> 23;
-    else if (z >= 0.5)
-        ih = 2;
-
-    if (ih > 0) {               /* q > 0.5 */
-        n += 1;
-        carry = 0;
-        for (i = 0; i < jz; i++) {      /* compute 1-q */
-            j = iq[i];
-            if (carry == 0) {
-                if (j != 0) {
-                    carry = 1;
-                    iq[i] = 0x1000000 - j;
-                }
-            } else
-                iq[i] = 0xffffff - j;
-        }
-        if (q0 > 0) {           /* rare case: chance is 1 in 12 */
-            switch (q0) {
-            case 1:
-                iq[jz - 1] &= 0x7fffff;
-                break;
-            case 2:
-                iq[jz - 1] &= 0x3fffff;
-                break;
-            }
-        }
-        if (ih == 2) {
-            z = one - z;
-            if (carry != 0)
-                z -= scalbn(one, q0);
-        }
-    }
-
-    /* check if recomputation is needed */
-    if (z == zero) {
-        j = 0;
-        for (i = jz - 1; i >= jk; i--)
-            j |= iq[i];
-        if (j == 0) {           /* need recomputation */
-            for (k = 1; iq[jk - k] == 0; k++);  /* k = no. of terms needed */
-
-            for (i = jz + 1; i <= jz + k; i++) {        /* add q[jz+1] to q[jz+k] */
-                f[jx + i] = (double) ipio2[jv + i];
-                for (j = 0, fw = 0.0; j <= jx; j++)
-                    fw += x[j] * f[jx + i - j];
-                q[i] = fw;
-            }
-            jz += k;
-            goto recompute;
-        }
-    }
-
-    /* chop off zero terms */
-    if (z == 0.0) {
-        jz -= 1;
-        q0 -= 24;
-        while (iq[jz] == 0) {
-            jz--;
-            q0 -= 24;
-        }
-    } else {                    /* break z into 24-bit if necessary */
-        z = scalbn(z, -q0);
-        if (z >= two24) {
-            fw = (double) ((int32_t) (twon24 * z));
-            iq[jz] = (int32_t) (z - two24 * fw);
-            jz += 1;
-            q0 += 24;
-            iq[jz] = (int32_t) fw;
-        } else
-            iq[jz] = (int32_t) z;
-    }
-
-    /* convert integer "bit" chunk to floating-point value */
-    fw = scalbn(one, q0);
-    for (i = jz; i >= 0; i--) {
-        q[i] = fw * (double) iq[i];
-        fw *= twon24;
-    }
-
-    /* compute PIo2[0,...,jp]*q[jz,...,0] */
-    for (i = jz; i >= 0; i--) {
-        for (fw = 0.0, k = 0; k <= jp && k <= jz - i; k++)
-            fw += PIo2[k] * q[i + k];
-        fq[jz - i] = fw;
-    }
-
-    /* compress fq[] into y[] */
-    switch (prec) {
-    case 0:
-        fw = 0.0;
-        for (i = jz; i >= 0; i--)
-            fw += fq[i];
-        y[0] = (ih == 0) ? fw : -fw;
-        break;
-    case 1:
-    case 2:
-        fw = 0.0;
-        for (i = jz; i >= 0; i--)
-            fw += fq[i];
-        y[0] = (ih == 0) ? fw : -fw;
-        fw = fq[0] - fw;
-        for (i = 1; i <= jz; i++)
-            fw += fq[i];
-        y[1] = (ih == 0) ? fw : -fw;
-        break;
-    case 3:                    /* painful */
-        for (i = jz; i > 0; i--) {
-            fw = fq[i - 1] + fq[i];
-            fq[i] += fq[i - 1] - fw;
-            fq[i - 1] = fw;
-        }
-        for (i = jz; i > 1; i--) {
-            fw = fq[i - 1] + fq[i];
-            fq[i] += fq[i - 1] - fw;
-            fq[i - 1] = fw;
-        }
-        for (fw = 0.0, i = jz; i >= 2; i--)
-            fw += fq[i];
-        if (ih == 0) {
-            y[0] = fq[0];
-            y[1] = fq[1];
-            y[2] = fw;
-        } else {
-            y[0] = -fq[0];
-            y[1] = -fq[1];
-            y[2] = -fw;
-        }
-    }
-    return n & 7;
-}
diff --git a/deps/SDL2/src/libm/k_sin.c b/deps/SDL2/src/libm/k_sin.c
deleted file mode 100644
index 6088157..0000000
--- a/deps/SDL2/src/libm/k_sin.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* @(#)k_sin.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: k_sin.c,v 1.8 1995/05/10 20:46:31 jtc Exp $";
-#endif
-
-/* __kernel_sin( x, y, iy)
- * kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854
- * Input x is assumed to be bounded by ~pi/4 in magnitude.
- * Input y is the tail of x.
- * Input iy indicates whether y is 0. (if iy=0, y assume to be 0).
- *
- * Algorithm
- *	1. Since sin(-x) = -sin(x), we need only to consider positive x.
- *	2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0.
- *	3. sin(x) is approximated by a polynomial of degree 13 on
- *	   [0,pi/4]
- *		  	         3            13
- *	   	sin(x) ~ x + S1*x + ... + S6*x
- *	   where
- *
- * 	|sin(x)         2     4     6     8     10     12  |     -58
- * 	|----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x  +S6*x   )| <= 2
- * 	|  x 					           |
- *
- *	4. sin(x+y) = sin(x) + sin'(x')*y
- *		    ~ sin(x) + (1-x*x/2)*y
- *	   For better accuracy, let
- *		     3      2      2      2      2
- *		r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6))))
- *	   then                   3    2
- *		sin(x) = x + (S1*x + (x *(r-y/2)+y))
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-  half = 5.00000000000000000000e-01,    /* 0x3FE00000, 0x00000000 */
-    S1 = -1.66666666666666324348e-01,   /* 0xBFC55555, 0x55555549 */
-    S2 = 8.33333333332248946124e-03,    /* 0x3F811111, 0x1110F8A6 */
-    S3 = -1.98412698298579493134e-04,   /* 0xBF2A01A0, 0x19C161D5 */
-    S4 = 2.75573137070700676789e-06,    /* 0x3EC71DE3, 0x57B1FE7D */
-    S5 = -2.50507602534068634195e-08,   /* 0xBE5AE5E6, 0x8A2B9CEB */
-    S6 = 1.58969099521155010221e-10;    /* 0x3DE5D93A, 0x5ACFD57C */
-
-#ifdef __STDC__
-double attribute_hidden
-__kernel_sin(double x, double y, int iy)
-#else
-double attribute_hidden
-__kernel_sin(x, y, iy)
-     double x, y;
-     int iy;                    /* iy=0 if y is zero */
-#endif
-{
-    double z, r, v;
-    int32_t ix;
-    GET_HIGH_WORD(ix, x);
-    ix &= 0x7fffffff;           /* high word of x */
-    if (ix < 0x3e400000) {      /* |x| < 2**-27 */
-        if ((int) x == 0)
-            return x;
-    }                           /* generate inexact */
-    z = x * x;
-    v = z * x;
-    r = S2 + z * (S3 + z * (S4 + z * (S5 + z * S6)));
-    if (iy == 0)
-        return x + v * (S1 + z * r);
-    else
-        return x - ((z * (half * y - v * r) - y) - v * S1);
-}
diff --git a/deps/SDL2/src/libm/math_libm.h b/deps/SDL2/src/libm/math_libm.h
deleted file mode 100644
index 45a34d8..0000000
--- a/deps/SDL2/src/libm/math_libm.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Math routines from uClibc: http://www.uclibc.org */
-
-double SDL_uclibc_atan(double x);
-double SDL_uclibc_atan2(double y, double x);    
-double SDL_uclibc_copysign(double x, double y);       
-double SDL_uclibc_cos(double x);         
-double SDL_uclibc_fabs(double x);        
-double SDL_uclibc_floor(double x);
-double SDL_uclibc_log(double x);
-double SDL_uclibc_pow(double x, double y);    
-double SDL_uclibc_scalbn(double x, int n);
-double SDL_uclibc_sin(double x);
-double SDL_uclibc_sqrt(double x);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/libm/math_private.h b/deps/SDL2/src/libm/math_private.h
deleted file mode 100644
index 6ab0f35..0000000
--- a/deps/SDL2/src/libm/math_private.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * from: @(#)fdlibm.h 5.1 93/09/24
- * $Id: math_private.h,v 1.3 2004/02/09 07:10:38 andersen Exp $
- */
-
-#ifndef _MATH_PRIVATE_H_
-#define _MATH_PRIVATE_H_
-
-/* #include <endian.h> */
-#include "SDL_endian.h"
-/* #include <sys/types.h> */
-
-#define attribute_hidden
-#define libm_hidden_proto(x)
-#define libm_hidden_def(x)
-
-#ifndef __HAIKU__ /* already defined in a system header. */
-typedef unsigned int u_int32_t;
-#endif
-
-#define atan            SDL_uclibc_atan
-#define __ieee754_atan2 SDL_uclibc_atan2
-#define copysign        SDL_uclibc_copysign
-#define cos             SDL_uclibc_cos
-#define fabs            SDL_uclibc_fabs
-#define floor           SDL_uclibc_floor
-#define __ieee754_log   SDL_uclibc_log
-#define __ieee754_pow   SDL_uclibc_pow
-#define scalbn          SDL_uclibc_scalbn
-#define sin             SDL_uclibc_sin
-#define __ieee754_sqrt  SDL_uclibc_sqrt
-
-/* The original fdlibm code used statements like:
-	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
-	ix0 = *(n0+(int*)&x);			* high word of x *
-	ix1 = *((1-n0)+(int*)&x);		* low word of x *
-   to dig two 32 bit words out of the 64 bit IEEE floating point
-   value.  That is non-ANSI, and, moreover, the gcc instruction
-   scheduler gets it wrong.  We instead use the following macros.
-   Unlike the original code, we determine the endianness at compile
-   time, not at run time; I don't see much benefit to selecting
-   endianness at run time.  */
-
-/* A union which permits us to convert between a double and two 32 bit
-   ints.  */
-
-/*
- * Math on arm is special:
- * For FPA, float words are always big-endian.
- * For VFP, floats words follow the memory system mode.
- */
-
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-
-typedef union
-{
-    double value;
-    struct
-    {
-        u_int32_t msw;
-        u_int32_t lsw;
-    } parts;
-} ieee_double_shape_type;
-
-#else
-
-typedef union
-{
-    double value;
-    struct
-    {
-        u_int32_t lsw;
-        u_int32_t msw;
-    } parts;
-} ieee_double_shape_type;
-
-#endif
-
-/* Get two 32 bit ints from a double.  */
-
-#define EXTRACT_WORDS(ix0,ix1,d)				\
-do {								\
-  ieee_double_shape_type ew_u;					\
-  ew_u.value = (d);						\
-  (ix0) = ew_u.parts.msw;					\
-  (ix1) = ew_u.parts.lsw;					\
-} while (0)
-
-/* Get the more significant 32 bit int from a double.  */
-
-#define GET_HIGH_WORD(i,d)					\
-do {								\
-  ieee_double_shape_type gh_u;					\
-  gh_u.value = (d);						\
-  (i) = gh_u.parts.msw;						\
-} while (0)
-
-/* Get the less significant 32 bit int from a double.  */
-
-#define GET_LOW_WORD(i,d)					\
-do {								\
-  ieee_double_shape_type gl_u;					\
-  gl_u.value = (d);						\
-  (i) = gl_u.parts.lsw;						\
-} while (0)
-
-/* Set a double from two 32 bit ints.  */
-
-#define INSERT_WORDS(d,ix0,ix1)					\
-do {								\
-  ieee_double_shape_type iw_u;					\
-  iw_u.parts.msw = (ix0);					\
-  iw_u.parts.lsw = (ix1);					\
-  (d) = iw_u.value;						\
-} while (0)
-
-/* Set the more significant 32 bits of a double from an int.  */
-
-#define SET_HIGH_WORD(d,v)					\
-do {								\
-  ieee_double_shape_type sh_u;					\
-  sh_u.value = (d);						\
-  sh_u.parts.msw = (v);						\
-  (d) = sh_u.value;						\
-} while (0)
-
-/* Set the less significant 32 bits of a double from an int.  */
-
-#define SET_LOW_WORD(d,v)					\
-do {								\
-  ieee_double_shape_type sl_u;					\
-  sl_u.value = (d);						\
-  sl_u.parts.lsw = (v);						\
-  (d) = sl_u.value;						\
-} while (0)
-
-/* A union which permits us to convert between a float and a 32 bit
-   int.  */
-
-typedef union
-{
-    float value;
-    u_int32_t word;
-} ieee_float_shape_type;
-
-/* Get a 32 bit int from a float.  */
-
-#define GET_FLOAT_WORD(i,d)					\
-do {								\
-  ieee_float_shape_type gf_u;					\
-  gf_u.value = (d);						\
-  (i) = gf_u.word;						\
-} while (0)
-
-/* Set a float from a 32 bit int.  */
-
-#define SET_FLOAT_WORD(d,i)					\
-do {								\
-  ieee_float_shape_type sf_u;					\
-  sf_u.word = (i);						\
-  (d) = sf_u.value;						\
-} while (0)
-
-/* ieee style elementary functions */
-extern double
-__ieee754_sqrt(double)
-    attribute_hidden;
-     extern double __ieee754_acos(double) attribute_hidden;
-     extern double __ieee754_acosh(double) attribute_hidden;
-     extern double __ieee754_log(double) attribute_hidden;
-     extern double __ieee754_atanh(double) attribute_hidden;
-     extern double __ieee754_asin(double) attribute_hidden;
-     extern double __ieee754_atan2(double, double) attribute_hidden;
-     extern double __ieee754_exp(double) attribute_hidden;
-     extern double __ieee754_cosh(double) attribute_hidden;
-     extern double __ieee754_fmod(double, double) attribute_hidden;
-     extern double __ieee754_pow(double, double) attribute_hidden;
-     extern double __ieee754_lgamma_r(double, int *) attribute_hidden;
-     extern double __ieee754_gamma_r(double, int *) attribute_hidden;
-     extern double __ieee754_lgamma(double) attribute_hidden;
-     extern double __ieee754_gamma(double) attribute_hidden;
-     extern double __ieee754_log10(double) attribute_hidden;
-     extern double __ieee754_sinh(double) attribute_hidden;
-     extern double __ieee754_hypot(double, double) attribute_hidden;
-     extern double __ieee754_j0(double) attribute_hidden;
-     extern double __ieee754_j1(double) attribute_hidden;
-     extern double __ieee754_y0(double) attribute_hidden;
-     extern double __ieee754_y1(double) attribute_hidden;
-     extern double __ieee754_jn(int, double) attribute_hidden;
-     extern double __ieee754_yn(int, double) attribute_hidden;
-     extern double __ieee754_remainder(double, double) attribute_hidden;
-     extern int __ieee754_rem_pio2(double, double *) attribute_hidden;
-#if defined(_SCALB_INT)
-     extern double __ieee754_scalb(double, int) attribute_hidden;
-#else
-     extern double __ieee754_scalb(double, double) attribute_hidden;
-#endif
-
-/* fdlibm kernel function */
-#ifndef _IEEE_LIBM
-     extern double __kernel_standard(double, double, int) attribute_hidden;
-#endif
-     extern double __kernel_sin(double, double, int) attribute_hidden;
-     extern double __kernel_cos(double, double) attribute_hidden;
-     extern double __kernel_tan(double, double, int) attribute_hidden;
-     extern int __kernel_rem_pio2(double *, double *, int, int, int,
-                                  const int *) attribute_hidden;
-
-#endif /* _MATH_PRIVATE_H_ */
diff --git a/deps/SDL2/src/libm/s_atan.c b/deps/SDL2/src/libm/s_atan.c
deleted file mode 100644
index f664f0e..0000000
--- a/deps/SDL2/src/libm/s_atan.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/* atan(x)
- * Method
- *   1. Reduce x to positive by atan(x) = -atan(-x).
- *   2. According to the integer k=4t+0.25 chopped, t=x, the argument
- *      is further reduced to one of the following intervals and the
- *      arctangent of t is evaluated by the corresponding formula:
- *
- *      [0,7/16]      atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
- *      [7/16,11/16]  atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
- *      [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
- *      [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
- *      [39/16,INF]   atan(x) = atan(INF) + atan( -1/t )
- *
- * Constants:
- * The hexadecimal values are the intended ones for the following
- * constants. The decimal values may be used, provided that the
- * compiler will convert from decimal to binary accurately enough
- * to produce the hexadecimal values shown.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-static const double atanhi[] = {
-  4.63647609000806093515e-01, /* atan(0.5)hi 0x3FDDAC67, 0x0561BB4F */
-  7.85398163397448278999e-01, /* atan(1.0)hi 0x3FE921FB, 0x54442D18 */
-  9.82793723247329054082e-01, /* atan(1.5)hi 0x3FEF730B, 0xD281F69B */
-  1.57079632679489655800e+00, /* atan(inf)hi 0x3FF921FB, 0x54442D18 */
-};
-
-static const double atanlo[] = {
-  2.26987774529616870924e-17, /* atan(0.5)lo 0x3C7A2B7F, 0x222F65E2 */
-  3.06161699786838301793e-17, /* atan(1.0)lo 0x3C81A626, 0x33145C07 */
-  1.39033110312309984516e-17, /* atan(1.5)lo 0x3C700788, 0x7AF0CBBD */
-  6.12323399573676603587e-17, /* atan(inf)lo 0x3C91A626, 0x33145C07 */
-};
-
-static const double aT[] = {
-  3.33333333333329318027e-01, /* 0x3FD55555, 0x5555550D */
- -1.99999999998764832476e-01, /* 0xBFC99999, 0x9998EBC4 */
-  1.42857142725034663711e-01, /* 0x3FC24924, 0x920083FF */
- -1.11111104054623557880e-01, /* 0xBFBC71C6, 0xFE231671 */
-  9.09088713343650656196e-02, /* 0x3FB745CD, 0xC54C206E */
- -7.69187620504482999495e-02, /* 0xBFB3B0F2, 0xAF749A6D */
-  6.66107313738753120669e-02, /* 0x3FB10D66, 0xA0D03D51 */
- -5.83357013379057348645e-02, /* 0xBFADDE2D, 0x52DEFD9A */
-  4.97687799461593236017e-02, /* 0x3FA97B4B, 0x24760DEB */
- -3.65315727442169155270e-02, /* 0xBFA2B444, 0x2C6A6C2F */
-  1.62858201153657823623e-02, /* 0x3F90AD3A, 0xE322DA11 */
-};
-
-static const double
-one   = 1.0,
-huge   = 1.0e300;
-
-double atan(double x)
-{
-	double w,s1,s2,z;
-	int32_t ix,hx,id;
-
-	GET_HIGH_WORD(hx,x);
-	ix = hx&0x7fffffff;
-	if(ix>=0x44100000) {	/* if |x| >= 2^66 */
-	    u_int32_t low;
-	    GET_LOW_WORD(low,x);
-	    if(ix>0x7ff00000||
-		(ix==0x7ff00000&&(low!=0)))
-		return x+x;		/* NaN */
-	    if(hx>0) return  atanhi[3]+atanlo[3];
-	    else     return -atanhi[3]-atanlo[3];
-	} if (ix < 0x3fdc0000) {	/* |x| < 0.4375 */
-	    if (ix < 0x3e200000) {	/* |x| < 2^-29 */
-		if(huge+x>one) return x;	/* raise inexact */
-	    }
-	    id = -1;
-	} else {
-	x = fabs(x);
-	if (ix < 0x3ff30000) {		/* |x| < 1.1875 */
-	    if (ix < 0x3fe60000) {	/* 7/16 <=|x|<11/16 */
-		id = 0; x = (2.0*x-one)/(2.0+x);
-	    } else {			/* 11/16<=|x|< 19/16 */
-		id = 1; x  = (x-one)/(x+one);
-	    }
-	} else {
-	    if (ix < 0x40038000) {	/* |x| < 2.4375 */
-		id = 2; x  = (x-1.5)/(one+1.5*x);
-	    } else {			/* 2.4375 <= |x| < 2^66 */
-		id = 3; x  = -1.0/x;
-	    }
-	}}
-    /* end of argument reduction */
-	z = x*x;
-	w = z*z;
-    /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */
-	s1 = z*(aT[0]+w*(aT[2]+w*(aT[4]+w*(aT[6]+w*(aT[8]+w*aT[10])))));
-	s2 = w*(aT[1]+w*(aT[3]+w*(aT[5]+w*(aT[7]+w*aT[9]))));
-	if (id<0) return x - x*(s1+s2);
-	else {
-	    z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x);
-	    return (hx<0)? -z:z;
-	}
-}
-libm_hidden_def(atan)
diff --git a/deps/SDL2/src/libm/s_copysign.c b/deps/SDL2/src/libm/s_copysign.c
deleted file mode 100644
index afd43e9..0000000
--- a/deps/SDL2/src/libm/s_copysign.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* @(#)s_copysign.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: s_copysign.c,v 1.8 1995/05/10 20:46:57 jtc Exp $";
-#endif
-
-/*
- * copysign(double x, double y)
- * copysign(x,y) returns a value with the magnitude of x and
- * with the sign bit of y.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(copysign)
-#ifdef __STDC__
-     double copysign(double x, double y)
-#else
-     double copysign(x, y)
-     double x, y;
-#endif
-{
-    u_int32_t hx, hy;
-    GET_HIGH_WORD(hx, x);
-    GET_HIGH_WORD(hy, y);
-    SET_HIGH_WORD(x, (hx & 0x7fffffff) | (hy & 0x80000000));
-    return x;
-}
-
-libm_hidden_def(copysign)
diff --git a/deps/SDL2/src/libm/s_cos.c b/deps/SDL2/src/libm/s_cos.c
deleted file mode 100644
index 66b156c..0000000
--- a/deps/SDL2/src/libm/s_cos.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* @(#)s_cos.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: s_cos.c,v 1.7 1995/05/10 20:47:02 jtc Exp $";
-#endif
-
-/* cos(x)
- * Return cosine function of x.
- *
- * kernel function:
- *	__kernel_sin		... sine function on [-pi/4,pi/4]
- *	__kernel_cos		... cosine function on [-pi/4,pi/4]
- *	__ieee754_rem_pio2	... argument reduction routine
- *
- * Method.
- *      Let S,C and T denote the sin, cos and tan respectively on
- *	[-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2
- *	in [-pi/4 , +pi/4], and let n = k mod 4.
- *	We have
- *
- *          n        sin(x)      cos(x)        tan(x)
- *     ----------------------------------------------------------
- *	    0	       S	   C		 T
- *	    1	       C	  -S		-1/T
- *	    2	      -S	  -C		 T
- *	    3	      -C	   S		-1/T
- *     ----------------------------------------------------------
- *
- * Special cases:
- *      Let trig be any of sin, cos, or tan.
- *      trig(+-INF)  is NaN, with signals;
- *      trig(NaN)    is that NaN;
- *
- * Accuracy:
- *	TRIG(x) returns trig(x) nearly rounded
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(cos)
-#ifdef __STDC__
-     double cos(double x)
-#else
-     double cos(x)
-     double x;
-#endif
-{
-    double y[2], z = 0.0;
-    int32_t n, ix;
-
-    /* High word of x. */
-    GET_HIGH_WORD(ix, x);
-
-    /* |x| ~< pi/4 */
-    ix &= 0x7fffffff;
-    if (ix <= 0x3fe921fb)
-        return __kernel_cos(x, z);
-
-    /* cos(Inf or NaN) is NaN */
-    else if (ix >= 0x7ff00000)
-        return x - x;
-
-    /* argument reduction needed */
-    else {
-        n = __ieee754_rem_pio2(x, y);
-        switch (n & 3) {
-        case 0:
-            return __kernel_cos(y[0], y[1]);
-        case 1:
-            return -__kernel_sin(y[0], y[1], 1);
-        case 2:
-            return -__kernel_cos(y[0], y[1]);
-        default:
-            return __kernel_sin(y[0], y[1], 1);
-        }
-    }
-}
-
-libm_hidden_def(cos)
diff --git a/deps/SDL2/src/libm/s_fabs.c b/deps/SDL2/src/libm/s_fabs.c
deleted file mode 100644
index 5cf0c39..0000000
--- a/deps/SDL2/src/libm/s_fabs.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* @(#)s_fabs.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $";
-#endif
-
-/*
- * fabs(x) returns the absolute value of x.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(fabs)
-#ifdef __STDC__
-     double fabs(double x)
-#else
-     double fabs(x)
-     double x;
-#endif
-{
-    u_int32_t high;
-    GET_HIGH_WORD(high, x);
-    SET_HIGH_WORD(x, high & 0x7fffffff);
-    return x;
-}
-
-libm_hidden_def(fabs)
diff --git a/deps/SDL2/src/libm/s_floor.c b/deps/SDL2/src/libm/s_floor.c
deleted file mode 100644
index b553d30..0000000
--- a/deps/SDL2/src/libm/s_floor.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* @(#)s_floor.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: s_floor.c,v 1.8 1995/05/10 20:47:20 jtc Exp $";
-#endif
-
-/*
- * floor(x)
- * Return x rounded toward -inf to integral value
- * Method:
- *	Bit twiddling.
- * Exception:
- *	Inexact flag raised if x not equal to floor(x).
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-#ifdef __STDC__
-static const double huge_val = 1.0e300;
-#else
-static double huge_val = 1.0e300;
-#endif
-
-libm_hidden_proto(floor)
-#ifdef __STDC__
-     double floor(double x)
-#else
-     double floor(x)
-     double x;
-#endif
-{
-    int32_t i0, i1, j0;
-    u_int32_t i, j;
-    EXTRACT_WORDS(i0, i1, x);
-    j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
-    if (j0 < 20) {
-        if (j0 < 0) {           /* raise inexact if x != 0 */
-            if (huge_val + x > 0.0) {       /* return 0*sign(x) if |x|<1 */
-                if (i0 >= 0) {
-                    i0 = i1 = 0;
-                } else if (((i0 & 0x7fffffff) | i1) != 0) {
-                    i0 = 0xbff00000;
-                    i1 = 0;
-                }
-            }
-        } else {
-            i = (0x000fffff) >> j0;
-            if (((i0 & i) | i1) == 0)
-                return x;       /* x is integral */
-            if (huge_val + x > 0.0) {       /* raise inexact flag */
-                if (i0 < 0)
-                    i0 += (0x00100000) >> j0;
-                i0 &= (~i);
-                i1 = 0;
-            }
-        }
-    } else if (j0 > 51) {
-        if (j0 == 0x400)
-            return x + x;       /* inf or NaN */
-        else
-            return x;           /* x is integral */
-    } else {
-        i = ((u_int32_t) (0xffffffff)) >> (j0 - 20);
-        if ((i1 & i) == 0)
-            return x;           /* x is integral */
-        if (huge_val + x > 0.0) {   /* raise inexact flag */
-            if (i0 < 0) {
-                if (j0 == 20)
-                    i0 += 1;
-                else {
-                    j = i1 + (1 << (52 - j0));
-                    if (j < (u_int32_t) i1)
-                        i0 += 1;        /* got a carry */
-                    i1 = j;
-                }
-            }
-            i1 &= (~i);
-        }
-    }
-    INSERT_WORDS(x, i0, i1);
-    return x;
-}
-
-libm_hidden_def(floor)
diff --git a/deps/SDL2/src/libm/s_scalbn.c b/deps/SDL2/src/libm/s_scalbn.c
deleted file mode 100644
index f824e92..0000000
--- a/deps/SDL2/src/libm/s_scalbn.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* @(#)s_scalbn.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: s_scalbn.c,v 1.8 1995/05/10 20:48:08 jtc Exp $";
-#endif
-
-/*
- * scalbn (double x, int n)
- * scalbn(x,n) returns x* 2**n  computed by  exponent
- * manipulation rather than by actually performing an
- * exponentiation or a multiplication.
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(copysign)
-#ifdef __STDC__
-     static const double
-#else
-     static double
-#endif
-       two54 = 1.80143985094819840000e+16,      /* 0x43500000, 0x00000000 */
-         twom54 = 5.55111512312578270212e-17,   /* 0x3C900000, 0x00000000 */
-         huge_val = 1.0e+300, tiny = 1.0e-300;
-
-libm_hidden_proto(scalbn)
-#ifdef __STDC__
-     double scalbn(double x, int n)
-#else
-     double scalbn(x, n)
-     double x;
-     int n;
-#endif
-{
-    int32_t k, hx, lx;
-    EXTRACT_WORDS(hx, lx, x);
-    k = (hx & 0x7ff00000) >> 20;        /* extract exponent */
-    if (k == 0) {               /* 0 or subnormal x */
-        if ((lx | (hx & 0x7fffffff)) == 0)
-            return x;           /* +-0 */
-        x *= two54;
-        GET_HIGH_WORD(hx, x);
-        k = ((hx & 0x7ff00000) >> 20) - 54;
-        if (n < -50000)
-            return tiny * x;    /* underflow */
-    }
-    if (k == 0x7ff)
-        return x + x;           /* NaN or Inf */
-    k = k + n;
-    if (k > 0x7fe)
-        return huge_val * copysign(huge_val, x);        /* overflow  */
-    if (k > 0) {                /* normal result */
-        SET_HIGH_WORD(x, (hx & 0x800fffff) | (k << 20));
-        return x;
-    }
-    if (k <= -54) {
-        if (n > 50000)          /* in case integer overflow in n+k */
-            return huge_val * copysign(huge_val, x);    /* overflow */
-        else
-            return tiny * copysign(tiny, x);    /* underflow */
-    }
-    k += 54;                    /* subnormal result */
-    SET_HIGH_WORD(x, (hx & 0x800fffff) | (k << 20));
-    return x * twom54;
-}
-
-libm_hidden_def(scalbn)
diff --git a/deps/SDL2/src/libm/s_sin.c b/deps/SDL2/src/libm/s_sin.c
deleted file mode 100644
index 7711766..0000000
--- a/deps/SDL2/src/libm/s_sin.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* @(#)s_sin.c 5.1 93/09/24 */
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static const char rcsid[] =
-    "$NetBSD: s_sin.c,v 1.7 1995/05/10 20:48:15 jtc Exp $";
-#endif
-
-/* sin(x)
- * Return sine function of x.
- *
- * kernel function:
- *	__kernel_sin		... sine function on [-pi/4,pi/4]
- *	__kernel_cos		... cose function on [-pi/4,pi/4]
- *	__ieee754_rem_pio2	... argument reduction routine
- *
- * Method.
- *      Let S,C and T denote the sin, cos and tan respectively on
- *	[-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2
- *	in [-pi/4 , +pi/4], and let n = k mod 4.
- *	We have
- *
- *          n        sin(x)      cos(x)        tan(x)
- *     ----------------------------------------------------------
- *	    0	       S	   C		 T
- *	    1	       C	  -S		-1/T
- *	    2	      -S	  -C		 T
- *	    3	      -C	   S		-1/T
- *     ----------------------------------------------------------
- *
- * Special cases:
- *      Let trig be any of sin, cos, or tan.
- *      trig(+-INF)  is NaN, with signals;
- *      trig(NaN)    is that NaN;
- *
- * Accuracy:
- *	TRIG(x) returns trig(x) nearly rounded
- */
-
-#include "math_libm.h"
-#include "math_private.h"
-
-libm_hidden_proto(sin)
-#ifdef __STDC__
-     double sin(double x)
-#else
-     double sin(x)
-     double x;
-#endif
-{
-    double y[2], z = 0.0;
-    int32_t n, ix;
-
-    /* High word of x. */
-    GET_HIGH_WORD(ix, x);
-
-    /* |x| ~< pi/4 */
-    ix &= 0x7fffffff;
-    if (ix <= 0x3fe921fb)
-        return __kernel_sin(x, z, 0);
-
-    /* sin(Inf or NaN) is NaN */
-    else if (ix >= 0x7ff00000)
-        return x - x;
-
-    /* argument reduction needed */
-    else {
-        n = __ieee754_rem_pio2(x, y);
-        switch (n & 3) {
-        case 0:
-            return __kernel_sin(y[0], y[1], 1);
-        case 1:
-            return __kernel_cos(y[0], y[1]);
-        case 2:
-            return -__kernel_sin(y[0], y[1], 1);
-        default:
-            return -__kernel_cos(y[0], y[1]);
-        }
-    }
-}
-
-libm_hidden_def(sin)
diff --git a/deps/SDL2/src/loadso/beos/SDL_sysloadso.c b/deps/SDL2/src/loadso/beos/SDL_sysloadso.c
deleted file mode 100644
index 524cd71..0000000
--- a/deps/SDL2/src/loadso/beos/SDL_sysloadso.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_BEOS
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines                           */
-
-#include <stdio.h>
-#include <be/kernel/image.h>
-
-#include "SDL_loadso.h"
-
-void *
-SDL_LoadObject(const char *sofile)
-{
-    void *handle = NULL;
-    image_id library_id = load_add_on(sofile);
-    if (library_id < 0) {
-        SDL_SetError(strerror((int) library_id));
-    } else {
-        handle = (void *) (library_id);
-    }
-    return (handle);
-}
-
-void *
-SDL_LoadFunction(void *handle, const char *name)
-{
-    void *sym = NULL;
-    image_id library_id = (image_id) handle;
-    status_t rc =
-        get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
-    if (rc != B_NO_ERROR) {
-        SDL_SetError(strerror(rc));
-    }
-    return (sym);
-}
-
-void
-SDL_UnloadObject(void *handle)
-{
-    image_id library_id;
-    if (handle != NULL) {
-        library_id = (image_id) handle;
-        unload_add_on(library_id);
-    }
-}
-
-#endif /* SDL_LOADSO_BEOS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/loadso/dlopen/SDL_sysloadso.c b/deps/SDL2/src/loadso/dlopen/SDL_sysloadso.c
deleted file mode 100644
index c2cbdd4..0000000
--- a/deps/SDL2/src/loadso/dlopen/SDL_sysloadso.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_DLOPEN
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines                           */
-
-#include <stdio.h>
-#include <dlfcn.h>
-
-#include "SDL_loadso.h"
-
-void *
-SDL_LoadObject(const char *sofile)
-{
-    void *handle = dlopen(sofile, RTLD_NOW|RTLD_LOCAL);
-    const char *loaderror = (char *) dlerror();
-    if (handle == NULL) {
-        SDL_SetError("Failed loading %s: %s", sofile, loaderror);
-    }
-    return (handle);
-}
-
-void *
-SDL_LoadFunction(void *handle, const char *name)
-{
-    void *symbol = dlsym(handle, name);
-    if (symbol == NULL) {
-        /* append an underscore for platforms that need that. */
-        size_t len = 1 + SDL_strlen(name) + 1;
-        char *_name = SDL_stack_alloc(char, len);
-        _name[0] = '_';
-        SDL_strlcpy(&_name[1], name, len);
-        symbol = dlsym(handle, _name);
-        SDL_stack_free(_name);
-        if (symbol == NULL) {
-            SDL_SetError("Failed loading %s: %s", name,
-                         (const char *) dlerror());
-        }
-    }
-    return (symbol);
-}
-
-void
-SDL_UnloadObject(void *handle)
-{
-    if (handle != NULL) {
-        dlclose(handle);
-    }
-}
-
-#endif /* SDL_LOADSO_DLOPEN */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/loadso/dummy/SDL_sysloadso.c b/deps/SDL2/src/loadso/dummy/SDL_sysloadso.c
deleted file mode 100644
index d890a14..0000000
--- a/deps/SDL2/src/loadso/dummy/SDL_sysloadso.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(SDL_LOADSO_DUMMY) || defined(SDL_LOADSO_DISABLED)
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines                           */
-
-#include "SDL_loadso.h"
-
-void *
-SDL_LoadObject(const char *sofile)
-{
-    const char *loaderror = "SDL_LoadObject() not implemented";
-    SDL_SetError("Failed loading %s: %s", sofile, loaderror);
-    return (NULL);
-}
-
-void *
-SDL_LoadFunction(void *handle, const char *name)
-{
-    const char *loaderror = "SDL_LoadFunction() not implemented";
-    SDL_SetError("Failed loading %s: %s", name, loaderror);
-    return (NULL);
-}
-
-void
-SDL_UnloadObject(void *handle)
-{
-    /* no-op. */
-}
-
-#endif /* SDL_LOADSO_DUMMY || SDL_LOADSO_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/loadso/windows/SDL_sysloadso.c b/deps/SDL2/src/loadso/windows/SDL_sysloadso.c
deleted file mode 100644
index 21e7a6c..0000000
--- a/deps/SDL2/src/loadso/windows/SDL_sysloadso.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_WINDOWS
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines                           */
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_loadso.h"
-
-void *
-SDL_LoadObject(const char *sofile)
-{
-    LPTSTR tstr = WIN_UTF8ToString(sofile);
-    void *handle = (void *) LoadLibrary(tstr);
-    SDL_free(tstr);
-
-    /* Generate an error message if all loads failed */
-    if (handle == NULL) {
-        char errbuf[512];
-        SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf));
-        SDL_strlcat(errbuf, sofile, SDL_arraysize(errbuf));
-        WIN_SetError(errbuf);
-    }
-    return handle;
-}
-
-void *
-SDL_LoadFunction(void *handle, const char *name)
-{
-    void *symbol = (void *) GetProcAddress((HMODULE) handle, name);
-    if (symbol == NULL) {
-        char errbuf[512];
-        SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf));
-        SDL_strlcat(errbuf, name, SDL_arraysize(errbuf));
-        WIN_SetError(errbuf);
-    }
-    return symbol;
-}
-
-void
-SDL_UnloadObject(void *handle)
-{
-    if (handle != NULL) {
-        FreeLibrary((HMODULE) handle);
-    }
-}
-
-#endif /* SDL_LOADSO_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/main/android/SDL_android_main.c b/deps/SDL2/src/main/android/SDL_android_main.c
deleted file mode 100644
index 8f00f39..0000000
--- a/deps/SDL2/src/main/android/SDL_android_main.c
+++ /dev/null
@@ -1,38 +0,0 @@
-
-#include "SDL_config.h"
-
-#ifdef __ANDROID__
-
-/* Include the SDL main definition header */
-#include "SDL_main.h"
-
-/*******************************************************************************
-                 Functions called by JNI
-*******************************************************************************/
-#include <jni.h>
-
-/* Called before SDL_main() to initialize JNI bindings in SDL library */
-extern void SDL_Android_Init(JNIEnv* env, jclass cls);
-
-/* Start up the SDL app */
-void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj)
-{
-    /* This interface could expand with ABI negotiation, calbacks, etc. */
-    SDL_Android_Init(env, cls);
-
-    SDL_SetMainReady();
-
-    /* Run the application code! */
-    int status;
-    char *argv[2];
-    argv[0] = SDL_strdup("SDL_app");
-    argv[1] = NULL;
-    status = SDL_main(1, argv);
-
-    /* Do not issue an exit or the whole application will terminate instead of just the SDL thread */
-    /* exit(status); */
-}
-
-#endif /* __ANDROID__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/main/beos/SDL_BApp.h b/deps/SDL2/src/main/beos/SDL_BApp.h
deleted file mode 100644
index 9b731e3..0000000
--- a/deps/SDL2/src/main/beos/SDL_BApp.h
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef SDL_BAPP_H
-#define SDL_BAPP_H
-
-#include <InterfaceKit.h>
-#include <OpenGLKit.h>
-
-#include "../../video/bwindow/SDL_bkeyboard.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-
-/* Local includes */
-#include "../../events/SDL_events_c.h"
-#include "../../video/bwindow/SDL_bkeyboard.h"
-#include "../../video/bwindow/SDL_bframebuffer.h"
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <vector>
-
-
-
-
-/* Forward declarations */
-class SDL_BWin;
-
-/* Message constants */
-enum ToSDL {
-    /* Intercepted by BWindow on its way to BView */
-    BAPP_MOUSE_MOVED,
-    BAPP_MOUSE_BUTTON,
-    BAPP_MOUSE_WHEEL,
-    BAPP_KEY,
-    BAPP_REPAINT,           /* from _UPDATE_ */
-    /* From BWindow */
-    BAPP_MAXIMIZE,          /* from B_ZOOM */
-    BAPP_MINIMIZE,
-    BAPP_RESTORE,           /* TODO: IMPLEMENT! */
-    BAPP_SHOW,
-    BAPP_HIDE,
-    BAPP_MOUSE_FOCUS,       /* caused by MOUSE_MOVE */
-    BAPP_KEYBOARD_FOCUS,    /* from WINDOW_ACTIVATED */
-    BAPP_WINDOW_CLOSE_REQUESTED,
-    BAPP_WINDOW_MOVED,
-    BAPP_WINDOW_RESIZED,
-    BAPP_SCREEN_CHANGED
-};
-
-
-
-/* Create a descendant of BApplication */
-class SDL_BApp : public BApplication {
-public:
-    SDL_BApp(const char* signature) :
-        BApplication(signature) {
-        _current_context = NULL;
-    }
-
-
-    virtual ~SDL_BApp() {
-    }
-
-
-
-        /* Event-handling functions */
-    virtual void MessageReceived(BMessage* message) {
-        /* Sort out SDL-related messages */
-        switch ( message->what ) {
-        case BAPP_MOUSE_MOVED:
-            _HandleMouseMove(message);
-            break;
-
-        case BAPP_MOUSE_BUTTON:
-            _HandleMouseButton(message);
-            break;
-
-        case BAPP_MOUSE_WHEEL:
-            _HandleMouseWheel(message);
-            break;
-
-        case BAPP_KEY:
-            _HandleKey(message);
-            break;
-
-        case BAPP_REPAINT:
-            _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_EXPOSED);
-            break;
-
-        case BAPP_MAXIMIZE:
-            _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_MAXIMIZED);
-            break;
-
-        case BAPP_MINIMIZE:
-            _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_MINIMIZED);
-            break;
-
-        case BAPP_SHOW:
-            _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_SHOWN);
-            break;
-
-        case BAPP_HIDE:
-            _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_HIDDEN);
-            break;
-
-        case BAPP_MOUSE_FOCUS:
-            _HandleMouseFocus(message);
-            break;
-
-        case BAPP_KEYBOARD_FOCUS:
-            _HandleKeyboardFocus(message);
-            break;
-
-        case BAPP_WINDOW_CLOSE_REQUESTED:
-            _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_CLOSE);
-            break;
-
-        case BAPP_WINDOW_MOVED:
-            _HandleWindowMoved(message);
-            break;
-
-        case BAPP_WINDOW_RESIZED:
-            _HandleWindowResized(message);
-            break;
-
-        case BAPP_SCREEN_CHANGED:
-            /* TODO: Handle screen resize or workspace change */
-            break;
-
-        default:
-           BApplication::MessageReceived(message);
-           break;
-        }
-    }
-
-    /* Window creation/destruction methods */
-    int32 GetID(SDL_Window *win) {
-        int32 i;
-        for(i = 0; i < _GetNumWindowSlots(); ++i) {
-            if( GetSDLWindow(i) == NULL ) {
-                _SetSDLWindow(win, i);
-                return i;
-            }
-        }
-
-        /* Expand the vector if all slots are full */
-        if( i == _GetNumWindowSlots() ) {
-            _PushBackWindow(win);
-            return i;
-        }
-
-        /* TODO: error handling */
-        return 0;
-    }
-
-    /* FIXME: Bad coding practice, but I can't include SDL_BWin.h here.  Is
-       there another way to do this? */
-    void ClearID(SDL_BWin *bwin); /* Defined in SDL_BeApp.cc */
-
-
-    SDL_Window *GetSDLWindow(int32 winID) {
-        return _window_map[winID];
-    }
-
-    void SetCurrentContext(BGLView *newContext) {
-        if(_current_context)
-            _current_context->UnlockGL();
-        _current_context = newContext;
-        _current_context->LockGL();
-    }
-private:
-    /* Event management */
-    void _HandleBasicWindowEvent(BMessage *msg, int32 sdlEventType) {
-        SDL_Window *win;
-        int32 winID;
-        if(
-            !_GetWinID(msg, &winID)
-        ) {
-            return;
-        }
-        win = GetSDLWindow(winID);
-        SDL_SendWindowEvent(win, sdlEventType, 0, 0);
-    }
-
-    void _HandleMouseMove(BMessage *msg) {
-        SDL_Window *win;
-        int32 winID;
-        int32 x = 0, y = 0;
-        if(
-            !_GetWinID(msg, &winID) ||
-            msg->FindInt32("x", &x) != B_OK || /* x movement */
-            msg->FindInt32("y", &y) != B_OK    /* y movement */
-        ) {
-            return;
-        }
-        win = GetSDLWindow(winID);
-        SDL_SendMouseMotion(win, 0, 0, x, y);
-
-        /* Tell the application that the mouse passed over, redraw needed */
-        BE_UpdateWindowFramebuffer(NULL,win,NULL,-1);
-    }
-
-    void _HandleMouseButton(BMessage *msg) {
-        SDL_Window *win;
-        int32 winID;
-        int32 button, state;    /* left/middle/right, pressed/released */
-        if(
-            !_GetWinID(msg, &winID) ||
-            msg->FindInt32("button-id", &button) != B_OK ||
-            msg->FindInt32("button-state", &state) != B_OK
-        ) {
-            return;
-        }
-        win = GetSDLWindow(winID);
-        SDL_SendMouseButton(win, 0, state, button);
-    }
-
-    void _HandleMouseWheel(BMessage *msg) {
-        SDL_Window *win;
-        int32 winID;
-        int32 xTicks, yTicks;
-        if(
-            !_GetWinID(msg, &winID) ||
-            msg->FindInt32("xticks", &xTicks) != B_OK ||
-            msg->FindInt32("yticks", &yTicks) != B_OK
-        ) {
-            return;
-        }
-        win = GetSDLWindow(winID);
-        SDL_SendMouseWheel(win, 0, xTicks, yTicks);
-    }
-
-    void _HandleKey(BMessage *msg) {
-        int32 scancode, state;  /* scancode, pressed/released */
-        if(
-            msg->FindInt32("key-state", &state) != B_OK ||
-            msg->FindInt32("key-scancode", &scancode) != B_OK
-        ) {
-            return;
-        }
-
-        /* Make sure this isn't a repeated event (key pressed and held) */
-        if(state == SDL_PRESSED && BE_GetKeyState(scancode) == SDL_PRESSED) {
-            return;
-        }
-        BE_SetKeyState(scancode, state);
-        SDL_SendKeyboardKey(state, BE_GetScancodeFromBeKey(scancode));
-    }
-
-    void _HandleMouseFocus(BMessage *msg) {
-        SDL_Window *win;
-        int32 winID;
-        bool bSetFocus; /* If false, lose focus */
-        if(
-            !_GetWinID(msg, &winID) ||
-            msg->FindBool("focusGained", &bSetFocus) != B_OK
-        ) {
-            return;
-        }
-        win = GetSDLWindow(winID);
-        if(bSetFocus) {
-            SDL_SetMouseFocus(win);
-        } else if(SDL_GetMouseFocus() == win) {
-            /* Only lose all focus if this window was the current focus */
-            SDL_SetMouseFocus(NULL);
-        }
-    }
-
-    void _HandleKeyboardFocus(BMessage *msg) {
-        SDL_Window *win;
-        int32 winID;
-        bool bSetFocus; /* If false, lose focus */
-        if(
-            !_GetWinID(msg, &winID) ||
-            msg->FindBool("focusGained", &bSetFocus) != B_OK
-        ) {
-            return;
-        }
-        win = GetSDLWindow(winID);
-        if(bSetFocus) {
-            SDL_SetKeyboardFocus(win);
-        } else if(SDL_GetKeyboardFocus() == win) {
-            /* Only lose all focus if this window was the current focus */
-            SDL_SetKeyboardFocus(NULL);
-        }
-    }
-
-    void _HandleWindowMoved(BMessage *msg) {
-        SDL_Window *win;
-        int32 winID;
-        int32 xPos, yPos;
-        /* Get the window id and new x/y position of the window */
-        if(
-            !_GetWinID(msg, &winID) ||
-            msg->FindInt32("window-x", &xPos) != B_OK ||
-            msg->FindInt32("window-y", &yPos) != B_OK
-        ) {
-            return;
-        }
-        win = GetSDLWindow(winID);
-        SDL_SendWindowEvent(win, SDL_WINDOWEVENT_MOVED, xPos, yPos);
-    }
-
-    void _HandleWindowResized(BMessage *msg) {
-        SDL_Window *win;
-        int32 winID;
-        int32 w, h;
-        /* Get the window id ]and new x/y position of the window */
-        if(
-            !_GetWinID(msg, &winID) ||
-            msg->FindInt32("window-w", &w) != B_OK ||
-            msg->FindInt32("window-h", &h) != B_OK
-        ) {
-            return;
-        }
-        win = GetSDLWindow(winID);
-        SDL_SendWindowEvent(win, SDL_WINDOWEVENT_RESIZED, w, h);
-    }
-
-    bool _GetWinID(BMessage *msg, int32 *winID) {
-        return msg->FindInt32("window-id", winID) == B_OK;
-    }
-
-
-
-    /* Vector functions: Wraps vector stuff in case we need to change
-       implementation */
-    void _SetSDLWindow(SDL_Window *win, int32 winID) {
-        _window_map[winID] = win;
-    }
-
-    int32 _GetNumWindowSlots() {
-        return _window_map.size();
-    }
-
-
-    void _PopBackWindow() {
-        _window_map.pop_back();
-    }
-
-    void _PushBackWindow(SDL_Window *win) {
-        _window_map.push_back(win);
-    }
-
-
-    /* Members */
-    std::vector<SDL_Window*> _window_map; /* Keeps track of SDL_Windows by index-id */
-
-    display_mode *_saved_mode;
-    BGLView      *_current_context;
-};
-
-#endif
diff --git a/deps/SDL2/src/main/beos/SDL_BeApp.cc b/deps/SDL2/src/main/beos/SDL_BeApp.cc
deleted file mode 100644
index fb622ab..0000000
--- a/deps/SDL2/src/main/beos/SDL_BeApp.cc
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(__BEOS__) || defined(__HAIKU__)
-
-/* Handle the BeApp specific portions of the application */
-
-#include <AppKit.h>
-#include <storage/Path.h>
-#include <storage/Entry.h>
-#include <unistd.h>
-
-#include "SDL_BApp.h"	/* SDL_BApp class definition */
-#include "SDL_BeApp.h"
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "SDL_error.h"
-
-#include "../../video/bwindow/SDL_BWin.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* Flag to tell whether or not the Be application is active or not */
-int SDL_BeAppActive = 0;
-static SDL_Thread *SDL_AppThread = NULL;
-
-static int
-StartBeApp(void *unused)
-{
-    BApplication *App;
-
-    App = new SDL_BApp("application/x-SDL-executable");
-
-    App->Run();
-    delete App;
-    return (0);
-}
-
-/* Initialize the Be Application, if it's not already started */
-int
-SDL_InitBeApp(void)
-{
-    /* Create the BApplication that handles appserver interaction */
-    if (SDL_BeAppActive <= 0) {
-        SDL_AppThread = SDL_CreateThread(StartBeApp, "SDLApplication", NULL);
-        if (SDL_AppThread == NULL) {
-            return SDL_SetError("Couldn't create BApplication thread");
-        }
-
-        /* Change working to directory to that of executable */
-        app_info info;
-        if (B_OK == be_app->GetAppInfo(&info)) {
-            entry_ref ref = info.ref;
-            BEntry entry;
-            if (B_OK == entry.SetTo(&ref)) {
-                BPath path;
-                if (B_OK == path.SetTo(&entry)) {
-                    if (B_OK == path.GetParent(&path)) {
-                        chdir(path.Path());
-                    }
-                }
-            }
-        }
-
-        do {
-            SDL_Delay(10);
-        } while ((be_app == NULL) || be_app->IsLaunching());
-
-        /* Mark the application active */
-        SDL_BeAppActive = 0;
-    }
-
-    /* Increment the application reference count */
-    ++SDL_BeAppActive;
-
-    /* The app is running, and we're ready to go */
-    return (0);
-}
-
-/* Quit the Be Application, if there's nothing left to do */
-void
-SDL_QuitBeApp(void)
-{
-    /* Decrement the application reference count */
-    --SDL_BeAppActive;
-
-    /* If the reference count reached zero, clean up the app */
-    if (SDL_BeAppActive == 0) {
-        if (SDL_AppThread != NULL) {
-            if (be_app != NULL) {       /* Not tested */
-                be_app->PostMessage(B_QUIT_REQUESTED);
-            }
-            SDL_WaitThread(SDL_AppThread, NULL);
-            SDL_AppThread = NULL;
-        }
-        /* be_app should now be NULL since be_app has quit */
-    }
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-/* SDL_BApp functions */
-void SDL_BApp::ClearID(SDL_BWin *bwin) {
-	_SetSDLWindow(NULL, bwin->GetID());
-	int32 i = _GetNumWindowSlots() - 1;
-	while(i >= 0 && GetSDLWindow(i) == NULL) {
-		_PopBackWindow();
-		--i;
-	}
-}
-
-#endif /* __BEOS__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/main/beos/SDL_BeApp.h b/deps/SDL2/src/main/beos/SDL_BeApp.h
deleted file mode 100644
index 5bc5251..0000000
--- a/deps/SDL2/src/main/beos/SDL_BeApp.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* Handle the BeApp specific portions of the application */
-
-/* Initialize the Be Application, if it's not already started */
-extern int SDL_InitBeApp(void);
-
-/* Quit the Be Application, if there's nothing left to do */
-extern void SDL_QuitBeApp(void);
-
-/* Flag to tell whether the app is active or not */
-extern int SDL_BeAppActive;
-/* vi: set ts=4 sw=4 expandtab: */
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/deps/SDL2/src/main/dummy/SDL_dummy_main.c b/deps/SDL2/src/main/dummy/SDL_dummy_main.c
deleted file mode 100644
index 8795523..0000000
--- a/deps/SDL2/src/main/dummy/SDL_dummy_main.c
+++ /dev/null
@@ -1,25 +0,0 @@
-
-/* Include the SDL main definition header */
-#include "SDL_config.h"
-#include "SDL_main.h"
-
-#ifdef main
-#undef main
-int
-main(int argc, char *argv[])
-{
-    return (SDL_main(argc, argv));
-}
-#else
-/* Nothing to do on this platform */
-int
-SDL_main_stub_symbol(void);
-
-int
-SDL_main_stub_symbol(void)
-{
-    return 0;
-}
-#endif
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/main/psp/SDL_psp_main.c b/deps/SDL2/src/main/psp/SDL_psp_main.c
deleted file mode 100644
index 77ef39d..0000000
--- a/deps/SDL2/src/main/psp/SDL_psp_main.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_main.h"
-#include <pspkernel.h>
-#include <pspdebug.h>
-#include <pspsdk.h>
-#include <pspthreadman.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-/* If application's main() is redefined as SDL_main, and libSDLmain is
-   linked, then this file will create the standard exit callback,
-   define the PSP_MODULE_INFO macro, and exit back to the browser when
-   the program is finished.
-
-   You can still override other parameters in your own code if you
-   desire, such as PSP_HEAP_SIZE_KB, PSP_MAIN_THREAD_ATTR,
-   PSP_MAIN_THREAD_STACK_SIZE, etc.
-*/
-
-PSP_MODULE_INFO("SDL App", 0, 1, 1);
-
-int sdl_psp_exit_callback(int arg1, int arg2, void *common)
-{
-    exit(0);
-    return 0;
-}
-
-int sdl_psp_callback_thread(SceSize args, void *argp)
-{
-    int cbid;
-    cbid = sceKernelCreateCallback("Exit Callback",
-                       sdl_psp_exit_callback, NULL);
-    sceKernelRegisterExitCallback(cbid);
-    sceKernelSleepThreadCB();
-    return 0;
-}
-
-int sdl_psp_setup_callbacks(void)
-{
-    int thid = 0;
-    thid = sceKernelCreateThread("update_thread",
-                     sdl_psp_callback_thread, 0x11, 0xFA0, 0, 0);
-    if(thid >= 0)
-        sceKernelStartThread(thid, 0, 0);
-    return thid;
-}
-
-int main(int argc, char *argv[])
-{
-    pspDebugScreenInit();
-    sdl_psp_setup_callbacks();
-
-    /* Register sceKernelExitGame() to be called when we exit */
-    atexit(sceKernelExitGame);
-
-    SDL_SetMainReady();
-
-    (void)SDL_main(argc, argv);
-    return 0;
-}
diff --git a/deps/SDL2/src/main/windows/SDL_windows_main.c b/deps/SDL2/src/main/windows/SDL_windows_main.c
deleted file mode 100644
index 4e8e3f2..0000000
--- a/deps/SDL2/src/main/windows/SDL_windows_main.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
-    SDL_main.c, placed in the public domain by Sam Lantinga  4/13/98
-
-    The WinMain function -- calls your program's main() function
-*/
-#include "SDL_config.h"
-
-#ifdef __WIN32__
-
-/* Include this so we define UNICODE properly */
-#include "../../core/windows/SDL_windows.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/* Include the SDL main definition header */
-#include "SDL.h"
-#include "SDL_main.h"
-
-#ifdef main
-#  undef main
-#endif /* main */
-
-static void
-UnEscapeQuotes(char *arg)
-{
-    char *last = NULL;
-
-    while (*arg) {
-        if (*arg == '"' && (last != NULL && *last == '\\')) {
-            char *c_curr = arg;
-            char *c_last = last;
-
-            while (*c_curr) {
-                *c_last = *c_curr;
-                c_last = c_curr;
-                c_curr++;
-            }
-            *c_last = '\0';
-        }
-        last = arg;
-        arg++;
-    }
-}
-
-/* Parse a command line buffer into arguments */
-static int
-ParseCommandLine(char *cmdline, char **argv)
-{
-    char *bufp;
-    char *lastp = NULL;
-    int argc, last_argc;
-
-    argc = last_argc = 0;
-    for (bufp = cmdline; *bufp;) {
-        /* Skip leading whitespace */
-        while (SDL_isspace(*bufp)) {
-            ++bufp;
-        }
-        /* Skip over argument */
-        if (*bufp == '"') {
-            ++bufp;
-            if (*bufp) {
-                if (argv) {
-                    argv[argc] = bufp;
-                }
-                ++argc;
-            }
-            /* Skip over word */
-            lastp = bufp;
-            while (*bufp && (*bufp != '"' || *lastp == '\\')) {
-                lastp = bufp;
-                ++bufp;
-            }
-        } else {
-            if (*bufp) {
-                if (argv) {
-                    argv[argc] = bufp;
-                }
-                ++argc;
-            }
-            /* Skip over word */
-            while (*bufp && !SDL_isspace(*bufp)) {
-                ++bufp;
-            }
-        }
-        if (*bufp) {
-            if (argv) {
-                *bufp = '\0';
-            }
-            ++bufp;
-        }
-
-        /* Strip out \ from \" sequences */
-        if (argv && last_argc != argc) {
-            UnEscapeQuotes(argv[last_argc]);
-        }
-        last_argc = argc;
-    }
-    if (argv) {
-        argv[argc] = NULL;
-    }
-    return (argc);
-}
-
-/* Show an error message */
-static void
-ShowError(const char *title, const char *message)
-{
-/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */
-#ifdef USE_MESSAGEBOX
-    MessageBox(NULL, message, title, MB_ICONEXCLAMATION | MB_OK);
-#else
-    fprintf(stderr, "%s: %s\n", title, message);
-#endif
-}
-
-/* Pop up an out of memory message, returns to Windows */
-static BOOL
-OutOfMemory(void)
-{
-    ShowError("Fatal Error", "Out of memory - aborting");
-    return FALSE;
-}
-
-#if defined(_MSC_VER)
-/* The VC++ compiler needs main defined */
-#define console_main main
-#endif
-
-/* This is where execution begins [console apps] */
-int
-console_main(int argc, char *argv[])
-{
-    int status;
-
-    SDL_SetMainReady();
-
-    /* Run the application main() code */
-    status = SDL_main(argc, argv);
-
-    /* Exit cleanly, calling atexit() functions */
-    exit(status);
-
-    /* Hush little compiler, don't you cry... */
-    return 0;
-}
-
-/* This is where execution begins [windowed apps] */
-int WINAPI
-WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
-{
-    char **argv;
-    int argc;
-    char *cmdline;
-
-    /* Grab the command line */
-    TCHAR *text = GetCommandLine();
-#if UNICODE
-    cmdline = SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(text), (SDL_wcslen(text)+1)*sizeof(WCHAR));
-#else
-    cmdline = SDL_strdup(text);
-#endif
-    if (cmdline == NULL) {
-        return OutOfMemory();
-    }
-
-    /* Parse it into argv and argc */
-    argc = ParseCommandLine(cmdline, NULL);
-    argv = SDL_stack_alloc(char *, argc + 1);
-    if (argv == NULL) {
-        return OutOfMemory();
-    }
-    ParseCommandLine(cmdline, argv);
-
-    /* Run the main program */
-    console_main(argc, argv);
-
-    SDL_stack_free(argv);
-
-    SDL_free(cmdline);
-
-    /* Hush little compiler, don't you cry... */
-    return 0;
-}
-
-#endif /* __WIN32__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/main/windows/version.rc b/deps/SDL2/src/main/windows/version.rc
deleted file mode 100644
index b096a91..0000000
--- a/deps/SDL2/src/main/windows/version.rc
+++ /dev/null
@@ -1,38 +0,0 @@
-
-#include "winresrc.h"
-
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,1,0
- PRODUCTVERSION 2,0,1,0
- FILEFLAGSMASK 0x3fL
- FILEFLAGS 0x0L
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904b0"
-        BEGIN
-            VALUE "CompanyName", "\0"
-            VALUE "FileDescription", "SDL\0"
-            VALUE "FileVersion", "2, 0, 1, 0\0"
-            VALUE "InternalName", "SDL\0"
-            VALUE "LegalCopyright", "Copyright © 2013 Sam Lantinga\0"
-            VALUE "OriginalFilename", "SDL2.dll\0"
-            VALUE "ProductName", "Simple DirectMedia Layer\0"
-            VALUE "ProductVersion", "2, 0, 1, 0\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
-END
diff --git a/deps/SDL2/src/power/SDL_power.c b/deps/SDL2/src/power/SDL_power.c
deleted file mode 100644
index b8f3ae4..0000000
--- a/deps/SDL2/src/power/SDL_power.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-#include "SDL_power.h"
-
-/*
- * Returns SDL_TRUE if we have a definitive answer.
- * SDL_FALSE to try next implementation.
- */
-typedef SDL_bool
-    (*SDL_GetPowerInfo_Impl) (SDL_PowerState * state, int *seconds,
-                              int *percent);
-
-SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_BeOS(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *);
-SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *, int *, int *);
-
-#ifndef SDL_POWER_DISABLED
-#ifdef SDL_POWER_HARDWIRED
-/* This is for things that _never_ have a battery */
-static SDL_bool
-SDL_GetPowerInfo_Hardwired(SDL_PowerState * state, int *seconds, int *percent)
-{
-    *seconds = -1;
-    *percent = -1;
-    *state = SDL_POWERSTATE_NO_BATTERY;
-    return SDL_TRUE;
-}
-#endif
-#endif
-
-
-static SDL_GetPowerInfo_Impl implementations[] = {
-#ifndef SDL_POWER_DISABLED
-#ifdef SDL_POWER_LINUX          /* in order of preference. More than could work. */
-    SDL_GetPowerInfo_Linux_proc_acpi,
-    SDL_GetPowerInfo_Linux_proc_apm,
-#endif
-#ifdef SDL_POWER_WINDOWS        /* handles Win32, Win64, PocketPC. */
-    SDL_GetPowerInfo_Windows,
-#endif
-#ifdef SDL_POWER_UIKIT          /* handles iPhone/iPad/etc */
-    SDL_GetPowerInfo_UIKit,
-#endif
-#ifdef SDL_POWER_MACOSX         /* handles Mac OS X, Darwin. */
-    SDL_GetPowerInfo_MacOSX,
-#endif
-#ifdef SDL_POWER_BEOS           /* handles BeOS, Zeta, with euc.jp apm driver. */
-    SDL_GetPowerInfo_BeOS,
-#endif
-#ifdef SDL_POWER_ANDROID        /* handles Android. */
-    SDL_GetPowerInfo_Android,
-#endif
-#ifdef SDL_POWER_PSP        /* handles PSP. */
-    SDL_GetPowerInfo_PSP,
-#endif
-
-#ifdef SDL_POWER_HARDWIRED
-    SDL_GetPowerInfo_Hardwired,
-#endif
-#endif
-};
-
-SDL_PowerState
-SDL_GetPowerInfo(int *seconds, int *percent)
-{
-    const int total = sizeof(implementations) / sizeof(implementations[0]);
-    int _seconds, _percent;
-    SDL_PowerState retval;
-    int i;
-
-    /* Make these never NULL for platform-specific implementations. */
-    if (seconds == NULL) {
-        seconds = &_seconds;
-    }
-
-    if (percent == NULL) {
-        percent = &_percent;
-    }
-
-    for (i = 0; i < total; i++) {
-        if (implementations[i] (&retval, seconds, percent)) {
-            return retval;
-        }
-    }
-
-    /* nothing was definitive. */
-    *seconds = -1;
-    *percent = -1;
-    return SDL_POWERSTATE_UNKNOWN;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/power/android/SDL_syspower.c b/deps/SDL2/src/power/android/SDL_syspower.c
deleted file mode 100644
index adedd04..0000000
--- a/deps/SDL2/src/power/android/SDL_syspower.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef SDL_POWER_DISABLED
-#if SDL_POWER_ANDROID
-
-#include "SDL_power.h"
-
-#include "../../core/android/SDL_android.h"
-
-SDL_bool
-SDL_GetPowerInfo_Android(SDL_PowerState * state, int *seconds, int *percent)
-{
-    int battery;
-    int plugged;
-    int charged;
-
-    if (Android_JNI_GetPowerInfo(&plugged, &charged, &battery, seconds, percent) != -1) {
-        if (plugged) {
-            if (charged) {
-                *state = SDL_POWERSTATE_CHARGED;
-            } else if (battery) {
-                *state = SDL_POWERSTATE_CHARGING;
-            } else {
-                *state = SDL_POWERSTATE_NO_BATTERY;
-                *seconds = -1;
-                *percent = -1;
-            }
-        } else {
-            *state = SDL_POWERSTATE_ON_BATTERY;
-        }
-    } else {
-        *state = SDL_POWERSTATE_UNKNOWN;
-        *seconds = -1;
-        *percent = -1;
-    }
-
-    return SDL_TRUE;
-}
-
-#endif /* SDL_POWER_ANDROID */
-#endif /* SDL_POWER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/power/beos/SDL_syspower.c b/deps/SDL2/src/power/beos/SDL_syspower.c
deleted file mode 100644
index 8f172cc..0000000
--- a/deps/SDL2/src/power/beos/SDL_syspower.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef SDL_POWER_DISABLED
-#if SDL_POWER_BEOS
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <drivers/Drivers.h>
-
-/* These values are from apm.h ... */
-#define APM_DEVICE_PATH "/dev/misc/apm"
-#define APM_FUNC_OFFSET 0x5300
-#define APM_FUNC_GET_POWER_STATUS 10
-#define APM_DEVICE_ALL 1
-#define APM_BIOS_CALL (B_DEVICE_OP_CODES_END + 3)
-
-#include "SDL_power.h"
-
-SDL_bool
-SDL_GetPowerInfo_BeOS(SDL_PowerState * state, int *seconds, int *percent)
-{
-    const int fd = open("/dev/misc/apm", O_RDONLY);
-    SDL_bool need_details = SDL_FALSE;
-    uint16 regs[6];
-    uint8 ac_status;
-    uint8 battery_status;
-    uint8 battery_flags;
-    uint8 battery_life;
-    uint32 battery_time;
-    int rc;
-
-    if (fd == -1) {
-        return SDL_FALSE;       /* maybe some other method will work? */
-    }
-
-    memset(regs, '\0', sizeof(regs));
-    regs[0] = APM_FUNC_OFFSET + APM_FUNC_GET_POWER_STATUS;
-    regs[1] = APM_DEVICE_ALL;
-    rc = ioctl(fd, APM_BIOS_CALL, regs);
-    close(fd);
-
-    if (rc < 0) {
-        return SDL_FALSE;
-    }
-
-    ac_status = regs[1] >> 8;
-    battery_status = regs[1] & 0xFF;
-    battery_flags = regs[2] >> 8;
-    battery_life = regs[2] & 0xFF;
-    battery_time = (uint32) regs[3];
-
-    /* in theory, _something_ should be set in battery_flags, right? */
-    if (battery_flags == 0x00) {        /* older APM BIOS? Less fields. */
-        battery_time = 0xFFFF;
-        if (battery_status == 0xFF) {
-            battery_flags = 0xFF;
-        } else {
-            battery_flags = (1 << battery_status);
-        }
-    }
-
-    if ((battery_time != 0xFFFF) && (battery_time & (1 << 15))) {
-        /* time is in minutes, not seconds */
-        battery_time = (battery_time & 0x7FFF) * 60;
-    }
-
-    if (battery_flags == 0xFF) {        /* unknown state */
-        *state = SDL_POWERSTATE_UNKNOWN;
-    } else if (battery_flags & (1 << 7)) {      /* no battery */
-        *state = SDL_POWERSTATE_NO_BATTERY;
-    } else if (battery_flags & (1 << 3)) {      /* charging */
-        *state = SDL_POWERSTATE_CHARGING;
-        need_details = SDL_TRUE;
-    } else if (ac_status == 1) {
-        *state = SDL_POWERSTATE_CHARGED;        /* on AC, not charging. */
-        need_details = SDL_TRUE;
-    } else {
-        *state = SDL_POWERSTATE_ON_BATTERY;     /* not on AC. */
-        need_details = SDL_TRUE;
-    }
-
-    *percent = -1;
-    *seconds = -1;
-    if (need_details) {
-        const int pct = (int) battery_life;
-        const int secs = (int) battery_time;
-
-        if (pct != 255) {       /* 255 == unknown */
-            *percent = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */
-        }
-        if (secs != 0xFFFF) {   /* 0xFFFF == unknown */
-            *seconds = secs;
-        }
-    }
-
-    return SDL_TRUE;            /* the definitive answer if APM driver replied. */
-}
-
-#endif /* SDL_POWER_BEOS */
-#endif /* SDL_POWER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/power/linux/SDL_syspower.c b/deps/SDL2/src/power/linux/SDL_syspower.c
deleted file mode 100644
index d9616de..0000000
--- a/deps/SDL2/src/power/linux/SDL_syspower.c
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef SDL_POWER_DISABLED
-#if SDL_POWER_LINUX
-
-#include <stdio.h>
-#include <unistd.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <fcntl.h>
-
-#include "SDL_power.h"
-
-static const char *proc_apm_path = "/proc/apm";
-static const char *proc_acpi_battery_path = "/proc/acpi/battery";
-static const char *proc_acpi_ac_adapter_path = "/proc/acpi/ac_adapter";
-
-static int open_acpi_file(const char *base, const char *node, const char *key)
-{
-    const size_t pathlen = strlen(base) + strlen(node) + strlen(key) + 3;
-    char *path = (char *) alloca(pathlen);
-    if (path == NULL) {
-        return -1;  /* oh well. */
-    }
-
-    snprintf(path, pathlen, "%s/%s/%s", base, node, key);
-    return open(path, O_RDONLY);
-}
-
-
-static SDL_bool
-load_acpi_file(const char *base, const char *node, const char *key,
-               char *buf, size_t buflen)
-{
-    ssize_t br = 0;
-    const int fd = open_acpi_file(base, node, key);
-    if (fd == -1) {
-        return SDL_FALSE;
-    }
-    br = read(fd, buf, buflen-1);
-    close(fd);
-    if (br < 0) {
-        return SDL_FALSE;
-    }
-    buf[br] = '\0';             /* null-terminate the string. */
-    return SDL_TRUE;
-}
-
-
-static SDL_bool
-make_proc_acpi_key_val(char **_ptr, char **_key, char **_val)
-{
-    char *ptr = *_ptr;
-
-    while (*ptr == ' ') {
-        ptr++;  /* skip whitespace. */
-    }
-
-    if (*ptr == '\0') {
-        return SDL_FALSE;  /* EOF. */
-    }
-
-    *_key = ptr;
-
-    while ((*ptr != ':') && (*ptr != '\0')) {
-        ptr++;
-    }
-
-    if (*ptr == '\0') {
-        return SDL_FALSE;  /* (unexpected) EOF. */
-    }
-
-    *(ptr++) = '\0';  /* terminate the key. */
-
-    while ((*ptr == ' ') && (*ptr != '\0')) {
-        ptr++;  /* skip whitespace. */
-    }
-
-    if (*ptr == '\0') {
-        return SDL_FALSE;  /* (unexpected) EOF. */
-    }
-
-    *_val = ptr;
-
-    while ((*ptr != '\n') && (*ptr != '\0')) {
-        ptr++;
-    }
-
-    if (*ptr != '\0') {
-        *(ptr++) = '\0';  /* terminate the value. */
-    }
-
-    *_ptr = ptr;  /* store for next time. */
-    return SDL_TRUE;
-}
-
-static void
-check_proc_acpi_battery(const char * node, SDL_bool * have_battery,
-                        SDL_bool * charging, int *seconds, int *percent)
-{
-    const char *base = proc_acpi_battery_path;
-    char info[1024];
-    char state[1024];
-    char *ptr = NULL;
-    char *key = NULL;
-    char *val = NULL;
-    SDL_bool charge = SDL_FALSE;
-    SDL_bool choose = SDL_FALSE;
-    int maximum = -1;
-    int remaining = -1;
-    int secs = -1;
-    int pct = -1;
-
-    if (!load_acpi_file(base, node, "state", state, sizeof (state))) {
-        return;
-    } else if (!load_acpi_file(base, node, "info", info, sizeof (info))) {
-        return;
-    }
-
-    ptr = &state[0];
-    while (make_proc_acpi_key_val(&ptr, &key, &val)) {
-        if (strcmp(key, "present") == 0) {
-            if (strcmp(val, "yes") == 0) {
-                *have_battery = SDL_TRUE;
-            }
-        } else if (strcmp(key, "charging state") == 0) {
-            /* !!! FIXME: what exactly _does_ charging/discharging mean? */
-            if (strcmp(val, "charging/discharging") == 0) {
-                charge = SDL_TRUE;
-            } else if (strcmp(val, "charging") == 0) {
-                charge = SDL_TRUE;
-            }
-        } else if (strcmp(key, "remaining capacity") == 0) {
-            char *endptr = NULL;
-            const int cvt = (int) strtol(val, &endptr, 10);
-            if (*endptr == ' ') {
-                remaining = cvt;
-            }
-        }
-    }
-
-    ptr = &info[0];
-    while (make_proc_acpi_key_val(&ptr, &key, &val)) {
-        if (strcmp(key, "design capacity") == 0) {
-            char *endptr = NULL;
-            const int cvt = (int) strtol(val, &endptr, 10);
-            if (*endptr == ' ') {
-                maximum = cvt;
-            }
-        }
-    }
-
-    if ((maximum >= 0) && (remaining >= 0)) {
-        pct = (int) ((((float) remaining) / ((float) maximum)) * 100.0f);
-        if (pct < 0) {
-            pct = 0;
-        } else if (pct > 100) {
-            pct = 100;
-        }
-    }
-
-    /* !!! FIXME: calculate (secs). */
-
-    /*
-     * We pick the battery that claims to have the most minutes left.
-     *  (failing a report of minutes, we'll take the highest percent.)
-     */
-    if ((secs < 0) && (*seconds < 0)) {
-        if ((pct < 0) && (*percent < 0)) {
-            choose = SDL_TRUE;  /* at least we know there's a battery. */
-        }
-        if (pct > *percent) {
-            choose = SDL_TRUE;
-        }
-    } else if (secs > *seconds) {
-        choose = SDL_TRUE;
-    }
-
-    if (choose) {
-        *seconds = secs;
-        *percent = pct;
-        *charging = charge;
-    }
-}
-
-static void
-check_proc_acpi_ac_adapter(const char * node, SDL_bool * have_ac)
-{
-    const char *base = proc_acpi_ac_adapter_path;
-    char state[256];
-    char *ptr = NULL;
-    char *key = NULL;
-    char *val = NULL;
-
-    if (!load_acpi_file(base, node, "state", state, sizeof (state))) {
-        return;
-    }
-
-    ptr = &state[0];
-    while (make_proc_acpi_key_val(&ptr, &key, &val)) {
-        if (strcmp(key, "state") == 0) {
-            if (strcmp(val, "on-line") == 0) {
-                *have_ac = SDL_TRUE;
-            }
-        }
-    }
-}
-
-
-SDL_bool
-SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState * state,
-                                 int *seconds, int *percent)
-{
-    struct dirent *dent = NULL;
-    DIR *dirp = NULL;
-    SDL_bool have_battery = SDL_FALSE;
-    SDL_bool have_ac = SDL_FALSE;
-    SDL_bool charging = SDL_FALSE;
-
-    *seconds = -1;
-    *percent = -1;
-    *state = SDL_POWERSTATE_UNKNOWN;
-
-    dirp = opendir(proc_acpi_battery_path);
-    if (dirp == NULL) {
-        return SDL_FALSE;  /* can't use this interface. */
-    } else {
-        while ((dent = readdir(dirp)) != NULL) {
-            const char *node = dent->d_name;
-            check_proc_acpi_battery(node, &have_battery, &charging,
-                                    seconds, percent);
-        }
-        closedir(dirp);
-    }
-
-    dirp = opendir(proc_acpi_ac_adapter_path);
-    if (dirp == NULL) {
-        return SDL_FALSE;  /* can't use this interface. */
-    } else {
-        while ((dent = readdir(dirp)) != NULL) {
-            const char *node = dent->d_name;
-            check_proc_acpi_ac_adapter(node, &have_ac);
-        }
-        closedir(dirp);
-    }
-
-    if (!have_battery) {
-        *state = SDL_POWERSTATE_NO_BATTERY;
-    } else if (charging) {
-        *state = SDL_POWERSTATE_CHARGING;
-    } else if (have_ac) {
-        *state = SDL_POWERSTATE_CHARGED;
-    } else {
-        *state = SDL_POWERSTATE_ON_BATTERY;
-    }
-
-    return SDL_TRUE;   /* definitive answer. */
-}
-
-
-static SDL_bool
-next_string(char **_ptr, char **_str)
-{
-    char *ptr = *_ptr;
-    char *str = *_str;
-
-    while (*ptr == ' ') {       /* skip any spaces... */
-        ptr++;
-    }
-
-    if (*ptr == '\0') {
-        return SDL_FALSE;
-    }
-
-    str = ptr;
-    while ((*ptr != ' ') && (*ptr != '\n') && (*ptr != '\0'))
-        ptr++;
-
-    if (*ptr != '\0')
-        *(ptr++) = '\0';
-
-    *_str = str;
-    *_ptr = ptr;
-    return SDL_TRUE;
-}
-
-static SDL_bool
-int_string(char *str, int *val)
-{
-    char *endptr = NULL;
-    *val = (int) strtol(str, &endptr, 0);
-    return ((*str != '\0') && (*endptr == '\0'));
-}
-
-/* http://lxr.linux.no/linux+v2.6.29/drivers/char/apm-emulation.c */
-SDL_bool
-SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state,
-                                int *seconds, int *percent)
-{
-    SDL_bool need_details = SDL_FALSE;
-    int ac_status = 0;
-    int battery_status = 0;
-    int battery_flag = 0;
-    int battery_percent = 0;
-    int battery_time = 0;
-    const int fd = open(proc_apm_path, O_RDONLY);
-    char buf[128];
-    char *ptr = &buf[0];
-    char *str = NULL;
-    ssize_t br;
-
-    if (fd == -1) {
-        return SDL_FALSE;       /* can't use this interface. */
-    }
-
-    br = read(fd, buf, sizeof (buf) - 1);
-    close(fd);
-
-    if (br < 0) {
-        return SDL_FALSE;
-    }
-
-    buf[br] = '\0';             /* null-terminate the string. */
-    if (!next_string(&ptr, &str)) {     /* driver version */
-        return SDL_FALSE;
-    }
-    if (!next_string(&ptr, &str)) {     /* BIOS version */
-        return SDL_FALSE;
-    }
-    if (!next_string(&ptr, &str)) {     /* APM flags */
-        return SDL_FALSE;
-    }
-
-    if (!next_string(&ptr, &str)) {     /* AC line status */
-        return SDL_FALSE;
-    } else if (!int_string(str, &ac_status)) {
-        return SDL_FALSE;
-    }
-
-    if (!next_string(&ptr, &str)) {     /* battery status */
-        return SDL_FALSE;
-    } else if (!int_string(str, &battery_status)) {
-        return SDL_FALSE;
-    }
-    if (!next_string(&ptr, &str)) {     /* battery flag */
-        return SDL_FALSE;
-    } else if (!int_string(str, &battery_flag)) {
-        return SDL_FALSE;
-    }
-    if (!next_string(&ptr, &str)) {     /* remaining battery life percent */
-        return SDL_FALSE;
-    }
-    if (str[strlen(str) - 1] == '%') {
-        str[strlen(str) - 1] = '\0';
-    }
-    if (!int_string(str, &battery_percent)) {
-        return SDL_FALSE;
-    }
-
-    if (!next_string(&ptr, &str)) {     /* remaining battery life time */
-        return SDL_FALSE;
-    } else if (!int_string(str, &battery_time)) {
-        return SDL_FALSE;
-    }
-
-    if (!next_string(&ptr, &str)) {     /* remaining battery life time units */
-        return SDL_FALSE;
-    } else if (strcmp(str, "min") == 0) {
-        battery_time *= 60;
-    }
-
-    if (battery_flag == 0xFF) { /* unknown state */
-        *state = SDL_POWERSTATE_UNKNOWN;
-    } else if (battery_flag & (1 << 7)) {       /* no battery */
-        *state = SDL_POWERSTATE_NO_BATTERY;
-    } else if (battery_flag & (1 << 3)) {       /* charging */
-        *state = SDL_POWERSTATE_CHARGING;
-        need_details = SDL_TRUE;
-    } else if (ac_status == 1) {
-        *state = SDL_POWERSTATE_CHARGED;        /* on AC, not charging. */
-        need_details = SDL_TRUE;
-    } else {
-        *state = SDL_POWERSTATE_ON_BATTERY;
-        need_details = SDL_TRUE;
-    }
-
-    *percent = -1;
-    *seconds = -1;
-    if (need_details) {
-        const int pct = battery_percent;
-        const int secs = battery_time;
-
-        if (pct >= 0) {         /* -1 == unknown */
-            *percent = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */
-        }
-        if (secs >= 0) {        /* -1 == unknown */
-            *seconds = secs;
-        }
-    }
-
-    return SDL_TRUE;
-}
-
-#endif /* SDL_POWER_LINUX */
-#endif /* SDL_POWER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/power/macosx/SDL_syspower.c b/deps/SDL2/src/power/macosx/SDL_syspower.c
deleted file mode 100644
index 572dcfd..0000000
--- a/deps/SDL2/src/power/macosx/SDL_syspower.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef SDL_POWER_DISABLED
-#if SDL_POWER_MACOSX
-
-#include <Carbon/Carbon.h>
-#include <IOKit/ps/IOPowerSources.h>
-#include <IOKit/ps/IOPSKeys.h>
-
-#include "SDL_power.h"
-
-/* Carbon is so verbose... */
-#define STRMATCH(a,b) (CFStringCompare(a, b, 0) == kCFCompareEqualTo)
-#define GETVAL(k,v) \
-    CFDictionaryGetValueIfPresent(dict, CFSTR(k), (const void **) v)
-
-/* Note that AC power sources also include a laptop battery it is charging. */
-static void
-checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery,
-        SDL_bool * charging, int *seconds, int *percent)
-{
-    CFStringRef strval;         /* don't CFRelease() this. */
-    CFBooleanRef bval;
-    CFNumberRef numval;
-    SDL_bool charge = SDL_FALSE;
-    SDL_bool choose = SDL_FALSE;
-    SDL_bool is_ac = SDL_FALSE;
-    int secs = -1;
-    int maxpct = -1;
-    int pct = -1;
-
-    if ((GETVAL(kIOPSIsPresentKey, &bval)) && (bval == kCFBooleanFalse)) {
-        return;                 /* nothing to see here. */
-    }
-
-    if (!GETVAL(kIOPSPowerSourceStateKey, &strval)) {
-        return;
-    }
-
-    if (STRMATCH(strval, CFSTR(kIOPSACPowerValue))) {
-        is_ac = *have_ac = SDL_TRUE;
-    } else if (!STRMATCH(strval, CFSTR(kIOPSBatteryPowerValue))) {
-        return;                 /* not a battery? */
-    }
-
-    if ((GETVAL(kIOPSIsChargingKey, &bval)) && (bval == kCFBooleanTrue)) {
-        charge = SDL_TRUE;
-    }
-
-    if (GETVAL(kIOPSMaxCapacityKey, &numval)) {
-        SInt32 val = -1;
-        CFNumberGetValue(numval, kCFNumberSInt32Type, &val);
-        if (val > 0) {
-            *have_battery = SDL_TRUE;
-            maxpct = (int) val;
-        }
-    }
-
-    if (GETVAL(kIOPSMaxCapacityKey, &numval)) {
-        SInt32 val = -1;
-        CFNumberGetValue(numval, kCFNumberSInt32Type, &val);
-        if (val > 0) {
-            *have_battery = SDL_TRUE;
-            maxpct = (int) val;
-        }
-    }
-
-    if (GETVAL(kIOPSTimeToEmptyKey, &numval)) {
-        SInt32 val = -1;
-        CFNumberGetValue(numval, kCFNumberSInt32Type, &val);
-
-        /* Mac OS X reports 0 minutes until empty if you're plugged in. :( */
-        if ((val == 0) && (is_ac)) {
-            val = -1;           /* !!! FIXME: calc from timeToFull and capacity? */
-        }
-
-        secs = (int) val;
-        if (secs > 0) {
-            secs *= 60;         /* value is in minutes, so convert to seconds. */
-        }
-    }
-
-    if (GETVAL(kIOPSCurrentCapacityKey, &numval)) {
-        SInt32 val = -1;
-        CFNumberGetValue(numval, kCFNumberSInt32Type, &val);
-        pct = (int) val;
-    }
-
-    if ((pct > 0) && (maxpct > 0)) {
-        pct = (int) ((((double) pct) / ((double) maxpct)) * 100.0);
-    }
-
-    if (pct > 100) {
-        pct = 100;
-    }
-
-    /*
-     * We pick the battery that claims to have the most minutes left.
-     *  (failing a report of minutes, we'll take the highest percent.)
-     */
-    if ((secs < 0) && (*seconds < 0)) {
-        if ((pct < 0) && (*percent < 0)) {
-            choose = SDL_TRUE;  /* at least we know there's a battery. */
-        }
-        if (pct > *percent) {
-            choose = SDL_TRUE;
-        }
-    } else if (secs > *seconds) {
-        choose = SDL_TRUE;
-    }
-
-    if (choose) {
-        *seconds = secs;
-        *percent = pct;
-        *charging = charge;
-    }
-}
-
-#undef GETVAL
-#undef STRMATCH
-
-
-SDL_bool
-SDL_GetPowerInfo_MacOSX(SDL_PowerState * state, int *seconds, int *percent)
-{
-    CFTypeRef blob = IOPSCopyPowerSourcesInfo();
-
-    *seconds = -1;
-    *percent = -1;
-    *state = SDL_POWERSTATE_UNKNOWN;
-
-    if (blob != NULL) {
-        CFArrayRef list = IOPSCopyPowerSourcesList(blob);
-        if (list != NULL) {
-            /* don't CFRelease() the list items, or dictionaries! */
-            SDL_bool have_ac = SDL_FALSE;
-            SDL_bool have_battery = SDL_FALSE;
-            SDL_bool charging = SDL_FALSE;
-            const CFIndex total = CFArrayGetCount(list);
-            CFIndex i;
-            for (i = 0; i < total; i++) {
-                CFTypeRef ps = (CFTypeRef) CFArrayGetValueAtIndex(list, i);
-                CFDictionaryRef dict =
-                    IOPSGetPowerSourceDescription(blob, ps);
-                if (dict != NULL) {
-                    checkps(dict, &have_ac, &have_battery, &charging,
-                            seconds, percent);
-                }
-            }
-
-            if (!have_battery) {
-                *state = SDL_POWERSTATE_NO_BATTERY;
-            } else if (charging) {
-                *state = SDL_POWERSTATE_CHARGING;
-            } else if (have_ac) {
-                *state = SDL_POWERSTATE_CHARGED;
-            } else {
-                *state = SDL_POWERSTATE_ON_BATTERY;
-            }
-
-            CFRelease(list);
-        }
-        CFRelease(blob);
-    }
-
-    return SDL_TRUE;            /* always the definitive answer on Mac OS X. */
-}
-
-#endif /* SDL_POWER_MACOSX */
-#endif /* SDL_POWER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/power/psp/SDL_syspower.c b/deps/SDL2/src/power/psp/SDL_syspower.c
deleted file mode 100644
index 8c791bb..0000000
--- a/deps/SDL2/src/power/psp/SDL_syspower.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#ifndef SDL_POWER_DISABLED
-#if SDL_POWER_PSP
-
-#include "SDL_power.h"
-#include <psppower.h>
-
-
-SDL_bool
-SDL_GetPowerInfo_PSP(SDL_PowerState * state, int *seconds,
-                            int *percent)
-{
-    int battery = scePowerIsBatteryExist();
-    int plugged = scePowerIsPowerOnline();
-    int charging = scePowerIsBatteryCharging();
-
-    *state = SDL_POWERSTATE_UNKNOWN;
-    *seconds = -1;
-    *percent = -1;
-
-    if (!battery) {
-        *state = SDL_POWERSTATE_NO_BATTERY;
-        *seconds = -1;
-        *percent = -1;
-    } else if (charging) {
-        *state = SDL_POWERSTATE_CHARGING;
-        *percent = scePowerGetBatteryLifePercent();
-        *seconds = scePowerGetBatteryLifeTime()*60;
-    } else if (plugged) {
-        *state = SDL_POWERSTATE_CHARGED;
-        *percent = scePowerGetBatteryLifePercent();
-        *seconds = scePowerGetBatteryLifeTime()*60;
-    } else {
-        *state = SDL_POWERSTATE_ON_BATTERY;
-        *percent = scePowerGetBatteryLifePercent();
-        *seconds = scePowerGetBatteryLifeTime()*60;
-    }
-
-
-    return SDL_TRUE;            /* always the definitive answer on PSP. */
-}
-
-#endif /* SDL_POWER_PSP */
-#endif /* SDL_POWER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/power/uikit/SDL_syspower.h b/deps/SDL2/src/power/uikit/SDL_syspower.h
deleted file mode 100644
index ce3bc2e..0000000
--- a/deps/SDL2/src/power/uikit/SDL_syspower.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_POWER_UIKIT
-
-#include "SDL_power.h"
-
-void SDL_UIKit_UpdateBatteryMonitoring(void);
-SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent);
-
-#endif /* SDL_POWER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/power/uikit/SDL_syspower.m b/deps/SDL2/src/power/uikit/SDL_syspower.m
deleted file mode 100644
index f870ea2..0000000
--- a/deps/SDL2/src/power/uikit/SDL_syspower.m
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef SDL_POWER_DISABLED
-#if SDL_POWER_UIKIT
-
-#import <UIKit/UIKit.h>
-
-#include "SDL_power.h"
-#include "SDL_timer.h"
-#include "SDL_assert.h"
-#include "SDL_syspower.h"
-
-/* turn off the battery monitor if it's been more than X ms since last check. */
-static const int BATTERY_MONITORING_TIMEOUT = 3000;
-static Uint32 SDL_UIKitLastPowerInfoQuery = 0;
-
-void
-SDL_UIKit_UpdateBatteryMonitoring(void)
-{
-    if (SDL_UIKitLastPowerInfoQuery) {
-        if (SDL_TICKS_PASSED(SDL_GetTicks(), SDL_UIKitLastPowerInfoQuery + BATTERY_MONITORING_TIMEOUT)) {
-            UIDevice *uidev = [UIDevice currentDevice];
-            SDL_assert([uidev isBatteryMonitoringEnabled] == YES);
-            [uidev setBatteryMonitoringEnabled:NO];
-            SDL_UIKitLastPowerInfoQuery = 0;
-        }
-    }
-}
-
-SDL_bool
-SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent)
-{
-    UIDevice *uidev = [UIDevice currentDevice];
-
-    if (!SDL_UIKitLastPowerInfoQuery) {
-        SDL_assert([uidev isBatteryMonitoringEnabled] == NO);
-        [uidev setBatteryMonitoringEnabled:YES];
-    }
-
-    /* UIKit_GL_SwapWindow() (etc) will check this and disable the battery
-     *  monitoring if the app hasn't queried it in the last X seconds.
-     *  Apparently monitoring the battery burns battery life.  :)
-     *  Apple's docs say not to monitor the battery unless you need it.
-     */
-    SDL_UIKitLastPowerInfoQuery = SDL_GetTicks();
-
-    *seconds = -1;   /* no API to estimate this in UIKit. */
-
-    switch ([uidev batteryState])
-    {
-        case UIDeviceBatteryStateCharging:
-            *state = SDL_POWERSTATE_CHARGING;
-            break;
-
-        case UIDeviceBatteryStateFull:
-            *state = SDL_POWERSTATE_CHARGED;
-            break;
-
-        case UIDeviceBatteryStateUnplugged:
-            *state = SDL_POWERSTATE_ON_BATTERY;
-            break;
-
-        case UIDeviceBatteryStateUnknown:
-        default:
-            *state = SDL_POWERSTATE_UNKNOWN;
-            break;
-    }
-
-    const float level = [uidev batteryLevel];
-    *percent = ( (level < 0.0f) ? -1 : (((int) (level + 0.5f)) * 100) );
-    return SDL_TRUE;            /* always the definitive answer on iPhoneOS. */
-}
-
-#endif /* SDL_POWER_UIKIT */
-#endif /* SDL_POWER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/power/windows/SDL_syspower.c b/deps/SDL2/src/power/windows/SDL_syspower.c
deleted file mode 100644
index 29ddb0f..0000000
--- a/deps/SDL2/src/power/windows/SDL_syspower.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef SDL_POWER_DISABLED
-#if SDL_POWER_WINDOWS
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_power.h"
-
-SDL_bool
-SDL_GetPowerInfo_Windows(SDL_PowerState * state, int *seconds, int *percent)
-{
-    SYSTEM_POWER_STATUS status;
-    SDL_bool need_details = SDL_FALSE;
-
-    /* This API should exist back to Win95. */
-    if (!GetSystemPowerStatus(&status))
-    {
-        /* !!! FIXME: push GetLastError() into SDL_GetError() */
-        *state = SDL_POWERSTATE_UNKNOWN;
-    } else if (status.BatteryFlag == 0xFF) {    /* unknown state */
-        *state = SDL_POWERSTATE_UNKNOWN;
-    } else if (status.BatteryFlag & (1 << 7)) { /* no battery */
-        *state = SDL_POWERSTATE_NO_BATTERY;
-    } else if (status.BatteryFlag & (1 << 3)) { /* charging */
-        *state = SDL_POWERSTATE_CHARGING;
-        need_details = SDL_TRUE;
-    } else if (status.ACLineStatus == 1) {
-        *state = SDL_POWERSTATE_CHARGED;        /* on AC, not charging. */
-        need_details = SDL_TRUE;
-    } else {
-        *state = SDL_POWERSTATE_ON_BATTERY;     /* not on AC. */
-        need_details = SDL_TRUE;
-    }
-
-    *percent = -1;
-    *seconds = -1;
-    if (need_details) {
-        const int pct = (int) status.BatteryLifePercent;
-        const int secs = (int) status.BatteryLifeTime;
-
-        if (pct != 255) {       /* 255 == unknown */
-            *percent = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */
-        }
-        if (secs != 0xFFFFFFFF) {       /* ((DWORD)-1) == unknown */
-            *seconds = secs;
-        }
-    }
-
-    return SDL_TRUE;            /* always the definitive answer on Windows. */
-}
-
-#endif /* SDL_POWER_WINDOWS */
-#endif /* SDL_POWER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/SDL_render.c b/deps/SDL2/src/render/SDL_render.c
deleted file mode 100644
index 5546d4a..0000000
--- a/deps/SDL2/src/render/SDL_render.c
+++ /dev/null
@@ -1,1887 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* The SDL 2D rendering system */
-
-#include "SDL_assert.h"
-#include "SDL_hints.h"
-#include "SDL_log.h"
-#include "SDL_render.h"
-#include "SDL_sysrender.h"
-#include "software/SDL_render_sw_c.h"
-
-
-#define SDL_WINDOWRENDERDATA    "_SDL_WindowRenderData"
-
-#define CHECK_RENDERER_MAGIC(renderer, retval) \
-    if (!renderer || renderer->magic != &renderer_magic) { \
-        SDL_SetError("Invalid renderer"); \
-        return retval; \
-    }
-
-#define CHECK_TEXTURE_MAGIC(texture, retval) \
-    if (!texture || texture->magic != &texture_magic) { \
-        SDL_SetError("Invalid texture"); \
-        return retval; \
-    }
-
-
-#if !SDL_RENDER_DISABLED
-static const SDL_RenderDriver *render_drivers[] = {
-#if SDL_VIDEO_RENDER_D3D
-    &D3D_RenderDriver,
-#endif
-#if SDL_VIDEO_RENDER_OGL
-    &GL_RenderDriver,
-#endif
-#if SDL_VIDEO_RENDER_OGL_ES2
-    &GLES2_RenderDriver,
-#endif
-#if SDL_VIDEO_RENDER_OGL_ES
-    &GLES_RenderDriver,
-#endif
-#if SDL_VIDEO_RENDER_DIRECTFB
-    &DirectFB_RenderDriver,
-#endif
-#if SDL_VIDEO_RENDER_PSP
-    &PSP_RenderDriver,
-#endif
-    &SW_RenderDriver
-};
-#endif /* !SDL_RENDER_DISABLED */
-
-static char renderer_magic;
-static char texture_magic;
-
-static int UpdateLogicalSize(SDL_Renderer *renderer);
-
-int
-SDL_GetNumRenderDrivers(void)
-{
-#if !SDL_RENDER_DISABLED
-    return SDL_arraysize(render_drivers);
-#else
-    return 0;
-#endif
-}
-
-int
-SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info)
-{
-#if !SDL_RENDER_DISABLED
-    if (index < 0 || index >= SDL_GetNumRenderDrivers()) {
-        return SDL_SetError("index must be in the range of 0 - %d",
-                            SDL_GetNumRenderDrivers() - 1);
-    }
-    *info = render_drivers[index]->info;
-    return 0;
-#else
-    return SDL_SetError("SDL not built with rendering support");
-#endif
-}
-
-static int
-SDL_RendererEventWatch(void *userdata, SDL_Event *event)
-{
-    SDL_Renderer *renderer = (SDL_Renderer *)userdata;
-
-    if (event->type == SDL_WINDOWEVENT) {
-        SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);
-        if (window == renderer->window) {
-            if (renderer->WindowEvent) {
-                renderer->WindowEvent(renderer, &event->window);
-            }
-
-            if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
-                if (renderer->logical_w) {
-                    UpdateLogicalSize(renderer);
-                } else {
-                    /* Window was resized, reset viewport */
-                    int w, h;
-
-                    if (renderer->GetOutputSize) {
-                        renderer->GetOutputSize(renderer, &w, &h);
-                    } else {
-                        SDL_GetWindowSize(renderer->window, &w, &h);
-                    }
-
-                    if (renderer->target) {
-                        renderer->viewport_backup.x = 0;
-                        renderer->viewport_backup.y = 0;
-                        renderer->viewport_backup.w = w;
-                        renderer->viewport_backup.h = h;
-                    } else {
-                        renderer->viewport.x = 0;
-                        renderer->viewport.y = 0;
-                        renderer->viewport.w = w;
-                        renderer->viewport.h = h;
-                        renderer->UpdateViewport(renderer);
-                    }
-                }
-            } else if (event->window.event == SDL_WINDOWEVENT_HIDDEN) {
-                renderer->hidden = SDL_TRUE;
-            } else if (event->window.event == SDL_WINDOWEVENT_SHOWN) {
-                if (!(SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED)) {
-                    renderer->hidden = SDL_FALSE;
-                }
-            } else if (event->window.event == SDL_WINDOWEVENT_MINIMIZED) {
-                renderer->hidden = SDL_TRUE;
-            } else if (event->window.event == SDL_WINDOWEVENT_RESTORED) {
-                if (!(SDL_GetWindowFlags(window) & SDL_WINDOW_HIDDEN)) {
-                    renderer->hidden = SDL_FALSE;
-                }
-            }
-        }
-    } else if (event->type == SDL_MOUSEMOTION) {
-        if (renderer->logical_w) {
-            event->motion.x -= renderer->viewport.x;
-            event->motion.y -= renderer->viewport.y;
-            event->motion.x = (int)(event->motion.x / renderer->scale.x);
-            event->motion.y = (int)(event->motion.y / renderer->scale.y);
-            if (event->motion.xrel > 0) {
-                event->motion.xrel = SDL_max(1, (int)(event->motion.xrel / renderer->scale.x));
-            } else if (event->motion.xrel < 0) {
-                event->motion.xrel = SDL_min(-1, (int)(event->motion.xrel / renderer->scale.x));
-            }
-            if (event->motion.yrel > 0) {
-                event->motion.yrel = SDL_max(1, (int)(event->motion.yrel / renderer->scale.y));
-            } else if (event->motion.yrel < 0) {
-                event->motion.yrel = SDL_min(-1, (int)(event->motion.yrel / renderer->scale.y));
-            }
-        }
-    } else if (event->type == SDL_MOUSEBUTTONDOWN ||
-               event->type == SDL_MOUSEBUTTONUP) {
-        if (renderer->logical_w) {
-            event->button.x -= renderer->viewport.x;
-            event->button.y -= renderer->viewport.y;
-            event->button.x = (int)(event->button.x / renderer->scale.x);
-            event->button.y = (int)(event->button.y / renderer->scale.y);
-        }
-    }
-    return 0;
-}
-
-int
-SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags,
-                            SDL_Window **window, SDL_Renderer **renderer)
-{
-    *window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED,
-                                     SDL_WINDOWPOS_UNDEFINED,
-                                     width, height, window_flags);
-    if (!*window) {
-        *renderer = NULL;
-        return -1;
-    }
-
-    *renderer = SDL_CreateRenderer(*window, -1, 0);
-    if (!*renderer) {
-        return -1;
-    }
-
-    return 0;
-}
-
-SDL_Renderer *
-SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags)
-{
-#if !SDL_RENDER_DISABLED
-    SDL_Renderer *renderer = NULL;
-    int n = SDL_GetNumRenderDrivers();
-    const char *hint;
-
-    if (!window) {
-        SDL_SetError("Invalid window");
-        return NULL;
-    }
-
-    if (SDL_GetRenderer(window)) {
-        SDL_SetError("Renderer already associated with window");
-        return NULL;
-    }
-
-    hint = SDL_GetHint(SDL_HINT_RENDER_VSYNC);
-    if (hint) {
-        if (*hint == '0') {
-            flags &= ~SDL_RENDERER_PRESENTVSYNC;
-        } else {
-            flags |= SDL_RENDERER_PRESENTVSYNC;
-        }
-    }
-
-    if (index < 0) {
-        hint = SDL_GetHint(SDL_HINT_RENDER_DRIVER);
-        if (hint) {
-            for (index = 0; index < n; ++index) {
-                const SDL_RenderDriver *driver = render_drivers[index];
-
-                if (SDL_strcasecmp(hint, driver->info.name) == 0) {
-                    /* Create a new renderer instance */
-                    renderer = driver->CreateRenderer(window, flags);
-                    break;
-                }
-            }
-        }
-
-        if (!renderer) {
-            for (index = 0; index < n; ++index) {
-                const SDL_RenderDriver *driver = render_drivers[index];
-
-                if ((driver->info.flags & flags) == flags) {
-                    /* Create a new renderer instance */
-                    renderer = driver->CreateRenderer(window, flags);
-                    if (renderer) {
-                        /* Yay, we got one! */
-                        break;
-                    }
-                }
-            }
-        }
-        if (index == n) {
-            SDL_SetError("Couldn't find matching render driver");
-            return NULL;
-        }
-    } else {
-        if (index >= SDL_GetNumRenderDrivers()) {
-            SDL_SetError("index must be -1 or in the range of 0 - %d",
-                         SDL_GetNumRenderDrivers() - 1);
-            return NULL;
-        }
-        /* Create a new renderer instance */
-        renderer = render_drivers[index]->CreateRenderer(window, flags);
-    }
-
-    if (renderer) {
-        renderer->magic = &renderer_magic;
-        renderer->window = window;
-        renderer->scale.x = 1.0f;
-        renderer->scale.y = 1.0f;
-
-        if (SDL_GetWindowFlags(window) & (SDL_WINDOW_HIDDEN|SDL_WINDOW_MINIMIZED)) {
-            renderer->hidden = SDL_TRUE;
-        } else {
-            renderer->hidden = SDL_FALSE;
-        }
-
-        SDL_SetWindowData(window, SDL_WINDOWRENDERDATA, renderer);
-
-        SDL_RenderSetViewport(renderer, NULL);
-
-        SDL_AddEventWatch(SDL_RendererEventWatch, renderer);
-
-        SDL_LogInfo(SDL_LOG_CATEGORY_RENDER,
-                    "Created renderer: %s", renderer->info.name);
-    }
-    return renderer;
-#else
-    SDL_SetError("SDL not built with rendering support");
-    return NULL;
-#endif
-}
-
-SDL_Renderer *
-SDL_CreateSoftwareRenderer(SDL_Surface * surface)
-{
-#if !SDL_RENDER_DISABLED
-    SDL_Renderer *renderer;
-
-    renderer = SW_CreateRendererForSurface(surface);
-
-    if (renderer) {
-        renderer->magic = &renderer_magic;
-        renderer->scale.x = 1.0f;
-        renderer->scale.y = 1.0f;
-
-        SDL_RenderSetViewport(renderer, NULL);
-    }
-    return renderer;
-#else
-    SDL_SetError("SDL not built with rendering support");
-    return NULL;
-#endif /* !SDL_RENDER_DISABLED */
-}
-
-SDL_Renderer *
-SDL_GetRenderer(SDL_Window * window)
-{
-    return (SDL_Renderer *)SDL_GetWindowData(window, SDL_WINDOWRENDERDATA);
-}
-
-int
-SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    *info = renderer->info;
-    return 0;
-}
-
-int
-SDL_GetRendererOutputSize(SDL_Renderer * renderer, int *w, int *h)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    if (renderer->target) {
-        return SDL_QueryTexture(renderer->target, NULL, NULL, w, h);
-    } else if (renderer->GetOutputSize) {
-        return renderer->GetOutputSize(renderer, w, h);
-    } else if (renderer->window) {
-        SDL_GetWindowSize(renderer->window, w, h);
-        return 0;
-    } else {
-        /* This should never happen */
-        SDL_SetError("Renderer doesn't support querying output size");
-        return -1;
-    }
-}
-
-static SDL_bool
-IsSupportedFormat(SDL_Renderer * renderer, Uint32 format)
-{
-    Uint32 i;
-
-    for (i = 0; i < renderer->info.num_texture_formats; ++i) {
-        if (renderer->info.texture_formats[i] == format) {
-            return SDL_TRUE;
-        }
-    }
-    return SDL_FALSE;
-}
-
-static Uint32
-GetClosestSupportedFormat(SDL_Renderer * renderer, Uint32 format)
-{
-    Uint32 i;
-
-    if (SDL_ISPIXELFORMAT_FOURCC(format)) {
-        /* Look for an exact match */
-        for (i = 0; i < renderer->info.num_texture_formats; ++i) {
-            if (renderer->info.texture_formats[i] == format) {
-                return renderer->info.texture_formats[i];
-            }
-        }
-    } else {
-        SDL_bool hasAlpha = SDL_ISPIXELFORMAT_ALPHA(format);
-
-        /* We just want to match the first format that has the same channels */
-        for (i = 0; i < renderer->info.num_texture_formats; ++i) {
-            if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) &&
-                SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == hasAlpha) {
-                return renderer->info.texture_formats[i];
-            }
-        }
-    }
-    return renderer->info.texture_formats[0];
-}
-
-SDL_Texture *
-SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int h)
-{
-    SDL_Texture *texture;
-
-    CHECK_RENDERER_MAGIC(renderer, NULL);
-
-    if (!format) {
-        format = renderer->info.texture_formats[0];
-    }
-    if (SDL_ISPIXELFORMAT_INDEXED(format)) {
-        SDL_SetError("Palettized textures are not supported");
-        return NULL;
-    }
-    if (w <= 0 || h <= 0) {
-        SDL_SetError("Texture dimensions can't be 0");
-        return NULL;
-    }
-    if ((renderer->info.max_texture_width && w > renderer->info.max_texture_width) ||
-        (renderer->info.max_texture_height && h > renderer->info.max_texture_height)) {
-        SDL_SetError("Texture dimensions are limited to %dx%d", renderer->info.max_texture_width, renderer->info.max_texture_height);
-        return NULL;
-    }
-    texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
-    if (!texture) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    texture->magic = &texture_magic;
-    texture->format = format;
-    texture->access = access;
-    texture->w = w;
-    texture->h = h;
-    texture->r = 255;
-    texture->g = 255;
-    texture->b = 255;
-    texture->a = 255;
-    texture->renderer = renderer;
-    texture->next = renderer->textures;
-    if (renderer->textures) {
-        renderer->textures->prev = texture;
-    }
-    renderer->textures = texture;
-
-    if (IsSupportedFormat(renderer, format)) {
-        if (renderer->CreateTexture(renderer, texture) < 0) {
-            SDL_DestroyTexture(texture);
-            return 0;
-        }
-    } else {
-        texture->native = SDL_CreateTexture(renderer,
-                                GetClosestSupportedFormat(renderer, format),
-                                access, w, h);
-        if (!texture->native) {
-            SDL_DestroyTexture(texture);
-            return NULL;
-        }
-
-        /* Swap textures to have texture before texture->native in the list */
-        texture->native->next = texture->next;
-        if (texture->native->next) {
-            texture->native->next->prev = texture->native;
-        }
-        texture->prev = texture->native->prev;
-        if (texture->prev) {
-            texture->prev->next = texture;
-        }
-        texture->native->prev = texture;
-        texture->next = texture->native;
-        renderer->textures = texture;
-
-        if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
-            texture->yuv = SDL_SW_CreateYUVTexture(format, w, h);
-            if (!texture->yuv) {
-                SDL_DestroyTexture(texture);
-                return NULL;
-            }
-        } else if (access == SDL_TEXTUREACCESS_STREAMING) {
-            /* The pitch is 4 byte aligned */
-            texture->pitch = (((w * SDL_BYTESPERPIXEL(format)) + 3) & ~3);
-            texture->pixels = SDL_calloc(1, texture->pitch * h);
-            if (!texture->pixels) {
-                SDL_DestroyTexture(texture);
-                return NULL;
-            }
-        }
-    }
-    return texture;
-}
-
-SDL_Texture *
-SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface)
-{
-    const SDL_PixelFormat *fmt;
-    SDL_bool needAlpha;
-    Uint32 i;
-    Uint32 format;
-    SDL_Texture *texture;
-
-    CHECK_RENDERER_MAGIC(renderer, NULL);
-
-    if (!surface) {
-        SDL_SetError("SDL_CreateTextureFromSurface() passed NULL surface");
-        return NULL;
-    }
-
-    /* See what the best texture format is */
-    fmt = surface->format;
-    if (fmt->Amask || SDL_GetColorKey(surface, NULL) == 0) {
-        needAlpha = SDL_TRUE;
-    } else {
-        needAlpha = SDL_FALSE;
-    }
-    format = renderer->info.texture_formats[0];
-    for (i = 0; i < renderer->info.num_texture_formats; ++i) {
-        if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) &&
-            SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) {
-            format = renderer->info.texture_formats[i];
-            break;
-        }
-    }
-
-    texture = SDL_CreateTexture(renderer, format, SDL_TEXTUREACCESS_STATIC,
-                                surface->w, surface->h);
-    if (!texture) {
-        return NULL;
-    }
-
-    if (format == surface->format->format) {
-        if (SDL_MUSTLOCK(surface)) {
-            SDL_LockSurface(surface);
-            SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch);
-            SDL_UnlockSurface(surface);
-        } else {
-            SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch);
-        }
-    } else {
-        SDL_PixelFormat *dst_fmt;
-        SDL_Surface *temp = NULL;
-
-        /* Set up a destination surface for the texture update */
-        dst_fmt = SDL_AllocFormat(format);
-        temp = SDL_ConvertSurface(surface, dst_fmt, 0);
-        SDL_FreeFormat(dst_fmt);
-        if (temp) {
-            SDL_UpdateTexture(texture, NULL, temp->pixels, temp->pitch);
-            SDL_FreeSurface(temp);
-        } else {
-            SDL_DestroyTexture(texture);
-            return NULL;
-        }
-    }
-
-    {
-        Uint8 r, g, b, a;
-        SDL_BlendMode blendMode;
-
-        SDL_GetSurfaceColorMod(surface, &r, &g, &b);
-        SDL_SetTextureColorMod(texture, r, g, b);
-
-        SDL_GetSurfaceAlphaMod(surface, &a);
-        SDL_SetTextureAlphaMod(texture, a);
-
-        if (SDL_GetColorKey(surface, NULL) == 0) {
-            /* We converted to a texture with alpha format */
-            SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
-        } else {
-            SDL_GetSurfaceBlendMode(surface, &blendMode);
-            SDL_SetTextureBlendMode(texture, blendMode);
-        }
-    }
-    return texture;
-}
-
-int
-SDL_QueryTexture(SDL_Texture * texture, Uint32 * format, int *access,
-                 int *w, int *h)
-{
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    if (format) {
-        *format = texture->format;
-    }
-    if (access) {
-        *access = texture->access;
-    }
-    if (w) {
-        *w = texture->w;
-    }
-    if (h) {
-        *h = texture->h;
-    }
-    return 0;
-}
-
-int
-SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b)
-{
-    SDL_Renderer *renderer;
-
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    renderer = texture->renderer;
-    if (r < 255 || g < 255 || b < 255) {
-        texture->modMode |= SDL_TEXTUREMODULATE_COLOR;
-    } else {
-        texture->modMode &= ~SDL_TEXTUREMODULATE_COLOR;
-    }
-    texture->r = r;
-    texture->g = g;
-    texture->b = b;
-    if (texture->native) {
-        return SDL_SetTextureColorMod(texture->native, r, g, b);
-    } else if (renderer->SetTextureColorMod) {
-        return renderer->SetTextureColorMod(renderer, texture);
-    } else {
-        return 0;
-    }
-}
-
-int
-SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g,
-                       Uint8 * b)
-{
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    if (r) {
-        *r = texture->r;
-    }
-    if (g) {
-        *g = texture->g;
-    }
-    if (b) {
-        *b = texture->b;
-    }
-    return 0;
-}
-
-int
-SDL_SetTextureAlphaMod(SDL_Texture * texture, Uint8 alpha)
-{
-    SDL_Renderer *renderer;
-
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    renderer = texture->renderer;
-    if (alpha < 255) {
-        texture->modMode |= SDL_TEXTUREMODULATE_ALPHA;
-    } else {
-        texture->modMode &= ~SDL_TEXTUREMODULATE_ALPHA;
-    }
-    texture->a = alpha;
-    if (texture->native) {
-        return SDL_SetTextureAlphaMod(texture->native, alpha);
-    } else if (renderer->SetTextureAlphaMod) {
-        return renderer->SetTextureAlphaMod(renderer, texture);
-    } else {
-        return 0;
-    }
-}
-
-int
-SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha)
-{
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    if (alpha) {
-        *alpha = texture->a;
-    }
-    return 0;
-}
-
-int
-SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode)
-{
-    SDL_Renderer *renderer;
-
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    renderer = texture->renderer;
-    texture->blendMode = blendMode;
-    if (texture->native) {
-        return SDL_SetTextureBlendMode(texture->native, blendMode);
-    } else if (renderer->SetTextureBlendMode) {
-        return renderer->SetTextureBlendMode(renderer, texture);
-    } else {
-        return 0;
-    }
-}
-
-int
-SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode)
-{
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    if (blendMode) {
-        *blendMode = texture->blendMode;
-    }
-    return 0;
-}
-
-static int
-SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect,
-                     const void *pixels, int pitch)
-{
-    SDL_Texture *native = texture->native;
-    SDL_Rect full_rect;
-
-    if (SDL_SW_UpdateYUVTexture(texture->yuv, rect, pixels, pitch) < 0) {
-        return -1;
-    }
-
-    full_rect.x = 0;
-    full_rect.y = 0;
-    full_rect.w = texture->w;
-    full_rect.h = texture->h;
-    rect = &full_rect;
-
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        /* We can lock the texture and copy to it */
-        void *native_pixels;
-        int native_pitch;
-
-        if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
-            return -1;
-        }
-        SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format,
-                            rect->w, rect->h, native_pixels, native_pitch);
-        SDL_UnlockTexture(native);
-    } else {
-        /* Use a temporary buffer for updating */
-        void *temp_pixels;
-        int temp_pitch;
-
-        temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3);
-        temp_pixels = SDL_malloc(rect->h * temp_pitch);
-        if (!temp_pixels) {
-            return SDL_OutOfMemory();
-        }
-        SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format,
-                            rect->w, rect->h, temp_pixels, temp_pitch);
-        SDL_UpdateTexture(native, rect, temp_pixels, temp_pitch);
-        SDL_free(temp_pixels);
-    }
-    return 0;
-}
-
-static int
-SDL_UpdateTextureNative(SDL_Texture * texture, const SDL_Rect * rect,
-                        const void *pixels, int pitch)
-{
-    SDL_Texture *native = texture->native;
-
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        /* We can lock the texture and copy to it */
-        void *native_pixels;
-        int native_pitch;
-
-        if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
-            return -1;
-        }
-        SDL_ConvertPixels(rect->w, rect->h,
-                          texture->format, pixels, pitch,
-                          native->format, native_pixels, native_pitch);
-        SDL_UnlockTexture(native);
-    } else {
-        /* Use a temporary buffer for updating */
-        void *temp_pixels;
-        int temp_pitch;
-
-        temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3);
-        temp_pixels = SDL_malloc(rect->h * temp_pitch);
-        if (!temp_pixels) {
-            return SDL_OutOfMemory();
-        }
-        SDL_ConvertPixels(rect->w, rect->h,
-                          texture->format, pixels, pitch,
-                          native->format, temp_pixels, temp_pitch);
-        SDL_UpdateTexture(native, rect, temp_pixels, temp_pitch);
-        SDL_free(temp_pixels);
-    }
-    return 0;
-}
-
-int
-SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect,
-                  const void *pixels, int pitch)
-{
-    SDL_Renderer *renderer;
-    SDL_Rect full_rect;
-
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    if (!pixels) {
-        return SDL_InvalidParamError("pixels");
-    }
-    if (!pitch) {
-        return SDL_InvalidParamError("pitch");
-    }
-
-    if (!rect) {
-        full_rect.x = 0;
-        full_rect.y = 0;
-        full_rect.w = texture->w;
-        full_rect.h = texture->h;
-        rect = &full_rect;
-    }
-
-    if (texture->yuv) {
-        return SDL_UpdateTextureYUV(texture, rect, pixels, pitch);
-    } else if (texture->native) {
-        return SDL_UpdateTextureNative(texture, rect, pixels, pitch);
-    } else {
-        renderer = texture->renderer;
-        return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch);
-    }
-}
-
-static int
-SDL_UpdateTextureYUVPlanar(SDL_Texture * texture, const SDL_Rect * rect,
-                           const Uint8 *Yplane, int Ypitch,
-                           const Uint8 *Uplane, int Upitch,
-                           const Uint8 *Vplane, int Vpitch)
-{
-    SDL_Texture *native = texture->native;
-    SDL_Rect full_rect;
-
-    if (SDL_SW_UpdateYUVTexturePlanar(texture->yuv, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch) < 0) {
-        return -1;
-    }
-
-    full_rect.x = 0;
-    full_rect.y = 0;
-    full_rect.w = texture->w;
-    full_rect.h = texture->h;
-    rect = &full_rect;
-
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        /* We can lock the texture and copy to it */
-        void *native_pixels;
-        int native_pitch;
-
-        if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
-            return -1;
-        }
-        SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format,
-                            rect->w, rect->h, native_pixels, native_pitch);
-        SDL_UnlockTexture(native);
-    } else {
-        /* Use a temporary buffer for updating */
-        void *temp_pixels;
-        int temp_pitch;
-
-        temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3);
-        temp_pixels = SDL_malloc(rect->h * temp_pitch);
-        if (!temp_pixels) {
-            return SDL_OutOfMemory();
-        }
-        SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format,
-                            rect->w, rect->h, temp_pixels, temp_pitch);
-        SDL_UpdateTexture(native, rect, temp_pixels, temp_pitch);
-        SDL_free(temp_pixels);
-    }
-    return 0;
-}
-
-int SDL_UpdateYUVTexture(SDL_Texture * texture, const SDL_Rect * rect,
-                         const Uint8 *Yplane, int Ypitch,
-                         const Uint8 *Uplane, int Upitch,
-                         const Uint8 *Vplane, int Vpitch)
-{
-    SDL_Renderer *renderer;
-    SDL_Rect full_rect;
-
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    if (!Yplane) {
-        return SDL_InvalidParamError("Yplane");
-    }
-    if (!Ypitch) {
-        return SDL_InvalidParamError("Ypitch");
-    }
-    if (!Uplane) {
-        return SDL_InvalidParamError("Uplane");
-    }
-    if (!Upitch) {
-        return SDL_InvalidParamError("Upitch");
-    }
-    if (!Vplane) {
-        return SDL_InvalidParamError("Vplane");
-    }
-    if (!Vpitch) {
-        return SDL_InvalidParamError("Vpitch");
-    }
-
-    if (texture->format != SDL_PIXELFORMAT_YV12 &&
-        texture->format != SDL_PIXELFORMAT_IYUV) {
-        return SDL_SetError("Texture format must by YV12 or IYUV");
-    }
-
-    if (!rect) {
-        full_rect.x = 0;
-        full_rect.y = 0;
-        full_rect.w = texture->w;
-        full_rect.h = texture->h;
-        rect = &full_rect;
-    }
-
-    if (texture->yuv) {
-        return SDL_UpdateTextureYUVPlanar(texture, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch);
-    } else {
-        SDL_assert(!texture->native);
-        renderer = texture->renderer;
-        SDL_assert(renderer->UpdateTextureYUV);
-		if (renderer->UpdateTextureYUV) {
-			return renderer->UpdateTextureYUV(renderer, texture, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch);
-		} else {
-			return SDL_Unsupported();
-		}
-	}
-}
-
-static int
-SDL_LockTextureYUV(SDL_Texture * texture, const SDL_Rect * rect,
-                   void **pixels, int *pitch)
-{
-    return SDL_SW_LockYUVTexture(texture->yuv, rect, pixels, pitch);
-}
-
-static int
-SDL_LockTextureNative(SDL_Texture * texture, const SDL_Rect * rect,
-                      void **pixels, int *pitch)
-{
-    texture->locked_rect = *rect;
-    *pixels = (void *) ((Uint8 *) texture->pixels +
-                        rect->y * texture->pitch +
-                        rect->x * SDL_BYTESPERPIXEL(texture->format));
-    *pitch = texture->pitch;
-    return 0;
-}
-
-int
-SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect,
-                void **pixels, int *pitch)
-{
-    SDL_Renderer *renderer;
-    SDL_Rect full_rect;
-
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
-        return SDL_SetError("SDL_LockTexture(): texture must be streaming");
-    }
-
-    if (!rect) {
-        full_rect.x = 0;
-        full_rect.y = 0;
-        full_rect.w = texture->w;
-        full_rect.h = texture->h;
-        rect = &full_rect;
-    }
-
-    if (texture->yuv) {
-        return SDL_LockTextureYUV(texture, rect, pixels, pitch);
-    } else if (texture->native) {
-        return SDL_LockTextureNative(texture, rect, pixels, pitch);
-    } else {
-        renderer = texture->renderer;
-        return renderer->LockTexture(renderer, texture, rect, pixels, pitch);
-    }
-}
-
-static void
-SDL_UnlockTextureYUV(SDL_Texture * texture)
-{
-    SDL_Texture *native = texture->native;
-    void *native_pixels;
-    int native_pitch;
-    SDL_Rect rect;
-
-    rect.x = 0;
-    rect.y = 0;
-    rect.w = texture->w;
-    rect.h = texture->h;
-
-    if (SDL_LockTexture(native, &rect, &native_pixels, &native_pitch) < 0) {
-        return;
-    }
-    SDL_SW_CopyYUVToRGB(texture->yuv, &rect, native->format,
-                        rect.w, rect.h, native_pixels, native_pitch);
-    SDL_UnlockTexture(native);
-}
-
-static void
-SDL_UnlockTextureNative(SDL_Texture * texture)
-{
-    SDL_Texture *native = texture->native;
-    void *native_pixels;
-    int native_pitch;
-    const SDL_Rect *rect = &texture->locked_rect;
-    const void* pixels = (void *) ((Uint8 *) texture->pixels +
-                        rect->y * texture->pitch +
-                        rect->x * SDL_BYTESPERPIXEL(texture->format));
-    int pitch = texture->pitch;
-
-    if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
-        return;
-    }
-    SDL_ConvertPixels(rect->w, rect->h,
-                      texture->format, pixels, pitch,
-                      native->format, native_pixels, native_pitch);
-    SDL_UnlockTexture(native);
-}
-
-void
-SDL_UnlockTexture(SDL_Texture * texture)
-{
-    SDL_Renderer *renderer;
-
-    CHECK_TEXTURE_MAGIC(texture, );
-
-    if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
-        return;
-    }
-    if (texture->yuv) {
-        SDL_UnlockTextureYUV(texture);
-    } else if (texture->native) {
-        SDL_UnlockTextureNative(texture);
-    } else {
-        renderer = texture->renderer;
-        renderer->UnlockTexture(renderer, texture);
-    }
-}
-
-SDL_bool
-SDL_RenderTargetSupported(SDL_Renderer *renderer)
-{
-    if (!renderer || !renderer->SetRenderTarget) {
-        return SDL_FALSE;
-    }
-    return (renderer->info.flags & SDL_RENDERER_TARGETTEXTURE) != 0;
-}
-
-int
-SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
-{
-    if (!SDL_RenderTargetSupported(renderer)) {
-        return SDL_Unsupported();
-    }
-    if (texture == renderer->target) {
-        /* Nothing to do! */
-        return 0;
-    }
-
-    /* texture == NULL is valid and means reset the target to the window */
-    if (texture) {
-        CHECK_TEXTURE_MAGIC(texture, -1);
-        if (renderer != texture->renderer) {
-            return SDL_SetError("Texture was not created with this renderer");
-        }
-        if (texture->access != SDL_TEXTUREACCESS_TARGET) {
-            return SDL_SetError("Texture not created with SDL_TEXTUREACCESS_TARGET");
-        }
-        if (texture->native) {
-            /* Always render to the native texture */
-            texture = texture->native;
-        }
-    }
-
-    if (texture && !renderer->target) {
-        /* Make a backup of the viewport */
-        renderer->viewport_backup = renderer->viewport;
-        renderer->clip_rect_backup = renderer->clip_rect;
-        renderer->scale_backup = renderer->scale;
-        renderer->logical_w_backup = renderer->logical_w;
-        renderer->logical_h_backup = renderer->logical_h;
-    }
-    renderer->target = texture;
-
-    if (renderer->SetRenderTarget(renderer, texture) < 0) {
-        return -1;
-    }
-
-    if (texture) {
-        renderer->viewport.x = 0;
-        renderer->viewport.y = 0;
-        renderer->viewport.w = texture->w;
-        renderer->viewport.h = texture->h;
-        renderer->scale.x = 1.0f;
-        renderer->scale.y = 1.0f;
-        renderer->logical_w = texture->w;
-        renderer->logical_h = texture->h;
-    } else {
-        renderer->viewport = renderer->viewport_backup;
-        renderer->clip_rect = renderer->clip_rect_backup;
-        renderer->scale = renderer->scale_backup;
-        renderer->logical_w = renderer->logical_w_backup;
-        renderer->logical_h = renderer->logical_h_backup;
-    }
-    if (renderer->UpdateViewport(renderer) < 0) {
-        return -1;
-    }
-    if (renderer->UpdateClipRect(renderer) < 0) {
-        return -1;
-    }
-
-    /* All set! */
-    return 0;
-}
-
-SDL_Texture *
-SDL_GetRenderTarget(SDL_Renderer *renderer)
-{
-    return renderer->target;
-}
-
-static int
-UpdateLogicalSize(SDL_Renderer *renderer)
-{
-    int w, h;
-    float want_aspect;
-    float real_aspect;
-    float scale;
-    SDL_Rect viewport;
-
-    if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) {
-        return -1;
-    }
-
-    want_aspect = (float)renderer->logical_w / renderer->logical_h;
-    real_aspect = (float)w / h;
-
-    /* Clear the scale because we're setting viewport in output coordinates */
-    SDL_RenderSetScale(renderer, 1.0f, 1.0f);
-
-    if (SDL_fabs(want_aspect-real_aspect) < 0.0001) {
-        /* The aspect ratios are the same, just scale appropriately */
-        scale = (float)w / renderer->logical_w;
-        SDL_RenderSetViewport(renderer, NULL);
-    } else if (want_aspect > real_aspect) {
-        /* We want a wider aspect ratio than is available - letterbox it */
-        scale = (float)w / renderer->logical_w;
-        viewport.x = 0;
-        viewport.w = w;
-        viewport.h = (int)SDL_ceil(renderer->logical_h * scale);
-        viewport.y = (h - viewport.h) / 2;
-        SDL_RenderSetViewport(renderer, &viewport);
-    } else {
-        /* We want a narrower aspect ratio than is available - use side-bars */
-        scale = (float)h / renderer->logical_h;
-        viewport.y = 0;
-        viewport.h = h;
-        viewport.w = (int)SDL_ceil(renderer->logical_w * scale);
-        viewport.x = (w - viewport.w) / 2;
-        SDL_RenderSetViewport(renderer, &viewport);
-    }
-
-    /* Set the new scale */
-    SDL_RenderSetScale(renderer, scale, scale);
-
-    return 0;
-}
-
-int
-SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    if (!w || !h) {
-        /* Clear any previous logical resolution */
-        renderer->logical_w = 0;
-        renderer->logical_h = 0;
-        SDL_RenderSetViewport(renderer, NULL);
-        SDL_RenderSetScale(renderer, 1.0f, 1.0f);
-        return 0;
-    }
-
-    renderer->logical_w = w;
-    renderer->logical_h = h;
-
-    return UpdateLogicalSize(renderer);
-}
-
-void
-SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h)
-{
-    CHECK_RENDERER_MAGIC(renderer, );
-
-    if (w) {
-        *w = renderer->logical_w;
-    }
-    if (h) {
-        *h = renderer->logical_h;
-    }
-}
-
-int
-SDL_RenderSetViewport(SDL_Renderer * renderer, const SDL_Rect * rect)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    if (rect) {
-        renderer->viewport.x = (int)SDL_floor(rect->x * renderer->scale.x);
-        renderer->viewport.y = (int)SDL_floor(rect->y * renderer->scale.y);
-        renderer->viewport.w = (int)SDL_ceil(rect->w * renderer->scale.x);
-        renderer->viewport.h = (int)SDL_ceil(rect->h * renderer->scale.y);
-    } else {
-        renderer->viewport.x = 0;
-        renderer->viewport.y = 0;
-        if (SDL_GetRendererOutputSize(renderer, &renderer->viewport.w, &renderer->viewport.h) < 0) {
-            return -1;
-        }
-    }
-    return renderer->UpdateViewport(renderer);
-}
-
-void
-SDL_RenderGetViewport(SDL_Renderer * renderer, SDL_Rect * rect)
-{
-    CHECK_RENDERER_MAGIC(renderer, );
-
-    if (rect) {
-        rect->x = (int)(renderer->viewport.x / renderer->scale.x);
-        rect->y = (int)(renderer->viewport.y / renderer->scale.y);
-        rect->w = (int)(renderer->viewport.w / renderer->scale.x);
-        rect->h = (int)(renderer->viewport.h / renderer->scale.y);
-    }
-}
-
-int
-SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1)
-
-    if (rect) {
-        renderer->clip_rect.x = (int)SDL_floor(rect->x * renderer->scale.x);
-        renderer->clip_rect.y = (int)SDL_floor(rect->y * renderer->scale.y);
-        renderer->clip_rect.w = (int)SDL_ceil(rect->w * renderer->scale.x);
-        renderer->clip_rect.h = (int)SDL_ceil(rect->h * renderer->scale.y);
-    } else {
-        SDL_zero(renderer->clip_rect);
-    }
-    return renderer->UpdateClipRect(renderer);
-}
-
-void
-SDL_RenderGetClipRect(SDL_Renderer * renderer, SDL_Rect * rect)
-{
-    CHECK_RENDERER_MAGIC(renderer, )
-
-    if (rect) {
-        rect->x = (int)(renderer->clip_rect.x / renderer->scale.x);
-        rect->y = (int)(renderer->clip_rect.y / renderer->scale.y);
-        rect->w = (int)(renderer->clip_rect.w / renderer->scale.x);
-        rect->h = (int)(renderer->clip_rect.h / renderer->scale.y);
-    }
-}
-
-int
-SDL_RenderSetScale(SDL_Renderer * renderer, float scaleX, float scaleY)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    renderer->scale.x = scaleX;
-    renderer->scale.y = scaleY;
-    return 0;
-}
-
-void
-SDL_RenderGetScale(SDL_Renderer * renderer, float *scaleX, float *scaleY)
-{
-    CHECK_RENDERER_MAGIC(renderer, );
-
-    if (scaleX) {
-        *scaleX = renderer->scale.x;
-    }
-    if (scaleY) {
-        *scaleY = renderer->scale.y;
-    }
-}
-
-int
-SDL_SetRenderDrawColor(SDL_Renderer * renderer,
-                       Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    renderer->r = r;
-    renderer->g = g;
-    renderer->b = b;
-    renderer->a = a;
-    return 0;
-}
-
-int
-SDL_GetRenderDrawColor(SDL_Renderer * renderer,
-                       Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    if (r) {
-        *r = renderer->r;
-    }
-    if (g) {
-        *g = renderer->g;
-    }
-    if (b) {
-        *b = renderer->b;
-    }
-    if (a) {
-        *a = renderer->a;
-    }
-    return 0;
-}
-
-int
-SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    renderer->blendMode = blendMode;
-    return 0;
-}
-
-int
-SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode *blendMode)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    *blendMode = renderer->blendMode;
-    return 0;
-}
-
-int
-SDL_RenderClear(SDL_Renderer * renderer)
-{
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    /* Don't draw while we're hidden */
-    if (renderer->hidden) {
-        return 0;
-    }
-    return renderer->RenderClear(renderer);
-}
-
-int
-SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y)
-{
-    SDL_Point point;
-
-    point.x = x;
-    point.y = y;
-    return SDL_RenderDrawPoints(renderer, &point, 1);
-}
-
-static int
-RenderDrawPointsWithRects(SDL_Renderer * renderer,
-                     const SDL_Point * points, int count)
-{
-    SDL_FRect *frects;
-    int i;
-    int status;
-
-    frects = SDL_stack_alloc(SDL_FRect, count);
-    if (!frects) {
-        return SDL_OutOfMemory();
-    }
-    for (i = 0; i < count; ++i) {
-        frects[i].x = points[i].x * renderer->scale.x;
-        frects[i].y = points[i].y * renderer->scale.y;
-        frects[i].w = renderer->scale.x;
-        frects[i].h = renderer->scale.y;
-    }
-
-    status = renderer->RenderFillRects(renderer, frects, count);
-
-    SDL_stack_free(frects);
-
-    return status;
-}
-
-int
-SDL_RenderDrawPoints(SDL_Renderer * renderer,
-                     const SDL_Point * points, int count)
-{
-    SDL_FPoint *fpoints;
-    int i;
-    int status;
-
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    if (!points) {
-        return SDL_SetError("SDL_RenderDrawPoints(): Passed NULL points");
-    }
-    if (count < 1) {
-        return 0;
-    }
-    /* Don't draw while we're hidden */
-    if (renderer->hidden) {
-        return 0;
-    }
-
-    if (renderer->scale.x != 1.0f || renderer->scale.y != 1.0f) {
-        return RenderDrawPointsWithRects(renderer, points, count);
-    }
-
-    fpoints = SDL_stack_alloc(SDL_FPoint, count);
-    if (!fpoints) {
-        return SDL_OutOfMemory();
-    }
-    for (i = 0; i < count; ++i) {
-        fpoints[i].x = points[i].x * renderer->scale.x;
-        fpoints[i].y = points[i].y * renderer->scale.y;
-    }
-
-    status = renderer->RenderDrawPoints(renderer, fpoints, count);
-
-    SDL_stack_free(fpoints);
-
-    return status;
-}
-
-int
-SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
-{
-    SDL_Point points[2];
-
-    points[0].x = x1;
-    points[0].y = y1;
-    points[1].x = x2;
-    points[1].y = y2;
-    return SDL_RenderDrawLines(renderer, points, 2);
-}
-
-static int
-RenderDrawLinesWithRects(SDL_Renderer * renderer,
-                     const SDL_Point * points, int count)
-{
-    SDL_FRect *frect;
-    SDL_FRect *frects;
-    SDL_FPoint fpoints[2];
-    int i, nrects;
-    int status;
-
-    frects = SDL_stack_alloc(SDL_FRect, count-1);
-    if (!frects) {
-        return SDL_OutOfMemory();
-    }
-
-    status = 0;
-    nrects = 0;
-    for (i = 0; i < count-1; ++i) {
-        if (points[i].x == points[i+1].x) {
-            int minY = SDL_min(points[i].y, points[i+1].y);
-            int maxY = SDL_max(points[i].y, points[i+1].y);
-
-            frect = &frects[nrects++];
-            frect->x = points[i].x * renderer->scale.x;
-            frect->y = minY * renderer->scale.y;
-            frect->w = renderer->scale.x;
-            frect->h = (maxY - minY + 1) * renderer->scale.y;
-        } else if (points[i].y == points[i+1].y) {
-            int minX = SDL_min(points[i].x, points[i+1].x);
-            int maxX = SDL_max(points[i].x, points[i+1].x);
-
-            frect = &frects[nrects++];
-            frect->x = minX * renderer->scale.x;
-            frect->y = points[i].y * renderer->scale.y;
-            frect->w = (maxX - minX + 1) * renderer->scale.x;
-            frect->h = renderer->scale.y;
-        } else {
-            /* FIXME: We can't use a rect for this line... */
-            fpoints[0].x = points[i].x * renderer->scale.x;
-            fpoints[0].y = points[i].y * renderer->scale.y;
-            fpoints[1].x = points[i+1].x * renderer->scale.x;
-            fpoints[1].y = points[i+1].y * renderer->scale.y;
-            status += renderer->RenderDrawLines(renderer, fpoints, 2);
-        }
-    }
-
-    status += renderer->RenderFillRects(renderer, frects, nrects);
-
-    SDL_stack_free(frects);
-
-    if (status < 0) {
-        status = -1;
-    }
-    return status;
-}
-
-int
-SDL_RenderDrawLines(SDL_Renderer * renderer,
-                    const SDL_Point * points, int count)
-{
-    SDL_FPoint *fpoints;
-    int i;
-    int status;
-
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    if (!points) {
-        return SDL_SetError("SDL_RenderDrawLines(): Passed NULL points");
-    }
-    if (count < 2) {
-        return 0;
-    }
-    /* Don't draw while we're hidden */
-    if (renderer->hidden) {
-        return 0;
-    }
-
-    if (renderer->scale.x != 1.0f || renderer->scale.y != 1.0f) {
-        return RenderDrawLinesWithRects(renderer, points, count);
-    }
-
-    fpoints = SDL_stack_alloc(SDL_FPoint, count);
-    if (!fpoints) {
-        return SDL_OutOfMemory();
-    }
-    for (i = 0; i < count; ++i) {
-        fpoints[i].x = points[i].x * renderer->scale.x;
-        fpoints[i].y = points[i].y * renderer->scale.y;
-    }
-
-    status = renderer->RenderDrawLines(renderer, fpoints, count);
-
-    SDL_stack_free(fpoints);
-
-    return status;
-}
-
-int
-SDL_RenderDrawRect(SDL_Renderer * renderer, const SDL_Rect * rect)
-{
-    SDL_Rect full_rect;
-    SDL_Point points[5];
-
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    /* If 'rect' == NULL, then outline the whole surface */
-    if (!rect) {
-        SDL_RenderGetViewport(renderer, &full_rect);
-        full_rect.x = 0;
-        full_rect.y = 0;
-        rect = &full_rect;
-    }
-
-    points[0].x = rect->x;
-    points[0].y = rect->y;
-    points[1].x = rect->x+rect->w-1;
-    points[1].y = rect->y;
-    points[2].x = rect->x+rect->w-1;
-    points[2].y = rect->y+rect->h-1;
-    points[3].x = rect->x;
-    points[3].y = rect->y+rect->h-1;
-    points[4].x = rect->x;
-    points[4].y = rect->y;
-    return SDL_RenderDrawLines(renderer, points, 5);
-}
-
-int
-SDL_RenderDrawRects(SDL_Renderer * renderer,
-                    const SDL_Rect * rects, int count)
-{
-    int i;
-
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    if (!rects) {
-        return SDL_SetError("SDL_RenderDrawRects(): Passed NULL rects");
-    }
-    if (count < 1) {
-        return 0;
-    }
-
-    /* Don't draw while we're hidden */
-    if (renderer->hidden) {
-        return 0;
-    }
-    for (i = 0; i < count; ++i) {
-        if (SDL_RenderDrawRect(renderer, &rects[i]) < 0) {
-            return -1;
-        }
-    }
-    return 0;
-}
-
-int
-SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect)
-{
-    SDL_Rect full_rect = { 0, 0, 0, 0 };
-
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    /* If 'rect' == NULL, then outline the whole surface */
-    if (!rect) {
-        SDL_RenderGetViewport(renderer, &full_rect);
-        full_rect.x = 0;
-        full_rect.y = 0;
-        rect = &full_rect;
-    }
-    return SDL_RenderFillRects(renderer, rect, 1);
-}
-
-int
-SDL_RenderFillRects(SDL_Renderer * renderer,
-                    const SDL_Rect * rects, int count)
-{
-    SDL_FRect *frects;
-    int i;
-    int status;
-
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    if (!rects) {
-        return SDL_SetError("SDL_RenderFillRects(): Passed NULL rects");
-    }
-    if (count < 1) {
-        return 0;
-    }
-    /* Don't draw while we're hidden */
-    if (renderer->hidden) {
-        return 0;
-    }
-
-    frects = SDL_stack_alloc(SDL_FRect, count);
-    if (!frects) {
-        return SDL_OutOfMemory();
-    }
-    for (i = 0; i < count; ++i) {
-        frects[i].x = rects[i].x * renderer->scale.x;
-        frects[i].y = rects[i].y * renderer->scale.y;
-        frects[i].w = rects[i].w * renderer->scale.x;
-        frects[i].h = rects[i].h * renderer->scale.y;
-    }
-
-    status = renderer->RenderFillRects(renderer, frects, count);
-
-    SDL_stack_free(frects);
-
-    return status;
-}
-
-int
-SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-               const SDL_Rect * srcrect, const SDL_Rect * dstrect)
-{
-    SDL_Rect real_srcrect = { 0, 0, 0, 0 };
-    SDL_Rect real_dstrect = { 0, 0, 0, 0 };
-    SDL_FRect frect;
-
-    CHECK_RENDERER_MAGIC(renderer, -1);
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    if (renderer != texture->renderer) {
-        return SDL_SetError("Texture was not created with this renderer");
-    }
-
-    real_srcrect.x = 0;
-    real_srcrect.y = 0;
-    real_srcrect.w = texture->w;
-    real_srcrect.h = texture->h;
-    if (srcrect) {
-        if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) {
-            return 0;
-        }
-    }
-
-    SDL_RenderGetViewport(renderer, &real_dstrect);
-    real_dstrect.x = 0;
-    real_dstrect.y = 0;
-    if (dstrect) {
-        if (!SDL_HasIntersection(dstrect, &real_dstrect)) {
-            return 0;
-        }
-        real_dstrect = *dstrect;
-    }
-
-    if (texture->native) {
-        texture = texture->native;
-    }
-
-    /* Don't draw while we're hidden */
-    if (renderer->hidden) {
-        return 0;
-    }
-
-    frect.x = real_dstrect.x * renderer->scale.x;
-    frect.y = real_dstrect.y * renderer->scale.y;
-    frect.w = real_dstrect.w * renderer->scale.x;
-    frect.h = real_dstrect.h * renderer->scale.y;
-
-    return renderer->RenderCopy(renderer, texture, &real_srcrect, &frect);
-}
-
-
-int
-SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-               const SDL_Rect * srcrect, const SDL_Rect * dstrect,
-               const double angle, const SDL_Point *center, const SDL_RendererFlip flip)
-{
-    SDL_Rect real_srcrect = { 0, 0, 0, 0 };
-    SDL_Rect real_dstrect = { 0, 0, 0, 0 };
-    SDL_Point real_center;
-    SDL_FRect frect;
-    SDL_FPoint fcenter;
-
-    CHECK_RENDERER_MAGIC(renderer, -1);
-    CHECK_TEXTURE_MAGIC(texture, -1);
-
-    if (renderer != texture->renderer) {
-        return SDL_SetError("Texture was not created with this renderer");
-    }
-    if (!renderer->RenderCopyEx) {
-        return SDL_SetError("Renderer does not support RenderCopyEx");
-    }
-
-    real_srcrect.x = 0;
-    real_srcrect.y = 0;
-    real_srcrect.w = texture->w;
-    real_srcrect.h = texture->h;
-    if (srcrect) {
-        if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) {
-            return 0;
-        }
-    }
-
-    /* We don't intersect the dstrect with the viewport as RenderCopy does because of potential rotation clipping issues... TODO: should we? */
-    if (dstrect) {
-        real_dstrect = *dstrect;
-    } else {
-        SDL_RenderGetViewport(renderer, &real_dstrect);
-        real_dstrect.x = 0;
-        real_dstrect.y = 0;
-    }
-
-    if (texture->native) {
-        texture = texture->native;
-    }
-
-    if(center) real_center = *center;
-    else {
-        real_center.x = real_dstrect.w/2;
-        real_center.y = real_dstrect.h/2;
-    }
-
-    frect.x = real_dstrect.x * renderer->scale.x;
-    frect.y = real_dstrect.y * renderer->scale.y;
-    frect.w = real_dstrect.w * renderer->scale.x;
-    frect.h = real_dstrect.h * renderer->scale.y;
-
-    fcenter.x = real_center.x * renderer->scale.x;
-    fcenter.y = real_center.y * renderer->scale.y;
-
-    return renderer->RenderCopyEx(renderer, texture, &real_srcrect, &frect, angle, &fcenter, flip);
-}
-
-int
-SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                     Uint32 format, void * pixels, int pitch)
-{
-    SDL_Rect real_rect;
-
-    CHECK_RENDERER_MAGIC(renderer, -1);
-
-    if (!renderer->RenderReadPixels) {
-        return SDL_Unsupported();
-    }
-
-    if (!format) {
-        format = SDL_GetWindowPixelFormat(renderer->window);
-    }
-
-    real_rect.x = renderer->viewport.x;
-    real_rect.y = renderer->viewport.y;
-    real_rect.w = renderer->viewport.w;
-    real_rect.h = renderer->viewport.h;
-    if (rect) {
-        if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) {
-            return 0;
-        }
-        if (real_rect.y > rect->y) {
-            pixels = (Uint8 *)pixels + pitch * (real_rect.y - rect->y);
-        }
-        if (real_rect.x > rect->x) {
-            int bpp = SDL_BYTESPERPIXEL(format);
-            pixels = (Uint8 *)pixels + bpp * (real_rect.x - rect->x);
-        }
-    }
-
-    return renderer->RenderReadPixels(renderer, &real_rect,
-                                      format, pixels, pitch);
-}
-
-void
-SDL_RenderPresent(SDL_Renderer * renderer)
-{
-    CHECK_RENDERER_MAGIC(renderer, );
-
-    /* Don't draw while we're hidden */
-    if (renderer->hidden) {
-        return;
-    }
-    renderer->RenderPresent(renderer);
-}
-
-void
-SDL_DestroyTexture(SDL_Texture * texture)
-{
-    SDL_Renderer *renderer;
-
-    CHECK_TEXTURE_MAGIC(texture, );
-
-    renderer = texture->renderer;
-    if (texture == renderer->target) {
-        SDL_SetRenderTarget(renderer, NULL);
-    }
-
-    texture->magic = NULL;
-
-    if (texture->next) {
-        texture->next->prev = texture->prev;
-    }
-    if (texture->prev) {
-        texture->prev->next = texture->next;
-    } else {
-        renderer->textures = texture->next;
-    }
-
-    if (texture->native) {
-        SDL_DestroyTexture(texture->native);
-    }
-    if (texture->yuv) {
-        SDL_SW_DestroyYUVTexture(texture->yuv);
-    }
-    SDL_free(texture->pixels);
-
-    renderer->DestroyTexture(renderer, texture);
-    SDL_free(texture);
-}
-
-void
-SDL_DestroyRenderer(SDL_Renderer * renderer)
-{
-    CHECK_RENDERER_MAGIC(renderer, );
-
-    SDL_DelEventWatch(SDL_RendererEventWatch, renderer);
-
-    /* Free existing textures for this renderer */
-    while (renderer->textures) {
-        SDL_DestroyTexture(renderer->textures);
-    }
-
-    if (renderer->window) {
-        SDL_SetWindowData(renderer->window, SDL_WINDOWRENDERDATA, NULL);
-    }
-
-    /* It's no longer magical... */
-    renderer->magic = NULL;
-
-    /* Free the renderer instance */
-    renderer->DestroyRenderer(renderer);
-}
-
-int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh)
-{
-    SDL_Renderer *renderer;
-
-    CHECK_TEXTURE_MAGIC(texture, -1);
-    renderer = texture->renderer;
-    if (texture->native) {
-        return SDL_GL_BindTexture(texture->native, texw, texh);
-    } else if (renderer && renderer->GL_BindTexture) {
-        return renderer->GL_BindTexture(renderer, texture, texw, texh);
-    } else {
-        return SDL_Unsupported();
-    }
-}
-
-int SDL_GL_UnbindTexture(SDL_Texture *texture)
-{
-    SDL_Renderer *renderer;
-
-    CHECK_TEXTURE_MAGIC(texture, -1);
-    renderer = texture->renderer;
-    if (renderer && renderer->GL_UnbindTexture) {
-        return renderer->GL_UnbindTexture(renderer, texture);
-    }
-
-    return SDL_Unsupported();
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/SDL_sysrender.h b/deps/SDL2/src/render/SDL_sysrender.h
deleted file mode 100644
index b3d6868..0000000
--- a/deps/SDL2/src/render/SDL_sysrender.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_sysrender_h
-#define _SDL_sysrender_h
-
-#include "SDL_render.h"
-#include "SDL_events.h"
-#include "SDL_yuv_sw_c.h"
-
-/* The SDL 2D rendering system */
-
-typedef struct SDL_RenderDriver SDL_RenderDriver;
-
-typedef struct
-{
-    float x;
-    float y;
-} SDL_FPoint;
-
-typedef struct
-{
-    float x;
-    float y;
-    float w;
-    float h;
-} SDL_FRect;
-
-/* Define the SDL texture structure */
-struct SDL_Texture
-{
-    const void *magic;
-    Uint32 format;              /**< The pixel format of the texture */
-    int access;                 /**< SDL_TextureAccess */
-    int w;                      /**< The width of the texture */
-    int h;                      /**< The height of the texture */
-    int modMode;                /**< The texture modulation mode */
-    SDL_BlendMode blendMode;    /**< The texture blend mode */
-    Uint8 r, g, b, a;           /**< Texture modulation values */
-
-    SDL_Renderer *renderer;
-
-    /* Support for formats not supported directly by the renderer */
-    SDL_Texture *native;
-    SDL_SW_YUVTexture *yuv;
-    void *pixels;
-    int pitch;
-    SDL_Rect locked_rect;
-
-    void *driverdata;           /**< Driver specific texture representation */
-
-    SDL_Texture *prev;
-    SDL_Texture *next;
-};
-
-/* Define the SDL renderer structure */
-struct SDL_Renderer
-{
-    const void *magic;
-
-    void (*WindowEvent) (SDL_Renderer * renderer, const SDL_WindowEvent *event);
-    int (*GetOutputSize) (SDL_Renderer * renderer, int *w, int *h);
-    int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
-    int (*SetTextureColorMod) (SDL_Renderer * renderer,
-                               SDL_Texture * texture);
-    int (*SetTextureAlphaMod) (SDL_Renderer * renderer,
-                               SDL_Texture * texture);
-    int (*SetTextureBlendMode) (SDL_Renderer * renderer,
-                                SDL_Texture * texture);
-    int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
-                          const SDL_Rect * rect, const void *pixels,
-                          int pitch);
-    int (*UpdateTextureYUV) (SDL_Renderer * renderer, SDL_Texture * texture,
-                            const SDL_Rect * rect,
-                            const Uint8 *Yplane, int Ypitch,
-                            const Uint8 *Uplane, int Upitch,
-                            const Uint8 *Vplane, int Vpitch);
-    int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
-                        const SDL_Rect * rect, void **pixels, int *pitch);
-    void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
-    int (*SetRenderTarget) (SDL_Renderer * renderer, SDL_Texture * texture);
-    int (*UpdateViewport) (SDL_Renderer * renderer);
-    int (*UpdateClipRect) (SDL_Renderer * renderer);
-    int (*RenderClear) (SDL_Renderer * renderer);
-    int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_FPoint * points,
-                             int count);
-    int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_FPoint * points,
-                            int count);
-    int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_FRect * rects,
-                            int count);
-    int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
-                       const SDL_Rect * srcrect, const SDL_FRect * dstrect);
-    int (*RenderCopyEx) (SDL_Renderer * renderer, SDL_Texture * texture,
-                       const SDL_Rect * srcquad, const SDL_FRect * dstrect,
-                       const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip);
-    int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect,
-                             Uint32 format, void * pixels, int pitch);
-    void (*RenderPresent) (SDL_Renderer * renderer);
-    void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
-
-    void (*DestroyRenderer) (SDL_Renderer * renderer);
-
-    int (*GL_BindTexture) (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh);
-    int (*GL_UnbindTexture) (SDL_Renderer * renderer, SDL_Texture *texture);
-
-    /* The current renderer info */
-    SDL_RendererInfo info;
-
-    /* The window associated with the renderer */
-    SDL_Window *window;
-    SDL_bool hidden;
-
-    /* The logical resolution for rendering */
-    int logical_w;
-    int logical_h;
-    int logical_w_backup;
-    int logical_h_backup;
-
-    /* The drawable area within the window */
-    SDL_Rect viewport;
-    SDL_Rect viewport_backup;
-
-    /* The clip rectangle within the window */
-    SDL_Rect clip_rect;
-    SDL_Rect clip_rect_backup;
-
-    /* The render output coordinate scale */
-    SDL_FPoint scale;
-    SDL_FPoint scale_backup;
-
-    /* The list of textures */
-    SDL_Texture *textures;
-    SDL_Texture *target;
-
-    Uint8 r, g, b, a;                   /**< Color for drawing operations values */
-    SDL_BlendMode blendMode;            /**< The drawing blend mode */
-
-    void *driverdata;
-};
-
-/* Define the SDL render driver structure */
-struct SDL_RenderDriver
-{
-    SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags);
-
-    /* Info about the renderer capabilities */
-    SDL_RendererInfo info;
-};
-
-#if !SDL_RENDER_DISABLED
-
-#if SDL_VIDEO_RENDER_D3D
-extern SDL_RenderDriver D3D_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_OGL
-extern SDL_RenderDriver GL_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_OGL_ES2
-extern SDL_RenderDriver GLES2_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_OGL_ES
-extern SDL_RenderDriver GLES_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_DIRECTFB
-extern SDL_RenderDriver DirectFB_RenderDriver;
-#endif
-#if SDL_VIDEO_RENDER_PSP
-extern SDL_RenderDriver PSP_RenderDriver;
-#endif
-extern SDL_RenderDriver SW_RenderDriver;
-
-#endif /* !SDL_RENDER_DISABLED */
-
-#endif /* _SDL_sysrender_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/SDL_yuv_mmx.c b/deps/SDL2/src/render/SDL_yuv_mmx.c
deleted file mode 100644
index b223d2d..0000000
--- a/deps/SDL2/src/render/SDL_yuv_mmx.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
-
-#include "SDL_stdinc.h"
-
-#include "mmx.h"
-
-/* *INDENT-OFF* */
-
-static mmx_t MMX_0080w    = { .ud = {0x00800080, 0x00800080} };
-static mmx_t MMX_00FFw    = { .ud = {0x00ff00ff, 0x00ff00ff} };
-static mmx_t MMX_FF00w    = { .ud = {0xff00ff00, 0xff00ff00} };
-
-static mmx_t MMX_Ycoeff   = { .uw = {0x004a, 0x004a, 0x004a, 0x004a} };
-
-static mmx_t MMX_UbluRGB  = { .uw = {0x0072, 0x0072, 0x0072, 0x0072} };
-static mmx_t MMX_VredRGB  = { .uw = {0x0059, 0x0059, 0x0059, 0x0059} };
-static mmx_t MMX_UgrnRGB  = { .uw = {0xffea, 0xffea, 0xffea, 0xffea} };
-static mmx_t MMX_VgrnRGB  = { .uw = {0xffd2, 0xffd2, 0xffd2, 0xffd2} };
-
-static mmx_t MMX_Ublu5x5  = { .uw = {0x0081, 0x0081, 0x0081, 0x0081} };
-static mmx_t MMX_Vred5x5  = { .uw = {0x0066, 0x0066, 0x0066, 0x0066} };
-static mmx_t MMX_Ugrn565  = { .uw = {0xffe8, 0xffe8, 0xffe8, 0xffe8} };
-static mmx_t MMX_Vgrn565  = { .uw = {0xffcd, 0xffcd, 0xffcd, 0xffcd} };
-
-static mmx_t MMX_red565   = { .uw = {0xf800, 0xf800, 0xf800, 0xf800} };
-static mmx_t MMX_grn565   = { .uw = {0x07e0, 0x07e0, 0x07e0, 0x07e0} };
-
-/**
-   This MMX assembler is my first assembler/MMX program ever.
-   Thus it maybe buggy.
-   Send patches to:
-   mvogt at rhrk.uni-kl.de
-
-   After it worked fine I have "obfuscated" the code a bit to have
-   more parallism in the MMX units. This means I moved
-   initilisation around and delayed other instruction.
-   Performance measurement did not show that this brought any advantage
-   but in theory it _should_ be faster this way.
-
-   The overall performanve gain to the C based dither was 30%-40%.
-   The MMX routine calculates 256bit=8RGB values in each cycle
-   (4 for row1 & 4 for row2)
-
-   The red/green/blue.. coefficents are taken from the mpeg_play
-   player. They look nice, but I dont know if you can have
-   better values, to avoid integer rounding errors.
-
-
-   IMPORTANT:
-   ==========
-
-   It is a requirement that the cr/cb/lum are 8 byte aligned and
-   the out are 16byte aligned or you will/may get segfaults
-
-*/
-
-void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
-                              unsigned char *lum, unsigned char *cr,
-                              unsigned char *cb, unsigned char *out,
-                              int rows, int cols, int mod )
-{
-    Uint32 *row1;
-    Uint32 *row2;
-
-    unsigned char* y = lum +cols*rows;    /* Pointer to the end */
-    int x = 0;
-    row1 = (Uint32 *)out;                 /* 32 bit target */
-    row2 = (Uint32 *)out+cols+mod;        /* start of second row */
-    mod = (mod+cols+mod)*4;               /* increment for row1 in byte */
-
-    __asm__ __volatile__ (
-        /* tap dance to workaround the inability to use %%ebx at will... */
-        /*  move one thing to the stack... */
-        "pushl $0\n"  /* save a slot on the stack. */
-        "pushl %%ebx\n"  /* save %%ebx. */
-        "movl %0, %%ebx\n"  /* put the thing in ebx. */
-        "movl %%ebx,4(%%esp)\n"  /* put the thing in the stack slot. */
-        "popl %%ebx\n"  /* get back %%ebx (the PIC register). */
-
-        ".align 8\n"
-        "1:\n"
-
-        /* create Cr (result in mm1) */
-        "pushl %%ebx\n"
-        "movl 4(%%esp),%%ebx\n"
-        "movd (%%ebx),%%mm1\n"   /*         0  0  0  0  v3 v2 v1 v0 */
-        "popl %%ebx\n"
-        "pxor %%mm7,%%mm7\n"      /*         00 00 00 00 00 00 00 00 */
-        "movd (%2), %%mm2\n"           /*    0  0  0  0 l3 l2 l1 l0 */
-        "punpcklbw %%mm7,%%mm1\n" /*         0  v3 0  v2 00 v1 00 v0 */
-        "punpckldq %%mm1,%%mm1\n" /*         00 v1 00 v0 00 v1 00 v0 */
-        "psubw %9,%%mm1\n"        /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */
-
-        /* create Cr_g (result in mm0) */
-        "movq %%mm1,%%mm0\n"           /* r1 r1 r0 r0 r1 r1 r0 r0 */
-        "pmullw %10,%%mm0\n"           /* red*-46dec=0.7136*64 */
-        "pmullw %11,%%mm1\n"           /* red*89dec=1.4013*64 */
-        "psraw  $6, %%mm0\n"           /* red=red/64 */
-        "psraw  $6, %%mm1\n"           /* red=red/64 */
-
-        /* create L1 L2 (result in mm2,mm4) */
-        /* L2=lum+cols */
-        "movq (%2,%4),%%mm3\n"         /*    0  0  0  0 L3 L2 L1 L0 */
-        "punpckldq %%mm3,%%mm2\n"      /*   L3 L2 L1 L0 l3 l2 l1 l0 */
-        "movq %%mm2,%%mm4\n"           /*   L3 L2 L1 L0 l3 l2 l1 l0 */
-        "pand %12,%%mm2\n"             /*   L3 0  L1  0 l3  0 l1  0 */
-        "pand %13,%%mm4\n"             /*   0  L2  0 L0  0 l2  0 l0 */
-        "psrlw $8,%%mm2\n"             /*   0  L3  0 L1  0 l3  0 l1 */
-
-        /* create R (result in mm6) */
-        "movq %%mm2,%%mm5\n"           /*   0 L3  0 L1  0 l3  0 l1 */
-        "movq %%mm4,%%mm6\n"           /*   0 L2  0 L0  0 l2  0 l0 */
-        "paddsw  %%mm1, %%mm5\n"       /* lum1+red:x R3 x R1 x r3 x r1 */
-        "paddsw  %%mm1, %%mm6\n"       /* lum1+red:x R2 x R0 x r2 x r0 */
-        "packuswb %%mm5,%%mm5\n"       /*  R3 R1 r3 r1 R3 R1 r3 r1 */
-        "packuswb %%mm6,%%mm6\n"       /*  R2 R0 r2 r0 R2 R0 r2 r0 */
-        "pxor %%mm7,%%mm7\n"      /*         00 00 00 00 00 00 00 00 */
-        "punpcklbw %%mm5,%%mm6\n"      /*  R3 R2 R1 R0 r3 r2 r1 r0 */
-
-        /* create Cb (result in mm1) */
-        "movd (%1), %%mm1\n"      /*         0  0  0  0  u3 u2 u1 u0 */
-        "punpcklbw %%mm7,%%mm1\n" /*         0  u3 0  u2 00 u1 00 u0 */
-        "punpckldq %%mm1,%%mm1\n" /*         00 u1 00 u0 00 u1 00 u0 */
-        "psubw %9,%%mm1\n"        /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */
-
-        /* create Cb_g (result in mm5) */
-        "movq %%mm1,%%mm5\n"            /* u1 u1 u0 u0 u1 u1 u0 u0 */
-        "pmullw %14,%%mm5\n"            /* blue*-109dec=1.7129*64 */
-        "pmullw %15,%%mm1\n"            /* blue*114dec=1.78125*64 */
-        "psraw  $6, %%mm5\n"            /* blue=red/64 */
-        "psraw  $6, %%mm1\n"            /* blue=blue/64 */
-
-        /* create G (result in mm7) */
-        "movq %%mm2,%%mm3\n"      /*   0  L3  0 L1  0 l3  0 l1 */
-        "movq %%mm4,%%mm7\n"      /*   0  L2  0 L0  0 l2  0 l1 */
-        "paddsw  %%mm5, %%mm3\n"  /* lum1+Cb_g:x G3t x G1t x g3t x g1t */
-        "paddsw  %%mm5, %%mm7\n"  /* lum1+Cb_g:x G2t x G0t x g2t x g0t */
-        "paddsw  %%mm0, %%mm3\n"  /* lum1+Cr_g:x G3  x G1  x g3  x g1 */
-        "paddsw  %%mm0, %%mm7\n"  /* lum1+blue:x G2  x G0  x g2  x g0 */
-        "packuswb %%mm3,%%mm3\n"  /* G3 G1 g3 g1 G3 G1 g3 g1 */
-        "packuswb %%mm7,%%mm7\n"  /* G2 G0 g2 g0 G2 G0 g2 g0 */
-        "punpcklbw %%mm3,%%mm7\n" /* G3 G2 G1 G0 g3 g2 g1 g0 */
-
-        /* create B (result in mm5) */
-        "movq %%mm2,%%mm3\n"         /*   0  L3  0 L1  0 l3  0 l1 */
-        "movq %%mm4,%%mm5\n"         /*   0  L2  0 L0  0 l2  0 l1 */
-        "paddsw  %%mm1, %%mm3\n"     /* lum1+blue:x B3 x B1 x b3 x b1 */
-        "paddsw  %%mm1, %%mm5\n"     /* lum1+blue:x B2 x B0 x b2 x b0 */
-        "packuswb %%mm3,%%mm3\n"     /* B3 B1 b3 b1 B3 B1 b3 b1 */
-        "packuswb %%mm5,%%mm5\n"     /* B2 B0 b2 b0 B2 B0 b2 b0 */
-        "punpcklbw %%mm3,%%mm5\n"    /* B3 B2 B1 B0 b3 b2 b1 b0 */
-
-        /* fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */
-
-        "pxor %%mm2,%%mm2\n"           /*  0  0  0  0  0  0  0  0 */
-        "pxor %%mm4,%%mm4\n"           /*  0  0  0  0  0  0  0  0 */
-        "movq %%mm6,%%mm1\n"           /* R3 R2 R1 R0 r3 r2 r1 r0 */
-        "movq %%mm5,%%mm3\n"           /* B3 B2 B1 B0 b3 b2 b1 b0 */
-
-        /* process lower lum */
-        "punpcklbw %%mm4,%%mm1\n"      /*  0 r3  0 r2  0 r1  0 r0 */
-        "punpcklbw %%mm4,%%mm3\n"      /*  0 b3  0 b2  0 b1  0 b0 */
-        "movq %%mm1,%%mm2\n"           /*  0 r3  0 r2  0 r1  0 r0 */
-        "movq %%mm3,%%mm0\n"           /*  0 b3  0 b2  0 b1  0 b0 */
-        "punpcklwd %%mm1,%%mm3\n"      /*  0 r1  0 b1  0 r0  0 b0 */
-        "punpckhwd %%mm2,%%mm0\n"      /*  0 r3  0 b3  0 r2  0 b2 */
-
-        "pxor %%mm2,%%mm2\n"           /*  0  0  0  0  0  0  0  0 */
-        "movq %%mm7,%%mm1\n"           /* G3 G2 G1 G0 g3 g2 g1 g0 */
-        "punpcklbw %%mm1,%%mm2\n"      /* g3  0 g2  0 g1  0 g0  0 */
-        "punpcklwd %%mm4,%%mm2\n"      /*  0  0 g1  0  0  0 g0  0 */
-        "por %%mm3, %%mm2\n"          /*  0 r1 g1 b1  0 r0 g0 b0 */
-        "movq %%mm2,(%3)\n"          /* wrote out ! row1 */
-
-        "pxor %%mm2,%%mm2\n"           /*  0  0  0  0  0  0  0  0 */
-        "punpcklbw %%mm1,%%mm4\n"      /* g3  0 g2  0 g1  0 g0  0 */
-        "punpckhwd %%mm2,%%mm4\n"      /*  0  0 g3  0  0  0 g2  0 */
-        "por %%mm0, %%mm4\n"          /*  0 r3 g3 b3  0 r2 g2 b2 */
-        "movq %%mm4,8(%3)\n"         /* wrote out ! row1 */
-
-        /* fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */
-        /* this can be done "destructive" */
-        "pxor %%mm2,%%mm2\n"           /*  0  0  0  0  0  0  0  0 */
-        "punpckhbw %%mm2,%%mm6\n"      /*  0 R3  0 R2  0 R1  0 R0 */
-        "punpckhbw %%mm1,%%mm5\n"      /* G3 B3 G2 B2 G1 B1 G0 B0 */
-        "movq %%mm5,%%mm1\n"           /* G3 B3 G2 B2 G1 B1 G0 B0 */
-        "punpcklwd %%mm6,%%mm1\n"      /*  0 R1 G1 B1  0 R0 G0 B0 */
-        "movq %%mm1,(%5)\n"          /* wrote out ! row2 */
-        "punpckhwd %%mm6,%%mm5\n"      /*  0 R3 G3 B3  0 R2 G2 B2 */
-        "movq %%mm5,8(%5)\n"         /* wrote out ! row2 */
-
-        "addl $4,%2\n"            /* lum+4 */
-        "leal 16(%3),%3\n"        /* row1+16 */
-        "leal 16(%5),%5\n"        /* row2+16 */
-        "addl $2,(%%esp)\n"        /* cr+2 */
-        "addl $2,%1\n"           /* cb+2 */
-
-        "addl $4,%6\n"            /* x+4 */
-        "cmpl %4,%6\n"
-
-        "jl 1b\n"
-        "addl %4,%2\n" /* lum += cols */
-        "addl %8,%3\n" /* row1+= mod */
-        "addl %8,%5\n" /* row2+= mod */
-        "movl $0,%6\n" /* x=0 */
-        "cmpl %7,%2\n"
-        "jl 1b\n"
-
-        "addl $4,%%esp\n"  /* get rid of the stack slot we reserved. */
-        "emms\n"  /* reset MMX registers. */
-        :
-        : "m" (cr), "r"(cb),"r"(lum),
-          "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
-          "m"(MMX_0080w),"m"(MMX_VgrnRGB),"m"(MMX_VredRGB),
-          "m"(MMX_FF00w),"m"(MMX_00FFw),"m"(MMX_UgrnRGB),
-          "m"(MMX_UbluRGB)
-    );
-}
-
-void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
-                             unsigned char *lum, unsigned char *cr,
-                             unsigned char *cb, unsigned char *out,
-                             int rows, int cols, int mod )
-{
-    Uint16 *row1;
-    Uint16 *row2;
-
-    unsigned char* y = lum +cols*rows;    /* Pointer to the end */
-    int x = 0;
-    row1 = (Uint16 *)out;                 /* 16 bit target */
-    row2 = (Uint16 *)out+cols+mod;        /* start of second row  */
-    mod = (mod+cols+mod)*2;               /* increment for row1 in byte */
-
-    __asm__ __volatile__(
-        /* tap dance to workaround the inability to use %%ebx at will... */
-        /*  move one thing to the stack... */
-        "pushl $0\n"  /* save a slot on the stack. */
-        "pushl %%ebx\n"  /* save %%ebx. */
-        "movl %0, %%ebx\n"  /* put the thing in ebx. */
-        "movl %%ebx, 4(%%esp)\n"  /* put the thing in the stack slot. */
-        "popl %%ebx\n"  /* get back %%ebx (the PIC register). */
-
-        ".align 8\n"
-        "1:\n"
-
-        "movd           (%1),                   %%mm0\n" /* 4 Cb         0  0  0  0 u3 u2 u1 u0 */
-        "pxor           %%mm7,                  %%mm7\n"
-        "pushl %%ebx\n"
-        "movl 4(%%esp), %%ebx\n"
-        "movd (%%ebx), %%mm1\n"   /* 4 Cr                0  0  0  0 v3 v2 v1 v0 */
-        "popl %%ebx\n"
-
-        "punpcklbw      %%mm7,                  %%mm0\n" /* 4 W cb   0 u3  0 u2  0 u1  0 u0 */
-        "punpcklbw      %%mm7,                  %%mm1\n" /* 4 W cr   0 v3  0 v2  0 v1  0 v0 */
-        "psubw          %9,                     %%mm0\n"
-        "psubw          %9,                     %%mm1\n"
-        "movq           %%mm0,                  %%mm2\n" /* Cb                   0 u3  0 u2  0 u1  0 u0 */
-        "movq           %%mm1,                  %%mm3\n" /* Cr */
-        "pmullw         %10,                    %%mm2\n" /* Cb2green 0 R3  0 R2  0 R1  0 R0 */
-        "movq           (%2),                   %%mm6\n" /* L1      l7 L6 L5 L4 L3 L2 L1 L0 */
-        "pmullw         %11,                    %%mm0\n" /* Cb2blue */
-        "pand           %12,                    %%mm6\n" /* L1      00 L6 00 L4 00 L2 00 L0 */
-        "pmullw         %13,                    %%mm3\n" /* Cr2green */
-        "movq           (%2),                   %%mm7\n" /* L2 */
-        "pmullw         %14,                    %%mm1\n" /* Cr2red */
-        "psrlw          $8,                     %%mm7\n"        /* L2           00 L7 00 L5 00 L3 00 L1 */
-        "pmullw         %15,                    %%mm6\n" /* lum1 */
-        "paddw          %%mm3,                  %%mm2\n" /* Cb2green + Cr2green == green */
-        "pmullw         %15,                    %%mm7\n" /* lum2 */
-
-        "movq           %%mm6,                  %%mm4\n" /* lum1 */
-        "paddw          %%mm0,                  %%mm6\n" /* lum1 +blue 00 B6 00 B4 00 B2 00 B0 */
-        "movq           %%mm4,                  %%mm5\n" /* lum1 */
-        "paddw          %%mm1,                  %%mm4\n" /* lum1 +red  00 R6 00 R4 00 R2 00 R0 */
-        "paddw          %%mm2,                  %%mm5\n" /* lum1 +green 00 G6 00 G4 00 G2 00 G0 */
-        "psraw          $6,                     %%mm4\n" /* R1 0 .. 64 */
-        "movq           %%mm7,                  %%mm3\n" /* lum2                       00 L7 00 L5 00 L3 00 L1 */
-        "psraw          $6,                     %%mm5\n" /* G1  - .. + */
-        "paddw          %%mm0,                  %%mm7\n" /* Lum2 +blue 00 B7 00 B5 00 B3 00 B1 */
-        "psraw          $6,                     %%mm6\n" /* B1         0 .. 64 */
-        "packuswb       %%mm4,                  %%mm4\n" /* R1 R1 */
-        "packuswb       %%mm5,                  %%mm5\n" /* G1 G1 */
-        "packuswb       %%mm6,                  %%mm6\n" /* B1 B1 */
-        "punpcklbw      %%mm4,                  %%mm4\n"
-        "punpcklbw      %%mm5,                  %%mm5\n"
-
-        "pand           %16,                    %%mm4\n"
-        "psllw          $3,                     %%mm5\n" /* GREEN       1 */
-        "punpcklbw      %%mm6,                  %%mm6\n"
-        "pand           %17,                    %%mm5\n"
-        "pand           %16,                    %%mm6\n"
-        "por            %%mm5,                  %%mm4\n" /* */
-        "psrlw          $11,                    %%mm6\n" /* BLUE        1 */
-        "movq           %%mm3,                  %%mm5\n" /* lum2 */
-        "paddw          %%mm1,                  %%mm3\n" /* lum2 +red      00 R7 00 R5 00 R3 00 R1 */
-        "paddw          %%mm2,                  %%mm5\n" /* lum2 +green 00 G7 00 G5 00 G3 00 G1 */
-        "psraw          $6,                     %%mm3\n" /* R2 */
-        "por            %%mm6,                  %%mm4\n" /* MM4 */
-        "psraw          $6,                     %%mm5\n" /* G2 */
-        "movq           (%2, %4),               %%mm6\n" /* L3 load lum2 */
-        "psraw          $6,                     %%mm7\n"
-        "packuswb       %%mm3,                  %%mm3\n"
-        "packuswb       %%mm5,                  %%mm5\n"
-        "packuswb       %%mm7,                  %%mm7\n"
-        "pand           %12,                    %%mm6\n" /* L3 */
-        "punpcklbw      %%mm3,                  %%mm3\n"
-        "punpcklbw      %%mm5,                  %%mm5\n"
-        "pmullw         %15,                    %%mm6\n" /* lum3 */
-        "punpcklbw      %%mm7,                  %%mm7\n"
-        "psllw          $3,                     %%mm5\n" /* GREEN 2 */
-        "pand           %16,                    %%mm7\n"
-        "pand           %16,                    %%mm3\n"
-        "psrlw          $11,                    %%mm7\n" /* BLUE  2 */
-        "pand           %17,                    %%mm5\n"
-        "por            %%mm7,                  %%mm3\n"
-        "movq           (%2,%4),                %%mm7\n" /* L4 load lum2 */
-        "por            %%mm5,                  %%mm3\n"
-        "psrlw          $8,                     %%mm7\n" /* L4 */
-        "movq           %%mm4,                  %%mm5\n"
-        "punpcklwd      %%mm3,                  %%mm4\n"
-        "pmullw         %15,                    %%mm7\n" /* lum4 */
-        "punpckhwd      %%mm3,                  %%mm5\n"
-
-        "movq           %%mm4,                  (%3)\n"  /* write row1 */
-        "movq           %%mm5,                  8(%3)\n" /* write row1 */
-
-        "movq           %%mm6,                  %%mm4\n" /* Lum3 */
-        "paddw          %%mm0,                  %%mm6\n" /* Lum3 +blue */
-
-        "movq           %%mm4,                  %%mm5\n" /* Lum3 */
-        "paddw          %%mm1,                  %%mm4\n" /* Lum3 +red */
-        "paddw          %%mm2,                  %%mm5\n" /* Lum3 +green */
-        "psraw          $6,                     %%mm4\n"
-        "movq           %%mm7,                  %%mm3\n" /* Lum4 */
-        "psraw          $6,                     %%mm5\n"
-        "paddw          %%mm0,                  %%mm7\n" /* Lum4 +blue */
-        "psraw          $6,                     %%mm6\n" /* Lum3 +blue */
-        "movq           %%mm3,                  %%mm0\n" /* Lum4 */
-        "packuswb       %%mm4,                  %%mm4\n"
-        "paddw          %%mm1,                  %%mm3\n" /* Lum4 +red */
-        "packuswb       %%mm5,                  %%mm5\n"
-        "paddw          %%mm2,                  %%mm0\n" /* Lum4 +green */
-        "packuswb       %%mm6,                  %%mm6\n"
-        "punpcklbw      %%mm4,                  %%mm4\n"
-        "punpcklbw      %%mm5,                  %%mm5\n"
-        "punpcklbw      %%mm6,                  %%mm6\n"
-        "psllw          $3,                     %%mm5\n" /* GREEN 3 */
-        "pand           %16,                    %%mm4\n"
-        "psraw          $6,                     %%mm3\n" /* psr 6 */
-        "psraw          $6,                     %%mm0\n"
-        "pand           %16,                    %%mm6\n" /* BLUE */
-        "pand           %17,                    %%mm5\n"
-        "psrlw          $11,                    %%mm6\n" /* BLUE  3 */
-        "por            %%mm5,                  %%mm4\n"
-        "psraw          $6,                     %%mm7\n"
-        "por            %%mm6,                  %%mm4\n"
-        "packuswb       %%mm3,                  %%mm3\n"
-        "packuswb       %%mm0,                  %%mm0\n"
-        "packuswb       %%mm7,                  %%mm7\n"
-        "punpcklbw      %%mm3,                  %%mm3\n"
-        "punpcklbw      %%mm0,                  %%mm0\n"
-        "punpcklbw      %%mm7,                  %%mm7\n"
-        "pand           %16,                    %%mm3\n"
-        "pand           %16,                    %%mm7\n" /* BLUE */
-        "psllw          $3,                     %%mm0\n" /* GREEN 4 */
-        "psrlw          $11,                    %%mm7\n"
-        "pand           %17,                    %%mm0\n"
-        "por            %%mm7,                  %%mm3\n"
-        "por            %%mm0,                  %%mm3\n"
-
-        "movq           %%mm4,                  %%mm5\n"
-
-        "punpcklwd      %%mm3,                  %%mm4\n"
-        "punpckhwd      %%mm3,                  %%mm5\n"
-
-        "movq           %%mm4,                  (%5)\n"
-        "movq           %%mm5,                  8(%5)\n"
-
-        "addl           $8,                     %6\n"
-        "addl           $8,                     %2\n"
-        "addl           $4,                     (%%esp)\n"
-        "addl           $4,                     %1\n"
-        "cmpl           %4,                     %6\n"
-        "leal           16(%3),                 %3\n"
-        "leal           16(%5),%5\n" /* row2+16 */
-
-        "jl             1b\n"
-        "addl           %4,     %2\n" /* lum += cols */
-        "addl           %8,     %3\n" /* row1+= mod */
-        "addl           %8,     %5\n" /* row2+= mod */
-        "movl           $0,     %6\n" /* x=0 */
-        "cmpl           %7,     %2\n"
-        "jl             1b\n"
-        "addl $4, %%esp\n"  /* get rid of the stack slot we reserved. */
-        "emms\n"
-        :
-        : "m" (cr), "r"(cb),"r"(lum),
-          "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
-          "m"(MMX_0080w),"m"(MMX_Ugrn565),"m"(MMX_Ublu5x5),
-          "m"(MMX_00FFw),"m"(MMX_Vgrn565),"m"(MMX_Vred5x5),
-          "m"(MMX_Ycoeff),"m"(MMX_red565),"m"(MMX_grn565)
-    );
-}
-
-/* *INDENT-ON* */
-
-#endif /* GCC3 i386 inline assembly */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/SDL_yuv_sw.c b/deps/SDL2/src/render/SDL_yuv_sw.c
deleted file mode 100644
index 14b825d..0000000
--- a/deps/SDL2/src/render/SDL_yuv_sw.c
+++ /dev/null
@@ -1,1400 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This is the software implementation of the YUV texture support */
-
-/* This code was derived from code carrying the following copyright notices:
-
- * Copyright (c) 1995 The Regents of the University of California.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice and the following
- * two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
- * Copyright (c) 1995 Erik Corry
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice and the following
- * two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
- * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- * BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
- * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
- * Portions of this software Copyright (c) 1995 Brown University.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement
- * is hereby granted, provided that the above copyright notice and the
- * following two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN
- * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
- * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
-
-#include "SDL_assert.h"
-#include "SDL_video.h"
-#include "SDL_cpuinfo.h"
-#include "SDL_yuv_sw_c.h"
-
-
-/* The colorspace conversion functions */
-
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
-extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
-                                    unsigned char *lum, unsigned char *cr,
-                                    unsigned char *cb, unsigned char *out,
-                                    int rows, int cols, int mod);
-extern void ColorRGBDitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
-                                    unsigned char *lum, unsigned char *cr,
-                                    unsigned char *cb, unsigned char *out,
-                                    int rows, int cols, int mod);
-#endif
-
-static void
-Color16DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned short *row1;
-    unsigned short *row2;
-    unsigned char *lum2;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    row1 = (unsigned short *) out;
-    row2 = row1 + cols + mod;
-    lum2 = lum + cols;
-
-    mod += cols + mod;
-
-    y = rows / 2;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            ++cr;
-            ++cb;
-
-            L = *lum++;
-            *row1++ = (unsigned short) (rgb_2_pix[L + cr_r] |
-                                        rgb_2_pix[L + crb_g] |
-                                        rgb_2_pix[L + cb_b]);
-
-            L = *lum++;
-            *row1++ = (unsigned short) (rgb_2_pix[L + cr_r] |
-                                        rgb_2_pix[L + crb_g] |
-                                        rgb_2_pix[L + cb_b]);
-
-
-            /* Now, do second row.  */
-
-            L = *lum2++;
-            *row2++ = (unsigned short) (rgb_2_pix[L + cr_r] |
-                                        rgb_2_pix[L + crb_g] |
-                                        rgb_2_pix[L + cb_b]);
-
-            L = *lum2++;
-            *row2++ = (unsigned short) (rgb_2_pix[L + cr_r] |
-                                        rgb_2_pix[L + crb_g] |
-                                        rgb_2_pix[L + cb_b]);
-        }
-
-        /*
-         * These values are at the start of the next line, (due
-         * to the ++'s above),but they need to be at the start
-         * of the line after that.
-         */
-        lum += cols;
-        lum2 += cols;
-        row1 += mod;
-        row2 += mod;
-    }
-}
-
-static void
-Color24DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int value;
-    unsigned char *row1;
-    unsigned char *row2;
-    unsigned char *lum2;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    row1 = out;
-    row2 = row1 + cols * 3 + mod * 3;
-    lum2 = lum + cols;
-
-    mod += cols + mod;
-    mod *= 3;
-
-    y = rows / 2;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            ++cr;
-            ++cb;
-
-            L = *lum++;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            *row1++ = (value) & 0xFF;
-            *row1++ = (value >> 8) & 0xFF;
-            *row1++ = (value >> 16) & 0xFF;
-
-            L = *lum++;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            *row1++ = (value) & 0xFF;
-            *row1++ = (value >> 8) & 0xFF;
-            *row1++ = (value >> 16) & 0xFF;
-
-
-            /* Now, do second row.  */
-
-            L = *lum2++;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            *row2++ = (value) & 0xFF;
-            *row2++ = (value >> 8) & 0xFF;
-            *row2++ = (value >> 16) & 0xFF;
-
-            L = *lum2++;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            *row2++ = (value) & 0xFF;
-            *row2++ = (value >> 8) & 0xFF;
-            *row2++ = (value >> 16) & 0xFF;
-        }
-
-        /*
-         * These values are at the start of the next line, (due
-         * to the ++'s above),but they need to be at the start
-         * of the line after that.
-         */
-        lum += cols;
-        lum2 += cols;
-        row1 += mod;
-        row2 += mod;
-    }
-}
-
-static void
-Color32DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int *row1;
-    unsigned int *row2;
-    unsigned char *lum2;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    row1 = (unsigned int *) out;
-    row2 = row1 + cols + mod;
-    lum2 = lum + cols;
-
-    mod += cols + mod;
-
-    y = rows / 2;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            ++cr;
-            ++cb;
-
-            L = *lum++;
-            *row1++ = (rgb_2_pix[L + cr_r] |
-                       rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
-            L = *lum++;
-            *row1++ = (rgb_2_pix[L + cr_r] |
-                       rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
-
-            /* Now, do second row.  */
-
-            L = *lum2++;
-            *row2++ = (rgb_2_pix[L + cr_r] |
-                       rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
-            L = *lum2++;
-            *row2++ = (rgb_2_pix[L + cr_r] |
-                       rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-        }
-
-        /*
-         * These values are at the start of the next line, (due
-         * to the ++'s above),but they need to be at the start
-         * of the line after that.
-         */
-        lum += cols;
-        lum2 += cols;
-        row1 += mod;
-        row2 += mod;
-    }
-}
-
-/*
- * In this function I make use of a nasty trick. The tables have the lower
- * 16 bits replicated in the upper 16. This means I can write ints and get
- * the horisontal doubling for free (almost).
- */
-static void
-Color16DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int *row1 = (unsigned int *) out;
-    const int next_row = cols + (mod / 2);
-    unsigned int *row2 = row1 + 2 * next_row;
-    unsigned char *lum2;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    lum2 = lum + cols;
-
-    mod = (next_row * 3) + (mod / 2);
-
-    y = rows / 2;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            ++cr;
-            ++cb;
-
-            L = *lum++;
-            row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
-                                        rgb_2_pix[L + crb_g] |
-                                        rgb_2_pix[L + cb_b]);
-            row1++;
-
-            L = *lum++;
-            row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
-                                        rgb_2_pix[L + crb_g] |
-                                        rgb_2_pix[L + cb_b]);
-            row1++;
-
-
-            /* Now, do second row. */
-
-            L = *lum2++;
-            row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
-                                        rgb_2_pix[L + crb_g] |
-                                        rgb_2_pix[L + cb_b]);
-            row2++;
-
-            L = *lum2++;
-            row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
-                                        rgb_2_pix[L + crb_g] |
-                                        rgb_2_pix[L + cb_b]);
-            row2++;
-        }
-
-        /*
-         * These values are at the start of the next line, (due
-         * to the ++'s above),but they need to be at the start
-         * of the line after that.
-         */
-        lum += cols;
-        lum2 += cols;
-        row1 += mod;
-        row2 += mod;
-    }
-}
-
-static void
-Color24DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int value;
-    unsigned char *row1 = out;
-    const int next_row = (cols * 2 + mod) * 3;
-    unsigned char *row2 = row1 + 2 * next_row;
-    unsigned char *lum2;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    lum2 = lum + cols;
-
-    mod = next_row * 3 + mod * 3;
-
-    y = rows / 2;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            ++cr;
-            ++cb;
-
-            L = *lum++;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
-                row1[next_row + 3 + 0] = (value) & 0xFF;
-            row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
-                row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
-            row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
-                row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
-            row1 += 2 * 3;
-
-            L = *lum++;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
-                row1[next_row + 3 + 0] = (value) & 0xFF;
-            row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
-                row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
-            row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
-                row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
-            row1 += 2 * 3;
-
-
-            /* Now, do second row. */
-
-            L = *lum2++;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
-                row2[next_row + 3 + 0] = (value) & 0xFF;
-            row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
-                row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
-            row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
-                row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
-            row2 += 2 * 3;
-
-            L = *lum2++;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
-                row2[next_row + 3 + 0] = (value) & 0xFF;
-            row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
-                row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
-            row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
-                row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
-            row2 += 2 * 3;
-        }
-
-        /*
-         * These values are at the start of the next line, (due
-         * to the ++'s above),but they need to be at the start
-         * of the line after that.
-         */
-        lum += cols;
-        lum2 += cols;
-        row1 += mod;
-        row2 += mod;
-    }
-}
-
-static void
-Color32DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int *row1 = (unsigned int *) out;
-    const int next_row = cols * 2 + mod;
-    unsigned int *row2 = row1 + 2 * next_row;
-    unsigned char *lum2;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    lum2 = lum + cols;
-
-    mod = (next_row * 3) + mod;
-
-    y = rows / 2;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            ++cr;
-            ++cb;
-
-            L = *lum++;
-            row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
-                (rgb_2_pix[L + cr_r] |
-                 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row1 += 2;
-
-            L = *lum++;
-            row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
-                (rgb_2_pix[L + cr_r] |
-                 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row1 += 2;
-
-
-            /* Now, do second row. */
-
-            L = *lum2++;
-            row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
-                (rgb_2_pix[L + cr_r] |
-                 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row2 += 2;
-
-            L = *lum2++;
-            row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
-                (rgb_2_pix[L + cr_r] |
-                 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row2 += 2;
-        }
-
-        /*
-         * These values are at the start of the next line, (due
-         * to the ++'s above),but they need to be at the start
-         * of the line after that.
-         */
-        lum += cols;
-        lum2 += cols;
-        row1 += mod;
-        row2 += mod;
-    }
-}
-
-static void
-Color16DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned short *row;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    row = (unsigned short *) out;
-
-    y = rows;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            cr += 4;
-            cb += 4;
-
-            L = *lum;
-            lum += 2;
-            *row++ = (unsigned short) (rgb_2_pix[L + cr_r] |
-                                       rgb_2_pix[L + crb_g] |
-                                       rgb_2_pix[L + cb_b]);
-
-            L = *lum;
-            lum += 2;
-            *row++ = (unsigned short) (rgb_2_pix[L + cr_r] |
-                                       rgb_2_pix[L + crb_g] |
-                                       rgb_2_pix[L + cb_b]);
-
-        }
-
-        row += mod;
-    }
-}
-
-static void
-Color24DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int value;
-    unsigned char *row;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    row = (unsigned char *) out;
-    mod *= 3;
-    y = rows;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            cr += 4;
-            cb += 4;
-
-            L = *lum;
-            lum += 2;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            *row++ = (value) & 0xFF;
-            *row++ = (value >> 8) & 0xFF;
-            *row++ = (value >> 16) & 0xFF;
-
-            L = *lum;
-            lum += 2;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            *row++ = (value) & 0xFF;
-            *row++ = (value >> 8) & 0xFF;
-            *row++ = (value >> 16) & 0xFF;
-
-        }
-        row += mod;
-    }
-}
-
-static void
-Color32DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int *row;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    row = (unsigned int *) out;
-    y = rows;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            cr += 4;
-            cb += 4;
-
-            L = *lum;
-            lum += 2;
-            *row++ = (rgb_2_pix[L + cr_r] |
-                      rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
-            L = *lum;
-            lum += 2;
-            *row++ = (rgb_2_pix[L + cr_r] |
-                      rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
-
-        }
-        row += mod;
-    }
-}
-
-/*
- * In this function I make use of a nasty trick. The tables have the lower
- * 16 bits replicated in the upper 16. This means I can write ints and get
- * the horisontal doubling for free (almost).
- */
-static void
-Color16DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int *row = (unsigned int *) out;
-    const int next_row = cols + (mod / 2);
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-
-    y = rows;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            cr += 4;
-            cb += 4;
-
-            L = *lum;
-            lum += 2;
-            row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
-                                      rgb_2_pix[L + crb_g] |
-                                      rgb_2_pix[L + cb_b]);
-            row++;
-
-            L = *lum;
-            lum += 2;
-            row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
-                                      rgb_2_pix[L + crb_g] |
-                                      rgb_2_pix[L + cb_b]);
-            row++;
-
-        }
-        row += next_row;
-    }
-}
-
-static void
-Color24DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int value;
-    unsigned char *row = out;
-    const int next_row = (cols * 2 + mod) * 3;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-    y = rows;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            cr += 4;
-            cb += 4;
-
-            L = *lum;
-            lum += 2;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row[0 + 0] = row[3 + 0] = row[next_row + 0] =
-                row[next_row + 3 + 0] = (value) & 0xFF;
-            row[0 + 1] = row[3 + 1] = row[next_row + 1] =
-                row[next_row + 3 + 1] = (value >> 8) & 0xFF;
-            row[0 + 2] = row[3 + 2] = row[next_row + 2] =
-                row[next_row + 3 + 2] = (value >> 16) & 0xFF;
-            row += 2 * 3;
-
-            L = *lum;
-            lum += 2;
-            value = (rgb_2_pix[L + cr_r] |
-                     rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row[0 + 0] = row[3 + 0] = row[next_row + 0] =
-                row[next_row + 3 + 0] = (value) & 0xFF;
-            row[0 + 1] = row[3 + 1] = row[next_row + 1] =
-                row[next_row + 3 + 1] = (value >> 8) & 0xFF;
-            row[0 + 2] = row[3 + 2] = row[next_row + 2] =
-                row[next_row + 3 + 2] = (value >> 16) & 0xFF;
-            row += 2 * 3;
-
-        }
-        row += next_row;
-    }
-}
-
-static void
-Color32DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod)
-{
-    unsigned int *row = (unsigned int *) out;
-    const int next_row = cols * 2 + mod;
-    int x, y;
-    int cr_r;
-    int crb_g;
-    int cb_b;
-    int cols_2 = cols / 2;
-    mod += mod;
-    y = rows;
-    while (y--) {
-        x = cols_2;
-        while (x--) {
-            register int L;
-
-            cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
-            crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
-                + colortab[*cb + 2 * 256];
-            cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
-            cr += 4;
-            cb += 4;
-
-            L = *lum;
-            lum += 2;
-            row[0] = row[1] = row[next_row] = row[next_row + 1] =
-                (rgb_2_pix[L + cr_r] |
-                 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row += 2;
-
-            L = *lum;
-            lum += 2;
-            row[0] = row[1] = row[next_row] = row[next_row + 1] =
-                (rgb_2_pix[L + cr_r] |
-                 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-            row += 2;
-
-
-        }
-
-        row += next_row;
-    }
-}
-
-/*
- * How many 1 bits are there in the Uint32.
- * Low performance, do not call often.
- */
-static int
-number_of_bits_set(Uint32 a)
-{
-    if (!a)
-        return 0;
-    if (a & 1)
-        return 1 + number_of_bits_set(a >> 1);
-    return (number_of_bits_set(a >> 1));
-}
-
-/*
- * How many 0 bits are there at least significant end of Uint32.
- * Low performance, do not call often.
- */
-static int
-free_bits_at_bottom(Uint32 a)
-{
-    /* assume char is 8 bits */
-    if (!a)
-        return sizeof(Uint32) * 8;
-    if (((Sint32) a) & 1l)
-        return 0;
-    return 1 + free_bits_at_bottom(a >> 1);
-}
-
-static int
-SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format)
-{
-    Uint32 *r_2_pix_alloc;
-    Uint32 *g_2_pix_alloc;
-    Uint32 *b_2_pix_alloc;
-    int i;
-    int bpp;
-    Uint32 Rmask, Gmask, Bmask, Amask;
-
-    if (!SDL_PixelFormatEnumToMasks
-        (target_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask) || bpp < 15) {
-        return SDL_SetError("Unsupported YUV destination format");
-    }
-
-    swdata->target_format = target_format;
-    r_2_pix_alloc = &swdata->rgb_2_pix[0 * 768];
-    g_2_pix_alloc = &swdata->rgb_2_pix[1 * 768];
-    b_2_pix_alloc = &swdata->rgb_2_pix[2 * 768];
-
-    /*
-     * Set up entries 0-255 in rgb-to-pixel value tables.
-     */
-    for (i = 0; i < 256; ++i) {
-        r_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Rmask));
-        r_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Rmask);
-        r_2_pix_alloc[i + 256] |= Amask;
-        g_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Gmask));
-        g_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Gmask);
-        g_2_pix_alloc[i + 256] |= Amask;
-        b_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Bmask));
-        b_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Bmask);
-        b_2_pix_alloc[i + 256] |= Amask;
-    }
-
-    /*
-     * If we have 16-bit output depth, then we double the value
-     * in the top word. This means that we can write out both
-     * pixels in the pixel doubling mode with one op. It is
-     * harmless in the normal case as storing a 32-bit value
-     * through a short pointer will lose the top bits anyway.
-     */
-    if (SDL_BYTESPERPIXEL(target_format) == 2) {
-        for (i = 0; i < 256; ++i) {
-            r_2_pix_alloc[i + 256] |= (r_2_pix_alloc[i + 256]) << 16;
-            g_2_pix_alloc[i + 256] |= (g_2_pix_alloc[i + 256]) << 16;
-            b_2_pix_alloc[i + 256] |= (b_2_pix_alloc[i + 256]) << 16;
-        }
-    }
-
-    /*
-     * Spread out the values we have to the rest of the array so that
-     * we do not need to check for overflow.
-     */
-    for (i = 0; i < 256; ++i) {
-        r_2_pix_alloc[i] = r_2_pix_alloc[256];
-        r_2_pix_alloc[i + 512] = r_2_pix_alloc[511];
-        g_2_pix_alloc[i] = g_2_pix_alloc[256];
-        g_2_pix_alloc[i + 512] = g_2_pix_alloc[511];
-        b_2_pix_alloc[i] = b_2_pix_alloc[256];
-        b_2_pix_alloc[i + 512] = b_2_pix_alloc[511];
-    }
-
-    /* You have chosen wisely... */
-    switch (swdata->format) {
-    case SDL_PIXELFORMAT_YV12:
-    case SDL_PIXELFORMAT_IYUV:
-        if (SDL_BYTESPERPIXEL(target_format) == 2) {
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
-            /* inline assembly functions */
-            if (SDL_HasMMX() && (Rmask == 0xF800) &&
-                (Gmask == 0x07E0) && (Bmask == 0x001F)
-                && (swdata->w & 15) == 0) {
-/* printf("Using MMX 16-bit 565 dither\n"); */
-                swdata->Display1X = Color565DitherYV12MMX1X;
-            } else {
-/* printf("Using C 16-bit dither\n"); */
-                swdata->Display1X = Color16DitherYV12Mod1X;
-            }
-#else
-            swdata->Display1X = Color16DitherYV12Mod1X;
-#endif
-            swdata->Display2X = Color16DitherYV12Mod2X;
-        }
-        if (SDL_BYTESPERPIXEL(target_format) == 3) {
-            swdata->Display1X = Color24DitherYV12Mod1X;
-            swdata->Display2X = Color24DitherYV12Mod2X;
-        }
-        if (SDL_BYTESPERPIXEL(target_format) == 4) {
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
-            /* inline assembly functions */
-            if (SDL_HasMMX() && (Rmask == 0x00FF0000) &&
-                (Gmask == 0x0000FF00) &&
-                (Bmask == 0x000000FF) && (swdata->w & 15) == 0) {
-/* printf("Using MMX 32-bit dither\n"); */
-                swdata->Display1X = ColorRGBDitherYV12MMX1X;
-            } else {
-/* printf("Using C 32-bit dither\n"); */
-                swdata->Display1X = Color32DitherYV12Mod1X;
-            }
-#else
-            swdata->Display1X = Color32DitherYV12Mod1X;
-#endif
-            swdata->Display2X = Color32DitherYV12Mod2X;
-        }
-        break;
-    case SDL_PIXELFORMAT_YUY2:
-    case SDL_PIXELFORMAT_UYVY:
-    case SDL_PIXELFORMAT_YVYU:
-        if (SDL_BYTESPERPIXEL(target_format) == 2) {
-            swdata->Display1X = Color16DitherYUY2Mod1X;
-            swdata->Display2X = Color16DitherYUY2Mod2X;
-        }
-        if (SDL_BYTESPERPIXEL(target_format) == 3) {
-            swdata->Display1X = Color24DitherYUY2Mod1X;
-            swdata->Display2X = Color24DitherYUY2Mod2X;
-        }
-        if (SDL_BYTESPERPIXEL(target_format) == 4) {
-            swdata->Display1X = Color32DitherYUY2Mod1X;
-            swdata->Display2X = Color32DitherYUY2Mod2X;
-        }
-        break;
-    default:
-        /* We should never get here (caught above) */
-        break;
-    }
-
-    SDL_FreeSurface(swdata->display);
-    swdata->display = NULL;
-    return 0;
-}
-
-SDL_SW_YUVTexture *
-SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
-{
-    SDL_SW_YUVTexture *swdata;
-    int *Cr_r_tab;
-    int *Cr_g_tab;
-    int *Cb_g_tab;
-    int *Cb_b_tab;
-    int i;
-    int CR, CB;
-
-    switch (format) {
-    case SDL_PIXELFORMAT_YV12:
-    case SDL_PIXELFORMAT_IYUV:
-    case SDL_PIXELFORMAT_YUY2:
-    case SDL_PIXELFORMAT_UYVY:
-    case SDL_PIXELFORMAT_YVYU:
-        break;
-    default:
-        SDL_SetError("Unsupported YUV format");
-        return NULL;
-    }
-
-    swdata = (SDL_SW_YUVTexture *) SDL_calloc(1, sizeof(*swdata));
-    if (!swdata) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    swdata->format = format;
-    swdata->target_format = SDL_PIXELFORMAT_UNKNOWN;
-    swdata->w = w;
-    swdata->h = h;
-    swdata->pixels = (Uint8 *) SDL_malloc(w * h * 2);
-    swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int));
-    swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32));
-    if (!swdata->pixels || !swdata->colortab || !swdata->rgb_2_pix) {
-        SDL_SW_DestroyYUVTexture(swdata);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    /* Generate the tables for the display surface */
-    Cr_r_tab = &swdata->colortab[0 * 256];
-    Cr_g_tab = &swdata->colortab[1 * 256];
-    Cb_g_tab = &swdata->colortab[2 * 256];
-    Cb_b_tab = &swdata->colortab[3 * 256];
-    for (i = 0; i < 256; i++) {
-        /* Gamma correction (luminescence table) and chroma correction
-           would be done here.  See the Berkeley mpeg_play sources.
-         */
-        CB = CR = (i - 128);
-        Cr_r_tab[i] = (int) ((0.419 / 0.299) * CR);
-        Cr_g_tab[i] = (int) (-(0.299 / 0.419) * CR);
-        Cb_g_tab[i] = (int) (-(0.114 / 0.331) * CB);
-        Cb_b_tab[i] = (int) ((0.587 / 0.331) * CB);
-    }
-
-    /* Find the pitch and offset values for the overlay */
-    switch (format) {
-    case SDL_PIXELFORMAT_YV12:
-    case SDL_PIXELFORMAT_IYUV:
-        swdata->pitches[0] = w;
-        swdata->pitches[1] = swdata->pitches[0] / 2;
-        swdata->pitches[2] = swdata->pitches[0] / 2;
-        swdata->planes[0] = swdata->pixels;
-        swdata->planes[1] = swdata->planes[0] + swdata->pitches[0] * h;
-        swdata->planes[2] = swdata->planes[1] + swdata->pitches[1] * h / 2;
-        break;
-    case SDL_PIXELFORMAT_YUY2:
-    case SDL_PIXELFORMAT_UYVY:
-    case SDL_PIXELFORMAT_YVYU:
-        swdata->pitches[0] = w * 2;
-        swdata->planes[0] = swdata->pixels;
-        break;
-    default:
-        SDL_assert(0 && "We should never get here (caught above)");
-        break;
-    }
-
-    /* We're all done.. */
-    return (swdata);
-}
-
-int
-SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels,
-                             int *pitch)
-{
-    *pixels = swdata->planes[0];
-    *pitch = swdata->pitches[0];
-    return 0;
-}
-
-int
-SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
-                        const void *pixels, int pitch)
-{
-    switch (swdata->format) {
-    case SDL_PIXELFORMAT_YV12:
-    case SDL_PIXELFORMAT_IYUV:
-        if (rect->x == 0 && rect->y == 0 &&
-            rect->w == swdata->w && rect->h == swdata->h) {
-                SDL_memcpy(swdata->pixels, pixels,
-                           (swdata->h * swdata->w) + (swdata->h * swdata->w) / 2);
-        } else {
-            Uint8 *src, *dst;
-            int row;
-            size_t length;
-
-            /* Copy the Y plane */
-            src = (Uint8 *) pixels;
-            dst = swdata->pixels + rect->y * swdata->w + rect->x;
-            length = rect->w;
-            for (row = 0; row < rect->h; ++row) {
-                SDL_memcpy(dst, src, length);
-                src += pitch;
-                dst += swdata->w;
-            }
-
-            /* Copy the next plane */
-            src = (Uint8 *) pixels + rect->h * pitch;
-            dst = swdata->pixels + swdata->h * swdata->w;
-            dst += rect->y/2 * swdata->w/2 + rect->x/2;
-            length = rect->w / 2;
-            for (row = 0; row < rect->h/2; ++row) {
-                SDL_memcpy(dst, src, length);
-                src += pitch/2;
-                dst += swdata->w/2;
-            }
-
-            /* Copy the next plane */
-            src = (Uint8 *) pixels + rect->h * pitch + (rect->h * pitch) / 4;
-            dst = swdata->pixels + swdata->h * swdata->w +
-                  (swdata->h * swdata->w) / 4;
-            dst += rect->y/2 * swdata->w/2 + rect->x/2;
-            length = rect->w / 2;
-            for (row = 0; row < rect->h/2; ++row) {
-                SDL_memcpy(dst, src, length);
-                src += pitch/2;
-                dst += swdata->w/2;
-            }
-        }
-        break;
-    case SDL_PIXELFORMAT_YUY2:
-    case SDL_PIXELFORMAT_UYVY:
-    case SDL_PIXELFORMAT_YVYU:
-        {
-            Uint8 *src, *dst;
-            int row;
-            size_t length;
-
-            src = (Uint8 *) pixels;
-            dst =
-                swdata->planes[0] + rect->y * swdata->pitches[0] +
-                rect->x * 2;
-            length = rect->w * 2;
-            for (row = 0; row < rect->h; ++row) {
-                SDL_memcpy(dst, src, length);
-                src += pitch;
-                dst += swdata->pitches[0];
-            }
-        }
-        break;
-    }
-    return 0;
-}
-
-int
-SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
-                              const Uint8 *Yplane, int Ypitch,
-                              const Uint8 *Uplane, int Upitch,
-                              const Uint8 *Vplane, int Vpitch)
-{
-    const Uint8 *src;
-    Uint8 *dst;
-    int row;
-    size_t length;
-
-    /* Copy the Y plane */
-    src = Yplane;
-    dst = swdata->pixels + rect->y * swdata->w + rect->x;
-    length = rect->w;
-    for (row = 0; row < rect->h; ++row) {
-        SDL_memcpy(dst, src, length);
-        src += Ypitch;
-        dst += swdata->w;
-    }
-
-    /* Copy the U plane */
-    src = Uplane;
-    if (swdata->format == SDL_PIXELFORMAT_IYUV) {
-        dst = swdata->pixels + swdata->h * swdata->w;
-    } else {
-        dst = swdata->pixels + swdata->h * swdata->w +
-              (swdata->h * swdata->w) / 4;
-    }
-    dst += rect->y/2 * swdata->w/2 + rect->x/2;
-    length = rect->w / 2;
-    for (row = 0; row < rect->h/2; ++row) {
-        SDL_memcpy(dst, src, length);
-        src += Upitch;
-        dst += swdata->w/2;
-    }
-
-    /* Copy the V plane */
-    src = Vplane;
-    if (swdata->format == SDL_PIXELFORMAT_YV12) {
-        dst = swdata->pixels + swdata->h * swdata->w;
-    } else {
-        dst = swdata->pixels + swdata->h * swdata->w +
-              (swdata->h * swdata->w) / 4;
-    }
-    dst += rect->y/2 * swdata->w/2 + rect->x/2;
-    length = rect->w / 2;
-    for (row = 0; row < rect->h/2; ++row) {
-        SDL_memcpy(dst, src, length);
-        src += Vpitch;
-        dst += swdata->w/2;
-    }
-    return 0;
-}
-
-int
-SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
-                      void **pixels, int *pitch)
-{
-    switch (swdata->format) {
-    case SDL_PIXELFORMAT_YV12:
-    case SDL_PIXELFORMAT_IYUV:
-        if (rect
-            && (rect->x != 0 || rect->y != 0 || rect->w != swdata->w
-                || rect->h != swdata->h)) {
-            return SDL_SetError
-                ("YV12 and IYUV textures only support full surface locks");
-        }
-        break;
-    }
-
-    if (rect) {
-        *pixels = swdata->planes[0] + rect->y * swdata->pitches[0] + rect->x * 2;
-    } else {
-        *pixels = swdata->planes[0];
-    }
-    *pitch = swdata->pitches[0];
-    return 0;
-}
-
-void
-SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata)
-{
-}
-
-int
-SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
-                    Uint32 target_format, int w, int h, void *pixels,
-                    int pitch)
-{
-    int stretch;
-    int scale_2x;
-    Uint8 *lum, *Cr, *Cb;
-    int mod;
-
-    /* Make sure we're set up to display in the desired format */
-    if (target_format != swdata->target_format) {
-        if (SDL_SW_SetupYUVDisplay(swdata, target_format) < 0) {
-            return -1;
-        }
-    }
-
-    stretch = 0;
-    scale_2x = 0;
-    if (srcrect->x || srcrect->y || srcrect->w < swdata->w
-        || srcrect->h < swdata->h) {
-        /* The source rectangle has been clipped.
-           Using a scratch surface is easier than adding clipped
-           source support to all the blitters, plus that would
-           slow them down in the general unclipped case.
-         */
-        stretch = 1;
-    } else if ((srcrect->w != w) || (srcrect->h != h)) {
-        if ((w == 2 * srcrect->w) && (h == 2 * srcrect->h)) {
-            scale_2x = 1;
-        } else {
-            stretch = 1;
-        }
-    }
-    if (stretch) {
-        int bpp;
-        Uint32 Rmask, Gmask, Bmask, Amask;
-
-        if (swdata->display) {
-            swdata->display->w = w;
-            swdata->display->h = h;
-            swdata->display->pixels = pixels;
-            swdata->display->pitch = pitch;
-        } else {
-            /* This must have succeeded in SDL_SW_SetupYUVDisplay() earlier */
-            SDL_PixelFormatEnumToMasks(target_format, &bpp, &Rmask, &Gmask,
-                                       &Bmask, &Amask);
-            swdata->display =
-                SDL_CreateRGBSurfaceFrom(pixels, w, h, bpp, pitch, Rmask,
-                                         Gmask, Bmask, Amask);
-            if (!swdata->display) {
-                return (-1);
-            }
-        }
-        if (!swdata->stretch) {
-            /* This must have succeeded in SDL_SW_SetupYUVDisplay() earlier */
-            SDL_PixelFormatEnumToMasks(target_format, &bpp, &Rmask, &Gmask,
-                                       &Bmask, &Amask);
-            swdata->stretch =
-                SDL_CreateRGBSurface(0, swdata->w, swdata->h, bpp, Rmask,
-                                     Gmask, Bmask, Amask);
-            if (!swdata->stretch) {
-                return (-1);
-            }
-        }
-        pixels = swdata->stretch->pixels;
-        pitch = swdata->stretch->pitch;
-    }
-    switch (swdata->format) {
-    case SDL_PIXELFORMAT_YV12:
-        lum = swdata->planes[0];
-        Cr = swdata->planes[1];
-        Cb = swdata->planes[2];
-        break;
-    case SDL_PIXELFORMAT_IYUV:
-        lum = swdata->planes[0];
-        Cr = swdata->planes[2];
-        Cb = swdata->planes[1];
-        break;
-    case SDL_PIXELFORMAT_YUY2:
-        lum = swdata->planes[0];
-        Cr = lum + 3;
-        Cb = lum + 1;
-        break;
-    case SDL_PIXELFORMAT_UYVY:
-        lum = swdata->planes[0] + 1;
-        Cr = lum + 1;
-        Cb = lum - 1;
-        break;
-    case SDL_PIXELFORMAT_YVYU:
-        lum = swdata->planes[0];
-        Cr = lum + 1;
-        Cb = lum + 3;
-        break;
-    default:
-        return SDL_SetError("Unsupported YUV format in copy");
-    }
-    mod = (pitch / SDL_BYTESPERPIXEL(target_format));
-
-    if (scale_2x) {
-        mod -= (swdata->w * 2);
-        swdata->Display2X(swdata->colortab, swdata->rgb_2_pix,
-                          lum, Cr, Cb, pixels, swdata->h, swdata->w, mod);
-    } else {
-        mod -= swdata->w;
-        swdata->Display1X(swdata->colortab, swdata->rgb_2_pix,
-                          lum, Cr, Cb, pixels, swdata->h, swdata->w, mod);
-    }
-    if (stretch) {
-        SDL_Rect rect = *srcrect;
-        SDL_SoftStretch(swdata->stretch, &rect, swdata->display, NULL);
-    }
-    return 0;
-}
-
-void
-SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata)
-{
-    if (swdata) {
-        SDL_free(swdata->pixels);
-        SDL_free(swdata->colortab);
-        SDL_free(swdata->rgb_2_pix);
-        SDL_FreeSurface(swdata->stretch);
-        SDL_FreeSurface(swdata->display);
-        SDL_free(swdata);
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/SDL_yuv_sw_c.h b/deps/SDL2/src/render/SDL_yuv_sw_c.h
deleted file mode 100644
index f128041..0000000
--- a/deps/SDL2/src/render/SDL_yuv_sw_c.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-
-/* This is the software implementation of the YUV texture support */
-
-struct SDL_SW_YUVTexture
-{
-    Uint32 format;
-    Uint32 target_format;
-    int w, h;
-    Uint8 *pixels;
-    int *colortab;
-    Uint32 *rgb_2_pix;
-    void (*Display1X) (int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod);
-    void (*Display2X) (int *colortab, Uint32 * rgb_2_pix,
-                       unsigned char *lum, unsigned char *cr,
-                       unsigned char *cb, unsigned char *out,
-                       int rows, int cols, int mod);
-
-    /* These are just so we don't have to allocate them separately */
-    Uint16 pitches[3];
-    Uint8 *planes[3];
-
-    /* This is a temporary surface in case we have to stretch copy */
-    SDL_Surface *stretch;
-    SDL_Surface *display;
-};
-
-typedef struct SDL_SW_YUVTexture SDL_SW_YUVTexture;
-
-SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h);
-int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels,
-                                 int *pitch);
-int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
-                            const void *pixels, int pitch);
-int SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
-                                  const Uint8 *Yplane, int Ypitch,
-                                  const Uint8 *Uplane, int Upitch,
-                                  const Uint8 *Vplane, int Vpitch);
-int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
-                          void **pixels, int *pitch);
-void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata);
-int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
-                        Uint32 target_format, int w, int h, void *pixels,
-                        int pitch);
-void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/direct3d/SDL_render_d3d.c b/deps/SDL2/src/render/direct3d/SDL_render_d3d.c
deleted file mode 100644
index a4c6027..0000000
--- a/deps/SDL2/src/render/direct3d/SDL_render_d3d.c
+++ /dev/null
@@ -1,1915 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_hints.h"
-#include "SDL_loadso.h"
-#include "SDL_syswm.h"
-#include "SDL_system.h"
-#include "../SDL_sysrender.h"
-#include "../../video/windows/SDL_windowsvideo.h"
-
-#if SDL_VIDEO_RENDER_D3D
-#define D3D_DEBUG_INFO
-#include <d3d9.h>
-#endif
-
-
-typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK;
-typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
-typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
-
-DEFINE_GUID(IID_ID3DXMatrixStack,
-0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85);
-
-#undef INTERFACE
-#define INTERFACE ID3DXMatrixStack
-
-DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown)
-{
-    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
-    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
-    STDMETHOD_(ULONG,Release)(THIS) PURE;
-    STDMETHOD(Pop)(THIS) PURE;
-    STDMETHOD(Push)(THIS) PURE;
-    STDMETHOD(LoadIdentity)(THIS) PURE;
-    STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
-    STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
-    STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE;
-    STDMETHOD(RotateAxis)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
-    STDMETHOD(RotateAxisLocal)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
-    STDMETHOD(RotateYawPitchRoll)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
-    STDMETHOD(RotateYawPitchRollLocal)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
-    STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
-    STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
-    STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE;
-    STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
-    STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE;
-};
-
-#undef INTERFACE
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define ID3DXMatrixStack_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
-#define ID3DXMatrixStack_AddRef(p)                        (p)->lpVtbl->AddRef(p)
-#define ID3DXMatrixStack_Release(p)                       (p)->lpVtbl->Release(p)
-#define ID3DXMatrixStack_Pop(p)                           (p)->lpVtbl->Pop(p)
-#define ID3DXMatrixStack_Push(p)                          (p)->lpVtbl->Push(p)
-#define ID3DXMatrixStack_LoadIdentity(p)                  (p)->lpVtbl->LoadIdentity(p)
-#define ID3DXMatrixStack_LoadMatrix(p,a)                  (p)->lpVtbl->LoadMatrix(p,a)
-#define ID3DXMatrixStack_MultMatrix(p,a)                  (p)->lpVtbl->MultMatrix(p,a)
-#define ID3DXMatrixStack_MultMatrixLocal(p,a)             (p)->lpVtbl->MultMatrixLocal(p,a)
-#define ID3DXMatrixStack_RotateAxis(p,a,b)                (p)->lpVtbl->RotateAxis(p,a,b)
-#define ID3DXMatrixStack_RotateAxisLocal(p,a,b)           (p)->lpVtbl->RotateAxisLocal(p,a,b)
-#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c)      (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c)
-#define ID3DXMatrixStack_RotateYawPitchRollLocal(p,a,b,c) (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c)
-#define ID3DXMatrixStack_Scale(p,a,b,c)                   (p)->lpVtbl->Scale(p,a,b,c)
-#define ID3DXMatrixStack_ScaleLocal(p,a,b,c)              (p)->lpVtbl->ScaleLocal(p,a,b,c)
-#define ID3DXMatrixStack_Translate(p,a,b,c)               (p)->lpVtbl->Translate(p,a,b,c)
-#define ID3DXMatrixStack_TranslateLocal(p,a,b,c)          (p)->lpVtbl->TranslateLocal(p,a,b,c)
-#define ID3DXMatrixStack_GetTop(p)                        (p)->lpVtbl->GetTop(p)
-#else
-#define ID3DXMatrixStack_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
-#define ID3DXMatrixStack_AddRef(p)                        (p)->AddRef()
-#define ID3DXMatrixStack_Release(p)                       (p)->Release()
-#define ID3DXMatrixStack_Pop(p)    (p)->Pop()
-#define ID3DXMatrixStack_Push(p)    (p)->Push()
-#define ID3DXMatrixStack_LoadIdentity(p)    (p)->LoadIdentity()
-#define ID3DXMatrixStack_LoadMatrix(p,a)    (p)->LoadMatrix(a)
-#define ID3DXMatrixStack_MultMatrix(p,a)    (p)->MultMatrix(a)
-#define ID3DXMatrixStack_MultMatrixLocal(p,a)    (p)->MultMatrixLocal(a)
-#define ID3DXMatrixStack_RotateAxis(p,a,b)    (p)->RotateAxis(a,b)
-#define ID3DXMatrixStack_RotateAxisLocal(p,a,b)    (p)->RotateAxisLocal(a,b)
-#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c)    (p)->RotateYawPitchRollLocal(a,b,c)
-#define ID3DXMatrixStack_Scale(p,a,b,c)    (p)->Scale(a,b,c)
-#define ID3DXMatrixStack_ScaleLocal(p,a,b,c)    (p)->ScaleLocal(a,b,c)
-#define ID3DXMatrixStack_Translate(p,a,b,c)    (p)->Translate(a,b,c)
-#define ID3DXMatrixStack_TranslateLocal(p,a,b,c)    (p)->TranslateLocal(a,b,c)
-#define ID3DXMatrixStack_GetTop(p)    (p)->GetTop()
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack);
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef ASSEMBLE_SHADER
-/**************************************************************************
- * ID3DXBuffer:
- * ------------
- * The buffer object is used by D3DX to return arbitrary size data.
- *
- * GetBufferPointer -
- *    Returns a pointer to the beginning of the buffer.
- *
- * GetBufferSize -
- *    Returns the size of the buffer, in bytes.
- **************************************************************************/
-
-typedef interface ID3DXBuffer ID3DXBuffer;
-typedef interface ID3DXBuffer *LPD3DXBUFFER;
-
-/* {8BA5FB08-5195-40e2-AC58-0D989C3A0102} */
-DEFINE_GUID(IID_ID3DXBuffer,
-0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
-
-#undef INTERFACE
-#define INTERFACE ID3DXBuffer
-
-typedef interface ID3DXBuffer {
-    const struct ID3DXBufferVtbl FAR* lpVtbl;
-} ID3DXBuffer;
-typedef const struct ID3DXBufferVtbl ID3DXBufferVtbl;
-const struct ID3DXBufferVtbl
-{
-    /* IUnknown */
-    STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
-    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
-    STDMETHOD_(ULONG, Release)(THIS) PURE;
-
-    /* ID3DXBuffer */
-    STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
-    STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
-};
-
-HRESULT WINAPI
-    D3DXAssembleShader(
-        LPCSTR                          pSrcData,
-        UINT                            SrcDataLen,
-        CONST LPVOID*                   pDefines,
-        LPVOID                          pInclude,
-        DWORD                           Flags,
-        LPD3DXBUFFER*                   ppShader,
-        LPD3DXBUFFER*                   ppErrorMsgs);
-
-static void PrintShaderData(LPDWORD shader_data, DWORD shader_size)
-{
-    OutputDebugStringA("const DWORD shader_data[] = {\n\t");
-    {
-        SDL_bool newline = SDL_FALSE;
-        unsigned i;
-        for (i = 0; i < shader_size / sizeof(DWORD); ++i) {
-            char dword[11];
-            if (i > 0) {
-                if ((i%6) == 0) {
-                    newline = SDL_TRUE;
-                }
-                if (newline) {
-                    OutputDebugStringA(",\n    ");
-                    newline = SDL_FALSE;
-                } else {
-                    OutputDebugStringA(", ");
-                }
-            }
-            SDL_snprintf(dword, sizeof(dword), "0x%8.8x", shader_data[i]);
-            OutputDebugStringA(dword);
-        }
-        OutputDebugStringA("\n};\n");
-    }
-}
-
-#endif /* ASSEMBLE_SHADER */
-
-
-/* Direct3D renderer implementation */
-
-static SDL_Renderer *D3D_CreateRenderer(SDL_Window * window, Uint32 flags);
-static void D3D_WindowEvent(SDL_Renderer * renderer,
-                            const SDL_WindowEvent *event);
-static int D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                             const SDL_Rect * rect, const void *pixels,
-                             int pitch);
-static int D3D_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
-                                const SDL_Rect * rect,
-                                const Uint8 *Yplane, int Ypitch,
-                                const Uint8 *Uplane, int Upitch,
-                                const Uint8 *Vplane, int Vpitch);
-static int D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                           const SDL_Rect * rect, void **pixels, int *pitch);
-static void D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
-static int D3D_UpdateViewport(SDL_Renderer * renderer);
-static int D3D_UpdateClipRect(SDL_Renderer * renderer);
-static int D3D_RenderClear(SDL_Renderer * renderer);
-static int D3D_RenderDrawPoints(SDL_Renderer * renderer,
-                                const SDL_FPoint * points, int count);
-static int D3D_RenderDrawLines(SDL_Renderer * renderer,
-                               const SDL_FPoint * points, int count);
-static int D3D_RenderFillRects(SDL_Renderer * renderer,
-                               const SDL_FRect * rects, int count);
-static int D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-                          const SDL_Rect * srcrect, const SDL_FRect * dstrect);
-static int D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-                          const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-                          const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip);
-static int D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                                Uint32 format, void * pixels, int pitch);
-static void D3D_RenderPresent(SDL_Renderer * renderer);
-static void D3D_DestroyTexture(SDL_Renderer * renderer,
-                               SDL_Texture * texture);
-static void D3D_DestroyRenderer(SDL_Renderer * renderer);
-
-
-SDL_RenderDriver D3D_RenderDriver = {
-    D3D_CreateRenderer,
-    {
-     "direct3d",
-     (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE),
-     1,
-     {SDL_PIXELFORMAT_ARGB8888},
-     0,
-     0}
-};
-
-typedef struct
-{
-    void* d3dDLL;
-    IDirect3D9 *d3d;
-    IDirect3DDevice9 *device;
-    UINT adapter;
-    D3DPRESENT_PARAMETERS pparams;
-    SDL_bool updateSize;
-    SDL_bool beginScene;
-    SDL_bool enableSeparateAlphaBlend;
-    D3DTEXTUREFILTERTYPE scaleMode[8];
-    IDirect3DSurface9 *defaultRenderTarget;
-    IDirect3DSurface9 *currentRenderTarget;
-    void* d3dxDLL;
-    ID3DXMatrixStack *matrixStack;
-    LPDIRECT3DPIXELSHADER9 ps_yuv;
-} D3D_RenderData;
-
-typedef struct
-{
-    IDirect3DTexture9 *texture;
-    D3DTEXTUREFILTERTYPE scaleMode;
-
-    /* YV12 texture support */
-    SDL_bool yuv;
-    IDirect3DTexture9 *utexture;
-    IDirect3DTexture9 *vtexture;
-    Uint8 *pixels;
-    int pitch;
-    SDL_Rect locked_rect;
-} D3D_TextureData;
-
-typedef struct
-{
-    float x, y, z;
-    DWORD color;
-    float u, v;
-} Vertex;
-
-static int
-D3D_SetError(const char *prefix, HRESULT result)
-{
-    const char *error;
-
-    switch (result) {
-    case D3DERR_WRONGTEXTUREFORMAT:
-        error = "WRONGTEXTUREFORMAT";
-        break;
-    case D3DERR_UNSUPPORTEDCOLOROPERATION:
-        error = "UNSUPPORTEDCOLOROPERATION";
-        break;
-    case D3DERR_UNSUPPORTEDCOLORARG:
-        error = "UNSUPPORTEDCOLORARG";
-        break;
-    case D3DERR_UNSUPPORTEDALPHAOPERATION:
-        error = "UNSUPPORTEDALPHAOPERATION";
-        break;
-    case D3DERR_UNSUPPORTEDALPHAARG:
-        error = "UNSUPPORTEDALPHAARG";
-        break;
-    case D3DERR_TOOMANYOPERATIONS:
-        error = "TOOMANYOPERATIONS";
-        break;
-    case D3DERR_CONFLICTINGTEXTUREFILTER:
-        error = "CONFLICTINGTEXTUREFILTER";
-        break;
-    case D3DERR_UNSUPPORTEDFACTORVALUE:
-        error = "UNSUPPORTEDFACTORVALUE";
-        break;
-    case D3DERR_CONFLICTINGRENDERSTATE:
-        error = "CONFLICTINGRENDERSTATE";
-        break;
-    case D3DERR_UNSUPPORTEDTEXTUREFILTER:
-        error = "UNSUPPORTEDTEXTUREFILTER";
-        break;
-    case D3DERR_CONFLICTINGTEXTUREPALETTE:
-        error = "CONFLICTINGTEXTUREPALETTE";
-        break;
-    case D3DERR_DRIVERINTERNALERROR:
-        error = "DRIVERINTERNALERROR";
-        break;
-    case D3DERR_NOTFOUND:
-        error = "NOTFOUND";
-        break;
-    case D3DERR_MOREDATA:
-        error = "MOREDATA";
-        break;
-    case D3DERR_DEVICELOST:
-        error = "DEVICELOST";
-        break;
-    case D3DERR_DEVICENOTRESET:
-        error = "DEVICENOTRESET";
-        break;
-    case D3DERR_NOTAVAILABLE:
-        error = "NOTAVAILABLE";
-        break;
-    case D3DERR_OUTOFVIDEOMEMORY:
-        error = "OUTOFVIDEOMEMORY";
-        break;
-    case D3DERR_INVALIDDEVICE:
-        error = "INVALIDDEVICE";
-        break;
-    case D3DERR_INVALIDCALL:
-        error = "INVALIDCALL";
-        break;
-    case D3DERR_DRIVERINVALIDCALL:
-        error = "DRIVERINVALIDCALL";
-        break;
-    case D3DERR_WASSTILLDRAWING:
-        error = "WASSTILLDRAWING";
-        break;
-    default:
-        error = "UNKNOWN";
-        break;
-    }
-    return SDL_SetError("%s: %s", prefix, error);
-}
-
-static D3DFORMAT
-PixelFormatToD3DFMT(Uint32 format)
-{
-    switch (format) {
-    case SDL_PIXELFORMAT_RGB565:
-        return D3DFMT_R5G6B5;
-    case SDL_PIXELFORMAT_RGB888:
-        return D3DFMT_X8R8G8B8;
-    case SDL_PIXELFORMAT_ARGB8888:
-        return D3DFMT_A8R8G8B8;
-    case SDL_PIXELFORMAT_YV12:
-    case SDL_PIXELFORMAT_IYUV:
-        return D3DFMT_L8;
-    default:
-        return D3DFMT_UNKNOWN;
-    }
-}
-
-static Uint32
-D3DFMTToPixelFormat(D3DFORMAT format)
-{
-    switch (format) {
-    case D3DFMT_R5G6B5:
-        return SDL_PIXELFORMAT_RGB565;
-    case D3DFMT_X8R8G8B8:
-        return SDL_PIXELFORMAT_RGB888;
-    case D3DFMT_A8R8G8B8:
-        return SDL_PIXELFORMAT_ARGB8888;
-    default:
-        return SDL_PIXELFORMAT_UNKNOWN;
-    }
-}
-
-static void
-D3D_InitRenderState(D3D_RenderData *data)
-{
-    D3DMATRIX matrix;
-
-    IDirect3DDevice9 *device = data->device;
-
-    IDirect3DDevice9_SetVertexShader(device, NULL);
-    IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1);
-    IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE);
-    IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE);
-    IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
-
-    /* Enable color modulation by diffuse color */
-    IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP,
-                                          D3DTOP_MODULATE);
-    IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1,
-                                          D3DTA_TEXTURE);
-    IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG2,
-                                          D3DTA_DIFFUSE);
-
-    /* Enable alpha modulation by diffuse alpha */
-    IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAOP,
-                                          D3DTOP_MODULATE);
-    IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1,
-                                          D3DTA_TEXTURE);
-    IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAARG2,
-                                          D3DTA_DIFFUSE);
-
-    /* Enable separate alpha blend function, if possible */
-    if (data->enableSeparateAlphaBlend) {
-        IDirect3DDevice9_SetRenderState(device, D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
-    }
-
-    /* Disable second texture stage, since we're done */
-    IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP,
-                                          D3DTOP_DISABLE);
-    IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_ALPHAOP,
-                                          D3DTOP_DISABLE);
-
-    /* Set an identity world and view matrix */
-    matrix.m[0][0] = 1.0f;
-    matrix.m[0][1] = 0.0f;
-    matrix.m[0][2] = 0.0f;
-    matrix.m[0][3] = 0.0f;
-    matrix.m[1][0] = 0.0f;
-    matrix.m[1][1] = 1.0f;
-    matrix.m[1][2] = 0.0f;
-    matrix.m[1][3] = 0.0f;
-    matrix.m[2][0] = 0.0f;
-    matrix.m[2][1] = 0.0f;
-    matrix.m[2][2] = 1.0f;
-    matrix.m[2][3] = 0.0f;
-    matrix.m[3][0] = 0.0f;
-    matrix.m[3][1] = 0.0f;
-    matrix.m[3][2] = 0.0f;
-    matrix.m[3][3] = 1.0f;
-    IDirect3DDevice9_SetTransform(device, D3DTS_WORLD, &matrix);
-    IDirect3DDevice9_SetTransform(device, D3DTS_VIEW, &matrix);
-
-    /* Reset our current scale mode */
-    SDL_memset(data->scaleMode, 0xFF, sizeof(data->scaleMode));
-
-    /* Start the render with beginScene */
-    data->beginScene = SDL_TRUE;
-}
-
-static int
-D3D_Reset(SDL_Renderer * renderer)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    HRESULT result;
-
-    /* Release the default render target before reset */
-    if (data->defaultRenderTarget) {
-        IDirect3DSurface9_Release(data->defaultRenderTarget);
-        data->defaultRenderTarget = NULL;
-    }
-
-    result = IDirect3DDevice9_Reset(data->device, &data->pparams);
-    if (FAILED(result)) {
-        if (result == D3DERR_DEVICELOST) {
-            /* Don't worry about it, we'll reset later... */
-            return 0;
-        } else {
-            return D3D_SetError("Reset()", result);
-        }
-    }
-
-    IDirect3DDevice9_GetRenderTarget(data->device, 0, &data->defaultRenderTarget);
-    D3D_InitRenderState(data);
-    D3D_UpdateViewport(renderer);
-    return 0;
-}
-
-static int
-D3D_ActivateRenderer(SDL_Renderer * renderer)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    HRESULT result;
-
-    if (data->updateSize) {
-        SDL_Window *window = renderer->window;
-        int w, h;
-
-        SDL_GetWindowSize(window, &w, &h);
-        data->pparams.BackBufferWidth = w;
-        data->pparams.BackBufferHeight = h;
-        if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) {
-            data->pparams.BackBufferFormat =
-                PixelFormatToD3DFMT(SDL_GetWindowPixelFormat(window));
-        } else {
-            data->pparams.BackBufferFormat = D3DFMT_UNKNOWN;
-        }
-        if (D3D_Reset(renderer) < 0) {
-            return -1;
-        }
-
-        data->updateSize = SDL_FALSE;
-    }
-    if (data->beginScene) {
-        result = IDirect3DDevice9_BeginScene(data->device);
-        if (result == D3DERR_DEVICELOST) {
-            if (D3D_Reset(renderer) < 0) {
-                return -1;
-            }
-            result = IDirect3DDevice9_BeginScene(data->device);
-        }
-        if (FAILED(result)) {
-            return D3D_SetError("BeginScene()", result);
-        }
-        data->beginScene = SDL_FALSE;
-    }
-    return 0;
-}
-
-SDL_Renderer *
-D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
-{
-    SDL_Renderer *renderer;
-    D3D_RenderData *data;
-    SDL_SysWMinfo windowinfo;
-    HRESULT result;
-    const char *hint;
-    D3DPRESENT_PARAMETERS pparams;
-    IDirect3DSwapChain9 *chain;
-    D3DCAPS9 caps;
-    DWORD device_flags;
-    Uint32 window_flags;
-    int w, h;
-    SDL_DisplayMode fullscreen_mode;
-    int d3dxVersion;
-    char d3dxDLLFile[50];
-    int displayIndex;
-
-    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
-    if (!renderer) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    data = (D3D_RenderData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        SDL_free(renderer);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    if( D3D_LoadDLL( &data->d3dDLL, &data->d3d ) ) {
-        for (d3dxVersion=50;d3dxVersion>0;d3dxVersion--) {
-            LPTSTR dllName;
-            SDL_snprintf(d3dxDLLFile, sizeof(d3dxDLLFile), "D3DX9_%02d.dll", d3dxVersion);
-            dllName = WIN_UTF8ToString(d3dxDLLFile);
-            data->d3dxDLL = (void *)LoadLibrary(dllName); /* not using SDL_LoadObject() as we want silently fail - no error message */
-            SDL_free(dllName);
-            if (data->d3dxDLL) {
-                HRESULT (WINAPI *D3DXCreateMatrixStack) (DWORD Flags, LPD3DXMATRIXSTACK*  ppStack);
-                D3DXCreateMatrixStack = (HRESULT (WINAPI *) (DWORD, LPD3DXMATRIXSTACK*)) SDL_LoadFunction(data->d3dxDLL, "D3DXCreateMatrixStack");
-                if (D3DXCreateMatrixStack) {
-                    D3DXCreateMatrixStack(0, &data->matrixStack);
-                    break;
-                }
-            }
-        }
-
-        if (!data->matrixStack) {
-            if (data->d3dxDLL) SDL_UnloadObject(data->d3dxDLL);
-        }
-    }
-
-    if (!data->d3d || !data->matrixStack) {
-        SDL_free(renderer);
-        SDL_free(data);
-        SDL_SetError("Unable to create Direct3D interface");
-        return NULL;
-    }
-
-    renderer->WindowEvent = D3D_WindowEvent;
-    renderer->CreateTexture = D3D_CreateTexture;
-    renderer->UpdateTexture = D3D_UpdateTexture;
-    renderer->UpdateTextureYUV = D3D_UpdateTextureYUV;
-    renderer->LockTexture = D3D_LockTexture;
-    renderer->UnlockTexture = D3D_UnlockTexture;
-    renderer->SetRenderTarget = D3D_SetRenderTarget;
-    renderer->UpdateViewport = D3D_UpdateViewport;
-    renderer->UpdateClipRect = D3D_UpdateClipRect;
-    renderer->RenderClear = D3D_RenderClear;
-    renderer->RenderDrawPoints = D3D_RenderDrawPoints;
-    renderer->RenderDrawLines = D3D_RenderDrawLines;
-    renderer->RenderFillRects = D3D_RenderFillRects;
-    renderer->RenderCopy = D3D_RenderCopy;
-    renderer->RenderCopyEx = D3D_RenderCopyEx;
-    renderer->RenderReadPixels = D3D_RenderReadPixels;
-    renderer->RenderPresent = D3D_RenderPresent;
-    renderer->DestroyTexture = D3D_DestroyTexture;
-    renderer->DestroyRenderer = D3D_DestroyRenderer;
-    renderer->info = D3D_RenderDriver.info;
-    renderer->driverdata = data;
-
-    renderer->info.flags = SDL_RENDERER_ACCELERATED;
-
-    SDL_VERSION(&windowinfo.version);
-    SDL_GetWindowWMInfo(window, &windowinfo);
-
-    window_flags = SDL_GetWindowFlags(window);
-    SDL_GetWindowSize(window, &w, &h);
-    SDL_GetWindowDisplayMode(window, &fullscreen_mode);
-
-    SDL_zero(pparams);
-    pparams.hDeviceWindow = windowinfo.info.win.window;
-    pparams.BackBufferWidth = w;
-    pparams.BackBufferHeight = h;
-    if (window_flags & SDL_WINDOW_FULLSCREEN) {
-        pparams.BackBufferFormat =
-            PixelFormatToD3DFMT(fullscreen_mode.format);
-    } else {
-        pparams.BackBufferFormat = D3DFMT_UNKNOWN;
-    }
-    pparams.BackBufferCount = 1;
-    pparams.SwapEffect = D3DSWAPEFFECT_DISCARD;
-
-    if (window_flags & SDL_WINDOW_FULLSCREEN) {
-        if ( ( window_flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) == SDL_WINDOW_FULLSCREEN_DESKTOP )  {
-            pparams.Windowed = TRUE;
-            pparams.FullScreen_RefreshRateInHz = 0;
-        } else {
-        pparams.Windowed = FALSE;
-        pparams.FullScreen_RefreshRateInHz =
-            fullscreen_mode.refresh_rate;
-        }
-    } else {
-        pparams.Windowed = TRUE;
-        pparams.FullScreen_RefreshRateInHz = 0;
-    }
-    if (flags & SDL_RENDERER_PRESENTVSYNC) {
-        pparams.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
-    } else {
-        pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
-    }
-
-    /* Get the adapter for the display that the window is on */
-    displayIndex = SDL_GetWindowDisplayIndex( window );
-    data->adapter = SDL_Direct3D9GetAdapterIndex( displayIndex );
-
-    IDirect3D9_GetDeviceCaps(data->d3d, data->adapter, D3DDEVTYPE_HAL, &caps);
-
-    device_flags = D3DCREATE_FPU_PRESERVE;
-    if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) {
-        device_flags |= D3DCREATE_HARDWARE_VERTEXPROCESSING;
-    } else {
-        device_flags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;
-    }
-
-    hint = SDL_GetHint(SDL_HINT_RENDER_DIRECT3D_THREADSAFE);
-    if (hint && SDL_atoi(hint)) {
-        device_flags |= D3DCREATE_MULTITHREADED;
-    }
-
-    result = IDirect3D9_CreateDevice(data->d3d, data->adapter,
-                                     D3DDEVTYPE_HAL,
-                                     pparams.hDeviceWindow,
-                                     device_flags,
-                                     &pparams, &data->device);
-    if (FAILED(result)) {
-        D3D_DestroyRenderer(renderer);
-        D3D_SetError("CreateDevice()", result);
-        return NULL;
-    }
-
-    /* Get presentation parameters to fill info */
-    result = IDirect3DDevice9_GetSwapChain(data->device, 0, &chain);
-    if (FAILED(result)) {
-        D3D_DestroyRenderer(renderer);
-        D3D_SetError("GetSwapChain()", result);
-        return NULL;
-    }
-    result = IDirect3DSwapChain9_GetPresentParameters(chain, &pparams);
-    if (FAILED(result)) {
-        IDirect3DSwapChain9_Release(chain);
-        D3D_DestroyRenderer(renderer);
-        D3D_SetError("GetPresentParameters()", result);
-        return NULL;
-    }
-    IDirect3DSwapChain9_Release(chain);
-    if (pparams.PresentationInterval == D3DPRESENT_INTERVAL_ONE) {
-        renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
-    }
-    data->pparams = pparams;
-
-    IDirect3DDevice9_GetDeviceCaps(data->device, &caps);
-    renderer->info.max_texture_width = caps.MaxTextureWidth;
-    renderer->info.max_texture_height = caps.MaxTextureHeight;
-    if (caps.NumSimultaneousRTs >= 2) {
-        renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
-    }
-
-    if (caps.PrimitiveMiscCaps & D3DPMISCCAPS_SEPARATEALPHABLEND) {
-        data->enableSeparateAlphaBlend = SDL_TRUE;
-    }
-
-    /* Store the default render target */
-    IDirect3DDevice9_GetRenderTarget(data->device, 0, &data->defaultRenderTarget );
-    data->currentRenderTarget = NULL;
-
-    /* Set up parameters for rendering */
-    D3D_InitRenderState(data);
-
-    if (caps.MaxSimultaneousTextures >= 3)
-    {
-#ifdef ASSEMBLE_SHADER
-        /* This shader was created by running the following HLSL through the fxc compiler
-           and then tuning the generated assembly.
-
-           fxc /T fx_4_0 /O3 /Gfa /Fc yuv.fxc yuv.fx
-
-           --- yuv.fx ---
-           Texture2D g_txY;
-           Texture2D g_txU;
-           Texture2D g_txV;
-
-           SamplerState samLinear
-           {
-               Filter = ANISOTROPIC;
-               AddressU = Clamp;
-               AddressV = Clamp;
-               MaxAnisotropy = 1;
-           };
-
-           struct VS_OUTPUT
-           {
-                float2 TextureUV  : TEXCOORD0;
-           };
-
-           struct PS_OUTPUT
-           {
-                float4 RGBAColor : SV_Target;
-           };
-
-           PS_OUTPUT YUV420( VS_OUTPUT In ) 
-           {
-               const float3 offset = {-0.0625, -0.5, -0.5};
-               const float3 Rcoeff = {1.164,  0.000,  1.596};
-               const float3 Gcoeff = {1.164, -0.391, -0.813};
-               const float3 Bcoeff = {1.164,  2.018,  0.000};
-
-               PS_OUTPUT Output;
-               float2 TextureUV = In.TextureUV;
-
-               float3 yuv;
-               yuv.x = g_txY.Sample( samLinear, TextureUV ).r;
-               yuv.y = g_txU.Sample( samLinear, TextureUV ).r;
-               yuv.z = g_txV.Sample( samLinear, TextureUV ).r;
-
-               yuv += offset;
-               Output.RGBAColor.r = dot(yuv, Rcoeff);
-               Output.RGBAColor.g = dot(yuv, Gcoeff);
-               Output.RGBAColor.b = dot(yuv, Bcoeff);
-               Output.RGBAColor.a = 1.0f;
-
-               return Output;
-           }
-
-           technique10 RenderYUV420
-           {
-               pass P0
-               {
-                    SetPixelShader( CompileShader( ps_4_0_level_9_0, YUV420() ) );
-               }
-           }
-        */
-        const char *shader_text =
-            "ps_2_0\n"
-            "def c0, -0.0625, -0.5, -0.5, 1\n"
-            "def c1, 1.16400003, 0, 1.59599996, 0\n"
-            "def c2, 1.16400003, -0.391000003, -0.813000023, 0\n"
-            "def c3, 1.16400003, 2.01799989, 0, 0\n"
-            "dcl t0.xy\n"
-            "dcl v0.xyzw\n"
-            "dcl_2d s0\n"
-            "dcl_2d s1\n"
-            "dcl_2d s2\n"
-            "texld r0, t0, s0\n"
-            "texld r1, t0, s1\n"
-            "texld r2, t0, s2\n"
-            "mov r0.y, r1.x\n"
-            "mov r0.z, r2.x\n"
-            "add r0.xyz, r0, c0\n"
-            "dp3 r1.x, r0, c1\n"
-            "dp3 r1.y, r0, c2\n"
-            "dp2add r1.z, r0, c3, c3.z\n"   /* Logically this is "dp3 r1.z, r0, c3" but the optimizer did its magic */
-            "mov r1.w, c0.w\n"
-            "mul r0, r1, v0\n"              /* Not in the HLSL, multiply by vertex color */
-            "mov oC0, r0\n"
-        ;
-        LPD3DXBUFFER pCode;
-        LPD3DXBUFFER pErrorMsgs;
-        LPDWORD shader_data = NULL;
-        DWORD   shader_size = 0;
-        result = D3DXAssembleShader(shader_text, SDL_strlen(shader_text), NULL, NULL, 0, &pCode, &pErrorMsgs);
-        if (!FAILED(result)) {
-            shader_data = (DWORD*)pCode->lpVtbl->GetBufferPointer(pCode);
-            shader_size = pCode->lpVtbl->GetBufferSize(pCode);
-            PrintShaderData(shader_data, shader_size);
-        } else {
-            const char *error = (const char *)pErrorMsgs->lpVtbl->GetBufferPointer(pErrorMsgs);
-            SDL_SetError("Couldn't assemble shader: %s", error);
-        }
-#else
-        const DWORD shader_data[] = {
-            0xffff0200, 0x05000051, 0xa00f0000, 0xbd800000, 0xbf000000, 0xbf000000,
-            0x3f800000, 0x05000051, 0xa00f0001, 0x3f94fdf4, 0x00000000, 0x3fcc49ba,
-            0x00000000, 0x05000051, 0xa00f0002, 0x3f94fdf4, 0xbec83127, 0xbf5020c5,
-            0x00000000, 0x05000051, 0xa00f0003, 0x3f94fdf4, 0x400126e9, 0x00000000,
-            0x00000000, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x80000000,
-            0x900f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000,
-            0xa00f0801, 0x0200001f, 0x90000000, 0xa00f0802, 0x03000042, 0x800f0000,
-            0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801,
-            0x03000042, 0x800f0002, 0xb0e40000, 0xa0e40802, 0x02000001, 0x80020000,
-            0x80000001, 0x02000001, 0x80040000, 0x80000002, 0x03000002, 0x80070000,
-            0x80e40000, 0xa0e40000, 0x03000008, 0x80010001, 0x80e40000, 0xa0e40001,
-            0x03000008, 0x80020001, 0x80e40000, 0xa0e40002, 0x0400005a, 0x80040001,
-            0x80e40000, 0xa0e40003, 0xa0aa0003, 0x02000001, 0x80080001, 0xa0ff0000,
-            0x03000005, 0x800f0000, 0x80e40001, 0x90e40000, 0x02000001, 0x800f0800,
-            0x80e40000, 0x0000ffff
-        };
-#endif
-        if (shader_data != NULL) {
-            result = IDirect3DDevice9_CreatePixelShader(data->device, shader_data, &data->ps_yuv);
-            if (!FAILED(result)) {
-                renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12;
-                renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV;
-            } else {
-                D3D_SetError("CreatePixelShader()", result);
-            }
-        }
-    }
-
-    return renderer;
-}
-
-static void
-D3D_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-
-    if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
-        data->updateSize = SDL_TRUE;
-    }
-}
-
-static D3DTEXTUREFILTERTYPE
-GetScaleQuality(void)
-{
-    const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
-
-    if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
-        return D3DTEXF_POINT;
-    } else /* if (*hint == '1' || SDL_strcasecmp(hint, "linear") == 0) */ {
-        return D3DTEXF_LINEAR;
-    }
-}
-
-static int
-D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata;
-    D3D_TextureData *data;
-    D3DPOOL pool;
-    DWORD usage;
-    HRESULT result;
-
-    data = (D3D_TextureData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        return SDL_OutOfMemory();
-    }
-    data->scaleMode = GetScaleQuality();
-
-    texture->driverdata = data;
-
-#ifdef USE_DYNAMIC_TEXTURE
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        pool = D3DPOOL_DEFAULT;
-        usage = D3DUSAGE_DYNAMIC;
-    } else
-#endif
-    if (texture->access == SDL_TEXTUREACCESS_TARGET) {
-        /* D3DPOOL_MANAGED does not work with D3DUSAGE_RENDERTARGET */
-        pool = D3DPOOL_DEFAULT;
-        usage = D3DUSAGE_RENDERTARGET;
-    } else {
-        pool = D3DPOOL_MANAGED;
-        usage = 0;
-    }
-
-    result =
-        IDirect3DDevice9_CreateTexture(renderdata->device, texture->w,
-                                       texture->h, 1, usage,
-                                       PixelFormatToD3DFMT(texture->format),
-                                       pool, &data->texture, NULL);
-    if (FAILED(result)) {
-        return D3D_SetError("CreateTexture()", result);
-    }
-
-    if (texture->format == SDL_PIXELFORMAT_YV12 ||
-        texture->format == SDL_PIXELFORMAT_IYUV) {
-        data->yuv = SDL_TRUE;
-
-        result =
-            IDirect3DDevice9_CreateTexture(renderdata->device, texture->w / 2,
-                                           texture->h / 2, 1, usage,
-                                           PixelFormatToD3DFMT(texture->format),
-                                           pool, &data->utexture, NULL);
-        if (FAILED(result)) {
-            return D3D_SetError("CreateTexture()", result);
-        }
-
-        result =
-            IDirect3DDevice9_CreateTexture(renderdata->device, texture->w / 2,
-                                           texture->h / 2, 1, usage,
-                                           PixelFormatToD3DFMT(texture->format),
-                                           pool, &data->vtexture, NULL);
-        if (FAILED(result)) {
-            return D3D_SetError("CreateTexture()", result);
-        }
-    }
-
-    return 0;
-}
-
-static int
-D3D_UpdateTextureInternal(IDirect3DTexture9 *texture, Uint32 format, SDL_bool full_texture, int x, int y, int w, int h, const void *pixels, int pitch)
-{
-    RECT d3drect;
-    D3DLOCKED_RECT locked;
-    const Uint8 *src;
-    Uint8 *dst;
-    int row, length;
-    HRESULT result;
-
-    if (full_texture) {
-        result = IDirect3DTexture9_LockRect(texture, 0, &locked, NULL, D3DLOCK_DISCARD);
-    } else {
-        d3drect.left = x;
-        d3drect.right = x + w;
-        d3drect.top = y;
-        d3drect.bottom = y + h;
-        result = IDirect3DTexture9_LockRect(texture, 0, &locked, &d3drect, 0);
-    }
-
-    if (FAILED(result)) {
-        return D3D_SetError("LockRect()", result);
-    }
-
-    src = (const Uint8 *)pixels;
-    dst = locked.pBits;
-    length = w * SDL_BYTESPERPIXEL(format);
-    if (length == pitch && length == locked.Pitch) {
-        SDL_memcpy(dst, src, length*h);
-    } else {
-        for (row = 0; row < h; ++row) {
-            SDL_memcpy(dst, src, length);
-            src += pitch;
-            dst += locked.Pitch;
-        }
-    }
-    IDirect3DTexture9_UnlockRect(texture, 0);
-
-    return 0;
-}
-
-static int
-D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                  const SDL_Rect * rect, const void *pixels, int pitch)
-{
-    D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
-    SDL_bool full_texture = SDL_FALSE;
-
-#ifdef USE_DYNAMIC_TEXTURE
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING &&
-        rect->x == 0 && rect->y == 0 &&
-        rect->w == texture->w && rect->h == texture->h) {
-        full_texture = SDL_TRUE;
-    }
-#endif
-
-    if (D3D_UpdateTextureInternal(data->texture, texture->format, full_texture, rect->x, rect->y, rect->w, rect->h, pixels, pitch) < 0) {
-        return -1;
-    }
-
-    if (data->yuv) {
-        /* Skip to the correct offset into the next texture */
-        pixels = (const void*)((const Uint8*)pixels + rect->h * pitch);
-
-        if (D3D_UpdateTextureInternal(texture->format == SDL_PIXELFORMAT_YV12 ? data->vtexture : data->utexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, pixels, pitch / 2) < 0) {
-            return -1;
-        }
-
-        /* Skip to the correct offset into the next texture */
-        pixels = (const void*)((const Uint8*)pixels + (rect->h * pitch)/4);
-        if (D3D_UpdateTextureInternal(texture->format == SDL_PIXELFORMAT_YV12 ? data->utexture : data->vtexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, pixels, pitch / 2) < 0) {
-            return -1;
-        }
-    }
-    return 0;
-}
-
-static int
-D3D_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
-                     const SDL_Rect * rect,
-                     const Uint8 *Yplane, int Ypitch,
-                     const Uint8 *Uplane, int Upitch,
-                     const Uint8 *Vplane, int Vpitch)
-{
-    D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
-    SDL_bool full_texture = SDL_FALSE;
-
-#ifdef USE_DYNAMIC_TEXTURE
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING &&
-        rect->x == 0 && rect->y == 0 &&
-        rect->w == texture->w && rect->h == texture->h) {
-            full_texture = SDL_TRUE;
-    }
-#endif
-
-    if (D3D_UpdateTextureInternal(data->texture, texture->format, full_texture, rect->x, rect->y, rect->w, rect->h, Yplane, Ypitch) < 0) {
-        return -1;
-    }
-    if (D3D_UpdateTextureInternal(data->utexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Uplane, Upitch) < 0) {
-        return -1;
-    }
-    if (D3D_UpdateTextureInternal(data->vtexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Vplane, Vpitch) < 0) {
-        return -1;
-    }
-    return 0;
-}
-
-static int
-D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                const SDL_Rect * rect, void **pixels, int *pitch)
-{
-    D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
-    RECT d3drect;
-    D3DLOCKED_RECT locked;
-    HRESULT result;
-
-    if (data->yuv) {
-        /* It's more efficient to upload directly... */
-        if (!data->pixels) {
-            data->pitch = texture->w;
-            data->pixels = (Uint8 *)SDL_malloc((texture->h * data->pitch * 3) / 2);
-            if (!data->pixels) {
-                return SDL_OutOfMemory();
-            }
-        }
-        data->locked_rect = *rect;
-        *pixels =
-            (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
-                      rect->x * SDL_BYTESPERPIXEL(texture->format));
-        *pitch = data->pitch;
-    } else {
-        d3drect.left = rect->x;
-        d3drect.right = rect->x + rect->w;
-        d3drect.top = rect->y;
-        d3drect.bottom = rect->y + rect->h;
-
-        result = IDirect3DTexture9_LockRect(data->texture, 0, &locked, &d3drect, 0);
-        if (FAILED(result)) {
-            return D3D_SetError("LockRect()", result);
-        }
-        *pixels = locked.pBits;
-        *pitch = locked.Pitch;
-    }
-    return 0;
-}
-
-static void
-D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
-
-    if (data->yuv) {
-        const SDL_Rect *rect = &data->locked_rect;
-        void *pixels =
-            (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
-                      rect->x * SDL_BYTESPERPIXEL(texture->format));
-        D3D_UpdateTexture(renderer, texture, rect, pixels, data->pitch);
-    } else {
-        IDirect3DTexture9_UnlockRect(data->texture, 0);
-    }
-}
-
-static int
-D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    D3D_TextureData *texturedata;
-    HRESULT result;
-
-    D3D_ActivateRenderer(renderer);
-
-    /* Release the previous render target if it wasn't the default one */
-    if (data->currentRenderTarget != NULL) {
-        IDirect3DSurface9_Release(data->currentRenderTarget);
-        data->currentRenderTarget = NULL;
-    }
-
-    if (texture == NULL) {
-        IDirect3DDevice9_SetRenderTarget(data->device, 0, data->defaultRenderTarget);
-        return 0;
-    }
-
-    texturedata = (D3D_TextureData *) texture->driverdata;
-    result = IDirect3DTexture9_GetSurfaceLevel(texturedata->texture, 0, &data->currentRenderTarget);
-    if(FAILED(result)) {
-        return D3D_SetError("GetSurfaceLevel()", result);
-    }
-    result = IDirect3DDevice9_SetRenderTarget(data->device, 0, data->currentRenderTarget);
-    if(FAILED(result)) {
-        return D3D_SetError("SetRenderTarget()", result);
-    }
-
-    return 0;
-}
-
-static int
-D3D_UpdateViewport(SDL_Renderer * renderer)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    D3DVIEWPORT9 viewport;
-    D3DMATRIX matrix;
-
-    /* Set the viewport */
-    viewport.X = renderer->viewport.x;
-    viewport.Y = renderer->viewport.y;
-    viewport.Width = renderer->viewport.w;
-    viewport.Height = renderer->viewport.h;
-    viewport.MinZ = 0.0f;
-    viewport.MaxZ = 1.0f;
-    IDirect3DDevice9_SetViewport(data->device, &viewport);
-
-    /* Set an orthographic projection matrix */
-    if (renderer->viewport.w && renderer->viewport.h) {
-        matrix.m[0][0] = 2.0f / renderer->viewport.w;
-        matrix.m[0][1] = 0.0f;
-        matrix.m[0][2] = 0.0f;
-        matrix.m[0][3] = 0.0f;
-        matrix.m[1][0] = 0.0f;
-        matrix.m[1][1] = -2.0f / renderer->viewport.h;
-        matrix.m[1][2] = 0.0f;
-        matrix.m[1][3] = 0.0f;
-        matrix.m[2][0] = 0.0f;
-        matrix.m[2][1] = 0.0f;
-        matrix.m[2][2] = 1.0f;
-        matrix.m[2][3] = 0.0f;
-        matrix.m[3][0] = -1.0f;
-        matrix.m[3][1] = 1.0f;
-        matrix.m[3][2] = 0.0f;
-        matrix.m[3][3] = 1.0f;
-        IDirect3DDevice9_SetTransform(data->device, D3DTS_PROJECTION, &matrix);
-    }
-
-    return 0;
-}
-
-static int
-D3D_UpdateClipRect(SDL_Renderer * renderer)
-{
-    const SDL_Rect *rect = &renderer->clip_rect;
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    RECT r;
-    HRESULT result;
-
-    if (!SDL_RectEmpty(rect)) {
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, TRUE);
-        r.left = rect->x;
-        r.top = rect->y;
-        r.right = rect->x + rect->w;
-        r.bottom = rect->y + rect->h;
-
-        result = IDirect3DDevice9_SetScissorRect(data->device, &r);
-        if (result != D3D_OK) {
-            D3D_SetError("SetScissor()", result);
-            return -1;
-        }
-    } else {
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, FALSE);
-    }
-    return 0;
-}
-
-static int
-D3D_RenderClear(SDL_Renderer * renderer)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    DWORD color;
-    HRESULT result;
-    int BackBufferWidth, BackBufferHeight;
-
-    if (D3D_ActivateRenderer(renderer) < 0) {
-        return -1;
-    }
-
-    color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
-
-    if (renderer->target) {
-        BackBufferWidth = renderer->target->w;
-        BackBufferHeight = renderer->target->h;
-    } else {
-        BackBufferWidth = data->pparams.BackBufferWidth;
-        BackBufferHeight = data->pparams.BackBufferHeight;
-    }
-
-    /* Don't reset the viewport if we don't have to! */
-    if (!renderer->viewport.x && !renderer->viewport.y &&
-        renderer->viewport.w == BackBufferWidth &&
-        renderer->viewport.h == BackBufferHeight) {
-        result = IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0);
-    } else {
-        D3DVIEWPORT9 viewport;
-
-        /* Clear is defined to clear the entire render target */
-        viewport.X = 0;
-        viewport.Y = 0;
-        viewport.Width = BackBufferWidth;
-        viewport.Height = BackBufferHeight;
-        viewport.MinZ = 0.0f;
-        viewport.MaxZ = 1.0f;
-        IDirect3DDevice9_SetViewport(data->device, &viewport);
-
-        result = IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0);
-
-        /* Reset the viewport */
-        viewport.X = renderer->viewport.x;
-        viewport.Y = renderer->viewport.y;
-        viewport.Width = renderer->viewport.w;
-        viewport.Height = renderer->viewport.h;
-        viewport.MinZ = 0.0f;
-        viewport.MaxZ = 1.0f;
-        IDirect3DDevice9_SetViewport(data->device, &viewport);
-    }
-
-    if (FAILED(result)) {
-        return D3D_SetError("Clear()", result);
-    }
-    return 0;
-}
-
-static void
-D3D_SetBlendMode(D3D_RenderData * data, int blendMode)
-{
-    switch (blendMode) {
-    case SDL_BLENDMODE_NONE:
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
-                                        FALSE);
-        break;
-    case SDL_BLENDMODE_BLEND:
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
-                                        TRUE);
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
-                                        D3DBLEND_SRCALPHA);
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND,
-                                        D3DBLEND_INVSRCALPHA);
-        if (data->enableSeparateAlphaBlend) {
-            IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLENDALPHA,
-                                            D3DBLEND_ONE);
-            IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLENDALPHA,
-                                            D3DBLEND_INVSRCALPHA);
-        }
-        break;
-    case SDL_BLENDMODE_ADD:
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
-                                        TRUE);
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
-                                        D3DBLEND_SRCALPHA);
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND,
-                                        D3DBLEND_ONE);
-        if (data->enableSeparateAlphaBlend) {
-            IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLENDALPHA,
-                                            D3DBLEND_ZERO);
-            IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLENDALPHA,
-                                            D3DBLEND_ONE);
-        }
-        break;
-    case SDL_BLENDMODE_MOD:
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
-                                        TRUE);
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
-                                        D3DBLEND_ZERO);
-        IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND,
-                                        D3DBLEND_SRCCOLOR);
-        if (data->enableSeparateAlphaBlend) {
-            IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLENDALPHA,
-                                            D3DBLEND_ZERO);
-            IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLENDALPHA,
-                                            D3DBLEND_ONE);
-        }
-        break;
-    }
-}
-
-static int
-D3D_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points,
-                     int count)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    DWORD color;
-    Vertex *vertices;
-    int i;
-    HRESULT result;
-
-    if (D3D_ActivateRenderer(renderer) < 0) {
-        return -1;
-    }
-
-    D3D_SetBlendMode(data, renderer->blendMode);
-
-    result =
-        IDirect3DDevice9_SetTexture(data->device, 0,
-                                    (IDirect3DBaseTexture9 *) 0);
-    if (FAILED(result)) {
-        return D3D_SetError("SetTexture()", result);
-    }
-
-    color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
-
-    vertices = SDL_stack_alloc(Vertex, count);
-    for (i = 0; i < count; ++i) {
-        vertices[i].x = points[i].x;
-        vertices[i].y = points[i].y;
-        vertices[i].z = 0.0f;
-        vertices[i].color = color;
-        vertices[i].u = 0.0f;
-        vertices[i].v = 0.0f;
-    }
-    result =
-        IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count,
-                                         vertices, sizeof(*vertices));
-    SDL_stack_free(vertices);
-    if (FAILED(result)) {
-        return D3D_SetError("DrawPrimitiveUP()", result);
-    }
-    return 0;
-}
-
-static int
-D3D_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points,
-                    int count)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    DWORD color;
-    Vertex *vertices;
-    int i;
-    HRESULT result;
-
-    if (D3D_ActivateRenderer(renderer) < 0) {
-        return -1;
-    }
-
-    D3D_SetBlendMode(data, renderer->blendMode);
-
-    result =
-        IDirect3DDevice9_SetTexture(data->device, 0,
-                                    (IDirect3DBaseTexture9 *) 0);
-    if (FAILED(result)) {
-        return D3D_SetError("SetTexture()", result);
-    }
-
-    color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
-
-    vertices = SDL_stack_alloc(Vertex, count);
-    for (i = 0; i < count; ++i) {
-        vertices[i].x = points[i].x;
-        vertices[i].y = points[i].y;
-        vertices[i].z = 0.0f;
-        vertices[i].color = color;
-        vertices[i].u = 0.0f;
-        vertices[i].v = 0.0f;
-    }
-    result =
-        IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, count-1,
-                                         vertices, sizeof(*vertices));
-
-    /* DirectX 9 has the same line rasterization semantics as GDI,
-       so we need to close the endpoint of the line */
-    if (count == 2 ||
-        points[0].x != points[count-1].x || points[0].y != points[count-1].y) {
-        vertices[0].x = points[count-1].x;
-        vertices[0].y = points[count-1].y;
-        result = IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, 1, vertices, sizeof(*vertices));
-    }
-
-    SDL_stack_free(vertices);
-    if (FAILED(result)) {
-        return D3D_SetError("DrawPrimitiveUP()", result);
-    }
-    return 0;
-}
-
-static int
-D3D_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects,
-                    int count)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    DWORD color;
-    int i;
-    float minx, miny, maxx, maxy;
-    Vertex vertices[4];
-    HRESULT result;
-
-    if (D3D_ActivateRenderer(renderer) < 0) {
-        return -1;
-    }
-
-    D3D_SetBlendMode(data, renderer->blendMode);
-
-    result =
-        IDirect3DDevice9_SetTexture(data->device, 0,
-                                    (IDirect3DBaseTexture9 *) 0);
-    if (FAILED(result)) {
-        return D3D_SetError("SetTexture()", result);
-    }
-
-    color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
-
-    for (i = 0; i < count; ++i) {
-        const SDL_FRect *rect = &rects[i];
-
-        minx = rect->x;
-        miny = rect->y;
-        maxx = rect->x + rect->w;
-        maxy = rect->y + rect->h;
-
-        vertices[0].x = minx;
-        vertices[0].y = miny;
-        vertices[0].z = 0.0f;
-        vertices[0].color = color;
-        vertices[0].u = 0.0f;
-        vertices[0].v = 0.0f;
-
-        vertices[1].x = maxx;
-        vertices[1].y = miny;
-        vertices[1].z = 0.0f;
-        vertices[1].color = color;
-        vertices[1].u = 0.0f;
-        vertices[1].v = 0.0f;
-
-        vertices[2].x = maxx;
-        vertices[2].y = maxy;
-        vertices[2].z = 0.0f;
-        vertices[2].color = color;
-        vertices[2].u = 0.0f;
-        vertices[2].v = 0.0f;
-
-        vertices[3].x = minx;
-        vertices[3].y = maxy;
-        vertices[3].z = 0.0f;
-        vertices[3].color = color;
-        vertices[3].u = 0.0f;
-        vertices[3].v = 0.0f;
-
-        result =
-            IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN,
-                                             2, vertices, sizeof(*vertices));
-        if (FAILED(result)) {
-            return D3D_SetError("DrawPrimitiveUP()", result);
-        }
-    }
-    return 0;
-}
-
-static void
-D3D_UpdateTextureScaleMode(D3D_RenderData *data, D3D_TextureData *texturedata, unsigned index)
-{
-    if (texturedata->scaleMode != data->scaleMode[index]) {
-        IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MINFILTER,
-                                         texturedata->scaleMode);
-        IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MAGFILTER,
-                                         texturedata->scaleMode);
-        data->scaleMode[index] = texturedata->scaleMode;
-    }
-}
-
-static int
-D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-               const SDL_Rect * srcrect, const SDL_FRect * dstrect)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata;
-    LPDIRECT3DPIXELSHADER9 shader = NULL;
-    float minx, miny, maxx, maxy;
-    float minu, maxu, minv, maxv;
-    DWORD color;
-    Vertex vertices[4];
-    HRESULT result;
-
-    if (D3D_ActivateRenderer(renderer) < 0) {
-        return -1;
-    }
-
-    minx = dstrect->x - 0.5f;
-    miny = dstrect->y - 0.5f;
-    maxx = dstrect->x + dstrect->w - 0.5f;
-    maxy = dstrect->y + dstrect->h - 0.5f;
-
-    minu = (float) srcrect->x / texture->w;
-    maxu = (float) (srcrect->x + srcrect->w) / texture->w;
-    minv = (float) srcrect->y / texture->h;
-    maxv = (float) (srcrect->y + srcrect->h) / texture->h;
-
-    color = D3DCOLOR_ARGB(texture->a, texture->r, texture->g, texture->b);
-
-    vertices[0].x = minx;
-    vertices[0].y = miny;
-    vertices[0].z = 0.0f;
-    vertices[0].color = color;
-    vertices[0].u = minu;
-    vertices[0].v = minv;
-
-    vertices[1].x = maxx;
-    vertices[1].y = miny;
-    vertices[1].z = 0.0f;
-    vertices[1].color = color;
-    vertices[1].u = maxu;
-    vertices[1].v = minv;
-
-    vertices[2].x = maxx;
-    vertices[2].y = maxy;
-    vertices[2].z = 0.0f;
-    vertices[2].color = color;
-    vertices[2].u = maxu;
-    vertices[2].v = maxv;
-
-    vertices[3].x = minx;
-    vertices[3].y = maxy;
-    vertices[3].z = 0.0f;
-    vertices[3].color = color;
-    vertices[3].u = minu;
-    vertices[3].v = maxv;
-
-    D3D_SetBlendMode(data, texture->blendMode);
-
-    D3D_UpdateTextureScaleMode(data, texturedata, 0);
-
-    result =
-        IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *)
-                                    texturedata->texture);
-    if (FAILED(result)) {
-        return D3D_SetError("SetTexture()", result);
-    }
-
-    if (texturedata->yuv) {
-        shader = data->ps_yuv;
-
-        D3D_UpdateTextureScaleMode(data, texturedata, 1);
-        D3D_UpdateTextureScaleMode(data, texturedata, 2);
-
-        result =
-            IDirect3DDevice9_SetTexture(data->device, 1, (IDirect3DBaseTexture9 *)
-                                        texturedata->utexture);
-        if (FAILED(result)) {
-            return D3D_SetError("SetTexture()", result);
-        }
-
-        result =
-            IDirect3DDevice9_SetTexture(data->device, 2, (IDirect3DBaseTexture9 *)
-                                        texturedata->vtexture);
-        if (FAILED(result)) {
-            return D3D_SetError("SetTexture()", result);
-        }
-    }
-
-    if (shader) {
-        result = IDirect3DDevice9_SetPixelShader(data->device, shader);
-        if (FAILED(result)) {
-            return D3D_SetError("SetShader()", result);
-        }
-    }
-    result =
-        IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
-                                         vertices, sizeof(*vertices));
-    if (FAILED(result)) {
-        return D3D_SetError("DrawPrimitiveUP()", result);
-    }
-    if (shader) {
-        result = IDirect3DDevice9_SetPixelShader(data->device, NULL);
-        if (FAILED(result)) {
-            return D3D_SetError("SetShader()", result);
-        }
-    }
-    return 0;
-}
-
-
-static int
-D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-               const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-               const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata;
-    LPDIRECT3DPIXELSHADER9 shader = NULL;
-    float minx, miny, maxx, maxy;
-    float minu, maxu, minv, maxv;
-    float centerx, centery;
-    DWORD color;
-    Vertex vertices[4];
-    HRESULT result;
-
-    if (D3D_ActivateRenderer(renderer) < 0) {
-        return -1;
-    }
-
-    centerx = center->x;
-    centery = center->y;
-
-    if (flip & SDL_FLIP_HORIZONTAL) {
-        minx = dstrect->w - centerx - 0.5f;
-        maxx = -centerx - 0.5f;
-    }
-    else {
-        minx = -centerx - 0.5f;
-        maxx = dstrect->w - centerx - 0.5f;
-    }
-
-    if (flip & SDL_FLIP_VERTICAL) {
-        miny = dstrect->h - centery - 0.5f;
-        maxy = -centery - 0.5f;
-    }
-    else {
-        miny = -centery - 0.5f;
-        maxy = dstrect->h - centery - 0.5f;
-    }
-
-    minu = (float) srcrect->x / texture->w;
-    maxu = (float) (srcrect->x + srcrect->w) / texture->w;
-    minv = (float) srcrect->y / texture->h;
-    maxv = (float) (srcrect->y + srcrect->h) / texture->h;
-
-    color = D3DCOLOR_ARGB(texture->a, texture->r, texture->g, texture->b);
-
-    vertices[0].x = minx;
-    vertices[0].y = miny;
-    vertices[0].z = 0.0f;
-    vertices[0].color = color;
-    vertices[0].u = minu;
-    vertices[0].v = minv;
-
-    vertices[1].x = maxx;
-    vertices[1].y = miny;
-    vertices[1].z = 0.0f;
-    vertices[1].color = color;
-    vertices[1].u = maxu;
-    vertices[1].v = minv;
-
-    vertices[2].x = maxx;
-    vertices[2].y = maxy;
-    vertices[2].z = 0.0f;
-    vertices[2].color = color;
-    vertices[2].u = maxu;
-    vertices[2].v = maxv;
-
-    vertices[3].x = minx;
-    vertices[3].y = maxy;
-    vertices[3].z = 0.0f;
-    vertices[3].color = color;
-    vertices[3].u = minu;
-    vertices[3].v = maxv;
-
-    D3D_SetBlendMode(data, texture->blendMode);
-
-    /* Rotate and translate */
-    ID3DXMatrixStack_Push(data->matrixStack);
-    ID3DXMatrixStack_LoadIdentity(data->matrixStack);
-    ID3DXMatrixStack_RotateYawPitchRoll(data->matrixStack, 0.0, 0.0, (float)(M_PI * (float) angle / 180.0f));
-    ID3DXMatrixStack_Translate(data->matrixStack, (float)dstrect->x + centerx, (float)dstrect->y + centery, (float)0.0);
-    IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)ID3DXMatrixStack_GetTop(data->matrixStack));
-
-    D3D_UpdateTextureScaleMode(data, texturedata, 0);
-
-    result =
-        IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *)
-                                    texturedata->texture);
-    if (FAILED(result)) {
-        return D3D_SetError("SetTexture()", result);
-    }
-
-    if (texturedata->yuv) {
-        shader = data->ps_yuv;
-
-        D3D_UpdateTextureScaleMode(data, texturedata, 1);
-        D3D_UpdateTextureScaleMode(data, texturedata, 2);
-
-        result =
-            IDirect3DDevice9_SetTexture(data->device, 1, (IDirect3DBaseTexture9 *)
-                                        texturedata->utexture);
-        if (FAILED(result)) {
-            return D3D_SetError("SetTexture()", result);
-        }
-
-        result =
-            IDirect3DDevice9_SetTexture(data->device, 2, (IDirect3DBaseTexture9 *)
-                                        texturedata->vtexture);
-        if (FAILED(result)) {
-            return D3D_SetError("SetTexture()", result);
-        }
-    }
-
-    if (shader) {
-        result = IDirect3DDevice9_SetPixelShader(data->device, shader);
-        if (FAILED(result)) {
-            return D3D_SetError("SetShader()", result);
-        }
-    }
-    result =
-        IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
-                                         vertices, sizeof(*vertices));
-    if (FAILED(result)) {
-        return D3D_SetError("DrawPrimitiveUP()", result);
-    }
-    if (shader) {
-        result = IDirect3DDevice9_SetPixelShader(data->device, NULL);
-        if (FAILED(result)) {
-            return D3D_SetError("SetShader()", result);
-        }
-    }
-    ID3DXMatrixStack_Pop(data->matrixStack);
-    ID3DXMatrixStack_Push(data->matrixStack);
-    ID3DXMatrixStack_LoadIdentity(data->matrixStack);
-    IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)ID3DXMatrixStack_GetTop(data->matrixStack));
-    ID3DXMatrixStack_Pop(data->matrixStack);
-    return 0;
-}
-
-static int
-D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                     Uint32 format, void * pixels, int pitch)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    D3DSURFACE_DESC desc;
-    LPDIRECT3DSURFACE9 backBuffer;
-    LPDIRECT3DSURFACE9 surface;
-    RECT d3drect;
-    D3DLOCKED_RECT locked;
-    HRESULT result;
-
-    result = IDirect3DDevice9_GetBackBuffer(data->device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backBuffer);
-    if (FAILED(result)) {
-        return D3D_SetError("GetBackBuffer()", result);
-    }
-
-    result = IDirect3DSurface9_GetDesc(backBuffer, &desc);
-    if (FAILED(result)) {
-        IDirect3DSurface9_Release(backBuffer);
-        return D3D_SetError("GetDesc()", result);
-    }
-
-    result = IDirect3DDevice9_CreateOffscreenPlainSurface(data->device, desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &surface, NULL);
-    if (FAILED(result)) {
-        IDirect3DSurface9_Release(backBuffer);
-        return D3D_SetError("CreateOffscreenPlainSurface()", result);
-    }
-
-    result = IDirect3DDevice9_GetRenderTargetData(data->device, backBuffer, surface);
-    if (FAILED(result)) {
-        IDirect3DSurface9_Release(surface);
-        IDirect3DSurface9_Release(backBuffer);
-        return D3D_SetError("GetRenderTargetData()", result);
-    }
-
-    d3drect.left = rect->x;
-    d3drect.right = rect->x + rect->w;
-    d3drect.top = rect->y;
-    d3drect.bottom = rect->y + rect->h;
-
-    result = IDirect3DSurface9_LockRect(surface, &locked, &d3drect, D3DLOCK_READONLY);
-    if (FAILED(result)) {
-        IDirect3DSurface9_Release(surface);
-        IDirect3DSurface9_Release(backBuffer);
-        return D3D_SetError("LockRect()", result);
-    }
-
-    SDL_ConvertPixels(rect->w, rect->h,
-                      D3DFMTToPixelFormat(desc.Format), locked.pBits, locked.Pitch,
-                      format, pixels, pitch);
-
-    IDirect3DSurface9_UnlockRect(surface);
-
-    IDirect3DSurface9_Release(surface);
-    IDirect3DSurface9_Release(backBuffer);
-
-    return 0;
-}
-
-static void
-D3D_RenderPresent(SDL_Renderer * renderer)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    HRESULT result;
-
-    if (!data->beginScene) {
-        IDirect3DDevice9_EndScene(data->device);
-        data->beginScene = SDL_TRUE;
-    }
-
-    result = IDirect3DDevice9_TestCooperativeLevel(data->device);
-    if (result == D3DERR_DEVICELOST) {
-        /* We'll reset later */
-        return;
-    }
-    if (result == D3DERR_DEVICENOTRESET) {
-        D3D_Reset(renderer);
-    }
-    result = IDirect3DDevice9_Present(data->device, NULL, NULL, NULL, NULL);
-    if (FAILED(result)) {
-        D3D_SetError("Present()", result);
-    }
-}
-
-static void
-D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
-
-    if (!data) {
-        return;
-    }
-    if (data->texture) {
-        IDirect3DTexture9_Release(data->texture);
-    }
-    if (data->utexture) {
-        IDirect3DTexture9_Release(data->utexture);
-    }
-    if (data->vtexture) {
-        IDirect3DTexture9_Release(data->vtexture);
-    }
-    SDL_free(data->pixels);
-    SDL_free(data);
-    texture->driverdata = NULL;
-}
-
-static void
-D3D_DestroyRenderer(SDL_Renderer * renderer)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-
-    if (data) {
-        /* Release the render target */
-        if (data->defaultRenderTarget) {
-            IDirect3DSurface9_Release(data->defaultRenderTarget);
-            data->defaultRenderTarget = NULL;
-        }
-        if (data->currentRenderTarget != NULL) {
-            IDirect3DSurface9_Release(data->currentRenderTarget);
-            data->currentRenderTarget = NULL;
-        }
-        if (data->ps_yuv) {
-            IDirect3DPixelShader9_Release(data->ps_yuv);
-        }
-        if (data->device) {
-            IDirect3DDevice9_Release(data->device);
-        }
-        if (data->d3d) {
-            IDirect3D9_Release(data->d3d);
-            ID3DXMatrixStack_Release(data->matrixStack);
-            SDL_UnloadObject(data->d3dDLL);
-        }
-        SDL_free(data);
-    }
-    SDL_free(renderer);
-}
-
-IDirect3DDevice9 *
-SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
-{
-    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
-    IDirect3DDevice9 *device;
-
-    // Make sure that this is a D3D renderer
-    if (renderer->DestroyRenderer != D3D_DestroyRenderer) {
-        SDL_SetError("Renderer is not a D3D renderer");
-        return NULL;
-    }
-
-    device = data->device;
-    if (device) {
-        IDirect3DDevice9_AddRef( device );
-    }
-    return device;
-}
-
-#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/mmx.h b/deps/SDL2/src/render/mmx.h
deleted file mode 100644
index 3bd00ac..0000000
--- a/deps/SDL2/src/render/mmx.h
+++ /dev/null
@@ -1,642 +0,0 @@
-/*	mmx.h
-
-	MultiMedia eXtensions GCC interface library for IA32.
-
-	To use this library, simply include this header file
-	and compile with GCC.  You MUST have inlining enabled
-	in order for mmx_ok() to work; this can be done by
-	simply using -O on the GCC command line.
-
-	Compiling with -DMMX_TRACE will cause detailed trace
-	output to be sent to stderr for each mmx operation.
-	This adds lots of code, and obviously slows execution to
-	a crawl, but can be very useful for debugging.
-
-	THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY
-	EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
-	LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-	AND FITNESS FOR ANY PARTICULAR PURPOSE.
-
-	1997-99 by H. Dietz and R. Fisher
-
- Notes:
-	It appears that the latest gas has the pand problem fixed, therefore
-	  I'll undefine BROKEN_PAND by default.
-*/
-
-#ifndef _MMX_H
-#define _MMX_H
-
-
-/*	Warning:  at this writing, the version of GAS packaged
-	with most Linux distributions does not handle the
-	parallel AND operation mnemonic correctly.  If the
-	symbol BROKEN_PAND is defined, a slower alternative
-	coding will be used.  If execution of mmxtest results
-	in an illegal instruction fault, define this symbol.
-*/
-#undef	BROKEN_PAND
-
-
-/*	The type of an value that fits in an MMX register
-	(note that long long constant values MUST be suffixed
-	 by LL and unsigned long long values by ULL, lest
-	 they be truncated by the compiler)
-*/
-typedef union
-{
-    long long q;                /* Quadword (64-bit) value */
-    unsigned long long uq;      /* Unsigned Quadword */
-    int d[2];                   /* 2 Doubleword (32-bit) values */
-    unsigned int ud[2];         /* 2 Unsigned Doubleword */
-    short w[4];                 /* 4 Word (16-bit) values */
-    unsigned short uw[4];       /* 4 Unsigned Word */
-    char b[8];                  /* 8 Byte (8-bit) values */
-    unsigned char ub[8];        /* 8 Unsigned Byte */
-    float s[2];                 /* Single-precision (32-bit) value */
-} __attribute__ ((aligned(8))) mmx_t;   /* On an 8-byte (64-bit) boundary */
-
-
-#if 0
-/*	Function to test if multimedia instructions are supported...
-*/
-inline extern int
-mm_support(void)
-{
-    /* Returns 1 if MMX instructions are supported,
-       3 if Cyrix MMX and Extended MMX instructions are supported
-       5 if AMD MMX and 3DNow! instructions are supported
-       0 if hardware does not support any of these
-     */
-    register int rval = 0;
-
-    __asm__ __volatile__(
-                            /* See if CPUID instruction is supported ... */
-                            /* ... Get copies of EFLAGS into eax and ecx */
-                            "pushf\n\t"
-                            "popl %%eax\n\t" "movl %%eax, %%ecx\n\t"
-                            /* ... Toggle the ID bit in one copy and store */
-                            /*     to the EFLAGS reg */
-                            "xorl $0x200000, %%eax\n\t"
-                            "push %%eax\n\t" "popf\n\t"
-                            /* ... Get the (hopefully modified) EFLAGS */
-                            "pushf\n\t" "popl %%eax\n\t"
-                            /* ... Compare and test result */
-                            "xorl %%eax, %%ecx\n\t" "testl $0x200000, %%ecx\n\t" "jz NotSupported1\n\t" /* CPUID not supported */
-                            /* Get standard CPUID information, and
-                               go to a specific vendor section */
-                            "movl $0, %%eax\n\t" "cpuid\n\t"
-                            /* Check for Intel */
-                            "cmpl $0x756e6547, %%ebx\n\t"
-                            "jne TryAMD\n\t"
-                            "cmpl $0x49656e69, %%edx\n\t"
-                            "jne TryAMD\n\t"
-                            "cmpl $0x6c65746e, %%ecx\n"
-                            "jne TryAMD\n\t" "jmp Intel\n\t"
-                            /* Check for AMD */
-                            "\nTryAMD:\n\t"
-                            "cmpl $0x68747541, %%ebx\n\t"
-                            "jne TryCyrix\n\t"
-                            "cmpl $0x69746e65, %%edx\n\t"
-                            "jne TryCyrix\n\t"
-                            "cmpl $0x444d4163, %%ecx\n"
-                            "jne TryCyrix\n\t" "jmp AMD\n\t"
-                            /* Check for Cyrix */
-                            "\nTryCyrix:\n\t"
-                            "cmpl $0x69727943, %%ebx\n\t"
-                            "jne NotSupported2\n\t"
-                            "cmpl $0x736e4978, %%edx\n\t"
-                            "jne NotSupported3\n\t"
-                            "cmpl $0x64616574, %%ecx\n\t"
-                            "jne NotSupported4\n\t"
-                            /* Drop through to Cyrix... */
-                            /* Cyrix Section */
-                            /* See if extended CPUID level 80000001 is supported */
-                            /* The value of CPUID/80000001 for the 6x86MX is undefined
-                               according to the Cyrix CPU Detection Guide (Preliminary
-                               Rev. 1.01 table 1), so we'll check the value of eax for
-                               CPUID/0 to see if standard CPUID level 2 is supported.
-                               According to the table, the only CPU which supports level
-                               2 is also the only one which supports extended CPUID levels.
-                             */
-                            "cmpl $0x2, %%eax\n\t" "jne MMXtest\n\t"    /* Use standard CPUID instead */
-                            /* Extended CPUID supported (in theory), so get extended
-                               features */
-                            "movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%eax\n\t"    /* Test for MMX */
-                            "jz NotSupported5\n\t"      /* MMX not supported */
-                            "testl $0x01000000, %%eax\n\t"      /* Test for Ext'd MMX */
-                            "jnz EMMXSupported\n\t" "movl $1, %0:\n\n\t"        /* MMX Supported */
-                            "jmp Return\n\n" "EMMXSupported:\n\t" "movl $3, %0:\n\n\t"  /* EMMX and MMX Supported */
-                            "jmp Return\n\t"
-                            /* AMD Section */
-                            "AMD:\n\t"
-                            /* See if extended CPUID is supported */
-                            "movl $0x80000000, %%eax\n\t" "cpuid\n\t" "cmpl $0x80000000, %%eax\n\t" "jl MMXtest\n\t"    /* Use standard CPUID instead */
-                            /* Extended CPUID supported, so get extended features */
-                            "movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t"    /* Test for MMX */
-                            "jz NotSupported6\n\t"      /* MMX not supported */
-                            "testl $0x80000000, %%edx\n\t"      /* Test for 3DNow! */
-                            "jnz ThreeDNowSupported\n\t" "movl $1, %0:\n\n\t"   /* MMX Supported */
-                            "jmp Return\n\n" "ThreeDNowSupported:\n\t" "movl $5, %0:\n\n\t"     /* 3DNow! and MMX Supported */
-                            "jmp Return\n\t"
-                            /* Intel Section */
-                            "Intel:\n\t"
-                            /* Check for MMX */
-                            "MMXtest:\n\t" "movl $1, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t"      /* Test for MMX */
-                            "jz NotSupported7\n\t"      /* MMX Not supported */
-                            "movl $1, %0:\n\n\t"        /* MMX Supported */
-                            "jmp Return\n\t"
-                            /* Nothing supported */
-                            "\nNotSupported1:\n\t" "#movl $101, %0:\n\n\t" "\nNotSupported2:\n\t" "#movl $102, %0:\n\n\t" "\nNotSupported3:\n\t" "#movl $103, %0:\n\n\t" "\nNotSupported4:\n\t" "#movl $104, %0:\n\n\t" "\nNotSupported5:\n\t" "#movl $105, %0:\n\n\t" "\nNotSupported6:\n\t" "#movl $106, %0:\n\n\t" "\nNotSupported7:\n\t" "#movl $107, %0:\n\n\t" "movl $0, %0:\n\n\t" "Return:\n\t":"=a"(rval):     /* no input */
-                            :"eax", "ebx", "ecx", "edx");
-
-    /* Return */
-    return (rval);
-}
-
-/*	Function to test if mmx instructions are supported...
-*/
-inline extern int
-mmx_ok(void)
-{
-    /* Returns 1 if MMX instructions are supported, 0 otherwise */
-    return (mm_support() & 0x1);
-}
-#endif
-
-/*	Helper functions for the instruction macros that follow...
-	(note that memory-to-register, m2r, instructions are nearly
-	 as efficient as register-to-register, r2r, instructions;
-	 however, memory-to-memory instructions are really simulated
-	 as a convenience, and are only 1/3 as efficient)
-*/
-#ifdef	MMX_TRACE
-
-/*	Include the stuff for printing a trace to stderr...
-*/
-
-#define	mmx_i2r(op, imm, reg) \
-	{ \
-		mmx_t mmx_trace; \
-		mmx_trace.uq = (imm); \
-		printf(#op "_i2r(" #imm "=0x%08x%08x, ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		__asm__ __volatile__ ("movq %%" #reg ", %0" \
-				      : "=X" (mmx_trace) \
-				      : /* nothing */ ); \
-		printf(#reg "=0x%08x%08x) => ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		__asm__ __volatile__ (#op " %0, %%" #reg \
-				      : /* nothing */ \
-				      : "X" (imm)); \
-		__asm__ __volatile__ ("movq %%" #reg ", %0" \
-				      : "=X" (mmx_trace) \
-				      : /* nothing */ ); \
-		printf(#reg "=0x%08x%08x\n", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-	}
-
-#define	mmx_m2r(op, mem, reg) \
-	{ \
-		mmx_t mmx_trace; \
-		mmx_trace = (mem); \
-		printf(#op "_m2r(" #mem "=0x%08x%08x, ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		__asm__ __volatile__ ("movq %%" #reg ", %0" \
-				      : "=X" (mmx_trace) \
-				      : /* nothing */ ); \
-		printf(#reg "=0x%08x%08x) => ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		__asm__ __volatile__ (#op " %0, %%" #reg \
-				      : /* nothing */ \
-				      : "X" (mem)); \
-		__asm__ __volatile__ ("movq %%" #reg ", %0" \
-				      : "=X" (mmx_trace) \
-				      : /* nothing */ ); \
-		printf(#reg "=0x%08x%08x\n", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-	}
-
-#define	mmx_r2m(op, reg, mem) \
-	{ \
-		mmx_t mmx_trace; \
-		__asm__ __volatile__ ("movq %%" #reg ", %0" \
-				      : "=X" (mmx_trace) \
-				      : /* nothing */ ); \
-		printf(#op "_r2m(" #reg "=0x%08x%08x, ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		mmx_trace = (mem); \
-		printf(#mem "=0x%08x%08x) => ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		__asm__ __volatile__ (#op " %%" #reg ", %0" \
-				      : "=X" (mem) \
-				      : /* nothing */ ); \
-		mmx_trace = (mem); \
-		printf(#mem "=0x%08x%08x\n", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-	}
-
-#define	mmx_r2r(op, regs, regd) \
-	{ \
-		mmx_t mmx_trace; \
-		__asm__ __volatile__ ("movq %%" #regs ", %0" \
-				      : "=X" (mmx_trace) \
-				      : /* nothing */ ); \
-		printf(#op "_r2r(" #regs "=0x%08x%08x, ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		__asm__ __volatile__ ("movq %%" #regd ", %0" \
-				      : "=X" (mmx_trace) \
-				      : /* nothing */ ); \
-		printf(#regd "=0x%08x%08x) => ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		__asm__ __volatile__ (#op " %" #regs ", %" #regd); \
-		__asm__ __volatile__ ("movq %%" #regd ", %0" \
-				      : "=X" (mmx_trace) \
-				      : /* nothing */ ); \
-		printf(#regd "=0x%08x%08x\n", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-	}
-
-#define	mmx_m2m(op, mems, memd) \
-	{ \
-		mmx_t mmx_trace; \
-		mmx_trace = (mems); \
-		printf(#op "_m2m(" #mems "=0x%08x%08x, ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		mmx_trace = (memd); \
-		printf(#memd "=0x%08x%08x) => ", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-		__asm__ __volatile__ ("movq %0, %%mm0\n\t" \
-				      #op " %1, %%mm0\n\t" \
-				      "movq %%mm0, %0" \
-				      : "=X" (memd) \
-				      : "X" (mems)); \
-		mmx_trace = (memd); \
-		printf(#memd "=0x%08x%08x\n", \
-			mmx_trace.d[1], mmx_trace.d[0]); \
-	}
-
-#else
-
-/*	These macros are a lot simpler without the tracing...
-*/
-
-#define	mmx_i2r(op, imm, reg) \
-	__asm__ __volatile__ (#op " %0, %%" #reg \
-			      : /* nothing */ \
-			      : "X" (imm) )
-
-#define	mmx_m2r(op, mem, reg) \
-	__asm__ __volatile__ (#op " %0, %%" #reg \
-			      : /* nothing */ \
-			      : "m" (mem))
-
-#define	mmx_r2m(op, reg, mem) \
-	__asm__ __volatile__ (#op " %%" #reg ", %0" \
-			      : "=m" (mem) \
-			      : /* nothing */ )
-
-#define	mmx_r2r(op, regs, regd) \
-	__asm__ __volatile__ (#op " %" #regs ", %" #regd)
-
-#define	mmx_m2m(op, mems, memd) \
-	__asm__ __volatile__ ("movq %0, %%mm0\n\t" \
-			      #op " %1, %%mm0\n\t" \
-			      "movq %%mm0, %0" \
-			      : "=X" (memd) \
-			      : "X" (mems))
-
-#endif
-
-
-/*	1x64 MOVe Quadword
-	(this is both a load and a store...
-	 in fact, it is the only way to store)
-*/
-#define	movq_m2r(var, reg)	mmx_m2r(movq, var, reg)
-#define	movq_r2m(reg, var)	mmx_r2m(movq, reg, var)
-#define	movq_r2r(regs, regd)	mmx_r2r(movq, regs, regd)
-#define	movq(vars, vard) \
-	__asm__ __volatile__ ("movq %1, %%mm0\n\t" \
-			      "movq %%mm0, %0" \
-			      : "=X" (vard) \
-			      : "X" (vars))
-
-
-/*	1x32 MOVe Doubleword
-	(like movq, this is both load and store...
-	 but is most useful for moving things between
-	 mmx registers and ordinary registers)
-*/
-#define	movd_m2r(var, reg)	mmx_m2r(movd, var, reg)
-#define	movd_r2m(reg, var)	mmx_r2m(movd, reg, var)
-#define	movd_r2r(regs, regd)	mmx_r2r(movd, regs, regd)
-#define	movd(vars, vard) \
-	__asm__ __volatile__ ("movd %1, %%mm0\n\t" \
-			      "movd %%mm0, %0" \
-			      : "=X" (vard) \
-			      : "X" (vars))
-
-
-/*	2x32, 4x16, and 8x8 Parallel ADDs
-*/
-#define	paddd_m2r(var, reg)	mmx_m2r(paddd, var, reg)
-#define	paddd_r2r(regs, regd)	mmx_r2r(paddd, regs, regd)
-#define	paddd(vars, vard)	mmx_m2m(paddd, vars, vard)
-
-#define	paddw_m2r(var, reg)	mmx_m2r(paddw, var, reg)
-#define	paddw_r2r(regs, regd)	mmx_r2r(paddw, regs, regd)
-#define	paddw(vars, vard)	mmx_m2m(paddw, vars, vard)
-
-#define	paddb_m2r(var, reg)	mmx_m2r(paddb, var, reg)
-#define	paddb_r2r(regs, regd)	mmx_r2r(paddb, regs, regd)
-#define	paddb(vars, vard)	mmx_m2m(paddb, vars, vard)
-
-
-/*	4x16 and 8x8 Parallel ADDs using Saturation arithmetic
-*/
-#define	paddsw_m2r(var, reg)	mmx_m2r(paddsw, var, reg)
-#define	paddsw_r2r(regs, regd)	mmx_r2r(paddsw, regs, regd)
-#define	paddsw(vars, vard)	mmx_m2m(paddsw, vars, vard)
-
-#define	paddsb_m2r(var, reg)	mmx_m2r(paddsb, var, reg)
-#define	paddsb_r2r(regs, regd)	mmx_r2r(paddsb, regs, regd)
-#define	paddsb(vars, vard)	mmx_m2m(paddsb, vars, vard)
-
-
-/*	4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic
-*/
-#define	paddusw_m2r(var, reg)	mmx_m2r(paddusw, var, reg)
-#define	paddusw_r2r(regs, regd)	mmx_r2r(paddusw, regs, regd)
-#define	paddusw(vars, vard)	mmx_m2m(paddusw, vars, vard)
-
-#define	paddusb_m2r(var, reg)	mmx_m2r(paddusb, var, reg)
-#define	paddusb_r2r(regs, regd)	mmx_r2r(paddusb, regs, regd)
-#define	paddusb(vars, vard)	mmx_m2m(paddusb, vars, vard)
-
-
-/*	2x32, 4x16, and 8x8 Parallel SUBs
-*/
-#define	psubd_m2r(var, reg)	mmx_m2r(psubd, var, reg)
-#define	psubd_r2r(regs, regd)	mmx_r2r(psubd, regs, regd)
-#define	psubd(vars, vard)	mmx_m2m(psubd, vars, vard)
-
-#define	psubw_m2r(var, reg)	mmx_m2r(psubw, var, reg)
-#define	psubw_r2r(regs, regd)	mmx_r2r(psubw, regs, regd)
-#define	psubw(vars, vard)	mmx_m2m(psubw, vars, vard)
-
-#define	psubb_m2r(var, reg)	mmx_m2r(psubb, var, reg)
-#define	psubb_r2r(regs, regd)	mmx_r2r(psubb, regs, regd)
-#define	psubb(vars, vard)	mmx_m2m(psubb, vars, vard)
-
-
-/*	4x16 and 8x8 Parallel SUBs using Saturation arithmetic
-*/
-#define	psubsw_m2r(var, reg)	mmx_m2r(psubsw, var, reg)
-#define	psubsw_r2r(regs, regd)	mmx_r2r(psubsw, regs, regd)
-#define	psubsw(vars, vard)	mmx_m2m(psubsw, vars, vard)
-
-#define	psubsb_m2r(var, reg)	mmx_m2r(psubsb, var, reg)
-#define	psubsb_r2r(regs, regd)	mmx_r2r(psubsb, regs, regd)
-#define	psubsb(vars, vard)	mmx_m2m(psubsb, vars, vard)
-
-
-/*	4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic
-*/
-#define	psubusw_m2r(var, reg)	mmx_m2r(psubusw, var, reg)
-#define	psubusw_r2r(regs, regd)	mmx_r2r(psubusw, regs, regd)
-#define	psubusw(vars, vard)	mmx_m2m(psubusw, vars, vard)
-
-#define	psubusb_m2r(var, reg)	mmx_m2r(psubusb, var, reg)
-#define	psubusb_r2r(regs, regd)	mmx_r2r(psubusb, regs, regd)
-#define	psubusb(vars, vard)	mmx_m2m(psubusb, vars, vard)
-
-
-/*	4x16 Parallel MULs giving Low 4x16 portions of results
-*/
-#define	pmullw_m2r(var, reg)	mmx_m2r(pmullw, var, reg)
-#define	pmullw_r2r(regs, regd)	mmx_r2r(pmullw, regs, regd)
-#define	pmullw(vars, vard)	mmx_m2m(pmullw, vars, vard)
-
-
-/*	4x16 Parallel MULs giving High 4x16 portions of results
-*/
-#define	pmulhw_m2r(var, reg)	mmx_m2r(pmulhw, var, reg)
-#define	pmulhw_r2r(regs, regd)	mmx_r2r(pmulhw, regs, regd)
-#define	pmulhw(vars, vard)	mmx_m2m(pmulhw, vars, vard)
-
-
-/*	4x16->2x32 Parallel Mul-ADD
-	(muls like pmullw, then adds adjacent 16-bit fields
-	 in the multiply result to make the final 2x32 result)
-*/
-#define	pmaddwd_m2r(var, reg)	mmx_m2r(pmaddwd, var, reg)
-#define	pmaddwd_r2r(regs, regd)	mmx_r2r(pmaddwd, regs, regd)
-#define	pmaddwd(vars, vard)	mmx_m2m(pmaddwd, vars, vard)
-
-
-/*	1x64 bitwise AND
-*/
-#ifdef	BROKEN_PAND
-#define	pand_m2r(var, reg) \
-	{ \
-		mmx_m2r(pandn, (mmx_t) -1LL, reg); \
-		mmx_m2r(pandn, var, reg); \
-	}
-#define	pand_r2r(regs, regd) \
-	{ \
-		mmx_m2r(pandn, (mmx_t) -1LL, regd); \
-		mmx_r2r(pandn, regs, regd) \
-	}
-#define	pand(vars, vard) \
-	{ \
-		movq_m2r(vard, mm0); \
-		mmx_m2r(pandn, (mmx_t) -1LL, mm0); \
-		mmx_m2r(pandn, vars, mm0); \
-		movq_r2m(mm0, vard); \
-	}
-#else
-#define	pand_m2r(var, reg)	mmx_m2r(pand, var, reg)
-#define	pand_r2r(regs, regd)	mmx_r2r(pand, regs, regd)
-#define	pand(vars, vard)	mmx_m2m(pand, vars, vard)
-#endif
-
-
-/*	1x64 bitwise AND with Not the destination
-*/
-#define	pandn_m2r(var, reg)	mmx_m2r(pandn, var, reg)
-#define	pandn_r2r(regs, regd)	mmx_r2r(pandn, regs, regd)
-#define	pandn(vars, vard)	mmx_m2m(pandn, vars, vard)
-
-
-/*	1x64 bitwise OR
-*/
-#define	por_m2r(var, reg)	mmx_m2r(por, var, reg)
-#define	por_r2r(regs, regd)	mmx_r2r(por, regs, regd)
-#define	por(vars, vard)	mmx_m2m(por, vars, vard)
-
-
-/*	1x64 bitwise eXclusive OR
-*/
-#define	pxor_m2r(var, reg)	mmx_m2r(pxor, var, reg)
-#define	pxor_r2r(regs, regd)	mmx_r2r(pxor, regs, regd)
-#define	pxor(vars, vard)	mmx_m2m(pxor, vars, vard)
-
-
-/*	2x32, 4x16, and 8x8 Parallel CoMPare for EQuality
-	(resulting fields are either 0 or -1)
-*/
-#define	pcmpeqd_m2r(var, reg)	mmx_m2r(pcmpeqd, var, reg)
-#define	pcmpeqd_r2r(regs, regd)	mmx_r2r(pcmpeqd, regs, regd)
-#define	pcmpeqd(vars, vard)	mmx_m2m(pcmpeqd, vars, vard)
-
-#define	pcmpeqw_m2r(var, reg)	mmx_m2r(pcmpeqw, var, reg)
-#define	pcmpeqw_r2r(regs, regd)	mmx_r2r(pcmpeqw, regs, regd)
-#define	pcmpeqw(vars, vard)	mmx_m2m(pcmpeqw, vars, vard)
-
-#define	pcmpeqb_m2r(var, reg)	mmx_m2r(pcmpeqb, var, reg)
-#define	pcmpeqb_r2r(regs, regd)	mmx_r2r(pcmpeqb, regs, regd)
-#define	pcmpeqb(vars, vard)	mmx_m2m(pcmpeqb, vars, vard)
-
-
-/*	2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than
-	(resulting fields are either 0 or -1)
-*/
-#define	pcmpgtd_m2r(var, reg)	mmx_m2r(pcmpgtd, var, reg)
-#define	pcmpgtd_r2r(regs, regd)	mmx_r2r(pcmpgtd, regs, regd)
-#define	pcmpgtd(vars, vard)	mmx_m2m(pcmpgtd, vars, vard)
-
-#define	pcmpgtw_m2r(var, reg)	mmx_m2r(pcmpgtw, var, reg)
-#define	pcmpgtw_r2r(regs, regd)	mmx_r2r(pcmpgtw, regs, regd)
-#define	pcmpgtw(vars, vard)	mmx_m2m(pcmpgtw, vars, vard)
-
-#define	pcmpgtb_m2r(var, reg)	mmx_m2r(pcmpgtb, var, reg)
-#define	pcmpgtb_r2r(regs, regd)	mmx_r2r(pcmpgtb, regs, regd)
-#define	pcmpgtb(vars, vard)	mmx_m2m(pcmpgtb, vars, vard)
-
-
-/*	1x64, 2x32, and 4x16 Parallel Shift Left Logical
-*/
-#define	psllq_i2r(imm, reg)	mmx_i2r(psllq, imm, reg)
-#define	psllq_m2r(var, reg)	mmx_m2r(psllq, var, reg)
-#define	psllq_r2r(regs, regd)	mmx_r2r(psllq, regs, regd)
-#define	psllq(vars, vard)	mmx_m2m(psllq, vars, vard)
-
-#define	pslld_i2r(imm, reg)	mmx_i2r(pslld, imm, reg)
-#define	pslld_m2r(var, reg)	mmx_m2r(pslld, var, reg)
-#define	pslld_r2r(regs, regd)	mmx_r2r(pslld, regs, regd)
-#define	pslld(vars, vard)	mmx_m2m(pslld, vars, vard)
-
-#define	psllw_i2r(imm, reg)	mmx_i2r(psllw, imm, reg)
-#define	psllw_m2r(var, reg)	mmx_m2r(psllw, var, reg)
-#define	psllw_r2r(regs, regd)	mmx_r2r(psllw, regs, regd)
-#define	psllw(vars, vard)	mmx_m2m(psllw, vars, vard)
-
-
-/*	1x64, 2x32, and 4x16 Parallel Shift Right Logical
-*/
-#define	psrlq_i2r(imm, reg)	mmx_i2r(psrlq, imm, reg)
-#define	psrlq_m2r(var, reg)	mmx_m2r(psrlq, var, reg)
-#define	psrlq_r2r(regs, regd)	mmx_r2r(psrlq, regs, regd)
-#define	psrlq(vars, vard)	mmx_m2m(psrlq, vars, vard)
-
-#define	psrld_i2r(imm, reg)	mmx_i2r(psrld, imm, reg)
-#define	psrld_m2r(var, reg)	mmx_m2r(psrld, var, reg)
-#define	psrld_r2r(regs, regd)	mmx_r2r(psrld, regs, regd)
-#define	psrld(vars, vard)	mmx_m2m(psrld, vars, vard)
-
-#define	psrlw_i2r(imm, reg)	mmx_i2r(psrlw, imm, reg)
-#define	psrlw_m2r(var, reg)	mmx_m2r(psrlw, var, reg)
-#define	psrlw_r2r(regs, regd)	mmx_r2r(psrlw, regs, regd)
-#define	psrlw(vars, vard)	mmx_m2m(psrlw, vars, vard)
-
-
-/*	2x32 and 4x16 Parallel Shift Right Arithmetic
-*/
-#define	psrad_i2r(imm, reg)	mmx_i2r(psrad, imm, reg)
-#define	psrad_m2r(var, reg)	mmx_m2r(psrad, var, reg)
-#define	psrad_r2r(regs, regd)	mmx_r2r(psrad, regs, regd)
-#define	psrad(vars, vard)	mmx_m2m(psrad, vars, vard)
-
-#define	psraw_i2r(imm, reg)	mmx_i2r(psraw, imm, reg)
-#define	psraw_m2r(var, reg)	mmx_m2r(psraw, var, reg)
-#define	psraw_r2r(regs, regd)	mmx_r2r(psraw, regs, regd)
-#define	psraw(vars, vard)	mmx_m2m(psraw, vars, vard)
-
-
-/*	2x32->4x16 and 4x16->8x8 PACK and Signed Saturate
-	(packs source and dest fields into dest in that order)
-*/
-#define	packssdw_m2r(var, reg)	mmx_m2r(packssdw, var, reg)
-#define	packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd)
-#define	packssdw(vars, vard)	mmx_m2m(packssdw, vars, vard)
-
-#define	packsswb_m2r(var, reg)	mmx_m2r(packsswb, var, reg)
-#define	packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd)
-#define	packsswb(vars, vard)	mmx_m2m(packsswb, vars, vard)
-
-
-/*	4x16->8x8 PACK and Unsigned Saturate
-	(packs source and dest fields into dest in that order)
-*/
-#define	packuswb_m2r(var, reg)	mmx_m2r(packuswb, var, reg)
-#define	packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd)
-#define	packuswb(vars, vard)	mmx_m2m(packuswb, vars, vard)
-
-
-/*	2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low
-	(interleaves low half of dest with low half of source
-	 as padding in each result field)
-*/
-#define	punpckldq_m2r(var, reg)	mmx_m2r(punpckldq, var, reg)
-#define	punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd)
-#define	punpckldq(vars, vard)	mmx_m2m(punpckldq, vars, vard)
-
-#define	punpcklwd_m2r(var, reg)	mmx_m2r(punpcklwd, var, reg)
-#define	punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd)
-#define	punpcklwd(vars, vard)	mmx_m2m(punpcklwd, vars, vard)
-
-#define	punpcklbw_m2r(var, reg)	mmx_m2r(punpcklbw, var, reg)
-#define	punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd)
-#define	punpcklbw(vars, vard)	mmx_m2m(punpcklbw, vars, vard)
-
-
-/*	2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High
-	(interleaves high half of dest with high half of source
-	 as padding in each result field)
-*/
-#define	punpckhdq_m2r(var, reg)	mmx_m2r(punpckhdq, var, reg)
-#define	punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd)
-#define	punpckhdq(vars, vard)	mmx_m2m(punpckhdq, vars, vard)
-
-#define	punpckhwd_m2r(var, reg)	mmx_m2r(punpckhwd, var, reg)
-#define	punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd)
-#define	punpckhwd(vars, vard)	mmx_m2m(punpckhwd, vars, vard)
-
-#define	punpckhbw_m2r(var, reg)	mmx_m2r(punpckhbw, var, reg)
-#define	punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd)
-#define	punpckhbw(vars, vard)	mmx_m2m(punpckhbw, vars, vard)
-
-
-/*	Empty MMx State
-	(used to clean-up when going from mmx to float use
-	 of the registers that are shared by both; note that
-	 there is no float-to-mmx operation needed, because
-	 only the float tag word info is corruptible)
-*/
-#ifdef	MMX_TRACE
-
-#define	emms() \
-	{ \
-		printf("emms()\n"); \
-		__asm__ __volatile__ ("emms"); \
-	}
-
-#else
-
-#define	emms()			__asm__ __volatile__ ("emms")
-
-#endif
-
-#endif
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/opengl/SDL_glfuncs.h b/deps/SDL2/src/render/opengl/SDL_glfuncs.h
deleted file mode 100644
index 4915c64..0000000
--- a/deps/SDL2/src/render/opengl/SDL_glfuncs.h
+++ /dev/null
@@ -1,456 +0,0 @@
-/* list of OpenGL functions sorted alphabetically
-   If you need to use a GL function from the SDL video subsystem,
-   change its entry from SDL_PROC_UNUSED to SDL_PROC and rebuild.
-*/
-#define SDL_PROC_UNUSED(ret,func,params)
-
-SDL_PROC_UNUSED(void, glAccum, (GLenum, GLfloat))
-SDL_PROC_UNUSED(void, glAlphaFunc, (GLenum, GLclampf))
-SDL_PROC_UNUSED(GLboolean, glAreTexturesResident,
-                (GLsizei, const GLuint *, GLboolean *))
-SDL_PROC_UNUSED(void, glArrayElement, (GLint))
-SDL_PROC(void, glBegin, (GLenum))
-SDL_PROC(void, glBindTexture, (GLenum, GLuint))
-SDL_PROC_UNUSED(void, glBitmap,
-                (GLsizei, GLsizei, GLfloat, GLfloat, GLfloat, GLfloat,
-                 const GLubyte *))
-SDL_PROC(void, glBlendFunc, (GLenum, GLenum))
-SDL_PROC(void, glBlendFuncSeparate, (GLenum, GLenum, GLenum, GLenum))
-SDL_PROC_UNUSED(void, glCallList, (GLuint))
-SDL_PROC_UNUSED(void, glCallLists, (GLsizei, GLenum, const GLvoid *))
-SDL_PROC(void, glClear, (GLbitfield))
-SDL_PROC_UNUSED(void, glClearAccum, (GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glClearColor, (GLclampf, GLclampf, GLclampf, GLclampf))
-SDL_PROC_UNUSED(void, glClearDepth, (GLclampd))
-SDL_PROC_UNUSED(void, glClearIndex, (GLfloat))
-SDL_PROC_UNUSED(void, glClearStencil, (GLint))
-SDL_PROC_UNUSED(void, glClipPlane, (GLenum, const GLdouble *))
-SDL_PROC_UNUSED(void, glColor3b, (GLbyte, GLbyte, GLbyte))
-SDL_PROC_UNUSED(void, glColor3bv, (const GLbyte *))
-SDL_PROC_UNUSED(void, glColor3d, (GLdouble, GLdouble, GLdouble))
-SDL_PROC_UNUSED(void, glColor3dv, (const GLdouble *))
-SDL_PROC_UNUSED(void, glColor3f, (GLfloat, GLfloat, GLfloat))
-SDL_PROC_UNUSED(void, glColor3fv, (const GLfloat *))
-SDL_PROC_UNUSED(void, glColor3i, (GLint, GLint, GLint))
-SDL_PROC_UNUSED(void, glColor3iv, (const GLint *))
-SDL_PROC_UNUSED(void, glColor3s, (GLshort, GLshort, GLshort))
-SDL_PROC_UNUSED(void, glColor3sv, (const GLshort *))
-SDL_PROC_UNUSED(void, glColor3ub, (GLubyte, GLubyte, GLubyte))
-SDL_PROC_UNUSED(void, glColor3ubv, (const GLubyte *))
-SDL_PROC_UNUSED(void, glColor3ui, (GLuint, GLuint, GLuint))
-SDL_PROC_UNUSED(void, glColor3uiv, (const GLuint *))
-SDL_PROC_UNUSED(void, glColor3us, (GLushort, GLushort, GLushort))
-SDL_PROC_UNUSED(void, glColor3usv, (const GLushort *))
-SDL_PROC_UNUSED(void, glColor4b, (GLbyte, GLbyte, GLbyte, GLbyte))
-SDL_PROC_UNUSED(void, glColor4bv, (const GLbyte *))
-SDL_PROC_UNUSED(void, glColor4d, (GLdouble, GLdouble, GLdouble, GLdouble))
-SDL_PROC_UNUSED(void, glColor4dv, (const GLdouble *))
-SDL_PROC(void, glColor4f, (GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC_UNUSED(void, glColor4fv, (const GLfloat *))
-SDL_PROC_UNUSED(void, glColor4i, (GLint, GLint, GLint, GLint))
-SDL_PROC_UNUSED(void, glColor4iv, (const GLint *))
-SDL_PROC_UNUSED(void, glColor4s, (GLshort, GLshort, GLshort, GLshort))
-SDL_PROC_UNUSED(void, glColor4sv, (const GLshort *))
-SDL_PROC_UNUSED(void, glColor4ub,
-                (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha))
-SDL_PROC_UNUSED(void, glColor4ubv, (const GLubyte * v))
-SDL_PROC_UNUSED(void, glColor4ui,
-                (GLuint red, GLuint green, GLuint blue, GLuint alpha))
-SDL_PROC_UNUSED(void, glColor4uiv, (const GLuint * v))
-SDL_PROC_UNUSED(void, glColor4us,
-                (GLushort red, GLushort green, GLushort blue, GLushort alpha))
-SDL_PROC_UNUSED(void, glColor4usv, (const GLushort * v))
-SDL_PROC_UNUSED(void, glColorMask,
-                (GLboolean red, GLboolean green, GLboolean blue,
-                 GLboolean alpha))
-SDL_PROC_UNUSED(void, glColorMaterial, (GLenum face, GLenum mode))
-SDL_PROC_UNUSED(void, glColorPointer,
-                (GLint size, GLenum type, GLsizei stride,
-                 const GLvoid * pointer))
-SDL_PROC_UNUSED(void, glCopyPixels,
-                (GLint x, GLint y, GLsizei width, GLsizei height,
-                 GLenum type))
-SDL_PROC_UNUSED(void, glCopyTexImage1D,
-                (GLenum target, GLint level, GLenum internalFormat, GLint x,
-                 GLint y, GLsizei width, GLint border))
-SDL_PROC_UNUSED(void, glCopyTexImage2D,
-                (GLenum target, GLint level, GLenum internalFormat, GLint x,
-                 GLint y, GLsizei width, GLsizei height, GLint border))
-SDL_PROC_UNUSED(void, glCopyTexSubImage1D,
-                (GLenum target, GLint level, GLint xoffset, GLint x, GLint y,
-                 GLsizei width))
-SDL_PROC_UNUSED(void, glCopyTexSubImage2D,
-                (GLenum target, GLint level, GLint xoffset, GLint yoffset,
-                 GLint x, GLint y, GLsizei width, GLsizei height))
-SDL_PROC_UNUSED(void, glCullFace, (GLenum mode))
-SDL_PROC_UNUSED(void, glDeleteLists, (GLuint list, GLsizei range))
-SDL_PROC(void, glDeleteTextures, (GLsizei n, const GLuint * textures))
-SDL_PROC_UNUSED(void, glDepthFunc, (GLenum func))
-SDL_PROC_UNUSED(void, glDepthMask, (GLboolean flag))
-SDL_PROC_UNUSED(void, glDepthRange, (GLclampd zNear, GLclampd zFar))
-SDL_PROC(void, glDisable, (GLenum cap))
-SDL_PROC(void, glDisableClientState, (GLenum array))
-SDL_PROC(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count))
-SDL_PROC_UNUSED(void, glDrawBuffer, (GLenum mode))
-SDL_PROC_UNUSED(void, glDrawElements,
-                (GLenum mode, GLsizei count, GLenum type,
-                 const GLvoid * indices))
-SDL_PROC(void, glDrawPixels,
-         (GLsizei width, GLsizei height, GLenum format, GLenum type,
-          const GLvoid * pixels))
-SDL_PROC_UNUSED(void, glEdgeFlag, (GLboolean flag))
-SDL_PROC_UNUSED(void, glEdgeFlagPointer,
-                (GLsizei stride, const GLvoid * pointer))
-SDL_PROC_UNUSED(void, glEdgeFlagv, (const GLboolean * flag))
-SDL_PROC(void, glEnable, (GLenum cap))
-SDL_PROC(void, glEnableClientState, (GLenum array))
-SDL_PROC(void, glEnd, (void))
-SDL_PROC_UNUSED(void, glEndList, (void))
-SDL_PROC_UNUSED(void, glEvalCoord1d, (GLdouble u))
-SDL_PROC_UNUSED(void, glEvalCoord1dv, (const GLdouble * u))
-SDL_PROC_UNUSED(void, glEvalCoord1f, (GLfloat u))
-SDL_PROC_UNUSED(void, glEvalCoord1fv, (const GLfloat * u))
-SDL_PROC_UNUSED(void, glEvalCoord2d, (GLdouble u, GLdouble v))
-SDL_PROC_UNUSED(void, glEvalCoord2dv, (const GLdouble * u))
-SDL_PROC_UNUSED(void, glEvalCoord2f, (GLfloat u, GLfloat v))
-SDL_PROC_UNUSED(void, glEvalCoord2fv, (const GLfloat * u))
-SDL_PROC_UNUSED(void, glEvalMesh1, (GLenum mode, GLint i1, GLint i2))
-SDL_PROC_UNUSED(void, glEvalMesh2,
-                (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2))
-SDL_PROC_UNUSED(void, glEvalPoint1, (GLint i))
-SDL_PROC_UNUSED(void, glEvalPoint2, (GLint i, GLint j))
-SDL_PROC_UNUSED(void, glFeedbackBuffer,
-                (GLsizei size, GLenum type, GLfloat * buffer))
-SDL_PROC_UNUSED(void, glFinish, (void))
-SDL_PROC_UNUSED(void, glFlush, (void))
-SDL_PROC_UNUSED(void, glFogf, (GLenum pname, GLfloat param))
-SDL_PROC_UNUSED(void, glFogfv, (GLenum pname, const GLfloat * params))
-SDL_PROC_UNUSED(void, glFogi, (GLenum pname, GLint param))
-SDL_PROC_UNUSED(void, glFogiv, (GLenum pname, const GLint * params))
-SDL_PROC_UNUSED(void, glFrontFace, (GLenum mode))
-SDL_PROC_UNUSED(void, glFrustum,
-                (GLdouble left, GLdouble right, GLdouble bottom,
-                 GLdouble top, GLdouble zNear, GLdouble zFar))
-SDL_PROC_UNUSED(GLuint, glGenLists, (GLsizei range))
-SDL_PROC(void, glGenTextures, (GLsizei n, GLuint * textures))
-SDL_PROC_UNUSED(void, glGetBooleanv, (GLenum pname, GLboolean * params))
-SDL_PROC_UNUSED(void, glGetClipPlane, (GLenum plane, GLdouble * equation))
-SDL_PROC_UNUSED(void, glGetDoublev, (GLenum pname, GLdouble * params))
-SDL_PROC(GLenum, glGetError, (void))
-SDL_PROC_UNUSED(void, glGetFloatv, (GLenum pname, GLfloat * params))
-SDL_PROC(void, glGetIntegerv, (GLenum pname, GLint * params))
-SDL_PROC_UNUSED(void, glGetLightfv,
-                (GLenum light, GLenum pname, GLfloat * params))
-SDL_PROC_UNUSED(void, glGetLightiv,
-                (GLenum light, GLenum pname, GLint * params))
-SDL_PROC_UNUSED(void, glGetMapdv, (GLenum target, GLenum query, GLdouble * v))
-SDL_PROC_UNUSED(void, glGetMapfv, (GLenum target, GLenum query, GLfloat * v))
-SDL_PROC_UNUSED(void, glGetMapiv, (GLenum target, GLenum query, GLint * v))
-SDL_PROC_UNUSED(void, glGetMaterialfv,
-                (GLenum face, GLenum pname, GLfloat * params))
-SDL_PROC_UNUSED(void, glGetMaterialiv,
-                (GLenum face, GLenum pname, GLint * params))
-SDL_PROC_UNUSED(void, glGetPixelMapfv, (GLenum map, GLfloat * values))
-SDL_PROC_UNUSED(void, glGetPixelMapuiv, (GLenum map, GLuint * values))
-SDL_PROC_UNUSED(void, glGetPixelMapusv, (GLenum map, GLushort * values))
-SDL_PROC(void, glGetPointerv, (GLenum pname, GLvoid * *params))
-SDL_PROC_UNUSED(void, glGetPolygonStipple, (GLubyte * mask))
-SDL_PROC(const GLubyte *, glGetString, (GLenum name))
-SDL_PROC_UNUSED(void, glGetTexEnvfv,
-                (GLenum target, GLenum pname, GLfloat * params))
-SDL_PROC_UNUSED(void, glGetTexEnviv,
-                (GLenum target, GLenum pname, GLint * params))
-SDL_PROC_UNUSED(void, glGetTexGendv,
-                (GLenum coord, GLenum pname, GLdouble * params))
-SDL_PROC_UNUSED(void, glGetTexGenfv,
-                (GLenum coord, GLenum pname, GLfloat * params))
-SDL_PROC_UNUSED(void, glGetTexGeniv,
-                (GLenum coord, GLenum pname, GLint * params))
-SDL_PROC_UNUSED(void, glGetTexImage,
-                (GLenum target, GLint level, GLenum format, GLenum type,
-                 GLvoid * pixels))
-SDL_PROC_UNUSED(void, glGetTexLevelParameterfv,
-                (GLenum target, GLint level, GLenum pname, GLfloat * params))
-SDL_PROC_UNUSED(void, glGetTexLevelParameteriv,
-                (GLenum target, GLint level, GLenum pname, GLint * params))
-SDL_PROC_UNUSED(void, glGetTexParameterfv,
-                (GLenum target, GLenum pname, GLfloat * params))
-SDL_PROC_UNUSED(void, glGetTexParameteriv,
-                (GLenum target, GLenum pname, GLint * params))
-SDL_PROC_UNUSED(void, glHint, (GLenum target, GLenum mode))
-SDL_PROC_UNUSED(void, glIndexMask, (GLuint mask))
-SDL_PROC_UNUSED(void, glIndexPointer,
-                (GLenum type, GLsizei stride, const GLvoid * pointer))
-SDL_PROC_UNUSED(void, glIndexd, (GLdouble c))
-SDL_PROC_UNUSED(void, glIndexdv, (const GLdouble * c))
-SDL_PROC_UNUSED(void, glIndexf, (GLfloat c))
-SDL_PROC_UNUSED(void, glIndexfv, (const GLfloat * c))
-SDL_PROC_UNUSED(void, glIndexi, (GLint c))
-SDL_PROC_UNUSED(void, glIndexiv, (const GLint * c))
-SDL_PROC_UNUSED(void, glIndexs, (GLshort c))
-SDL_PROC_UNUSED(void, glIndexsv, (const GLshort * c))
-SDL_PROC_UNUSED(void, glIndexub, (GLubyte c))
-SDL_PROC_UNUSED(void, glIndexubv, (const GLubyte * c))
-SDL_PROC_UNUSED(void, glInitNames, (void))
-SDL_PROC_UNUSED(void, glInterleavedArrays,
-                (GLenum format, GLsizei stride, const GLvoid * pointer))
-SDL_PROC_UNUSED(GLboolean, glIsEnabled, (GLenum cap))
-SDL_PROC_UNUSED(GLboolean, glIsList, (GLuint list))
-SDL_PROC_UNUSED(GLboolean, glIsTexture, (GLuint texture))
-SDL_PROC_UNUSED(void, glLightModelf, (GLenum pname, GLfloat param))
-SDL_PROC_UNUSED(void, glLightModelfv, (GLenum pname, const GLfloat * params))
-SDL_PROC_UNUSED(void, glLightModeli, (GLenum pname, GLint param))
-SDL_PROC_UNUSED(void, glLightModeliv, (GLenum pname, const GLint * params))
-SDL_PROC_UNUSED(void, glLightf, (GLenum light, GLenum pname, GLfloat param))
-SDL_PROC_UNUSED(void, glLightfv,
-                (GLenum light, GLenum pname, const GLfloat * params))
-SDL_PROC_UNUSED(void, glLighti, (GLenum light, GLenum pname, GLint param))
-SDL_PROC_UNUSED(void, glLightiv,
-                (GLenum light, GLenum pname, const GLint * params))
-SDL_PROC_UNUSED(void, glLineStipple, (GLint factor, GLushort pattern))
-SDL_PROC(void, glLineWidth, (GLfloat width))
-SDL_PROC_UNUSED(void, glListBase, (GLuint base))
-SDL_PROC(void, glLoadIdentity, (void))
-SDL_PROC_UNUSED(void, glLoadMatrixd, (const GLdouble * m))
-SDL_PROC_UNUSED(void, glLoadMatrixf, (const GLfloat * m))
-SDL_PROC_UNUSED(void, glLoadName, (GLuint name))
-SDL_PROC_UNUSED(void, glLogicOp, (GLenum opcode))
-SDL_PROC_UNUSED(void, glMap1d,
-                (GLenum target, GLdouble u1, GLdouble u2, GLint stride,
-                 GLint order, const GLdouble * points))
-SDL_PROC_UNUSED(void, glMap1f,
-                (GLenum target, GLfloat u1, GLfloat u2, GLint stride,
-                 GLint order, const GLfloat * points))
-SDL_PROC_UNUSED(void, glMap2d,
-                (GLenum target, GLdouble u1, GLdouble u2, GLint ustride,
-                 GLint uorder, GLdouble v1, GLdouble v2, GLint vstride,
-                 GLint vorder, const GLdouble * points))
-SDL_PROC_UNUSED(void, glMap2f,
-                (GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
-                 GLint uorder, GLfloat v1, GLfloat v2, GLint vstride,
-                 GLint vorder, const GLfloat * points))
-SDL_PROC_UNUSED(void, glMapGrid1d, (GLint un, GLdouble u1, GLdouble u2))
-SDL_PROC_UNUSED(void, glMapGrid1f, (GLint un, GLfloat u1, GLfloat u2))
-SDL_PROC_UNUSED(void, glMapGrid2d,
-                (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1,
-                 GLdouble v2))
-SDL_PROC_UNUSED(void, glMapGrid2f,
-                (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1,
-                 GLfloat v2))
-SDL_PROC_UNUSED(void, glMaterialf, (GLenum face, GLenum pname, GLfloat param))
-SDL_PROC_UNUSED(void, glMaterialfv,
-                (GLenum face, GLenum pname, const GLfloat * params))
-SDL_PROC_UNUSED(void, glMateriali, (GLenum face, GLenum pname, GLint param))
-SDL_PROC_UNUSED(void, glMaterialiv,
-                (GLenum face, GLenum pname, const GLint * params))
-SDL_PROC(void, glMatrixMode, (GLenum mode))
-SDL_PROC_UNUSED(void, glMultMatrixd, (const GLdouble * m))
-SDL_PROC_UNUSED(void, glMultMatrixf, (const GLfloat * m))
-SDL_PROC_UNUSED(void, glNewList, (GLuint list, GLenum mode))
-SDL_PROC_UNUSED(void, glNormal3b, (GLbyte nx, GLbyte ny, GLbyte nz))
-SDL_PROC_UNUSED(void, glNormal3bv, (const GLbyte * v))
-SDL_PROC_UNUSED(void, glNormal3d, (GLdouble nx, GLdouble ny, GLdouble nz))
-SDL_PROC_UNUSED(void, glNormal3dv, (const GLdouble * v))
-SDL_PROC_UNUSED(void, glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz))
-SDL_PROC_UNUSED(void, glNormal3fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glNormal3i, (GLint nx, GLint ny, GLint nz))
-SDL_PROC_UNUSED(void, glNormal3iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glNormal3s, (GLshort nx, GLshort ny, GLshort nz))
-SDL_PROC_UNUSED(void, glNormal3sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glNormalPointer,
-                (GLenum type, GLsizei stride, const GLvoid * pointer))
-SDL_PROC(void, glOrtho,
-         (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top,
-          GLdouble zNear, GLdouble zFar))
-SDL_PROC_UNUSED(void, glPassThrough, (GLfloat token))
-SDL_PROC_UNUSED(void, glPixelMapfv,
-                (GLenum map, GLsizei mapsize, const GLfloat * values))
-SDL_PROC_UNUSED(void, glPixelMapuiv,
-                (GLenum map, GLsizei mapsize, const GLuint * values))
-SDL_PROC_UNUSED(void, glPixelMapusv,
-                (GLenum map, GLsizei mapsize, const GLushort * values))
-SDL_PROC_UNUSED(void, glPixelStoref, (GLenum pname, GLfloat param))
-SDL_PROC(void, glPixelStorei, (GLenum pname, GLint param))
-SDL_PROC_UNUSED(void, glPixelTransferf, (GLenum pname, GLfloat param))
-SDL_PROC_UNUSED(void, glPixelTransferi, (GLenum pname, GLint param))
-SDL_PROC_UNUSED(void, glPixelZoom, (GLfloat xfactor, GLfloat yfactor))
-SDL_PROC(void, glPointSize, (GLfloat size))
-SDL_PROC_UNUSED(void, glPolygonMode, (GLenum face, GLenum mode))
-SDL_PROC_UNUSED(void, glPolygonOffset, (GLfloat factor, GLfloat units))
-SDL_PROC_UNUSED(void, glPolygonStipple, (const GLubyte * mask))
-SDL_PROC_UNUSED(void, glPopAttrib, (void))
-SDL_PROC_UNUSED(void, glPopClientAttrib, (void))
-SDL_PROC(void, glPopMatrix, (void))
-SDL_PROC_UNUSED(void, glPopName, (void))
-SDL_PROC_UNUSED(void, glPrioritizeTextures,
-                (GLsizei n, const GLuint * textures,
-                 const GLclampf * priorities))
-SDL_PROC_UNUSED(void, glPushAttrib, (GLbitfield mask))
-SDL_PROC_UNUSED(void, glPushClientAttrib, (GLbitfield mask))
-SDL_PROC(void, glPushMatrix, (void))
-SDL_PROC_UNUSED(void, glPushName, (GLuint name))
-SDL_PROC_UNUSED(void, glRasterPos2d, (GLdouble x, GLdouble y))
-SDL_PROC_UNUSED(void, glRasterPos2dv, (const GLdouble * v))
-SDL_PROC_UNUSED(void, glRasterPos2f, (GLfloat x, GLfloat y))
-SDL_PROC_UNUSED(void, glRasterPos2fv, (const GLfloat * v))
-SDL_PROC(void, glRasterPos2i, (GLint x, GLint y))
-SDL_PROC_UNUSED(void, glRasterPos2iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glRasterPos2s, (GLshort x, GLshort y))
-SDL_PROC_UNUSED(void, glRasterPos2sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glRasterPos3d, (GLdouble x, GLdouble y, GLdouble z))
-SDL_PROC_UNUSED(void, glRasterPos3dv, (const GLdouble * v))
-SDL_PROC_UNUSED(void, glRasterPos3f, (GLfloat x, GLfloat y, GLfloat z))
-SDL_PROC_UNUSED(void, glRasterPos3fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glRasterPos3i, (GLint x, GLint y, GLint z))
-SDL_PROC_UNUSED(void, glRasterPos3iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glRasterPos3s, (GLshort x, GLshort y, GLshort z))
-SDL_PROC_UNUSED(void, glRasterPos3sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glRasterPos4d,
-                (GLdouble x, GLdouble y, GLdouble z, GLdouble w))
-SDL_PROC_UNUSED(void, glRasterPos4dv, (const GLdouble * v))
-SDL_PROC_UNUSED(void, glRasterPos4f,
-                (GLfloat x, GLfloat y, GLfloat z, GLfloat w))
-SDL_PROC_UNUSED(void, glRasterPos4fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glRasterPos4i, (GLint x, GLint y, GLint z, GLint w))
-SDL_PROC_UNUSED(void, glRasterPos4iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glRasterPos4s,
-                (GLshort x, GLshort y, GLshort z, GLshort w))
-SDL_PROC_UNUSED(void, glRasterPos4sv, (const GLshort * v))
-SDL_PROC(void, glReadBuffer, (GLenum mode))
-SDL_PROC(void, glReadPixels,
-         (GLint x, GLint y, GLsizei width, GLsizei height,
-          GLenum format, GLenum type, GLvoid * pixels))
-SDL_PROC_UNUSED(void, glRectd,
-                (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2))
-SDL_PROC_UNUSED(void, glRectdv, (const GLdouble * v1, const GLdouble * v2))
-SDL_PROC(void, glRectf,
-                (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2))
-SDL_PROC_UNUSED(void, glRectfv, (const GLfloat * v1, const GLfloat * v2))
-SDL_PROC_UNUSED(void, glRecti, (GLint x1, GLint y1, GLint x2, GLint y2))
-SDL_PROC_UNUSED(void, glRectiv, (const GLint * v1, const GLint * v2))
-SDL_PROC_UNUSED(void, glRects,
-                (GLshort x1, GLshort y1, GLshort x2, GLshort y2))
-SDL_PROC_UNUSED(void, glRectsv, (const GLshort * v1, const GLshort * v2))
-SDL_PROC_UNUSED(GLint, glRenderMode, (GLenum mode))
-SDL_PROC(void, glRotated,
-                (GLdouble angle, GLdouble x, GLdouble y, GLdouble z))
-SDL_PROC_UNUSED(void, glRotatef,
-                (GLfloat angle, GLfloat x, GLfloat y, GLfloat z))
-SDL_PROC_UNUSED(void, glScaled, (GLdouble x, GLdouble y, GLdouble z))
-SDL_PROC_UNUSED(void, glScalef, (GLfloat x, GLfloat y, GLfloat z))
-SDL_PROC(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height))
-SDL_PROC_UNUSED(void, glSelectBuffer, (GLsizei size, GLuint * buffer))
-SDL_PROC_UNUSED(void, glShadeModel, (GLenum mode))
-SDL_PROC_UNUSED(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask))
-SDL_PROC_UNUSED(void, glStencilMask, (GLuint mask))
-SDL_PROC_UNUSED(void, glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass))
-SDL_PROC_UNUSED(void, glTexCoord1d, (GLdouble s))
-SDL_PROC_UNUSED(void, glTexCoord1dv, (const GLdouble * v))
-SDL_PROC_UNUSED(void, glTexCoord1f, (GLfloat s))
-SDL_PROC_UNUSED(void, glTexCoord1fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glTexCoord1i, (GLint s))
-SDL_PROC_UNUSED(void, glTexCoord1iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glTexCoord1s, (GLshort s))
-SDL_PROC_UNUSED(void, glTexCoord1sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glTexCoord2d, (GLdouble s, GLdouble t))
-SDL_PROC_UNUSED(void, glTexCoord2dv, (const GLdouble * v))
-SDL_PROC(void, glTexCoord2f, (GLfloat s, GLfloat t))
-SDL_PROC_UNUSED(void, glTexCoord2fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glTexCoord2i, (GLint s, GLint t))
-SDL_PROC_UNUSED(void, glTexCoord2iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glTexCoord2s, (GLshort s, GLshort t))
-SDL_PROC_UNUSED(void, glTexCoord2sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glTexCoord3d, (GLdouble s, GLdouble t, GLdouble r))
-SDL_PROC_UNUSED(void, glTexCoord3dv, (const GLdouble * v))
-SDL_PROC_UNUSED(void, glTexCoord3f, (GLfloat s, GLfloat t, GLfloat r))
-SDL_PROC_UNUSED(void, glTexCoord3fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glTexCoord3i, (GLint s, GLint t, GLint r))
-SDL_PROC_UNUSED(void, glTexCoord3iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glTexCoord3s, (GLshort s, GLshort t, GLshort r))
-SDL_PROC_UNUSED(void, glTexCoord3sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glTexCoord4d,
-                (GLdouble s, GLdouble t, GLdouble r, GLdouble q))
-SDL_PROC_UNUSED(void, glTexCoord4dv, (const GLdouble * v))
-SDL_PROC_UNUSED(void, glTexCoord4f,
-                (GLfloat s, GLfloat t, GLfloat r, GLfloat q))
-SDL_PROC_UNUSED(void, glTexCoord4fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glTexCoord4i, (GLint s, GLint t, GLint r, GLint q))
-SDL_PROC_UNUSED(void, glTexCoord4iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glTexCoord4s,
-                (GLshort s, GLshort t, GLshort r, GLshort q))
-SDL_PROC_UNUSED(void, glTexCoord4sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glTexCoordPointer,
-                (GLint size, GLenum type, GLsizei stride,
-                 const GLvoid * pointer))
-SDL_PROC(void, glTexEnvf, (GLenum target, GLenum pname, GLfloat param))
-SDL_PROC_UNUSED(void, glTexEnvfv,
-                (GLenum target, GLenum pname, const GLfloat * params))
-SDL_PROC_UNUSED(void, glTexEnvi, (GLenum target, GLenum pname, GLint param))
-SDL_PROC_UNUSED(void, glTexEnviv,
-                (GLenum target, GLenum pname, const GLint * params))
-SDL_PROC_UNUSED(void, glTexGend, (GLenum coord, GLenum pname, GLdouble param))
-SDL_PROC_UNUSED(void, glTexGendv,
-                (GLenum coord, GLenum pname, const GLdouble * params))
-SDL_PROC_UNUSED(void, glTexGenf, (GLenum coord, GLenum pname, GLfloat param))
-SDL_PROC_UNUSED(void, glTexGenfv,
-                (GLenum coord, GLenum pname, const GLfloat * params))
-SDL_PROC_UNUSED(void, glTexGeni, (GLenum coord, GLenum pname, GLint param))
-SDL_PROC_UNUSED(void, glTexGeniv,
-                (GLenum coord, GLenum pname, const GLint * params))
-SDL_PROC_UNUSED(void, glTexImage1D,
-                (GLenum target, GLint level, GLint internalformat,
-                 GLsizei width, GLint border, GLenum format, GLenum type,
-                 const GLvoid * pixels))
-SDL_PROC(void, glTexImage2D,
-         (GLenum target, GLint level, GLint internalformat, GLsizei width,
-          GLsizei height, GLint border, GLenum format, GLenum type,
-          const GLvoid * pixels))
-SDL_PROC_UNUSED(void, glTexParameterf,
-                (GLenum target, GLenum pname, GLfloat param))
-SDL_PROC_UNUSED(void, glTexParameterfv,
-                (GLenum target, GLenum pname, const GLfloat * params))
-SDL_PROC(void, glTexParameteri, (GLenum target, GLenum pname, GLint param))
-SDL_PROC_UNUSED(void, glTexParameteriv,
-                (GLenum target, GLenum pname, const GLint * params))
-SDL_PROC_UNUSED(void, glTexSubImage1D,
-                (GLenum target, GLint level, GLint xoffset, GLsizei width,
-                 GLenum format, GLenum type, const GLvoid * pixels))
-SDL_PROC(void, glTexSubImage2D,
-         (GLenum target, GLint level, GLint xoffset, GLint yoffset,
-          GLsizei width, GLsizei height, GLenum format, GLenum type,
-          const GLvoid * pixels))
-SDL_PROC_UNUSED(void, glTranslated, (GLdouble x, GLdouble y, GLdouble z))
-SDL_PROC(void, glTranslatef, (GLfloat x, GLfloat y, GLfloat z))
-SDL_PROC_UNUSED(void, glVertex2d, (GLdouble x, GLdouble y))
-SDL_PROC_UNUSED(void, glVertex2dv, (const GLdouble * v))
-SDL_PROC(void, glVertex2f, (GLfloat x, GLfloat y))
-SDL_PROC_UNUSED(void, glVertex2fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glVertex2i, (GLint x, GLint y))
-SDL_PROC_UNUSED(void, glVertex2iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glVertex2s, (GLshort x, GLshort y))
-SDL_PROC_UNUSED(void, glVertex2sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glVertex3d, (GLdouble x, GLdouble y, GLdouble z))
-SDL_PROC_UNUSED(void, glVertex3dv, (const GLdouble * v))
-SDL_PROC_UNUSED(void, glVertex3f, (GLfloat x, GLfloat y, GLfloat z))
-SDL_PROC_UNUSED(void, glVertex3fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glVertex3i, (GLint x, GLint y, GLint z))
-SDL_PROC_UNUSED(void, glVertex3iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glVertex3s, (GLshort x, GLshort y, GLshort z))
-SDL_PROC_UNUSED(void, glVertex3sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glVertex4d,
-                (GLdouble x, GLdouble y, GLdouble z, GLdouble w))
-SDL_PROC_UNUSED(void, glVertex4dv, (const GLdouble * v))
-SDL_PROC_UNUSED(void, glVertex4f,
-                (GLfloat x, GLfloat y, GLfloat z, GLfloat w))
-SDL_PROC_UNUSED(void, glVertex4fv, (const GLfloat * v))
-SDL_PROC_UNUSED(void, glVertex4i, (GLint x, GLint y, GLint z, GLint w))
-SDL_PROC_UNUSED(void, glVertex4iv, (const GLint * v))
-SDL_PROC_UNUSED(void, glVertex4s,
-                (GLshort x, GLshort y, GLshort z, GLshort w))
-SDL_PROC_UNUSED(void, glVertex4sv, (const GLshort * v))
-SDL_PROC(void, glVertexPointer,
-                (GLint size, GLenum type, GLsizei stride,
-                 const GLvoid * pointer))
-SDL_PROC(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height))
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/opengl/SDL_render_gl.c b/deps/SDL2/src/render/opengl/SDL_render_gl.c
deleted file mode 100644
index 51fc9ad..0000000
--- a/deps/SDL2/src/render/opengl/SDL_render_gl.c
+++ /dev/null
@@ -1,1443 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
-
-#include "SDL_hints.h"
-#include "SDL_log.h"
-#include "SDL_opengl.h"
-#include "../SDL_sysrender.h"
-#include "SDL_shaders_gl.h"
-
-#ifdef __MACOSX__
-#include <OpenGL/OpenGL.h>
-#endif
-
-
-/* OpenGL renderer implementation */
-
-/* Details on optimizing the texture path on Mac OS X:
-   http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_texturedata/opengl_texturedata.html
-*/
-
-/* Used to re-create the window with OpenGL capability */
-extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
-
-static const float inv255f = 1.0f / 255.0f;
-
-static SDL_Renderer *GL_CreateRenderer(SDL_Window * window, Uint32 flags);
-static void GL_WindowEvent(SDL_Renderer * renderer,
-                           const SDL_WindowEvent *event);
-static int GL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h);
-static int GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                            const SDL_Rect * rect, const void *pixels,
-                            int pitch);
-static int GL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
-                               const SDL_Rect * rect,
-                               const Uint8 *Yplane, int Ypitch,
-                               const Uint8 *Uplane, int Upitch,
-                               const Uint8 *Vplane, int Vpitch);
-static int GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                          const SDL_Rect * rect, void **pixels, int *pitch);
-static void GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
-static int GL_UpdateViewport(SDL_Renderer * renderer);
-static int GL_UpdateClipRect(SDL_Renderer * renderer);
-static int GL_RenderClear(SDL_Renderer * renderer);
-static int GL_RenderDrawPoints(SDL_Renderer * renderer,
-                               const SDL_FPoint * points, int count);
-static int GL_RenderDrawLines(SDL_Renderer * renderer,
-                              const SDL_FPoint * points, int count);
-static int GL_RenderFillRects(SDL_Renderer * renderer,
-                              const SDL_FRect * rects, int count);
-static int GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-                         const SDL_Rect * srcrect, const SDL_FRect * dstrect);
-static int GL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-                         const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-                         const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip);
-static int GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                               Uint32 pixel_format, void * pixels, int pitch);
-static void GL_RenderPresent(SDL_Renderer * renderer);
-static void GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static void GL_DestroyRenderer(SDL_Renderer * renderer);
-static int GL_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh);
-static int GL_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture);
-
-SDL_RenderDriver GL_RenderDriver = {
-    GL_CreateRenderer,
-    {
-     "opengl",
-     (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE),
-     1,
-     {SDL_PIXELFORMAT_ARGB8888},
-     0,
-     0}
-};
-
-typedef struct GL_FBOList GL_FBOList;
-
-struct GL_FBOList
-{
-    Uint32 w, h;
-    GLuint FBO;
-    GL_FBOList *next;
-};
-
-typedef struct
-{
-    SDL_GLContext context;
-
-    SDL_bool debug_enabled;
-    SDL_bool GL_ARB_debug_output_supported;
-    int errors;
-    char **error_messages;
-    GLDEBUGPROCARB next_error_callback;
-    GLvoid *next_error_userparam;
-
-    SDL_bool GL_ARB_texture_rectangle_supported;
-    struct {
-        GL_Shader shader;
-        Uint32 color;
-        int blendMode;
-    } current;
-
-    SDL_bool GL_EXT_framebuffer_object_supported;
-    GL_FBOList *framebuffers;
-
-    /* OpenGL functions */
-#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
-#include "SDL_glfuncs.h"
-#undef SDL_PROC
-
-    /* Multitexture support */
-    SDL_bool GL_ARB_multitexture_supported;
-    PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
-    GLint num_texture_units;
-
-    PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
-    PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
-    PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
-    PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
-    PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
-
-    /* Shader support */
-    GL_ShaderContext *shaders;
-
-} GL_RenderData;
-
-typedef struct
-{
-    GLuint texture;
-    GLenum type;
-    GLfloat texw;
-    GLfloat texh;
-    GLenum format;
-    GLenum formattype;
-    void *pixels;
-    int pitch;
-    SDL_Rect locked_rect;
-
-    /* YV12 texture support */
-    SDL_bool yuv;
-    GLuint utexture;
-    GLuint vtexture;
-
-    GL_FBOList *fbo;
-} GL_TextureData;
-
-SDL_FORCE_INLINE const char*
-GL_TranslateError (GLenum error)
-{
-#define GL_ERROR_TRANSLATE(e) case e: return #e;
-    switch (error) {
-    GL_ERROR_TRANSLATE(GL_INVALID_ENUM)
-    GL_ERROR_TRANSLATE(GL_INVALID_VALUE)
-    GL_ERROR_TRANSLATE(GL_INVALID_OPERATION)
-    GL_ERROR_TRANSLATE(GL_OUT_OF_MEMORY)
-    GL_ERROR_TRANSLATE(GL_NO_ERROR)
-    GL_ERROR_TRANSLATE(GL_STACK_OVERFLOW)
-    GL_ERROR_TRANSLATE(GL_STACK_UNDERFLOW)
-    GL_ERROR_TRANSLATE(GL_TABLE_TOO_LARGE)
-    default:
-        return "UNKNOWN";
-}
-#undef GL_ERROR_TRANSLATE
-}
-
-SDL_FORCE_INLINE void
-GL_ClearErrors(SDL_Renderer *renderer)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    if (!data->debug_enabled)
-    {
-        return;
-    }
-    if (data->GL_ARB_debug_output_supported) {
-        if (data->errors) {
-            int i;
-            for (i = 0; i < data->errors; ++i) {
-                SDL_free(data->error_messages[i]);
-            }
-            SDL_free(data->error_messages);
-
-            data->errors = 0;
-            data->error_messages = NULL;
-        }
-    } else {
-        while (data->glGetError() != GL_NO_ERROR) {
-            continue;
-        }
-    }
-}
-
-SDL_FORCE_INLINE int
-GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-    int ret = 0;
-
-    if (!data->debug_enabled)
-    {
-        return 0;
-    }
-    if (data->GL_ARB_debug_output_supported) {
-        if (data->errors) {
-            int i;
-            for (i = 0; i < data->errors; ++i) {
-                SDL_SetError("%s: %s (%d): %s %s", prefix, file, line, function, data->error_messages[i]);
-                ret = -1;
-            }
-            GL_ClearErrors(renderer);
-        }
-    } else {
-        /* check gl errors (can return multiple errors) */
-        for (;;) {
-            GLenum error = data->glGetError();
-            if (error != GL_NO_ERROR) {
-                if (prefix == NULL || prefix[0] == '\0') {
-                    prefix = "generic";
-                }
-                SDL_SetError("%s: %s (%d): %s %s (0x%X)", prefix, file, line, function, GL_TranslateError(error), error);
-                ret = -1;
-            } else {
-                break;
-            }
-        }
-    }
-    return ret;
-}
-
-#if 0
-#define GL_CheckError(prefix, renderer)
-#elif defined(_MSC_VER)
-#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __FUNCTION__)
-#else
-#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#endif
-
-static int
-GL_LoadFunctions(GL_RenderData * data)
-{
-#ifdef __SDL_NOGETPROCADDR__
-#define SDL_PROC(ret,func,params) data->func=func;
-#else
-#define SDL_PROC(ret,func,params) \
-    do { \
-        data->func = SDL_GL_GetProcAddress(#func); \
-        if ( ! data->func ) { \
-            return SDL_SetError("Couldn't load GL function %s: %s\n", #func, SDL_GetError()); \
-        } \
-    } while ( 0 );
-#endif /* __SDL_NOGETPROCADDR__ */
-
-#include "SDL_glfuncs.h"
-#undef SDL_PROC
-    return 0;
-}
-
-static SDL_GLContext SDL_CurrentContext = NULL;
-
-static int
-GL_ActivateRenderer(SDL_Renderer * renderer)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    if (SDL_CurrentContext != data->context) {
-        if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) {
-            return -1;
-        }
-        SDL_CurrentContext = data->context;
-
-        GL_UpdateViewport(renderer);
-    }
-
-    GL_ClearErrors(renderer);
-
-    return 0;
-}
-
-/* This is called if we need to invalidate all of the SDL OpenGL state */
-static void
-GL_ResetState(SDL_Renderer *renderer)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    if (SDL_CurrentContext == data->context) {
-        GL_UpdateViewport(renderer);
-    } else {
-        GL_ActivateRenderer(renderer);
-    }
-
-    data->current.shader = SHADER_NONE;
-    data->current.color = 0;
-    data->current.blendMode = -1;
-
-    data->glDisable(GL_DEPTH_TEST);
-    data->glDisable(GL_CULL_FACE);
-    /* This ended up causing video discrepancies between OpenGL and Direct3D */
-    /* data->glEnable(GL_LINE_SMOOTH); */
-
-    data->glMatrixMode(GL_MODELVIEW);
-    data->glLoadIdentity();
-
-    GL_CheckError("", renderer);
-}
-
-static void APIENTRY
-GL_HandleDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, void *userParam)
-{
-    SDL_Renderer *renderer = (SDL_Renderer *) userParam;
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    if (type == GL_DEBUG_TYPE_ERROR_ARB) {
-        /* Record this error */
-        ++data->errors;
-        data->error_messages = SDL_realloc(data->error_messages, data->errors * sizeof(*data->error_messages));
-        if (data->error_messages) {
-            data->error_messages[data->errors-1] = SDL_strdup(message);
-        }
-    }
-
-    /* If there's another error callback, pass it along, otherwise log it */
-    if (data->next_error_callback) {
-        data->next_error_callback(source, type, id, severity, length, message, data->next_error_userparam);
-    } else {
-        if (type == GL_DEBUG_TYPE_ERROR_ARB) {
-            SDL_LogError(SDL_LOG_CATEGORY_RENDER, "%s", message);
-        } else {
-            SDL_LogDebug(SDL_LOG_CATEGORY_RENDER, "%s", message);
-        }
-    }
-}
-
-static GL_FBOList *
-GL_GetFBO(GL_RenderData *data, Uint32 w, Uint32 h)
-{
-    GL_FBOList *result = data->framebuffers;
-
-    while (result && ((result->w != w) || (result->h != h))) {
-        result = result->next;
-    }
-
-    if (!result) {
-        result = SDL_malloc(sizeof(GL_FBOList));
-        if (result) {
-            result->w = w;
-            result->h = h;
-            data->glGenFramebuffersEXT(1, &result->FBO);
-            result->next = data->framebuffers;
-            data->framebuffers = result;
-        }
-    }
-    return result;
-}
-
-SDL_Renderer *
-GL_CreateRenderer(SDL_Window * window, Uint32 flags)
-{
-    SDL_Renderer *renderer;
-    GL_RenderData *data;
-    const char *hint;
-    GLint value;
-    Uint32 window_flags;
-
-    window_flags = SDL_GetWindowFlags(window);
-    if (!(window_flags & SDL_WINDOW_OPENGL)) {
-        if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
-            /* Uh oh, better try to put it back... */
-            SDL_RecreateWindow(window, window_flags);
-            return NULL;
-        }
-    }
-
-    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
-    if (!renderer) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    data = (GL_RenderData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        GL_DestroyRenderer(renderer);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    renderer->WindowEvent = GL_WindowEvent;
-    renderer->GetOutputSize = GL_GetOutputSize;
-    renderer->CreateTexture = GL_CreateTexture;
-    renderer->UpdateTexture = GL_UpdateTexture;
-    renderer->UpdateTextureYUV = GL_UpdateTextureYUV;
-    renderer->LockTexture = GL_LockTexture;
-    renderer->UnlockTexture = GL_UnlockTexture;
-    renderer->SetRenderTarget = GL_SetRenderTarget;
-    renderer->UpdateViewport = GL_UpdateViewport;
-    renderer->UpdateClipRect = GL_UpdateClipRect;
-    renderer->RenderClear = GL_RenderClear;
-    renderer->RenderDrawPoints = GL_RenderDrawPoints;
-    renderer->RenderDrawLines = GL_RenderDrawLines;
-    renderer->RenderFillRects = GL_RenderFillRects;
-    renderer->RenderCopy = GL_RenderCopy;
-    renderer->RenderCopyEx = GL_RenderCopyEx;
-    renderer->RenderReadPixels = GL_RenderReadPixels;
-    renderer->RenderPresent = GL_RenderPresent;
-    renderer->DestroyTexture = GL_DestroyTexture;
-    renderer->DestroyRenderer = GL_DestroyRenderer;
-    renderer->GL_BindTexture = GL_BindTexture;
-    renderer->GL_UnbindTexture = GL_UnbindTexture;
-    renderer->info = GL_RenderDriver.info;
-    renderer->info.flags = SDL_RENDERER_ACCELERATED;
-    renderer->driverdata = data;
-    renderer->window = window;
-
-    data->context = SDL_GL_CreateContext(window);
-    if (!data->context) {
-        GL_DestroyRenderer(renderer);
-        return NULL;
-    }
-    if (SDL_GL_MakeCurrent(window, data->context) < 0) {
-        GL_DestroyRenderer(renderer);
-        return NULL;
-    }
-
-    if (GL_LoadFunctions(data) < 0) {
-        GL_DestroyRenderer(renderer);
-        return NULL;
-    }
-
-#ifdef __MACOSX__
-    /* Enable multi-threaded rendering */
-    /* Disabled until Ryan finishes his VBO/PBO code...
-       CGLEnable(CGLGetCurrentContext(), kCGLCEMPEngine);
-     */
-#endif
-
-    if (flags & SDL_RENDERER_PRESENTVSYNC) {
-        SDL_GL_SetSwapInterval(1);
-    } else {
-        SDL_GL_SetSwapInterval(0);
-    }
-    if (SDL_GL_GetSwapInterval() > 0) {
-        renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
-    }
-
-    /* Check for debug output support */
-    if (SDL_GL_GetAttribute(SDL_GL_CONTEXT_FLAGS, &value) == 0 &&
-        (value & SDL_GL_CONTEXT_DEBUG_FLAG)) {
-        data->debug_enabled = SDL_TRUE;
-    }
-    if (data->debug_enabled && SDL_GL_ExtensionSupported("GL_ARB_debug_output")) {
-        PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
-
-        data->GL_ARB_debug_output_supported = SDL_TRUE;
-        data->glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION_ARB, (GLvoid **)&data->next_error_callback);
-        data->glGetPointerv(GL_DEBUG_CALLBACK_USER_PARAM_ARB, &data->next_error_userparam);
-        glDebugMessageCallbackARBFunc(GL_HandleDebugMessage, renderer);
-
-        /* Make sure our callback is called when errors actually happen */
-        data->glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
-    }
-
-    if (SDL_GL_ExtensionSupported("GL_ARB_texture_rectangle")
-        || SDL_GL_ExtensionSupported("GL_EXT_texture_rectangle")) {
-        data->GL_ARB_texture_rectangle_supported = SDL_TRUE;
-        data->glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &value);
-        renderer->info.max_texture_width = value;
-        renderer->info.max_texture_height = value;
-    } else {
-        data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
-        renderer->info.max_texture_width = value;
-        renderer->info.max_texture_height = value;
-    }
-
-    /* Check for multitexture support */
-    if (SDL_GL_ExtensionSupported("GL_ARB_multitexture")) {
-        data->glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB");
-        if (data->glActiveTextureARB) {
-            data->GL_ARB_multitexture_supported = SDL_TRUE;
-            data->glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &data->num_texture_units);
-        }
-    }
-
-    /* Check for shader support */
-    hint = SDL_GetHint(SDL_HINT_RENDER_OPENGL_SHADERS);
-    if (!hint || *hint != '0') {
-        data->shaders = GL_CreateShaderContext();
-    }
-    SDL_LogInfo(SDL_LOG_CATEGORY_RENDER, "OpenGL shaders: %s",
-                data->shaders ? "ENABLED" : "DISABLED");
-
-    /* We support YV12 textures using 3 textures and a shader */
-    if (data->shaders && data->num_texture_units >= 3) {
-        renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12;
-        renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV;
-    }
-
-#ifdef __MACOSX__
-    renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_UYVY;
-#endif
-
-    if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object")) {
-        data->GL_EXT_framebuffer_object_supported = SDL_TRUE;
-        data->glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)
-            SDL_GL_GetProcAddress("glGenFramebuffersEXT");
-        data->glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)
-            SDL_GL_GetProcAddress("glDeleteFramebuffersEXT");
-        data->glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)
-            SDL_GL_GetProcAddress("glFramebufferTexture2DEXT");
-        data->glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)
-            SDL_GL_GetProcAddress("glBindFramebufferEXT");
-        data->glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)
-            SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT");
-        renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
-    }
-    data->framebuffers = NULL;
-
-    /* Set up parameters for rendering */
-    GL_ResetState(renderer);
-
-    return renderer;
-}
-
-static void
-GL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
-{
-    if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED ||
-        event->event == SDL_WINDOWEVENT_SHOWN ||
-        event->event == SDL_WINDOWEVENT_HIDDEN) {
-        /* Rebind the context to the window area and update matrices */
-        SDL_CurrentContext = NULL;
-    }
-}
-
-static int
-GL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
-{
-    SDL_GL_GetDrawableSize(renderer->window, w, h);
-
-    return 0;
-}
-
-SDL_FORCE_INLINE int
-power_of_2(int input)
-{
-    int value = 1;
-
-    while (value < input) {
-        value <<= 1;
-    }
-    return value;
-}
-
-SDL_FORCE_INLINE SDL_bool
-convert_format(GL_RenderData *renderdata, Uint32 pixel_format,
-               GLint* internalFormat, GLenum* format, GLenum* type)
-{
-    switch (pixel_format) {
-    case SDL_PIXELFORMAT_ARGB8888:
-        *internalFormat = GL_RGBA8;
-        *format = GL_BGRA;
-        *type = GL_UNSIGNED_INT_8_8_8_8_REV;
-        break;
-    case SDL_PIXELFORMAT_YV12:
-    case SDL_PIXELFORMAT_IYUV:
-        *internalFormat = GL_LUMINANCE;
-        *format = GL_LUMINANCE;
-        *type = GL_UNSIGNED_BYTE;
-        break;
-#ifdef __MACOSX__
-    case SDL_PIXELFORMAT_UYVY:
-		*internalFormat = GL_RGB8;
-		*format = GL_YCBCR_422_APPLE;
-		*type = GL_UNSIGNED_SHORT_8_8_APPLE;
-		break;
-#endif
-    default:
-        return SDL_FALSE;
-    }
-    return SDL_TRUE;
-}
-
-static GLenum
-GetScaleQuality(void)
-{
-    const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
-
-    if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
-        return GL_NEAREST;
-    } else {
-        return GL_LINEAR;
-    }
-}
-
-static int
-GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata;
-    GL_TextureData *data;
-    GLint internalFormat;
-    GLenum format, type;
-    int texture_w, texture_h;
-    GLenum scaleMode;
-
-    GL_ActivateRenderer(renderer);
-
-    if (!convert_format(renderdata, texture->format, &internalFormat,
-                        &format, &type)) {
-        return SDL_SetError("Texture format %s not supported by OpenGL",
-                            SDL_GetPixelFormatName(texture->format));
-    }
-
-    data = (GL_TextureData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        return SDL_OutOfMemory();
-    }
-
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        size_t size;
-        data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
-        size = texture->h * data->pitch;
-        if (texture->format == SDL_PIXELFORMAT_YV12 ||
-            texture->format == SDL_PIXELFORMAT_IYUV) {
-            /* Need to add size for the U and V planes */
-            size += (2 * (texture->h * data->pitch) / 4);
-        }
-        data->pixels = SDL_calloc(1, size);
-        if (!data->pixels) {
-            SDL_free(data);
-            return SDL_OutOfMemory();
-        }
-    }
-
-    if (texture->access == SDL_TEXTUREACCESS_TARGET) {
-        data->fbo = GL_GetFBO(renderdata, texture->w, texture->h);
-    } else {
-        data->fbo = NULL;
-    }
-
-    GL_CheckError("", renderer);
-    renderdata->glGenTextures(1, &data->texture);
-    if (GL_CheckError("glGenTexures()", renderer) < 0) {
-        SDL_free(data);
-        return -1;
-    }
-    texture->driverdata = data;
-
-    if ((renderdata->GL_ARB_texture_rectangle_supported)
-        /* && texture->access != SDL_TEXTUREACCESS_TARGET */){
-        data->type = GL_TEXTURE_RECTANGLE_ARB;
-        texture_w = texture->w;
-        texture_h = texture->h;
-        data->texw = (GLfloat) texture_w;
-        data->texh = (GLfloat) texture_h;
-    } else {
-        data->type = GL_TEXTURE_2D;
-        texture_w = power_of_2(texture->w);
-        texture_h = power_of_2(texture->h);
-        data->texw = (GLfloat) (texture->w) / texture_w;
-        data->texh = (GLfloat) texture->h / texture_h;
-    }
-
-    data->format = format;
-    data->formattype = type;
-    scaleMode = GetScaleQuality();
-    renderdata->glEnable(data->type);
-    renderdata->glBindTexture(data->type, data->texture);
-    renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER, scaleMode);
-    renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER, scaleMode);
-    /* According to the spec, CLAMP_TO_EDGE is the default for TEXTURE_RECTANGLE
-       and setting it causes an INVALID_ENUM error in the latest NVidia drivers.
-    */
-    if (data->type != GL_TEXTURE_RECTANGLE_ARB) {
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S,
-                                    GL_CLAMP_TO_EDGE);
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T,
-                                    GL_CLAMP_TO_EDGE);
-    }
-#ifdef __MACOSX__
-#ifndef GL_TEXTURE_STORAGE_HINT_APPLE
-#define GL_TEXTURE_STORAGE_HINT_APPLE       0x85BC
-#endif
-#ifndef STORAGE_CACHED_APPLE
-#define STORAGE_CACHED_APPLE                0x85BE
-#endif
-#ifndef STORAGE_SHARED_APPLE
-#define STORAGE_SHARED_APPLE                0x85BF
-#endif
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_STORAGE_HINT_APPLE,
-                                    GL_STORAGE_SHARED_APPLE);
-    } else {
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_STORAGE_HINT_APPLE,
-                                    GL_STORAGE_CACHED_APPLE);
-    }
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING
-        && texture->format == SDL_PIXELFORMAT_ARGB8888
-        && (texture->w % 8) == 0) {
-        renderdata->glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE);
-        renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-        renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH,
-                          (data->pitch / SDL_BYTESPERPIXEL(texture->format)));
-        renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
-                                 texture_h, 0, format, type, data->pixels);
-        renderdata->glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE);
-    }
-    else
-#endif
-    {
-        renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
-                                 texture_h, 0, format, type, NULL);
-    }
-    renderdata->glDisable(data->type);
-    if (GL_CheckError("glTexImage2D()", renderer) < 0) {
-        return -1;
-    }
-
-    if (texture->format == SDL_PIXELFORMAT_YV12 ||
-        texture->format == SDL_PIXELFORMAT_IYUV) {
-        data->yuv = SDL_TRUE;
-
-        renderdata->glGenTextures(1, &data->utexture);
-        renderdata->glGenTextures(1, &data->vtexture);
-        renderdata->glEnable(data->type);
-
-        renderdata->glBindTexture(data->type, data->utexture);
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER,
-                                    scaleMode);
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER,
-                                    scaleMode);
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S,
-                                    GL_CLAMP_TO_EDGE);
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T,
-                                    GL_CLAMP_TO_EDGE);
-        renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w/2,
-                                 texture_h/2, 0, format, type, NULL);
-
-        renderdata->glBindTexture(data->type, data->vtexture);
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER,
-                                    scaleMode);
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER,
-                                    scaleMode);
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S,
-                                    GL_CLAMP_TO_EDGE);
-        renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T,
-                                    GL_CLAMP_TO_EDGE);
-        renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w/2,
-                                 texture_h/2, 0, format, type, NULL);
-
-        renderdata->glDisable(data->type);
-    }
-
-    return GL_CheckError("", renderer);
-}
-
-static int
-GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                 const SDL_Rect * rect, const void *pixels, int pitch)
-{
-    GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata;
-    GL_TextureData *data = (GL_TextureData *) texture->driverdata;
-
-    GL_ActivateRenderer(renderer);
-
-    renderdata->glEnable(data->type);
-    renderdata->glBindTexture(data->type, data->texture);
-    renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-    renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH,
-                              (pitch / SDL_BYTESPERPIXEL(texture->format)));
-    renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
-                                rect->h, data->format, data->formattype,
-                                pixels);
-    if (data->yuv) {
-        renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, (pitch / 2));
-
-        /* Skip to the correct offset into the next texture */
-        pixels = (const void*)((const Uint8*)pixels + rect->h * pitch);
-        if (texture->format == SDL_PIXELFORMAT_YV12) {
-            renderdata->glBindTexture(data->type, data->vtexture);
-        } else {
-            renderdata->glBindTexture(data->type, data->utexture);
-        }
-        renderdata->glTexSubImage2D(data->type, 0, rect->x/2, rect->y/2,
-                                    rect->w/2, rect->h/2,
-                                    data->format, data->formattype, pixels);
-
-        /* Skip to the correct offset into the next texture */
-        pixels = (const void*)((const Uint8*)pixels + (rect->h * pitch)/4);
-        if (texture->format == SDL_PIXELFORMAT_YV12) {
-            renderdata->glBindTexture(data->type, data->utexture);
-        } else {
-            renderdata->glBindTexture(data->type, data->vtexture);
-        }
-        renderdata->glTexSubImage2D(data->type, 0, rect->x/2, rect->y/2,
-                                    rect->w/2, rect->h/2,
-                                    data->format, data->formattype, pixels);
-    }
-    renderdata->glDisable(data->type);
-
-    return GL_CheckError("glTexSubImage2D()", renderer);
-}
-
-static int
-GL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
-                    const SDL_Rect * rect,
-                    const Uint8 *Yplane, int Ypitch,
-                    const Uint8 *Uplane, int Upitch,
-                    const Uint8 *Vplane, int Vpitch)
-{
-    GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata;
-    GL_TextureData *data = (GL_TextureData *) texture->driverdata;
-
-    GL_ActivateRenderer(renderer);
-
-    renderdata->glEnable(data->type);
-    renderdata->glBindTexture(data->type, data->texture);
-    renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-    renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, Ypitch);
-    renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
-                                rect->h, data->format, data->formattype,
-                                Yplane);
-
-    renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, Upitch);
-    renderdata->glBindTexture(data->type, data->utexture);
-    renderdata->glTexSubImage2D(data->type, 0, rect->x/2, rect->y/2,
-                                rect->w/2, rect->h/2,
-                                data->format, data->formattype, Uplane);
-
-    renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, Vpitch);
-    renderdata->glBindTexture(data->type, data->vtexture);
-    renderdata->glTexSubImage2D(data->type, 0, rect->x/2, rect->y/2,
-                                rect->w/2, rect->h/2,
-                                data->format, data->formattype, Vplane);
-    renderdata->glDisable(data->type);
-
-    return GL_CheckError("glTexSubImage2D()", renderer);
-}
-
-static int
-GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-               const SDL_Rect * rect, void **pixels, int *pitch)
-{
-    GL_TextureData *data = (GL_TextureData *) texture->driverdata;
-
-    data->locked_rect = *rect;
-    *pixels =
-        (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
-                  rect->x * SDL_BYTESPERPIXEL(texture->format));
-    *pitch = data->pitch;
-    return 0;
-}
-
-static void
-GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    GL_TextureData *data = (GL_TextureData *) texture->driverdata;
-    const SDL_Rect *rect;
-    void *pixels;
-
-    rect = &data->locked_rect;
-    pixels =
-        (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
-                  rect->x * SDL_BYTESPERPIXEL(texture->format));
-    GL_UpdateTexture(renderer, texture, rect, pixels, data->pitch);
-}
-
-static int
-GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-    GL_TextureData *texturedata;
-    GLenum status;
-
-    GL_ActivateRenderer(renderer);
-
-    if (texture == NULL) {
-        data->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
-        return 0;
-    }
-
-    texturedata = (GL_TextureData *) texture->driverdata;
-    data->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, texturedata->fbo->FBO);
-    /* TODO: check if texture pixel format allows this operation */
-    data->glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, texturedata->type, texturedata->texture, 0);
-    /* Check FBO status */
-    status = data->glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
-    if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
-        return SDL_SetError("glFramebufferTexture2DEXT() failed");
-    }
-    return 0;
-}
-
-static int
-GL_UpdateViewport(SDL_Renderer * renderer)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    if (SDL_CurrentContext != data->context) {
-        /* We'll update the viewport after we rebind the context */
-        return 0;
-    }
-
-    data->glViewport(renderer->viewport.x, renderer->viewport.y,
-                     renderer->viewport.w, renderer->viewport.h);
-
-    data->glMatrixMode(GL_PROJECTION);
-    data->glLoadIdentity();
-    if (renderer->viewport.w && renderer->viewport.h) {
-        if (renderer->target) {
-            data->glOrtho((GLdouble) 0,
-                          (GLdouble) renderer->viewport.w,
-                          (GLdouble) 0,
-                          (GLdouble) renderer->viewport.h,
-                           0.0, 1.0);
-        } else {
-            data->glOrtho((GLdouble) 0,
-                          (GLdouble) renderer->viewport.w,
-                          (GLdouble) renderer->viewport.h,
-                          (GLdouble) 0,
-                           0.0, 1.0);
-        }
-    }
-    return GL_CheckError("", renderer);
-}
-
-static int
-GL_UpdateClipRect(SDL_Renderer * renderer)
-{
-    const SDL_Rect *rect = &renderer->clip_rect;
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    if (!SDL_RectEmpty(rect)) {
-        data->glEnable(GL_SCISSOR_TEST);
-        data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h);
-    } else {
-        data->glDisable(GL_SCISSOR_TEST);
-    }
-    return 0;
-}
-
-static void
-GL_SetShader(GL_RenderData * data, GL_Shader shader)
-{
-    if (data->shaders && shader != data->current.shader) {
-        GL_SelectShader(data->shaders, shader);
-        data->current.shader = shader;
-    }
-}
-
-static void
-GL_SetColor(GL_RenderData * data, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    Uint32 color = ((a << 24) | (r << 16) | (g << 8) | b);
-
-    if (color != data->current.color) {
-        data->glColor4f((GLfloat) r * inv255f,
-                        (GLfloat) g * inv255f,
-                        (GLfloat) b * inv255f,
-                        (GLfloat) a * inv255f);
-        data->current.color = color;
-    }
-}
-
-static void
-GL_SetBlendMode(GL_RenderData * data, int blendMode)
-{
-    if (blendMode != data->current.blendMode) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_NONE:
-            data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-            data->glDisable(GL_BLEND);
-            break;
-        case SDL_BLENDMODE_BLEND:
-            data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-            data->glEnable(GL_BLEND);
-            data->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-            break;
-        case SDL_BLENDMODE_ADD:
-            data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-            data->glEnable(GL_BLEND);
-            data->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_ONE);
-            break;
-        case SDL_BLENDMODE_MOD:
-            data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-            data->glEnable(GL_BLEND);
-            data->glBlendFuncSeparate(GL_ZERO, GL_SRC_COLOR, GL_ZERO, GL_ONE);
-            break;
-        }
-        data->current.blendMode = blendMode;
-    }
-}
-
-static void
-GL_SetDrawingState(SDL_Renderer * renderer)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    GL_ActivateRenderer(renderer);
-
-    GL_SetColor(data, renderer->r,
-                      renderer->g,
-                      renderer->b,
-                      renderer->a);
-
-    GL_SetBlendMode(data, renderer->blendMode);
-
-    GL_SetShader(data, SHADER_SOLID);
-}
-
-static int
-GL_RenderClear(SDL_Renderer * renderer)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    GL_ActivateRenderer(renderer);
-
-    data->glClearColor((GLfloat) renderer->r * inv255f,
-                       (GLfloat) renderer->g * inv255f,
-                       (GLfloat) renderer->b * inv255f,
-                       (GLfloat) renderer->a * inv255f);
-
-    data->glClear(GL_COLOR_BUFFER_BIT);
-
-    return 0;
-}
-
-static int
-GL_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points,
-                    int count)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    GL_SetDrawingState(renderer);
-
-    data->glTranslatef(0.5f, 0.5f, 0.0f);
-    data->glVertexPointer(2, GL_FLOAT, 0, points);
-    data->glEnableClientState(GL_VERTEX_ARRAY);
-
-    data->glDrawArrays(GL_POINTS, 0, count);
-
-    data->glDisableClientState(GL_VERTEX_ARRAY);
-    data->glTranslatef(-0.5f, -0.5f, 0.0f);
-
-    return 0;
-}
-
-static int
-GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points,
-                   int count)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    GL_SetDrawingState(renderer);
-
-    data->glTranslatef(0.5f, 0.5f, 0.0f);
-    data->glVertexPointer(2, GL_FLOAT, 0, points);
-    data->glEnableClientState(GL_VERTEX_ARRAY);
-
-    if (count > 2 &&
-        points[0].x == points[count-1].x && points[0].y == points[count-1].y) {
-        /* GL_LINE_LOOP takes care of the final segment */
-        data->glDrawArrays(GL_LINE_LOOP, 0, count-1);
-    } else {
-        data->glDrawArrays(GL_LINE_STRIP, 0, count);
-    }
-    /* Make sure all the line endpoints are closed.
-     * http://www.opengl.org/documentation/specs/version1.1/glspec1.1/node47.html
-     * Which points need to be drawn varies by driver, so just draw all of them.
-     */
-    data->glDrawArrays(GL_POINTS, 0, count);
-    data->glDisableClientState(GL_VERTEX_ARRAY);
-    data->glTranslatef(-0.5f, -0.5f, 0.0f);
-
-    return GL_CheckError("", renderer);
-}
-
-static int
-GL_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, int count)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-    int i;
-
-    GL_SetDrawingState(renderer);
-
-    for (i = 0; i < count; ++i) {
-        const SDL_FRect *rect = &rects[i];
-
-        data->glRectf(rect->x, rect->y, rect->x + rect->w, rect->y + rect->h);
-    }
-    return GL_CheckError("", renderer);
-}
-
-static int
-GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-              const SDL_Rect * srcrect, const SDL_FRect * dstrect)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-    GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata;
-    GLfloat minx, miny, maxx, maxy;
-    GLfloat minu, maxu, minv, maxv;
-
-    GL_ActivateRenderer(renderer);
-
-    data->glEnable(texturedata->type);
-    if (texturedata->yuv) {
-        data->glActiveTextureARB(GL_TEXTURE2_ARB);
-        data->glBindTexture(texturedata->type, texturedata->vtexture);
-
-        data->glActiveTextureARB(GL_TEXTURE1_ARB);
-        data->glBindTexture(texturedata->type, texturedata->utexture);
-
-        data->glActiveTextureARB(GL_TEXTURE0_ARB);
-    }
-    data->glBindTexture(texturedata->type, texturedata->texture);
-
-    if (texture->modMode) {
-        GL_SetColor(data, texture->r, texture->g, texture->b, texture->a);
-    } else {
-        GL_SetColor(data, 255, 255, 255, 255);
-    }
-
-    GL_SetBlendMode(data, texture->blendMode);
-
-    if (texturedata->yuv) {
-        GL_SetShader(data, SHADER_YV12);
-    } else {
-        GL_SetShader(data, SHADER_RGB);
-    }
-
-    minx = dstrect->x;
-    miny = dstrect->y;
-    maxx = dstrect->x + dstrect->w;
-    maxy = dstrect->y + dstrect->h;
-
-    minu = (GLfloat) srcrect->x / texture->w;
-    minu *= texturedata->texw;
-    maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
-    maxu *= texturedata->texw;
-    minv = (GLfloat) srcrect->y / texture->h;
-    minv *= texturedata->texh;
-    maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
-    maxv *= texturedata->texh;
-
-    data->glBegin(GL_TRIANGLE_STRIP);
-    data->glTexCoord2f(minu, minv);
-    data->glVertex2f(minx, miny);
-    data->glTexCoord2f(maxu, minv);
-    data->glVertex2f(maxx, miny);
-    data->glTexCoord2f(minu, maxv);
-    data->glVertex2f(minx, maxy);
-    data->glTexCoord2f(maxu, maxv);
-    data->glVertex2f(maxx, maxy);
-    data->glEnd();
-
-    data->glDisable(texturedata->type);
-
-    return GL_CheckError("", renderer);
-}
-
-static int
-GL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-              const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-              const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-    GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata;
-    GLfloat minx, miny, maxx, maxy;
-    GLfloat centerx, centery;
-    GLfloat minu, maxu, minv, maxv;
-
-    GL_ActivateRenderer(renderer);
-
-    data->glEnable(texturedata->type);
-    if (texturedata->yuv) {
-        data->glActiveTextureARB(GL_TEXTURE2_ARB);
-        data->glBindTexture(texturedata->type, texturedata->vtexture);
-
-        data->glActiveTextureARB(GL_TEXTURE1_ARB);
-        data->glBindTexture(texturedata->type, texturedata->utexture);
-
-        data->glActiveTextureARB(GL_TEXTURE0_ARB);
-    }
-    data->glBindTexture(texturedata->type, texturedata->texture);
-
-    if (texture->modMode) {
-        GL_SetColor(data, texture->r, texture->g, texture->b, texture->a);
-    } else {
-        GL_SetColor(data, 255, 255, 255, 255);
-    }
-
-    GL_SetBlendMode(data, texture->blendMode);
-
-    if (texturedata->yuv) {
-        GL_SetShader(data, SHADER_YV12);
-    } else {
-        GL_SetShader(data, SHADER_RGB);
-    }
-
-    centerx = center->x;
-    centery = center->y;
-
-    if (flip & SDL_FLIP_HORIZONTAL) {
-        minx =  dstrect->w - centerx;
-        maxx = -centerx;
-    }
-    else {
-        minx = -centerx;
-        maxx =  dstrect->w - centerx;
-    }
-
-    if (flip & SDL_FLIP_VERTICAL) {
-        miny =  dstrect->h - centery;
-        maxy = -centery;
-    }
-    else {
-        miny = -centery;
-        maxy =  dstrect->h - centery;
-    }
-
-    minu = (GLfloat) srcrect->x / texture->w;
-    minu *= texturedata->texw;
-    maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
-    maxu *= texturedata->texw;
-    minv = (GLfloat) srcrect->y / texture->h;
-    minv *= texturedata->texh;
-    maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
-    maxv *= texturedata->texh;
-
-    /* Translate to flip, rotate, translate to position */
-    data->glPushMatrix();
-    data->glTranslatef((GLfloat)dstrect->x + centerx, (GLfloat)dstrect->y + centery, (GLfloat)0.0);
-    data->glRotated(angle, (GLdouble)0.0, (GLdouble)0.0, (GLdouble)1.0);
-
-    data->glBegin(GL_TRIANGLE_STRIP);
-    data->glTexCoord2f(minu, minv);
-    data->glVertex2f(minx, miny);
-    data->glTexCoord2f(maxu, minv);
-    data->glVertex2f(maxx, miny);
-    data->glTexCoord2f(minu, maxv);
-    data->glVertex2f(minx, maxy);
-    data->glTexCoord2f(maxu, maxv);
-    data->glVertex2f(maxx, maxy);
-    data->glEnd();
-    data->glPopMatrix();
-
-    data->glDisable(texturedata->type);
-
-    return GL_CheckError("", renderer);
-}
-
-static int
-GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                    Uint32 pixel_format, void * pixels, int pitch)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-    Uint32 temp_format = SDL_PIXELFORMAT_ARGB8888;
-    void *temp_pixels;
-    int temp_pitch;
-    GLint internalFormat;
-    GLenum format, type;
-    Uint8 *src, *dst, *tmp;
-    int w, h, length, rows;
-    int status;
-
-    GL_ActivateRenderer(renderer);
-
-    temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format);
-    temp_pixels = SDL_malloc(rect->h * temp_pitch);
-    if (!temp_pixels) {
-        return SDL_OutOfMemory();
-    }
-
-    convert_format(data, temp_format, &internalFormat, &format, &type);
-
-    SDL_GetRendererOutputSize(renderer, &w, &h);
-
-    data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
-    data->glPixelStorei(GL_PACK_ROW_LENGTH,
-                        (temp_pitch / SDL_BYTESPERPIXEL(temp_format)));
-
-    data->glReadPixels(rect->x, (h-rect->y)-rect->h, rect->w, rect->h,
-                       format, type, temp_pixels);
-
-    if (GL_CheckError("glReadPixels()", renderer) < 0) {
-        return -1;
-    }
-
-    /* Flip the rows to be top-down */
-    length = rect->w * SDL_BYTESPERPIXEL(temp_format);
-    src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch;
-    dst = (Uint8*)temp_pixels;
-    tmp = SDL_stack_alloc(Uint8, length);
-    rows = rect->h / 2;
-    while (rows--) {
-        SDL_memcpy(tmp, dst, length);
-        SDL_memcpy(dst, src, length);
-        SDL_memcpy(src, tmp, length);
-        dst += temp_pitch;
-        src -= temp_pitch;
-    }
-    SDL_stack_free(tmp);
-
-    status = SDL_ConvertPixels(rect->w, rect->h,
-                               temp_format, temp_pixels, temp_pitch,
-                               pixel_format, pixels, pitch);
-    SDL_free(temp_pixels);
-
-    return status;
-}
-
-static void
-GL_RenderPresent(SDL_Renderer * renderer)
-{
-    GL_ActivateRenderer(renderer);
-
-    SDL_GL_SwapWindow(renderer->window);
-}
-
-static void
-GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata;
-    GL_TextureData *data = (GL_TextureData *) texture->driverdata;
-
-    GL_ActivateRenderer(renderer);
-
-    if (!data) {
-        return;
-    }
-    if (data->texture) {
-        renderdata->glDeleteTextures(1, &data->texture);
-    }
-    if (data->yuv) {
-        renderdata->glDeleteTextures(1, &data->utexture);
-        renderdata->glDeleteTextures(1, &data->vtexture);
-    }
-    SDL_free(data->pixels);
-    SDL_free(data);
-    texture->driverdata = NULL;
-}
-
-static void
-GL_DestroyRenderer(SDL_Renderer * renderer)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-
-    if (data) {
-        GL_ClearErrors(renderer);
-        if (data->GL_ARB_debug_output_supported) {
-            PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
-
-            /* Uh oh, we don't have a safe way of removing ourselves from the callback chain, if it changed after we set our callback. */
-            /* For now, just always replace the callback with the original one */
-            glDebugMessageCallbackARBFunc(data->next_error_callback, data->next_error_userparam);
-        }
-        if (data->shaders) {
-            GL_DestroyShaderContext(data->shaders);
-        }
-        if (data->context) {
-            while (data->framebuffers) {
-                GL_FBOList *nextnode = data->framebuffers->next;
-                /* delete the framebuffer object */
-                data->glDeleteFramebuffersEXT(1, &data->framebuffers->FBO);
-                GL_CheckError("", renderer);
-                SDL_free(data->framebuffers);
-                data->framebuffers = nextnode;
-            }
-            SDL_GL_DeleteContext(data->context);
-        }
-        SDL_free(data);
-    }
-    SDL_free(renderer);
-}
-
-static int
-GL_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-    GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata;
-    GL_ActivateRenderer(renderer);
-
-    data->glEnable(texturedata->type);
-    if (texturedata->yuv) {
-        data->glActiveTextureARB(GL_TEXTURE2_ARB);
-        data->glBindTexture(texturedata->type, texturedata->vtexture);
-
-        data->glActiveTextureARB(GL_TEXTURE1_ARB);
-        data->glBindTexture(texturedata->type, texturedata->utexture);
-
-        data->glActiveTextureARB(GL_TEXTURE0_ARB);
-    }
-    data->glBindTexture(texturedata->type, texturedata->texture);
-
-    if(texw) *texw = (float)texturedata->texw;
-    if(texh) *texh = (float)texturedata->texh;
-
-    return 0;
-}
-
-static int
-GL_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-    GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata;
-    GL_ActivateRenderer(renderer);
-
-    if (texturedata->yuv) {
-        data->glActiveTextureARB(GL_TEXTURE2_ARB);
-        data->glDisable(texturedata->type);
-
-        data->glActiveTextureARB(GL_TEXTURE1_ARB);
-        data->glDisable(texturedata->type);
-
-        data->glActiveTextureARB(GL_TEXTURE0_ARB);
-    }
-
-    data->glDisable(texturedata->type);
-
-    return 0;
-}
-
-#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/opengl/SDL_shaders_gl.c b/deps/SDL2/src/render/opengl/SDL_shaders_gl.c
deleted file mode 100644
index ebf641b..0000000
--- a/deps/SDL2/src/render/opengl/SDL_shaders_gl.c
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
-
-#include "SDL_stdinc.h"
-#include "SDL_log.h"
-#include "SDL_opengl.h"
-#include "SDL_video.h"
-#include "SDL_shaders_gl.h"
-
-/* OpenGL shader implementation */
-
-/* #define DEBUG_SHADERS */
-
-typedef struct
-{
-    GLhandleARB program;
-    GLhandleARB vert_shader;
-    GLhandleARB frag_shader;
-} GL_ShaderData;
-
-struct GL_ShaderContext
-{
-    GLenum (*glGetError)(void);
-
-    PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
-    PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
-    PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
-    PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
-    PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
-    PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
-    PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
-    PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
-    PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
-    PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
-    PFNGLUNIFORM1IARBPROC glUniform1iARB;
-    PFNGLUNIFORM1FARBPROC glUniform1fARB;
-    PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
-
-    SDL_bool GL_ARB_texture_rectangle_supported;
-
-    GL_ShaderData shaders[NUM_SHADERS];
-};
-
-/*
- * NOTE: Always use sampler2D, etc here. We'll #define them to the
- *  texture_rectangle versions if we choose to use that extension.
- */
-static const char *shader_source[NUM_SHADERS][2] =
-{
-    /* SHADER_NONE */
-    { NULL, NULL },
-
-    /* SHADER_SOLID */
-    {
-        /* vertex shader */
-"varying vec4 v_color;\n"
-"\n"
-"void main()\n"
-"{\n"
-"    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
-"    v_color = gl_Color;\n"
-"}",
-        /* fragment shader */
-"varying vec4 v_color;\n"
-"\n"
-"void main()\n"
-"{\n"
-"    gl_FragColor = v_color;\n"
-"}"
-    },
-
-    /* SHADER_RGB */
-    {
-        /* vertex shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"\n"
-"void main()\n"
-"{\n"
-"    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
-"    v_color = gl_Color;\n"
-"    v_texCoord = vec2(gl_MultiTexCoord0);\n"
-"}",
-        /* fragment shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"uniform sampler2D tex0;\n"
-"\n"
-"void main()\n"
-"{\n"
-"    gl_FragColor = texture2D(tex0, v_texCoord) * v_color;\n"
-"}"
-    },
-
-    /* SHADER_YV12 */
-    {
-        /* vertex shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"\n"
-"void main()\n"
-"{\n"
-"    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
-"    v_color = gl_Color;\n"
-"    v_texCoord = vec2(gl_MultiTexCoord0);\n"
-"}",
-        /* fragment shader */
-"varying vec4 v_color;\n"
-"varying vec2 v_texCoord;\n"
-"uniform sampler2D tex0; // Y \n"
-"uniform sampler2D tex1; // U \n"
-"uniform sampler2D tex2; // V \n"
-"\n"
-"// YUV offset \n"
-"const vec3 offset = vec3(-0.0625, -0.5, -0.5);\n"
-"\n"
-"// RGB coefficients \n"
-"const vec3 Rcoeff = vec3(1.164,  0.000,  1.596);\n"
-"const vec3 Gcoeff = vec3(1.164, -0.391, -0.813);\n"
-"const vec3 Bcoeff = vec3(1.164,  2.018,  0.000);\n"
-"\n"
-"void main()\n"
-"{\n"
-"    vec2 tcoord;\n"
-"    vec3 yuv, rgb;\n"
-"\n"
-"    // Get the Y value \n"
-"    tcoord = v_texCoord;\n"
-"    yuv.x = texture2D(tex0, tcoord).r;\n"
-"\n"
-"    // Get the U and V values \n"
-"    tcoord *= 0.5;\n"
-"    yuv.y = texture2D(tex1, tcoord).r;\n"
-"    yuv.z = texture2D(tex2, tcoord).r;\n"
-"\n"
-"    // Do the color transform \n"
-"    yuv += offset;\n"
-"    rgb.r = dot(yuv, Rcoeff);\n"
-"    rgb.g = dot(yuv, Gcoeff);\n"
-"    rgb.b = dot(yuv, Bcoeff);\n"
-"\n"
-"    // That was easy. :) \n"
-"    gl_FragColor = vec4(rgb, 1.0) * v_color;\n"
-"}"
-    },
-};
-
-static SDL_bool
-CompileShader(GL_ShaderContext *ctx, GLhandleARB shader, const char *defines, const char *source)
-{
-    GLint status;
-    const char *sources[2];
-
-    sources[0] = defines;
-    sources[1] = source;
-
-    ctx->glShaderSourceARB(shader, SDL_arraysize(sources), sources, NULL);
-    ctx->glCompileShaderARB(shader);
-    ctx->glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status);
-    if (status == 0) {
-        GLint length;
-        char *info;
-
-        ctx->glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length);
-        info = SDL_stack_alloc(char, length+1);
-        ctx->glGetInfoLogARB(shader, length, NULL, info);
-        SDL_LogError(SDL_LOG_CATEGORY_RENDER,
-            "Failed to compile shader:\n%s%s\n%s", defines, source, info);
-#ifdef DEBUG_SHADERS
-        fprintf(stderr,
-            "Failed to compile shader:\n%s%s\n%s", defines, source, info);
-#endif
-        SDL_stack_free(info);
-
-        return SDL_FALSE;
-    } else {
-        return SDL_TRUE;
-    }
-}
-
-static SDL_bool
-CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data)
-{
-    const int num_tmus_bound = 4;
-    const char *vert_defines = "";
-    const char *frag_defines = "";
-    int i;
-    GLint location;
-
-    if (index == SHADER_NONE) {
-        return SDL_TRUE;
-    }
-
-    ctx->glGetError();
-
-    /* Make sure we use the correct sampler type for our texture type */
-    if (ctx->GL_ARB_texture_rectangle_supported) {
-        frag_defines =
-"#define sampler2D sampler2DRect\n"
-"#define texture2D texture2DRect\n";
-    }
-
-    /* Create one program object to rule them all */
-    data->program = ctx->glCreateProgramObjectARB();
-
-    /* Create the vertex shader */
-    data->vert_shader = ctx->glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
-    if (!CompileShader(ctx, data->vert_shader, vert_defines, shader_source[index][0])) {
-        return SDL_FALSE;
-    }
-
-    /* Create the fragment shader */
-    data->frag_shader = ctx->glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
-    if (!CompileShader(ctx, data->frag_shader, frag_defines, shader_source[index][1])) {
-        return SDL_FALSE;
-    }
-
-    /* ... and in the darkness bind them */
-    ctx->glAttachObjectARB(data->program, data->vert_shader);
-    ctx->glAttachObjectARB(data->program, data->frag_shader);
-    ctx->glLinkProgramARB(data->program);
-
-    /* Set up some uniform variables */
-    ctx->glUseProgramObjectARB(data->program);
-    for (i = 0; i < num_tmus_bound; ++i) {
-        char tex_name[10];
-        SDL_snprintf(tex_name, SDL_arraysize(tex_name), "tex%d", i);
-        location = ctx->glGetUniformLocationARB(data->program, tex_name);
-        if (location >= 0) {
-            ctx->glUniform1iARB(location, i);
-        }
-    }
-    ctx->glUseProgramObjectARB(0);
-
-    return (ctx->glGetError() == GL_NO_ERROR);
-}
-
-static void
-DestroyShaderProgram(GL_ShaderContext *ctx, GL_ShaderData *data)
-{
-    ctx->glDeleteObjectARB(data->vert_shader);
-    ctx->glDeleteObjectARB(data->frag_shader);
-    ctx->glDeleteObjectARB(data->program);
-}
-
-GL_ShaderContext *
-GL_CreateShaderContext()
-{
-    GL_ShaderContext *ctx;
-    SDL_bool shaders_supported;
-    int i;
-
-    ctx = (GL_ShaderContext *)SDL_calloc(1, sizeof(*ctx));
-    if (!ctx) {
-        return NULL;
-    }
-
-    if (SDL_GL_ExtensionSupported("GL_ARB_texture_rectangle")
-        || SDL_GL_ExtensionSupported("GL_EXT_texture_rectangle")) {
-        ctx->GL_ARB_texture_rectangle_supported = SDL_TRUE;
-    }
-
-    /* Check for shader support */
-    shaders_supported = SDL_FALSE;
-    if (SDL_GL_ExtensionSupported("GL_ARB_shader_objects") &&
-        SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") &&
-        SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") &&
-        SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) {
-        ctx->glGetError = (GLenum (*)(void)) SDL_GL_GetProcAddress("glGetError");
-        ctx->glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) SDL_GL_GetProcAddress("glAttachObjectARB");
-        ctx->glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) SDL_GL_GetProcAddress("glCompileShaderARB");
-        ctx->glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glCreateProgramObjectARB");
-        ctx->glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) SDL_GL_GetProcAddress("glCreateShaderObjectARB");
-        ctx->glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) SDL_GL_GetProcAddress("glDeleteObjectARB");
-        ctx->glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) SDL_GL_GetProcAddress("glGetInfoLogARB");
-        ctx->glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) SDL_GL_GetProcAddress("glGetObjectParameterivARB");
-        ctx->glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) SDL_GL_GetProcAddress("glGetUniformLocationARB");
-        ctx->glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) SDL_GL_GetProcAddress("glLinkProgramARB");
-        ctx->glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) SDL_GL_GetProcAddress("glShaderSourceARB");
-        ctx->glUniform1iARB = (PFNGLUNIFORM1IARBPROC) SDL_GL_GetProcAddress("glUniform1iARB");
-        ctx->glUniform1fARB = (PFNGLUNIFORM1FARBPROC) SDL_GL_GetProcAddress("glUniform1fARB");
-        ctx->glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glUseProgramObjectARB");
-        if (ctx->glGetError &&
-            ctx->glAttachObjectARB &&
-            ctx->glCompileShaderARB &&
-            ctx->glCreateProgramObjectARB &&
-            ctx->glCreateShaderObjectARB &&
-            ctx->glDeleteObjectARB &&
-            ctx->glGetInfoLogARB &&
-            ctx->glGetObjectParameterivARB &&
-            ctx->glGetUniformLocationARB &&
-            ctx->glLinkProgramARB &&
-            ctx->glShaderSourceARB &&
-            ctx->glUniform1iARB &&
-            ctx->glUniform1fARB &&
-            ctx->glUseProgramObjectARB) {
-            shaders_supported = SDL_TRUE;
-        }
-    }
-
-    if (!shaders_supported) {
-        SDL_free(ctx);
-        return NULL;
-    }
-
-    /* Compile all the shaders */
-    for (i = 0; i < NUM_SHADERS; ++i) {
-        if (!CompileShaderProgram(ctx, i, &ctx->shaders[i])) {
-            GL_DestroyShaderContext(ctx);
-            return NULL;
-        }
-    }
-
-    /* We're done! */
-    return ctx;
-}
-
-void
-GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader)
-{
-    ctx->glUseProgramObjectARB(ctx->shaders[shader].program);
-}
-
-void
-GL_DestroyShaderContext(GL_ShaderContext *ctx)
-{
-    int i;
-
-    for (i = 0; i < NUM_SHADERS; ++i) {
-        DestroyShaderProgram(ctx, &ctx->shaders[i]);
-    }
-    SDL_free(ctx);
-}
-
-#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/opengl/SDL_shaders_gl.h b/deps/SDL2/src/render/opengl/SDL_shaders_gl.h
deleted file mode 100644
index c4b7e0b..0000000
--- a/deps/SDL2/src/render/opengl/SDL_shaders_gl.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* OpenGL shader implementation */
-
-typedef enum {
-    SHADER_NONE,
-    SHADER_SOLID,
-    SHADER_RGB,
-    SHADER_YV12,
-    NUM_SHADERS
-} GL_Shader;
-
-typedef struct GL_ShaderContext GL_ShaderContext;
-
-extern GL_ShaderContext * GL_CreateShaderContext();
-extern void GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader);
-extern void GL_DestroyShaderContext(GL_ShaderContext *ctx);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/opengles/SDL_glesfuncs.h b/deps/SDL2/src/render/opengles/SDL_glesfuncs.h
deleted file mode 100644
index ff5ce76..0000000
--- a/deps/SDL2/src/render/opengles/SDL_glesfuncs.h
+++ /dev/null
@@ -1,42 +0,0 @@
-SDL_PROC(void, glBindTexture, (GLenum, GLuint))
-SDL_PROC(void, glBlendFunc, (GLenum, GLenum))
-SDL_PROC_OES(void, glBlendFuncSeparateOES, (GLenum, GLenum, GLenum, GLenum))
-SDL_PROC(void, glClear, (GLbitfield))
-SDL_PROC(void, glClearColor, (GLclampf, GLclampf, GLclampf, GLclampf))
-SDL_PROC(void, glColor4f, (GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glDeleteTextures, (GLsizei, const GLuint *))
-SDL_PROC(void, glDisable, (GLenum))
-SDL_PROC(void, glDisableClientState, (GLenum array))
-SDL_PROC(void, glDrawArrays, (GLenum, GLint, GLsizei))
-SDL_PROC_OES(void, glDrawTexfOES, (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glEnable, (GLenum))
-SDL_PROC(void, glEnableClientState, (GLenum))
-SDL_PROC(void, glFinish, (void))
-SDL_PROC_OES(void, glGenFramebuffersOES, (GLsizei, GLuint *))
-SDL_PROC(void, glGenTextures, (GLsizei, GLuint *))
-SDL_PROC(GLenum, glGetError, (void))
-SDL_PROC(void, glGetIntegerv, (GLenum, GLint *))
-SDL_PROC(void, glLoadIdentity, (void))
-SDL_PROC(void, glMatrixMode, (GLenum))
-SDL_PROC(void, glOrthof, (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glPixelStorei, (GLenum, GLint))
-SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*))
-SDL_PROC(void, glScissor, (GLint, GLint, GLsizei, GLsizei))
-SDL_PROC(void, glTexCoordPointer, (GLint, GLenum, GLsizei, const GLvoid *))
-SDL_PROC(void, glTexEnvf, (GLenum, GLenum, GLfloat))
-SDL_PROC(void, glTexImage2D, (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *))
-SDL_PROC(void, glTexParameteri, (GLenum, GLenum, GLint))
-SDL_PROC(void, glTexParameteriv, (GLenum, GLenum, const GLint *))
-SDL_PROC(void, glTexSubImage2D, (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *))
-SDL_PROC(void, glVertexPointer, (GLint, GLenum, GLsizei, const GLvoid *))
-SDL_PROC(void, glViewport, (GLint, GLint, GLsizei, GLsizei))
-SDL_PROC_OES(void, glBindFramebufferOES, (GLenum, GLuint))
-SDL_PROC_OES(void, glFramebufferTexture2DOES, (GLenum, GLenum, GLenum, GLuint, GLint))
-SDL_PROC_OES(GLenum, glCheckFramebufferStatusOES, (GLenum))
-SDL_PROC(void, glPushMatrix, (void))
-SDL_PROC(void, glTranslatef, (GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glRotatef, (GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glPopMatrix, (void))
-SDL_PROC_OES(void, glDeleteFramebuffersOES, (GLsizei, const GLuint*))
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/opengles/SDL_render_gles.c b/deps/SDL2/src/render/opengles/SDL_render_gles.c
deleted file mode 100644
index 3be1998..0000000
--- a/deps/SDL2/src/render/opengles/SDL_render_gles.c
+++ /dev/null
@@ -1,1169 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED
-
-#include "SDL_hints.h"
-#include "SDL_opengles.h"
-#include "../SDL_sysrender.h"
-
-#if defined(SDL_VIDEO_DRIVER_PANDORA)
-
-/* Empty function stub to get OpenGL ES 1.x support without  */
-/* OpenGL ES extension GL_OES_draw_texture supported         */
-GL_API void GL_APIENTRY
-glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
-{
-    return;
-}
-
-#endif /* PANDORA */
-
-/* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
-
-/* Used to re-create the window with OpenGL ES capability */
-extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
-
-static const float inv255f = 1.0f / 255.0f;
-
-static SDL_Renderer *GLES_CreateRenderer(SDL_Window * window, Uint32 flags);
-static void GLES_WindowEvent(SDL_Renderer * renderer,
-                             const SDL_WindowEvent *event);
-static int GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                              const SDL_Rect * rect, const void *pixels,
-                              int pitch);
-static int GLES_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                            const SDL_Rect * rect, void **pixels, int *pitch);
-static void GLES_UnlockTexture(SDL_Renderer * renderer,
-                               SDL_Texture * texture);
-static int GLES_SetRenderTarget(SDL_Renderer * renderer,
-                                 SDL_Texture * texture);
-static int GLES_UpdateViewport(SDL_Renderer * renderer);
-static int GLES_UpdateClipRect(SDL_Renderer * renderer);
-static int GLES_RenderClear(SDL_Renderer * renderer);
-static int GLES_RenderDrawPoints(SDL_Renderer * renderer,
-                                 const SDL_FPoint * points, int count);
-static int GLES_RenderDrawLines(SDL_Renderer * renderer,
-                                const SDL_FPoint * points, int count);
-static int GLES_RenderFillRects(SDL_Renderer * renderer,
-                                const SDL_FRect * rects, int count);
-static int GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-                           const SDL_Rect * srcrect,
-                           const SDL_FRect * dstrect);
-static int GLES_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-                         const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-                         const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip);
-static int GLES_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                    Uint32 pixel_format, void * pixels, int pitch);
-static void GLES_RenderPresent(SDL_Renderer * renderer);
-static void GLES_DestroyTexture(SDL_Renderer * renderer,
-                                SDL_Texture * texture);
-static void GLES_DestroyRenderer(SDL_Renderer * renderer);
-static int GLES_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh);
-static int GLES_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture);
-
-typedef struct GLES_FBOList GLES_FBOList;
-
-struct GLES_FBOList
-{
-   Uint32 w, h;
-   GLuint FBO;
-   GLES_FBOList *next;
-};
-
-
-SDL_RenderDriver GLES_RenderDriver = {
-    GLES_CreateRenderer,
-    {
-     "opengles",
-     (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC ),
-     1,
-     {SDL_PIXELFORMAT_ABGR8888},
-     0,
-     0}
-};
-
-typedef struct
-{
-    SDL_GLContext context;
-    struct {
-        Uint32 color;
-        int blendMode;
-        SDL_bool tex_coords;
-    } current;
-
-#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
-#define SDL_PROC_OES SDL_PROC
-#include "SDL_glesfuncs.h"
-#undef SDL_PROC
-#undef SDL_PROC_OES
-    SDL_bool GL_OES_framebuffer_object_supported;
-    GLES_FBOList *framebuffers;
-    GLuint window_framebuffer;
-
-    SDL_bool useDrawTexture;
-    SDL_bool GL_OES_draw_texture_supported;
-    SDL_bool GL_OES_blend_func_separate_supported;
-} GLES_RenderData;
-
-typedef struct
-{
-    GLuint texture;
-    GLenum type;
-    GLfloat texw;
-    GLfloat texh;
-    GLenum format;
-    GLenum formattype;
-    void *pixels;
-    int pitch;
-    GLES_FBOList *fbo;
-} GLES_TextureData;
-
-static int
-GLES_SetError(const char *prefix, GLenum result)
-{
-    const char *error;
-
-    switch (result) {
-    case GL_NO_ERROR:
-        error = "GL_NO_ERROR";
-        break;
-    case GL_INVALID_ENUM:
-        error = "GL_INVALID_ENUM";
-        break;
-    case GL_INVALID_VALUE:
-        error = "GL_INVALID_VALUE";
-        break;
-    case GL_INVALID_OPERATION:
-        error = "GL_INVALID_OPERATION";
-        break;
-    case GL_STACK_OVERFLOW:
-        error = "GL_STACK_OVERFLOW";
-        break;
-    case GL_STACK_UNDERFLOW:
-        error = "GL_STACK_UNDERFLOW";
-        break;
-    case GL_OUT_OF_MEMORY:
-        error = "GL_OUT_OF_MEMORY";
-        break;
-    default:
-        error = "UNKNOWN";
-        break;
-    }
-    return SDL_SetError("%s: %s", prefix, error);
-}
-
-static int GLES_LoadFunctions(GLES_RenderData * data)
-{
-#if SDL_VIDEO_DRIVER_UIKIT
-#define __SDL_NOGETPROCADDR__
-#elif SDL_VIDEO_DRIVER_ANDROID
-#define __SDL_NOGETPROCADDR__
-#elif SDL_VIDEO_DRIVER_PANDORA
-#define __SDL_NOGETPROCADDR__
-#endif
-
-#ifdef __SDL_NOGETPROCADDR__
-#define SDL_PROC(ret,func,params) data->func=func;
-#define SDL_PROC_OES(ret,func,params) data->func=func;
-#else
-#define SDL_PROC(ret,func,params) \
-    do { \
-        data->func = SDL_GL_GetProcAddress(#func); \
-        if ( ! data->func ) { \
-            return SDL_SetError("Couldn't load GLES function %s: %s\n", #func, SDL_GetError()); \
-        } \
-    } while ( 0 );
-#define SDL_PROC_OES(ret,func,params) \
-    do { \
-        data->func = SDL_GL_GetProcAddress(#func); \
-    } while ( 0 );    
-#endif /* _SDL_NOGETPROCADDR_ */
-
-#include "SDL_glesfuncs.h"
-#undef SDL_PROC
-#undef SDL_PROC_OES
-    return 0;
-}
-
-static SDL_GLContext SDL_CurrentContext = NULL;
-
-GLES_FBOList *
-GLES_GetFBO(GLES_RenderData *data, Uint32 w, Uint32 h)
-{
-   GLES_FBOList *result = data->framebuffers;
-   while ((result) && ((result->w != w) || (result->h != h)) )
-   {
-       result = result->next;
-   }
-   if (result == NULL)
-   {
-       result = SDL_malloc(sizeof(GLES_FBOList));
-       result->w = w;
-       result->h = h;
-       data->glGenFramebuffersOES(1, &result->FBO);
-       result->next = data->framebuffers;
-       data->framebuffers = result;
-   }
-   return result;
-}
-
-
-static int
-GLES_ActivateRenderer(SDL_Renderer * renderer)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
-    if (SDL_CurrentContext != data->context) {
-        if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) {
-            return -1;
-        }
-        SDL_CurrentContext = data->context;
-
-        GLES_UpdateViewport(renderer);
-    }
-    return 0;
-}
-
-/* This is called if we need to invalidate all of the SDL OpenGL state */
-static void
-GLES_ResetState(SDL_Renderer *renderer)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
-    if (SDL_CurrentContext == data->context) {
-        GLES_UpdateViewport(renderer);
-    } else {
-        GLES_ActivateRenderer(renderer);
-    }
-
-    data->current.color = 0;
-    data->current.blendMode = -1;
-    data->current.tex_coords = SDL_FALSE;
-
-    data->glDisable(GL_DEPTH_TEST);
-    data->glDisable(GL_CULL_FACE);
-
-    data->glMatrixMode(GL_MODELVIEW);
-    data->glLoadIdentity();
-
-    data->glEnableClientState(GL_VERTEX_ARRAY);
-    data->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-}
-
-SDL_Renderer *
-GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
-{
-
-    SDL_Renderer *renderer;
-    GLES_RenderData *data;
-    GLint value;
-    Uint32 windowFlags;
-
-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
-
-    windowFlags = SDL_GetWindowFlags(window);
-    if (!(windowFlags & SDL_WINDOW_OPENGL)) {
-        if (SDL_RecreateWindow(window, windowFlags | SDL_WINDOW_OPENGL) < 0) {
-            /* Uh oh, better try to put it back... */
-            SDL_RecreateWindow(window, windowFlags);
-            return NULL;
-        }
-    }
-
-    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
-    if (!renderer) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    data = (GLES_RenderData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        GLES_DestroyRenderer(renderer);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    renderer->WindowEvent = GLES_WindowEvent;
-    renderer->CreateTexture = GLES_CreateTexture;
-    renderer->UpdateTexture = GLES_UpdateTexture;
-    renderer->LockTexture = GLES_LockTexture;
-    renderer->UnlockTexture = GLES_UnlockTexture;
-    renderer->SetRenderTarget = GLES_SetRenderTarget;
-    renderer->UpdateViewport = GLES_UpdateViewport;
-    renderer->UpdateClipRect = GLES_UpdateClipRect;
-    renderer->RenderClear = GLES_RenderClear;
-    renderer->RenderDrawPoints = GLES_RenderDrawPoints;
-    renderer->RenderDrawLines = GLES_RenderDrawLines;
-    renderer->RenderFillRects = GLES_RenderFillRects;
-    renderer->RenderCopy = GLES_RenderCopy;
-    renderer->RenderCopyEx = GLES_RenderCopyEx;
-    renderer->RenderReadPixels = GLES_RenderReadPixels;
-    renderer->RenderPresent = GLES_RenderPresent;
-    renderer->DestroyTexture = GLES_DestroyTexture;
-    renderer->DestroyRenderer = GLES_DestroyRenderer;
-    renderer->GL_BindTexture = GLES_BindTexture;
-    renderer->GL_UnbindTexture = GLES_UnbindTexture;
-    renderer->info = GLES_RenderDriver.info;
-    renderer->info.flags = SDL_RENDERER_ACCELERATED;
-    renderer->driverdata = data;
-    renderer->window = window;
-
-    data->context = SDL_GL_CreateContext(window);
-    if (!data->context) {
-        GLES_DestroyRenderer(renderer);
-        return NULL;
-    }
-    if (SDL_GL_MakeCurrent(window, data->context) < 0) {
-        GLES_DestroyRenderer(renderer);
-        return NULL;
-    }
-
-    if (GLES_LoadFunctions(data) < 0) {
-        GLES_DestroyRenderer(renderer);
-        return NULL;
-    }
-
-    if (flags & SDL_RENDERER_PRESENTVSYNC) {
-        SDL_GL_SetSwapInterval(1);
-    } else {
-        SDL_GL_SetSwapInterval(0);
-    }
-    if (SDL_GL_GetSwapInterval() > 0) {
-        renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
-    }
-
-#if SDL_VIDEO_DRIVER_PANDORA
-    data->GL_OES_draw_texture_supported = SDL_FALSE;
-    data->useDrawTexture = SDL_FALSE;
-#else
-    if (SDL_GL_ExtensionSupported("GL_OES_draw_texture")) {
-        data->GL_OES_draw_texture_supported = SDL_TRUE;
-        data->useDrawTexture = SDL_TRUE;
-    } else {
-        data->GL_OES_draw_texture_supported = SDL_FALSE;
-        data->useDrawTexture = SDL_FALSE;
-    }
-#endif
-
-    value = 0;
-    data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
-    renderer->info.max_texture_width = value;
-    value = 0;
-    data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
-    renderer->info.max_texture_height = value;
-
-    /* Android does not report GL_OES_framebuffer_object but the functionality seems to be there anyway */
-    if (SDL_GL_ExtensionSupported("GL_OES_framebuffer_object") || data->glGenFramebuffersOES) {
-        data->GL_OES_framebuffer_object_supported = SDL_TRUE;
-        renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
-
-        value = 0;
-        data->glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &value);
-        data->window_framebuffer = (GLuint)value;
-    }
-    data->framebuffers = NULL;
-
-    if (SDL_GL_ExtensionSupported("GL_OES_blend_func_separate")) {
-        data->GL_OES_blend_func_separate_supported = SDL_TRUE;
-    }
-
-    /* Set up parameters for rendering */
-    GLES_ResetState(renderer);
-
-    return renderer;
-}
-
-static void
-GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
-    if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED ||
-        event->event == SDL_WINDOWEVENT_SHOWN ||
-        event->event == SDL_WINDOWEVENT_HIDDEN) {
-        /* Rebind the context to the window area and update matrices */
-        SDL_CurrentContext = NULL;
-    }
-
-    if (event->event == SDL_WINDOWEVENT_MINIMIZED) {
-        /* According to Apple documentation, we need to finish drawing NOW! */
-        data->glFinish();
-    }
-}
-
-static SDL_INLINE int
-power_of_2(int input)
-{
-    int value = 1;
-
-    while (value < input) {
-        value <<= 1;
-    }
-    return value;
-}
-
-static GLenum
-GetScaleQuality(void)
-{
-    const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
-
-    if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
-        return GL_NEAREST;
-    } else {
-        return GL_LINEAR;
-    }
-}
-
-static int
-GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
-    GLES_TextureData *data;
-    GLint internalFormat;
-    GLenum format, type;
-    int texture_w, texture_h;
-    GLenum scaleMode;
-    GLenum result;
-
-    GLES_ActivateRenderer(renderer);
-
-    switch (texture->format) {
-    case SDL_PIXELFORMAT_ABGR8888:
-        internalFormat = GL_RGBA;
-        format = GL_RGBA;
-        type = GL_UNSIGNED_BYTE;
-        break;
-    default:
-        return SDL_SetError("Texture format not supported");
-    }
-
-    data = (GLES_TextureData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        return SDL_OutOfMemory();
-    }
-
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
-        data->pixels = SDL_calloc(1, texture->h * data->pitch);
-        if (!data->pixels) {
-            SDL_free(data);
-            return SDL_OutOfMemory();
-        }
-    }
-
-    
-    if (texture->access == SDL_TEXTUREACCESS_TARGET) {
-        if (!renderdata->GL_OES_framebuffer_object_supported) {
-            SDL_free(data);
-            return SDL_SetError("GL_OES_framebuffer_object not supported");
-        }
-        data->fbo = GLES_GetFBO(renderer->driverdata, texture->w, texture->h);
-    } else {
-        data->fbo = NULL;
-    }
-    
-
-    renderdata->glGetError();
-    renderdata->glEnable(GL_TEXTURE_2D);
-    renderdata->glGenTextures(1, &data->texture);
-    result = renderdata->glGetError();
-    if (result != GL_NO_ERROR) {
-        SDL_free(data);
-        return GLES_SetError("glGenTextures()", result);
-    }
-
-    data->type = GL_TEXTURE_2D;
-    /* no NPOV textures allowed in OpenGL ES (yet) */
-    texture_w = power_of_2(texture->w);
-    texture_h = power_of_2(texture->h);
-    data->texw = (GLfloat) texture->w / texture_w;
-    data->texh = (GLfloat) texture->h / texture_h;
-
-    data->format = format;
-    data->formattype = type;
-    scaleMode = GetScaleQuality();
-    renderdata->glBindTexture(data->type, data->texture);
-    renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER, scaleMode);
-    renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER, scaleMode);
-    renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-    renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
-    renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
-                             texture_h, 0, format, type, NULL);
-    renderdata->glDisable(GL_TEXTURE_2D);
-
-    result = renderdata->glGetError();
-    if (result != GL_NO_ERROR) {
-        SDL_free(data);
-        return GLES_SetError("glTexImage2D()", result);
-    }
-    
-    texture->driverdata = data;
-    return 0;
-}
-
-static int
-GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                   const SDL_Rect * rect, const void *pixels, int pitch)
-{
-    GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
-    GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
-    Uint8 *blob = NULL;
-    Uint8 *src;
-    int srcPitch;
-    int y;
-
-    GLES_ActivateRenderer(renderer);
-
-    /* Bail out if we're supposed to update an empty rectangle */
-    if (rect->w <= 0 || rect->h <= 0)
-        return 0;
-
-    /* Reformat the texture data into a tightly packed array */
-    srcPitch = rect->w * SDL_BYTESPERPIXEL(texture->format);
-    src = (Uint8 *)pixels;
-    if (pitch != srcPitch) {
-        blob = (Uint8 *)SDL_malloc(srcPitch * rect->h);
-        if (!blob) {
-            return SDL_OutOfMemory();
-        }
-        src = blob;
-        for (y = 0; y < rect->h; ++y) {
-            SDL_memcpy(src, pixels, srcPitch);
-            src += srcPitch;
-            pixels = (Uint8 *)pixels + pitch;
-        }
-        src = blob;
-    }
-
-    /* Create a texture subimage with the supplied data */
-    renderdata->glGetError();
-    renderdata->glEnable(data->type);
-    renderdata->glBindTexture(data->type, data->texture);
-    renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-    renderdata->glTexSubImage2D(data->type,
-                    0,
-                    rect->x,
-                    rect->y,
-                    rect->w,
-                    rect->h,
-                    data->format,
-                    data->formattype,
-                    src);
-    SDL_free(blob);
-
-    if (renderdata->glGetError() != GL_NO_ERROR)
-    {
-        return SDL_SetError("Failed to update texture");
-    }
-    return 0;
-}
-
-static int
-GLES_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                 const SDL_Rect * rect, void **pixels, int *pitch)
-{
-    GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
-
-    *pixels =
-        (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
-                  rect->x * SDL_BYTESPERPIXEL(texture->format));
-    *pitch = data->pitch;
-    return 0;
-}
-
-static void
-GLES_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
-    SDL_Rect rect;
-
-    /* We do whole texture updates, at least for now */
-    rect.x = 0;
-    rect.y = 0;
-    rect.w = texture->w;
-    rect.h = texture->h;
-    GLES_UpdateTexture(renderer, texture, &rect, data->pixels, data->pitch);
-}
-
-static int
-GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-    GLES_TextureData *texturedata = NULL;
-    GLenum status;
-
-    GLES_ActivateRenderer(renderer);
-    
-    if (!data->GL_OES_framebuffer_object_supported) {
-        return SDL_SetError("Can't enable render target support in this renderer");
-    }
-
-    if (texture == NULL) {
-        data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, data->window_framebuffer);
-        return 0;
-    }
-
-    texturedata = (GLES_TextureData *) texture->driverdata;
-    data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, texturedata->fbo->FBO);
-    /* TODO: check if texture pixel format allows this operation */
-    data->glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, texturedata->type, texturedata->texture, 0);
-    /* Check FBO status */
-    status = data->glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
-    if (status != GL_FRAMEBUFFER_COMPLETE_OES) {
-        return SDL_SetError("glFramebufferTexture2DOES() failed");
-    }
-    return 0;
-}
-
-static int
-GLES_UpdateViewport(SDL_Renderer * renderer)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
-    if (SDL_CurrentContext != data->context) {
-        /* We'll update the viewport after we rebind the context */
-        return 0;
-    }
-
-    data->glViewport(renderer->viewport.x, renderer->viewport.y,
-               renderer->viewport.w, renderer->viewport.h);
-
-    if (renderer->viewport.w && renderer->viewport.h) {
-        data->glMatrixMode(GL_PROJECTION);
-        data->glLoadIdentity();
-        data->glOrthof((GLfloat) 0,
-                 (GLfloat) renderer->viewport.w,
-                 (GLfloat) renderer->viewport.h,
-                 (GLfloat) 0, 0.0, 1.0);
-    }
-    return 0;
-}
-
-static int
-GLES_UpdateClipRect(SDL_Renderer * renderer)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-    const SDL_Rect *rect = &renderer->clip_rect;
-
-    if (SDL_CurrentContext != data->context) {
-        /* We'll update the clip rect after we rebind the context */
-        return 0;
-    }
-
-    if (!SDL_RectEmpty(rect)) {
-        data->glEnable(GL_SCISSOR_TEST);
-        data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h);
-    } else {
-        data->glDisable(GL_SCISSOR_TEST);
-    }
-    return 0;
-}
-
-static void
-GLES_SetColor(GLES_RenderData * data, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    Uint32 color = ((a << 24) | (r << 16) | (g << 8) | b);
-
-    if (color != data->current.color) {
-        data->glColor4f((GLfloat) r * inv255f,
-                        (GLfloat) g * inv255f,
-                        (GLfloat) b * inv255f,
-                        (GLfloat) a * inv255f);
-        data->current.color = color;
-    }
-}
-
-static void
-GLES_SetBlendMode(GLES_RenderData * data, int blendMode)
-{
-    if (blendMode != data->current.blendMode) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_NONE:
-            data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-            data->glDisable(GL_BLEND);
-            break;
-        case SDL_BLENDMODE_BLEND:
-            data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-            data->glEnable(GL_BLEND);
-            if (data->GL_OES_blend_func_separate_supported) {
-                data->glBlendFuncSeparateOES(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-            } else {
-                data->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-            }
-            break;
-        case SDL_BLENDMODE_ADD:
-            data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-            data->glEnable(GL_BLEND);
-            if (data->GL_OES_blend_func_separate_supported) {
-                data->glBlendFuncSeparateOES(GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_ONE);
-            } else {
-                data->glBlendFunc(GL_SRC_ALPHA, GL_ONE);
-            }
-            break;
-        case SDL_BLENDMODE_MOD:
-            data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-            data->glEnable(GL_BLEND);
-            if (data->GL_OES_blend_func_separate_supported) {
-                data->glBlendFuncSeparateOES(GL_ZERO, GL_SRC_COLOR, GL_ZERO, GL_ONE);
-            } else {
-                data->glBlendFunc(GL_ZERO, GL_SRC_COLOR);
-            }
-            break;
-        }
-        data->current.blendMode = blendMode;
-    }
-}
-
-static void
-GLES_SetTexCoords(GLES_RenderData * data, SDL_bool enabled)
-{
-    if (enabled != data->current.tex_coords) {
-        if (enabled) {
-            data->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-        } else {
-            data->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-        }
-        data->current.tex_coords = enabled;
-    }
-}
-
-static void
-GLES_SetDrawingState(SDL_Renderer * renderer)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
-    GLES_ActivateRenderer(renderer);
-
-    GLES_SetColor(data, (GLfloat) renderer->r,
-                        (GLfloat) renderer->g,
-                        (GLfloat) renderer->b,
-                        (GLfloat) renderer->a);
-
-    GLES_SetBlendMode(data, renderer->blendMode);
-
-    GLES_SetTexCoords(data, SDL_FALSE);
-}
-
-static int
-GLES_RenderClear(SDL_Renderer * renderer)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
-    GLES_ActivateRenderer(renderer);
-
-    data->glClearColor((GLfloat) renderer->r * inv255f,
-                 (GLfloat) renderer->g * inv255f,
-                 (GLfloat) renderer->b * inv255f,
-                 (GLfloat) renderer->a * inv255f);
-
-    data->glClear(GL_COLOR_BUFFER_BIT);
-
-    return 0;
-}
-
-static int
-GLES_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points,
-                      int count)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
-    GLES_SetDrawingState(renderer);
-
-    data->glVertexPointer(2, GL_FLOAT, 0, points);
-    data->glDrawArrays(GL_POINTS, 0, count);
-
-    return 0;
-}
-
-static int
-GLES_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points,
-                     int count)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
-    GLES_SetDrawingState(renderer);
-
-    data->glVertexPointer(2, GL_FLOAT, 0, points);
-    if (count > 2 &&
-        points[0].x == points[count-1].x && points[0].y == points[count-1].y) {
-        /* GL_LINE_LOOP takes care of the final segment */
-        --count;
-        data->glDrawArrays(GL_LINE_LOOP, 0, count);
-    } else {
-        data->glDrawArrays(GL_LINE_STRIP, 0, count);
-        /* We need to close the endpoint of the line */
-        data->glDrawArrays(GL_POINTS, count-1, 1);
-    }
-
-    return 0;
-}
-
-static int
-GLES_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects,
-                     int count)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-    int i;
-
-    GLES_SetDrawingState(renderer);
-
-    for (i = 0; i < count; ++i) {
-        const SDL_FRect *rect = &rects[i];
-        GLfloat minx = rect->x;
-        GLfloat maxx = rect->x + rect->w;
-        GLfloat miny = rect->y;
-        GLfloat maxy = rect->y + rect->h;
-        GLfloat vertices[8];
-        vertices[0] = minx;
-        vertices[1] = miny;
-        vertices[2] = maxx;
-        vertices[3] = miny;
-        vertices[4] = minx;
-        vertices[5] = maxy;
-        vertices[6] = maxx;
-        vertices[7] = maxy;
-
-        data->glVertexPointer(2, GL_FLOAT, 0, vertices);
-        data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-    }
-
-    return 0;
-}
-
-static int
-GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-                const SDL_Rect * srcrect, const SDL_FRect * dstrect)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-    GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
-    GLfloat minx, miny, maxx, maxy;
-    GLfloat minu, maxu, minv, maxv;
-    GLfloat vertices[8];
-    GLfloat texCoords[8];
-
-    GLES_ActivateRenderer(renderer);
-
-    data->glEnable(GL_TEXTURE_2D);
-
-    data->glBindTexture(texturedata->type, texturedata->texture);
-
-    if (texture->modMode) {
-        GLES_SetColor(data, texture->r, texture->g, texture->b, texture->a);
-    } else {
-        GLES_SetColor(data, 255, 255, 255, 255);
-    }
-
-    GLES_SetBlendMode(data, texture->blendMode);
-
-    GLES_SetTexCoords(data, SDL_TRUE);
-
-    if (data->GL_OES_draw_texture_supported && data->useDrawTexture) {
-        /* this code is a little funny because the viewport is upside down vs SDL's coordinate system */
-        GLint cropRect[4];
-        int w, h;
-        SDL_Window *window = renderer->window;
-
-        SDL_GetWindowSize(window, &w, &h);
-        if (renderer->target) {
-            cropRect[0] = srcrect->x;
-            cropRect[1] = srcrect->y;
-            cropRect[2] = srcrect->w;
-            cropRect[3] = srcrect->h;
-            data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES,
-                                   cropRect);
-            data->glDrawTexfOES(renderer->viewport.x + dstrect->x, renderer->viewport.y + dstrect->y, 0,
-                                dstrect->w, dstrect->h);
-        } else {
-            cropRect[0] = srcrect->x;
-            cropRect[1] = srcrect->y + srcrect->h;
-            cropRect[2] = srcrect->w;
-            cropRect[3] = -srcrect->h;
-            data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES,
-                                   cropRect);
-            data->glDrawTexfOES(renderer->viewport.x + dstrect->x,
-                        h - (renderer->viewport.y + dstrect->y) - dstrect->h, 0,
-                        dstrect->w, dstrect->h);
-        }
-    } else {
-
-        minx = dstrect->x;
-        miny = dstrect->y;
-        maxx = dstrect->x + dstrect->w;
-        maxy = dstrect->y + dstrect->h;
-
-        minu = (GLfloat) srcrect->x / texture->w;
-        minu *= texturedata->texw;
-        maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
-        maxu *= texturedata->texw;
-        minv = (GLfloat) srcrect->y / texture->h;
-        minv *= texturedata->texh;
-        maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
-        maxv *= texturedata->texh;
-
-        vertices[0] = minx;
-        vertices[1] = miny;
-        vertices[2] = maxx;
-        vertices[3] = miny;
-        vertices[4] = minx;
-        vertices[5] = maxy;
-        vertices[6] = maxx;
-        vertices[7] = maxy;
-
-        texCoords[0] = minu;
-        texCoords[1] = minv;
-        texCoords[2] = maxu;
-        texCoords[3] = minv;
-        texCoords[4] = minu;
-        texCoords[5] = maxv;
-        texCoords[6] = maxu;
-        texCoords[7] = maxv;
-
-        data->glVertexPointer(2, GL_FLOAT, 0, vertices);
-        data->glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
-        data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-    }
-    data->glDisable(GL_TEXTURE_2D);
-
-    return 0;
-}
-
-static int
-GLES_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-                const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-                const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
-{
-
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-    GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
-    GLfloat minx, miny, maxx, maxy;
-    GLfloat minu, maxu, minv, maxv;
-    GLfloat centerx, centery;
-    GLfloat vertices[8];
-    GLfloat texCoords[8];
-
-
-    GLES_ActivateRenderer(renderer);
-
-    data->glEnable(GL_TEXTURE_2D);
-
-    data->glBindTexture(texturedata->type, texturedata->texture);
-
-    if (texture->modMode) {
-        GLES_SetColor(data, texture->r, texture->g, texture->b, texture->a);
-    } else {
-        GLES_SetColor(data, 255, 255, 255, 255);
-    }
-
-    GLES_SetBlendMode(data, texture->blendMode);
-
-    GLES_SetTexCoords(data, SDL_TRUE);
-
-    centerx = center->x;
-    centery = center->y;
-
-    /* Rotate and translate */
-    data->glPushMatrix();
-    data->glTranslatef(dstrect->x + centerx, dstrect->y + centery, 0.0f);
-    data->glRotatef((GLfloat)angle, 0.0f, 0.0f, 1.0f);
-
-    if (flip & SDL_FLIP_HORIZONTAL) {
-        minx =  dstrect->w - centerx;
-        maxx = -centerx;
-    } else {
-        minx = -centerx;
-        maxx = dstrect->w - centerx;
-    }
-
-    if (flip & SDL_FLIP_VERTICAL) {
-        miny = dstrect->h - centery;
-        maxy = -centery;
-    } else {
-        miny = -centery;
-        maxy = dstrect->h - centery;
-    }
-
-    minu = (GLfloat) srcrect->x / texture->w;
-    minu *= texturedata->texw;
-    maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
-    maxu *= texturedata->texw;
-    minv = (GLfloat) srcrect->y / texture->h;
-    minv *= texturedata->texh;
-    maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
-    maxv *= texturedata->texh;
-
-    vertices[0] = minx;
-    vertices[1] = miny;
-    vertices[2] = maxx;
-    vertices[3] = miny;
-    vertices[4] = minx;
-    vertices[5] = maxy;
-    vertices[6] = maxx;
-    vertices[7] = maxy;
-
-    texCoords[0] = minu;
-    texCoords[1] = minv;
-    texCoords[2] = maxu;
-    texCoords[3] = minv;
-    texCoords[4] = minu;
-    texCoords[5] = maxv;
-    texCoords[6] = maxu;
-    texCoords[7] = maxv;
-    data->glVertexPointer(2, GL_FLOAT, 0, vertices);
-    data->glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
-    data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-    data->glPopMatrix();
-    data->glDisable(GL_TEXTURE_2D);
-
-    return 0;
-}
-
-static int
-GLES_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                    Uint32 pixel_format, void * pixels, int pitch)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-    Uint32 temp_format = SDL_PIXELFORMAT_ABGR8888;
-    void *temp_pixels;
-    int temp_pitch;
-    Uint8 *src, *dst, *tmp;
-    int w, h, length, rows;
-    int status;
-
-    GLES_ActivateRenderer(renderer);
-
-    temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format);
-    temp_pixels = SDL_malloc(rect->h * temp_pitch);
-    if (!temp_pixels) {
-        return SDL_OutOfMemory();
-    }
-
-    SDL_GetRendererOutputSize(renderer, &w, &h);
-
-    data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
-
-    data->glReadPixels(rect->x, (h-rect->y)-rect->h, rect->w, rect->h,
-                       GL_RGBA, GL_UNSIGNED_BYTE, temp_pixels);
-
-    /* Flip the rows to be top-down */
-    length = rect->w * SDL_BYTESPERPIXEL(temp_format);
-    src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch;
-    dst = (Uint8*)temp_pixels;
-    tmp = SDL_stack_alloc(Uint8, length);
-    rows = rect->h / 2;
-    while (rows--) {
-        SDL_memcpy(tmp, dst, length);
-        SDL_memcpy(dst, src, length);
-        SDL_memcpy(src, tmp, length);
-        dst += temp_pitch;
-        src -= temp_pitch;
-    }
-    SDL_stack_free(tmp);
-
-    status = SDL_ConvertPixels(rect->w, rect->h,
-                               temp_format, temp_pixels, temp_pitch,
-                               pixel_format, pixels, pitch);
-    SDL_free(temp_pixels);
-
-    return status;
-}
-
-static void
-GLES_RenderPresent(SDL_Renderer * renderer)
-{
-    GLES_ActivateRenderer(renderer);
-
-    SDL_GL_SwapWindow(renderer->window);
-}
-
-static void
-GLES_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
-
-    GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
-
-    GLES_ActivateRenderer(renderer);
-
-    if (!data) {
-        return;
-    }
-    if (data->texture) {
-        renderdata->glDeleteTextures(1, &data->texture);
-    }
-    SDL_free(data->pixels);
-    SDL_free(data);
-    texture->driverdata = NULL;
-}
-
-static void
-GLES_DestroyRenderer(SDL_Renderer * renderer)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
-    if (data) {
-        if (data->context) {
-            while (data->framebuffers) {
-               GLES_FBOList *nextnode = data->framebuffers->next;
-               data->glDeleteFramebuffersOES(1, &data->framebuffers->FBO);
-               SDL_free(data->framebuffers);
-               data->framebuffers = nextnode;
-            }
-            SDL_GL_DeleteContext(data->context);
-        }
-        SDL_free(data);
-    }
-    SDL_free(renderer);
-}
-
-static int GLES_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-    GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
-    GLES_ActivateRenderer(renderer);
-
-    data->glEnable(GL_TEXTURE_2D);
-    data->glBindTexture(texturedata->type, texturedata->texture);
-
-    if(texw) *texw = (float)texturedata->texw;
-    if(texh) *texh = (float)texturedata->texh;
-
-    return 0;
-}
-
-static int GLES_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture)
-{
-    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-    GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
-    GLES_ActivateRenderer(renderer);
-    data->glDisable(texturedata->type);
-
-    return 0;
-}
-
-#endif /* SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/opengles2/SDL_gles2funcs.h b/deps/SDL2/src/render/opengles2/SDL_gles2funcs.h
deleted file mode 100644
index b201bdf..0000000
--- a/deps/SDL2/src/render/opengles2/SDL_gles2funcs.h
+++ /dev/null
@@ -1,48 +0,0 @@
-SDL_PROC(void, glActiveTexture, (GLenum))
-SDL_PROC(void, glAttachShader, (GLuint, GLuint))
-SDL_PROC(void, glBindAttribLocation, (GLuint, GLuint, const char *))
-SDL_PROC(void, glBindTexture, (GLenum, GLuint))
-SDL_PROC(void, glBlendFuncSeparate, (GLenum, GLenum, GLenum, GLenum))
-SDL_PROC(void, glClear, (GLbitfield))
-SDL_PROC(void, glClearColor, (GLclampf, GLclampf, GLclampf, GLclampf))
-SDL_PROC(void, glCompileShader, (GLuint))
-SDL_PROC(GLuint, glCreateProgram, (void))
-SDL_PROC(GLuint, glCreateShader, (GLenum))
-SDL_PROC(void, glDeleteProgram, (GLuint))
-SDL_PROC(void, glDeleteShader, (GLuint))
-SDL_PROC(void, glDeleteTextures, (GLsizei, const GLuint *))
-SDL_PROC(void, glDisable, (GLenum))
-SDL_PROC(void, glDisableVertexAttribArray, (GLuint))
-SDL_PROC(void, glDrawArrays, (GLenum, GLint, GLsizei))
-SDL_PROC(void, glEnable, (GLenum))
-SDL_PROC(void, glEnableVertexAttribArray, (GLuint))
-SDL_PROC(void, glFinish, (void))
-SDL_PROC(void, glGenFramebuffers, (GLsizei, GLuint *))
-SDL_PROC(void, glGenTextures, (GLsizei, GLuint *))
-SDL_PROC(void, glGetBooleanv, (GLenum, GLboolean *))
-SDL_PROC(const GLubyte *, glGetString, (GLenum))
-SDL_PROC(GLenum, glGetError, (void))
-SDL_PROC(void, glGetIntegerv, (GLenum, GLint *))
-SDL_PROC(void, glGetProgramiv, (GLuint, GLenum, GLint *))
-SDL_PROC(void, glGetShaderInfoLog, (GLuint, GLsizei, GLsizei *, char *))
-SDL_PROC(void, glGetShaderiv, (GLuint, GLenum, GLint *))
-SDL_PROC(GLint, glGetUniformLocation, (GLuint, const char *))
-SDL_PROC(void, glLinkProgram, (GLuint))
-SDL_PROC(void, glPixelStorei, (GLenum, GLint))
-SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*))
-SDL_PROC(void, glScissor, (GLint, GLint, GLsizei, GLsizei))
-SDL_PROC(void, glShaderBinary, (GLsizei, const GLuint *, GLenum, const void *, GLsizei))
-SDL_PROC(void, glShaderSource, (GLuint, GLsizei, const char **, const GLint *))
-SDL_PROC(void, glTexImage2D, (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *))
-SDL_PROC(void, glTexParameteri, (GLenum, GLenum, GLint))
-SDL_PROC(void, glTexSubImage2D, (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *))
-SDL_PROC(void, glUniform1i, (GLint, GLint))
-SDL_PROC(void, glUniform4f, (GLint, GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glUniformMatrix4fv, (GLint, GLsizei, GLboolean, const GLfloat *))
-SDL_PROC(void, glUseProgram, (GLuint))
-SDL_PROC(void, glVertexAttribPointer, (GLuint, GLint, GLenum, GLboolean, GLsizei, const void *))
-SDL_PROC(void, glViewport, (GLint, GLint, GLsizei, GLsizei))
-SDL_PROC(void, glBindFramebuffer, (GLenum, GLuint))
-SDL_PROC(void, glFramebufferTexture2D, (GLenum, GLenum, GLenum, GLuint, GLint))
-SDL_PROC(GLenum, glCheckFramebufferStatus, (GLenum))
-SDL_PROC(void, glDeleteFramebuffers, (GLsizei, const GLuint *))
diff --git a/deps/SDL2/src/render/opengles2/SDL_render_gles2.c b/deps/SDL2/src/render/opengles2/SDL_render_gles2.c
deleted file mode 100644
index 31a1598..0000000
--- a/deps/SDL2/src/render/opengles2/SDL_render_gles2.c
+++ /dev/null
@@ -1,1856 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
-
-#include "SDL_hints.h"
-#include "SDL_opengles2.h"
-#include "../SDL_sysrender.h"
-#include "../../video/SDL_blit.h"
-#include "SDL_shaders_gles2.h"
-
-/* Used to re-create the window with OpenGL ES capability */
-extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
-
-/*************************************************************************************************
- * Bootstrap data                                                                                *
- *************************************************************************************************/
-
-static SDL_Renderer *GLES2_CreateRenderer(SDL_Window *window, Uint32 flags);
-
-SDL_RenderDriver GLES2_RenderDriver = {
-    GLES2_CreateRenderer,
-    {
-        "opengles2",
-        (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE),
-        4,
-        {SDL_PIXELFORMAT_ABGR8888,
-        SDL_PIXELFORMAT_ARGB8888,
-        SDL_PIXELFORMAT_RGB888,
-        SDL_PIXELFORMAT_BGR888},
-        0,
-        0
-    }
-};
-
-/*************************************************************************************************
- * Context structures                                                                            *
- *************************************************************************************************/
-
-typedef struct GLES2_FBOList GLES2_FBOList;
-
-struct GLES2_FBOList
-{
-   Uint32 w, h;
-   GLuint FBO;
-   GLES2_FBOList *next;
-};
-
-typedef struct GLES2_TextureData
-{
-    GLenum texture;
-    GLenum texture_type;
-    GLenum pixel_format;
-    GLenum pixel_type;
-    void *pixel_data;
-    size_t pitch;
-    GLES2_FBOList *fbo;
-} GLES2_TextureData;
-
-typedef struct GLES2_ShaderCacheEntry
-{
-    GLuint id;
-    GLES2_ShaderType type;
-    const GLES2_ShaderInstance *instance;
-    int references;
-    Uint8 modulation_r, modulation_g, modulation_b, modulation_a;
-    struct GLES2_ShaderCacheEntry *prev;
-    struct GLES2_ShaderCacheEntry *next;
-} GLES2_ShaderCacheEntry;
-
-typedef struct GLES2_ShaderCache
-{
-    int count;
-    GLES2_ShaderCacheEntry *head;
-} GLES2_ShaderCache;
-
-typedef struct GLES2_ProgramCacheEntry
-{
-    GLuint id;
-    SDL_BlendMode blend_mode;
-    GLES2_ShaderCacheEntry *vertex_shader;
-    GLES2_ShaderCacheEntry *fragment_shader;
-    GLuint uniform_locations[16];
-    Uint8 color_r, color_g, color_b, color_a;
-    Uint8 modulation_r, modulation_g, modulation_b, modulation_a;
-    GLfloat projection[4][4];
-    struct GLES2_ProgramCacheEntry *prev;
-    struct GLES2_ProgramCacheEntry *next;
-} GLES2_ProgramCacheEntry;
-
-typedef struct GLES2_ProgramCache
-{
-    int count;
-    GLES2_ProgramCacheEntry *head;
-    GLES2_ProgramCacheEntry *tail;
-} GLES2_ProgramCache;
-
-typedef enum
-{
-    GLES2_ATTRIBUTE_POSITION = 0,
-    GLES2_ATTRIBUTE_TEXCOORD = 1,
-    GLES2_ATTRIBUTE_ANGLE = 2,
-    GLES2_ATTRIBUTE_CENTER = 3,
-} GLES2_Attribute;
-
-typedef enum
-{
-    GLES2_UNIFORM_PROJECTION,
-    GLES2_UNIFORM_TEXTURE,
-    GLES2_UNIFORM_MODULATION,
-    GLES2_UNIFORM_COLOR
-} GLES2_Uniform;
-
-typedef enum
-{
-    GLES2_IMAGESOURCE_SOLID,
-    GLES2_IMAGESOURCE_TEXTURE_ABGR,
-    GLES2_IMAGESOURCE_TEXTURE_ARGB,
-    GLES2_IMAGESOURCE_TEXTURE_RGB,
-    GLES2_IMAGESOURCE_TEXTURE_BGR
-} GLES2_ImageSource;
-
-typedef struct GLES2_DriverContext
-{
-    SDL_GLContext *context;
-
-    SDL_bool debug_enabled;
-
-    struct {
-        int blendMode;
-        SDL_bool tex_coords;
-    } current;
-
-#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
-#include "SDL_gles2funcs.h"
-#undef SDL_PROC
-    GLES2_FBOList *framebuffers;
-    GLuint window_framebuffer;
-
-    int shader_format_count;
-    GLenum *shader_formats;
-    GLES2_ShaderCache shader_cache;
-    GLES2_ProgramCache program_cache;
-    GLES2_ProgramCacheEntry *current_program;
-    Uint8 clear_r, clear_g, clear_b, clear_a;
-} GLES2_DriverContext;
-
-#define GLES2_MAX_CACHED_PROGRAMS 8
-
-
-SDL_FORCE_INLINE const char*
-GL_TranslateError (GLenum error)
-{
-#define GL_ERROR_TRANSLATE(e) case e: return #e;
-    switch (error) {
-    GL_ERROR_TRANSLATE(GL_INVALID_ENUM)
-    GL_ERROR_TRANSLATE(GL_INVALID_VALUE)
-    GL_ERROR_TRANSLATE(GL_INVALID_OPERATION)
-    GL_ERROR_TRANSLATE(GL_OUT_OF_MEMORY)
-    GL_ERROR_TRANSLATE(GL_NO_ERROR)
-    default:
-        return "UNKNOWN";
-}
-#undef GL_ERROR_TRANSLATE
-}
-
-SDL_FORCE_INLINE void
-GL_ClearErrors(SDL_Renderer *renderer)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *) renderer->driverdata;
-
-    if (!data->debug_enabled)
-    {
-        return;
-    }
-    while (data->glGetError() != GL_NO_ERROR) {
-        continue;
-    }
-}
-
-SDL_FORCE_INLINE int
-GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *) renderer->driverdata;
-    int ret = 0;
-
-    if (!data->debug_enabled)
-    {
-        return 0;
-    }
-    /* check gl errors (can return multiple errors) */
-    for (;;) {
-        GLenum error = data->glGetError();
-        if (error != GL_NO_ERROR) {
-            if (prefix == NULL || prefix[0] == '\0') {
-                prefix = "generic";
-            }
-            SDL_SetError("%s: %s (%d): %s %s (0x%X)", prefix, file, line, function, GL_TranslateError(error), error);
-            ret = -1;
-        } else {
-            break;
-        }
-    }
-    return ret;
-}
-
-#if 0
-#define GL_CheckError(prefix, renderer)
-#elif defined(_MSC_VER)
-#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __FUNCTION__)
-#else
-#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#endif
-
-
-/*************************************************************************************************
- * Renderer state APIs                                                                           *
- *************************************************************************************************/
-
-static int GLES2_ActivateRenderer(SDL_Renderer *renderer);
-static void GLES2_WindowEvent(SDL_Renderer * renderer,
-                              const SDL_WindowEvent *event);
-static int GLES2_UpdateViewport(SDL_Renderer * renderer);
-static void GLES2_DestroyRenderer(SDL_Renderer *renderer);
-static int GLES2_SetOrthographicProjection(SDL_Renderer *renderer);
-
-
-static SDL_GLContext SDL_CurrentContext = NULL;
-
-static int GLES2_LoadFunctions(GLES2_DriverContext * data)
-{
-#if SDL_VIDEO_DRIVER_UIKIT
-#define __SDL_NOGETPROCADDR__
-#elif SDL_VIDEO_DRIVER_ANDROID
-#define __SDL_NOGETPROCADDR__
-#elif SDL_VIDEO_DRIVER_PANDORA
-#define __SDL_NOGETPROCADDR__
-#endif
-
-#if defined __SDL_NOGETPROCADDR__
-#define SDL_PROC(ret,func,params) data->func=func;
-#else
-#define SDL_PROC(ret,func,params) \
-    do { \
-        data->func = SDL_GL_GetProcAddress(#func); \
-        if ( ! data->func ) { \
-            return SDL_SetError("Couldn't load GLES2 function %s: %s\n", #func, SDL_GetError()); \
-        } \
-    } while ( 0 );
-#endif /* _SDL_NOGETPROCADDR_ */
-
-#include "SDL_gles2funcs.h"
-#undef SDL_PROC
-    return 0;
-}
-
-GLES2_FBOList *
-GLES2_GetFBO(GLES2_DriverContext *data, Uint32 w, Uint32 h)
-{
-   GLES2_FBOList *result = data->framebuffers;
-   while ((result) && ((result->w != w) || (result->h != h)) )
-   {
-       result = result->next;
-   }
-   if (result == NULL)
-   {
-       result = SDL_malloc(sizeof(GLES2_FBOList));
-       result->w = w;
-       result->h = h;
-       data->glGenFramebuffers(1, &result->FBO);
-       result->next = data->framebuffers;
-       data->framebuffers = result;
-   }
-   return result;
-}
-
-static int
-GLES2_ActivateRenderer(SDL_Renderer * renderer)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-
-    if (SDL_CurrentContext != data->context) {
-        /* Null out the current program to ensure we set it again */
-        data->current_program = NULL;
-
-        if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) {
-            return -1;
-        }
-        SDL_CurrentContext = data->context;
-
-        GLES2_UpdateViewport(renderer);
-    }
-
-    GL_ClearErrors(renderer);
-
-    return 0;
-}
-
-static void
-GLES2_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-
-    if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED ||
-        event->event == SDL_WINDOWEVENT_SHOWN ||
-        event->event == SDL_WINDOWEVENT_HIDDEN) {
-        /* Rebind the context to the window area */
-        SDL_CurrentContext = NULL;
-    }
-
-    if (event->event == SDL_WINDOWEVENT_MINIMIZED) {
-        /* According to Apple documentation, we need to finish drawing NOW! */
-        data->glFinish();
-    }
-}
-
-static int
-GLES2_UpdateViewport(SDL_Renderer * renderer)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-
-    if (SDL_CurrentContext != data->context) {
-        /* We'll update the viewport after we rebind the context */
-        return 0;
-    }
-
-    data->glViewport(renderer->viewport.x, renderer->viewport.y,
-               renderer->viewport.w, renderer->viewport.h);
-
-    if (data->current_program) {
-        GLES2_SetOrthographicProjection(renderer);
-    }
-    return GL_CheckError("", renderer);
-}
-
-static int
-GLES2_UpdateClipRect(SDL_Renderer * renderer)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    const SDL_Rect *rect = &renderer->clip_rect;
-
-    if (SDL_CurrentContext != data->context) {
-        /* We'll update the clip rect after we rebind the context */
-        return 0;
-    }
-
-    if (!SDL_RectEmpty(rect)) {
-        data->glEnable(GL_SCISSOR_TEST);
-        data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h);
-    } else {
-        data->glDisable(GL_SCISSOR_TEST);
-    }
-    return 0;
-}
-
-static void
-GLES2_DestroyRenderer(SDL_Renderer *renderer)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-
-    /* Deallocate everything */
-    if (data) {
-        GLES2_ActivateRenderer(renderer);
-
-        {
-            GLES2_ShaderCacheEntry *entry;
-            GLES2_ShaderCacheEntry *next;
-            entry = data->shader_cache.head;
-            while (entry)
-            {
-                data->glDeleteShader(entry->id);
-                next = entry->next;
-                SDL_free(entry);
-                entry = next;
-            }
-        }
-        {
-            GLES2_ProgramCacheEntry *entry;
-            GLES2_ProgramCacheEntry *next;
-            entry = data->program_cache.head;
-            while (entry) {
-                data->glDeleteProgram(entry->id);
-                next = entry->next;
-                SDL_free(entry);
-                entry = next;
-            }
-        }
-        if (data->context) {
-            while (data->framebuffers) {
-                GLES2_FBOList *nextnode = data->framebuffers->next;
-                data->glDeleteFramebuffers(1, &data->framebuffers->FBO);
-                GL_CheckError("", renderer);
-                SDL_free(data->framebuffers);
-                data->framebuffers = nextnode;
-            }
-            SDL_GL_DeleteContext(data->context);
-        }
-        SDL_free(data->shader_formats);
-        SDL_free(data);
-    }
-    SDL_free(renderer);
-}
-
-/*************************************************************************************************
- * Texture APIs                                                                                  *
- *************************************************************************************************/
-
-static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture);
-static int GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect,
-                               const void *pixels, int pitch);
-static int GLES2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect,
-                             void **pixels, int *pitch);
-static void GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture);
-static int GLES2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
-static void GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture);
-
-static GLenum
-GetScaleQuality(void)
-{
-    const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
-
-    if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
-        return GL_NEAREST;
-    } else {
-        return GL_LINEAR;
-    }
-}
-
-static int
-GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
-{
-    GLES2_DriverContext *renderdata = (GLES2_DriverContext *)renderer->driverdata;
-    GLES2_TextureData *data;
-    GLenum format;
-    GLenum type;
-    GLenum scaleMode;
-
-    GLES2_ActivateRenderer(renderer);
-
-    /* Determine the corresponding GLES texture format params */
-    switch (texture->format)
-    {
-    case SDL_PIXELFORMAT_ABGR8888:
-    case SDL_PIXELFORMAT_ARGB8888:
-    case SDL_PIXELFORMAT_BGR888:
-    case SDL_PIXELFORMAT_RGB888:
-        format = GL_RGBA;
-        type = GL_UNSIGNED_BYTE;
-        break;
-    default:
-        return SDL_SetError("Texture format not supported");
-    }
-
-    /* Allocate a texture struct */
-    data = (GLES2_TextureData *)SDL_calloc(1, sizeof(GLES2_TextureData));
-    if (!data) {
-        return SDL_OutOfMemory();
-    }
-    data->texture = 0;
-    data->texture_type = GL_TEXTURE_2D;
-    data->pixel_format = format;
-    data->pixel_type = type;
-    scaleMode = GetScaleQuality();
-
-    /* Allocate a blob for image renderdata */
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
-        data->pixel_data = SDL_calloc(1, data->pitch * texture->h);
-        if (!data->pixel_data) {
-            SDL_free(data);
-            return SDL_OutOfMemory();
-        }
-    }
-
-    /* Allocate the texture */
-    GL_CheckError("", renderer);
-    renderdata->glGenTextures(1, &data->texture);
-    if (GL_CheckError("glGenTexures()", renderer) < 0) {
-        return -1;
-    }
-    texture->driverdata = data;
-    renderdata->glBindTexture(data->texture_type, data->texture);
-    renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MIN_FILTER, scaleMode);
-    renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MAG_FILTER, scaleMode);
-    renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-    renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-    renderdata->glTexImage2D(data->texture_type, 0, format, texture->w, texture->h, 0, format, type, NULL);
-    if (GL_CheckError("glTexImage2D()", renderer) < 0) {
-        return -1;
-    }
-
-    if (texture->access == SDL_TEXTUREACCESS_TARGET) {
-       data->fbo = GLES2_GetFBO(renderer->driverdata, texture->w, texture->h);
-    } else {
-       data->fbo = NULL;
-    }
-
-    return GL_CheckError("", renderer);
-}
-
-static int
-GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect,
-                    const void *pixels, int pitch)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata;
-    Uint8 *blob = NULL;
-    Uint8 *src;
-    int srcPitch;
-    int y;
-
-    GLES2_ActivateRenderer(renderer);
-
-    /* Bail out if we're supposed to update an empty rectangle */
-    if (rect->w <= 0 || rect->h <= 0)
-        return 0;
-
-    /* Reformat the texture data into a tightly packed array */
-    srcPitch = rect->w * SDL_BYTESPERPIXEL(texture->format);
-    src = (Uint8 *)pixels;
-    if (pitch != srcPitch) {
-        blob = (Uint8 *)SDL_malloc(srcPitch * rect->h);
-        if (!blob) {
-            return SDL_OutOfMemory();
-        }
-        src = blob;
-        for (y = 0; y < rect->h; ++y)
-        {
-            SDL_memcpy(src, pixels, srcPitch);
-            src += srcPitch;
-            pixels = (Uint8 *)pixels + pitch;
-        }
-        src = blob;
-    }
-
-    /* Create a texture subimage with the supplied data */
-    data->glBindTexture(tdata->texture_type, tdata->texture);
-    data->glTexSubImage2D(tdata->texture_type,
-                    0,
-                    rect->x,
-                    rect->y,
-                    rect->w,
-                    rect->h,
-                    tdata->pixel_format,
-                    tdata->pixel_type,
-                    src);
-    SDL_free(blob);
-
-    return GL_CheckError("glTexSubImage2D()", renderer);
-}
-
-static int
-GLES2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect,
-                  void **pixels, int *pitch)
-{
-    GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata;
-
-    /* Retrieve the buffer/pitch for the specified region */
-    *pixels = (Uint8 *)tdata->pixel_data +
-              (tdata->pitch * rect->y) +
-              (rect->x * SDL_BYTESPERPIXEL(texture->format));
-    *pitch = tdata->pitch;
-
-    return 0;
-}
-
-static void
-GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture)
-{
-    GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata;
-    SDL_Rect rect;
-
-    /* We do whole texture updates, at least for now */
-    rect.x = 0;
-    rect.y = 0;
-    rect.w = texture->w;
-    rect.h = texture->h;
-    GLES2_UpdateTexture(renderer, texture, &rect, tdata->pixel_data, tdata->pitch);
-}
-
-static int
-GLES2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *) renderer->driverdata;
-    GLES2_TextureData *texturedata = NULL;
-    GLenum status;
-
-    if (texture == NULL) {
-        data->glBindFramebuffer(GL_FRAMEBUFFER, data->window_framebuffer);
-    } else {
-        texturedata = (GLES2_TextureData *) texture->driverdata;
-        data->glBindFramebuffer(GL_FRAMEBUFFER, texturedata->fbo->FBO);
-        /* TODO: check if texture pixel format allows this operation */
-        data->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texturedata->texture_type, texturedata->texture, 0);
-        /* Check FBO status */
-        status = data->glCheckFramebufferStatus(GL_FRAMEBUFFER);
-        if (status != GL_FRAMEBUFFER_COMPLETE) {
-            return SDL_SetError("glFramebufferTexture2D() failed");
-        }
-    }
-    return 0;
-}
-
-static void
-GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata;
-
-    GLES2_ActivateRenderer(renderer);
-
-    /* Destroy the texture */
-    if (tdata)
-    {
-        data->glDeleteTextures(1, &tdata->texture);
-        SDL_free(tdata->pixel_data);
-        SDL_free(tdata);
-        texture->driverdata = NULL;
-    }
-}
-
-/*************************************************************************************************
- * Shader management functions                                                                   *
- *************************************************************************************************/
-
-static GLES2_ShaderCacheEntry *GLES2_CacheShader(SDL_Renderer *renderer, GLES2_ShaderType type,
-                                                 SDL_BlendMode blendMode);
-static void GLES2_EvictShader(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *entry);
-static GLES2_ProgramCacheEntry *GLES2_CacheProgram(SDL_Renderer *renderer,
-                                                   GLES2_ShaderCacheEntry *vertex,
-                                                   GLES2_ShaderCacheEntry *fragment,
-                                                   SDL_BlendMode blendMode);
-static int GLES2_SelectProgram(SDL_Renderer *renderer, GLES2_ImageSource source,
-                               SDL_BlendMode blendMode);
-
-static GLES2_ProgramCacheEntry *
-GLES2_CacheProgram(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *vertex,
-                   GLES2_ShaderCacheEntry *fragment, SDL_BlendMode blendMode)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLES2_ProgramCacheEntry *entry;
-    GLES2_ShaderCacheEntry *shaderEntry;
-    GLint linkSuccessful;
-
-    /* Check if we've already cached this program */
-    entry = data->program_cache.head;
-    while (entry)
-    {
-        if (entry->vertex_shader == vertex && entry->fragment_shader == fragment)
-            break;
-        entry = entry->next;
-    }
-    if (entry)
-    {
-        if (data->program_cache.head != entry)
-        {
-            if (entry->next)
-                entry->next->prev = entry->prev;
-            if (entry->prev)
-                entry->prev->next = entry->next;
-            entry->prev = NULL;
-            entry->next = data->program_cache.head;
-            data->program_cache.head->prev = entry;
-            data->program_cache.head = entry;
-        }
-        return entry;
-    }
-
-    /* Create a program cache entry */
-    entry = (GLES2_ProgramCacheEntry *)SDL_calloc(1, sizeof(GLES2_ProgramCacheEntry));
-    if (!entry)
-    {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    entry->vertex_shader = vertex;
-    entry->fragment_shader = fragment;
-    entry->blend_mode = blendMode;
-
-    /* Create the program and link it */
-    entry->id = data->glCreateProgram();
-    data->glAttachShader(entry->id, vertex->id);
-    data->glAttachShader(entry->id, fragment->id);
-    data->glBindAttribLocation(entry->id, GLES2_ATTRIBUTE_POSITION, "a_position");
-    data->glBindAttribLocation(entry->id, GLES2_ATTRIBUTE_TEXCOORD, "a_texCoord");
-    data->glBindAttribLocation(entry->id, GLES2_ATTRIBUTE_ANGLE, "a_angle");
-    data->glBindAttribLocation(entry->id, GLES2_ATTRIBUTE_CENTER, "a_center");
-    data->glLinkProgram(entry->id);
-    data->glGetProgramiv(entry->id, GL_LINK_STATUS, &linkSuccessful);
-    if (!linkSuccessful)
-    {
-        data->glDeleteProgram(entry->id);
-        SDL_free(entry);
-        SDL_SetError("Failed to link shader program");
-        return NULL;
-    }
-
-    /* Predetermine locations of uniform variables */
-    entry->uniform_locations[GLES2_UNIFORM_PROJECTION] =
-        data->glGetUniformLocation(entry->id, "u_projection");
-    entry->uniform_locations[GLES2_UNIFORM_TEXTURE] =
-        data->glGetUniformLocation(entry->id, "u_texture");
-    entry->uniform_locations[GLES2_UNIFORM_MODULATION] =
-        data->glGetUniformLocation(entry->id, "u_modulation");
-    entry->uniform_locations[GLES2_UNIFORM_COLOR] =
-        data->glGetUniformLocation(entry->id, "u_color");
-
-    entry->modulation_r = entry->modulation_g = entry->modulation_b = entry->modulation_a = 1.0f;
-    entry->color_r = entry->color_g = entry->color_b = entry->color_a = 1.0f;
-
-    data->glUseProgram(entry->id);
-    data->glUniformMatrix4fv(entry->uniform_locations[GLES2_UNIFORM_PROJECTION], 1, GL_FALSE, (GLfloat *)entry->projection);
-    data->glUniform1i(entry->uniform_locations[GLES2_UNIFORM_TEXTURE], 0);  /* always texture unit 0. */
-    data->glUniform4f(entry->uniform_locations[GLES2_UNIFORM_MODULATION], 1.0f, 1.0f, 1.0f, 1.0f);
-    data->glUniform4f(entry->uniform_locations[GLES2_UNIFORM_COLOR], 1.0f, 1.0f, 1.0f, 1.0f);
-
-    /* Cache the linked program */
-    if (data->program_cache.head)
-    {
-        entry->next = data->program_cache.head;
-        data->program_cache.head->prev = entry;
-    }
-    else
-    {
-        data->program_cache.tail = entry;
-    }
-    data->program_cache.head = entry;
-    ++data->program_cache.count;
-
-    /* Increment the refcount of the shaders we're using */
-    ++vertex->references;
-    ++fragment->references;
-
-    /* Evict the last entry from the cache if we exceed the limit */
-    if (data->program_cache.count > GLES2_MAX_CACHED_PROGRAMS)
-    {
-        shaderEntry = data->program_cache.tail->vertex_shader;
-        if (--shaderEntry->references <= 0)
-            GLES2_EvictShader(renderer, shaderEntry);
-        shaderEntry = data->program_cache.tail->fragment_shader;
-        if (--shaderEntry->references <= 0)
-            GLES2_EvictShader(renderer, shaderEntry);
-        data->glDeleteProgram(data->program_cache.tail->id);
-        data->program_cache.tail = data->program_cache.tail->prev;
-        SDL_free(data->program_cache.tail->next);
-        data->program_cache.tail->next = NULL;
-        --data->program_cache.count;
-    }
-    return entry;
-}
-
-static GLES2_ShaderCacheEntry *
-GLES2_CacheShader(SDL_Renderer *renderer, GLES2_ShaderType type, SDL_BlendMode blendMode)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    const GLES2_Shader *shader;
-    const GLES2_ShaderInstance *instance = NULL;
-    GLES2_ShaderCacheEntry *entry = NULL;
-    GLint compileSuccessful = GL_FALSE;
-    int i, j;
-
-    /* Find the corresponding shader */
-    shader = GLES2_GetShader(type, blendMode);
-    if (!shader)
-    {
-        SDL_SetError("No shader matching the requested characteristics was found");
-        return NULL;
-    }
-
-    /* Find a matching shader instance that's supported on this hardware */
-    for (i = 0; i < shader->instance_count && !instance; ++i)
-    {
-        for (j = 0; j < data->shader_format_count && !instance; ++j)
-        {
-            if (!shader->instances)
-                continue;
-            if (!shader->instances[i])
-                continue;
-            if (shader->instances[i]->format != data->shader_formats[j])
-                continue;
-            instance = shader->instances[i];
-        }
-    }
-    if (!instance)
-    {
-        SDL_SetError("The specified shader cannot be loaded on the current platform");
-        return NULL;
-    }
-
-    /* Check if we've already cached this shader */
-    entry = data->shader_cache.head;
-    while (entry)
-    {
-        if (entry->instance == instance)
-            break;
-        entry = entry->next;
-    }
-    if (entry)
-        return entry;
-
-    /* Create a shader cache entry */
-    entry = (GLES2_ShaderCacheEntry *)SDL_calloc(1, sizeof(GLES2_ShaderCacheEntry));
-    if (!entry)
-    {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    entry->type = type;
-    entry->instance = instance;
-
-    /* Compile or load the selected shader instance */
-    entry->id = data->glCreateShader(instance->type);
-    if (instance->format == (GLenum)-1)
-    {
-        data->glShaderSource(entry->id, 1, (const char **)&instance->data, NULL);
-        data->glCompileShader(entry->id);
-        data->glGetShaderiv(entry->id, GL_COMPILE_STATUS, &compileSuccessful);
-    }
-    else
-    {
-        data->glShaderBinary(1, &entry->id, instance->format, instance->data, instance->length);
-        compileSuccessful = GL_TRUE;
-    }
-    if (!compileSuccessful)
-    {
-        char *info = NULL;
-        int length = 0;
-
-        data->glGetShaderiv(entry->id, GL_INFO_LOG_LENGTH, &length);
-        if (length > 0) {
-            info = SDL_stack_alloc(char, length);
-            if (info) {
-                data->glGetShaderInfoLog(entry->id, length, &length, info);
-            }
-        }
-        if (info) {
-            SDL_SetError("Failed to load the shader: %s", info);
-            SDL_stack_free(info);
-        } else {
-            SDL_SetError("Failed to load the shader");
-        }
-        data->glDeleteShader(entry->id);
-        SDL_free(entry);
-        return NULL;
-    }
-
-    /* Link the shader entry in at the front of the cache */
-    if (data->shader_cache.head)
-    {
-        entry->next = data->shader_cache.head;
-        data->shader_cache.head->prev = entry;
-    }
-    data->shader_cache.head = entry;
-    ++data->shader_cache.count;
-    return entry;
-}
-
-static void
-GLES2_EvictShader(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *entry)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-
-    /* Unlink the shader from the cache */
-    if (entry->next)
-        entry->next->prev = entry->prev;
-    if (entry->prev)
-        entry->prev->next = entry->next;
-    if (data->shader_cache.head == entry)
-        data->shader_cache.head = entry->next;
-    --data->shader_cache.count;
-
-    /* Deallocate the shader */
-    data->glDeleteShader(entry->id);
-    SDL_free(entry);
-}
-
-static int
-GLES2_SelectProgram(SDL_Renderer *renderer, GLES2_ImageSource source, SDL_BlendMode blendMode)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLES2_ShaderCacheEntry *vertex = NULL;
-    GLES2_ShaderCacheEntry *fragment = NULL;
-    GLES2_ShaderType vtype, ftype;
-    GLES2_ProgramCacheEntry *program;
-
-    /* Select an appropriate shader pair for the specified modes */
-    vtype = GLES2_SHADER_VERTEX_DEFAULT;
-    switch (source)
-    {
-    case GLES2_IMAGESOURCE_SOLID:
-        ftype = GLES2_SHADER_FRAGMENT_SOLID_SRC;
-        break;
-    case GLES2_IMAGESOURCE_TEXTURE_ABGR:
-        ftype = GLES2_SHADER_FRAGMENT_TEXTURE_ABGR_SRC;
-        break;
-    case GLES2_IMAGESOURCE_TEXTURE_ARGB:
-        ftype = GLES2_SHADER_FRAGMENT_TEXTURE_ARGB_SRC;
-        break;
-    case GLES2_IMAGESOURCE_TEXTURE_RGB:
-        ftype = GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC;
-        break;
-    case GLES2_IMAGESOURCE_TEXTURE_BGR:
-        ftype = GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC;
-        break;
-    default:
-        goto fault;
-    }
-
-    /* Load the requested shaders */
-    vertex = GLES2_CacheShader(renderer, vtype, blendMode);
-    if (!vertex)
-        goto fault;
-    fragment = GLES2_CacheShader(renderer, ftype, blendMode);
-    if (!fragment)
-        goto fault;
-
-    /* Check if we need to change programs at all */
-    if (data->current_program &&
-        data->current_program->vertex_shader == vertex &&
-        data->current_program->fragment_shader == fragment)
-        return 0;
-
-    /* Generate a matching program */
-    program = GLES2_CacheProgram(renderer, vertex, fragment, blendMode);
-    if (!program)
-        goto fault;
-
-    /* Select that program in OpenGL */
-    data->glUseProgram(program->id);
-
-    /* Set the current program */
-    data->current_program = program;
-
-    /* Activate an orthographic projection */
-    if (GLES2_SetOrthographicProjection(renderer) < 0)
-        goto fault;
-
-    /* Clean up and return */
-    return 0;
-fault:
-    if (vertex && vertex->references <= 0)
-        GLES2_EvictShader(renderer, vertex);
-    if (fragment && fragment->references <= 0)
-        GLES2_EvictShader(renderer, fragment);
-    data->current_program = NULL;
-    return -1;
-}
-
-static int
-GLES2_SetOrthographicProjection(SDL_Renderer *renderer)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLfloat projection[4][4];
-
-    if (!renderer->viewport.w || !renderer->viewport.h) {
-        return 0;
-    }
-
-    /* Prepare an orthographic projection */
-    projection[0][0] = 2.0f / renderer->viewport.w;
-    projection[0][1] = 0.0f;
-    projection[0][2] = 0.0f;
-    projection[0][3] = 0.0f;
-    projection[1][0] = 0.0f;
-    if (renderer->target) {
-        projection[1][1] = 2.0f / renderer->viewport.h;
-    } else {
-        projection[1][1] = -2.0f / renderer->viewport.h;
-    }
-    projection[1][2] = 0.0f;
-    projection[1][3] = 0.0f;
-    projection[2][0] = 0.0f;
-    projection[2][1] = 0.0f;
-    projection[2][2] = 0.0f;
-    projection[2][3] = 0.0f;
-    projection[3][0] = -1.0f;
-    if (renderer->target) {
-        projection[3][1] = -1.0f;
-    } else {
-        projection[3][1] = 1.0f;
-    }
-    projection[3][2] = 0.0f;
-    projection[3][3] = 1.0f;
-
-    /* Set the projection matrix */
-    if (SDL_memcmp(data->current_program->projection, projection, sizeof (projection)) != 0) {
-        const GLuint locProjection = data->current_program->uniform_locations[GLES2_UNIFORM_PROJECTION];
-        data->glUniformMatrix4fv(locProjection, 1, GL_FALSE, (GLfloat *)projection);
-        SDL_memcpy(data->current_program->projection, projection, sizeof (projection));
-    }
-
-    return 0;
-}
-
-/*************************************************************************************************
- * Rendering functions                                                                           *
- *************************************************************************************************/
-
-static const float inv255f = 1.0f / 255.0f;
-
-static int GLES2_RenderClear(SDL_Renderer *renderer);
-static int GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count);
-static int GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count);
-static int GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count);
-static int GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect,
-                            const SDL_FRect *dstrect);
-static int GLES2_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-                         const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-                         const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip);
-static int GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                    Uint32 pixel_format, void * pixels, int pitch);
-static void GLES2_RenderPresent(SDL_Renderer *renderer);
-
-static SDL_bool
-CompareColors(Uint8 r1, Uint8 g1, Uint8 b1, Uint8 a1,
-              Uint8 r2, Uint8 g2, Uint8 b2, Uint8 a2)
-{
-    Uint32 Pixel1, Pixel2;
-    RGBA8888_FROM_RGBA(Pixel1, r1, g1, b1, a1);
-    RGBA8888_FROM_RGBA(Pixel2, r2, g2, b2, a2);
-    return (Pixel1 == Pixel2);
-}
-
-static int
-GLES2_RenderClear(SDL_Renderer * renderer)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-
-    GLES2_ActivateRenderer(renderer);
-
-    if (!CompareColors(data->clear_r, data->clear_g, data->clear_b, data->clear_a,
-                        renderer->r, renderer->g, renderer->b, renderer->a)) {
-        data->glClearColor((GLfloat) renderer->r * inv255f,
-                     (GLfloat) renderer->g * inv255f,
-                     (GLfloat) renderer->b * inv255f,
-                     (GLfloat) renderer->a * inv255f);
-        data->clear_r = renderer->r;
-        data->clear_g = renderer->g;
-        data->clear_b = renderer->b;
-        data->clear_a = renderer->a;
-    }
-
-    data->glClear(GL_COLOR_BUFFER_BIT);
-
-    return 0;
-}
-
-static void
-GLES2_SetBlendMode(GLES2_DriverContext *data, int blendMode)
-{
-    if (blendMode != data->current.blendMode) {
-        switch (blendMode) {
-        default:
-        case SDL_BLENDMODE_NONE:
-            data->glDisable(GL_BLEND);
-            break;
-        case SDL_BLENDMODE_BLEND:
-            data->glEnable(GL_BLEND);
-            data->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-            break;
-        case SDL_BLENDMODE_ADD:
-            data->glEnable(GL_BLEND);
-            data->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_ONE);
-            break;
-        case SDL_BLENDMODE_MOD:
-            data->glEnable(GL_BLEND);
-            data->glBlendFuncSeparate(GL_ZERO, GL_SRC_COLOR, GL_ZERO, GL_ONE);
-            break;
-        }
-        data->current.blendMode = blendMode;
-    }
-}
-
-static void
-GLES2_SetTexCoords(GLES2_DriverContext * data, SDL_bool enabled)
-{
-    if (enabled != data->current.tex_coords) {
-        if (enabled) {
-            data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_TEXCOORD);
-        } else {
-            data->glDisableVertexAttribArray(GLES2_ATTRIBUTE_TEXCOORD);
-        }
-        data->current.tex_coords = enabled;
-    }
-}
-
-static int
-GLES2_SetDrawingState(SDL_Renderer * renderer)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    const int blendMode = renderer->blendMode;
-    GLES2_ProgramCacheEntry *program;
-    Uint8 r, g, b, a;
-
-    GLES2_ActivateRenderer(renderer);
-
-    GLES2_SetBlendMode(data, blendMode);
-
-    GLES2_SetTexCoords(data, SDL_FALSE);
-
-    /* Activate an appropriate shader and set the projection matrix */
-    if (GLES2_SelectProgram(renderer, GLES2_IMAGESOURCE_SOLID, blendMode) < 0) {
-        return -1;
-    }
-
-    /* Select the color to draw with */
-    g = renderer->g;
-    a = renderer->a;
-
-    if (renderer->target &&
-         (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 ||
-         renderer->target->format == SDL_PIXELFORMAT_RGB888)) {
-        r = renderer->b;
-        b = renderer->r;
-     } else {
-        r = renderer->r;
-        b = renderer->b;
-     }
-
-    program = data->current_program;
-    if (!CompareColors(program->color_r, program->color_g, program->color_b, program->color_a, r, g, b, a)) {
-        /* Select the color to draw with */
-        data->glUniform4f(program->uniform_locations[GLES2_UNIFORM_COLOR], r * inv255f, g * inv255f, b * inv255f, a * inv255f);
-        program->color_r = r;
-        program->color_g = g;
-        program->color_b = b;
-        program->color_a = a;
-    }
-
-    return 0;
-}
-
-static int
-GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLfloat *vertices;
-    int idx;
-
-    if (GLES2_SetDrawingState(renderer) < 0) {
-        return -1;
-    }
-
-    /* Emit the specified vertices as points */
-    vertices = SDL_stack_alloc(GLfloat, count * 2);
-    for (idx = 0; idx < count; ++idx) {
-        GLfloat x = points[idx].x + 0.5f;
-        GLfloat y = points[idx].y + 0.5f;
-
-        vertices[idx * 2] = x;
-        vertices[(idx * 2) + 1] = y;
-    }
-    data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
-    data->glDrawArrays(GL_POINTS, 0, count);
-    SDL_stack_free(vertices);
-    return 0;
-}
-
-static int
-GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLfloat *vertices;
-    int idx;
-
-    if (GLES2_SetDrawingState(renderer) < 0) {
-        return -1;
-    }
-
-    /* Emit a line strip including the specified vertices */
-    vertices = SDL_stack_alloc(GLfloat, count * 2);
-    for (idx = 0; idx < count; ++idx) {
-        GLfloat x = points[idx].x + 0.5f;
-        GLfloat y = points[idx].y + 0.5f;
-
-        vertices[idx * 2] = x;
-        vertices[(idx * 2) + 1] = y;
-    }
-    data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
-    data->glDrawArrays(GL_LINE_STRIP, 0, count);
-
-    /* We need to close the endpoint of the line */
-    if (count == 2 ||
-        points[0].x != points[count-1].x || points[0].y != points[count-1].y) {
-        data->glDrawArrays(GL_POINTS, count-1, 1);
-    }
-    SDL_stack_free(vertices);
-
-    return GL_CheckError("", renderer);
-}
-
-static int
-GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLfloat vertices[8];
-    int idx;
-
-    if (GLES2_SetDrawingState(renderer) < 0) {
-        return -1;
-    }
-
-    /* Emit a line loop for each rectangle */
-    for (idx = 0; idx < count; ++idx) {
-        const SDL_FRect *rect = &rects[idx];
-
-        GLfloat xMin = rect->x;
-        GLfloat xMax = (rect->x + rect->w);
-        GLfloat yMin = rect->y;
-        GLfloat yMax = (rect->y + rect->h);
-
-        vertices[0] = xMin;
-        vertices[1] = yMin;
-        vertices[2] = xMax;
-        vertices[3] = yMin;
-        vertices[4] = xMin;
-        vertices[5] = yMax;
-        vertices[6] = xMax;
-        vertices[7] = yMax;
-        data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
-        data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-    }
-    return GL_CheckError("", renderer);
-}
-
-static int
-GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect,
-                 const SDL_FRect *dstrect)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata;
-    GLES2_ImageSource sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
-    SDL_BlendMode blendMode;
-    GLfloat vertices[8];
-    GLfloat texCoords[8];
-    GLES2_ProgramCacheEntry *program;
-    Uint8 r, g, b, a;
-
-    GLES2_ActivateRenderer(renderer);
-
-    /* Activate an appropriate shader and set the projection matrix */
-    blendMode = texture->blendMode;
-    if (renderer->target) {
-        /* Check if we need to do color mapping between the source and render target textures */
-        if (renderer->target->format != texture->format) {
-            switch (texture->format)
-            {
-            case SDL_PIXELFORMAT_ABGR8888:
-                switch (renderer->target->format)
-                {
-                    case SDL_PIXELFORMAT_ARGB8888:
-                    case SDL_PIXELFORMAT_RGB888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                    case SDL_PIXELFORMAT_BGR888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
-                        break;
-                }
-                break;
-            case SDL_PIXELFORMAT_ARGB8888:
-                switch (renderer->target->format)
-                {
-                    case SDL_PIXELFORMAT_ABGR8888:
-                    case SDL_PIXELFORMAT_BGR888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                    case SDL_PIXELFORMAT_RGB888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
-                        break;
-                }
-                break;
-            case SDL_PIXELFORMAT_BGR888:
-                switch (renderer->target->format)
-                {
-                    case SDL_PIXELFORMAT_ABGR8888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR;
-                        break;
-                    case SDL_PIXELFORMAT_ARGB8888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB;
-                        break;
-                    case SDL_PIXELFORMAT_RGB888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                }
-                break;
-            case SDL_PIXELFORMAT_RGB888:
-                switch (renderer->target->format)
-                {
-                    case SDL_PIXELFORMAT_ABGR8888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                    case SDL_PIXELFORMAT_ARGB8888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR;
-                        break;
-                    case SDL_PIXELFORMAT_BGR888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                }
-                break;
-            }
-        }
-        else sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;   /* Texture formats match, use the non color mapping shader (even if the formats are not ABGR) */
-    }
-    else {
-        switch (texture->format)
-        {
-            case SDL_PIXELFORMAT_ABGR8888:
-                sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
-                break;
-            case SDL_PIXELFORMAT_ARGB8888:
-                sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                break;
-            case SDL_PIXELFORMAT_BGR888:
-                sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR;
-                break;
-            case SDL_PIXELFORMAT_RGB888:
-                sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB;
-                break;
-            default:
-                return -1;
-        }
-    }
-
-    if (GLES2_SelectProgram(renderer, sourceType, blendMode) < 0) {
-        return -1;
-    }
-
-    /* Select the target texture */
-    data->glBindTexture(tdata->texture_type, tdata->texture);
-
-    /* Configure color modulation */
-    g = texture->g;
-    a = texture->a;
-
-    if (renderer->target &&
-        (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 ||
-         renderer->target->format == SDL_PIXELFORMAT_RGB888)) {
-        r = texture->b;
-        b = texture->r;
-    } else {
-        r = texture->r;
-        b = texture->b;
-    }
-
-    program = data->current_program;
-
-    if (!CompareColors(program->modulation_r, program->modulation_g, program->modulation_b, program->modulation_a, r, g, b, a)) {
-        data->glUniform4f(program->uniform_locations[GLES2_UNIFORM_MODULATION], r * inv255f, g * inv255f, b * inv255f, a * inv255f);
-        program->modulation_r = r;
-        program->modulation_g = g;
-        program->modulation_b = b;
-        program->modulation_a = a;
-    }
-
-    /* Configure texture blending */
-    GLES2_SetBlendMode(data, blendMode);
-
-    GLES2_SetTexCoords(data, SDL_TRUE);
-
-    /* Emit the textured quad */
-    vertices[0] = dstrect->x;
-    vertices[1] = dstrect->y;
-    vertices[2] = (dstrect->x + dstrect->w);
-    vertices[3] = dstrect->y;
-    vertices[4] = dstrect->x;
-    vertices[5] = (dstrect->y + dstrect->h);
-    vertices[6] = (dstrect->x + dstrect->w);
-    vertices[7] = (dstrect->y + dstrect->h);
-    data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
-    texCoords[0] = srcrect->x / (GLfloat)texture->w;
-    texCoords[1] = srcrect->y / (GLfloat)texture->h;
-    texCoords[2] = (srcrect->x + srcrect->w) / (GLfloat)texture->w;
-    texCoords[3] = srcrect->y / (GLfloat)texture->h;
-    texCoords[4] = srcrect->x / (GLfloat)texture->w;
-    texCoords[5] = (srcrect->y + srcrect->h) / (GLfloat)texture->h;
-    texCoords[6] = (srcrect->x + srcrect->w) / (GLfloat)texture->w;
-    texCoords[7] = (srcrect->y + srcrect->h) / (GLfloat)texture->h;
-    data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, texCoords);
-    data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
-    return GL_CheckError("", renderer);
-}
-
-static int
-GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect,
-                 const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata;
-    GLES2_ImageSource sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
-    GLES2_ProgramCacheEntry *program;
-    Uint8 r, g, b, a;
-    SDL_BlendMode blendMode;
-    GLfloat vertices[8];
-    GLfloat texCoords[8];
-    GLfloat translate[8];
-    GLfloat fAngle[4];
-    GLfloat tmp;
-
-    GLES2_ActivateRenderer(renderer);
-
-    data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_CENTER);
-    data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_ANGLE);
-    fAngle[0] = fAngle[1] = fAngle[2] = fAngle[3] = (GLfloat)(360.0f - angle);
-    /* Calculate the center of rotation */
-    translate[0] = translate[2] = translate[4] = translate[6] = (center->x + dstrect->x);
-    translate[1] = translate[3] = translate[5] = translate[7] = (center->y + dstrect->y);
-
-    /* Activate an appropriate shader and set the projection matrix */
-    blendMode = texture->blendMode;
-    if (renderer->target) {
-        /* Check if we need to do color mapping between the source and render target textures */
-        if (renderer->target->format != texture->format) {
-            switch (texture->format)
-            {
-            case SDL_PIXELFORMAT_ABGR8888:
-                switch (renderer->target->format)
-                {
-                    case SDL_PIXELFORMAT_ARGB8888:
-                    case SDL_PIXELFORMAT_RGB888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                    case SDL_PIXELFORMAT_BGR888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
-                        break;
-                }
-                break;
-            case SDL_PIXELFORMAT_ARGB8888:
-                switch (renderer->target->format)
-                {
-                    case SDL_PIXELFORMAT_ABGR8888:
-                    case SDL_PIXELFORMAT_BGR888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                    case SDL_PIXELFORMAT_RGB888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
-                        break;
-                }
-                break;
-            case SDL_PIXELFORMAT_BGR888:
-                switch (renderer->target->format)
-                {
-                    case SDL_PIXELFORMAT_ABGR8888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR;
-                        break;
-                    case SDL_PIXELFORMAT_ARGB8888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB;
-                        break;
-                    case SDL_PIXELFORMAT_RGB888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                }
-                break;
-            case SDL_PIXELFORMAT_RGB888:
-                switch (renderer->target->format)
-                {
-                    case SDL_PIXELFORMAT_ABGR8888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                    case SDL_PIXELFORMAT_ARGB8888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR;
-                        break;
-                    case SDL_PIXELFORMAT_BGR888:
-                        sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                        break;
-                }
-                break;
-            }
-        }
-        else sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;   /* Texture formats match, use the non color mapping shader (even if the formats are not ABGR) */
-    }
-    else {
-        switch (texture->format)
-        {
-            case SDL_PIXELFORMAT_ABGR8888:
-                sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
-                break;
-            case SDL_PIXELFORMAT_ARGB8888:
-                sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
-                break;
-            case SDL_PIXELFORMAT_BGR888:
-                sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR;
-                break;
-            case SDL_PIXELFORMAT_RGB888:
-                sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB;
-                break;
-            default:
-                return -1;
-        }
-    }
-    if (GLES2_SelectProgram(renderer, sourceType, blendMode) < 0)
-        return -1;
-
-    /* Select the target texture */
-    data->glBindTexture(tdata->texture_type, tdata->texture);
-
-    /* Configure color modulation */
-    /* !!! FIXME: grep for glUniform4f(), move that stuff to a subroutine, it's a lot of copy/paste. */
-    g = texture->g;
-    a = texture->a;
-
-    if (renderer->target &&
-        (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 ||
-         renderer->target->format == SDL_PIXELFORMAT_RGB888)) {
-        r = texture->b;
-        b = texture->r;
-    } else {
-        r = texture->r;
-        b = texture->b;
-    }
-
-    program = data->current_program;
-
-    if (!CompareColors(program->modulation_r, program->modulation_g, program->modulation_b, program->modulation_a, r, g, b, a)) {
-        data->glUniform4f(program->uniform_locations[GLES2_UNIFORM_MODULATION], r * inv255f, g * inv255f, b * inv255f, a * inv255f);
-        program->modulation_r = r;
-        program->modulation_g = g;
-        program->modulation_b = b;
-        program->modulation_a = a;
-    }
-
-    /* Configure texture blending */
-    GLES2_SetBlendMode(data, blendMode);
-
-    GLES2_SetTexCoords(data, SDL_TRUE);
-
-    /* Emit the textured quad */
-    vertices[0] = dstrect->x;
-    vertices[1] = dstrect->y;
-    vertices[2] = (dstrect->x + dstrect->w);
-    vertices[3] = dstrect->y;
-    vertices[4] = dstrect->x;
-    vertices[5] = (dstrect->y + dstrect->h);
-    vertices[6] = (dstrect->x + dstrect->w);
-    vertices[7] = (dstrect->y + dstrect->h);
-    if (flip & SDL_FLIP_HORIZONTAL) {
-        tmp = vertices[0];
-        vertices[0] = vertices[4] = vertices[2];
-        vertices[2] = vertices[6] = tmp;
-    }
-    if (flip & SDL_FLIP_VERTICAL) {
-        tmp = vertices[1];
-        vertices[1] = vertices[3] = vertices[5];
-        vertices[5] = vertices[7] = tmp;
-    }
-
-    data->glVertexAttribPointer(GLES2_ATTRIBUTE_ANGLE, 1, GL_FLOAT, GL_FALSE, 0, &fAngle);
-    data->glVertexAttribPointer(GLES2_ATTRIBUTE_CENTER, 2, GL_FLOAT, GL_FALSE, 0, translate);
-    data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
-
-    texCoords[0] = srcrect->x / (GLfloat)texture->w;
-    texCoords[1] = srcrect->y / (GLfloat)texture->h;
-    texCoords[2] = (srcrect->x + srcrect->w) / (GLfloat)texture->w;
-    texCoords[3] = srcrect->y / (GLfloat)texture->h;
-    texCoords[4] = srcrect->x / (GLfloat)texture->w;
-    texCoords[5] = (srcrect->y + srcrect->h) / (GLfloat)texture->h;
-    texCoords[6] = (srcrect->x + srcrect->w) / (GLfloat)texture->w;
-    texCoords[7] = (srcrect->y + srcrect->h) / (GLfloat)texture->h;
-    data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, texCoords);
-    data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-    data->glDisableVertexAttribArray(GLES2_ATTRIBUTE_CENTER);
-    data->glDisableVertexAttribArray(GLES2_ATTRIBUTE_ANGLE);
-
-    return GL_CheckError("", renderer);
-}
-
-static int
-GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                    Uint32 pixel_format, void * pixels, int pitch)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    Uint32 temp_format = SDL_PIXELFORMAT_ABGR8888;
-    void *temp_pixels;
-    int temp_pitch;
-    Uint8 *src, *dst, *tmp;
-    int w, h, length, rows;
-    int status;
-
-    GLES2_ActivateRenderer(renderer);
-
-    temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format);
-    temp_pixels = SDL_malloc(rect->h * temp_pitch);
-    if (!temp_pixels) {
-        return SDL_OutOfMemory();
-    }
-
-    SDL_GetRendererOutputSize(renderer, &w, &h);
-
-    data->glReadPixels(rect->x, (h-rect->y)-rect->h, rect->w, rect->h,
-                       GL_RGBA, GL_UNSIGNED_BYTE, temp_pixels);
-    if (GL_CheckError("glReadPixels()", renderer) < 0) {
-        return -1;
-    }
-
-    /* Flip the rows to be top-down */
-    length = rect->w * SDL_BYTESPERPIXEL(temp_format);
-    src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch;
-    dst = (Uint8*)temp_pixels;
-    tmp = SDL_stack_alloc(Uint8, length);
-    rows = rect->h / 2;
-    while (rows--) {
-        SDL_memcpy(tmp, dst, length);
-        SDL_memcpy(dst, src, length);
-        SDL_memcpy(src, tmp, length);
-        dst += temp_pitch;
-        src -= temp_pitch;
-    }
-    SDL_stack_free(tmp);
-
-    status = SDL_ConvertPixels(rect->w, rect->h,
-                               temp_format, temp_pixels, temp_pitch,
-                               pixel_format, pixels, pitch);
-    SDL_free(temp_pixels);
-
-    return status;
-}
-
-static void
-GLES2_RenderPresent(SDL_Renderer *renderer)
-{
-    GLES2_ActivateRenderer(renderer);
-
-    /* Tell the video driver to swap buffers */
-    SDL_GL_SwapWindow(renderer->window);
-}
-
-
-/*************************************************************************************************
- * Bind/unbinding of textures
- *************************************************************************************************/
-static int GLES2_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh);
-static int GLES2_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture);
-
-static int GLES2_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLES2_TextureData *texturedata = (GLES2_TextureData *)texture->driverdata;
-    GLES2_ActivateRenderer(renderer);
-
-    data->glBindTexture(texturedata->texture_type, texturedata->texture);
-
-    if(texw) *texw = 1.0;
-    if(texh) *texh = 1.0;
-
-    return 0;
-}
-
-static int GLES2_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
-    GLES2_TextureData *texturedata = (GLES2_TextureData *)texture->driverdata;
-    GLES2_ActivateRenderer(renderer);
-
-    data->glBindTexture(texturedata->texture_type, 0);
-
-    return 0;
-}
-
-
-/*************************************************************************************************
- * Renderer instantiation                                                                        *
- *************************************************************************************************/
-
-#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B
-
-static void
-GLES2_ResetState(SDL_Renderer *renderer)
-{
-    GLES2_DriverContext *data = (GLES2_DriverContext *) renderer->driverdata;
-
-    if (SDL_CurrentContext == data->context) {
-        GLES2_UpdateViewport(renderer);
-    } else {
-        GLES2_ActivateRenderer(renderer);
-    }
-
-    data->current.blendMode = -1;
-    data->current.tex_coords = SDL_FALSE;
-
-    data->glActiveTexture(GL_TEXTURE0);
-    data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
-    data->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
-    data->glClearColor((GLfloat) data->clear_r * inv255f,
-                        (GLfloat) data->clear_g * inv255f,
-                        (GLfloat) data->clear_b * inv255f,
-                        (GLfloat) data->clear_a * inv255f);
-
-    data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_POSITION);
-    data->glDisableVertexAttribArray(GLES2_ATTRIBUTE_TEXCOORD);
-
-    GL_CheckError("", renderer);
-}
-
-static SDL_Renderer *
-GLES2_CreateRenderer(SDL_Window *window, Uint32 flags)
-{
-    SDL_Renderer *renderer;
-    GLES2_DriverContext *data;
-    GLint nFormats;
-#ifndef ZUNE_HD
-    GLboolean hasCompiler;
-#endif
-    Uint32 windowFlags;
-    GLint window_framebuffer;
-    GLint value;
-
-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
-    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
-
-    windowFlags = SDL_GetWindowFlags(window);
-    if (!(windowFlags & SDL_WINDOW_OPENGL)) {
-        if (SDL_RecreateWindow(window, windowFlags | SDL_WINDOW_OPENGL) < 0) {
-            /* Uh oh, better try to put it back... */
-            SDL_RecreateWindow(window, windowFlags);
-            return NULL;
-        }
-    }
-
-    /* Create the renderer struct */
-    renderer = (SDL_Renderer *)SDL_calloc(1, sizeof(SDL_Renderer));
-    if (!renderer) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    data = (GLES2_DriverContext *)SDL_calloc(1, sizeof(GLES2_DriverContext));
-    if (!data) {
-        GLES2_DestroyRenderer(renderer);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    renderer->info = GLES2_RenderDriver.info;
-    renderer->info.flags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE;
-    renderer->driverdata = data;
-    renderer->window = window;
-
-    /* Create an OpenGL ES 2.0 context */
-    data->context = SDL_GL_CreateContext(window);
-    if (!data->context)
-    {
-        GLES2_DestroyRenderer(renderer);
-        return NULL;
-    }
-    if (SDL_GL_MakeCurrent(window, data->context) < 0) {
-        GLES2_DestroyRenderer(renderer);
-        return NULL;
-    }
-
-    if (GLES2_LoadFunctions(data) < 0) {
-        GLES2_DestroyRenderer(renderer);
-        return NULL;
-    }
-
-    if (flags & SDL_RENDERER_PRESENTVSYNC) {
-        SDL_GL_SetSwapInterval(1);
-    } else {
-        SDL_GL_SetSwapInterval(0);
-    }
-    if (SDL_GL_GetSwapInterval() > 0) {
-        renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
-    }
-
-    /* Check for debug output support */
-    if (SDL_GL_GetAttribute(SDL_GL_CONTEXT_FLAGS, &value) == 0 &&
-        (value & SDL_GL_CONTEXT_DEBUG_FLAG)) {
-        data->debug_enabled = SDL_TRUE;
-    }
-
-    value = 0;
-    data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
-    renderer->info.max_texture_width = value;
-    value = 0;
-    data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
-    renderer->info.max_texture_height = value;
-
-    /* Determine supported shader formats */
-    /* HACK: glGetInteger is broken on the Zune HD's compositor, so we just hardcode this */
-#ifdef ZUNE_HD
-    nFormats = 1;
-#else /* !ZUNE_HD */
-    data->glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &nFormats);
-    data->glGetBooleanv(GL_SHADER_COMPILER, &hasCompiler);
-    if (hasCompiler)
-        ++nFormats;
-#endif /* ZUNE_HD */
-    data->shader_formats = (GLenum *)SDL_calloc(nFormats, sizeof(GLenum));
-    if (!data->shader_formats)
-    {
-        GLES2_DestroyRenderer(renderer);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    data->shader_format_count = nFormats;
-#ifdef ZUNE_HD
-    data->shader_formats[0] = GL_NVIDIA_PLATFORM_BINARY_NV;
-#else /* !ZUNE_HD */
-    data->glGetIntegerv(GL_SHADER_BINARY_FORMATS, (GLint *)data->shader_formats);
-    if (hasCompiler)
-        data->shader_formats[nFormats - 1] = (GLenum)-1;
-#endif /* ZUNE_HD */
-
-    data->framebuffers = NULL;
-    data->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &window_framebuffer);
-    data->window_framebuffer = (GLuint)window_framebuffer;
-
-    /* Populate the function pointers for the module */
-    renderer->WindowEvent         = &GLES2_WindowEvent;
-    renderer->CreateTexture       = &GLES2_CreateTexture;
-    renderer->UpdateTexture       = &GLES2_UpdateTexture;
-    renderer->LockTexture         = &GLES2_LockTexture;
-    renderer->UnlockTexture       = &GLES2_UnlockTexture;
-    renderer->SetRenderTarget     = &GLES2_SetRenderTarget;
-    renderer->UpdateViewport      = &GLES2_UpdateViewport;
-    renderer->UpdateClipRect      = &GLES2_UpdateClipRect;
-    renderer->RenderClear         = &GLES2_RenderClear;
-    renderer->RenderDrawPoints    = &GLES2_RenderDrawPoints;
-    renderer->RenderDrawLines     = &GLES2_RenderDrawLines;
-    renderer->RenderFillRects     = &GLES2_RenderFillRects;
-    renderer->RenderCopy          = &GLES2_RenderCopy;
-    renderer->RenderCopyEx        = &GLES2_RenderCopyEx;
-    renderer->RenderReadPixels    = &GLES2_RenderReadPixels;
-    renderer->RenderPresent       = &GLES2_RenderPresent;
-    renderer->DestroyTexture      = &GLES2_DestroyTexture;
-    renderer->DestroyRenderer     = &GLES2_DestroyRenderer;
-    renderer->GL_BindTexture      = &GLES2_BindTexture;
-    renderer->GL_UnbindTexture    = &GLES2_UnbindTexture;
-
-    GLES2_ResetState(renderer);
-
-    return renderer;
-}
-
-#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/opengles2/SDL_shaders_gles2.c b/deps/SDL2/src/render/opengles2/SDL_shaders_gles2.c
deleted file mode 100644
index fb6921f..0000000
--- a/deps/SDL2/src/render/opengles2/SDL_shaders_gles2.c
+++ /dev/null
@@ -1,785 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
-
-#include "SDL_video.h"
-#include "SDL_opengles2.h"
-#include "SDL_shaders_gles2.h"
-#include "SDL_stdinc.h"
-
-/*************************************************************************************************
- * Vertex/fragment shader source                                                                 *
- *************************************************************************************************/
-
-static const Uint8 GLES2_VertexSrc_Default_[] = " \
-    uniform mat4 u_projection; \
-    attribute vec2 a_position; \
-    attribute vec2 a_texCoord; \
-    attribute float a_angle; \
-    attribute vec2 a_center; \
-    varying vec2 v_texCoord; \
-    \
-    void main() \
-    { \
-        float angle = radians(a_angle); \
-        float c = cos(angle); \
-        float s = sin(angle); \
-        mat2 rotationMatrix = mat2(c, -s, s, c); \
-        vec2 position = rotationMatrix * (a_position - a_center) + a_center; \
-        v_texCoord = a_texCoord; \
-        gl_Position = u_projection * vec4(position, 0.0, 1.0);\
-        gl_PointSize = 1.0; \
-    } \
-";
-
-static const Uint8 GLES2_FragmentSrc_SolidSrc_[] = " \
-    precision mediump float; \
-    uniform vec4 u_color; \
-    \
-    void main() \
-    { \
-        gl_FragColor = u_color; \
-    } \
-";
-
-static const Uint8 GLES2_FragmentSrc_TextureABGRSrc_[] = " \
-    precision mediump float; \
-    uniform sampler2D u_texture; \
-    uniform vec4 u_modulation; \
-    varying vec2 v_texCoord; \
-    \
-    void main() \
-    { \
-        gl_FragColor = texture2D(u_texture, v_texCoord); \
-        gl_FragColor *= u_modulation; \
-    } \
-";
-
-/* ARGB to ABGR conversion */
-static const Uint8 GLES2_FragmentSrc_TextureARGBSrc_[] = " \
-    precision mediump float; \
-    uniform sampler2D u_texture; \
-    uniform vec4 u_modulation; \
-    varying vec2 v_texCoord; \
-    \
-    void main() \
-    { \
-        vec4 abgr = texture2D(u_texture, v_texCoord); \
-        gl_FragColor = abgr; \
-        gl_FragColor.r = abgr.b; \
-        gl_FragColor.b = abgr.r; \
-        gl_FragColor *= u_modulation; \
-    } \
-";
-
-/* RGB to ABGR conversion */
-static const Uint8 GLES2_FragmentSrc_TextureRGBSrc_[] = " \
-    precision mediump float; \
-    uniform sampler2D u_texture; \
-    uniform vec4 u_modulation; \
-    varying vec2 v_texCoord; \
-    \
-    void main() \
-    { \
-        vec4 abgr = texture2D(u_texture, v_texCoord); \
-        gl_FragColor = abgr; \
-        gl_FragColor.r = abgr.b; \
-        gl_FragColor.b = abgr.r; \
-        gl_FragColor.a = 1.0; \
-        gl_FragColor *= u_modulation; \
-    } \
-";
-
-/* BGR to ABGR conversion */
-static const Uint8 GLES2_FragmentSrc_TextureBGRSrc_[] = " \
-    precision mediump float; \
-    uniform sampler2D u_texture; \
-    uniform vec4 u_modulation; \
-    varying vec2 v_texCoord; \
-    \
-    void main() \
-    { \
-        vec4 abgr = texture2D(u_texture, v_texCoord); \
-        gl_FragColor = abgr; \
-        gl_FragColor.a = 1.0; \
-        gl_FragColor *= u_modulation; \
-    } \
-";
-
-static const GLES2_ShaderInstance GLES2_VertexSrc_Default = {
-    GL_VERTEX_SHADER,
-    GLES2_SOURCE_SHADER,
-    sizeof(GLES2_VertexSrc_Default_),
-    GLES2_VertexSrc_Default_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_SolidSrc = {
-    GL_FRAGMENT_SHADER,
-    GLES2_SOURCE_SHADER,
-    sizeof(GLES2_FragmentSrc_SolidSrc_),
-    GLES2_FragmentSrc_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureABGRSrc = {
-    GL_FRAGMENT_SHADER,
-    GLES2_SOURCE_SHADER,
-    sizeof(GLES2_FragmentSrc_TextureABGRSrc_),
-    GLES2_FragmentSrc_TextureABGRSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureARGBSrc = {
-    GL_FRAGMENT_SHADER,
-    GLES2_SOURCE_SHADER,
-    sizeof(GLES2_FragmentSrc_TextureARGBSrc_),
-    GLES2_FragmentSrc_TextureARGBSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureRGBSrc = {
-    GL_FRAGMENT_SHADER,
-    GLES2_SOURCE_SHADER,
-    sizeof(GLES2_FragmentSrc_TextureRGBSrc_),
-    GLES2_FragmentSrc_TextureRGBSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureBGRSrc = {
-    GL_FRAGMENT_SHADER,
-    GLES2_SOURCE_SHADER,
-    sizeof(GLES2_FragmentSrc_TextureBGRSrc_),
-    GLES2_FragmentSrc_TextureBGRSrc_
-};
-
-/*************************************************************************************************
- * Vertex/fragment shader binaries (NVIDIA Tegra 1/2)                                            *
- *************************************************************************************************/
-
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-
-#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B
-
-static const Uint8 GLES2_VertexTegra_Default_[] = {
-    243, 193, 1, 142, 31, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
-    0, 0, 46, 0, 0, 0, 48, 0, 0, 0, 2, 0, 0, 0, 85, 0, 0, 0, 2, 0, 0, 0, 24, 0, 0, 0, 3, 0, 0, 0,
-    91, 0, 0, 0, 1, 0, 0, 0, 16, 0, 0, 0, 5, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 95, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
-    13, 0, 0, 0, 102, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 16, 0, 0, 0, 104, 0, 0, 0, 1, 0, 0, 0, 32, 0, 0, 0, 17, 0, 0, 0, 112, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 112, 0, 0, 0, 80, 0, 0, 0, 80, 0, 0, 0, 19, 0, 0, 0, 132, 0,
-    0, 0, 104, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97,
-    95, 112, 111, 115, 105, 116, 105, 111, 110, 0, 97, 95, 116, 101, 120, 67, 111, 111, 114, 100,
-    0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 112, 114, 111, 106, 101, 99,
-    116, 105, 111, 110, 0, 0, 0, 0, 0, 0, 0, 82, 139, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 80, 139, 0,
-    0, 1, 0, 0, 0, 22, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 33, 0, 0, 0, 92, 139, 0, 0,
-    1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 240, 0, 0, 0, 0, 0, 0, 1, 0,
-    0, 0, 64, 0, 0, 0, 80, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 193, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 66, 24, 0, 6, 34, 108, 28,
-    0, 0, 42, 16, 128, 0, 195, 192, 6, 129, 252, 255, 65, 96, 108, 28, 0, 0, 0, 0, 0, 1, 195, 192,
-    6, 1, 252, 255, 33, 96, 108, 156, 31, 64, 8, 1, 64, 0, 131, 192, 6, 1, 156, 159, 65, 96, 108,
-    28, 0, 0, 85, 32, 0, 1, 195, 192, 6, 1, 252, 255, 33, 96, 108, 156, 31, 64, 0, 64, 64, 0, 131,
-    192, 134, 1, 152, 31, 65, 96, 108, 156, 31, 64, 127, 48, 0, 1, 195, 192, 6, 129, 129, 255, 33,
-    96
-};
-
-static const Uint8 GLES2_FragmentTegra_None_SolidSrc_[] = {
-    155, 191, 159, 1, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
-    0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
-    75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0,
-    0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4,
-    0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0,
-    0, 108, 0, 0, 0, 108, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
-    0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 240, 0, 0,
-    0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0,
-    0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1,
-    0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 0, 0, 0, 0, 1, 0, 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 0, 0, 0,
-    0, 1, 0, 1, 39, 0, 0, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 0, 40, 0, 0, 0, 242, 65, 63,
-    192, 200, 0, 0, 0, 242, 65, 63, 128, 168, 0, 0, 0, 242, 65, 63, 64, 72, 0, 0, 0, 242, 65, 63,
-    1, 0, 6, 40, 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Alpha_SolidSrc_[] = {
-    169, 153, 195, 28, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
-    0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
-    75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0,
-    0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4,
-    0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0,
-    0, 220, 0, 0, 0, 220, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
-    0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 118, 118, 17, 241, 0, 0, 0, 240, 0,
-    0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0,
-    0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 21, 32, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78,
-    1, 0, 0, 0, 3, 0, 0, 0, 3, 0, 65, 37, 8, 0, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 21, 0,
-    0, 0, 0, 3, 0, 1, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 39, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 3, 0, 1, 40, 1, 0, 0, 0, 5, 0, 0, 0, 9, 0, 0, 0, 24, 0, 4, 40, 232, 231, 15,
-    0, 0, 242, 65, 62, 194, 72, 1, 0, 0, 250, 65, 63, 194, 40, 1, 0, 0, 250, 65, 63, 192, 168, 1,
-    0, 0, 242, 1, 64, 192, 168, 1, 0, 0, 242, 1, 68, 168, 32, 0, 0, 0, 50, 64, 0, 192, 168, 15,
-    0, 0, 242, 1, 66, 168, 64, 0, 16, 0, 242, 65, 1, 232, 231, 15, 0, 0, 242, 65, 62, 168, 160,
-    0, 0, 0, 50, 64, 2, 104, 192, 0, 0, 36, 48, 66, 4, 232, 231, 15, 0, 0, 242, 65, 62, 3, 0, 6,
-    40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 41, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Additive_SolidSrc_[] = {
-    59, 71, 42, 17, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, 0,
-    0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
-    75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0,
-    0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4,
-    0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0,
-    0, 108, 0, 0, 0, 108, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
-    0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 22, 22, 17, 241, 0, 0, 0, 240, 0,
-    0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0,
-    0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78,
-    1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 8, 0, 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 0,
-    0, 0, 0, 1, 0, 1, 39, 0, 0, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 192, 200, 0, 0, 0, 26,
-    0, 70, 192, 40, 0, 0, 0, 2, 0, 64, 192, 72, 0, 0, 0, 10, 0, 66, 192, 168, 0, 0, 0, 18, 0, 68,
-    1, 0, 6, 40, 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Modulated_SolidSrc_[] = {
-    37, 191, 49, 17, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, 0,
-    0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
-    75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0,
-    0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4,
-    0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0,
-    0, 108, 0, 0, 0, 108, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0,
-    0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 32, 32, 17, 241, 0, 0, 0, 240, 0,
-    0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0,
-    0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78,
-    1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 8, 0, 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 0,
-    0, 0, 0, 1, 0, 1, 39, 0, 0, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 104, 192, 0, 0, 0, 242,
-    1, 70, 8, 32, 0, 0, 0, 242, 1, 64, 40, 64, 0, 0, 0, 242, 1, 66, 72, 160, 0, 0, 0, 242, 1, 68,
-    1, 0, 6, 40, 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_None_TextureSrc_[] = {
-    220, 217, 41, 211, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
-    0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
-    82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
-    0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0,
-    13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4,
-    0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0,
-    0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135,
-    0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
-    0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108,
-    97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0,
-    2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0,
-    0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 1, 0, 0, 0, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240,
-    0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0,
-    0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0,
-    0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 0, 0, 0, 0, 1, 0,
-    0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 1, 0, 0, 0, 2, 0, 4, 38, 186, 81, 78, 16, 2, 1, 0, 0, 1, 0,
-    1, 39, 0, 4, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 104, 192, 0, 0, 0, 242, 1, 70, 8, 32,
-    0, 0, 0, 242, 1, 64, 40, 64, 0, 0, 0, 242, 1, 66, 72, 160, 0, 0, 0, 242, 1, 68, 1, 0, 6, 40,
-    0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Alpha_TextureSrc_[] = {
-    71, 202, 114, 229, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
-    0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
-    82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
-    0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0,
-    13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4,
-    0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0,
-    0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135,
-    0, 0, 0, 176, 0, 0, 0, 176, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
-    0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108,
-    97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0,
-    2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0,
-    0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 1, 118, 118, 17, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0,
-    240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0,
-    1, 0, 0, 0, 2, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16,
-    0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 65, 37, 0, 0, 0, 0,
-    8, 0, 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 2, 0, 1, 38, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 38, 186,
-    81, 78, 16, 2, 1, 0, 0, 2, 0, 1, 39, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 1, 40, 1, 0, 0, 0, 5, 0,
-    0, 0, 16, 0, 4, 40, 40, 160, 1, 0, 0, 242, 1, 66, 8, 192, 1, 0, 0, 242, 1, 64, 104, 32, 1, 0,
-    0, 242, 1, 70, 72, 64, 1, 0, 0, 242, 1, 68, 154, 192, 0, 0, 37, 34, 64, 3, 8, 32, 0, 0, 5, 58,
-    208, 4, 40, 64, 0, 0, 5, 50, 208, 4, 72, 160, 0, 0, 37, 42, 208, 4, 2, 0, 6, 40, 0, 0, 0, 0,
-    0, 0, 0, 0, 2, 0, 1, 41, 0, 0, 0, 0, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Additive_TextureSrc_[] = {
-    161, 234, 193, 234, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
-    0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
-    82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
-    0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0,
-    13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4,
-    0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0,
-    0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135,
-    0, 0, 0, 176, 0, 0, 0, 176, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
-    0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108,
-    97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0,
-    2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0,
-    0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 1, 22, 22, 17, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240,
-    0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0,
-    0, 0, 2, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0,
-    0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 65, 37, 0, 0, 0, 0, 8, 0,
-    129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 2, 0, 1, 38, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 38, 186, 81,
-    78, 16, 2, 1, 0, 0, 2, 0, 1, 39, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 1, 40, 1, 0, 0, 0, 5, 0, 0, 0,
-    16, 0, 4, 40, 40, 160, 1, 0, 0, 242, 1, 66, 104, 32, 1, 0, 0, 242, 1, 70, 8, 192, 1, 0, 0, 242,
-    1, 64, 72, 64, 1, 0, 0, 242, 1, 68, 136, 192, 0, 0, 0, 26, 64, 4, 136, 32, 0, 0, 0, 2, 64, 7,
-    136, 64, 0, 0, 0, 10, 64, 6, 136, 160, 0, 0, 0, 18, 64, 5, 2, 0, 6, 40, 0, 0, 0, 0, 0, 0, 0,
-    0, 2, 0, 1, 41, 0, 0, 0, 0, 5, 0, 2, 0
-};
-
-static const Uint8 GLES2_FragmentTegra_Modulated_TextureSrc_[] = {
-    75, 132, 201, 227, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0,
-    0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
-    82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
-    0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0,
-    13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4,
-    0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0,
-    0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135,
-    0, 0, 0, 176, 0, 0, 0, 176, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
-    0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108,
-    97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0,
-    2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0,
-    0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 1, 32, 32, 17, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240,
-    0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0,
-    0, 0, 2, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0,
-    0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 65, 37, 0, 0, 0, 0, 8, 0,
-    129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 2, 0, 1, 38, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 38, 186, 81,
-    78, 16, 2, 1, 0, 0, 2, 0, 1, 39, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 1, 40, 1, 0, 0, 0, 5, 0, 0, 0,
-    16, 0, 4, 40, 40, 160, 1, 0, 0, 242, 1, 66, 8, 192, 1, 0, 0, 242, 1, 64, 104, 32, 1, 0, 0, 242,
-    1, 70, 72, 64, 1, 0, 0, 242, 1, 68, 104, 192, 0, 0, 0, 242, 65, 4, 232, 32, 0, 0, 0, 242, 65,
-    0, 40, 64, 0, 0, 0, 242, 65, 6, 72, 160, 0, 0, 0, 242, 65, 5, 2, 0, 6, 40, 0, 0, 0, 0, 0, 0,
-    0, 0, 2, 0, 1, 41, 0, 0, 0, 0, 5, 0, 2, 0
-};
-
-static const GLES2_ShaderInstance GLES2_VertexTegra_Default = {
-    GL_VERTEX_SHADER,
-    GL_NVIDIA_PLATFORM_BINARY_NV,
-    sizeof(GLES2_VertexTegra_Default_),
-    GLES2_VertexTegra_Default_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_None_SolidSrc = {
-    GL_FRAGMENT_SHADER,
-    GL_NVIDIA_PLATFORM_BINARY_NV,
-    sizeof(GLES2_FragmentTegra_None_SolidSrc_),
-    GLES2_FragmentTegra_None_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Alpha_SolidSrc = {
-    GL_FRAGMENT_SHADER,
-    GL_NVIDIA_PLATFORM_BINARY_NV,
-    sizeof(GLES2_FragmentTegra_Alpha_SolidSrc_),
-    GLES2_FragmentTegra_Alpha_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Additive_SolidSrc = {
-    GL_FRAGMENT_SHADER,
-    GL_NVIDIA_PLATFORM_BINARY_NV,
-    sizeof(GLES2_FragmentTegra_Additive_SolidSrc_),
-    GLES2_FragmentTegra_Additive_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Modulated_SolidSrc = {
-    GL_FRAGMENT_SHADER,
-    GL_NVIDIA_PLATFORM_BINARY_NV,
-    sizeof(GLES2_FragmentTegra_Modulated_SolidSrc_),
-    GLES2_FragmentTegra_Modulated_SolidSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_None_TextureSrc = {
-    GL_FRAGMENT_SHADER,
-    GL_NVIDIA_PLATFORM_BINARY_NV,
-    sizeof(GLES2_FragmentTegra_None_TextureSrc_),
-    GLES2_FragmentTegra_None_TextureSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Alpha_TextureSrc = {
-    GL_FRAGMENT_SHADER,
-    GL_NVIDIA_PLATFORM_BINARY_NV,
-    sizeof(GLES2_FragmentTegra_Alpha_TextureSrc_),
-    GLES2_FragmentTegra_Alpha_TextureSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Additive_TextureSrc = {
-    GL_FRAGMENT_SHADER,
-    GL_NVIDIA_PLATFORM_BINARY_NV,
-    sizeof(GLES2_FragmentTegra_Additive_TextureSrc_),
-    GLES2_FragmentTegra_Additive_TextureSrc_
-};
-
-static const GLES2_ShaderInstance GLES2_FragmentTegra_Modulated_TextureSrc = {
-    GL_FRAGMENT_SHADER,
-    GL_NVIDIA_PLATFORM_BINARY_NV,
-    sizeof(GLES2_FragmentTegra_Modulated_TextureSrc_),
-    GLES2_FragmentTegra_Modulated_TextureSrc_
-};
-
-#endif /* GLES2_INCLUDE_NVIDIA_SHADERS */
-
-/*************************************************************************************************
- * Vertex/fragment shader definitions                                                            *
- *************************************************************************************************/
-
-static GLES2_Shader GLES2_VertexShader_Default = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-    2,
-#else
-    1,
-#endif
-    {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-        &GLES2_VertexTegra_Default,
-#endif
-        &GLES2_VertexSrc_Default
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_SolidSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-    2,
-#else
-    1,
-#endif
-    {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-        &GLES2_FragmentTegra_None_SolidSrc,
-#endif
-        &GLES2_FragmentSrc_SolidSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_SolidSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-    2,
-#else
-    1,
-#endif
-    {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-        &GLES2_FragmentTegra_Alpha_SolidSrc,
-#endif
-        &GLES2_FragmentSrc_SolidSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_SolidSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-    2,
-#else
-    1,
-#endif
-    {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-        &GLES2_FragmentTegra_Additive_SolidSrc,
-#endif
-        &GLES2_FragmentSrc_SolidSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_SolidSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-    2,
-#else
-    1,
-#endif
-    {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-        &GLES2_FragmentTegra_Modulated_SolidSrc,
-#endif
-        &GLES2_FragmentSrc_SolidSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_TextureABGRSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-    2,
-#else
-    1,
-#endif
-    {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-        &GLES2_FragmentTegra_None_TextureSrc,
-#endif
-        &GLES2_FragmentSrc_TextureABGRSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_TextureABGRSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-    2,
-#else
-    1,
-#endif
-    {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-        &GLES2_FragmentTegra_Alpha_TextureSrc,
-#endif
-        &GLES2_FragmentSrc_TextureABGRSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_TextureABGRSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-    2,
-#else
-    1,
-#endif
-    {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-        &GLES2_FragmentTegra_Additive_TextureSrc,
-#endif
-        &GLES2_FragmentSrc_TextureABGRSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_TextureABGRSrc = {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-    2,
-#else
-    1,
-#endif
-    {
-#if GLES2_INCLUDE_NVIDIA_SHADERS
-        &GLES2_FragmentTegra_Modulated_TextureSrc,
-#endif
-        &GLES2_FragmentSrc_TextureABGRSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_TextureARGBSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureARGBSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_TextureARGBSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureARGBSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_TextureARGBSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureARGBSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_TextureARGBSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureARGBSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_TextureRGBSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureRGBSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_TextureRGBSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureRGBSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_TextureRGBSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureRGBSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_TextureRGBSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureRGBSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_None_TextureBGRSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureBGRSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Alpha_TextureBGRSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureBGRSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Additive_TextureBGRSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureBGRSrc
-    }
-};
-
-static GLES2_Shader GLES2_FragmentShader_Modulated_TextureBGRSrc = {
-    1,
-    {
-        &GLES2_FragmentSrc_TextureBGRSrc
-    }
-};
-
-/*************************************************************************************************
- * Shader selector                                                                               *
- *************************************************************************************************/
-
-const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMode)
-{
-    switch (type)
-    {
-    case GLES2_SHADER_VERTEX_DEFAULT:
-        return &GLES2_VertexShader_Default;
-    case GLES2_SHADER_FRAGMENT_SOLID_SRC:
-    switch (blendMode)
-    {
-    case SDL_BLENDMODE_NONE:
-        return &GLES2_FragmentShader_None_SolidSrc;
-    case SDL_BLENDMODE_BLEND:
-        return &GLES2_FragmentShader_Alpha_SolidSrc;
-    case SDL_BLENDMODE_ADD:
-        return &GLES2_FragmentShader_Additive_SolidSrc;
-    case SDL_BLENDMODE_MOD:
-        return &GLES2_FragmentShader_Modulated_SolidSrc;
-    default:
-        return NULL;
-    }
-    case GLES2_SHADER_FRAGMENT_TEXTURE_ABGR_SRC:
-        switch (blendMode)
-    {
-        case SDL_BLENDMODE_NONE:
-            return &GLES2_FragmentShader_None_TextureABGRSrc;
-        case SDL_BLENDMODE_BLEND:
-            return &GLES2_FragmentShader_Alpha_TextureABGRSrc;
-        case SDL_BLENDMODE_ADD:
-            return &GLES2_FragmentShader_Additive_TextureABGRSrc;
-        case SDL_BLENDMODE_MOD:
-            return &GLES2_FragmentShader_Modulated_TextureABGRSrc;
-        default:
-            return NULL;
-    }
-    case GLES2_SHADER_FRAGMENT_TEXTURE_ARGB_SRC:
-        switch (blendMode)
-    {
-        case SDL_BLENDMODE_NONE:
-            return &GLES2_FragmentShader_None_TextureARGBSrc;
-        case SDL_BLENDMODE_BLEND:
-            return &GLES2_FragmentShader_Alpha_TextureARGBSrc;
-        case SDL_BLENDMODE_ADD:
-            return &GLES2_FragmentShader_Additive_TextureARGBSrc;
-        case SDL_BLENDMODE_MOD:
-            return &GLES2_FragmentShader_Modulated_TextureARGBSrc;
-        default:
-            return NULL;
-    }
-
-    case GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC:
-        switch (blendMode)
-    {
-        case SDL_BLENDMODE_NONE:
-            return &GLES2_FragmentShader_None_TextureRGBSrc;
-        case SDL_BLENDMODE_BLEND:
-            return &GLES2_FragmentShader_Alpha_TextureRGBSrc;
-        case SDL_BLENDMODE_ADD:
-            return &GLES2_FragmentShader_Additive_TextureRGBSrc;
-        case SDL_BLENDMODE_MOD:
-            return &GLES2_FragmentShader_Modulated_TextureRGBSrc;
-        default:
-            return NULL;
-    }
-
-    case GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC:
-        switch (blendMode)
-    {
-        case SDL_BLENDMODE_NONE:
-            return &GLES2_FragmentShader_None_TextureBGRSrc;
-        case SDL_BLENDMODE_BLEND:
-            return &GLES2_FragmentShader_Alpha_TextureBGRSrc;
-        case SDL_BLENDMODE_ADD:
-            return &GLES2_FragmentShader_Additive_TextureBGRSrc;
-        case SDL_BLENDMODE_MOD:
-            return &GLES2_FragmentShader_Modulated_TextureBGRSrc;
-        default:
-            return NULL;
-    }
-
-    default:
-        return NULL;
-    }
-}
-
-#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/opengles2/SDL_shaders_gles2.h b/deps/SDL2/src/render/opengles2/SDL_shaders_gles2.h
deleted file mode 100644
index 73f7066..0000000
--- a/deps/SDL2/src/render/opengles2/SDL_shaders_gles2.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_RENDER_OGL_ES2
-
-#ifndef SDL_shaderdata_h_
-#define SDL_shaderdata_h_
-
-typedef struct GLES2_ShaderInstance
-{
-    GLenum type;
-    GLenum format;
-    int length;
-    const void *data;
-} GLES2_ShaderInstance;
-
-typedef struct GLES2_Shader
-{
-    int instance_count;
-    const GLES2_ShaderInstance *instances[4];
-} GLES2_Shader;
-
-typedef enum
-{
-    GLES2_SHADER_VERTEX_DEFAULT,
-    GLES2_SHADER_FRAGMENT_SOLID_SRC,
-    GLES2_SHADER_FRAGMENT_TEXTURE_ABGR_SRC,
-    GLES2_SHADER_FRAGMENT_TEXTURE_ARGB_SRC,
-    GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC,
-    GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC
-} GLES2_ShaderType;
-
-#define GLES2_SOURCE_SHADER (GLenum)-1
-
-const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMode);
-
-#endif /* SDL_shaderdata_h_ */
-
-#endif /* SDL_VIDEO_RENDER_OGL_ES2 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/psp/SDL_render_psp.c b/deps/SDL2/src/render/psp/SDL_render_psp.c
deleted file mode 100644
index b8cd265..0000000
--- a/deps/SDL2/src/render/psp/SDL_render_psp.c
+++ /dev/null
@@ -1,1020 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_RENDER_PSP
-
-#include "SDL_hints.h"
-#include "../SDL_sysrender.h"
-
-#include <pspkernel.h>
-#include <pspdisplay.h>
-#include <pspgu.h>
-#include <pspgum.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <pspge.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <vram.h>
-
-
-
-
-/* PSP renderer implementation, based on the PGE  */
-
-
-extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
-
-
-static SDL_Renderer *PSP_CreateRenderer(SDL_Window * window, Uint32 flags);
-static void PSP_WindowEvent(SDL_Renderer * renderer,
-                             const SDL_WindowEvent *event);
-static int PSP_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int PSP_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                              const SDL_Rect * rect, const void *pixels,
-                              int pitch);
-static int PSP_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                            const SDL_Rect * rect, void **pixels, int *pitch);
-static void PSP_UnlockTexture(SDL_Renderer * renderer,
-                               SDL_Texture * texture);
-static int PSP_SetRenderTarget(SDL_Renderer * renderer,
-                                 SDL_Texture * texture);
-static int PSP_UpdateViewport(SDL_Renderer * renderer);
-static int PSP_RenderClear(SDL_Renderer * renderer);
-static int PSP_RenderDrawPoints(SDL_Renderer * renderer,
-                                 const SDL_FPoint * points, int count);
-static int PSP_RenderDrawLines(SDL_Renderer * renderer,
-                                const SDL_FPoint * points, int count);
-static int PSP_RenderFillRects(SDL_Renderer * renderer,
-                                const SDL_FRect * rects, int count);
-static int PSP_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-                           const SDL_Rect * srcrect,
-                           const SDL_FRect * dstrect);
-static int PSP_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                    Uint32 pixel_format, void * pixels, int pitch);
-static int PSP_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-                         const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-                         const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip);
-static void PSP_RenderPresent(SDL_Renderer * renderer);
-static void PSP_DestroyTexture(SDL_Renderer * renderer,
-                                SDL_Texture * texture);
-static void PSP_DestroyRenderer(SDL_Renderer * renderer);
-
-/*
-SDL_RenderDriver PSP_RenderDriver = {
-    PSP_CreateRenderer,
-    {
-     "PSP",
-     (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE),
-     1,
-     {SDL_PIXELFORMAT_ABGR8888},
-     0,
-     0}
-};
-*/
-SDL_RenderDriver PSP_RenderDriver = {
-    .CreateRenderer = PSP_CreateRenderer,
-    .info = {
-        .name = "PSP",
-        .flags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE,
-        .num_texture_formats = 4,
-        .texture_formats = { [0] = SDL_PIXELFORMAT_BGR565,
-                                                 [1] = SDL_PIXELFORMAT_ABGR1555,
-                                                 [2] = SDL_PIXELFORMAT_ABGR4444,
-                                                 [3] = SDL_PIXELFORMAT_ABGR8888,
-        },
-        .max_texture_width = 512,
-        .max_texture_height = 512,
-     }
-};
-
-#define PSP_SCREEN_WIDTH    480
-#define PSP_SCREEN_HEIGHT   272
-
-#define PSP_FRAME_BUFFER_WIDTH  512
-#define PSP_FRAME_BUFFER_SIZE   (PSP_FRAME_BUFFER_WIDTH*PSP_SCREEN_HEIGHT)
-
-static unsigned int __attribute__((aligned(16))) DisplayList[262144];
-
-
-#define COL5650(r,g,b,a)    ((r>>3) | ((g>>2)<<5) | ((b>>3)<<11))
-#define COL5551(r,g,b,a)    ((r>>3) | ((g>>3)<<5) | ((b>>3)<<10) | (a>0?0x7000:0))
-#define COL4444(r,g,b,a)    ((r>>4) | ((g>>4)<<4) | ((b>>4)<<8) | ((a>>4)<<12))
-#define COL8888(r,g,b,a)    ((r) | ((g)<<8) | ((b)<<16) | ((a)<<24))
-
-
-typedef struct
-{
-    void*           frontbuffer ;
-    void*           backbuffer ;
-    SDL_bool        initialized ;
-    SDL_bool        displayListAvail ;
-    unsigned int    psm ;
-    unsigned int    bpp ;
-
-    SDL_bool        vsync;
-    unsigned int    currentColor;
-    int             currentBlendMode;
-
-} PSP_RenderData;
-
-
-typedef struct
-{
-    void                *data;                              /**< Image data. */
-    unsigned int        size;                               /**< Size of data in bytes. */
-    unsigned int        width;                              /**< Image width. */
-    unsigned int        height;                             /**< Image height. */
-    unsigned int        textureWidth;                       /**< Texture width (power of two). */
-    unsigned int        textureHeight;                      /**< Texture height (power of two). */
-    unsigned int        bits;                               /**< Image bits per pixel. */
-    unsigned int        format;                             /**< Image format - one of ::pgePixelFormat. */
-    unsigned int        pitch;
-    SDL_bool            swizzled;                           /**< Is image swizzled. */
-
-} PSP_TextureData;
-
-typedef struct
-{
-    float   x, y, z;
-} VertV;
-
-
-typedef struct
-{
-    float   u, v;
-    float   x, y, z;
-
-} VertTV;
-
-
-/* Return next power of 2 */
-static int
-TextureNextPow2(unsigned int w)
-{
-    if(w == 0)
-        return 0;
-
-    unsigned int n = 2;
-
-    while(w > n)
-        n <<= 1;
-
-    return n;
-}
-
-
-static int
-GetScaleQuality(void)
-{
-    const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
-
-    if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
-        return GU_NEAREST; /* GU_NEAREST good for tile-map */
-    } else {
-        return GU_LINEAR; /* GU_LINEAR good for scaling */
-    }
-}
-
-static int
-PixelFormatToPSPFMT(Uint32 format)
-{
-    switch (format) {
-    case SDL_PIXELFORMAT_BGR565:
-        return GU_PSM_5650;
-    case SDL_PIXELFORMAT_ABGR1555:
-        return GU_PSM_5551;
-    case SDL_PIXELFORMAT_ABGR4444:
-        return GU_PSM_4444;
-    case SDL_PIXELFORMAT_ABGR8888:
-        return GU_PSM_8888;
-    default:
-        return GU_PSM_8888;
-    }
-}
-
-void
-StartDrawing(SDL_Renderer * renderer)
-{
-    PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata;
-    if(data->displayListAvail)
-        return;
-
-    sceGuStart(GU_DIRECT, DisplayList);
-    data->displayListAvail = SDL_TRUE;
-}
-
-
-int
-TextureSwizzle(PSP_TextureData *psp_texture)
-{
-    if(psp_texture->swizzled)
-        return 1;
-
-    int bytewidth = psp_texture->textureWidth*(psp_texture->bits>>3);
-    int height = psp_texture->size / bytewidth;
-
-    int rowblocks = (bytewidth>>4);
-    int rowblocksadd = (rowblocks-1)<<7;
-    unsigned int blockaddress = 0;
-    unsigned int *src = (unsigned int*) psp_texture->data;
-
-    unsigned char *data = NULL;
-    data = malloc(psp_texture->size);
-
-    int j;
-
-    for(j = 0; j < height; j++, blockaddress += 16)
-    {
-        unsigned int *block;
-
-        block = (unsigned int*)&data[blockaddress];
-
-        int i;
-
-        for(i = 0; i < rowblocks; i++)
-        {
-            *block++ = *src++;
-            *block++ = *src++;
-            *block++ = *src++;
-            *block++ = *src++;
-            block += 28;
-        }
-
-        if((j & 0x7) == 0x7)
-            blockaddress += rowblocksadd;
-    }
-
-    free(psp_texture->data);
-    psp_texture->data = data;
-    psp_texture->swizzled = SDL_TRUE;
-
-    return 1;
-}
-int TextureUnswizzle(PSP_TextureData *psp_texture)
-{
-    if(!psp_texture->swizzled)
-        return 1;
-
-    int blockx, blocky;
-
-    int bytewidth = psp_texture->textureWidth*(psp_texture->bits>>3);
-    int height = psp_texture->size / bytewidth;
-
-    int widthblocks = bytewidth/16;
-    int heightblocks = height/8;
-
-    int dstpitch = (bytewidth - 16)/4;
-    int dstrow = bytewidth * 8;
-
-    unsigned int *src = (unsigned int*) psp_texture->data;
-
-    unsigned char *data = NULL;
-
-    data = malloc(psp_texture->size);
-
-    if(!data)
-        return 0;
-
-    sceKernelDcacheWritebackAll();
-
-    int j;
-
-    unsigned char *ydst = (unsigned char *)data;
-
-    for(blocky = 0; blocky < heightblocks; ++blocky)
-    {
-        unsigned char *xdst = ydst;
-
-        for(blockx = 0; blockx < widthblocks; ++blockx)
-        {
-            unsigned int *block;
-
-            block = (unsigned int*)xdst;
-
-            for(j = 0; j < 8; ++j)
-            {
-                *(block++) = *(src++);
-                *(block++) = *(src++);
-                *(block++) = *(src++);
-                *(block++) = *(src++);
-                block += dstpitch;
-            }
-
-            xdst += 16;
-        }
-
-        ydst += dstrow;
-    }
-
-    free(psp_texture->data);
-
-    psp_texture->data = data;
-
-    psp_texture->swizzled = SDL_FALSE;
-
-    return 1;
-}
-
-SDL_Renderer *
-PSP_CreateRenderer(SDL_Window * window, Uint32 flags)
-{
-
-    SDL_Renderer *renderer;
-    PSP_RenderData *data;
-        int pixelformat;
-    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
-    if (!renderer) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    data = (PSP_RenderData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        PSP_DestroyRenderer(renderer);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-
-    renderer->WindowEvent = PSP_WindowEvent;
-    renderer->CreateTexture = PSP_CreateTexture;
-    renderer->UpdateTexture = PSP_UpdateTexture;
-    renderer->LockTexture = PSP_LockTexture;
-    renderer->UnlockTexture = PSP_UnlockTexture;
-    renderer->SetRenderTarget = PSP_SetRenderTarget;
-    renderer->UpdateViewport = PSP_UpdateViewport;
-    renderer->RenderClear = PSP_RenderClear;
-    renderer->RenderDrawPoints = PSP_RenderDrawPoints;
-    renderer->RenderDrawLines = PSP_RenderDrawLines;
-    renderer->RenderFillRects = PSP_RenderFillRects;
-    renderer->RenderCopy = PSP_RenderCopy;
-    renderer->RenderReadPixels = PSP_RenderReadPixels;
-    renderer->RenderCopyEx = PSP_RenderCopyEx;
-    renderer->RenderPresent = PSP_RenderPresent;
-    renderer->DestroyTexture = PSP_DestroyTexture;
-    renderer->DestroyRenderer = PSP_DestroyRenderer;
-    renderer->info = PSP_RenderDriver.info;
-    renderer->info.flags = SDL_RENDERER_ACCELERATED;
-    renderer->driverdata = data;
-    renderer->window = window;
-
-    if (data->initialized != SDL_FALSE)
-        return 0;
-    data->initialized = SDL_TRUE;
-
-    if (flags & SDL_RENDERER_PRESENTVSYNC) {
-        data->vsync = SDL_TRUE;
-    } else {
-        data->vsync = SDL_FALSE;
-    }
-
-    pixelformat=PixelFormatToPSPFMT(SDL_GetWindowPixelFormat(window));
-    switch(pixelformat)
-    {
-        case GU_PSM_4444:
-        case GU_PSM_5650:
-        case GU_PSM_5551:
-            data->frontbuffer = (unsigned int *)(PSP_FRAME_BUFFER_SIZE<<1);
-            data->backbuffer =  (unsigned int *)(0);
-            data->bpp = 2;
-            data->psm = pixelformat;
-            break;
-        default:
-            data->frontbuffer = (unsigned int *)(PSP_FRAME_BUFFER_SIZE<<2);
-            data->backbuffer =  (unsigned int *)(0);
-            data->bpp = 4;
-            data->psm = GU_PSM_8888;
-            break;
-    }
-
-    sceGuInit();
-    /* setup GU */
-    sceGuStart(GU_DIRECT, DisplayList);
-    sceGuDrawBuffer(data->psm, data->frontbuffer, PSP_FRAME_BUFFER_WIDTH);
-    sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, data->backbuffer, PSP_FRAME_BUFFER_WIDTH);
-
-
-    sceGuOffset(2048 - (PSP_SCREEN_WIDTH>>1), 2048 - (PSP_SCREEN_HEIGHT>>1));
-    sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
-
-    data->frontbuffer = vabsptr(data->frontbuffer);
-    data->backbuffer = vabsptr(data->backbuffer);
-
-    /* Scissoring */
-    sceGuScissor(0, 0, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
-    sceGuEnable(GU_SCISSOR_TEST);
-
-    /* Backface culling */
-    sceGuFrontFace(GU_CCW);
-    sceGuEnable(GU_CULL_FACE);
-
-    /* Texturing */
-    sceGuEnable(GU_TEXTURE_2D);
-    sceGuShadeModel(GU_SMOOTH);
-    sceGuTexWrap(GU_REPEAT, GU_REPEAT);
-
-    /* Blending */
-    sceGuEnable(GU_BLEND);
-    sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
-
-    sceGuTexFilter(GU_LINEAR,GU_LINEAR);
-
-    sceGuFinish();
-    sceGuSync(0,0);
-    sceDisplayWaitVblankStartCB();
-    sceGuDisplay(GU_TRUE);
-
-    return renderer;
-}
-
-static void
-PSP_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
-{
-
-}
-
-
-static int
-PSP_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-/*      PSP_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata; */
-    PSP_TextureData* psp_texture = (PSP_TextureData*) SDL_calloc(1, sizeof(*psp_texture));;
-
-    if(!psp_texture)
-        return -1;
-
-    psp_texture->swizzled = SDL_FALSE;
-    psp_texture->width = texture->w;
-    psp_texture->height = texture->h;
-    psp_texture->textureHeight = TextureNextPow2(texture->h);
-    psp_texture->textureWidth = TextureNextPow2(texture->w);
-    psp_texture->format = PixelFormatToPSPFMT(texture->format);
-
-    switch(psp_texture->format)
-    {
-        case GU_PSM_5650:
-        case GU_PSM_5551:
-        case GU_PSM_4444:
-            psp_texture->bits = 16;
-            break;
-
-        case GU_PSM_8888:
-            psp_texture->bits = 32;
-            break;
-
-        default:
-            return -1;
-    }
-
-    psp_texture->pitch = psp_texture->textureWidth * SDL_BYTESPERPIXEL(texture->format);
-    psp_texture->size = psp_texture->textureHeight*psp_texture->pitch;
-    psp_texture->data = SDL_calloc(1, psp_texture->size);
-
-    if(!psp_texture->data)
-    {
-        SDL_free(psp_texture);
-        return SDL_OutOfMemory();
-    }
-    texture->driverdata = psp_texture;
-
-    return 0;
-}
-
-
-void
-TextureActivate(SDL_Texture * texture)
-{
-    PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata;
-    int scaleMode = GetScaleQuality();
-
-    /* Swizzling is useless with small textures. */
-    if (texture->w >= 16 || texture->h >= 16)
-    {
-        TextureSwizzle(psp_texture);
-    }
-
-    sceGuEnable(GU_TEXTURE_2D);
-    sceGuTexWrap(GU_REPEAT, GU_REPEAT);
-    sceGuTexMode(psp_texture->format, 0, 0, psp_texture->swizzled);
-    sceGuTexFilter(scaleMode, scaleMode); /* GU_NEAREST good for tile-map */
-                                          /* GU_LINEAR good for scaling */
-    sceGuTexImage(0, psp_texture->textureWidth, psp_texture->textureHeight, psp_texture->textureWidth, psp_texture->data);
-    sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
-}
-
-
-static int
-PSP_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                   const SDL_Rect * rect, const void *pixels, int pitch)
-{
-/*  PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; */
-    const Uint8 *src;
-    Uint8 *dst;
-    int row, length,dpitch;
-    src = pixels;
-
-    PSP_LockTexture(renderer, texture,rect,(void **)&dst, &dpitch);
-    length = rect->w * SDL_BYTESPERPIXEL(texture->format);
-    if (length == pitch && length == dpitch) {
-        SDL_memcpy(dst, src, length*rect->h);
-    } else {
-        for (row = 0; row < rect->h; ++row) {
-            SDL_memcpy(dst, src, length);
-            src += pitch;
-            dst += dpitch;
-        }
-    }
-
-    sceKernelDcacheWritebackAll();
-    return 0;
-}
-
-static int
-PSP_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                 const SDL_Rect * rect, void **pixels, int *pitch)
-{
-    PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata;
-
-    *pixels =
-        (void *) ((Uint8 *) psp_texture->data + rect->y * psp_texture->pitch +
-                  rect->x * SDL_BYTESPERPIXEL(texture->format));
-    *pitch = psp_texture->pitch;
-    return 0;
-}
-
-static void
-PSP_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata;
-    SDL_Rect rect;
-
-    /* We do whole texture updates, at least for now */
-    rect.x = 0;
-    rect.y = 0;
-    rect.w = texture->w;
-    rect.h = texture->h;
-    PSP_UpdateTexture(renderer, texture, &rect, psp_texture->data, psp_texture->pitch);
-}
-
-static int
-PSP_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-
-    return 0;
-}
-
-static int
-PSP_UpdateViewport(SDL_Renderer * renderer)
-{
-
-    return 0;
-}
-
-
-static void
-PSP_SetBlendMode(SDL_Renderer * renderer, int blendMode)
-{
-    PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata;
-    if (blendMode != data-> currentBlendMode) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_NONE:
-                sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
-                sceGuDisable(GU_BLEND);
-            break;
-        case SDL_BLENDMODE_BLEND:
-                sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA);
-                sceGuEnable(GU_BLEND);
-                sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0 );
-            break;
-        case SDL_BLENDMODE_ADD:
-                sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA);
-                sceGuEnable(GU_BLEND);
-                sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_FIX, 0, 0x00FFFFFF );
-            break;
-        case SDL_BLENDMODE_MOD:
-                sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA);
-                sceGuEnable(GU_BLEND);
-                sceGuBlendFunc( GU_ADD, GU_FIX, GU_SRC_COLOR, 0, 0);
-            break;
-        }
-        data->currentBlendMode = blendMode;
-    }
-}
-
-
-
-static int
-PSP_RenderClear(SDL_Renderer * renderer)
-{
-    /* start list */
-    StartDrawing(renderer);
-    int color = renderer->a << 24 | renderer->b << 16 | renderer->g << 8 | renderer->r;
-    sceGuClearColor(color);
-    sceGuClearDepth(0);
-    sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT|GU_FAST_CLEAR_BIT);
-
-    return 0;
-}
-
-static int
-PSP_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points,
-                      int count)
-{
-    int color = renderer->a << 24 | renderer->b << 16 | renderer->g << 8 | renderer->r;
-    int i;
-    StartDrawing(renderer);
-    VertV* vertices = (VertV*)sceGuGetMemory(count*sizeof(VertV));
-
-    for (i = 0; i < count; ++i) {
-            vertices[i].x = points[i].x;
-            vertices[i].y = points[i].y;
-            vertices[i].z = 0.0f;
-    }
-    sceGuDisable(GU_TEXTURE_2D);
-    sceGuColor(color);
-    sceGuShadeModel(GU_FLAT);
-    sceGuDrawArray(GU_POINTS, GU_VERTEX_32BITF|GU_TRANSFORM_2D, count, 0, vertices);
-    sceGuShadeModel(GU_SMOOTH);
-    sceGuEnable(GU_TEXTURE_2D);
-
-    return 0;
-}
-
-static int
-PSP_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points,
-                     int count)
-{
-    int color = renderer->a << 24 | renderer->b << 16 | renderer->g << 8 | renderer->r;
-    int i;
-    StartDrawing(renderer);
-    VertV* vertices = (VertV*)sceGuGetMemory(count*sizeof(VertV));
-
-    for (i = 0; i < count; ++i) {
-            vertices[i].x = points[i].x;
-            vertices[i].y = points[i].y;
-            vertices[i].z = 0.0f;
-    }
-
-    sceGuDisable(GU_TEXTURE_2D);
-    sceGuColor(color);
-    sceGuShadeModel(GU_FLAT);
-    sceGuDrawArray(GU_LINE_STRIP, GU_VERTEX_32BITF|GU_TRANSFORM_2D, count, 0, vertices);
-    sceGuShadeModel(GU_SMOOTH);
-    sceGuEnable(GU_TEXTURE_2D);
-
-    return 0;
-}
-
-static int
-PSP_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects,
-                     int count)
-{
-    int color = renderer->a << 24 | renderer->b << 16 | renderer->g << 8 | renderer->r;
-    int i;
-    StartDrawing(renderer);
-
-    for (i = 0; i < count; ++i) {
-        const SDL_FRect *rect = &rects[i];
-        VertV* vertices = (VertV*)sceGuGetMemory((sizeof(VertV)<<1));
-        vertices[0].x = rect->x;
-        vertices[0].y = rect->y;
-        vertices[0].z = 0.0f;
-
-        vertices[1].x = rect->x + rect->w;
-        vertices[1].y = rect->y + rect->h;
-        vertices[1].z = 0.0f;
-
-        sceGuDisable(GU_TEXTURE_2D);
-        sceGuColor(color);
-        sceGuShadeModel(GU_FLAT);
-        sceGuDrawArray(GU_SPRITES, GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
-        sceGuShadeModel(GU_SMOOTH);
-        sceGuEnable(GU_TEXTURE_2D);
-    }
-
-    return 0;
-}
-
-
-#define PI   3.14159265358979f
-
-#define radToDeg(x) ((x)*180.f/PI)
-#define degToRad(x) ((x)*PI/180.f)
-
-float MathAbs(float x)
-{
-    float result;
-
-    __asm__ volatile (
-        "mtv      %1, S000\n"
-        "vabs.s   S000, S000\n"
-        "mfv      %0, S000\n"
-    : "=r"(result) : "r"(x));
-
-    return result;
-}
-
-void MathSincos(float r, float *s, float *c)
-{
-    __asm__ volatile (
-        "mtv      %2, S002\n"
-        "vcst.s   S003, VFPU_2_PI\n"
-        "vmul.s   S002, S002, S003\n"
-        "vrot.p   C000, S002, [s, c]\n"
-        "mfv      %0, S000\n"
-        "mfv      %1, S001\n"
-    : "=r"(*s), "=r"(*c): "r"(r));
-}
-
-void Swap(float *a, float *b)
-{
-    float n=*a;
-    *a = *b;
-    *b = n;
-}
-
-static int
-PSP_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-                const SDL_Rect * srcrect, const SDL_FRect * dstrect)
-{
-    float x, y, width, height;
-    float u0, v0, u1, v1;
-    unsigned char alpha;
-
-    x = dstrect->x;
-    y = dstrect->y;
-    width = dstrect->w;
-    height = dstrect->h;
-
-    u0 = srcrect->x;
-    v0 = srcrect->y;
-    u1 = srcrect->x + srcrect->w;
-    v1 = srcrect->y + srcrect->h;
-
-    alpha = texture->a;
-
-    StartDrawing(renderer);
-    TextureActivate(texture);
-    PSP_SetBlendMode(renderer, renderer->blendMode);
-
-    if(alpha != 255)
-    {
-        sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
-        sceGuColor(GU_RGBA(255, 255, 255, alpha));
-    }else{
-        sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
-        sceGuColor(0xFFFFFFFF);
-    }
-
-    if((MathAbs(u1) - MathAbs(u0)) < 64.0f)
-    {
-        VertTV* vertices = (VertTV*)sceGuGetMemory((sizeof(VertTV))<<1);
-
-        vertices[0].u = u0;
-        vertices[0].v = v0;
-        vertices[0].x = x;
-        vertices[0].y = y;
-        vertices[0].z = 0;
-
-        vertices[1].u = u1;
-        vertices[1].v = v1;
-        vertices[1].x = x + width;
-        vertices[1].y = y + height;
-        vertices[1].z = 0;
-
-        sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
-    }
-    else
-    {
-        float start, end;
-        float curU = u0;
-        float curX = x;
-        float endX = x + width;
-        float slice = 64.0f;
-        float ustep = (u1 - u0)/width * slice;
-
-        if(ustep < 0.0f)
-            ustep = -ustep;
-
-        for(start = 0, end = width; start < end; start += slice)
-        {
-            VertTV* vertices = (VertTV*)sceGuGetMemory((sizeof(VertTV))<<1);
-
-            float polyWidth = ((curX + slice) > endX) ? (endX - curX) : slice;
-            float sourceWidth = ((curU + ustep) > u1) ? (u1 - curU) : ustep;
-
-            vertices[0].u = curU;
-            vertices[0].v = v0;
-            vertices[0].x = curX;
-            vertices[0].y = y;
-            vertices[0].z = 0;
-
-            curU += sourceWidth;
-            curX += polyWidth;
-
-            vertices[1].u = curU;
-            vertices[1].v = v1;
-            vertices[1].x = curX;
-            vertices[1].y = (y + height);
-            vertices[1].z = 0;
-
-            sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
-        }
-    }
-
-    if(alpha != 255)
-        sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
-    return 0;
-}
-
-static int
-PSP_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                    Uint32 pixel_format, void * pixels, int pitch)
-
-{
-        return 0;
-}
-
-
-static int
-PSP_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-                const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-                const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
-{
-    float x, y, width, height;
-    float u0, v0, u1, v1;
-    unsigned char alpha;
-    float centerx, centery;
-
-    x = dstrect->x;
-    y = dstrect->y;
-    width = dstrect->w;
-    height = dstrect->h;
-
-    u0 = srcrect->x;
-    v0 = srcrect->y;
-    u1 = srcrect->x + srcrect->w;
-    v1 = srcrect->y + srcrect->h;
-
-    centerx = center->x;
-    centery = center->y;
-
-    alpha = texture->a;
-
-    StartDrawing(renderer);
-    TextureActivate(texture);
-    PSP_SetBlendMode(renderer, renderer->blendMode);
-
-    if(alpha != 255)
-    {
-        sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
-        sceGuColor(GU_RGBA(255, 255, 255, alpha));
-    }else{
-        sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
-        sceGuColor(0xFFFFFFFF);
-    }
-
-/*      x += width * 0.5f; */
-/*      y += height * 0.5f; */
-    x += centerx;
-    y += centery;
-
-    float c, s;
-
-    MathSincos(degToRad(angle), &s, &c);
-
-/*      width *= 0.5f; */
-/*      height *= 0.5f; */
-    width  -= centerx;
-    height -= centery;
-
-
-    float cw = c*width;
-    float sw = s*width;
-    float ch = c*height;
-    float sh = s*height;
-
-    VertTV* vertices = (VertTV*)sceGuGetMemory(sizeof(VertTV)<<2);
-
-    vertices[0].u = u0;
-    vertices[0].v = v0;
-    vertices[0].x = x - cw + sh;
-    vertices[0].y = y - sw - ch;
-    vertices[0].z = 0;
-
-    vertices[1].u = u0;
-    vertices[1].v = v1;
-    vertices[1].x = x - cw - sh;
-    vertices[1].y = y - sw + ch;
-    vertices[1].z = 0;
-
-    vertices[2].u = u1;
-    vertices[2].v = v1;
-    vertices[2].x = x + cw - sh;
-    vertices[2].y = y + sw + ch;
-    vertices[2].z = 0;
-
-    vertices[3].u = u1;
-    vertices[3].v = v0;
-    vertices[3].x = x + cw + sh;
-    vertices[3].y = y + sw - ch;
-    vertices[3].z = 0;
-
-    if (flip & SDL_FLIP_HORIZONTAL) {
-                Swap(&vertices[0].v, &vertices[2].v);
-                Swap(&vertices[1].v, &vertices[3].v);
-    }
-    if (flip & SDL_FLIP_VERTICAL) {
-                Swap(&vertices[0].u, &vertices[2].u);
-                Swap(&vertices[1].u, &vertices[3].u);
-    }
-
-    sceGuDrawArray(GU_TRIANGLE_FAN, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices);
-
-    if(alpha != 255)
-        sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
-    return 0;
-}
-
-static void
-PSP_RenderPresent(SDL_Renderer * renderer)
-{
-    PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata;
-    if(!data->displayListAvail)
-        return;
-
-    data->displayListAvail = SDL_FALSE;
-    sceGuFinish();
-    sceGuSync(0,0);
-
-/*  if(data->vsync) */
-        sceDisplayWaitVblankStart();
-
-    data->backbuffer = data->frontbuffer;
-    data->frontbuffer = vabsptr(sceGuSwapBuffers());
-
-}
-
-static void
-PSP_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    PSP_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata;
-    PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata;
-
-    if (renderdata == 0)
-        return;
-
-    if(psp_texture == 0)
-        return;
-
-    SDL_free(psp_texture->data);
-    SDL_free(psp_texture);
-    texture->driverdata = NULL;
-}
-
-static void
-PSP_DestroyRenderer(SDL_Renderer * renderer)
-{
-    PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata;
-    if (data) {
-        if (!data->initialized)
-            return;
-
-        StartDrawing(renderer);
-
-        sceGuTerm();
-/*      vfree(data->backbuffer); */
-/*      vfree(data->frontbuffer); */
-
-        data->initialized = SDL_FALSE;
-        data->displayListAvail = SDL_FALSE;
-        SDL_free(data);
-    }
-    SDL_free(renderer);
-}
-
-#endif /* SDL_VIDEO_RENDER_PSP */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/deps/SDL2/src/render/software/SDL_blendfillrect.c b/deps/SDL2/src/render/software/SDL_blendfillrect.c
deleted file mode 100644
index ea05ea6..0000000
--- a/deps/SDL2/src/render/software/SDL_blendfillrect.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if !SDL_RENDER_DISABLED
-
-#include "SDL_draw.h"
-#include "SDL_blendfillrect.h"
-
-
-static int
-SDL_BlendFillRect_RGB555(SDL_Surface * dst, const SDL_Rect * rect,
-                         SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    unsigned inva = 0xff - a;
-
-    switch (blendMode) {
-    case SDL_BLENDMODE_BLEND:
-        FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_RGB555);
-        break;
-    case SDL_BLENDMODE_ADD:
-        FILLRECT(Uint16, DRAW_SETPIXEL_ADD_RGB555);
-        break;
-    case SDL_BLENDMODE_MOD:
-        FILLRECT(Uint16, DRAW_SETPIXEL_MOD_RGB555);
-        break;
-    default:
-        FILLRECT(Uint16, DRAW_SETPIXEL_RGB555);
-        break;
-    }
-    return 0;
-}
-
-static int
-SDL_BlendFillRect_RGB565(SDL_Surface * dst, const SDL_Rect * rect,
-                         SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    unsigned inva = 0xff - a;
-
-    switch (blendMode) {
-    case SDL_BLENDMODE_BLEND:
-        FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_RGB565);
-        break;
-    case SDL_BLENDMODE_ADD:
-        FILLRECT(Uint16, DRAW_SETPIXEL_ADD_RGB565);
-        break;
-    case SDL_BLENDMODE_MOD:
-        FILLRECT(Uint16, DRAW_SETPIXEL_MOD_RGB565);
-        break;
-    default:
-        FILLRECT(Uint16, DRAW_SETPIXEL_RGB565);
-        break;
-    }
-    return 0;
-}
-
-static int
-SDL_BlendFillRect_RGB888(SDL_Surface * dst, const SDL_Rect * rect,
-                         SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    unsigned inva = 0xff - a;
-
-    switch (blendMode) {
-    case SDL_BLENDMODE_BLEND:
-        FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_RGB888);
-        break;
-    case SDL_BLENDMODE_ADD:
-        FILLRECT(Uint32, DRAW_SETPIXEL_ADD_RGB888);
-        break;
-    case SDL_BLENDMODE_MOD:
-        FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGB888);
-        break;
-    default:
-        FILLRECT(Uint32, DRAW_SETPIXEL_RGB888);
-        break;
-    }
-    return 0;
-}
-
-static int
-SDL_BlendFillRect_ARGB8888(SDL_Surface * dst, const SDL_Rect * rect,
-                           SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    unsigned inva = 0xff - a;
-
-    switch (blendMode) {
-    case SDL_BLENDMODE_BLEND:
-        FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888);
-        break;
-    case SDL_BLENDMODE_ADD:
-        FILLRECT(Uint32, DRAW_SETPIXEL_ADD_ARGB8888);
-        break;
-    case SDL_BLENDMODE_MOD:
-        FILLRECT(Uint32, DRAW_SETPIXEL_MOD_ARGB8888);
-        break;
-    default:
-        FILLRECT(Uint32, DRAW_SETPIXEL_ARGB8888);
-        break;
-    }
-    return 0;
-}
-
-static int
-SDL_BlendFillRect_RGB(SDL_Surface * dst, const SDL_Rect * rect,
-                      SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    SDL_PixelFormat *fmt = dst->format;
-    unsigned inva = 0xff - a;
-
-    switch (fmt->BytesPerPixel) {
-    case 2:
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_RGB);
-            break;
-        case SDL_BLENDMODE_ADD:
-            FILLRECT(Uint16, DRAW_SETPIXEL_ADD_RGB);
-            break;
-        case SDL_BLENDMODE_MOD:
-            FILLRECT(Uint16, DRAW_SETPIXEL_MOD_RGB);
-            break;
-        default:
-            FILLRECT(Uint16, DRAW_SETPIXEL_RGB);
-            break;
-        }
-        return 0;
-    case 4:
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_RGB);
-            break;
-        case SDL_BLENDMODE_ADD:
-            FILLRECT(Uint32, DRAW_SETPIXEL_ADD_RGB);
-            break;
-        case SDL_BLENDMODE_MOD:
-            FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGB);
-            break;
-        default:
-            FILLRECT(Uint32, DRAW_SETPIXEL_RGB);
-            break;
-        }
-        return 0;
-    default:
-        return SDL_Unsupported();
-    }
-}
-
-static int
-SDL_BlendFillRect_RGBA(SDL_Surface * dst, const SDL_Rect * rect,
-                       SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    SDL_PixelFormat *fmt = dst->format;
-    unsigned inva = 0xff - a;
-
-    switch (fmt->BytesPerPixel) {
-    case 4:
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_RGBA);
-            break;
-        case SDL_BLENDMODE_ADD:
-            FILLRECT(Uint32, DRAW_SETPIXEL_ADD_RGBA);
-            break;
-        case SDL_BLENDMODE_MOD:
-            FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGBA);
-            break;
-        default:
-            FILLRECT(Uint32, DRAW_SETPIXEL_RGBA);
-            break;
-        }
-        return 0;
-    default:
-        return SDL_Unsupported();
-    }
-}
-
-int
-SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect,
-                  SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    SDL_Rect clipped;
-
-    if (!dst) {
-        return SDL_SetError("Passed NULL destination surface");
-    }
-
-    /* This function doesn't work on surfaces < 8 bpp */
-    if (dst->format->BitsPerPixel < 8) {
-        return SDL_SetError("SDL_BlendFillRect(): Unsupported surface format");
-    }
-
-    /* If 'rect' == NULL, then fill the whole surface */
-    if (rect) {
-        /* Perform clipping */
-        if (!SDL_IntersectRect(rect, &dst->clip_rect, &clipped)) {
-            return 0;
-        }
-        rect = &clipped;
-    } else {
-        rect = &dst->clip_rect;
-    }
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(r, a);
-        g = DRAW_MUL(g, a);
-        b = DRAW_MUL(b, a);
-    }
-
-    switch (dst->format->BitsPerPixel) {
-    case 15:
-        switch (dst->format->Rmask) {
-        case 0x7C00:
-            return SDL_BlendFillRect_RGB555(dst, rect, blendMode, r, g, b, a);
-        }
-        break;
-    case 16:
-        switch (dst->format->Rmask) {
-        case 0xF800:
-            return SDL_BlendFillRect_RGB565(dst, rect, blendMode, r, g, b, a);
-        }
-        break;
-    case 32:
-        switch (dst->format->Rmask) {
-        case 0x00FF0000:
-            if (!dst->format->Amask) {
-                return SDL_BlendFillRect_RGB888(dst, rect, blendMode, r, g, b, a);
-            } else {
-                return SDL_BlendFillRect_ARGB8888(dst, rect, blendMode, r, g, b, a);
-            }
-            break;
-        }
-        break;
-    default:
-        break;
-    }
-
-    if (!dst->format->Amask) {
-        return SDL_BlendFillRect_RGB(dst, rect, blendMode, r, g, b, a);
-    } else {
-        return SDL_BlendFillRect_RGBA(dst, rect, blendMode, r, g, b, a);
-    }
-}
-
-int
-SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count,
-                   SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    SDL_Rect rect;
-    int i;
-    int (*func)(SDL_Surface * dst, const SDL_Rect * rect,
-                SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL;
-    int status = 0;
-
-    if (!dst) {
-        return SDL_SetError("Passed NULL destination surface");
-    }
-
-    /* This function doesn't work on surfaces < 8 bpp */
-    if (dst->format->BitsPerPixel < 8) {
-        return SDL_SetError("SDL_BlendFillRects(): Unsupported surface format");
-    }
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(r, a);
-        g = DRAW_MUL(g, a);
-        b = DRAW_MUL(b, a);
-    }
-
-    /* FIXME: Does this function pointer slow things down significantly? */
-    switch (dst->format->BitsPerPixel) {
-    case 15:
-        switch (dst->format->Rmask) {
-        case 0x7C00:
-            func = SDL_BlendFillRect_RGB555;
-        }
-        break;
-    case 16:
-        switch (dst->format->Rmask) {
-        case 0xF800:
-            func = SDL_BlendFillRect_RGB565;
-        }
-        break;
-    case 32:
-        switch (dst->format->Rmask) {
-        case 0x00FF0000:
-            if (!dst->format->Amask) {
-                func = SDL_BlendFillRect_RGB888;
-            } else {
-                func = SDL_BlendFillRect_ARGB8888;
-            }
-            break;
-        }
-        break;
-    default:
-        break;
-    }
-
-    if (!func) {
-        if (!dst->format->Amask) {
-            func = SDL_BlendFillRect_RGB;
-        } else {
-            func = SDL_BlendFillRect_RGBA;
-        }
-    }
-
-    for (i = 0; i < count; ++i) {
-        /* Perform clipping */
-        if (!SDL_IntersectRect(&rects[i], &dst->clip_rect, &rect)) {
-            continue;
-        }
-        status = func(dst, &rect, blendMode, r, g, b, a);
-    }
-    return status;
-}
-
-#endif /* !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_blendfillrect.h b/deps/SDL2/src/render/software/SDL_blendfillrect.h
deleted file mode 100644
index ed7981d..0000000
--- a/deps/SDL2/src/render/software/SDL_blendfillrect.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-
-extern int SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-extern int SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_blendline.c b/deps/SDL2/src/render/software/SDL_blendline.c
deleted file mode 100644
index 2ab0231..0000000
--- a/deps/SDL2/src/render/software/SDL_blendline.c
+++ /dev/null
@@ -1,777 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if !SDL_RENDER_DISABLED
-
-#include "SDL_draw.h"
-#include "SDL_blendline.h"
-#include "SDL_blendpoint.h"
-
-
-static void
-SDL_BlendLine_RGB2(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                   SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
-                   SDL_bool draw_end)
-{
-    const SDL_PixelFormat *fmt = dst->format;
-    unsigned r, g, b, a, inva;
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(_r, _a);
-        g = DRAW_MUL(_g, _a);
-        b = DRAW_MUL(_b, _a);
-        a = _a;
-    } else {
-        r = _r;
-        g = _g;
-        b = _b;
-        a = _a;
-    }
-    inva = (a ^ 0xff);
-
-    if (y1 == y2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end);
-            break;
-        default:
-            HLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
-            break;
-        }
-    } else if (x1 == x2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end);
-            break;
-        default:
-            VLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
-            break;
-        }
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end);
-            break;
-        default:
-            DLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
-            break;
-        }
-    } else {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY2_BLEND_RGB, DRAW_SETPIXELXY2_BLEND_RGB,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY2_ADD_RGB, DRAW_SETPIXELXY2_ADD_RGB,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY2_MOD_RGB, DRAW_SETPIXELXY2_MOD_RGB,
-                   draw_end);
-            break;
-        default:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY2_RGB, DRAW_SETPIXELXY2_BLEND_RGB,
-                   draw_end);
-            break;
-        }
-    }
-}
-
-static void
-SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                     SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
-                     SDL_bool draw_end)
-{
-    unsigned r, g, b, a, inva;
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(_r, _a);
-        g = DRAW_MUL(_g, _a);
-        b = DRAW_MUL(_b, _a);
-        a = _a;
-    } else {
-        r = _r;
-        g = _g;
-        b = _b;
-        a = _a;
-    }
-    inva = (a ^ 0xff);
-
-    if (y1 == y2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end);
-            break;
-        default:
-            HLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
-            break;
-        }
-    } else if (x1 == x2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end);
-            break;
-        default:
-            VLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
-            break;
-        }
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end);
-            break;
-        default:
-            DLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
-            break;
-        }
-    } else {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_BLEND_RGB555, DRAW_SETPIXELXY_BLEND_RGB555,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_ADD_RGB555, DRAW_SETPIXELXY_ADD_RGB555,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_MOD_RGB555, DRAW_SETPIXELXY_MOD_RGB555,
-                   draw_end);
-            break;
-        default:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_RGB555, DRAW_SETPIXELXY_BLEND_RGB555,
-                   draw_end);
-            break;
-        }
-    }
-}
-
-static void
-SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                     SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
-                     SDL_bool draw_end)
-{
-    unsigned r, g, b, a, inva;
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(_r, _a);
-        g = DRAW_MUL(_g, _a);
-        b = DRAW_MUL(_b, _a);
-        a = _a;
-    } else {
-        r = _r;
-        g = _g;
-        b = _b;
-        a = _a;
-    }
-    inva = (a ^ 0xff);
-
-    if (y1 == y2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end);
-            break;
-        default:
-            HLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
-            break;
-        }
-    } else if (x1 == x2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end);
-            break;
-        default:
-            VLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
-            break;
-        }
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end);
-            break;
-        default:
-            DLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
-            break;
-        }
-    } else {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_BLEND_RGB565, DRAW_SETPIXELXY_BLEND_RGB565,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_ADD_RGB565, DRAW_SETPIXELXY_ADD_RGB565,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_MOD_RGB565, DRAW_SETPIXELXY_MOD_RGB565,
-                   draw_end);
-            break;
-        default:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_RGB565, DRAW_SETPIXELXY_BLEND_RGB565,
-                   draw_end);
-            break;
-        }
-    }
-}
-
-static void
-SDL_BlendLine_RGB4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                   SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
-                   SDL_bool draw_end)
-{
-    const SDL_PixelFormat *fmt = dst->format;
-    unsigned r, g, b, a, inva;
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(_r, _a);
-        g = DRAW_MUL(_g, _a);
-        b = DRAW_MUL(_b, _a);
-        a = _a;
-    } else {
-        r = _r;
-        g = _g;
-        b = _b;
-        a = _a;
-    }
-    inva = (a ^ 0xff);
-
-    if (y1 == y2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            HLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
-            break;
-        default:
-            HLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
-            break;
-        }
-    } else if (x1 == x2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            VLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
-            break;
-        default:
-            VLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
-            break;
-        }
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
-            break;
-        default:
-            DLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
-            break;
-        }
-    } else {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY4_BLEND_RGB, DRAW_SETPIXELXY4_BLEND_RGB,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY4_ADD_RGB, DRAW_SETPIXELXY4_ADD_RGB,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY4_MOD_RGB, DRAW_SETPIXELXY4_MOD_RGB,
-                   draw_end);
-            break;
-        default:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY4_RGB, DRAW_SETPIXELXY4_BLEND_RGB,
-                   draw_end);
-            break;
-        }
-    }
-}
-
-static void
-SDL_BlendLine_RGBA4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                    SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
-                    SDL_bool draw_end)
-{
-    const SDL_PixelFormat *fmt = dst->format;
-    unsigned r, g, b, a, inva;
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(_r, _a);
-        g = DRAW_MUL(_g, _a);
-        b = DRAW_MUL(_b, _a);
-        a = _a;
-    } else {
-        r = _r;
-        g = _g;
-        b = _b;
-        a = _a;
-    }
-    inva = (a ^ 0xff);
-
-    if (y1 == y2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            HLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            HLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
-            break;
-        default:
-            HLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
-            break;
-        }
-    } else if (x1 == x2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            VLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            VLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
-            break;
-        default:
-            VLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
-            break;
-        }
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
-            break;
-        default:
-            DLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
-            break;
-        }
-    } else {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY4_BLEND_RGBA, DRAW_SETPIXELXY4_BLEND_RGBA,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY4_ADD_RGBA, DRAW_SETPIXELXY4_ADD_RGBA,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY4_MOD_RGBA, DRAW_SETPIXELXY4_MOD_RGBA,
-                   draw_end);
-            break;
-        default:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY4_RGBA, DRAW_SETPIXELXY4_BLEND_RGBA,
-                   draw_end);
-            break;
-        }
-    }
-}
-
-static void
-SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                     SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
-                     SDL_bool draw_end)
-{
-    unsigned r, g, b, a, inva;
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(_r, _a);
-        g = DRAW_MUL(_g, _a);
-        b = DRAW_MUL(_b, _a);
-        a = _a;
-    } else {
-        r = _r;
-        g = _g;
-        b = _b;
-        a = _a;
-    }
-    inva = (a ^ 0xff);
-
-    if (y1 == y2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            HLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
-            break;
-        default:
-            HLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
-            break;
-        }
-    } else if (x1 == x2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            VLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
-            break;
-        default:
-            VLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
-            break;
-        }
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
-            break;
-        default:
-            DLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
-            break;
-        }
-    } else {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_BLEND_RGB888, DRAW_SETPIXELXY_BLEND_RGB888,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_ADD_RGB888, DRAW_SETPIXELXY_ADD_RGB888,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_MOD_RGB888, DRAW_SETPIXELXY_MOD_RGB888,
-                   draw_end);
-            break;
-        default:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_RGB888, DRAW_SETPIXELXY_BLEND_RGB888,
-                   draw_end);
-            break;
-        }
-    }
-}
-
-static void
-SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                       SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
-                       SDL_bool draw_end)
-{
-    unsigned r, g, b, a, inva;
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(_r, _a);
-        g = DRAW_MUL(_g, _a);
-        b = DRAW_MUL(_b, _a);
-        a = _a;
-    } else {
-        r = _r;
-        g = _g;
-        b = _b;
-        a = _a;
-    }
-    inva = (a ^ 0xff);
-
-    if (y1 == y2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            HLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            HLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            HLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end);
-            break;
-        default:
-            HLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
-            break;
-        }
-    } else if (x1 == x2) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            VLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            VLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            VLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end);
-            break;
-        default:
-            VLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
-            break;
-        }
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end);
-            break;
-        default:
-            DLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
-            break;
-        }
-    } else {
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_BLEND_ARGB8888, DRAW_SETPIXELXY_BLEND_ARGB8888,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_ADD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_ADD_ARGB8888, DRAW_SETPIXELXY_ADD_ARGB8888,
-                   draw_end);
-            break;
-        case SDL_BLENDMODE_MOD:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_MOD_ARGB8888, DRAW_SETPIXELXY_MOD_ARGB8888,
-                   draw_end);
-            break;
-        default:
-            AALINE(x1, y1, x2, y2,
-                   DRAW_SETPIXELXY_ARGB8888, DRAW_SETPIXELXY_BLEND_ARGB8888,
-                   draw_end);
-            break;
-        }
-    }
-}
-
-typedef void (*BlendLineFunc) (SDL_Surface * dst,
-                               int x1, int y1, int x2, int y2,
-                               SDL_BlendMode blendMode,
-                               Uint8 r, Uint8 g, Uint8 b, Uint8 a,
-                               SDL_bool draw_end);
-
-static BlendLineFunc
-SDL_CalculateBlendLineFunc(const SDL_PixelFormat * fmt)
-{
-    switch (fmt->BytesPerPixel) {
-    case 2:
-        if (fmt->Rmask == 0x7C00) {
-            return SDL_BlendLine_RGB555;
-        } else if (fmt->Rmask == 0xF800) {
-            return SDL_BlendLine_RGB565;
-        } else {
-            return SDL_BlendLine_RGB2;
-        }
-        break;
-    case 4:
-        if (fmt->Rmask == 0x00FF0000) {
-            if (fmt->Amask) {
-                return SDL_BlendLine_ARGB8888;
-            } else {
-                return SDL_BlendLine_RGB888;
-            }
-        } else {
-            if (fmt->Amask) {
-                return SDL_BlendLine_RGBA4;
-            } else {
-                return SDL_BlendLine_RGB4;
-            }
-        }
-    }
-    return NULL;
-}
-
-int
-SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-              SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    BlendLineFunc func;
-
-    if (!dst) {
-        return SDL_SetError("SDL_BlendLine(): Passed NULL destination surface");
-    }
-
-    func = SDL_CalculateBlendLineFunc(dst->format);
-    if (!func) {
-        return SDL_SetError("SDL_BlendLine(): Unsupported surface format");
-    }
-
-    /* Perform clipping */
-    /* FIXME: We don't actually want to clip, as it may change line slope */
-    if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
-        return 0;
-    }
-
-    func(dst, x1, y1, x2, y2, blendMode, r, g, b, a, SDL_TRUE);
-    return 0;
-}
-
-int
-SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count,
-               SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    int i;
-    int x1, y1;
-    int x2, y2;
-    SDL_bool draw_end;
-    BlendLineFunc func;
-
-    if (!dst) {
-        return SDL_SetError("SDL_BlendLines(): Passed NULL destination surface");
-    }
-
-    func = SDL_CalculateBlendLineFunc(dst->format);
-    if (!func) {
-        return SDL_SetError("SDL_BlendLines(): Unsupported surface format");
-    }
-
-    for (i = 1; i < count; ++i) {
-        x1 = points[i-1].x;
-        y1 = points[i-1].y;
-        x2 = points[i].x;
-        y2 = points[i].y;
-
-        /* Perform clipping */
-        /* FIXME: We don't actually want to clip, as it may change line slope */
-        if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
-            continue;
-        }
-
-        /* Draw the end if it was clipped */
-        draw_end = (x2 != points[i].x || y2 != points[i].y);
-
-        func(dst, x1, y1, x2, y2, blendMode, r, g, b, a, draw_end);
-    }
-    if (points[0].x != points[count-1].x || points[0].y != points[count-1].y) {
-        SDL_BlendPoint(dst, points[count-1].x, points[count-1].y,
-                       blendMode, r, g, b, a);
-    }
-    return 0;
-}
-
-#endif /* !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_blendline.h b/deps/SDL2/src/render/software/SDL_blendline.h
deleted file mode 100644
index 8132401..0000000
--- a/deps/SDL2/src/render/software/SDL_blendline.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-
-extern int SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-extern int SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_blendpoint.c b/deps/SDL2/src/render/software/SDL_blendpoint.c
deleted file mode 100644
index e2fa66f..0000000
--- a/deps/SDL2/src/render/software/SDL_blendpoint.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if !SDL_RENDER_DISABLED
-
-#include "SDL_draw.h"
-#include "SDL_blendpoint.h"
-
-
-static int
-SDL_BlendPoint_RGB555(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
-                      Uint8 g, Uint8 b, Uint8 a)
-{
-    unsigned inva = 0xff - a;
-
-    switch (blendMode) {
-    case SDL_BLENDMODE_BLEND:
-        DRAW_SETPIXELXY_BLEND_RGB555(x, y);
-        break;
-    case SDL_BLENDMODE_ADD:
-        DRAW_SETPIXELXY_ADD_RGB555(x, y);
-        break;
-    case SDL_BLENDMODE_MOD:
-        DRAW_SETPIXELXY_MOD_RGB555(x, y);
-        break;
-    default:
-        DRAW_SETPIXELXY_RGB555(x, y);
-        break;
-    }
-    return 0;
-}
-
-static int
-SDL_BlendPoint_RGB565(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
-                      Uint8 g, Uint8 b, Uint8 a)
-{
-    unsigned inva = 0xff - a;
-
-    switch (blendMode) {
-    case SDL_BLENDMODE_BLEND:
-        DRAW_SETPIXELXY_BLEND_RGB565(x, y);
-        break;
-    case SDL_BLENDMODE_ADD:
-        DRAW_SETPIXELXY_ADD_RGB565(x, y);
-        break;
-    case SDL_BLENDMODE_MOD:
-        DRAW_SETPIXELXY_MOD_RGB565(x, y);
-        break;
-    default:
-        DRAW_SETPIXELXY_RGB565(x, y);
-        break;
-    }
-    return 0;
-}
-
-static int
-SDL_BlendPoint_RGB888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
-                      Uint8 g, Uint8 b, Uint8 a)
-{
-    unsigned inva = 0xff - a;
-
-    switch (blendMode) {
-    case SDL_BLENDMODE_BLEND:
-        DRAW_SETPIXELXY_BLEND_RGB888(x, y);
-        break;
-    case SDL_BLENDMODE_ADD:
-        DRAW_SETPIXELXY_ADD_RGB888(x, y);
-        break;
-    case SDL_BLENDMODE_MOD:
-        DRAW_SETPIXELXY_MOD_RGB888(x, y);
-        break;
-    default:
-        DRAW_SETPIXELXY_RGB888(x, y);
-        break;
-    }
-    return 0;
-}
-
-static int
-SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode,
-                        Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    unsigned inva = 0xff - a;
-
-    switch (blendMode) {
-    case SDL_BLENDMODE_BLEND:
-        DRAW_SETPIXELXY_BLEND_ARGB8888(x, y);
-        break;
-    case SDL_BLENDMODE_ADD:
-        DRAW_SETPIXELXY_ADD_ARGB8888(x, y);
-        break;
-    case SDL_BLENDMODE_MOD:
-        DRAW_SETPIXELXY_MOD_ARGB8888(x, y);
-        break;
-    default:
-        DRAW_SETPIXELXY_ARGB8888(x, y);
-        break;
-    }
-    return 0;
-}
-
-static int
-SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
-                   Uint8 g, Uint8 b, Uint8 a)
-{
-    SDL_PixelFormat *fmt = dst->format;
-    unsigned inva = 0xff - a;
-
-    switch (fmt->BytesPerPixel) {
-    case 2:
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DRAW_SETPIXELXY2_BLEND_RGB(x, y);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DRAW_SETPIXELXY2_ADD_RGB(x, y);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DRAW_SETPIXELXY2_MOD_RGB(x, y);
-            break;
-        default:
-            DRAW_SETPIXELXY2_RGB(x, y);
-            break;
-        }
-        return 0;
-    case 4:
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DRAW_SETPIXELXY4_BLEND_RGB(x, y);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DRAW_SETPIXELXY4_ADD_RGB(x, y);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DRAW_SETPIXELXY4_MOD_RGB(x, y);
-            break;
-        default:
-            DRAW_SETPIXELXY4_RGB(x, y);
-            break;
-        }
-        return 0;
-    default:
-        return SDL_Unsupported();
-    }
-}
-
-static int
-SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
-                    Uint8 g, Uint8 b, Uint8 a)
-{
-    SDL_PixelFormat *fmt = dst->format;
-    unsigned inva = 0xff - a;
-
-    switch (fmt->BytesPerPixel) {
-    case 4:
-        switch (blendMode) {
-        case SDL_BLENDMODE_BLEND:
-            DRAW_SETPIXELXY4_BLEND_RGBA(x, y);
-            break;
-        case SDL_BLENDMODE_ADD:
-            DRAW_SETPIXELXY4_ADD_RGBA(x, y);
-            break;
-        case SDL_BLENDMODE_MOD:
-            DRAW_SETPIXELXY4_MOD_RGBA(x, y);
-            break;
-        default:
-            DRAW_SETPIXELXY4_RGBA(x, y);
-            break;
-        }
-        return 0;
-    default:
-        return SDL_Unsupported();
-    }
-}
-
-int
-SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
-               Uint8 g, Uint8 b, Uint8 a)
-{
-    if (!dst) {
-        return SDL_SetError("Passed NULL destination surface");
-    }
-
-    /* This function doesn't work on surfaces < 8 bpp */
-    if (dst->format->BitsPerPixel < 8) {
-        return SDL_SetError("SDL_BlendPoint(): Unsupported surface format");
-    }
-
-    /* Perform clipping */
-    if (x < dst->clip_rect.x || y < dst->clip_rect.y ||
-        x >= (dst->clip_rect.x + dst->clip_rect.w) ||
-        y >= (dst->clip_rect.y + dst->clip_rect.h)) {
-        return 0;
-    }
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(r, a);
-        g = DRAW_MUL(g, a);
-        b = DRAW_MUL(b, a);
-    }
-
-    switch (dst->format->BitsPerPixel) {
-    case 15:
-        switch (dst->format->Rmask) {
-        case 0x7C00:
-            return SDL_BlendPoint_RGB555(dst, x, y, blendMode, r, g, b, a);
-        }
-        break;
-    case 16:
-        switch (dst->format->Rmask) {
-        case 0xF800:
-            return SDL_BlendPoint_RGB565(dst, x, y, blendMode, r, g, b, a);
-        }
-        break;
-    case 32:
-        switch (dst->format->Rmask) {
-        case 0x00FF0000:
-            if (!dst->format->Amask) {
-                return SDL_BlendPoint_RGB888(dst, x, y, blendMode, r, g, b,
-                                             a);
-            } else {
-                return SDL_BlendPoint_ARGB8888(dst, x, y, blendMode, r, g, b,
-                                               a);
-            }
-            break;
-        }
-        break;
-    default:
-        break;
-    }
-
-    if (!dst->format->Amask) {
-        return SDL_BlendPoint_RGB(dst, x, y, blendMode, r, g, b, a);
-    } else {
-        return SDL_BlendPoint_RGBA(dst, x, y, blendMode, r, g, b, a);
-    }
-}
-
-int
-SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count,
-                SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    int minx, miny;
-    int maxx, maxy;
-    int i;
-    int x, y;
-    int (*func)(SDL_Surface * dst, int x, int y,
-                SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL;
-    int status = 0;
-
-    if (!dst) {
-        return SDL_SetError("Passed NULL destination surface");
-    }
-
-    /* This function doesn't work on surfaces < 8 bpp */
-    if (dst->format->BitsPerPixel < 8) {
-        return SDL_SetError("SDL_BlendPoints(): Unsupported surface format");
-    }
-
-    if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
-        r = DRAW_MUL(r, a);
-        g = DRAW_MUL(g, a);
-        b = DRAW_MUL(b, a);
-    }
-
-    /* FIXME: Does this function pointer slow things down significantly? */
-    switch (dst->format->BitsPerPixel) {
-    case 15:
-        switch (dst->format->Rmask) {
-        case 0x7C00:
-            func = SDL_BlendPoint_RGB555;
-            break;
-        }
-        break;
-    case 16:
-        switch (dst->format->Rmask) {
-        case 0xF800:
-            func = SDL_BlendPoint_RGB565;
-            break;
-        }
-        break;
-    case 32:
-        switch (dst->format->Rmask) {
-        case 0x00FF0000:
-            if (!dst->format->Amask) {
-                func = SDL_BlendPoint_RGB888;
-            } else {
-                func = SDL_BlendPoint_ARGB8888;
-            }
-            break;
-        }
-        break;
-    default:
-        break;
-    }
-
-    if (!func) {
-        if (!dst->format->Amask) {
-            func = SDL_BlendPoint_RGB;
-        } else {
-            func = SDL_BlendPoint_RGBA;
-        }
-    }
-
-    minx = dst->clip_rect.x;
-    maxx = dst->clip_rect.x + dst->clip_rect.w - 1;
-    miny = dst->clip_rect.y;
-    maxy = dst->clip_rect.y + dst->clip_rect.h - 1;
-
-    for (i = 0; i < count; ++i) {
-        x = points[i].x;
-        y = points[i].y;
-
-        if (x < minx || x > maxx || y < miny || y > maxy) {
-            continue;
-        }
-        status = func(dst, x, y, blendMode, r, g, b, a);
-    }
-    return status;
-}
-
-#endif /* !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_blendpoint.h b/deps/SDL2/src/render/software/SDL_blendpoint.h
deleted file mode 100644
index ec7cfa7..0000000
--- a/deps/SDL2/src/render/software/SDL_blendpoint.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-
-extern int SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-extern int SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_draw.h b/deps/SDL2/src/render/software/SDL_draw.h
deleted file mode 100644
index c529e98..0000000
--- a/deps/SDL2/src/render/software/SDL_draw.h
+++ /dev/null
@@ -1,575 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "../../video/SDL_blit.h"
-
-/* This code assumes that r, g, b, a are the source color,
- * and in the blend and add case, the RGB values are premultiplied by a.
- */
-
-#define DRAW_MUL(_a, _b) (((unsigned)(_a)*(_b))/255)
-
-#define DRAW_FASTSETPIXEL(type) \
-    *pixel = (type) color
-
-#define DRAW_FASTSETPIXEL1 DRAW_FASTSETPIXEL(Uint8)
-#define DRAW_FASTSETPIXEL2 DRAW_FASTSETPIXEL(Uint16)
-#define DRAW_FASTSETPIXEL4 DRAW_FASTSETPIXEL(Uint32)
-
-#define DRAW_FASTSETPIXELXY(x, y, type, bpp, color) \
-    *(type *)((Uint8 *)dst->pixels + (y) * dst->pitch \
-                                   + (x) * bpp) = (type) color
-
-#define DRAW_FASTSETPIXELXY1(x, y) DRAW_FASTSETPIXELXY(x, y, Uint8, 1, color)
-#define DRAW_FASTSETPIXELXY2(x, y) DRAW_FASTSETPIXELXY(x, y, Uint16, 2, color)
-#define DRAW_FASTSETPIXELXY4(x, y) DRAW_FASTSETPIXELXY(x, y, Uint32, 4, color)
-
-#define DRAW_SETPIXEL(setpixel) \
-do { \
-    unsigned sr = r, sg = g, sb = b, sa = a; (void) sa; \
-    setpixel; \
-} while (0)
-
-#define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \
-do { \
-    unsigned sr, sg, sb, sa; (void) sa; \
-    getpixel; \
-    sr = DRAW_MUL(inva, sr) + r; \
-    sg = DRAW_MUL(inva, sg) + g; \
-    sb = DRAW_MUL(inva, sb) + b; \
-    setpixel; \
-} while (0)
-
-#define DRAW_SETPIXEL_ADD(getpixel, setpixel) \
-do { \
-    unsigned sr, sg, sb, sa; (void) sa; \
-    getpixel; \
-    sr += r; if (sr > 0xff) sr = 0xff; \
-    sg += g; if (sg > 0xff) sg = 0xff; \
-    sb += b; if (sb > 0xff) sb = 0xff; \
-    setpixel; \
-} while (0)
-
-#define DRAW_SETPIXEL_MOD(getpixel, setpixel) \
-do { \
-    unsigned sr, sg, sb, sa; (void) sa; \
-    getpixel; \
-    sr = DRAW_MUL(sr, r); \
-    sg = DRAW_MUL(sg, g); \
-    sb = DRAW_MUL(sb, b); \
-    setpixel; \
-} while (0)
-
-#define DRAW_SETPIXELXY(x, y, type, bpp, op) \
-do { \
-    type *pixel = (type *)((Uint8 *)dst->pixels + (y) * dst->pitch \
-                                                + (x) * bpp); \
-    op; \
-} while (0)
-
-/*
- * Define draw operators for RGB555
- */
-
-#define DRAW_SETPIXEL_RGB555 \
-    DRAW_SETPIXEL(RGB555_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXEL_BLEND_RGB555 \
-    DRAW_SETPIXEL_BLEND(RGB_FROM_RGB555(*pixel, sr, sg, sb), \
-                        RGB555_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXEL_ADD_RGB555 \
-    DRAW_SETPIXEL_ADD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \
-                      RGB555_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXEL_MOD_RGB555 \
-    DRAW_SETPIXEL_MOD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \
-                      RGB555_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXELXY_RGB555(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB555)
-
-#define DRAW_SETPIXELXY_BLEND_RGB555(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_RGB555)
-
-#define DRAW_SETPIXELXY_ADD_RGB555(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB555)
-
-#define DRAW_SETPIXELXY_MOD_RGB555(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB555)
-
-/*
- * Define draw operators for RGB565
- */
-
-#define DRAW_SETPIXEL_RGB565 \
-    DRAW_SETPIXEL(RGB565_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXEL_BLEND_RGB565 \
-    DRAW_SETPIXEL_BLEND(RGB_FROM_RGB565(*pixel, sr, sg, sb), \
-                        RGB565_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXEL_ADD_RGB565 \
-    DRAW_SETPIXEL_ADD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \
-                      RGB565_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXEL_MOD_RGB565 \
-    DRAW_SETPIXEL_MOD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \
-                      RGB565_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXELXY_RGB565(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB565)
-
-#define DRAW_SETPIXELXY_BLEND_RGB565(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_RGB565)
-
-#define DRAW_SETPIXELXY_ADD_RGB565(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB565)
-
-#define DRAW_SETPIXELXY_MOD_RGB565(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB565)
-
-/*
- * Define draw operators for RGB888
- */
-
-#define DRAW_SETPIXEL_RGB888 \
-    DRAW_SETPIXEL(RGB888_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXEL_BLEND_RGB888 \
-    DRAW_SETPIXEL_BLEND(RGB_FROM_RGB888(*pixel, sr, sg, sb), \
-                        RGB888_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXEL_ADD_RGB888 \
-    DRAW_SETPIXEL_ADD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \
-                      RGB888_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXEL_MOD_RGB888 \
-    DRAW_SETPIXEL_MOD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \
-                      RGB888_FROM_RGB(*pixel, sr, sg, sb))
-
-#define DRAW_SETPIXELXY_RGB888(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGB888)
-
-#define DRAW_SETPIXELXY_BLEND_RGB888(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_RGB888)
-
-#define DRAW_SETPIXELXY_ADD_RGB888(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGB888)
-
-#define DRAW_SETPIXELXY_MOD_RGB888(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGB888)
-
-/*
- * Define draw operators for ARGB8888
- */
-
-#define DRAW_SETPIXEL_ARGB8888 \
-    DRAW_SETPIXEL(ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa))
-
-#define DRAW_SETPIXEL_BLEND_ARGB8888 \
-    DRAW_SETPIXEL_BLEND(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \
-                        ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa))
-
-#define DRAW_SETPIXEL_ADD_ARGB8888 \
-    DRAW_SETPIXEL_ADD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \
-                      ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa))
-
-#define DRAW_SETPIXEL_MOD_ARGB8888 \
-    DRAW_SETPIXEL_MOD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \
-                      ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa))
-
-#define DRAW_SETPIXELXY_ARGB8888(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ARGB8888)
-
-#define DRAW_SETPIXELXY_BLEND_ARGB8888(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_ARGB8888)
-
-#define DRAW_SETPIXELXY_ADD_ARGB8888(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_ARGB8888)
-
-#define DRAW_SETPIXELXY_MOD_ARGB8888(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_ARGB8888)
-
-/*
- * Define draw operators for general RGB
- */
-
-#define DRAW_SETPIXEL_RGB \
-    DRAW_SETPIXEL(PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb))
-
-#define DRAW_SETPIXEL_BLEND_RGB \
-    DRAW_SETPIXEL_BLEND(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \
-                        PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb))
-
-#define DRAW_SETPIXEL_ADD_RGB \
-    DRAW_SETPIXEL_ADD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \
-                      PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb))
-
-#define DRAW_SETPIXEL_MOD_RGB \
-    DRAW_SETPIXEL_MOD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \
-                      PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb))
-
-#define DRAW_SETPIXELXY2_RGB(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB)
-
-#define DRAW_SETPIXELXY4_RGB(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGB)
-
-#define DRAW_SETPIXELXY2_BLEND_RGB(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_RGB)
-
-#define DRAW_SETPIXELXY4_BLEND_RGB(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_RGB)
-
-#define DRAW_SETPIXELXY2_ADD_RGB(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB)
-
-#define DRAW_SETPIXELXY4_ADD_RGB(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGB)
-
-#define DRAW_SETPIXELXY2_MOD_RGB(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB)
-
-#define DRAW_SETPIXELXY4_MOD_RGB(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGB)
-
-
-/*
- * Define draw operators for general RGBA
- */
-
-#define DRAW_SETPIXEL_RGBA \
-    DRAW_SETPIXEL(PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa))
-
-#define DRAW_SETPIXEL_BLEND_RGBA \
-    DRAW_SETPIXEL_BLEND(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \
-                        PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa))
-
-#define DRAW_SETPIXEL_ADD_RGBA \
-    DRAW_SETPIXEL_ADD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \
-                      PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa))
-
-#define DRAW_SETPIXEL_MOD_RGBA \
-    DRAW_SETPIXEL_MOD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \
-                      PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa))
-
-#define DRAW_SETPIXELXY4_RGBA(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGBA)
-
-#define DRAW_SETPIXELXY4_BLEND_RGBA(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_RGBA)
-
-#define DRAW_SETPIXELXY4_ADD_RGBA(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGBA)
-
-#define DRAW_SETPIXELXY4_MOD_RGBA(x, y) \
-    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGBA)
-
-/*
- * Define line drawing macro
- */
-
-#define ABS(_x) ((_x) < 0 ? -(_x) : (_x))
-
-/* Horizontal line */
-#define HLINE(type, op, draw_end) \
-{ \
-    int length; \
-    int pitch = (dst->pitch / dst->format->BytesPerPixel); \
-    type *pixel; \
-    if (x1 <= x2) { \
-        pixel = (type *)dst->pixels + y1 * pitch + x1; \
-        length = draw_end ? (x2-x1+1) : (x2-x1); \
-    } else { \
-        pixel = (type *)dst->pixels + y1 * pitch + x2; \
-        if (!draw_end) { \
-            ++pixel; \
-        } \
-        length = draw_end ? (x1-x2+1) : (x1-x2); \
-    } \
-    while (length--) { \
-        op; \
-        ++pixel; \
-    } \
-}
-
-/* Vertical line */
-#define VLINE(type, op, draw_end) \
-{ \
-    int length; \
-    int pitch = (dst->pitch / dst->format->BytesPerPixel); \
-    type *pixel; \
-    if (y1 <= y2) { \
-        pixel = (type *)dst->pixels + y1 * pitch + x1; \
-        length = draw_end ? (y2-y1+1) : (y2-y1); \
-    } else { \
-        pixel = (type *)dst->pixels + y2 * pitch + x1; \
-        if (!draw_end) { \
-            pixel += pitch; \
-        } \
-        length = draw_end ? (y1-y2+1) : (y1-y2); \
-    } \
-    while (length--) { \
-        op; \
-        pixel += pitch; \
-    } \
-}
-
-/* Diagonal line */
-#define DLINE(type, op, draw_end) \
-{ \
-    int length; \
-    int pitch = (dst->pitch / dst->format->BytesPerPixel); \
-    type *pixel; \
-    if (y1 <= y2) { \
-        pixel = (type *)dst->pixels + y1 * pitch + x1; \
-        if (x1 <= x2) { \
-            ++pitch; \
-        } else { \
-            --pitch; \
-        } \
-        length = (y2-y1); \
-    } else { \
-        pixel = (type *)dst->pixels + y2 * pitch + x2; \
-        if (x2 <= x1) { \
-            ++pitch; \
-        } else { \
-            --pitch; \
-        } \
-        if (!draw_end) { \
-            pixel += pitch; \
-        } \
-        length = (y1-y2); \
-    } \
-    if (draw_end) { \
-        ++length; \
-    } \
-    while (length--) { \
-        op; \
-        pixel += pitch; \
-    } \
-}
-
-/* Bresenham's line algorithm */
-#define BLINE(x1, y1, x2, y2, op, draw_end) \
-{ \
-    int i, deltax, deltay, numpixels; \
-    int d, dinc1, dinc2; \
-    int x, xinc1, xinc2; \
-    int y, yinc1, yinc2; \
- \
-    deltax = ABS(x2 - x1); \
-    deltay = ABS(y2 - y1); \
- \
-    if (deltax >= deltay) { \
-        numpixels = deltax + 1; \
-        d = (2 * deltay) - deltax; \
-        dinc1 = deltay * 2; \
-        dinc2 = (deltay - deltax) * 2; \
-        xinc1 = 1; \
-        xinc2 = 1; \
-        yinc1 = 0; \
-        yinc2 = 1; \
-    } else { \
-        numpixels = deltay + 1; \
-        d = (2 * deltax) - deltay; \
-        dinc1 = deltax * 2; \
-        dinc2 = (deltax - deltay) * 2; \
-        xinc1 = 0; \
-        xinc2 = 1; \
-        yinc1 = 1; \
-        yinc2 = 1; \
-    } \
- \
-    if (x1 > x2) { \
-        xinc1 = -xinc1; \
-        xinc2 = -xinc2; \
-    } \
-    if (y1 > y2) { \
-        yinc1 = -yinc1; \
-        yinc2 = -yinc2; \
-    } \
- \
-    x = x1; \
-    y = y1; \
- \
-    if (!draw_end) { \
-        --numpixels; \
-    } \
-    for (i = 0; i < numpixels; ++i) { \
-        op(x, y); \
-        if (d < 0) { \
-            d += dinc1; \
-            x += xinc1; \
-            y += yinc1; \
-        } else { \
-            d += dinc2; \
-            x += xinc2; \
-            y += yinc2; \
-        } \
-    } \
-}
-
-/* Xiaolin Wu's line algorithm, based on Michael Abrash's implementation */
-#define WULINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \
-{ \
-    Uint16 ErrorAdj, ErrorAcc; \
-    Uint16 ErrorAccTemp, Weighting; \
-    int DeltaX, DeltaY, Temp, XDir; \
-    unsigned r, g, b, a, inva; \
- \
-    /* Draw the initial pixel, which is always exactly intersected by \
-       the line and so needs no weighting */ \
-    opaque_op(x1, y1); \
- \
-    /* Draw the final pixel, which is always exactly intersected by the line \
-       and so needs no weighting */ \
-    if (draw_end) { \
-        opaque_op(x2, y2); \
-    } \
- \
-    /* Make sure the line runs top to bottom */ \
-    if (y1 > y2) { \
-        Temp = y1; y1 = y2; y2 = Temp; \
-        Temp = x1; x1 = x2; x2 = Temp; \
-    } \
-    DeltaY = y2 - y1; \
- \
-    if ((DeltaX = x2 - x1) >= 0) { \
-        XDir = 1; \
-    } else { \
-        XDir = -1; \
-        DeltaX = -DeltaX; /* make DeltaX positive */ \
-    } \
- \
-    /* line is not horizontal, diagonal, or vertical */ \
-    ErrorAcc = 0;  /* initialize the line error accumulator to 0 */ \
- \
-    /* Is this an X-major or Y-major line? */ \
-    if (DeltaY > DeltaX) { \
-        /* Y-major line; calculate 16-bit fixed-point fractional part of a \
-          pixel that X advances each time Y advances 1 pixel, truncating the \
-          result so that we won't overrun the endpoint along the X axis */ \
-        ErrorAdj = ((unsigned long) DeltaX << 16) / (unsigned long) DeltaY; \
-        /* Draw all pixels other than the first and last */ \
-        while (--DeltaY) { \
-            ErrorAccTemp = ErrorAcc;   /* remember currrent accumulated error */ \
-            ErrorAcc += ErrorAdj;      /* calculate error for next pixel */ \
-            if (ErrorAcc <= ErrorAccTemp) { \
-                /* The error accumulator turned over, so advance the X coord */ \
-                x1 += XDir; \
-            } \
-            y1++; /* Y-major, so always advance Y */ \
-            /* The IntensityBits most significant bits of ErrorAcc give us the \
-             intensity weighting for this pixel, and the complement of the \
-             weighting for the paired pixel */ \
-            Weighting = ErrorAcc >> 8; \
-            { \
-                a = DRAW_MUL(_a, (Weighting ^ 255)); \
-                r = DRAW_MUL(_r, a); \
-                g = DRAW_MUL(_g, a); \
-                b = DRAW_MUL(_b, a); \
-                inva = (a ^ 0xFF); \
-                blend_op(x1, y1); \
-            } \
-            { \
-                a = DRAW_MUL(_a, Weighting); \
-                r = DRAW_MUL(_r, a); \
-                g = DRAW_MUL(_g, a); \
-                b = DRAW_MUL(_b, a); \
-                inva = (a ^ 0xFF); \
-                blend_op(x1 + XDir, y1); \
-            } \
-        } \
-    } else { \
-        /* X-major line; calculate 16-bit fixed-point fractional part of a \
-           pixel that Y advances each time X advances 1 pixel, truncating the \
-           result to avoid overrunning the endpoint along the X axis */ \
-        ErrorAdj = ((unsigned long) DeltaY << 16) / (unsigned long) DeltaX; \
-        /* Draw all pixels other than the first and last */ \
-        while (--DeltaX) { \
-            ErrorAccTemp = ErrorAcc;   /* remember currrent accumulated error */ \
-            ErrorAcc += ErrorAdj;      /* calculate error for next pixel */ \
-            if (ErrorAcc <= ErrorAccTemp) { \
-                /* The error accumulator turned over, so advance the Y coord */ \
-                y1++; \
-            } \
-            x1 += XDir; /* X-major, so always advance X */ \
-            /* The IntensityBits most significant bits of ErrorAcc give us the \
-              intensity weighting for this pixel, and the complement of the \
-              weighting for the paired pixel */ \
-            Weighting = ErrorAcc >> 8; \
-            { \
-                a = DRAW_MUL(_a, (Weighting ^ 255)); \
-                r = DRAW_MUL(_r, a); \
-                g = DRAW_MUL(_g, a); \
-                b = DRAW_MUL(_b, a); \
-                inva = (a ^ 0xFF); \
-                blend_op(x1, y1); \
-            } \
-            { \
-                a = DRAW_MUL(_a, Weighting); \
-                r = DRAW_MUL(_r, a); \
-                g = DRAW_MUL(_g, a); \
-                b = DRAW_MUL(_b, a); \
-                inva = (a ^ 0xFF); \
-                blend_op(x1, y1 + 1); \
-            } \
-        } \
-    } \
-}
-
-#ifdef AA_LINES
-#define AALINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \
-            WULINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end)
-#else
-#define AALINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \
-            BLINE(x1, y1, x2, y2, opaque_op, draw_end)
-#endif
-
-/*
- * Define fill rect macro
- */
-
-#define FILLRECT(type, op) \
-do { \
-    int width = rect->w; \
-    int height = rect->h; \
-    int pitch = (dst->pitch / dst->format->BytesPerPixel); \
-    int skip = pitch - width; \
-    type *pixel = (type *)dst->pixels + rect->y * pitch + rect->x; \
-    while (height--) { \
-        { int n = (width+3)/4; \
-            switch (width & 3) { \
-            case 0: do {   op; pixel++; \
-            case 3:        op; pixel++; \
-            case 2:        op; pixel++; \
-            case 1:        op; pixel++; \
-                    } while ( --n > 0 ); \
-            } \
-        } \
-        pixel += skip; \
-    } \
-} while (0)
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_drawline.c b/deps/SDL2/src/render/software/SDL_drawline.c
deleted file mode 100644
index 5cda4cc..0000000
--- a/deps/SDL2/src/render/software/SDL_drawline.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if !SDL_RENDER_DISABLED
-
-#include "SDL_draw.h"
-#include "SDL_drawline.h"
-#include "SDL_drawpoint.h"
-
-
-static void
-SDL_DrawLine1(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color,
-              SDL_bool draw_end)
-{
-    if (y1 == y2) {
-        int length;
-        int pitch = (dst->pitch / dst->format->BytesPerPixel);
-        Uint8 *pixel;
-        if (x1 <= x2) {
-            pixel = (Uint8 *)dst->pixels + y1 * pitch + x1;
-            length = draw_end ? (x2-x1+1) : (x2-x1);
-        } else {
-            pixel = (Uint8 *)dst->pixels + y1 * pitch + x2;
-            if (!draw_end) {
-                ++pixel;
-            }
-            length = draw_end ? (x1-x2+1) : (x1-x2);
-        }
-        SDL_memset(pixel, color, length);
-    } else if (x1 == x2) {
-        VLINE(Uint8, DRAW_FASTSETPIXEL1, draw_end);
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        DLINE(Uint8, DRAW_FASTSETPIXEL1, draw_end);
-    } else {
-        BLINE(x1, y1, x2, y2, DRAW_FASTSETPIXELXY1, draw_end);
-    }
-}
-
-static void
-SDL_DrawLine2(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color,
-              SDL_bool draw_end)
-{
-    if (y1 == y2) {
-        HLINE(Uint16, DRAW_FASTSETPIXEL2, draw_end);
-    } else if (x1 == x2) {
-        VLINE(Uint16, DRAW_FASTSETPIXEL2, draw_end);
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        DLINE(Uint16, DRAW_FASTSETPIXEL2, draw_end);
-    } else {
-        Uint8 _r, _g, _b, _a;
-        const SDL_PixelFormat * fmt = dst->format;
-        SDL_GetRGBA(color, fmt, &_r, &_g, &_b, &_a);
-        if (fmt->Rmask == 0x7C00) {
-            AALINE(x1, y1, x2, y2,
-                   DRAW_FASTSETPIXELXY2, DRAW_SETPIXELXY_BLEND_RGB555,
-                   draw_end);
-        } else if (fmt->Rmask == 0xF800) {
-            AALINE(x1, y1, x2, y2,
-                   DRAW_FASTSETPIXELXY2, DRAW_SETPIXELXY_BLEND_RGB565,
-                   draw_end);
-        } else {
-            AALINE(x1, y1, x2, y2,
-                   DRAW_FASTSETPIXELXY2, DRAW_SETPIXELXY2_BLEND_RGB,
-                   draw_end);
-        }
-    }
-}
-
-static void
-SDL_DrawLine4(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color,
-              SDL_bool draw_end)
-{
-    if (y1 == y2) {
-        HLINE(Uint32, DRAW_FASTSETPIXEL4, draw_end);
-    } else if (x1 == x2) {
-        VLINE(Uint32, DRAW_FASTSETPIXEL4, draw_end);
-    } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
-        DLINE(Uint32, DRAW_FASTSETPIXEL4, draw_end);
-    } else {
-        Uint8 _r, _g, _b, _a;
-        const SDL_PixelFormat * fmt = dst->format;
-        SDL_GetRGBA(color, fmt, &_r, &_g, &_b, &_a);
-        if (fmt->Rmask == 0x00FF0000) {
-            if (!fmt->Amask) {
-                AALINE(x1, y1, x2, y2,
-                       DRAW_FASTSETPIXELXY4, DRAW_SETPIXELXY_BLEND_RGB888,
-                       draw_end);
-            } else {
-                AALINE(x1, y1, x2, y2,
-                       DRAW_FASTSETPIXELXY4, DRAW_SETPIXELXY_BLEND_ARGB8888,
-                       draw_end);
-            }
-        } else {
-            AALINE(x1, y1, x2, y2,
-                   DRAW_FASTSETPIXELXY4, DRAW_SETPIXELXY4_BLEND_RGB,
-                   draw_end);
-        }
-    }
-}
-
-typedef void (*DrawLineFunc) (SDL_Surface * dst,
-                              int x1, int y1, int x2, int y2,
-                              Uint32 color, SDL_bool draw_end);
-
-static DrawLineFunc
-SDL_CalculateDrawLineFunc(const SDL_PixelFormat * fmt)
-{
-    switch (fmt->BytesPerPixel) {
-    case 1:
-        if (fmt->BitsPerPixel < 8) {
-            break;
-        }
-        return SDL_DrawLine1;
-    case 2:
-        return SDL_DrawLine2;
-    case 4:
-        return SDL_DrawLine4;
-    }
-    return NULL;
-}
-
-int
-SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color)
-{
-    DrawLineFunc func;
-
-    if (!dst) {
-        return SDL_SetError("SDL_DrawLine(): Passed NULL destination surface");
-    }
-
-    func = SDL_CalculateDrawLineFunc(dst->format);
-    if (!func) {
-        return SDL_SetError("SDL_DrawLine(): Unsupported surface format");
-    }
-
-    /* Perform clipping */
-    /* FIXME: We don't actually want to clip, as it may change line slope */
-    if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
-        return 0;
-    }
-
-    func(dst, x1, y1, x2, y2, color, SDL_TRUE);
-    return 0;
-}
-
-int
-SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count,
-              Uint32 color)
-{
-    int i;
-    int x1, y1;
-    int x2, y2;
-    SDL_bool draw_end;
-    DrawLineFunc func;
-
-    if (!dst) {
-        return SDL_SetError("SDL_DrawLines(): Passed NULL destination surface");
-    }
-
-    func = SDL_CalculateDrawLineFunc(dst->format);
-    if (!func) {
-        return SDL_SetError("SDL_DrawLines(): Unsupported surface format");
-    }
-
-    for (i = 1; i < count; ++i) {
-        x1 = points[i-1].x;
-        y1 = points[i-1].y;
-        x2 = points[i].x;
-        y2 = points[i].y;
-
-        /* Perform clipping */
-        /* FIXME: We don't actually want to clip, as it may change line slope */
-        if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
-            continue;
-        }
-
-        /* Draw the end if it was clipped */
-        draw_end = (x2 != points[i].x || y2 != points[i].y);
-
-        func(dst, x1, y1, x2, y2, color, draw_end);
-    }
-    if (points[0].x != points[count-1].x || points[0].y != points[count-1].y) {
-        SDL_DrawPoint(dst, points[count-1].x, points[count-1].y, color);
-    }
-    return 0;
-}
-
-#endif /* !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_drawline.h b/deps/SDL2/src/render/software/SDL_drawline.h
deleted file mode 100644
index 5b6a098..0000000
--- a/deps/SDL2/src/render/software/SDL_drawline.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-
-extern int SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color);
-extern int SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_drawpoint.c b/deps/SDL2/src/render/software/SDL_drawpoint.c
deleted file mode 100644
index 1ae8419..0000000
--- a/deps/SDL2/src/render/software/SDL_drawpoint.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if !SDL_RENDER_DISABLED
-
-#include "SDL_draw.h"
-#include "SDL_drawpoint.h"
-
-
-int
-SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color)
-{
-    if (!dst) {
-        return SDL_SetError("Passed NULL destination surface");
-    }
-
-    /* This function doesn't work on surfaces < 8 bpp */
-    if (dst->format->BitsPerPixel < 8) {
-        return SDL_SetError("SDL_DrawPoint(): Unsupported surface format");
-    }
-
-    /* Perform clipping */
-    if (x < dst->clip_rect.x || y < dst->clip_rect.y ||
-        x >= (dst->clip_rect.x + dst->clip_rect.w) ||
-        y >= (dst->clip_rect.y + dst->clip_rect.h)) {
-        return 0;
-    }
-
-    switch (dst->format->BytesPerPixel) {
-    case 1:
-        DRAW_FASTSETPIXELXY1(x, y);
-        break;
-    case 2:
-        DRAW_FASTSETPIXELXY2(x, y);
-        break;
-    case 3:
-        return SDL_Unsupported();
-    case 4:
-        DRAW_FASTSETPIXELXY4(x, y);
-        break;
-    }
-    return 0;
-}
-
-int
-SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count,
-               Uint32 color)
-{
-    int minx, miny;
-    int maxx, maxy;
-    int i;
-    int x, y;
-
-    if (!dst) {
-        return SDL_SetError("Passed NULL destination surface");
-    }
-
-    /* This function doesn't work on surfaces < 8 bpp */
-    if (dst->format->BitsPerPixel < 8) {
-        return SDL_SetError("SDL_DrawPoints(): Unsupported surface format");
-    }
-
-    minx = dst->clip_rect.x;
-    maxx = dst->clip_rect.x + dst->clip_rect.w - 1;
-    miny = dst->clip_rect.y;
-    maxy = dst->clip_rect.y + dst->clip_rect.h - 1;
-
-    for (i = 0; i < count; ++i) {
-        x = points[i].x;
-        y = points[i].y;
-
-        if (x < minx || x > maxx || y < miny || y > maxy) {
-            continue;
-        }
-
-        switch (dst->format->BytesPerPixel) {
-        case 1:
-            DRAW_FASTSETPIXELXY1(x, y);
-            break;
-        case 2:
-            DRAW_FASTSETPIXELXY2(x, y);
-            break;
-        case 3:
-            return SDL_Unsupported();
-        case 4:
-            DRAW_FASTSETPIXELXY4(x, y);
-            break;
-        }
-    }
-    return 0;
-}
-
-#endif /* !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_drawpoint.h b/deps/SDL2/src/render/software/SDL_drawpoint.h
deleted file mode 100644
index 512ef64..0000000
--- a/deps/SDL2/src/render/software/SDL_drawpoint.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-
-extern int SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color);
-extern int SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_render_sw.c b/deps/SDL2/src/render/software/SDL_render_sw.c
deleted file mode 100644
index 29aab8c..0000000
--- a/deps/SDL2/src/render/software/SDL_render_sw.c
+++ /dev/null
@@ -1,727 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if !SDL_RENDER_DISABLED
-
-#include "../SDL_sysrender.h"
-#include "SDL_render_sw_c.h"
-#include "SDL_hints.h"
-
-#include "SDL_draw.h"
-#include "SDL_blendfillrect.h"
-#include "SDL_blendline.h"
-#include "SDL_blendpoint.h"
-#include "SDL_drawline.h"
-#include "SDL_drawpoint.h"
-#include "SDL_rotate.h"
-
-/* SDL surface based renderer implementation */
-
-static SDL_Renderer *SW_CreateRenderer(SDL_Window * window, Uint32 flags);
-static void SW_WindowEvent(SDL_Renderer * renderer,
-                           const SDL_WindowEvent *event);
-static int SW_GetOutputSize(SDL_Renderer * renderer, int *w, int *h);
-static int SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int SW_SetTextureColorMod(SDL_Renderer * renderer,
-                                 SDL_Texture * texture);
-static int SW_SetTextureAlphaMod(SDL_Renderer * renderer,
-                                 SDL_Texture * texture);
-static int SW_SetTextureBlendMode(SDL_Renderer * renderer,
-                                  SDL_Texture * texture);
-static int SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                            const SDL_Rect * rect, const void *pixels,
-                            int pitch);
-static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                          const SDL_Rect * rect, void **pixels, int *pitch);
-static void SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int SW_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
-static int SW_UpdateViewport(SDL_Renderer * renderer);
-static int SW_UpdateClipRect(SDL_Renderer * renderer);
-static int SW_RenderClear(SDL_Renderer * renderer);
-static int SW_RenderDrawPoints(SDL_Renderer * renderer,
-                               const SDL_FPoint * points, int count);
-static int SW_RenderDrawLines(SDL_Renderer * renderer,
-                              const SDL_FPoint * points, int count);
-static int SW_RenderFillRects(SDL_Renderer * renderer,
-                              const SDL_FRect * rects, int count);
-static int SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-                         const SDL_Rect * srcrect, const SDL_FRect * dstrect);
-static int SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-                          const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-                          const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip);
-static int SW_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                               Uint32 format, void * pixels, int pitch);
-static void SW_RenderPresent(SDL_Renderer * renderer);
-static void SW_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static void SW_DestroyRenderer(SDL_Renderer * renderer);
-
-
-SDL_RenderDriver SW_RenderDriver = {
-    SW_CreateRenderer,
-    {
-     "software",
-     SDL_RENDERER_SOFTWARE | SDL_RENDERER_TARGETTEXTURE,
-     8,
-     {
-      SDL_PIXELFORMAT_RGB555,
-      SDL_PIXELFORMAT_RGB565,
-      SDL_PIXELFORMAT_RGB888,
-      SDL_PIXELFORMAT_BGR888,
-      SDL_PIXELFORMAT_ARGB8888,
-      SDL_PIXELFORMAT_RGBA8888,
-      SDL_PIXELFORMAT_ABGR8888,
-      SDL_PIXELFORMAT_BGRA8888
-     },
-     0,
-     0}
-};
-
-typedef struct
-{
-    SDL_Surface *surface;
-    SDL_Surface *window;
-} SW_RenderData;
-
-
-static SDL_Surface *
-SW_ActivateRenderer(SDL_Renderer * renderer)
-{
-    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-
-    if (!data->surface) {
-        data->surface = data->window;
-    }
-    if (!data->surface) {
-        SDL_Surface *surface = SDL_GetWindowSurface(renderer->window);
-        if (surface) {
-            data->surface = data->window = surface;
-
-            SW_UpdateViewport(renderer);
-            SW_UpdateClipRect(renderer);
-        }
-    }
-    return data->surface;
-}
-
-SDL_Renderer *
-SW_CreateRendererForSurface(SDL_Surface * surface)
-{
-    SDL_Renderer *renderer;
-    SW_RenderData *data;
-
-    if (!surface) {
-        SDL_SetError("Can't create renderer for NULL surface");
-        return NULL;
-    }
-
-    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
-    if (!renderer) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    data = (SW_RenderData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        SW_DestroyRenderer(renderer);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    data->surface = surface;
-
-    renderer->WindowEvent = SW_WindowEvent;
-    renderer->GetOutputSize = SW_GetOutputSize;
-    renderer->CreateTexture = SW_CreateTexture;
-    renderer->SetTextureColorMod = SW_SetTextureColorMod;
-    renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod;
-    renderer->SetTextureBlendMode = SW_SetTextureBlendMode;
-    renderer->UpdateTexture = SW_UpdateTexture;
-    renderer->LockTexture = SW_LockTexture;
-    renderer->UnlockTexture = SW_UnlockTexture;
-    renderer->SetRenderTarget = SW_SetRenderTarget;
-    renderer->UpdateViewport = SW_UpdateViewport;
-    renderer->UpdateClipRect = SW_UpdateClipRect;
-    renderer->RenderClear = SW_RenderClear;
-    renderer->RenderDrawPoints = SW_RenderDrawPoints;
-    renderer->RenderDrawLines = SW_RenderDrawLines;
-    renderer->RenderFillRects = SW_RenderFillRects;
-    renderer->RenderCopy = SW_RenderCopy;
-    renderer->RenderCopyEx = SW_RenderCopyEx;
-    renderer->RenderReadPixels = SW_RenderReadPixels;
-    renderer->RenderPresent = SW_RenderPresent;
-    renderer->DestroyTexture = SW_DestroyTexture;
-    renderer->DestroyRenderer = SW_DestroyRenderer;
-    renderer->info = SW_RenderDriver.info;
-    renderer->driverdata = data;
-
-    SW_ActivateRenderer(renderer);
-
-    return renderer;
-}
-
-SDL_Renderer *
-SW_CreateRenderer(SDL_Window * window, Uint32 flags)
-{
-    SDL_Surface *surface;
-
-    surface = SDL_GetWindowSurface(window);
-    if (!surface) {
-        return NULL;
-    }
-    return SW_CreateRendererForSurface(surface);
-}
-
-static void
-SW_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
-{
-    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-
-    if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
-        data->surface = NULL;
-        data->window = NULL;
-    }
-}
-
-static int
-SW_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
-{
-    SDL_Surface *surface = SW_ActivateRenderer(renderer);
-
-    if (surface) {
-        if (w) {
-            *w = surface->w;
-        }
-        if (h) {
-            *h = surface->h;
-        }
-        return 0;
-    } else {
-        SDL_SetError("Software renderer doesn't have an output surface");
-        return -1;
-    }
-}
-
-static int
-SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    int bpp;
-    Uint32 Rmask, Gmask, Bmask, Amask;
-
-    if (!SDL_PixelFormatEnumToMasks
-        (texture->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
-        return SDL_SetError("Unknown texture format");
-    }
-
-    texture->driverdata =
-        SDL_CreateRGBSurface(0, texture->w, texture->h, bpp, Rmask, Gmask,
-                             Bmask, Amask);
-    SDL_SetSurfaceColorMod(texture->driverdata, texture->r, texture->g,
-                           texture->b);
-    SDL_SetSurfaceAlphaMod(texture->driverdata, texture->a);
-    SDL_SetSurfaceBlendMode(texture->driverdata, texture->blendMode);
-
-    if (texture->access == SDL_TEXTUREACCESS_STATIC) {
-        SDL_SetSurfaceRLE(texture->driverdata, 1);
-    }
-
-    if (!texture->driverdata) {
-        return -1;
-    }
-    return 0;
-}
-
-static int
-SW_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
-    return SDL_SetSurfaceColorMod(surface, texture->r, texture->g,
-                                  texture->b);
-}
-
-static int
-SW_SetTextureAlphaMod(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
-    return SDL_SetSurfaceAlphaMod(surface, texture->a);
-}
-
-static int
-SW_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
-    return SDL_SetSurfaceBlendMode(surface, texture->blendMode);
-}
-
-static int
-SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                 const SDL_Rect * rect, const void *pixels, int pitch)
-{
-    SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
-    Uint8 *src, *dst;
-    int row;
-    size_t length;
-
-    if(SDL_MUSTLOCK(surface))
-        SDL_LockSurface(surface);
-    src = (Uint8 *) pixels;
-    dst = (Uint8 *) surface->pixels +
-                        rect->y * surface->pitch +
-                        rect->x * surface->format->BytesPerPixel;
-    length = rect->w * surface->format->BytesPerPixel;
-    for (row = 0; row < rect->h; ++row) {
-        SDL_memcpy(dst, src, length);
-        src += pitch;
-        dst += surface->pitch;
-    }
-    if(SDL_MUSTLOCK(surface))
-        SDL_UnlockSurface(surface);
-    return 0;
-}
-
-static int
-SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-               const SDL_Rect * rect, void **pixels, int *pitch)
-{
-    SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
-
-    *pixels =
-        (void *) ((Uint8 *) surface->pixels + rect->y * surface->pitch +
-                  rect->x * surface->format->BytesPerPixel);
-    *pitch = surface->pitch;
-    return 0;
-}
-
-static void
-SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-}
-
-static int
-SW_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-
-    if (texture ) {
-        data->surface = (SDL_Surface *) texture->driverdata;
-    } else {
-        data->surface = data->window;
-    }
-    return 0;
-}
-
-static int
-SW_UpdateViewport(SDL_Renderer * renderer)
-{
-    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-    SDL_Surface *surface = data->surface;
-
-    if (!surface) {
-        /* We'll update the viewport after we recreate the surface */
-        return 0;
-    }
-
-    SDL_SetClipRect(data->surface, &renderer->viewport);
-    return 0;
-}
-
-static int
-SW_UpdateClipRect(SDL_Renderer * renderer)
-{
-    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-    SDL_Surface *surface = data->surface;
-    const SDL_Rect *rect = &renderer->clip_rect;
-
-    if (surface) {
-        if (!SDL_RectEmpty(rect)) {
-            SDL_SetClipRect(surface, rect);
-        } else {
-            SDL_SetClipRect(surface, NULL);
-        }
-    }
-    return 0;
-}
-
-static int
-SW_RenderClear(SDL_Renderer * renderer)
-{
-    SDL_Surface *surface = SW_ActivateRenderer(renderer);
-    Uint32 color;
-    SDL_Rect clip_rect;
-
-    if (!surface) {
-        return -1;
-    }
-
-    color = SDL_MapRGBA(surface->format,
-                        renderer->r, renderer->g, renderer->b, renderer->a);
-
-    /* By definition the clear ignores the clip rect */
-    clip_rect = surface->clip_rect;
-    SDL_SetClipRect(surface, NULL);
-    SDL_FillRect(surface, NULL, color);
-    SDL_SetClipRect(surface, &clip_rect);
-    return 0;
-}
-
-static int
-SW_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points,
-                    int count)
-{
-    SDL_Surface *surface = SW_ActivateRenderer(renderer);
-    SDL_Point *final_points;
-    int i, status;
-
-    if (!surface) {
-        return -1;
-    }
-
-    final_points = SDL_stack_alloc(SDL_Point, count);
-    if (!final_points) {
-        return SDL_OutOfMemory();
-    }
-    if (renderer->viewport.x || renderer->viewport.y) {
-        int x = renderer->viewport.x;
-        int y = renderer->viewport.y;
-
-        for (i = 0; i < count; ++i) {
-            final_points[i].x = (int)(x + points[i].x);
-            final_points[i].y = (int)(y + points[i].y);
-        }
-    } else {
-        for (i = 0; i < count; ++i) {
-            final_points[i].x = (int)points[i].x;
-            final_points[i].y = (int)points[i].y;
-        }
-    }
-
-    /* Draw the points! */
-    if (renderer->blendMode == SDL_BLENDMODE_NONE) {
-        Uint32 color = SDL_MapRGBA(surface->format,
-                                   renderer->r, renderer->g, renderer->b,
-                                   renderer->a);
-
-        status = SDL_DrawPoints(surface, final_points, count, color);
-    } else {
-        status = SDL_BlendPoints(surface, final_points, count,
-                                renderer->blendMode,
-                                renderer->r, renderer->g, renderer->b,
-                                renderer->a);
-    }
-    SDL_stack_free(final_points);
-
-    return status;
-}
-
-static int
-SW_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points,
-                   int count)
-{
-    SDL_Surface *surface = SW_ActivateRenderer(renderer);
-    SDL_Point *final_points;
-    int i, status;
-
-    if (!surface) {
-        return -1;
-    }
-
-    final_points = SDL_stack_alloc(SDL_Point, count);
-    if (!final_points) {
-        return SDL_OutOfMemory();
-    }
-    if (renderer->viewport.x || renderer->viewport.y) {
-        int x = renderer->viewport.x;
-        int y = renderer->viewport.y;
-
-        for (i = 0; i < count; ++i) {
-            final_points[i].x = (int)(x + points[i].x);
-            final_points[i].y = (int)(y + points[i].y);
-        }
-    } else {
-        for (i = 0; i < count; ++i) {
-            final_points[i].x = (int)points[i].x;
-            final_points[i].y = (int)points[i].y;
-        }
-    }
-
-    /* Draw the lines! */
-    if (renderer->blendMode == SDL_BLENDMODE_NONE) {
-        Uint32 color = SDL_MapRGBA(surface->format,
-                                   renderer->r, renderer->g, renderer->b,
-                                   renderer->a);
-
-        status = SDL_DrawLines(surface, final_points, count, color);
-    } else {
-        status = SDL_BlendLines(surface, final_points, count,
-                                renderer->blendMode,
-                                renderer->r, renderer->g, renderer->b,
-                                renderer->a);
-    }
-    SDL_stack_free(final_points);
-
-    return status;
-}
-
-static int
-SW_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, int count)
-{
-    SDL_Surface *surface = SW_ActivateRenderer(renderer);
-    SDL_Rect *final_rects;
-    int i, status;
-
-    if (!surface) {
-        return -1;
-    }
-
-    final_rects = SDL_stack_alloc(SDL_Rect, count);
-    if (!final_rects) {
-        return SDL_OutOfMemory();
-    }
-    if (renderer->viewport.x || renderer->viewport.y) {
-        int x = renderer->viewport.x;
-        int y = renderer->viewport.y;
-
-        for (i = 0; i < count; ++i) {
-            final_rects[i].x = (int)(x + rects[i].x);
-            final_rects[i].y = (int)(y + rects[i].y);
-            final_rects[i].w = SDL_max((int)rects[i].w, 1);
-            final_rects[i].h = SDL_max((int)rects[i].h, 1);
-        }
-    } else {
-        for (i = 0; i < count; ++i) {
-            final_rects[i].x = (int)rects[i].x;
-            final_rects[i].y = (int)rects[i].y;
-            final_rects[i].w = SDL_max((int)rects[i].w, 1);
-            final_rects[i].h = SDL_max((int)rects[i].h, 1);
-        }
-    }
-
-    if (renderer->blendMode == SDL_BLENDMODE_NONE) {
-        Uint32 color = SDL_MapRGBA(surface->format,
-                                   renderer->r, renderer->g, renderer->b,
-                                   renderer->a);
-        status = SDL_FillRects(surface, final_rects, count, color);
-    } else {
-        status = SDL_BlendFillRects(surface, final_rects, count,
-                                    renderer->blendMode,
-                                    renderer->r, renderer->g, renderer->b,
-                                    renderer->a);
-    }
-    SDL_stack_free(final_rects);
-
-    return status;
-}
-
-static int
-SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-              const SDL_Rect * srcrect, const SDL_FRect * dstrect)
-{
-    SDL_Surface *surface = SW_ActivateRenderer(renderer);
-    SDL_Surface *src = (SDL_Surface *) texture->driverdata;
-    SDL_Rect final_rect;
-
-    if (!surface) {
-        return -1;
-    }
-
-    if (renderer->viewport.x || renderer->viewport.y) {
-        final_rect.x = (int)(renderer->viewport.x + dstrect->x);
-        final_rect.y = (int)(renderer->viewport.y + dstrect->y);
-    } else {
-        final_rect.x = (int)dstrect->x;
-        final_rect.y = (int)dstrect->y;
-    }
-    final_rect.w = (int)dstrect->w;
-    final_rect.h = (int)dstrect->h;
-
-    if ( srcrect->w == final_rect.w && srcrect->h == final_rect.h ) {
-        return SDL_BlitSurface(src, srcrect, surface, &final_rect);
-    } else {
-        return SDL_BlitScaled(src, srcrect, surface, &final_rect);
-    }
-}
-
-static int
-GetScaleQuality(void)
-{
-    const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
-
-    if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
-        return 0;
-    } else {
-        return 1;
-    }
-}
-
-static int
-SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
-                const SDL_Rect * srcrect, const SDL_FRect * dstrect,
-                const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip)
-{
-    SDL_Surface *surface = SW_ActivateRenderer(renderer);
-    SDL_Surface *src = (SDL_Surface *) texture->driverdata;
-    SDL_Rect final_rect, tmp_rect;
-    SDL_Surface *surface_rotated, *surface_scaled;
-    Uint32 colorkey;
-    int retval, dstwidth, dstheight, abscenterx, abscentery;
-    double cangle, sangle, px, py, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y;
-
-    if (!surface) {
-        return -1;
-    }
-
-    if (renderer->viewport.x || renderer->viewport.y) {
-        final_rect.x = (int)(renderer->viewport.x + dstrect->x);
-        final_rect.y = (int)(renderer->viewport.y + dstrect->y);
-    } else {
-        final_rect.x = (int)dstrect->x;
-        final_rect.y = (int)dstrect->y;
-    }
-    final_rect.w = (int)dstrect->w;
-    final_rect.h = (int)dstrect->h;
-
-    surface_scaled = SDL_CreateRGBSurface(SDL_SWSURFACE, final_rect.w, final_rect.h, src->format->BitsPerPixel,
-                                          src->format->Rmask, src->format->Gmask,
-                                          src->format->Bmask, src->format->Amask );
-    if (surface_scaled) {
-        SDL_GetColorKey(src, &colorkey);
-        SDL_SetColorKey(surface_scaled, SDL_TRUE, colorkey);
-        tmp_rect = final_rect;
-        tmp_rect.x = 0;
-        tmp_rect.y = 0;
-
-        retval = SDL_BlitScaled(src, srcrect, surface_scaled, &tmp_rect);
-        if (!retval) {
-            SDLgfx_rotozoomSurfaceSizeTrig(tmp_rect.w, tmp_rect.h, -angle, &dstwidth, &dstheight, &cangle, &sangle);
-            surface_rotated = SDLgfx_rotateSurface(surface_scaled, -angle, dstwidth/2, dstheight/2, GetScaleQuality(), flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL, dstwidth, dstheight, cangle, sangle);
-            if(surface_rotated) {
-                /* Find out where the new origin is by rotating the four final_rect points around the center and then taking the extremes */
-                abscenterx = final_rect.x + (int)center->x;
-                abscentery = final_rect.y + (int)center->y;
-                /* Compensate the angle inversion to match the behaviour of the other backends */
-                sangle = -sangle;
-
-                /* Top Left */
-                px = final_rect.x - abscenterx;
-                py = final_rect.y - abscentery;
-                p1x = px * cangle - py * sangle + abscenterx;
-                p1y = px * sangle + py * cangle + abscentery;
-
-                /* Top Right */
-                px = final_rect.x + final_rect.w - abscenterx;
-                py = final_rect.y - abscentery;
-                p2x = px * cangle - py * sangle + abscenterx;
-                p2y = px * sangle + py * cangle + abscentery;
-
-                /* Bottom Left */
-                px = final_rect.x - abscenterx;
-                py = final_rect.y + final_rect.h - abscentery;
-                p3x = px * cangle - py * sangle + abscenterx;
-                p3y = px * sangle + py * cangle + abscentery;
-
-                /* Bottom Right */
-                px = final_rect.x + final_rect.w - abscenterx;
-                py = final_rect.y + final_rect.h - abscentery;
-                p4x = px * cangle - py * sangle + abscenterx;
-                p4y = px * sangle + py * cangle + abscentery;
-
-                tmp_rect.x = (int)MIN(MIN(p1x, p2x), MIN(p3x, p4x));
-                tmp_rect.y = (int)MIN(MIN(p1y, p2y), MIN(p3y, p4y));
-                tmp_rect.w = dstwidth;
-                tmp_rect.h = dstheight;
-
-                retval = SDL_BlitSurface(surface_rotated, NULL, surface, &tmp_rect);
-                SDL_FreeSurface(surface_scaled);
-                SDL_FreeSurface(surface_rotated);
-                return retval;
-            }
-        }
-        return retval;
-    }
-
-    return -1;
-}
-
-static int
-SW_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                    Uint32 format, void * pixels, int pitch)
-{
-    SDL_Surface *surface = SW_ActivateRenderer(renderer);
-    Uint32 src_format;
-    void *src_pixels;
-    SDL_Rect final_rect;
-
-    if (!surface) {
-        return -1;
-    }
-
-    if (renderer->viewport.x || renderer->viewport.y) {
-        final_rect.x = renderer->viewport.x + rect->x;
-        final_rect.y = renderer->viewport.y + rect->y;
-        final_rect.w = rect->w;
-        final_rect.h = rect->h;
-        rect = &final_rect;
-    }
-
-    if (rect->x < 0 || rect->x+rect->w > surface->w ||
-        rect->y < 0 || rect->y+rect->h > surface->h) {
-        return SDL_SetError("Tried to read outside of surface bounds");
-    }
-
-    src_format = surface->format->format;
-    src_pixels = (void*)((Uint8 *) surface->pixels +
-                    rect->y * surface->pitch +
-                    rect->x * surface->format->BytesPerPixel);
-
-    return SDL_ConvertPixels(rect->w, rect->h,
-                             src_format, src_pixels, surface->pitch,
-                             format, pixels, pitch);
-}
-
-static void
-SW_RenderPresent(SDL_Renderer * renderer)
-{
-    SDL_Window *window = renderer->window;
-
-    if (window) {
-        SDL_UpdateWindowSurface(window);
-    }
-}
-
-static void
-SW_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
-
-    SDL_FreeSurface(surface);
-}
-
-static void
-SW_DestroyRenderer(SDL_Renderer * renderer)
-{
-    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-
-    SDL_free(data);
-    SDL_free(renderer);
-}
-
-#endif /* !SDL_RENDER_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_render_sw_c.h b/deps/SDL2/src/render/software/SDL_render_sw_c.h
deleted file mode 100644
index 7ba0a7e..0000000
--- a/deps/SDL2/src/render/software/SDL_render_sw_c.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-extern SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface * surface);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/render/software/SDL_rotate.c b/deps/SDL2/src/render/software/SDL_rotate.c
deleted file mode 100644
index 3006eda..0000000
--- a/deps/SDL2/src/render/software/SDL_rotate.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
-
-SDL_rotate.c: rotates 32bit or 8bit surfaces
-
-Shamelessly stolen from SDL_gfx by Andreas Schiffler. Original copyright follows:
-
-Copyright (C) 2001-2011  Andreas Schiffler
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-   1. The origin of this software must not be misrepresented; you must not
-   claim that you wrote the original software. If you use this software
-   in a product, an acknowledgment in the product documentation would be
-   appreciated but is not required.
-
-   2. Altered source versions must be plainly marked as such, and must not be
-   misrepresented as being the original software.
-
-   3. This notice may not be removed or altered from any source
-   distribution.
-
-Andreas Schiffler -- aschiffler at ferzkopp dot net
-
-*/
-#include "SDL_config.h"
-
-#if defined(__WIN32__)
-#include "../../core/windows/SDL_windows.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "SDL.h"
-#include "SDL_rotate.h"
-
-/* ---- Internally used structures */
-
-/* !
-\brief A 32 bit RGBA pixel.
-*/
-typedef struct tColorRGBA {
-    Uint8 r;
-    Uint8 g;
-    Uint8 b;
-    Uint8 a;
-} tColorRGBA;
-
-/* !
-\brief A 8bit Y/palette pixel.
-*/
-typedef struct tColorY {
-    Uint8 y;
-} tColorY;
-
-/* !
-\brief Returns maximum of two numbers a and b.
-*/
-#define MAX(a,b)    (((a) > (b)) ? (a) : (b))
-
-/* !
-\brief Number of guard rows added to destination surfaces.
-
-This is a simple but effective workaround for observed issues.
-These rows allocate extra memory and are then hidden from the surface.
-Rows are added to the end of destination surfaces when they are allocated.
-This catches any potential overflows which seem to happen with
-just the right src image dimensions and scale/rotation and can lead
-to a situation where the program can segfault.
-*/
-#define GUARD_ROWS (2)
-
-/* !
-\brief Lower limit of absolute zoom factor or rotation degrees.
-*/
-#define VALUE_LIMIT 0.001
-
-/* !
-\brief Returns colorkey info for a surface
-*/
-static Uint32
-_colorkey(SDL_Surface *src)
-{
-    Uint32 key = 0;
-    SDL_GetColorKey(src, &key);
-    return key;
-}
-
-
-/* !
-\brief Internal target surface sizing function for rotations with trig result return.
-
-\param width The source surface width.
-\param height The source surface height.
-\param angle The angle to rotate in degrees.
-\param dstwidth The calculated width of the destination surface.
-\param dstheight The calculated height of the destination surface.
-\param cangle The sine of the angle
-\param sangle The cosine of the angle
-
-*/
-void
-SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle,
-                               int *dstwidth, int *dstheight,
-                               double *cangle, double *sangle)
-{
-    double x, y, cx, cy, sx, sy;
-    double radangle;
-    int dstwidthhalf, dstheighthalf;
-
-    /*
-    * Determine destination width and height by rotating a centered source box
-    */
-    radangle = angle * (M_PI / 180.0);
-    *sangle = SDL_sin(radangle);
-    *cangle = SDL_cos(radangle);
-    x = (double)(width / 2);
-    y = (double)(height / 2);
-    cx = *cangle * x;
-    cy = *cangle * y;
-    sx = *sangle * x;
-    sy = *sangle * y;
-
-    dstwidthhalf = MAX((int)
-        SDL_ceil(MAX(MAX(MAX(SDL_fabs(cx + sy), SDL_fabs(cx - sy)), SDL_fabs(-cx + sy)), SDL_fabs(-cx - sy))), 1);
-    dstheighthalf = MAX((int)
-        SDL_ceil(MAX(MAX(MAX(SDL_fabs(sx + cy), SDL_fabs(sx - cy)), SDL_fabs(-sx + cy)), SDL_fabs(-sx - cy))), 1);
-    *dstwidth = 2 * dstwidthhalf;
-    *dstheight = 2 * dstheighthalf;
-}
-
-
-/* !
-\brief Internal 32 bit rotozoomer with optional anti-aliasing.
-
-Rotates and zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control
-parameters by scanning the destination surface and applying optionally anti-aliasing
-by bilinear interpolation.
-Assumes src and dst surfaces are of 32 bit depth.
-Assumes dst surface was allocated with the correct dimensions.
-
-\param src Source surface.
-\param dst Destination surface.
-\param cx Horizontal center coordinate.
-\param cy Vertical center coordinate.
-\param isin Integer version of sine of angle.
-\param icos Integer version of cosine of angle.
-\param flipx Flag indicating horizontal mirroring should be applied.
-\param flipy Flag indicating vertical mirroring should be applied.
-\param smooth Flag indicating anti-aliasing should be used.
-*/
-static void
-_transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth)
-{
-    int x, y, t1, t2, dx, dy, xd, yd, sdx, sdy, ax, ay, ex, ey, sw, sh;
-    tColorRGBA c00, c01, c10, c11, cswap;
-    tColorRGBA *pc, *sp;
-    int gap;
-
-    /*
-    * Variable setup
-    */
-    xd = ((src->w - dst->w) << 15);
-    yd = ((src->h - dst->h) << 15);
-    ax = (cx << 16) - (icos * cx);
-    ay = (cy << 16) - (isin * cx);
-    sw = src->w - 1;
-    sh = src->h - 1;
-    pc = (tColorRGBA*) dst->pixels;
-    gap = dst->pitch - dst->w * 4;
-
-    /*
-    * Switch between interpolating and non-interpolating code
-    */
-    if (smooth) {
-        for (y = 0; y < dst->h; y++) {
-            dy = cy - y;
-            sdx = (ax + (isin * dy)) + xd;
-            sdy = (ay - (icos * dy)) + yd;
-            for (x = 0; x < dst->w; x++) {
-                dx = (sdx >> 16);
-                dy = (sdy >> 16);
-                if (flipx) dx = sw - dx;
-                if (flipy) dy = sh - dy;
-                if ((dx > -1) && (dy > -1) && (dx < (src->w-1)) && (dy < (src->h-1))) {
-                    sp = (tColorRGBA *)src->pixels;;
-                    sp += ((src->pitch/4) * dy);
-                    sp += dx;
-                    c00 = *sp;
-                    sp += 1;
-                    c01 = *sp;
-                    sp += (src->pitch/4);
-                    c11 = *sp;
-                    sp -= 1;
-                    c10 = *sp;
-                    if (flipx) {
-                        cswap = c00; c00=c01; c01=cswap;
-                        cswap = c10; c10=c11; c11=cswap;
-                    }
-                    if (flipy) {
-                        cswap = c00; c00=c10; c10=cswap;
-                        cswap = c01; c01=c11; c11=cswap;
-                    }
-                    /*
-                    * Interpolate colors
-                    */
-                    ex = (sdx & 0xffff);
-                    ey = (sdy & 0xffff);
-                    t1 = ((((c01.r - c00.r) * ex) >> 16) + c00.r) & 0xff;
-                    t2 = ((((c11.r - c10.r) * ex) >> 16) + c10.r) & 0xff;
-                    pc->r = (((t2 - t1) * ey) >> 16) + t1;
-                    t1 = ((((c01.g - c00.g) * ex) >> 16) + c00.g) & 0xff;
-                    t2 = ((((c11.g - c10.g) * ex) >> 16) + c10.g) & 0xff;
-                    pc->g = (((t2 - t1) * ey) >> 16) + t1;
-                    t1 = ((((c01.b - c00.b) * ex) >> 16) + c00.b) & 0xff;
-                    t2 = ((((c11.b - c10.b) * ex) >> 16) + c10.b) & 0xff;
-                    pc->b = (((t2 - t1) * ey) >> 16) + t1;
-                    t1 = ((((c01.a - c00.a) * ex) >> 16) + c00.a) & 0xff;
-                    t2 = ((((c11.a - c10.a) * ex) >> 16) + c10.a) & 0xff;
-                    pc->a = (((t2 - t1) * ey) >> 16) + t1;
-                }
-                sdx += icos;
-                sdy += isin;
-                pc++;
-            }
-            pc = (tColorRGBA *) ((Uint8 *) pc + gap);
-        }
-    } else {
-        for (y = 0; y < dst->h; y++) {
-            dy = cy - y;
-            sdx = (ax + (isin * dy)) + xd;
-            sdy = (ay - (icos * dy)) + yd;
-            for (x = 0; x < dst->w; x++) {
-                dx = (short) (sdx >> 16);
-                dy = (short) (sdy >> 16);
-                if (flipx) dx = (src->w-1)-dx;
-                if (flipy) dy = (src->h-1)-dy;
-                if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) {
-                    sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy);
-                    sp += dx;
-                    *pc = *sp;
-                }
-                sdx += icos;
-                sdy += isin;
-                pc++;
-            }
-            pc = (tColorRGBA *) ((Uint8 *) pc + gap);
-        }
-    }
-}
-
-/* !
-
-\brief Rotates and zooms 8 bit palette/Y 'src' surface to 'dst' surface without smoothing.
-
-Rotates and zooms 8 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control
-parameters by scanning the destination surface.
-Assumes src and dst surfaces are of 8 bit depth.
-Assumes dst surface was allocated with the correct dimensions.
-
-\param src Source surface.
-\param dst Destination surface.
-\param cx Horizontal center coordinate.
-\param cy Vertical center coordinate.
-\param isin Integer version of sine of angle.
-\param icos Integer version of cosine of angle.
-\param flipx Flag indicating horizontal mirroring should be applied.
-\param flipy Flag indicating vertical mirroring should be applied.
-*/
-static void
-transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy)
-{
-    int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay;
-    tColorY *pc, *sp;
-    int gap;
-
-    /*
-    * Variable setup
-    */
-    xd = ((src->w - dst->w) << 15);
-    yd = ((src->h - dst->h) << 15);
-    ax = (cx << 16) - (icos * cx);
-    ay = (cy << 16) - (isin * cx);
-    pc = (tColorY*) dst->pixels;
-    gap = dst->pitch - dst->w;
-    /*
-    * Clear surface to colorkey
-    */
-    SDL_memset(pc, (int)(_colorkey(src) & 0xff), dst->pitch * dst->h);
-    /*
-    * Iterate through destination surface
-    */
-    for (y = 0; y < dst->h; y++) {
-        dy = cy - y;
-        sdx = (ax + (isin * dy)) + xd;
-        sdy = (ay - (icos * dy)) + yd;
-        for (x = 0; x < dst->w; x++) {
-            dx = (short) (sdx >> 16);
-            dy = (short) (sdy >> 16);
-            if (flipx) dx = (src->w-1)-dx;
-            if (flipy) dy = (src->h-1)-dy;
-            if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) {
-                sp = (tColorY *) (src->pixels);
-                sp += (src->pitch * dy + dx);
-                *pc = *sp;
-            }
-            sdx += icos;
-            sdy += isin;
-            pc++;
-        }
-        pc += gap;
-    }
-}
-
-
-/* !
-\brief Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing.
-
-Rotates a 32bit or 8bit 'src' surface to newly created 'dst' surface.
-'angle' is the rotation in degrees, 'centerx' and 'centery' the rotation center. If 'smooth' is set
-then the destination 32bit surface is anti-aliased. If the surface is not 8bit
-or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
-
-\param src The surface to rotozoom.
-\param angle The angle to rotate in degrees.
-\param centerx The horizontal coordinate of the center of rotation
-\param zoomy The vertical coordinate of the center of rotation
-\param smooth Antialiasing flag; set to SMOOTHING_ON to enable.
-\param flipx Set to 1 to flip the image horizontally
-\param flipy Set to 1 to flip the image vertically
-\param dstwidth The destination surface width
-\param dstheight The destination surface height
-\param cangle The angle cosine
-\param sangle The angle sine
-\return The new rotated surface.
-
-*/
-
-SDL_Surface *
-SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle)
-{
-    SDL_Surface *rz_src;
-    SDL_Surface *rz_dst;
-    int is32bit;
-    int i, src_converted;
-    Uint8 r,g,b;
-    Uint32 colorkey = 0;
-    int colorKeyAvailable = 0;
-    double sangleinv, cangleinv;
-
-    /*
-    * Sanity check
-    */
-    if (src == NULL)
-        return (NULL);
-
-    if (src->flags & SDL_TRUE/* SDL_SRCCOLORKEY */)
-    {
-        colorkey = _colorkey(src);
-        SDL_GetRGB(colorkey, src->format, &r, &g, &b);
-        colorKeyAvailable = 1;
-    }
-    /*
-    * Determine if source surface is 32bit or 8bit
-    */
-    is32bit = (src->format->BitsPerPixel == 32);
-    if ((is32bit) || (src->format->BitsPerPixel == 8)) {
-        /*
-        * Use source surface 'as is'
-        */
-        rz_src = src;
-        src_converted = 0;
-    } else {
-        /*
-        * New source surface is 32bit with a defined RGBA ordering
-        */
-        rz_src =
-            SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32,
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-            0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
-#else
-            0xff000000,  0x00ff0000, 0x0000ff00, 0x000000ff
-#endif
-            );
-        if(colorKeyAvailable)
-            SDL_SetColorKey(src, 0, 0);
-
-        SDL_BlitSurface(src, NULL, rz_src, NULL);
-
-        if(colorKeyAvailable)
-            SDL_SetColorKey(src, SDL_TRUE /* SDL_SRCCOLORKEY */, colorkey);
-        src_converted = 1;
-        is32bit = 1;
-    }
-
-
-    /* Determine target size */
-    /* _rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, &dstwidth, &dstheight, &cangle, &sangle); */
-
-    /*
-    * Calculate target factors from sin/cos and zoom
-    */
-    sangleinv = sangle*65536.0;
-    cangleinv = cangle*65536.0;
-
-    /*
-    * Alloc space to completely contain the rotated surface
-    */
-    rz_dst = NULL;
-    if (is32bit) {
-        /*
-        * Target surface is 32bit with source RGBA/ABGR ordering
-        */
-        rz_dst =
-            SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32,
-            rz_src->format->Rmask, rz_src->format->Gmask,
-            rz_src->format->Bmask, rz_src->format->Amask);
-    } else {
-        /*
-        * Target surface is 8bit
-        */
-        rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
-    }
-
-    /* Check target */
-    if (rz_dst == NULL)
-        return NULL;
-
-    /* Adjust for guard rows */
-    rz_dst->h = dstheight;
-
-    if (colorKeyAvailable == 1){
-        colorkey = SDL_MapRGB(rz_dst->format, r, g, b);
-
-        SDL_FillRect(rz_dst, NULL, colorkey );
-    }
-
-    /*
-    * Lock source surface
-    */
-    if (SDL_MUSTLOCK(rz_src)) {
-        SDL_LockSurface(rz_src);
-    }
-
-    /*
-    * Check which kind of surface we have
-    */
-    if (is32bit) {
-        /*
-        * Call the 32bit transformation routine to do the rotation (using alpha)
-        */
-        _transformSurfaceRGBA(rz_src, rz_dst, centerx, centery,
-            (int) (sangleinv), (int) (cangleinv),
-            flipx, flipy,
-            smooth);
-        /*
-        * Turn on source-alpha support
-        */
-        /* SDL_SetAlpha(rz_dst, SDL_SRCALPHA, 255); */
-        SDL_SetColorKey(rz_dst, /* SDL_SRCCOLORKEY */ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src));
-    } else {
-        /*
-        * Copy palette and colorkey info
-        */
-        for (i = 0; i < rz_src->format->palette->ncolors; i++) {
-            rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i];
-        }
-        rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors;
-        /*
-        * Call the 8bit transformation routine to do the rotation
-        */
-        transformSurfaceY(rz_src, rz_dst, centerx, centery,
-            (int) (sangleinv), (int) (cangleinv),
-            flipx, flipy);
-        SDL_SetColorKey(rz_dst, /* SDL_SRCCOLORKEY */ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src));
-    }
-    /*
-    * Unlock source surface
-    */
-    if (SDL_MUSTLOCK(rz_src)) {
-        SDL_UnlockSurface(rz_src);
-    }
-
-    /*
-    * Cleanup temp surface
-    */
-    if (src_converted) {
-        SDL_FreeSurface(rz_src);
-    }
-
-    /*
-    * Return destination surface
-    */
-    return (rz_dst);
-}
diff --git a/deps/SDL2/src/render/software/SDL_rotate.h b/deps/SDL2/src/render/software/SDL_rotate.h
deleted file mode 100644
index 31d12a4..0000000
--- a/deps/SDL2/src/render/software/SDL_rotate.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef MIN
-#define MIN(a,b)    (((a) < (b)) ? (a) : (b))
-#endif
-
-extern SDL_Surface *SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle);
-extern void SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle);
-
diff --git a/deps/SDL2/src/stdlib/SDL_getenv.c b/deps/SDL2/src/stdlib/SDL_getenv.c
deleted file mode 100644
index 10fa7c5..0000000
--- a/deps/SDL2/src/stdlib/SDL_getenv.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(__WIN32__)
-#include "../core/windows/SDL_windows.h"
-#endif
-
-#include "SDL_stdinc.h"
-
-#if !defined(SDL_setenv) && defined(__WIN32__)
-/* Note this isn't thread-safe! */
-static char *SDL_envmem = NULL; /* Ugh, memory leak */
-static size_t SDL_envmemlen = 0;
-#endif
-
-
-/* Put a variable into the environment */
-#if defined(HAVE_SETENV)
-int
-SDL_setenv(const char *name, const char *value, int overwrite)
-{
-    return setenv(name, value, overwrite);
-}
-#elif defined(__WIN32__)
-int
-SDL_setenv(const char *name, const char *value, int overwrite)
-{
-    if (!overwrite) {
-        char ch = 0;
-        const size_t len = GetEnvironmentVariableA(name, &ch, sizeof (ch));
-        if (len > 0) {
-            return 0;  /* asked not to overwrite existing value. */
-        }
-    }
-    if (!SetEnvironmentVariableA(name, *value ? value : NULL)) {
-        return -1;
-    }
-    return 0;
-}
-/* We have a real environment table, but no real setenv? Fake it w/ putenv. */
-#elif (defined(HAVE_GETENV) && defined(HAVE_PUTENV) && !defined(HAVE_SETENV))
-int
-SDL_setenv(const char *name, const char *value, int overwrite)
-{
-    size_t len;
-    char *new_variable;
-
-    if (getenv(name) != NULL) {
-        if (overwrite) {
-            unsetenv(name);
-        } else {
-            return 0;  /* leave the existing one there. */
-        }
-    }
-
-    /* This leaks. Sorry. Get a better OS so we don't have to do this. */
-    len = SDL_strlen(name) + SDL_strlen(value) + 2;
-    new_variable = (char *) SDL_malloc(len);
-    if (!new_variable) {
-        return (-1);
-    }
-
-    SDL_snprintf(new_variable, len, "%s=%s", name, value);
-    return putenv(new_variable);
-}
-#else /* roll our own */
-static char **SDL_env = (char **) 0;
-int
-SDL_setenv(const char *name, const char *value, int overwrite)
-{
-    int added;
-    int len, i;
-    char **new_env;
-    char *new_variable;
-
-    /* A little error checking */
-    if (!name || !value) {
-        return (-1);
-    }
-
-    /* See if it already exists */
-    if (!overwrite && SDL_getenv(name)) {
-        return 0;
-    }
-
-    /* Allocate memory for the variable */
-    len = SDL_strlen(name) + SDL_strlen(value) + 2;
-    new_variable = (char *) SDL_malloc(len);
-    if (!new_variable) {
-        return (-1);
-    }
-
-    SDL_snprintf(new_variable, len, "%s=%s", name, value);
-    value = new_variable + SDL_strlen(name) + 1;
-    name = new_variable;
-
-    /* Actually put it into the environment */
-    added = 0;
-    i = 0;
-    if (SDL_env) {
-        /* Check to see if it's already there... */
-        len = (value - name);
-        for (; SDL_env[i]; ++i) {
-            if (SDL_strncmp(SDL_env[i], name, len) == 0) {
-                break;
-            }
-        }
-        /* If we found it, just replace the entry */
-        if (SDL_env[i]) {
-            SDL_free(SDL_env[i]);
-            SDL_env[i] = new_variable;
-            added = 1;
-        }
-    }
-
-    /* Didn't find it in the environment, expand and add */
-    if (!added) {
-        new_env = SDL_realloc(SDL_env, (i + 2) * sizeof(char *));
-        if (new_env) {
-            SDL_env = new_env;
-            SDL_env[i++] = new_variable;
-            SDL_env[i++] = (char *) 0;
-            added = 1;
-        } else {
-            SDL_free(new_variable);
-        }
-    }
-    return (added ? 0 : -1);
-}
-#endif
-
-/* Retrieve a variable named "name" from the environment */
-#if defined(HAVE_GETENV)
-char *
-SDL_getenv(const char *name)
-{
-    return getenv(name);
-}
-#elif defined(__WIN32__)
-char *
-SDL_getenv(const char *name)
-{
-    size_t bufferlen;
-
-    bufferlen =
-        GetEnvironmentVariableA(name, SDL_envmem, (DWORD) SDL_envmemlen);
-    if (bufferlen == 0) {
-        return NULL;
-    }
-    if (bufferlen > SDL_envmemlen) {
-        char *newmem = (char *) SDL_realloc(SDL_envmem, bufferlen);
-        if (newmem == NULL) {
-            return NULL;
-        }
-        SDL_envmem = newmem;
-        SDL_envmemlen = bufferlen;
-        GetEnvironmentVariableA(name, SDL_envmem, (DWORD) SDL_envmemlen);
-    }
-    return SDL_envmem;
-}
-#else
-char *
-SDL_getenv(const char *name)
-{
-    int len, i;
-    char *value;
-
-    value = (char *) 0;
-    if (SDL_env) {
-        len = SDL_strlen(name);
-        for (i = 0; SDL_env[i] && !value; ++i) {
-            if ((SDL_strncmp(SDL_env[i], name, len) == 0) &&
-                (SDL_env[i][len] == '=')) {
-                value = &SDL_env[i][len + 1];
-            }
-        }
-    }
-    return value;
-}
-#endif
-
-
-#ifdef TEST_MAIN
-#include <stdio.h>
-
-int
-main(int argc, char *argv[])
-{
-    char *value;
-
-    printf("Checking for non-existent variable... ");
-    fflush(stdout);
-    if (!SDL_getenv("EXISTS")) {
-        printf("okay\n");
-    } else {
-        printf("failed\n");
-    }
-    printf("Setting FIRST=VALUE1 in the environment... ");
-    fflush(stdout);
-    if (SDL_setenv("FIRST", "VALUE1", 0) == 0) {
-        printf("okay\n");
-    } else {
-        printf("failed\n");
-    }
-    printf("Getting FIRST from the environment... ");
-    fflush(stdout);
-    value = SDL_getenv("FIRST");
-    if (value && (SDL_strcmp(value, "VALUE1") == 0)) {
-        printf("okay\n");
-    } else {
-        printf("failed\n");
-    }
-    printf("Setting SECOND=VALUE2 in the environment... ");
-    fflush(stdout);
-    if (SDL_setenv("SECOND", "VALUE2", 0) == 0) {
-        printf("okay\n");
-    } else {
-        printf("failed\n");
-    }
-    printf("Getting SECOND from the environment... ");
-    fflush(stdout);
-    value = SDL_getenv("SECOND");
-    if (value && (SDL_strcmp(value, "VALUE2") == 0)) {
-        printf("okay\n");
-    } else {
-        printf("failed\n");
-    }
-    printf("Setting FIRST=NOVALUE in the environment... ");
-    fflush(stdout);
-    if (SDL_setenv("FIRST", "NOVALUE", 1) == 0) {
-        printf("okay\n");
-    } else {
-        printf("failed\n");
-    }
-    printf("Getting FIRST from the environment... ");
-    fflush(stdout);
-    value = SDL_getenv("FIRST");
-    if (value && (SDL_strcmp(value, "NOVALUE") == 0)) {
-        printf("okay\n");
-    } else {
-        printf("failed\n");
-    }
-    printf("Checking for non-existent variable... ");
-    fflush(stdout);
-    if (!SDL_getenv("EXISTS")) {
-        printf("okay\n");
-    } else {
-        printf("failed\n");
-    }
-    return (0);
-}
-#endif /* TEST_MAIN */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/stdlib/SDL_iconv.c b/deps/SDL2/src/stdlib/SDL_iconv.c
deleted file mode 100644
index 4de2ebe..0000000
--- a/deps/SDL2/src/stdlib/SDL_iconv.c
+++ /dev/null
@@ -1,924 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This file contains portable iconv functions for SDL */
-
-#include "SDL_stdinc.h"
-#include "SDL_endian.h"
-
-#ifdef HAVE_ICONV
-
-/* Depending on which standard the iconv() was implemented with,
-   iconv() may or may not use const char ** for the inbuf param.
-   If we get this wrong, it's just a warning, so no big deal.
-*/
-#if defined(_XGP6) || defined(__APPLE__) || \
-    (defined(__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)))
-#define ICONV_INBUF_NONCONST
-#endif
-
-#include <errno.h>
-
-SDL_COMPILE_TIME_ASSERT(iconv_t, sizeof (iconv_t) <= sizeof (SDL_iconv_t));
-
-SDL_iconv_t
-SDL_iconv_open(const char *tocode, const char *fromcode)
-{
-    return (SDL_iconv_t) ((size_t) iconv_open(tocode, fromcode));
-}
-
-int
-SDL_iconv_close(SDL_iconv_t cd)
-{
-    return iconv_close((iconv_t) ((size_t) cd));
-}
-
-size_t
-SDL_iconv(SDL_iconv_t cd,
-          const char **inbuf, size_t * inbytesleft,
-          char **outbuf, size_t * outbytesleft)
-{
-    size_t retCode;
-#ifdef ICONV_INBUF_NONCONST
-    retCode = iconv((iconv_t) ((size_t) cd), (char **) inbuf, inbytesleft, outbuf, outbytesleft);
-#else
-    retCode = iconv((iconv_t) ((size_t) cd), inbuf, inbytesleft, outbuf, outbytesleft);
-#endif
-    if (retCode == (size_t) - 1) {
-        switch (errno) {
-        case E2BIG:
-            return SDL_ICONV_E2BIG;
-        case EILSEQ:
-            return SDL_ICONV_EILSEQ;
-        case EINVAL:
-            return SDL_ICONV_EINVAL;
-        default:
-            return SDL_ICONV_ERROR;
-        }
-    }
-    return retCode;
-}
-
-#else
-
-/* Lots of useful information on Unicode at:
-	http://www.cl.cam.ac.uk/~mgk25/unicode.html
-*/
-
-#define UNICODE_BOM	0xFEFF
-
-#define UNKNOWN_ASCII	'?'
-#define UNKNOWN_UNICODE	0xFFFD
-
-enum
-{
-    ENCODING_UNKNOWN,
-    ENCODING_ASCII,
-    ENCODING_LATIN1,
-    ENCODING_UTF8,
-    ENCODING_UTF16,             /* Needs byte order marker */
-    ENCODING_UTF16BE,
-    ENCODING_UTF16LE,
-    ENCODING_UTF32,             /* Needs byte order marker */
-    ENCODING_UTF32BE,
-    ENCODING_UTF32LE,
-    ENCODING_UCS2BE,
-    ENCODING_UCS2LE,
-    ENCODING_UCS4BE,
-    ENCODING_UCS4LE,
-};
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define ENCODING_UTF16NATIVE	ENCODING_UTF16BE
-#define ENCODING_UTF32NATIVE	ENCODING_UTF32BE
-#define ENCODING_UCS2NATIVE     ENCODING_UCS2BE
-#define ENCODING_UCS4NATIVE     ENCODING_UCS4BE
-#else
-#define ENCODING_UTF16NATIVE	ENCODING_UTF16LE
-#define ENCODING_UTF32NATIVE	ENCODING_UTF32LE
-#define ENCODING_UCS2NATIVE     ENCODING_UCS2LE
-#define ENCODING_UCS4NATIVE     ENCODING_UCS4LE
-#endif
-
-struct _SDL_iconv_t
-{
-    int src_fmt;
-    int dst_fmt;
-};
-
-static struct
-{
-    const char *name;
-    int format;
-} encodings[] = {
-/* *INDENT-OFF* */
-    { "ASCII", ENCODING_ASCII },
-    { "US-ASCII", ENCODING_ASCII },
-    { "8859-1", ENCODING_LATIN1 },
-    { "ISO-8859-1", ENCODING_LATIN1 },
-    { "UTF8", ENCODING_UTF8 },
-    { "UTF-8", ENCODING_UTF8 },
-    { "UTF16", ENCODING_UTF16 },
-    { "UTF-16", ENCODING_UTF16 },
-    { "UTF16BE", ENCODING_UTF16BE },
-    { "UTF-16BE", ENCODING_UTF16BE },
-    { "UTF16LE", ENCODING_UTF16LE },
-    { "UTF-16LE", ENCODING_UTF16LE },
-    { "UTF32", ENCODING_UTF32 },
-    { "UTF-32", ENCODING_UTF32 },
-    { "UTF32BE", ENCODING_UTF32BE },
-    { "UTF-32BE", ENCODING_UTF32BE },
-    { "UTF32LE", ENCODING_UTF32LE },
-    { "UTF-32LE", ENCODING_UTF32LE },
-    { "UCS2", ENCODING_UCS2BE },
-    { "UCS-2", ENCODING_UCS2BE },
-    { "UCS-2LE", ENCODING_UCS2LE },
-    { "UCS-2BE", ENCODING_UCS2BE },
-    { "UCS-2-INTERNAL", ENCODING_UCS2NATIVE },
-    { "UCS4", ENCODING_UCS4BE },
-    { "UCS-4", ENCODING_UCS4BE },
-    { "UCS-4LE", ENCODING_UCS4LE },
-    { "UCS-4BE", ENCODING_UCS4BE },
-    { "UCS-4-INTERNAL", ENCODING_UCS4NATIVE },
-/* *INDENT-ON* */
-};
-
-static const char *
-getlocale(char *buffer, size_t bufsize)
-{
-    const char *lang;
-    char *ptr;
-
-    lang = SDL_getenv("LC_ALL");
-    if (!lang) {
-        lang = SDL_getenv("LC_CTYPE");
-    }
-    if (!lang) {
-        lang = SDL_getenv("LC_MESSAGES");
-    }
-    if (!lang) {
-        lang = SDL_getenv("LANG");
-    }
-    if (!lang || !*lang || SDL_strcmp(lang, "C") == 0) {
-        lang = "ASCII";
-    }
-
-    /* We need to trim down strings like "en_US.UTF-8 at blah" to "UTF-8" */
-    ptr = SDL_strchr(lang, '.');
-    if (ptr != NULL) {
-        lang = ptr + 1;
-    }
-
-    SDL_strlcpy(buffer, lang, bufsize);
-    ptr = SDL_strchr(buffer, '@');
-    if (ptr != NULL) {
-        *ptr = '\0';            /* chop end of string. */
-    }
-
-    return buffer;
-}
-
-SDL_iconv_t
-SDL_iconv_open(const char *tocode, const char *fromcode)
-{
-    int src_fmt = ENCODING_UNKNOWN;
-    int dst_fmt = ENCODING_UNKNOWN;
-    int i;
-    char fromcode_buffer[64];
-    char tocode_buffer[64];
-
-    if (!fromcode || !*fromcode) {
-        fromcode = getlocale(fromcode_buffer, sizeof(fromcode_buffer));
-    }
-    if (!tocode || !*tocode) {
-        tocode = getlocale(tocode_buffer, sizeof(tocode_buffer));
-    }
-    for (i = 0; i < SDL_arraysize(encodings); ++i) {
-        if (SDL_strcasecmp(fromcode, encodings[i].name) == 0) {
-            src_fmt = encodings[i].format;
-            if (dst_fmt != ENCODING_UNKNOWN) {
-                break;
-            }
-        }
-        if (SDL_strcasecmp(tocode, encodings[i].name) == 0) {
-            dst_fmt = encodings[i].format;
-            if (src_fmt != ENCODING_UNKNOWN) {
-                break;
-            }
-        }
-    }
-    if (src_fmt != ENCODING_UNKNOWN && dst_fmt != ENCODING_UNKNOWN) {
-        SDL_iconv_t cd = (SDL_iconv_t) SDL_malloc(sizeof(*cd));
-        if (cd) {
-            cd->src_fmt = src_fmt;
-            cd->dst_fmt = dst_fmt;
-            return cd;
-        }
-    }
-    return (SDL_iconv_t) - 1;
-}
-
-size_t
-SDL_iconv(SDL_iconv_t cd,
-          const char **inbuf, size_t * inbytesleft,
-          char **outbuf, size_t * outbytesleft)
-{
-    /* For simplicity, we'll convert everything to and from UCS-4 */
-    const char *src;
-    char *dst;
-    size_t srclen, dstlen;
-    Uint32 ch = 0;
-    size_t total;
-
-    if (!inbuf || !*inbuf) {
-        /* Reset the context */
-        return 0;
-    }
-    if (!outbuf || !*outbuf || !outbytesleft || !*outbytesleft) {
-        return SDL_ICONV_E2BIG;
-    }
-    src = *inbuf;
-    srclen = (inbytesleft ? *inbytesleft : 0);
-    dst = *outbuf;
-    dstlen = *outbytesleft;
-
-    switch (cd->src_fmt) {
-    case ENCODING_UTF16:
-        /* Scan for a byte order marker */
-        {
-            Uint8 *p = (Uint8 *) src;
-            size_t n = srclen / 2;
-            while (n) {
-                if (p[0] == 0xFF && p[1] == 0xFE) {
-                    cd->src_fmt = ENCODING_UTF16BE;
-                    break;
-                } else if (p[0] == 0xFE && p[1] == 0xFF) {
-                    cd->src_fmt = ENCODING_UTF16LE;
-                    break;
-                }
-                p += 2;
-                --n;
-            }
-            if (n == 0) {
-                /* We can't tell, default to host order */
-                cd->src_fmt = ENCODING_UTF16NATIVE;
-            }
-        }
-        break;
-    case ENCODING_UTF32:
-        /* Scan for a byte order marker */
-        {
-            Uint8 *p = (Uint8 *) src;
-            size_t n = srclen / 4;
-            while (n) {
-                if (p[0] == 0xFF && p[1] == 0xFE &&
-                    p[2] == 0x00 && p[3] == 0x00) {
-                    cd->src_fmt = ENCODING_UTF32BE;
-                    break;
-                } else if (p[0] == 0x00 && p[1] == 0x00 &&
-                           p[2] == 0xFE && p[3] == 0xFF) {
-                    cd->src_fmt = ENCODING_UTF32LE;
-                    break;
-                }
-                p += 4;
-                --n;
-            }
-            if (n == 0) {
-                /* We can't tell, default to host order */
-                cd->src_fmt = ENCODING_UTF32NATIVE;
-            }
-        }
-        break;
-    }
-
-    switch (cd->dst_fmt) {
-    case ENCODING_UTF16:
-        /* Default to host order, need to add byte order marker */
-        if (dstlen < 2) {
-            return SDL_ICONV_E2BIG;
-        }
-        *(Uint16 *) dst = UNICODE_BOM;
-        dst += 2;
-        dstlen -= 2;
-        cd->dst_fmt = ENCODING_UTF16NATIVE;
-        break;
-    case ENCODING_UTF32:
-        /* Default to host order, need to add byte order marker */
-        if (dstlen < 4) {
-            return SDL_ICONV_E2BIG;
-        }
-        *(Uint32 *) dst = UNICODE_BOM;
-        dst += 4;
-        dstlen -= 4;
-        cd->dst_fmt = ENCODING_UTF32NATIVE;
-        break;
-    }
-
-    total = 0;
-    while (srclen > 0) {
-        /* Decode a character */
-        switch (cd->src_fmt) {
-        case ENCODING_ASCII:
-            {
-                Uint8 *p = (Uint8 *) src;
-                ch = (Uint32) (p[0] & 0x7F);
-                ++src;
-                --srclen;
-            }
-            break;
-        case ENCODING_LATIN1:
-            {
-                Uint8 *p = (Uint8 *) src;
-                ch = (Uint32) p[0];
-                ++src;
-                --srclen;
-            }
-            break;
-        case ENCODING_UTF8:    /* RFC 3629 */
-            {
-                Uint8 *p = (Uint8 *) src;
-                size_t left = 0;
-                SDL_bool overlong = SDL_FALSE;
-                if (p[0] >= 0xFC) {
-                    if ((p[0] & 0xFE) != 0xFC) {
-                        /* Skip illegal sequences
-                           return SDL_ICONV_EILSEQ;
-                         */
-                        ch = UNKNOWN_UNICODE;
-                    } else {
-                        if (p[0] == 0xFC && srclen > 1 && (p[1] & 0xFC) == 0x80) {
-                            overlong = SDL_TRUE;
-                        }
-                        ch = (Uint32) (p[0] & 0x01);
-                        left = 5;
-                    }
-                } else if (p[0] >= 0xF8) {
-                    if ((p[0] & 0xFC) != 0xF8) {
-                        /* Skip illegal sequences
-                           return SDL_ICONV_EILSEQ;
-                         */
-                        ch = UNKNOWN_UNICODE;
-                    } else {
-                        if (p[0] == 0xF8 && srclen > 1 && (p[1] & 0xF8) == 0x80) {
-                            overlong = SDL_TRUE;
-                        }
-                        ch = (Uint32) (p[0] & 0x03);
-                        left = 4;
-                    }
-                } else if (p[0] >= 0xF0) {
-                    if ((p[0] & 0xF8) != 0xF0) {
-                        /* Skip illegal sequences
-                           return SDL_ICONV_EILSEQ;
-                         */
-                        ch = UNKNOWN_UNICODE;
-                    } else {
-                        if (p[0] == 0xF0 && srclen > 1 && (p[1] & 0xF0) == 0x80) {
-                            overlong = SDL_TRUE;
-                        }
-                        ch = (Uint32) (p[0] & 0x07);
-                        left = 3;
-                    }
-                } else if (p[0] >= 0xE0) {
-                    if ((p[0] & 0xF0) != 0xE0) {
-                        /* Skip illegal sequences
-                           return SDL_ICONV_EILSEQ;
-                         */
-                        ch = UNKNOWN_UNICODE;
-                    } else {
-                        if (p[0] == 0xE0 && srclen > 1 && (p[1] & 0xE0) == 0x80) {
-                            overlong = SDL_TRUE;
-                        }
-                        ch = (Uint32) (p[0] & 0x0F);
-                        left = 2;
-                    }
-                } else if (p[0] >= 0xC0) {
-                    if ((p[0] & 0xE0) != 0xC0) {
-                        /* Skip illegal sequences
-                           return SDL_ICONV_EILSEQ;
-                         */
-                        ch = UNKNOWN_UNICODE;
-                    } else {
-                        if ((p[0] & 0xDE) == 0xC0) {
-                            overlong = SDL_TRUE;
-                        }
-                        ch = (Uint32) (p[0] & 0x1F);
-                        left = 1;
-                    }
-                } else {
-                    if ((p[0] & 0x80) != 0x00) {
-                        /* Skip illegal sequences
-                           return SDL_ICONV_EILSEQ;
-                         */
-                        ch = UNKNOWN_UNICODE;
-                    } else {
-                        ch = (Uint32) p[0];
-                    }
-                }
-                ++src;
-                --srclen;
-                if (srclen < left) {
-                    return SDL_ICONV_EINVAL;
-                }
-                while (left--) {
-                    ++p;
-                    if ((p[0] & 0xC0) != 0x80) {
-                        /* Skip illegal sequences
-                           return SDL_ICONV_EILSEQ;
-                         */
-                        ch = UNKNOWN_UNICODE;
-                        break;
-                    }
-                    ch <<= 6;
-                    ch |= (p[0] & 0x3F);
-                    ++src;
-                    --srclen;
-                }
-                if (overlong) {
-                    /* Potential security risk
-                       return SDL_ICONV_EILSEQ;
-                     */
-                    ch = UNKNOWN_UNICODE;
-                }
-                if ((ch >= 0xD800 && ch <= 0xDFFF) ||
-                    (ch == 0xFFFE || ch == 0xFFFF) || ch > 0x10FFFF) {
-                    /* Skip illegal sequences
-                       return SDL_ICONV_EILSEQ;
-                     */
-                    ch = UNKNOWN_UNICODE;
-                }
-            }
-            break;
-        case ENCODING_UTF16BE: /* RFC 2781 */
-            {
-                Uint8 *p = (Uint8 *) src;
-                Uint16 W1, W2;
-                if (srclen < 2) {
-                    return SDL_ICONV_EINVAL;
-                }
-                W1 = ((Uint16) p[0] << 8) | (Uint16) p[1];
-                src += 2;
-                srclen -= 2;
-                if (W1 < 0xD800 || W1 > 0xDFFF) {
-                    ch = (Uint32) W1;
-                    break;
-                }
-                if (W1 > 0xDBFF) {
-                    /* Skip illegal sequences
-                       return SDL_ICONV_EILSEQ;
-                     */
-                    ch = UNKNOWN_UNICODE;
-                    break;
-                }
-                if (srclen < 2) {
-                    return SDL_ICONV_EINVAL;
-                }
-                p = (Uint8 *) src;
-                W2 = ((Uint16) p[0] << 8) | (Uint16) p[1];
-                src += 2;
-                srclen -= 2;
-                if (W2 < 0xDC00 || W2 > 0xDFFF) {
-                    /* Skip illegal sequences
-                       return SDL_ICONV_EILSEQ;
-                     */
-                    ch = UNKNOWN_UNICODE;
-                    break;
-                }
-                ch = (((Uint32) (W1 & 0x3FF) << 10) |
-                      (Uint32) (W2 & 0x3FF)) + 0x10000;
-            }
-            break;
-        case ENCODING_UTF16LE: /* RFC 2781 */
-            {
-                Uint8 *p = (Uint8 *) src;
-                Uint16 W1, W2;
-                if (srclen < 2) {
-                    return SDL_ICONV_EINVAL;
-                }
-                W1 = ((Uint16) p[1] << 8) | (Uint16) p[0];
-                src += 2;
-                srclen -= 2;
-                if (W1 < 0xD800 || W1 > 0xDFFF) {
-                    ch = (Uint32) W1;
-                    break;
-                }
-                if (W1 > 0xDBFF) {
-                    /* Skip illegal sequences
-                       return SDL_ICONV_EILSEQ;
-                     */
-                    ch = UNKNOWN_UNICODE;
-                    break;
-                }
-                if (srclen < 2) {
-                    return SDL_ICONV_EINVAL;
-                }
-                p = (Uint8 *) src;
-                W2 = ((Uint16) p[1] << 8) | (Uint16) p[0];
-                src += 2;
-                srclen -= 2;
-                if (W2 < 0xDC00 || W2 > 0xDFFF) {
-                    /* Skip illegal sequences
-                       return SDL_ICONV_EILSEQ;
-                     */
-                    ch = UNKNOWN_UNICODE;
-                    break;
-                }
-                ch = (((Uint32) (W1 & 0x3FF) << 10) |
-                      (Uint32) (W2 & 0x3FF)) + 0x10000;
-            }
-            break;
-        case ENCODING_UCS2LE:
-            {
-                Uint8 *p = (Uint8 *) src;
-                if (srclen < 2) {
-                    return SDL_ICONV_EINVAL;
-                }
-                ch = ((Uint32) p[1] << 8) | (Uint32) p[0];
-                src += 2;
-                srclen -= 2;
-            }
-            break;
-        case ENCODING_UCS2BE:
-            {
-                Uint8 *p = (Uint8 *) src;
-                if (srclen < 2) {
-                    return SDL_ICONV_EINVAL;
-                }
-                ch = ((Uint32) p[0] << 8) | (Uint32) p[1];
-                src += 2;
-                srclen -= 2;
-            }
-            break;
-        case ENCODING_UCS4BE:
-        case ENCODING_UTF32BE:
-            {
-                Uint8 *p = (Uint8 *) src;
-                if (srclen < 4) {
-                    return SDL_ICONV_EINVAL;
-                }
-                ch = ((Uint32) p[0] << 24) |
-                    ((Uint32) p[1] << 16) |
-                    ((Uint32) p[2] << 8) | (Uint32) p[3];
-                src += 4;
-                srclen -= 4;
-            }
-            break;
-        case ENCODING_UCS4LE:
-        case ENCODING_UTF32LE:
-            {
-                Uint8 *p = (Uint8 *) src;
-                if (srclen < 4) {
-                    return SDL_ICONV_EINVAL;
-                }
-                ch = ((Uint32) p[3] << 24) |
-                    ((Uint32) p[2] << 16) |
-                    ((Uint32) p[1] << 8) | (Uint32) p[0];
-                src += 4;
-                srclen -= 4;
-            }
-            break;
-        }
-
-        /* Encode a character */
-        switch (cd->dst_fmt) {
-        case ENCODING_ASCII:
-            {
-                Uint8 *p = (Uint8 *) dst;
-                if (dstlen < 1) {
-                    return SDL_ICONV_E2BIG;
-                }
-                if (ch > 0x7F) {
-                    *p = UNKNOWN_ASCII;
-                } else {
-                    *p = (Uint8) ch;
-                }
-                ++dst;
-                --dstlen;
-            }
-            break;
-        case ENCODING_LATIN1:
-            {
-                Uint8 *p = (Uint8 *) dst;
-                if (dstlen < 1) {
-                    return SDL_ICONV_E2BIG;
-                }
-                if (ch > 0xFF) {
-                    *p = UNKNOWN_ASCII;
-                } else {
-                    *p = (Uint8) ch;
-                }
-                ++dst;
-                --dstlen;
-            }
-            break;
-        case ENCODING_UTF8:    /* RFC 3629 */
-            {
-                Uint8 *p = (Uint8 *) dst;
-                if (ch > 0x10FFFF) {
-                    ch = UNKNOWN_UNICODE;
-                }
-                if (ch <= 0x7F) {
-                    if (dstlen < 1) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    *p = (Uint8) ch;
-                    ++dst;
-                    --dstlen;
-                } else if (ch <= 0x7FF) {
-                    if (dstlen < 2) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    p[0] = 0xC0 | (Uint8) ((ch >> 6) & 0x1F);
-                    p[1] = 0x80 | (Uint8) (ch & 0x3F);
-                    dst += 2;
-                    dstlen -= 2;
-                } else if (ch <= 0xFFFF) {
-                    if (dstlen < 3) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    p[0] = 0xE0 | (Uint8) ((ch >> 12) & 0x0F);
-                    p[1] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
-                    p[2] = 0x80 | (Uint8) (ch & 0x3F);
-                    dst += 3;
-                    dstlen -= 3;
-                } else if (ch <= 0x1FFFFF) {
-                    if (dstlen < 4) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    p[0] = 0xF0 | (Uint8) ((ch >> 18) & 0x07);
-                    p[1] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
-                    p[2] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
-                    p[3] = 0x80 | (Uint8) (ch & 0x3F);
-                    dst += 4;
-                    dstlen -= 4;
-                } else if (ch <= 0x3FFFFFF) {
-                    if (dstlen < 5) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    p[0] = 0xF8 | (Uint8) ((ch >> 24) & 0x03);
-                    p[1] = 0x80 | (Uint8) ((ch >> 18) & 0x3F);
-                    p[2] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
-                    p[3] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
-                    p[4] = 0x80 | (Uint8) (ch & 0x3F);
-                    dst += 5;
-                    dstlen -= 5;
-                } else {
-                    if (dstlen < 6) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    p[0] = 0xFC | (Uint8) ((ch >> 30) & 0x01);
-                    p[1] = 0x80 | (Uint8) ((ch >> 24) & 0x3F);
-                    p[2] = 0x80 | (Uint8) ((ch >> 18) & 0x3F);
-                    p[3] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
-                    p[4] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
-                    p[5] = 0x80 | (Uint8) (ch & 0x3F);
-                    dst += 6;
-                    dstlen -= 6;
-                }
-            }
-            break;
-        case ENCODING_UTF16BE: /* RFC 2781 */
-            {
-                Uint8 *p = (Uint8 *) dst;
-                if (ch > 0x10FFFF) {
-                    ch = UNKNOWN_UNICODE;
-                }
-                if (ch < 0x10000) {
-                    if (dstlen < 2) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    p[0] = (Uint8) (ch >> 8);
-                    p[1] = (Uint8) ch;
-                    dst += 2;
-                    dstlen -= 2;
-                } else {
-                    Uint16 W1, W2;
-                    if (dstlen < 4) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    ch = ch - 0x10000;
-                    W1 = 0xD800 | (Uint16) ((ch >> 10) & 0x3FF);
-                    W2 = 0xDC00 | (Uint16) (ch & 0x3FF);
-                    p[0] = (Uint8) (W1 >> 8);
-                    p[1] = (Uint8) W1;
-                    p[2] = (Uint8) (W2 >> 8);
-                    p[3] = (Uint8) W2;
-                    dst += 4;
-                    dstlen -= 4;
-                }
-            }
-            break;
-        case ENCODING_UTF16LE: /* RFC 2781 */
-            {
-                Uint8 *p = (Uint8 *) dst;
-                if (ch > 0x10FFFF) {
-                    ch = UNKNOWN_UNICODE;
-                }
-                if (ch < 0x10000) {
-                    if (dstlen < 2) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    p[1] = (Uint8) (ch >> 8);
-                    p[0] = (Uint8) ch;
-                    dst += 2;
-                    dstlen -= 2;
-                } else {
-                    Uint16 W1, W2;
-                    if (dstlen < 4) {
-                        return SDL_ICONV_E2BIG;
-                    }
-                    ch = ch - 0x10000;
-                    W1 = 0xD800 | (Uint16) ((ch >> 10) & 0x3FF);
-                    W2 = 0xDC00 | (Uint16) (ch & 0x3FF);
-                    p[1] = (Uint8) (W1 >> 8);
-                    p[0] = (Uint8) W1;
-                    p[3] = (Uint8) (W2 >> 8);
-                    p[2] = (Uint8) W2;
-                    dst += 4;
-                    dstlen -= 4;
-                }
-            }
-            break;
-        case ENCODING_UCS2BE:
-            {
-                Uint8 *p = (Uint8 *) dst;
-                if (ch > 0xFFFF) {
-                    ch = UNKNOWN_UNICODE;
-                }
-                if (dstlen < 2) {
-                    return SDL_ICONV_E2BIG;
-                }
-                p[0] = (Uint8) (ch >> 8);
-                p[1] = (Uint8) ch;
-                dst += 2;
-                dstlen -= 2;
-            }
-            break;
-        case ENCODING_UCS2LE:
-            {
-                Uint8 *p = (Uint8 *) dst;
-                if (ch > 0xFFFF) {
-                    ch = UNKNOWN_UNICODE;
-                }
-                if (dstlen < 2) {
-                    return SDL_ICONV_E2BIG;
-                }
-                p[1] = (Uint8) (ch >> 8);
-                p[0] = (Uint8) ch;
-                dst += 2;
-                dstlen -= 2;
-            }
-            break;
-        case ENCODING_UTF32BE:
-            if (ch > 0x10FFFF) {
-                ch = UNKNOWN_UNICODE;
-            }
-        case ENCODING_UCS4BE:
-            if (ch > 0x7FFFFFFF) {
-                ch = UNKNOWN_UNICODE;
-            }
-            {
-                Uint8 *p = (Uint8 *) dst;
-                if (dstlen < 4) {
-                    return SDL_ICONV_E2BIG;
-                }
-                p[0] = (Uint8) (ch >> 24);
-                p[1] = (Uint8) (ch >> 16);
-                p[2] = (Uint8) (ch >> 8);
-                p[3] = (Uint8) ch;
-                dst += 4;
-                dstlen -= 4;
-            }
-            break;
-        case ENCODING_UTF32LE:
-            if (ch > 0x10FFFF) {
-                ch = UNKNOWN_UNICODE;
-            }
-        case ENCODING_UCS4LE:
-            if (ch > 0x7FFFFFFF) {
-                ch = UNKNOWN_UNICODE;
-            }
-            {
-                Uint8 *p = (Uint8 *) dst;
-                if (dstlen < 4) {
-                    return SDL_ICONV_E2BIG;
-                }
-                p[3] = (Uint8) (ch >> 24);
-                p[2] = (Uint8) (ch >> 16);
-                p[1] = (Uint8) (ch >> 8);
-                p[0] = (Uint8) ch;
-                dst += 4;
-                dstlen -= 4;
-            }
-            break;
-        }
-
-        /* Update state */
-        *inbuf = src;
-        *inbytesleft = srclen;
-        *outbuf = dst;
-        *outbytesleft = dstlen;
-        ++total;
-    }
-    return total;
-}
-
-int
-SDL_iconv_close(SDL_iconv_t cd)
-{
-    if (cd != (SDL_iconv_t)-1) {
-        SDL_free(cd);
-    }
-    return 0;
-}
-
-#endif /* !HAVE_ICONV */
-
-char *
-SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf,
-                 size_t inbytesleft)
-{
-    SDL_iconv_t cd;
-    char *string;
-    size_t stringsize;
-    char *outbuf;
-    size_t outbytesleft;
-    size_t retCode = 0;
-
-    cd = SDL_iconv_open(tocode, fromcode);
-    if (cd == (SDL_iconv_t) - 1) {
-        /* See if we can recover here (fixes iconv on Solaris 11) */
-        if (!tocode || !*tocode) {
-            tocode = "UTF-8";
-        }
-        if (!fromcode || !*fromcode) {
-            fromcode = "UTF-8";
-        }
-        cd = SDL_iconv_open(tocode, fromcode);
-    }
-    if (cd == (SDL_iconv_t) - 1) {
-        return NULL;
-    }
-
-    stringsize = inbytesleft > 4 ? inbytesleft : 4;
-    string = SDL_malloc(stringsize);
-    if (!string) {
-        SDL_iconv_close(cd);
-        return NULL;
-    }
-    outbuf = string;
-    outbytesleft = stringsize;
-    SDL_memset(outbuf, 0, 4);
-
-    while (inbytesleft > 0) {
-        retCode = SDL_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
-        switch (retCode) {
-        case SDL_ICONV_E2BIG:
-            {
-                char *oldstring = string;
-                stringsize *= 2;
-                string = SDL_realloc(string, stringsize);
-                if (!string) {
-                    SDL_iconv_close(cd);
-                    return NULL;
-                }
-                outbuf = string + (outbuf - oldstring);
-                outbytesleft = stringsize - (outbuf - string);
-                SDL_memset(outbuf, 0, 4);
-            }
-            break;
-        case SDL_ICONV_EILSEQ:
-            /* Try skipping some input data - not perfect, but... */
-            ++inbuf;
-            --inbytesleft;
-            break;
-        case SDL_ICONV_EINVAL:
-        case SDL_ICONV_ERROR:
-            /* We can't continue... */
-            inbytesleft = 0;
-            break;
-        }
-    }
-    SDL_iconv_close(cd);
-
-    return string;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/stdlib/SDL_malloc.c b/deps/SDL2/src/stdlib/SDL_malloc.c
deleted file mode 100644
index 7a85a3b..0000000
--- a/deps/SDL2/src/stdlib/SDL_malloc.c
+++ /dev/null
@@ -1,5258 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This file contains portable memory management functions for SDL */
-
-#include "SDL_stdinc.h"
-
-#if defined(HAVE_MALLOC)
-
-void *SDL_malloc(size_t size)
-{
-    return malloc(size);
-}
-
-void *SDL_calloc(size_t nmemb, size_t size)
-{
-    return calloc(nmemb, size);
-}
-
-void *SDL_realloc(void *ptr, size_t size)
-{
-    return realloc(ptr, size);
-}
-
-void SDL_free(void *ptr)
-{
-    free(ptr);
-}
-
-#else  /* the rest of this is a LOT of tapdancing to implement malloc. :) */
-
-#define LACKS_SYS_TYPES_H
-#define LACKS_STDIO_H
-#define LACKS_STRINGS_H
-#define LACKS_STRING_H
-#define LACKS_STDLIB_H
-#define ABORT
-
-/*
-  This is a version (aka dlmalloc) of malloc/free/realloc written by
-  Doug Lea and released to the public domain, as explained at
-  http://creativecommons.org/licenses/publicdomain.  Send questions,
-  comments, complaints, performance data, etc to dl at cs.oswego.edu
-
-* Version 2.8.3 Thu Sep 22 11:16:15 2005  Doug Lea  (dl at gee)
-
-   Note: There may be an updated version of this malloc obtainable at
-           ftp://gee.cs.oswego.edu/pub/misc/malloc.c
-         Check before installing!
-
-* Quickstart
-
-  This library is all in one file to simplify the most common usage:
-  ftp it, compile it (-O3), and link it into another program. All of
-  the compile-time options default to reasonable values for use on
-  most platforms.  You might later want to step through various
-  compile-time and dynamic tuning options.
-
-  For convenience, an include file for code using this malloc is at:
-     ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h
-  You don't really need this .h file unless you call functions not
-  defined in your system include files.  The .h file contains only the
-  excerpts from this file needed for using this malloc on ANSI C/C++
-  systems, so long as you haven't changed compile-time options about
-  naming and tuning parameters.  If you do, then you can create your
-  own malloc.h that does include all settings by cutting at the point
-  indicated below. Note that you may already by default be using a C
-  library containing a malloc that is based on some version of this
-  malloc (for example in linux). You might still want to use the one
-  in this file to customize settings or to avoid overheads associated
-  with library versions.
-
-* Vital statistics:
-
-  Supported pointer/size_t representation:       4 or 8 bytes
-       size_t MUST be an unsigned type of the same width as
-       pointers. (If you are using an ancient system that declares
-       size_t as a signed type, or need it to be a different width
-       than pointers, you can use a previous release of this malloc
-       (e.g. 2.7.2) supporting these.)
-
-  Alignment:                                     8 bytes (default)
-       This suffices for nearly all current machines and C compilers.
-       However, you can define MALLOC_ALIGNMENT to be wider than this
-       if necessary (up to 128bytes), at the expense of using more space.
-
-  Minimum overhead per allocated chunk:   4 or  8 bytes (if 4byte sizes)
-                                          8 or 16 bytes (if 8byte sizes)
-       Each malloced chunk has a hidden word of overhead holding size
-       and status information, and additional cross-check word
-       if FOOTERS is defined.
-
-  Minimum allocated size: 4-byte ptrs:  16 bytes    (including overhead)
-                          8-byte ptrs:  32 bytes    (including overhead)
-
-       Even a request for zero bytes (i.e., malloc(0)) returns a
-       pointer to something of the minimum allocatable size.
-       The maximum overhead wastage (i.e., number of extra bytes
-       allocated than were requested in malloc) is less than or equal
-       to the minimum size, except for requests >= mmap_threshold that
-       are serviced via mmap(), where the worst case wastage is about
-       32 bytes plus the remainder from a system page (the minimal
-       mmap unit); typically 4096 or 8192 bytes.
-
-  Security: static-safe; optionally more or less
-       The "security" of malloc refers to the ability of malicious
-       code to accentuate the effects of errors (for example, freeing
-       space that is not currently malloc'ed or overwriting past the
-       ends of chunks) in code that calls malloc.  This malloc
-       guarantees not to modify any memory locations below the base of
-       heap, i.e., static variables, even in the presence of usage
-       errors.  The routines additionally detect most improper frees
-       and reallocs.  All this holds as long as the static bookkeeping
-       for malloc itself is not corrupted by some other means.  This
-       is only one aspect of security -- these checks do not, and
-       cannot, detect all possible programming errors.
-
-       If FOOTERS is defined nonzero, then each allocated chunk
-       carries an additional check word to verify that it was malloced
-       from its space.  These check words are the same within each
-       execution of a program using malloc, but differ across
-       executions, so externally crafted fake chunks cannot be
-       freed. This improves security by rejecting frees/reallocs that
-       could corrupt heap memory, in addition to the checks preventing
-       writes to statics that are always on.  This may further improve
-       security at the expense of time and space overhead.  (Note that
-       FOOTERS may also be worth using with MSPACES.)
-
-       By default detected errors cause the program to abort (calling
-       "abort()"). You can override this to instead proceed past
-       errors by defining PROCEED_ON_ERROR.  In this case, a bad free
-       has no effect, and a malloc that encounters a bad address
-       caused by user overwrites will ignore the bad address by
-       dropping pointers and indices to all known memory. This may
-       be appropriate for programs that should continue if at all
-       possible in the face of programming errors, although they may
-       run out of memory because dropped memory is never reclaimed.
-
-       If you don't like either of these options, you can define
-       CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything
-       else. And if if you are sure that your program using malloc has
-       no errors or vulnerabilities, you can define INSECURE to 1,
-       which might (or might not) provide a small performance improvement.
-
-  Thread-safety: NOT thread-safe unless USE_LOCKS defined
-       When USE_LOCKS is defined, each public call to malloc, free,
-       etc is surrounded with either a pthread mutex or a win32
-       spinlock (depending on WIN32). This is not especially fast, and
-       can be a major bottleneck.  It is designed only to provide
-       minimal protection in concurrent environments, and to provide a
-       basis for extensions.  If you are using malloc in a concurrent
-       program, consider instead using ptmalloc, which is derived from
-       a version of this malloc. (See http://www.malloc.de).
-
-  System requirements: Any combination of MORECORE and/or MMAP/MUNMAP
-       This malloc can use unix sbrk or any emulation (invoked using
-       the CALL_MORECORE macro) and/or mmap/munmap or any emulation
-       (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system
-       memory.  On most unix systems, it tends to work best if both
-       MORECORE and MMAP are enabled.  On Win32, it uses emulations
-       based on VirtualAlloc. It also uses common C library functions
-       like memset.
-
-  Compliance: I believe it is compliant with the Single Unix Specification
-       (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably
-       others as well.
-
-* Overview of algorithms
-
-  This is not the fastest, most space-conserving, most portable, or
-  most tunable malloc ever written. However it is among the fastest
-  while also being among the most space-conserving, portable and
-  tunable.  Consistent balance across these factors results in a good
-  general-purpose allocator for malloc-intensive programs.
-
-  In most ways, this malloc is a best-fit allocator. Generally, it
-  chooses the best-fitting existing chunk for a request, with ties
-  broken in approximately least-recently-used order. (This strategy
-  normally maintains low fragmentation.) However, for requests less
-  than 256bytes, it deviates from best-fit when there is not an
-  exactly fitting available chunk by preferring to use space adjacent
-  to that used for the previous small request, as well as by breaking
-  ties in approximately most-recently-used order. (These enhance
-  locality of series of small allocations.)  And for very large requests
-  (>= 256Kb by default), it relies on system memory mapping
-  facilities, if supported.  (This helps avoid carrying around and
-  possibly fragmenting memory used only for large chunks.)
-
-  All operations (except malloc_stats and mallinfo) have execution
-  times that are bounded by a constant factor of the number of bits in
-  a size_t, not counting any clearing in calloc or copying in realloc,
-  or actions surrounding MORECORE and MMAP that have times
-  proportional to the number of non-contiguous regions returned by
-  system allocation routines, which is often just 1.
-
-  The implementation is not very modular and seriously overuses
-  macros. Perhaps someday all C compilers will do as good a job
-  inlining modular code as can now be done by brute-force expansion,
-  but now, enough of them seem not to.
-
-  Some compilers issue a lot of warnings about code that is
-  dead/unreachable only on some platforms, and also about intentional
-  uses of negation on unsigned types. All known cases of each can be
-  ignored.
-
-  For a longer but out of date high-level description, see
-     http://gee.cs.oswego.edu/dl/html/malloc.html
-
-* MSPACES
-  If MSPACES is defined, then in addition to malloc, free, etc.,
-  this file also defines mspace_malloc, mspace_free, etc. These
-  are versions of malloc routines that take an "mspace" argument
-  obtained using create_mspace, to control all internal bookkeeping.
-  If ONLY_MSPACES is defined, only these versions are compiled.
-  So if you would like to use this allocator for only some allocations,
-  and your system malloc for others, you can compile with
-  ONLY_MSPACES and then do something like...
-    static mspace mymspace = create_mspace(0,0); // for example
-    #define mymalloc(bytes)  mspace_malloc(mymspace, bytes)
-
-  (Note: If you only need one instance of an mspace, you can instead
-  use "USE_DL_PREFIX" to relabel the global malloc.)
-
-  You can similarly create thread-local allocators by storing
-  mspaces as thread-locals. For example:
-    static __thread mspace tlms = 0;
-    void*  tlmalloc(size_t bytes) {
-      if (tlms == 0) tlms = create_mspace(0, 0);
-      return mspace_malloc(tlms, bytes);
-    }
-    void  tlfree(void* mem) { mspace_free(tlms, mem); }
-
-  Unless FOOTERS is defined, each mspace is completely independent.
-  You cannot allocate from one and free to another (although
-  conformance is only weakly checked, so usage errors are not always
-  caught). If FOOTERS is defined, then each chunk carries around a tag
-  indicating its originating mspace, and frees are directed to their
-  originating spaces.
-
- -------------------------  Compile-time options ---------------------------
-
-Be careful in setting #define values for numerical constants of type
-size_t. On some systems, literal values are not automatically extended
-to size_t precision unless they are explicitly casted.
-
-WIN32                    default: defined if _WIN32 defined
-  Defining WIN32 sets up defaults for MS environment and compilers.
-  Otherwise defaults are for unix.
-
-MALLOC_ALIGNMENT         default: (size_t)8
-  Controls the minimum alignment for malloc'ed chunks.  It must be a
-  power of two and at least 8, even on machines for which smaller
-  alignments would suffice. It may be defined as larger than this
-  though. Note however that code and data structures are optimized for
-  the case of 8-byte alignment.
-
-MSPACES                  default: 0 (false)
-  If true, compile in support for independent allocation spaces.
-  This is only supported if HAVE_MMAP is true.
-
-ONLY_MSPACES             default: 0 (false)
-  If true, only compile in mspace versions, not regular versions.
-
-USE_LOCKS                default: 0 (false)
-  Causes each call to each public routine to be surrounded with
-  pthread or WIN32 mutex lock/unlock. (If set true, this can be
-  overridden on a per-mspace basis for mspace versions.)
-
-FOOTERS                  default: 0
-  If true, provide extra checking and dispatching by placing
-  information in the footers of allocated chunks. This adds
-  space and time overhead.
-
-INSECURE                 default: 0
-  If true, omit checks for usage errors and heap space overwrites.
-
-USE_DL_PREFIX            default: NOT defined
-  Causes compiler to prefix all public routines with the string 'dl'.
-  This can be useful when you only want to use this malloc in one part
-  of a program, using your regular system malloc elsewhere.
-
-ABORT                    default: defined as abort()
-  Defines how to abort on failed checks.  On most systems, a failed
-  check cannot die with an "assert" or even print an informative
-  message, because the underlying print routines in turn call malloc,
-  which will fail again.  Generally, the best policy is to simply call
-  abort(). It's not very useful to do more than this because many
-  errors due to overwriting will show up as address faults (null, odd
-  addresses etc) rather than malloc-triggered checks, so will also
-  abort.  Also, most compilers know that abort() does not return, so
-  can better optimize code conditionally calling it.
-
-PROCEED_ON_ERROR           default: defined as 0 (false)
-  Controls whether detected bad addresses cause them to bypassed
-  rather than aborting. If set, detected bad arguments to free and
-  realloc are ignored. And all bookkeeping information is zeroed out
-  upon a detected overwrite of freed heap space, thus losing the
-  ability to ever return it from malloc again, but enabling the
-  application to proceed. If PROCEED_ON_ERROR is defined, the
-  static variable malloc_corruption_error_count is compiled in
-  and can be examined to see if errors have occurred. This option
-  generates slower code than the default abort policy.
-
-DEBUG                    default: NOT defined
-  The DEBUG setting is mainly intended for people trying to modify
-  this code or diagnose problems when porting to new platforms.
-  However, it may also be able to better isolate user errors than just
-  using runtime checks.  The assertions in the check routines spell
-  out in more detail the assumptions and invariants underlying the
-  algorithms.  The checking is fairly extensive, and will slow down
-  execution noticeably. Calling malloc_stats or mallinfo with DEBUG
-  set will attempt to check every non-mmapped allocated and free chunk
-  in the course of computing the summaries.
-
-ABORT_ON_ASSERT_FAILURE   default: defined as 1 (true)
-  Debugging assertion failures can be nearly impossible if your
-  version of the assert macro causes malloc to be called, which will
-  lead to a cascade of further failures, blowing the runtime stack.
-  ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(),
-  which will usually make debugging easier.
-
-MALLOC_FAILURE_ACTION     default: sets errno to ENOMEM, or no-op on win32
-  The action to take before "return 0" when malloc fails to be able to
-  return memory because there is none available.
-
-HAVE_MORECORE             default: 1 (true) unless win32 or ONLY_MSPACES
-  True if this system supports sbrk or an emulation of it.
-
-MORECORE                  default: sbrk
-  The name of the sbrk-style system routine to call to obtain more
-  memory.  See below for guidance on writing custom MORECORE
-  functions. The type of the argument to sbrk/MORECORE varies across
-  systems.  It cannot be size_t, because it supports negative
-  arguments, so it is normally the signed type of the same width as
-  size_t (sometimes declared as "intptr_t").  It doesn't much matter
-  though. Internally, we only call it with arguments less than half
-  the max value of a size_t, which should work across all reasonable
-  possibilities, although sometimes generating compiler warnings.  See
-  near the end of this file for guidelines for creating a custom
-  version of MORECORE.
-
-MORECORE_CONTIGUOUS       default: 1 (true)
-  If true, take advantage of fact that consecutive calls to MORECORE
-  with positive arguments always return contiguous increasing
-  addresses.  This is true of unix sbrk. It does not hurt too much to
-  set it true anyway, since malloc copes with non-contiguities.
-  Setting it false when definitely non-contiguous saves time
-  and possibly wasted space it would take to discover this though.
-
-MORECORE_CANNOT_TRIM      default: NOT defined
-  True if MORECORE cannot release space back to the system when given
-  negative arguments. This is generally necessary only if you are
-  using a hand-crafted MORECORE function that cannot handle negative
-  arguments.
-
-HAVE_MMAP                 default: 1 (true)
-  True if this system supports mmap or an emulation of it.  If so, and
-  HAVE_MORECORE is not true, MMAP is used for all system
-  allocation. If set and HAVE_MORECORE is true as well, MMAP is
-  primarily used to directly allocate very large blocks. It is also
-  used as a backup strategy in cases where MORECORE fails to provide
-  space from system. Note: A single call to MUNMAP is assumed to be
-  able to unmap memory that may have be allocated using multiple calls
-  to MMAP, so long as they are adjacent.
-
-HAVE_MREMAP               default: 1 on linux, else 0
-  If true realloc() uses mremap() to re-allocate large blocks and
-  extend or shrink allocation spaces.
-
-MMAP_CLEARS               default: 1 on unix
-  True if mmap clears memory so calloc doesn't need to. This is true
-  for standard unix mmap using /dev/zero.
-
-USE_BUILTIN_FFS            default: 0 (i.e., not used)
-  Causes malloc to use the builtin ffs() function to compute indices.
-  Some compilers may recognize and intrinsify ffs to be faster than the
-  supplied C version. Also, the case of x86 using gcc is special-cased
-  to an asm instruction, so is already as fast as it can be, and so
-  this setting has no effect. (On most x86s, the asm version is only
-  slightly faster than the C version.)
-
-malloc_getpagesize         default: derive from system includes, or 4096.
-  The system page size. To the extent possible, this malloc manages
-  memory from the system in page-size units.  This may be (and
-  usually is) a function rather than a constant. This is ignored
-  if WIN32, where page size is determined using getSystemInfo during
-  initialization.
-
-USE_DEV_RANDOM             default: 0 (i.e., not used)
-  Causes malloc to use /dev/random to initialize secure magic seed for
-  stamping footers. Otherwise, the current time is used.
-
-NO_MALLINFO                default: 0
-  If defined, don't compile "mallinfo". This can be a simple way
-  of dealing with mismatches between system declarations and
-  those in this file.
-
-MALLINFO_FIELD_TYPE        default: size_t
-  The type of the fields in the mallinfo struct. This was originally
-  defined as "int" in SVID etc, but is more usefully defined as
-  size_t. The value is used only if  HAVE_USR_INCLUDE_MALLOC_H is not set
-
-REALLOC_ZERO_BYTES_FREES    default: not defined
-  This should be set if a call to realloc with zero bytes should
-  be the same as a call to free. Some people think it should. Otherwise,
-  since this malloc returns a unique pointer for malloc(0), so does
-  realloc(p, 0).
-
-LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H
-LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H,  LACKS_ERRNO_H
-LACKS_STDLIB_H                default: NOT defined unless on WIN32
-  Define these if your system does not have these header files.
-  You might need to manually insert some of the declarations they provide.
-
-DEFAULT_GRANULARITY        default: page size if MORECORE_CONTIGUOUS,
-                                system_info.dwAllocationGranularity in WIN32,
-                                otherwise 64K.
-      Also settable using mallopt(M_GRANULARITY, x)
-  The unit for allocating and deallocating memory from the system.  On
-  most systems with contiguous MORECORE, there is no reason to
-  make this more than a page. However, systems with MMAP tend to
-  either require or encourage larger granularities.  You can increase
-  this value to prevent system allocation functions to be called so
-  often, especially if they are slow.  The value must be at least one
-  page and must be a power of two.  Setting to 0 causes initialization
-  to either page size or win32 region size.  (Note: In previous
-  versions of malloc, the equivalent of this option was called
-  "TOP_PAD")
-
-DEFAULT_TRIM_THRESHOLD    default: 2MB
-      Also settable using mallopt(M_TRIM_THRESHOLD, x)
-  The maximum amount of unused top-most memory to keep before
-  releasing via malloc_trim in free().  Automatic trimming is mainly
-  useful in long-lived programs using contiguous MORECORE.  Because
-  trimming via sbrk can be slow on some systems, and can sometimes be
-  wasteful (in cases where programs immediately afterward allocate
-  more large chunks) the value should be high enough so that your
-  overall system performance would improve by releasing this much
-  memory.  As a rough guide, you might set to a value close to the
-  average size of a process (program) running on your system.
-  Releasing this much memory would allow such a process to run in
-  memory.  Generally, it is worth tuning trim thresholds when a
-  program undergoes phases where several large chunks are allocated
-  and released in ways that can reuse each other's storage, perhaps
-  mixed with phases where there are no such chunks at all. The trim
-  value must be greater than page size to have any useful effect.  To
-  disable trimming completely, you can set to MAX_SIZE_T. Note that the trick
-  some people use of mallocing a huge space and then freeing it at
-  program startup, in an attempt to reserve system memory, doesn't
-  have the intended effect under automatic trimming, since that memory
-  will immediately be returned to the system.
-
-DEFAULT_MMAP_THRESHOLD       default: 256K
-      Also settable using mallopt(M_MMAP_THRESHOLD, x)
-  The request size threshold for using MMAP to directly service a
-  request. Requests of at least this size that cannot be allocated
-  using already-existing space will be serviced via mmap.  (If enough
-  normal freed space already exists it is used instead.)  Using mmap
-  segregates relatively large chunks of memory so that they can be
-  individually obtained and released from the host system. A request
-  serviced through mmap is never reused by any other request (at least
-  not directly; the system may just so happen to remap successive
-  requests to the same locations).  Segregating space in this way has
-  the benefits that: Mmapped space can always be individually released
-  back to the system, which helps keep the system level memory demands
-  of a long-lived program low.  Also, mapped memory doesn't become
-  `locked' between other chunks, as can happen with normally allocated
-  chunks, which means that even trimming via malloc_trim would not
-  release them.  However, it has the disadvantage that the space
-  cannot be reclaimed, consolidated, and then used to service later
-  requests, as happens with normal chunks.  The advantages of mmap
-  nearly always outweigh disadvantages for "large" chunks, but the
-  value of "large" may vary across systems.  The default is an
-  empirically derived value that works well in most systems. You can
-  disable mmap by setting to MAX_SIZE_T.
-
-*/
-
-#ifndef WIN32
-#ifdef _WIN32
-#define WIN32 1
-#endif /* _WIN32 */
-#endif /* WIN32 */
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#define HAVE_MMAP 1
-#define HAVE_MORECORE 0
-#define LACKS_UNISTD_H
-#define LACKS_SYS_PARAM_H
-#define LACKS_SYS_MMAN_H
-#define LACKS_STRING_H
-#define LACKS_STRINGS_H
-#define LACKS_SYS_TYPES_H
-#define LACKS_ERRNO_H
-#define LACKS_FCNTL_H
-#define MALLOC_FAILURE_ACTION
-#define MMAP_CLEARS 0           /* WINCE and some others apparently don't clear */
-#endif /* WIN32 */
-
-#if defined(DARWIN) || defined(_DARWIN)
-/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */
-#ifndef HAVE_MORECORE
-#define HAVE_MORECORE 0
-#define HAVE_MMAP 1
-#endif /* HAVE_MORECORE */
-#endif /* DARWIN */
-
-#ifndef LACKS_SYS_TYPES_H
-#include <sys/types.h>          /* For size_t */
-#endif /* LACKS_SYS_TYPES_H */
-
-/* The maximum possible size_t value has all bits set */
-#define MAX_SIZE_T           (~(size_t)0)
-
-#ifndef ONLY_MSPACES
-#define ONLY_MSPACES 0
-#endif /* ONLY_MSPACES */
-#ifndef MSPACES
-#if ONLY_MSPACES
-#define MSPACES 1
-#else /* ONLY_MSPACES */
-#define MSPACES 0
-#endif /* ONLY_MSPACES */
-#endif /* MSPACES */
-#ifndef MALLOC_ALIGNMENT
-#define MALLOC_ALIGNMENT ((size_t)8U)
-#endif /* MALLOC_ALIGNMENT */
-#ifndef FOOTERS
-#define FOOTERS 0
-#endif /* FOOTERS */
-#ifndef ABORT
-#define ABORT  abort()
-#endif /* ABORT */
-#ifndef ABORT_ON_ASSERT_FAILURE
-#define ABORT_ON_ASSERT_FAILURE 1
-#endif /* ABORT_ON_ASSERT_FAILURE */
-#ifndef PROCEED_ON_ERROR
-#define PROCEED_ON_ERROR 0
-#endif /* PROCEED_ON_ERROR */
-#ifndef USE_LOCKS
-#define USE_LOCKS 0
-#endif /* USE_LOCKS */
-#ifndef INSECURE
-#define INSECURE 0
-#endif /* INSECURE */
-#ifndef HAVE_MMAP
-#define HAVE_MMAP 1
-#endif /* HAVE_MMAP */
-#ifndef MMAP_CLEARS
-#define MMAP_CLEARS 1
-#endif /* MMAP_CLEARS */
-#ifndef HAVE_MREMAP
-#ifdef linux
-#define HAVE_MREMAP 1
-#else /* linux */
-#define HAVE_MREMAP 0
-#endif /* linux */
-#endif /* HAVE_MREMAP */
-#ifndef MALLOC_FAILURE_ACTION
-#define MALLOC_FAILURE_ACTION  errno = ENOMEM;
-#endif /* MALLOC_FAILURE_ACTION */
-#ifndef HAVE_MORECORE
-#if ONLY_MSPACES
-#define HAVE_MORECORE 0
-#else /* ONLY_MSPACES */
-#define HAVE_MORECORE 1
-#endif /* ONLY_MSPACES */
-#endif /* HAVE_MORECORE */
-#if !HAVE_MORECORE
-#define MORECORE_CONTIGUOUS 0
-#else /* !HAVE_MORECORE */
-#ifndef MORECORE
-#define MORECORE sbrk
-#endif /* MORECORE */
-#ifndef MORECORE_CONTIGUOUS
-#define MORECORE_CONTIGUOUS 1
-#endif /* MORECORE_CONTIGUOUS */
-#endif /* HAVE_MORECORE */
-#ifndef DEFAULT_GRANULARITY
-#if MORECORE_CONTIGUOUS
-#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */
-#else /* MORECORE_CONTIGUOUS */
-#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U)
-#endif /* MORECORE_CONTIGUOUS */
-#endif /* DEFAULT_GRANULARITY */
-#ifndef DEFAULT_TRIM_THRESHOLD
-#ifndef MORECORE_CANNOT_TRIM
-#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U)
-#else /* MORECORE_CANNOT_TRIM */
-#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T
-#endif /* MORECORE_CANNOT_TRIM */
-#endif /* DEFAULT_TRIM_THRESHOLD */
-#ifndef DEFAULT_MMAP_THRESHOLD
-#if HAVE_MMAP
-#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U)
-#else /* HAVE_MMAP */
-#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
-#endif /* HAVE_MMAP */
-#endif /* DEFAULT_MMAP_THRESHOLD */
-#ifndef USE_BUILTIN_FFS
-#define USE_BUILTIN_FFS 0
-#endif /* USE_BUILTIN_FFS */
-#ifndef USE_DEV_RANDOM
-#define USE_DEV_RANDOM 0
-#endif /* USE_DEV_RANDOM */
-#ifndef NO_MALLINFO
-#define NO_MALLINFO 0
-#endif /* NO_MALLINFO */
-#ifndef MALLINFO_FIELD_TYPE
-#define MALLINFO_FIELD_TYPE size_t
-#endif /* MALLINFO_FIELD_TYPE */
-
-#define memset  SDL_memset
-#define memcpy  SDL_memcpy
-#define malloc  SDL_malloc
-#define calloc  SDL_calloc
-#define realloc SDL_realloc
-#define free    SDL_free
-
-/*
-  mallopt tuning options.  SVID/XPG defines four standard parameter
-  numbers for mallopt, normally defined in malloc.h.  None of these
-  are used in this malloc, so setting them has no effect. But this
-  malloc does support the following options.
-*/
-
-#define M_TRIM_THRESHOLD     (-1)
-#define M_GRANULARITY        (-2)
-#define M_MMAP_THRESHOLD     (-3)
-
-/* ------------------------ Mallinfo declarations ------------------------ */
-
-#if !NO_MALLINFO
-/*
-  This version of malloc supports the standard SVID/XPG mallinfo
-  routine that returns a struct containing usage properties and
-  statistics. It should work on any system that has a
-  /usr/include/malloc.h defining struct mallinfo.  The main
-  declaration needed is the mallinfo struct that is returned (by-copy)
-  by mallinfo().  The malloinfo struct contains a bunch of fields that
-  are not even meaningful in this version of malloc.  These fields are
-  are instead filled by mallinfo() with other numbers that might be of
-  interest.
-
-  HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
-  /usr/include/malloc.h file that includes a declaration of struct
-  mallinfo.  If so, it is included; else a compliant version is
-  declared below.  These must be precisely the same for mallinfo() to
-  work.  The original SVID version of this struct, defined on most
-  systems with mallinfo, declares all fields as ints. But some others
-  define as unsigned long. If your system defines the fields using a
-  type of different width than listed here, you MUST #include your
-  system version and #define HAVE_USR_INCLUDE_MALLOC_H.
-*/
-
-/* #define HAVE_USR_INCLUDE_MALLOC_H */
-
-#ifdef HAVE_USR_INCLUDE_MALLOC_H
-#include "/usr/include/malloc.h"
-#else /* HAVE_USR_INCLUDE_MALLOC_H */
-
-struct mallinfo
-{
-    MALLINFO_FIELD_TYPE arena;  /* non-mmapped space allocated from system */
-    MALLINFO_FIELD_TYPE ordblks;        /* number of free chunks */
-    MALLINFO_FIELD_TYPE smblks; /* always 0 */
-    MALLINFO_FIELD_TYPE hblks;  /* always 0 */
-    MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */
-    MALLINFO_FIELD_TYPE usmblks;        /* maximum total allocated space */
-    MALLINFO_FIELD_TYPE fsmblks;        /* always 0 */
-    MALLINFO_FIELD_TYPE uordblks;       /* total allocated space */
-    MALLINFO_FIELD_TYPE fordblks;       /* total free space */
-    MALLINFO_FIELD_TYPE keepcost;       /* releasable (via malloc_trim) space */
-};
-
-#endif /* HAVE_USR_INCLUDE_MALLOC_H */
-#endif /* NO_MALLINFO */
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif                          /* __cplusplus */
-
-#if !ONLY_MSPACES
-
-/* ------------------- Declarations of public routines ------------------- */
-
-#ifndef USE_DL_PREFIX
-#define dlcalloc               calloc
-#define dlfree                 free
-#define dlmalloc               malloc
-#define dlmemalign             memalign
-#define dlrealloc              realloc
-#define dlvalloc               valloc
-#define dlpvalloc              pvalloc
-#define dlmallinfo             mallinfo
-#define dlmallopt              mallopt
-#define dlmalloc_trim          malloc_trim
-#define dlmalloc_stats         malloc_stats
-#define dlmalloc_usable_size   malloc_usable_size
-#define dlmalloc_footprint     malloc_footprint
-#define dlmalloc_max_footprint malloc_max_footprint
-#define dlindependent_calloc   independent_calloc
-#define dlindependent_comalloc independent_comalloc
-#endif                          /* USE_DL_PREFIX */
-
-
-/*
-  malloc(size_t n)
-  Returns a pointer to a newly allocated chunk of at least n bytes, or
-  null if no space is available, in which case errno is set to ENOMEM
-  on ANSI C systems.
-
-  If n is zero, malloc returns a minimum-sized chunk. (The minimum
-  size is 16 bytes on most 32bit systems, and 32 bytes on 64bit
-  systems.)  Note that size_t is an unsigned type, so calls with
-  arguments that would be negative if signed are interpreted as
-  requests for huge amounts of space, which will often fail. The
-  maximum supported value of n differs across systems, but is in all
-  cases less than the maximum representable value of a size_t.
-*/
-    void *dlmalloc(size_t);
-
-/*
-  free(void* p)
-  Releases the chunk of memory pointed to by p, that had been previously
-  allocated using malloc or a related routine such as realloc.
-  It has no effect if p is null. If p was not malloced or already
-  freed, free(p) will by default cause the current program to abort.
-*/
-    void dlfree(void *);
-
-/*
-  calloc(size_t n_elements, size_t element_size);
-  Returns a pointer to n_elements * element_size bytes, with all locations
-  set to zero.
-*/
-    void *dlcalloc(size_t, size_t);
-
-/*
-  realloc(void* p, size_t n)
-  Returns a pointer to a chunk of size n that contains the same data
-  as does chunk p up to the minimum of (n, p's size) bytes, or null
-  if no space is available.
-
-  The returned pointer may or may not be the same as p. The algorithm
-  prefers extending p in most cases when possible, otherwise it
-  employs the equivalent of a malloc-copy-free sequence.
-
-  If p is null, realloc is equivalent to malloc.
-
-  If space is not available, realloc returns null, errno is set (if on
-  ANSI) and p is NOT freed.
-
-  if n is for fewer bytes than already held by p, the newly unused
-  space is lopped off and freed if possible.  realloc with a size
-  argument of zero (re)allocates a minimum-sized chunk.
-
-  The old unix realloc convention of allowing the last-free'd chunk
-  to be used as an argument to realloc is not supported.
-*/
-
-    void *dlrealloc(void *, size_t);
-
-/*
-  memalign(size_t alignment, size_t n);
-  Returns a pointer to a newly allocated chunk of n bytes, aligned
-  in accord with the alignment argument.
-
-  The alignment argument should be a power of two. If the argument is
-  not a power of two, the nearest greater power is used.
-  8-byte alignment is guaranteed by normal malloc calls, so don't
-  bother calling memalign with an argument of 8 or less.
-
-  Overreliance on memalign is a sure way to fragment space.
-*/
-    void *dlmemalign(size_t, size_t);
-
-/*
-  valloc(size_t n);
-  Equivalent to memalign(pagesize, n), where pagesize is the page
-  size of the system. If the pagesize is unknown, 4096 is used.
-*/
-    void *dlvalloc(size_t);
-
-/*
-  mallopt(int parameter_number, int parameter_value)
-  Sets tunable parameters The format is to provide a
-  (parameter-number, parameter-value) pair.  mallopt then sets the
-  corresponding parameter to the argument value if it can (i.e., so
-  long as the value is meaningful), and returns 1 if successful else
-  0.  SVID/XPG/ANSI defines four standard param numbers for mallopt,
-  normally defined in malloc.h.  None of these are use in this malloc,
-  so setting them has no effect. But this malloc also supports other
-  options in mallopt. See below for details.  Briefly, supported
-  parameters are as follows (listed defaults are for "typical"
-  configurations).
-
-  Symbol            param #  default    allowed param values
-  M_TRIM_THRESHOLD     -1   2*1024*1024   any   (MAX_SIZE_T disables)
-  M_GRANULARITY        -2     page size   any power of 2 >= page size
-  M_MMAP_THRESHOLD     -3      256*1024   any   (or 0 if no MMAP support)
-*/
-    int dlmallopt(int, int);
-
-/*
-  malloc_footprint();
-  Returns the number of bytes obtained from the system.  The total
-  number of bytes allocated by malloc, realloc etc., is less than this
-  value. Unlike mallinfo, this function returns only a precomputed
-  result, so can be called frequently to monitor memory consumption.
-  Even if locks are otherwise defined, this function does not use them,
-  so results might not be up to date.
-*/
-    size_t dlmalloc_footprint(void);
-
-/*
-  malloc_max_footprint();
-  Returns the maximum number of bytes obtained from the system. This
-  value will be greater than current footprint if deallocated space
-  has been reclaimed by the system. The peak number of bytes allocated
-  by malloc, realloc etc., is less than this value. Unlike mallinfo,
-  this function returns only a precomputed result, so can be called
-  frequently to monitor memory consumption.  Even if locks are
-  otherwise defined, this function does not use them, so results might
-  not be up to date.
-*/
-    size_t dlmalloc_max_footprint(void);
-
-#if !NO_MALLINFO
-/*
-  mallinfo()
-  Returns (by copy) a struct containing various summary statistics:
-
-  arena:     current total non-mmapped bytes allocated from system
-  ordblks:   the number of free chunks
-  smblks:    always zero.
-  hblks:     current number of mmapped regions
-  hblkhd:    total bytes held in mmapped regions
-  usmblks:   the maximum total allocated space. This will be greater
-                than current total if trimming has occurred.
-  fsmblks:   always zero
-  uordblks:  current total allocated space (normal or mmapped)
-  fordblks:  total free space
-  keepcost:  the maximum number of bytes that could ideally be released
-               back to system via malloc_trim. ("ideally" means that
-               it ignores page restrictions etc.)
-
-  Because these fields are ints, but internal bookkeeping may
-  be kept as longs, the reported values may wrap around zero and
-  thus be inaccurate.
-*/
-    struct mallinfo dlmallinfo(void);
-#endif                          /* NO_MALLINFO */
-
-/*
-  independent_calloc(size_t n_elements, size_t element_size, void* chunks[]);
-
-  independent_calloc is similar to calloc, but instead of returning a
-  single cleared space, it returns an array of pointers to n_elements
-  independent elements that can hold contents of size elem_size, each
-  of which starts out cleared, and can be independently freed,
-  realloc'ed etc. The elements are guaranteed to be adjacently
-  allocated (this is not guaranteed to occur with multiple callocs or
-  mallocs), which may also improve cache locality in some
-  applications.
-
-  The "chunks" argument is optional (i.e., may be null, which is
-  probably the most typical usage). If it is null, the returned array
-  is itself dynamically allocated and should also be freed when it is
-  no longer needed. Otherwise, the chunks array must be of at least
-  n_elements in length. It is filled in with the pointers to the
-  chunks.
-
-  In either case, independent_calloc returns this pointer array, or
-  null if the allocation failed.  If n_elements is zero and "chunks"
-  is null, it returns a chunk representing an array with zero elements
-  (which should be freed if not wanted).
-
-  Each element must be individually freed when it is no longer
-  needed. If you'd like to instead be able to free all at once, you
-  should instead use regular calloc and assign pointers into this
-  space to represent elements.  (In this case though, you cannot
-  independently free elements.)
-
-  independent_calloc simplifies and speeds up implementations of many
-  kinds of pools.  It may also be useful when constructing large data
-  structures that initially have a fixed number of fixed-sized nodes,
-  but the number is not known at compile time, and some of the nodes
-  may later need to be freed. For example:
-
-  struct Node { int item; struct Node* next; };
-
-  struct Node* build_list() {
-    struct Node** pool;
-    int n = read_number_of_nodes_needed();
-    if (n <= 0) return 0;
-    pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);
-    if (pool == 0) die();
-    // organize into a linked list...
-    struct Node* first = pool[0];
-    for (i = 0; i < n-1; ++i)
-      pool[i]->next = pool[i+1];
-    free(pool);     // Can now free the array (or not, if it is needed later)
-    return first;
-  }
-*/
-    void **dlindependent_calloc(size_t, size_t, void **);
-
-/*
-  independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);
-
-  independent_comalloc allocates, all at once, a set of n_elements
-  chunks with sizes indicated in the "sizes" array.    It returns
-  an array of pointers to these elements, each of which can be
-  independently freed, realloc'ed etc. The elements are guaranteed to
-  be adjacently allocated (this is not guaranteed to occur with
-  multiple callocs or mallocs), which may also improve cache locality
-  in some applications.
-
-  The "chunks" argument is optional (i.e., may be null). If it is null
-  the returned array is itself dynamically allocated and should also
-  be freed when it is no longer needed. Otherwise, the chunks array
-  must be of at least n_elements in length. It is filled in with the
-  pointers to the chunks.
-
-  In either case, independent_comalloc returns this pointer array, or
-  null if the allocation failed.  If n_elements is zero and chunks is
-  null, it returns a chunk representing an array with zero elements
-  (which should be freed if not wanted).
-
-  Each element must be individually freed when it is no longer
-  needed. If you'd like to instead be able to free all at once, you
-  should instead use a single regular malloc, and assign pointers at
-  particular offsets in the aggregate space. (In this case though, you
-  cannot independently free elements.)
-
-  independent_comallac differs from independent_calloc in that each
-  element may have a different size, and also that it does not
-  automatically clear elements.
-
-  independent_comalloc can be used to speed up allocation in cases
-  where several structs or objects must always be allocated at the
-  same time.  For example:
-
-  struct Head { ... }
-  struct Foot { ... }
-
-  void send_message(char* msg) {
-    int msglen = strlen(msg);
-    size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };
-    void* chunks[3];
-    if (independent_comalloc(3, sizes, chunks) == 0)
-      die();
-    struct Head* head = (struct Head*)(chunks[0]);
-    char*        body = (char*)(chunks[1]);
-    struct Foot* foot = (struct Foot*)(chunks[2]);
-    // ...
-  }
-
-  In general though, independent_comalloc is worth using only for
-  larger values of n_elements. For small values, you probably won't
-  detect enough difference from series of malloc calls to bother.
-
-  Overuse of independent_comalloc can increase overall memory usage,
-  since it cannot reuse existing noncontiguous small chunks that
-  might be available for some of the elements.
-*/
-    void **dlindependent_comalloc(size_t, size_t *, void **);
-
-
-/*
-  pvalloc(size_t n);
-  Equivalent to valloc(minimum-page-that-holds(n)), that is,
-  round up n to nearest pagesize.
- */
-    void *dlpvalloc(size_t);
-
-/*
-  malloc_trim(size_t pad);
-
-  If possible, gives memory back to the system (via negative arguments
-  to sbrk) if there is unused memory at the `high' end of the malloc
-  pool or in unused MMAP segments. You can call this after freeing
-  large blocks of memory to potentially reduce the system-level memory
-  requirements of a program. However, it cannot guarantee to reduce
-  memory. Under some allocation patterns, some large free blocks of
-  memory will be locked between two used chunks, so they cannot be
-  given back to the system.
-
-  The `pad' argument to malloc_trim represents the amount of free
-  trailing space to leave untrimmed. If this argument is zero, only
-  the minimum amount of memory to maintain internal data structures
-  will be left. Non-zero arguments can be supplied to maintain enough
-  trailing space to service future expected allocations without having
-  to re-obtain memory from the system.
-
-  Malloc_trim returns 1 if it actually released any memory, else 0.
-*/
-    int dlmalloc_trim(size_t);
-
-/*
-  malloc_usable_size(void* p);
-
-  Returns the number of bytes you can actually use in
-  an allocated chunk, which may be more than you requested (although
-  often not) due to alignment and minimum size constraints.
-  You can use this many bytes without worrying about
-  overwriting other allocated objects. This is not a particularly great
-  programming practice. malloc_usable_size can be more useful in
-  debugging and assertions, for example:
-
-  p = malloc(n);
-  assert(malloc_usable_size(p) >= 256);
-*/
-    size_t dlmalloc_usable_size(void *);
-
-/*
-  malloc_stats();
-  Prints on stderr the amount of space obtained from the system (both
-  via sbrk and mmap), the maximum amount (which may be more than
-  current if malloc_trim and/or munmap got called), and the current
-  number of bytes allocated via malloc (or realloc, etc) but not yet
-  freed. Note that this is the number of bytes allocated, not the
-  number requested. It will be larger than the number requested
-  because of alignment and bookkeeping overhead. Because it includes
-  alignment wastage as being in use, this figure may be greater than
-  zero even when no user-level chunks are allocated.
-
-  The reported current and maximum system memory can be inaccurate if
-  a program makes other calls to system memory allocation functions
-  (normally sbrk) outside of malloc.
-
-  malloc_stats prints only the most commonly interesting statistics.
-  More information can be obtained by calling mallinfo.
-*/
-    void dlmalloc_stats(void);
-
-#endif                          /* ONLY_MSPACES */
-
-#if MSPACES
-
-/*
-  mspace is an opaque type representing an independent
-  region of space that supports mspace_malloc, etc.
-*/
-    typedef void *mspace;
-
-/*
-  create_mspace creates and returns a new independent space with the
-  given initial capacity, or, if 0, the default granularity size.  It
-  returns null if there is no system memory available to create the
-  space.  If argument locked is non-zero, the space uses a separate
-  lock to control access. The capacity of the space will grow
-  dynamically as needed to service mspace_malloc requests.  You can
-  control the sizes of incremental increases of this space by
-  compiling with a different DEFAULT_GRANULARITY or dynamically
-  setting with mallopt(M_GRANULARITY, value).
-*/
-    mspace create_mspace(size_t capacity, int locked);
-
-/*
-  destroy_mspace destroys the given space, and attempts to return all
-  of its memory back to the system, returning the total number of
-  bytes freed. After destruction, the results of access to all memory
-  used by the space become undefined.
-*/
-    size_t destroy_mspace(mspace msp);
-
-/*
-  create_mspace_with_base uses the memory supplied as the initial base
-  of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this
-  space is used for bookkeeping, so the capacity must be at least this
-  large. (Otherwise 0 is returned.) When this initial space is
-  exhausted, additional memory will be obtained from the system.
-  Destroying this space will deallocate all additionally allocated
-  space (if possible) but not the initial base.
-*/
-    mspace create_mspace_with_base(void *base, size_t capacity, int locked);
-
-/*
-  mspace_malloc behaves as malloc, but operates within
-  the given space.
-*/
-    void *mspace_malloc(mspace msp, size_t bytes);
-
-/*
-  mspace_free behaves as free, but operates within
-  the given space.
-
-  If compiled with FOOTERS==1, mspace_free is not actually needed.
-  free may be called instead of mspace_free because freed chunks from
-  any space are handled by their originating spaces.
-*/
-    void mspace_free(mspace msp, void *mem);
-
-/*
-  mspace_realloc behaves as realloc, but operates within
-  the given space.
-
-  If compiled with FOOTERS==1, mspace_realloc is not actually
-  needed.  realloc may be called instead of mspace_realloc because
-  realloced chunks from any space are handled by their originating
-  spaces.
-*/
-    void *mspace_realloc(mspace msp, void *mem, size_t newsize);
-
-/*
-  mspace_calloc behaves as calloc, but operates within
-  the given space.
-*/
-    void *mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);
-
-/*
-  mspace_memalign behaves as memalign, but operates within
-  the given space.
-*/
-    void *mspace_memalign(mspace msp, size_t alignment, size_t bytes);
-
-/*
-  mspace_independent_calloc behaves as independent_calloc, but
-  operates within the given space.
-*/
-    void **mspace_independent_calloc(mspace msp, size_t n_elements,
-                                     size_t elem_size, void *chunks[]);
-
-/*
-  mspace_independent_comalloc behaves as independent_comalloc, but
-  operates within the given space.
-*/
-    void **mspace_independent_comalloc(mspace msp, size_t n_elements,
-                                       size_t sizes[], void *chunks[]);
-
-/*
-  mspace_footprint() returns the number of bytes obtained from the
-  system for this space.
-*/
-    size_t mspace_footprint(mspace msp);
-
-/*
-  mspace_max_footprint() returns the peak number of bytes obtained from the
-  system for this space.
-*/
-    size_t mspace_max_footprint(mspace msp);
-
-
-#if !NO_MALLINFO
-/*
-  mspace_mallinfo behaves as mallinfo, but reports properties of
-  the given space.
-*/
-    struct mallinfo mspace_mallinfo(mspace msp);
-#endif                          /* NO_MALLINFO */
-
-/*
-  mspace_malloc_stats behaves as malloc_stats, but reports
-  properties of the given space.
-*/
-    void mspace_malloc_stats(mspace msp);
-
-/*
-  mspace_trim behaves as malloc_trim, but
-  operates within the given space.
-*/
-    int mspace_trim(mspace msp, size_t pad);
-
-/*
-  An alias for mallopt.
-*/
-    int mspace_mallopt(int, int);
-
-#endif                          /* MSPACES */
-
-#ifdef __cplusplus
-};                              /* end of extern "C" */
-#endif /* __cplusplus */
-
-/*
-  ========================================================================
-  To make a fully customizable malloc.h header file, cut everything
-  above this line, put into file malloc.h, edit to suit, and #include it
-  on the next line, as well as in programs that use this malloc.
-  ========================================================================
-*/
-
-/* #include "malloc.h" */
-
-/*------------------------------ internal #includes ---------------------- */
-
-#ifdef _MSC_VER
-#pragma warning( disable : 4146 )       /* no "unsigned" warnings */
-#endif /* _MSC_VER */
-
-#ifndef LACKS_STDIO_H
-#include <stdio.h>              /* for printing in malloc_stats */
-#endif
-
-#ifndef LACKS_ERRNO_H
-#include <errno.h>              /* for MALLOC_FAILURE_ACTION */
-#endif /* LACKS_ERRNO_H */
-#if FOOTERS
-#include <time.h>               /* for magic initialization */
-#endif /* FOOTERS */
-#ifndef LACKS_STDLIB_H
-#include <stdlib.h>             /* for abort() */
-#endif /* LACKS_STDLIB_H */
-#ifdef DEBUG
-#if ABORT_ON_ASSERT_FAILURE
-#define assert(x) if(!(x)) ABORT
-#else /* ABORT_ON_ASSERT_FAILURE */
-#include <assert.h>
-#endif /* ABORT_ON_ASSERT_FAILURE */
-#else /* DEBUG */
-#define assert(x)
-#endif /* DEBUG */
-#ifndef LACKS_STRING_H
-#include <string.h>             /* for memset etc */
-#endif /* LACKS_STRING_H */
-#if USE_BUILTIN_FFS
-#ifndef LACKS_STRINGS_H
-#include <strings.h>            /* for ffs */
-#endif /* LACKS_STRINGS_H */
-#endif /* USE_BUILTIN_FFS */
-#if HAVE_MMAP
-#ifndef LACKS_SYS_MMAN_H
-#include <sys/mman.h>           /* for mmap */
-#endif /* LACKS_SYS_MMAN_H */
-#ifndef LACKS_FCNTL_H
-#include <fcntl.h>
-#endif /* LACKS_FCNTL_H */
-#endif /* HAVE_MMAP */
-#if HAVE_MORECORE
-#ifndef LACKS_UNISTD_H
-#include <unistd.h>             /* for sbrk */
-#else /* LACKS_UNISTD_H */
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
-extern void *sbrk(ptrdiff_t);
-#endif /* FreeBSD etc */
-#endif /* LACKS_UNISTD_H */
-#endif /* HAVE_MMAP */
-
-#ifndef WIN32
-#ifndef malloc_getpagesize
-#  ifdef _SC_PAGESIZE           /* some SVR4 systems omit an underscore */
-#    ifndef _SC_PAGE_SIZE
-#      define _SC_PAGE_SIZE _SC_PAGESIZE
-#    endif
-#  endif
-#  ifdef _SC_PAGE_SIZE
-#    define malloc_getpagesize sysconf(_SC_PAGE_SIZE)
-#  else
-#    if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
-extern size_t getpagesize();
-#      define malloc_getpagesize getpagesize()
-#    else
-#      ifdef WIN32              /* use supplied emulation of getpagesize */
-#        define malloc_getpagesize getpagesize()
-#      else
-#        ifndef LACKS_SYS_PARAM_H
-#          include <sys/param.h>
-#        endif
-#        ifdef EXEC_PAGESIZE
-#          define malloc_getpagesize EXEC_PAGESIZE
-#        else
-#          ifdef NBPG
-#            ifndef CLSIZE
-#              define malloc_getpagesize NBPG
-#            else
-#              define malloc_getpagesize (NBPG * CLSIZE)
-#            endif
-#          else
-#            ifdef NBPC
-#              define malloc_getpagesize NBPC
-#            else
-#              ifdef PAGESIZE
-#                define malloc_getpagesize PAGESIZE
-#              else /* just guess */
-#                define malloc_getpagesize ((size_t)4096U)
-#              endif
-#            endif
-#          endif
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-#endif
-
-/* ------------------- size_t and alignment properties -------------------- */
-
-/* The byte and bit size of a size_t */
-#define SIZE_T_SIZE         (sizeof(size_t))
-#define SIZE_T_BITSIZE      (sizeof(size_t) << 3)
-
-/* Some constants coerced to size_t */
-/* Annoying but necessary to avoid errors on some plaftorms */
-#define SIZE_T_ZERO         ((size_t)0)
-#define SIZE_T_ONE          ((size_t)1)
-#define SIZE_T_TWO          ((size_t)2)
-#define TWO_SIZE_T_SIZES    (SIZE_T_SIZE<<1)
-#define FOUR_SIZE_T_SIZES   (SIZE_T_SIZE<<2)
-#define SIX_SIZE_T_SIZES    (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)
-#define HALF_MAX_SIZE_T     (MAX_SIZE_T / 2U)
-
-/* The bit mask value corresponding to MALLOC_ALIGNMENT */
-#define CHUNK_ALIGN_MASK    (MALLOC_ALIGNMENT - SIZE_T_ONE)
-
-/* True if address a has acceptable alignment */
-#define is_aligned(A)       (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0)
-
-/* the number of bytes to offset an address to align it */
-#define align_offset(A)\
- ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\
-  ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK))
-
-/* -------------------------- MMAP preliminaries ------------------------- */
-
-/*
-   If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and
-   checks to fail so compiler optimizer can delete code rather than
-   using so many "#if"s.
-*/
-
-
-/* MORECORE and MMAP must return MFAIL on failure */
-#define MFAIL                ((void*)(MAX_SIZE_T))
-#define CMFAIL               ((char*)(MFAIL))   /* defined for convenience */
-
-#if !HAVE_MMAP
-#define IS_MMAPPED_BIT       (SIZE_T_ZERO)
-#define USE_MMAP_BIT         (SIZE_T_ZERO)
-#define CALL_MMAP(s)         MFAIL
-#define CALL_MUNMAP(a, s)    (-1)
-#define DIRECT_MMAP(s)       MFAIL
-
-#else /* HAVE_MMAP */
-#define IS_MMAPPED_BIT       (SIZE_T_ONE)
-#define USE_MMAP_BIT         (SIZE_T_ONE)
-
-#ifndef WIN32
-#define CALL_MUNMAP(a, s)    munmap((a), (s))
-#define MMAP_PROT            (PROT_READ|PROT_WRITE)
-#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-#define MAP_ANONYMOUS        MAP_ANON
-#endif /* MAP_ANON */
-#ifdef MAP_ANONYMOUS
-#define MMAP_FLAGS           (MAP_PRIVATE|MAP_ANONYMOUS)
-#define CALL_MMAP(s)         mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0)
-#else /* MAP_ANONYMOUS */
-/*
-   Nearly all versions of mmap support MAP_ANONYMOUS, so the following
-   is unlikely to be needed, but is supplied just in case.
-*/
-#define MMAP_FLAGS           (MAP_PRIVATE)
-static int dev_zero_fd = -1;    /* Cached file descriptor for /dev/zero. */
-#define CALL_MMAP(s) ((dev_zero_fd < 0) ? \
-           (dev_zero_fd = open("/dev/zero", O_RDWR), \
-            mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \
-            mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0))
-#endif /* MAP_ANONYMOUS */
-
-#define DIRECT_MMAP(s)       CALL_MMAP(s)
-#else /* WIN32 */
-
-/* Win32 MMAP via VirtualAlloc */
-static void *
-win32mmap(size_t size)
-{
-    void *ptr =
-        VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
-    return (ptr != 0) ? ptr : MFAIL;
-}
-
-/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */
-static void *
-win32direct_mmap(size_t size)
-{
-    void *ptr = VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN,
-                             PAGE_READWRITE);
-    return (ptr != 0) ? ptr : MFAIL;
-}
-
-/* This function supports releasing coalesed segments */
-static int
-win32munmap(void *ptr, size_t size)
-{
-    MEMORY_BASIC_INFORMATION minfo;
-    char *cptr = ptr;
-    while (size) {
-        if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0)
-            return -1;
-        if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr ||
-            minfo.State != MEM_COMMIT || minfo.RegionSize > size)
-            return -1;
-        if (VirtualFree(cptr, 0, MEM_RELEASE) == 0)
-            return -1;
-        cptr += minfo.RegionSize;
-        size -= minfo.RegionSize;
-    }
-    return 0;
-}
-
-#define CALL_MMAP(s)         win32mmap(s)
-#define CALL_MUNMAP(a, s)    win32munmap((a), (s))
-#define DIRECT_MMAP(s)       win32direct_mmap(s)
-#endif /* WIN32 */
-#endif /* HAVE_MMAP */
-
-#if HAVE_MMAP && HAVE_MREMAP
-#define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv))
-#else /* HAVE_MMAP && HAVE_MREMAP */
-#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL
-#endif /* HAVE_MMAP && HAVE_MREMAP */
-
-#if HAVE_MORECORE
-#define CALL_MORECORE(S)     MORECORE(S)
-#else /* HAVE_MORECORE */
-#define CALL_MORECORE(S)     MFAIL
-#endif /* HAVE_MORECORE */
-
-/* mstate bit set if continguous morecore disabled or failed */
-#define USE_NONCONTIGUOUS_BIT (4U)
-
-/* segment bit set in create_mspace_with_base */
-#define EXTERN_BIT            (8U)
-
-
-/* --------------------------- Lock preliminaries ------------------------ */
-
-#if USE_LOCKS
-
-/*
-  When locks are defined, there are up to two global locks:
-
-  * If HAVE_MORECORE, morecore_mutex protects sequences of calls to
-    MORECORE.  In many cases sys_alloc requires two calls, that should
-    not be interleaved with calls by other threads.  This does not
-    protect against direct calls to MORECORE by other threads not
-    using this lock, so there is still code to cope the best we can on
-    interference.
-
-  * magic_init_mutex ensures that mparams.magic and other
-    unique mparams values are initialized only once.
-*/
-
-#ifndef WIN32
-/* By default use posix locks */
-#include <pthread.h>
-#define MLOCK_T pthread_mutex_t
-#define INITIAL_LOCK(l)      pthread_mutex_init(l, NULL)
-#define ACQUIRE_LOCK(l)      pthread_mutex_lock(l)
-#define RELEASE_LOCK(l)      pthread_mutex_unlock(l)
-
-#if HAVE_MORECORE
-static MLOCK_T morecore_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* HAVE_MORECORE */
-
-static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-#else /* WIN32 */
-/*
-   Because lock-protected regions have bounded times, and there
-   are no recursive lock calls, we can use simple spinlocks.
-*/
-
-#define MLOCK_T long
-static int
-win32_acquire_lock(MLOCK_T * sl)
-{
-    for (;;) {
-#ifdef InterlockedCompareExchangePointer
-        if (!InterlockedCompareExchange(sl, 1, 0))
-            return 0;
-#else /* Use older void* version */
-        if (!InterlockedCompareExchange((void **) sl, (void *) 1, (void *) 0))
-            return 0;
-#endif /* InterlockedCompareExchangePointer */
-        Sleep(0);
-    }
-}
-
-static void
-win32_release_lock(MLOCK_T * sl)
-{
-    InterlockedExchange(sl, 0);
-}
-
-#define INITIAL_LOCK(l)      *(l)=0
-#define ACQUIRE_LOCK(l)      win32_acquire_lock(l)
-#define RELEASE_LOCK(l)      win32_release_lock(l)
-#if HAVE_MORECORE
-static MLOCK_T morecore_mutex;
-#endif /* HAVE_MORECORE */
-static MLOCK_T magic_init_mutex;
-#endif /* WIN32 */
-
-#define USE_LOCK_BIT               (2U)
-#else /* USE_LOCKS */
-#define USE_LOCK_BIT               (0U)
-#define INITIAL_LOCK(l)
-#endif /* USE_LOCKS */
-
-#if USE_LOCKS && HAVE_MORECORE
-#define ACQUIRE_MORECORE_LOCK()    ACQUIRE_LOCK(&morecore_mutex);
-#define RELEASE_MORECORE_LOCK()    RELEASE_LOCK(&morecore_mutex);
-#else /* USE_LOCKS && HAVE_MORECORE */
-#define ACQUIRE_MORECORE_LOCK()
-#define RELEASE_MORECORE_LOCK()
-#endif /* USE_LOCKS && HAVE_MORECORE */
-
-#if USE_LOCKS
-#define ACQUIRE_MAGIC_INIT_LOCK()  ACQUIRE_LOCK(&magic_init_mutex);
-#define RELEASE_MAGIC_INIT_LOCK()  RELEASE_LOCK(&magic_init_mutex);
-#else /* USE_LOCKS */
-#define ACQUIRE_MAGIC_INIT_LOCK()
-#define RELEASE_MAGIC_INIT_LOCK()
-#endif /* USE_LOCKS */
-
-
-/* -----------------------  Chunk representations ------------------------ */
-
-/*
-  (The following includes lightly edited explanations by Colin Plumb.)
-
-  The malloc_chunk declaration below is misleading (but accurate and
-  necessary).  It declares a "view" into memory allowing access to
-  necessary fields at known offsets from a given base.
-
-  Chunks of memory are maintained using a `boundary tag' method as
-  originally described by Knuth.  (See the paper by Paul Wilson
-  ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such
-  techniques.)  Sizes of free chunks are stored both in the front of
-  each chunk and at the end.  This makes consolidating fragmented
-  chunks into bigger chunks fast.  The head fields also hold bits
-  representing whether chunks are free or in use.
-
-  Here are some pictures to make it clearer.  They are "exploded" to
-  show that the state of a chunk can be thought of as extending from
-  the high 31 bits of the head field of its header through the
-  prev_foot and PINUSE_BIT bit of the following chunk header.
-
-  A chunk that's in use looks like:
-
-   chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-           | Size of previous chunk (if P = 1)                             |
-           +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
-         | Size of this chunk                                         1| +-+
-   mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         |                                                               |
-         +-                                                             -+
-         |                                                               |
-         +-                                                             -+
-         |                                                               :
-         +-      size - sizeof(size_t) available payload bytes          -+
-         :                                                               |
- chunk-> +-                                                             -+
-         |                                                               |
-         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1|
-       | Size of next chunk (may or may not be in use)               | +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-    And if it's free, it looks like this:
-
-   chunk-> +-                                                             -+
-           | User payload (must be in use, or we would have merged!)       |
-           +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
-         | Size of this chunk                                         0| +-+
-   mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         | Next pointer                                                  |
-         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         | Prev pointer                                                  |
-         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         |                                                               :
-         +-      size - sizeof(struct chunk) unused bytes               -+
-         :                                                               |
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-         | Size of this chunk                                            |
-         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0|
-       | Size of next chunk (must be in use, or we would have merged)| +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-       |                                                               :
-       +- User payload                                                -+
-       :                                                               |
-       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-                                                                     |0|
-                                                                     +-+
-  Note that since we always merge adjacent free chunks, the chunks
-  adjacent to a free chunk must be in use.
-
-  Given a pointer to a chunk (which can be derived trivially from the
-  payload pointer) we can, in O(1) time, find out whether the adjacent
-  chunks are free, and if so, unlink them from the lists that they
-  are on and merge them with the current chunk.
-
-  Chunks always begin on even word boundaries, so the mem portion
-  (which is returned to the user) is also on an even word boundary, and
-  thus at least double-word aligned.
-
-  The P (PINUSE_BIT) bit, stored in the unused low-order bit of the
-  chunk size (which is always a multiple of two words), is an in-use
-  bit for the *previous* chunk.  If that bit is *clear*, then the
-  word before the current chunk size contains the previous chunk
-  size, and can be used to find the front of the previous chunk.
-  The very first chunk allocated always has this bit set, preventing
-  access to non-existent (or non-owned) memory. If pinuse is set for
-  any given chunk, then you CANNOT determine the size of the
-  previous chunk, and might even get a memory addressing fault when
-  trying to do so.
-
-  The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of
-  the chunk size redundantly records whether the current chunk is
-  inuse. This redundancy enables usage checks within free and realloc,
-  and reduces indirection when freeing and consolidating chunks.
-
-  Each freshly allocated chunk must have both cinuse and pinuse set.
-  That is, each allocated chunk borders either a previously allocated
-  and still in-use chunk, or the base of its memory arena. This is
-  ensured by making all allocations from the the `lowest' part of any
-  found chunk.  Further, no free chunk physically borders another one,
-  so each free chunk is known to be preceded and followed by either
-  inuse chunks or the ends of memory.
-
-  Note that the `foot' of the current chunk is actually represented
-  as the prev_foot of the NEXT chunk. This makes it easier to
-  deal with alignments etc but can be very confusing when trying
-  to extend or adapt this code.
-
-  The exceptions to all this are
-
-     1. The special chunk `top' is the top-most available chunk (i.e.,
-        the one bordering the end of available memory). It is treated
-        specially.  Top is never included in any bin, is used only if
-        no other chunk is available, and is released back to the
-        system if it is very large (see M_TRIM_THRESHOLD).  In effect,
-        the top chunk is treated as larger (and thus less well
-        fitting) than any other available chunk.  The top chunk
-        doesn't update its trailing size field since there is no next
-        contiguous chunk that would have to index off it. However,
-        space is still allocated for it (TOP_FOOT_SIZE) to enable
-        separation or merging when space is extended.
-
-     3. Chunks allocated via mmap, which have the lowest-order bit
-        (IS_MMAPPED_BIT) set in their prev_foot fields, and do not set
-        PINUSE_BIT in their head fields.  Because they are allocated
-        one-by-one, each must carry its own prev_foot field, which is
-        also used to hold the offset this chunk has within its mmapped
-        region, which is needed to preserve alignment. Each mmapped
-        chunk is trailed by the first two fields of a fake next-chunk
-        for sake of usage checks.
-
-*/
-
-struct malloc_chunk
-{
-    size_t prev_foot;           /* Size of previous chunk (if free).  */
-    size_t head;                /* Size and inuse bits. */
-    struct malloc_chunk *fd;    /* double links -- used only if free. */
-    struct malloc_chunk *bk;
-};
-
-typedef struct malloc_chunk mchunk;
-typedef struct malloc_chunk *mchunkptr;
-typedef struct malloc_chunk *sbinptr;   /* The type of bins of chunks */
-typedef size_t bindex_t;        /* Described below */
-typedef unsigned int binmap_t;  /* Described below */
-typedef unsigned int flag_t;    /* The type of various bit flag sets */
-
-/* ------------------- Chunks sizes and alignments ----------------------- */
-
-#define MCHUNK_SIZE         (sizeof(mchunk))
-
-#if FOOTERS
-#define CHUNK_OVERHEAD      (TWO_SIZE_T_SIZES)
-#else /* FOOTERS */
-#define CHUNK_OVERHEAD      (SIZE_T_SIZE)
-#endif /* FOOTERS */
-
-/* MMapped chunks need a second word of overhead ... */
-#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
-/* ... and additional padding for fake next-chunk at foot */
-#define MMAP_FOOT_PAD       (FOUR_SIZE_T_SIZES)
-
-/* The smallest size we can malloc is an aligned minimal chunk */
-#define MIN_CHUNK_SIZE\
-  ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
-
-/* conversion from malloc headers to user pointers, and back */
-#define chunk2mem(p)        ((void*)((char*)(p)       + TWO_SIZE_T_SIZES))
-#define mem2chunk(mem)      ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES))
-/* chunk associated with aligned address A */
-#define align_as_chunk(A)   (mchunkptr)((A) + align_offset(chunk2mem(A)))
-
-/* Bounds on request (not chunk) sizes. */
-#define MAX_REQUEST         ((-MIN_CHUNK_SIZE) << 2)
-#define MIN_REQUEST         (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)
-
-/* pad request bytes into a usable size */
-#define pad_request(req) \
-   (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
-
-/* pad request, checking for minimum (but not maximum) */
-#define request2size(req) \
-  (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))
-
-
-/* ------------------ Operations on head and foot fields ----------------- */
-
-/*
-  The head field of a chunk is or'ed with PINUSE_BIT when previous
-  adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in
-  use. If the chunk was obtained with mmap, the prev_foot field has
-  IS_MMAPPED_BIT set, otherwise holding the offset of the base of the
-  mmapped region to the base of the chunk.
-*/
-
-#define PINUSE_BIT          (SIZE_T_ONE)
-#define CINUSE_BIT          (SIZE_T_TWO)
-#define INUSE_BITS          (PINUSE_BIT|CINUSE_BIT)
-
-/* Head value for fenceposts */
-#define FENCEPOST_HEAD      (INUSE_BITS|SIZE_T_SIZE)
-
-/* extraction of fields from head words */
-#define cinuse(p)           ((p)->head & CINUSE_BIT)
-#define pinuse(p)           ((p)->head & PINUSE_BIT)
-#define chunksize(p)        ((p)->head & ~(INUSE_BITS))
-
-#define clear_pinuse(p)     ((p)->head &= ~PINUSE_BIT)
-#define clear_cinuse(p)     ((p)->head &= ~CINUSE_BIT)
-
-/* Treat space at ptr +/- offset as a chunk */
-#define chunk_plus_offset(p, s)  ((mchunkptr)(((char*)(p)) + (s)))
-#define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s)))
-
-/* Ptr to next or previous physical malloc_chunk. */
-#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS)))
-#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) ))
-
-/* extract next chunk's pinuse bit */
-#define next_pinuse(p)  ((next_chunk(p)->head) & PINUSE_BIT)
-
-/* Get/set size at footer */
-#define get_foot(p, s)  (((mchunkptr)((char*)(p) + (s)))->prev_foot)
-#define set_foot(p, s)  (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s))
-
-/* Set size, pinuse bit, and foot */
-#define set_size_and_pinuse_of_free_chunk(p, s)\
-  ((p)->head = (s|PINUSE_BIT), set_foot(p, s))
-
-/* Set size, pinuse bit, foot, and clear next pinuse */
-#define set_free_with_pinuse(p, s, n)\
-  (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s))
-
-#define is_mmapped(p)\
-  (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT))
-
-/* Get the internal overhead associated with chunk p */
-#define overhead_for(p)\
- (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD)
-
-/* Return true if malloced space is not necessarily cleared */
-#if MMAP_CLEARS
-#define calloc_must_clear(p) (!is_mmapped(p))
-#else /* MMAP_CLEARS */
-#define calloc_must_clear(p) (1)
-#endif /* MMAP_CLEARS */
-
-/* ---------------------- Overlaid data structures ----------------------- */
-
-/*
-  When chunks are not in use, they are treated as nodes of either
-  lists or trees.
-
-  "Small"  chunks are stored in circular doubly-linked lists, and look
-  like this:
-
-    chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Size of previous chunk                            |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-    `head:' |             Size of chunk, in bytes                         |P|
-      mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Forward pointer to next chunk in list             |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Back pointer to previous chunk in list            |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Unused space (may be 0 bytes long)                .
-            .                                                               .
-            .                                                               |
-nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-    `foot:' |             Size of chunk, in bytes                           |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-  Larger chunks are kept in a form of bitwise digital trees (aka
-  tries) keyed on chunksizes.  Because malloc_tree_chunks are only for
-  free chunks greater than 256 bytes, their size doesn't impose any
-  constraints on user chunk sizes.  Each node looks like:
-
-    chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Size of previous chunk                            |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-    `head:' |             Size of chunk, in bytes                         |P|
-      mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Forward pointer to next chunk of same size        |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Back pointer to previous chunk of same size       |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Pointer to left child (child[0])                  |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Pointer to right child (child[1])                 |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Pointer to parent                                 |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             bin index of this chunk                           |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-            |             Unused space                                      .
-            .                                                               |
-nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-    `foot:' |             Size of chunk, in bytes                           |
-            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-  Each tree holding treenodes is a tree of unique chunk sizes.  Chunks
-  of the same size are arranged in a circularly-linked list, with only
-  the oldest chunk (the next to be used, in our FIFO ordering)
-  actually in the tree.  (Tree members are distinguished by a non-null
-  parent pointer.)  If a chunk with the same size an an existing node
-  is inserted, it is linked off the existing node using pointers that
-  work in the same way as fd/bk pointers of small chunks.
-
-  Each tree contains a power of 2 sized range of chunk sizes (the
-  smallest is 0x100 <= x < 0x180), which is is divided in half at each
-  tree level, with the chunks in the smaller half of the range (0x100
-  <= x < 0x140 for the top nose) in the left subtree and the larger
-  half (0x140 <= x < 0x180) in the right subtree.  This is, of course,
-  done by inspecting individual bits.
-
-  Using these rules, each node's left subtree contains all smaller
-  sizes than its right subtree.  However, the node at the root of each
-  subtree has no particular ordering relationship to either.  (The
-  dividing line between the subtree sizes is based on trie relation.)
-  If we remove the last chunk of a given size from the interior of the
-  tree, we need to replace it with a leaf node.  The tree ordering
-  rules permit a node to be replaced by any leaf below it.
-
-  The smallest chunk in a tree (a common operation in a best-fit
-  allocator) can be found by walking a path to the leftmost leaf in
-  the tree.  Unlike a usual binary tree, where we follow left child
-  pointers until we reach a null, here we follow the right child
-  pointer any time the left one is null, until we reach a leaf with
-  both child pointers null. The smallest chunk in the tree will be
-  somewhere along that path.
-
-  The worst case number of steps to add, find, or remove a node is
-  bounded by the number of bits differentiating chunks within
-  bins. Under current bin calculations, this ranges from 6 up to 21
-  (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case
-  is of course much better.
-*/
-
-struct malloc_tree_chunk
-{
-    /* The first four fields must be compatible with malloc_chunk */
-    size_t prev_foot;
-    size_t head;
-    struct malloc_tree_chunk *fd;
-    struct malloc_tree_chunk *bk;
-
-    struct malloc_tree_chunk *child[2];
-    struct malloc_tree_chunk *parent;
-    bindex_t index;
-};
-
-typedef struct malloc_tree_chunk tchunk;
-typedef struct malloc_tree_chunk *tchunkptr;
-typedef struct malloc_tree_chunk *tbinptr;      /* The type of bins of trees */
-
-/* A little helper macro for trees */
-#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1])
-
-/* ----------------------------- Segments -------------------------------- */
-
-/*
-  Each malloc space may include non-contiguous segments, held in a
-  list headed by an embedded malloc_segment record representing the
-  top-most space. Segments also include flags holding properties of
-  the space. Large chunks that are directly allocated by mmap are not
-  included in this list. They are instead independently created and
-  destroyed without otherwise keeping track of them.
-
-  Segment management mainly comes into play for spaces allocated by
-  MMAP.  Any call to MMAP might or might not return memory that is
-  adjacent to an existing segment.  MORECORE normally contiguously
-  extends the current space, so this space is almost always adjacent,
-  which is simpler and faster to deal with. (This is why MORECORE is
-  used preferentially to MMAP when both are available -- see
-  sys_alloc.)  When allocating using MMAP, we don't use any of the
-  hinting mechanisms (inconsistently) supported in various
-  implementations of unix mmap, or distinguish reserving from
-  committing memory. Instead, we just ask for space, and exploit
-  contiguity when we get it.  It is probably possible to do
-  better than this on some systems, but no general scheme seems
-  to be significantly better.
-
-  Management entails a simpler variant of the consolidation scheme
-  used for chunks to reduce fragmentation -- new adjacent memory is
-  normally prepended or appended to an existing segment. However,
-  there are limitations compared to chunk consolidation that mostly
-  reflect the fact that segment processing is relatively infrequent
-  (occurring only when getting memory from system) and that we
-  don't expect to have huge numbers of segments:
-
-  * Segments are not indexed, so traversal requires linear scans.  (It
-    would be possible to index these, but is not worth the extra
-    overhead and complexity for most programs on most platforms.)
-  * New segments are only appended to old ones when holding top-most
-    memory; if they cannot be prepended to others, they are held in
-    different segments.
-
-  Except for the top-most segment of an mstate, each segment record
-  is kept at the tail of its segment. Segments are added by pushing
-  segment records onto the list headed by &mstate.seg for the
-  containing mstate.
-
-  Segment flags control allocation/merge/deallocation policies:
-  * If EXTERN_BIT set, then we did not allocate this segment,
-    and so should not try to deallocate or merge with others.
-    (This currently holds only for the initial segment passed
-    into create_mspace_with_base.)
-  * If IS_MMAPPED_BIT set, the segment may be merged with
-    other surrounding mmapped segments and trimmed/de-allocated
-    using munmap.
-  * If neither bit is set, then the segment was obtained using
-    MORECORE so can be merged with surrounding MORECORE'd segments
-    and deallocated/trimmed using MORECORE with negative arguments.
-*/
-
-struct malloc_segment
-{
-    char *base;                 /* base address */
-    size_t size;                /* allocated size */
-    struct malloc_segment *next;        /* ptr to next segment */
-    flag_t sflags;              /* mmap and extern flag */
-};
-
-#define is_mmapped_segment(S)  ((S)->sflags & IS_MMAPPED_BIT)
-#define is_extern_segment(S)   ((S)->sflags & EXTERN_BIT)
-
-typedef struct malloc_segment msegment;
-typedef struct malloc_segment *msegmentptr;
-
-/* ---------------------------- malloc_state ----------------------------- */
-
-/*
-   A malloc_state holds all of the bookkeeping for a space.
-   The main fields are:
-
-  Top
-    The topmost chunk of the currently active segment. Its size is
-    cached in topsize.  The actual size of topmost space is
-    topsize+TOP_FOOT_SIZE, which includes space reserved for adding
-    fenceposts and segment records if necessary when getting more
-    space from the system.  The size at which to autotrim top is
-    cached from mparams in trim_check, except that it is disabled if
-    an autotrim fails.
-
-  Designated victim (dv)
-    This is the preferred chunk for servicing small requests that
-    don't have exact fits.  It is normally the chunk split off most
-    recently to service another small request.  Its size is cached in
-    dvsize. The link fields of this chunk are not maintained since it
-    is not kept in a bin.
-
-  SmallBins
-    An array of bin headers for free chunks.  These bins hold chunks
-    with sizes less than MIN_LARGE_SIZE bytes. Each bin contains
-    chunks of all the same size, spaced 8 bytes apart.  To simplify
-    use in double-linked lists, each bin header acts as a malloc_chunk
-    pointing to the real first node, if it exists (else pointing to
-    itself).  This avoids special-casing for headers.  But to avoid
-    waste, we allocate only the fd/bk pointers of bins, and then use
-    repositioning tricks to treat these as the fields of a chunk.
-
-  TreeBins
-    Treebins are pointers to the roots of trees holding a range of
-    sizes. There are 2 equally spaced treebins for each power of two
-    from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything
-    larger.
-
-  Bin maps
-    There is one bit map for small bins ("smallmap") and one for
-    treebins ("treemap).  Each bin sets its bit when non-empty, and
-    clears the bit when empty.  Bit operations are then used to avoid
-    bin-by-bin searching -- nearly all "search" is done without ever
-    looking at bins that won't be selected.  The bit maps
-    conservatively use 32 bits per map word, even if on 64bit system.
-    For a good description of some of the bit-based techniques used
-    here, see Henry S. Warren Jr's book "Hacker's Delight" (and
-    supplement at http://hackersdelight.org/). Many of these are
-    intended to reduce the branchiness of paths through malloc etc, as
-    well as to reduce the number of memory locations read or written.
-
-  Segments
-    A list of segments headed by an embedded malloc_segment record
-    representing the initial space.
-
-  Address check support
-    The least_addr field is the least address ever obtained from
-    MORECORE or MMAP. Attempted frees and reallocs of any address less
-    than this are trapped (unless INSECURE is defined).
-
-  Magic tag
-    A cross-check field that should always hold same value as mparams.magic.
-
-  Flags
-    Bits recording whether to use MMAP, locks, or contiguous MORECORE
-
-  Statistics
-    Each space keeps track of current and maximum system memory
-    obtained via MORECORE or MMAP.
-
-  Locking
-    If USE_LOCKS is defined, the "mutex" lock is acquired and released
-    around every public call using this mspace.
-*/
-
-/* Bin types, widths and sizes */
-#define NSMALLBINS        (32U)
-#define NTREEBINS         (32U)
-#define SMALLBIN_SHIFT    (3U)
-#define SMALLBIN_WIDTH    (SIZE_T_ONE << SMALLBIN_SHIFT)
-#define TREEBIN_SHIFT     (8U)
-#define MIN_LARGE_SIZE    (SIZE_T_ONE << TREEBIN_SHIFT)
-#define MAX_SMALL_SIZE    (MIN_LARGE_SIZE - SIZE_T_ONE)
-#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)
-
-struct malloc_state
-{
-    binmap_t smallmap;
-    binmap_t treemap;
-    size_t dvsize;
-    size_t topsize;
-    char *least_addr;
-    mchunkptr dv;
-    mchunkptr top;
-    size_t trim_check;
-    size_t magic;
-    mchunkptr smallbins[(NSMALLBINS + 1) * 2];
-    tbinptr treebins[NTREEBINS];
-    size_t footprint;
-    size_t max_footprint;
-    flag_t mflags;
-#if USE_LOCKS
-    MLOCK_T mutex;              /* locate lock among fields that rarely change */
-#endif                          /* USE_LOCKS */
-    msegment seg;
-};
-
-typedef struct malloc_state *mstate;
-
-/* ------------- Global malloc_state and malloc_params ------------------- */
-
-/*
-  malloc_params holds global properties, including those that can be
-  dynamically set using mallopt. There is a single instance, mparams,
-  initialized in init_mparams.
-*/
-
-struct malloc_params
-{
-    size_t magic;
-    size_t page_size;
-    size_t granularity;
-    size_t mmap_threshold;
-    size_t trim_threshold;
-    flag_t default_mflags;
-};
-
-static struct malloc_params mparams;
-
-/* The global malloc_state used for all non-"mspace" calls */
-static struct malloc_state _gm_;
-#define gm                 (&_gm_)
-#define is_global(M)       ((M) == &_gm_)
-#define is_initialized(M)  ((M)->top != 0)
-
-/* -------------------------- system alloc setup ------------------------- */
-
-/* Operations on mflags */
-
-#define use_lock(M)           ((M)->mflags &   USE_LOCK_BIT)
-#define enable_lock(M)        ((M)->mflags |=  USE_LOCK_BIT)
-#define disable_lock(M)       ((M)->mflags &= ~USE_LOCK_BIT)
-
-#define use_mmap(M)           ((M)->mflags &   USE_MMAP_BIT)
-#define enable_mmap(M)        ((M)->mflags |=  USE_MMAP_BIT)
-#define disable_mmap(M)       ((M)->mflags &= ~USE_MMAP_BIT)
-
-#define use_noncontiguous(M)  ((M)->mflags &   USE_NONCONTIGUOUS_BIT)
-#define disable_contiguous(M) ((M)->mflags |=  USE_NONCONTIGUOUS_BIT)
-
-#define set_lock(M,L)\
- ((M)->mflags = (L)?\
-  ((M)->mflags | USE_LOCK_BIT) :\
-  ((M)->mflags & ~USE_LOCK_BIT))
-
-/* page-align a size */
-#define page_align(S)\
- (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE))
-
-/* granularity-align a size */
-#define granularity_align(S)\
-  (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE))
-
-#define is_page_aligned(S)\
-   (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0)
-#define is_granularity_aligned(S)\
-   (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0)
-
-/*  True if segment S holds address A */
-#define segment_holds(S, A)\
-  ((char*)(A) >= S->base && (char*)(A) < S->base + S->size)
-
-/* Return segment holding given address */
-static msegmentptr
-segment_holding(mstate m, char *addr)
-{
-    msegmentptr sp = &m->seg;
-    for (;;) {
-        if (addr >= sp->base && addr < sp->base + sp->size)
-            return sp;
-        if ((sp = sp->next) == 0)
-            return 0;
-    }
-}
-
-/* Return true if segment contains a segment link */
-static int
-has_segment_link(mstate m, msegmentptr ss)
-{
-    msegmentptr sp = &m->seg;
-    for (;;) {
-        if ((char *) sp >= ss->base && (char *) sp < ss->base + ss->size)
-            return 1;
-        if ((sp = sp->next) == 0)
-            return 0;
-    }
-}
-
-#ifndef MORECORE_CANNOT_TRIM
-#define should_trim(M,s)  ((s) > (M)->trim_check)
-#else /* MORECORE_CANNOT_TRIM */
-#define should_trim(M,s)  (0)
-#endif /* MORECORE_CANNOT_TRIM */
-
-/*
-  TOP_FOOT_SIZE is padding at the end of a segment, including space
-  that may be needed to place segment records and fenceposts when new
-  noncontiguous segments are added.
-*/
-#define TOP_FOOT_SIZE\
-  (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)
-
-
-/* -------------------------------  Hooks -------------------------------- */
-
-/*
-  PREACTION should be defined to return 0 on success, and nonzero on
-  failure. If you are not using locking, you can redefine these to do
-  anything you like.
-*/
-
-#if USE_LOCKS
-
-/* Ensure locks are initialized */
-#define GLOBALLY_INITIALIZE() (mparams.page_size == 0 && init_mparams())
-
-#define PREACTION(M)  ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0)
-#define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); }
-#else /* USE_LOCKS */
-
-#ifndef PREACTION
-#define PREACTION(M) (0)
-#endif /* PREACTION */
-
-#ifndef POSTACTION
-#define POSTACTION(M)
-#endif /* POSTACTION */
-
-#endif /* USE_LOCKS */
-
-/*
-  CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses.
-  USAGE_ERROR_ACTION is triggered on detected bad frees and
-  reallocs. The argument p is an address that might have triggered the
-  fault. It is ignored by the two predefined actions, but might be
-  useful in custom actions that try to help diagnose errors.
-*/
-
-#if PROCEED_ON_ERROR
-
-/* A count of the number of corruption errors causing resets */
-int malloc_corruption_error_count;
-
-/* default corruption action */
-static void reset_on_error(mstate m);
-
-#define CORRUPTION_ERROR_ACTION(m)  reset_on_error(m)
-#define USAGE_ERROR_ACTION(m, p)
-
-#else /* PROCEED_ON_ERROR */
-
-#ifndef CORRUPTION_ERROR_ACTION
-#define CORRUPTION_ERROR_ACTION(m) ABORT
-#endif /* CORRUPTION_ERROR_ACTION */
-
-#ifndef USAGE_ERROR_ACTION
-#define USAGE_ERROR_ACTION(m,p) ABORT
-#endif /* USAGE_ERROR_ACTION */
-
-#endif /* PROCEED_ON_ERROR */
-
-/* -------------------------- Debugging setup ---------------------------- */
-
-#if ! DEBUG
-
-#define check_free_chunk(M,P)
-#define check_inuse_chunk(M,P)
-#define check_malloced_chunk(M,P,N)
-#define check_mmapped_chunk(M,P)
-#define check_malloc_state(M)
-#define check_top_chunk(M,P)
-
-#else /* DEBUG */
-#define check_free_chunk(M,P)       do_check_free_chunk(M,P)
-#define check_inuse_chunk(M,P)      do_check_inuse_chunk(M,P)
-#define check_top_chunk(M,P)        do_check_top_chunk(M,P)
-#define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N)
-#define check_mmapped_chunk(M,P)    do_check_mmapped_chunk(M,P)
-#define check_malloc_state(M)       do_check_malloc_state(M)
-
-static void do_check_any_chunk(mstate m, mchunkptr p);
-static void do_check_top_chunk(mstate m, mchunkptr p);
-static void do_check_mmapped_chunk(mstate m, mchunkptr p);
-static void do_check_inuse_chunk(mstate m, mchunkptr p);
-static void do_check_free_chunk(mstate m, mchunkptr p);
-static void do_check_malloced_chunk(mstate m, void *mem, size_t s);
-static void do_check_tree(mstate m, tchunkptr t);
-static void do_check_treebin(mstate m, bindex_t i);
-static void do_check_smallbin(mstate m, bindex_t i);
-static void do_check_malloc_state(mstate m);
-static int bin_find(mstate m, mchunkptr x);
-static size_t traverse_and_check(mstate m);
-#endif /* DEBUG */
-
-/* ---------------------------- Indexing Bins ---------------------------- */
-
-#define is_small(s)         (((s) >> SMALLBIN_SHIFT) < NSMALLBINS)
-#define small_index(s)      ((s)  >> SMALLBIN_SHIFT)
-#define small_index2size(i) ((i)  << SMALLBIN_SHIFT)
-#define MIN_SMALL_INDEX     (small_index(MIN_CHUNK_SIZE))
-
-/* addressing by index. See above about smallbin repositioning */
-#define smallbin_at(M, i)   ((sbinptr)((char*)&((M)->smallbins[(i)<<1])))
-#define treebin_at(M,i)     (&((M)->treebins[i]))
-
-/* assign tree index for size S to variable I */
-#if defined(__GNUC__) && defined(i386)
-#define compute_tree_index(S, I)\
-{\
-  size_t X = S >> TREEBIN_SHIFT;\
-  if (X == 0)\
-    I = 0;\
-  else if (X > 0xFFFF)\
-    I = NTREEBINS-1;\
-  else {\
-    unsigned int K;\
-    __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm"  (X));\
-    I =  (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\
-  }\
-}
-#else /* GNUC */
-#define compute_tree_index(S, I)\
-{\
-  size_t X = S >> TREEBIN_SHIFT;\
-  if (X == 0)\
-    I = 0;\
-  else if (X > 0xFFFF)\
-    I = NTREEBINS-1;\
-  else {\
-    unsigned int Y = (unsigned int)X;\
-    unsigned int N = ((Y - 0x100) >> 16) & 8;\
-    unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\
-    N += K;\
-    N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\
-    K = 14 - N + ((Y <<= K) >> 15);\
-    I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\
-  }\
-}
-#endif /* GNUC */
-
-/* Bit representing maximum resolved size in a treebin at i */
-#define bit_for_tree_index(i) \
-   (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2)
-
-/* Shift placing maximum resolved bit in a treebin at i as sign bit */
-#define leftshift_for_tree_index(i) \
-   ((i == NTREEBINS-1)? 0 : \
-    ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))
-
-/* The size of the smallest chunk held in bin with index i */
-#define minsize_for_tree_index(i) \
-   ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) |  \
-   (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1)))
-
-
-/* ------------------------ Operations on bin maps ----------------------- */
-
-/* bit corresponding to given index */
-#define idx2bit(i)              ((binmap_t)(1) << (i))
-
-/* Mark/Clear bits with given index */
-#define mark_smallmap(M,i)      ((M)->smallmap |=  idx2bit(i))
-#define clear_smallmap(M,i)     ((M)->smallmap &= ~idx2bit(i))
-#define smallmap_is_marked(M,i) ((M)->smallmap &   idx2bit(i))
-
-#define mark_treemap(M,i)       ((M)->treemap  |=  idx2bit(i))
-#define clear_treemap(M,i)      ((M)->treemap  &= ~idx2bit(i))
-#define treemap_is_marked(M,i)  ((M)->treemap  &   idx2bit(i))
-
-/* index corresponding to given bit */
-
-#if defined(__GNUC__) && defined(i386)
-#define compute_bit2idx(X, I)\
-{\
-  unsigned int J;\
-  __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\
-  I = (bindex_t)J;\
-}
-
-#else /* GNUC */
-#if  USE_BUILTIN_FFS
-#define compute_bit2idx(X, I) I = ffs(X)-1
-
-#else /* USE_BUILTIN_FFS */
-#define compute_bit2idx(X, I)\
-{\
-  unsigned int Y = X - 1;\
-  unsigned int K = Y >> (16-4) & 16;\
-  unsigned int N = K;        Y >>= K;\
-  N += K = Y >> (8-3) &  8;  Y >>= K;\
-  N += K = Y >> (4-2) &  4;  Y >>= K;\
-  N += K = Y >> (2-1) &  2;  Y >>= K;\
-  N += K = Y >> (1-0) &  1;  Y >>= K;\
-  I = (bindex_t)(N + Y);\
-}
-#endif /* USE_BUILTIN_FFS */
-#endif /* GNUC */
-
-/* isolate the least set bit of a bitmap */
-#define least_bit(x)         ((x) & -(x))
-
-/* mask with all bits to left of least bit of x on */
-#define left_bits(x)         ((x<<1) | -(x<<1))
-
-/* mask with all bits to left of or equal to least bit of x on */
-#define same_or_left_bits(x) ((x) | -(x))
-
-
-/* ----------------------- Runtime Check Support ------------------------- */
-
-/*
-  For security, the main invariant is that malloc/free/etc never
-  writes to a static address other than malloc_state, unless static
-  malloc_state itself has been corrupted, which cannot occur via
-  malloc (because of these checks). In essence this means that we
-  believe all pointers, sizes, maps etc held in malloc_state, but
-  check all of those linked or offsetted from other embedded data
-  structures.  These checks are interspersed with main code in a way
-  that tends to minimize their run-time cost.
-
-  When FOOTERS is defined, in addition to range checking, we also
-  verify footer fields of inuse chunks, which can be used guarantee
-  that the mstate controlling malloc/free is intact.  This is a
-  streamlined version of the approach described by William Robertson
-  et al in "Run-time Detection of Heap-based Overflows" LISA'03
-  http://www.usenix.org/events/lisa03/tech/robertson.html The footer
-  of an inuse chunk holds the xor of its mstate and a random seed,
-  that is checked upon calls to free() and realloc().  This is
-  (probablistically) unguessable from outside the program, but can be
-  computed by any code successfully malloc'ing any chunk, so does not
-  itself provide protection against code that has already broken
-  security through some other means.  Unlike Robertson et al, we
-  always dynamically check addresses of all offset chunks (previous,
-  next, etc). This turns out to be cheaper than relying on hashes.
-*/
-
-#if !INSECURE
-/* Check if address a is at least as high as any from MORECORE or MMAP */
-#define ok_address(M, a) ((char*)(a) >= (M)->least_addr)
-/* Check if address of next chunk n is higher than base chunk p */
-#define ok_next(p, n)    ((char*)(p) < (char*)(n))
-/* Check if p has its cinuse bit on */
-#define ok_cinuse(p)     cinuse(p)
-/* Check if p has its pinuse bit on */
-#define ok_pinuse(p)     pinuse(p)
-
-#else /* !INSECURE */
-#define ok_address(M, a) (1)
-#define ok_next(b, n)    (1)
-#define ok_cinuse(p)     (1)
-#define ok_pinuse(p)     (1)
-#endif /* !INSECURE */
-
-#if (FOOTERS && !INSECURE)
-/* Check if (alleged) mstate m has expected magic field */
-#define ok_magic(M)      ((M)->magic == mparams.magic)
-#else /* (FOOTERS && !INSECURE) */
-#define ok_magic(M)      (1)
-#endif /* (FOOTERS && !INSECURE) */
-
-
-/* In gcc, use __builtin_expect to minimize impact of checks */
-#if !INSECURE
-#if defined(__GNUC__) && __GNUC__ >= 3
-#define RTCHECK(e)  __builtin_expect(e, 1)
-#else /* GNUC */
-#define RTCHECK(e)  (e)
-#endif /* GNUC */
-#else /* !INSECURE */
-#define RTCHECK(e)  (1)
-#endif /* !INSECURE */
-
-/* macros to set up inuse chunks with or without footers */
-
-#if !FOOTERS
-
-#define mark_inuse_foot(M,p,s)
-
-/* Set cinuse bit and pinuse bit of next chunk */
-#define set_inuse(M,p,s)\
-  ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
-  ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
-
-/* Set cinuse and pinuse of this chunk and pinuse of next chunk */
-#define set_inuse_and_pinuse(M,p,s)\
-  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
-  ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
-
-/* Set size, cinuse and pinuse bit of this chunk */
-#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
-  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT))
-
-#else /* FOOTERS */
-
-/* Set foot of inuse chunk to be xor of mstate and seed */
-#define mark_inuse_foot(M,p,s)\
-  (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic))
-
-#define get_mstate_for(p)\
-  ((mstate)(((mchunkptr)((char*)(p) +\
-    (chunksize(p))))->prev_foot ^ mparams.magic))
-
-#define set_inuse(M,p,s)\
-  ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
-  (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \
-  mark_inuse_foot(M,p,s))
-
-#define set_inuse_and_pinuse(M,p,s)\
-  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
-  (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\
- mark_inuse_foot(M,p,s))
-
-#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
-  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
-  mark_inuse_foot(M, p, s))
-
-#endif /* !FOOTERS */
-
-/* ---------------------------- setting mparams -------------------------- */
-
-/* Initialize mparams */
-static int
-init_mparams(void)
-{
-    if (mparams.page_size == 0) {
-        size_t s;
-
-        mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD;
-        mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD;
-#if MORECORE_CONTIGUOUS
-        mparams.default_mflags = USE_LOCK_BIT | USE_MMAP_BIT;
-#else /* MORECORE_CONTIGUOUS */
-        mparams.default_mflags =
-            USE_LOCK_BIT | USE_MMAP_BIT | USE_NONCONTIGUOUS_BIT;
-#endif /* MORECORE_CONTIGUOUS */
-
-#if (FOOTERS && !INSECURE)
-        {
-#if USE_DEV_RANDOM
-            int fd;
-            unsigned char buf[sizeof(size_t)];
-            /* Try to use /dev/urandom, else fall back on using time */
-            if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 &&
-                read(fd, buf, sizeof(buf)) == sizeof(buf)) {
-                s = *((size_t *) buf);
-                close(fd);
-            } else
-#endif /* USE_DEV_RANDOM */
-                s = (size_t) (time(0) ^ (size_t) 0x55555555U);
-
-            s |= (size_t) 8U;   /* ensure nonzero */
-            s &= ~(size_t) 7U;  /* improve chances of fault for bad values */
-
-        }
-#else /* (FOOTERS && !INSECURE) */
-        s = (size_t) 0x58585858U;
-#endif /* (FOOTERS && !INSECURE) */
-        ACQUIRE_MAGIC_INIT_LOCK();
-        if (mparams.magic == 0) {
-            mparams.magic = s;
-            /* Set up lock for main malloc area */
-            INITIAL_LOCK(&gm->mutex);
-            gm->mflags = mparams.default_mflags;
-        }
-        RELEASE_MAGIC_INIT_LOCK();
-
-#ifndef WIN32
-        mparams.page_size = malloc_getpagesize;
-        mparams.granularity = ((DEFAULT_GRANULARITY != 0) ?
-                               DEFAULT_GRANULARITY : mparams.page_size);
-#else /* WIN32 */
-        {
-            SYSTEM_INFO system_info;
-            GetSystemInfo(&system_info);
-            mparams.page_size = system_info.dwPageSize;
-            mparams.granularity = system_info.dwAllocationGranularity;
-        }
-#endif /* WIN32 */
-
-        /* Sanity-check configuration:
-           size_t must be unsigned and as wide as pointer type.
-           ints must be at least 4 bytes.
-           alignment must be at least 8.
-           Alignment, min chunk size, and page size must all be powers of 2.
-         */
-        if ((sizeof(size_t) != sizeof(char *)) ||
-            (MAX_SIZE_T < MIN_CHUNK_SIZE) ||
-            (sizeof(int) < 4) ||
-            (MALLOC_ALIGNMENT < (size_t) 8U) ||
-            ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT - SIZE_T_ONE)) != 0) ||
-            ((MCHUNK_SIZE & (MCHUNK_SIZE - SIZE_T_ONE)) != 0) ||
-            ((mparams.granularity & (mparams.granularity - SIZE_T_ONE)) != 0)
-            || ((mparams.page_size & (mparams.page_size - SIZE_T_ONE)) != 0))
-            ABORT;
-    }
-    return 0;
-}
-
-/* support for mallopt */
-static int
-change_mparam(int param_number, int value)
-{
-    size_t val = (size_t) value;
-    init_mparams();
-    switch (param_number) {
-    case M_TRIM_THRESHOLD:
-        mparams.trim_threshold = val;
-        return 1;
-    case M_GRANULARITY:
-        if (val >= mparams.page_size && ((val & (val - 1)) == 0)) {
-            mparams.granularity = val;
-            return 1;
-        } else
-            return 0;
-    case M_MMAP_THRESHOLD:
-        mparams.mmap_threshold = val;
-        return 1;
-    default:
-        return 0;
-    }
-}
-
-#if DEBUG
-/* ------------------------- Debugging Support --------------------------- */
-
-/* Check properties of any chunk, whether free, inuse, mmapped etc  */
-static void
-do_check_any_chunk(mstate m, mchunkptr p)
-{
-    assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
-    assert(ok_address(m, p));
-}
-
-/* Check properties of top chunk */
-static void
-do_check_top_chunk(mstate m, mchunkptr p)
-{
-    msegmentptr sp = segment_holding(m, (char *) p);
-    size_t sz = chunksize(p);
-    assert(sp != 0);
-    assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
-    assert(ok_address(m, p));
-    assert(sz == m->topsize);
-    assert(sz > 0);
-    assert(sz == ((sp->base + sp->size) - (char *) p) - TOP_FOOT_SIZE);
-    assert(pinuse(p));
-    assert(!next_pinuse(p));
-}
-
-/* Check properties of (inuse) mmapped chunks */
-static void
-do_check_mmapped_chunk(mstate m, mchunkptr p)
-{
-    size_t sz = chunksize(p);
-    size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD);
-    assert(is_mmapped(p));
-    assert(use_mmap(m));
-    assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
-    assert(ok_address(m, p));
-    assert(!is_small(sz));
-    assert((len & (mparams.page_size - SIZE_T_ONE)) == 0);
-    assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD);
-    assert(chunk_plus_offset(p, sz + SIZE_T_SIZE)->head == 0);
-}
-
-/* Check properties of inuse chunks */
-static void
-do_check_inuse_chunk(mstate m, mchunkptr p)
-{
-    do_check_any_chunk(m, p);
-    assert(cinuse(p));
-    assert(next_pinuse(p));
-    /* If not pinuse and not mmapped, previous chunk has OK offset */
-    assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p);
-    if (is_mmapped(p))
-        do_check_mmapped_chunk(m, p);
-}
-
-/* Check properties of free chunks */
-static void
-do_check_free_chunk(mstate m, mchunkptr p)
-{
-    size_t sz = p->head & ~(PINUSE_BIT | CINUSE_BIT);
-    mchunkptr next = chunk_plus_offset(p, sz);
-    do_check_any_chunk(m, p);
-    assert(!cinuse(p));
-    assert(!next_pinuse(p));
-    assert(!is_mmapped(p));
-    if (p != m->dv && p != m->top) {
-        if (sz >= MIN_CHUNK_SIZE) {
-            assert((sz & CHUNK_ALIGN_MASK) == 0);
-            assert(is_aligned(chunk2mem(p)));
-            assert(next->prev_foot == sz);
-            assert(pinuse(p));
-            assert(next == m->top || cinuse(next));
-            assert(p->fd->bk == p);
-            assert(p->bk->fd == p);
-        } else                  /* markers are always of size SIZE_T_SIZE */
-            assert(sz == SIZE_T_SIZE);
-    }
-}
-
-/* Check properties of malloced chunks at the point they are malloced */
-static void
-do_check_malloced_chunk(mstate m, void *mem, size_t s)
-{
-    if (mem != 0) {
-        mchunkptr p = mem2chunk(mem);
-        size_t sz = p->head & ~(PINUSE_BIT | CINUSE_BIT);
-        do_check_inuse_chunk(m, p);
-        assert((sz & CHUNK_ALIGN_MASK) == 0);
-        assert(sz >= MIN_CHUNK_SIZE);
-        assert(sz >= s);
-        /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */
-        assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE));
-    }
-}
-
-/* Check a tree and its subtrees.  */
-static void
-do_check_tree(mstate m, tchunkptr t)
-{
-    tchunkptr head = 0;
-    tchunkptr u = t;
-    bindex_t tindex = t->index;
-    size_t tsize = chunksize(t);
-    bindex_t idx;
-    compute_tree_index(tsize, idx);
-    assert(tindex == idx);
-    assert(tsize >= MIN_LARGE_SIZE);
-    assert(tsize >= minsize_for_tree_index(idx));
-    assert((idx == NTREEBINS - 1)
-           || (tsize < minsize_for_tree_index((idx + 1))));
-
-    do {                        /* traverse through chain of same-sized nodes */
-        do_check_any_chunk(m, ((mchunkptr) u));
-        assert(u->index == tindex);
-        assert(chunksize(u) == tsize);
-        assert(!cinuse(u));
-        assert(!next_pinuse(u));
-        assert(u->fd->bk == u);
-        assert(u->bk->fd == u);
-        if (u->parent == 0) {
-            assert(u->child[0] == 0);
-            assert(u->child[1] == 0);
-        } else {
-            assert(head == 0);  /* only one node on chain has parent */
-            head = u;
-            assert(u->parent != u);
-            assert(u->parent->child[0] == u ||
-                   u->parent->child[1] == u ||
-                   *((tbinptr *) (u->parent)) == u);
-            if (u->child[0] != 0) {
-                assert(u->child[0]->parent == u);
-                assert(u->child[0] != u);
-                do_check_tree(m, u->child[0]);
-            }
-            if (u->child[1] != 0) {
-                assert(u->child[1]->parent == u);
-                assert(u->child[1] != u);
-                do_check_tree(m, u->child[1]);
-            }
-            if (u->child[0] != 0 && u->child[1] != 0) {
-                assert(chunksize(u->child[0]) < chunksize(u->child[1]));
-            }
-        }
-        u = u->fd;
-    } while (u != t);
-    assert(head != 0);
-}
-
-/*  Check all the chunks in a treebin.  */
-static void
-do_check_treebin(mstate m, bindex_t i)
-{
-    tbinptr *tb = treebin_at(m, i);
-    tchunkptr t = *tb;
-    int empty = (m->treemap & (1U << i)) == 0;
-    if (t == 0)
-        assert(empty);
-    if (!empty)
-        do_check_tree(m, t);
-}
-
-/*  Check all the chunks in a smallbin.  */
-static void
-do_check_smallbin(mstate m, bindex_t i)
-{
-    sbinptr b = smallbin_at(m, i);
-    mchunkptr p = b->bk;
-    unsigned int empty = (m->smallmap & (1U << i)) == 0;
-    if (p == b)
-        assert(empty);
-    if (!empty) {
-        for (; p != b; p = p->bk) {
-            size_t size = chunksize(p);
-            mchunkptr q;
-            /* each chunk claims to be free */
-            do_check_free_chunk(m, p);
-            /* chunk belongs in bin */
-            assert(small_index(size) == i);
-            assert(p->bk == b || chunksize(p->bk) == chunksize(p));
-            /* chunk is followed by an inuse chunk */
-            q = next_chunk(p);
-            if (q->head != FENCEPOST_HEAD)
-                do_check_inuse_chunk(m, q);
-        }
-    }
-}
-
-/* Find x in a bin. Used in other check functions. */
-static int
-bin_find(mstate m, mchunkptr x)
-{
-    size_t size = chunksize(x);
-    if (is_small(size)) {
-        bindex_t sidx = small_index(size);
-        sbinptr b = smallbin_at(m, sidx);
-        if (smallmap_is_marked(m, sidx)) {
-            mchunkptr p = b;
-            do {
-                if (p == x)
-                    return 1;
-            } while ((p = p->fd) != b);
-        }
-    } else {
-        bindex_t tidx;
-        compute_tree_index(size, tidx);
-        if (treemap_is_marked(m, tidx)) {
-            tchunkptr t = *treebin_at(m, tidx);
-            size_t sizebits = size << leftshift_for_tree_index(tidx);
-            while (t != 0 && chunksize(t) != size) {
-                t = t->child[(sizebits >> (SIZE_T_BITSIZE - SIZE_T_ONE)) & 1];
-                sizebits <<= 1;
-            }
-            if (t != 0) {
-                tchunkptr u = t;
-                do {
-                    if (u == (tchunkptr) x)
-                        return 1;
-                } while ((u = u->fd) != t);
-            }
-        }
-    }
-    return 0;
-}
-
-/* Traverse each chunk and check it; return total */
-static size_t
-traverse_and_check(mstate m)
-{
-    size_t sum = 0;
-    if (is_initialized(m)) {
-        msegmentptr s = &m->seg;
-        sum += m->topsize + TOP_FOOT_SIZE;
-        while (s != 0) {
-            mchunkptr q = align_as_chunk(s->base);
-            mchunkptr lastq = 0;
-            assert(pinuse(q));
-            while (segment_holds(s, q) &&
-                   q != m->top && q->head != FENCEPOST_HEAD) {
-                sum += chunksize(q);
-                if (cinuse(q)) {
-                    assert(!bin_find(m, q));
-                    do_check_inuse_chunk(m, q);
-                } else {
-                    assert(q == m->dv || bin_find(m, q));
-                    assert(lastq == 0 || cinuse(lastq));        /* Not 2 consecutive free */
-                    do_check_free_chunk(m, q);
-                }
-                lastq = q;
-                q = next_chunk(q);
-            }
-            s = s->next;
-        }
-    }
-    return sum;
-}
-
-/* Check all properties of malloc_state. */
-static void
-do_check_malloc_state(mstate m)
-{
-    bindex_t i;
-    size_t total;
-    /* check bins */
-    for (i = 0; i < NSMALLBINS; ++i)
-        do_check_smallbin(m, i);
-    for (i = 0; i < NTREEBINS; ++i)
-        do_check_treebin(m, i);
-
-    if (m->dvsize != 0) {       /* check dv chunk */
-        do_check_any_chunk(m, m->dv);
-        assert(m->dvsize == chunksize(m->dv));
-        assert(m->dvsize >= MIN_CHUNK_SIZE);
-        assert(bin_find(m, m->dv) == 0);
-    }
-
-    if (m->top != 0) {          /* check top chunk */
-        do_check_top_chunk(m, m->top);
-        assert(m->topsize == chunksize(m->top));
-        assert(m->topsize > 0);
-        assert(bin_find(m, m->top) == 0);
-    }
-
-    total = traverse_and_check(m);
-    assert(total <= m->footprint);
-    assert(m->footprint <= m->max_footprint);
-}
-#endif /* DEBUG */
-
-/* ----------------------------- statistics ------------------------------ */
-
-#if !NO_MALLINFO
-static struct mallinfo
-internal_mallinfo(mstate m)
-{
-    struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-    if (!PREACTION(m)) {
-        check_malloc_state(m);
-        if (is_initialized(m)) {
-            size_t nfree = SIZE_T_ONE;  /* top always free */
-            size_t mfree = m->topsize + TOP_FOOT_SIZE;
-            size_t sum = mfree;
-            msegmentptr s = &m->seg;
-            while (s != 0) {
-                mchunkptr q = align_as_chunk(s->base);
-                while (segment_holds(s, q) &&
-                       q != m->top && q->head != FENCEPOST_HEAD) {
-                    size_t sz = chunksize(q);
-                    sum += sz;
-                    if (!cinuse(q)) {
-                        mfree += sz;
-                        ++nfree;
-                    }
-                    q = next_chunk(q);
-                }
-                s = s->next;
-            }
-
-            nm.arena = sum;
-            nm.ordblks = nfree;
-            nm.hblkhd = m->footprint - sum;
-            nm.usmblks = m->max_footprint;
-            nm.uordblks = m->footprint - mfree;
-            nm.fordblks = mfree;
-            nm.keepcost = m->topsize;
-        }
-
-        POSTACTION(m);
-    }
-    return nm;
-}
-#endif /* !NO_MALLINFO */
-
-static void
-internal_malloc_stats(mstate m)
-{
-    if (!PREACTION(m)) {
-        size_t maxfp = 0;
-        size_t fp = 0;
-        size_t used = 0;
-        check_malloc_state(m);
-        if (is_initialized(m)) {
-            msegmentptr s = &m->seg;
-            maxfp = m->max_footprint;
-            fp = m->footprint;
-            used = fp - (m->topsize + TOP_FOOT_SIZE);
-
-            while (s != 0) {
-                mchunkptr q = align_as_chunk(s->base);
-                while (segment_holds(s, q) &&
-                       q != m->top && q->head != FENCEPOST_HEAD) {
-                    if (!cinuse(q))
-                        used -= chunksize(q);
-                    q = next_chunk(q);
-                }
-                s = s->next;
-            }
-        }
-#ifndef LACKS_STDIO_H
-        fprintf(stderr, "max system bytes = %10lu\n",
-                (unsigned long) (maxfp));
-        fprintf(stderr, "system bytes     = %10lu\n", (unsigned long) (fp));
-        fprintf(stderr, "in use bytes     = %10lu\n", (unsigned long) (used));
-#endif
-
-        POSTACTION(m);
-    }
-}
-
-/* ----------------------- Operations on smallbins ----------------------- */
-
-/*
-  Various forms of linking and unlinking are defined as macros.  Even
-  the ones for trees, which are very long but have very short typical
-  paths.  This is ugly but reduces reliance on inlining support of
-  compilers.
-*/
-
-/* Link a free chunk into a smallbin  */
-#define insert_small_chunk(M, P, S) {\
-  bindex_t I  = small_index(S);\
-  mchunkptr B = smallbin_at(M, I);\
-  mchunkptr F = B;\
-  assert(S >= MIN_CHUNK_SIZE);\
-  if (!smallmap_is_marked(M, I))\
-    mark_smallmap(M, I);\
-  else if (RTCHECK(ok_address(M, B->fd)))\
-    F = B->fd;\
-  else {\
-    CORRUPTION_ERROR_ACTION(M);\
-  }\
-  B->fd = P;\
-  F->bk = P;\
-  P->fd = F;\
-  P->bk = B;\
-}
-
-/* Unlink a chunk from a smallbin  */
-#define unlink_small_chunk(M, P, S) {\
-  mchunkptr F = P->fd;\
-  mchunkptr B = P->bk;\
-  bindex_t I = small_index(S);\
-  assert(P != B);\
-  assert(P != F);\
-  assert(chunksize(P) == small_index2size(I));\
-  if (F == B)\
-    clear_smallmap(M, I);\
-  else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\
-                   (B == smallbin_at(M,I) || ok_address(M, B)))) {\
-    F->bk = B;\
-    B->fd = F;\
-  }\
-  else {\
-    CORRUPTION_ERROR_ACTION(M);\
-  }\
-}
-
-/* Unlink the first chunk from a smallbin */
-#define unlink_first_small_chunk(M, B, P, I) {\
-  mchunkptr F = P->fd;\
-  assert(P != B);\
-  assert(P != F);\
-  assert(chunksize(P) == small_index2size(I));\
-  if (B == F)\
-    clear_smallmap(M, I);\
-  else if (RTCHECK(ok_address(M, F))) {\
-    B->fd = F;\
-    F->bk = B;\
-  }\
-  else {\
-    CORRUPTION_ERROR_ACTION(M);\
-  }\
-}
-
-/* Replace dv node, binning the old one */
-/* Used only when dvsize known to be small */
-#define replace_dv(M, P, S) {\
-  size_t DVS = M->dvsize;\
-  if (DVS != 0) {\
-    mchunkptr DV = M->dv;\
-    assert(is_small(DVS));\
-    insert_small_chunk(M, DV, DVS);\
-  }\
-  M->dvsize = S;\
-  M->dv = P;\
-}
-
-/* ------------------------- Operations on trees ------------------------- */
-
-/* Insert chunk into tree */
-#define insert_large_chunk(M, X, S) {\
-  tbinptr* H;\
-  bindex_t I;\
-  compute_tree_index(S, I);\
-  H = treebin_at(M, I);\
-  X->index = I;\
-  X->child[0] = X->child[1] = 0;\
-  if (!treemap_is_marked(M, I)) {\
-    mark_treemap(M, I);\
-    *H = X;\
-    X->parent = (tchunkptr)H;\
-    X->fd = X->bk = X;\
-  }\
-  else {\
-    tchunkptr T = *H;\
-    size_t K = S << leftshift_for_tree_index(I);\
-    for (;;) {\
-      if (chunksize(T) != S) {\
-        tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\
-        K <<= 1;\
-        if (*C != 0)\
-          T = *C;\
-        else if (RTCHECK(ok_address(M, C))) {\
-          *C = X;\
-          X->parent = T;\
-          X->fd = X->bk = X;\
-          break;\
-        }\
-        else {\
-          CORRUPTION_ERROR_ACTION(M);\
-          break;\
-        }\
-      }\
-      else {\
-        tchunkptr F = T->fd;\
-        if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\
-          T->fd = F->bk = X;\
-          X->fd = F;\
-          X->bk = T;\
-          X->parent = 0;\
-          break;\
-        }\
-        else {\
-          CORRUPTION_ERROR_ACTION(M);\
-          break;\
-        }\
-      }\
-    }\
-  }\
-}
-
-/*
-  Unlink steps:
-
-  1. If x is a chained node, unlink it from its same-sized fd/bk links
-     and choose its bk node as its replacement.
-  2. If x was the last node of its size, but not a leaf node, it must
-     be replaced with a leaf node (not merely one with an open left or
-     right), to make sure that lefts and rights of descendents
-     correspond properly to bit masks.  We use the rightmost descendent
-     of x.  We could use any other leaf, but this is easy to locate and
-     tends to counteract removal of leftmosts elsewhere, and so keeps
-     paths shorter than minimally guaranteed.  This doesn't loop much
-     because on average a node in a tree is near the bottom.
-  3. If x is the base of a chain (i.e., has parent links) relink
-     x's parent and children to x's replacement (or null if none).
-*/
-
-#define unlink_large_chunk(M, X) {\
-  tchunkptr XP = X->parent;\
-  tchunkptr R;\
-  if (X->bk != X) {\
-    tchunkptr F = X->fd;\
-    R = X->bk;\
-    if (RTCHECK(ok_address(M, F))) {\
-      F->bk = R;\
-      R->fd = F;\
-    }\
-    else {\
-      CORRUPTION_ERROR_ACTION(M);\
-    }\
-  }\
-  else {\
-    tchunkptr* RP;\
-    if (((R = *(RP = &(X->child[1]))) != 0) ||\
-        ((R = *(RP = &(X->child[0]))) != 0)) {\
-      tchunkptr* CP;\
-      while ((*(CP = &(R->child[1])) != 0) ||\
-             (*(CP = &(R->child[0])) != 0)) {\
-        R = *(RP = CP);\
-      }\
-      if (RTCHECK(ok_address(M, RP)))\
-        *RP = 0;\
-      else {\
-        CORRUPTION_ERROR_ACTION(M);\
-      }\
-    }\
-  }\
-  if (XP != 0) {\
-    tbinptr* H = treebin_at(M, X->index);\
-    if (X == *H) {\
-      if ((*H = R) == 0) \
-        clear_treemap(M, X->index);\
-    }\
-    else if (RTCHECK(ok_address(M, XP))) {\
-      if (XP->child[0] == X) \
-        XP->child[0] = R;\
-      else \
-        XP->child[1] = R;\
-    }\
-    else\
-      CORRUPTION_ERROR_ACTION(M);\
-    if (R != 0) {\
-      if (RTCHECK(ok_address(M, R))) {\
-        tchunkptr C0, C1;\
-        R->parent = XP;\
-        if ((C0 = X->child[0]) != 0) {\
-          if (RTCHECK(ok_address(M, C0))) {\
-            R->child[0] = C0;\
-            C0->parent = R;\
-          }\
-          else\
-            CORRUPTION_ERROR_ACTION(M);\
-        }\
-        if ((C1 = X->child[1]) != 0) {\
-          if (RTCHECK(ok_address(M, C1))) {\
-            R->child[1] = C1;\
-            C1->parent = R;\
-          }\
-          else\
-            CORRUPTION_ERROR_ACTION(M);\
-        }\
-      }\
-      else\
-        CORRUPTION_ERROR_ACTION(M);\
-    }\
-  }\
-}
-
-/* Relays to large vs small bin operations */
-
-#define insert_chunk(M, P, S)\
-  if (is_small(S)) insert_small_chunk(M, P, S)\
-  else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }
-
-#define unlink_chunk(M, P, S)\
-  if (is_small(S)) unlink_small_chunk(M, P, S)\
-  else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }
-
-
-/* Relays to internal calls to malloc/free from realloc, memalign etc */
-
-#if ONLY_MSPACES
-#define internal_malloc(m, b) mspace_malloc(m, b)
-#define internal_free(m, mem) mspace_free(m,mem);
-#else /* ONLY_MSPACES */
-#if MSPACES
-#define internal_malloc(m, b)\
-   (m == gm)? dlmalloc(b) : mspace_malloc(m, b)
-#define internal_free(m, mem)\
-   if (m == gm) dlfree(mem); else mspace_free(m,mem);
-#else /* MSPACES */
-#define internal_malloc(m, b) dlmalloc(b)
-#define internal_free(m, mem) dlfree(mem)
-#endif /* MSPACES */
-#endif /* ONLY_MSPACES */
-
-/* -----------------------  Direct-mmapping chunks ----------------------- */
-
-/*
-  Directly mmapped chunks are set up with an offset to the start of
-  the mmapped region stored in the prev_foot field of the chunk. This
-  allows reconstruction of the required argument to MUNMAP when freed,
-  and also allows adjustment of the returned chunk to meet alignment
-  requirements (especially in memalign).  There is also enough space
-  allocated to hold a fake next chunk of size SIZE_T_SIZE to maintain
-  the PINUSE bit so frees can be checked.
-*/
-
-/* Malloc using mmap */
-static void *
-mmap_alloc(mstate m, size_t nb)
-{
-    size_t mmsize =
-        granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
-    if (mmsize > nb) {          /* Check for wrap around 0 */
-        char *mm = (char *) (DIRECT_MMAP(mmsize));
-        if (mm != CMFAIL) {
-            size_t offset = align_offset(chunk2mem(mm));
-            size_t psize = mmsize - offset - MMAP_FOOT_PAD;
-            mchunkptr p = (mchunkptr) (mm + offset);
-            p->prev_foot = offset | IS_MMAPPED_BIT;
-            (p)->head = (psize | CINUSE_BIT);
-            mark_inuse_foot(m, p, psize);
-            chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD;
-            chunk_plus_offset(p, psize + SIZE_T_SIZE)->head = 0;
-
-            if (mm < m->least_addr)
-                m->least_addr = mm;
-            if ((m->footprint += mmsize) > m->max_footprint)
-                m->max_footprint = m->footprint;
-            assert(is_aligned(chunk2mem(p)));
-            check_mmapped_chunk(m, p);
-            return chunk2mem(p);
-        }
-    }
-    return 0;
-}
-
-/* Realloc using mmap */
-static mchunkptr
-mmap_resize(mstate m, mchunkptr oldp, size_t nb)
-{
-    size_t oldsize = chunksize(oldp);
-    if (is_small(nb))           /* Can't shrink mmap regions below small size */
-        return 0;
-    /* Keep old chunk if big enough but not too big */
-    if (oldsize >= nb + SIZE_T_SIZE &&
-        (oldsize - nb) <= (mparams.granularity << 1))
-        return oldp;
-    else {
-        size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT;
-        size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD;
-        size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES +
-                                             CHUNK_ALIGN_MASK);
-        char *cp = (char *) CALL_MREMAP((char *) oldp - offset,
-                                        oldmmsize, newmmsize, 1);
-        if (cp != CMFAIL) {
-            mchunkptr newp = (mchunkptr) (cp + offset);
-            size_t psize = newmmsize - offset - MMAP_FOOT_PAD;
-            newp->head = (psize | CINUSE_BIT);
-            mark_inuse_foot(m, newp, psize);
-            chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD;
-            chunk_plus_offset(newp, psize + SIZE_T_SIZE)->head = 0;
-
-            if (cp < m->least_addr)
-                m->least_addr = cp;
-            if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint)
-                m->max_footprint = m->footprint;
-            check_mmapped_chunk(m, newp);
-            return newp;
-        }
-    }
-    return 0;
-}
-
-/* -------------------------- mspace management -------------------------- */
-
-/* Initialize top chunk and its size */
-static void
-init_top(mstate m, mchunkptr p, size_t psize)
-{
-    /* Ensure alignment */
-    size_t offset = align_offset(chunk2mem(p));
-    p = (mchunkptr) ((char *) p + offset);
-    psize -= offset;
-
-    m->top = p;
-    m->topsize = psize;
-    p->head = psize | PINUSE_BIT;
-    /* set size of fake trailing chunk holding overhead space only once */
-    chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE;
-    m->trim_check = mparams.trim_threshold;     /* reset on each update */
-}
-
-/* Initialize bins for a new mstate that is otherwise zeroed out */
-static void
-init_bins(mstate m)
-{
-    /* Establish circular links for smallbins */
-    bindex_t i;
-    for (i = 0; i < NSMALLBINS; ++i) {
-        sbinptr bin = smallbin_at(m, i);
-        bin->fd = bin->bk = bin;
-    }
-}
-
-#if PROCEED_ON_ERROR
-
-/* default corruption action */
-static void
-reset_on_error(mstate m)
-{
-    int i;
-    ++malloc_corruption_error_count;
-    /* Reinitialize fields to forget about all memory */
-    m->smallbins = m->treebins = 0;
-    m->dvsize = m->topsize = 0;
-    m->seg.base = 0;
-    m->seg.size = 0;
-    m->seg.next = 0;
-    m->top = m->dv = 0;
-    for (i = 0; i < NTREEBINS; ++i)
-        *treebin_at(m, i) = 0;
-    init_bins(m);
-}
-#endif /* PROCEED_ON_ERROR */
-
-/* Allocate chunk and prepend remainder with chunk in successor base. */
-static void *
-prepend_alloc(mstate m, char *newbase, char *oldbase, size_t nb)
-{
-    mchunkptr p = align_as_chunk(newbase);
-    mchunkptr oldfirst = align_as_chunk(oldbase);
-    size_t psize = (char *) oldfirst - (char *) p;
-    mchunkptr q = chunk_plus_offset(p, nb);
-    size_t qsize = psize - nb;
-    set_size_and_pinuse_of_inuse_chunk(m, p, nb);
-
-    assert((char *) oldfirst > (char *) q);
-    assert(pinuse(oldfirst));
-    assert(qsize >= MIN_CHUNK_SIZE);
-
-    /* consolidate remainder with first chunk of old base */
-    if (oldfirst == m->top) {
-        size_t tsize = m->topsize += qsize;
-        m->top = q;
-        q->head = tsize | PINUSE_BIT;
-        check_top_chunk(m, q);
-    } else if (oldfirst == m->dv) {
-        size_t dsize = m->dvsize += qsize;
-        m->dv = q;
-        set_size_and_pinuse_of_free_chunk(q, dsize);
-    } else {
-        if (!cinuse(oldfirst)) {
-            size_t nsize = chunksize(oldfirst);
-            unlink_chunk(m, oldfirst, nsize);
-            oldfirst = chunk_plus_offset(oldfirst, nsize);
-            qsize += nsize;
-        }
-        set_free_with_pinuse(q, qsize, oldfirst);
-        insert_chunk(m, q, qsize);
-        check_free_chunk(m, q);
-    }
-
-    check_malloced_chunk(m, chunk2mem(p), nb);
-    return chunk2mem(p);
-}
-
-
-/* Add a segment to hold a new noncontiguous region */
-static void
-add_segment(mstate m, char *tbase, size_t tsize, flag_t mmapped)
-{
-    /* Determine locations and sizes of segment, fenceposts, old top */
-    char *old_top = (char *) m->top;
-    msegmentptr oldsp = segment_holding(m, old_top);
-    char *old_end = oldsp->base + oldsp->size;
-    size_t ssize = pad_request(sizeof(struct malloc_segment));
-    char *rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
-    size_t offset = align_offset(chunk2mem(rawsp));
-    char *asp = rawsp + offset;
-    char *csp = (asp < (old_top + MIN_CHUNK_SIZE)) ? old_top : asp;
-    mchunkptr sp = (mchunkptr) csp;
-    msegmentptr ss = (msegmentptr) (chunk2mem(sp));
-    mchunkptr tnext = chunk_plus_offset(sp, ssize);
-    mchunkptr p = tnext;
-    int nfences = 0;
-
-    /* reset top to new space */
-    init_top(m, (mchunkptr) tbase, tsize - TOP_FOOT_SIZE);
-
-    /* Set up segment record */
-    assert(is_aligned(ss));
-    set_size_and_pinuse_of_inuse_chunk(m, sp, ssize);
-    *ss = m->seg;               /* Push current record */
-    m->seg.base = tbase;
-    m->seg.size = tsize;
-    m->seg.sflags = mmapped;
-    m->seg.next = ss;
-
-    /* Insert trailing fenceposts */
-    for (;;) {
-        mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE);
-        p->head = FENCEPOST_HEAD;
-        ++nfences;
-        if ((char *) (&(nextp->head)) < old_end)
-            p = nextp;
-        else
-            break;
-    }
-    assert(nfences >= 2);
-
-    /* Insert the rest of old top into a bin as an ordinary free chunk */
-    if (csp != old_top) {
-        mchunkptr q = (mchunkptr) old_top;
-        size_t psize = csp - old_top;
-        mchunkptr tn = chunk_plus_offset(q, psize);
-        set_free_with_pinuse(q, psize, tn);
-        insert_chunk(m, q, psize);
-    }
-
-    check_top_chunk(m, m->top);
-}
-
-/* -------------------------- System allocation -------------------------- */
-
-/* Get memory from system using MORECORE or MMAP */
-static void *
-sys_alloc(mstate m, size_t nb)
-{
-    char *tbase = CMFAIL;
-    size_t tsize = 0;
-    flag_t mmap_flag = 0;
-
-    init_mparams();
-
-    /* Directly map large chunks */
-    if (use_mmap(m) && nb >= mparams.mmap_threshold) {
-        void *mem = mmap_alloc(m, nb);
-        if (mem != 0)
-            return mem;
-    }
-
-    /*
-       Try getting memory in any of three ways (in most-preferred to
-       least-preferred order):
-       1. A call to MORECORE that can normally contiguously extend memory.
-       (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or
-       or main space is mmapped or a previous contiguous call failed)
-       2. A call to MMAP new space (disabled if not HAVE_MMAP).
-       Note that under the default settings, if MORECORE is unable to
-       fulfill a request, and HAVE_MMAP is true, then mmap is
-       used as a noncontiguous system allocator. This is a useful backup
-       strategy for systems with holes in address spaces -- in this case
-       sbrk cannot contiguously expand the heap, but mmap may be able to
-       find space.
-       3. A call to MORECORE that cannot usually contiguously extend memory.
-       (disabled if not HAVE_MORECORE)
-     */
-
-    if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) {
-        char *br = CMFAIL;
-        msegmentptr ss =
-            (m->top == 0) ? 0 : segment_holding(m, (char *) m->top);
-        size_t asize = 0;
-        ACQUIRE_MORECORE_LOCK();
-
-        if (ss == 0) {          /* First time through or recovery */
-            char *base = (char *) CALL_MORECORE(0);
-            if (base != CMFAIL) {
-                asize =
-                    granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT +
-                                      SIZE_T_ONE);
-                /* Adjust to end on a page boundary */
-                if (!is_page_aligned(base))
-                    asize += (page_align((size_t) base) - (size_t) base);
-                /* Can't call MORECORE if size is negative when treated as signed */
-                if (asize < HALF_MAX_SIZE_T &&
-                    (br = (char *) (CALL_MORECORE(asize))) == base) {
-                    tbase = base;
-                    tsize = asize;
-                }
-            }
-        } else {
-            /* Subtract out existing available top space from MORECORE request. */
-            asize =
-                granularity_align(nb - m->topsize + TOP_FOOT_SIZE +
-                                  MALLOC_ALIGNMENT + SIZE_T_ONE);
-            /* Use mem here only if it did continuously extend old space */
-            if (asize < HALF_MAX_SIZE_T &&
-                (br =
-                 (char *) (CALL_MORECORE(asize))) == ss->base + ss->size) {
-                tbase = br;
-                tsize = asize;
-            }
-        }
-
-        if (tbase == CMFAIL) {  /* Cope with partial failure */
-            if (br != CMFAIL) { /* Try to use/extend the space we did get */
-                if (asize < HALF_MAX_SIZE_T &&
-                    asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) {
-                    size_t esize =
-                        granularity_align(nb + TOP_FOOT_SIZE +
-                                          MALLOC_ALIGNMENT + SIZE_T_ONE -
-                                          asize);
-                    if (esize < HALF_MAX_SIZE_T) {
-                        char *end = (char *) CALL_MORECORE(esize);
-                        if (end != CMFAIL)
-                            asize += esize;
-                        else {  /* Can't use; try to release */
-                            end = (char *) CALL_MORECORE(-asize);
-                            br = CMFAIL;
-                        }
-                    }
-                }
-            }
-            if (br != CMFAIL) { /* Use the space we did get */
-                tbase = br;
-                tsize = asize;
-            } else
-                disable_contiguous(m);  /* Don't try contiguous path in the future */
-        }
-
-        RELEASE_MORECORE_LOCK();
-    }
-
-    if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */
-        size_t req = nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE;
-        size_t rsize = granularity_align(req);
-        if (rsize > nb) {       /* Fail if wraps around zero */
-            char *mp = (char *) (CALL_MMAP(rsize));
-            if (mp != CMFAIL) {
-                tbase = mp;
-                tsize = rsize;
-                mmap_flag = IS_MMAPPED_BIT;
-            }
-        }
-    }
-
-    if (HAVE_MORECORE && tbase == CMFAIL) {     /* Try noncontiguous MORECORE */
-        size_t asize =
-            granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT +
-                              SIZE_T_ONE);
-        if (asize < HALF_MAX_SIZE_T) {
-            char *br = CMFAIL;
-            char *end = CMFAIL;
-            ACQUIRE_MORECORE_LOCK();
-            br = (char *) (CALL_MORECORE(asize));
-            end = (char *) (CALL_MORECORE(0));
-            RELEASE_MORECORE_LOCK();
-            if (br != CMFAIL && end != CMFAIL && br < end) {
-                size_t ssize = end - br;
-                if (ssize > nb + TOP_FOOT_SIZE) {
-                    tbase = br;
-                    tsize = ssize;
-                }
-            }
-        }
-    }
-
-    if (tbase != CMFAIL) {
-
-        if ((m->footprint += tsize) > m->max_footprint)
-            m->max_footprint = m->footprint;
-
-        if (!is_initialized(m)) {       /* first-time initialization */
-            m->seg.base = m->least_addr = tbase;
-            m->seg.size = tsize;
-            m->seg.sflags = mmap_flag;
-            m->magic = mparams.magic;
-            init_bins(m);
-            if (is_global(m))
-                init_top(m, (mchunkptr) tbase, tsize - TOP_FOOT_SIZE);
-            else {
-                /* Offset top by embedded malloc_state */
-                mchunkptr mn = next_chunk(mem2chunk(m));
-                init_top(m, mn,
-                         (size_t) ((tbase + tsize) - (char *) mn) -
-                         TOP_FOOT_SIZE);
-            }
-        }
-
-        else {
-            /* Try to merge with an existing segment */
-            msegmentptr sp = &m->seg;
-            while (sp != 0 && tbase != sp->base + sp->size)
-                sp = sp->next;
-            if (sp != 0 && !is_extern_segment(sp) && (sp->sflags & IS_MMAPPED_BIT) == mmap_flag && segment_holds(sp, m->top)) { /* append */
-                sp->size += tsize;
-                init_top(m, m->top, m->topsize + tsize);
-            } else {
-                if (tbase < m->least_addr)
-                    m->least_addr = tbase;
-                sp = &m->seg;
-                while (sp != 0 && sp->base != tbase + tsize)
-                    sp = sp->next;
-                if (sp != 0 &&
-                    !is_extern_segment(sp) &&
-                    (sp->sflags & IS_MMAPPED_BIT) == mmap_flag) {
-                    char *oldbase = sp->base;
-                    sp->base = tbase;
-                    sp->size += tsize;
-                    return prepend_alloc(m, tbase, oldbase, nb);
-                } else
-                    add_segment(m, tbase, tsize, mmap_flag);
-            }
-        }
-
-        if (nb < m->topsize) {  /* Allocate from new or extended top space */
-            size_t rsize = m->topsize -= nb;
-            mchunkptr p = m->top;
-            mchunkptr r = m->top = chunk_plus_offset(p, nb);
-            r->head = rsize | PINUSE_BIT;
-            set_size_and_pinuse_of_inuse_chunk(m, p, nb);
-            check_top_chunk(m, m->top);
-            check_malloced_chunk(m, chunk2mem(p), nb);
-            return chunk2mem(p);
-        }
-    }
-
-    MALLOC_FAILURE_ACTION;
-    return 0;
-}
-
-/* -----------------------  system deallocation -------------------------- */
-
-/* Unmap and unlink any mmapped segments that don't contain used chunks */
-static size_t
-release_unused_segments(mstate m)
-{
-    size_t released = 0;
-    msegmentptr pred = &m->seg;
-    msegmentptr sp = pred->next;
-    while (sp != 0) {
-        char *base = sp->base;
-        size_t size = sp->size;
-        msegmentptr next = sp->next;
-        if (is_mmapped_segment(sp) && !is_extern_segment(sp)) {
-            mchunkptr p = align_as_chunk(base);
-            size_t psize = chunksize(p);
-            /* Can unmap if first chunk holds entire segment and not pinned */
-            if (!cinuse(p)
-                && (char *) p + psize >= base + size - TOP_FOOT_SIZE) {
-                tchunkptr tp = (tchunkptr) p;
-                assert(segment_holds(sp, (char *) sp));
-                if (p == m->dv) {
-                    m->dv = 0;
-                    m->dvsize = 0;
-                } else {
-                    unlink_large_chunk(m, tp);
-                }
-                if (CALL_MUNMAP(base, size) == 0) {
-                    released += size;
-                    m->footprint -= size;
-                    /* unlink obsoleted record */
-                    sp = pred;
-                    sp->next = next;
-                } else {        /* back out if cannot unmap */
-                    insert_large_chunk(m, tp, psize);
-                }
-            }
-        }
-        pred = sp;
-        sp = next;
-    }
-    return released;
-}
-
-static int
-sys_trim(mstate m, size_t pad)
-{
-    size_t released = 0;
-    if (pad < MAX_REQUEST && is_initialized(m)) {
-        pad += TOP_FOOT_SIZE;   /* ensure enough room for segment overhead */
-
-        if (m->topsize > pad) {
-            /* Shrink top space in granularity-size units, keeping at least one */
-            size_t unit = mparams.granularity;
-            size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit -
-                            SIZE_T_ONE) * unit;
-            msegmentptr sp = segment_holding(m, (char *) m->top);
-
-            if (!is_extern_segment(sp)) {
-                if (is_mmapped_segment(sp)) {
-                    if (HAVE_MMAP && sp->size >= extra && !has_segment_link(m, sp)) {   /* can't shrink if pinned */
-                        size_t newsize = sp->size - extra;
-                        /* Prefer mremap, fall back to munmap */
-                        if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) !=
-                             MFAIL)
-                            || (CALL_MUNMAP(sp->base + newsize, extra) == 0)) {
-                            released = extra;
-                        }
-                    }
-                } else if (HAVE_MORECORE) {
-                    if (extra >= HALF_MAX_SIZE_T)       /* Avoid wrapping negative */
-                        extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit;
-                    ACQUIRE_MORECORE_LOCK();
-                    {
-                        /* Make sure end of memory is where we last set it. */
-                        char *old_br = (char *) (CALL_MORECORE(0));
-                        if (old_br == sp->base + sp->size) {
-                            char *rel_br = (char *) (CALL_MORECORE(-extra));
-                            char *new_br = (char *) (CALL_MORECORE(0));
-                            if (rel_br != CMFAIL && new_br < old_br)
-                                released = old_br - new_br;
-                        }
-                    }
-                    RELEASE_MORECORE_LOCK();
-                }
-            }
-
-            if (released != 0) {
-                sp->size -= released;
-                m->footprint -= released;
-                init_top(m, m->top, m->topsize - released);
-                check_top_chunk(m, m->top);
-            }
-        }
-
-        /* Unmap any unused mmapped segments */
-        if (HAVE_MMAP)
-            released += release_unused_segments(m);
-
-        /* On failure, disable autotrim to avoid repeated failed future calls */
-        if (released == 0)
-            m->trim_check = MAX_SIZE_T;
-    }
-
-    return (released != 0) ? 1 : 0;
-}
-
-/* ---------------------------- malloc support --------------------------- */
-
-/* allocate a large request from the best fitting chunk in a treebin */
-static void *
-tmalloc_large(mstate m, size_t nb)
-{
-    tchunkptr v = 0;
-    size_t rsize = -nb;         /* Unsigned negation */
-    tchunkptr t;
-    bindex_t idx;
-    compute_tree_index(nb, idx);
-
-    if ((t = *treebin_at(m, idx)) != 0) {
-        /* Traverse tree for this bin looking for node with size == nb */
-        size_t sizebits = nb << leftshift_for_tree_index(idx);
-        tchunkptr rst = 0;      /* The deepest untaken right subtree */
-        for (;;) {
-            tchunkptr rt;
-            size_t trem = chunksize(t) - nb;
-            if (trem < rsize) {
-                v = t;
-                if ((rsize = trem) == 0)
-                    break;
-            }
-            rt = t->child[1];
-            t = t->child[(sizebits >> (SIZE_T_BITSIZE - SIZE_T_ONE)) & 1];
-            if (rt != 0 && rt != t)
-                rst = rt;
-            if (t == 0) {
-                t = rst;        /* set t to least subtree holding sizes > nb */
-                break;
-            }
-            sizebits <<= 1;
-        }
-    }
-
-    if (t == 0 && v == 0) {     /* set t to root of next non-empty treebin */
-        binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap;
-        if (leftbits != 0) {
-            bindex_t i;
-            binmap_t leastbit = least_bit(leftbits);
-            compute_bit2idx(leastbit, i);
-            t = *treebin_at(m, i);
-        }
-    }
-
-    while (t != 0) {            /* find smallest of tree or subtree */
-        size_t trem = chunksize(t) - nb;
-        if (trem < rsize) {
-            rsize = trem;
-            v = t;
-        }
-        t = leftmost_child(t);
-    }
-
-    /*  If dv is a better fit, return 0 so malloc will use it */
-    if (v != 0 && rsize < (size_t) (m->dvsize - nb)) {
-        if (RTCHECK(ok_address(m, v))) {        /* split */
-            mchunkptr r = chunk_plus_offset(v, nb);
-            assert(chunksize(v) == rsize + nb);
-            if (RTCHECK(ok_next(v, r))) {
-                unlink_large_chunk(m, v);
-                if (rsize < MIN_CHUNK_SIZE)
-                    set_inuse_and_pinuse(m, v, (rsize + nb));
-                else {
-                    set_size_and_pinuse_of_inuse_chunk(m, v, nb);
-                    set_size_and_pinuse_of_free_chunk(r, rsize);
-                    insert_chunk(m, r, rsize);
-                }
-                return chunk2mem(v);
-            }
-        }
-        CORRUPTION_ERROR_ACTION(m);
-    }
-    return 0;
-}
-
-/* allocate a small request from the best fitting chunk in a treebin */
-static void *
-tmalloc_small(mstate m, size_t nb)
-{
-    tchunkptr t, v;
-    size_t rsize;
-    bindex_t i;
-    binmap_t leastbit = least_bit(m->treemap);
-    compute_bit2idx(leastbit, i);
-
-    v = t = *treebin_at(m, i);
-    rsize = chunksize(t) - nb;
-
-    while ((t = leftmost_child(t)) != 0) {
-        size_t trem = chunksize(t) - nb;
-        if (trem < rsize) {
-            rsize = trem;
-            v = t;
-        }
-    }
-
-    if (RTCHECK(ok_address(m, v))) {
-        mchunkptr r = chunk_plus_offset(v, nb);
-        assert(chunksize(v) == rsize + nb);
-        if (RTCHECK(ok_next(v, r))) {
-            unlink_large_chunk(m, v);
-            if (rsize < MIN_CHUNK_SIZE)
-                set_inuse_and_pinuse(m, v, (rsize + nb));
-            else {
-                set_size_and_pinuse_of_inuse_chunk(m, v, nb);
-                set_size_and_pinuse_of_free_chunk(r, rsize);
-                replace_dv(m, r, rsize);
-            }
-            return chunk2mem(v);
-        }
-    }
-
-    CORRUPTION_ERROR_ACTION(m);
-    return 0;
-}
-
-/* --------------------------- realloc support --------------------------- */
-
-static void *
-internal_realloc(mstate m, void *oldmem, size_t bytes)
-{
-    if (bytes >= MAX_REQUEST) {
-        MALLOC_FAILURE_ACTION;
-        return 0;
-    }
-    if (!PREACTION(m)) {
-        mchunkptr oldp = mem2chunk(oldmem);
-        size_t oldsize = chunksize(oldp);
-        mchunkptr next = chunk_plus_offset(oldp, oldsize);
-        mchunkptr newp = 0;
-        void *extra = 0;
-
-        /* Try to either shrink or extend into top. Else malloc-copy-free */
-
-        if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) &&
-                    ok_next(oldp, next) && ok_pinuse(next))) {
-            size_t nb = request2size(bytes);
-            if (is_mmapped(oldp))
-                newp = mmap_resize(m, oldp, nb);
-            else if (oldsize >= nb) {   /* already big enough */
-                size_t rsize = oldsize - nb;
-                newp = oldp;
-                if (rsize >= MIN_CHUNK_SIZE) {
-                    mchunkptr remainder = chunk_plus_offset(newp, nb);
-                    set_inuse(m, newp, nb);
-                    set_inuse(m, remainder, rsize);
-                    extra = chunk2mem(remainder);
-                }
-            } else if (next == m->top && oldsize + m->topsize > nb) {
-                /* Expand into top */
-                size_t newsize = oldsize + m->topsize;
-                size_t newtopsize = newsize - nb;
-                mchunkptr newtop = chunk_plus_offset(oldp, nb);
-                set_inuse(m, oldp, nb);
-                newtop->head = newtopsize | PINUSE_BIT;
-                m->top = newtop;
-                m->topsize = newtopsize;
-                newp = oldp;
-            }
-        } else {
-            USAGE_ERROR_ACTION(m, oldmem);
-            POSTACTION(m);
-            return 0;
-        }
-
-        POSTACTION(m);
-
-        if (newp != 0) {
-            if (extra != 0) {
-                internal_free(m, extra);
-            }
-            check_inuse_chunk(m, newp);
-            return chunk2mem(newp);
-        } else {
-            void *newmem = internal_malloc(m, bytes);
-            if (newmem != 0) {
-                size_t oc = oldsize - overhead_for(oldp);
-                memcpy(newmem, oldmem, (oc < bytes) ? oc : bytes);
-                internal_free(m, oldmem);
-            }
-            return newmem;
-        }
-    }
-    return 0;
-}
-
-/* --------------------------- memalign support -------------------------- */
-
-static void *
-internal_memalign(mstate m, size_t alignment, size_t bytes)
-{
-    if (alignment <= MALLOC_ALIGNMENT)  /* Can just use malloc */
-        return internal_malloc(m, bytes);
-    if (alignment < MIN_CHUNK_SIZE)     /* must be at least a minimum chunk size */
-        alignment = MIN_CHUNK_SIZE;
-    if ((alignment & (alignment - SIZE_T_ONE)) != 0) {  /* Ensure a power of 2 */
-        size_t a = MALLOC_ALIGNMENT << 1;
-        while (a < alignment)
-            a <<= 1;
-        alignment = a;
-    }
-
-    if (bytes >= MAX_REQUEST - alignment) {
-        if (m != 0) {           /* Test isn't needed but avoids compiler warning */
-            MALLOC_FAILURE_ACTION;
-        }
-    } else {
-        size_t nb = request2size(bytes);
-        size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD;
-        char *mem = (char *) internal_malloc(m, req);
-        if (mem != 0) {
-            void *leader = 0;
-            void *trailer = 0;
-            mchunkptr p = mem2chunk(mem);
-
-            if (PREACTION(m))
-                return 0;
-            if ((((size_t) (mem)) % alignment) != 0) {  /* misaligned */
-                /*
-                   Find an aligned spot inside chunk.  Since we need to give
-                   back leading space in a chunk of at least MIN_CHUNK_SIZE, if
-                   the first calculation places us at a spot with less than
-                   MIN_CHUNK_SIZE leader, we can move to the next aligned spot.
-                   We've allocated enough total room so that this is always
-                   possible.
-                 */
-                char *br = (char *) mem2chunk((size_t) (((size_t) (mem +
-                                                                   alignment -
-                                                                   SIZE_T_ONE))
-                                                        & -alignment));
-                char *pos =
-                    ((size_t) (br - (char *) (p)) >=
-                     MIN_CHUNK_SIZE) ? br : br + alignment;
-                mchunkptr newp = (mchunkptr) pos;
-                size_t leadsize = pos - (char *) (p);
-                size_t newsize = chunksize(p) - leadsize;
-
-                if (is_mmapped(p)) {    /* For mmapped chunks, just adjust offset */
-                    newp->prev_foot = p->prev_foot + leadsize;
-                    newp->head = (newsize | CINUSE_BIT);
-                } else {        /* Otherwise, give back leader, use the rest */
-                    set_inuse(m, newp, newsize);
-                    set_inuse(m, p, leadsize);
-                    leader = chunk2mem(p);
-                }
-                p = newp;
-            }
-
-            /* Give back spare room at the end */
-            if (!is_mmapped(p)) {
-                size_t size = chunksize(p);
-                if (size > nb + MIN_CHUNK_SIZE) {
-                    size_t remainder_size = size - nb;
-                    mchunkptr remainder = chunk_plus_offset(p, nb);
-                    set_inuse(m, p, nb);
-                    set_inuse(m, remainder, remainder_size);
-                    trailer = chunk2mem(remainder);
-                }
-            }
-
-            assert(chunksize(p) >= nb);
-            assert((((size_t) (chunk2mem(p))) % alignment) == 0);
-            check_inuse_chunk(m, p);
-            POSTACTION(m);
-            if (leader != 0) {
-                internal_free(m, leader);
-            }
-            if (trailer != 0) {
-                internal_free(m, trailer);
-            }
-            return chunk2mem(p);
-        }
-    }
-    return 0;
-}
-
-/* ------------------------ comalloc/coalloc support --------------------- */
-
-static void **
-ialloc(mstate m, size_t n_elements, size_t * sizes, int opts, void *chunks[])
-{
-    /*
-       This provides common support for independent_X routines, handling
-       all of the combinations that can result.
-
-       The opts arg has:
-       bit 0 set if all elements are same size (using sizes[0])
-       bit 1 set if elements should be zeroed
-     */
-
-    size_t element_size;        /* chunksize of each element, if all same */
-    size_t contents_size;       /* total size of elements */
-    size_t array_size;          /* request size of pointer array */
-    void *mem;                  /* malloced aggregate space */
-    mchunkptr p;                /* corresponding chunk */
-    size_t remainder_size;      /* remaining bytes while splitting */
-    void **marray;              /* either "chunks" or malloced ptr array */
-    mchunkptr array_chunk;      /* chunk for malloced ptr array */
-    flag_t was_enabled;         /* to disable mmap */
-    size_t size;
-    size_t i;
-
-    /* compute array length, if needed */
-    if (chunks != 0) {
-        if (n_elements == 0)
-            return chunks;      /* nothing to do */
-        marray = chunks;
-        array_size = 0;
-    } else {
-        /* if empty req, must still return chunk representing empty array */
-        if (n_elements == 0)
-            return (void **) internal_malloc(m, 0);
-        marray = 0;
-        array_size = request2size(n_elements * (sizeof(void *)));
-    }
-
-    /* compute total element size */
-    if (opts & 0x1) {           /* all-same-size */
-        element_size = request2size(*sizes);
-        contents_size = n_elements * element_size;
-    } else {                    /* add up all the sizes */
-        element_size = 0;
-        contents_size = 0;
-        for (i = 0; i != n_elements; ++i)
-            contents_size += request2size(sizes[i]);
-    }
-
-    size = contents_size + array_size;
-
-    /*
-       Allocate the aggregate chunk.  First disable direct-mmapping so
-       malloc won't use it, since we would not be able to later
-       free/realloc space internal to a segregated mmap region.
-     */
-    was_enabled = use_mmap(m);
-    disable_mmap(m);
-    mem = internal_malloc(m, size - CHUNK_OVERHEAD);
-    if (was_enabled)
-        enable_mmap(m);
-    if (mem == 0)
-        return 0;
-
-    if (PREACTION(m))
-        return 0;
-    p = mem2chunk(mem);
-    remainder_size = chunksize(p);
-
-    assert(!is_mmapped(p));
-
-    if (opts & 0x2) {           /* optionally clear the elements */
-        memset((size_t *) mem, 0, remainder_size - SIZE_T_SIZE - array_size);
-    }
-
-    /* If not provided, allocate the pointer array as final part of chunk */
-    if (marray == 0) {
-        size_t array_chunk_size;
-        array_chunk = chunk_plus_offset(p, contents_size);
-        array_chunk_size = remainder_size - contents_size;
-        marray = (void **) (chunk2mem(array_chunk));
-        set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size);
-        remainder_size = contents_size;
-    }
-
-    /* split out elements */
-    for (i = 0;; ++i) {
-        marray[i] = chunk2mem(p);
-        if (i != n_elements - 1) {
-            if (element_size != 0)
-                size = element_size;
-            else
-                size = request2size(sizes[i]);
-            remainder_size -= size;
-            set_size_and_pinuse_of_inuse_chunk(m, p, size);
-            p = chunk_plus_offset(p, size);
-        } else {                /* the final element absorbs any overallocation slop */
-            set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size);
-            break;
-        }
-    }
-
-#if DEBUG
-    if (marray != chunks) {
-        /* final element must have exactly exhausted chunk */
-        if (element_size != 0) {
-            assert(remainder_size == element_size);
-        } else {
-            assert(remainder_size == request2size(sizes[i]));
-        }
-        check_inuse_chunk(m, mem2chunk(marray));
-    }
-    for (i = 0; i != n_elements; ++i)
-        check_inuse_chunk(m, mem2chunk(marray[i]));
-
-#endif /* DEBUG */
-
-    POSTACTION(m);
-    return marray;
-}
-
-
-/* -------------------------- public routines ---------------------------- */
-
-#if !ONLY_MSPACES
-
-void *
-dlmalloc(size_t bytes)
-{
-    /*
-       Basic algorithm:
-       If a small request (< 256 bytes minus per-chunk overhead):
-       1. If one exists, use a remainderless chunk in associated smallbin.
-       (Remainderless means that there are too few excess bytes to
-       represent as a chunk.)
-       2. If it is big enough, use the dv chunk, which is normally the
-       chunk adjacent to the one used for the most recent small request.
-       3. If one exists, split the smallest available chunk in a bin,
-       saving remainder in dv.
-       4. If it is big enough, use the top chunk.
-       5. If available, get memory from system and use it
-       Otherwise, for a large request:
-       1. Find the smallest available binned chunk that fits, and use it
-       if it is better fitting than dv chunk, splitting if necessary.
-       2. If better fitting than any binned chunk, use the dv chunk.
-       3. If it is big enough, use the top chunk.
-       4. If request size >= mmap threshold, try to directly mmap this chunk.
-       5. If available, get memory from system and use it
-
-       The ugly goto's here ensure that postaction occurs along all paths.
-     */
-
-    if (!PREACTION(gm)) {
-        void *mem;
-        size_t nb;
-        if (bytes <= MAX_SMALL_REQUEST) {
-            bindex_t idx;
-            binmap_t smallbits;
-            nb = (bytes < MIN_REQUEST) ? MIN_CHUNK_SIZE : pad_request(bytes);
-            idx = small_index(nb);
-            smallbits = gm->smallmap >> idx;
-
-            if ((smallbits & 0x3U) != 0) {      /* Remainderless fit to a smallbin. */
-                mchunkptr b, p;
-                idx += ~smallbits & 1;  /* Uses next bin if idx empty */
-                b = smallbin_at(gm, idx);
-                p = b->fd;
-                assert(chunksize(p) == small_index2size(idx));
-                unlink_first_small_chunk(gm, b, p, idx);
-                set_inuse_and_pinuse(gm, p, small_index2size(idx));
-                mem = chunk2mem(p);
-                check_malloced_chunk(gm, mem, nb);
-                goto postaction;
-            }
-
-            else if (nb > gm->dvsize) {
-                if (smallbits != 0) {   /* Use chunk in next nonempty smallbin */
-                    mchunkptr b, p, r;
-                    size_t rsize;
-                    bindex_t i;
-                    binmap_t leftbits =
-                        (smallbits << idx) & left_bits(idx2bit(idx));
-                    binmap_t leastbit = least_bit(leftbits);
-                    compute_bit2idx(leastbit, i);
-                    b = smallbin_at(gm, i);
-                    p = b->fd;
-                    assert(chunksize(p) == small_index2size(i));
-                    unlink_first_small_chunk(gm, b, p, i);
-                    rsize = small_index2size(i) - nb;
-                    /* Fit here cannot be remainderless if 4byte sizes */
-                    if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
-                        set_inuse_and_pinuse(gm, p, small_index2size(i));
-                    else {
-                        set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
-                        r = chunk_plus_offset(p, nb);
-                        set_size_and_pinuse_of_free_chunk(r, rsize);
-                        replace_dv(gm, r, rsize);
-                    }
-                    mem = chunk2mem(p);
-                    check_malloced_chunk(gm, mem, nb);
-                    goto postaction;
-                }
-
-                else if (gm->treemap != 0
-                         && (mem = tmalloc_small(gm, nb)) != 0) {
-                    check_malloced_chunk(gm, mem, nb);
-                    goto postaction;
-                }
-            }
-        } else if (bytes >= MAX_REQUEST)
-            nb = MAX_SIZE_T;    /* Too big to allocate. Force failure (in sys alloc) */
-        else {
-            nb = pad_request(bytes);
-            if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) {
-                check_malloced_chunk(gm, mem, nb);
-                goto postaction;
-            }
-        }
-
-        if (nb <= gm->dvsize) {
-            size_t rsize = gm->dvsize - nb;
-            mchunkptr p = gm->dv;
-            if (rsize >= MIN_CHUNK_SIZE) {      /* split dv */
-                mchunkptr r = gm->dv = chunk_plus_offset(p, nb);
-                gm->dvsize = rsize;
-                set_size_and_pinuse_of_free_chunk(r, rsize);
-                set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
-            } else {            /* exhaust dv */
-                size_t dvs = gm->dvsize;
-                gm->dvsize = 0;
-                gm->dv = 0;
-                set_inuse_and_pinuse(gm, p, dvs);
-            }
-            mem = chunk2mem(p);
-            check_malloced_chunk(gm, mem, nb);
-            goto postaction;
-        }
-
-        else if (nb < gm->topsize) {    /* Split top */
-            size_t rsize = gm->topsize -= nb;
-            mchunkptr p = gm->top;
-            mchunkptr r = gm->top = chunk_plus_offset(p, nb);
-            r->head = rsize | PINUSE_BIT;
-            set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
-            mem = chunk2mem(p);
-            check_top_chunk(gm, gm->top);
-            check_malloced_chunk(gm, mem, nb);
-            goto postaction;
-        }
-
-        mem = sys_alloc(gm, nb);
-
-      postaction:
-        POSTACTION(gm);
-        return mem;
-    }
-
-    return 0;
-}
-
-void
-dlfree(void *mem)
-{
-    /*
-       Consolidate freed chunks with preceeding or succeeding bordering
-       free chunks, if they exist, and then place in a bin.  Intermixed
-       with special cases for top, dv, mmapped chunks, and usage errors.
-     */
-
-    if (mem != 0) {
-        mchunkptr p = mem2chunk(mem);
-#if FOOTERS
-        mstate fm = get_mstate_for(p);
-        if (!ok_magic(fm)) {
-            USAGE_ERROR_ACTION(fm, p);
-            return;
-        }
-#else /* FOOTERS */
-#define fm gm
-#endif /* FOOTERS */
-        if (!PREACTION(fm)) {
-            check_inuse_chunk(fm, p);
-            if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
-                size_t psize = chunksize(p);
-                mchunkptr next = chunk_plus_offset(p, psize);
-                if (!pinuse(p)) {
-                    size_t prevsize = p->prev_foot;
-                    if ((prevsize & IS_MMAPPED_BIT) != 0) {
-                        prevsize &= ~IS_MMAPPED_BIT;
-                        psize += prevsize + MMAP_FOOT_PAD;
-                        if (CALL_MUNMAP((char *) p - prevsize, psize) == 0)
-                            fm->footprint -= psize;
-                        goto postaction;
-                    } else {
-                        mchunkptr prev = chunk_minus_offset(p, prevsize);
-                        psize += prevsize;
-                        p = prev;
-                        if (RTCHECK(ok_address(fm, prev))) {    /* consolidate backward */
-                            if (p != fm->dv) {
-                                unlink_chunk(fm, p, prevsize);
-                            } else if ((next->head & INUSE_BITS) ==
-                                       INUSE_BITS) {
-                                fm->dvsize = psize;
-                                set_free_with_pinuse(p, psize, next);
-                                goto postaction;
-                            }
-                        } else
-                            goto erroraction;
-                    }
-                }
-
-                if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
-                    if (!cinuse(next)) {        /* consolidate forward */
-                        if (next == fm->top) {
-                            size_t tsize = fm->topsize += psize;
-                            fm->top = p;
-                            p->head = tsize | PINUSE_BIT;
-                            if (p == fm->dv) {
-                                fm->dv = 0;
-                                fm->dvsize = 0;
-                            }
-                            if (should_trim(fm, tsize))
-                                sys_trim(fm, 0);
-                            goto postaction;
-                        } else if (next == fm->dv) {
-                            size_t dsize = fm->dvsize += psize;
-                            fm->dv = p;
-                            set_size_and_pinuse_of_free_chunk(p, dsize);
-                            goto postaction;
-                        } else {
-                            size_t nsize = chunksize(next);
-                            psize += nsize;
-                            unlink_chunk(fm, next, nsize);
-                            set_size_and_pinuse_of_free_chunk(p, psize);
-                            if (p == fm->dv) {
-                                fm->dvsize = psize;
-                                goto postaction;
-                            }
-                        }
-                    } else
-                        set_free_with_pinuse(p, psize, next);
-                    insert_chunk(fm, p, psize);
-                    check_free_chunk(fm, p);
-                    goto postaction;
-                }
-            }
-          erroraction:
-            USAGE_ERROR_ACTION(fm, p);
-          postaction:
-            POSTACTION(fm);
-        }
-    }
-#if !FOOTERS
-#undef fm
-#endif /* FOOTERS */
-}
-
-void *
-dlcalloc(size_t n_elements, size_t elem_size)
-{
-    void *mem;
-    size_t req = 0;
-    if (n_elements != 0) {
-        req = n_elements * elem_size;
-        if (((n_elements | elem_size) & ~(size_t) 0xffff) &&
-            (req / n_elements != elem_size))
-            req = MAX_SIZE_T;   /* force downstream failure on overflow */
-    }
-    mem = dlmalloc(req);
-    if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
-        memset(mem, 0, req);
-    return mem;
-}
-
-void *
-dlrealloc(void *oldmem, size_t bytes)
-{
-    if (oldmem == 0)
-        return dlmalloc(bytes);
-#ifdef REALLOC_ZERO_BYTES_FREES
-    if (bytes == 0) {
-        dlfree(oldmem);
-        return 0;
-    }
-#endif /* REALLOC_ZERO_BYTES_FREES */
-    else {
-#if ! FOOTERS
-        mstate m = gm;
-#else /* FOOTERS */
-        mstate m = get_mstate_for(mem2chunk(oldmem));
-        if (!ok_magic(m)) {
-            USAGE_ERROR_ACTION(m, oldmem);
-            return 0;
-        }
-#endif /* FOOTERS */
-        return internal_realloc(m, oldmem, bytes);
-    }
-}
-
-void *
-dlmemalign(size_t alignment, size_t bytes)
-{
-    return internal_memalign(gm, alignment, bytes);
-}
-
-void **
-dlindependent_calloc(size_t n_elements, size_t elem_size, void *chunks[])
-{
-    size_t sz = elem_size;      /* serves as 1-element array */
-    return ialloc(gm, n_elements, &sz, 3, chunks);
-}
-
-void **
-dlindependent_comalloc(size_t n_elements, size_t sizes[], void *chunks[])
-{
-    return ialloc(gm, n_elements, sizes, 0, chunks);
-}
-
-void *
-dlvalloc(size_t bytes)
-{
-    size_t pagesz;
-    init_mparams();
-    pagesz = mparams.page_size;
-    return dlmemalign(pagesz, bytes);
-}
-
-void *
-dlpvalloc(size_t bytes)
-{
-    size_t pagesz;
-    init_mparams();
-    pagesz = mparams.page_size;
-    return dlmemalign(pagesz,
-                      (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE));
-}
-
-int
-dlmalloc_trim(size_t pad)
-{
-    int result = 0;
-    if (!PREACTION(gm)) {
-        result = sys_trim(gm, pad);
-        POSTACTION(gm);
-    }
-    return result;
-}
-
-size_t
-dlmalloc_footprint(void)
-{
-    return gm->footprint;
-}
-
-size_t
-dlmalloc_max_footprint(void)
-{
-    return gm->max_footprint;
-}
-
-#if !NO_MALLINFO
-struct mallinfo
-dlmallinfo(void)
-{
-    return internal_mallinfo(gm);
-}
-#endif /* NO_MALLINFO */
-
-void
-dlmalloc_stats()
-{
-    internal_malloc_stats(gm);
-}
-
-size_t
-dlmalloc_usable_size(void *mem)
-{
-    if (mem != 0) {
-        mchunkptr p = mem2chunk(mem);
-        if (cinuse(p))
-            return chunksize(p) - overhead_for(p);
-    }
-    return 0;
-}
-
-int
-dlmallopt(int param_number, int value)
-{
-    return change_mparam(param_number, value);
-}
-
-#endif /* !ONLY_MSPACES */
-
-/* ----------------------------- user mspaces ---------------------------- */
-
-#if MSPACES
-
-static mstate
-init_user_mstate(char *tbase, size_t tsize)
-{
-    size_t msize = pad_request(sizeof(struct malloc_state));
-    mchunkptr mn;
-    mchunkptr msp = align_as_chunk(tbase);
-    mstate m = (mstate) (chunk2mem(msp));
-    memset(m, 0, msize);
-    INITIAL_LOCK(&m->mutex);
-    msp->head = (msize | PINUSE_BIT | CINUSE_BIT);
-    m->seg.base = m->least_addr = tbase;
-    m->seg.size = m->footprint = m->max_footprint = tsize;
-    m->magic = mparams.magic;
-    m->mflags = mparams.default_mflags;
-    disable_contiguous(m);
-    init_bins(m);
-    mn = next_chunk(mem2chunk(m));
-    init_top(m, mn, (size_t) ((tbase + tsize) - (char *) mn) - TOP_FOOT_SIZE);
-    check_top_chunk(m, m->top);
-    return m;
-}
-
-mspace
-create_mspace(size_t capacity, int locked)
-{
-    mstate m = 0;
-    size_t msize = pad_request(sizeof(struct malloc_state));
-    init_mparams();             /* Ensure pagesize etc initialized */
-
-    if (capacity < (size_t) - (msize + TOP_FOOT_SIZE + mparams.page_size)) {
-        size_t rs = ((capacity == 0) ? mparams.granularity :
-                     (capacity + TOP_FOOT_SIZE + msize));
-        size_t tsize = granularity_align(rs);
-        char *tbase = (char *) (CALL_MMAP(tsize));
-        if (tbase != CMFAIL) {
-            m = init_user_mstate(tbase, tsize);
-            m->seg.sflags = IS_MMAPPED_BIT;
-            set_lock(m, locked);
-        }
-    }
-    return (mspace) m;
-}
-
-mspace
-create_mspace_with_base(void *base, size_t capacity, int locked)
-{
-    mstate m = 0;
-    size_t msize = pad_request(sizeof(struct malloc_state));
-    init_mparams();             /* Ensure pagesize etc initialized */
-
-    if (capacity > msize + TOP_FOOT_SIZE &&
-        capacity < (size_t) - (msize + TOP_FOOT_SIZE + mparams.page_size)) {
-        m = init_user_mstate((char *) base, capacity);
-        m->seg.sflags = EXTERN_BIT;
-        set_lock(m, locked);
-    }
-    return (mspace) m;
-}
-
-size_t
-destroy_mspace(mspace msp)
-{
-    size_t freed = 0;
-    mstate ms = (mstate) msp;
-    if (ok_magic(ms)) {
-        msegmentptr sp = &ms->seg;
-        while (sp != 0) {
-            char *base = sp->base;
-            size_t size = sp->size;
-            flag_t flag = sp->sflags;
-            sp = sp->next;
-            if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) &&
-                CALL_MUNMAP(base, size) == 0)
-                freed += size;
-        }
-    } else {
-        USAGE_ERROR_ACTION(ms, ms);
-    }
-    return freed;
-}
-
-/*
-  mspace versions of routines are near-clones of the global
-  versions. This is not so nice but better than the alternatives.
-*/
-
-
-void *
-mspace_malloc(mspace msp, size_t bytes)
-{
-    mstate ms = (mstate) msp;
-    if (!ok_magic(ms)) {
-        USAGE_ERROR_ACTION(ms, ms);
-        return 0;
-    }
-    if (!PREACTION(ms)) {
-        void *mem;
-        size_t nb;
-        if (bytes <= MAX_SMALL_REQUEST) {
-            bindex_t idx;
-            binmap_t smallbits;
-            nb = (bytes < MIN_REQUEST) ? MIN_CHUNK_SIZE : pad_request(bytes);
-            idx = small_index(nb);
-            smallbits = ms->smallmap >> idx;
-
-            if ((smallbits & 0x3U) != 0) {      /* Remainderless fit to a smallbin. */
-                mchunkptr b, p;
-                idx += ~smallbits & 1;  /* Uses next bin if idx empty */
-                b = smallbin_at(ms, idx);
-                p = b->fd;
-                assert(chunksize(p) == small_index2size(idx));
-                unlink_first_small_chunk(ms, b, p, idx);
-                set_inuse_and_pinuse(ms, p, small_index2size(idx));
-                mem = chunk2mem(p);
-                check_malloced_chunk(ms, mem, nb);
-                goto postaction;
-            }
-
-            else if (nb > ms->dvsize) {
-                if (smallbits != 0) {   /* Use chunk in next nonempty smallbin */
-                    mchunkptr b, p, r;
-                    size_t rsize;
-                    bindex_t i;
-                    binmap_t leftbits =
-                        (smallbits << idx) & left_bits(idx2bit(idx));
-                    binmap_t leastbit = least_bit(leftbits);
-                    compute_bit2idx(leastbit, i);
-                    b = smallbin_at(ms, i);
-                    p = b->fd;
-                    assert(chunksize(p) == small_index2size(i));
-                    unlink_first_small_chunk(ms, b, p, i);
-                    rsize = small_index2size(i) - nb;
-                    /* Fit here cannot be remainderless if 4byte sizes */
-                    if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
-                        set_inuse_and_pinuse(ms, p, small_index2size(i));
-                    else {
-                        set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
-                        r = chunk_plus_offset(p, nb);
-                        set_size_and_pinuse_of_free_chunk(r, rsize);
-                        replace_dv(ms, r, rsize);
-                    }
-                    mem = chunk2mem(p);
-                    check_malloced_chunk(ms, mem, nb);
-                    goto postaction;
-                }
-
-                else if (ms->treemap != 0
-                         && (mem = tmalloc_small(ms, nb)) != 0) {
-                    check_malloced_chunk(ms, mem, nb);
-                    goto postaction;
-                }
-            }
-        } else if (bytes >= MAX_REQUEST)
-            nb = MAX_SIZE_T;    /* Too big to allocate. Force failure (in sys alloc) */
-        else {
-            nb = pad_request(bytes);
-            if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) {
-                check_malloced_chunk(ms, mem, nb);
-                goto postaction;
-            }
-        }
-
-        if (nb <= ms->dvsize) {
-            size_t rsize = ms->dvsize - nb;
-            mchunkptr p = ms->dv;
-            if (rsize >= MIN_CHUNK_SIZE) {      /* split dv */
-                mchunkptr r = ms->dv = chunk_plus_offset(p, nb);
-                ms->dvsize = rsize;
-                set_size_and_pinuse_of_free_chunk(r, rsize);
-                set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
-            } else {            /* exhaust dv */
-                size_t dvs = ms->dvsize;
-                ms->dvsize = 0;
-                ms->dv = 0;
-                set_inuse_and_pinuse(ms, p, dvs);
-            }
-            mem = chunk2mem(p);
-            check_malloced_chunk(ms, mem, nb);
-            goto postaction;
-        }
-
-        else if (nb < ms->topsize) {    /* Split top */
-            size_t rsize = ms->topsize -= nb;
-            mchunkptr p = ms->top;
-            mchunkptr r = ms->top = chunk_plus_offset(p, nb);
-            r->head = rsize | PINUSE_BIT;
-            set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
-            mem = chunk2mem(p);
-            check_top_chunk(ms, ms->top);
-            check_malloced_chunk(ms, mem, nb);
-            goto postaction;
-        }
-
-        mem = sys_alloc(ms, nb);
-
-      postaction:
-        POSTACTION(ms);
-        return mem;
-    }
-
-    return 0;
-}
-
-void
-mspace_free(mspace msp, void *mem)
-{
-    if (mem != 0) {
-        mchunkptr p = mem2chunk(mem);
-#if FOOTERS
-        mstate fm = get_mstate_for(p);
-#else /* FOOTERS */
-        mstate fm = (mstate) msp;
-#endif /* FOOTERS */
-        if (!ok_magic(fm)) {
-            USAGE_ERROR_ACTION(fm, p);
-            return;
-        }
-        if (!PREACTION(fm)) {
-            check_inuse_chunk(fm, p);
-            if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
-                size_t psize = chunksize(p);
-                mchunkptr next = chunk_plus_offset(p, psize);
-                if (!pinuse(p)) {
-                    size_t prevsize = p->prev_foot;
-                    if ((prevsize & IS_MMAPPED_BIT) != 0) {
-                        prevsize &= ~IS_MMAPPED_BIT;
-                        psize += prevsize + MMAP_FOOT_PAD;
-                        if (CALL_MUNMAP((char *) p - prevsize, psize) == 0)
-                            fm->footprint -= psize;
-                        goto postaction;
-                    } else {
-                        mchunkptr prev = chunk_minus_offset(p, prevsize);
-                        psize += prevsize;
-                        p = prev;
-                        if (RTCHECK(ok_address(fm, prev))) {    /* consolidate backward */
-                            if (p != fm->dv) {
-                                unlink_chunk(fm, p, prevsize);
-                            } else if ((next->head & INUSE_BITS) ==
-                                       INUSE_BITS) {
-                                fm->dvsize = psize;
-                                set_free_with_pinuse(p, psize, next);
-                                goto postaction;
-                            }
-                        } else
-                            goto erroraction;
-                    }
-                }
-
-                if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
-                    if (!cinuse(next)) {        /* consolidate forward */
-                        if (next == fm->top) {
-                            size_t tsize = fm->topsize += psize;
-                            fm->top = p;
-                            p->head = tsize | PINUSE_BIT;
-                            if (p == fm->dv) {
-                                fm->dv = 0;
-                                fm->dvsize = 0;
-                            }
-                            if (should_trim(fm, tsize))
-                                sys_trim(fm, 0);
-                            goto postaction;
-                        } else if (next == fm->dv) {
-                            size_t dsize = fm->dvsize += psize;
-                            fm->dv = p;
-                            set_size_and_pinuse_of_free_chunk(p, dsize);
-                            goto postaction;
-                        } else {
-                            size_t nsize = chunksize(next);
-                            psize += nsize;
-                            unlink_chunk(fm, next, nsize);
-                            set_size_and_pinuse_of_free_chunk(p, psize);
-                            if (p == fm->dv) {
-                                fm->dvsize = psize;
-                                goto postaction;
-                            }
-                        }
-                    } else
-                        set_free_with_pinuse(p, psize, next);
-                    insert_chunk(fm, p, psize);
-                    check_free_chunk(fm, p);
-                    goto postaction;
-                }
-            }
-          erroraction:
-            USAGE_ERROR_ACTION(fm, p);
-          postaction:
-            POSTACTION(fm);
-        }
-    }
-}
-
-void *
-mspace_calloc(mspace msp, size_t n_elements, size_t elem_size)
-{
-    void *mem;
-    size_t req = 0;
-    mstate ms = (mstate) msp;
-    if (!ok_magic(ms)) {
-        USAGE_ERROR_ACTION(ms, ms);
-        return 0;
-    }
-    if (n_elements != 0) {
-        req = n_elements * elem_size;
-        if (((n_elements | elem_size) & ~(size_t) 0xffff) &&
-            (req / n_elements != elem_size))
-            req = MAX_SIZE_T;   /* force downstream failure on overflow */
-    }
-    mem = internal_malloc(ms, req);
-    if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
-        memset(mem, 0, req);
-    return mem;
-}
-
-void *
-mspace_realloc(mspace msp, void *oldmem, size_t bytes)
-{
-    if (oldmem == 0)
-        return mspace_malloc(msp, bytes);
-#ifdef REALLOC_ZERO_BYTES_FREES
-    if (bytes == 0) {
-        mspace_free(msp, oldmem);
-        return 0;
-    }
-#endif /* REALLOC_ZERO_BYTES_FREES */
-    else {
-#if FOOTERS
-        mchunkptr p = mem2chunk(oldmem);
-        mstate ms = get_mstate_for(p);
-#else /* FOOTERS */
-        mstate ms = (mstate) msp;
-#endif /* FOOTERS */
-        if (!ok_magic(ms)) {
-            USAGE_ERROR_ACTION(ms, ms);
-            return 0;
-        }
-        return internal_realloc(ms, oldmem, bytes);
-    }
-}
-
-void *
-mspace_memalign(mspace msp, size_t alignment, size_t bytes)
-{
-    mstate ms = (mstate) msp;
-    if (!ok_magic(ms)) {
-        USAGE_ERROR_ACTION(ms, ms);
-        return 0;
-    }
-    return internal_memalign(ms, alignment, bytes);
-}
-
-void **
-mspace_independent_calloc(mspace msp, size_t n_elements,
-                          size_t elem_size, void *chunks[])
-{
-    size_t sz = elem_size;      /* serves as 1-element array */
-    mstate ms = (mstate) msp;
-    if (!ok_magic(ms)) {
-        USAGE_ERROR_ACTION(ms, ms);
-        return 0;
-    }
-    return ialloc(ms, n_elements, &sz, 3, chunks);
-}
-
-void **
-mspace_independent_comalloc(mspace msp, size_t n_elements,
-                            size_t sizes[], void *chunks[])
-{
-    mstate ms = (mstate) msp;
-    if (!ok_magic(ms)) {
-        USAGE_ERROR_ACTION(ms, ms);
-        return 0;
-    }
-    return ialloc(ms, n_elements, sizes, 0, chunks);
-}
-
-int
-mspace_trim(mspace msp, size_t pad)
-{
-    int result = 0;
-    mstate ms = (mstate) msp;
-    if (ok_magic(ms)) {
-        if (!PREACTION(ms)) {
-            result = sys_trim(ms, pad);
-            POSTACTION(ms);
-        }
-    } else {
-        USAGE_ERROR_ACTION(ms, ms);
-    }
-    return result;
-}
-
-void
-mspace_malloc_stats(mspace msp)
-{
-    mstate ms = (mstate) msp;
-    if (ok_magic(ms)) {
-        internal_malloc_stats(ms);
-    } else {
-        USAGE_ERROR_ACTION(ms, ms);
-    }
-}
-
-size_t
-mspace_footprint(mspace msp)
-{
-    size_t result;
-    mstate ms = (mstate) msp;
-    if (ok_magic(ms)) {
-        result = ms->footprint;
-    }
-    USAGE_ERROR_ACTION(ms, ms);
-    return result;
-}
-
-
-size_t
-mspace_max_footprint(mspace msp)
-{
-    size_t result;
-    mstate ms = (mstate) msp;
-    if (ok_magic(ms)) {
-        result = ms->max_footprint;
-    }
-    USAGE_ERROR_ACTION(ms, ms);
-    return result;
-}
-
-
-#if !NO_MALLINFO
-struct mallinfo
-mspace_mallinfo(mspace msp)
-{
-    mstate ms = (mstate) msp;
-    if (!ok_magic(ms)) {
-        USAGE_ERROR_ACTION(ms, ms);
-    }
-    return internal_mallinfo(ms);
-}
-#endif /* NO_MALLINFO */
-
-int
-mspace_mallopt(int param_number, int value)
-{
-    return change_mparam(param_number, value);
-}
-
-#endif /* MSPACES */
-
-/* -------------------- Alternative MORECORE functions ------------------- */
-
-/*
-  Guidelines for creating a custom version of MORECORE:
-
-  * For best performance, MORECORE should allocate in multiples of pagesize.
-  * MORECORE may allocate more memory than requested. (Or even less,
-      but this will usually result in a malloc failure.)
-  * MORECORE must not allocate memory when given argument zero, but
-      instead return one past the end address of memory from previous
-      nonzero call.
-  * For best performance, consecutive calls to MORECORE with positive
-      arguments should return increasing addresses, indicating that
-      space has been contiguously extended.
-  * Even though consecutive calls to MORECORE need not return contiguous
-      addresses, it must be OK for malloc'ed chunks to span multiple
-      regions in those cases where they do happen to be contiguous.
-  * MORECORE need not handle negative arguments -- it may instead
-      just return MFAIL when given negative arguments.
-      Negative arguments are always multiples of pagesize. MORECORE
-      must not misinterpret negative args as large positive unsigned
-      args. You can suppress all such calls from even occurring by defining
-      MORECORE_CANNOT_TRIM,
-
-  As an example alternative MORECORE, here is a custom allocator
-  kindly contributed for pre-OSX macOS.  It uses virtually but not
-  necessarily physically contiguous non-paged memory (locked in,
-  present and won't get swapped out).  You can use it by uncommenting
-  this section, adding some #includes, and setting up the appropriate
-  defines above:
-
-      #define MORECORE osMoreCore
-
-  There is also a shutdown routine that should somehow be called for
-  cleanup upon program exit.
-
-  #define MAX_POOL_ENTRIES 100
-  #define MINIMUM_MORECORE_SIZE  (64 * 1024U)
-  static int next_os_pool;
-  void *our_os_pools[MAX_POOL_ENTRIES];
-
-  void *osMoreCore(int size)
-  {
-    void *ptr = 0;
-    static void *sbrk_top = 0;
-
-    if (size > 0)
-    {
-      if (size < MINIMUM_MORECORE_SIZE)
-         size = MINIMUM_MORECORE_SIZE;
-      if (CurrentExecutionLevel() == kTaskLevel)
-         ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0);
-      if (ptr == 0)
-      {
-        return (void *) MFAIL;
-      }
-      // save ptrs so they can be freed during cleanup
-      our_os_pools[next_os_pool] = ptr;
-      next_os_pool++;
-      ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK);
-      sbrk_top = (char *) ptr + size;
-      return ptr;
-    }
-    else if (size < 0)
-    {
-      // we don't currently support shrink behavior
-      return (void *) MFAIL;
-    }
-    else
-    {
-      return sbrk_top;
-    }
-  }
-
-  // cleanup any allocated memory pools
-  // called as last thing before shutting down driver
-
-  void osCleanupMem(void)
-  {
-    void **ptr;
-
-    for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++)
-      if (*ptr)
-      {
-         PoolDeallocate(*ptr);
-         *ptr = 0;
-      }
-  }
-
-*/
-
-
-/* -----------------------------------------------------------------------
-History:
-    V2.8.3 Thu Sep 22 11:16:32 2005  Doug Lea  (dl at gee)
-      * Add max_footprint functions
-      * Ensure all appropriate literals are size_t
-      * Fix conditional compilation problem for some #define settings
-      * Avoid concatenating segments with the one provided
-        in create_mspace_with_base
-      * Rename some variables to avoid compiler shadowing warnings
-      * Use explicit lock initialization.
-      * Better handling of sbrk interference.
-      * Simplify and fix segment insertion, trimming and mspace_destroy
-      * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x
-      * Thanks especially to Dennis Flanagan for help on these.
-
-    V2.8.2 Sun Jun 12 16:01:10 2005  Doug Lea  (dl at gee)
-      * Fix memalign brace error.
-
-    V2.8.1 Wed Jun  8 16:11:46 2005  Doug Lea  (dl at gee)
-      * Fix improper #endif nesting in C++
-      * Add explicit casts needed for C++
-
-    V2.8.0 Mon May 30 14:09:02 2005  Doug Lea  (dl at gee)
-      * Use trees for large bins
-      * Support mspaces
-      * Use segments to unify sbrk-based and mmap-based system allocation,
-        removing need for emulation on most platforms without sbrk.
-      * Default safety checks
-      * Optional footer checks. Thanks to William Robertson for the idea.
-      * Internal code refactoring
-      * Incorporate suggestions and platform-specific changes.
-        Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas,
-        Aaron Bachmann,  Emery Berger, and others.
-      * Speed up non-fastbin processing enough to remove fastbins.
-      * Remove useless cfree() to avoid conflicts with other apps.
-      * Remove internal memcpy, memset. Compilers handle builtins better.
-      * Remove some options that no one ever used and rename others.
-
-    V2.7.2 Sat Aug 17 09:07:30 2002  Doug Lea  (dl at gee)
-      * Fix malloc_state bitmap array misdeclaration
-
-    V2.7.1 Thu Jul 25 10:58:03 2002  Doug Lea  (dl at gee)
-      * Allow tuning of FIRST_SORTED_BIN_SIZE
-      * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.
-      * Better detection and support for non-contiguousness of MORECORE.
-        Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger
-      * Bypass most of malloc if no frees. Thanks To Emery Berger.
-      * Fix freeing of old top non-contiguous chunk im sysmalloc.
-      * Raised default trim and map thresholds to 256K.
-      * Fix mmap-related #defines. Thanks to Lubos Lunak.
-      * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield.
-      * Branch-free bin calculation
-      * Default trim and mmap thresholds now 256K.
-
-    V2.7.0 Sun Mar 11 14:14:06 2001  Doug Lea  (dl at gee)
-      * Introduce independent_comalloc and independent_calloc.
-        Thanks to Michael Pachos for motivation and help.
-      * Make optional .h file available
-      * Allow > 2GB requests on 32bit systems.
-      * new WIN32 sbrk, mmap, munmap, lock code from <Walter at GeNeSys-e.de>.
-        Thanks also to Andreas Mueller <a.mueller at paradatec.de>,
-        and Anonymous.
-      * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for
-        helping test this.)
-      * memalign: check alignment arg
-      * realloc: don't try to shift chunks backwards, since this
-        leads to  more fragmentation in some programs and doesn't
-        seem to help in any others.
-      * Collect all cases in malloc requiring system memory into sysmalloc
-      * Use mmap as backup to sbrk
-      * Place all internal state in malloc_state
-      * Introduce fastbins (although similar to 2.5.1)
-      * Many minor tunings and cosmetic improvements
-      * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK
-      * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS
-        Thanks to Tony E. Bennett <tbennett at nvidia.com> and others.
-      * Include errno.h to support default failure action.
-
-    V2.6.6 Sun Dec  5 07:42:19 1999  Doug Lea  (dl at gee)
-      * return null for negative arguments
-      * Added Several WIN32 cleanups from Martin C. Fong <mcfong at yahoo.com>
-         * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h'
-          (e.g. WIN32 platforms)
-         * Cleanup header file inclusion for WIN32 platforms
-         * Cleanup code to avoid Microsoft Visual C++ compiler complaints
-         * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing
-           memory allocation routines
-         * Set 'malloc_getpagesize' for WIN32 platforms (needs more work)
-         * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to
-           usage of 'assert' in non-WIN32 code
-         * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to
-           avoid infinite loop
-      * Always call 'fREe()' rather than 'free()'
-
-    V2.6.5 Wed Jun 17 15:57:31 1998  Doug Lea  (dl at gee)
-      * Fixed ordering problem with boundary-stamping
-
-    V2.6.3 Sun May 19 08:17:58 1996  Doug Lea  (dl at gee)
-      * Added pvalloc, as recommended by H.J. Liu
-      * Added 64bit pointer support mainly from Wolfram Gloger
-      * Added anonymously donated WIN32 sbrk emulation
-      * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen
-      * malloc_extend_top: fix mask error that caused wastage after
-        foreign sbrks
-      * Add linux mremap support code from HJ Liu
-
-    V2.6.2 Tue Dec  5 06:52:55 1995  Doug Lea  (dl at gee)
-      * Integrated most documentation with the code.
-      * Add support for mmap, with help from
-        Wolfram Gloger (Gloger at lrz.uni-muenchen.de).
-      * Use last_remainder in more cases.
-      * Pack bins using idea from  colin at nyx10.cs.du.edu
-      * Use ordered bins instead of best-fit threshhold
-      * Eliminate block-local decls to simplify tracing and debugging.
-      * Support another case of realloc via move into top
-      * Fix error occuring when initial sbrk_base not word-aligned.
-      * Rely on page size for units instead of SBRK_UNIT to
-        avoid surprises about sbrk alignment conventions.
-      * Add mallinfo, mallopt. Thanks to Raymond Nijssen
-        (raymond at es.ele.tue.nl) for the suggestion.
-      * Add `pad' argument to malloc_trim and top_pad mallopt parameter.
-      * More precautions for cases where other routines call sbrk,
-        courtesy of Wolfram Gloger (Gloger at lrz.uni-muenchen.de).
-      * Added macros etc., allowing use in linux libc from
-        H.J. Lu (hjl at gnu.ai.mit.edu)
-      * Inverted this history list
-
-    V2.6.1 Sat Dec  2 14:10:57 1995  Doug Lea  (dl at gee)
-      * Re-tuned and fixed to behave more nicely with V2.6.0 changes.
-      * Removed all preallocation code since under current scheme
-        the work required to undo bad preallocations exceeds
-        the work saved in good cases for most test programs.
-      * No longer use return list or unconsolidated bins since
-        no scheme using them consistently outperforms those that don't
-        given above changes.
-      * Use best fit for very large chunks to prevent some worst-cases.
-      * Added some support for debugging
-
-    V2.6.0 Sat Nov  4 07:05:23 1995  Doug Lea  (dl at gee)
-      * Removed footers when chunks are in use. Thanks to
-        Paul Wilson (wilson at cs.texas.edu) for the suggestion.
-
-    V2.5.4 Wed Nov  1 07:54:51 1995  Doug Lea  (dl at gee)
-      * Added malloc_trim, with help from Wolfram Gloger
-        (wmglo at Dent.MED.Uni-Muenchen.DE).
-
-    V2.5.3 Tue Apr 26 10:16:01 1994  Doug Lea  (dl at g)
-
-    V2.5.2 Tue Apr  5 16:20:40 1994  Doug Lea  (dl at g)
-      * realloc: try to expand in both directions
-      * malloc: swap order of clean-bin strategy;
-      * realloc: only conditionally expand backwards
-      * Try not to scavenge used bins
-      * Use bin counts as a guide to preallocation
-      * Occasionally bin return list chunks in first scan
-      * Add a few optimizations from colin at nyx10.cs.du.edu
-
-    V2.5.1 Sat Aug 14 15:40:43 1993  Doug Lea  (dl at g)
-      * faster bin computation & slightly different binning
-      * merged all consolidations to one part of malloc proper
-         (eliminating old malloc_find_space & malloc_clean_bin)
-      * Scan 2 returns chunks (not just 1)
-      * Propagate failure in realloc if malloc returns 0
-      * Add stuff to allow compilation on non-ANSI compilers
-          from kpv at research.att.com
-
-    V2.5 Sat Aug  7 07:41:59 1993  Doug Lea  (dl at g.oswego.edu)
-      * removed potential for odd address access in prev_chunk
-      * removed dependency on getpagesize.h
-      * misc cosmetics and a bit more internal documentation
-      * anticosmetics: mangled names in macros to evade debugger strangeness
-      * tested on sparc, hp-700, dec-mips, rs6000
-          with gcc & native cc (hp, dec only) allowing
-          Detlefs & Zorn comparison study (in SIGPLAN Notices.)
-
-    Trial version Fri Aug 28 13:14:29 1992  Doug Lea  (dl at g.oswego.edu)
-      * Based loosely on libg++-1.2X malloc. (It retains some of the overall
-         structure of old version,  but most details differ.)
-
-*/
-
-#endif /* !HAVE_MALLOC */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/stdlib/SDL_qsort.c b/deps/SDL2/src/stdlib/SDL_qsort.c
deleted file mode 100644
index 0130d5a..0000000
--- a/deps/SDL2/src/stdlib/SDL_qsort.c
+++ /dev/null
@@ -1,476 +0,0 @@
-/* qsort.c
- * (c) 1998 Gareth McCaughan
- *
- * This is a drop-in replacement for the C library's |qsort()| routine.
- *
- * Features:
- *   - Median-of-three pivoting (and more)
- *   - Truncation and final polishing by a single insertion sort
- *   - Early truncation when no swaps needed in pivoting step
- *   - Explicit recursion, guaranteed not to overflow
- *   - A few little wrinkles stolen from the GNU |qsort()|.
- *   - separate code for non-aligned / aligned / word-size objects
- *
- * This code may be reproduced freely provided
- *   - this file is retained unaltered apart from minor
- *     changes for portability and efficiency
- *   - no changes are made to this comment
- *   - any changes that *are* made are clearly flagged
- *   - the _ID string below is altered by inserting, after
- *     the date, the string " altered" followed at your option
- *     by other material. (Exceptions: you may change the name
- *     of the exported routine without changing the ID string.
- *     You may change the values of the macros TRUNC_* and
- *     PIVOT_THRESHOLD without changing the ID string, provided
- *     they remain constants with TRUNC_nonaligned, TRUNC_aligned
- *     and TRUNC_words/WORD_BYTES between 8 and 24, and
- *     PIVOT_THRESHOLD between 32 and 200.)
- *
- * You may use it in anything you like; you may make money
- * out of it; you may distribute it in object form or as
- * part of an executable without including source code;
- * you don't have to credit me. (But it would be nice if
- * you did.)
- *
- * If you find problems with this code, or find ways of
- * making it significantly faster, please let me know!
- * My e-mail address, valid as of early 1998 and certainly
- * OK for at least the next 18 months, is
- *    gjm11 at dpmms.cam.ac.uk
- * Thanks!
- *
- * Gareth McCaughan   Peterhouse   Cambridge   1998
- */
-#include "SDL_config.h"
-
-/*
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-*/
-#include "SDL_stdinc.h"
-#include "SDL_assert.h"
-
-#if defined(HAVE_QSORT)
-void
-SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *))
-{
-    qsort(base, nmemb, size, compare);
-}
-#else
-
-#ifdef assert
-#undef assert
-#endif
-#define assert(X) SDL_assert(X)
-#ifdef malloc
-#undef malloc
-#endif
-#define malloc	SDL_malloc
-#ifdef free
-#undef free
-#endif
-#define free	SDL_free
-#ifdef memcpy
-#undef memcpy
-#endif
-#define memcpy	SDL_memcpy
-#ifdef memmove
-#undef memmove
-#endif
-#define memmove	SDL_memmove
-#ifdef qsort
-#undef qsort
-#endif
-#define qsort	SDL_qsort
-
-static const char _ID[] = "<qsort.c gjm 1.12 1998-03-19>";
-
-/* How many bytes are there per word? (Must be a power of 2,
- * and must in fact equal sizeof(int).)
- */
-#define WORD_BYTES sizeof(int)
-
-/* How big does our stack need to be? Answer: one entry per
- * bit in a |size_t|.
- */
-#define STACK_SIZE (8*sizeof(size_t))
-
-/* Different situations have slightly different requirements,
- * and we make life epsilon easier by using different truncation
- * points for the three different cases.
- * So far, I have tuned TRUNC_words and guessed that the same
- * value might work well for the other two cases. Of course
- * what works well on my machine might work badly on yours.
- */
-#define TRUNC_nonaligned	12
-#define TRUNC_aligned		12
-#define TRUNC_words		12*WORD_BYTES   /* nb different meaning */
-
-/* We use a simple pivoting algorithm for shortish sub-arrays
- * and a more complicated one for larger ones. The threshold
- * is PIVOT_THRESHOLD.
- */
-#define PIVOT_THRESHOLD 40
-
-typedef struct
-{
-    char *first;
-    char *last;
-} stack_entry;
-#define pushLeft {stack[stacktop].first=ffirst;stack[stacktop++].last=last;}
-#define pushRight {stack[stacktop].first=first;stack[stacktop++].last=llast;}
-#define doLeft {first=ffirst;llast=last;continue;}
-#define doRight {ffirst=first;last=llast;continue;}
-#define pop {if (--stacktop<0) break;\
-  first=ffirst=stack[stacktop].first;\
-  last=llast=stack[stacktop].last;\
-  continue;}
-
-/* Some comments on the implementation.
- * 1. When we finish partitioning the array into "low"
- *    and "high", we forget entirely about short subarrays,
- *    because they'll be done later by insertion sort.
- *    Doing lots of little insertion sorts might be a win
- *    on large datasets for locality-of-reference reasons,
- *    but it makes the code much nastier and increases
- *    bookkeeping overhead.
- * 2. We always save the shorter and get to work on the
- *    longer. This guarantees that every time we push
- *    an item onto the stack its size is <= 1/2 of that
- *    of its parent; so the stack can't need more than
- *    log_2(max-array-size) entries.
- * 3. We choose a pivot by looking at the first, last
- *    and middle elements. We arrange them into order
- *    because it's easy to do that in conjunction with
- *    choosing the pivot, and it makes things a little
- *    easier in the partitioning step. Anyway, the pivot
- *    is the middle of these three. It's still possible
- *    to construct datasets where the algorithm takes
- *    time of order n^2, but it simply never happens in
- *    practice.
- * 3' Newsflash: On further investigation I find that
- *    it's easy to construct datasets where median-of-3
- *    simply isn't good enough. So on large-ish subarrays
- *    we do a more sophisticated pivoting: we take three
- *    sets of 3 elements, find their medians, and then
- *    take the median of those.
- * 4. We copy the pivot element to a separate place
- *    because that way we can always do our comparisons
- *    directly against a pointer to that separate place,
- *    and don't have to wonder "did we move the pivot
- *    element?". This makes the inner loop better.
- * 5. It's possible to make the pivoting even more
- *    reliable by looking at more candidates when n
- *    is larger. (Taking this to its logical conclusion
- *    results in a variant of quicksort that doesn't
- *    have that n^2 worst case.) However, the overhead
- *    from the extra bookkeeping means that it's just
- *    not worth while.
- * 6. This is pretty clean and portable code. Here are
- *    all the potential portability pitfalls and problems
- *    I know of:
- *      - In one place (the insertion sort) I construct
- *        a pointer that points just past the end of the
- *        supplied array, and assume that (a) it won't
- *        compare equal to any pointer within the array,
- *        and (b) it will compare equal to a pointer
- *        obtained by stepping off the end of the array.
- *        These might fail on some segmented architectures.
- *      - I assume that there are 8 bits in a |char| when
- *        computing the size of stack needed. This would
- *        fail on machines with 9-bit or 16-bit bytes.
- *      - I assume that if |((int)base&(sizeof(int)-1))==0|
- *        and |(size&(sizeof(int)-1))==0| then it's safe to
- *        get at array elements via |int*|s, and that if
- *        actually |size==sizeof(int)| as well then it's
- *        safe to treat the elements as |int|s. This might
- *        fail on systems that convert pointers to integers
- *        in non-standard ways.
- *      - I assume that |8*sizeof(size_t)<=INT_MAX|. This
- *        would be false on a machine with 8-bit |char|s,
- *        16-bit |int|s and 4096-bit |size_t|s. :-)
- */
-
-/* The recursion logic is the same in each case: */
-#define Recurse(Trunc)				\
-      { size_t l=last-ffirst,r=llast-first;	\
-        if (l<Trunc) {				\
-          if (r>=Trunc) doRight			\
-          else pop				\
-        }					\
-        else if (l<=r) { pushLeft; doRight }	\
-        else if (r>=Trunc) { pushRight; doLeft }\
-        else doLeft				\
-      }
-
-/* and so is the pivoting logic: */
-#define Pivot(swapper,sz)			\
-  if ((size_t)(last-first)>PIVOT_THRESHOLD*sz) mid=pivot_big(first,mid,last,sz,compare);\
-  else {	\
-    if (compare(first,mid)<0) {			\
-      if (compare(mid,last)>0) {		\
-        swapper(mid,last);			\
-        if (compare(first,mid)>0) swapper(first,mid);\
-      }						\
-    }						\
-    else {					\
-      if (compare(mid,last)>0) swapper(first,last)\
-      else {					\
-        swapper(first,mid);			\
-        if (compare(mid,last)>0) swapper(mid,last);\
-      }						\
-    }						\
-    first+=sz; last-=sz;			\
-  }
-
-#ifdef DEBUG_QSORT
-#include <stdio.h>
-#endif
-
-/* and so is the partitioning logic: */
-#define Partition(swapper,sz) {			\
-  int swapped=0;				\
-  do {						\
-    while (compare(first,pivot)<0) first+=sz;	\
-    while (compare(pivot,last)<0) last-=sz;	\
-    if (first<last) {				\
-      swapper(first,last); swapped=1;		\
-      first+=sz; last-=sz; }			\
-    else if (first==last) { first+=sz; last-=sz; break; }\
-  } while (first<=last);			\
-  if (!swapped) pop				\
-}
-
-/* and so is the pre-insertion-sort operation of putting
- * the smallest element into place as a sentinel.
- * Doing this makes the inner loop nicer. I got this
- * idea from the GNU implementation of qsort().
- */
-#define PreInsertion(swapper,limit,sz)		\
-  first=base;					\
-  last=first + (nmemb>limit ? limit : nmemb-1)*sz;\
-  while (last!=base) {				\
-    if (compare(first,last)>0) first=last;	\
-    last-=sz; }					\
-  if (first!=base) swapper(first,(char*)base);
-
-/* and so is the insertion sort, in the first two cases: */
-#define Insertion(swapper)			\
-  last=((char*)base)+nmemb*size;		\
-  for (first=((char*)base)+size;first!=last;first+=size) {	\
-    char *test;					\
-    /* Find the right place for |first|.	\
-     * My apologies for var reuse. */		\
-    for (test=first-size;compare(test,first)>0;test-=size) ;	\
-    test+=size;					\
-    if (test!=first) {				\
-      /* Shift everything in [test,first)	\
-       * up by one, and place |first|		\
-       * where |test| is. */			\
-      memcpy(pivot,first,size);			\
-      memmove(test+size,test,first-test);	\
-      memcpy(test,pivot,size);			\
-    }						\
-  }
-
-#define SWAP_nonaligned(a,b) { \
-  register char *aa=(a),*bb=(b); \
-  register size_t sz=size; \
-  do { register char t=*aa; *aa++=*bb; *bb++=t; } while (--sz); }
-
-#define SWAP_aligned(a,b) { \
-  register int *aa=(int*)(a),*bb=(int*)(b); \
-  register size_t sz=size; \
-  do { register int t=*aa;*aa++=*bb; *bb++=t; } while (sz-=WORD_BYTES); }
-
-#define SWAP_words(a,b) { \
-  register int t=*((int*)a); *((int*)a)=*((int*)b); *((int*)b)=t; }
-
-/* ---------------------------------------------------------------------- */
-
-static char *
-pivot_big(char *first, char *mid, char *last, size_t size,
-          int compare(const void *, const void *))
-{
-    size_t d = (((last - first) / size) >> 3) * size;
-    char *m1, *m2, *m3;
-    {
-        char *a = first, *b = first + d, *c = first + 2 * d;
-#ifdef DEBUG_QSORT
-        fprintf(stderr, "< %d %d %d\n", *(int *) a, *(int *) b, *(int *) c);
-#endif
-        m1 = compare(a, b) < 0 ?
-            (compare(b, c) < 0 ? b : (compare(a, c) < 0 ? c : a))
-            : (compare(a, c) < 0 ? a : (compare(b, c) < 0 ? c : b));
-    }
-    {
-        char *a = mid - d, *b = mid, *c = mid + d;
-#ifdef DEBUG_QSORT
-        fprintf(stderr, ". %d %d %d\n", *(int *) a, *(int *) b, *(int *) c);
-#endif
-        m2 = compare(a, b) < 0 ?
-            (compare(b, c) < 0 ? b : (compare(a, c) < 0 ? c : a))
-            : (compare(a, c) < 0 ? a : (compare(b, c) < 0 ? c : b));
-    }
-    {
-        char *a = last - 2 * d, *b = last - d, *c = last;
-#ifdef DEBUG_QSORT
-        fprintf(stderr, "> %d %d %d\n", *(int *) a, *(int *) b, *(int *) c);
-#endif
-        m3 = compare(a, b) < 0 ?
-            (compare(b, c) < 0 ? b : (compare(a, c) < 0 ? c : a))
-            : (compare(a, c) < 0 ? a : (compare(b, c) < 0 ? c : b));
-    }
-#ifdef DEBUG_QSORT
-    fprintf(stderr, "-> %d %d %d\n", *(int *) m1, *(int *) m2, *(int *) m3);
-#endif
-    return compare(m1, m2) < 0 ?
-        (compare(m2, m3) < 0 ? m2 : (compare(m1, m3) < 0 ? m3 : m1))
-        : (compare(m1, m3) < 0 ? m1 : (compare(m2, m3) < 0 ? m3 : m2));
-}
-
-/* ---------------------------------------------------------------------- */
-
-static void
-qsort_nonaligned(void *base, size_t nmemb, size_t size,
-                 int (*compare) (const void *, const void *))
-{
-
-    stack_entry stack[STACK_SIZE];
-    int stacktop = 0;
-    char *first, *last;
-    char *pivot = malloc(size);
-    size_t trunc = TRUNC_nonaligned * size;
-    assert(pivot != 0);
-
-    first = (char *) base;
-    last = first + (nmemb - 1) * size;
-
-    if ((size_t) (last - first) > trunc) {
-        char *ffirst = first, *llast = last;
-        while (1) {
-            /* Select pivot */
-            {
-                char *mid = first + size * ((last - first) / size >> 1);
-                Pivot(SWAP_nonaligned, size);
-                memcpy(pivot, mid, size);
-            }
-            /* Partition. */
-            Partition(SWAP_nonaligned, size);
-            /* Prepare to recurse/iterate. */
-        Recurse(trunc)}
-    }
-    PreInsertion(SWAP_nonaligned, TRUNC_nonaligned, size);
-    Insertion(SWAP_nonaligned);
-    free(pivot);
-}
-
-static void
-qsort_aligned(void *base, size_t nmemb, size_t size,
-              int (*compare) (const void *, const void *))
-{
-
-    stack_entry stack[STACK_SIZE];
-    int stacktop = 0;
-    char *first, *last;
-    char *pivot = malloc(size);
-    size_t trunc = TRUNC_aligned * size;
-    assert(pivot != 0);
-
-    first = (char *) base;
-    last = first + (nmemb - 1) * size;
-
-    if ((size_t) (last - first) > trunc) {
-        char *ffirst = first, *llast = last;
-        while (1) {
-            /* Select pivot */
-            {
-                char *mid = first + size * ((last - first) / size >> 1);
-                Pivot(SWAP_aligned, size);
-                memcpy(pivot, mid, size);
-            }
-            /* Partition. */
-            Partition(SWAP_aligned, size);
-            /* Prepare to recurse/iterate. */
-        Recurse(trunc)}
-    }
-    PreInsertion(SWAP_aligned, TRUNC_aligned, size);
-    Insertion(SWAP_aligned);
-    free(pivot);
-}
-
-static void
-qsort_words(void *base, size_t nmemb,
-            int (*compare) (const void *, const void *))
-{
-
-    stack_entry stack[STACK_SIZE];
-    int stacktop = 0;
-    char *first, *last;
-    char *pivot = malloc(WORD_BYTES);
-    assert(pivot != 0);
-
-    first = (char *) base;
-    last = first + (nmemb - 1) * WORD_BYTES;
-
-    if (last - first > TRUNC_words) {
-        char *ffirst = first, *llast = last;
-        while (1) {
-#ifdef DEBUG_QSORT
-            fprintf(stderr, "Doing %d:%d: ",
-                    (first - (char *) base) / WORD_BYTES,
-                    (last - (char *) base) / WORD_BYTES);
-#endif
-            /* Select pivot */
-            {
-                char *mid =
-                    first + WORD_BYTES * ((last - first) / (2 * WORD_BYTES));
-                Pivot(SWAP_words, WORD_BYTES);
-                *(int *) pivot = *(int *) mid;
-            }
-#ifdef DEBUG_QSORT
-            fprintf(stderr, "pivot=%d\n", *(int *) pivot);
-#endif
-            /* Partition. */
-            Partition(SWAP_words, WORD_BYTES);
-            /* Prepare to recurse/iterate. */
-        Recurse(TRUNC_words)}
-    }
-    PreInsertion(SWAP_words, (TRUNC_words / WORD_BYTES), WORD_BYTES);
-    /* Now do insertion sort. */
-    last = ((char *) base) + nmemb * WORD_BYTES;
-    for (first = ((char *) base) + WORD_BYTES; first != last;
-         first += WORD_BYTES) {
-        /* Find the right place for |first|. My apologies for var reuse */
-        int *pl = (int *) (first - WORD_BYTES), *pr = (int *) first;
-        *(int *) pivot = *(int *) first;
-        for (; compare(pl, pivot) > 0; pr = pl, --pl) {
-            *pr = *pl;
-        }
-        if (pr != (int *) first)
-            *pr = *(int *) pivot;
-    }
-    free(pivot);
-}
-
-/* ---------------------------------------------------------------------- */
-
-void
-qsort(void *base, size_t nmemb, size_t size,
-      int (*compare) (const void *, const void *))
-{
-
-    if (nmemb <= 1)
-        return;
-    if (((uintptr_t) base | size) & (WORD_BYTES - 1))
-        qsort_nonaligned(base, nmemb, size, compare);
-    else if (size != WORD_BYTES)
-        qsort_aligned(base, nmemb, size, compare);
-    else
-        qsort_words(base, nmemb, compare);
-}
-
-#endif /* !SDL_qsort */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/stdlib/SDL_stdlib.c b/deps/SDL2/src/stdlib/SDL_stdlib.c
deleted file mode 100644
index 2ee62be..0000000
--- a/deps/SDL2/src/stdlib/SDL_stdlib.c
+++ /dev/null
@@ -1,906 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This file contains portable stdlib functions for SDL */
-
-#include "SDL_stdinc.h"
-#include "../libm/math_libm.h"
-
-
-double
-SDL_atan(double x)
-{
-#ifdef HAVE_ATAN
-    return atan(x);
-#else
-    return SDL_uclibc_atan(x);
-#endif /* HAVE_ATAN */
-}
-
-double
-SDL_atan2(double x, double y)
-{
-#if defined(HAVE_ATAN2)
-    return atan2(x, y);
-#else
-    return SDL_uclibc_atan2(x, y);
-#endif /* HAVE_ATAN2 */
-}
-
-double
-SDL_ceil(double x)
-{
-#ifdef HAVE_CEIL
-    return ceil(x);
-#else
-    return (double)(int)((x)+0.5);
-#endif /* HAVE_CEIL */
-}
-
-double
-SDL_copysign(double x, double y)
-{
-#if defined(HAVE_COPYSIGN)
-    return copysign(x, y);
-#else
-    return SDL_uclibc_copysign(x, y);
-#endif /* HAVE_COPYSIGN */
-}
-
-double
-SDL_cos(double x)
-{
-#if defined(HAVE_COS)
-    return cos(x);
-#else
-    return SDL_uclibc_cos(x);
-#endif /* HAVE_COS */
-}
-
-float
-SDL_cosf(float x)
-{
-#ifdef HAVE_COSF
-    return cosf(x);
-#else
-    return (float)SDL_cos((double)x);
-#endif
-}
-
-double
-SDL_fabs(double x)
-{
-#if defined(HAVE_FABS)
-    return fabs(x); 
-#else
-    return SDL_uclibc_fabs(x);
-#endif /* HAVE_FABS */
-}
-
-double
-SDL_floor(double x)
-{
-#if defined(HAVE_FLOOR)
-    return floor(x);
-#else
-    return SDL_uclibc_floor(x);
-#endif /* HAVE_FLOOR */
-}
-
-double
-SDL_log(double x)
-{
-#if defined(HAVE_LOG)
-    return log(x);
-#else
-    return SDL_uclibc_log(x);
-#endif /* HAVE_LOG */
-}
-
-double
-SDL_pow(double x, double y)
-{
-#if defined(HAVE_POW)
-    return pow(x, y);
-#else
-    return SDL_uclibc_pow(x, y);
-#endif /* HAVE_POW */
-}
-
-double
-SDL_scalbn(double x, int n)
-{
-#if defined(HAVE_SCALBN)
-    return scalbn(x, n);
-#else
-    return SDL_uclibc_scalbn(x, n);
-#endif /* HAVE_SCALBN */
-}
-
-double
-SDL_sin(double x)
-{
-#if defined(HAVE_SIN)
-    return sin(x);
-#else
-    return SDL_uclibc_sin(x);
-#endif /* HAVE_SIN */
-}
-
-float 
-SDL_sinf(float x)
-{
-#ifdef HAVE_SINF
-    return sinf(x);
-#else
-    return (float)SDL_sin((double)x);
-#endif /* HAVE_SINF */
-}
-
-double
-SDL_sqrt(double x)
-{
-#if defined(HAVE_SQRT)
-    return sqrt(x);
-#else
-    return SDL_uclibc_sqrt(x);
-#endif
-}
-
-int SDL_abs(int x)
-{
-#ifdef HAVE_ABS
-    return abs(x);
-#else
-    return ((x) < 0 ? -(x) : (x));
-#endif
-}
-
-#ifdef HAVE_CTYPE_H
-int SDL_isdigit(int x) { return isdigit(x); }
-int SDL_isspace(int x) { return isspace(x); }
-int SDL_toupper(int x) { return toupper(x); }
-int SDL_tolower(int x) { return tolower(x); }
-#else
-int SDL_isdigit(int x) { return ((x) >= '0') && ((x) <= '9'); }
-int SDL_isspace(int x) { return ((x) == ' ') || ((x) == '\t') || ((x) == '\r') || ((x) == '\n') || ((x) == '\f') || ((x) == '\v'); }
-int SDL_toupper(int x) { return ((x) >= 'a') && ((x) <= 'z') ? ('A'+((x)-'a')) : (x); }
-int SDL_tolower(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a'+((x)-'A')) : (x); }
-#endif
-
-
-#ifndef HAVE_LIBC
-/* These are some C runtime intrinsics that need to be defined */
-
-#if defined(_MSC_VER)
-
-#ifndef __FLTUSED__
-#define __FLTUSED__
-__declspec(selectany) int _fltused = 1;
-#endif
-
-/* The optimizer on Visual Studio 2010/2012 generates memcpy() calls */
-#if _MSC_VER >= 1600 && defined(_WIN64) && !defined(_DEBUG)
-#include <intrin.h>
-
-#pragma function(memcpy)
-void * memcpy ( void * destination, const void * source, size_t num )
-{
-    const Uint8 *src = (const Uint8 *)source;
-    Uint8 *dst = (Uint8 *)destination;
-    size_t i;
-    
-    /* All WIN64 architectures have SSE, right? */
-    if (!((uintptr_t) src & 15) && !((uintptr_t) dst & 15)) {
-        __m128 values[4];
-        for (i = num / 64; i--;) {
-            _mm_prefetch(src, _MM_HINT_NTA);
-            values[0] = *(__m128 *) (src + 0);
-            values[1] = *(__m128 *) (src + 16);
-            values[2] = *(__m128 *) (src + 32);
-            values[3] = *(__m128 *) (src + 48);
-            _mm_stream_ps((float *) (dst + 0), values[0]);
-            _mm_stream_ps((float *) (dst + 16), values[1]);
-            _mm_stream_ps((float *) (dst + 32), values[2]);
-            _mm_stream_ps((float *) (dst + 48), values[3]);
-            src += 64;
-            dst += 64;
-        }
-        num &= 63;
-    }
-
-    while (num--) {
-        *dst++ = *src++;
-    }
-    return destination;
-}
-#endif /* _MSC_VER == 1600 && defined(_WIN64) && !defined(_DEBUG) */
-
-#ifdef _M_IX86
-
-void
-__declspec(naked)
-_chkstk()
-{
-}
-
-/* Float to long */
-void
-__declspec(naked)
-_ftol()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        push        ebp
-        mov         ebp,esp
-        sub         esp,20h
-        and         esp,0FFFFFFF0h
-        fld         st(0)
-        fst         dword ptr [esp+18h]
-        fistp       qword ptr [esp+10h]
-        fild        qword ptr [esp+10h]
-        mov         edx,dword ptr [esp+18h]
-        mov         eax,dword ptr [esp+10h]
-        test        eax,eax
-        je          integer_QnaN_or_zero
-arg_is_not_integer_QnaN:
-        fsubp       st(1),st
-        test        edx,edx
-        jns         positive
-        fstp        dword ptr [esp]
-        mov         ecx,dword ptr [esp]
-        xor         ecx,80000000h
-        add         ecx,7FFFFFFFh
-        adc         eax,0
-        mov         edx,dword ptr [esp+14h]
-        adc         edx,0
-        jmp         localexit
-positive:
-        fstp        dword ptr [esp]
-        mov         ecx,dword ptr [esp]
-        add         ecx,7FFFFFFFh
-        sbb         eax,0
-        mov         edx,dword ptr [esp+14h]
-        sbb         edx,0
-        jmp         localexit
-integer_QnaN_or_zero:
-        mov         edx,dword ptr [esp+14h]
-        test        edx,7FFFFFFFh
-        jne         arg_is_not_integer_QnaN
-        fstp        dword ptr [esp+18h]
-        fstp        dword ptr [esp+18h]
-localexit:
-        leave
-        ret
-    }
-    /* *INDENT-ON* */
-}
-
-void
-_ftol2_sse()
-{
-    _ftol();
-}
-
-/* 64-bit math operators for 32-bit systems */
-void
-__declspec(naked)
-_allmul()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        push        ebp
-        mov         ebp,esp
-        push        edi
-        push        esi
-        push        ebx
-        sub         esp,0Ch
-        mov         eax,dword ptr [ebp+10h]
-        mov         edi,dword ptr [ebp+8]
-        mov         ebx,eax
-        mov         esi,eax
-        sar         esi,1Fh
-        mov         eax,dword ptr [ebp+8]
-        mul         ebx
-        imul        edi,esi
-        mov         ecx,edx
-        mov         dword ptr [ebp-18h],eax
-        mov         edx,dword ptr [ebp+0Ch]
-        add         ecx,edi
-        imul        ebx,edx
-        mov         eax,dword ptr [ebp-18h]
-        lea         ebx,[ebx+ecx]
-        mov         dword ptr [ebp-14h],ebx
-        mov         edx,dword ptr [ebp-14h]
-        add         esp,0Ch
-        pop         ebx
-        pop         esi
-        pop         edi
-        pop         ebp
-        ret         10h
-    }
-    /* *INDENT-ON* */
-}
-
-void
-__declspec(naked)
-_alldiv()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        push        edi
-        push        esi
-        push        ebx
-        xor         edi,edi
-        mov         eax,dword ptr [esp+14h]
-        or          eax,eax
-        jge         L1
-        inc         edi
-        mov         edx,dword ptr [esp+10h]
-        neg         eax
-        neg         edx
-        sbb         eax,0
-        mov         dword ptr [esp+14h],eax
-        mov         dword ptr [esp+10h],edx
-L1:
-        mov         eax,dword ptr [esp+1Ch]
-        or          eax,eax
-        jge         L2
-        inc         edi
-        mov         edx,dword ptr [esp+18h]
-        neg         eax
-        neg         edx
-        sbb         eax,0
-        mov         dword ptr [esp+1Ch],eax
-        mov         dword ptr [esp+18h],edx
-L2:
-        or          eax,eax
-        jne         L3
-        mov         ecx,dword ptr [esp+18h]
-        mov         eax,dword ptr [esp+14h]
-        xor         edx,edx
-        div         ecx
-        mov         ebx,eax
-        mov         eax,dword ptr [esp+10h]
-        div         ecx
-        mov         edx,ebx
-        jmp         L4
-L3:
-        mov         ebx,eax
-        mov         ecx,dword ptr [esp+18h]
-        mov         edx,dword ptr [esp+14h]
-        mov         eax,dword ptr [esp+10h]
-L5:
-        shr         ebx,1
-        rcr         ecx,1
-        shr         edx,1
-        rcr         eax,1
-        or          ebx,ebx
-        jne         L5
-        div         ecx
-        mov         esi,eax
-        mul         dword ptr [esp+1Ch]
-        mov         ecx,eax
-        mov         eax,dword ptr [esp+18h]
-        mul         esi
-        add         edx,ecx
-        jb          L6
-        cmp         edx,dword ptr [esp+14h]
-        ja          L6
-        jb          L7
-        cmp         eax,dword ptr [esp+10h]
-        jbe         L7
-L6:
-        dec         esi
-L7:
-        xor         edx,edx
-        mov         eax,esi
-L4:
-        dec         edi
-        jne         L8
-        neg         edx
-        neg         eax
-        sbb         edx,0
-L8:
-        pop         ebx
-        pop         esi
-        pop         edi
-        ret         10h
-    }
-    /* *INDENT-ON* */
-}
-
-void
-__declspec(naked)
-_aulldiv()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        push        ebx
-        push        esi
-        mov         eax,dword ptr [esp+18h]
-        or          eax,eax
-        jne         L1
-        mov         ecx,dword ptr [esp+14h]
-        mov         eax,dword ptr [esp+10h]
-        xor         edx,edx
-        div         ecx
-        mov         ebx,eax
-        mov         eax,dword ptr [esp+0Ch]
-        div         ecx
-        mov         edx,ebx
-        jmp         L2
-L1:
-        mov         ecx,eax
-        mov         ebx,dword ptr [esp+14h]
-        mov         edx,dword ptr [esp+10h]
-        mov         eax,dword ptr [esp+0Ch]
-L3:
-        shr         ecx,1
-        rcr         ebx,1
-        shr         edx,1
-        rcr         eax,1
-        or          ecx,ecx
-        jne         L3
-        div         ebx
-        mov         esi,eax
-        mul         dword ptr [esp+18h]
-        mov         ecx,eax
-        mov         eax,dword ptr [esp+14h]
-        mul         esi
-        add         edx,ecx
-        jb          L4
-        cmp         edx,dword ptr [esp+10h]
-        ja          L4
-        jb          L5
-        cmp         eax,dword ptr [esp+0Ch]
-        jbe         L5
-L4:
-        dec         esi
-L5:
-        xor         edx,edx
-        mov         eax,esi
-L2:
-        pop         esi
-        pop         ebx
-        ret         10h
-    }
-    /* *INDENT-ON* */
-}
-
-void
-__declspec(naked)
-_allrem()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        push        ebx
-        push        edi
-        xor         edi,edi
-        mov         eax,dword ptr [esp+10h]
-        or          eax,eax
-        jge         L1
-        inc         edi
-        mov         edx,dword ptr [esp+0Ch]
-        neg         eax
-        neg         edx
-        sbb         eax,0
-        mov         dword ptr [esp+10h],eax
-        mov         dword ptr [esp+0Ch],edx
-L1:
-        mov         eax,dword ptr [esp+18h]
-        or          eax,eax
-        jge         L2
-        mov         edx,dword ptr [esp+14h]
-        neg         eax
-        neg         edx
-        sbb         eax,0
-        mov         dword ptr [esp+18h],eax
-        mov         dword ptr [esp+14h],edx
-L2:
-        or          eax,eax
-        jne         L3
-        mov         ecx,dword ptr [esp+14h]
-        mov         eax,dword ptr [esp+10h]
-        xor         edx,edx
-        div         ecx
-        mov         eax,dword ptr [esp+0Ch]
-        div         ecx
-        mov         eax,edx
-        xor         edx,edx
-        dec         edi
-        jns         L4
-        jmp         L8
-L3:
-        mov         ebx,eax
-        mov         ecx,dword ptr [esp+14h]
-        mov         edx,dword ptr [esp+10h]
-        mov         eax,dword ptr [esp+0Ch]
-L5:
-        shr         ebx,1
-        rcr         ecx,1
-        shr         edx,1
-        rcr         eax,1
-        or          ebx,ebx
-        jne         L5
-        div         ecx
-        mov         ecx,eax
-        mul         dword ptr [esp+18h]
-        xchg        eax,ecx
-        mul         dword ptr [esp+14h]
-        add         edx,ecx
-        jb          L6
-        cmp         edx,dword ptr [esp+10h]
-        ja          L6
-        jb          L7
-        cmp         eax,dword ptr [esp+0Ch]
-        jbe         L7
-L6:
-        sub         eax,dword ptr [esp+14h]
-        sbb         edx,dword ptr [esp+18h]
-L7:
-        sub         eax,dword ptr [esp+0Ch]
-        sbb         edx,dword ptr [esp+10h]
-        dec         edi
-        jns         L8
-L4:
-        neg         edx
-        neg         eax
-        sbb         edx,0
-L8:
-        pop         edi
-        pop         ebx
-        ret         10h
-    }
-    /* *INDENT-ON* */
-}
-
-void
-__declspec(naked)
-_aullrem()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        push        ebx
-        mov         eax,dword ptr [esp+14h]
-        or          eax,eax
-        jne         L1
-        mov         ecx,dword ptr [esp+10h]
-        mov         eax,dword ptr [esp+0Ch]
-        xor         edx,edx
-        div         ecx
-        mov         eax,dword ptr [esp+8]
-        div         ecx
-        mov         eax,edx
-        xor         edx,edx
-        jmp         L2
-L1:
-        mov         ecx,eax
-        mov         ebx,dword ptr [esp+10h]
-        mov         edx,dword ptr [esp+0Ch]
-        mov         eax,dword ptr [esp+8]
-L3:
-        shr         ecx,1
-        rcr         ebx,1
-        shr         edx,1
-        rcr         eax,1
-        or          ecx,ecx
-        jne         L3
-        div         ebx
-        mov         ecx,eax
-        mul         dword ptr [esp+14h]
-        xchg        eax,ecx
-        mul         dword ptr [esp+10h]
-        add         edx,ecx
-        jb          L4
-        cmp         edx,dword ptr [esp+0Ch]
-        ja          L4
-        jb          L5
-        cmp         eax,dword ptr [esp+8]
-        jbe         L5
-L4:
-        sub         eax,dword ptr [esp+10h]
-        sbb         edx,dword ptr [esp+14h]
-L5:
-        sub         eax,dword ptr [esp+8]
-        sbb         edx,dword ptr [esp+0Ch]
-        neg         edx
-        neg         eax
-        sbb         edx,0
-L2:
-        pop         ebx
-        ret         10h
-    }
-    /* *INDENT-ON* */
-}
-
-void
-__declspec(naked)
-_alldvrm()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        push        edi
-        push        esi
-        push        ebp
-        xor         edi,edi
-        xor         ebp,ebp
-        mov         eax,dword ptr [esp+14h]
-        or          eax,eax
-        jge         L1
-        inc         edi
-        inc         ebp
-        mov         edx,dword ptr [esp+10h]
-        neg         eax
-        neg         edx
-        sbb         eax,0
-        mov         dword ptr [esp+14h],eax
-        mov         dword ptr [esp+10h],edx
-L1:
-        mov         eax,dword ptr [esp+1Ch]
-        or          eax,eax
-        jge         L2
-        inc         edi
-        mov         edx,dword ptr [esp+18h]
-        neg         eax
-        neg         edx
-        sbb         eax,0
-        mov         dword ptr [esp+1Ch],eax
-        mov         dword ptr [esp+18h],edx
-L2:
-        or          eax,eax
-        jne         L3
-        mov         ecx,dword ptr [esp+18h]
-        mov         eax,dword ptr [esp+14h]
-        xor         edx,edx
-        div         ecx
-        mov         ebx,eax
-        mov         eax,dword ptr [esp+10h]
-        div         ecx
-        mov         esi,eax
-        mov         eax,ebx
-        mul         dword ptr [esp+18h]
-        mov         ecx,eax
-        mov         eax,esi
-        mul         dword ptr [esp+18h]
-        add         edx,ecx
-        jmp         L4
-L3:
-        mov         ebx,eax
-        mov         ecx,dword ptr [esp+18h]
-        mov         edx,dword ptr [esp+14h]
-        mov         eax,dword ptr [esp+10h]
-L5:
-        shr         ebx,1
-        rcr         ecx,1
-        shr         edx,1
-        rcr         eax,1
-        or          ebx,ebx
-        jne         L5
-        div         ecx
-        mov         esi,eax
-        mul         dword ptr [esp+1Ch]
-        mov         ecx,eax
-        mov         eax,dword ptr [esp+18h]
-        mul         esi
-        add         edx,ecx
-        jb          L6
-        cmp         edx,dword ptr [esp+14h]
-        ja          L6
-        jb          L7
-        cmp         eax,dword ptr [esp+10h]
-        jbe         L7
-L6:
-        dec         esi
-        sub         eax,dword ptr [esp+18h]
-        sbb         edx,dword ptr [esp+1Ch]
-L7:
-        xor         ebx,ebx
-L4:
-        sub         eax,dword ptr [esp+10h]
-        sbb         edx,dword ptr [esp+14h]
-        dec         ebp
-        jns         L9
-        neg         edx
-        neg         eax
-        sbb         edx,0
-L9:
-        mov         ecx,edx
-        mov         edx,ebx
-        mov         ebx,ecx
-        mov         ecx,eax
-        mov         eax,esi
-        dec         edi
-        jne         L8
-        neg         edx
-        neg         eax
-        sbb         edx,0
-L8:
-        pop         ebp
-        pop         esi
-        pop         edi
-        ret         10h
-    }
-    /* *INDENT-ON* */
-}
-
-void
-__declspec(naked)
-_aulldvrm()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        push        esi
-        mov         eax,dword ptr [esp+14h]
-        or          eax,eax
-        jne         L1
-        mov         ecx,dword ptr [esp+10h]
-        mov         eax,dword ptr [esp+0Ch]
-        xor         edx,edx
-        div         ecx
-        mov         ebx,eax
-        mov         eax,dword ptr [esp+8]
-        div         ecx
-        mov         esi,eax
-        mov         eax,ebx
-        mul         dword ptr [esp+10h]
-        mov         ecx,eax
-        mov         eax,esi
-        mul         dword ptr [esp+10h]
-        add         edx,ecx
-        jmp         L2
-L1:
-        mov         ecx,eax
-        mov         ebx,dword ptr [esp+10h]
-        mov         edx,dword ptr [esp+0Ch]
-        mov         eax,dword ptr [esp+8]
-L3:
-        shr         ecx,1
-        rcr         ebx,1
-        shr         edx,1
-        rcr         eax,1
-        or          ecx,ecx
-        jne         L3
-        div         ebx
-        mov         esi,eax
-        mul         dword ptr [esp+14h]
-        mov         ecx,eax
-        mov         eax,dword ptr [esp+10h]
-        mul         esi
-        add         edx,ecx
-        jb          L4
-        cmp         edx,dword ptr [esp+0Ch]
-        ja          L4
-        jb          L5
-        cmp         eax,dword ptr [esp+8]
-        jbe         L5
-L4:
-        dec         esi
-        sub         eax,dword ptr [esp+10h]
-        sbb         edx,dword ptr [esp+14h]
-L5:
-        xor         ebx,ebx
-L2:
-        sub         eax,dword ptr [esp+8]
-        sbb         edx,dword ptr [esp+0Ch]
-        neg         edx
-        neg         eax
-        sbb         edx,0
-        mov         ecx,edx
-        mov         edx,ebx
-        mov         ebx,ecx
-        mov         ecx,eax
-        mov         eax,esi
-        pop         esi
-        ret         10h
-    }
-    /* *INDENT-ON* */
-}
-
-void
-__declspec(naked)
-_allshl()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        cmp         cl,40h
-        jae         RETZERO
-        cmp         cl,20h
-        jae         MORE32
-        shld        edx,eax,cl
-        shl         eax,cl
-        ret
-MORE32:
-        mov         edx,eax
-        xor         eax,eax
-        and         cl,1Fh
-        shl         edx,cl
-        ret
-RETZERO:
-        xor         eax,eax
-        xor         edx,edx
-        ret
-    }
-    /* *INDENT-ON* */
-}
-
-void
-__declspec(naked)
-_allshr()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        cmp         cl,40h
-        jae         RETZERO
-        cmp         cl,20h
-        jae         MORE32
-        shrd        eax,edx,cl
-        sar         edx,cl
-        ret
-MORE32:
-        mov         eax,edx
-        xor         edx,edx
-        and         cl,1Fh
-        sar         eax,cl
-        ret
-RETZERO:
-        xor         eax,eax
-        xor         edx,edx
-        ret
-    }
-    /* *INDENT-ON* */
-}
-
-void
-__declspec(naked)
-_aullshr()
-{
-    /* *INDENT-OFF* */
-    __asm {
-        cmp         cl,40h
-        jae         RETZERO
-        cmp         cl,20h
-        jae         MORE32
-        shrd        eax,edx,cl
-        shr         edx,cl
-        ret
-MORE32:
-        mov         eax,edx
-        xor         edx,edx
-        and         cl,1Fh
-        shr         eax,cl
-        ret
-RETZERO:
-        xor         eax,eax
-        xor         edx,edx
-        ret
-    }
-    /* *INDENT-ON* */
-}
-
-#endif /* _M_IX86 */
-
-#endif /* MSC_VER */
-
-#endif /* !HAVE_LIBC */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/stdlib/SDL_string.c b/deps/SDL2/src/stdlib/SDL_string.c
deleted file mode 100644
index 980f025..0000000
--- a/deps/SDL2/src/stdlib/SDL_string.c
+++ /dev/null
@@ -1,1660 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This file contains portable string manipulation functions for SDL */
-
-#include "SDL_stdinc.h"
-
-
-#define SDL_isupperhex(X)   (((X) >= 'A') && ((X) <= 'F'))
-#define SDL_islowerhex(X)   (((X) >= 'a') && ((X) <= 'f'))
-
-#define UTF8_IsLeadByte(c) ((c) >= 0xC0 && (c) <= 0xF4)
-#define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF)
-
-static int UTF8_TrailingBytes(unsigned char c)
-{
-    if (c >= 0xC0 && c <= 0xDF)
-        return 1;
-    else if (c >= 0xE0 && c <= 0xEF)
-        return 2;
-    else if (c >= 0xF0 && c <= 0xF4)
-        return 3;
-    else
-        return 0;
-}
-
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOL)
-static size_t
-SDL_ScanLong(const char *text, int radix, long *valuep)
-{
-    const char *textstart = text;
-    long value = 0;
-    SDL_bool negative = SDL_FALSE;
-
-    if (*text == '-') {
-        negative = SDL_TRUE;
-        ++text;
-    }
-    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
-        text += 2;
-    }
-    for (;;) {
-        int v;
-        if (SDL_isdigit((unsigned char) *text)) {
-            v = *text - '0';
-        } else if (radix == 16 && SDL_isupperhex(*text)) {
-            v = 10 + (*text - 'A');
-        } else if (radix == 16 && SDL_islowerhex(*text)) {
-            v = 10 + (*text - 'a');
-        } else {
-            break;
-        }
-        value *= radix;
-        value += v;
-        ++text;
-    }
-    if (valuep) {
-        if (negative && value) {
-            *valuep = -value;
-        } else {
-            *valuep = value;
-        }
-    }
-    return (text - textstart);
-}
-#endif
-
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD)
-static size_t
-SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *valuep)
-{
-    const char *textstart = text;
-    unsigned long value = 0;
-
-    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
-        text += 2;
-    }
-    for (;;) {
-        int v;
-        if (SDL_isdigit((unsigned char) *text)) {
-            v = *text - '0';
-        } else if (radix == 16 && SDL_isupperhex(*text)) {
-            v = 10 + (*text - 'A');
-        } else if (radix == 16 && SDL_islowerhex(*text)) {
-            v = 10 + (*text - 'a');
-        } else {
-            break;
-        }
-        value *= radix;
-        value += v;
-        ++text;
-    }
-    if (valuep) {
-        *valuep = value;
-    }
-    return (text - textstart);
-}
-#endif
-
-#ifndef HAVE_SSCANF
-static size_t
-SDL_ScanUintPtrT(const char *text, int radix, uintptr_t * valuep)
-{
-    const char *textstart = text;
-    uintptr_t value = 0;
-
-    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
-        text += 2;
-    }
-    for (;;) {
-        int v;
-        if (SDL_isdigit((unsigned char) *text)) {
-            v = *text - '0';
-        } else if (radix == 16 && SDL_isupperhex(*text)) {
-            v = 10 + (*text - 'A');
-        } else if (radix == 16 && SDL_islowerhex(*text)) {
-            v = 10 + (*text - 'a');
-        } else {
-            break;
-        }
-        value *= radix;
-        value += v;
-        ++text;
-    }
-    if (valuep) {
-        *valuep = value;
-    }
-    return (text - textstart);
-}
-#endif
-
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOLL)
-static size_t
-SDL_ScanLongLong(const char *text, int radix, Sint64 * valuep)
-{
-    const char *textstart = text;
-    Sint64 value = 0;
-    SDL_bool negative = SDL_FALSE;
-
-    if (*text == '-') {
-        negative = SDL_TRUE;
-        ++text;
-    }
-    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
-        text += 2;
-    }
-    for (;;) {
-        int v;
-        if (SDL_isdigit((unsigned char) *text)) {
-            v = *text - '0';
-        } else if (radix == 16 && SDL_isupperhex(*text)) {
-            v = 10 + (*text - 'A');
-        } else if (radix == 16 && SDL_islowerhex(*text)) {
-            v = 10 + (*text - 'a');
-        } else {
-            break;
-        }
-        value *= radix;
-        value += v;
-        ++text;
-    }
-    if (valuep) {
-        if (negative && value) {
-            *valuep = -value;
-        } else {
-            *valuep = value;
-        }
-    }
-    return (text - textstart);
-}
-#endif
-
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOULL)
-static size_t
-SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 * valuep)
-{
-    const char *textstart = text;
-    Uint64 value = 0;
-
-    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
-        text += 2;
-    }
-    for (;;) {
-        int v;
-        if (SDL_isdigit((unsigned char) *text)) {
-            v = *text - '0';
-        } else if (radix == 16 && SDL_isupperhex(*text)) {
-            v = 10 + (*text - 'A');
-        } else if (radix == 16 && SDL_islowerhex(*text)) {
-            v = 10 + (*text - 'a');
-        } else {
-            break;
-        }
-        value *= radix;
-        value += v;
-        ++text;
-    }
-    if (valuep) {
-        *valuep = value;
-    }
-    return (text - textstart);
-}
-#endif
-
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOD)
-static size_t
-SDL_ScanFloat(const char *text, double *valuep)
-{
-    const char *textstart = text;
-    unsigned long lvalue = 0;
-    double value = 0.0;
-    SDL_bool negative = SDL_FALSE;
-
-    if (*text == '-') {
-        negative = SDL_TRUE;
-        ++text;
-    }
-    text += SDL_ScanUnsignedLong(text, 10, &lvalue);
-    value += lvalue;
-    if (*text == '.') {
-        int mult = 10;
-        ++text;
-        while (SDL_isdigit((unsigned char) *text)) {
-            lvalue = *text - '0';
-            value += (double) lvalue / mult;
-            mult *= 10;
-            ++text;
-        }
-    }
-    if (valuep) {
-        if (negative && value) {
-            *valuep = -value;
-        } else {
-            *valuep = value;
-        }
-    }
-    return (text - textstart);
-}
-#endif
-
-void *
-SDL_memset(void *dst, int c, size_t len)
-{
-#if defined(HAVE_MEMSET)
-    return memset(dst, c, len);
-#else
-    size_t left = (len % 4);
-    Uint32 *dstp4;
-    Uint8 *dstp1;
-    Uint32 value4 = (c | (c << 8) | (c << 16) | (c << 24));
-    Uint8 value1 = (Uint8) c;
-
-    dstp4 = (Uint32 *) dst;
-    len /= 4;
-    while (len--) {
-        *dstp4++ = value4;
-    }
-
-    dstp1 = (Uint8 *) dstp4;
-    switch (left) {
-    case 3:
-        *dstp1++ = value1;
-    case 2:
-        *dstp1++ = value1;
-    case 1:
-        *dstp1++ = value1;
-    }
-
-    return dst;
-#endif /* HAVE_MEMSET */
-}
-
-void *
-SDL_memcpy(void *dst, const void *src, size_t len)
-{
-#ifdef __GNUC__
-    /* Presumably this is well tuned for speed.
-       On my machine this is twice as fast as the C code below.
-     */
-    return __builtin_memcpy(dst, src, len);
-#elif defined(HAVE_MEMCPY)
-    return memcpy(dst, src, len);
-#elif defined(HAVE_BCOPY)
-    bcopy(src, dst, len);
-    return dst;
-#else
-    /* GCC 4.9.0 with -O3 will generate movaps instructions with the loop
-       using Uint32* pointers, so we need to make sure the pointers are
-       aligned before we loop using them.
-     */
-    if (((intptr_t)src & 0x3) || ((intptr_t)dst & 0x3)) {
-        /* Do an unaligned byte copy */
-        Uint8 *srcp1 = (Uint8 *)src;
-        Uint8 *dstp1 = (Uint8 *)dst;
-
-        while (len--) {
-            *dstp1++ = *srcp1++;
-        }
-    } else {
-        size_t left = (len % 4);
-        Uint32 *srcp4, *dstp4;
-        Uint8 *srcp1, *dstp1;
-
-        srcp4 = (Uint32 *) src;
-        dstp4 = (Uint32 *) dst;
-        len /= 4;
-        while (len--) {
-            *dstp4++ = *srcp4++;
-        }
-
-        srcp1 = (Uint8 *) srcp4;
-        dstp1 = (Uint8 *) dstp4;
-        switch (left) {
-        case 3:
-            *dstp1++ = *srcp1++;
-        case 2:
-            *dstp1++ = *srcp1++;
-        case 1:
-            *dstp1++ = *srcp1++;
-        }
-    }
-    return dst;
-#endif /* __GNUC__ */
-}
-
-void *
-SDL_memmove(void *dst, const void *src, size_t len)
-{
-#if defined(HAVE_MEMMOVE)
-    return memmove(dst, src, len);
-#else
-    char *srcp = (char *) src;
-    char *dstp = (char *) dst;
-
-    if (src < dst) {
-        srcp += len - 1;
-        dstp += len - 1;
-        while (len--) {
-            *dstp-- = *srcp--;
-        }
-    } else {
-        while (len--) {
-            *dstp++ = *srcp++;
-        }
-    }
-    return dst;
-#endif /* HAVE_MEMMOVE */
-}
-
-int
-SDL_memcmp(const void *s1, const void *s2, size_t len)
-{
-#if defined(HAVE_MEMCMP)
-    return memcmp(s1, s2, len);
-#else
-    char *s1p = (char *) s1;
-    char *s2p = (char *) s2;
-    while (len--) {
-        if (*s1p != *s2p) {
-            return (*s1p - *s2p);
-        }
-        ++s1p;
-        ++s2p;
-    }
-    return 0;
-#endif /* HAVE_MEMCMP */
-}
-
-size_t
-SDL_strlen(const char *string)
-{
-#if defined(HAVE_STRLEN)
-    return strlen(string);
-#else
-    size_t len = 0;
-    while (*string++) {
-        ++len;
-    }
-    return len;
-#endif /* HAVE_STRLEN */
-}
-
-size_t
-SDL_wcslen(const wchar_t * string)
-{
-#if defined(HAVE_WCSLEN)
-    return wcslen(string);
-#else
-    size_t len = 0;
-    while (*string++) {
-        ++len;
-    }
-    return len;
-#endif /* HAVE_WCSLEN */
-}
-
-size_t
-SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen)
-{
-#if defined(HAVE_WCSLCPY)
-    return wcslcpy(dst, src, maxlen);
-#else
-    size_t srclen = SDL_wcslen(src);
-    if (maxlen > 0) {
-        size_t len = SDL_min(srclen, maxlen - 1);
-        SDL_memcpy(dst, src, len * sizeof(wchar_t));
-        dst[len] = '\0';
-    }
-    return srclen;
-#endif /* HAVE_WCSLCPY */
-}
-
-size_t
-SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen)
-{
-#if defined(HAVE_WCSLCAT)
-    return wcslcat(dst, src, maxlen);
-#else
-    size_t dstlen = SDL_wcslen(dst);
-    size_t srclen = SDL_wcslen(src);
-    if (dstlen < maxlen) {
-        SDL_wcslcpy(dst + dstlen, src, maxlen - dstlen);
-    }
-    return dstlen + srclen;
-#endif /* HAVE_WCSLCAT */
-}
-
-size_t
-SDL_strlcpy(char *dst, const char *src, size_t maxlen)
-{
-#if defined(HAVE_STRLCPY)
-    return strlcpy(dst, src, maxlen);
-#else
-    size_t srclen = SDL_strlen(src);
-    if (maxlen > 0) {
-        size_t len = SDL_min(srclen, maxlen - 1);
-        SDL_memcpy(dst, src, len);
-        dst[len] = '\0';
-    }
-    return srclen;
-#endif /* HAVE_STRLCPY */
-}
-
-size_t SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes)
-{
-    size_t src_bytes = SDL_strlen(src);
-    size_t bytes = SDL_min(src_bytes, dst_bytes - 1);
-    size_t i = 0;
-    char trailing_bytes = 0;
-    if (bytes)
-    {
-        unsigned char c = (unsigned char)src[bytes - 1];
-        if (UTF8_IsLeadByte(c))
-            --bytes;
-        else if (UTF8_IsTrailingByte(c))
-        {
-            for (i = bytes - 1; i != 0; --i)
-            {
-                c = (unsigned char)src[i];
-                trailing_bytes = UTF8_TrailingBytes(c);
-                if (trailing_bytes)
-                {
-                    if (bytes - i != trailing_bytes + 1)
-                        bytes = i;
-
-                    break;
-                }
-            }
-        }
-        SDL_memcpy(dst, src, bytes);
-    }
-    dst[bytes] = '\0';
-    return bytes;
-}
-
-size_t
-SDL_strlcat(char *dst, const char *src, size_t maxlen)
-{
-#if defined(HAVE_STRLCAT)
-    return strlcat(dst, src, maxlen);
-#else
-    size_t dstlen = SDL_strlen(dst);
-    size_t srclen = SDL_strlen(src);
-    if (dstlen < maxlen) {
-        SDL_strlcpy(dst + dstlen, src, maxlen - dstlen);
-    }
-    return dstlen + srclen;
-#endif /* HAVE_STRLCAT */
-}
-
-char *
-SDL_strdup(const char *string)
-{
-#if defined(HAVE_STRDUP)
-    return strdup(string);
-#else
-    size_t len = SDL_strlen(string) + 1;
-    char *newstr = SDL_malloc(len);
-    if (newstr) {
-        SDL_strlcpy(newstr, string, len);
-    }
-    return newstr;
-#endif /* HAVE_STRDUP */
-}
-
-char *
-SDL_strrev(char *string)
-{
-#if defined(HAVE__STRREV)
-    return _strrev(string);
-#else
-    size_t len = SDL_strlen(string);
-    char *a = &string[0];
-    char *b = &string[len - 1];
-    len /= 2;
-    while (len--) {
-        char c = *a;
-        *a++ = *b;
-        *b-- = c;
-    }
-    return string;
-#endif /* HAVE__STRREV */
-}
-
-char *
-SDL_strupr(char *string)
-{
-#if defined(HAVE__STRUPR)
-    return _strupr(string);
-#else
-    char *bufp = string;
-    while (*bufp) {
-        *bufp = SDL_toupper((unsigned char) *bufp);
-        ++bufp;
-    }
-    return string;
-#endif /* HAVE__STRUPR */
-}
-
-char *
-SDL_strlwr(char *string)
-{
-#if defined(HAVE__STRLWR)
-    return _strlwr(string);
-#else
-    char *bufp = string;
-    while (*bufp) {
-        *bufp = SDL_tolower((unsigned char) *bufp);
-        ++bufp;
-    }
-    return string;
-#endif /* HAVE__STRLWR */
-}
-
-char *
-SDL_strchr(const char *string, int c)
-{
-#ifdef HAVE_STRCHR
-    return SDL_const_cast(char*,strchr(string, c));
-#elif defined(HAVE_INDEX)
-    return SDL_const_cast(char*,index(string, c));
-#else
-    while (*string) {
-        if (*string == c) {
-            return (char *) string;
-        }
-        ++string;
-    }
-    return NULL;
-#endif /* HAVE_STRCHR */
-}
-
-char *
-SDL_strrchr(const char *string, int c)
-{
-#ifdef HAVE_STRRCHR
-    return SDL_const_cast(char*,strrchr(string, c));
-#elif defined(HAVE_RINDEX)
-    return SDL_const_cast(char*,rindex(string, c));
-#else
-    const char *bufp = string + SDL_strlen(string) - 1;
-    while (bufp >= string) {
-        if (*bufp == c) {
-            return (char *) bufp;
-        }
-        --bufp;
-    }
-    return NULL;
-#endif /* HAVE_STRRCHR */
-}
-
-char *
-SDL_strstr(const char *haystack, const char *needle)
-{
-#if defined(HAVE_STRSTR)
-    return SDL_const_cast(char*,strstr(haystack, needle));
-#else
-    size_t length = SDL_strlen(needle);
-    while (*haystack) {
-        if (SDL_strncmp(haystack, needle, length) == 0) {
-            return (char *) haystack;
-        }
-        ++haystack;
-    }
-    return NULL;
-#endif /* HAVE_STRSTR */
-}
-
-#if !defined(HAVE__LTOA) || !defined(HAVE__I64TOA) || \
-    !defined(HAVE__ULTOA) || !defined(HAVE__UI64TOA)
-static const char ntoa_table[] = {
-    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
-    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
-    'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
-    'U', 'V', 'W', 'X', 'Y', 'Z'
-};
-#endif /* ntoa() conversion table */
-
-char *
-SDL_itoa(int value, char *string, int radix)
-{
-#ifdef HAVE_ITOA
-    return itoa(value, string, radix);
-#else
-    return SDL_ltoa((long)value, string, radix);
-#endif /* HAVE_ITOA */
-}
-
-char *
-SDL_uitoa(unsigned int value, char *string, int radix)
-{
-#ifdef HAVE__UITOA
-    return _uitoa(value, string, radix);
-#else
-    return SDL_ultoa((unsigned long)value, string, radix);
-#endif /* HAVE__UITOA */
-}
-
-char *
-SDL_ltoa(long value, char *string, int radix)
-{
-#if defined(HAVE__LTOA)
-    return _ltoa(value, string, radix);
-#else
-    char *bufp = string;
-
-    if (value < 0) {
-        *bufp++ = '-';
-        value = -value;
-    }
-    if (value) {
-        while (value > 0) {
-            *bufp++ = ntoa_table[value % radix];
-            value /= radix;
-        }
-    } else {
-        *bufp++ = '0';
-    }
-    *bufp = '\0';
-
-    /* The numbers went into the string backwards. :) */
-    if (*string == '-') {
-        SDL_strrev(string + 1);
-    } else {
-        SDL_strrev(string);
-    }
-
-    return string;
-#endif /* HAVE__LTOA */
-}
-
-char *
-SDL_ultoa(unsigned long value, char *string, int radix)
-{
-#if defined(HAVE__ULTOA)
-    return _ultoa(value, string, radix);
-#else
-    char *bufp = string;
-
-    if (value) {
-        while (value > 0) {
-            *bufp++ = ntoa_table[value % radix];
-            value /= radix;
-        }
-    } else {
-        *bufp++ = '0';
-    }
-    *bufp = '\0';
-
-    /* The numbers went into the string backwards. :) */
-    SDL_strrev(string);
-
-    return string;
-#endif /* HAVE__ULTOA */
-}
-
-char *
-SDL_lltoa(Sint64 value, char *string, int radix)
-{
-#if defined(HAVE__I64TOA)
-    return _i64toa(value, string, radix);
-#else
-    char *bufp = string;
-
-    if (value < 0) {
-        *bufp++ = '-';
-        value = -value;
-    }
-    if (value) {
-        while (value > 0) {
-            *bufp++ = ntoa_table[value % radix];
-            value /= radix;
-        }
-    } else {
-        *bufp++ = '0';
-    }
-    *bufp = '\0';
-
-    /* The numbers went into the string backwards. :) */
-    if (*string == '-') {
-        SDL_strrev(string + 1);
-    } else {
-        SDL_strrev(string);
-    }
-
-    return string;
-#endif /* HAVE__I64TOA */
-}
-
-char *
-SDL_ulltoa(Uint64 value, char *string, int radix)
-{
-#if defined(HAVE__UI64TOA)
-    return _ui64toa(value, string, radix);
-#else
-    char *bufp = string;
-
-    if (value) {
-        while (value > 0) {
-            *bufp++ = ntoa_table[value % radix];
-            value /= radix;
-        }
-    } else {
-        *bufp++ = '0';
-    }
-    *bufp = '\0';
-
-    /* The numbers went into the string backwards. :) */
-    SDL_strrev(string);
-
-    return string;
-#endif /* HAVE__UI64TOA */
-}
-
-int SDL_atoi(const char *string)
-{
-#ifdef HAVE_ATOI
-    return atoi(string);
-#else
-    return SDL_strtol(string, NULL, 0);
-#endif /* HAVE_ATOI */
-}
-
-double SDL_atof(const char *string)
-{
-#ifdef HAVE_ATOF
-    return (double) atof(string);
-#else
-    return SDL_strtod(string, NULL);
-#endif /* HAVE_ATOF */
-}
-
-long
-SDL_strtol(const char *string, char **endp, int base)
-{
-#if defined(HAVE_STRTOL)
-    return strtol(string, endp, base);
-#else
-    size_t len;
-    long value;
-
-    if (!base) {
-        if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) {
-            base = 16;
-        } else {
-            base = 10;
-        }
-    }
-
-    len = SDL_ScanLong(string, base, &value);
-    if (endp) {
-        *endp = (char *) string + len;
-    }
-    return value;
-#endif /* HAVE_STRTOL */
-}
-
-unsigned long
-SDL_strtoul(const char *string, char **endp, int base)
-{
-#if defined(HAVE_STRTOUL)
-    return strtoul(string, endp, base);
-#else
-    size_t len;
-    unsigned long value;
-
-    if (!base) {
-        if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) {
-            base = 16;
-        } else {
-            base = 10;
-        }
-    }
-
-    len = SDL_ScanUnsignedLong(string, base, &value);
-    if (endp) {
-        *endp = (char *) string + len;
-    }
-    return value;
-#endif /* HAVE_STRTOUL */
-}
-
-Sint64
-SDL_strtoll(const char *string, char **endp, int base)
-{
-#if defined(HAVE_STRTOLL)
-    return strtoll(string, endp, base);
-#else
-    size_t len;
-    Sint64 value;
-
-    if (!base) {
-        if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) {
-            base = 16;
-        } else {
-            base = 10;
-        }
-    }
-
-    len = SDL_ScanLongLong(string, base, &value);
-    if (endp) {
-        *endp = (char *) string + len;
-    }
-    return value;
-#endif /* HAVE_STRTOLL */
-}
-
-Uint64
-SDL_strtoull(const char *string, char **endp, int base)
-{
-#if defined(HAVE_STRTOULL)
-    return strtoull(string, endp, base);
-#else
-    size_t len;
-    Uint64 value;
-
-    if (!base) {
-        if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) {
-            base = 16;
-        } else {
-            base = 10;
-        }
-    }
-
-    len = SDL_ScanUnsignedLongLong(string, base, &value);
-    if (endp) {
-        *endp = (char *) string + len;
-    }
-    return value;
-#endif /* HAVE_STRTOULL */
-}
-
-double
-SDL_strtod(const char *string, char **endp)
-{
-#if defined(HAVE_STRTOD)
-    return strtod(string, endp);
-#else
-    size_t len;
-    double value;
-
-    len = SDL_ScanFloat(string, &value);
-    if (endp) {
-        *endp = (char *) string + len;
-    }
-    return value;
-#endif /* HAVE_STRTOD */
-}
-
-int
-SDL_strcmp(const char *str1, const char *str2)
-{
-#if defined(HAVE_STRCMP)
-    return strcmp(str1, str2);
-#else
-    while (*str1 && *str2) {
-        if (*str1 != *str2)
-            break;
-        ++str1;
-        ++str2;
-    }
-    return (int) ((unsigned char) *str1 - (unsigned char) *str2);
-#endif /* HAVE_STRCMP */
-}
-
-int
-SDL_strncmp(const char *str1, const char *str2, size_t maxlen)
-{
-#if defined(HAVE_STRNCMP)
-    return strncmp(str1, str2, maxlen);
-#else
-    while (*str1 && *str2 && maxlen) {
-        if (*str1 != *str2)
-            break;
-        ++str1;
-        ++str2;
-        --maxlen;
-    }
-    if (!maxlen) {
-        return 0;
-    }
-    return (int) ((unsigned char) *str1 - (unsigned char) *str2);
-#endif /* HAVE_STRNCMP */
-}
-
-int
-SDL_strcasecmp(const char *str1, const char *str2)
-{
-#ifdef HAVE_STRCASECMP
-    return strcasecmp(str1, str2);
-#elif defined(HAVE__STRICMP)
-    return _stricmp(str1, str2);
-#else
-    char a = 0;
-    char b = 0;
-    while (*str1 && *str2) {
-        a = SDL_toupper((unsigned char) *str1);
-        b = SDL_toupper((unsigned char) *str2);
-        if (a != b)
-            break;
-        ++str1;
-        ++str2;
-    }
-    a = SDL_toupper(*str1);
-    b = SDL_toupper(*str2);
-    return (int) ((unsigned char) a - (unsigned char) b);
-#endif /* HAVE_STRCASECMP */
-}
-
-int
-SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen)
-{
-#ifdef HAVE_STRNCASECMP
-    return strncasecmp(str1, str2, maxlen);
-#elif defined(HAVE__STRNICMP)
-    return _strnicmp(str1, str2, maxlen);
-#else
-    char a = 0;
-    char b = 0;
-    while (*str1 && *str2 && maxlen) {
-        a = SDL_tolower((unsigned char) *str1);
-        b = SDL_tolower((unsigned char) *str2);
-        if (a != b)
-            break;
-        ++str1;
-        ++str2;
-        --maxlen;
-    }
-    if (maxlen == 0) {
-        return 0;
-    } else {
-        a = SDL_tolower((unsigned char) *str1);
-        b = SDL_tolower((unsigned char) *str2);
-        return (int) ((unsigned char) a - (unsigned char) b);
-    }
-#endif /* HAVE_STRNCASECMP */
-}
-
-#ifdef HAVE_SSCANF
-int
-SDL_sscanf(const char *text, const char *fmt, ...)
-{
-    int rc;
-    va_list ap;
-    va_start(ap, fmt);
-    rc = vsscanf(text, fmt, ap);
-    va_end(ap);
-    return rc;
-}
-#else
-int
-SDL_sscanf(const char *text, const char *fmt, ...)
-{
-    va_list ap;
-    int retval = 0;
-
-    va_start(ap, fmt);
-    while (*fmt) {
-        if (*fmt == ' ') {
-            while (SDL_isspace((unsigned char) *text)) {
-                ++text;
-            }
-            ++fmt;
-            continue;
-        }
-        if (*fmt == '%') {
-            SDL_bool done = SDL_FALSE;
-            long count = 0;
-            int radix = 10;
-            enum
-            {
-                DO_SHORT,
-                DO_INT,
-                DO_LONG,
-                DO_LONGLONG
-            } inttype = DO_INT;
-            SDL_bool suppress = SDL_FALSE;
-
-            ++fmt;
-            if (*fmt == '%') {
-                if (*text == '%') {
-                    ++text;
-                    ++fmt;
-                    continue;
-                }
-                break;
-            }
-            if (*fmt == '*') {
-                suppress = SDL_TRUE;
-                ++fmt;
-            }
-            fmt += SDL_ScanLong(fmt, 10, &count);
-
-            if (*fmt == 'c') {
-                if (!count) {
-                    count = 1;
-                }
-                if (suppress) {
-                    while (count--) {
-                        ++text;
-                    }
-                } else {
-                    char *valuep = va_arg(ap, char *);
-                    while (count--) {
-                        *valuep++ = *text++;
-                    }
-                    ++retval;
-                }
-                continue;
-            }
-
-            while (SDL_isspace((unsigned char) *text)) {
-                ++text;
-            }
-
-            /* FIXME: implement more of the format specifiers */
-            while (!done) {
-                switch (*fmt) {
-                case '*':
-                    suppress = SDL_TRUE;
-                    break;
-                case 'h':
-                    if (inttype > DO_SHORT) {
-                        ++inttype;
-                    }
-                    break;
-                case 'l':
-                    if (inttype < DO_LONGLONG) {
-                        ++inttype;
-                    }
-                    break;
-                case 'I':
-                    if (SDL_strncmp(fmt, "I64", 3) == 0) {
-                        fmt += 2;
-                        inttype = DO_LONGLONG;
-                    }
-                    break;
-                case 'i':
-                    {
-                        int index = 0;
-                        if (text[index] == '-') {
-                            ++index;
-                        }
-                        if (text[index] == '0') {
-                            if (SDL_tolower((unsigned char) text[index + 1]) == 'x') {
-                                radix = 16;
-                            } else {
-                                radix = 8;
-                            }
-                        }
-                    }
-                    /* Fall through to %d handling */
-                case 'd':
-                    if (inttype == DO_LONGLONG) {
-                        Sint64 value;
-                        text += SDL_ScanLongLong(text, radix, &value);
-                        if (!suppress) {
-                            Sint64 *valuep = va_arg(ap, Sint64 *);
-                            *valuep = value;
-                            ++retval;
-                        }
-                    } else {
-                        long value;
-                        text += SDL_ScanLong(text, radix, &value);
-                        if (!suppress) {
-                            switch (inttype) {
-                            case DO_SHORT:
-                                {
-                                    short *valuep = va_arg(ap, short *);
-                                    *valuep = (short) value;
-                                }
-                                break;
-                            case DO_INT:
-                                {
-                                    int *valuep = va_arg(ap, int *);
-                                    *valuep = (int) value;
-                                }
-                                break;
-                            case DO_LONG:
-                                {
-                                    long *valuep = va_arg(ap, long *);
-                                    *valuep = value;
-                                }
-                                break;
-                            case DO_LONGLONG:
-                                /* Handled above */
-                                break;
-                            }
-                            ++retval;
-                        }
-                    }
-                    done = SDL_TRUE;
-                    break;
-                case 'o':
-                    if (radix == 10) {
-                        radix = 8;
-                    }
-                    /* Fall through to unsigned handling */
-                case 'x':
-                case 'X':
-                    if (radix == 10) {
-                        radix = 16;
-                    }
-                    /* Fall through to unsigned handling */
-                case 'u':
-                    if (inttype == DO_LONGLONG) {
-                        Uint64 value;
-                        text += SDL_ScanUnsignedLongLong(text, radix, &value);
-                        if (!suppress) {
-                            Uint64 *valuep = va_arg(ap, Uint64 *);
-                            *valuep = value;
-                            ++retval;
-                        }
-                    } else {
-                        unsigned long value;
-                        text += SDL_ScanUnsignedLong(text, radix, &value);
-                        if (!suppress) {
-                            switch (inttype) {
-                            case DO_SHORT:
-                                {
-                                    short *valuep = va_arg(ap, short *);
-                                    *valuep = (short) value;
-                                }
-                                break;
-                            case DO_INT:
-                                {
-                                    int *valuep = va_arg(ap, int *);
-                                    *valuep = (int) value;
-                                }
-                                break;
-                            case DO_LONG:
-                                {
-                                    long *valuep = va_arg(ap, long *);
-                                    *valuep = value;
-                                }
-                                break;
-                            case DO_LONGLONG:
-                                /* Handled above */
-                                break;
-                            }
-                            ++retval;
-                        }
-                    }
-                    done = SDL_TRUE;
-                    break;
-                case 'p':
-                    {
-                        uintptr_t value;
-                        text += SDL_ScanUintPtrT(text, 16, &value);
-                        if (!suppress) {
-                            void **valuep = va_arg(ap, void **);
-                            *valuep = (void *) value;
-                            ++retval;
-                        }
-                    }
-                    done = SDL_TRUE;
-                    break;
-                case 'f':
-                    {
-                        double value;
-                        text += SDL_ScanFloat(text, &value);
-                        if (!suppress) {
-                            float *valuep = va_arg(ap, float *);
-                            *valuep = (float) value;
-                            ++retval;
-                        }
-                    }
-                    done = SDL_TRUE;
-                    break;
-                case 's':
-                    if (suppress) {
-                        while (!SDL_isspace((unsigned char) *text)) {
-                            ++text;
-                            if (count) {
-                                if (--count == 0) {
-                                    break;
-                                }
-                            }
-                        }
-                    } else {
-                        char *valuep = va_arg(ap, char *);
-                        while (!SDL_isspace((unsigned char) *text)) {
-                            *valuep++ = *text++;
-                            if (count) {
-                                if (--count == 0) {
-                                    break;
-                                }
-                            }
-                        }
-                        *valuep = '\0';
-                        ++retval;
-                    }
-                    done = SDL_TRUE;
-                    break;
-                default:
-                    done = SDL_TRUE;
-                    break;
-                }
-                ++fmt;
-            }
-            continue;
-        }
-        if (*text == *fmt) {
-            ++text;
-            ++fmt;
-            continue;
-        }
-        /* Text didn't match format specifier */
-        break;
-    }
-    va_end(ap);
-
-    return retval;
-}
-#endif /* HAVE_SSCANF */
-
-int
-SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...)
-{
-    va_list ap;
-    int retval;
-
-    va_start(ap, fmt);
-    retval = SDL_vsnprintf(text, maxlen, fmt, ap);
-    va_end(ap);
-
-    return retval;
-}
-
-#ifdef HAVE_VSNPRINTF
-int SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap)
-{
-    return vsnprintf(text, maxlen, fmt, ap);
-}
-#else
- /* FIXME: implement more of the format specifiers */
-typedef enum
-{
-    SDL_CASE_NOCHANGE,
-    SDL_CASE_LOWER,
-    SDL_CASE_UPPER
-} SDL_letter_case;
-
-typedef struct
-{
-    SDL_bool left_justify;
-    SDL_bool force_sign;
-    SDL_bool force_type;
-    SDL_bool pad_zeroes;
-    SDL_letter_case force_case;
-    int width;
-    int radix;
-    int precision;
-} SDL_FormatInfo;
-
-static size_t
-SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *string)
-{
-    size_t length = 0;
-
-    if (info && info->width && (size_t)info->width > SDL_strlen(string)) {
-        char fill = info->pad_zeroes ? '0' : ' ';
-        size_t width = info->width - SDL_strlen(string);
-        while (width-- > 0 && maxlen > 0) {
-            *text++ = fill;
-            ++length;
-            --maxlen;
-        }
-    }
-
-    length += SDL_strlcpy(text, string, maxlen);
-
-    if (info) {
-        if (info->force_case == SDL_CASE_LOWER) {
-            SDL_strlwr(text);
-        } else if (info->force_case == SDL_CASE_UPPER) {
-            SDL_strupr(text);
-        }
-    }
-    return length;
-}
-
-static size_t
-SDL_PrintLong(char *text, size_t maxlen, SDL_FormatInfo *info, long value)
-{
-    char num[130];
-
-    SDL_ltoa(value, num, info ? info->radix : 10);
-    return SDL_PrintString(text, maxlen, info, num);
-}
-
-static size_t
-SDL_PrintUnsignedLong(char *text, size_t maxlen, SDL_FormatInfo *info, unsigned long value)
-{
-    char num[130];
-
-    SDL_ultoa(value, num, info ? info->radix : 10);
-    return SDL_PrintString(text, maxlen, info, num);
-}
-
-static size_t
-SDL_PrintLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value)
-{
-    char num[130];
-
-    SDL_lltoa(value, num, info ? info->radix : 10);
-    return SDL_PrintString(text, maxlen, info, num);
-}
-
-static size_t
-SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint64 value)
-{
-    char num[130];
-
-    SDL_ulltoa(value, num, info ? info->radix : 10);
-    return SDL_PrintString(text, maxlen, info, num);
-}
-
-static size_t
-SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg)
-{
-    int width;
-    size_t len;
-    size_t left = maxlen;
-    char *textstart = text;
-
-    if (arg) {
-        /* This isn't especially accurate, but hey, it's easy. :) */
-        unsigned long value;
-
-        if (arg < 0) {
-            if (left > 1) {
-                *text = '-';
-                --left;
-            }
-            ++text;
-            arg = -arg;
-        } else if (info->force_sign) {
-            if (left > 1) {
-                *text = '+';
-                --left;
-            }
-            ++text;
-        }
-        value = (unsigned long) arg;
-        len = SDL_PrintUnsignedLong(text, left, NULL, value);
-        text += len;
-        if (len >= left) {
-            left = SDL_min(left, 1);
-        } else {
-            left -= len;
-        }
-        arg -= value;
-        if (info->precision < 0) {
-            info->precision = 6;
-        }
-        if (info->force_type || info->precision > 0) {
-            int mult = 10;
-            if (left > 1) {
-                *text = '.';
-                --left;
-            }
-            ++text;
-            while (info->precision-- > 0) {
-                value = (unsigned long) (arg * mult);
-                len = SDL_PrintUnsignedLong(text, left, NULL, value);
-                text += len;
-                if (len >= left) {
-                    left = SDL_min(left, 1);
-                } else {
-                    left -= len;
-                }
-                arg -= (double) value / mult;
-                mult *= 10;
-            }
-        }
-    } else {
-        if (left > 1) {
-            *text = '0';
-            --left;
-        }
-        ++text;
-        if (info->force_type) {
-            if (left > 1) {
-                *text = '.';
-                --left;
-            }
-            ++text;
-        }
-    }
-
-    width = info->width - (int)(text - textstart);
-    if (width > 0) {
-        char fill = info->pad_zeroes ? '0' : ' ';
-        char *end = text+left-1;
-        len = (text - textstart);
-        for (len = (text - textstart); len--; ) {
-            if ((textstart+len+width) < end) {
-                *(textstart+len+width) = *(textstart+len);
-            }
-        }
-        len = (size_t)width;
-        text += len;
-        if (len >= left) {
-            left = SDL_min(left, 1);
-        } else {
-            left -= len;
-        }
-        while (len--) {
-            if (textstart+len < end) {
-                textstart[len] = fill;
-            }
-        }
-    }
-
-    return (text - textstart);
-}
-
-int
-SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap)
-{
-    size_t left = maxlen;
-    char *textstart = text;
-
-    while (*fmt) {
-        if (*fmt == '%') {
-            SDL_bool done = SDL_FALSE;
-            size_t len = 0;
-            SDL_bool check_flag;
-            SDL_FormatInfo info;
-            enum
-            {
-                DO_INT,
-                DO_LONG,
-                DO_LONGLONG
-            } inttype = DO_INT;
-
-            SDL_zero(info);
-            info.radix = 10;
-            info.precision = -1;
-
-            check_flag = SDL_TRUE;
-            while (check_flag) {
-                ++fmt;
-                switch (*fmt) {
-                case '-':
-                    info.left_justify = SDL_TRUE;
-                    break;
-                case '+':
-                    info.force_sign = SDL_TRUE;
-                    break;
-                case '#':
-                    info.force_type = SDL_TRUE;
-                    break;
-                case '0':
-                    info.pad_zeroes = SDL_TRUE;
-                    break;
-                default:
-                    check_flag = SDL_FALSE;
-                    break;
-                }
-            }
-
-            if (*fmt >= '0' && *fmt <= '9') {
-                info.width = SDL_strtol(fmt, (char **)&fmt, 0);
-            }
-
-            if (*fmt == '.') {
-                ++fmt;
-                if (*fmt >= '0' && *fmt <= '9') {
-                    info.precision = SDL_strtol(fmt, (char **)&fmt, 0);
-                } else {
-                    info.precision = 0;
-                }
-            }
-
-            while (!done) {
-                switch (*fmt) {
-                case '%':
-                    if (left > 1) {
-                        *text = '%';
-                    }
-                    len = 1;
-                    done = SDL_TRUE;
-                    break;
-                case 'c':
-                    /* char is promoted to int when passed through (...) */
-                    if (left > 1) {
-                        *text = (char) va_arg(ap, int);
-                    }
-                    len = 1;
-                    done = SDL_TRUE;
-                    break;
-                case 'h':
-                    /* short is promoted to int when passed through (...) */
-                    break;
-                case 'l':
-                    if (inttype < DO_LONGLONG) {
-                        ++inttype;
-                    }
-                    break;
-                case 'I':
-                    if (SDL_strncmp(fmt, "I64", 3) == 0) {
-                        fmt += 2;
-                        inttype = DO_LONGLONG;
-                    }
-                    break;
-                case 'i':
-                case 'd':
-                    switch (inttype) {
-                    case DO_INT:
-                        len = SDL_PrintLong(text, left, &info,
-                                            (long) va_arg(ap, int));
-                        break;
-                    case DO_LONG:
-                        len = SDL_PrintLong(text, left, &info,
-                                            va_arg(ap, long));
-                        break;
-                    case DO_LONGLONG:
-                        len = SDL_PrintLongLong(text, left, &info,
-                                                va_arg(ap, Sint64));
-                        break;
-                    }
-                    done = SDL_TRUE;
-                    break;
-                case 'p':
-                case 'x':
-                    info.force_case = SDL_CASE_LOWER;
-                    /* Fall through to 'X' handling */
-                case 'X':
-                    if (info.force_case == SDL_CASE_NOCHANGE) {
-                        info.force_case = SDL_CASE_UPPER;
-                    }
-                    if (info.radix == 10) {
-                        info.radix = 16;
-                    }
-                    if (*fmt == 'p') {
-                        inttype = DO_LONG;
-                    }
-                    /* Fall through to unsigned handling */
-                case 'o':
-                    if (info.radix == 10) {
-                        info.radix = 8;
-                    }
-                    /* Fall through to unsigned handling */
-                case 'u':
-                    info.pad_zeroes = SDL_TRUE;
-                    switch (inttype) {
-                    case DO_INT:
-                        len = SDL_PrintUnsignedLong(text, left, &info,
-                                                    (unsigned long)
-                                                    va_arg(ap, unsigned int));
-                        break;
-                    case DO_LONG:
-                        len = SDL_PrintUnsignedLong(text, left, &info,
-                                                    va_arg(ap, unsigned long));
-                        break;
-                    case DO_LONGLONG:
-                        len = SDL_PrintUnsignedLongLong(text, left, &info,
-                                                        va_arg(ap, Uint64));
-                        break;
-                    }
-                    done = SDL_TRUE;
-                    break;
-                case 'f':
-                    len = SDL_PrintFloat(text, left, &info, va_arg(ap, double));
-                    done = SDL_TRUE;
-                    break;
-                case 's':
-                    len = SDL_PrintString(text, left, &info, va_arg(ap, char *));
-                    done = SDL_TRUE;
-                    break;
-                default:
-                    done = SDL_TRUE;
-                    break;
-                }
-                ++fmt;
-            }
-            text += len;
-            if (len >= left) {
-                left = SDL_min(left, 1);
-            } else {
-                left -= len;
-            }
-        } else {
-            if (left > 1) {
-                *text = *fmt;
-                --left;
-            }
-            ++fmt;
-            ++text;
-        }
-    }
-    if (left > 0) {
-        *text = '\0';
-    }
-    return (int)(text - textstart);
-}
-#endif /* HAVE_VSNPRINTF */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/test/SDL_test_assert.c b/deps/SDL2/src/test/SDL_test_assert.c
deleted file mode 100644
index 6f08d1f..0000000
--- a/deps/SDL2/src/test/SDL_test_assert.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-
- Used by the test framework and test cases.
-
-*/
-
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-/* Assert check message format */
-const char *SDLTest_AssertCheckFormat = "Assert '%s': %s";
-
-/* Assert summary message format */
-const char *SDLTest_AssertSummaryFormat = "Assert Summary: Total=%d Passed=%d Failed=%d";
-
-/* ! \brief counts the failed asserts */
-static Uint32 SDLTest_AssertsFailed = 0;
-
-/* ! \brief counts the passed asserts */
-static Uint32 SDLTest_AssertsPassed = 0;
-
-/*
- *  Assert that logs and break execution flow on failures (i.e. for harness errors).
- */
-void SDLTest_Assert(int assertCondition, const char *assertDescription, ...)
-{
-        va_list list;
-    char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
-
-    /* Print assert description into a buffer */
-    SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
-    va_start(list, assertDescription);
-    SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list);
-    va_end(list);
-
-    /* Log, then assert and break on failure */
-    SDL_assert((SDLTest_AssertCheck(assertCondition, logMessage)));
-}
-
-/*
- * Assert that logs but does not break execution flow on failures (i.e. for test cases).
- */
-int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...)
-{
-    va_list list;
-    char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
-
-    /* Print assert description into a buffer */
-    SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
-    va_start(list, assertDescription);
-    SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list);
-    va_end(list);
-
-    /* Log pass or fail message */
-    if (assertCondition == ASSERT_FAIL)
-    {
-        SDLTest_AssertsFailed++;
-        SDLTest_LogError(SDLTest_AssertCheckFormat, logMessage, "Failed");
-    }
-    else
-    {
-        SDLTest_AssertsPassed++;
-        SDLTest_Log(SDLTest_AssertCheckFormat, logMessage, "Passed");
-    }
-
-    return assertCondition;
-}
-
-/*
- * Explicitly passing Assert that logs (i.e. for test cases).
- */
-void SDLTest_AssertPass(const char *assertDescription, ...)
-{
-    va_list list;
-    char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
-
-    /* Print assert description into a buffer */
-    SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
-    va_start(list, assertDescription);
-    SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list);
-    va_end(list);
-
-        /* Log pass message */
-    SDLTest_AssertsPassed++;
-    SDLTest_Log(SDLTest_AssertCheckFormat, logMessage, "Pass");
-}
-
-/*
- * Resets the assert summary counters to zero.
- */
-void SDLTest_ResetAssertSummary()
-{
-    SDLTest_AssertsPassed = 0;
-    SDLTest_AssertsFailed = 0;
-}
-
-/*
- * Logs summary of all assertions (total, pass, fail) since last reset
- * as INFO (failed==0) or ERROR (failed > 0).
- */
-void SDLTest_LogAssertSummary()
-{
-    Uint32 totalAsserts = SDLTest_AssertsPassed + SDLTest_AssertsFailed;
-    if (SDLTest_AssertsFailed == 0)
-    {
-        SDLTest_Log(SDLTest_AssertSummaryFormat, totalAsserts, SDLTest_AssertsPassed, SDLTest_AssertsFailed);
-    }
-    else
-    {
-        SDLTest_LogError(SDLTest_AssertSummaryFormat, totalAsserts, SDLTest_AssertsPassed, SDLTest_AssertsFailed);
-    }
-}
-
-/*
- * Converts the current assert state into a test result
- */
-int SDLTest_AssertSummaryToTestResult()
-{
-    if (SDLTest_AssertsFailed > 0) {
-        return TEST_RESULT_FAILED;
-    } else {
-        if (SDLTest_AssertsPassed > 0) {
-            return TEST_RESULT_PASSED;
-        } else {
-            return TEST_RESULT_NO_ASSERT;
-        }
-    }
-}
diff --git a/deps/SDL2/src/test/SDL_test_common.c b/deps/SDL2/src/test/SDL_test_common.c
deleted file mode 100644
index c117a93..0000000
--- a/deps/SDL2/src/test/SDL_test_common.c
+++ /dev/null
@@ -1,1432 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* Ported from original test\common.c file. */
-
-#include "SDL_config.h"
-#include "SDL_test.h"
-
-#include <stdio.h>
-
-#define VIDEO_USAGE \
-"[--video driver] [--renderer driver] [--gldebug] [--info all|video|modes|render|event] [--log all|error|system|audio|video|render|input] [--display N] [--fullscreen | --fullscreen-desktop | --windows N] [--title title] [--icon icon.bmp] [--center | --position X,Y] [--geometry WxH] [--min-geometry WxH] [--max-geometry WxH] [--logical WxH] [--scale N] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab] [--allow-hidpi]"
-
-#define AUDIO_USAGE \
-"[--rate N] [--format U8|S8|U16|U16LE|U16BE|S16|S16LE|S16BE] [--channels N] [--samples N]"
-
-SDLTest_CommonState *
-SDLTest_CommonCreateState(char **argv, Uint32 flags)
-{
-    SDLTest_CommonState *state = (SDLTest_CommonState *)SDL_calloc(1, sizeof(*state));
-    if (!state) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    /* Initialize some defaults */
-    state->argv = argv;
-    state->flags = flags;
-    state->window_title = argv[0];
-    state->window_flags = 0;
-    state->window_x = SDL_WINDOWPOS_UNDEFINED;
-    state->window_y = SDL_WINDOWPOS_UNDEFINED;
-    state->window_w = DEFAULT_WINDOW_WIDTH;
-    state->window_h = DEFAULT_WINDOW_HEIGHT;
-    state->num_windows = 1;
-    state->audiospec.freq = 22050;
-    state->audiospec.format = AUDIO_S16;
-    state->audiospec.channels = 2;
-    state->audiospec.samples = 2048;
-
-    /* Set some very sane GL defaults */
-    state->gl_red_size = 3;
-    state->gl_green_size = 3;
-    state->gl_blue_size = 2;
-    state->gl_alpha_size = 0;
-    state->gl_buffer_size = 0;
-    state->gl_depth_size = 16;
-    state->gl_stencil_size = 0;
-    state->gl_double_buffer = 1;
-    state->gl_accum_red_size = 0;
-    state->gl_accum_green_size = 0;
-    state->gl_accum_blue_size = 0;
-    state->gl_accum_alpha_size = 0;
-    state->gl_stereo = 0;
-    state->gl_multisamplebuffers = 0;
-    state->gl_multisamplesamples = 0;
-    state->gl_retained_backing = 1;
-    state->gl_accelerated = -1;
-    state->gl_debug = 0;
-
-    return state;
-}
-
-int
-SDLTest_CommonArg(SDLTest_CommonState * state, int index)
-{
-    char **argv = state->argv;
-
-    if (SDL_strcasecmp(argv[index], "--video") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->videodriver = argv[index];
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--renderer") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->renderdriver = argv[index];
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--gldebug") == 0) {
-        state->gl_debug = 1;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--info") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        if (SDL_strcasecmp(argv[index], "all") == 0) {
-            state->verbose |=
-                (VERBOSE_VIDEO | VERBOSE_MODES | VERBOSE_RENDER |
-                 VERBOSE_EVENT);
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "video") == 0) {
-            state->verbose |= VERBOSE_VIDEO;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "modes") == 0) {
-            state->verbose |= VERBOSE_MODES;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "render") == 0) {
-            state->verbose |= VERBOSE_RENDER;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "event") == 0) {
-            state->verbose |= VERBOSE_EVENT;
-            return 2;
-        }
-        return -1;
-    }
-    if (SDL_strcasecmp(argv[index], "--log") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        if (SDL_strcasecmp(argv[index], "all") == 0) {
-            SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "error") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_ERROR, SDL_LOG_PRIORITY_VERBOSE);
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "system") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE);
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "audio") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_AUDIO, SDL_LOG_PRIORITY_VERBOSE);
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "video") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_VIDEO, SDL_LOG_PRIORITY_VERBOSE);
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "render") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_RENDER, SDL_LOG_PRIORITY_VERBOSE);
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "input") == 0) {
-            SDL_LogSetPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_VERBOSE);
-            return 2;
-        }
-        return -1;
-    }
-    if (SDL_strcasecmp(argv[index], "--display") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->display = SDL_atoi(argv[index]);
-        if (SDL_WINDOWPOS_ISUNDEFINED(state->window_x)) {
-            state->window_x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(state->display);
-            state->window_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(state->display);
-        }
-        if (SDL_WINDOWPOS_ISCENTERED(state->window_x)) {
-            state->window_x = SDL_WINDOWPOS_CENTERED_DISPLAY(state->display);
-            state->window_y = SDL_WINDOWPOS_CENTERED_DISPLAY(state->display);
-        }
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--fullscreen") == 0) {
-        state->window_flags |= SDL_WINDOW_FULLSCREEN;
-        state->num_windows = 1;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--fullscreen-desktop") == 0) {
-        state->window_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
-        state->num_windows = 1;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--allow-highdpi") == 0) {
-        state->window_flags |= SDL_WINDOW_ALLOW_HIGHDPI;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--windows") == 0) {
-        ++index;
-        if (!argv[index] || !SDL_isdigit(*argv[index])) {
-            return -1;
-        }
-        if (!(state->window_flags & SDL_WINDOW_FULLSCREEN)) {
-            state->num_windows = SDL_atoi(argv[index]);
-        }
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--title") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->window_title = argv[index];
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--icon") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->window_icon = argv[index];
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--center") == 0) {
-        state->window_x = SDL_WINDOWPOS_CENTERED;
-        state->window_y = SDL_WINDOWPOS_CENTERED;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--position") == 0) {
-        char *x, *y;
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        x = argv[index];
-        y = argv[index];
-        while (*y && *y != ',') {
-            ++y;
-        }
-        if (!*y) {
-            return -1;
-        }
-        *y++ = '\0';
-        state->window_x = SDL_atoi(x);
-        state->window_y = SDL_atoi(y);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--geometry") == 0) {
-        char *w, *h;
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        w = argv[index];
-        h = argv[index];
-        while (*h && *h != 'x') {
-            ++h;
-        }
-        if (!*h) {
-            return -1;
-        }
-        *h++ = '\0';
-        state->window_w = SDL_atoi(w);
-        state->window_h = SDL_atoi(h);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--min-geometry") == 0) {
-        char *w, *h;
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        w = argv[index];
-        h = argv[index];
-        while (*h && *h != 'x') {
-            ++h;
-        }
-        if (!*h) {
-            return -1;
-        }
-        *h++ = '\0';
-        state->window_minW = SDL_atoi(w);
-        state->window_minH = SDL_atoi(h);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--max-geometry") == 0) {
-        char *w, *h;
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        w = argv[index];
-        h = argv[index];
-        while (*h && *h != 'x') {
-            ++h;
-        }
-        if (!*h) {
-            return -1;
-        }
-        *h++ = '\0';
-        state->window_maxW = SDL_atoi(w);
-        state->window_maxH = SDL_atoi(h);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--logical") == 0) {
-        char *w, *h;
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        w = argv[index];
-        h = argv[index];
-        while (*h && *h != 'x') {
-            ++h;
-        }
-        if (!*h) {
-            return -1;
-        }
-        *h++ = '\0';
-        state->logical_w = SDL_atoi(w);
-        state->logical_h = SDL_atoi(h);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--scale") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->scale = (float)SDL_atof(argv[index]);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--depth") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->depth = SDL_atoi(argv[index]);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--refresh") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->refresh_rate = SDL_atoi(argv[index]);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--vsync") == 0) {
-        state->render_flags |= SDL_RENDERER_PRESENTVSYNC;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--noframe") == 0) {
-        state->window_flags |= SDL_WINDOW_BORDERLESS;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--resize") == 0) {
-        state->window_flags |= SDL_WINDOW_RESIZABLE;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--minimize") == 0) {
-        state->window_flags |= SDL_WINDOW_MINIMIZED;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--maximize") == 0) {
-        state->window_flags |= SDL_WINDOW_MAXIMIZED;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--grab") == 0) {
-        state->window_flags |= SDL_WINDOW_INPUT_GRABBED;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--rate") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->audiospec.freq = SDL_atoi(argv[index]);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--format") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        if (SDL_strcasecmp(argv[index], "U8") == 0) {
-            state->audiospec.format = AUDIO_U8;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "S8") == 0) {
-            state->audiospec.format = AUDIO_S8;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "U16") == 0) {
-            state->audiospec.format = AUDIO_U16;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "U16LE") == 0) {
-            state->audiospec.format = AUDIO_U16LSB;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "U16BE") == 0) {
-            state->audiospec.format = AUDIO_U16MSB;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "S16") == 0) {
-            state->audiospec.format = AUDIO_S16;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "S16LE") == 0) {
-            state->audiospec.format = AUDIO_S16LSB;
-            return 2;
-        }
-        if (SDL_strcasecmp(argv[index], "S16BE") == 0) {
-            state->audiospec.format = AUDIO_S16MSB;
-            return 2;
-        }
-        return -1;
-    }
-    if (SDL_strcasecmp(argv[index], "--channels") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->audiospec.channels = (Uint8) SDL_atoi(argv[index]);
-        return 2;
-    }
-    if (SDL_strcasecmp(argv[index], "--samples") == 0) {
-        ++index;
-        if (!argv[index]) {
-            return -1;
-        }
-        state->audiospec.samples = (Uint16) SDL_atoi(argv[index]);
-        return 2;
-    }
-    if ((SDL_strcasecmp(argv[index], "-h") == 0)
-        || (SDL_strcasecmp(argv[index], "--help") == 0)) {
-        /* Print the usage message */
-        return -1;
-    }
-    if (SDL_strcmp(argv[index], "-NSDocumentRevisionsDebugMode") == 0) {
-    /* Debug flag sent by Xcode */
-        return 2;
-    }
-    return 0;
-}
-
-const char *
-SDLTest_CommonUsage(SDLTest_CommonState * state)
-{
-    switch (state->flags & (SDL_INIT_VIDEO | SDL_INIT_AUDIO)) {
-    case SDL_INIT_VIDEO:
-        return VIDEO_USAGE;
-    case SDL_INIT_AUDIO:
-        return AUDIO_USAGE;
-    case (SDL_INIT_VIDEO | SDL_INIT_AUDIO):
-        return VIDEO_USAGE " " AUDIO_USAGE;
-    default:
-        return "";
-    }
-}
-
-static void
-SDLTest_PrintRendererFlag(Uint32 flag)
-{
-    switch (flag) {
-    case SDL_RENDERER_PRESENTVSYNC:
-        fprintf(stderr, "PresentVSync");
-        break;
-    case SDL_RENDERER_ACCELERATED:
-        fprintf(stderr, "Accelerated");
-        break;
-    default:
-        fprintf(stderr, "0x%8.8x", flag);
-        break;
-    }
-}
-
-static void
-SDLTest_PrintPixelFormat(Uint32 format)
-{
-    switch (format) {
-    case SDL_PIXELFORMAT_UNKNOWN:
-        fprintf(stderr, "Unknwon");
-        break;
-    case SDL_PIXELFORMAT_INDEX1LSB:
-        fprintf(stderr, "Index1LSB");
-        break;
-    case SDL_PIXELFORMAT_INDEX1MSB:
-        fprintf(stderr, "Index1MSB");
-        break;
-    case SDL_PIXELFORMAT_INDEX4LSB:
-        fprintf(stderr, "Index4LSB");
-        break;
-    case SDL_PIXELFORMAT_INDEX4MSB:
-        fprintf(stderr, "Index4MSB");
-        break;
-    case SDL_PIXELFORMAT_INDEX8:
-        fprintf(stderr, "Index8");
-        break;
-    case SDL_PIXELFORMAT_RGB332:
-        fprintf(stderr, "RGB332");
-        break;
-    case SDL_PIXELFORMAT_RGB444:
-        fprintf(stderr, "RGB444");
-        break;
-    case SDL_PIXELFORMAT_RGB555:
-        fprintf(stderr, "RGB555");
-        break;
-    case SDL_PIXELFORMAT_BGR555:
-        fprintf(stderr, "BGR555");
-        break;
-    case SDL_PIXELFORMAT_ARGB4444:
-        fprintf(stderr, "ARGB4444");
-        break;
-    case SDL_PIXELFORMAT_ABGR4444:
-        fprintf(stderr, "ABGR4444");
-        break;
-    case SDL_PIXELFORMAT_ARGB1555:
-        fprintf(stderr, "ARGB1555");
-        break;
-    case SDL_PIXELFORMAT_ABGR1555:
-        fprintf(stderr, "ABGR1555");
-        break;
-    case SDL_PIXELFORMAT_RGB565:
-        fprintf(stderr, "RGB565");
-        break;
-    case SDL_PIXELFORMAT_BGR565:
-        fprintf(stderr, "BGR565");
-        break;
-    case SDL_PIXELFORMAT_RGB24:
-        fprintf(stderr, "RGB24");
-        break;
-    case SDL_PIXELFORMAT_BGR24:
-        fprintf(stderr, "BGR24");
-        break;
-    case SDL_PIXELFORMAT_RGB888:
-        fprintf(stderr, "RGB888");
-        break;
-    case SDL_PIXELFORMAT_BGR888:
-        fprintf(stderr, "BGR888");
-        break;
-    case SDL_PIXELFORMAT_ARGB8888:
-        fprintf(stderr, "ARGB8888");
-        break;
-    case SDL_PIXELFORMAT_RGBA8888:
-        fprintf(stderr, "RGBA8888");
-        break;
-    case SDL_PIXELFORMAT_ABGR8888:
-        fprintf(stderr, "ABGR8888");
-        break;
-    case SDL_PIXELFORMAT_BGRA8888:
-        fprintf(stderr, "BGRA8888");
-        break;
-    case SDL_PIXELFORMAT_ARGB2101010:
-        fprintf(stderr, "ARGB2101010");
-        break;
-    case SDL_PIXELFORMAT_YV12:
-        fprintf(stderr, "YV12");
-        break;
-    case SDL_PIXELFORMAT_IYUV:
-        fprintf(stderr, "IYUV");
-        break;
-    case SDL_PIXELFORMAT_YUY2:
-        fprintf(stderr, "YUY2");
-        break;
-    case SDL_PIXELFORMAT_UYVY:
-        fprintf(stderr, "UYVY");
-        break;
-    case SDL_PIXELFORMAT_YVYU:
-        fprintf(stderr, "YVYU");
-        break;
-    default:
-        fprintf(stderr, "0x%8.8x", format);
-        break;
-    }
-}
-
-static void
-SDLTest_PrintRenderer(SDL_RendererInfo * info)
-{
-    int i, count;
-
-    fprintf(stderr, "  Renderer %s:\n", info->name);
-
-    fprintf(stderr, "    Flags: 0x%8.8X", info->flags);
-    fprintf(stderr, " (");
-    count = 0;
-    for (i = 0; i < sizeof(info->flags) * 8; ++i) {
-        Uint32 flag = (1 << i);
-        if (info->flags & flag) {
-            if (count > 0) {
-                fprintf(stderr, " | ");
-            }
-            SDLTest_PrintRendererFlag(flag);
-            ++count;
-        }
-    }
-    fprintf(stderr, ")\n");
-
-    fprintf(stderr, "    Texture formats (%d): ", info->num_texture_formats);
-    for (i = 0; i < (int) info->num_texture_formats; ++i) {
-        if (i > 0) {
-            fprintf(stderr, ", ");
-        }
-        SDLTest_PrintPixelFormat(info->texture_formats[i]);
-    }
-    fprintf(stderr, "\n");
-
-    if (info->max_texture_width || info->max_texture_height) {
-        fprintf(stderr, "    Max Texture Size: %dx%d\n",
-                info->max_texture_width, info->max_texture_height);
-    }
-}
-
-static SDL_Surface *
-SDLTest_LoadIcon(const char *file)
-{
-    SDL_Surface *icon;
-
-    /* Load the icon surface */
-    icon = SDL_LoadBMP(file);
-    if (icon == NULL) {
-        fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
-        return (NULL);
-    }
-
-    if (icon->format->palette) {
-        /* Set the colorkey */
-        SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
-    }
-
-    return (icon);
-}
-
-SDL_bool
-SDLTest_CommonInit(SDLTest_CommonState * state)
-{
-    int i, j, m, n, w, h;
-    SDL_DisplayMode fullscreen_mode;
-
-    if (state->flags & SDL_INIT_VIDEO) {
-        if (state->verbose & VERBOSE_VIDEO) {
-            n = SDL_GetNumVideoDrivers();
-            if (n == 0) {
-                fprintf(stderr, "No built-in video drivers\n");
-            } else {
-                fprintf(stderr, "Built-in video drivers:");
-                for (i = 0; i < n; ++i) {
-                    if (i > 0) {
-                        fprintf(stderr, ",");
-                    }
-                    fprintf(stderr, " %s", SDL_GetVideoDriver(i));
-                }
-                fprintf(stderr, "\n");
-            }
-        }
-        if (SDL_VideoInit(state->videodriver) < 0) {
-            fprintf(stderr, "Couldn't initialize video driver: %s\n",
-                    SDL_GetError());
-            return SDL_FALSE;
-        }
-        if (state->verbose & VERBOSE_VIDEO) {
-            fprintf(stderr, "Video driver: %s\n",
-                    SDL_GetCurrentVideoDriver());
-        }
-
-        /* Upload GL settings */
-        SDL_GL_SetAttribute(SDL_GL_RED_SIZE, state->gl_red_size);
-        SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, state->gl_green_size);
-        SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, state->gl_blue_size);
-        SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, state->gl_alpha_size);
-        SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, state->gl_double_buffer);
-        SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, state->gl_buffer_size);
-        SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, state->gl_depth_size);
-        SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, state->gl_stencil_size);
-        SDL_GL_SetAttribute(SDL_GL_ACCUM_RED_SIZE, state->gl_accum_red_size);
-        SDL_GL_SetAttribute(SDL_GL_ACCUM_GREEN_SIZE, state->gl_accum_green_size);
-        SDL_GL_SetAttribute(SDL_GL_ACCUM_BLUE_SIZE, state->gl_accum_blue_size);
-        SDL_GL_SetAttribute(SDL_GL_ACCUM_ALPHA_SIZE, state->gl_accum_alpha_size);
-        SDL_GL_SetAttribute(SDL_GL_STEREO, state->gl_stereo);
-        SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, state->gl_multisamplebuffers);
-        SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, state->gl_multisamplesamples);
-        if (state->gl_accelerated >= 0) {
-            SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL,
-                                state->gl_accelerated);
-        }
-        SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, state->gl_retained_backing);
-        if (state->gl_major_version) {
-            SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, state->gl_major_version);
-            SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, state->gl_minor_version);
-        }
-        if (state->gl_debug) {
-            SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
-        }
-        if (state->gl_profile_mask) {
-            SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, state->gl_profile_mask);
-        }
-
-        if (state->verbose & VERBOSE_MODES) {
-            SDL_Rect bounds;
-            SDL_DisplayMode mode;
-            int bpp;
-            Uint32 Rmask, Gmask, Bmask, Amask;
-#if SDL_VIDEO_DRIVER_WINDOWS
-			int adapterIndex = 0;
-#endif
-            n = SDL_GetNumVideoDisplays();
-            fprintf(stderr, "Number of displays: %d\n", n);
-            for (i = 0; i < n; ++i) {
-                fprintf(stderr, "Display %d: %s\n", i, SDL_GetDisplayName(i));
-
-                SDL_zero(bounds);
-                SDL_GetDisplayBounds(i, &bounds);
-                fprintf(stderr, "Bounds: %dx%d at %d,%d\n", bounds.w, bounds.h, bounds.x, bounds.y);
-
-                SDL_GetDesktopDisplayMode(i, &mode);
-                SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, &Gmask,
-                                           &Bmask, &Amask);
-                fprintf(stderr,
-                        "  Current mode: %dx%d@%dHz, %d bits-per-pixel (%s)\n",
-                        mode.w, mode.h, mode.refresh_rate, bpp,
-                        SDL_GetPixelFormatName(mode.format));
-                if (Rmask || Gmask || Bmask) {
-                    fprintf(stderr, "      Red Mask   = 0x%.8x\n", Rmask);
-                    fprintf(stderr, "      Green Mask = 0x%.8x\n", Gmask);
-                    fprintf(stderr, "      Blue Mask  = 0x%.8x\n", Bmask);
-                    if (Amask)
-                        fprintf(stderr, "      Alpha Mask = 0x%.8x\n", Amask);
-                }
-
-                /* Print available fullscreen video modes */
-                m = SDL_GetNumDisplayModes(i);
-                if (m == 0) {
-                    fprintf(stderr, "No available fullscreen video modes\n");
-                } else {
-                    fprintf(stderr, "  Fullscreen video modes:\n");
-                    for (j = 0; j < m; ++j) {
-                        SDL_GetDisplayMode(i, j, &mode);
-                        SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask,
-                                                   &Gmask, &Bmask, &Amask);
-                        fprintf(stderr,
-                                "    Mode %d: %dx%d@%dHz, %d bits-per-pixel (%s)\n",
-                                j, mode.w, mode.h, mode.refresh_rate, bpp,
-                                SDL_GetPixelFormatName(mode.format));
-                        if (Rmask || Gmask || Bmask) {
-                            fprintf(stderr, "        Red Mask   = 0x%.8x\n",
-                                    Rmask);
-                            fprintf(stderr, "        Green Mask = 0x%.8x\n",
-                                    Gmask);
-                            fprintf(stderr, "        Blue Mask  = 0x%.8x\n",
-                                    Bmask);
-                            if (Amask)
-                                fprintf(stderr,
-                                        "        Alpha Mask = 0x%.8x\n",
-                                        Amask);
-                        }
-                    }
-                }
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-				/* Print the adapter index */
-				adapterIndex = SDL_Direct3D9GetAdapterIndex( i );
-				fprintf( stderr, "Adapter Index: %d", adapterIndex );
-#endif
-            }
-        }
-
-        if (state->verbose & VERBOSE_RENDER) {
-            SDL_RendererInfo info;
-
-            n = SDL_GetNumRenderDrivers();
-            if (n == 0) {
-                fprintf(stderr, "No built-in render drivers\n");
-            } else {
-                fprintf(stderr, "Built-in render drivers:\n");
-                for (i = 0; i < n; ++i) {
-                    SDL_GetRenderDriverInfo(i, &info);
-                    SDLTest_PrintRenderer(&info);
-                }
-            }
-        }
-
-        SDL_zero(fullscreen_mode);
-        switch (state->depth) {
-        case 8:
-            fullscreen_mode.format = SDL_PIXELFORMAT_INDEX8;
-            break;
-        case 15:
-            fullscreen_mode.format = SDL_PIXELFORMAT_RGB555;
-            break;
-        case 16:
-            fullscreen_mode.format = SDL_PIXELFORMAT_RGB565;
-            break;
-        case 24:
-            fullscreen_mode.format = SDL_PIXELFORMAT_RGB24;
-            break;
-        default:
-            fullscreen_mode.format = SDL_PIXELFORMAT_RGB888;
-            break;
-        }
-        fullscreen_mode.refresh_rate = state->refresh_rate;
-
-        state->windows =
-            (SDL_Window **) SDL_malloc(state->num_windows *
-                                        sizeof(*state->windows));
-        state->renderers =
-            (SDL_Renderer **) SDL_malloc(state->num_windows *
-                                        sizeof(*state->renderers));
-        if (!state->windows || !state->renderers) {
-            fprintf(stderr, "Out of memory!\n");
-            return SDL_FALSE;
-        }
-        for (i = 0; i < state->num_windows; ++i) {
-            char title[1024];
-
-            if (state->num_windows > 1) {
-                SDL_snprintf(title, SDL_arraysize(title), "%s %d",
-                             state->window_title, i + 1);
-            } else {
-                SDL_strlcpy(title, state->window_title, SDL_arraysize(title));
-            }
-            state->windows[i] =
-                SDL_CreateWindow(title, state->window_x, state->window_y,
-                                 state->window_w, state->window_h,
-                                 state->window_flags);
-            if (!state->windows[i]) {
-                fprintf(stderr, "Couldn't create window: %s\n",
-                        SDL_GetError());
-                return SDL_FALSE;
-            }
-            if (state->window_minW || state->window_minH) {
-                SDL_SetWindowMinimumSize(state->windows[i], state->window_minW, state->window_minH);
-            }
-            if (state->window_maxW || state->window_maxH) {
-                SDL_SetWindowMaximumSize(state->windows[i], state->window_maxW, state->window_maxH);
-            }
-            SDL_GetWindowSize(state->windows[i], &w, &h);
-            if (!(state->window_flags & SDL_WINDOW_RESIZABLE) &&
-                (w != state->window_w || h != state->window_h)) {
-                printf("Window requested size %dx%d, got %dx%d\n", state->window_w, state->window_h, w, h);
-                state->window_w = w;
-                state->window_h = h;
-            }
-            if (SDL_SetWindowDisplayMode(state->windows[i], &fullscreen_mode) < 0) {
-                fprintf(stderr, "Can't set up fullscreen display mode: %s\n",
-                        SDL_GetError());
-                return SDL_FALSE;
-            }
-
-            if (state->window_icon) {
-                SDL_Surface *icon = SDLTest_LoadIcon(state->window_icon);
-                if (icon) {
-                    SDL_SetWindowIcon(state->windows[i], icon);
-                    SDL_FreeSurface(icon);
-                }
-            }
-
-            SDL_ShowWindow(state->windows[i]);
-
-            state->renderers[i] = NULL;
-
-            if (!state->skip_renderer
-                && (state->renderdriver
-                    || !(state->window_flags & SDL_WINDOW_OPENGL))) {
-                m = -1;
-                if (state->renderdriver) {
-                    SDL_RendererInfo info;
-                    n = SDL_GetNumRenderDrivers();
-                    for (j = 0; j < n; ++j) {
-                        SDL_GetRenderDriverInfo(j, &info);
-                        if (SDL_strcasecmp(info.name, state->renderdriver) ==
-                            0) {
-                            m = j;
-                            break;
-                        }
-                    }
-                    if (m == n) {
-                        fprintf(stderr,
-                                "Couldn't find render driver named %s",
-                                state->renderdriver);
-                        return SDL_FALSE;
-                    }
-                }
-                state->renderers[i] = SDL_CreateRenderer(state->windows[i],
-                                            m, state->render_flags);
-                if (!state->renderers[i]) {
-                    fprintf(stderr, "Couldn't create renderer: %s\n",
-                            SDL_GetError());
-                    return SDL_FALSE;
-                }
-                if (state->logical_w && state->logical_h) {
-                    SDL_RenderSetLogicalSize(state->renderers[i], state->logical_w, state->logical_h);
-                } else if (state->scale) {
-                    SDL_RenderSetScale(state->renderers[i], state->scale, state->scale);
-                }
-                if (state->verbose & VERBOSE_RENDER) {
-                    SDL_RendererInfo info;
-
-                    fprintf(stderr, "Current renderer:\n");
-                    SDL_GetRendererInfo(state->renderers[i], &info);
-                    SDLTest_PrintRenderer(&info);
-                }
-            }
-        }
-    }
-
-    if (state->flags & SDL_INIT_AUDIO) {
-        if (state->verbose & VERBOSE_AUDIO) {
-            n = SDL_GetNumAudioDrivers();
-            if (n == 0) {
-                fprintf(stderr, "No built-in audio drivers\n");
-            } else {
-                fprintf(stderr, "Built-in audio drivers:");
-                for (i = 0; i < n; ++i) {
-                    if (i > 0) {
-                        fprintf(stderr, ",");
-                    }
-                    fprintf(stderr, " %s", SDL_GetAudioDriver(i));
-                }
-                fprintf(stderr, "\n");
-            }
-        }
-        if (SDL_AudioInit(state->audiodriver) < 0) {
-            fprintf(stderr, "Couldn't initialize audio driver: %s\n",
-                    SDL_GetError());
-            return SDL_FALSE;
-        }
-        if (state->verbose & VERBOSE_VIDEO) {
-            fprintf(stderr, "Audio driver: %s\n",
-                    SDL_GetCurrentAudioDriver());
-        }
-
-        if (SDL_OpenAudio(&state->audiospec, NULL) < 0) {
-            fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
-            return SDL_FALSE;
-        }
-    }
-
-    return SDL_TRUE;
-}
-
-static void
-SDLTest_PrintEvent(SDL_Event * event)
-{
-    if ((event->type == SDL_MOUSEMOTION) || (event->type == SDL_FINGERMOTION)) {
-        /* Mouse and finger motion are really spammy */
-        return;
-    }
-
-    fprintf(stderr, "SDL EVENT: ");
-    switch (event->type) {
-    case SDL_WINDOWEVENT:
-        switch (event->window.event) {
-        case SDL_WINDOWEVENT_SHOWN:
-            fprintf(stderr, "Window %d shown", event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_HIDDEN:
-            fprintf(stderr, "Window %d hidden", event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_EXPOSED:
-            fprintf(stderr, "Window %d exposed", event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_MOVED:
-            fprintf(stderr, "Window %d moved to %d,%d",
-                    event->window.windowID, event->window.data1,
-                    event->window.data2);
-            break;
-        case SDL_WINDOWEVENT_RESIZED:
-            fprintf(stderr, "Window %d resized to %dx%d",
-                    event->window.windowID, event->window.data1,
-                    event->window.data2);
-            break;
-        case SDL_WINDOWEVENT_SIZE_CHANGED:
-            fprintf(stderr, "Window %d changed size to %dx%d",
-                    event->window.windowID, event->window.data1,
-                    event->window.data2);
-            break;
-        case SDL_WINDOWEVENT_MINIMIZED:
-            fprintf(stderr, "Window %d minimized", event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_MAXIMIZED:
-            fprintf(stderr, "Window %d maximized", event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_RESTORED:
-            fprintf(stderr, "Window %d restored", event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_ENTER:
-            fprintf(stderr, "Mouse entered window %d",
-                    event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_LEAVE:
-            fprintf(stderr, "Mouse left window %d", event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_FOCUS_GAINED:
-            fprintf(stderr, "Window %d gained keyboard focus",
-                    event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_FOCUS_LOST:
-            fprintf(stderr, "Window %d lost keyboard focus",
-                    event->window.windowID);
-            break;
-        case SDL_WINDOWEVENT_CLOSE:
-            fprintf(stderr, "Window %d closed", event->window.windowID);
-            break;
-        default:
-            fprintf(stderr, "Window %d got unknown event %d",
-                    event->window.windowID, event->window.event);
-            break;
-        }
-        break;
-    case SDL_KEYDOWN:
-        fprintf(stderr,
-                "Keyboard: key pressed  in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
-                event->key.windowID,
-                event->key.keysym.scancode,
-                SDL_GetScancodeName(event->key.keysym.scancode),
-                event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym));
-        break;
-    case SDL_KEYUP:
-        fprintf(stderr,
-                "Keyboard: key released in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s",
-                event->key.windowID,
-                event->key.keysym.scancode,
-                SDL_GetScancodeName(event->key.keysym.scancode),
-                event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym));
-        break;
-    case SDL_TEXTINPUT:
-        fprintf(stderr, "Keyboard: text input \"%s\" in window %d",
-                event->text.text, event->text.windowID);
-        break;
-    case SDL_MOUSEMOTION:
-        fprintf(stderr, "Mouse: moved to %d,%d (%d,%d) in window %d",
-                event->motion.x, event->motion.y,
-                event->motion.xrel, event->motion.yrel,
-                event->motion.windowID);
-        break;
-    case SDL_MOUSEBUTTONDOWN:
-        fprintf(stderr, "Mouse: button %d pressed at %d,%d in window %d",
-                event->button.button, event->button.x, event->button.y,
-                event->button.windowID);
-        break;
-    case SDL_MOUSEBUTTONUP:
-        fprintf(stderr, "Mouse: button %d released at %d,%d in window %d",
-                event->button.button, event->button.x, event->button.y,
-                event->button.windowID);
-        break;
-    case SDL_MOUSEWHEEL:
-        fprintf(stderr,
-                "Mouse: wheel scrolled %d in x and %d in y in window %d",
-                event->wheel.x, event->wheel.y, event->wheel.windowID);
-        break;
-    case SDL_JOYBALLMOTION:
-        fprintf(stderr, "Joystick %d: ball %d moved by %d,%d",
-                event->jball.which, event->jball.ball, event->jball.xrel,
-                event->jball.yrel);
-        break;
-    case SDL_JOYHATMOTION:
-        fprintf(stderr, "Joystick %d: hat %d moved to ", event->jhat.which,
-                event->jhat.hat);
-        switch (event->jhat.value) {
-        case SDL_HAT_CENTERED:
-            fprintf(stderr, "CENTER");
-            break;
-        case SDL_HAT_UP:
-            fprintf(stderr, "UP");
-            break;
-        case SDL_HAT_RIGHTUP:
-            fprintf(stderr, "RIGHTUP");
-            break;
-        case SDL_HAT_RIGHT:
-            fprintf(stderr, "RIGHT");
-            break;
-        case SDL_HAT_RIGHTDOWN:
-            fprintf(stderr, "RIGHTDOWN");
-            break;
-        case SDL_HAT_DOWN:
-            fprintf(stderr, "DOWN");
-            break;
-        case SDL_HAT_LEFTDOWN:
-            fprintf(stderr, "LEFTDOWN");
-            break;
-        case SDL_HAT_LEFT:
-            fprintf(stderr, "LEFT");
-            break;
-        case SDL_HAT_LEFTUP:
-            fprintf(stderr, "LEFTUP");
-            break;
-        default:
-            fprintf(stderr, "UNKNOWN");
-            break;
-        }
-        break;
-    case SDL_JOYBUTTONDOWN:
-        fprintf(stderr, "Joystick %d: button %d pressed",
-                event->jbutton.which, event->jbutton.button);
-        break;
-    case SDL_JOYBUTTONUP:
-        fprintf(stderr, "Joystick %d: button %d released",
-                event->jbutton.which, event->jbutton.button);
-        break;
-    case SDL_CLIPBOARDUPDATE:
-        fprintf(stderr, "Clipboard updated");
-        break;
-
-    case SDL_FINGERDOWN:
-    case SDL_FINGERUP:
-        fprintf(stderr, "Finger: %s touch=%ld, finger=%ld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f",
-                (event->type == SDL_FINGERDOWN) ? "down" : "up",
-                (long) event->tfinger.touchId,
-                (long) event->tfinger.fingerId,
-                event->tfinger.x, event->tfinger.y,
-                event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure);
-        break;
-
-    case SDL_QUIT:
-        fprintf(stderr, "Quit requested");
-        break;
-    case SDL_USEREVENT:
-        fprintf(stderr, "User event %d", event->user.code);
-        break;
-    default:
-        fprintf(stderr, "Unknown event %d", event->type);
-        break;
-    }
-    fprintf(stderr, "\n");
-}
-
-static void
-SDLTest_ScreenShot(SDL_Renderer *renderer)
-{
-    SDL_Rect viewport;
-    SDL_Surface *surface;
-
-    if (!renderer) {
-        return;
-    }
-
-    SDL_RenderGetViewport(renderer, &viewport);
-    surface = SDL_CreateRGBSurface(0, viewport.w, viewport.h, 24,
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-                    0x00FF0000, 0x0000FF00, 0x000000FF,
-#else
-                    0x000000FF, 0x0000FF00, 0x00FF0000,
-#endif
-                    0x00000000);
-    if (!surface) {
-        fprintf(stderr, "Couldn't create surface: %s\n", SDL_GetError());
-        return;
-    }
-
-    if (SDL_RenderReadPixels(renderer, NULL, surface->format->format,
-                             surface->pixels, surface->pitch) < 0) {
-        fprintf(stderr, "Couldn't read screen: %s\n", SDL_GetError());
-        SDL_free(surface);
-        return;
-    }
-
-    if (SDL_SaveBMP(surface, "screenshot.bmp") < 0) {
-        fprintf(stderr, "Couldn't save screenshot.bmp: %s\n", SDL_GetError());
-        SDL_free(surface);
-        return;
-    }
-}
-
-static void
-FullscreenTo(int index, int windowId)
-{
-    Uint32 flags;
-    struct SDL_Rect rect = { 0, 0, 0, 0 };
-    SDL_Window *window = SDL_GetWindowFromID(windowId);
-    if (!window) {
-        return;
-    }
-
-    SDL_GetDisplayBounds( index, &rect );
-
-    flags = SDL_GetWindowFlags(window);
-    if (flags & SDL_WINDOW_FULLSCREEN) {
-        SDL_SetWindowFullscreen( window, SDL_FALSE );
-        SDL_Delay( 15 );
-    }
-
-    SDL_SetWindowPosition( window, rect.x, rect.y );
-    SDL_SetWindowFullscreen( window, SDL_TRUE );
-}
-
-void
-SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done)
-{
-    int i;
-    static SDL_MouseMotionEvent lastEvent;
-
-    if (state->verbose & VERBOSE_EVENT) {
-        SDLTest_PrintEvent(event);
-    }
-
-    switch (event->type) {
-    case SDL_WINDOWEVENT:
-        switch (event->window.event) {
-        case SDL_WINDOWEVENT_CLOSE:
-            {
-                SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);
-                if (window) {
-                    SDL_DestroyWindow(window);
-                    for (i = 0; i < state->num_windows; ++i) {
-                        if (window == state->windows[i]) {
-                            state->windows[i] = NULL;
-                            break;
-                        }
-                    }
-                }
-            }
-            break;
-        }
-        break;
-    case SDL_KEYDOWN:
-        switch (event->key.keysym.sym) {
-            /* Add hotkeys here */
-        case SDLK_PRINTSCREEN: {
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                if (window) {
-                    for (i = 0; i < state->num_windows; ++i) {
-                        if (window == state->windows[i]) {
-                            SDLTest_ScreenShot(state->renderers[i]);
-                        }
-                    }
-                }
-            }
-            break;
-        case SDLK_EQUALS:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-+ double the size of the window */
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                if (window) {
-                    int w, h;
-                    SDL_GetWindowSize(window, &w, &h);
-                    SDL_SetWindowSize(window, w*2, h*2);
-                }
-            }
-            break;
-        case SDLK_MINUS:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-- half the size of the window */
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                if (window) {
-                    int w, h;
-                    SDL_GetWindowSize(window, &w, &h);
-                    SDL_SetWindowSize(window, w/2, h/2);
-                }
-            }
-            break;
-        case SDLK_c:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-C copy awesome text! */
-                SDL_SetClipboardText("SDL rocks!\nYou know it!");
-                printf("Copied text to clipboard\n");
-            }
-            if (event->key.keysym.mod & KMOD_ALT) {
-                /* Alt-C toggle a render clip rectangle */
-                for (i = 0; i < state->num_windows; ++i) {
-                    int w, h;
-                    if (state->renderers[i]) {
-                        SDL_Rect clip;
-                        SDL_GetWindowSize(state->windows[i], &w, &h);
-                        SDL_RenderGetClipRect(state->renderers[i], &clip);
-                        if (SDL_RectEmpty(&clip)) {
-                            clip.x = w/4;
-                            clip.y = h/4;
-                            clip.w = w/2;
-                            clip.h = h/2;
-                            SDL_RenderSetClipRect(state->renderers[i], &clip);
-                        } else {
-                            SDL_RenderSetClipRect(state->renderers[i], NULL);
-                        }
-                    }
-                }
-            }
-            break;
-        case SDLK_v:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-V paste awesome text! */
-                char *text = SDL_GetClipboardText();
-                if (*text) {
-                    printf("Clipboard: %s\n", text);
-                } else {
-                    printf("Clipboard is empty\n");
-                }
-                SDL_free(text);
-            }
-            break;
-        case SDLK_g:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-G toggle grab */
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                if (window) {
-                    SDL_SetWindowGrab(window, !SDL_GetWindowGrab(window) ? SDL_TRUE : SDL_FALSE);
-                }
-            }
-            break;
-        case SDLK_m:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-M maximize */
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                if (window) {
-                    Uint32 flags = SDL_GetWindowFlags(window);
-                    if (flags & SDL_WINDOW_MAXIMIZED) {
-                        SDL_RestoreWindow(window);
-                    } else {
-                        SDL_MaximizeWindow(window);
-                    }
-                }
-            }
-            break;
-        case SDLK_r:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-R toggle mouse relative mode */
-                SDL_SetRelativeMouseMode(!SDL_GetRelativeMouseMode() ? SDL_TRUE : SDL_FALSE);
-            }
-            break;
-        case SDLK_z:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-Z minimize */
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                if (window) {
-                    SDL_MinimizeWindow(window);
-                }
-            }
-            break;
-        case SDLK_RETURN:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-Enter toggle fullscreen */
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                if (window) {
-                    Uint32 flags = SDL_GetWindowFlags(window);
-                    if (flags & SDL_WINDOW_FULLSCREEN) {
-                        SDL_SetWindowFullscreen(window, SDL_FALSE);
-                    } else {
-                        SDL_SetWindowFullscreen(window, SDL_TRUE);
-                    }
-                }
-            } else if (event->key.keysym.mod & KMOD_ALT) {
-                /* Alt-Enter toggle fullscreen desktop */
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                if (window) {
-                    Uint32 flags = SDL_GetWindowFlags(window);
-                    if (flags & SDL_WINDOW_FULLSCREEN) {
-                        SDL_SetWindowFullscreen(window, SDL_FALSE);
-                    } else {
-                        SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
-                    }
-                }
-            }
-            break;
-        case SDLK_b:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                /* Ctrl-B toggle window border */
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                if (window) {
-                    const Uint32 flags = SDL_GetWindowFlags(window);
-                    const SDL_bool b = ((flags & SDL_WINDOW_BORDERLESS) != 0) ? SDL_TRUE : SDL_FALSE;
-                    SDL_SetWindowBordered(window, b);
-                }
-            }
-            break;
-        case SDLK_0:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-                SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Test Message", "You're awesome!", window);
-            }
-            break;
-        case SDLK_1:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                FullscreenTo(0, event->key.windowID);
-            }
-            break;
-        case SDLK_2:
-            if (event->key.keysym.mod & KMOD_CTRL) {
-                FullscreenTo(1, event->key.windowID);
-            }
-            break;
-        case SDLK_ESCAPE:
-            *done = 1;
-            break;
-        case SDLK_SPACE:
-        {
-            char message[256];
-            SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
-
-            SDL_snprintf(message, sizeof(message), "(%i, %i), rel (%i, %i)\n", lastEvent.x, lastEvent.y, lastEvent.xrel, lastEvent.yrel);
-            SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Last mouse position", message, window);
-            break;
-        }
-        default:
-            break;
-        }
-        break;
-    case SDL_QUIT:
-        *done = 1;
-        break;
-    case SDL_MOUSEMOTION:
-        lastEvent = event->motion;
-        break;
-    }
-}
-
-void
-SDLTest_CommonQuit(SDLTest_CommonState * state)
-{
-    int i;
-
-    SDL_free(state->windows);
-    if (state->renderers) {
-        for (i = 0; i < state->num_windows; ++i) {
-            if (state->renderers[i]) {
-                SDL_DestroyRenderer(state->renderers[i]);
-            }
-        }
-        SDL_free(state->renderers);
-    }
-    if (state->flags & SDL_INIT_VIDEO) {
-        SDL_VideoQuit();
-    }
-    if (state->flags & SDL_INIT_AUDIO) {
-        SDL_AudioQuit();
-    }
-    SDL_free(state);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/test/SDL_test_compare.c b/deps/SDL2/src/test/SDL_test_compare.c
deleted file mode 100644
index 33f2373..0000000
--- a/deps/SDL2/src/test/SDL_test_compare.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-
- Based on automated SDL_Surface tests originally written by Edgar Simo 'bobbens'.
-
- Rewritten for test lib by Andreas Schiffler.
-
-*/
-
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-
-/* Counter for _CompareSurface calls; used for filename creation when comparisons fail */
-static int _CompareSurfaceCount = 0;
-
-/* Compare surfaces */
-int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error)
-{
-   int ret;
-   int i,j;
-   int bpp, bpp_reference;
-   Uint8 *p, *p_reference;
-   int dist;
-   Uint8 R, G, B, A;
-   Uint8 Rd, Gd, Bd, Ad;
-   char imageFilename[128];
-   char referenceFilename[128];
-
-   /* Validate input surfaces */
-   if (surface == NULL || referenceSurface == NULL) {
-      return -1;
-   }
-
-   /* Make sure surface size is the same. */
-   if ((surface->w != referenceSurface->w) || (surface->h != referenceSurface->h)) {
-      return -2;
-   }
-
-   /* Sanitize input value */
-   if (allowable_error<0) {
-      allowable_error = 0;
-   }
-
-   SDL_LockSurface( surface );
-   SDL_LockSurface( referenceSurface );
-
-   ret = 0;
-   bpp = surface->format->BytesPerPixel;
-   bpp_reference = referenceSurface->format->BytesPerPixel;
-   /* Compare image - should be same format. */
-   for (j=0; j<surface->h; j++) {
-      for (i=0; i<surface->w; i++) {
-         p  = (Uint8 *)surface->pixels + j * surface->pitch + i * bpp;
-         p_reference = (Uint8 *)referenceSurface->pixels + j * referenceSurface->pitch + i * bpp_reference;
-
-         SDL_GetRGBA(*(Uint32*)p, surface->format, &R, &G, &B, &A);
-         SDL_GetRGBA(*(Uint32*)p_reference, referenceSurface->format, &Rd, &Gd, &Bd, &Ad);
-
-         dist = 0;
-         dist += (R-Rd)*(R-Rd);
-         dist += (G-Gd)*(G-Gd);
-         dist += (B-Bd)*(B-Bd);
-
-         /* Allow some difference in blending accuracy */
-         if (dist > allowable_error) {
-            ret++;
-         }
-      }
-   }
-
-   SDL_UnlockSurface( surface );
-   SDL_UnlockSurface( referenceSurface );
-
-   /* Save test image and reference for analysis on failures */
-   _CompareSurfaceCount++;
-   if (ret != 0) {
-      SDL_snprintf(imageFilename, 127, "CompareSurfaces%04d_TestOutput.bmp", _CompareSurfaceCount);
-      SDL_SaveBMP(surface, imageFilename);
-      SDL_snprintf(referenceFilename, 127, "CompareSurfaces%04d_Reference.bmp", _CompareSurfaceCount);
-      SDL_SaveBMP(referenceSurface, referenceFilename);
-      SDLTest_LogError("Surfaces from failed comparison saved as '%s' and '%s'", imageFilename, referenceFilename);
-   }
-
-   return ret;
-}
diff --git a/deps/SDL2/src/test/SDL_test_crc32.c b/deps/SDL2/src/test/SDL_test_crc32.c
deleted file mode 100644
index d6685c3..0000000
--- a/deps/SDL2/src/test/SDL_test_crc32.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-
- Used by the test execution component.
- Original source code contributed by A. Schiffler for GSOC project.
-
-*/
-
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-
-int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext)
-{
-  int i,j;
-  CrcUint32 c;
-
-  /* Sanity check context pointer */
-  if (crcContext==NULL) {
-   return -1;
-  }
-
-  /*
-   * Build auxiliary table for parallel byte-at-a-time CRC-32
-   */
-#ifdef ORIGINAL_METHOD
-  for (i = 0; i < 256; ++i) {
-    for (c = i << 24, j = 8; j > 0; --j) {
-      c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY : (c << 1);
-    }
-    crcContext->crc32_table[i] = c;
-  }
-#else
-  for (i=0; i<256; i++) {
-   c = i;
-   for (j=8; j>0; j--) {
-    if (c & 1) {
-     c = (c >> 1) ^ CRC32_POLY;
-    } else {
-     c >>= 1;
-    }
-   }
-   crcContext->crc32_table[i] = c;
-  }
-#endif
-
-  return 0;
-}
-
-/* Complete CRC32 calculation on a memory block */
-
-int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
-{
-  if (SDLTest_Crc32CalcStart(crcContext,crc32)) {
-   return -1;
-  }
-
-  if (SDLTest_Crc32CalcBuffer(crcContext, inBuf, inLen, crc32)) {
-   return -1;
-  }
-
-  if (SDLTest_Crc32CalcEnd(crcContext, crc32)) {
-   return -1;
-  }
-
-  return 0;
-}
-
-/* Start crc calculation */
-
-int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32)
-{
-  /* Sanity check pointers */
-  if (crcContext==NULL) {
-   *crc32=0;
-   return -1;
-  }
-
-  /*
-   * Preload shift register, per CRC-32 spec
-   */
-  *crc32 = 0xffffffff;
-
-  return 0;
-}
-
-/* Finish crc calculation */
-
-int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32)
-{
-  /* Sanity check pointers */
-  if (crcContext==NULL) {
-   *crc32=0;
-   return -1;
-  }
-
-  /*
-   * Return complement, per CRC-32 spec
-   */
-  *crc32 = (~(*crc32));
-
-  return 0;
-}
-
-/* Include memory block in crc */
-
-int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
-{
-  CrcUint8    *p;
-  register CrcUint32    crc;
-
-  if (crcContext==NULL) {
-   *crc32=0;
-   return -1;
-  }
-
-  if (inBuf==NULL) {
-   return -1;
-  }
-
-  /*
-   * Calculate CRC from data
-   */
-  crc = *crc32;
-  for (p = inBuf; inLen > 0; ++p, --inLen) {
-#ifdef ORIGINAL_METHOD
-    crc = (crc << 8) ^ crcContext->crc32_table[(crc >> 24) ^ *p];
-#else
-    crc = ((crc >> 8) & 0x00FFFFFF) ^ crcContext->crc32_table[ (crc ^ *p) & 0xFF ];
-#endif
-  }
-  *crc32 = crc;
-
-  return 0;
-}
-
-int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext)
-{
-  if (crcContext==NULL) {
-     return -1;
-  }
-
-  return 0;
-}
diff --git a/deps/SDL2/src/test/SDL_test_font.c b/deps/SDL2/src/test/SDL_test_font.c
deleted file mode 100644
index b7d2caa..0000000
--- a/deps/SDL2/src/test/SDL_test_font.c
+++ /dev/null
@@ -1,3238 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-/* ---- 8x8 font definition ---- */
-
-/* Originally part of SDL2_gfx */
-
-/* ZLIB (c) A. Schiffler 2012 */
-
-#define SDL_TESTFONTDATAMAX (8*256)
-
-static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = {
-
-    /*
-    * 0 0x00 '^@'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 1 0x01 '^A'
-    */
-    0x7e,           /* 01111110 */
-    0x81,           /* 10000001 */
-    0xa5,           /* 10100101 */
-    0x81,           /* 10000001 */
-    0xbd,           /* 10111101 */
-    0x99,           /* 10011001 */
-    0x81,           /* 10000001 */
-    0x7e,           /* 01111110 */
-
-    /*
-    * 2 0x02 '^B'
-    */
-    0x7e,           /* 01111110 */
-    0xff,           /* 11111111 */
-    0xdb,           /* 11011011 */
-    0xff,           /* 11111111 */
-    0xc3,           /* 11000011 */
-    0xe7,           /* 11100111 */
-    0xff,           /* 11111111 */
-    0x7e,           /* 01111110 */
-
-    /*
-    * 3 0x03 '^C'
-    */
-    0x6c,           /* 01101100 */
-    0xfe,           /* 11111110 */
-    0xfe,           /* 11111110 */
-    0xfe,           /* 11111110 */
-    0x7c,           /* 01111100 */
-    0x38,           /* 00111000 */
-    0x10,           /* 00010000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 4 0x04 '^D'
-    */
-    0x10,           /* 00010000 */
-    0x38,           /* 00111000 */
-    0x7c,           /* 01111100 */
-    0xfe,           /* 11111110 */
-    0x7c,           /* 01111100 */
-    0x38,           /* 00111000 */
-    0x10,           /* 00010000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 5 0x05 '^E'
-    */
-    0x38,           /* 00111000 */
-    0x7c,           /* 01111100 */
-    0x38,           /* 00111000 */
-    0xfe,           /* 11111110 */
-    0xfe,           /* 11111110 */
-    0xd6,           /* 11010110 */
-    0x10,           /* 00010000 */
-    0x38,           /* 00111000 */
-
-    /*
-    * 6 0x06 '^F'
-    */
-    0x10,           /* 00010000 */
-    0x38,           /* 00111000 */
-    0x7c,           /* 01111100 */
-    0xfe,           /* 11111110 */
-    0xfe,           /* 11111110 */
-    0x7c,           /* 01111100 */
-    0x10,           /* 00010000 */
-    0x38,           /* 00111000 */
-
-    /*
-    * 7 0x07 '^G'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 8 0x08 '^H'
-    */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xe7,           /* 11100111 */
-    0xc3,           /* 11000011 */
-    0xc3,           /* 11000011 */
-    0xe7,           /* 11100111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-
-    /*
-    * 9 0x09 '^I'
-    */
-    0x00,           /* 00000000 */
-    0x3c,           /* 00111100 */
-    0x66,           /* 01100110 */
-    0x42,           /* 01000010 */
-    0x42,           /* 01000010 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 10 0x0a '^J'
-    */
-    0xff,           /* 11111111 */
-    0xc3,           /* 11000011 */
-    0x99,           /* 10011001 */
-    0xbd,           /* 10111101 */
-    0xbd,           /* 10111101 */
-    0x99,           /* 10011001 */
-    0xc3,           /* 11000011 */
-    0xff,           /* 11111111 */
-
-    /*
-    * 11 0x0b '^K'
-    */
-    0x0f,           /* 00001111 */
-    0x07,           /* 00000111 */
-    0x0f,           /* 00001111 */
-    0x7d,           /* 01111101 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x78,           /* 01111000 */
-
-    /*
-    * 12 0x0c '^L'
-    */
-    0x3c,           /* 00111100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 13 0x0d '^M'
-    */
-    0x3f,           /* 00111111 */
-    0x33,           /* 00110011 */
-    0x3f,           /* 00111111 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x70,           /* 01110000 */
-    0xf0,           /* 11110000 */
-    0xe0,           /* 11100000 */
-
-    /*
-    * 14 0x0e '^N'
-    */
-    0x7f,           /* 01111111 */
-    0x63,           /* 01100011 */
-    0x7f,           /* 01111111 */
-    0x63,           /* 01100011 */
-    0x63,           /* 01100011 */
-    0x67,           /* 01100111 */
-    0xe6,           /* 11100110 */
-    0xc0,           /* 11000000 */
-
-    /*
-    * 15 0x0f '^O'
-    */
-    0x18,           /* 00011000 */
-    0xdb,           /* 11011011 */
-    0x3c,           /* 00111100 */
-    0xe7,           /* 11100111 */
-    0xe7,           /* 11100111 */
-    0x3c,           /* 00111100 */
-    0xdb,           /* 11011011 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 16 0x10 '^P'
-    */
-    0x80,           /* 10000000 */
-    0xe0,           /* 11100000 */
-    0xf8,           /* 11111000 */
-    0xfe,           /* 11111110 */
-    0xf8,           /* 11111000 */
-    0xe0,           /* 11100000 */
-    0x80,           /* 10000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 17 0x11 '^Q'
-    */
-    0x02,           /* 00000010 */
-    0x0e,           /* 00001110 */
-    0x3e,           /* 00111110 */
-    0xfe,           /* 11111110 */
-    0x3e,           /* 00111110 */
-    0x0e,           /* 00001110 */
-    0x02,           /* 00000010 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 18 0x12 '^R'
-    */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 19 0x13 '^S'
-    */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x00,           /* 00000000 */
-    0x66,           /* 01100110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 20 0x14 '^T'
-    */
-    0x7f,           /* 01111111 */
-    0xdb,           /* 11011011 */
-    0xdb,           /* 11011011 */
-    0x7b,           /* 01111011 */
-    0x1b,           /* 00011011 */
-    0x1b,           /* 00011011 */
-    0x1b,           /* 00011011 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 21 0x15 '^U'
-    */
-    0x3e,           /* 00111110 */
-    0x61,           /* 01100001 */
-    0x3c,           /* 00111100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0x86,           /* 10000110 */
-    0x7c,           /* 01111100 */
-
-    /*
-    * 22 0x16 '^V'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x7e,           /* 01111110 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 23 0x17 '^W'
-    */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0xff,           /* 11111111 */
-
-    /*
-    * 24 0x18 '^X'
-    */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 25 0x19 '^Y'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 26 0x1a '^Z'
-    */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0xfe,           /* 11111110 */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 27 0x1b '^['
-    */
-    0x00,           /* 00000000 */
-    0x30,           /* 00110000 */
-    0x60,           /* 01100000 */
-    0xfe,           /* 11111110 */
-    0x60,           /* 01100000 */
-    0x30,           /* 00110000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 28 0x1c '^\'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 29 0x1d '^]'
-    */
-    0x00,           /* 00000000 */
-    0x24,           /* 00100100 */
-    0x66,           /* 01100110 */
-    0xff,           /* 11111111 */
-    0x66,           /* 01100110 */
-    0x24,           /* 00100100 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 30 0x1e '^^'
-    */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x7e,           /* 01111110 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 31 0x1f '^_'
-    */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0x7e,           /* 01111110 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 32 0x20 ' '
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 33 0x21 '!'
-    */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 34 0x22 '"'
-    */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x24,           /* 00100100 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 35 0x23 '#'
-    */
-    0x6c,           /* 01101100 */
-    0x6c,           /* 01101100 */
-    0xfe,           /* 11111110 */
-    0x6c,           /* 01101100 */
-    0xfe,           /* 11111110 */
-    0x6c,           /* 01101100 */
-    0x6c,           /* 01101100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 36 0x24 '$'
-    */
-    0x18,           /* 00011000 */
-    0x3e,           /* 00111110 */
-    0x60,           /* 01100000 */
-    0x3c,           /* 00111100 */
-    0x06,           /* 00000110 */
-    0x7c,           /* 01111100 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 37 0x25 '%'
-    */
-    0x00,           /* 00000000 */
-    0xc6,           /* 11000110 */
-    0xcc,           /* 11001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x66,           /* 01100110 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 38 0x26 '&'
-    */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x76,           /* 01110110 */
-    0xdc,           /* 11011100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 39 0x27 '''
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 40 0x28 '('
-    */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 41 0x29 ')'
-    */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 42 0x2a '*'
-    */
-    0x00,           /* 00000000 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0xff,           /* 11111111 */
-    0x3c,           /* 00111100 */
-    0x66,           /* 01100110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 43 0x2b '+'
-    */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 44 0x2c ','
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-
-    /*
-    * 45 0x2d '-'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 46 0x2e '.'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 47 0x2f '/'
-    */
-    0x06,           /* 00000110 */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x60,           /* 01100000 */
-    0xc0,           /* 11000000 */
-    0x80,           /* 10000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 48 0x30 '0'
-    */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0xd6,           /* 11010110 */
-    0xc6,           /* 11000110 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 49 0x31 '1'
-    */
-    0x18,           /* 00011000 */
-    0x38,           /* 00111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 50 0x32 '2'
-    */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0x06,           /* 00000110 */
-    0x1c,           /* 00011100 */
-    0x30,           /* 00110000 */
-    0x66,           /* 01100110 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 51 0x33 '3'
-    */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0x06,           /* 00000110 */
-    0x3c,           /* 00111100 */
-    0x06,           /* 00000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 52 0x34 '4'
-    */
-    0x1c,           /* 00011100 */
-    0x3c,           /* 00111100 */
-    0x6c,           /* 01101100 */
-    0xcc,           /* 11001100 */
-    0xfe,           /* 11111110 */
-    0x0c,           /* 00001100 */
-    0x1e,           /* 00011110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 53 0x35 '5'
-    */
-    0xfe,           /* 11111110 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0xfc,           /* 11111100 */
-    0x06,           /* 00000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 54 0x36 '6'
-    */
-    0x38,           /* 00111000 */
-    0x60,           /* 01100000 */
-    0xc0,           /* 11000000 */
-    0xfc,           /* 11111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 55 0x37 '7'
-    */
-    0xfe,           /* 11111110 */
-    0xc6,           /* 11000110 */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 56 0x38 '8'
-    */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 57 0x39 '9'
-    */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7e,           /* 01111110 */
-    0x06,           /* 00000110 */
-    0x0c,           /* 00001100 */
-    0x78,           /* 01111000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 58 0x3a ':'
-    */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 59 0x3b ';'
-    */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-
-    /*
-    * 60 0x3c '<'
-    */
-    0x06,           /* 00000110 */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x06,           /* 00000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 61 0x3d '='
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 62 0x3e '>'
-    */
-    0x60,           /* 01100000 */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x60,           /* 01100000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 63 0x3f '?'
-    */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 64 0x40 '@'
-    */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xde,           /* 11011110 */
-    0xde,           /* 11011110 */
-    0xde,           /* 11011110 */
-    0xc0,           /* 11000000 */
-    0x78,           /* 01111000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 65 0x41 'A'
-    */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 66 0x42 'B'
-    */
-    0xfc,           /* 11111100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x7c,           /* 01111100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0xfc,           /* 11111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 67 0x43 'C'
-    */
-    0x3c,           /* 00111100 */
-    0x66,           /* 01100110 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 68 0x44 'D'
-    */
-    0xf8,           /* 11111000 */
-    0x6c,           /* 01101100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x6c,           /* 01101100 */
-    0xf8,           /* 11111000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 69 0x45 'E'
-    */
-    0xfe,           /* 11111110 */
-    0x62,           /* 01100010 */
-    0x68,           /* 01101000 */
-    0x78,           /* 01111000 */
-    0x68,           /* 01101000 */
-    0x62,           /* 01100010 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 70 0x46 'F'
-    */
-    0xfe,           /* 11111110 */
-    0x62,           /* 01100010 */
-    0x68,           /* 01101000 */
-    0x78,           /* 01111000 */
-    0x68,           /* 01101000 */
-    0x60,           /* 01100000 */
-    0xf0,           /* 11110000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 71 0x47 'G'
-    */
-    0x3c,           /* 00111100 */
-    0x66,           /* 01100110 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0xce,           /* 11001110 */
-    0x66,           /* 01100110 */
-    0x3a,           /* 00111010 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 72 0x48 'H'
-    */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 73 0x49 'I'
-    */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 74 0x4a 'J'
-    */
-    0x1e,           /* 00011110 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x78,           /* 01111000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 75 0x4b 'K'
-    */
-    0xe6,           /* 11100110 */
-    0x66,           /* 01100110 */
-    0x6c,           /* 01101100 */
-    0x78,           /* 01111000 */
-    0x6c,           /* 01101100 */
-    0x66,           /* 01100110 */
-    0xe6,           /* 11100110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 76 0x4c 'L'
-    */
-    0xf0,           /* 11110000 */
-    0x60,           /* 01100000 */
-    0x60,           /* 01100000 */
-    0x60,           /* 01100000 */
-    0x62,           /* 01100010 */
-    0x66,           /* 01100110 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 77 0x4d 'M'
-    */
-    0xc6,           /* 11000110 */
-    0xee,           /* 11101110 */
-    0xfe,           /* 11111110 */
-    0xfe,           /* 11111110 */
-    0xd6,           /* 11010110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 78 0x4e 'N'
-    */
-    0xc6,           /* 11000110 */
-    0xe6,           /* 11100110 */
-    0xf6,           /* 11110110 */
-    0xde,           /* 11011110 */
-    0xce,           /* 11001110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 79 0x4f 'O'
-    */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 80 0x50 'P'
-    */
-    0xfc,           /* 11111100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x7c,           /* 01111100 */
-    0x60,           /* 01100000 */
-    0x60,           /* 01100000 */
-    0xf0,           /* 11110000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 81 0x51 'Q'
-    */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xce,           /* 11001110 */
-    0x7c,           /* 01111100 */
-    0x0e,           /* 00001110 */
-
-    /*
-    * 82 0x52 'R'
-    */
-    0xfc,           /* 11111100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x7c,           /* 01111100 */
-    0x6c,           /* 01101100 */
-    0x66,           /* 01100110 */
-    0xe6,           /* 11100110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 83 0x53 'S'
-    */
-    0x3c,           /* 00111100 */
-    0x66,           /* 01100110 */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 84 0x54 'T'
-    */
-    0x7e,           /* 01111110 */
-    0x7e,           /* 01111110 */
-    0x5a,           /* 01011010 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 85 0x55 'U'
-    */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 86 0x56 'V'
-    */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 87 0x57 'W'
-    */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xd6,           /* 11010110 */
-    0xd6,           /* 11010110 */
-    0xfe,           /* 11111110 */
-    0x6c,           /* 01101100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 88 0x58 'X'
-    */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 89 0x59 'Y'
-    */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 90 0x5a 'Z'
-    */
-    0xfe,           /* 11111110 */
-    0xc6,           /* 11000110 */
-    0x8c,           /* 10001100 */
-    0x18,           /* 00011000 */
-    0x32,           /* 00110010 */
-    0x66,           /* 01100110 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 91 0x5b '['
-    */
-    0x3c,           /* 00111100 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 92 0x5c '\'
-    */
-    0xc0,           /* 11000000 */
-    0x60,           /* 01100000 */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x06,           /* 00000110 */
-    0x02,           /* 00000010 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 93 0x5d ']'
-    */
-    0x3c,           /* 00111100 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 94 0x5e '^'
-    */
-    0x10,           /* 00010000 */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 95 0x5f '_'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-
-    /*
-    * 96 0x60 '`'
-    */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 97 0x61 'a'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x78,           /* 01111000 */
-    0x0c,           /* 00001100 */
-    0x7c,           /* 01111100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 98 0x62 'b'
-    */
-    0xe0,           /* 11100000 */
-    0x60,           /* 01100000 */
-    0x7c,           /* 01111100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0xdc,           /* 11011100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 99 0x63 'c'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc0,           /* 11000000 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 100 0x64 'd'
-    */
-    0x1c,           /* 00011100 */
-    0x0c,           /* 00001100 */
-    0x7c,           /* 01111100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 101 0x65 'e'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc0,           /* 11000000 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 102 0x66 'f'
-    */
-    0x3c,           /* 00111100 */
-    0x66,           /* 01100110 */
-    0x60,           /* 01100000 */
-    0xf8,           /* 11111000 */
-    0x60,           /* 01100000 */
-    0x60,           /* 01100000 */
-    0xf0,           /* 11110000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 103 0x67 'g'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x76,           /* 01110110 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x7c,           /* 01111100 */
-    0x0c,           /* 00001100 */
-    0xf8,           /* 11111000 */
-
-    /*
-    * 104 0x68 'h'
-    */
-    0xe0,           /* 11100000 */
-    0x60,           /* 01100000 */
-    0x6c,           /* 01101100 */
-    0x76,           /* 01110110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0xe6,           /* 11100110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 105 0x69 'i'
-    */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x38,           /* 00111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 106 0x6a 'j'
-    */
-    0x06,           /* 00000110 */
-    0x00,           /* 00000000 */
-    0x06,           /* 00000110 */
-    0x06,           /* 00000110 */
-    0x06,           /* 00000110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-
-    /*
-    * 107 0x6b 'k'
-    */
-    0xe0,           /* 11100000 */
-    0x60,           /* 01100000 */
-    0x66,           /* 01100110 */
-    0x6c,           /* 01101100 */
-    0x78,           /* 01111000 */
-    0x6c,           /* 01101100 */
-    0xe6,           /* 11100110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 108 0x6c 'l'
-    */
-    0x38,           /* 00111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 109 0x6d 'm'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xec,           /* 11101100 */
-    0xfe,           /* 11111110 */
-    0xd6,           /* 11010110 */
-    0xd6,           /* 11010110 */
-    0xd6,           /* 11010110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 110 0x6e 'n'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xdc,           /* 11011100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 111 0x6f 'o'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 112 0x70 'p'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xdc,           /* 11011100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x7c,           /* 01111100 */
-    0x60,           /* 01100000 */
-    0xf0,           /* 11110000 */
-
-    /*
-    * 113 0x71 'q'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x76,           /* 01110110 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x7c,           /* 01111100 */
-    0x0c,           /* 00001100 */
-    0x1e,           /* 00011110 */
-
-    /*
-    * 114 0x72 'r'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xdc,           /* 11011100 */
-    0x76,           /* 01110110 */
-    0x60,           /* 01100000 */
-    0x60,           /* 01100000 */
-    0xf0,           /* 11110000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 115 0x73 's'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0xc0,           /* 11000000 */
-    0x7c,           /* 01111100 */
-    0x06,           /* 00000110 */
-    0xfc,           /* 11111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 116 0x74 't'
-    */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0xfc,           /* 11111100 */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x36,           /* 00110110 */
-    0x1c,           /* 00011100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 117 0x75 'u'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 118 0x76 'v'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 119 0x77 'w'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xc6,           /* 11000110 */
-    0xd6,           /* 11010110 */
-    0xd6,           /* 11010110 */
-    0xfe,           /* 11111110 */
-    0x6c,           /* 01101100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 120 0x78 'x'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xc6,           /* 11000110 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 121 0x79 'y'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7e,           /* 01111110 */
-    0x06,           /* 00000110 */
-    0xfc,           /* 11111100 */
-
-    /*
-    * 122 0x7a 'z'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x4c,           /* 01001100 */
-    0x18,           /* 00011000 */
-    0x32,           /* 00110010 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 123 0x7b '{'
-    */
-    0x0e,           /* 00001110 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x70,           /* 01110000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x0e,           /* 00001110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 124 0x7c '|'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 125 0x7d '}'
-    */
-    0x70,           /* 01110000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x0e,           /* 00001110 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x70,           /* 01110000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 126 0x7e '~'
-    */
-    0x76,           /* 01110110 */
-    0xdc,           /* 11011100 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 127 0x7f ''
-    */
-    0x00,           /* 00000000 */
-    0x10,           /* 00010000 */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 128 0x80 '�'
-    */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x0c,           /* 00001100 */
-    0x78,           /* 01111000 */
-
-    /*
-    * 129 0x81 '�'
-    */
-    0xcc,           /* 11001100 */
-    0x00,           /* 00000000 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 130 0x82 '�'
-    */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc0,           /* 11000000 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 131 0x83 '�'
-    */
-    0x7c,           /* 01111100 */
-    0x82,           /* 10000010 */
-    0x78,           /* 01111000 */
-    0x0c,           /* 00001100 */
-    0x7c,           /* 01111100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 132 0x84 '�'
-    */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-    0x78,           /* 01111000 */
-    0x0c,           /* 00001100 */
-    0x7c,           /* 01111100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 133 0x85 '�'
-    */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x78,           /* 01111000 */
-    0x0c,           /* 00001100 */
-    0x7c,           /* 01111100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 134 0x86 '�'
-    */
-    0x30,           /* 00110000 */
-    0x30,           /* 00110000 */
-    0x78,           /* 01111000 */
-    0x0c,           /* 00001100 */
-    0x7c,           /* 01111100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 135 0x87 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0x7e,           /* 01111110 */
-    0x0c,           /* 00001100 */
-    0x38,           /* 00111000 */
-
-    /*
-    * 136 0x88 '�'
-    */
-    0x7c,           /* 01111100 */
-    0x82,           /* 10000010 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc0,           /* 11000000 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 137 0x89 '�'
-    */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc0,           /* 11000000 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 138 0x8a '�'
-    */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc0,           /* 11000000 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 139 0x8b '�'
-    */
-    0x66,           /* 01100110 */
-    0x00,           /* 00000000 */
-    0x38,           /* 00111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 140 0x8c '�'
-    */
-    0x7c,           /* 01111100 */
-    0x82,           /* 10000010 */
-    0x38,           /* 00111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 141 0x8d '�'
-    */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x38,           /* 00111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 142 0x8e '�'
-    */
-    0xc6,           /* 11000110 */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 143 0x8f '�'
-    */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 144 0x90 '�'
-    */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0xfe,           /* 11111110 */
-    0xc0,           /* 11000000 */
-    0xf8,           /* 11111000 */
-    0xc0,           /* 11000000 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 145 0x91 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0xd8,           /* 11011000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 146 0x92 '�'
-    */
-    0x3e,           /* 00111110 */
-    0x6c,           /* 01101100 */
-    0xcc,           /* 11001100 */
-    0xfe,           /* 11111110 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xce,           /* 11001110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 147 0x93 '�'
-    */
-    0x7c,           /* 01111100 */
-    0x82,           /* 10000010 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 148 0x94 '�'
-    */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 149 0x95 '�'
-    */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 150 0x96 '�'
-    */
-    0x78,           /* 01111000 */
-    0x84,           /* 10000100 */
-    0x00,           /* 00000000 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 151 0x97 '�'
-    */
-    0x60,           /* 01100000 */
-    0x30,           /* 00110000 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 152 0x98 '�'
-    */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7e,           /* 01111110 */
-    0x06,           /* 00000110 */
-    0xfc,           /* 11111100 */
-
-    /*
-    * 153 0x99 '�'
-    */
-    0xc6,           /* 11000110 */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 154 0x9a '�'
-    */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 155 0x9b '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 156 0x9c '�'
-    */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0x64,           /* 01100100 */
-    0xf0,           /* 11110000 */
-    0x60,           /* 01100000 */
-    0x66,           /* 01100110 */
-    0xfc,           /* 11111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 157 0x9d '�'
-    */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 158 0x9e '�'
-    */
-    0xf8,           /* 11111000 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xfa,           /* 11111010 */
-    0xc6,           /* 11000110 */
-    0xcf,           /* 11001111 */
-    0xc6,           /* 11000110 */
-    0xc7,           /* 11000111 */
-
-    /*
-    * 159 0x9f '�'
-    */
-    0x0e,           /* 00001110 */
-    0x1b,           /* 00011011 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0xd8,           /* 11011000 */
-    0x70,           /* 01110000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 160 0xa0 '�'
-    */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x78,           /* 01111000 */
-    0x0c,           /* 00001100 */
-    0x7c,           /* 01111100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 161 0xa1 '�'
-    */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x38,           /* 00111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 162 0xa2 '�'
-    */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 163 0xa3 '�'
-    */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 164 0xa4 '�'
-    */
-    0x76,           /* 01110110 */
-    0xdc,           /* 11011100 */
-    0x00,           /* 00000000 */
-    0xdc,           /* 11011100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 165 0xa5 '�'
-    */
-    0x76,           /* 01110110 */
-    0xdc,           /* 11011100 */
-    0x00,           /* 00000000 */
-    0xe6,           /* 11100110 */
-    0xf6,           /* 11110110 */
-    0xde,           /* 11011110 */
-    0xce,           /* 11001110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 166 0xa6 '�'
-    */
-    0x3c,           /* 00111100 */
-    0x6c,           /* 01101100 */
-    0x6c,           /* 01101100 */
-    0x3e,           /* 00111110 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 167 0xa7 '�'
-    */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x00,           /* 00000000 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 168 0xa8 '�'
-    */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x63,           /* 01100011 */
-    0x3e,           /* 00111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 169 0xa9 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xfe,           /* 11111110 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 170 0xaa '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xfe,           /* 11111110 */
-    0x06,           /* 00000110 */
-    0x06,           /* 00000110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 171 0xab '�'
-    */
-    0x63,           /* 01100011 */
-    0xe6,           /* 11100110 */
-    0x6c,           /* 01101100 */
-    0x7e,           /* 01111110 */
-    0x33,           /* 00110011 */
-    0x66,           /* 01100110 */
-    0xcc,           /* 11001100 */
-    0x0f,           /* 00001111 */
-
-    /*
-    * 172 0xac '�'
-    */
-    0x63,           /* 01100011 */
-    0xe6,           /* 11100110 */
-    0x6c,           /* 01101100 */
-    0x7a,           /* 01111010 */
-    0x36,           /* 00110110 */
-    0x6a,           /* 01101010 */
-    0xdf,           /* 11011111 */
-    0x06,           /* 00000110 */
-
-    /*
-    * 173 0xad '�'
-    */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 174 0xae '�'
-    */
-    0x00,           /* 00000000 */
-    0x33,           /* 00110011 */
-    0x66,           /* 01100110 */
-    0xcc,           /* 11001100 */
-    0x66,           /* 01100110 */
-    0x33,           /* 00110011 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 175 0xaf '�'
-    */
-    0x00,           /* 00000000 */
-    0xcc,           /* 11001100 */
-    0x66,           /* 01100110 */
-    0x33,           /* 00110011 */
-    0x66,           /* 01100110 */
-    0xcc,           /* 11001100 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 176 0xb0 '�'
-    */
-    0x22,           /* 00100010 */
-    0x88,           /* 10001000 */
-    0x22,           /* 00100010 */
-    0x88,           /* 10001000 */
-    0x22,           /* 00100010 */
-    0x88,           /* 10001000 */
-    0x22,           /* 00100010 */
-    0x88,           /* 10001000 */
-
-    /*
-    * 177 0xb1 '�'
-    */
-    0x55,           /* 01010101 */
-    0xaa,           /* 10101010 */
-    0x55,           /* 01010101 */
-    0xaa,           /* 10101010 */
-    0x55,           /* 01010101 */
-    0xaa,           /* 10101010 */
-    0x55,           /* 01010101 */
-    0xaa,           /* 10101010 */
-
-    /*
-    * 178 0xb2 '�'
-    */
-    0x77,           /* 01110111 */
-    0xdd,           /* 11011101 */
-    0x77,           /* 01110111 */
-    0xdd,           /* 11011101 */
-    0x77,           /* 01110111 */
-    0xdd,           /* 11011101 */
-    0x77,           /* 01110111 */
-    0xdd,           /* 11011101 */
-
-    /*
-    * 179 0xb3 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 180 0xb4 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0xf8,           /* 11111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 181 0xb5 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0xf8,           /* 11111000 */
-    0x18,           /* 00011000 */
-    0xf8,           /* 11111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 182 0xb6 '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0xf6,           /* 11110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 183 0xb7 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xfe,           /* 11111110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 184 0xb8 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xf8,           /* 11111000 */
-    0x18,           /* 00011000 */
-    0xf8,           /* 11111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 185 0xb9 '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0xf6,           /* 11110110 */
-    0x06,           /* 00000110 */
-    0xf6,           /* 11110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 186 0xba '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 187 0xbb '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xfe,           /* 11111110 */
-    0x06,           /* 00000110 */
-    0xf6,           /* 11110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 188 0xbc '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0xf6,           /* 11110110 */
-    0x06,           /* 00000110 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 189 0xbd '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 190 0xbe '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0xf8,           /* 11111000 */
-    0x18,           /* 00011000 */
-    0xf8,           /* 11111000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 191 0xbf '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xf8,           /* 11111000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 192 0xc0 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x1f,           /* 00011111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 193 0xc1 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 194 0xc2 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 195 0xc3 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x1f,           /* 00011111 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 196 0xc4 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 197 0xc5 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0xff,           /* 11111111 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 198 0xc6 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x1f,           /* 00011111 */
-    0x18,           /* 00011000 */
-    0x1f,           /* 00011111 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 199 0xc7 '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x37,           /* 00110111 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 200 0xc8 '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x37,           /* 00110111 */
-    0x30,           /* 00110000 */
-    0x3f,           /* 00111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 201 0xc9 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x3f,           /* 00111111 */
-    0x30,           /* 00110000 */
-    0x37,           /* 00110111 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 202 0xca '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0xf7,           /* 11110111 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 203 0xcb '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0xf7,           /* 11110111 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 204 0xcc '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x37,           /* 00110111 */
-    0x30,           /* 00110000 */
-    0x37,           /* 00110111 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 205 0xcd '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 206 0xce '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0xf7,           /* 11110111 */
-    0x00,           /* 00000000 */
-    0xf7,           /* 11110111 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 207 0xcf '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 208 0xd0 '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 209 0xd1 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 210 0xd2 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 211 0xd3 '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x3f,           /* 00111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 212 0xd4 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x1f,           /* 00011111 */
-    0x18,           /* 00011000 */
-    0x1f,           /* 00011111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 213 0xd5 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x1f,           /* 00011111 */
-    0x18,           /* 00011000 */
-    0x1f,           /* 00011111 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 214 0xd6 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x3f,           /* 00111111 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 215 0xd7 '�'
-    */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0xff,           /* 11111111 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-
-    /*
-    * 216 0xd8 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0xff,           /* 11111111 */
-    0x18,           /* 00011000 */
-    0xff,           /* 11111111 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 217 0xd9 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0xf8,           /* 11111000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 218 0xda '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x1f,           /* 00011111 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 219 0xdb '�'
-    */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-
-    /*
-    * 220 0xdc '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-
-    /*
-    * 221 0xdd '�'
-    */
-    0xf0,           /* 11110000 */
-    0xf0,           /* 11110000 */
-    0xf0,           /* 11110000 */
-    0xf0,           /* 11110000 */
-    0xf0,           /* 11110000 */
-    0xf0,           /* 11110000 */
-    0xf0,           /* 11110000 */
-    0xf0,           /* 11110000 */
-
-    /*
-    * 222 0xde '�'
-    */
-    0x0f,           /* 00001111 */
-    0x0f,           /* 00001111 */
-    0x0f,           /* 00001111 */
-    0x0f,           /* 00001111 */
-    0x0f,           /* 00001111 */
-    0x0f,           /* 00001111 */
-    0x0f,           /* 00001111 */
-    0x0f,           /* 00001111 */
-
-    /*
-    * 223 0xdf '�'
-    */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0xff,           /* 11111111 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 224 0xe0 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x76,           /* 01110110 */
-    0xdc,           /* 11011100 */
-    0xc8,           /* 11001000 */
-    0xdc,           /* 11011100 */
-    0x76,           /* 01110110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 225 0xe1 '�'
-    */
-    0x78,           /* 01111000 */
-    0xcc,           /* 11001100 */
-    0xcc,           /* 11001100 */
-    0xd8,           /* 11011000 */
-    0xcc,           /* 11001100 */
-    0xc6,           /* 11000110 */
-    0xcc,           /* 11001100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 226 0xe2 '�'
-    */
-    0xfe,           /* 11111110 */
-    0xc6,           /* 11000110 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0xc0,           /* 11000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 227 0xe3 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0xfe,           /* 11111110 */
-    0x6c,           /* 01101100 */
-    0x6c,           /* 01101100 */
-    0x6c,           /* 01101100 */
-    0x6c,           /* 01101100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 228 0xe4 '�'
-    */
-    0xfe,           /* 11111110 */
-    0xc6,           /* 11000110 */
-    0x60,           /* 01100000 */
-    0x30,           /* 00110000 */
-    0x60,           /* 01100000 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 229 0xe5 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0xd8,           /* 11011000 */
-    0xd8,           /* 11011000 */
-    0xd8,           /* 11011000 */
-    0x70,           /* 01110000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 230 0xe6 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x7c,           /* 01111100 */
-    0xc0,           /* 11000000 */
-
-    /*
-    * 231 0xe7 '�'
-    */
-    0x00,           /* 00000000 */
-    0x76,           /* 01110110 */
-    0xdc,           /* 11011100 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 232 0xe8 '�'
-    */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x3c,           /* 00111100 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-
-    /*
-    * 233 0xe9 '�'
-    */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0xfe,           /* 11111110 */
-    0xc6,           /* 11000110 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 234 0xea '�'
-    */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x6c,           /* 01101100 */
-    0x6c,           /* 01101100 */
-    0xee,           /* 11101110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 235 0xeb '�'
-    */
-    0x0e,           /* 00001110 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x3e,           /* 00111110 */
-    0x66,           /* 01100110 */
-    0x66,           /* 01100110 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 236 0xec '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0xdb,           /* 11011011 */
-    0xdb,           /* 11011011 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 237 0xed '�'
-    */
-    0x06,           /* 00000110 */
-    0x0c,           /* 00001100 */
-    0x7e,           /* 01111110 */
-    0xdb,           /* 11011011 */
-    0xdb,           /* 11011011 */
-    0x7e,           /* 01111110 */
-    0x60,           /* 01100000 */
-    0xc0,           /* 11000000 */
-
-    /*
-    * 238 0xee '�'
-    */
-    0x1e,           /* 00011110 */
-    0x30,           /* 00110000 */
-    0x60,           /* 01100000 */
-    0x7e,           /* 01111110 */
-    0x60,           /* 01100000 */
-    0x30,           /* 00110000 */
-    0x1e,           /* 00011110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 239 0xef '�'
-    */
-    0x00,           /* 00000000 */
-    0x7c,           /* 01111100 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0xc6,           /* 11000110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 240 0xf0 '�'
-    */
-    0x00,           /* 00000000 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-    0xfe,           /* 11111110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 241 0xf1 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x7e,           /* 01111110 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 242 0xf2 '�'
-    */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 243 0xf3 '�'
-    */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x18,           /* 00011000 */
-    0x0c,           /* 00001100 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 244 0xf4 '�'
-    */
-    0x0e,           /* 00001110 */
-    0x1b,           /* 00011011 */
-    0x1b,           /* 00011011 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-
-    /*
-    * 245 0xf5 '�'
-    */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0xd8,           /* 11011000 */
-    0xd8,           /* 11011000 */
-    0x70,           /* 01110000 */
-
-    /*
-    * 246 0xf6 '�'
-    */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x7e,           /* 01111110 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 247 0xf7 '�'
-    */
-    0x00,           /* 00000000 */
-    0x76,           /* 01110110 */
-    0xdc,           /* 11011100 */
-    0x00,           /* 00000000 */
-    0x76,           /* 01110110 */
-    0xdc,           /* 11011100 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 248 0xf8 '�'
-    */
-    0x38,           /* 00111000 */
-    0x6c,           /* 01101100 */
-    0x6c,           /* 01101100 */
-    0x38,           /* 00111000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 249 0xf9 '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 250 0xfa '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x18,           /* 00011000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 251 0xfb '�'
-    */
-    0x0f,           /* 00001111 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0x0c,           /* 00001100 */
-    0xec,           /* 11101100 */
-    0x6c,           /* 01101100 */
-    0x3c,           /* 00111100 */
-    0x1c,           /* 00011100 */
-
-    /*
-    * 252 0xfc '�'
-    */
-    0x6c,           /* 01101100 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x36,           /* 00110110 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 253 0xfd '�'
-    */
-    0x78,           /* 01111000 */
-    0x0c,           /* 00001100 */
-    0x18,           /* 00011000 */
-    0x30,           /* 00110000 */
-    0x7c,           /* 01111100 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 254 0xfe '�'
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x3c,           /* 00111100 */
-    0x3c,           /* 00111100 */
-    0x3c,           /* 00111100 */
-    0x3c,           /* 00111100 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-    /*
-    * 255 0xff ' '
-    */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-    0x00,           /* 00000000 */
-
-};
-
-
-/* ---- Character */
-
-/* !
-\brief Global cache for 8x8 pixel font textures created at runtime.
-*/
-static SDL_Texture *SDLTest_CharTextureCache[256];
-
-int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c)
-{
-    const Uint32 charWidth = 8;
-    const Uint32 charHeight = 8;
-    const Uint32 charSize = 8;
-    SDL_Rect srect;
-    SDL_Rect drect;
-    int result;
-    Uint32 ix, iy;
-    const unsigned char *charpos;
-    Uint8 *curpos;
-    Uint8 patt, mask;
-    Uint8 *linepos;
-    Uint32 pitch;
-    SDL_Surface *character;
-    Uint32 ci;
-    Uint8 r, g, b, a;
-
-    /*
-    * Setup source rectangle
-    */
-    srect.x = 0;
-    srect.y = 0;
-    srect.w = charWidth;
-    srect.h = charHeight;
-
-    /*
-    * Setup destination rectangle
-    */
-    drect.x = x;
-    drect.y = y;
-    drect.w = charWidth;
-    drect.h = charHeight;
-
-    /* Character index in cache */
-    ci = (unsigned char)c;
-
-    /*
-    * Create new charWidth x charHeight bitmap surface if not already present.
-    */
-    if (SDLTest_CharTextureCache[ci] == NULL) {
-        /*
-        * Redraw character into surface
-        */
-        character = SDL_CreateRGBSurface(SDL_SWSURFACE,
-            charWidth, charHeight, 32,
-            0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
-        if (character == NULL) {
-            return (-1);
-        }
-
-        charpos = SDLTest_FontData + ci * charSize;
-        linepos = (Uint8 *)character->pixels;
-        pitch = character->pitch;
-
-        /*
-        * Drawing loop
-        */
-        patt = 0;
-        for (iy = 0; iy < charWidth; iy++) {
-            mask = 0x00;
-            curpos = linepos;
-            for (ix = 0; ix < charWidth; ix++) {
-                if (!(mask >>= 1)) {
-                    patt = *charpos++;
-                    mask = 0x80;
-                }
-                if (patt & mask) {
-                    *(Uint32 *)curpos = 0xffffffff;
-                } else {
-                    *(Uint32 *)curpos = 0;
-                }
-                curpos += 4;
-            }
-            linepos += pitch;
-        }
-
-        /* Convert temp surface into texture */
-        SDLTest_CharTextureCache[ci] = SDL_CreateTextureFromSurface(renderer, character);
-        SDL_FreeSurface(character);
-
-        /*
-        * Check pointer
-        */
-        if (SDLTest_CharTextureCache[ci] == NULL) {
-            return (-1);
-        }
-    }
-
-    /*
-    * Set color
-    */
-    result = 0;
-    result |= SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a);
-    result |= SDL_SetTextureColorMod(SDLTest_CharTextureCache[ci], r, g, b);
-    result |= SDL_SetTextureAlphaMod(SDLTest_CharTextureCache[ci], a);
-
-    /*
-    * Draw texture onto destination
-    */
-    result |= SDL_RenderCopy(renderer, SDLTest_CharTextureCache[ci], &srect, &drect);
-
-    return (result);
-}
-
-int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s)
-{
-    const Uint32 charWidth = 8;
-    int result = 0;
-    int curx = x;
-    int cury = y;
-    const char *curchar = s;
-
-    while (*curchar && !result) {
-        result |= SDLTest_DrawCharacter(renderer, curx, cury, *curchar);
-        curx += charWidth;
-        curchar++;
-    }
-
-    return (result);
-}
-
diff --git a/deps/SDL2/src/test/SDL_test_fuzzer.c b/deps/SDL2/src/test/SDL_test_fuzzer.c
deleted file mode 100644
index d090c15..0000000
--- a/deps/SDL2/src/test/SDL_test_fuzzer.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-
-  Data generators for fuzzing test data in a reproducible way.
-
-*/
-
-#include "SDL_config.h"
-
-/* Visual Studio 2008 doesn't have stdint.h */
-#if defined(_MSC_VER) && _MSC_VER <= 1500
-#define UINT8_MAX   ~(Uint8)0
-#define UINT16_MAX  ~(Uint16)0
-#define UINT32_MAX  ~(Uint32)0
-#define UINT64_MAX  ~(Uint64)0
-#else
-#include <stdint.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <float.h>
-
-#include "SDL_test.h"
-
-/**
- * Counter for fuzzer invocations
- */
-static int fuzzerInvocationCounter = 0;
-
-/**
- * Context for shared random number generator
- */
-static SDLTest_RandomContext rndContext;
-
-/*
- * Note: doxygen documentation markup for functions is in the header file.
- */
-
-void
-SDLTest_FuzzerInit(Uint64 execKey)
-{
-    Uint32 a = (execKey >> 32) & 0x00000000FFFFFFFF;
-    Uint32 b = execKey & 0x00000000FFFFFFFF;
-    SDL_memset((void *)&rndContext, 0, sizeof(SDLTest_RandomContext));
-    SDLTest_RandomInit(&rndContext, a, b);
-    fuzzerInvocationCounter = 0;
-}
-
-int
-SDLTest_GetFuzzerInvocationCount()
-{
-    return fuzzerInvocationCounter;
-}
-
-Uint8
-SDLTest_RandomUint8()
-{
-    fuzzerInvocationCounter++;
-
-    return (Uint8) SDLTest_RandomInt(&rndContext) & 0x000000FF;
-}
-
-Sint8
-SDLTest_RandomSint8()
-{
-    fuzzerInvocationCounter++;
-
-    return (Sint8) SDLTest_RandomInt(&rndContext) & 0x000000FF;
-}
-
-Uint16
-SDLTest_RandomUint16()
-{
-    fuzzerInvocationCounter++;
-
-    return (Uint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF;
-}
-
-Sint16
-SDLTest_RandomSint16()
-{
-    fuzzerInvocationCounter++;
-
-    return (Sint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF;
-}
-
-Sint32
-SDLTest_RandomSint32()
-{
-    fuzzerInvocationCounter++;
-
-    return (Sint32) SDLTest_RandomInt(&rndContext);
-}
-
-Uint32
-SDLTest_RandomUint32()
-{
-    fuzzerInvocationCounter++;
-
-    return (Uint32) SDLTest_RandomInt(&rndContext);
-}
-
-Uint64
-SDLTest_RandomUint64()
-{
-    Uint64 value = 0;
-    Uint32 *vp = (void *)&value;
-
-    fuzzerInvocationCounter++;
-
-    vp[0] = SDLTest_RandomSint32();
-    vp[1] = SDLTest_RandomSint32();
-
-    return value;
-}
-
-Sint64
-SDLTest_RandomSint64()
-{
-    Uint64 value = 0;
-    Uint32 *vp = (void *)&value;
-
-    fuzzerInvocationCounter++;
-
-    vp[0] = SDLTest_RandomSint32();
-    vp[1] = SDLTest_RandomSint32();
-
-    return value;
-}
-
-
-
-Sint32
-SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
-{
-    Sint64 min = pMin;
-    Sint64 max = pMax;
-    Sint64 temp;
-    Sint64 number;
-
-    if(pMin > pMax) {
-        temp = min;
-        min = max;
-        max = temp;
-    } else if(pMin == pMax) {
-        return (Sint32)min;
-    }
-
-    number = SDLTest_RandomUint32();
-    /* invocation count increment in preceeding call */
-
-    return (Sint32)((number % ((max + 1) - min)) + min);
-}
-
-/* !
- * Generates a unsigned boundary value between the given boundaries.
- * Boundary values are inclusive. See the examples below.
- * If boundary2 < boundary1, the values are swapped.
- * If boundary1 == boundary2, value of boundary1 will be returned
- *
- * Generating boundary values for Uint8:
- * BoundaryValues(UINT8_MAX, 10, 20, True) -> [10,11,19,20]
- * BoundaryValues(UINT8_MAX, 10, 20, False) -> [9,21]
- * BoundaryValues(UINT8_MAX, 0, 15, True) -> [0, 1, 14, 15]
- * BoundaryValues(UINT8_MAX, 0, 15, False) -> [16]
- * BoundaryValues(UINT8_MAX, 0, 0xFF, False) -> [0], error set
- *
- * Generator works the same for other types of unsigned integers.
- *
- * \param maxValue The biggest value that is acceptable for this data type.
- *                  For instance, for Uint8 -> 255, Uint16 -> 65536 etc.
- * \param boundary1 defines lower boundary
- * \param boundary2 defines upper boundary
- * \param validDomain Generate only for valid domain (for the data type)
- *
- * \returns Returns a random boundary value for the domain or 0 in case of error
- */
-Uint64
-SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
-{
-        Uint64 b1, b2;
-    Uint64 delta;
-    Uint64 tempBuf[4];
-    Uint8 index;
-
-        /* Maybe swap */
-    if (boundary1 > boundary2) {
-        b1 = boundary2;
-        b2 = boundary1;
-    } else {
-        b1 = boundary1;
-        b2 = boundary2;
-        }
-
-    index = 0;
-    if (validDomain == SDL_TRUE) {
-            if (b1 == b2) {
-                return b1;
-            }
-
-            /* Generate up to 4 values within bounds */
-            delta = b2 - b1;
-            if (delta < 4) {
-                do {
-                tempBuf[index] = b1 + index;
-                index++;
-                    } while (index < delta);
-            } else {
-          tempBuf[index] = b1;
-          index++;
-          tempBuf[index] = b1 + 1;
-          index++;
-          tempBuf[index] = b2 - 1;
-          index++;
-          tempBuf[index] = b2;
-          index++;
-            }
-        } else {
-            /* Generate up to 2 values outside of bounds */
-        if (b1 > 0) {
-            tempBuf[index] = b1 - 1;
-            index++;
-        }
-
-        if (b2 < maxValue) {
-            tempBuf[index] = b2 + 1;
-            index++;
-        }
-    }
-
-    if (index == 0) {
-        /* There are no valid boundaries */
-        SDL_Unsupported();
-        return 0;
-    }
-
-    return tempBuf[SDLTest_RandomUint8() % index];
-}
-
-
-Uint8
-SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain)
-{
-    /* max value for Uint8 */
-    const Uint64 maxValue = UCHAR_MAX;
-    return (Uint8)SDLTest_GenerateUnsignedBoundaryValues(maxValue,
-                (Uint64) boundary1, (Uint64) boundary2,
-                validDomain);
-}
-
-Uint16
-SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain)
-{
-    /* max value for Uint16 */
-    const Uint64 maxValue = USHRT_MAX;
-    return (Uint16)SDLTest_GenerateUnsignedBoundaryValues(maxValue,
-                (Uint64) boundary1, (Uint64) boundary2,
-                validDomain);
-}
-
-Uint32
-SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain)
-{
-    /* max value for Uint32 */
-    #if ((ULONG_MAX) == (UINT_MAX))
-      const Uint64 maxValue = ULONG_MAX;
-        #else
-      const Uint64 maxValue = UINT_MAX;
-        #endif
-    return (Uint32)SDLTest_GenerateUnsignedBoundaryValues(maxValue,
-                (Uint64) boundary1, (Uint64) boundary2,
-                validDomain);
-}
-
-Uint64
-SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
-{
-    /* max value for Uint64 */
-    const Uint64 maxValue = ULLONG_MAX;
-    return SDLTest_GenerateUnsignedBoundaryValues(maxValue,
-                (Uint64) boundary1, (Uint64) boundary2,
-                validDomain);
-}
-
-/* !
- * Generates a signed boundary value between the given boundaries.
- * Boundary values are inclusive. See the examples below.
- * If boundary2 < boundary1, the values are swapped.
- * If boundary1 == boundary2, value of boundary1 will be returned
- *
- * Generating boundary values for Sint8:
- * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -10, 20, True) -> [-10,-9,19,20]
- * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -10, 20, False) -> [-11,21]
- * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -30, -15, True) -> [-30, -29, -16, -15]
- * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -127, 15, False) -> [16]
- * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -127, 127, False) -> [0], error set
- *
- * Generator works the same for other types of signed integers.
- *
- * \param minValue The smallest value that is acceptable for this data type.
- *                  For instance, for Uint8 -> -127, etc.
- * \param maxValue The biggest value that is acceptable for this data type.
- *                  For instance, for Uint8 -> 127, etc.
- * \param boundary1 defines lower boundary
- * \param boundary2 defines upper boundary
- * \param validDomain Generate only for valid domain (for the data type)
- *
- * \returns Returns a random boundary value for the domain or 0 in case of error
- */
-Sint64
-SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
-{
-        Sint64 b1, b2;
-    Sint64 delta;
-    Sint64 tempBuf[4];
-    Uint8 index;
-
-        /* Maybe swap */
-    if (boundary1 > boundary2) {
-        b1 = boundary2;
-        b2 = boundary1;
-    } else {
-        b1 = boundary1;
-        b2 = boundary2;
-        }
-
-    index = 0;
-    if (validDomain == SDL_TRUE) {
-            if (b1 == b2) {
-                return b1;
-            }
-
-            /* Generate up to 4 values within bounds */
-            delta = b2 - b1;
-            if (delta < 4) {
-                do {
-                tempBuf[index] = b1 + index;
-                index++;
-                    } while (index < delta);
-            } else {
-          tempBuf[index] = b1;
-          index++;
-          tempBuf[index] = b1 + 1;
-          index++;
-          tempBuf[index] = b2 - 1;
-          index++;
-          tempBuf[index] = b2;
-          index++;
-            }
-        } else {
-            /* Generate up to 2 values outside of bounds */
-        if (b1 > minValue) {
-            tempBuf[index] = b1 - 1;
-            index++;
-        }
-
-        if (b2 < maxValue) {
-            tempBuf[index] = b2 + 1;
-            index++;
-        }
-    }
-
-    if (index == 0) {
-        /* There are no valid boundaries */
-        SDL_Unsupported();
-        return minValue;
-    }
-
-    return tempBuf[SDLTest_RandomUint8() % index];
-}
-
-
-Sint8
-SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain)
-{
-    /* min & max values for Sint8 */
-    const Sint64 maxValue = SCHAR_MAX;
-    const Sint64 minValue = SCHAR_MIN;
-    return (Sint8)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
-                (Sint64) boundary1, (Sint64) boundary2,
-                validDomain);
-}
-
-Sint16
-SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain)
-{
-    /* min & max values for Sint16 */
-    const Sint64 maxValue = SHRT_MAX;
-    const Sint64 minValue = SHRT_MIN;
-    return (Sint16)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
-                (Sint64) boundary1, (Sint64) boundary2,
-                validDomain);
-}
-
-Sint32
-SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain)
-{
-    /* min & max values for Sint32 */
-    #if ((ULONG_MAX) == (UINT_MAX))
-      const Sint64 maxValue = LONG_MAX;
-      const Sint64 minValue = LONG_MIN;
-        #else
-      const Sint64 maxValue = INT_MAX;
-      const Sint64 minValue = INT_MIN;
-        #endif
-    return (Sint32)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
-                (Sint64) boundary1, (Sint64) boundary2,
-                validDomain);
-}
-
-Sint64
-SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
-{
-    /* min & max values for Sint64 */
-    const Sint64 maxValue = LLONG_MAX;
-    const Sint64 minValue = LLONG_MIN;
-    return SDLTest_GenerateSignedBoundaryValues(minValue, maxValue,
-                boundary1, boundary2,
-                validDomain);
-}
-
-float
-SDLTest_RandomUnitFloat()
-{
-    return (float) SDLTest_RandomUint32() / UINT_MAX;
-}
-
-float
-SDLTest_RandomFloat()
-{
-        return (float) (SDLTest_RandomUnitDouble() * (double)2.0 * (double)FLT_MAX - (double)(FLT_MAX));
-}
-
-double
-SDLTest_RandomUnitDouble()
-{
-    return (double) (SDLTest_RandomUint64() >> 11) * (1.0/9007199254740992.0);
-}
-
-double
-SDLTest_RandomDouble()
-{
-    double r = 0.0;
-    double s = 1.0;
-    do {
-      s /= UINT_MAX + 1.0;
-      r += (double)SDLTest_RandomInt(&rndContext) * s;
-    } while (s > DBL_EPSILON);
-
-    fuzzerInvocationCounter++;
-
-    return r;
-}
-
-
-char *
-SDLTest_RandomAsciiString()
-{
-    return SDLTest_RandomAsciiStringWithMaximumLength(255);
-}
-
-char *
-SDLTest_RandomAsciiStringWithMaximumLength(int maxLength)
-{
-    int size;
-
-    if(maxLength < 1) {
-                SDL_InvalidParamError("maxLength");
-        return NULL;
-    }
-
-    size = (SDLTest_RandomUint32() % (maxLength + 1));
-
-    return SDLTest_RandomAsciiStringOfSize(size);
-}
-
-char *
-SDLTest_RandomAsciiStringOfSize(int size)
-{
-    char *string;
-    int counter;
-
-
-    if(size < 1) {
-                SDL_InvalidParamError("size");
-        return NULL;
-    }
-
-    string = (char *)SDL_malloc((size + 1) * sizeof(char));
-    if (string==NULL) {
-      return NULL;
-        }
-
-    for(counter = 0; counter < size; ++counter) {
-        string[counter] = (char)SDLTest_RandomIntegerInRange(32, 126);
-    }
-
-    string[counter] = '\0';
-
-    fuzzerInvocationCounter++;
-
-    return string;
-}
diff --git a/deps/SDL2/src/test/SDL_test_harness.c b/deps/SDL2/src/test/SDL_test_harness.c
deleted file mode 100644
index 1bfe9c2..0000000
--- a/deps/SDL2/src/test/SDL_test_harness.c
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
-Simple DirectMedia Layer
-Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-This software is provided 'as-is', without any express or implied
-warranty.  In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
-claim that you wrote the original software. If you use this software
-in a product, an acknowledgment in the product documentation would be
-appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be
-misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-/* Invalid test name/description message format */
-const char *SDLTest_InvalidNameFormat = "(Invalid)";
-
-/* Log summary message format */
-const char *SDLTest_LogSummaryFormat = "%s Summary: Total=%d Passed=%d Failed=%d Skipped=%d";
-
-/* Final result message format */
-const char *SDLTest_FinalResultFormat = ">>> %s '%s': %s\n";
-
-/* ! \brief Timeout for single test case execution */
-static Uint32 SDLTest_TestCaseTimeout = 3600;
-
-/**
-* Generates a random run seed string for the harness. The generated seed
-* will contain alphanumeric characters (0-9A-Z).
-*
-* Note: The returned string needs to be deallocated by the caller.
-*
-* \param length The length of the seed string to generate
-*
-* \returns The generated seed string
-*/
-char *
-SDLTest_GenerateRunSeed(const int length)
-{
-    char *seed = NULL;
-    SDLTest_RandomContext randomContext;
-    int counter;
-
-    /* Sanity check input */
-    if (length <= 0) {
-        SDLTest_LogError("The length of the harness seed must be >0.");
-        return NULL;
-    }
-
-    /* Allocate output buffer */
-    seed = (char *)SDL_malloc((length + 1) * sizeof(char));
-    if (seed == NULL) {
-        SDLTest_LogError("SDL_malloc for run seed output buffer failed.");
-        return NULL;
-    }
-
-    /* Generate a random string of alphanumeric characters */
-    SDLTest_RandomInitTime(&randomContext);
-    for (counter = 0; counter < length - 1; ++counter) {
-        unsigned int number = SDLTest_Random(&randomContext);
-        char ch = (char) (number % (91 - 48)) + 48;
-        if (ch >= 58 && ch <= 64) {
-            ch = 65;
-        }
-        seed[counter] = ch;
-    }
-    seed[counter] = '\0';
-
-    return seed;
-}
-
-/**
-* Generates an execution key for the fuzzer.
-*
-* \param runSeed        The run seed to use
-* \param suiteName      The name of the test suite
-* \param testName       The name of the test
-* \param iteration      The iteration count
-*
-* \returns The generated execution key to initialize the fuzzer with.
-*
-*/
-Uint64
-SDLTest_GenerateExecKey(char *runSeed, char *suiteName, char *testName, int iteration)
-{
-    SDLTest_Md5Context md5Context;
-    Uint64 *keys;
-    char iterationString[16];
-    Uint32 runSeedLength;
-    Uint32 suiteNameLength;
-    Uint32 testNameLength;
-    Uint32 iterationStringLength;
-    Uint32 entireStringLength;
-    char *buffer;
-
-    if (runSeed == NULL || runSeed[0] == '\0') {
-        SDLTest_LogError("Invalid runSeed string.");
-        return -1;
-    }
-
-    if (suiteName == NULL || suiteName[0] == '\0') {
-        SDLTest_LogError("Invalid suiteName string.");
-        return -1;
-    }
-
-    if (testName == NULL || testName[0] == '\0') {
-        SDLTest_LogError("Invalid testName string.");
-        return -1;
-    }
-
-    if (iteration <= 0) {
-        SDLTest_LogError("Invalid iteration count.");
-        return -1;
-    }
-
-    /* Convert iteration number into a string */
-    SDL_memset(iterationString, 0, sizeof(iterationString));
-    SDL_snprintf(iterationString, sizeof(iterationString) - 1, "%d", iteration);
-
-    /* Combine the parameters into single string */
-    runSeedLength = SDL_strlen(runSeed);
-    suiteNameLength = SDL_strlen(suiteName);
-    testNameLength = SDL_strlen(testName);
-    iterationStringLength = SDL_strlen(iterationString);
-    entireStringLength  = runSeedLength + suiteNameLength + testNameLength + iterationStringLength + 1;
-    buffer = (char *)SDL_malloc(entireStringLength);
-    if (buffer == NULL) {
-        SDLTest_LogError("SDL_malloc failed to allocate buffer for execKey generation.");
-        return 0;
-    }
-    SDL_snprintf(buffer, entireStringLength, "%s%s%s%d", runSeed, suiteName, testName, iteration);
-
-    /* Hash string and use half of the digest as 64bit exec key */
-    SDLTest_Md5Init(&md5Context);
-    SDLTest_Md5Update(&md5Context, (unsigned char *)buffer, entireStringLength);
-    SDLTest_Md5Final(&md5Context);
-    SDL_free(buffer);
-    keys = (Uint64 *)md5Context.digest;
-
-    return keys[0];
-}
-
-/**
-* \brief Set timeout handler for test.
-*
-* Note: SDL_Init(SDL_INIT_TIMER) will be called if it wasn't done so before.
-*
-* \param timeout Timeout interval in seconds.
-* \param callback Function that will be called after timeout has elapsed.
-*
-* \return Timer id or -1 on failure.
-*/
-SDL_TimerID
-SDLTest_SetTestTimeout(int timeout, void (*callback)())
-{
-    Uint32 timeoutInMilliseconds;
-    SDL_TimerID timerID;
-
-    if (callback == NULL) {
-        SDLTest_LogError("Timeout callback can't be NULL");
-        return -1;
-    }
-
-    if (timeout < 0) {
-        SDLTest_LogError("Timeout value must be bigger than zero.");
-        return -1;
-    }
-
-    /* Init SDL timer if not initialized before */
-    if (SDL_WasInit(SDL_INIT_TIMER) == 0) {
-        if (SDL_InitSubSystem(SDL_INIT_TIMER)) {
-            SDLTest_LogError("Failed to init timer subsystem: %s", SDL_GetError());
-            return -1;
-        }
-    }
-
-    /* Set timer */
-    timeoutInMilliseconds = timeout * 1000;
-    timerID = SDL_AddTimer(timeoutInMilliseconds, (SDL_TimerCallback)callback, 0x0);
-    if (timerID == 0) {
-        SDLTest_LogError("Creation of SDL timer failed: %s", SDL_GetError());
-        return -1;
-    }
-
-    return timerID;
-}
-
-/**
-* \brief Timeout handler. Aborts test run and exits harness process.
-*/
-void
-    SDLTest_BailOut()
-{
-    SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run.");
-    exit(TEST_ABORTED); /* bail out from the test */
-}
-
-/**
-* \brief Execute a test using the given execution key.
-*
-* \param testSuite Suite containing the test case.
-* \param testCase Case to execute.
-* \param execKey Execution key for the fuzzer.
-*
-* \returns Test case result.
-*/
-int
-SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey)
-{
-    SDL_TimerID timer = 0;
-    int testCaseResult = 0;
-    int testResult = 0;
-    int fuzzerCount;
-
-    if (testSuite==NULL || testCase==NULL || testSuite->name==NULL || testCase->name==NULL)
-    {
-        SDLTest_LogError("Setup failure: testSuite or testCase references NULL");
-        return TEST_RESULT_SETUP_FAILURE;
-    }
-
-    if (!testCase->enabled)
-    {
-        SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Disabled)");
-        return TEST_RESULT_SKIPPED;
-    }
-
-
-    /* Initialize fuzzer */
-    SDLTest_FuzzerInit(execKey);
-
-    /* Reset assert tracker */
-    SDLTest_ResetAssertSummary();
-
-    /* Set timeout timer */
-    timer = SDLTest_SetTestTimeout(SDLTest_TestCaseTimeout, SDLTest_BailOut);
-
-    /* Maybe run suite initalizer function */
-    if (testSuite->testSetUp) {
-        testSuite->testSetUp(0x0);
-        if (SDLTest_AssertSummaryToTestResult() == TEST_RESULT_FAILED) {
-            SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite Setup", testSuite->name, "Failed");
-            return TEST_RESULT_SETUP_FAILURE;
-        }
-    }
-
-    /* Run test case function */
-    testCaseResult = testCase->testCase(0x0);
-
-    /* Convert test execution result into harness result */
-    if (testCaseResult == TEST_SKIPPED) {
-        /* Test was programatically skipped */
-        testResult = TEST_RESULT_SKIPPED;
-    } else if (testCaseResult == TEST_STARTED) {
-        /* Test did not return a TEST_COMPLETED value; assume it failed */
-        testResult = TEST_RESULT_FAILED;
-    } else if (testCaseResult == TEST_ABORTED) {
-        /* Test was aborted early; assume it failed */
-        testResult = TEST_RESULT_FAILED;
-    } else {
-        /* Perform failure analysis based on asserts */
-        testResult = SDLTest_AssertSummaryToTestResult();
-    }
-
-    /* Maybe run suite cleanup function (ignore failed asserts) */
-    if (testSuite->testTearDown) {
-        testSuite->testTearDown(0x0);
-    }
-
-    /* Cancel timeout timer */
-    if (timer) {
-        SDL_RemoveTimer(timer);
-    }
-
-    /* Report on asserts and fuzzer usage */
-    fuzzerCount = SDLTest_GetFuzzerInvocationCount();
-    if (fuzzerCount > 0) {
-        SDLTest_Log("Fuzzer invocations: %d", fuzzerCount);
-    }
-
-    /* Final log based on test execution result */
-    if (testCaseResult == TEST_SKIPPED) {
-        /* Test was programatically skipped */
-        SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Programmatically)");
-    } else if (testCaseResult == TEST_STARTED) {
-        /* Test did not return a TEST_COMPLETED value; assume it failed */
-        SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Failed (test started, but did not return TEST_COMPLETED)");
-    } else if (testCaseResult == TEST_ABORTED) {
-        /* Test was aborted early; assume it failed */
-        SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Failed (Aborted)");
-    } else {
-        SDLTest_LogAssertSummary();
-    }
-
-    return testResult;
-}
-
-/* Prints summary of all suites/tests contained in the given reference */
-void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites)
-{
-    int suiteCounter;
-    int testCounter;
-    SDLTest_TestSuiteReference *testSuite;
-    SDLTest_TestCaseReference *testCase;
-
-    /* Loop over all suites */
-    suiteCounter = 0;
-    while(&testSuites[suiteCounter]) {
-        testSuite=&testSuites[suiteCounter];
-        suiteCounter++;
-        SDLTest_Log("Test Suite %i - %s\n", suiteCounter,
-            (testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat);
-
-        /* Loop over all test cases */
-        testCounter = 0;
-        while(testSuite->testCases[testCounter])
-        {
-            testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
-            testCounter++;
-            SDLTest_Log("  Test Case %i - %s: %s", testCounter,
-                (testCase->name) ? testCase->name : SDLTest_InvalidNameFormat,
-                (testCase->description) ? testCase->description : SDLTest_InvalidNameFormat);
-        }
-    }
-}
-
-/* Gets a timer value in seconds */
-float GetClock()
-{
-    float currentClock = (float)clock();
-    return currentClock / (float)CLOCKS_PER_SEC;
-}
-
-/**
-* \brief Execute a test suite using the given run seend and execution key.
-*
-* The filter string is matched to the suite name (full comparison) to select a single suite,
-* or if no suite matches, it is matched to the test names (full comparison) to select a single test.
-*
-* \param testSuites Suites containing the test case.
-* \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one.
-* \param userExecKey Custom execution key provided by user, or 0 to autogenerate one.
-* \param filter Filter specification. NULL disables. Case sensitive.
-* \param testIterations Number of iterations to run each test case.
-*
-* \returns Test run result; 0 when all tests passed, 1 if any tests failed.
-*/
-int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations)
-{
-    int suiteCounter;
-    int testCounter;
-    int iterationCounter;
-    SDLTest_TestSuiteReference *testSuite;
-    SDLTest_TestCaseReference *testCase;
-    const char *runSeed = NULL;
-    char *currentSuiteName;
-    char *currentTestName;
-    Uint64 execKey;
-    float runStartSeconds;
-    float suiteStartSeconds;
-    float testStartSeconds;
-    float runEndSeconds;
-    float suiteEndSeconds;
-    float testEndSeconds;
-    float runtime;
-    int suiteFilter = 0;
-    char *suiteFilterName = NULL;
-    int testFilter = 0;
-    char *testFilterName = NULL;
-    int testResult = 0;
-    int runResult = 0;
-    Uint32 totalTestFailedCount = 0;
-    Uint32 totalTestPassedCount = 0;
-    Uint32 totalTestSkippedCount = 0;
-    Uint32 testFailedCount = 0;
-    Uint32 testPassedCount = 0;
-    Uint32 testSkippedCount = 0;
-    Uint32 countSum = 0;
-    char *logFormat = (char *)SDLTest_LogSummaryFormat;
-
-    /* Sanitize test iterations */
-    if (testIterations < 1) {
-        testIterations = 1;
-    }
-
-    /* Generate run see if we don't have one already */
-    if (userRunSeed == NULL || userRunSeed[0] == '\0') {
-        runSeed = SDLTest_GenerateRunSeed(16);
-        if (runSeed == NULL) {
-            SDLTest_LogError("Generating a random seed failed");
-            return 2;
-        }
-    } else {
-        runSeed = userRunSeed;
-    }
-
-
-    /* Reset per-run counters */
-    totalTestFailedCount = 0;
-    totalTestPassedCount = 0;
-    totalTestSkippedCount = 0;
-
-    /* Take time - run start */
-    runStartSeconds = GetClock();
-
-    /* Log run with fuzzer parameters */
-    SDLTest_Log("::::: Test Run /w seed '%s' started\n", runSeed);
-
-    /* Initialize filtering */
-    if (filter != NULL && filter[0] != '\0') {
-        /* Loop over all suites to check if we have a filter match */
-        suiteCounter = 0;
-        while (testSuites[suiteCounter] && suiteFilter == 0) {
-            testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter];
-            suiteCounter++;
-            if (testSuite->name != NULL && SDL_strcmp(filter, testSuite->name) == 0) {
-                /* Matched a suite name */
-                suiteFilter = 1;
-                suiteFilterName = testSuite->name;
-                SDLTest_Log("Filtering: running only suite '%s'", suiteFilterName);
-                break;
-            }
-
-            /* Within each suite, loop over all test cases to check if we have a filter match */
-            testCounter = 0;
-            while (testSuite->testCases[testCounter] && testFilter == 0)
-            {
-                testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
-                testCounter++;
-                if (testCase->name != NULL && SDL_strcmp(filter, testCase->name) == 0) {
-                    /* Matched a test name */
-                    suiteFilter = 1;
-                    suiteFilterName = testSuite->name;
-                    testFilter = 1;
-                    testFilterName = testCase->name;
-                    SDLTest_Log("Filtering: running only test '%s' in suite '%s'", testFilterName, suiteFilterName);
-                    break;
-                }
-            }
-        }
-
-        if (suiteFilter == 0 && testFilter == 0) {
-            SDLTest_LogError("Filter '%s' did not match any test suite/case.", filter);
-            SDLTest_Log("Exit code: 2");
-            return 2;
-        }
-    }
-
-    /* Loop over all suites */
-    suiteCounter = 0;
-    while(testSuites[suiteCounter]) {
-        testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter];
-        currentSuiteName = (char *)((testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat);
-        suiteCounter++;
-
-        /* Filter suite if flag set and we have a name */
-        if (suiteFilter == 1 && suiteFilterName != NULL && testSuite->name != NULL &&
-            SDL_strcmp(suiteFilterName, testSuite->name) != 0) {
-                /* Skip suite */
-                SDLTest_Log("===== Test Suite %i: '%s' skipped\n",
-                    suiteCounter,
-                    currentSuiteName);
-        } else {
-
-            /* Reset per-suite counters */
-            testFailedCount = 0;
-            testPassedCount = 0;
-            testSkippedCount = 0;
-
-            /* Take time - suite start */
-            suiteStartSeconds = GetClock();
-
-            /* Log suite started */
-            SDLTest_Log("===== Test Suite %i: '%s' started\n",
-                suiteCounter,
-                currentSuiteName);
-
-            /* Loop over all test cases */
-            testCounter = 0;
-            while(testSuite->testCases[testCounter])
-            {
-                testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
-                currentTestName = (char *)((testCase->name) ? testCase->name : SDLTest_InvalidNameFormat);
-                testCounter++;
-
-                /* Filter tests if flag set and we have a name */
-                if (testFilter == 1 && testFilterName != NULL && testCase->name != NULL &&
-                    SDL_strcmp(testFilterName, testCase->name) != 0) {
-                        /* Skip test */
-                        SDLTest_Log("===== Test Case %i.%i: '%s' skipped\n",
-                            suiteCounter,
-                            testCounter,
-                            currentTestName);
-                } else {
-                    /* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */
-                    if (testFilter == 1 && !testCase->enabled) {
-                        SDLTest_Log("Force run of disabled test since test filter was set");
-                        testCase->enabled = 1;
-                    }
-
-                    /* Take time - test start */
-                    testStartSeconds = GetClock();
-
-                    /* Log test started */
-                    SDLTest_Log("----- Test Case %i.%i: '%s' started",
-                        suiteCounter,
-                        testCounter,
-                        currentTestName);
-                    if (testCase->description != NULL && testCase->description[0] != '\0') {
-                        SDLTest_Log("Test Description: '%s'",
-                            (testCase->description) ? testCase->description : SDLTest_InvalidNameFormat);
-                    }
-
-                    /* Loop over all iterations */
-                    iterationCounter = 0;
-                    while(iterationCounter < testIterations)
-                    {
-                        iterationCounter++;
-
-                        if (userExecKey != 0) {
-                            execKey = userExecKey;
-                        } else {
-                            execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter);
-                        }
-
-                        SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey);
-                        testResult = SDLTest_RunTest(testSuite, testCase, execKey);
-
-                        if (testResult == TEST_RESULT_PASSED) {
-                            testPassedCount++;
-                            totalTestPassedCount++;
-                        } else if (testResult == TEST_RESULT_SKIPPED) {
-                            testSkippedCount++;
-                            totalTestSkippedCount++;
-                        } else {
-                            testFailedCount++;
-                            totalTestFailedCount++;
-                        }
-                    }
-
-                    /* Take time - test end */
-                    testEndSeconds = GetClock();
-                    runtime = testEndSeconds - testStartSeconds;
-                    if (runtime < 0.0f) runtime = 0.0f;
-
-                    if (testIterations > 1) {
-                        /* Log test runtime */
-                        SDLTest_Log("Runtime of %i iterations: %.1f sec", testIterations, runtime);
-                        SDLTest_Log("Average Test runtime: %.5f sec", runtime / (float)testIterations);
-                    } else {
-                        /* Log test runtime */
-                        SDLTest_Log("Total Test runtime: %.1f sec", runtime);
-                    }
-
-                    /* Log final test result */
-                    switch (testResult) {
-                    case TEST_RESULT_PASSED:
-                        SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Passed");
-                        break;
-                    case TEST_RESULT_FAILED:
-                        SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Failed");
-                        break;
-                    case TEST_RESULT_NO_ASSERT:
-                        SDLTest_LogError((char *)SDLTest_FinalResultFormat,"Test", currentTestName, "No Asserts");
-                        break;
-                    }
-
-                }
-            }
-
-            /* Take time - suite end */
-            suiteEndSeconds = GetClock();
-            runtime = suiteEndSeconds - suiteStartSeconds;
-            if (runtime < 0.0f) runtime = 0.0f;
-
-            /* Log suite runtime */
-            SDLTest_Log("Total Suite runtime: %.1f sec", runtime);
-
-            /* Log summary and final Suite result */
-            countSum = testPassedCount + testFailedCount + testSkippedCount;
-            if (testFailedCount == 0)
-            {
-                SDLTest_Log(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
-                SDLTest_Log((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Passed");
-            }
-            else
-            {
-                SDLTest_LogError(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
-                SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Failed");
-            }
-
-        }
-    }
-
-    /* Take time - run end */
-    runEndSeconds = GetClock();
-    runtime = runEndSeconds - runStartSeconds;
-    if (runtime < 0.0f) runtime = 0.0f;
-
-    /* Log total runtime */
-    SDLTest_Log("Total Run runtime: %.1f sec", runtime);
-
-    /* Log summary and final run result */
-    countSum = totalTestPassedCount + totalTestFailedCount + totalTestSkippedCount;
-    if (totalTestFailedCount == 0)
-    {
-        runResult = 0;
-        SDLTest_Log(logFormat, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount);
-        SDLTest_Log((char *)SDLTest_FinalResultFormat, "Run /w seed", runSeed, "Passed");
-    }
-    else
-    {
-        runResult = 1;
-        SDLTest_LogError(logFormat, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount);
-        SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Run /w seed", runSeed, "Failed");
-    }
-
-    SDLTest_Log("Exit code: %d", runResult);
-    return runResult;
-}
diff --git a/deps/SDL2/src/test/SDL_test_imageBlit.c b/deps/SDL2/src/test/SDL_test_imageBlit.c
deleted file mode 100644
index d1d1295..0000000
--- a/deps/SDL2/src/test/SDL_test_imageBlit.c
+++ /dev/null
@@ -1,1557 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-/* GIMP RGB C-Source image dump (blit.c) */
-
-const SDLTest_SurfaceImage_t SDLTest_imageBlit = {
-  80, 60, 3,
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377"
-  "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0"
-  "\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0"
-  "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0"
-  "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0"
-  "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0"
-  "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0"
-  "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0"
-  "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0"
-  "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0"
-  "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0"
-  "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0"
-  "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0"
-  "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0"
-  "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0"
-  "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0"
-  "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377"
-  "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0"
-  "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377"
-  "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0"
-  "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0"
-  "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0"
-  "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0"
-  "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0"
-  "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0"
-  "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377"
-  "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0",
-};
-
-/**
- * \brief Returns the Blit test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImageBlit()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imageBlit.pixel_data,
-        SDLTest_imageBlit.width,
-        SDLTest_imageBlit.height,
-        SDLTest_imageBlit.bytes_per_pixel * 8,
-        SDLTest_imageBlit.width * SDLTest_imageBlit.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
-
-const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = {
-  80, 60, 3,
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\0\0\0\0"
-  "\0\0(\0\0(\0\0\0\0\0\0\0\0<\0\0<\0\0\0\0\0\0\0\0P\0\0P\0\0\0\0\0\0\0\0d\0"
-  "\0d\0\0\0\0\0\0\0\0x\0\0x\0\0\0\0\0\0\0\0\214\0\0\214\0\0\0\0\0\0\0\0\240"
-  "\0\0\240\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\0\0\0\310\0\0\310\0\0\0\0"
-  "\0\0\0\0\334\0\0\334\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360"
-  "\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\24\0\0\0\0\0(\0\0"
-  "(\0\0(\0\0\0\0\0<\0\0<\0\0<\0\0\0\0\0P\0\0P\0\0P\0\0\0\0\0d\0\0d\0\0d\0\0"
-  "\0\0\0x\0\0x\0\0x\0\0\0\0\0\214\0\0\214\0\0\214\0\0\0\0\0\240\0\0\240\0\0"
-  "\240\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\310\0\0\310\0\0\310\0\0\0\0"
-  "\0\334\0\0\334\0\0\334\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0"
-  "\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\24\0\0\0"
-  "\0\0(\0\0(\0\0(\0\0\0\0\0<\0\0<\0\0<\0\0\0\0\0P\0\0P\0\0P\0\0\0\0\0d\0\0"
-  "d\0\0d\0\0\0\0\0x\0\0x\0\0x\0\0\0\0\0\214\0\0\214\0\0\214\0\0\0\0\0\240\0"
-  "\0\240\0\0\240\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\310\0\0\310\0\0\310"
-  "\0\0\0\0\0\334\0\0\334\0\0\334\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0"
-  "\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0"
-  "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0\0\0\0$\24\0"
-  "$\24\0\0\0\0\0\0\0$(\0$(\0\0\0\0\0\0\0$<\0$<\0\0\0\0\0\0\0$P\0$P\0\0\0\0"
-  "\0\0\0$d\0$d\0\0\0\0\0\0\0$x\0$x\0\0\0\0\0\0\0$\214\0$\214\0\0\0\0\0\0\0"
-  "$\240\0$\240\0\0\0\0\0\0\0$\264\0$\264\0\0\0\0\0\0\0$\310\0$\310\0\0\0\0"
-  "\0\0\0$\334\0$\334\0\0\0\0\0\0\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360"
-  "\0$\360\0$\360\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0$\24\0$\24\0$\24\0\0\0\0$(\0$(\0$(\0\0\0\0"
-  "$<\0$<\0$<\0\0\0\0$P\0$P\0$P\0\0\0\0$d\0$d\0$d\0\0\0\0$x\0$x\0$x\0\0\0\0"
-  "$\214\0$\214\0$\214\0\0\0\0$\240\0$\240\0$\240\0\0\0\0$\264\0$\264\0$\264"
-  "\0\0\0\0$\310\0$\310\0$\310\0\0\0\0$\334\0$\334\0$\334\0\0\0\0$\360\0$\360"
-  "\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0"
-  "\0\0\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0$\24\0"
-  "$\24\0$\24\0\0\0\0$(\0$(\0$(\0\0\0\0$<\0$<\0$<\0\0\0\0$P\0$P\0$P\0\0\0\0"
-  "$d\0$d\0$d\0\0\0\0$x\0$x\0$x\0\0\0\0$\214\0$\214\0$\214\0\0\0\0$\240\0$\240"
-  "\0$\240\0\0\0\0$\264\0$\264\0$\264\0\0\0\0$\310\0$\310\0$\310\0\0\0\0$\334"
-  "\0$\334\0$\334\0\0\0\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$"
-  "\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0\0\0\0\0\360\0\0\360\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0$\360\0$\360\0$\360\0$\360\0\0\0\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0$\0\0\0\0"
-  "\0\0\0\0H\0\0H\0\0\0\0\0\0\0\0H\24\0H\24\0\0\0\0\0\0\0H(\0H(\0\0\0\0\0\0"
-  "\0H<\0H<\0\0\0\0\0\0\0HP\0HP\0\0\0\0\0\0\0Hd\0Hd\0\0\0\0\0\0\0Hx\0Hx\0\0"
-  "\0\0\0\0\0H\214\0H\214\0\0\0\0\0\0\0H\240\0H\240\0\0\0\0\0\0\0H\264\0H\264"
-  "\0\0\0\0\0\0\0H\310\0H\310\0\0\0\0\0\0\0H\334\0H\334\0\0\0\0\0\0\0H\360\0"
-  "H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0\0\0\0\0\0\0$\360\0$\360"
-  "\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0H\0\0H\0\0H\0\0\0\0\0H\24\0H\24\0H\24"
-  "\0\0\0\0H(\0H(\0H(\0\0\0\0H<\0H<\0H<\0\0\0\0HP\0HP\0HP\0\0\0\0Hd\0Hd\0Hd"
-  "\0\0\0\0Hx\0Hx\0Hx\0\0\0\0H\214\0H\214\0H\214\0\0\0\0H\240\0H\240\0H\240"
-  "\0\0\0\0H\264\0H\264\0H\264\0\0\0\0H\310\0H\310\0H\310\0\0\0\0H\334\0H\334"
-  "\0H\334\0\0\0\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H"
-  "\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0H\0\0"
-  "H\0\0H\0\0\0\0\0H\24\0H\24\0H\24\0\0\0\0H(\0H(\0H(\0\0\0\0H<\0H<\0H<\0\0"
-  "\0\0HP\0HP\0HP\0\0\0\0Hd\0Hd\0Hd\0\0\0\0Hx\0Hx\0Hx\0\0\0\0H\214\0H\214\0"
-  "H\214\0\0\0\0H\240\0H\240\0H\240\0\0\0\0H\264\0H\264\0H\264\0\0\0\0H\310"
-  "\0H\310\0H\310\0\0\0\0H\334\0H\334\0H\334\0\0\0\0H\360\0H\360\0H\360\0H\360"
-  "\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0"
-  "\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0$\0\0\0\0\0H\0\0H\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0H\0\0H\0\0H\0\0\0\0\0\0\0\0l\0\0l\0\0\0\0\0\0\0\0l\24\0l\24\0\0\0\0\0\0"
-  "\0l(\0l(\0\0\0\0\0\0\0l<\0l<\0\0\0\0\0\0\0lP\0lP\0\0\0\0\0\0\0ld\0ld\0\0"
-  "\0\0\0\0\0lx\0lx\0\0\0\0\0\0\0l\214\0l\214\0\0\0\0\0\0\0l\240\0l\240\0\0"
-  "\0\0\0\0\0l\264\0l\264\0\0\0\0\0\0\0l\310\0l\310\0\0\0\0\0\0\0l\334\0l\334"
-  "\0\0\0\0\0\0\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0\0"
-  "\0\0\0\0\0H\360\0H\360\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0\0H\0\0\0\0\0l\0\0l\0\0l\0\0"
-  "\0\0\0l\24\0l\24\0l\24\0\0\0\0l(\0l(\0l(\0\0\0\0l<\0l<\0l<\0\0\0\0lP\0lP"
-  "\0lP\0\0\0\0ld\0ld\0ld\0\0\0\0lx\0lx\0lx\0\0\0\0l\214\0l\214\0l\214\0\0\0"
-  "\0l\240\0l\240\0l\240\0\0\0\0l\264\0l\264\0l\264\0\0\0\0l\310\0l\310\0l\310"
-  "\0\0\0\0l\334\0l\334\0l\334\0\0\0\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360"
-  "\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0\0\0\0H\360\0H\360\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0"
-  "\0H\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0l\24\0l\24\0l\24\0\0\0\0l(\0l(\0l(\0\0"
-  "\0\0l<\0l<\0l<\0\0\0\0lP\0lP\0lP\0\0\0\0ld\0ld\0ld\0\0\0\0lx\0lx\0lx\0\0"
-  "\0\0l\214\0l\214\0l\214\0\0\0\0l\240\0l\240\0l\240\0\0\0\0l\264\0l\264\0"
-  "l\264\0\0\0\0l\310\0l\310\0l\310\0\0\0\0l\334\0l\334\0l\334\0\0\0\0l\360"
-  "\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0"
-  "l\360\0l\360\0l\360\0\0\0\0H\360\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0l\360\0l\360\0l\360\0l\360"
-  "\0\0\0\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0\0\0\0\220\0\0\220\0\0\0\0\0\0\0"
-  "\0\220\24\0\220\24\0\0\0\0\0\0\0\220(\0\220(\0\0\0\0\0\0\0\220<\0\220<\0"
-  "\0\0\0\0\0\0\220P\0\220P\0\0\0\0\0\0\0\220d\0\220d\0\0\0\0\0\0\0\220x\0\220"
-  "x\0\0\0\0\0\0\0\220\214\0\220\214\0\0\0\0\0\0\0\220\240\0\220\240\0\0\0\0"
-  "\0\0\0\220\264\0\220\264\0\0\0\0\0\0\0\220\310\0\220\310\0\0\0\0\0\0\0\220"
-  "\334\0\220\334\0\0\0\0\0\0\0\220\360\0\220\360\0\220\360\0\220\360\0\220"
-  "\360\0\220\360\0\220\360\0\220\360\0\0\0\0\0\0\0l\360\0l\360\0l\360\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0l\0\0l\0\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\220\24\0\220\24\0"
-  "\220\24\0\0\0\0\220(\0\220(\0\220(\0\0\0\0\220<\0\220<\0\220<\0\0\0\0\220"
-  "P\0\220P\0\220P\0\0\0\0\220d\0\220d\0\220d\0\0\0\0\220x\0\220x\0\220x\0\0"
-  "\0\0\220\214\0\220\214\0\220\214\0\0\0\0\220\240\0\220\240\0\220\240\0\0"
-  "\0\0\220\264\0\220\264\0\220\264\0\0\0\0\220\310\0\220\310\0\220\310\0\0"
-  "\0\0\220\334\0\220\334\0\220\334\0\0\0\0\220\360\0\220\360\0\220\360\0\220"
-  "\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360"
-  "\0\220\360\0\0\0\0l\360\0l\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0l\0\0l\0\0\0\0\0\220\0\0\220\0\0\220"
-  "\0\0\0\0\0\220\24\0\220\24\0\220\24\0\0\0\0\220(\0\220(\0\220(\0\0\0\0\220"
-  "<\0\220<\0\220<\0\0\0\0\220P\0\220P\0\220P\0\0\0\0\220d\0\220d\0\220d\0\0"
-  "\0\0\220x\0\220x\0\220x\0\0\0\0\220\214\0\220\214\0\220\214\0\0\0\0\220\240"
-  "\0\220\240\0\220\240\0\0\0\0\220\264\0\220\264\0\220\264\0\0\0\0\220\310"
-  "\0\220\310\0\220\310\0\0\0\0\220\334\0\220\334\0\220\334\0\0\0\0\220\360"
-  "\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0"
-  "\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\0\0\0l\360\0"
-  "l\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0l\0\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\220\360\0\220\360\0\220\360\0\220\360\0\0\0\0l\360"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\0\0\0"
-  "\264\24\0\264\24\0\0\0\0\0\0\0\264(\0\264(\0\0\0\0\0\0\0\264<\0\264<\0\0"
-  "\0\0\0\0\0\264P\0\264P\0\0\0\0\0\0\0\264d\0\264d\0\0\0\0\0\0\0\264x\0\264"
-  "x\0\0\0\0\0\0\0\264\214\0\264\214\0\0\0\0\0\0\0\264\240\0\264\240\0\0\0\0"
-  "\0\0\0\264\264\0\264\264\0\0\0\0\0\0\0\264\310\0\264\310\0\0\0\0\0\0\0\264"
-  "\334\0\264\334\0\0\0\0\0\0\0\264\360\0\264\360\0\264\360\0\264\360\0\264"
-  "\360\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\220\360\0\220\360\0\220"
-  "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\220\0\0\220\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\264"
-  "\24\0\264\24\0\264\24\0\0\0\0\264(\0\264(\0\264(\0\0\0\0\264<\0\264<\0\264"
-  "<\0\0\0\0\264P\0\264P\0\264P\0\0\0\0\264d\0\264d\0\264d\0\0\0\0\264x\0\264"
-  "x\0\264x\0\0\0\0\264\214\0\264\214\0\264\214\0\0\0\0\264\240\0\264\240\0"
-  "\264\240\0\0\0\0\264\264\0\264\264\0\264\264\0\0\0\0\264\310\0\264\310\0"
-  "\264\310\0\0\0\0\264\334\0\264\334\0\264\334\0\0\0\0\264\360\0\264\360\0"
-  "\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264"
-  "\360\0\264\360\0\264\360\0\0\0\0\220\360\0\220\360\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\0\0\220\0"
-  "\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\264\24\0\264\24\0\264\24\0\0\0\0\264"
-  "(\0\264(\0\264(\0\0\0\0\264<\0\264<\0\264<\0\0\0\0\264P\0\264P\0\264P\0\0"
-  "\0\0\264d\0\264d\0\264d\0\0\0\0\264x\0\264x\0\264x\0\0\0\0\264\214\0\264"
-  "\214\0\264\214\0\0\0\0\264\240\0\264\240\0\264\240\0\0\0\0\264\264\0\264"
-  "\264\0\264\264\0\0\0\0\264\310\0\264\310\0\264\310\0\0\0\0\264\334\0\264"
-  "\334\0\264\334\0\0\0\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0"
-  "\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264"
-  "\360\0\264\360\0\0\0\0\220\360\0\220\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\0\0\0\0\0\264\0\0\264\0\0"
-  "\264\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\360\0"
-  "\264\360\0\264\360\0\264\360\0\0\0\0\220\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0\264\0\0\264"
-  "\0\0\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\0\0\0\330\24\0\330\24\0\0\0\0\0\0"
-  "\0\330(\0\330(\0\0\0\0\0\0\0\330<\0\330<\0\0\0\0\0\0\0\330P\0\330P\0\0\0"
-  "\0\0\0\0\330d\0\330d\0\0\0\0\0\0\0\330x\0\330x\0\0\0\0\0\0\0\330\214\0\330"
-  "\214\0\0\0\0\0\0\0\330\240\0\330\240\0\0\0\0\0\0\0\330\264\0\330\264\0\0"
-  "\0\0\0\0\0\330\310\0\330\310\0\0\0\0\0\0\0\330\334\0\330\334\0\0\0\0\0\0"
-  "\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0"
-  "\330\360\0\0\0\0\0\0\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0"
-  "\264\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\330\24\0\330\24\0\330\24\0\0"
-  "\0\0\330(\0\330(\0\330(\0\0\0\0\330<\0\330<\0\330<\0\0\0\0\330P\0\330P\0"
-  "\330P\0\0\0\0\330d\0\330d\0\330d\0\0\0\0\330x\0\330x\0\330x\0\0\0\0\330\214"
-  "\0\330\214\0\330\214\0\0\0\0\330\240\0\330\240\0\330\240\0\0\0\0\330\264"
-  "\0\330\264\0\330\264\0\0\0\0\330\310\0\330\310\0\330\310\0\0\0\0\330\334"
-  "\0\330\334\0\330\334\0\0\0\0\330\360\0\330\360\0\330\360\0\330\360\0\330"
-  "\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360"
-  "\0\0\0\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\330\0\0\330\0\0"
-  "\330\0\0\0\0\0\330\24\0\330\24\0\330\24\0\0\0\0\330(\0\330(\0\330(\0\0\0"
-  "\0\330<\0\330<\0\330<\0\0\0\0\330P\0\330P\0\330P\0\0\0\0\330d\0\330d\0\330"
-  "d\0\0\0\0\330x\0\330x\0\330x\0\0\0\0\330\214\0\330\214\0\330\214\0\0\0\0"
-  "\330\240\0\330\240\0\330\240\0\0\0\0\330\264\0\330\264\0\330\264\0\0\0\0"
-  "\330\310\0\330\310\0\330\310\0\0\0\0\330\334\0\330\334\0\330\334\0\0\0\0"
-  "\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330"
-  "\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\0\0\0"
-  "\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\264\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0\330"
-  "\360\0\0\0\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\0\0\0\374\0\0"
-  "\374\0\0\0\0\0\0\0\0\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0"
-  "\0\0\374<\0\374<\0\0\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0"
-  "\0\0\0\0\0\374x\0\374x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374"
-  "\240\0\374\240\0\0\0\0\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374"
-  "\310\0\0\0\0\0\0\0\374\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\330"
-  "\360\0\330\360\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\374\0\0\374"
-  "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0"
-  "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d"
-  "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0"
-  "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0"
-  "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0"
-  "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330"
-  "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0"
-  "\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0"
-  "\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x"
-  "\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374"
-  "\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374"
-  "\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330\360\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330"
-  "\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0"
-  "\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374"
-  "P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0"
-  "\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0"
-  "\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0"
-  "\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374"
-  "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0"
-  "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d"
-  "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0"
-  "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0"
-  "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0"
-  "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374"
-  "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374"
-  "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0"
-  "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240"
-  "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310"
-  "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360"
-  "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374"
-  "(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374"
-  "d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374"
-  "\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374"
-  "\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374"
-  "\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\334"
-  "\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\334\0\0"
-  "\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0"
-  "\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374"
-  "<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374"
-  "x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374"
-  "\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374"
-  "\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374"
-  "(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0"
-  "\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374"
-  "\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374"
-  "\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374"
-  "\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0"
-  "\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0"
-  "\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214"
-  "\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264"
-  "\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334"
-  "\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374"
-  "(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374"
-  "d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374"
-  "\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374"
-  "\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374"
-  "\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374"
-  "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0"
-  "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d"
-  "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0"
-  "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0"
-  "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0"
-  "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374"
-  "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374"
-  "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0"
-  "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240"
-  "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310"
-  "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374"
-  "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374"
-  "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0"
-  "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240"
-  "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310"
-  "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0\374\24"
-  "\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0\0\0\0\0"
-  "\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374x\0\0\0"
-  "\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0\0\0\0"
-  "\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374\334"
-  "\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0"
-  "\0\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0"
-  "\0\0\0\0\0\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0"
-  "\374<\0\0\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374"
-  "x\0\374x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240"
-  "\0\0\0\0\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0"
-  "\0\0\0\374\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374"
-  "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0\374\24\0"
-  "\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0\0\0\0\0\0"
-  "\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374x\0\0\0\0"
-  "\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0\0\0\0\374"
-  "\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374\334\0\374"
-  "\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0"
-  "\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P"
-  "\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374"
-  "\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374"
-  "\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374"
-  "\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0"
-  "\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0"
-  "\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374"
-  "x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0"
-  "\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374"
-  "\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
-};
-
-/**
- * \brief Returns the BlitColor test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImageBlitColor()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imageBlitColor.pixel_data,
-        SDLTest_imageBlitColor.width,
-        SDLTest_imageBlitColor.height,
-        SDLTest_imageBlitColor.bytes_per_pixel * 8,
-        SDLTest_imageBlitColor.width * SDLTest_imageBlitColor.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
-
-const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = {
-  80, 60, 3,
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\20\20\0"
-  "\20\20\0""88\0""88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0II\0\224\224\0\224"
-  "\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302\302\0HH\0HH\0\324"
-  "\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0""00\0""00\0\356\356\0\356\356"
-  "\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16\0\374\374\0\374\374"
-  "\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\24\24\0\24\24\0\24\24\0\20\20\0""88\0""88\0""88\0**\0ff\0ff\0ff\0FF\0"
-  "\215\215\0\215\215\0\215\215\0UU\0\255\255\0\255\255\0\255\255\0[[\0\306"
-  "\306\0\306\306\0\306\306\0YY\0\331\331\0\331\331\0\331\331\0PP\0\350\350"
-  "\0\350\350\0\350\350\0DD\0\362\362\0\362\362\0\362\362\0""44\0\370\370\0"
-  "\370\370\0\370\370\0\"\"\0\374\374\0\374\374\0\374\374\0\16\16\0\376\376"
-  "\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\374\374\0"
-  "\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\20\20\0""88\0"
-  """88\0""88\0**\0ff\0ff\0ff\0FF\0\226\226\0\226\226\0\215\215\0UU\0\271\271"
-  "\0\271\271\0\255\255\0[[\0\323\323\0\323\323\0\306\306\0YY\0\345\345\0\345"
-  "\345\0\331\331\0PP\0\360\360\0\360\360\0\350\350\0DD\0\370\370\0\370\370"
-  "\0\362\362\0""44\0\374\374\0\374\374\0\370\370\0\"\"\0\376\376\0\376\376"
-  "\0\374\374\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376"
-  "\376\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360"
-  "\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24"
-  "\0\24\24\0\24\24\0\20\20\0""33\0""33\0""33\0&&\0OO\0OO\0OO\0""55\0``\0``"
-  "\0``\0::\0``\0``\0``\0""22\0WW\0WW\0WW\0''\0II\0II\0II\0\33\33\0""99\0""9"
-  "9\0""99\0\20\20\0))\0))\0))\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17"
-  "\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0"
-  "\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\360\360\0\360\360\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\16\16"
-  "\0""33\0GG\0GG\0""00\0``\0\210\210\0\210\210\0TT\0\204\204\0\263\263\0\263"
-  "\263\0ee\0\222\222\0\315\315\0\312\312\0gg\0\216\216\0\331\331\0\327\327"
-  "\0cc\0\202\202\0\340\340\0\337\337\0YY\0qq\0\345\345\0\344\344\0NN\0^^\0"
-  "\352\352\0\352\352\0@@\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364"
-  "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375"
-  "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16"
-  "\16\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24"
-  "\24\0\24\24\0\22\22\0\24\24\0""88\0""88\0//\0BB\0pp\0pp\0UU\0ss\0\242\242"
-  "\0\242\242\0oo\0\230\230\0\306\306\0\306\306\0ww\0\265\265\0\335\335\0\335"
-  "\335\0ss\0\313\313\0\353\353\0\353\353\0ii\0\333\333\0\364\364\0\364\364"
-  "\0ZZ\0\351\351\0\371\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0""6"
-  "6\0\370\370\0\376\376\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16"
-  "\16\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376"
-  "\0\376\376\0\360\360\0\360\360\0\360\360\0\360\360\0\16\16\0\360\360\0\360"
-  "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\22\22\0\"\"\0""88\0"
-  """88\0//\0OO\0pp\0pp\0WW\0\203\203\0\242\242\0\242\242\0qq\0\256\256\0\312"
-  "\312\0\301\301\0||\0\313\313\0\342\342\0\325\325\0yy\0\336\336\0\360\360"
-  "\0\342\342\0mm\0\353\353\0\367\367\0\354\354\0\\\\\0\363\363\0\373\373\0"
-  "\362\362\0JJ\0\371\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373"
-  "\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376"
-  "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375"
-  "\0\360\360\0\374\374\0\360\360\0\376\376\0\16\16\0\360\360\0\360\360\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\22\22\0&&\0\"\"\0""88\0//\0PP\0HH\0gg\0NN"
-  "\0pp\0ee\0}}\0VV\0{{\0oo\0\202\202\0NN\0qq\0jj\0vv\0>>\0``\0\\\\\0cc\0,,"
-  "\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0"
-  "\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7"
-  "\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360"
-  "\360\0\376\376\0\376\376\0\16\16\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22"
-  "\0&&\0&&\0\"\"\0""66\0[[\0oo\0ee\0``\0\220\220\0\270\270\0\250\250\0xx\0"
-  "\250\250\0\327\327\0\311\311\0zz\0\246\246\0\341\341\0\325\325\0rr\0\230"
-  "\230\0\343\343\0\334\334\0gg\0\205\205\0\344\344\0\340\340\0[[\0rr\0\346"
-  "\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0"
-  """11\0""66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16"
-  "\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362\0\376"
-  "\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\22\22\0&&\0&&\0\37\37\0;;\0``\0``\0HH\0qq\0\237\237"
-  "\0\237\237\0nn\0\227\227\0\306\306\0\306\306\0}}\0\254\254\0\334\334\0\334"
-  "\334\0}}\0\275\275\0\347\347\0\347\347\0vv\0\316\316\0\357\357\0\357\357"
-  "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II"
-  "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\""
-  "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376"
-  "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360"
-  "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "&&\0&&\0##\0--\0``\0``\0TT\0cc\0\237\237\0\231\231\0||\0\223\223\0\306\306"
-  "\0\301\301\0\217\217\0\267\267\0\336\336\0\322\322\0\220\220\0\317\317\0"
-  "\352\352\0\334\334\0\202\202\0\337\337\0\362\362\0\345\345\0qq\0\353\353"
-  "\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371\371\0\375"
-  "\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376\376\0\376"
-  "\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376"
-  "\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0\376\376\0"
-  "\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "&&\0##\0""77\0--\0``\0PP\0nn\0[[\0\222\222\0kk\0\211\211\0qq\0\231\231\0"
-  "ff\0\210\210\0uu\0\217\217\0UU\0vv\0ll\0zz\0@@\0aa\0]]\0dd\0,,\0MM\0KK\0"
-  "OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0\33\33\0\33"
-  "\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2"
-  "\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\376"
-  "\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0##\0""77\0""77"
-  "\0--\0UU\0zz\0\216\216\0ww\0}}\0\254\254\0\324\324\0\264\264\0\207\207\0"
-  "\266\266\0\345\345\0\316\316\0\177\177\0\254\254\0\346\346\0\326\326\0rr"
-  "\0\231\231\0\344\344\0\334\334\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr"
-  "\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357"
-  "\357\0""11\0""66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0"
-  "\16\16\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362"
-  "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0""77\0--\0CC\0~~\0~~\0\\\\\0||\0"
-  "\274\274\0\274\274\0||\0\235\235\0\325\325\0\325\325\0\204\204\0\256\256"
-  "\0\340\340\0\340\340\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316"
-  "\0\360\360\0\360\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371"
-  "\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376"
-  "\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376"
-  "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0"
-  "\360\360\0\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0&&\0""77\0""22\0--\0``\0vv\0pp\0gg\0\243\243\0\255\255"
-  "\0\225\225\0\231\231\0\311\311\0\314\314\0\235\235\0\271\271\0\337\337\0"
-  "\326\326\0\224\224\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362"
-  "\362\0\345\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373"
-  "\0\362\362\0JJ\0\371\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0"
-  "\373\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376"
-  "\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0"
-  "\375\375\0\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376"
-  "\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222"
-  "\222\0kk\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm"
-  "\0zz\0@@\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0"
-  "))\0**\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0"
-  "\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16"
-  "\0\16\16\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203"
-  "\203\0\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317"
-  "\0\200\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334"
-  "\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0"
-  "\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364"
-  "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375"
-  "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16"
-  "\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22"
-  "\0""77\0""77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302"
-  "\302\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341"
-  "\341\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360"
-  "\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371"
-  "\0II\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0"
-  "\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376"
-  "\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0"
-  "\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235"
-  "\0\234\234\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0"
-  "\225\225\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345"
-  "\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362"
-  "\0JJ\0\371\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0"
-  "\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376"
-  "\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0"
-  "\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222\222\0kk"
-  "\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@"
-  "\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0"
-  "\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7"
-  "\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16"
-  "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203\203\0"
-  "\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200"
-  "\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg"
-  "\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352"
-  "\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364\364"
-  "\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0"
-  "\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16"
-  "\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0"
-  """77\0""77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302"
-  "\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341"
-  "\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360"
-  "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II"
-  "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\""
-  "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376"
-  "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360"
-  "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234"
-  "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0"
-  "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq"
-  "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371"
-  "\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376"
-  "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376"
-  "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0"
-  "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222"
-  "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0"
-  "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33"
-  "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7"
-  "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360"
-  "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0"
-  "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254"
-  "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206"
-  "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352"
-  "\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364\364\0\40\40"
-  "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376"
-  "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376"
-  "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0"
-  """77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||"
-  "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0"
-  "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360"
-  "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II"
-  "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\""
-  "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376"
-  "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360"
-  "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234"
-  "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0"
-  "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq"
-  "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371"
-  "\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376"
-  "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376"
-  "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0"
-  "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222"
-  "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0"
-  "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33"
-  "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7"
-  "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360"
-  "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0"
-  "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254"
-  "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206"
-  "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352"
-  "\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364\364\0\40\40"
-  "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376"
-  "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376"
-  "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0"
-  """77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||"
-  "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0"
-  "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360"
-  "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II"
-  "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\""
-  "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376"
-  "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360"
-  "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234"
-  "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0"
-  "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq"
-  "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371"
-  "\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376"
-  "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376"
-  "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0"
-  "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\213\213\0mm\0\237\237\0uu\0\275\275"
-  "\0\232\232\0\306\306\0\204\204\0\331\331\0\272\272\0\336\336\0\205\205\0"
-  "\345\345\0\320\320\0\352\352\0{{\0\355\355\0\337\337\0\362\362\0mm\0\363"
-  "\363\0\353\353\0\370\370\0\\\\\0\367\367\0\363\363\0\373\373\0II\0\373\373"
-  "\0\371\371\0\375\375\0""66\0\375\375\0\374\374\0\376\376\0\"\"\0\376\376"
-  "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376"
-  "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\375\375\0\375\375"
-  "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0##\0""77\0""77\0""99\0gg\0\205\205\0\205\205\0ww\0\224\224\0"
-  "\310\310\0\310\310\0\247\247\0\240\240\0\354\354\0\354\354\0\306\306\0\227"
-  "\227\0\372\372\0\372\372\0\325\325\0\205\205\0\375\375\0\375\375\0\342\342"
-  "\0rr\0\376\376\0\376\376\0\354\354\0^^\0\376\376\0\376\376\0\363\363\0JJ"
-  "\0\376\376\0\376\376\0\370\370\0""66\0\376\376\0\376\376\0\374\374\0\"\""
-  "\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376"
-  "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375"
-  "\0\376\376\0\376\376\0\376\376\0\362\362\0\376\376\0\376\376\0\376\376\0"
-  "\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0""77\0""11\0>>\0~~\0~~\0bb"
-  "\0__\0\261\261\0\261\261\0\212\212\0``\0\277\277\0\277\277\0\230\230\0SS"
-  "\0\275\275\0\275\275\0\233\233\0@@\0\273\273\0\273\273\0\240\240\0//\0\274"
-  "\274\0\274\274\0\252\252\0!!\0\301\301\0\301\301\0\266\266\0\25\25\0\311"
-  "\311\0\311\311\0\303\303\0\14\14\0\324\324\0\324\324\0\322\322\0\6\6\0\342"
-  "\342\0\342\342\0\341\341\0\1\1\0\361\361\0\361\361\0\361\361\0\15\15\0\15"
-  "\15\0\15\15\0\15\15\0\362\362\0\362\362\0\362\362\0\360\360\0\16\16\0\16"
-  "\16\0\16\16\0\2\2\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0&&\0""77\0""77\0\34\34\0SS\0kk\0\206\206\0BB\0\214\214\0\232\232"
-  "\0\302\302\0YY\0\250\250\0\255\255\0\340\340\0XX\0\264\264\0\264\264\0\355"
-  "\355\0SS\0\265\265\0\266\266\0\364\364\0JJ\0\270\270\0\272\272\0\371\371"
-  "\0AA\0\277\277\0\300\300\0\374\374\0""66\0\310\310\0\311\311\0\375\375\0"
-  "**\0\324\324\0\324\324\0\376\376\0\34\34\0\341\341\0\342\342\0\376\376\0"
-  "\15\15\0\361\361\0\361\361\0\376\376\0\361\361\0\15\15\0\15\15\0\376\376"
-  "\0\15\15\0\361\361\0\361\361\0\373\373\0\362\362\0\15\15\0\16\16\0\376\376"
-  "\0\16\16\0\361\361\0\376\376\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0&&\0&&\0""77\0))\0SS\0SS\0kk\0DD\0\205\205\0}}\0\222\222\0WW\0\241\241"
-  "\0\230\230\0\245\245\0XX\0\261\261\0\252\252\0\261\261\0SS\0\264\264\0\263"
-  "\263\0\265\265\0JJ\0\270\270\0\271\271\0\272\272\0AA\0\276\276\0\300\300"
-  "\0\300\300\0""66\0\310\310\0\311\311\0\311\311\0**\0\324\324\0\324\324\0"
-  "\324\324\0\34\34\0\341\341\0\342\342\0\342\342\0\15\15\0\361\361\0\361\361"
-  "\0\361\361\0\361\361\0\15\15\0\15\15\0\15\15\0\15\15\0\361\361\0\361\361"
-  "\0\361\361\0\362\362\0\15\15\0\16\16\0\16\16\0\16\16\0\361\361\0\376\376"
-  "\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0&&\0&&\0))\0pp\0cc\0cc"
-  "\0QQ\0\261\261\0\244\244\0\244\244\0ll\0\335\335\0\323\323\0\323\323\0ww"
-  "\0\364\364\0\356\356\0\356\356\0ss\0\370\370\0\371\371\0\371\371\0ii\0\372"
-  "\372\0\375\375\0\375\375\0YY\0\374\374\0\376\376\0\376\376\0HH\0\375\375"
-  "\0\376\376\0\376\376\0""66\0\376\376\0\376\376\0\376\376\0\"\"\0\376\376"
-  "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376"
-  "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376"
-  "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0"
-  "\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\40\40\0QQ\0pp\0pp\0KK"
-  "\0\215\215\0\261\261\0\261\261\0pp\0\274\274\0\337\337\0\337\337\0\200\200"
-  "\0\332\332\0\364\364\0\364\364\0}}\0\350\350\0\373\373\0\373\373\0oo\0\361"
-  "\361\0\375\375\0\375\375\0]]\0\367\367\0\376\376\0\376\376\0JJ\0\373\373"
-  "\0\376\376\0\376\376\0""66\0\375\375\0\376\376\0\376\376\0\"\"\0\376\376"
-  "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376"
-  "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376"
-  "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0"
-  "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\20\20\0""88\0WW\0pp\0"
-  "==\0ss\0\212\212\0\252\252\0dd\0\250\250\0\264\264\0\312\312\0rr\0\313\313"
-  "\0\315\315\0\331\331\0rr\0\340\340\0\331\331\0\340\340\0hh\0\355\355\0\341"
-  "\341\0\345\345\0YY\0\366\366\0\350\350\0\352\352\0HH\0\372\372\0\356\356"
-  "\0\357\357\0""66\0\375\375\0\364\364\0\364\364\0\"\"\0\376\376\0\371\371"
-  "\0\371\371\0\16\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361"
-  "\361\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\375\375\0"
-  "\376\376\0\375\375\0\374\374\0\360\360\0\376\376\0\376\376\0\360\360\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0&&\0\40\40\0""88\0""88\0WW\0BB\0ff"
-  "\0ZZ\0}}\0^^\0\226\226\0\201\201\0\241\241\0nn\0\301\301\0\246\246\0\277"
-  "\277\0rr\0\333\333\0\301\301\0\321\321\0ii\0\353\353\0\323\323\0\335\335"
-  "\0[[\0\365\365\0\341\341\0\346\346\0II\0\372\372\0\353\353\0\356\356\0""6"
-  "6\0\375\375\0\363\363\0\364\364\0\"\"\0\376\376\0\371\371\0\371\371\0\16"
-  "\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361\361\0\361\361"
-  "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\374\374\0\375\375\0\374"
-  "\374\0\374\374\0\361\361\0\376\376\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0""88\0""88\0BB\0~~\0ff\0ff\0"
-  "^^\0\256\256\0\226\226\0\226\226\0qq\0\325\325\0\277\277\0\277\277\0ss\0"
-  "\350\350\0\331\331\0\331\331\0jj\0\363\363\0\353\353\0\353\353\0[[\0\371"
-  "\371\0\365\365\0\365\365\0II\0\374\374\0\372\372\0\372\372\0""66\0\375\375"
-  "\0\375\375\0\375\375\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376"
-  "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0"
-  "\376\376\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\376"
-  "\376\0\361\361\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0HH\0""88\0BB\0~~\0~~\0ff\0^^\0\263"
-  "\263\0\263\263\0\231\231\0nn\0\330\330\0\330\330\0\274\274\0pp\0\353\353"
-  "\0\353\353\0\324\324\0hh\0\365\365\0\365\365\0\345\345\0ZZ\0\373\373\0\373"
-  "\373\0\361\361\0II\0\375\375\0\375\375\0\370\370\0""66\0\376\376\0\376\376"
-  "\0\374\374\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376"
-  "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0"
-  "\376\376\0\374\374\0\374\374\0\376\376\0\376\376\0\361\361\0\360\360\0\360"
-  "\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0"
-  "\0\0\0\0((\0HH\0\40\40\0\25\25\0QQ\0\207\207\0KK\0--\0}}\0\262\262\0bb\0"
-  """44\0\235\235\0\320\320\0ff\0""00\0\257\257\0\341\341\0cc\0))\0\272\272"
-  "\0\354\354\0ZZ\0\37\37\0\303\303\0\363\363\0OO\0\26\26\0\314\314\0\370\370"
-  "\0AA\0\15\15\0\326\326\0\373\373\0""22\0\6\6\0\343\343\0\375\375\0!!\0\1"
-  "\1\0\362\362\0\376\376\0\16\16\0\16\16\0\16\16\0\375\375\0\375\375\0\375"
-  "\375\0\376\376\0\362\362\0\360\360\0\361\361\0\376\376\0\14\14\0\0\0\0\0"
-  "\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24"
-  "\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0PP\0PP\0\10"
-  "\10\0\4\4\0dd\0dd\0\14\14\0\6\6\0xx\0xx\0\14\14\0\5\5\0\214\214\0\214\214"
-  "\0\13\13\0\4\4\0\240\240\0\240\240\0\10\10\0\2\2\0\264\264\0\264\264\0\5"
-  "\5\0\1\1\0\310\310\0\310\310\0\3\3\0\0\0\0\334\334\0\334\334\0\1\1\0\0\0"
-  "\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\1\1\0\0\0\0\0\0\0\14"
-  "\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0"
-  "\0<<\0<<\0\0\0\0\0\0\0XX\0XX\0\0\0\0\0\0\0pp\0pp\0\0\0\0\0\0\0\204\204\0"
-  "\204\204\0\0\0\0\0\0\0\227\227\0\227\227\0\0\0\0\0\0\0\250\250\0\250\250"
-  "\0\0\0\0\0\0\0\271\271\0\271\271\0\0\0\0\0\0\0\313\313\0\313\313\0\0\0\0"
-  "\0\0\0\335\335\0\335\335\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\1"
-  "\1\0\1\1\0\0\0\0\0\0\0\14\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0"
-  "\24\24\0\24\24\0\0\0\0((\0((\0((\0\0\0\0<<\0HH\0HH\0\10\10\0PP\0dd\0dd\0"
-  "\14\14\0dd\0||\0||\0\14\14\0xx\0\221\221\0\221\221\0\13\13\0\214\214\0\243"
-  "\243\0\243\243\0\10\10\0\240\240\0\264\264\0\264\264\0\5\5\0\264\264\0\303"
-  "\303\0\303\303\0\3\3\0\310\310\0\322\322\0\322\322\0\1\1\0\334\334\0\341"
-  "\341\0\341\341\0\0\0\0\360\360\0\361\361\0\361\361\0\1\1\0\0\0\0\14\14\0"
-  "\14\14\0\14\14\0\0\0\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0"
-  "\24\24\0\20\20\0\20\20\0""88\0""88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0"
-  "II\0\224\224\0\224\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302"
-  "\302\0HH\0HH\0\324\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0""00\0""00"
-  "\0\356\356\0\356\356\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16"
-  "\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0"
-  "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
-};
-
-/**
- * \brief Returns the BlitAlpha test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImageBlitAlpha()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imageBlitAlpha.pixel_data,
-        SDLTest_imageBlitAlpha.width,
-        SDLTest_imageBlitAlpha.height,
-        SDLTest_imageBlitAlpha.bytes_per_pixel * 8,
-        SDLTest_imageBlitAlpha.width * SDLTest_imageBlitAlpha.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
diff --git a/deps/SDL2/src/test/SDL_test_imageBlitBlend.c b/deps/SDL2/src/test/SDL_test_imageBlitBlend.c
deleted file mode 100644
index 06dbfab..0000000
--- a/deps/SDL2/src/test/SDL_test_imageBlitBlend.c
+++ /dev/null
@@ -1,2843 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-/* GIMP RGB C-Source image dump (alpha.c) */
-
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = {
-  80, 60, 3,
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310"
-  "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310"
-  "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0"
-  "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310"
-  "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310"
-  "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0"
-  "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310"
-  "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310"
-  "\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd"
-  "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0"
-  "\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310"
-  "\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0"
-  "dd\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0"
-  "dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd"
-  "\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310"
-  "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310"
-  "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310"
-  "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310"
-  "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310"
-  "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310"
-  "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310"
-  "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310"
-  "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310"
-  "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310"
-  "\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310"
-  "\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310"
-  "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310"
-  "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310"
-  "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\310\310"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\310\310\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310\310"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310"
-  "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310"
-  "\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0dd\0\310\310\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0"
-  "dd\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310"
-  "\0\377\377\0\377\377\0\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310"
-  "\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\310\310\0\310\310"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0\310\310\0dd"
-  "\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\377\377\0\310\310\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\310\310\0\377\377\0\377\377\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd"
-  "\0\0\0\0\0\0\0dd\0\377\377\0\310\310\0\310\310\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0dd\0\0"
-  "\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0"
-  "\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0"
-  "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0"
-  "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0"
-  "dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0"
-  "\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0"
-  "\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310"
-  "\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310"
-  "\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0"
-  "\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0"
-  "\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0\310\310\0\310"
-  "\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310"
-  "\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0"
-  "dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310"
-  "\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0"
-  "\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310"
-  "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310"
-  "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0"
-  "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310"
-  "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310"
-  "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0"
-  "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310"
-  "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
-};
-
-/**
- * \brief Returns the BlitBlendAdd test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImageBlitBlendAdd()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imageBlitBlendAdd.pixel_data,
-        SDLTest_imageBlitBlendAdd.width,
-        SDLTest_imageBlitBlendAdd.height,
-        SDLTest_imageBlitBlendAdd.bytes_per_pixel * 8,
-        SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
-
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = {
-  80, 60, 3,
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240"
-  "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0"
-  "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240"
-  "\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0"
-  "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240"
-  "\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240\0\240\240\0\240\240"
-  "\0aa\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww"
-  "\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305"
-  "\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305"
-  "\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305"
-  "\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305"
-  "\0\305\305\0\305\305\0\240\240\0\240\240\0\240\240\0\240\240\0dd\0dd\0dd"
-  "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240"
-  "\0\240\240\0\240\240\0aa\0\305\305\0\305\305\0\305\305\0ww\0\333\333\0\333"
-  "\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333"
-  "\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305"
-  "\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305"
-  "\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww"
-  "\0\333\333\0\333\333\0\305\305\0\305\305\0\305\305\0\305\305\0\240\240\0"
-  "\240\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0dd\0dd\0dd\0<<\0aa\0aa\0aa\0::\0HH\0HH\0HH\0++\0PP\0PP\0PP\0""00\0PP"
-  "\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP"
-  "\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP"
-  "\0PP\0PP\0PP\0HH\0HH\0HH\0HH\0aa\0aa\0aa\0aa\0dd\0dd\0dd\0dd\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0dd\0dd\0dd\0$$\0aa\0\305\305\0\305\305\0``\0\205\205\0\351\351\0"
-  "\351\351\0||\0\222\222\0\321\321\0\321\321\0\177\177\0\225\225\0\324\324"
-  "\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0"
-  "\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225"
-  "\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177"
-  "\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0"
-  "\177\177\0\225\225\0\324\324\0\321\321\0\222\222\0\222\222\0\321\321\0\314"
-  "\314\0\351\351\0\351\351\0\254\254\0\236\236\0\305\305\0\305\305\0aa\0<<"
-  "\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0dd\0\240\240\0\240\240\0aa\0\255\255"
-  "\0\322\322\0\322\322\0\177\177\0\315\315\0\343\343\0\343\343\0\211\211\0"
-  "\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211"
-  "\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346"
-  "\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0"
-  "\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346"
-  "\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\320\320"
-  "\0\327\327\0\327\327\0\322\322\0\276\276\0\322\322\0\322\322\0\305\305\0"
-  "yy\0\210\210\0\210\210\0dd\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0\210\210\0\240"
-  "\240\0\240\240\0aa\0\266\266\0\322\322\0\322\322\0\205\205\0\327\327\0\343"
-  "\343\0\343\343\0\215\215\0\346\346\0\357\357\0\331\331\0\222\222\0\347\347"
-  "\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0"
-  "\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222"
-  "\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331"
-  "\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0"
-  "\331\331\0\222\222\0\357\357\0\346\346\0\320\320\0\351\351\0\327\327\0\343"
-  "\343\0\276\276\0\333\333\0\322\322\0\266\266\0yy\0\240\240\0\210\210\0\240"
-  "\240\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0dd\0<<\0\240\240\0\210\210\0\240\240\0aa\0ww\0nn\0\177"
-  "\177\0MM\0SS\0OO\0SS\0""22\0WW\0TT\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0"
-  "XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0"
-  "XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0XX\0TT\0TT\0LL\0OO\0SS"
-  "\0SS\0ss\0\177\177\0nn\0nn\0yy\0\210\210\0\240\240\0\240\240\0<<\0dd\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<"
-  "\0\240\240\0\240\240\0\210\210\0HH\0\205\205\0\351\351\0\333\333\0pp\0\225"
-  "\225\0\371\371\0\363\363\0\202\202\0\231\231\0\330\330\0\325\325\0\203\203"
-  "\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0"
-  "\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324"
-  "\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331"
-  "\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0"
-  "\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\325\325\0\231\231\0\231"
-  "\231\0\330\330\0\323\323\0\371\371\0\371\371\0\274\274\0\257\257\0\351\351"
-  "\0\351\351\0\205\205\0``\0\240\240\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\240\240"
-  "\0\240\240\0RR\0\207\207\0\304\304\0\304\304\0nn\0\275\275\0\343\343\0\343"
-  "\343\0\205\205\0\324\324\0\352\352\0\352\352\0\214\214\0\316\316\0\352\352"
-  "\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0"
-  "\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316"
-  "\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213"
-  "\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0"
-  "\213\213\0\316\316\0\352\352\0\352\352\0\214\214\0\324\324\0\336\336\0\336"
-  "\336\0\331\331\0\310\310\0\343\343\0\343\343\0\325\325\0\217\217\0\254\254"
-  "\0\254\254\0\207\207\0aa\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0aa"
-  "\0\225\225\0\304\304\0\304\304\0\205\205\0\276\276\0\343\343\0\340\340\0"
-  "\222\222\0\333\333\0\352\352\0\351\351\0\226\226\0\347\347\0\362\362\0\333"
-  "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361"
-  "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0"
-  "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351"
-  "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230"
-  "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0"
-  "\366\366\0\336\336\0\351\351\0\304\304\0\351\351\0\343\343\0\304\304\0\217"
-  "\217\0\333\333\0\254\254\0\266\266\0aa\0\240\240\0\240\240\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa"
-  "\0\305\305\0\225\225\0\304\304\0ww\0\205\205\0ss\0\211\211\0RR\0VV\0PP\0"
-  "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211"
-  "\0ww\0||\0\217\217\0\254\254\0\266\266\0\305\305\0aa\0\240\240\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305"
-  "\305\0\305\305\0\225\225\0UU\0\222\222\0\366\366\0\340\340\0tt\0\231\231"
-  "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0"
-  "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203"
-  "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324"
-  "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0"
-  "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331"
-  "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231"
-  "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0"
-  "\366\366\0\222\222\0mm\0\266\266\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0"
-  "\305\305\0``\0\214\214\0\321\321\0\321\321\0rr\0\277\277\0\346\346\0\346"
-  "\346\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353"
-  "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0"
-  "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316"
-  "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213"
-  "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0"
-  "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337"
-  "\337\0\331\331\0\312\312\0\346\346\0\346\346\0\330\330\0\224\224\0\271\271"
-  "\0\271\271\0\217\217\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww"
-  "\0\225\225\0\304\304\0\314\314\0\222\222\0\277\277\0\343\343\0\342\342\0"
-  "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333"
-  "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361"
-  "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0"
-  "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351"
-  "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230"
-  "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0"
-  "\370\370\0\336\336\0\352\352\0\306\306\0\354\354\0\344\344\0\305\305\0\227"
-  "\227\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa"
-  "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0"
-  "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211"
-  "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305"
-  "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231"
-  "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0"
-  "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203"
-  "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324"
-  "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0"
-  "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331"
-  "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231"
-  "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0"
-  "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0"
-  "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347"
-  "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353"
-  "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0"
-  "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316"
-  "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213"
-  "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0"
-  "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337"
-  "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274"
-  "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww"
-  "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0"
-  "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333"
-  "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361"
-  "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0"
-  "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351"
-  "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230"
-  "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0"
-  "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231"
-  "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa"
-  "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0"
-  "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211"
-  "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305"
-  "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231"
-  "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0"
-  "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203"
-  "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324"
-  "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0"
-  "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331"
-  "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231"
-  "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0"
-  "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0"
-  "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347"
-  "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353"
-  "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0"
-  "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316"
-  "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213"
-  "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0"
-  "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337"
-  "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274"
-  "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww"
-  "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0"
-  "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333"
-  "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361"
-  "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0"
-  "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351"
-  "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230"
-  "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0"
-  "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231"
-  "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa"
-  "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0"
-  "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211"
-  "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305"
-  "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231"
-  "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0"
-  "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203"
-  "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324"
-  "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0"
-  "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331"
-  "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231"
-  "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0"
-  "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0"
-  "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347"
-  "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353"
-  "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0"
-  "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316"
-  "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213"
-  "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0"
-  "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337"
-  "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274"
-  "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww"
-  "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0"
-  "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333"
-  "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361"
-  "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0"
-  "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351"
-  "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230"
-  "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0"
-  "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231"
-  "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa"
-  "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0"
-  "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0"
-  "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211"
-  "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305"
-  "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231"
-  "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0"
-  "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203"
-  "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324"
-  "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0"
-  "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331"
-  "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231"
-  "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0"
-  "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0"
-  "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347"
-  "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353"
-  "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0"
-  "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316"
-  "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213"
-  "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0"
-  "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337"
-  "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274"
-  "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww"
-  "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0"
-  "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333"
-  "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361"
-  "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0"
-  "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351"
-  "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230"
-  "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0"
-  "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231"
-  "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa"
-  "\0\333\333\0\236\236\0\304\304\0ww\0\340\340\0\300\300\0\343\343\0\210\210"
-  "\0\354\354\0\333\333\0\352\352\0\215\215\0\361\361\0\350\350\0\362\362\0"
-  "\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361"
-  "\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351"
-  "\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0"
-  "\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351"
-  "\351\0\351\351\0\361\361\0\223\223\0\351\351\0\362\362\0\351\351\0\351\351"
-  "\0\323\323\0\336\336\0\351\351\0\351\351\0\304\304\0\343\343\0\305\305\0"
-  "\317\317\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305"
-  "\305\0\305\305\0\236\236\0\222\222\0\361\361\0\361\361\0\316\316\0\230\230"
-  "\0\373\373\0\373\373\0\344\344\0\231\231\0\375\375\0\375\375\0\357\357\0"
-  "\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347"
-  "\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375"
-  "\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0"
-  "\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375"
-  "\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\360\360\0\373\373"
-  "\0\375\375\0\375\375\0\347\347\0\367\367\0\373\373\0\373\373\0\326\326\0"
-  "\351\351\0\361\361\0\361\361\0\271\271\0\276\276\0\305\305\0\305\305\0aa"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0<<\0\305\305\0\305\305\0\236\236\0HH\0\271\271\0\271\271\0\224\224\0VV"
-  "\0\277\277\0\277\277\0\251\251\0DD\0\252\252\0\252\252\0\235\235\0FF\0\253"
-  "\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253"
-  "\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253"
-  "\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253"
-  "\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\235"
-  "\235\0rr\0uu\0uu\0^^\0\272\272\0\277\277\0\277\277\0\230\230\0\205\205\0"
-  "\222\222\0\222\222\0MM\0\266\266\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305"
-  "\305\0\305\305\0RR\0\236\236\0\254\254\0\361\361\0VV\0\267\267\0\263\263"
-  "\0\356\356\0ee\0\247\247\0\244\244\0\356\356\0^^\0\251\251\0\247\247\0\365"
-  "\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365"
-  "\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb"
-  "\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242"
-  "\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0\252\252\0ee"
-  "\0jj\0\345\345\0tt\0\246\246\0\251\251\0\321\321\0\272\272\0ff\0\222\222"
-  "\0\322\322\0ww\0\210\210\0\305\305\0\305\305\0\240\240\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240"
-  "\0\305\305\0``\0\236\236\0\236\236\0\254\254\0VV\0\264\264\0\254\254\0\261"
-  "\261\0dd\0\246\246\0\240\240\0\243\243\0^^\0\251\251\0\246\246\0\246\246"
-  "\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb"
-  "\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242"
-  "\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242"
-  "\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0\251\251\0dd\0hh"
-  "\0hh\0pp\0\243\243\0\240\240\0\236\236\0\264\264\0cc\0\177\177\0ww\0ww\0"
-  "\225\225\0\305\305\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0\240\240\0``"
-  "\0\351\351\0\333\333\0\333\333\0||\0\366\366\0\361\361\0\361\361\0\211\211"
-  "\0\373\373\0\371\371\0\371\371\0\221\221\0\375\375\0\374\374\0\374\374\0"
-  "\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374"
-  "\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374"
-  "\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0"
-  "\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365"
-  "\365\0\374\374\0\374\374\0\375\375\0\356\356\0\371\371\0\371\371\0\372\372"
-  "\0\340\340\0\361\361\0\361\361\0\364\364\0\307\307\0\333\333\0\333\333\0"
-  "\351\351\0\225\225\0\240\240\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240\240"
-  "\0aa\0\304\304\0\351\351\0\351\351\0\205\205\0\340\340\0\366\366\0\366\366"
-  "\0\222\222\0\355\355\0\373\373\0\373\373\0\227\227\0\364\364\0\375\375\0"
-  "\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375"
-  "\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360"
-  "\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0"
-  "\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230"
-  "\230\0\360\360\0\375\375\0\375\375\0\373\373\0\356\356\0\373\373\0\373\373"
-  "\0\367\367\0\340\340\0\364\364\0\364\364\0\354\354\0\304\304\0\351\351\0"
-  "\351\351\0\322\322\0\210\210\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240"
-  "\240\0<<\0\240\240\0\305\305\0\351\351\0ww\0\320\320\0\301\301\0\324\324"
-  "\0\211\211\0\345\345\0\316\316\0\324\324\0\217\217\0\356\356\0\323\323\0"
-  "\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323"
-  "\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354"
-  "\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0"
-  "\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223"
-  "\223\0\354\354\0\323\323\0\326\326\0\362\362\0\344\344\0\261\261\0\272\272"
-  "\0\364\364\0\340\340\0\225\225\0\205\205\0\340\340\0\276\276\0\351\351\0"
-  "\266\266\0\240\240\0dd\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\240\240\0aa\0\240"
-  "\240\0\240\240\0\305\305\0ww\0\305\305\0\240\240\0\266\266\0\205\205\0\333"
-  "\333\0\266\266\0\304\304\0\215\215\0\352\352\0\305\305\0\314\314\0\222\222"
-  "\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0"
-  "\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314"
-  "\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305"
-  "\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0"
-  "\305\305\0\314\314\0\361\361\0\335\335\0\242\242\0\236\236\0\333\333\0\312"
-  "\312\0ii\0aa\0\305\305\0\255\255\0\266\266\0\240\240\0\240\240\0\210\210"
-  "\0\240\240\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0aa\0\305\305\0\240\240\0\240\240\0ww\0\333"
-  "\333\0\305\305\0\305\305\0\205\205\0\351\351\0\333\333\0\333\333\0\217\217"
-  "\0\363\363\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0"
-  "\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351"
-  "\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351"
-  "\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0"
-  "\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\363\363\0\345"
-  "\345\0\333\333\0\333\333\0\340\340\0\312\312\0\305\305\0\305\305\0\322\322"
-  "\0\255\255\0\240\240\0\240\240\0\305\305\0\210\210\0dd\0dd\0dd\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd"
-  "\0dd\0dd\0aa\0\305\305\0\305\305\0\240\240\0ww\0\333\333\0\333\333\0\305"
-  "\305\0\205\205\0\355\355\0\355\355\0\336\336\0\215\215\0\364\364\0\364\364"
-  "\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0"
-  "\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364"
-  "\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215"
-  "\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0"
-  "\215\215\0\364\364\0\364\364\0\335\335\0\351\351\0\355\355\0\355\355\0\312"
-  "\312\0\305\305\0\322\322\0\322\322\0\255\255\0\240\240\0\305\305\0\305\305"
-  "\0\210\210\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0\305\305\0aa"
-  "\0""11\0\225\225\0\351\351\0\205\205\0HH\0\254\254\0\333\333\0ww\0BB\0\264"
-  "\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0"
-  "nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264"
-  "\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0"
-  "BB\0\264\264\0\340\340\0nn\0nn\0\205\205\0\314\314\0\266\266\0\304\304\0"
-  "\351\351\0\236\236\0yy\0\210\210\0\305\305\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0"
-  "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14"
-  "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14"
-  "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14"
-  "\0dd\0dd\0\25\25\0\25\25\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0"
-  "\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0"
-  "\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0"
-  "yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0"
-  "\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0"
-  "yy\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd"
-  "\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210"
-  "\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210"
-  "\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25"
-  "\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210"
-  "\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0$$\0\0\0\0<<\0<<\0<<\0\0"
-  "\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0"
-  "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240"
-  "\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240"
-  "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0"
-  "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0\240\240\0\240\240"
-  "\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
-};
-
-/**
- * \brief Returns the BlitBlend test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImageBlitBlend()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imageBlitBlend.pixel_data,
-        SDLTest_imageBlitBlend.width,
-        SDLTest_imageBlitBlend.height,
-        SDLTest_imageBlitBlend.bytes_per_pixel * 8,
-        SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
-
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = {
-  80, 60, 3,
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
-};
-
-/**
- * \brief Returns the BlitBlendMod test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImageBlitBlendMod()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imageBlitBlendMod.pixel_data,
-        SDLTest_imageBlitBlendMod.width,
-        SDLTest_imageBlitBlendMod.height,
-        SDLTest_imageBlitBlendMod.bytes_per_pixel * 8,
-        SDLTest_imageBlitBlendMod.width * SDLTest_imageBlitBlendMod.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
-
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = {
-  80, 60, 3,
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0"
-  "\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0"
-  "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377"
-  "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377"
-  "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377"
-  "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0"
-  "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377"
-  "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377",
-};
-
-/**
- * \brief Returns the BlitBlendNone test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImageBlitBlendNone()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imageBlitBlendNone.pixel_data,
-        SDLTest_imageBlitBlendNone.width,
-        SDLTest_imageBlitBlendNone.height,
-        SDLTest_imageBlitBlendNone.bytes_per_pixel * 8,
-        SDLTest_imageBlitBlendNone.width * SDLTest_imageBlitBlendNone.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
-
-const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = {
-  80, 60, 3,
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\0\0\0\0\0"
-  "\0\11\0\0\11\0\0\0\0\0\0\0\0\16\0\0\16\0\0\0\0\0\0\0\0\11\0\0\11\0\0\0\0"
-  "\0\0\0\0\14\0\0\14\0\0\0\0\0\0\0\0\17\0\0\17\0\0\0\0\0\0\0\0\21\0\0\21\0"
-  "\0\0\0\0\0\0\0K\0\0K\0\0\0\0\0\0\0\0T\0\0T\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0"
-  "\0\0\0\0g\0\0g\0\0\0\0\0\0\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317"
-  "\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11"
-  "\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\11\0\0\0\0\0\14\0\0\14"
-  "\0\0\14\0\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24"
-  "\0\0\24\0\0K\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0"
-  "\0g\0\0\0\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317"
-  "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11\0\0\0\0\0"
-  "\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\22\0\0\0\0\0\14\0\0\14\0\0\14\0"
-  "\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24\0\0\24"
-  "\0\0\24\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0\0g\0"
-  "\0\0\0\0q\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317"
-  "\0\0\317\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\10\0\0\10\0\0\10\0\0\0\0\0\15"
-  "\0\0\15\0\0\15\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0J\0\0J\0\0J\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\317"
-  "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1"
-  "\0\0\4\0\0\4\0\0\0\0\0\0\0\0\7\0\0\7\0\0\0\0\0\0\0\0&\0\0&\0\0\32\0\0\32"
-  "\0\0&\0\0&\0\0&\0\0&\0\0C\0\0C\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0\0\0\0\17\251"
-  "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\0\0\0\0"
-  "\0\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\6\2\0\6\2\0\0\1\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0"
-  "\17\0\0\0\0\0\4\0\0\11\0\0\11\0\0\0\0\6+\0\6+\0\0&\0\0\32\0\0&\0\0&\0\0&"
-  "\0\0&\0\0""5\0\0""5\0\2\210\0\0\0\0\0C\0\0|\0\0|\0\0\0\0\17\251\0\17\251"
-  "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251"
-  "\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1"
-  "\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\6\2\0\6\2\0\6\2\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1"
-  "\0\0\1\0\0\0\0\0\17\0\0\17\0\0\4\0\0\0\0\6+\0\6+\0\6+\0\0\32\0\0&\0\0&\0"
-  "\0&\0\0&\0\0""5\0\0""5\0\0""5\0\0\0\0\2\210\0\2\210\0\0C\0\0\0\0\17\251\0"
-  "\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0"
-  "\17\251\0\17\251\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "$\360\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0"
-  "\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\14\1\0\14\1\0\14\1"
-  "\0\14\1\0\15\1\0\15\1\0\0\0\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16"
-  "\2\0\0\0\0\0\0\0\14!\0\14!\0\14!\0\14!\0\17(\0\17(\0\0\0\0\0\0\0\14+\0\14"
-  "+\0\14+\0\14+\0\20""9\0\20""9\0\0\0\0\0\0\0\36\215\0\36\215\0\36\215\0\36"
-  "\215\0(\264\0(\264\0\0\0\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251"
-  "\0\36\251\0\36\251\0\36\251\0\0\0\0\0\0\0$\360\0$\360\0$\360\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3"
-  "\0\36\3\0\14\1\0\14\1\0\15\1\0\15\1\0\15\1\0\0\0\0\14\2\0\14\2\0\14\2\0\14"
-  "\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14\3\0\14!\0\14!\0\17(\0\17(\0\17"
-  "(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20""9\0\20""9\0\20""9\0\0\0\0\14""7\0\14"
-  """7\0\36\215\0\36\215\0(\264\0(\264\0(\264\0\0\0\0\36\251\0\36\251\0\36\251"
-  "\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0H\360\0"
-  "H\360\0\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3\0\36\3\0\36\3\0\14\1\0\15\1\0\15\1\0\15\1"
-  "\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14"
-  "\3\0\14\3\0\14!\0\17(\0\17(\0\17(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20""9\0"
-  "\20""9\0\20""9\0\0\0\0\14""7\0\14""7\0\14""7\0\36\215\0(\264\0(\264\0(\264"
-  "\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36"
-  "\251\0\36\251\0\36\251\0\36\251\0H\360\0H\360\0H\360\0\0\0\0$\360\0$\360"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\13\1\0\13\1\0\13\1\0\13\1\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\11!\0"
-  "\11!\0\11!\0\11!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\23n\0\23n\0\23n\0\23n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0H\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\1\0\1\1\0\0\0\0\0\0\0\0\0\0\0\0\0\25\0\0\25\0\0\25\0\0\27\0"
-  "\0\13\0\0\13\0\0\1\0\0\11\0\0\4\0\0\4\0\0\0\0\0\0\0\0\25\3\0\25\3\0\0\0\0"
-  "\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\3\1\0\3\1\0\2\1\0\7\5\0\7\3\0\7\3\0\0"
-  "\0\0\0\0\0\25""4\0\25""4\0\0\0\0\0\0\0\25""4\0\25""4\0\25""4\0\25""4\0\20"
-  "\35\0\20\35\0\11\22\0\23F\0\34""6\0\34""6\0\0\0\0\0\0\0L\317\0L\317\0L\317"
-  "\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0\0\0\0""2\317\0""2\317\0""2\317"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\0\0\0\0\0\0\0\0\0\25\0\0\25"
-  "\0\0\25\0\0\4\0\0\5\0\0\2\0\0\1\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7\0\37\7"
-  "\0\25\3\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\15\4\0\11\3\0\7"
-  "\3\0\14\10\0\14\10\0\0\0\0\25\16\0\25\16\0\25""4\0\0\0\0\25""4\0\25""4\0"
-  "\25""4\0\25""4\0&Q\0&Q\0&Q\0\31""5\0\34""6\0&j\0&j\0\0\0\0""5q\0""5q\0L\317"
-  "\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0""2"
-  "\317\0""2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\1\0\0\0\0\0\0\0\25\0"
-  "\0\25\0\0\25\0\0\31\1\0\5\0\0\5\0\0\2\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7"
-  "\0\37\7\0\37\7\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\37\6\0\11"
-  "\3\0\16\6\0\16\6\0\7\3\0\0\0\0\25\16\0\25\16\0\25\16\0\0\0\0\25""4\0\25""4"
-  "\0\25""4\0\25""4\0&Q\0&Q\0&Q\0\31""5\0+X\0+X\0\34""6\0\0\0\0""5q\0""5q\0"
-  """5q\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317"
-  "\0L\317\0\0\0\0""2\317\0""2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0"
-  "\0\0\0\0\25\0\0\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0L\317\0L\317\0L\317\0L\317"
-  "\0\0\0\0""2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0e\4\0e\4\0\0\0\0\0\0\0e\11\0e\11\0\0\0\0\0\0\0e\16\0e\16\0\0\0\0\0\0"
-  "\0G\11\0G\11\0\0\0\0\0\0\0G\14\0G\14\0\0\0\0\0\0\0G\17\0G\17\0\0\0\0\0\0"
-  "\0G\21\0G\21\0\0\0\0\0\0\0GK\0GK\0\0\0\0\0\0\0GT\0GT\0\0\0\0\0\0\0G^\0G^"
-  "\0\0\0\0\0\0\0Gg\0Gg\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317"
-  "\0e\317\0e\317\0\0\0\0\0\0\0L\317\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0e\4\0e\4\0e\4\0\0\0\0e\11\0e\11\0e\11\0\0\0"
-  "\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0G\11\0\0\0\0G\14\0G\14\0G\14\0\0\0"
-  "\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0\0G\24\0G\24\0GK\0\0\0\0"
-  "GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg\0\0\0\0Gq\0Gq\0e\317\0e\317"
-  "\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0\0\0\0L\317\0L"
-  "\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0e\4\0e\4\0e\4\0\0\0"
-  "\0e\11\0e\11\0e\11\0\0\0\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0e\22\0\0\0"
-  "\0G\14\0G\14\0G\14\0\0\0\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0"
-  "\0G\24\0G\24\0G\24\0\0\0\0GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg"
-  "\0\0\0\0Gq\0Gq\0Gq\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317"
-  "\0e\317\0e\317\0e\317\0\0\0\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0e\4\0e\4\0e\4\0\0\0\0b\10\0b\10\0b\10\0\0\0\0b\15\0b\15\0b\15\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0<\16\0<\16\0<\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0""2J\0""2J\0""2J\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e"
-  "\317\0\0\0\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0c\0\0c\0\0\0\0\0"
-  "`\0\0c\0\0c\0\0\2\0\0c\1\0i\0\0i\0\0\0\0\0\0\0\0e\0\0e\0\0\0\0\0\0\0\0{\1"
-  "\0{\1\0f\0\0f\0\0z\1\0z\1\0z\1\0z\1\0)\4\0)\4\0\0\0\0\0\0\0Q\7\0Q\7\0\0\0"
-  "\0\0\0\0{&\0{&\0W\32\0W\32\0z&\0z&\0z&\0z&\0IC\0IC\0\0\0\0\0\0\0X^\0X^\0"
-  "\0\0\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0"
-  "\261\251\0\261\251\0\0\0\0\0\0\0e\317\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\216\1\0c\0\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0k\1\0i\0\0"
-  "\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0{\1\0f\0\0z\1\0z\1\0z\1\0z\1"
-  "\0\221\1\0\221\1\0\221\17\0\0\0\0)\4\0c\11\0c\11\0\0\0\0\256+\0\256+\0{&"
-  "\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\243\210\0\0\0\0IC\0{|\0{|\0\0\0\0"
-  "\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261"
-  "\251\0\261\251\0\261\251\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0"
-  "k\1\0k\1\0\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0\256\2\0f\0\0z\1\0"
-  "z\1\0z\1\0z\1\0\221\1\0\221\1\0\221\1\0\0\0\0\221\17\0\221\17\0)\4\0\0\0"
-  "\0\256+\0\256+\0\256+\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\2415\0\0\0\0"
-  "\243\210\0\243\210\0IC\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261"
-  "\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\264\360"
-  "\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1"
-  "\0\211\1\0c\0\0\2\0\0c\0\0c\0\0k\0\0\12\0\0k\1\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\360\0\264\360"
-  "\0\264\360\0\264\360\0\0\0\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216\1"
-  "\0c\0\0\2\0\0c\0\0k\0\0q\0\0\20\0\0\0\0\0\0\0\0\322\1\0\322\1\0\322\1\0\322"
-  "\1\0\346\1\0\346\1\0\0\0\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0"
-  "\363\2\0\0\0\0\0\0\0\322!\0\322!\0\322!\0\322!\0\371(\0\371(\0\0\0\0\0\0"
-  "\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\0\0\0\0\0\0\325\215\0\325\215"
-  "\0\325\215\0\325\215\0\374\264\0\374\264\0\0\0\0\0\0\0\325\251\0\325\251"
-  "\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\0\0\0\0\0"
-  "\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216"
-  "\1\0c\0\0\2\0\0f\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\322\1\0\322\1\0\346"
-  "\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0\363\2"
-  "\0\363\2\0\0\0\0\322\3\0\322\3\0\322!\0\322!\0\371(\0\371(\0\371(\0\0\0\0"
-  "\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\3227\0\3227\0\325"
-  "\215\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0\325\251\0"
-  "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325"
-  "\251\0\330\360\0\330\360\0\0\0\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\216\1\0\216\1\0c\0\0\10\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\325"
-  "\3\0\322\1\0\346\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2"
-  "\0\363\2\0\363\2\0\363\2\0\0\0\0\322\3\0\322\3\0\322\3\0\322!\0\371(\0\371"
-  "(\0\371(\0\0\0\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\322"
-  "7\0\3227\0\3227\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0"
-  "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325"
-  "\251\0\325\251\0\325\251\0\330\360\0\330\360\0\330\360\0\0\0\0\264\360\0"
-  "\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0i\0\0\10\0\0m\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\275\1\0\275\1\0\275\1\0"
-  "\275\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\244!\0\244!\0\244!\0\244!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\213n\0\213n\0\213n\0\213n\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0\330"
-  "\360\0\0\0\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\224\1\0i\0\0\10\0"
-  "\0\0\0\0\0\0\0\325\3\0\325\3\0\325\3\0\351\3\0\365\1\0\365\1\0\14\0\0\313"
-  "\2\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37"
-  "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0\304-\0Y!\0Y!\0\0\0\0\0\0\0\371p\0"
-  "\371p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0""3(\0\247\227\0\211"
-  "s\0\211s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\224\1\0i\0\0\0\0\0\0\0\0\325\3\0\325"
-  "\3\0\325\3\0\17\2\0\"\2\0!\0\0\35\0\0#\2\0\342\4\0\342\4\0\0\0\0\371\37\0"
-  "\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775"
-  "\0\374%\0\304\34\0Y!\0\373C\0\373C\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371"
-  "p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\211s\0\375"
-  "\342\0\375\342\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0"
-  "\0\0\330\360\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\224\1\0\0\0"
-  "\0\0\0\0\325\3\0\325\3\0\325\3\0\344\5\0\"\2\0\"\2\0\200\0\0#\2\0\342\4\0"
-  "\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37"
-  "\0\371\37\0\3775\0\3775\0\3775\0\304\34\0\3732\0\3732\0Y!\0\0\0\0\371p\0"
-  "\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377"
-  "\256\0\247q\0\375\274\0\375\274\0\211s\0\0\0\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330\360\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\12\0\0\0\0\0i\0\0\0\0\0\325\3\0\325\3\0\344\5\0\344\5"
-  "\0\"\2\0\36\1\0""4\2\0#\2\0\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0"
-  "\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\3732\0"
-  "\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371"
-  "p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0"
-  "\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\0\0\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0"
-  "\10\0\0\0\0\0\325\3\0\344\5\0\344\5\0\344\5\0\340\4\0\367\11\0\364\3\0#\2"
-  "\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371"
-  "\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\3732\0\3732\0\0\0\0\371p\0\371p"
-  "\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0"
-  "\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\10\0\0\0\0\0\0\0\0\17\2\0\17"
-  "\2\0\17\2\0\323\2\0\352\7\0\347\2\0\26\1\0\0\0\0\371\37\0\371\37\0\371\37"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0\0\0\0""7\36\0""6\25\0"
-  """6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0"
-  "O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\12\0"
-  "\0\10\0\0\0\0\0\17\2\0\17\2\0\344\5\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0"
-  "\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\362\4\0\0\0\0/\26\0/\26\0"
-  "\3775\0$\21\0""7\36\0""7\36\0\3672\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0"
-  "\0\0\0\0\370A\0\0\0\0O>\0O>\0\377\256\0""3(\0VK\0VK\0\372\264\0\0\0\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\341\271\0\0\0\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\343\350\0\0\0\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\10\0\0\0\0"
-  "\0\17\2\0\17\2\0\17\2\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0\0\371\37\0\371"
-  "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0$\21\0""7\36"
-  "\0""7\36\0""6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0O>\0O>\0O>\0""3(\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\5\0\0\5\0\0\5\0\0\0\0\0\344\5\0\344\5\0\344\5\0\316\4\0\367"
-  "\11\0\367\11\0\364\3\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371"
-  "\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0"
-  "\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377"
-  "\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5"
-  "\0\0\5\0\0\5\0\0\17\2\0\344\5\0\344\5\0\316\4\0\345\11\0\367\11\0\364\3\0"
-  "\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37"
-  "\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371"
-  "p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q"
-  "\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\0\0\0\17\2"
-  "\0\344\5\0\344\5\0\15\1\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37\0\371\37\0"
-  "\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0\307)\0\376"
-  "G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0"
-  "\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0"
-  "\5\0\0\17\2\0\17\2\0\344\5\0\316\4\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37"
-  "\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0"
-  "\307)\0\376G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371"
-  "p\0\371p\0\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\5\0\0\24\2\0\17\2\0\17\2\0\316\4\0\345\11\0$\6\0#\2\0\0\0\0\371"
-  "\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0"
-  "\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0"
-  "\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274"
-  "\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0"
-  "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\24\2\0\24"
-  "\2\0\17\2\0\316\4\0\345\11\0\342\3\0#\2\0\0\0\0\371\37\0\371\37\0\371\37"
-  "\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0"
-  "\376G\0\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371"
-  "p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274"
-  "\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\24\2\0\5\0\0\0\0\0\27\5\0\342\3\0\313"
-  "\1\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\371\37\0\0\0\0\0\0\0/\26\0"
-  "\3775\0\371\37\0\302\30\0\3716\0Y!\0#\14\0\0\0\0\371p\0\371p\0\0\0\0\0\0"
-  "\0\0\0\0\371p\0\0\0\0\0\0\0O>\0\377\256\0\371p\0\243I\0\371\224\0\211s\0"
-  """3(\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374"
-  "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0"
-  "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0\0\371"
-  "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0\0\0\0"
-  "\0""6\25\0""6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374"
-  "\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0"
-  "\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0"
-  "\0\0\0\0""6\25\0""6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0"
-  "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\16\0\0\0\0\0\26\1\0\26\1\0\26"
-  "\1\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0"
-  "/\26\0.\17\0\0\0\0""6\25\0""6\25\0""6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0"
-  "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360"
-  "\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\14\0\0\14"
-  "\0\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37"
-  "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0#\14\0Y!\0Y!\0\0\0\0\0\0\0\371p\0\371"
-  "p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0""3(\0""3(\0\211s\0\211"
-  "s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360"
-  "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
-};
-
-/**
- * \brief Returns the BlitBlendAll test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImageBlitBlendAll()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imageBlitBlendAll.pixel_data,
-        SDLTest_imageBlitBlendAll.width,
-        SDLTest_imageBlitBlendAll.height,
-        SDLTest_imageBlitBlendAll.bytes_per_pixel * 8,
-        SDLTest_imageBlitBlendAll.width * SDLTest_imageBlitBlendAll.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
diff --git a/deps/SDL2/src/test/SDL_test_imageFace.c b/deps/SDL2/src/test/SDL_test_imageFace.c
deleted file mode 100644
index 46c117a..0000000
--- a/deps/SDL2/src/test/SDL_test_imageFace.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-/* GIMP RGBA C-Source image dump (face.c) */
-
-const SDLTest_SurfaceImage_t SDLTest_imageFace = {
-  32, 32, 4,
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0"
-  "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
-  "\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377"
-  "\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0"
-  "\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0"
-  "\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0"
-  "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0"
-  "\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377"
-  "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0"
-  "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
-  "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
-  "\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377"
-  "\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
-  "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0"
-  "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
-  "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
-  "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
-  "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
-  "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
-  "\377\377\0\377\377\377\0",
-};
-
-/**
- * \brief Returns the Face test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImageFace()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imageFace.pixel_data,
-        SDLTest_imageFace.width,
-        SDLTest_imageFace.height,
-        SDLTest_imageFace.bytes_per_pixel * 8,
-        SDLTest_imageFace.width * SDLTest_imageFace.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
-
diff --git a/deps/SDL2/src/test/SDL_test_imagePrimitives.c b/deps/SDL2/src/test/SDL_test_imagePrimitives.c
deleted file mode 100644
index 93b99d6..0000000
--- a/deps/SDL2/src/test/SDL_test_imagePrimitives.c
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-/* GIMP RGB C-Source image dump (primitives.c) */
-
-const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = {
-  80, 60, 3,
-  "\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15"
-  "I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310"
-  "\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0"
-  "\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0"
-  "\0\5ii\0\0\0\5ii\0\0\0\3\1\1\0\0\0\5\2\1\0\0\0\7\3\2\0\0\0\11\4\3\0\0\0\13"
-  "\5\3\0\0\0\15\6\4\0\0\0\17\7\5\0\0\0\21\10\5\0\0\0\23\11\6\0\0\0\25\12\7"
-  "\0\0\0\27\13\7\0\0\0\31\14\10\0\0\0\33\15\11\0\0\0\35\16\11\0\0\0\37\17\12"
-  "\0\0\0!\20\13\0\0\0#\21\13\0\0\0%\22\14\0\0\0'\23\15\15I\310)\24\15\15I\310"
-  "+\25\16\15I\310-\26\17\15I\310/\27\17\15I\3101\30\20\15I\3103\31\21\15I\310"
-  "5\32\21\15I\3107\33\22\15I\3109\34\23\15I\310;\35\23\15I\310=\36\24\15I\310"
-  "?\37\25\15I\310A\40\25\15I\310C!\26\15I\310E\"\27\15I\310G#\27\15I\310I$"
-  "\30\15I\310K%\31\15I\310M&\31\5iiO'\32\0\0\0\0\0\0\5ii\0\0\0\10\4\2\0\0\0"
-  "\14\6\4\0\0\0\20\10\5\0\0\0\24\12\6\0\0\0\30\14\10\0\0\0\34\16\11\0\0\0\40"
-  "\20\12\0\0\0$\22\14\0\0\0(\24\15\0\0\0,\26\16\0\0\0""0\30\20\0\0\0""4\32"
-  "\21\0\0\0""8\34\22\0\0\0<\36\24\0\0\0@\40\25\0\0\0D\"\26\0\0\0H$\30\0\0\0"
-  "L&\31\0\0\0P(\32\15I\310T*\34\15I\310X,\35\15I\310\\.\36\15I\310`0\40\15"
-  "I\310d2!\15I\310h4\"\15I\310l6$\15I\310p8%\15I\310t:&\15I\310x<(\15I\310"
-  "|>)\15I\310\200@*\15I\310\204B,\15I\310\210D-\15I\310\214F.\15I\310\220H"
-  "0\15I\310\224J1\15I\310\230L2\5ii\234N4\15I\310\0\0\0\0\0\0\0\0\0\5ii\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii"
-  "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d"
-  "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\5ii\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\5ii\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d"
-  "\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\5ii\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310"
-  "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d"
-  "\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d"
-  "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5"
-  "ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d"
-  "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d"
-  "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0"
-  "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0"
-  "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0"
-  "\0\377\0\0\377\0\0\377\0\0\377\0\5ii\0\377\0\0\377\0\0\377\0\0\377\0\0\377"
-  "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0""77\5\0\377\0\0\377\0\0\377\0"
-  "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\5ii\0\377\0\0\377\0\0\377"
-  "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377"
-  "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377"
-  "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5"
-  "ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d"
-  "\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5i"
-  "i\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310"
-  "\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\5ii\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310"
-  "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\5ii\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\5ii\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15"
-  "I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d7"
-  "7\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0"
-  "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310"
-  "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310"
-  "\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5"
-  "ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310"
-  "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\0\0\0\0"
-  "\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\5ii\15I\310\15I\310\15I\310\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii"
-  "\15I\310\15I\310\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\5ii\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-  "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I"
-  "\310\15I\310\15I\310\15I\310\15I\310\5ii",
-};
-
-/**
- * \brief Returns the Primitives test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImagePrimitives()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imagePrimitives.pixel_data,
-        SDLTest_imagePrimitives.width,
-        SDLTest_imagePrimitives.height,
-        SDLTest_imagePrimitives.bytes_per_pixel * 8,
-        SDLTest_imagePrimitives.width * SDLTest_imagePrimitives.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
diff --git a/deps/SDL2/src/test/SDL_test_imagePrimitivesBlend.c b/deps/SDL2/src/test/SDL_test_imagePrimitivesBlend.c
deleted file mode 100644
index ce9adc5..0000000
--- a/deps/SDL2/src/test/SDL_test_imagePrimitivesBlend.c
+++ /dev/null
@@ -1,694 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-/* GIMP RGB C-Source image dump (alpha.c) */
-
-const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = {
-  80, 60, 3,
-  "\260e\15\222\356/\37\313\15\36\330\17K\3745D\3471\0\20\0D\3502D\3502<\321"
-  ",\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0-\0\377\377"
-  "\377\377\377\377\311\324\311\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\0H\0\377\377\377\377\377\377\256\307\256\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\0c\0\377\377\377\377\377\377"
-  "\223\300\223\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\0~\0\377\377\377\377\377\377x\277x\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\0\231\0\377\377\377\377\377\377]\303]\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\0\264\0\377\377\377\377\377"
-  "\377B\316B\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0"
-  "\317\0\377\377\377\377\377\377'\335'\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\0\352\0\377\377\377#\262\6\260d\15\260e\15\224\357"
-  "/&\262\6\34\300\5.\314\22\40\315\12[\3747M\332/\27\331\12\27\331\12K\374"
-  "5K\3745K\3745D\3471D\3471D\3471D\3471D\3471D\3502D\3502D\3502D\3502D\350"
-  "2D\3502D\3502D\3502D\3502D\3502\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377,\372\27\273\3465\327"
-  "Q.\260d\15\213\213\40\241\3601\200\366*=\265\13?\301\25s\375<Y\316-X\320"
-  "-!\315\13]\3749]\3749O\3321O\3321P\3342P\3342P\3342\371\377\364\371\377\364"
-  "\371\377\364\371\377\364\371\377\364\362\375\360\362\375\360\362\375\360"
-  "\362\375\360\362\375\360D\3471D\3471D\3471D\3502D\3502D\3502D\3502D\3502"
-  "D\3502D\3502D\3502D\3502D\3502D\3502D\3502D\3502D\3502D\3502D\3502D\3502"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "K\3745&\262\6\213\213\40\11\2\0\260`\15\241~#m}\11\273\363AQ\247\15S\266"
-  "\31\212\373 at e\302,\4\33\2s\375<\\\3161M\260*\\\3202X\320-\366\377\354\364"
-  "\377\352O\3321\3""5\2O\3321O\3321<\261&P\3342P\3342S\3655\377\377\377\377"
-  "\377\377\14Z\14\377\377\377\377\377\377\234\302\231\371\377\364\362\375\360"
-  "\367\377\365\362\375\360\362\375\360\13t\13\362\375\360\362\375\360\177\275"
-  "~\362\375\360\362\375\360\370\377\366\362\375\360\377\377\377\14\220\14\377"
-  "\377\377D\3502\"\267\33D\3502D\3502K\3779D\3502D\3502\3\233\2D\3502D\350"
-  "2\34\303\26D\3502D\3502L\377:D\3502D\3502\3\264\2D\3502D\3502\25\323\22\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\14\341\14\377\377"
-  "\377\377\377\377\40\353\40\377\377\377D\3471\34\300\5e\247\33\356\336?\277"
-  "f)\260P\17\260i\16\356\336?\331\353C\274\363GQ\247\15\243\370Cp\270)\212"
-  "\373 at h\3021h\3042c\304+\364\377\336\\\3161\\\3161\\\3202\\\3202\\\3202\377"
-  "\377\377\364\377\352\364\377\352\346\371\342\346\371\342O\3321O\3321P\334"
-  "2P\3342P\3342P\3342P\3342P\3342\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\362\375\360\362\375\360\362\375\360\362\375\360\362\375"
-  "\360\362\375\360\362\375\360\362\375\360\362\375\360\362\375\360\362\375"
-  "\360\362\375\360\362\375\360\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377D\3502D\3502D\3502D\3502D\3502D\3502D\3502D\3502D\3502D\3502D\3502\40"
-  "\315\12=\265\13f\230\14\237y\15\274Y\17\327Q.\260X\14\243\177$\220\214\""
-  "\215\235*\274\363G\177\252+\243\370Cu\2661p\270)\367\377\324h\3021h\3021"
-  "h\3042\364\377\336\364\377\336\335\364\323\\\3161\\\3161\\\3202\\\3202\\"
-  "\3202\377\377\377\377\377\377\364\377\352\364\377\352\346\371\342\346\371"
-  "\342\346\371\342\346\371\342O\3321P\3342P\3342P\3342P\3342P\3342P\3342P\334"
-  "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\362\375\360\362\375\360"
-  "\362\375\360\362\375\360\362\375\360\362\375\360\362\375\360\362\375\360"
-  "\362\375\360\362\375\360\362\375\360\362\375\360\362\375\360\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\6\0\4[\3747?\301\25N\241\14\331\353C\243\177$\275Z\21\377\254W\260Q\17\30"
-  "\26\7\370\343N\201\210\16|\213-\274\363G\200\2521\202\263+\243\370Cu\266"
-  "1\12&\4\367\377\324h\3021S\241)h\3042h\3042\377\377\377\364\377\336\335\364"
-  "\323\24M\23\\\3161\\\3202C\245(\\\3202\\\3202\377\377\377\377\377\377\377"
-  "\377\377\30l\30\346\371\342\346\371\342\207\273\205\346\371\342\346\371\342"
-  "\361\377\355\377\377\377P\3342\7t\4P\3342P\3342/\260\"P\3342P\3342^\377@"
-  "\377\377\377\377\377\377\30\242\30\377\377\377\377\377\377d\306d\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\30\275\30\377\377\377"
-  "\377\377\377K\322K\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\30\330\30\362\375\360\362\375\3601\3431\362\375\360\362\375\360\377"
-  "\377\377\362\375\360D\3502M\332/s\375<>\265\14\177\252+\201\210\16\245\204"
-  "*\377\314U\312\\,\224'\11\260i\17\244\210\40\232\2211\331\353J\215\2351\377"
-  "\377\276\200\2521\200\2542\375\377\310u\2661t\2702t\2702\367\377\324\325"
-  "\355\305h\3021h\3042h\3042\377\377\377\377\377\377\364\377\336\335\364\323"
-  "\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346"
-  "\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377"
-  "\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\3342\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\27\331\12Y\316-h\3021\243\370Cg\230\15\230\224\"\245"
-  "\204*\377\314U\310J\21\327Q.\260b\21\245\2041\370\343N\230\2242\331\353J"
-  "\214\2402\377\377\276\200\2521\200\2542\375\377\310\317\344\266u\2661t\270"
-  "2\377\377\377\367\377\324\325\355\305h\3021h\3042h\3042h\3042\377\377\377"
-  "\377\377\377\364\377\336\335\364\323\335\364\323\335\364\323\335\364\323"
-  "\\\3202\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371"
-  "\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377\377"
-  "\377\377\377\377\377\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\334"
-  "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377K\3745!\315\13d\304,p\270)\177\252+\23\13\6\232\2211\245\204"
-  "1\347\270O\377\277Y\324<\22\265V\24\377\330Q\244\210\40#(\13\230\224\"\331"
-  "\353Ju\211.\377\377\276\200\2521\210\273:\200\2542\375\377\310\20""3\6u\266"
-  "1t\2702\271\307\271\367\377\324\325\355\305\341\377\321h\3021h\3042\16L\7"
-  "h\3042\377\377\377\242\300\242\377\377\377\335\364\323\355\377\343\335\364"
-  "\323\335\364\323\14f\7\\\3202\\\3202>\250*\\\3202\377\377\377\377\377\377"
-  "\377\377\377\377\377\377$\231$\377\377\377\377\377\377s\303s\377\377\377"
-  "\346\371\342\376\377\372\346\371\342\346\371\342\40\257\37\346\371\342\346"
-  "\371\342\\\316\\\377\377\377\377\377\377\377\377\377\377\377\377P\3342\13"
-  "\262\7P\3342P\3342*\327%P\3342P\3342o\377Q\377\377\377\377\377\377$\352$"
-  "\377\377\377\377\377\377K\3745]\3749s\375<\212\373@\243\370C\274\363G\331"
-  "\353J\370\343N\377\330Q\377\314U\377\277Y\377\260\\\224(\11\260|\36\245\204"
-  "1\377\377\250\232\2211\230\224\"\215\2351\214\2402\377\377\276\312\332\250"
-  "\200\2521\200\2542\377\377\377\317\344\266u\2661t\2702t\2702\377\377\377"
-  "\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\3042h\3042\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364\323\335\364"
-  "\323\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342"
-  "\346\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377P\3342P\3342"
-  "P\3342P\3342\377\377\377K\3745O\3321\\\3161h\3021t\2702~\254'\214\240%\377"
-  "\377\262\370\343N\377\330Q\262x1\277l1\312`1\327R.\260X\23\377\330Q\244\210"
-  "2\377\377\250\230\2242\377\377\262\215\2351\214\2402\377\377\377\312\332"
-  "\250\200\2521\200\2542\377\377\377\375\377\310\317\344\266u\2661t\2702t\270"
-  "2\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\304"
-  "2h\3042h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\\\3202\\\320"
-  "2\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346\371\342\346"
-  "\371\342\346\371\342\346\371\342\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377D\3471O\3321\21\7\11c\304+\367\377\324o\2520\200\252"
-  "1\214\2402\235\226'\377\377\250\377\330Q!\20\11\277l1\310d2\266?\33\224("
-  "\11\260|\36\257\217;\377\377\250\232\2211\34$\11\377\377\262\215\2351q\206"
-  "0\377\377\377\312\332\250\217\303@\200\2542\200\25420Z0\317\344\266\317\344"
-  "\266X\2260t\2702t\2702\377\377\377\377\377\377\325\355\305(l%\325\355\305"
-  "\325\355\305K\2410h\3042h\3042\377\377\377\377\377\377\377\377\3770\2200"
-  "\377\377\377\377\377\377t\274p\335\364\323\335\364\323\373\377\361\377\377"
-  "\377\377\377\377\21\213\11\\\3202\\\3202<\274/\\\3202\377\377\377\377\377"
-  "\377\377\377\377\377\377\3770\3060\377\377\377\377\377\377V\330V\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\3770\3410\346\371\342\346"
-  "\371\342>\352>\346\371\342\377\377\377D\3471P\3342\364\377\352s\375<h\302"
-  "1t\2702~\254'\377\377\276\215\2351\230\2242\244\210\40\377\377\234\262x1"
-  "\277l1\310W\32\377\260\\\327T1\260|2\377\330Q\244\2102\377\377\250\232\221"
-  "1\230\2242\377\377\262\215\2351\214\2402\377\377\377\377\377\276\312\332"
-  "\250\200\2542\200\2542\377\377\377\375\377\310\317\344\266\317\344\266t\270"
-  "2t\2702t\2702\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305"
-  "\325\355\305h\3042h\3042h\3042h\3042\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\335\364\323\335\364\323\335\364\323"
-  "\335\364\323\335\364\323\377\377\377\377\377\377\\\3202\\\3202\\\3202\\\320"
-  "2\\\3202\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377D\3471P\3342\364\377\352\\\3161h\3042\367"
-  "\377\324u\2661\200\2542\214\240%\377\377\262\232\2211\244\2102\377\377\234"
-  "\262x1\274p2\377\337\207\377\260\\\327T1\227/\14\377\377\234\245\2041\244"
-  "\2102\307\300\213\230\2242\377\377\377\377\377\262\215\2351\214\2402\377"
-  "\377\377\377\377\276\312\332\250\200\2542\200\2542\377\377\377\377\377\377"
-  "\317\344\266\317\344\266\317\344\266t\2702t\2702\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\377\377\377"
-  "h\3042h\3042h\3042h\3042\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\335\364\323\335\364\323\335\364\323"
-  "\335\364\323\377\377\377\377\377\377\377\377\377\\\3202\\\3202\\\3202\\\320"
-  "2\\\3202\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377<\0<D\3502\371\377\364N\3221\\\3202\364\377"
-  "\336l\3035t\2702\375\377\310\36\22\13\214\2402\377\377\262\214\2012\244\210"
-  "2\377\377\234\274\177;\274p2\377\337\207/\24\13\324X2\227/\14\222l3\307\260"
-  "|\244\2102\377\377\270\232\2211\230\2242<Q<\310\316\231\215\2351o\2065\377"
-  "\377\377\377\377\276\341\377\277\200\2521\200\2542\36H\13\377\377\377\377"
-  "\377\377\213\260}\317\344\266t\2702\221\366Ot\2702\377\377\377<\207<\377"
-  "\377\377\377\377\377}\270v\325\355\305\325\355\305\371\377\351\377\377\377"
-  "h\3042\30|\13h\3042\377\377\377|\306|\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377<\275<\335\364\323\335\364\323_\317]\335\364\323"
-  "\335\364\323\377\377\377\377\377\377\377\377\377\25\260\13\\\3202\\\3202"
-  ">\3369\\\3202\377\377\377\377\377\377\377\377\377\377\377\377D\3502\371\377"
-  "\364O\3321\\\3202\364\377\336h\3042\367\377\324u\2661\200\2542\377\377\276"
-  "\215\2351\230\2242\307\300\213\244\2102\377\377\234\262x1\274p2\377\337\207"
-  "\312`1\324E\30\327T1\260|2\377\377\234\245\2041\244\2102\377\377\250\232"
-  "\2211\230\2242\377\377\377\310\316\231\215\2351\214\2402\377\377\377\377"
-  "\377\377\312\332\250\312\332\250\200\2542\200\2542\377\377\377\377\377\377"
-  "\317\344\266\317\344\266\317\344\266t\2702t\2702t\2702\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355"
-  "\305\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\\\3202\\\3202\\\3202\377\377\377D\3502\371\377"
-  "\364O\3321\377\377\377\\\3161h\3042\367\377\324t\2702\375\377\310\200\252"
-  "1\377\377\377\215\2351\230\2242\377\377\250\244\2102\377\377\234\262x1\274"
-  "p2\316\214_\310d2\377\310|\327T1\227/\14\377\377\377\307\260|\244\2102\377"
-  "\377\377\307\300\213\230\2242\230\2242\377\377\377\310\316\231\214\2402\214"
-  "\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\2542\377"
-  "\377\377\377\377\377\377\377\377\317\344\266\317\344\266\317\344\266t\270"
-  "2t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377h\3042h\3042"
-  "h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364"
-  "\323\335\364\323\335\364\323\377\377\377\377\377\377\377\377\377\377\377"
-  "\377D\3502\371\377\364R\3344\364\377\352\\\3161H\22Hh\3021\377\377\377o\244"
-  "2\200\2542\312\332\250\226\245<\377\377\262\230\2242H-/\245\2041\377\377"
-  "\377\233i5\274p2\277l1\331sC\377\310|\324X2*\15\3\260|2\377\377\234\206s"
-  "7\244\2102\377\377\250\340\337\244\230\2242\377\377\377Hc2\310\316\231\214"
-  "\2402n\211:\377\377\377\377\377\377\353\377\311\312\332\250\200\2542$T\16"
-  "\377\377\377\377\377\377\236\277\236\377\377\377\317\344\266\367\377\336"
-  "\377\377\377t\2702\40n\16t\2702\377\377\377\212\303\212\377\377\377\377\377"
-  "\377\377\377\377\325\355\305\325\355\305<\2477\377\377\377\377\377\377O\276"
-  "Ah\3042h\3042\237\377i\377\377\377\377\377\377H\317H\377\377\377\377\377"
-  "\377c\335c\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323>\337"
-  ";\335\364\323\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\364"
-  "\377\336h\3042\367\377\324t\2702\375\377\310\200\2542\377\377\276\214\240"
-  "2\377\377\262\232\2211\377\377\377\245\2041\377\377\377\262x1\377\377\377"
-  "\277l1\310d2\312`1\324X2\327T1\260|2\377\377\377\307\260|\244\2102\377\377"
-  "\377\307\300\213\232\2211\230\2242\377\377\377\377\377\262\310\316\231\214"
-  "\2402\214\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200"
-  "\2542\200\2542\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266"
-  "\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\325\355"
-  "\305\377\377\377\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\335"
-  "\364\323h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377"
-  "\377\215\2351\377\377\377\232\2211\377\377\377\245\2041\377\377\377\262x"
-  "1\377\377\377\277l1\377\377\377\312`1\377\310|\327T1\227/\14\377\377\377"
-  "\307\260|\244\2102\244\2102\377\377\377\307\300\213\230\2242\230\2242\377"
-  "\377\377\310\316\231\310\316\231\214\2402\214\2402\377\377\377\377\377\377"
-  "\312\332\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377"
-  "\377t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\377\377"
-  "\377\377\377\377\377\377\377h\3042h\3042h\3042\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360"
-  "T\11TO\3321\377\377\377Z\3002\377\377\377h\3042\377\377\334t\2702\375\377"
-  "\310*\30\20\312\332\250\214\2402\262\260\214\230\2242\307\300\213\377\377"
-  "\377\245\2041\377\377\377:\35\20\377\377\377\277l1\316\264w\310d2\377\310"
-  "|\356qL\227/\14\260|2TZ3\307\260|\244\2102\274\302\274\307\300\213\307\300"
-  "\213\273\301U\377\377\377\377\377\377A^2\310\316\231\214\2402o\216B\377\377"
-  "\377\377\377\377\366\377\324\312\332\250\312\332\250*a\20\200\2542\377\377"
-  "\377\230\301\230\377\377\377\377\377\377\377\377\353\317\344\266\317\344"
-  "\266T\253Tt\2702t\2702]\265I\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377T\306T\377\377\377\325\355\305l\324i\325\355\305\377\377"
-  "\377\377\377\377\377\377\377h\3042\"\254\20h\3042h\3042b\353b\377\377\377"
-  "\377\377\377D\3502\362\375\360\377\377\377O\3321\377\377\377\\\3202\364\377"
-  "\336h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377\377"
-  "\214\2402\377\377\262\230\2242\307\300\213\244\2102\307\260|\377\377\377"
-  "\262x1\377\377\377\274p2\377\337\207\310d2\377\310|\324X2\333bB\260|2\377"
-  "\377\377\307\260|\244\2102\244\2102\377\377\377\307\300\213\232\2211\230"
-  "\2242\377\377\377\377\377\377\310\316\231\310\316\231\214\2402\214\2402\377"
-  "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\254"
-  "2\200\2542\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317"
-  "\344\266\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\325\355\305"
-  "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377\377\377\377"
-  "h\3042h\3042\377\377\377\377\377\377D\3471\377\377\377P\3342\364\377\352"
-  "\\\3202\335\364\323\377\377\377h\3021\377\377\377t\2702\375\377\310\200\254"
-  "2\312\332\250\377\377\377\215\2351\377\377\377\230\2242\377\377\250\244\210"
-  "2\307\260|\377\377\377\262x1\377\377\377\274p2\377\337\207\310d2\323xQ\324"
-  "X2\327T1\227/\14\260|2\377\377\234\307\260|\244\2102\377\377\377\377\377"
-  "\377\307\300\213\230\2242\230\2242\377\377\377\377\377\377\310\316\231\310"
-  "\316\231\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250"
-  "\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377"
-  "\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325"
-  "\355\305\377\377\377\377\377\377`\0`\377\377\377D\3471\371\366\371P\3342"
-  "\346\371\342\377\377\377\\\3161\377\377\377'\24\22\325\355\305t\2702\276"
-  "\310\251\377\377\377\200\2542\377\377\316\214\2402\310\316\231`6`\230\224"
-  "2\377\377\250\222u<\307\260|\377\377\377\315\214L\377\377\377\274p2M,#\310"
-  "d2\312`1\306\304\306\324X2\333bB\325\242W\377\377\377\307\260|=9\22\244\210"
-  "2\377\377\377\227\234w\307\300\213\230\2242\307\322a\377\377\377\377\377"
-  "\377Km9\310\316\231\214\2402r\226K\377\377\377\377\377\377\377\377\377\312"
-  "\332\250\312\332\250`\242`\200\2542\200\2542\224\306\224\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\317\344\266M\250D\317\344\266\377\377\377"
-  "\203\322\203t\2702t\2702\301\377\177\377\377\377\377\377\377`\330`\377\377"
-  "\377\377\377\377r\344r\377\377\377\377\377\377\377\377\377\325\355\305\377"
-  "\377\377\377\377\377D\3502\371\377\364P\3342\346\371\342\377\377\377\\\320"
-  "2\364\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\200\2542\312"
-  "\332\250\377\377\377\214\2402\310\316\231\230\2242\307\300\213\377\377\377"
-  "\244\2102\307\260|\377\377\377\200U0\220^\377\7\4/\227U[\246]\377\255Q1\377"
-  "\242y\10\3/\306M@\6\4/{^\377mVvmVv\6\5/h\\\377h\\\377\\U\204\12\12\360\5"
-  "\5/VX\377VX\377\12\12\360LR\221\12\12\360\5\6/\214\2402\377\377\377\377\377"
-  "\377\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200"
-  "\2542\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344"
-  "\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371"
-  "\342\377\377\377\\\3202\335\364\323\377\377\377h\3042\367\377\324t\2702\317"
-  "\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402\377\377\262"
-  "\230\2242\307\300\213\377\377\377\244\2102\307\260|{^\377\200U0\220^\377"
-  "\7\4/\227U[\246]\377\7\3/\377\242y\236\37""2\306M0\210%\14T-2{^\377mVv\6"
-  "\5/\6\5/h\\\377\\U\204\\U\204\5\5/\5\5/VX\377VX\377LR\221LR\221\377\377\377"
-  "\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250\312\332"
-  "\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266\377"
-  "\377\377\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377D\3502\365\375\363\377\377"
-  "\377O\3321l\22l\\\3202\335\364\323\357\346\357h\3042\325\355\305\377\377"
-  "\377t\2702\317\344\266l-l\200\2521\377\377\377\204\211=\310\316\231\377\377"
-  "\377\262\243L\307\300\213\377\377\377E&\25mVv{^\377ySB\220^\377\7\4/\275"
-  "t\201\246]\377\7\3/I\37!\277Z\377\10\3/\237YQ\6\4/{^\377\236\213\247mVv\6"
-  "\5/,-lh\\\377\\U\204dow\5\5/\5\5/\222\251\377VX\377\310\316\231T{@\377\377"
-  "\377\214\2402w\240V\377\377\377\377\377\377\377\377\377\377\377\377\312\332"
-  "\250U\231G\377\377\377\200\2542q\270\\\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377l\317l\317\344\266\317\344\266z\330v\377\377\377"
-  "\377\377\377\323\377\221t\2702t\2702l\352l\377\377\377\377\377\377\377\377"
-  "\377D\3502\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\364"
-  "\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200"
-  "\2542\312\332\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\307"
-  "\300\213\377\377\377\6\5/mVv{^\377\200U0\220^\377\7\4/\227U[\246]\377\7\3"
-  "/\255RN\277Z\377\10\3/\306M@\6\4/{^\377{^\377mVv\6\5/\6\5/h\\\377h\\\377"
-  "\\U\204\12\12\360\5\5/\12\12\360\377\377\377\377\377\377\310\316\231\310"
-  "\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200\254"
-  "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\317\344\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702"
-  "\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\3342\346\371\342"
-  "\377\377\377\\\3202\335\364\323\377\377\377h\3042\325\355\305\377\377\377"
-  "t\2702\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402"
-  "\310\316\231\377\377\377\230\2242\307\300\213h\\\377\6\5/mVv{^\377\200U0"
-  "\220^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{"
-  "^\377mVvmVv\6\5/\12\12\360h\\\377\\U\204\\U\204\5\5/\230\2242\377\377\377"
-  "\377\377\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214"
-  "\2402\377\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332"
-  "\250\377\377\377\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317"
-  "\344\266\377\377\377\377\377\377\377\377\377\377\377\377D\3502q\10p\377\377"
-  "\377P\3342\335\350\332\377\377\377\\\3202\351\366\337\377\377\377h\3042d"
-  "!\\\377\377\377t\2702\277\302\252\377\377\377\200\2542\343\345\301\377\377"
-  "\377\214\2402^2H\377\377\377\230\2242\257\235\204h\\\377\6\5/\223o\234{^"
-  "\377\6\4/<\36""1\377\252\215j)2\211XK\377\250\203\202$2\337~c\377\242y\236"
-  "\37""2]#\26\306M@\6\4/ym\274{^\377mVvELn\6\5/h\\\37703x\\U\204\307\300\213"
-  "\204\226\\\230\2242\377\377\377\377\377\377\377\377\377\310\316\231^\212"
-  "H\377\377\377\214\2402}\256b\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\312\332\250_\251O\377\377\377\377\377\377y\310j\200\2542\377\377\377"
-  "\377\377\377\377\377\377\377\377\377x\341x\377\377\377\377\377\377\177\350"
-  "|\317\344\266\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\334"
-  "2\346\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\304"
-  "2\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200\2542\312\332"
-  "\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\\U\204h\\\377"
-  "\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\255"
-  "RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377mVvmVv\6\5/\12\12\360h\\\377"
-  "\377\377\377\307\300\213\377\377\377\230\2242\230\2242\377\377\377\377\377"
-  "\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214\2402\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\312"
-  "\332\250\377\377\377\200\2542\200\2542\200\2542\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\350"
-  "2\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377\377\377\\\320"
-  "2\335\364\323\377\377\377h\3042\325\355\305\377\377\377t\2702\317\344\266"
-  "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\214\2402\310\316"
-  "\231\377\377\377\5\5/\\U\204h\\\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220"
-  "^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{^\377"
-  "\12\12\360mVv\6\5/\6\5/\377\377\377\377\377\377\307\300\213\307\300\213\377"
-  "\377\377\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316"
-  "\231\310\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377"
-  "\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\204\0\204\377\377\377D\3502\355\364\353\377\377\377\377\377\377Y\335;\346"
-  "\371\342\377\377\377/\26\31\335\364\323\377\377\377k\255<\325\355\305\377"
-  "\377\377\377\377\377t\2702\317\344\266\2046\204\200\2542\312\332\250\340"
-  "\317\340\214\2402\310\316\231\377\377\377VX\377\5\5//\33Dh\\\377\6\5/tVz"
-  "{^\377\6\4/=0\377\201Vi\220^\377\3\1\30\227U[\246]\377?6U\255RN\277Z\377"
-  "\337]s\306M0\306M@\3\2\30{^\377{^\377yv}mVv\244\2102\377\377\377\377\377"
-  "\377\377\377\377gyG\307\300\213\230\2242\212\242h\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\310\316\231g\230O\377\377\377\214\2402\205\274q"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377h\270V\312\332"
-  "\250\377\377\377\222\344\222\200\2542\200\2542\377\377\377\377\377\377\377"
-  "\377\377\377\377\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346"
-  "\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\3042\325"
-  "\355\305\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312"
-  "\332\250\377\377\377\214\2402\310\316\231VX\377\12\12\360\5\5/\\U\204h\\"
-  "\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3"
-  "/\255RN\255RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377\12\12\360\307\260"
-  "|\244\2102\244\2102\377\377\377\377\377\377\377\377\377\307\300\213\377\377"
-  "\377\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310"
-  "\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377"
-  "\377\377\377\200\2542\200\2542\377\377\377\377\377\377D\3502\377\377\377"
-  "\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\377\377\377"
-  "\335\364\323\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702"
-  "\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\377\377\377\214"
-  "\2402LR\221VX\377\5\5/\\U\204\12\12\360h\\\377\6\5/mVv{^\377\6\4/\12\12\360"
-  "\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\7\3/\255RN\277Z\377\10\3/\306M@"
-  "\6\4/\6\4/{^\377\377\377\377\307\260|\377\377\377\244\2102\377\377\377\377"
-  "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231\377\377"
-  "\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377\377\377\377"
-  "\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377\377-\17\34\346"
-  "\371\342\377\377\377\363\346\363\\\3202\335\364\323\377\377\377h\3042\377"
-  "\377\377x)o\377\377\377t\2702\301\276\255\377\377\377\377\377\377\243\273"
-  "U\312\332\250\377\377\377O-\34\12\12\360LR\221gU\333\5\5/\\U\204<)\377h\\"
-  "\377\6\5/=!B{^\377\6\4/A2\306\201Vi\220^\377I9q\227U[\246]\377]-\220\7\3"
-  "/\255RN\245q\304\10\3/\306M0\377\236\221\6\4/\377\377\377\220\231\220\307"
-  "\260|\307\260|\226\227m\244\2102\377\377\377\377\377\377\377\377\377\307"
-  "\300\213p\207N\230\2242\230\2242\254\316\254\377\377\377\377\377\377\377"
-  "\377\377\310\316\231\310\316\231\220\317\220\377\377\377\214\2402\216\316"
-  "\200\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377r\310^\312"
-  "\332\250\377\377\377\377\377\377\377\377\377D\3502\362\375\360\377\377\377"
-  "P\3342\377\377\377\346\371\342\377\377\377\\\3202\335\364\323\377\377\377"
-  "\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702\317\344\266"
-  "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\5\6/LR\221\12\12"
-  "\360VX\377\5\5/\\U\204h\\\377\12\12\360\6\5/mVv{^\377\6\4/\12\12\360\201"
-  "Vi\220^\377\7\4/\227U[\12\12\360\246]\377\7\3/\255RN\277Z\377\277Z\377\10"
-  "\3/\306M@\260|2\260|2\377\377\377\377\377\377\307\260|\377\377\377\244\210"
-  "2\377\377\377\377\377\377\377\377\377\377\377\377\307\300\213\377\377\377"
-  "\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316"
-  "\231\310\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377D\3502\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377"
-  "\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\325\355\305\377"
-  "\377\377\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312"
-  "\332\250\377\377\377\12\12\360\5\6/LR\221VX\377\12\12\360\5\5/\\U\204h\\"
-  "\377\6\5/\12\12\360mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\227"
-  "U[\246]\377\7\3/\255RN\12\12\360\277Z\377\10\3/\333bB\377\377\377\260|2\377"
-  "\377\377\377\377\377\307\260|\307\260|\244\2102\244\2102\377\377\377\377"
-  "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\230\224"
-  "2\377\377\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231"
-  "\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377)\10\36\362\375\360\377\377\377\370"
-  "\356\370P\3342\346\371\342\377\377\377\377\377\377\\\3202\207\"\201\377\377"
-  "\377\377\377\377p\250D\325\355\305\377\377\377\377\377\377t\2702\317\344"
-  "\266\234?\234\200\2542\377\377\377\274\260\244FS\377\5\6/;#\377LR\221VX\377"
-  "\3\1\34\12\12\360\\U\204{^\330\6\5/\12\12\360\257\203\270{^\377\6\4/\6\4"
-  "\222\201Vi\220^\377P at d\12\12\360\227U[\370\244\377\7\3/\255RNi./\277Z\377"
-  "\324X2\264\202w\333bB\260|2\377\377\377\377\377\377\377\377\377yvK\377\377"
-  "\377\244\2102\236\247|\377\377\377\377\377\377\377\377\377\307\300\213\307"
-  "\300\213\234\306\234\230\2242\377\377\377\256\330\256\377\377\377\377\377"
-  "\377\377\377\377\310\316\231\310\316\231\234\341\234\377\377\377\214\240"
-  "2\232\343\223\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375"
-  "\360\377\377\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\"
-  "\3202\335\364\323\377\377\377\377\377\377h\3042\325\355\305\377\377\377\377"
-  "\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312\332\250\12"
-  "\12\360FS\377\5\6/LR\221\12\12\360RW\255\3\5\35\6\11\224ZT\\d[\261\3\4\35"
-  "\6\11\224lVTw]\264\4\4\35\6\11\224\200VN\214]\270\4\3\35\6\11\224\226UG\242"
-  "\\\274\4\3\35\4\3\35\254R@\377\377\311\203U\36\203U\36\323a:my\36my\36\377"
-  "\377\276\377\377\276\243\255X\243\255X\236\371\236e\204\36\236\371\236\374"
-  "\377\273\236\371\236\236\371\236\234\275`\236\371\236^\220\36^\220\36\236"
-  "\371\236\352\377\267\352\377\267\236\371\236\236\371\236\310\316\231\310"
-  "\316\231\377\377\377\377\377\377\214\2402\377\377\377\377\377\377\377\377"
-  "\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346\371\342\377\377"
-  "\377\377\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\377\377"
-  "\377\325\355\305\377\377\377t\2702\377\377\377\317\344\266\377\377\377\377"
-  "\377\377\200\2542<L\237FS\377\12\12\360\5\6/LR\221\6\11\224RW\255\3\5\35"
-  "ZT\\\6\11\224d[\261\3\4\35\6\11\224lVTw]\264\4\4\35\6\11\224\200VN\214]\270"
-  "\4\3\35\4\3\35\226UG\242\\\274\6\11\224\4\3\35\304wB\377\377\311\377\377"
-  "\311\203U\36\323a:\236\371\236my\36\236\371\236\377\377\276\236\371\236\243"
-  "\255X\236\371\236e\204\36e\204\36\374\377\273\374\377\273\236\371\236\234"
-  "\275`\234\275`\236\371\236^\220\36^\220\36\236\371\236\352\377\267\352\377"
-  "\267\377\377\377\377\377\377\310\316\231\310\316\231\377\377\377\250\0\250"
-  "\377\377\377\377\377\377F\3375\362\375\360\377\377\377\377\377\377P\3342"
-  "\377\377\377\227\32\224\377\377\377\\\3202\362\340\362\335\364\323\377\377"
-  "\377\377\377\377h\3042\325\355\305\2506\250\377\377\377t\2702\304\272\262"
-  "\377\377\377\377\377\377\257\300a\12\12\360<L\237.\32\250\5\6/\12\12\360"
-  "jSzRW\255\6\11\224D+^ZT\\\6\11\224A&t\3\4\35lVTP9\235w]\264\4\4\35YG\347"
-  "\200VN\214]\270\3\4a\4\3\35\226UG\244y\257\6\11\224{a\36\377\322\246\236"
-  "\371\236\377\377\311V6\23\323a:\323a:\223\231y\236\371\236\377\377\276\377"
-  "\377\377\243\255X\243\255Xh\270he\204\36\236\371\236\272\322\253\374\377"
-  "\273\236\371\236\377\377\350\236\371\236\236\371\236=y\23\236\371\236\236"
-  "\371\236\262\344\262\377\377\377\377\377\377\377\377\377\310\316\231\377"
-  "\377\377\377\377\377\377\377\377D\3502\362\375\360\377\377\377\377\377\377"
-  "P\3342\377\377\377\346\371\342\377\377\377\377\377\377\\\3202\335\364\323"
-  "\377\377\377\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702"
-  "\377\377\377\317\344\266\377\377\377\377\377\377\5\6/<L\237\12\12\360FS\377"
-  "\5\6/\6\11\224JQbRW\255\6\11\224\3\5\35ZT\\d[\261\6\11\224\3\4\35lVT\6\11"
-  "\224w]\264\4\4\35\6\11\224\200VN\214]\270\6\11\224\4\3\35\226UG\242\\\274"
-  "\377\377\306{a\36\304wB\304wB\377\377\311\203U\36\203U\36\323a:my\36my\36"
-  "\377\377\276\377\377\276\236\371\236\243\255X\236\371\236e\204\36e\204\36"
-  "\236\371\236\374\377\273\236\371\236\234\275`\234\275`\236\371\236^\220\36"
-  "^\220\36\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377D\3502\362\375\360\377\377\377\377\377\377"
-  "P\3342\377\377\377\346\371\342\377\377\377\377\377\377\\\3202\335\364\323"
-  "\377\377\377\377\377\377h\3042\377\377\377\325\355\305\377\377\377\377\377"
-  "\377t\2702\317\344\266\377\377\377\377\377\377\5\6/\12\12\360<L\237FS\377"
-  "\12\12\360\3\5\35JQb\6\11\224RW\255\3\5\35\6\11\224ZT\\d[\261\6\11\224\3"
-  "\4\35lVT\6\11\224w]\264\4\4\35\6\11\224\200VN\214]\270\6\11\224\4\3\35\226"
-  "UG\236\371\236\377\377\306{a\36\236\371\236\304wB\377\377\311\236\371\236"
-  "\203U\36\323a:\236\371\236my\36\236\371\236\377\377\276\236\371\236\243\255"
-  "X\243\255X\236\371\236e\204\36\236\371\236\374\377\273\374\377\273\236\371"
-  "\236\234\275`\234\275`\236\371\236\230\2242\230\2242\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377J\3508\377\377\377\362"
-  "\375\360\264\22\264\377\377\377P\3342\340\340\335\377\377\377\377\377\377"
-  "u\325K\377\377\377\335\364\323\264-\264\377\377\377h\3042\315\305\301\377"
-  "\377\377\377\377\377\240\307^\377\377\377\317\344\266\264H\264\12\12\360"
-  "\5\6/aL\245\12\12\360FS\377E(\323\3\5\35JQb\4\3hRW\255\3\5\35O2\241ZT\\d"
-  "[\261X>\346\3\4\35lVT\4\4hw]\264\4\4\35aK\244\200VN\214]\270kZ\371\4\3\35"
-  "\270\212Io\225o\377\377\306{a\36\253\300\253\304wB\377\377\311\377\377\377"
-  "\203U\36\323a:\224D(my\36\236\371\236\307\316\266\377\377\276\236\371\236"
-  "\377\377\343\236\371\236e\204\36Gk\25\236\371\236\374\377\273\260\334\260"
-  "\236\371\236\234\275`\377\377\377\377\377\377\230\2242k\207#\377\377\377"
-  "\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377"
-  "\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\\3202\377\377"
-  "\377\335\364\323\377\377\377\377\377\377h\3042\377\377\377\325\355\305\377"
-  "\377\377\377\377\377t\2702\317\344\266\377\377\3778L\377\12\12\360\5\6/<"
-  "L\237\12\12\360BR\252\3\5\35\6\11\224JQbRW\255\6\11\224\3\5\35ZT\\\6\11\224"
-  "d[\261\6\11\224\3\4\35lVT\6\11\224w]\264\4\4\35\6\11\224\200VN\214]\270\6"
-  "\11\224tm\36\270\212I\270\212I\377\377\306{a\36{a\36\304wB\236\371\236\377"
-  "\377\311\203U\36\236\371\236\323a:my\36my\36\236\371\236\377\377\276\236"
-  "\371\236\243\255X\243\255X\236\371\236e\204\36\236\371\236\374\377\273\374"
-  "\377\273\236\371\236\307\300\213\307\300\213\377\377\377\377\377\377\230"
-  "\2242\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377"
-  "\377\377\377\377\377P\3342\377\377\377\346\371\342\377\377\377\377\377\377"
-  "\\\3202\335\364\323\377\377\377\377\377\377\377\377\377h\3042\325\355\305"
-  "\377\377\377\377\377\377t\2702\377\377\377\317\344\2668L\377\12\12\360\5"
-  "\6/\12\12\360<L\237BR\252\6\11\224\3\5\35JQb\6\11\224RW\255\6\11\224\3\5"
-  "\35ZT\\\6\11\224d[\261\3\4\35\6\11\224lVT\6\11\224w]\264\4\4\35\6\11\224"
-  "\200VN\214]\270\236\371\236tm\36\236\371\236\270\212I\377\377\306\236\371"
-  "\236{a\36\304wB\236\371\236\377\377\311\203U\36\203U\36\323a:\236\371\236"
-  "my\36\236\371\236\377\377\276\377\377\276\236\371\236\243\255X\236\371\236"
-  "e\204\36e\204\36\236\371\236\374\377\273\377\377\377\377\377\377\307\300"
-  "\213\307\300\213\377\377\377\377\377\377\377\377\377\377\377\3773\10%\377"
-  "\377\377\362\375\360\372\356\372\377\377\377P\3342\377\377\377\346\371\342"
-  "\377\377\377\300$\300\\\3202\377\377\377\327\317\316\377\377\377\377\377"
-  "\377\220\317Z\377\377\377\325\355\305\300?\300\377\377\377t\2702\312\267"
-  "\270\12\12\3608L\377F#\377\5\6/<L\237\4\3oBR\252\6\11\224K)[JQb\6\11\224"
-  "\243\204\376\3\5\35\6\11\224C&E\6\11\224d[\261_ at l\6\11\224lVTkP\371w]\264"
-  "\4\4\35\4\5o\200VN\377\377\302\262\276\262tm\36\236\371\236\377\360\302\377"
-  "\377\306\236\371\236\\A\26\304wB\304wB\322\312\302\236\371\236\203U\36\377"
-  "\355\310\323a:my\36R]\26\236\371\236\377\377\276\270\326\270\243\255X\236"
-  "\371\236\377\377\377e\204\36\236\371\236\300\341\300\377\377\377\377\377"
-  "\377\305\353\305\307\300\213\377\377\377\377\377\377\377\377\377D\3502\377"
-  "\377\377\362\375\360\377\377\377\377\377\377P\3342\377\377\377\346\371\342"
-  "\377\377\377\377\377\377\\\3202\377\377\377\335\364\323\377\377\377\377\377"
-  "\377h\3042\377\377\377\325\355\305\377\377\377\377\377\377t\2702\377\377"
-  "\3770E\254\12\12\3608L\377\5\6/\12\12\360:Lj\6\11\224BR\252\3\5\35\6\11\224"
-  "JQb\6\11\224RW\255\3\5\35\6\11\224ZT\\\6\11\224d[\261\3\4\35\6\11\224lVT"
-  "\6\11\224w]\264\4\4\35\6\11\224\255\235Q\377\377\302\377\377\302tm\36\236"
-  "\371\236\270\212I\377\377\306\377\377\306{a\36\236\371\236\304wB\377\377"
-  "\311\377\377\311\203U\36\236\371\236\323a:\236\371\236my\36\236\371\236\377"
-  "\377\276\236\371\236\243\255X\243\255X\236\371\236e\204\36\244\2102\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377D\3502\377\377\377\362\375\360\377\377\377\377\377\377P\3342\377\377"
-  "\377\346\371\342\377\377\377\377\377\377\377\377\377\\\3202\335\364\323\377"
-  "\377\377\377\377\377\377\377\377h\3042\325\355\305\377\377\377\377\377\377"
-  "\377\377\377t\2702\317\344\266\377\377\377\377\377\377\377\377\377\200\254"
-  "2\236\371\236\222\326p\332\377\264\236\371\236V\234\36\236\371\236\226\312"
-  "g\352\377\267\236\371\236^\220\36\236\371\236\234\275`\374\377\273\236\371"
-  "\236e\204\36\236\371\236\243\255X\377\377\276\236\371\236my\36\236\371\236"
-  "\255\235Q\236\371\236\377\377\302tm\36\236\371\236\270\212I\236\371\236\377"
-  "\377\306{a\36\236\371\236\304wB\236\371\236\377\377\311\203U\36\203U\36\323"
-  "a:\236\371\236my\36\236\371\236\377\377\276\377\377\276\236\371\236\243\255"
-  "X\236\371\236\377\377\377\244\2102\377\377\377\377\377\377\377\377\377\314"
-  "\0\314\377\377\377\377\377\377H\3377\377\377\377\362\375\360\377\377\377"
-  "\377\377\377\377\377\377@\27(\346\371\342\377\377\377\367\340\367\377\377"
-  "\377\\\3202\377\377\377\335\364\323\377\377\377\3146\314h\3042\377\377\377"
-  "\322\301\306\377\377\377\377\377\377\255\314k\377\377\377\317\344\266\314"
-  "Q\314\377\377\377\200\2542\256\300\256\222\326p\236\371\236\377\377\377\236"
-  "\371\236V\234\36xUR\236\371\236\352\377\267\262\273\262^\220\36\234\275`"
-  "\377\377\377\374\377\273\236\371\236PE\30\236\371\236\243\255X\342\300\305"
-  "\236\371\236my\36\377\377\377\255\235Q\236\371\236\314\242\233tm\36\236\371"
-  "\236\304\237\240\236\371\236\377\377\306\377\340\256{a\36\304wB~\270~\377"
-  "\377\311\236\371\236\273\254\244\323a:\323a:\377\377\303my\36\236\371\236"
-  "\314\330\230\236\371\236\243\255X\313\332\302\377\377\377\244\2102\377\377"
-  "\355\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362"
-  "\375\360\377\377\377\377\377\377\377\377\377P\3342\377\377\377\346\371\342"
-  "\377\377\377\377\377\377\\\3202\377\377\377\335\364\323\377\377\377\377\377"
-  "\377h\3042\377\377\377\325\355\305\377\377\377\377\377\377\377\377\377t\270"
-  "2\317\344\266\377\377\377\377\377\377\377\377\377O\247\36\236\371\236\222"
-  "\326p\332\377\264\236\371\236V\234\36\236\371\236\226\312g\236\371\236\352"
-  "\377\267\236\371\236^\220\36\234\275`\236\371\236\374\377\273\236\371\236"
-  "e\204\36\236\371\236\243\255X\377\377\276\236\371\236my\36\236\371\236\255"
-  "\235Q\236\371\236\377\377\302tm\36\236\371\236\270\212I\236\371\236\377\377"
-  "\306\236\371\236{a\36\304wB\304wB\377\377\311\236\371\236\203U\36\236\371"
-  "\236\323a:\236\371\236my\36\236\371\236\377\377\276\377\377\276\377\377\377"
-  "\307\260|\377\377\377\377\377\377\244\2102\377\377\377\377\377\377\377\377"
-  "\377\377\377\377D\3502\362\375\360\377\377\377\377\377\377\377\377\377P\334"
-  "2\377\377\377\346\371\342\377\377\377\377\377\377\\\3202\377\377\377\335"
-  "\364\323\377\377\377\377\377\377\377\377\377h\3042\377\377\377\325\355\305"
-  "\377\377\377\377\377\377t\2702\377\377\377\317\344\266\377\377\377\377\377"
-  "\377\236\371\236O\247\36\222\326p\236\371\236\332\377\264\236\371\236V\234"
-  "\36\236\371\236\226\312g\236\371\236\352\377\267^\220\36\236\371\236\234"
-  "\275`\236\371\236\374\377\273\236\371\236e\204\36\236\371\236\243\255X\377"
-  "\377\276\236\371\236my\36\236\371\236\255\235Q\236\371\236\377\377\302tm"
-  "\36tm\36\270\212I\236\371\236\377\377\306\236\371\236{a\36\236\371\236\304"
-  "wB\377\377\311\377\377\311\203U\36\236\371\236\323a:\236\371\236my\36\236"
-  "\371\236\236\371\236\377\377\377\377\377\377\307\260|\307\260|\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360\330\22"
-  "\330\377\377\377\377\377\377]\306B\377\377\377\346\371\342\377\377\377\377"
-  "\377\377\377\377\377M$*\335\364\323\377\377\377\366\324\366\377\377\377h"
-  "\3042\377\377\377\325\355\305\377\377\377\330H\330\377\377\377t\2702\321"
-  "\264\300\377\377\377\377\377\377\352\377\352O\247\36\236\371\236{S^\236\371"
-  "\236\332\377\264\266\274\266V\234\36\226\312g\377\377\377\352\377\267\236"
-  "\371\236OG\31\236\371\236\234\275`\274\274\274\374\377\273\236\371\236\336"
-  "\325\227\243\255X\236\371\236\330\231\240\236\371\236my\36\302\300\302\255"
-  "\235Q\236\371\236\377\377\377\236\371\236tm\36\233a=\236\371\236\377\377"
-  "\306\310\314\310{a\36\236\371\236\377\377\351\236\371\236\377\377\311nE\31"
-  "\203U\36\323a:\326\304\276my\36my\36\377\377\377\377\377\377\377\377\377"
-  "\330\352\330\307\260|\377\377\377\377\377\377\377\377\377\377\377\377D\350"
-  "2\377\377\377\362\375\360\377\377\377\377\377\377P\3342\377\377\377\346\371"
-  "\342\377\377\377\377\377\377\377\377\377\\\3202\377\377\377\335\364\323\377"
-  "\377\377\377\377\377\377\377\377h\3042\325\355\305\377\377\377\377\377\377"
-  "\377\377\377t\2702\377\377\377\317\344\266\377\377\377\377\377\377\377\377"
-  "\377\200\2542\377\377\377\312\332\250\377\377\377\377\377\377\214\2402\377"
-  "\377\377\310\316\231\377\377\377\377\377\377\377\377\377\230\2242\377\377"
-  "\377\307\300\213\377\377\377\377\377\377\244\2102\377\377\377\307\260|\377"
-  "\377\377\377\377\377\377\377\377\260|2\377\377\377\312\237n\377\377\377\377"
-  "\377\377\377\377\377\274p2\316\214_\316\214_\377\377\377\377\377\377\310"
-  "d2\377\377\377\323xQ\377\377\377\377\377\377\377\377\377\324X2\377\377\377"
-  "\333bB\377\377\377\260|2\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375"
-  "\360\377\377\377\377\377\377P\3342\377\377\377\346\371\342\377\377\377\377"
-  "\377\377\377\377\377\\\3202\377\377\377\335\364\323\377\377\377\377\377\377"
-  "\377\377\377h\3042\377\377\377\325\355\305\377\377\377\377\377\377\377\377"
-  "\377t\2702\317\344\266\377\377\377\377\377\377\377\377\377\200\2542\377\377"
-  "\377\312\332\250\377\377\377\377\377\377\377\377\377\214\2402\377\377\377"
-  "\310\316\231\377\377\377\377\377\377\377\377\377\230\2242\377\377\377\307"
-  "\300\213\377\377\377\377\377\377\244\2102\377\377\377\307\260|\377\377\377"
-  "\377\377\377\377\377\377\260|2\377\377\377\312\237n\377\377\377\377\377\377"
-  "\377\377\377\274p2\377\377\377\316\214_\377\377\377\377\377\377\310d2\310"
-  "d2\323xQ\377\377\377\377\377\377\377\377\377\324X2\377\377\377\333bB\377"
-  "\377\377\260|2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
-  "\377\377\377\344\11\344D\3502\377\377\377\360\354\357\377\377\377\377\377"
-  "\377\377\377\377P\3342\377\377\377\315#\312\377\377\377\377\377\377s\262"
-  "Q\377\377\377\335\364\323\377\377\377\377\377\377\377\377\377\\0,\377\377"
-  "\377\325\355\305\367\313\367\377\377\377\377\377\377\274\321z\377\377\377"
-  "\317\344\266\344Z\344\377\377\377\377\377\377\246\217v\377\377\377\312\332"
-  "\250\377\377\377\377\377\377\377\377\377}I,\377\377\377\310\316\231\361\277"
-  "\361\377\377\377\230\2242\377\377\377\307\300\213\377\377\377\344\220\344"
-  "\377\377\377\244\2102\356\301\356\307\260|\377\377\377\377\377\377\377\377"
-  "\377\260|2\344\253\344\312\237n\377\377\377\353\312\353\377\377\377\274p"
-  "2\377\377\377\316\214_\377\377\377\344\306\344\377\377\377\310d2\340\276"
-  "\310\323xQ\377\377\377\377\377\377\324X2\324X2\303V;\333bB\260|2\337\340"
-  "\325\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\3502\377"
-  "\377\377\362\375\360\377\377\377\377\377\377\377\377\377P\3342\377\377\377"
-  "\346\371\342\377\377\377\377\377\377\377\377\377\\\3202\377\377\377\335\364"
-  "\323\377\377\377\377\377\377\377\377\377h\3042\377\377\377\325\355\305\377"
-  "\377\377\377\377\377\377\377\377t\2702\317\344\266\377\377\377\377\377\377"
-  "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\377\377\377\377"
-  "\377\377\214\2402\377\377\377\310\316\231\377\377\377\377\377\377\377\377"
-  "\377\230\2242\377\377\377\307\300\213\377\377\377\377\377\377\377\377\377"
-  "\244\2102\377\377\377\307\260|\377\377\377\377\377\377\377\377\377\260|2"
-  "\377\377\377\312\237n\377\377\377\377\377\377\377\377\377\274p2\377\377\377"
-  "\316\214_\377\377\377\377\377\377\377\377\377\310d2\377\377\377\323xQ\377"
-  "\377\377\377\377\377\377\377\377\324X2\377\377\377\333bB\377\377\377\260"
-  "|2\377\377\377\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362"
-  "\375\360\377\377\377\377\377\377\377\377\377P\3342\377\377\377\346\371\342"
-  "\377\377\377\377\377\377\377\377\377\\\3202\377\377\377\335\364\323\377\377"
-  "\377\377\377\377\377\377\377h\3042\377\377\377\325\355\305\377\377\377\377"
-  "\377\377\377\377\377t\2702\377\377\377\317\344\266\377\377\377\377\377\377"
-  "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\377\377\377\377"
-  "\377\377\214\2402\377\377\377\310\316\231\377\377\377\377\377\377\377\377"
-  "\377\230\2242\377\377\377\307\300\213\377\377\377\377\377\377\377\377\377"
-  "\244\2102\377\377\377\307\260|\377\377\377\377\377\377\377\377\377\260|2"
-  "\377\377\377\312\237n\377\377\377\377\377\377\377\377\377\274p2\377\377\377"
-  "\316\214_\377\377\377\377\377\377\377\377\377\310d2\377\377\377\323xQ\377"
-  "\377\377\377\377\377\377\377\377\324X2\377\377\377\333bB\377\377\377",
-};
-
-/**
- * \brief Returns the PrimitivesBlend test image as SDL_Surface.
- */
-SDL_Surface *SDLTest_ImagePrimitivesBlend()
-{
-   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(
-        (void*)SDLTest_imagePrimitivesBlend.pixel_data,
-        SDLTest_imagePrimitivesBlend.width,
-        SDLTest_imagePrimitivesBlend.height,
-        SDLTest_imagePrimitivesBlend.bytes_per_pixel * 8,
-        SDLTest_imagePrimitivesBlend.width * SDLTest_imagePrimitivesBlend.bytes_per_pixel,
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-         0xff000000, /* Red bit mask. */
-         0x00ff0000, /* Green bit mask. */
-         0x0000ff00, /* Blue bit mask. */
-         0x000000ff  /* Alpha bit mask. */
-#else
-         0x000000ff, /* Red bit mask. */
-         0x0000ff00, /* Green bit mask. */
-         0x00ff0000, /* Blue bit mask. */
-         0xff000000  /* Alpha bit mask. */
-#endif
-         );
-   return surface;
-}
diff --git a/deps/SDL2/src/test/SDL_test_log.c b/deps/SDL2/src/test/SDL_test_log.c
deleted file mode 100644
index caf3ddd..0000000
--- a/deps/SDL2/src/test/SDL_test_log.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-
- Used by the test framework and test cases.
-
-*/
-
-/* quiet windows compiler warnings */
-#define _CRT_SECURE_NO_WARNINGS
-
-#include "SDL_config.h"
-
-#include <stdarg.h> /* va_list */
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-
-#include "SDL.h"
-
-#include "SDL_test.h"
-
-/* !
- * Converts unix timestamp to its ascii representation in localtime
- *
- * Note: Uses a static buffer internally, so the return value
- * isn't valid after the next call of this function. If you
- * want to retain the return value, make a copy of it.
- *
- * \param timestamp A Timestamp, i.e. time(0)
- *
- * \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02'
- */
-char *SDLTest_TimestampToString(const time_t timestamp)
-{
-    time_t copy;
-    static char buffer[64];
-    struct tm *local;
-    const char *fmt = "%x %X";
-
-    SDL_memset(buffer, 0, sizeof(buffer));
-    copy = timestamp;
-    local = localtime(&copy);
-    strftime(buffer, sizeof(buffer), fmt, local);
-
-    return buffer;
-}
-
-/*
- * Prints given message with a timestamp in the TEST category and INFO priority.
- */
-void SDLTest_Log(const char *fmt, ...)
-{
-    va_list list;
-    char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
-
-    /* Print log message into a buffer */
-    SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
-    va_start(list, fmt);
-    SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list);
-    va_end(list);
-
-    /* Log with timestamp and newline */
-    SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_INFO, " %s: %s", SDLTest_TimestampToString(time(0)), logMessage);
-}
-
-/*
- * Prints given message with a timestamp in the TEST category and the ERROR priority.
- */
-void SDLTest_LogError(const char *fmt, ...)
-{
-    va_list list;
-    char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
-
-    /* Print log message into a buffer */
-    SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
-    va_start(list, fmt);
-    SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list);
-    va_end(list);
-
-    /* Log with timestamp and newline */
-    SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_ERROR, "%s: %s", SDLTest_TimestampToString(time(0)), logMessage);
-}
diff --git a/deps/SDL2/src/test/SDL_test_md5.c b/deps/SDL2/src/test/SDL_test_md5.c
deleted file mode 100644
index 3f42ed3..0000000
--- a/deps/SDL2/src/test/SDL_test_md5.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
- ***********************************************************************
- ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
- ** Created: 2/17/90 RLR                                              **
- ** Revised: 1/91 SRD,AJ,BSK,JT Reference C ver., 7/10 constant corr. **
- ***********************************************************************
- */
-
-/*
- ***********************************************************************
- ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
- **                                                                   **
- ** License to copy and use this software is granted provided that    **
- ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
- ** Digest Algorithm" in all material mentioning or referencing this  **
- ** software or this function.                                        **
- **                                                                   **
- ** License is also granted to make and use derivative works          **
- ** provided that such works are identified as "derived from the RSA  **
- ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
- ** material mentioning or referencing the derived work.              **
- **                                                                   **
- ** RSA Data Security, Inc. makes no representations concerning       **
- ** either the merchantability of this software or the suitability    **
- ** of this software for any particular purpose.  It is provided "as  **
- ** is" without express or implied warranty of any kind.              **
- **                                                                   **
- ** These notices must be retained in any copies of any part of this  **
- ** documentation and/or software.                                    **
- ***********************************************************************
- */
-
-#include "SDL_config.h"
-
-#include "SDL_test.h"
-
-/* Forward declaration of static helper function */
-static void SDLTest_Md5Transform(MD5UINT4 * buf, MD5UINT4 * in);
-
-static unsigned char MD5PADDING[64] = {
-  0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-/* F, G, H and I are basic MD5 functions */
-#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
-#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-#define I(x, y, z) ((y) ^ ((x) | (~z)))
-
-/* ROTATE_LEFT rotates x left n bits */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
-
-/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */
-
-/* Rotation is separate from addition to prevent recomputation */
-#define FF(a, b, c, d, x, s, ac) \
-  {(a) += F ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \
-   (a) = ROTATE_LEFT ((a), (s)); \
-   (a) += (b); \
-  }
-#define GG(a, b, c, d, x, s, ac) \
-  {(a) += G ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \
-   (a) = ROTATE_LEFT ((a), (s)); \
-   (a) += (b); \
-  }
-#define HH(a, b, c, d, x, s, ac) \
-  {(a) += H ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \
-   (a) = ROTATE_LEFT ((a), (s)); \
-   (a) += (b); \
-  }
-#define II(a, b, c, d, x, s, ac) \
-  {(a) += I ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \
-   (a) = ROTATE_LEFT ((a), (s)); \
-   (a) += (b); \
-  }
-
-/*
-  The routine MD5Init initializes the message-digest context
-  mdContext. All fields are set to zero.
-*/
-
-void SDLTest_Md5Init(SDLTest_Md5Context * mdContext)
-{
-  if (mdContext==NULL) return;
-
-  mdContext->i[0] = mdContext->i[1] = (MD5UINT4) 0;
-
-  /*
-   * Load magic initialization constants.
-   */
-  mdContext->buf[0] = (MD5UINT4) 0x67452301;
-  mdContext->buf[1] = (MD5UINT4) 0xefcdab89;
-  mdContext->buf[2] = (MD5UINT4) 0x98badcfe;
-  mdContext->buf[3] = (MD5UINT4) 0x10325476;
-}
-
-/*
- The routine MD5Update updates the message-digest context to
- account for the presence of each of the characters inBuf[0..inLen-1]
- in the message whose digest is being computed.
-*/
-
-void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf,
-          unsigned int inLen)
-{
-  MD5UINT4  in[16];
-  int       mdi;
-  unsigned int i, ii;
-
-  if (mdContext == NULL) return;
-  if (inBuf == NULL || inLen < 1) return;
-
-  /*
-   * compute number of bytes mod 64
-   */
-  mdi = (int) ((mdContext->i[0] >> 3) & 0x3F);
-
-  /*
-   * update number of bits
-   */
-  if ((mdContext->i[0] + ((MD5UINT4) inLen << 3)) < mdContext->i[0])
-    mdContext->i[1]++;
-  mdContext->i[0] += ((MD5UINT4) inLen << 3);
-  mdContext->i[1] += ((MD5UINT4) inLen >> 29);
-
-  while (inLen--) {
-    /*
-     * add new character to buffer, increment mdi
-     */
-    mdContext->in[mdi++] = *inBuf++;
-
-    /*
-     * transform if necessary
-     */
-    if (mdi == 0x40) {
-      for (i = 0, ii = 0; i < 16; i++, ii += 4)
-    in[i] = (((MD5UINT4) mdContext->in[ii + 3]) << 24) |
-      (((MD5UINT4) mdContext->in[ii + 2]) << 16) |
-      (((MD5UINT4) mdContext->in[ii + 1]) << 8) |
-      ((MD5UINT4) mdContext->in[ii]);
-      SDLTest_Md5Transform(mdContext->buf, in);
-      mdi = 0;
-    }
-  }
-}
-
-/*
- The routine MD5Final terminates the message-digest computation and
- ends with the desired message digest in mdContext->digest[0...15].
-*/
-
-void SDLTest_Md5Final(SDLTest_Md5Context * mdContext)
-{
-  MD5UINT4  in[16];
-  int       mdi;
-  unsigned int i, ii;
-  unsigned int padLen;
-
-  if (mdContext == NULL) return;
-
-  /*
-   * save number of bits
-   */
-  in[14] = mdContext->i[0];
-  in[15] = mdContext->i[1];
-
-  /*
-   * compute number of bytes mod 64
-   */
-  mdi = (int) ((mdContext->i[0] >> 3) & 0x3F);
-
-  /*
-   * pad out to 56 mod 64
-   */
-  padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi);
-  SDLTest_Md5Update(mdContext, MD5PADDING, padLen);
-
-  /*
-   * append length in bits and transform
-   */
-  for (i = 0, ii = 0; i < 14; i++, ii += 4)
-    in[i] = (((MD5UINT4) mdContext->in[ii + 3]) << 24) |
-      (((MD5UINT4) mdContext->in[ii + 2]) << 16) |
-      (((MD5UINT4) mdContext->in[ii + 1]) << 8) |
-      ((MD5UINT4) mdContext->in[ii]);
-  SDLTest_Md5Transform(mdContext->buf, in);
-
-  /*
-   * store buffer in digest
-   */
-  for (i = 0, ii = 0; i < 4; i++, ii += 4) {
-    mdContext->digest[ii] = (unsigned char) (mdContext->buf[i] & 0xFF);
-    mdContext->digest[ii + 1] =
-      (unsigned char) ((mdContext->buf[i] >> 8) & 0xFF);
-    mdContext->digest[ii + 2] =
-      (unsigned char) ((mdContext->buf[i] >> 16) & 0xFF);
-    mdContext->digest[ii + 3] =
-      (unsigned char) ((mdContext->buf[i] >> 24) & 0xFF);
-  }
-}
-
-/* Basic MD5 step. Transforms buf based on in.
- */
-static void SDLTest_Md5Transform(MD5UINT4 * buf, MD5UINT4 * in)
-{
-  MD5UINT4  a = buf[0], b = buf[1], c = buf[2], d = buf[3];
-
-  /*
-   * Round 1
-   */
-#define S11 7
-#define S12 12
-#define S13 17
-#define S14 22
-  FF(a, b, c, d, in[0], S11, 3614090360u);  /* 1 */
-  FF(d, a, b, c, in[1], S12, 3905402710u);  /* 2 */
-  FF(c, d, a, b, in[2], S13, 606105819u);   /* 3 */
-  FF(b, c, d, a, in[3], S14, 3250441966u);  /* 4 */
-  FF(a, b, c, d, in[4], S11, 4118548399u);  /* 5 */
-  FF(d, a, b, c, in[5], S12, 1200080426u);  /* 6 */
-  FF(c, d, a, b, in[6], S13, 2821735955u);  /* 7 */
-  FF(b, c, d, a, in[7], S14, 4249261313u);  /* 8 */
-  FF(a, b, c, d, in[8], S11, 1770035416u);  /* 9 */
-  FF(d, a, b, c, in[9], S12, 2336552879u);  /* 10 */
-  FF(c, d, a, b, in[10], S13, 4294925233u); /* 11 */
-  FF(b, c, d, a, in[11], S14, 2304563134u); /* 12 */
-  FF(a, b, c, d, in[12], S11, 1804603682u); /* 13 */
-  FF(d, a, b, c, in[13], S12, 4254626195u); /* 14 */
-  FF(c, d, a, b, in[14], S13, 2792965006u); /* 15 */
-  FF(b, c, d, a, in[15], S14, 1236535329u); /* 16 */
-
-  /*
-   * Round 2
-   */
-#define S21 5
-#define S22 9
-#define S23 14
-#define S24 20
-  GG(a, b, c, d, in[1], S21, 4129170786u);  /* 17 */
-  GG(d, a, b, c, in[6], S22, 3225465664u);  /* 18 */
-  GG(c, d, a, b, in[11], S23, 643717713u);  /* 19 */
-  GG(b, c, d, a, in[0], S24, 3921069994u);  /* 20 */
-  GG(a, b, c, d, in[5], S21, 3593408605u);  /* 21 */
-  GG(d, a, b, c, in[10], S22, 38016083u);   /* 22 */
-  GG(c, d, a, b, in[15], S23, 3634488961u); /* 23 */
-  GG(b, c, d, a, in[4], S24, 3889429448u);  /* 24 */
-  GG(a, b, c, d, in[9], S21, 568446438u);   /* 25 */
-  GG(d, a, b, c, in[14], S22, 3275163606u); /* 26 */
-  GG(c, d, a, b, in[3], S23, 4107603335u);  /* 27 */
-  GG(b, c, d, a, in[8], S24, 1163531501u);  /* 28 */
-  GG(a, b, c, d, in[13], S21, 2850285829u); /* 29 */
-  GG(d, a, b, c, in[2], S22, 4243563512u);  /* 30 */
-  GG(c, d, a, b, in[7], S23, 1735328473u);  /* 31 */
-  GG(b, c, d, a, in[12], S24, 2368359562u); /* 32 */
-
-  /*
-   * Round 3
-   */
-#define S31 4
-#define S32 11
-#define S33 16
-#define S34 23
-  HH(a, b, c, d, in[5], S31, 4294588738u);  /* 33 */
-  HH(d, a, b, c, in[8], S32, 2272392833u);  /* 34 */
-  HH(c, d, a, b, in[11], S33, 1839030562u); /* 35 */
-  HH(b, c, d, a, in[14], S34, 4259657740u); /* 36 */
-  HH(a, b, c, d, in[1], S31, 2763975236u);  /* 37 */
-  HH(d, a, b, c, in[4], S32, 1272893353u);  /* 38 */
-  HH(c, d, a, b, in[7], S33, 4139469664u);  /* 39 */
-  HH(b, c, d, a, in[10], S34, 3200236656u); /* 40 */
-  HH(a, b, c, d, in[13], S31, 681279174u);  /* 41 */
-  HH(d, a, b, c, in[0], S32, 3936430074u);  /* 42 */
-  HH(c, d, a, b, in[3], S33, 3572445317u);  /* 43 */
-  HH(b, c, d, a, in[6], S34, 76029189u);    /* 44 */
-  HH(a, b, c, d, in[9], S31, 3654602809u);  /* 45 */
-  HH(d, a, b, c, in[12], S32, 3873151461u); /* 46 */
-  HH(c, d, a, b, in[15], S33, 530742520u);  /* 47 */
-  HH(b, c, d, a, in[2], S34, 3299628645u);  /* 48 */
-
-  /*
-   * Round 4
-   */
-#define S41 6
-#define S42 10
-#define S43 15
-#define S44 21
-  II(a, b, c, d, in[0], S41, 4096336452u);  /* 49 */
-  II(d, a, b, c, in[7], S42, 1126891415u);  /* 50 */
-  II(c, d, a, b, in[14], S43, 2878612391u); /* 51 */
-  II(b, c, d, a, in[5], S44, 4237533241u);  /* 52 */
-  II(a, b, c, d, in[12], S41, 1700485571u); /* 53 */
-  II(d, a, b, c, in[3], S42, 2399980690u);  /* 54 */
-  II(c, d, a, b, in[10], S43, 4293915773u); /* 55 */
-  II(b, c, d, a, in[1], S44, 2240044497u);  /* 56 */
-  II(a, b, c, d, in[8], S41, 1873313359u);  /* 57 */
-  II(d, a, b, c, in[15], S42, 4264355552u); /* 58 */
-  II(c, d, a, b, in[6], S43, 2734768916u);  /* 59 */
-  II(b, c, d, a, in[13], S44, 1309151649u); /* 60 */
-  II(a, b, c, d, in[4], S41, 4149444226u);  /* 61 */
-  II(d, a, b, c, in[11], S42, 3174756917u); /* 62 */
-  II(c, d, a, b, in[2], S43, 718787259u);   /* 63 */
-  II(b, c, d, a, in[9], S44, 3951481745u);  /* 64 */
-
-  buf[0] += a;
-  buf[1] += b;
-  buf[2] += c;
-  buf[3] += d;
-}
diff --git a/deps/SDL2/src/test/SDL_test_random.c b/deps/SDL2/src/test/SDL_test_random.c
deleted file mode 100644
index 2c70dbd..0000000
--- a/deps/SDL2/src/test/SDL_test_random.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-
- A portable "32-bit Multiply with carry" random number generator.
-
- Used by the fuzzer component.
- Original source code contributed by A. Schiffler for GSOC project.
-
-*/
-
-#include "SDL_config.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-
-#include "SDL_test.h"
-
-/* Initialize random number generator with two integer variables */
-
-void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, unsigned int ci)
-{
-  if (rndContext==NULL) return;
-
-  /*
-   * Choose a value for 'a' from this list
-   * 1791398085 1929682203 1683268614 1965537969 1675393560
-   * 1967773755 1517746329 1447497129 1655692410 1606218150
-   * 2051013963 1075433238 1557985959 1781943330 1893513180
-   * 1631296680 2131995753 2083801278 1873196400 1554115554
-   */
-  rndContext->a = 1655692410;
-  rndContext->x = 30903;
-  rndContext->c = 0;
-  if (xi != 0) {
-      rndContext->x = xi;
-  }
-  rndContext->c = ci;
-  rndContext->ah = rndContext->a >> 16;
-  rndContext->al = rndContext->a & 65535;
-}
-
-/* Initialize random number generator from system time */
-
-void SDLTest_RandomInitTime(SDLTest_RandomContext * rndContext)
-{
-  int a, b;
-
-  if (rndContext==NULL) return;
-
-  srand((unsigned int)time(NULL));
-  a=rand();
-  srand(clock());
-  b=rand();
-  SDLTest_RandomInit(rndContext, a, b);
-}
-
-/* Returns random numbers */
-
-unsigned int SDLTest_Random(SDLTest_RandomContext * rndContext)
-{
-  unsigned int xh, xl;
-
-  if (rndContext==NULL) return -1;
-
-  xh = rndContext->x >> 16, xl = rndContext->x & 65535;
-  rndContext->x = rndContext->x * rndContext->a + rndContext->c;
-  rndContext->c =
-    xh * rndContext->ah + ((xh * rndContext->al) >> 16) +
-    ((xl * rndContext->ah) >> 16);
-  if (xl * rndContext->al >= (~rndContext->c + 1))
-    rndContext->c++;
-  return (rndContext->x);
-}
diff --git a/deps/SDL2/src/thread/SDL_systhread.h b/deps/SDL2/src/thread/SDL_systhread.h
deleted file mode 100644
index 36898f3..0000000
--- a/deps/SDL2/src/thread/SDL_systhread.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* These are functions that need to be implemented by a port of SDL */
-
-#ifndef _SDL_systhread_h
-#define _SDL_systhread_h
-
-#include "SDL_thread.h"
-#include "SDL_thread_c.h"
-
-/* This function creates a thread, passing args to SDL_RunThread(),
-   saves a system-dependent thread id in thread->id, and returns 0
-   on success.
-*/
-#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-extern int SDL_SYS_CreateThread(SDL_Thread * thread, void *args,
-                                pfnSDL_CurrentBeginThread pfnBeginThread,
-                                pfnSDL_CurrentEndThread pfnEndThread);
-#else
-extern int SDL_SYS_CreateThread(SDL_Thread * thread, void *args);
-#endif
-
-/* This function does any necessary setup in the child thread */
-extern void SDL_SYS_SetupThread(const char *name);
-
-/* This function sets the current thread priority */
-extern int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority);
-
-/* This function waits for the thread to finish and frees any data
-   allocated by SDL_SYS_CreateThread()
- */
-extern void SDL_SYS_WaitThread(SDL_Thread * thread);
-
-/* Get the thread local storage for this thread */
-extern SDL_TLSData *SDL_SYS_GetTLSData();
-
-/* Set the thread local storage for this thread */
-extern int SDL_SYS_SetTLSData(SDL_TLSData *data);
-
-#endif /* _SDL_systhread_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/SDL_thread.c b/deps/SDL2/src/thread/SDL_thread.c
deleted file mode 100644
index 4b070da..0000000
--- a/deps/SDL2/src/thread/SDL_thread.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* System independent thread management routines for SDL */
-
-#include "SDL_thread.h"
-#include "SDL_thread_c.h"
-#include "SDL_systhread.h"
-#include "../SDL_error_c.h"
-
-
-SDL_TLSID
-SDL_TLSCreate()
-{
-    static SDL_atomic_t SDL_tls_id;
-    return SDL_AtomicIncRef(&SDL_tls_id)+1;
-}
-
-void *
-SDL_TLSGet(SDL_TLSID id)
-{
-    SDL_TLSData *storage;
-
-    storage = SDL_SYS_GetTLSData();
-    if (!storage || id == 0 || id > storage->limit) {
-        return NULL;
-    }
-    return storage->array[id-1].data;
-}
-
-int
-SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void *))
-{
-    SDL_TLSData *storage;
-
-    if (id == 0) {
-        return SDL_InvalidParamError("id");
-    }
-
-    storage = SDL_SYS_GetTLSData();
-    if (!storage || (id > storage->limit)) {
-        unsigned int i, oldlimit, newlimit;
-
-        oldlimit = storage ? storage->limit : 0;
-        newlimit = (id + TLS_ALLOC_CHUNKSIZE);
-        storage = (SDL_TLSData *)SDL_realloc(storage, sizeof(*storage)+(newlimit-1)*sizeof(storage->array[0]));
-        if (!storage) {
-            return SDL_OutOfMemory();
-        }
-        storage->limit = newlimit;
-        for (i = oldlimit; i < newlimit; ++i) {
-            storage->array[i].data = NULL;
-            storage->array[i].destructor = NULL;
-        }
-        if (SDL_SYS_SetTLSData(storage) != 0) {
-            return -1;
-        }
-    }
-
-    storage->array[id-1].data = SDL_const_cast(void*, value);
-    storage->array[id-1].destructor = destructor;
-    return 0;
-}
-
-static void
-SDL_TLSCleanup()
-{
-    SDL_TLSData *storage;
-
-    storage = SDL_SYS_GetTLSData();
-    if (storage) {
-        unsigned int i;
-        for (i = 0; i < storage->limit; ++i) {
-            if (storage->array[i].destructor) {
-                storage->array[i].destructor(storage->array[i].data);
-            }
-        }
-        SDL_SYS_SetTLSData(NULL);
-        SDL_free(storage);
-    }
-}
-
-
-/* This is a generic implementation of thread-local storage which doesn't
-   require additional OS support.
-
-   It is not especially efficient and doesn't clean up thread-local storage
-   as threads exit.  If there is a real OS that doesn't support thread-local
-   storage this implementation should be improved to be production quality.
-*/
-
-typedef struct SDL_TLSEntry {
-    SDL_threadID thread;
-    SDL_TLSData *storage;
-    struct SDL_TLSEntry *next;
-} SDL_TLSEntry;
-
-static SDL_mutex *SDL_generic_TLS_mutex;
-static SDL_TLSEntry *SDL_generic_TLS;
-
-
-SDL_TLSData *
-SDL_Generic_GetTLSData()
-{
-    SDL_threadID thread = SDL_ThreadID();
-    SDL_TLSEntry *entry;
-    SDL_TLSData *storage = NULL;
-
-#if !SDL_THREADS_DISABLED
-    if (!SDL_generic_TLS_mutex) {
-        static SDL_SpinLock tls_lock;
-        SDL_AtomicLock(&tls_lock);
-        if (!SDL_generic_TLS_mutex) {
-            SDL_mutex *mutex = SDL_CreateMutex();
-            SDL_MemoryBarrierRelease();
-            SDL_generic_TLS_mutex = mutex;
-            if (!SDL_generic_TLS_mutex) {
-                SDL_AtomicUnlock(&tls_lock);
-                return NULL;
-            }
-        }
-        SDL_AtomicUnlock(&tls_lock);
-    }
-#endif /* SDL_THREADS_DISABLED */
-
-    SDL_MemoryBarrierAcquire();
-    SDL_LockMutex(SDL_generic_TLS_mutex);
-    for (entry = SDL_generic_TLS; entry; entry = entry->next) {
-        if (entry->thread == thread) {
-            storage = entry->storage;
-            break;
-        }
-    }
-#if !SDL_THREADS_DISABLED
-    SDL_UnlockMutex(SDL_generic_TLS_mutex);
-#endif
-
-    return storage;
-}
-
-int
-SDL_Generic_SetTLSData(SDL_TLSData *storage)
-{
-    SDL_threadID thread = SDL_ThreadID();
-    SDL_TLSEntry *prev, *entry;
-
-    /* SDL_Generic_GetTLSData() is always called first, so we can assume SDL_generic_TLS_mutex */
-    SDL_LockMutex(SDL_generic_TLS_mutex);
-    prev = NULL;
-    for (entry = SDL_generic_TLS; entry; entry = entry->next) {
-        if (entry->thread == thread) {
-            if (storage) {
-                entry->storage = storage;
-            } else {
-                if (prev) {
-                    prev->next = entry->next;
-                } else {
-                    SDL_generic_TLS = entry->next;
-                }
-                SDL_free(entry);
-            }
-            break;
-        }
-        prev = entry;
-    }
-    if (!entry) {
-        entry = (SDL_TLSEntry *)SDL_malloc(sizeof(*entry));
-        if (entry) {
-            entry->thread = thread;
-            entry->storage = storage;
-            entry->next = SDL_generic_TLS;
-            SDL_generic_TLS = entry;
-        }
-    }
-    SDL_UnlockMutex(SDL_generic_TLS_mutex);
-
-    if (!entry) {
-        return SDL_OutOfMemory();
-    }
-    return 0;
-}
-
-/* Routine to get the thread-specific error variable */
-SDL_error *
-SDL_GetErrBuf(void)
-{
-    static SDL_SpinLock tls_lock;
-    static SDL_bool tls_being_created;
-    static SDL_TLSID tls_errbuf;
-    static SDL_error SDL_global_errbuf;
-    const SDL_error *ALLOCATION_IN_PROGRESS = (SDL_error *)-1;
-    SDL_error *errbuf;
-
-    /* tls_being_created is there simply to prevent recursion if SDL_TLSCreate() fails.
-       It also means it's possible for another thread to also use SDL_global_errbuf,
-       but that's very unlikely and hopefully won't cause issues.
-     */
-    if (!tls_errbuf && !tls_being_created) {
-        SDL_AtomicLock(&tls_lock);
-        if (!tls_errbuf) {
-            SDL_TLSID slot;
-            tls_being_created = SDL_TRUE;
-            slot = SDL_TLSCreate();
-            tls_being_created = SDL_FALSE;
-            SDL_MemoryBarrierRelease();
-            tls_errbuf = slot;
-        }
-        SDL_AtomicUnlock(&tls_lock);
-    }
-    if (!tls_errbuf) {
-        return &SDL_global_errbuf;
-    }
-
-    SDL_MemoryBarrierAcquire();
-    errbuf = (SDL_error *)SDL_TLSGet(tls_errbuf);
-    if (errbuf == ALLOCATION_IN_PROGRESS) {
-        return &SDL_global_errbuf;
-    }
-    if (!errbuf) {
-        /* Mark that we're in the middle of allocating our buffer */
-        SDL_TLSSet(tls_errbuf, ALLOCATION_IN_PROGRESS, NULL);
-        errbuf = (SDL_error *)SDL_malloc(sizeof(*errbuf));
-        if (!errbuf) {
-            SDL_TLSSet(tls_errbuf, NULL, NULL);
-            return &SDL_global_errbuf;
-        }
-        SDL_zerop(errbuf);
-        SDL_TLSSet(tls_errbuf, errbuf, SDL_free);
-    }
-    return errbuf;
-}
-
-
-/* Arguments and callback to setup and run the user thread function */
-typedef struct
-{
-    int (SDLCALL * func) (void *);
-    void *data;
-    SDL_Thread *info;
-    SDL_sem *wait;
-} thread_args;
-
-void
-SDL_RunThread(void *data)
-{
-    thread_args *args = (thread_args *) data;
-    int (SDLCALL * userfunc) (void *) = args->func;
-    void *userdata = args->data;
-    int *statusloc = &args->info->status;
-
-    /* Perform any system-dependent setup - this function may not fail */
-    SDL_SYS_SetupThread(args->info->name);
-
-    /* Get the thread id */
-    args->info->threadid = SDL_ThreadID();
-
-    /* Wake up the parent thread */
-    SDL_SemPost(args->wait);
-
-    /* Run the function */
-    *statusloc = userfunc(userdata);
-
-    /* Clean up thread-local storage */
-    SDL_TLSCleanup();
-}
-
-#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-#undef SDL_CreateThread
-DECLSPEC SDL_Thread *SDLCALL
-SDL_CreateThread(int (SDLCALL * fn) (void *),
-                 const char *name, void *data,
-                 pfnSDL_CurrentBeginThread pfnBeginThread,
-                 pfnSDL_CurrentEndThread pfnEndThread)
-#else
-DECLSPEC SDL_Thread *SDLCALL
-SDL_CreateThread(int (SDLCALL * fn) (void *),
-                 const char *name, void *data)
-#endif
-{
-    SDL_Thread *thread;
-    thread_args *args;
-    int ret;
-
-    /* Allocate memory for the thread info structure */
-    thread = (SDL_Thread *) SDL_malloc(sizeof(*thread));
-    if (thread == NULL) {
-        SDL_OutOfMemory();
-        return (NULL);
-    }
-    SDL_memset(thread, 0, (sizeof *thread));
-    thread->status = -1;
-
-    /* Set up the arguments for the thread */
-    if (name != NULL) {
-        thread->name = SDL_strdup(name);
-        if (thread->name == NULL) {
-            SDL_OutOfMemory();
-            SDL_free(thread);
-            return (NULL);
-        }
-    }
-
-    /* Set up the arguments for the thread */
-    args = (thread_args *) SDL_malloc(sizeof(*args));
-    if (args == NULL) {
-        SDL_OutOfMemory();
-        if (thread->name) {
-            SDL_free(thread->name);
-        }
-        SDL_free(thread);
-        return (NULL);
-    }
-    args->func = fn;
-    args->data = data;
-    args->info = thread;
-    args->wait = SDL_CreateSemaphore(0);
-    if (args->wait == NULL) {
-        if (thread->name) {
-            SDL_free(thread->name);
-        }
-        SDL_free(thread);
-        SDL_free(args);
-        return (NULL);
-    }
-
-    /* Create the thread and go! */
-#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-    ret = SDL_SYS_CreateThread(thread, args, pfnBeginThread, pfnEndThread);
-#else
-    ret = SDL_SYS_CreateThread(thread, args);
-#endif
-    if (ret >= 0) {
-        /* Wait for the thread function to use arguments */
-        SDL_SemWait(args->wait);
-    } else {
-        /* Oops, failed.  Gotta free everything */
-        if (thread->name) {
-            SDL_free(thread->name);
-        }
-        SDL_free(thread);
-        thread = NULL;
-    }
-    SDL_DestroySemaphore(args->wait);
-    SDL_free(args);
-
-    /* Everything is running now */
-    return (thread);
-}
-
-SDL_threadID
-SDL_GetThreadID(SDL_Thread * thread)
-{
-    SDL_threadID id;
-
-    if (thread) {
-        id = thread->threadid;
-    } else {
-        id = SDL_ThreadID();
-    }
-    return id;
-}
-
-const char *
-SDL_GetThreadName(SDL_Thread * thread)
-{
-    if (thread) {
-        return thread->name;
-    } else {
-        return NULL;
-    }
-}
-
-int
-SDL_SetThreadPriority(SDL_ThreadPriority priority)
-{
-    return SDL_SYS_SetThreadPriority(priority);
-}
-
-void
-SDL_WaitThread(SDL_Thread * thread, int *status)
-{
-    if (thread) {
-        SDL_SYS_WaitThread(thread);
-        if (status) {
-            *status = thread->status;
-        }
-        if (thread->name) {
-            SDL_free(thread->name);
-        }
-        SDL_free(thread);
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/SDL_thread_c.h b/deps/SDL2/src/thread/SDL_thread_c.h
deleted file mode 100644
index c7b063e..0000000
--- a/deps/SDL2/src/thread/SDL_thread_c.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_thread_c_h
-#define _SDL_thread_c_h
-
-#include "SDL_thread.h"
-
-/* Need the definitions of SYS_ThreadHandle */
-#if SDL_THREADS_DISABLED
-#include "generic/SDL_systhread_c.h"
-#elif SDL_THREAD_BEOS
-#include "beos/SDL_systhread_c.h"
-#elif SDL_THREAD_EPOC
-#include "epoc/SDL_systhread_c.h"
-#elif SDL_THREAD_PTHREAD
-#include "pthread/SDL_systhread_c.h"
-#elif SDL_THREAD_WINDOWS
-#include "windows/SDL_systhread_c.h"
-#elif SDL_THREAD_PSP
-#include "psp/SDL_systhread_c.h"
-#else
-#error Need thread implementation for this platform
-#include "generic/SDL_systhread_c.h"
-#endif
-#include "../SDL_error_c.h"
-
-/* This is the system-independent thread info structure */
-struct SDL_Thread
-{
-    SDL_threadID threadid;
-    SYS_ThreadHandle handle;
-    int status;
-    SDL_error errbuf;
-    char *name;
-    void *data;
-};
-
-/* This is the function called to run a thread */
-extern void SDL_RunThread(void *data);
-
-/* This is the system-independent thread local storage structure */
-typedef struct {
-    unsigned int limit;
-    struct {
-        void *data;
-        void (*destructor)(void*);
-    } array[1];
-} SDL_TLSData;
-
-/* This is how many TLS entries we allocate at once */
-#define TLS_ALLOC_CHUNKSIZE 4
-
-/* Get cross-platform, slow, thread local storage for this thread.
-   This is only intended as a fallback if getting real thread-local
-   storage fails or isn't supported on this platform.
- */
-extern SDL_TLSData *SDL_Generic_GetTLSData();
-
-/* Set cross-platform, slow, thread local storage for this thread.
-   This is only intended as a fallback if getting real thread-local
-   storage fails or isn't supported on this platform.
- */
-extern int SDL_Generic_SetTLSData(SDL_TLSData *data);
-
-#endif /* _SDL_thread_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/beos/SDL_syssem.c b/deps/SDL2/src/thread/beos/SDL_syssem.c
deleted file mode 100644
index 9661f90..0000000
--- a/deps/SDL2/src/thread/beos/SDL_syssem.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_THREAD_BEOS
-
-/* Semaphores in the BeOS environment */
-
-#include <be/kernel/OS.h>
-
-#include "SDL_thread.h"
-
-
-struct SDL_semaphore
-{
-    sem_id id;
-};
-
-/* Create a counting semaphore */
-SDL_sem *
-SDL_CreateSemaphore(Uint32 initial_value)
-{
-    SDL_sem *sem;
-
-    sem = (SDL_sem *) SDL_malloc(sizeof(*sem));
-    if (sem) {
-        sem->id = create_sem(initial_value, "SDL semaphore");
-        if (sem->id < B_NO_ERROR) {
-            SDL_SetError("create_sem() failed");
-            SDL_free(sem);
-            sem = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return (sem);
-}
-
-/* Free the semaphore */
-void
-SDL_DestroySemaphore(SDL_sem * sem)
-{
-    if (sem) {
-        if (sem->id >= B_NO_ERROR) {
-            delete_sem(sem->id);
-        }
-        SDL_free(sem);
-    }
-}
-
-int
-SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
-{
-    int32 val;
-    int retval;
-
-    if (!sem) {
-        return SDL_SetError("Passed a NULL semaphore");
-    }
-
-  tryagain:
-    if (timeout == SDL_MUTEX_MAXWAIT) {
-        val = acquire_sem(sem->id);
-    } else {
-        timeout *= 1000;        /* BeOS uses a timeout in microseconds */
-        val = acquire_sem_etc(sem->id, 1, B_RELATIVE_TIMEOUT, timeout);
-    }
-    switch (val) {
-    case B_INTERRUPTED:
-        goto tryagain;
-    case B_NO_ERROR:
-        retval = 0;
-        break;
-    case B_TIMED_OUT:
-        retval = SDL_MUTEX_TIMEDOUT;
-        break;
-    case B_WOULD_BLOCK:
-        retval = SDL_MUTEX_TIMEDOUT;
-        break;
-    default:
-        retval = SDL_SetError("acquire_sem() failed");
-        break;
-    }
-
-    return retval;
-}
-
-int
-SDL_SemTryWait(SDL_sem * sem)
-{
-    return SDL_SemWaitTimeout(sem, 0);
-}
-
-int
-SDL_SemWait(SDL_sem * sem)
-{
-    return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
-}
-
-/* Returns the current count of the semaphore */
-Uint32
-SDL_SemValue(SDL_sem * sem)
-{
-    int32 count;
-    Uint32 value;
-
-    value = 0;
-    if (sem) {
-        get_sem_count(sem->id, &count);
-        if (count > 0) {
-            value = (Uint32) count;
-        }
-    }
-    return value;
-}
-
-/* Atomically increases the semaphore's count (not blocking) */
-int
-SDL_SemPost(SDL_sem * sem)
-{
-    if (!sem) {
-        return SDL_SetError("Passed a NULL semaphore");
-    }
-
-    if (release_sem(sem->id) != B_NO_ERROR) {
-        return SDL_SetError("release_sem() failed");
-    }
-    return 0;
-}
-
-#endif /* SDL_THREAD_BEOS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/beos/SDL_systhread.c b/deps/SDL2/src/thread/beos/SDL_systhread.c
deleted file mode 100644
index 11646f9..0000000
--- a/deps/SDL2/src/thread/beos/SDL_systhread.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_THREAD_BEOS
-
-/* BeOS thread management routines for SDL */
-
-#include <stdio.h>
-#include <signal.h>
-#include <be/kernel/OS.h>
-
-#include "SDL_mutex.h"
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-
-
-static int sig_list[] = {
-    SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0
-};
-
-void
-SDL_MaskSignals(sigset_t * omask)
-{
-    sigset_t mask;
-    int i;
-
-    sigemptyset(&mask);
-    for (i = 0; sig_list[i]; ++i) {
-        sigaddset(&mask, sig_list[i]);
-    }
-    sigprocmask(SIG_BLOCK, &mask, omask);
-}
-
-void
-SDL_UnmaskSignals(sigset_t * omask)
-{
-    sigprocmask(SIG_SETMASK, omask, NULL);
-}
-
-static int32
-RunThread(void *data)
-{
-    SDL_RunThread(data);
-    return (0);
-}
-
-int
-SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
-{
-    /* The docs say the thread name can't be longer than B_OS_NAME_LENGTH. */
-    const char *threadname = thread->name ? thread->name : "SDL Thread";
-    char name[B_OS_NAME_LENGTH];
-    SDL_snprintf(name, sizeof (name), "%s", threadname);
-    name[sizeof (name) - 1] = '\0';
-
-    /* Create the thread and go! */
-    thread->handle = spawn_thread(RunThread, name, B_NORMAL_PRIORITY, args);
-    if ((thread->handle == B_NO_MORE_THREADS) ||
-        (thread->handle == B_NO_MEMORY)) {
-        return SDL_SetError("Not enough resources to create thread");
-    }
-    resume_thread(thread->handle);
-    return (0);
-}
-
-void
-SDL_SYS_SetupThread(const char *name)
-{
-    /* We set the thread name during SDL_SYS_CreateThread(). */
-    /* Mask asynchronous signals for this thread */
-    SDL_MaskSignals(NULL);
-}
-
-SDL_threadID
-SDL_ThreadID(void)
-{
-    return ((SDL_threadID) find_thread(NULL));
-}
-
-int
-SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
-{
-    int32 value;
-
-    if (priority == SDL_THREAD_PRIORITY_LOW) {
-        value = B_LOW_PRIORITY;
-    } else if (priority == SDL_THREAD_PRIORITY_HIGH) {
-        value = B_URGENT_DISPLAY_PRIORITY;
-    } else {
-        value = B_NORMAL_PRIORITY;
-    }
-    set_thread_priority(find_thread(NULL), value);
-    return 0;
-}
-
-void
-SDL_SYS_WaitThread(SDL_Thread * thread)
-{
-    status_t the_status;
-
-    wait_for_thread(thread->handle, &the_status);
-}
-
-#endif /* SDL_THREAD_BEOS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/beos/SDL_systhread_c.h b/deps/SDL2/src/thread/beos/SDL_systhread_c.h
deleted file mode 100644
index a350ab5..0000000
--- a/deps/SDL2/src/thread/beos/SDL_systhread_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include <signal.h>
-#include <be/kernel/OS.h>
-
-typedef thread_id SYS_ThreadHandle;
-
-/* Functions needed to work with system threads in other portions of SDL */
-extern void SDL_MaskSignals(sigset_t * omask);
-extern void SDL_UnmaskSignals(sigset_t * omask);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/beos/SDL_systls.c b/deps/SDL2/src/thread/beos/SDL_systls.c
deleted file mode 100644
index 8e94128..0000000
--- a/deps/SDL2/src/thread/beos/SDL_systls.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-
-#if SDL_THREAD_BEOS
-
-#include <support/TLS.h>
-
-
-static int32 thread_local_storage = B_NO_MEMORY;
-static SDL_bool generic_local_storage = SDL_FALSE;
-
-SDL_TLSData *
-SDL_SYS_GetTLSData()
-{
-    if (thread_local_storage == B_NO_MEMORY && !generic_local_storage) {
-        static SDL_SpinLock lock;
-        SDL_AtomicLock(&lock);
-        if (thread_local_storage == B_NO_MEMORY && !generic_local_storage) {
-            int32 storage = tls_allocate();
-            if (storage != B_NO_MEMORY) {
-                SDL_MemoryBarrierRelease();
-                thread_local_storage = storage;
-            } else {
-                generic_local_storage = SDL_TRUE;
-            }
-        }
-        SDL_AtomicUnlock(&lock);
-    }
-    if (generic_local_storage) {
-        return SDL_Generic_GetTLSData();
-    }
-    SDL_MemoryBarrierAcquire();
-    return (SDL_TLSData *)tls_get(thread_local_storage);
-}
-
-int
-SDL_SYS_SetTLSData(SDL_TLSData *data)
-{
-    if (generic_local_storage) {
-        return SDL_Generic_SetTLSData(data);
-    }
-    tls_set(thread_local_storage, data);
-    return 0;
-}
-
-#endif /* SDL_THREAD_BEOS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/generic/SDL_syscond.c b/deps/SDL2/src/thread/generic/SDL_syscond.c
deleted file mode 100644
index 5c8fe8b..0000000
--- a/deps/SDL2/src/thread/generic/SDL_syscond.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* An implementation of condition variables using semaphores and mutexes */
-/*
-   This implementation borrows heavily from the BeOS condition variable
-   implementation, written by Christopher Tate and Owen Smith.  Thanks!
- */
-
-#include "SDL_thread.h"
-
-struct SDL_cond
-{
-    SDL_mutex *lock;
-    int waiting;
-    int signals;
-    SDL_sem *wait_sem;
-    SDL_sem *wait_done;
-};
-
-/* Create a condition variable */
-SDL_cond *
-SDL_CreateCond(void)
-{
-    SDL_cond *cond;
-
-    cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
-    if (cond) {
-        cond->lock = SDL_CreateMutex();
-        cond->wait_sem = SDL_CreateSemaphore(0);
-        cond->wait_done = SDL_CreateSemaphore(0);
-        cond->waiting = cond->signals = 0;
-        if (!cond->lock || !cond->wait_sem || !cond->wait_done) {
-            SDL_DestroyCond(cond);
-            cond = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return (cond);
-}
-
-/* Destroy a condition variable */
-void
-SDL_DestroyCond(SDL_cond * cond)
-{
-    if (cond) {
-        if (cond->wait_sem) {
-            SDL_DestroySemaphore(cond->wait_sem);
-        }
-        if (cond->wait_done) {
-            SDL_DestroySemaphore(cond->wait_done);
-        }
-        if (cond->lock) {
-            SDL_DestroyMutex(cond->lock);
-        }
-        SDL_free(cond);
-    }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-int
-SDL_CondSignal(SDL_cond * cond)
-{
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    }
-
-    /* If there are waiting threads not already signalled, then
-       signal the condition and wait for the thread to respond.
-     */
-    SDL_LockMutex(cond->lock);
-    if (cond->waiting > cond->signals) {
-        ++cond->signals;
-        SDL_SemPost(cond->wait_sem);
-        SDL_UnlockMutex(cond->lock);
-        SDL_SemWait(cond->wait_done);
-    } else {
-        SDL_UnlockMutex(cond->lock);
-    }
-
-    return 0;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-int
-SDL_CondBroadcast(SDL_cond * cond)
-{
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    }
-
-    /* If there are waiting threads not already signalled, then
-       signal the condition and wait for the thread to respond.
-     */
-    SDL_LockMutex(cond->lock);
-    if (cond->waiting > cond->signals) {
-        int i, num_waiting;
-
-        num_waiting = (cond->waiting - cond->signals);
-        cond->signals = cond->waiting;
-        for (i = 0; i < num_waiting; ++i) {
-            SDL_SemPost(cond->wait_sem);
-        }
-        /* Now all released threads are blocked here, waiting for us.
-           Collect them all (and win fabulous prizes!) :-)
-         */
-        SDL_UnlockMutex(cond->lock);
-        for (i = 0; i < num_waiting; ++i) {
-            SDL_SemWait(cond->wait_done);
-        }
-    } else {
-        SDL_UnlockMutex(cond->lock);
-    }
-
-    return 0;
-}
-
-/* Wait on the condition variable for at most 'ms' milliseconds.
-   The mutex must be locked before entering this function!
-   The mutex is unlocked during the wait, and locked again after the wait.
-
-Typical use:
-
-Thread A:
-    SDL_LockMutex(lock);
-    while ( ! condition ) {
-        SDL_CondWait(cond, lock);
-    }
-    SDL_UnlockMutex(lock);
-
-Thread B:
-    SDL_LockMutex(lock);
-    ...
-    condition = true;
-    ...
-    SDL_CondSignal(cond);
-    SDL_UnlockMutex(lock);
- */
-int
-SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
-{
-    int retval;
-
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    }
-
-    /* Obtain the protection mutex, and increment the number of waiters.
-       This allows the signal mechanism to only perform a signal if there
-       are waiting threads.
-     */
-    SDL_LockMutex(cond->lock);
-    ++cond->waiting;
-    SDL_UnlockMutex(cond->lock);
-
-    /* Unlock the mutex, as is required by condition variable semantics */
-    SDL_UnlockMutex(mutex);
-
-    /* Wait for a signal */
-    if (ms == SDL_MUTEX_MAXWAIT) {
-        retval = SDL_SemWait(cond->wait_sem);
-    } else {
-        retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
-    }
-
-    /* Let the signaler know we have completed the wait, otherwise
-       the signaler can race ahead and get the condition semaphore
-       if we are stopped between the mutex unlock and semaphore wait,
-       giving a deadlock.  See the following URL for details:
-       http://web.archive.org/web/20010914175514/http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html#Workshop
-     */
-    SDL_LockMutex(cond->lock);
-    if (cond->signals > 0) {
-        /* If we timed out, we need to eat a condition signal */
-        if (retval > 0) {
-            SDL_SemWait(cond->wait_sem);
-        }
-        /* We always notify the signal thread that we are done */
-        SDL_SemPost(cond->wait_done);
-
-        /* Signal handshake complete */
-        --cond->signals;
-    }
-    --cond->waiting;
-    SDL_UnlockMutex(cond->lock);
-
-    /* Lock the mutex, as is required by condition variable semantics */
-    SDL_LockMutex(mutex);
-
-    return retval;
-}
-
-/* Wait on the condition variable forever */
-int
-SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
-{
-    return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/generic/SDL_sysmutex.c b/deps/SDL2/src/thread/generic/SDL_sysmutex.c
deleted file mode 100644
index 3e3c1fe..0000000
--- a/deps/SDL2/src/thread/generic/SDL_sysmutex.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* An implementation of mutexes using semaphores */
-
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-
-struct SDL_mutex
-{
-    int recursive;
-    SDL_threadID owner;
-    SDL_sem *sem;
-};
-
-/* Create a mutex */
-SDL_mutex *
-SDL_CreateMutex(void)
-{
-    SDL_mutex *mutex;
-
-    /* Allocate mutex memory */
-    mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex));
-    if (mutex) {
-        /* Create the mutex semaphore, with initial value 1 */
-        mutex->sem = SDL_CreateSemaphore(1);
-        mutex->recursive = 0;
-        mutex->owner = 0;
-        if (!mutex->sem) {
-            SDL_free(mutex);
-            mutex = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return mutex;
-}
-
-/* Free the mutex */
-void
-SDL_DestroyMutex(SDL_mutex * mutex)
-{
-    if (mutex) {
-        if (mutex->sem) {
-            SDL_DestroySemaphore(mutex->sem);
-        }
-        SDL_free(mutex);
-    }
-}
-
-/* Lock the mutex */
-int
-SDL_LockMutex(SDL_mutex * mutex)
-{
-#if SDL_THREADS_DISABLED
-    return 0;
-#else
-    SDL_threadID this_thread;
-
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-    this_thread = SDL_ThreadID();
-    if (mutex->owner == this_thread) {
-        ++mutex->recursive;
-    } else {
-        /* The order of operations is important.
-           We set the locking thread id after we obtain the lock
-           so unlocks from other threads will fail.
-         */
-        SDL_SemWait(mutex->sem);
-        mutex->owner = this_thread;
-        mutex->recursive = 0;
-    }
-
-    return 0;
-#endif /* SDL_THREADS_DISABLED */
-}
-
-/* try Lock the mutex */
-int
-SDL_TryLockMutex(SDL_mutex * mutex)
-{
-#if SDL_THREADS_DISABLED
-    return 0;
-#else
-    int retval = 0;
-    SDL_threadID this_thread;
-
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-    this_thread = SDL_ThreadID();
-    if (mutex->owner == this_thread) {
-        ++mutex->recursive;
-    } else {
-        /* The order of operations is important.
-         We set the locking thread id after we obtain the lock
-         so unlocks from other threads will fail.
-         */
-        retval = SDL_SemWait(mutex->sem);
-        if (retval == 0) {
-            mutex->owner = this_thread;
-            mutex->recursive = 0;
-        }
-    }
-
-    return retval;
-#endif /* SDL_THREADS_DISABLED */
-}
-
-/* Unlock the mutex */
-int
-SDL_mutexV(SDL_mutex * mutex)
-{
-#if SDL_THREADS_DISABLED
-    return 0;
-#else
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-    /* If we don't own the mutex, we can't unlock it */
-    if (SDL_ThreadID() != mutex->owner) {
-        return SDL_SetError("mutex not owned by this thread");
-    }
-
-    if (mutex->recursive) {
-        --mutex->recursive;
-    } else {
-        /* The order of operations is important.
-           First reset the owner so another thread doesn't lock
-           the mutex and set the ownership before we reset it,
-           then release the lock semaphore.
-         */
-        mutex->owner = 0;
-        SDL_SemPost(mutex->sem);
-    }
-    return 0;
-#endif /* SDL_THREADS_DISABLED */
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/generic/SDL_sysmutex_c.h b/deps/SDL2/src/thread/generic/SDL_sysmutex_c.h
deleted file mode 100644
index 8d6dbdc..0000000
--- a/deps/SDL2/src/thread/generic/SDL_sysmutex_c.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/generic/SDL_syssem.c b/deps/SDL2/src/thread/generic/SDL_syssem.c
deleted file mode 100644
index bfb011d..0000000
--- a/deps/SDL2/src/thread/generic/SDL_syssem.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* An implementation of semaphores using mutexes and condition variables */
-
-#include "SDL_timer.h"
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-
-#if SDL_THREADS_DISABLED
-
-SDL_sem *
-SDL_CreateSemaphore(Uint32 initial_value)
-{
-    SDL_SetError("SDL not built with thread support");
-    return (SDL_sem *) 0;
-}
-
-void
-SDL_DestroySemaphore(SDL_sem * sem)
-{
-}
-
-int
-SDL_SemTryWait(SDL_sem * sem)
-{
-    return SDL_SetError("SDL not built with thread support");
-}
-
-int
-SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
-{
-    return SDL_SetError("SDL not built with thread support");
-}
-
-int
-SDL_SemWait(SDL_sem * sem)
-{
-    return SDL_SetError("SDL not built with thread support");
-}
-
-Uint32
-SDL_SemValue(SDL_sem * sem)
-{
-    return 0;
-}
-
-int
-SDL_SemPost(SDL_sem * sem)
-{
-    return SDL_SetError("SDL not built with thread support");
-}
-
-#else
-
-struct SDL_semaphore
-{
-    Uint32 count;
-    Uint32 waiters_count;
-    SDL_mutex *count_lock;
-    SDL_cond *count_nonzero;
-};
-
-SDL_sem *
-SDL_CreateSemaphore(Uint32 initial_value)
-{
-    SDL_sem *sem;
-
-    sem = (SDL_sem *) SDL_malloc(sizeof(*sem));
-    if (!sem) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    sem->count = initial_value;
-    sem->waiters_count = 0;
-
-    sem->count_lock = SDL_CreateMutex();
-    sem->count_nonzero = SDL_CreateCond();
-    if (!sem->count_lock || !sem->count_nonzero) {
-        SDL_DestroySemaphore(sem);
-        return NULL;
-    }
-
-    return sem;
-}
-
-/* WARNING:
-   You cannot call this function when another thread is using the semaphore.
-*/
-void
-SDL_DestroySemaphore(SDL_sem * sem)
-{
-    if (sem) {
-        sem->count = 0xFFFFFFFF;
-        while (sem->waiters_count > 0) {
-            SDL_CondSignal(sem->count_nonzero);
-            SDL_Delay(10);
-        }
-        SDL_DestroyCond(sem->count_nonzero);
-        if (sem->count_lock) {
-            SDL_LockMutex(sem->count_lock);
-            SDL_UnlockMutex(sem->count_lock);
-            SDL_DestroyMutex(sem->count_lock);
-        }
-        SDL_free(sem);
-    }
-}
-
-int
-SDL_SemTryWait(SDL_sem * sem)
-{
-    int retval;
-
-    if (!sem) {
-        return SDL_SetError("Passed a NULL semaphore");
-    }
-
-    retval = SDL_MUTEX_TIMEDOUT;
-    SDL_LockMutex(sem->count_lock);
-    if (sem->count > 0) {
-        --sem->count;
-        retval = 0;
-    }
-    SDL_UnlockMutex(sem->count_lock);
-
-    return retval;
-}
-
-int
-SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
-{
-    int retval;
-
-    if (!sem) {
-        return SDL_SetError("Passed a NULL semaphore");
-    }
-
-    /* A timeout of 0 is an easy case */
-    if (timeout == 0) {
-        return SDL_SemTryWait(sem);
-    }
-
-    SDL_LockMutex(sem->count_lock);
-    ++sem->waiters_count;
-    retval = 0;
-    while ((sem->count == 0) && (retval != SDL_MUTEX_TIMEDOUT)) {
-        retval = SDL_CondWaitTimeout(sem->count_nonzero,
-                                     sem->count_lock, timeout);
-    }
-    --sem->waiters_count;
-    if (retval == 0) {
-        --sem->count;
-    }
-    SDL_UnlockMutex(sem->count_lock);
-
-    return retval;
-}
-
-int
-SDL_SemWait(SDL_sem * sem)
-{
-    return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
-}
-
-Uint32
-SDL_SemValue(SDL_sem * sem)
-{
-    Uint32 value;
-
-    value = 0;
-    if (sem) {
-        SDL_LockMutex(sem->count_lock);
-        value = sem->count;
-        SDL_UnlockMutex(sem->count_lock);
-    }
-    return value;
-}
-
-int
-SDL_SemPost(SDL_sem * sem)
-{
-    if (!sem) {
-        return SDL_SetError("Passed a NULL semaphore");
-    }
-
-    SDL_LockMutex(sem->count_lock);
-    if (sem->waiters_count > 0) {
-        SDL_CondSignal(sem->count_nonzero);
-    }
-    ++sem->count;
-    SDL_UnlockMutex(sem->count_lock);
-
-    return 0;
-}
-
-#endif /* SDL_THREADS_DISABLED */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/generic/SDL_systhread.c b/deps/SDL2/src/thread/generic/SDL_systhread.c
deleted file mode 100644
index 139f8ac..0000000
--- a/deps/SDL2/src/thread/generic/SDL_systhread.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Thread management routines for SDL */
-
-#include "SDL_thread.h"
-#include "../SDL_systhread.h"
-
-#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-int
-SDL_SYS_CreateThread(SDL_Thread * thread, void *args,
-                     pfnSDL_CurrentBeginThread pfnBeginThread,
-                     pfnSDL_CurrentEndThread pfnEndThread)
-#else
-int
-SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
-#endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */
-{
-    return SDL_SetError("Threads are not supported on this platform");
-}
-
-void
-SDL_SYS_SetupThread(const char *name)
-{
-    return;
-}
-
-SDL_threadID
-SDL_ThreadID(void)
-{
-    return (0);
-}
-
-int
-SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
-{
-    return (0);
-}
-
-void
-SDL_SYS_WaitThread(SDL_Thread * thread)
-{
-    return;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/generic/SDL_systhread_c.h b/deps/SDL2/src/thread/generic/SDL_systhread_c.h
deleted file mode 100644
index b6c99c9..0000000
--- a/deps/SDL2/src/thread/generic/SDL_systhread_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Stub until we implement threads on this platform */
-typedef int SYS_ThreadHandle;
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/generic/SDL_systls.c b/deps/SDL2/src/thread/generic/SDL_systls.c
deleted file mode 100644
index bdb83db..0000000
--- a/deps/SDL2/src/thread/generic/SDL_systls.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-#include "../SDL_thread_c.h"
-
-
-SDL_TLSData *
-SDL_SYS_GetTLSData()
-{
-    return SDL_Generic_GetTLSData();
-}
-
-int
-SDL_SYS_SetTLSData(SDL_TLSData *data)
-{
-    return SDL_Generic_SetTLSData(data);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/psp/SDL_syscond.c b/deps/SDL2/src/thread/psp/SDL_syscond.c
deleted file mode 100644
index f540cdd..0000000
--- a/deps/SDL2/src/thread/psp/SDL_syscond.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* An implementation of condition variables using semaphores and mutexes */
-/*
-   This implementation borrows heavily from the BeOS condition variable
-   implementation, written by Christopher Tate and Owen Smith.  Thanks!
- */
-
-#include "SDL_thread.h"
-
-struct SDL_cond
-{
-    SDL_mutex *lock;
-    int waiting;
-    int signals;
-    SDL_sem *wait_sem;
-    SDL_sem *wait_done;
-};
-
-/* Create a condition variable */
-SDL_cond *
-SDL_CreateCond(void)
-{
-    SDL_cond *cond;
-
-    cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
-    if (cond) {
-        cond->lock = SDL_CreateMutex();
-        cond->wait_sem = SDL_CreateSemaphore(0);
-        cond->wait_done = SDL_CreateSemaphore(0);
-        cond->waiting = cond->signals = 0;
-        if (!cond->lock || !cond->wait_sem || !cond->wait_done) {
-            SDL_DestroyCond(cond);
-            cond = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return (cond);
-}
-
-/* Destroy a condition variable */
-void
-SDL_DestroyCond(SDL_cond * cond)
-{
-    if (cond) {
-        if (cond->wait_sem) {
-            SDL_DestroySemaphore(cond->wait_sem);
-        }
-        if (cond->wait_done) {
-            SDL_DestroySemaphore(cond->wait_done);
-        }
-        if (cond->lock) {
-            SDL_DestroyMutex(cond->lock);
-        }
-        SDL_free(cond);
-    }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-int
-SDL_CondSignal(SDL_cond * cond)
-{
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    }
-
-    /* If there are waiting threads not already signalled, then
-       signal the condition and wait for the thread to respond.
-     */
-    SDL_LockMutex(cond->lock);
-    if (cond->waiting > cond->signals) {
-        ++cond->signals;
-        SDL_SemPost(cond->wait_sem);
-        SDL_UnlockMutex(cond->lock);
-        SDL_SemWait(cond->wait_done);
-    } else {
-        SDL_UnlockMutex(cond->lock);
-    }
-
-    return 0;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-int
-SDL_CondBroadcast(SDL_cond * cond)
-{
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    }
-
-    /* If there are waiting threads not already signalled, then
-       signal the condition and wait for the thread to respond.
-     */
-    SDL_LockMutex(cond->lock);
-    if (cond->waiting > cond->signals) {
-        int i, num_waiting;
-
-        num_waiting = (cond->waiting - cond->signals);
-        cond->signals = cond->waiting;
-        for (i = 0; i < num_waiting; ++i) {
-            SDL_SemPost(cond->wait_sem);
-        }
-        /* Now all released threads are blocked here, waiting for us.
-           Collect them all (and win fabulous prizes!) :-)
-         */
-        SDL_UnlockMutex(cond->lock);
-        for (i = 0; i < num_waiting; ++i) {
-            SDL_SemWait(cond->wait_done);
-        }
-    } else {
-        SDL_UnlockMutex(cond->lock);
-    }
-
-    return 0;
-}
-
-/* Wait on the condition variable for at most 'ms' milliseconds.
-   The mutex must be locked before entering this function!
-   The mutex is unlocked during the wait, and locked again after the wait.
-
-Typical use:
-
-Thread A:
-    SDL_LockMutex(lock);
-    while ( ! condition ) {
-        SDL_CondWait(cond, lock);
-    }
-    SDL_UnlockMutex(lock);
-
-Thread B:
-    SDL_LockMutex(lock);
-    ...
-    condition = true;
-    ...
-    SDL_CondSignal(cond);
-    SDL_UnlockMutex(lock);
- */
-int
-SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
-{
-    int retval;
-
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    }
-
-    /* Obtain the protection mutex, and increment the number of waiters.
-       This allows the signal mechanism to only perform a signal if there
-       are waiting threads.
-     */
-    SDL_LockMutex(cond->lock);
-    ++cond->waiting;
-    SDL_UnlockMutex(cond->lock);
-
-    /* Unlock the mutex, as is required by condition variable semantics */
-    SDL_UnlockMutex(mutex);
-
-    /* Wait for a signal */
-    if (ms == SDL_MUTEX_MAXWAIT) {
-        retval = SDL_SemWait(cond->wait_sem);
-    } else {
-        retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
-    }
-
-    /* Let the signaler know we have completed the wait, otherwise
-       the signaler can race ahead and get the condition semaphore
-       if we are stopped between the mutex unlock and semaphore wait,
-       giving a deadlock.  See the following URL for details:
-       http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html
-     */
-    SDL_LockMutex(cond->lock);
-    if (cond->signals > 0) {
-        /* If we timed out, we need to eat a condition signal */
-        if (retval > 0) {
-            SDL_SemWait(cond->wait_sem);
-        }
-        /* We always notify the signal thread that we are done */
-        SDL_SemPost(cond->wait_done);
-
-        /* Signal handshake complete */
-        --cond->signals;
-    }
-    --cond->waiting;
-    SDL_UnlockMutex(cond->lock);
-
-    /* Lock the mutex, as is required by condition variable semantics */
-    SDL_LockMutex(mutex);
-
-    return retval;
-}
-
-/* Wait on the condition variable forever */
-int
-SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
-{
-    return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/psp/SDL_sysmutex.c b/deps/SDL2/src/thread/psp/SDL_sysmutex.c
deleted file mode 100644
index 6bb68a2..0000000
--- a/deps/SDL2/src/thread/psp/SDL_sysmutex.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* An implementation of mutexes using semaphores */
-
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-
-struct SDL_mutex
-{
-    int recursive;
-    SDL_threadID owner;
-    SDL_sem *sem;
-};
-
-/* Create a mutex */
-SDL_mutex *
-SDL_CreateMutex(void)
-{
-    SDL_mutex *mutex;
-
-    /* Allocate mutex memory */
-    mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex));
-    if (mutex) {
-        /* Create the mutex semaphore, with initial value 1 */
-        mutex->sem = SDL_CreateSemaphore(1);
-        mutex->recursive = 0;
-        mutex->owner = 0;
-        if (!mutex->sem) {
-            SDL_free(mutex);
-            mutex = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return mutex;
-}
-
-/* Free the mutex */
-void
-SDL_DestroyMutex(SDL_mutex * mutex)
-{
-    if (mutex) {
-        if (mutex->sem) {
-            SDL_DestroySemaphore(mutex->sem);
-        }
-        SDL_free(mutex);
-    }
-}
-
-/* Lock the semaphore */
-int
-SDL_mutexP(SDL_mutex * mutex)
-{
-#if SDL_THREADS_DISABLED
-    return 0;
-#else
-    SDL_threadID this_thread;
-
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-    this_thread = SDL_ThreadID();
-    if (mutex->owner == this_thread) {
-        ++mutex->recursive;
-    } else {
-        /* The order of operations is important.
-           We set the locking thread id after we obtain the lock
-           so unlocks from other threads will fail.
-         */
-        SDL_SemWait(mutex->sem);
-        mutex->owner = this_thread;
-        mutex->recursive = 0;
-    }
-
-    return 0;
-#endif /* SDL_THREADS_DISABLED */
-}
-
-/* Unlock the mutex */
-int
-SDL_mutexV(SDL_mutex * mutex)
-{
-#if SDL_THREADS_DISABLED
-    return 0;
-#else
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-    /* If we don't own the mutex, we can't unlock it */
-    if (SDL_ThreadID() != mutex->owner) {
-        return SDL_SetError("mutex not owned by this thread");
-    }
-
-    if (mutex->recursive) {
-        --mutex->recursive;
-    } else {
-        /* The order of operations is important.
-           First reset the owner so another thread doesn't lock
-           the mutex and set the ownership before we reset it,
-           then release the lock semaphore.
-         */
-        mutex->owner = 0;
-        SDL_SemPost(mutex->sem);
-    }
-    return 0;
-#endif /* SDL_THREADS_DISABLED */
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/psp/SDL_sysmutex_c.h b/deps/SDL2/src/thread/psp/SDL_sysmutex_c.h
deleted file mode 100644
index 8d6dbdc..0000000
--- a/deps/SDL2/src/thread/psp/SDL_sysmutex_c.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/psp/SDL_syssem.c b/deps/SDL2/src/thread/psp/SDL_syssem.c
deleted file mode 100644
index 8eff409..0000000
--- a/deps/SDL2/src/thread/psp/SDL_syssem.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* Semaphore functions for the PSP. */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "SDL_error.h"
-#include "SDL_thread.h"
-
-#include <pspthreadman.h>
-#include <pspkerror.h>
-
-struct SDL_semaphore {
-    SceUID  semid;
-};
-
-
-/* Create a semaphore */
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
-    SDL_sem *sem;
-
-    sem = (SDL_sem *) malloc(sizeof(*sem));
-    if (sem != NULL) {
-        /* TODO: Figure out the limit on the maximum value. */
-        sem->semid = sceKernelCreateSema("SDL sema", 0, initial_value, 255, NULL);
-        if (sem->semid < 0) {
-            SDL_SetError("Couldn't create semaphore");
-            free(sem);
-            sem = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-
-    return sem;
-}
-
-/* Free the semaphore */
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
-    if (sem != NULL) {
-        if (sem->semid > 0) {
-            sceKernelDeleteSema(sem->semid);
-            sem->semid = 0;
-        }
-
-        free(sem);
-    }
-}
-
-/* TODO: This routine is a bit overloaded.
- * If the timeout is 0 then just poll the semaphore; if it's SDL_MUTEX_MAXWAIT, pass
- * NULL to sceKernelWaitSema() so that it waits indefinitely; and if the timeout
- * is specified, convert it to microseconds. */
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
-    Uint32 *pTimeout;
-       unsigned int res;
-
-    if (sem == NULL) {
-        SDL_SetError("Passed a NULL sem");
-        return 0;
-    }
-
-    if (timeout == 0) {
-        res = sceKernelPollSema(sem->semid, 1);
-        if (res < 0) {
-            return SDL_MUTEX_TIMEDOUT;
-        }
-        return 0;
-    }
-
-    if (timeout == SDL_MUTEX_MAXWAIT) {
-        pTimeout = NULL;
-    } else {
-        timeout *= 1000;  /* Convert to microseconds. */
-        pTimeout = &timeout;
-    }
-
-    res = sceKernelWaitSema(sem->semid, 1, pTimeout);
-       switch (res) {
-               case SCE_KERNEL_ERROR_OK:
-                       return 0;
-               case SCE_KERNEL_ERROR_WAIT_TIMEOUT:
-                       return SDL_MUTEX_TIMEDOUT;
-               default:
-                       return SDL_SetError("WaitForSingleObject() failed");
-    }
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
-    return SDL_SemWaitTimeout(sem, 0);
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
-    return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
-}
-
-/* Returns the current count of the semaphore */
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
-    SceKernelSemaInfo info;
-
-    if (sem == NULL) {
-        SDL_SetError("Passed a NULL sem");
-        return 0;
-    }
-
-    if (sceKernelReferSemaStatus(sem->semid, &info) >= 0) {
-        return info.currentCount;
-    }
-
-    return 0;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
-    int res;
-
-    if (sem == NULL) {
-        return SDL_SetError("Passed a NULL sem");
-    }
-
-    res = sceKernelSignalSema(sem->semid, 1);
-    if (res < 0) {
-        return SDL_SetError("sceKernelSignalSema() failed");
-    }
-
-    return 0;
-}
-
-/* vim: ts=4 sw=4
- */
diff --git a/deps/SDL2/src/thread/psp/SDL_systhread.c b/deps/SDL2/src/thread/psp/SDL_systhread.c
deleted file mode 100644
index 05a2341..0000000
--- a/deps/SDL2/src/thread/psp/SDL_systhread.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-/* PSP thread management routines for SDL */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "SDL_error.h"
-#include "SDL_thread.h"
-#include "../SDL_systhread.h"
-#include "../SDL_thread_c.h"
-#include <pspkerneltypes.h>
-#include <pspthreadman.h>
-
-
-static int ThreadEntry(SceSize args, void *argp)
-{
-    SDL_RunThread(*(void **) argp);
-    return 0;
-}
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
-    SceKernelThreadInfo status;
-    int priority = 32;
-
-    /* Set priority of new thread to the same as the current thread */
-    status.size = sizeof(SceKernelThreadInfo);
-    if (sceKernelReferThreadStatus(sceKernelGetThreadId(), &status) == 0) {
-        priority = status.currentPriority;
-    }
-
-    thread->handle = sceKernelCreateThread("SDL thread", ThreadEntry,
-                           priority, 0x8000,
-                           PSP_THREAD_ATTR_VFPU, NULL);
-    if (thread->handle < 0) {
-        return SDL_SetError("sceKernelCreateThread() failed");
-    }
-
-    sceKernelStartThread(thread->handle, 4, &args);
-    return 0;
-}
-
-void SDL_SYS_SetupThread(const char *name)
-{
-    /* Do nothing. */
-}
-
-SDL_threadID SDL_ThreadID(void)
-{
-    return (SDL_threadID) sceKernelGetThreadId();
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
-    sceKernelWaitThreadEnd(thread->handle, NULL);
-    sceKernelDeleteThread(thread->handle);
-}
-
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
-    sceKernelTerminateDeleteThread(thread->handle);
-}
-
-int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
-{
-    int value;
-
-    if (priority == SDL_THREAD_PRIORITY_LOW) {
-        value = 19;
-    } else if (priority == SDL_THREAD_PRIORITY_HIGH) {
-        value = -20;
-    } else {
-        value = 0;
-    }
-
-    return sceKernelChangeThreadPriority(sceKernelGetThreadId(),value);
-
-}
-
-/* vim: ts=4 sw=4
- */
diff --git a/deps/SDL2/src/thread/psp/SDL_systhread_c.h b/deps/SDL2/src/thread/psp/SDL_systhread_c.h
deleted file mode 100644
index a806ede..0000000
--- a/deps/SDL2/src/thread/psp/SDL_systhread_c.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include <pspkerneltypes.h>
-
-typedef SceUID SYS_ThreadHandle;
diff --git a/deps/SDL2/src/thread/pthread/SDL_syscond.c b/deps/SDL2/src/thread/pthread/SDL_syscond.c
deleted file mode 100644
index 1eb4f29..0000000
--- a/deps/SDL2/src/thread/pthread/SDL_syscond.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include <sys/time.h>
-#include <unistd.h>
-#include <errno.h>
-#include <pthread.h>
-
-#include "SDL_thread.h"
-#include "SDL_sysmutex_c.h"
-
-struct SDL_cond
-{
-    pthread_cond_t cond;
-};
-
-/* Create a condition variable */
-SDL_cond *
-SDL_CreateCond(void)
-{
-    SDL_cond *cond;
-
-    cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
-    if (cond) {
-        if (pthread_cond_init(&cond->cond, NULL) < 0) {
-            SDL_SetError("pthread_cond_init() failed");
-            SDL_free(cond);
-            cond = NULL;
-        }
-    }
-    return (cond);
-}
-
-/* Destroy a condition variable */
-void
-SDL_DestroyCond(SDL_cond * cond)
-{
-    if (cond) {
-        pthread_cond_destroy(&cond->cond);
-        SDL_free(cond);
-    }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-int
-SDL_CondSignal(SDL_cond * cond)
-{
-    int retval;
-
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    }
-
-    retval = 0;
-    if (pthread_cond_signal(&cond->cond) != 0) {
-        return SDL_SetError("pthread_cond_signal() failed");
-    }
-    return retval;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-int
-SDL_CondBroadcast(SDL_cond * cond)
-{
-    int retval;
-
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    }
-
-    retval = 0;
-    if (pthread_cond_broadcast(&cond->cond) != 0) {
-        return SDL_SetError("pthread_cond_broadcast() failed");
-    }
-    return retval;
-}
-
-int
-SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
-{
-    int retval;
-    struct timeval delta;
-    struct timespec abstime;
-
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    }
-
-    gettimeofday(&delta, NULL);
-
-    abstime.tv_sec = delta.tv_sec + (ms / 1000);
-    abstime.tv_nsec = (delta.tv_usec + (ms % 1000) * 1000) * 1000;
-    if (abstime.tv_nsec > 1000000000) {
-        abstime.tv_sec += 1;
-        abstime.tv_nsec -= 1000000000;
-    }
-
-  tryagain:
-    retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime);
-    switch (retval) {
-    case EINTR:
-        goto tryagain;
-        break;
-    case ETIMEDOUT:
-        retval = SDL_MUTEX_TIMEDOUT;
-        break;
-    case 0:
-        break;
-    default:
-        retval = SDL_SetError("pthread_cond_timedwait() failed");
-    }
-    return retval;
-}
-
-/* Wait on the condition variable, unlocking the provided mutex.
-   The mutex must be locked before entering this function!
- */
-int
-SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
-{
-    if (!cond) {
-        return SDL_SetError("Passed a NULL condition variable");
-    } else if (pthread_cond_wait(&cond->cond, &mutex->id) != 0) {
-        return SDL_SetError("pthread_cond_wait() failed");
-    }
-    return 0;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/pthread/SDL_sysmutex.c b/deps/SDL2/src/thread/pthread/SDL_sysmutex.c
deleted file mode 100644
index bd238da..0000000
--- a/deps/SDL2/src/thread/pthread/SDL_sysmutex.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#define _GNU_SOURCE
-#include <pthread.h>
-#include <errno.h>
-
-#include "SDL_thread.h"
-
-#if !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX && \
-    !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
-#define FAKE_RECURSIVE_MUTEX 1
-#endif
-
-struct SDL_mutex
-{
-    pthread_mutex_t id;
-#if FAKE_RECURSIVE_MUTEX
-    int recursive;
-    pthread_t owner;
-#endif
-};
-
-SDL_mutex *
-SDL_CreateMutex(void)
-{
-    SDL_mutex *mutex;
-    pthread_mutexattr_t attr;
-
-    /* Allocate the structure */
-    mutex = (SDL_mutex *) SDL_calloc(1, sizeof(*mutex));
-    if (mutex) {
-        pthread_mutexattr_init(&attr);
-#if SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
-        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-#elif SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
-        pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
-#else
-        /* No extra attributes necessary */
-#endif
-        if (pthread_mutex_init(&mutex->id, &attr) != 0) {
-            SDL_SetError("pthread_mutex_init() failed");
-            SDL_free(mutex);
-            mutex = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return (mutex);
-}
-
-void
-SDL_DestroyMutex(SDL_mutex * mutex)
-{
-    if (mutex) {
-        pthread_mutex_destroy(&mutex->id);
-        SDL_free(mutex);
-    }
-}
-
-/* Lock the mutex */
-int
-SDL_LockMutex(SDL_mutex * mutex)
-{
-#if FAKE_RECURSIVE_MUTEX
-    pthread_t this_thread;
-#endif
-
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-#if FAKE_RECURSIVE_MUTEX
-    this_thread = pthread_self();
-    if (mutex->owner == this_thread) {
-        ++mutex->recursive;
-    } else {
-        /* The order of operations is important.
-           We set the locking thread id after we obtain the lock
-           so unlocks from other threads will fail.
-         */
-        if (pthread_mutex_lock(&mutex->id) == 0) {
-            mutex->owner = this_thread;
-            mutex->recursive = 0;
-        } else {
-            return SDL_SetError("pthread_mutex_lock() failed");
-        }
-    }
-#else
-    if (pthread_mutex_lock(&mutex->id) < 0) {
-        return SDL_SetError("pthread_mutex_lock() failed");
-    }
-#endif
-    return 0;
-}
-
-int
-SDL_TryLockMutex(SDL_mutex * mutex)
-{
-    int retval;
-#if FAKE_RECURSIVE_MUTEX
-    pthread_t this_thread;
-#endif
-
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-    retval = 0;
-#if FAKE_RECURSIVE_MUTEX
-    this_thread = pthread_self();
-    if (mutex->owner == this_thread) {
-        ++mutex->recursive;
-    } else {
-        /* The order of operations is important.
-         We set the locking thread id after we obtain the lock
-         so unlocks from other threads will fail.
-         */
-        if (pthread_mutex_lock(&mutex->id) == 0) {
-            mutex->owner = this_thread;
-            mutex->recursive = 0;
-        } else if (errno == EBUSY) {
-            retval = SDL_MUTEX_TIMEDOUT;
-        } else {
-            retval = SDL_SetError("pthread_mutex_trylock() failed");
-        }
-    }
-#else
-    if (pthread_mutex_trylock(&mutex->id) != 0) {
-        if (errno == EBUSY) {
-            retval = SDL_MUTEX_TIMEDOUT;
-        } else {
-            retval = SDL_SetError("pthread_mutex_trylock() failed");
-        }
-    }
-#endif
-    return retval;
-}
-
-int
-SDL_UnlockMutex(SDL_mutex * mutex)
-{
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-#if FAKE_RECURSIVE_MUTEX
-    /* We can only unlock the mutex if we own it */
-    if (pthread_self() == mutex->owner) {
-        if (mutex->recursive) {
-            --mutex->recursive;
-        } else {
-            /* The order of operations is important.
-               First reset the owner so another thread doesn't lock
-               the mutex and set the ownership before we reset it,
-               then release the lock semaphore.
-             */
-            mutex->owner = 0;
-            pthread_mutex_unlock(&mutex->id);
-        }
-    } else {
-        return SDL_SetError("mutex not owned by this thread");
-    }
-
-#else
-    if (pthread_mutex_unlock(&mutex->id) < 0) {
-        return SDL_SetError("pthread_mutex_unlock() failed");
-    }
-#endif /* FAKE_RECURSIVE_MUTEX */
-
-    return 0;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/pthread/SDL_sysmutex_c.h b/deps/SDL2/src/thread/pthread/SDL_sysmutex_c.h
deleted file mode 100644
index 2e2eae4..0000000
--- a/deps/SDL2/src/thread/pthread/SDL_sysmutex_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_mutex_c_h
-#define _SDL_mutex_c_h
-
-struct SDL_mutex
-{
-    pthread_mutex_t id;
-};
-
-#endif /* _SDL_mutex_c_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/pthread/SDL_syssem.c b/deps/SDL2/src/thread/pthread/SDL_syssem.c
deleted file mode 100644
index e1613fc..0000000
--- a/deps/SDL2/src/thread/pthread/SDL_syssem.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include <errno.h>
-#include <pthread.h>
-#include <semaphore.h>
-#include <sys/time.h>
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-
-/* Wrapper around POSIX 1003.1b semaphores */
-
-#if defined(__MACOSX__) || defined(__IPHONEOS__)
-/* Mac OS X doesn't support sem_getvalue() as of version 10.4 */
-#include "../generic/SDL_syssem.c"
-#else
-
-struct SDL_semaphore
-{
-    sem_t sem;
-};
-
-/* Create a semaphore, initialized with value */
-SDL_sem *
-SDL_CreateSemaphore(Uint32 initial_value)
-{
-    SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem));
-    if (sem) {
-        if (sem_init(&sem->sem, 0, initial_value) < 0) {
-            SDL_SetError("sem_init() failed");
-            SDL_free(sem);
-            sem = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return sem;
-}
-
-void
-SDL_DestroySemaphore(SDL_sem * sem)
-{
-    if (sem) {
-        sem_destroy(&sem->sem);
-        SDL_free(sem);
-    }
-}
-
-int
-SDL_SemTryWait(SDL_sem * sem)
-{
-    int retval;
-
-    if (!sem) {
-        return SDL_SetError("Passed a NULL semaphore");
-    }
-    retval = SDL_MUTEX_TIMEDOUT;
-    if (sem_trywait(&sem->sem) == 0) {
-        retval = 0;
-    }
-    return retval;
-}
-
-int
-SDL_SemWait(SDL_sem * sem)
-{
-    int retval;
-
-    if (!sem) {
-        return SDL_SetError("Passed a NULL semaphore");
-    }
-
-    retval = sem_wait(&sem->sem);
-    if (retval < 0) {
-        retval = SDL_SetError("sem_wait() failed");
-    }
-    return retval;
-}
-
-int
-SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
-{
-    int retval;
-#ifdef HAVE_SEM_TIMEDWAIT
-    struct timeval now;
-    struct timespec ts_timeout;
-#else
-    Uint32 end;
-#endif
-
-    if (!sem) {
-        return SDL_SetError("Passed a NULL semaphore");
-    }
-
-    /* Try the easy cases first */
-    if (timeout == 0) {
-        return SDL_SemTryWait(sem);
-    }
-    if (timeout == SDL_MUTEX_MAXWAIT) {
-        return SDL_SemWait(sem);
-    }
-
-#ifdef HAVE_SEM_TIMEDWAIT
-    /* Setup the timeout. sem_timedwait doesn't wait for
-    * a lapse of time, but until we reach a certain time.
-    * This time is now plus the timeout.
-    */
-    gettimeofday(&now, NULL);
-
-    /* Add our timeout to current time */
-    now.tv_usec += (timeout % 1000) * 1000;
-    now.tv_sec += timeout / 1000;
-
-    /* Wrap the second if needed */
-    if ( now.tv_usec >= 1000000 ) {
-        now.tv_usec -= 1000000;
-        now.tv_sec ++;
-    }
-
-    /* Convert to timespec */
-    ts_timeout.tv_sec = now.tv_sec;
-    ts_timeout.tv_nsec = now.tv_usec * 1000;
-
-    /* Wait. */
-    do {
-        retval = sem_timedwait(&sem->sem, &ts_timeout);
-    } while (retval < 0 && errno == EINTR);
-
-    if (retval < 0) {
-        if (errno == ETIMEDOUT) {
-            retval = SDL_MUTEX_TIMEDOUT;
-        } else {
-            SDL_SetError(strerror(errno));
-        }
-    }
-#else
-    end = SDL_GetTicks() + timeout;
-    while ((retval = SDL_SemTryWait(sem)) == SDL_MUTEX_TIMEDOUT) {
-        if (SDL_TICKS_PASSED(SDL_GetTicks(), end)) {
-            break;
-        }
-        SDL_Delay(1);
-    }
-#endif /* HAVE_SEM_TIMEDWAIT */
-
-    return retval;
-}
-
-Uint32
-SDL_SemValue(SDL_sem * sem)
-{
-    int ret = 0;
-    if (sem) {
-        sem_getvalue(&sem->sem, &ret);
-        if (ret < 0) {
-            ret = 0;
-        }
-    }
-    return (Uint32) ret;
-}
-
-int
-SDL_SemPost(SDL_sem * sem)
-{
-    int retval;
-
-    if (!sem) {
-        return SDL_SetError("Passed a NULL semaphore");
-    }
-
-    retval = sem_post(&sem->sem);
-    if (retval < 0) {
-        SDL_SetError("sem_post() failed");
-    }
-    return retval;
-}
-
-#endif /* __MACOSX__ */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/pthread/SDL_systhread.c b/deps/SDL2/src/thread/pthread/SDL_systhread.c
deleted file mode 100644
index c967ca7..0000000
--- a/deps/SDL2/src/thread/pthread/SDL_systhread.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#include <pthread.h>
-
-#if HAVE_PTHREAD_NP_H
-#include <pthread_np.h>
-#endif
-
-#include <signal.h>
-
-#ifdef __LINUX__
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-#endif /* __LINUX__ */
-
-#if defined(__LINUX__) || defined(__MACOSX__) || defined(__IPHONEOS__)
-#include <dlfcn.h>
-#ifndef RTLD_DEFAULT
-#define RTLD_DEFAULT NULL
-#endif
-#endif
-
-#include "SDL_platform.h"
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-#ifdef __ANDROID__
-#include "../../core/android/SDL_android.h"
-#endif
-
-#include "SDL_assert.h"
-
-/* List of signals to mask in the subthreads */
-static const int sig_list[] = {
-    SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
-    SIGVTALRM, SIGPROF, 0
-};
-
-
-static void *
-RunThread(void *data)
-{
-#ifdef __ANDROID__
-    Android_JNI_SetupThread();
-#endif
-    SDL_RunThread(data);
-    return NULL;
-}
-
-#if defined(__MACOSX__) || defined(__IPHONEOS__)
-static SDL_bool checked_setname = SDL_FALSE;
-static int (*ppthread_setname_np)(const char*) = NULL;
-#elif defined(__LINUX__)
-static SDL_bool checked_setname = SDL_FALSE;
-static int (*ppthread_setname_np)(pthread_t, const char*) = NULL;
-#endif
-int
-SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
-{
-    pthread_attr_t type;
-
-    /* do this here before any threads exist, so there's no race condition. */
-    #if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__)
-    if (!checked_setname) {
-        void *fn = dlsym(RTLD_DEFAULT, "pthread_setname_np");
-        #if defined(__MACOSX__) || defined(__IPHONEOS__)
-        ppthread_setname_np = (int(*)(const char*)) fn;
-        #elif defined(__LINUX__)
-        ppthread_setname_np = (int(*)(pthread_t, const char*)) fn;
-        #endif
-        checked_setname = SDL_TRUE;
-    }
-    #endif
-
-    /* Set the thread attributes */
-    if (pthread_attr_init(&type) != 0) {
-        return SDL_SetError("Couldn't initialize pthread attributes");
-    }
-    pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);
-
-    /* Create the thread and go! */
-    if (pthread_create(&thread->handle, &type, RunThread, args) != 0) {
-        return SDL_SetError("Not enough resources to create thread");
-    }
-
-    return 0;
-}
-
-void
-SDL_SYS_SetupThread(const char *name)
-{
-    int i;
-    sigset_t mask;
-
-    if (name != NULL) {
-        #if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__)
-        SDL_assert(checked_setname);
-        if (ppthread_setname_np != NULL) {
-            #if defined(__MACOSX__) || defined(__IPHONEOS__)
-            ppthread_setname_np(name);
-            #elif defined(__LINUX__)
-            ppthread_setname_np(pthread_self(), name);
-            #endif
-        }
-        #elif HAVE_PTHREAD_SETNAME_NP
-            pthread_setname_np(pthread_self(), name);
-        #elif HAVE_PTHREAD_SET_NAME_NP
-            pthread_set_name_np(pthread_self(), name);
-        #endif
-    }
-
-    /* Mask asynchronous signals for this thread */
-    sigemptyset(&mask);
-    for (i = 0; sig_list[i]; ++i) {
-        sigaddset(&mask, sig_list[i]);
-    }
-    pthread_sigmask(SIG_BLOCK, &mask, 0);
-
-#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
-    /* Allow ourselves to be asynchronously cancelled */
-    {
-        int oldstate;
-        pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
-    }
-#endif
-}
-
-SDL_threadID
-SDL_ThreadID(void)
-{
-    return ((SDL_threadID) pthread_self());
-}
-
-int
-SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
-{
-#ifdef __LINUX__
-    int value;
-
-    if (priority == SDL_THREAD_PRIORITY_LOW) {
-        value = 19;
-    } else if (priority == SDL_THREAD_PRIORITY_HIGH) {
-        value = -20;
-    } else {
-        value = 0;
-    }
-    if (setpriority(PRIO_PROCESS, syscall(SYS_gettid), value) < 0) {
-        /* Note that this fails if you're trying to set high priority
-           and you don't have root permission. BUT DON'T RUN AS ROOT!
-         */
-        return SDL_SetError("setpriority() failed");
-    }
-    return 0;
-#else
-    struct sched_param sched;
-    int policy;
-    pthread_t thread = pthread_self();
-
-    if (pthread_getschedparam(thread, &policy, &sched) < 0) {
-        return SDL_SetError("pthread_getschedparam() failed");
-    }
-    if (priority == SDL_THREAD_PRIORITY_LOW) {
-        sched.sched_priority = sched_get_priority_min(policy);
-    } else if (priority == SDL_THREAD_PRIORITY_HIGH) {
-        sched.sched_priority = sched_get_priority_max(policy);
-    } else {
-        int min_priority = sched_get_priority_min(policy);
-        int max_priority = sched_get_priority_max(policy);
-        sched.sched_priority = (min_priority + (max_priority - min_priority) / 2);
-    }
-    if (pthread_setschedparam(thread, policy, &sched) < 0) {
-        return SDL_SetError("pthread_setschedparam() failed");
-    }
-    return 0;
-#endif /* linux */
-}
-
-void
-SDL_SYS_WaitThread(SDL_Thread * thread)
-{
-    pthread_join(thread->handle, 0);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/pthread/SDL_systhread_c.h b/deps/SDL2/src/thread/pthread/SDL_systhread_c.h
deleted file mode 100644
index f134b0b..0000000
--- a/deps/SDL2/src/thread/pthread/SDL_systhread_c.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include <pthread.h>
-
-typedef pthread_t SYS_ThreadHandle;
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/pthread/SDL_systls.c b/deps/SDL2/src/thread/pthread/SDL_systls.c
deleted file mode 100644
index 9ef6e51..0000000
--- a/deps/SDL2/src/thread/pthread/SDL_systls.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-
-#include <pthread.h>
-
-
-#define INVALID_PTHREAD_KEY ((pthread_key_t)-1)
-
-static pthread_key_t thread_local_storage = INVALID_PTHREAD_KEY;
-static SDL_bool generic_local_storage = SDL_FALSE;
-
-SDL_TLSData *
-SDL_SYS_GetTLSData()
-{
-    if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) {
-        static SDL_SpinLock lock;
-        SDL_AtomicLock(&lock);
-        if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) {
-            pthread_key_t storage;
-            if (pthread_key_create(&storage, NULL) == 0) {
-                SDL_MemoryBarrierRelease();
-                thread_local_storage = storage;
-            } else {
-                generic_local_storage = SDL_TRUE;
-            }
-        }
-        SDL_AtomicUnlock(&lock);
-    }
-    if (generic_local_storage) {
-        return SDL_Generic_GetTLSData();
-    }
-    SDL_MemoryBarrierAcquire();
-    return (SDL_TLSData *)pthread_getspecific(thread_local_storage);
-}
-
-int
-SDL_SYS_SetTLSData(SDL_TLSData *data)
-{
-    if (generic_local_storage) {
-        return SDL_Generic_SetTLSData(data);
-    }
-    if (pthread_setspecific(thread_local_storage, data) != 0) {
-        return SDL_SetError("pthread_setspecific() failed");
-    }
-    return 0;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/windows/SDL_sysmutex.c b/deps/SDL2/src/thread/windows/SDL_sysmutex.c
deleted file mode 100644
index 60e9c6c..0000000
--- a/deps/SDL2/src/thread/windows/SDL_sysmutex.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_THREAD_WINDOWS
-
-/* Mutex functions using the Win32 API */
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_mutex.h"
-
-
-struct SDL_mutex
-{
-    CRITICAL_SECTION cs;
-};
-
-/* Create a mutex */
-SDL_mutex *
-SDL_CreateMutex(void)
-{
-    SDL_mutex *mutex;
-
-    /* Allocate mutex memory */
-    mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex));
-    if (mutex) {
-        /* Initialize */
-        /* On SMP systems, a non-zero spin count generally helps performance */
-        InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000);
-    } else {
-        SDL_OutOfMemory();
-    }
-    return (mutex);
-}
-
-/* Free the mutex */
-void
-SDL_DestroyMutex(SDL_mutex * mutex)
-{
-    if (mutex) {
-        DeleteCriticalSection(&mutex->cs);
-        SDL_free(mutex);
-    }
-}
-
-/* Lock the mutex */
-int
-SDL_LockMutex(SDL_mutex * mutex)
-{
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-    EnterCriticalSection(&mutex->cs);
-    return (0);
-}
-
-/* TryLock the mutex */
-int
-SDL_TryLockMutex(SDL_mutex * mutex)
-{
-    int retval = 0;
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-    if (TryEnterCriticalSection(&mutex->cs) == 0) {
-        retval = SDL_MUTEX_TIMEDOUT;
-    }
-    return retval;
-}
-
-/* Unlock the mutex */
-int
-SDL_UnlockMutex(SDL_mutex * mutex)
-{
-    if (mutex == NULL) {
-        return SDL_SetError("Passed a NULL mutex");
-    }
-
-    LeaveCriticalSection(&mutex->cs);
-    return (0);
-}
-
-#endif /* SDL_THREAD_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/windows/SDL_syssem.c b/deps/SDL2/src/thread/windows/SDL_syssem.c
deleted file mode 100644
index 8dc72bc..0000000
--- a/deps/SDL2/src/thread/windows/SDL_syssem.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_THREAD_WINDOWS
-
-/* Semaphore functions using the Win32 API */
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_thread.h"
-
-struct SDL_semaphore
-{
-    HANDLE id;
-    LONG count;
-};
-
-
-/* Create a semaphore */
-SDL_sem *
-SDL_CreateSemaphore(Uint32 initial_value)
-{
-    SDL_sem *sem;
-
-    /* Allocate sem memory */
-    sem = (SDL_sem *) SDL_malloc(sizeof(*sem));
-    if (sem) {
-        /* Create the semaphore, with max value 32K */
-        sem->id = CreateSemaphore(NULL, initial_value, 32 * 1024, NULL);
-        sem->count = initial_value;
-        if (!sem->id) {
-            SDL_SetError("Couldn't create semaphore");
-            SDL_free(sem);
-            sem = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return (sem);
-}
-
-/* Free the semaphore */
-void
-SDL_DestroySemaphore(SDL_sem * sem)
-{
-    if (sem) {
-        if (sem->id) {
-            CloseHandle(sem->id);
-            sem->id = 0;
-        }
-        SDL_free(sem);
-    }
-}
-
-int
-SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
-{
-    int retval;
-    DWORD dwMilliseconds;
-
-    if (!sem) {
-        return SDL_SetError("Passed a NULL sem");
-    }
-
-    if (timeout == SDL_MUTEX_MAXWAIT) {
-        dwMilliseconds = INFINITE;
-    } else {
-        dwMilliseconds = (DWORD) timeout;
-    }
-    switch (WaitForSingleObject(sem->id, dwMilliseconds)) {
-    case WAIT_OBJECT_0:
-        InterlockedDecrement(&sem->count);
-        retval = 0;
-        break;
-    case WAIT_TIMEOUT:
-        retval = SDL_MUTEX_TIMEDOUT;
-        break;
-    default:
-        retval = SDL_SetError("WaitForSingleObject() failed");
-        break;
-    }
-    return retval;
-}
-
-int
-SDL_SemTryWait(SDL_sem * sem)
-{
-    return SDL_SemWaitTimeout(sem, 0);
-}
-
-int
-SDL_SemWait(SDL_sem * sem)
-{
-    return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
-}
-
-/* Returns the current count of the semaphore */
-Uint32
-SDL_SemValue(SDL_sem * sem)
-{
-    if (!sem) {
-        SDL_SetError("Passed a NULL sem");
-        return 0;
-    }
-    return (Uint32)sem->count;
-}
-
-int
-SDL_SemPost(SDL_sem * sem)
-{
-    if (!sem) {
-        return SDL_SetError("Passed a NULL sem");
-    }
-    /* Increase the counter in the first place, because
-     * after a successful release the semaphore may
-     * immediately get destroyed by another thread which
-     * is waiting for this semaphore.
-     */
-    InterlockedIncrement(&sem->count);
-    if (ReleaseSemaphore(sem->id, 1, NULL) == FALSE) {
-        InterlockedDecrement(&sem->count);      /* restore */
-        return SDL_SetError("ReleaseSemaphore() failed");
-    }
-    return 0;
-}
-
-#endif /* SDL_THREAD_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/windows/SDL_systhread.c b/deps/SDL2/src/thread/windows/SDL_systhread.c
deleted file mode 100644
index 06e23ab..0000000
--- a/deps/SDL2/src/thread/windows/SDL_systhread.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_THREAD_WINDOWS
-
-/* Win32 thread management routines for SDL */
-
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-#include "SDL_systhread_c.h"
-
-#ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-/* We'll use the C library from this DLL */
-#include <process.h>
-
-/* Cygwin gcc-3 ... MingW64 (even with a i386 host) does this like MSVC. */
-#if (defined(__MINGW32__) && (__GNUC__ < 4))
-typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
-        unsigned (__stdcall *func)(void *), void *arg,
-        unsigned, unsigned *threadID);
-typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
-
-#elif defined(__WATCOMC__)
-/* This is for Watcom targets except OS2 */
-#if __WATCOMC__ < 1240
-#define __watcall
-#endif
-typedef unsigned long (__watcall * pfnSDL_CurrentBeginThread) (void *,
-                                                               unsigned,
-                                                               unsigned
-                                                               (__stdcall *
-                                                                func) (void
-                                                                       *),
-                                                               void *arg,
-                                                               unsigned,
-                                                               unsigned
-                                                               *threadID);
-typedef void (__watcall * pfnSDL_CurrentEndThread) (unsigned code);
-
-#else
-typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
-                                                        unsigned (__stdcall *
-                                                                  func) (void
-                                                                         *),
-                                                        void *arg, unsigned,
-                                                        unsigned *threadID);
-typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
-#endif
-#endif /* !SDL_PASSED_BEGINTHREAD_ENDTHREAD */
-
-
-typedef struct ThreadStartParms
-{
-    void *args;
-    pfnSDL_CurrentEndThread pfnCurrentEndThread;
-} tThreadStartParms, *pThreadStartParms;
-
-static DWORD
-RunThread(void *data)
-{
-    pThreadStartParms pThreadParms = (pThreadStartParms) data;
-    pfnSDL_CurrentEndThread pfnEndThread = pThreadParms->pfnCurrentEndThread;
-    void *args = pThreadParms->args;
-    SDL_free(pThreadParms);
-    SDL_RunThread(args);
-    if (pfnEndThread != NULL)
-        pfnEndThread(0);
-    return (0);
-}
-
-static DWORD WINAPI
-RunThreadViaCreateThread(LPVOID data)
-{
-  return RunThread(data);
-}
-
-static unsigned __stdcall
-RunThreadViaBeginThreadEx(void *data)
-{
-  return (unsigned) RunThread(data);
-}
-
-#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-int
-SDL_SYS_CreateThread(SDL_Thread * thread, void *args,
-                     pfnSDL_CurrentBeginThread pfnBeginThread,
-                     pfnSDL_CurrentEndThread pfnEndThread)
-{
-#elif defined(__CYGWIN__)
-int
-SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
-{
-    pfnSDL_CurrentBeginThread pfnBeginThread = NULL;
-    pfnSDL_CurrentEndThread pfnEndThread = NULL;
-#else
-int
-SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
-{
-    pfnSDL_CurrentBeginThread pfnBeginThread = (pfnSDL_CurrentBeginThread)_beginthreadex;
-    pfnSDL_CurrentEndThread pfnEndThread = (pfnSDL_CurrentEndThread)_endthreadex;
-#endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */
-    pThreadStartParms pThreadParms =
-        (pThreadStartParms) SDL_malloc(sizeof(tThreadStartParms));
-    if (!pThreadParms) {
-        return SDL_OutOfMemory();
-    }
-    /* Save the function which we will have to call to clear the RTL of calling app! */
-    pThreadParms->pfnCurrentEndThread = pfnEndThread;
-    /* Also save the real parameters we have to pass to thread function */
-    pThreadParms->args = args;
-
-    if (pfnBeginThread) {
-        unsigned threadid = 0;
-        thread->handle = (SYS_ThreadHandle)
-            ((size_t) pfnBeginThread(NULL, 0, RunThreadViaBeginThreadEx,
-                                     pThreadParms, 0, &threadid));
-    } else {
-        DWORD threadid = 0;
-        thread->handle = CreateThread(NULL, 0, RunThreadViaCreateThread,
-                                      pThreadParms, 0, &threadid);
-    }
-    if (thread->handle == NULL) {
-        return SDL_SetError("Not enough resources to create thread");
-    }
-    return 0;
-}
-
-#if 0  /* !!! FIXME: revisit this later. See https://bugzilla.libsdl.org/show_bug.cgi?id=2089 */
-#ifdef _MSC_VER
-#pragma warning(disable : 4733)
-#pragma pack(push,8)
-typedef struct tagTHREADNAME_INFO
-{
-    DWORD dwType; /* must be 0x1000 */
-    LPCSTR szName; /* pointer to name (in user addr space) */
-    DWORD dwThreadID; /* thread ID (-1=caller thread) */
-    DWORD dwFlags; /* reserved for future use, must be zero */
-} THREADNAME_INFO;
-#pragma pack(pop)
-
-static EXCEPTION_DISPOSITION
-ignore_exception(void *a, void *b, void *c, void *d)
-{
-    return ExceptionContinueExecution;
-}
-#endif
-#endif
-
-void
-SDL_SYS_SetupThread(const char *name)
-{
-    if (name != NULL) {
-        #if 0 /* !!! FIXME: revisit this later. See https://bugzilla.libsdl.org/show_bug.cgi?id=2089 */
-        #if (defined(_MSC_VER) && defined(_M_IX86))
-        /* This magic tells the debugger to name a thread if it's listening.
-            The inline asm sets up SEH (__try/__except) without C runtime
-            support. See Microsoft Systems Journal, January 1997:
-            http://www.microsoft.com/msj/0197/exception/exception.aspx */
-        INT_PTR handler = (INT_PTR) ignore_exception;
-        THREADNAME_INFO inf;
-
-        inf.dwType = 0x1000;
-        inf.szName = name;
-        inf.dwThreadID = (DWORD) -1;
-        inf.dwFlags = 0;
-
-        __asm {   /* set up SEH */
-            push handler
-            push fs:[0]
-            mov fs:[0],esp
-        }
-
-        /* The program itself should ignore this bogus exception. */
-        RaiseException(0x406D1388, 0, sizeof(inf)/sizeof(DWORD), (DWORD*)&inf);
-
-        __asm {  /* tear down SEH. */
-            mov eax,[esp]
-            mov fs:[0], eax
-            add esp, 8
-        }
-        #endif
-        #endif
-    }
-}
-
-SDL_threadID
-SDL_ThreadID(void)
-{
-    return ((SDL_threadID) GetCurrentThreadId());
-}
-
-int
-SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
-{
-    int value;
-
-    if (priority == SDL_THREAD_PRIORITY_LOW) {
-        value = THREAD_PRIORITY_LOWEST;
-    } else if (priority == SDL_THREAD_PRIORITY_HIGH) {
-        value = THREAD_PRIORITY_HIGHEST;
-    } else {
-        value = THREAD_PRIORITY_NORMAL;
-    }
-    if (!SetThreadPriority(GetCurrentThread(), value)) {
-        return WIN_SetError("SetThreadPriority()");
-    }
-    return 0;
-}
-
-void
-SDL_SYS_WaitThread(SDL_Thread * thread)
-{
-    WaitForSingleObject(thread->handle, INFINITE);
-    CloseHandle(thread->handle);
-}
-
-#endif /* SDL_THREAD_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/windows/SDL_systhread_c.h b/deps/SDL2/src/thread/windows/SDL_systhread_c.h
deleted file mode 100644
index f9f013b..0000000
--- a/deps/SDL2/src/thread/windows/SDL_systhread_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_systhread_c_h
-#define _SDL_systhread_c_h
-
-#include "../../core/windows/SDL_windows.h"
-
-typedef HANDLE SYS_ThreadHandle;
-
-#endif /* _SDL_systhread_c_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/thread/windows/SDL_systls.c b/deps/SDL2/src/thread/windows/SDL_systls.c
deleted file mode 100644
index 90941ee..0000000
--- a/deps/SDL2/src/thread/windows/SDL_systls.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#if SDL_THREAD_WINDOWS
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-
-static DWORD thread_local_storage = TLS_OUT_OF_INDEXES;
-static SDL_bool generic_local_storage = SDL_FALSE;
-
-SDL_TLSData *
-SDL_SYS_GetTLSData()
-{
-    if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) {
-        static SDL_SpinLock lock;
-        SDL_AtomicLock(&lock);
-        if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) {
-            DWORD storage = TlsAlloc();
-            if (storage != TLS_OUT_OF_INDEXES) {
-                SDL_MemoryBarrierRelease();
-                thread_local_storage = storage;
-            } else {
-                generic_local_storage = SDL_TRUE;
-            }
-        }
-        SDL_AtomicUnlock(&lock);
-    }
-    if (generic_local_storage) {
-        return SDL_Generic_GetTLSData();
-    }
-    SDL_MemoryBarrierAcquire();
-    return (SDL_TLSData *)TlsGetValue(thread_local_storage);
-}
-
-int
-SDL_SYS_SetTLSData(SDL_TLSData *data)
-{
-    if (generic_local_storage) {
-        return SDL_Generic_SetTLSData(data);
-    }
-    if (!TlsSetValue(thread_local_storage, data)) {
-        return SDL_SetError("TlsSetValue() failed");
-    }
-    return 0;
-}
-
-#endif /* SDL_THREAD_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/timer/SDL_timer.c b/deps/SDL2/src/timer/SDL_timer.c
deleted file mode 100644
index 2980f4d..0000000
--- a/deps/SDL2/src/timer/SDL_timer.c
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_timer.h"
-#include "SDL_timer_c.h"
-#include "SDL_atomic.h"
-#include "SDL_cpuinfo.h"
-#include "SDL_thread.h"
-
-/* #define DEBUG_TIMERS */
-
-typedef struct _SDL_Timer
-{
-    int timerID;
-    SDL_TimerCallback callback;
-    void *param;
-    Uint32 interval;
-    Uint32 scheduled;
-    volatile SDL_bool canceled;
-    struct _SDL_Timer *next;
-} SDL_Timer;
-
-typedef struct _SDL_TimerMap
-{
-    int timerID;
-    SDL_Timer *timer;
-    struct _SDL_TimerMap *next;
-} SDL_TimerMap;
-
-/* The timers are kept in a sorted list */
-typedef struct {
-    /* Data used by the main thread */
-    SDL_Thread *thread;
-    SDL_atomic_t nextID;
-    SDL_TimerMap *timermap;
-    SDL_mutex *timermap_lock;
-
-    /* Padding to separate cache lines between threads */
-    char cache_pad[SDL_CACHELINE_SIZE];
-
-    /* Data used to communicate with the timer thread */
-    SDL_SpinLock lock;
-    SDL_sem *sem;
-    SDL_Timer * volatile pending;
-    SDL_Timer * volatile freelist;
-    volatile SDL_bool active;
-
-    /* List of timers - this is only touched by the timer thread */
-    SDL_Timer *timers;
-} SDL_TimerData;
-
-static SDL_TimerData SDL_timer_data;
-
-/* The idea here is that any thread might add a timer, but a single
- * thread manages the active timer queue, sorted by scheduling time.
- *
- * Timers are removed by simply setting a canceled flag
- */
-
-static void
-SDL_AddTimerInternal(SDL_TimerData *data, SDL_Timer *timer)
-{
-    SDL_Timer *prev, *curr;
-
-    prev = NULL;
-    for (curr = data->timers; curr; prev = curr, curr = curr->next) {
-        if ((Sint32)(timer->scheduled-curr->scheduled) < 0) {
-            break;
-        }
-    }
-
-    /* Insert the timer here! */
-    if (prev) {
-        prev->next = timer;
-    } else {
-        data->timers = timer;
-    }
-    timer->next = curr;
-}
-
-static int
-SDL_TimerThread(void *_data)
-{
-    SDL_TimerData *data = (SDL_TimerData *)_data;
-    SDL_Timer *pending;
-    SDL_Timer *current;
-    SDL_Timer *freelist_head = NULL;
-    SDL_Timer *freelist_tail = NULL;
-    Uint32 tick, now, interval, delay;
-
-    /* Threaded timer loop:
-     *  1. Queue timers added by other threads
-     *  2. Handle any timers that should dispatch this cycle
-     *  3. Wait until next dispatch time or new timer arrives
-     */
-    for ( ; ; ) {
-        /* Pending and freelist maintenance */
-        SDL_AtomicLock(&data->lock);
-        {
-            /* Get any timers ready to be queued */
-            pending = data->pending;
-            data->pending = NULL;
-
-            /* Make any unused timer structures available */
-            if (freelist_head) {
-                freelist_tail->next = data->freelist;
-                data->freelist = freelist_head;
-            }
-        }
-        SDL_AtomicUnlock(&data->lock);
-
-        /* Sort the pending timers into our list */
-        while (pending) {
-            current = pending;
-            pending = pending->next;
-            SDL_AddTimerInternal(data, current);
-        }
-        freelist_head = NULL;
-        freelist_tail = NULL;
-
-        /* Check to see if we're still running, after maintenance */
-        if (!data->active) {
-            break;
-        }
-
-        /* Initial delay if there are no timers */
-        delay = SDL_MUTEX_MAXWAIT;
-
-        tick = SDL_GetTicks();
-
-        /* Process all the pending timers for this tick */
-        while (data->timers) {
-            current = data->timers;
-
-            if ((Sint32)(tick-current->scheduled) < 0) {
-                /* Scheduled for the future, wait a bit */
-                delay = (current->scheduled - tick);
-                break;
-            }
-
-            /* We're going to do something with this timer */
-            data->timers = current->next;
-
-            if (current->canceled) {
-                interval = 0;
-            } else {
-                interval = current->callback(current->interval, current->param);
-            }
-
-            if (interval > 0) {
-                /* Reschedule this timer */
-                current->scheduled = tick + interval;
-                SDL_AddTimerInternal(data, current);
-            } else {
-                if (!freelist_head) {
-                    freelist_head = current;
-                }
-                if (freelist_tail) {
-                    freelist_tail->next = current;
-                }
-                freelist_tail = current;
-
-                current->canceled = SDL_TRUE;
-            }
-        }
-
-        /* Adjust the delay based on processing time */
-        now = SDL_GetTicks();
-        interval = (now - tick);
-        if (interval > delay) {
-            delay = 0;
-        } else {
-            delay -= interval;
-        }
-
-        /* Note that each time a timer is added, this will return
-           immediately, but we process the timers added all at once.
-           That's okay, it just means we run through the loop a few
-           extra times.
-         */
-        SDL_SemWaitTimeout(data->sem, delay);
-    }
-    return 0;
-}
-
-int
-SDL_TimerInit(void)
-{
-    SDL_TimerData *data = &SDL_timer_data;
-
-    if (!data->active) {
-        const char *name = "SDLTimer";
-        data->timermap_lock = SDL_CreateMutex();
-        if (!data->timermap_lock) {
-            return -1;
-        }
-
-        data->sem = SDL_CreateSemaphore(0);
-        if (!data->sem) {
-            SDL_DestroyMutex(data->timermap_lock);
-            return -1;
-        }
-
-        data->active = SDL_TRUE;
-        /* !!! FIXME: this is nasty. */
-#if defined(__WIN32__) && !defined(HAVE_LIBC)
-#undef SDL_CreateThread
-        data->thread = SDL_CreateThread(SDL_TimerThread, name, data, NULL, NULL);
-#else
-        data->thread = SDL_CreateThread(SDL_TimerThread, name, data);
-#endif
-        if (!data->thread) {
-            SDL_TimerQuit();
-            return -1;
-        }
-
-        SDL_AtomicSet(&data->nextID, 1);
-    }
-    return 0;
-}
-
-void
-SDL_TimerQuit(void)
-{
-    SDL_TimerData *data = &SDL_timer_data;
-    SDL_Timer *timer;
-    SDL_TimerMap *entry;
-
-    if (data->active) {
-        data->active = SDL_FALSE;
-
-        /* Shutdown the timer thread */
-        if (data->thread) {
-            SDL_SemPost(data->sem);
-            SDL_WaitThread(data->thread, NULL);
-            data->thread = NULL;
-        }
-
-        SDL_DestroySemaphore(data->sem);
-        data->sem = NULL;
-
-        /* Clean up the timer entries */
-        while (data->timers) {
-            timer = data->timers;
-            data->timers = timer->next;
-            SDL_free(timer);
-        }
-        while (data->freelist) {
-            timer = data->freelist;
-            data->freelist = timer->next;
-            SDL_free(timer);
-        }
-        while (data->timermap) {
-            entry = data->timermap;
-            data->timermap = entry->next;
-            SDL_free(entry);
-        }
-
-        SDL_DestroyMutex(data->timermap_lock);
-        data->timermap_lock = NULL;
-    }
-}
-
-SDL_TimerID
-SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param)
-{
-    SDL_TimerData *data = &SDL_timer_data;
-    SDL_Timer *timer;
-    SDL_TimerMap *entry;
-
-    if (!data->active) {
-        int status = 0;
-
-        SDL_AtomicLock(&data->lock);
-        if (!data->active) {
-            status = SDL_TimerInit();
-        }
-        SDL_AtomicUnlock(&data->lock);
-
-        if (status < 0) {
-            return 0;
-        }
-    }
-
-    SDL_AtomicLock(&data->lock);
-    timer = data->freelist;
-    if (timer) {
-        data->freelist = timer->next;
-    }
-    SDL_AtomicUnlock(&data->lock);
-
-    if (timer) {
-        SDL_RemoveTimer(timer->timerID);
-    } else {
-        timer = (SDL_Timer *)SDL_malloc(sizeof(*timer));
-        if (!timer) {
-            SDL_OutOfMemory();
-            return 0;
-        }
-    }
-    timer->timerID = SDL_AtomicIncRef(&data->nextID);
-    timer->callback = callback;
-    timer->param = param;
-    timer->interval = interval;
-    timer->scheduled = SDL_GetTicks() + interval;
-    timer->canceled = SDL_FALSE;
-
-    entry = (SDL_TimerMap *)SDL_malloc(sizeof(*entry));
-    if (!entry) {
-        SDL_free(timer);
-        SDL_OutOfMemory();
-        return 0;
-    }
-    entry->timer = timer;
-    entry->timerID = timer->timerID;
-
-    SDL_LockMutex(data->timermap_lock);
-    entry->next = data->timermap;
-    data->timermap = entry;
-    SDL_UnlockMutex(data->timermap_lock);
-
-    /* Add the timer to the pending list for the timer thread */
-    SDL_AtomicLock(&data->lock);
-    timer->next = data->pending;
-    data->pending = timer;
-    SDL_AtomicUnlock(&data->lock);
-
-    /* Wake up the timer thread if necessary */
-    SDL_SemPost(data->sem);
-
-    return entry->timerID;
-}
-
-SDL_bool
-SDL_RemoveTimer(SDL_TimerID id)
-{
-    SDL_TimerData *data = &SDL_timer_data;
-    SDL_TimerMap *prev, *entry;
-    SDL_bool canceled = SDL_FALSE;
-
-    /* Find the timer */
-    SDL_LockMutex(data->timermap_lock);
-    prev = NULL;
-    for (entry = data->timermap; entry; prev = entry, entry = entry->next) {
-        if (entry->timerID == id) {
-            if (prev) {
-                prev->next = entry->next;
-            } else {
-                data->timermap = entry->next;
-            }
-            break;
-        }
-    }
-    SDL_UnlockMutex(data->timermap_lock);
-
-    if (entry) {
-        if (!entry->timer->canceled) {
-            entry->timer->canceled = SDL_TRUE;
-            canceled = SDL_TRUE;
-        }
-        SDL_free(entry);
-    }
-    return canceled;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/timer/SDL_timer_c.h b/deps/SDL2/src/timer/SDL_timer_c.h
deleted file mode 100644
index 1574853..0000000
--- a/deps/SDL2/src/timer/SDL_timer_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_timer.c */
-#include "SDL_timer.h"
-
-#define ROUND_RESOLUTION(X) \
-    (((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION)
-
-extern void SDL_InitTicks(void);
-extern int SDL_TimerInit(void);
-extern void SDL_TimerQuit(void);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/timer/beos/SDL_systimer.c b/deps/SDL2/src/timer/beos/SDL_systimer.c
deleted file mode 100644
index fd22e44..0000000
--- a/deps/SDL2/src/timer/beos/SDL_systimer.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_BEOS
-
-#include <be/kernel/OS.h>
-
-#include "SDL_timer.h"
-
-static bigtime_t start;
-static SDL_bool ticks_started = SDL_FALSE;
-
-void
-SDL_InitTicks(void)
-{
-    if (ticks_started) {
-        return;
-    }
-    ticks_started = SDL_TRUE;
-
-    /* Set first ticks value */
-    start = system_time();
-}
-
-Uint32
-SDL_GetTicks(void)
-{
-    if (!ticks_started) {
-        SDL_InitTicks();
-    }
-
-    return ((system_time() - start) / 1000);
-}
-
-Uint64
-SDL_GetPerformanceCounter(void)
-{
-    return system_time();
-}
-
-Uint64
-SDL_GetPerformanceFrequency(void)
-{
-    return 1000000;
-}
-
-void
-SDL_Delay(Uint32 ms)
-{
-    snooze(ms * 1000);
-}
-
-#endif /* SDL_TIMER_BEOS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/timer/dummy/SDL_systimer.c b/deps/SDL2/src/timer/dummy/SDL_systimer.c
deleted file mode 100644
index 387675d..0000000
--- a/deps/SDL2/src/timer/dummy/SDL_systimer.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if defined(SDL_TIMER_DUMMY) || defined(SDL_TIMERS_DISABLED)
-
-#include "SDL_timer.h"
-
-static SDL_bool ticks_started = SDL_FALSE;
-
-void
-SDL_InitTicks(void)
-{
-    if (ticks_started) {
-        return;
-    }
-    ticks_started = SDL_TRUE;
-}
-
-Uint32
-SDL_GetTicks(void)
-{
-    if (!ticks_started) {
-        SDL_InitTicks();
-    }
-
-    SDL_Unsupported();
-    return 0;
-}
-
-Uint64
-SDL_GetPerformanceCounter(void)
-{
-    return SDL_GetTicks();
-}
-
-Uint64
-SDL_GetPerformanceFrequency(void)
-{
-    return 1000;
-}
-
-void
-SDL_Delay(Uint32 ms)
-{
-    SDL_Unsupported();
-}
-
-#endif /* SDL_TIMER_DUMMY || SDL_TIMERS_DISABLED */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/timer/psp/SDL_systimer.c b/deps/SDL2/src/timer/psp/SDL_systimer.c
deleted file mode 100644
index 61c4690..0000000
--- a/deps/SDL2/src/timer/psp/SDL_systimer.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "SDL_error.h"
-#include "../SDL_timer_c.h"
-#include <stdlib.h>
-#include <time.h>
-#include <sys/time.h>
-#include <pspthreadman.h>
-
-static struct timeval start;
-static SDL_bool ticks_started = SDL_FALSE;
-
-void SDL_InitTicks(void)
-{
-    if (ticks_started) {
-        return;
-    }
-    ticks_started = SDL_TRUE;
-
-    gettimeofday(&start, NULL);
-}
-
-Uint32 SDL_GetTicks(void)
-{
-    if (!ticks_started) {
-        SDL_InitTicks();
-    }
-
-    struct timeval now;
-    Uint32 ticks;
-
-    gettimeofday(&now, NULL);
-    ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000;
-    return(ticks);
-}
-
-Uint64
-SDL_GetPerformanceCounter(void)
-{
-    return SDL_GetTicks();
-}
-
-Uint64
-SDL_GetPerformanceFrequency(void)
-{
-    return 1000;
-}
-
-void SDL_Delay(Uint32 ms)
-{
-    const Uint32 max_delay = 0xffffffffUL / 1000;
-    if(ms > max_delay)
-        ms = max_delay;
-    sceKernelDelayThreadCB(ms * 1000);
-}
-
-/* vim: ts=4 sw=4
- */
diff --git a/deps/SDL2/src/timer/unix/SDL_systimer.c b/deps/SDL2/src/timer/unix/SDL_systimer.c
deleted file mode 100644
index 88a40ba..0000000
--- a/deps/SDL2/src/timer/unix/SDL_systimer.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_UNIX
-
-#include <stdio.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "SDL_timer.h"
-
-/* The clock_gettime provides monotonous time, so we should use it if
-   it's available. The clock_gettime function is behind ifdef
-   for __USE_POSIX199309
-   Tommi Kyntola (tommi.kyntola at ray.fi) 27/09/2005
-*/
-/* Reworked monotonic clock to not assume the current system has one
-   as not all linux kernels provide a monotonic clock (yeah recent ones
-   probably do)
-   Also added OS X Monotonic clock support
-   Based on work in https://github.com/ThomasHabets/monotonic_clock
- */
-#if HAVE_NANOSLEEP || HAVE_CLOCK_GETTIME
-#include <time.h>
-#endif
-#ifdef __APPLE__
-#include <mach/mach_time.h>
-#endif
-
-/* The first ticks value of the application */
-#if HAVE_CLOCK_GETTIME
-static struct timespec start_ts;
-#elif defined(__APPLE__)
-static uint64_t start_mach;
-mach_timebase_info_data_t mach_base_info;
-#endif
-static SDL_bool has_monotonic_time = SDL_FALSE;
-static struct timeval start_tv;
-static SDL_bool ticks_started = SDL_FALSE;
-
-void
-SDL_InitTicks(void)
-{
-    if (ticks_started) {
-        return;
-    }
-    ticks_started = SDL_TRUE;
-
-    /* Set first ticks value */
-#if HAVE_CLOCK_GETTIME
-    if (clock_gettime(CLOCK_MONOTONIC, &start_ts) == 0) {
-        has_monotonic_time = SDL_TRUE;
-    } else
-#elif defined(__APPLE__)
-    kern_return_t ret = mach_timebase_info(&mach_base_info);
-    if (ret == 0) {
-        has_monotonic_time = SDL_TRUE;
-        start_mach = mach_absolute_time();
-    } else
-#endif
-    {
-        gettimeofday(&start_tv, NULL);
-    }
-}
-
-Uint32
-SDL_GetTicks(void)
-{
-    Uint32 ticks;
-    if (!ticks_started) {
-        SDL_InitTicks();
-    }
-
-    if (has_monotonic_time) {
-#if HAVE_CLOCK_GETTIME
-        struct timespec now;
-        clock_gettime(CLOCK_MONOTONIC, &now);
-        ticks = (now.tv_sec - start_ts.tv_sec) * 1000 + (now.tv_nsec -
-                                                 start_ts.tv_nsec) / 1000000;
-#elif defined(__APPLE__)
-        uint64_t now = mach_absolute_time();
-        ticks = (((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000;
-#endif
-    } else {
-        struct timeval now;
-
-        gettimeofday(&now, NULL);
-        ticks =
-            (now.tv_sec - start_tv.tv_sec) * 1000 + (now.tv_usec -
-                                                  start_tv.tv_usec) / 1000;
-    }
-    return (ticks);
-}
-
-Uint64
-SDL_GetPerformanceCounter(void)
-{
-    Uint64 ticks;
-    if (!ticks_started) {
-        SDL_InitTicks();
-    }
-
-    if (has_monotonic_time) {
-#if HAVE_CLOCK_GETTIME
-        struct timespec now;
-
-        clock_gettime(CLOCK_MONOTONIC, &now);
-        ticks = now.tv_sec;
-        ticks *= 1000000000;
-        ticks += now.tv_nsec;
-#elif defined(__APPLE__)
-        ticks = mach_absolute_time();
-#endif
-    } else {
-        struct timeval now;
-
-        gettimeofday(&now, NULL);
-        ticks = now.tv_sec;
-        ticks *= 1000000;
-        ticks += now.tv_usec;
-    }
-    return (ticks);
-}
-
-Uint64
-SDL_GetPerformanceFrequency(void)
-{
-    if (!ticks_started) {
-        SDL_InitTicks();
-    }
-
-    if (has_monotonic_time) {
-#if HAVE_CLOCK_GETTIME
-        return 1000000000;
-#elif defined(__APPLE__)
-        Uint64 freq = mach_base_info.denom;
-        freq *= 1000000000;
-        freq /= mach_base_info.numer;
-        return freq;
-#endif
-    } 
-        
-    return 1000000;
-}
-
-void
-SDL_Delay(Uint32 ms)
-{
-    int was_error;
-
-#if HAVE_NANOSLEEP
-    struct timespec elapsed, tv;
-#else
-    struct timeval tv;
-    Uint32 then, now, elapsed;
-#endif
-
-    /* Set the timeout interval */
-#if HAVE_NANOSLEEP
-    elapsed.tv_sec = ms / 1000;
-    elapsed.tv_nsec = (ms % 1000) * 1000000;
-#else
-    then = SDL_GetTicks();
-#endif
-    do {
-        errno = 0;
-
-#if HAVE_NANOSLEEP
-        tv.tv_sec = elapsed.tv_sec;
-        tv.tv_nsec = elapsed.tv_nsec;
-        was_error = nanosleep(&tv, &elapsed);
-#else
-        /* Calculate the time interval left (in case of interrupt) */
-        now = SDL_GetTicks();
-        elapsed = (now - then);
-        then = now;
-        if (elapsed >= ms) {
-            break;
-        }
-        ms -= elapsed;
-        tv.tv_sec = ms / 1000;
-        tv.tv_usec = (ms % 1000) * 1000;
-
-        was_error = select(0, NULL, NULL, NULL, &tv);
-#endif /* HAVE_NANOSLEEP */
-    } while (was_error && (errno == EINTR));
-}
-
-#endif /* SDL_TIMER_UNIX */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/timer/windows/SDL_systimer.c b/deps/SDL2/src/timer/windows/SDL_systimer.c
deleted file mode 100644
index c3b54f5..0000000
--- a/deps/SDL2/src/timer/windows/SDL_systimer.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_WINDOWS
-
-#include "../../core/windows/SDL_windows.h"
-#include <mmsystem.h>
-
-#include "SDL_timer.h"
-#include "SDL_hints.h"
-
-
-/* The first (low-resolution) ticks value of the application */
-static DWORD start;
-static BOOL ticks_started = FALSE; 
-
-#ifndef USE_GETTICKCOUNT
-/* Store if a high-resolution performance counter exists on the system */
-static BOOL hires_timer_available;
-/* The first high-resolution ticks value of the application */
-static LARGE_INTEGER hires_start_ticks;
-/* The number of ticks per second of the high-resolution performance counter */
-static LARGE_INTEGER hires_ticks_per_second;
-#endif
-
-static void
-timeSetPeriod(UINT uPeriod)
-{
-    static UINT timer_period = 0;
-
-    if (uPeriod != timer_period) {
-        if (timer_period) {
-            timeEndPeriod(timer_period);
-        }
-
-        timer_period = uPeriod;
-
-        if (timer_period) {
-            timeBeginPeriod(timer_period);
-        }
-    }
-}
-
-static void
-SDL_TimerResolutionChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
-{
-    UINT uPeriod;
-
-    /* Unless the hint says otherwise, let's have good sleep precision */
-    if (hint && *hint) {
-        uPeriod = SDL_atoi(hint);
-    } else {
-        uPeriod = 1;
-    }
-    if (uPeriod || oldValue != hint) {
-        timeSetPeriod(uPeriod);
-    }
-}
-
-void
-SDL_InitTicks(void)
-{
-    if (ticks_started) {
-        return;
-    }
-    ticks_started = TRUE;
-
-    /* Set first ticks value */
-#ifdef USE_GETTICKCOUNT
-    start = GetTickCount();
-#else
-    /* QueryPerformanceCounter has had problems in the past, but lots of games
-       use it, so we'll rely on it here.
-     */
-    if (QueryPerformanceFrequency(&hires_ticks_per_second) == TRUE) {
-        hires_timer_available = TRUE;
-        QueryPerformanceCounter(&hires_start_ticks);
-    } else {
-        hires_timer_available = FALSE;
-        timeSetPeriod(1);     /* use 1 ms timer precision */
-        start = timeGetTime();
-    }
-#endif
-
-    SDL_AddHintCallback(SDL_HINT_TIMER_RESOLUTION,
-                        SDL_TimerResolutionChanged, NULL);
-}
-
-Uint32
-SDL_GetTicks(void)
-{
-    DWORD now;
-#ifndef USE_GETTICKCOUNT
-    LARGE_INTEGER hires_now;
-#endif
-
-    if (!ticks_started) {
-        SDL_InitTicks();
-    }
-
-#ifdef USE_GETTICKCOUNT
-    now = GetTickCount();
-#else
-    if (hires_timer_available) {
-        QueryPerformanceCounter(&hires_now);
-
-        hires_now.QuadPart -= hires_start_ticks.QuadPart;
-        hires_now.QuadPart *= 1000;
-        hires_now.QuadPart /= hires_ticks_per_second.QuadPart;
-
-        return (DWORD) hires_now.QuadPart;
-    } else {
-        now = timeGetTime();
-    }
-#endif
-
-    return (now - start);
-}
-
-Uint64
-SDL_GetPerformanceCounter(void)
-{
-    LARGE_INTEGER counter;
-
-    if (!QueryPerformanceCounter(&counter)) {
-        return SDL_GetTicks();
-    }
-    return counter.QuadPart;
-}
-
-Uint64
-SDL_GetPerformanceFrequency(void)
-{
-    LARGE_INTEGER frequency;
-
-    if (!QueryPerformanceFrequency(&frequency)) {
-        return 1000;
-    }
-    return frequency.QuadPart;
-}
-
-void
-SDL_Delay(Uint32 ms)
-{
-    Sleep(ms);
-}
-
-#endif /* SDL_TIMER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_RLEaccel.c b/deps/SDL2/src/video/SDL_RLEaccel.c
deleted file mode 100644
index 6db43b0..0000000
--- a/deps/SDL2/src/video/SDL_RLEaccel.c
+++ /dev/null
@@ -1,1566 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/*
- * RLE encoding for software colorkey and alpha-channel acceleration
- *
- * Original version by Sam Lantinga
- *
- * Mattias Engdegård (Yorick): Rewrite. New encoding format, encoder and
- * decoder. Added per-surface alpha blitter. Added per-pixel alpha
- * format, encoder and blitter.
- *
- * Many thanks to Xark and johns for hints, benchmarks and useful comments
- * leading to this code.
- *
- * Welcome to Macro Mayhem.
- */
-
-/*
- * The encoding translates the image data to a stream of segments of the form
- *
- * <skip> <run> <data>
- *
- * where <skip> is the number of transparent pixels to skip,
- *       <run>  is the number of opaque pixels to blit,
- * and   <data> are the pixels themselves.
- *
- * This basic structure is used both for colorkeyed surfaces, used for simple
- * binary transparency and for per-surface alpha blending, and for surfaces
- * with per-pixel alpha. The details differ, however:
- *
- * Encoding of colorkeyed surfaces:
- *
- *   Encoded pixels always have the same format as the target surface.
- *   <skip> and <run> are unsigned 8 bit integers, except for 32 bit depth
- *   where they are 16 bit. This makes the pixel data aligned at all times.
- *   Segments never wrap around from one scan line to the next.
- *
- *   The end of the sequence is marked by a zero <skip>,<run> pair at the *
- *   beginning of a line.
- *
- * Encoding of surfaces with per-pixel alpha:
- *
- *   The sequence begins with a struct RLEDestFormat describing the target
- *   pixel format, to provide reliable un-encoding.
- *
- *   Each scan line is encoded twice: First all completely opaque pixels,
- *   encoded in the target format as described above, and then all
- *   partially transparent (translucent) pixels (where 1 <= alpha <= 254),
- *   in the following 32-bit format:
- *
- *   For 32-bit targets, each pixel has the target RGB format but with
- *   the alpha value occupying the highest 8 bits. The <skip> and <run>
- *   counts are 16 bit.
- *
- *   For 16-bit targets, each pixel has the target RGB format, but with
- *   the middle component (usually green) shifted 16 steps to the left,
- *   and the hole filled with the 5 most significant bits of the alpha value.
- *   i.e. if the target has the format         rrrrrggggggbbbbb,
- *   the encoded pixel will be 00000gggggg00000rrrrr0aaaaabbbbb.
- *   The <skip> and <run> counts are 8 bit for the opaque lines, 16 bit
- *   for the translucent lines. Two padding bytes may be inserted
- *   before each translucent line to keep them 32-bit aligned.
- *
- *   The end of the sequence is marked by a zero <skip>,<run> pair at the
- *   beginning of an opaque line.
- */
-
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_blit.h"
-#include "SDL_RLEaccel_c.h"
-
-#ifndef MAX
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-#ifndef MIN
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-#define PIXEL_COPY(to, from, len, bpp)          \
-    SDL_memcpy(to, from, (size_t)(len) * (bpp))
-
-/*
- * Various colorkey blit methods, for opaque and per-surface alpha
- */
-
-#define OPAQUE_BLIT(to, from, length, bpp, alpha)   \
-    PIXEL_COPY(to, from, length, bpp)
-
-/*
- * For 32bpp pixels on the form 0x00rrggbb:
- * If we treat the middle component separately, we can process the two
- * remaining in parallel. This is safe to do because of the gap to the left
- * of each component, so the bits from the multiplication don't collide.
- * This can be used for any RGB permutation of course.
- */
-#define ALPHA_BLIT32_888(to, from, length, bpp, alpha)      \
-    do {                            \
-        int i;                          \
-    Uint32 *src = (Uint32 *)(from);             \
-    Uint32 *dst = (Uint32 *)(to);               \
-    for(i = 0; i < (int)(length); i++) {            \
-        Uint32 s = *src++;                  \
-        Uint32 d = *dst;                    \
-        Uint32 s1 = s & 0xff00ff;               \
-        Uint32 d1 = d & 0xff00ff;               \
-        d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff;    \
-        s &= 0xff00;                    \
-        d &= 0xff00;                    \
-        d = (d + ((s - d) * alpha >> 8)) & 0xff00;      \
-        *dst++ = d1 | d;                    \
-    }                           \
-    } while(0)
-
-/*
- * For 16bpp pixels we can go a step further: put the middle component
- * in the high 16 bits of a 32 bit word, and process all three RGB
- * components at the same time. Since the smallest gap is here just
- * 5 bits, we have to scale alpha down to 5 bits as well.
- */
-#define ALPHA_BLIT16_565(to, from, length, bpp, alpha)  \
-    do {                        \
-        int i;                      \
-    Uint16 *src = (Uint16 *)(from);         \
-    Uint16 *dst = (Uint16 *)(to);           \
-    Uint32 ALPHA = alpha >> 3;          \
-    for(i = 0; i < (int)(length); i++) {        \
-        Uint32 s = *src++;              \
-        Uint32 d = *dst;                \
-        s = (s | s << 16) & 0x07e0f81f;     \
-        d = (d | d << 16) & 0x07e0f81f;     \
-        d += (s - d) * ALPHA >> 5;          \
-        d &= 0x07e0f81f;                \
-        *dst++ = (Uint16)(d | d >> 16);         \
-    }                       \
-    } while(0)
-
-#define ALPHA_BLIT16_555(to, from, length, bpp, alpha)  \
-    do {                        \
-        int i;                      \
-    Uint16 *src = (Uint16 *)(from);         \
-    Uint16 *dst = (Uint16 *)(to);           \
-    Uint32 ALPHA = alpha >> 3;          \
-    for(i = 0; i < (int)(length); i++) {        \
-        Uint32 s = *src++;              \
-        Uint32 d = *dst;                \
-        s = (s | s << 16) & 0x03e07c1f;     \
-        d = (d | d << 16) & 0x03e07c1f;     \
-        d += (s - d) * ALPHA >> 5;          \
-        d &= 0x03e07c1f;                \
-        *dst++ = (Uint16)(d | d >> 16);         \
-    }                       \
-    } while(0)
-
-/*
- * The general slow catch-all function, for remaining depths and formats
- */
-#define ALPHA_BLIT_ANY(to, from, length, bpp, alpha)            \
-    do {                                \
-        int i;                              \
-    Uint8 *src = from;                      \
-    Uint8 *dst = to;                        \
-    for(i = 0; i < (int)(length); i++) {                \
-        Uint32 s, d;                        \
-        unsigned rs, gs, bs, rd, gd, bd;                \
-        switch(bpp) {                       \
-        case 2:                         \
-        s = *(Uint16 *)src;                 \
-        d = *(Uint16 *)dst;                 \
-        break;                          \
-        case 3:                         \
-        if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {           \
-            s = (src[0] << 16) | (src[1] << 8) | src[2];    \
-            d = (dst[0] << 16) | (dst[1] << 8) | dst[2];    \
-        } else {                        \
-            s = (src[2] << 16) | (src[1] << 8) | src[0];    \
-            d = (dst[2] << 16) | (dst[1] << 8) | dst[0];    \
-        }                           \
-        break;                          \
-        case 4:                         \
-        s = *(Uint32 *)src;                 \
-        d = *(Uint32 *)dst;                 \
-        break;                          \
-        }                               \
-        RGB_FROM_PIXEL(s, fmt, rs, gs, bs);             \
-        RGB_FROM_PIXEL(d, fmt, rd, gd, bd);             \
-        rd += (rs - rd) * alpha >> 8;               \
-        gd += (gs - gd) * alpha >> 8;               \
-        bd += (bs - bd) * alpha >> 8;               \
-        PIXEL_FROM_RGB(d, fmt, rd, gd, bd);             \
-        switch(bpp) {                       \
-        case 2:                         \
-        *(Uint16 *)dst = (Uint16)d;                 \
-        break;                          \
-        case 3:                         \
-        if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {           \
-            dst[0] = (Uint8)(d >> 16);                  \
-            dst[1] = (Uint8)(d >> 8);                   \
-            dst[2] = (Uint8)(d);                        \
-        } else {                        \
-            dst[0] = (Uint8)d;                      \
-            dst[1] = (Uint8)(d >> 8);                   \
-            dst[2] = (Uint8)(d >> 16);                  \
-        }                           \
-        break;                          \
-        case 4:                         \
-        *(Uint32 *)dst = d;                 \
-        break;                          \
-        }                               \
-        src += bpp;                         \
-        dst += bpp;                         \
-    }                               \
-    } while(0)
-
-/*
- * Special case: 50% alpha (alpha=128)
- * This is treated specially because it can be optimized very well, and
- * since it is good for many cases of semi-translucency.
- * The theory is to do all three components at the same time:
- * First zero the lowest bit of each component, which gives us room to
- * add them. Then shift right and add the sum of the lowest bits.
- */
-#define ALPHA_BLIT32_888_50(to, from, length, bpp, alpha)       \
-    do {                                \
-        int i;                              \
-    Uint32 *src = (Uint32 *)(from);                 \
-    Uint32 *dst = (Uint32 *)(to);                   \
-    for(i = 0; i < (int)(length); i++) {                \
-        Uint32 s = *src++;                      \
-        Uint32 d = *dst;                        \
-        *dst++ = (((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)   \
-             + (s & d & 0x00010101);                \
-    }                               \
-    } while(0)
-
-/*
- * For 16bpp, we can actually blend two pixels in parallel, if we take
- * care to shift before we add, not after.
- */
-
-/* helper: blend a single 16 bit pixel at 50% */
-#define BLEND16_50(dst, src, mask)          \
-    do {                        \
-    Uint32 s = *src++;              \
-    Uint32 d = *dst;                \
-    *dst++ = (Uint16)((((s & mask) + (d & mask)) >> 1) +    \
-                      (s & d & (~mask & 0xffff)));      \
-    } while(0)
-
-/* basic 16bpp blender. mask is the pixels to keep when adding. */
-#define ALPHA_BLIT16_50(to, from, length, bpp, alpha, mask)     \
-    do {                                \
-    unsigned n = (length);                      \
-    Uint16 *src = (Uint16 *)(from);                 \
-    Uint16 *dst = (Uint16 *)(to);                   \
-    if(((uintptr_t)src ^ (uintptr_t)dst) & 3) {         \
-        /* source and destination not in phase, blit one by one */  \
-        while(n--)                          \
-        BLEND16_50(dst, src, mask);             \
-    } else {                            \
-        if((uintptr_t)src & 3) {                    \
-        /* first odd pixel */                   \
-        BLEND16_50(dst, src, mask);             \
-        n--;                            \
-        }                               \
-        for(; n > 1; n -= 2) {                  \
-        Uint32 s = *(Uint32 *)src;              \
-        Uint32 d = *(Uint32 *)dst;              \
-        *(Uint32 *)dst = ((s & (mask | mask << 16)) >> 1)   \
-                       + ((d & (mask | mask << 16)) >> 1)   \
-                       + (s & d & (~(mask | mask << 16)));  \
-        src += 2;                       \
-        dst += 2;                       \
-        }                               \
-        if(n)                           \
-        BLEND16_50(dst, src, mask); /* last odd pixel */    \
-    }                               \
-    } while(0)
-
-#define ALPHA_BLIT16_565_50(to, from, length, bpp, alpha)   \
-    ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xf7de)
-
-#define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha)   \
-    ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbde)
-
-#define CHOOSE_BLIT(blitter, alpha, fmt)                \
-    do {                                \
-        if(alpha == 255) {                      \
-        switch(fmt->BytesPerPixel) {                \
-        case 1: blitter(1, Uint8, OPAQUE_BLIT); break;      \
-        case 2: blitter(2, Uint8, OPAQUE_BLIT); break;      \
-        case 3: blitter(3, Uint8, OPAQUE_BLIT); break;      \
-        case 4: blitter(4, Uint16, OPAQUE_BLIT); break;     \
-        }                               \
-    } else {                            \
-        switch(fmt->BytesPerPixel) {                \
-        case 1:                         \
-        /* No 8bpp alpha blitting */                \
-        break;                          \
-                                    \
-        case 2:                         \
-        switch(fmt->Rmask | fmt->Gmask | fmt->Bmask) {      \
-        case 0xffff:                        \
-            if(fmt->Gmask == 0x07e0             \
-               || fmt->Rmask == 0x07e0              \
-               || fmt->Bmask == 0x07e0) {           \
-            if(alpha == 128)                \
-                blitter(2, Uint8, ALPHA_BLIT16_565_50); \
-            else {                      \
-                blitter(2, Uint8, ALPHA_BLIT16_565);    \
-            }                       \
-            } else                      \
-            goto general16;                 \
-            break;                      \
-                                    \
-        case 0x7fff:                        \
-            if(fmt->Gmask == 0x03e0             \
-               || fmt->Rmask == 0x03e0              \
-               || fmt->Bmask == 0x03e0) {           \
-            if(alpha == 128)                \
-                blitter(2, Uint8, ALPHA_BLIT16_555_50); \
-            else {                      \
-                blitter(2, Uint8, ALPHA_BLIT16_555);    \
-            }                       \
-            break;                      \
-            }                           \
-            /* fallthrough */                   \
-                                    \
-        default:                        \
-        general16:                      \
-            blitter(2, Uint8, ALPHA_BLIT_ANY);          \
-        }                           \
-        break;                          \
-                                    \
-        case 3:                         \
-        blitter(3, Uint8, ALPHA_BLIT_ANY);          \
-        break;                          \
-                                    \
-        case 4:                         \
-        if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \
-           && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \
-               || fmt->Bmask == 0xff00)) {          \
-            if(alpha == 128)                    \
-            blitter(4, Uint16, ALPHA_BLIT32_888_50);    \
-            else                        \
-            blitter(4, Uint16, ALPHA_BLIT32_888);       \
-        } else                          \
-            blitter(4, Uint16, ALPHA_BLIT_ANY);         \
-        break;                          \
-        }                               \
-    }                               \
-    } while(0)
-
-/*
- * This takes care of the case when the surface is clipped on the left and/or
- * right. Top clipping has already been taken care of.
- */
-static void
-RLEClipBlit(int w, Uint8 * srcbuf, SDL_Surface * dst,
-            Uint8 * dstbuf, SDL_Rect * srcrect, unsigned alpha)
-{
-    SDL_PixelFormat *fmt = dst->format;
-
-#define RLECLIPBLIT(bpp, Type, do_blit)                    \
-    do {                                   \
-    int linecount = srcrect->h;                    \
-    int ofs = 0;                               \
-    int left = srcrect->x;                         \
-    int right = left + srcrect->w;                     \
-    dstbuf -= left * bpp;                          \
-    for(;;) {                              \
-        int run;                               \
-        ofs += *(Type *)srcbuf;                    \
-        run = ((Type *)srcbuf)[1];                     \
-        srcbuf += 2 * sizeof(Type);                    \
-        if(run) {                              \
-        /* clip to left and right borders */               \
-        if(ofs < right) {                      \
-            int start = 0;                     \
-            int len = run;                     \
-            int startcol;                      \
-            if(left - ofs > 0) {                   \
-            start = left - ofs;                \
-            len -= start;                      \
-            if(len <= 0)                       \
-                goto nocopy ## bpp ## do_blit;         \
-            }                              \
-            startcol = ofs + start;                \
-            if(len > right - startcol)                 \
-            len = right - startcol;                \
-            do_blit(dstbuf + startcol * bpp, srcbuf + start * bpp, \
-                len, bpp, alpha);                  \
-        }                              \
-        nocopy ## bpp ## do_blit:                      \
-        srcbuf += run * bpp;                       \
-        ofs += run;                        \
-        } else if(!ofs)                        \
-        break;                             \
-        if(ofs == w) {                         \
-        ofs = 0;                           \
-        dstbuf += dst->pitch;                      \
-        if(!--linecount)                       \
-            break;                         \
-        }                                  \
-    }                                  \
-    } while(0)
-
-    CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
-
-#undef RLECLIPBLIT
-
-}
-
-
-/* blit a colorkeyed RLE surface */
-int
-SDL_RLEBlit(SDL_Surface * src, SDL_Rect * srcrect,
-            SDL_Surface * dst, SDL_Rect * dstrect)
-{
-    Uint8 *dstbuf;
-    Uint8 *srcbuf;
-    int x, y;
-    int w = src->w;
-    unsigned alpha;
-
-    /* Lock the destination if necessary */
-    if (SDL_MUSTLOCK(dst)) {
-        if (SDL_LockSurface(dst) < 0) {
-            return (-1);
-        }
-    }
-
-    /* Set up the source and destination pointers */
-    x = dstrect->x;
-    y = dstrect->y;
-    dstbuf = (Uint8 *) dst->pixels
-        + y * dst->pitch + x * src->format->BytesPerPixel;
-    srcbuf = (Uint8 *) src->map->data;
-
-    {
-        /* skip lines at the top if necessary */
-        int vskip = srcrect->y;
-        int ofs = 0;
-        if (vskip) {
-
-#define RLESKIP(bpp, Type)          \
-        for(;;) {           \
-            int run;            \
-            ofs += *(Type *)srcbuf; \
-            run = ((Type *)srcbuf)[1];  \
-            srcbuf += sizeof(Type) * 2; \
-            if(run) {           \
-            srcbuf += run * bpp;    \
-            ofs += run;     \
-            } else if(!ofs)     \
-            goto done;      \
-            if(ofs == w) {      \
-            ofs = 0;        \
-            if(!--vskip)        \
-                break;      \
-            }               \
-        }
-
-            switch (src->format->BytesPerPixel) {
-            case 1:
-                RLESKIP(1, Uint8);
-                break;
-            case 2:
-                RLESKIP(2, Uint8);
-                break;
-            case 3:
-                RLESKIP(3, Uint8);
-                break;
-            case 4:
-                RLESKIP(4, Uint16);
-                break;
-            }
-
-#undef RLESKIP
-
-        }
-    }
-
-    alpha = src->map->info.a;
-    /* if left or right edge clipping needed, call clip blit */
-    if (srcrect->x || srcrect->w != src->w) {
-        RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha);
-    } else {
-        SDL_PixelFormat *fmt = src->format;
-
-#define RLEBLIT(bpp, Type, do_blit)                       \
-        do {                                  \
-        int linecount = srcrect->h;                   \
-        int ofs = 0;                              \
-        for(;;) {                             \
-            unsigned run;                         \
-            ofs += *(Type *)srcbuf;                   \
-            run = ((Type *)srcbuf)[1];                    \
-            srcbuf += 2 * sizeof(Type);                   \
-            if(run) {                             \
-            do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \
-            srcbuf += run * bpp;                      \
-            ofs += run;                       \
-            } else if(!ofs)                       \
-            break;                            \
-            if(ofs == w) {                        \
-            ofs = 0;                          \
-            dstbuf += dst->pitch;                     \
-            if(!--linecount)                      \
-                break;                        \
-            }                                 \
-        }                                 \
-        } while(0)
-
-        CHOOSE_BLIT(RLEBLIT, alpha, fmt);
-
-#undef RLEBLIT
-    }
-
-  done:
-    /* Unlock the destination if necessary */
-    if (SDL_MUSTLOCK(dst)) {
-        SDL_UnlockSurface(dst);
-    }
-    return (0);
-}
-
-#undef OPAQUE_BLIT
-
-/*
- * Per-pixel blitting macros for translucent pixels:
- * These use the same techniques as the per-surface blitting macros
- */
-
-/*
- * For 32bpp pixels, we have made sure the alpha is stored in the top
- * 8 bits, so proceed as usual
- */
-#define BLIT_TRANSL_888(src, dst)               \
-    do {                            \
-        Uint32 s = src;                     \
-    Uint32 d = dst;                     \
-    unsigned alpha = s >> 24;               \
-    Uint32 s1 = s & 0xff00ff;               \
-    Uint32 d1 = d & 0xff00ff;               \
-    d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff;    \
-    s &= 0xff00;                        \
-    d &= 0xff00;                        \
-    d = (d + ((s - d) * alpha >> 8)) & 0xff00;      \
-    dst = d1 | d | 0xff000000;              \
-    } while(0)
-
-/*
- * For 16bpp pixels, we have stored the 5 most significant alpha bits in
- * bits 5-10. As before, we can process all 3 RGB components at the same time.
- */
-#define BLIT_TRANSL_565(src, dst)       \
-    do {                    \
-    Uint32 s = src;             \
-    Uint32 d = dst;             \
-    unsigned alpha = (s & 0x3e0) >> 5;  \
-    s &= 0x07e0f81f;            \
-    d = (d | d << 16) & 0x07e0f81f;     \
-    d += (s - d) * alpha >> 5;      \
-    d &= 0x07e0f81f;            \
-    dst = (Uint16)(d | d >> 16);            \
-    } while(0)
-
-#define BLIT_TRANSL_555(src, dst)       \
-    do {                    \
-    Uint32 s = src;             \
-    Uint32 d = dst;             \
-    unsigned alpha = (s & 0x3e0) >> 5;  \
-    s &= 0x03e07c1f;            \
-    d = (d | d << 16) & 0x03e07c1f;     \
-    d += (s - d) * alpha >> 5;      \
-    d &= 0x03e07c1f;            \
-    dst = (Uint16)(d | d >> 16);            \
-    } while(0)
-
-/* used to save the destination format in the encoding. Designed to be
-   macro-compatible with SDL_PixelFormat but without the unneeded fields */
-typedef struct
-{
-    Uint8 BytesPerPixel;
-    Uint8 padding[3];
-    Uint32 Rmask;
-    Uint32 Gmask;
-    Uint32 Bmask;
-    Uint32 Amask;
-    Uint8 Rloss;
-    Uint8 Gloss;
-    Uint8 Bloss;
-    Uint8 Aloss;
-    Uint8 Rshift;
-    Uint8 Gshift;
-    Uint8 Bshift;
-    Uint8 Ashift;
-} RLEDestFormat;
-
-/* blit a pixel-alpha RLE surface clipped at the right and/or left edges */
-static void
-RLEAlphaClipBlit(int w, Uint8 * srcbuf, SDL_Surface * dst,
-                 Uint8 * dstbuf, SDL_Rect * srcrect)
-{
-    SDL_PixelFormat *df = dst->format;
-    /*
-     * clipped blitter: Ptype is the destination pixel type,
-     * Ctype the translucent count type, and do_blend the macro
-     * to blend one pixel.
-     */
-#define RLEALPHACLIPBLIT(Ptype, Ctype, do_blend)              \
-    do {                                  \
-    int linecount = srcrect->h;                   \
-    int left = srcrect->x;                        \
-    int right = left + srcrect->w;                    \
-    dstbuf -= left * sizeof(Ptype);                   \
-    do {                                  \
-        int ofs = 0;                          \
-        /* blit opaque pixels on one line */              \
-        do {                              \
-        unsigned run;                         \
-        ofs += ((Ctype *)srcbuf)[0];                  \
-        run = ((Ctype *)srcbuf)[1];               \
-        srcbuf += 2 * sizeof(Ctype);                  \
-        if(run) {                         \
-            /* clip to left and right borders */          \
-            int cofs = ofs;                   \
-            int crun = run;                   \
-            if(left - cofs > 0) {                 \
-            crun -= left - cofs;                  \
-            cofs = left;                      \
-            }                             \
-            if(crun > right - cofs)               \
-            crun = right - cofs;                  \
-            if(crun > 0)                      \
-            PIXEL_COPY(dstbuf + cofs * sizeof(Ptype),     \
-                   srcbuf + (cofs - ofs) * sizeof(Ptype), \
-                   (unsigned)crun, sizeof(Ptype));    \
-            srcbuf += run * sizeof(Ptype);            \
-            ofs += run;                       \
-        } else if(!ofs)                       \
-            return;                       \
-        } while(ofs < w);                         \
-        /* skip padding if necessary */               \
-        if(sizeof(Ptype) == 2)                    \
-        srcbuf += (uintptr_t)srcbuf & 2;              \
-        /* blit translucent pixels on the same line */        \
-        ofs = 0;                              \
-        do {                              \
-        unsigned run;                         \
-        ofs += ((Uint16 *)srcbuf)[0];                 \
-        run = ((Uint16 *)srcbuf)[1];                  \
-        srcbuf += 4;                          \
-        if(run) {                         \
-            /* clip to left and right borders */          \
-            int cofs = ofs;                   \
-            int crun = run;                   \
-            if(left - cofs > 0) {                 \
-            crun -= left - cofs;                  \
-            cofs = left;                      \
-            }                             \
-            if(crun > right - cofs)               \
-            crun = right - cofs;                  \
-            if(crun > 0) {                    \
-            Ptype *dst = (Ptype *)dstbuf + cofs;          \
-            Uint32 *src = (Uint32 *)srcbuf + (cofs - ofs);    \
-            int i;                        \
-            for(i = 0; i < crun; i++)             \
-                do_blend(src[i], dst[i]);             \
-            }                             \
-            srcbuf += run * 4;                    \
-            ofs += run;                       \
-        }                             \
-        } while(ofs < w);                         \
-        dstbuf += dst->pitch;                     \
-    } while(--linecount);                         \
-    } while(0)
-
-    switch (df->BytesPerPixel) {
-    case 2:
-        if (df->Gmask == 0x07e0 || df->Rmask == 0x07e0 || df->Bmask == 0x07e0)
-            RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_565);
-        else
-            RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_555);
-        break;
-    case 4:
-        RLEALPHACLIPBLIT(Uint32, Uint16, BLIT_TRANSL_888);
-        break;
-    }
-}
-
-/* blit a pixel-alpha RLE surface */
-int
-SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect,
-                 SDL_Surface * dst, SDL_Rect * dstrect)
-{
-    int x, y;
-    int w = src->w;
-    Uint8 *srcbuf, *dstbuf;
-    SDL_PixelFormat *df = dst->format;
-
-    /* Lock the destination if necessary */
-    if (SDL_MUSTLOCK(dst)) {
-        if (SDL_LockSurface(dst) < 0) {
-            return -1;
-        }
-    }
-
-    x = dstrect->x;
-    y = dstrect->y;
-    dstbuf = (Uint8 *) dst->pixels + y * dst->pitch + x * df->BytesPerPixel;
-    srcbuf = (Uint8 *) src->map->data + sizeof(RLEDestFormat);
-
-    {
-        /* skip lines at the top if necessary */
-        int vskip = srcrect->y;
-        if (vskip) {
-            int ofs;
-            if (df->BytesPerPixel == 2) {
-                /* the 16/32 interleaved format */
-                do {
-                    /* skip opaque line */
-                    ofs = 0;
-                    do {
-                        int run;
-                        ofs += srcbuf[0];
-                        run = srcbuf[1];
-                        srcbuf += 2;
-                        if (run) {
-                            srcbuf += 2 * run;
-                            ofs += run;
-                        } else if (!ofs)
-                            goto done;
-                    } while (ofs < w);
-
-                    /* skip padding */
-                    srcbuf += (uintptr_t) srcbuf & 2;
-
-                    /* skip translucent line */
-                    ofs = 0;
-                    do {
-                        int run;
-                        ofs += ((Uint16 *) srcbuf)[0];
-                        run = ((Uint16 *) srcbuf)[1];
-                        srcbuf += 4 * (run + 1);
-                        ofs += run;
-                    } while (ofs < w);
-                } while (--vskip);
-            } else {
-                /* the 32/32 interleaved format */
-                vskip <<= 1;    /* opaque and translucent have same format */
-                do {
-                    ofs = 0;
-                    do {
-                        int run;
-                        ofs += ((Uint16 *) srcbuf)[0];
-                        run = ((Uint16 *) srcbuf)[1];
-                        srcbuf += 4;
-                        if (run) {
-                            srcbuf += 4 * run;
-                            ofs += run;
-                        } else if (!ofs)
-                            goto done;
-                    } while (ofs < w);
-                } while (--vskip);
-            }
-        }
-    }
-
-    /* if left or right edge clipping needed, call clip blit */
-    if (srcrect->x || srcrect->w != src->w) {
-        RLEAlphaClipBlit(w, srcbuf, dst, dstbuf, srcrect);
-    } else {
-
-        /*
-         * non-clipped blitter. Ptype is the destination pixel type,
-         * Ctype the translucent count type, and do_blend the
-         * macro to blend one pixel.
-         */
-#define RLEALPHABLIT(Ptype, Ctype, do_blend)                 \
-    do {                                 \
-        int linecount = srcrect->h;                  \
-        do {                             \
-        int ofs = 0;                         \
-        /* blit opaque pixels on one line */             \
-        do {                             \
-            unsigned run;                    \
-            ofs += ((Ctype *)srcbuf)[0];             \
-            run = ((Ctype *)srcbuf)[1];              \
-            srcbuf += 2 * sizeof(Ctype);             \
-            if(run) {                        \
-            PIXEL_COPY(dstbuf + ofs * sizeof(Ptype), srcbuf, \
-                   run, sizeof(Ptype));          \
-            srcbuf += run * sizeof(Ptype);           \
-            ofs += run;                  \
-            } else if(!ofs)                  \
-            goto done;                   \
-        } while(ofs < w);                    \
-        /* skip padding if necessary */              \
-        if(sizeof(Ptype) == 2)                   \
-            srcbuf += (uintptr_t)srcbuf & 2;             \
-        /* blit translucent pixels on the same line */       \
-        ofs = 0;                         \
-        do {                             \
-            unsigned run;                    \
-            ofs += ((Uint16 *)srcbuf)[0];            \
-            run = ((Uint16 *)srcbuf)[1];             \
-            srcbuf += 4;                     \
-            if(run) {                        \
-            Ptype *dst = (Ptype *)dstbuf + ofs;      \
-            unsigned i;                  \
-            for(i = 0; i < run; i++) {           \
-                Uint32 src = *(Uint32 *)srcbuf;      \
-                do_blend(src, *dst);             \
-                srcbuf += 4;                 \
-                dst++;                   \
-            }                        \
-            ofs += run;                  \
-            }                            \
-        } while(ofs < w);                    \
-        dstbuf += dst->pitch;                    \
-        } while(--linecount);                    \
-    } while(0)
-
-        switch (df->BytesPerPixel) {
-        case 2:
-            if (df->Gmask == 0x07e0 || df->Rmask == 0x07e0
-                || df->Bmask == 0x07e0)
-                RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_565);
-            else
-                RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_555);
-            break;
-        case 4:
-            RLEALPHABLIT(Uint32, Uint16, BLIT_TRANSL_888);
-            break;
-        }
-    }
-
-  done:
-    /* Unlock the destination if necessary */
-    if (SDL_MUSTLOCK(dst)) {
-        SDL_UnlockSurface(dst);
-    }
-    return 0;
-}
-
-/*
- * Auxiliary functions:
- * The encoding functions take 32bpp rgb + a, and
- * return the number of bytes copied to the destination.
- * The decoding functions copy to 32bpp rgb + a, and
- * return the number of bytes copied from the source.
- * These are only used in the encoder and un-RLE code and are therefore not
- * highly optimised.
- */
-
-/* encode 32bpp rgb + a into 16bpp rgb, losing alpha */
-static int
-copy_opaque_16(void *dst, Uint32 * src, int n,
-               SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt)
-{
-    int i;
-    Uint16 *d = dst;
-    for (i = 0; i < n; i++) {
-        unsigned r, g, b;
-        RGB_FROM_PIXEL(*src, sfmt, r, g, b);
-        PIXEL_FROM_RGB(*d, dfmt, r, g, b);
-        src++;
-        d++;
-    }
-    return n * 2;
-}
-
-/* decode opaque pixels from 16bpp to 32bpp rgb + a */
-static int
-uncopy_opaque_16(Uint32 * dst, void *src, int n,
-                 RLEDestFormat * sfmt, SDL_PixelFormat * dfmt)
-{
-    int i;
-    Uint16 *s = src;
-    unsigned alpha = dfmt->Amask ? 255 : 0;
-    for (i = 0; i < n; i++) {
-        unsigned r, g, b;
-        RGB_FROM_PIXEL(*s, sfmt, r, g, b);
-        PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, alpha);
-        s++;
-        dst++;
-    }
-    return n * 2;
-}
-
-
-
-/* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 565 */
-static int
-copy_transl_565(void *dst, Uint32 * src, int n,
-                SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt)
-{
-    int i;
-    Uint32 *d = dst;
-    for (i = 0; i < n; i++) {
-        unsigned r, g, b, a;
-        Uint16 pix;
-        RGBA_FROM_8888(*src, sfmt, r, g, b, a);
-        PIXEL_FROM_RGB(pix, dfmt, r, g, b);
-        *d = ((pix & 0x7e0) << 16) | (pix & 0xf81f) | ((a << 2) & 0x7e0);
-        src++;
-        d++;
-    }
-    return n * 4;
-}
-
-/* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 555 */
-static int
-copy_transl_555(void *dst, Uint32 * src, int n,
-                SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt)
-{
-    int i;
-    Uint32 *d = dst;
-    for (i = 0; i < n; i++) {
-        unsigned r, g, b, a;
-        Uint16 pix;
-        RGBA_FROM_8888(*src, sfmt, r, g, b, a);
-        PIXEL_FROM_RGB(pix, dfmt, r, g, b);
-        *d = ((pix & 0x3e0) << 16) | (pix & 0xfc1f) | ((a << 2) & 0x3e0);
-        src++;
-        d++;
-    }
-    return n * 4;
-}
-
-/* decode translucent pixels from 32bpp GORAB to 32bpp rgb + a */
-static int
-uncopy_transl_16(Uint32 * dst, void *src, int n,
-                 RLEDestFormat * sfmt, SDL_PixelFormat * dfmt)
-{
-    int i;
-    Uint32 *s = src;
-    for (i = 0; i < n; i++) {
-        unsigned r, g, b, a;
-        Uint32 pix = *s++;
-        a = (pix & 0x3e0) >> 2;
-        pix = (pix & ~0x3e0) | pix >> 16;
-        RGB_FROM_PIXEL(pix, sfmt, r, g, b);
-        PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a);
-        dst++;
-    }
-    return n * 4;
-}
-
-/* encode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */
-static int
-copy_32(void *dst, Uint32 * src, int n,
-        SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt)
-{
-    int i;
-    Uint32 *d = dst;
-    for (i = 0; i < n; i++) {
-        unsigned r, g, b, a;
-        RGBA_FROM_8888(*src, sfmt, r, g, b, a);
-        PIXEL_FROM_RGBA(*d, dfmt, r, g, b, a);
-        d++;
-        src++;
-    }
-    return n * 4;
-}
-
-/* decode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */
-static int
-uncopy_32(Uint32 * dst, void *src, int n,
-          RLEDestFormat * sfmt, SDL_PixelFormat * dfmt)
-{
-    int i;
-    Uint32 *s = src;
-    for (i = 0; i < n; i++) {
-        unsigned r, g, b, a;
-        Uint32 pixel = *s++;
-        RGB_FROM_PIXEL(pixel, sfmt, r, g, b);
-        a = pixel >> 24;
-        PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a);
-        dst++;
-    }
-    return n * 4;
-}
-
-#define ISOPAQUE(pixel, fmt) ((((pixel) & fmt->Amask) >> fmt->Ashift) == 255)
-
-#define ISTRANSL(pixel, fmt)    \
-    ((unsigned)((((pixel) & fmt->Amask) >> fmt->Ashift) - 1U) < 254U)
-
-/* convert surface to be quickly alpha-blittable onto dest, if possible */
-static int
-RLEAlphaSurface(SDL_Surface * surface)
-{
-    SDL_Surface *dest;
-    SDL_PixelFormat *df;
-    int maxsize = 0;
-    int max_opaque_run;
-    int max_transl_run = 65535;
-    unsigned masksum;
-    Uint8 *rlebuf, *dst;
-    int (*copy_opaque) (void *, Uint32 *, int,
-                        SDL_PixelFormat *, SDL_PixelFormat *);
-    int (*copy_transl) (void *, Uint32 *, int,
-                        SDL_PixelFormat *, SDL_PixelFormat *);
-
-    dest = surface->map->dst;
-    if (!dest)
-        return -1;
-    df = dest->format;
-    if (surface->format->BitsPerPixel != 32)
-        return -1;              /* only 32bpp source supported */
-
-    /* find out whether the destination is one we support,
-       and determine the max size of the encoded result */
-    masksum = df->Rmask | df->Gmask | df->Bmask;
-    switch (df->BytesPerPixel) {
-    case 2:
-        /* 16bpp: only support 565 and 555 formats */
-        switch (masksum) {
-        case 0xffff:
-            if (df->Gmask == 0x07e0
-                || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) {
-                copy_opaque = copy_opaque_16;
-                copy_transl = copy_transl_565;
-            } else
-                return -1;
-            break;
-        case 0x7fff:
-            if (df->Gmask == 0x03e0
-                || df->Rmask == 0x03e0 || df->Bmask == 0x03e0) {
-                copy_opaque = copy_opaque_16;
-                copy_transl = copy_transl_555;
-            } else
-                return -1;
-            break;
-        default:
-            return -1;
-        }
-        max_opaque_run = 255;   /* runs stored as bytes */
-
-        /* worst case is alternating opaque and translucent pixels,
-           with room for alignment padding between lines */
-        maxsize = surface->h * (2 + (4 + 2) * (surface->w + 1)) + 2;
-        break;
-    case 4:
-        if (masksum != 0x00ffffff)
-            return -1;          /* requires unused high byte */
-        copy_opaque = copy_32;
-        copy_transl = copy_32;
-        max_opaque_run = 255;   /* runs stored as short ints */
-
-        /* worst case is alternating opaque and translucent pixels */
-        maxsize = surface->h * 2 * 4 * (surface->w + 1) + 4;
-        break;
-    default:
-        return -1;              /* anything else unsupported right now */
-    }
-
-    maxsize += sizeof(RLEDestFormat);
-    rlebuf = (Uint8 *) SDL_malloc(maxsize);
-    if (!rlebuf) {
-        return SDL_OutOfMemory();
-    }
-    {
-        /* save the destination format so we can undo the encoding later */
-        RLEDestFormat *r = (RLEDestFormat *) rlebuf;
-        r->BytesPerPixel = df->BytesPerPixel;
-        r->Rmask = df->Rmask;
-        r->Gmask = df->Gmask;
-        r->Bmask = df->Bmask;
-        r->Amask = df->Amask;
-        r->Rloss = df->Rloss;
-        r->Gloss = df->Gloss;
-        r->Bloss = df->Bloss;
-        r->Aloss = df->Aloss;
-        r->Rshift = df->Rshift;
-        r->Gshift = df->Gshift;
-        r->Bshift = df->Bshift;
-        r->Ashift = df->Ashift;
-    }
-    dst = rlebuf + sizeof(RLEDestFormat);
-
-    /* Do the actual encoding */
-    {
-        int x, y;
-        int h = surface->h, w = surface->w;
-        SDL_PixelFormat *sf = surface->format;
-        Uint32 *src = (Uint32 *) surface->pixels;
-        Uint8 *lastline = dst;  /* end of last non-blank line */
-
-        /* opaque counts are 8 or 16 bits, depending on target depth */
-#define ADD_OPAQUE_COUNTS(n, m)         \
-    if(df->BytesPerPixel == 4) {        \
-        ((Uint16 *)dst)[0] = n;     \
-        ((Uint16 *)dst)[1] = m;     \
-        dst += 4;               \
-    } else {                \
-        dst[0] = n;             \
-        dst[1] = m;             \
-        dst += 2;               \
-    }
-
-        /* translucent counts are always 16 bit */
-#define ADD_TRANSL_COUNTS(n, m)     \
-    (((Uint16 *)dst)[0] = n, ((Uint16 *)dst)[1] = m, dst += 4)
-
-        for (y = 0; y < h; y++) {
-            int runstart, skipstart;
-            int blankline = 0;
-            /* First encode all opaque pixels of a scan line */
-            x = 0;
-            do {
-                int run, skip, len;
-                skipstart = x;
-                while (x < w && !ISOPAQUE(src[x], sf))
-                    x++;
-                runstart = x;
-                while (x < w && ISOPAQUE(src[x], sf))
-                    x++;
-                skip = runstart - skipstart;
-                if (skip == w)
-                    blankline = 1;
-                run = x - runstart;
-                while (skip > max_opaque_run) {
-                    ADD_OPAQUE_COUNTS(max_opaque_run, 0);
-                    skip -= max_opaque_run;
-                }
-                len = MIN(run, max_opaque_run);
-                ADD_OPAQUE_COUNTS(skip, len);
-                dst += copy_opaque(dst, src + runstart, len, sf, df);
-                runstart += len;
-                run -= len;
-                while (run) {
-                    len = MIN(run, max_opaque_run);
-                    ADD_OPAQUE_COUNTS(0, len);
-                    dst += copy_opaque(dst, src + runstart, len, sf, df);
-                    runstart += len;
-                    run -= len;
-                }
-            } while (x < w);
-
-            /* Make sure the next output address is 32-bit aligned */
-            dst += (uintptr_t) dst & 2;
-
-            /* Next, encode all translucent pixels of the same scan line */
-            x = 0;
-            do {
-                int run, skip, len;
-                skipstart = x;
-                while (x < w && !ISTRANSL(src[x], sf))
-                    x++;
-                runstart = x;
-                while (x < w && ISTRANSL(src[x], sf))
-                    x++;
-                skip = runstart - skipstart;
-                blankline &= (skip == w);
-                run = x - runstart;
-                while (skip > max_transl_run) {
-                    ADD_TRANSL_COUNTS(max_transl_run, 0);
-                    skip -= max_transl_run;
-                }
-                len = MIN(run, max_transl_run);
-                ADD_TRANSL_COUNTS(skip, len);
-                dst += copy_transl(dst, src + runstart, len, sf, df);
-                runstart += len;
-                run -= len;
-                while (run) {
-                    len = MIN(run, max_transl_run);
-                    ADD_TRANSL_COUNTS(0, len);
-                    dst += copy_transl(dst, src + runstart, len, sf, df);
-                    runstart += len;
-                    run -= len;
-                }
-                if (!blankline)
-                    lastline = dst;
-            } while (x < w);
-
-            src += surface->pitch >> 2;
-        }
-        dst = lastline;         /* back up past trailing blank lines */
-        ADD_OPAQUE_COUNTS(0, 0);
-    }
-
-#undef ADD_OPAQUE_COUNTS
-#undef ADD_TRANSL_COUNTS
-
-    /* Now that we have it encoded, release the original pixels */
-    if (!(surface->flags & SDL_PREALLOC)) {
-        SDL_free(surface->pixels);
-        surface->pixels = NULL;
-    }
-
-    /* realloc the buffer to release unused memory */
-    {
-        Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf);
-        if (!p)
-            p = rlebuf;
-        surface->map->data = p;
-    }
-
-    return 0;
-}
-
-static Uint32
-getpix_8(Uint8 * srcbuf)
-{
-    return *srcbuf;
-}
-
-static Uint32
-getpix_16(Uint8 * srcbuf)
-{
-    return *(Uint16 *) srcbuf;
-}
-
-static Uint32
-getpix_24(Uint8 * srcbuf)
-{
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-    return srcbuf[0] + (srcbuf[1] << 8) + (srcbuf[2] << 16);
-#else
-    return (srcbuf[0] << 16) + (srcbuf[1] << 8) + srcbuf[2];
-#endif
-}
-
-static Uint32
-getpix_32(Uint8 * srcbuf)
-{
-    return *(Uint32 *) srcbuf;
-}
-
-typedef Uint32(*getpix_func) (Uint8 *);
-
-static const getpix_func getpixes[4] = {
-    getpix_8, getpix_16, getpix_24, getpix_32
-};
-
-static int
-RLEColorkeySurface(SDL_Surface * surface)
-{
-    Uint8 *rlebuf, *dst;
-    int maxn;
-    int y;
-    Uint8 *srcbuf, *lastline;
-    int maxsize = 0;
-    int bpp = surface->format->BytesPerPixel;
-    getpix_func getpix;
-    Uint32 ckey, rgbmask;
-    int w, h;
-
-    /* calculate the worst case size for the compressed surface */
-    switch (bpp) {
-    case 1:
-        /* worst case is alternating opaque and transparent pixels,
-           starting with an opaque pixel */
-        maxsize = surface->h * 3 * (surface->w / 2 + 1) + 2;
-        break;
-    case 2:
-    case 3:
-        /* worst case is solid runs, at most 255 pixels wide */
-        maxsize = surface->h * (2 * (surface->w / 255 + 1)
-                                + surface->w * bpp) + 2;
-        break;
-    case 4:
-        /* worst case is solid runs, at most 65535 pixels wide */
-        maxsize = surface->h * (4 * (surface->w / 65535 + 1)
-                                + surface->w * 4) + 4;
-        break;
-    }
-
-    rlebuf = (Uint8 *) SDL_malloc(maxsize);
-    if (rlebuf == NULL) {
-        return SDL_OutOfMemory();
-    }
-
-    /* Set up the conversion */
-    srcbuf = (Uint8 *) surface->pixels;
-    maxn = bpp == 4 ? 65535 : 255;
-    dst = rlebuf;
-    rgbmask = ~surface->format->Amask;
-    ckey = surface->map->info.colorkey & rgbmask;
-    lastline = dst;
-    getpix = getpixes[bpp - 1];
-    w = surface->w;
-    h = surface->h;
-
-#define ADD_COUNTS(n, m)            \
-    if(bpp == 4) {              \
-        ((Uint16 *)dst)[0] = n;     \
-        ((Uint16 *)dst)[1] = m;     \
-        dst += 4;               \
-    } else {                \
-        dst[0] = n;             \
-        dst[1] = m;             \
-        dst += 2;               \
-    }
-
-    for (y = 0; y < h; y++) {
-        int x = 0;
-        int blankline = 0;
-        do {
-            int run, skip, len;
-            int runstart;
-            int skipstart = x;
-
-            /* find run of transparent, then opaque pixels */
-            while (x < w && (getpix(srcbuf + x * bpp) & rgbmask) == ckey)
-                x++;
-            runstart = x;
-            while (x < w && (getpix(srcbuf + x * bpp) & rgbmask) != ckey)
-                x++;
-            skip = runstart - skipstart;
-            if (skip == w)
-                blankline = 1;
-            run = x - runstart;
-
-            /* encode segment */
-            while (skip > maxn) {
-                ADD_COUNTS(maxn, 0);
-                skip -= maxn;
-            }
-            len = MIN(run, maxn);
-            ADD_COUNTS(skip, len);
-            SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp);
-            dst += len * bpp;
-            run -= len;
-            runstart += len;
-            while (run) {
-                len = MIN(run, maxn);
-                ADD_COUNTS(0, len);
-                SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp);
-                dst += len * bpp;
-                runstart += len;
-                run -= len;
-            }
-            if (!blankline)
-                lastline = dst;
-        } while (x < w);
-
-        srcbuf += surface->pitch;
-    }
-    dst = lastline;             /* back up bast trailing blank lines */
-    ADD_COUNTS(0, 0);
-
-#undef ADD_COUNTS
-
-    /* Now that we have it encoded, release the original pixels */
-    if (!(surface->flags & SDL_PREALLOC)) {
-        SDL_free(surface->pixels);
-        surface->pixels = NULL;
-    }
-
-    /* realloc the buffer to release unused memory */
-    {
-        /* If realloc returns NULL, the original block is left intact */
-        Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf);
-        if (!p)
-            p = rlebuf;
-        surface->map->data = p;
-    }
-
-    return (0);
-}
-
-int
-SDL_RLESurface(SDL_Surface * surface)
-{
-    int flags;
-
-    /* Clear any previous RLE conversion */
-    if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) {
-        SDL_UnRLESurface(surface, 1);
-    }
-
-    /* We don't support RLE encoding of bitmaps */
-    if (surface->format->BitsPerPixel < 8) {
-        return -1;
-    }
-
-    /* Make sure the pixels are available */
-    if (!surface->pixels) {
-        return -1;
-    }
-
-    /* If we don't have colorkey or blending, nothing to do... */
-    flags = surface->map->info.flags;
-    if (!(flags & (SDL_COPY_COLORKEY | SDL_COPY_BLEND))) {
-        return -1;
-    }
-
-    /* Pass on combinations not supported */
-    if ((flags & SDL_COPY_MODULATE_COLOR) ||
-        ((flags & SDL_COPY_MODULATE_ALPHA) && surface->format->Amask) ||
-        (flags & (SDL_COPY_ADD | SDL_COPY_MOD)) ||
-        (flags & SDL_COPY_NEAREST)) {
-        return -1;
-    }
-
-    /* Encode and set up the blit */
-    if (!surface->format->Amask || !(flags & SDL_COPY_BLEND)) {
-        if (!surface->map->identity) {
-            return -1;
-        }
-        if (RLEColorkeySurface(surface) < 0) {
-            return -1;
-        }
-        surface->map->blit = SDL_RLEBlit;
-        surface->map->info.flags |= SDL_COPY_RLE_COLORKEY;
-    } else {
-        if (RLEAlphaSurface(surface) < 0) {
-            return -1;
-        }
-        surface->map->blit = SDL_RLEAlphaBlit;
-        surface->map->info.flags |= SDL_COPY_RLE_ALPHAKEY;
-    }
-
-    /* The surface is now accelerated */
-    surface->flags |= SDL_RLEACCEL;
-
-    return (0);
-}
-
-/*
- * Un-RLE a surface with pixel alpha
- * This may not give back exactly the image before RLE-encoding; all
- * completely transparent pixels will be lost, and color and alpha depth
- * may have been reduced (when encoding for 16bpp targets).
- */
-static SDL_bool
-UnRLEAlpha(SDL_Surface * surface)
-{
-    Uint8 *srcbuf;
-    Uint32 *dst;
-    SDL_PixelFormat *sf = surface->format;
-    RLEDestFormat *df = surface->map->data;
-    int (*uncopy_opaque) (Uint32 *, void *, int,
-                          RLEDestFormat *, SDL_PixelFormat *);
-    int (*uncopy_transl) (Uint32 *, void *, int,
-                          RLEDestFormat *, SDL_PixelFormat *);
-    int w = surface->w;
-    int bpp = df->BytesPerPixel;
-
-    if (bpp == 2) {
-        uncopy_opaque = uncopy_opaque_16;
-        uncopy_transl = uncopy_transl_16;
-    } else {
-        uncopy_opaque = uncopy_transl = uncopy_32;
-    }
-
-    surface->pixels = SDL_malloc(surface->h * surface->pitch);
-    if (!surface->pixels) {
-        return (SDL_FALSE);
-    }
-    /* fill background with transparent pixels */
-    SDL_memset(surface->pixels, 0, surface->h * surface->pitch);
-
-    dst = surface->pixels;
-    srcbuf = (Uint8 *) (df + 1);
-    for (;;) {
-        /* copy opaque pixels */
-        int ofs = 0;
-        do {
-            unsigned run;
-            if (bpp == 2) {
-                ofs += srcbuf[0];
-                run = srcbuf[1];
-                srcbuf += 2;
-            } else {
-                ofs += ((Uint16 *) srcbuf)[0];
-                run = ((Uint16 *) srcbuf)[1];
-                srcbuf += 4;
-            }
-            if (run) {
-                srcbuf += uncopy_opaque(dst + ofs, srcbuf, run, df, sf);
-                ofs += run;
-            } else if (!ofs)
-                return (SDL_TRUE);
-        } while (ofs < w);
-
-        /* skip padding if needed */
-        if (bpp == 2)
-            srcbuf += (uintptr_t) srcbuf & 2;
-
-        /* copy translucent pixels */
-        ofs = 0;
-        do {
-            unsigned run;
-            ofs += ((Uint16 *) srcbuf)[0];
-            run = ((Uint16 *) srcbuf)[1];
-            srcbuf += 4;
-            if (run) {
-                srcbuf += uncopy_transl(dst + ofs, srcbuf, run, df, sf);
-                ofs += run;
-            }
-        } while (ofs < w);
-        dst += surface->pitch >> 2;
-    }
-    /* Make the compiler happy */
-    return (SDL_TRUE);
-}
-
-void
-SDL_UnRLESurface(SDL_Surface * surface, int recode)
-{
-    if (surface->flags & SDL_RLEACCEL) {
-        surface->flags &= ~SDL_RLEACCEL;
-
-        if (recode && !(surface->flags & SDL_PREALLOC)) {
-            if (surface->map->info.flags & SDL_COPY_RLE_COLORKEY) {
-                SDL_Rect full;
-
-                /* re-create the original surface */
-                surface->pixels = SDL_malloc(surface->h * surface->pitch);
-                if (!surface->pixels) {
-                    /* Oh crap... */
-                    surface->flags |= SDL_RLEACCEL;
-                    return;
-                }
-
-                /* fill it with the background color */
-                SDL_FillRect(surface, NULL, surface->map->info.colorkey);
-
-                /* now render the encoded surface */
-                full.x = full.y = 0;
-                full.w = surface->w;
-                full.h = surface->h;
-                SDL_RLEBlit(surface, &full, surface, &full);
-            } else {
-                if (!UnRLEAlpha(surface)) {
-                    /* Oh crap... */
-                    surface->flags |= SDL_RLEACCEL;
-                    return;
-                }
-            }
-        }
-        surface->map->info.flags &=
-            ~(SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY);
-
-        SDL_free(surface->map->data);
-        surface->map->data = NULL;
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_RLEaccel_c.h b/deps/SDL2/src/video/SDL_RLEaccel_c.h
deleted file mode 100644
index 986d114..0000000
--- a/deps/SDL2/src/video/SDL_RLEaccel_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_RLEaccel.c */
-
-extern int SDL_RLESurface(SDL_Surface * surface);
-extern int SDL_RLEBlit(SDL_Surface * src, SDL_Rect * srcrect,
-                       SDL_Surface * dst, SDL_Rect * dstrect);
-extern int SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect,
-                            SDL_Surface * dst, SDL_Rect * dstrect);
-extern void SDL_UnRLESurface(SDL_Surface * surface, int recode);
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit.c b/deps/SDL2/src/video/SDL_blit.c
deleted file mode 100644
index 7b4f9ed..0000000
--- a/deps/SDL2/src/video/SDL_blit.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_blit.h"
-#include "SDL_blit_auto.h"
-#include "SDL_blit_copy.h"
-#include "SDL_blit_slow.h"
-#include "SDL_RLEaccel_c.h"
-#include "SDL_pixels_c.h"
-
-/* The general purpose software blit routine */
-static int
-SDL_SoftBlit(SDL_Surface * src, SDL_Rect * srcrect,
-             SDL_Surface * dst, SDL_Rect * dstrect)
-{
-    int okay;
-    int src_locked;
-    int dst_locked;
-
-    /* Everything is okay at the beginning...  */
-    okay = 1;
-
-    /* Lock the destination if it's in hardware */
-    dst_locked = 0;
-    if (SDL_MUSTLOCK(dst)) {
-        if (SDL_LockSurface(dst) < 0) {
-            okay = 0;
-        } else {
-            dst_locked = 1;
-        }
-    }
-    /* Lock the source if it's in hardware */
-    src_locked = 0;
-    if (SDL_MUSTLOCK(src)) {
-        if (SDL_LockSurface(src) < 0) {
-            okay = 0;
-        } else {
-            src_locked = 1;
-        }
-    }
-
-    /* Set up source and destination buffer pointers, and BLIT! */
-    if (okay && !SDL_RectEmpty(srcrect)) {
-        SDL_BlitFunc RunBlit;
-        SDL_BlitInfo *info = &src->map->info;
-
-        /* Set up the blit information */
-        info->src = (Uint8 *) src->pixels +
-            (Uint16) srcrect->y * src->pitch +
-            (Uint16) srcrect->x * info->src_fmt->BytesPerPixel;
-        info->src_w = srcrect->w;
-        info->src_h = srcrect->h;
-        info->src_pitch = src->pitch;
-        info->src_skip =
-            info->src_pitch - info->src_w * info->src_fmt->BytesPerPixel;
-        info->dst =
-            (Uint8 *) dst->pixels + (Uint16) dstrect->y * dst->pitch +
-            (Uint16) dstrect->x * info->dst_fmt->BytesPerPixel;
-        info->dst_w = dstrect->w;
-        info->dst_h = dstrect->h;
-        info->dst_pitch = dst->pitch;
-        info->dst_skip =
-            info->dst_pitch - info->dst_w * info->dst_fmt->BytesPerPixel;
-        RunBlit = (SDL_BlitFunc) src->map->data;
-
-        /* Run the actual software blit */
-        RunBlit(info);
-    }
-
-    /* We need to unlock the surfaces if they're locked */
-    if (dst_locked) {
-        SDL_UnlockSurface(dst);
-    }
-    if (src_locked) {
-        SDL_UnlockSurface(src);
-    }
-    /* Blit is done! */
-    return (okay ? 0 : -1);
-}
-
-#ifdef __MACOSX__
-#include <sys/sysctl.h>
-
-static SDL_bool
-SDL_UseAltivecPrefetch()
-{
-    const char key[] = "hw.l3cachesize";
-    u_int64_t result = 0;
-    size_t typeSize = sizeof(result);
-
-    if (sysctlbyname(key, &result, &typeSize, NULL, 0) == 0 && result > 0) {
-        return SDL_TRUE;
-    } else {
-        return SDL_FALSE;
-    }
-}
-#else
-static SDL_bool
-SDL_UseAltivecPrefetch()
-{
-    /* Just guess G4 */
-    return SDL_TRUE;
-}
-#endif /* __MACOSX__ */
-
-static SDL_BlitFunc
-SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags,
-                   SDL_BlitFuncEntry * entries)
-{
-    int i, flagcheck;
-    static Uint32 features = 0xffffffff;
-
-    /* Get the available CPU features */
-    if (features == 0xffffffff) {
-        const char *override = SDL_getenv("SDL_BLIT_CPU_FEATURES");
-
-        features = SDL_CPU_ANY;
-
-        /* Allow an override for testing .. */
-        if (override) {
-            SDL_sscanf(override, "%u", &features);
-        } else {
-            if (SDL_HasMMX()) {
-                features |= SDL_CPU_MMX;
-            }
-            if (SDL_Has3DNow()) {
-                features |= SDL_CPU_3DNOW;
-            }
-            if (SDL_HasSSE()) {
-                features |= SDL_CPU_SSE;
-            }
-            if (SDL_HasSSE2()) {
-                features |= SDL_CPU_SSE2;
-            }
-            if (SDL_HasAltiVec()) {
-                if (SDL_UseAltivecPrefetch()) {
-                    features |= SDL_CPU_ALTIVEC_PREFETCH;
-                } else {
-                    features |= SDL_CPU_ALTIVEC_NOPREFETCH;
-                }
-            }
-        }
-    }
-
-    for (i = 0; entries[i].func; ++i) {
-        /* Check for matching pixel formats */
-        if (src_format != entries[i].src_format) {
-            continue;
-        }
-        if (dst_format != entries[i].dst_format) {
-            continue;
-        }
-
-        /* Check modulation flags */
-        flagcheck =
-            (flags & (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA));
-        if ((flagcheck & entries[i].flags) != flagcheck) {
-            continue;
-        }
-
-        /* Check blend flags */
-        flagcheck =
-            (flags &
-             (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD));
-        if ((flagcheck & entries[i].flags) != flagcheck) {
-            continue;
-        }
-
-        /* Check colorkey flag */
-        flagcheck = (flags & SDL_COPY_COLORKEY);
-        if ((flagcheck & entries[i].flags) != flagcheck) {
-            continue;
-        }
-
-        /* Check scaling flags */
-        flagcheck = (flags & SDL_COPY_NEAREST);
-        if ((flagcheck & entries[i].flags) != flagcheck) {
-            continue;
-        }
-
-        /* Check CPU features */
-        flagcheck = entries[i].cpu;
-        if ((flagcheck & features) != flagcheck) {
-            continue;
-        }
-
-        /* We found the best one! */
-        return entries[i].func;
-    }
-    return NULL;
-}
-
-/* Figure out which of many blit routines to set up on a surface */
-int
-SDL_CalculateBlit(SDL_Surface * surface)
-{
-    SDL_BlitFunc blit = NULL;
-    SDL_BlitMap *map = surface->map;
-    SDL_Surface *dst = map->dst;
-
-    /* Clean everything out to start */
-    if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) {
-        SDL_UnRLESurface(surface, 1);
-    }
-    map->blit = SDL_SoftBlit;
-    map->info.src_fmt = surface->format;
-    map->info.src_pitch = surface->pitch;
-    map->info.dst_fmt = dst->format;
-    map->info.dst_pitch = dst->pitch;
-
-    /* See if we can do RLE acceleration */
-    if (map->info.flags & SDL_COPY_RLE_DESIRED) {
-        if (SDL_RLESurface(surface) == 0) {
-            return 0;
-        }
-    }
-
-    /* Choose a standard blit function */
-    if (map->identity && !(map->info.flags & ~SDL_COPY_RLE_DESIRED)) {
-        blit = SDL_BlitCopy;
-    } else if (surface->format->BitsPerPixel < 8 &&
-               SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) {
-        blit = SDL_CalculateBlit0(surface);
-    } else if (surface->format->BytesPerPixel == 1 &&
-               SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) {
-        blit = SDL_CalculateBlit1(surface);
-    } else if (map->info.flags & SDL_COPY_BLEND) {
-        blit = SDL_CalculateBlitA(surface);
-    } else {
-        blit = SDL_CalculateBlitN(surface);
-    }
-    if (blit == NULL) {
-        Uint32 src_format = surface->format->format;
-        Uint32 dst_format = dst->format->format;
-
-        blit =
-            SDL_ChooseBlitFunc(src_format, dst_format, map->info.flags,
-                               SDL_GeneratedBlitFuncTable);
-    }
-#ifndef TEST_SLOW_BLIT
-    if (blit == NULL)
-#endif
-    {
-        Uint32 src_format = surface->format->format;
-        Uint32 dst_format = dst->format->format;
-
-        if (!SDL_ISPIXELFORMAT_INDEXED(src_format) &&
-            !SDL_ISPIXELFORMAT_FOURCC(src_format) &&
-            !SDL_ISPIXELFORMAT_INDEXED(dst_format) &&
-            !SDL_ISPIXELFORMAT_FOURCC(dst_format)) {
-            blit = SDL_Blit_Slow;
-        }
-    }
-    map->data = blit;
-
-    /* Make sure we have a blit function */
-    if (blit == NULL) {
-        SDL_InvalidateMap(map);
-        return SDL_SetError("Blit combination not supported");
-    }
-
-    return 0;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit.h b/deps/SDL2/src/video/SDL_blit.h
deleted file mode 100644
index 07d3af7..0000000
--- a/deps/SDL2/src/video/SDL_blit.h
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_blit_h
-#define _SDL_blit_h
-
-#include "SDL_cpuinfo.h"
-#include "SDL_endian.h"
-#include "SDL_surface.h"
-
-/* Table to do pixel byte expansion */
-extern Uint8* SDL_expand_byte[9];
-
-/* SDL blit copy flags */
-#define SDL_COPY_MODULATE_COLOR     0x00000001
-#define SDL_COPY_MODULATE_ALPHA     0x00000002
-#define SDL_COPY_BLEND              0x00000010
-#define SDL_COPY_ADD                0x00000020
-#define SDL_COPY_MOD                0x00000040
-#define SDL_COPY_COLORKEY           0x00000100
-#define SDL_COPY_NEAREST            0x00000200
-#define SDL_COPY_RLE_DESIRED        0x00001000
-#define SDL_COPY_RLE_COLORKEY       0x00002000
-#define SDL_COPY_RLE_ALPHAKEY       0x00004000
-#define SDL_COPY_RLE_MASK           (SDL_COPY_RLE_DESIRED|SDL_COPY_RLE_COLORKEY|SDL_COPY_RLE_ALPHAKEY)
-
-/* SDL blit CPU flags */
-#define SDL_CPU_ANY                 0x00000000
-#define SDL_CPU_MMX                 0x00000001
-#define SDL_CPU_3DNOW               0x00000002
-#define SDL_CPU_SSE                 0x00000004
-#define SDL_CPU_SSE2                0x00000008
-#define SDL_CPU_ALTIVEC_PREFETCH    0x00000010
-#define SDL_CPU_ALTIVEC_NOPREFETCH  0x00000020
-
-typedef struct
-{
-    Uint8 *src;
-    int src_w, src_h;
-    int src_pitch;
-    int src_skip;
-    Uint8 *dst;
-    int dst_w, dst_h;
-    int dst_pitch;
-    int dst_skip;
-    SDL_PixelFormat *src_fmt;
-    SDL_PixelFormat *dst_fmt;
-    Uint8 *table;
-    int flags;
-    Uint32 colorkey;
-    Uint8 r, g, b, a;
-} SDL_BlitInfo;
-
-typedef void (SDLCALL * SDL_BlitFunc) (SDL_BlitInfo * info);
-
-typedef struct
-{
-    Uint32 src_format;
-    Uint32 dst_format;
-    int flags;
-    int cpu;
-    SDL_BlitFunc func;
-} SDL_BlitFuncEntry;
-
-/* Blit mapping definition */
-typedef struct SDL_BlitMap
-{
-    SDL_Surface *dst;
-    int identity;
-    SDL_blit blit;
-    void *data;
-    SDL_BlitInfo info;
-
-    /* the version count matches the destination; mismatch indicates
-       an invalid mapping */
-    Uint32 dst_palette_version;
-    Uint32 src_palette_version;
-} SDL_BlitMap;
-
-/* Functions found in SDL_blit.c */
-extern int SDL_CalculateBlit(SDL_Surface * surface);
-
-/* Functions found in SDL_blit_*.c */
-extern SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface * surface);
-extern SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface * surface);
-extern SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface * surface);
-extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface * surface);
-
-/*
- * Useful macros for blitting routines
- */
-
-#if defined(__GNUC__)
-#define DECLARE_ALIGNED(t,v,a)  t __attribute__((aligned(a))) v
-#elif defined(_MSC_VER)
-#define DECLARE_ALIGNED(t,v,a)  __declspec(align(a)) t v
-#else
-#define DECLARE_ALIGNED(t,v,a)  t v
-#endif
-
-/* Load pixel of the specified format from a buffer and get its R-G-B values */
-#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b)                             \
-{                                                                       \
-    r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \
-    g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \
-    b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \
-}
-#define RGB_FROM_RGB565(Pixel, r, g, b)                                 \
-    {                                                                   \
-    r = SDL_expand_byte[3][((Pixel&0xF800)>>11)];                       \
-    g = SDL_expand_byte[2][((Pixel&0x07E0)>>5)];                        \
-    b = SDL_expand_byte[3][(Pixel&0x001F)];                             \
-}
-#define RGB_FROM_RGB555(Pixel, r, g, b)                                 \
-{                                                                       \
-    r = SDL_expand_byte[3][((Pixel&0x7C00)>>10)];                       \
-    g = SDL_expand_byte[3][((Pixel&0x03E0)>>5)];                        \
-    b = SDL_expand_byte[3][(Pixel&0x001F)];                             \
-}
-#define RGB_FROM_RGB888(Pixel, r, g, b)                                 \
-{                                                                       \
-    r = ((Pixel&0xFF0000)>>16);                                         \
-    g = ((Pixel&0xFF00)>>8);                                            \
-    b = (Pixel&0xFF);                                                   \
-}
-#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel)                             \
-do {                                                                    \
-    switch (bpp) {                                                      \
-        case 1:                                                         \
-            Pixel = *((Uint8 *)(buf));                                  \
-        break;                                                          \
-                                                                        \
-        case 2:                                                         \
-            Pixel = *((Uint16 *)(buf));                                 \
-        break;                                                          \
-                                                                        \
-        case 3: {                                                       \
-            Uint8 *B = (Uint8 *)(buf);                                  \
-            if (SDL_BYTEORDER == SDL_LIL_ENDIAN) {                      \
-                Pixel = B[0] + (B[1] << 8) + (B[2] << 16);              \
-            } else {                                                    \
-                Pixel = (B[0] << 16) + (B[1] << 8) + B[2];              \
-            }                                                           \
-        }                                                               \
-        break;                                                          \
-                                                                        \
-        case 4:                                                         \
-            Pixel = *((Uint32 *)(buf));                                 \
-        break;                                                          \
-                                                                        \
-        default:                                                        \
-                Pixel = 0; /* stop gcc complaints */                    \
-        break;                                                          \
-    }                                                                   \
-} while (0)
-
-#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b)                     \
-do {                                                                    \
-    switch (bpp) {                                                      \
-        case 1:                                                         \
-            Pixel = *((Uint8 *)(buf));                                  \
-            RGB_FROM_PIXEL(Pixel, fmt, r, g, b);                        \
-        break;                                                          \
-                                                                        \
-        case 2:                                                         \
-            Pixel = *((Uint16 *)(buf));                                 \
-            RGB_FROM_PIXEL(Pixel, fmt, r, g, b);                        \
-        break;                                                          \
-                                                                        \
-        case 3: {                                                       \
-            Pixel = 0;                                                  \
-            if (SDL_BYTEORDER == SDL_LIL_ENDIAN) {                      \
-                r = *((buf)+fmt->Rshift/8);                             \
-                g = *((buf)+fmt->Gshift/8);                             \
-                b = *((buf)+fmt->Bshift/8);                             \
-            } else {                                                    \
-                r = *((buf)+2-fmt->Rshift/8);                           \
-                g = *((buf)+2-fmt->Gshift/8);                           \
-                b = *((buf)+2-fmt->Bshift/8);                           \
-            }                                                           \
-        }                                                               \
-        break;                                                          \
-                                                                        \
-        case 4:                                                         \
-            Pixel = *((Uint32 *)(buf));                                 \
-            RGB_FROM_PIXEL(Pixel, fmt, r, g, b);                        \
-        break;                                                          \
-                                                                        \
-        default:                                                        \
-                /* stop gcc complaints */                               \
-                Pixel = 0;                                              \
-                r = g = b = 0;                                          \
-        break;                                                          \
-    }                                                                   \
-} while (0)
-
-/* Assemble R-G-B values into a specified pixel format and store them */
-#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)                             \
-{                                                                       \
-    Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|                             \
-        ((g>>fmt->Gloss)<<fmt->Gshift)|                                 \
-        ((b>>fmt->Bloss)<<fmt->Bshift)|                                 \
-        fmt->Amask;                                                     \
-}
-#define RGB565_FROM_RGB(Pixel, r, g, b)                                 \
-{                                                                       \
-    Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3);                            \
-}
-#define RGB555_FROM_RGB(Pixel, r, g, b)                                 \
-{                                                                       \
-    Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3);                            \
-}
-#define RGB888_FROM_RGB(Pixel, r, g, b)                                 \
-{                                                                       \
-    Pixel = (r<<16)|(g<<8)|b;                                           \
-}
-#define ARGB8888_FROM_RGBA(Pixel, r, g, b, a)                           \
-{                                                                       \
-    Pixel = (a<<24)|(r<<16)|(g<<8)|b;                                   \
-}
-#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a)                           \
-{                                                                       \
-    Pixel = (r<<24)|(g<<16)|(b<<8)|a;                                   \
-}
-#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a)                           \
-{                                                                       \
-    Pixel = (a<<24)|(b<<16)|(g<<8)|r;                                   \
-}
-#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a)                           \
-{                                                                       \
-    Pixel = (b<<24)|(g<<16)|(r<<8)|a;                                   \
-}
-#define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a)                        \
-{                                                                       \
-    r = r ? ((r << 2) | 0x3) : 0;                                       \
-    g = g ? ((g << 2) | 0x3) : 0;                                       \
-    b = b ? ((b << 2) | 0x3) : 0;                                       \
-    a = (a * 3) / 255;                                                  \
-    Pixel = (a<<30)|(r<<20)|(g<<10)|b;                                  \
-}
-#define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b)                            \
-{                                                                       \
-    switch (bpp) {                                                      \
-        case 1: {                                                       \
-            Uint8 Pixel;                                                \
-                                                                        \
-            PIXEL_FROM_RGB(Pixel, fmt, r, g, b);                        \
-            *((Uint8 *)(buf)) = Pixel;                                  \
-        }                                                               \
-        break;                                                          \
-                                                                        \
-        case 2: {                                                       \
-            Uint16 Pixel;                                               \
-                                                                        \
-            PIXEL_FROM_RGB(Pixel, fmt, r, g, b);                        \
-            *((Uint16 *)(buf)) = Pixel;                                 \
-        }                                                               \
-        break;                                                          \
-                                                                        \
-        case 3: {                                                       \
-            if (SDL_BYTEORDER == SDL_LIL_ENDIAN) {                      \
-                *((buf)+fmt->Rshift/8) = r;                             \
-                *((buf)+fmt->Gshift/8) = g;                             \
-                *((buf)+fmt->Bshift/8) = b;                             \
-            } else {                                                    \
-                *((buf)+2-fmt->Rshift/8) = r;                           \
-                *((buf)+2-fmt->Gshift/8) = g;                           \
-                *((buf)+2-fmt->Bshift/8) = b;                           \
-            }                                                           \
-        }                                                               \
-        break;                                                          \
-                                                                        \
-        case 4: {                                                       \
-            Uint32 Pixel;                                               \
-                                                                        \
-            PIXEL_FROM_RGB(Pixel, fmt, r, g, b);                        \
-            *((Uint32 *)(buf)) = Pixel;                                 \
-        }                                                               \
-        break;                                                          \
-    }                                                                   \
-}
-
-/* FIXME: Should we rescale alpha into 0..255 here? */
-#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a)                         \
-{                                                                       \
-    r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \
-    g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \
-    b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \
-    a = SDL_expand_byte[fmt->Aloss][((Pixel&fmt->Amask)>>fmt->Ashift)]; \
-}
-#define RGBA_FROM_8888(Pixel, fmt, r, g, b, a)                          \
-{                                                                       \
-    r = (Pixel&fmt->Rmask)>>fmt->Rshift;                                \
-    g = (Pixel&fmt->Gmask)>>fmt->Gshift;                                \
-    b = (Pixel&fmt->Bmask)>>fmt->Bshift;                                \
-    a = (Pixel&fmt->Amask)>>fmt->Ashift;                                \
-}
-#define RGBA_FROM_RGBA8888(Pixel, r, g, b, a)                           \
-{                                                                       \
-    r = (Pixel>>24);                                                    \
-    g = ((Pixel>>16)&0xFF);                                             \
-    b = ((Pixel>>8)&0xFF);                                              \
-    a = (Pixel&0xFF);                                                   \
-}
-#define RGBA_FROM_ARGB8888(Pixel, r, g, b, a)                           \
-{                                                                       \
-    r = ((Pixel>>16)&0xFF);                                             \
-    g = ((Pixel>>8)&0xFF);                                              \
-    b = (Pixel&0xFF);                                                   \
-    a = (Pixel>>24);                                                    \
-}
-#define RGBA_FROM_ABGR8888(Pixel, r, g, b, a)                           \
-{                                                                       \
-    r = (Pixel&0xFF);                                                   \
-    g = ((Pixel>>8)&0xFF);                                              \
-    b = ((Pixel>>16)&0xFF);                                             \
-    a = (Pixel>>24);                                                    \
-}
-#define RGBA_FROM_BGRA8888(Pixel, r, g, b, a)                           \
-{                                                                       \
-    r = ((Pixel>>8)&0xFF);                                              \
-    g = ((Pixel>>16)&0xFF);                                             \
-    b = (Pixel>>24);                                                    \
-    a = (Pixel&0xFF);                                                   \
-}
-#define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a)                        \
-{                                                                       \
-    r = ((Pixel>>22)&0xFF);                                             \
-    g = ((Pixel>>12)&0xFF);                                             \
-    b = ((Pixel>>2)&0xFF);                                              \
-    a = SDL_expand_byte[6][(Pixel>>30)];                                \
-}
-#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)                 \
-do {                                                                    \
-    switch (bpp) {                                                      \
-        case 1:                                                         \
-            Pixel = *((Uint8 *)(buf));                                  \
-            RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a);                    \
-        break;                                                          \
-                                                                        \
-        case 2:                                                         \
-            Pixel = *((Uint16 *)(buf));                                 \
-            RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a);                    \
-        break;                                                          \
-                                                                        \
-        case 3: {                                                       \
-            Pixel = 0;                                                  \
-            if (SDL_BYTEORDER == SDL_LIL_ENDIAN) {                      \
-                r = *((buf)+fmt->Rshift/8);                             \
-                g = *((buf)+fmt->Gshift/8);                             \
-                b = *((buf)+fmt->Bshift/8);                             \
-            } else {                                                    \
-                r = *((buf)+2-fmt->Rshift/8);                           \
-                g = *((buf)+2-fmt->Gshift/8);                           \
-                b = *((buf)+2-fmt->Bshift/8);                           \
-            }                                                           \
-            a = 0xFF;                                                   \
-        }                                                               \
-        break;                                                          \
-                                                                        \
-        case 4:                                                         \
-            Pixel = *((Uint32 *)(buf));                                 \
-            RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a);                    \
-        break;                                                          \
-                                                                        \
-        default:                                                        \
-            /* stop gcc complaints */                                   \
-            Pixel = 0;                                                  \
-            r = g = b = a = 0;                                          \
-        break;                                                          \
-    }                                                                   \
-} while (0)
-
-/* FIXME: this isn't correct, especially for Alpha (maximum != 255) */
-#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)                         \
-{                                                                       \
-    Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|                             \
-        ((g>>fmt->Gloss)<<fmt->Gshift)|                                 \
-        ((b>>fmt->Bloss)<<fmt->Bshift)|                                 \
-        ((a>>fmt->Aloss)<<fmt->Ashift);                                 \
-}
-#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)                        \
-{                                                                       \
-    switch (bpp) {                                                      \
-        case 1: {                                                       \
-            Uint8 Pixel;                                                \
-                                                                        \
-            PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a);                    \
-            *((Uint8 *)(buf)) = Pixel;                                  \
-        }                                                               \
-        break;                                                          \
-                                                                        \
-        case 2: {                                                       \
-            Uint16 Pixel;                                               \
-                                                                        \
-            PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a);                    \
-            *((Uint16 *)(buf)) = Pixel;                                 \
-        }                                                               \
-        break;                                                          \
-                                                                        \
-        case 3: {                                                       \
-            if (SDL_BYTEORDER == SDL_LIL_ENDIAN) {                      \
-                *((buf)+fmt->Rshift/8) = r;                             \
-                *((buf)+fmt->Gshift/8) = g;                             \
-                *((buf)+fmt->Bshift/8) = b;                             \
-            } else {                                                    \
-                *((buf)+2-fmt->Rshift/8) = r;                           \
-                *((buf)+2-fmt->Gshift/8) = g;                           \
-                *((buf)+2-fmt->Bshift/8) = b;                           \
-            }                                                           \
-        }                                                               \
-        break;                                                          \
-                                                                        \
-        case 4: {                                                       \
-            Uint32 Pixel;                                               \
-                                                                        \
-            PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a);                    \
-            *((Uint32 *)(buf)) = Pixel;                                 \
-        }                                                               \
-        break;                                                          \
-    }                                                                   \
-}
-
-/* Blend the RGB values of two pixels with an alpha value */
-#define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB)                      \
-do {                                                                    \
-    dR = ((((unsigned)(sR-dR)*(unsigned)A)/255)+dR);                    \
-    dG = ((((unsigned)(sG-dG)*(unsigned)A)/255)+dG);                    \
-    dB = ((((unsigned)(sB-dB)*(unsigned)A)/255)+dB);                    \
-} while(0)
-
-
-/* Blend the RGBA values of two pixels */
-#define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA)                \
-do {                                                                    \
-    dR = ((((unsigned)(sR-dR)*(unsigned)sA)/255)+dR);                   \
-    dG = ((((unsigned)(sG-dG)*(unsigned)sA)/255)+dG);                   \
-    dB = ((((unsigned)(sB-dB)*(unsigned)sA)/255)+dB);                   \
-    dA = ((unsigned)sA+(unsigned)dA-((unsigned)sA*dA)/255);             \
-} while(0)
-
-
-/* This is a very useful loop for optimizing blitters */
-#if defined(_MSC_VER) && (_MSC_VER == 1300)
-/* There's a bug in the Visual C++ 7 optimizer when compiling this code */
-#else
-#define USE_DUFFS_LOOP
-#endif
-#ifdef USE_DUFFS_LOOP
-
-/* 8-times unrolled loop */
-#define DUFFS_LOOP8(pixel_copy_increment, width)                        \
-{ int n = (width+7)/8;                                                  \
-    switch (width & 7) {                                                \
-    case 0: do {    pixel_copy_increment;                               \
-    case 7:     pixel_copy_increment;                                   \
-    case 6:     pixel_copy_increment;                                   \
-    case 5:     pixel_copy_increment;                                   \
-    case 4:     pixel_copy_increment;                                   \
-    case 3:     pixel_copy_increment;                                   \
-    case 2:     pixel_copy_increment;                                   \
-    case 1:     pixel_copy_increment;                                   \
-        } while ( --n > 0 );                                            \
-    }                                                                   \
-}
-
-/* 4-times unrolled loop */
-#define DUFFS_LOOP4(pixel_copy_increment, width)                        \
-{ int n = (width+3)/4;                                                  \
-    switch (width & 3) {                                                \
-    case 0: do {    pixel_copy_increment;                               \
-    case 3:     pixel_copy_increment;                                   \
-    case 2:     pixel_copy_increment;                                   \
-    case 1:     pixel_copy_increment;                                   \
-        } while (--n > 0);                                              \
-    }                                                                   \
-}
-
-/* Use the 8-times version of the loop by default */
-#define DUFFS_LOOP(pixel_copy_increment, width)                         \
-    DUFFS_LOOP8(pixel_copy_increment, width)
-
-/* Special version of Duff's device for even more optimization */
-#define DUFFS_LOOP_124(pixel_copy_increment1,                           \
-                       pixel_copy_increment2,                           \
-                       pixel_copy_increment4, width)                    \
-{ int n = width;                                                        \
-    if (n & 1) {                                                        \
-        pixel_copy_increment1; n -= 1;                                  \
-    }                                                                   \
-    if (n & 2) {                                                        \
-        pixel_copy_increment2; n -= 2;                                  \
-    }                                                                   \
-    if (n & 4) {                                                        \
-        pixel_copy_increment4; n -= 4;                                  \
-    }                                                                   \
-    if (n) {                                                            \
-        n /= 8;                                                         \
-        do {                                                            \
-            pixel_copy_increment4;                                      \
-            pixel_copy_increment4;                                      \
-        } while (--n > 0);                                              \
-    }                                                                   \
-}
-
-#else
-
-/* Don't use Duff's device to unroll loops */
-#define DUFFS_LOOP(pixel_copy_increment, width)                         \
-{ int n;                                                                \
-    for ( n=width; n > 0; --n ) {                                       \
-        pixel_copy_increment;                                           \
-    }                                                                   \
-}
-#define DUFFS_LOOP8(pixel_copy_increment, width)                        \
-    DUFFS_LOOP(pixel_copy_increment, width)
-#define DUFFS_LOOP4(pixel_copy_increment, width)                        \
-    DUFFS_LOOP(pixel_copy_increment, width)
-#define DUFFS_LOOP_124(pixel_copy_increment1,                           \
-                       pixel_copy_increment2,                           \
-                       pixel_copy_increment4, width)                    \
-    DUFFS_LOOP(pixel_copy_increment1, width)
-
-#endif /* USE_DUFFS_LOOP */
-
-/* Prevent Visual C++ 6.0 from printing out stupid warnings */
-#if defined(_MSC_VER) && (_MSC_VER >= 600)
-#pragma warning(disable: 4550)
-#endif
-
-#endif /* _SDL_blit_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_0.c b/deps/SDL2/src/video/SDL_blit_0.c
deleted file mode 100644
index ba70974..0000000
--- a/deps/SDL2/src/video/SDL_blit_0.c
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-
-/* Functions to blit from bitmaps to other surfaces */
-
-static void
-BlitBto1(SDL_BlitInfo * info)
-{
-    int c;
-    int width, height;
-    Uint8 *src, *map, *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = info->src;
-    srcskip = info->src_skip;
-    dst = info->dst;
-    dstskip = info->dst_skip;
-    map = info->table;
-    srcskip += width - (width + 7) / 8;
-
-    if (map) {
-        while (height--) {
-            Uint8 byte = 0, bit;
-            for (c = 0; c < width; ++c) {
-                if ((c & 7) == 0) {
-                    byte = *src++;
-                }
-                bit = (byte & 0x80) >> 7;
-                if (1) {
-                    *dst = map[bit];
-                }
-                dst++;
-                byte <<= 1;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        while (height--) {
-            Uint8 byte = 0, bit;
-            for (c = 0; c < width; ++c) {
-                if ((c & 7) == 0) {
-                    byte = *src++;
-                }
-                bit = (byte & 0x80) >> 7;
-                if (1) {
-                    *dst = bit;
-                }
-                dst++;
-                byte <<= 1;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-}
-
-static void
-BlitBto2(SDL_BlitInfo * info)
-{
-    int c;
-    int width, height;
-    Uint8 *src;
-    Uint16 *map, *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = info->src;
-    srcskip = info->src_skip;
-    dst = (Uint16 *) info->dst;
-    dstskip = info->dst_skip / 2;
-    map = (Uint16 *) info->table;
-    srcskip += width - (width + 7) / 8;
-
-    while (height--) {
-        Uint8 byte = 0, bit;
-        for (c = 0; c < width; ++c) {
-            if ((c & 7) == 0) {
-                byte = *src++;
-            }
-            bit = (byte & 0x80) >> 7;
-            if (1) {
-                *dst = map[bit];
-            }
-            byte <<= 1;
-            dst++;
-        }
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-BlitBto3(SDL_BlitInfo * info)
-{
-    int c, o;
-    int width, height;
-    Uint8 *src, *map, *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = info->src;
-    srcskip = info->src_skip;
-    dst = info->dst;
-    dstskip = info->dst_skip;
-    map = info->table;
-    srcskip += width - (width + 7) / 8;
-
-    while (height--) {
-        Uint8 byte = 0, bit;
-        for (c = 0; c < width; ++c) {
-            if ((c & 7) == 0) {
-                byte = *src++;
-            }
-            bit = (byte & 0x80) >> 7;
-            if (1) {
-                o = bit * 4;
-                dst[0] = map[o++];
-                dst[1] = map[o++];
-                dst[2] = map[o++];
-            }
-            byte <<= 1;
-            dst += 3;
-        }
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-BlitBto4(SDL_BlitInfo * info)
-{
-    int width, height;
-    Uint8 *src;
-    Uint32 *map, *dst;
-    int srcskip, dstskip;
-    int c;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = info->src;
-    srcskip = info->src_skip;
-    dst = (Uint32 *) info->dst;
-    dstskip = info->dst_skip / 4;
-    map = (Uint32 *) info->table;
-    srcskip += width - (width + 7) / 8;
-
-    while (height--) {
-        Uint8 byte = 0, bit;
-        for (c = 0; c < width; ++c) {
-            if ((c & 7) == 0) {
-                byte = *src++;
-            }
-            bit = (byte & 0x80) >> 7;
-            if (1) {
-                *dst = map[bit];
-            }
-            byte <<= 1;
-            dst++;
-        }
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-BlitBto1Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    Uint8 *dst = info->dst;
-    int srcskip = info->src_skip;
-    int dstskip = info->dst_skip;
-    Uint32 ckey = info->colorkey;
-    Uint8 *palmap = info->table;
-    int c;
-
-    /* Set up some basic variables */
-    srcskip += width - (width + 7) / 8;
-
-    if (palmap) {
-        while (height--) {
-            Uint8 byte = 0, bit;
-            for (c = 0; c < width; ++c) {
-                if ((c & 7) == 0) {
-                    byte = *src++;
-                }
-                bit = (byte & 0x80) >> 7;
-                if (bit != ckey) {
-                    *dst = palmap[bit];
-                }
-                dst++;
-                byte <<= 1;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        while (height--) {
-            Uint8 byte = 0, bit;
-            for (c = 0; c < width; ++c) {
-                if ((c & 7) == 0) {
-                    byte = *src++;
-                }
-                bit = (byte & 0x80) >> 7;
-                if (bit != ckey) {
-                    *dst = bit;
-                }
-                dst++;
-                byte <<= 1;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-}
-
-static void
-BlitBto2Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    Uint16 *dstp = (Uint16 *) info->dst;
-    int srcskip = info->src_skip;
-    int dstskip = info->dst_skip;
-    Uint32 ckey = info->colorkey;
-    Uint8 *palmap = info->table;
-    int c;
-
-    /* Set up some basic variables */
-    srcskip += width - (width + 7) / 8;
-    dstskip /= 2;
-
-    while (height--) {
-        Uint8 byte = 0, bit;
-        for (c = 0; c < width; ++c) {
-            if ((c & 7) == 0) {
-                byte = *src++;
-            }
-            bit = (byte & 0x80) >> 7;
-            if (bit != ckey) {
-                *dstp = ((Uint16 *) palmap)[bit];
-            }
-            byte <<= 1;
-            dstp++;
-        }
-        src += srcskip;
-        dstp += dstskip;
-    }
-}
-
-static void
-BlitBto3Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    Uint8 *dst = info->dst;
-    int srcskip = info->src_skip;
-    int dstskip = info->dst_skip;
-    Uint32 ckey = info->colorkey;
-    Uint8 *palmap = info->table;
-    int c;
-
-    /* Set up some basic variables */
-    srcskip += width - (width + 7) / 8;
-
-    while (height--) {
-        Uint8 byte = 0, bit;
-        for (c = 0; c < width; ++c) {
-            if ((c & 7) == 0) {
-                byte = *src++;
-            }
-            bit = (byte & 0x80) >> 7;
-            if (bit != ckey) {
-                SDL_memcpy(dst, &palmap[bit * 4], 3);
-            }
-            byte <<= 1;
-            dst += 3;
-        }
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-BlitBto4Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    Uint32 *dstp = (Uint32 *) info->dst;
-    int srcskip = info->src_skip;
-    int dstskip = info->dst_skip;
-    Uint32 ckey = info->colorkey;
-    Uint8 *palmap = info->table;
-    int c;
-
-    /* Set up some basic variables */
-    srcskip += width - (width + 7) / 8;
-    dstskip /= 4;
-
-    while (height--) {
-        Uint8 byte = 0, bit;
-        for (c = 0; c < width; ++c) {
-            if ((c & 7) == 0) {
-                byte = *src++;
-            }
-            bit = (byte & 0x80) >> 7;
-            if (bit != ckey) {
-                *dstp = ((Uint32 *) palmap)[bit];
-            }
-            byte <<= 1;
-            dstp++;
-        }
-        src += srcskip;
-        dstp += dstskip;
-    }
-}
-
-static void
-BlitBtoNAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    Uint8 *dst = info->dst;
-    int srcskip = info->src_skip;
-    int dstskip = info->dst_skip;
-    const SDL_Color *srcpal = info->src_fmt->palette->colors;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int dstbpp;
-    int c;
-    Uint32 pixel;
-    unsigned sR, sG, sB;
-    unsigned dR, dG, dB, dA;
-    const unsigned A = info->a;
-
-    /* Set up some basic variables */
-    dstbpp = dstfmt->BytesPerPixel;
-    srcskip += width - (width + 7) / 8;
-
-    while (height--) {
-        Uint8 byte = 0, bit;
-        for (c = 0; c < width; ++c) {
-            if ((c & 7) == 0) {
-                byte = *src++;
-            }
-            bit = (byte & 0x80) >> 7;
-            if (1) {
-                sR = srcpal[bit].r;
-                sG = srcpal[bit].g;
-                sB = srcpal[bit].b;
-                DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
-                ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
-                ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-            }
-            byte <<= 1;
-            dst += dstbpp;
-        }
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-BlitBtoNAlphaKey(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    Uint8 *dst = info->dst;
-    int srcskip = info->src_skip;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    const SDL_Color *srcpal = srcfmt->palette->colors;
-    int dstbpp;
-    int c;
-    Uint32 pixel;
-    unsigned sR, sG, sB;
-    unsigned dR, dG, dB, dA;
-    const unsigned A = info->a;
-    Uint32 ckey = info->colorkey;
-
-    /* Set up some basic variables */
-    dstbpp = dstfmt->BytesPerPixel;
-    srcskip += width - (width + 7) / 8;
-
-    while (height--) {
-        Uint8 byte = 0, bit;
-        for (c = 0; c < width; ++c) {
-            if ((c & 7) == 0) {
-                byte = *src++;
-            }
-            bit = (byte & 0x80) >> 7;
-            if (bit != ckey) {
-                sR = srcpal[bit].r;
-                sG = srcpal[bit].g;
-                sB = srcpal[bit].b;
-                DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
-                ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
-                ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-            }
-            byte <<= 1;
-            dst += dstbpp;
-        }
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static const SDL_BlitFunc bitmap_blit[] = {
-    (SDL_BlitFunc) NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4
-};
-
-static const SDL_BlitFunc colorkey_blit[] = {
-    (SDL_BlitFunc) NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key
-};
-
-SDL_BlitFunc
-SDL_CalculateBlit0(SDL_Surface * surface)
-{
-    int which;
-
-    if (surface->format->BitsPerPixel != 1) {
-        /* We don't support sub 8-bit packed pixel modes */
-        return (SDL_BlitFunc) NULL;
-    }
-    if (surface->map->dst->format->BitsPerPixel < 8) {
-        which = 0;
-    } else {
-        which = surface->map->dst->format->BytesPerPixel;
-    }
-    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
-    case 0:
-        return bitmap_blit[which];
-
-    case SDL_COPY_COLORKEY:
-        return colorkey_blit[which];
-
-    case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
-        return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL;
-
-    case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
-        return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL;
-    }
-    return (SDL_BlitFunc) NULL;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_1.c b/deps/SDL2/src/video/SDL_blit_1.c
deleted file mode 100644
index 67503e8..0000000
--- a/deps/SDL2/src/video/SDL_blit_1.c
+++ /dev/null
@@ -1,550 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-#include "SDL_sysvideo.h"
-#include "SDL_endian.h"
-
-/* Functions to blit from 8-bit surfaces to other surfaces */
-
-static void
-Blit1to1(SDL_BlitInfo * info)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int width, height;
-    Uint8 *src, *map, *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = info->src;
-    srcskip = info->src_skip;
-    dst = info->dst;
-    dstskip = info->dst_skip;
-    map = info->table;
-
-    while (height--) {
-#ifdef USE_DUFFS_LOOP
-        /* *INDENT-OFF* */
-		DUFFS_LOOP(
-			{
-			  *dst = map[*src];
-			}
-			dst++;
-			src++;
-		, width);
-        /* *INDENT-ON* */
-#else
-        for (c = width; c; --c) {
-            *dst = map[*src];
-            dst++;
-            src++;
-        }
-#endif
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-/* This is now endian dependent */
-#if ( SDL_BYTEORDER == SDL_LIL_ENDIAN )
-#define HI	1
-#define LO	0
-#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
-#define HI	0
-#define LO	1
-#endif
-static void
-Blit1to2(SDL_BlitInfo * info)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int width, height;
-    Uint8 *src, *dst;
-    Uint16 *map;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = info->src;
-    srcskip = info->src_skip;
-    dst = info->dst;
-    dstskip = info->dst_skip;
-    map = (Uint16 *) info->table;
-
-#ifdef USE_DUFFS_LOOP
-    while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			*(Uint16 *)dst = map[*src++];
-			dst += 2;
-		},
-		width);
-		/* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-#else
-    /* Memory align at 4-byte boundary, if necessary */
-    if ((long) dst & 0x03) {
-        /* Don't do anything if width is 0 */
-        if (width == 0) {
-            return;
-        }
-        --width;
-
-        while (height--) {
-            /* Perform copy alignment */
-            *(Uint16 *) dst = map[*src++];
-            dst += 2;
-
-            /* Copy in 4 pixel chunks */
-            for (c = width / 4; c; --c) {
-                *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]);
-                src += 2;
-                dst += 4;
-                *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]);
-                src += 2;
-                dst += 4;
-            }
-            /* Get any leftovers */
-            switch (width & 3) {
-            case 3:
-                *(Uint16 *) dst = map[*src++];
-                dst += 2;
-            case 2:
-                *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]);
-                src += 2;
-                dst += 4;
-                break;
-            case 1:
-                *(Uint16 *) dst = map[*src++];
-                dst += 2;
-                break;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        while (height--) {
-            /* Copy in 4 pixel chunks */
-            for (c = width / 4; c; --c) {
-                *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]);
-                src += 2;
-                dst += 4;
-                *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]);
-                src += 2;
-                dst += 4;
-            }
-            /* Get any leftovers */
-            switch (width & 3) {
-            case 3:
-                *(Uint16 *) dst = map[*src++];
-                dst += 2;
-            case 2:
-                *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]);
-                src += 2;
-                dst += 4;
-                break;
-            case 1:
-                *(Uint16 *) dst = map[*src++];
-                dst += 2;
-                break;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-#endif /* USE_DUFFS_LOOP */
-}
-
-static void
-Blit1to3(SDL_BlitInfo * info)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int o;
-    int width, height;
-    Uint8 *src, *map, *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = info->src;
-    srcskip = info->src_skip;
-    dst = info->dst;
-    dstskip = info->dst_skip;
-    map = info->table;
-
-    while (height--) {
-#ifdef USE_DUFFS_LOOP
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-			{
-				o = *src * 4;
-				dst[0] = map[o++];
-				dst[1] = map[o++];
-				dst[2] = map[o++];
-			}
-			src++;
-			dst += 3;
-		, width);
-		/* *INDENT-ON* */
-#else
-        for (c = width; c; --c) {
-            o = *src * 4;
-            dst[0] = map[o++];
-            dst[1] = map[o++];
-            dst[2] = map[o++];
-            src++;
-            dst += 3;
-        }
-#endif /* USE_DUFFS_LOOP */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-Blit1to4(SDL_BlitInfo * info)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int width, height;
-    Uint8 *src;
-    Uint32 *map, *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = info->src;
-    srcskip = info->src_skip;
-    dst = (Uint32 *) info->dst;
-    dstskip = info->dst_skip / 4;
-    map = (Uint32 *) info->table;
-
-    while (height--) {
-#ifdef USE_DUFFS_LOOP
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-			*dst++ = map[*src++];
-		, width);
-		/* *INDENT-ON* */
-#else
-        for (c = width / 4; c; --c) {
-            *dst++ = map[*src++];
-            *dst++ = map[*src++];
-            *dst++ = map[*src++];
-            *dst++ = map[*src++];
-        }
-        switch (width & 3) {
-        case 3:
-            *dst++ = map[*src++];
-        case 2:
-            *dst++ = map[*src++];
-        case 1:
-            *dst++ = map[*src++];
-        }
-#endif /* USE_DUFFS_LOOP */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-Blit1to1Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    Uint8 *palmap = info->table;
-    Uint32 ckey = info->colorkey;
-
-    if (palmap) {
-        while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP(
-			{
-				if ( *src != ckey ) {
-				  *dst = palmap[*src];
-				}
-				dst++;
-				src++;
-			},
-			width);
-			/* *INDENT-ON* */
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP(
-			{
-				if ( *src != ckey ) {
-				  *dst = *src;
-				}
-				dst++;
-				src++;
-			},
-			width);
-			/* *INDENT-ON* */
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-}
-
-static void
-Blit1to2Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint16 *dstp = (Uint16 *) info->dst;
-    int dstskip = info->dst_skip;
-    Uint16 *palmap = (Uint16 *) info->table;
-    Uint32 ckey = info->colorkey;
-
-    /* Set up some basic variables */
-    dstskip /= 2;
-
-    while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			if ( *src != ckey ) {
-				*dstp=palmap[*src];
-			}
-			src++;
-			dstp++;
-		},
-		width);
-		/* *INDENT-ON* */
-        src += srcskip;
-        dstp += dstskip;
-    }
-}
-
-static void
-Blit1to3Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    Uint8 *palmap = info->table;
-    Uint32 ckey = info->colorkey;
-    int o;
-
-    while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			if ( *src != ckey ) {
-				o = *src * 4;
-				dst[0] = palmap[o++];
-				dst[1] = palmap[o++];
-				dst[2] = palmap[o++];
-			}
-			src++;
-			dst += 3;
-		},
-		width);
-		/* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-Blit1to4Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint32 *dstp = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip;
-    Uint32 *palmap = (Uint32 *) info->table;
-    Uint32 ckey = info->colorkey;
-
-    /* Set up some basic variables */
-    dstskip /= 4;
-
-    while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			if ( *src != ckey ) {
-				*dstp = palmap[*src];
-			}
-			src++;
-			dstp++;
-		},
-		width);
-		/* *INDENT-ON* */
-        src += srcskip;
-        dstp += dstskip;
-    }
-}
-
-static void
-Blit1toNAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    const SDL_Color *srcpal = info->src_fmt->palette->colors;
-    int dstbpp;
-    Uint32 pixel;
-    unsigned sR, sG, sB;
-    unsigned dR, dG, dB, dA;
-    const unsigned A = info->a;
-
-    /* Set up some basic variables */
-    dstbpp = dstfmt->BytesPerPixel;
-
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP4(
-        {
-            sR = srcpal[*src].r;
-            sG = srcpal[*src].g;
-            sB = srcpal[*src].b;
-            DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
-            ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
-            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-            src++;
-            dst += dstbpp;
-        },
-        width);
-        /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-Blit1toNAlphaKey(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    const SDL_Color *srcpal = info->src_fmt->palette->colors;
-    Uint32 ckey = info->colorkey;
-    int dstbpp;
-    Uint32 pixel;
-    unsigned sR, sG, sB;
-    unsigned dR, dG, dB, dA;
-    const unsigned A = info->a;
-
-    /* Set up some basic variables */
-    dstbpp = dstfmt->BytesPerPixel;
-
-    while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			if ( *src != ckey ) {
-				sR = srcpal[*src].r;
-				sG = srcpal[*src].g;
-				sB = srcpal[*src].b;
-				DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
-				ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
-			  	ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-			}
-			src++;
-			dst += dstbpp;
-		},
-		width);
-		/* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static const SDL_BlitFunc one_blit[] = {
-    (SDL_BlitFunc) NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4
-};
-
-static const SDL_BlitFunc one_blitkey[] = {
-    (SDL_BlitFunc) NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key
-};
-
-SDL_BlitFunc
-SDL_CalculateBlit1(SDL_Surface * surface)
-{
-    int which;
-    SDL_PixelFormat *dstfmt;
-
-    dstfmt = surface->map->dst->format;
-    if (dstfmt->BitsPerPixel < 8) {
-        which = 0;
-    } else {
-        which = dstfmt->BytesPerPixel;
-    }
-    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
-    case 0:
-        return one_blit[which];
-
-    case SDL_COPY_COLORKEY:
-        return one_blitkey[which];
-
-    case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
-        /* Supporting 8bpp->8bpp alpha is doable but requires lots of
-           tables which consume space and takes time to precompute,
-           so is better left to the user */
-        return which >= 2 ? Blit1toNAlpha : (SDL_BlitFunc) NULL;
-
-    case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
-        return which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc) NULL;
-    }
-    return (SDL_BlitFunc) NULL;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_A.c b/deps/SDL2/src/video/SDL_blit_A.c
deleted file mode 100644
index 46d4613..0000000
--- a/deps/SDL2/src/video/SDL_blit_A.c
+++ /dev/null
@@ -1,1388 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-
-/* Functions to perform alpha blended blitting */
-
-/* N->1 blending with per-surface alpha */
-static void
-BlitNto1SurfaceAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    Uint8 *palmap = info->table;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int srcbpp = srcfmt->BytesPerPixel;
-    Uint32 Pixel;
-    unsigned sR, sG, sB;
-    unsigned dR, dG, dB;
-    const unsigned A = info->a;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
-		dR = dstfmt->palette->colors[*dst].r;
-		dG = dstfmt->palette->colors[*dst].g;
-		dB = dstfmt->palette->colors[*dst].b;
-		ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
-		dR &= 0xff;
-		dG &= 0xff;
-		dB &= 0xff;
-		/* Pack RGB into 8bit pixel */
-		if ( palmap == NULL ) {
-		    *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
-		} else {
-		    *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
-		}
-		dst++;
-		src += srcbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-/* N->1 blending with pixel alpha */
-static void
-BlitNto1PixelAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    Uint8 *palmap = info->table;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int srcbpp = srcfmt->BytesPerPixel;
-    Uint32 Pixel;
-    unsigned sR, sG, sB, sA;
-    unsigned dR, dG, dB;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		DISEMBLE_RGBA(src,srcbpp,srcfmt,Pixel,sR,sG,sB,sA);
-		dR = dstfmt->palette->colors[*dst].r;
-		dG = dstfmt->palette->colors[*dst].g;
-		dB = dstfmt->palette->colors[*dst].b;
-		ALPHA_BLEND_RGB(sR, sG, sB, sA, dR, dG, dB);
-		dR &= 0xff;
-		dG &= 0xff;
-		dB &= 0xff;
-		/* Pack RGB into 8bit pixel */
-		if ( palmap == NULL ) {
-		    *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
-		} else {
-		    *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
-		}
-		dst++;
-		src += srcbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-/* colorkeyed N->1 blending with per-surface alpha */
-static void
-BlitNto1SurfaceAlphaKey(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    Uint8 *palmap = info->table;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int srcbpp = srcfmt->BytesPerPixel;
-    Uint32 ckey = info->colorkey;
-    Uint32 Pixel;
-    unsigned sR, sG, sB;
-    unsigned dR, dG, dB;
-    const unsigned A = info->a;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP(
-	    {
-		DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
-		if ( Pixel != ckey ) {
-		    dR = dstfmt->palette->colors[*dst].r;
-		    dG = dstfmt->palette->colors[*dst].g;
-		    dB = dstfmt->palette->colors[*dst].b;
-		    ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
-		    dR &= 0xff;
-		    dG &= 0xff;
-		    dB &= 0xff;
-		    /* Pack RGB into 8bit pixel */
-		    if ( palmap == NULL ) {
-                *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
-		    } else {
-                *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
-		    }
-		}
-		dst++;
-		src += srcbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-#ifdef __MMX__
-
-/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
-static void
-BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint32 *srcp = (Uint32 *) info->src;
-    int srcskip = info->src_skip >> 2;
-    Uint32 *dstp = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip >> 2;
-    Uint32 dalpha = info->dst_fmt->Amask;
-
-    __m64 src1, src2, dst1, dst2, lmask, hmask, dsta;
-
-    hmask = _mm_set_pi32(0x00fefefe, 0x00fefefe);       /* alpha128 mask -> hmask */
-    lmask = _mm_set_pi32(0x00010101, 0x00010101);       /* !alpha128 mask -> lmask */
-    dsta = _mm_set_pi32(dalpha, dalpha);        /* dst alpha mask -> dsta */
-
-    while (height--) {
-        int n = width;
-        if (n & 1) {
-            Uint32 s = *srcp++;
-            Uint32 d = *dstp;
-            *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
-                       + (s & d & 0x00010101)) | dalpha;
-            n--;
-        }
-
-        for (n >>= 1; n > 0; --n) {
-            dst1 = *(__m64 *) dstp;     /* 2 x dst -> dst1(ARGBARGB) */
-            dst2 = dst1;        /* 2 x dst -> dst2(ARGBARGB) */
-
-            src1 = *(__m64 *) srcp;     /* 2 x src -> src1(ARGBARGB) */
-            src2 = src1;        /* 2 x src -> src2(ARGBARGB) */
-
-            dst2 = _mm_and_si64(dst2, hmask);   /* dst & mask -> dst2 */
-            src2 = _mm_and_si64(src2, hmask);   /* src & mask -> src2 */
-            src2 = _mm_add_pi32(src2, dst2);    /* dst2 + src2 -> src2 */
-            src2 = _mm_srli_pi32(src2, 1);      /* src2 >> 1 -> src2 */
-
-            dst1 = _mm_and_si64(dst1, src1);    /* src & dst -> dst1 */
-            dst1 = _mm_and_si64(dst1, lmask);   /* dst1 & !mask -> dst1 */
-            dst1 = _mm_add_pi32(dst1, src2);    /* src2 + dst1 -> dst1 */
-            dst1 = _mm_or_si64(dst1, dsta);     /* dsta(full alpha) | dst1 -> dst1 */
-
-            *(__m64 *) dstp = dst1;     /* dst1 -> 2 x dst pixels */
-            dstp += 2;
-            srcp += 2;
-        }
-
-        srcp += srcskip;
-        dstp += dstskip;
-    }
-    _mm_empty();
-}
-
-/* fast RGB888->(A)RGB888 blending with surface alpha */
-static void
-BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo * info)
-{
-    SDL_PixelFormat *df = info->dst_fmt;
-    Uint32 chanmask;
-    unsigned alpha = info->a;
-
-    if (alpha == 128 && (df->Rmask | df->Gmask | df->Bmask) == 0x00FFFFFF) {
-        /* only call a128 version when R,G,B occupy lower bits */
-        BlitRGBtoRGBSurfaceAlpha128MMX(info);
-    } else {
-        int width = info->dst_w;
-        int height = info->dst_h;
-        Uint32 *srcp = (Uint32 *) info->src;
-        int srcskip = info->src_skip >> 2;
-        Uint32 *dstp = (Uint32 *) info->dst;
-        int dstskip = info->dst_skip >> 2;
-        Uint32 dalpha = df->Amask;
-        Uint32 amult;
-
-        __m64 src1, src2, dst1, dst2, mm_alpha, mm_zero, dsta;
-
-        mm_zero = _mm_setzero_si64();   /* 0 -> mm_zero */
-        /* form the alpha mult */
-        amult = alpha | (alpha << 8);
-        amult = amult | (amult << 16);
-        chanmask =
-            (0xff << df->Rshift) | (0xff << df->
-                                    Gshift) | (0xff << df->Bshift);
-        mm_alpha = _mm_set_pi32(0, amult & chanmask);   /* 0000AAAA -> mm_alpha, minus 1 chan */
-        mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */
-        /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */
-        dsta = _mm_set_pi32(dalpha, dalpha);    /* dst alpha mask -> dsta */
-
-        while (height--) {
-            int n = width;
-            if (n & 1) {
-                /* One Pixel Blend */
-                src2 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src2 (0000ARGB) */
-                src2 = _mm_unpacklo_pi8(src2, mm_zero); /* 0A0R0G0B -> src2 */
-
-                dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
-                dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
-
-                src2 = _mm_sub_pi16(src2, dst1);        /* src2 - dst2 -> src2 */
-                src2 = _mm_mullo_pi16(src2, mm_alpha);  /* src2 * alpha -> src2 */
-                src2 = _mm_srli_pi16(src2, 8);  /* src2 >> 8 -> src2 */
-                dst1 = _mm_add_pi8(src2, dst1); /* src2 + dst1 -> dst1 */
-
-                dst1 = _mm_packs_pu16(dst1, mm_zero);   /* 0000ARGB -> dst1 */
-                dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */
-                *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
-
-                ++srcp;
-                ++dstp;
-
-                n--;
-            }
-
-            for (n >>= 1; n > 0; --n) {
-                /* Two Pixels Blend */
-                src1 = *(__m64 *) srcp; /* 2 x src -> src1(ARGBARGB) */
-                src2 = src1;    /* 2 x src -> src2(ARGBARGB) */
-                src1 = _mm_unpacklo_pi8(src1, mm_zero); /* low - 0A0R0G0B -> src1 */
-                src2 = _mm_unpackhi_pi8(src2, mm_zero); /* high - 0A0R0G0B -> src2 */
-
-                dst1 = *(__m64 *) dstp; /* 2 x dst -> dst1(ARGBARGB) */
-                dst2 = dst1;    /* 2 x dst -> dst2(ARGBARGB) */
-                dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* low - 0A0R0G0B -> dst1 */
-                dst2 = _mm_unpackhi_pi8(dst2, mm_zero); /* high - 0A0R0G0B -> dst2 */
-
-                src1 = _mm_sub_pi16(src1, dst1);        /* src1 - dst1 -> src1 */
-                src1 = _mm_mullo_pi16(src1, mm_alpha);  /* src1 * alpha -> src1 */
-                src1 = _mm_srli_pi16(src1, 8);  /* src1 >> 8 -> src1 */
-                dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1(dst1) -> dst1 */
-
-                src2 = _mm_sub_pi16(src2, dst2);        /* src2 - dst2 -> src2 */
-                src2 = _mm_mullo_pi16(src2, mm_alpha);  /* src2 * alpha -> src2 */
-                src2 = _mm_srli_pi16(src2, 8);  /* src2 >> 8 -> src2 */
-                dst2 = _mm_add_pi8(src2, dst2); /* src2 + dst2(dst2) -> dst2 */
-
-                dst1 = _mm_packs_pu16(dst1, dst2);      /* 0A0R0G0B(res1), 0A0R0G0B(res2) -> dst1(ARGBARGB) */
-                dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */
-
-                *(__m64 *) dstp = dst1; /* dst1 -> 2 x pixel */
-
-                srcp += 2;
-                dstp += 2;
-            }
-            srcp += srcskip;
-            dstp += dstskip;
-        }
-        _mm_empty();
-    }
-}
-
-/* fast ARGB888->(A)RGB888 blending with pixel alpha */
-static void
-BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint32 *srcp = (Uint32 *) info->src;
-    int srcskip = info->src_skip >> 2;
-    Uint32 *dstp = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip >> 2;
-    SDL_PixelFormat *sf = info->src_fmt;
-    Uint32 amask = sf->Amask;
-    Uint32 ashift = sf->Ashift;
-    Uint64 multmask, multmask2;
-
-    __m64 src1, dst1, mm_alpha, mm_zero, mm_alpha2;
-
-    mm_zero = _mm_setzero_si64();       /* 0 -> mm_zero */
-    multmask = 0x00FF;
-	multmask <<= (ashift * 2);
-	multmask2 = 0x00FF00FF00FF00FF;
-
-    while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP4({
-		Uint32 alpha = *srcp & amask;
-		if (alpha == 0) {
-			/* do nothing */
-		} else if (alpha == amask) {
-			*dstp = *srcp;
-		} else {
-			src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
-			src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
-
-			dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
-			dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
-
-			mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
-			mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
-			mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
-			mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
-			mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);	/* 0F0A0A0A -> mm_alpha */
-			mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);	/* 255 - mm_alpha -> mm_alpha */
-
-			/* blend */		    
-			src1 = _mm_mullo_pi16(src1, mm_alpha);
-			src1 = _mm_srli_pi16(src1, 8);
-			dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
-			dst1 = _mm_srli_pi16(dst1, 8);
-			dst1 = _mm_add_pi16(src1, dst1);
-			dst1 = _mm_packs_pu16(dst1, mm_zero);
-			
-			*dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
-		}
-		++srcp;
-		++dstp;
-	    }, width);
-		/* *INDENT-ON* */
-        srcp += srcskip;
-        dstp += dstskip;
-    }
-    _mm_empty();
-}
-
-#endif /* __MMX__ */
-
-/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
-static void
-BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint32 *srcp = (Uint32 *) info->src;
-    int srcskip = info->src_skip >> 2;
-    Uint32 *dstp = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip >> 2;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		    Uint32 s = *srcp++;
-		    Uint32 d = *dstp;
-		    *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
-			       + (s & d & 0x00010101)) | 0xff000000;
-	    }, width);
-	    /* *INDENT-ON* */
-        srcp += srcskip;
-        dstp += dstskip;
-    }
-}
-
-/* fast RGB888->(A)RGB888 blending with surface alpha */
-static void
-BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo * info)
-{
-    unsigned alpha = info->a;
-    if (alpha == 128) {
-        BlitRGBtoRGBSurfaceAlpha128(info);
-    } else {
-        int width = info->dst_w;
-        int height = info->dst_h;
-        Uint32 *srcp = (Uint32 *) info->src;
-        int srcskip = info->src_skip >> 2;
-        Uint32 *dstp = (Uint32 *) info->dst;
-        int dstskip = info->dst_skip >> 2;
-        Uint32 s;
-        Uint32 d;
-        Uint32 s1;
-        Uint32 d1;
-
-        while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP4({
-				s = *srcp;
-				d = *dstp;
-				s1 = s & 0xff00ff;
-				d1 = d & 0xff00ff;
-				d1 = (d1 + ((s1 - d1) * alpha >> 8))
-				     & 0xff00ff;
-				s &= 0xff00;
-				d &= 0xff00;
-				d = (d + ((s - d) * alpha >> 8)) & 0xff00;
-				*dstp = d1 | d | 0xff000000;
-				++srcp;
-				++dstp;
-			}, width);
-			/* *INDENT-ON* */
-            srcp += srcskip;
-            dstp += dstskip;
-        }
-    }
-}
-
-/* fast ARGB888->(A)RGB888 blending with pixel alpha */
-static void
-BlitRGBtoRGBPixelAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint32 *srcp = (Uint32 *) info->src;
-    int srcskip = info->src_skip >> 2;
-    Uint32 *dstp = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip >> 2;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		Uint32 dalpha;
-		Uint32 d;
-		Uint32 s1;
-		Uint32 d1;
-		Uint32 s = *srcp;
-		Uint32 alpha = s >> 24;
-		/* FIXME: Here we special-case opaque alpha since the
-		   compositioning used (>>8 instead of /255) doesn't handle
-		   it correctly. Also special-case alpha=0 for speed?
-		   Benchmark this! */
-		if (alpha) {
-		  if (alpha == SDL_ALPHA_OPAQUE) {
-			  *dstp = *srcp;
-		  } else {
-		    /*
-		     * take out the middle component (green), and process
-		     * the other two in parallel. One multiply less.
-		     */
-		    d = *dstp;
-			dalpha = d >> 24;
-		    s1 = s & 0xff00ff;
-		    d1 = d & 0xff00ff;
-		    d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff;
-		    s &= 0xff00;
-		    d &= 0xff00;
-		    d = (d + ((s - d) * alpha >> 8)) & 0xff00;
-			dalpha = alpha + (dalpha * (alpha ^ 0xFF) >> 8);
-		    *dstp = d1 | d | (dalpha << 24);
-		  }
-		}
-		++srcp;
-		++dstp;
-	    }, width);
-	    /* *INDENT-ON* */
-        srcp += srcskip;
-        dstp += dstskip;
-    }
-}
-
-#ifdef __3dNOW__
-/* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */
-static void
-BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint32 *srcp = (Uint32 *) info->src;
-    int srcskip = info->src_skip >> 2;
-    Uint32 *dstp = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip >> 2;
-    SDL_PixelFormat *sf = info->src_fmt;
-    Uint32 amask = sf->Amask;
-    Uint32 ashift = sf->Ashift;
-    Uint64 multmask, multmask2;
-
-    __m64 src1, dst1, mm_alpha, mm_zero, mm_alpha2;
-
-    mm_zero = _mm_setzero_si64();       /* 0 -> mm_zero */
-    multmask = 0x00FF;
-    multmask <<= (ashift * 2);
-    multmask2 = 0x00FF00FF00FF00FF;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		Uint32 alpha;
-
-		_m_prefetch(srcp + 16);
-		_m_prefetch(dstp + 16);
-
-		alpha = *srcp & amask;
-		if (alpha == 0) {
-			/* do nothing */
-		} else if (alpha == amask) {
-			*dstp = *srcp;
-		} else {
-			src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
-			src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
-
-			dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
-			dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
-
-			mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
-			mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
-			mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
-			mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
-			mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);	/* 0F0A0A0A -> mm_alpha */
-			mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);	/* 255 - mm_alpha -> mm_alpha */
-
-
-			/* blend */		    
-			src1 = _mm_mullo_pi16(src1, mm_alpha);
-			src1 = _mm_srli_pi16(src1, 8);
-			dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
-			dst1 = _mm_srli_pi16(dst1, 8);
-			dst1 = _mm_add_pi16(src1, dst1);
-			dst1 = _mm_packs_pu16(dst1, mm_zero);
-			
-			*dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
-		}
-		++srcp;
-		++dstp;
-	    }, width);
-	    /* *INDENT-ON* */
-        srcp += srcskip;
-        dstp += dstskip;
-    }
-    _mm_empty();
-}
-
-#endif /* __MMX__ */
-
-/* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */
-
-/* blend a single 16 bit pixel at 50% */
-#define BLEND16_50(d, s, mask)						\
-	((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff)))
-
-/* blend two 16 bit pixels at 50% */
-#define BLEND2x16_50(d, s, mask)					     \
-	(((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \
-	 + (s & d & (~(mask | mask << 16))))
-
-static void
-Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint16 *srcp = (Uint16 *) info->src;
-    int srcskip = info->src_skip >> 1;
-    Uint16 *dstp = (Uint16 *) info->dst;
-    int dstskip = info->dst_skip >> 1;
-
-    while (height--) {
-        if (((uintptr_t) srcp ^ (uintptr_t) dstp) & 2) {
-            /*
-             * Source and destination not aligned, pipeline it.
-             * This is mostly a win for big blits but no loss for
-             * small ones
-             */
-            Uint32 prev_sw;
-            int w = width;
-
-            /* handle odd destination */
-            if ((uintptr_t) dstp & 2) {
-                Uint16 d = *dstp, s = *srcp;
-                *dstp = BLEND16_50(d, s, mask);
-                dstp++;
-                srcp++;
-                w--;
-            }
-            srcp++;             /* srcp is now 32-bit aligned */
-
-            /* bootstrap pipeline with first halfword */
-            prev_sw = ((Uint32 *) srcp)[-1];
-
-            while (w > 1) {
-                Uint32 sw, dw, s;
-                sw = *(Uint32 *) srcp;
-                dw = *(Uint32 *) dstp;
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-                s = (prev_sw << 16) + (sw >> 16);
-#else
-                s = (prev_sw >> 16) + (sw << 16);
-#endif
-                prev_sw = sw;
-                *(Uint32 *) dstp = BLEND2x16_50(dw, s, mask);
-                dstp += 2;
-                srcp += 2;
-                w -= 2;
-            }
-
-            /* final pixel if any */
-            if (w) {
-                Uint16 d = *dstp, s;
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-                s = (Uint16) prev_sw;
-#else
-                s = (Uint16) (prev_sw >> 16);
-#endif
-                *dstp = BLEND16_50(d, s, mask);
-                srcp++;
-                dstp++;
-            }
-            srcp += srcskip - 1;
-            dstp += dstskip;
-        } else {
-            /* source and destination are aligned */
-            int w = width;
-
-            /* first odd pixel? */
-            if ((uintptr_t) srcp & 2) {
-                Uint16 d = *dstp, s = *srcp;
-                *dstp = BLEND16_50(d, s, mask);
-                srcp++;
-                dstp++;
-                w--;
-            }
-            /* srcp and dstp are now 32-bit aligned */
-
-            while (w > 1) {
-                Uint32 sw = *(Uint32 *) srcp;
-                Uint32 dw = *(Uint32 *) dstp;
-                *(Uint32 *) dstp = BLEND2x16_50(dw, sw, mask);
-                srcp += 2;
-                dstp += 2;
-                w -= 2;
-            }
-
-            /* last odd pixel? */
-            if (w) {
-                Uint16 d = *dstp, s = *srcp;
-                *dstp = BLEND16_50(d, s, mask);
-                srcp++;
-                dstp++;
-            }
-            srcp += srcskip;
-            dstp += dstskip;
-        }
-    }
-}
-
-#ifdef __MMX__
-
-/* fast RGB565->RGB565 blending with surface alpha */
-static void
-Blit565to565SurfaceAlphaMMX(SDL_BlitInfo * info)
-{
-    unsigned alpha = info->a;
-    if (alpha == 128) {
-        Blit16to16SurfaceAlpha128(info, 0xf7de);
-    } else {
-        int width = info->dst_w;
-        int height = info->dst_h;
-        Uint16 *srcp = (Uint16 *) info->src;
-        int srcskip = info->src_skip >> 1;
-        Uint16 *dstp = (Uint16 *) info->dst;
-        int dstskip = info->dst_skip >> 1;
-        Uint32 s, d;
-
-        __m64 src1, dst1, src2, dst2, gmask, bmask, mm_res, mm_alpha;
-
-        alpha &= ~(1 + 2 + 4);  /* cut alpha to get the exact same behaviour */
-        mm_alpha = _mm_set_pi32(0, alpha);      /* 0000000A -> mm_alpha */
-        alpha >>= 3;            /* downscale alpha to 5 bits */
-
-        mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha);       /* 00000A0A -> mm_alpha */
-        mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha);       /* 0A0A0A0A -> mm_alpha */
-        /* position alpha to allow for mullo and mulhi on diff channels
-           to reduce the number of operations */
-        mm_alpha = _mm_slli_si64(mm_alpha, 3);
-
-        /* Setup the 565 color channel masks */
-        gmask = _mm_set_pi32(0x07E007E0, 0x07E007E0);   /* MASKGREEN -> gmask */
-        bmask = _mm_set_pi32(0x001F001F, 0x001F001F);   /* MASKBLUE -> bmask */
-
-        while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP_124(
-			{
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x07e0f81f;
-				d = (d | d << 16) & 0x07e0f81f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x07e0f81f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			},{
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x07e0f81f;
-				d = (d | d << 16) & 0x07e0f81f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x07e0f81f;
-				*dstp++ = (Uint16)(d | d >> 16);
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x07e0f81f;
-				d = (d | d << 16) & 0x07e0f81f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x07e0f81f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			},{
-				src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
-				dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
-
-				/* red */
-				src2 = src1;
-				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 [000r 000r 000r 000r] */
-
-				dst2 = dst1;
-				dst2 = _mm_srli_pi16(dst2, 11); /* dst2 >> 11 -> dst2 [000r 000r 000r 000r] */
-
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-				dst2 = _mm_slli_pi16(dst2, 11); /* dst2 << 11 -> dst2 */
-
-				mm_res = dst2; /* RED -> mm_res */
-
-				/* green -- process the bits in place */
-				src2 = src1;
-				src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
-
-				dst2 = dst1;
-				dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
-
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-
-				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
-
-				/* blue */
-				src2 = src1;
-				src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
-
-				dst2 = dst1;
-				dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
-
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-				dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
-
-				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
-
-				*(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
-
-				srcp += 4;
-				dstp += 4;
-			}, width);
-			/* *INDENT-ON* */
-            srcp += srcskip;
-            dstp += dstskip;
-        }
-        _mm_empty();
-    }
-}
-
-/* fast RGB555->RGB555 blending with surface alpha */
-static void
-Blit555to555SurfaceAlphaMMX(SDL_BlitInfo * info)
-{
-    unsigned alpha = info->a;
-    if (alpha == 128) {
-        Blit16to16SurfaceAlpha128(info, 0xfbde);
-    } else {
-        int width = info->dst_w;
-        int height = info->dst_h;
-        Uint16 *srcp = (Uint16 *) info->src;
-        int srcskip = info->src_skip >> 1;
-        Uint16 *dstp = (Uint16 *) info->dst;
-        int dstskip = info->dst_skip >> 1;
-        Uint32 s, d;
-
-        __m64 src1, dst1, src2, dst2, rmask, gmask, bmask, mm_res, mm_alpha;
-
-        alpha &= ~(1 + 2 + 4);  /* cut alpha to get the exact same behaviour */
-        mm_alpha = _mm_set_pi32(0, alpha);      /* 0000000A -> mm_alpha */
-        alpha >>= 3;            /* downscale alpha to 5 bits */
-
-        mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha);       /* 00000A0A -> mm_alpha */
-        mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha);       /* 0A0A0A0A -> mm_alpha */
-        /* position alpha to allow for mullo and mulhi on diff channels
-           to reduce the number of operations */
-        mm_alpha = _mm_slli_si64(mm_alpha, 3);
-
-        /* Setup the 555 color channel masks */
-        rmask = _mm_set_pi32(0x7C007C00, 0x7C007C00);   /* MASKRED -> rmask */
-        gmask = _mm_set_pi32(0x03E003E0, 0x03E003E0);   /* MASKGREEN -> gmask */
-        bmask = _mm_set_pi32(0x001F001F, 0x001F001F);   /* MASKBLUE -> bmask */
-
-        while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP_124(
-			{
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x03e07c1f;
-				d = (d | d << 16) & 0x03e07c1f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x03e07c1f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			},{
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x03e07c1f;
-				d = (d | d << 16) & 0x03e07c1f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x03e07c1f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			        s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x03e07c1f;
-				d = (d | d << 16) & 0x03e07c1f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x03e07c1f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			},{
-				src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
-				dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
-
-				/* red -- process the bits in place */
-				src2 = src1;
-				src2 = _mm_and_si64(src2, rmask); /* src & MASKRED -> src2 */
-
-				dst2 = dst1;
-				dst2 = _mm_and_si64(dst2, rmask); /* dst & MASKRED -> dst2 */
-
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-				dst2 = _mm_and_si64(dst2, rmask); /* dst2 & MASKRED -> dst2 */
-
-				mm_res = dst2; /* RED -> mm_res */
-				
-				/* green -- process the bits in place */
-				src2 = src1;
-				src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
-
-				dst2 = dst1;
-				dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
-
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-
-				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
-
-				/* blue */
-				src2 = src1; /* src -> src2 */
-				src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
-
-				dst2 = dst1; /* dst -> dst2 */
-				dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
-
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-				dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
-
-				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
-
-				*(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
-
-				srcp += 4;
-				dstp += 4;
-			}, width);
-			/* *INDENT-ON* */
-            srcp += srcskip;
-            dstp += dstskip;
-        }
-        _mm_empty();
-    }
-}
-
-#endif /* __MMX__ */
-
-/* fast RGB565->RGB565 blending with surface alpha */
-static void
-Blit565to565SurfaceAlpha(SDL_BlitInfo * info)
-{
-    unsigned alpha = info->a;
-    if (alpha == 128) {
-        Blit16to16SurfaceAlpha128(info, 0xf7de);
-    } else {
-        int width = info->dst_w;
-        int height = info->dst_h;
-        Uint16 *srcp = (Uint16 *) info->src;
-        int srcskip = info->src_skip >> 1;
-        Uint16 *dstp = (Uint16 *) info->dst;
-        int dstskip = info->dst_skip >> 1;
-        alpha >>= 3;            /* downscale alpha to 5 bits */
-
-        while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP4({
-				Uint32 s = *srcp++;
-				Uint32 d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x07e0f81f;
-				d = (d | d << 16) & 0x07e0f81f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x07e0f81f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			}, width);
-			/* *INDENT-ON* */
-            srcp += srcskip;
-            dstp += dstskip;
-        }
-    }
-}
-
-/* fast RGB555->RGB555 blending with surface alpha */
-static void
-Blit555to555SurfaceAlpha(SDL_BlitInfo * info)
-{
-    unsigned alpha = info->a;   /* downscale alpha to 5 bits */
-    if (alpha == 128) {
-        Blit16to16SurfaceAlpha128(info, 0xfbde);
-    } else {
-        int width = info->dst_w;
-        int height = info->dst_h;
-        Uint16 *srcp = (Uint16 *) info->src;
-        int srcskip = info->src_skip >> 1;
-        Uint16 *dstp = (Uint16 *) info->dst;
-        int dstskip = info->dst_skip >> 1;
-        alpha >>= 3;            /* downscale alpha to 5 bits */
-
-        while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP4({
-				Uint32 s = *srcp++;
-				Uint32 d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x03e07c1f;
-				d = (d | d << 16) & 0x03e07c1f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x03e07c1f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			}, width);
-			/* *INDENT-ON* */
-            srcp += srcskip;
-            dstp += dstskip;
-        }
-    }
-}
-
-/* fast ARGB8888->RGB565 blending with pixel alpha */
-static void
-BlitARGBto565PixelAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint32 *srcp = (Uint32 *) info->src;
-    int srcskip = info->src_skip >> 2;
-    Uint16 *dstp = (Uint16 *) info->dst;
-    int dstskip = info->dst_skip >> 1;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		Uint32 s = *srcp;
-		unsigned alpha = s >> 27; /* downscale alpha to 5 bits */
-		/* FIXME: Here we special-case opaque alpha since the
-		   compositioning used (>>8 instead of /255) doesn't handle
-		   it correctly. Also special-case alpha=0 for speed?
-		   Benchmark this! */
-		if(alpha) {   
-		  if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
-		    *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3  & 0x1f));
-		  } else {
-		    Uint32 d = *dstp;
-		    /*
-		     * convert source and destination to G0RAB65565
-		     * and blend all components at the same time
-		     */
-		    s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800)
-		      + (s >> 3 & 0x1f);
-		    d = (d | d << 16) & 0x07e0f81f;
-		    d += (s - d) * alpha >> 5;
-		    d &= 0x07e0f81f;
-		    *dstp = (Uint16)(d | d >> 16);
-		  }
-		}
-		srcp++;
-		dstp++;
-	    }, width);
-	    /* *INDENT-ON* */
-        srcp += srcskip;
-        dstp += dstskip;
-    }
-}
-
-/* fast ARGB8888->RGB555 blending with pixel alpha */
-static void
-BlitARGBto555PixelAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint32 *srcp = (Uint32 *) info->src;
-    int srcskip = info->src_skip >> 2;
-    Uint16 *dstp = (Uint16 *) info->dst;
-    int dstskip = info->dst_skip >> 1;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		unsigned alpha;
-		Uint32 s = *srcp;
-		alpha = s >> 27; /* downscale alpha to 5 bits */
-		/* FIXME: Here we special-case opaque alpha since the
-		   compositioning used (>>8 instead of /255) doesn't handle
-		   it correctly. Also special-case alpha=0 for speed?
-		   Benchmark this! */
-		if(alpha) {   
-		  if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
-		    *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3  & 0x1f));
-		  } else {
-		    Uint32 d = *dstp;
-		    /*
-		     * convert source and destination to G0RAB65565
-		     * and blend all components at the same time
-		     */
-		    s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00)
-		      + (s >> 3 & 0x1f);
-		    d = (d | d << 16) & 0x03e07c1f;
-		    d += (s - d) * alpha >> 5;
-		    d &= 0x03e07c1f;
-		    *dstp = (Uint16)(d | d >> 16);
-		  }
-		}
-		srcp++;
-		dstp++;
-	    }, width);
-	    /* *INDENT-ON* */
-        srcp += srcskip;
-        dstp += dstskip;
-    }
-}
-
-/* General (slow) N->N blending with per-surface alpha */
-static void
-BlitNtoNSurfaceAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int srcbpp = srcfmt->BytesPerPixel;
-    int dstbpp = dstfmt->BytesPerPixel;
-    Uint32 Pixel;
-    unsigned sR, sG, sB;
-    unsigned dR, dG, dB, dA;
-    const unsigned sA = info->a;
-
-    if (sA) {
-        while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
-		DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
-		ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
-		ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-		src += srcbpp;
-		dst += dstbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-}
-
-/* General (slow) colorkeyed N->N blending with per-surface alpha */
-static void
-BlitNtoNSurfaceAlphaKey(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    Uint32 ckey = info->colorkey;
-    int srcbpp = srcfmt->BytesPerPixel;
-    int dstbpp = dstfmt->BytesPerPixel;
-    Uint32 Pixel;
-    unsigned sR, sG, sB;
-    unsigned dR, dG, dB, dA;
-    const unsigned sA = info->a;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
-		if(sA && Pixel != ckey) {
-		    RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
-		    DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
-		    ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
-		    ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-		}
-		src += srcbpp;
-		dst += dstbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-/* General (slow) N->N blending with pixel alpha */
-static void
-BlitNtoNPixelAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int srcbpp;
-    int dstbpp;
-    Uint32 Pixel;
-    unsigned sR, sG, sB, sA;
-    unsigned dR, dG, dB, dA;
-
-    /* Set up some basic variables */
-    srcbpp = srcfmt->BytesPerPixel;
-    dstbpp = dstfmt->BytesPerPixel;
-
-    while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
-		if(sA) {
-		    DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
-		    ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
-		    ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-		}
-		src += srcbpp;
-		dst += dstbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-
-SDL_BlitFunc
-SDL_CalculateBlitA(SDL_Surface * surface)
-{
-    SDL_PixelFormat *sf = surface->format;
-    SDL_PixelFormat *df = surface->map->dst->format;
-
-    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
-    case SDL_COPY_BLEND:
-        /* Per-pixel alpha blits */
-        switch (df->BytesPerPixel) {
-        case 1:
-            return BlitNto1PixelAlpha;
-
-        case 2:
-                if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
-                    && sf->Gmask == 0xff00
-                    && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
-                        || (sf->Bmask == 0xff && df->Bmask == 0x1f))) {
-                if (df->Gmask == 0x7e0)
-                    return BlitARGBto565PixelAlpha;
-                else if (df->Gmask == 0x3e0)
-                    return BlitARGBto555PixelAlpha;
-            }
-            return BlitNtoNPixelAlpha;
-
-        case 4:
-            if (sf->Rmask == df->Rmask
-                && sf->Gmask == df->Gmask
-                && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) {
-#if defined(__MMX__) || defined(__3dNOW__)
-                if (sf->Rshift % 8 == 0
-                    && sf->Gshift % 8 == 0
-                    && sf->Bshift % 8 == 0
-                    && sf->Ashift % 8 == 0 && sf->Aloss == 0) {
-#ifdef __3dNOW__
-                    if (SDL_Has3DNow())
-                        return BlitRGBtoRGBPixelAlphaMMX3DNOW;
-#endif
-#ifdef __MMX__
-                    if (SDL_HasMMX())
-                        return BlitRGBtoRGBPixelAlphaMMX;
-#endif
-                }
-#endif /* __MMX__ || __3dNOW__ */
-                if (sf->Amask == 0xff000000) {
-                    return BlitRGBtoRGBPixelAlpha;
-                }
-            }
-            return BlitNtoNPixelAlpha;
-
-        case 3:
-        default:
-            return BlitNtoNPixelAlpha;
-        }
-        break;
-
-    case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
-        if (sf->Amask == 0) {
-            /* Per-surface alpha blits */
-            switch (df->BytesPerPixel) {
-            case 1:
-                return BlitNto1SurfaceAlpha;
-
-            case 2:
-                if (surface->map->identity) {
-                    if (df->Gmask == 0x7e0) {
-#ifdef __MMX__
-                        if (SDL_HasMMX())
-                            return Blit565to565SurfaceAlphaMMX;
-                        else
-#endif
-                            return Blit565to565SurfaceAlpha;
-                    } else if (df->Gmask == 0x3e0) {
-#ifdef __MMX__
-                        if (SDL_HasMMX())
-                            return Blit555to555SurfaceAlphaMMX;
-                        else
-#endif
-                            return Blit555to555SurfaceAlpha;
-                    }
-                }
-                return BlitNtoNSurfaceAlpha;
-
-            case 4:
-                if (sf->Rmask == df->Rmask
-                    && sf->Gmask == df->Gmask
-                    && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) {
-#ifdef __MMX__
-                    if (sf->Rshift % 8 == 0
-                        && sf->Gshift % 8 == 0
-                        && sf->Bshift % 8 == 0 && SDL_HasMMX())
-                        return BlitRGBtoRGBSurfaceAlphaMMX;
-#endif
-                    if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) {
-                        return BlitRGBtoRGBSurfaceAlpha;
-                    }
-                }
-                return BlitNtoNSurfaceAlpha;
-
-            case 3:
-            default:
-                return BlitNtoNSurfaceAlpha;
-            }
-        }
-        break;
-
-    case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
-        if (sf->Amask == 0) {
-            if (df->BytesPerPixel == 1) {
-                return BlitNto1SurfaceAlphaKey;
-            } else {
-                return BlitNtoNSurfaceAlphaKey;
-            }
-        }
-        break;
-    }
-
-    return NULL;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_N.c b/deps/SDL2/src/video/SDL_blit_N.c
deleted file mode 100644
index 84c96e2..0000000
--- a/deps/SDL2/src/video/SDL_blit_N.c
+++ /dev/null
@@ -1,2601 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_endian.h"
-#include "SDL_cpuinfo.h"
-#include "SDL_blit.h"
-
-#include "SDL_assert.h"
-
-/* Functions to blit from N-bit surfaces to other surfaces */
-
-#if SDL_ALTIVEC_BLITTERS
-#ifdef HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-#ifdef __MACOSX__
-#include <sys/sysctl.h>
-static size_t
-GetL3CacheSize(void)
-{
-    const char key[] = "hw.l3cachesize";
-    u_int64_t result = 0;
-    size_t typeSize = sizeof(result);
-
-
-    int err = sysctlbyname(key, &result, &typeSize, NULL, 0);
-    if (0 != err)
-        return 0;
-
-    return result;
-}
-#else
-static size_t
-GetL3CacheSize(void)
-{
-    /* XXX: Just guess G4 */
-    return 2097152;
-}
-#endif /* __MACOSX__ */
-
-#if (defined(__MACOSX__) && (__GNUC__ < 4))
-#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
-        (vector unsigned char) ( a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p )
-#define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
-        (vector unsigned short) ( a,b,c,d,e,f,g,h )
-#else
-#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
-        (vector unsigned char) { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p }
-#define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
-        (vector unsigned short) { a,b,c,d,e,f,g,h }
-#endif
-
-#define UNALIGNED_PTR(x) (((size_t) x) & 0x0000000F)
-#define VSWIZZLE32(a,b,c,d) (vector unsigned char) \
-                               ( 0x00+a, 0x00+b, 0x00+c, 0x00+d, \
-                                 0x04+a, 0x04+b, 0x04+c, 0x04+d, \
-                                 0x08+a, 0x08+b, 0x08+c, 0x08+d, \
-                                 0x0C+a, 0x0C+b, 0x0C+c, 0x0C+d )
-
-#define MAKE8888(dstfmt, r, g, b, a)  \
-    ( ((r<<dstfmt->Rshift)&dstfmt->Rmask) | \
-      ((g<<dstfmt->Gshift)&dstfmt->Gmask) | \
-      ((b<<dstfmt->Bshift)&dstfmt->Bmask) | \
-      ((a<<dstfmt->Ashift)&dstfmt->Amask) )
-
-/*
- * Data Stream Touch...Altivec cache prefetching.
- *
- *  Don't use this on a G5...however, the speed boost is very significant
- *   on a G4.
- */
-#define DST_CHAN_SRC 1
-#define DST_CHAN_DEST 2
-
-/* macro to set DST control word value... */
-#define DST_CTRL(size, count, stride) \
-    (((size) << 24) | ((count) << 16) | (stride))
-
-#define VEC_ALIGNER(src) ((UNALIGNED_PTR(src)) \
-    ? vec_lvsl(0, src) \
-    : vec_add(vec_lvsl(8, src), vec_splat_u8(8)))
-
-/* Calculate the permute vector used for 32->32 swizzling */
-static vector unsigned char
-calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt)
-{
-    /*
-     * We have to assume that the bits that aren't used by other
-     *  colors is alpha, and it's one complete byte, since some formats
-     *  leave alpha with a zero mask, but we should still swizzle the bits.
-     */
-    /* ARGB */
-    const static const struct SDL_PixelFormat default_pixel_format = {
-        0, NULL, 0, 0,
-        {0, 0},
-        0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
-        0, 0, 0, 0,
-        16, 8, 0, 24,
-        0, NULL
-    };
-    if (!srcfmt) {
-        srcfmt = &default_pixel_format;
-    }
-    if (!dstfmt) {
-        dstfmt = &default_pixel_format;
-    }
-    const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00,
-                                                       0x04, 0x04, 0x04, 0x04,
-                                                       0x08, 0x08, 0x08, 0x08,
-                                                       0x0C, 0x0C, 0x0C,
-                                                       0x0C);
-    vector unsigned char vswiz;
-    vector unsigned int srcvec;
-#define RESHIFT(X) (3 - ((X) >> 3))
-    Uint32 rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
-    Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
-    Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
-    Uint32 amask;
-    /* Use zero for alpha if either surface doesn't have alpha */
-    if (dstfmt->Amask) {
-        amask =
-            ((srcfmt->Amask) ? RESHIFT(srcfmt->
-                                       Ashift) : 0x10) << (dstfmt->Ashift);
-    } else {
-        amask =
-            0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^
-                          0xFFFFFFFF);
-    }
-#undef RESHIFT
-    ((unsigned int *) (char *) &srcvec)[0] = (rmask | gmask | bmask | amask);
-    vswiz = vec_add(plus, (vector unsigned char) vec_splat(srcvec, 0));
-    return (vswiz);
-}
-
-static void Blit_RGB888_RGB565(SDL_BlitInfo * info);
-static void
-Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info)
-{
-    int height = info->dst_h;
-    Uint8 *src = (Uint8 *) info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = (Uint8 *) info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    vector unsigned char valpha = vec_splat_u8(0);
-    vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL);
-    vector unsigned char vgmerge = VECUINT8_LITERAL(0x00, 0x02, 0x00, 0x06,
-                                                    0x00, 0x0a, 0x00, 0x0e,
-                                                    0x00, 0x12, 0x00, 0x16,
-                                                    0x00, 0x1a, 0x00, 0x1e);
-    vector unsigned short v1 = vec_splat_u16(1);
-    vector unsigned short v3 = vec_splat_u16(3);
-    vector unsigned short v3f =
-        VECUINT16_LITERAL(0x003f, 0x003f, 0x003f, 0x003f,
-                          0x003f, 0x003f, 0x003f, 0x003f);
-    vector unsigned short vfc =
-        VECUINT16_LITERAL(0x00fc, 0x00fc, 0x00fc, 0x00fc,
-                          0x00fc, 0x00fc, 0x00fc, 0x00fc);
-    vector unsigned short vf800 = (vector unsigned short) vec_splat_u8(-7);
-    vf800 = vec_sl(vf800, vec_splat_u16(8));
-
-    while (height--) {
-        vector unsigned char valigner;
-        vector unsigned char voverflow;
-        vector unsigned char vsrc;
-
-        int width = info->dst_w;
-        int extrawidth;
-
-        /* do scalar until we can align... */
-#define ONE_PIXEL_BLEND(condition, widthvar) \
-        while (condition) { \
-            Uint32 Pixel; \
-            unsigned sR, sG, sB, sA; \
-            DISEMBLE_RGBA((Uint8 *)src, 4, srcfmt, Pixel, \
-                          sR, sG, sB, sA); \
-            *(Uint16 *)(dst) = (((sR << 8) & 0x0000F800) | \
-                                ((sG << 3) & 0x000007E0) | \
-                                ((sB >> 3) & 0x0000001F)); \
-            dst += 2; \
-            src += 4; \
-            widthvar--; \
-        }
-
-        ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
-
-        /* After all that work, here's the vector part! */
-        extrawidth = (width % 8);       /* trailing unaligned stores */
-        width -= extrawidth;
-        vsrc = vec_ld(0, src);
-        valigner = VEC_ALIGNER(src);
-
-        while (width) {
-            vector unsigned short vpixel, vrpixel, vgpixel, vbpixel;
-            vector unsigned int vsrc1, vsrc2;
-            vector unsigned char vdst;
-
-            voverflow = vec_ld(15, src);
-            vsrc = vec_perm(vsrc, voverflow, valigner);
-            vsrc1 = (vector unsigned int) vec_perm(vsrc, valpha, vpermute);
-            src += 16;
-            vsrc = voverflow;
-            voverflow = vec_ld(15, src);
-            vsrc = vec_perm(vsrc, voverflow, valigner);
-            vsrc2 = (vector unsigned int) vec_perm(vsrc, valpha, vpermute);
-            /* 1555 */
-            vpixel = (vector unsigned short) vec_packpx(vsrc1, vsrc2);
-            vgpixel = (vector unsigned short) vec_perm(vsrc1, vsrc2, vgmerge);
-            vgpixel = vec_and(vgpixel, vfc);
-            vgpixel = vec_sl(vgpixel, v3);
-            vrpixel = vec_sl(vpixel, v1);
-            vrpixel = vec_and(vrpixel, vf800);
-            vbpixel = vec_and(vpixel, v3f);
-            vdst =
-                vec_or((vector unsigned char) vrpixel,
-                       (vector unsigned char) vgpixel);
-            /* 565 */
-            vdst = vec_or(vdst, (vector unsigned char) vbpixel);
-            vec_st(vdst, 0, dst);
-
-            width -= 8;
-            src += 16;
-            dst += 16;
-            vsrc = voverflow;
-        }
-
-        SDL_assert(width == 0);
-
-        /* do scalar until we can align... */
-        ONE_PIXEL_BLEND((extrawidth), extrawidth);
-#undef ONE_PIXEL_BLEND
-
-        src += srcskip;         /* move to next row, accounting for pitch. */
-        dst += dstskip;
-    }
-
-
-}
-
-static void
-Blit_RGB565_32Altivec(SDL_BlitInfo * info)
-{
-    int height = info->dst_h;
-    Uint8 *src = (Uint8 *) info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = (Uint8 *) info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    unsigned alpha;
-    vector unsigned char valpha;
-    vector unsigned char vpermute;
-    vector unsigned short vf800;
-    vector unsigned int v8 = vec_splat_u32(8);
-    vector unsigned int v16 = vec_add(v8, v8);
-    vector unsigned short v2 = vec_splat_u16(2);
-    vector unsigned short v3 = vec_splat_u16(3);
-    /*
-       0x10 - 0x1f is the alpha
-       0x00 - 0x0e evens are the red
-       0x01 - 0x0f odds are zero
-     */
-    vector unsigned char vredalpha1 = VECUINT8_LITERAL(0x10, 0x00, 0x01, 0x01,
-                                                       0x10, 0x02, 0x01, 0x01,
-                                                       0x10, 0x04, 0x01, 0x01,
-                                                       0x10, 0x06, 0x01,
-                                                       0x01);
-    vector unsigned char vredalpha2 =
-        (vector unsigned
-         char) (vec_add((vector unsigned int) vredalpha1, vec_sl(v8, v16))
-        );
-    /*
-       0x00 - 0x0f is ARxx ARxx ARxx ARxx
-       0x11 - 0x0f odds are blue
-     */
-    vector unsigned char vblue1 = VECUINT8_LITERAL(0x00, 0x01, 0x02, 0x11,
-                                                   0x04, 0x05, 0x06, 0x13,
-                                                   0x08, 0x09, 0x0a, 0x15,
-                                                   0x0c, 0x0d, 0x0e, 0x17);
-    vector unsigned char vblue2 =
-        (vector unsigned char) (vec_add((vector unsigned int) vblue1, v8)
-        );
-    /*
-       0x00 - 0x0f is ARxB ARxB ARxB ARxB
-       0x10 - 0x0e evens are green
-     */
-    vector unsigned char vgreen1 = VECUINT8_LITERAL(0x00, 0x01, 0x10, 0x03,
-                                                    0x04, 0x05, 0x12, 0x07,
-                                                    0x08, 0x09, 0x14, 0x0b,
-                                                    0x0c, 0x0d, 0x16, 0x0f);
-    vector unsigned char vgreen2 =
-        (vector unsigned
-         char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
-        );
-
-    SDL_assert(srcfmt->BytesPerPixel == 2);
-    SDL_assert(dstfmt->BytesPerPixel == 4);
-
-    vf800 = (vector unsigned short) vec_splat_u8(-7);
-    vf800 = vec_sl(vf800, vec_splat_u16(8));
-
-    if (dstfmt->Amask && info->a) {
-        ((unsigned char *) &valpha)[0] = alpha = info->a;
-        valpha = vec_splat(valpha, 0);
-    } else {
-        alpha = 0;
-        valpha = vec_splat_u8(0);
-    }
-
-    vpermute = calc_swizzle32(NULL, dstfmt);
-    while (height--) {
-        vector unsigned char valigner;
-        vector unsigned char voverflow;
-        vector unsigned char vsrc;
-
-        int width = info->dst_w;
-        int extrawidth;
-
-        /* do scalar until we can align... */
-#define ONE_PIXEL_BLEND(condition, widthvar) \
-        while (condition) { \
-            unsigned sR, sG, sB; \
-            unsigned short Pixel = *((unsigned short *)src); \
-            sR = (Pixel >> 8) & 0xf8; \
-            sG = (Pixel >> 3) & 0xfc; \
-            sB = (Pixel << 3) & 0xf8; \
-            ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
-            src += 2; \
-            dst += 4; \
-            widthvar--; \
-        }
-        ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
-
-        /* After all that work, here's the vector part! */
-        extrawidth = (width % 8);       /* trailing unaligned stores */
-        width -= extrawidth;
-        vsrc = vec_ld(0, src);
-        valigner = VEC_ALIGNER(src);
-
-        while (width) {
-            vector unsigned short vR, vG, vB;
-            vector unsigned char vdst1, vdst2;
-
-            voverflow = vec_ld(15, src);
-            vsrc = vec_perm(vsrc, voverflow, valigner);
-
-            vR = vec_and((vector unsigned short) vsrc, vf800);
-            vB = vec_sl((vector unsigned short) vsrc, v3);
-            vG = vec_sl(vB, v2);
-
-            vdst1 =
-                (vector unsigned char) vec_perm((vector unsigned char) vR,
-                                                valpha, vredalpha1);
-            vdst1 = vec_perm(vdst1, (vector unsigned char) vB, vblue1);
-            vdst1 = vec_perm(vdst1, (vector unsigned char) vG, vgreen1);
-            vdst1 = vec_perm(vdst1, valpha, vpermute);
-            vec_st(vdst1, 0, dst);
-
-            vdst2 =
-                (vector unsigned char) vec_perm((vector unsigned char) vR,
-                                                valpha, vredalpha2);
-            vdst2 = vec_perm(vdst2, (vector unsigned char) vB, vblue2);
-            vdst2 = vec_perm(vdst2, (vector unsigned char) vG, vgreen2);
-            vdst2 = vec_perm(vdst2, valpha, vpermute);
-            vec_st(vdst2, 16, dst);
-
-            width -= 8;
-            dst += 32;
-            src += 16;
-            vsrc = voverflow;
-        }
-
-        SDL_assert(width == 0);
-
-
-        /* do scalar until we can align... */
-        ONE_PIXEL_BLEND((extrawidth), extrawidth);
-#undef ONE_PIXEL_BLEND
-
-        src += srcskip;         /* move to next row, accounting for pitch. */
-        dst += dstskip;
-    }
-
-}
-
-
-static void
-Blit_RGB555_32Altivec(SDL_BlitInfo * info)
-{
-    int height = info->dst_h;
-    Uint8 *src = (Uint8 *) info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = (Uint8 *) info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    unsigned alpha;
-    vector unsigned char valpha;
-    vector unsigned char vpermute;
-    vector unsigned short vf800;
-    vector unsigned int v8 = vec_splat_u32(8);
-    vector unsigned int v16 = vec_add(v8, v8);
-    vector unsigned short v1 = vec_splat_u16(1);
-    vector unsigned short v3 = vec_splat_u16(3);
-    /*
-       0x10 - 0x1f is the alpha
-       0x00 - 0x0e evens are the red
-       0x01 - 0x0f odds are zero
-     */
-    vector unsigned char vredalpha1 = VECUINT8_LITERAL(0x10, 0x00, 0x01, 0x01,
-                                                       0x10, 0x02, 0x01, 0x01,
-                                                       0x10, 0x04, 0x01, 0x01,
-                                                       0x10, 0x06, 0x01,
-                                                       0x01);
-    vector unsigned char vredalpha2 =
-        (vector unsigned
-         char) (vec_add((vector unsigned int) vredalpha1, vec_sl(v8, v16))
-        );
-    /*
-       0x00 - 0x0f is ARxx ARxx ARxx ARxx
-       0x11 - 0x0f odds are blue
-     */
-    vector unsigned char vblue1 = VECUINT8_LITERAL(0x00, 0x01, 0x02, 0x11,
-                                                   0x04, 0x05, 0x06, 0x13,
-                                                   0x08, 0x09, 0x0a, 0x15,
-                                                   0x0c, 0x0d, 0x0e, 0x17);
-    vector unsigned char vblue2 =
-        (vector unsigned char) (vec_add((vector unsigned int) vblue1, v8)
-        );
-    /*
-       0x00 - 0x0f is ARxB ARxB ARxB ARxB
-       0x10 - 0x0e evens are green
-     */
-    vector unsigned char vgreen1 = VECUINT8_LITERAL(0x00, 0x01, 0x10, 0x03,
-                                                    0x04, 0x05, 0x12, 0x07,
-                                                    0x08, 0x09, 0x14, 0x0b,
-                                                    0x0c, 0x0d, 0x16, 0x0f);
-    vector unsigned char vgreen2 =
-        (vector unsigned
-         char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
-        );
-
-    SDL_assert(srcfmt->BytesPerPixel == 2);
-    SDL_assert(dstfmt->BytesPerPixel == 4);
-
-    vf800 = (vector unsigned short) vec_splat_u8(-7);
-    vf800 = vec_sl(vf800, vec_splat_u16(8));
-
-    if (dstfmt->Amask && info->a) {
-        ((unsigned char *) &valpha)[0] = alpha = info->a;
-        valpha = vec_splat(valpha, 0);
-    } else {
-        alpha = 0;
-        valpha = vec_splat_u8(0);
-    }
-
-    vpermute = calc_swizzle32(NULL, dstfmt);
-    while (height--) {
-        vector unsigned char valigner;
-        vector unsigned char voverflow;
-        vector unsigned char vsrc;
-
-        int width = info->dst_w;
-        int extrawidth;
-
-        /* do scalar until we can align... */
-#define ONE_PIXEL_BLEND(condition, widthvar) \
-        while (condition) { \
-            unsigned sR, sG, sB; \
-            unsigned short Pixel = *((unsigned short *)src); \
-            sR = (Pixel >> 7) & 0xf8; \
-            sG = (Pixel >> 2) & 0xf8; \
-            sB = (Pixel << 3) & 0xf8; \
-            ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
-            src += 2; \
-            dst += 4; \
-            widthvar--; \
-        }
-        ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
-
-        /* After all that work, here's the vector part! */
-        extrawidth = (width % 8);       /* trailing unaligned stores */
-        width -= extrawidth;
-        vsrc = vec_ld(0, src);
-        valigner = VEC_ALIGNER(src);
-
-        while (width) {
-            vector unsigned short vR, vG, vB;
-            vector unsigned char vdst1, vdst2;
-
-            voverflow = vec_ld(15, src);
-            vsrc = vec_perm(vsrc, voverflow, valigner);
-
-            vR = vec_and(vec_sl((vector unsigned short) vsrc, v1), vf800);
-            vB = vec_sl((vector unsigned short) vsrc, v3);
-            vG = vec_sl(vB, v3);
-
-            vdst1 =
-                (vector unsigned char) vec_perm((vector unsigned char) vR,
-                                                valpha, vredalpha1);
-            vdst1 = vec_perm(vdst1, (vector unsigned char) vB, vblue1);
-            vdst1 = vec_perm(vdst1, (vector unsigned char) vG, vgreen1);
-            vdst1 = vec_perm(vdst1, valpha, vpermute);
-            vec_st(vdst1, 0, dst);
-
-            vdst2 =
-                (vector unsigned char) vec_perm((vector unsigned char) vR,
-                                                valpha, vredalpha2);
-            vdst2 = vec_perm(vdst2, (vector unsigned char) vB, vblue2);
-            vdst2 = vec_perm(vdst2, (vector unsigned char) vG, vgreen2);
-            vdst2 = vec_perm(vdst2, valpha, vpermute);
-            vec_st(vdst2, 16, dst);
-
-            width -= 8;
-            dst += 32;
-            src += 16;
-            vsrc = voverflow;
-        }
-
-        SDL_assert(width == 0);
-
-
-        /* do scalar until we can align... */
-        ONE_PIXEL_BLEND((extrawidth), extrawidth);
-#undef ONE_PIXEL_BLEND
-
-        src += srcskip;         /* move to next row, accounting for pitch. */
-        dst += dstskip;
-    }
-
-}
-
-static void BlitNtoNKey(SDL_BlitInfo * info);
-static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info);
-static void
-Blit32to32KeyAltivec(SDL_BlitInfo * info)
-{
-    int height = info->dst_h;
-    Uint32 *srcp = (Uint32 *) info->src;
-    int srcskip = info->src_skip / 4;
-    Uint32 *dstp = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip / 4;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    int srcbpp = srcfmt->BytesPerPixel;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int dstbpp = dstfmt->BytesPerPixel;
-    int copy_alpha = (srcfmt->Amask && dstfmt->Amask);
-    unsigned alpha = dstfmt->Amask ? info->a : 0;
-    Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
-    Uint32 ckey = info->colorkey;
-    vector unsigned int valpha;
-    vector unsigned char vpermute;
-    vector unsigned char vzero;
-    vector unsigned int vckey;
-    vector unsigned int vrgbmask;
-    vpermute = calc_swizzle32(srcfmt, dstfmt);
-    if (info->dst_w < 16) {
-        if (copy_alpha) {
-            BlitNtoNKeyCopyAlpha(info);
-        } else {
-            BlitNtoNKey(info);
-        }
-        return;
-    }
-    vzero = vec_splat_u8(0);
-    if (alpha) {
-        ((unsigned char *) &valpha)[0] = (unsigned char) alpha;
-        valpha =
-            (vector unsigned int) vec_splat((vector unsigned char) valpha, 0);
-    } else {
-        valpha = (vector unsigned int) vzero;
-    }
-    ckey &= rgbmask;
-    ((unsigned int *) (char *) &vckey)[0] = ckey;
-    vckey = vec_splat(vckey, 0);
-    ((unsigned int *) (char *) &vrgbmask)[0] = rgbmask;
-    vrgbmask = vec_splat(vrgbmask, 0);
-
-    while (height--) {
-#define ONE_PIXEL_BLEND(condition, widthvar) \
-        if (copy_alpha) { \
-            while (condition) { \
-                Uint32 Pixel; \
-                unsigned sR, sG, sB, sA; \
-                DISEMBLE_RGBA((Uint8 *)srcp, srcbpp, srcfmt, Pixel, \
-                          sR, sG, sB, sA); \
-                if ( (Pixel & rgbmask) != ckey ) { \
-                      ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \
-                            sR, sG, sB, sA); \
-                } \
-                dstp = (Uint32 *) (((Uint8 *) dstp) + dstbpp); \
-                srcp = (Uint32 *) (((Uint8 *) srcp) + srcbpp); \
-                widthvar--; \
-            } \
-        } else { \
-            while (condition) { \
-                Uint32 Pixel; \
-                unsigned sR, sG, sB; \
-                RETRIEVE_RGB_PIXEL((Uint8 *)srcp, srcbpp, Pixel); \
-                if ( Pixel != ckey ) { \
-                    RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \
-                    ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \
-                              sR, sG, sB, alpha); \
-                } \
-                dstp = (Uint32 *) (((Uint8 *)dstp) + dstbpp); \
-                srcp = (Uint32 *) (((Uint8 *)srcp) + srcbpp); \
-                widthvar--; \
-            } \
-        }
-        int width = info->dst_w;
-        ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
-        SDL_assert(width > 0);
-        if (width > 0) {
-            int extrawidth = (width % 4);
-            vector unsigned char valigner = VEC_ALIGNER(srcp);
-            vector unsigned int vs = vec_ld(0, srcp);
-            width -= extrawidth;
-            SDL_assert(width >= 4);
-            while (width) {
-                vector unsigned char vsel;
-                vector unsigned int vd;
-                vector unsigned int voverflow = vec_ld(15, srcp);
-                /* load the source vec */
-                vs = vec_perm(vs, voverflow, valigner);
-                /* vsel is set for items that match the key */
-                vsel = (vector unsigned char) vec_and(vs, vrgbmask);
-                vsel = (vector unsigned char) vec_cmpeq(vs, vckey);
-                /* permute the src vec to the dest format */
-                vs = vec_perm(vs, valpha, vpermute);
-                /* load the destination vec */
-                vd = vec_ld(0, dstp);
-                /* select the source and dest into vs */
-                vd = (vector unsigned int) vec_sel((vector unsigned char) vs,
-                                                   (vector unsigned char) vd,
-                                                   vsel);
-
-                vec_st(vd, 0, dstp);
-                srcp += 4;
-                width -= 4;
-                dstp += 4;
-                vs = voverflow;
-            }
-            ONE_PIXEL_BLEND((extrawidth), extrawidth);
-#undef ONE_PIXEL_BLEND
-            srcp += srcskip;
-            dstp += dstskip;
-        }
-    }
-}
-
-/* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */
-/* Use this on a G5 */
-static void
-ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info)
-{
-    int height = info->dst_h;
-    Uint32 *src = (Uint32 *) info->src;
-    int srcskip = info->src_skip / 4;
-    Uint32 *dst = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip / 4;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    vector unsigned int vzero = vec_splat_u32(0);
-    vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
-    if (dstfmt->Amask && !srcfmt->Amask) {
-        if (info->a) {
-            vector unsigned char valpha;
-            ((unsigned char *) &valpha)[0] = info->a;
-            vzero = (vector unsigned int) vec_splat(valpha, 0);
-        }
-    }
-
-    SDL_assert(srcfmt->BytesPerPixel == 4);
-    SDL_assert(dstfmt->BytesPerPixel == 4);
-
-    while (height--) {
-        vector unsigned char valigner;
-        vector unsigned int vbits;
-        vector unsigned int voverflow;
-        Uint32 bits;
-        Uint8 r, g, b, a;
-
-        int width = info->dst_w;
-        int extrawidth;
-
-        /* do scalar until we can align... */
-        while ((UNALIGNED_PTR(dst)) && (width)) {
-            bits = *(src++);
-            RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
-            if(!srcfmt->Amask)
-              a = info->a;
-            *(dst++) = MAKE8888(dstfmt, r, g, b, a);
-            width--;
-        }
-
-        /* After all that work, here's the vector part! */
-        extrawidth = (width % 4);
-        width -= extrawidth;
-        valigner = VEC_ALIGNER(src);
-        vbits = vec_ld(0, src);
-
-        while (width) {
-            voverflow = vec_ld(15, src);
-            src += 4;
-            width -= 4;
-            vbits = vec_perm(vbits, voverflow, valigner);       /* src is ready. */
-            vbits = vec_perm(vbits, vzero, vpermute);   /* swizzle it. */
-            vec_st(vbits, 0, dst);      /* store it back out. */
-            dst += 4;
-            vbits = voverflow;
-        }
-
-        SDL_assert(width == 0);
-
-        /* cover pixels at the end of the row that didn't fit in 16 bytes. */
-        while (extrawidth) {
-            bits = *(src++);    /* max 7 pixels, don't bother with prefetch. */
-            RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
-            if(!srcfmt->Amask)
-              a = info->a;
-            *(dst++) = MAKE8888(dstfmt, r, g, b, a);
-            extrawidth--;
-        }
-
-        src += srcskip;
-        dst += dstskip;
-    }
-
-}
-
-/* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */
-/* Use this on a G4 */
-static void
-ConvertAltivec32to32_prefetch(SDL_BlitInfo * info)
-{
-    const int scalar_dst_lead = sizeof(Uint32) * 4;
-    const int vector_dst_lead = sizeof(Uint32) * 16;
-
-    int height = info->dst_h;
-    Uint32 *src = (Uint32 *) info->src;
-    int srcskip = info->src_skip / 4;
-    Uint32 *dst = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip / 4;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    vector unsigned int vzero = vec_splat_u32(0);
-    vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
-    if (dstfmt->Amask && !srcfmt->Amask) {
-        if (info->a) {
-            vector unsigned char valpha;
-            ((unsigned char *) &valpha)[0] = info->a;
-            vzero = (vector unsigned int) vec_splat(valpha, 0);
-        }
-    }
-
-    SDL_assert(srcfmt->BytesPerPixel == 4);
-    SDL_assert(dstfmt->BytesPerPixel == 4);
-
-    while (height--) {
-        vector unsigned char valigner;
-        vector unsigned int vbits;
-        vector unsigned int voverflow;
-        Uint32 bits;
-        Uint8 r, g, b, a;
-
-        int width = info->dst_w;
-        int extrawidth;
-
-        /* do scalar until we can align... */
-        while ((UNALIGNED_PTR(dst)) && (width)) {
-            vec_dstt(src + scalar_dst_lead, DST_CTRL(2, 32, 1024),
-                     DST_CHAN_SRC);
-            vec_dstst(dst + scalar_dst_lead, DST_CTRL(2, 32, 1024),
-                      DST_CHAN_DEST);
-            bits = *(src++);
-            RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
-            if(!srcfmt->Amask)
-              a = info->a;
-            *(dst++) = MAKE8888(dstfmt, r, g, b, a);
-            width--;
-        }
-
-        /* After all that work, here's the vector part! */
-        extrawidth = (width % 4);
-        width -= extrawidth;
-        valigner = VEC_ALIGNER(src);
-        vbits = vec_ld(0, src);
-
-        while (width) {
-            vec_dstt(src + vector_dst_lead, DST_CTRL(2, 32, 1024),
-                     DST_CHAN_SRC);
-            vec_dstst(dst + vector_dst_lead, DST_CTRL(2, 32, 1024),
-                      DST_CHAN_DEST);
-            voverflow = vec_ld(15, src);
-            src += 4;
-            width -= 4;
-            vbits = vec_perm(vbits, voverflow, valigner);       /* src is ready. */
-            vbits = vec_perm(vbits, vzero, vpermute);   /* swizzle it. */
-            vec_st(vbits, 0, dst);      /* store it back out. */
-            dst += 4;
-            vbits = voverflow;
-        }
-
-        SDL_assert(width == 0);
-
-        /* cover pixels at the end of the row that didn't fit in 16 bytes. */
-        while (extrawidth) {
-            bits = *(src++);    /* max 7 pixels, don't bother with prefetch. */
-            RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
-            if(!srcfmt->Amask)
-              a = info->a;
-            *(dst++) = MAKE8888(dstfmt, r, g, b, a);
-            extrawidth--;
-        }
-
-        src += srcskip;
-        dst += dstskip;
-    }
-
-    vec_dss(DST_CHAN_SRC);
-    vec_dss(DST_CHAN_DEST);
-}
-
-static Uint32
-GetBlitFeatures(void)
-{
-    static Uint32 features = 0xffffffff;
-    if (features == 0xffffffff) {
-        /* Provide an override for testing .. */
-        char *override = SDL_getenv("SDL_ALTIVEC_BLIT_FEATURES");
-        if (override) {
-            features = 0;
-            SDL_sscanf(override, "%u", &features);
-        } else {
-            features = (0
-                        /* Feature 1 is has-MMX */
-                        | ((SDL_HasMMX())? 1 : 0)
-                        /* Feature 2 is has-AltiVec */
-                        | ((SDL_HasAltiVec())? 2 : 0)
-                        /* Feature 4 is dont-use-prefetch */
-                        /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */
-                        | ((GetL3CacheSize() == 0) ? 4 : 0)
-                );
-        }
-    }
-    return features;
-}
-
-#if __MWERKS__
-#pragma altivec_model off
-#endif
-#else
-/* Feature 1 is has-MMX */
-#define GetBlitFeatures() ((Uint32)(SDL_HasMMX() ? 1 : 0))
-#endif
-
-/* This is now endian dependent */
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define HI  1
-#define LO  0
-#else /* SDL_BYTEORDER == SDL_BIG_ENDIAN */
-#define HI  0
-#define LO  1
-#endif
-
-/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */
-#define RGB888_RGB332(dst, src) { \
-    dst = (Uint8)((((src)&0x00E00000)>>16)| \
-                  (((src)&0x0000E000)>>11)| \
-                  (((src)&0x000000C0)>>6)); \
-}
-static void
-Blit_RGB888_index8(SDL_BlitInfo * info)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int width, height;
-    Uint32 *src;
-    const Uint8 *map;
-    Uint8 *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = (Uint32 *) info->src;
-    srcskip = info->src_skip / 4;
-    dst = info->dst;
-    dstskip = info->dst_skip;
-    map = info->table;
-
-    if (map == NULL) {
-        while (height--) {
-#ifdef USE_DUFFS_LOOP
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-                RGB888_RGB332(*dst++, *src);
-            , width);
-            /* *INDENT-ON* */
-#else
-            for (c = width / 4; c; --c) {
-                /* Pack RGB into 8bit pixel */
-                ++src;
-                RGB888_RGB332(*dst++, *src);
-                ++src;
-                RGB888_RGB332(*dst++, *src);
-                ++src;
-                RGB888_RGB332(*dst++, *src);
-                ++src;
-            }
-            switch (width & 3) {
-            case 3:
-                RGB888_RGB332(*dst++, *src);
-                ++src;
-            case 2:
-                RGB888_RGB332(*dst++, *src);
-                ++src;
-            case 1:
-                RGB888_RGB332(*dst++, *src);
-                ++src;
-            }
-#endif /* USE_DUFFS_LOOP */
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        int Pixel;
-
-        while (height--) {
-#ifdef USE_DUFFS_LOOP
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-                RGB888_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            , width);
-            /* *INDENT-ON* */
-#else
-            for (c = width / 4; c; --c) {
-                /* Pack RGB into 8bit pixel */
-                RGB888_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-                RGB888_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-                RGB888_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-                RGB888_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            }
-            switch (width & 3) {
-            case 3:
-                RGB888_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            case 2:
-                RGB888_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            case 1:
-                RGB888_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            }
-#endif /* USE_DUFFS_LOOP */
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-}
-
-/* Special optimized blit for RGB 10-10-10 --> RGB 3-3-2 */
-#define RGB101010_RGB332(dst, src) { \
-    dst = (Uint8)((((src)&0x38000000)>>22)| \
-                  (((src)&0x000E0000)>>15)| \
-                  (((src)&0x00000300)>>8)); \
-}
-static void
-Blit_RGB101010_index8(SDL_BlitInfo * info)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int width, height;
-    Uint32 *src;
-    const Uint8 *map;
-    Uint8 *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = (Uint32 *) info->src;
-    srcskip = info->src_skip / 4;
-    dst = info->dst;
-    dstskip = info->dst_skip;
-    map = info->table;
-
-    if (map == NULL) {
-        while (height--) {
-#ifdef USE_DUFFS_LOOP
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-                RGB101010_RGB332(*dst++, *src);
-            , width);
-            /* *INDENT-ON* */
-#else
-            for (c = width / 4; c; --c) {
-                /* Pack RGB into 8bit pixel */
-                ++src;
-                RGB101010_RGB332(*dst++, *src);
-                ++src;
-                RGB101010_RGB332(*dst++, *src);
-                ++src;
-                RGB101010_RGB332(*dst++, *src);
-                ++src;
-            }
-            switch (width & 3) {
-            case 3:
-                RGB101010_RGB332(*dst++, *src);
-                ++src;
-            case 2:
-                RGB101010_RGB332(*dst++, *src);
-                ++src;
-            case 1:
-                RGB101010_RGB332(*dst++, *src);
-                ++src;
-            }
-#endif /* USE_DUFFS_LOOP */
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        int Pixel;
-
-        while (height--) {
-#ifdef USE_DUFFS_LOOP
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-                RGB101010_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            , width);
-            /* *INDENT-ON* */
-#else
-            for (c = width / 4; c; --c) {
-                /* Pack RGB into 8bit pixel */
-                RGB101010_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-                RGB101010_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-                RGB101010_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-                RGB101010_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            }
-            switch (width & 3) {
-            case 3:
-                RGB101010_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            case 2:
-                RGB101010_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            case 1:
-                RGB101010_RGB332(Pixel, *src);
-                *dst++ = map[Pixel];
-                ++src;
-            }
-#endif /* USE_DUFFS_LOOP */
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-}
-
-/* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */
-#define RGB888_RGB555(dst, src) { \
-    *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>9)| \
-                                (((*src)&0x0000F800)>>6)| \
-                                (((*src)&0x000000F8)>>3)); \
-}
-#define RGB888_RGB555_TWO(dst, src) { \
-    *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>9)| \
-                         (((src[HI])&0x0000F800)>>6)| \
-                         (((src[HI])&0x000000F8)>>3))<<16)| \
-                         (((src[LO])&0x00F80000)>>9)| \
-                         (((src[LO])&0x0000F800)>>6)| \
-                         (((src[LO])&0x000000F8)>>3); \
-}
-static void
-Blit_RGB888_RGB555(SDL_BlitInfo * info)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int width, height;
-    Uint32 *src;
-    Uint16 *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = (Uint32 *) info->src;
-    srcskip = info->src_skip / 4;
-    dst = (Uint16 *) info->dst;
-    dstskip = info->dst_skip / 2;
-
-#ifdef USE_DUFFS_LOOP
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP(
-            RGB888_RGB555(dst, src);
-            ++src;
-            ++dst;
-        , width);
-        /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-#else
-    /* Memory align at 4-byte boundary, if necessary */
-    if ((long) dst & 0x03) {
-        /* Don't do anything if width is 0 */
-        if (width == 0) {
-            return;
-        }
-        --width;
-
-        while (height--) {
-            /* Perform copy alignment */
-            RGB888_RGB555(dst, src);
-            ++src;
-            ++dst;
-
-            /* Copy in 4 pixel chunks */
-            for (c = width / 4; c; --c) {
-                RGB888_RGB555_TWO(dst, src);
-                src += 2;
-                dst += 2;
-                RGB888_RGB555_TWO(dst, src);
-                src += 2;
-                dst += 2;
-            }
-            /* Get any leftovers */
-            switch (width & 3) {
-            case 3:
-                RGB888_RGB555(dst, src);
-                ++src;
-                ++dst;
-            case 2:
-                RGB888_RGB555_TWO(dst, src);
-                src += 2;
-                dst += 2;
-                break;
-            case 1:
-                RGB888_RGB555(dst, src);
-                ++src;
-                ++dst;
-                break;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        while (height--) {
-            /* Copy in 4 pixel chunks */
-            for (c = width / 4; c; --c) {
-                RGB888_RGB555_TWO(dst, src);
-                src += 2;
-                dst += 2;
-                RGB888_RGB555_TWO(dst, src);
-                src += 2;
-                dst += 2;
-            }
-            /* Get any leftovers */
-            switch (width & 3) {
-            case 3:
-                RGB888_RGB555(dst, src);
-                ++src;
-                ++dst;
-            case 2:
-                RGB888_RGB555_TWO(dst, src);
-                src += 2;
-                dst += 2;
-                break;
-            case 1:
-                RGB888_RGB555(dst, src);
-                ++src;
-                ++dst;
-                break;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-#endif /* USE_DUFFS_LOOP */
-}
-
-/* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */
-#define RGB888_RGB565(dst, src) { \
-    *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \
-                                (((*src)&0x0000FC00)>>5)| \
-                                (((*src)&0x000000F8)>>3)); \
-}
-#define RGB888_RGB565_TWO(dst, src) { \
-    *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>8)| \
-                         (((src[HI])&0x0000FC00)>>5)| \
-                         (((src[HI])&0x000000F8)>>3))<<16)| \
-                         (((src[LO])&0x00F80000)>>8)| \
-                         (((src[LO])&0x0000FC00)>>5)| \
-                         (((src[LO])&0x000000F8)>>3); \
-}
-static void
-Blit_RGB888_RGB565(SDL_BlitInfo * info)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int width, height;
-    Uint32 *src;
-    Uint16 *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = (Uint32 *) info->src;
-    srcskip = info->src_skip / 4;
-    dst = (Uint16 *) info->dst;
-    dstskip = info->dst_skip / 2;
-
-#ifdef USE_DUFFS_LOOP
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP(
-            RGB888_RGB565(dst, src);
-            ++src;
-            ++dst;
-        , width);
-        /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-#else
-    /* Memory align at 4-byte boundary, if necessary */
-    if ((long) dst & 0x03) {
-        /* Don't do anything if width is 0 */
-        if (width == 0) {
-            return;
-        }
-        --width;
-
-        while (height--) {
-            /* Perform copy alignment */
-            RGB888_RGB565(dst, src);
-            ++src;
-            ++dst;
-
-            /* Copy in 4 pixel chunks */
-            for (c = width / 4; c; --c) {
-                RGB888_RGB565_TWO(dst, src);
-                src += 2;
-                dst += 2;
-                RGB888_RGB565_TWO(dst, src);
-                src += 2;
-                dst += 2;
-            }
-            /* Get any leftovers */
-            switch (width & 3) {
-            case 3:
-                RGB888_RGB565(dst, src);
-                ++src;
-                ++dst;
-            case 2:
-                RGB888_RGB565_TWO(dst, src);
-                src += 2;
-                dst += 2;
-                break;
-            case 1:
-                RGB888_RGB565(dst, src);
-                ++src;
-                ++dst;
-                break;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        while (height--) {
-            /* Copy in 4 pixel chunks */
-            for (c = width / 4; c; --c) {
-                RGB888_RGB565_TWO(dst, src);
-                src += 2;
-                dst += 2;
-                RGB888_RGB565_TWO(dst, src);
-                src += 2;
-                dst += 2;
-            }
-            /* Get any leftovers */
-            switch (width & 3) {
-            case 3:
-                RGB888_RGB565(dst, src);
-                ++src;
-                ++dst;
-            case 2:
-                RGB888_RGB565_TWO(dst, src);
-                src += 2;
-                dst += 2;
-                break;
-            case 1:
-                RGB888_RGB565(dst, src);
-                ++src;
-                ++dst;
-                break;
-            }
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-#endif /* USE_DUFFS_LOOP */
-}
-
-
-/* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */
-#define RGB565_32(dst, src, map) (map[src[LO]*2] + map[src[HI]*2+1])
-static void
-Blit_RGB565_32(SDL_BlitInfo * info, const Uint32 * map)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int width, height;
-    Uint8 *src;
-    Uint32 *dst;
-    int srcskip, dstskip;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = (Uint8 *) info->src;
-    srcskip = info->src_skip;
-    dst = (Uint32 *) info->dst;
-    dstskip = info->dst_skip / 4;
-
-#ifdef USE_DUFFS_LOOP
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP(
-        {
-            *dst++ = RGB565_32(dst, src, map);
-            src += 2;
-        },
-        width);
-        /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-#else
-    while (height--) {
-        /* Copy in 4 pixel chunks */
-        for (c = width / 4; c; --c) {
-            *dst++ = RGB565_32(dst, src, map);
-            src += 2;
-            *dst++ = RGB565_32(dst, src, map);
-            src += 2;
-            *dst++ = RGB565_32(dst, src, map);
-            src += 2;
-            *dst++ = RGB565_32(dst, src, map);
-            src += 2;
-        }
-        /* Get any leftovers */
-        switch (width & 3) {
-        case 3:
-            *dst++ = RGB565_32(dst, src, map);
-            src += 2;
-        case 2:
-            *dst++ = RGB565_32(dst, src, map);
-            src += 2;
-        case 1:
-            *dst++ = RGB565_32(dst, src, map);
-            src += 2;
-            break;
-        }
-        src += srcskip;
-        dst += dstskip;
-    }
-#endif /* USE_DUFFS_LOOP */
-}
-
-/* Special optimized blit for RGB 5-6-5 --> ARGB 8-8-8-8 */
-static const Uint32 RGB565_ARGB8888_LUT[512] = {
-    0x00000000, 0xff000000, 0x00000008, 0xff002000,
-    0x00000010, 0xff004000, 0x00000018, 0xff006100,
-    0x00000020, 0xff008100, 0x00000029, 0xff00a100,
-    0x00000031, 0xff00c200, 0x00000039, 0xff00e200,
-    0x00000041, 0xff080000, 0x0000004a, 0xff082000,
-    0x00000052, 0xff084000, 0x0000005a, 0xff086100,
-    0x00000062, 0xff088100, 0x0000006a, 0xff08a100,
-    0x00000073, 0xff08c200, 0x0000007b, 0xff08e200,
-    0x00000083, 0xff100000, 0x0000008b, 0xff102000,
-    0x00000094, 0xff104000, 0x0000009c, 0xff106100,
-    0x000000a4, 0xff108100, 0x000000ac, 0xff10a100,
-    0x000000b4, 0xff10c200, 0x000000bd, 0xff10e200,
-    0x000000c5, 0xff180000, 0x000000cd, 0xff182000,
-    0x000000d5, 0xff184000, 0x000000de, 0xff186100,
-    0x000000e6, 0xff188100, 0x000000ee, 0xff18a100,
-    0x000000f6, 0xff18c200, 0x000000ff, 0xff18e200,
-    0x00000400, 0xff200000, 0x00000408, 0xff202000,
-    0x00000410, 0xff204000, 0x00000418, 0xff206100,
-    0x00000420, 0xff208100, 0x00000429, 0xff20a100,
-    0x00000431, 0xff20c200, 0x00000439, 0xff20e200,
-    0x00000441, 0xff290000, 0x0000044a, 0xff292000,
-    0x00000452, 0xff294000, 0x0000045a, 0xff296100,
-    0x00000462, 0xff298100, 0x0000046a, 0xff29a100,
-    0x00000473, 0xff29c200, 0x0000047b, 0xff29e200,
-    0x00000483, 0xff310000, 0x0000048b, 0xff312000,
-    0x00000494, 0xff314000, 0x0000049c, 0xff316100,
-    0x000004a4, 0xff318100, 0x000004ac, 0xff31a100,
-    0x000004b4, 0xff31c200, 0x000004bd, 0xff31e200,
-    0x000004c5, 0xff390000, 0x000004cd, 0xff392000,
-    0x000004d5, 0xff394000, 0x000004de, 0xff396100,
-    0x000004e6, 0xff398100, 0x000004ee, 0xff39a100,
-    0x000004f6, 0xff39c200, 0x000004ff, 0xff39e200,
-    0x00000800, 0xff410000, 0x00000808, 0xff412000,
-    0x00000810, 0xff414000, 0x00000818, 0xff416100,
-    0x00000820, 0xff418100, 0x00000829, 0xff41a100,
-    0x00000831, 0xff41c200, 0x00000839, 0xff41e200,
-    0x00000841, 0xff4a0000, 0x0000084a, 0xff4a2000,
-    0x00000852, 0xff4a4000, 0x0000085a, 0xff4a6100,
-    0x00000862, 0xff4a8100, 0x0000086a, 0xff4aa100,
-    0x00000873, 0xff4ac200, 0x0000087b, 0xff4ae200,
-    0x00000883, 0xff520000, 0x0000088b, 0xff522000,
-    0x00000894, 0xff524000, 0x0000089c, 0xff526100,
-    0x000008a4, 0xff528100, 0x000008ac, 0xff52a100,
-    0x000008b4, 0xff52c200, 0x000008bd, 0xff52e200,
-    0x000008c5, 0xff5a0000, 0x000008cd, 0xff5a2000,
-    0x000008d5, 0xff5a4000, 0x000008de, 0xff5a6100,
-    0x000008e6, 0xff5a8100, 0x000008ee, 0xff5aa100,
-    0x000008f6, 0xff5ac200, 0x000008ff, 0xff5ae200,
-    0x00000c00, 0xff620000, 0x00000c08, 0xff622000,
-    0x00000c10, 0xff624000, 0x00000c18, 0xff626100,
-    0x00000c20, 0xff628100, 0x00000c29, 0xff62a100,
-    0x00000c31, 0xff62c200, 0x00000c39, 0xff62e200,
-    0x00000c41, 0xff6a0000, 0x00000c4a, 0xff6a2000,
-    0x00000c52, 0xff6a4000, 0x00000c5a, 0xff6a6100,
-    0x00000c62, 0xff6a8100, 0x00000c6a, 0xff6aa100,
-    0x00000c73, 0xff6ac200, 0x00000c7b, 0xff6ae200,
-    0x00000c83, 0xff730000, 0x00000c8b, 0xff732000,
-    0x00000c94, 0xff734000, 0x00000c9c, 0xff736100,
-    0x00000ca4, 0xff738100, 0x00000cac, 0xff73a100,
-    0x00000cb4, 0xff73c200, 0x00000cbd, 0xff73e200,
-    0x00000cc5, 0xff7b0000, 0x00000ccd, 0xff7b2000,
-    0x00000cd5, 0xff7b4000, 0x00000cde, 0xff7b6100,
-    0x00000ce6, 0xff7b8100, 0x00000cee, 0xff7ba100,
-    0x00000cf6, 0xff7bc200, 0x00000cff, 0xff7be200,
-    0x00001000, 0xff830000, 0x00001008, 0xff832000,
-    0x00001010, 0xff834000, 0x00001018, 0xff836100,
-    0x00001020, 0xff838100, 0x00001029, 0xff83a100,
-    0x00001031, 0xff83c200, 0x00001039, 0xff83e200,
-    0x00001041, 0xff8b0000, 0x0000104a, 0xff8b2000,
-    0x00001052, 0xff8b4000, 0x0000105a, 0xff8b6100,
-    0x00001062, 0xff8b8100, 0x0000106a, 0xff8ba100,
-    0x00001073, 0xff8bc200, 0x0000107b, 0xff8be200,
-    0x00001083, 0xff940000, 0x0000108b, 0xff942000,
-    0x00001094, 0xff944000, 0x0000109c, 0xff946100,
-    0x000010a4, 0xff948100, 0x000010ac, 0xff94a100,
-    0x000010b4, 0xff94c200, 0x000010bd, 0xff94e200,
-    0x000010c5, 0xff9c0000, 0x000010cd, 0xff9c2000,
-    0x000010d5, 0xff9c4000, 0x000010de, 0xff9c6100,
-    0x000010e6, 0xff9c8100, 0x000010ee, 0xff9ca100,
-    0x000010f6, 0xff9cc200, 0x000010ff, 0xff9ce200,
-    0x00001400, 0xffa40000, 0x00001408, 0xffa42000,
-    0x00001410, 0xffa44000, 0x00001418, 0xffa46100,
-    0x00001420, 0xffa48100, 0x00001429, 0xffa4a100,
-    0x00001431, 0xffa4c200, 0x00001439, 0xffa4e200,
-    0x00001441, 0xffac0000, 0x0000144a, 0xffac2000,
-    0x00001452, 0xffac4000, 0x0000145a, 0xffac6100,
-    0x00001462, 0xffac8100, 0x0000146a, 0xffaca100,
-    0x00001473, 0xffacc200, 0x0000147b, 0xfface200,
-    0x00001483, 0xffb40000, 0x0000148b, 0xffb42000,
-    0x00001494, 0xffb44000, 0x0000149c, 0xffb46100,
-    0x000014a4, 0xffb48100, 0x000014ac, 0xffb4a100,
-    0x000014b4, 0xffb4c200, 0x000014bd, 0xffb4e200,
-    0x000014c5, 0xffbd0000, 0x000014cd, 0xffbd2000,
-    0x000014d5, 0xffbd4000, 0x000014de, 0xffbd6100,
-    0x000014e6, 0xffbd8100, 0x000014ee, 0xffbda100,
-    0x000014f6, 0xffbdc200, 0x000014ff, 0xffbde200,
-    0x00001800, 0xffc50000, 0x00001808, 0xffc52000,
-    0x00001810, 0xffc54000, 0x00001818, 0xffc56100,
-    0x00001820, 0xffc58100, 0x00001829, 0xffc5a100,
-    0x00001831, 0xffc5c200, 0x00001839, 0xffc5e200,
-    0x00001841, 0xffcd0000, 0x0000184a, 0xffcd2000,
-    0x00001852, 0xffcd4000, 0x0000185a, 0xffcd6100,
-    0x00001862, 0xffcd8100, 0x0000186a, 0xffcda100,
-    0x00001873, 0xffcdc200, 0x0000187b, 0xffcde200,
-    0x00001883, 0xffd50000, 0x0000188b, 0xffd52000,
-    0x00001894, 0xffd54000, 0x0000189c, 0xffd56100,
-    0x000018a4, 0xffd58100, 0x000018ac, 0xffd5a100,
-    0x000018b4, 0xffd5c200, 0x000018bd, 0xffd5e200,
-    0x000018c5, 0xffde0000, 0x000018cd, 0xffde2000,
-    0x000018d5, 0xffde4000, 0x000018de, 0xffde6100,
-    0x000018e6, 0xffde8100, 0x000018ee, 0xffdea100,
-    0x000018f6, 0xffdec200, 0x000018ff, 0xffdee200,
-    0x00001c00, 0xffe60000, 0x00001c08, 0xffe62000,
-    0x00001c10, 0xffe64000, 0x00001c18, 0xffe66100,
-    0x00001c20, 0xffe68100, 0x00001c29, 0xffe6a100,
-    0x00001c31, 0xffe6c200, 0x00001c39, 0xffe6e200,
-    0x00001c41, 0xffee0000, 0x00001c4a, 0xffee2000,
-    0x00001c52, 0xffee4000, 0x00001c5a, 0xffee6100,
-    0x00001c62, 0xffee8100, 0x00001c6a, 0xffeea100,
-    0x00001c73, 0xffeec200, 0x00001c7b, 0xffeee200,
-    0x00001c83, 0xfff60000, 0x00001c8b, 0xfff62000,
-    0x00001c94, 0xfff64000, 0x00001c9c, 0xfff66100,
-    0x00001ca4, 0xfff68100, 0x00001cac, 0xfff6a100,
-    0x00001cb4, 0xfff6c200, 0x00001cbd, 0xfff6e200,
-    0x00001cc5, 0xffff0000, 0x00001ccd, 0xffff2000,
-    0x00001cd5, 0xffff4000, 0x00001cde, 0xffff6100,
-    0x00001ce6, 0xffff8100, 0x00001cee, 0xffffa100,
-    0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200
-};
-
-static void
-Blit_RGB565_ARGB8888(SDL_BlitInfo * info)
-{
-    Blit_RGB565_32(info, RGB565_ARGB8888_LUT);
-}
-
-/* Special optimized blit for RGB 5-6-5 --> ABGR 8-8-8-8 */
-static const Uint32 RGB565_ABGR8888_LUT[512] = {
-    0xff000000, 0x00000000, 0xff080000, 0x00002000,
-    0xff100000, 0x00004000, 0xff180000, 0x00006100,
-    0xff200000, 0x00008100, 0xff290000, 0x0000a100,
-    0xff310000, 0x0000c200, 0xff390000, 0x0000e200,
-    0xff410000, 0x00000008, 0xff4a0000, 0x00002008,
-    0xff520000, 0x00004008, 0xff5a0000, 0x00006108,
-    0xff620000, 0x00008108, 0xff6a0000, 0x0000a108,
-    0xff730000, 0x0000c208, 0xff7b0000, 0x0000e208,
-    0xff830000, 0x00000010, 0xff8b0000, 0x00002010,
-    0xff940000, 0x00004010, 0xff9c0000, 0x00006110,
-    0xffa40000, 0x00008110, 0xffac0000, 0x0000a110,
-    0xffb40000, 0x0000c210, 0xffbd0000, 0x0000e210,
-    0xffc50000, 0x00000018, 0xffcd0000, 0x00002018,
-    0xffd50000, 0x00004018, 0xffde0000, 0x00006118,
-    0xffe60000, 0x00008118, 0xffee0000, 0x0000a118,
-    0xfff60000, 0x0000c218, 0xffff0000, 0x0000e218,
-    0xff000400, 0x00000020, 0xff080400, 0x00002020,
-    0xff100400, 0x00004020, 0xff180400, 0x00006120,
-    0xff200400, 0x00008120, 0xff290400, 0x0000a120,
-    0xff310400, 0x0000c220, 0xff390400, 0x0000e220,
-    0xff410400, 0x00000029, 0xff4a0400, 0x00002029,
-    0xff520400, 0x00004029, 0xff5a0400, 0x00006129,
-    0xff620400, 0x00008129, 0xff6a0400, 0x0000a129,
-    0xff730400, 0x0000c229, 0xff7b0400, 0x0000e229,
-    0xff830400, 0x00000031, 0xff8b0400, 0x00002031,
-    0xff940400, 0x00004031, 0xff9c0400, 0x00006131,
-    0xffa40400, 0x00008131, 0xffac0400, 0x0000a131,
-    0xffb40400, 0x0000c231, 0xffbd0400, 0x0000e231,
-    0xffc50400, 0x00000039, 0xffcd0400, 0x00002039,
-    0xffd50400, 0x00004039, 0xffde0400, 0x00006139,
-    0xffe60400, 0x00008139, 0xffee0400, 0x0000a139,
-    0xfff60400, 0x0000c239, 0xffff0400, 0x0000e239,
-    0xff000800, 0x00000041, 0xff080800, 0x00002041,
-    0xff100800, 0x00004041, 0xff180800, 0x00006141,
-    0xff200800, 0x00008141, 0xff290800, 0x0000a141,
-    0xff310800, 0x0000c241, 0xff390800, 0x0000e241,
-    0xff410800, 0x0000004a, 0xff4a0800, 0x0000204a,
-    0xff520800, 0x0000404a, 0xff5a0800, 0x0000614a,
-    0xff620800, 0x0000814a, 0xff6a0800, 0x0000a14a,
-    0xff730800, 0x0000c24a, 0xff7b0800, 0x0000e24a,
-    0xff830800, 0x00000052, 0xff8b0800, 0x00002052,
-    0xff940800, 0x00004052, 0xff9c0800, 0x00006152,
-    0xffa40800, 0x00008152, 0xffac0800, 0x0000a152,
-    0xffb40800, 0x0000c252, 0xffbd0800, 0x0000e252,
-    0xffc50800, 0x0000005a, 0xffcd0800, 0x0000205a,
-    0xffd50800, 0x0000405a, 0xffde0800, 0x0000615a,
-    0xffe60800, 0x0000815a, 0xffee0800, 0x0000a15a,
-    0xfff60800, 0x0000c25a, 0xffff0800, 0x0000e25a,
-    0xff000c00, 0x00000062, 0xff080c00, 0x00002062,
-    0xff100c00, 0x00004062, 0xff180c00, 0x00006162,
-    0xff200c00, 0x00008162, 0xff290c00, 0x0000a162,
-    0xff310c00, 0x0000c262, 0xff390c00, 0x0000e262,
-    0xff410c00, 0x0000006a, 0xff4a0c00, 0x0000206a,
-    0xff520c00, 0x0000406a, 0xff5a0c00, 0x0000616a,
-    0xff620c00, 0x0000816a, 0xff6a0c00, 0x0000a16a,
-    0xff730c00, 0x0000c26a, 0xff7b0c00, 0x0000e26a,
-    0xff830c00, 0x00000073, 0xff8b0c00, 0x00002073,
-    0xff940c00, 0x00004073, 0xff9c0c00, 0x00006173,
-    0xffa40c00, 0x00008173, 0xffac0c00, 0x0000a173,
-    0xffb40c00, 0x0000c273, 0xffbd0c00, 0x0000e273,
-    0xffc50c00, 0x0000007b, 0xffcd0c00, 0x0000207b,
-    0xffd50c00, 0x0000407b, 0xffde0c00, 0x0000617b,
-    0xffe60c00, 0x0000817b, 0xffee0c00, 0x0000a17b,
-    0xfff60c00, 0x0000c27b, 0xffff0c00, 0x0000e27b,
-    0xff001000, 0x00000083, 0xff081000, 0x00002083,
-    0xff101000, 0x00004083, 0xff181000, 0x00006183,
-    0xff201000, 0x00008183, 0xff291000, 0x0000a183,
-    0xff311000, 0x0000c283, 0xff391000, 0x0000e283,
-    0xff411000, 0x0000008b, 0xff4a1000, 0x0000208b,
-    0xff521000, 0x0000408b, 0xff5a1000, 0x0000618b,
-    0xff621000, 0x0000818b, 0xff6a1000, 0x0000a18b,
-    0xff731000, 0x0000c28b, 0xff7b1000, 0x0000e28b,
-    0xff831000, 0x00000094, 0xff8b1000, 0x00002094,
-    0xff941000, 0x00004094, 0xff9c1000, 0x00006194,
-    0xffa41000, 0x00008194, 0xffac1000, 0x0000a194,
-    0xffb41000, 0x0000c294, 0xffbd1000, 0x0000e294,
-    0xffc51000, 0x0000009c, 0xffcd1000, 0x0000209c,
-    0xffd51000, 0x0000409c, 0xffde1000, 0x0000619c,
-    0xffe61000, 0x0000819c, 0xffee1000, 0x0000a19c,
-    0xfff61000, 0x0000c29c, 0xffff1000, 0x0000e29c,
-    0xff001400, 0x000000a4, 0xff081400, 0x000020a4,
-    0xff101400, 0x000040a4, 0xff181400, 0x000061a4,
-    0xff201400, 0x000081a4, 0xff291400, 0x0000a1a4,
-    0xff311400, 0x0000c2a4, 0xff391400, 0x0000e2a4,
-    0xff411400, 0x000000ac, 0xff4a1400, 0x000020ac,
-    0xff521400, 0x000040ac, 0xff5a1400, 0x000061ac,
-    0xff621400, 0x000081ac, 0xff6a1400, 0x0000a1ac,
-    0xff731400, 0x0000c2ac, 0xff7b1400, 0x0000e2ac,
-    0xff831400, 0x000000b4, 0xff8b1400, 0x000020b4,
-    0xff941400, 0x000040b4, 0xff9c1400, 0x000061b4,
-    0xffa41400, 0x000081b4, 0xffac1400, 0x0000a1b4,
-    0xffb41400, 0x0000c2b4, 0xffbd1400, 0x0000e2b4,
-    0xffc51400, 0x000000bd, 0xffcd1400, 0x000020bd,
-    0xffd51400, 0x000040bd, 0xffde1400, 0x000061bd,
-    0xffe61400, 0x000081bd, 0xffee1400, 0x0000a1bd,
-    0xfff61400, 0x0000c2bd, 0xffff1400, 0x0000e2bd,
-    0xff001800, 0x000000c5, 0xff081800, 0x000020c5,
-    0xff101800, 0x000040c5, 0xff181800, 0x000061c5,
-    0xff201800, 0x000081c5, 0xff291800, 0x0000a1c5,
-    0xff311800, 0x0000c2c5, 0xff391800, 0x0000e2c5,
-    0xff411800, 0x000000cd, 0xff4a1800, 0x000020cd,
-    0xff521800, 0x000040cd, 0xff5a1800, 0x000061cd,
-    0xff621800, 0x000081cd, 0xff6a1800, 0x0000a1cd,
-    0xff731800, 0x0000c2cd, 0xff7b1800, 0x0000e2cd,
-    0xff831800, 0x000000d5, 0xff8b1800, 0x000020d5,
-    0xff941800, 0x000040d5, 0xff9c1800, 0x000061d5,
-    0xffa41800, 0x000081d5, 0xffac1800, 0x0000a1d5,
-    0xffb41800, 0x0000c2d5, 0xffbd1800, 0x0000e2d5,
-    0xffc51800, 0x000000de, 0xffcd1800, 0x000020de,
-    0xffd51800, 0x000040de, 0xffde1800, 0x000061de,
-    0xffe61800, 0x000081de, 0xffee1800, 0x0000a1de,
-    0xfff61800, 0x0000c2de, 0xffff1800, 0x0000e2de,
-    0xff001c00, 0x000000e6, 0xff081c00, 0x000020e6,
-    0xff101c00, 0x000040e6, 0xff181c00, 0x000061e6,
-    0xff201c00, 0x000081e6, 0xff291c00, 0x0000a1e6,
-    0xff311c00, 0x0000c2e6, 0xff391c00, 0x0000e2e6,
-    0xff411c00, 0x000000ee, 0xff4a1c00, 0x000020ee,
-    0xff521c00, 0x000040ee, 0xff5a1c00, 0x000061ee,
-    0xff621c00, 0x000081ee, 0xff6a1c00, 0x0000a1ee,
-    0xff731c00, 0x0000c2ee, 0xff7b1c00, 0x0000e2ee,
-    0xff831c00, 0x000000f6, 0xff8b1c00, 0x000020f6,
-    0xff941c00, 0x000040f6, 0xff9c1c00, 0x000061f6,
-    0xffa41c00, 0x000081f6, 0xffac1c00, 0x0000a1f6,
-    0xffb41c00, 0x0000c2f6, 0xffbd1c00, 0x0000e2f6,
-    0xffc51c00, 0x000000ff, 0xffcd1c00, 0x000020ff,
-    0xffd51c00, 0x000040ff, 0xffde1c00, 0x000061ff,
-    0xffe61c00, 0x000081ff, 0xffee1c00, 0x0000a1ff,
-    0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff
-};
-
-static void
-Blit_RGB565_ABGR8888(SDL_BlitInfo * info)
-{
-    Blit_RGB565_32(info, RGB565_ABGR8888_LUT);
-}
-
-/* Special optimized blit for RGB 5-6-5 --> RGBA 8-8-8-8 */
-static const Uint32 RGB565_RGBA8888_LUT[512] = {
-    0x000000ff, 0x00000000, 0x000008ff, 0x00200000,
-    0x000010ff, 0x00400000, 0x000018ff, 0x00610000,
-    0x000020ff, 0x00810000, 0x000029ff, 0x00a10000,
-    0x000031ff, 0x00c20000, 0x000039ff, 0x00e20000,
-    0x000041ff, 0x08000000, 0x00004aff, 0x08200000,
-    0x000052ff, 0x08400000, 0x00005aff, 0x08610000,
-    0x000062ff, 0x08810000, 0x00006aff, 0x08a10000,
-    0x000073ff, 0x08c20000, 0x00007bff, 0x08e20000,
-    0x000083ff, 0x10000000, 0x00008bff, 0x10200000,
-    0x000094ff, 0x10400000, 0x00009cff, 0x10610000,
-    0x0000a4ff, 0x10810000, 0x0000acff, 0x10a10000,
-    0x0000b4ff, 0x10c20000, 0x0000bdff, 0x10e20000,
-    0x0000c5ff, 0x18000000, 0x0000cdff, 0x18200000,
-    0x0000d5ff, 0x18400000, 0x0000deff, 0x18610000,
-    0x0000e6ff, 0x18810000, 0x0000eeff, 0x18a10000,
-    0x0000f6ff, 0x18c20000, 0x0000ffff, 0x18e20000,
-    0x000400ff, 0x20000000, 0x000408ff, 0x20200000,
-    0x000410ff, 0x20400000, 0x000418ff, 0x20610000,
-    0x000420ff, 0x20810000, 0x000429ff, 0x20a10000,
-    0x000431ff, 0x20c20000, 0x000439ff, 0x20e20000,
-    0x000441ff, 0x29000000, 0x00044aff, 0x29200000,
-    0x000452ff, 0x29400000, 0x00045aff, 0x29610000,
-    0x000462ff, 0x29810000, 0x00046aff, 0x29a10000,
-    0x000473ff, 0x29c20000, 0x00047bff, 0x29e20000,
-    0x000483ff, 0x31000000, 0x00048bff, 0x31200000,
-    0x000494ff, 0x31400000, 0x00049cff, 0x31610000,
-    0x0004a4ff, 0x31810000, 0x0004acff, 0x31a10000,
-    0x0004b4ff, 0x31c20000, 0x0004bdff, 0x31e20000,
-    0x0004c5ff, 0x39000000, 0x0004cdff, 0x39200000,
-    0x0004d5ff, 0x39400000, 0x0004deff, 0x39610000,
-    0x0004e6ff, 0x39810000, 0x0004eeff, 0x39a10000,
-    0x0004f6ff, 0x39c20000, 0x0004ffff, 0x39e20000,
-    0x000800ff, 0x41000000, 0x000808ff, 0x41200000,
-    0x000810ff, 0x41400000, 0x000818ff, 0x41610000,
-    0x000820ff, 0x41810000, 0x000829ff, 0x41a10000,
-    0x000831ff, 0x41c20000, 0x000839ff, 0x41e20000,
-    0x000841ff, 0x4a000000, 0x00084aff, 0x4a200000,
-    0x000852ff, 0x4a400000, 0x00085aff, 0x4a610000,
-    0x000862ff, 0x4a810000, 0x00086aff, 0x4aa10000,
-    0x000873ff, 0x4ac20000, 0x00087bff, 0x4ae20000,
-    0x000883ff, 0x52000000, 0x00088bff, 0x52200000,
-    0x000894ff, 0x52400000, 0x00089cff, 0x52610000,
-    0x0008a4ff, 0x52810000, 0x0008acff, 0x52a10000,
-    0x0008b4ff, 0x52c20000, 0x0008bdff, 0x52e20000,
-    0x0008c5ff, 0x5a000000, 0x0008cdff, 0x5a200000,
-    0x0008d5ff, 0x5a400000, 0x0008deff, 0x5a610000,
-    0x0008e6ff, 0x5a810000, 0x0008eeff, 0x5aa10000,
-    0x0008f6ff, 0x5ac20000, 0x0008ffff, 0x5ae20000,
-    0x000c00ff, 0x62000000, 0x000c08ff, 0x62200000,
-    0x000c10ff, 0x62400000, 0x000c18ff, 0x62610000,
-    0x000c20ff, 0x62810000, 0x000c29ff, 0x62a10000,
-    0x000c31ff, 0x62c20000, 0x000c39ff, 0x62e20000,
-    0x000c41ff, 0x6a000000, 0x000c4aff, 0x6a200000,
-    0x000c52ff, 0x6a400000, 0x000c5aff, 0x6a610000,
-    0x000c62ff, 0x6a810000, 0x000c6aff, 0x6aa10000,
-    0x000c73ff, 0x6ac20000, 0x000c7bff, 0x6ae20000,
-    0x000c83ff, 0x73000000, 0x000c8bff, 0x73200000,
-    0x000c94ff, 0x73400000, 0x000c9cff, 0x73610000,
-    0x000ca4ff, 0x73810000, 0x000cacff, 0x73a10000,
-    0x000cb4ff, 0x73c20000, 0x000cbdff, 0x73e20000,
-    0x000cc5ff, 0x7b000000, 0x000ccdff, 0x7b200000,
-    0x000cd5ff, 0x7b400000, 0x000cdeff, 0x7b610000,
-    0x000ce6ff, 0x7b810000, 0x000ceeff, 0x7ba10000,
-    0x000cf6ff, 0x7bc20000, 0x000cffff, 0x7be20000,
-    0x001000ff, 0x83000000, 0x001008ff, 0x83200000,
-    0x001010ff, 0x83400000, 0x001018ff, 0x83610000,
-    0x001020ff, 0x83810000, 0x001029ff, 0x83a10000,
-    0x001031ff, 0x83c20000, 0x001039ff, 0x83e20000,
-    0x001041ff, 0x8b000000, 0x00104aff, 0x8b200000,
-    0x001052ff, 0x8b400000, 0x00105aff, 0x8b610000,
-    0x001062ff, 0x8b810000, 0x00106aff, 0x8ba10000,
-    0x001073ff, 0x8bc20000, 0x00107bff, 0x8be20000,
-    0x001083ff, 0x94000000, 0x00108bff, 0x94200000,
-    0x001094ff, 0x94400000, 0x00109cff, 0x94610000,
-    0x0010a4ff, 0x94810000, 0x0010acff, 0x94a10000,
-    0x0010b4ff, 0x94c20000, 0x0010bdff, 0x94e20000,
-    0x0010c5ff, 0x9c000000, 0x0010cdff, 0x9c200000,
-    0x0010d5ff, 0x9c400000, 0x0010deff, 0x9c610000,
-    0x0010e6ff, 0x9c810000, 0x0010eeff, 0x9ca10000,
-    0x0010f6ff, 0x9cc20000, 0x0010ffff, 0x9ce20000,
-    0x001400ff, 0xa4000000, 0x001408ff, 0xa4200000,
-    0x001410ff, 0xa4400000, 0x001418ff, 0xa4610000,
-    0x001420ff, 0xa4810000, 0x001429ff, 0xa4a10000,
-    0x001431ff, 0xa4c20000, 0x001439ff, 0xa4e20000,
-    0x001441ff, 0xac000000, 0x00144aff, 0xac200000,
-    0x001452ff, 0xac400000, 0x00145aff, 0xac610000,
-    0x001462ff, 0xac810000, 0x00146aff, 0xaca10000,
-    0x001473ff, 0xacc20000, 0x00147bff, 0xace20000,
-    0x001483ff, 0xb4000000, 0x00148bff, 0xb4200000,
-    0x001494ff, 0xb4400000, 0x00149cff, 0xb4610000,
-    0x0014a4ff, 0xb4810000, 0x0014acff, 0xb4a10000,
-    0x0014b4ff, 0xb4c20000, 0x0014bdff, 0xb4e20000,
-    0x0014c5ff, 0xbd000000, 0x0014cdff, 0xbd200000,
-    0x0014d5ff, 0xbd400000, 0x0014deff, 0xbd610000,
-    0x0014e6ff, 0xbd810000, 0x0014eeff, 0xbda10000,
-    0x0014f6ff, 0xbdc20000, 0x0014ffff, 0xbde20000,
-    0x001800ff, 0xc5000000, 0x001808ff, 0xc5200000,
-    0x001810ff, 0xc5400000, 0x001818ff, 0xc5610000,
-    0x001820ff, 0xc5810000, 0x001829ff, 0xc5a10000,
-    0x001831ff, 0xc5c20000, 0x001839ff, 0xc5e20000,
-    0x001841ff, 0xcd000000, 0x00184aff, 0xcd200000,
-    0x001852ff, 0xcd400000, 0x00185aff, 0xcd610000,
-    0x001862ff, 0xcd810000, 0x00186aff, 0xcda10000,
-    0x001873ff, 0xcdc20000, 0x00187bff, 0xcde20000,
-    0x001883ff, 0xd5000000, 0x00188bff, 0xd5200000,
-    0x001894ff, 0xd5400000, 0x00189cff, 0xd5610000,
-    0x0018a4ff, 0xd5810000, 0x0018acff, 0xd5a10000,
-    0x0018b4ff, 0xd5c20000, 0x0018bdff, 0xd5e20000,
-    0x0018c5ff, 0xde000000, 0x0018cdff, 0xde200000,
-    0x0018d5ff, 0xde400000, 0x0018deff, 0xde610000,
-    0x0018e6ff, 0xde810000, 0x0018eeff, 0xdea10000,
-    0x0018f6ff, 0xdec20000, 0x0018ffff, 0xdee20000,
-    0x001c00ff, 0xe6000000, 0x001c08ff, 0xe6200000,
-    0x001c10ff, 0xe6400000, 0x001c18ff, 0xe6610000,
-    0x001c20ff, 0xe6810000, 0x001c29ff, 0xe6a10000,
-    0x001c31ff, 0xe6c20000, 0x001c39ff, 0xe6e20000,
-    0x001c41ff, 0xee000000, 0x001c4aff, 0xee200000,
-    0x001c52ff, 0xee400000, 0x001c5aff, 0xee610000,
-    0x001c62ff, 0xee810000, 0x001c6aff, 0xeea10000,
-    0x001c73ff, 0xeec20000, 0x001c7bff, 0xeee20000,
-    0x001c83ff, 0xf6000000, 0x001c8bff, 0xf6200000,
-    0x001c94ff, 0xf6400000, 0x001c9cff, 0xf6610000,
-    0x001ca4ff, 0xf6810000, 0x001cacff, 0xf6a10000,
-    0x001cb4ff, 0xf6c20000, 0x001cbdff, 0xf6e20000,
-    0x001cc5ff, 0xff000000, 0x001ccdff, 0xff200000,
-    0x001cd5ff, 0xff400000, 0x001cdeff, 0xff610000,
-    0x001ce6ff, 0xff810000, 0x001ceeff, 0xffa10000,
-    0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000,
-};
-
-static void
-Blit_RGB565_RGBA8888(SDL_BlitInfo * info)
-{
-    Blit_RGB565_32(info, RGB565_RGBA8888_LUT);
-}
-
-/* Special optimized blit for RGB 5-6-5 --> BGRA 8-8-8-8 */
-static const Uint32 RGB565_BGRA8888_LUT[512] = {
-    0x00000000, 0x000000ff, 0x08000000, 0x002000ff,
-    0x10000000, 0x004000ff, 0x18000000, 0x006100ff,
-    0x20000000, 0x008100ff, 0x29000000, 0x00a100ff,
-    0x31000000, 0x00c200ff, 0x39000000, 0x00e200ff,
-    0x41000000, 0x000008ff, 0x4a000000, 0x002008ff,
-    0x52000000, 0x004008ff, 0x5a000000, 0x006108ff,
-    0x62000000, 0x008108ff, 0x6a000000, 0x00a108ff,
-    0x73000000, 0x00c208ff, 0x7b000000, 0x00e208ff,
-    0x83000000, 0x000010ff, 0x8b000000, 0x002010ff,
-    0x94000000, 0x004010ff, 0x9c000000, 0x006110ff,
-    0xa4000000, 0x008110ff, 0xac000000, 0x00a110ff,
-    0xb4000000, 0x00c210ff, 0xbd000000, 0x00e210ff,
-    0xc5000000, 0x000018ff, 0xcd000000, 0x002018ff,
-    0xd5000000, 0x004018ff, 0xde000000, 0x006118ff,
-    0xe6000000, 0x008118ff, 0xee000000, 0x00a118ff,
-    0xf6000000, 0x00c218ff, 0xff000000, 0x00e218ff,
-    0x00040000, 0x000020ff, 0x08040000, 0x002020ff,
-    0x10040000, 0x004020ff, 0x18040000, 0x006120ff,
-    0x20040000, 0x008120ff, 0x29040000, 0x00a120ff,
-    0x31040000, 0x00c220ff, 0x39040000, 0x00e220ff,
-    0x41040000, 0x000029ff, 0x4a040000, 0x002029ff,
-    0x52040000, 0x004029ff, 0x5a040000, 0x006129ff,
-    0x62040000, 0x008129ff, 0x6a040000, 0x00a129ff,
-    0x73040000, 0x00c229ff, 0x7b040000, 0x00e229ff,
-    0x83040000, 0x000031ff, 0x8b040000, 0x002031ff,
-    0x94040000, 0x004031ff, 0x9c040000, 0x006131ff,
-    0xa4040000, 0x008131ff, 0xac040000, 0x00a131ff,
-    0xb4040000, 0x00c231ff, 0xbd040000, 0x00e231ff,
-    0xc5040000, 0x000039ff, 0xcd040000, 0x002039ff,
-    0xd5040000, 0x004039ff, 0xde040000, 0x006139ff,
-    0xe6040000, 0x008139ff, 0xee040000, 0x00a139ff,
-    0xf6040000, 0x00c239ff, 0xff040000, 0x00e239ff,
-    0x00080000, 0x000041ff, 0x08080000, 0x002041ff,
-    0x10080000, 0x004041ff, 0x18080000, 0x006141ff,
-    0x20080000, 0x008141ff, 0x29080000, 0x00a141ff,
-    0x31080000, 0x00c241ff, 0x39080000, 0x00e241ff,
-    0x41080000, 0x00004aff, 0x4a080000, 0x00204aff,
-    0x52080000, 0x00404aff, 0x5a080000, 0x00614aff,
-    0x62080000, 0x00814aff, 0x6a080000, 0x00a14aff,
-    0x73080000, 0x00c24aff, 0x7b080000, 0x00e24aff,
-    0x83080000, 0x000052ff, 0x8b080000, 0x002052ff,
-    0x94080000, 0x004052ff, 0x9c080000, 0x006152ff,
-    0xa4080000, 0x008152ff, 0xac080000, 0x00a152ff,
-    0xb4080000, 0x00c252ff, 0xbd080000, 0x00e252ff,
-    0xc5080000, 0x00005aff, 0xcd080000, 0x00205aff,
-    0xd5080000, 0x00405aff, 0xde080000, 0x00615aff,
-    0xe6080000, 0x00815aff, 0xee080000, 0x00a15aff,
-    0xf6080000, 0x00c25aff, 0xff080000, 0x00e25aff,
-    0x000c0000, 0x000062ff, 0x080c0000, 0x002062ff,
-    0x100c0000, 0x004062ff, 0x180c0000, 0x006162ff,
-    0x200c0000, 0x008162ff, 0x290c0000, 0x00a162ff,
-    0x310c0000, 0x00c262ff, 0x390c0000, 0x00e262ff,
-    0x410c0000, 0x00006aff, 0x4a0c0000, 0x00206aff,
-    0x520c0000, 0x00406aff, 0x5a0c0000, 0x00616aff,
-    0x620c0000, 0x00816aff, 0x6a0c0000, 0x00a16aff,
-    0x730c0000, 0x00c26aff, 0x7b0c0000, 0x00e26aff,
-    0x830c0000, 0x000073ff, 0x8b0c0000, 0x002073ff,
-    0x940c0000, 0x004073ff, 0x9c0c0000, 0x006173ff,
-    0xa40c0000, 0x008173ff, 0xac0c0000, 0x00a173ff,
-    0xb40c0000, 0x00c273ff, 0xbd0c0000, 0x00e273ff,
-    0xc50c0000, 0x00007bff, 0xcd0c0000, 0x00207bff,
-    0xd50c0000, 0x00407bff, 0xde0c0000, 0x00617bff,
-    0xe60c0000, 0x00817bff, 0xee0c0000, 0x00a17bff,
-    0xf60c0000, 0x00c27bff, 0xff0c0000, 0x00e27bff,
-    0x00100000, 0x000083ff, 0x08100000, 0x002083ff,
-    0x10100000, 0x004083ff, 0x18100000, 0x006183ff,
-    0x20100000, 0x008183ff, 0x29100000, 0x00a183ff,
-    0x31100000, 0x00c283ff, 0x39100000, 0x00e283ff,
-    0x41100000, 0x00008bff, 0x4a100000, 0x00208bff,
-    0x52100000, 0x00408bff, 0x5a100000, 0x00618bff,
-    0x62100000, 0x00818bff, 0x6a100000, 0x00a18bff,
-    0x73100000, 0x00c28bff, 0x7b100000, 0x00e28bff,
-    0x83100000, 0x000094ff, 0x8b100000, 0x002094ff,
-    0x94100000, 0x004094ff, 0x9c100000, 0x006194ff,
-    0xa4100000, 0x008194ff, 0xac100000, 0x00a194ff,
-    0xb4100000, 0x00c294ff, 0xbd100000, 0x00e294ff,
-    0xc5100000, 0x00009cff, 0xcd100000, 0x00209cff,
-    0xd5100000, 0x00409cff, 0xde100000, 0x00619cff,
-    0xe6100000, 0x00819cff, 0xee100000, 0x00a19cff,
-    0xf6100000, 0x00c29cff, 0xff100000, 0x00e29cff,
-    0x00140000, 0x0000a4ff, 0x08140000, 0x0020a4ff,
-    0x10140000, 0x0040a4ff, 0x18140000, 0x0061a4ff,
-    0x20140000, 0x0081a4ff, 0x29140000, 0x00a1a4ff,
-    0x31140000, 0x00c2a4ff, 0x39140000, 0x00e2a4ff,
-    0x41140000, 0x0000acff, 0x4a140000, 0x0020acff,
-    0x52140000, 0x0040acff, 0x5a140000, 0x0061acff,
-    0x62140000, 0x0081acff, 0x6a140000, 0x00a1acff,
-    0x73140000, 0x00c2acff, 0x7b140000, 0x00e2acff,
-    0x83140000, 0x0000b4ff, 0x8b140000, 0x0020b4ff,
-    0x94140000, 0x0040b4ff, 0x9c140000, 0x0061b4ff,
-    0xa4140000, 0x0081b4ff, 0xac140000, 0x00a1b4ff,
-    0xb4140000, 0x00c2b4ff, 0xbd140000, 0x00e2b4ff,
-    0xc5140000, 0x0000bdff, 0xcd140000, 0x0020bdff,
-    0xd5140000, 0x0040bdff, 0xde140000, 0x0061bdff,
-    0xe6140000, 0x0081bdff, 0xee140000, 0x00a1bdff,
-    0xf6140000, 0x00c2bdff, 0xff140000, 0x00e2bdff,
-    0x00180000, 0x0000c5ff, 0x08180000, 0x0020c5ff,
-    0x10180000, 0x0040c5ff, 0x18180000, 0x0061c5ff,
-    0x20180000, 0x0081c5ff, 0x29180000, 0x00a1c5ff,
-    0x31180000, 0x00c2c5ff, 0x39180000, 0x00e2c5ff,
-    0x41180000, 0x0000cdff, 0x4a180000, 0x0020cdff,
-    0x52180000, 0x0040cdff, 0x5a180000, 0x0061cdff,
-    0x62180000, 0x0081cdff, 0x6a180000, 0x00a1cdff,
-    0x73180000, 0x00c2cdff, 0x7b180000, 0x00e2cdff,
-    0x83180000, 0x0000d5ff, 0x8b180000, 0x0020d5ff,
-    0x94180000, 0x0040d5ff, 0x9c180000, 0x0061d5ff,
-    0xa4180000, 0x0081d5ff, 0xac180000, 0x00a1d5ff,
-    0xb4180000, 0x00c2d5ff, 0xbd180000, 0x00e2d5ff,
-    0xc5180000, 0x0000deff, 0xcd180000, 0x0020deff,
-    0xd5180000, 0x0040deff, 0xde180000, 0x0061deff,
-    0xe6180000, 0x0081deff, 0xee180000, 0x00a1deff,
-    0xf6180000, 0x00c2deff, 0xff180000, 0x00e2deff,
-    0x001c0000, 0x0000e6ff, 0x081c0000, 0x0020e6ff,
-    0x101c0000, 0x0040e6ff, 0x181c0000, 0x0061e6ff,
-    0x201c0000, 0x0081e6ff, 0x291c0000, 0x00a1e6ff,
-    0x311c0000, 0x00c2e6ff, 0x391c0000, 0x00e2e6ff,
-    0x411c0000, 0x0000eeff, 0x4a1c0000, 0x0020eeff,
-    0x521c0000, 0x0040eeff, 0x5a1c0000, 0x0061eeff,
-    0x621c0000, 0x0081eeff, 0x6a1c0000, 0x00a1eeff,
-    0x731c0000, 0x00c2eeff, 0x7b1c0000, 0x00e2eeff,
-    0x831c0000, 0x0000f6ff, 0x8b1c0000, 0x0020f6ff,
-    0x941c0000, 0x0040f6ff, 0x9c1c0000, 0x0061f6ff,
-    0xa41c0000, 0x0081f6ff, 0xac1c0000, 0x00a1f6ff,
-    0xb41c0000, 0x00c2f6ff, 0xbd1c0000, 0x00e2f6ff,
-    0xc51c0000, 0x0000ffff, 0xcd1c0000, 0x0020ffff,
-    0xd51c0000, 0x0040ffff, 0xde1c0000, 0x0061ffff,
-    0xe61c0000, 0x0081ffff, 0xee1c0000, 0x00a1ffff,
-    0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff
-};
-
-static void
-Blit_RGB565_BGRA8888(SDL_BlitInfo * info)
-{
-    Blit_RGB565_32(info, RGB565_BGRA8888_LUT);
-}
-
-static void
-BlitNto1(SDL_BlitInfo * info)
-{
-#ifndef USE_DUFFS_LOOP
-    int c;
-#endif
-    int width, height;
-    Uint8 *src;
-    const Uint8 *map;
-    Uint8 *dst;
-    int srcskip, dstskip;
-    int srcbpp;
-    Uint32 Pixel;
-    int sR, sG, sB;
-    SDL_PixelFormat *srcfmt;
-
-    /* Set up some basic variables */
-    width = info->dst_w;
-    height = info->dst_h;
-    src = info->src;
-    srcskip = info->src_skip;
-    dst = info->dst;
-    dstskip = info->dst_skip;
-    map = info->table;
-    srcfmt = info->src_fmt;
-    srcbpp = srcfmt->BytesPerPixel;
-
-    if (map == NULL) {
-        while (height--) {
-#ifdef USE_DUFFS_LOOP
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-                DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
-                                sR, sG, sB);
-                if ( 1 ) {
-                    /* Pack RGB into 8bit pixel */
-                    *dst = ((sR>>5)<<(3+2))|
-                            ((sG>>5)<<(2)) |
-                            ((sB>>6)<<(0)) ;
-                }
-                dst++;
-                src += srcbpp;
-            , width);
-            /* *INDENT-ON* */
-#else
-            for (c = width; c; --c) {
-                DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
-                if (1) {
-                    /* Pack RGB into 8bit pixel */
-                    *dst = ((sR >> 5) << (3 + 2)) |
-                        ((sG >> 5) << (2)) | ((sB >> 6) << (0));
-                }
-                dst++;
-                src += srcbpp;
-            }
-#endif
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        while (height--) {
-#ifdef USE_DUFFS_LOOP
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-                DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
-                                sR, sG, sB);
-                if ( 1 ) {
-                    /* Pack RGB into 8bit pixel */
-                    *dst = map[((sR>>5)<<(3+2))|
-                           ((sG>>5)<<(2))  |
-                           ((sB>>6)<<(0))  ];
-                }
-                dst++;
-                src += srcbpp;
-            , width);
-            /* *INDENT-ON* */
-#else
-            for (c = width; c; --c) {
-                DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
-                if (1) {
-                    /* Pack RGB into 8bit pixel */
-                    *dst = map[((sR >> 5) << (3 + 2)) |
-                               ((sG >> 5) << (2)) | ((sB >> 6) << (0))];
-                }
-                dst++;
-                src += srcbpp;
-            }
-#endif /* USE_DUFFS_LOOP */
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-}
-
-/* blits 32 bit RGB<->RGBA with both surfaces having the same R,G,B fields */
-static void
-Blit4to4MaskAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint32 *src = (Uint32 *) info->src;
-    int srcskip = info->src_skip;
-    Uint32 *dst = (Uint32 *) info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-
-    if (dstfmt->Amask) {
-        /* RGB->RGBA, SET_ALPHA */
-        Uint32 mask = (info->a >> dstfmt->Aloss) << dstfmt->Ashift;
-
-        while (height--) {
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-            {
-                *dst = *src | mask;
-                ++dst;
-                ++src;
-            },
-            width);
-            /* *INDENT-ON* */
-            src = (Uint32 *) ((Uint8 *) src + srcskip);
-            dst = (Uint32 *) ((Uint8 *) dst + dstskip);
-        }
-    } else {
-        /* RGBA->RGB, NO_ALPHA */
-        Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
-
-        while (height--) {
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-            {
-                *dst = *src & mask;
-                ++dst;
-                ++src;
-            },
-            width);
-            /* *INDENT-ON* */
-            src = (Uint32 *) ((Uint8 *) src + srcskip);
-            dst = (Uint32 *) ((Uint8 *) dst + dstskip);
-        }
-    }
-}
-
-static void
-BlitNtoN(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    int srcbpp = srcfmt->BytesPerPixel;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int dstbpp = dstfmt->BytesPerPixel;
-    unsigned alpha = dstfmt->Amask ? info->a : 0;
-
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP(
-        {
-            Uint32 Pixel;
-            unsigned sR;
-            unsigned sG;
-            unsigned sB;
-            DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
-            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
-            dst += dstbpp;
-            src += srcbpp;
-        },
-        width);
-        /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-BlitNtoNCopyAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    int srcbpp = srcfmt->BytesPerPixel;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int dstbpp = dstfmt->BytesPerPixel;
-    int c;
-
-    while (height--) {
-        for (c = width; c; --c) {
-            Uint32 Pixel;
-            unsigned sR, sG, sB, sA;
-            DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
-            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
-            dst += dstbpp;
-            src += srcbpp;
-        }
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-BlitNto1Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    const Uint8 *palmap = info->table;
-    Uint32 ckey = info->colorkey;
-    Uint32 rgbmask = ~srcfmt->Amask;
-    int srcbpp;
-    Uint32 Pixel;
-    unsigned sR, sG, sB;
-
-    /* Set up some basic variables */
-    srcbpp = srcfmt->BytesPerPixel;
-    ckey &= rgbmask;
-
-    if (palmap == NULL) {
-        while (height--) {
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-            {
-                DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
-                                sR, sG, sB);
-                if ( (Pixel & rgbmask) != ckey ) {
-                    /* Pack RGB into 8bit pixel */
-                    *dst = (Uint8)(((sR>>5)<<(3+2))|
-                                   ((sG>>5)<<(2)) |
-                                   ((sB>>6)<<(0)));
-                }
-                dst++;
-                src += srcbpp;
-            },
-            width);
-            /* *INDENT-ON* */
-            src += srcskip;
-            dst += dstskip;
-        }
-    } else {
-        while (height--) {
-            /* *INDENT-OFF* */
-            DUFFS_LOOP(
-            {
-                DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
-                                sR, sG, sB);
-                if ( (Pixel & rgbmask) != ckey ) {
-                    /* Pack RGB into 8bit pixel */
-                    *dst = (Uint8)palmap[((sR>>5)<<(3+2))|
-                                         ((sG>>5)<<(2))  |
-                                         ((sB>>6)<<(0))  ];
-                }
-                dst++;
-                src += srcbpp;
-            },
-            width);
-            /* *INDENT-ON* */
-            src += srcskip;
-            dst += dstskip;
-        }
-    }
-}
-
-static void
-Blit2to2Key(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint16 *srcp = (Uint16 *) info->src;
-    int srcskip = info->src_skip;
-    Uint16 *dstp = (Uint16 *) info->dst;
-    int dstskip = info->dst_skip;
-    Uint32 ckey = info->colorkey;
-    Uint32 rgbmask = ~info->src_fmt->Amask;
-
-    /* Set up some basic variables */
-    srcskip /= 2;
-    dstskip /= 2;
-    ckey &= rgbmask;
-
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP(
-        {
-            if ( (*srcp & rgbmask) != ckey ) {
-                *dstp = *srcp;
-            }
-            dstp++;
-            srcp++;
-        },
-        width);
-        /* *INDENT-ON* */
-        srcp += srcskip;
-        dstp += dstskip;
-    }
-}
-
-static void
-BlitNtoNKey(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    Uint32 ckey = info->colorkey;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int srcbpp = srcfmt->BytesPerPixel;
-    int dstbpp = dstfmt->BytesPerPixel;
-    unsigned alpha = dstfmt->Amask ? info->a : 0;
-    Uint32 rgbmask = ~srcfmt->Amask;
-
-    /* Set up some basic variables */
-    ckey &= rgbmask;
-
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP(
-        {
-            Uint32 Pixel;
-            unsigned sR;
-            unsigned sG;
-            unsigned sB;
-            RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
-            if ( (Pixel & rgbmask) != ckey ) {
-                RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
-                ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
-            }
-            dst += dstbpp;
-            src += srcbpp;
-        },
-        width);
-        /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-static void
-BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    Uint32 ckey = info->colorkey;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    Uint32 rgbmask = ~srcfmt->Amask;
-
-    Uint8 srcbpp;
-    Uint8 dstbpp;
-    Uint32 Pixel;
-    unsigned sR, sG, sB, sA;
-
-    /* Set up some basic variables */
-    srcbpp = srcfmt->BytesPerPixel;
-    dstbpp = dstfmt->BytesPerPixel;
-    ckey &= rgbmask;
-
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP(
-        {
-            DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
-            if ( (Pixel & rgbmask) != ckey ) {
-                  ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
-            }
-            dst += dstbpp;
-            src += srcbpp;
-        },
-        width);
-        /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-/* Special optimized blit for ARGB 2-10-10-10 --> RGBA */
-static void
-Blit2101010toN(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *dstfmt = info->dst_fmt;
-    int dstbpp = dstfmt->BytesPerPixel;
-    Uint32 Pixel;
-    unsigned sR, sG, sB, sA;
-
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP(
-        {
-            Pixel = *(Uint32 *)src;
-            RGBA_FROM_ARGB2101010(Pixel, sR, sG, sB, sA);
-            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
-            dst += dstbpp;
-            src += 4;
-        },
-        width);
-        /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-/* Special optimized blit for RGBA --> ARGB 2-10-10-10 */
-static void
-BlitNto2101010(SDL_BlitInfo * info)
-{
-    int width = info->dst_w;
-    int height = info->dst_h;
-    Uint8 *src = info->src;
-    int srcskip = info->src_skip;
-    Uint8 *dst = info->dst;
-    int dstskip = info->dst_skip;
-    SDL_PixelFormat *srcfmt = info->src_fmt;
-    int srcbpp = srcfmt->BytesPerPixel;
-    Uint32 Pixel;
-    unsigned sR, sG, sB, sA;
-
-    while (height--) {
-        /* *INDENT-OFF* */
-        DUFFS_LOOP(
-        {
-            DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
-            ARGB2101010_FROM_RGBA(Pixel, sR, sG, sB, sA);
-            *(Uint32 *)dst = Pixel;
-            dst += 4;
-            src += srcbpp;
-        },
-        width);
-        /* *INDENT-ON* */
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-/* Normal N to N optimized blitters */
-struct blit_table
-{
-    Uint32 srcR, srcG, srcB;
-    int dstbpp;
-    Uint32 dstR, dstG, dstB;
-    Uint32 blit_features;
-    SDL_BlitFunc blitfunc;
-    enum
-    { NO_ALPHA = 1, SET_ALPHA = 2, COPY_ALPHA = 4 } alpha;
-};
-static const struct blit_table normal_blit_1[] = {
-    /* Default for 8-bit RGB source, never optimized */
-    {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
-};
-
-static const struct blit_table normal_blit_2[] = {
-#if SDL_ALTIVEC_BLITTERS
-    /* has-altivec */
-    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000,
-     2, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
-    {0x00007C00, 0x000003E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000,
-     2, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
-#endif
-    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF,
-     0, Blit_RGB565_ARGB8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
-    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x000000FF, 0x0000FF00, 0x00FF0000,
-     0, Blit_RGB565_ABGR8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
-    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0xFF000000, 0x00FF0000, 0x0000FF00,
-     0, Blit_RGB565_RGBA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
-    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x0000FF00, 0x00FF0000, 0xFF000000,
-     0, Blit_RGB565_BGRA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
-
-    /* Default for 16-bit RGB source, used if no other blitter matches */
-    {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
-};
-
-static const struct blit_table normal_blit_3[] = {
-    /* Default for 24-bit RGB source, never optimized */
-    {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
-};
-
-static const struct blit_table normal_blit_4[] = {
-#if SDL_ALTIVEC_BLITTERS
-    /* has-altivec | dont-use-prefetch */
-    {0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000,
-     6, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
-    /* has-altivec */
-    {0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000,
-     2, ConvertAltivec32to32_prefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
-    /* has-altivec */
-    {0x00000000, 0x00000000, 0x00000000, 2, 0x0000F800, 0x000007E0, 0x0000001F,
-     2, Blit_RGB888_RGB565Altivec, NO_ALPHA},
-#endif
-    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0, 0x0000001F,
-     0, Blit_RGB888_RGB565, NO_ALPHA},
-    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0, 0x0000001F,
-     0, Blit_RGB888_RGB555, NO_ALPHA},
-    /* Default for 32-bit RGB source, used if no other blitter matches */
-    {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
-};
-
-static const struct blit_table *const normal_blit[] = {
-    normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
-};
-
-/* Mask matches table, or table entry is zero */
-#define MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000))
-
-SDL_BlitFunc
-SDL_CalculateBlitN(SDL_Surface * surface)
-{
-    SDL_PixelFormat *srcfmt;
-    SDL_PixelFormat *dstfmt;
-    const struct blit_table *table;
-    int which;
-    SDL_BlitFunc blitfun;
-
-    /* Set up data for choosing the blit */
-    srcfmt = surface->format;
-    dstfmt = surface->map->dst->format;
-
-    /* We don't support destinations less than 8-bits */
-    if (dstfmt->BitsPerPixel < 8) {
-        return (NULL);
-    }
-
-    switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
-    case 0:
-        blitfun = NULL;
-        if (dstfmt->BitsPerPixel == 8) {
-            if ((srcfmt->BytesPerPixel == 4) &&
-                (srcfmt->Rmask == 0x00FF0000) &&
-                (srcfmt->Gmask == 0x0000FF00) &&
-                (srcfmt->Bmask == 0x000000FF)) {
-                blitfun = Blit_RGB888_index8;
-            } else if ((srcfmt->BytesPerPixel == 4) &&
-                (srcfmt->Rmask == 0x3FF00000) &&
-                (srcfmt->Gmask == 0x000FFC00) &&
-                (srcfmt->Bmask == 0x000003FF)) {
-                blitfun = Blit_RGB101010_index8;
-            } else {
-                blitfun = BlitNto1;
-            }
-        } else {
-            /* Now the meat, choose the blitter we want */
-            int a_need = NO_ALPHA;
-            if (dstfmt->Amask)
-                a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
-            table = normal_blit[srcfmt->BytesPerPixel - 1];
-            for (which = 0; table[which].dstbpp; ++which) {
-                if (MASKOK(srcfmt->Rmask, table[which].srcR) &&
-                    MASKOK(srcfmt->Gmask, table[which].srcG) &&
-                    MASKOK(srcfmt->Bmask, table[which].srcB) &&
-                    MASKOK(dstfmt->Rmask, table[which].dstR) &&
-                    MASKOK(dstfmt->Gmask, table[which].dstG) &&
-                    MASKOK(dstfmt->Bmask, table[which].dstB) &&
-                    dstfmt->BytesPerPixel == table[which].dstbpp &&
-                    (a_need & table[which].alpha) == a_need &&
-                    ((table[which].blit_features & GetBlitFeatures()) ==
-                     table[which].blit_features))
-                    break;
-            }
-            blitfun = table[which].blitfunc;
-
-            if (blitfun == BlitNtoN) {  /* default C fallback catch-all. Slow! */
-                if (srcfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
-                    blitfun = Blit2101010toN;
-                } else if (dstfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
-                    blitfun = BlitNto2101010;
-                } else if (srcfmt->BytesPerPixel == 4 &&
-                            dstfmt->BytesPerPixel == 4 &&
-                            srcfmt->Rmask == dstfmt->Rmask &&
-                            srcfmt->Gmask == dstfmt->Gmask &&
-                            srcfmt->Bmask == dstfmt->Bmask) {
-                    /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
-                    blitfun = Blit4to4MaskAlpha;
-                } else if (a_need == COPY_ALPHA) {
-                    blitfun = BlitNtoNCopyAlpha;
-                }
-            }
-        }
-        return (blitfun);
-
-    case SDL_COPY_COLORKEY:
-        /* colorkey blit: Here we don't have too many options, mostly
-           because RLE is the preferred fast way to deal with this.
-           If a particular case turns out to be useful we'll add it. */
-
-        if (srcfmt->BytesPerPixel == 2 && surface->map->identity)
-            return Blit2to2Key;
-        else if (dstfmt->BytesPerPixel == 1)
-            return BlitNto1Key;
-        else {
-#if SDL_ALTIVEC_BLITTERS
-            if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4)
-                && SDL_HasAltiVec()) {
-                return Blit32to32KeyAltivec;
-            } else
-#endif
-            if (srcfmt->Amask && dstfmt->Amask) {
-                return BlitNtoNKeyCopyAlpha;
-            } else {
-                return BlitNtoNKey;
-            }
-        }
-    }
-
-    return NULL;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_auto.c b/deps/SDL2/src/video/SDL_blit_auto.c
deleted file mode 100644
index 251c5fe..0000000
--- a/deps/SDL2/src/video/SDL_blit_auto.c
+++ /dev/null
@@ -1,7563 +0,0 @@
-/* DO NOT EDIT!  This file is generated by sdlgenblit.pl */
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* *INDENT-OFF* */
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-#include "SDL_blit_auto.h"
-
-static void SDL_Blit_RGB888_RGB888_Scale(SDL_BlitInfo *info)
-{
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            *dst = *src;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_RGB888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_RGB888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_RGB888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_BGR888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_BGR888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_BGR888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_BGR888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_ARGB8888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_ARGB8888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_RGB888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_RGB888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_RGB888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_RGB888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_BGR888_Scale(SDL_BlitInfo *info)
-{
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            *dst = *src;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_BGR888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_BGR888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_BGR888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_ARGB8888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_ARGB8888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_ARGB8888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_RGB888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_RGB888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_RGB888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_BGR888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_BGR888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_BGR888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info)
-{
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            *dst = *src;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_RGB888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_RGB888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_RGB888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_BGR888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_BGR888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_BGR888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_RGB888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_RGB888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_RGB888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_BGR888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_BGR888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_BGR888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_RGB888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_RGB888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_RGB888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_BGR888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_BGR888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_BGR888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info)
-{
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            pixel = *src;
-            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            pixel = *src;
-            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                R = (R * modulateR) / 255;
-                G = (G * modulateG) / 255;
-                B = (B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                A = (A * modulateA) / 255;
-            }
-            pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
-            *dst = pixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-
-    while (info->dst_h--) {
-        Uint32 *src = (Uint32 *)info->src;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-}
-
-static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint32 *src = 0;
-        Uint32 *dst = (Uint32 *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
-            }
-            srcpixel = *src;
-            srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
-            dstpixel = *dst;
-            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                dstA = srcA + ((255 - srcA) * dstA) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR; if (dstR > 255) dstR = 255;
-                dstG = srcG + dstG; if (dstG > 255) dstG = 255;
-                dstB = srcB + dstB; if (dstB > 255) dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
-            *dst = dstpixel;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[] = {
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Scale },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend },
-    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Scale },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend },
-    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend },
-    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend },
-    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend },
-    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend },
-    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale },
-    { 0, 0, 0, 0, NULL }
-};
-
-/* *INDENT-ON* */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_auto.h b/deps/SDL2/src/video/SDL_blit_auto.h
deleted file mode 100644
index ed0115e..0000000
--- a/deps/SDL2/src/video/SDL_blit_auto.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* DO NOT EDIT!  This file is generated by sdlgenblit.pl */
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* *INDENT-OFF* */
-
-extern SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[];
-
-/* *INDENT-ON* */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_copy.c b/deps/SDL2/src/video/SDL_blit_copy.c
deleted file mode 100644
index 80519e0..0000000
--- a/deps/SDL2/src/video/SDL_blit_copy.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-#include "SDL_blit_copy.h"
-
-
-#ifdef __SSE__
-/* This assumes 16-byte aligned src and dst */
-static SDL_INLINE void
-SDL_memcpySSE(Uint8 * dst, const Uint8 * src, int len)
-{
-    int i;
-
-    __m128 values[4];
-    for (i = len / 64; i--;) {
-        _mm_prefetch(src, _MM_HINT_NTA);
-        values[0] = *(__m128 *) (src + 0);
-        values[1] = *(__m128 *) (src + 16);
-        values[2] = *(__m128 *) (src + 32);
-        values[3] = *(__m128 *) (src + 48);
-        _mm_stream_ps((float *) (dst + 0), values[0]);
-        _mm_stream_ps((float *) (dst + 16), values[1]);
-        _mm_stream_ps((float *) (dst + 32), values[2]);
-        _mm_stream_ps((float *) (dst + 48), values[3]);
-        src += 64;
-        dst += 64;
-    }
-
-    if (len & 63)
-        SDL_memcpy(dst, src, len & 63);
-}
-#endif /* __SSE__ */
-
-#ifdef __MMX__
-#ifdef _MSC_VER
-#pragma warning(disable:4799)
-#endif
-static SDL_INLINE void
-SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len)
-{
-    const int remain = (len & 63);
-    int i;
-
-    __m64* d64 = (__m64*)dst;
-    __m64* s64 = (__m64*)src;
-
-    for(i= len / 64; i--;) {
-        d64[0] = s64[0];
-        d64[1] = s64[1];
-        d64[2] = s64[2];
-        d64[3] = s64[3];
-        d64[4] = s64[4];
-        d64[5] = s64[5];
-        d64[6] = s64[6];
-        d64[7] = s64[7];
-
-        d64 += 8;
-        s64 += 8;
-    }
-
-    if (remain)
-    {
-        const int skip = len - remain;
-        SDL_memcpy(dst + skip, src + skip, remain);
-    }
-}
-#endif /* __MMX__ */
-
-void
-SDL_BlitCopy(SDL_BlitInfo * info)
-{
-    SDL_bool overlap;
-    Uint8 *src, *dst;
-    int w, h;
-    int srcskip, dstskip;
-
-    w = info->dst_w * info->dst_fmt->BytesPerPixel;
-    h = info->dst_h;
-    src = info->src;
-    dst = info->dst;
-    srcskip = info->src_pitch;
-    dstskip = info->dst_pitch;
-
-    /* Properly handle overlapping blits */
-    if (src < dst) {
-        overlap = (dst < (src + h*srcskip));
-    } else {
-        overlap = (src < (dst + h*dstskip));
-    }
-    if (overlap) {
-        while (h--) {
-            SDL_memmove(dst, src, w);
-            src += srcskip;
-            dst += dstskip;
-        }
-        return;
-    }
-
-#ifdef __SSE__
-    if (SDL_HasSSE() &&
-        !((uintptr_t) src & 15) && !(srcskip & 15) &&
-        !((uintptr_t) dst & 15) && !(dstskip & 15)) {
-        while (h--) {
-            SDL_memcpySSE(dst, src, w);
-            src += srcskip;
-            dst += dstskip;
-        }
-        return;
-    }
-#endif
-
-#ifdef __MMX__
-    if (SDL_HasMMX() && !(srcskip & 7) && !(dstskip & 7)) {
-        while (h--) {
-            SDL_memcpyMMX(dst, src, w);
-            src += srcskip;
-            dst += dstskip;
-        }
-        _mm_empty();
-        return;
-    }
-#endif
-
-    while (h--) {
-        SDL_memcpy(dst, src, w);
-        src += srcskip;
-        dst += dstskip;
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_copy.h b/deps/SDL2/src/video/SDL_blit_copy.h
deleted file mode 100644
index 8d02a83..0000000
--- a/deps/SDL2/src/video/SDL_blit_copy.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-void SDL_BlitCopy(SDL_BlitInfo * info);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_slow.c b/deps/SDL2/src/video/SDL_blit_slow.c
deleted file mode 100644
index 1f4bce2..0000000
--- a/deps/SDL2/src/video/SDL_blit_slow.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-#include "SDL_blit_slow.h"
-
-/* The ONE TRUE BLITTER
- * This puppy has to handle all the unoptimized cases - yes, it's slow.
- */
-void
-SDL_Blit_Slow(SDL_BlitInfo * info)
-{
-    const int flags = info->flags;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-    SDL_PixelFormat *src_fmt = info->src_fmt;
-    SDL_PixelFormat *dst_fmt = info->dst_fmt;
-    int srcbpp = src_fmt->BytesPerPixel;
-    int dstbpp = dst_fmt->BytesPerPixel;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        Uint8 *src = 0;
-        Uint8 *dst = (Uint8 *) info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src =
-                    (info->src + (srcy * info->src_pitch) + (srcx * srcbpp));
-            }
-            if (src_fmt->Amask) {
-                DISEMBLE_RGBA(src, srcbpp, src_fmt, srcpixel, srcR, srcG,
-                              srcB, srcA);
-            } else {
-                DISEMBLE_RGB(src, srcbpp, src_fmt, srcpixel, srcR, srcG,
-                             srcB);
-                srcA = 0xFF;
-            }
-            if (flags & SDL_COPY_COLORKEY) {
-                /* srcpixel isn't set for 24 bpp */
-                if (srcbpp == 3) {
-                    srcpixel = (srcR << src_fmt->Rshift) |
-                        (srcG << src_fmt->Gshift) | (srcB << src_fmt->Bshift);
-                }
-                if (srcpixel == info->colorkey) {
-                    posx += incx;
-                    dst += dstbpp;
-                    continue;
-                }
-            }
-            if (dst_fmt->Amask) {
-                DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG,
-                              dstB, dstA);
-            } else {
-                DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG,
-                             dstB);
-                dstA = 0xFF;
-            }
-
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                srcR = (srcR * modulateR) / 255;
-                srcG = (srcG * modulateG) / 255;
-                srcB = (srcB * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                srcA = (srcA * modulateA) / 255;
-            }
-            if (flags & (SDL_COPY_BLEND | SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (srcA < 255) {
-                    srcR = (srcR * srcA) / 255;
-                    srcG = (srcG * srcA) / 255;
-                    srcB = (srcB * srcA) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD)) {
-            case 0:
-                dstR = srcR;
-                dstG = srcG;
-                dstB = srcB;
-                dstA = srcA;
-                break;
-            case SDL_COPY_BLEND:
-                dstR = srcR + ((255 - srcA) * dstR) / 255;
-                dstG = srcG + ((255 - srcA) * dstG) / 255;
-                dstB = srcB + ((255 - srcA) * dstB) / 255;
-                break;
-            case SDL_COPY_ADD:
-                dstR = srcR + dstR;
-                if (dstR > 255)
-                    dstR = 255;
-                dstG = srcG + dstG;
-                if (dstG > 255)
-                    dstG = 255;
-                dstB = srcB + dstB;
-                if (dstB > 255)
-                    dstB = 255;
-                break;
-            case SDL_COPY_MOD:
-                dstR = (srcR * dstR) / 255;
-                dstG = (srcG * dstG) / 255;
-                dstB = (srcB * dstB) / 255;
-                break;
-            }
-            if (dst_fmt->Amask) {
-                ASSEMBLE_RGBA(dst, dstbpp, dst_fmt, dstR, dstG, dstB, dstA);
-            } else {
-                ASSEMBLE_RGB(dst, dstbpp, dst_fmt, dstR, dstG, dstB);
-            }
-            posx += incx;
-            dst += dstbpp;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_blit_slow.h b/deps/SDL2/src/video/SDL_blit_slow.h
deleted file mode 100644
index 15b5c79..0000000
--- a/deps/SDL2/src/video/SDL_blit_slow.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-extern void SDL_Blit_Slow(SDL_BlitInfo * info);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_bmp.c b/deps/SDL2/src/video/SDL_bmp.c
deleted file mode 100644
index 9244b28..0000000
--- a/deps/SDL2/src/video/SDL_bmp.c
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/*
-   Code to load and save surfaces in Windows BMP format.
-
-   Why support BMP format?  Well, it's a native format for Windows, and
-   most image processing programs can read and write it.  It would be nice
-   to be able to have at least one image format that we can natively load
-   and save, and since PNG is so complex that it would bloat the library,
-   BMP is a good alternative.
-
-   This code currently supports Win32 DIBs in uncompressed 8 and 24 bpp.
-*/
-
-#include "SDL_video.h"
-#include "SDL_endian.h"
-#include "SDL_pixels_c.h"
-
-#define SAVE_32BIT_BMP
-
-/* Compression encodings for BMP files */
-#ifndef BI_RGB
-#define BI_RGB      0
-#define BI_RLE8     1
-#define BI_RLE4     2
-#define BI_BITFIELDS    3
-#endif
-
-
-static void CorrectAlphaChannel(SDL_Surface *surface)
-{
-    /* Check to see if there is any alpha channel data */
-    SDL_bool hasAlpha = SDL_FALSE;
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-    int alphaChannelOffset = 0;
-#else
-    int alphaChannelOffset = 3;
-#endif
-    Uint8 *alpha = ((Uint8*)surface->pixels) + alphaChannelOffset;
-    Uint8 *end = alpha + surface->h * surface->pitch;
-
-    while (alpha < end) {
-        if (*alpha != 0) {
-            hasAlpha = SDL_TRUE;
-            break;
-        }
-        alpha += 4;
-    }
-
-    if (!hasAlpha) {
-        alpha = ((Uint8*)surface->pixels) + alphaChannelOffset;
-        while (alpha < end) {
-            *alpha = SDL_ALPHA_OPAQUE;
-            alpha += 4;
-        }
-    }
-}
-
-SDL_Surface *
-SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
-{
-    SDL_bool was_error;
-    Sint64 fp_offset = 0;
-    int bmpPitch;
-    int i, pad;
-    SDL_Surface *surface;
-    Uint32 Rmask;
-    Uint32 Gmask;
-    Uint32 Bmask;
-    Uint32 Amask;
-    SDL_Palette *palette;
-    Uint8 *bits;
-    Uint8 *top, *end;
-    SDL_bool topDown;
-    int ExpandBMP;
-    SDL_bool correctAlpha = SDL_FALSE;
-
-    /* The Win32 BMP file header (14 bytes) */
-    char magic[2];
-    /* Uint32 bfSize = 0; */
-    /* Uint16 bfReserved1 = 0; */
-    /* Uint16 bfReserved2 = 0; */
-    Uint32 bfOffBits = 0;
-
-    /* The Win32 BITMAPINFOHEADER struct (40 bytes) */
-    Uint32 biSize = 0;
-    Sint32 biWidth = 0;
-    Sint32 biHeight = 0;
-    /* Uint16 biPlanes = 0; */
-    Uint16 biBitCount = 0;
-    Uint32 biCompression = 0;
-    /* Uint32 biSizeImage = 0; */
-    /* Sint32 biXPelsPerMeter = 0; */
-    /* Sint32 biYPelsPerMeter = 0; */
-    Uint32 biClrUsed = 0;
-    /* Uint32 biClrImportant = 0; */
-
-    /* Make sure we are passed a valid data source */
-    surface = NULL;
-    was_error = SDL_FALSE;
-    if (src == NULL) {
-        was_error = SDL_TRUE;
-        goto done;
-    }
-
-    /* Read in the BMP file header */
-    fp_offset = SDL_RWtell(src);
-    SDL_ClearError();
-    if (SDL_RWread(src, magic, 1, 2) != 2) {
-        SDL_Error(SDL_EFREAD);
-        was_error = SDL_TRUE;
-        goto done;
-    }
-    if (SDL_strncmp(magic, "BM", 2) != 0) {
-        SDL_SetError("File is not a Windows BMP file");
-        was_error = SDL_TRUE;
-        goto done;
-    }
-    /* bfSize = */ SDL_ReadLE32(src);
-    /* bfReserved1 = */ SDL_ReadLE16(src);
-    /* bfReserved2 = */ SDL_ReadLE16(src);
-    bfOffBits = SDL_ReadLE32(src);
-
-    /* Read the Win32 BITMAPINFOHEADER */
-    biSize = SDL_ReadLE32(src);
-    if (biSize == 12) {
-        biWidth = (Uint32) SDL_ReadLE16(src);
-        biHeight = (Uint32) SDL_ReadLE16(src);
-        /* biPlanes = */ SDL_ReadLE16(src);
-        biBitCount = SDL_ReadLE16(src);
-        biCompression = BI_RGB;
-    } else {
-        biWidth = SDL_ReadLE32(src);
-        biHeight = SDL_ReadLE32(src);
-        /* biPlanes = */ SDL_ReadLE16(src);
-        biBitCount = SDL_ReadLE16(src);
-        biCompression = SDL_ReadLE32(src);
-        /* biSizeImage = */ SDL_ReadLE32(src);
-        /* biXPelsPerMeter = */ SDL_ReadLE32(src);
-        /* biYPelsPerMeter = */ SDL_ReadLE32(src);
-        biClrUsed = SDL_ReadLE32(src);
-        /* biClrImportant = */ SDL_ReadLE32(src);
-    }
-    if (biHeight < 0) {
-        topDown = SDL_TRUE;
-        biHeight = -biHeight;
-    } else {
-        topDown = SDL_FALSE;
-    }
-
-    /* Check for read error */
-    if (SDL_strcmp(SDL_GetError(), "") != 0) {
-        was_error = SDL_TRUE;
-        goto done;
-    }
-
-    /* Expand 1 and 4 bit bitmaps to 8 bits per pixel */
-    switch (biBitCount) {
-    case 1:
-    case 4:
-        ExpandBMP = biBitCount;
-        biBitCount = 8;
-        break;
-    default:
-        ExpandBMP = 0;
-        break;
-    }
-
-    /* We don't support any BMP compression right now */
-    Rmask = Gmask = Bmask = Amask = 0;
-    switch (biCompression) {
-    case BI_RGB:
-        /* If there are no masks, use the defaults */
-        if (bfOffBits == (14 + biSize)) {
-            /* Default values for the BMP format */
-            switch (biBitCount) {
-            case 15:
-            case 16:
-                Rmask = 0x7C00;
-                Gmask = 0x03E0;
-                Bmask = 0x001F;
-                break;
-            case 24:
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-                Rmask = 0x000000FF;
-                Gmask = 0x0000FF00;
-                Bmask = 0x00FF0000;
-#else
-                Rmask = 0x00FF0000;
-                Gmask = 0x0000FF00;
-                Bmask = 0x000000FF;
-#endif
-                break;
-            case 32:
-                /* We don't know if this has alpha channel or not */
-                correctAlpha = SDL_TRUE;
-                Amask = 0xFF000000;
-                Rmask = 0x00FF0000;
-                Gmask = 0x0000FF00;
-                Bmask = 0x000000FF;
-                break;
-            default:
-                break;
-            }
-            break;
-        }
-        /* Fall through -- read the RGB masks */
-
-    case BI_BITFIELDS:
-        switch (biBitCount) {
-        case 15:
-        case 16:
-            Rmask = SDL_ReadLE32(src);
-            Gmask = SDL_ReadLE32(src);
-            Bmask = SDL_ReadLE32(src);
-            break;
-        case 32:
-            Rmask = SDL_ReadLE32(src);
-            Gmask = SDL_ReadLE32(src);
-            Bmask = SDL_ReadLE32(src);
-            Amask = SDL_ReadLE32(src);
-            break;
-        default:
-            break;
-        }
-        break;
-    default:
-        SDL_SetError("Compressed BMP files not supported");
-        was_error = SDL_TRUE;
-        goto done;
-    }
-
-    /* Create a compatible surface, note that the colors are RGB ordered */
-    surface =
-        SDL_CreateRGBSurface(0, biWidth, biHeight, biBitCount, Rmask, Gmask,
-                             Bmask, Amask);
-    if (surface == NULL) {
-        was_error = SDL_TRUE;
-        goto done;
-    }
-
-    /* Load the palette, if any */
-    palette = (surface->format)->palette;
-    if (palette) {
-        if (biClrUsed == 0) {
-            biClrUsed = 1 << biBitCount;
-        }
-        if ((int) biClrUsed > palette->ncolors) {
-            palette->ncolors = biClrUsed;
-            palette->colors =
-                (SDL_Color *) SDL_realloc(palette->colors,
-                                          palette->ncolors *
-                                          sizeof(*palette->colors));
-            if (!palette->colors) {
-                SDL_OutOfMemory();
-                was_error = SDL_TRUE;
-                goto done;
-            }
-        } else if ((int) biClrUsed < palette->ncolors) {
-            palette->ncolors = biClrUsed;
-        }
-        if (biSize == 12) {
-            for (i = 0; i < (int) biClrUsed; ++i) {
-                SDL_RWread(src, &palette->colors[i].b, 1, 1);
-                SDL_RWread(src, &palette->colors[i].g, 1, 1);
-                SDL_RWread(src, &palette->colors[i].r, 1, 1);
-                palette->colors[i].a = SDL_ALPHA_OPAQUE;
-            }
-        } else {
-            for (i = 0; i < (int) biClrUsed; ++i) {
-                SDL_RWread(src, &palette->colors[i].b, 1, 1);
-                SDL_RWread(src, &palette->colors[i].g, 1, 1);
-                SDL_RWread(src, &palette->colors[i].r, 1, 1);
-                SDL_RWread(src, &palette->colors[i].a, 1, 1);
-
-                /* According to Microsoft documentation, the fourth element
-                   is reserved and must be zero, so we shouldn't treat it as
-                   alpha.
-                */
-                palette->colors[i].a = SDL_ALPHA_OPAQUE;
-            }
-        }
-    }
-
-    /* Read the surface pixels.  Note that the bmp image is upside down */
-    if (SDL_RWseek(src, fp_offset + bfOffBits, RW_SEEK_SET) < 0) {
-        SDL_Error(SDL_EFSEEK);
-        was_error = SDL_TRUE;
-        goto done;
-    }
-    top = (Uint8 *)surface->pixels;
-    end = (Uint8 *)surface->pixels+(surface->h*surface->pitch);
-    switch (ExpandBMP) {
-    case 1:
-        bmpPitch = (biWidth + 7) >> 3;
-        pad = (((bmpPitch) % 4) ? (4 - ((bmpPitch) % 4)) : 0);
-        break;
-    case 4:
-        bmpPitch = (biWidth + 1) >> 1;
-        pad = (((bmpPitch) % 4) ? (4 - ((bmpPitch) % 4)) : 0);
-        break;
-    default:
-        pad = ((surface->pitch % 4) ? (4 - (surface->pitch % 4)) : 0);
-        break;
-    }
-    if (topDown) {
-        bits = top;
-    } else {
-        bits = end - surface->pitch;
-    }
-    while (bits >= top && bits < end) {
-        switch (ExpandBMP) {
-        case 1:
-        case 4:{
-                Uint8 pixel = 0;
-                int shift = (8 - ExpandBMP);
-                for (i = 0; i < surface->w; ++i) {
-                    if (i % (8 / ExpandBMP) == 0) {
-                        if (!SDL_RWread(src, &pixel, 1, 1)) {
-                            SDL_SetError("Error reading from BMP");
-                            was_error = SDL_TRUE;
-                            goto done;
-                        }
-                    }
-                    *(bits + i) = (pixel >> shift);
-                    pixel <<= ExpandBMP;
-                }
-            }
-            break;
-
-        default:
-            if (SDL_RWread(src, bits, 1, surface->pitch)
-                != surface->pitch) {
-                SDL_Error(SDL_EFREAD);
-                was_error = SDL_TRUE;
-                goto done;
-            }
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-            /* Byte-swap the pixels if needed. Note that the 24bpp
-               case has already been taken care of above. */
-            switch (biBitCount) {
-            case 15:
-            case 16:{
-                    Uint16 *pix = (Uint16 *) bits;
-                    for (i = 0; i < surface->w; i++)
-                        pix[i] = SDL_Swap16(pix[i]);
-                    break;
-                }
-
-            case 32:{
-                    Uint32 *pix = (Uint32 *) bits;
-                    for (i = 0; i < surface->w; i++)
-                        pix[i] = SDL_Swap32(pix[i]);
-                    break;
-                }
-            }
-#endif
-            break;
-        }
-        /* Skip padding bytes, ugh */
-        if (pad) {
-            Uint8 padbyte;
-            for (i = 0; i < pad; ++i) {
-                SDL_RWread(src, &padbyte, 1, 1);
-            }
-        }
-        if (topDown) {
-            bits += surface->pitch;
-        } else {
-            bits -= surface->pitch;
-        }
-    }
-    if (correctAlpha) {
-        CorrectAlphaChannel(surface);
-    }
-  done:
-    if (was_error) {
-        if (src) {
-            SDL_RWseek(src, fp_offset, RW_SEEK_SET);
-        }
-        SDL_FreeSurface(surface);
-        surface = NULL;
-    }
-    if (freesrc && src) {
-        SDL_RWclose(src);
-    }
-    return (surface);
-}
-
-int
-SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst)
-{
-    Sint64 fp_offset;
-    int i, pad;
-    SDL_Surface *surface;
-    Uint8 *bits;
-
-    /* The Win32 BMP file header (14 bytes) */
-    char magic[2] = { 'B', 'M' };
-    Uint32 bfSize;
-    Uint16 bfReserved1;
-    Uint16 bfReserved2;
-    Uint32 bfOffBits;
-
-    /* The Win32 BITMAPINFOHEADER struct (40 bytes) */
-    Uint32 biSize;
-    Sint32 biWidth;
-    Sint32 biHeight;
-    Uint16 biPlanes;
-    Uint16 biBitCount;
-    Uint32 biCompression;
-    Uint32 biSizeImage;
-    Sint32 biXPelsPerMeter;
-    Sint32 biYPelsPerMeter;
-    Uint32 biClrUsed;
-    Uint32 biClrImportant;
-
-    /* Make sure we have somewhere to save */
-    surface = NULL;
-    if (dst) {
-        SDL_bool save32bit = SDL_FALSE;
-#ifdef SAVE_32BIT_BMP
-        /* We can save alpha information in a 32-bit BMP */
-        if (saveme->map->info.flags & SDL_COPY_COLORKEY ||
-            saveme->format->Amask) {
-            save32bit = SDL_TRUE;
-        }
-#endif /* SAVE_32BIT_BMP */
-
-        if (saveme->format->palette && !save32bit) {
-            if (saveme->format->BitsPerPixel == 8) {
-                surface = saveme;
-            } else {
-                SDL_SetError("%d bpp BMP files not supported",
-                             saveme->format->BitsPerPixel);
-            }
-        } else if ((saveme->format->BitsPerPixel == 24) &&
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-                   (saveme->format->Rmask == 0x00FF0000) &&
-                   (saveme->format->Gmask == 0x0000FF00) &&
-                   (saveme->format->Bmask == 0x000000FF)
-#else
-                   (saveme->format->Rmask == 0x000000FF) &&
-                   (saveme->format->Gmask == 0x0000FF00) &&
-                   (saveme->format->Bmask == 0x00FF0000)
-#endif
-            ) {
-            surface = saveme;
-        } else {
-            SDL_PixelFormat format;
-
-            /* If the surface has a colorkey or alpha channel we'll save a
-               32-bit BMP with alpha channel, otherwise save a 24-bit BMP. */
-            if (save32bit) {
-                SDL_InitFormat(&format,
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-                               SDL_PIXELFORMAT_ARGB8888
-#else
-                               SDL_PIXELFORMAT_BGRA8888
-#endif
-                               );
-            } else {
-                SDL_InitFormat(&format, SDL_PIXELFORMAT_BGR24);
-            }
-            surface = SDL_ConvertSurface(saveme, &format, 0);
-            if (!surface) {
-                SDL_SetError("Couldn't convert image to %d bpp",
-                             format.BitsPerPixel);
-            }
-        }
-    }
-
-    if (surface && (SDL_LockSurface(surface) == 0)) {
-        const int bw = surface->w * surface->format->BytesPerPixel;
-
-        /* Set the BMP file header values */
-        bfSize = 0;             /* We'll write this when we're done */
-        bfReserved1 = 0;
-        bfReserved2 = 0;
-        bfOffBits = 0;          /* We'll write this when we're done */
-
-        /* Write the BMP file header values */
-        fp_offset = SDL_RWtell(dst);
-        SDL_ClearError();
-        SDL_RWwrite(dst, magic, 2, 1);
-        SDL_WriteLE32(dst, bfSize);
-        SDL_WriteLE16(dst, bfReserved1);
-        SDL_WriteLE16(dst, bfReserved2);
-        SDL_WriteLE32(dst, bfOffBits);
-
-        /* Set the BMP info values */
-        biSize = 40;
-        biWidth = surface->w;
-        biHeight = surface->h;
-        biPlanes = 1;
-        biBitCount = surface->format->BitsPerPixel;
-        biCompression = BI_RGB;
-        biSizeImage = surface->h * surface->pitch;
-        biXPelsPerMeter = 0;
-        biYPelsPerMeter = 0;
-        if (surface->format->palette) {
-            biClrUsed = surface->format->palette->ncolors;
-        } else {
-            biClrUsed = 0;
-        }
-        biClrImportant = 0;
-
-        /* Write the BMP info values */
-        SDL_WriteLE32(dst, biSize);
-        SDL_WriteLE32(dst, biWidth);
-        SDL_WriteLE32(dst, biHeight);
-        SDL_WriteLE16(dst, biPlanes);
-        SDL_WriteLE16(dst, biBitCount);
-        SDL_WriteLE32(dst, biCompression);
-        SDL_WriteLE32(dst, biSizeImage);
-        SDL_WriteLE32(dst, biXPelsPerMeter);
-        SDL_WriteLE32(dst, biYPelsPerMeter);
-        SDL_WriteLE32(dst, biClrUsed);
-        SDL_WriteLE32(dst, biClrImportant);
-
-        /* Write the palette (in BGR color order) */
-        if (surface->format->palette) {
-            SDL_Color *colors;
-            int ncolors;
-
-            colors = surface->format->palette->colors;
-            ncolors = surface->format->palette->ncolors;
-            for (i = 0; i < ncolors; ++i) {
-                SDL_RWwrite(dst, &colors[i].b, 1, 1);
-                SDL_RWwrite(dst, &colors[i].g, 1, 1);
-                SDL_RWwrite(dst, &colors[i].r, 1, 1);
-                SDL_RWwrite(dst, &colors[i].a, 1, 1);
-            }
-        }
-
-        /* Write the bitmap offset */
-        bfOffBits = (Uint32)(SDL_RWtell(dst) - fp_offset);
-        if (SDL_RWseek(dst, fp_offset + 10, RW_SEEK_SET) < 0) {
-            SDL_Error(SDL_EFSEEK);
-        }
-        SDL_WriteLE32(dst, bfOffBits);
-        if (SDL_RWseek(dst, fp_offset + bfOffBits, RW_SEEK_SET) < 0) {
-            SDL_Error(SDL_EFSEEK);
-        }
-
-        /* Write the bitmap image upside down */
-        bits = (Uint8 *) surface->pixels + (surface->h * surface->pitch);
-        pad = ((bw % 4) ? (4 - (bw % 4)) : 0);
-        while (bits > (Uint8 *) surface->pixels) {
-            bits -= surface->pitch;
-            if (SDL_RWwrite(dst, bits, 1, bw) != bw) {
-                SDL_Error(SDL_EFWRITE);
-                break;
-            }
-            if (pad) {
-                const Uint8 padbyte = 0;
-                for (i = 0; i < pad; ++i) {
-                    SDL_RWwrite(dst, &padbyte, 1, 1);
-                }
-            }
-        }
-
-        /* Write the BMP file size */
-        bfSize = (Uint32)(SDL_RWtell(dst) - fp_offset);
-        if (SDL_RWseek(dst, fp_offset + 2, RW_SEEK_SET) < 0) {
-            SDL_Error(SDL_EFSEEK);
-        }
-        SDL_WriteLE32(dst, bfSize);
-        if (SDL_RWseek(dst, fp_offset + bfSize, RW_SEEK_SET) < 0) {
-            SDL_Error(SDL_EFSEEK);
-        }
-
-        /* Close it up.. */
-        SDL_UnlockSurface(surface);
-        if (surface != saveme) {
-            SDL_FreeSurface(surface);
-        }
-    }
-
-    if (freedst && dst) {
-        SDL_RWclose(dst);
-    }
-    return ((SDL_strcmp(SDL_GetError(), "") == 0) ? 0 : -1);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_clipboard.c b/deps/SDL2/src/video/SDL_clipboard.c
deleted file mode 100644
index 8c0626e..0000000
--- a/deps/SDL2/src/video/SDL_clipboard.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_clipboard.h"
-#include "SDL_sysvideo.h"
-
-
-int
-SDL_SetClipboardText(const char *text)
-{
-    SDL_VideoDevice *_this = SDL_GetVideoDevice();
-
-    if (!text) {
-        text = "";
-    }
-    if (_this->SetClipboardText) {
-        return _this->SetClipboardText(_this, text);
-    } else {
-        SDL_free(_this->clipboard_text);
-        _this->clipboard_text = SDL_strdup(text);
-        return 0;
-    }
-}
-
-char *
-SDL_GetClipboardText(void)
-{
-    SDL_VideoDevice *_this = SDL_GetVideoDevice();
-
-    if (_this->GetClipboardText) {
-        return _this->GetClipboardText(_this);
-    } else {
-        const char *text = _this->clipboard_text;
-        if (!text) {
-            text = "";
-        }
-        return SDL_strdup(text);
-    }
-}
-
-SDL_bool
-SDL_HasClipboardText(void)
-{
-    SDL_VideoDevice *_this = SDL_GetVideoDevice();
-
-    if (_this->HasClipboardText) {
-        return _this->HasClipboardText(_this);
-    } else {
-        if (_this->clipboard_text && _this->clipboard_text[0] != '\0') {
-            return SDL_TRUE;
-        } else {
-            return SDL_FALSE;
-        }
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_egl.c b/deps/SDL2/src/video/SDL_egl.c
deleted file mode 100644
index ccfb92e..0000000
--- a/deps/SDL2/src/video/SDL_egl.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- *  Simple DirectMedia Layer
- *  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
- * 
- *  This software is provided 'as-is', without any express or implied
- *  warranty.  In no event will the authors be held liable for any damages
- *  arising from the use of this software.
- * 
- *  Permission is granted to anyone to use this software for any purpose,
- *  including commercial applications, and to alter it and redistribute it
- *  freely, subject to the following restrictions:
- * 
- *  1. The origin of this software must not be misrepresented; you must not
- *     claim that you wrote the original software. If you use this software
- *     in a product, an acknowledgment in the product documentation would be
- *     appreciated but is not required.
- *  2. Altered source versions must be plainly marked as such, and must not be
- *     misrepresented as being the original software.
- *  3. This notice may not be removed or altered from any source distribution.
- */
-#include "SDL_config.h"
-
-#if SDL_VIDEO_OPENGL_EGL
-
-#include "SDL_sysvideo.h"
-#include "SDL_egl.h"
-
-
-#if SDL_VIDEO_DRIVER_RPI
-/* Raspbian places the OpenGL ES/EGL binaries in a non standard path */
-#define DEFAULT_EGL "/opt/vc/lib/libEGL.so"
-#define DEFAULT_OGL_ES2 "/opt/vc/lib/libGLESv2.so"
-#define DEFAULT_OGL_ES_PVR "/opt/vc/lib/libGLES_CM.so"
-#define DEFAULT_OGL_ES "/opt/vc/lib/libGLESv1_CM.so"
-
-#elif SDL_VIDEO_DRIVER_ANDROID
-/* Android */
-#define DEFAULT_EGL "libEGL.so"
-#define DEFAULT_OGL_ES2 "libGLESv2.so"
-#define DEFAULT_OGL_ES_PVR "libGLES_CM.so"
-#define DEFAULT_OGL_ES "libGLESv1_CM.so"
-
-#else
-/* Desktop Linux */
-#define DEFAULT_EGL "libEGL.so.1"
-#define DEFAULT_OGL_ES2 "libGLESv2.so.2"
-#define DEFAULT_OGL_ES_PVR "libGLES_CM.so.1"
-#define DEFAULT_OGL_ES "libGLESv1_CM.so.1"
-#endif /* SDL_VIDEO_DRIVER_RPI */
-
-#define LOAD_FUNC(NAME) \
-*((void**)&_this->egl_data->NAME) = dlsym(dll_handle, #NAME); \
-if (!_this->egl_data->NAME) \
-{ \
-    return SDL_SetError("Could not retrieve EGL function " #NAME); \
-}
-    
-/* EGL implementation of SDL OpenGL ES support */
-
-void *
-SDL_EGL_GetProcAddress(_THIS, const char *proc)
-{
-    static char procname[1024];
-    void *handle;
-    void *retval;
-    
-    /* eglGetProcAddress is busted on Android http://code.google.com/p/android/issues/detail?id=7681 */
-#if !defined(SDL_VIDEO_DRIVER_ANDROID)
-    handle = _this->egl_data->egl_dll_handle;
-    if (_this->egl_data->eglGetProcAddress) {
-        retval = _this->egl_data->eglGetProcAddress(proc);
-        if (retval) {
-            return retval;
-        }
-    }
-#endif
-    
-    handle = _this->gl_config.dll_handle;
-    #if defined(__OpenBSD__) && !defined(__ELF__)
-    #undef dlsym(x,y);
-    #endif
-    retval = dlsym(handle, proc);
-    if (!retval && strlen(proc) <= 1022) {
-        procname[0] = '_';
-        strcpy(procname + 1, proc);
-        retval = dlsym(handle, procname);
-    }
-    return retval;
-}
-
-void
-SDL_EGL_UnloadLibrary(_THIS)
-{
-    if (_this->egl_data) {
-        if (_this->egl_data->egl_display) {
-            _this->egl_data->eglTerminate(_this->egl_data->egl_display);
-            _this->egl_data->egl_display = NULL;
-        }
-
-        if (_this->gl_config.dll_handle) {
-            dlclose(_this->gl_config.dll_handle);
-            _this->gl_config.dll_handle = NULL;
-        }
-        if (_this->egl_data->egl_dll_handle) {
-            dlclose(_this->egl_data->egl_dll_handle);
-            _this->egl_data->egl_dll_handle = NULL;
-        }
-        
-        SDL_free(_this->egl_data);
-        _this->egl_data = NULL;
-    }
-}
-
-int
-SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_display)
-{
-    void *dll_handle, *egl_dll_handle; /* The naming is counter intuitive, but hey, I just work here -- Gabriel */
-    char *path;
-    int dlopen_flags;
-    
-    if (_this->egl_data) {
-        return SDL_SetError("OpenGL ES context already created");
-    }
-
-    _this->egl_data = (struct SDL_EGL_VideoData *) SDL_calloc(1, sizeof(SDL_EGL_VideoData));
-    if (!_this->egl_data) {
-        return SDL_OutOfMemory();
-    }
-
-#ifdef RTLD_GLOBAL
-    dlopen_flags = RTLD_LAZY | RTLD_GLOBAL;
-#else
-    dlopen_flags = RTLD_LAZY;
-#endif
-
-    /* A funny thing, loading EGL.so first does not work on the Raspberry, so we load libGL* first */
-    path = getenv("SDL_VIDEO_GL_DRIVER");
-    egl_dll_handle = dlopen(path, dlopen_flags);
-    if ((path == NULL) | (egl_dll_handle == NULL)) {
-        if (_this->gl_config.major_version > 1) {
-            path = DEFAULT_OGL_ES2;
-            egl_dll_handle = dlopen(path, dlopen_flags);
-        } else {
-            path = DEFAULT_OGL_ES;
-            egl_dll_handle = dlopen(path, dlopen_flags);
-            if (egl_dll_handle == NULL) {
-                path = DEFAULT_OGL_ES_PVR;
-                egl_dll_handle = dlopen(path, dlopen_flags);
-            }
-        }
-    }
-    _this->egl_data->egl_dll_handle = egl_dll_handle;
-
-    if (egl_dll_handle == NULL) {
-        return SDL_SetError("Could not initialize OpenGL ES library: %s", dlerror());
-    }
-    
-    /* Loading libGL* in the previous step took care of loading libEGL.so, but we future proof by double checking */
-    dll_handle = dlopen(egl_path, dlopen_flags);
-    /* Catch the case where the application isn't linked with EGL */
-    if ((dlsym(dll_handle, "eglChooseConfig") == NULL) && (egl_path == NULL)) {
-        dlclose(dll_handle);
-        path = getenv("SDL_VIDEO_EGL_DRIVER");
-        if (path == NULL) {
-            path = DEFAULT_EGL;
-        }
-        dll_handle = dlopen(path, dlopen_flags);
-    }
-    _this->gl_config.dll_handle = dll_handle;
-
-    if (dll_handle == NULL) {
-        return SDL_SetError("Could not load EGL library: %s", dlerror());
-    }
-
-    /* Load new function pointers */
-    LOAD_FUNC(eglGetDisplay);
-    LOAD_FUNC(eglInitialize);
-    LOAD_FUNC(eglTerminate);
-    LOAD_FUNC(eglGetProcAddress);
-    LOAD_FUNC(eglChooseConfig);
-    LOAD_FUNC(eglGetConfigAttrib);
-    LOAD_FUNC(eglCreateContext);
-    LOAD_FUNC(eglDestroyContext);
-    LOAD_FUNC(eglCreateWindowSurface);
-    LOAD_FUNC(eglDestroySurface);
-    LOAD_FUNC(eglMakeCurrent);
-    LOAD_FUNC(eglSwapBuffers);
-    LOAD_FUNC(eglSwapInterval);
-    LOAD_FUNC(eglWaitNative);
-    LOAD_FUNC(eglWaitGL);
-    
-    _this->egl_data->egl_display = _this->egl_data->eglGetDisplay(native_display);
-    if (!_this->egl_data->egl_display) {
-        return SDL_SetError("Could not get EGL display");
-    }
-    
-    if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) {
-        return SDL_SetError("Could not initialize EGL");
-    }
-
-    _this->gl_config.dll_handle = dll_handle;
-    _this->egl_data->egl_dll_handle = egl_dll_handle;
-    _this->gl_config.driver_loaded = 1;
-
-    if (path) {
-        strncpy(_this->gl_config.driver_path, path, sizeof(_this->gl_config.driver_path) - 1);
-    } else {
-        strcpy(_this->gl_config.driver_path, "");
-    }
-    
-    /* We need to select a config here to satisfy some video backends such as X11 */
-    SDL_EGL_ChooseConfig(_this);
-    
-    return 0;
-}
-
-int
-SDL_EGL_ChooseConfig(_THIS) 
-{
-    /* 64 seems nice. */
-    EGLint attribs[64];
-    EGLint found_configs = 0;
-    int i;
-    
-    if (!_this->egl_data) {
-        /* The EGL library wasn't loaded, SDL_GetError() should have info */
-        return -1;
-    }
-  
-    /* Get a valid EGL configuration */
-    i = 0;
-    attribs[i++] = EGL_RED_SIZE;
-    attribs[i++] = _this->gl_config.red_size;
-    attribs[i++] = EGL_GREEN_SIZE;
-    attribs[i++] = _this->gl_config.green_size;
-    attribs[i++] = EGL_BLUE_SIZE;
-    attribs[i++] = _this->gl_config.blue_size;
-    
-    if (_this->gl_config.alpha_size) {
-        attribs[i++] = EGL_ALPHA_SIZE;
-        attribs[i++] = _this->gl_config.alpha_size;
-    }
-    
-    if (_this->gl_config.buffer_size) {
-        attribs[i++] = EGL_BUFFER_SIZE;
-        attribs[i++] = _this->gl_config.buffer_size;
-    }
-    
-    attribs[i++] = EGL_DEPTH_SIZE;
-    attribs[i++] = _this->gl_config.depth_size;
-    
-    if (_this->gl_config.stencil_size) {
-        attribs[i++] = EGL_STENCIL_SIZE;
-        attribs[i++] = _this->gl_config.stencil_size;
-    }
-    
-    if (_this->gl_config.multisamplebuffers) {
-        attribs[i++] = EGL_SAMPLE_BUFFERS;
-        attribs[i++] = _this->gl_config.multisamplebuffers;
-    }
-    
-    if (_this->gl_config.multisamplesamples) {
-        attribs[i++] = EGL_SAMPLES;
-        attribs[i++] = _this->gl_config.multisamplesamples;
-    }
-    
-    attribs[i++] = EGL_RENDERABLE_TYPE;
-    if (_this->gl_config.major_version == 2) {
-        attribs[i++] = EGL_OPENGL_ES2_BIT;
-    } else {
-        attribs[i++] = EGL_OPENGL_ES_BIT;
-    }
-    
-    attribs[i++] = EGL_NONE;
-    
-    if (_this->egl_data->eglChooseConfig(_this->egl_data->egl_display,
-        attribs,
-        &_this->egl_data->egl_config, 1,
-        &found_configs) == EGL_FALSE ||
-        found_configs == 0) {
-        return SDL_SetError("Couldn't find matching EGL config");
-    }
-    
-    return 0;
-}
-
-SDL_GLContext
-SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
-{
-    EGLint context_attrib_list[] = {
-        EGL_CONTEXT_CLIENT_VERSION,
-        1,
-        EGL_NONE
-    };
-    
-    EGLContext egl_context;
-    
-    if (!_this->egl_data) {
-        /* The EGL library wasn't loaded, SDL_GetError() should have info */
-        return NULL;
-    }
-    
-    if (_this->gl_config.major_version) {
-        context_attrib_list[1] = _this->gl_config.major_version;
-    }
-
-    egl_context =
-    _this->egl_data->eglCreateContext(_this->egl_data->egl_display,
-                                      _this->egl_data->egl_config,
-                                      EGL_NO_CONTEXT, context_attrib_list);
-    
-    if (egl_context == EGL_NO_CONTEXT) {
-        SDL_SetError("Could not create EGL context");
-        return NULL;
-    }
-    
-    _this->egl_data->egl_swapinterval = 0;
-    
-    if (SDL_EGL_MakeCurrent(_this, egl_surface, egl_context) < 0) {
-        SDL_EGL_DeleteContext(_this, egl_context);
-        SDL_SetError("Could not make EGL context current");
-        return NULL;
-    }
-  
-    return (SDL_GLContext) egl_context;
-}
-
-int
-SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context)
-{
-    EGLContext egl_context = (EGLContext) context;
-
-    if (!_this->egl_data) {
-        return SDL_SetError("OpenGL not initialized");
-    }
-    
-    /* The android emulator crashes badly if you try to eglMakeCurrent 
-     * with a valid context and invalid surface, so we have to check for both here.
-     */
-    if (!egl_context || !egl_surface) {
-         _this->egl_data->eglMakeCurrent(_this->egl_data->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-    }
-    else {
-        if (!_this->egl_data->eglMakeCurrent(_this->egl_data->egl_display,
-            egl_surface, egl_surface, egl_context)) {
-            return SDL_SetError("Unable to make EGL context current");
-        }
-    }
-      
-    return 0;
-}
-
-int
-SDL_EGL_SetSwapInterval(_THIS, int interval)
-{
-    EGLBoolean status;
-    
-    if (!_this->egl_data) {
-        return SDL_SetError("EGL not initialized");
-    }
-    
-    status = _this->egl_data->eglSwapInterval(_this->egl_data->egl_display, interval);
-    if (status == EGL_TRUE) {
-        _this->egl_data->egl_swapinterval = interval;
-        return 0;
-    }
-    
-    return SDL_SetError("Unable to set the EGL swap interval");
-}
-
-int
-SDL_EGL_GetSwapInterval(_THIS)
-{
-    if (!_this->egl_data) {
-        return SDL_SetError("EGL not initialized");
-    }
-    
-    return _this->egl_data->egl_swapinterval;
-}
-
-void
-SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface)
-{
-    _this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, egl_surface);
-}
-
-void
-SDL_EGL_DeleteContext(_THIS, SDL_GLContext context)
-{
-    EGLContext egl_context = (EGLContext) context;
-
-    /* Clean up GLES and EGL */
-    if (!_this->egl_data) {
-        return;
-    }
-    
-    if (!egl_context && egl_context != EGL_NO_CONTEXT) {
-        SDL_EGL_MakeCurrent(_this, NULL, NULL);
-        _this->egl_data->eglDestroyContext(_this->egl_data->egl_display, egl_context);
-    }
-        
-    /* FIXME: This "crappy fix" comes from the X11 code, 
-     * it's required so you can create a GLX context, destroy it and create a EGL one */
-    SDL_EGL_UnloadLibrary(_this);
-}
-
-EGLSurface *
-SDL_EGL_CreateSurface(_THIS, NativeWindowType nw) 
-{
-    return _this->egl_data->eglCreateWindowSurface(
-            _this->egl_data->egl_display,
-            _this->egl_data->egl_config,
-            nw, NULL);
-}
-
-void
-SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface) 
-{
-    if (!_this->egl_data) {
-        return;
-    }
-    
-    if (egl_surface != EGL_NO_SURFACE) {
-        _this->egl_data->eglDestroySurface(_this->egl_data->egl_display, egl_surface);
-    }
-}
-
-#endif /* SDL_VIDEO_OPENGL_EGL */
-
-/* vi: set ts=4 sw=4 expandtab: */
-    
diff --git a/deps/SDL2/src/video/SDL_egl.h b/deps/SDL2/src/video/SDL_egl.h
deleted file mode 100644
index d613905..0000000
--- a/deps/SDL2/src/video/SDL_egl.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_egl_h
-#define _SDL_egl_h
-
-#if SDL_VIDEO_OPENGL_EGL
-
-#include <EGL/egl.h>
-
-#include <dlfcn.h>
-#if defined(__OpenBSD__) && !defined(__ELF__)
-#define dlsym(x,y) dlsym(x, "_" y)
-#endif
-
-#include "SDL_sysvideo.h"
-
-typedef struct SDL_EGL_VideoData
-{
-    void *egl_dll_handle;
-    EGLDisplay egl_display;
-    EGLConfig egl_config;
-    int egl_swapinterval;
-    
-    EGLDisplay(*eglGetDisplay) (NativeDisplayType display);
-    EGLBoolean(*eglInitialize) (EGLDisplay dpy, EGLint * major,
-                                EGLint * minor);
-    EGLBoolean(*eglTerminate) (EGLDisplay dpy);
-    
-    void *(*eglGetProcAddress) (const char * procName);
-    
-    EGLBoolean(*eglChooseConfig) (EGLDisplay dpy,
-                                  const EGLint * attrib_list,
-                                  EGLConfig * configs,
-                                  EGLint config_size, EGLint * num_config);
-    
-    EGLContext(*eglCreateContext) (EGLDisplay dpy,
-                                   EGLConfig config,
-                                   EGLContext share_list,
-                                   const EGLint * attrib_list);
-    
-    EGLBoolean(*eglDestroyContext) (EGLDisplay dpy, EGLContext ctx);
-    
-    EGLSurface(*eglCreateWindowSurface) (EGLDisplay dpy,
-                                         EGLConfig config,
-                                         NativeWindowType window,
-                                         const EGLint * attrib_list);
-    EGLBoolean(*eglDestroySurface) (EGLDisplay dpy, EGLSurface surface);
-    
-    EGLBoolean(*eglMakeCurrent) (EGLDisplay dpy, EGLSurface draw,
-                                 EGLSurface read, EGLContext ctx);
-    
-    EGLBoolean(*eglSwapBuffers) (EGLDisplay dpy, EGLSurface draw);
-    
-    EGLBoolean(*eglSwapInterval) (EGLDisplay dpy, EGLint interval);
-    
-    const char *(*eglQueryString) (EGLDisplay dpy, EGLint name);
-    
-    EGLBoolean(*eglGetConfigAttrib) (EGLDisplay dpy, EGLConfig config,
-                                     EGLint attribute, EGLint * value);
-    
-    EGLBoolean(*eglWaitNative) (EGLint  engine);
-
-    EGLBoolean(*eglWaitGL)(void);   
-} SDL_EGL_VideoData;
-
-/* OpenGLES functions */
-extern int SDL_EGL_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
-extern int SDL_EGL_LoadLibrary(_THIS, const char *path, NativeDisplayType native_display);
-extern void *SDL_EGL_GetProcAddress(_THIS, const char *proc);
-extern void SDL_EGL_UnloadLibrary(_THIS);
-extern int SDL_EGL_ChooseConfig(_THIS);
-extern int SDL_EGL_SetSwapInterval(_THIS, int interval);
-extern int SDL_EGL_GetSwapInterval(_THIS);
-extern void SDL_EGL_DeleteContext(_THIS, SDL_GLContext context);
-extern EGLSurface *SDL_EGL_CreateSurface(_THIS, NativeWindowType nw);
-extern void SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface);
-
-/* These need to be wrapped to get the surface for the window by the platform GLES implementation */
-extern SDL_GLContext SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface);
-extern int SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context);
-extern void SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface);
-
-/* A few of useful macros */
-
-#define SDL_EGL_SwapWindow_impl(BACKEND) void \
-BACKEND ## _GLES_SwapWindow(_THIS, SDL_Window * window) \
-{\
-    SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);\
-}
-
-#define SDL_EGL_MakeCurrent_impl(BACKEND) int \
-BACKEND ## _GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) \
-{\
-    if (window && context) { \
-        return SDL_EGL_MakeCurrent(_this, ((SDL_WindowData *) window->driverdata)->egl_surface, context); \
-    }\
-    else {\
-        return SDL_EGL_MakeCurrent(_this, NULL, NULL);\
-    }\
-}
-
-#define SDL_EGL_CreateContext_impl(BACKEND) SDL_GLContext \
-BACKEND ## _GLES_CreateContext(_THIS, SDL_Window * window) \
-{\
-    return SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);\
-}
-
-#endif /* SDL_VIDEO_OPENGL_EGL */
-
-#endif /* _SDL_egl_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_fillrect.c b/deps/SDL2/src/video/SDL_fillrect.c
deleted file mode 100644
index d891e4e..0000000
--- a/deps/SDL2/src/video/SDL_fillrect.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-
-
-#ifdef __SSE__
-/* *INDENT-OFF* */
-
-#ifdef _MSC_VER
-#define SSE_BEGIN \
-    __m128 c128; \
-    c128.m128_u32[0] = color; \
-    c128.m128_u32[1] = color; \
-    c128.m128_u32[2] = color; \
-    c128.m128_u32[3] = color;
-#else
-#define SSE_BEGIN \
-    __m128 c128; \
-    DECLARE_ALIGNED(Uint32, cccc[4], 16); \
-    cccc[0] = color; \
-    cccc[1] = color; \
-    cccc[2] = color; \
-    cccc[3] = color; \
-    c128 = *(__m128 *)cccc;
-#endif
-
-#define SSE_WORK \
-    for (i = n / 64; i--;) { \
-        _mm_stream_ps((float *)(p+0), c128); \
-        _mm_stream_ps((float *)(p+16), c128); \
-        _mm_stream_ps((float *)(p+32), c128); \
-        _mm_stream_ps((float *)(p+48), c128); \
-        p += 64; \
-    }
-
-#define SSE_END
-
-#define DEFINE_SSE_FILLRECT(bpp, type) \
-static void \
-SDL_FillRect##bpp##SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \
-{ \
-    int i, n; \
-    Uint8 *p = NULL; \
- \
-    SSE_BEGIN; \
- \
-    while (h--) { \
-        n = w * bpp; \
-        p = pixels; \
- \
-        if (n > 63) { \
-            int adjust = 16 - ((uintptr_t)p & 15); \
-            if (adjust < 16) { \
-                n -= adjust; \
-                adjust /= bpp; \
-                while (adjust--) { \
-                    *((type *)p) = (type)color; \
-                    p += bpp; \
-                } \
-            } \
-            SSE_WORK; \
-        } \
-        if (n & 63) { \
-            int remainder = (n & 63); \
-            remainder /= bpp; \
-            while (remainder--) { \
-                *((type *)p) = (type)color; \
-                p += bpp; \
-            } \
-        } \
-        pixels += pitch; \
-    } \
- \
-    SSE_END; \
-}
-
-static void
-SDL_FillRect1SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
-{
-    int i, n;
-    Uint8 *p = NULL;
-    
-    SSE_BEGIN;
-    while (h--) {
-        n = w;
-        p = pixels;
-
-        if (n > 63) {
-            int adjust = 16 - ((uintptr_t)p & 15);
-            if (adjust) {
-                n -= adjust;
-                SDL_memset(p, color, adjust);
-                p += adjust;
-            }
-            SSE_WORK;
-        }
-        if (n & 63) {
-            int remainder = (n & 63);
-            SDL_memset(p, color, remainder);
-            p += remainder;
-        }
-        pixels += pitch;
-    }
-
-    SSE_END;
-}
-/* DEFINE_SSE_FILLRECT(1, Uint8) */
-DEFINE_SSE_FILLRECT(2, Uint16)
-DEFINE_SSE_FILLRECT(4, Uint32)
-
-/* *INDENT-ON* */
-#endif /* __SSE__ */
-
-#ifdef __MMX__
-/* *INDENT-OFF* */
-
-#define MMX_BEGIN \
-    __m64 c64 = _mm_set_pi32(color, color)
-
-#define MMX_WORK \
-    for (i = n / 64; i--;) { \
-        _mm_stream_pi((__m64 *)(p+0), c64); \
-        _mm_stream_pi((__m64 *)(p+8), c64); \
-        _mm_stream_pi((__m64 *)(p+16), c64); \
-        _mm_stream_pi((__m64 *)(p+24), c64); \
-        _mm_stream_pi((__m64 *)(p+32), c64); \
-        _mm_stream_pi((__m64 *)(p+40), c64); \
-        _mm_stream_pi((__m64 *)(p+48), c64); \
-        _mm_stream_pi((__m64 *)(p+56), c64); \
-        p += 64; \
-    }
-
-#define MMX_END \
-    _mm_empty()
-
-#define DEFINE_MMX_FILLRECT(bpp, type) \
-static void \
-SDL_FillRect##bpp##MMX(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \
-{ \
-    int i, n; \
-    Uint8 *p = NULL; \
- \
-    MMX_BEGIN; \
- \
-    while (h--) { \
-        n = w * bpp; \
-        p = pixels; \
- \
-        if (n > 63) { \
-            int adjust = 8 - ((uintptr_t)p & 7); \
-            if (adjust < 8) { \
-                n -= adjust; \
-                adjust /= bpp; \
-                while (adjust--) { \
-                    *((type *)p) = (type)color; \
-                    p += bpp; \
-                } \
-            } \
-            MMX_WORK; \
-        } \
-        if (n & 63) { \
-            int remainder = (n & 63); \
-            remainder /= bpp; \
-            while (remainder--) { \
-                *((type *)p) = (type)color; \
-                p += bpp; \
-            } \
-        } \
-        pixels += pitch; \
-    } \
- \
-    MMX_END; \
-}
-
-static void
-SDL_FillRect1MMX(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
-{
-    int i, n;
-    Uint8 *p = NULL;
-    
-    MMX_BEGIN;
-
-    while (h--) {
-        n = w;
-        p = pixels;
-
-        if (n > 63) {
-            int adjust = 8 - ((uintptr_t)p & 7);
-            if (adjust) {
-                n -= adjust;
-                SDL_memset(p, color, adjust);
-                p += adjust;
-            }
-            MMX_WORK;
-        }
-        if (n & 63) {
-            int remainder = (n & 63);
-            SDL_memset(p, color, remainder);
-            p += remainder;
-        }
-        pixels += pitch;
-    }
-
-    MMX_END;
-}
-/* DEFINE_MMX_FILLRECT(1, Uint8) */
-DEFINE_MMX_FILLRECT(2, Uint16)
-DEFINE_MMX_FILLRECT(4, Uint32)
-
-/* *INDENT-ON* */
-#endif /* __MMX__ */
-
-static void
-SDL_FillRect1(Uint8 * pixels, int pitch, Uint32 color, int w, int h)
-{
-    int n;
-    Uint8 *p = NULL;
-    
-    while (h--) {
-        n = w;
-        p = pixels;
-
-        if (n > 3) {
-            switch ((uintptr_t) p & 3) {
-            case 1:
-                *p++ = (Uint8) color;
-                --n;
-            case 2:
-                *p++ = (Uint8) color;
-                --n;
-            case 3:
-                *p++ = (Uint8) color;
-                --n;
-            }
-            SDL_memset4(p, color, (n >> 2));
-        }
-        if (n & 3) {
-            p += (n & ~3);
-            switch (n & 3) {
-            case 3:
-                *p++ = (Uint8) color;
-            case 2:
-                *p++ = (Uint8) color;
-            case 1:
-                *p++ = (Uint8) color;
-            }
-        }
-        pixels += pitch;
-    }
-}
-
-static void
-SDL_FillRect2(Uint8 * pixels, int pitch, Uint32 color, int w, int h)
-{
-    int n;
-    Uint16 *p = NULL;
-    
-    while (h--) {
-        n = w;
-        p = (Uint16 *) pixels;
-
-        if (n > 1) {
-            if ((uintptr_t) p & 2) {
-                *p++ = (Uint16) color;
-                --n;
-            }
-            SDL_memset4(p, color, (n >> 1));
-        }
-        if (n & 1) {
-            p[n - 1] = (Uint16) color;
-        }
-        pixels += pitch;
-    }
-}
-
-static void
-SDL_FillRect3(Uint8 * pixels, int pitch, Uint32 color, int w, int h)
-{
-    Uint8 r = (Uint8) ((color >> 16) & 0xFF);
-    Uint8 g = (Uint8) ((color >> 8) & 0xFF);
-    Uint8 b = (Uint8) (color & 0xFF);
-    int n;
-    Uint8 *p = NULL;
-
-    while (h--) {
-        n = w;
-        p = pixels;
-
-        while (n--) {
-            *p++ = r;
-            *p++ = g;
-            *p++ = b;
-        }
-        pixels += pitch;
-    }
-}
-
-static void
-SDL_FillRect4(Uint8 * pixels, int pitch, Uint32 color, int w, int h)
-{
-    while (h--) {
-        SDL_memset4(pixels, color, w);
-        pixels += pitch;
-    }
-}
-
-/* 
- * This function performs a fast fill of the given rectangle with 'color'
- */
-int
-SDL_FillRect(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color)
-{
-    SDL_Rect clipped;
-    Uint8 *pixels;
-
-    if (!dst) {
-        return SDL_SetError("Passed NULL destination surface");
-    }
-
-    /* This function doesn't work on surfaces < 8 bpp */
-    if (dst->format->BitsPerPixel < 8) {
-        return SDL_SetError("SDL_FillRect(): Unsupported surface format");
-    }
-
-    /* If 'rect' == NULL, then fill the whole surface */
-    if (rect) {
-        /* Perform clipping */
-        if (!SDL_IntersectRect(rect, &dst->clip_rect, &clipped)) {
-            return 0;
-        }
-        rect = &clipped;
-    } else {
-        rect = &dst->clip_rect;
-    }
-
-    /* Perform software fill */
-    if (!dst->pixels) {
-        return SDL_SetError("SDL_FillRect(): You must lock the surface");
-    }
-
-    pixels = (Uint8 *) dst->pixels + rect->y * dst->pitch +
-                                     rect->x * dst->format->BytesPerPixel;
-
-    switch (dst->format->BytesPerPixel) {
-    case 1:
-        {
-            color |= (color << 8);
-            color |= (color << 16);
-#ifdef __SSE__
-            if (SDL_HasSSE()) {
-                SDL_FillRect1SSE(pixels, dst->pitch, color, rect->w, rect->h);
-                break;
-            }
-#endif
-#ifdef __MMX__
-            if (SDL_HasMMX()) {
-                SDL_FillRect1MMX(pixels, dst->pitch, color, rect->w, rect->h);
-                break;
-            }
-#endif
-            SDL_FillRect1(pixels, dst->pitch, color, rect->w, rect->h);
-            break;
-        }
-
-    case 2:
-        {
-            color |= (color << 16);
-#ifdef __SSE__
-            if (SDL_HasSSE()) {
-                SDL_FillRect2SSE(pixels, dst->pitch, color, rect->w, rect->h);
-                break;
-            }
-#endif
-#ifdef __MMX__
-            if (SDL_HasMMX()) {
-                SDL_FillRect2MMX(pixels, dst->pitch, color, rect->w, rect->h);
-                break;
-            }
-#endif
-            SDL_FillRect2(pixels, dst->pitch, color, rect->w, rect->h);
-            break;
-        }
-
-    case 3:
-        /* 24-bit RGB is a slow path, at least for now. */
-        {
-            SDL_FillRect3(pixels, dst->pitch, color, rect->w, rect->h);
-            break;
-        }
-
-    case 4:
-        {
-#ifdef __SSE__
-            if (SDL_HasSSE()) {
-                SDL_FillRect4SSE(pixels, dst->pitch, color, rect->w, rect->h);
-                break;
-            }
-#endif
-#ifdef __MMX__
-            if (SDL_HasMMX()) {
-                SDL_FillRect4MMX(pixels, dst->pitch, color, rect->w, rect->h);
-                break;
-            }
-#endif
-            SDL_FillRect4(pixels, dst->pitch, color, rect->w, rect->h);
-            break;
-        }
-    }
-
-    /* We're done! */
-    return 0;
-}
-
-int
-SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count,
-              Uint32 color)
-{
-    int i;
-    int status = 0;
-
-    if (!rects) {
-        return SDL_SetError("SDL_FillRects() passed NULL rects");
-    }
-
-    for (i = 0; i < count; ++i) {
-        status += SDL_FillRect(dst, &rects[i], color);
-    }
-    return status;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_pixels.c b/deps/SDL2/src/video/SDL_pixels.c
deleted file mode 100644
index 0300155..0000000
--- a/deps/SDL2/src/video/SDL_pixels.c
+++ /dev/null
@@ -1,1127 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* General (mostly internal) pixel/color manipulation routines for SDL */
-
-#include "SDL_endian.h"
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_blit.h"
-#include "SDL_pixels_c.h"
-#include "SDL_RLEaccel_c.h"
-
-
-/* Lookup tables to expand partial bytes to the full 0..255 range */
-
-static Uint8 lookup_0[] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
-};
-
-static Uint8 lookup_1[] = {
-0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255
-};
-
-static Uint8 lookup_2[] = {
-0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255
-};
-
-static Uint8 lookup_3[] = {
-0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255
-};
-
-static Uint8 lookup_4[] = {
-0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255
-};
-
-static Uint8 lookup_5[] = {
-0, 36, 72, 109, 145, 182, 218, 255
-};
-
-static Uint8 lookup_6[] = {
-0, 85, 170, 255
-};
-
-static Uint8 lookup_7[] = {
-0, 255
-};
-
-static Uint8 lookup_8[] = {
-255
-};
-
-Uint8* SDL_expand_byte[9] = {
-    lookup_0,
-    lookup_1,
-    lookup_2,
-    lookup_3,
-    lookup_4,
-    lookup_5,
-    lookup_6,
-    lookup_7,
-    lookup_8
-};
-
-/* Helper functions */
-
-const char*
-SDL_GetPixelFormatName(Uint32 format)
-{
-    switch (format) {
-#define CASE(X) case X: return #X;
-    CASE(SDL_PIXELFORMAT_INDEX1LSB)
-    CASE(SDL_PIXELFORMAT_INDEX1MSB)
-    CASE(SDL_PIXELFORMAT_INDEX4LSB)
-    CASE(SDL_PIXELFORMAT_INDEX4MSB)
-    CASE(SDL_PIXELFORMAT_INDEX8)
-    CASE(SDL_PIXELFORMAT_RGB332)
-    CASE(SDL_PIXELFORMAT_RGB444)
-    CASE(SDL_PIXELFORMAT_RGB555)
-    CASE(SDL_PIXELFORMAT_BGR555)
-    CASE(SDL_PIXELFORMAT_ARGB4444)
-    CASE(SDL_PIXELFORMAT_RGBA4444)
-    CASE(SDL_PIXELFORMAT_ABGR4444)
-    CASE(SDL_PIXELFORMAT_BGRA4444)
-    CASE(SDL_PIXELFORMAT_ARGB1555)
-    CASE(SDL_PIXELFORMAT_RGBA5551)
-    CASE(SDL_PIXELFORMAT_ABGR1555)
-    CASE(SDL_PIXELFORMAT_BGRA5551)
-    CASE(SDL_PIXELFORMAT_RGB565)
-    CASE(SDL_PIXELFORMAT_BGR565)
-    CASE(SDL_PIXELFORMAT_RGB24)
-    CASE(SDL_PIXELFORMAT_BGR24)
-    CASE(SDL_PIXELFORMAT_RGB888)
-    CASE(SDL_PIXELFORMAT_RGBX8888)
-    CASE(SDL_PIXELFORMAT_BGR888)
-    CASE(SDL_PIXELFORMAT_BGRX8888)
-    CASE(SDL_PIXELFORMAT_ARGB8888)
-    CASE(SDL_PIXELFORMAT_RGBA8888)
-    CASE(SDL_PIXELFORMAT_ABGR8888)
-    CASE(SDL_PIXELFORMAT_BGRA8888)
-    CASE(SDL_PIXELFORMAT_ARGB2101010)
-    CASE(SDL_PIXELFORMAT_YV12)
-    CASE(SDL_PIXELFORMAT_IYUV)
-    CASE(SDL_PIXELFORMAT_YUY2)
-    CASE(SDL_PIXELFORMAT_UYVY)
-    CASE(SDL_PIXELFORMAT_YVYU)
-#undef CASE
-    default:
-        return "SDL_PIXELFORMAT_UNKNOWN";
-    }
-}
-
-SDL_bool
-SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask,
-                           Uint32 * Gmask, Uint32 * Bmask, Uint32 * Amask)
-{
-    Uint32 masks[4];
-
-    /* This function doesn't work with FourCC pixel formats */
-    if (SDL_ISPIXELFORMAT_FOURCC(format)) {
-        SDL_SetError("FOURCC pixel formats are not supported");
-        return SDL_FALSE;
-    }
-
-    /* Initialize the values here */
-    if (SDL_BYTESPERPIXEL(format) <= 2) {
-        *bpp = SDL_BITSPERPIXEL(format);
-    } else {
-        *bpp = SDL_BYTESPERPIXEL(format) * 8;
-    }
-    *Rmask = *Gmask = *Bmask = *Amask = 0;
-
-    if (format == SDL_PIXELFORMAT_RGB24) {
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-        *Rmask = 0x00FF0000;
-        *Gmask = 0x0000FF00;
-        *Bmask = 0x000000FF;
-#else
-        *Rmask = 0x000000FF;
-        *Gmask = 0x0000FF00;
-        *Bmask = 0x00FF0000;
-#endif
-        return SDL_TRUE;
-    }
-
-    if (format == SDL_PIXELFORMAT_BGR24) {
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-        *Rmask = 0x000000FF;
-        *Gmask = 0x0000FF00;
-        *Bmask = 0x00FF0000;
-#else
-        *Rmask = 0x00FF0000;
-        *Gmask = 0x0000FF00;
-        *Bmask = 0x000000FF;
-#endif
-        return SDL_TRUE;
-    }
-
-    if (SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED8 &&
-        SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED16 &&
-        SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED32) {
-        /* Not a format that uses masks */
-        return SDL_TRUE;
-    }
-
-    switch (SDL_PIXELLAYOUT(format)) {
-    case SDL_PACKEDLAYOUT_332:
-        masks[0] = 0x00000000;
-        masks[1] = 0x000000E0;
-        masks[2] = 0x0000001C;
-        masks[3] = 0x00000003;
-        break;
-    case SDL_PACKEDLAYOUT_4444:
-        masks[0] = 0x0000F000;
-        masks[1] = 0x00000F00;
-        masks[2] = 0x000000F0;
-        masks[3] = 0x0000000F;
-        break;
-    case SDL_PACKEDLAYOUT_1555:
-        masks[0] = 0x00008000;
-        masks[1] = 0x00007C00;
-        masks[2] = 0x000003E0;
-        masks[3] = 0x0000001F;
-        break;
-    case SDL_PACKEDLAYOUT_5551:
-        masks[0] = 0x0000F800;
-        masks[1] = 0x000007C0;
-        masks[2] = 0x0000003E;
-        masks[3] = 0x00000001;
-        break;
-    case SDL_PACKEDLAYOUT_565:
-        masks[0] = 0x00000000;
-        masks[1] = 0x0000F800;
-        masks[2] = 0x000007E0;
-        masks[3] = 0x0000001F;
-        break;
-    case SDL_PACKEDLAYOUT_8888:
-        masks[0] = 0xFF000000;
-        masks[1] = 0x00FF0000;
-        masks[2] = 0x0000FF00;
-        masks[3] = 0x000000FF;
-        break;
-    case SDL_PACKEDLAYOUT_2101010:
-        masks[0] = 0xC0000000;
-        masks[1] = 0x3FF00000;
-        masks[2] = 0x000FFC00;
-        masks[3] = 0x000003FF;
-        break;
-    case SDL_PACKEDLAYOUT_1010102:
-        masks[0] = 0xFFC00000;
-        masks[1] = 0x003FF000;
-        masks[2] = 0x00000FFC;
-        masks[3] = 0x00000003;
-        break;
-    default:
-        SDL_SetError("Unknown pixel format");
-        return SDL_FALSE;
-    }
-
-    switch (SDL_PIXELORDER(format)) {
-    case SDL_PACKEDORDER_XRGB:
-        *Rmask = masks[1];
-        *Gmask = masks[2];
-        *Bmask = masks[3];
-        break;
-    case SDL_PACKEDORDER_RGBX:
-        *Rmask = masks[0];
-        *Gmask = masks[1];
-        *Bmask = masks[2];
-        break;
-    case SDL_PACKEDORDER_ARGB:
-        *Amask = masks[0];
-        *Rmask = masks[1];
-        *Gmask = masks[2];
-        *Bmask = masks[3];
-        break;
-    case SDL_PACKEDORDER_RGBA:
-        *Rmask = masks[0];
-        *Gmask = masks[1];
-        *Bmask = masks[2];
-        *Amask = masks[3];
-        break;
-    case SDL_PACKEDORDER_XBGR:
-        *Bmask = masks[1];
-        *Gmask = masks[2];
-        *Rmask = masks[3];
-        break;
-    case SDL_PACKEDORDER_BGRX:
-        *Bmask = masks[0];
-        *Gmask = masks[1];
-        *Rmask = masks[2];
-        break;
-    case SDL_PACKEDORDER_BGRA:
-        *Bmask = masks[0];
-        *Gmask = masks[1];
-        *Rmask = masks[2];
-        *Amask = masks[3];
-        break;
-    case SDL_PACKEDORDER_ABGR:
-        *Amask = masks[0];
-        *Bmask = masks[1];
-        *Gmask = masks[2];
-        *Rmask = masks[3];
-        break;
-    default:
-        SDL_SetError("Unknown pixel format");
-        return SDL_FALSE;
-    }
-    return SDL_TRUE;
-}
-
-Uint32
-SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
-                           Uint32 Amask)
-{
-    switch (bpp) {
-    case 1:
-        /* SDL defaults to MSB ordering */
-        return SDL_PIXELFORMAT_INDEX1MSB;
-    case 4:
-        /* SDL defaults to MSB ordering */
-        return SDL_PIXELFORMAT_INDEX4MSB;
-    case 8:
-        if (Rmask == 0) {
-            return SDL_PIXELFORMAT_INDEX8;
-        }
-        if (Rmask == 0xE0 &&
-            Gmask == 0x1C &&
-            Bmask == 0x03 &&
-            Amask == 0x00) {
-            return SDL_PIXELFORMAT_RGB332;
-        }
-        break;
-    case 12:
-        if (Rmask == 0) {
-            return SDL_PIXELFORMAT_RGB444;
-        }
-        if (Rmask == 0x0F00 &&
-            Gmask == 0x00F0 &&
-            Bmask == 0x000F &&
-            Amask == 0x0000) {
-            return SDL_PIXELFORMAT_RGB444;
-        }
-        break;
-    case 15:
-        if (Rmask == 0) {
-            return SDL_PIXELFORMAT_RGB555;
-        }
-        /* Fall through to 16-bit checks */
-    case 16:
-        if (Rmask == 0) {
-            return SDL_PIXELFORMAT_RGB565;
-        }
-        if (Rmask == 0x7C00 &&
-            Gmask == 0x03E0 &&
-            Bmask == 0x001F &&
-            Amask == 0x0000) {
-            return SDL_PIXELFORMAT_RGB555;
-        }
-        if (Rmask == 0x001F &&
-            Gmask == 0x03E0 &&
-            Bmask == 0x7C00 &&
-            Amask == 0x0000) {
-            return SDL_PIXELFORMAT_BGR555;
-        }
-        if (Rmask == 0x0F00 &&
-            Gmask == 0x00F0 &&
-            Bmask == 0x000F &&
-            Amask == 0xF000) {
-            return SDL_PIXELFORMAT_ARGB4444;
-        }
-        if (Rmask == 0xF000 &&
-            Gmask == 0x0F00 &&
-            Bmask == 0x00F0 &&
-            Amask == 0x000F) {
-            return SDL_PIXELFORMAT_RGBA4444;
-        }
-        if (Rmask == 0x000F &&
-            Gmask == 0x00F0 &&
-            Bmask == 0x0F00 &&
-            Amask == 0xF000) {
-            return SDL_PIXELFORMAT_ABGR4444;
-        }
-        if (Rmask == 0x00F0 &&
-            Gmask == 0x0F00 &&
-            Bmask == 0xF000 &&
-            Amask == 0x000F) {
-            return SDL_PIXELFORMAT_BGRA4444;
-        }
-        if (Rmask == 0x7C00 &&
-            Gmask == 0x03E0 &&
-            Bmask == 0x001F &&
-            Amask == 0x8000) {
-            return SDL_PIXELFORMAT_ARGB1555;
-        }
-        if (Rmask == 0xF800 &&
-            Gmask == 0x07C0 &&
-            Bmask == 0x003E &&
-            Amask == 0x0001) {
-            return SDL_PIXELFORMAT_RGBA5551;
-        }
-        if (Rmask == 0x001F &&
-            Gmask == 0x03E0 &&
-            Bmask == 0x7C00 &&
-            Amask == 0x8000) {
-            return SDL_PIXELFORMAT_ABGR1555;
-        }
-        if (Rmask == 0x003E &&
-            Gmask == 0x07C0 &&
-            Bmask == 0xF800 &&
-            Amask == 0x0001) {
-            return SDL_PIXELFORMAT_BGRA5551;
-        }
-        if (Rmask == 0xF800 &&
-            Gmask == 0x07E0 &&
-            Bmask == 0x001F &&
-            Amask == 0x0000) {
-            return SDL_PIXELFORMAT_RGB565;
-        }
-        if (Rmask == 0x001F &&
-            Gmask == 0x07E0 &&
-            Bmask == 0xF800 &&
-            Amask == 0x0000) {
-            return SDL_PIXELFORMAT_BGR565;
-        }
-        break;
-    case 24:
-        switch (Rmask) {
-        case 0:
-        case 0x00FF0000:
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-            return SDL_PIXELFORMAT_RGB24;
-#else
-            return SDL_PIXELFORMAT_BGR24;
-#endif
-        case 0x000000FF:
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-            return SDL_PIXELFORMAT_BGR24;
-#else
-            return SDL_PIXELFORMAT_RGB24;
-#endif
-        }
-    case 32:
-        if (Rmask == 0) {
-            return SDL_PIXELFORMAT_RGB888;
-        }
-        if (Rmask == 0x00FF0000 &&
-            Gmask == 0x0000FF00 &&
-            Bmask == 0x000000FF &&
-            Amask == 0x00000000) {
-            return SDL_PIXELFORMAT_RGB888;
-        }
-        if (Rmask == 0xFF000000 &&
-            Gmask == 0x00FF0000 &&
-            Bmask == 0x0000FF00 &&
-            Amask == 0x00000000) {
-            return SDL_PIXELFORMAT_RGBX8888;
-        }
-        if (Rmask == 0x000000FF &&
-            Gmask == 0x0000FF00 &&
-            Bmask == 0x00FF0000 &&
-            Amask == 0x00000000) {
-            return SDL_PIXELFORMAT_BGR888;
-        }
-        if (Rmask == 0x0000FF00 &&
-            Gmask == 0x00FF0000 &&
-            Bmask == 0xFF000000 &&
-            Amask == 0x00000000) {
-            return SDL_PIXELFORMAT_BGRX8888;
-        }
-        if (Rmask == 0x00FF0000 &&
-            Gmask == 0x0000FF00 &&
-            Bmask == 0x000000FF &&
-            Amask == 0xFF000000) {
-            return SDL_PIXELFORMAT_ARGB8888;
-        }
-        if (Rmask == 0xFF000000 &&
-            Gmask == 0x00FF0000 &&
-            Bmask == 0x0000FF00 &&
-            Amask == 0x000000FF) {
-            return SDL_PIXELFORMAT_RGBA8888;
-        }
-        if (Rmask == 0x000000FF &&
-            Gmask == 0x0000FF00 &&
-            Bmask == 0x00FF0000 &&
-            Amask == 0xFF000000) {
-            return SDL_PIXELFORMAT_ABGR8888;
-        }
-        if (Rmask == 0x0000FF00 &&
-            Gmask == 0x00FF0000 &&
-            Bmask == 0xFF000000 &&
-            Amask == 0x000000FF) {
-            return SDL_PIXELFORMAT_BGRA8888;
-        }
-        if (Rmask == 0x3FF00000 &&
-            Gmask == 0x000FFC00 &&
-            Bmask == 0x000003FF &&
-            Amask == 0xC0000000) {
-            return SDL_PIXELFORMAT_ARGB2101010;
-        }
-    }
-    return SDL_PIXELFORMAT_UNKNOWN;
-}
-
-static SDL_PixelFormat *formats;
-
-SDL_PixelFormat *
-SDL_AllocFormat(Uint32 pixel_format)
-{
-    SDL_PixelFormat *format;
-
-    /* Look it up in our list of previously allocated formats */
-    for (format = formats; format; format = format->next) {
-        if (pixel_format == format->format) {
-            ++format->refcount;
-            return format;
-        }
-    }
-
-    /* Allocate an empty pixel format structure, and initialize it */
-    format = SDL_malloc(sizeof(*format));
-    if (format == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    if (SDL_InitFormat(format, pixel_format) < 0) {
-        SDL_free(format);
-        SDL_InvalidParamError("format");
-        return NULL;
-    }
-
-    if (!SDL_ISPIXELFORMAT_INDEXED(pixel_format)) {
-        /* Cache the RGB formats */
-        format->next = formats;
-        formats = format;
-    }
-    return format;
-}
-
-int
-SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format)
-{
-    int bpp;
-    Uint32 Rmask, Gmask, Bmask, Amask;
-    Uint32 mask;
-
-    if (!SDL_PixelFormatEnumToMasks(pixel_format, &bpp,
-                                    &Rmask, &Gmask, &Bmask, &Amask)) {
-        return -1;
-    }
-
-    /* Set up the format */
-    SDL_zerop(format);
-    format->format = pixel_format;
-    format->BitsPerPixel = bpp;
-    format->BytesPerPixel = (bpp + 7) / 8;
-
-    format->Rmask = Rmask;
-    format->Rshift = 0;
-    format->Rloss = 8;
-    if (Rmask) {
-        for (mask = Rmask; !(mask & 0x01); mask >>= 1)
-            ++format->Rshift;
-        for (; (mask & 0x01); mask >>= 1)
-            --format->Rloss;
-    }
-
-    format->Gmask = Gmask;
-    format->Gshift = 0;
-    format->Gloss = 8;
-    if (Gmask) {
-        for (mask = Gmask; !(mask & 0x01); mask >>= 1)
-            ++format->Gshift;
-        for (; (mask & 0x01); mask >>= 1)
-            --format->Gloss;
-    }
-
-    format->Bmask = Bmask;
-    format->Bshift = 0;
-    format->Bloss = 8;
-    if (Bmask) {
-        for (mask = Bmask; !(mask & 0x01); mask >>= 1)
-            ++format->Bshift;
-        for (; (mask & 0x01); mask >>= 1)
-            --format->Bloss;
-    }
-
-    format->Amask = Amask;
-    format->Ashift = 0;
-    format->Aloss = 8;
-    if (Amask) {
-        for (mask = Amask; !(mask & 0x01); mask >>= 1)
-            ++format->Ashift;
-        for (; (mask & 0x01); mask >>= 1)
-            --format->Aloss;
-    }
-
-    format->palette = NULL;
-    format->refcount = 1;
-    format->next = NULL;
-
-    return 0;
-}
-
-void
-SDL_FreeFormat(SDL_PixelFormat *format)
-{
-    SDL_PixelFormat *prev;
-
-    if (!format) {
-        SDL_InvalidParamError("format");
-        return;
-    }
-    if (--format->refcount > 0) {
-        return;
-    }
-
-    /* Remove this format from our list */
-    if (format == formats) {
-        formats = format->next;
-    } else if (formats) {
-        for (prev = formats; prev->next; prev = prev->next) {
-            if (prev->next == format) {
-                prev->next = format->next;
-                break;
-            }
-        }
-    }
-
-    if (format->palette) {
-        SDL_FreePalette(format->palette);
-    }
-    SDL_free(format);
-}
-
-SDL_Palette *
-SDL_AllocPalette(int ncolors)
-{
-    SDL_Palette *palette;
-
-    /* Input validation */
-    if (ncolors < 1) {
-      SDL_InvalidParamError("ncolors");
-      return NULL;
-    }
-
-    palette = (SDL_Palette *) SDL_malloc(sizeof(*palette));
-    if (!palette) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    palette->colors =
-        (SDL_Color *) SDL_malloc(ncolors * sizeof(*palette->colors));
-    if (!palette->colors) {
-        SDL_free(palette);
-        return NULL;
-    }
-    palette->ncolors = ncolors;
-    palette->version = 1;
-    palette->refcount = 1;
-
-    SDL_memset(palette->colors, 0xFF, ncolors * sizeof(*palette->colors));
-
-    return palette;
-}
-
-int
-SDL_SetPixelFormatPalette(SDL_PixelFormat * format, SDL_Palette *palette)
-{
-    if (!format) {
-        return SDL_SetError("SDL_SetPixelFormatPalette() passed NULL format");
-    }
-
-    if (palette && palette->ncolors != (1 << format->BitsPerPixel)) {
-        return SDL_SetError("SDL_SetPixelFormatPalette() passed a palette that doesn't match the format");
-    }
-
-    if (format->palette == palette) {
-        return 0;
-    }
-
-    if (format->palette) {
-        SDL_FreePalette(format->palette);
-    }
-
-    format->palette = palette;
-
-    if (format->palette) {
-        ++format->palette->refcount;
-    }
-
-    return 0;
-}
-
-int
-SDL_SetPaletteColors(SDL_Palette * palette, const SDL_Color * colors,
-                     int firstcolor, int ncolors)
-{
-    int status = 0;
-
-    /* Verify the parameters */
-    if (!palette) {
-        return -1;
-    }
-    if (ncolors > (palette->ncolors - firstcolor)) {
-        ncolors = (palette->ncolors - firstcolor);
-        status = -1;
-    }
-
-    if (colors != (palette->colors + firstcolor)) {
-        SDL_memcpy(palette->colors + firstcolor, colors,
-                   ncolors * sizeof(*colors));
-    }
-    ++palette->version;
-    if (!palette->version) {
-        palette->version = 1;
-    }
-
-    return status;
-}
-
-void
-SDL_FreePalette(SDL_Palette * palette)
-{
-    if (!palette) {
-        SDL_InvalidParamError("palette");
-        return;
-    }
-    if (--palette->refcount > 0) {
-        return;
-    }
-    SDL_free(palette->colors);
-    SDL_free(palette);
-}
-
-/*
- * Calculate an 8-bit (3 red, 3 green, 2 blue) dithered palette of colors
- */
-void
-SDL_DitherColors(SDL_Color * colors, int bpp)
-{
-    int i;
-    if (bpp != 8)
-        return;                 /* only 8bpp supported right now */
-
-    for (i = 0; i < 256; i++) {
-        int r, g, b;
-        /* map each bit field to the full [0, 255] interval,
-           so 0 is mapped to (0, 0, 0) and 255 to (255, 255, 255) */
-        r = i & 0xe0;
-        r |= r >> 3 | r >> 6;
-        colors[i].r = r;
-        g = (i << 3) & 0xe0;
-        g |= g >> 3 | g >> 6;
-        colors[i].g = g;
-        b = i & 0x3;
-        b |= b << 2;
-        b |= b << 4;
-        colors[i].b = b;
-        colors[i].a = SDL_ALPHA_OPAQUE;
-    }
-}
-
-/*
- * Calculate the pad-aligned scanline width of a surface
- */
-int
-SDL_CalculatePitch(SDL_Surface * surface)
-{
-    int pitch;
-
-    /* Surface should be 4-byte aligned for speed */
-    pitch = surface->w * surface->format->BytesPerPixel;
-    switch (surface->format->BitsPerPixel) {
-    case 1:
-        pitch = (pitch + 7) / 8;
-        break;
-    case 4:
-        pitch = (pitch + 1) / 2;
-        break;
-    default:
-        break;
-    }
-    pitch = (pitch + 3) & ~3;   /* 4-byte aligning */
-    return (pitch);
-}
-
-/*
- * Match an RGB value to a particular palette index
- */
-Uint8
-SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-{
-    /* Do colorspace distance matching */
-    unsigned int smallest;
-    unsigned int distance;
-    int rd, gd, bd, ad;
-    int i;
-    Uint8 pixel = 0;
-
-    smallest = ~0;
-    for (i = 0; i < pal->ncolors; ++i) {
-        rd = pal->colors[i].r - r;
-        gd = pal->colors[i].g - g;
-        bd = pal->colors[i].b - b;
-        ad = pal->colors[i].a - a;
-        distance = (rd * rd) + (gd * gd) + (bd * bd) + (ad * ad);
-        if (distance < smallest) {
-            pixel = i;
-            if (distance == 0) {        /* Perfect match! */
-                break;
-            }
-            smallest = distance;
-        }
-    }
-    return (pixel);
-}
-
-/* Find the opaque pixel value corresponding to an RGB triple */
-Uint32
-SDL_MapRGB(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b)
-{
-    if (format->palette == NULL) {
-        return (r >> format->Rloss) << format->Rshift
-            | (g >> format->Gloss) << format->Gshift
-            | (b >> format->Bloss) << format->Bshift | format->Amask;
-    } else {
-        return SDL_FindColor(format->palette, r, g, b, SDL_ALPHA_OPAQUE);
-    }
-}
-
-/* Find the pixel value corresponding to an RGBA quadruple */
-Uint32
-SDL_MapRGBA(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b,
-            Uint8 a)
-{
-    if (format->palette == NULL) {
-        return (r >> format->Rloss) << format->Rshift
-            | (g >> format->Gloss) << format->Gshift
-            | (b >> format->Bloss) << format->Bshift
-            | ((a >> format->Aloss) << format->Ashift & format->Amask);
-    } else {
-        return SDL_FindColor(format->palette, r, g, b, a);
-    }
-}
-
-void
-SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * format, Uint8 * r, Uint8 * g,
-           Uint8 * b)
-{
-    if (format->palette == NULL) {
-        unsigned v;
-        v = (pixel & format->Rmask) >> format->Rshift;
-        *r = SDL_expand_byte[format->Rloss][v];
-        v = (pixel & format->Gmask) >> format->Gshift;
-        *g = SDL_expand_byte[format->Gloss][v];
-        v = (pixel & format->Bmask) >> format->Bshift;
-        *b = SDL_expand_byte[format->Bloss][v];
-    } else {
-        if (pixel < (unsigned)format->palette->ncolors) {
-            *r = format->palette->colors[pixel].r;
-            *g = format->palette->colors[pixel].g;
-            *b = format->palette->colors[pixel].b;
-        } else {
-            *r = *g = *b = 0;
-        }
-    }
-}
-
-void
-SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format,
-            Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a)
-{
-    if (format->palette == NULL) {
-        unsigned v;
-        v = (pixel & format->Rmask) >> format->Rshift;
-        *r = SDL_expand_byte[format->Rloss][v];
-        v = (pixel & format->Gmask) >> format->Gshift;
-        *g = SDL_expand_byte[format->Gloss][v];
-        v = (pixel & format->Bmask) >> format->Bshift;
-        *b = SDL_expand_byte[format->Bloss][v];
-        v = (pixel & format->Amask) >> format->Ashift;
-        *a = SDL_expand_byte[format->Aloss][v];
-    } else {
-        if (pixel < (unsigned)format->palette->ncolors) {
-            *r = format->palette->colors[pixel].r;
-            *g = format->palette->colors[pixel].g;
-            *b = format->palette->colors[pixel].b;
-            *a = format->palette->colors[pixel].a;
-        } else {
-            *r = *g = *b = *a = 0;
-        }
-    }
-}
-
-/* Map from Palette to Palette */
-static Uint8 *
-Map1to1(SDL_Palette * src, SDL_Palette * dst, int *identical)
-{
-    Uint8 *map;
-    int i;
-
-    if (identical) {
-        if (src->ncolors <= dst->ncolors) {
-            /* If an identical palette, no need to map */
-            if (src == dst
-                ||
-                (SDL_memcmp
-                 (src->colors, dst->colors,
-                  src->ncolors * sizeof(SDL_Color)) == 0)) {
-                *identical = 1;
-                return (NULL);
-            }
-        }
-        *identical = 0;
-    }
-    map = (Uint8 *) SDL_malloc(src->ncolors);
-    if (map == NULL) {
-        SDL_OutOfMemory();
-        return (NULL);
-    }
-    for (i = 0; i < src->ncolors; ++i) {
-        map[i] = SDL_FindColor(dst,
-                               src->colors[i].r, src->colors[i].g,
-                               src->colors[i].b, src->colors[i].a);
-    }
-    return (map);
-}
-
-/* Map from Palette to BitField */
-static Uint8 *
-Map1toN(SDL_PixelFormat * src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod,
-        SDL_PixelFormat * dst)
-{
-    Uint8 *map;
-    int i;
-    int bpp;
-    SDL_Palette *pal = src->palette;
-
-    bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel);
-    map = (Uint8 *) SDL_malloc(pal->ncolors * bpp);
-    if (map == NULL) {
-        SDL_OutOfMemory();
-        return (NULL);
-    }
-
-    /* We memory copy to the pixel map so the endianness is preserved */
-    for (i = 0; i < pal->ncolors; ++i) {
-        Uint8 R = (Uint8) ((pal->colors[i].r * Rmod) / 255);
-        Uint8 G = (Uint8) ((pal->colors[i].g * Gmod) / 255);
-        Uint8 B = (Uint8) ((pal->colors[i].b * Bmod) / 255);
-        Uint8 A = (Uint8) ((pal->colors[i].a * Amod) / 255);
-        ASSEMBLE_RGBA(&map[i * bpp], dst->BytesPerPixel, dst, R, G, B, A);
-    }
-    return (map);
-}
-
-/* Map from BitField to Dithered-Palette to Palette */
-static Uint8 *
-MapNto1(SDL_PixelFormat * src, SDL_PixelFormat * dst, int *identical)
-{
-    /* Generate a 256 color dither palette */
-    SDL_Palette dithered;
-    SDL_Color colors[256];
-    SDL_Palette *pal = dst->palette;
-
-    dithered.ncolors = 256;
-    SDL_DitherColors(colors, 8);
-    dithered.colors = colors;
-    return (Map1to1(&dithered, pal, identical));
-}
-
-SDL_BlitMap *
-SDL_AllocBlitMap(void)
-{
-    SDL_BlitMap *map;
-
-    /* Allocate the empty map */
-    map = (SDL_BlitMap *) SDL_calloc(1, sizeof(*map));
-    if (map == NULL) {
-        SDL_OutOfMemory();
-        return (NULL);
-    }
-    map->info.r = 0xFF;
-    map->info.g = 0xFF;
-    map->info.b = 0xFF;
-    map->info.a = 0xFF;
-
-    /* It's ready to go */
-    return (map);
-}
-
-void
-SDL_InvalidateMap(SDL_BlitMap * map)
-{
-    if (!map) {
-        return;
-    }
-    if (map->dst) {
-        /* Release our reference to the surface - see the note below */
-        if (--map->dst->refcount <= 0) {
-            SDL_FreeSurface(map->dst);
-        }
-    }
-    map->dst = NULL;
-    map->src_palette_version = 0;
-    map->dst_palette_version = 0;
-    SDL_free(map->info.table);
-    map->info.table = NULL;
-}
-
-int
-SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst)
-{
-    SDL_PixelFormat *srcfmt;
-    SDL_PixelFormat *dstfmt;
-    SDL_BlitMap *map;
-
-    /* Clear out any previous mapping */
-    map = src->map;
-    if ((src->flags & SDL_RLEACCEL) == SDL_RLEACCEL) {
-        SDL_UnRLESurface(src, 1);
-    }
-    SDL_InvalidateMap(map);
-
-    /* Figure out what kind of mapping we're doing */
-    map->identity = 0;
-    srcfmt = src->format;
-    dstfmt = dst->format;
-    if (SDL_ISPIXELFORMAT_INDEXED(srcfmt->format)) {
-        if (SDL_ISPIXELFORMAT_INDEXED(dstfmt->format)) {
-            /* Palette --> Palette */
-            map->info.table =
-                Map1to1(srcfmt->palette, dstfmt->palette, &map->identity);
-            if (!map->identity) {
-                if (map->info.table == NULL) {
-                    return (-1);
-                }
-            }
-            if (srcfmt->BitsPerPixel != dstfmt->BitsPerPixel)
-                map->identity = 0;
-        } else {
-            /* Palette --> BitField */
-            map->info.table =
-                Map1toN(srcfmt, src->map->info.r, src->map->info.g,
-                        src->map->info.b, src->map->info.a, dstfmt);
-            if (map->info.table == NULL) {
-                return (-1);
-            }
-        }
-    } else {
-        if (SDL_ISPIXELFORMAT_INDEXED(dstfmt->format)) {
-            /* BitField --> Palette */
-            map->info.table = MapNto1(srcfmt, dstfmt, &map->identity);
-            if (!map->identity) {
-                if (map->info.table == NULL) {
-                    return (-1);
-                }
-            }
-            map->identity = 0;  /* Don't optimize to copy */
-        } else {
-            /* BitField --> BitField */
-            if (srcfmt == dstfmt) {
-                map->identity = 1;
-            }
-        }
-    }
-
-    map->dst = dst;
-
-    if (map->dst) {
-        /* Keep a reference to this surface so it doesn't get deleted
-           while we're still pointing at it.
-
-           A better method would be for the destination surface to keep
-           track of surfaces that are mapped to it and automatically
-           invalidate them when it is freed, but this will do for now.
-        */
-        ++map->dst->refcount;
-    }
-
-    if (dstfmt->palette) {
-        map->dst_palette_version = dstfmt->palette->version;
-    } else {
-        map->dst_palette_version = 0;
-    }
-
-    if (srcfmt->palette) {
-        map->src_palette_version = srcfmt->palette->version;
-    } else {
-        map->src_palette_version = 0;
-    }
-
-    /* Choose your blitters wisely */
-    return (SDL_CalculateBlit(src));
-}
-
-void
-SDL_FreeBlitMap(SDL_BlitMap * map)
-{
-    if (map) {
-        SDL_InvalidateMap(map);
-        SDL_free(map);
-    }
-}
-
-void
-SDL_CalculateGammaRamp(float gamma, Uint16 * ramp)
-{
-    int i;
-
-    /* Input validation */
-    if (gamma < 0.0f ) {
-      SDL_InvalidParamError("gamma");
-      return;
-    }
-    if (ramp == NULL) {
-      SDL_InvalidParamError("ramp");
-      return;
-    }
-
-    /* 0.0 gamma is all black */
-    if (gamma == 0.0f) {
-        for (i = 0; i < 256; ++i) {
-            ramp[i] = 0;
-        }
-        return;
-    } else if (gamma == 1.0f) {
-        /* 1.0 gamma is identity */
-        for (i = 0; i < 256; ++i) {
-            ramp[i] = (i << 8) | i;
-        }
-        return;
-    } else {
-        /* Calculate a real gamma ramp */
-        int value;
-        gamma = 1.0f / gamma;
-        for (i = 0; i < 256; ++i) {
-            value =
-                (int) (SDL_pow((double) i / 256.0, gamma) * 65535.0 + 0.5);
-            if (value > 65535) {
-                value = 65535;
-            }
-            ramp[i] = (Uint16) value;
-        }
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_pixels_c.h b/deps/SDL2/src/video/SDL_pixels_c.h
deleted file mode 100644
index 0b5d9a0..0000000
--- a/deps/SDL2/src/video/SDL_pixels_c.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_pixel.c */
-
-#include "SDL_blit.h"
-
-/* Pixel format functions */
-extern int SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format);
-
-/* Blit mapping functions */
-extern SDL_BlitMap *SDL_AllocBlitMap(void);
-extern void SDL_InvalidateMap(SDL_BlitMap * map);
-extern int SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst);
-extern void SDL_FreeBlitMap(SDL_BlitMap * map);
-
-/* Miscellaneous functions */
-extern int SDL_CalculatePitch(SDL_Surface * surface);
-extern void SDL_DitherColors(SDL_Color * colors, int bpp);
-extern Uint8 SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_rect.c b/deps/SDL2/src/video/SDL_rect.c
deleted file mode 100644
index b6393fb..0000000
--- a/deps/SDL2/src/video/SDL_rect.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_rect.h"
-#include "SDL_rect_c.h"
-
-
-SDL_bool
-SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B)
-{
-    int Amin, Amax, Bmin, Bmax;
-
-    if (!A) {
-        SDL_InvalidParamError("A");
-        return SDL_FALSE;
-    }
-
-    if (!B) {
-        SDL_InvalidParamError("B");
-        return SDL_FALSE;
-    }
-
-    /* Special cases for empty rects */
-    if (SDL_RectEmpty(A) || SDL_RectEmpty(B)) {
-        return SDL_FALSE;
-    }
-
-    /* Horizontal intersection */
-    Amin = A->x;
-    Amax = Amin + A->w;
-    Bmin = B->x;
-    Bmax = Bmin + B->w;
-    if (Bmin > Amin)
-        Amin = Bmin;
-    if (Bmax < Amax)
-        Amax = Bmax;
-    if (Amax <= Amin)
-        return SDL_FALSE;
-
-    /* Vertical intersection */
-    Amin = A->y;
-    Amax = Amin + A->h;
-    Bmin = B->y;
-    Bmax = Bmin + B->h;
-    if (Bmin > Amin)
-        Amin = Bmin;
-    if (Bmax < Amax)
-        Amax = Bmax;
-    if (Amax <= Amin)
-        return SDL_FALSE;
-
-    return SDL_TRUE;
-}
-
-SDL_bool
-SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
-{
-    int Amin, Amax, Bmin, Bmax;
-
-    if (!A) {
-        SDL_InvalidParamError("A");
-        return SDL_FALSE;
-    }
-
-    if (!B) {
-        SDL_InvalidParamError("B");
-        return SDL_FALSE;
-    }
-
-    if (!result) {
-        SDL_InvalidParamError("result");
-        return SDL_FALSE;
-    }
-
-    /* Special cases for empty rects */
-    if (SDL_RectEmpty(A) || SDL_RectEmpty(B)) {
-        result->w = 0;
-        result->h = 0;
-        return SDL_FALSE;
-    }
-
-    /* Horizontal intersection */
-    Amin = A->x;
-    Amax = Amin + A->w;
-    Bmin = B->x;
-    Bmax = Bmin + B->w;
-    if (Bmin > Amin)
-        Amin = Bmin;
-    result->x = Amin;
-    if (Bmax < Amax)
-        Amax = Bmax;
-    result->w = Amax - Amin;
-
-    /* Vertical intersection */
-    Amin = A->y;
-    Amax = Amin + A->h;
-    Bmin = B->y;
-    Bmax = Bmin + B->h;
-    if (Bmin > Amin)
-        Amin = Bmin;
-    result->y = Amin;
-    if (Bmax < Amax)
-        Amax = Bmax;
-    result->h = Amax - Amin;
-
-    return !SDL_RectEmpty(result);
-}
-
-void
-SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
-{
-    int Amin, Amax, Bmin, Bmax;
-
-    if (!A) {
-        SDL_InvalidParamError("A");
-        return;
-    }
-
-    if (!B) {
-        SDL_InvalidParamError("B");
-        return;
-    }
-
-    if (!result) {
-        SDL_InvalidParamError("result");
-        return;
-    }
-
-    /* Special cases for empty Rects */
-    if (SDL_RectEmpty(A)) {
-      if (SDL_RectEmpty(B)) {
-       /* A and B empty */
-       return;
-      } else {
-       /* A empty, B not empty */
-       *result = *B;
-       return;
-      }
-    } else {
-      if (SDL_RectEmpty(B)) {
-       /* A not empty, B empty */
-       *result = *A;
-       return;
-      }
-    }
-
-    /* Horizontal union */
-    Amin = A->x;
-    Amax = Amin + A->w;
-    Bmin = B->x;
-    Bmax = Bmin + B->w;
-    if (Bmin < Amin)
-        Amin = Bmin;
-    result->x = Amin;
-    if (Bmax > Amax)
-        Amax = Bmax;
-    result->w = Amax - Amin;
-
-    /* Vertical union */
-    Amin = A->y;
-    Amax = Amin + A->h;
-    Bmin = B->y;
-    Bmax = Bmin + B->h;
-    if (Bmin < Amin)
-        Amin = Bmin;
-    result->y = Amin;
-    if (Bmax > Amax)
-        Amax = Bmax;
-    result->h = Amax - Amin;
-}
-
-SDL_bool
-SDL_EnclosePoints(const SDL_Point * points, int count, const SDL_Rect * clip,
-                  SDL_Rect * result)
-{
-    int minx = 0;
-    int miny = 0;
-    int maxx = 0;
-    int maxy = 0;
-    int x, y, i;
-
-    if (!points) {
-        SDL_InvalidParamError("points");
-        return SDL_FALSE;
-    }
-
-    if (count < 1) {
-        SDL_InvalidParamError("count");
-        return SDL_FALSE;
-    }
-
-    if (clip) {
-        SDL_bool added = SDL_FALSE;
-        const int clip_minx = clip->x;
-        const int clip_miny = clip->y;
-        const int clip_maxx = clip->x+clip->w-1;
-        const int clip_maxy = clip->y+clip->h-1;
-
-        /* Special case for empty rectangle */
-        if (SDL_RectEmpty(clip)) {
-            return SDL_FALSE;
-        }
-
-        for (i = 0; i < count; ++i) {
-            x = points[i].x;
-            y = points[i].y;
-
-            if (x < clip_minx || x > clip_maxx ||
-                y < clip_miny || y > clip_maxy) {
-                continue;
-            }
-            if (!added) {
-                /* Special case: if no result was requested, we are done */
-                if (result == NULL) {
-                    return SDL_TRUE;
-                }
-
-                /* First point added */
-                minx = maxx = x;
-                miny = maxy = y;
-                added = SDL_TRUE;
-                continue;
-            }
-            if (x < minx) {
-                minx = x;
-            } else if (x > maxx) {
-                maxx = x;
-            }
-            if (y < miny) {
-                miny = y;
-            } else if (y > maxy) {
-                maxy = y;
-            }
-        }
-        if (!added) {
-            return SDL_FALSE;
-        }
-    } else {
-        /* Special case: if no result was requested, we are done */
-        if (result == NULL) {
-            return SDL_TRUE;
-        }
-
-        /* No clipping, always add the first point */
-        minx = maxx = points[0].x;
-        miny = maxy = points[0].y;
-
-        for (i = 1; i < count; ++i) {
-            x = points[i].x;
-            y = points[i].y;
-
-            if (x < minx) {
-                minx = x;
-            } else if (x > maxx) {
-                maxx = x;
-            }
-            if (y < miny) {
-                miny = y;
-            } else if (y > maxy) {
-                maxy = y;
-            }
-        }
-    }
-
-    if (result) {
-        result->x = minx;
-        result->y = miny;
-        result->w = (maxx-minx)+1;
-        result->h = (maxy-miny)+1;
-    }
-    return SDL_TRUE;
-}
-
-/* Use the Cohen-Sutherland algorithm for line clipping */
-#define CODE_BOTTOM 1
-#define CODE_TOP    2
-#define CODE_LEFT   4
-#define CODE_RIGHT  8
-
-static int
-ComputeOutCode(const SDL_Rect * rect, int x, int y)
-{
-    int code = 0;
-    if (y < rect->y) {
-        code |= CODE_TOP;
-    } else if (y >= rect->y + rect->h) {
-        code |= CODE_BOTTOM;
-    }
-    if (x < rect->x) {
-        code |= CODE_LEFT;
-    } else if (x >= rect->x + rect->w) {
-        code |= CODE_RIGHT;
-    }
-    return code;
-}
-
-SDL_bool
-SDL_IntersectRectAndLine(const SDL_Rect * rect, int *X1, int *Y1, int *X2,
-                         int *Y2)
-{
-    int x = 0;
-    int y = 0;
-    int x1, y1;
-    int x2, y2;
-    int rectx1;
-    int recty1;
-    int rectx2;
-    int recty2;
-    int outcode1, outcode2;
-
-    if (!rect) {
-        SDL_InvalidParamError("rect");
-        return SDL_FALSE;
-    }
-
-    if (!X1) {
-        SDL_InvalidParamError("X1");
-        return SDL_FALSE;
-    }
-
-    if (!Y1) {
-        SDL_InvalidParamError("Y1");
-        return SDL_FALSE;
-    }
-
-    if (!X2) {
-        SDL_InvalidParamError("X2");
-        return SDL_FALSE;
-    }
-
-    if (!Y2) {
-        SDL_InvalidParamError("Y2");
-        return SDL_FALSE;
-    }
-
-    /* Special case for empty rect */
-    if (SDL_RectEmpty(rect)) {
-        return SDL_FALSE;
-    }
-
-    x1 = *X1;
-    y1 = *Y1;
-    x2 = *X2;
-    y2 = *Y2;
-    rectx1 = rect->x;
-    recty1 = rect->y;
-    rectx2 = rect->x + rect->w - 1;
-    recty2 = rect->y + rect->h - 1;
-
-    /* Check to see if entire line is inside rect */
-    if (x1 >= rectx1 && x1 <= rectx2 && x2 >= rectx1 && x2 <= rectx2 &&
-        y1 >= recty1 && y1 <= recty2 && y2 >= recty1 && y2 <= recty2) {
-        return SDL_TRUE;
-    }
-
-    /* Check to see if entire line is to one side of rect */
-    if ((x1 < rectx1 && x2 < rectx1) || (x1 > rectx2 && x2 > rectx2) ||
-        (y1 < recty1 && y2 < recty1) || (y1 > recty2 && y2 > recty2)) {
-        return SDL_FALSE;
-    }
-
-    if (y1 == y2) {
-        /* Horizontal line, easy to clip */
-        if (x1 < rectx1) {
-            *X1 = rectx1;
-        } else if (x1 > rectx2) {
-            *X1 = rectx2;
-        }
-        if (x2 < rectx1) {
-            *X2 = rectx1;
-        } else if (x2 > rectx2) {
-            *X2 = rectx2;
-        }
-        return SDL_TRUE;
-    }
-
-    if (x1 == x2) {
-        /* Vertical line, easy to clip */
-        if (y1 < recty1) {
-            *Y1 = recty1;
-        } else if (y1 > recty2) {
-            *Y1 = recty2;
-        }
-        if (y2 < recty1) {
-            *Y2 = recty1;
-        } else if (y2 > recty2) {
-            *Y2 = recty2;
-        }
-        return SDL_TRUE;
-    }
-
-    /* More complicated Cohen-Sutherland algorithm */
-    outcode1 = ComputeOutCode(rect, x1, y1);
-    outcode2 = ComputeOutCode(rect, x2, y2);
-    while (outcode1 || outcode2) {
-        if (outcode1 & outcode2) {
-            return SDL_FALSE;
-        }
-
-        if (outcode1) {
-            if (outcode1 & CODE_TOP) {
-                y = recty1;
-                x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1);
-            } else if (outcode1 & CODE_BOTTOM) {
-                y = recty2;
-                x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1);
-            } else if (outcode1 & CODE_LEFT) {
-                x = rectx1;
-                y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1);
-            } else if (outcode1 & CODE_RIGHT) {
-                x = rectx2;
-                y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1);
-            }
-            x1 = x;
-            y1 = y;
-            outcode1 = ComputeOutCode(rect, x, y);
-        } else {
-            if (outcode2 & CODE_TOP) {
-                y = recty1;
-                x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1);
-            } else if (outcode2 & CODE_BOTTOM) {
-                y = recty2;
-                x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1);
-            } else if (outcode2 & CODE_LEFT) {
-                x = rectx1;
-                y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1);
-            } else if (outcode2 & CODE_RIGHT) {
-                x = rectx2;
-                y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1);
-            }
-            x2 = x;
-            y2 = y;
-            outcode2 = ComputeOutCode(rect, x, y);
-        }
-    }
-    *X1 = x1;
-    *Y1 = y1;
-    *X2 = x2;
-    *Y2 = y2;
-    return SDL_TRUE;
-}
-
-SDL_bool
-SDL_GetSpanEnclosingRect(int width, int height,
-                         int numrects, const SDL_Rect * rects, SDL_Rect *span)
-{
-    int i;
-    int span_y1, span_y2;
-    int rect_y1, rect_y2;
-
-    if (width < 1) {
-        SDL_InvalidParamError("width");
-        return SDL_FALSE;
-    }
-
-    if (height < 1) {
-        SDL_InvalidParamError("height");
-        return SDL_FALSE;
-    }
-
-    if (!rects) {
-        SDL_InvalidParamError("rects");
-        return SDL_FALSE;
-    }
-
-    if (!span) {
-        SDL_InvalidParamError("span");
-        return SDL_FALSE;
-    }
-
-    if (numrects < 1) {
-        SDL_InvalidParamError("numrects");
-        return SDL_FALSE;
-    }
-
-    /* Initialize to empty rect */
-    span_y1 = height;
-    span_y2 = 0;
-
-    for (i = 0; i < numrects; ++i) {
-        rect_y1 = rects[i].y;
-        rect_y2 = rect_y1 + rects[i].h;
-
-        /* Clip out of bounds rectangles, and expand span rect */
-        if (rect_y1 < 0) {
-            span_y1 = 0;
-        } else if (rect_y1 < span_y1) {
-            span_y1 = rect_y1;
-        }
-        if (rect_y2 > height) {
-            span_y2 = height;
-        } else if (rect_y2 > span_y2) {
-            span_y2 = rect_y2;
-        }
-    }
-    if (span_y2 > span_y1) {
-        span->x = 0;
-        span->y = span_y1;
-        span->w = width;
-        span->h = (span_y2 - span_y1);
-        return SDL_TRUE;
-    }
-    return SDL_FALSE;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_rect_c.h b/deps/SDL2/src/video/SDL_rect_c.h
deleted file mode 100644
index a7fd49c..0000000
--- a/deps/SDL2/src/video/SDL_rect_c.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect * rects, SDL_Rect *span);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_shape.c b/deps/SDL2/src/video/SDL_shape.c
deleted file mode 100644
index 308fefc..0000000
--- a/deps/SDL2/src/video/SDL_shape.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL.h"
-#include "SDL_assert.h"
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_pixels.h"
-#include "SDL_surface.h"
-#include "SDL_shape.h"
-#include "SDL_shape_internals.h"
-
-SDL_Window*
-SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags)
-{
-    SDL_Window *result = NULL;
-    result = SDL_CreateWindow(title,-1000,-1000,w,h,(flags | SDL_WINDOW_BORDERLESS) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE) /* & (~SDL_WINDOW_SHOWN) */);
-    if(result != NULL) {
-        result->shaper = SDL_GetVideoDevice()->shape_driver.CreateShaper(result);
-        if(result->shaper != NULL) {
-            result->shaper->userx = x;
-            result->shaper->usery = y;
-            result->shaper->mode.mode = ShapeModeDefault;
-            result->shaper->mode.parameters.binarizationCutoff = 1;
-            result->shaper->hasshape = SDL_FALSE;
-            return result;
-        }
-        else {
-            SDL_DestroyWindow(result);
-            return NULL;
-        }
-    }
-    else
-        return NULL;
-}
-
-SDL_bool
-SDL_IsShapedWindow(const SDL_Window *window)
-{
-    if(window == NULL)
-        return SDL_FALSE;
-    else
-        return (SDL_bool)(window->shaper != NULL);
-}
-
-/* REQUIRES that bitmap point to a w-by-h bitmap with ppb pixels-per-byte. */
-void
-SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb)
-{
-    int x = 0;
-    int y = 0;
-    Uint8 r = 0,g = 0,b = 0,alpha = 0;
-    Uint8* pixel = NULL;
-    Uint32 bitmap_pixel,pixel_value = 0,mask_value = 0;
-    SDL_Color key;
-    if(SDL_MUSTLOCK(shape))
-        SDL_LockSurface(shape);
-    for(y = 0;y<shape->h;y++) {
-        for(x=0;x<shape->w;x++) {
-            alpha = 0;
-            pixel_value = 0;
-            pixel = (Uint8 *)(shape->pixels) + (y*shape->pitch) + (x*shape->format->BytesPerPixel);
-            switch(shape->format->BytesPerPixel) {
-                case(1):
-                    pixel_value = *(Uint8*)pixel;
-                    break;
-                case(2):
-                    pixel_value = *(Uint16*)pixel;
-                    break;
-                case(3):
-                    pixel_value = *(Uint32*)pixel & (~shape->format->Amask);
-                    break;
-                case(4):
-                    pixel_value = *(Uint32*)pixel;
-                    break;
-            }
-            SDL_GetRGBA(pixel_value,shape->format,&r,&g,&b,&alpha);
-            bitmap_pixel = y*shape->w + x;
-            switch(mode.mode) {
-                case(ShapeModeDefault):
-                    mask_value = (alpha >= 1 ? 1 : 0);
-                    break;
-                case(ShapeModeBinarizeAlpha):
-                    mask_value = (alpha >= mode.parameters.binarizationCutoff ? 1 : 0);
-                    break;
-                case(ShapeModeReverseBinarizeAlpha):
-                    mask_value = (alpha <= mode.parameters.binarizationCutoff ? 1 : 0);
-                    break;
-                case(ShapeModeColorKey):
-                    key = mode.parameters.colorKey;
-                    mask_value = ((key.r != r || key.g != g || key.b != b) ? 1 : 0);
-                    break;
-            }
-            bitmap[bitmap_pixel / ppb] |= mask_value << (7 - ((ppb - 1) - (bitmap_pixel % ppb)));
-        }
-    }
-    if(SDL_MUSTLOCK(shape))
-        SDL_UnlockSurface(shape);
-}
-
-static SDL_ShapeTree*
-RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* mask,SDL_Rect dimensions) {
-    int x = 0,y = 0;
-    Uint8* pixel = NULL;
-    Uint32 pixel_value = 0;
-    Uint8 r = 0,g = 0,b = 0,a = 0;
-    SDL_bool pixel_opaque = SDL_FALSE;
-    int last_opaque = -1;
-    SDL_Color key;
-    SDL_ShapeTree* result = (SDL_ShapeTree*)SDL_malloc(sizeof(SDL_ShapeTree));
-    SDL_Rect next = {0,0,0,0};
-    for(y=dimensions.y;y<dimensions.y + dimensions.h;y++) {
-        for(x=dimensions.x;x<dimensions.x + dimensions.w;x++) {
-            pixel_value = 0;
-            pixel = (Uint8 *)(mask->pixels) + (y*mask->pitch) + (x*mask->format->BytesPerPixel);
-            switch(mask->format->BytesPerPixel) {
-                case(1):
-                    pixel_value = *(Uint8*)pixel;
-                    break;
-                case(2):
-                    pixel_value = *(Uint16*)pixel;
-                    break;
-                case(3):
-                    pixel_value = *(Uint32*)pixel & (~mask->format->Amask);
-                    break;
-                case(4):
-                    pixel_value = *(Uint32*)pixel;
-                    break;
-            }
-            SDL_GetRGBA(pixel_value,mask->format,&r,&g,&b,&a);
-            switch(mode.mode) {
-                case(ShapeModeDefault):
-                    pixel_opaque = (a >= 1 ? SDL_TRUE : SDL_FALSE);
-                    break;
-                case(ShapeModeBinarizeAlpha):
-                    pixel_opaque = (a >= mode.parameters.binarizationCutoff ? SDL_TRUE : SDL_FALSE);
-                    break;
-                case(ShapeModeReverseBinarizeAlpha):
-                    pixel_opaque = (a <= mode.parameters.binarizationCutoff ? SDL_TRUE : SDL_FALSE);
-                    break;
-                case(ShapeModeColorKey):
-                    key = mode.parameters.colorKey;
-                    pixel_opaque = ((key.r != r || key.g != g || key.b != b) ? SDL_TRUE : SDL_FALSE);
-                    break;
-            }
-            if(last_opaque == -1)
-                last_opaque = pixel_opaque;
-            if(last_opaque != pixel_opaque) {
-                result->kind = QuadShape;
-                /* These will stay the same. */
-                next.w = dimensions.w / 2;
-                next.h = dimensions.h / 2;
-                /* These will change from recursion to recursion. */
-                next.x = dimensions.x;
-                next.y = dimensions.y;
-                result->data.children.upleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next);
-                next.x += next.w;
-                /* Unneeded: next.y = dimensions.y; */
-                result->data.children.upright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next);
-                next.x = dimensions.x;
-                next.y += next.h;
-                result->data.children.downleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next);
-                next.x += next.w;
-                /* Unneeded: next.y = dimensions.y + dimensions.h /2; */
-                result->data.children.downright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next);
-                return result;
-            }
-        }
-    }
-    /* If we never recursed, all the pixels in this quadrant have the same "value". */
-    result->kind = (last_opaque == SDL_TRUE ? OpaqueShape : TransparentShape);
-    result->data.shape = dimensions;
-    return result;
-}
-
-SDL_ShapeTree*
-SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape)
-{
-    SDL_Rect dimensions = {0,0,shape->w,shape->h};
-    SDL_ShapeTree* result = NULL;
-    if(SDL_MUSTLOCK(shape))
-        SDL_LockSurface(shape);
-    result = RecursivelyCalculateShapeTree(mode,shape,dimensions);
-    if(SDL_MUSTLOCK(shape))
-        SDL_UnlockSurface(shape);
-    return result;
-}
-
-void
-SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure)
-{
-    SDL_assert(tree != NULL);
-    if(tree->kind == QuadShape) {
-        SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upleft,function,closure);
-        SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upright,function,closure);
-        SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.downleft,function,closure);
-        SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.downright,function,closure);
-    }
-    else
-        function(tree,closure);
-}
-
-void
-SDL_FreeShapeTree(SDL_ShapeTree** shape_tree)
-{
-    if((*shape_tree)->kind == QuadShape) {
-        SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.upleft);
-        SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.upright);
-        SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.downleft);
-        SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.downright);
-    }
-    SDL_free(*shape_tree);
-    *shape_tree = NULL;
-}
-
-int
-SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode)
-{
-    int result;
-    if(window == NULL || !SDL_IsShapedWindow(window))
-        /* The window given was not a shapeable window. */
-        return SDL_NONSHAPEABLE_WINDOW;
-    if(shape == NULL)
-        /* Invalid shape argument. */
-        return SDL_INVALID_SHAPE_ARGUMENT;
-
-    if(shape_mode != NULL)
-        window->shaper->mode = *shape_mode;
-    result = SDL_GetVideoDevice()->shape_driver.SetWindowShape(window->shaper,shape,shape_mode);
-    window->shaper->hasshape = SDL_TRUE;
-    if(window->shaper->userx != 0 && window->shaper->usery != 0) {
-        SDL_SetWindowPosition(window,window->shaper->userx,window->shaper->usery);
-        window->shaper->userx = 0;
-        window->shaper->usery = 0;
-    }
-    return result;
-}
-
-static SDL_bool
-SDL_WindowHasAShape(SDL_Window *window)
-{
-    if (window == NULL || !SDL_IsShapedWindow(window))
-        return SDL_FALSE;
-    return window->shaper->hasshape;
-}
-
-int
-SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode)
-{
-    if(window != NULL && SDL_IsShapedWindow(window)) {
-        if(shape_mode == NULL) {
-            if(SDL_WindowHasAShape(window))
-                /* The window given has a shape. */
-                return 0;
-            else
-                /* The window given is shapeable but lacks a shape. */
-                return SDL_WINDOW_LACKS_SHAPE;
-        }
-        else {
-            *shape_mode = window->shaper->mode;
-            return 0;
-        }
-    }
-    else
-        /* The window given is not a valid shapeable window. */
-        return SDL_NONSHAPEABLE_WINDOW;
-}
diff --git a/deps/SDL2/src/video/SDL_shape_internals.h b/deps/SDL2/src/video/SDL_shape_internals.h
deleted file mode 100644
index 27b5124..0000000
--- a/deps/SDL2/src/video/SDL_shape_internals.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_shape_internals_h
-#define _SDL_shape_internals_h
-
-#include "SDL_rect.h"
-#include "SDL_shape.h"
-#include "SDL_surface.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-/* *INDENT-OFF* */
-extern "C" {
-/* *INDENT-ON* */
-#endif
-
-typedef struct {
-	struct SDL_ShapeTree *upleft,*upright,*downleft,*downright;
-} SDL_QuadTreeChildren;
-
-typedef union {
-	SDL_QuadTreeChildren children;
-	SDL_Rect shape;
-} SDL_ShapeUnion;
-
-typedef enum { QuadShape,TransparentShape,OpaqueShape } SDL_ShapeKind;
-
-typedef struct {
-	SDL_ShapeKind kind;
-	SDL_ShapeUnion data;
-} SDL_ShapeTree;
-	
-typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*);
-
-extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb);
-extern SDL_ShapeTree* SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape);
-extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure);
-extern void SDL_FreeShapeTree(SDL_ShapeTree** shape_tree);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-/* *INDENT-OFF* */
-}
-/* *INDENT-ON* */
-#endif
-#include "close_code.h"
-
-#endif
diff --git a/deps/SDL2/src/video/SDL_stretch.c b/deps/SDL2/src/video/SDL_stretch.c
deleted file mode 100644
index 3eafc20..0000000
--- a/deps/SDL2/src/video/SDL_stretch.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* This a stretch blit implementation based on ideas given to me by
-   Tomasz Cejner - thanks! :)
-
-   April 27, 2000 - Sam Lantinga
-*/
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-
-/* This isn't ready for general consumption yet - it should be folded
-   into the general blitting mechanism.
-*/
-
-#if ((defined(_MFC_VER) && defined(_M_IX86)) || \
-     defined(__WATCOMC__) || \
-     (defined(__GNUC__) && defined(__i386__))) && SDL_ASSEMBLY_ROUTINES
-/* There's a bug with gcc 4.4.1 and -O2 where srcp doesn't get the correct
- * value after the first scanline.  FIXME? */
-/* #define USE_ASM_STRETCH */
-#endif
-
-#ifdef USE_ASM_STRETCH
-
-#ifdef HAVE_MPROTECT
-#include <sys/types.h>
-#include <sys/mman.h>
-#endif
-#ifdef __GNUC__
-#define PAGE_ALIGNED __attribute__((__aligned__(4096)))
-#else
-#define PAGE_ALIGNED
-#endif
-
-#if defined(_M_IX86) || defined(i386)
-#define PREFIX16    0x66
-#define STORE_BYTE  0xAA
-#define STORE_WORD  0xAB
-#define LOAD_BYTE   0xAC
-#define LOAD_WORD   0xAD
-#define RETURN      0xC3
-#else
-#error Need assembly opcodes for this architecture
-#endif
-
-static unsigned char copy_row[4096] PAGE_ALIGNED;
-
-static int
-generate_rowbytes(int src_w, int dst_w, int bpp)
-{
-    static struct
-    {
-        int bpp;
-        int src_w;
-        int dst_w;
-        int status;
-    } last;
-
-    int i;
-    int pos, inc;
-    unsigned char *eip, *fence;
-    unsigned char load, store;
-
-    /* See if we need to regenerate the copy buffer */
-    if ((src_w == last.src_w) && (dst_w == last.dst_w) && (bpp == last.bpp)) {
-        return (last.status);
-    }
-    last.bpp = bpp;
-    last.src_w = src_w;
-    last.dst_w = dst_w;
-    last.status = -1;
-
-    switch (bpp) {
-    case 1:
-        load = LOAD_BYTE;
-        store = STORE_BYTE;
-        break;
-    case 2:
-    case 4:
-        load = LOAD_WORD;
-        store = STORE_WORD;
-        break;
-    default:
-        return SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp);
-    }
-#ifdef HAVE_MPROTECT
-    /* Make the code writeable */
-    if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_WRITE) < 0) {
-        return SDL_SetError("Couldn't make copy buffer writeable");
-    }
-#endif
-    pos = 0x10000;
-    inc = (src_w << 16) / dst_w;
-    eip = copy_row;
-    fence = copy_row + sizeof(copy_row)-2;
-    for (i = 0; i < dst_w; ++i) {
-        while (pos >= 0x10000L) {
-            if (eip == fence) {
-                return -1;
-            }
-            if (bpp == 2) {
-                *eip++ = PREFIX16;
-            }
-            *eip++ = load;
-            pos -= 0x10000L;
-        }
-        if (eip == fence) {
-            return -1;
-        }
-        if (bpp == 2) {
-            *eip++ = PREFIX16;
-        }
-        *eip++ = store;
-        pos += inc;
-    }
-    *eip++ = RETURN;
-
-#ifdef HAVE_MPROTECT
-    /* Make the code executable but not writeable */
-    if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_EXEC) < 0) {
-        return SDL_SetError("Couldn't make copy buffer executable");
-    }
-#endif
-    last.status = 0;
-    return (0);
-}
-
-#endif /* USE_ASM_STRETCH */
-
-#define DEFINE_COPY_ROW(name, type)         \
-static void name(type *src, int src_w, type *dst, int dst_w)    \
-{                                           \
-    int i;                                  \
-    int pos, inc;                           \
-    type pixel = 0;                         \
-                                            \
-    pos = 0x10000;                          \
-    inc = (src_w << 16) / dst_w;            \
-    for ( i=dst_w; i>0; --i ) {             \
-        while ( pos >= 0x10000L ) {         \
-            pixel = *src++;                 \
-            pos -= 0x10000L;                \
-        }                                   \
-        *dst++ = pixel;                     \
-        pos += inc;                         \
-    }                                       \
-}
-/* *INDENT-OFF* */
-DEFINE_COPY_ROW(copy_row1, Uint8)
-DEFINE_COPY_ROW(copy_row2, Uint16)
-DEFINE_COPY_ROW(copy_row4, Uint32)
-/* *INDENT-ON* */
-
-/* The ASM code doesn't handle 24-bpp stretch blits */
-static void
-copy_row3(Uint8 * src, int src_w, Uint8 * dst, int dst_w)
-{
-    int i;
-    int pos, inc;
-    Uint8 pixel[3] = { 0, 0, 0 };
-
-    pos = 0x10000;
-    inc = (src_w << 16) / dst_w;
-    for (i = dst_w; i > 0; --i) {
-        while (pos >= 0x10000L) {
-            pixel[0] = *src++;
-            pixel[1] = *src++;
-            pixel[2] = *src++;
-            pos -= 0x10000L;
-        }
-        *dst++ = pixel[0];
-        *dst++ = pixel[1];
-        *dst++ = pixel[2];
-        pos += inc;
-    }
-}
-
-/* Perform a stretch blit between two surfaces of the same format.
-   NOTE:  This function is not safe to call from multiple threads!
-*/
-int
-SDL_SoftStretch(SDL_Surface * src, const SDL_Rect * srcrect,
-                SDL_Surface * dst, const SDL_Rect * dstrect)
-{
-    int src_locked;
-    int dst_locked;
-    int pos, inc;
-    int dst_maxrow;
-    int src_row, dst_row;
-    Uint8 *srcp = NULL;
-    Uint8 *dstp;
-    SDL_Rect full_src;
-    SDL_Rect full_dst;
-#ifdef USE_ASM_STRETCH
-    SDL_bool use_asm = SDL_TRUE;
-#ifdef __GNUC__
-    int u1, u2;
-#endif
-#endif /* USE_ASM_STRETCH */
-    const int bpp = dst->format->BytesPerPixel;
-
-    if (src->format->format != dst->format->format) {
-        return SDL_SetError("Only works with same format surfaces");
-    }
-
-    /* Verify the blit rectangles */
-    if (srcrect) {
-        if ((srcrect->x < 0) || (srcrect->y < 0) ||
-            ((srcrect->x + srcrect->w) > src->w) ||
-            ((srcrect->y + srcrect->h) > src->h)) {
-            return SDL_SetError("Invalid source blit rectangle");
-        }
-    } else {
-        full_src.x = 0;
-        full_src.y = 0;
-        full_src.w = src->w;
-        full_src.h = src->h;
-        srcrect = &full_src;
-    }
-    if (dstrect) {
-        if ((dstrect->x < 0) || (dstrect->y < 0) ||
-            ((dstrect->x + dstrect->w) > dst->w) ||
-            ((dstrect->y + dstrect->h) > dst->h)) {
-            return SDL_SetError("Invalid destination blit rectangle");
-        }
-    } else {
-        full_dst.x = 0;
-        full_dst.y = 0;
-        full_dst.w = dst->w;
-        full_dst.h = dst->h;
-        dstrect = &full_dst;
-    }
-
-    /* Lock the destination if it's in hardware */
-    dst_locked = 0;
-    if (SDL_MUSTLOCK(dst)) {
-        if (SDL_LockSurface(dst) < 0) {
-            return SDL_SetError("Unable to lock destination surface");
-        }
-        dst_locked = 1;
-    }
-    /* Lock the source if it's in hardware */
-    src_locked = 0;
-    if (SDL_MUSTLOCK(src)) {
-        if (SDL_LockSurface(src) < 0) {
-            if (dst_locked) {
-                SDL_UnlockSurface(dst);
-            }
-            return SDL_SetError("Unable to lock source surface");
-        }
-        src_locked = 1;
-    }
-
-    /* Set up the data... */
-    pos = 0x10000;
-    inc = (srcrect->h << 16) / dstrect->h;
-    src_row = srcrect->y;
-    dst_row = dstrect->y;
-
-#ifdef USE_ASM_STRETCH
-    /* Write the opcodes for this stretch */
-    if ((bpp == 3) || (generate_rowbytes(srcrect->w, dstrect->w, bpp) < 0)) {
-        use_asm = SDL_FALSE;
-    }
-#endif
-
-    /* Perform the stretch blit */
-    for (dst_maxrow = dst_row + dstrect->h; dst_row < dst_maxrow; ++dst_row) {
-        dstp = (Uint8 *) dst->pixels + (dst_row * dst->pitch)
-            + (dstrect->x * bpp);
-        while (pos >= 0x10000L) {
-            srcp = (Uint8 *) src->pixels + (src_row * src->pitch)
-                + (srcrect->x * bpp);
-            ++src_row;
-            pos -= 0x10000L;
-        }
-#ifdef USE_ASM_STRETCH
-        if (use_asm) {
-#ifdef __GNUC__
-            __asm__ __volatile__("call *%4":"=&D"(u1), "=&S"(u2)
-                                 :"0"(dstp), "1"(srcp), "r"(copy_row)
-                                 :"memory");
-#elif defined(_MSC_VER) || defined(__WATCOMC__)
-            /* *INDENT-OFF* */
-            {
-                void *code = copy_row;
-                __asm {
-                    push edi
-                    push esi
-                    mov edi, dstp
-                    mov esi, srcp
-                    call dword ptr code
-                    pop esi
-                    pop edi
-                }
-            }
-            /* *INDENT-ON* */
-#else
-#error Need inline assembly for this compiler
-#endif
-        } else
-#endif
-            switch (bpp) {
-            case 1:
-                copy_row1(srcp, srcrect->w, dstp, dstrect->w);
-                break;
-            case 2:
-                copy_row2((Uint16 *) srcp, srcrect->w,
-                          (Uint16 *) dstp, dstrect->w);
-                break;
-            case 3:
-                copy_row3(srcp, srcrect->w, dstp, dstrect->w);
-                break;
-            case 4:
-                copy_row4((Uint32 *) srcp, srcrect->w,
-                          (Uint32 *) dstp, dstrect->w);
-                break;
-            }
-        pos += inc;
-    }
-
-    /* We need to unlock the surfaces if they're locked */
-    if (dst_locked) {
-        SDL_UnlockSurface(dst);
-    }
-    if (src_locked) {
-        SDL_UnlockSurface(src);
-    }
-    return (0);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_surface.c b/deps/SDL2/src/video/SDL_surface.c
deleted file mode 100644
index d4c852a..0000000
--- a/deps/SDL2/src/video/SDL_surface.c
+++ /dev/null
@@ -1,1094 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_blit.h"
-#include "SDL_RLEaccel_c.h"
-#include "SDL_pixels_c.h"
-
-
-/* Public routines */
-/*
- * Create an empty RGB surface of the appropriate depth
- */
-SDL_Surface *
-SDL_CreateRGBSurface(Uint32 flags,
-                     int width, int height, int depth,
-                     Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
-{
-    SDL_Surface *surface;
-    Uint32 format;
-
-    /* The flags are no longer used, make the compiler happy */
-    (void)flags;
-
-    /* Get the pixel format */
-    format = SDL_MasksToPixelFormatEnum(depth, Rmask, Gmask, Bmask, Amask);
-    if (format == SDL_PIXELFORMAT_UNKNOWN) {
-        SDL_SetError("Unknown pixel format");
-        return NULL;
-    }
-
-    /* Allocate the surface */
-    surface = (SDL_Surface *) SDL_calloc(1, sizeof(*surface));
-    if (surface == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    surface->format = SDL_AllocFormat(format);
-    if (!surface->format) {
-        SDL_FreeSurface(surface);
-        return NULL;
-    }
-    surface->w = width;
-    surface->h = height;
-    surface->pitch = SDL_CalculatePitch(surface);
-    SDL_SetClipRect(surface, NULL);
-
-    if (SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) {
-        SDL_Palette *palette =
-            SDL_AllocPalette((1 << surface->format->BitsPerPixel));
-        if (!palette) {
-            SDL_FreeSurface(surface);
-            return NULL;
-        }
-        if (palette->ncolors == 2) {
-            /* Create a black and white bitmap palette */
-            palette->colors[0].r = 0xFF;
-            palette->colors[0].g = 0xFF;
-            palette->colors[0].b = 0xFF;
-            palette->colors[1].r = 0x00;
-            palette->colors[1].g = 0x00;
-            palette->colors[1].b = 0x00;
-        }
-        SDL_SetSurfacePalette(surface, palette);
-        SDL_FreePalette(palette);
-    }
-
-    /* Get the pixels */
-    if (surface->w && surface->h) {
-        surface->pixels = SDL_malloc(surface->h * surface->pitch);
-        if (!surface->pixels) {
-            SDL_FreeSurface(surface);
-            SDL_OutOfMemory();
-            return NULL;
-        }
-        /* This is important for bitmaps */
-        SDL_memset(surface->pixels, 0, surface->h * surface->pitch);
-    }
-
-    /* Allocate an empty mapping */
-    surface->map = SDL_AllocBlitMap();
-    if (!surface->map) {
-        SDL_FreeSurface(surface);
-        return NULL;
-    }
-
-    /* By default surface with an alpha mask are set up for blending */
-    if (Amask) {
-        SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND);
-    }
-
-    /* The surface is ready to go */
-    surface->refcount = 1;
-    return surface;
-}
-
-/*
- * Create an RGB surface from an existing memory buffer
- */
-SDL_Surface *
-SDL_CreateRGBSurfaceFrom(void *pixels,
-                         int width, int height, int depth, int pitch,
-                         Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
-                         Uint32 Amask)
-{
-    SDL_Surface *surface;
-
-    surface =
-        SDL_CreateRGBSurface(0, 0, 0, depth, Rmask, Gmask, Bmask, Amask);
-    if (surface != NULL) {
-        surface->flags |= SDL_PREALLOC;
-        surface->pixels = pixels;
-        surface->w = width;
-        surface->h = height;
-        surface->pitch = pitch;
-        SDL_SetClipRect(surface, NULL);
-    }
-    return surface;
-}
-
-int
-SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette)
-{
-    if (!surface) {
-        return SDL_SetError("SDL_SetSurfacePalette() passed a NULL surface");
-    }
-    return SDL_SetPixelFormatPalette(surface->format, palette);
-}
-
-int
-SDL_SetSurfaceRLE(SDL_Surface * surface, int flag)
-{
-    int flags;
-
-    if (!surface) {
-        return -1;
-    }
-
-    flags = surface->map->info.flags;
-    if (flag) {
-        surface->map->info.flags |= SDL_COPY_RLE_DESIRED;
-    } else {
-        surface->map->info.flags &= ~SDL_COPY_RLE_DESIRED;
-    }
-    if (surface->map->info.flags != flags) {
-        SDL_InvalidateMap(surface->map);
-    }
-    return 0;
-}
-
-int
-SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key)
-{
-    int flags;
-
-    if (!surface) {
-        return SDL_InvalidParamError("surface");
-    }
-
-    if (surface->format->palette && key >= ((Uint32) surface->format->palette->ncolors)) {
-        return SDL_InvalidParamError("key");
-    }
-
-    if (flag & SDL_RLEACCEL) {
-        SDL_SetSurfaceRLE(surface, 1);
-    }
-
-    flags = surface->map->info.flags;
-    if (flag) {
-        surface->map->info.flags |= SDL_COPY_COLORKEY;
-        surface->map->info.colorkey = key;
-        if (surface->format->palette) {
-            surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_TRANSPARENT;
-            ++surface->format->palette->version;
-            if (!surface->format->palette->version) {
-                surface->format->palette->version = 1;
-            }
-        }
-    } else {
-        if (surface->format->palette) {
-            surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_OPAQUE;
-            ++surface->format->palette->version;
-            if (!surface->format->palette->version) {
-                surface->format->palette->version = 1;
-            }
-        }
-        surface->map->info.flags &= ~SDL_COPY_COLORKEY;
-    }
-    if (surface->map->info.flags != flags) {
-        SDL_InvalidateMap(surface->map);
-    }
-
-    return 0;
-}
-
-int
-SDL_GetColorKey(SDL_Surface * surface, Uint32 * key)
-{
-    if (!surface) {
-        return -1;
-    }
-
-    if (!(surface->map->info.flags & SDL_COPY_COLORKEY)) {
-        return -1;
-    }
-
-    if (key) {
-        *key = surface->map->info.colorkey;
-    }
-    return 0;
-}
-
-/* This is a fairly slow function to switch from colorkey to alpha */
-static void
-SDL_ConvertColorkeyToAlpha(SDL_Surface * surface)
-{
-    int x, y;
-
-    if (!surface) {
-        return;
-    }
-
-    if (!(surface->map->info.flags & SDL_COPY_COLORKEY) ||
-        !surface->format->Amask) {
-        return;
-    }
-
-    SDL_LockSurface(surface);
-
-    switch (surface->format->BytesPerPixel) {
-    case 2:
-        {
-            Uint16 *row, *spot;
-            Uint16 ckey = (Uint16) surface->map->info.colorkey;
-            Uint16 mask = (Uint16) (~surface->format->Amask);
-
-            /* Ignore alpha in colorkey comparison */
-            ckey &= mask;
-            row = (Uint16 *) surface->pixels;
-            for (y = surface->h; y--;) {
-                spot = row;
-                for (x = surface->w; x--;) {
-                    if ((*spot & mask) == ckey) {
-                        *spot &= mask;
-                    }
-                    ++spot;
-                }
-                row += surface->pitch / 2;
-            }
-        }
-        break;
-    case 3:
-        /* FIXME */
-        break;
-    case 4:
-        {
-            Uint32 *row, *spot;
-            Uint32 ckey = surface->map->info.colorkey;
-            Uint32 mask = ~surface->format->Amask;
-
-            /* Ignore alpha in colorkey comparison */
-            ckey &= mask;
-            row = (Uint32 *) surface->pixels;
-            for (y = surface->h; y--;) {
-                spot = row;
-                for (x = surface->w; x--;) {
-                    if ((*spot & mask) == ckey) {
-                        *spot &= mask;
-                    }
-                    ++spot;
-                }
-                row += surface->pitch / 4;
-            }
-        }
-        break;
-    }
-
-    SDL_UnlockSurface(surface);
-
-    SDL_SetColorKey(surface, 0, 0);
-    SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND);
-}
-
-int
-SDL_SetSurfaceColorMod(SDL_Surface * surface, Uint8 r, Uint8 g, Uint8 b)
-{
-    int flags;
-
-    if (!surface) {
-        return -1;
-    }
-
-    surface->map->info.r = r;
-    surface->map->info.g = g;
-    surface->map->info.b = b;
-
-    flags = surface->map->info.flags;
-    if (r != 0xFF || g != 0xFF || b != 0xFF) {
-        surface->map->info.flags |= SDL_COPY_MODULATE_COLOR;
-    } else {
-        surface->map->info.flags &= ~SDL_COPY_MODULATE_COLOR;
-    }
-    if (surface->map->info.flags != flags) {
-        SDL_InvalidateMap(surface->map);
-    }
-    return 0;
-}
-
-
-int
-SDL_GetSurfaceColorMod(SDL_Surface * surface, Uint8 * r, Uint8 * g, Uint8 * b)
-{
-    if (!surface) {
-        return -1;
-    }
-
-    if (r) {
-        *r = surface->map->info.r;
-    }
-    if (g) {
-        *g = surface->map->info.g;
-    }
-    if (b) {
-        *b = surface->map->info.b;
-    }
-    return 0;
-}
-
-int
-SDL_SetSurfaceAlphaMod(SDL_Surface * surface, Uint8 alpha)
-{
-    int flags;
-
-    if (!surface) {
-        return -1;
-    }
-
-    surface->map->info.a = alpha;
-
-    flags = surface->map->info.flags;
-    if (alpha != 0xFF) {
-        surface->map->info.flags |= SDL_COPY_MODULATE_ALPHA;
-    } else {
-        surface->map->info.flags &= ~SDL_COPY_MODULATE_ALPHA;
-    }
-    if (surface->map->info.flags != flags) {
-        SDL_InvalidateMap(surface->map);
-    }
-    return 0;
-}
-
-int
-SDL_GetSurfaceAlphaMod(SDL_Surface * surface, Uint8 * alpha)
-{
-    if (!surface) {
-        return -1;
-    }
-
-    if (alpha) {
-        *alpha = surface->map->info.a;
-    }
-    return 0;
-}
-
-int
-SDL_SetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode blendMode)
-{
-    int flags, status;
-
-    if (!surface) {
-        return -1;
-    }
-
-    status = 0;
-    flags = surface->map->info.flags;
-    surface->map->info.flags &=
-        ~(SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD);
-    switch (blendMode) {
-    case SDL_BLENDMODE_NONE:
-        break;
-    case SDL_BLENDMODE_BLEND:
-        surface->map->info.flags |= SDL_COPY_BLEND;
-        break;
-    case SDL_BLENDMODE_ADD:
-        surface->map->info.flags |= SDL_COPY_ADD;
-        break;
-    case SDL_BLENDMODE_MOD:
-        surface->map->info.flags |= SDL_COPY_MOD;
-        break;
-    default:
-        status = SDL_Unsupported();
-        break;
-    }
-
-    if (surface->map->info.flags != flags) {
-        SDL_InvalidateMap(surface->map);
-    }
-
-    return status;
-}
-
-int
-SDL_GetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode *blendMode)
-{
-    if (!surface) {
-        return -1;
-    }
-
-    if (!blendMode) {
-        return 0;
-    }
-
-    switch (surface->map->
-            info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD)) {
-    case SDL_COPY_BLEND:
-        *blendMode = SDL_BLENDMODE_BLEND;
-        break;
-    case SDL_COPY_ADD:
-        *blendMode = SDL_BLENDMODE_ADD;
-        break;
-    case SDL_COPY_MOD:
-        *blendMode = SDL_BLENDMODE_MOD;
-        break;
-    default:
-        *blendMode = SDL_BLENDMODE_NONE;
-        break;
-    }
-    return 0;
-}
-
-SDL_bool
-SDL_SetClipRect(SDL_Surface * surface, const SDL_Rect * rect)
-{
-    SDL_Rect full_rect;
-
-    /* Don't do anything if there's no surface to act on */
-    if (!surface) {
-        return SDL_FALSE;
-    }
-
-    /* Set up the full surface rectangle */
-    full_rect.x = 0;
-    full_rect.y = 0;
-    full_rect.w = surface->w;
-    full_rect.h = surface->h;
-
-    /* Set the clipping rectangle */
-    if (!rect) {
-        surface->clip_rect = full_rect;
-        return SDL_TRUE;
-    }
-    return SDL_IntersectRect(rect, &full_rect, &surface->clip_rect);
-}
-
-void
-SDL_GetClipRect(SDL_Surface * surface, SDL_Rect * rect)
-{
-    if (surface && rect) {
-        *rect = surface->clip_rect;
-    }
-}
-
-/*
- * Set up a blit between two surfaces -- split into three parts:
- * The upper part, SDL_UpperBlit(), performs clipping and rectangle
- * verification.  The lower part is a pointer to a low level
- * accelerated blitting function.
- *
- * These parts are separated out and each used internally by this
- * library in the optimimum places.  They are exported so that if
- * you know exactly what you are doing, you can optimize your code
- * by calling the one(s) you need.
- */
-int
-SDL_LowerBlit(SDL_Surface * src, SDL_Rect * srcrect,
-              SDL_Surface * dst, SDL_Rect * dstrect)
-{
-    /* Check to make sure the blit mapping is valid */
-    if ((src->map->dst != dst) ||
-        (dst->format->palette &&
-         src->map->dst_palette_version != dst->format->palette->version) ||
-        (src->format->palette &&
-         src->map->src_palette_version != src->format->palette->version)) {
-        if (SDL_MapSurface(src, dst) < 0) {
-            return (-1);
-        }
-        /* just here for debugging */
-/*         printf */
-/*             ("src = 0x%08X src->flags = %08X src->map->info.flags = %08x\ndst = 0x%08X dst->flags = %08X dst->map->info.flags = %08X\nsrc->map->blit = 0x%08x\n", */
-/*              src, dst->flags, src->map->info.flags, dst, dst->flags, */
-/*              dst->map->info.flags, src->map->blit); */
-    }
-    return (src->map->blit(src, srcrect, dst, dstrect));
-}
-
-
-int
-SDL_UpperBlit(SDL_Surface * src, const SDL_Rect * srcrect,
-              SDL_Surface * dst, SDL_Rect * dstrect)
-{
-    SDL_Rect fulldst;
-    int srcx, srcy, w, h;
-
-    /* Make sure the surfaces aren't locked */
-    if (!src || !dst) {
-        return SDL_SetError("SDL_UpperBlit: passed a NULL surface");
-    }
-    if (src->locked || dst->locked) {
-        return SDL_SetError("Surfaces must not be locked during blit");
-    }
-
-    /* If the destination rectangle is NULL, use the entire dest surface */
-    if (dstrect == NULL) {
-        fulldst.x = fulldst.y = 0;
-        fulldst.w = dst->w;
-        fulldst.h = dst->h;
-        dstrect = &fulldst;
-    }
-
-    /* clip the source rectangle to the source surface */
-    if (srcrect) {
-        int maxw, maxh;
-
-        srcx = srcrect->x;
-        w = srcrect->w;
-        if (srcx < 0) {
-            w += srcx;
-            dstrect->x -= srcx;
-            srcx = 0;
-        }
-        maxw = src->w - srcx;
-        if (maxw < w)
-            w = maxw;
-
-        srcy = srcrect->y;
-        h = srcrect->h;
-        if (srcy < 0) {
-            h += srcy;
-            dstrect->y -= srcy;
-            srcy = 0;
-        }
-        maxh = src->h - srcy;
-        if (maxh < h)
-            h = maxh;
-
-    } else {
-        srcx = srcy = 0;
-        w = src->w;
-        h = src->h;
-    }
-
-    /* clip the destination rectangle against the clip rectangle */
-    {
-        SDL_Rect *clip = &dst->clip_rect;
-        int dx, dy;
-
-        dx = clip->x - dstrect->x;
-        if (dx > 0) {
-            w -= dx;
-            dstrect->x += dx;
-            srcx += dx;
-        }
-        dx = dstrect->x + w - clip->x - clip->w;
-        if (dx > 0)
-            w -= dx;
-
-        dy = clip->y - dstrect->y;
-        if (dy > 0) {
-            h -= dy;
-            dstrect->y += dy;
-            srcy += dy;
-        }
-        dy = dstrect->y + h - clip->y - clip->h;
-        if (dy > 0)
-            h -= dy;
-    }
-
-    /* Switch back to a fast blit if we were previously stretching */
-    if (src->map->info.flags & SDL_COPY_NEAREST) {
-        src->map->info.flags &= ~SDL_COPY_NEAREST;
-        SDL_InvalidateMap(src->map);
-    }
-
-    if (w > 0 && h > 0) {
-        SDL_Rect sr;
-        sr.x = srcx;
-        sr.y = srcy;
-        sr.w = dstrect->w = w;
-        sr.h = dstrect->h = h;
-        return SDL_LowerBlit(src, &sr, dst, dstrect);
-    }
-    dstrect->w = dstrect->h = 0;
-    return 0;
-}
-
-int
-SDL_UpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect,
-              SDL_Surface * dst, SDL_Rect * dstrect)
-{
-    SDL_Rect final_src, final_dst, fulldst;
-
-    /* Make sure the surfaces aren't locked */
-    if (!src || !dst) {
-        return SDL_SetError("SDL_UpperBlitScaled: passed a NULL surface");
-    }
-    if (src->locked || dst->locked) {
-        return SDL_SetError("Surfaces must not be locked during blit");
-    }
-
-    /* If the destination rectangle is NULL, use the entire dest surface */
-    if (dstrect == NULL) {
-        fulldst.x = fulldst.y = 0;
-        fulldst.w = dst->w;
-        fulldst.h = dst->h;
-        dstrect = &fulldst;
-    }
-
-    /* clip the source rectangle to the source surface */
-    if (srcrect) {
-        int maxw, maxh;
-
-        final_src.x = srcrect->x;
-        final_src.w = srcrect->w;
-        if (final_src.x < 0) {
-            final_src.w += final_src.x;
-            final_src.x = 0;
-        }
-        maxw = src->w - final_src.x;
-        if (maxw < final_src.w)
-            final_src.w = maxw;
-
-        final_src.y = srcrect->y;
-        final_src.h = srcrect->h;
-        if (final_src.y < 0) {
-            final_src.h += final_src.y;
-            final_src.y = 0;
-        }
-        maxh = src->h - final_src.y;
-        if (maxh < final_src.h)
-            final_src.h = maxh;
-
-    } else {
-        final_src.x = final_src.y = 0;
-        final_src.w = src->w;
-        final_src.h = src->h;
-    }
-
-    /* clip the destination rectangle against the clip rectangle */
-    if (dstrect) {
-        int maxw, maxh;
-
-        final_dst.x = dstrect->x;
-        final_dst.w = dstrect->w;
-        if (final_dst.x < 0) {
-            final_dst.w += final_dst.x;
-            final_dst.x = 0;
-        }
-        maxw = dst->w - final_dst.x;
-        if (maxw < final_dst.w)
-            final_dst.w = maxw;
-
-        final_dst.y = dstrect->y;
-        final_dst.h = dstrect->h;
-        if (final_dst.y < 0) {
-            final_dst.h += final_dst.y;
-            final_dst.y = 0;
-        }
-        maxh = dst->h - final_dst.y;
-        if (maxh < final_dst.h)
-            final_dst.h = maxh;
-    } else {
-        final_dst.x = final_dst.y = 0;
-        final_dst.w = dst->w;
-        final_dst.h = dst->h;
-    }
-
-    if (final_dst.w > 0 && final_dst.h > 0) {
-        return SDL_LowerBlitScaled(src, &final_src, dst, &final_dst);
-    }
-
-    return 0;
-}
-
-/**
- *  This is a semi-private blit function and it performs low-level surface
- *  scaled blitting only.
- */
-int
-SDL_LowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect,
-                SDL_Surface * dst, SDL_Rect * dstrect)
-{
-    static const Uint32 complex_copy_flags = (
-        SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA |
-        SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD |
-        SDL_COPY_COLORKEY
-    );
-
-    /* Save off the original dst width, height */
-    int dstW = dstrect->w;
-    int dstH = dstrect->h;
-    SDL_Rect full_rect;
-    SDL_Rect final_dst = *dstrect;
-    SDL_Rect final_src = *srcrect;
-
-    /* Clip the dst surface to the dstrect */
-    full_rect.x = 0;
-    full_rect.y = 0;
-    full_rect.w = dst->w;
-    full_rect.h = dst->h;
-    if (!SDL_IntersectRect(&final_dst, &full_rect, &final_dst)) {
-        return 0;
-    }
-
-    /* Did the dst width change? */
-    if ( dstW != final_dst.w ) {
-        /* scale the src width appropriately */
-        final_src.w = final_src.w * dst->clip_rect.w / dstW;
-    }
-
-    /* Did the dst height change? */
-    if ( dstH != final_dst.h ) {
-        /* scale the src width appropriately */
-        final_src.h = final_src.h * dst->clip_rect.h / dstH;
-    }
-
-    /* Clip the src surface to the srcrect */
-    full_rect.x = 0;
-    full_rect.y = 0;
-    full_rect.w = src->w;
-    full_rect.h = src->h;
-    if (!SDL_IntersectRect(&final_src, &full_rect, &final_src)) {
-        return 0;
-    }
-
-    if (!(src->map->info.flags & SDL_COPY_NEAREST)) {
-        src->map->info.flags |= SDL_COPY_NEAREST;
-        SDL_InvalidateMap(src->map);
-    }
-
-    if ( !(src->map->info.flags & complex_copy_flags) &&
-         src->format->format == dst->format->format &&
-         !SDL_ISPIXELFORMAT_INDEXED(src->format->format) ) {
-        return SDL_SoftStretch( src, &final_src, dst, &final_dst );
-    } else {
-        return SDL_LowerBlit( src, &final_src, dst, &final_dst );
-    }
-}
-
-/*
- * Lock a surface to directly access the pixels
- */
-int
-SDL_LockSurface(SDL_Surface * surface)
-{
-    if (!surface->locked) {
-        /* Perform the lock */
-        if (surface->flags & SDL_RLEACCEL) {
-            SDL_UnRLESurface(surface, 1);
-            surface->flags |= SDL_RLEACCEL;     /* save accel'd state */
-        }
-    }
-
-    /* Increment the surface lock count, for recursive locks */
-    ++surface->locked;
-
-    /* Ready to go.. */
-    return (0);
-}
-
-/*
- * Unlock a previously locked surface
- */
-void
-SDL_UnlockSurface(SDL_Surface * surface)
-{
-    /* Only perform an unlock if we are locked */
-    if (!surface->locked || (--surface->locked > 0)) {
-        return;
-    }
-
-    /* Update RLE encoded surface with new data */
-    if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) {
-        surface->flags &= ~SDL_RLEACCEL;        /* stop lying */
-        SDL_RLESurface(surface);
-    }
-}
-
-/*
- * Convert a surface into the specified pixel format.
- */
-SDL_Surface *
-SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format,
-                   Uint32 flags)
-{
-    SDL_Surface *convert;
-    Uint32 copy_flags;
-    SDL_Color copy_color;
-    SDL_Rect bounds;
-
-    /* Check for empty destination palette! (results in empty image) */
-    if (format->palette != NULL) {
-        int i;
-        for (i = 0; i < format->palette->ncolors; ++i) {
-            if ((format->palette->colors[i].r != 0xFF) ||
-                (format->palette->colors[i].g != 0xFF) ||
-                (format->palette->colors[i].b != 0xFF))
-                break;
-        }
-        if (i == format->palette->ncolors) {
-            SDL_SetError("Empty destination palette");
-            return (NULL);
-        }
-    }
-
-    /* Create a new surface with the desired format */
-    convert = SDL_CreateRGBSurface(flags, surface->w, surface->h,
-                                   format->BitsPerPixel, format->Rmask,
-                                   format->Gmask, format->Bmask,
-                                   format->Amask);
-    if (convert == NULL) {
-        return (NULL);
-    }
-
-    /* Copy the palette if any */
-    if (format->palette && convert->format->palette) {
-        SDL_memcpy(convert->format->palette->colors,
-                   format->palette->colors,
-                   format->palette->ncolors * sizeof(SDL_Color));
-        convert->format->palette->ncolors = format->palette->ncolors;
-    }
-
-    /* Save the original copy flags */
-    copy_flags = surface->map->info.flags;
-    copy_color.r = surface->map->info.r;
-    copy_color.g = surface->map->info.g;
-    copy_color.b = surface->map->info.b;
-    copy_color.a = surface->map->info.a;
-    surface->map->info.r = 0xFF;
-    surface->map->info.g = 0xFF;
-    surface->map->info.b = 0xFF;
-    surface->map->info.a = 0xFF;
-    surface->map->info.flags = 0;
-    SDL_InvalidateMap(surface->map);
-
-    /* Copy over the image data */
-    bounds.x = 0;
-    bounds.y = 0;
-    bounds.w = surface->w;
-    bounds.h = surface->h;
-    SDL_LowerBlit(surface, &bounds, convert, &bounds);
-
-    /* Clean up the original surface, and update converted surface */
-    convert->map->info.r = copy_color.r;
-    convert->map->info.g = copy_color.g;
-    convert->map->info.b = copy_color.b;
-    convert->map->info.a = copy_color.a;
-    convert->map->info.flags =
-        (copy_flags &
-         ~(SDL_COPY_COLORKEY | SDL_COPY_BLEND
-           | SDL_COPY_RLE_DESIRED | SDL_COPY_RLE_COLORKEY |
-           SDL_COPY_RLE_ALPHAKEY));
-    surface->map->info.r = copy_color.r;
-    surface->map->info.g = copy_color.g;
-    surface->map->info.b = copy_color.b;
-    surface->map->info.a = copy_color.a;
-    surface->map->info.flags = copy_flags;
-    SDL_InvalidateMap(surface->map);
-    if (copy_flags & SDL_COPY_COLORKEY) {
-        SDL_bool set_colorkey_by_color = SDL_FALSE;
-
-        if (surface->format->palette) {
-            if (format->palette &&
-                surface->format->palette->ncolors <= format->palette->ncolors &&
-                (SDL_memcmp(surface->format->palette->colors, format->palette->colors,
-                  surface->format->palette->ncolors * sizeof(SDL_Color)) == 0)) {
-                /* The palette is identical, just set the same colorkey */
-                SDL_SetColorKey(convert, 1, surface->map->info.colorkey);
-            } else if (format->Amask) {
-                /* The alpha was set in the destination from the palette */
-            } else {
-                set_colorkey_by_color = SDL_TRUE;
-            }
-        } else {
-            set_colorkey_by_color = SDL_TRUE;
-        }
-
-        if (set_colorkey_by_color) {
-            /* Set the colorkey by color, which needs to be unique */
-            Uint8 keyR, keyG, keyB, keyA;
-
-            SDL_GetRGBA(surface->map->info.colorkey, surface->format, &keyR,
-                        &keyG, &keyB, &keyA);
-            SDL_SetColorKey(convert, 1,
-                            SDL_MapRGBA(convert->format, keyR, keyG, keyB, keyA));
-            /* This is needed when converting for 3D texture upload */
-            SDL_ConvertColorkeyToAlpha(convert);
-        }
-    }
-    SDL_SetClipRect(convert, &surface->clip_rect);
-
-    /* Enable alpha blending by default if the new surface has an
-     * alpha channel or alpha modulation */
-    if ((surface->format->Amask && format->Amask) ||
-        (copy_flags & (SDL_COPY_COLORKEY|SDL_COPY_MODULATE_ALPHA))) {
-        SDL_SetSurfaceBlendMode(convert, SDL_BLENDMODE_BLEND);
-    }
-    if ((copy_flags & SDL_COPY_RLE_DESIRED) || (flags & SDL_RLEACCEL)) {
-        SDL_SetSurfaceRLE(convert, SDL_RLEACCEL);
-    }
-
-    /* We're ready to go! */
-    return (convert);
-}
-
-SDL_Surface *
-SDL_ConvertSurfaceFormat(SDL_Surface * surface, Uint32 pixel_format,
-                         Uint32 flags)
-{
-    SDL_PixelFormat *fmt;
-    SDL_Surface *convert = NULL;
-
-    fmt = SDL_AllocFormat(pixel_format);
-    if (fmt) {
-        convert = SDL_ConvertSurface(surface, fmt, flags);
-        SDL_FreeFormat(fmt);
-    }
-    return convert;
-}
-
-/*
- * Create a surface on the stack for quick blit operations
- */
-static SDL_INLINE SDL_bool
-SDL_CreateSurfaceOnStack(int width, int height, Uint32 pixel_format,
-                         void * pixels, int pitch, SDL_Surface * surface,
-                         SDL_PixelFormat * format, SDL_BlitMap * blitmap)
-{
-    if (SDL_ISPIXELFORMAT_INDEXED(pixel_format)) {
-        SDL_SetError("Indexed pixel formats not supported");
-        return SDL_FALSE;
-    }
-    if (SDL_InitFormat(format, pixel_format) < 0) {
-        return SDL_FALSE;
-    }
-
-    SDL_zerop(surface);
-    surface->flags = SDL_PREALLOC;
-    surface->format = format;
-    surface->pixels = pixels;
-    surface->w = width;
-    surface->h = height;
-    surface->pitch = pitch;
-    /* We don't actually need to set up the clip rect for our purposes */
-    /* SDL_SetClipRect(surface, NULL); */
-
-    /* Allocate an empty mapping */
-    SDL_zerop(blitmap);
-    blitmap->info.r = 0xFF;
-    blitmap->info.g = 0xFF;
-    blitmap->info.b = 0xFF;
-    blitmap->info.a = 0xFF;
-    surface->map = blitmap;
-
-    /* The surface is ready to go */
-    surface->refcount = 1;
-    return SDL_TRUE;
-}
-
-/*
- * Copy a block of pixels of one format to another format
- */
-int SDL_ConvertPixels(int width, int height,
-                      Uint32 src_format, const void * src, int src_pitch,
-                      Uint32 dst_format, void * dst, int dst_pitch)
-{
-    SDL_Surface src_surface, dst_surface;
-    SDL_PixelFormat src_fmt, dst_fmt;
-    SDL_BlitMap src_blitmap, dst_blitmap;
-    SDL_Rect rect;
-    void *nonconst_src = (void *) src;
-
-    /* Check to make sure we are bliting somewhere, so we don't crash */
-    if (!dst) {
-        return SDL_InvalidParamError("dst");
-    }
-    if (!dst_pitch) {
-        return SDL_InvalidParamError("dst_pitch");
-    }
-
-    /* Fast path for same format copy */
-    if (src_format == dst_format) {
-        int bpp;
-
-        if (SDL_ISPIXELFORMAT_FOURCC(src_format)) {
-            switch (src_format) {
-            case SDL_PIXELFORMAT_YV12:
-            case SDL_PIXELFORMAT_IYUV:
-            case SDL_PIXELFORMAT_YUY2:
-            case SDL_PIXELFORMAT_UYVY:
-            case SDL_PIXELFORMAT_YVYU:
-                bpp = 2;
-                break;
-            default:
-                return SDL_SetError("Unknown FOURCC pixel format");
-            }
-        } else {
-            bpp = SDL_BYTESPERPIXEL(src_format);
-        }
-        width *= bpp;
-
-        while (height-- > 0) {
-            SDL_memcpy(dst, src, width);
-            src = (Uint8*)src + src_pitch;
-            dst = (Uint8*)dst + dst_pitch;
-        }
-        return 0;
-    }
-
-    if (!SDL_CreateSurfaceOnStack(width, height, src_format, nonconst_src,
-                                  src_pitch,
-                                  &src_surface, &src_fmt, &src_blitmap)) {
-        return -1;
-    }
-    if (!SDL_CreateSurfaceOnStack(width, height, dst_format, dst, dst_pitch,
-                                  &dst_surface, &dst_fmt, &dst_blitmap)) {
-        return -1;
-    }
-
-    /* Set up the rect and go! */
-    rect.x = 0;
-    rect.y = 0;
-    rect.w = width;
-    rect.h = height;
-    return SDL_LowerBlit(&src_surface, &rect, &dst_surface, &rect);
-}
-
-/*
- * Free a surface created by the above function.
- */
-void
-SDL_FreeSurface(SDL_Surface * surface)
-{
-    if (surface == NULL) {
-        return;
-    }
-    if (surface->flags & SDL_DONTFREE) {
-        return;
-    }
-    if (--surface->refcount > 0) {
-        return;
-    }
-    while (surface->locked > 0) {
-        SDL_UnlockSurface(surface);
-    }
-    if (surface->flags & SDL_RLEACCEL) {
-        SDL_UnRLESurface(surface, 0);
-    }
-    if (surface->format) {
-        SDL_SetSurfacePalette(surface, NULL);
-        SDL_FreeFormat(surface->format);
-        surface->format = NULL;
-    }
-    if (surface->map != NULL) {
-        SDL_FreeBlitMap(surface->map);
-        surface->map = NULL;
-    }
-    if (!(surface->flags & SDL_PREALLOC)) {
-        SDL_free(surface->pixels);
-    }
-    SDL_free(surface);
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_sysvideo.h b/deps/SDL2/src/video/SDL_sysvideo.h
deleted file mode 100644
index 2d41234..0000000
--- a/deps/SDL2/src/video/SDL_sysvideo.h
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_sysvideo_h
-#define _SDL_sysvideo_h
-
-#include "SDL_messagebox.h"
-#include "SDL_shape.h"
-#include "SDL_thread.h"
-
-/* The SDL video driver */
-
-typedef struct SDL_WindowShaper SDL_WindowShaper;
-typedef struct SDL_ShapeDriver SDL_ShapeDriver;
-typedef struct SDL_VideoDisplay SDL_VideoDisplay;
-typedef struct SDL_VideoDevice SDL_VideoDevice;
-
-/* Define the SDL window-shaper structure */
-struct SDL_WindowShaper
-{
-    /* The window associated with the shaper */
-    SDL_Window *window;
-
-    /* The user's specified coordinates for the window, for once we give it a shape. */
-    Uint32 userx,usery;
-
-    /* The parameters for shape calculation. */
-    SDL_WindowShapeMode mode;
-
-    /* Has this window been assigned a shape? */
-    SDL_bool hasshape;
-
-    void *driverdata;
-};
-
-/* Define the SDL shape driver structure */
-struct SDL_ShapeDriver
-{
-    SDL_WindowShaper *(*CreateShaper)(SDL_Window * window);
-    int (*SetWindowShape)(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
-    int (*ResizeWindowShape)(SDL_Window *window);
-};
-
-typedef struct SDL_WindowUserData
-{
-    char *name;
-    void *data;
-    struct SDL_WindowUserData *next;
-} SDL_WindowUserData;
-
-/* Define the SDL window structure, corresponding to toplevel windows */
-struct SDL_Window
-{
-    const void *magic;
-    Uint32 id;
-    char *title;
-    SDL_Surface *icon;
-    int x, y;
-    int w, h;
-    int min_w, min_h;
-    int max_w, max_h;
-    Uint32 flags;
-
-    /* Stored position and size for windowed mode */
-    SDL_Rect windowed;
-
-    SDL_DisplayMode fullscreen_mode;
-
-    float brightness;
-    Uint16 *gamma;
-    Uint16 *saved_gamma;        /* (just offset into gamma) */
-
-    SDL_Surface *surface;
-    SDL_bool surface_valid;
-
-    SDL_WindowShaper *shaper;
-
-    SDL_WindowUserData *data;
-
-    void *driverdata;
-
-    SDL_Window *prev;
-    SDL_Window *next;
-};
-#define FULLSCREEN_VISIBLE(W) \
-    (((W)->flags & SDL_WINDOW_FULLSCREEN) && \
-     ((W)->flags & SDL_WINDOW_SHOWN) && \
-     !((W)->flags & SDL_WINDOW_MINIMIZED))
-
-/*
- * Define the SDL display structure This corresponds to physical monitors
- * attached to the system.
- */
-struct SDL_VideoDisplay
-{
-    char *name;
-    int max_display_modes;
-    int num_display_modes;
-    SDL_DisplayMode *display_modes;
-    SDL_DisplayMode desktop_mode;
-    SDL_DisplayMode current_mode;
-
-    SDL_Window *fullscreen_window;
-
-    SDL_VideoDevice *device;
-
-    void *driverdata;
-};
-
-/* Forward declaration */
-struct SDL_SysWMinfo;
-
-/* Define the SDL video driver structure */
-#define _THIS   SDL_VideoDevice *_this
-
-struct SDL_VideoDevice
-{
-    /* * * */
-    /* The name of this video driver */
-    const char *name;
-
-    /* * * */
-    /* Initialization/Query functions */
-
-    /*
-     * Initialize the native video subsystem, filling in the list of
-     * displays for this driver, returning 0 or -1 if there's an error.
-     */
-    int (*VideoInit) (_THIS);
-
-    /*
-     * Reverse the effects VideoInit() -- called if VideoInit() fails or
-     * if the application is shutting down the video subsystem.
-     */
-    void (*VideoQuit) (_THIS);
-
-    /* * * */
-    /*
-     * Display functions
-     */
-
-    /*
-     * Get the bounds of a display
-     */
-    int (*GetDisplayBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect);
-
-    /*
-     * Get a list of the available display modes for a display.
-     */
-    void (*GetDisplayModes) (_THIS, SDL_VideoDisplay * display);
-
-    /*
-     * Setting the display mode is independent of creating windows, so
-     * when the display mode is changed, all existing windows should have
-     * their data updated accordingly, including the display surfaces
-     * associated with them.
-     */
-    int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-
-    /* * * */
-    /*
-     * Window functions
-     */
-    int (*CreateWindow) (_THIS, SDL_Window * window);
-    int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data);
-    void (*SetWindowTitle) (_THIS, SDL_Window * window);
-    void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon);
-    void (*SetWindowPosition) (_THIS, SDL_Window * window);
-    void (*SetWindowSize) (_THIS, SDL_Window * window);
-    void (*SetWindowMinimumSize) (_THIS, SDL_Window * window);
-    void (*SetWindowMaximumSize) (_THIS, SDL_Window * window);
-    void (*ShowWindow) (_THIS, SDL_Window * window);
-    void (*HideWindow) (_THIS, SDL_Window * window);
-    void (*RaiseWindow) (_THIS, SDL_Window * window);
-    void (*MaximizeWindow) (_THIS, SDL_Window * window);
-    void (*MinimizeWindow) (_THIS, SDL_Window * window);
-    void (*RestoreWindow) (_THIS, SDL_Window * window);
-    void (*SetWindowBordered) (_THIS, SDL_Window * window, SDL_bool bordered);
-    void (*SetWindowFullscreen) (_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
-    int (*SetWindowGammaRamp) (_THIS, SDL_Window * window, const Uint16 * ramp);
-    int (*GetWindowGammaRamp) (_THIS, SDL_Window * window, Uint16 * ramp);
-    void (*SetWindowGrab) (_THIS, SDL_Window * window, SDL_bool grabbed);
-    void (*DestroyWindow) (_THIS, SDL_Window * window);
-    int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
-    int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
-    void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);
-    void (*OnWindowEnter) (_THIS, SDL_Window * window);
-
-    /* * * */
-    /*
-     * Shaped-window functions
-     */
-    SDL_ShapeDriver shape_driver;
-
-    /* Get some platform dependent window information */
-      SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window,
-                                  struct SDL_SysWMinfo * info);
-
-    /* * * */
-    /*
-     * OpenGL support
-     */
-    int (*GL_LoadLibrary) (_THIS, const char *path);
-    void *(*GL_GetProcAddress) (_THIS, const char *proc);
-    void (*GL_UnloadLibrary) (_THIS);
-      SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window);
-    int (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context);
-    void (*GL_GetDrawableSize) (_THIS, SDL_Window * window, int *w, int *h);
-    int (*GL_SetSwapInterval) (_THIS, int interval);
-    int (*GL_GetSwapInterval) (_THIS);
-    void (*GL_SwapWindow) (_THIS, SDL_Window * window);
-    void (*GL_DeleteContext) (_THIS, SDL_GLContext context);
-
-    /* * * */
-    /*
-     * Event manager functions
-     */
-    void (*PumpEvents) (_THIS);
-
-    /* Suspend the screensaver */
-    void (*SuspendScreenSaver) (_THIS);
-
-    /* Text input */
-    void (*StartTextInput) (_THIS);
-    void (*StopTextInput) (_THIS);
-    void (*SetTextInputRect) (_THIS, SDL_Rect *rect);
-
-    /* Screen keyboard */
-    SDL_bool (*HasScreenKeyboardSupport) (_THIS);
-    void (*ShowScreenKeyboard) (_THIS, SDL_Window *window);
-    void (*HideScreenKeyboard) (_THIS, SDL_Window *window);
-    SDL_bool (*IsScreenKeyboardShown) (_THIS, SDL_Window *window);
-
-    /* Clipboard */
-    int (*SetClipboardText) (_THIS, const char *text);
-    char * (*GetClipboardText) (_THIS);
-    SDL_bool (*HasClipboardText) (_THIS);
-
-    /* MessageBox */
-    int (*ShowMessageBox) (_THIS, const SDL_MessageBoxData *messageboxdata, int *buttonid);
-
-    /* * * */
-    /* Data common to all drivers */
-    SDL_bool suspend_screensaver;
-    int num_displays;
-    SDL_VideoDisplay *displays;
-    SDL_Window *windows;
-    Uint8 window_magic;
-    Uint32 next_object_id;
-    char * clipboard_text;
-
-    /* * * */
-    /* Data used by the GL drivers */
-    struct
-    {
-        int red_size;
-        int green_size;
-        int blue_size;
-        int alpha_size;
-        int depth_size;
-        int buffer_size;
-        int stencil_size;
-        int double_buffer;
-        int accum_red_size;
-        int accum_green_size;
-        int accum_blue_size;
-        int accum_alpha_size;
-        int stereo;
-        int multisamplebuffers;
-        int multisamplesamples;
-        int accelerated;
-        int major_version;
-        int minor_version;
-        int flags;
-        int profile_mask;
-        int share_with_current_context;
-        int framebuffer_srgb_capable;
-        int retained_backing;
-        int driver_loaded;
-        char driver_path[256];
-        void *dll_handle;
-    } gl_config;
-
-    /* * * */
-    /* Cache current GL context; don't call the OS when it hasn't changed. */
-    /* We have the global pointers here so Cocoa continues to work the way
-       it always has, and the thread-local storage for the general case.
-     */
-    SDL_Window *current_glwin;
-    SDL_GLContext current_glctx;
-    SDL_TLSID current_glwin_tls;
-    SDL_TLSID current_glctx_tls;
-
-    /* * * */
-    /* Data private to this driver */
-    void *driverdata;
-    struct SDL_GLDriverData *gl_data;
-    
-#if SDL_VIDEO_OPENGL_EGL
-    struct SDL_EGL_VideoData *egl_data;
-#endif
-    
-#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
-    struct SDL_PrivateGLESData *gles_data;
-#endif
-
-    /* * * */
-    /* The function used to dispose of this structure */
-    void (*free) (_THIS);
-};
-
-typedef struct VideoBootStrap
-{
-    const char *name;
-    const char *desc;
-    int (*available) (void);
-    SDL_VideoDevice *(*create) (int devindex);
-} VideoBootStrap;
-
-#if SDL_VIDEO_DRIVER_COCOA
-extern VideoBootStrap COCOA_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_X11
-extern VideoBootStrap X11_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DIRECTFB
-extern VideoBootStrap DirectFB_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_WINDOWS
-extern VideoBootStrap WINDOWS_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_BWINDOW
-extern VideoBootStrap BWINDOW_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_PANDORA
-extern VideoBootStrap PND_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_UIKIT
-extern VideoBootStrap UIKIT_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_ANDROID
-extern VideoBootStrap Android_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_PSP
-extern VideoBootStrap PSP_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_RPI
-extern VideoBootStrap RPI_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DUMMY
-extern VideoBootStrap DUMMY_bootstrap;
-#endif
-
-extern SDL_VideoDevice *SDL_GetVideoDevice(void);
-extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
-extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
-extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode);
-extern SDL_VideoDisplay *SDL_GetDisplayForWindow(SDL_Window *window);
-extern void *SDL_GetDisplayDriverData( int displayIndex );
-
-extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
-
-extern void SDL_OnWindowShown(SDL_Window * window);
-extern void SDL_OnWindowHidden(SDL_Window * window);
-extern void SDL_OnWindowResized(SDL_Window * window);
-extern void SDL_OnWindowMinimized(SDL_Window * window);
-extern void SDL_OnWindowRestored(SDL_Window * window);
-extern void SDL_OnWindowEnter(SDL_Window * window);
-extern void SDL_OnWindowLeave(SDL_Window * window);
-extern void SDL_OnWindowFocusGained(SDL_Window * window);
-extern void SDL_OnWindowFocusLost(SDL_Window * window);
-extern void SDL_UpdateWindowGrab(SDL_Window * window);
-extern SDL_Window * SDL_GetFocusWindow(void);
-
-extern SDL_bool SDL_ShouldAllowTopmost(void);
-
-#endif /* _SDL_sysvideo_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/SDL_video.c b/deps/SDL2/src/video/SDL_video.c
deleted file mode 100644
index 613bf4c..0000000
--- a/deps/SDL2/src/video/SDL_video.c
+++ /dev/null
@@ -1,3239 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* The high-level video driver subsystem */
-
-#include "SDL.h"
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_blit.h"
-#include "SDL_pixels_c.h"
-#include "SDL_rect_c.h"
-#include "../events/SDL_events_c.h"
-#include "../timer/SDL_timer_c.h"
-
-#if SDL_VIDEO_OPENGL
-#include "SDL_opengl.h"
-#endif /* SDL_VIDEO_OPENGL */
-
-#if SDL_VIDEO_OPENGL_ES
-#include "SDL_opengles.h"
-#endif /* SDL_VIDEO_OPENGL_ES */
-
-/* GL and GLES2 headers conflict on Linux 32 bits */
-#if SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL
-#include "SDL_opengles2.h"
-#endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */
-
-#include "SDL_syswm.h"
-
-/* On Windows, windows.h defines CreateWindow */
-#ifdef CreateWindow
-#undef CreateWindow
-#endif
-
-/* Available video drivers */
-static VideoBootStrap *bootstrap[] = {
-#if SDL_VIDEO_DRIVER_COCOA
-    &COCOA_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_X11
-    &X11_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_DIRECTFB
-    &DirectFB_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_WINDOWS
-    &WINDOWS_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_BWINDOW
-    &BWINDOW_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_PANDORA
-    &PND_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_UIKIT
-    &UIKIT_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_ANDROID
-    &Android_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_PSP
-    &PSP_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_RPI
-    &RPI_bootstrap,
-#endif 
-#if SDL_VIDEO_DRIVER_DUMMY
-    &DUMMY_bootstrap,
-#endif
-    NULL
-};
-
-static SDL_VideoDevice *_this = NULL;
-
-#define CHECK_WINDOW_MAGIC(window, retval) \
-    if (!_this) { \
-        SDL_UninitializedVideo(); \
-        return retval; \
-    } \
-    if (!window || window->magic != &_this->window_magic) { \
-        SDL_SetError("Invalid window"); \
-        return retval; \
-    }
-
-#define CHECK_DISPLAY_INDEX(displayIndex, retval) \
-    if (!_this) { \
-        SDL_UninitializedVideo(); \
-        return retval; \
-    } \
-    if (displayIndex < 0 || displayIndex >= _this->num_displays) { \
-        SDL_SetError("displayIndex must be in the range 0 - %d", \
-                     _this->num_displays - 1); \
-        return retval; \
-    }
-
-/* Support for framebuffer emulation using an accelerated renderer */
-
-#define SDL_WINDOWTEXTUREDATA   "_SDL_WindowTextureData"
-
-typedef struct {
-    SDL_Renderer *renderer;
-    SDL_Texture *texture;
-    void *pixels;
-    int pitch;
-    int bytes_per_pixel;
-} SDL_WindowTextureData;
-
-static SDL_bool
-ShouldUseTextureFramebuffer()
-{
-    const char *hint;
-
-    /* If there's no native framebuffer support then there's no option */
-    if (!_this->CreateWindowFramebuffer) {
-        return SDL_TRUE;
-    }
-
-    /* If the user has specified a software renderer we can't use a
-       texture framebuffer, or renderer creation will go recursive.
-     */
-    hint = SDL_GetHint(SDL_HINT_RENDER_DRIVER);
-    if (hint && SDL_strcasecmp(hint, "software") == 0) {
-        return SDL_FALSE;
-    }
-
-    /* See if the user or application wants a specific behavior */
-    hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION);
-    if (hint) {
-        if (*hint == '0') {
-            return SDL_FALSE;
-        } else {
-            return SDL_TRUE;
-        }
-    }
-
-    /* Each platform has different performance characteristics */
-#if defined(__WIN32__)
-    /* GDI BitBlt() is way faster than Direct3D dynamic textures right now.
-     */
-    return SDL_FALSE;
-
-#elif defined(__MACOSX__)
-    /* Mac OS X uses OpenGL as the native fast path */
-    return SDL_TRUE;
-
-#elif defined(__LINUX__)
-    /* Properly configured OpenGL drivers are faster than MIT-SHM */
-#if SDL_VIDEO_OPENGL
-    /* Ugh, find a way to cache this value! */
-    {
-        SDL_Window *window;
-        SDL_GLContext context;
-        SDL_bool hasAcceleratedOpenGL = SDL_FALSE;
-
-        window = SDL_CreateWindow("OpenGL test", -32, -32, 32, 32, SDL_WINDOW_OPENGL|SDL_WINDOW_HIDDEN);
-        if (window) {
-            context = SDL_GL_CreateContext(window);
-            if (context) {
-                const GLubyte *(APIENTRY * glGetStringFunc) (GLenum);
-                const char *vendor = NULL;
-
-                glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
-                if (glGetStringFunc) {
-                    vendor = (const char *) glGetStringFunc(GL_VENDOR);
-                }
-                /* Add more vendors here at will... */
-                if (vendor &&
-                    (SDL_strstr(vendor, "ATI Technologies") ||
-                     SDL_strstr(vendor, "NVIDIA"))) {
-                    hasAcceleratedOpenGL = SDL_TRUE;
-                }
-                SDL_GL_DeleteContext(context);
-            }
-            SDL_DestroyWindow(window);
-        }
-        return hasAcceleratedOpenGL;
-    }
-#elif SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
-    /* Let's be optimistic about this! */
-    return SDL_TRUE;
-#else
-    return SDL_FALSE;
-#endif
-
-#else
-    /* Play it safe, assume that if there is a framebuffer driver that it's
-       optimized for the current platform.
-    */
-    return SDL_FALSE;
-#endif
-}
-
-static int
-SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
-{
-    SDL_WindowTextureData *data;
-    SDL_RendererInfo info;
-    Uint32 i;
-
-    data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA);
-    if (!data) {
-        SDL_Renderer *renderer = NULL;
-        SDL_RendererInfo info;
-        int i;
-        const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION);
-
-        /* Check to see if there's a specific driver requested */
-        if (hint && *hint != '0' && *hint != '1' &&
-            SDL_strcasecmp(hint, "software") != 0) {
-            for (i = 0; i < SDL_GetNumRenderDrivers(); ++i) {
-                SDL_GetRenderDriverInfo(i, &info);
-                if (SDL_strcasecmp(info.name, hint) == 0) {
-                    renderer = SDL_CreateRenderer(window, i, 0);
-                    break;
-                }
-            }
-        }
-
-        if (!renderer) {
-            for (i = 0; i < SDL_GetNumRenderDrivers(); ++i) {
-                SDL_GetRenderDriverInfo(i, &info);
-                if (SDL_strcmp(info.name, "software") != 0) {
-                    renderer = SDL_CreateRenderer(window, i, 0);
-                    if (renderer) {
-                        break;
-                    }
-                }
-            }
-        }
-        if (!renderer) {
-            return SDL_SetError("No hardware accelerated renderers available");
-        }
-
-        /* Create the data after we successfully create the renderer (bug #1116) */
-        data = (SDL_WindowTextureData *)SDL_calloc(1, sizeof(*data));
-        if (!data) {
-            SDL_DestroyRenderer(renderer);
-            return SDL_OutOfMemory();
-        }
-        SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, data);
-
-        data->renderer = renderer;
-    }
-
-    /* Free any old texture and pixel data */
-    if (data->texture) {
-        SDL_DestroyTexture(data->texture);
-        data->texture = NULL;
-    }
-    SDL_free(data->pixels);
-    data->pixels = NULL;
-
-    if (SDL_GetRendererInfo(data->renderer, &info) < 0) {
-        return -1;
-    }
-
-    /* Find the first format without an alpha channel */
-    *format = info.texture_formats[0];
-    for (i = 0; i < info.num_texture_formats; ++i) {
-        if (!SDL_ISPIXELFORMAT_FOURCC(info.texture_formats[i]) &&
-            !SDL_ISPIXELFORMAT_ALPHA(info.texture_formats[i])) {
-            *format = info.texture_formats[i];
-            break;
-        }
-    }
-
-    data->texture = SDL_CreateTexture(data->renderer, *format,
-                                      SDL_TEXTUREACCESS_STREAMING,
-                                      window->w, window->h);
-    if (!data->texture) {
-        return -1;
-    }
-
-    /* Create framebuffer data */
-    data->bytes_per_pixel = SDL_BYTESPERPIXEL(*format);
-    data->pitch = (((window->w * data->bytes_per_pixel) + 3) & ~3);
-    data->pixels = SDL_malloc(window->h * data->pitch);
-    if (!data->pixels) {
-        return SDL_OutOfMemory();
-    }
-
-    *pixels = data->pixels;
-    *pitch = data->pitch;
-
-    /* Make sure we're not double-scaling the viewport */
-    SDL_RenderSetViewport(data->renderer, NULL);
-
-    return 0;
-}
-
-static int
-SDL_UpdateWindowTexture(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
-{
-    SDL_WindowTextureData *data;
-    SDL_Rect rect;
-    void *src;
-
-    data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA);
-    if (!data || !data->texture) {
-        return SDL_SetError("No window texture data");
-    }
-
-    /* Update a single rect that contains subrects for best DMA performance */
-    if (SDL_GetSpanEnclosingRect(window->w, window->h, numrects, rects, &rect)) {
-        src = (void *)((Uint8 *)data->pixels +
-                        rect.y * data->pitch +
-                        rect.x * data->bytes_per_pixel);
-        if (SDL_UpdateTexture(data->texture, &rect, src, data->pitch) < 0) {
-            return -1;
-        }
-
-        if (SDL_RenderCopy(data->renderer, data->texture, NULL, NULL) < 0) {
-            return -1;
-        }
-
-        SDL_RenderPresent(data->renderer);
-    }
-    return 0;
-}
-
-static void
-SDL_DestroyWindowTexture(_THIS, SDL_Window * window)
-{
-    SDL_WindowTextureData *data;
-
-    data = SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, NULL);
-    if (!data) {
-        return;
-    }
-    if (data->texture) {
-        SDL_DestroyTexture(data->texture);
-    }
-    if (data->renderer) {
-        SDL_DestroyRenderer(data->renderer);
-    }
-    SDL_free(data->pixels);
-    SDL_free(data);
-}
-
-
-static int
-cmpmodes(const void *A, const void *B)
-{
-    const SDL_DisplayMode *a = (const SDL_DisplayMode *) A;
-    const SDL_DisplayMode *b = (const SDL_DisplayMode *) B;
-    if (a == b) {
-        return 0;
-    } else if (a->w != b->w) {
-        return b->w - a->w;
-    } else if (a->h != b->h) {
-        return b->h - a->h;
-    } else if (SDL_BITSPERPIXEL(a->format) != SDL_BITSPERPIXEL(b->format)) {
-        return SDL_BITSPERPIXEL(b->format) - SDL_BITSPERPIXEL(a->format);
-    } else if (SDL_PIXELLAYOUT(a->format) != SDL_PIXELLAYOUT(b->format)) {
-        return SDL_PIXELLAYOUT(b->format) - SDL_PIXELLAYOUT(a->format);
-    } else if (a->refresh_rate != b->refresh_rate) {
-        return b->refresh_rate - a->refresh_rate;
-    }
-    return 0;
-}
-
-static int
-SDL_UninitializedVideo()
-{
-    return SDL_SetError("Video subsystem has not been initialized");
-}
-
-int
-SDL_GetNumVideoDrivers(void)
-{
-    return SDL_arraysize(bootstrap) - 1;
-}
-
-const char *
-SDL_GetVideoDriver(int index)
-{
-    if (index >= 0 && index < SDL_GetNumVideoDrivers()) {
-        return bootstrap[index]->name;
-    }
-    return NULL;
-}
-
-/*
- * Initialize the video and event subsystems -- determine native pixel format
- */
-int
-SDL_VideoInit(const char *driver_name)
-{
-    SDL_VideoDevice *video;
-    int index;
-    int i;
-
-    /* Check to make sure we don't overwrite '_this' */
-    if (_this != NULL) {
-        SDL_VideoQuit();
-    }
-
-#if !SDL_TIMERS_DISABLED
-    SDL_InitTicks();
-#endif
-
-    /* Start the event loop */
-    if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0 ||
-        SDL_KeyboardInit() < 0 ||
-        SDL_MouseInit() < 0 ||
-        SDL_TouchInit() < 0) {
-        return -1;
-    }
-
-    /* Select the proper video driver */
-    index = 0;
-    video = NULL;
-    if (driver_name == NULL) {
-        driver_name = SDL_getenv("SDL_VIDEODRIVER");
-    }
-    if (driver_name != NULL) {
-        for (i = 0; bootstrap[i]; ++i) {
-            if (SDL_strncasecmp(bootstrap[i]->name, driver_name, SDL_strlen(driver_name)) == 0) {
-                video = bootstrap[i]->create(index);
-                break;
-            }
-        }
-    } else {
-        for (i = 0; bootstrap[i]; ++i) {
-            if (bootstrap[i]->available()) {
-                video = bootstrap[i]->create(index);
-                if (video != NULL) {
-                    break;
-                }
-            }
-        }
-    }
-    if (video == NULL) {
-        if (driver_name) {
-            return SDL_SetError("%s not available", driver_name);
-        }
-        return SDL_SetError("No available video device");
-    }
-    _this = video;
-    _this->name = bootstrap[i]->name;
-    _this->next_object_id = 1;
-
-
-    /* Set some very sane GL defaults */
-    _this->gl_config.driver_loaded = 0;
-    _this->gl_config.dll_handle = NULL;
-    _this->gl_config.red_size = 3;
-    _this->gl_config.green_size = 3;
-    _this->gl_config.blue_size = 2;
-    _this->gl_config.alpha_size = 0;
-    _this->gl_config.buffer_size = 0;
-    _this->gl_config.depth_size = 16;
-    _this->gl_config.stencil_size = 0;
-    _this->gl_config.double_buffer = 1;
-    _this->gl_config.accum_red_size = 0;
-    _this->gl_config.accum_green_size = 0;
-    _this->gl_config.accum_blue_size = 0;
-    _this->gl_config.accum_alpha_size = 0;
-    _this->gl_config.stereo = 0;
-    _this->gl_config.multisamplebuffers = 0;
-    _this->gl_config.multisamplesamples = 0;
-    _this->gl_config.retained_backing = 1;
-    _this->gl_config.accelerated = -1;  /* accelerated or not, both are fine */
-    _this->gl_config.profile_mask = 0;
-#if SDL_VIDEO_OPENGL
-    _this->gl_config.major_version = 2;
-    _this->gl_config.minor_version = 1;
-#elif SDL_VIDEO_OPENGL_ES2
-    _this->gl_config.major_version = 2;
-    _this->gl_config.minor_version = 0;
-    _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES;   
-#elif SDL_VIDEO_OPENGL_ES
-    _this->gl_config.major_version = 1;
-    _this->gl_config.minor_version = 1;
-    _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES;
-#endif
-    _this->gl_config.flags = 0;
-    
-    _this->gl_config.share_with_current_context = 0;
-
-    _this->current_glwin_tls = SDL_TLSCreate();
-    _this->current_glctx_tls = SDL_TLSCreate();
-
-    /* Initialize the video subsystem */
-    if (_this->VideoInit(_this) < 0) {
-        SDL_VideoQuit();
-        return -1;
-    }
-
-    /* Make sure some displays were added */
-    if (_this->num_displays == 0) {
-        SDL_VideoQuit();
-        return SDL_SetError("The video driver did not add any displays");
-    }
-
-    /* Add the renderer framebuffer emulation if desired */
-    if (ShouldUseTextureFramebuffer()) {
-        _this->CreateWindowFramebuffer = SDL_CreateWindowTexture;
-        _this->UpdateWindowFramebuffer = SDL_UpdateWindowTexture;
-        _this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture;
-    }
-
-    /* If we don't use a screen keyboard, turn on text input by default,
-       otherwise programs that expect to get text events without enabling
-       UNICODE input won't get any events.
-
-       Actually, come to think of it, you needed to call SDL_EnableUNICODE(1)
-       in SDL 1.2 before you got text input events.  Hmm...
-     */
-    if (!SDL_HasScreenKeyboardSupport()) {
-        SDL_StartTextInput();
-    }
-
-    /* We're ready to go! */
-    return 0;
-}
-
-const char *
-SDL_GetCurrentVideoDriver()
-{
-    if (!_this) {
-        SDL_UninitializedVideo();
-        return NULL;
-    }
-    return _this->name;
-}
-
-SDL_VideoDevice *
-SDL_GetVideoDevice(void)
-{
-    return _this;
-}
-
-int
-SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode)
-{
-    SDL_VideoDisplay display;
-
-    SDL_zero(display);
-    if (desktop_mode) {
-        display.desktop_mode = *desktop_mode;
-    }
-    display.current_mode = display.desktop_mode;
-
-    return SDL_AddVideoDisplay(&display);
-}
-
-int
-SDL_AddVideoDisplay(const SDL_VideoDisplay * display)
-{
-    SDL_VideoDisplay *displays;
-    int index = -1;
-
-    displays =
-        SDL_realloc(_this->displays,
-                    (_this->num_displays + 1) * sizeof(*displays));
-    if (displays) {
-        index = _this->num_displays++;
-        displays[index] = *display;
-        displays[index].device = _this;
-        _this->displays = displays;
-
-        if (display->name) {
-            displays[index].name = SDL_strdup(display->name);
-        } else {
-            char name[32];
-
-            SDL_itoa(index, name, 10);
-            displays[index].name = SDL_strdup(name);
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return index;
-}
-
-int
-SDL_GetNumVideoDisplays(void)
-{
-    if (!_this) {
-        SDL_UninitializedVideo();
-        return 0;
-    }
-    return _this->num_displays;
-}
-
-static int
-SDL_GetIndexOfDisplay(SDL_VideoDisplay *display)
-{
-    int displayIndex;
-
-    for (displayIndex = 0; displayIndex < _this->num_displays; ++displayIndex) {
-        if (display == &_this->displays[displayIndex]) {
-            return displayIndex;
-        }
-    }
-
-    /* Couldn't find the display, just use index 0 */
-    return 0;
-}
-
-void *
-SDL_GetDisplayDriverData( int displayIndex )
-{
-	CHECK_DISPLAY_INDEX( displayIndex, NULL );
-
-	return _this->displays[displayIndex].driverdata;
-}
-
-const char *
-SDL_GetDisplayName(int displayIndex)
-{
-    CHECK_DISPLAY_INDEX(displayIndex, NULL);
-
-    return _this->displays[displayIndex].name;
-}
-
-int
-SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect)
-{
-    CHECK_DISPLAY_INDEX(displayIndex, -1);
-
-    if (rect) {
-        SDL_VideoDisplay *display = &_this->displays[displayIndex];
-
-        if (_this->GetDisplayBounds) {
-            if (_this->GetDisplayBounds(_this, display, rect) == 0) {
-                return 0;
-            }
-        }
-
-        /* Assume that the displays are left to right */
-        if (displayIndex == 0) {
-            rect->x = 0;
-            rect->y = 0;
-        } else {
-            SDL_GetDisplayBounds(displayIndex-1, rect);
-            rect->x += rect->w;
-        }
-        rect->w = display->current_mode.w;
-        rect->h = display->current_mode.h;
-    }
-    return 0;
-}
-
-SDL_bool
-SDL_AddDisplayMode(SDL_VideoDisplay * display,  const SDL_DisplayMode * mode)
-{
-    SDL_DisplayMode *modes;
-    int i, nmodes;
-
-    /* Make sure we don't already have the mode in the list */
-    modes = display->display_modes;
-    nmodes = display->num_display_modes;
-    for (i = 0; i < nmodes; ++i) {
-        if (cmpmodes(mode, &modes[i]) == 0) {
-            return SDL_FALSE;
-        }
-    }
-
-    /* Go ahead and add the new mode */
-    if (nmodes == display->max_display_modes) {
-        modes =
-            SDL_realloc(modes,
-                        (display->max_display_modes + 32) * sizeof(*modes));
-        if (!modes) {
-            return SDL_FALSE;
-        }
-        display->display_modes = modes;
-        display->max_display_modes += 32;
-    }
-    modes[nmodes] = *mode;
-    display->num_display_modes++;
-
-    /* Re-sort video modes */
-    SDL_qsort(display->display_modes, display->num_display_modes,
-              sizeof(SDL_DisplayMode), cmpmodes);
-
-    return SDL_TRUE;
-}
-
-static int
-SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display)
-{
-    if (!display->num_display_modes && _this->GetDisplayModes) {
-        _this->GetDisplayModes(_this, display);
-        SDL_qsort(display->display_modes, display->num_display_modes,
-                  sizeof(SDL_DisplayMode), cmpmodes);
-    }
-    return display->num_display_modes;
-}
-
-int
-SDL_GetNumDisplayModes(int displayIndex)
-{
-    CHECK_DISPLAY_INDEX(displayIndex, -1);
-
-    return SDL_GetNumDisplayModesForDisplay(&_this->displays[displayIndex]);
-}
-
-int
-SDL_GetDisplayMode(int displayIndex, int index, SDL_DisplayMode * mode)
-{
-    SDL_VideoDisplay *display;
-
-    CHECK_DISPLAY_INDEX(displayIndex, -1);
-
-    display = &_this->displays[displayIndex];
-    if (index < 0 || index >= SDL_GetNumDisplayModesForDisplay(display)) {
-        return SDL_SetError("index must be in the range of 0 - %d",
-                            SDL_GetNumDisplayModesForDisplay(display) - 1);
-    }
-    if (mode) {
-        *mode = display->display_modes[index];
-    }
-    return 0;
-}
-
-int
-SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode)
-{
-    SDL_VideoDisplay *display;
-
-    CHECK_DISPLAY_INDEX(displayIndex, -1);
-
-    display = &_this->displays[displayIndex];
-    if (mode) {
-        *mode = display->desktop_mode;
-    }
-    return 0;
-}
-
-int
-SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode)
-{
-    SDL_VideoDisplay *display;
-
-    CHECK_DISPLAY_INDEX(displayIndex, -1);
-
-    display = &_this->displays[displayIndex];
-    if (mode) {
-        *mode = display->current_mode;
-    }
-    return 0;
-}
-
-static SDL_DisplayMode *
-SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display,
-                                    const SDL_DisplayMode * mode,
-                                    SDL_DisplayMode * closest)
-{
-    Uint32 target_format;
-    int target_refresh_rate;
-    int i;
-    SDL_DisplayMode *current, *match;
-
-    if (!mode || !closest) {
-        SDL_SetError("Missing desired mode or closest mode parameter");
-        return NULL;
-    }
-
-    /* Default to the desktop format */
-    if (mode->format) {
-        target_format = mode->format;
-    } else {
-        target_format = display->desktop_mode.format;
-    }
-
-    /* Default to the desktop refresh rate */
-    if (mode->refresh_rate) {
-        target_refresh_rate = mode->refresh_rate;
-    } else {
-        target_refresh_rate = display->desktop_mode.refresh_rate;
-    }
-
-    match = NULL;
-    for (i = 0; i < SDL_GetNumDisplayModesForDisplay(display); ++i) {
-        current = &display->display_modes[i];
-
-        if (current->w && (current->w < mode->w)) {
-            /* Out of sorted modes large enough here */
-            break;
-        }
-        if (current->h && (current->h < mode->h)) {
-            if (current->w && (current->w == mode->w)) {
-                /* Out of sorted modes large enough here */
-                break;
-            }
-            /* Wider, but not tall enough, due to a different
-               aspect ratio. This mode must be skipped, but closer
-               modes may still follow. */
-            continue;
-        }
-        if (!match || current->w < match->w || current->h < match->h) {
-            match = current;
-            continue;
-        }
-        if (current->format != match->format) {
-            /* Sorted highest depth to lowest */
-            if (current->format == target_format ||
-                (SDL_BITSPERPIXEL(current->format) >=
-                 SDL_BITSPERPIXEL(target_format)
-                 && SDL_PIXELTYPE(current->format) ==
-                 SDL_PIXELTYPE(target_format))) {
-                match = current;
-            }
-            continue;
-        }
-        if (current->refresh_rate != match->refresh_rate) {
-            /* Sorted highest refresh to lowest */
-            if (current->refresh_rate >= target_refresh_rate) {
-                match = current;
-            }
-        }
-    }
-    if (match) {
-        if (match->format) {
-            closest->format = match->format;
-        } else {
-            closest->format = mode->format;
-        }
-        if (match->w && match->h) {
-            closest->w = match->w;
-            closest->h = match->h;
-        } else {
-            closest->w = mode->w;
-            closest->h = mode->h;
-        }
-        if (match->refresh_rate) {
-            closest->refresh_rate = match->refresh_rate;
-        } else {
-            closest->refresh_rate = mode->refresh_rate;
-        }
-        closest->driverdata = match->driverdata;
-
-        /*
-         * Pick some reasonable defaults if the app and driver don't
-         * care
-         */
-        if (!closest->format) {
-            closest->format = SDL_PIXELFORMAT_RGB888;
-        }
-        if (!closest->w) {
-            closest->w = 640;
-        }
-        if (!closest->h) {
-            closest->h = 480;
-        }
-        return closest;
-    }
-    return NULL;
-}
-
-SDL_DisplayMode *
-SDL_GetClosestDisplayMode(int displayIndex,
-                          const SDL_DisplayMode * mode,
-                          SDL_DisplayMode * closest)
-{
-    SDL_VideoDisplay *display;
-
-    CHECK_DISPLAY_INDEX(displayIndex, NULL);
-
-    display = &_this->displays[displayIndex];
-    return SDL_GetClosestDisplayModeForDisplay(display, mode, closest);
-}
-
-static int
-SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode)
-{
-    SDL_DisplayMode display_mode;
-    SDL_DisplayMode current_mode;
-
-    if (mode) {
-        display_mode = *mode;
-
-        /* Default to the current mode */
-        if (!display_mode.format) {
-            display_mode.format = display->current_mode.format;
-        }
-        if (!display_mode.w) {
-            display_mode.w = display->current_mode.w;
-        }
-        if (!display_mode.h) {
-            display_mode.h = display->current_mode.h;
-        }
-        if (!display_mode.refresh_rate) {
-            display_mode.refresh_rate = display->current_mode.refresh_rate;
-        }
-
-        /* Get a good video mode, the closest one possible */
-        if (!SDL_GetClosestDisplayModeForDisplay(display, &display_mode, &display_mode)) {
-            return SDL_SetError("No video mode large enough for %dx%d",
-                                display_mode.w, display_mode.h);
-        }
-    } else {
-        display_mode = display->desktop_mode;
-    }
-
-    /* See if there's anything left to do */
-    current_mode = display->current_mode;
-    if (SDL_memcmp(&display_mode, &current_mode, sizeof(display_mode)) == 0) {
-        return 0;
-    }
-
-    /* Actually change the display mode */
-    if (!_this->SetDisplayMode) {
-        return SDL_SetError("Video driver doesn't support changing display mode");
-    }
-    if (_this->SetDisplayMode(_this, display, &display_mode) < 0) {
-        return -1;
-    }
-    display->current_mode = display_mode;
-    return 0;
-}
-
-int
-SDL_GetWindowDisplayIndex(SDL_Window * window)
-{
-    int displayIndex;
-    int i, dist;
-    int closest = -1;
-    int closest_dist = 0x7FFFFFFF;
-    SDL_Point center;
-    SDL_Point delta;
-    SDL_Rect rect;
-
-    CHECK_WINDOW_MAGIC(window, -1);
-
-    if (SDL_WINDOWPOS_ISUNDEFINED(window->x) ||
-        SDL_WINDOWPOS_ISCENTERED(window->x)) {
-        displayIndex = (window->x & 0xFFFF);
-        if (displayIndex >= _this->num_displays) {
-            displayIndex = 0;
-        }
-        return displayIndex;
-    }
-    if (SDL_WINDOWPOS_ISUNDEFINED(window->y) ||
-        SDL_WINDOWPOS_ISCENTERED(window->y)) {
-        displayIndex = (window->y & 0xFFFF);
-        if (displayIndex >= _this->num_displays) {
-            displayIndex = 0;
-        }
-        return displayIndex;
-    }
-
-    /* Find the display containing the window */
-    for (i = 0; i < _this->num_displays; ++i) {
-        SDL_VideoDisplay *display = &_this->displays[i];
-
-        if (display->fullscreen_window == window) {
-            return i;
-        }
-    }
-    center.x = window->x + window->w / 2;
-    center.y = window->y + window->h / 2;
-    for (i = 0; i < _this->num_displays; ++i) {
-        SDL_GetDisplayBounds(i, &rect);
-        if (SDL_EnclosePoints(&center, 1, &rect, NULL)) {
-            return i;
-        }
-
-        delta.x = center.x - (rect.x + rect.w / 2);
-        delta.y = center.y - (rect.y + rect.h / 2);
-        dist = (delta.x*delta.x + delta.y*delta.y);
-        if (dist < closest_dist) {
-            closest = i;
-            closest_dist = dist;
-        }
-    }
-    if (closest < 0) {
-        SDL_SetError("Couldn't find any displays");
-    }
-    return closest;
-}
-
-SDL_VideoDisplay *
-SDL_GetDisplayForWindow(SDL_Window *window)
-{
-    int displayIndex = SDL_GetWindowDisplayIndex(window);
-    if (displayIndex >= 0) {
-        return &_this->displays[displayIndex];
-    } else {
-        return NULL;
-    }
-}
-
-int
-SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode)
-{
-    CHECK_WINDOW_MAGIC(window, -1);
-
-    if (mode) {
-        window->fullscreen_mode = *mode;
-    } else {
-        SDL_zero(window->fullscreen_mode);
-    }
-    return 0;
-}
-
-int
-SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode)
-{
-    SDL_DisplayMode fullscreen_mode;
-    SDL_VideoDisplay *display;
-
-    if (!mode) {
-      return SDL_InvalidParamError("mode");
-    }
-
-    CHECK_WINDOW_MAGIC(window, -1);
-
-    fullscreen_mode = window->fullscreen_mode;
-    if (!fullscreen_mode.w) {
-        fullscreen_mode.w = window->w;
-    }
-    if (!fullscreen_mode.h) {
-        fullscreen_mode.h = window->h;
-    }
-
-    display = SDL_GetDisplayForWindow(window);
-
-    /* if in desktop size mode, just return the size of the desktop */
-    if ( ( window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) == SDL_WINDOW_FULLSCREEN_DESKTOP )
-    {
-        fullscreen_mode = display->desktop_mode;
-    }
-    else if (!SDL_GetClosestDisplayModeForDisplay(SDL_GetDisplayForWindow(window),
-                                             &fullscreen_mode,
-                                             &fullscreen_mode)) {
-        return SDL_SetError("Couldn't find display mode match");
-    }
-
-    if (mode) {
-        *mode = fullscreen_mode;
-    }
-    return 0;
-}
-
-Uint32
-SDL_GetWindowPixelFormat(SDL_Window * window)
-{
-    SDL_VideoDisplay *display;
-
-    CHECK_WINDOW_MAGIC(window, SDL_PIXELFORMAT_UNKNOWN);
-
-    display = SDL_GetDisplayForWindow(window);
-    return display->current_mode.format;
-}
-
-static void
-SDL_RestoreMousePosition(SDL_Window *window)
-{
-    int x, y;
-
-    if (window == SDL_GetMouseFocus()) {
-        SDL_GetMouseState(&x, &y);
-        SDL_WarpMouseInWindow(window, x, y);
-    }
-}
-
-static void
-SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen)
-{
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_Window *other;
-
-    if (fullscreen) {
-        /* Hide any other fullscreen windows */
-        if (display->fullscreen_window &&
-            display->fullscreen_window != window) {
-            SDL_MinimizeWindow(display->fullscreen_window);
-        }
-    }
-
-    /* See if anything needs to be done now */
-    if ((display->fullscreen_window == window) == fullscreen) {
-        return;
-    }
-
-    /* See if there are any fullscreen windows */
-    for (other = _this->windows; other; other = other->next) {
-        SDL_bool setDisplayMode = SDL_FALSE;
-
-        if (other == window) {
-            setDisplayMode = fullscreen;
-        } else if (FULLSCREEN_VISIBLE(other) &&
-                   SDL_GetDisplayForWindow(other) == display) {
-            setDisplayMode = SDL_TRUE;
-        }
-
-        if (setDisplayMode) {
-            SDL_DisplayMode fullscreen_mode;
-
-            if (SDL_GetWindowDisplayMode(other, &fullscreen_mode) == 0) {
-                SDL_bool resized = SDL_TRUE;
-
-                if (other->w == fullscreen_mode.w && other->h == fullscreen_mode.h) {
-                    resized = SDL_FALSE;
-                }
-
-                /* only do the mode change if we want exclusive fullscreen */
-                if ( ( window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) != SDL_WINDOW_FULLSCREEN_DESKTOP )
-                    SDL_SetDisplayModeForDisplay(display, &fullscreen_mode);
-                else
-                    SDL_SetDisplayModeForDisplay(display, NULL);
-
-
-                if (_this->SetWindowFullscreen) {
-                    _this->SetWindowFullscreen(_this, other, display, SDL_TRUE);
-                }
-                display->fullscreen_window = other;
-
-                /* Generate a mode change event here */
-                if (resized) {
-                    SDL_SendWindowEvent(other, SDL_WINDOWEVENT_RESIZED,
-                                        fullscreen_mode.w, fullscreen_mode.h);
-                } else {
-                    SDL_OnWindowResized(other);
-                }
-
-                SDL_RestoreMousePosition(other);
-                return;
-            }
-        }
-    }
-
-    /* Nope, restore the desktop mode */
-    SDL_SetDisplayModeForDisplay(display, NULL);
-
-    if (_this->SetWindowFullscreen) {
-        _this->SetWindowFullscreen(_this, window, display, SDL_FALSE);
-    }
-    display->fullscreen_window = NULL;
-
-    /* Generate a mode change event here */
-    SDL_OnWindowResized(window);
-
-    /* Restore the cursor position */
-    SDL_RestoreMousePosition(window);
-}
-
-#define CREATE_FLAGS \
-    (SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE)
-
-static void
-SDL_FinishWindowCreation(SDL_Window *window, Uint32 flags)
-{
-    window->windowed.x = window->x;
-    window->windowed.y = window->y;
-    window->windowed.w = window->w;
-    window->windowed.h = window->h;
-
-    if (flags & SDL_WINDOW_MAXIMIZED) {
-        SDL_MaximizeWindow(window);
-    }
-    if (flags & SDL_WINDOW_MINIMIZED) {
-        SDL_MinimizeWindow(window);
-    }
-    if (flags & SDL_WINDOW_FULLSCREEN) {
-        SDL_SetWindowFullscreen(window, flags);
-    }
-    if (flags & SDL_WINDOW_INPUT_GRABBED) {
-        SDL_SetWindowGrab(window, SDL_TRUE);
-    }
-    if (!(flags & SDL_WINDOW_HIDDEN)) {
-        SDL_ShowWindow(window);
-    }
-}
-
-SDL_Window *
-SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
-{
-    SDL_Window *window;
-    const char *hint;
-
-    if (!_this) {
-        /* Initialize the video system if needed */
-        if (SDL_VideoInit(NULL) < 0) {
-            return NULL;
-        }
-    }
-
-    /* Some platforms can't create zero-sized windows */
-    if (w < 1) {
-        w = 1;
-    }
-    if (h < 1) {
-        h = 1;
-    }
-
-    /* Some platforms have OpenGL enabled by default */
-#if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__
-    flags |= SDL_WINDOW_OPENGL;
-#endif
-    if (flags & SDL_WINDOW_OPENGL) {
-        if (!_this->GL_CreateContext) {
-            SDL_SetError("No OpenGL support in video driver");
-            return NULL;
-        }
-        if (SDL_GL_LoadLibrary(NULL) < 0) {
-            return NULL;
-        }
-    }
-    window = (SDL_Window *)SDL_calloc(1, sizeof(*window));
-    if (!window) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    window->magic = &_this->window_magic;
-    window->id = _this->next_object_id++;
-    window->x = x;
-    window->y = y;
-    window->w = w;
-    window->h = h;
-    if (SDL_WINDOWPOS_ISUNDEFINED(x) || SDL_WINDOWPOS_ISUNDEFINED(y) ||
-        SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) {
-        SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-        int displayIndex;
-        SDL_Rect bounds;
-
-        displayIndex = SDL_GetIndexOfDisplay(display);
-        SDL_GetDisplayBounds(displayIndex, &bounds);
-        if (SDL_WINDOWPOS_ISUNDEFINED(x) || SDL_WINDOWPOS_ISCENTERED(x)) {
-            window->x = bounds.x + (bounds.w - w) / 2;
-        }
-        if (SDL_WINDOWPOS_ISUNDEFINED(y) || SDL_WINDOWPOS_ISCENTERED(y)) {
-            window->y = bounds.y + (bounds.h - h) / 2;
-        }
-    }
-    window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN);
-    window->brightness = 1.0f;
-    window->next = _this->windows;
-
-    /* Unless the user has specified the high-DPI disabling hint, respect the
-     * SDL_WINDOW_ALLOW_HIGHDPI flag.
-     */
-    hint = SDL_GetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED);
-    if (!hint || *hint != '1') {
-        if ((flags & SDL_WINDOW_ALLOW_HIGHDPI)) {
-            window->flags |= SDL_WINDOW_ALLOW_HIGHDPI;
-        }
-    }
-
-    if (_this->windows) {
-        _this->windows->prev = window;
-    }
-    _this->windows = window;
-
-    if (_this->CreateWindow && _this->CreateWindow(_this, window) < 0) {
-        SDL_DestroyWindow(window);
-        return NULL;
-    }
-
-    if (title) {
-        SDL_SetWindowTitle(window, title);
-    }
-    SDL_FinishWindowCreation(window, flags);
-
-    /* If the window was created fullscreen, make sure the mode code matches */
-    SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window));
-
-    return window;
-}
-
-SDL_Window *
-SDL_CreateWindowFrom(const void *data)
-{
-    SDL_Window *window;
-
-    if (!_this) {
-        SDL_UninitializedVideo();
-        return NULL;
-    }
-    window = (SDL_Window *)SDL_calloc(1, sizeof(*window));
-    if (!window) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    window->magic = &_this->window_magic;
-    window->id = _this->next_object_id++;
-    window->flags = SDL_WINDOW_FOREIGN;
-    window->brightness = 1.0f;
-    window->next = _this->windows;
-    if (_this->windows) {
-        _this->windows->prev = window;
-    }
-    _this->windows = window;
-
-    if (!_this->CreateWindowFrom ||
-        _this->CreateWindowFrom(_this, window, data) < 0) {
-        SDL_DestroyWindow(window);
-        return NULL;
-    }
-    return window;
-}
-
-int
-SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
-{
-    char *title = window->title;
-    SDL_Surface *icon = window->icon;
-
-    if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) {
-        return SDL_SetError("No OpenGL support in video driver");
-    }
-
-    if (window->flags & SDL_WINDOW_FOREIGN) {
-        /* Can't destroy and re-create foreign windows, hrm */
-        flags |= SDL_WINDOW_FOREIGN;
-    } else {
-        flags &= ~SDL_WINDOW_FOREIGN;
-    }
-
-    /* Restore video mode, etc. */
-    SDL_HideWindow(window);
-
-    /* Tear down the old native window */
-    if (window->surface) {
-        window->surface->flags &= ~SDL_DONTFREE;
-        SDL_FreeSurface(window->surface);
-    }
-    if (_this->DestroyWindowFramebuffer) {
-        _this->DestroyWindowFramebuffer(_this, window);
-    }
-    if (_this->DestroyWindow && !(flags & SDL_WINDOW_FOREIGN)) {
-        _this->DestroyWindow(_this, window);
-    }
-
-    if ((window->flags & SDL_WINDOW_OPENGL) != (flags & SDL_WINDOW_OPENGL)) {
-        if (flags & SDL_WINDOW_OPENGL) {
-            if (SDL_GL_LoadLibrary(NULL) < 0) {
-                return -1;
-            }
-        } else {
-            SDL_GL_UnloadLibrary();
-        }
-    }
-
-    window->title = NULL;
-    window->icon = NULL;
-    window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN);
-
-    if (_this->CreateWindow && !(flags & SDL_WINDOW_FOREIGN)) {
-        if (_this->CreateWindow(_this, window) < 0) {
-            if (flags & SDL_WINDOW_OPENGL) {
-                SDL_GL_UnloadLibrary();
-            }
-            return -1;
-        }
-    }
-
-    if (title) {
-        SDL_SetWindowTitle(window, title);
-        SDL_free(title);
-    }
-    if (icon) {
-        SDL_SetWindowIcon(window, icon);
-        SDL_FreeSurface(icon);
-    }
-    SDL_FinishWindowCreation(window, flags);
-
-    return 0;
-}
-
-Uint32
-SDL_GetWindowID(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, 0);
-
-    return window->id;
-}
-
-SDL_Window *
-SDL_GetWindowFromID(Uint32 id)
-{
-    SDL_Window *window;
-
-    if (!_this) {
-        return NULL;
-    }
-    for (window = _this->windows; window; window = window->next) {
-        if (window->id == id) {
-            return window;
-        }
-    }
-    return NULL;
-}
-
-Uint32
-SDL_GetWindowFlags(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, 0);
-
-    return window->flags;
-}
-
-void
-SDL_SetWindowTitle(SDL_Window * window, const char *title)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (title == window->title) {
-        return;
-    }
-    SDL_free(window->title);
-    if (title && *title) {
-        window->title = SDL_strdup(title);
-    } else {
-        window->title = NULL;
-    }
-
-    if (_this->SetWindowTitle) {
-        _this->SetWindowTitle(_this, window);
-    }
-}
-
-const char *
-SDL_GetWindowTitle(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, "");
-
-    return window->title ? window->title : "";
-}
-
-void
-SDL_SetWindowIcon(SDL_Window * window, SDL_Surface * icon)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (!icon) {
-        return;
-    }
-
-    SDL_FreeSurface(window->icon);
-
-    /* Convert the icon into ARGB8888 */
-    window->icon = SDL_ConvertSurfaceFormat(icon, SDL_PIXELFORMAT_ARGB8888, 0);
-    if (!window->icon) {
-        return;
-    }
-
-    if (_this->SetWindowIcon) {
-        _this->SetWindowIcon(_this, window, window->icon);
-    }
-}
-
-void*
-SDL_SetWindowData(SDL_Window * window, const char *name, void *userdata)
-{
-    SDL_WindowUserData *prev, *data;
-
-    CHECK_WINDOW_MAGIC(window, NULL);
-
-    /* Input validation */
-    if (name == NULL || name[0] == '\0') {
-      SDL_InvalidParamError("name");
-      return NULL;
-    }
-
-    /* See if the named data already exists */
-    prev = NULL;
-    for (data = window->data; data; prev = data, data = data->next) {
-        if (data->name && SDL_strcmp(data->name, name) == 0) {
-            void *last_value = data->data;
-
-            if (userdata) {
-                /* Set the new value */
-                data->data = userdata;
-            } else {
-                /* Delete this value */
-                if (prev) {
-                    prev->next = data->next;
-                } else {
-                    window->data = data->next;
-                }
-                SDL_free(data->name);
-                SDL_free(data);
-            }
-            return last_value;
-        }
-    }
-
-    /* Add new data to the window */
-    if (userdata) {
-        data = (SDL_WindowUserData *)SDL_malloc(sizeof(*data));
-        data->name = SDL_strdup(name);
-        data->data = userdata;
-        data->next = window->data;
-        window->data = data;
-    }
-    return NULL;
-}
-
-void *
-SDL_GetWindowData(SDL_Window * window, const char *name)
-{
-    SDL_WindowUserData *data;
-
-    CHECK_WINDOW_MAGIC(window, NULL);
-
-    /* Input validation */
-    if (name == NULL || name[0] == '\0') {
-      SDL_InvalidParamError("name");
-      return NULL;
-    }
-
-    for (data = window->data; data; data = data->next) {
-        if (data->name && SDL_strcmp(data->name, name) == 0) {
-            return data->data;
-        }
-    }
-    return NULL;
-}
-
-void
-SDL_SetWindowPosition(SDL_Window * window, int x, int y)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) {
-        SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-        int displayIndex;
-        SDL_Rect bounds;
-
-        displayIndex = SDL_GetIndexOfDisplay(display);
-        SDL_GetDisplayBounds(displayIndex, &bounds);
-        if (SDL_WINDOWPOS_ISCENTERED(x)) {
-            x = bounds.x + (bounds.w - window->w) / 2;
-        }
-        if (SDL_WINDOWPOS_ISCENTERED(y)) {
-            y = bounds.y + (bounds.h - window->h) / 2;
-        }
-    }
-
-    if ((window->flags & SDL_WINDOW_FULLSCREEN)) {
-        if (!SDL_WINDOWPOS_ISUNDEFINED(x)) {
-            window->windowed.x = x;
-        }
-        if (!SDL_WINDOWPOS_ISUNDEFINED(y)) {
-            window->windowed.y = y;
-        }
-    } else {
-        if (!SDL_WINDOWPOS_ISUNDEFINED(x)) {
-            window->x = x;
-        }
-        if (!SDL_WINDOWPOS_ISUNDEFINED(y)) {
-            window->y = y;
-        }
-
-        if (_this->SetWindowPosition) {
-            _this->SetWindowPosition(_this, window);
-        }
-        SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);
-    }
-}
-
-void
-SDL_GetWindowPosition(SDL_Window * window, int *x, int *y)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    /* Fullscreen windows are always at their display's origin */
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        if (x) {
-            *x = 0;
-        }
-        if (y) {
-            *y = 0;
-        }
-    } else {
-        if (x) {
-            *x = window->x;
-        }
-        if (y) {
-            *y = window->y;
-        }
-    }
-}
-
-void
-SDL_SetWindowBordered(SDL_Window * window, SDL_bool bordered)
-{
-    CHECK_WINDOW_MAGIC(window, );
-    if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
-        const int want = (bordered != SDL_FALSE);  /* normalize the flag. */
-        const int have = ((window->flags & SDL_WINDOW_BORDERLESS) == 0);
-        if ((want != have) && (_this->SetWindowBordered)) {
-            if (want) {
-                window->flags &= ~SDL_WINDOW_BORDERLESS;
-            } else {
-                window->flags |= SDL_WINDOW_BORDERLESS;
-            }
-            _this->SetWindowBordered(_this, window, (SDL_bool) want);
-        }
-    }
-}
-
-void
-SDL_SetWindowSize(SDL_Window * window, int w, int h)
-{
-    CHECK_WINDOW_MAGIC(window, );
-    if (w <= 0) {
-        SDL_InvalidParamError("w");
-        return;
-    }
-    if (h <= 0) {
-        SDL_InvalidParamError("h");
-        return;
-    }
-
-    /* FIXME: Should this change fullscreen modes? */
-    if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
-        window->w = w;
-        window->h = h;
-        if (_this->SetWindowSize) {
-            _this->SetWindowSize(_this, window);
-        }
-        if (window->w == w && window->h == h) {
-            /* We didn't get a SDL_WINDOWEVENT_RESIZED event (by design) */
-            SDL_OnWindowResized(window);
-        }
-    }
-}
-
-void
-SDL_GetWindowSize(SDL_Window * window, int *w, int *h)
-{
-    CHECK_WINDOW_MAGIC(window, );
-    if (w) {
-        *w = window->w;
-    }
-    if (h) {
-        *h = window->h;
-    }
-}
-
-void
-SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h)
-{
-    CHECK_WINDOW_MAGIC(window, );
-    if (min_w <= 0) {
-        SDL_InvalidParamError("min_w");
-        return;
-    }
-    if (min_h <= 0) {
-        SDL_InvalidParamError("min_h");
-        return;
-    }
-
-    if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
-        window->min_w = min_w;
-        window->min_h = min_h;
-        if (_this->SetWindowMinimumSize) {
-            _this->SetWindowMinimumSize(_this, window);
-        }
-        /* Ensure that window is not smaller than minimal size */
-        SDL_SetWindowSize(window, SDL_max(window->w, window->min_w), SDL_max(window->h, window->min_h));
-    }
-}
-
-void
-SDL_GetWindowMinimumSize(SDL_Window * window, int *min_w, int *min_h)
-{
-    CHECK_WINDOW_MAGIC(window, );
-    if (min_w) {
-        *min_w = window->min_w;
-    }
-    if (min_h) {
-        *min_h = window->min_h;
-    }
-}
-
-void
-SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h)
-{
-    CHECK_WINDOW_MAGIC(window, );
-    if (max_w <= 0) {
-        SDL_InvalidParamError("max_w");
-        return;
-    }
-    if (max_h <= 0) {
-        SDL_InvalidParamError("max_h");
-        return;
-    }
-
-    if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
-        window->max_w = max_w;
-        window->max_h = max_h;
-        if (_this->SetWindowMaximumSize) {
-            _this->SetWindowMaximumSize(_this, window);
-        }
-        /* Ensure that window is not larger than maximal size */
-        SDL_SetWindowSize(window, SDL_min(window->w, window->max_w), SDL_min(window->h, window->max_h));
-    }
-}
-
-void
-SDL_GetWindowMaximumSize(SDL_Window * window, int *max_w, int *max_h)
-{
-    CHECK_WINDOW_MAGIC(window, );
-    if (max_w) {
-        *max_w = window->max_w;
-    }
-    if (max_h) {
-        *max_h = window->max_h;
-    }
-}
-
-void
-SDL_ShowWindow(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (window->flags & SDL_WINDOW_SHOWN) {
-        return;
-    }
-
-    if (_this->ShowWindow) {
-        _this->ShowWindow(_this, window);
-    }
-    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SHOWN, 0, 0);
-}
-
-void
-SDL_HideWindow(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (!(window->flags & SDL_WINDOW_SHOWN)) {
-        return;
-    }
-
-    SDL_UpdateFullscreenMode(window, SDL_FALSE);
-
-    if (_this->HideWindow) {
-        _this->HideWindow(_this, window);
-    }
-    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
-}
-
-void
-SDL_RaiseWindow(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (!(window->flags & SDL_WINDOW_SHOWN)) {
-        return;
-    }
-    if (_this->RaiseWindow) {
-        _this->RaiseWindow(_this, window);
-    }
-}
-
-void
-SDL_MaximizeWindow(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (window->flags & SDL_WINDOW_MAXIMIZED) {
-        return;
-    }
-
-    /* !!! FIXME: should this check if the window is resizable? */
-
-    if (_this->MaximizeWindow) {
-        _this->MaximizeWindow(_this, window);
-    }
-}
-
-void
-SDL_MinimizeWindow(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (window->flags & SDL_WINDOW_MINIMIZED) {
-        return;
-    }
-
-    SDL_UpdateFullscreenMode(window, SDL_FALSE);
-
-    if (_this->MinimizeWindow) {
-        _this->MinimizeWindow(_this, window);
-    }
-}
-
-void
-SDL_RestoreWindow(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (!(window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) {
-        return;
-    }
-
-    if (_this->RestoreWindow) {
-        _this->RestoreWindow(_this, window);
-    }
-}
-
-#define FULLSCREEN_MASK ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN )
-int
-SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags)
-{
-    CHECK_WINDOW_MAGIC(window, -1);
-
-    flags &= FULLSCREEN_MASK;
-
-    if ( flags == (window->flags & FULLSCREEN_MASK) ) {
-        return 0;
-    }
-
-    /* clear the previous flags and OR in the new ones */
-    window->flags &= ~FULLSCREEN_MASK;
-    window->flags |= flags;
-
-    SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window));
-
-    return 0;
-}
-
-static SDL_Surface *
-SDL_CreateWindowFramebuffer(SDL_Window * window)
-{
-    Uint32 format;
-    void *pixels;
-    int pitch;
-    int bpp;
-    Uint32 Rmask, Gmask, Bmask, Amask;
-
-    if (!_this->CreateWindowFramebuffer || !_this->UpdateWindowFramebuffer) {
-        return NULL;
-    }
-
-    if (_this->CreateWindowFramebuffer(_this, window, &format, &pixels, &pitch) < 0) {
-        return NULL;
-    }
-
-    if (!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
-        return NULL;
-    }
-
-    return SDL_CreateRGBSurfaceFrom(pixels, window->w, window->h, bpp, pitch, Rmask, Gmask, Bmask, Amask);
-}
-
-SDL_Surface *
-SDL_GetWindowSurface(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, NULL);
-
-    if (!window->surface_valid) {
-        if (window->surface) {
-            window->surface->flags &= ~SDL_DONTFREE;
-            SDL_FreeSurface(window->surface);
-        }
-        window->surface = SDL_CreateWindowFramebuffer(window);
-        if (window->surface) {
-            window->surface_valid = SDL_TRUE;
-            window->surface->flags |= SDL_DONTFREE;
-        }
-    }
-    return window->surface;
-}
-
-int
-SDL_UpdateWindowSurface(SDL_Window * window)
-{
-    SDL_Rect full_rect;
-
-    CHECK_WINDOW_MAGIC(window, -1);
-
-    full_rect.x = 0;
-    full_rect.y = 0;
-    full_rect.w = window->w;
-    full_rect.h = window->h;
-    return SDL_UpdateWindowSurfaceRects(window, &full_rect, 1);
-}
-
-int
-SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects,
-                             int numrects)
-{
-    CHECK_WINDOW_MAGIC(window, -1);
-
-    if (!window->surface_valid) {
-        return SDL_SetError("Window surface is invalid, please call SDL_GetWindowSurface() to get a new surface");
-    }
-
-    return _this->UpdateWindowFramebuffer(_this, window, rects, numrects);
-}
-
-int
-SDL_SetWindowBrightness(SDL_Window * window, float brightness)
-{
-    Uint16 ramp[256];
-    int status;
-
-    CHECK_WINDOW_MAGIC(window, -1);
-
-    SDL_CalculateGammaRamp(brightness, ramp);
-    status = SDL_SetWindowGammaRamp(window, ramp, ramp, ramp);
-    if (status == 0) {
-        window->brightness = brightness;
-    }
-    return status;
-}
-
-float
-SDL_GetWindowBrightness(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, 1.0f);
-
-    return window->brightness;
-}
-
-int
-SDL_SetWindowGammaRamp(SDL_Window * window, const Uint16 * red,
-                                            const Uint16 * green,
-                                            const Uint16 * blue)
-{
-    CHECK_WINDOW_MAGIC(window, -1);
-
-    if (!_this->SetWindowGammaRamp) {
-        return SDL_Unsupported();
-    }
-
-    if (!window->gamma) {
-        if (SDL_GetWindowGammaRamp(window, NULL, NULL, NULL) < 0) {
-            return -1;
-        }
-    }
-
-    if (red) {
-        SDL_memcpy(&window->gamma[0*256], red, 256*sizeof(Uint16));
-    }
-    if (green) {
-        SDL_memcpy(&window->gamma[1*256], green, 256*sizeof(Uint16));
-    }
-    if (blue) {
-        SDL_memcpy(&window->gamma[2*256], blue, 256*sizeof(Uint16));
-    }
-    if (window->flags & SDL_WINDOW_INPUT_FOCUS) {
-        return _this->SetWindowGammaRamp(_this, window, window->gamma);
-    } else {
-        return 0;
-    }
-}
-
-int
-SDL_GetWindowGammaRamp(SDL_Window * window, Uint16 * red,
-                                            Uint16 * green,
-                                            Uint16 * blue)
-{
-    CHECK_WINDOW_MAGIC(window, -1);
-
-    if (!window->gamma) {
-        int i;
-
-        window->gamma = (Uint16 *)SDL_malloc(256*6*sizeof(Uint16));
-        if (!window->gamma) {
-            return SDL_OutOfMemory();
-        }
-        window->saved_gamma = window->gamma + 3*256;
-
-        if (_this->GetWindowGammaRamp) {
-            if (_this->GetWindowGammaRamp(_this, window, window->gamma) < 0) {
-                return -1;
-            }
-        } else {
-            /* Create an identity gamma ramp */
-            for (i = 0; i < 256; ++i) {
-                Uint16 value = (Uint16)((i << 8) | i);
-
-                window->gamma[0*256+i] = value;
-                window->gamma[1*256+i] = value;
-                window->gamma[2*256+i] = value;
-            }
-        }
-        SDL_memcpy(window->saved_gamma, window->gamma, 3*256*sizeof(Uint16));
-    }
-
-    if (red) {
-        SDL_memcpy(red, &window->gamma[0*256], 256*sizeof(Uint16));
-    }
-    if (green) {
-        SDL_memcpy(green, &window->gamma[1*256], 256*sizeof(Uint16));
-    }
-    if (blue) {
-        SDL_memcpy(blue, &window->gamma[2*256], 256*sizeof(Uint16));
-    }
-    return 0;
-}
-
-void
-SDL_UpdateWindowGrab(SDL_Window * window)
-{
-    if (_this->SetWindowGrab) {
-        SDL_bool grabbed;
-        if ((window->flags & SDL_WINDOW_INPUT_GRABBED) &&
-            (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
-            grabbed = SDL_TRUE;
-        } else {
-            grabbed = SDL_FALSE;
-        }
-        _this->SetWindowGrab(_this, window, grabbed);
-    }
-}
-
-void
-SDL_SetWindowGrab(SDL_Window * window, SDL_bool grabbed)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (!!grabbed == !!(window->flags & SDL_WINDOW_INPUT_GRABBED)) {
-        return;
-    }
-    if (grabbed) {
-        window->flags |= SDL_WINDOW_INPUT_GRABBED;
-    } else {
-        window->flags &= ~SDL_WINDOW_INPUT_GRABBED;
-    }
-    SDL_UpdateWindowGrab(window);
-}
-
-SDL_bool
-SDL_GetWindowGrab(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, SDL_FALSE);
-
-    return ((window->flags & SDL_WINDOW_INPUT_GRABBED) != 0);
-}
-
-void
-SDL_OnWindowShown(SDL_Window * window)
-{
-    SDL_OnWindowRestored(window);
-}
-
-void
-SDL_OnWindowHidden(SDL_Window * window)
-{
-    SDL_UpdateFullscreenMode(window, SDL_FALSE);
-}
-
-void
-SDL_OnWindowResized(SDL_Window * window)
-{
-    window->surface_valid = SDL_FALSE;
-    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h);
-}
-
-void
-SDL_OnWindowMinimized(SDL_Window * window)
-{
-    SDL_UpdateFullscreenMode(window, SDL_FALSE);
-}
-
-void
-SDL_OnWindowRestored(SDL_Window * window)
-{
-    SDL_RaiseWindow(window);
-
-    if (FULLSCREEN_VISIBLE(window)) {
-        SDL_UpdateFullscreenMode(window, SDL_TRUE);
-    }
-}
-
-void
-SDL_OnWindowEnter(SDL_Window * window)
-{
-    if (_this->OnWindowEnter) {
-        _this->OnWindowEnter(_this, window);
-    }
-}
-
-void
-SDL_OnWindowLeave(SDL_Window * window)
-{
-}
-
-void
-SDL_OnWindowFocusGained(SDL_Window * window)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    if (window->gamma && _this->SetWindowGammaRamp) {
-        _this->SetWindowGammaRamp(_this, window, window->gamma);
-    }
-
-    if (mouse && mouse->relative_mode) {
-        SDL_SetMouseFocus(window);
-        SDL_WarpMouseInWindow(window, window->w/2, window->h/2);
-    }
-
-    SDL_UpdateWindowGrab(window);
-}
-
-static SDL_bool ShouldMinimizeOnFocusLoss()
-{
-    const char *hint = SDL_GetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS);
-    if (hint) {
-        if (*hint == '0') {
-            return SDL_FALSE;
-        } else {
-            return SDL_TRUE;
-        }
-    }
-    return SDL_TRUE;
-}
-
-void
-SDL_OnWindowFocusLost(SDL_Window * window)
-{
-    if (window->gamma && _this->SetWindowGammaRamp) {
-        _this->SetWindowGammaRamp(_this, window, window->saved_gamma);
-    }
-
-    SDL_UpdateWindowGrab(window);
-
-    /* If we're fullscreen and lose focus, minimize unless the hint tells us otherwise */
-    if ((window->flags & SDL_WINDOW_FULLSCREEN) && ShouldMinimizeOnFocusLoss()) {
-        SDL_MinimizeWindow(window);
-    }
-}
-
-SDL_Window *
-SDL_GetFocusWindow(void)
-{
-    SDL_Window *window;
-
-    if (!_this) {
-        return NULL;
-    }
-    for (window = _this->windows; window; window = window->next) {
-        if (window->flags & SDL_WINDOW_INPUT_FOCUS) {
-            return window;
-        }
-    }
-    return NULL;
-}
-
-void
-SDL_DestroyWindow(SDL_Window * window)
-{
-    SDL_VideoDisplay *display;
-
-    CHECK_WINDOW_MAGIC(window, );
-
-    /* Restore video mode, etc. */
-    SDL_HideWindow(window);
-
-    /* Make sure this window no longer has focus */
-    if (SDL_GetKeyboardFocus() == window) {
-        SDL_SetKeyboardFocus(NULL);
-    }
-    if (SDL_GetMouseFocus() == window) {
-        SDL_SetMouseFocus(NULL);
-    }
-
-    /* make no context current if this is the current context window. */
-    if (window->flags & SDL_WINDOW_OPENGL) {
-        if (_this->current_glwin == window) {
-            SDL_GL_MakeCurrent(window, NULL);
-        }
-    }
-
-    if (window->surface) {
-        window->surface->flags &= ~SDL_DONTFREE;
-        SDL_FreeSurface(window->surface);
-    }
-    if (_this->DestroyWindowFramebuffer) {
-        _this->DestroyWindowFramebuffer(_this, window);
-    }
-    if (_this->DestroyWindow) {
-        _this->DestroyWindow(_this, window);
-    }
-    if (window->flags & SDL_WINDOW_OPENGL) {
-        SDL_GL_UnloadLibrary();
-    }
-
-    display = SDL_GetDisplayForWindow(window);
-    if (display->fullscreen_window == window) {
-        display->fullscreen_window = NULL;
-    }
-
-    /* Now invalidate magic */
-    window->magic = NULL;
-
-    /* Free memory associated with the window */
-    SDL_free(window->title);
-    SDL_FreeSurface(window->icon);
-    SDL_free(window->gamma);
-    while (window->data) {
-        SDL_WindowUserData *data = window->data;
-
-        window->data = data->next;
-        SDL_free(data->name);
-        SDL_free(data);
-    }
-
-    /* Unlink the window from the list */
-    if (window->next) {
-        window->next->prev = window->prev;
-    }
-    if (window->prev) {
-        window->prev->next = window->next;
-    } else {
-        _this->windows = window->next;
-    }
-
-    SDL_free(window);
-}
-
-SDL_bool
-SDL_IsScreenSaverEnabled()
-{
-    if (!_this) {
-        return SDL_TRUE;
-    }
-    return _this->suspend_screensaver ? SDL_FALSE : SDL_TRUE;
-}
-
-void
-SDL_EnableScreenSaver()
-{
-    if (!_this) {
-        return;
-    }
-    if (!_this->suspend_screensaver) {
-        return;
-    }
-    _this->suspend_screensaver = SDL_FALSE;
-    if (_this->SuspendScreenSaver) {
-        _this->SuspendScreenSaver(_this);
-    }
-}
-
-void
-SDL_DisableScreenSaver()
-{
-    if (!_this) {
-        return;
-    }
-    if (_this->suspend_screensaver) {
-        return;
-    }
-    _this->suspend_screensaver = SDL_TRUE;
-    if (_this->SuspendScreenSaver) {
-        _this->SuspendScreenSaver(_this);
-    }
-}
-
-void
-SDL_VideoQuit(void)
-{
-    int i, j;
-
-    if (!_this) {
-        return;
-    }
-
-    /* Halt event processing before doing anything else */
-    SDL_TouchQuit();
-    SDL_MouseQuit();
-    SDL_KeyboardQuit();
-    SDL_QuitSubSystem(SDL_INIT_EVENTS);
-
-    SDL_EnableScreenSaver();
-
-    /* Clean up the system video */
-    while (_this->windows) {
-        SDL_DestroyWindow(_this->windows);
-    }
-    _this->VideoQuit(_this);
-
-    for (i = 0; i < _this->num_displays; ++i) {
-        SDL_VideoDisplay *display = &_this->displays[i];
-        for (j = display->num_display_modes; j--;) {
-            SDL_free(display->display_modes[j].driverdata);
-            display->display_modes[j].driverdata = NULL;
-        }
-        SDL_free(display->display_modes);
-        display->display_modes = NULL;
-        SDL_free(display->desktop_mode.driverdata);
-        display->desktop_mode.driverdata = NULL;
-        SDL_free(display->driverdata);
-        display->driverdata = NULL;
-    }
-    if (_this->displays) {
-        for (i = 0; i < _this->num_displays; ++i) {
-            SDL_free(_this->displays[i].name);
-        }
-        SDL_free(_this->displays);
-        _this->displays = NULL;
-        _this->num_displays = 0;
-    }
-    SDL_free(_this->clipboard_text);
-    _this->clipboard_text = NULL;
-    _this->free(_this);
-    _this = NULL;
-}
-
-int
-SDL_GL_LoadLibrary(const char *path)
-{
-    int retval;
-
-    if (!_this) {
-        return SDL_UninitializedVideo();
-    }
-    if (_this->gl_config.driver_loaded) {
-        if (path && SDL_strcmp(path, _this->gl_config.driver_path) != 0) {
-            return SDL_SetError("OpenGL library already loaded");
-        }
-        retval = 0;
-    } else {
-        if (!_this->GL_LoadLibrary) {
-            return SDL_SetError("No dynamic GL support in video driver");
-        }
-        retval = _this->GL_LoadLibrary(_this, path);
-    }
-    if (retval == 0) {
-        ++_this->gl_config.driver_loaded;
-    } else {
-        if (_this->GL_UnloadLibrary) {
-            _this->GL_UnloadLibrary(_this);
-        }
-    }
-    return (retval);
-}
-
-void *
-SDL_GL_GetProcAddress(const char *proc)
-{
-    void *func;
-
-    if (!_this) {
-        SDL_UninitializedVideo();
-        return NULL;
-    }
-    func = NULL;
-    if (_this->GL_GetProcAddress) {
-        if (_this->gl_config.driver_loaded) {
-            func = _this->GL_GetProcAddress(_this, proc);
-        } else {
-            SDL_SetError("No GL driver has been loaded");
-        }
-    } else {
-        SDL_SetError("No dynamic GL support in video driver");
-    }
-    return func;
-}
-
-void
-SDL_GL_UnloadLibrary(void)
-{
-    if (!_this) {
-        SDL_UninitializedVideo();
-        return;
-    }
-    if (_this->gl_config.driver_loaded > 0) {
-        if (--_this->gl_config.driver_loaded > 0) {
-            return;
-        }
-        if (_this->GL_UnloadLibrary) {
-            _this->GL_UnloadLibrary(_this);
-        }
-    }
-}
-
-static SDL_INLINE SDL_bool
-isAtLeastGL3(const char *verstr)
-{
-    return ( verstr && (SDL_atoi(verstr) >= 3) );
-}
-
-SDL_bool
-SDL_GL_ExtensionSupported(const char *extension)
-{
-#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
-    const GLubyte *(APIENTRY * glGetStringFunc) (GLenum);
-    const char *extensions;
-    const char *start;
-    const char *where, *terminator;
-
-    /* Extension names should not have spaces. */
-    where = SDL_strchr(extension, ' ');
-    if (where || *extension == '\0') {
-        return SDL_FALSE;
-    }
-    /* See if there's an environment variable override */
-    start = SDL_getenv(extension);
-    if (start && *start == '0') {
-        return SDL_FALSE;
-    }
-
-    /* Lookup the available extensions */
-
-    glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
-    if (!glGetStringFunc) {
-        return SDL_FALSE;
-    }
-
-    if (isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) {
-        const GLubyte *(APIENTRY * glGetStringiFunc) (GLenum, GLuint);
-        void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params);
-        GLint num_exts = 0;
-        GLint i;
-
-        glGetStringiFunc = SDL_GL_GetProcAddress("glGetStringi");
-        glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
-        if ((!glGetStringiFunc) || (!glGetIntegervFunc)) {
-            return SDL_FALSE;
-        }
-
-        #ifndef GL_NUM_EXTENSIONS
-        #define GL_NUM_EXTENSIONS 0x821D
-        #endif
-        glGetIntegervFunc(GL_NUM_EXTENSIONS, &num_exts);
-        for (i = 0; i < num_exts; i++) {
-            const char *thisext = (const char *) glGetStringiFunc(GL_EXTENSIONS, i);
-            if (SDL_strcmp(thisext, extension) == 0) {
-                return SDL_TRUE;
-            }
-        }
-
-        return SDL_FALSE;
-    }
-
-    /* Try the old way with glGetString(GL_EXTENSIONS) ... */
-
-    extensions = (const char *) glGetStringFunc(GL_EXTENSIONS);
-    if (!extensions) {
-        return SDL_FALSE;
-    }
-    /*
-     * It takes a bit of care to be fool-proof about parsing the OpenGL
-     * extensions string. Don't be fooled by sub-strings, etc.
-     */
-
-    start = extensions;
-
-    for (;;) {
-        where = SDL_strstr(start, extension);
-        if (!where)
-            break;
-
-        terminator = where + SDL_strlen(extension);
-        if (where == start || *(where - 1) == ' ')
-            if (*terminator == ' ' || *terminator == '\0')
-                return SDL_TRUE;
-
-        start = terminator;
-    }
-    return SDL_FALSE;
-#else
-    return SDL_FALSE;
-#endif
-}
-
-int
-SDL_GL_SetAttribute(SDL_GLattr attr, int value)
-{
-#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
-    int retval;
-
-    if (!_this) {
-        return SDL_UninitializedVideo();
-    }
-    retval = 0;
-    switch (attr) {
-    case SDL_GL_RED_SIZE:
-        _this->gl_config.red_size = value;
-        break;
-    case SDL_GL_GREEN_SIZE:
-        _this->gl_config.green_size = value;
-        break;
-    case SDL_GL_BLUE_SIZE:
-        _this->gl_config.blue_size = value;
-        break;
-    case SDL_GL_ALPHA_SIZE:
-        _this->gl_config.alpha_size = value;
-        break;
-    case SDL_GL_DOUBLEBUFFER:
-        _this->gl_config.double_buffer = value;
-        break;
-    case SDL_GL_BUFFER_SIZE:
-        _this->gl_config.buffer_size = value;
-        break;
-    case SDL_GL_DEPTH_SIZE:
-        _this->gl_config.depth_size = value;
-        break;
-    case SDL_GL_STENCIL_SIZE:
-        _this->gl_config.stencil_size = value;
-        break;
-    case SDL_GL_ACCUM_RED_SIZE:
-        _this->gl_config.accum_red_size = value;
-        break;
-    case SDL_GL_ACCUM_GREEN_SIZE:
-        _this->gl_config.accum_green_size = value;
-        break;
-    case SDL_GL_ACCUM_BLUE_SIZE:
-        _this->gl_config.accum_blue_size = value;
-        break;
-    case SDL_GL_ACCUM_ALPHA_SIZE:
-        _this->gl_config.accum_alpha_size = value;
-        break;
-    case SDL_GL_STEREO:
-        _this->gl_config.stereo = value;
-        break;
-    case SDL_GL_MULTISAMPLEBUFFERS:
-        _this->gl_config.multisamplebuffers = value;
-        break;
-    case SDL_GL_MULTISAMPLESAMPLES:
-        _this->gl_config.multisamplesamples = value;
-        break;
-    case SDL_GL_ACCELERATED_VISUAL:
-        _this->gl_config.accelerated = value;
-        break;
-    case SDL_GL_RETAINED_BACKING:
-        _this->gl_config.retained_backing = value;
-        break;
-    case SDL_GL_CONTEXT_MAJOR_VERSION:
-        _this->gl_config.major_version = value;
-        break;
-    case SDL_GL_CONTEXT_MINOR_VERSION:
-        _this->gl_config.minor_version = value;
-        break;
-    case SDL_GL_CONTEXT_EGL:
-        /* FIXME: SDL_GL_CONTEXT_EGL to be deprecated in SDL 2.1 */
-        if (value != 0) {
-            SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
-        } else {
-            SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, 0);
-        };
-        break;
-    case SDL_GL_CONTEXT_FLAGS:
-        if( value & ~(SDL_GL_CONTEXT_DEBUG_FLAG |
-              SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG |
-              SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG |
-              SDL_GL_CONTEXT_RESET_ISOLATION_FLAG) ) {
-        retval = SDL_SetError("Unknown OpenGL context flag %d", value);
-        break;
-    }
-        _this->gl_config.flags = value;
-        break;
-    case SDL_GL_CONTEXT_PROFILE_MASK:
-        if( value != 0 &&
-        value != SDL_GL_CONTEXT_PROFILE_CORE &&
-        value != SDL_GL_CONTEXT_PROFILE_COMPATIBILITY &&
-        value != SDL_GL_CONTEXT_PROFILE_ES ) {
-        retval = SDL_SetError("Unknown OpenGL context profile %d", value);
-        break;
-    }
-        _this->gl_config.profile_mask = value;
-        break;
-    case SDL_GL_SHARE_WITH_CURRENT_CONTEXT:
-        _this->gl_config.share_with_current_context = value;
-        break;
-    case SDL_GL_FRAMEBUFFER_SRGB_CAPABLE:
-        _this->gl_config.framebuffer_srgb_capable = value;
-        break;
-    default:
-        retval = SDL_SetError("Unknown OpenGL attribute");
-        break;
-    }
-    return retval;
-#else
-    return SDL_Unsupported();
-#endif /* SDL_VIDEO_OPENGL */
-}
-
-int
-SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
-{
-#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
-    void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params);
-    GLenum(APIENTRY * glGetErrorFunc) (void);
-    GLenum attrib = 0;
-    GLenum error = 0;
-
-    glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
-    if (!glGetIntegervFunc) {
-        return -1;
-    }
-
-    glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
-    if (!glGetErrorFunc) {
-        return -1;
-    }
-
-    /* Clear value in any case */
-    *value = 0;
-
-    switch (attr) {
-    case SDL_GL_RED_SIZE:
-        attrib = GL_RED_BITS;
-        break;
-    case SDL_GL_BLUE_SIZE:
-        attrib = GL_BLUE_BITS;
-        break;
-    case SDL_GL_GREEN_SIZE:
-        attrib = GL_GREEN_BITS;
-        break;
-    case SDL_GL_ALPHA_SIZE:
-        attrib = GL_ALPHA_BITS;
-        break;
-    case SDL_GL_DOUBLEBUFFER:
-#if SDL_VIDEO_OPENGL
-        attrib = GL_DOUBLEBUFFER;
-        break;
-#else
-        /* OpenGL ES 1.0 and above specifications have EGL_SINGLE_BUFFER      */
-        /* parameter which switches double buffer to single buffer. OpenGL ES */
-        /* SDL driver must set proper value after initialization              */
-        *value = _this->gl_config.double_buffer;
-        return 0;
-#endif
-    case SDL_GL_DEPTH_SIZE:
-        attrib = GL_DEPTH_BITS;
-        break;
-    case SDL_GL_STENCIL_SIZE:
-        attrib = GL_STENCIL_BITS;
-        break;
-#if SDL_VIDEO_OPENGL
-    case SDL_GL_ACCUM_RED_SIZE:
-        attrib = GL_ACCUM_RED_BITS;
-        break;
-    case SDL_GL_ACCUM_GREEN_SIZE:
-        attrib = GL_ACCUM_GREEN_BITS;
-        break;
-    case SDL_GL_ACCUM_BLUE_SIZE:
-        attrib = GL_ACCUM_BLUE_BITS;
-        break;
-    case SDL_GL_ACCUM_ALPHA_SIZE:
-        attrib = GL_ACCUM_ALPHA_BITS;
-        break;
-    case SDL_GL_STEREO:
-        attrib = GL_STEREO;
-        break;
-#else
-    case SDL_GL_ACCUM_RED_SIZE:
-    case SDL_GL_ACCUM_GREEN_SIZE:
-    case SDL_GL_ACCUM_BLUE_SIZE:
-    case SDL_GL_ACCUM_ALPHA_SIZE:
-    case SDL_GL_STEREO:
-        /* none of these are supported in OpenGL ES */
-        *value = 0;
-        return 0;
-#endif
-    case SDL_GL_MULTISAMPLEBUFFERS:
-#if SDL_VIDEO_OPENGL
-        attrib = GL_SAMPLE_BUFFERS_ARB;
-#else
-        attrib = GL_SAMPLE_BUFFERS;
-#endif
-        break;
-    case SDL_GL_MULTISAMPLESAMPLES:
-#if SDL_VIDEO_OPENGL
-        attrib = GL_SAMPLES_ARB;
-#else
-        attrib = GL_SAMPLES;
-#endif
-        break;
-    case SDL_GL_BUFFER_SIZE:
-        {
-            GLint bits = 0;
-            GLint component;
-
-            /*
-             * there doesn't seem to be a single flag in OpenGL
-             * for this!
-             */
-            glGetIntegervFunc(GL_RED_BITS, &component);
-            bits += component;
-            glGetIntegervFunc(GL_GREEN_BITS, &component);
-            bits += component;
-            glGetIntegervFunc(GL_BLUE_BITS, &component);
-            bits += component;
-            glGetIntegervFunc(GL_ALPHA_BITS, &component);
-            bits += component;
-
-            *value = bits;
-            return 0;
-        }
-    case SDL_GL_ACCELERATED_VISUAL:
-        {
-            /* FIXME: How do we get this information? */
-            *value = (_this->gl_config.accelerated != 0);
-            return 0;
-        }
-    case SDL_GL_RETAINED_BACKING:
-        {
-            *value = _this->gl_config.retained_backing;
-            return 0;
-        }
-    case SDL_GL_CONTEXT_MAJOR_VERSION:
-        {
-            *value = _this->gl_config.major_version;
-            return 0;
-        }
-    case SDL_GL_CONTEXT_MINOR_VERSION:
-        {
-            *value = _this->gl_config.minor_version;
-            return 0;
-        }
-    case SDL_GL_CONTEXT_EGL:
-        /* FIXME: SDL_GL_CONTEXT_EGL to be deprecated in SDL 2.1 */
-        {
-            if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
-                *value = 1;
-            }
-            else {
-                *value = 0;
-            }
-            return 0;
-        }
-    case SDL_GL_CONTEXT_FLAGS:
-        {
-            *value = _this->gl_config.flags;
-            return 0;
-        }
-    case SDL_GL_CONTEXT_PROFILE_MASK:
-        {
-            *value = _this->gl_config.profile_mask;
-            return 0;
-        }
-    case SDL_GL_SHARE_WITH_CURRENT_CONTEXT:
-        {
-            *value = _this->gl_config.share_with_current_context;
-            return 0;
-        }
-    case SDL_GL_FRAMEBUFFER_SRGB_CAPABLE:
-        {
-            *value = _this->gl_config.framebuffer_srgb_capable;
-            return 0;
-        }
-    default:
-        return SDL_SetError("Unknown OpenGL attribute");
-    }
-
-    glGetIntegervFunc(attrib, (GLint *) value);
-    error = glGetErrorFunc();
-    if (error != GL_NO_ERROR) {
-        if (error == GL_INVALID_ENUM) {
-            return SDL_SetError("OpenGL error: GL_INVALID_ENUM");
-        } else if (error == GL_INVALID_VALUE) {
-            return SDL_SetError("OpenGL error: GL_INVALID_VALUE");
-        }
-        return SDL_SetError("OpenGL error: %08X", error);
-    }
-    return 0;
-#else
-    return SDL_Unsupported();
-#endif /* SDL_VIDEO_OPENGL */
-}
-
-SDL_GLContext
-SDL_GL_CreateContext(SDL_Window * window)
-{
-    SDL_GLContext ctx = NULL;
-    CHECK_WINDOW_MAGIC(window, NULL);
-
-    if (!(window->flags & SDL_WINDOW_OPENGL)) {
-        SDL_SetError("The specified window isn't an OpenGL window");
-        return NULL;
-    }
-
-    ctx = _this->GL_CreateContext(_this, window);
-
-    /* Creating a context is assumed to make it current in the SDL driver. */
-    if (ctx) {
-        _this->current_glwin = window;
-        _this->current_glctx = ctx;
-        SDL_TLSSet(_this->current_glwin_tls, window, NULL);
-        SDL_TLSSet(_this->current_glctx_tls, ctx, NULL);
-    }
-    return ctx;
-}
-
-int
-SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx)
-{
-    int retval;
-
-    if (window == SDL_GL_GetCurrentWindow() &&
-        ctx == SDL_GL_GetCurrentContext()) {
-        /* We're already current. */
-        return 0;
-    }
-
-    if (!ctx) {
-        window = NULL;
-    } else {
-        CHECK_WINDOW_MAGIC(window, -1);
-
-        if (!(window->flags & SDL_WINDOW_OPENGL)) {
-            return SDL_SetError("The specified window isn't an OpenGL window");
-        }
-    }
-
-    retval = _this->GL_MakeCurrent(_this, window, ctx);
-    if (retval == 0) {
-        _this->current_glwin = window;
-        _this->current_glctx = ctx;
-        SDL_TLSSet(_this->current_glwin_tls, window, NULL);
-        SDL_TLSSet(_this->current_glctx_tls, ctx, NULL);
-    }
-    return retval;
-}
-
-SDL_Window *
-SDL_GL_GetCurrentWindow(void)
-{
-    if (!_this) {
-        SDL_UninitializedVideo();
-        return NULL;
-    }
-    return (SDL_Window *)SDL_TLSGet(_this->current_glwin_tls);
-}
-
-SDL_GLContext
-SDL_GL_GetCurrentContext(void)
-{
-    if (!_this) {
-        SDL_UninitializedVideo();
-        return NULL;
-    }
-    return (SDL_GLContext)SDL_TLSGet(_this->current_glctx_tls);
-}
-
-void SDL_GL_GetDrawableSize(SDL_Window * window, int *w, int *h)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (_this->GL_GetDrawableSize) {
-        _this->GL_GetDrawableSize(_this, window, w, h);
-    } else {
-        SDL_GetWindowSize(window, w, h);
-    }
-}
-
-int
-SDL_GL_SetSwapInterval(int interval)
-{
-    if (!_this) {
-        return SDL_UninitializedVideo();
-    } else if (SDL_GL_GetCurrentContext() == NULL) {
-        return SDL_SetError("No OpenGL context has been made current");
-    } else if (_this->GL_SetSwapInterval) {
-        return _this->GL_SetSwapInterval(_this, interval);
-    } else {
-        return SDL_SetError("Setting the swap interval is not supported");
-    }
-}
-
-int
-SDL_GL_GetSwapInterval(void)
-{
-    if (!_this) {
-        return 0;
-    } else if (SDL_GL_GetCurrentContext() == NULL) {
-        return 0;
-    } else if (_this->GL_GetSwapInterval) {
-        return _this->GL_GetSwapInterval(_this);
-    } else {
-        return 0;
-    }
-}
-
-void
-SDL_GL_SwapWindow(SDL_Window * window)
-{
-    CHECK_WINDOW_MAGIC(window, );
-
-    if (!(window->flags & SDL_WINDOW_OPENGL)) {
-        SDL_SetError("The specified window isn't an OpenGL window");
-        return;
-    }
-
-    if (SDL_GL_GetCurrentWindow() != window) {
-        SDL_SetError("The specified window has not been made current");
-        return;
-    }
-
-    _this->GL_SwapWindow(_this, window);
-}
-
-void
-SDL_GL_DeleteContext(SDL_GLContext context)
-{
-    if (!_this || !context) {
-        return;
-    }
-
-    if (SDL_GL_GetCurrentContext() == context) {
-        SDL_GL_MakeCurrent(NULL, NULL);
-    }
-
-    _this->GL_DeleteContext(_this, context);
-}
-
-#if 0                           /* FIXME */
-/*
- * Utility function used by SDL_WM_SetIcon(); flags & 1 for color key, flags
- * & 2 for alpha channel.
- */
-static void
-CreateMaskFromColorKeyOrAlpha(SDL_Surface * icon, Uint8 * mask, int flags)
-{
-    int x, y;
-    Uint32 colorkey;
-#define SET_MASKBIT(icon, x, y, mask) \
-    mask[(y*((icon->w+7)/8))+(x/8)] &= ~(0x01<<(7-(x%8)))
-
-    colorkey = icon->format->colorkey;
-    switch (icon->format->BytesPerPixel) {
-    case 1:
-        {
-            Uint8 *pixels;
-            for (y = 0; y < icon->h; ++y) {
-                pixels = (Uint8 *) icon->pixels + y * icon->pitch;
-                for (x = 0; x < icon->w; ++x) {
-                    if (*pixels++ == colorkey) {
-                        SET_MASKBIT(icon, x, y, mask);
-                    }
-                }
-            }
-        }
-        break;
-
-    case 2:
-        {
-            Uint16 *pixels;
-            for (y = 0; y < icon->h; ++y) {
-                pixels = (Uint16 *) icon->pixels + y * icon->pitch / 2;
-                for (x = 0; x < icon->w; ++x) {
-                    if ((flags & 1) && *pixels == colorkey) {
-                        SET_MASKBIT(icon, x, y, mask);
-                    } else if ((flags & 2)
-                               && (*pixels & icon->format->Amask) == 0) {
-                        SET_MASKBIT(icon, x, y, mask);
-                    }
-                    pixels++;
-                }
-            }
-        }
-        break;
-
-    case 4:
-        {
-            Uint32 *pixels;
-            for (y = 0; y < icon->h; ++y) {
-                pixels = (Uint32 *) icon->pixels + y * icon->pitch / 4;
-                for (x = 0; x < icon->w; ++x) {
-                    if ((flags & 1) && *pixels == colorkey) {
-                        SET_MASKBIT(icon, x, y, mask);
-                    } else if ((flags & 2)
-                               && (*pixels & icon->format->Amask) == 0) {
-                        SET_MASKBIT(icon, x, y, mask);
-                    }
-                    pixels++;
-                }
-            }
-        }
-        break;
-    }
-}
-
-/*
- * Sets the window manager icon for the display window.
- */
-void
-SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask)
-{
-    if (icon && _this->SetIcon) {
-        /* Generate a mask if necessary, and create the icon! */
-        if (mask == NULL) {
-            int mask_len = icon->h * (icon->w + 7) / 8;
-            int flags = 0;
-            mask = (Uint8 *) SDL_malloc(mask_len);
-            if (mask == NULL) {
-                return;
-            }
-            SDL_memset(mask, ~0, mask_len);
-            if (icon->flags & SDL_SRCCOLORKEY)
-                flags |= 1;
-            if (icon->flags & SDL_SRCALPHA)
-                flags |= 2;
-            if (flags) {
-                CreateMaskFromColorKeyOrAlpha(icon, mask, flags);
-            }
-            _this->SetIcon(_this, icon, mask);
-            SDL_free(mask);
-        } else {
-            _this->SetIcon(_this, icon, mask);
-        }
-    }
-}
-#endif
-
-SDL_bool
-SDL_GetWindowWMInfo(SDL_Window * window, struct SDL_SysWMinfo *info)
-{
-    CHECK_WINDOW_MAGIC(window, SDL_FALSE);
-
-    if (!info) {
-        return SDL_FALSE;
-    }
-    info->subsystem = SDL_SYSWM_UNKNOWN;
-
-    if (!_this->GetWindowWMInfo) {
-        return SDL_FALSE;
-    }
-    return (_this->GetWindowWMInfo(_this, window, info));
-}
-
-void
-SDL_StartTextInput(void)
-{
-    SDL_Window *window;
-
-    /* First, enable text events */
-    SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE);
-    SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE);
-
-    /* Then show the on-screen keyboard, if any */
-    window = SDL_GetFocusWindow();
-    if (window && _this && _this->ShowScreenKeyboard) {
-        _this->ShowScreenKeyboard(_this, window);
-    }
-
-    /* Finally start the text input system */
-    if (_this && _this->StartTextInput) {
-        _this->StartTextInput(_this);
-    }
-}
-
-SDL_bool
-SDL_IsTextInputActive(void)
-{
-    return (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE);
-}
-
-void
-SDL_StopTextInput(void)
-{
-    SDL_Window *window;
-
-    /* Stop the text input system */
-    if (_this && _this->StopTextInput) {
-        _this->StopTextInput(_this);
-    }
-
-    /* Hide the on-screen keyboard, if any */
-    window = SDL_GetFocusWindow();
-    if (window && _this && _this->HideScreenKeyboard) {
-        _this->HideScreenKeyboard(_this, window);
-    }
-
-    /* Finally disable text events */
-    SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
-    SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
-}
-
-void
-SDL_SetTextInputRect(SDL_Rect *rect)
-{
-    if (_this && _this->SetTextInputRect) {
-        _this->SetTextInputRect(_this, rect);
-    }
-}
-
-SDL_bool
-SDL_HasScreenKeyboardSupport(void)
-{
-    if (_this && _this->HasScreenKeyboardSupport) {
-        return _this->HasScreenKeyboardSupport(_this);
-    }
-    return SDL_FALSE;
-}
-
-SDL_bool
-SDL_IsScreenKeyboardShown(SDL_Window *window)
-{
-    if (window && _this && _this->IsScreenKeyboardShown) {
-        return _this->IsScreenKeyboardShown(_this, window);
-    }
-    return SDL_FALSE;
-}
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-#include "windows/SDL_windowsmessagebox.h"
-#endif
-#if SDL_VIDEO_DRIVER_COCOA
-#include "cocoa/SDL_cocoamessagebox.h"
-#endif
-#if SDL_VIDEO_DRIVER_UIKIT
-#include "uikit/SDL_uikitmessagebox.h"
-#endif
-#if SDL_VIDEO_DRIVER_X11
-#include "x11/SDL_x11messagebox.h"
-#endif
-
-static SDL_bool SDL_MessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype)
-{
-    SDL_SysWMinfo info;
-    SDL_Window *window = messageboxdata->window;
-
-    if (!window) {
-        return SDL_TRUE;
-    }
-
-    SDL_VERSION(&info.version);
-    if (!SDL_GetWindowWMInfo(window, &info)) {
-        return SDL_TRUE;
-    } else {
-        return (info.subsystem == drivertype);
-    }
-}
-
-int
-SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
-{
-    int dummybutton;
-    int retval = -1;
-    SDL_bool relative_mode;
-    int show_cursor_prev;
-
-    if (!messageboxdata) {
-        return SDL_InvalidParamError("messageboxdata");
-    }
-
-    relative_mode = SDL_GetRelativeMouseMode();
-    SDL_SetRelativeMouseMode(SDL_FALSE);
-    show_cursor_prev = SDL_ShowCursor(1);
-
-    if (!buttonid) {
-        buttonid = &dummybutton;
-    }
-
-    if (_this && _this->ShowMessageBox) {
-        retval = _this->ShowMessageBox(_this, messageboxdata, buttonid);
-    }
-
-    /* It's completely fine to call this function before video is initialized */
-#if SDL_VIDEO_DRIVER_WINDOWS
-    if (retval == -1 &&
-        SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_WINDOWS) &&
-        WIN_ShowMessageBox(messageboxdata, buttonid) == 0) {
-        retval = 0;
-    }
-#endif
-#if SDL_VIDEO_DRIVER_COCOA
-    if (retval == -1 &&
-        SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_COCOA) &&
-        Cocoa_ShowMessageBox(messageboxdata, buttonid) == 0) {
-        retval = 0;
-    }
-#endif
-#if SDL_VIDEO_DRIVER_UIKIT
-    if (retval == -1 &&
-        SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_UIKIT) &&
-        UIKit_ShowMessageBox(messageboxdata, buttonid) == 0) {
-        retval = 0;
-    }
-#endif
-#if SDL_VIDEO_DRIVER_X11
-    if (retval == -1 &&
-        SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_X11) &&
-        X11_ShowMessageBox(messageboxdata, buttonid) == 0) {
-        retval = 0;
-    }
-#endif
-    if (retval == -1) {
-        SDL_SetError("No message system available");
-    }
-
-    SDL_ShowCursor(show_cursor_prev);
-    SDL_SetRelativeMouseMode(relative_mode);
-
-    return retval;
-}
-
-int
-SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window)
-{
-    SDL_MessageBoxData data;
-    SDL_MessageBoxButtonData button;
-
-    SDL_zero(data);
-    data.flags = flags;
-    data.title = title;
-    data.message = message;
-    data.numbuttons = 1;
-    data.buttons = &button;
-    data.window = window;
-
-    SDL_zero(button);
-    button.flags |= SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT;
-    button.flags |= SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT;
-    button.text = "OK";
-
-    return SDL_ShowMessageBox(&data, NULL);
-}
-
-SDL_bool
-SDL_ShouldAllowTopmost(void)
-{
-    const char *hint = SDL_GetHint(SDL_HINT_ALLOW_TOPMOST);
-    if (hint) {
-        if (*hint == '0') {
-            return SDL_FALSE;
-        } else {
-            return SDL_TRUE;
-        }
-    }
-    return SDL_TRUE;
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidclipboard.c b/deps/SDL2/src/video/android/SDL_androidclipboard.c
deleted file mode 100644
index 19a70a3..0000000
--- a/deps/SDL2/src/video/android/SDL_androidclipboard.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_ANDROID
-
-#include "SDL_androidvideo.h"
-
-#include "../../core/android/SDL_android.h"
-
-int
-Android_SetClipboardText(_THIS, const char *text)
-{
-    return Android_JNI_SetClipboardText(text);
-}
-
-char *
-Android_GetClipboardText(_THIS)
-{
-    return Android_JNI_GetClipboardText();
-}
-
-SDL_bool Android_HasClipboardText(_THIS)
-{
-    return Android_JNI_HasClipboardText();
-}
-
-#endif /* SDL_VIDEO_DRIVER_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidclipboard.h b/deps/SDL2/src/video/android/SDL_androidclipboard.h
deleted file mode 100644
index d1cdaf1..0000000
--- a/deps/SDL2/src/video/android/SDL_androidclipboard.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_androidclipboard_h
-#define _SDL_androidclipboard_h
-
-extern int Android_SetClipboardText(_THIS, const char *text);
-extern char *Android_GetClipboardText(_THIS);
-extern SDL_bool Android_HasClipboardText(_THIS);
-
-#endif /* _SDL_androidclipboard_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidevents.c b/deps/SDL2/src/video/android/SDL_androidevents.c
deleted file mode 100644
index 9be49cf..0000000
--- a/deps/SDL2/src/video/android/SDL_androidevents.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_ANDROID
-
-/* We're going to do this by default */
-#define SDL_ANDROID_BLOCK_ON_PAUSE  1
-
-#include "SDL_androidevents.h"
-#include "SDL_events.h"
-#include "SDL_androidwindow.h"
-
-void android_egl_context_backup();
-void android_egl_context_restore();
-
-void 
-android_egl_context_restore() 
-{
-    SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata;
-    if (SDL_GL_MakeCurrent(Android_Window, (SDL_GLContext) data->egl_context) < 0) {
-        /* The context is no longer valid, create a new one */
-        /* FIXME: Notify the user that the context changed and textures need to be re created */
-        data->egl_context = (EGLContext) SDL_GL_CreateContext(Android_Window);
-        SDL_GL_MakeCurrent(Android_Window, (SDL_GLContext) data->egl_context);
-    }
-}
-
-void 
-android_egl_context_backup() 
-{
-    /* Keep a copy of the EGL Context so we can try to restore it when we resume */
-    SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata;
-    data->egl_context = SDL_GL_GetCurrentContext();
-    /* We need to do this so the EGLSurface can be freed */
-    SDL_GL_MakeCurrent(Android_Window, NULL);
-}
-
-void
-Android_PumpEvents(_THIS)
-{
-    static int isPaused = 0;
-#if SDL_ANDROID_BLOCK_ON_PAUSE
-    static int isPausing = 0;
-#endif
-    /* No polling necessary */
-
-    /*
-     * Android_ResumeSem and Android_PauseSem are signaled from Java_org_libsdl_app_SDLActivity_nativePause and Java_org_libsdl_app_SDLActivity_nativeResume
-     * When the pause semaphore is signaled, if SDL_ANDROID_BLOCK_ON_PAUSE is defined the event loop will block until the resume signal is emitted.
-     * When the resume semaphore is signaled, SDL_GL_CreateContext is called which in turn calls Java code
-     * SDLActivity::createGLContext -> SDLActivity:: initEGL -> SDLActivity::createEGLSurface -> SDLActivity::createEGLContext
-     */
-
-#if SDL_ANDROID_BLOCK_ON_PAUSE
-    if (isPaused && !isPausing) {
-        /* Make sure this is the last thing we do before pausing */
-        android_egl_context_backup();
-        if(SDL_SemWait(Android_ResumeSem) == 0) {
-#else
-    if (isPaused) {
-        if(SDL_SemTryWait(Android_ResumeSem) == 0) {
-#endif
-            isPaused = 0;
-            
-            /* Restore the GL Context from here, as this operation is thread dependent */
-            android_egl_context_restore();
-        }
-    }
-    else {
-#if SDL_ANDROID_BLOCK_ON_PAUSE
-        if( isPausing || SDL_SemTryWait(Android_PauseSem) == 0 ) {
-            /* We've been signaled to pause, but before we block ourselves, 
-            we need to make sure that certain key events have reached the app */
-            if (SDL_HasEvent(SDL_WINDOWEVENT) || SDL_HasEvent(SDL_APP_WILLENTERBACKGROUND) || SDL_HasEvent(SDL_APP_DIDENTERBACKGROUND) ) {
-                isPausing = 1;
-            }
-            else {
-                isPausing = 0;
-                isPaused = 1;
-            }
-        }
-#else
-        if(SDL_SemTryWait(Android_PauseSem) == 0) {
-            android_egl_context_backup();
-            isPaused = 1;
-        }
-#endif
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidevents.h b/deps/SDL2/src/video/android/SDL_androidevents.h
deleted file mode 100644
index 970131c..0000000
--- a/deps/SDL2/src/video/android/SDL_androidevents.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_androidvideo.h"
-
-extern void Android_PumpEvents(_THIS);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidgl.c b/deps/SDL2/src/video/android/SDL_androidgl.c
deleted file mode 100644
index 691fbf7..0000000
--- a/deps/SDL2/src/video/android/SDL_androidgl.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_ANDROID
-
-/* Android SDL video driver implementation */
-
-#include "SDL_video.h"
-#include "../SDL_egl.h"
-#include "SDL_androidwindow.h"
-
-#include "SDL_androidvideo.h"
-#include "../../core/android/SDL_android.h"
-
-#include <android/log.h>
-
-#include <dlfcn.h>
-
-SDL_EGL_CreateContext_impl(Android)
-SDL_EGL_MakeCurrent_impl(Android)
-
-void
-Android_GLES_SwapWindow(_THIS, SDL_Window * window)
-{
-    /* FIXME: These two functions were in the Java code, do we really need them? */
-    _this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE);
-    _this->egl_data->eglWaitGL();
-    SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
-}
-
-int
-Android_GLES_LoadLibrary(_THIS, const char *path) {
-    return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) 0);
-}
-
-#endif /* SDL_VIDEO_DRIVER_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidkeyboard.c b/deps/SDL2/src/video/android/SDL_androidkeyboard.c
deleted file mode 100644
index 5381de6..0000000
--- a/deps/SDL2/src/video/android/SDL_androidkeyboard.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_ANDROID
-
-#include <android/log.h>
-
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_androidkeyboard.h"
-
-#include "../../core/android/SDL_android.h"
-
-void Android_InitKeyboard(void)
-{
-    SDL_Keycode keymap[SDL_NUM_SCANCODES];
-
-    /* Add default scancode to key mapping */
-    SDL_GetDefaultKeymap(keymap);
-    SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
-}
-
-static SDL_Scancode Android_Keycodes[] = {
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_UNKNOWN */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_LEFT */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_RIGHT */
-    SDL_SCANCODE_AC_HOME, /* AKEYCODE_HOME */
-    SDL_SCANCODE_AC_BACK, /* AKEYCODE_BACK */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALL */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ENDCALL */
-    SDL_SCANCODE_0, /* AKEYCODE_0 */
-    SDL_SCANCODE_1, /* AKEYCODE_1 */
-    SDL_SCANCODE_2, /* AKEYCODE_2 */
-    SDL_SCANCODE_3, /* AKEYCODE_3 */
-    SDL_SCANCODE_4, /* AKEYCODE_4 */
-    SDL_SCANCODE_5, /* AKEYCODE_5 */
-    SDL_SCANCODE_6, /* AKEYCODE_6 */
-    SDL_SCANCODE_7, /* AKEYCODE_7 */
-    SDL_SCANCODE_8, /* AKEYCODE_8 */
-    SDL_SCANCODE_9, /* AKEYCODE_9 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STAR */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_POUND */
-    SDL_SCANCODE_UP, /* AKEYCODE_DPAD_UP */
-    SDL_SCANCODE_DOWN, /* AKEYCODE_DPAD_DOWN */
-    SDL_SCANCODE_LEFT, /* AKEYCODE_DPAD_LEFT */
-    SDL_SCANCODE_RIGHT, /* AKEYCODE_DPAD_RIGHT */
-    SDL_SCANCODE_SELECT, /* AKEYCODE_DPAD_CENTER */
-    SDL_SCANCODE_VOLUMEUP, /* AKEYCODE_VOLUME_UP */
-    SDL_SCANCODE_VOLUMEDOWN, /* AKEYCODE_VOLUME_DOWN */
-    SDL_SCANCODE_POWER, /* AKEYCODE_POWER */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAMERA */
-    SDL_SCANCODE_CLEAR, /* AKEYCODE_CLEAR */
-    SDL_SCANCODE_A, /* AKEYCODE_A */
-    SDL_SCANCODE_B, /* AKEYCODE_B */
-    SDL_SCANCODE_C, /* AKEYCODE_C */
-    SDL_SCANCODE_D, /* AKEYCODE_D */
-    SDL_SCANCODE_E, /* AKEYCODE_E */
-    SDL_SCANCODE_F, /* AKEYCODE_F */
-    SDL_SCANCODE_G, /* AKEYCODE_G */
-    SDL_SCANCODE_H, /* AKEYCODE_H */
-    SDL_SCANCODE_I, /* AKEYCODE_I */
-    SDL_SCANCODE_J, /* AKEYCODE_J */
-    SDL_SCANCODE_K, /* AKEYCODE_K */
-    SDL_SCANCODE_L, /* AKEYCODE_L */
-    SDL_SCANCODE_M, /* AKEYCODE_M */
-    SDL_SCANCODE_N, /* AKEYCODE_N */
-    SDL_SCANCODE_O, /* AKEYCODE_O */
-    SDL_SCANCODE_P, /* AKEYCODE_P */
-    SDL_SCANCODE_Q, /* AKEYCODE_Q */
-    SDL_SCANCODE_R, /* AKEYCODE_R */
-    SDL_SCANCODE_S, /* AKEYCODE_S */
-    SDL_SCANCODE_T, /* AKEYCODE_T */
-    SDL_SCANCODE_U, /* AKEYCODE_U */
-    SDL_SCANCODE_V, /* AKEYCODE_V */
-    SDL_SCANCODE_W, /* AKEYCODE_W */
-    SDL_SCANCODE_X, /* AKEYCODE_X */
-    SDL_SCANCODE_Y, /* AKEYCODE_Y */
-    SDL_SCANCODE_Z, /* AKEYCODE_Z */
-    SDL_SCANCODE_COMMA, /* AKEYCODE_COMMA */
-    SDL_SCANCODE_PERIOD, /* AKEYCODE_PERIOD */
-    SDL_SCANCODE_LALT, /* AKEYCODE_ALT_LEFT */
-    SDL_SCANCODE_RALT, /* AKEYCODE_ALT_RIGHT */
-    SDL_SCANCODE_LSHIFT, /* AKEYCODE_SHIFT_LEFT */
-    SDL_SCANCODE_RSHIFT, /* AKEYCODE_SHIFT_RIGHT */
-    SDL_SCANCODE_TAB, /* AKEYCODE_TAB */
-    SDL_SCANCODE_SPACE, /* AKEYCODE_SPACE */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SYM */
-    SDL_SCANCODE_WWW, /* AKEYCODE_EXPLORER */
-    SDL_SCANCODE_MAIL, /* AKEYCODE_ENVELOPE */
-    SDL_SCANCODE_RETURN, /* AKEYCODE_ENTER */
-    SDL_SCANCODE_BACKSPACE, /* AKEYCODE_DEL */
-    SDL_SCANCODE_GRAVE, /* AKEYCODE_GRAVE */
-    SDL_SCANCODE_MINUS, /* AKEYCODE_MINUS */
-    SDL_SCANCODE_EQUALS, /* AKEYCODE_EQUALS */
-    SDL_SCANCODE_LEFTBRACKET, /* AKEYCODE_LEFT_BRACKET */
-    SDL_SCANCODE_RIGHTBRACKET, /* AKEYCODE_RIGHT_BRACKET */
-    SDL_SCANCODE_BACKSLASH, /* AKEYCODE_BACKSLASH */
-    SDL_SCANCODE_SEMICOLON, /* AKEYCODE_SEMICOLON */
-    SDL_SCANCODE_APOSTROPHE, /* AKEYCODE_APOSTROPHE */
-    SDL_SCANCODE_SLASH, /* AKEYCODE_SLASH */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AT */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HEADSETHOOK */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FOCUS */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PLUS */
-    SDL_SCANCODE_MENU, /* AKEYCODE_MENU */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NOTIFICATION */
-    SDL_SCANCODE_AC_SEARCH, /* AKEYCODE_SEARCH */
-    SDL_SCANCODE_AUDIOPLAY, /* AKEYCODE_MEDIA_PLAY_PAUSE */
-    SDL_SCANCODE_AUDIOSTOP, /* AKEYCODE_MEDIA_STOP */
-    SDL_SCANCODE_AUDIONEXT, /* AKEYCODE_MEDIA_NEXT */
-    SDL_SCANCODE_AUDIOPREV, /* AKEYCODE_MEDIA_PREVIOUS */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_REWIND */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_FAST_FORWARD */
-    SDL_SCANCODE_MUTE, /* AKEYCODE_MUTE */
-    SDL_SCANCODE_PAGEUP, /* AKEYCODE_PAGE_UP */
-    SDL_SCANCODE_PAGEDOWN, /* AKEYCODE_PAGE_DOWN */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PICTSYMBOLS */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SWITCH_CHARSET */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_A */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_B */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_C */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_X */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Y */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Z */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L1 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R1 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L2 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R2 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBL */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBR */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_START */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_SELECT */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_MODE */
-    SDL_SCANCODE_ESCAPE, /* AKEYCODE_ESCAPE */
-    SDL_SCANCODE_DELETE, /* AKEYCODE_FORWARD_DEL */
-    SDL_SCANCODE_LCTRL, /* AKEYCODE_CTRL_LEFT */
-    SDL_SCANCODE_RCTRL, /* AKEYCODE_CTRL_RIGHT */
-    SDL_SCANCODE_CAPSLOCK, /* AKEYCODE_CAPS_LOCK */
-    SDL_SCANCODE_SCROLLLOCK, /* AKEYCODE_SCROLL_LOCK */
-    SDL_SCANCODE_LGUI, /* AKEYCODE_META_LEFT */
-    SDL_SCANCODE_RGUI, /* AKEYCODE_META_RIGHT */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FUNCTION */
-    SDL_SCANCODE_PRINTSCREEN, /* AKEYCODE_SYSRQ */
-    SDL_SCANCODE_PAUSE, /* AKEYCODE_BREAK */
-    SDL_SCANCODE_HOME, /* AKEYCODE_MOVE_HOME */
-    SDL_SCANCODE_END, /* AKEYCODE_MOVE_END */
-    SDL_SCANCODE_INSERT, /* AKEYCODE_INSERT */
-    SDL_SCANCODE_AC_FORWARD, /* AKEYCODE_FORWARD */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PLAY */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PAUSE */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_CLOSE */
-    SDL_SCANCODE_EJECT, /* AKEYCODE_MEDIA_EJECT */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_RECORD */
-    SDL_SCANCODE_F1, /* AKEYCODE_F1 */
-    SDL_SCANCODE_F2, /* AKEYCODE_F2 */
-    SDL_SCANCODE_F3, /* AKEYCODE_F3 */
-    SDL_SCANCODE_F4, /* AKEYCODE_F4 */
-    SDL_SCANCODE_F5, /* AKEYCODE_F5 */
-    SDL_SCANCODE_F6, /* AKEYCODE_F6 */
-    SDL_SCANCODE_F7, /* AKEYCODE_F7 */
-    SDL_SCANCODE_F8, /* AKEYCODE_F8 */
-    SDL_SCANCODE_F9, /* AKEYCODE_F9 */
-    SDL_SCANCODE_F10, /* AKEYCODE_F10 */
-    SDL_SCANCODE_F11, /* AKEYCODE_F11 */
-    SDL_SCANCODE_F12, /* AKEYCODE_F12 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM_LOCK */
-    SDL_SCANCODE_KP_0, /* AKEYCODE_NUMPAD_0 */
-    SDL_SCANCODE_KP_1, /* AKEYCODE_NUMPAD_1 */
-    SDL_SCANCODE_KP_2, /* AKEYCODE_NUMPAD_2 */
-    SDL_SCANCODE_KP_3, /* AKEYCODE_NUMPAD_3 */
-    SDL_SCANCODE_KP_4, /* AKEYCODE_NUMPAD_4 */
-    SDL_SCANCODE_KP_5, /* AKEYCODE_NUMPAD_5 */
-    SDL_SCANCODE_KP_6, /* AKEYCODE_NUMPAD_6 */
-    SDL_SCANCODE_KP_7, /* AKEYCODE_NUMPAD_7 */
-    SDL_SCANCODE_KP_8, /* AKEYCODE_NUMPAD_8 */
-    SDL_SCANCODE_KP_9, /* AKEYCODE_NUMPAD_9 */
-    SDL_SCANCODE_KP_DIVIDE, /* AKEYCODE_NUMPAD_DIVIDE */
-    SDL_SCANCODE_KP_MULTIPLY, /* AKEYCODE_NUMPAD_MULTIPLY */
-    SDL_SCANCODE_KP_MINUS, /* AKEYCODE_NUMPAD_SUBTRACT */
-    SDL_SCANCODE_KP_PLUS, /* AKEYCODE_NUMPAD_ADD */
-    SDL_SCANCODE_KP_PERIOD, /* AKEYCODE_NUMPAD_DOT */
-    SDL_SCANCODE_KP_COMMA, /* AKEYCODE_NUMPAD_COMMA */
-    SDL_SCANCODE_KP_ENTER, /* AKEYCODE_NUMPAD_ENTER */
-    SDL_SCANCODE_KP_EQUALS, /* AKEYCODE_NUMPAD_EQUALS */
-    SDL_SCANCODE_KP_LEFTPAREN, /* AKEYCODE_NUMPAD_LEFT_PAREN */
-    SDL_SCANCODE_KP_RIGHTPAREN, /* AKEYCODE_NUMPAD_RIGHT_PAREN */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_VOLUME_MUTE */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_INFO */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_UP */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_DOWN */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_IN */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_OUT */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_WINDOW */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_GUIDE */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DVR */
-    SDL_SCANCODE_AC_BOOKMARKS, /* AKEYCODE_BOOKMARK */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAPTIONS */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SETTINGS */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_POWER */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_POWER */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_INPUT */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_POWER */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_INPUT */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_RED */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_GREEN */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_YELLOW */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_BLUE */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_APP_SWITCH */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_1 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_2 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_3 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_4 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_5 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_6 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_7 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_8 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_9 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_10 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_11 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_12 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_13 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_14 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_15 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_16 */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_LANGUAGE_SWITCH */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MANNER_MODE */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_3D_MODE */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CONTACTS */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALENDAR */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUSIC */
-    SDL_SCANCODE_CALCULATOR, /* AKEYCODE_CALCULATOR */
-    SDL_SCANCODE_LANG5, /* AKEYCODE_ZENKAKU_HANKAKU */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_EISU */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUHENKAN */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HENKAN */
-    SDL_SCANCODE_LANG3, /* AKEYCODE_KATAKANA_HIRAGANA */
-    SDL_SCANCODE_INTERNATIONAL3, /* AKEYCODE_YEN */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_RO */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_KANA */
-    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ASSIST */
-    SDL_SCANCODE_BRIGHTNESSDOWN, /* AKEYCODE_BRIGHTNESS_DOWN */
-    SDL_SCANCODE_BRIGHTNESSUP, /* AKEYCODE_BRIGHTNESS_UP */
-};
-
-static SDL_Scancode
-TranslateKeycode(int keycode)
-{
-    SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;
-
-    if (keycode < SDL_arraysize(Android_Keycodes)) {
-        scancode = Android_Keycodes[keycode];
-    }
-    if (scancode == SDL_SCANCODE_UNKNOWN) {
-        __android_log_print(ANDROID_LOG_INFO, "SDL", "Unknown keycode %d", keycode);
-    }
-    return scancode;
-}
-
-int
-Android_OnKeyDown(int keycode)
-{
-    return SDL_SendKeyboardKey(SDL_PRESSED, TranslateKeycode(keycode));
-}
-
-int
-Android_OnKeyUp(int keycode)
-{
-    return SDL_SendKeyboardKey(SDL_RELEASED, TranslateKeycode(keycode));
-}
-
-SDL_bool
-Android_HasScreenKeyboardSupport(_THIS)
-{
-    return SDL_TRUE;
-}
-
-SDL_bool
-Android_IsScreenKeyboardShown(_THIS, SDL_Window * window)
-{
-    return SDL_IsTextInputActive();
-}
-
-void
-Android_StartTextInput(_THIS)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
-    Android_JNI_ShowTextInput(&videodata->textRect);
-}
-
-void
-Android_StopTextInput(_THIS)
-{
-    Android_JNI_HideTextInput();
-}
-
-void
-Android_SetTextInputRect(_THIS, SDL_Rect *rect)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
-
-    if (!rect) {
-        SDL_InvalidParamError("rect");
-        return;
-    }
-
-    videodata->textRect = *rect;
-}
-
-#endif /* SDL_VIDEO_DRIVER_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidkeyboard.h b/deps/SDL2/src/video/android/SDL_androidkeyboard.h
deleted file mode 100644
index da8da9b..0000000
--- a/deps/SDL2/src/video/android/SDL_androidkeyboard.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_androidvideo.h"
-
-extern void Android_InitKeyboard(void);
-extern int Android_OnKeyDown(int keycode);
-extern int Android_OnKeyUp(int keycode);
-
-extern SDL_bool Android_HasScreenKeyboardSupport(_THIS);
-extern SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window * window);
-
-extern void Android_StartTextInput(_THIS);
-extern void Android_StopTextInput(_THIS);
-extern void Android_SetTextInputRect(_THIS, SDL_Rect *rect);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidtouch.c b/deps/SDL2/src/video/android/SDL_androidtouch.c
deleted file mode 100644
index 6ad26e2..0000000
--- a/deps/SDL2/src/video/android/SDL_androidtouch.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_ANDROID
-
-#include <android/log.h>
-
-#include "SDL_events.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/SDL_touch_c.h"
-#include "SDL_log.h"
-
-#include "SDL_androidtouch.h"
-
-#include "../../core/android/SDL_android.h"
-
-#define ACTION_DOWN 0
-#define ACTION_UP 1
-#define ACTION_MOVE 2
-#define ACTION_CANCEL 3
-#define ACTION_OUTSIDE 4
-/* The following two are deprecated but it seems they are still emitted (instead the corresponding ACTION_UP/DOWN) as of Android 3.2 */
-#define ACTION_POINTER_1_DOWN 5
-#define ACTION_POINTER_1_UP 6
-
-static SDL_FingerID leftFingerDown = 0;
-
-static void Android_GetWindowCoordinates(float x, float y,
-                                         int *window_x, int *window_y)
-{
-    int window_w, window_h;
-
-    SDL_GetWindowSize(Android_Window, &window_w, &window_h);
-    *window_x = (int)(x * window_w);
-    *window_y = (int)(y * window_h);
-}
-
-void Android_InitTouch(void)
-{
-    int i;
-    int* ids;
-    int number = Android_JNI_GetTouchDeviceIds(&ids);
-    if (0 < number) {
-        for (i = 0; i < number; ++i) {
-            SDL_AddTouch((SDL_TouchID) ids[i], ""); /* no error handling */
-        }
-        SDL_free(ids);
-    }
-}
-
-void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p)
-{
-    SDL_TouchID touchDeviceId = 0;
-    SDL_FingerID fingerId = 0;
-    int window_x, window_y;
-
-    if (!Android_Window) {
-        return;
-    }
-
-    touchDeviceId = (SDL_TouchID)touch_device_id_in;
-    if (SDL_AddTouch(touchDeviceId, "") < 0) {
-        SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
-    }
-
-    fingerId = (SDL_FingerID)pointer_finger_id_in;
-    switch (action) {
-        case ACTION_DOWN:
-        case ACTION_POINTER_1_DOWN:
-            if (!leftFingerDown) {
-                Android_GetWindowCoordinates(x, y, &window_x, &window_y);
-
-                /* send moved event */
-                SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, window_x, window_y);
-
-                /* send mouse down event */
-                SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
-
-                leftFingerDown = fingerId;
-            }
-            SDL_SendTouch(touchDeviceId, fingerId, SDL_TRUE, x, y, p);
-            break;
-        case ACTION_MOVE:
-            if (!leftFingerDown) {
-                Android_GetWindowCoordinates(x, y, &window_x, &window_y);
-
-                /* send moved event */
-                SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, window_x, window_y);
-            }
-            SDL_SendTouchMotion(touchDeviceId, fingerId, x, y, p);
-            break;
-        case ACTION_UP:
-        case ACTION_POINTER_1_UP:
-            if (fingerId == leftFingerDown) {
-                /* send mouse up */
-                SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
-                leftFingerDown = 0;
-            }
-            SDL_SendTouch(touchDeviceId, fingerId, SDL_FALSE, x, y, p);
-            break;
-        default:
-            break;
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidtouch.h b/deps/SDL2/src/video/android/SDL_androidtouch.h
deleted file mode 100644
index 346d73a..0000000
--- a/deps/SDL2/src/video/android/SDL_androidtouch.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_androidvideo.h"
-
-extern void Android_InitTouch(void);
-extern void Android_OnTouch( int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidvideo.c b/deps/SDL2/src/video/android/SDL_androidvideo.c
deleted file mode 100644
index fc766ec..0000000
--- a/deps/SDL2/src/video/android/SDL_androidvideo.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_ANDROID
-
-/* Android SDL video driver implementation
-*/
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "../../events/SDL_windowevents_c.h"
-
-#include "SDL_androidvideo.h"
-#include "SDL_androidclipboard.h"
-#include "SDL_androidevents.h"
-#include "SDL_androidkeyboard.h"
-#include "SDL_androidtouch.h"
-#include "SDL_androidwindow.h"
-
-#define ANDROID_VID_DRIVER_NAME "Android"
-
-/* Initialization/Query functions */
-static int Android_VideoInit(_THIS);
-static void Android_VideoQuit(_THIS);
-
-#include "../SDL_egl.h"
-/* GL functions (SDL_androidgl.c) */
-extern SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window * window);
-extern int Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
-extern void Android_GLES_SwapWindow(_THIS, SDL_Window * window);
-extern int Android_GLES_LoadLibrary(_THIS, const char *path);
-#define Android_GLES_GetProcAddress SDL_EGL_GetProcAddress
-#define Android_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
-#define Android_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
-#define Android_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
-#define Android_GLES_DeleteContext SDL_EGL_DeleteContext
-
-/* Android driver bootstrap functions */
-
-
-/* These are filled in with real values in Android_SetScreenResolution on init (before SDL_main()) */
-int Android_ScreenWidth = 0;
-int Android_ScreenHeight = 0;
-Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN;
-SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL;
-
-/* Currently only one window */
-SDL_Window *Android_Window = NULL;
-
-static int
-Android_Available(void)
-{
-    return 1;
-}
-
-static void
-Android_DeleteDevice(SDL_VideoDevice * device)
-{
-    SDL_free(device);
-}
-
-static SDL_VideoDevice *
-Android_CreateDevice(int devindex)
-{
-    SDL_VideoDevice *device;
-    SDL_VideoData *data;
-
-    /* Initialize all variables that we clean on shutdown */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-    if (!device) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    data = (SDL_VideoData*) SDL_calloc(1, sizeof(SDL_VideoData));
-    if (!data) {
-        SDL_OutOfMemory();
-        SDL_free(device);
-        return NULL;
-    }
-
-    device->driverdata = data;
-
-    /* Set the function pointers */
-    device->VideoInit = Android_VideoInit;
-    device->VideoQuit = Android_VideoQuit;
-    device->PumpEvents = Android_PumpEvents;
-
-    device->CreateWindow = Android_CreateWindow;
-    device->SetWindowTitle = Android_SetWindowTitle;
-    device->DestroyWindow = Android_DestroyWindow;
-
-    device->free = Android_DeleteDevice;
-
-    /* GL pointers */
-    device->GL_LoadLibrary = Android_GLES_LoadLibrary;
-    device->GL_GetProcAddress = Android_GLES_GetProcAddress;
-    device->GL_UnloadLibrary = Android_GLES_UnloadLibrary;
-    device->GL_CreateContext = Android_GLES_CreateContext;
-    device->GL_MakeCurrent = Android_GLES_MakeCurrent;
-    device->GL_SetSwapInterval = Android_GLES_SetSwapInterval;
-    device->GL_GetSwapInterval = Android_GLES_GetSwapInterval;
-    device->GL_SwapWindow = Android_GLES_SwapWindow;
-    device->GL_DeleteContext = Android_GLES_DeleteContext;
-
-    /* Text input */
-    device->StartTextInput = Android_StartTextInput;
-    device->StopTextInput = Android_StopTextInput;
-    device->SetTextInputRect = Android_SetTextInputRect;
-
-    /* Screen keyboard */
-    device->HasScreenKeyboardSupport = Android_HasScreenKeyboardSupport;
-    device->IsScreenKeyboardShown = Android_IsScreenKeyboardShown;
-
-    /* Clipboard */
-    device->SetClipboardText = Android_SetClipboardText;
-    device->GetClipboardText = Android_GetClipboardText;
-    device->HasClipboardText = Android_HasClipboardText;
-
-    return device;
-}
-
-VideoBootStrap Android_bootstrap = {
-    ANDROID_VID_DRIVER_NAME, "SDL Android video driver",
-    Android_Available, Android_CreateDevice
-};
-
-
-int
-Android_VideoInit(_THIS)
-{
-    SDL_DisplayMode mode;
-
-    mode.format = Android_ScreenFormat;
-    mode.w = Android_ScreenWidth;
-    mode.h = Android_ScreenHeight;
-    mode.refresh_rate = 0;
-    mode.driverdata = NULL;
-    if (SDL_AddBasicVideoDisplay(&mode) < 0) {
-        return -1;
-    }
-
-    SDL_AddDisplayMode(&_this->displays[0], &mode);
-
-    Android_InitKeyboard();
-
-    Android_InitTouch();
-
-    /* We're done! */
-    return 0;
-}
-
-void
-Android_VideoQuit(_THIS)
-{
-}
-
-/* This function gets called before VideoInit() */
-void
-Android_SetScreenResolution(int width, int height, Uint32 format)
-{
-    Android_ScreenWidth = width;
-    Android_ScreenHeight = height;
-    Android_ScreenFormat = format;
-
-    if (Android_Window) {
-        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height);
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidvideo.h b/deps/SDL2/src/video/android/SDL_androidvideo.h
deleted file mode 100644
index 3f509ab..0000000
--- a/deps/SDL2/src/video/android/SDL_androidvideo.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_androidvideo_h
-#define _SDL_androidvideo_h
-
-#include "SDL_mutex.h"
-#include "SDL_rect.h"
-#include "../SDL_sysvideo.h"
-
-/* Called by the JNI layer when the screen changes size or format */
-extern void Android_SetScreenResolution(int width, int height, Uint32 format);
-
-/* Private display data */
-
-typedef struct SDL_VideoData
-{
-    SDL_Rect        textRect;
-} SDL_VideoData;
-
-extern int Android_ScreenWidth;
-extern int Android_ScreenHeight;
-extern Uint32 Android_ScreenFormat;
-extern SDL_sem *Android_PauseSem, *Android_ResumeSem;
-extern SDL_Window *Android_Window;
-
-
-#endif /* _SDL_androidvideo_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidwindow.c b/deps/SDL2/src/video/android/SDL_androidwindow.c
deleted file mode 100644
index acc40db..0000000
--- a/deps/SDL2/src/video/android/SDL_androidwindow.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_ANDROID
-
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/SDL_mouse_c.h"
-
-#include "SDL_androidvideo.h"
-#include "SDL_androidwindow.h"
-
-int
-Android_CreateWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data;
-    
-    if (Android_Window) {
-        return SDL_SetError("Android only supports one window");
-    }
-    
-    Android_PauseSem = SDL_CreateSemaphore(0);
-    Android_ResumeSem = SDL_CreateSemaphore(0);
-
-    /* Adjust the window data to match the screen */
-    window->x = 0;
-    window->y = 0;
-    window->w = Android_ScreenWidth;
-    window->h = Android_ScreenHeight;
-
-    window->flags &= ~SDL_WINDOW_RESIZABLE;     /* window is NEVER resizeable */
-    window->flags |= SDL_WINDOW_FULLSCREEN;     /* window is always fullscreen */
-    window->flags &= ~SDL_WINDOW_HIDDEN;
-    window->flags |= SDL_WINDOW_SHOWN;          /* only one window on Android */
-    window->flags |= SDL_WINDOW_INPUT_FOCUS;    /* always has input focus */
-
-    /* One window, it always has focus */
-    SDL_SetMouseFocus(window);
-    SDL_SetKeyboardFocus(window);
-    
-    data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        return SDL_OutOfMemory();
-    }
-    
-    data->native_window = Android_JNI_GetNativeWindow();
-    
-    if (!data->native_window) {
-        SDL_free(data);
-        return SDL_SetError("Could not fetch native window");
-    }
-    
-    data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->native_window);
-
-    if (data->egl_surface == EGL_NO_SURFACE) {
-        SDL_free(data);
-        return SDL_SetError("Could not create GLES window surface");
-    }
-
-    window->driverdata = data;
-    Android_Window = window;
-    
-    return 0;
-}
-
-void
-Android_SetWindowTitle(_THIS, SDL_Window * window)
-{
-    Android_JNI_SetActivityTitle(window->title);
-}
-
-void
-Android_DestroyWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data;
-    
-    if (window == Android_Window) {
-        Android_Window = NULL;
-        if (Android_PauseSem) SDL_DestroySemaphore(Android_PauseSem);
-        if (Android_ResumeSem) SDL_DestroySemaphore(Android_ResumeSem);
-        Android_PauseSem = NULL;
-        Android_ResumeSem = NULL;
-        
-        if(window->driverdata) {
-            data = (SDL_WindowData *) window->driverdata;
-            if(data->native_window) {
-                ANativeWindow_release(data->native_window);
-            }
-            SDL_free(window->driverdata);
-            window->driverdata = NULL;
-        }
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_ANDROID */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/android/SDL_androidwindow.h b/deps/SDL2/src/video/android/SDL_androidwindow.h
deleted file mode 100644
index 4365cd4..0000000
--- a/deps/SDL2/src/video/android/SDL_androidwindow.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_androidwindow_h
-#define _SDL_androidwindow_h
-
-#include "../../core/android/SDL_android.h"
-#include "../SDL_egl.h"
-
-extern int Android_CreateWindow(_THIS, SDL_Window * window);
-extern void Android_SetWindowTitle(_THIS, SDL_Window * window);
-extern void Android_DestroyWindow(_THIS, SDL_Window * window);
-
-typedef struct
-{
-    EGLSurface egl_surface;
-    EGLContext egl_context; /* We use this to preserve the context when losing focus */
-    ANativeWindow* native_window;
-    
-} SDL_WindowData;
-
-#endif /* _SDL_androidwindow_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/bwindow/SDL_BWin.h b/deps/SDL2/src/video/bwindow/SDL_BWin.h
deleted file mode 100644
index 6b6a71e..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_BWin.h
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_BWin_h
-#define _SDL_BWin_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "SDL_config.h"
-#include "SDL.h"
-#include "SDL_syswm.h"
-#include "SDL_bframebuffer.h"
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <stdio.h>
-#include <AppKit.h>
-#include <InterfaceKit.h>
-#include <be/game/DirectWindow.h>
-#if SDL_VIDEO_OPENGL
-#include <be/opengl/GLView.h>
-#endif
-#include "SDL_events.h"
-#include "../../main/beos/SDL_BApp.h"
-
-
-enum WinCommands {
-    BWIN_MOVE_WINDOW,
-    BWIN_RESIZE_WINDOW,
-    BWIN_SHOW_WINDOW,
-    BWIN_HIDE_WINDOW,
-    BWIN_MAXIMIZE_WINDOW,
-    BWIN_MINIMIZE_WINDOW,
-    BWIN_RESTORE_WINDOW,
-    BWIN_SET_TITLE,
-    BWIN_SET_BORDERED,
-    BWIN_FULLSCREEN
-};
-
-
-class SDL_BWin:public BDirectWindow
-{
-  public:
-    /* Constructor/Destructor */
-    SDL_BWin(BRect bounds, window_look look, uint32 flags)
-        : BDirectWindow(bounds, "Untitled", look, B_NORMAL_WINDOW_FEEL, flags)
-    {
-        _last_buttons = 0;
-
-#if SDL_VIDEO_OPENGL
-        _SDL_GLView = NULL;
-#endif
-        _shown = false;
-        _inhibit_resize = false;
-        _mouse_focused = false;
-        _prev_frame = NULL;
-
-        /* Handle framebuffer stuff */
-        _connected = _connection_disabled = false;
-        _buffer_created = _buffer_dirty = false;
-        _trash_window_buffer = false;
-        _buffer_locker = new BLocker();
-        _bitmap = NULL;
-#ifdef DRAWTHREAD
-        _draw_thread_id = spawn_thread(BE_DrawThread, "drawing_thread",
-                            B_NORMAL_PRIORITY, (void*) this);
-        resume_thread(_draw_thread_id);
-#endif
-    }
-
-    virtual ~ SDL_BWin()
-    {
-        Lock();
-        _connection_disabled = true;
-        int32 result;
-
-#if SDL_VIDEO_OPENGL
-        if (_SDL_GLView) {
-            _SDL_GLView->UnlockGL();
-            RemoveChild(_SDL_GLView);   /* Why was this outside the if
-                                            statement before? */
-        }
-
-#endif
-        Unlock();
-#if SDL_VIDEO_OPENGL
-        if (_SDL_GLView) {
-            delete _SDL_GLView;
-        }
-#endif
-
-        /* Clean up framebuffer stuff */
-        _buffer_locker->Lock();
-#ifdef DRAWTHREAD
-        wait_for_thread(_draw_thread_id, &result);
-#endif
-        free(_clips);
-        delete _buffer_locker;
-    }
-
-
-    /* * * * * OpenGL functionality * * * * */
-#if SDL_VIDEO_OPENGL
-    virtual BGLView *CreateGLView(Uint32 gl_flags) {
-        Lock();
-        if (_SDL_GLView == NULL) {
-            _SDL_GLView = new BGLView(Bounds(), "SDL GLView",
-                                     B_FOLLOW_ALL_SIDES,
-                                     (B_WILL_DRAW | B_FRAME_EVENTS),
-                                     gl_flags);
-        }
-        AddChild(_SDL_GLView);
-        _SDL_GLView->EnableDirectMode(true);
-        _SDL_GLView->LockGL();  /* "New" GLViews are created */
-        Unlock();
-        return (_SDL_GLView);
-    }
-
-    virtual void RemoveGLView() {
-        Lock();
-        if(_SDL_GLView) {
-            _SDL_GLView->UnlockGL();
-            RemoveChild(_SDL_GLView);
-        }
-        Unlock();
-    }
-
-    virtual void SwapBuffers(void) {
-        _SDL_GLView->UnlockGL();
-        _SDL_GLView->LockGL();
-        _SDL_GLView->SwapBuffers();
-    }
-#endif
-
-    /* * * * * Framebuffering* * * * */
-    virtual void DirectConnected(direct_buffer_info *info) {
-        if(!_connected && _connection_disabled) {
-            return;
-        }
-
-        /* Determine if the pixel buffer is usable after this update */
-        _trash_window_buffer =      _trash_window_buffer
-                                || ((info->buffer_state & B_BUFFER_RESIZED)
-                                || (info->buffer_state & B_BUFFER_RESET)
-                                || (info->driver_state == B_MODE_CHANGED));
-        LockBuffer();
-
-        switch(info->buffer_state & B_DIRECT_MODE_MASK) {
-        case B_DIRECT_START:
-            _connected = true;
-
-        case B_DIRECT_MODIFY:
-            if(_clips) {
-                free(_clips);
-                _clips = NULL;
-            }
-
-            _num_clips = info->clip_list_count;
-            _clips = (clipping_rect *)malloc(_num_clips*sizeof(clipping_rect));
-            if(_clips) {
-                memcpy(_clips, info->clip_list,
-                    _num_clips*sizeof(clipping_rect));
-
-                _bits = (uint8*) info->bits;
-                _row_bytes = info->bytes_per_row;
-                _bounds = info->window_bounds;
-                _bytes_per_px = info->bits_per_pixel / 8;
-                _buffer_dirty = true;
-            }
-            break;
-
-        case B_DIRECT_STOP:
-            _connected = false;
-            break;
-        }
-#if SDL_VIDEO_OPENGL
-        if(_SDL_GLView) {
-            _SDL_GLView->DirectConnected(info);
-        }
-#endif
-
-
-        /* Call the base object directconnected */
-        BDirectWindow::DirectConnected(info);
-
-        UnlockBuffer();
-
-    }
-
-
-
-
-    /* * * * * Event sending * * * * */
-    /* Hook functions */
-    virtual void FrameMoved(BPoint origin) {
-        /* Post a message to the BApp so that it can handle the window event */
-        BMessage msg(BAPP_WINDOW_MOVED);
-        msg.AddInt32("window-x", (int)origin.x);
-        msg.AddInt32("window-y", (int)origin.y);
-        _PostWindowEvent(msg);
-
-        /* Perform normal hook operations */
-        BDirectWindow::FrameMoved(origin);
-    }
-
-    virtual void FrameResized(float width, float height) {
-        /* Post a message to the BApp so that it can handle the window event */
-        BMessage msg(BAPP_WINDOW_RESIZED);
-
-        msg.AddInt32("window-w", (int)width + 1);
-        msg.AddInt32("window-h", (int)height + 1);
-        _PostWindowEvent(msg);
-
-        /* Perform normal hook operations */
-        BDirectWindow::FrameResized(width, height);
-    }
-
-    virtual bool QuitRequested() {
-        BMessage msg(BAPP_WINDOW_CLOSE_REQUESTED);
-        _PostWindowEvent(msg);
-
-        /* We won't allow a quit unless asked by DestroyWindow() */
-        return false;
-    }
-
-    virtual void WindowActivated(bool active) {
-        BMessage msg(BAPP_KEYBOARD_FOCUS);  /* Mouse focus sold separately */
-        _PostWindowEvent(msg);
-    }
-
-    virtual void Zoom(BPoint origin,
-                float width,
-                float height) {
-        BMessage msg(BAPP_MAXIMIZE);    /* Closest thing to maximization Haiku has */
-        _PostWindowEvent(msg);
-
-        /* Before the window zooms, record its size */
-        if( !_prev_frame )
-            _prev_frame = new BRect(Frame());
-
-        /* Perform normal hook operations */
-        BDirectWindow::Zoom(origin, width, height);
-    }
-
-    /* Member functions */
-    virtual void Show() {
-        while(IsHidden()) {
-            BDirectWindow::Show();
-        }
-        _shown = true;
-
-        BMessage msg(BAPP_SHOW);
-        _PostWindowEvent(msg);
-    }
-
-    virtual void Hide() {
-        BDirectWindow::Hide();
-        _shown = false;
-
-        BMessage msg(BAPP_HIDE);
-        _PostWindowEvent(msg);
-    }
-
-    virtual void Minimize(bool minimize) {
-        BDirectWindow::Minimize(minimize);
-        int32 minState = (minimize ? BAPP_MINIMIZE : BAPP_RESTORE);
-
-        BMessage msg(minState);
-        _PostWindowEvent(msg);
-    }
-
-
-    /* BView message interruption */
-    virtual void DispatchMessage(BMessage * msg, BHandler * target)
-    {
-        BPoint where;   /* Used by mouse moved */
-        int32 buttons;  /* Used for mouse button events */
-        int32 key;      /* Used for key events */
-
-        switch (msg->what) {
-        case B_MOUSE_MOVED:
-            int32 transit;
-            if (msg->FindPoint("where", &where) == B_OK
-                && msg->FindInt32("be:transit", &transit) == B_OK) {
-                _MouseMotionEvent(where, transit);
-            }
-
-            /* FIXME: Apparently a button press/release event might be dropped
-               if made before before a different button is released.  Does
-               B_MOUSE_MOVED have the data needed to check if a mouse button
-               state has changed? */
-            if (msg->FindInt32("buttons", &buttons) == B_OK) {
-                _MouseButtonEvent(buttons);
-            }
-            break;
-
-        case B_MOUSE_DOWN:
-        case B_MOUSE_UP:
-            /* _MouseButtonEvent() detects any and all buttons that may have
-               changed state, as well as that button's new state */
-            if (msg->FindInt32("buttons", &buttons) == B_OK) {
-                _MouseButtonEvent(buttons);
-            }
-            break;
-
-        case B_MOUSE_WHEEL_CHANGED:
-            float x, y;
-            if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK
-                && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) {
-                    _MouseWheelEvent((int)x, (int)y);
-            }
-            break;
-
-        case B_KEY_DOWN:
-        case B_UNMAPPED_KEY_DOWN:      /* modifier keys are unmapped */
-            if (msg->FindInt32("key", &key) == B_OK) {
-                _KeyEvent((SDL_Scancode)key, SDL_PRESSED);
-            }
-            break;
-
-        case B_KEY_UP:
-        case B_UNMAPPED_KEY_UP:        /* modifier keys are unmapped */
-            if (msg->FindInt32("key", &key) == B_OK) {
-                _KeyEvent(key, SDL_RELEASED);
-            }
-            break;
-
-        default:
-            /* move it after switch{} so it's always handled
-               that way we keep BeOS feautures like:
-               - CTRL+Q to close window (and other shortcuts)
-               - PrintScreen to make screenshot into /boot/home
-               - etc.. */
-            /* BDirectWindow::DispatchMessage(msg, target); */
-            break;
-        }
-
-        BDirectWindow::DispatchMessage(msg, target);
-    }
-
-    /* Handle command messages */
-    virtual void MessageReceived(BMessage* message) {
-        switch (message->what) {
-            /* Handle commands from SDL */
-            case BWIN_SET_TITLE:
-                _SetTitle(message);
-                break;
-            case BWIN_MOVE_WINDOW:
-                _MoveTo(message);
-                break;
-            case BWIN_RESIZE_WINDOW:
-                _ResizeTo(message);
-                break;
-            case BWIN_SET_BORDERED:
-                _SetBordered(message);
-                break;
-            case BWIN_SHOW_WINDOW:
-                Show();
-                break;
-            case BWIN_HIDE_WINDOW:
-                Hide();
-                break;
-            case BWIN_MAXIMIZE_WINDOW:
-                BWindow::Zoom();
-                break;
-            case BWIN_MINIMIZE_WINDOW:
-                Minimize(true);
-                break;
-            case BWIN_RESTORE_WINDOW:
-                _Restore();
-                break;
-            case BWIN_FULLSCREEN:
-                _SetFullScreen(message);
-                break;
-            default:
-                /* Perform normal message handling */
-                BDirectWindow::MessageReceived(message);
-                break;
-        }
-
-    }
-
-
-
-    /* Accessor methods */
-    bool IsShown() { return _shown; }
-    int32 GetID() { return _id; }
-    uint32 GetRowBytes() { return _row_bytes; }
-    int32 GetFbX() { return _bounds.left; }
-    int32 GetFbY() { return _bounds.top; }
-    bool ConnectionEnabled() { return !_connection_disabled; }
-    bool Connected() { return _connected; }
-    clipping_rect *GetClips() { return _clips; }
-    int32 GetNumClips() { return _num_clips; }
-    uint8* GetBufferPx() { return _bits; }
-    int32 GetBytesPerPx() { return _bytes_per_px; }
-    bool CanTrashWindowBuffer() { return _trash_window_buffer; }
-    bool BufferExists() { return _buffer_created; }
-    bool BufferIsDirty() { return _buffer_dirty; }
-    BBitmap *GetBitmap() { return _bitmap; }
-#if SDL_VIDEO_OPENGL
-    BGLView *GetGLView() { return _SDL_GLView; }
-#endif
-
-    /* Setter methods */
-    void SetID(int32 id) { _id = id; }
-    void SetBufferExists(bool bufferExists) { _buffer_created = bufferExists; }
-    void LockBuffer() { _buffer_locker->Lock(); }
-    void UnlockBuffer() { _buffer_locker->Unlock(); }
-    void SetBufferDirty(bool bufferDirty) { _buffer_dirty = bufferDirty; }
-    void SetTrashBuffer(bool trash) { _trash_window_buffer = trash;     }
-    void SetBitmap(BBitmap *bitmap) { _bitmap = bitmap; }
-
-
-private:
-    /* Event redirection */
-    void _MouseMotionEvent(BPoint &where, int32 transit) {
-        if(transit == B_EXITED_VIEW) {
-            /* Change mouse focus */
-            if(_mouse_focused) {
-                _MouseFocusEvent(false);
-            }
-        } else {
-            /* Change mouse focus */
-            if (!_mouse_focused) {
-                _MouseFocusEvent(true);
-            }
-            BMessage msg(BAPP_MOUSE_MOVED);
-            msg.AddInt32("x", (int)where.x);
-            msg.AddInt32("y", (int)where.y);
-
-            _PostWindowEvent(msg);
-        }
-    }
-
-    void _MouseFocusEvent(bool focusGained) {
-        _mouse_focused = focusGained;
-        BMessage msg(BAPP_MOUSE_FOCUS);
-        msg.AddBool("focusGained", focusGained);
-        _PostWindowEvent(msg);
-
-/* FIXME: Why were these here?
- if false: be_app->SetCursor(B_HAND_CURSOR);
- if true:  SDL_SetCursor(NULL); */
-    }
-
-    void _MouseButtonEvent(int32 buttons) {
-        int32 buttonStateChange = buttons ^ _last_buttons;
-
-        /* Make sure at least one button has changed state */
-        if( !(buttonStateChange) ) {
-            return;
-        }
-
-        /* Add any mouse button events */
-        if(buttonStateChange & B_PRIMARY_MOUSE_BUTTON) {
-            _SendMouseButton(SDL_BUTTON_LEFT, buttons &
-                B_PRIMARY_MOUSE_BUTTON);
-        }
-        if(buttonStateChange & B_SECONDARY_MOUSE_BUTTON) {
-            _SendMouseButton(SDL_BUTTON_RIGHT, buttons &
-                B_PRIMARY_MOUSE_BUTTON);
-        }
-        if(buttonStateChange & B_TERTIARY_MOUSE_BUTTON) {
-            _SendMouseButton(SDL_BUTTON_MIDDLE, buttons &
-                B_PRIMARY_MOUSE_BUTTON);
-        }
-
-        _last_buttons = buttons;
-    }
-
-    void _SendMouseButton(int32 button, int32 state) {
-        BMessage msg(BAPP_MOUSE_BUTTON);
-        msg.AddInt32("button-id", button);
-        msg.AddInt32("button-state", state);
-        _PostWindowEvent(msg);
-    }
-
-    void _MouseWheelEvent(int32 x, int32 y) {
-        /* Create a message to pass along to the BeApp thread */
-        BMessage msg(BAPP_MOUSE_WHEEL);
-        msg.AddInt32("xticks", x);
-        msg.AddInt32("yticks", y);
-        _PostWindowEvent(msg);
-    }
-
-    void _KeyEvent(int32 keyCode, int32 keyState) {
-        /* Create a message to pass along to the BeApp thread */
-        BMessage msg(BAPP_KEY);
-        msg.AddInt32("key-state", keyState);
-        msg.AddInt32("key-scancode", keyCode);
-        be_app->PostMessage(&msg);
-        /* Apparently SDL only uses the scancode */
-    }
-
-    void _RepaintEvent() {
-        /* Force a repaint: Call the SDL exposed event */
-        BMessage msg(BAPP_REPAINT);
-        _PostWindowEvent(msg);
-    }
-    void _PostWindowEvent(BMessage &msg) {
-        msg.AddInt32("window-id", _id);
-        be_app->PostMessage(&msg);
-    }
-
-    /* Command methods (functions called upon by SDL) */
-    void _SetTitle(BMessage *msg) {
-        const char *title;
-        if(
-            msg->FindString("window-title", &title) != B_OK
-        ) {
-            return;
-        }
-        SetTitle(title);
-    }
-
-    void _MoveTo(BMessage *msg) {
-        int32 x, y;
-        if(
-            msg->FindInt32("window-x", &x) != B_OK ||
-            msg->FindInt32("window-y", &y) != B_OK
-        ) {
-            return;
-        }
-        MoveTo(x, y);
-    }
-
-    void _ResizeTo(BMessage *msg) {
-        int32 w, h;
-        if(
-            msg->FindInt32("window-w", &w) != B_OK ||
-            msg->FindInt32("window-h", &h) != B_OK
-        ) {
-            return;
-        }
-        ResizeTo(w, h);
-    }
-
-    void _SetBordered(BMessage *msg) {
-        bool bEnabled;
-        if(msg->FindBool("window-border", &bEnabled) != B_OK) {
-            return;
-        }
-        SetLook(bEnabled ? B_BORDERED_WINDOW_LOOK : B_NO_BORDER_WINDOW_LOOK);
-    }
-
-    void _Restore() {
-        if(IsMinimized()) {
-            Minimize(false);
-        } else if(IsHidden()) {
-            Show();
-        } else if(_prev_frame != NULL) {    /* Zoomed */
-            MoveTo(_prev_frame->left, _prev_frame->top);
-            ResizeTo(_prev_frame->Width(), _prev_frame->Height());
-        }
-    }
-
-    void _SetFullScreen(BMessage *msg) {
-        bool fullscreen;
-        if(
-            msg->FindBool("fullscreen", &fullscreen) != B_OK
-        ) {
-            return;
-        }
-        SetFullScreen(fullscreen);
-    }
-
-    /* Members */
-#if SDL_VIDEO_OPENGL
-    BGLView * _SDL_GLView;
-#endif
-
-    int32 _last_buttons;
-    int32 _id;  /* Window id used by SDL_BApp */
-    bool  _mouse_focused;       /* Does this window have mouse focus? */
-    bool  _shown;
-    bool  _inhibit_resize;
-
-    BRect *_prev_frame; /* Previous position and size of the window */
-
-    /* Framebuffer members */
-    bool            _connected,
-                    _connection_disabled,
-                    _buffer_created,
-                    _buffer_dirty,
-                    _trash_window_buffer;
-    uint8          *_bits;
-    uint32          _row_bytes;
-    clipping_rect   _bounds;
-    BLocker        *_buffer_locker;
-    clipping_rect  *_clips;
-    int32           _num_clips;
-    int32           _bytes_per_px;
-    thread_id       _draw_thread_id;
-
-    BBitmap        *_bitmap;
-};
-
-
-/* FIXME:
- * An explanation of framebuffer flags.
- *
- * _connected -           Original variable used to let the drawing thread know
- *                         when changes are being made to the other framebuffer
- *                         members.
- * _connection_disabled - Used to signal to the drawing thread that the window
- *                         is closing, and the thread should exit.
- * _buffer_created -      True if the current buffer is valid
- * _buffer_dirty -        True if the window should be redrawn.
- * _trash_window_buffer - True if the window buffer needs to be trashed partway
- *                         through a draw cycle.  Occurs when the previous
- *                         buffer provided by DirectConnected() is invalidated.
- */
-#endif
diff --git a/deps/SDL2/src/video/bwindow/SDL_bclipboard.cc b/deps/SDL2/src/video/bwindow/SDL_bclipboard.cc
deleted file mode 100644
index 2ec80c6..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bclipboard.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_BWINDOW
-
-/* BWindow based framebuffer implementation */
-
-#include <unistd.h>
-#include <TypeConstants.h>
-
-#include "SDL_BWin.h"
-#include "SDL_timer.h"
-#include "../SDL_sysvideo.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int BE_SetClipboardText(_THIS, const char *text) {
-	BMessage *clip = NULL;
-	if(be_clipboard->Lock()) {
-		be_clipboard->Clear();
-		if((clip = be_clipboard->Data())) {
-			/* Presumably the string of characters is ascii-format */
-			ssize_t asciiLength = 0;
-			for(; text[asciiLength] != 0; ++asciiLength) {}
-			clip->AddData("text/plain", B_MIME_TYPE, &text, asciiLength);
-			be_clipboard->Commit();
-		}
-		be_clipboard->Unlock();
-	}
-	return 0;
-}
-
-char *BE_GetClipboardText(_THIS) {
-	BMessage *clip = NULL;
-	const char *text = NULL;	
-	ssize_t length;
-	char *result;
-	if(be_clipboard->Lock()) {
-		if((clip = be_clipboard->Data())) {
-			/* Presumably the string of characters is ascii-format */
-			clip->FindData("text/plain", B_MIME_TYPE, (const void**)&text,
-				&length);
-		} else {
-			be_clipboard->Unlock();
-		}
-		be_clipboard->Unlock();
-	} 
-	
-	if (!text) {
-		result = SDL_strdup("");
-	} else {
-		/* Copy the data and pass on to SDL */
-		result = (char*)SDL_calloc(1, sizeof(char*)*length);
-		SDL_strlcpy(result, text, length);
-	}
-	
-	return result;
-}
-
-SDL_bool BE_HasClipboardText(_THIS) {
-	SDL_bool result = SDL_FALSE;
-	char *text = BE_GetClipboardText(_this);
-	if (text) {
-		result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
-		SDL_free(text);
-	} 
-	return result;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_BWINDOW */
diff --git a/deps/SDL2/src/video/bwindow/SDL_bclipboard.h b/deps/SDL2/src/video/bwindow/SDL_bclipboard.h
deleted file mode 100644
index 9ffbf9e..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bclipboard.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#ifndef SDL_BCLIPBOARD_H
-#define SDL_BCLIPBOARD_H
-
-extern int BE_SetClipboardText(_THIS, const char *text);
-extern char *BE_GetClipboardText(_THIS);
-extern SDL_bool BE_HasClipboardText(_THIS);
-
-#endif
diff --git a/deps/SDL2/src/video/bwindow/SDL_bevents.cc b/deps/SDL2/src/video/bwindow/SDL_bevents.cc
deleted file mode 100644
index e01e8b2..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bevents.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_BWINDOW
-
-#include "SDL_bevents.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void BE_PumpEvents(_THIS) {
-	/* Since the event thread is its own thread, this isn't really necessary */
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_BWINDOW */
diff --git a/deps/SDL2/src/video/bwindow/SDL_bevents.h b/deps/SDL2/src/video/bwindow/SDL_bevents.h
deleted file mode 100644
index a83d03b..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bevents.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_BEVENTS_H
-#define SDL_BEVENTS_H
-
-#include "../SDL_sysvideo.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void BE_PumpEvents(_THIS);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/deps/SDL2/src/video/bwindow/SDL_bframebuffer.cc b/deps/SDL2/src/video/bwindow/SDL_bframebuffer.cc
deleted file mode 100644
index 69f4a43..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bframebuffer.cc
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_BWINDOW
-
-#include "SDL_bframebuffer.h"
-
-#include <AppKit.h>
-#include <InterfaceKit.h>
-#include "SDL_bmodes.h"
-#include "SDL_BWin.h"
-
-#include "../../main/beos/SDL_BApp.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int32 BE_UpdateOnce(SDL_Window *window);
-
-static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
-	return ((SDL_BWin*)(window->driverdata));
-}
-
-static SDL_INLINE SDL_BApp *_GetBeApp() {
-	return ((SDL_BApp*)be_app);
-}
-
-int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
-                                       Uint32 * format,
-                                       void ** pixels, int *pitch) {
-	SDL_BWin *bwin = _ToBeWin(window);
-	BScreen bscreen;
-	if(!bscreen.IsValid()) {
-		return -1;
-	}
-
-	while(!bwin->Connected()) { snooze(100); }
-	
-	/* Make sure we have exclusive access to frame buffer data */
-	bwin->LockBuffer();
-
-	/* format */
-	display_mode bmode;
-	bscreen.GetMode(&bmode);
-	int32 bpp = BE_ColorSpaceToBitsPerPixel(bmode.space);
-	*format = BE_BPPToSDLPxFormat(bpp);
-
-	/* Create the new bitmap object */
-	BBitmap *bitmap = bwin->GetBitmap();
-
-	if(bitmap) {
-		delete bitmap;
-	}
-	bitmap = new BBitmap(bwin->Bounds(), (color_space)bmode.space,
-			false,	/* Views not accepted */
-			true);	/* Contiguous memory required */
-			
-	if(bitmap->InitCheck() != B_OK) {
-		return SDL_SetError("Could not initialize back buffer!\n");
-	}
-
-
-	bwin->SetBitmap(bitmap);
-	
-	/* Set the pixel pointer */
-	*pixels = bitmap->Bits();
-
-	/* pitch = width of window, in bytes */
-	*pitch = bitmap->BytesPerRow();
-
-	bwin->SetBufferExists(true);
-	bwin->SetTrashBuffer(false);
-	bwin->UnlockBuffer();
-	return 0;
-}
-
-
-
-int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
-                                      const SDL_Rect * rects, int numrects) {
-	if(!window)
-		return 0;
-
-	SDL_BWin *bwin = _ToBeWin(window);
-
-#ifdef DRAWTHREAD	
-	bwin->LockBuffer();
-	bwin->SetBufferDirty(true);
-	bwin->UnlockBuffer();
-#else
-	bwin->SetBufferDirty(true);
-	BE_UpdateOnce(window);
-#endif
-
-	return 0;
-}
-
-int32 BE_DrawThread(void *data) {
-	SDL_BWin *bwin = (SDL_BWin*)data;
-	
-	BScreen bscreen;
-	if(!bscreen.IsValid()) {
-		return -1;
-	}
-
-	while(bwin->ConnectionEnabled()) {
-		if( bwin->Connected() && bwin->BufferExists() && bwin->BufferIsDirty() ) {
-			bwin->LockBuffer();
-			BBitmap *bitmap = NULL;
-			bitmap = bwin->GetBitmap();
-			int32 windowPitch = bitmap->BytesPerRow();
-			int32 bufferPitch = bwin->GetRowBytes();
-			uint8 *windowpx;
-			uint8 *bufferpx;
-
-			int32 BPP = bwin->GetBytesPerPx();
-			int32 windowSub = bwin->GetFbX() * BPP +
-						  bwin->GetFbY() * windowPitch;
-			clipping_rect *clips = bwin->GetClips();
-			int32 numClips = bwin->GetNumClips();
-			int i, y;
-
-			/* Blit each clipping rectangle */
-			bscreen.WaitForRetrace();
-			for(i = 0; i < numClips; ++i) {
-				clipping_rect rc = clips[i];
-				/* Get addresses of the start of each clipping rectangle */
-				int32 width = clips[i].right - clips[i].left + 1;
-				int32 height = clips[i].bottom - clips[i].top + 1;
-				bufferpx = bwin->GetBufferPx() + 
-					clips[i].top * bufferPitch + clips[i].left * BPP;
-				windowpx = (uint8*)bitmap->Bits() + 
-					clips[i].top * windowPitch + clips[i].left * BPP -
-					windowSub;
-
-				/* Copy each row of pixels from the window buffer into the frame
-				   buffer */
-				for(y = 0; y < height; ++y)
-				{
-
-					if(bwin->CanTrashWindowBuffer()) {
-						goto escape;	/* Break out before the buffer is killed */
-					}
-
-					memcpy(bufferpx, windowpx, width * BPP);
-					bufferpx += bufferPitch;
-					windowpx += windowPitch;
-				}
-			}
-
-			bwin->SetBufferDirty(false);
-escape:
-			bwin->UnlockBuffer();
-		} else {
-			snooze(16000);
-		}
-	}
-	
-	return B_OK;
-}
-
-void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window) {
-	SDL_BWin *bwin = _ToBeWin(window);
-	
-	bwin->LockBuffer();
-	
-	/* Free and clear the window buffer */
-	BBitmap *bitmap = bwin->GetBitmap();
-	delete bitmap;
-	bwin->SetBitmap(NULL);
-	bwin->SetBufferExists(false);
-	bwin->UnlockBuffer();
-}
-
-
-/*
- * TODO:
- * This was written to test if certain errors were caused by threading issues.
- * The specific issues have since become rare enough that they may have been
- * solved, but I doubt it- they were pretty sporadic before now.
- */
-int32 BE_UpdateOnce(SDL_Window *window) {
-	SDL_BWin *bwin = _ToBeWin(window);
-	BScreen bscreen;
-	if(!bscreen.IsValid()) {
-		return -1;
-	}
-
-	if(bwin->ConnectionEnabled() && bwin->Connected()) {
-		bwin->LockBuffer();
-		int32 windowPitch = window->surface->pitch;
-		int32 bufferPitch = bwin->GetRowBytes();
-		uint8 *windowpx;
-		uint8 *bufferpx;
-
-		int32 BPP = bwin->GetBytesPerPx();
-		uint8 *windowBaseAddress = (uint8*)window->surface->pixels;
-		int32 windowSub = bwin->GetFbX() * BPP +
-						  bwin->GetFbY() * windowPitch;
-		clipping_rect *clips = bwin->GetClips();
-		int32 numClips = bwin->GetNumClips();
-		int i, y;
-
-		/* Blit each clipping rectangle */
-		bscreen.WaitForRetrace();
-		for(i = 0; i < numClips; ++i) {
-			clipping_rect rc = clips[i];
-			/* Get addresses of the start of each clipping rectangle */
-			int32 width = clips[i].right - clips[i].left + 1;
-			int32 height = clips[i].bottom - clips[i].top + 1;
-			bufferpx = bwin->GetBufferPx() + 
-				clips[i].top * bufferPitch + clips[i].left * BPP;
-			windowpx = windowBaseAddress + 
-				clips[i].top * windowPitch + clips[i].left * BPP - windowSub;
-
-			/* Copy each row of pixels from the window buffer into the frame
-			   buffer */
-			for(y = 0; y < height; ++y)
-			{
-				memcpy(bufferpx, windowpx, width * BPP);
-				bufferpx += bufferPitch;
-				windowpx += windowPitch;
-			}
-		}
-		bwin->UnlockBuffer();
-	}
-	return 0;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_BWINDOW */
diff --git a/deps/SDL2/src/video/bwindow/SDL_bframebuffer.h b/deps/SDL2/src/video/bwindow/SDL_bframebuffer.h
deleted file mode 100644
index 935f0e9..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bframebuffer.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_BFRAMEBUFFER_H
-#define SDL_BFRAMEBUFFER_H
-#include <SupportDefs.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define DRAWTHREAD
-
-#include "../SDL_sysvideo.h"
-
-extern int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
-                                       Uint32 * format,
-                                       void ** pixels, int *pitch);
-extern int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
-                                       const SDL_Rect * rects, int numrects);
-extern void BE_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
-extern int32 BE_DrawThread(void *data);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/deps/SDL2/src/video/bwindow/SDL_bkeyboard.cc b/deps/SDL2/src/video/bwindow/SDL_bkeyboard.cc
deleted file mode 100644
index 41eb6ca..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bkeyboard.cc
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_BWINDOW
-
-#include <SupportDefs.h>
-#include <support/UTF8.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "SDL_events.h"
-#include "SDL_keycode.h"
-
-#include "SDL_bkeyboard.h"
-
-
-#define KEYMAP_SIZE 128
-
-
-static SDL_Scancode keymap[KEYMAP_SIZE];
-static int8 keystate[KEYMAP_SIZE];
-
-void BE_InitOSKeymap() {
-		for( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) {
-			keymap[i] = SDL_SCANCODE_UNKNOWN;
-		}
-
-		for( uint i = 0; i < KEYMAP_SIZE; ++i ) {
-			keystate[i] = SDL_RELEASED;
-		}
-
-		keymap[0x01]		= SDL_GetScancodeFromKey(SDLK_ESCAPE);
-		keymap[B_F1_KEY]	= SDL_GetScancodeFromKey(SDLK_F1);
-		keymap[B_F2_KEY]	= SDL_GetScancodeFromKey(SDLK_F2);
-		keymap[B_F3_KEY]	= SDL_GetScancodeFromKey(SDLK_F3);
-		keymap[B_F4_KEY]	= SDL_GetScancodeFromKey(SDLK_F4);
-		keymap[B_F5_KEY]	= SDL_GetScancodeFromKey(SDLK_F5);
-		keymap[B_F6_KEY]	= SDL_GetScancodeFromKey(SDLK_F6);
-		keymap[B_F7_KEY]	= SDL_GetScancodeFromKey(SDLK_F7);
-		keymap[B_F8_KEY]	= SDL_GetScancodeFromKey(SDLK_F8);
-		keymap[B_F9_KEY]	= SDL_GetScancodeFromKey(SDLK_F9);
-		keymap[B_F10_KEY]	= SDL_GetScancodeFromKey(SDLK_F10);
-		keymap[B_F11_KEY]	= SDL_GetScancodeFromKey(SDLK_F11);
-		keymap[B_F12_KEY]	= SDL_GetScancodeFromKey(SDLK_F12);
-		keymap[B_PRINT_KEY]	= SDL_GetScancodeFromKey(SDLK_PRINTSCREEN);
-		keymap[B_SCROLL_KEY]	= SDL_GetScancodeFromKey(SDLK_SCROLLLOCK);
-		keymap[B_PAUSE_KEY]	= SDL_GetScancodeFromKey(SDLK_PAUSE);
-		keymap[0x11]		= SDL_GetScancodeFromKey(SDLK_BACKQUOTE);
-		keymap[0x12]		= SDL_GetScancodeFromKey(SDLK_1);
-		keymap[0x13]		= SDL_GetScancodeFromKey(SDLK_2);
-		keymap[0x14]		= SDL_GetScancodeFromKey(SDLK_3);
-		keymap[0x15]		= SDL_GetScancodeFromKey(SDLK_4);
-		keymap[0x16]		= SDL_GetScancodeFromKey(SDLK_5);
-		keymap[0x17]		= SDL_GetScancodeFromKey(SDLK_6);
-		keymap[0x18]		= SDL_GetScancodeFromKey(SDLK_7);
-		keymap[0x19]		= SDL_GetScancodeFromKey(SDLK_8);
-		keymap[0x1a]		= SDL_GetScancodeFromKey(SDLK_9);
-		keymap[0x1b]		= SDL_GetScancodeFromKey(SDLK_0);
-		keymap[0x1c]		= SDL_GetScancodeFromKey(SDLK_MINUS);
-		keymap[0x1d]		= SDL_GetScancodeFromKey(SDLK_EQUALS);
-		keymap[0x1e]		= SDL_GetScancodeFromKey(SDLK_BACKSPACE);
-		keymap[0x1f]		= SDL_GetScancodeFromKey(SDLK_INSERT);
-		keymap[0x20]		= SDL_GetScancodeFromKey(SDLK_HOME);
-		keymap[0x21]		= SDL_GetScancodeFromKey(SDLK_PAGEUP);
-		keymap[0x22]		= SDL_GetScancodeFromKey(SDLK_NUMLOCKCLEAR);
-		keymap[0x23]		= SDL_GetScancodeFromKey(SDLK_KP_DIVIDE);
-		keymap[0x24]		= SDL_GetScancodeFromKey(SDLK_KP_MULTIPLY);
-		keymap[0x25]		= SDL_GetScancodeFromKey(SDLK_KP_MINUS);
-		keymap[0x26]		= SDL_GetScancodeFromKey(SDLK_TAB);
-		keymap[0x27]		= SDL_GetScancodeFromKey(SDLK_q);
-		keymap[0x28]		= SDL_GetScancodeFromKey(SDLK_w);
-		keymap[0x29]		= SDL_GetScancodeFromKey(SDLK_e);
-		keymap[0x2a]		= SDL_GetScancodeFromKey(SDLK_r);
-		keymap[0x2b]		= SDL_GetScancodeFromKey(SDLK_t);
-		keymap[0x2c]		= SDL_GetScancodeFromKey(SDLK_y);
-		keymap[0x2d]		= SDL_GetScancodeFromKey(SDLK_u);
-		keymap[0x2e]		= SDL_GetScancodeFromKey(SDLK_i);
-		keymap[0x2f]		= SDL_GetScancodeFromKey(SDLK_o);
-		keymap[0x30]		= SDL_GetScancodeFromKey(SDLK_p);
-		keymap[0x31]		= SDL_GetScancodeFromKey(SDLK_LEFTBRACKET);
-		keymap[0x32]		= SDL_GetScancodeFromKey(SDLK_RIGHTBRACKET);
-		keymap[0x33]		= SDL_GetScancodeFromKey(SDLK_BACKSLASH);
-		keymap[0x34]		= SDL_GetScancodeFromKey(SDLK_DELETE);
-		keymap[0x35]		= SDL_GetScancodeFromKey(SDLK_END);
-		keymap[0x36]		= SDL_GetScancodeFromKey(SDLK_PAGEDOWN);
-		keymap[0x37]		= SDL_GetScancodeFromKey(SDLK_KP_7);
-		keymap[0x38]		= SDL_GetScancodeFromKey(SDLK_KP_8);
-		keymap[0x39]		= SDL_GetScancodeFromKey(SDLK_KP_9);
-		keymap[0x3a]		= SDL_GetScancodeFromKey(SDLK_KP_PLUS);
-		keymap[0x3b]		= SDL_GetScancodeFromKey(SDLK_CAPSLOCK);
-		keymap[0x3c]		= SDL_GetScancodeFromKey(SDLK_a);
-		keymap[0x3d]		= SDL_GetScancodeFromKey(SDLK_s);
-		keymap[0x3e]		= SDL_GetScancodeFromKey(SDLK_d);
-		keymap[0x3f]		= SDL_GetScancodeFromKey(SDLK_f);
-		keymap[0x40]		= SDL_GetScancodeFromKey(SDLK_g);
-		keymap[0x41]		= SDL_GetScancodeFromKey(SDLK_h);
-		keymap[0x42]		= SDL_GetScancodeFromKey(SDLK_j);
-		keymap[0x43]		= SDL_GetScancodeFromKey(SDLK_k);
-		keymap[0x44]		= SDL_GetScancodeFromKey(SDLK_l);
-		keymap[0x45]		= SDL_GetScancodeFromKey(SDLK_SEMICOLON);
-		keymap[0x46]		= SDL_GetScancodeFromKey(SDLK_QUOTE);
-		keymap[0x47]		= SDL_GetScancodeFromKey(SDLK_RETURN);
-		keymap[0x48]		= SDL_GetScancodeFromKey(SDLK_KP_4);
-		keymap[0x49]		= SDL_GetScancodeFromKey(SDLK_KP_5);
-		keymap[0x4a]		= SDL_GetScancodeFromKey(SDLK_KP_6);
-		keymap[0x4b]		= SDL_GetScancodeFromKey(SDLK_LSHIFT);
-		keymap[0x4c]		= SDL_GetScancodeFromKey(SDLK_z);
-		keymap[0x4d]		= SDL_GetScancodeFromKey(SDLK_x);
-		keymap[0x4e]		= SDL_GetScancodeFromKey(SDLK_c);
-		keymap[0x4f]		= SDL_GetScancodeFromKey(SDLK_v);
-		keymap[0x50]		= SDL_GetScancodeFromKey(SDLK_b);
-		keymap[0x51]		= SDL_GetScancodeFromKey(SDLK_n);
-		keymap[0x52]		= SDL_GetScancodeFromKey(SDLK_m);
-		keymap[0x53]		= SDL_GetScancodeFromKey(SDLK_COMMA);
-		keymap[0x54]		= SDL_GetScancodeFromKey(SDLK_PERIOD);
-		keymap[0x55]		= SDL_GetScancodeFromKey(SDLK_SLASH);
-		keymap[0x56]		= SDL_GetScancodeFromKey(SDLK_RSHIFT);
-		keymap[0x57]		= SDL_GetScancodeFromKey(SDLK_UP);
-		keymap[0x58]		= SDL_GetScancodeFromKey(SDLK_KP_1);
-		keymap[0x59]		= SDL_GetScancodeFromKey(SDLK_KP_2);
-		keymap[0x5a]		= SDL_GetScancodeFromKey(SDLK_KP_3);
-		keymap[0x5b]		= SDL_GetScancodeFromKey(SDLK_KP_ENTER);
-		keymap[0x5c]		= SDL_GetScancodeFromKey(SDLK_LCTRL);
-		keymap[0x5d]		= SDL_GetScancodeFromKey(SDLK_LALT);
-		keymap[0x5e]		= SDL_GetScancodeFromKey(SDLK_SPACE);
-		keymap[0x5f]		= SDL_GetScancodeFromKey(SDLK_RALT);
-		keymap[0x60]		= SDL_GetScancodeFromKey(SDLK_RCTRL);
-		keymap[0x61]		= SDL_GetScancodeFromKey(SDLK_LEFT);
-		keymap[0x62]		= SDL_GetScancodeFromKey(SDLK_DOWN);
-		keymap[0x63]		= SDL_GetScancodeFromKey(SDLK_RIGHT);
-		keymap[0x64]		= SDL_GetScancodeFromKey(SDLK_KP_0);
-		keymap[0x65]		= SDL_GetScancodeFromKey(SDLK_KP_PERIOD);
-		keymap[0x66]		= SDL_GetScancodeFromKey(SDLK_LGUI);
-		keymap[0x67]		= SDL_GetScancodeFromKey(SDLK_RGUI);
-		keymap[0x68]		= SDL_GetScancodeFromKey(SDLK_MENU);
-		keymap[0x69]		= SDL_GetScancodeFromKey(SDLK_2); /* SDLK_EURO */
-		keymap[0x6a]		= SDL_GetScancodeFromKey(SDLK_KP_EQUALS);
-		keymap[0x6b]		= SDL_GetScancodeFromKey(SDLK_POWER);
-}
-
-SDL_Scancode BE_GetScancodeFromBeKey(int32 bkey) {
-	if(bkey > 0 && bkey < (int32)SDL_TABLESIZE(keymap)) {
-		return keymap[bkey];
-	} else {
-		return SDL_SCANCODE_UNKNOWN;
-	}
-}
-
-int8 BE_GetKeyState(int32 bkey) {
-	if(bkey > 0 && bkey < KEYMAP_SIZE) {
-		return keystate[bkey];
-	} else {
-		return SDL_RELEASED;
-	}
-}
-
-void BE_SetKeyState(int32 bkey, int8 state) {
-	if(bkey > 0 && bkey < KEYMAP_SIZE) {
-		keystate[bkey] = state;
-	}
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_BWINDOW */
diff --git a/deps/SDL2/src/video/bwindow/SDL_bkeyboard.h b/deps/SDL2/src/video/bwindow/SDL_bkeyboard.h
deleted file mode 100644
index b170228..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bkeyboard.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_BKEYBOARD_H
-#define SDL_BKEYBOARD_H
-
-#include <SupportDefs.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "../../../include/SDL_keyboard.h"
-
-extern void BE_InitOSKeymap();
-extern SDL_Scancode BE_GetScancodeFromBeKey(int32 bkey);
-extern int8 BE_GetKeyState(int32 bkey);
-extern void BE_SetKeyState(int32 bkey, int8 state);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/deps/SDL2/src/video/bwindow/SDL_bmodes.cc b/deps/SDL2/src/video/bwindow/SDL_bmodes.cc
deleted file mode 100644
index 44e19dc..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bmodes.cc
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_BWINDOW
-
-#include <AppKit.h>
-#include <InterfaceKit.h>
-#include "SDL_bmodes.h"
-#include "SDL_BWin.h"
-
-#if SDL_VIDEO_OPENGL
-#include "SDL_bopengl.h"
-#endif
-
-#include "../../main/beos/SDL_BApp.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define WRAP_BMODE 1 /* FIXME: Some debate as to whether this is necessary */
-
-#if WRAP_BMODE
-/* This wrapper is here so that the driverdata can be freed without freeing
-   the display_mode structure */
-typedef struct SDL_DisplayModeData {
-	display_mode *bmode;
-};
-#endif
-
-static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
-	return ((SDL_BWin*)(window->driverdata));
-}
-
-static SDL_INLINE SDL_BApp *_GetBeApp() {
-	return ((SDL_BApp*)be_app);
-}
-
-static SDL_INLINE display_mode * _ExtractBMode(SDL_DisplayMode *mode) {
-#if WRAP_BMODE
-	return ((SDL_DisplayModeData*)mode->driverdata)->bmode;
-#else
-	return (display_mode*)(mode->driverdata);
-#endif
-}
-
-/* Copied from haiku/trunk/src/preferences/screen/ScreenMode.cpp */
-static float get_refresh_rate(display_mode &mode) {
-	return float(mode.timing.pixel_clock * 1000)
-		/ float(mode.timing.h_total * mode.timing.v_total);
-}
-
-
-#if 0
-/* TODO:
- * This is a useful debugging tool.  Uncomment and insert into code as needed.
- */
-void _SpoutModeData(display_mode *bmode) {
-	printf("BMode:\n");
-	printf("\tw,h = (%i,%i)\n", bmode->virtual_width, bmode->virtual_height);
-	printf("\th,v = (%i,%i)\n", bmode->h_display_start, 
-			bmode->v_display_start);
-	if(bmode->flags) {
-		printf("\tFlags:\n");
-		if(bmode->flags & B_SCROLL) {
-			printf("\t\tB_SCROLL\n");
-		}
-		if(bmode->flags & B_8_BIT_DAC) {
-			printf("\t\tB_8_BIT_DAC\n");
-		}
-		if(bmode->flags & B_HARDWARE_CURSOR) {
-			printf("\t\tB_HARDWARE_CURSOR\n");
-		}
-		if(bmode->flags & B_PARALLEL_ACCESS) {
-			printf("\t\tB_PARALLEL_ACCESS\n");
-		}
-		if(bmode->flags & B_DPMS) {
-			printf("\t\tB_DPMS\n");
-		}
-		if(bmode->flags & B_IO_FB_NA) {
-			printf("\t\tB_IO_FB_NA\n");
-		}
-	}
-	printf("\tTiming:\n");
-	printf("\t\tpx clock: %i\n", bmode->timing.pixel_clock);
-	printf("\t\th - display: %i sync start: %i sync end: %i total: %i\n",
-		bmode->timing.h_display, bmode->timing.h_sync_start,
-		bmode->timing.h_sync_end, bmode->timing.h_total);
-	printf("\t\tv - display: %i sync start: %i sync end: %i total: %i\n",
-		bmode->timing.v_display, bmode->timing.v_sync_start,
-		bmode->timing.v_sync_end, bmode->timing.v_total);
-	if(bmode->timing.flags) {
-		printf("\t\tFlags:\n");
-		if(bmode->timing.flags & B_BLANK_PEDESTAL) {
-			printf("\t\t\tB_BLANK_PEDESTAL\n");
-		}
-		if(bmode->timing.flags & B_TIMING_INTERLACED) {
-			printf("\t\t\tB_TIMING_INTERLACED\n");
-		}
-		if(bmode->timing.flags & B_POSITIVE_HSYNC) {
-			printf("\t\t\tB_POSITIVE_HSYNC\n");
-		}
-		if(bmode->timing.flags & B_POSITIVE_VSYNC) {
-			printf("\t\t\tB_POSITIVE_VSYNC\n");
-		}
-		if(bmode->timing.flags & B_SYNC_ON_GREEN) {
-			printf("\t\t\tB_SYNC_ON_GREEN\n");
-		}
-	}
-}
-#endif
-
-
-
-int32 BE_ColorSpaceToBitsPerPixel(uint32 colorspace)
-{
-	int bitsperpixel;
-
-	bitsperpixel = 0;
-	switch (colorspace) {
-	    case B_CMAP8:
-		bitsperpixel = 8;
-		break;
-	    case B_RGB15:
-	    case B_RGBA15:
-	    case B_RGB15_BIG:
-	    case B_RGBA15_BIG:
-		bitsperpixel = 15;
-		break;
-	    case B_RGB16:
-	    case B_RGB16_BIG:
-		bitsperpixel = 16;
-		break;
-	    case B_RGB32:
-	    case B_RGBA32:
-	    case B_RGB32_BIG:
-	    case B_RGBA32_BIG:
-		bitsperpixel = 32;
-		break;
-	    default:
-		break;
-	}
-	return(bitsperpixel);
-}
-
-int32 BE_BPPToSDLPxFormat(int32 bpp) {
-	/* Translation taken from SDL_windowsmodes.c */
-	switch (bpp) {
-	case 32:
-		return SDL_PIXELFORMAT_RGB888;
-		break;
-	case 24:	/* May not be supported by Haiku */
-		return SDL_PIXELFORMAT_RGB24;
-		break;
-	case 16:
-		return SDL_PIXELFORMAT_RGB565;
-		break;
-	case 15:
-		return SDL_PIXELFORMAT_RGB555;
-		break;
-	case 8:
-		return SDL_PIXELFORMAT_INDEX8;
-		break;
-	case 4:		/* May not be supported by Haiku */
-		return SDL_PIXELFORMAT_INDEX4LSB;
-		break;
-	}
-
-	/* May never get here, but safer and needed to shut up compiler */
-	SDL_SetError("Invalid bpp value");
-	return 0;       
-}
-
-static void _BDisplayModeToSdlDisplayMode(display_mode *bmode,
-		SDL_DisplayMode *mode) {
-	mode->w = bmode->virtual_width;
-	mode->h = bmode->virtual_height;
-	mode->refresh_rate = (int)get_refresh_rate(*bmode);
-
-#if WRAP_BMODE
-	SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1,
-		sizeof(SDL_DisplayModeData));
-	data->bmode = bmode;
-	
-	mode->driverdata = data;
-
-#else
-
-	mode->driverdata = bmode;
-#endif
-
-	/* Set the format */
-	int32 bpp = BE_ColorSpaceToBitsPerPixel(bmode->space);
-	mode->format = BE_BPPToSDLPxFormat(bpp);
-}
-
-/* Later, there may be more than one monitor available */
-static void _AddDisplay(BScreen *screen) {
-	SDL_VideoDisplay display;
-	SDL_DisplayMode *mode = (SDL_DisplayMode*)SDL_calloc(1,
-		sizeof(SDL_DisplayMode));
-	display_mode *bmode = (display_mode*)SDL_calloc(1, sizeof(display_mode));
-	screen->GetMode(bmode);
-
-	_BDisplayModeToSdlDisplayMode(bmode, mode);
-	
-	SDL_zero(display);
-	display.desktop_mode = *mode;
-	display.current_mode = *mode;
-	
-	SDL_AddVideoDisplay(&display);
-}
-
-/*
- * Functions called by SDL
- */
-
-int BE_InitModes(_THIS) {
-	BScreen screen;
-
-	/* TODO: When Haiku supports multiple display screens, call
-	   _AddDisplayScreen() for each of them. */
-	_AddDisplay(&screen);
-	return 0;
-}
-
-int BE_QuitModes(_THIS) {
-	/* FIXME: Nothing really needs to be done here at the moment? */
-	return 0;
-}
-
-
-int BE_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) {
-	BScreen bscreen;
-	BRect rc = bscreen.Frame();
-	rect->x = (int)rc.left;
-	rect->y = (int)rc.top;
-	rect->w = (int)rc.Width() + 1;
-	rect->h = (int)rc.Height() + 1;
-	return 0;
-}
-
-void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
-	/* Get the current screen */
-	BScreen bscreen;
-
-	/* Iterate through all of the modes */
-	SDL_DisplayMode mode;
-	display_mode this_bmode;
-	display_mode *bmodes;
-	uint32 count, i;
-	
-	/* Get graphics-hardware supported modes */
-	bscreen.GetModeList(&bmodes, &count);
-	bscreen.GetMode(&this_bmode);
-	
-	for(i = 0; i < count; ++i) {
-		// FIXME: Apparently there are errors with colorspace changes
-		if (bmodes[i].space == this_bmode.space) {
-			_BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
-			SDL_AddDisplayMode(display, &mode);
-		}
-	}
-	free(bmodes);
-}
-
-
-int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
-	/* Get the current screen */
-	BScreen bscreen;
-	if(!bscreen.IsValid()) {
-		printf(__FILE__": %d - ERROR: BAD SCREEN\n", __LINE__);
-	}
-
-	/* Set the mode using the driver data */
-	display_mode *bmode = _ExtractBMode(mode);
-
-
-	/* FIXME: Is the first option always going to be the right one? */
-	uint32 c = 0, i;
-	display_mode *bmode_list;
-	bscreen.GetModeList(&bmode_list, &c);
-	for(i = 0; i < c; ++i) {
-		if(	bmode_list[i].space == bmode->space &&
-			bmode_list[i].virtual_width == bmode->virtual_width &&
-			bmode_list[i].virtual_height == bmode->virtual_height ) {
-				bmode = &bmode_list[i];
-				break;
-		}
-	}
-
-	if(bscreen.SetMode(bmode) != B_OK) {
-		return SDL_SetError("Bad video mode\n");
-	}
-	
-	free(bmode_list);
-	
-#if SDL_VIDEO_OPENGL
-	/* FIXME: Is there some way to reboot the OpenGL context?  This doesn't
-	   help */
-//	BE_GL_RebootContexts(_this);
-#endif
-
-	return 0;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_BWINDOW */
diff --git a/deps/SDL2/src/video/bwindow/SDL_bmodes.h b/deps/SDL2/src/video/bwindow/SDL_bmodes.h
deleted file mode 100644
index 9ca04d0..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bmodes.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_BMODES_H
-#define SDL_BMODES_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "../SDL_sysvideo.h"
-
-extern int32 BE_ColorSpaceToBitsPerPixel(uint32 colorspace);
-extern int32 BE_BPPToSDLPxFormat(int32 bpp);
-
-extern int BE_InitModes(_THIS);
-extern int BE_QuitModes(_THIS);
-extern int BE_GetDisplayBounds(_THIS, SDL_VideoDisplay *display,
-    SDL_Rect *rect);
-extern void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display);
-extern int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display,
-    SDL_DisplayMode *mode);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/deps/SDL2/src/video/bwindow/SDL_bopengl.cc b/deps/SDL2/src/video/bwindow/SDL_bopengl.cc
deleted file mode 100644
index 13b90ad..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bopengl.cc
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_BWINDOW
-
-#include "SDL_bopengl.h"
-
-#include <unistd.h>
-#include <KernelKit.h>
-#include <OpenGLKit.h>
-#include "SDL_BWin.h"
-#include "../../main/beos/SDL_BApp.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define BGL_FLAGS BGL_RGB | BGL_DOUBLE
-
-static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
-	return ((SDL_BWin*)(window->driverdata));
-}
-
-static SDL_INLINE SDL_BApp *_GetBeApp() {
-	return ((SDL_BApp*)be_app);
-}
-
-/* Passing a NULL path means load pointers from the application */
-int BE_GL_LoadLibrary(_THIS, const char *path)
-{
-/* FIXME: Is this working correctly? */
-	image_info info;
-			int32 cookie = 0;
-	while (get_next_image_info(0, &cookie, &info) == B_OK) {
-		void *location = NULL;
-		if( get_image_symbol(info.id, "glBegin", B_SYMBOL_TYPE_ANY,
-				&location) == B_OK) {
-
-			_this->gl_config.dll_handle = (void *) info.id;
-			_this->gl_config.driver_loaded = 1;
-			SDL_strlcpy(_this->gl_config.driver_path, "libGL.so",
-					SDL_arraysize(_this->gl_config.driver_path));
-		}
-	}
-	return 0;
-}
-
-void *BE_GL_GetProcAddress(_THIS, const char *proc)
-{
-	if (_this->gl_config.dll_handle != NULL) {
-		void *location = NULL;
-		status_t err;
-		if ((err =
-			get_image_symbol((image_id) _this->gl_config.dll_handle,
-                              proc, B_SYMBOL_TYPE_ANY,
-                              &location)) == B_OK) {
-            return location;
-        } else {
-                SDL_SetError("Couldn't find OpenGL symbol");
-                return NULL;
-        }
-	} else {
-		SDL_SetError("OpenGL library not loaded");
-		return NULL;
-	}
-}
-
-
-
-
-void BE_GL_SwapWindow(_THIS, SDL_Window * window) {
-    _ToBeWin(window)->SwapBuffers();
-}
-
-int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
-	_GetBeApp()->SetCurrentContext(((SDL_BWin*)context)->GetGLView());
-	return 0;
-}
-
-
-SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window) {
-	/* FIXME: Not sure what flags should be included here; may want to have
-	   most of them */
-	SDL_BWin *bwin = _ToBeWin(window);
-	bwin->CreateGLView(BGL_FLAGS);
-	return (SDL_GLContext)(bwin);
-}
-
-void BE_GL_DeleteContext(_THIS, SDL_GLContext context) {
-	/* Currently, automatically unlocks the view */
-	((SDL_BWin*)context)->RemoveGLView();
-}
-
-
-int BE_GL_SetSwapInterval(_THIS, int interval) {
-	/* TODO: Implement this, if necessary? */
-	return 0;
-}
-
-int BE_GL_GetSwapInterval(_THIS) {
-	/* TODO: Implement this, if necessary? */
-	return 0;
-}
-
-
-void BE_GL_UnloadLibrary(_THIS) {
-	/* TODO: Implement this, if necessary? */
-}
-
-
-/* FIXME: This function is meant to clear the OpenGL context when the video
-   mode changes (see SDL_bmodes.cc), but it doesn't seem to help, and is not
-   currently in use. */
-void BE_GL_RebootContexts(_THIS) {
-	SDL_Window *window = _this->windows;
-	while(window) {
-		SDL_BWin *bwin = _ToBeWin(window);
-		if(bwin->GetGLView()) {
-			bwin->LockLooper();
-			bwin->RemoveGLView();
-			bwin->CreateGLView(BGL_FLAGS);
-			bwin->UnlockLooper();
-		}
-		window = window->next;
-	}
-}
-
-
-#if 0 /* Functions from 1.2 that do not appear to be used in 1.3 */
-
-    int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value)
-    {
-        /*
-           FIXME? Right now BE_GL_GetAttribute shouldn't be called between glBegin() and glEnd() - it doesn't use "cached" values
-         */
-        switch (attrib) {
-        case SDL_GL_RED_SIZE:
-            glGetIntegerv(GL_RED_BITS, (GLint *) value);
-            break;
-        case SDL_GL_GREEN_SIZE:
-            glGetIntegerv(GL_GREEN_BITS, (GLint *) value);
-            break;
-        case SDL_GL_BLUE_SIZE:
-            glGetIntegerv(GL_BLUE_BITS, (GLint *) value);
-            break;
-        case SDL_GL_ALPHA_SIZE:
-            glGetIntegerv(GL_ALPHA_BITS, (GLint *) value);
-            break;
-        case SDL_GL_DOUBLEBUFFER:
-            glGetBooleanv(GL_DOUBLEBUFFER, (GLboolean *) value);
-            break;
-        case SDL_GL_BUFFER_SIZE:
-            int v;
-            glGetIntegerv(GL_RED_BITS, (GLint *) & v);
-            *value = v;
-            glGetIntegerv(GL_GREEN_BITS, (GLint *) & v);
-            *value += v;
-            glGetIntegerv(GL_BLUE_BITS, (GLint *) & v);
-            *value += v;
-            glGetIntegerv(GL_ALPHA_BITS, (GLint *) & v);
-            *value += v;
-            break;
-        case SDL_GL_DEPTH_SIZE:
-            glGetIntegerv(GL_DEPTH_BITS, (GLint *) value);      /* Mesa creates 16 only? r5 always 32 */
-            break;
-        case SDL_GL_STENCIL_SIZE:
-            glGetIntegerv(GL_STENCIL_BITS, (GLint *) value);
-            break;
-        case SDL_GL_ACCUM_RED_SIZE:
-            glGetIntegerv(GL_ACCUM_RED_BITS, (GLint *) value);
-            break;
-        case SDL_GL_ACCUM_GREEN_SIZE:
-            glGetIntegerv(GL_ACCUM_GREEN_BITS, (GLint *) value);
-            break;
-        case SDL_GL_ACCUM_BLUE_SIZE:
-            glGetIntegerv(GL_ACCUM_BLUE_BITS, (GLint *) value);
-            break;
-        case SDL_GL_ACCUM_ALPHA_SIZE:
-            glGetIntegerv(GL_ACCUM_ALPHA_BITS, (GLint *) value);
-            break;
-        case SDL_GL_STEREO:
-        case SDL_GL_MULTISAMPLEBUFFERS:
-        case SDL_GL_MULTISAMPLESAMPLES:
-        default:
-            *value = 0;
-            return (-1);
-        }
-        return 0;
-    }
-
-#endif
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_BWINDOW */
diff --git a/deps/SDL2/src/video/bwindow/SDL_bopengl.h b/deps/SDL2/src/video/bwindow/SDL_bopengl.h
deleted file mode 100644
index 9ec972e..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bopengl.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_BOPENGL_H
-#define SDL_BOPENGL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "../SDL_sysvideo.h"
-
-
-extern int BE_GL_LoadLibrary(_THIS, const char *path);                  /* FIXME */
-extern void *BE_GL_GetProcAddress(_THIS, const char *proc);             /* FIXME */
-extern void BE_GL_UnloadLibrary(_THIS);                                 /* TODO */
-extern int BE_GL_MakeCurrent(_THIS, SDL_Window * window,
-                              SDL_GLContext context);
-extern int BE_GL_SetSwapInterval(_THIS, int interval);                  /* TODO */
-extern int BE_GL_GetSwapInterval(_THIS);                                /* TODO */
-extern void BE_GL_SwapWindow(_THIS, SDL_Window * window);
-extern SDL_GLContext BE_GL_CreateContext(_THIS, SDL_Window * window);
-extern void BE_GL_DeleteContext(_THIS, SDL_GLContext context);
-
-extern void BE_GL_RebootContexts(_THIS);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/deps/SDL2/src/video/bwindow/SDL_bvideo.cc b/deps/SDL2/src/video/bwindow/SDL_bvideo.cc
deleted file mode 100644
index 19c03ee..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bvideo.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_BWINDOW
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "SDL_bkeyboard.h"
-#include "SDL_bwindow.h"
-#include "SDL_bclipboard.h"
-#include "SDL_bvideo.h"
-#include "SDL_bopengl.h"
-#include "SDL_bmodes.h"
-#include "SDL_bframebuffer.h"
-#include "SDL_bevents.h"
-
-/* FIXME: Undefined functions */
-//    #define BE_PumpEvents NULL
-    #define BE_StartTextInput NULL
-    #define BE_StopTextInput NULL
-    #define BE_SetTextInputRect NULL
-
-//    #define BE_DeleteDevice NULL
-
-/* End undefined functions */
-
-static SDL_VideoDevice *
-BE_CreateDevice(int devindex)
-{
-    SDL_VideoDevice *device;
-    /*SDL_VideoData *data;*/
-
-    /* Initialize all variables that we clean on shutdown */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-
-    device->driverdata = NULL; /* FIXME: Is this the cause of some of the
-    							  SDL_Quit() errors? */
-
-/* TODO: Figure out if any initialization needs to go here */
-
-    /* Set the function pointers */
-    device->VideoInit = BE_VideoInit;
-    device->VideoQuit = BE_VideoQuit;
-    device->GetDisplayBounds = BE_GetDisplayBounds;
-    device->GetDisplayModes = BE_GetDisplayModes;
-    device->SetDisplayMode = BE_SetDisplayMode;
-    device->PumpEvents = BE_PumpEvents;
-
-    device->CreateWindow = BE_CreateWindow;
-    device->CreateWindowFrom = BE_CreateWindowFrom;
-    device->SetWindowTitle = BE_SetWindowTitle;
-    device->SetWindowIcon = BE_SetWindowIcon;
-    device->SetWindowPosition = BE_SetWindowPosition;
-    device->SetWindowSize = BE_SetWindowSize;
-    device->ShowWindow = BE_ShowWindow;
-    device->HideWindow = BE_HideWindow;
-    device->RaiseWindow = BE_RaiseWindow;
-    device->MaximizeWindow = BE_MaximizeWindow;
-    device->MinimizeWindow = BE_MinimizeWindow;
-    device->RestoreWindow = BE_RestoreWindow;
-    device->SetWindowBordered = BE_SetWindowBordered;
-    device->SetWindowFullscreen = BE_SetWindowFullscreen;
-    device->SetWindowGammaRamp = BE_SetWindowGammaRamp;
-    device->GetWindowGammaRamp = BE_GetWindowGammaRamp;
-    device->SetWindowGrab = BE_SetWindowGrab;
-    device->DestroyWindow = BE_DestroyWindow;
-    device->GetWindowWMInfo = BE_GetWindowWMInfo;
-    device->CreateWindowFramebuffer = BE_CreateWindowFramebuffer;
-    device->UpdateWindowFramebuffer = BE_UpdateWindowFramebuffer;
-    device->DestroyWindowFramebuffer = BE_DestroyWindowFramebuffer;
-    
-    device->shape_driver.CreateShaper = NULL;
-    device->shape_driver.SetWindowShape = NULL;
-    device->shape_driver.ResizeWindowShape = NULL;
-
-
-    device->GL_LoadLibrary = BE_GL_LoadLibrary;
-    device->GL_GetProcAddress = BE_GL_GetProcAddress;
-    device->GL_UnloadLibrary = BE_GL_UnloadLibrary;
-    device->GL_CreateContext = BE_GL_CreateContext;
-    device->GL_MakeCurrent = BE_GL_MakeCurrent;
-    device->GL_SetSwapInterval = BE_GL_SetSwapInterval;
-    device->GL_GetSwapInterval = BE_GL_GetSwapInterval;
-    device->GL_SwapWindow = BE_GL_SwapWindow;
-    device->GL_DeleteContext = BE_GL_DeleteContext;
-
-    device->StartTextInput = BE_StartTextInput;
-    device->StopTextInput = BE_StopTextInput;
-    device->SetTextInputRect = BE_SetTextInputRect;
-
-    device->SetClipboardText = BE_SetClipboardText;
-    device->GetClipboardText = BE_GetClipboardText;
-    device->HasClipboardText = BE_HasClipboardText;
-
-    device->free = BE_DeleteDevice;
-
-    return device;
-}
-
-VideoBootStrap BWINDOW_bootstrap = {
-	"bwindow", "BDirectWindow graphics",
-	BE_Available, BE_CreateDevice
-};
-
-void BE_DeleteDevice(SDL_VideoDevice * device)
-{
-	SDL_free(device->driverdata);
-	SDL_free(device);
-}
-
-int BE_VideoInit(_THIS)
-{
-	/* Initialize the Be Application for appserver interaction */
-	if (SDL_InitBeApp() < 0) {
-		return -1;
-	}
-	
-	/* Initialize video modes */
-	BE_InitModes(_this);
-
-	/* Init the keymap */
-	BE_InitOSKeymap();
-	
-	
-#if SDL_VIDEO_OPENGL
-        /* testgl application doesn't load library, just tries to load symbols */
-        /* is it correct? if so we have to load library here */
-    BE_GL_LoadLibrary(_this, NULL);
-#endif
-
-        /* We're done! */
-    return (0);
-}
-
-int BE_Available(void)
-{
-    return (1);
-}
-
-void BE_VideoQuit(_THIS)
-{
-
-    BE_QuitModes(_this);
-
-    SDL_QuitBeApp();
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_BWINDOW */
diff --git a/deps/SDL2/src/video/bwindow/SDL_bvideo.h b/deps/SDL2/src/video/bwindow/SDL_bvideo.h
deleted file mode 100644
index e0e8e07..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bvideo.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BVIDEO_H
-#define BVIDEO_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "../../main/beos/SDL_BeApp.h"
-#include "../SDL_sysvideo.h"
-
-
-extern void BE_VideoQuit(_THIS);
-extern int BE_VideoInit(_THIS);
-extern void BE_DeleteDevice(_THIS);
-extern int BE_Available(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/deps/SDL2/src/video/bwindow/SDL_bwindow.cc b/deps/SDL2/src/video/bwindow/SDL_bwindow.cc
deleted file mode 100644
index c898be6..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bwindow.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_BWINDOW
-#include "../SDL_sysvideo.h"
-
-#include "SDL_BWin.h"
-#include <new>
-
-/* Define a path to window's BWIN data */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
-	return ((SDL_BWin*)(window->driverdata));
-}
-
-static SDL_INLINE SDL_BApp *_GetBeApp() {
-	return ((SDL_BApp*)be_app);
-}
-
-static int _InitWindow(_THIS, SDL_Window *window) {
-	uint32 flags = 0;
-	window_look look = B_BORDERED_WINDOW_LOOK;
-
-	BRect bounds(
-        window->x,
-        window->y,
-        window->x + window->w - 1,	//BeWindows have an off-by-one px w/h thing
-        window->y + window->h - 1
-    );
-    
-    if(window->flags & SDL_WINDOW_FULLSCREEN) {
-    	/* TODO: Add support for this flag */
-    	printf(__FILE__": %d!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",__LINE__);
-    }
-    if(window->flags & SDL_WINDOW_OPENGL) {
-    	/* TODO: Add support for this flag */
-    }
-    if(!(window->flags & SDL_WINDOW_RESIZABLE)) {
-    	flags |= B_NOT_RESIZABLE | B_NOT_ZOOMABLE;
-    }
-    if(window->flags & SDL_WINDOW_BORDERLESS) {
-    	look = B_NO_BORDER_WINDOW_LOOK;
-    }
-
-    SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, look, flags);
-    if(bwin == NULL)
-    	return ENOMEM;
-
-    window->driverdata = bwin;
-    int32 winID = _GetBeApp()->GetID(window);
-    bwin->SetID(winID);
-
-    return 0;
-}
-
-int BE_CreateWindow(_THIS, SDL_Window *window) {
-	if(_InitWindow(_this, window) == ENOMEM)
-		return ENOMEM;
-	
-	/* Start window loop */
-    _ToBeWin(window)->Show();
-    return 0;
-}
-
-int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
-
-	SDL_BWin *otherBWin = (SDL_BWin*)data;
-	if(!otherBWin->LockLooper())
-		return -1;
-	
-	/* Create the new window and initialize its members */
-	window->x = (int)otherBWin->Frame().left;
-	window->y = (int)otherBWin->Frame().top;
-	window->w = (int)otherBWin->Frame().Width();
-	window->h = (int)otherBWin->Frame().Height();
-	
-	/* Set SDL flags */
-	if(!(otherBWin->Flags() & B_NOT_RESIZABLE)) {
-		window->flags |= SDL_WINDOW_RESIZABLE;
-	}
-	
-	/* If we are out of memory, return the error code */
-	if(_InitWindow(_this, window) == ENOMEM)
-		return ENOMEM;
-	
-	/* TODO: Add any other SDL-supported window attributes here */
-    _ToBeWin(window)->SetTitle(otherBWin->Title());
-    
-    /* Start window loop and unlock the other window */
-    _ToBeWin(window)->Show();
-    
-    otherBWin->UnlockLooper();
-    return 0;
-}
-
-void BE_SetWindowTitle(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_SET_TITLE);
-	msg.AddString("window-title", window->title);
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) {
-	/* FIXME: Icons not supported by BeOs/Haiku */
-}
-
-void BE_SetWindowPosition(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_MOVE_WINDOW);
-	msg.AddInt32("window-x", window->x);
-	msg.AddInt32("window-y", window->y);
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_SetWindowSize(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_RESIZE_WINDOW);
-	msg.AddInt32("window-w", window->w - 1);
-	msg.AddInt32("window-h", window->h - 1);
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) {
-	BMessage msg(BWIN_SET_BORDERED);
-	msg.AddBool("window-border", bordered != SDL_FALSE);
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_ShowWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_SHOW_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_HideWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_HIDE_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_RaiseWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_SHOW_WINDOW);	/* Activate this window and move to front */
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_MaximizeWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_MAXIMIZE_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_MinimizeWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_MINIMIZE_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_RestoreWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_RESTORE_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
-}
-
-void BE_SetWindowFullscreen(_THIS, SDL_Window * window,
-		SDL_VideoDisplay * display, SDL_bool fullscreen) {
-	/* Haiku tracks all video display information */
-	BMessage msg(BWIN_FULLSCREEN);
-	msg.AddBool("fullscreen", fullscreen);
-	_ToBeWin(window)->PostMessage(&msg);
-	
-}
-
-int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) {
-	/* FIXME: Not BeOs/Haiku supported */
-	return -1;
-}
-
-int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) {
-	/* FIXME: Not BeOs/Haiku supported */
-	return -1;
-}
-
-
-void BE_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) {
-	/* TODO: Implement this! */
-}
-
-void BE_DestroyWindow(_THIS, SDL_Window * window) {
-	_ToBeWin(window)->LockLooper();	/* This MUST be locked */
-	_GetBeApp()->ClearID(_ToBeWin(window));
-	_ToBeWin(window)->Quit();
-	window->driverdata = NULL;
-}
-
-SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
-                                    struct SDL_SysWMinfo *info) {
-	/* FIXME: What is the point of this? What information should be included? */
-	return SDL_FALSE;
-}
-
-
-
-
- 
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_BWINDOW */
diff --git a/deps/SDL2/src/video/bwindow/SDL_bwindow.h b/deps/SDL2/src/video/bwindow/SDL_bwindow.h
deleted file mode 100644
index e3c0b6a..0000000
--- a/deps/SDL2/src/video/bwindow/SDL_bwindow.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_BWINDOW_H
-#define SDL_BWINDOW_H
-
-
-#include "../SDL_sysvideo.h"
-
-
-extern int BE_CreateWindow(_THIS, SDL_Window *window);
-extern int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
-extern void BE_SetWindowTitle(_THIS, SDL_Window * window);
-extern void BE_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
-extern void BE_SetWindowPosition(_THIS, SDL_Window * window);
-extern void BE_SetWindowSize(_THIS, SDL_Window * window);
-extern void BE_ShowWindow(_THIS, SDL_Window * window);
-extern void BE_HideWindow(_THIS, SDL_Window * window);
-extern void BE_RaiseWindow(_THIS, SDL_Window * window);
-extern void BE_MaximizeWindow(_THIS, SDL_Window * window);
-extern void BE_MinimizeWindow(_THIS, SDL_Window * window);
-extern void BE_RestoreWindow(_THIS, SDL_Window * window);
-extern void BE_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
-extern void BE_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
-extern int BE_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
-extern int BE_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp);
-extern void BE_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
-extern void BE_DestroyWindow(_THIS, SDL_Window * window);
-extern SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
-                                    struct SDL_SysWMinfo *info);
-
-
-
-#endif
-
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoaclipboard.h b/deps/SDL2/src/video/cocoa/SDL_cocoaclipboard.h
deleted file mode 100644
index 74515dd..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoaclipboard.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoaclipboard_h
-#define _SDL_cocoaclipboard_h
-
-/* Forward declaration */
-struct SDL_VideoData;
-
-extern int Cocoa_SetClipboardText(_THIS, const char *text);
-extern char *Cocoa_GetClipboardText(_THIS);
-extern SDL_bool Cocoa_HasClipboardText(_THIS);
-extern void Cocoa_CheckClipboardUpdate(struct SDL_VideoData * data);
-
-#endif /* _SDL_cocoaclipboard_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoaclipboard.m b/deps/SDL2/src/video/cocoa/SDL_cocoaclipboard.m
deleted file mode 100644
index 62c34b5..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoaclipboard.m
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-#include "SDL_cocoavideo.h"
-#include "../../events/SDL_clipboardevents_c.h"
-
-static NSString *
-GetTextFormat(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    if (data->osversion >= 0x1060) {
-        return NSPasteboardTypeString;
-    } else {
-        return NSStringPboardType;
-    }
-}
-
-int
-Cocoa_SetClipboardText(_THIS, const char *text)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    NSAutoreleasePool *pool;
-    NSPasteboard *pasteboard;
-    NSString *format = GetTextFormat(_this);
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    pasteboard = [NSPasteboard generalPasteboard];
-    data->clipboard_count = [pasteboard declareTypes:[NSArray arrayWithObject:format] owner:nil];
-    [pasteboard setString:[NSString stringWithUTF8String:text] forType:format];
-
-    [pool release];
-
-    return 0;
-}
-
-char *
-Cocoa_GetClipboardText(_THIS)
-{
-    NSAutoreleasePool *pool;
-    NSPasteboard *pasteboard;
-    NSString *format = GetTextFormat(_this);
-    NSString *available;
-    char *text;
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    pasteboard = [NSPasteboard generalPasteboard];
-    available = [pasteboard availableTypeFromArray: [NSArray arrayWithObject:format]];
-    if ([available isEqualToString:format]) {
-        NSString* string;
-        const char *utf8;
-
-        string = [pasteboard stringForType:format];
-        if (string == nil) {
-            utf8 = "";
-        } else {
-            utf8 = [string UTF8String];
-        }
-        text = SDL_strdup(utf8);
-    } else {
-        text = SDL_strdup("");
-    }
-
-    [pool release];
-
-    return text;
-}
-
-SDL_bool
-Cocoa_HasClipboardText(_THIS)
-{
-    SDL_bool result = SDL_FALSE;
-    char *text = Cocoa_GetClipboardText(_this);
-    if (text) {
-        result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
-    SDL_free(text);
-    }
-    return result;
-}
-
-void
-Cocoa_CheckClipboardUpdate(struct SDL_VideoData * data)
-{
-    NSAutoreleasePool *pool;
-    NSPasteboard *pasteboard;
-    NSInteger count;
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    pasteboard = [NSPasteboard generalPasteboard];
-    count = [pasteboard changeCount];
-    if (count != data->clipboard_count) {
-        if (data->clipboard_count) {
-            SDL_SendClipboardUpdate();
-        }
-        data->clipboard_count = count;
-    }
-
-    [pool release];
-}
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoaevents.h b/deps/SDL2/src/video/cocoa/SDL_cocoaevents.h
deleted file mode 100644
index 4057748..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoaevents.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoaevents_h
-#define _SDL_cocoaevents_h
-
-extern void Cocoa_RegisterApp(void);
-extern void Cocoa_PumpEvents(_THIS);
-
-#endif /* _SDL_cocoaevents_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoaevents.m b/deps/SDL2/src/video/cocoa/SDL_cocoaevents.m
deleted file mode 100644
index e6b292b..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoaevents.m
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-#include "SDL_timer.h"
-
-#include "SDL_cocoavideo.h"
-#include "../../events/SDL_events_c.h"
-
-#if !defined(UsrActivity) && defined(__LP64__) && !defined(__POWER__)
-/*
- * Workaround for a bug in the 10.5 SDK: By accident, OSService.h does
- * not include Power.h at all when compiling in 64bit mode. This has
- * been fixed in 10.6, but for 10.5, we manually define UsrActivity
- * to ensure compilation works.
- */
-#define UsrActivity 1
-#endif
-
-/* setAppleMenu disappeared from the headers in 10.4 */
- at interface NSApplication(NSAppleMenu)
-- (void)setAppleMenu:(NSMenu *)menu;
- at end
-
- at interface SDLAppDelegate : NSObject {
- at public
-    BOOL seenFirstActivate;
-}
-
-- (id)init;
- at end
-
- at implementation SDLAppDelegate : NSObject
-- (id)init
-{
-    self = [super init];
-
-    if (self) {
-        seenFirstActivate = NO;
-        [[NSNotificationCenter defaultCenter] addObserver:self
-                                                 selector:@selector(focusSomeWindow:)
-                                                     name:NSApplicationDidBecomeActiveNotification
-                                                   object:nil];
-    }
-
-    return self;
-}
-
-- (void)dealloc
-{
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-    [super dealloc];
-}
-
-- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
-{
-    SDL_SendQuit();
-    return NSTerminateCancel;
-}
-
-- (void)focusSomeWindow:(NSNotification *)aNotification
-{
-    /* HACK: Ignore the first call. The application gets a
-     * applicationDidBecomeActive: a little bit after the first window is
-     * created, and if we don't ignore it, a window that has been created with
-     * SDL_WINDOW_MINIZED will ~immediately be restored.
-     */
-    if (!seenFirstActivate) {
-        seenFirstActivate = YES;
-        return;
-    }
-
-    SDL_VideoDevice *device = SDL_GetVideoDevice();
-    if (device && device->windows)
-    {
-        SDL_Window *window = device->windows;
-        int i;
-        for (i = 0; i < device->num_displays; ++i)
-        {
-            SDL_Window *fullscreen_window = device->displays[i].fullscreen_window;
-            if (fullscreen_window)
-            {
-                if (fullscreen_window->flags & SDL_WINDOW_MINIMIZED) {
-                    SDL_RestoreWindow(fullscreen_window);
-                }
-                return;
-            }
-        }
-
-        if (window->flags & SDL_WINDOW_MINIMIZED) {
-            SDL_RestoreWindow(window);
-        } else {
-            SDL_RaiseWindow(window);
-        }
-    }
-}
-
-- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
-{
-    return (BOOL)SDL_SendDropFile([filename UTF8String]);
-}
- at end
-
-static SDLAppDelegate *appDelegate = nil;
-
-static NSString *
-GetApplicationName(void)
-{
-    NSDictionary *dict;
-    NSString *appName = 0;
-
-    /* Determine the application name */
-    dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
-    if (dict)
-        appName = [dict objectForKey: @"CFBundleName"];
-
-    if (![appName length])
-        appName = [[NSProcessInfo processInfo] processName];
-
-    return appName;
-}
-
-static void
-CreateApplicationMenus(void)
-{
-    NSString *appName;
-    NSString *title;
-    NSMenu *appleMenu;
-    NSMenu *serviceMenu;
-    NSMenu *windowMenu;
-    NSMenuItem *menuItem;
-
-    if (NSApp == nil) {
-        return;
-    }
-    
-    /* Create the main menu bar */
-    [NSApp setMainMenu:[[NSMenu alloc] init]];
-
-    /* Create the application menu */
-    appName = GetApplicationName();
-    appleMenu = [[NSMenu alloc] initWithTitle:@""];
-
-    /* Add menu items */
-    title = [@"About " stringByAppendingString:appName];
-    [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
-
-    [appleMenu addItem:[NSMenuItem separatorItem]];
-
-    [appleMenu addItemWithTitle:@"Preferences…" action:nil keyEquivalent:@","];
-
-    [appleMenu addItem:[NSMenuItem separatorItem]];
-
-    serviceMenu = [[NSMenu alloc] initWithTitle:@""];
-    menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Services" action:nil keyEquivalent:@""];
-    [menuItem setSubmenu:serviceMenu];
-
-    [NSApp setServicesMenu:serviceMenu];
-    [serviceMenu release];
-
-    [appleMenu addItem:[NSMenuItem separatorItem]];
-
-    title = [@"Hide " stringByAppendingString:appName];
-    [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
-
-    menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
-    [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
-
-    [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
-
-    [appleMenu addItem:[NSMenuItem separatorItem]];
-
-    title = [@"Quit " stringByAppendingString:appName];
-    [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
-
-    /* Put menu into the menubar */
-    menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
-    [menuItem setSubmenu:appleMenu];
-    [[NSApp mainMenu] addItem:menuItem];
-    [menuItem release];
-
-    /* Tell the application object that this is now the application menu */
-    [NSApp setAppleMenu:appleMenu];
-    [appleMenu release];
-
-
-    /* Create the window menu */
-    windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
-
-    /* Add menu items */
-    [windowMenu addItemWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
-
-    [windowMenu addItemWithTitle:@"Zoom" action:@selector(performZoom:) keyEquivalent:@""];
-
-    /* Put menu into the menubar */
-    menuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
-    [menuItem setSubmenu:windowMenu];
-    [[NSApp mainMenu] addItem:menuItem];
-    [menuItem release];
-
-    /* Tell the application object that this is now the window menu */
-    [NSApp setWindowsMenu:windowMenu];
-    [windowMenu release];
-}
-
-void
-Cocoa_RegisterApp(void)
-{
-    /* This can get called more than once! Be careful what you initialize! */
-    ProcessSerialNumber psn;
-    NSAutoreleasePool *pool;
-
-    if (!GetCurrentProcess(&psn)) {
-        TransformProcessType(&psn, kProcessTransformToForegroundApplication);
-        SetFrontProcess(&psn);
-    }
-
-    pool = [[NSAutoreleasePool alloc] init];
-    if (NSApp == nil) {
-        [NSApplication sharedApplication];
-
-        if ([NSApp mainMenu] == nil) {
-            CreateApplicationMenus();
-        }
-        [NSApp finishLaunching];
-        NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:@"NO" forKey:@"AppleMomentumScrollSupported"];
-        [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
-
-    }
-    if (NSApp && !appDelegate) {
-        appDelegate = [[SDLAppDelegate alloc] init];
-
-        /* If someone else has an app delegate, it means we can't turn a
-         * termination into SDL_Quit, and we can't handle application:openFile:
-         */
-        if (![NSApp delegate]) {
-            [NSApp setDelegate:appDelegate];
-        } else {
-            appDelegate->seenFirstActivate = YES;
-        }
-    }
-    [pool release];
-}
-
-void
-Cocoa_PumpEvents(_THIS)
-{
-    NSAutoreleasePool *pool;
-
-    /* Update activity every 30 seconds to prevent screensaver */
-    if (_this->suspend_screensaver) {
-        SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
-        Uint32 now = SDL_GetTicks();
-        if (!data->screensaver_activity ||
-            SDL_TICKS_PASSED(now, data->screensaver_activity + 30000)) {
-            UpdateSystemActivity(UsrActivity);
-            data->screensaver_activity = now;
-        }
-    }
-
-    pool = [[NSAutoreleasePool alloc] init];
-    for ( ; ; ) {
-        NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
-        if ( event == nil ) {
-            break;
-        }
-
-        switch ([event type]) {
-        case NSLeftMouseDown:
-        case NSOtherMouseDown:
-        case NSRightMouseDown:
-        case NSLeftMouseUp:
-        case NSOtherMouseUp:
-        case NSRightMouseUp:
-        case NSLeftMouseDragged:
-        case NSRightMouseDragged:
-        case NSOtherMouseDragged: /* usually middle mouse dragged */
-        case NSMouseMoved:
-        case NSScrollWheel:
-            Cocoa_HandleMouseEvent(_this, event);
-            break;
-        case NSKeyDown:
-        case NSKeyUp:
-        case NSFlagsChanged:
-            Cocoa_HandleKeyEvent(_this, event);
-            break;
-        default:
-            break;
-        }
-        /* Pass through to NSApp to make sure everything stays in sync */
-        [NSApp sendEvent:event];
-    }
-    [pool release];
-}
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoakeyboard.h b/deps/SDL2/src/video/cocoa/SDL_cocoakeyboard.h
deleted file mode 100644
index 4343b9c..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoakeyboard.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoakeyboard_h
-#define _SDL_cocoakeyboard_h
-
-extern void Cocoa_InitKeyboard(_THIS);
-extern void Cocoa_HandleKeyEvent(_THIS, NSEvent * event);
-extern void Cocoa_QuitKeyboard(_THIS);
-
-extern void Cocoa_StartTextInput(_THIS);
-extern void Cocoa_StopTextInput(_THIS);
-extern void Cocoa_SetTextInputRect(_THIS, SDL_Rect *rect);
-
-#endif /* _SDL_cocoakeyboard_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoakeyboard.m b/deps/SDL2/src/video/cocoa/SDL_cocoakeyboard.m
deleted file mode 100644
index 8a6b874..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoakeyboard.m
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-#include "SDL_cocoavideo.h"
-
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/scancodes_darwin.h"
-
-#include <Carbon/Carbon.h>
-
-/*#define DEBUG_IME NSLog */
-#define DEBUG_IME(...)
-
-#ifndef NX_DEVICERCTLKEYMASK
-    #define NX_DEVICELCTLKEYMASK    0x00000001
-#endif
-#ifndef NX_DEVICELSHIFTKEYMASK
-    #define NX_DEVICELSHIFTKEYMASK  0x00000002
-#endif
-#ifndef NX_DEVICERSHIFTKEYMASK
-    #define NX_DEVICERSHIFTKEYMASK  0x00000004
-#endif
-#ifndef NX_DEVICELCMDKEYMASK
-    #define NX_DEVICELCMDKEYMASK    0x00000008
-#endif
-#ifndef NX_DEVICERCMDKEYMASK
-    #define NX_DEVICERCMDKEYMASK    0x00000010
-#endif
-#ifndef NX_DEVICELALTKEYMASK
-    #define NX_DEVICELALTKEYMASK    0x00000020
-#endif
-#ifndef NX_DEVICERALTKEYMASK
-    #define NX_DEVICERALTKEYMASK    0x00000040
-#endif
-#ifndef NX_DEVICERCTLKEYMASK
-    #define NX_DEVICERCTLKEYMASK    0x00002000
-#endif
-
- at interface SDLTranslatorResponder : NSView <NSTextInput>
-{
-    NSString *_markedText;
-    NSRange   _markedRange;
-    NSRange   _selectedRange;
-    SDL_Rect  _inputRect;
-}
-- (void) doCommandBySelector:(SEL)myselector;
-- (void) setInputRect:(SDL_Rect *) rect;
- at end
-
- at implementation SDLTranslatorResponder
-
-- (void) setInputRect:(SDL_Rect *) rect
-{
-    _inputRect = *rect;
-}
-
-- (void) insertText:(id) aString
-{
-    const char *str;
-
-    DEBUG_IME(@"insertText: %@", aString);
-
-    /* Could be NSString or NSAttributedString, so we have
-     * to test and convert it before return as SDL event */
-    if ([aString isKindOfClass: [NSAttributedString class]])
-        str = [[aString string] UTF8String];
-    else
-        str = [aString UTF8String];
-
-    SDL_SendKeyboardText(str);
-}
-
-- (void) doCommandBySelector:(SEL) myselector
-{
-    /* No need to do anything since we are not using Cocoa
-       selectors to handle special keys, instead we use SDL
-       key events to do the same job.
-    */
-}
-
-- (BOOL) hasMarkedText
-{
-    return _markedText != nil;
-}
-
-- (NSRange) markedRange
-{
-    return _markedRange;
-}
-
-- (NSRange) selectedRange
-{
-    return _selectedRange;
-}
-
-- (void) setMarkedText:(id) aString
-         selectedRange:(NSRange) selRange
-{
-    if ([aString isKindOfClass: [NSAttributedString class]])
-        aString = [aString string];
-
-    if ([aString length] == 0)
-    {
-        [self unmarkText];
-        return;
-    }
-
-    if (_markedText != aString)
-    {
-        [_markedText release];
-        _markedText = [aString retain];
-    }
-
-    _selectedRange = selRange;
-    _markedRange = NSMakeRange(0, [aString length]);
-
-    SDL_SendEditingText([aString UTF8String],
-                        selRange.location, selRange.length);
-
-    DEBUG_IME(@"setMarkedText: %@, (%d, %d)", _markedText,
-          selRange.location, selRange.length);
-}
-
-- (void) unmarkText
-{
-    [_markedText release];
-    _markedText = nil;
-
-    SDL_SendEditingText("", 0, 0);
-}
-
-- (NSRect) firstRectForCharacterRange: (NSRange) theRange
-{
-    NSWindow *window = [self window];
-    NSRect contentRect = [window contentRectForFrameRect: [window frame]];
-    float windowHeight = contentRect.size.height;
-    NSRect rect = NSMakeRect(_inputRect.x, windowHeight - _inputRect.y - _inputRect.h,
-                             _inputRect.w, _inputRect.h);
-
-    DEBUG_IME(@"firstRectForCharacterRange: (%d, %d): windowHeight = %g, rect = %@",
-            theRange.location, theRange.length, windowHeight,
-            NSStringFromRect(rect));
-    rect.origin = [[self window] convertBaseToScreen: rect.origin];
-
-    return rect;
-}
-
-- (NSAttributedString *) attributedSubstringFromRange: (NSRange) theRange
-{
-    DEBUG_IME(@"attributedSubstringFromRange: (%d, %d)", theRange.location, theRange.length);
-    return nil;
-}
-
-- (NSInteger) conversationIdentifier
-{
-    return (NSInteger) self;
-}
-
-/* This method returns the index for character that is
- * nearest to thePoint.  thPoint is in screen coordinate system.
- */
-- (NSUInteger) characterIndexForPoint:(NSPoint) thePoint
-{
-    DEBUG_IME(@"characterIndexForPoint: (%g, %g)", thePoint.x, thePoint.y);
-    return 0;
-}
-
-/* This method is the key to attribute extension.
- * We could add new attributes through this method.
- * NSInputServer examines the return value of this
- * method & constructs appropriate attributed string.
- */
-- (NSArray *) validAttributesForMarkedText
-{
-    return [NSArray array];
-}
-
- at end
-
-/* This is the original behavior, before support was added for
- * differentiating between left and right versions of the keys.
- */
-static void
-DoUnsidedModifiers(unsigned short scancode,
-                   unsigned int oldMods, unsigned int newMods)
-{
-    const int mapping[] = {
-        SDL_SCANCODE_CAPSLOCK,
-        SDL_SCANCODE_LSHIFT,
-        SDL_SCANCODE_LCTRL,
-        SDL_SCANCODE_LALT,
-        SDL_SCANCODE_LGUI
-    };
-    unsigned int i, bit;
-
-    /* Iterate through the bits, testing each against the current modifiers */
-    for (i = 0, bit = NSAlphaShiftKeyMask; bit <= NSCommandKeyMask; bit <<= 1, ++i) {
-        unsigned int oldMask, newMask;
-
-        oldMask = oldMods & bit;
-        newMask = newMods & bit;
-
-        if (oldMask && oldMask != newMask) {        /* modifier up event */
-            /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
-            if (bit == NSAlphaShiftKeyMask) {
-                SDL_SendKeyboardKey(SDL_PRESSED, mapping[i]);
-            }
-            SDL_SendKeyboardKey(SDL_RELEASED, mapping[i]);
-        } else if (newMask && oldMask != newMask) { /* modifier down event */
-            SDL_SendKeyboardKey(SDL_PRESSED, mapping[i]);
-            /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
-            if (bit == NSAlphaShiftKeyMask) {
-                SDL_SendKeyboardKey(SDL_RELEASED, mapping[i]);
-            }
-        }
-    }
-}
-
-/* This is a helper function for HandleModifierSide. This
- * function reverts back to behavior before the distinction between
- * sides was made.
- */
-static void
-HandleNonDeviceModifier(unsigned int device_independent_mask,
-                        unsigned int oldMods,
-                        unsigned int newMods,
-                        SDL_Scancode scancode)
-{
-    unsigned int oldMask, newMask;
-
-    /* Isolate just the bits we care about in the depedent bits so we can
-     * figure out what changed
-     */
-    oldMask = oldMods & device_independent_mask;
-    newMask = newMods & device_independent_mask;
-
-    if (oldMask && oldMask != newMask) {
-        SDL_SendKeyboardKey(SDL_RELEASED, scancode);
-    } else if (newMask && oldMask != newMask) {
-        SDL_SendKeyboardKey(SDL_PRESSED, scancode);
-    }
-}
-
-/* This is a helper function for HandleModifierSide.
- * This function sets the actual SDL_PrivateKeyboard event.
- */
-static void
-HandleModifierOneSide(unsigned int oldMods, unsigned int newMods,
-                      SDL_Scancode scancode,
-                      unsigned int sided_device_dependent_mask)
-{
-    unsigned int old_dep_mask, new_dep_mask;
-
-    /* Isolate just the bits we care about in the depedent bits so we can
-     * figure out what changed
-     */
-    old_dep_mask = oldMods & sided_device_dependent_mask;
-    new_dep_mask = newMods & sided_device_dependent_mask;
-
-    /* We now know that this side bit flipped. But we don't know if
-     * it went pressed to released or released to pressed, so we must
-     * find out which it is.
-     */
-    if (new_dep_mask && old_dep_mask != new_dep_mask) {
-        SDL_SendKeyboardKey(SDL_PRESSED, scancode);
-    } else {
-        SDL_SendKeyboardKey(SDL_RELEASED, scancode);
-    }
-}
-
-/* This is a helper function for DoSidedModifiers.
- * This function will figure out if the modifier key is the left or right side,
- * e.g. left-shift vs right-shift.
- */
-static void
-HandleModifierSide(int device_independent_mask,
-                   unsigned int oldMods, unsigned int newMods,
-                   SDL_Scancode left_scancode,
-                   SDL_Scancode right_scancode,
-                   unsigned int left_device_dependent_mask,
-                   unsigned int right_device_dependent_mask)
-{
-    unsigned int device_dependent_mask = (left_device_dependent_mask |
-                                         right_device_dependent_mask);
-    unsigned int diff_mod;
-
-    /* On the basis that the device independent mask is set, but there are
-     * no device dependent flags set, we'll assume that we can't detect this
-     * keyboard and revert to the unsided behavior.
-     */
-    if ((device_dependent_mask & newMods) == 0) {
-        /* Revert to the old behavior */
-        HandleNonDeviceModifier(device_independent_mask, oldMods, newMods, left_scancode);
-        return;
-    }
-
-    /* XOR the previous state against the new state to see if there's a change */
-    diff_mod = (device_dependent_mask & oldMods) ^
-               (device_dependent_mask & newMods);
-    if (diff_mod) {
-        /* A change in state was found. Isolate the left and right bits
-         * to handle them separately just in case the values can simulataneously
-         * change or if the bits don't both exist.
-         */
-        if (left_device_dependent_mask & diff_mod) {
-            HandleModifierOneSide(oldMods, newMods, left_scancode, left_device_dependent_mask);
-        }
-        if (right_device_dependent_mask & diff_mod) {
-            HandleModifierOneSide(oldMods, newMods, right_scancode, right_device_dependent_mask);
-        }
-    }
-}
-
-/* This is a helper function for DoSidedModifiers.
- * This function will release a key press in the case that
- * it is clear that the modifier has been released (i.e. one side
- * can't still be down).
- */
-static void
-ReleaseModifierSide(unsigned int device_independent_mask,
-                    unsigned int oldMods, unsigned int newMods,
-                    SDL_Scancode left_scancode,
-                    SDL_Scancode right_scancode,
-                    unsigned int left_device_dependent_mask,
-                    unsigned int right_device_dependent_mask)
-{
-    unsigned int device_dependent_mask = (left_device_dependent_mask |
-                                          right_device_dependent_mask);
-
-    /* On the basis that the device independent mask is set, but there are
-     * no device dependent flags set, we'll assume that we can't detect this
-     * keyboard and revert to the unsided behavior.
-     */
-    if ((device_dependent_mask & oldMods) == 0) {
-        /* In this case, we can't detect the keyboard, so use the left side
-         * to represent both, and release it.
-         */
-        SDL_SendKeyboardKey(SDL_RELEASED, left_scancode);
-        return;
-    }
-
-    /*
-     * This could have been done in an if-else case because at this point,
-     * we know that all keys have been released when calling this function.
-     * But I'm being paranoid so I want to handle each separately,
-     * so I hope this doesn't cause other problems.
-     */
-    if ( left_device_dependent_mask & oldMods ) {
-        SDL_SendKeyboardKey(SDL_RELEASED, left_scancode);
-    }
-    if ( right_device_dependent_mask & oldMods ) {
-        SDL_SendKeyboardKey(SDL_RELEASED, right_scancode);
-    }
-}
-
-/* This is a helper function for DoSidedModifiers.
- * This function handles the CapsLock case.
- */
-static void
-HandleCapsLock(unsigned short scancode,
-               unsigned int oldMods, unsigned int newMods)
-{
-    unsigned int oldMask, newMask;
-
-    oldMask = oldMods & NSAlphaShiftKeyMask;
-    newMask = newMods & NSAlphaShiftKeyMask;
-
-    if (oldMask != newMask) {
-        SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK);
-        SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK);
-    }
-}
-
-/* This function will handle the modifier keys and also determine the
- * correct side of the key.
- */
-static void
-DoSidedModifiers(unsigned short scancode,
-                 unsigned int oldMods, unsigned int newMods)
-{
-    /* Set up arrays for the key syms for the left and right side. */
-    const SDL_Scancode left_mapping[]  = {
-        SDL_SCANCODE_LSHIFT,
-        SDL_SCANCODE_LCTRL,
-        SDL_SCANCODE_LALT,
-        SDL_SCANCODE_LGUI
-    };
-    const SDL_Scancode right_mapping[] = {
-        SDL_SCANCODE_RSHIFT,
-        SDL_SCANCODE_RCTRL,
-        SDL_SCANCODE_RALT,
-        SDL_SCANCODE_RGUI
-    };
-    /* Set up arrays for the device dependent masks with indices that
-     * correspond to the _mapping arrays
-     */
-    const unsigned int left_device_mapping[]  = { NX_DEVICELSHIFTKEYMASK, NX_DEVICELCTLKEYMASK, NX_DEVICELALTKEYMASK, NX_DEVICELCMDKEYMASK };
-    const unsigned int right_device_mapping[] = { NX_DEVICERSHIFTKEYMASK, NX_DEVICERCTLKEYMASK, NX_DEVICERALTKEYMASK, NX_DEVICERCMDKEYMASK };
-
-    unsigned int i, bit;
-
-    /* Handle CAPSLOCK separately because it doesn't have a left/right side */
-    HandleCapsLock(scancode, oldMods, newMods);
-
-    /* Iterate through the bits, testing each against the old modifiers */
-    for (i = 0, bit = NSShiftKeyMask; bit <= NSCommandKeyMask; bit <<= 1, ++i) {
-        unsigned int oldMask, newMask;
-
-        oldMask = oldMods & bit;
-        newMask = newMods & bit;
-
-        /* If the bit is set, we must always examine it because the left
-         * and right side keys may alternate or both may be pressed.
-         */
-        if (newMask) {
-            HandleModifierSide(bit, oldMods, newMods,
-                               left_mapping[i], right_mapping[i],
-                               left_device_mapping[i], right_device_mapping[i]);
-        }
-        /* If the state changed from pressed to unpressed, we must examine
-            * the device dependent bits to release the correct keys.
-            */
-        else if (oldMask && oldMask != newMask) {
-            ReleaseModifierSide(bit, oldMods, newMods,
-                              left_mapping[i], right_mapping[i],
-                              left_device_mapping[i], right_device_mapping[i]);
-        }
-    }
-}
-
-static void
-HandleModifiers(_THIS, unsigned short scancode, unsigned int modifierFlags)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    if (modifierFlags == data->modifierFlags) {
-        return;
-    }
-
-    /*
-     * Starting with Panther (10.3.0), the ability to distinguish between
-     * left side and right side modifiers is available.
-     */
-    if (data->osversion >= 0x1030) {
-        DoSidedModifiers(scancode, data->modifierFlags, modifierFlags);
-    } else {
-        DoUnsidedModifiers(scancode, data->modifierFlags, modifierFlags);
-    }
-    data->modifierFlags = modifierFlags;
-}
-
-static void
-UpdateKeymap(SDL_VideoData *data)
-{
-    TISInputSourceRef key_layout;
-    const void *chr_data;
-    int i;
-    SDL_Scancode scancode;
-    SDL_Keycode keymap[SDL_NUM_SCANCODES];
-
-    /* See if the keymap needs to be updated */
-    key_layout = TISCopyCurrentKeyboardLayoutInputSource();
-    if (key_layout == data->key_layout) {
-        return;
-    }
-    data->key_layout = key_layout;
-
-    SDL_GetDefaultKeymap(keymap);
-
-    /* Try Unicode data first */
-    CFDataRef uchrDataRef = TISGetInputSourceProperty(key_layout, kTISPropertyUnicodeKeyLayoutData);
-    if (uchrDataRef)
-        chr_data = CFDataGetBytePtr(uchrDataRef);
-    else
-        goto cleanup;
-
-    if (chr_data) {
-        UInt32 keyboard_type = LMGetKbdType();
-        OSStatus err;
-
-        for (i = 0; i < SDL_arraysize(darwin_scancode_table); i++) {
-            UniChar s[8];
-            UniCharCount len;
-            UInt32 dead_key_state;
-
-            /* Make sure this scancode is a valid character scancode */
-            scancode = darwin_scancode_table[i];
-            if (scancode == SDL_SCANCODE_UNKNOWN ||
-                (keymap[scancode] & SDLK_SCANCODE_MASK)) {
-                continue;
-            }
-
-            dead_key_state = 0;
-            err = UCKeyTranslate ((UCKeyboardLayout *) chr_data,
-                                  i, kUCKeyActionDown,
-                                  0, keyboard_type,
-                                  kUCKeyTranslateNoDeadKeysMask,
-                                  &dead_key_state, 8, &len, s);
-            if (err != noErr)
-                continue;
-
-            if (len > 0 && s[0] != 0x10) {
-                keymap[scancode] = s[0];
-            }
-        }
-        SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
-        return;
-    }
-
-cleanup:
-    CFRelease(key_layout);
-}
-
-void
-Cocoa_InitKeyboard(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    UpdateKeymap(data);
-
-    /* Set our own names for the platform-dependent but layout-independent keys */
-    /* This key is NumLock on the MacBook keyboard. :) */
-    /*SDL_SetScancodeName(SDL_SCANCODE_NUMLOCKCLEAR, "Clear");*/
-    SDL_SetScancodeName(SDL_SCANCODE_LALT, "Left Option");
-    SDL_SetScancodeName(SDL_SCANCODE_LGUI, "Left Command");
-    SDL_SetScancodeName(SDL_SCANCODE_RALT, "Right Option");
-    SDL_SetScancodeName(SDL_SCANCODE_RGUI, "Right Command");
-}
-
-void
-Cocoa_StartTextInput(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSView *parentView = [[NSApp keyWindow] contentView];
-
-    /* We only keep one field editor per process, since only the front most
-     * window can receive text input events, so it make no sense to keep more
-     * than one copy. When we switched to another window and requesting for
-     * text input, simply remove the field editor from its superview then add
-     * it to the front most window's content view */
-    if (!data->fieldEdit) {
-        data->fieldEdit =
-            [[SDLTranslatorResponder alloc] initWithFrame: NSMakeRect(0.0, 0.0, 0.0, 0.0)];
-    }
-
-    if (![[data->fieldEdit superview] isEqual: parentView])
-    {
-        /* DEBUG_IME(@"add fieldEdit to window contentView"); */
-        [data->fieldEdit removeFromSuperview];
-        [parentView addSubview: data->fieldEdit];
-        [[NSApp keyWindow] makeFirstResponder: data->fieldEdit];
-    }
-
-    [pool release];
-}
-
-void
-Cocoa_StopTextInput(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    if (data && data->fieldEdit) {
-        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-        [data->fieldEdit removeFromSuperview];
-        [data->fieldEdit release];
-        data->fieldEdit = nil;
-        [pool release];
-    }
-}
-
-void
-Cocoa_SetTextInputRect(_THIS, SDL_Rect *rect)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    if (!rect) {
-    SDL_InvalidParamError("rect");
-    return;
-    }
-
-    [data->fieldEdit setInputRect: rect];
-}
-
-void
-Cocoa_HandleKeyEvent(_THIS, NSEvent *event)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    unsigned short scancode = [event keyCode];
-    SDL_Scancode code;
-#if 0
-    const char *text;
-#endif
-
-    if ((scancode == 10 || scancode == 50) && KBGetLayoutType(LMGetKbdType()) == kKeyboardISO) {
-        /* see comments in SDL_cocoakeys.h */
-        scancode = 60 - scancode;
-    }
-    if (scancode < SDL_arraysize(darwin_scancode_table)) {
-        code = darwin_scancode_table[scancode];
-    }
-    else {
-        /* Hmm, does this ever happen?  If so, need to extend the keymap... */
-        code = SDL_SCANCODE_UNKNOWN;
-    }
-
-    switch ([event type]) {
-    case NSKeyDown:
-        if (![event isARepeat]) {
-            /* See if we need to rebuild the keyboard layout */
-            UpdateKeymap(data);
-        }
-
-        SDL_SendKeyboardKey(SDL_PRESSED, code);
-#if 1
-        if (code == SDL_SCANCODE_UNKNOWN) {
-            fprintf(stderr, "The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL mailing list <sdl at libsdl.org> or to Christian Walther <cwalther at gmx.ch>. Mac virtual key code is %d.\n", scancode);
-        }
-#endif
-        if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
-            /* FIXME CW 2007-08-16: only send those events to the field editor for which we actually want text events, not e.g. esc or function keys. Arrow keys in particular seem to produce crashes sometimes. */
-            [data->fieldEdit interpretKeyEvents:[NSArray arrayWithObject:event]];
-#if 0
-            text = [[event characters] UTF8String];
-            if(text && *text) {
-                SDL_SendKeyboardText(text);
-                [data->fieldEdit setString:@""];
-            }
-#endif
-        }
-        break;
-    case NSKeyUp:
-        SDL_SendKeyboardKey(SDL_RELEASED, code);
-        break;
-    case NSFlagsChanged:
-        /* FIXME CW 2007-08-14: check if this whole mess that takes up half of this file is really necessary */
-        HandleModifiers(_this, scancode, [event modifierFlags]);
-        break;
-    default: /* just to avoid compiler warnings */
-        break;
-    }
-}
-
-void
-Cocoa_QuitKeyboard(_THIS)
-{
-}
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoamessagebox.h b/deps/SDL2/src/video/cocoa/SDL_cocoamessagebox.h
deleted file mode 100644
index e1890b2..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoamessagebox.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-extern int Cocoa_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoamessagebox.m b/deps/SDL2/src/video/cocoa/SDL_cocoamessagebox.m
deleted file mode 100644
index 78b80ae..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoamessagebox.m
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-#if defined(__APPLE__) && defined(__POWERPC__) && !defined(__APPLE_ALTIVEC__)
-#include <altivec.h>
-#undef bool
-#undef vector
-#undef pixel
-#endif
-
-#include "SDL_events.h"
-#include "SDL_timer.h"
-#include "SDL_messagebox.h"
-#include "SDL_cocoavideo.h"
-
- at interface SDLMessageBoxPresenter : NSObject {
- at public
-    NSInteger clicked;
-    NSWindow *nswindow;
-}
-- (id) initWithParentWindow:(SDL_Window *)window;
-- (void) alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
- at end
-
- at implementation SDLMessageBoxPresenter
-- (id) initWithParentWindow:(SDL_Window *)window
-{
-    self = [super init];
-    if (self) {
-        clicked = -1;
-
-        /* Retain the NSWindow because we'll show the alert later on the main thread */
-        if (window) {
-            nswindow = [((SDL_WindowData *) window->driverdata)->nswindow retain];
-        } else {
-            nswindow = NULL;
-        }
-    }
-
-    return self;
-}
-
-- (void)showAlert:(NSAlert*)alert
-{
-    if (nswindow) {
-        [alert beginSheetModalForWindow:nswindow modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil];
-        while (clicked < 0) {
-            SDL_PumpEvents();
-            SDL_Delay(100);
-        }
-        [nswindow release];
-    } else {
-        clicked = [alert runModal];
-    }
-}
-
-- (void) alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
-{
-    clicked = returnCode;
-}
-
- at end
-
-
-/* Display a Cocoa message box */
-int
-Cocoa_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
-{
-    Cocoa_RegisterApp();
-
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    NSAlert* alert = [[[NSAlert alloc] init] autorelease];
-
-    if (messageboxdata->flags & SDL_MESSAGEBOX_ERROR) {
-        [alert setAlertStyle:NSCriticalAlertStyle];
-    } else if (messageboxdata->flags & SDL_MESSAGEBOX_WARNING) {
-        [alert setAlertStyle:NSWarningAlertStyle];
-    } else {
-        [alert setAlertStyle:NSInformationalAlertStyle];
-    }
-
-    [alert setMessageText:[NSString stringWithUTF8String:messageboxdata->title]];
-    [alert setInformativeText:[NSString stringWithUTF8String:messageboxdata->message]];
-
-    const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons;
-    int i;
-    for (i = 0; i < messageboxdata->numbuttons; ++i) {
-        NSButton *button = [alert addButtonWithTitle:[NSString stringWithUTF8String:buttons[i].text]];
-        if (buttons[i].flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT) {
-            [button setKeyEquivalent:@"\r"];
-        } else if (buttons[i].flags & SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT) {
-            [button setKeyEquivalent:@"\033"];
-        } else {
-            [button setKeyEquivalent:@""];
-        }
-    }
-
-    SDLMessageBoxPresenter* presenter = [[[SDLMessageBoxPresenter alloc] initWithParentWindow:messageboxdata->window] autorelease];
-
-    [presenter performSelectorOnMainThread:@selector(showAlert:)
-                                withObject:alert
-                             waitUntilDone:YES];
-
-    int returnValue = 0;
-    NSInteger clicked = presenter->clicked;
-    if (clicked >= NSAlertFirstButtonReturn)
-    {
-        clicked -= NSAlertFirstButtonReturn;
-        *buttonid = buttons[clicked].buttonid;
-    }
-    else
-    {
-        returnValue = SDL_SetError("Did not get a valid `clicked button' id: %d", clicked);
-    }
-
-    [pool release];
-
-    return returnValue;
-}
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoamodes.h b/deps/SDL2/src/video/cocoa/SDL_cocoamodes.h
deleted file mode 100644
index 06ed931..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoamodes.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoamodes_h
-#define _SDL_cocoamodes_h
-
-typedef struct
-{
-    CGDirectDisplayID display;
-} SDL_DisplayData;
-
-typedef struct
-{
-    const void *moderef;
-} SDL_DisplayModeData;
-
-extern void Cocoa_InitModes(_THIS);
-extern int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect);
-extern void Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
-extern int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-extern void Cocoa_QuitModes(_THIS);
-
-#endif /* _SDL_cocoamodes_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoamodes.m b/deps/SDL2/src/video/cocoa/SDL_cocoamodes.m
deleted file mode 100644
index 501684f..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoamodes.m
+++ /dev/null
@@ -1,465 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-#include "SDL_cocoavideo.h"
-
-/* We need this for IODisplayCreateInfoDictionary and kIODisplayOnlyPreferredName */
-#include <IOKit/graphics/IOGraphicsLib.h>
-
-/* we need this for ShowMenuBar() and HideMenuBar(). */
-#include <Carbon/Carbon.h>
-
-/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
-#include <AvailabilityMacros.h>
-
-
-static void
-Cocoa_ToggleMenuBar(const BOOL show)
-{
-    /* !!! FIXME: keep an eye on this.
-     * ShowMenuBar/HideMenuBar is officially unavailable for 64-bit binaries.
-     *  It happens to work, as of 10.7, but we're going to see if
-     *  we can just simply do without it on newer OSes...
-     */
-#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070) && !defined(__LP64__)
-    if (show)
-        ShowMenuBar();
-    else
-        HideMenuBar();
-#endif
-}
-
-
-/* !!! FIXME: clean out the pre-10.6 code when it makes sense to do so. */
-#define FORCE_OLD_API 0
-
-#if FORCE_OLD_API
-#undef MAC_OS_X_VERSION_MIN_REQUIRED
-#define MAC_OS_X_VERSION_MIN_REQUIRED 1050
-#endif
-
-static BOOL
-IS_SNOW_LEOPARD_OR_LATER(_THIS)
-{
-#if FORCE_OLD_API
-    return NO;
-#else
-    return ((((SDL_VideoData *) _this->driverdata))->osversion >= 0x1060);
-#endif
-}
-
-static int
-CG_SetError(const char *prefix, CGDisplayErr result)
-{
-    const char *error;
-
-    switch (result) {
-    case kCGErrorFailure:
-        error = "kCGErrorFailure";
-        break;
-    case kCGErrorIllegalArgument:
-        error = "kCGErrorIllegalArgument";
-        break;
-    case kCGErrorInvalidConnection:
-        error = "kCGErrorInvalidConnection";
-        break;
-    case kCGErrorInvalidContext:
-        error = "kCGErrorInvalidContext";
-        break;
-    case kCGErrorCannotComplete:
-        error = "kCGErrorCannotComplete";
-        break;
-    case kCGErrorNotImplemented:
-        error = "kCGErrorNotImplemented";
-        break;
-    case kCGErrorRangeCheck:
-        error = "kCGErrorRangeCheck";
-        break;
-    case kCGErrorTypeCheck:
-        error = "kCGErrorTypeCheck";
-        break;
-    case kCGErrorInvalidOperation:
-        error = "kCGErrorInvalidOperation";
-        break;
-    case kCGErrorNoneAvailable:
-        error = "kCGErrorNoneAvailable";
-        break;
-    default:
-        error = "Unknown Error";
-        break;
-    }
-    return SDL_SetError("%s: %s", prefix, error);
-}
-
-static SDL_bool
-GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode)
-{
-    SDL_DisplayModeData *data;
-    long width = 0;
-    long height = 0;
-    long bpp = 0;
-    long refreshRate = 0;
-
-    data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data));
-    if (!data) {
-        return SDL_FALSE;
-    }
-    data->moderef = moderef;
-
-    if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
-        CGDisplayModeRef vidmode = (CGDisplayModeRef) moderef;
-        CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
-        width = (long) CGDisplayModeGetWidth(vidmode);
-        height = (long) CGDisplayModeGetHeight(vidmode);
-        refreshRate = (long) CGDisplayModeGetRefreshRate(vidmode);
-
-        if (CFStringCompare(fmt, CFSTR(IO32BitDirectPixels),
-                            kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
-            bpp = 32;
-        } else if (CFStringCompare(fmt, CFSTR(IO16BitDirectPixels),
-                            kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
-            bpp = 16;
-        } else {
-            bpp = 0;  /* ignore 8-bit and such for now. */
-        }
-
-        CFRelease(fmt);
-    }
-
-    #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-    if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
-        CFNumberRef number;
-        CFDictionaryRef vidmode = (CFDictionaryRef) moderef;
-        number = CFDictionaryGetValue(vidmode, kCGDisplayWidth);
-        CFNumberGetValue(number, kCFNumberLongType, &width);
-        number = CFDictionaryGetValue(vidmode, kCGDisplayHeight);
-        CFNumberGetValue(number, kCFNumberLongType, &height);
-        number = CFDictionaryGetValue(vidmode, kCGDisplayBitsPerPixel);
-        CFNumberGetValue(number, kCFNumberLongType, &bpp);
-        number = CFDictionaryGetValue(vidmode, kCGDisplayRefreshRate);
-        CFNumberGetValue(number, kCFNumberLongType, &refreshRate);
-    }
-    #endif
-
-    mode->format = SDL_PIXELFORMAT_UNKNOWN;
-    switch (bpp) {
-    case 16:
-        mode->format = SDL_PIXELFORMAT_ARGB1555;
-        break;
-    case 32:
-        mode->format = SDL_PIXELFORMAT_ARGB8888;
-        break;
-    case 8: /* We don't support palettized modes now */
-    default: /* Totally unrecognizable bit depth. */
-        return SDL_FALSE;
-    }
-    mode->w = width;
-    mode->h = height;
-    mode->refresh_rate = refreshRate;
-    mode->driverdata = data;
-    return SDL_TRUE;
-}
-
-static void
-Cocoa_ReleaseDisplayMode(_THIS, const void *moderef)
-{
-    if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
-        CGDisplayModeRelease((CGDisplayModeRef) moderef);  /* NULL is ok */
-    }
-}
-
-static void
-Cocoa_ReleaseDisplayModeList(_THIS, CFArrayRef modelist)
-{
-    if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
-        CFRelease(modelist);  /* NULL is ok */
-    }
-}
-
-static const char *
-Cocoa_GetDisplayName(CGDirectDisplayID displayID)
-{
-    NSDictionary *deviceInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), kIODisplayOnlyPreferredName);
-    NSDictionary *localizedNames = [deviceInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]];
-    const char* displayName = NULL;
-
-    if ([localizedNames count] > 0) {
-        displayName = SDL_strdup([[localizedNames objectForKey:[[localizedNames allKeys] objectAtIndex:0]] UTF8String]);
-    }
-    [deviceInfo release];
-    return displayName;
-}
-
-void
-Cocoa_InitModes(_THIS)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    CGDisplayErr result;
-    CGDirectDisplayID *displays;
-    CGDisplayCount numDisplays;
-    int pass, i;
-
-    result = CGGetOnlineDisplayList(0, NULL, &numDisplays);
-    if (result != kCGErrorSuccess) {
-        CG_SetError("CGGetOnlineDisplayList()", result);
-        [pool release];
-        return;
-    }
-    displays = SDL_stack_alloc(CGDirectDisplayID, numDisplays);
-    result = CGGetOnlineDisplayList(numDisplays, displays, &numDisplays);
-    if (result != kCGErrorSuccess) {
-        CG_SetError("CGGetOnlineDisplayList()", result);
-        SDL_stack_free(displays);
-        [pool release];
-        return;
-    }
-
-    /* Pick up the primary display in the first pass, then get the rest */
-    for (pass = 0; pass < 2; ++pass) {
-        for (i = 0; i < numDisplays; ++i) {
-            SDL_VideoDisplay display;
-            SDL_DisplayData *displaydata;
-            SDL_DisplayMode mode;
-            const void *moderef = NULL;
-
-            if (pass == 0) {
-                if (!CGDisplayIsMain(displays[i])) {
-                    continue;
-                }
-            } else {
-                if (CGDisplayIsMain(displays[i])) {
-                    continue;
-                }
-            }
-
-            if (CGDisplayMirrorsDisplay(displays[i]) != kCGNullDirectDisplay) {
-                continue;
-            }
-
-            if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
-                moderef = CGDisplayCopyDisplayMode(displays[i]);
-            }
-
-            #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-            if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
-                moderef = CGDisplayCurrentMode(displays[i]);
-            }
-            #endif
-
-            if (!moderef) {
-                continue;
-            }
-
-            displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
-            if (!displaydata) {
-                Cocoa_ReleaseDisplayMode(_this, moderef);
-                continue;
-            }
-            displaydata->display = displays[i];
-
-            SDL_zero(display);
-            /* this returns a stddup'ed string */
-            display.name = (char *)Cocoa_GetDisplayName(displays[i]);
-            if (!GetDisplayMode (_this, moderef, &mode)) {
-                Cocoa_ReleaseDisplayMode(_this, moderef);
-                SDL_free(display.name);
-                SDL_free(displaydata);
-                continue;
-            }
-
-            display.desktop_mode = mode;
-            display.current_mode = mode;
-            display.driverdata = displaydata;
-            SDL_AddVideoDisplay(&display);
-            SDL_free(display.name);
-        }
-    }
-    SDL_stack_free(displays);
-    [pool release];
-}
-
-int
-Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect)
-{
-    SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
-    CGRect cgrect;
-
-    cgrect = CGDisplayBounds(displaydata->display);
-    rect->x = (int)cgrect.origin.x;
-    rect->y = (int)cgrect.origin.y;
-    rect->w = (int)cgrect.size.width;
-    rect->h = (int)cgrect.size.height;
-    return 0;
-}
-
-void
-Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
-{
-    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
-    CFArrayRef modes = NULL;
-
-    if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
-        modes = CGDisplayCopyAllDisplayModes(data->display, NULL);
-    }
-
-    #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-    if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
-        modes = CGDisplayAvailableModes(data->display);
-    }
-    #endif
-
-    if (modes) {
-        const CFIndex count = CFArrayGetCount(modes);
-        CFIndex i;
-
-        for (i = 0; i < count; i++) {
-            const void *moderef = CFArrayGetValueAtIndex(modes, i);
-            SDL_DisplayMode mode;
-            if (GetDisplayMode(_this, moderef, &mode)) {
-                if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
-                    CGDisplayModeRetain((CGDisplayModeRef) moderef);
-                }
-                SDL_AddDisplayMode(display, &mode);
-            }
-        }
-
-        Cocoa_ReleaseDisplayModeList(_this, modes);
-    }
-}
-
-static CGError
-Cocoa_SwitchMode(_THIS, CGDirectDisplayID display, const void *mode)
-{
-    if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
-        return CGDisplaySetDisplayMode(display, (CGDisplayModeRef) mode, NULL);
-    }
- 
-    #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-    if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
-        return CGDisplaySwitchToMode(display, (CFDictionaryRef) mode);
-    }
-    #endif
-
-    return kCGErrorFailure;
-}
-
-int
-Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
-{
-    SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
-    SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata;
-    CGDisplayFadeReservationToken fade_token = kCGDisplayFadeReservationInvalidToken;
-    CGError result;
-
-    /* Fade to black to hide resolution-switching flicker */
-    if (CGAcquireDisplayFadeReservation(5, &fade_token) == kCGErrorSuccess) {
-        CGDisplayFade(fade_token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);
-    }
-
-    if (data == display->desktop_mode.driverdata) {
-        /* Restoring desktop mode */
-        Cocoa_SwitchMode(_this, displaydata->display, data->moderef);
-
-        if (CGDisplayIsMain(displaydata->display)) {
-            CGReleaseAllDisplays();
-        } else {
-            CGDisplayRelease(displaydata->display);
-        }
-
-        if (CGDisplayIsMain(displaydata->display)) {
-            Cocoa_ToggleMenuBar(YES);
-        }
-    } else {
-        /* Put up the blanking window (a window above all other windows) */
-        if (CGDisplayIsMain(displaydata->display)) {
-            /* If we don't capture all displays, Cocoa tries to rearrange windows... *sigh* */
-            result = CGCaptureAllDisplays();
-        } else {
-            result = CGDisplayCapture(displaydata->display);
-        }
-        if (result != kCGErrorSuccess) {
-            CG_SetError("CGDisplayCapture()", result);
-            goto ERR_NO_CAPTURE;
-        }
-
-        /* Do the physical switch */
-        result = Cocoa_SwitchMode(_this, displaydata->display, data->moderef);
-        if (result != kCGErrorSuccess) {
-            CG_SetError("CGDisplaySwitchToMode()", result);
-            goto ERR_NO_SWITCH;
-        }
-
-        /* Hide the menu bar so it doesn't intercept events */
-        if (CGDisplayIsMain(displaydata->display)) {
-            Cocoa_ToggleMenuBar(NO);
-        }
-    }
-
-    /* Fade in again (asynchronously) */
-    if (fade_token != kCGDisplayFadeReservationInvalidToken) {
-        CGDisplayFade(fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
-        CGReleaseDisplayFadeReservation(fade_token);
-    }
-
-    return 0;
-
-    /* Since the blanking window covers *all* windows (even force quit) correct recovery is crucial */
-ERR_NO_SWITCH:
-    CGDisplayRelease(displaydata->display);
-ERR_NO_CAPTURE:
-    if (fade_token != kCGDisplayFadeReservationInvalidToken) {
-        CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
-        CGReleaseDisplayFadeReservation(fade_token);
-    }
-    return -1;
-}
-
-void
-Cocoa_QuitModes(_THIS)
-{
-    int i, j;
-
-    for (i = 0; i < _this->num_displays; ++i) {
-        SDL_VideoDisplay *display = &_this->displays[i];
-        SDL_DisplayModeData *mode;
-
-        if (display->current_mode.driverdata != display->desktop_mode.driverdata) {
-            Cocoa_SetDisplayMode(_this, display, &display->desktop_mode);
-        }
-
-        mode = (SDL_DisplayModeData *) display->desktop_mode.driverdata;
-        Cocoa_ReleaseDisplayMode(_this, mode->moderef);
-
-        for (j = 0; j < display->num_display_modes; j++) {
-            mode = (SDL_DisplayModeData*) display->display_modes[j].driverdata;
-            Cocoa_ReleaseDisplayMode(_this, mode->moderef);
-        }
-
-    }
-    Cocoa_ToggleMenuBar(YES);
-}
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoamouse.h b/deps/SDL2/src/video/cocoa/SDL_cocoamouse.h
deleted file mode 100644
index eb6f589..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoamouse.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoamouse_h
-#define _SDL_cocoamouse_h
-
-#include "SDL_cocoavideo.h"
-
-extern void Cocoa_InitMouse(_THIS);
-extern void Cocoa_HandleMouseEvent(_THIS, NSEvent * event);
-extern void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent * event);
-extern void Cocoa_QuitMouse(_THIS);
-
-typedef struct {
-    int deltaXOffset;
-    int deltaYOffset;
-    void *tapdata;
-} SDL_MouseData;
-
- at interface NSCursor (InvisibleCursor)
-+ (NSCursor *)invisibleCursor;
- at end
-
-#endif /* _SDL_cocoamouse_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoamouse.m b/deps/SDL2/src/video/cocoa/SDL_cocoamouse.m
deleted file mode 100644
index e834423..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoamouse.m
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-#include "SDL_assert.h"
-#include "SDL_events.h"
-#include "SDL_cocoamouse.h"
-#include "SDL_cocoamousetap.h"
-
-#include "../../events/SDL_mouse_c.h"
-
- at implementation NSCursor (InvisibleCursor)
-+ (NSCursor *)invisibleCursor
-{
-    static NSCursor *invisibleCursor = NULL;
-    if (!invisibleCursor) {
-        /* RAW 16x16 transparent GIF */
-        static unsigned char cursorBytes[] = {
-            0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80,
-            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0xF9, 0x04,
-            0x01, 0x00, 0x00, 0x01, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x10,
-            0x00, 0x10, 0x00, 0x00, 0x02, 0x0E, 0x8C, 0x8F, 0xA9, 0xCB, 0xED,
-            0x0F, 0xA3, 0x9C, 0xB4, 0xDA, 0x8B, 0xB3, 0x3E, 0x05, 0x00, 0x3B
-        };
-
-        NSData *cursorData = [NSData dataWithBytesNoCopy:&cursorBytes[0]
-                                                  length:sizeof(cursorBytes)
-                                            freeWhenDone:NO];
-        NSImage *cursorImage = [[[NSImage alloc] initWithData:cursorData] autorelease];
-        invisibleCursor = [[NSCursor alloc] initWithImage:cursorImage
-                                                  hotSpot:NSZeroPoint];
-    }
-
-    return invisibleCursor;
-}
- at end
-
-
-static SDL_Cursor *
-Cocoa_CreateDefaultCursor()
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSCursor *nscursor;
-    SDL_Cursor *cursor = NULL;
-
-    nscursor = [NSCursor arrowCursor];
-
-    if (nscursor) {
-        cursor = SDL_calloc(1, sizeof(*cursor));
-        if (cursor) {
-            cursor->driverdata = nscursor;
-            [nscursor retain];
-        }
-    }
-
-    [pool release];
-
-    return cursor;
-}
-
-static SDL_Cursor *
-Cocoa_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSImage *nsimage;
-    NSCursor *nscursor = NULL;
-    SDL_Cursor *cursor = NULL;
-
-    nsimage = Cocoa_CreateImage(surface);
-    if (nsimage) {
-        nscursor = [[NSCursor alloc] initWithImage: nsimage hotSpot: NSMakePoint(hot_x, hot_y)];
-    }
-
-    if (nscursor) {
-        cursor = SDL_calloc(1, sizeof(*cursor));
-        if (cursor) {
-            cursor->driverdata = nscursor;
-        } else {
-            [nscursor release];
-        }
-    }
-
-    [pool release];
-
-    return cursor;
-}
-
-static SDL_Cursor *
-Cocoa_CreateSystemCursor(SDL_SystemCursor id)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSCursor *nscursor = NULL;
-    SDL_Cursor *cursor = NULL;
-
-    switch(id)
-    {
-    case SDL_SYSTEM_CURSOR_ARROW:
-        nscursor = [NSCursor arrowCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_IBEAM:
-        nscursor = [NSCursor IBeamCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_WAIT:
-        nscursor = [NSCursor arrowCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_CROSSHAIR:
-        nscursor = [NSCursor crosshairCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_WAITARROW:
-        nscursor = [NSCursor arrowCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_SIZENWSE:
-    case SDL_SYSTEM_CURSOR_SIZENESW:
-        nscursor = [NSCursor closedHandCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_SIZEWE:
-        nscursor = [NSCursor resizeLeftRightCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_SIZENS:
-        nscursor = [NSCursor resizeUpDownCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_SIZEALL:
-        nscursor = [NSCursor closedHandCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_NO:
-        nscursor = [NSCursor operationNotAllowedCursor];
-        break;
-    case SDL_SYSTEM_CURSOR_HAND:
-        nscursor = [NSCursor pointingHandCursor];
-        break;
-    default:
-        SDL_assert(!"Unknown system cursor");
-        return NULL;
-    }
-
-    if (nscursor) {
-        cursor = SDL_calloc(1, sizeof(*cursor));
-        if (cursor) {
-            /* We'll free it later, so retain it here */
-            [nscursor retain];
-            cursor->driverdata = nscursor;
-        }
-    }
-
-    [pool release];
-
-    return cursor;
-}
-
-static void
-Cocoa_FreeCursor(SDL_Cursor * cursor)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSCursor *nscursor = (NSCursor *)cursor->driverdata;
-
-    [nscursor release];
-    SDL_free(cursor);
-
-    [pool release];
-}
-
-static int
-Cocoa_ShowCursor(SDL_Cursor * cursor)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    SDL_VideoDevice *device = SDL_GetVideoDevice();
-    SDL_Window *window = (device ? device->windows : NULL);
-    for (; window != NULL; window = window->next) {
-        SDL_WindowData *driverdata = (SDL_WindowData *)window->driverdata;
-        if (driverdata) {
-            [driverdata->nswindow performSelectorOnMainThread:@selector(invalidateCursorRectsForView:)
-                                                   withObject:[driverdata->nswindow contentView]
-                                                waitUntilDone:NO];
-        }
-    }
-
-    [pool release];
-
-    return 0;
-}
-
-static void
-Cocoa_WarpMouse(SDL_Window * window, int x, int y)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    CGPoint point = CGPointMake(x + (float)window->x, y + (float)window->y);
-
-    {
-        /* This makes Cocoa_HandleMouseEvent ignore this delta in the next
-         * movement event.
-         */
-        SDL_MouseData *driverdata = (SDL_MouseData*)mouse->driverdata;
-        NSPoint location =  [NSEvent mouseLocation];
-        driverdata->deltaXOffset = location.x - point.x;
-        driverdata->deltaYOffset = point.y - location.y;
-    }
-
-    /* According to the docs, this was deprecated in 10.6, but it's still
-     * around. The substitute requires a CGEventSource, but I'm not entirely
-     * sure how we'd procure the right one for this event.
-     */
-    CGSetLocalEventsSuppressionInterval(0.0);
-    CGWarpMouseCursorPosition(point);
-    CGSetLocalEventsSuppressionInterval(0.25);
-
-    if (!mouse->relative_mode) {
-        /* CGWarpMouseCursorPosition doesn't generate a window event, unlike our
-         * other implementations' APIs.
-         */
-        SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 0, x, y);
-    }
-}
-
-static int
-Cocoa_SetRelativeMouseMode(SDL_bool enabled)
-{
-    CGError result;
-
-    if (enabled) {
-        result = CGAssociateMouseAndMouseCursorPosition(NO);
-    } else {
-        result = CGAssociateMouseAndMouseCursorPosition(YES);
-    }
-    if (result != kCGErrorSuccess) {
-        return SDL_SetError("CGAssociateMouseAndMouseCursorPosition() failed");
-    }
-    return 0;
-}
-
-void
-Cocoa_InitMouse(_THIS)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    mouse->driverdata = SDL_calloc(1, sizeof(SDL_MouseData));
-
-    mouse->CreateCursor = Cocoa_CreateCursor;
-    mouse->CreateSystemCursor = Cocoa_CreateSystemCursor;
-    mouse->ShowCursor = Cocoa_ShowCursor;
-    mouse->FreeCursor = Cocoa_FreeCursor;
-    mouse->WarpMouse = Cocoa_WarpMouse;
-    mouse->SetRelativeMouseMode = Cocoa_SetRelativeMouseMode;
-
-    SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor());
-
-    Cocoa_InitMouseEventTap(mouse->driverdata);
-}
-
-void
-Cocoa_HandleMouseEvent(_THIS, NSEvent *event)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    if (mouse->relative_mode &&
-        ([event type] == NSMouseMoved ||
-         [event type] == NSLeftMouseDragged ||
-         [event type] == NSRightMouseDragged ||
-         [event type] == NSOtherMouseDragged)) {
-        SDL_MouseData *driverdata = (SDL_MouseData*)mouse->driverdata;
-        float x = [event deltaX] + driverdata->deltaXOffset;
-        float y = [event deltaY] + driverdata->deltaYOffset;
-        driverdata->deltaXOffset = driverdata->deltaYOffset = 0;
-
-        SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 1, (int)x, (int)y);
-    }
-}
-
-void
-Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    float x = [event deltaX];
-    float y = [event deltaY];
-
-    if (x > 0) {
-        x += 0.9f;
-    } else if (x < 0) {
-        x -= 0.9f;
-    }
-    if (y > 0) {
-        y += 0.9f;
-    } else if (y < 0) {
-        y -= 0.9f;
-    }
-    SDL_SendMouseWheel(window, mouse->mouseID, (int)x, (int)y);
-}
-
-void
-Cocoa_QuitMouse(_THIS)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    if (mouse) {
-        if (mouse->driverdata) {
-            Cocoa_QuitMouseEventTap(((SDL_MouseData*)mouse->driverdata));
-        }
-
-        SDL_free(mouse->driverdata);
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoamousetap.h b/deps/SDL2/src/video/cocoa/SDL_cocoamousetap.h
deleted file mode 100644
index a13d97b..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoamousetap.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoamousetap_h
-#define _SDL_cocoamousetap_h
-
-#include "SDL_cocoamouse.h"
-
-extern void Cocoa_InitMouseEventTap(SDL_MouseData *driverdata);
-extern void Cocoa_QuitMouseEventTap(SDL_MouseData *driverdata);
-
-#endif /* _SDL_cocoamousetap_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoamousetap.m b/deps/SDL2/src/video/cocoa/SDL_cocoamousetap.m
deleted file mode 100644
index 5879d49..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoamousetap.m
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-#include "SDL_cocoamousetap.h"
-
-/* Event taps are forbidden in the Mac App Store, so we can only enable this
- * code if your app doesn't need to ship through the app store.
- * This code makes it so that a grabbed cursor cannot "leak" a mouse click
- * past the edge of the window if moving the cursor too fast.
- */
-#if SDL_MAC_NO_SANDBOX
-
-#include "SDL_keyboard.h"
-#include "SDL_thread.h"
-#include "SDL_cocoavideo.h"
-
-#include "../../events/SDL_mouse_c.h"
-
-typedef struct {
-    CFMachPortRef tap;
-    CFRunLoopRef runloop;
-    CFRunLoopSourceRef runloopSource;
-    SDL_Thread *thread;
-    SDL_sem *runloopStartedSemaphore;
-} SDL_MouseEventTapData;
-
-static const CGEventMask movementEventsMask =
-      CGEventMaskBit(kCGEventLeftMouseDragged)
-    | CGEventMaskBit(kCGEventRightMouseDragged)
-    | CGEventMaskBit(kCGEventMouseMoved);
-
-static const CGEventMask allGrabbedEventsMask =
-      CGEventMaskBit(kCGEventLeftMouseDown)    | CGEventMaskBit(kCGEventLeftMouseUp)
-    | CGEventMaskBit(kCGEventRightMouseDown)   | CGEventMaskBit(kCGEventRightMouseUp)
-    | CGEventMaskBit(kCGEventOtherMouseDown)   | CGEventMaskBit(kCGEventOtherMouseUp)
-    | CGEventMaskBit(kCGEventLeftMouseDragged) | CGEventMaskBit(kCGEventRightMouseDragged)
-    | CGEventMaskBit(kCGEventMouseMoved);
-
-static CGEventRef
-Cocoa_MouseTapCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
-{
-    SDL_MouseData *driverdata = (SDL_MouseData*)refcon;
-    SDL_Mouse *mouse = SDL_GetMouse();
-    SDL_Window *window = SDL_GetKeyboardFocus();
-    NSRect windowRect;
-    CGPoint eventLocation;
-
-    switch (type)
-    {
-        case kCGEventTapDisabledByTimeout:
-        case kCGEventTapDisabledByUserInput:
-            {
-                CGEventTapEnable(((SDL_MouseEventTapData*)(driverdata->tapdata))->tap, true);
-                return NULL;
-            }
-        default:
-            break;
-    }
-
-
-    if (!window || !mouse) {
-        return event;
-    }
-
-    if (mouse->relative_mode) {
-        return event;
-    }
-
-    if (!(window->flags & SDL_WINDOW_INPUT_GRABBED)) {
-        return event;
-    }
-
-    /* This is the same coordinate system as Cocoa uses. */
-    eventLocation = CGEventGetUnflippedLocation(event);
-    windowRect = [((SDL_WindowData *) window->driverdata)->nswindow frame];
-
-    if (!NSPointInRect(NSPointFromCGPoint(eventLocation), windowRect)) {
-
-        /* This is in CGs global screenspace coordinate system, which has a
-         * flipped Y.
-         */
-        CGPoint newLocation = CGEventGetLocation(event);
-
-        if (eventLocation.x < NSMinX(windowRect)) {
-            newLocation.x = NSMinX(windowRect);
-        } else if (eventLocation.x >= NSMaxX(windowRect)) {
-            newLocation.x = NSMaxX(windowRect) - 1.0;
-        }
-
-        if (eventLocation.y < NSMinY(windowRect)) {
-            newLocation.y -= (NSMinY(windowRect) - eventLocation.y + 1);
-        } else if (eventLocation.y >= NSMaxY(windowRect)) {
-            newLocation.y += (eventLocation.y - NSMaxY(windowRect) + 1);
-        }
-
-        CGSetLocalEventsSuppressionInterval(0);
-        CGWarpMouseCursorPosition(newLocation);
-        CGSetLocalEventsSuppressionInterval(0.25);
-
-        if ((CGEventMaskBit(type) & movementEventsMask) == 0) {
-            /* For click events, we just constrain the event to the window, so
-             * no other app receives the click event. We can't due the same to
-             * movement events, since they mean that our warp cursor above
-             * behaves strangely.
-             */
-            CGEventSetLocation(event, newLocation);
-        }
-    }
-
-    return event;
-}
-
-static void
-SemaphorePostCallback(CFRunLoopTimerRef timer, void *info)
-{
-    SDL_SemPost((SDL_sem*)info);
-}
-
-static int
-Cocoa_MouseTapThread(void *data)
-{
-    SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)data;
-
-    /* Create a tap. */
-    CFMachPortRef eventTap = CGEventTapCreate(kCGSessionEventTap, kCGHeadInsertEventTap,
-                                              kCGEventTapOptionDefault, allGrabbedEventsMask,
-                                              &Cocoa_MouseTapCallback, tapdata);
-    if (eventTap) {
-        /* Try to create a runloop source we can schedule. */
-        CFRunLoopSourceRef runloopSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventTap, 0);
-        if  (runloopSource) {
-            tapdata->tap = eventTap;
-            tapdata->runloopSource = runloopSource;
-        } else {
-            CFRelease(eventTap);
-            SDL_SemPost(tapdata->runloopStartedSemaphore);
-            /* TODO: Both here and in the return below, set some state in
-             * tapdata to indicate that initialization failed, which we should
-             * check in InitMouseEventTap, after we move the semaphore check
-             * from Quit to Init.
-             */
-            return 1;
-        }
-    } else {
-        SDL_SemPost(tapdata->runloopStartedSemaphore);
-        return 1;
-    }
-
-    tapdata->runloop = CFRunLoopGetCurrent();
-    CFRunLoopAddSource(tapdata->runloop, tapdata->runloopSource, kCFRunLoopCommonModes);
-    CFRunLoopTimerContext context = {.info = tapdata->runloopStartedSemaphore};
-    /* We signal the runloop started semaphore *after* the run loop has started, indicating it's safe to CFRunLoopStop it. */
-    CFRunLoopTimerRef timer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 0, 0, 0, &SemaphorePostCallback, &context);
-    CFRunLoopAddTimer(tapdata->runloop, timer, kCFRunLoopCommonModes);
-    CFRelease(timer);
-
-    /* Run the event loop to handle events in the event tap. */
-    CFRunLoopRun();
-    /* Make sure this is signaled so that SDL_QuitMouseEventTap knows it can safely SDL_WaitThread for us. */
-    if (SDL_SemValue(tapdata->runloopStartedSemaphore) < 1) {
-        SDL_SemPost(tapdata->runloopStartedSemaphore);
-    }
-    CFRunLoopRemoveSource(tapdata->runloop, tapdata->runloopSource, kCFRunLoopCommonModes);
-
-    /* Clean up. */
-    CGEventTapEnable(tapdata->tap, false);
-    CFRelease(tapdata->runloopSource);
-    CFRelease(tapdata->tap);
-    tapdata->runloopSource = NULL;
-    tapdata->tap = NULL;
-
-    return 0;
-}
-
-void
-Cocoa_InitMouseEventTap(SDL_MouseData* driverdata)
-{
-    SDL_MouseEventTapData *tapdata;
-    driverdata->tapdata = SDL_calloc(1, sizeof(SDL_MouseEventTapData));
-    tapdata = (SDL_MouseEventTapData*)driverdata->tapdata;
-
-    tapdata->runloopStartedSemaphore = SDL_CreateSemaphore(0);
-    if (tapdata->runloopStartedSemaphore) {
-        tapdata->thread = SDL_CreateThread(&Cocoa_MouseTapThread, "Event Tap Loop", tapdata);
-        if (!tapdata->thread) {
-            SDL_DestroySemaphore(tapdata->runloopStartedSemaphore);
-        }
-    }
-
-    if (!tapdata->thread) {
-        SDL_free(driverdata->tapdata);
-        driverdata->tapdata = NULL;
-    }
-}
-
-void
-Cocoa_QuitMouseEventTap(SDL_MouseData *driverdata)
-{
-    SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)driverdata->tapdata;
-    int status;
-
-    /* Ensure that the runloop has been started first.
-     * TODO: Move this to InitMouseEventTap, check for error conditions that can
-     * happen in Cocoa_MouseTapThread, and fall back to the non-EventTap way of
-     * grabbing the mouse if it fails to Init.
-     */
-    status = SDL_SemWaitTimeout(tapdata->runloopStartedSemaphore, 5000);
-    if (status > -1) {
-        /* Then stop it, which will cause Cocoa_MouseTapThread to return. */
-        CFRunLoopStop(tapdata->runloop);
-        /* And then wait for Cocoa_MouseTapThread to finish cleaning up. It
-         * releases some of the pointers in tapdata. */
-        SDL_WaitThread(tapdata->thread, &status);
-    }
-
-    SDL_free(driverdata->tapdata);
-    driverdata->tapdata = NULL;
-}
-
-#else /* SDL_MAC_NO_SANDBOX */
-
-void
-Cocoa_InitMouseEventTap(SDL_MouseData *unused)
-{
-}
-
-void
-Cocoa_QuitMouseEventTap(SDL_MouseData *driverdata)
-{
-}
-
-#endif /* !SDL_MAC_NO_SANDBOX */
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoaopengl.h b/deps/SDL2/src/video/cocoa/SDL_cocoaopengl.h
deleted file mode 100644
index e7ef1f6..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoaopengl.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoaopengl_h
-#define _SDL_cocoaopengl_h
-
-#if SDL_VIDEO_OPENGL_CGL
-
-#include "SDL_atomic.h"
-#import <Cocoa/Cocoa.h>
-
-struct SDL_GLDriverData
-{
-    int initialized;
-};
-
- at interface SDLOpenGLContext : NSOpenGLContext {
-    SDL_atomic_t dirty;
-    SDL_Window *window;
-}
-
-- (id)initWithFormat:(NSOpenGLPixelFormat *)format
-        shareContext:(NSOpenGLContext *)share;
-- (void)scheduleUpdate;
-- (void)updateIfNeeded;
-- (void)setWindow:(SDL_Window *)window;
-
- at end
-
-
-/* OpenGL functions */
-extern int Cocoa_GL_LoadLibrary(_THIS, const char *path);
-extern void *Cocoa_GL_GetProcAddress(_THIS, const char *proc);
-extern void Cocoa_GL_UnloadLibrary(_THIS);
-extern SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window * window);
-extern int Cocoa_GL_MakeCurrent(_THIS, SDL_Window * window,
-                                SDL_GLContext context);
-extern void Cocoa_GL_GetDrawableSize(_THIS, SDL_Window * window,
-                                     int * w, int * h);
-extern int Cocoa_GL_SetSwapInterval(_THIS, int interval);
-extern int Cocoa_GL_GetSwapInterval(_THIS);
-extern void Cocoa_GL_SwapWindow(_THIS, SDL_Window * window);
-extern void Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context);
-
-#endif /* SDL_VIDEO_OPENGL_CGL */
-
-#endif /* _SDL_cocoaopengl_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoaopengl.m b/deps/SDL2/src/video/cocoa/SDL_cocoaopengl.m
deleted file mode 100644
index 13c7777..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoaopengl.m
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* NSOpenGL implementation of SDL OpenGL support */
-
-#if SDL_VIDEO_OPENGL_CGL
-#include "SDL_cocoavideo.h"
-#include "SDL_cocoaopengl.h"
-
-#include <OpenGL/CGLTypes.h>
-#include <OpenGL/OpenGL.h>
-#include <OpenGL/CGLRenderers.h>
-
-#include "SDL_loadso.h"
-#include "SDL_opengl.h"
-
-#define DEFAULT_OPENGL  "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
-/* New methods for converting to and from backing store pixels, taken from
- * AppKite/NSView.h in 10.8 SDK. */
- at interface NSView (Backing)
-- (NSPoint)convertPointToBacking:(NSPoint)aPoint;
-- (NSPoint)convertPointFromBacking:(NSPoint)aPoint;
-- (NSSize)convertSizeToBacking:(NSSize)aSize;
-- (NSSize)convertSizeFromBacking:(NSSize)aSize;
-- (NSRect)convertRectToBacking:(NSRect)aRect;
-- (NSRect)convertRectFromBacking:(NSRect)aRect;
- at end
-#endif
-
-#ifndef kCGLPFAOpenGLProfile
-#define kCGLPFAOpenGLProfile 99
-#endif
-#ifndef kCGLOGLPVersion_Legacy
-#define kCGLOGLPVersion_Legacy 0x1000
-#endif
-#ifndef kCGLOGLPVersion_3_2_Core
-#define kCGLOGLPVersion_3_2_Core 0x3200
-#endif
-
- at implementation SDLOpenGLContext : NSOpenGLContext
-
-- (id)initWithFormat:(NSOpenGLPixelFormat *)format
-        shareContext:(NSOpenGLContext *)share
-{
-    self = [super initWithFormat:format shareContext:share];
-    if (self) {
-        SDL_AtomicSet(&self->dirty, 0);
-        self->window = NULL;
-    }
-    return self;
-}
-
-- (void)scheduleUpdate
-{
-    SDL_AtomicAdd(&self->dirty, 1);
-}
-
-/* This should only be called on the thread on which a user is using the context. */
-- (void)updateIfNeeded
-{
-    int value = SDL_AtomicSet(&self->dirty, 0);
-    if (value > 0) {
-        /* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
-        [super update];
-    }
-}
-
-/* This should only be called on the thread on which a user is using the context. */
-- (void)update
-{
-    /* This ensures that regular 'update' calls clear the atomic dirty flag. */
-    [self scheduleUpdate];
-    [self updateIfNeeded];
-}
-
-/* Updates the drawable for the contexts and manages related state. */
-- (void)setWindow:(SDL_Window *)newWindow
-{
-    if (self->window) {
-        SDL_WindowData *oldwindowdata = (SDL_WindowData *)self->window->driverdata;
-
-        /* Make sure to remove us from the old window's context list, or we'll get scheduled updates from it too. */
-        NSMutableArray *contexts = oldwindowdata->nscontexts;
-        @synchronized (contexts) {
-            [contexts removeObject:self];
-        }
-    }
-
-    self->window = newWindow;
-
-    if (newWindow) {
-        SDL_WindowData *windowdata = (SDL_WindowData *)newWindow->driverdata;
-
-        /* Now sign up for scheduled updates for the new window. */
-        NSMutableArray *contexts = windowdata->nscontexts;
-        @synchronized (contexts) {
-            [contexts addObject:self];
-        }
-
-        if ([self view] != [windowdata->nswindow contentView]) {
-            [self setView:[windowdata->nswindow contentView]];
-            [self scheduleUpdate];
-        }
-    } else {
-        [self clearDrawable];
-        [self scheduleUpdate];
-    }
-}
-
- at end
-
-
-int
-Cocoa_GL_LoadLibrary(_THIS, const char *path)
-{
-    /* Load the OpenGL library */
-    if (path == NULL) {
-        path = SDL_getenv("SDL_OPENGL_LIBRARY");
-    }
-    if (path == NULL) {
-        path = DEFAULT_OPENGL;
-    }
-    _this->gl_config.dll_handle = SDL_LoadObject(path);
-    if (!_this->gl_config.dll_handle) {
-        return -1;
-    }
-    SDL_strlcpy(_this->gl_config.driver_path, path,
-                SDL_arraysize(_this->gl_config.driver_path));
-    return 0;
-}
-
-void *
-Cocoa_GL_GetProcAddress(_THIS, const char *proc)
-{
-    return SDL_LoadFunction(_this->gl_config.dll_handle, proc);
-}
-
-void
-Cocoa_GL_UnloadLibrary(_THIS)
-{
-    SDL_UnloadObject(_this->gl_config.dll_handle);
-    _this->gl_config.dll_handle = NULL;
-}
-
-SDL_GLContext
-Cocoa_GL_CreateContext(_THIS, SDL_Window * window)
-{
-    const int wantver = (_this->gl_config.major_version << 8) |
-                        (_this->gl_config.minor_version);
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    NSAutoreleasePool *pool;
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
-    NSOpenGLPixelFormatAttribute attr[32];
-    NSOpenGLPixelFormat *fmt;
-    SDLOpenGLContext *context;
-    NSOpenGLContext *share_context = nil;
-    int i = 0;
-
-    if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
-        SDL_SetError ("OpenGL ES not supported on this platform");
-        return NULL;
-    }
-
-    /* Sadly, we'll have to update this as life progresses, since we need to
-       set an enum for context profiles, not a context version number */
-    if (wantver > 0x0302) {
-        SDL_SetError ("OpenGL > 3.2 is not supported on this platform");
-        return NULL;
-    }
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    /* specify a profile if we're on Lion (10.7) or later. */
-    if (data->osversion >= 0x1070) {
-        NSOpenGLPixelFormatAttribute profile = kCGLOGLPVersion_Legacy;
-        if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_CORE) {
-            if (wantver == 0x0302) {
-                profile = kCGLOGLPVersion_3_2_Core;
-            }
-        }
-        attr[i++] = kCGLPFAOpenGLProfile;
-        attr[i++] = profile;
-    }
-
-    attr[i++] = NSOpenGLPFAColorSize;
-    attr[i++] = SDL_BYTESPERPIXEL(display->current_mode.format)*8;
-
-    attr[i++] = NSOpenGLPFADepthSize;
-    attr[i++] = _this->gl_config.depth_size;
-
-    if (_this->gl_config.double_buffer) {
-        attr[i++] = NSOpenGLPFADoubleBuffer;
-    }
-
-    if (_this->gl_config.stereo) {
-        attr[i++] = NSOpenGLPFAStereo;
-    }
-
-    if (_this->gl_config.stencil_size) {
-        attr[i++] = NSOpenGLPFAStencilSize;
-        attr[i++] = _this->gl_config.stencil_size;
-    }
-
-    if ((_this->gl_config.accum_red_size +
-         _this->gl_config.accum_green_size +
-         _this->gl_config.accum_blue_size +
-         _this->gl_config.accum_alpha_size) > 0) {
-        attr[i++] = NSOpenGLPFAAccumSize;
-        attr[i++] = _this->gl_config.accum_red_size + _this->gl_config.accum_green_size + _this->gl_config.accum_blue_size + _this->gl_config.accum_alpha_size;
-    }
-
-    if (_this->gl_config.multisamplebuffers) {
-        attr[i++] = NSOpenGLPFASampleBuffers;
-        attr[i++] = _this->gl_config.multisamplebuffers;
-    }
-
-    if (_this->gl_config.multisamplesamples) {
-        attr[i++] = NSOpenGLPFASamples;
-        attr[i++] = _this->gl_config.multisamplesamples;
-        attr[i++] = NSOpenGLPFANoRecovery;
-    }
-
-    if (_this->gl_config.accelerated >= 0) {
-        if (_this->gl_config.accelerated) {
-            attr[i++] = NSOpenGLPFAAccelerated;
-        } else {
-            attr[i++] = NSOpenGLPFARendererID;
-            attr[i++] = kCGLRendererGenericFloatID;
-        }
-    }
-
-    attr[i++] = NSOpenGLPFAScreenMask;
-    attr[i++] = CGDisplayIDToOpenGLDisplayMask(displaydata->display);
-    attr[i] = 0;
-
-    fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr];
-    if (fmt == nil) {
-        SDL_SetError ("Failed creating OpenGL pixel format");
-        [pool release];
-        return NULL;
-    }
-
-    if (_this->gl_config.share_with_current_context) {
-        share_context = (NSOpenGLContext*)SDL_GL_GetCurrentContext();
-    }
-
-    context = [[SDLOpenGLContext alloc] initWithFormat:fmt shareContext:share_context];
-
-    [fmt release];
-
-    if (context == nil) {
-        SDL_SetError ("Failed creating OpenGL context");
-        [pool release];
-        return NULL;
-    }
-
-    [pool release];
-
-    if ( Cocoa_GL_MakeCurrent(_this, window, context) < 0 ) {
-        Cocoa_GL_DeleteContext(_this, context);
-        return NULL;
-    }
-
-    return context;
-}
-
-int
-Cocoa_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
-{
-    NSAutoreleasePool *pool;
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    if (context) {
-        SDLOpenGLContext *nscontext = (SDLOpenGLContext *)context;
-        [nscontext setWindow:window];
-        [nscontext updateIfNeeded];
-        [nscontext makeCurrentContext];
-    } else {
-        [NSOpenGLContext clearCurrentContext];
-    }
-
-    [pool release];
-    return 0;
-}
-
-void
-Cocoa_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h)
-{
-    SDL_WindowData *windata = (SDL_WindowData *) window->driverdata;
-    NSView *contentView = [windata->nswindow contentView];
-    NSRect viewport = [contentView bounds];
-
-    /* This gives us the correct viewport for a Retina-enabled view, only
-     * supported on 10.7+. */
-    if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
-        viewport = [contentView convertRectToBacking:viewport];
-    }
-
-    if (w) {
-        *w = viewport.size.width;
-    }
-
-    if (h) {
-        *h = viewport.size.height;
-    }
-}
-
-int
-Cocoa_GL_SetSwapInterval(_THIS, int interval)
-{
-    NSAutoreleasePool *pool;
-    NSOpenGLContext *nscontext;
-    GLint value;
-    int status;
-
-    if (interval < 0) {  /* no extension for this on Mac OS X at the moment. */
-        return SDL_SetError("Late swap tearing currently unsupported");
-    }
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    nscontext = (NSOpenGLContext*)SDL_GL_GetCurrentContext();
-    if (nscontext != nil) {
-        value = interval;
-        [nscontext setValues:&value forParameter:NSOpenGLCPSwapInterval];
-        status = 0;
-    } else {
-        status = SDL_SetError("No current OpenGL context");
-    }
-
-    [pool release];
-    return status;
-}
-
-int
-Cocoa_GL_GetSwapInterval(_THIS)
-{
-    NSAutoreleasePool *pool;
-    NSOpenGLContext *nscontext;
-    GLint value;
-    int status = 0;
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    nscontext = (NSOpenGLContext*)SDL_GL_GetCurrentContext();
-    if (nscontext != nil) {
-        [nscontext getValues:&value forParameter:NSOpenGLCPSwapInterval];
-        status = (int)value;
-    }
-
-    [pool release];
-    return status;
-}
-
-void
-Cocoa_GL_SwapWindow(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool;
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    SDLOpenGLContext* nscontext = (SDLOpenGLContext*)SDL_GL_GetCurrentContext();
-    [nscontext flushBuffer];
-    [nscontext updateIfNeeded];
-
-    [pool release];
-}
-
-void
-Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context)
-{
-    NSAutoreleasePool *pool;
-    SDLOpenGLContext *nscontext = (SDLOpenGLContext *)context;
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    [nscontext setWindow:NULL];
-    [nscontext release];
-
-    [pool release];
-}
-
-#endif /* SDL_VIDEO_OPENGL_CGL */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoashape.h b/deps/SDL2/src/video/cocoa/SDL_cocoashape.h
deleted file mode 100644
index 3b656c1..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoashape.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoashape_h
-#define _SDL_cocoashape_h
-
-#include "SDL_stdinc.h"
-#include "SDL_video.h"
-#include "SDL_shape.h"
-#include "../SDL_shape_internals.h"
-
-typedef struct {
-    NSGraphicsContext* context;
-    SDL_bool saved;
-
-    SDL_ShapeTree* shape;
-} SDL_ShapeData;
-
-extern SDL_WindowShaper* Cocoa_CreateShaper(SDL_Window* window);
-extern int Cocoa_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
-extern int Cocoa_ResizeWindowShape(SDL_Window *window);
-
-#endif
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoashape.m b/deps/SDL2/src/video/cocoa/SDL_cocoashape.m
deleted file mode 100644
index ae8df8d..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoashape.m
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-#include "SDL_cocoavideo.h"
-#include "SDL_shape.h"
-#include "SDL_cocoashape.h"
-#include "../SDL_sysvideo.h"
-#include "SDL_assert.h"
-
-SDL_WindowShaper*
-Cocoa_CreateShaper(SDL_Window* window) {
-    SDL_WindowData* windata = (SDL_WindowData*)window->driverdata;
-    [windata->nswindow setOpaque:NO];
-
-    if ([windata->nswindow respondsToSelector:@selector(setStyleMask:)]) {
-        [windata->nswindow setStyleMask:NSBorderlessWindowMask];
-    }
-
-    SDL_WindowShaper* result = result = malloc(sizeof(SDL_WindowShaper));
-    result->window = window;
-    result->mode.mode = ShapeModeDefault;
-    result->mode.parameters.binarizationCutoff = 1;
-    result->userx = result->usery = 0;
-    window->shaper = result;
-
-    SDL_ShapeData* data = malloc(sizeof(SDL_ShapeData));
-    result->driverdata = data;
-    data->context = [windata->nswindow graphicsContext];
-    data->saved = SDL_FALSE;
-    data->shape = NULL;
-
-    int resized_properly = Cocoa_ResizeWindowShape(window);
-    SDL_assert(resized_properly == 0);
-    return result;
-}
-
-typedef struct {
-    NSView* view;
-    NSBezierPath* path;
-    SDL_Window* window;
-} SDL_CocoaClosure;
-
-void
-ConvertRects(SDL_ShapeTree* tree,void* closure) {
-    SDL_CocoaClosure* data = (SDL_CocoaClosure*)closure;
-    if(tree->kind == OpaqueShape) {
-        NSRect rect = NSMakeRect(tree->data.shape.x,data->window->h - tree->data.shape.y,tree->data.shape.w,tree->data.shape.h);
-        [data->path appendBezierPathWithRect:[data->view convertRect:rect toView:nil]];
-    }
-}
-
-int
-Cocoa_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) {
-    SDL_ShapeData* data = (SDL_ShapeData*)shaper->driverdata;
-    SDL_WindowData* windata = (SDL_WindowData*)shaper->window->driverdata;
-    SDL_CocoaClosure closure;
-    NSAutoreleasePool *pool = NULL;
-    if(data->saved == SDL_TRUE) {
-        [data->context restoreGraphicsState];
-        data->saved = SDL_FALSE;
-    }
-
-    /*[data->context saveGraphicsState];*/
-    /*data->saved = SDL_TRUE;*/
-    [NSGraphicsContext setCurrentContext:data->context];
-
-    [[NSColor clearColor] set];
-    NSRectFill([[windata->nswindow contentView] frame]);
-    data->shape = SDL_CalculateShapeTree(*shape_mode,shape);
-
-    pool = [[NSAutoreleasePool alloc] init];
-    closure.view = [windata->nswindow contentView];
-    closure.path = [[NSBezierPath bezierPath] autorelease];
-    closure.window = shaper->window;
-    SDL_TraverseShapeTree(data->shape,&ConvertRects,&closure);
-    [closure.path addClip];
-    [pool release];
-
-    return 0;
-}
-
-int
-Cocoa_ResizeWindowShape(SDL_Window *window) {
-    SDL_ShapeData* data = window->shaper->driverdata;
-    SDL_assert(data != NULL);
-    return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoavideo.h b/deps/SDL2/src/video/cocoa/SDL_cocoavideo.h
deleted file mode 100644
index 5f8be53..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoavideo.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoavideo_h
-#define _SDL_cocoavideo_h
-
-#include "SDL_opengl.h"
-
-#include <ApplicationServices/ApplicationServices.h>
-#include <Cocoa/Cocoa.h>
-
-#include "SDL_keycode.h"
-#include "../SDL_sysvideo.h"
-
-#include "SDL_cocoaclipboard.h"
-#include "SDL_cocoaevents.h"
-#include "SDL_cocoakeyboard.h"
-#include "SDL_cocoamodes.h"
-#include "SDL_cocoamouse.h"
-#include "SDL_cocoaopengl.h"
-#include "SDL_cocoawindow.h"
-
-/* Private display data */
-
- at class SDLTranslatorResponder;
-
-typedef struct SDL_VideoData
-{
-    SInt32 osversion;
-    unsigned int modifierFlags;
-    void *key_layout;
-    SDLTranslatorResponder *fieldEdit;
-    NSInteger clipboard_count;
-    Uint32 screensaver_activity;
-} SDL_VideoData;
-
-/* Utility functions */
-extern NSImage * Cocoa_CreateImage(SDL_Surface * surface);
-
-#endif /* _SDL_cocoavideo_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoavideo.m b/deps/SDL2/src/video/cocoa/SDL_cocoavideo.m
deleted file mode 100644
index d1b9587..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoavideo.m
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-#if defined(__APPLE__) && defined(__POWERPC__) && !defined(__APPLE_ALTIVEC__)
-#include <altivec.h>
-#undef bool
-#undef vector
-#undef pixel
-#endif
-
-#include "SDL.h"
-#include "SDL_endian.h"
-#include "SDL_cocoavideo.h"
-#include "SDL_cocoashape.h"
-#include "SDL_assert.h"
-
-/* Initialization/Query functions */
-static int Cocoa_VideoInit(_THIS);
-static void Cocoa_VideoQuit(_THIS);
-
-/* Cocoa driver bootstrap functions */
-
-static int
-Cocoa_Available(void)
-{
-    return (1);
-}
-
-static void
-Cocoa_DeleteDevice(SDL_VideoDevice * device)
-{
-    SDL_free(device->driverdata);
-    SDL_free(device);
-}
-
-static SDL_VideoDevice *
-Cocoa_CreateDevice(int devindex)
-{
-    SDL_VideoDevice *device;
-    SDL_VideoData *data;
-
-    Cocoa_RegisterApp();
-
-    /* Initialize all variables that we clean on shutdown */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-    if (device) {
-        data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
-    } else {
-        data = NULL;
-    }
-    if (!data) {
-        SDL_OutOfMemory();
-        SDL_free(device);
-        return NULL;
-    }
-    device->driverdata = data;
-
-    /* Find out what version of Mac OS X we're running */
-    Gestalt(gestaltSystemVersion, &data->osversion);
-
-    /* Set the function pointers */
-    device->VideoInit = Cocoa_VideoInit;
-    device->VideoQuit = Cocoa_VideoQuit;
-    device->GetDisplayBounds = Cocoa_GetDisplayBounds;
-    device->GetDisplayModes = Cocoa_GetDisplayModes;
-    device->SetDisplayMode = Cocoa_SetDisplayMode;
-    device->PumpEvents = Cocoa_PumpEvents;
-
-    device->CreateWindow = Cocoa_CreateWindow;
-    device->CreateWindowFrom = Cocoa_CreateWindowFrom;
-    device->SetWindowTitle = Cocoa_SetWindowTitle;
-    device->SetWindowIcon = Cocoa_SetWindowIcon;
-    device->SetWindowPosition = Cocoa_SetWindowPosition;
-    device->SetWindowSize = Cocoa_SetWindowSize;
-    device->SetWindowMinimumSize = Cocoa_SetWindowMinimumSize;
-    device->SetWindowMaximumSize = Cocoa_SetWindowMaximumSize;
-    device->ShowWindow = Cocoa_ShowWindow;
-    device->HideWindow = Cocoa_HideWindow;
-    device->RaiseWindow = Cocoa_RaiseWindow;
-    device->MaximizeWindow = Cocoa_MaximizeWindow;
-    device->MinimizeWindow = Cocoa_MinimizeWindow;
-    device->RestoreWindow = Cocoa_RestoreWindow;
-    device->SetWindowBordered = Cocoa_SetWindowBordered;
-    device->SetWindowFullscreen = Cocoa_SetWindowFullscreen;
-    device->SetWindowGammaRamp = Cocoa_SetWindowGammaRamp;
-    device->GetWindowGammaRamp = Cocoa_GetWindowGammaRamp;
-    device->SetWindowGrab = Cocoa_SetWindowGrab;
-    device->DestroyWindow = Cocoa_DestroyWindow;
-    device->GetWindowWMInfo = Cocoa_GetWindowWMInfo;
-
-    device->shape_driver.CreateShaper = Cocoa_CreateShaper;
-    device->shape_driver.SetWindowShape = Cocoa_SetWindowShape;
-    device->shape_driver.ResizeWindowShape = Cocoa_ResizeWindowShape;
-
-#if SDL_VIDEO_OPENGL_CGL
-    device->GL_LoadLibrary = Cocoa_GL_LoadLibrary;
-    device->GL_GetProcAddress = Cocoa_GL_GetProcAddress;
-    device->GL_UnloadLibrary = Cocoa_GL_UnloadLibrary;
-    device->GL_CreateContext = Cocoa_GL_CreateContext;
-    device->GL_MakeCurrent = Cocoa_GL_MakeCurrent;
-    device->GL_GetDrawableSize = Cocoa_GL_GetDrawableSize;
-    device->GL_SetSwapInterval = Cocoa_GL_SetSwapInterval;
-    device->GL_GetSwapInterval = Cocoa_GL_GetSwapInterval;
-    device->GL_SwapWindow = Cocoa_GL_SwapWindow;
-    device->GL_DeleteContext = Cocoa_GL_DeleteContext;
-#endif
-
-    device->StartTextInput = Cocoa_StartTextInput;
-    device->StopTextInput = Cocoa_StopTextInput;
-    device->SetTextInputRect = Cocoa_SetTextInputRect;
-
-    device->SetClipboardText = Cocoa_SetClipboardText;
-    device->GetClipboardText = Cocoa_GetClipboardText;
-    device->HasClipboardText = Cocoa_HasClipboardText;
-
-    device->free = Cocoa_DeleteDevice;
-
-    return device;
-}
-
-VideoBootStrap COCOA_bootstrap = {
-    "cocoa", "SDL Cocoa video driver",
-    Cocoa_Available, Cocoa_CreateDevice
-};
-
-
-int
-Cocoa_VideoInit(_THIS)
-{
-    Cocoa_InitModes(_this);
-    Cocoa_InitKeyboard(_this);
-    Cocoa_InitMouse(_this);
-    return 0;
-}
-
-void
-Cocoa_VideoQuit(_THIS)
-{
-    Cocoa_QuitModes(_this);
-    Cocoa_QuitKeyboard(_this);
-    Cocoa_QuitMouse(_this);
-}
-
-/* This function assumes that it's called from within an autorelease pool */
-NSImage *
-Cocoa_CreateImage(SDL_Surface * surface)
-{
-    SDL_Surface *converted;
-    NSBitmapImageRep *imgrep;
-    Uint8 *pixels;
-    int i;
-    NSImage *img;
-
-    converted = SDL_ConvertSurfaceFormat(surface,
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-                                         SDL_PIXELFORMAT_RGBA8888,
-#else
-                                         SDL_PIXELFORMAT_ABGR8888,
-#endif
-                                         0);
-    if (!converted) {
-        return nil;
-    }
-
-    imgrep = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL
-                    pixelsWide: converted->w
-                    pixelsHigh: converted->h
-                    bitsPerSample: 8
-                    samplesPerPixel: 4
-                    hasAlpha: YES
-                    isPlanar: NO
-                    colorSpaceName: NSDeviceRGBColorSpace
-                    bytesPerRow: converted->pitch
-                    bitsPerPixel: converted->format->BitsPerPixel] autorelease];
-    if (imgrep == nil) {
-        SDL_FreeSurface(converted);
-        return nil;
-    }
-
-    /* Copy the pixels */
-    pixels = [imgrep bitmapData];
-    SDL_memcpy(pixels, converted->pixels, converted->h * converted->pitch);
-    SDL_FreeSurface(converted);
-
-    /* Premultiply the alpha channel */
-    for (i = (surface->h * surface->w); i--; ) {
-        Uint8 alpha = pixels[3];
-        pixels[0] = (Uint8)(((Uint16)pixels[0] * alpha) / 255);
-        pixels[1] = (Uint8)(((Uint16)pixels[1] * alpha) / 255);
-        pixels[2] = (Uint8)(((Uint16)pixels[2] * alpha) / 255);
-        pixels += 4;
-    }
-
-    img = [[[NSImage alloc] initWithSize: NSMakeSize(surface->w, surface->h)] autorelease];
-    if (img != nil) {
-        [img addRepresentation: imgrep];
-    }
-    return img;
-}
-
-/*
- * Mac OS X log support.
- *
- * This doesn't really have aything to do with the interfaces of the SDL video
- *  subsystem, but we need to stuff this into an Objective-C source code file.
- */
-
-void SDL_NSLog(const char *text)
-{
-    NSLog(@"%s", text);
-}
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vim: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoawindow.h b/deps/SDL2/src/video/cocoa/SDL_cocoawindow.h
deleted file mode 100644
index c08c55c..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoawindow.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cocoawindow_h
-#define _SDL_cocoawindow_h
-
-#import <Cocoa/Cocoa.h>
-
-typedef struct SDL_WindowData SDL_WindowData;
-
- at interface Cocoa_WindowListener : NSResponder <NSWindowDelegate> {
-    SDL_WindowData *_data;
-    BOOL observingVisible;
-    BOOL wasCtrlLeft;
-    BOOL wasVisible;
-}
-
--(void) listen:(SDL_WindowData *) data;
--(void) pauseVisibleObservation;
--(void) resumeVisibleObservation;
--(void) close;
-
-/* Window delegate functionality */
--(BOOL) windowShouldClose:(id) sender;
--(void) windowDidExpose:(NSNotification *) aNotification;
--(void) windowDidMove:(NSNotification *) aNotification;
--(void) windowDidResize:(NSNotification *) aNotification;
--(void) windowDidMiniaturize:(NSNotification *) aNotification;
--(void) windowDidDeminiaturize:(NSNotification *) aNotification;
--(void) windowDidBecomeKey:(NSNotification *) aNotification;
--(void) windowDidResignKey:(NSNotification *) aNotification;
-
-/* Window event handling */
--(void) mouseDown:(NSEvent *) theEvent;
--(void) rightMouseDown:(NSEvent *) theEvent;
--(void) otherMouseDown:(NSEvent *) theEvent;
--(void) mouseUp:(NSEvent *) theEvent;
--(void) rightMouseUp:(NSEvent *) theEvent;
--(void) otherMouseUp:(NSEvent *) theEvent;
--(void) mouseMoved:(NSEvent *) theEvent;
--(void) mouseDragged:(NSEvent *) theEvent;
--(void) rightMouseDragged:(NSEvent *) theEvent;
--(void) otherMouseDragged:(NSEvent *) theEvent;
--(void) scrollWheel:(NSEvent *) theEvent;
--(void) touchesBeganWithEvent:(NSEvent *) theEvent;
--(void) touchesMovedWithEvent:(NSEvent *) theEvent;
--(void) touchesEndedWithEvent:(NSEvent *) theEvent;
--(void) touchesCancelledWithEvent:(NSEvent *) theEvent;
-
-/* Touch event handling */
-typedef enum {
-    COCOA_TOUCH_DOWN,
-    COCOA_TOUCH_UP,
-    COCOA_TOUCH_MOVE,
-    COCOA_TOUCH_CANCELLED
-} cocoaTouchType;
--(void) handleTouches:(cocoaTouchType)type withEvent:(NSEvent*) event;
-
- at end
-/* *INDENT-ON* */
-
- at class SDLOpenGLContext;
-
-struct SDL_WindowData
-{
-    SDL_Window *window;
-    NSWindow *nswindow;
-    NSMutableArray *nscontexts;
-    SDL_bool created;
-    Cocoa_WindowListener *listener;
-    struct SDL_VideoData *videodata;
-};
-
-extern int Cocoa_CreateWindow(_THIS, SDL_Window * window);
-extern int Cocoa_CreateWindowFrom(_THIS, SDL_Window * window,
-                                  const void *data);
-extern void Cocoa_SetWindowTitle(_THIS, SDL_Window * window);
-extern void Cocoa_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
-extern void Cocoa_SetWindowPosition(_THIS, SDL_Window * window);
-extern void Cocoa_SetWindowSize(_THIS, SDL_Window * window);
-extern void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window * window);
-extern void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window * window);
-extern void Cocoa_ShowWindow(_THIS, SDL_Window * window);
-extern void Cocoa_HideWindow(_THIS, SDL_Window * window);
-extern void Cocoa_RaiseWindow(_THIS, SDL_Window * window);
-extern void Cocoa_MaximizeWindow(_THIS, SDL_Window * window);
-extern void Cocoa_MinimizeWindow(_THIS, SDL_Window * window);
-extern void Cocoa_RestoreWindow(_THIS, SDL_Window * window);
-extern void Cocoa_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
-extern void Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
-extern int Cocoa_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
-extern int Cocoa_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp);
-extern void Cocoa_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
-extern void Cocoa_DestroyWindow(_THIS, SDL_Window * window);
-extern SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window,
-                                      struct SDL_SysWMinfo *info);
-
-#endif /* _SDL_cocoawindow_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/cocoa/SDL_cocoawindow.m b/deps/SDL2/src/video/cocoa/SDL_cocoawindow.m
deleted file mode 100644
index 5529983..0000000
--- a/deps/SDL2/src/video/cocoa/SDL_cocoawindow.m
+++ /dev/null
@@ -1,1207 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_COCOA
-
-#include "SDL_syswm.h"
-#include "SDL_timer.h"  /* For SDL_GetTicks() */
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/SDL_touch_c.h"
-#include "../../events/SDL_windowevents_c.h"
-#include "SDL_cocoavideo.h"
-#include "SDL_cocoashape.h"
-#include "SDL_cocoamouse.h"
-#include "SDL_cocoaopengl.h"
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
-/* Taken from AppKit/NSOpenGLView.h in 10.8 SDK. */
- at interface NSView (NSOpenGLSurfaceResolution)
-- (BOOL)wantsBestResolutionOpenGLSurface;
-- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
- at end
-#endif
-
-static Uint32 s_moveHack;
-
-static void ConvertNSRect(NSRect *r)
-{
-    r->origin.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - r->origin.y - r->size.height;
-}
-
-static void ScheduleContextUpdates(SDL_WindowData *data)
-{
-    NSMutableArray *contexts = data->nscontexts;
-    @synchronized (contexts) {
-        for (SDLOpenGLContext *context in contexts) {
-            [context scheduleUpdate];
-        }
-    }
-}
-
- at implementation Cocoa_WindowListener
-
-- (void)listen:(SDL_WindowData *)data
-{
-    NSNotificationCenter *center;
-    NSWindow *window = data->nswindow;
-    NSView *view = [window contentView];
-
-    _data = data;
-    observingVisible = YES;
-    wasCtrlLeft = NO;
-    wasVisible = [window isVisible];
-
-    center = [NSNotificationCenter defaultCenter];
-
-    if ([window delegate] != nil) {
-        [center addObserver:self selector:@selector(windowDidExpose:) name:NSWindowDidExposeNotification object:window];
-        [center addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:window];
-        [center addObserver:self selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:window];
-        [center addObserver:self selector:@selector(windowDidMiniaturize:) name:NSWindowDidMiniaturizeNotification object:window];
-        [center addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window];
-        [center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window];
-        [center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window];
-    } else {
-        [window setDelegate:self];
-    }
-
-    /* Haven't found a delegate / notification that triggers when the window is
-     * ordered out (is not visible any more). You can be ordered out without
-     * minimizing, so DidMiniaturize doesn't work. (e.g. -[NSWindow orderOut:])
-     */
-    [window addObserver:self
-             forKeyPath:@"visible"
-                options:NSKeyValueObservingOptionNew
-                context:NULL];
-
-    [window setNextResponder:self];
-    [window setAcceptsMouseMovedEvents:YES];
-
-    [view setNextResponder:self];
-
-    if ([view respondsToSelector:@selector(setAcceptsTouchEvents:)]) {
-        [view setAcceptsTouchEvents:YES];
-    }
-}
-
-- (void)observeValueForKeyPath:(NSString *)keyPath
-                      ofObject:(id)object
-                        change:(NSDictionary *)change
-                       context:(void *)context
-{
-    if (!observingVisible) {
-        return;
-    }
-
-    if (object == _data->nswindow && [keyPath isEqualToString:@"visible"]) {
-        int newVisibility = [[change objectForKey:@"new"] intValue];
-        if (newVisibility) {
-            SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
-        } else {
-            SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
-        }
-    }
-}
-
--(void) pauseVisibleObservation
-{
-    observingVisible = NO;
-    wasVisible = [_data->nswindow isVisible];
-}
-
--(void) resumeVisibleObservation
-{
-    BOOL isVisible = [_data->nswindow isVisible];
-    observingVisible = YES;
-    if (wasVisible != isVisible) {
-        if (isVisible) {
-            SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
-        } else {
-            SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
-        }
-
-        wasVisible = isVisible;
-    }
-}
-
-- (void)close
-{
-    NSNotificationCenter *center;
-    NSWindow *window = _data->nswindow;
-    NSView *view = [window contentView];
-    NSArray *windows = nil;
-
-    center = [NSNotificationCenter defaultCenter];
-
-    if ([window delegate] != self) {
-        [center removeObserver:self name:NSWindowDidExposeNotification object:window];
-        [center removeObserver:self name:NSWindowDidMoveNotification object:window];
-        [center removeObserver:self name:NSWindowDidResizeNotification object:window];
-        [center removeObserver:self name:NSWindowDidMiniaturizeNotification object:window];
-        [center removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window];
-        [center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window];
-        [center removeObserver:self name:NSWindowDidResignKeyNotification object:window];
-    } else {
-        [window setDelegate:nil];
-    }
-
-    [window removeObserver:self
-                forKeyPath:@"visible"];
-
-    if ([window nextResponder] == self) {
-        [window setNextResponder:nil];
-    }
-    if ([view nextResponder] == self) {
-        [view setNextResponder:nil];
-    }
-
-    /* Make the next window in the z-order Key. If we weren't the foreground
-       when closed, this is a no-op.
-       !!! FIXME: Note that this is a hack, and there are corner cases where
-       !!! FIXME:  this fails (such as the About box). The typical nib+RunLoop
-       !!! FIXME:  handles this for Cocoa apps, but we bypass all that in SDL.
-       !!! FIXME:  We should remove this code when we find a better way to
-       !!! FIXME:  have the system do this for us. See discussion in
-       !!! FIXME:   http://bugzilla.libsdl.org/show_bug.cgi?id=1825
-    */
-    windows = [NSApp orderedWindows];
-    if ([windows count] > 0) {
-        NSWindow *win = (NSWindow *) [windows objectAtIndex:0];
-        [win makeKeyAndOrderFront:self];
-    }
-}
-
-- (BOOL)windowShouldClose:(id)sender
-{
-    SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_CLOSE, 0, 0);
-    return NO;
-}
-
-- (void)windowDidExpose:(NSNotification *)aNotification
-{
-    SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_EXPOSED, 0, 0);
-}
-
-- (void)windowDidMove:(NSNotification *)aNotification
-{
-    int x, y;
-    SDL_Window *window = _data->window;
-    NSWindow *nswindow = _data->nswindow;
-    NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
-    ConvertNSRect(&rect);
-
-    if (s_moveHack) {
-        SDL_bool blockMove = ((SDL_GetTicks() - s_moveHack) < 500);
-
-        s_moveHack = 0;
-
-        if (blockMove) {
-            /* Cocoa is adjusting the window in response to a mode change */
-            rect.origin.x = window->x;
-            rect.origin.y = window->y;
-            ConvertNSRect(&rect);
-            [nswindow setFrameOrigin:rect.origin];
-            return;
-        }
-    }
-
-    x = (int)rect.origin.x;
-    y = (int)rect.origin.y;
-
-    ScheduleContextUpdates(_data);
-
-    SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);
-}
-
-- (void)windowDidResize:(NSNotification *)aNotification
-{
-    int x, y, w, h;
-    NSRect rect = [_data->nswindow contentRectForFrameRect:[_data->nswindow frame]];
-    ConvertNSRect(&rect);
-    x = (int)rect.origin.x;
-    y = (int)rect.origin.y;
-    w = (int)rect.size.width;
-    h = (int)rect.size.height;
-    if (SDL_IsShapedWindow(_data->window))
-        Cocoa_ResizeWindowShape(_data->window);
-
-    ScheduleContextUpdates(_data);
-
-    /* The window can move during a resize event, such as when maximizing
-       or resizing from a corner */
-    SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MOVED, x, y);
-    SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESIZED, w, h);
-
-    const BOOL zoomed = [_data->nswindow isZoomed];
-    if (!zoomed) {
-        SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESTORED, 0, 0);
-    } else if (zoomed) {
-        SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
-    }
-}
-
-- (void)windowDidMiniaturize:(NSNotification *)aNotification
-{
-    SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
-}
-
-- (void)windowDidDeminiaturize:(NSNotification *)aNotification
-{
-    SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESTORED, 0, 0);
-}
-
-- (void)windowDidBecomeKey:(NSNotification *)aNotification
-{
-    SDL_Window *window = _data->window;
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    /* We're going to get keyboard events, since we're key. */
-    SDL_SetKeyboardFocus(window);
-
-    /* If we just gained focus we need the updated mouse position */
-    if (!mouse->relative_mode) {
-        NSPoint point;
-        int x, y;
-
-        point = [_data->nswindow mouseLocationOutsideOfEventStream];
-        x = (int)point.x;
-        y = (int)(window->h - point.y);
-
-        if (x >= 0 && x < window->w && y >= 0 && y < window->h) {
-            SDL_SendMouseMotion(window, 0, 0, x, y);
-        }
-    }
-
-    /* Check to see if someone updated the clipboard */
-    Cocoa_CheckClipboardUpdate(_data->videodata);
-}
-
-- (void)windowDidResignKey:(NSNotification *)aNotification
-{
-    /* Some other window will get mouse events, since we're not key. */
-    if (SDL_GetMouseFocus() == _data->window) {
-        SDL_SetMouseFocus(NULL);
-    }
-
-    /* Some other window will get keyboard events, since we're not key. */
-    if (SDL_GetKeyboardFocus() == _data->window) {
-        SDL_SetKeyboardFocus(NULL);
-    }
-}
-
-/* We'll respond to key events by doing nothing so we don't beep.
- * We could handle key messages here, but we lose some in the NSApp dispatch,
- * where they get converted to action messages, etc.
- */
-- (void)flagsChanged:(NSEvent *)theEvent
-{
-    /*Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent);*/
-}
-- (void)keyDown:(NSEvent *)theEvent
-{
-    /*Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent);*/
-}
-- (void)keyUp:(NSEvent *)theEvent
-{
-    /*Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent);*/
-}
-
-/* We'll respond to selectors by doing nothing so we don't beep.
- * The escape key gets converted to a "cancel" selector, etc.
- */
-- (void)doCommandBySelector:(SEL)aSelector
-{
-    /*NSLog(@"doCommandBySelector: %@\n", NSStringFromSelector(aSelector));*/
-}
-
-- (void)mouseDown:(NSEvent *)theEvent
-{
-    int button;
-
-    switch ([theEvent buttonNumber]) {
-    case 0:
-        if ([theEvent modifierFlags] & NSControlKeyMask) {
-            wasCtrlLeft = YES;
-            button = SDL_BUTTON_RIGHT;
-        } else {
-            wasCtrlLeft = NO;
-            button = SDL_BUTTON_LEFT;
-        }
-        break;
-    case 1:
-        button = SDL_BUTTON_RIGHT;
-        break;
-    case 2:
-        button = SDL_BUTTON_MIDDLE;
-        break;
-    default:
-        button = [theEvent buttonNumber] + 1;
-        break;
-    }
-    SDL_SendMouseButton(_data->window, 0, SDL_PRESSED, button);
-}
-
-- (void)rightMouseDown:(NSEvent *)theEvent
-{
-    [self mouseDown:theEvent];
-}
-
-- (void)otherMouseDown:(NSEvent *)theEvent
-{
-    [self mouseDown:theEvent];
-}
-
-- (void)mouseUp:(NSEvent *)theEvent
-{
-    int button;
-
-    switch ([theEvent buttonNumber]) {
-    case 0:
-        if (wasCtrlLeft) {
-            button = SDL_BUTTON_RIGHT;
-            wasCtrlLeft = NO;
-        } else {
-            button = SDL_BUTTON_LEFT;
-        }
-        break;
-    case 1:
-        button = SDL_BUTTON_RIGHT;
-        break;
-    case 2:
-        button = SDL_BUTTON_MIDDLE;
-        break;
-    default:
-        button = [theEvent buttonNumber] + 1;
-        break;
-    }
-    SDL_SendMouseButton(_data->window, 0, SDL_RELEASED, button);
-}
-
-- (void)rightMouseUp:(NSEvent *)theEvent
-{
-    [self mouseUp:theEvent];
-}
-
-- (void)otherMouseUp:(NSEvent *)theEvent
-{
-    [self mouseUp:theEvent];
-}
-
-- (void)mouseMoved:(NSEvent *)theEvent
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    SDL_Window *window = _data->window;
-    NSPoint point;
-    int x, y;
-
-    if (mouse->relative_mode) {
-        return;
-    }
-
-    point = [theEvent locationInWindow];
-    x = (int)point.x;
-    y = (int)(window->h - point.y);
-
-    if (x < 0 || x >= window->w || y < 0 || y >= window->h) {
-        if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
-            CGPoint cgpoint;
-
-            if (x < 0) {
-                x = 0;
-            } else if (x >= window->w) {
-                x = window->w - 1;
-            }
-            if (y < 0) {
-                y = 0;
-            } else if (y >= window->h) {
-                y = window->h - 1;
-            }
-
-#if !SDL_MAC_NO_SANDBOX
-            /* When SDL_MAC_NO_SANDBOX is set, this is handled by
-             * SDL_cocoamousetap.m.
-             */
-
-            cgpoint.x = window->x + x;
-            cgpoint.y = window->y + y;
-
-            /* According to the docs, this was deprecated in 10.6, but it's still
-             * around. The substitute requires a CGEventSource, but I'm not entirely
-             * sure how we'd procure the right one for this event.
-             */
-            CGSetLocalEventsSuppressionInterval(0.0);
-            CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
-            CGSetLocalEventsSuppressionInterval(0.25);
-#endif
-        }
-    }
-    SDL_SendMouseMotion(window, 0, 0, x, y);
-}
-
-- (void)mouseDragged:(NSEvent *)theEvent
-{
-    [self mouseMoved:theEvent];
-}
-
-- (void)rightMouseDragged:(NSEvent *)theEvent
-{
-    [self mouseMoved:theEvent];
-}
-
-- (void)otherMouseDragged:(NSEvent *)theEvent
-{
-    [self mouseMoved:theEvent];
-}
-
-- (void)scrollWheel:(NSEvent *)theEvent
-{
-    Cocoa_HandleMouseWheel(_data->window, theEvent);
-}
-
-- (void)touchesBeganWithEvent:(NSEvent *) theEvent
-{
-    [self handleTouches:COCOA_TOUCH_DOWN withEvent:theEvent];
-}
-
-- (void)touchesMovedWithEvent:(NSEvent *) theEvent
-{
-    [self handleTouches:COCOA_TOUCH_MOVE withEvent:theEvent];
-}
-
-- (void)touchesEndedWithEvent:(NSEvent *) theEvent
-{
-    [self handleTouches:COCOA_TOUCH_UP withEvent:theEvent];
-}
-
-- (void)touchesCancelledWithEvent:(NSEvent *) theEvent
-{
-    [self handleTouches:COCOA_TOUCH_CANCELLED withEvent:theEvent];
-}
-
-- (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event
-{
-    NSSet *touches = 0;
-    NSEnumerator *enumerator;
-    NSTouch *touch;
-
-    switch (type) {
-        case COCOA_TOUCH_DOWN:
-            touches = [event touchesMatchingPhase:NSTouchPhaseBegan inView:nil];
-            break;
-        case COCOA_TOUCH_UP:
-        case COCOA_TOUCH_CANCELLED:
-            touches = [event touchesMatchingPhase:NSTouchPhaseEnded inView:nil];
-            break;
-        case COCOA_TOUCH_MOVE:
-            touches = [event touchesMatchingPhase:NSTouchPhaseMoved inView:nil];
-            break;
-    }
-
-    enumerator = [touches objectEnumerator];
-    touch = (NSTouch*)[enumerator nextObject];
-    while (touch) {
-        const SDL_TouchID touchId = (SDL_TouchID)(intptr_t)[touch device];
-        if (!SDL_GetTouch(touchId)) {
-            if (SDL_AddTouch(touchId, "") < 0) {
-                return;
-            }
-        }
-
-        const SDL_FingerID fingerId = (SDL_FingerID)(intptr_t)[touch identity];
-        float x = [touch normalizedPosition].x;
-        float y = [touch normalizedPosition].y;
-        /* Make the origin the upper left instead of the lower left */
-        y = 1.0f - y;
-
-        switch (type) {
-        case COCOA_TOUCH_DOWN:
-            SDL_SendTouch(touchId, fingerId, SDL_TRUE, x, y, 1.0f);
-            break;
-        case COCOA_TOUCH_UP:
-        case COCOA_TOUCH_CANCELLED:
-            SDL_SendTouch(touchId, fingerId, SDL_FALSE, x, y, 1.0f);
-            break;
-        case COCOA_TOUCH_MOVE:
-            SDL_SendTouchMotion(touchId, fingerId, x, y, 1.0f);
-            break;
-        }
-
-        touch = (NSTouch*)[enumerator nextObject];
-    }
-}
-
- at end
-
- at interface SDLWindow : NSWindow
-/* These are needed for borderless/fullscreen windows */
-- (BOOL)canBecomeKeyWindow;
-- (BOOL)canBecomeMainWindow;
- at end
-
- at implementation SDLWindow
-- (BOOL)canBecomeKeyWindow
-{
-    return YES;
-}
-
-- (BOOL)canBecomeMainWindow
-{
-    return YES;
-}
- at end
-
- at interface SDLView : NSView
-
-/* The default implementation doesn't pass rightMouseDown to responder chain */
-- (void)rightMouseDown:(NSEvent *)theEvent;
- at end
-
- at implementation SDLView
-- (void)rightMouseDown:(NSEvent *)theEvent
-{
-    [[self nextResponder] rightMouseDown:theEvent];
-}
-
-- (void)resetCursorRects
-{
-    [super resetCursorRects];
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    if (mouse->cursor_shown && mouse->cur_cursor && !mouse->relative_mode) {
-        [self addCursorRect:[self bounds]
-                     cursor:mouse->cur_cursor->driverdata];
-    } else {
-        [self addCursorRect:[self bounds]
-                     cursor:[NSCursor invisibleCursor]];
-    }
-}
- at end
-
-static unsigned int
-GetWindowStyle(SDL_Window * window)
-{
-    unsigned int style;
-
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        style = NSBorderlessWindowMask;
-    } else {
-        if (window->flags & SDL_WINDOW_BORDERLESS) {
-            style = NSBorderlessWindowMask;
-        } else {
-            style = (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask);
-        }
-        if (window->flags & SDL_WINDOW_RESIZABLE) {
-            style |= NSResizableWindowMask;
-        }
-    }
-    return style;
-}
-
-static int
-SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created)
-{
-    NSAutoreleasePool *pool;
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-    SDL_WindowData *data;
-
-    /* Allocate the window data */
-    data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        return SDL_OutOfMemory();
-    }
-    data->window = window;
-    data->nswindow = nswindow;
-    data->created = created;
-    data->videodata = videodata;
-    data->nscontexts = [[NSMutableArray alloc] init];
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    /* Create an event listener for the window */
-    data->listener = [[Cocoa_WindowListener alloc] init];
-
-    /* Fill in the SDL window with the window data */
-    {
-        NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
-        ConvertNSRect(&rect);
-        window->x = (int)rect.origin.x;
-        window->y = (int)rect.origin.y;
-        window->w = (int)rect.size.width;
-        window->h = (int)rect.size.height;
-    }
-
-    /* Set up the listener after we create the view */
-    [data->listener listen:data];
-
-    if ([nswindow isVisible]) {
-        window->flags |= SDL_WINDOW_SHOWN;
-    } else {
-        window->flags &= ~SDL_WINDOW_SHOWN;
-    }
-
-    {
-        unsigned int style = [nswindow styleMask];
-
-        if (style == NSBorderlessWindowMask) {
-            window->flags |= SDL_WINDOW_BORDERLESS;
-        } else {
-            window->flags &= ~SDL_WINDOW_BORDERLESS;
-        }
-        if (style & NSResizableWindowMask) {
-            window->flags |= SDL_WINDOW_RESIZABLE;
-        } else {
-            window->flags &= ~SDL_WINDOW_RESIZABLE;
-        }
-    }
-
-    /* isZoomed always returns true if the window is not resizable */
-    if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed]) {
-        window->flags |= SDL_WINDOW_MAXIMIZED;
-    } else {
-        window->flags &= ~SDL_WINDOW_MAXIMIZED;
-    }
-
-    if ([nswindow isMiniaturized]) {
-        window->flags |= SDL_WINDOW_MINIMIZED;
-    } else {
-        window->flags &= ~SDL_WINDOW_MINIMIZED;
-    }
-
-    if ([nswindow isKeyWindow]) {
-        window->flags |= SDL_WINDOW_INPUT_FOCUS;
-        SDL_SetKeyboardFocus(data->window);
-    }
-
-    /* Prevents the window's "window device" from being destroyed when it is
-     * hidden. See http://www.mikeash.com/pyblog/nsopenglcontext-and-one-shot.html
-     */
-    [nswindow setOneShot:NO];
-
-    /* All done! */
-    [pool release];
-    window->driverdata = data;
-    return 0;
-}
-
-int
-Cocoa_CreateWindow(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSWindow *nswindow;
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    NSRect rect;
-    SDL_Rect bounds;
-    unsigned int style;
-
-    Cocoa_GetDisplayBounds(_this, display, &bounds);
-    rect.origin.x = window->x;
-    rect.origin.y = window->y;
-    rect.size.width = window->w;
-    rect.size.height = window->h;
-    ConvertNSRect(&rect);
-
-    style = GetWindowStyle(window);
-
-    /* Figure out which screen to place this window */
-    NSArray *screens = [NSScreen screens];
-    NSScreen *screen = nil;
-    NSScreen *candidate;
-    int i, count = [screens count];
-    for (i = 0; i < count; ++i) {
-        candidate = [screens objectAtIndex:i];
-        NSRect screenRect = [candidate frame];
-        if (rect.origin.x >= screenRect.origin.x &&
-            rect.origin.x < screenRect.origin.x + screenRect.size.width &&
-            rect.origin.y >= screenRect.origin.y &&
-            rect.origin.y < screenRect.origin.y + screenRect.size.height) {
-            screen = candidate;
-            rect.origin.x -= screenRect.origin.x;
-            rect.origin.y -= screenRect.origin.y;
-        }
-    }
-    nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO screen:screen];
-    [nswindow setBackgroundColor:[NSColor blackColor]];
-
-    /* Create a default view for this window */
-    rect = [nswindow contentRectForFrameRect:[nswindow frame]];
-    NSView *contentView = [[SDLView alloc] initWithFrame:rect];
-
-    if ((window->flags & SDL_WINDOW_ALLOW_HIGHDPI) > 0) {
-        if ([contentView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
-            [contentView setWantsBestResolutionOpenGLSurface:YES];
-        }
-    }
-
-    [nswindow setContentView: contentView];
-    [contentView release];
-
-    [pool release];
-
-    if (SetupWindowData(_this, window, nswindow, SDL_TRUE) < 0) {
-        [nswindow release];
-        return -1;
-    }
-    return 0;
-}
-
-int
-Cocoa_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
-{
-    NSAutoreleasePool *pool;
-    NSWindow *nswindow = (NSWindow *) data;
-    NSString *title;
-
-    pool = [[NSAutoreleasePool alloc] init];
-
-    /* Query the title from the existing window */
-    title = [nswindow title];
-    if (title) {
-        window->title = SDL_strdup([title UTF8String]);
-    }
-
-    [pool release];
-
-    return SetupWindowData(_this, window, nswindow, SDL_FALSE);
-}
-
-void
-Cocoa_SetWindowTitle(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
-    NSString *string;
-
-    if(window->title) {
-        string = [[NSString alloc] initWithUTF8String:window->title];
-    } else {
-        string = [[NSString alloc] init];
-    }
-    [nswindow setTitle:string];
-    [string release];
-
-    [pool release];
-}
-
-void
-Cocoa_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSImage *nsimage = Cocoa_CreateImage(icon);
-
-    if (nsimage) {
-        [NSApp setApplicationIconImage:nsimage];
-    }
-
-    [pool release];
-}
-
-void
-Cocoa_SetWindowPosition(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    SDL_WindowData *windata = (SDL_WindowData *) window->driverdata;
-    NSWindow *nswindow = windata->nswindow;
-    NSRect rect;
-    Uint32 moveHack;
-
-    rect.origin.x = window->x;
-    rect.origin.y = window->y;
-    rect.size.width = window->w;
-    rect.size.height = window->h;
-    ConvertNSRect(&rect);
-
-    moveHack = s_moveHack;
-    s_moveHack = 0;
-    [nswindow setFrameOrigin:rect.origin];
-    s_moveHack = moveHack;
-
-    ScheduleContextUpdates(windata);
-
-    [pool release];
-}
-
-void
-Cocoa_SetWindowSize(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    SDL_WindowData *windata = (SDL_WindowData *) window->driverdata;
-    NSWindow *nswindow = windata->nswindow;
-    NSSize size;
-
-    size.width = window->w;
-    size.height = window->h;
-    [nswindow setContentSize:size];
-
-    ScheduleContextUpdates(windata);
-
-    [pool release];
-}
-
-void
-Cocoa_SetWindowMinimumSize(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    SDL_WindowData *windata = (SDL_WindowData *) window->driverdata;
-
-    NSSize minSize;
-    minSize.width = window->min_w;
-    minSize.height = window->min_h;
-
-    [windata->nswindow setContentMinSize:minSize];
-
-    [pool release];
-}
-
-void
-Cocoa_SetWindowMaximumSize(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    SDL_WindowData *windata = (SDL_WindowData *) window->driverdata;
-
-    NSSize maxSize;
-    maxSize.width = window->max_w;
-    maxSize.height = window->max_h;
-
-    [windata->nswindow setContentMaxSize:maxSize];
-
-    [pool release];
-}
-
-void
-Cocoa_ShowWindow(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    SDL_WindowData *windowData = ((SDL_WindowData *) window->driverdata);
-    NSWindow *nswindow = windowData->nswindow;
-
-    if (![nswindow isMiniaturized]) {
-        [windowData->listener pauseVisibleObservation];
-        [nswindow makeKeyAndOrderFront:nil];
-        [windowData->listener resumeVisibleObservation];
-    }
-    [pool release];
-}
-
-void
-Cocoa_HideWindow(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
-
-    [nswindow orderOut:nil];
-    [pool release];
-}
-
-void
-Cocoa_RaiseWindow(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    SDL_WindowData *windowData = ((SDL_WindowData *) window->driverdata);
-    NSWindow *nswindow = windowData->nswindow;
-
-    /* makeKeyAndOrderFront: has the side-effect of deminiaturizing and showing
-       a minimized or hidden window, so check for that before showing it.
-     */
-    [windowData->listener pauseVisibleObservation];
-    if (![nswindow isMiniaturized] && [nswindow isVisible]) {
-        [nswindow makeKeyAndOrderFront:nil];
-    }
-    [windowData->listener resumeVisibleObservation];
-
-    [pool release];
-}
-
-void
-Cocoa_MaximizeWindow(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    SDL_WindowData *windata = (SDL_WindowData *) window->driverdata;
-    NSWindow *nswindow = windata->nswindow;
-
-    [nswindow zoom:nil];
-
-    ScheduleContextUpdates(windata);
-
-    [pool release];
-}
-
-void
-Cocoa_MinimizeWindow(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
-
-    [nswindow miniaturize:nil];
-    [pool release];
-}
-
-void
-Cocoa_RestoreWindow(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
-
-    if ([nswindow isMiniaturized]) {
-        [nswindow deminiaturize:nil];
-    } else if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed]) {
-        [nswindow zoom:nil];
-    }
-    [pool release];
-}
-
-static NSWindow *
-Cocoa_RebuildWindow(SDL_WindowData * data, NSWindow * nswindow, unsigned style)
-{
-    if (!data->created) {
-        /* Don't mess with other people's windows... */
-        return nswindow;
-    }
-
-    [data->listener close];
-    data->nswindow = [[SDLWindow alloc] initWithContentRect:[[nswindow contentView] frame] styleMask:style backing:NSBackingStoreBuffered defer:NO screen:[nswindow screen]];
-    [data->nswindow setContentView:[nswindow contentView]];
-    /* See comment in SetupWindowData. */
-    [data->nswindow setOneShot:NO];
-    [data->listener listen:data];
-
-    [nswindow close];
-
-    return data->nswindow;
-}
-
-void
-Cocoa_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
-    if ([nswindow respondsToSelector:@selector(setStyleMask:)]) {
-        [nswindow setStyleMask:GetWindowStyle(window)];
-        if (bordered) {
-            Cocoa_SetWindowTitle(_this, window);  /* this got blanked out. */
-        }
-    }
-    [pool release];
-}
-
-void
-Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    NSWindow *nswindow = data->nswindow;
-    NSRect rect;
-
-    /* The view responder chain gets messed with during setStyleMask */
-    if ([[nswindow contentView] nextResponder] == data->listener) {
-        [[nswindow contentView] setNextResponder:nil];
-    }
-
-    if (fullscreen) {
-        SDL_Rect bounds;
-
-        Cocoa_GetDisplayBounds(_this, display, &bounds);
-        rect.origin.x = bounds.x;
-        rect.origin.y = bounds.y;
-        rect.size.width = bounds.w;
-        rect.size.height = bounds.h;
-        ConvertNSRect(&rect);
-
-        /* Hack to fix origin on Mac OS X 10.4 */
-        NSRect screenRect = [[nswindow screen] frame];
-        if (screenRect.size.height >= 1.0f) {
-            rect.origin.y += (screenRect.size.height - rect.size.height);
-        }
-
-        if ([nswindow respondsToSelector: @selector(setStyleMask:)]) {
-            [nswindow performSelector: @selector(setStyleMask:) withObject: (id)NSBorderlessWindowMask];
-        } else {
-            nswindow = Cocoa_RebuildWindow(data, nswindow, NSBorderlessWindowMask);
-        }
-    } else {
-        rect.origin.x = window->windowed.x;
-        rect.origin.y = window->windowed.y;
-        rect.size.width = window->windowed.w;
-        rect.size.height = window->windowed.h;
-        ConvertNSRect(&rect);
-
-        if ([nswindow respondsToSelector: @selector(setStyleMask:)]) {
-            [nswindow performSelector: @selector(setStyleMask:) withObject: (id)(uintptr_t)GetWindowStyle(window)];
-        } else {
-            nswindow = Cocoa_RebuildWindow(data, nswindow, GetWindowStyle(window));
-        }
-    }
-
-    /* The view responder chain gets messed with during setStyleMask */
-    if ([[nswindow contentView] nextResponder] != data->listener) {
-        [[nswindow contentView] setNextResponder:data->listener];
-    }
-
-    s_moveHack = 0;
-    [nswindow setContentSize:rect.size];
-    [nswindow setFrameOrigin:rect.origin];
-    s_moveHack = SDL_GetTicks();
-
-    /* When the window style changes the title is cleared */
-    if (!fullscreen) {
-        Cocoa_SetWindowTitle(_this, window);
-    }
-
-    if (SDL_ShouldAllowTopmost() && fullscreen) {
-        /* OpenGL is rendering to the window, so make it visible! */
-        [nswindow setLevel:CGShieldingWindowLevel()];
-    } else {
-        [nswindow setLevel:kCGNormalWindowLevel];
-    }
-
-    if ([nswindow isVisible] || fullscreen) {
-        [data->listener pauseVisibleObservation];
-        [nswindow makeKeyAndOrderFront:nil];
-        [data->listener resumeVisibleObservation];
-    }
-
-    ScheduleContextUpdates(data);
-
-    [pool release];
-}
-
-int
-Cocoa_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
-{
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    CGDirectDisplayID display_id = ((SDL_DisplayData *)display->driverdata)->display;
-    const uint32_t tableSize = 256;
-    CGGammaValue redTable[tableSize];
-    CGGammaValue greenTable[tableSize];
-    CGGammaValue blueTable[tableSize];
-    uint32_t i;
-    float inv65535 = 1.0f / 65535.0f;
-
-    /* Extract gamma values into separate tables, convert to floats between 0.0 and 1.0 */
-    for (i = 0; i < 256; i++) {
-        redTable[i] = ramp[0*256+i] * inv65535;
-        greenTable[i] = ramp[1*256+i] * inv65535;
-        blueTable[i] = ramp[2*256+i] * inv65535;
-    }
-
-    if (CGSetDisplayTransferByTable(display_id, tableSize,
-                                    redTable, greenTable, blueTable) != CGDisplayNoErr) {
-        return SDL_SetError("CGSetDisplayTransferByTable()");
-    }
-    return 0;
-}
-
-int
-Cocoa_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp)
-{
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    CGDirectDisplayID display_id = ((SDL_DisplayData *)display->driverdata)->display;
-    const uint32_t tableSize = 256;
-    CGGammaValue redTable[tableSize];
-    CGGammaValue greenTable[tableSize];
-    CGGammaValue blueTable[tableSize];
-    uint32_t i, tableCopied;
-
-    if (CGGetDisplayTransferByTable(display_id, tableSize,
-                                    redTable, greenTable, blueTable, &tableCopied) != CGDisplayNoErr) {
-        return SDL_SetError("CGGetDisplayTransferByTable()");
-    }
-
-    for (i = 0; i < tableCopied; i++) {
-        ramp[0*256+i] = (Uint16)(redTable[i] * 65535.0f);
-        ramp[1*256+i] = (Uint16)(greenTable[i] * 65535.0f);
-        ramp[2*256+i] = (Uint16)(blueTable[i] * 65535.0f);
-    }
-    return 0;
-}
-
-void
-Cocoa_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
-{
-    /* Move the cursor to the nearest point in the window */
-    if (grabbed) {
-        int x, y;
-        CGPoint cgpoint;
-
-        SDL_GetMouseState(&x, &y);
-        cgpoint.x = window->x + x;
-        cgpoint.y = window->y + y;
-        CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
-    }
-
-    if ( window->flags & SDL_WINDOW_FULLSCREEN ) {
-        SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-
-        if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
-            /* OpenGL is rendering to the window, so make it visible! */
-            [data->nswindow setLevel:CGShieldingWindowLevel()];
-        } else {
-            [data->nswindow setLevel:kCGNormalWindowLevel];
-        }
-    }
-}
-
-void
-Cocoa_DestroyWindow(_THIS, SDL_Window * window)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-
-    if (data) {
-        [data->listener close];
-        [data->listener release];
-        if (data->created) {
-            [data->nswindow close];
-        }
-
-        NSArray *contexts = [[data->nscontexts copy] autorelease];
-        for (SDLOpenGLContext *context in contexts) {
-            /* Calling setWindow:NULL causes the context to remove itself from the context list. */            
-            [context setWindow:NULL];
-        }
-        [data->nscontexts release];
-
-        SDL_free(data);
-    }
-    [pool release];
-}
-
-SDL_bool
-Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
-{
-    NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
-
-    if (info->version.major <= SDL_MAJOR_VERSION) {
-        info->subsystem = SDL_SYSWM_COCOA;
-        info->info.cocoa.window = nswindow;
-        return SDL_TRUE;
-    } else {
-        SDL_SetError("Application not compiled with SDL %d.%d\n",
-                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
-        return SDL_FALSE;
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_COCOA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_WM.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_WM.c
deleted file mode 100644
index 83912bd..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_WM.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_window.h"
-
-#include "../../events/SDL_windowevents_c.h"
-
-#define COLOR_EXPAND(col) col.r, col.g, col.b, col.a
-
-static DFB_Theme theme_std = {
-    4, 4, 8, 8,
-    {255, 200, 200, 200},
-    24,
-    {255, 0, 0, 255},
-    16,
-    {255, 255, 255, 255},
-    "/usr/share/fonts/truetype/freefont/FreeSans.ttf",
-    {255, 255, 0, 0},
-    {255, 255, 255, 0},
-};
-
-static DFB_Theme theme_none = {
-    0, 0, 0, 0,
-    {0, 0, 0, 0},
-    0,
-    {0, 0, 0, 0},
-    0,
-    {0, 0, 0, 0},
-    NULL
-};
-
-static void
-DrawTriangle(IDirectFBSurface * s, int down, int x, int y, int w)
-{
-    int x1, x2, x3;
-    int y1, y2, y3;
-
-    if (down) {
-        x1 = x + w / 2;
-        x2 = x;
-        x3 = x + w;
-        y1 = y + w;
-        y2 = y;
-        y3 = y;
-    } else {
-        x1 = x + w / 2;
-        x2 = x;
-        x3 = x + w;
-        y1 = y;
-        y2 = y + w;
-        y3 = y + w;
-    }
-    s->FillTriangle(s, x1, y1, x2, y2, x3, y3);
-}
-
-static void
-LoadFont(_THIS, SDL_Window * window)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    SDL_DFB_WINDOWDATA(window);
-
-    if (windata->font != NULL) {
-        SDL_DFB_RELEASE(windata->font);
-        windata->font = NULL;
-        SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font));
-    }
-
-    if (windata->theme.font != NULL)
-    {
-        DFBFontDescription fdesc;
-
-        SDL_zero(fdesc);
-        fdesc.flags = DFDESC_HEIGHT;
-        fdesc.height = windata->theme.font_size;
-        SDL_DFB_CHECK(devdata->
-                      dfb->CreateFont(devdata->dfb, windata->theme.font,
-                                      &fdesc, &windata->font));
-        SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font));
-    }
-}
-
-static void
-DrawCraption(_THIS, IDirectFBSurface * s, int x, int y, char *text)
-{
-    DFBSurfaceTextFlags flags;
-
-    flags = DSTF_CENTER | DSTF_TOP;
-
-    s->DrawString(s, text, -1, x, y, flags);
-}
-
-void
-DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-    IDirectFBSurface *s = windata->window_surface;
-    DFB_Theme *t = &windata->theme;
-    int i;
-    int d = (t->caption_size - t->font_size) / 2;
-    int x, y, w;
-
-
-    if (!windata->is_managed || (window->flags & SDL_WINDOW_FULLSCREEN))
-        return;
-
-    SDL_DFB_CHECK(s->SetSrcBlendFunction(s, DSBF_ONE));
-    SDL_DFB_CHECK(s->SetDstBlendFunction(s, DSBF_ZERO));
-    SDL_DFB_CHECK(s->SetDrawingFlags(s, DSDRAW_NOFX));
-    SDL_DFB_CHECK(s->SetBlittingFlags(s, DSBLIT_NOFX));
-
-    LoadFont(_this, window);
-    /* s->SetDrawingFlags(s, DSDRAW_BLEND); */
-    s->SetColor(s, COLOR_EXPAND(t->frame_color));
-    /* top */
-    for (i = 0; i < t->top_size; i++)
-        s->DrawLine(s, 0, i, windata->size.w, i);
-    /* bottom */
-    for (i = windata->size.h - t->bottom_size; i < windata->size.h; i++)
-        s->DrawLine(s, 0, i, windata->size.w, i);
-    /* left */
-    for (i = 0; i < t->left_size; i++)
-        s->DrawLine(s, i, 0, i, windata->size.h);
-    /* right */
-    for (i = windata->size.w - t->right_size; i < windata->size.w; i++)
-        s->DrawLine(s, i, 0, i, windata->size.h);
-    /* Caption */
-    s->SetColor(s, COLOR_EXPAND(t->caption_color));
-    s->FillRectangle(s, t->left_size, t->top_size, windata->client.w,
-                     t->caption_size);
-    /* Close Button */
-    w = t->caption_size;
-    x = windata->size.w - t->right_size - w + d;
-    y = t->top_size + d;
-    s->SetColor(s, COLOR_EXPAND(t->close_color));
-    DrawTriangle(s, 1, x, y, w - 2 * d);
-    /* Max Button */
-    s->SetColor(s, COLOR_EXPAND(t->max_color));
-    DrawTriangle(s, window->flags & SDL_WINDOW_MAXIMIZED ? 1 : 0, x - w,
-               y, w - 2 * d);
-
-    /* Caption */
-    if (window->title) {
-        s->SetColor(s, COLOR_EXPAND(t->font_color));
-        DrawCraption(_this, s, (x - w) / 2, t->top_size + d, window->title);
-    }
-    /* Icon */
-    if (windata->icon) {
-        DFBRectangle dr;
-
-        dr.x = t->left_size + d;
-        dr.y = t->top_size + d;
-        dr.w = w - 2 * d;
-        dr.h = w - 2 * d;
-        s->SetBlittingFlags(s, DSBLIT_BLEND_ALPHACHANNEL);
-
-        s->StretchBlit(s, windata->icon, NULL, &dr);
-    }
-    windata->wm_needs_redraw = 0;
-}
-
-DFBResult
-DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch)
-{
-    SDL_DFB_WINDOWDATA(window);
-    IDirectFBWindow *dfbwin = windata->dfbwin;
-
-    SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, cw, ch));
-    dfbwin->GetSize(dfbwin, cw, ch);
-    *cw -= windata->theme.left_size + windata->theme.right_size;
-    *ch -=
-        windata->theme.top_size + windata->theme.caption_size +
-        windata->theme.bottom_size;
-    return DFB_OK;
-}
-
-void
-DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h)
-{
-    SDL_DFB_WINDOWDATA(window);
-
-    if (!windata->is_managed)
-        windata->theme = theme_none;
-    else if (flags & SDL_WINDOW_BORDERLESS)
-        /* desc.caps |= DWCAPS_NODECORATION;) */
-        windata->theme = theme_none;
-    else if (flags & SDL_WINDOW_FULLSCREEN) {
-        windata->theme = theme_none;
-    } else if (flags & SDL_WINDOW_MAXIMIZED) {
-        windata->theme = theme_std;
-        windata->theme.left_size = 0;
-        windata->theme.right_size = 0;
-        windata->theme.top_size = 0;
-        windata->theme.bottom_size = 0;
-    } else {
-        windata->theme = theme_std;
-    }
-
-    windata->client.x = windata->theme.left_size;
-    windata->client.y = windata->theme.top_size + windata->theme.caption_size;
-    windata->client.w = w;
-    windata->client.h = h;
-    windata->size.w =
-        w + windata->theme.left_size + windata->theme.right_size;
-    windata->size.h =
-        h + windata->theme.top_size +
-        windata->theme.caption_size + windata->theme.bottom_size;
-}
-
-
-enum
-{
-    WM_POS_NONE = 0x00,
-    WM_POS_CAPTION = 0x01,
-    WM_POS_CLOSE = 0x02,
-    WM_POS_MAX = 0x04,
-    WM_POS_LEFT = 0x08,
-    WM_POS_RIGHT = 0x10,
-    WM_POS_TOP = 0x20,
-    WM_POS_BOTTOM = 0x40,
-};
-
-static int
-WMIsClient(DFB_WindowData * p, int x, int y)
-{
-    x -= p->client.x;
-    y -= p->client.y;
-    if (x < 0 || y < 0)
-        return 0;
-    if (x >= p->client.w || y >= p->client.h)
-        return 0;
-    return 1;
-}
-
-static int
-WMPos(DFB_WindowData * p, int x, int y)
-{
-    int pos = WM_POS_NONE;
-
-    if (!WMIsClient(p, x, y)) {
-        if (y < p->theme.top_size) {
-            pos |= WM_POS_TOP;
-        } else if (y < p->client.y) {
-            if (x <
-                p->size.w - p->theme.right_size - 2 * p->theme.caption_size) {
-                pos |= WM_POS_CAPTION;
-            } else if (x <
-                       p->size.w - p->theme.right_size -
-                       p->theme.caption_size) {
-                pos |= WM_POS_MAX;
-            } else {
-                pos |= WM_POS_CLOSE;
-            }
-        } else if (y >= p->size.h - p->theme.bottom_size) {
-            pos |= WM_POS_BOTTOM;
-        }
-        if (x < p->theme.left_size) {
-            pos |= WM_POS_LEFT;
-        } else if (x >= p->size.w - p->theme.right_size) {
-            pos |= WM_POS_RIGHT;
-        }
-    }
-    return pos;
-}
-
-int
-DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    SDL_DFB_WINDOWDATA(window);
-    DFB_WindowData *gwindata = ((devdata->grabbed_window) ? (DFB_WindowData *) ((devdata->grabbed_window)->driverdata) : NULL);
-    IDirectFBWindow *dfbwin = windata->dfbwin;
-    DFBWindowOptions wopts;
-
-    if (!windata->is_managed)
-        return 0;
-
-    SDL_DFB_CHECK(dfbwin->GetOptions(dfbwin, &wopts));
-
-    switch (evt->type) {
-    case DWET_BUTTONDOWN:
-        if (evt->buttons & DIBM_LEFT) {
-            int pos = WMPos(windata, evt->x, evt->y);
-            switch (pos) {
-            case WM_POS_NONE:
-                return 0;
-            case WM_POS_CLOSE:
-                windata->wm_grab = WM_POS_NONE;
-                SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0,
-                                    0);
-                return 1;
-            case WM_POS_MAX:
-                windata->wm_grab = WM_POS_NONE;
-                if (window->flags & SDL_WINDOW_MAXIMIZED) {
-                    SDL_RestoreWindow(window);
-                } else {
-                    SDL_MaximizeWindow(window);
-                }
-                return 1;
-            case WM_POS_CAPTION:
-                if (!(wopts & DWOP_KEEP_STACKING)) {
-                    DirectFB_RaiseWindow(_this, window);
-                }
-                if (window->flags & SDL_WINDOW_MAXIMIZED)
-                    return 1;
-                /* fall through */
-            default:
-                windata->wm_grab = pos;
-                if (gwindata != NULL)
-                    SDL_DFB_CHECK(gwindata->dfbwin->UngrabPointer(gwindata->dfbwin));
-                SDL_DFB_CHECK(dfbwin->GrabPointer(dfbwin));
-                windata->wm_lastx = evt->cx;
-                windata->wm_lasty = evt->cy;
-            }
-        }
-        return 1;
-    case DWET_BUTTONUP:
-        if (!windata->wm_grab)
-            return 0;
-        if (!(evt->buttons & DIBM_LEFT)) {
-            if (windata->wm_grab & (WM_POS_RIGHT | WM_POS_BOTTOM)) {
-                int dx = evt->cx - windata->wm_lastx;
-                int dy = evt->cy - windata->wm_lasty;
-
-                if (!(wopts & DWOP_KEEP_SIZE)) {
-                    int cw, ch;
-                    if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM)
-                        dx = 0;
-                    else if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT)
-                        dy = 0;
-                    SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, &cw, &ch));
-
-                    /* necessary to trigger an event - ugly */
-                    SDL_DFB_CHECK(dfbwin->DisableEvents(dfbwin, DWET_ALL));
-                    SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx + 1, ch + dy));
-                    SDL_DFB_CHECK(dfbwin->EnableEvents(dfbwin, DWET_ALL));
-
-                    SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx, ch + dy));
-                }
-            }
-            SDL_DFB_CHECK(dfbwin->UngrabPointer(dfbwin));
-            if (gwindata != NULL)
-                SDL_DFB_CHECK(gwindata->dfbwin->GrabPointer(gwindata->dfbwin));
-            windata->wm_grab = WM_POS_NONE;
-            return 1;
-        }
-        break;
-    case DWET_MOTION:
-        if (!windata->wm_grab)
-            return 0;
-        if (evt->buttons & DIBM_LEFT) {
-            int dx = evt->cx - windata->wm_lastx;
-            int dy = evt->cy - windata->wm_lasty;
-
-            if (windata->wm_grab & WM_POS_CAPTION) {
-                if (!(wopts & DWOP_KEEP_POSITION))
-                    SDL_DFB_CHECK(dfbwin->Move(dfbwin, dx, dy));
-            }
-            if (windata->wm_grab & (WM_POS_RIGHT | WM_POS_BOTTOM)) {
-                if (!(wopts & DWOP_KEEP_SIZE)) {
-                    int cw, ch;
-
-                    /* Make sure all events are disabled for this operation ! */
-                    SDL_DFB_CHECK(dfbwin->DisableEvents(dfbwin, DWET_ALL));
-
-                    if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM)
-                        dx = 0;
-                    else if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT)
-                        dy = 0;
-
-                    SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, &cw, &ch));
-                    SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx, ch + dy));
-
-                    SDL_DFB_CHECK(dfbwin->EnableEvents(dfbwin, DWET_ALL));
-                }
-            }
-            windata->wm_lastx = evt->cx;
-            windata->wm_lasty = evt->cy;
-            return 1;
-        }
-        break;
-    case DWET_KEYDOWN:
-        break;
-    case DWET_KEYUP:
-        break;
-    default:
-        ;
-    }
-    return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_WM.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_WM.h
deleted file mode 100644
index 4c5d539..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_WM.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_directfb_wm_h
-#define _SDL_directfb_wm_h
-
-#include "SDL_DirectFB_video.h"
-
-typedef struct _DFB_Theme DFB_Theme;
-struct _DFB_Theme
-{
-    int left_size;
-    int right_size;
-    int top_size;
-    int bottom_size;
-    DFBColor frame_color;
-    int caption_size;
-    DFBColor caption_color;
-    int font_size;
-    DFBColor font_color;
-    char *font;
-    DFBColor close_color;
-    DFBColor max_color;
-};
-
-extern void DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h);
-extern void DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window);
-
-extern int DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window,
-                                    DFBWindowEvent * evt);
-
-extern DFBResult DirectFB_WM_GetClientSize(_THIS, SDL_Window * window,
-                                           int *cw, int *ch);
-
-
-#endif /* _SDL_directfb_wm_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_dyn.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_dyn.c
deleted file mode 100644
index cbbfa17..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_dyn.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_dyn.h"
-
-#ifdef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-
-#define DFB_SYM(ret, name, args, al, func) ret (*name) args;
-static struct _SDL_DirectFB_Symbols
-{
-    DFB_SYMS
-    const unsigned int *directfb_major_version;
-    const unsigned int *directfb_minor_version;
-    const unsigned int *directfb_micro_version;
-} SDL_DirectFB_Symbols;
-#undef DFB_SYM
-
-#define DFB_SYM(ret, name, args, al, func) ret name args { func SDL_DirectFB_Symbols.name al  ; }
-DFB_SYMS
-#undef DFB_SYM
-
-static void *handle = NULL;
-
-int
-SDL_DirectFB_LoadLibrary(void)
-{
-    int retval = 0;
-
-    if (handle == NULL) {
-        handle = SDL_LoadObject(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC);
-        if (handle != NULL) {
-            retval = 1;
-#define DFB_SYM(ret, name, args, al, func) if (!(SDL_DirectFB_Symbols.name = SDL_LoadFunction(handle, # name))) retval = 0;
-            DFB_SYMS
-#undef DFB_SYM
-            if (!
-                    (SDL_DirectFB_Symbols.directfb_major_version =
-                     SDL_LoadFunction(handle, "directfb_major_version")))
-                retval = 0;
-            if (!
-                (SDL_DirectFB_Symbols.directfb_minor_version =
-                 SDL_LoadFunction(handle, "directfb_minor_version")))
-                retval = 0;
-            if (!
-                (SDL_DirectFB_Symbols.directfb_micro_version =
-                 SDL_LoadFunction(handle, "directfb_micro_version")))
-                retval = 0;
-        }
-    }
-    if (retval) {
-        const char *stemp = DirectFBCheckVersion(DIRECTFB_MAJOR_VERSION,
-                                                 DIRECTFB_MINOR_VERSION,
-                                                 DIRECTFB_MICRO_VERSION);
-        /* Version Check */
-        if (stemp != NULL) {
-            fprintf(stderr,
-                    "DirectFB Lib: Version mismatch. Compiled: %d.%d.%d Library %d.%d.%d\n",
-                    DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION,
-                    DIRECTFB_MICRO_VERSION,
-                    *SDL_DirectFB_Symbols.directfb_major_version,
-                    *SDL_DirectFB_Symbols.directfb_minor_version,
-                    *SDL_DirectFB_Symbols.directfb_micro_version);
-            retval = 0;
-        }
-    }
-    if (!retval)
-        SDL_DirectFB_UnLoadLibrary();
-    return retval;
-}
-
-void
-SDL_DirectFB_UnLoadLibrary(void)
-{
-    if (handle != NULL) {
-        SDL_UnloadObject(handle);
-        handle = NULL;
-    }
-}
-
-#else
-int
-SDL_DirectFB_LoadLibrary(void)
-{
-    return 1;
-}
-
-void
-SDL_DirectFB_UnLoadLibrary(void)
-{
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_dyn.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_dyn.h
deleted file mode 100644
index 52658b0..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_dyn.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_DirectFB_dyn_h
-#define _SDL_DirectFB_dyn_h
-
-#define DFB_SYMS \
-    DFB_SYM(DFBResult, DirectFBError, (const char *msg, DFBResult result), (msg, result), return) \
-    DFB_SYM(DFBResult, DirectFBErrorFatal, (const char *msg, DFBResult result), (msg, result), return) \
-    DFB_SYM(const char *, DirectFBErrorString, (DFBResult result), (result), return) \
-    DFB_SYM(const char *, DirectFBUsageString, ( void ), (), return) \
-    DFB_SYM(DFBResult, DirectFBInit, (int *argc, char *(*argv[]) ), (argc, argv), return) \
-    DFB_SYM(DFBResult, DirectFBSetOption, (const char *name, const char *value), (name, value), return) \
-    DFB_SYM(DFBResult, DirectFBCreate, (IDirectFB **interface), (interface), return) \
-    DFB_SYM(const char *, DirectFBCheckVersion, (unsigned int required_major, unsigned int required_minor, unsigned int required_micro), \
-                (required_major, required_minor, required_micro), return)
-
-int SDL_DirectFB_LoadLibrary(void);
-void SDL_DirectFB_UnLoadLibrary(void);
-
-#endif
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_events.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_events.c
deleted file mode 100644
index cb669bc..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_events.c
+++ /dev/null
@@ -1,751 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-
-/* Handle the event stream, converting DirectFB input events into SDL events */
-
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_window.h"
-#include "SDL_DirectFB_modes.h"
-
-#include "SDL_syswm.h"
-
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/SDL_windowevents_c.h"
-#include "../../events/SDL_events_c.h"
-#include "../../events/scancodes_linux.h"
-#include "../../events/scancodes_xfree86.h"
-
-#include "SDL_DirectFB_events.h"
-
-#if USE_MULTI_API
-#define SDL_SendMouseMotion_ex(w, id, relative, x, y, p) SDL_SendMouseMotion(w, id, relative, x, y, p)
-#define SDL_SendMouseButton_ex(w, id, state, button) SDL_SendMouseButton(w, id, state, button)
-#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(id, state, scancode)
-#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(id, text)
-#else
-#define SDL_SendMouseMotion_ex(w, id, relative, x, y, p) SDL_SendMouseMotion(w, id, relative, x, y)
-#define SDL_SendMouseButton_ex(w, id, state, button) SDL_SendMouseButton(w, id, state, button)
-#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(state, scancode)
-#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(text)
-#endif
-
-typedef struct _cb_data cb_data;
-struct _cb_data
-{
-    DFB_DeviceData *devdata;
-    int sys_ids;
-    int sys_kbd;
-};
-
-/* The translation tables from a DirectFB keycode to a SDL keysym */
-static SDL_Scancode oskeymap[256];
-
-
-static SDL_Keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt,
-                                         SDL_Keysym * keysym, Uint32 *unicode);
-static SDL_Keysym *DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt,
-                                                   SDL_Keysym * keysym, Uint32 *unicode);
-
-static void DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keypmap, int numkeys);
-static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button);
-
-static void UnicodeToUtf8( Uint16 w , char *utf8buf)
-{
-        unsigned char *utf8s = (unsigned char *) utf8buf;
-
-    if ( w < 0x0080 ) {
-        utf8s[0] = ( unsigned char ) w;
-        utf8s[1] = 0;
-    }
-    else if ( w < 0x0800 ) {
-        utf8s[0] = 0xc0 | (( w ) >> 6 );
-        utf8s[1] = 0x80 | (( w ) & 0x3f );
-        utf8s[2] = 0;
-    }
-    else {
-        utf8s[0] = 0xe0 | (( w ) >> 12 );
-        utf8s[1] = 0x80 | (( ( w ) >> 6 ) & 0x3f );
-        utf8s[2] = 0x80 | (( w ) & 0x3f );
-        utf8s[3] = 0;
-    }
-}
-
-static void
-FocusAllMice(_THIS, SDL_Window *window)
-{
-#if USE_MULTI_API
-    SDL_DFB_DEVICEDATA(_this);
-    int index;
-
-    for (index = 0; index < devdata->num_mice; index++)
-        SDL_SetMouseFocus(devdata->mouse_id[index], id);
-#else
-    SDL_SetMouseFocus(window);
-#endif
-}
-
-
-static void
-FocusAllKeyboards(_THIS, SDL_Window *window)
-{
-#if USE_MULTI_API
-    SDL_DFB_DEVICEDATA(_this);
-    int index;
-
-    for (index = 0; index < devdata->num_keyboard; index++)
-        SDL_SetKeyboardFocus(index, id);
-#else
-    SDL_SetKeyboardFocus(window);
-#endif
-}
-
-static void
-MotionAllMice(_THIS, int x, int y)
-{
-#if USE_MULTI_API
-    SDL_DFB_DEVICEDATA(_this);
-    int index;
-
-    for (index = 0; index < devdata->num_mice; index++) {
-        SDL_Mouse *mouse = SDL_GetMouse(index);
-        mouse->x = mouse->last_x = x;
-        mouse->y = mouse->last_y = y;
-        /* SDL_SendMouseMotion(devdata->mouse_id[index], 0, x, y, 0); */
-    }
-#endif
-}
-
-static int
-KbdIndex(_THIS, int id)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    int index;
-
-    for (index = 0; index < devdata->num_keyboard; index++) {
-        if (devdata->keyboard[index].id == id)
-            return index;
-    }
-    return -1;
-}
-
-static int
-ClientXY(DFB_WindowData * p, int *x, int *y)
-{
-    int cx, cy;
-
-    cx = *x;
-    cy = *y;
-
-    cx -= p->client.x;
-    cy -= p->client.y;
-
-    if (cx < 0 || cy < 0)
-        return 0;
-    if (cx >= p->client.w || cy >= p->client.h)
-        return 0;
-    *x = cx;
-    *y = cy;
-    return 1;
-}
-
-static void
-ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    SDL_DFB_WINDOWDATA(sdlwin);
-    SDL_Keysym keysym;
-    Uint32 unicode;
-    char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
-
-    if (evt->clazz == DFEC_WINDOW) {
-        switch (evt->type) {
-        case DWET_BUTTONDOWN:
-            if (ClientXY(windata, &evt->x, &evt->y)) {
-                if (!devdata->use_linux_input) {
-                    SDL_SendMouseMotion_ex(sdlwin, devdata->mouse_id[0], 0, evt->x,
-                                        evt->y, 0);
-                    SDL_SendMouseButton_ex(sdlwin, devdata->mouse_id[0],
-                                        SDL_PRESSED,
-                                        DirectFB_TranslateButton
-                                        (evt->button));
-                } else {
-                    MotionAllMice(_this, evt->x, evt->y);
-                }
-            }
-            break;
-        case DWET_BUTTONUP:
-            if (ClientXY(windata, &evt->x, &evt->y)) {
-                if (!devdata->use_linux_input) {
-                    SDL_SendMouseMotion_ex(sdlwin, devdata->mouse_id[0], 0, evt->x,
-                                        evt->y, 0);
-                    SDL_SendMouseButton_ex(sdlwin, devdata->mouse_id[0],
-                                        SDL_RELEASED,
-                                        DirectFB_TranslateButton
-                                        (evt->button));
-                } else {
-                    MotionAllMice(_this, evt->x, evt->y);
-                }
-            }
-            break;
-        case DWET_MOTION:
-            if (ClientXY(windata, &evt->x, &evt->y)) {
-                if (!devdata->use_linux_input) {
-                    if (!(sdlwin->flags & SDL_WINDOW_INPUT_GRABBED))
-                        SDL_SendMouseMotion_ex(sdlwin, devdata->mouse_id[0], 0,
-                                            evt->x, evt->y, 0);
-                } else {
-                    /* relative movements are not exact!
-                     * This code should limit the number of events sent.
-                     * However it kills MAME axis recognition ... */
-                    static int cnt = 0;
-                    if (1 && ++cnt > 20) {
-                        MotionAllMice(_this, evt->x, evt->y);
-                        cnt = 0;
-                    }
-                }
-                if (!(sdlwin->flags & SDL_WINDOW_MOUSE_FOCUS))
-                    SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_ENTER, 0,
-                                        0);
-            }
-            break;
-        case DWET_KEYDOWN:
-            if (!devdata->use_linux_input) {
-                DirectFB_TranslateKey(_this, evt, &keysym, &unicode);
-                /* printf("Scancode %d  %d %d\n", keysym.scancode, evt->key_code, evt->key_id); */
-                SDL_SendKeyboardKey_ex(0, SDL_PRESSED, keysym.scancode);
-                if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
-                    SDL_zero(text);
-                    UnicodeToUtf8(unicode, text);
-                    if (*text) {
-                        SDL_SendKeyboardText_ex(0, text);
-                    }
-                }
-            }
-            break;
-        case DWET_KEYUP:
-            if (!devdata->use_linux_input) {
-                DirectFB_TranslateKey(_this, evt, &keysym, &unicode);
-                SDL_SendKeyboardKey_ex(0, SDL_RELEASED, keysym.scancode);
-            }
-            break;
-        case DWET_POSITION:
-            if (ClientXY(windata, &evt->x, &evt->y)) {
-                SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_MOVED,
-                                    evt->x, evt->y);
-            }
-            break;
-        case DWET_POSITION_SIZE:
-            if (ClientXY(windata, &evt->x, &evt->y)) {
-                SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_MOVED,
-                                    evt->x, evt->y);
-            }
-            /* fall throught */
-        case DWET_SIZE:
-            /* FIXME: what about < 0 */
-            evt->w -= (windata->theme.right_size + windata->theme.left_size);
-            evt->h -=
-                (windata->theme.top_size + windata->theme.bottom_size +
-                 windata->theme.caption_size);
-            SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_RESIZED,
-                                evt->w, evt->h);
-            break;
-        case DWET_CLOSE:
-            SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_CLOSE, 0, 0);
-            break;
-        case DWET_GOTFOCUS:
-            DirectFB_SetContext(_this, sdlwin);
-            FocusAllKeyboards(_this, sdlwin);
-            SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_FOCUS_GAINED,
-                                0, 0);
-            break;
-        case DWET_LOSTFOCUS:
-            SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
-            FocusAllKeyboards(_this, 0);
-            break;
-        case DWET_ENTER:
-            /* SDL_DirectFB_ReshowCursor(_this, 0); */
-            FocusAllMice(_this, sdlwin);
-            /* FIXME: when do we really enter ? */
-            if (ClientXY(windata, &evt->x, &evt->y))
-                MotionAllMice(_this, evt->x, evt->y);
-            SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_ENTER, 0, 0);
-            break;
-        case DWET_LEAVE:
-            SDL_SendWindowEvent(sdlwin, SDL_WINDOWEVENT_LEAVE, 0, 0);
-            FocusAllMice(_this, 0);
-            /* SDL_DirectFB_ReshowCursor(_this, 1); */
-            break;
-        default:
-            ;
-        }
-    } else
-        printf("Event Clazz %d\n", evt->clazz);
-}
-
-static void
-ProcessInputEvent(_THIS, DFBInputEvent * ievt)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    SDL_Keysym keysym;
-    int kbd_idx;
-    Uint32 unicode;
-    char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
-
-    if (!devdata->use_linux_input) {
-        if (ievt->type == DIET_AXISMOTION) {
-            if ((devdata->grabbed_window != NULL) && (ievt->flags & DIEF_AXISREL)) {
-                if (ievt->axis == DIAI_X)
-                    SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1,
-                                        ievt->axisrel, 0, 0);
-                else if (ievt->axis == DIAI_Y)
-                    SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1, 0,
-                                        ievt->axisrel, 0);
-            }
-        }
-    } else {
-        static int last_x, last_y;
-
-        switch (ievt->type) {
-        case DIET_AXISMOTION:
-            if (ievt->flags & DIEF_AXISABS) {
-                if (ievt->axis == DIAI_X)
-                    last_x = ievt->axisabs;
-                else if (ievt->axis == DIAI_Y)
-                    last_y = ievt->axisabs;
-                if (!(ievt->flags & DIEF_FOLLOW)) {
-#if USE_MULTI_API
-                    SDL_Mouse *mouse = SDL_GetMouse(ievt->device_id);
-                    SDL_Window *window = SDL_GetWindowFromID(mouse->focus);
-#else
-                    SDL_Window *window = devdata->grabbed_window;
-#endif
-                    if (window) {
-                        DFB_WindowData *windata =
-                            (DFB_WindowData *) window->driverdata;
-                        int x, y;
-
-                        windata->dfbwin->GetPosition(windata->dfbwin, &x, &y);
-                        SDL_SendMouseMotion_ex(window, ievt->device_id, 0,
-                                            last_x - (x +
-                                                      windata->client.x),
-                                            last_y - (y +
-                                                      windata->client.y), 0);
-                    } else {
-                        SDL_SendMouseMotion_ex(window, ievt->device_id, 0, last_x,
-                                            last_y, 0);
-                    }
-                }
-            } else if (ievt->flags & DIEF_AXISREL) {
-                if (ievt->axis == DIAI_X)
-                    SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1,
-                                        ievt->axisrel, 0, 0);
-                else if (ievt->axis == DIAI_Y)
-                    SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1, 0,
-                                        ievt->axisrel, 0);
-            }
-            break;
-        case DIET_KEYPRESS:
-            kbd_idx = KbdIndex(_this, ievt->device_id);
-            DirectFB_TranslateKeyInputEvent(_this, ievt, &keysym, &unicode);
-            /* printf("Scancode %d  %d %d\n", keysym.scancode, evt->key_code, evt->key_id); */
-            SDL_SendKeyboardKey_ex(kbd_idx, SDL_PRESSED, keysym.scancode);
-            if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
-                SDL_zero(text);
-                UnicodeToUtf8(unicode, text);
-                if (*text) {
-                    SDL_SendKeyboardText_ex(kbd_idx, text);
-                }
-            }
-            break;
-        case DIET_KEYRELEASE:
-            kbd_idx = KbdIndex(_this, ievt->device_id);
-            DirectFB_TranslateKeyInputEvent(_this, ievt, &keysym, &unicode);
-            SDL_SendKeyboardKey_ex(kbd_idx, SDL_RELEASED, keysym.scancode);
-            break;
-        case DIET_BUTTONPRESS:
-            if (ievt->buttons & DIBM_LEFT)
-                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_PRESSED, 1);
-            if (ievt->buttons & DIBM_MIDDLE)
-                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_PRESSED, 2);
-            if (ievt->buttons & DIBM_RIGHT)
-                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_PRESSED, 3);
-            break;
-        case DIET_BUTTONRELEASE:
-            if (!(ievt->buttons & DIBM_LEFT))
-                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_RELEASED, 1);
-            if (!(ievt->buttons & DIBM_MIDDLE))
-                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_RELEASED, 2);
-            if (!(ievt->buttons & DIBM_RIGHT))
-                SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_RELEASED, 3);
-            break;
-        default:
-            break;              /* please gcc */
-        }
-    }
-}
-
-void
-DirectFB_PumpEventsWindow(_THIS)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    DFBInputEvent ievt;
-    SDL_Window *w;
-
-    for (w = devdata->firstwin; w != NULL; w = w->next) {
-        SDL_DFB_WINDOWDATA(w);
-        DFBWindowEvent evt;
-
-        while (windata->eventbuffer->GetEvent(windata->eventbuffer,
-                                        DFB_EVENT(&evt)) == DFB_OK) {
-            if (!DirectFB_WM_ProcessEvent(_this, w, &evt)) {
-                /* Send a SDL_SYSWMEVENT if the application wants them */
-                if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) {
-                    SDL_SysWMmsg wmmsg;
-                    SDL_VERSION(&wmmsg.version);
-                    wmmsg.subsystem = SDL_SYSWM_DIRECTFB;
-                    wmmsg.msg.dfb.event.window = evt;
-                    SDL_SendSysWMEvent(&wmmsg);
-                }
-                ProcessWindowEvent(_this, w, &evt);
-            }
-        }
-    }
-
-    /* Now get relative events in case we need them */
-    while (devdata->events->GetEvent(devdata->events,
-                                     DFB_EVENT(&ievt)) == DFB_OK) {
-
-        if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) {
-            SDL_SysWMmsg wmmsg;
-            SDL_VERSION(&wmmsg.version);
-            wmmsg.subsystem = SDL_SYSWM_DIRECTFB;
-            wmmsg.msg.dfb.event.input = ievt;
-            SDL_SendSysWMEvent(&wmmsg);
-        }
-        ProcessInputEvent(_this, &ievt);
-    }
-}
-
-void
-DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keymap, int numkeys)
-{
-    int i;
-
-    /* Initialize the DirectFB key translation table */
-    for (i = 0; i < numkeys; ++i)
-        keymap[i] = SDL_SCANCODE_UNKNOWN;
-
-    keymap[DIKI_A - DIKI_UNKNOWN] = SDL_SCANCODE_A;
-    keymap[DIKI_B - DIKI_UNKNOWN] = SDL_SCANCODE_B;
-    keymap[DIKI_C - DIKI_UNKNOWN] = SDL_SCANCODE_C;
-    keymap[DIKI_D - DIKI_UNKNOWN] = SDL_SCANCODE_D;
-    keymap[DIKI_E - DIKI_UNKNOWN] = SDL_SCANCODE_E;
-    keymap[DIKI_F - DIKI_UNKNOWN] = SDL_SCANCODE_F;
-    keymap[DIKI_G - DIKI_UNKNOWN] = SDL_SCANCODE_G;
-    keymap[DIKI_H - DIKI_UNKNOWN] = SDL_SCANCODE_H;
-    keymap[DIKI_I - DIKI_UNKNOWN] = SDL_SCANCODE_I;
-    keymap[DIKI_J - DIKI_UNKNOWN] = SDL_SCANCODE_J;
-    keymap[DIKI_K - DIKI_UNKNOWN] = SDL_SCANCODE_K;
-    keymap[DIKI_L - DIKI_UNKNOWN] = SDL_SCANCODE_L;
-    keymap[DIKI_M - DIKI_UNKNOWN] = SDL_SCANCODE_M;
-    keymap[DIKI_N - DIKI_UNKNOWN] = SDL_SCANCODE_N;
-    keymap[DIKI_O - DIKI_UNKNOWN] = SDL_SCANCODE_O;
-    keymap[DIKI_P - DIKI_UNKNOWN] = SDL_SCANCODE_P;
-    keymap[DIKI_Q - DIKI_UNKNOWN] = SDL_SCANCODE_Q;
-    keymap[DIKI_R - DIKI_UNKNOWN] = SDL_SCANCODE_R;
-    keymap[DIKI_S - DIKI_UNKNOWN] = SDL_SCANCODE_S;
-    keymap[DIKI_T - DIKI_UNKNOWN] = SDL_SCANCODE_T;
-    keymap[DIKI_U - DIKI_UNKNOWN] = SDL_SCANCODE_U;
-    keymap[DIKI_V - DIKI_UNKNOWN] = SDL_SCANCODE_V;
-    keymap[DIKI_W - DIKI_UNKNOWN] = SDL_SCANCODE_W;
-    keymap[DIKI_X - DIKI_UNKNOWN] = SDL_SCANCODE_X;
-    keymap[DIKI_Y - DIKI_UNKNOWN] = SDL_SCANCODE_Y;
-    keymap[DIKI_Z - DIKI_UNKNOWN] = SDL_SCANCODE_Z;
-
-    keymap[DIKI_0 - DIKI_UNKNOWN] = SDL_SCANCODE_0;
-    keymap[DIKI_1 - DIKI_UNKNOWN] = SDL_SCANCODE_1;
-    keymap[DIKI_2 - DIKI_UNKNOWN] = SDL_SCANCODE_2;
-    keymap[DIKI_3 - DIKI_UNKNOWN] = SDL_SCANCODE_3;
-    keymap[DIKI_4 - DIKI_UNKNOWN] = SDL_SCANCODE_4;
-    keymap[DIKI_5 - DIKI_UNKNOWN] = SDL_SCANCODE_5;
-    keymap[DIKI_6 - DIKI_UNKNOWN] = SDL_SCANCODE_6;
-    keymap[DIKI_7 - DIKI_UNKNOWN] = SDL_SCANCODE_7;
-    keymap[DIKI_8 - DIKI_UNKNOWN] = SDL_SCANCODE_8;
-    keymap[DIKI_9 - DIKI_UNKNOWN] = SDL_SCANCODE_9;
-
-    keymap[DIKI_F1 - DIKI_UNKNOWN] = SDL_SCANCODE_F1;
-    keymap[DIKI_F2 - DIKI_UNKNOWN] = SDL_SCANCODE_F2;
-    keymap[DIKI_F3 - DIKI_UNKNOWN] = SDL_SCANCODE_F3;
-    keymap[DIKI_F4 - DIKI_UNKNOWN] = SDL_SCANCODE_F4;
-    keymap[DIKI_F5 - DIKI_UNKNOWN] = SDL_SCANCODE_F5;
-    keymap[DIKI_F6 - DIKI_UNKNOWN] = SDL_SCANCODE_F6;
-    keymap[DIKI_F7 - DIKI_UNKNOWN] = SDL_SCANCODE_F7;
-    keymap[DIKI_F8 - DIKI_UNKNOWN] = SDL_SCANCODE_F8;
-    keymap[DIKI_F9 - DIKI_UNKNOWN] = SDL_SCANCODE_F9;
-    keymap[DIKI_F10 - DIKI_UNKNOWN] = SDL_SCANCODE_F10;
-    keymap[DIKI_F11 - DIKI_UNKNOWN] = SDL_SCANCODE_F11;
-    keymap[DIKI_F12 - DIKI_UNKNOWN] = SDL_SCANCODE_F12;
-
-    keymap[DIKI_ESCAPE - DIKI_UNKNOWN] = SDL_SCANCODE_ESCAPE;
-    keymap[DIKI_LEFT - DIKI_UNKNOWN] = SDL_SCANCODE_LEFT;
-    keymap[DIKI_RIGHT - DIKI_UNKNOWN] = SDL_SCANCODE_RIGHT;
-    keymap[DIKI_UP - DIKI_UNKNOWN] = SDL_SCANCODE_UP;
-    keymap[DIKI_DOWN - DIKI_UNKNOWN] = SDL_SCANCODE_DOWN;
-    keymap[DIKI_CONTROL_L - DIKI_UNKNOWN] = SDL_SCANCODE_LCTRL;
-    keymap[DIKI_CONTROL_R - DIKI_UNKNOWN] = SDL_SCANCODE_RCTRL;
-    keymap[DIKI_SHIFT_L - DIKI_UNKNOWN] = SDL_SCANCODE_LSHIFT;
-    keymap[DIKI_SHIFT_R - DIKI_UNKNOWN] = SDL_SCANCODE_RSHIFT;
-    keymap[DIKI_ALT_L - DIKI_UNKNOWN] = SDL_SCANCODE_LALT;
-    keymap[DIKI_ALT_R - DIKI_UNKNOWN] = SDL_SCANCODE_RALT;
-    keymap[DIKI_META_L - DIKI_UNKNOWN] = SDL_SCANCODE_LGUI;
-    keymap[DIKI_META_R - DIKI_UNKNOWN] = SDL_SCANCODE_RGUI;
-    keymap[DIKI_SUPER_L - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION;
-    keymap[DIKI_SUPER_R - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION;
-    /* FIXME:Do we read hyper keys ?
-     * keymap[DIKI_HYPER_L - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION;
-     * keymap[DIKI_HYPER_R - DIKI_UNKNOWN] = SDL_SCANCODE_APPLICATION;
-     */
-    keymap[DIKI_TAB - DIKI_UNKNOWN] = SDL_SCANCODE_TAB;
-    keymap[DIKI_ENTER - DIKI_UNKNOWN] = SDL_SCANCODE_RETURN;
-    keymap[DIKI_SPACE - DIKI_UNKNOWN] = SDL_SCANCODE_SPACE;
-    keymap[DIKI_BACKSPACE - DIKI_UNKNOWN] = SDL_SCANCODE_BACKSPACE;
-    keymap[DIKI_INSERT - DIKI_UNKNOWN] = SDL_SCANCODE_INSERT;
-    keymap[DIKI_DELETE - DIKI_UNKNOWN] = SDL_SCANCODE_DELETE;
-    keymap[DIKI_HOME - DIKI_UNKNOWN] = SDL_SCANCODE_HOME;
-    keymap[DIKI_END - DIKI_UNKNOWN] = SDL_SCANCODE_END;
-    keymap[DIKI_PAGE_UP - DIKI_UNKNOWN] = SDL_SCANCODE_PAGEUP;
-    keymap[DIKI_PAGE_DOWN - DIKI_UNKNOWN] = SDL_SCANCODE_PAGEDOWN;
-    keymap[DIKI_CAPS_LOCK - DIKI_UNKNOWN] = SDL_SCANCODE_CAPSLOCK;
-    keymap[DIKI_NUM_LOCK - DIKI_UNKNOWN] = SDL_SCANCODE_NUMLOCKCLEAR;
-    keymap[DIKI_SCROLL_LOCK - DIKI_UNKNOWN] = SDL_SCANCODE_SCROLLLOCK;
-    keymap[DIKI_PRINT - DIKI_UNKNOWN] = SDL_SCANCODE_PRINTSCREEN;
-    keymap[DIKI_PAUSE - DIKI_UNKNOWN] = SDL_SCANCODE_PAUSE;
-
-    keymap[DIKI_KP_EQUAL - DIKI_UNKNOWN] = SDL_SCANCODE_KP_EQUALS;
-    keymap[DIKI_KP_DECIMAL - DIKI_UNKNOWN] = SDL_SCANCODE_KP_PERIOD;
-    keymap[DIKI_KP_0 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_0;
-    keymap[DIKI_KP_1 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_1;
-    keymap[DIKI_KP_2 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_2;
-    keymap[DIKI_KP_3 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_3;
-    keymap[DIKI_KP_4 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_4;
-    keymap[DIKI_KP_5 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_5;
-    keymap[DIKI_KP_6 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_6;
-    keymap[DIKI_KP_7 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_7;
-    keymap[DIKI_KP_8 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_8;
-    keymap[DIKI_KP_9 - DIKI_UNKNOWN] = SDL_SCANCODE_KP_9;
-    keymap[DIKI_KP_DIV - DIKI_UNKNOWN] = SDL_SCANCODE_KP_DIVIDE;
-    keymap[DIKI_KP_MULT - DIKI_UNKNOWN] = SDL_SCANCODE_KP_MULTIPLY;
-    keymap[DIKI_KP_MINUS - DIKI_UNKNOWN] = SDL_SCANCODE_KP_MINUS;
-    keymap[DIKI_KP_PLUS - DIKI_UNKNOWN] = SDL_SCANCODE_KP_PLUS;
-    keymap[DIKI_KP_ENTER - DIKI_UNKNOWN] = SDL_SCANCODE_KP_ENTER;
-
-    keymap[DIKI_QUOTE_LEFT - DIKI_UNKNOWN] = SDL_SCANCODE_GRAVE;        /*  TLDE  */
-    keymap[DIKI_MINUS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_MINUS;        /*  AE11  */
-    keymap[DIKI_EQUALS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_EQUALS;      /*  AE12  */
-    keymap[DIKI_BRACKET_LEFT - DIKI_UNKNOWN] = SDL_SCANCODE_RIGHTBRACKET;       /*  AD11  */
-    keymap[DIKI_BRACKET_RIGHT - DIKI_UNKNOWN] = SDL_SCANCODE_LEFTBRACKET;       /*  AD12  */
-    keymap[DIKI_BACKSLASH - DIKI_UNKNOWN] = SDL_SCANCODE_BACKSLASH;     /*  BKSL  */
-    keymap[DIKI_SEMICOLON - DIKI_UNKNOWN] = SDL_SCANCODE_SEMICOLON;     /*  AC10  */
-    keymap[DIKI_QUOTE_RIGHT - DIKI_UNKNOWN] = SDL_SCANCODE_APOSTROPHE;  /*  AC11  */
-    keymap[DIKI_COMMA - DIKI_UNKNOWN] = SDL_SCANCODE_COMMA;     /*  AB08  */
-    keymap[DIKI_PERIOD - DIKI_UNKNOWN] = SDL_SCANCODE_PERIOD;   /*  AB09  */
-    keymap[DIKI_SLASH - DIKI_UNKNOWN] = SDL_SCANCODE_SLASH;     /*  AB10  */
-    keymap[DIKI_LESS_SIGN - DIKI_UNKNOWN] = SDL_SCANCODE_NONUSBACKSLASH;        /*  103rd  */
-
-}
-
-static SDL_Keysym *
-DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym, Uint32 *unicode)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    int kbd_idx = 0; /* Window events lag the device source KbdIndex(_this, evt->device_id); */
-    DFB_KeyboardData *kbd = &devdata->keyboard[kbd_idx];
-
-    keysym->scancode = SDL_SCANCODE_UNKNOWN;
-
-    if (kbd->map && evt->key_code >= kbd->map_adjust &&
-        evt->key_code < kbd->map_size + kbd->map_adjust)
-        keysym->scancode = kbd->map[evt->key_code - kbd->map_adjust];
-
-    if (keysym->scancode == SDL_SCANCODE_UNKNOWN ||
-        devdata->keyboard[kbd_idx].is_generic) {
-        if (evt->key_id - DIKI_UNKNOWN < SDL_arraysize(oskeymap))
-            keysym->scancode = oskeymap[evt->key_id - DIKI_UNKNOWN];
-        else
-            keysym->scancode = SDL_SCANCODE_UNKNOWN;
-    }
-
-    *unicode =
-        (DFB_KEY_TYPE(evt->key_symbol) == DIKT_UNICODE) ? evt->key_symbol : 0;
-    if (*unicode == 0 &&
-        (evt->key_symbol > 0 && evt->key_symbol < 255))
-        *unicode = evt->key_symbol;
-
-    return keysym;
-}
-
-static SDL_Keysym *
-DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt,
-                                SDL_Keysym * keysym, Uint32 *unicode)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    int kbd_idx = KbdIndex(_this, evt->device_id);
-    DFB_KeyboardData *kbd = &devdata->keyboard[kbd_idx];
-
-    keysym->scancode = SDL_SCANCODE_UNKNOWN;
-
-    if (kbd->map && evt->key_code >= kbd->map_adjust &&
-        evt->key_code < kbd->map_size + kbd->map_adjust)
-        keysym->scancode = kbd->map[evt->key_code - kbd->map_adjust];
-
-    if (keysym->scancode == SDL_SCANCODE_UNKNOWN || devdata->keyboard[kbd_idx].is_generic) {
-        if (evt->key_id - DIKI_UNKNOWN < SDL_arraysize(oskeymap))
-            keysym->scancode = oskeymap[evt->key_id - DIKI_UNKNOWN];
-        else
-            keysym->scancode = SDL_SCANCODE_UNKNOWN;
-    }
-
-    *unicode =
-        (DFB_KEY_TYPE(evt->key_symbol) == DIKT_UNICODE) ? evt->key_symbol : 0;
-    if (*unicode == 0 &&
-        (evt->key_symbol > 0 && evt->key_symbol < 255))
-        *unicode = evt->key_symbol;
-
-    return keysym;
-}
-
-static int
-DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button)
-{
-    switch (button) {
-    case DIBI_LEFT:
-        return 1;
-    case DIBI_MIDDLE:
-        return 2;
-    case DIBI_RIGHT:
-        return 3;
-    default:
-        return 0;
-    }
-}
-
-static DFBEnumerationResult
-EnumKeyboards(DFBInputDeviceID device_id,
-                DFBInputDeviceDescription desc, void *callbackdata)
-{
-    cb_data *cb = callbackdata;
-    DFB_DeviceData *devdata = cb->devdata;
-#if USE_MULTI_API
-    SDL_Keyboard keyboard;
-#endif
-    SDL_Keycode keymap[SDL_NUM_SCANCODES];
-
-    if (!cb->sys_kbd) {
-        if (cb->sys_ids) {
-            if (device_id >= 0x10)
-                return DFENUM_OK;
-        } else {
-            if (device_id < 0x10)
-                return DFENUM_OK;
-        }
-    } else {
-        if (device_id != DIDID_KEYBOARD)
-            return DFENUM_OK;
-    }
-
-    if ((desc.caps & DIDTF_KEYBOARD)) {
-#if USE_MULTI_API
-        SDL_zero(keyboard);
-        SDL_AddKeyboard(&keyboard, devdata->num_keyboard);
-#endif
-        devdata->keyboard[devdata->num_keyboard].id = device_id;
-        devdata->keyboard[devdata->num_keyboard].is_generic = 0;
-        if (!strncmp("X11", desc.name, 3))
-        {
-            devdata->keyboard[devdata->num_keyboard].map = xfree86_scancode_table2;
-            devdata->keyboard[devdata->num_keyboard].map_size = SDL_arraysize(xfree86_scancode_table2);
-            devdata->keyboard[devdata->num_keyboard].map_adjust = 8;
-        } else {
-            devdata->keyboard[devdata->num_keyboard].map = linux_scancode_table;
-            devdata->keyboard[devdata->num_keyboard].map_size = SDL_arraysize(linux_scancode_table);
-            devdata->keyboard[devdata->num_keyboard].map_adjust = 0;
-        }
-
-        SDL_DFB_LOG("Keyboard %d - %s\n", device_id, desc.name);
-
-        SDL_GetDefaultKeymap(keymap);
-#if USE_MULTI_API
-        SDL_SetKeymap(devdata->num_keyboard, 0, keymap, SDL_NUM_SCANCODES);
-#else
-        SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
-#endif
-        devdata->num_keyboard++;
-
-        if (cb->sys_kbd)
-            return DFENUM_CANCEL;
-    }
-    return DFENUM_OK;
-}
-
-void
-DirectFB_InitKeyboard(_THIS)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    cb_data cb;
-
-    DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap));
-
-    devdata->num_keyboard = 0;
-    cb.devdata = devdata;
-
-    if (devdata->use_linux_input) {
-        cb.sys_kbd = 0;
-        cb.sys_ids = 0;
-        SDL_DFB_CHECK(devdata->dfb->
-                      EnumInputDevices(devdata->dfb, EnumKeyboards, &cb));
-        if (devdata->num_keyboard == 0) {
-            cb.sys_ids = 1;
-            SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb,
-                                                         EnumKeyboards,
-                                                         &cb));
-        }
-    } else {
-        cb.sys_kbd = 1;
-        SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb,
-                                                     EnumKeyboards,
-                                                     &cb));
-    }
-}
-
-void
-DirectFB_QuitKeyboard(_THIS)
-{
-    /* SDL_DFB_DEVICEDATA(_this); */
-
-    SDL_KeyboardQuit();
-
-}
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_events.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_events.h
deleted file mode 100644
index a69e6bf..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_events.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_DirectFB_events_h
-#define _SDL_DirectFB_events_h
-
-#include "../SDL_sysvideo.h"
-
-/* Functions to be exported */
-extern void DirectFB_InitKeyboard(_THIS);
-extern void DirectFB_QuitKeyboard(_THIS);
-extern void DirectFB_PumpEventsWindow(_THIS);
-
-#endif
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_modes.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_modes.c
deleted file mode 100644
index c6d1bb4..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_modes.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_modes.h"
-
-#define DFB_MAX_MODES 200
-
-struct screen_callback_t
-{
-    int numscreens;
-    DFBScreenID screenid[DFB_MAX_SCREENS];
-    DFBDisplayLayerID gralayer[DFB_MAX_SCREENS];
-    DFBDisplayLayerID vidlayer[DFB_MAX_SCREENS];
-    int aux;                    /* auxiliary integer for callbacks */
-};
-
-struct modes_callback_t
-{
-    int nummodes;
-    SDL_DisplayMode *modelist;
-};
-
-static DFBEnumerationResult
-EnumModesCallback(int width, int height, int bpp, void *data)
-{
-    struct modes_callback_t *modedata = (struct modes_callback_t *) data;
-    SDL_DisplayMode mode;
-
-    mode.w = width;
-    mode.h = height;
-    mode.refresh_rate = 0;
-    mode.driverdata = NULL;
-    mode.format = SDL_PIXELFORMAT_UNKNOWN;
-
-    if (modedata->nummodes < DFB_MAX_MODES) {
-        modedata->modelist[modedata->nummodes++] = mode;
-    }
-
-    return DFENUM_OK;
-}
-
-static DFBEnumerationResult
-EnumScreensCallback(DFBScreenID screen_id, DFBScreenDescription desc,
-          void *callbackdata)
-{
-    struct screen_callback_t *devdata = (struct screen_callback_t *) callbackdata;
-
-    devdata->screenid[devdata->numscreens++] = screen_id;
-    return DFENUM_OK;
-}
-
-static DFBEnumerationResult
-EnumLayersCallback(DFBDisplayLayerID layer_id, DFBDisplayLayerDescription desc,
-         void *callbackdata)
-{
-    struct screen_callback_t *devdata = (struct screen_callback_t *) callbackdata;
-
-    if (desc.caps & DLCAPS_SURFACE) {
-        if ((desc.type & DLTF_GRAPHICS) && (desc.type & DLTF_VIDEO)) {
-            if (devdata->vidlayer[devdata->aux] == -1)
-                devdata->vidlayer[devdata->aux] = layer_id;
-        } else if (desc.type & DLTF_GRAPHICS) {
-            if (devdata->gralayer[devdata->aux] == -1)
-                devdata->gralayer[devdata->aux] = layer_id;
-        }
-    }
-    return DFENUM_OK;
-}
-
-static void
-CheckSetDisplayMode(_THIS, SDL_VideoDisplay * display, DFB_DisplayData * data, SDL_DisplayMode * mode)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    DFBDisplayLayerConfig config;
-    DFBDisplayLayerConfigFlags failed;
-
-    SDL_DFB_CHECKERR(data->layer->SetCooperativeLevel(data->layer,
-                                                      DLSCL_ADMINISTRATIVE));
-    config.width = mode->w;
-    config.height = mode->h;
-    config.pixelformat = DirectFB_SDLToDFBPixelFormat(mode->format);
-    config.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT;
-    if (devdata->use_yuv_underlays) {
-        config.flags |= DLCONF_OPTIONS;
-        config.options = DLOP_ALPHACHANNEL;
-    }
-    failed = 0;
-    data->layer->TestConfiguration(data->layer, &config, &failed);
-    SDL_DFB_CHECKERR(data->layer->SetCooperativeLevel(data->layer,
-                                                      DLSCL_SHARED));
-    if (failed == 0)
-    {
-        SDL_AddDisplayMode(display, mode);
-        SDL_DFB_LOG("Mode %d x %d Added\n", mode->w, mode->h);
-    }
-    else
-        SDL_DFB_ERR("Mode %d x %d not available: %x\n", mode->w,
-                      mode->h, failed);
-
-    return;
-  error:
-    return;
-}
-
-
-void
-DirectFB_SetContext(_THIS, SDL_Window *window)
-{
-#if (DFB_VERSION_ATLEAST(1,0,0))
-    /* FIXME: does not work on 1.0/1.2 with radeon driver
-     *        the approach did work with the matrox driver
-     *        This has simply no effect.
-     */
-
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
-
-    /* FIXME: should we handle the error */
-    if (dispdata->vidIDinuse)
-        SDL_DFB_CHECK(dispdata->vidlayer->SwitchContext(dispdata->vidlayer,
-                                                           DFB_TRUE));
-#endif
-}
-
-void
-DirectFB_InitModes(_THIS)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    IDirectFBDisplayLayer *layer = NULL;
-    SDL_VideoDisplay display;
-    DFB_DisplayData *dispdata = NULL;
-    SDL_DisplayMode mode;
-    DFBGraphicsDeviceDescription caps;
-    DFBDisplayLayerConfig dlc;
-    struct screen_callback_t *screencbdata;
-
-    int tcw[DFB_MAX_SCREENS];
-    int tch[DFB_MAX_SCREENS];
-    int i;
-    DFBResult ret;
-
-    SDL_DFB_ALLOC_CLEAR(screencbdata, sizeof(*screencbdata));
-
-    screencbdata->numscreens = 0;
-
-    for (i = 0; i < DFB_MAX_SCREENS; i++) {
-        screencbdata->gralayer[i] = -1;
-        screencbdata->vidlayer[i] = -1;
-    }
-
-    SDL_DFB_CHECKERR(devdata->dfb->EnumScreens(devdata->dfb, &EnumScreensCallback,
-                                               screencbdata));
-
-    for (i = 0; i < screencbdata->numscreens; i++) {
-        IDirectFBScreen *screen;
-
-        SDL_DFB_CHECKERR(devdata->dfb->GetScreen(devdata->dfb,
-                                                 screencbdata->screenid
-                                                 [i], &screen));
-
-        screencbdata->aux = i;
-        SDL_DFB_CHECKERR(screen->EnumDisplayLayers(screen, &EnumLayersCallback,
-                                                   screencbdata));
-        screen->GetSize(screen, &tcw[i], &tch[i]);
-
-        screen->Release(screen);
-    }
-
-    /* Query card capabilities */
-
-    devdata->dfb->GetDeviceDescription(devdata->dfb, &caps);
-
-    for (i = 0; i < screencbdata->numscreens; i++) {
-        SDL_DFB_CHECKERR(devdata->dfb->GetDisplayLayer(devdata->dfb,
-                                                       screencbdata->gralayer
-                                                       [i], &layer));
-
-        SDL_DFB_CHECKERR(layer->SetCooperativeLevel(layer,
-                                                    DLSCL_ADMINISTRATIVE));
-        layer->EnableCursor(layer, 1);
-        SDL_DFB_CHECKERR(layer->SetCursorOpacity(layer, 0xC0));
-
-        if (devdata->use_yuv_underlays) {
-            dlc.flags = DLCONF_PIXELFORMAT | DLCONF_OPTIONS;
-            dlc.pixelformat = DSPF_ARGB;
-            dlc.options = DLOP_ALPHACHANNEL;
-
-            ret = layer->SetConfiguration(layer, &dlc);
-            if (ret != DFB_OK) {
-                /* try AiRGB if the previous failed */
-                dlc.pixelformat = DSPF_AiRGB;
-                SDL_DFB_CHECKERR(layer->SetConfiguration(layer, &dlc));
-            }
-        }
-
-        /* Query layer configuration to determine the current mode and pixelformat */
-        dlc.flags = DLCONF_ALL;
-        SDL_DFB_CHECKERR(layer->GetConfiguration(layer, &dlc));
-
-        mode.format = DirectFB_DFBToSDLPixelFormat(dlc.pixelformat);
-
-        if (mode.format == SDL_PIXELFORMAT_UNKNOWN) {
-            SDL_DFB_ERR("Unknown dfb pixelformat %x !\n", dlc.pixelformat);
-            goto error;
-        }
-
-        mode.w = dlc.width;
-        mode.h = dlc.height;
-        mode.refresh_rate = 0;
-        mode.driverdata = NULL;
-
-        SDL_DFB_ALLOC_CLEAR(dispdata, sizeof(*dispdata));
-
-        dispdata->layer = layer;
-        dispdata->pixelformat = dlc.pixelformat;
-        dispdata->cw = tcw[i];
-        dispdata->ch = tch[i];
-
-        /* YUV - Video layer */
-
-        dispdata->vidID = screencbdata->vidlayer[i];
-        dispdata->vidIDinuse = 0;
-
-        SDL_zero(display);
-
-        display.desktop_mode = mode;
-        display.current_mode = mode;
-        display.driverdata = dispdata;
-
-#if (DFB_VERSION_ATLEAST(1,2,0))
-        dlc.flags =
-            DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT |
-            DLCONF_OPTIONS;
-        ret = layer->SetConfiguration(layer, &dlc);
-#endif
-
-        SDL_DFB_CHECKERR(layer->SetCooperativeLevel(layer, DLSCL_SHARED));
-
-        SDL_AddVideoDisplay(&display);
-    }
-    SDL_DFB_FREE(screencbdata);
-    return;
-  error:
-    /* FIXME: Cleanup not complete, Free existing displays */
-    SDL_DFB_FREE(dispdata);
-    SDL_DFB_RELEASE(layer);
-    return;
-}
-
-void
-DirectFB_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
-    SDL_DisplayMode mode;
-    struct modes_callback_t data;
-    int i;
-
-    data.nummodes = 0;
-    /* Enumerate the available fullscreen modes */
-    SDL_DFB_CALLOC(data.modelist, DFB_MAX_MODES, sizeof(SDL_DisplayMode));
-    SDL_DFB_CHECKERR(devdata->dfb->EnumVideoModes(devdata->dfb,
-                                                  EnumModesCallback, &data));
-
-    for (i = 0; i < data.nummodes; ++i) {
-        mode = data.modelist[i];
-
-        mode.format = SDL_PIXELFORMAT_ARGB8888;
-        CheckSetDisplayMode(_this, display, dispdata, &mode);
-        mode.format = SDL_PIXELFORMAT_RGB888;
-        CheckSetDisplayMode(_this, display, dispdata, &mode);
-        mode.format = SDL_PIXELFORMAT_RGB24;
-        CheckSetDisplayMode(_this, display, dispdata, &mode);
-        mode.format = SDL_PIXELFORMAT_RGB565;
-        CheckSetDisplayMode(_this, display, dispdata, &mode);
-        mode.format = SDL_PIXELFORMAT_INDEX8;
-        CheckSetDisplayMode(_this, display, dispdata, &mode);
-    }
-
-    SDL_DFB_FREE(data.modelist);
-error:
-    return;
-}
-
-int
-DirectFB_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
-{
-    /*
-     * FIXME: video mode switch is currently broken for 1.2.0
-     *
-     */
-
-    SDL_DFB_DEVICEDATA(_this);
-    DFB_DisplayData *data = (DFB_DisplayData *) display->driverdata;
-    DFBDisplayLayerConfig config, rconfig;
-    DFBDisplayLayerConfigFlags fail = 0;
-
-    SDL_DFB_CHECKERR(data->layer->SetCooperativeLevel(data->layer,
-                                                      DLSCL_ADMINISTRATIVE));
-
-    SDL_DFB_CHECKERR(data->layer->GetConfiguration(data->layer, &config));
-    config.flags = DLCONF_WIDTH | DLCONF_HEIGHT;
-    if (mode->format != SDL_PIXELFORMAT_UNKNOWN) {
-        config.flags |= DLCONF_PIXELFORMAT;
-        config.pixelformat = DirectFB_SDLToDFBPixelFormat(mode->format);
-        data->pixelformat = config.pixelformat;
-    }
-    config.width = mode->w;
-    config.height = mode->h;
-
-    if (devdata->use_yuv_underlays) {
-        config.flags |= DLCONF_OPTIONS;
-        config.options = DLOP_ALPHACHANNEL;
-    }
-
-    data->layer->TestConfiguration(data->layer, &config, &fail);
-
-    if (fail &
-        (DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT |
-         DLCONF_OPTIONS)) {
-        SDL_DFB_ERR("Error setting mode %dx%d-%x\n", mode->w, mode->h,
-                    mode->format);
-        return -1;
-    }
-
-    config.flags &= ~fail;
-    SDL_DFB_CHECKERR(data->layer->SetConfiguration(data->layer, &config));
-#if (DFB_VERSION_ATLEAST(1,2,0))
-    /* Need to call this twice ! */
-    SDL_DFB_CHECKERR(data->layer->SetConfiguration(data->layer, &config));
-#endif
-
-    /* Double check */
-    SDL_DFB_CHECKERR(data->layer->GetConfiguration(data->layer, &rconfig));
-    SDL_DFB_CHECKERR(data->
-                     layer->SetCooperativeLevel(data->layer, DLSCL_SHARED));
-
-    if ((config.width != rconfig.width) || (config.height != rconfig.height)
-        || ((mode->format != SDL_PIXELFORMAT_UNKNOWN)
-            && (config.pixelformat != rconfig.pixelformat))) {
-        SDL_DFB_ERR("Error setting mode %dx%d-%x\n", mode->w, mode->h,
-                    mode->format);
-        return -1;
-    }
-
-    data->pixelformat = rconfig.pixelformat;
-    data->cw = config.width;
-    data->ch = config.height;
-    display->current_mode = *mode;
-
-    return 0;
-  error:
-    return -1;
-}
-
-void
-DirectFB_QuitModes(_THIS)
-{
-    SDL_DisplayMode tmode;
-    int i;
-
-    for (i = 0; i < _this->num_displays; ++i) {
-        SDL_VideoDisplay *display = &_this->displays[i];
-        DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
-
-        SDL_GetDesktopDisplayMode(i, &tmode);
-        tmode.format = SDL_PIXELFORMAT_UNKNOWN;
-        DirectFB_SetDisplayMode(_this, display, &tmode);
-
-        SDL_GetDesktopDisplayMode(i, &tmode);
-        DirectFB_SetDisplayMode(_this, display, &tmode);
-
-        if (dispdata->layer) {
-            SDL_DFB_CHECK(dispdata->
-                          layer->SetCooperativeLevel(dispdata->layer,
-                                                     DLSCL_ADMINISTRATIVE));
-            SDL_DFB_CHECK(dispdata->
-                          layer->SetCursorOpacity(dispdata->layer, 0x00));
-            SDL_DFB_CHECK(dispdata->
-                          layer->SetCooperativeLevel(dispdata->layer,
-                                                     DLSCL_SHARED));
-        }
-
-        SDL_DFB_RELEASE(dispdata->layer);
-        SDL_DFB_RELEASE(dispdata->vidlayer);
-
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_modes.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_modes.h
deleted file mode 100644
index 6e439cd..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_modes.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_directfb_modes_h
-#define _SDL_directfb_modes_h
-
-#include <directfb.h>
-
-#include "../SDL_sysvideo.h"
-
-#define SDL_DFB_DISPLAYDATA(win)  DFB_DisplayData *dispdata = ((win) ? (DFB_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata : NULL)
-
-typedef struct _DFB_DisplayData DFB_DisplayData;
-struct _DFB_DisplayData
-{
-    IDirectFBDisplayLayer   *layer;
-    DFBSurfacePixelFormat   pixelformat;
-    /* FIXME: support for multiple video layer.
-     * However, I do not know any card supporting
-     * more than one
-     */
-    DFBDisplayLayerID       vidID;
-    IDirectFBDisplayLayer   *vidlayer;
-
-    int                     vidIDinuse;
-
-    int                     cw;
-    int                     ch;
-};
-
-
-extern void DirectFB_InitModes(_THIS);
-extern void DirectFB_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
-extern int DirectFB_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-extern void DirectFB_QuitModes(_THIS);
-
-extern void DirectFB_SetContext(_THIS, SDL_Window *window);
-
-#endif /* _SDL_directfb_modes_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_mouse.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_mouse.c
deleted file mode 100644
index fb5ed4e..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_mouse.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-
-#include "SDL_assert.h"
-
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_mouse.h"
-#include "SDL_DirectFB_modes.h"
-#include "SDL_DirectFB_window.h"
-
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_mouse_c.h"
-
-static SDL_Cursor *DirectFB_CreateDefaultCursor(void);
-static SDL_Cursor *DirectFB_CreateCursor(SDL_Surface * surface,
-                                         int hot_x, int hot_y);
-static int DirectFB_ShowCursor(SDL_Cursor * cursor);
-static void DirectFB_MoveCursor(SDL_Cursor * cursor);
-static void DirectFB_FreeCursor(SDL_Cursor * cursor);
-static void DirectFB_WarpMouse(SDL_Window * window, int x, int y);
-static void DirectFB_FreeMouse(SDL_Mouse * mouse);
-
-static const char *arrow[] = {
-    /* pixels */
-    "X                               ",
-    "XX                              ",
-    "X.X                             ",
-    "X..X                            ",
-    "X...X                           ",
-    "X....X                          ",
-    "X.....X                         ",
-    "X......X                        ",
-    "X.......X                       ",
-    "X........X                      ",
-    "X.....XXXXX                     ",
-    "X..X..X                         ",
-    "X.X X..X                        ",
-    "XX  X..X                        ",
-    "X    X..X                       ",
-    "     X..X                       ",
-    "      X..X                      ",
-    "      X..X                      ",
-    "       XX                       ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-    "                                ",
-};
-
-static SDL_Cursor *
-DirectFB_CreateDefaultCursor(void)
-{
-    SDL_VideoDevice *dev = SDL_GetVideoDevice();
-
-    SDL_DFB_DEVICEDATA(dev);
-    DFB_CursorData *curdata;
-    DFBResult ret;
-    DFBSurfaceDescription dsc;
-    SDL_Cursor *cursor;
-    Uint32 *dest;
-    Uint32 *p;
-    int pitch, i, j;
-
-    SDL_DFB_ALLOC_CLEAR( cursor, sizeof(*cursor));
-    SDL_DFB_ALLOC_CLEAR(curdata, sizeof(*curdata));
-
-    dsc.flags =
-        DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
-    dsc.caps = DSCAPS_VIDEOONLY;
-    dsc.width = 32;
-    dsc.height = 32;
-    dsc.pixelformat = DSPF_ARGB;
-
-    SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc,
-                                                 &curdata->surf));
-    curdata->hotx = 0;
-    curdata->hoty = 0;
-    cursor->driverdata = curdata;
-
-    SDL_DFB_CHECKERR(curdata->surf->Lock(curdata->surf, DSLF_WRITE,
-                                         (void *) &dest, &pitch));
-
-    /* Relies on the fact that this is only called with ARGB surface. */
-    for (i = 0; i < 32; i++)
-    {
-        for (j = 0; j < 32; j++)
-        {
-            switch (arrow[i][j])
-            {
-            case ' ': dest[j] = 0x00000000; break;
-            case '.': dest[j] = 0xffffffff; break;
-            case 'X': dest[j] = 0xff000000; break;
-            }
-        }
-        dest += (pitch >> 2);
-    }
-
-    curdata->surf->Unlock(curdata->surf);
-    return cursor;
-  error:
-    return NULL;
-}
-
-/* Create a cursor from a surface */
-static SDL_Cursor *
-DirectFB_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
-{
-    SDL_VideoDevice *dev = SDL_GetVideoDevice();
-
-    SDL_DFB_DEVICEDATA(dev);
-    DFB_CursorData *curdata;
-    DFBResult ret;
-    DFBSurfaceDescription dsc;
-    SDL_Cursor *cursor;
-    Uint32 *dest;
-    Uint32 *p;
-    int pitch, i;
-
-    SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888);
-    SDL_assert(surface->pitch == surface->w * 4);
-
-    SDL_DFB_ALLOC_CLEAR( cursor, sizeof(*cursor));
-    SDL_DFB_ALLOC_CLEAR(curdata, sizeof(*curdata));
-
-    dsc.flags =
-        DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
-    dsc.caps = DSCAPS_VIDEOONLY;
-    dsc.width = surface->w;
-    dsc.height = surface->h;
-    dsc.pixelformat = DSPF_ARGB;
-
-    SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc,
-                                                 &curdata->surf));
-    curdata->hotx = hot_x;
-    curdata->hoty = hot_y;
-    cursor->driverdata = curdata;
-
-    SDL_DFB_CHECKERR(curdata->surf->Lock(curdata->surf, DSLF_WRITE,
-                                         (void *) &dest, &pitch));
-
-    p = surface->pixels;
-    for (i = 0; i < surface->h; i++)
-        memcpy((char *) dest + i * pitch,
-               (char *) p + i * surface->pitch, 4 * surface->w);
-
-    curdata->surf->Unlock(curdata->surf);
-    return cursor;
-  error:
-    return NULL;
-}
-
-/* Show the specified cursor, or hide if cursor is NULL */
-static int
-DirectFB_ShowCursor(SDL_Cursor * cursor)
-{
-    SDL_DFB_CURSORDATA(cursor);
-    DFBResult ret;
-    SDL_Window *window;
-
-    window = SDL_GetFocusWindow();
-    if (!window)
-        return -1;
-    else {
-        SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-
-        if (display) {
-            DFB_DisplayData *dispdata =
-                (DFB_DisplayData *) display->driverdata;
-            DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
-
-            if (cursor)
-                SDL_DFB_CHECKERR(windata->dfbwin->
-                                 SetCursorShape(windata->dfbwin,
-                                                curdata->surf, curdata->hotx,
-                                                curdata->hoty));
-
-            SDL_DFB_CHECKERR(dispdata->layer->
-                             SetCooperativeLevel(dispdata->layer,
-                                                 DLSCL_ADMINISTRATIVE));
-            SDL_DFB_CHECKERR(dispdata->layer->
-                             SetCursorOpacity(dispdata->layer,
-                                              cursor ? 0xC0 : 0x00));
-            SDL_DFB_CHECKERR(dispdata->layer->
-                             SetCooperativeLevel(dispdata->layer,
-                                                 DLSCL_SHARED));
-        }
-    }
-
-    return 0;
-  error:
-    return -1;
-}
-
-/* Free a window manager cursor */
-static void
-DirectFB_FreeCursor(SDL_Cursor * cursor)
-{
-    SDL_DFB_CURSORDATA(cursor);
-
-    SDL_DFB_RELEASE(curdata->surf);
-    SDL_DFB_FREE(cursor->driverdata);
-    SDL_DFB_FREE(cursor);
-}
-
-/* Warp the mouse to (x,y) */
-static void
-DirectFB_WarpMouse(SDL_Window * window, int x, int y)
-{
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
-    DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
-    DFBResult ret;
-    int cx, cy;
-
-    SDL_DFB_CHECKERR(windata->dfbwin->GetPosition(windata->dfbwin, &cx, &cy));
-    SDL_DFB_CHECKERR(dispdata->layer->WarpCursor(dispdata->layer,
-                                                 cx + x + windata->client.x,
-                                                 cy + y + windata->client.y));
-
-  error:
-    return;
-}
-
-#if USE_MULTI_API
-
-static void DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window,
-                               int x, int y);
-
-static int id_mask;
-
-static DFBEnumerationResult
-EnumMice(DFBInputDeviceID device_id, DFBInputDeviceDescription desc,
-         void *callbackdata)
-{
-    DFB_DeviceData *devdata = callbackdata;
-
-    if ((desc.type & DIDTF_MOUSE) && (device_id & id_mask)) {
-        SDL_Mouse mouse;
-
-        SDL_zero(mouse);
-        mouse.id = device_id;
-        mouse.CreateCursor = DirectFB_CreateCursor;
-        mouse.ShowCursor = DirectFB_ShowCursor;
-        mouse.MoveCursor = DirectFB_MoveCursor;
-        mouse.FreeCursor = DirectFB_FreeCursor;
-        mouse.WarpMouse = DirectFB_WarpMouse;
-        mouse.FreeMouse = DirectFB_FreeMouse;
-        mouse.cursor_shown = 1;
-
-        SDL_AddMouse(&mouse, desc.name, 0, 0, 1);
-        devdata->mouse_id[devdata->num_mice++] = device_id;
-    }
-    return DFENUM_OK;
-}
-
-void
-DirectFB_InitMouse(_THIS)
-{
-    SDL_DFB_DEVICEDATA(_this);
-
-    devdata->num_mice = 0;
-    if (devdata->use_linux_input) {
-        /* try non-core devices first */
-        id_mask = 0xF0;
-        devdata->dfb->EnumInputDevices(devdata->dfb, EnumMice, devdata);
-        if (devdata->num_mice == 0) {
-            /* try core devices */
-            id_mask = 0x0F;
-            devdata->dfb->EnumInputDevices(devdata->dfb, EnumMice, devdata);
-        }
-    }
-    if (devdata->num_mice == 0) {
-        SDL_Mouse mouse;
-
-        SDL_zero(mouse);
-        mouse.CreateCursor = DirectFB_CreateCursor;
-        mouse.ShowCursor = DirectFB_ShowCursor;
-        mouse.MoveCursor = DirectFB_MoveCursor;
-        mouse.FreeCursor = DirectFB_FreeCursor;
-        mouse.WarpMouse = DirectFB_WarpMouse;
-        mouse.FreeMouse = DirectFB_FreeMouse;
-        mouse.cursor_shown = 1;
-
-        SDL_AddMouse(&mouse, "Mouse", 0, 0, 1);
-        devdata->num_mice = 1;
-    }
-}
-
-void
-DirectFB_QuitMouse(_THIS)
-{
-    SDL_DFB_DEVICEDATA(_this);
-
-    if (devdata->use_linux_input) {
-        SDL_MouseQuit();
-    } else {
-        SDL_DelMouse(0);
-    }
-}
-
-
-/* This is called when a mouse motion event occurs */
-static void
-DirectFB_MoveCursor(SDL_Cursor * cursor)
-{
-
-}
-
-/* Warp the mouse to (x,y) */
-static void
-DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y)
-{
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
-    DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
-    DFBResult ret;
-    int cx, cy;
-
-    SDL_DFB_CHECKERR(windata->dfbwin->GetPosition(windata->dfbwin, &cx, &cy));
-    SDL_DFB_CHECKERR(dispdata->layer->WarpCursor(dispdata->layer,
-                                                 cx + x + windata->client.x,
-                                                 cy + y + windata->client.y));
-
-  error:
-    return;
-}
-
-/* Free the mouse when it's time */
-static void
-DirectFB_FreeMouse(SDL_Mouse * mouse)
-{
-    /* nothing yet */
-}
-
-#else /* USE_MULTI_API */
-
-void
-DirectFB_InitMouse(_THIS)
-{
-    SDL_DFB_DEVICEDATA(_this);
-
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    mouse->CreateCursor = DirectFB_CreateCursor;
-    mouse->ShowCursor = DirectFB_ShowCursor;
-    mouse->WarpMouse = DirectFB_WarpMouse;
-    mouse->FreeCursor = DirectFB_FreeCursor;
-
-    SDL_SetDefaultCursor(DirectFB_CreateDefaultCursor());
-
-    devdata->num_mice = 1;
-}
-
-void
-DirectFB_QuitMouse(_THIS)
-{
-}
-
-
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_mouse.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_mouse.h
deleted file mode 100644
index 906f1fb..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_mouse.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_DirectFB_mouse_h
-#define _SDL_DirectFB_mouse_h
-
-#include <directfb.h>
-
-#include "../SDL_sysvideo.h"
-
-typedef struct _DFB_CursorData DFB_CursorData;
-struct _DFB_CursorData
-{
-    IDirectFBSurface *surf;
-    int             hotx;
-    int             hoty;
-};
-
-#define SDL_DFB_CURSORDATA(curs)  DFB_CursorData *curdata = (DFB_CursorData *) ((curs) ? (curs)->driverdata : NULL)
-
-extern void DirectFB_InitMouse(_THIS);
-extern void DirectFB_QuitMouse(_THIS);
-
-#endif /* _SDL_DirectFB_mouse_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_opengl.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_opengl.c
deleted file mode 100644
index fac05e6..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_opengl.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-
-#include "SDL_DirectFB_video.h"
-
-#if SDL_DIRECTFB_OPENGL
-
-#include "SDL_DirectFB_opengl.h"
-#include "SDL_DirectFB_window.h"
-
-#include <directfbgl.h>
-#include "SDL_loadso.h"
-#endif
-
-#if SDL_DIRECTFB_OPENGL
-
-struct SDL_GLDriverData
-{
-    int gl_active;              /* to stop switching drivers while we have a valid context */
-    int initialized;
-    DirectFB_GLContext *firstgl;        /* linked list */
-
-    /* OpenGL */
-    void (*glFinish) (void);
-    void (*glFlush) (void);
-};
-
-#define OPENGL_REQUIRS_DLOPEN
-#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
-#include <dlfcn.h>
-#define GL_LoadObject(X)    dlopen(X, (RTLD_NOW|RTLD_GLOBAL))
-#define GL_LoadFunction     dlsym
-#define GL_UnloadObject     dlclose
-#else
-#define GL_LoadObject   SDL_LoadObject
-#define GL_LoadFunction SDL_LoadFunction
-#define GL_UnloadObject SDL_UnloadObject
-#endif
-
-static void DirectFB_GL_UnloadLibrary(_THIS);
-
-int
-DirectFB_GL_Initialize(_THIS)
-{
-    if (_this->gl_data) {
-        return 0;
-    }
-
-    _this->gl_data =
-        (struct SDL_GLDriverData *) SDL_calloc(1,
-                                               sizeof(struct
-                                                      SDL_GLDriverData));
-    if (!_this->gl_data) {
-        return SDL_OutOfMemory();
-    }
-    _this->gl_data->initialized = 0;
-
-    ++_this->gl_data->initialized;
-    _this->gl_data->firstgl = NULL;
-
-    if (DirectFB_GL_LoadLibrary(_this, NULL) < 0) {
-        return -1;
-    }
-
-    /* Initialize extensions */
-    /* FIXME needed?
-     * X11_GL_InitExtensions(_this);
-     */
-
-    return 0;
-}
-
-void
-DirectFB_GL_Shutdown(_THIS)
-{
-    if (!_this->gl_data || (--_this->gl_data->initialized > 0)) {
-        return;
-    }
-
-    DirectFB_GL_UnloadLibrary(_this);
-
-    SDL_free(_this->gl_data);
-    _this->gl_data = NULL;
-}
-
-int
-DirectFB_GL_LoadLibrary(_THIS, const char *path)
-{
-    void *handle = NULL;
-
-    SDL_DFB_DEBUG("Loadlibrary : %s\n", path);
-
-    if (_this->gl_data->gl_active) {
-        return SDL_SetError("OpenGL context already created");
-    }
-
-
-    if (path == NULL) {
-        path = SDL_getenv("SDL_VIDEO_GL_DRIVER");
-        if (path == NULL) {
-            path = "libGL.so";
-        }
-    }
-
-    handle = GL_LoadObject(path);
-    if (handle == NULL) {
-        SDL_DFB_ERR("Library not found: %s\n", path);
-        /* SDL_LoadObject() will call SDL_SetError() for us. */
-        return -1;
-    }
-
-    SDL_DFB_DEBUG("Loaded library: %s\n", path);
-
-    _this->gl_config.dll_handle = handle;
-    _this->gl_config.driver_loaded = 1;
-    if (path) {
-        SDL_strlcpy(_this->gl_config.driver_path, path,
-                    SDL_arraysize(_this->gl_config.driver_path));
-    } else {
-        *_this->gl_config.driver_path = '\0';
-    }
-
-    _this->gl_data->glFinish = DirectFB_GL_GetProcAddress(_this, "glFinish");
-    _this->gl_data->glFlush = DirectFB_GL_GetProcAddress(_this, "glFlush");
-
-    return 0;
-}
-
-static void
-DirectFB_GL_UnloadLibrary(_THIS)
-{
- #if 0
-    int ret;
-
-    if (_this->gl_config.driver_loaded) {
-
-        ret = GL_UnloadObject(_this->gl_config.dll_handle);
-        if (ret)
-            SDL_DFB_ERR("Error #%d trying to unload library.\n", ret);
-        _this->gl_config.dll_handle = NULL;
-        _this->gl_config.driver_loaded = 0;
-    }
-#endif
-    /* Free OpenGL memory */
-    SDL_free(_this->gl_data);
-    _this->gl_data = NULL;
-}
-
-void *
-DirectFB_GL_GetProcAddress(_THIS, const char *proc)
-{
-    void *handle;
-
-    handle = _this->gl_config.dll_handle;
-    return GL_LoadFunction(handle, proc);
-}
-
-SDL_GLContext
-DirectFB_GL_CreateContext(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-    DirectFB_GLContext *context;
-
-    SDL_DFB_ALLOC_CLEAR(context, sizeof(DirectFB_GLContext));
-
-    SDL_DFB_CHECKERR(windata->surface->GetGL(windata->surface,
-                                             &context->context));
-
-    if (!context->context)
-        return NULL;
-
-    context->is_locked = 0;
-    context->sdl_window = window;
-
-    context->next = _this->gl_data->firstgl;
-    _this->gl_data->firstgl = context;
-
-    SDL_DFB_CHECK(context->context->Unlock(context->context));
-
-    if (DirectFB_GL_MakeCurrent(_this, window, context) < 0) {
-        DirectFB_GL_DeleteContext(_this, context);
-        return NULL;
-    }
-
-    return context;
-
-  error:
-    return NULL;
-}
-
-int
-DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
-{
-    DirectFB_GLContext *ctx = (DirectFB_GLContext *) context;
-    DirectFB_GLContext *p;
-
-    for (p = _this->gl_data->firstgl; p; p = p->next)
-    {
-       if (p->is_locked) {
-         SDL_DFB_CHECKERR(p->context->Unlock(p->context));
-         p->is_locked = 0;
-       }
-
-    }
-
-    if (ctx != NULL) {
-        SDL_DFB_CHECKERR(ctx->context->Lock(ctx->context));
-        ctx->is_locked = 1;
-    }
-
-    return 0;
-  error:
-    return -1;
-}
-
-int
-DirectFB_GL_SetSwapInterval(_THIS, int interval)
-{
-    return SDL_Unsupported();
-}
-
-int
-DirectFB_GL_GetSwapInterval(_THIS)
-{
-    return 0;
-}
-
-void
-DirectFB_GL_SwapWindow(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-    DFBRegion region;
-    DirectFB_GLContext *p;
-
-    region.x1 = 0;
-    region.y1 = 0;
-    region.x2 = window->w;
-    region.y2 = window->h;
-
-#if 0
-    if (devdata->glFinish)
-        devdata->glFinish();
-    else if (devdata->glFlush)
-        devdata->glFlush();
-#endif
-
-    for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
-        if (p->sdl_window == window && p->is_locked)
-        {
-            SDL_DFB_CHECKERR(p->context->Unlock(p->context));
-            p->is_locked = 0;
-        }
-
-    SDL_DFB_CHECKERR(windata->window_surface->Flip(windata->window_surface,NULL,  DSFLIP_PIPELINE |DSFLIP_BLIT | DSFLIP_ONSYNC ));
-    return;
-  error:
-    return;
-}
-
-void
-DirectFB_GL_DeleteContext(_THIS, SDL_GLContext context)
-{
-    DirectFB_GLContext *ctx = (DirectFB_GLContext *) context;
-    DirectFB_GLContext *p;
-
-    if (ctx->is_locked)
-        SDL_DFB_CHECK(ctx->context->Unlock(ctx->context));
-    SDL_DFB_RELEASE(ctx->context);
-
-    for (p = _this->gl_data->firstgl; p && p->next != ctx; p = p->next)
-        ;
-    if (p)
-        p->next = ctx->next;
-    else
-        _this->gl_data->firstgl = ctx->next;
-
-    SDL_DFB_FREE(ctx);
-}
-
-void
-DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window)
-{
-    DirectFB_GLContext *p;
-
-    for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
-        if (p->sdl_window == window)
-        {
-            if (p->is_locked)
-                SDL_DFB_CHECK(p->context->Unlock(p->context));
-            SDL_DFB_RELEASE(p->context);
-        }
-}
-
-void
-DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window)
-{
-    DirectFB_GLContext *p;
-
-    for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
-        if (p->sdl_window == window)
-        {
-            SDL_DFB_WINDOWDATA(window);
-            SDL_DFB_CHECK(windata->surface->GetGL(windata->surface,
-                                             &p->context));
-            if (p->is_locked)
-                SDL_DFB_CHECK(p->context->Lock(p->context));
-            }
-}
-
-void
-DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window)
-{
-    DirectFB_GLContext *p;
-
-    for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
-        if (p->sdl_window == window)
-            DirectFB_GL_DeleteContext(_this, p);
-}
-
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_opengl.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_opengl.h
deleted file mode 100644
index efb11f7..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_opengl.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef _SDL_directfb_opengl_h
-#define _SDL_directfb_opengl_h
-
-#include "SDL_DirectFB_video.h"
-
-#if SDL_DIRECTFB_OPENGL
-
-#include "SDL_opengl.h"
-
-typedef struct _DirectFB_GLContext DirectFB_GLContext;
-struct _DirectFB_GLContext
-{
-    IDirectFBGL         *context;
-    DirectFB_GLContext  *next;
-
-    SDL_Window          *sdl_window;
-    int                 is_locked;
-};
-
-/* OpenGL functions */
-extern int DirectFB_GL_Initialize(_THIS);
-extern void DirectFB_GL_Shutdown(_THIS);
-
-extern int DirectFB_GL_LoadLibrary(_THIS, const char *path);
-extern void *DirectFB_GL_GetProcAddress(_THIS, const char *proc);
-extern SDL_GLContext DirectFB_GL_CreateContext(_THIS, SDL_Window * window);
-extern int DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window,
-                                   SDL_GLContext context);
-extern int DirectFB_GL_SetSwapInterval(_THIS, int interval);
-extern int DirectFB_GL_GetSwapInterval(_THIS);
-extern void DirectFB_GL_SwapWindow(_THIS, SDL_Window * window);
-extern void DirectFB_GL_DeleteContext(_THIS, SDL_GLContext context);
-
-extern void DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window);
-extern void DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window);
-extern void DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window);
-
-#endif /* SDL_DIRECTFB_OPENGL */
-
-#endif /* _SDL_directfb_opengl_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_render.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_render.c
deleted file mode 100644
index 219f520..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_render.c
+++ /dev/null
@@ -1,1328 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-#include "SDL_DirectFB_window.h"
-#include "SDL_DirectFB_modes.h"
-
-#include "SDL_syswm.h"
-#include "SDL_DirectFB_shape.h"
-
-#include "../SDL_sysvideo.h"
-#include "../../render/SDL_sysrender.h"
-
-#ifndef DFB_VERSION_ATLEAST
-
-#define DFB_VERSIONNUM(X, Y, Z)                     \
-    ((X)*1000 + (Y)*100 + (Z))
-
-#define DFB_COMPILEDVERSION \
-    DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
-
-#define DFB_VERSION_ATLEAST(X, Y, Z) \
-    (DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
-
-#define SDL_DFB_CHECK(x)    x
-
-#endif
-
-/* the following is not yet tested ... */
-#define USE_DISPLAY_PALETTE         (0)
-
-
-#define SDL_DFB_RENDERERDATA(rend) DirectFB_RenderData *renddata = ((rend) ? (DirectFB_RenderData *) (rend)->driverdata : NULL)
-
-
-/* GDI renderer implementation */
-
-static SDL_Renderer *DirectFB_CreateRenderer(SDL_Window * window,
-                                             Uint32 flags);
-static void DirectFB_ActivateRenderer(SDL_Renderer * renderer);
-static int DirectFB_CreateTexture(SDL_Renderer * renderer,
-                                  SDL_Texture * texture);
-static int DirectFB_QueryTexturePixels(SDL_Renderer * renderer,
-                                       SDL_Texture * texture,
-                                       void **pixels, int *pitch);
-static int DirectFB_SetTexturePalette(SDL_Renderer * renderer,
-                                      SDL_Texture * texture,
-                                      const SDL_Color * colors,
-                                      int firstcolor, int ncolors);
-static int DirectFB_GetTexturePalette(SDL_Renderer * renderer,
-                                      SDL_Texture * texture,
-                                      SDL_Color * colors,
-                                      int firstcolor, int ncolors);
-static int DirectFB_SetTextureAlphaMod(SDL_Renderer * renderer,
-                                       SDL_Texture * texture);
-static int DirectFB_SetTextureColorMod(SDL_Renderer * renderer,
-                                       SDL_Texture * texture);
-static int DirectFB_SetTextureBlendMode(SDL_Renderer * renderer,
-                                        SDL_Texture * texture);
-static int DirectFB_SetTextureScaleMode(SDL_Renderer * renderer,
-                                        SDL_Texture * texture);
-static int DirectFB_UpdateTexture(SDL_Renderer * renderer,
-                                  SDL_Texture * texture,
-                                  const SDL_Rect * rect,
-                                  const void *pixels, int pitch);
-static int DirectFB_LockTexture(SDL_Renderer * renderer,
-                                SDL_Texture * texture,
-                                const SDL_Rect * rect,
-                                void **pixels, int *pitch);
-static void DirectFB_UnlockTexture(SDL_Renderer * renderer,
-                                   SDL_Texture * texture);
-static void DirectFB_DirtyTexture(SDL_Renderer * renderer,
-                                  SDL_Texture * texture, int numrects,
-                                  const SDL_Rect * rects);
-static int DirectFB_SetDrawBlendMode(SDL_Renderer * renderer);
-static int DirectFB_RenderDrawPoints(SDL_Renderer * renderer,
-                                const SDL_FPoint * points, int count);
-static int DirectFB_RenderDrawLines(SDL_Renderer * renderer,
-                               const SDL_FPoint * points, int count);
-static int DirectFB_RenderDrawRects(SDL_Renderer * renderer,
-        const SDL_Rect ** rects, int count);
-static int DirectFB_RenderFillRects(SDL_Renderer * renderer,
-        const SDL_FRect * rects, int count);
-static int DirectFB_RenderCopy(SDL_Renderer * renderer,
-                               SDL_Texture * texture,
-                               const SDL_Rect * srcrect,
-                               const SDL_FRect * dstrect);
-static void DirectFB_RenderPresent(SDL_Renderer * renderer);
-static void DirectFB_DestroyTexture(SDL_Renderer * renderer,
-                                    SDL_Texture * texture);
-static void DirectFB_DestroyRenderer(SDL_Renderer * renderer);
-static int DirectFB_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                     Uint32 format, void * pixels, int pitch);
-static int DirectFB_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                      Uint32 format, const void * pixels, int pitch);
-static int DirectFB_UpdateViewport(SDL_Renderer * renderer);
-static int DirectFB_UpdateClipRect(SDL_Renderer * renderer);
-static int DirectFB_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
-
-static int PrepareDraw(SDL_Renderer * renderer);
-
-
-#define SDL_DFB_WINDOWSURFACE(win)  IDirectFBSurface *destsurf = ((DFB_WindowData *) ((win)->driverdata))->surface;
-
-SDL_RenderDriver DirectFB_RenderDriver = {
-    DirectFB_CreateRenderer,
-    {
-     "directfb",
-     (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
-     /* (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
-      SDL_TEXTUREMODULATE_ALPHA),
-      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND |
-      SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
-     (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST |
-      SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST), */
-     0,
-     {
-             /* formats filled in later */
-     },
-     0,
-     0}
-};
-
-typedef struct
-{
-    SDL_Window *window;
-    DFBSurfaceFlipFlags flipflags;
-    int size_changed;
-    int lastBlendMode;
-    DFBSurfaceBlittingFlags blitFlags;
-    DFBSurfaceDrawingFlags drawFlags;
-    IDirectFBSurface* target;
-} DirectFB_RenderData;
-
-typedef struct
-{
-    IDirectFBSurface *surface;
-    Uint32 format;
-    void *pixels;
-    int pitch;
-    IDirectFBPalette *palette;
-    int isDirty;
-
-    SDL_VideoDisplay *display;      /* only for yuv textures */
-
-#if (DFB_VERSION_ATLEAST(1,2,0))
-    DFBSurfaceRenderOptions render_options;
-#endif
-} DirectFB_TextureData;
-
-static SDL_INLINE void
-SDLtoDFBRect(const SDL_Rect * sr, DFBRectangle * dr)
-{
-    dr->x = sr->x;
-    dr->y = sr->y;
-    dr->h = sr->h;
-    dr->w = sr->w;
-}
-static SDL_INLINE void
-SDLtoDFBRect_Float(const SDL_FRect * sr, DFBRectangle * dr)
-{
-    dr->x = sr->x;
-    dr->y = sr->y;
-    dr->h = sr->h;
-    dr->w = sr->w;
-}
-
-
-static int
-TextureHasAlpha(DirectFB_TextureData * data)
-{
-    /* Drawing primitive ? */
-    if (!data)
-        return 0;
-
-    return (DFB_PIXELFORMAT_HAS_ALPHA(DirectFB_SDLToDFBPixelFormat(data->format)) ? 1 : 0);
-#if 0
-    switch (data->format) {
-    case SDL_PIXELFORMAT_INDEX4LSB:
-    case SDL_PIXELFORMAT_INDEX4MSB:
-    case SDL_PIXELFORMAT_ARGB4444:
-    case SDL_PIXELFORMAT_ARGB1555:
-    case SDL_PIXELFORMAT_ARGB8888:
-    case SDL_PIXELFORMAT_RGBA8888:
-    case SDL_PIXELFORMAT_ABGR8888:
-    case SDL_PIXELFORMAT_BGRA8888:
-    case SDL_PIXELFORMAT_ARGB2101010:
-       return 1;
-    default:
-        return 0;
-    }
-#endif
-}
-
-static SDL_INLINE IDirectFBSurface *get_dfb_surface(SDL_Window *window)
-{
-    SDL_SysWMinfo wm_info;
-    SDL_memset(&wm_info, 0, sizeof(SDL_SysWMinfo));
-
-    SDL_VERSION(&wm_info.version);
-    SDL_GetWindowWMInfo(window, &wm_info);
-
-    return wm_info.info.dfb.surface;
-}
-
-static SDL_INLINE IDirectFBWindow *get_dfb_window(SDL_Window *window)
-{
-    SDL_SysWMinfo wm_info;
-    SDL_memset(&wm_info, 0, sizeof(SDL_SysWMinfo));
-
-    SDL_VERSION(&wm_info.version);
-    SDL_GetWindowWMInfo(window, &wm_info);
-
-    return wm_info.info.dfb.window;
-}
-
-static void
-SetBlendMode(DirectFB_RenderData * data, int blendMode,
-             DirectFB_TextureData * source)
-{
-    IDirectFBSurface *destsurf = data->target;
-
-    /* FIXME: check for format change */
-    if (1 || data->lastBlendMode != blendMode) {
-        switch (blendMode) {
-        case SDL_BLENDMODE_NONE:
-                                           /**< No blending */
-            data->blitFlags = DSBLIT_NOFX;
-            data->drawFlags = DSDRAW_NOFX;
-            SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE));
-            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO));
-            break;
-#if 0
-        case SDL_BLENDMODE_MASK:
-            data->blitFlags =  DSBLIT_BLEND_ALPHACHANNEL;
-            data->drawFlags = DSDRAW_BLEND;
-            SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA));
-            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA));
-            break;
-#endif
-        case SDL_BLENDMODE_BLEND:
-            data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
-            data->drawFlags = DSDRAW_BLEND;
-            SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA));
-            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA));
-            break;
-        case SDL_BLENDMODE_ADD:
-            data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
-            data->drawFlags = DSDRAW_BLEND;
-            /* FIXME: SRCALPHA kills performance on radeon ...
-             * It will be cheaper to copy the surface to a temporary surface and premultiply
-             */
-            if (source && TextureHasAlpha(source))
-                SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA));
-            else
-                SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE));
-            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_ONE));
-            break;
-        case SDL_BLENDMODE_MOD:
-            data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
-            data->drawFlags = DSDRAW_BLEND;
-            SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_ZERO));
-            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_SRCCOLOR));
-
-            break;
-        }
-        data->lastBlendMode = blendMode;
-    }
-}
-
-static int
-DisplayPaletteChanged(void *userdata, SDL_Palette * palette)
-{
-#if USE_DISPLAY_PALETTE
-    DirectFB_RenderData *data = (DirectFB_RenderData *) userdata;
-    SDL_DFB_WINDOWSURFACE(data->window);
-    IDirectFBPalette *surfpal;
-
-    int i;
-    int ncolors;
-    DFBColor entries[256];
-
-    SDL_DFB_CHECKERR(destsurf->GetPalette(destsurf, &surfpal));
-
-    /* FIXME: number of colors */
-    ncolors = (palette->ncolors < 256 ? palette->ncolors : 256);
-
-    for (i = 0; i < ncolors; ++i) {
-        entries[i].r = palette->colors[i].r;
-        entries[i].g = palette->colors[i].g;
-        entries[i].b = palette->colors[i].b;
-        entries[i].a = palette->colors[i].a;
-    }
-    SDL_DFB_CHECKERR(surfpal->SetEntries(surfpal, entries, ncolors, 0));
-    return 0;
-  error:
-#else
-    SDL_Unsupported();
-#endif
-    return -1;
-}
-
-static void
-DirectFB_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
-{
-    SDL_DFB_RENDERERDATA(renderer);
-
-    if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
-        /* Rebind the context to the window area and update matrices */
-        /* SDL_CurrentContext = NULL; */
-        /* data->updateSize = SDL_TRUE; */
-        renddata->size_changed = SDL_TRUE;
-   }
-}
-
-int
-DirectFB_RenderClear(SDL_Renderer * renderer)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *destsurf = data->target;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    PrepareDraw(renderer);
-
-    destsurf->Clear(destsurf, renderer->r, renderer->g, renderer->b, renderer->a);
-
-
-    return 0;
-}
-
-SDL_Renderer *
-DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags)
-{
-    IDirectFBSurface *winsurf = get_dfb_surface(window);
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_Renderer *renderer = NULL;
-    DirectFB_RenderData *data = NULL;
-    DFBSurfaceCapabilities scaps;
-
-    SDL_DFB_ALLOC_CLEAR(renderer, sizeof(*renderer));
-    SDL_DFB_ALLOC_CLEAR(data, sizeof(*data));
-
-    renderer->WindowEvent = DirectFB_WindowEvent;
-    renderer->CreateTexture = DirectFB_CreateTexture;
-    renderer->SetTextureAlphaMod = DirectFB_SetTextureAlphaMod;
-    renderer->SetTextureColorMod = DirectFB_SetTextureColorMod;
-    renderer->SetTextureBlendMode = DirectFB_SetTextureBlendMode;
-    renderer->UpdateTexture = DirectFB_UpdateTexture;
-    renderer->LockTexture = DirectFB_LockTexture;
-    renderer->RenderClear = DirectFB_RenderClear;
-    renderer->UnlockTexture = DirectFB_UnlockTexture;
-    renderer->RenderDrawPoints = DirectFB_RenderDrawPoints;
-    renderer->RenderDrawLines = DirectFB_RenderDrawLines;
-    /* SetDrawColor - no needed */
-    renderer->RenderFillRects = DirectFB_RenderFillRects;
-
-    renderer->RenderCopy = DirectFB_RenderCopy;
-    renderer->RenderPresent = DirectFB_RenderPresent;
-
-    /* FIXME: Yet to be tested */
-    renderer->RenderReadPixels = DirectFB_RenderReadPixels;
-    /* renderer->RenderWritePixels = DirectFB_RenderWritePixels; */
-
-    renderer->DestroyTexture = DirectFB_DestroyTexture;
-    renderer->DestroyRenderer = DirectFB_DestroyRenderer;
-    renderer->UpdateViewport = DirectFB_UpdateViewport;
-    renderer->UpdateClipRect = DirectFB_UpdateClipRect;
-    renderer->SetRenderTarget = DirectFB_SetRenderTarget;
-
-#if 0
-    renderer->QueryTexturePixels = DirectFB_QueryTexturePixels;
-    renderer->SetTexturePalette = DirectFB_SetTexturePalette;
-    renderer->GetTexturePalette = DirectFB_GetTexturePalette;
-    renderer->SetTextureScaleMode = DirectFB_SetTextureScaleMode;
-    renderer->DirtyTexture = DirectFB_DirtyTexture;
-    renderer->SetDrawBlendMode = DirectFB_SetDrawBlendMode;
-    renderer->RenderDrawRects = DirectFB_RenderDrawRects;
-#endif
-
-    renderer->info = DirectFB_RenderDriver.info;
-    renderer->window = window;      /* SDL window */
-    renderer->driverdata = data;
-
-    renderer->info.flags =
-        SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE;
-
-    data->window = window;
-    data->target = winsurf;
-
-    data->flipflags = DSFLIP_PIPELINE | DSFLIP_BLIT;
-
-    if (flags & SDL_RENDERER_PRESENTVSYNC) {
-        data->flipflags |= DSFLIP_WAITFORSYNC | DSFLIP_ONSYNC;
-        renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
-    } else
-        data->flipflags |= DSFLIP_ONSYNC;
-
-    SDL_DFB_CHECKERR(winsurf->GetCapabilities(winsurf, &scaps));
-
-#if 0
-    if (scaps & DSCAPS_DOUBLE)
-        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
-    else if (scaps & DSCAPS_TRIPLE)
-        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
-    else
-        renderer->info.flags |= SDL_RENDERER_SINGLEBUFFER;
-#endif
-
-    DirectFB_SetSupportedPixelFormats(&renderer->info);
-
-#if 0
-    /* Set up a palette watch on the display palette */
-    if (display-> palette) {
-        SDL_AddPaletteWatch(display->palette, DisplayPaletteChanged, data);
-    }
-#endif
-
-    return renderer;
-
-  error:
-    SDL_DFB_FREE(renderer);
-    SDL_DFB_FREE(data);
-    return NULL;
-}
-
-static void
-DirectFB_ActivateRenderer(SDL_Renderer * renderer)
-{
-    SDL_DFB_RENDERERDATA(renderer);
-    SDL_Window *window = renderer->window;
-    SDL_DFB_WINDOWDATA(window);
-
-    if (renddata->size_changed /* || windata->wm_needs_redraw */) {
-        renddata->size_changed = SDL_FALSE;
-    }
-}
-
-
-static int
-DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    SDL_Window *window = renderer->window;
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_DFB_DEVICEDATA(display->device);
-    DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
-    DirectFB_TextureData *data = texture->driverdata;
-    DFBDisplayLayerConfig layconf;
-    DFBResult ret;
-
-    if (devdata->use_yuv_direct && (dispdata->vidID >= 0)
-        && (!dispdata->vidIDinuse)
-        && SDL_ISPIXELFORMAT_FOURCC(data->format)) {
-        layconf.flags =
-            DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT |
-            DLCONF_SURFACE_CAPS;
-        layconf.width = texture->w;
-        layconf.height = texture->h;
-        layconf.pixelformat = DirectFB_SDLToDFBPixelFormat(data->format);
-        layconf.surface_caps = DSCAPS_VIDEOONLY | DSCAPS_DOUBLE;
-
-        SDL_DFB_CHECKERR(devdata->dfb->GetDisplayLayer(devdata->dfb,
-                                                       dispdata->vidID,
-                                                       &dispdata->vidlayer));
-        SDL_DFB_CHECKERR(dispdata->
-                         vidlayer->SetCooperativeLevel(dispdata->vidlayer,
-                                                       DLSCL_EXCLUSIVE));
-
-        if (devdata->use_yuv_underlays) {
-            ret = dispdata->vidlayer->SetLevel(dispdata->vidlayer, -1);
-            if (ret != DFB_OK)
-                SDL_DFB_DEBUG("Underlay Setlevel not supported\n");
-        }
-        SDL_DFB_CHECKERR(dispdata->
-                         vidlayer->SetConfiguration(dispdata->vidlayer,
-                                                    &layconf));
-        SDL_DFB_CHECKERR(dispdata->
-                         vidlayer->GetSurface(dispdata->vidlayer,
-                                              &data->surface));
-        dispdata->vidIDinuse = 1;
-        data->display = display;
-        return 0;
-    }
-    return 1;
-  error:
-    if (dispdata->vidlayer) {
-        SDL_DFB_RELEASE(data->surface);
-        SDL_DFB_CHECKERR(dispdata->
-                         vidlayer->SetCooperativeLevel(dispdata->vidlayer,
-                                                       DLSCL_ADMINISTRATIVE));
-        SDL_DFB_RELEASE(dispdata->vidlayer);
-    }
-    return 1;
-}
-
-static int
-DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    SDL_Window *window = renderer->window;
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_DFB_DEVICEDATA(display->device);
-    DirectFB_TextureData *data;
-    DFBSurfaceDescription dsc;
-    DFBSurfacePixelFormat pixelformat;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    SDL_DFB_ALLOC_CLEAR(data, sizeof(*data));
-    texture->driverdata = data;
-
-    /* find the right pixelformat */
-    pixelformat = DirectFB_SDLToDFBPixelFormat(texture->format);
-    if (pixelformat == DSPF_UNKNOWN) {
-        SDL_SetError("Unknown pixel format %d\n", data->format);
-        goto error;
-    }
-
-    data->format = texture->format;
-    data->pitch = texture->w * DFB_BYTES_PER_PIXEL(pixelformat);
-
-    if (DirectFB_AcquireVidLayer(renderer, texture) != 0) {
-        /* fill surface description */
-        dsc.flags =
-            DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
-        dsc.width = texture->w;
-        dsc.height = texture->h;
-        if(texture->format == SDL_PIXELFORMAT_YV12 ||
-           texture->format == SDL_PIXELFORMAT_IYUV) {
-           /* dfb has problems with odd sizes -make them even internally */
-           dsc.width += (dsc.width % 2);
-           dsc.height += (dsc.height % 2);
-        }
-        /* <1.2 Never use DSCAPS_VIDEOONLY here. It kills performance
-         * No DSCAPS_SYSTEMONLY either - let dfb decide
-         * 1.2: DSCAPS_SYSTEMONLY boosts performance by factor ~8
-         * Depends on other settings as well. Let dfb decide.
-         */
-        dsc.caps = DSCAPS_PREMULTIPLIED;
-#if 0
-        if (texture->access == SDL_TEXTUREACCESS_STREAMING)
-            dsc.caps |= DSCAPS_SYSTEMONLY;
-        else
-            dsc.caps |= DSCAPS_VIDEOONLY;
-#endif
-
-        dsc.pixelformat = pixelformat;
-        data->pixels = NULL;
-
-        /* Create the surface */
-        SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc,
-                                                     &data->surface));
-        if (SDL_ISPIXELFORMAT_INDEXED(data->format)
-            && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
-#if 1
-            SDL_DFB_CHECKERR(data->surface->GetPalette(data->surface, &data->palette));
-#else
-            /* DFB has issues with blitting LUT8 surfaces.
-             * Creating a new palette does not help.
-             */
-            DFBPaletteDescription pal_desc;
-            pal_desc.flags = DPDESC_SIZE; /* | DPDESC_ENTRIES */
-            pal_desc.size = 256;
-            SDL_DFB_CHECKERR(devdata->dfb->CreatePalette(devdata->dfb, &pal_desc,&data->palette));
-            SDL_DFB_CHECKERR(data->surface->SetPalette(data->surface, data->palette));
-#endif
-        }
-
-    }
-#if (DFB_VERSION_ATLEAST(1,2,0))
-    data->render_options = DSRO_NONE;
-#endif
-    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
-        /* 3 plane YUVs return 1 bpp, but we need more space for other planes */
-        if(texture->format == SDL_PIXELFORMAT_YV12 ||
-           texture->format == SDL_PIXELFORMAT_IYUV) {
-            SDL_DFB_ALLOC_CLEAR(data->pixels, (texture->h * data->pitch  + ((texture->h + texture->h % 2) * (data->pitch + data->pitch % 2) * 2) / 4));
-        } else {
-            SDL_DFB_ALLOC_CLEAR(data->pixels, texture->h * data->pitch);
-        }
-    }
-
-    return 0;
-
-  error:
-    SDL_DFB_RELEASE(data->palette);
-    SDL_DFB_RELEASE(data->surface);
-    SDL_DFB_FREE(texture->driverdata);
-    return -1;
-}
-
-static int
-DirectFB_QueryTexturePixels(SDL_Renderer * renderer,
-                            SDL_Texture * texture, void **pixels, int *pitch)
-{
-    DirectFB_TextureData *texturedata =
-        (DirectFB_TextureData *) texture->driverdata;
-
-    if (texturedata->display) {
-        return -1;
-    } else {
-        *pixels = texturedata->pixels;
-        *pitch = texturedata->pitch;
-    }
-    return 0;
-}
-
-static int
-DirectFB_SetTexturePalette(SDL_Renderer * renderer,
-                           SDL_Texture * texture,
-                           const SDL_Color * colors, int firstcolor,
-                           int ncolors)
-{
-    DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
-    if (SDL_ISPIXELFORMAT_INDEXED(data->format)
-        && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
-        DFBColor entries[256];
-        int i;
-
-        if (ncolors > 256)
-            ncolors = 256;
-
-        for (i = 0; i < ncolors; ++i) {
-            entries[i].r = colors[i].r;
-            entries[i].g = colors[i].g;
-            entries[i].b = colors[i].b;
-            entries[i].a = 0xff;
-        }
-        SDL_DFB_CHECKERR(data->
-                         palette->SetEntries(data->palette, entries, ncolors, firstcolor));
-        return 0;
-    } else {
-        return SDL_SetError("YUV textures don't have a palette");
-    }
-  error:
-    return -1;
-}
-
-static int
-DirectFB_GetTexturePalette(SDL_Renderer * renderer,
-                           SDL_Texture * texture, SDL_Color * colors,
-                           int firstcolor, int ncolors)
-{
-    DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
-
-    if (SDL_ISPIXELFORMAT_INDEXED(data->format)
-        && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
-        DFBColor entries[256];
-        int i;
-
-        SDL_DFB_CHECKERR(data->
-                         palette->GetEntries(data->palette, entries, ncolors,
-                                             firstcolor));
-
-        for (i = 0; i < ncolors; ++i) {
-            colors[i].r = entries[i].r;
-            colors[i].g = entries[i].g;
-            colors[i].b = entries[i].b;
-            colors[i].a = SDL_ALPHA_OPAQUE;
-        }
-        return 0;
-    } else {
-        return SDL_SetError("YUV textures don't have a palette");
-    }
-  error:
-    return -1;
-}
-
-static int
-DirectFB_SetTextureAlphaMod(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    return 0;
-}
-
-static int
-DirectFB_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    return 0;
-}
-
-static int
-DirectFB_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    switch (texture->blendMode) {
-    case SDL_BLENDMODE_NONE:
-    /* case SDL_BLENDMODE_MASK: */
-    case SDL_BLENDMODE_BLEND:
-    case SDL_BLENDMODE_ADD:
-    case SDL_BLENDMODE_MOD:
-        return 0;
-    default:
-        texture->blendMode = SDL_BLENDMODE_NONE;
-        return SDL_Unsupported();
-    }
-}
-
-static int
-DirectFB_SetDrawBlendMode(SDL_Renderer * renderer)
-{
-    switch (renderer->blendMode) {
-    case SDL_BLENDMODE_NONE:
-    /* case SDL_BLENDMODE_MASK: */
-    case SDL_BLENDMODE_BLEND:
-    case SDL_BLENDMODE_ADD:
-    case SDL_BLENDMODE_MOD:
-        return 0;
-    default:
-        renderer->blendMode = SDL_BLENDMODE_NONE;
-        return SDL_Unsupported();
-    }
-}
-
-#if 0
-static int
-DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-#if (DFB_VERSION_ATLEAST(1,2,0))
-
-    DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
-
-    switch (texture->scaleMode) {
-    case SDL_SCALEMODE_NONE:
-    case SDL_SCALEMODE_FAST:
-        data->render_options = DSRO_NONE;
-        break;
-    case SDL_SCALEMODE_SLOW:
-        data->render_options = DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE;
-        break;
-    case SDL_SCALEMODE_BEST:
-        data->render_options =
-            DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE | DSRO_ANTIALIAS;
-        break;
-    default:
-        data->render_options = DSRO_NONE;
-        texture->scaleMode = SDL_SCALEMODE_NONE;
-        return SDL_Unsupported();
-    }
-#endif
-    return 0;
-}
-#endif
-
-static int
-DirectFB_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                       const SDL_Rect * rect, const void *pixels, int pitch)
-{
-    DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
-    Uint8 *dpixels;
-    int dpitch;
-    Uint8 *src, *dst;
-    int row;
-    size_t length;
-    int bpp = DFB_BYTES_PER_PIXEL(DirectFB_SDLToDFBPixelFormat(texture->format));
-    /* FIXME: SDL_BYTESPERPIXEL(texture->format) broken for yuv yv12 3 planes */
-
-    DirectFB_ActivateRenderer(renderer);
-
-    if ((texture->format == SDL_PIXELFORMAT_YV12) ||
-        (texture->format == SDL_PIXELFORMAT_IYUV)) {
-        bpp = 1;
-    }
-
-    SDL_DFB_CHECKERR(data->surface->Lock(data->surface,
-                                         DSLF_WRITE | DSLF_READ,
-                                         ((void **) &dpixels), &dpitch));
-    src = (Uint8 *) pixels;
-    dst = (Uint8 *) dpixels + rect->y * dpitch + rect->x * bpp;
-    length = rect->w * bpp;
-    for (row = 0; row < rect->h; ++row) {
-        SDL_memcpy(dst, src, length);
-        src += pitch;
-        dst += dpitch;
-    }
-    /* copy other planes for 3 plane formats */
-    if ((texture->format == SDL_PIXELFORMAT_YV12) ||
-        (texture->format == SDL_PIXELFORMAT_IYUV)) {
-        src = (Uint8 *) pixels + texture->h * pitch;
-        dst = (Uint8 *) dpixels + texture->h * dpitch + rect->y * dpitch / 4 + rect->x * bpp / 2;
-        for (row = 0; row < rect->h / 2 + (rect->h & 1); ++row) {
-            SDL_memcpy(dst, src, length / 2);
-            src += pitch / 2;
-            dst += dpitch / 2;
-        }
-        src = (Uint8 *) pixels + texture->h * pitch + texture->h * pitch / 4;
-        dst = (Uint8 *) dpixels + texture->h * dpitch + texture->h * dpitch / 4 + rect->y * dpitch / 4 + rect->x * bpp / 2;
-        for (row = 0; row < rect->h / 2 + (rect->h & 1); ++row) {
-            SDL_memcpy(dst, src, length / 2);
-            src += pitch / 2;
-            dst += dpitch / 2;
-        }
-    }
-    SDL_DFB_CHECKERR(data->surface->Unlock(data->surface));
-    data->isDirty = 0;
-    return 0;
-  error:
-    return 1;
-
-}
-
-static int
-DirectFB_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                     const SDL_Rect * rect, void **pixels, int *pitch)
-{
-    DirectFB_TextureData *texturedata =
-        (DirectFB_TextureData *) texture->driverdata;
-
-    DirectFB_ActivateRenderer(renderer);
-
-#if 0
-    if (markDirty) {
-        SDL_AddDirtyRect(&texturedata->dirty, rect);
-    }
-#endif
-
-    if (texturedata->display) {
-        void *fdata;
-        int fpitch;
-
-        SDL_DFB_CHECKERR(texturedata->surface->Lock(texturedata->surface,
-                                                    DSLF_WRITE | DSLF_READ,
-                                                    &fdata, &fpitch));
-        *pitch = fpitch;
-        *pixels = fdata;
-    } else {
-        *pixels =
-            (void *) ((Uint8 *) texturedata->pixels +
-                      rect->y * texturedata->pitch +
-                      rect->x * DFB_BYTES_PER_PIXEL(DirectFB_SDLToDFBPixelFormat(texture->format)));
-        *pitch = texturedata->pitch;
-        texturedata->isDirty = 1;
-    }
-    return 0;
-
-  error:
-    return -1;
-}
-
-static void
-DirectFB_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    DirectFB_TextureData *texturedata =
-        (DirectFB_TextureData *) texture->driverdata;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    if (texturedata->display) {
-        SDL_DFB_CHECK(texturedata->surface->Unlock(texturedata->surface));
-        texturedata->pixels = NULL;
-    }
-}
-
-#if 0
-static void
-DirectFB_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture,
-                      int numrects, const SDL_Rect * rects)
-{
-    DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
-    int i;
-
-    for (i = 0; i < numrects; ++i) {
-        SDL_AddDirtyRect(&data->dirty, &rects[i]);
-    }
-}
-#endif
-
-static int DirectFB_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    DirectFB_TextureData *tex_data = NULL;
-
-    DirectFB_ActivateRenderer(renderer);
-    if (texture) {
-        tex_data = (DirectFB_TextureData *) texture->driverdata;
-        data->target = tex_data->surface;
-    } else {
-        data->target = get_dfb_surface(data->window);
-    }
-    data->lastBlendMode = 0;
-    return 0;
-}
-
-
-static int
-PrepareDraw(SDL_Renderer * renderer)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *destsurf = data->target;
-
-    Uint8 r, g, b, a;
-
-    r = renderer->r;
-    g = renderer->g;
-    b = renderer->b;
-    a = renderer->a;
-
-    SetBlendMode(data, renderer->blendMode, NULL);
-    SDL_DFB_CHECKERR(destsurf->SetDrawingFlags(destsurf, data->drawFlags));
-
-    switch (renderer->blendMode) {
-    case SDL_BLENDMODE_NONE:
-    /* case SDL_BLENDMODE_MASK: */
-    case SDL_BLENDMODE_BLEND:
-        break;
-    case SDL_BLENDMODE_ADD:
-    case SDL_BLENDMODE_MOD:
-        r = ((int) r * (int) a) / 255;
-        g = ((int) g * (int) a) / 255;
-        b = ((int) b * (int) a) / 255;
-        a = 255;
-        break;
-    }
-
-    SDL_DFB_CHECKERR(destsurf->SetColor(destsurf, r, g, b, a));
-    return 0;
-  error:
-    return -1;
-}
-
-static int DirectFB_RenderDrawPoints(SDL_Renderer * renderer,
-                                const SDL_FPoint * points, int count)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *destsurf = data->target;
-    DFBRegion clip_region;
-    int i;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    PrepareDraw(renderer);
-    destsurf->GetClip(destsurf, &clip_region);
-    for (i=0; i < count; i++) {
-        int x = points[i].x + clip_region.x1;
-        int y = points[i].y + clip_region.y1;
-        SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, x, y, x, y));
-    }
-    return 0;
-  error:
-    return -1;
-}
-
-static int DirectFB_RenderDrawLines(SDL_Renderer * renderer,
-                               const SDL_FPoint * points, int count)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *destsurf = data->target;
-    DFBRegion clip_region;
-    int i;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    PrepareDraw(renderer);
-    /* Use antialiasing when available */
-#if (DFB_VERSION_ATLEAST(1,2,0))
-    SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf, DSRO_ANTIALIAS));
-#endif
-
-    destsurf->GetClip(destsurf, &clip_region);
-    for (i=0; i < count - 1; i++) {
-        int x1 = points[i].x + clip_region.x1;
-        int y1 = points[i].y + clip_region.y1;
-        int x2 = points[i + 1].x + clip_region.x1;
-        int y2 = points[i + 1].y + clip_region.y1;
-        SDL_DFB_CHECKERR(destsurf->DrawLine(destsurf, x1, y1, x2, y2));
-    }
-
-    return 0;
-  error:
-    return -1;
-}
-
-static int
-DirectFB_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *destsurf = data->target;
-    DFBRegion clip_region;
-    int i;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    PrepareDraw(renderer);
-
-    destsurf->GetClip(destsurf, &clip_region);
-    for (i=0; i<count; i++) {
-        SDL_Rect dst = {rects[i]->x, rects[i]->y, rects[i]->w, rects[i]->h};
-        dst.x += clip_region.x1;
-        dst.y += clip_region.y1;
-        SDL_DFB_CHECKERR(destsurf->DrawRectangle(destsurf, dst.x, dst.y,
-                dst.w, dst.h));
-    }
-
-    return 0;
-  error:
-    return -1;
-}
-
-static int
-DirectFB_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, int count)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *destsurf = data->target;
-    DFBRegion clip_region;
-    int i;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    PrepareDraw(renderer);
-
-    destsurf->GetClip(destsurf, &clip_region);
-    for (i=0; i<count; i++) {
-        SDL_Rect dst = {rects[i].x, rects[i].y, rects[i].w, rects[i].h};
-        dst.x += clip_region.x1;
-        dst.y += clip_region.y1;
-        SDL_DFB_CHECKERR(destsurf->FillRectangle(destsurf, dst.x, dst.y,
-                dst.w, dst.h));
-    }
-
-    return 0;
-  error:
-    return -1;
-}
-
-static int
-DirectFB_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
-                    const SDL_Rect * srcrect, const SDL_FRect * dstrect)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *destsurf = data->target;
-    DirectFB_TextureData *texturedata =
-        (DirectFB_TextureData *) texture->driverdata;
-    Uint8 alpha, r, g, b;
-    DFBRegion clip_region;
-    DFBRectangle sr, dr;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    SDLtoDFBRect(srcrect, &sr);
-    SDLtoDFBRect_Float(dstrect, &dr);
-
-    destsurf->GetClip(destsurf, &clip_region);
-    dr.x += clip_region.x1;
-    dr.y += clip_region.y1;
-
-    if (texturedata->display) {
-        int px, py;
-        SDL_Window *window = renderer->window;
-        IDirectFBWindow *dfbwin = get_dfb_window(window);
-        SDL_DFB_WINDOWDATA(window);
-        SDL_VideoDisplay *display = texturedata->display;
-        DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
-
-        SDL_DFB_CHECKERR(dispdata->
-                         vidlayer->SetSourceRectangle(dispdata->vidlayer,
-                                                      sr.x, sr.y, sr.w, sr.h));
-        dfbwin->GetPosition(dfbwin, &px, &py);
-        px += windata->client.x;
-        py += windata->client.y;
-        SDL_DFB_CHECKERR(dispdata->
-                         vidlayer->SetScreenRectangle(dispdata->vidlayer,
-                                                      px + dr.x,
-                                                      py + dr.y,
-                                                      dr.w,
-                                                      dr.h));
-    } else {
-        DFBSurfaceBlittingFlags flags = 0;
-
-#if 0
-        if (texturedata->dirty.list) {
-            SDL_DirtyRect *dirty;
-            void *pixels;
-            int bpp = DFB_BYTES_PER_PIXEL(DirectFB_SDLToDFBPixelFormat(texture->format));
-            int pitch = texturedata->pitch;
-
-            for (dirty = texturedata->dirty.list; dirty; dirty = dirty->next) {
-                SDL_Rect *rect = &dirty->rect;
-                pixels =
-                    (void *) ((Uint8 *) texturedata->pixels +
-                              rect->y * pitch + rect->x * bpp);
-                DirectFB_UpdateTexture(renderer, texture, rect,
-                                       pixels,
-                                       texturedata->pitch);
-            }
-            SDL_ClearDirtyRects(&texturedata->dirty);
-        }
-#endif
-        if (texturedata->isDirty)
-        {
-            SDL_Rect rect;
-
-            rect.x = 0;
-            rect.y = 0;
-            rect.w = texture->w;
-            rect.h = texture->h;
-
-            DirectFB_UpdateTexture(renderer, texture, &rect, texturedata->pixels, texturedata->pitch);
-        }
-
-        alpha = r = g = b = 0xff;
-        if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA){
-            alpha = texture->a;
-            flags |= DSBLIT_BLEND_COLORALPHA;
-        }
-
-        if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) {
-            r = texture->r;
-            g = texture->g;
-            b = texture->b;
-            flags |= DSBLIT_COLORIZE;
-        }
-        SDL_DFB_CHECKERR(destsurf->
-                         SetColor(destsurf, r, g, b, alpha));
-
-        /* ???? flags |= DSBLIT_SRC_PREMULTCOLOR; */
-
-        SetBlendMode(data, texture->blendMode, texturedata);
-
-        SDL_DFB_CHECKERR(destsurf->SetBlittingFlags(destsurf,
-                                                    data->blitFlags | flags));
-
-#if (DFB_VERSION_ATLEAST(1,2,0))
-        SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf,
-                                                    texturedata->
-                                                    render_options));
-#endif
-
-        if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
-            SDL_DFB_CHECKERR(destsurf->Blit(destsurf,
-                                            texturedata->surface,
-                                            &sr, dr.x, dr.y));
-        } else {
-            SDL_DFB_CHECKERR(destsurf->StretchBlit(destsurf,
-                                                   texturedata->surface,
-                                                   &sr, &dr));
-        }
-    }
-    return 0;
-  error:
-    return -1;
-}
-
-static void
-DirectFB_RenderPresent(SDL_Renderer * renderer)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    SDL_Window *window = renderer->window;
-    SDL_DFB_WINDOWDATA(window);
-    SDL_ShapeData *shape_data = (window->shaper ? window->shaper->driverdata : NULL);
-
-    DirectFB_ActivateRenderer(renderer);
-
-    if (shape_data && shape_data->surface) {
-        /* saturate the window surface alpha channel */
-        SDL_DFB_CHECK(windata->window_surface->SetSrcBlendFunction(windata->window_surface, DSBF_ONE));
-        SDL_DFB_CHECK(windata->window_surface->SetDstBlendFunction(windata->window_surface, DSBF_ONE));
-        SDL_DFB_CHECK(windata->window_surface->SetDrawingFlags(windata->window_surface, DSDRAW_BLEND));
-        SDL_DFB_CHECK(windata->window_surface->SetColor(windata->window_surface, 0, 0, 0, 0xff));
-        SDL_DFB_CHECK(windata->window_surface->FillRectangle(windata->window_surface, 0,0, windata->size.w, windata->size.h));
-
-        /* blit the mask */
-        SDL_DFB_CHECK(windata->surface->SetSrcBlendFunction(windata->surface, DSBF_DESTCOLOR));
-        SDL_DFB_CHECK(windata->surface->SetDstBlendFunction(windata->surface, DSBF_ZERO));
-        SDL_DFB_CHECK(windata->surface->SetBlittingFlags(windata->surface, DSBLIT_BLEND_ALPHACHANNEL));
-#if (DFB_VERSION_ATLEAST(1,2,0))
-        SDL_DFB_CHECK(windata->surface->SetRenderOptions(windata->surface, DSRO_NONE));
-#endif
-        SDL_DFB_CHECK(windata->surface->Blit(windata->surface, shape_data->surface, NULL, 0, 0));
-    }
-
-    /* Send the data to the display */
-    SDL_DFB_CHECK(windata->window_surface->Flip(windata->window_surface, NULL,
-                                                data->flipflags));
-}
-
-static void
-DirectFB_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-    DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    if (!data) {
-        return;
-    }
-    SDL_DFB_RELEASE(data->palette);
-    SDL_DFB_RELEASE(data->surface);
-    if (data->display) {
-        DFB_DisplayData *dispdata =
-            (DFB_DisplayData *) data->display->driverdata;
-        dispdata->vidIDinuse = 0;
-        /* FIXME: Shouldn't we reset the cooperative level */
-        SDL_DFB_CHECK(dispdata->vidlayer->SetCooperativeLevel(dispdata->vidlayer,
-                                                DLSCL_ADMINISTRATIVE));
-        SDL_DFB_RELEASE(dispdata->vidlayer);
-    }
-    SDL_DFB_FREE(data->pixels);
-    SDL_free(data);
-    texture->driverdata = NULL;
-}
-
-static void
-DirectFB_DestroyRenderer(SDL_Renderer * renderer)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(data->window);
-#if 0
-    if (display->palette) {
-        SDL_DelPaletteWatch(display->palette, DisplayPaletteChanged, data);
-    }
-#endif
-
-    SDL_free(data);
-    SDL_free(renderer);
-}
-
-static int
-DirectFB_UpdateViewport(SDL_Renderer * renderer)
-{
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *winsurf = data->target;
-    DFBRegion dreg;
-
-    dreg.x1 = renderer->viewport.x;
-    dreg.y1 = renderer->viewport.y;
-    dreg.x2 = dreg.x1 + renderer->viewport.w - 1;
-    dreg.y2 = dreg.y1 + renderer->viewport.h - 1;
-
-    winsurf->SetClip(winsurf, &dreg);
-    return 0;
-}
-
-static int
-DirectFB_UpdateClipRect(SDL_Renderer * renderer)
-{
-    const SDL_Rect *rect = &renderer->clip_rect;
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *destsurf = get_dfb_surface(data->window);
-    DFBRegion region;
-
-    if (!SDL_RectEmpty(rect)) {
-        region.x1 = rect->x;
-        region.x2 = rect->x + rect->w;
-        region.y1 = rect->y;
-        region.y2 = rect->y + rect->h;
-        SDL_DFB_CHECKERR(destsurf->SetClip(destsurf, &region));
-    } else {
-        SDL_DFB_CHECKERR(destsurf->SetClip(destsurf, NULL));
-    }
-    return 0;
-  error:
-    return -1;
-}
-
-static int
-DirectFB_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                     Uint32 format, void * pixels, int pitch)
-{
-    Uint32 sdl_format;
-    void * laypixels;
-    int laypitch;
-    DFBSurfacePixelFormat dfb_format;
-    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
-    IDirectFBSurface *winsurf = data->target;
-
-    DirectFB_ActivateRenderer(renderer);
-
-    winsurf->GetPixelFormat(winsurf, &dfb_format);
-    sdl_format = DirectFB_DFBToSDLPixelFormat(dfb_format);
-    winsurf->Lock(winsurf, DSLF_READ, (void **) &laypixels, &laypitch);
-
-    laypixels += (rect->y * laypitch + rect->x * SDL_BYTESPERPIXEL(sdl_format) );
-    SDL_ConvertPixels(rect->w, rect->h,
-                      sdl_format, laypixels, laypitch,
-                      format, pixels, pitch);
-
-    winsurf->Unlock(winsurf);
-
-    return 0;
-}
-
-#if 0
-static int
-DirectFB_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
-                      Uint32 format, const void * pixels, int pitch)
-{
-    SDL_Window *window = renderer->window;
-    SDL_DFB_WINDOWDATA(window);
-    Uint32 sdl_format;
-    void * laypixels;
-    int laypitch;
-    DFBSurfacePixelFormat dfb_format;
-
-    SDL_DFB_CHECK(windata->surface->GetPixelFormat(windata->surface, &dfb_format));
-    sdl_format = DirectFB_DFBToSDLPixelFormat(dfb_format);
-
-    SDL_DFB_CHECK(windata->surface->Lock(windata->surface, DSLF_WRITE, (void **) &laypixels, &laypitch));
-
-    laypixels += (rect->y * laypitch + rect->x * SDL_BYTESPERPIXEL(sdl_format) );
-    SDL_ConvertPixels(rect->w, rect->h,
-                      format, pixels, pitch,
-                      sdl_format, laypixels, laypitch);
-
-    SDL_DFB_CHECK(windata->surface->Unlock(windata->surface));
-
-    return 0;
-}
-#endif
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_render.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_render.h
deleted file mode 100644
index fe888af..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_render.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-/* SDL surface based renderer implementation */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_shape.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_shape.c
deleted file mode 100644
index 358078f..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_shape.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-
-#include "SDL_assert.h"
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_shape.h"
-#include "SDL_DirectFB_window.h"
-
-#include "../SDL_shape_internals.h"
-
-SDL_Window*
-DirectFB_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags) {
-    return SDL_CreateWindow(title,x,y,w,h,flags /* | SDL_DFB_WINDOW_SHAPED */);
-}
-
-SDL_WindowShaper*
-DirectFB_CreateShaper(SDL_Window* window) {
-    SDL_WindowShaper* result = NULL;
-
-    result = malloc(sizeof(SDL_WindowShaper));
-    result->window = window;
-    result->mode.mode = ShapeModeDefault;
-    result->mode.parameters.binarizationCutoff = 1;
-    result->userx = result->usery = 0;
-    SDL_ShapeData* data = SDL_malloc(sizeof(SDL_ShapeData));
-    result->driverdata = data;
-    data->surface = NULL;
-    window->shaper = result;
-    int resized_properly = DirectFB_ResizeWindowShape(window);
-    SDL_assert(resized_properly == 0);
-
-    return result;
-}
-
-int
-DirectFB_ResizeWindowShape(SDL_Window* window) {
-    SDL_ShapeData* data = window->shaper->driverdata;
-    SDL_assert(data != NULL);
-
-    if (window->x != -1000)
-    {
-        window->shaper->userx = window->x;
-        window->shaper->usery = window->y;
-    }
-    SDL_SetWindowPosition(window,-1000,-1000);
-
-    return 0;
-}
-
-int
-DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) {
-
-    if(shaper == NULL || shape == NULL || shaper->driverdata == NULL)
-        return -1;
-    if(shape->format->Amask == 0 && SDL_SHAPEMODEALPHA(shape_mode->mode))
-        return -2;
-    if(shape->w != shaper->window->w || shape->h != shaper->window->h)
-        return -3;
-
-    {
-        SDL_VideoDisplay *display = SDL_GetDisplayForWindow(shaper->window);
-        SDL_DFB_DEVICEDATA(display->device);
-        Uint32 *pixels;
-        Sint32 pitch;
-        Uint32 h,w;
-        Uint8  *src, *bitmap;
-        DFBSurfaceDescription dsc;
-
-        SDL_ShapeData *data = shaper->driverdata;
-
-        SDL_DFB_RELEASE(data->surface);
-
-        dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
-        dsc.width = shape->w;
-        dsc.height = shape->h;
-        dsc.caps = DSCAPS_PREMULTIPLIED;
-        dsc.pixelformat = DSPF_ARGB;
-
-        SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc, &data->surface));
-
-        /* Assume that shaper->alphacutoff already has a value, because SDL_SetWindowShape() should have given it one. */
-        SDL_DFB_ALLOC_CLEAR(bitmap, shape->w * shape->h);
-        SDL_CalculateShapeBitmap(shaper->mode,shape,bitmap,1);
-
-        src = bitmap;
-
-        SDL_DFB_CHECK(data->surface->Lock(data->surface, DSLF_WRITE | DSLF_READ, (void **) &pixels, &pitch));
-
-        h = shaper->window->h;
-        while (h--) {
-            for (w = 0; w < shaper->window->w; w++) {
-                if (*src)
-                    pixels[w] = 0xFFFFFFFF;
-                else
-                    pixels[w] = 0;
-                src++;
-
-            }
-            pixels += (pitch >> 2);
-        }
-        SDL_DFB_CHECK(data->surface->Unlock(data->surface));
-        SDL_DFB_FREE(bitmap);
-
-        /* FIXME: Need to call this here - Big ?? */
-        DirectFB_WM_RedrawLayout(SDL_GetDisplayForWindow(shaper->window)->device, shaper->window);
-    }
-
-    return 0;
-error:
-    return -1;
-}
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_shape.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_shape.h
deleted file mode 100644
index a997785..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_shape.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_DirectFB_shape_h
-#define _SDL_DirectFB_shape_h
-
-#include <directfb.h>
-
-#include "../SDL_sysvideo.h"
-#include "SDL_shape.h"
-
-typedef struct {
-    IDirectFBSurface *surface;
-} SDL_ShapeData;
-
-extern SDL_Window* DirectFB_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
-extern SDL_WindowShaper* DirectFB_CreateShaper(SDL_Window* window);
-extern int DirectFB_ResizeWindowShape(SDL_Window* window);
-extern int DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode);
-
-#endif /* _SDL_DirectFB_shape_h */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_video.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_video.c
deleted file mode 100644
index 4e5eae4..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_video.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-
-#include "SDL_DirectFB_video.h"
-
-#include "SDL_DirectFB_events.h"
-/*
- * #include "SDL_DirectFB_keyboard.h"
- */
-#include "SDL_DirectFB_modes.h"
-#include "SDL_DirectFB_mouse.h"
-#include "SDL_DirectFB_opengl.h"
-#include "SDL_DirectFB_window.h"
-#include "SDL_DirectFB_WM.h"
-
-
-#include "SDL_config.h"
-
-/* DirectFB video driver implementation.
-*/
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/mman.h>
-
-#include <directfb.h>
-#include <directfb_version.h>
-#include <directfb_strings.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_events.h"
-#include "SDL_DirectFB_render.h"
-#include "SDL_DirectFB_mouse.h"
-#include "SDL_DirectFB_shape.h"
-
-
-#include "SDL_DirectFB_dyn.h"
-
-/* Initialization/Query functions */
-static int DirectFB_VideoInit(_THIS);
-static void DirectFB_VideoQuit(_THIS);
-
-static int DirectFB_Available(void);
-static SDL_VideoDevice *DirectFB_CreateDevice(int devindex);
-
-VideoBootStrap DirectFB_bootstrap = {
-    "directfb", "DirectFB",
-    DirectFB_Available, DirectFB_CreateDevice
-};
-
-static const DirectFBSurfaceDrawingFlagsNames(drawing_flags);
-static const DirectFBSurfaceBlittingFlagsNames(blitting_flags);
-static const DirectFBAccelerationMaskNames(acceleration_mask);
-
-/* DirectFB driver bootstrap functions */
-
-static int
-DirectFB_Available(void)
-{
-    if (!SDL_DirectFB_LoadLibrary())
-        return 0;
-    SDL_DirectFB_UnLoadLibrary();
-    return 1;
-}
-
-static void
-DirectFB_DeleteDevice(SDL_VideoDevice * device)
-{
-    SDL_DirectFB_UnLoadLibrary();
-    SDL_DFB_FREE(device->driverdata);
-    SDL_DFB_FREE(device);
-}
-
-static SDL_VideoDevice *
-DirectFB_CreateDevice(int devindex)
-{
-    SDL_VideoDevice *device;
-
-    if (!SDL_DirectFB_LoadLibrary()) {
-        return NULL;
-    }
-
-    /* Initialize all variables that we clean on shutdown */
-    SDL_DFB_ALLOC_CLEAR(device, sizeof(SDL_VideoDevice));
-
-    /* Set the function pointers */
-
-    /* Set the function pointers */
-    device->VideoInit = DirectFB_VideoInit;
-    device->VideoQuit = DirectFB_VideoQuit;
-    device->GetDisplayModes = DirectFB_GetDisplayModes;
-    device->SetDisplayMode = DirectFB_SetDisplayMode;
-    device->PumpEvents = DirectFB_PumpEventsWindow;
-    device->CreateWindow = DirectFB_CreateWindow;
-    device->CreateWindowFrom = DirectFB_CreateWindowFrom;
-    device->SetWindowTitle = DirectFB_SetWindowTitle;
-    device->SetWindowIcon = DirectFB_SetWindowIcon;
-    device->SetWindowPosition = DirectFB_SetWindowPosition;
-    device->SetWindowSize = DirectFB_SetWindowSize;
-    device->ShowWindow = DirectFB_ShowWindow;
-    device->HideWindow = DirectFB_HideWindow;
-    device->RaiseWindow = DirectFB_RaiseWindow;
-    device->MaximizeWindow = DirectFB_MaximizeWindow;
-    device->MinimizeWindow = DirectFB_MinimizeWindow;
-    device->RestoreWindow = DirectFB_RestoreWindow;
-    device->SetWindowGrab = DirectFB_SetWindowGrab;
-    device->DestroyWindow = DirectFB_DestroyWindow;
-    device->GetWindowWMInfo = DirectFB_GetWindowWMInfo;
-
-    /* !!! FIXME: implement SetWindowBordered */
-
-#if SDL_DIRECTFB_OPENGL
-    device->GL_LoadLibrary = DirectFB_GL_LoadLibrary;
-    device->GL_GetProcAddress = DirectFB_GL_GetProcAddress;
-    device->GL_MakeCurrent = DirectFB_GL_MakeCurrent;
-
-    device->GL_CreateContext = DirectFB_GL_CreateContext;
-    device->GL_SetSwapInterval = DirectFB_GL_SetSwapInterval;
-    device->GL_GetSwapInterval = DirectFB_GL_GetSwapInterval;
-    device->GL_SwapWindow = DirectFB_GL_SwapWindow;
-    device->GL_DeleteContext = DirectFB_GL_DeleteContext;
-
-#endif
-
-    /* Shaped window support */
-    device->shape_driver.CreateShaper = DirectFB_CreateShaper;
-    device->shape_driver.SetWindowShape = DirectFB_SetWindowShape;
-    device->shape_driver.ResizeWindowShape = DirectFB_ResizeWindowShape;
-
-    device->free = DirectFB_DeleteDevice;
-
-    return device;
-  error:
-    if (device)
-        free(device);
-    return (0);
-}
-
-static void
-DirectFB_DeviceInformation(IDirectFB * dfb)
-{
-    DFBGraphicsDeviceDescription desc;
-    int n;
-
-    dfb->GetDeviceDescription(dfb, &desc);
-
-    SDL_DFB_LOG( "DirectFB Device Information");
-    SDL_DFB_LOG( "===========================");
-    SDL_DFB_LOG( "Name:           %s", desc.name);
-    SDL_DFB_LOG( "Vendor:         %s", desc.vendor);
-    SDL_DFB_LOG( "Driver Name:    %s", desc.driver.name);
-    SDL_DFB_LOG( "Driver Vendor:  %s", desc.driver.vendor);
-    SDL_DFB_LOG( "Driver Version: %d.%d", desc.driver.major,
-            desc.driver.minor);
-
-    SDL_DFB_LOG( "Video memoory:  %d", desc.video_memory);
-
-    SDL_DFB_LOG( "Blitting flags:");
-    for (n = 0; blitting_flags[n].flag; n++) {
-        if (desc.blitting_flags & blitting_flags[n].flag)
-            SDL_DFB_LOG( "    %s", blitting_flags[n].name);
-    }
-
-    SDL_DFB_LOG( "Drawing flags:");
-    for (n = 0; drawing_flags[n].flag; n++) {
-        if (desc.drawing_flags & drawing_flags[n].flag)
-            SDL_DFB_LOG( "    %s", drawing_flags[n].name);
-    }
-
-
-    SDL_DFB_LOG( "Acceleration flags:");
-    for (n = 0; acceleration_mask[n].mask; n++) {
-        if (desc.acceleration_mask & acceleration_mask[n].mask)
-            SDL_DFB_LOG( "    %s", acceleration_mask[n].name);
-    }
-
-
-}
-
-static int readBoolEnv(const char *env_name, int def_val)
-{
-    char *stemp;
-
-    stemp = SDL_getenv(env_name);
-    if (stemp)
-        return atoi(stemp);
-    else
-        return def_val;
-}
-
-static int
-DirectFB_VideoInit(_THIS)
-{
-    IDirectFB *dfb = NULL;
-    DFB_DeviceData *devdata = NULL;
-    DFBResult ret;
-
-    SDL_DFB_ALLOC_CLEAR(devdata, sizeof(*devdata));
-
-    SDL_DFB_CHECKERR(DirectFBInit(NULL, NULL));
-
-    /* avoid switching to the framebuffer when we
-     * are running X11 */
-    ret = readBoolEnv(DFBENV_USE_X11_CHECK , 1);
-    if (ret) {
-        if (SDL_getenv("DISPLAY"))
-            DirectFBSetOption("system", "x11");
-        else
-            DirectFBSetOption("disable-module", "x11input");
-    }
-
-    /* FIXME: Reenable as default once multi kbd/mouse interface is sorted out */
-    devdata->use_linux_input = readBoolEnv(DFBENV_USE_LINUX_INPUT, 0);       /* default: on */
-
-    if (!devdata->use_linux_input)
-    {
-        SDL_DFB_LOG("Disabling linxu input\n");
-        DirectFBSetOption("disable-module", "linux_input");
-    }
-
-    SDL_DFB_CHECKERR(DirectFBCreate(&dfb));
-
-    DirectFB_DeviceInformation(dfb);
-
-    devdata->use_yuv_underlays = readBoolEnv(DFBENV_USE_YUV_UNDERLAY, 0);     /* default: off */
-    devdata->use_yuv_direct = readBoolEnv(DFBENV_USE_YUV_DIRECT, 0);      /* default is off! */
-
-    /* Create global Eventbuffer for axis events */
-    if (devdata->use_linux_input) {
-        SDL_DFB_CHECKERR(dfb->CreateInputEventBuffer(dfb, DICAPS_ALL,
-                                                     DFB_TRUE,
-                                                     &devdata->events));
-    } else {
-        SDL_DFB_CHECKERR(dfb->CreateInputEventBuffer(dfb, DICAPS_AXES
-                                                     /* DICAPS_ALL */ ,
-                                                     DFB_TRUE,
-                                                     &devdata->events));
-    }
-
-    /* simple window manager support */
-    devdata->has_own_wm = readBoolEnv(DFBENV_USE_WM, 0);
-
-    devdata->initialized = 1;
-
-    devdata->dfb = dfb;
-    devdata->firstwin = NULL;
-    devdata->grabbed_window = NULL;
-
-    _this->driverdata = devdata;
-
-    DirectFB_InitModes(_this);
-
-#if SDL_DIRECTFB_OPENGL
-    DirectFB_GL_Initialize(_this);
-#endif
-
-    DirectFB_InitMouse(_this);
-    DirectFB_InitKeyboard(_this);
-
-    return 0;
-
-
-  error:
-    SDL_DFB_FREE(devdata);
-    SDL_DFB_RELEASE(dfb);
-    return -1;
-}
-
-static void
-DirectFB_VideoQuit(_THIS)
-{
-    DFB_DeviceData *devdata = (DFB_DeviceData *) _this->driverdata;
-
-    DirectFB_QuitModes(_this);
-    DirectFB_QuitKeyboard(_this);
-    DirectFB_QuitMouse(_this);
-
-    devdata->events->Reset(devdata->events);
-    SDL_DFB_RELEASE(devdata->events);
-    SDL_DFB_RELEASE(devdata->dfb);
-
-#if SDL_DIRECTFB_OPENGL
-    DirectFB_GL_Shutdown(_this);
-#endif
-
-    devdata->initialized = 0;
-}
-
-/* DirectFB driver general support functions */
-
-static const struct {
-    DFBSurfacePixelFormat dfb;
-    Uint32 sdl;
-} pixelformat_tab[] =
-{
-    { DSPF_RGB32, SDL_PIXELFORMAT_RGB888 },             /* 24 bit RGB (4 byte, nothing at 24, red 8 at 16, green 8 at 8, blue 8 at 0) */
-    { DSPF_ARGB, SDL_PIXELFORMAT_ARGB8888 },            /* 32 bit ARGB (4 byte, alpha 8 at 24, red 8 at 16, green 8 at 8, blue 8 at 0) */
-    { DSPF_RGB16, SDL_PIXELFORMAT_RGB565 },             /* 16 bit RGB (2 byte, red 5 at 11, green 6 at 5, blue 5 at 0) */
-    { DSPF_RGB332, SDL_PIXELFORMAT_RGB332 },            /* 8 bit RGB (1 byte, red 3 at 5, green 3 at 2, blue 2 at 0) */
-    { DSPF_ARGB4444, SDL_PIXELFORMAT_ARGB4444 },        /* 16 bit ARGB (2 byte, alpha 4 at 12, red 4 at 8, green 4 at 4, blue 4 at 0) */
-    { DSPF_ARGB1555, SDL_PIXELFORMAT_ARGB1555 },        /* 16 bit ARGB (2 byte, alpha 1 at 15, red 5 at 10, green 5 at 5, blue 5 at 0) */
-    { DSPF_RGB24, SDL_PIXELFORMAT_RGB24 },              /* 24 bit RGB (3 byte, red 8 at 16, green 8 at 8, blue 8 at 0) */
-    { DSPF_RGB444, SDL_PIXELFORMAT_RGB444 },            /* 16 bit RGB (2 byte, nothing @12, red 4 at 8, green 4 at 4, blue 4 at 0) */
-    { DSPF_YV12, SDL_PIXELFORMAT_YV12 },                /* 12 bit YUV (8 bit Y plane followed by 8 bit quarter size V/U planes) */
-    { DSPF_I420,SDL_PIXELFORMAT_IYUV },                 /* 12 bit YUV (8 bit Y plane followed by 8 bit quarter size U/V planes) */
-    { DSPF_YUY2, SDL_PIXELFORMAT_YUY2 },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains CbYCrY [31:0]) */
-    { DSPF_UYVY, SDL_PIXELFORMAT_UYVY },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains YCbYCr [31:0]) */
-    { DSPF_RGB555, SDL_PIXELFORMAT_RGB555 },            /* 16 bit RGB (2 byte, nothing @15, red 5 at 10, green 5 at 5, blue 5 at 0) */
-#if (ENABLE_LUT8)
-    { DSPF_LUT8, SDL_PIXELFORMAT_INDEX8 },              /* 8 bit LUT (8 bit color and alpha lookup from palette) */
-#endif
-
-#if (DFB_VERSION_ATLEAST(1,2,0))
-    { DSPF_BGR555, SDL_PIXELFORMAT_BGR555 },            /* 16 bit BGR (2 byte, nothing @15, blue 5 at 10, green 5 at 5, red 5 at 0) */
-#else
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR555 },
-#endif
-
-    /* Pfff ... nonmatching formats follow */
-
-    { DSPF_ALUT44, SDL_PIXELFORMAT_UNKNOWN },           /* 8 bit ALUT (1 byte, alpha 4 at 4, color lookup 4 at 0) */
-    { DSPF_A8, SDL_PIXELFORMAT_UNKNOWN },               /*  8 bit alpha (1 byte, alpha 8 at 0), e.g. anti-aliased glyphs */
-    { DSPF_AiRGB, SDL_PIXELFORMAT_UNKNOWN },            /*  32 bit ARGB (4 byte, inv. alpha 8 at 24, red 8 at 16, green 8 at 8, blue 8 at 0) */
-    { DSPF_A1, SDL_PIXELFORMAT_UNKNOWN },               /*  1 bit alpha (1 byte/ 8 pixel, most significant bit used first) */
-    { DSPF_NV12, SDL_PIXELFORMAT_UNKNOWN },             /*  12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane) */
-    { DSPF_NV16, SDL_PIXELFORMAT_UNKNOWN },             /*  16 bit YUV (8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane) */
-    { DSPF_ARGB2554, SDL_PIXELFORMAT_UNKNOWN },         /*  16 bit ARGB (2 byte, alpha 2 at 14, red 5 at 9, green 5 at 4, blue 4 at 0) */
-    { DSPF_NV21, SDL_PIXELFORMAT_UNKNOWN },             /*  12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CrCb [15:0] plane) */
-    { DSPF_AYUV, SDL_PIXELFORMAT_UNKNOWN },             /*  32 bit AYUV (4 byte, alpha 8 at 24, Y 8 at 16, Cb 8 at 8, Cr 8 at 0) */
-    { DSPF_A4, SDL_PIXELFORMAT_UNKNOWN },               /*  4 bit alpha (1 byte/ 2 pixel, more significant nibble used first) */
-    { DSPF_ARGB1666, SDL_PIXELFORMAT_UNKNOWN },         /*  1 bit alpha (3 byte/ alpha 1 at 18, red 6 at 16, green 6 at 6, blue 6 at 0) */
-    { DSPF_ARGB6666, SDL_PIXELFORMAT_UNKNOWN },         /*  6 bit alpha (3 byte/ alpha 6 at 18, red 6 at 16, green 6 at 6, blue 6 at 0) */
-    { DSPF_RGB18, SDL_PIXELFORMAT_UNKNOWN },            /*  6 bit RGB (3 byte/ red 6 at 16, green 6 at 6, blue 6 at 0) */
-    { DSPF_LUT2, SDL_PIXELFORMAT_UNKNOWN },             /*  2 bit LUT (1 byte/ 4 pixel, 2 bit color and alpha lookup from palette) */
-
-#if (DFB_VERSION_ATLEAST(1,3,0))
-    { DSPF_RGBA4444, SDL_PIXELFORMAT_UNKNOWN },         /* 16 bit RGBA (2 byte, red 4 at 12, green 4 at 8, blue 4 at 4, alpha 4 at 0) */
-#endif
-
-#if (DFB_VERSION_ATLEAST(1,4,3))
-    { DSPF_RGBA5551, SDL_PIXELFORMAT_UNKNOWN },         /*  16 bit RGBA (2 byte, red 5 at 11, green 5 at 6, blue 5 at 1, alpha 1 at 0) */
-    { DSPF_YUV444P, SDL_PIXELFORMAT_UNKNOWN },          /*  24 bit full YUV planar (8 bit Y plane followed by an 8 bit Cb and an 8 bit Cr plane) */
-    { DSPF_ARGB8565, SDL_PIXELFORMAT_UNKNOWN },         /*  24 bit ARGB (3 byte, alpha 8 at 16, red 5 at 11, green 6 at 5, blue 5 at 0) */
-    { DSPF_AVYU, SDL_PIXELFORMAT_UNKNOWN },             /*  32 bit AVYU 4:4:4 (4 byte, alpha 8 at 24, Cr 8 at 16, Y 8 at 8, Cb 8 at 0) */
-    { DSPF_VYU, SDL_PIXELFORMAT_UNKNOWN },              /*  24 bit VYU 4:4:4 (3 byte, Cr 8 at 16, Y 8 at 8, Cb 8 at 0)  */
-#endif
-
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX1LSB },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX1MSB },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX4LSB },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX4MSB },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR24 },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR888 },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_RGBA8888 },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR8888 },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGRA8888 },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_ARGB2101010 },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR4444 },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR1555 },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR565 },
-    { DSPF_UNKNOWN, SDL_PIXELFORMAT_YVYU },                        /**< Packed mode: Y0+V0+Y1+U0 (1 pla */
-};
-
-Uint32
-DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat)
-{
-    int i;
-
-    for (i=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++)
-        if (pixelformat_tab[i].dfb == pixelformat)
-        {
-            return pixelformat_tab[i].sdl;
-        }
-    return SDL_PIXELFORMAT_UNKNOWN;
-}
-
-DFBSurfacePixelFormat
-DirectFB_SDLToDFBPixelFormat(Uint32 format)
-{
-    int i;
-
-    for (i=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++)
-        if (pixelformat_tab[i].sdl == format)
-        {
-            return pixelformat_tab[i].dfb;
-        }
-    return DSPF_UNKNOWN;
-}
-
-void DirectFB_SetSupportedPixelFormats(SDL_RendererInfo* ri)
-{
-    int i, j;
-
-    for (i=0, j=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++)
-        if (pixelformat_tab[i].sdl != SDL_PIXELFORMAT_UNKNOWN)
-            ri->texture_formats[j++] = pixelformat_tab[i].sdl;
-    ri->num_texture_formats = j;
-}
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_video.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_video.h
deleted file mode 100644
index b40bac0..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_video.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#ifndef _SDL_DirectFB_video_h
-#define _SDL_DirectFB_video_h
-
-#include <directfb.h>
-#include <directfb_version.h>
-
-#include "../SDL_sysvideo.h"
-#include "SDL_scancode.h"
-#include "SDL_render.h"
-
-#include "SDL_log.h"
-
-#define DFB_VERSIONNUM(X, Y, Z)                     \
-    ((X)*1000 + (Y)*100 + (Z))
-
-#define DFB_COMPILEDVERSION \
-    DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
-
-#define DFB_VERSION_ATLEAST(X, Y, Z) \
-    (DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
-
-#if (DFB_VERSION_ATLEAST(1,0,0))
-#ifdef SDL_VIDEO_OPENGL
-#define SDL_DIRECTFB_OPENGL 1
-#endif
-#else
-#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
-#endif
-
-/* Set below to 1 to compile with (old) multi mice/keyboard api. Code left in
- * in case we see this again ...
- */
-
-#define USE_MULTI_API   (0)
-
-/* Support for LUT8/INDEX8 pixel format.
- * This is broken in DirectFB 1.4.3. It works in 1.4.0 and 1.4.5
- * occurred.
- */
-
-#if (DFB_COMPILEDVERSION == DFB_VERSIONNUM(1, 4, 3))
-#define ENABLE_LUT8     (0)
-#else
-#define ENABLE_LUT8     (1)
-#endif
-
-#define DIRECTFB_DEBUG 1
-
-#define DFBENV_USE_YUV_UNDERLAY     "SDL_DIRECTFB_YUV_UNDERLAY"     /* Default: off */
-#define DFBENV_USE_YUV_DIRECT       "SDL_DIRECTFB_YUV_DIRECT"       /* Default: off */
-#define DFBENV_USE_X11_CHECK        "SDL_DIRECTFB_X11_CHECK"        /* Default: on  */
-#define DFBENV_USE_LINUX_INPUT      "SDL_DIRECTFB_LINUX_INPUT"      /* Default: on  */
-#define DFBENV_USE_WM               "SDL_DIRECTFB_WM"       /* Default: off  */
-
-#define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { SDL_DFB_CHECK(x->Release(x)); x = NULL; } } while (0)
-#define SDL_DFB_FREE(x) do { SDL_free((x)); (x) = NULL; } while (0)
-#define SDL_DFB_UNLOCK(x) do { if ( (x) != NULL ) { x->Unlock(x); } } while (0)
-
-#define SDL_DFB_CONTEXT "SDL_DirectFB"
-
-#define SDL_DFB_ERR(x...) SDL_LogError(SDL_LOG_CATEGORY_ERROR, x)
-
-#if (DIRECTFB_DEBUG)
-#define SDL_DFB_LOG(x...) SDL_LogInfo(SDL_LOG_CATEGORY_VIDEO, x)
-
-#define SDL_DFB_DEBUG(x...) SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, x)
-
-static SDL_INLINE DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int src_line) {
-    if (ret != DFB_OK) {
-        SDL_DFB_LOG("%s (%d):%s", src_file, src_line, DirectFBErrorString (ret) );
-        SDL_SetError("%s:%s", SDL_DFB_CONTEXT, DirectFBErrorString (ret) );
-    }
-    return ret;
-}
-
-#define SDL_DFB_CHECK(x...) do { sdl_dfb_check( x, __FILE__, __LINE__); } while (0)
-#define SDL_DFB_CHECKERR(x...) do { if ( sdl_dfb_check( x, __FILE__, __LINE__) != DFB_OK ) goto error; } while (0)
-
-#else
-
-#define SDL_DFB_CHECK(x...) x
-#define SDL_DFB_CHECKERR(x...) do { if (x != DFB_OK ) goto error; } while (0)
-#define SDL_DFB_LOG(x...) do {} while (0)
-#define SDL_DFB_DEBUG(x...) do {} while (0)
-
-#endif
-
-
-#define SDL_DFB_CALLOC(r, n, s) \
-     do {                                           \
-          r = SDL_calloc (n, s);                    \
-          if (!(r)) {                               \
-               SDL_DFB_ERR("Out of memory");        \
-               SDL_OutOfMemory();                   \
-               goto error;                          \
-          }                                         \
-     } while (0)
-
-#define SDL_DFB_ALLOC_CLEAR(r, s) SDL_DFB_CALLOC(r, 1, s)
-
-/* Private display data */
-
-#define SDL_DFB_DEVICEDATA(dev)  DFB_DeviceData *devdata = (dev ? (DFB_DeviceData *) ((dev)->driverdata) : NULL)
-
-#define DFB_MAX_SCREENS 10
-
-typedef struct _DFB_KeyboardData DFB_KeyboardData;
-struct _DFB_KeyboardData
-{
-    const SDL_Scancode  *map;       /* keyboard scancode map */
-    int             map_size;   /* size of map */
-    int             map_adjust; /* index adjust */
-    int             is_generic; /* generic keyboard */
-    int id;
-};
-
-typedef struct _DFB_DeviceData DFB_DeviceData;
-struct _DFB_DeviceData
-{
-    int initialized;
-
-    IDirectFB           *dfb;
-    int                 num_mice;
-    int                 mouse_id[0x100];
-    int                 num_keyboard;
-    DFB_KeyboardData    keyboard[10];
-    SDL_Window          *firstwin;
-
-    int                 use_yuv_underlays;
-    int                 use_yuv_direct;
-    int                 use_linux_input;
-    int                 has_own_wm;
-
-
-    /* window grab */
-    SDL_Window          *grabbed_window;
-
-    /* global events */
-    IDirectFBEventBuffer *events;
-};
-
-Uint32 DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat);
-DFBSurfacePixelFormat DirectFB_SDLToDFBPixelFormat(Uint32 format);
-void DirectFB_SetSupportedPixelFormats(SDL_RendererInfo *ri);
-
-
-#endif /* _SDL_DirectFB_video_h */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_window.c b/deps/SDL2/src/video/directfb/SDL_DirectFB_window.c
deleted file mode 100644
index e373d4b..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_window.c
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DIRECTFB
-
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_modes.h"
-#include "SDL_DirectFB_window.h"
-#include "SDL_DirectFB_shape.h"
-
-#if SDL_DIRECTFB_OPENGL
-#include "SDL_DirectFB_opengl.h"
-#endif
-
-#include "SDL_syswm.h"
-
-#include "../SDL_pixels_c.h"
-
-int
-DirectFB_CreateWindow(_THIS, SDL_Window * window)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    SDL_DFB_DISPLAYDATA(window);
-    DFB_WindowData *windata = NULL;
-    DFBWindowOptions wopts;
-    DFBWindowDescription desc;
-    int x, y;
-    int bshaped = 0;
-
-    SDL_DFB_ALLOC_CLEAR(window->driverdata, sizeof(DFB_WindowData));
-    SDL_memset(&desc, 0, sizeof(DFBWindowDescription));
-    windata = (DFB_WindowData *) window->driverdata;
-
-    windata->is_managed = devdata->has_own_wm;
-#if 1
-    SDL_DFB_CHECKERR(devdata->dfb->SetCooperativeLevel(devdata->dfb,
-                                                       DFSCL_NORMAL));
-    SDL_DFB_CHECKERR(dispdata->layer->SetCooperativeLevel(dispdata->layer,
-                                                          DLSCL_ADMINISTRATIVE));
-#endif
-    /* FIXME ... ughh, ugly */
-    if (window->x == -1000 && window->y == -1000)
-        bshaped = 1;
-
-    /* Fill the window description. */
-    x = window->x;
-    y = window->y;
-
-    DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
-
-    /* Create Window */
-    desc.caps = 0;
-    desc.flags =
-        DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY | DWDESC_SURFACE_CAPS;
-
-    if (bshaped) {
-        desc.flags |= DWDESC_CAPS;
-        desc.caps |= DWCAPS_ALPHACHANNEL;
-    }
-    else
-    {
-        desc.flags |= DWDESC_PIXELFORMAT;
-    }
-
-    if (!(window->flags & SDL_WINDOW_BORDERLESS))
-        desc.caps |= DWCAPS_NODECORATION;
-
-    desc.posx = x;
-    desc.posy = y;
-    desc.width = windata->size.w;
-    desc.height = windata->size.h;
-    desc.pixelformat = dispdata->pixelformat;
-    desc.surface_caps = DSCAPS_PREMULTIPLIED;
-#if DIRECTFB_MAJOR_VERSION == 1 && DIRECTFB_MINOR_VERSION >= 4
-    if (window->flags & SDL_WINDOW_OPENGL) {
-        desc.surface_caps |= DSCAPS_GL;
-    }
-#endif
-
-    /* Create the window. */
-    SDL_DFB_CHECKERR(dispdata->layer->CreateWindow(dispdata->layer, &desc,
-                                                   &windata->dfbwin));
-
-    /* Set Options */
-    SDL_DFB_CHECK(windata->dfbwin->GetOptions(windata->dfbwin, &wopts));
-
-    /* explicit rescaling of surface */
-    wopts |= DWOP_SCALE;
-    if (window->flags & SDL_WINDOW_RESIZABLE) {
-        wopts &= ~DWOP_KEEP_SIZE;
-    }
-    else {
-        wopts |= DWOP_KEEP_SIZE;
-    }
-
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        wopts |= DWOP_KEEP_POSITION | DWOP_KEEP_STACKING | DWOP_KEEP_SIZE;
-        SDL_DFB_CHECK(windata->dfbwin->SetStackingClass(windata->dfbwin, DWSC_UPPER));
-    }
-
-    if (bshaped) {
-        wopts |= DWOP_SHAPED | DWOP_ALPHACHANNEL;
-        wopts &= ~DWOP_OPAQUE_REGION;
-    }
-
-    SDL_DFB_CHECK(windata->dfbwin->SetOptions(windata->dfbwin, wopts));
-
-    /* See what we got */
-    SDL_DFB_CHECK(DirectFB_WM_GetClientSize
-                     (_this, window, &window->w, &window->h));
-
-    /* Get the window's surface. */
-    SDL_DFB_CHECKERR(windata->dfbwin->GetSurface(windata->dfbwin,
-                                                 &windata->window_surface));
-
-    /* And get a subsurface for rendering */
-    SDL_DFB_CHECKERR(windata->window_surface->
-                     GetSubSurface(windata->window_surface, &windata->client,
-                                   &windata->surface));
-
-    SDL_DFB_CHECK(windata->dfbwin->SetOpacity(windata->dfbwin, 0xFF));
-
-    /* Create Eventbuffer */
-
-    SDL_DFB_CHECKERR(windata->dfbwin->CreateEventBuffer(windata->dfbwin,
-                                                        &windata->
-                                                        eventbuffer));
-    SDL_DFB_CHECKERR(windata->dfbwin->
-                     EnableEvents(windata->dfbwin, DWET_ALL));
-
-    /* Create a font */
-    /* FIXME: once during Video_Init */
-    windata->font = NULL;
-
-    /* Make it the top most window. */
-    SDL_DFB_CHECK(windata->dfbwin->RaiseToTop(windata->dfbwin));
-
-    /* remember parent */
-    /* windata->sdlwin = window; */
-
-    /* Add to list ... */
-
-    windata->next = devdata->firstwin;
-    windata->opacity = 0xFF;
-    devdata->firstwin = window;
-
-    /* Draw Frame */
-    DirectFB_WM_RedrawLayout(_this, window);
-
-    return 0;
-  error:
-    SDL_DFB_RELEASE(windata->surface);
-    SDL_DFB_RELEASE(windata->dfbwin);
-    return -1;
-}
-
-int
-DirectFB_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
-{
-    return SDL_Unsupported();
-}
-
-void
-DirectFB_SetWindowTitle(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-
-    if (windata->is_managed) {
-        windata->wm_needs_redraw = 1;
-        DirectFB_WM_RedrawLayout(_this, window);
-    } else {
-        SDL_Unsupported();
-    }
-}
-
-void
-DirectFB_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    SDL_DFB_WINDOWDATA(window);
-    SDL_Surface *surface = NULL;
-
-    if (icon) {
-        SDL_PixelFormat format;
-        DFBSurfaceDescription dsc;
-        Uint32 *dest;
-        Uint32 *p;
-        int pitch, i;
-
-        /* Convert the icon to ARGB for modern window managers */
-        SDL_InitFormat(&format, SDL_PIXELFORMAT_ARGB8888);
-        surface = SDL_ConvertSurface(icon, &format, 0);
-        if (!surface) {
-            return;
-        }
-        dsc.flags =
-            DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
-        dsc.caps = DSCAPS_VIDEOONLY;
-        dsc.width = surface->w;
-        dsc.height = surface->h;
-        dsc.pixelformat = DSPF_ARGB;
-
-        SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc,
-                                                     &windata->icon));
-
-        SDL_DFB_CHECKERR(windata->icon->Lock(windata->icon, DSLF_WRITE,
-                                             (void *) &dest, &pitch));
-
-        p = surface->pixels;
-        for (i = 0; i < surface->h; i++)
-            memcpy((char *) dest + i * pitch,
-                   (char *) p + i * surface->pitch, 4 * surface->w);
-
-        SDL_DFB_CHECK(windata->icon->Unlock(windata->icon));
-        SDL_FreeSurface(surface);
-    } else {
-        SDL_DFB_RELEASE(windata->icon);
-    }
-    return;
-  error:
-    SDL_FreeSurface(surface);
-    SDL_DFB_RELEASE(windata->icon);
-    return;
-}
-
-void
-DirectFB_SetWindowPosition(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-    int x, y;
-
-    x = window->x;
-    y = window->y;
-
-    DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
-    SDL_DFB_CHECK(windata->dfbwin->MoveTo(windata->dfbwin, x, y));
-}
-
-void
-DirectFB_SetWindowSize(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-
-    if(SDL_IsShapedWindow(window))
-        DirectFB_ResizeWindowShape(window);
-
-    if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
-        int cw;
-        int ch;
-
-        /* Make sure all events are disabled for this operation ! */
-        SDL_DFB_CHECKERR(windata->dfbwin->DisableEvents(windata->dfbwin,
-                                                        DWET_ALL));
-        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize(_this, window, &cw, &ch));
-
-        if (cw != window->w || ch != window->h) {
-
-            DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
-            SDL_DFB_CHECKERR(windata->dfbwin->Resize(windata->dfbwin,
-                                                     windata->size.w,
-                                                     windata->size.h));
-        }
-
-        SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize
-                     (_this, window, &window->w, &window->h));
-        DirectFB_AdjustWindowSurface(window);
-
-        SDL_DFB_CHECKERR(windata->dfbwin->EnableEvents(windata->dfbwin,
-                                                       DWET_ALL));
-
-    }
-    return;
-  error:
-    SDL_DFB_CHECK(windata->dfbwin->EnableEvents(windata->dfbwin, DWET_ALL));
-    return;
-}
-
-void
-DirectFB_ShowWindow(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-
-    SDL_DFB_CHECK(windata->dfbwin->SetOpacity(windata->dfbwin, windata->opacity));
-
-}
-
-void
-DirectFB_HideWindow(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-
-    SDL_DFB_CHECK(windata->dfbwin->GetOpacity(windata->dfbwin, &windata->opacity));
-    SDL_DFB_CHECK(windata->dfbwin->SetOpacity(windata->dfbwin, 0));
-}
-
-void
-DirectFB_RaiseWindow(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-
-    SDL_DFB_CHECK(windata->dfbwin->RaiseToTop(windata->dfbwin));
-    SDL_DFB_CHECK(windata->dfbwin->RequestFocus(windata->dfbwin));
-}
-
-void
-DirectFB_MaximizeWindow(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    DFBWindowOptions wopts;
-
-    SDL_DFB_CHECK(windata->dfbwin->GetPosition(windata->dfbwin,
-                                 &windata->restore.x, &windata->restore.y));
-    SDL_DFB_CHECK(windata->dfbwin->GetSize(windata->dfbwin, &windata->restore.w,
-                             &windata->restore.h));
-
-    DirectFB_WM_AdjustWindowLayout(window, window->flags | SDL_WINDOW_MAXIMIZED, display->current_mode.w, display->current_mode.h) ;
-
-    SDL_DFB_CHECK(windata->dfbwin->MoveTo(windata->dfbwin, 0, 0));
-    SDL_DFB_CHECK(windata->dfbwin->Resize(windata->dfbwin,
-                            display->current_mode.w, display->current_mode.h));
-
-    /* Set Options */
-    SDL_DFB_CHECK(windata->dfbwin->GetOptions(windata->dfbwin, &wopts));
-    wopts |= DWOP_KEEP_SIZE | DWOP_KEEP_POSITION;
-    SDL_DFB_CHECK(windata->dfbwin->SetOptions(windata->dfbwin, wopts));
-}
-
-void
-DirectFB_MinimizeWindow(_THIS, SDL_Window * window)
-{
-    /* FIXME: Size to 32x32 ? */
-
-    SDL_Unsupported();
-}
-
-void
-DirectFB_RestoreWindow(_THIS, SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-    DFBWindowOptions wopts;
-
-    /* Set Options */
-    SDL_DFB_CHECK(windata->dfbwin->GetOptions(windata->dfbwin, &wopts));
-    wopts &= ~(DWOP_KEEP_SIZE | DWOP_KEEP_POSITION);
-    SDL_DFB_CHECK(windata->dfbwin->SetOptions(windata->dfbwin, wopts));
-
-    /* Window layout */
-    DirectFB_WM_AdjustWindowLayout(window, window->flags & ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED),
-        windata->restore.w, windata->restore.h);
-    SDL_DFB_CHECK(windata->dfbwin->Resize(windata->dfbwin, windata->restore.w,
-                            windata->restore.h));
-    SDL_DFB_CHECK(windata->dfbwin->MoveTo(windata->dfbwin, windata->restore.x,
-                            windata->restore.y));
-
-    if (!(window->flags & SDL_WINDOW_RESIZABLE))
-        wopts |= DWOP_KEEP_SIZE;
-
-    if (window->flags & SDL_WINDOW_FULLSCREEN)
-        wopts |= DWOP_KEEP_POSITION | DWOP_KEEP_SIZE;
-    SDL_DFB_CHECK(windata->dfbwin->SetOptions(windata->dfbwin, wopts));
-
-
-}
-
-void
-DirectFB_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    SDL_DFB_WINDOWDATA(window);
-    DFB_WindowData *gwindata = ((devdata->grabbed_window) ? (DFB_WindowData *) ((devdata->grabbed_window)->driverdata) : NULL);
-
-    if ((window->flags & SDL_WINDOW_INPUT_GRABBED)) {
-        if (gwindata != NULL)
-        {
-            SDL_DFB_CHECK(gwindata->dfbwin->UngrabPointer(gwindata->dfbwin));
-            SDL_DFB_CHECK(gwindata->dfbwin->UngrabKeyboard(gwindata->dfbwin));
-        }
-        SDL_DFB_CHECK(windata->dfbwin->GrabPointer(windata->dfbwin));
-        SDL_DFB_CHECK(windata->dfbwin->GrabKeyboard(windata->dfbwin));
-        devdata->grabbed_window = window;
-    } else {
-        SDL_DFB_CHECK(windata->dfbwin->UngrabPointer(windata->dfbwin));
-        SDL_DFB_CHECK(windata->dfbwin->UngrabKeyboard(windata->dfbwin));
-        devdata->grabbed_window = NULL;
-    }
-}
-
-void
-DirectFB_DestroyWindow(_THIS, SDL_Window * window)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    SDL_DFB_WINDOWDATA(window);
-    DFB_WindowData *p;
-
-    /* Some cleanups */
-    SDL_DFB_CHECK(windata->dfbwin->UngrabPointer(windata->dfbwin));
-    SDL_DFB_CHECK(windata->dfbwin->UngrabKeyboard(windata->dfbwin));
-
-#if SDL_DIRECTFB_OPENGL
-    DirectFB_GL_DestroyWindowContexts(_this, window);
-#endif
-
-    if (window->shaper)
-    {
-        SDL_ShapeData *data = window->shaper->driverdata;
-        SDL_DFB_CHECK(data->surface->ReleaseSource(data->surface));
-        SDL_DFB_RELEASE(data->surface);
-        SDL_DFB_FREE(data);
-        SDL_DFB_FREE(window->shaper);
-    }
-
-    SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, NULL));
-    SDL_DFB_CHECK(windata->surface->ReleaseSource(windata->surface));
-    SDL_DFB_CHECK(windata->window_surface->ReleaseSource(windata->window_surface));
-    SDL_DFB_RELEASE(windata->icon);
-    SDL_DFB_RELEASE(windata->font);
-    SDL_DFB_RELEASE(windata->eventbuffer);
-    SDL_DFB_RELEASE(windata->surface);
-    SDL_DFB_RELEASE(windata->window_surface);
-
-    SDL_DFB_RELEASE(windata->dfbwin);
-
-    /* Remove from list ... */
-
-    p = devdata->firstwin->driverdata;
-
-    while (p && p->next != window)
-        p = (p->next ? p->next->driverdata : NULL);
-    if (p)
-        p->next = windata->next;
-    else
-        devdata->firstwin = windata->next;
-    SDL_free(windata);
-    return;
-}
-
-SDL_bool
-DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window,
-                         struct SDL_SysWMinfo * info)
-{
-    SDL_DFB_DEVICEDATA(_this);
-    SDL_DFB_WINDOWDATA(window);
-
-    if (info->version.major == SDL_MAJOR_VERSION &&
-        info->version.minor == SDL_MINOR_VERSION) {
-        info->subsystem = SDL_SYSWM_DIRECTFB;
-        info->info.dfb.dfb = devdata->dfb;
-        info->info.dfb.window = windata->dfbwin;
-        info->info.dfb.surface = windata->surface;
-        return SDL_TRUE;
-    } else {
-        SDL_SetError("Application not compiled with SDL %d.%d\n",
-                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
-        return SDL_FALSE;
-    }
-}
-
-void
-DirectFB_AdjustWindowSurface(SDL_Window * window)
-{
-    SDL_DFB_WINDOWDATA(window);
-    int adjust = windata->wm_needs_redraw;
-    int cw, ch;
-
-    DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
-
-    SDL_DFB_CHECKERR(windata->
-                     window_surface->GetSize(windata->window_surface, &cw,
-                                             &ch));
-    if (cw != windata->size.w || ch != windata->size.h) {
-        adjust = 1;
-    }
-
-    if (adjust) {
-#if SDL_DIRECTFB_OPENGL
-        DirectFB_GL_FreeWindowContexts(SDL_GetVideoDevice(), window);
-#endif
-
-#if (DFB_VERSION_ATLEAST(1,2,1))
-        SDL_DFB_CHECKERR(windata->dfbwin->ResizeSurface(windata->dfbwin,
-                                                        windata->size.w,
-                                                        windata->size.h));
-        SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
-                                                          windata->
-                                                          window_surface,
-                                                          &windata->client));
-#else
-        DFBWindowOptions opts;
-
-        SDL_DFB_CHECKERR(windata->dfbwin->GetOptions(windata->dfbwin, &opts));
-        /* recreate subsurface */
-        SDL_DFB_RELEASE(windata->surface);
-
-        if (opts & DWOP_SCALE)
-            SDL_DFB_CHECKERR(windata->dfbwin->ResizeSurface(windata->dfbwin,
-                                                            windata->size.w,
-                                                            windata->size.h));
-        SDL_DFB_CHECKERR(windata->window_surface->
-                         GetSubSurface(windata->window_surface,
-                                       &windata->client, &windata->surface));
-#endif
-        DirectFB_WM_RedrawLayout(SDL_GetVideoDevice(), window);
-
-#if SDL_DIRECTFB_OPENGL
-        DirectFB_GL_ReAllocWindowContexts(SDL_GetVideoDevice(), window);
-#endif
-   }
-  error:
-    return;
-}
-
-#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
diff --git a/deps/SDL2/src/video/directfb/SDL_DirectFB_window.h b/deps/SDL2/src/video/directfb/SDL_DirectFB_window.h
deleted file mode 100644
index 96afc59..0000000
--- a/deps/SDL2/src/video/directfb/SDL_DirectFB_window.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_directfb_window_h
-#define _SDL_directfb_window_h
-
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_WM.h"
-
-#define SDL_DFB_WINDOWDATA(win)  DFB_WindowData *windata = ((win) ? (DFB_WindowData *) ((win)->driverdata) : NULL)
-
-typedef struct _DFB_WindowData DFB_WindowData;
-struct _DFB_WindowData
-{
-    IDirectFBSurface        *window_surface;    /* window surface */
-    IDirectFBSurface        *surface;           /* client drawing surface */
-    IDirectFBWindow         *dfbwin;
-    IDirectFBEventBuffer    *eventbuffer;
-    /* SDL_Window                *sdlwin; */
-    SDL_Window              *next;
-    Uint8                   opacity;
-    DFBRectangle            client;
-    DFBDimension            size;
-    DFBRectangle            restore;
-
-    /* WM extras */
-    int                     is_managed;
-    int                     wm_needs_redraw;
-    IDirectFBSurface        *icon;
-    IDirectFBFont           *font;
-    DFB_Theme               theme;
-
-    /* WM moving and sizing */
-    int                     wm_grab;
-    int                     wm_lastx;
-    int                     wm_lasty;
-};
-
-extern int DirectFB_CreateWindow(_THIS, SDL_Window * window);
-extern int DirectFB_CreateWindowFrom(_THIS, SDL_Window * window,
-                                     const void *data);
-extern void DirectFB_SetWindowTitle(_THIS, SDL_Window * window);
-extern void DirectFB_SetWindowIcon(_THIS, SDL_Window * window,
-                                   SDL_Surface * icon);
-
-extern void DirectFB_SetWindowPosition(_THIS, SDL_Window * window);
-extern void DirectFB_SetWindowSize(_THIS, SDL_Window * window);
-extern void DirectFB_ShowWindow(_THIS, SDL_Window * window);
-extern void DirectFB_HideWindow(_THIS, SDL_Window * window);
-extern void DirectFB_RaiseWindow(_THIS, SDL_Window * window);
-extern void DirectFB_MaximizeWindow(_THIS, SDL_Window * window);
-extern void DirectFB_MinimizeWindow(_THIS, SDL_Window * window);
-extern void DirectFB_RestoreWindow(_THIS, SDL_Window * window);
-extern void DirectFB_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
-extern void DirectFB_DestroyWindow(_THIS, SDL_Window * window);
-extern SDL_bool DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window,
-                                         struct SDL_SysWMinfo *info);
-
-extern void DirectFB_AdjustWindowSurface(SDL_Window * window);
-
-#endif /* _SDL_directfb_window_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/dummy/SDL_nullevents.c b/deps/SDL2/src/video/dummy/SDL_nullevents.c
deleted file mode 100644
index 8315609..0000000
--- a/deps/SDL2/src/video/dummy/SDL_nullevents.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DUMMY
-
-/* Being a null driver, there's no event stream. We just define stubs for
-   most of the API. */
-
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_nullvideo.h"
-#include "SDL_nullevents_c.h"
-
-void
-DUMMY_PumpEvents(_THIS)
-{
-    /* do nothing. */
-}
-
-#endif /* SDL_VIDEO_DRIVER_DUMMY */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/dummy/SDL_nullevents_c.h b/deps/SDL2/src/video/dummy/SDL_nullevents_c.h
deleted file mode 100644
index 1a8294c..0000000
--- a/deps/SDL2/src/video/dummy/SDL_nullevents_c.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#include "SDL_nullvideo.h"
-
-extern void DUMMY_PumpEvents(_THIS);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/dummy/SDL_nullframebuffer.c b/deps/SDL2/src/video/dummy/SDL_nullframebuffer.c
deleted file mode 100644
index f18ceea..0000000
--- a/deps/SDL2/src/video/dummy/SDL_nullframebuffer.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DUMMY
-
-#include "../SDL_sysvideo.h"
-#include "SDL_nullframebuffer_c.h"
-
-
-#define DUMMY_SURFACE   "_SDL_DummySurface"
-
-int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
-{
-    SDL_Surface *surface;
-    const Uint32 surface_format = SDL_PIXELFORMAT_RGB888;
-    int w, h;
-    int bpp;
-    Uint32 Rmask, Gmask, Bmask, Amask;
-
-    /* Free the old framebuffer surface */
-    surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE);
-    SDL_FreeSurface(surface);
-
-    /* Create a new one */
-    SDL_PixelFormatEnumToMasks(surface_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask);
-    SDL_GetWindowSize(window, &w, &h);
-    surface = SDL_CreateRGBSurface(0, w, h, bpp, Rmask, Gmask, Bmask, Amask);
-    if (!surface) {
-        return -1;
-    }
-
-    /* Save the info and return! */
-    SDL_SetWindowData(window, DUMMY_SURFACE, surface);
-    *format = surface_format;
-    *pixels = surface->pixels;
-    *pitch = surface->pitch;
-    return 0;
-}
-
-int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
-{
-    static int frame_number;
-    SDL_Surface *surface;
-
-    surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE);
-    if (!surface) {
-        return SDL_SetError("Couldn't find dummy surface for window");
-    }
-
-    /* Send the data to the display */
-    if (SDL_getenv("SDL_VIDEO_DUMMY_SAVE_FRAMES")) {
-        char file[128];
-        SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp",
-                     SDL_GetWindowID(window), ++frame_number);
-        SDL_SaveBMP(surface, file);
-    }
-    return 0;
-}
-
-void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window)
-{
-    SDL_Surface *surface;
-
-    surface = (SDL_Surface *) SDL_SetWindowData(window, DUMMY_SURFACE, NULL);
-    SDL_FreeSurface(surface);
-}
-
-#endif /* SDL_VIDEO_DRIVER_DUMMY */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/dummy/SDL_nullframebuffer_c.h b/deps/SDL2/src/video/dummy/SDL_nullframebuffer_c.h
deleted file mode 100644
index 57dd2ad..0000000
--- a/deps/SDL2/src/video/dummy/SDL_nullframebuffer_c.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
-extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
-extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/dummy/SDL_nullvideo.c b/deps/SDL2/src/video/dummy/SDL_nullvideo.c
deleted file mode 100644
index 9d6ea67..0000000
--- a/deps/SDL2/src/video/dummy/SDL_nullvideo.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_DUMMY
-
-/* Dummy SDL video driver implementation; this is just enough to make an
- *  SDL-based application THINK it's got a working video driver, for
- *  applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it,
- *  and also for use as a collection of stubs when porting SDL to a new
- *  platform for which you haven't yet written a valid video driver.
- *
- * This is also a great way to determine bottlenecks: if you think that SDL
- *  is a performance problem for a given platform, enable this driver, and
- *  then see if your application runs faster without video overhead.
- *
- * Initial work by Ryan C. Gordon (icculus at icculus.org). A good portion
- *  of this was cut-and-pasted from Stephane Peter's work in the AAlib
- *  SDL video driver.  Renamed to "DUMMY" by Sam Lantinga.
- */
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_nullvideo.h"
-#include "SDL_nullevents_c.h"
-#include "SDL_nullframebuffer_c.h"
-
-#define DUMMYVID_DRIVER_NAME "dummy"
-
-/* Initialization/Query functions */
-static int DUMMY_VideoInit(_THIS);
-static int DUMMY_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-static void DUMMY_VideoQuit(_THIS);
-
-/* DUMMY driver bootstrap functions */
-
-static int
-DUMMY_Available(void)
-{
-    const char *envr = SDL_getenv("SDL_VIDEODRIVER");
-    if ((envr) && (SDL_strcmp(envr, DUMMYVID_DRIVER_NAME) == 0)) {
-        return (1);
-    }
-
-    return (0);
-}
-
-static void
-DUMMY_DeleteDevice(SDL_VideoDevice * device)
-{
-    SDL_free(device);
-}
-
-static SDL_VideoDevice *
-DUMMY_CreateDevice(int devindex)
-{
-    SDL_VideoDevice *device;
-
-    /* Initialize all variables that we clean on shutdown */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-    if (!device) {
-        SDL_OutOfMemory();
-        SDL_free(device);
-        return (0);
-    }
-
-    /* Set the function pointers */
-    device->VideoInit = DUMMY_VideoInit;
-    device->VideoQuit = DUMMY_VideoQuit;
-    device->SetDisplayMode = DUMMY_SetDisplayMode;
-    device->PumpEvents = DUMMY_PumpEvents;
-    device->CreateWindowFramebuffer = SDL_DUMMY_CreateWindowFramebuffer;
-    device->UpdateWindowFramebuffer = SDL_DUMMY_UpdateWindowFramebuffer;
-    device->DestroyWindowFramebuffer = SDL_DUMMY_DestroyWindowFramebuffer;
-
-    device->free = DUMMY_DeleteDevice;
-
-    return device;
-}
-
-VideoBootStrap DUMMY_bootstrap = {
-    DUMMYVID_DRIVER_NAME, "SDL dummy video driver",
-    DUMMY_Available, DUMMY_CreateDevice
-};
-
-
-int
-DUMMY_VideoInit(_THIS)
-{
-    SDL_DisplayMode mode;
-
-    /* Use a fake 32-bpp desktop mode */
-    mode.format = SDL_PIXELFORMAT_RGB888;
-    mode.w = 1024;
-    mode.h = 768;
-    mode.refresh_rate = 0;
-    mode.driverdata = NULL;
-    if (SDL_AddBasicVideoDisplay(&mode) < 0) {
-        return -1;
-    }
-
-    SDL_zero(mode);
-    SDL_AddDisplayMode(&_this->displays[0], &mode);
-
-    /* We're done! */
-    return 0;
-}
-
-static int
-DUMMY_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
-{
-    return 0;
-}
-
-void
-DUMMY_VideoQuit(_THIS)
-{
-}
-
-#endif /* SDL_VIDEO_DRIVER_DUMMY */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/dummy/SDL_nullvideo.h b/deps/SDL2/src/video/dummy/SDL_nullvideo.h
deleted file mode 100644
index 7d0a825..0000000
--- a/deps/SDL2/src/video/dummy/SDL_nullvideo.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_nullvideo_h
-#define _SDL_nullvideo_h
-
-#include "../SDL_sysvideo.h"
-
-#endif /* _SDL_nullvideo_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/pandora/SDL_pandora.c b/deps/SDL2/src/video/pandora/SDL_pandora.c
deleted file mode 100644
index 1ebf829..0000000
--- a/deps/SDL2/src/video/pandora/SDL_pandora.c
+++ /dev/null
@@ -1,850 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_PANDORA
-
-/* SDL internals */
-#include "../SDL_sysvideo.h"
-#include "SDL_version.h"
-#include "SDL_syswm.h"
-#include "SDL_loadso.h"
-#include "SDL_events.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/SDL_keyboard_c.h"
-
-/* PND declarations */
-#include "SDL_pandora.h"
-#include "SDL_pandora_events.h"
-
-/* WIZ declarations */
-#include "GLES/gl.h"
-#ifdef WIZ_GLES_LITE
-static NativeWindowType hNativeWnd = 0; /* A handle to the window we will create. */
-#endif
-
-static SDL_bool PND_initialized = SDL_FALSE;
-
-static int
-PND_available(void)
-{
-    return 1;
-}
-
-static void
-PND_destroy(SDL_VideoDevice * device)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata;
-
-    if (device->driverdata != NULL) {
-        device->driverdata = NULL;
-    }
-}
-
-static SDL_VideoDevice *
-PND_create()
-{
-    SDL_VideoDevice *device;
-    SDL_VideoData *phdata;
-    int status;
-
-    /* Check if pandora could be initialized */
-    status = PND_available();
-    if (status == 0) {
-        /* PND could not be used */
-        return NULL;
-    }
-
-    /* Initialize SDL_VideoDevice structure */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-    if (device == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    /* Initialize internal Pandora specific data */
-    phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
-    if (phdata == NULL) {
-        SDL_OutOfMemory();
-        SDL_free(device);
-        return NULL;
-    }
-
-    device->driverdata = phdata;
-
-    phdata->egl_initialized = SDL_TRUE;
-
-
-    /* Setup amount of available displays and current display */
-    device->num_displays = 0;
-    device->current_display = 0;
-
-    /* Set device free function */
-    device->free = PND_destroy;
-
-    /* Setup all functions which we can handle */
-    device->VideoInit = PND_videoinit;
-    device->VideoQuit = PND_videoquit;
-    device->GetDisplayModes = PND_getdisplaymodes;
-    device->SetDisplayMode = PND_setdisplaymode;
-    device->CreateWindow = PND_createwindow;
-    device->CreateWindowFrom = PND_createwindowfrom;
-    device->SetWindowTitle = PND_setwindowtitle;
-    device->SetWindowIcon = PND_setwindowicon;
-    device->SetWindowPosition = PND_setwindowposition;
-    device->SetWindowSize = PND_setwindowsize;
-    device->ShowWindow = PND_showwindow;
-    device->HideWindow = PND_hidewindow;
-    device->RaiseWindow = PND_raisewindow;
-    device->MaximizeWindow = PND_maximizewindow;
-    device->MinimizeWindow = PND_minimizewindow;
-    device->RestoreWindow = PND_restorewindow;
-    device->SetWindowGrab = PND_setwindowgrab;
-    device->DestroyWindow = PND_destroywindow;
-    device->GetWindowWMInfo = PND_getwindowwminfo;
-    device->GL_LoadLibrary = PND_gl_loadlibrary;
-    device->GL_GetProcAddress = PND_gl_getprocaddres;
-    device->GL_UnloadLibrary = PND_gl_unloadlibrary;
-    device->GL_CreateContext = PND_gl_createcontext;
-    device->GL_MakeCurrent = PND_gl_makecurrent;
-    device->GL_SetSwapInterval = PND_gl_setswapinterval;
-    device->GL_GetSwapInterval = PND_gl_getswapinterval;
-    device->GL_SwapWindow = PND_gl_swapwindow;
-    device->GL_DeleteContext = PND_gl_deletecontext;
-    device->PumpEvents = PND_PumpEvents;
-
-    /* !!! FIXME: implement SetWindowBordered */
-
-    return device;
-}
-
-VideoBootStrap PND_bootstrap = {
-#ifdef WIZ_GLES_LITE
-    "wiz",
-    "SDL Wiz Video Driver",
-#else
-    "pandora",
-    "SDL Pandora Video Driver",
-#endif
-    PND_available,
-    PND_create
-};
-
-/*****************************************************************************/
-/* SDL Video and Display initialization/handling functions                   */
-/*****************************************************************************/
-int
-PND_videoinit(_THIS)
-{
-    SDL_VideoDisplay display;
-    SDL_DisplayMode current_mode;
-
-    SDL_zero(current_mode);
-#ifdef WIZ_GLES_LITE
-    current_mode.w = 320;
-    current_mode.h = 240;
-#else
-    current_mode.w = 800;
-    current_mode.h = 480;
-#endif
-    current_mode.refresh_rate = 60;
-    current_mode.format = SDL_PIXELFORMAT_RGB565;
-    current_mode.driverdata = NULL;
-
-    SDL_zero(display);
-    display.desktop_mode = current_mode;
-    display.current_mode = current_mode;
-    display.driverdata = NULL;
-
-    SDL_AddVideoDisplay(&display);
-
-    return 1;
-}
-
-void
-PND_videoquit(_THIS)
-{
-
-}
-
-void
-PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display)
-{
-
-}
-
-int
-PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
-{
-    return 0;
-}
-
-int
-PND_createwindow(_THIS, SDL_Window * window)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-
-    SDL_WindowData *wdata;
-
-    uint32_t winargc = 0;
-    int32_t status;
-
-
-    /* Allocate window internal data */
-    wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData));
-    if (wdata == NULL) {
-        return SDL_OutOfMemory();
-    }
-
-    /* Setup driver data for this window */
-    window->driverdata = wdata;
-
-    /* Check if window must support OpenGL ES rendering */
-    if ((window->flags & SDL_WINDOW_OPENGL) == SDL_WINDOW_OPENGL) {
-
-        EGLBoolean initstatus;
-
-        /* Mark this window as OpenGL ES compatible */
-        wdata->uses_gles = SDL_TRUE;
-
-        /* Create connection to OpenGL ES */
-        if (phdata->egl_display == EGL_NO_DISPLAY) {
-            phdata->egl_display = eglGetDisplay((NativeDisplayType) 0);
-            if (phdata->egl_display == EGL_NO_DISPLAY) {
-                return SDL_SetError("PND: Can't get connection to OpenGL ES");
-            }
-
-            initstatus = eglInitialize(phdata->egl_display, NULL, NULL);
-            if (initstatus != EGL_TRUE) {
-                return SDL_SetError("PND: Can't init OpenGL ES library");
-            }
-        }
-
-        phdata->egl_refcount++;
-    }
-
-    /* Window has been successfully created */
-    return 0;
-}
-
-int
-PND_createwindowfrom(_THIS, SDL_Window * window, const void *data)
-{
-    return -1;
-}
-
-void
-PND_setwindowtitle(_THIS, SDL_Window * window)
-{
-}
-void
-PND_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon)
-{
-}
-void
-PND_setwindowposition(_THIS, SDL_Window * window)
-{
-}
-void
-PND_setwindowsize(_THIS, SDL_Window * window)
-{
-}
-void
-PND_showwindow(_THIS, SDL_Window * window)
-{
-}
-void
-PND_hidewindow(_THIS, SDL_Window * window)
-{
-}
-void
-PND_raisewindow(_THIS, SDL_Window * window)
-{
-}
-void
-PND_maximizewindow(_THIS, SDL_Window * window)
-{
-}
-void
-PND_minimizewindow(_THIS, SDL_Window * window)
-{
-}
-void
-PND_restorewindow(_THIS, SDL_Window * window)
-{
-}
-void
-PND_setwindowgrab(_THIS, SDL_Window * window)
-{
-}
-void
-PND_destroywindow(_THIS, SDL_Window * window)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-    eglTerminate(phdata->egl_display);
-}
-
-/*****************************************************************************/
-/* SDL Window Manager function                                               */
-/*****************************************************************************/
-SDL_bool
-PND_getwindowwminfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
-{
-    if (info->version.major <= SDL_MAJOR_VERSION) {
-        return SDL_TRUE;
-    } else {
-        SDL_SetError("application not compiled with SDL %d.%d\n",
-                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
-        return SDL_FALSE;
-    }
-
-    /* Failed to get window manager information */
-    return SDL_FALSE;
-}
-
-/*****************************************************************************/
-/* SDL OpenGL/OpenGL ES functions                                            */
-/*****************************************************************************/
-int
-PND_gl_loadlibrary(_THIS, const char *path)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-
-    /* Check if OpenGL ES library is specified for GF driver */
-    if (path == NULL) {
-        path = SDL_getenv("SDL_OPENGL_LIBRARY");
-        if (path == NULL) {
-            path = SDL_getenv("SDL_OPENGLES_LIBRARY");
-        }
-    }
-
-    /* Check if default library loading requested */
-    if (path == NULL) {
-        /* Already linked with GF library which provides egl* subset of  */
-        /* functions, use Common profile of OpenGL ES library by default */
-#ifdef WIZ_GLES_LITE
-    path = "/lib/libopengles_lite.so";
-#else
-        path = "/usr/lib/libGLES_CM.so";
-#endif
-    }
-
-    /* Load dynamic library */
-    _this->gl_config.dll_handle = SDL_LoadObject(path);
-    if (!_this->gl_config.dll_handle) {
-        /* Failed to load new GL ES library */
-        return SDL_SetError("PND: Failed to locate OpenGL ES library");
-    }
-
-    /* Store OpenGL ES library path and name */
-    SDL_strlcpy(_this->gl_config.driver_path, path,
-                SDL_arraysize(_this->gl_config.driver_path));
-
-    /* New OpenGL ES library is loaded */
-    return 0;
-}
-
-void *
-PND_gl_getprocaddres(_THIS, const char *proc)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-    void *function_address;
-
-    /* Try to get function address through the egl interface */
-    function_address = eglGetProcAddress(proc);
-    if (function_address != NULL) {
-        return function_address;
-    }
-
-    /* Then try to get function in the OpenGL ES library */
-    if (_this->gl_config.dll_handle) {
-        function_address =
-            SDL_LoadFunction(_this->gl_config.dll_handle, proc);
-        if (function_address != NULL) {
-            return function_address;
-        }
-    }
-
-    /* Failed to get GL ES function address pointer */
-    SDL_SetError("PND: Cannot locate OpenGL ES function name");
-    return NULL;
-}
-
-void
-PND_gl_unloadlibrary(_THIS)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-
-    if (phdata->egl_initialized == SDL_TRUE) {
-        /* Unload OpenGL ES library */
-        if (_this->gl_config.dll_handle) {
-            SDL_UnloadObject(_this->gl_config.dll_handle);
-            _this->gl_config.dll_handle = NULL;
-        }
-    } else {
-        SDL_SetError("PND: GF initialization failed, no OpenGL ES support");
-    }
-}
-
-SDL_GLContext
-PND_gl_createcontext(_THIS, SDL_Window * window)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-    SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *didata =
-        (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
-    EGLBoolean status;
-    int32_t gfstatus;
-    EGLint configs;
-    uint32_t attr_pos;
-    EGLint attr_value;
-    EGLint cit;
-
-    /* Check if EGL was initialized */
-    if (phdata->egl_initialized != SDL_TRUE) {
-        SDL_SetError("PND: EGL initialization failed, no OpenGL ES support");
-        return NULL;
-    }
-
-    /* Prepare attributes list to pass them to OpenGL ES */
-    attr_pos = 0;
-    wdata->gles_attributes[attr_pos++] = EGL_SURFACE_TYPE;
-    wdata->gles_attributes[attr_pos++] = EGL_WINDOW_BIT;
-    wdata->gles_attributes[attr_pos++] = EGL_RED_SIZE;
-    wdata->gles_attributes[attr_pos++] = _this->gl_config.red_size;
-    wdata->gles_attributes[attr_pos++] = EGL_GREEN_SIZE;
-    wdata->gles_attributes[attr_pos++] = _this->gl_config.green_size;
-    wdata->gles_attributes[attr_pos++] = EGL_BLUE_SIZE;
-    wdata->gles_attributes[attr_pos++] = _this->gl_config.blue_size;
-    wdata->gles_attributes[attr_pos++] = EGL_ALPHA_SIZE;
-
-    /* Setup alpha size in bits */
-    if (_this->gl_config.alpha_size) {
-        wdata->gles_attributes[attr_pos++] = _this->gl_config.alpha_size;
-    } else {
-        wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-    }
-
-    /* Setup color buffer size */
-    if (_this->gl_config.buffer_size) {
-        wdata->gles_attributes[attr_pos++] = EGL_BUFFER_SIZE;
-        wdata->gles_attributes[attr_pos++] = _this->gl_config.buffer_size;
-    } else {
-        wdata->gles_attributes[attr_pos++] = EGL_BUFFER_SIZE;
-        wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-    }
-
-    /* Setup depth buffer bits */
-    wdata->gles_attributes[attr_pos++] = EGL_DEPTH_SIZE;
-    wdata->gles_attributes[attr_pos++] = _this->gl_config.depth_size;
-
-    /* Setup stencil bits */
-    if (_this->gl_config.stencil_size) {
-        wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE;
-        wdata->gles_attributes[attr_pos++] = _this->gl_config.buffer_size;
-    } else {
-        wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE;
-        wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-    }
-
-    /* Set number of samples in multisampling */
-    if (_this->gl_config.multisamplesamples) {
-        wdata->gles_attributes[attr_pos++] = EGL_SAMPLES;
-        wdata->gles_attributes[attr_pos++] =
-            _this->gl_config.multisamplesamples;
-    }
-
-    /* Multisample buffers, OpenGL ES 1.0 spec defines 0 or 1 buffer */
-    if (_this->gl_config.multisamplebuffers) {
-        wdata->gles_attributes[attr_pos++] = EGL_SAMPLE_BUFFERS;
-        wdata->gles_attributes[attr_pos++] =
-            _this->gl_config.multisamplebuffers;
-    }
-
-    /* Finish attributes list */
-    wdata->gles_attributes[attr_pos] = EGL_NONE;
-
-    /* Request first suitable framebuffer configuration */
-    status = eglChooseConfig(phdata->egl_display, wdata->gles_attributes,
-                             wdata->gles_configs, 1, &configs);
-    if (status != EGL_TRUE) {
-        SDL_SetError("PND: Can't find closest configuration for OpenGL ES");
-        return NULL;
-    }
-
-    /* Check if nothing has been found, try "don't care" settings */
-    if (configs == 0) {
-        int32_t it;
-        int32_t jt;
-        GLint depthbits[4] = { 32, 24, 16, EGL_DONT_CARE };
-
-        for (it = 0; it < 4; it++) {
-            for (jt = 16; jt >= 0; jt--) {
-                /* Don't care about color buffer bits, use what exist */
-                /* Replace previous set data with EGL_DONT_CARE       */
-                attr_pos = 0;
-                wdata->gles_attributes[attr_pos++] = EGL_SURFACE_TYPE;
-                wdata->gles_attributes[attr_pos++] = EGL_WINDOW_BIT;
-                wdata->gles_attributes[attr_pos++] = EGL_RED_SIZE;
-                wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-                wdata->gles_attributes[attr_pos++] = EGL_GREEN_SIZE;
-                wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-                wdata->gles_attributes[attr_pos++] = EGL_BLUE_SIZE;
-                wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-                wdata->gles_attributes[attr_pos++] = EGL_ALPHA_SIZE;
-                wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-                wdata->gles_attributes[attr_pos++] = EGL_BUFFER_SIZE;
-                wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-
-                /* Try to find requested or smallest depth */
-                if (_this->gl_config.depth_size) {
-                    wdata->gles_attributes[attr_pos++] = EGL_DEPTH_SIZE;
-                    wdata->gles_attributes[attr_pos++] = depthbits[it];
-                } else {
-                    wdata->gles_attributes[attr_pos++] = EGL_DEPTH_SIZE;
-                    wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-                }
-
-                if (_this->gl_config.stencil_size) {
-                    wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE;
-                    wdata->gles_attributes[attr_pos++] = jt;
-                } else {
-                    wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE;
-                    wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-                }
-
-                wdata->gles_attributes[attr_pos++] = EGL_SAMPLES;
-                wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-                wdata->gles_attributes[attr_pos++] = EGL_SAMPLE_BUFFERS;
-                wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE;
-                wdata->gles_attributes[attr_pos] = EGL_NONE;
-
-                /* Request first suitable framebuffer configuration */
-                status =
-                    eglChooseConfig(phdata->egl_display,
-                                    wdata->gles_attributes,
-                                    wdata->gles_configs, 1, &configs);
-
-                if (status != EGL_TRUE) {
-                    SDL_SetError
-                        ("PND: Can't find closest configuration for OpenGL ES");
-                    return NULL;
-                }
-                if (configs != 0) {
-                    break;
-                }
-            }
-            if (configs != 0) {
-                break;
-            }
-        }
-
-        /* No available configs */
-        if (configs == 0) {
-            SDL_SetError("PND: Can't find any configuration for OpenGL ES");
-            return NULL;
-        }
-    }
-
-    /* Initialize config index */
-    wdata->gles_config = 0;
-
-    /* Now check each configuration to find out the best */
-    for (cit = 0; cit < configs; cit++) {
-        uint32_t stencil_found;
-        uint32_t depth_found;
-
-        stencil_found = 0;
-        depth_found = 0;
-
-        if (_this->gl_config.stencil_size) {
-            status =
-                eglGetConfigAttrib(phdata->egl_display,
-                                   wdata->gles_configs[cit], EGL_STENCIL_SIZE,
-                                   &attr_value);
-            if (status == EGL_TRUE) {
-                if (attr_value != 0) {
-                    stencil_found = 1;
-                }
-            }
-        } else {
-            stencil_found = 1;
-        }
-
-        if (_this->gl_config.depth_size) {
-            status =
-                eglGetConfigAttrib(phdata->egl_display,
-                                   wdata->gles_configs[cit], EGL_DEPTH_SIZE,
-                                   &attr_value);
-            if (status == EGL_TRUE) {
-                if (attr_value != 0) {
-                    depth_found = 1;
-                }
-            }
-        } else {
-            depth_found = 1;
-        }
-
-        /* Exit from loop if found appropriate configuration */
-        if ((depth_found != 0) && (stencil_found != 0)) {
-            break;
-        }
-    }
-
-    /* If best could not be found, use first */
-    if (cit == configs) {
-        cit = 0;
-    }
-    wdata->gles_config = cit;
-
-    /* Create OpenGL ES context */
-    wdata->gles_context =
-        eglCreateContext(phdata->egl_display,
-                         wdata->gles_configs[wdata->gles_config], NULL, NULL);
-    if (wdata->gles_context == EGL_NO_CONTEXT) {
-        SDL_SetError("PND: OpenGL ES context creation has been failed");
-        return NULL;
-    }
-
-#ifdef WIZ_GLES_LITE
-    if( !hNativeWnd ) {
-    hNativeWnd = (NativeWindowType)malloc(16*1024);
-
-    if(!hNativeWnd)
-        printf( "Error : Wiz framebuffer allocatation failed\n" );
-    else
-        printf( "SDL13: Wiz framebuffer allocated: %X\n", hNativeWnd );
-    }
-    else {
-    printf( "SDL13: Wiz framebuffer already allocated: %X\n", hNativeWnd );
-    }
-
-    wdata->gles_surface =
-    eglCreateWindowSurface(phdata->egl_display,
-                   wdata->gles_configs[wdata->gles_config],
-                   hNativeWnd, NULL );
-#else
-    wdata->gles_surface =
-        eglCreateWindowSurface(phdata->egl_display,
-                               wdata->gles_configs[wdata->gles_config],
-                               (NativeWindowType) 0, NULL);
-#endif
-
-
-    if (wdata->gles_surface == 0) {
-        SDL_SetError("Error : eglCreateWindowSurface failed;\n");
-        return NULL;
-    }
-
-    /* Make just created context current */
-    status =
-        eglMakeCurrent(phdata->egl_display, wdata->gles_surface,
-                       wdata->gles_surface, wdata->gles_context);
-    if (status != EGL_TRUE) {
-        /* Destroy OpenGL ES surface */
-        eglDestroySurface(phdata->egl_display, wdata->gles_surface);
-        eglDestroyContext(phdata->egl_display, wdata->gles_context);
-        wdata->gles_context = EGL_NO_CONTEXT;
-        SDL_SetError("PND: Can't set OpenGL ES context on creation");
-        return NULL;
-    }
-
-    _this->gl_config.accelerated = 1;
-
-    /* Always clear stereo enable, since OpenGL ES do not supports stereo */
-    _this->gl_config.stereo = 0;
-
-    /* Get back samples and samplebuffers configurations. Rest framebuffer */
-    /* parameters could be obtained through the OpenGL ES API              */
-    status =
-        eglGetConfigAttrib(phdata->egl_display,
-                           wdata->gles_configs[wdata->gles_config],
-                           EGL_SAMPLES, &attr_value);
-    if (status == EGL_TRUE) {
-        _this->gl_config.multisamplesamples = attr_value;
-    }
-    status =
-        eglGetConfigAttrib(phdata->egl_display,
-                           wdata->gles_configs[wdata->gles_config],
-                           EGL_SAMPLE_BUFFERS, &attr_value);
-    if (status == EGL_TRUE) {
-        _this->gl_config.multisamplebuffers = attr_value;
-    }
-
-    /* Get back stencil and depth buffer sizes */
-    status =
-        eglGetConfigAttrib(phdata->egl_display,
-                           wdata->gles_configs[wdata->gles_config],
-                           EGL_DEPTH_SIZE, &attr_value);
-    if (status == EGL_TRUE) {
-        _this->gl_config.depth_size = attr_value;
-    }
-    status =
-        eglGetConfigAttrib(phdata->egl_display,
-                           wdata->gles_configs[wdata->gles_config],
-                           EGL_STENCIL_SIZE, &attr_value);
-    if (status == EGL_TRUE) {
-        _this->gl_config.stencil_size = attr_value;
-    }
-
-    /* Under PND OpenGL ES output can't be double buffered */
-    _this->gl_config.double_buffer = 0;
-
-    /* GL ES context was successfully created */
-    return wdata->gles_context;
-}
-
-int
-PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-    SDL_WindowData *wdata;
-    EGLBoolean status;
-
-    if (phdata->egl_initialized != SDL_TRUE) {
-        return SDL_SetError("PND: GF initialization failed, no OpenGL ES support");
-    }
-
-    if ((window == NULL) && (context == NULL)) {
-        status =
-            eglMakeCurrent(phdata->egl_display, EGL_NO_SURFACE,
-                           EGL_NO_SURFACE, EGL_NO_CONTEXT);
-        if (status != EGL_TRUE) {
-            /* Failed to set current GL ES context */
-            return SDL_SetError("PND: Can't set OpenGL ES context");
-        }
-    } else {
-        wdata = (SDL_WindowData *) window->driverdata;
-        if (wdata->gles_surface == EGL_NO_SURFACE) {
-            return SDL_SetError
-                ("PND: OpenGL ES surface is not initialized for this window");
-        }
-        if (wdata->gles_context == EGL_NO_CONTEXT) {
-            return SDL_SetError
-                ("PND: OpenGL ES context is not initialized for this window");
-        }
-        if (wdata->gles_context != context) {
-            return SDL_SetError
-                ("PND: OpenGL ES context is not belong to this window");
-        }
-        status =
-            eglMakeCurrent(phdata->egl_display, wdata->gles_surface,
-                           wdata->gles_surface, wdata->gles_context);
-        if (status != EGL_TRUE) {
-            /* Failed to set current GL ES context */
-            return SDL_SetError("PND: Can't set OpenGL ES context");
-        }
-    }
-    return 0;
-}
-
-int
-PND_gl_setswapinterval(_THIS, int interval)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-    EGLBoolean status;
-
-    if (phdata->egl_initialized != SDL_TRUE) {
-        return SDL_SetError("PND: EGL initialization failed, no OpenGL ES support");
-    }
-
-    /* Check if OpenGL ES connection has been initialized */
-    if (phdata->egl_display != EGL_NO_DISPLAY) {
-        /* Set swap OpenGL ES interval */
-        status = eglSwapInterval(phdata->egl_display, interval);
-        if (status == EGL_TRUE) {
-            /* Return success to upper level */
-            phdata->swapinterval = interval;
-            return 0;
-        }
-    }
-
-    /* Failed to set swap interval */
-    return SDL_SetError("PND: Cannot set swap interval");
-}
-
-int
-PND_gl_getswapinterval(_THIS)
-{
-    return ((SDL_VideoData *) _this->driverdata)->swapinterval;
-}
-
-void
-PND_gl_swapwindow(_THIS, SDL_Window * window)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-    SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *didata =
-        (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
-
-
-    if (phdata->egl_initialized != SDL_TRUE) {
-        SDL_SetError("PND: GLES initialization failed, no OpenGL ES support");
-        return;
-    }
-
-    /* Many applications do not uses glFinish(), so we call it for them */
-    glFinish();
-
-    /* Wait until OpenGL ES rendering is completed */
-    eglWaitGL();
-
-    eglSwapBuffers(phdata->egl_display, wdata->gles_surface);
-}
-
-void
-PND_gl_deletecontext(_THIS, SDL_GLContext context)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-    EGLBoolean status;
-
-    if (phdata->egl_initialized != SDL_TRUE) {
-        SDL_SetError("PND: GLES initialization failed, no OpenGL ES support");
-        return;
-    }
-
-    /* Check if OpenGL ES connection has been initialized */
-    if (phdata->egl_display != EGL_NO_DISPLAY) {
-        if (context != EGL_NO_CONTEXT) {
-            status = eglDestroyContext(phdata->egl_display, context);
-            if (status != EGL_TRUE) {
-                /* Error during OpenGL ES context destroying */
-                SDL_SetError("PND: OpenGL ES context destroy error");
-                return;
-            }
-        }
-    }
-
-#ifdef WIZ_GLES_LITE
-    if( hNativeWnd != 0 )
-    {
-      free(hNativeWnd);
-      hNativeWnd = 0;
-      printf( "SDL13: Wiz framebuffer released\n" );
-    }
-#endif
-
-    return;
-}
-
-#endif /* SDL_VIDEO_DRIVER_PANDORA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/pandora/SDL_pandora.h b/deps/SDL2/src/video/pandora/SDL_pandora.h
deleted file mode 100644
index 05aafda..0000000
--- a/deps/SDL2/src/video/pandora/SDL_pandora.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef __SDL_PANDORA_H__
-#define __SDL_PANDORA_H__
-
-#include <GLES/egl.h>
-
-#include "SDL_config.h"
-#include "../SDL_sysvideo.h"
-
-typedef struct SDL_VideoData
-{
-    SDL_bool egl_initialized;   /* OpenGL ES device initialization status */
-    EGLDisplay egl_display;     /* OpenGL ES display connection           */
-    uint32_t egl_refcount;      /* OpenGL ES reference count              */
-    uint32_t swapinterval;      /* OpenGL ES default swap interval        */
-
-} SDL_VideoData;
-
-
-typedef struct SDL_DisplayData
-{
-
-} SDL_DisplayData;
-
-
-typedef struct SDL_WindowData
-{
-    SDL_bool uses_gles;         /* if true window must support OpenGL ES */
-
-    EGLConfig gles_configs[32];
-    EGLint gles_config;         /* OpenGL ES configuration index      */
-    EGLContext gles_context;    /* OpenGL ES context                  */
-    EGLint gles_attributes[256];        /* OpenGL ES attributes for context   */
-    EGLSurface gles_surface;    /* OpenGL ES target rendering surface */
-
-} SDL_WindowData;
-
-
-/****************************************************************************/
-/* SDL_VideoDevice functions declaration                                    */
-/****************************************************************************/
-
-/* Display and window functions */
-int PND_videoinit(_THIS);
-void PND_videoquit(_THIS);
-void PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display);
-int PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-int PND_createwindow(_THIS, SDL_Window * window);
-int PND_createwindowfrom(_THIS, SDL_Window * window, const void *data);
-void PND_setwindowtitle(_THIS, SDL_Window * window);
-void PND_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon);
-void PND_setwindowposition(_THIS, SDL_Window * window);
-void PND_setwindowsize(_THIS, SDL_Window * window);
-void PND_showwindow(_THIS, SDL_Window * window);
-void PND_hidewindow(_THIS, SDL_Window * window);
-void PND_raisewindow(_THIS, SDL_Window * window);
-void PND_maximizewindow(_THIS, SDL_Window * window);
-void PND_minimizewindow(_THIS, SDL_Window * window);
-void PND_restorewindow(_THIS, SDL_Window * window);
-void PND_setwindowgrab(_THIS, SDL_Window * window);
-void PND_destroywindow(_THIS, SDL_Window * window);
-
-/* Window manager function */
-SDL_bool PND_getwindowwminfo(_THIS, SDL_Window * window,
-                             struct SDL_SysWMinfo *info);
-
-/* OpenGL/OpenGL ES functions */
-int PND_gl_loadlibrary(_THIS, const char *path);
-void *PND_gl_getprocaddres(_THIS, const char *proc);
-void PND_gl_unloadlibrary(_THIS);
-SDL_GLContext PND_gl_createcontext(_THIS, SDL_Window * window);
-int PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context);
-int PND_gl_setswapinterval(_THIS, int interval);
-int PND_gl_getswapinterval(_THIS);
-void PND_gl_swapwindow(_THIS, SDL_Window * window);
-void PND_gl_deletecontext(_THIS, SDL_GLContext context);
-
-
-#endif /* __SDL_PANDORA_H__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/pandora/SDL_pandora_events.c b/deps/SDL2/src/video/pandora/SDL_pandora_events.c
deleted file mode 100644
index de03519..0000000
--- a/deps/SDL2/src/video/pandora/SDL_pandora_events.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_PANDORA
-
-/* Being a null driver, there's no event stream. We just define stubs for
-   most of the API. */
-
-#include "../../events/SDL_events_c.h"
-
-void
-PND_PumpEvents(_THIS)
-{
-    /* Not implemented. */
-}
-
-#endif /* SDL_VIDEO_DRIVER_PANDORA */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/pandora/SDL_pandora_events.h b/deps/SDL2/src/video/pandora/SDL_pandora_events.h
deleted file mode 100644
index 9aee724..0000000
--- a/deps/SDL2/src/video/pandora/SDL_pandora_events.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-extern void PND_PumpEvents(_THIS);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/psp/SDL_pspevents.c b/deps/SDL2/src/video/psp/SDL_pspevents.c
deleted file mode 100644
index 87bc529..0000000
--- a/deps/SDL2/src/video/psp/SDL_pspevents.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* Being a null driver, there's no event stream. We just define stubs for
-   most of the API. */
-
-#include "SDL.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "../../events/SDL_keyboard_c.h"
-#include "SDL_pspvideo.h"
-#include "SDL_pspevents_c.h"
-#include "SDL_thread.h"
-#include "SDL_keyboard.h"
-#include <psphprm.h>
-
-#ifdef PSPIRKEYB
-#include <pspirkeyb.h>
-#include <pspirkeyb_rawkeys.h>
-
-#define IRKBD_CONFIG_FILE     NULL    /* this will take ms0:/seplugins/pspirkeyb.ini */
-
-static int irkbd_ready = 0;
-static SDLKey keymap[256];
-#endif
-
-static enum PspHprmKeys hprm = 0;
-static SDL_sem *event_sem = NULL;
-static SDL_Thread *thread = NULL;
-static int running = 0;
-static struct {
-    enum PspHprmKeys id;
-    SDL_Keycode sym;
-} keymap_psp[] = {
-    { PSP_HPRM_PLAYPAUSE, SDLK_F10 },
-    { PSP_HPRM_FORWARD,   SDLK_F11 },
-    { PSP_HPRM_BACK,      SDLK_F12 },
-    { PSP_HPRM_VOL_UP,    SDLK_F13 },
-    { PSP_HPRM_VOL_DOWN,  SDLK_F14 },
-    { PSP_HPRM_HOLD,      SDLK_F15 }
-};
-
-int EventUpdate(void *data)
-{
-    while (running) {
-                SDL_SemWait(event_sem);
-                                sceHprmPeekCurrentKey(&hprm);
-                SDL_SemPost(event_sem);
-                /* Delay 1/60th of a second */
-                sceKernelDelayThread(1000000 / 60);
-        }
-        return 0;
-}
-
-void PSP_PumpEvents(_THIS)
-{
-    int i;
-    enum PspHprmKeys keys;
-    enum PspHprmKeys changed;
-    static enum PspHprmKeys old_keys = 0;
-    SDL_Keysym sym;
-
-    SDL_SemWait(event_sem);
-    keys = hprm;
-    SDL_SemPost(event_sem);
-
-    /* HPRM Keyboard */
-    changed = old_keys ^ keys;
-    old_keys = keys;
-    if(changed) {
-        for(i=0; i<sizeof(keymap_psp)/sizeof(keymap_psp[0]); i++) {
-            if(changed & keymap_psp[i].id) {
-                sym.scancode = keymap_psp[i].id;
-                sym.sym = keymap_psp[i].sym;
-
-                /* out of date
-                SDL_PrivateKeyboard((keys & keymap_psp[i].id) ?
-                            SDL_PRESSED : SDL_RELEASED,
-                            &sym);
-        */
-                SDL_SendKeyboardKey((keys & keymap_psp[i].id) ?
-                                    SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap_psp[i].sym));
-            }
-        }
-    }
-
-#ifdef PSPIRKEYB
-    if (irkbd_ready) {
-            unsigned char buffer[255];
-        int i, length, count;
-        SIrKeybScanCodeData *scanData;
-
-            if(pspIrKeybReadinput(buffer, &length) >= 0) {
-                if((length % sizeof(SIrKeybScanCodeData)) == 0){
-                    count = length / sizeof(SIrKeybScanCodeData);
-                    for( i=0; i < count; i++ ) {
-                unsigned char raw, pressed;
-                        scanData=(SIrKeybScanCodeData*) buffer+i;
-                        raw = scanData->raw;
-                        pressed = scanData->pressed;
-                sym.scancode = raw;
-                sym.sym = keymap[raw];
-                /* not tested */
-                /* SDL_PrivateKeyboard(pressed?SDL_PRESSED:SDL_RELEASED, &sym); */
-                SDL_SendKeyboardKey((keys & keymap_psp[i].id) ?
-                                    SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap[raw]);
-
-                }
-            }
-        }
-    }
-#endif
-    sceKernelDelayThread(0);
-
-    return;
-}
-
-void PSP_InitOSKeymap(_THIS)
-{
-#ifdef PSPIRKEYB
-    int i;
-    for (i=0; i<SDL_TABLESIZE(keymap); ++i)
-        keymap[i] = SDLK_UNKNOWN;
-
-    keymap[KEY_ESC] = SDLK_ESCAPE;
-
-    keymap[KEY_F1] = SDLK_F1;
-    keymap[KEY_F2] = SDLK_F2;
-    keymap[KEY_F3] = SDLK_F3;
-    keymap[KEY_F4] = SDLK_F4;
-    keymap[KEY_F5] = SDLK_F5;
-    keymap[KEY_F6] = SDLK_F6;
-    keymap[KEY_F7] = SDLK_F7;
-    keymap[KEY_F8] = SDLK_F8;
-    keymap[KEY_F9] = SDLK_F9;
-    keymap[KEY_F10] = SDLK_F10;
-    keymap[KEY_F11] = SDLK_F11;
-    keymap[KEY_F12] = SDLK_F12;
-    keymap[KEY_F13] = SDLK_PRINT;
-    keymap[KEY_F14] = SDLK_PAUSE;
-
-    keymap[KEY_GRAVE] = SDLK_BACKQUOTE;
-    keymap[KEY_1] = SDLK_1;
-    keymap[KEY_2] = SDLK_2;
-    keymap[KEY_3] = SDLK_3;
-    keymap[KEY_4] = SDLK_4;
-    keymap[KEY_5] = SDLK_5;
-    keymap[KEY_6] = SDLK_6;
-    keymap[KEY_7] = SDLK_7;
-    keymap[KEY_8] = SDLK_8;
-    keymap[KEY_9] = SDLK_9;
-    keymap[KEY_0] = SDLK_0;
-    keymap[KEY_MINUS] = SDLK_MINUS;
-    keymap[KEY_EQUAL] = SDLK_EQUALS;
-    keymap[KEY_BACKSPACE] = SDLK_BACKSPACE;
-
-    keymap[KEY_TAB] = SDLK_TAB;
-    keymap[KEY_Q] = SDLK_q;
-    keymap[KEY_W] = SDLK_w;
-    keymap[KEY_E] = SDLK_e;
-    keymap[KEY_R] = SDLK_r;
-    keymap[KEY_T] = SDLK_t;
-    keymap[KEY_Y] = SDLK_y;
-    keymap[KEY_U] = SDLK_u;
-    keymap[KEY_I] = SDLK_i;
-    keymap[KEY_O] = SDLK_o;
-    keymap[KEY_P] = SDLK_p;
-    keymap[KEY_LEFTBRACE] = SDLK_LEFTBRACKET;
-    keymap[KEY_RIGHTBRACE] = SDLK_RIGHTBRACKET;
-    keymap[KEY_ENTER] = SDLK_RETURN;
-
-    keymap[KEY_CAPSLOCK] = SDLK_CAPSLOCK;
-    keymap[KEY_A] = SDLK_a;
-    keymap[KEY_S] = SDLK_s;
-    keymap[KEY_D] = SDLK_d;
-    keymap[KEY_F] = SDLK_f;
-    keymap[KEY_G] = SDLK_g;
-    keymap[KEY_H] = SDLK_h;
-    keymap[KEY_J] = SDLK_j;
-    keymap[KEY_K] = SDLK_k;
-    keymap[KEY_L] = SDLK_l;
-    keymap[KEY_SEMICOLON] = SDLK_SEMICOLON;
-    keymap[KEY_APOSTROPHE] = SDLK_QUOTE;
-    keymap[KEY_BACKSLASH] = SDLK_BACKSLASH;
-
-    keymap[KEY_Z] = SDLK_z;
-    keymap[KEY_X] = SDLK_x;
-    keymap[KEY_C] = SDLK_c;
-    keymap[KEY_V] = SDLK_v;
-    keymap[KEY_B] = SDLK_b;
-    keymap[KEY_N] = SDLK_n;
-    keymap[KEY_M] = SDLK_m;
-    keymap[KEY_COMMA] = SDLK_COMMA;
-    keymap[KEY_DOT] = SDLK_PERIOD;
-    keymap[KEY_SLASH] = SDLK_SLASH;
-
-    keymap[KEY_SPACE] = SDLK_SPACE;
-
-    keymap[KEY_UP] = SDLK_UP;
-    keymap[KEY_DOWN] = SDLK_DOWN;
-    keymap[KEY_LEFT] = SDLK_LEFT;
-    keymap[KEY_RIGHT] = SDLK_RIGHT;
-
-    keymap[KEY_HOME] = SDLK_HOME;
-    keymap[KEY_END] = SDLK_END;
-    keymap[KEY_INSERT] = SDLK_INSERT;
-    keymap[KEY_DELETE] = SDLK_DELETE;
-
-    keymap[KEY_NUMLOCK] = SDLK_NUMLOCK;
-    keymap[KEY_LEFTMETA] = SDLK_LSUPER;
-
-    keymap[KEY_KPSLASH] = SDLK_KP_DIVIDE;
-    keymap[KEY_KPASTERISK] = SDLK_KP_MULTIPLY;
-    keymap[KEY_KPMINUS] = SDLK_KP_MINUS;
-    keymap[KEY_KPPLUS] = SDLK_KP_PLUS;
-    keymap[KEY_KPDOT] = SDLK_KP_PERIOD;
-    keymap[KEY_KPEQUAL] = SDLK_KP_EQUALS;
-
-    keymap[KEY_LEFTCTRL] = SDLK_LCTRL;
-    keymap[KEY_RIGHTCTRL] = SDLK_RCTRL;
-    keymap[KEY_LEFTALT] = SDLK_LALT;
-    keymap[KEY_RIGHTALT] = SDLK_RALT;
-    keymap[KEY_LEFTSHIFT] = SDLK_LSHIFT;
-    keymap[KEY_RIGHTSHIFT] = SDLK_RSHIFT;
-#endif
-}
-
-void PSP_EventInit(_THIS)
-{
-#ifdef PSPIRKEYB
-    int outputmode = PSP_IRKBD_OUTPUT_MODE_SCANCODE;
-    int ret = pspIrKeybInit(IRKBD_CONFIG_FILE, 0);
-    if (ret == PSP_IRKBD_RESULT_OK) {
-            pspIrKeybOutputMode(outputmode);
-        irkbd_ready = 1;
-    } else {
-        irkbd_ready = 0;
-    }
-#endif
-    /* Start thread to read data */
-    if((event_sem =  SDL_CreateSemaphore(1)) == NULL) {
-        SDL_SetError("Can't create input semaphore\n");
-        return;
-    }
-    running = 1;
-    if((thread = SDL_CreateThread(EventUpdate, "PSPInputThread",NULL)) == NULL) {
-        SDL_SetError("Can't create input thread\n");
-        return;
-    }
-}
-
-void PSP_EventQuit(_THIS)
-{
-    running = 0;
-    SDL_WaitThread(thread, NULL);
-    SDL_DestroySemaphore(event_sem);
-#ifdef PSPIRKEYB
-    if (irkbd_ready) {
-            pspIrKeybFinish();
-        irkbd_ready = 0;
-    }
-#endif
-}
-
-/* end of SDL_pspevents.c ... */
-
diff --git a/deps/SDL2/src/video/psp/SDL_pspevents_c.h b/deps/SDL2/src/video/psp/SDL_pspevents_c.h
deleted file mode 100644
index e02c11d..0000000
--- a/deps/SDL2/src/video/psp/SDL_pspevents_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_pspvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
-   of the native video subsystem (SDL_sysvideo.c)
-*/
-extern void PSP_InitOSKeymap(_THIS);
-extern void PSP_PumpEvents(_THIS);
-
-/* end of SDL_pspevents_c.h ... */
-
diff --git a/deps/SDL2/src/video/psp/SDL_pspgl.c b/deps/SDL2/src/video/psp/SDL_pspgl.c
deleted file mode 100644
index fbbc20c..0000000
--- a/deps/SDL2/src/video/psp/SDL_pspgl.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "SDL_error.h"
-#include "SDL_pspvideo.h"
-#include "SDL_pspgl_c.h"
-
-/*****************************************************************************/
-/* SDL OpenGL/OpenGL ES functions                                            */
-/*****************************************************************************/
-#define EGLCHK(stmt)                            \
-    do {                                        \
-        EGLint err;                             \
-                                                \
-        stmt;                                   \
-        err = eglGetError();                    \
-        if (err != EGL_SUCCESS) {               \
-            SDL_SetError("EGL error %d", err);  \
-            return 0;                           \
-        }                                       \
-    } while (0)
-
-int
-PSP_GL_LoadLibrary(_THIS, const char *path)
-{
-  if (!_this->gl_config.driver_loaded) {
-        _this->gl_config.driver_loaded = 1;
-  }
-
-  return 0;
-}
-
-/* pspgl doesn't provide this call, so stub it out since SDL requires it.
-#define GLSTUB(func,params) void func params {}
-
-GLSTUB(glOrtho,(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top,
-                    GLdouble zNear, GLdouble zFar))
-*/
-void *
-PSP_GL_GetProcAddress(_THIS, const char *proc)
-{
-        return eglGetProcAddress(proc);
-}
-
-void
-PSP_GL_UnloadLibrary(_THIS)
-{
-        eglTerminate(_this->gl_data->display);
-}
-
-static EGLint width = 480;
-static EGLint height = 272;
-
-SDL_GLContext
-PSP_GL_CreateContext(_THIS, SDL_Window * window)
-{
-
-    SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata;
-
-        EGLint attribs[32];
-        EGLDisplay display;
-        EGLContext context;
-        EGLSurface surface;
-        EGLConfig config;
-        EGLint num_configs;
-        int i;
-
-
-    /* EGL init taken from glutCreateWindow() in PSPGL's glut.c. */
-        EGLCHK(display = eglGetDisplay(0));
-        EGLCHK(eglInitialize(display, NULL, NULL));
-    wdata->uses_gles = SDL_TRUE;
-        window->flags |= SDL_WINDOW_FULLSCREEN;
-
-        /* Setup the config based on SDL's current values. */
-        i = 0;
-        attribs[i++] = EGL_RED_SIZE;
-        attribs[i++] = _this->gl_config.red_size;
-        attribs[i++] = EGL_GREEN_SIZE;
-        attribs[i++] = _this->gl_config.green_size;
-        attribs[i++] = EGL_BLUE_SIZE;
-        attribs[i++] = _this->gl_config.blue_size;
-        attribs[i++] = EGL_DEPTH_SIZE;
-        attribs[i++] = _this->gl_config.depth_size;
-
-        if (_this->gl_config.alpha_size)
-        {
-            attribs[i++] = EGL_ALPHA_SIZE;
-            attribs[i++] = _this->gl_config.alpha_size;
-        }
-        if (_this->gl_config.stencil_size)
-        {
-            attribs[i++] = EGL_STENCIL_SIZE;
-            attribs[i++] = _this->gl_config.stencil_size;
-        }
-
-        attribs[i++] = EGL_NONE;
-
-        EGLCHK(eglChooseConfig(display, attribs, &config, 1, &num_configs));
-
-        if (num_configs == 0)
-        {
-            SDL_SetError("No valid EGL configs for requested mode");
-            return 0;
-        }
-
-        EGLCHK(eglGetConfigAttrib(display, config, EGL_WIDTH, &width));
-        EGLCHK(eglGetConfigAttrib(display, config, EGL_HEIGHT, &height));
-
-        EGLCHK(context = eglCreateContext(display, config, NULL, NULL));
-        EGLCHK(surface = eglCreateWindowSurface(display, config, 0, NULL));
-        EGLCHK(eglMakeCurrent(display, surface, surface, context));
-
-        _this->gl_data->display = display;
-        _this->gl_data->context = context;
-        _this->gl_data->surface = surface;
-
-
-    return context;
-}
-
-int
-PSP_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
-{
-        if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface,
-                          _this->gl_data->surface, _this->gl_data->context))
-        {
-            return SDL_SetError("Unable to make EGL context current");
-        }
-    return 0;
-}
-
-int
-PSP_GL_SetSwapInterval(_THIS, int interval)
-{
-    EGLBoolean status;
-    status = eglSwapInterval(_this->gl_data->display, interval);
-    if (status == EGL_TRUE) {
-        /* Return success to upper level */
-        _this->gl_data->swapinterval = interval;
-        return 0;
-    }
-    /* Failed to set swap interval */
-    return SDL_SetError("Unable to set the EGL swap interval");
-}
-
-int
-PSP_GL_GetSwapInterval(_THIS)
-{
-    return _this->gl_data->swapinterval;
-}
-
-void
-PSP_GL_SwapWindow(_THIS, SDL_Window * window)
-{
-    eglSwapBuffers(_this->gl_data->display, _this->gl_data->surface);
-}
-
-void
-PSP_GL_DeleteContext(_THIS, SDL_GLContext context)
-{
-    SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
-    EGLBoolean status;
-
-    if (phdata->egl_initialized != SDL_TRUE) {
-        SDL_SetError("PSP: GLES initialization failed, no OpenGL ES support");
-        return;
-    }
-
-    /* Check if OpenGL ES connection has been initialized */
-    if (_this->gl_data->display != EGL_NO_DISPLAY) {
-        if (context != EGL_NO_CONTEXT) {
-            status = eglDestroyContext(_this->gl_data->display, context);
-            if (status != EGL_TRUE) {
-                /* Error during OpenGL ES context destroying */
-                SDL_SetError("PSP: OpenGL ES context destroy error");
-                return;
-            }
-        }
-    }
-
-    return;
-}
-
diff --git a/deps/SDL2/src/video/psp/SDL_pspgl_c.h b/deps/SDL2/src/video/psp/SDL_pspgl_c.h
deleted file mode 100644
index 8b20d15..0000000
--- a/deps/SDL2/src/video/psp/SDL_pspgl_c.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_pspgl_c_h
-#define _SDL_pspgl_c_h
-
-
-#include <GLES/egl.h>
-#include <GLES/gl.h>
-
-#include "SDL_pspvideo.h"
-
-
-typedef struct SDL_GLDriverData {
-        EGLDisplay display;
-        EGLContext context;
-        EGLSurface surface;
-    uint32_t swapinterval;
-}SDL_GLDriverData;
-
-extern void * PSP_GL_GetProcAddress(_THIS, const char *proc);
-extern int PSP_GL_MakeCurrent(_THIS,SDL_Window * window, SDL_GLContext context);
-extern void PSP_GL_SwapBuffers(_THIS);
-
-extern void PSP_GL_SwapWindow(_THIS, SDL_Window * window);
-extern SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window * window);
-
-extern int PSP_GL_LoadLibrary(_THIS, const char *path);
-extern void PSP_GL_UnloadLibrary(_THIS);
-extern int PSP_GL_SetSwapInterval(_THIS, int interval);
-extern int PSP_GL_GetSwapInterval(_THIS);
-
-
-#endif /* _SDL_pspgl_c_h */
diff --git a/deps/SDL2/src/video/psp/SDL_pspmouse.c b/deps/SDL2/src/video/psp/SDL_pspmouse.c
deleted file mode 100644
index 002a518..0000000
--- a/deps/SDL2/src/video/psp/SDL_pspmouse.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include <stdio.h>
-
-#include "SDL_error.h"
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_pspmouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
-    int unused;
-};
diff --git a/deps/SDL2/src/video/psp/SDL_pspmouse_c.h b/deps/SDL2/src/video/psp/SDL_pspmouse_c.h
deleted file mode 100644
index a0836a3..0000000
--- a/deps/SDL2/src/video/psp/SDL_pspmouse_c.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_pspvideo.h"
-
-/* Functions to be exported */
diff --git a/deps/SDL2/src/video/psp/SDL_pspvideo.c b/deps/SDL2/src/video/psp/SDL_pspvideo.c
deleted file mode 100644
index 64b48eb..0000000
--- a/deps/SDL2/src/video/psp/SDL_pspvideo.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_PSP
-
-/* SDL internals */
-#include "../SDL_sysvideo.h"
-#include "SDL_version.h"
-#include "SDL_syswm.h"
-#include "SDL_loadso.h"
-#include "SDL_events.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/SDL_keyboard_c.h"
-
-
-
-/* PSP declarations */
-#include "SDL_pspvideo.h"
-#include "SDL_pspevents_c.h"
-#include "SDL_pspgl_c.h"
-
-/* unused
-static SDL_bool PSP_initialized = SDL_FALSE;
-*/
-static int
-PSP_Available(void)
-{
-    return 1;
-}
-
-static void
-PSP_Destroy(SDL_VideoDevice * device)
-{
-/*    SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; */
-
-    if (device->driverdata != NULL) {
-        device->driverdata = NULL;
-    }
-}
-
-static SDL_VideoDevice *
-PSP_Create()
-{
-    SDL_VideoDevice *device;
-    SDL_VideoData *phdata;
-    SDL_GLDriverData *gldata;
-    int status;
-
-    /* Check if pandora could be initialized */
-    status = PSP_Available();
-    if (status == 0) {
-        /* PSP could not be used */
-        return NULL;
-    }
-
-    /* Initialize SDL_VideoDevice structure */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-    if (device == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    /* Initialize internal Pandora specific data */
-    phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
-    if (phdata == NULL) {
-        SDL_OutOfMemory();
-        SDL_free(device);
-        return NULL;
-    }
-
-        gldata = (SDL_GLDriverData *) SDL_calloc(1, sizeof(SDL_GLDriverData));
-    if (gldata == NULL) {
-        SDL_OutOfMemory();
-        SDL_free(device);
-        return NULL;
-    }
-    device->gl_data = gldata;
-
-    device->driverdata = phdata;
-
-    phdata->egl_initialized = SDL_TRUE;
-
-
-    /* Setup amount of available displays and current display */
-    device->num_displays = 0;
-
-    /* Set device free function */
-    device->free = PSP_Destroy;
-
-    /* Setup all functions which we can handle */
-    device->VideoInit = PSP_VideoInit;
-    device->VideoQuit = PSP_VideoQuit;
-    device->GetDisplayModes = PSP_GetDisplayModes;
-    device->SetDisplayMode = PSP_SetDisplayMode;
-    device->CreateWindow = PSP_CreateWindow;
-    device->CreateWindowFrom = PSP_CreateWindowFrom;
-    device->SetWindowTitle = PSP_SetWindowTitle;
-    device->SetWindowIcon = PSP_SetWindowIcon;
-    device->SetWindowPosition = PSP_SetWindowPosition;
-    device->SetWindowSize = PSP_SetWindowSize;
-    device->ShowWindow = PSP_ShowWindow;
-    device->HideWindow = PSP_HideWindow;
-    device->RaiseWindow = PSP_RaiseWindow;
-    device->MaximizeWindow = PSP_MaximizeWindow;
-    device->MinimizeWindow = PSP_MinimizeWindow;
-    device->RestoreWindow = PSP_RestoreWindow;
-    device->SetWindowGrab = PSP_SetWindowGrab;
-    device->DestroyWindow = PSP_DestroyWindow;
-    device->GetWindowWMInfo = PSP_GetWindowWMInfo;
-    device->GL_LoadLibrary = PSP_GL_LoadLibrary;
-    device->GL_GetProcAddress = PSP_GL_GetProcAddress;
-    device->GL_UnloadLibrary = PSP_GL_UnloadLibrary;
-    device->GL_CreateContext = PSP_GL_CreateContext;
-    device->GL_MakeCurrent = PSP_GL_MakeCurrent;
-    device->GL_SetSwapInterval = PSP_GL_SetSwapInterval;
-    device->GL_GetSwapInterval = PSP_GL_GetSwapInterval;
-    device->GL_SwapWindow = PSP_GL_SwapWindow;
-    device->GL_DeleteContext = PSP_GL_DeleteContext;
-    device->HasScreenKeyboardSupport = PSP_HasScreenKeyboardSupport;
-    device->ShowScreenKeyboard = PSP_ShowScreenKeyboard;
-    device->HideScreenKeyboard = PSP_HideScreenKeyboard;
-    device->IsScreenKeyboardShown = PSP_IsScreenKeyboardShown;
-
-    device->PumpEvents = PSP_PumpEvents;
-
-    return device;
-}
-
-VideoBootStrap PSP_bootstrap = {
-    "PSP",
-    "PSP Video Driver",
-    PSP_Available,
-    PSP_Create
-};
-
-/*****************************************************************************/
-/* SDL Video and Display initialization/handling functions                   */
-/*****************************************************************************/
-int
-PSP_VideoInit(_THIS)
-{
-    SDL_VideoDisplay display;
-    SDL_DisplayMode current_mode;
-
-    SDL_zero(current_mode);
-
-    current_mode.w = 480;
-    current_mode.h = 272;
-
-    current_mode.refresh_rate = 60;
-    /* 32 bpp for default */
-    current_mode.format = SDL_PIXELFORMAT_ABGR8888;
-
-    current_mode.driverdata = NULL;
-
-    SDL_zero(display);
-    display.desktop_mode = current_mode;
-    display.current_mode = current_mode;
-    display.driverdata = NULL;
-
-    SDL_AddVideoDisplay(&display);
-
-    return 1;
-}
-
-void
-PSP_VideoQuit(_THIS)
-{
-
-}
-
-void
-PSP_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
-{
-
-}
-
-int
-PSP_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
-{
-    return 0;
-}
-#define EGLCHK(stmt)                            \
-    do {                                        \
-        EGLint err;                             \
-                                                \
-        stmt;                                   \
-        err = eglGetError();                    \
-        if (err != EGL_SUCCESS) {               \
-            SDL_SetError("EGL error %d", err);  \
-            return 0;                           \
-        }                                       \
-    } while (0)
-
-int
-PSP_CreateWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *wdata;
-
-    /* Allocate window internal data */
-    wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData));
-    if (wdata == NULL) {
-        return SDL_OutOfMemory();
-    }
-
-    /* Setup driver data for this window */
-    window->driverdata = wdata;
-
-
-    /* Window has been successfully created */
-    return 0;
-}
-
-int
-PSP_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
-{
-    return -1;
-}
-
-void
-PSP_SetWindowTitle(_THIS, SDL_Window * window)
-{
-}
-void
-PSP_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
-{
-}
-void
-PSP_SetWindowPosition(_THIS, SDL_Window * window)
-{
-}
-void
-PSP_SetWindowSize(_THIS, SDL_Window * window)
-{
-}
-void
-PSP_ShowWindow(_THIS, SDL_Window * window)
-{
-}
-void
-PSP_HideWindow(_THIS, SDL_Window * window)
-{
-}
-void
-PSP_RaiseWindow(_THIS, SDL_Window * window)
-{
-}
-void
-PSP_MaximizeWindow(_THIS, SDL_Window * window)
-{
-}
-void
-PSP_MinimizeWindow(_THIS, SDL_Window * window)
-{
-}
-void
-PSP_RestoreWindow(_THIS, SDL_Window * window)
-{
-}
-void
-PSP_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
-{
-
-}
-void
-PSP_DestroyWindow(_THIS, SDL_Window * window)
-{
-}
-
-/*****************************************************************************/
-/* SDL Window Manager function                                               */
-/*****************************************************************************/
-SDL_bool
-PSP_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
-{
-    if (info->version.major <= SDL_MAJOR_VERSION) {
-        return SDL_TRUE;
-    } else {
-        SDL_SetError("application not compiled with SDL %d.%d\n",
-                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
-        return SDL_FALSE;
-    }
-
-    /* Failed to get window manager information */
-    return SDL_FALSE;
-}
-
-
-/* TO Write Me */
-SDL_bool PSP_HasScreenKeyboardSupport(_THIS)
-{
-    return SDL_FALSE;
-}
-void PSP_ShowScreenKeyboard(_THIS, SDL_Window *window)
-{
-}
-void PSP_HideScreenKeyboard(_THIS, SDL_Window *window)
-{
-}
-SDL_bool PSP_IsScreenKeyboardShown(_THIS, SDL_Window *window)
-{
-    return SDL_FALSE;
-}
-
-
-#endif /* SDL_VIDEO_DRIVER_PSP */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/psp/SDL_pspvideo.h b/deps/SDL2/src/video/psp/SDL_pspvideo.h
deleted file mode 100644
index 5b6435f..0000000
--- a/deps/SDL2/src/video/psp/SDL_pspvideo.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef __SDL_PANDORA_H__
-#define __SDL_PANDORA_H__
-
-#include <GLES/egl.h>
-
-#include "SDL_config.h"
-#include "../SDL_sysvideo.h"
-
-typedef struct SDL_VideoData
-{
-    SDL_bool egl_initialized;   /* OpenGL ES device initialization status */
-    uint32_t egl_refcount;      /* OpenGL ES reference count              */
-
-
-
-} SDL_VideoData;
-
-
-typedef struct SDL_DisplayData
-{
-
-} SDL_DisplayData;
-
-
-typedef struct SDL_WindowData
-{
-    SDL_bool uses_gles;         /* if true window must support OpenGL ES */
-
-} SDL_WindowData;
-
-
-
-
-/****************************************************************************/
-/* SDL_VideoDevice functions declaration                                    */
-/****************************************************************************/
-
-/* Display and window functions */
-int PSP_VideoInit(_THIS);
-void PSP_VideoQuit(_THIS);
-void PSP_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
-int PSP_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-int PSP_CreateWindow(_THIS, SDL_Window * window);
-int PSP_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
-void PSP_SetWindowTitle(_THIS, SDL_Window * window);
-void PSP_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
-void PSP_SetWindowPosition(_THIS, SDL_Window * window);
-void PSP_SetWindowSize(_THIS, SDL_Window * window);
-void PSP_ShowWindow(_THIS, SDL_Window * window);
-void PSP_HideWindow(_THIS, SDL_Window * window);
-void PSP_RaiseWindow(_THIS, SDL_Window * window);
-void PSP_MaximizeWindow(_THIS, SDL_Window * window);
-void PSP_MinimizeWindow(_THIS, SDL_Window * window);
-void PSP_RestoreWindow(_THIS, SDL_Window * window);
-void PSP_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
-void PSP_DestroyWindow(_THIS, SDL_Window * window);
-
-/* Window manager function */
-SDL_bool PSP_GetWindowWMInfo(_THIS, SDL_Window * window,
-                             struct SDL_SysWMinfo *info);
-
-/* OpenGL/OpenGL ES functions */
-int PSP_GL_LoadLibrary(_THIS, const char *path);
-void *PSP_GL_GetProcAddress(_THIS, const char *proc);
-void PSP_GL_UnloadLibrary(_THIS);
-SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window * window);
-int PSP_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
-int PSP_GL_SetSwapInterval(_THIS, int interval);
-int PSP_GL_GetSwapInterval(_THIS);
-void PSP_GL_SwapWindow(_THIS, SDL_Window * window);
-void PSP_GL_DeleteContext(_THIS, SDL_GLContext context);
-
-/* PSP on screen keyboard */
-SDL_bool PSP_HasScreenKeyboardSupport(_THIS);
-void PSP_ShowScreenKeyboard(_THIS, SDL_Window *window);
-void PSP_HideScreenKeyboard(_THIS, SDL_Window *window);
-SDL_bool PSP_IsScreenKeyboardShown(_THIS, SDL_Window *window);
-
-#endif /* __SDL_PANDORA_H__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/raspberry/SDL_rpievents.c b/deps/SDL2/src/video/raspberry/SDL_rpievents.c
deleted file mode 100644
index 8c420fe..0000000
--- a/deps/SDL2/src/video/raspberry/SDL_rpievents.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_RPI
-
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "../../events/SDL_keyboard_c.h"
-#include "SDL_rpivideo.h"
-#include "SDL_rpievents_c.h"
-
-#ifdef SDL_INPUT_LINUXEV
-#include "../../input/evdev/SDL_evdev.h"
-#endif
-
-void RPI_PumpEvents(_THIS)
-{
-#ifdef SDL_INPUT_LINUXEV
-    SDL_EVDEV_Poll();
-#endif
-    
-}
-
-#endif /* SDL_VIDEO_DRIVER_RPI */
-
diff --git a/deps/SDL2/src/video/raspberry/SDL_rpievents_c.h b/deps/SDL2/src/video/raspberry/SDL_rpievents_c.h
deleted file mode 100644
index 54d3119..0000000
--- a/deps/SDL2/src/video/raspberry/SDL_rpievents_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_rpievents_c_h
-#define _SDL_rpievents_c_h
-
-#include "SDL_rpivideo.h"
-
-void RPI_PumpEvents(_THIS);
-void RPI_EventInit(_THIS);
-void RPI_EventQuit(_THIS);
-
-#endif /* _SDL_rpievents_c_h */
diff --git a/deps/SDL2/src/video/raspberry/SDL_rpimouse.c b/deps/SDL2/src/video/raspberry/SDL_rpimouse.c
deleted file mode 100644
index 429214b..0000000
--- a/deps/SDL2/src/video/raspberry/SDL_rpimouse.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_RPI
-
-#include "SDL_assert.h"
-#include "SDL_surface.h"
-
-#include "SDL_rpivideo.h"
-#include "SDL_rpimouse.h"
-
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/default_cursor.h"
-
-/* Copied from vc_vchi_dispmanx.h which is bugged and tries to include a non existing file */
-/* Attributes changes flag mask */
-#define ELEMENT_CHANGE_LAYER          (1<<0)
-#define ELEMENT_CHANGE_OPACITY        (1<<1)
-#define ELEMENT_CHANGE_DEST_RECT      (1<<2)
-#define ELEMENT_CHANGE_SRC_RECT       (1<<3)
-#define ELEMENT_CHANGE_MASK_RESOURCE  (1<<4)
-#define ELEMENT_CHANGE_TRANSFORM      (1<<5)
-/* End copied from vc_vchi_dispmanx.h */
-
-static SDL_Cursor *RPI_CreateDefaultCursor(void);
-static SDL_Cursor *RPI_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y);
-static int RPI_ShowCursor(SDL_Cursor * cursor);
-static void RPI_MoveCursor(SDL_Cursor * cursor);
-static void RPI_FreeCursor(SDL_Cursor * cursor);
-static void RPI_WarpMouse(SDL_Window * window, int x, int y);
-
-static SDL_Cursor *
-RPI_CreateDefaultCursor(void)
-{
-    return SDL_CreateCursor(default_cdata, default_cmask, DEFAULT_CWIDTH, DEFAULT_CHEIGHT, DEFAULT_CHOTX, DEFAULT_CHOTY);
-}
-
-/* Create a cursor from a surface */
-static SDL_Cursor *
-RPI_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
-{
-    RPI_CursorData *curdata;
-    SDL_Cursor *cursor;
-    int ret;
-    VC_RECT_T dst_rect;
-    Uint32 dummy;
-        
-    SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888);
-    SDL_assert(surface->pitch == surface->w * 4);
-    
-    cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor));
-    curdata = (RPI_CursorData *) SDL_calloc(1, sizeof(*curdata));
-
-    curdata->hot_x = hot_x;
-    curdata->hot_y = hot_y;
-    curdata->w = surface->w;
-    curdata->h = surface->h;
-    
-    /* This usage is inspired by Wayland/Weston RPI code, how they figured this out is anyone's guess */
-    curdata->resource = vc_dispmanx_resource_create( VC_IMAGE_ARGB8888, surface->w | (surface->pitch << 16), surface->h | (surface->h << 16), &dummy );
-    SDL_assert(curdata->resource);
-    vc_dispmanx_rect_set( &dst_rect, 0, 0, curdata->w, curdata->h);
-    /* A note from Weston: 
-     * vc_dispmanx_resource_write_data() ignores ifmt,
-     * rect.x, rect.width, and uses stride only for computing
-     * the size of the transfer as rect.height * stride.
-     * Therefore we can only write rows starting at x=0.
-     */
-    ret = vc_dispmanx_resource_write_data( curdata->resource, VC_IMAGE_ARGB8888, surface->pitch, surface->pixels, &dst_rect );
-    SDL_assert ( ret == DISPMANX_SUCCESS );
-    
-    cursor->driverdata = curdata;
-    
-    return cursor;
-
-}
-
-/* Show the specified cursor, or hide if cursor is NULL */
-static int
-RPI_ShowCursor(SDL_Cursor * cursor)
-{
-    int ret;
-    DISPMANX_UPDATE_HANDLE_T update;
-    RPI_CursorData *curdata;
-    VC_RECT_T src_rect, dst_rect;
-    SDL_Mouse *mouse;
-    SDL_VideoDisplay *display;
-    SDL_DisplayData *data;
-    VC_DISPMANX_ALPHA_T alpha = {  DISPMANX_FLAGS_ALPHA_FROM_SOURCE /* flags */ , 255 /*opacity 0->255*/,  0 /* mask */ };
-    
-    mouse = SDL_GetMouse();
-    if (mouse == NULL) {
-        return -1;
-    }
-    
-    if (cursor == NULL) {
-        /* FIXME: We hide the current mouse's cursor, what we actually need is *_HideCursor */
-
-        if ( mouse->cur_cursor != NULL && mouse->cur_cursor->driverdata != NULL) {
-            curdata = (RPI_CursorData *) mouse->cur_cursor->driverdata;
-            if (curdata->element > DISPMANX_NO_HANDLE) {
-                update = vc_dispmanx_update_start( 10 );
-                SDL_assert( update );
-                ret = vc_dispmanx_element_remove( update, curdata->element );
-                SDL_assert( ret == DISPMANX_SUCCESS );
-                ret = vc_dispmanx_update_submit_sync( update );
-                SDL_assert( ret == DISPMANX_SUCCESS );
-                curdata->element = DISPMANX_NO_HANDLE;
-            }
-        }
-        return 0;
-    }
-    
-    curdata = (RPI_CursorData *) cursor->driverdata;
-    if (curdata == NULL) {
-        return -1;
-    }
-    
-    if (mouse->focus == NULL) {
-        return -1;
-    }
-    
-    display = SDL_GetDisplayForWindow(mouse->focus);
-    if (display == NULL) {
-        return -1;
-    }
-    
-    data = (SDL_DisplayData*) display->driverdata;
-    if (data == NULL) {
-        return -1;
-    }
-    
-    if (curdata->element == DISPMANX_NO_HANDLE) {
-        vc_dispmanx_rect_set( &src_rect, 0, 0, curdata->w << 16, curdata->h << 16 );
-        vc_dispmanx_rect_set( &dst_rect, 0, 0, curdata->w, curdata->h);
-        
-        update = vc_dispmanx_update_start( 10 );
-        SDL_assert( update );
-
-        curdata->element = vc_dispmanx_element_add( update,
-                                                    data->dispman_display,
-                                                    SDL_RPI_MOUSELAYER, // layer
-                                                    &dst_rect,
-                                                    curdata->resource,
-                                                    &src_rect,
-                                                    DISPMANX_PROTECTION_NONE,
-                                                    &alpha,
-                                                    DISPMANX_NO_HANDLE, // clamp
-                                                    VC_IMAGE_ROT0 );
-        SDL_assert( curdata->element > DISPMANX_NO_HANDLE);
-        ret = vc_dispmanx_update_submit_sync( update );
-        SDL_assert( ret == DISPMANX_SUCCESS );
-    }
-    
-    return 0;
-}
-
-/* Free a window manager cursor */
-static void
-RPI_FreeCursor(SDL_Cursor * cursor)
-{
-    int ret;
-    DISPMANX_UPDATE_HANDLE_T update;
-    RPI_CursorData *curdata;
-    
-    if (cursor != NULL) {
-        curdata = (RPI_CursorData *) cursor->driverdata;
-        
-        if (curdata != NULL) {
-            if (curdata->element != DISPMANX_NO_HANDLE) {
-                update = vc_dispmanx_update_start( 10 );
-                SDL_assert( update );
-                ret = vc_dispmanx_element_remove( update, curdata->element );
-                SDL_assert( ret == DISPMANX_SUCCESS );
-                ret = vc_dispmanx_update_submit_sync( update );
-                SDL_assert( ret == DISPMANX_SUCCESS );
-            }
-            
-            if (curdata->resource != DISPMANX_NO_HANDLE) {
-                ret = vc_dispmanx_resource_delete( curdata->resource );
-                SDL_assert( ret == DISPMANX_SUCCESS );
-            }
-        
-            SDL_free(cursor->driverdata);
-        }
-        SDL_free(cursor);
-    }
-}
-
-/* Warp the mouse to (x,y) */
-static void
-RPI_WarpMouse(SDL_Window * window, int x, int y)
-{
-    RPI_CursorData *curdata;
-    DISPMANX_UPDATE_HANDLE_T update;
-    int ret;
-    VC_RECT_T dst_rect;
-    SDL_Mouse *mouse = SDL_GetMouse();
-    
-    if (mouse != NULL && mouse->cur_cursor != NULL && mouse->cur_cursor->driverdata != NULL) {
-        curdata = (RPI_CursorData *) mouse->cur_cursor->driverdata;
-        if (curdata->element != DISPMANX_NO_HANDLE) {
-            update = vc_dispmanx_update_start( 10 );
-            SDL_assert( update );
-            vc_dispmanx_rect_set( &dst_rect, x, y, curdata->w, curdata->h);
-            ret = vc_dispmanx_element_change_attributes(
-                update,
-                curdata->element,
-                ELEMENT_CHANGE_DEST_RECT,
-                0,
-                0,
-                &dst_rect,
-                NULL,
-                DISPMANX_NO_HANDLE,
-                DISPMANX_NO_ROTATE);
-            SDL_assert( ret == DISPMANX_SUCCESS );
-            /* Submit asynchronously, otherwise the peformance suffers a lot */
-            ret = vc_dispmanx_update_submit( update, 0, NULL );
-            SDL_assert( ret == DISPMANX_SUCCESS );
-        }
-    }    
-}
-
-void
-RPI_InitMouse(_THIS)
-{
-    /* FIXME: Using UDEV it should be possible to scan all mice 
-     * but there's no point in doing so as there's no multimice support...yet!
-     */
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    mouse->CreateCursor = RPI_CreateCursor;
-    mouse->ShowCursor = RPI_ShowCursor;
-    mouse->MoveCursor = RPI_MoveCursor;
-    mouse->FreeCursor = RPI_FreeCursor;
-    mouse->WarpMouse = RPI_WarpMouse;
-
-    SDL_SetDefaultCursor(RPI_CreateDefaultCursor());
-}
-
-void
-RPI_QuitMouse(_THIS)
-{
-    
-}
-
-/* This is called when a mouse motion event occurs */
-static void
-RPI_MoveCursor(SDL_Cursor * cursor)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    RPI_WarpMouse(mouse->focus, mouse->x, mouse->y);
-}
-
-#endif /* SDL_VIDEO_DRIVER_RPI */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/raspberry/SDL_rpimouse.h b/deps/SDL2/src/video/raspberry/SDL_rpimouse.h
deleted file mode 100644
index aa8eec9..0000000
--- a/deps/SDL2/src/video/raspberry/SDL_rpimouse.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SDL_RPI_mouse_h
-#define _SDL_RPI_mouse_h
-
-#include "../SDL_sysvideo.h"
-
-typedef struct _RPI_CursorData RPI_CursorData;
-struct _RPI_CursorData
-{
-    DISPMANX_RESOURCE_HANDLE_T  resource;
-    DISPMANX_ELEMENT_HANDLE_T   element;
-    int                         hot_x, hot_y;
-    int                         w, h;
-};
-
-#define SDL_RPI_CURSORDATA(curs)  RPI_CursorData *curdata = (RPI_CursorData *) ((curs) ? (curs)->driverdata : NULL)
-
-extern void RPI_InitMouse(_THIS);
-extern void RPI_QuitMouse(_THIS);
-
-#endif /* _SDL_RPI_mouse_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/raspberry/SDL_rpiopengles.c b/deps/SDL2/src/video/raspberry/SDL_rpiopengles.c
deleted file mode 100644
index 23c89fe..0000000
--- a/deps/SDL2/src/video/raspberry/SDL_rpiopengles.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL
-
-#include "SDL_rpivideo.h"
-#include "SDL_rpiopengles.h"
-
-/* EGL implementation of SDL OpenGL support */
-
-int
-RPI_GLES_LoadLibrary(_THIS, const char *path) {
-    return SDL_EGL_LoadLibrary(_this, path, EGL_DEFAULT_DISPLAY);
-}
-
-SDL_EGL_CreateContext_impl(RPI)
-SDL_EGL_SwapWindow_impl(RPI)
-SDL_EGL_MakeCurrent_impl(RPI)
-
-#endif /* SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/deps/SDL2/src/video/raspberry/SDL_rpiopengles.h b/deps/SDL2/src/video/raspberry/SDL_rpiopengles.h
deleted file mode 100644
index deb4b2f..0000000
--- a/deps/SDL2/src/video/raspberry/SDL_rpiopengles.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_rpiopengles_h
-#define _SDL_rpiopengles_h
-
-#if SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL
-
-#include "../SDL_sysvideo.h"
-#include "../SDL_egl.h"
-
-/* OpenGLES functions */
-#define RPI_GLES_GetAttribute SDL_EGL_GetAttribute
-#define RPI_GLES_GetProcAddress SDL_EGL_GetProcAddress
-#define RPI_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
-#define RPI_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
-#define RPI_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
-#define RPI_GLES_DeleteContext SDL_EGL_DeleteContext
-
-extern int RPI_GLES_LoadLibrary(_THIS, const char *path);
-extern SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window * window);
-extern void RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
-extern int RPI_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
-
-#endif /* SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL */
-
-#endif /* _SDL_rpiopengles_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/raspberry/SDL_rpivideo.c b/deps/SDL2/src/video/raspberry/SDL_rpivideo.c
deleted file mode 100644
index dfad9ba..0000000
--- a/deps/SDL2/src/video/raspberry/SDL_rpivideo.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_RPI
-
-/* References
- * http://elinux.org/RPi_VideoCore_APIs
- * https://github.com/raspberrypi/firmware/blob/master/opt/vc/src/hello_pi/hello_triangle/triangle.c
- * http://cgit.freedesktop.org/wayland/weston/tree/src/rpi-renderer.c
- * http://cgit.freedesktop.org/wayland/weston/tree/src/compositor-rpi.c
- */
-
-/* SDL internals */
-#include "../SDL_sysvideo.h"
-#include "SDL_version.h"
-#include "SDL_syswm.h"
-#include "SDL_loadso.h"
-#include "SDL_events.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/SDL_keyboard_c.h"
-
-#ifdef SDL_INPUT_LINUXEV
-#include "../../input/evdev/SDL_evdev.h"
-#endif
-
-/* RPI declarations */
-#include "SDL_rpivideo.h"
-#include "SDL_rpievents_c.h"
-#include "SDL_rpiopengles.h"
-#include "SDL_rpimouse.h"
-
-static int
-RPI_Available(void)
-{
-    return 1;
-}
-
-static void
-RPI_Destroy(SDL_VideoDevice * device)
-{
-    /*    SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; */
-
-    if (device->driverdata != NULL) {
-        device->driverdata = NULL;
-    }
-}
-
-static SDL_VideoDevice *
-RPI_Create()
-{
-    SDL_VideoDevice *device;
-    SDL_VideoData *phdata;
-
-    /* Initialize SDL_VideoDevice structure */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-    if (device == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    /* Initialize internal data */
-    phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
-    if (phdata == NULL) {
-        SDL_OutOfMemory();
-        SDL_free(device);
-        return NULL;
-    }
-
-    device->driverdata = phdata;
-
-    /* Setup amount of available displays and current display */
-    device->num_displays = 0;
-
-    /* Set device free function */
-    device->free = RPI_Destroy;
-
-    /* Setup all functions which we can handle */
-    device->VideoInit = RPI_VideoInit;
-    device->VideoQuit = RPI_VideoQuit;
-    device->GetDisplayModes = RPI_GetDisplayModes;
-    device->SetDisplayMode = RPI_SetDisplayMode;
-    device->CreateWindow = RPI_CreateWindow;
-    device->CreateWindowFrom = RPI_CreateWindowFrom;
-    device->SetWindowTitle = RPI_SetWindowTitle;
-    device->SetWindowIcon = RPI_SetWindowIcon;
-    device->SetWindowPosition = RPI_SetWindowPosition;
-    device->SetWindowSize = RPI_SetWindowSize;
-    device->ShowWindow = RPI_ShowWindow;
-    device->HideWindow = RPI_HideWindow;
-    device->RaiseWindow = RPI_RaiseWindow;
-    device->MaximizeWindow = RPI_MaximizeWindow;
-    device->MinimizeWindow = RPI_MinimizeWindow;
-    device->RestoreWindow = RPI_RestoreWindow;
-    device->SetWindowGrab = RPI_SetWindowGrab;
-    device->DestroyWindow = RPI_DestroyWindow;
-    device->GetWindowWMInfo = RPI_GetWindowWMInfo;
-    device->GL_LoadLibrary = RPI_GLES_LoadLibrary;
-    device->GL_GetProcAddress = RPI_GLES_GetProcAddress;
-    device->GL_UnloadLibrary = RPI_GLES_UnloadLibrary;
-    device->GL_CreateContext = RPI_GLES_CreateContext;
-    device->GL_MakeCurrent = RPI_GLES_MakeCurrent;
-    device->GL_SetSwapInterval = RPI_GLES_SetSwapInterval;
-    device->GL_GetSwapInterval = RPI_GLES_GetSwapInterval;
-    device->GL_SwapWindow = RPI_GLES_SwapWindow;
-    device->GL_DeleteContext = RPI_GLES_DeleteContext;
-
-    device->PumpEvents = RPI_PumpEvents;
-
-    return device;
-}
-
-VideoBootStrap RPI_bootstrap = {
-    "RPI",
-    "RPI Video Driver",
-    RPI_Available,
-    RPI_Create
-};
-
-/*****************************************************************************/
-/* SDL Video and Display initialization/handling functions                   */
-/*****************************************************************************/
-int
-RPI_VideoInit(_THIS)
-{
-    SDL_VideoDisplay display;
-    SDL_DisplayMode current_mode;
-    SDL_DisplayData *data;
-    uint32_t w,h;
-
-    /* Initialize BCM Host */
-    bcm_host_init();
-
-    SDL_zero(current_mode);
-
-    if (graphics_get_display_size( 0, &w, &h) < 0) {
-        return -1;
-    }
-
-    current_mode.w = w;
-    current_mode.h = h;
-    /* FIXME: Is there a way to tell the actual refresh rate? */
-    current_mode.refresh_rate = 60;
-    /* 32 bpp for default */
-    current_mode.format = SDL_PIXELFORMAT_ABGR8888;
-
-    current_mode.driverdata = NULL;
-
-    SDL_zero(display);
-    display.desktop_mode = current_mode;
-    display.current_mode = current_mode;
-
-    /* Allocate display internal data */
-    data = (SDL_DisplayData *) SDL_calloc(1, sizeof(SDL_DisplayData));
-    if (data == NULL) {
-        return SDL_OutOfMemory();
-    }
-
-    data->dispman_display = vc_dispmanx_display_open( 0 /* LCD */);
-
-    display.driverdata = data;
-
-    SDL_AddVideoDisplay(&display);
-
-#ifdef SDL_INPUT_LINUXEV    
-    SDL_EVDEV_Init();
-#endif    
-    
-    RPI_InitMouse(_this);
-
-    return 1;
-}
-
-void
-RPI_VideoQuit(_THIS)
-{
-#ifdef SDL_INPUT_LINUXEV    
-    SDL_EVDEV_Quit();
-#endif    
-}
-
-void
-RPI_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
-{
-    /* Only one display mode available, the current one */
-    SDL_AddDisplayMode(display, &display->current_mode);
-}
-
-int
-RPI_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
-{
-    return 0;
-}
-
-int
-RPI_CreateWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *wdata;
-    SDL_VideoDisplay *display;
-    SDL_DisplayData *displaydata;
-    VC_RECT_T dst_rect;
-    VC_RECT_T src_rect;
-    VC_DISPMANX_ALPHA_T         dispman_alpha;
-    DISPMANX_UPDATE_HANDLE_T dispman_update;
-
-    /* Disable alpha, otherwise the app looks composed with whatever dispman is showing (X11, console,etc) */
-    dispman_alpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS; 
-    dispman_alpha.opacity = 0xFF; 
-    dispman_alpha.mask = 0;
-
-    /* Allocate window internal data */
-    wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData));
-    if (wdata == NULL) {
-        return SDL_OutOfMemory();
-    }
-    display = SDL_GetDisplayForWindow(window);
-    displaydata = (SDL_DisplayData *) display->driverdata;
-
-    /* Windows have one size for now */
-    window->w = display->desktop_mode.w;
-    window->h = display->desktop_mode.h;
-
-    /* OpenGL ES is the law here, buddy */
-    window->flags |= SDL_WINDOW_OPENGL;
-
-    /* Create a dispman element and associate a window to it */
-    dst_rect.x = 0;
-    dst_rect.y = 0;
-    dst_rect.width = window->w;
-    dst_rect.height = window->h;
-
-    src_rect.x = 0;
-    src_rect.y = 0;
-    src_rect.width = window->w << 16;
-    src_rect.height = window->h << 16;
-
-    dispman_update = vc_dispmanx_update_start( 0 );
-    wdata->dispman_window.element = vc_dispmanx_element_add ( dispman_update, displaydata->dispman_display, SDL_RPI_VIDEOLAYER /* layer */, &dst_rect, 0/*src*/, &src_rect, DISPMANX_PROTECTION_NONE, &dispman_alpha /*alpha*/, 0/*clamp*/, 0/*transform*/);
-    wdata->dispman_window.width = window->w;
-    wdata->dispman_window.height = window->h;
-    vc_dispmanx_update_submit_sync( dispman_update );
-    
-    if (!_this->egl_data) {
-        if (SDL_GL_LoadLibrary(NULL) < 0) {
-            return -1;
-        }
-    }
-    wdata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) &wdata->dispman_window);
-
-    if (wdata->egl_surface == EGL_NO_SURFACE) {
-        return SDL_SetError("Could not create GLES window surface");
-    }
-
-    /* Setup driver data for this window */
-    window->driverdata = wdata;
-    
-    /* One window, it always has focus */
-    SDL_SetMouseFocus(window);
-    SDL_SetKeyboardFocus(window);
-
-    /* Window has been successfully created */
-    return 0;
-}
-
-int
-RPI_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
-{
-    return -1;
-}
-
-void
-RPI_SetWindowTitle(_THIS, SDL_Window * window)
-{
-}
-void
-RPI_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
-{
-}
-void
-RPI_SetWindowPosition(_THIS, SDL_Window * window)
-{
-}
-void
-RPI_SetWindowSize(_THIS, SDL_Window * window)
-{
-}
-void
-RPI_ShowWindow(_THIS, SDL_Window * window)
-{
-}
-void
-RPI_HideWindow(_THIS, SDL_Window * window)
-{
-}
-void
-RPI_RaiseWindow(_THIS, SDL_Window * window)
-{
-}
-void
-RPI_MaximizeWindow(_THIS, SDL_Window * window)
-{
-}
-void
-RPI_MinimizeWindow(_THIS, SDL_Window * window)
-{
-}
-void
-RPI_RestoreWindow(_THIS, SDL_Window * window)
-{
-}
-void
-RPI_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
-{
-
-}
-void
-RPI_DestroyWindow(_THIS, SDL_Window * window)
-{
-}
-
-/*****************************************************************************/
-/* SDL Window Manager function                                               */
-/*****************************************************************************/
-SDL_bool
-RPI_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
-{
-    if (info->version.major <= SDL_MAJOR_VERSION) {
-        return SDL_TRUE;
-    } else {
-        SDL_SetError("application not compiled with SDL %d.%d\n",
-                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
-        return SDL_FALSE;
-    }
-
-    /* Failed to get window manager information */
-    return SDL_FALSE;
-}
-
-#endif /* SDL_VIDEO_DRIVER_RPI */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/raspberry/SDL_rpivideo.h b/deps/SDL2/src/video/raspberry/SDL_rpivideo.h
deleted file mode 100644
index 6359bad..0000000
--- a/deps/SDL2/src/video/raspberry/SDL_rpivideo.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef __SDL_RPIVIDEO_H__
-#define __SDL_RPIVIDEO_H__
-
-#include "SDL_config.h"
-#include "../SDL_sysvideo.h"
-
-#include "bcm_host.h"
-#include "GLES/gl.h"
-#include "EGL/egl.h"
-#include "EGL/eglext.h"
-
-typedef struct SDL_VideoData
-{
-    uint32_t egl_refcount;      /* OpenGL ES reference count              */
-} SDL_VideoData;
-
-
-typedef struct SDL_DisplayData
-{
-    DISPMANX_DISPLAY_HANDLE_T dispman_display;
-} SDL_DisplayData;
-
-
-typedef struct SDL_WindowData
-{
-    EGL_DISPMANX_WINDOW_T dispman_window;
-#if SDL_VIDEO_OPENGL_EGL  
-    EGLSurface egl_surface;
-#endif    
-} SDL_WindowData;
-
-#define SDL_RPI_VIDEOLAYER 10000 /* High enough so to occlude everything */
-#define SDL_RPI_MOUSELAYER SDL_RPI_VIDEOLAYER + 1
-
-
-/****************************************************************************/
-/* SDL_VideoDevice functions declaration                                    */
-/****************************************************************************/
-
-/* Display and window functions */
-int RPI_VideoInit(_THIS);
-void RPI_VideoQuit(_THIS);
-void RPI_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
-int RPI_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-int RPI_CreateWindow(_THIS, SDL_Window * window);
-int RPI_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
-void RPI_SetWindowTitle(_THIS, SDL_Window * window);
-void RPI_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
-void RPI_SetWindowPosition(_THIS, SDL_Window * window);
-void RPI_SetWindowSize(_THIS, SDL_Window * window);
-void RPI_ShowWindow(_THIS, SDL_Window * window);
-void RPI_HideWindow(_THIS, SDL_Window * window);
-void RPI_RaiseWindow(_THIS, SDL_Window * window);
-void RPI_MaximizeWindow(_THIS, SDL_Window * window);
-void RPI_MinimizeWindow(_THIS, SDL_Window * window);
-void RPI_RestoreWindow(_THIS, SDL_Window * window);
-void RPI_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
-void RPI_DestroyWindow(_THIS, SDL_Window * window);
-
-/* Window manager function */
-SDL_bool RPI_GetWindowWMInfo(_THIS, SDL_Window * window,
-                             struct SDL_SysWMinfo *info);
-
-/* OpenGL/OpenGL ES functions */
-int RPI_GLES_LoadLibrary(_THIS, const char *path);
-void *RPI_GLES_GetProcAddress(_THIS, const char *proc);
-void RPI_GLES_UnloadLibrary(_THIS);
-SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window * window);
-int RPI_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
-int RPI_GLES_SetSwapInterval(_THIS, int interval);
-int RPI_GLES_GetSwapInterval(_THIS);
-void RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
-void RPI_GLES_DeleteContext(_THIS, SDL_GLContext context);
-
-#endif /* __SDL_RPIVIDEO_H__ */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/sdlgenblit.pl b/deps/SDL2/src/video/sdlgenblit.pl
deleted file mode 100755
index 1097488..0000000
--- a/deps/SDL2/src/video/sdlgenblit.pl
+++ /dev/null
@@ -1,476 +0,0 @@
-#!/usr/bin/perl -w
-#
-# A script to generate optimized C blitters for Simple DirectMedia Layer
-# http://www.libsdl.org/
-
-use warnings;
-use strict;
-
-my %file;
-
-# The formats potentially supported by this script:
-# SDL_PIXELFORMAT_RGB332
-# SDL_PIXELFORMAT_RGB444
-# SDL_PIXELFORMAT_RGB555
-# SDL_PIXELFORMAT_ARGB4444
-# SDL_PIXELFORMAT_ARGB1555
-# SDL_PIXELFORMAT_RGB565
-# SDL_PIXELFORMAT_RGB24
-# SDL_PIXELFORMAT_BGR24
-# SDL_PIXELFORMAT_RGB888
-# SDL_PIXELFORMAT_BGR888
-# SDL_PIXELFORMAT_ARGB8888
-# SDL_PIXELFORMAT_RGBA8888
-# SDL_PIXELFORMAT_ABGR8888
-# SDL_PIXELFORMAT_BGRA8888
-# SDL_PIXELFORMAT_ARGB2101010
-
-# The formats we're actually creating blitters for:
-my @src_formats = (
-    "RGB888",
-    "BGR888",
-    "ARGB8888",
-    "RGBA8888",
-    "ABGR8888",
-    "BGRA8888",
-);
-my @dst_formats = (
-    "RGB888",
-    "BGR888",
-    "ARGB8888",
-);
-
-my %format_size = (
-    "RGB888" => 4,
-    "BGR888" => 4,
-    "ARGB8888" => 4,
-    "RGBA8888" => 4,
-    "ABGR8888" => 4,
-    "BGRA8888" => 4,
-);
-
-my %format_type = (
-    "RGB888" => "Uint32",
-    "BGR888" => "Uint32",
-    "ARGB8888" => "Uint32",
-    "RGBA8888" => "Uint32",
-    "ABGR8888" => "Uint32",
-    "BGRA8888" => "Uint32",
-);
-
-my %get_rgba_string = (
-    "RGB888" => "_R = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _B = (Uint8)_pixel; _A = 0xFF;",
-    "BGR888" => "_B = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _R = (Uint8)_pixel; _A = 0xFF;", "ARGB8888" => "_A = (Uint8)(_pixel >> 24); _R = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _B = (Uint8)_pixel;",
-    "RGBA8888" => "_R = (Uint8)(_pixel >> 24); _G = (Uint8)(_pixel >> 16); _B = (Uint8)(_pixel >> 8); _A = (Uint8)_pixel;",
-    "ABGR8888" => "_A = (Uint8)(_pixel >> 24); _B = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _R = (Uint8)_pixel;",
-    "BGRA8888" => "_B = (Uint8)(_pixel >> 24); _G = (Uint8)(_pixel >> 16); _R = (Uint8)(_pixel >> 8); _A = (Uint8)_pixel;",
-);
-
-my %set_rgba_string = (
-    "RGB888" => "_pixel = ((Uint32)_R << 16) | ((Uint32)_G << 8) | _B;",
-    "BGR888" => "_pixel = ((Uint32)_B << 16) | ((Uint32)_G << 8) | _R;",
-    "ARGB8888" => "_pixel = ((Uint32)_A << 24) | ((Uint32)_R << 16) | ((Uint32)_G << 8) | _B;",
-    "RGBA8888" => "_pixel = ((Uint32)_R << 24) | ((Uint32)_G << 16) | ((Uint32)_B << 8) | _A;",
-    "ABGR8888" => "_pixel = ((Uint32)_A << 24) | ((Uint32)_B << 16) | ((Uint32)_G << 8) | _R;",
-    "BGRA8888" => "_pixel = ((Uint32)_B << 24) | ((Uint32)_G << 16) | ((Uint32)_R << 8) | _A;",
-);
-
-sub open_file {
-    my $name = shift;
-    open(FILE, ">$name.new") || die "Cant' open $name.new: $!";
-    print FILE <<__EOF__;
-/* DO NOT EDIT!  This file is generated by sdlgenblit.pl */
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken\@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-/* *INDENT-OFF* */
-
-__EOF__
-}
-
-sub close_file {
-    my $name = shift;
-    print FILE <<__EOF__;
-/* *INDENT-ON* */
-
-/* vi: set ts=4 sw=4 expandtab: */
-__EOF__
-    close FILE;
-    if ( ! -f $name || system("cmp -s $name $name.new") != 0 ) {
-        rename("$name.new", "$name");
-    } else {
-        unlink("$name.new");
-    }
-}
-
-sub output_copydefs
-{
-    print FILE <<__EOF__;
-extern SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[];
-__EOF__
-}
-
-sub output_copyfuncname
-{
-    my $prefix = shift;
-    my $src = shift;
-    my $dst = shift;
-    my $modulate = shift;
-    my $blend = shift;
-    my $scale = shift;
-    my $args = shift;
-    my $suffix = shift;
-
-    print FILE "$prefix SDL_Blit_${src}_${dst}";
-    if ( $modulate ) {
-        print FILE "_Modulate";
-    }
-    if ( $blend ) {
-        print FILE "_Blend";
-    }
-    if ( $scale ) {
-        print FILE "_Scale";
-    }
-    if ( $args ) {
-        print FILE "(SDL_BlitInfo *info)";
-    }
-    print FILE "$suffix";
-}
-
-sub get_rgba
-{
-    my $prefix = shift;
-    my $format = shift;
-    my $string = $get_rgba_string{$format};
-    $string =~ s/_/$prefix/g;
-    if ( $prefix ne "" ) {
-        print FILE <<__EOF__;
-            ${prefix}pixel = *$prefix;
-__EOF__
-    } else {
-        print FILE <<__EOF__;
-            pixel = *src;
-__EOF__
-    }
-    print FILE <<__EOF__;
-            $string
-__EOF__
-}
-
-sub set_rgba
-{
-    my $prefix = shift;
-    my $format = shift;
-    my $string = $set_rgba_string{$format};
-    $string =~ s/_/$prefix/g;
-    print FILE <<__EOF__;
-            $string
-            *dst = ${prefix}pixel;
-__EOF__
-}
-
-sub output_copycore
-{
-    my $src = shift;
-    my $dst = shift;
-    my $modulate = shift;
-    my $blend = shift;
-    my $s = "";
-    my $d = "";
-
-    # Nice and easy...
-    if ( $src eq $dst && !$modulate && !$blend ) {
-        print FILE <<__EOF__;
-            *dst = *src;
-__EOF__
-        return;
-    }
-
-    if ( $blend ) {
-        get_rgba("src", $src);
-        get_rgba("dst", $dst);
-        $s = "src";
-        $d = "dst";
-    } else {
-        get_rgba("", $src);
-    }
-
-    if ( $modulate ) {
-        print FILE <<__EOF__;
-            if (flags & SDL_COPY_MODULATE_COLOR) {
-                ${s}R = (${s}R * modulateR) / 255;
-                ${s}G = (${s}G * modulateG) / 255;
-                ${s}B = (${s}B * modulateB) / 255;
-            }
-            if (flags & SDL_COPY_MODULATE_ALPHA) {
-                ${s}A = (${s}A * modulateA) / 255;
-            }
-__EOF__
-    }
-    if ( $blend ) {
-        print FILE <<__EOF__;
-            if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
-                /* This goes away if we ever use premultiplied alpha */
-                if (${s}A < 255) {
-                    ${s}R = (${s}R * ${s}A) / 255;
-                    ${s}G = (${s}G * ${s}A) / 255;
-                    ${s}B = (${s}B * ${s}A) / 255;
-                }
-            }
-            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
-            case SDL_COPY_BLEND:
-                ${d}R = ${s}R + ((255 - ${s}A) * ${d}R) / 255;
-                ${d}G = ${s}G + ((255 - ${s}A) * ${d}G) / 255;
-                ${d}B = ${s}B + ((255 - ${s}A) * ${d}B) / 255;
-                ${d}A = ${s}A + ((255 - ${s}A) * ${d}A) / 255;
-                break;
-            case SDL_COPY_ADD:
-                ${d}R = ${s}R + ${d}R; if (${d}R > 255) ${d}R = 255;
-                ${d}G = ${s}G + ${d}G; if (${d}G > 255) ${d}G = 255;
-                ${d}B = ${s}B + ${d}B; if (${d}B > 255) ${d}B = 255;
-                break;
-            case SDL_COPY_MOD:
-                ${d}R = (${s}R * ${d}R) / 255;
-                ${d}G = (${s}G * ${d}G) / 255;
-                ${d}B = (${s}B * ${d}B) / 255;
-                break;
-            }
-__EOF__
-    }
-    if ( $blend ) {
-        set_rgba("dst", $dst);
-    } else {
-        set_rgba("", $dst);
-    }
-}
-
-sub output_copyfunc
-{
-    my $src = shift;
-    my $dst = shift;
-    my $modulate = shift;
-    my $blend = shift;
-    my $scale = shift;
-
-    output_copyfuncname("static void", $src, $dst, $modulate, $blend, $scale, 1, "\n");
-    print FILE <<__EOF__;
-{
-__EOF__
-    if ( $modulate || $blend ) {
-        print FILE <<__EOF__;
-    const int flags = info->flags;
-__EOF__
-    }
-    if ( $modulate ) {
-        print FILE <<__EOF__;
-    const Uint32 modulateR = info->r;
-    const Uint32 modulateG = info->g;
-    const Uint32 modulateB = info->b;
-    const Uint32 modulateA = info->a;
-__EOF__
-    }
-    if ( $blend ) {
-        print FILE <<__EOF__;
-    Uint32 srcpixel;
-    Uint32 srcR, srcG, srcB, srcA;
-    Uint32 dstpixel;
-    Uint32 dstR, dstG, dstB, dstA;
-__EOF__
-    } elsif ( $modulate || $src ne $dst ) {
-        print FILE <<__EOF__;
-    Uint32 pixel;
-    Uint32 R, G, B, A;
-__EOF__
-    }
-    if ( $scale ) {
-        print FILE <<__EOF__;
-    int srcy, srcx;
-    int posy, posx;
-    int incy, incx;
-
-    srcy = 0;
-    posy = 0;
-    incy = (info->src_h << 16) / info->dst_h;
-    incx = (info->src_w << 16) / info->dst_w;
-
-    while (info->dst_h--) {
-        $format_type{$src} *src = 0;
-        $format_type{$dst} *dst = ($format_type{$dst} *)info->dst;
-        int n = info->dst_w;
-        srcx = -1;
-        posx = 0x10000L;
-        while (posy >= 0x10000L) {
-            ++srcy;
-            posy -= 0x10000L;
-        }
-        while (n--) {
-            if (posx >= 0x10000L) {
-                while (posx >= 0x10000L) {
-                    ++srcx;
-                    posx -= 0x10000L;
-                }
-                src = ($format_type{$src} *)(info->src + (srcy * info->src_pitch) + (srcx * $format_size{$src}));
-__EOF__
-        print FILE <<__EOF__;
-            }
-__EOF__
-        output_copycore($src, $dst, $modulate, $blend);
-        print FILE <<__EOF__;
-            posx += incx;
-            ++dst;
-        }
-        posy += incy;
-        info->dst += info->dst_pitch;
-    }
-__EOF__
-    } else {
-        print FILE <<__EOF__;
-
-    while (info->dst_h--) {
-        $format_type{$src} *src = ($format_type{$src} *)info->src;
-        $format_type{$dst} *dst = ($format_type{$dst} *)info->dst;
-        int n = info->dst_w;
-        while (n--) {
-__EOF__
-        output_copycore($src, $dst, $modulate, $blend);
-        print FILE <<__EOF__;
-            ++src;
-            ++dst;
-        }
-        info->src += info->src_pitch;
-        info->dst += info->dst_pitch;
-    }
-__EOF__
-    }
-    print FILE <<__EOF__;
-}
-
-__EOF__
-}
-
-sub output_copyfunc_h
-{
-}
-
-sub output_copyinc
-{
-    print FILE <<__EOF__;
-#include "SDL_video.h"
-#include "SDL_blit.h"
-#include "SDL_blit_auto.h"
-
-__EOF__
-}
-
-sub output_copyfunctable
-{
-    print FILE <<__EOF__;
-SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[] = {
-__EOF__
-    for (my $i = 0; $i <= $#src_formats; ++$i) {
-        my $src = $src_formats[$i];
-        for (my $j = 0; $j <= $#dst_formats; ++$j) {
-            my $dst = $dst_formats[$j];
-            for (my $modulate = 0; $modulate <= 1; ++$modulate) {
-                for (my $blend = 0; $blend <= 1; ++$blend) {
-                    for (my $scale = 0; $scale <= 1; ++$scale) {
-                        if ( $modulate || $blend || $scale ) {
-                            print FILE "    { SDL_PIXELFORMAT_$src, SDL_PIXELFORMAT_$dst, ";
-                            my $flags = "";
-                            my $flag = "";
-                            if ( $modulate ) {
-                                $flag = "SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA";
-                                if ( $flags eq "" ) {
-                                    $flags = $flag;
-                                } else {
-                                    $flags = "$flags | $flag";
-                                }
-                            }
-                            if ( $blend ) {
-                                $flag = "SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD";
-                                if ( $flags eq "" ) {
-                                    $flags = $flag;
-                                } else {
-                                    $flags = "$flags | $flag";
-                                }
-                            }
-                            if ( $scale ) {
-                                $flag = "SDL_COPY_NEAREST";
-                                if ( $flags eq "" ) {
-                                    $flags = $flag;
-                                } else {
-                                    $flags = "$flags | $flag";
-                                }
-                            }
-                            if ( $flags eq "" ) {
-                                $flags = "0";
-                            }
-                            print FILE "($flags), SDL_CPU_ANY,";
-                            output_copyfuncname("", $src_formats[$i], $dst_formats[$j], $modulate, $blend, $scale, 0, " },\n");
-                        }
-                    }
-                }
-            }
-        }
-    }
-    print FILE <<__EOF__;
-    { 0, 0, 0, 0, NULL }
-};
-
-__EOF__
-}
-
-sub output_copyfunc_c
-{
-    my $src = shift;
-    my $dst = shift;
-
-    for (my $modulate = 0; $modulate <= 1; ++$modulate) {
-        for (my $blend = 0; $blend <= 1; ++$blend) {
-            for (my $scale = 0; $scale <= 1; ++$scale) {
-                if ( $modulate || $blend || $scale ) {
-                    output_copyfunc($src, $dst, $modulate, $blend, $scale);
-                }
-            }
-        }
-    }
-}
-
-open_file("SDL_blit_auto.h");
-output_copydefs();
-for (my $i = 0; $i <= $#src_formats; ++$i) {
-    for (my $j = 0; $j <= $#dst_formats; ++$j) {
-        output_copyfunc_h($src_formats[$i], $dst_formats[$j]);
-    }
-}
-print FILE "\n";
-close_file("SDL_blit_auto.h");
-
-open_file("SDL_blit_auto.c");
-output_copyinc();
-for (my $i = 0; $i <= $#src_formats; ++$i) {
-    for (my $j = 0; $j <= $#dst_formats; ++$j) {
-        output_copyfunc_c($src_formats[$i], $dst_formats[$j]);
-    }
-}
-output_copyfunctable();
-close_file("SDL_blit_auto.c");
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitappdelegate.h b/deps/SDL2/src/video/uikit/SDL_uikitappdelegate.h
deleted file mode 100644
index b375f2e..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitappdelegate.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#import <UIKit/UIKit.h>
-
- at interface SDLUIKitDelegate : NSObject<UIApplicationDelegate> {
-}
-
-+ (id) sharedAppDelegate;
-+ (NSString *)getAppDelegateClassName;
-
- at end
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitappdelegate.m b/deps/SDL2/src/video/uikit/SDL_uikitappdelegate.m
deleted file mode 100644
index 4a32320..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitappdelegate.m
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#include "../SDL_sysvideo.h"
-#include "SDL_assert.h"
-#include "SDL_hints.h"
-#include "SDL_system.h"
-#include "SDL_main.h"
-
-#include "SDL_uikitappdelegate.h"
-#include "SDL_uikitmodes.h"
-#include "../../events/SDL_events_c.h"
-
-#ifdef main
-#undef main
-#endif
-
-static int forward_argc;
-static char **forward_argv;
-static int exit_status;
-static UIWindow *launch_window;
-
-int main(int argc, char **argv)
-{
-    int i;
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    /* store arguments */
-    forward_argc = argc;
-    forward_argv = (char **)malloc((argc+1) * sizeof(char *));
-    for (i = 0; i < argc; i++) {
-        forward_argv[i] = malloc( (strlen(argv[i])+1) * sizeof(char));
-        strcpy(forward_argv[i], argv[i]);
-    }
-    forward_argv[i] = NULL;
-
-    /* Give over control to run loop, SDLUIKitDelegate will handle most things from here */
-    UIApplicationMain(argc, argv, NULL, [SDLUIKitDelegate getAppDelegateClassName]);
-
-    /* free the memory we used to hold copies of argc and argv */
-    for (i = 0; i < forward_argc; i++) {
-        free(forward_argv[i]);
-    }
-    free(forward_argv);
-
-    [pool release];
-    return exit_status;
-}
-
-static void
-SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
-{
-    BOOL disable = (hint && *hint != '0');
-    [UIApplication sharedApplication].idleTimerDisabled = disable;
-}
-
- at interface SDL_splashviewcontroller : UIViewController {
-    UIImageView *splash;
-    UIImage *splashPortrait;
-    UIImage *splashLandscape;
-}
-
-- (void)updateSplashImage:(UIInterfaceOrientation)interfaceOrientation;
- at end
-
- at implementation SDL_splashviewcontroller
-
-- (id)init
-{
-    self = [super init];
-    if (self == nil) {
-        return nil;
-    }
-
-    self->splash = [[UIImageView alloc] init];
-    [self setView:self->splash];
-
-    CGSize size = [UIScreen mainScreen].bounds.size;
-    float height = SDL_max(size.width, size.height);
-    self->splashPortrait = [UIImage imageNamed:[NSString stringWithFormat:@"Default-%dh.png", (int)height]];
-    if (!self->splashPortrait) {
-        self->splashPortrait = [UIImage imageNamed:@"Default.png"];
-    }
-    self->splashLandscape = [UIImage imageNamed:@"Default-Landscape.png"];
-    if (!self->splashLandscape && self->splashPortrait) {
-        self->splashLandscape = [[UIImage alloc] initWithCGImage: self->splashPortrait.CGImage
-                                                           scale: 1.0
-                                                     orientation: UIImageOrientationRight];
-    }
-    if (self->splashPortrait) {
-        [self->splashPortrait retain];
-    }
-    if (self->splashLandscape) {
-        [self->splashLandscape retain];
-    }
-
-    [self updateSplashImage:[[UIApplication sharedApplication] statusBarOrientation]];
-
-    return self;
-}
-
-- (NSUInteger)supportedInterfaceOrientations
-{
-    NSUInteger orientationMask = UIInterfaceOrientationMaskAll;
-
-    /* Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation */
-    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
-        orientationMask &= ~UIInterfaceOrientationMaskPortraitUpsideDown;
-    }
-    return orientationMask;
-}
-
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient
-{
-    NSUInteger orientationMask = [self supportedInterfaceOrientations];
-    return (orientationMask & (1 << orient));
-}
-
-- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
-{
-    [self updateSplashImage:interfaceOrientation];
-}
-
-- (void)updateSplashImage:(UIInterfaceOrientation)interfaceOrientation
-{
-    UIImage *image;
-
-    if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
-        image = self->splashLandscape;
-    } else {
-        image = self->splashPortrait;
-    }
-    if (image)
-    {
-        splash.image = image;
-    }
-}
-
- at end
-
-
- at implementation SDLUIKitDelegate
-
-/* convenience method */
-+ (id) sharedAppDelegate
-{
-    /* the delegate is set in UIApplicationMain(), which is garaunteed to be called before this method */
-    return [[UIApplication sharedApplication] delegate];
-}
-
-+ (NSString *)getAppDelegateClassName
-{
-    /* subclassing notice: when you subclass this appdelegate, make sure to add a category to override
-       this method and return the actual name of the delegate */
-    return @"SDLUIKitDelegate";
-}
-
-- (id)init
-{
-    self = [super init];
-    return self;
-}
-
-- (void)postFinishLaunch
-{
-    /* run the user's application, passing argc and argv */
-    SDL_iPhoneSetEventPump(SDL_TRUE);
-    exit_status = SDL_main(forward_argc, forward_argv);
-    SDL_iPhoneSetEventPump(SDL_FALSE);
-
-    /* If we showed a splash image, clean it up */
-    if (launch_window) {
-        [launch_window release];
-        launch_window = NULL;
-    }
-
-    /* exit, passing the return status from the user's application */
-    /* We don't actually exit to support applications that do setup in
-     * their main function and then allow the Cocoa event loop to run.
-     */
-    /* exit(exit_status); */
-}
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
-{
-    /* Keep the launch image up until we set a video mode */
-    launch_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-
-    UIViewController *splashViewController = [[SDL_splashviewcontroller alloc] init];
-    launch_window.rootViewController = splashViewController;
-    [launch_window addSubview:splashViewController.view];
-    [launch_window makeKeyAndVisible];
-
-    /* Set working directory to resource path */
-    [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];
-
-    /* register a callback for the idletimer hint */
-    SDL_AddHintCallback(SDL_HINT_IDLE_TIMER_DISABLED,
-                        SDL_IdleTimerDisabledChanged, NULL);
-
-    SDL_SetMainReady();
-    [self performSelector:@selector(postFinishLaunch) withObject:nil afterDelay:0.0];
-
-    return YES;
-}
-
-- (void)applicationWillTerminate:(UIApplication *)application
-{
-    SDL_SendAppEvent(SDL_APP_TERMINATING);
-}
-
-- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
-{
-    SDL_SendAppEvent(SDL_APP_LOWMEMORY);
-}
-
-- (void) applicationWillResignActive:(UIApplication*)application
-{
-    SDL_VideoDevice *_this = SDL_GetVideoDevice();
-    if (_this) {
-        SDL_Window *window;
-        for (window = _this->windows; window != nil; window = window->next) {
-            SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
-            SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
-        }
-    }
-    SDL_SendAppEvent(SDL_APP_WILLENTERBACKGROUND);
-}
-
-- (void) applicationDidEnterBackground:(UIApplication*)application
-{
-    SDL_SendAppEvent(SDL_APP_DIDENTERBACKGROUND);
-}
-
-- (void) applicationWillEnterForeground:(UIApplication*)application
-{
-    SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND);
-}
-
-- (void) applicationDidBecomeActive:(UIApplication*)application
-{
-    SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND);
-
-    SDL_VideoDevice *_this = SDL_GetVideoDevice();
-    if (_this) {
-        SDL_Window *window;
-        for (window = _this->windows; window != nil; window = window->next) {
-            SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
-            SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0);
-        }
-    }
-}
-
-- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
-{
-    NSURL *fileURL = [url filePathURL];
-    if (fileURL != nil) {
-        SDL_SendDropFile([[fileURL path] UTF8String]);
-    } else {
-        SDL_SendDropFile([[url absoluteString] UTF8String]);
-    }
-    return YES;
-}
-
- at end
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitevents.h b/deps/SDL2/src/video/uikit/SDL_uikitevents.h
deleted file mode 100644
index 39ee4ca..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitevents.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef _SDL_uikitevents_h
-#define _SDL_uikitevents_h
-
-#include "../SDL_sysvideo.h"
-
-extern void UIKit_PumpEvents(_THIS);
-
-#endif /* _SDL_uikitevents_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitevents.m b/deps/SDL2/src/video/uikit/SDL_uikitevents.m
deleted file mode 100644
index 16c120d..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitevents.m
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_uikitvideo.h"
-#include "SDL_uikitevents.h"
-
-#import <Foundation/Foundation.h>
-
-static BOOL UIKit_EventPumpEnabled = YES;
-
-void
-SDL_iPhoneSetEventPump(SDL_bool enabled)
-{
-    UIKit_EventPumpEnabled = enabled;
-}
-
-void
-UIKit_PumpEvents(_THIS)
-{
-    if (!UIKit_EventPumpEnabled)
-        return;
-
-    /* Let the run loop run for a short amount of time: long enough for
-       touch events to get processed (which is important to get certain
-       elements of Game Center's GKLeaderboardViewController to respond
-       to touch input), but not long enough to introduce a significant
-       delay in the rest of the app.
-    */
-    const CFTimeInterval seconds = 0.000002;
-
-    /* Pump most event types. */
-    SInt32 result;
-    do {
-        result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, seconds, TRUE);
-    } while (result == kCFRunLoopRunHandledSource);
-
-    /* Make sure UIScrollView objects scroll properly. */
-    do {
-        result = CFRunLoopRunInMode((CFStringRef)UITrackingRunLoopMode, seconds, TRUE);
-    } while(result == kCFRunLoopRunHandledSource);
-}
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitmessagebox.h b/deps/SDL2/src/video/uikit/SDL_uikitmessagebox.h
deleted file mode 100644
index 7bee1ec..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitmessagebox.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-extern SDL_bool UIKit_ShowingMessageBox();
-
-extern int UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitmessagebox.m b/deps/SDL2/src/video/uikit/SDL_uikitmessagebox.m
deleted file mode 100644
index 5ec7e8b..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitmessagebox.m
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#include "SDL.h"
-#include "SDL_uikitvideo.h"
-
-
-/* Display a UIKit message box */
-
-static SDL_bool s_showingMessageBox = SDL_FALSE;
-
- at interface UIKit_UIAlertViewDelegate : NSObject <UIAlertViewDelegate> {
- at private
-    int *clickedButtonIndex;
-}
-
-- (id)initWithButtonIndex:(int *)_buttonIndex;
-- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;
-
- at end
-
- at implementation UIKit_UIAlertViewDelegate
-
-- (id)initWithButtonIndex:(int *)buttonIndex
-{
-    self = [self init];
-    if (self == nil) {
-        return nil;
-    }
-    self->clickedButtonIndex = buttonIndex;
-
-    return self;
-}
-
-- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;
-{
-    *clickedButtonIndex = buttonIndex;
-}
-
- at end /* UIKit_UIAlertViewDelegate */
-
-
-SDL_bool
-UIKit_ShowingMessageBox()
-{
-    return s_showingMessageBox;
-}
-
-int
-UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
-{
-    int clicked;
-
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    UIAlertView* alert = [[UIAlertView alloc] init];
-
-    alert.title = [NSString stringWithUTF8String:messageboxdata->title];
-    alert.message = [NSString stringWithUTF8String:messageboxdata->message];
-    alert.delegate = [[UIKit_UIAlertViewDelegate alloc] initWithButtonIndex:&clicked];
-
-    const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons;
-    int i;
-    for (i = 0; i < messageboxdata->numbuttons; ++i) {
-        [alert addButtonWithTitle:[[NSString alloc] initWithUTF8String:buttons[i].text]];
-    }
-
-    /* Set up for showing the alert */
-    clicked = messageboxdata->numbuttons;
-
-    [alert show];
-
-    /* Run the main event loop until the alert has finished */
-    /* Note that this needs to be done on the main thread */
-    s_showingMessageBox = SDL_TRUE;
-    while (clicked == messageboxdata->numbuttons) {
-        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
-    }
-    s_showingMessageBox = SDL_FALSE;
-
-    *buttonid = messageboxdata->buttons[clicked].buttonid;
-
-    [alert.delegate release];
-    [alert release];
-
-    [pool release];
-
-    return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitmodes.h b/deps/SDL2/src/video/uikit/SDL_uikitmodes.h
deleted file mode 100644
index 249bda1..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitmodes.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_uikitmodes_h
-#define _SDL_uikitmodes_h
-
-#include "SDL_uikitvideo.h"
-
-typedef struct
-{
-    UIScreen *uiscreen;
-    CGFloat scale;
-} SDL_DisplayData;
-
-typedef struct
-{
-    UIScreenMode *uiscreenmode;
-    CGFloat scale;
-} SDL_DisplayModeData;
-
-extern BOOL SDL_UIKit_supports_multiple_displays;
-
-extern SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen);
-
-extern int UIKit_InitModes(_THIS);
-extern void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
-extern int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-extern void UIKit_QuitModes(_THIS);
-
-#endif /* _SDL_uikitmodes_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitmodes.m b/deps/SDL2/src/video/uikit/SDL_uikitmodes.m
deleted file mode 100644
index f093a81..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitmodes.m
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#include "SDL_assert.h"
-#include "SDL_uikitmodes.h"
-
-
-BOOL SDL_UIKit_supports_multiple_displays = NO;
-
-
-static int
-UIKit_AllocateDisplayModeData(SDL_DisplayMode * mode,
-    UIScreenMode * uiscreenmode, CGFloat scale)
-{
-    SDL_DisplayModeData *data = NULL;
-
-    if (uiscreenmode != nil) {
-        /* Allocate the display mode data */
-        data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data));
-        if (!data) {
-            return SDL_OutOfMemory();
-        }
-
-        data->uiscreenmode = uiscreenmode;
-        [data->uiscreenmode retain];
-
-        data->scale = scale;
-    }
-
-    mode->driverdata = data;
-
-    return 0;
-}
-
-static void
-UIKit_FreeDisplayModeData(SDL_DisplayMode * mode)
-{
-    if (!SDL_UIKit_supports_multiple_displays) {
-        /* Not on at least iPhoneOS 3.2 (versions prior to iPad). */
-        SDL_assert(mode->driverdata == NULL);
-    } else if (mode->driverdata != NULL) {
-        SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata;
-        [data->uiscreenmode release];
-        SDL_free(data);
-        mode->driverdata = NULL;
-    }
-}
-
-static int
-UIKit_AddSingleDisplayMode(SDL_VideoDisplay * display, int w, int h,
-    UIScreenMode * uiscreenmode, CGFloat scale)
-{
-    SDL_DisplayMode mode;
-    SDL_zero(mode);
-
-    mode.format = SDL_PIXELFORMAT_ABGR8888;
-    mode.refresh_rate = 0;
-    if (UIKit_AllocateDisplayModeData(&mode, uiscreenmode, scale) < 0) {
-        return -1;
-    }
-
-    mode.w = w;
-    mode.h = h;
-    if (SDL_AddDisplayMode(display, &mode)) {
-        return 0;
-    } else {
-        UIKit_FreeDisplayModeData(&mode);
-        return -1;
-    }
-}
-
-static int
-UIKit_AddDisplayMode(SDL_VideoDisplay * display, int w, int h, CGFloat scale,
-                     UIScreenMode * uiscreenmode, SDL_bool addRotation)
-{
-    if (UIKit_AddSingleDisplayMode(display, w, h, uiscreenmode, scale) < 0) {
-        return -1;
-    }
-
-    if (addRotation) {
-        /* Add the rotated version */
-        if (UIKit_AddSingleDisplayMode(display, h, w, uiscreenmode, scale) < 0) {
-            return -1;
-        }
-    }
-
-    return 0;
-}
-
-static int
-UIKit_AddDisplay(UIScreen *uiscreen)
-{
-    CGSize size = [uiscreen bounds].size;
-
-    /* Make sure the width/height are oriented correctly */
-    if (UIKit_IsDisplayLandscape(uiscreen) != (size.width > size.height)) {
-        CGFloat height = size.width;
-        size.width = size.height;
-        size.height = height;
-    }
-
-    /* When dealing with UIKit all coordinates are specified in terms of
-     * what Apple refers to as points. On earlier devices without the
-     * so called "Retina" display, there is a one to one mapping between
-     * points and pixels. In other cases [UIScreen scale] indicates the
-     * relationship between points and pixels. Since SDL has no notion
-     * of points, we must compensate in all cases where dealing with such
-     * units.
-     */
-    CGFloat scale;
-    if ([UIScreen instancesRespondToSelector:@selector(scale)]) {
-        scale = [uiscreen scale]; /* iOS >= 4.0 */
-    } else {
-        scale = 1.0f; /* iOS < 4.0 */
-    }
-
-    SDL_VideoDisplay display;
-    SDL_DisplayMode mode;
-    SDL_zero(mode);
-    mode.format = SDL_PIXELFORMAT_ABGR8888;
-    mode.w = (int)(size.width * scale);
-    mode.h = (int)(size.height * scale);
-
-    UIScreenMode * uiscreenmode = nil;
-    /* UIScreenMode showed up in 3.2 (the iPad and later). We're
-     * misusing this supports_multiple_displays flag here for that.
-     */
-    if (SDL_UIKit_supports_multiple_displays) {
-        uiscreenmode = [uiscreen currentMode];
-    }
-
-    if (UIKit_AllocateDisplayModeData(&mode, uiscreenmode, scale) < 0) {
-        return -1;
-    }
-
-    SDL_zero(display);
-    display.desktop_mode = mode;
-    display.current_mode = mode;
-
-    /* Allocate the display data */
-    SDL_DisplayData *data = (SDL_DisplayData *) SDL_malloc(sizeof(*data));
-    if (!data) {
-        UIKit_FreeDisplayModeData(&display.desktop_mode);
-        return SDL_OutOfMemory();
-    }
-
-    [uiscreen retain];
-    data->uiscreen = uiscreen;
-    data->scale = scale;
-
-    display.driverdata = data;
-    SDL_AddVideoDisplay(&display);
-
-    return 0;
-}
-
-SDL_bool
-UIKit_IsDisplayLandscape(UIScreen *uiscreen)
-{
-    if (uiscreen == [UIScreen mainScreen]) {
-        return UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]);
-    } else {
-        CGSize size = [uiscreen bounds].size;
-        return (size.width > size.height);
-    }
-}
-
-int
-UIKit_InitModes(_THIS)
-{
-    /* this tells us whether we are running on ios >= 3.2 */
-    SDL_UIKit_supports_multiple_displays = [UIScreen instancesRespondToSelector:@selector(currentMode)];
-
-    /* Add the main screen. */
-    if (UIKit_AddDisplay([UIScreen mainScreen]) < 0) {
-        return -1;
-    }
-
-    /* If this is iPhoneOS < 3.2, all devices are one screen, 320x480 pixels. */
-    /*  The iPad added both a larger main screen and the ability to use
-     *  external displays. So, add the other displays (screens in UI speak).
-     */
-    if (SDL_UIKit_supports_multiple_displays) {
-        for (UIScreen *uiscreen in [UIScreen screens]) {
-            /* Only add the other screens */
-            if (uiscreen != [UIScreen mainScreen]) {
-                if (UIKit_AddDisplay(uiscreen) < 0) {
-                    return -1;
-                }
-            }
-        }
-    }
-
-    /* We're done! */
-    return 0;
-}
-
-void
-UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
-{
-    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
-
-    SDL_bool isLandscape = UIKit_IsDisplayLandscape(data->uiscreen);
-    SDL_bool addRotation = (data->uiscreen == [UIScreen mainScreen]);
-
-    if (SDL_UIKit_supports_multiple_displays) {
-        /* availableModes showed up in 3.2 (the iPad and later). We should only
-         * land here for at least that version of the OS.
-         */
-        for (UIScreenMode *uimode in [data->uiscreen availableModes]) {
-            CGSize size = [uimode size];
-            int w = (int)size.width;
-            int h = (int)size.height;
-
-            /* Make sure the width/height are oriented correctly */
-            if (isLandscape != (w > h)) {
-                int tmp = w;
-                w = h;
-                h = tmp;
-            }
-
-            /* Add the native screen resolution. */
-            UIKit_AddDisplayMode(display, w, h, data->scale, uimode, addRotation);
-
-            if (data->scale != 1.0f) {
-                /* Add the native screen resolution divided by its scale.
-                 * This is so devices capable of e.g. 640x960 also advertise 320x480.
-                 */
-                UIKit_AddDisplayMode(display,
-                    (int)(size.width / data->scale),
-                    (int)(size.height / data->scale),
-                    1.0f, uimode, addRotation);
-            }
-        }
-    } else {
-        const CGSize size = [data->uiscreen bounds].size;
-        int w = (int)size.width;
-        int h = (int)size.height;
-
-        /* Make sure the width/height are oriented correctly */
-        if (isLandscape != (w > h)) {
-            int tmp = w;
-            w = h;
-            h = tmp;
-        }
-
-        UIKit_AddDisplayMode(display, w, h, 1.0f, nil, addRotation);
-    }
-}
-
-int
-UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
-{
-    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
-
-    if (!SDL_UIKit_supports_multiple_displays) {
-        /* Not on at least iPhoneOS 3.2 (versions prior to iPad). */
-        SDL_assert(mode->driverdata == NULL);
-    } else {
-        SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata;
-        [data->uiscreen setCurrentMode:modedata->uiscreenmode];
-
-        if (data->uiscreen == [UIScreen mainScreen]) {
-            if (mode->w > mode->h) {
-                if (!UIKit_IsDisplayLandscape(data->uiscreen)) {
-                    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
-                }
-            } else if (mode->w < mode->h) {
-                if (UIKit_IsDisplayLandscape(data->uiscreen)) {
-                    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-void
-UIKit_QuitModes(_THIS)
-{
-    /* Release Objective-C objects, so higher level doesn't free() them. */
-    int i, j;
-    for (i = 0; i < _this->num_displays; i++) {
-        SDL_VideoDisplay *display = &_this->displays[i];
-
-        UIKit_FreeDisplayModeData(&display->desktop_mode);
-        for (j = 0; j < display->num_display_modes; j++) {
-            SDL_DisplayMode *mode = &display->display_modes[j];
-            UIKit_FreeDisplayModeData(mode);
-        }
-
-        SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
-        [data->uiscreen release];
-        SDL_free(data);
-        display->driverdata = NULL;
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitopengles.h b/deps/SDL2/src/video/uikit/SDL_uikitopengles.h
deleted file mode 100644
index cb81648..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitopengles.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef _SDL_uikitopengles
-#define _SDL_uikitopengles
-
-#include "../SDL_sysvideo.h"
-
-extern int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window,
-                                SDL_GLContext context);
-extern void UIKit_GL_SwapWindow(_THIS, SDL_Window * window);
-extern SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window);
-extern void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context);
-extern void *UIKit_GL_GetProcAddress(_THIS, const char *proc);
-extern int UIKit_GL_LoadLibrary(_THIS, const char *path);
-
-#endif
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitopengles.m b/deps/SDL2/src/video/uikit/SDL_uikitopengles.m
deleted file mode 100644
index d1cb207..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitopengles.m
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#include "SDL_uikitopengles.h"
-#include "SDL_uikitopenglview.h"
-#include "SDL_uikitappdelegate.h"
-#include "SDL_uikitmodes.h"
-#include "SDL_uikitwindow.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../power/uikit/SDL_syspower.h"
-#include "SDL_loadso.h"
-#include <dlfcn.h>
-
-static int UIKit_GL_Initialize(_THIS);
-
-void *
-UIKit_GL_GetProcAddress(_THIS, const char *proc)
-{
-    /* Look through all SO's for the proc symbol.  Here's why:
-       -Looking for the path to the OpenGL Library seems not to work in the iPhone Simulator.
-       -We don't know that the path won't change in the future.
-    */
-    return dlsym(RTLD_DEFAULT, proc);
-}
-
-/*
-    note that SDL_GL_Delete context makes it current without passing the window
-*/
-int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
-{
-    if (context) {
-        SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
-        [data->view setCurrentContext];
-    }
-    else {
-        [EAGLContext setCurrentContext: nil];
-    }
-
-    return 0;
-}
-
-int
-UIKit_GL_LoadLibrary(_THIS, const char *path)
-{
-    /*
-        shouldn't be passing a path into this function
-        why?  Because we've already loaded the library
-        and because the SDK forbids loading an external SO
-    */
-    if (path != NULL) {
-        return SDL_SetError("iPhone GL Load Library just here for compatibility");
-    }
-    return 0;
-}
-
-void UIKit_GL_SwapWindow(_THIS, SDL_Window * window)
-{
-#if SDL_POWER_UIKIT
-    /* Check once a frame to see if we should turn off the battery monitor. */
-    SDL_UIKit_UpdateBatteryMonitoring();
-#endif
-
-    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
-
-    if (nil == data->view) {
-        return;
-    }
-    [data->view swapBuffers];
-
-    /* You need to pump events in order for the OS to make changes visible.
-       We don't pump events here because we don't want iOS application events
-       (low memory, terminate, etc.) to happen inside low level rendering.
-     */
-}
-
-SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window)
-{
-    SDL_uikitopenglview *view;
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_DisplayData *displaydata = display->driverdata;
-    SDL_DisplayModeData *displaymodedata = display->current_mode.driverdata;
-    UIWindow *uiwindow = data->uiwindow;
-    EAGLSharegroup *share_group = nil;
-
-    if (_this->gl_config.share_with_current_context) {
-        SDL_uikitopenglview *view = (SDL_uikitopenglview *) SDL_GL_GetCurrentContext();
-        share_group = [view.context sharegroup];
-    }
-
-    /* construct our view, passing in SDL's OpenGL configuration data */
-    CGRect frame;
-    if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
-        frame = [displaydata->uiscreen bounds];
-    } else {
-        frame = [displaydata->uiscreen applicationFrame];
-    }
-    view = [[SDL_uikitopenglview alloc] initWithFrame: frame
-                                    scale: displaymodedata->scale
-                                    retainBacking: _this->gl_config.retained_backing
-                                    rBits: _this->gl_config.red_size
-                                    gBits: _this->gl_config.green_size
-                                    bBits: _this->gl_config.blue_size
-                                    aBits: _this->gl_config.alpha_size
-                                    depthBits: _this->gl_config.depth_size
-                                    stencilBits: _this->gl_config.stencil_size
-                                    majorVersion: _this->gl_config.major_version
-                                    shareGroup: share_group];
-    if (!view) {
-        return NULL;
-    }
-
-    data->view = view;
-    view->viewcontroller = data->viewcontroller;
-    if (view->viewcontroller != nil) {
-        [view->viewcontroller setView:view];
-        [view->viewcontroller retain];
-    }
-    [uiwindow addSubview: view];
-
-    /* The view controller needs to be the root in order to control rotation on iOS 6.0 */
-    if (uiwindow.rootViewController == nil) {
-        uiwindow.rootViewController = view->viewcontroller;
-    }
-
-    if (UIKit_GL_MakeCurrent(_this, window, view) < 0) {
-        UIKit_GL_DeleteContext(_this, view);
-        return NULL;
-    }
-
-    /* Make this window the current mouse focus for touch input */
-    if (displaydata->uiscreen == [UIScreen mainScreen]) {
-        SDL_SetMouseFocus(window);
-        SDL_SetKeyboardFocus(window);
-    }
-
-    return view;
-}
-
-void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context)
-{
-    /* the delegate has retained the view, this will release him */
-    SDL_uikitopenglview *view = (SDL_uikitopenglview *)context;
-    if (view->viewcontroller) {
-        UIWindow *uiwindow = (UIWindow *)view.superview;
-        if (uiwindow.rootViewController == view->viewcontroller) {
-            uiwindow.rootViewController = nil;
-        }
-        [view->viewcontroller setView:nil];
-        [view->viewcontroller release];
-    }
-    [view removeFromSuperview];
-    [view release];
-}
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitopenglview.h b/deps/SDL2/src/video/uikit/SDL_uikitopenglview.h
deleted file mode 100644
index 344ad6a..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitopenglview.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#import <UIKit/UIKit.h>
-#import <OpenGLES/EAGL.h>
-#import <OpenGLES/ES1/gl.h>
-#import <OpenGLES/ES1/glext.h>
-#import "SDL_uikitview.h"
-/*
-    This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
-    The view content is basically an EAGL surface you render your OpenGL scene into.
-    Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
- */
- at interface SDL_uikitopenglview : SDL_uikitview {
-
- at private
-    /* The pixel dimensions of the backbuffer */
-    GLint backingWidth;
-    GLint backingHeight;
-
-    EAGLContext *context;
-
-    /* OpenGL names for the renderbuffer and framebuffers used to render to this view */
-    GLuint viewRenderbuffer, viewFramebuffer;
-
-    /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */
-    GLuint depthRenderbuffer;
-
-    /* format of depthRenderbuffer */
-    GLenum depthBufferFormat;
-
-    id displayLink;
-    int animationInterval;
-    void (*animationCallback)(void*);
-    void *animationCallbackParam;
-}
-
- at property (nonatomic, retain, readonly) EAGLContext *context;
-
-- (void)swapBuffers;
-- (void)setCurrentContext;
-
-- (id)initWithFrame:(CGRect)frame
-    scale:(CGFloat)scale
-    retainBacking:(BOOL)retained
-    rBits:(int)rBits
-    gBits:(int)gBits
-    bBits:(int)bBits
-    aBits:(int)aBits
-    depthBits:(int)depthBits
-    stencilBits:(int)stencilBits
-    majorVersion:(int)majorVersion
-    shareGroup:(EAGLSharegroup*)shareGroup;
-
-- (void)updateFrame;
-
-- (void)setAnimationCallback:(int)interval
-    callback:(void (*)(void*))callback
-    callbackParam:(void*)callbackParam;
-
-- (void)startAnimation;
-- (void)stopAnimation;
-
-- (void)doLoop:(id)sender;
-
- at end
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitopenglview.m b/deps/SDL2/src/video/uikit/SDL_uikitopenglview.m
deleted file mode 100644
index b43f345..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitopenglview.m
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#include <QuartzCore/QuartzCore.h>
-#include <OpenGLES/EAGLDrawable.h>
-#include "SDL_uikitopenglview.h"
-#include "SDL_uikitmessagebox.h"
-
-
- at implementation SDL_uikitopenglview
-
- at synthesize context;
-
-+ (Class)layerClass
-{
-    return [CAEAGLLayer class];
-}
-
-- (id)initWithFrame:(CGRect)frame
-      scale:(CGFloat)scale
-      retainBacking:(BOOL)retained
-      rBits:(int)rBits
-      gBits:(int)gBits
-      bBits:(int)bBits
-      aBits:(int)aBits
-      depthBits:(int)depthBits
-      stencilBits:(int)stencilBits
-      majorVersion:(int)majorVersion
-      shareGroup:(EAGLSharegroup*)shareGroup
-{
-    depthBufferFormat = 0;
-
-    if ((self = [super initWithFrame:frame])) {
-        const BOOL useStencilBuffer = (stencilBits != 0);
-        const BOOL useDepthBuffer = (depthBits != 0);
-        NSString *colorFormat = nil;
-
-        if (rBits == 8 && gBits == 8 && bBits == 8) {
-            /* if user specifically requests rbg888 or some color format higher than 16bpp */
-            colorFormat = kEAGLColorFormatRGBA8;
-        } else {
-            /* default case (faster) */
-            colorFormat = kEAGLColorFormatRGB565;
-        }
-
-        /* Get the layer */
-        CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
-
-        eaglLayer.opaque = YES;
-        eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
-                                        [NSNumber numberWithBool: retained], kEAGLDrawablePropertyRetainedBacking, colorFormat, kEAGLDrawablePropertyColorFormat, nil];
-
-        if (majorVersion > 1) {
-            context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:shareGroup];
-        } else {
-            context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1 sharegroup:shareGroup];
-        }
-        if (!context || ![EAGLContext setCurrentContext:context]) {
-            [self release];
-            SDL_SetError("OpenGL ES %d not supported", majorVersion);
-            return nil;
-        }
-
-        /* Set the appropriate scale (for retina display support) */
-        if ([self respondsToSelector:@selector(contentScaleFactor)])
-            self.contentScaleFactor = scale;
-
-        /* create the buffers */
-        glGenFramebuffersOES(1, &viewFramebuffer);
-        glGenRenderbuffersOES(1, &viewRenderbuffer);
-
-        glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
-        glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
-        [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer];
-        glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);
-
-        glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
-        glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
-
-        if ((useDepthBuffer) || (useStencilBuffer)) {
-            if (useStencilBuffer) {
-                /* Apparently you need to pack stencil and depth into one buffer. */
-                depthBufferFormat = GL_DEPTH24_STENCIL8_OES;
-            } else if (useDepthBuffer) {
-                /* iOS only has 24-bit depth buffers, even with GL_DEPTH_COMPONENT16_OES */
-                depthBufferFormat = GL_DEPTH_COMPONENT24_OES;
-            }
-
-            glGenRenderbuffersOES(1, &depthRenderbuffer);
-            glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
-            glRenderbufferStorageOES(GL_RENDERBUFFER_OES, depthBufferFormat, backingWidth, backingHeight);
-            if (useDepthBuffer) {
-                glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);
-            }
-            if (useStencilBuffer) {
-                glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_STENCIL_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);
-            }
-        }
-
-        if (glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
-            return NO;
-        }
-
-        glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
-        /* end create buffers */
-
-        self.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
-        self.autoresizesSubviews = YES;
-    }
-    return self;
-}
-
-- (void)updateFrame
-{
-    glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
-    glBindRenderbufferOES(GL_RENDERBUFFER_OES, 0);
-    glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, 0);
-    glDeleteRenderbuffersOES(1, &viewRenderbuffer);
-
-    glGenRenderbuffersOES(1, &viewRenderbuffer);
-    glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
-    [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer];
-    glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);
-
-    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
-    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
-
-    if (depthRenderbuffer != 0) {
-        glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
-        glRenderbufferStorageOES(GL_RENDERBUFFER_OES, depthBufferFormat, backingWidth, backingHeight);
-    }
-
-    glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
-}
-
-- (void)setAnimationCallback:(int)interval
-    callback:(void (*)(void*))callback
-    callbackParam:(void*)callbackParam
-{
-    [self stopAnimation];
-
-    animationInterval = interval;
-    animationCallback = callback;
-    animationCallbackParam = callbackParam;
-
-    if (animationCallback)
-        [self startAnimation];
-}
-
-- (void)startAnimation
-{
-    /* CADisplayLink is API new to iPhone SDK 3.1.
-     * Compiling against earlier versions will result in a warning, but can be dismissed
-     * if the system version runtime check for CADisplayLink exists in -initWithCoder:.
-     */
-    displayLink = [NSClassFromString(@"CADisplayLink") displayLinkWithTarget:self selector:@selector(doLoop:)];
-    [displayLink setFrameInterval:animationInterval];
-    [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-}
-
-- (void)stopAnimation
-{
-    [displayLink invalidate];
-    displayLink = nil;
-}
-
-- (void)doLoop:(id)sender
-{
-    /* Don't run the game loop while a messagebox is up */
-    if (!UIKit_ShowingMessageBox()) {
-        animationCallback(animationCallbackParam);
-    }
-}
-
-- (void)setCurrentContext
-{
-    [EAGLContext setCurrentContext:context];
-}
-
-
-- (void)swapBuffers
-{
-    /* viewRenderbuffer should always be bound here. Code that binds something
-        else is responsible for rebinding viewRenderbuffer, to reduce
-        duplicate state changes. */
-    [context presentRenderbuffer:GL_RENDERBUFFER_OES];
-}
-
-
-- (void)layoutSubviews
-{
-    [EAGLContext setCurrentContext:context];
-    [self updateFrame];
-}
-
-- (void)destroyFramebuffer
-{
-    glDeleteFramebuffersOES(1, &viewFramebuffer);
-    viewFramebuffer = 0;
-    glDeleteRenderbuffersOES(1, &viewRenderbuffer);
-    viewRenderbuffer = 0;
-
-    if (depthRenderbuffer) {
-        glDeleteRenderbuffersOES(1, &depthRenderbuffer);
-        depthRenderbuffer = 0;
-    }
-}
-
-
-- (void)dealloc
-{
-    [self destroyFramebuffer];
-    if ([EAGLContext currentContext] == context) {
-        [EAGLContext setCurrentContext:nil];
-    }
-    [context release];
-    [super dealloc];
-}
-
- at end
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitvideo.h b/deps/SDL2/src/video/uikit/SDL_uikitvideo.h
deleted file mode 100644
index 8969e91..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitvideo.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef _SDL_uikitvideo_h
-#define _SDL_uikitvideo_h
-
-#include <UIKit/UIKit.h>
-
-#include "../SDL_sysvideo.h"
-
-#ifndef __IPHONE_6_0
-/* This enum isn't available in older SDKs, but we use it for our own purposes on iOS 5.1 and for the system on iOS 6.0 */
-enum UIInterfaceOrientationMask
-{
-    UIInterfaceOrientationMaskPortrait = (1 << UIInterfaceOrientationPortrait),
-    UIInterfaceOrientationMaskLandscapeLeft = (1 << UIInterfaceOrientationLandscapeLeft),
-    UIInterfaceOrientationMaskLandscapeRight = (1 << UIInterfaceOrientationLandscapeRight),
-    UIInterfaceOrientationMaskPortraitUpsideDown = (1 << UIInterfaceOrientationPortraitUpsideDown),
-    UIInterfaceOrientationMaskLandscape = (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight),
-    UIInterfaceOrientationMaskAll = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown),
-    UIInterfaceOrientationMaskAllButUpsideDown = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight),
-};
-#endif /* !__IPHONE_6_0 */
-
-
-#endif /* _SDL_uikitvideo_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitvideo.m b/deps/SDL2/src/video/uikit/SDL_uikitvideo.m
deleted file mode 100644
index 74b24b8..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitvideo.m
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#import <UIKit/UIKit.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_uikitvideo.h"
-#include "SDL_uikitevents.h"
-#include "SDL_uikitmodes.h"
-#include "SDL_uikitwindow.h"
-#include "SDL_uikitopengles.h"
-
-#define UIKITVID_DRIVER_NAME "uikit"
-
-/* Initialization/Query functions */
-static int UIKit_VideoInit(_THIS);
-static void UIKit_VideoQuit(_THIS);
-
-/* DUMMY driver bootstrap functions */
-
-static int
-UIKit_Available(void)
-{
-    return 1;
-}
-
-static void UIKit_DeleteDevice(SDL_VideoDevice * device)
-{
-    SDL_free(device);
-}
-
-static SDL_VideoDevice *
-UIKit_CreateDevice(int devindex)
-{
-    SDL_VideoDevice *device;
-
-    /* Initialize all variables that we clean on shutdown */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-    if (!device) {
-        SDL_free(device);
-        SDL_OutOfMemory();
-        return (0);
-    }
-
-    /* Set the function pointers */
-    device->VideoInit = UIKit_VideoInit;
-    device->VideoQuit = UIKit_VideoQuit;
-    device->GetDisplayModes = UIKit_GetDisplayModes;
-    device->SetDisplayMode = UIKit_SetDisplayMode;
-    device->PumpEvents = UIKit_PumpEvents;
-    device->CreateWindow = UIKit_CreateWindow;
-    device->ShowWindow = UIKit_ShowWindow;
-    device->HideWindow = UIKit_HideWindow;
-    device->RaiseWindow = UIKit_RaiseWindow;
-    device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
-    device->DestroyWindow = UIKit_DestroyWindow;
-    device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
-
-    /* !!! FIXME: implement SetWindowBordered */
-
-#if SDL_IPHONE_KEYBOARD
-    device->HasScreenKeyboardSupport = UIKit_HasScreenKeyboardSupport;
-    device->ShowScreenKeyboard = UIKit_ShowScreenKeyboard;
-    device->HideScreenKeyboard = UIKit_HideScreenKeyboard;
-    device->IsScreenKeyboardShown = UIKit_IsScreenKeyboardShown;
-#endif
-
-    /* OpenGL (ES) functions */
-    device->GL_MakeCurrent        = UIKit_GL_MakeCurrent;
-    device->GL_SwapWindow        = UIKit_GL_SwapWindow;
-    device->GL_CreateContext    = UIKit_GL_CreateContext;
-    device->GL_DeleteContext    = UIKit_GL_DeleteContext;
-    device->GL_GetProcAddress   = UIKit_GL_GetProcAddress;
-    device->GL_LoadLibrary        = UIKit_GL_LoadLibrary;
-    device->free = UIKit_DeleteDevice;
-
-    device->gl_config.accelerated = 1;
-
-    return device;
-}
-
-VideoBootStrap UIKIT_bootstrap = {
-    UIKITVID_DRIVER_NAME, "SDL UIKit video driver",
-    UIKit_Available, UIKit_CreateDevice
-};
-
-
-int
-UIKit_VideoInit(_THIS)
-{
-    _this->gl_config.driver_loaded = 1;
-
-    if (UIKit_InitModes(_this) < 0) {
-        return -1;
-    }
-    return 0;
-}
-
-void
-UIKit_VideoQuit(_THIS)
-{
-    UIKit_QuitModes(_this);
-}
-
-/*
- * iOS log support.
- *
- * This doesn't really have aything to do with the interfaces of the SDL video
- *  subsystem, but we need to stuff this into an Objective-C source code file.
- */
-
-void SDL_NSLog(const char *text)
-{
-    NSLog(@"%s", text);
-}
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitview.h b/deps/SDL2/src/video/uikit/SDL_uikitview.h
deleted file mode 100644
index ff8a7d2..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitview.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#import <UIKit/UIKit.h>
-#import "SDL_uikitviewcontroller.h"
-
-#include "SDL_touch.h"
-
-#define IPHONE_TOUCH_EFFICIENT_DANGEROUS
-
-#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
-#define MAX_SIMULTANEOUS_TOUCHES 5
-#endif
-
-#if SDL_IPHONE_KEYBOARD
- at interface SDL_uikitview : UIView<UITextFieldDelegate> {
-#else
- at interface SDL_uikitview : UIView {
-#endif
-
-    SDL_TouchID touchId;
-    UITouch *leftFingerDown;
-#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
-    UITouch *finger[MAX_SIMULTANEOUS_TOUCHES];
-#endif
-
-#if SDL_IPHONE_KEYBOARD
-    UITextField *textField;
-    BOOL keyboardVisible;
-#endif
-
- at public
-    SDL_uikitviewcontroller *viewcontroller;
-}
-- (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize;
-- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
-- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
-- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
-
-#if SDL_IPHONE_KEYBOARD
-- (void)showKeyboard;
-- (void)hideKeyboard;
-- (void)initializeKeyboard;
- at property (readonly) BOOL keyboardVisible;
-
-SDL_bool UIKit_HasScreenKeyboardSupport(_THIS);
-void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window);
-void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window);
-SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window);
-
-#endif
-
- at end
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitview.m b/deps/SDL2/src/video/uikit/SDL_uikitview.m
deleted file mode 100644
index 66129be..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitview.m
+++ /dev/null
@@ -1,359 +0,0 @@
- /*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#include "SDL_uikitview.h"
-
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/SDL_touch_c.h"
-
-#if SDL_IPHONE_KEYBOARD
-#include "keyinfotable.h"
-#endif
-#include "SDL_uikitappdelegate.h"
-#include "SDL_uikitmodes.h"
-#include "SDL_uikitwindow.h"
-
- at implementation SDL_uikitview
-
-- (void)dealloc
-{
-    [super dealloc];
-}
-
-- (id)initWithFrame:(CGRect)frame
-{
-    self = [super initWithFrame: frame];
-
-#if SDL_IPHONE_KEYBOARD
-    [self initializeKeyboard];
-#endif
-
-    self.multipleTouchEnabled = YES;
-
-    touchId = 1;
-    SDL_AddTouch(touchId, "");
-
-    return self;
-
-}
-
-- (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize
-{
-    CGPoint point = [touch locationInView: self];
-
-    /* Get the display scale and apply that to the input coordinates */
-    SDL_Window *window = self->viewcontroller.window;
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata;
-
-    if (normalize) {
-        CGRect bounds = [self bounds];
-        point.x /= bounds.size.width;
-        point.y /= bounds.size.height;
-    } else {
-        point.x *= displaymodedata->scale;
-        point.y *= displaymodedata->scale;
-    }
-    return point;
-}
-
-- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
-{
-    NSEnumerator *enumerator = [touches objectEnumerator];
-    UITouch *touch = (UITouch*)[enumerator nextObject];
-
-    while (touch) {
-        if (!leftFingerDown) {
-            CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
-
-            /* send moved event */
-            SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
-
-            /* send mouse down event */
-            SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
-
-            leftFingerDown = touch;
-        }
-
-        CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
-#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
-        /* FIXME: TODO: Using touch as the fingerId is potentially dangerous
-         * It is also much more efficient than storing the UITouch pointer
-         * and comparing it to the incoming event.
-         */
-        SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
-                      SDL_TRUE, locationInView.x, locationInView.y, 1.0f);
-#else
-        int i;
-        for(i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) {
-            if (finger[i] == NULL) {
-                finger[i] = touch;
-                SDL_SendTouch(touchId, i,
-                              SDL_TRUE, locationInView.x, locationInView.y, 1.0f);
-                break;
-            }
-        }
-#endif
-        touch = (UITouch*)[enumerator nextObject];
-    }
-}
-
-- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
-{
-    NSEnumerator *enumerator = [touches objectEnumerator];
-    UITouch *touch = (UITouch*)[enumerator nextObject];
-
-    while(touch) {
-        if (touch == leftFingerDown) {
-            /* send mouse up */
-            SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
-            leftFingerDown = nil;
-        }
-
-        CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
-#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
-        SDL_SendTouch(touchId, (long)touch,
-                      SDL_FALSE, locationInView.x, locationInView.y, 1.0f);
-#else
-        int i;
-        for (i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) {
-            if (finger[i] == touch) {
-                SDL_SendTouch(touchId, i,
-                              SDL_FALSE, locationInView.x, locationInView.y, 1.0f);
-                finger[i] = NULL;
-                break;
-            }
-        }
-#endif
-        touch = (UITouch*)[enumerator nextObject];
-    }
-}
-
-- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
-{
-    /*
-        this can happen if the user puts more than 5 touches on the screen
-        at once, or perhaps in other circumstances.  Usually (it seems)
-        all active touches are canceled.
-    */
-    [self touchesEnded: touches withEvent: event];
-}
-
-- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
-{
-    NSEnumerator *enumerator = [touches objectEnumerator];
-    UITouch *touch = (UITouch*)[enumerator nextObject];
-
-    while (touch) {
-        if (touch == leftFingerDown) {
-            CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
-
-            /* send moved event */
-            SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
-        }
-
-        CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
-#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
-        SDL_SendTouchMotion(touchId, (long)touch,
-                            locationInView.x, locationInView.y, 1.0f);
-#else
-        int i;
-        for (i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) {
-            if (finger[i] == touch) {
-                SDL_SendTouchMotion(touchId, i,
-                                    locationInView.x, locationInView.y, 1.0f);
-                break;
-            }
-        }
-#endif
-        touch = (UITouch*)[enumerator nextObject];
-    }
-}
-
-/*
-    ---- Keyboard related functionality below this line ----
-*/
-#if SDL_IPHONE_KEYBOARD
-
-/* Is the iPhone virtual keyboard visible onscreen? */
-- (BOOL)keyboardVisible
-{
-    return keyboardVisible;
-}
-
-/* Set ourselves up as a UITextFieldDelegate */
-- (void)initializeKeyboard
-{
-    textField = [[UITextField alloc] initWithFrame: CGRectZero];
-    textField.delegate = self;
-    /* placeholder so there is something to delete! */
-    textField.text = @" ";
-
-    /* set UITextInputTrait properties, mostly to defaults */
-    textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
-    textField.autocorrectionType = UITextAutocorrectionTypeNo;
-    textField.enablesReturnKeyAutomatically = NO;
-    textField.keyboardAppearance = UIKeyboardAppearanceDefault;
-    textField.keyboardType = UIKeyboardTypeDefault;
-    textField.returnKeyType = UIReturnKeyDefault;
-    textField.secureTextEntry = NO;
-
-    textField.hidden = YES;
-    keyboardVisible = NO;
-    /* add the UITextField (hidden) to our view */
-    [self addSubview: textField];
-    [textField release];
-}
-
-/* reveal onscreen virtual keyboard */
-- (void)showKeyboard
-{
-    keyboardVisible = YES;
-    [textField becomeFirstResponder];
-}
-
-/* hide onscreen virtual keyboard */
-- (void)hideKeyboard
-{
-    keyboardVisible = NO;
-    [textField resignFirstResponder];
-}
-
-/* UITextFieldDelegate method.  Invoked when user types something. */
-- (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
-{
-    if ([string length] == 0) {
-        /* it wants to replace text with nothing, ie a delete */
-        SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_BACKSPACE);
-        SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_BACKSPACE);
-    }
-    else {
-        /* go through all the characters in the string we've been sent
-           and convert them to key presses */
-        int i;
-        for (i = 0; i < [string length]; i++) {
-
-            unichar c = [string characterAtIndex: i];
-
-            Uint16 mod = 0;
-            SDL_Scancode code;
-
-            if (c < 127) {
-                /* figure out the SDL_Scancode and SDL_keymod for this unichar */
-                code = unicharToUIKeyInfoTable[c].code;
-                mod  = unicharToUIKeyInfoTable[c].mod;
-            }
-            else {
-                /* we only deal with ASCII right now */
-                code = SDL_SCANCODE_UNKNOWN;
-                mod = 0;
-            }
-
-            if (mod & KMOD_SHIFT) {
-                /* If character uses shift, press shift down */
-                SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT);
-            }
-            /* send a keydown and keyup even for the character */
-            SDL_SendKeyboardKey(SDL_PRESSED, code);
-            SDL_SendKeyboardKey(SDL_RELEASED, code);
-            if (mod & KMOD_SHIFT) {
-                /* If character uses shift, press shift back up */
-                SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT);
-            }
-        }
-        SDL_SendKeyboardText([string UTF8String]);
-    }
-    return NO; /* don't allow the edit! (keep placeholder text there) */
-}
-
-/* Terminates the editing session */
-- (BOOL)textFieldShouldReturn:(UITextField*)_textField
-{
-    SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);
-    SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN);
-    SDL_StopTextInput();
-    return YES;
-}
-
-#endif
-
- at end
-
-/* iPhone keyboard addition functions */
-#if SDL_IPHONE_KEYBOARD
-
-static SDL_uikitview * getWindowView(SDL_Window * window)
-{
-    if (window == NULL) {
-        SDL_SetError("Window does not exist");
-        return nil;
-    }
-
-    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
-    SDL_uikitview *view = data != NULL ? data->view : nil;
-
-    if (view == nil) {
-        SDL_SetError("Window has no view");
-    }
-
-    return view;
-}
-
-SDL_bool UIKit_HasScreenKeyboardSupport(_THIS)
-{
-    return SDL_TRUE;
-}
-
-void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window)
-{
-    SDL_uikitview *view = getWindowView(window);
-    if (view != nil) {
-        [view showKeyboard];
-    }
-}
-
-void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window)
-{
-    SDL_uikitview *view = getWindowView(window);
-    if (view != nil) {
-        [view hideKeyboard];
-    }
-}
-
-SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window)
-{
-    SDL_uikitview *view = getWindowView(window);
-    if (view == nil) {
-        return 0;
-    }
-
-    return view.keyboardVisible;
-}
-
-#endif /* SDL_IPHONE_KEYBOARD */
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitviewcontroller.h b/deps/SDL2/src/video/uikit/SDL_uikitviewcontroller.h
deleted file mode 100644
index a69c1e1..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitviewcontroller.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty.  In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
- */
-
-#import <UIKit/UIKit.h>
-
-#include "../SDL_sysvideo.h"
-
- at interface SDL_uikitviewcontroller : UIViewController {
- at private
-    SDL_Window *window;
-}
-
- at property (readwrite) SDL_Window *window;
-
-- (id)initWithSDLWindow:(SDL_Window *)_window;
-- (void)loadView;
-- (void)viewDidLayoutSubviews;
-- (NSUInteger)supportedInterfaceOrientations;
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient;
-- (BOOL)prefersStatusBarHidden;
-
- at end
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitviewcontroller.m b/deps/SDL2/src/video/uikit/SDL_uikitviewcontroller.m
deleted file mode 100644
index 077c160..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitviewcontroller.m
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#include "SDL_video.h"
-#include "SDL_assert.h"
-#include "SDL_hints.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_uikitviewcontroller.h"
-#include "SDL_uikitvideo.h"
-#include "SDL_uikitmodes.h"
-#include "SDL_uikitwindow.h"
-
-
- at implementation SDL_uikitviewcontroller
-
- at synthesize window;
-
-- (id)initWithSDLWindow:(SDL_Window *)_window
-{
-    self = [self init];
-    if (self == nil) {
-        return nil;
-    }
-    self.window = _window;
-
-    return self;
-}
-
-- (void)loadView
-{
-    /* do nothing. */
-}
-
-- (void)viewDidLayoutSubviews
-{
-    if (self->window->flags & SDL_WINDOW_RESIZABLE) {
-        SDL_WindowData *data = self->window->driverdata;
-        SDL_VideoDisplay *display = SDL_GetDisplayForWindow(self->window);
-        SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata;
-        const CGSize size = data->view.bounds.size;
-        int w, h;
-
-        w = (int)(size.width * displaymodedata->scale);
-        h = (int)(size.height * displaymodedata->scale);
-
-        SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
-    }
-}
-
-- (NSUInteger)supportedInterfaceOrientations
-{
-    NSUInteger orientationMask = 0;
-
-    const char *orientationsCString;
-    if ((orientationsCString = SDL_GetHint(SDL_HINT_ORIENTATIONS)) != NULL) {
-        BOOL rotate = NO;
-        NSString *orientationsNSString = [NSString stringWithCString:orientationsCString
-                                                            encoding:NSUTF8StringEncoding];
-        NSArray *orientations = [orientationsNSString componentsSeparatedByCharactersInSet:
-                                 [NSCharacterSet characterSetWithCharactersInString:@" "]];
-
-        if ([orientations containsObject:@"LandscapeLeft"]) {
-            orientationMask |= UIInterfaceOrientationMaskLandscapeLeft;
-        }
-        if ([orientations containsObject:@"LandscapeRight"]) {
-            orientationMask |= UIInterfaceOrientationMaskLandscapeRight;
-        }
-        if ([orientations containsObject:@"Portrait"]) {
-            orientationMask |= UIInterfaceOrientationMaskPortrait;
-        }
-        if ([orientations containsObject:@"PortraitUpsideDown"]) {
-            orientationMask |= UIInterfaceOrientationMaskPortraitUpsideDown;
-        }
-
-    } else if (self->window->flags & SDL_WINDOW_RESIZABLE) {
-        orientationMask = UIInterfaceOrientationMaskAll;  /* any orientation is okay. */
-    } else {
-        if (self->window->w >= self->window->h) {
-            orientationMask |= UIInterfaceOrientationMaskLandscape;
-        }
-        if (self->window->h >= self->window->w) {
-            orientationMask |= (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
-        }
-    }
-
-    /* Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation */
-    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
-        orientationMask &= ~UIInterfaceOrientationMaskPortraitUpsideDown;
-    }
-    return orientationMask;
-}
-
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient
-{
-    NSUInteger orientationMask = [self supportedInterfaceOrientations];
-    return (orientationMask & (1 << orient));
-}
-
-- (BOOL)prefersStatusBarHidden
-{
-    if (self->window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
-        return YES;
-    } else {
-        return NO;
-    }
-}
-
- at end
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitwindow.h b/deps/SDL2/src/video/uikit/SDL_uikitwindow.h
deleted file mode 100644
index effad90..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitwindow.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef _SDL_uikitwindow_h
-#define _SDL_uikitwindow_h
-
-#include "../SDL_sysvideo.h"
-#import "SDL_uikitvideo.h"
-#import "SDL_uikitopenglview.h"
-#import "SDL_uikitviewcontroller.h"
-
-typedef struct SDL_WindowData SDL_WindowData;
-
-extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
-extern void UIKit_ShowWindow(_THIS, SDL_Window * window);
-extern void UIKit_HideWindow(_THIS, SDL_Window * window);
-extern void UIKit_RaiseWindow(_THIS, SDL_Window * window);
-extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
-extern void UIKit_DestroyWindow(_THIS, SDL_Window * window);
-extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window,
-                                      struct SDL_SysWMinfo * info);
-
- at class UIWindow;
-
-struct SDL_WindowData
-{
-    UIWindow *uiwindow;
-    SDL_uikitopenglview *view;
-    SDL_uikitviewcontroller *viewcontroller;
-};
-
-#endif /* _SDL_uikitwindow_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/SDL_uikitwindow.m b/deps/SDL2/src/video/uikit/SDL_uikitwindow.m
deleted file mode 100644
index a8b8e67..0000000
--- a/deps/SDL2/src/video/uikit/SDL_uikitwindow.m
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_UIKIT
-
-#include "SDL_syswm.h"
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "SDL_assert.h"
-#include "SDL_hints.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_uikitvideo.h"
-#include "SDL_uikitevents.h"
-#include "SDL_uikitmodes.h"
-#include "SDL_uikitwindow.h"
-#import "SDL_uikitappdelegate.h"
-
-#import "SDL_uikitopenglview.h"
-
-#include <Foundation/Foundation.h>
-
-
-
-
-static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created)
-{
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata;
-    SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
-    SDL_WindowData *data;
-
-    /* Allocate the window data */
-    data = (SDL_WindowData *)SDL_malloc(sizeof(*data));
-    if (!data) {
-        return SDL_OutOfMemory();
-    }
-    data->uiwindow = uiwindow;
-    data->viewcontroller = nil;
-    data->view = nil;
-
-    /* Fill in the SDL window with the window data */
-    {
-        window->x = 0;
-        window->y = 0;
-
-        CGRect bounds;
-        if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
-            bounds = [displaydata->uiscreen bounds];
-        } else {
-            bounds = [displaydata->uiscreen applicationFrame];
-        }
-
-        /* Get frame dimensions in pixels */
-        int width = (int)(bounds.size.width * displaymodedata->scale);
-        int height = (int)(bounds.size.height * displaymodedata->scale);
-
-        /* Make sure the width/height are oriented correctly */
-        if (UIKit_IsDisplayLandscape(displaydata->uiscreen) != (width > height)) {
-            int temp = width;
-            width = height;
-            height = temp;
-        }
-
-        window->w = width;
-        window->h = height;
-    }
-
-    window->driverdata = data;
-
-    /* only one window on iOS, always shown */
-    window->flags &= ~SDL_WINDOW_HIDDEN;
-
-    /* SDL_WINDOW_BORDERLESS controls whether status bar is hidden.
-     * This is only set if the window is on the main screen. Other screens
-     *  just force the window to have the borderless flag.
-     */
-    if (displaydata->uiscreen == [UIScreen mainScreen]) {
-        window->flags |= SDL_WINDOW_INPUT_FOCUS;  /* always has input focus */
-
-        /* This was setup earlier for our window, and in iOS 7 is controlled by the view, not the application
-        if ([UIApplication sharedApplication].statusBarHidden) {
-            window->flags |= SDL_WINDOW_BORDERLESS;
-        } else {
-            window->flags &= ~SDL_WINDOW_BORDERLESS;
-        }
-        */
-    } else {
-        window->flags &= ~SDL_WINDOW_RESIZABLE;  /* window is NEVER resizeable */
-        window->flags &= ~SDL_WINDOW_INPUT_FOCUS;  /* never has input focus */
-        window->flags |= SDL_WINDOW_BORDERLESS;  /* never has a status bar. */
-    }
-
-    /* The View Controller will handle rotating the view when the
-     * device orientation changes. This will trigger resize events, if
-     * appropriate.
-     */
-    SDL_uikitviewcontroller *controller;
-    controller = [SDL_uikitviewcontroller alloc];
-    data->viewcontroller = [controller initWithSDLWindow:window];
-    [data->viewcontroller setTitle:@"SDL App"];  /* !!! FIXME: hook up SDL_SetWindowTitle() */
-
-    return 0;
-}
-
-int
-UIKit_CreateWindow(_THIS, SDL_Window *window)
-{
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
-    const BOOL external = ([UIScreen mainScreen] != data->uiscreen);
-
-    /* SDL currently puts this window at the start of display's linked list. We rely on this. */
-    SDL_assert(_this->windows == window);
-
-    /* We currently only handle a single window per display on iOS */
-    if (window->next != NULL) {
-        return SDL_SetError("Only one window allowed per display.");
-    }
-
-    /* If monitor has a resolution of 0x0 (hasn't been explicitly set by the
-     * user, so it's in standby), try to force the display to a resolution
-     * that most closely matches the desired window size.
-     */
-    if (SDL_UIKit_supports_multiple_displays) {
-        const CGSize origsize = [[data->uiscreen currentMode] size];
-        if ((origsize.width == 0.0f) && (origsize.height == 0.0f)) {
-            if (display->num_display_modes == 0) {
-                _this->GetDisplayModes(_this, display);
-            }
-
-            int i;
-            const SDL_DisplayMode *bestmode = NULL;
-            for (i = display->num_display_modes; i >= 0; i--) {
-                const SDL_DisplayMode *mode = &display->display_modes[i];
-                if ((mode->w >= window->w) && (mode->h >= window->h))
-                    bestmode = mode;
-            }
-
-            if (bestmode) {
-                SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)bestmode->driverdata;
-                [data->uiscreen setCurrentMode:modedata->uiscreenmode];
-
-                /* desktop_mode doesn't change here (the higher level will
-                 * use it to set all the screens back to their defaults
-                 * upon window destruction, SDL_Quit(), etc.
-                 */
-                display->current_mode = *bestmode;
-            }
-        }
-    }
-
-    if (data->uiscreen == [UIScreen mainScreen]) {
-        if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
-            [UIApplication sharedApplication].statusBarHidden = YES;
-        } else {
-            [UIApplication sharedApplication].statusBarHidden = NO;
-        }
-    }
-
-    if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
-        if (window->w > window->h) {
-            if (!UIKit_IsDisplayLandscape(data->uiscreen)) {
-                [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
-            }
-        } else if (window->w < window->h) {
-            if (UIKit_IsDisplayLandscape(data->uiscreen)) {
-                [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
-            }
-        }
-    }
-
-    /* ignore the size user requested, and make a fullscreen window */
-    /* !!! FIXME: can we have a smaller view? */
-    UIWindow *uiwindow = [UIWindow alloc];
-    uiwindow = [uiwindow initWithFrame:[data->uiscreen bounds]];
-
-    /* put the window on an external display if appropriate. This implicitly
-     * does [uiwindow setframe:[uiscreen bounds]], so don't do it on the
-     * main display, where we land by default, as that would eat the
-     * status bar real estate.
-     */
-    if (external) {
-        [uiwindow setScreen:data->uiscreen];
-    }
-
-    if (SetupWindowData(_this, window, uiwindow, SDL_TRUE) < 0) {
-        [uiwindow release];
-        return -1;
-    }
-
-    return 1;
-
-}
-
-void
-UIKit_ShowWindow(_THIS, SDL_Window * window)
-{
-    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
-
-    [uiwindow makeKeyAndVisible];
-}
-
-void
-UIKit_HideWindow(_THIS, SDL_Window * window)
-{
-    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
-
-    uiwindow.hidden = YES;
-}
-
-void
-UIKit_RaiseWindow(_THIS, SDL_Window * window)
-{
-    /* We don't currently offer a concept of "raising" the SDL window, since
-     *  we only allow one per display, in the iOS fashion.
-     * However, we use this entry point to rebind the context to the view
-     *  during OnWindowRestored processing.
-     */
-    _this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx);
-}
-
-void
-UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
-{
-    SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
-    SDL_DisplayModeData *displaymodedata = (SDL_DisplayModeData *) display->current_mode.driverdata;
-    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
-
-    if (fullscreen) {
-        [UIApplication sharedApplication].statusBarHidden = YES;
-    } else {
-        [UIApplication sharedApplication].statusBarHidden = NO;
-    }
-
-    CGRect bounds;
-    if (fullscreen) {
-        bounds = [displaydata->uiscreen bounds];
-    } else {
-        bounds = [displaydata->uiscreen applicationFrame];
-    }
-
-    /* Get frame dimensions in pixels */
-    int width = (int)(bounds.size.width * displaymodedata->scale);
-    int height = (int)(bounds.size.height * displaymodedata->scale);
-
-    /* We can pick either width or height here and we'll rotate the
-       screen to match, so we pick the closest to what we wanted.
-     */
-    if (window->w >= window->h) {
-        if (width > height) {
-            window->w = width;
-            window->h = height;
-        } else {
-            window->w = height;
-            window->h = width;
-        }
-    } else {
-        if (width > height) {
-            window->w = height;
-            window->h = width;
-        } else {
-            window->w = width;
-            window->h = height;
-        }
-    }
-}
-
-void
-UIKit_DestroyWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
-    if (data) {
-        [data->viewcontroller release];
-        [data->uiwindow release];
-        SDL_free(data);
-        window->driverdata = NULL;
-    }
-}
-
-SDL_bool
-UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
-{
-    UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
-
-    if (info->version.major <= SDL_MAJOR_VERSION) {
-        info->subsystem = SDL_SYSWM_UIKIT;
-        info->info.uikit.window = uiwindow;
-        return SDL_TRUE;
-    } else {
-        SDL_SetError("Application not compiled with SDL %d.%d\n",
-                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
-        return SDL_FALSE;
-    }
-}
-
-int
-SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam)
-{
-    SDL_WindowData *data = window ? (SDL_WindowData *)window->driverdata : NULL;
-
-    if (!data || !data->view) {
-        return SDL_SetError("Invalid window or view not set");
-    }
-
-    [data->view setAnimationCallback:interval callback:callback callbackParam:callbackParam];
-    return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_UIKIT */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/uikit/keyinfotable.h b/deps/SDL2/src/video/uikit/keyinfotable.h
deleted file mode 100644
index d588f91..0000000
--- a/deps/SDL2/src/video/uikit/keyinfotable.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _UIKIT_KeyInfo
-#define _UIKIT_KeyInfo
-
-#include "SDL_scancode.h"
-
-/*
-    This file is used by the keyboard code in SDL_uikitview.m to convert between characters
-    passed in from the iPhone's virtual keyboard, and tuples of SDL_Scancode and SDL_keymods.
-    For example unicharToUIKeyInfoTable['a'] would give you the scan code and keymod for lower
-    case a.
-*/
-
-typedef struct
-{
-    SDL_Scancode code;
-    Uint16 mod;
-} UIKitKeyInfo;
-
-/* So far only ASCII characters here */
-static UIKitKeyInfo unicharToUIKeyInfoTable[] = {
-/*  0 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  1 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  2 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  3 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  4 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  5 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  6 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  7 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  8 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  9 */  {  SDL_SCANCODE_UNKNOWN, 0 },
-/*  10 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  11 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  12 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  13 */ {   SDL_SCANCODE_RETURN, 0 },
-/*  14 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  15 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  16 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  17 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  18 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  19 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  20 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  21 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  22 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  23 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  24 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  25 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  26 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  27 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  28 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  29 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  30 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  31 */ {   SDL_SCANCODE_UNKNOWN, 0 },
-/*  32 */ {   SDL_SCANCODE_SPACE, 0 },
-/*  33 */ {   SDL_SCANCODE_1,    KMOD_SHIFT },        /* plus shift modifier '!' */
-/*  34 */ {   SDL_SCANCODE_APOSTROPHE, KMOD_SHIFT },    /* plus shift modifier '"' */
-/*  35 */ {   SDL_SCANCODE_3, KMOD_SHIFT },            /* plus shift modifier '#' */
-/*  36 */ {   SDL_SCANCODE_4, KMOD_SHIFT },            /* plus shift modifier '$' */
-/*  37 */ {   SDL_SCANCODE_5, KMOD_SHIFT },            /* plus shift modifier '%' */
-/*  38 */ {   SDL_SCANCODE_7, KMOD_SHIFT },            /* plus shift modifier '&' */
-/*  39 */ {   SDL_SCANCODE_APOSTROPHE, 0 },    /* '''                       */
-/*  40 */ {   SDL_SCANCODE_9, KMOD_SHIFT },             /* plus shift modifier '(' */
-/*  41 */ {   SDL_SCANCODE_0, KMOD_SHIFT },            /* plus shift modifier ')' */
-/*  42 */ {   SDL_SCANCODE_8, KMOD_SHIFT },            /* '*' */
-/*  43 */ {   SDL_SCANCODE_EQUALS, KMOD_SHIFT },    /* plus shift modifier '+' */
-/*  44 */ {   SDL_SCANCODE_COMMA, 0 },        /* ','                       */
-/*  45 */ {   SDL_SCANCODE_MINUS, 0 },        /* '-'                       */
-/*  46 */ {   SDL_SCANCODE_PERIOD, 0 },        /* '.'                       */
-/*  47 */ {   SDL_SCANCODE_SLASH, 0 },        /* '/'                       */
-/*  48 */ {   SDL_SCANCODE_0, 0    },
-/*  49 */ {   SDL_SCANCODE_1, 0 },
-/*  50 */ {   SDL_SCANCODE_2, 0 },
-/*  51 */ {   SDL_SCANCODE_3, 0 },
-/*  52 */ {   SDL_SCANCODE_4, 0 },
-/*  53 */ {   SDL_SCANCODE_5, 0 },
-/*  54 */ {   SDL_SCANCODE_6, 0 },
-/*  55 */ {   SDL_SCANCODE_7, 0 },
-/*  56 */ {   SDL_SCANCODE_8, 0 },
-/*  57 */ {   SDL_SCANCODE_9, 0 },
-/*  58 */ {   SDL_SCANCODE_SEMICOLON,  KMOD_SHIFT },    /* plus shift modifier ';' */
-/*  59 */ {   SDL_SCANCODE_SEMICOLON, 0 },
-/*  60 */ {   SDL_SCANCODE_COMMA,  KMOD_SHIFT },         /* plus shift modifier '<' */
-/*  61 */ {   SDL_SCANCODE_EQUALS, 0 },
-/*  62 */ {   SDL_SCANCODE_PERIOD,  KMOD_SHIFT },        /* plus shift modifier '>' */
-/*  63 */ {   SDL_SCANCODE_SLASH,  KMOD_SHIFT },        /* plus shift modifier '?' */
-/*  64 */ {   SDL_SCANCODE_2,  KMOD_SHIFT },            /* plus shift modifier '@' */
-/*  65 */ {   SDL_SCANCODE_A,  KMOD_SHIFT },            /* all the following need shift modifiers */
-/*  66 */ {   SDL_SCANCODE_B,  KMOD_SHIFT },
-/*  67 */ {   SDL_SCANCODE_C,  KMOD_SHIFT },
-/*  68 */ {   SDL_SCANCODE_D,  KMOD_SHIFT },
-/*  69 */ {   SDL_SCANCODE_E,  KMOD_SHIFT },
-/*  70 */ {   SDL_SCANCODE_F,  KMOD_SHIFT },
-/*  71 */ {   SDL_SCANCODE_G,  KMOD_SHIFT },
-/*  72 */ {   SDL_SCANCODE_H,  KMOD_SHIFT },
-/*  73 */ {   SDL_SCANCODE_I,  KMOD_SHIFT },
-/*  74 */ {   SDL_SCANCODE_J,  KMOD_SHIFT },
-/*  75 */ {   SDL_SCANCODE_K,  KMOD_SHIFT },
-/*  76 */ {   SDL_SCANCODE_L,  KMOD_SHIFT },
-/*  77 */ {   SDL_SCANCODE_M,  KMOD_SHIFT },
-/*  78 */ {   SDL_SCANCODE_N,  KMOD_SHIFT },
-/*  79 */ {   SDL_SCANCODE_O,  KMOD_SHIFT },
-/*  80 */ {   SDL_SCANCODE_P,  KMOD_SHIFT },
-/*  81 */ {   SDL_SCANCODE_Q,  KMOD_SHIFT },
-/*  82 */ {   SDL_SCANCODE_R,  KMOD_SHIFT },
-/*  83 */ {   SDL_SCANCODE_S,  KMOD_SHIFT },
-/*  84 */ {   SDL_SCANCODE_T,  KMOD_SHIFT },
-/*  85 */ {   SDL_SCANCODE_U,  KMOD_SHIFT },
-/*  86 */ {   SDL_SCANCODE_V,  KMOD_SHIFT },
-/*  87 */ {   SDL_SCANCODE_W,  KMOD_SHIFT },
-/*  88 */ {   SDL_SCANCODE_X,  KMOD_SHIFT },
-/*  89 */ {   SDL_SCANCODE_Y,  KMOD_SHIFT },
-/*  90 */ {   SDL_SCANCODE_Z,  KMOD_SHIFT },
-/*  91 */ {   SDL_SCANCODE_LEFTBRACKET, 0 },
-/*  92 */ {   SDL_SCANCODE_BACKSLASH, 0 },
-/*  93 */ {   SDL_SCANCODE_RIGHTBRACKET, 0 },
-/*  94 */ {   SDL_SCANCODE_6,  KMOD_SHIFT },            /* plus shift modifier '^' */
-/*  95 */ {   SDL_SCANCODE_MINUS,  KMOD_SHIFT },        /* plus shift modifier '_' */
-/*  96 */ {   SDL_SCANCODE_GRAVE,  KMOD_SHIFT },        /* '`' */
-/*  97 */ {   SDL_SCANCODE_A, 0    },
-/*  98 */ {   SDL_SCANCODE_B, 0 },
-/*  99 */ {   SDL_SCANCODE_C, 0 },
-/*  100 */{    SDL_SCANCODE_D, 0 },
-/*  101 */{    SDL_SCANCODE_E, 0 },
-/*  102 */{    SDL_SCANCODE_F, 0 },
-/*  103 */{    SDL_SCANCODE_G, 0 },
-/*  104 */{    SDL_SCANCODE_H, 0 },
-/*  105 */{    SDL_SCANCODE_I, 0 },
-/*  106 */{    SDL_SCANCODE_J, 0 },
-/*  107 */{    SDL_SCANCODE_K, 0 },
-/*  108 */{    SDL_SCANCODE_L, 0 },
-/*  109 */{    SDL_SCANCODE_M, 0 },
-/*  110 */{    SDL_SCANCODE_N, 0 },
-/*  111 */{    SDL_SCANCODE_O, 0 },
-/*  112 */{    SDL_SCANCODE_P, 0 },
-/*  113 */{    SDL_SCANCODE_Q, 0 },
-/*  114 */{    SDL_SCANCODE_R, 0 },
-/*  115 */{    SDL_SCANCODE_S, 0 },
-/*  116 */{    SDL_SCANCODE_T, 0 },
-/*  117 */{    SDL_SCANCODE_U, 0 },
-/*  118 */{    SDL_SCANCODE_V, 0 },
-/*  119 */{    SDL_SCANCODE_W, 0 },
-/*  120 */{    SDL_SCANCODE_X, 0 },
-/*  121 */{    SDL_SCANCODE_Y, 0 },
-/*  122 */{    SDL_SCANCODE_Z, 0 },
-/*  123 */{    SDL_SCANCODE_LEFTBRACKET, KMOD_SHIFT },    /* plus shift modifier '{' */
-/*  124 */{    SDL_SCANCODE_BACKSLASH, KMOD_SHIFT },    /* plus shift modifier '|' */
-/*  125 */{    SDL_SCANCODE_RIGHTBRACKET, KMOD_SHIFT },    /* plus shift modifier '}' */
-/*  126 */{    SDL_SCANCODE_GRAVE, KMOD_SHIFT },         /* plus shift modifier '~' */
-/*  127 */{    SDL_SCANCODE_BACKSPACE, KMOD_SHIFT }
-};
-
-#endif /* UIKitKeyInfo */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_msctf.h b/deps/SDL2/src/video/windows/SDL_msctf.h
deleted file mode 100644
index 9ff43c0..0000000
--- a/deps/SDL2/src/video/windows/SDL_msctf.h
+++ /dev/null
@@ -1,221 +0,0 @@
-#ifndef _SDL_msctf_h
-#define _SDL_msctf_h
-
-#include <unknwn.h>
-
-#define     TF_INVALID_COOKIE               (0xffffffff)
-#define     TF_IPSINK_FLAG_ACTIVE           0x0001
-#define     TF_TMAE_UIELEMENTENABLEDONLY    0x00000004
-
-typedef struct ITfThreadMgr ITfThreadMgr;
-typedef struct ITfDocumentMgr ITfDocumentMgr;
-typedef struct ITfClientId ITfClientId;
-
-typedef struct IEnumTfDocumentMgrs IEnumTfDocumentMgrs;
-typedef struct IEnumTfFunctionProviders IEnumTfFunctionProviders;
-typedef struct ITfFunctionProvider ITfFunctionProvider;
-typedef struct ITfCompartmentMgr ITfCompartmentMgr;
-typedef struct ITfContext ITfContext;
-typedef struct IEnumTfContexts IEnumTfContexts;
-typedef struct ITfUIElementSink ITfUIElementSink;
-typedef struct ITfUIElement ITfUIElement;
-typedef struct ITfUIElementMgr ITfUIElementMgr;
-typedef struct IEnumTfUIElements IEnumTfUIElements;
-typedef struct ITfThreadMgrEx ITfThreadMgrEx;
-typedef struct ITfCandidateListUIElement ITfCandidateListUIElement;
-typedef struct ITfReadingInformationUIElement ITfReadingInformationUIElement;
-typedef struct ITfInputProcessorProfileActivationSink ITfInputProcessorProfileActivationSink;
-typedef struct ITfSource ITfSource;
-
-typedef DWORD TfClientId;
-typedef DWORD TfEditCookie;
-
-typedef struct ITfThreadMgrVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfThreadMgr *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfThreadMgr *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfThreadMgr *);
-    HRESULT (STDMETHODCALLTYPE *Activate)(ITfThreadMgr *, TfClientId *);
-    HRESULT (STDMETHODCALLTYPE *Deactivate)(ITfThreadMgr *);
-    HRESULT (STDMETHODCALLTYPE *CreateDocumentMgr)(ITfThreadMgr *);
-    HRESULT (STDMETHODCALLTYPE *EnumDocumentMgrs)(ITfThreadMgr *, IEnumTfDocumentMgrs **);
-    HRESULT (STDMETHODCALLTYPE *GetFocus)(ITfThreadMgr *, ITfDocumentMgr **);
-    HRESULT (STDMETHODCALLTYPE *SetFocus)(ITfThreadMgr *, ITfDocumentMgr *);
-    HRESULT (STDMETHODCALLTYPE *AssociateFocus)(ITfThreadMgr *, HWND, ITfDocumentMgr *, ITfDocumentMgr **);
-    HRESULT (STDMETHODCALLTYPE *IsThreadFocus)(ITfThreadMgr *, BOOL *);
-    HRESULT (STDMETHODCALLTYPE *GetFunctionProvider)(ITfThreadMgr *, REFCLSID, ITfFunctionProvider **);
-    HRESULT (STDMETHODCALLTYPE *EnumFunctionProviders)(ITfThreadMgr *, IEnumTfFunctionProviders **);
-    HRESULT (STDMETHODCALLTYPE *GetGlobalCompartment)(ITfThreadMgr *, ITfCompartmentMgr **);
-} ITfThreadMgrVtbl;
-
-struct ITfThreadMgr
-{
-    const struct ITfThreadMgrVtbl *lpVtbl;
-};
-
-typedef struct ITfThreadMgrExVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfThreadMgrEx *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfThreadMgrEx *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfThreadMgrEx *);
-    HRESULT (STDMETHODCALLTYPE *Activate)(ITfThreadMgrEx *, TfClientId *);
-    HRESULT (STDMETHODCALLTYPE *Deactivate)(ITfThreadMgrEx *);
-    HRESULT (STDMETHODCALLTYPE *CreateDocumentMgr)(ITfThreadMgrEx *, ITfDocumentMgr **);
-    HRESULT (STDMETHODCALLTYPE *EnumDocumentMgrs)(ITfThreadMgrEx *, IEnumTfDocumentMgrs **);
-    HRESULT (STDMETHODCALLTYPE *GetFocus)(ITfThreadMgrEx *, ITfDocumentMgr **);
-    HRESULT (STDMETHODCALLTYPE *SetFocus)(ITfThreadMgrEx *, ITfDocumentMgr *);
-    HRESULT (STDMETHODCALLTYPE *AssociateFocus)(ITfThreadMgrEx *, ITfDocumentMgr *, ITfDocumentMgr **);
-    HRESULT (STDMETHODCALLTYPE *IsThreadFocus)(ITfThreadMgrEx *, BOOL *);
-    HRESULT (STDMETHODCALLTYPE *GetFunctionProvider)(ITfThreadMgrEx *, REFCLSID, ITfFunctionProvider **);
-    HRESULT (STDMETHODCALLTYPE *EnumFunctionProviders)(ITfThreadMgrEx *, IEnumTfFunctionProviders **);
-    HRESULT (STDMETHODCALLTYPE *GetGlobalCompartment)(ITfThreadMgrEx *, ITfCompartmentMgr **);
-    HRESULT (STDMETHODCALLTYPE *ActivateEx)(ITfThreadMgrEx *, TfClientId *, DWORD);
-    HRESULT (STDMETHODCALLTYPE *GetActiveFlags)(ITfThreadMgrEx *, DWORD *);
-} ITfThreadMgrExVtbl;
-
-struct ITfThreadMgrEx
-{
-    const struct ITfThreadMgrExVtbl *lpVtbl;
-};
-
-typedef struct ITfDocumentMgrVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfDocumentMgr *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfDocumentMgr *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfDocumentMgr *);
-    HRESULT (STDMETHODCALLTYPE *CreateContext)(ITfDocumentMgr *, TfClientId, DWORD, IUnknown *, ITfContext **, TfEditCookie *);
-    HRESULT (STDMETHODCALLTYPE *Push)(ITfDocumentMgr *, ITfContext *);
-    HRESULT (STDMETHODCALLTYPE *Pop)(ITfDocumentMgr *);
-    HRESULT (STDMETHODCALLTYPE *GetTop)(ITfDocumentMgr *, ITfContext **);
-    HRESULT (STDMETHODCALLTYPE *GetBase)(ITfDocumentMgr *, ITfContext **);
-    HRESULT (STDMETHODCALLTYPE *EnumContexts)(ITfDocumentMgr *, IEnumTfContexts **);
-} ITfDocumentMgrVtbl;
-
-struct ITfDocumentMgr
-{
-    const struct ITfDocumentMgrVtbl *lpVtbl;
-};
-
-typedef struct ITfUIElementSinkVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfUIElementSink *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfUIElementSink *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfUIElementSink *);
-    HRESULT (STDMETHODCALLTYPE *BeginUIElement)(ITfUIElementSink *, DWORD, BOOL *);
-    HRESULT (STDMETHODCALLTYPE *UpdateUIElement)(ITfUIElementSink *, DWORD);
-    HRESULT (STDMETHODCALLTYPE *EndUIElement)(ITfUIElementSink *, DWORD);
-} ITfUIElementSinkVtbl;
-
-struct ITfUIElementSink
-{
-    const struct ITfUIElementSinkVtbl *lpVtbl;
-};
-
-typedef struct ITfUIElementMgrVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfUIElementMgr *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfUIElementMgr *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfUIElementMgr *);
-    HRESULT (STDMETHODCALLTYPE *BeginUIElement)(ITfUIElementMgr *, ITfUIElement *, BOOL *, DWORD *);
-    HRESULT (STDMETHODCALLTYPE *UpdateUIElement)(ITfUIElementMgr *, DWORD);
-    HRESULT (STDMETHODCALLTYPE *EndUIElement)(ITfUIElementMgr *, DWORD);
-    HRESULT (STDMETHODCALLTYPE *GetUIElement)(ITfUIElementMgr *, DWORD, ITfUIElement **);
-    HRESULT (STDMETHODCALLTYPE *EnumUIElements)(ITfUIElementMgr *, IEnumTfUIElements **);
-} ITfUIElementMgrVtbl;
-
-struct ITfUIElementMgr
-{
-    const struct ITfUIElementMgrVtbl *lpVtbl;
-};
-
-typedef struct ITfCandidateListUIElementVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfCandidateListUIElement *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfCandidateListUIElement *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfCandidateListUIElement *);
-    HRESULT (STDMETHODCALLTYPE *GetDescription)(ITfCandidateListUIElement *, BSTR *);
-    HRESULT (STDMETHODCALLTYPE *GetGUID)(ITfCandidateListUIElement *, GUID *);
-    HRESULT (STDMETHODCALLTYPE *Show)(ITfCandidateListUIElement *, BOOL);
-    HRESULT (STDMETHODCALLTYPE *IsShown)(ITfCandidateListUIElement *, BOOL *);
-    HRESULT (STDMETHODCALLTYPE *GetUpdatedFlags)(ITfCandidateListUIElement *, DWORD *);
-    HRESULT (STDMETHODCALLTYPE *GetDocumentMgr)(ITfCandidateListUIElement *, ITfDocumentMgr **);
-    HRESULT (STDMETHODCALLTYPE *GetCount)(ITfCandidateListUIElement *, UINT *);
-    HRESULT (STDMETHODCALLTYPE *GetSelection)(ITfCandidateListUIElement *, UINT *);
-    HRESULT (STDMETHODCALLTYPE *GetString)(ITfCandidateListUIElement *, UINT, BSTR *);
-    HRESULT (STDMETHODCALLTYPE *GetPageIndex)(ITfCandidateListUIElement *, UINT *, UINT, UINT *);
-    HRESULT (STDMETHODCALLTYPE *SetPageIndex)(ITfCandidateListUIElement *, UINT *, UINT);
-    HRESULT (STDMETHODCALLTYPE *GetCurrentPage)(ITfCandidateListUIElement *, UINT *);
-} ITfCandidateListUIElementVtbl;
-
-struct ITfCandidateListUIElement
-{
-    const struct ITfCandidateListUIElementVtbl *lpVtbl;
-};
-
-typedef struct ITfReadingInformationUIElementVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfReadingInformationUIElement *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfReadingInformationUIElement *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfReadingInformationUIElement *);
-    HRESULT (STDMETHODCALLTYPE *GetDescription)(ITfReadingInformationUIElement *, BSTR *);
-    HRESULT (STDMETHODCALLTYPE *GetGUID)(ITfReadingInformationUIElement *, GUID *);
-    HRESULT (STDMETHODCALLTYPE *Show)(ITfReadingInformationUIElement *, BOOL);
-    HRESULT (STDMETHODCALLTYPE *IsShown)(ITfReadingInformationUIElement *, BOOL *);
-    HRESULT (STDMETHODCALLTYPE *GetUpdatedFlags)(ITfReadingInformationUIElement *, DWORD *);
-    HRESULT (STDMETHODCALLTYPE *GetContext)(ITfReadingInformationUIElement *, ITfContext **);
-    HRESULT (STDMETHODCALLTYPE *GetString)(ITfReadingInformationUIElement *, BSTR *);
-    HRESULT (STDMETHODCALLTYPE *GetMaxReadingStringLength)(ITfReadingInformationUIElement *, UINT *);
-    HRESULT (STDMETHODCALLTYPE *GetErrorIndex)(ITfReadingInformationUIElement *, UINT *);
-    HRESULT (STDMETHODCALLTYPE *IsVerticalOrderPreferred)(ITfReadingInformationUIElement *, BOOL *);
-} ITfReadingInformationUIElementVtbl;
-
-struct ITfReadingInformationUIElement
-{
-    const struct ITfReadingInformationUIElementVtbl *lpVtbl;
-};
-
-typedef struct ITfUIElementVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfUIElement *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfUIElement *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfUIElement *);
-    HRESULT (STDMETHODCALLTYPE *GetDescription)(ITfUIElement *, BSTR *);
-    HRESULT (STDMETHODCALLTYPE *GetGUID)(ITfUIElement *, GUID *);
-    HRESULT (STDMETHODCALLTYPE *Show)(ITfUIElement *, BOOL);
-    HRESULT (STDMETHODCALLTYPE *IsShown)(ITfUIElement *, BOOL *);
-} ITfUIElementVtbl;
-
-struct ITfUIElement
-{
-    const struct ITfUIElementVtbl *lpVtbl;
-};
-
-typedef struct ITfInputProcessorProfileActivationSinkVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfInputProcessorProfileActivationSink *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfInputProcessorProfileActivationSink *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfInputProcessorProfileActivationSink *);
-    HRESULT (STDMETHODCALLTYPE *OnActivated)(ITfInputProcessorProfileActivationSink *, DWORD, LANGID, REFCLSID, REFGUID, REFGUID, HKL, DWORD);
-
-} ITfInputProcessorProfileActivationSinkVtbl;
-
-struct ITfInputProcessorProfileActivationSink
-{
-    const struct ITfInputProcessorProfileActivationSinkVtbl *lpVtbl;
-};
-
-typedef struct ITfSourceVtbl
-{
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(ITfSource *, REFIID, void **);
-    ULONG (STDMETHODCALLTYPE *AddRef)(ITfSource *);
-    ULONG (STDMETHODCALLTYPE *Release)(ITfSource *);
-    HRESULT (STDMETHODCALLTYPE *AdviseSink)(ITfSource *, REFIID, IUnknown *, DWORD *);
-    HRESULT (STDMETHODCALLTYPE *UnadviseSink)(ITfSource *, DWORD);
-} ITfSourceVtbl;
-
-struct ITfSource
-{
-    const struct ITfSourceVtbl *lpVtbl;
-};
-
-#endif /* _SDL_msctf_h */
diff --git a/deps/SDL2/src/video/windows/SDL_vkeys.h b/deps/SDL2/src/video/windows/SDL_vkeys.h
deleted file mode 100644
index ca24e8f..0000000
--- a/deps/SDL2/src/video/windows/SDL_vkeys.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef VK_0
-#define VK_0    '0'
-#define VK_1    '1'
-#define VK_2    '2'
-#define VK_3    '3'
-#define VK_4    '4'
-#define VK_5    '5'
-#define VK_6    '6'
-#define VK_7    '7'
-#define VK_8    '8'
-#define VK_9    '9'
-#define VK_A    'A'
-#define VK_B    'B'
-#define VK_C    'C'
-#define VK_D    'D'
-#define VK_E    'E'
-#define VK_F    'F'
-#define VK_G    'G'
-#define VK_H    'H'
-#define VK_I    'I'
-#define VK_J    'J'
-#define VK_K    'K'
-#define VK_L    'L'
-#define VK_M    'M'
-#define VK_N    'N'
-#define VK_O    'O'
-#define VK_P    'P'
-#define VK_Q    'Q'
-#define VK_R    'R'
-#define VK_S    'S'
-#define VK_T    'T'
-#define VK_U    'U'
-#define VK_V    'V'
-#define VK_W    'W'
-#define VK_X    'X'
-#define VK_Y    'Y'
-#define VK_Z    'Z'
-#endif /* VK_0 */
-
-/* These keys haven't been defined, but were experimentally determined */
-#define VK_SEMICOLON    0xBA
-#define VK_EQUALS       0xBB
-#define VK_COMMA        0xBC
-#define VK_MINUS        0xBD
-#define VK_PERIOD       0xBE
-#define VK_SLASH        0xBF
-#define VK_GRAVE        0xC0
-#define VK_LBRACKET     0xDB
-#define VK_BACKSLASH    0xDC
-#define VK_RBRACKET     0xDD
-#define VK_APOSTROPHE   0xDE
-#define VK_BACKTICK     0xDF
-#define VK_OEM_102      0xE2
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsclipboard.c b/deps/SDL2/src/video/windows/SDL_windowsclipboard.c
deleted file mode 100644
index 15eea1a..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsclipboard.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "SDL_windowsvideo.h"
-#include "SDL_windowswindow.h"
-#include "../../events/SDL_clipboardevents_c.h"
-
-
-#ifdef UNICODE
-#define TEXT_FORMAT  CF_UNICODETEXT
-#else
-#define TEXT_FORMAT  CF_TEXT
-#endif
-
-
-/* Get any application owned window handle for clipboard association */
-static HWND
-GetWindowHandle(_THIS)
-{
-    SDL_Window *window;
-
-    window = _this->windows;
-    if (window) {
-        return ((SDL_WindowData *) window->driverdata)->hwnd;
-    }
-    return NULL;
-}
-
-int
-WIN_SetClipboardText(_THIS, const char *text)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    int result = 0;
-
-    if (OpenClipboard(GetWindowHandle(_this))) {
-        HANDLE hMem;
-        LPTSTR tstr;
-        SIZE_T i, size;
-
-        /* Convert the text from UTF-8 to Windows Unicode */
-        tstr = WIN_UTF8ToString(text);
-        if (!tstr) {
-            return -1;
-        }
-
-        /* Find out the size of the data */
-        for (size = 0, i = 0; tstr[i]; ++i, ++size) {
-            if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) {
-                /* We're going to insert a carriage return */
-                ++size;
-            }
-        }
-        size = (size+1)*sizeof(*tstr);
-
-        /* Save the data to the clipboard */
-        hMem = GlobalAlloc(GMEM_MOVEABLE, size);
-        if (hMem) {
-            LPTSTR dst = (LPTSTR)GlobalLock(hMem);
-            if (dst) {
-                /* Copy the text over, adding carriage returns as necessary */
-                for (i = 0; tstr[i]; ++i) {
-                    if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) {
-                        *dst++ = '\r';
-                    }
-                    *dst++ = tstr[i];
-                }
-                *dst = 0;
-                GlobalUnlock(hMem);
-            }
-
-            EmptyClipboard();
-            if (!SetClipboardData(TEXT_FORMAT, hMem)) {
-                result = WIN_SetError("Couldn't set clipboard data");
-            }
-            data->clipboard_count = GetClipboardSequenceNumber();
-        }
-        SDL_free(tstr);
-
-        CloseClipboard();
-    } else {
-        result = WIN_SetError("Couldn't open clipboard");
-    }
-    return result;
-}
-
-char *
-WIN_GetClipboardText(_THIS)
-{
-    char *text;
-
-    text = NULL;
-    if (IsClipboardFormatAvailable(TEXT_FORMAT) &&
-        OpenClipboard(GetWindowHandle(_this))) {
-        HANDLE hMem;
-        LPTSTR tstr;
-
-        hMem = GetClipboardData(TEXT_FORMAT);
-        if (hMem) {
-            tstr = (LPTSTR)GlobalLock(hMem);
-            text = WIN_StringToUTF8(tstr);
-            GlobalUnlock(hMem);
-        } else {
-            WIN_SetError("Couldn't get clipboard data");
-        }
-        CloseClipboard();
-    }
-    if (!text) {
-        text = SDL_strdup("");
-    }
-    return text;
-}
-
-SDL_bool
-WIN_HasClipboardText(_THIS)
-{
-    SDL_bool result = SDL_FALSE;
-    char *text = WIN_GetClipboardText(_this);
-    if (text) {
-        result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
-        SDL_free(text);
-    }
-    return result;
-}
-
-void
-WIN_CheckClipboardUpdate(struct SDL_VideoData * data)
-{
-    const DWORD count = GetClipboardSequenceNumber();
-    if (count != data->clipboard_count) {
-        if (data->clipboard_count) {
-            SDL_SendClipboardUpdate();
-        }
-        data->clipboard_count = count;
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsclipboard.h b/deps/SDL2/src/video/windows/SDL_windowsclipboard.h
deleted file mode 100644
index 410e757..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsclipboard.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_windowsclipboard_h
-#define _SDL_windowsclipboard_h
-
-/* Forward declaration */
-struct SDL_VideoData;
-
-extern int WIN_SetClipboardText(_THIS, const char *text);
-extern char *WIN_GetClipboardText(_THIS);
-extern SDL_bool WIN_HasClipboardText(_THIS);
-extern void WIN_CheckClipboardUpdate(struct SDL_VideoData * data);
-
-#endif /* _SDL_windowsclipboard_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsevents.c b/deps/SDL2/src/video/windows/SDL_windowsevents.c
deleted file mode 100644
index 1826258..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsevents.c
+++ /dev/null
@@ -1,909 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "SDL_windowsvideo.h"
-#include "SDL_windowsshape.h"
-#include "SDL_syswm.h"
-#include "SDL_vkeys.h"
-#include "../../events/SDL_events_c.h"
-#include "../../events/SDL_touch_c.h"
-#include "../../events/scancodes_windows.h"
-
-/* Dropfile support */
-#include <shellapi.h>
-
-/* For GET_X_LPARAM, GET_Y_LPARAM. */
-#include <windowsx.h>
-
-/* #define WMMSG_DEBUG */
-#ifdef WMMSG_DEBUG
-#include <stdio.h>
-#include "wmmsg.h"
-#endif
-
-/* Masks for processing the windows KEYDOWN and KEYUP messages */
-#define REPEATED_KEYMASK    (1<<30)
-#define EXTENDED_KEYMASK    (1<<24)
-
-#define VK_ENTER    10          /* Keypad Enter ... no VKEY defined? */
-#ifndef VK_OEM_NEC_EQUAL
-#define VK_OEM_NEC_EQUAL 0x92
-#endif
-
-/* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */
-#ifndef WM_XBUTTONDOWN
-#define WM_XBUTTONDOWN 0x020B
-#endif
-#ifndef WM_XBUTTONUP
-#define WM_XBUTTONUP 0x020C
-#endif
-#ifndef GET_XBUTTON_WPARAM
-#define GET_XBUTTON_WPARAM(w) (HIWORD(w))
-#endif
-#ifndef WM_INPUT
-#define WM_INPUT 0x00ff
-#endif
-#ifndef WM_TOUCH
-#define WM_TOUCH 0x0240
-#endif
-
-static SDL_Scancode
-WindowsScanCodeToSDLScanCode( LPARAM lParam, WPARAM wParam )
-{
-    SDL_Scancode code;
-    char bIsExtended;
-    int nScanCode = ( lParam >> 16 ) & 0xFF;
-
-    /* 0x45 here to work around both pause and numlock sharing the same scancode, so use the VK key to tell them apart */
-    if ( nScanCode == 0 || nScanCode == 0x45 )
-    {
-        switch( wParam )
-        {
-        case VK_CLEAR: return SDL_SCANCODE_CLEAR;
-        case VK_MODECHANGE: return SDL_SCANCODE_MODE;
-        case VK_SELECT: return SDL_SCANCODE_SELECT;
-        case VK_EXECUTE: return SDL_SCANCODE_EXECUTE;
-        case VK_HELP: return SDL_SCANCODE_HELP;
-        case VK_PAUSE: return SDL_SCANCODE_PAUSE;
-        case VK_NUMLOCK: return SDL_SCANCODE_NUMLOCKCLEAR;
-
-        case VK_F13: return SDL_SCANCODE_F13;
-        case VK_F14: return SDL_SCANCODE_F14;
-        case VK_F15: return SDL_SCANCODE_F15;
-        case VK_F16: return SDL_SCANCODE_F16;
-        case VK_F17: return SDL_SCANCODE_F17;
-        case VK_F18: return SDL_SCANCODE_F18;
-        case VK_F19: return SDL_SCANCODE_F19;
-        case VK_F20: return SDL_SCANCODE_F20;
-        case VK_F21: return SDL_SCANCODE_F21;
-        case VK_F22: return SDL_SCANCODE_F22;
-        case VK_F23: return SDL_SCANCODE_F23;
-        case VK_F24: return SDL_SCANCODE_F24;
-
-        case VK_OEM_NEC_EQUAL: return SDL_SCANCODE_KP_EQUALS;
-        case VK_BROWSER_BACK: return SDL_SCANCODE_AC_BACK;
-        case VK_BROWSER_FORWARD: return SDL_SCANCODE_AC_FORWARD;
-        case VK_BROWSER_REFRESH: return SDL_SCANCODE_AC_REFRESH;
-        case VK_BROWSER_STOP: return SDL_SCANCODE_AC_STOP;
-        case VK_BROWSER_SEARCH: return SDL_SCANCODE_AC_SEARCH;
-        case VK_BROWSER_FAVORITES: return SDL_SCANCODE_AC_BOOKMARKS;
-        case VK_BROWSER_HOME: return SDL_SCANCODE_AC_HOME;
-        case VK_VOLUME_MUTE: return SDL_SCANCODE_AUDIOMUTE;
-        case VK_VOLUME_DOWN: return SDL_SCANCODE_VOLUMEDOWN;
-        case VK_VOLUME_UP: return SDL_SCANCODE_VOLUMEUP;
-
-        case VK_MEDIA_NEXT_TRACK: return SDL_SCANCODE_AUDIONEXT;
-        case VK_MEDIA_PREV_TRACK: return SDL_SCANCODE_AUDIOPREV;
-        case VK_MEDIA_STOP: return SDL_SCANCODE_AUDIOSTOP;
-        case VK_MEDIA_PLAY_PAUSE: return SDL_SCANCODE_AUDIOPLAY;
-        case VK_LAUNCH_MAIL: return SDL_SCANCODE_MAIL;
-        case VK_LAUNCH_MEDIA_SELECT: return SDL_SCANCODE_MEDIASELECT;
-
-        case VK_OEM_102: return SDL_SCANCODE_NONUSBACKSLASH;
-
-        case VK_ATTN: return SDL_SCANCODE_SYSREQ;
-        case VK_CRSEL: return SDL_SCANCODE_CRSEL;
-        case VK_EXSEL: return SDL_SCANCODE_EXSEL;
-        case VK_OEM_CLEAR: return SDL_SCANCODE_CLEAR;
-
-        case VK_LAUNCH_APP1: return SDL_SCANCODE_APP1;
-        case VK_LAUNCH_APP2: return SDL_SCANCODE_APP2;
-
-        default: return SDL_SCANCODE_UNKNOWN;
-        }
-    }
-
-    if ( nScanCode > 127 )
-        return SDL_SCANCODE_UNKNOWN;
-
-    code = windows_scancode_table[nScanCode];
-
-    bIsExtended = ( lParam & ( 1 << 24 ) ) != 0;
-    if ( !bIsExtended )
-    {
-        switch ( code )
-        {
-        case SDL_SCANCODE_HOME:
-            return SDL_SCANCODE_KP_7;
-        case SDL_SCANCODE_UP:
-            return SDL_SCANCODE_KP_8;
-        case SDL_SCANCODE_PAGEUP:
-            return SDL_SCANCODE_KP_9;
-        case SDL_SCANCODE_LEFT:
-            return SDL_SCANCODE_KP_4;
-        case SDL_SCANCODE_RIGHT:
-            return SDL_SCANCODE_KP_6;
-        case SDL_SCANCODE_END:
-            return SDL_SCANCODE_KP_1;
-        case SDL_SCANCODE_DOWN:
-            return SDL_SCANCODE_KP_2;
-        case SDL_SCANCODE_PAGEDOWN:
-            return SDL_SCANCODE_KP_3;
-        case SDL_SCANCODE_INSERT:
-            return SDL_SCANCODE_KP_0;
-        case SDL_SCANCODE_DELETE:
-            return SDL_SCANCODE_KP_PERIOD;
-        case SDL_SCANCODE_PRINTSCREEN:
-            return SDL_SCANCODE_KP_MULTIPLY;
-        default:
-            break;
-        }
-    }
-    else
-    {
-        switch ( code )
-        {
-        case SDL_SCANCODE_RETURN:
-            return SDL_SCANCODE_KP_ENTER;
-        case SDL_SCANCODE_LALT:
-            return SDL_SCANCODE_RALT;
-        case SDL_SCANCODE_LCTRL:
-            return SDL_SCANCODE_RCTRL;
-        case SDL_SCANCODE_SLASH:
-            return SDL_SCANCODE_KP_DIVIDE;
-        case SDL_SCANCODE_CAPSLOCK:
-            return SDL_SCANCODE_KP_PLUS;
-        default:
-            break;
-        }
-    }
-
-    return code;
-}
-
-
-void
-WIN_CheckWParamMouseButton( SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button )
-{
-    if ( bwParamMousePressed && !bSDLMousePressed )
-    {
-        SDL_SendMouseButton(data->window, 0, SDL_PRESSED, button);
-    }
-    else if ( !bwParamMousePressed && bSDLMousePressed )
-    {
-        SDL_SendMouseButton(data->window, 0, SDL_RELEASED, button);
-    }
-}
-
-/*
-* Some windows systems fail to send a WM_LBUTTONDOWN sometimes, but each mouse move contains the current button state also
-*  so this funciton reconciles our view of the world with the current buttons reported by windows
-*/
-void
-WIN_CheckWParamMouseButtons( WPARAM wParam, SDL_WindowData *data )
-{
-    if ( wParam != data->mouse_button_flags )
-    {
-        Uint32 mouseFlags = SDL_GetMouseState( NULL, NULL );
-        WIN_CheckWParamMouseButton(  (wParam & MK_LBUTTON), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT );
-        WIN_CheckWParamMouseButton(  (wParam & MK_MBUTTON), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE );
-        WIN_CheckWParamMouseButton(  (wParam & MK_RBUTTON), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT );
-        WIN_CheckWParamMouseButton(  (wParam & MK_XBUTTON1), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 );
-        WIN_CheckWParamMouseButton(  (wParam & MK_XBUTTON2), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 );
-        data->mouse_button_flags = wParam;
-    }
-}
-
-
-void
-WIN_CheckRawMouseButtons( ULONG rawButtons, SDL_WindowData *data )
-{
-    if ( rawButtons != data->mouse_button_flags )
-    {
-        Uint32 mouseFlags = SDL_GetMouseState( NULL, NULL );
-        if ( (rawButtons & RI_MOUSE_BUTTON_1_DOWN) )
-            WIN_CheckWParamMouseButton(  (rawButtons & RI_MOUSE_BUTTON_1_DOWN), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT );
-        if ( (rawButtons & RI_MOUSE_BUTTON_1_UP) )
-            WIN_CheckWParamMouseButton(  !(rawButtons & RI_MOUSE_BUTTON_1_UP), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT );
-        if ( (rawButtons & RI_MOUSE_BUTTON_2_DOWN) )
-            WIN_CheckWParamMouseButton(  (rawButtons & RI_MOUSE_BUTTON_2_DOWN), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT );
-        if ( (rawButtons & RI_MOUSE_BUTTON_2_UP) )
-            WIN_CheckWParamMouseButton(  !(rawButtons & RI_MOUSE_BUTTON_2_UP), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT );
-        if ( (rawButtons & RI_MOUSE_BUTTON_3_DOWN) )
-            WIN_CheckWParamMouseButton(  (rawButtons & RI_MOUSE_BUTTON_3_DOWN), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE );
-        if ( (rawButtons & RI_MOUSE_BUTTON_3_UP) )
-            WIN_CheckWParamMouseButton(  !(rawButtons & RI_MOUSE_BUTTON_3_UP), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE );
-        if ( (rawButtons & RI_MOUSE_BUTTON_4_DOWN) )
-            WIN_CheckWParamMouseButton(  (rawButtons & RI_MOUSE_BUTTON_4_DOWN), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 );
-        if ( (rawButtons & RI_MOUSE_BUTTON_4_UP) )
-            WIN_CheckWParamMouseButton(  !(rawButtons & RI_MOUSE_BUTTON_4_UP), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 );
-        if ( (rawButtons & RI_MOUSE_BUTTON_5_DOWN) )
-            WIN_CheckWParamMouseButton(  (rawButtons & RI_MOUSE_BUTTON_5_DOWN), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 );
-        if ( (rawButtons & RI_MOUSE_BUTTON_5_UP) )
-            WIN_CheckWParamMouseButton(  !(rawButtons & RI_MOUSE_BUTTON_5_UP), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 );
-        data->mouse_button_flags = rawButtons;
-    }
-}
-
-SDL_FORCE_INLINE BOOL
-WIN_ConvertUTF32toUTF8(UINT32 codepoint, char * text)
-{
-    if (codepoint <= 0x7F) {
-        text[0] = (char) codepoint;
-        text[1] = '\0';
-    } else if (codepoint <= 0x7FF) {
-        text[0] = 0xC0 | (char) ((codepoint >> 6) & 0x1F);
-        text[1] = 0x80 | (char) (codepoint & 0x3F);
-        text[2] = '\0';
-    } else if (codepoint <= 0xFFFF) {
-        text[0] = 0xE0 | (char) ((codepoint >> 12) & 0x0F);
-        text[1] = 0x80 | (char) ((codepoint >> 6) & 0x3F);
-        text[2] = 0x80 | (char) (codepoint & 0x3F);
-        text[3] = '\0';
-    } else if (codepoint <= 0x10FFFF) {
-        text[0] = 0xF0 | (char) ((codepoint >> 18) & 0x0F);
-        text[1] = 0x80 | (char) ((codepoint >> 12) & 0x3F);
-        text[2] = 0x80 | (char) ((codepoint >> 6) & 0x3F);
-        text[3] = 0x80 | (char) (codepoint & 0x3F);
-        text[4] = '\0';
-    } else {
-        return SDL_FALSE;
-    }
-    return SDL_TRUE;
-}
-
-LRESULT CALLBACK
-WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
-    SDL_WindowData *data;
-    LRESULT returnCode = -1;
-
-    /* Send a SDL_SYSWMEVENT if the application wants them */
-    if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) {
-        SDL_SysWMmsg wmmsg;
-
-        SDL_VERSION(&wmmsg.version);
-        wmmsg.subsystem = SDL_SYSWM_WINDOWS;
-        wmmsg.msg.win.hwnd = hwnd;
-        wmmsg.msg.win.msg = msg;
-        wmmsg.msg.win.wParam = wParam;
-        wmmsg.msg.win.lParam = lParam;
-        SDL_SendSysWMEvent(&wmmsg);
-    }
-
-    /* Get the window data for the window */
-    data = (SDL_WindowData *) GetProp(hwnd, TEXT("SDL_WindowData"));
-    if (!data) {
-        return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam);
-    }
-
-#ifdef WMMSG_DEBUG
-	{
-		char message[1024];
-		if (msg > MAX_WMMSG) {
-			SDL_snprintf(message, sizeof(message), "Received windows message: %p UNKNOWN (%d) -- 0x%X, 0x%X\n", hwnd, msg, wParam, lParam);
-		} else {
-			SDL_snprintf(message, sizeof(message), "Received windows message: %p %s -- 0x%X, 0x%X\n", hwnd, wmtab[msg], wParam, lParam);
-		}
-		OutputDebugStringA(message);
-	}
-#endif /* WMMSG_DEBUG */
-
-    if (IME_HandleMessage(hwnd, msg, wParam, &lParam, data->videodata))
-        return 0;
-
-    switch (msg) {
-
-    case WM_SHOWWINDOW:
-        {
-            if (wParam) {
-                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
-            } else {
-                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
-            }
-        }
-        break;
-
-    case WM_ACTIVATE:
-        {
-            BOOL minimized;
-
-            minimized = HIWORD(wParam);
-            if (!minimized && (LOWORD(wParam) != WA_INACTIVE)) {
-                Uint32 mouseFlags;
-                SHORT keyState;
-
-                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
-                SDL_SendWindowEvent(data->window,
-                                    SDL_WINDOWEVENT_RESTORED, 0, 0);
-                if (IsZoomed(hwnd)) {
-                    SDL_SendWindowEvent(data->window,
-                                        SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
-                }
-                if (SDL_GetKeyboardFocus() != data->window) {
-                    SDL_SetKeyboardFocus(data->window);
-                }
-                /* mouse buttons may have changed state here, we need
-                to resync them, but we will get a WM_MOUSEMOVE right away which will fix
-                things up if in non raw mode also
-                */
-                mouseFlags = SDL_GetMouseState( NULL, NULL );
-
-                keyState = GetAsyncKeyState( VK_LBUTTON );
-                WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_LMASK), data, SDL_BUTTON_LEFT );
-                keyState = GetAsyncKeyState( VK_RBUTTON );
-                WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_RMASK), data, SDL_BUTTON_RIGHT );
-                keyState = GetAsyncKeyState( VK_MBUTTON );
-                WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_MMASK), data, SDL_BUTTON_MIDDLE );
-                keyState = GetAsyncKeyState( VK_XBUTTON1 );
-                WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_X1MASK), data, SDL_BUTTON_X1 );
-                keyState = GetAsyncKeyState( VK_XBUTTON2 );
-                WIN_CheckWParamMouseButton( ( keyState & 0x8000 ), (mouseFlags & SDL_BUTTON_X2MASK), data, SDL_BUTTON_X2 );
-                data->mouse_button_flags = 0;
-
-                if(SDL_GetMouse()->relative_mode) {
-                    LONG cx, cy;
-                    RECT rect;
-                    GetWindowRect(hwnd, &rect);
-
-                    cx = (rect.left + rect.right) / 2;
-                    cy = (rect.top + rect.bottom) / 2;
-
-                    /* Make an absurdly small clip rect */
-                    rect.left = cx-1;
-                    rect.right = cx+1;
-                    rect.top = cy-1;
-                    rect.bottom = cy+1;
-
-                    ClipCursor(&rect);
-                }
-
-                /*
-                 * FIXME: Update keyboard state
-                 */
-                WIN_CheckClipboardUpdate(data->videodata);
-            } else {
-                if (SDL_GetKeyboardFocus() == data->window) {
-                    SDL_SetKeyboardFocus(NULL);
-                }
-                if (minimized) {
-                    SDL_SendWindowEvent(data->window,
-                                        SDL_WINDOWEVENT_MINIMIZED, 0, 0);
-                }
-            }
-        }
-        returnCode = 0;
-        break;
-
-    case WM_MOUSEMOVE:
-        if( !SDL_GetMouse()->relative_mode )
-            SDL_SendMouseMotion(data->window, 0, 0, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
-        /* don't break here, fall through to check the wParam like the button presses */
-    case WM_LBUTTONUP:
-    case WM_RBUTTONUP:
-    case WM_MBUTTONUP:
-    case WM_XBUTTONUP:
-    case WM_LBUTTONDOWN:
-    case WM_RBUTTONDOWN:
-    case WM_MBUTTONDOWN:
-    case WM_XBUTTONDOWN:
-        if( !SDL_GetMouse()->relative_mode )
-            WIN_CheckWParamMouseButtons( wParam, data );
-        break;
-
-    case WM_INPUT:
-    {
-        HRAWINPUT hRawInput = (HRAWINPUT)lParam;
-        RAWINPUT inp;
-        UINT size = sizeof(inp);
-
-        if(!SDL_GetMouse()->relative_mode)
-            break;
-
-        GetRawInputData(hRawInput, RID_INPUT, &inp, &size, sizeof(RAWINPUTHEADER));
-
-        /* Mouse data */
-        if(inp.header.dwType == RIM_TYPEMOUSE)
-        {
-            RAWMOUSE* mouse = &inp.data.mouse;
-
-            if((mouse->usFlags & 0x01) == MOUSE_MOVE_RELATIVE)
-            {
-                SDL_SendMouseMotion(data->window, 0, 1, (int)mouse->lLastX, (int)mouse->lLastY);
-            }
-            else
-            {
-                /* synthesize relative moves from the abs position */
-                static SDL_Point initialMousePoint;
-                if ( initialMousePoint.x == 0 && initialMousePoint.y == 0 )
-                {
-                    initialMousePoint.x = mouse->lLastX;
-                    initialMousePoint.y = mouse->lLastY;
-                }
-
-                SDL_SendMouseMotion(data->window, 0, 1, (int)(mouse->lLastX-initialMousePoint.x), (int)(mouse->lLastY-initialMousePoint.y) );
-
-                initialMousePoint.x = mouse->lLastX;
-                initialMousePoint.y = mouse->lLastY;
-            }
-            WIN_CheckRawMouseButtons( mouse->usButtonFlags, data );
-        }
-        break;
-    }
-
-    case WM_MOUSEWHEEL:
-        {
-            static short s_AccumulatedMotion;
-
-            s_AccumulatedMotion += GET_WHEEL_DELTA_WPARAM(wParam);
-            if (s_AccumulatedMotion > 0) {
-                while (s_AccumulatedMotion >= WHEEL_DELTA) {
-                    SDL_SendMouseWheel(data->window, 0, 0, 1);
-                    s_AccumulatedMotion -= WHEEL_DELTA;
-                }
-            } else {
-                while (s_AccumulatedMotion <= -WHEEL_DELTA) {
-                    SDL_SendMouseWheel(data->window, 0, 0, -1);
-                    s_AccumulatedMotion += WHEEL_DELTA;
-                }
-            }
-            break;
-        }
-
-#ifdef WM_MOUSELEAVE
-    case WM_MOUSELEAVE:
-        if (SDL_GetMouseFocus() == data->window && !SDL_GetMouse()->relative_mode) {
-            POINT cursorPos;
-            GetCursorPos(&cursorPos);
-            ScreenToClient(hwnd, &cursorPos);
-            SDL_SendMouseMotion(data->window, 0, 0, cursorPos.x, cursorPos.y);
-            SDL_SetMouseFocus(NULL);
-        }
-        returnCode = 0;
-        break;
-#endif /* WM_MOUSELEAVE */
-
-    case WM_KEYDOWN:
-    case WM_SYSKEYDOWN:
-        {
-            SDL_Scancode code = WindowsScanCodeToSDLScanCode( lParam, wParam );
-            if ( code != SDL_SCANCODE_UNKNOWN ) {
-                SDL_SendKeyboardKey(SDL_PRESSED, code );
-            }
-        }
-        if (msg == WM_KEYDOWN) {
-            BYTE keyboardState[256];
-            char text[5];
-            UINT32 utf32 = 0;
-
-            GetKeyboardState(keyboardState);
-            if (ToUnicode(wParam, (lParam >> 16) & 0xff, keyboardState, (LPWSTR)&utf32, 1, 0) > 0) {
-                WORD repitition;
-                for (repitition = lParam & 0xffff; repitition > 0; repitition--) {
-                    WIN_ConvertUTF32toUTF8(utf32, text);
-                    SDL_SendKeyboardText(text);
-                }
-            }
-        }
-        returnCode = 0;
-        break;
-
-    case WM_SYSKEYUP:
-    case WM_KEYUP:
-        {
-            SDL_Scancode code = WindowsScanCodeToSDLScanCode( lParam, wParam );
-            if ( code != SDL_SCANCODE_UNKNOWN ) {
-                if (code == SDL_SCANCODE_PRINTSCREEN &&
-                    SDL_GetKeyboardState(NULL)[code] == SDL_RELEASED) {
-                    SDL_SendKeyboardKey(SDL_PRESSED, code);
-                }
-                SDL_SendKeyboardKey(SDL_RELEASED, code);
-            }
-        }
-        returnCode = 0;
-        break;
-
-    case WM_UNICHAR:
-        {
-            if (wParam == UNICODE_NOCHAR) {
-                returnCode = 1;
-                break;
-            }
-        }
-        /* no break */
-    case WM_CHAR:
-        {
-            char text[5];
-
-            WIN_ConvertUTF32toUTF8(wParam, text);
-            SDL_SendKeyboardText(text);
-        }
-        returnCode = 0;
-        break;
-
-#ifdef WM_INPUTLANGCHANGE
-    case WM_INPUTLANGCHANGE:
-        {
-            WIN_UpdateKeymap();
-        }
-        returnCode = 1;
-        break;
-#endif /* WM_INPUTLANGCHANGE */
-
-#ifdef WM_GETMINMAXINFO
-    case WM_GETMINMAXINFO:
-        {
-            MINMAXINFO *info;
-            RECT size;
-            int x, y;
-            int w, h;
-            int min_w, min_h;
-            int max_w, max_h;
-            int style;
-            BOOL menu;
-            BOOL constrain_max_size;
-
-            /* If we allow resizing, let the resize happen naturally */
-            if (SDL_IsShapedWindow(data->window))
-                Win32_ResizeWindowShape(data->window);
-
-            /* Get the current position of our window */
-            GetWindowRect(hwnd, &size);
-            x = size.left;
-            y = size.top;
-
-            /* Calculate current size of our window */
-            SDL_GetWindowSize(data->window, &w, &h);
-            SDL_GetWindowMinimumSize(data->window, &min_w, &min_h);
-            SDL_GetWindowMaximumSize(data->window, &max_w, &max_h);
-
-            /* Store in min_w and min_h difference between current size and minimal
-               size so we don't need to call AdjustWindowRectEx twice */
-            min_w -= w;
-            min_h -= h;
-            if (max_w && max_h) {
-                max_w -= w;
-                max_h -= h;
-                constrain_max_size = TRUE;
-            } else {
-                constrain_max_size = FALSE;
-            }
-
-            size.top = 0;
-            size.left = 0;
-            size.bottom = h;
-            size.right = w;
-
-            style = GetWindowLong(hwnd, GWL_STYLE);
-            /* DJM - according to the docs for GetMenu(), the
-               return value is undefined if hwnd is a child window.
-               Aparently it's too difficult for MS to check
-               inside their function, so I have to do it here.
-             */
-            menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
-            AdjustWindowRectEx(&size, style, menu, 0);
-            w = size.right - size.left;
-            h = size.bottom - size.top;
-
-            /* Fix our size to the current size */
-            info = (MINMAXINFO *) lParam;
-            if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE) {
-                info->ptMinTrackSize.x = w + min_w;
-                info->ptMinTrackSize.y = h + min_h;
-                if (constrain_max_size) {
-                    info->ptMaxTrackSize.x = w + max_w;
-                    info->ptMaxTrackSize.y = h + max_h;
-                }
-            } else {
-                info->ptMaxSize.x = w;
-                info->ptMaxSize.y = h;
-                info->ptMaxPosition.x = x;
-                info->ptMaxPosition.y = y;
-                info->ptMinTrackSize.x = w;
-                info->ptMinTrackSize.y = h;
-                info->ptMaxTrackSize.x = w;
-                info->ptMaxTrackSize.y = h;
-            }
-        }
-        returnCode = 0;
-        break;
-#endif /* WM_GETMINMAXINFO */
-
-    case WM_WINDOWPOSCHANGED:
-        {
-            RECT rect;
-            int x, y;
-            int w, h;
-            Uint32 window_flags;
-
-            if (!GetClientRect(hwnd, &rect) ||
-                (rect.right == rect.left && rect.bottom == rect.top)) {
-                break;
-            }
-            ClientToScreen(hwnd, (LPPOINT) & rect);
-            ClientToScreen(hwnd, (LPPOINT) & rect + 1);
-
-            window_flags = SDL_GetWindowFlags(data->window);
-            if ((window_flags & SDL_WINDOW_INPUT_GRABBED) &&
-                (window_flags & SDL_WINDOW_INPUT_FOCUS)) {
-                ClipCursor(&rect);
-            }
-
-            x = rect.left;
-            y = rect.top;
-            SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED, x, y);
-
-            w = rect.right - rect.left;
-            h = rect.bottom - rect.top;
-            SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED, w,
-                                h);
-        }
-        break;
-
-    case WM_SETCURSOR:
-        {
-            Uint16 hittest;
-
-            hittest = LOWORD(lParam);
-            if (hittest == HTCLIENT) {
-                SetCursor(SDL_cursor);
-                returnCode = TRUE;
-            }
-        }
-        break;
-
-        /* We were occluded, refresh our display */
-    case WM_PAINT:
-        {
-            RECT rect;
-            if (GetUpdateRect(hwnd, &rect, FALSE)) {
-                ValidateRect(hwnd, NULL);
-                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_EXPOSED,
-                                    0, 0);
-            }
-        }
-        returnCode = 0;
-        break;
-
-        /* We'll do our own drawing, prevent flicker */
-    case WM_ERASEBKGND:
-        {
-        }
-        return (1);
-
-#if defined(SC_SCREENSAVE) || defined(SC_MONITORPOWER)
-    case WM_SYSCOMMAND:
-        {
-            /* Don't start the screensaver or blank the monitor in fullscreen apps */
-            if ((wParam & 0xFFF0) == SC_SCREENSAVE ||
-                (wParam & 0xFFF0) == SC_MONITORPOWER) {
-                if (SDL_GetVideoDevice()->suspend_screensaver) {
-                    return (0);
-                }
-            }
-        }
-        break;
-#endif /* System has screensaver support */
-
-    case WM_CLOSE:
-        {
-            SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0);
-        }
-        returnCode = 0;
-        break;
-
-    case WM_TOUCH:
-        {
-            UINT i, num_inputs = LOWORD(wParam);
-            PTOUCHINPUT inputs = SDL_stack_alloc(TOUCHINPUT, num_inputs);
-            if (data->videodata->GetTouchInputInfo((HTOUCHINPUT)lParam, num_inputs, inputs, sizeof(TOUCHINPUT))) {
-                RECT rect;
-                float x, y;
-
-                if (!GetClientRect(hwnd, &rect) ||
-                    (rect.right == rect.left && rect.bottom == rect.top)) {
-                    if (inputs) {
-                        SDL_stack_free(inputs);
-                    }
-                    break;
-                }
-                ClientToScreen(hwnd, (LPPOINT) & rect);
-                ClientToScreen(hwnd, (LPPOINT) & rect + 1);
-                rect.top *= 100;
-                rect.left *= 100;
-                rect.bottom *= 100;
-                rect.right *= 100;
-
-                for (i = 0; i < num_inputs; ++i) {
-                    PTOUCHINPUT input = &inputs[i];
-
-                    const SDL_TouchID touchId = (SDL_TouchID)((size_t)input->hSource);
-                    if (!SDL_GetTouch(touchId)) {
-                        if (SDL_AddTouch(touchId, "") < 0) {
-                            continue;
-                        }
-                    }
-
-                    /* Get the normalized coordinates for the window */
-                    x = (float)(input->x - rect.left)/(rect.right - rect.left);
-                    y = (float)(input->y - rect.top)/(rect.bottom - rect.top);
-
-                    if (input->dwFlags & TOUCHEVENTF_DOWN) {
-                        SDL_SendTouch(touchId, input->dwID, SDL_TRUE, x, y, 1.0f);
-                    }
-                    if (input->dwFlags & TOUCHEVENTF_MOVE) {
-                        SDL_SendTouchMotion(touchId, input->dwID, x, y, 1.0f);
-                    }
-                    if (input->dwFlags & TOUCHEVENTF_UP) {
-                        SDL_SendTouch(touchId, input->dwID, SDL_FALSE, x, y, 1.0f);
-                    }
-                }
-            }
-            SDL_stack_free(inputs);
-
-            data->videodata->CloseTouchInputHandle((HTOUCHINPUT)lParam);
-            return 0;
-        }
-        break;
-
-    case WM_DROPFILES:
-        {
-            UINT i;
-            HDROP drop = (HDROP) wParam;
-            UINT count = DragQueryFile(drop, 0xFFFFFFFF, NULL, 0);
-            for (i = 0; i < count; ++i) {
-                UINT size = DragQueryFile(drop, i, NULL, 0) + 1;
-                LPTSTR buffer = SDL_stack_alloc(TCHAR, size);
-                if (buffer) {
-                    if (DragQueryFile(drop, i, buffer, size)) {
-                        char *file = WIN_StringToUTF8(buffer);
-                        SDL_SendDropFile(file);
-                        SDL_free(file);
-                    }
-                    SDL_stack_free(buffer);
-                }
-            }
-            DragFinish(drop);
-            return 0;
-        }
-        break;
-    }
-
-    /* If there's a window proc, assume it's going to handle messages */
-    if (data->wndproc) {
-        return CallWindowProc(data->wndproc, hwnd, msg, wParam, lParam);
-    } else if (returnCode >= 0) {
-        return returnCode;
-    } else {
-        return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam);
-    }
-}
-
-void
-WIN_PumpEvents(_THIS)
-{
-    const Uint8 *keystate;
-    MSG msg;
-    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
-        DispatchMessage(&msg);
-    }
-
-    /* Windows loses a shift KEYUP event when you have both pressed at once and let go of one.
-       You won't get a KEYUP until both are released, and that keyup will only be for the second
-       key you released. Take heroic measures and check the keystate as of the last handled event,
-       and if we think a key is pressed when Windows doesn't, unstick it in SDL's state. */
-    keystate = SDL_GetKeyboardState(NULL);
-    if ((keystate[SDL_SCANCODE_LSHIFT] == SDL_PRESSED) && !(GetKeyState(VK_LSHIFT) & 0x8000)) {
-        SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT);
-    }
-    if ((keystate[SDL_SCANCODE_RSHIFT] == SDL_PRESSED) && !(GetKeyState(VK_RSHIFT) & 0x8000)) {
-        SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RSHIFT);
-    }
-}
-
-static int app_registered = 0;
-LPTSTR SDL_Appname = NULL;
-Uint32 SDL_Appstyle = 0;
-HINSTANCE SDL_Instance = NULL;
-
-/* Register the class for this application */
-int
-SDL_RegisterApp(char *name, Uint32 style, void *hInst)
-{
-    WNDCLASS class;
-
-    /* Only do this once... */
-    if (app_registered) {
-        ++app_registered;
-        return (0);
-    }
-    if (!name && !SDL_Appname) {
-        name = "SDL_app";
-#if defined(CS_BYTEALIGNCLIENT) || defined(CS_OWNDC)
-        SDL_Appstyle = (CS_BYTEALIGNCLIENT | CS_OWNDC);
-#endif
-        SDL_Instance = hInst ? hInst : GetModuleHandle(NULL);
-    }
-
-    if (name) {
-        SDL_Appname = WIN_UTF8ToString(name);
-        SDL_Appstyle = style;
-        SDL_Instance = hInst ? hInst : GetModuleHandle(NULL);
-    }
-
-    /* Register the application class */
-    class.hCursor = NULL;
-    class.hIcon =
-        LoadImage(SDL_Instance, SDL_Appname, IMAGE_ICON, 0, 0,
-                  LR_DEFAULTCOLOR);
-    class.lpszMenuName = NULL;
-    class.lpszClassName = SDL_Appname;
-    class.hbrBackground = NULL;
-    class.hInstance = SDL_Instance;
-    class.style = SDL_Appstyle;
-    class.lpfnWndProc = WIN_WindowProc;
-    class.cbWndExtra = 0;
-    class.cbClsExtra = 0;
-    if (!RegisterClass(&class)) {
-        return SDL_SetError("Couldn't register application class");
-    }
-
-    app_registered = 1;
-    return 0;
-}
-
-/* Unregisters the windowclass registered in SDL_RegisterApp above. */
-void
-SDL_UnregisterApp()
-{
-    WNDCLASS class;
-
-    /* SDL_RegisterApp might not have been called before */
-    if (!app_registered) {
-        return;
-    }
-    --app_registered;
-    if (app_registered == 0) {
-        /* Check for any registered window classes. */
-        if (GetClassInfo(SDL_Instance, SDL_Appname, &class)) {
-            UnregisterClass(SDL_Appname, SDL_Instance);
-        }
-        SDL_free(SDL_Appname);
-        SDL_Appname = NULL;
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsevents.h b/deps/SDL2/src/video/windows/SDL_windowsevents.h
deleted file mode 100644
index 4fc146e..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsevents.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_windowsevents_h
-#define _SDL_windowsevents_h
-
-extern LPTSTR SDL_Appname;
-extern Uint32 SDL_Appstyle;
-extern HINSTANCE SDL_Instance;
-
-extern LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam,
-                                       LPARAM lParam);
-extern void WIN_PumpEvents(_THIS);
-
-#endif /* _SDL_windowsevents_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsframebuffer.c b/deps/SDL2/src/video/windows/SDL_windowsframebuffer.c
deleted file mode 100644
index 93af4c5..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsframebuffer.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "SDL_windowsvideo.h"
-
-int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    size_t size;
-    LPBITMAPINFO info;
-    HBITMAP hbm;
-
-    /* Free the old framebuffer surface */
-    if (data->mdc) {
-        DeleteDC(data->mdc);
-    }
-    if (data->hbm) {
-        DeleteObject(data->hbm);
-    }
-
-    /* Find out the format of the screen */
-    size = sizeof(BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD);
-    info = (LPBITMAPINFO)SDL_stack_alloc(Uint8, size);
-
-    SDL_memset(info, 0, size);
-    info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-
-    /* The second call to GetDIBits() fills in the bitfields */
-    hbm = CreateCompatibleBitmap(data->hdc, 1, 1);
-    GetDIBits(data->hdc, hbm, 0, 0, NULL, info, DIB_RGB_COLORS);
-    GetDIBits(data->hdc, hbm, 0, 0, NULL, info, DIB_RGB_COLORS);
-    DeleteObject(hbm);
-
-    *format = SDL_PIXELFORMAT_UNKNOWN;
-    if (info->bmiHeader.biCompression == BI_BITFIELDS) {
-        int bpp;
-        Uint32 *masks;
-
-        bpp = info->bmiHeader.biPlanes * info->bmiHeader.biBitCount;
-        masks = (Uint32*)((Uint8*)info + info->bmiHeader.biSize);
-        *format = SDL_MasksToPixelFormatEnum(bpp, masks[0], masks[1], masks[2], 0);
-    }
-    if (*format == SDL_PIXELFORMAT_UNKNOWN)
-    {
-        /* We'll use RGB format for now */
-        *format = SDL_PIXELFORMAT_RGB888;
-
-        /* Create a new one */
-        SDL_memset(info, 0, size);
-        info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-        info->bmiHeader.biPlanes = 1;
-        info->bmiHeader.biBitCount = 32;
-        info->bmiHeader.biCompression = BI_RGB;
-    }
-
-    /* Fill in the size information */
-    *pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3);
-    info->bmiHeader.biWidth = window->w;
-    info->bmiHeader.biHeight = -window->h;  /* negative for topdown bitmap */
-    info->bmiHeader.biSizeImage = window->h * (*pitch);
-
-    data->mdc = CreateCompatibleDC(data->hdc);
-    data->hbm = CreateDIBSection(data->hdc, info, DIB_RGB_COLORS, pixels, NULL, 0);
-    SDL_stack_free(info);
-
-    if (!data->hbm) {
-        return WIN_SetError("Unable to create DIB");
-    }
-    SelectObject(data->mdc, data->hbm);
-
-    return 0;
-}
-
-int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-
-    BitBlt(data->hdc, 0, 0, window->w, window->h, data->mdc, 0, 0, SRCCOPY);
-    return 0;
-}
-
-void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-
-    if (!data) {
-        /* The window wasn't fully initialized */
-        return;
-    }
-
-    if (data->mdc) {
-        DeleteDC(data->mdc);
-        data->mdc = NULL;
-    }
-    if (data->hbm) {
-        DeleteObject(data->hbm);
-        data->hbm = NULL;
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsframebuffer.h b/deps/SDL2/src/video/windows/SDL_windowsframebuffer.h
deleted file mode 100644
index 4d7a2ba..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsframebuffer.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-extern int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
-extern int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
-extern void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowskeyboard.c b/deps/SDL2/src/video/windows/SDL_windowskeyboard.c
deleted file mode 100644
index 17d4eed..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowskeyboard.c
+++ /dev/null
@@ -1,1524 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "SDL_windowsvideo.h"
-
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/scancodes_windows.h"
-
-#include <imm.h>
-#include <oleauto.h>
-
-#ifndef SDL_DISABLE_WINDOWS_IME
-static void IME_Init(SDL_VideoData *videodata, HWND hwnd);
-static void IME_Enable(SDL_VideoData *videodata, HWND hwnd);
-static void IME_Disable(SDL_VideoData *videodata, HWND hwnd);
-static void IME_Quit(SDL_VideoData *videodata);
-#endif /* !SDL_DISABLE_WINDOWS_IME */
-
-#ifndef MAPVK_VK_TO_VSC
-#define MAPVK_VK_TO_VSC     0
-#endif
-#ifndef MAPVK_VSC_TO_VK
-#define MAPVK_VSC_TO_VK     1
-#endif
-#ifndef MAPVK_VK_TO_CHAR
-#define MAPVK_VK_TO_CHAR    2
-#endif
-
-/* Alphabetic scancodes for PC keyboards */
-void
-WIN_InitKeyboard(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    data->ime_com_initialized = SDL_FALSE;
-    data->ime_threadmgr = 0;
-    data->ime_initialized = SDL_FALSE;
-    data->ime_enabled = SDL_FALSE;
-    data->ime_available = SDL_FALSE;
-    data->ime_hwnd_main = 0;
-    data->ime_hwnd_current = 0;
-    data->ime_himc = 0;
-    data->ime_composition[0] = 0;
-    data->ime_readingstring[0] = 0;
-    data->ime_cursor = 0;
-
-    data->ime_candlist = SDL_FALSE;
-    SDL_memset(data->ime_candidates, 0, sizeof(data->ime_candidates));
-    data->ime_candcount = 0;
-    data->ime_candref = 0;
-    data->ime_candsel = 0;
-    data->ime_candpgsize = 0;
-    data->ime_candlistindexbase = 0;
-    data->ime_candvertical = SDL_TRUE;
-
-    data->ime_dirty = SDL_FALSE;
-    SDL_memset(&data->ime_rect, 0, sizeof(data->ime_rect));
-    SDL_memset(&data->ime_candlistrect, 0, sizeof(data->ime_candlistrect));
-    data->ime_winwidth = 0;
-    data->ime_winheight = 0;
-
-    data->ime_hkl = 0;
-    data->ime_himm32 = 0;
-    data->GetReadingString = 0;
-    data->ShowReadingWindow = 0;
-    data->ImmLockIMC = 0;
-    data->ImmUnlockIMC = 0;
-    data->ImmLockIMCC = 0;
-    data->ImmUnlockIMCC = 0;
-    data->ime_uiless = SDL_FALSE;
-    data->ime_threadmgrex = 0;
-    data->ime_uielemsinkcookie = TF_INVALID_COOKIE;
-    data->ime_alpnsinkcookie = TF_INVALID_COOKIE;
-    data->ime_openmodesinkcookie = TF_INVALID_COOKIE;
-    data->ime_convmodesinkcookie = TF_INVALID_COOKIE;
-    data->ime_uielemsink = 0;
-    data->ime_ippasink = 0;
-
-    WIN_UpdateKeymap();
-
-    SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu");
-    SDL_SetScancodeName(SDL_SCANCODE_LGUI, "Left Windows");
-    SDL_SetScancodeName(SDL_SCANCODE_RGUI, "Right Windows");
-}
-
-void
-WIN_UpdateKeymap()
-{
-    int i;
-    SDL_Scancode scancode;
-    SDL_Keycode keymap[SDL_NUM_SCANCODES];
-
-    SDL_GetDefaultKeymap(keymap);
-
-    for (i = 0; i < SDL_arraysize(windows_scancode_table); i++) {
-        int vk;
-        /* Make sure this scancode is a valid character scancode */
-        scancode = windows_scancode_table[i];
-        if (scancode == SDL_SCANCODE_UNKNOWN ) {
-            continue;
-        }
-
-        /* If this key is one of the non-mappable keys, ignore it */
-        /* Don't allow the number keys right above the qwerty row to translate or the top left key (grave/backquote) */
-        /* Not mapping numbers fixes the French layout, giving numeric keycodes for the number keys, which is the expected behavior */
-        if ((keymap[scancode] & SDLK_SCANCODE_MASK) ||
-            scancode == SDL_SCANCODE_GRAVE ||
-            (scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0) ) {
-            continue;
-        }
-
-        vk =  MapVirtualKey(i, MAPVK_VSC_TO_VK);
-        if ( vk ) {
-            int ch = (MapVirtualKey( vk, MAPVK_VK_TO_CHAR ) & 0x7FFF);
-            if ( ch ) {
-                if ( ch >= 'A' && ch <= 'Z' ) {
-                    keymap[scancode] =  SDLK_a + ( ch - 'A' );
-                } else {
-                    keymap[scancode] = ch;
-                }
-            }
-        }
-    }
-
-    SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
-}
-
-void
-WIN_QuitKeyboard(_THIS)
-{
-#ifndef SDL_DISABLE_WINDOWS_IME
-    IME_Quit((SDL_VideoData *)_this->driverdata);
-#endif
-}
-
-void
-WIN_StartTextInput(_THIS)
-{
-#ifndef SDL_DISABLE_WINDOWS_IME
-    SDL_Window *window = SDL_GetKeyboardFocus();
-    if (window) {
-        HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-        SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
-        SDL_GetWindowSize(window, &videodata->ime_winwidth, &videodata->ime_winheight);
-        IME_Init(videodata, hwnd);
-        IME_Enable(videodata, hwnd);
-    }
-#endif /* !SDL_DISABLE_WINDOWS_IME */
-}
-
-void
-WIN_StopTextInput(_THIS)
-{
-#ifndef SDL_DISABLE_WINDOWS_IME
-    SDL_Window *window = SDL_GetKeyboardFocus();
-    if (window) {
-        HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-        SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
-        IME_Init(videodata, hwnd);
-        IME_Disable(videodata, hwnd);
-    }
-#endif /* !SDL_DISABLE_WINDOWS_IME */
-}
-
-void
-WIN_SetTextInputRect(_THIS, SDL_Rect *rect)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
-
-    if (!rect) {
-        SDL_InvalidParamError("rect");
-        return;
-    }
-
-    videodata->ime_rect = *rect;
-}
-
-#ifdef SDL_DISABLE_WINDOWS_IME
-
-
-SDL_bool
-IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata)
-{
-    return SDL_FALSE;
-}
-
-void IME_Present(SDL_VideoData *videodata)
-{
-}
-
-#else
-
-#ifdef __GNUC__
-#undef DEFINE_GUID
-#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) static const GUID n = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-DEFINE_GUID(IID_ITfInputProcessorProfileActivationSink,        0x71C6E74E,0x0F28,0x11D8,0xA8,0x2A,0x00,0x06,0x5B,0x84,0x43,0x5C);
-DEFINE_GUID(IID_ITfUIElementSink,                              0xEA1EA136,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C);
-DEFINE_GUID(GUID_TFCAT_TIP_KEYBOARD,                           0x34745C63,0xB2F0,0x4784,0x8B,0x67,0x5E,0x12,0xC8,0x70,0x1A,0x31);
-DEFINE_GUID(IID_ITfSource,                                     0x4EA48A35,0x60AE,0x446F,0x8F,0xD6,0xE6,0xA8,0xD8,0x24,0x59,0xF7);
-DEFINE_GUID(IID_ITfUIElementMgr,                               0xEA1EA135,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C);
-DEFINE_GUID(IID_ITfCandidateListUIElement,                     0xEA1EA138,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C);
-DEFINE_GUID(IID_ITfReadingInformationUIElement,                0xEA1EA139,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C);
-DEFINE_GUID(IID_ITfThreadMgr,                                  0xAA80E801,0x2021,0x11D2,0x93,0xE0,0x00,0x60,0xB0,0x67,0xB8,0x6E);
-DEFINE_GUID(CLSID_TF_ThreadMgr,                                0x529A9E6B,0x6587,0x4F23,0xAB,0x9E,0x9C,0x7D,0x68,0x3E,0x3C,0x50);
-DEFINE_GUID(IID_ITfThreadMgrEx,                                0x3E90ADE3,0x7594,0x4CB0,0xBB,0x58,0x69,0x62,0x8F,0x5F,0x45,0x8C);
-#endif
-
-#define LANG_CHT MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL)
-#define LANG_CHS MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED)
-
-#define MAKEIMEVERSION(major,minor) ((DWORD) (((BYTE)(major) << 24) | ((BYTE)(minor) << 16) ))
-#define IMEID_VER(id) ((id) & 0xffff0000)
-#define IMEID_LANG(id) ((id) & 0x0000ffff)
-
-#define CHT_HKL_DAYI            ((HKL)0xE0060404)
-#define CHT_HKL_NEW_PHONETIC    ((HKL)0xE0080404)
-#define CHT_HKL_NEW_CHANG_JIE   ((HKL)0xE0090404)
-#define CHT_HKL_NEW_QUICK       ((HKL)0xE00A0404)
-#define CHT_HKL_HK_CANTONESE    ((HKL)0xE00B0404)
-#define CHT_IMEFILENAME1        "TINTLGNT.IME"
-#define CHT_IMEFILENAME2        "CINTLGNT.IME"
-#define CHT_IMEFILENAME3        "MSTCIPHA.IME"
-#define IMEID_CHT_VER42         (LANG_CHT | MAKEIMEVERSION(4, 2))
-#define IMEID_CHT_VER43         (LANG_CHT | MAKEIMEVERSION(4, 3))
-#define IMEID_CHT_VER44         (LANG_CHT | MAKEIMEVERSION(4, 4))
-#define IMEID_CHT_VER50         (LANG_CHT | MAKEIMEVERSION(5, 0))
-#define IMEID_CHT_VER51         (LANG_CHT | MAKEIMEVERSION(5, 1))
-#define IMEID_CHT_VER52         (LANG_CHT | MAKEIMEVERSION(5, 2))
-#define IMEID_CHT_VER60         (LANG_CHT | MAKEIMEVERSION(6, 0))
-#define IMEID_CHT_VER_VISTA     (LANG_CHT | MAKEIMEVERSION(7, 0))
-
-#define CHS_HKL                 ((HKL)0xE00E0804)
-#define CHS_IMEFILENAME1        "PINTLGNT.IME"
-#define CHS_IMEFILENAME2        "MSSCIPYA.IME"
-#define IMEID_CHS_VER41         (LANG_CHS | MAKEIMEVERSION(4, 1))
-#define IMEID_CHS_VER42         (LANG_CHS | MAKEIMEVERSION(4, 2))
-#define IMEID_CHS_VER53         (LANG_CHS | MAKEIMEVERSION(5, 3))
-
-#define LANG() LOWORD((videodata->ime_hkl))
-#define PRIMLANG() ((WORD)PRIMARYLANGID(LANG()))
-#define SUBLANG() SUBLANGID(LANG())
-
-static void IME_UpdateInputLocale(SDL_VideoData *videodata);
-static void IME_ClearComposition(SDL_VideoData *videodata);
-static void IME_SetWindow(SDL_VideoData* videodata, HWND hwnd);
-static void IME_SetupAPI(SDL_VideoData *videodata);
-static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex);
-static void IME_SendEditingEvent(SDL_VideoData *videodata);
-static void IME_DestroyTextures(SDL_VideoData *videodata);
-
-#define SDL_IsEqualIID(riid1, riid2) SDL_IsEqualGUID(riid1, riid2)
-#define SDL_IsEqualGUID(rguid1, rguid2) (!SDL_memcmp(rguid1, rguid2, sizeof(GUID)))
-
-static SDL_bool UILess_SetupSinks(SDL_VideoData *videodata);
-static void UILess_ReleaseSinks(SDL_VideoData *videodata);
-static void UILess_EnableUIUpdates(SDL_VideoData *videodata);
-static void UILess_DisableUIUpdates(SDL_VideoData *videodata);
-
-static void
-IME_Init(SDL_VideoData *videodata, HWND hwnd)
-{
-    if (videodata->ime_initialized)
-        return;
-
-    videodata->ime_hwnd_main = hwnd;
-    if (SUCCEEDED(WIN_CoInitialize())) {
-        videodata->ime_com_initialized = SDL_TRUE;
-        CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, (LPVOID *)&videodata->ime_threadmgr);
-    }
-    videodata->ime_initialized = SDL_TRUE;
-    videodata->ime_himm32 = SDL_LoadObject("imm32.dll");
-    if (!videodata->ime_himm32) {
-        videodata->ime_available = SDL_FALSE;
-        return;
-    }
-    videodata->ImmLockIMC = (LPINPUTCONTEXT2 (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMC");
-    videodata->ImmUnlockIMC = (BOOL (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMC");
-    videodata->ImmLockIMCC = (LPVOID (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMCC");
-    videodata->ImmUnlockIMCC = (BOOL (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMCC");
-
-    IME_SetWindow(videodata, hwnd);
-    videodata->ime_himc = ImmGetContext(hwnd);
-    ImmReleaseContext(hwnd, videodata->ime_himc);
-    if (!videodata->ime_himc) {
-        videodata->ime_available = SDL_FALSE;
-        IME_Disable(videodata, hwnd);
-        return;
-    }
-    videodata->ime_available = SDL_TRUE;
-    IME_UpdateInputLocale(videodata);
-    IME_SetupAPI(videodata);
-    videodata->ime_uiless = UILess_SetupSinks(videodata);
-    IME_UpdateInputLocale(videodata);
-    IME_Disable(videodata, hwnd);
-}
-
-static void
-IME_Enable(SDL_VideoData *videodata, HWND hwnd)
-{
-    if (!videodata->ime_initialized || !videodata->ime_hwnd_current)
-        return;
-
-    if (!videodata->ime_available) {
-        IME_Disable(videodata, hwnd);
-        return;
-    }
-    if (videodata->ime_hwnd_current == videodata->ime_hwnd_main)
-        ImmAssociateContext(videodata->ime_hwnd_current, videodata->ime_himc);
-
-    videodata->ime_enabled = SDL_TRUE;
-    IME_UpdateInputLocale(videodata);
-    UILess_EnableUIUpdates(videodata);
-}
-
-static void
-IME_Disable(SDL_VideoData *videodata, HWND hwnd)
-{
-    if (!videodata->ime_initialized || !videodata->ime_hwnd_current)
-        return;
-
-    IME_ClearComposition(videodata);
-    if (videodata->ime_hwnd_current == videodata->ime_hwnd_main)
-        ImmAssociateContext(videodata->ime_hwnd_current, (HIMC)0);
-
-    videodata->ime_enabled = SDL_FALSE;
-    UILess_DisableUIUpdates(videodata);
-}
-
-static void
-IME_Quit(SDL_VideoData *videodata)
-{
-    if (!videodata->ime_initialized)
-        return;
-
-    UILess_ReleaseSinks(videodata);
-    if (videodata->ime_hwnd_main)
-        ImmAssociateContext(videodata->ime_hwnd_main, videodata->ime_himc);
-
-    videodata->ime_hwnd_main = 0;
-    videodata->ime_himc = 0;
-    if (videodata->ime_himm32) {
-        SDL_UnloadObject(videodata->ime_himm32);
-        videodata->ime_himm32 = 0;
-    }
-    if (videodata->ime_threadmgr) {
-        videodata->ime_threadmgr->lpVtbl->Release(videodata->ime_threadmgr);
-        videodata->ime_threadmgr = 0;
-    }
-    if (videodata->ime_com_initialized) {
-        WIN_CoUninitialize();
-        videodata->ime_com_initialized = SDL_FALSE;
-    }
-    IME_DestroyTextures(videodata);
-    videodata->ime_initialized = SDL_FALSE;
-}
-
-static void
-IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd)
-{
-    DWORD id = 0;
-    HIMC himc = 0;
-    WCHAR buffer[16];
-    WCHAR *s = buffer;
-    DWORD len = 0;
-    INT err = 0;
-    BOOL vertical = FALSE;
-    UINT maxuilen = 0;
-    static OSVERSIONINFOA osversion = {0};
-    if (videodata->ime_uiless)
-        return;
-
-    videodata->ime_readingstring[0] = 0;
-    if (!osversion.dwOSVersionInfoSize) {
-        osversion.dwOSVersionInfoSize = sizeof(osversion);
-        GetVersionExA(&osversion);
-    }
-    id = IME_GetId(videodata, 0);
-    if (!id)
-        return;
-
-    himc = ImmGetContext(hwnd);
-    if (!himc)
-        return;
-
-    if (videodata->GetReadingString) {
-        len = videodata->GetReadingString(himc, 0, 0, &err, &vertical, &maxuilen);
-        if (len) {
-            if (len > SDL_arraysize(buffer))
-                len = SDL_arraysize(buffer);
-
-            len = videodata->GetReadingString(himc, len, s, &err, &vertical, &maxuilen);
-        }
-        SDL_wcslcpy(videodata->ime_readingstring, s, len);
-    }
-    else {
-        LPINPUTCONTEXT2 lpimc = videodata->ImmLockIMC(himc);
-        LPBYTE p = 0;
-        s = 0;
-        switch (id)
-        {
-        case IMEID_CHT_VER42:
-        case IMEID_CHT_VER43:
-        case IMEID_CHT_VER44:
-            p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 24);
-            if (!p)
-                break;
-
-            len = *(DWORD *)(p + 7*4 + 32*4);
-            s = (WCHAR *)(p + 56);
-            break;
-        case IMEID_CHT_VER51:
-        case IMEID_CHT_VER52:
-        case IMEID_CHS_VER53:
-            p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 4);
-            if (!p)
-                break;
-
-            p = *(LPBYTE *)((LPBYTE)p + 1*4 + 5*4);
-            if (!p)
-                break;
-
-            len = *(DWORD *)(p + 1*4 + (16*2+2*4) + 5*4 + 16*2);
-            s = (WCHAR *)(p + 1*4 + (16*2+2*4) + 5*4);
-            break;
-        case IMEID_CHS_VER41:
-            {
-                int offset = (IME_GetId(videodata, 1) >= 0x00000002) ? 8 : 7;
-                p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + offset * 4);
-                if (!p)
-                    break;
-
-                len = *(DWORD *)(p + 7*4 + 16*2*4);
-                s = (WCHAR *)(p + 6*4 + 16*2*1);
-            }
-            break;
-        case IMEID_CHS_VER42:
-            if (osversion.dwPlatformId != VER_PLATFORM_WIN32_NT)
-                break;
-
-            p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 1*4 + 1*4 + 6*4);
-            if (!p)
-                break;
-
-            len = *(DWORD *)(p + 1*4 + (16*2+2*4) + 5*4 + 16*2);
-            s = (WCHAR *)(p + 1*4 + (16*2+2*4) + 5*4);
-            break;
-        }
-        if (s) {
-            size_t size = SDL_min((size_t)(len + 1), SDL_arraysize(videodata->ime_readingstring));
-            SDL_wcslcpy(videodata->ime_readingstring, s, size);
-        }
-
-        videodata->ImmUnlockIMCC(lpimc->hPrivate);
-        videodata->ImmUnlockIMC(himc);
-    }
-    ImmReleaseContext(hwnd, himc);
-    IME_SendEditingEvent(videodata);
-}
-
-static void
-IME_InputLangChanged(SDL_VideoData *videodata)
-{
-    UINT lang = PRIMLANG();
-    IME_UpdateInputLocale(videodata);
-    if (!videodata->ime_uiless)
-        videodata->ime_candlistindexbase = (videodata->ime_hkl == CHT_HKL_DAYI) ? 0 : 1;
-
-    IME_SetupAPI(videodata);
-    if (lang != PRIMLANG()) {
-        IME_ClearComposition(videodata);
-    }
-}
-
-static DWORD
-IME_GetId(SDL_VideoData *videodata, UINT uIndex)
-{
-    static HKL hklprev = 0;
-    static DWORD dwRet[2] = {0};
-    DWORD dwVerSize = 0;
-    DWORD dwVerHandle = 0;
-    LPVOID lpVerBuffer = 0;
-    LPVOID lpVerData = 0;
-    UINT cbVerData = 0;
-    char szTemp[256];
-    HKL hkl = 0;
-    DWORD dwLang = 0;
-    if (uIndex >= sizeof(dwRet) / sizeof(dwRet[0]))
-        return 0;
-
-    hkl = videodata->ime_hkl;
-    if (hklprev == hkl)
-        return dwRet[uIndex];
-
-    hklprev = hkl;
-    dwLang = ((DWORD_PTR)hkl & 0xffff);
-    if (videodata->ime_uiless && LANG() == LANG_CHT) {
-        dwRet[0] = IMEID_CHT_VER_VISTA;
-        dwRet[1] = 0;
-        return dwRet[0];
-    }
-    if (hkl != CHT_HKL_NEW_PHONETIC
-        && hkl != CHT_HKL_NEW_CHANG_JIE
-        && hkl != CHT_HKL_NEW_QUICK
-        && hkl != CHT_HKL_HK_CANTONESE
-        && hkl != CHS_HKL) {
-        dwRet[0] = dwRet[1] = 0;
-        return dwRet[uIndex];
-    }
-    if (ImmGetIMEFileNameA(hkl, szTemp, sizeof(szTemp) - 1) <= 0) {
-        dwRet[0] = dwRet[1] = 0;
-        return dwRet[uIndex];
-    }
-    if (!videodata->GetReadingString) {
-        #define LCID_INVARIANT MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)
-        if (CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME1, -1) != 2
-            && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME2, -1) != 2
-            && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME3, -1) != 2
-            && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHS_IMEFILENAME1, -1) != 2
-            && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHS_IMEFILENAME2, -1) != 2) {
-            dwRet[0] = dwRet[1] = 0;
-            return dwRet[uIndex];
-        }
-        #undef LCID_INVARIANT
-        dwVerSize = GetFileVersionInfoSizeA(szTemp, &dwVerHandle);
-        if (dwVerSize) {
-            lpVerBuffer = SDL_malloc(dwVerSize);
-            if (lpVerBuffer) {
-                if (GetFileVersionInfoA(szTemp, dwVerHandle, dwVerSize, lpVerBuffer)) {
-                    if (VerQueryValueA(lpVerBuffer, "\\", &lpVerData, &cbVerData)) {
-                        #define pVerFixedInfo   ((VS_FIXEDFILEINFO FAR*)lpVerData)
-                        DWORD dwVer = pVerFixedInfo->dwFileVersionMS;
-                        dwVer = (dwVer & 0x00ff0000) << 8 | (dwVer & 0x000000ff) << 16;
-                        if ((videodata->GetReadingString) ||
-                            ((dwLang == LANG_CHT) && (
-                            dwVer == MAKEIMEVERSION(4, 2) ||
-                            dwVer == MAKEIMEVERSION(4, 3) ||
-                            dwVer == MAKEIMEVERSION(4, 4) ||
-                            dwVer == MAKEIMEVERSION(5, 0) ||
-                            dwVer == MAKEIMEVERSION(5, 1) ||
-                            dwVer == MAKEIMEVERSION(5, 2) ||
-                            dwVer == MAKEIMEVERSION(6, 0)))
-                            ||
-                            ((dwLang == LANG_CHS) && (
-                            dwVer == MAKEIMEVERSION(4, 1) ||
-                            dwVer == MAKEIMEVERSION(4, 2) ||
-                            dwVer == MAKEIMEVERSION(5, 3)))) {
-                            dwRet[0] = dwVer | dwLang;
-                            dwRet[1] = pVerFixedInfo->dwFileVersionLS;
-                            SDL_free(lpVerBuffer);
-                            return dwRet[0];
-                        }
-                        #undef pVerFixedInfo
-                    }
-                }
-            }
-            SDL_free(lpVerBuffer);
-        }
-    }
-    dwRet[0] = dwRet[1] = 0;
-    return dwRet[uIndex];
-}
-
-static void
-IME_SetupAPI(SDL_VideoData *videodata)
-{
-    char ime_file[MAX_PATH + 1];
-    void* hime = 0;
-    HKL hkl = 0;
-    videodata->GetReadingString = 0;
-    videodata->ShowReadingWindow = 0;
-    if (videodata->ime_uiless)
-        return;
-
-    hkl = videodata->ime_hkl;
-    if (ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1) <= 0)
-        return;
-
-    hime = SDL_LoadObject(ime_file);
-    if (!hime)
-        return;
-
-    videodata->GetReadingString = (UINT (WINAPI *)(HIMC, UINT, LPWSTR, PINT, BOOL*, PUINT))
-        SDL_LoadFunction(hime, "GetReadingString");
-    videodata->ShowReadingWindow = (BOOL (WINAPI *)(HIMC, BOOL))
-        SDL_LoadFunction(hime, "ShowReadingWindow");
-
-    if (videodata->ShowReadingWindow) {
-        HIMC himc = ImmGetContext(videodata->ime_hwnd_current);
-        if (himc) {
-            videodata->ShowReadingWindow(himc, FALSE);
-            ImmReleaseContext(videodata->ime_hwnd_current, himc);
-        }
-    }
-}
-
-static void
-IME_SetWindow(SDL_VideoData* videodata, HWND hwnd)
-{
-    videodata->ime_hwnd_current = hwnd;
-    if (videodata->ime_threadmgr) {
-        struct ITfDocumentMgr *document_mgr = 0;
-        if (SUCCEEDED(videodata->ime_threadmgr->lpVtbl->AssociateFocus(videodata->ime_threadmgr, hwnd, NULL, &document_mgr))) {
-            if (document_mgr)
-                document_mgr->lpVtbl->Release(document_mgr);
-        }
-    }
-}
-
-static void
-IME_UpdateInputLocale(SDL_VideoData *videodata)
-{
-    static HKL hklprev = 0;
-    videodata->ime_hkl = GetKeyboardLayout(0);
-    if (hklprev == videodata->ime_hkl)
-        return;
-
-    hklprev = videodata->ime_hkl;
-    switch (PRIMLANG()) {
-    case LANG_CHINESE:
-        videodata->ime_candvertical = SDL_TRUE;
-        if (SUBLANG() == SUBLANG_CHINESE_SIMPLIFIED)
-            videodata->ime_candvertical = SDL_FALSE;
-
-        break;
-    case LANG_JAPANESE:
-        videodata->ime_candvertical = SDL_TRUE;
-        break;
-    case LANG_KOREAN:
-        videodata->ime_candvertical = SDL_FALSE;
-        break;
-    }
-}
-
-static void
-IME_ClearComposition(SDL_VideoData *videodata)
-{
-    HIMC himc = 0;
-    if (!videodata->ime_initialized)
-        return;
-
-    himc = ImmGetContext(videodata->ime_hwnd_current);
-    if (!himc)
-        return;
-
-    ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
-    if (videodata->ime_uiless)
-        ImmSetCompositionString(himc, SCS_SETSTR, TEXT(""), sizeof(TCHAR), TEXT(""), sizeof(TCHAR));
-
-    ImmNotifyIME(himc, NI_CLOSECANDIDATE, 0, 0);
-    ImmReleaseContext(videodata->ime_hwnd_current, himc);
-    SDL_SendEditingText("", 0, 0);
-}
-
-static void
-IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string)
-{
-    LONG length = ImmGetCompositionStringW(himc, string, videodata->ime_composition, sizeof(videodata->ime_composition) - sizeof(videodata->ime_composition[0]));
-    if (length < 0)
-        length = 0;
-
-    length /= sizeof(videodata->ime_composition[0]);
-    videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0));
-    if (videodata->ime_cursor < SDL_arraysize(videodata->ime_composition) && videodata->ime_composition[videodata->ime_cursor] == 0x3000) {
-        int i;
-        for (i = videodata->ime_cursor + 1; i < length; ++i)
-            videodata->ime_composition[i - 1] = videodata->ime_composition[i];
-
-        --length;
-    }
-    videodata->ime_composition[length] = 0;
-}
-
-static void
-IME_SendInputEvent(SDL_VideoData *videodata)
-{
-    char *s = 0;
-    s = WIN_StringToUTF8(videodata->ime_composition);
-    SDL_SendKeyboardText(s);
-    SDL_free(s);
-
-    videodata->ime_composition[0] = 0;
-    videodata->ime_readingstring[0] = 0;
-    videodata->ime_cursor = 0;
-}
-
-static void
-IME_SendEditingEvent(SDL_VideoData *videodata)
-{
-    char *s = 0;
-    WCHAR buffer[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
-    const size_t size = SDL_arraysize(buffer);
-    buffer[0] = 0;
-    if (videodata->ime_readingstring[0]) {
-        size_t len = SDL_min(SDL_wcslen(videodata->ime_composition), (size_t)videodata->ime_cursor);
-        SDL_wcslcpy(buffer, videodata->ime_composition, len + 1);
-        SDL_wcslcat(buffer, videodata->ime_readingstring, size);
-        SDL_wcslcat(buffer, &videodata->ime_composition[len], size);
-    }
-    else {
-        SDL_wcslcpy(buffer, videodata->ime_composition, size);
-    }
-    s = WIN_StringToUTF8(buffer);
-    SDL_SendEditingText(s, videodata->ime_cursor + SDL_wcslen(videodata->ime_readingstring), 0);
-    SDL_free(s);
-}
-
-static void
-IME_AddCandidate(SDL_VideoData *videodata, UINT i, LPCWSTR candidate)
-{
-    LPWSTR dst = videodata->ime_candidates[i];
-    *dst++ = (WCHAR)(TEXT('0') + ((i + videodata->ime_candlistindexbase) % 10));
-    if (videodata->ime_candvertical)
-        *dst++ = TEXT(' ');
-
-    while (*candidate && (SDL_arraysize(videodata->ime_candidates[i]) > (dst - videodata->ime_candidates[i])))
-        *dst++ = *candidate++;
-
-    *dst = (WCHAR)'\0';
-}
-
-static void
-IME_GetCandidateList(HIMC himc, SDL_VideoData *videodata)
-{
-    LPCANDIDATELIST cand_list = 0;
-    DWORD size = ImmGetCandidateListW(himc, 0, 0, 0);
-    if (size) {
-        cand_list = (LPCANDIDATELIST)SDL_malloc(size);
-        if (cand_list) {
-            size = ImmGetCandidateListW(himc, 0, cand_list, size);
-            if (size) {
-                int i = 0;
-                int j = 0;
-                int page_start = 0;
-                videodata->ime_candsel = cand_list->dwSelection;
-                videodata->ime_candcount = cand_list->dwCount;
-
-                if (LANG() == LANG_CHS && IME_GetId(videodata, 0)) {
-                    const UINT maxcandchar = 18;
-                    UINT i = 0;
-                    size_t cchars = 0;
-
-                    for (; i < videodata->ime_candcount; ++i) {
-                        size_t len = SDL_wcslen((LPWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i])) + 1;
-                        if (len + cchars > maxcandchar) {
-                            if (i > cand_list->dwSelection)
-                                break;
-
-                            page_start = i;
-                            cchars = len;
-                        }
-                        else {
-                            cchars += len;
-                        }
-                    }
-                    videodata->ime_candpgsize = i - page_start;
-                }
-                else {
-                    videodata->ime_candpgsize = SDL_min(cand_list->dwPageSize, MAX_CANDLIST);
-                    page_start = (cand_list->dwSelection / videodata->ime_candpgsize) * videodata->ime_candpgsize;
-                }
-                SDL_memset(&videodata->ime_candidates, 0, sizeof(videodata->ime_candidates));
-                for (i = page_start, j = 0; (DWORD)i < cand_list->dwCount && j < (int)videodata->ime_candpgsize; i++, j++) {
-                    LPCWSTR candidate = (LPCWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i]);
-                    IME_AddCandidate(videodata, j, candidate);
-                }
-                if (PRIMLANG() == LANG_KOREAN || (PRIMLANG() == LANG_CHT && !IME_GetId(videodata, 0)))
-                    videodata->ime_candsel = -1;
-
-            }
-            SDL_free(cand_list);
-        }
-    }
-}
-
-static void
-IME_ShowCandidateList(SDL_VideoData *videodata)
-{
-    videodata->ime_dirty = SDL_TRUE;
-    videodata->ime_candlist = SDL_TRUE;
-    IME_DestroyTextures(videodata);
-    IME_SendEditingEvent(videodata);
-}
-
-static void
-IME_HideCandidateList(SDL_VideoData *videodata)
-{
-    videodata->ime_dirty = SDL_FALSE;
-    videodata->ime_candlist = SDL_FALSE;
-    IME_DestroyTextures(videodata);
-    IME_SendEditingEvent(videodata);
-}
-
-SDL_bool
-IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata)
-{
-    SDL_bool trap = SDL_FALSE;
-    HIMC himc = 0;
-    if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled)
-        return SDL_FALSE;
-
-    switch (msg) {
-    case WM_INPUTLANGCHANGE:
-        IME_InputLangChanged(videodata);
-        break;
-    case WM_IME_SETCONTEXT:
-        *lParam = 0;
-        break;
-    case WM_IME_STARTCOMPOSITION:
-        trap = SDL_TRUE;
-        break;
-    case WM_IME_COMPOSITION:
-        trap = SDL_TRUE;
-        himc = ImmGetContext(hwnd);
-        if (*lParam & GCS_RESULTSTR) {
-            IME_GetCompositionString(videodata, himc, GCS_RESULTSTR);
-            IME_SendInputEvent(videodata);
-        }
-        if (*lParam & GCS_COMPSTR) {
-            if (!videodata->ime_uiless)
-                videodata->ime_readingstring[0] = 0;
-
-            IME_GetCompositionString(videodata, himc, GCS_COMPSTR);
-            IME_SendEditingEvent(videodata);
-        }
-        ImmReleaseContext(hwnd, himc);
-        break;
-    case WM_IME_ENDCOMPOSITION:
-        videodata->ime_composition[0] = 0;
-        videodata->ime_readingstring[0] = 0;
-        videodata->ime_cursor = 0;
-        SDL_SendEditingText("", 0, 0);
-        break;
-    case WM_IME_NOTIFY:
-        switch (wParam) {
-        case IMN_SETCONVERSIONMODE:
-        case IMN_SETOPENSTATUS:
-            IME_UpdateInputLocale(videodata);
-            break;
-        case IMN_OPENCANDIDATE:
-        case IMN_CHANGECANDIDATE:
-            if (videodata->ime_uiless)
-                break;
-
-            trap = SDL_TRUE;
-            IME_ShowCandidateList(videodata);
-            himc = ImmGetContext(hwnd);
-            if (!himc)
-                break;
-
-            IME_GetCandidateList(himc, videodata);
-            ImmReleaseContext(hwnd, himc);
-            break;
-        case IMN_CLOSECANDIDATE:
-            trap = SDL_TRUE;
-            IME_HideCandidateList(videodata);
-            break;
-        case IMN_PRIVATE:
-            {
-                DWORD dwId = IME_GetId(videodata, 0);
-                IME_GetReadingString(videodata, hwnd);
-                switch (dwId)
-                {
-                case IMEID_CHT_VER42:
-                case IMEID_CHT_VER43:
-                case IMEID_CHT_VER44:
-                case IMEID_CHS_VER41:
-                case IMEID_CHS_VER42:
-                    if (*lParam == 1 || *lParam == 2)
-                        trap = SDL_TRUE;
-
-                    break;
-                case IMEID_CHT_VER50:
-                case IMEID_CHT_VER51:
-                case IMEID_CHT_VER52:
-                case IMEID_CHT_VER60:
-                case IMEID_CHS_VER53:
-                    if (*lParam == 16
-                        || *lParam == 17
-                        || *lParam == 26
-                        || *lParam == 27
-                        || *lParam == 28)
-                        trap = SDL_TRUE;
-                    break;
-                }
-            }
-            break;
-        default:
-            trap = SDL_TRUE;
-            break;
-        }
-        break;
-    }
-    return trap;
-}
-
-static void
-IME_CloseCandidateList(SDL_VideoData *videodata)
-{
-    IME_HideCandidateList(videodata);
-    videodata->ime_candcount = 0;
-    SDL_memset(videodata->ime_candidates, 0, sizeof(videodata->ime_candidates));
-}
-
-static void
-UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUIElement *pcandlist)
-{
-    UINT selection = 0;
-    UINT count = 0;
-    UINT page = 0;
-    UINT pgcount = 0;
-    DWORD pgstart = 0;
-    DWORD pgsize = 0;
-    UINT i, j;
-    pcandlist->lpVtbl->GetSelection(pcandlist, &selection);
-    pcandlist->lpVtbl->GetCount(pcandlist, &count);
-    pcandlist->lpVtbl->GetCurrentPage(pcandlist, &page);
-
-    videodata->ime_candsel = selection;
-    videodata->ime_candcount = count;
-    IME_ShowCandidateList(videodata);
-
-    pcandlist->lpVtbl->GetPageIndex(pcandlist, 0, 0, &pgcount);
-    if (pgcount > 0) {
-        UINT *idxlist = SDL_malloc(sizeof(UINT) * pgcount);
-        if (idxlist) {
-            pcandlist->lpVtbl->GetPageIndex(pcandlist, idxlist, pgcount, &pgcount);
-            pgstart = idxlist[page];
-            if (page < pgcount - 1)
-                pgsize = SDL_min(count, idxlist[page + 1]) - pgstart;
-            else
-                pgsize = count - pgstart;
-
-            SDL_free(idxlist);
-        }
-    }
-    videodata->ime_candpgsize = SDL_min(pgsize, MAX_CANDLIST);
-    videodata->ime_candsel = videodata->ime_candsel - pgstart;
-
-    SDL_memset(videodata->ime_candidates, 0, sizeof(videodata->ime_candidates));
-    for (i = pgstart, j = 0; (DWORD)i < count && j < videodata->ime_candpgsize; i++, j++) {
-        BSTR bstr;
-        if (SUCCEEDED(pcandlist->lpVtbl->GetString(pcandlist, i, &bstr))) {
-            if (bstr) {
-                IME_AddCandidate(videodata, j, bstr);
-                SysFreeString(bstr);
-            }
-        }
-    }
-    if (PRIMLANG() == LANG_KOREAN)
-        videodata->ime_candsel = -1;
-}
-
-STDMETHODIMP_(ULONG) TSFSink_AddRef(TSFSink *sink)
-{
-    return ++sink->refcount;
-}
-
-STDMETHODIMP_(ULONG)TSFSink_Release(TSFSink *sink)
-{
-    --sink->refcount;
-    if (sink->refcount == 0) {
-        SDL_free(sink);
-        return 0;
-    }
-    return sink->refcount;
-}
-
-STDMETHODIMP UIElementSink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv)
-{
-    if (!ppv)
-        return E_INVALIDARG;
-
-    *ppv = 0;
-    if (SDL_IsEqualIID(riid, &IID_IUnknown))
-        *ppv = (IUnknown *)sink;
-    else if (SDL_IsEqualIID(riid, &IID_ITfUIElementSink))
-        *ppv = (ITfUIElementSink *)sink;
-
-    if (*ppv) {
-        TSFSink_AddRef(sink);
-        return S_OK;
-    }
-    return E_NOINTERFACE;
-}
-
-ITfUIElement *UILess_GetUIElement(SDL_VideoData *videodata, DWORD dwUIElementId)
-{
-    ITfUIElementMgr *puiem = 0;
-    ITfUIElement *pelem = 0;
-    ITfThreadMgrEx *threadmgrex = videodata->ime_threadmgrex;
-
-    if (SUCCEEDED(threadmgrex->lpVtbl->QueryInterface(threadmgrex, &IID_ITfUIElementMgr, (LPVOID *)&puiem))) {
-        puiem->lpVtbl->GetUIElement(puiem, dwUIElementId, &pelem);
-        puiem->lpVtbl->Release(puiem);
-    }
-    return pelem;
-}
-
-STDMETHODIMP UIElementSink_BeginUIElement(TSFSink *sink, DWORD dwUIElementId, BOOL *pbShow)
-{
-    ITfUIElement *element = UILess_GetUIElement((SDL_VideoData *)sink->data, dwUIElementId);
-    ITfReadingInformationUIElement *preading = 0;
-    ITfCandidateListUIElement *pcandlist = 0;
-    SDL_VideoData *videodata = (SDL_VideoData *)sink->data;
-    if (!element)
-        return E_INVALIDARG;
-
-    *pbShow = FALSE;
-    if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) {
-        BSTR bstr;
-        if (SUCCEEDED(preading->lpVtbl->GetString(preading, &bstr)) && bstr) {
-            SysFreeString(bstr);
-        }
-        preading->lpVtbl->Release(preading);
-    }
-    else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) {
-        videodata->ime_candref++;
-        UILess_GetCandidateList(videodata, pcandlist);
-        pcandlist->lpVtbl->Release(pcandlist);
-    }
-    return S_OK;
-}
-
-STDMETHODIMP UIElementSink_UpdateUIElement(TSFSink *sink, DWORD dwUIElementId)
-{
-    ITfUIElement *element = UILess_GetUIElement((SDL_VideoData *)sink->data, dwUIElementId);
-    ITfReadingInformationUIElement *preading = 0;
-    ITfCandidateListUIElement *pcandlist = 0;
-    SDL_VideoData *videodata = (SDL_VideoData *)sink->data;
-    if (!element)
-        return E_INVALIDARG;
-
-    if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) {
-        BSTR bstr;
-        if (SUCCEEDED(preading->lpVtbl->GetString(preading, &bstr)) && bstr) {
-            WCHAR *s = (WCHAR *)bstr;
-            SDL_wcslcpy(videodata->ime_readingstring, s, SDL_arraysize(videodata->ime_readingstring));
-            IME_SendEditingEvent(videodata);
-            SysFreeString(bstr);
-        }
-        preading->lpVtbl->Release(preading);
-    }
-    else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) {
-        UILess_GetCandidateList(videodata, pcandlist);
-        pcandlist->lpVtbl->Release(pcandlist);
-    }
-    return S_OK;
-}
-
-STDMETHODIMP UIElementSink_EndUIElement(TSFSink *sink, DWORD dwUIElementId)
-{
-    ITfUIElement *element = UILess_GetUIElement((SDL_VideoData *)sink->data, dwUIElementId);
-    ITfReadingInformationUIElement *preading = 0;
-    ITfCandidateListUIElement *pcandlist = 0;
-    SDL_VideoData *videodata = (SDL_VideoData *)sink->data;
-    if (!element)
-        return E_INVALIDARG;
-
-    if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) {
-        videodata->ime_readingstring[0] = 0;
-        IME_SendEditingEvent(videodata);
-        preading->lpVtbl->Release(preading);
-    }
-    if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) {
-        videodata->ime_candref--;
-        if (videodata->ime_candref == 0)
-            IME_CloseCandidateList(videodata);
-
-        pcandlist->lpVtbl->Release(pcandlist);
-    }
-    return S_OK;
-}
-
-STDMETHODIMP IPPASink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv)
-{
-    if (!ppv)
-        return E_INVALIDARG;
-
-    *ppv = 0;
-    if (SDL_IsEqualIID(riid, &IID_IUnknown))
-        *ppv = (IUnknown *)sink;
-    else if (SDL_IsEqualIID(riid, &IID_ITfInputProcessorProfileActivationSink))
-        *ppv = (ITfInputProcessorProfileActivationSink *)sink;
-
-    if (*ppv) {
-        TSFSink_AddRef(sink);
-        return S_OK;
-    }
-    return E_NOINTERFACE;
-}
-
-STDMETHODIMP IPPASink_OnActivated(TSFSink *sink, DWORD dwProfileType, LANGID langid, REFCLSID clsid, REFGUID catid, REFGUID guidProfile, HKL hkl, DWORD dwFlags)
-{
-    static const GUID TF_PROFILE_DAYI = { 0x037B2C25, 0x480C, 0x4D7F, { 0xB0, 0x27, 0xD6, 0xCA, 0x6B, 0x69, 0x78, 0x8A } };
-    SDL_VideoData *videodata = (SDL_VideoData *)sink->data;
-    videodata->ime_candlistindexbase = SDL_IsEqualGUID(&TF_PROFILE_DAYI, guidProfile) ? 0 : 1;
-    if (SDL_IsEqualIID(catid, &GUID_TFCAT_TIP_KEYBOARD) && (dwFlags & TF_IPSINK_FLAG_ACTIVE))
-        IME_InputLangChanged((SDL_VideoData *)sink->data);
-
-    IME_HideCandidateList(videodata);
-    return S_OK;
-}
-
-static void *vtUIElementSink[] = {
-    (void *)(UIElementSink_QueryInterface),
-    (void *)(TSFSink_AddRef),
-    (void *)(TSFSink_Release),
-    (void *)(UIElementSink_BeginUIElement),
-    (void *)(UIElementSink_UpdateUIElement),
-    (void *)(UIElementSink_EndUIElement)
-};
-
-static void *vtIPPASink[] = {
-    (void *)(IPPASink_QueryInterface),
-    (void *)(TSFSink_AddRef),
-    (void *)(TSFSink_Release),
-    (void *)(IPPASink_OnActivated)
-};
-
-static void
-UILess_EnableUIUpdates(SDL_VideoData *videodata)
-{
-    ITfSource *source = 0;
-    if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie != TF_INVALID_COOKIE)
-        return;
-
-    if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) {
-        source->lpVtbl->AdviseSink(source, &IID_ITfUIElementSink, (IUnknown *)videodata->ime_uielemsink, &videodata->ime_uielemsinkcookie);
-        source->lpVtbl->Release(source);
-    }
-}
-
-static void
-UILess_DisableUIUpdates(SDL_VideoData *videodata)
-{
-    ITfSource *source = 0;
-    if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie == TF_INVALID_COOKIE)
-        return;
-
-    if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) {
-        source->lpVtbl->UnadviseSink(source, videodata->ime_uielemsinkcookie);
-        videodata->ime_uielemsinkcookie = TF_INVALID_COOKIE;
-        source->lpVtbl->Release(source);
-    }
-}
-
-static SDL_bool
-UILess_SetupSinks(SDL_VideoData *videodata)
-{
-    TfClientId clientid = 0;
-    SDL_bool result = SDL_FALSE;
-    ITfSource *source = 0;
-    if (FAILED(CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgrEx, (LPVOID *)&videodata->ime_threadmgrex)))
-        return SDL_FALSE;
-
-    if (FAILED(videodata->ime_threadmgrex->lpVtbl->ActivateEx(videodata->ime_threadmgrex, &clientid, TF_TMAE_UIELEMENTENABLEDONLY)))
-        return SDL_FALSE;
-
-    videodata->ime_uielemsink = SDL_malloc(sizeof(TSFSink));
-    videodata->ime_ippasink = SDL_malloc(sizeof(TSFSink));
-
-    videodata->ime_uielemsink->lpVtbl = vtUIElementSink;
-    videodata->ime_uielemsink->refcount = 1;
-    videodata->ime_uielemsink->data = videodata;
-
-    videodata->ime_ippasink->lpVtbl = vtIPPASink;
-    videodata->ime_ippasink->refcount = 1;
-    videodata->ime_ippasink->data = videodata;
-
-    if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) {
-        if (SUCCEEDED(source->lpVtbl->AdviseSink(source, &IID_ITfUIElementSink, (IUnknown *)videodata->ime_uielemsink, &videodata->ime_uielemsinkcookie))) {
-            if (SUCCEEDED(source->lpVtbl->AdviseSink(source, &IID_ITfInputProcessorProfileActivationSink, (IUnknown *)videodata->ime_ippasink, &videodata->ime_alpnsinkcookie))) {
-                result = SDL_TRUE;
-            }
-        }
-        source->lpVtbl->Release(source);
-    }
-    return result;
-}
-
-#define SAFE_RELEASE(p)                             \
-{                                                   \
-    if (p) {                                        \
-        (p)->lpVtbl->Release((p));                  \
-        (p) = 0;                                    \
-    }                                               \
-}
-
-static void
-UILess_ReleaseSinks(SDL_VideoData *videodata)
-{
-    ITfSource *source = 0;
-    if (videodata->ime_threadmgrex && SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) {
-        source->lpVtbl->UnadviseSink(source, videodata->ime_uielemsinkcookie);
-        source->lpVtbl->UnadviseSink(source, videodata->ime_alpnsinkcookie);
-        SAFE_RELEASE(source);
-        videodata->ime_threadmgrex->lpVtbl->Deactivate(videodata->ime_threadmgrex);
-        SAFE_RELEASE(videodata->ime_threadmgrex);
-        TSFSink_Release(videodata->ime_uielemsink);
-        videodata->ime_uielemsink = 0;
-        TSFSink_Release(videodata->ime_ippasink);
-        videodata->ime_ippasink = 0;
-    }
-}
-
-static void *
-StartDrawToBitmap(HDC hdc, HBITMAP *hhbm, int width, int height)
-{
-    BITMAPINFO info;
-    BITMAPINFOHEADER *infoHeader = &info.bmiHeader;
-    BYTE *bits = NULL;
-    if (hhbm) {
-        SDL_zero(info);
-        infoHeader->biSize = sizeof(BITMAPINFOHEADER);
-        infoHeader->biWidth = width;
-        infoHeader->biHeight = -1 * SDL_abs(height);
-        infoHeader->biPlanes = 1;
-        infoHeader->biBitCount = 32;
-        infoHeader->biCompression = BI_RGB;
-        *hhbm = CreateDIBSection(hdc, &info, DIB_RGB_COLORS, (void **)&bits, 0, 0);
-        if (*hhbm)
-            SelectObject(hdc, *hhbm);
-    }
-    return bits;
-}
-
-static void
-StopDrawToBitmap(HDC hdc, HBITMAP *hhbm)
-{
-    if (hhbm && *hhbm) {
-        DeleteObject(*hhbm);
-        *hhbm = NULL;
-    }
-}
-
-/* This draws only within the specified area and fills the entire region. */
-static void
-DrawRect(HDC hdc, int left, int top, int right, int bottom, int pensize)
-{
-    /* The case of no pen (PenSize = 0) is automatically taken care of. */
-    const int penadjust = (int)SDL_floor(pensize / 2.0f - 0.5f);
-    left += pensize / 2;
-    top += pensize / 2;
-    right -= penadjust;
-    bottom -= penadjust;
-    Rectangle(hdc, left, top, right, bottom);
-}
-
-static void
-IME_DestroyTextures(SDL_VideoData *videodata)
-{
-}
-
-#define SDL_swap(a,b) { \
-    int c = (a);        \
-    (a) = (b);          \
-    (b) = c;            \
-    }
-
-static void
-IME_PositionCandidateList(SDL_VideoData *videodata, SIZE size)
-{
-    int left, top, right, bottom;
-    SDL_bool ok = SDL_FALSE;
-    int winw = videodata->ime_winwidth;
-    int winh = videodata->ime_winheight;
-
-    /* Bottom */
-    left = videodata->ime_rect.x;
-    top = videodata->ime_rect.y + videodata->ime_rect.h;
-    right = left + size.cx;
-    bottom = top + size.cy;
-    if (right >= winw) {
-        left -= right - winw;
-        right = winw;
-    }
-    if (bottom < winh)
-        ok = SDL_TRUE;
-
-    /* Top */
-    if (!ok) {
-        left = videodata->ime_rect.x;
-        top = videodata->ime_rect.y - size.cy;
-        right = left + size.cx;
-        bottom = videodata->ime_rect.y;
-        if (right >= winw) {
-            left -= right - winw;
-            right = winw;
-        }
-        if (top >= 0)
-            ok = SDL_TRUE;
-    }
-
-    /* Right */
-    if (!ok) {
-        left = videodata->ime_rect.x + size.cx;
-        top = 0;
-        right = left + size.cx;
-        bottom = size.cy;
-        if (right < winw)
-            ok = SDL_TRUE;
-    }
-
-    /* Left */
-    if (!ok) {
-        left = videodata->ime_rect.x - size.cx;
-        top = 0;
-        right = videodata->ime_rect.x;
-        bottom = size.cy;
-        if (right >= 0)
-            ok = SDL_TRUE;
-    }
-
-    /* Window too small, show at (0,0) */
-    if (!ok) {
-        left = 0;
-        top = 0;
-        right = size.cx;
-        bottom = size.cy;
-    }
-
-    videodata->ime_candlistrect.x = left;
-    videodata->ime_candlistrect.y = top;
-    videodata->ime_candlistrect.w = right - left;
-    videodata->ime_candlistrect.h = bottom - top;
-}
-
-static void
-IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc)
-{
-    int i, j;
-    SIZE size = {0};
-    SIZE candsizes[MAX_CANDLIST];
-    SIZE maxcandsize = {0};
-    HBITMAP hbm = NULL;
-    const int candcount = SDL_min(SDL_min(MAX_CANDLIST, videodata->ime_candcount), videodata->ime_candpgsize);
-    SDL_bool vertical = videodata->ime_candvertical;
-
-    const int listborder = 1;
-    const int listpadding = 0;
-    const int listbordercolor = RGB(0xB4, 0xC7, 0xAA);
-    const int listfillcolor = RGB(255, 255, 255);
-
-    const int candborder = 1;
-    const int candpadding = 0;
-    const int candmargin = 1;
-    const COLORREF candbordercolor = RGB(255, 255, 255);
-    const COLORREF candfillcolor = RGB(255, 255, 255);
-    const COLORREF candtextcolor = RGB(0, 0, 0);
-    const COLORREF selbordercolor = RGB(0x84, 0xAC, 0xDD);
-    const COLORREF selfillcolor = RGB(0xD2, 0xE6, 0xFF);
-    const COLORREF seltextcolor = RGB(0, 0, 0);
-    const int horzcandspacing = 5;
-
-    HPEN listpen = listborder != 0 ? CreatePen(PS_SOLID, listborder, listbordercolor) : (HPEN)GetStockObject(NULL_PEN);
-    HBRUSH listbrush = CreateSolidBrush(listfillcolor);
-    HPEN candpen = candborder != 0 ? CreatePen(PS_SOLID, candborder, candbordercolor) : (HPEN)GetStockObject(NULL_PEN);
-    HBRUSH candbrush = CreateSolidBrush(candfillcolor);
-    HPEN selpen = candborder != 0 ? CreatePen(PS_DOT, candborder, selbordercolor) : (HPEN)GetStockObject(NULL_PEN);
-    HBRUSH selbrush = CreateSolidBrush(selfillcolor);
-    HFONT font = CreateFont((int)(1 + videodata->ime_rect.h * 0.75f), 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_CHARACTER_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, VARIABLE_PITCH | FF_SWISS, TEXT("Microsoft Sans Serif"));
-
-    SetBkMode(hdc, TRANSPARENT);
-    SelectObject(hdc, font);
-
-    for (i = 0; i < candcount; ++i) {
-        const WCHAR *s = videodata->ime_candidates[i];
-        if (!*s)
-            break;
-
-        GetTextExtentPoint32W(hdc, s, SDL_wcslen(s), &candsizes[i]);
-        maxcandsize.cx = SDL_max(maxcandsize.cx, candsizes[i].cx);
-        maxcandsize.cy = SDL_max(maxcandsize.cy, candsizes[i].cy);
-
-    }
-    if (vertical) {
-        size.cx =
-            (listborder * 2) +
-            (listpadding * 2) +
-            (candmargin * 2) +
-            (candborder * 2) +
-            (candpadding * 2) +
-            (maxcandsize.cx)
-            ;
-        size.cy =
-            (listborder * 2) +
-            (listpadding * 2) +
-            ((candcount + 1) * candmargin) +
-            (candcount * candborder * 2) +
-            (candcount * candpadding * 2) +
-            (candcount * maxcandsize.cy)
-            ;
-    }
-    else {
-        size.cx =
-            (listborder * 2) +
-            (listpadding * 2) +
-            ((candcount + 1) * candmargin) +
-            (candcount * candborder * 2) +
-            (candcount * candpadding * 2) +
-            ((candcount - 1) * horzcandspacing);
-        ;
-
-        for (i = 0; i < candcount; ++i)
-            size.cx += candsizes[i].cx;
-
-        size.cy =
-            (listborder * 2) +
-            (listpadding * 2) +
-            (candmargin * 2) +
-            (candborder * 2) +
-            (candpadding * 2) +
-            (maxcandsize.cy)
-            ;
-    }
-
-    StartDrawToBitmap(hdc, &hbm, size.cx, size.cy);
-
-    SelectObject(hdc, listpen);
-    SelectObject(hdc, listbrush);
-    DrawRect(hdc, 0, 0, size.cx, size.cy, listborder);
-
-    SelectObject(hdc, candpen);
-    SelectObject(hdc, candbrush);
-    SetTextColor(hdc, candtextcolor);
-    SetBkMode(hdc, TRANSPARENT);
-
-    for (i = 0; i < candcount; ++i) {
-        const WCHAR *s = videodata->ime_candidates[i];
-        int left, top, right, bottom;
-        if (!*s)
-            break;
-
-        if (vertical) {
-            left = listborder + listpadding + candmargin;
-            top = listborder + listpadding + (i * candborder * 2) + (i * candpadding * 2) + ((i + 1) * candmargin) + (i * maxcandsize.cy);
-            right = size.cx - listborder - listpadding - candmargin;
-            bottom = top + maxcandsize.cy + (candpadding * 2) + (candborder * 2);
-        }
-        else {
-            left = listborder + listpadding + (i * candborder * 2) + (i * candpadding * 2) + ((i + 1) * candmargin) + (i * horzcandspacing);
-
-            for (j = 0; j < i; ++j)
-                left += candsizes[j].cx;
-
-            top = listborder + listpadding + candmargin;
-            right = left + candsizes[i].cx + (candpadding * 2) + (candborder * 2);
-            bottom = size.cy - listborder - listpadding - candmargin;
-        }
-
-        if (i == videodata->ime_candsel) {
-            SelectObject(hdc, selpen);
-            SelectObject(hdc, selbrush);
-            SetTextColor(hdc, seltextcolor);
-        }
-        else {
-            SelectObject(hdc, candpen);
-            SelectObject(hdc, candbrush);
-            SetTextColor(hdc, candtextcolor);
-        }
-
-        DrawRect(hdc, left, top, right, bottom, candborder);
-        ExtTextOutW(hdc, left + candborder + candpadding, top + candborder + candpadding, 0, NULL, s, SDL_wcslen(s), NULL);
-    }
-    StopDrawToBitmap(hdc, &hbm);
-
-    DeleteObject(listpen);
-    DeleteObject(listbrush);
-    DeleteObject(candpen);
-    DeleteObject(candbrush);
-    DeleteObject(selpen);
-    DeleteObject(selbrush);
-    DeleteObject(font);
-
-    IME_PositionCandidateList(videodata, size);
-}
-
-static void
-IME_Render(SDL_VideoData *videodata)
-{
-    HDC hdc = CreateCompatibleDC(NULL);
-
-    if (videodata->ime_candlist)
-        IME_RenderCandidateList(videodata, hdc);
-
-    DeleteDC(hdc);
-
-    videodata->ime_dirty = SDL_FALSE;
-}
-
-void IME_Present(SDL_VideoData *videodata)
-{
-    if (videodata->ime_dirty)
-        IME_Render(videodata);
-
-    /* FIXME: Need to show the IME bitmap */
-}
-
-#endif /* SDL_DISABLE_WINDOWS_IME */
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowskeyboard.h b/deps/SDL2/src/video/windows/SDL_windowskeyboard.h
deleted file mode 100644
index c79d1d0..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowskeyboard.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_windowskeyboard_h
-#define _SDL_windowskeyboard_h
-
-extern void WIN_InitKeyboard(_THIS);
-extern void WIN_UpdateKeymap(void);
-extern void WIN_QuitKeyboard(_THIS);
-
-extern void WIN_StartTextInput(_THIS);
-extern void WIN_StopTextInput(_THIS);
-extern void WIN_SetTextInputRect(_THIS, SDL_Rect *rect);
-
-extern SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, struct SDL_VideoData *videodata);
-
-#endif /* _SDL_windowskeyboard_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsmessagebox.c b/deps/SDL2/src/video/windows/SDL_windowsmessagebox.c
deleted file mode 100644
index 06937ad..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsmessagebox.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_assert.h"
-#include "SDL_windowsvideo.h"
-
-
-#ifndef SS_EDITCONTROL
-#define SS_EDITCONTROL  0x2000
-#endif
-
-/* Display a Windows message box */
-
-#pragma pack(push, 1)
-
-typedef struct
-{
-    WORD dlgVer;
-    WORD signature;
-    DWORD helpID;
-    DWORD exStyle;
-    DWORD style;
-    WORD cDlgItems;
-    short x;
-    short y;
-    short cx;
-    short cy;
-} DLGTEMPLATEEX;
-
-typedef struct
-{
-    DWORD helpID;
-    DWORD exStyle;
-    DWORD style;
-    short x;
-    short y;
-    short cx;
-    short cy;
-    DWORD id;
-} DLGITEMTEMPLATEEX;
-
-#pragma pack(pop)
-
-typedef struct
-{
-    DLGTEMPLATEEX* lpDialog;
-    Uint8 *data;
-    size_t size;
-    size_t used;
-} WIN_DialogData;
-
-
-static INT_PTR MessageBoxDialogProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)
-{
-    switch ( iMessage ) {
-    case WM_COMMAND:
-        /* Return the ID of the button that was pushed */
-        EndDialog(hDlg, LOWORD(wParam));
-        return TRUE;
-
-    default:
-        break;
-    }
-    return FALSE;
-}
-
-static SDL_bool ExpandDialogSpace(WIN_DialogData *dialog, size_t space)
-{
-    size_t size = dialog->size;
-
-    if (size == 0) {
-        size = space;
-    } else {
-        while ((dialog->used + space) > size) {
-            size *= 2;
-        }
-    }
-    if (size > dialog->size) {
-        void *data = SDL_realloc(dialog->data, size);
-        if (!data) {
-            SDL_OutOfMemory();
-            return SDL_FALSE;
-        }
-        dialog->data = data;
-        dialog->size = size;
-        dialog->lpDialog = (DLGTEMPLATEEX*)dialog->data;
-    }
-    return SDL_TRUE;
-}
-
-static SDL_bool AlignDialogData(WIN_DialogData *dialog, size_t size)
-{
-    size_t padding = (dialog->used % size);
-
-    if (!ExpandDialogSpace(dialog, padding)) {
-        return SDL_FALSE;
-    }
-
-    dialog->used += padding;
-
-    return SDL_TRUE;
-}
-
-static SDL_bool AddDialogData(WIN_DialogData *dialog, const void *data, size_t size)
-{
-    if (!ExpandDialogSpace(dialog, size)) {
-        return SDL_FALSE;
-    }
-
-    SDL_memcpy(dialog->data+dialog->used, data, size);
-    dialog->used += size;
-
-    return SDL_TRUE;
-}
-
-static SDL_bool AddDialogString(WIN_DialogData *dialog, const char *string)
-{
-    WCHAR *wstring;
-    WCHAR *p;
-    size_t count;
-    SDL_bool status;
-
-    if (!string) {
-        string = "";
-    }
-
-    wstring = WIN_UTF8ToString(string);
-    if (!wstring) {
-        return SDL_FALSE;
-    }
-
-    /* Find out how many characters we have, including null terminator */
-    count = 0;
-    for (p = wstring; *p; ++p) {
-        ++count;
-    }
-    ++count;
-
-    status = AddDialogData(dialog, wstring, count*sizeof(WCHAR));
-    SDL_free(wstring);
-    return status;
-}
-
-static int s_BaseUnitsX;
-static int s_BaseUnitsY;
-static void Vec2ToDLU(short *x, short *y)
-{
-    SDL_assert(s_BaseUnitsX != 0); /* we init in WIN_ShowMessageBox(), which is the only public function... */
-
-    *x = MulDiv(*x, 4, s_BaseUnitsX);
-    *y = MulDiv(*y, 8, s_BaseUnitsY);
-}
-
-
-static SDL_bool AddDialogControl(WIN_DialogData *dialog, WORD type, DWORD style, DWORD exStyle, int x, int y, int w, int h, int id, const char *caption)
-{
-    DLGITEMTEMPLATEEX item;
-    WORD marker = 0xFFFF;
-    WORD extraData = 0;
-
-    SDL_zero(item);
-    item.style = style;
-    item.exStyle = exStyle;
-    item.x = x;
-    item.y = y;
-    item.cx = w;
-    item.cy = h;
-    item.id = id;
-
-    Vec2ToDLU(&item.x, &item.y);
-    Vec2ToDLU(&item.cx, &item.cy);
-
-    if (!AlignDialogData(dialog, sizeof(DWORD))) {
-        return SDL_FALSE;
-    }
-    if (!AddDialogData(dialog, &item, sizeof(item))) {
-        return SDL_FALSE;
-    }
-    if (!AddDialogData(dialog, &marker, sizeof(marker))) {
-        return SDL_FALSE;
-    }
-    if (!AddDialogData(dialog, &type, sizeof(type))) {
-        return SDL_FALSE;
-    }
-    if (!AddDialogString(dialog, caption)) {
-        return SDL_FALSE;
-    }
-    if (!AddDialogData(dialog, &extraData, sizeof(extraData))) {
-        return SDL_FALSE;
-    }
-    ++dialog->lpDialog->cDlgItems;
-
-    return SDL_TRUE;
-}
-
-static SDL_bool AddDialogStatic(WIN_DialogData *dialog, int x, int y, int w, int h, const char *text)
-{
-    DWORD style = WS_VISIBLE | WS_CHILD | SS_LEFT | SS_NOPREFIX | SS_EDITCONTROL;
-    return AddDialogControl(dialog, 0x0082, style, 0, x, y, w, h, -1, text);
-}
-
-static SDL_bool AddDialogButton(WIN_DialogData *dialog, int x, int y, int w, int h, const char *text, int id, SDL_bool isDefault)
-{
-    DWORD style = WS_VISIBLE | WS_CHILD;
-    if (isDefault) {
-        style |= BS_DEFPUSHBUTTON;
-    } else {
-        style |= BS_PUSHBUTTON;
-    }
-    return AddDialogControl(dialog, 0x0080, style, 0, x, y, w, h, id, text);
-}
-
-static void FreeDialogData(WIN_DialogData *dialog)
-{
-    SDL_free(dialog->data);
-    SDL_free(dialog);
-}
-
-static WIN_DialogData *CreateDialogData(int w, int h, const char *caption)
-{
-    WIN_DialogData *dialog;
-    DLGTEMPLATEEX dialogTemplate;
-    WORD WordToPass;
-
-    SDL_zero(dialogTemplate);
-    dialogTemplate.dlgVer = 1;
-    dialogTemplate.signature = 0xffff;
-    dialogTemplate.style = (WS_CAPTION | DS_CENTER | DS_SHELLFONT);
-    dialogTemplate.x = 0;
-    dialogTemplate.y = 0;
-    dialogTemplate.cx = w;
-    dialogTemplate.cy = h;
-    Vec2ToDLU(&dialogTemplate.cx, &dialogTemplate.cy);
-
-    dialog = (WIN_DialogData *)SDL_calloc(1, sizeof(*dialog));
-    if (!dialog) {
-        return NULL;
-    }
-
-    if (!AddDialogData(dialog, &dialogTemplate, sizeof(dialogTemplate))) {
-        FreeDialogData(dialog);
-        return NULL;
-    }
-
-    /* No menu */
-    WordToPass = 0;
-    if (!AddDialogData(dialog, &WordToPass, 2)) {
-        FreeDialogData(dialog);
-        return NULL;
-    }
-
-    /* No custom class */
-    if (!AddDialogData(dialog, &WordToPass, 2)) {
-        FreeDialogData(dialog);
-        return NULL;
-    }
-
-    /* title */
-    if (!AddDialogString(dialog, caption)) {
-        FreeDialogData(dialog);
-        return NULL;
-    }
-
-    /* Font stuff */
-    {
-        /*
-         * We want to use the system messagebox font.
-         */
-        BYTE ToPass;
-
-        NONCLIENTMETRICSA NCM;
-        NCM.cbSize = sizeof(NCM);
-        SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &NCM, 0);
-
-        /* Font size - convert to logical font size for dialog parameter. */
-        {
-            HDC ScreenDC = GetDC(0);
-            WordToPass = (WORD)(-72 * NCM.lfMessageFont.lfHeight / GetDeviceCaps(ScreenDC, LOGPIXELSY));
-            ReleaseDC(0, ScreenDC);
-        }
-
-        if (!AddDialogData(dialog, &WordToPass, 2)) {
-            FreeDialogData(dialog);
-            return NULL;
-        }
-
-        /* Font weight */
-        WordToPass = (WORD)NCM.lfMessageFont.lfWeight;
-        if (!AddDialogData(dialog, &WordToPass, 2)) {
-            FreeDialogData(dialog);
-            return NULL;
-        }
-
-        /* italic? */
-        ToPass = NCM.lfMessageFont.lfItalic;
-        if (!AddDialogData(dialog, &ToPass, 1)) {
-            FreeDialogData(dialog);
-            return NULL;
-        }
-
-        /* charset? */
-        ToPass = NCM.lfMessageFont.lfCharSet;
-        if (!AddDialogData(dialog, &ToPass, 1)) {
-            FreeDialogData(dialog);
-            return NULL;
-        }
-
-        /* font typeface. */
-        if (!AddDialogString(dialog, NCM.lfMessageFont.lfFaceName)) {
-            FreeDialogData(dialog);
-            return NULL;
-        }
-    }
-
-    return dialog;
-}
-
-int
-WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
-{
-    WIN_DialogData *dialog;
-    int i, x, y;
-    UINT_PTR which;
-    const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons;
-    HFONT DialogFont;
-    SIZE Size;
-    RECT TextSize;
-    wchar_t* wmessage;
-    TEXTMETRIC TM;
-
-
-    const int ButtonWidth = 88;
-    const int ButtonHeight = 26;
-    const int TextMargin = 16;
-    const int ButtonMargin = 12;
-
-
-    /* Jan 25th, 2013 - dant at fleetsa.com
-     *
-     *
-     * I've tried to make this more reasonable, but I've run in to a lot
-     * of nonsense.
-     *
-     * The original issue is the code was written in pixels and not
-     * dialog units (DLUs). All DialogBox functions use DLUs, which
-     * vary based on the selected font (yay).
-     *
-     * According to MSDN, the most reliable way to convert is via
-     * MapDialogUnits, which requires an HWND, which we don't have
-     * at time of template creation.
-     *
-     * We do however have:
-     *  The system font (DLU width 8 for me)
-     *  The font we select for the dialog (DLU width 6 for me)
-     *
-     * Based on experimentation, *neither* of these return the value
-     * actually used. Stepping in to MapDialogUnits(), the conversion
-     * is fairly clear, and uses 7 for me.
-     *
-     * As a result, some of this is hacky to ensure the sizing is
-     * somewhat correct.
-     *
-     * Honestly, a long term solution is to use CreateWindow, not CreateDialog.
-     *
-
-     *
-     * In order to get text dimensions we need to have a DC with the desired font.
-     * I'm assuming a dialog box in SDL is rare enough we can to the create.
-     */
-    HDC FontDC = CreateCompatibleDC(0);
-
-    {
-        /* Create a duplicate of the font used in system message boxes. */
-        LOGFONT lf;
-        NONCLIENTMETRICS NCM;
-        NCM.cbSize = sizeof(NCM);
-        SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &NCM, 0);
-        lf = NCM.lfMessageFont;
-        DialogFont = CreateFontIndirect(&lf);
-    }
-
-    /* Select the font in to our DC */
-    SelectObject(FontDC, DialogFont);
-
-    {
-        /* Get the metrics to try and figure our DLU conversion. */
-        GetTextMetrics(FontDC, &TM);
-        s_BaseUnitsX = TM.tmAveCharWidth + 1;
-        s_BaseUnitsY = TM.tmHeight;
-    }
-
-    /* Measure the *pixel* size of the string. */
-    wmessage = WIN_UTF8ToString(messageboxdata->message);
-    SDL_zero(TextSize);
-    Size.cx = DrawText(FontDC, wmessage, -1, &TextSize, DT_CALCRECT);
-
-    /* Add some padding for hangs, etc. */
-    TextSize.right += 2;
-    TextSize.bottom += 2;
-
-    /* Done with the DC, and the string */
-    DeleteDC(FontDC);
-    SDL_free(wmessage);
-
-    /* Increase the size of the dialog by some border spacing around the text. */
-    Size.cx = TextSize.right - TextSize.left;
-    Size.cy = TextSize.bottom - TextSize.top;
-    Size.cx += TextMargin * 2;
-    Size.cy += TextMargin * 2;
-
-    /* Ensure the size is wide enough for all of the buttons. */
-    if (Size.cx < messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin)
-        Size.cx = messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin;
-
-    /* Add vertical space for the buttons and border. */
-    Size.cy += ButtonHeight + TextMargin;
-
-    dialog = CreateDialogData(Size.cx, Size.cy, messageboxdata->title);
-    if (!dialog) {
-        return -1;
-    }
-
-    if (!AddDialogStatic(dialog, TextMargin, TextMargin, TextSize.right - TextSize.left, TextSize.bottom - TextSize.top, messageboxdata->message)) {
-        FreeDialogData(dialog);
-        return -1;
-    }
-
-    /* Align the buttons to the right/bottom. */
-    x = Size.cx - ButtonWidth - ButtonMargin;
-    y = Size.cy - ButtonHeight - ButtonMargin;
-    for (i = 0; i < messageboxdata->numbuttons; ++i) {
-        SDL_bool isDefault;
-
-        if (buttons[i].flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT) {
-            isDefault = SDL_TRUE;
-        } else {
-            isDefault = SDL_FALSE;
-        }
-        if (!AddDialogButton(dialog, x, y, ButtonWidth, ButtonHeight, buttons[i].text, i, isDefault)) {
-            FreeDialogData(dialog);
-            return -1;
-        }
-        x -= ButtonWidth + ButtonMargin;
-    }
-
-    /* FIXME: If we have a parent window, get the Instance and HWND for them */
-    which = DialogBoxIndirect(NULL, (DLGTEMPLATE*)dialog->lpDialog, NULL, (DLGPROC)MessageBoxDialogProc);
-    *buttonid = buttons[which].buttonid;
-
-    FreeDialogData(dialog);
-    return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsmessagebox.h b/deps/SDL2/src/video/windows/SDL_windowsmessagebox.h
deleted file mode 100644
index 8780a2e..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsmessagebox.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-extern int WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsmodes.c b/deps/SDL2/src/video/windows/SDL_windowsmodes.c
deleted file mode 100644
index 73cae8f..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsmodes.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "SDL_windowsvideo.h"
-
-/* Windows CE compatibility */
-#ifndef CDS_FULLSCREEN
-#define CDS_FULLSCREEN 0
-#endif
-
-static SDL_bool
-WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode)
-{
-    SDL_DisplayModeData *data;
-    DEVMODE devmode;
-    HDC hdc;
-
-    devmode.dmSize = sizeof(devmode);
-    devmode.dmDriverExtra = 0;
-    if (!EnumDisplaySettings(deviceName, index, &devmode)) {
-        return SDL_FALSE;
-    }
-
-    data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data));
-    if (!data) {
-        return SDL_FALSE;
-    }
-    data->DeviceMode = devmode;
-    data->DeviceMode.dmFields =
-        (DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY |
-         DM_DISPLAYFLAGS);
-
-    /* Fill in the mode information */
-    mode->format = SDL_PIXELFORMAT_UNKNOWN;
-    mode->w = devmode.dmPelsWidth;
-    mode->h = devmode.dmPelsHeight;
-    mode->refresh_rate = devmode.dmDisplayFrequency;
-    mode->driverdata = data;
-
-    if (index == ENUM_CURRENT_SETTINGS
-        && (hdc = CreateDC(deviceName, NULL, NULL, NULL)) != NULL) {
-        char bmi_data[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)];
-        LPBITMAPINFO bmi;
-        HBITMAP hbm;
-
-        SDL_zero(bmi_data);
-        bmi = (LPBITMAPINFO) bmi_data;
-        bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-
-        hbm = CreateCompatibleBitmap(hdc, 1, 1);
-        GetDIBits(hdc, hbm, 0, 1, NULL, bmi, DIB_RGB_COLORS);
-        GetDIBits(hdc, hbm, 0, 1, NULL, bmi, DIB_RGB_COLORS);
-        DeleteObject(hbm);
-        DeleteDC(hdc);
-        if (bmi->bmiHeader.biCompression == BI_BITFIELDS) {
-            switch (*(Uint32 *) bmi->bmiColors) {
-            case 0x00FF0000:
-                mode->format = SDL_PIXELFORMAT_RGB888;
-                break;
-            case 0x000000FF:
-                mode->format = SDL_PIXELFORMAT_BGR888;
-                break;
-            case 0xF800:
-                mode->format = SDL_PIXELFORMAT_RGB565;
-                break;
-            case 0x7C00:
-                mode->format = SDL_PIXELFORMAT_RGB555;
-                break;
-            }
-        } else if (bmi->bmiHeader.biBitCount == 8) {
-            mode->format = SDL_PIXELFORMAT_INDEX8;
-        } else if (bmi->bmiHeader.biBitCount == 4) {
-            mode->format = SDL_PIXELFORMAT_INDEX4LSB;
-        }
-    } else {
-        /* FIXME: Can we tell what this will be? */
-        if ((devmode.dmFields & DM_BITSPERPEL) == DM_BITSPERPEL) {
-            switch (devmode.dmBitsPerPel) {
-            case 32:
-                mode->format = SDL_PIXELFORMAT_RGB888;
-                break;
-            case 24:
-                mode->format = SDL_PIXELFORMAT_RGB24;
-                break;
-            case 16:
-                mode->format = SDL_PIXELFORMAT_RGB565;
-                break;
-            case 15:
-                mode->format = SDL_PIXELFORMAT_RGB555;
-                break;
-            case 8:
-                mode->format = SDL_PIXELFORMAT_INDEX8;
-                break;
-            case 4:
-                mode->format = SDL_PIXELFORMAT_INDEX4LSB;
-                break;
-            }
-        }
-    }
-    return SDL_TRUE;
-}
-
-static SDL_bool
-WIN_AddDisplay(LPTSTR DeviceName)
-{
-    SDL_VideoDisplay display;
-    SDL_DisplayData *displaydata;
-    SDL_DisplayMode mode;
-    DISPLAY_DEVICE device;
-
-#ifdef DEBUG_MODES
-    printf("Display: %s\n", WIN_StringToUTF8(DeviceName));
-#endif
-    if (!WIN_GetDisplayMode(DeviceName, ENUM_CURRENT_SETTINGS, &mode)) {
-        return SDL_FALSE;
-    }
-
-    displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
-    if (!displaydata) {
-        return SDL_FALSE;
-    }
-    SDL_memcpy(displaydata->DeviceName, DeviceName,
-               sizeof(displaydata->DeviceName));
-
-    SDL_zero(display);
-    device.cb = sizeof(device);
-    if (EnumDisplayDevices(DeviceName, 0, &device, 0)) {
-        display.name = WIN_StringToUTF8(device.DeviceString);
-    }
-    display.desktop_mode = mode;
-    display.current_mode = mode;
-    display.driverdata = displaydata;
-    SDL_AddVideoDisplay(&display);
-    SDL_free(display.name);
-    return SDL_TRUE;
-}
-
-int
-WIN_InitModes(_THIS)
-{
-    int pass;
-    DWORD i, j, count;
-    DISPLAY_DEVICE device;
-
-    device.cb = sizeof(device);
-
-    /* Get the primary display in the first pass */
-    for (pass = 0; pass < 2; ++pass) {
-        for (i = 0; ; ++i) {
-            TCHAR DeviceName[32];
-
-            if (!EnumDisplayDevices(NULL, i, &device, 0)) {
-                break;
-            }
-            if (!(device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)) {
-                continue;
-            }
-            if (pass == 0) {
-                if (!(device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)) {
-                    continue;
-                }
-            } else {
-                if (device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) {
-                    continue;
-                }
-            }
-            SDL_memcpy(DeviceName, device.DeviceName, sizeof(DeviceName));
-#ifdef DEBUG_MODES
-            printf("Device: %s\n", WIN_StringToUTF8(DeviceName));
-#endif
-            count = 0;
-            for (j = 0; ; ++j) {
-                if (!EnumDisplayDevices(DeviceName, j, &device, 0)) {
-                    break;
-                }
-                if (!(device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)) {
-                    continue;
-                }
-                if (pass == 0) {
-                    if (!(device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)) {
-                        continue;
-                    }
-                } else {
-                    if (device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) {
-                        continue;
-                    }
-                }
-                count += WIN_AddDisplay(device.DeviceName);
-            }
-            if (count == 0) {
-                WIN_AddDisplay(DeviceName);
-            }
-        }
-    }
-    if (_this->num_displays == 0) {
-        return SDL_SetError("No displays available");
-    }
-    return 0;
-}
-
-int
-WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect)
-{
-    SDL_DisplayModeData *data = (SDL_DisplayModeData *) display->current_mode.driverdata;
-
-    rect->x = (int)data->DeviceMode.dmPosition.x;
-    rect->y = (int)data->DeviceMode.dmPosition.y;
-    rect->w = data->DeviceMode.dmPelsWidth;
-    rect->h = data->DeviceMode.dmPelsHeight;
-
-    return 0;
-}
-
-void
-WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
-{
-    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
-    DWORD i;
-    SDL_DisplayMode mode;
-
-    for (i = 0;; ++i) {
-        if (!WIN_GetDisplayMode(data->DeviceName, i, &mode)) {
-            break;
-        }
-        if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) {
-            /* We don't support palettized modes now */
-            SDL_free(mode.driverdata);
-            continue;
-        }
-        if (mode.format != SDL_PIXELFORMAT_UNKNOWN) {
-            if (!SDL_AddDisplayMode(display, &mode)) {
-                SDL_free(mode.driverdata);
-            }
-        }
-        else {
-            SDL_free(mode.driverdata);
-        }
-    }
-}
-
-int
-WIN_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
-{
-    SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
-    SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata;
-    LONG status;
-
-    status =
-        ChangeDisplaySettingsEx(displaydata->DeviceName, &data->DeviceMode,
-                                NULL, CDS_FULLSCREEN, NULL);
-    if (status != DISP_CHANGE_SUCCESSFUL) {
-        const char *reason = "Unknown reason";
-        switch (status) {
-        case DISP_CHANGE_BADFLAGS:
-            reason = "DISP_CHANGE_BADFLAGS";
-            break;
-        case DISP_CHANGE_BADMODE:
-            reason = "DISP_CHANGE_BADMODE";
-            break;
-        case DISP_CHANGE_BADPARAM:
-            reason = "DISP_CHANGE_BADPARAM";
-            break;
-        case DISP_CHANGE_FAILED:
-            reason = "DISP_CHANGE_FAILED";
-            break;
-        }
-        return SDL_SetError("ChangeDisplaySettingsEx() failed: %s", reason);
-    }
-    EnumDisplaySettings(displaydata->DeviceName, ENUM_CURRENT_SETTINGS, &data->DeviceMode);
-    return 0;
-}
-
-void
-WIN_QuitModes(_THIS)
-{
-    /* All fullscreen windows should have restored modes by now */
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsmodes.h b/deps/SDL2/src/video/windows/SDL_windowsmodes.h
deleted file mode 100644
index fd622d5..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsmodes.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_windowsmodes_h
-#define _SDL_windowsmodes_h
-
-typedef struct
-{
-    TCHAR DeviceName[32];
-} SDL_DisplayData;
-
-typedef struct
-{
-    DEVMODE DeviceMode;
-} SDL_DisplayModeData;
-
-extern int WIN_InitModes(_THIS);
-extern int WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect);
-extern void WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
-extern int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-extern void WIN_QuitModes(_THIS);
-
-#endif /* _SDL_windowsmodes_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsmouse.c b/deps/SDL2/src/video/windows/SDL_windowsmouse.c
deleted file mode 100644
index f50a872..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsmouse.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "SDL_assert.h"
-#include "SDL_windowsvideo.h"
-
-#include "../../events/SDL_mouse_c.h"
-
-
-HCURSOR SDL_cursor = NULL;
-
-
-static SDL_Cursor *
-WIN_CreateDefaultCursor()
-{
-    SDL_Cursor *cursor;
-
-    cursor = SDL_calloc(1, sizeof(*cursor));
-    if (cursor) {
-        cursor->driverdata = LoadCursor(NULL, IDC_ARROW);
-    } else {
-        SDL_OutOfMemory();
-    }
-
-    return cursor;
-}
-
-static SDL_Cursor *
-WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
-{
-    /* msdn says cursor mask has to be padded out to word alignment. Not sure
-        if that means machine word or WORD, but this handles either case. */
-    const size_t pad = (sizeof (size_t) * 8);  /* 32 or 64, or whatever. */
-    SDL_Cursor *cursor;
-    HICON hicon;
-    HDC hdc;
-    BITMAPV4HEADER bmh;
-    LPVOID pixels;
-    LPVOID maskbits;
-    size_t maskbitslen;
-    ICONINFO ii;
-
-    SDL_zero(bmh);
-    bmh.bV4Size = sizeof(bmh);
-    bmh.bV4Width = surface->w;
-    bmh.bV4Height = -surface->h; /* Invert the image */
-    bmh.bV4Planes = 1;
-    bmh.bV4BitCount = 32;
-    bmh.bV4V4Compression = BI_BITFIELDS;
-    bmh.bV4AlphaMask = 0xFF000000;
-    bmh.bV4RedMask   = 0x00FF0000;
-    bmh.bV4GreenMask = 0x0000FF00;
-    bmh.bV4BlueMask  = 0x000000FF;
-
-    maskbitslen = ((surface->w + (pad - (surface->w % pad))) / 8) * surface->h;
-    maskbits = SDL_stack_alloc(Uint8,maskbitslen);
-    if (maskbits == NULL) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-
-    /* AND the cursor against full bits: no change. We already have alpha. */
-    SDL_memset(maskbits, 0xFF, maskbitslen);
-
-    hdc = GetDC(NULL);
-    SDL_zero(ii);
-    ii.fIcon = FALSE;
-    ii.xHotspot = (DWORD)hot_x;
-    ii.yHotspot = (DWORD)hot_y;
-    ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO*)&bmh, DIB_RGB_COLORS, &pixels, NULL, 0);
-    ii.hbmMask = CreateBitmap(surface->w, surface->h, 1, 1, maskbits);
-    ReleaseDC(NULL, hdc);
-    SDL_stack_free(maskbits);
-
-    SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888);
-    SDL_assert(surface->pitch == surface->w * 4);
-    SDL_memcpy(pixels, surface->pixels, surface->h * surface->pitch);
-
-    hicon = CreateIconIndirect(&ii);
-
-    DeleteObject(ii.hbmColor);
-    DeleteObject(ii.hbmMask);
-
-    if (!hicon) {
-        WIN_SetError("CreateIconIndirect()");
-        return NULL;
-    }
-
-    cursor = SDL_calloc(1, sizeof(*cursor));
-    if (cursor) {
-        cursor->driverdata = hicon;
-    } else {
-        DestroyIcon(hicon);
-        SDL_OutOfMemory();
-    }
-
-    return cursor;
-}
-
-static SDL_Cursor *
-WIN_CreateSystemCursor(SDL_SystemCursor id)
-{
-    SDL_Cursor *cursor;
-    LPCTSTR name;
-
-    switch(id)
-    {
-    default:
-        SDL_assert(0);
-        return NULL;
-    case SDL_SYSTEM_CURSOR_ARROW:     name = IDC_ARROW; break;
-    case SDL_SYSTEM_CURSOR_IBEAM:     name = IDC_IBEAM; break;
-    case SDL_SYSTEM_CURSOR_WAIT:      name = IDC_WAIT; break;
-    case SDL_SYSTEM_CURSOR_CROSSHAIR: name = IDC_CROSS; break;
-    case SDL_SYSTEM_CURSOR_WAITARROW: name = IDC_WAIT; break;
-    case SDL_SYSTEM_CURSOR_SIZENWSE:  name = IDC_SIZENWSE; break;
-    case SDL_SYSTEM_CURSOR_SIZENESW:  name = IDC_SIZENESW; break;
-    case SDL_SYSTEM_CURSOR_SIZEWE:    name = IDC_SIZEWE; break;
-    case SDL_SYSTEM_CURSOR_SIZENS:    name = IDC_SIZENS; break;
-    case SDL_SYSTEM_CURSOR_SIZEALL:   name = IDC_SIZEALL; break;
-    case SDL_SYSTEM_CURSOR_NO:        name = IDC_NO; break;
-    case SDL_SYSTEM_CURSOR_HAND:      name = IDC_HAND; break;
-    }
-
-    cursor = SDL_calloc(1, sizeof(*cursor));
-    if (cursor) {
-        HICON hicon;
-
-        hicon = LoadCursor(NULL, name);
-
-        cursor->driverdata = hicon;
-    } else {
-        SDL_OutOfMemory();
-    }
-
-    return cursor;
-}
-
-static void
-WIN_FreeCursor(SDL_Cursor * cursor)
-{
-    HICON hicon = (HICON)cursor->driverdata;
-
-    DestroyIcon(hicon);
-    SDL_free(cursor);
-}
-
-static int
-WIN_ShowCursor(SDL_Cursor * cursor)
-{
-    if (cursor) {
-        SDL_cursor = (HCURSOR)cursor->driverdata;
-    } else {
-        SDL_cursor = NULL;
-    }
-    if (SDL_GetMouseFocus() != NULL) {
-        SetCursor(SDL_cursor);
-    }
-    return 0;
-}
-
-static void
-WIN_WarpMouse(SDL_Window * window, int x, int y)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    POINT pt;
-
-    pt.x = x;
-    pt.y = y;
-    ClientToScreen(hwnd, &pt);
-    SetCursorPos(pt.x, pt.y);
-}
-
-static int
-WIN_SetRelativeMouseMode(SDL_bool enabled)
-{
-    RAWINPUTDEVICE rawMouse = { 0x01, 0x02, 0, NULL }; /* Mouse: UsagePage = 1, Usage = 2 */
-    HWND hWnd;
-    hWnd = GetActiveWindow();
-
-    rawMouse.hwndTarget = hWnd;
-    if(!enabled) {
-        rawMouse.dwFlags |= RIDEV_REMOVE;
-        rawMouse.hwndTarget = NULL;
-    }
-
-
-    /* (Un)register raw input for mice */
-    if(RegisterRawInputDevices(&rawMouse, 1, sizeof(RAWINPUTDEVICE)) == FALSE) {
-
-        /* Only return an error when registering. If we unregister and fail, then
-        it's probably that we unregistered twice. That's OK. */
-        if(enabled) {
-            return SDL_Unsupported();
-        }
-    }
-
-    if(enabled) {
-        LONG cx, cy;
-        RECT rect;
-        GetWindowRect(hWnd, &rect);
-
-        cx = (rect.left + rect.right) / 2;
-        cy = (rect.top + rect.bottom) / 2;
-
-        /* Make an absurdly small clip rect */
-        rect.left = cx-1;
-        rect.right = cx+1;
-        rect.top = cy-1;
-        rect.bottom = cy+1;
-
-        ClipCursor(&rect);
-    }
-    else
-        ClipCursor(NULL);
-
-    return 0;
-}
-
-void
-WIN_InitMouse(_THIS)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    mouse->CreateCursor = WIN_CreateCursor;
-    mouse->CreateSystemCursor = WIN_CreateSystemCursor;
-    mouse->ShowCursor = WIN_ShowCursor;
-    mouse->FreeCursor = WIN_FreeCursor;
-    mouse->WarpMouse = WIN_WarpMouse;
-    mouse->SetRelativeMouseMode = WIN_SetRelativeMouseMode;
-
-    SDL_SetDefaultCursor(WIN_CreateDefaultCursor());
-}
-
-void
-WIN_QuitMouse(_THIS)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-    if ( mouse->def_cursor ) {
-        SDL_free(mouse->def_cursor);
-        mouse->def_cursor = NULL;
-        mouse->cur_cursor = NULL;
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsmouse.h b/deps/SDL2/src/video/windows/SDL_windowsmouse.h
deleted file mode 100644
index c63eee6..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsmouse.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_windowsmouse_h
-#define _SDL_windowsmouse_h
-
-extern HCURSOR SDL_cursor;
-
-extern void WIN_InitMouse(_THIS);
-extern void WIN_QuitMouse(_THIS);
-
-#endif /* _SDL_windowsmouse_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsopengl.c b/deps/SDL2/src/video/windows/SDL_windowsopengl.c
deleted file mode 100644
index 20d9913..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsopengl.c
+++ /dev/null
@@ -1,707 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "SDL_assert.h"
-#include "SDL_loadso.h"
-#include "SDL_windowsvideo.h"
-
-/* WGL implementation of SDL OpenGL support */
-
-#if SDL_VIDEO_OPENGL_WGL
-#include "SDL_opengl.h"
-
-#define DEFAULT_OPENGL "OPENGL32.DLL"
-
-#ifndef WGL_ARB_create_context
-#define WGL_ARB_create_context
-#define WGL_CONTEXT_MAJOR_VERSION_ARB   0x2091
-#define WGL_CONTEXT_MINOR_VERSION_ARB   0x2092
-#define WGL_CONTEXT_LAYER_PLANE_ARB     0x2093
-#define WGL_CONTEXT_FLAGS_ARB           0x2094
-#define WGL_CONTEXT_DEBUG_BIT_ARB       0x0001
-#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB  0x0002
-
-#ifndef WGL_ARB_create_context_profile
-#define WGL_ARB_create_context_profile
-#define WGL_CONTEXT_PROFILE_MASK_ARB              0x9126
-#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB          0x00000001
-#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
-#endif
-
-#ifndef WGL_ARB_create_context_robustness
-#define WGL_ARB_create_context_robustness
-#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB         0x00000004
-#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB     0x8256
-#define WGL_NO_RESET_NOTIFICATION_ARB                   0x8261
-#define WGL_LOSE_CONTEXT_ON_RESET_ARB                   0x8252
-#endif
-#endif
-
-#ifndef WGL_EXT_create_context_es2_profile
-#define WGL_EXT_create_context_es2_profile
-#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT           0x00000004
-#endif
-
-#ifndef WGL_EXT_create_context_es_profile
-#define WGL_EXT_create_context_es_profile
-#define WGL_CONTEXT_ES_PROFILE_BIT_EXT            0x00000004
-#endif
-
-#ifndef WGL_ARB_framebuffer_sRGB
-#define WGL_ARB_framebuffer_sRGB
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB                0x20A9
-#endif
-
-typedef HGLRC(APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC,
-                                                            HGLRC
-                                                            hShareContext,
-                                                            const int
-                                                            *attribList);
-
-int
-WIN_GL_LoadLibrary(_THIS, const char *path)
-{
-    void *handle;
-
-    if (path == NULL) {
-        path = SDL_getenv("SDL_OPENGL_LIBRARY");
-    }
-    if (path == NULL) {
-        path = DEFAULT_OPENGL;
-    }
-    _this->gl_config.dll_handle = SDL_LoadObject(path);
-    if (!_this->gl_config.dll_handle) {
-        return -1;
-    }
-    SDL_strlcpy(_this->gl_config.driver_path, path,
-                SDL_arraysize(_this->gl_config.driver_path));
-
-    /* Allocate OpenGL memory */
-    _this->gl_data = (struct SDL_GLDriverData *) SDL_calloc(1, sizeof(struct SDL_GLDriverData));
-    if (!_this->gl_data) {
-        return SDL_OutOfMemory();
-    }
-
-    /* Load function pointers */
-    handle = _this->gl_config.dll_handle;
-    _this->gl_data->wglGetProcAddress = (void *(WINAPI *) (const char *))
-        SDL_LoadFunction(handle, "wglGetProcAddress");
-    _this->gl_data->wglCreateContext = (HGLRC(WINAPI *) (HDC))
-        SDL_LoadFunction(handle, "wglCreateContext");
-    _this->gl_data->wglDeleteContext = (BOOL(WINAPI *) (HGLRC))
-        SDL_LoadFunction(handle, "wglDeleteContext");
-    _this->gl_data->wglMakeCurrent = (BOOL(WINAPI *) (HDC, HGLRC))
-        SDL_LoadFunction(handle, "wglMakeCurrent");
-    _this->gl_data->wglShareLists = (BOOL(WINAPI *) (HGLRC, HGLRC))
-        SDL_LoadFunction(handle, "wglShareLists");
-
-    if (!_this->gl_data->wglGetProcAddress ||
-        !_this->gl_data->wglCreateContext ||
-        !_this->gl_data->wglDeleteContext ||
-        !_this->gl_data->wglMakeCurrent) {
-        return SDL_SetError("Could not retrieve OpenGL functions");
-    }
-
-    return 0;
-}
-
-void *
-WIN_GL_GetProcAddress(_THIS, const char *proc)
-{
-    void *func;
-
-    /* This is to pick up extensions */
-    func = _this->gl_data->wglGetProcAddress(proc);
-    if (!func) {
-        /* This is probably a normal GL function */
-        func = GetProcAddress(_this->gl_config.dll_handle, proc);
-    }
-    return func;
-}
-
-void
-WIN_GL_UnloadLibrary(_THIS)
-{
-    SDL_UnloadObject(_this->gl_config.dll_handle);
-    _this->gl_config.dll_handle = NULL;
-
-    /* Free OpenGL memory */
-    SDL_free(_this->gl_data);
-    _this->gl_data = NULL;
-}
-
-static void
-WIN_GL_SetupPixelFormat(_THIS, PIXELFORMATDESCRIPTOR * pfd)
-{
-    SDL_zerop(pfd);
-    pfd->nSize = sizeof(*pfd);
-    pfd->nVersion = 1;
-    pfd->dwFlags = (PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL);
-    if (_this->gl_config.double_buffer) {
-        pfd->dwFlags |= PFD_DOUBLEBUFFER;
-    }
-    if (_this->gl_config.stereo) {
-        pfd->dwFlags |= PFD_STEREO;
-    }
-    pfd->iLayerType = PFD_MAIN_PLANE;
-    pfd->iPixelType = PFD_TYPE_RGBA;
-    pfd->cRedBits = _this->gl_config.red_size;
-    pfd->cGreenBits = _this->gl_config.green_size;
-    pfd->cBlueBits = _this->gl_config.blue_size;
-    pfd->cAlphaBits = _this->gl_config.alpha_size;
-    if (_this->gl_config.buffer_size) {
-        pfd->cColorBits =
-            _this->gl_config.buffer_size - _this->gl_config.alpha_size;
-    } else {
-        pfd->cColorBits = (pfd->cRedBits + pfd->cGreenBits + pfd->cBlueBits);
-    }
-    pfd->cAccumRedBits = _this->gl_config.accum_red_size;
-    pfd->cAccumGreenBits = _this->gl_config.accum_green_size;
-    pfd->cAccumBlueBits = _this->gl_config.accum_blue_size;
-    pfd->cAccumAlphaBits = _this->gl_config.accum_alpha_size;
-    pfd->cAccumBits =
-        (pfd->cAccumRedBits + pfd->cAccumGreenBits + pfd->cAccumBlueBits +
-         pfd->cAccumAlphaBits);
-    pfd->cDepthBits = _this->gl_config.depth_size;
-    pfd->cStencilBits = _this->gl_config.stencil_size;
-}
-
-/* Choose the closest pixel format that meets or exceeds the target.
-   FIXME: Should we weight any particular attribute over any other?
-*/
-static int
-WIN_GL_ChoosePixelFormat(HDC hdc, PIXELFORMATDESCRIPTOR * target)
-{
-    PIXELFORMATDESCRIPTOR pfd;
-    int count, index, best = 0;
-    unsigned int dist, best_dist = ~0U;
-
-    count = DescribePixelFormat(hdc, 1, sizeof(pfd), NULL);
-
-    for (index = 1; index <= count; index++) {
-
-        if (!DescribePixelFormat(hdc, index, sizeof(pfd), &pfd)) {
-            continue;
-        }
-
-        if ((pfd.dwFlags & target->dwFlags) != target->dwFlags) {
-            continue;
-        }
-
-        if (pfd.iLayerType != target->iLayerType) {
-            continue;
-        }
-        if (pfd.iPixelType != target->iPixelType) {
-            continue;
-        }
-
-        dist = 0;
-
-        if (pfd.cColorBits < target->cColorBits) {
-            continue;
-        } else {
-            dist += (pfd.cColorBits - target->cColorBits);
-        }
-        if (pfd.cRedBits < target->cRedBits) {
-            continue;
-        } else {
-            dist += (pfd.cRedBits - target->cRedBits);
-        }
-        if (pfd.cGreenBits < target->cGreenBits) {
-            continue;
-        } else {
-            dist += (pfd.cGreenBits - target->cGreenBits);
-        }
-        if (pfd.cBlueBits < target->cBlueBits) {
-            continue;
-        } else {
-            dist += (pfd.cBlueBits - target->cBlueBits);
-        }
-        if (pfd.cAlphaBits < target->cAlphaBits) {
-            continue;
-        } else {
-            dist += (pfd.cAlphaBits - target->cAlphaBits);
-        }
-        if (pfd.cAccumBits < target->cAccumBits) {
-            continue;
-        } else {
-            dist += (pfd.cAccumBits - target->cAccumBits);
-        }
-        if (pfd.cAccumRedBits < target->cAccumRedBits) {
-            continue;
-        } else {
-            dist += (pfd.cAccumRedBits - target->cAccumRedBits);
-        }
-        if (pfd.cAccumGreenBits < target->cAccumGreenBits) {
-            continue;
-        } else {
-            dist += (pfd.cAccumGreenBits - target->cAccumGreenBits);
-        }
-        if (pfd.cAccumBlueBits < target->cAccumBlueBits) {
-            continue;
-        } else {
-            dist += (pfd.cAccumBlueBits - target->cAccumBlueBits);
-        }
-        if (pfd.cAccumAlphaBits < target->cAccumAlphaBits) {
-            continue;
-        } else {
-            dist += (pfd.cAccumAlphaBits - target->cAccumAlphaBits);
-        }
-        if (pfd.cDepthBits < target->cDepthBits) {
-            continue;
-        } else {
-            dist += (pfd.cDepthBits - target->cDepthBits);
-        }
-        if (pfd.cStencilBits < target->cStencilBits) {
-            continue;
-        } else {
-            dist += (pfd.cStencilBits - target->cStencilBits);
-        }
-
-        if (dist < best_dist) {
-            best = index;
-            best_dist = dist;
-        }
-    }
-
-    return best;
-}
-
-static SDL_bool
-HasExtension(const char *extension, const char *extensions)
-{
-    const char *start;
-    const char *where, *terminator;
-
-    /* Extension names should not have spaces. */
-    where = SDL_strchr(extension, ' ');
-    if (where || *extension == '\0')
-        return SDL_FALSE;
-
-    if (!extensions)
-        return SDL_FALSE;
-
-    /* It takes a bit of care to be fool-proof about parsing the
-     * OpenGL extensions string. Don't be fooled by sub-strings,
-     * etc. */
-
-    start = extensions;
-
-    for (;;) {
-        where = SDL_strstr(start, extension);
-        if (!where)
-            break;
-
-        terminator = where + SDL_strlen(extension);
-        if (where == start || *(where - 1) == ' ')
-            if (*terminator == ' ' || *terminator == '\0')
-                return SDL_TRUE;
-
-        start = terminator;
-    }
-    return SDL_FALSE;
-}
-
-static void
-WIN_GL_InitExtensions(_THIS, HDC hdc)
-{
-    const char *(WINAPI * wglGetExtensionsStringARB) (HDC) = 0;
-    const char *extensions;
-
-    wglGetExtensionsStringARB = (const char *(WINAPI *) (HDC))
-        _this->gl_data->wglGetProcAddress("wglGetExtensionsStringARB");
-    if (wglGetExtensionsStringARB) {
-        extensions = wglGetExtensionsStringARB(hdc);
-    } else {
-        extensions = NULL;
-    }
-
-    /* Check for WGL_ARB_pixel_format */
-    _this->gl_data->HAS_WGL_ARB_pixel_format = SDL_FALSE;
-    if (HasExtension("WGL_ARB_pixel_format", extensions)) {
-        _this->gl_data->wglChoosePixelFormatARB = (BOOL(WINAPI *)
-                                                   (HDC, const int *,
-                                                    const FLOAT *, UINT,
-                                                    int *, UINT *))
-            WIN_GL_GetProcAddress(_this, "wglChoosePixelFormatARB");
-        _this->gl_data->wglGetPixelFormatAttribivARB =
-            (BOOL(WINAPI *) (HDC, int, int, UINT, const int *, int *))
-            WIN_GL_GetProcAddress(_this, "wglGetPixelFormatAttribivARB");
-
-        if ((_this->gl_data->wglChoosePixelFormatARB != NULL) &&
-            (_this->gl_data->wglGetPixelFormatAttribivARB != NULL)) {
-            _this->gl_data->HAS_WGL_ARB_pixel_format = SDL_TRUE;
-        }
-    }
-
-    /* Check for WGL_EXT_swap_control */
-    _this->gl_data->HAS_WGL_EXT_swap_control_tear = SDL_FALSE;
-    if (HasExtension("WGL_EXT_swap_control", extensions)) {
-        _this->gl_data->wglSwapIntervalEXT =
-            WIN_GL_GetProcAddress(_this, "wglSwapIntervalEXT");
-        _this->gl_data->wglGetSwapIntervalEXT =
-            WIN_GL_GetProcAddress(_this, "wglGetSwapIntervalEXT");
-        if (HasExtension("WGL_EXT_swap_control_tear", extensions)) {
-            _this->gl_data->HAS_WGL_EXT_swap_control_tear = SDL_TRUE;
-        }
-    } else {
-        _this->gl_data->wglSwapIntervalEXT = NULL;
-        _this->gl_data->wglGetSwapIntervalEXT = NULL;
-    }
-}
-
-static int
-WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs)
-{
-    HWND hwnd;
-    HDC hdc;
-    PIXELFORMATDESCRIPTOR pfd;
-    HGLRC hglrc;
-    int pixel_format = 0;
-    unsigned int matching;
-
-    hwnd =
-        CreateWindow(SDL_Appname, SDL_Appname, (WS_POPUP | WS_DISABLED), 0, 0,
-                     10, 10, NULL, NULL, SDL_Instance, NULL);
-    WIN_PumpEvents(_this);
-
-    hdc = GetDC(hwnd);
-
-    WIN_GL_SetupPixelFormat(_this, &pfd);
-
-    SetPixelFormat(hdc, ChoosePixelFormat(hdc, &pfd), &pfd);
-
-    hglrc = _this->gl_data->wglCreateContext(hdc);
-    if (hglrc) {
-        _this->gl_data->wglMakeCurrent(hdc, hglrc);
-
-        WIN_GL_InitExtensions(_this, hdc);
-
-        if (_this->gl_data->HAS_WGL_ARB_pixel_format) {
-            _this->gl_data->wglChoosePixelFormatARB(hdc, iAttribs, fAttribs,
-                                                    1, &pixel_format,
-                                                    &matching);
-        }
-
-        _this->gl_data->wglMakeCurrent(hdc, NULL);
-        _this->gl_data->wglDeleteContext(hglrc);
-    }
-    ReleaseDC(hwnd, hdc);
-    DestroyWindow(hwnd);
-    WIN_PumpEvents(_this);
-
-    return pixel_format;
-}
-
-/* actual work of WIN_GL_SetupWindow() happens here. */
-static int
-WIN_GL_SetupWindowInternal(_THIS, SDL_Window * window)
-{
-    HDC hdc = ((SDL_WindowData *) window->driverdata)->hdc;
-    PIXELFORMATDESCRIPTOR pfd;
-    int pixel_format = 0;
-    int iAttribs[64];
-    int *iAttr;
-    int *iAccelAttr;
-    float fAttribs[1] = { 0 };
-
-    WIN_GL_SetupPixelFormat(_this, &pfd);
-
-    /* setup WGL_ARB_pixel_format attribs */
-    iAttr = &iAttribs[0];
-
-    *iAttr++ = WGL_DRAW_TO_WINDOW_ARB;
-    *iAttr++ = GL_TRUE;
-    *iAttr++ = WGL_RED_BITS_ARB;
-    *iAttr++ = _this->gl_config.red_size;
-    *iAttr++ = WGL_GREEN_BITS_ARB;
-    *iAttr++ = _this->gl_config.green_size;
-    *iAttr++ = WGL_BLUE_BITS_ARB;
-    *iAttr++ = _this->gl_config.blue_size;
-
-    if (_this->gl_config.alpha_size) {
-        *iAttr++ = WGL_ALPHA_BITS_ARB;
-        *iAttr++ = _this->gl_config.alpha_size;
-    }
-
-    *iAttr++ = WGL_DOUBLE_BUFFER_ARB;
-    *iAttr++ = _this->gl_config.double_buffer;
-
-    *iAttr++ = WGL_DEPTH_BITS_ARB;
-    *iAttr++ = _this->gl_config.depth_size;
-
-    if (_this->gl_config.stencil_size) {
-        *iAttr++ = WGL_STENCIL_BITS_ARB;
-        *iAttr++ = _this->gl_config.stencil_size;
-    }
-
-    if (_this->gl_config.accum_red_size) {
-        *iAttr++ = WGL_ACCUM_RED_BITS_ARB;
-        *iAttr++ = _this->gl_config.accum_red_size;
-    }
-
-    if (_this->gl_config.accum_green_size) {
-        *iAttr++ = WGL_ACCUM_GREEN_BITS_ARB;
-        *iAttr++ = _this->gl_config.accum_green_size;
-    }
-
-    if (_this->gl_config.accum_blue_size) {
-        *iAttr++ = WGL_ACCUM_BLUE_BITS_ARB;
-        *iAttr++ = _this->gl_config.accum_blue_size;
-    }
-
-    if (_this->gl_config.accum_alpha_size) {
-        *iAttr++ = WGL_ACCUM_ALPHA_BITS_ARB;
-        *iAttr++ = _this->gl_config.accum_alpha_size;
-    }
-
-    if (_this->gl_config.stereo) {
-        *iAttr++ = WGL_STEREO_ARB;
-        *iAttr++ = GL_TRUE;
-    }
-
-    if (_this->gl_config.multisamplebuffers) {
-        *iAttr++ = WGL_SAMPLE_BUFFERS_ARB;
-        *iAttr++ = _this->gl_config.multisamplebuffers;
-    }
-
-    if (_this->gl_config.multisamplesamples) {
-        *iAttr++ = WGL_SAMPLES_ARB;
-        *iAttr++ = _this->gl_config.multisamplesamples;
-    }
-
-    if (_this->gl_config.framebuffer_srgb_capable) {
-        *iAttr++ = WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB;
-        *iAttr++ = _this->gl_config.framebuffer_srgb_capable;
-    }
-
-    /* We always choose either FULL or NO accel on Windows, because of flaky
-       drivers. If the app didn't specify, we use FULL, because that's
-       probably what they wanted (and if you didn't care and got FULL, that's
-       a perfectly valid result in any case). */
-    *iAttr++ = WGL_ACCELERATION_ARB;
-    iAccelAttr = iAttr;
-    if (_this->gl_config.accelerated) {
-        *iAttr++ = WGL_FULL_ACCELERATION_ARB;
-    } else {
-        *iAttr++ = WGL_NO_ACCELERATION_ARB;
-    }
-
-    *iAttr = 0;
-
-    /* Choose and set the closest available pixel format */
-    pixel_format = WIN_GL_ChoosePixelFormatARB(_this, iAttribs, fAttribs);
-
-    /* App said "don't care about accel" and FULL accel failed. Try NO. */
-    if ( ( !pixel_format ) && ( _this->gl_config.accelerated < 0 ) ) {
-        *iAccelAttr = WGL_NO_ACCELERATION_ARB;
-        pixel_format = WIN_GL_ChoosePixelFormatARB(_this, iAttribs, fAttribs);
-        *iAccelAttr = WGL_FULL_ACCELERATION_ARB;  /* if we try again. */
-    }
-    if (!pixel_format) {
-        pixel_format = WIN_GL_ChoosePixelFormat(hdc, &pfd);
-    }
-    if (!pixel_format) {
-        return SDL_SetError("No matching GL pixel format available");
-    }
-    if (!SetPixelFormat(hdc, pixel_format, &pfd)) {
-        return WIN_SetError("SetPixelFormat()");
-    }
-    return 0;
-}
-
-int
-WIN_GL_SetupWindow(_THIS, SDL_Window * window)
-{
-    /* The current context is lost in here; save it and reset it. */
-    SDL_Window *current_win = SDL_GL_GetCurrentWindow();
-    SDL_GLContext current_ctx = SDL_GL_GetCurrentContext();
-    const int retval = WIN_GL_SetupWindowInternal(_this, window);
-    WIN_GL_MakeCurrent(_this, current_win, current_ctx);
-    return retval;
-}
-
-SDL_GLContext
-WIN_GL_CreateContext(_THIS, SDL_Window * window)
-{
-    HDC hdc = ((SDL_WindowData *) window->driverdata)->hdc;
-    HGLRC context, share_context;
-
-    if (_this->gl_config.share_with_current_context) {
-        share_context = (HGLRC)SDL_GL_GetCurrentContext();
-    } else {
-        share_context = 0;
-    }
-
-    if (_this->gl_config.major_version < 3 &&
-    _this->gl_config.profile_mask == 0 &&
-    _this->gl_config.flags == 0) {
-        /* Create legacy context */
-        context = _this->gl_data->wglCreateContext(hdc);
-    if( share_context != 0 ) {
-            _this->gl_data->wglShareLists(share_context, context);
-    }
-    } else {
-        PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
-        HGLRC temp_context = _this->gl_data->wglCreateContext(hdc);
-        if (!temp_context) {
-            SDL_SetError("Could not create GL context");
-            return NULL;
-        }
-
-        /* Make the context current */
-        if (WIN_GL_MakeCurrent(_this, window, temp_context) < 0) {
-            WIN_GL_DeleteContext(_this, temp_context);
-            return NULL;
-        }
-
-        wglCreateContextAttribsARB =
-            (PFNWGLCREATECONTEXTATTRIBSARBPROC) _this->gl_data->
-            wglGetProcAddress("wglCreateContextAttribsARB");
-        if (!wglCreateContextAttribsARB) {
-            SDL_SetError("GL 3.x is not supported");
-            context = temp_context;
-        } else {
-        /* max 8 attributes plus terminator */
-            int attribs[9] = {
-                WGL_CONTEXT_MAJOR_VERSION_ARB, _this->gl_config.major_version,
-                WGL_CONTEXT_MINOR_VERSION_ARB, _this->gl_config.minor_version,
-                0
-            };
-        int iattr = 4;
-
-        /* SDL profile bits match WGL profile bits */
-        if( _this->gl_config.profile_mask != 0 ) {
-            attribs[iattr++] = WGL_CONTEXT_PROFILE_MASK_ARB;
-        attribs[iattr++] = _this->gl_config.profile_mask;
-        }
-
-        /* SDL flags match WGL flags */
-        if( _this->gl_config.flags != 0 ) {
-            attribs[iattr++] = WGL_CONTEXT_FLAGS_ARB;
-        attribs[iattr++] = _this->gl_config.flags;
-        }
-
-        attribs[iattr++] = 0;
-
-            /* Create the GL 3.x context */
-            context = wglCreateContextAttribsARB(hdc, share_context, attribs);
-            /* Delete the GL 2.x context */
-            _this->gl_data->wglDeleteContext(temp_context);
-        }
-    }
-
-    if (!context) {
-        WIN_SetError("Could not create GL context");
-        return NULL;
-    }
-
-    if (WIN_GL_MakeCurrent(_this, window, context) < 0) {
-        WIN_GL_DeleteContext(_this, context);
-        return NULL;
-    }
-
-    WIN_GL_InitExtensions(_this, hdc);
-
-    return context;
-}
-
-int
-WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
-{
-    HDC hdc;
-
-    if (!_this->gl_data) {
-        return SDL_SetError("OpenGL not initialized");
-    }
-
-    /* sanity check that higher level handled this. */
-    SDL_assert(window || (!window && !context));
-
-    /* Some Windows drivers freak out if hdc is NULL, even when context is
-       NULL, against spec. Since hdc is _supposed_ to be ignored if context
-       is NULL, we either use the current GL window, or do nothing if we
-       already have no current context. */
-    if (!window) {
-        window = SDL_GL_GetCurrentWindow();
-        if (!window) {
-            SDL_assert(SDL_GL_GetCurrentContext() == NULL);
-            return 0;  /* already done. */
-        }
-    }
-
-    hdc = ((SDL_WindowData *) window->driverdata)->hdc;
-    if (!_this->gl_data->wglMakeCurrent(hdc, (HGLRC) context)) {
-        return WIN_SetError("wglMakeCurrent()");
-    }
-    return 0;
-}
-
-int
-WIN_GL_SetSwapInterval(_THIS, int interval)
-{
-    if ((interval < 0) && (!_this->gl_data->HAS_WGL_EXT_swap_control_tear)) {
-        return SDL_SetError("Negative swap interval unsupported in this GL");
-    } else if (_this->gl_data->wglSwapIntervalEXT) {
-        if (_this->gl_data->wglSwapIntervalEXT(interval) != TRUE) {
-            return WIN_SetError("wglSwapIntervalEXT()");
-        }
-    } else {
-        return SDL_Unsupported();
-    }
-    return 0;
-}
-
-int
-WIN_GL_GetSwapInterval(_THIS)
-{
-    int retval = 0;
-    if (_this->gl_data->wglGetSwapIntervalEXT) {
-        retval = _this->gl_data->wglGetSwapIntervalEXT();
-    }
-    return retval;
-}
-
-void
-WIN_GL_SwapWindow(_THIS, SDL_Window * window)
-{
-    HDC hdc = ((SDL_WindowData *) window->driverdata)->hdc;
-
-    SwapBuffers(hdc);
-}
-
-void
-WIN_GL_DeleteContext(_THIS, SDL_GLContext context)
-{
-    if (!_this->gl_data) {
-        return;
-    }
-    _this->gl_data->wglDeleteContext((HGLRC) context);
-}
-
-#endif /* SDL_VIDEO_OPENGL_WGL */
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsopengl.h b/deps/SDL2/src/video/windows/SDL_windowsopengl.h
deleted file mode 100644
index 36da7ba..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsopengl.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_windowsopengl_h
-#define _SDL_windowsopengl_h
-
-#if SDL_VIDEO_OPENGL_WGL
-
-struct SDL_GLDriverData
-{
-    SDL_bool HAS_WGL_ARB_pixel_format;
-    SDL_bool HAS_WGL_EXT_swap_control_tear;
-
-    void *(WINAPI * wglGetProcAddress) (const char *proc);
-      HGLRC(WINAPI * wglCreateContext) (HDC hdc);
-      BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
-      BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
-      BOOL(WINAPI * wglShareLists) (HGLRC hglrc1, HGLRC hglrc2);
-      BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
-                                              const int *piAttribIList,
-                                              const FLOAT * pfAttribFList,
-                                              UINT nMaxFormats,
-                                              int *piFormats,
-                                              UINT * nNumFormats);
-      BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
-                                                   int iLayerPlane,
-                                                   UINT nAttributes,
-                                                   const int *piAttributes,
-                                                   int *piValues);
-    BOOL (WINAPI * wglSwapIntervalEXT) (int interval);
-    int (WINAPI * wglGetSwapIntervalEXT) (void);
-};
-
-/* OpenGL functions */
-extern int WIN_GL_LoadLibrary(_THIS, const char *path);
-extern void *WIN_GL_GetProcAddress(_THIS, const char *proc);
-extern void WIN_GL_UnloadLibrary(_THIS);
-extern int WIN_GL_SetupWindow(_THIS, SDL_Window * window);
-extern SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window * window);
-extern int WIN_GL_MakeCurrent(_THIS, SDL_Window * window,
-                              SDL_GLContext context);
-extern int WIN_GL_SetSwapInterval(_THIS, int interval);
-extern int WIN_GL_GetSwapInterval(_THIS);
-extern void WIN_GL_SwapWindow(_THIS, SDL_Window * window);
-extern void WIN_GL_DeleteContext(_THIS, SDL_GLContext context);
-
-#ifndef WGL_ARB_pixel_format
-#define WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000
-#define WGL_DRAW_TO_WINDOW_ARB         0x2001
-#define WGL_DRAW_TO_BITMAP_ARB         0x2002
-#define WGL_ACCELERATION_ARB           0x2003
-#define WGL_NEED_PALETTE_ARB           0x2004
-#define WGL_NEED_SYSTEM_PALETTE_ARB    0x2005
-#define WGL_SWAP_LAYER_BUFFERS_ARB     0x2006
-#define WGL_SWAP_METHOD_ARB            0x2007
-#define WGL_NUMBER_OVERLAYS_ARB        0x2008
-#define WGL_NUMBER_UNDERLAYS_ARB       0x2009
-#define WGL_TRANSPARENT_ARB            0x200A
-#define WGL_TRANSPARENT_RED_VALUE_ARB  0x2037
-#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
-#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
-#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
-#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
-#define WGL_SHARE_DEPTH_ARB            0x200C
-#define WGL_SHARE_STENCIL_ARB          0x200D
-#define WGL_SHARE_ACCUM_ARB            0x200E
-#define WGL_SUPPORT_GDI_ARB            0x200F
-#define WGL_SUPPORT_OPENGL_ARB         0x2010
-#define WGL_DOUBLE_BUFFER_ARB          0x2011
-#define WGL_STEREO_ARB                 0x2012
-#define WGL_PIXEL_TYPE_ARB             0x2013
-#define WGL_COLOR_BITS_ARB             0x2014
-#define WGL_RED_BITS_ARB               0x2015
-#define WGL_RED_SHIFT_ARB              0x2016
-#define WGL_GREEN_BITS_ARB             0x2017
-#define WGL_GREEN_SHIFT_ARB            0x2018
-#define WGL_BLUE_BITS_ARB              0x2019
-#define WGL_BLUE_SHIFT_ARB             0x201A
-#define WGL_ALPHA_BITS_ARB             0x201B
-#define WGL_ALPHA_SHIFT_ARB            0x201C
-#define WGL_ACCUM_BITS_ARB             0x201D
-#define WGL_ACCUM_RED_BITS_ARB         0x201E
-#define WGL_ACCUM_GREEN_BITS_ARB       0x201F
-#define WGL_ACCUM_BLUE_BITS_ARB        0x2020
-#define WGL_ACCUM_ALPHA_BITS_ARB       0x2021
-#define WGL_DEPTH_BITS_ARB             0x2022
-#define WGL_STENCIL_BITS_ARB           0x2023
-#define WGL_AUX_BUFFERS_ARB            0x2024
-#define WGL_NO_ACCELERATION_ARB        0x2025
-#define WGL_GENERIC_ACCELERATION_ARB   0x2026
-#define WGL_FULL_ACCELERATION_ARB      0x2027
-#define WGL_SWAP_EXCHANGE_ARB          0x2028
-#define WGL_SWAP_COPY_ARB              0x2029
-#define WGL_SWAP_UNDEFINED_ARB         0x202A
-#define WGL_TYPE_RGBA_ARB              0x202B
-#define WGL_TYPE_COLORINDEX_ARB        0x202C
-#endif
-
-#ifndef WGL_ARB_multisample
-#define WGL_SAMPLE_BUFFERS_ARB         0x2041
-#define WGL_SAMPLES_ARB                0x2042
-#endif
-
-#endif /* SDL_VIDEO_OPENGL_WGL */
-
-#endif /* _SDL_windowsopengl_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsshape.c b/deps/SDL2/src/video/windows/SDL_windowsshape.c
deleted file mode 100644
index fdbcdfc..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsshape.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "SDL_assert.h"
-#include "SDL_windowsshape.h"
-#include "SDL_windowsvideo.h"
-
-SDL_WindowShaper*
-Win32_CreateShaper(SDL_Window * window) {
-    int resized_properly;
-    SDL_WindowShaper* result = (SDL_WindowShaper *)SDL_malloc(sizeof(SDL_WindowShaper));
-    result->window = window;
-    result->mode.mode = ShapeModeDefault;
-    result->mode.parameters.binarizationCutoff = 1;
-    result->userx = result->usery = 0;
-    result->driverdata = (SDL_ShapeData*)SDL_malloc(sizeof(SDL_ShapeData));
-    ((SDL_ShapeData*)result->driverdata)->mask_tree = NULL;
-    /* Put some driver-data here. */
-    window->shaper = result;
-    resized_properly = Win32_ResizeWindowShape(window);
-    if (resized_properly != 0)
-            return NULL;
-
-    return result;
-}
-
-void
-CombineRectRegions(SDL_ShapeTree* node,void* closure) {
-    HRGN mask_region = *((HRGN*)closure),temp_region = NULL;
-    if(node->kind == OpaqueShape) {
-        /* Win32 API regions exclude their outline, so we widen the region by one pixel in each direction to include the real outline. */
-        temp_region = CreateRectRgn(node->data.shape.x,node->data.shape.y,node->data.shape.x + node->data.shape.w + 1,node->data.shape.y + node->data.shape.h + 1);
-        if(mask_region != NULL) {
-            CombineRgn(mask_region,mask_region,temp_region,RGN_OR);
-            DeleteObject(temp_region);
-        }
-        else
-            *((HRGN*)closure) = temp_region;
-    }
-}
-
-int
-Win32_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) {
-    SDL_ShapeData *data;
-    HRGN mask_region = NULL;
-
-    if( (shaper == NULL) ||
-        (shape == NULL) ||
-        ((shape->format->Amask == 0) && (shape_mode->mode != ShapeModeColorKey)) ||
-        (shape->w != shaper->window->w) ||
-        (shape->h != shaper->window->h) ) {
-        return SDL_INVALID_SHAPE_ARGUMENT;
-    }
-
-    data = (SDL_ShapeData*)shaper->driverdata;
-    if(data->mask_tree != NULL)
-        SDL_FreeShapeTree(&data->mask_tree);
-    data->mask_tree = SDL_CalculateShapeTree(*shape_mode,shape);
-
-    SDL_TraverseShapeTree(data->mask_tree,&CombineRectRegions,&mask_region);
-    SDL_assert(mask_region != NULL);
-
-    SetWindowRgn(((SDL_WindowData *)(shaper->window->driverdata))->hwnd, mask_region, TRUE);
-
-    return 0;
-}
-
-int
-Win32_ResizeWindowShape(SDL_Window *window) {
-    SDL_ShapeData* data;
-
-    if (window == NULL)
-        return -1;
-    data = (SDL_ShapeData *)window->shaper->driverdata;
-    if (data == NULL)
-        return -1;
-
-    if(data->mask_tree != NULL)
-        SDL_FreeShapeTree(&data->mask_tree);
-    if(window->shaper->hasshape == SDL_TRUE) {
-        window->shaper->userx = window->x;
-        window->shaper->usery = window->y;
-        SDL_SetWindowPosition(window,-1000,-1000);
-    }
-
-    return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsshape.h b/deps/SDL2/src/video/windows/SDL_windowsshape.h
deleted file mode 100644
index 06aaea1..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsshape.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#ifndef _SDL_windowsshape_h
-#define _SDL_windowsshape_h
-
-#include "SDL_video.h"
-#include "SDL_shape.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_shape_internals.h"
-
-typedef struct {
-    SDL_ShapeTree *mask_tree;
-} SDL_ShapeData;
-
-extern SDL_WindowShaper* Win32_CreateShaper(SDL_Window * window);
-extern int Win32_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
-extern int Win32_ResizeWindowShape(SDL_Window *window);
-
-#endif /* _SDL_windowsshape_h */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsvideo.c b/deps/SDL2/src/video/windows/SDL_windowsvideo.c
deleted file mode 100644
index 8f708cf..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsvideo.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "SDL_main.h"
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "SDL_system.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-
-#include "SDL_windowsvideo.h"
-#include "SDL_windowsframebuffer.h"
-#include "SDL_windowsshape.h"
-
-/* Initialization/Query functions */
-static int WIN_VideoInit(_THIS);
-static void WIN_VideoQuit(_THIS);
-
-
-/* Windows driver bootstrap functions */
-
-static int
-WIN_Available(void)
-{
-    return (1);
-}
-
-static void
-WIN_DeleteDevice(SDL_VideoDevice * device)
-{
-    SDL_VideoData *data = (SDL_VideoData *) device->driverdata;
-
-    SDL_UnregisterApp();
-    if (data->userDLL) {
-        SDL_UnloadObject(data->userDLL);
-    }
-
-    SDL_free(device->driverdata);
-    SDL_free(device);
-}
-
-static SDL_VideoDevice *
-WIN_CreateDevice(int devindex)
-{
-    SDL_VideoDevice *device;
-    SDL_VideoData *data;
-
-    SDL_RegisterApp(NULL, 0, NULL);
-
-    /* Initialize all variables that we clean on shutdown */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-    if (device) {
-        data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
-    } else {
-        data = NULL;
-    }
-    if (!data) {
-        SDL_free(device);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    device->driverdata = data;
-
-    data->userDLL = SDL_LoadObject("USER32.DLL");
-    if (data->userDLL) {
-        data->CloseTouchInputHandle = (BOOL (WINAPI *)( HTOUCHINPUT )) SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle");
-        data->GetTouchInputInfo = (BOOL (WINAPI *)( HTOUCHINPUT, UINT, PTOUCHINPUT, int )) SDL_LoadFunction(data->userDLL, "GetTouchInputInfo");
-        data->RegisterTouchWindow = (BOOL (WINAPI *)( HWND, ULONG )) SDL_LoadFunction(data->userDLL, "RegisterTouchWindow");
-    }
-
-    /* Set the function pointers */
-    device->VideoInit = WIN_VideoInit;
-    device->VideoQuit = WIN_VideoQuit;
-    device->GetDisplayBounds = WIN_GetDisplayBounds;
-    device->GetDisplayModes = WIN_GetDisplayModes;
-    device->SetDisplayMode = WIN_SetDisplayMode;
-    device->PumpEvents = WIN_PumpEvents;
-
-#undef CreateWindow
-    device->CreateWindow = WIN_CreateWindow;
-    device->CreateWindowFrom = WIN_CreateWindowFrom;
-    device->SetWindowTitle = WIN_SetWindowTitle;
-    device->SetWindowIcon = WIN_SetWindowIcon;
-    device->SetWindowPosition = WIN_SetWindowPosition;
-    device->SetWindowSize = WIN_SetWindowSize;
-    device->ShowWindow = WIN_ShowWindow;
-    device->HideWindow = WIN_HideWindow;
-    device->RaiseWindow = WIN_RaiseWindow;
-    device->MaximizeWindow = WIN_MaximizeWindow;
-    device->MinimizeWindow = WIN_MinimizeWindow;
-    device->RestoreWindow = WIN_RestoreWindow;
-    device->SetWindowBordered = WIN_SetWindowBordered;
-    device->SetWindowFullscreen = WIN_SetWindowFullscreen;
-    device->SetWindowGammaRamp = WIN_SetWindowGammaRamp;
-    device->GetWindowGammaRamp = WIN_GetWindowGammaRamp;
-    device->SetWindowGrab = WIN_SetWindowGrab;
-    device->DestroyWindow = WIN_DestroyWindow;
-    device->GetWindowWMInfo = WIN_GetWindowWMInfo;
-    device->CreateWindowFramebuffer = WIN_CreateWindowFramebuffer;
-    device->UpdateWindowFramebuffer = WIN_UpdateWindowFramebuffer;
-    device->DestroyWindowFramebuffer = WIN_DestroyWindowFramebuffer;
-    device->OnWindowEnter = WIN_OnWindowEnter;
-
-    device->shape_driver.CreateShaper = Win32_CreateShaper;
-    device->shape_driver.SetWindowShape = Win32_SetWindowShape;
-    device->shape_driver.ResizeWindowShape = Win32_ResizeWindowShape;
-
-#if SDL_VIDEO_OPENGL_WGL
-    device->GL_LoadLibrary = WIN_GL_LoadLibrary;
-    device->GL_GetProcAddress = WIN_GL_GetProcAddress;
-    device->GL_UnloadLibrary = WIN_GL_UnloadLibrary;
-    device->GL_CreateContext = WIN_GL_CreateContext;
-    device->GL_MakeCurrent = WIN_GL_MakeCurrent;
-    device->GL_SetSwapInterval = WIN_GL_SetSwapInterval;
-    device->GL_GetSwapInterval = WIN_GL_GetSwapInterval;
-    device->GL_SwapWindow = WIN_GL_SwapWindow;
-    device->GL_DeleteContext = WIN_GL_DeleteContext;
-#endif
-    device->StartTextInput = WIN_StartTextInput;
-    device->StopTextInput = WIN_StopTextInput;
-    device->SetTextInputRect = WIN_SetTextInputRect;
-
-    device->SetClipboardText = WIN_SetClipboardText;
-    device->GetClipboardText = WIN_GetClipboardText;
-    device->HasClipboardText = WIN_HasClipboardText;
-
-    device->free = WIN_DeleteDevice;
-
-    return device;
-}
-
-VideoBootStrap WINDOWS_bootstrap = {
-    "windows", "SDL Windows video driver", WIN_Available, WIN_CreateDevice
-};
-
-int
-WIN_VideoInit(_THIS)
-{
-    if (WIN_InitModes(_this) < 0) {
-        return -1;
-    }
-
-    WIN_InitKeyboard(_this);
-    WIN_InitMouse(_this);
-
-    return 0;
-}
-
-void
-WIN_VideoQuit(_THIS)
-{
-    WIN_QuitModes(_this);
-    WIN_QuitKeyboard(_this);
-    WIN_QuitMouse(_this);
-}
-
-
-#define D3D_DEBUG_INFO
-#include <d3d9.h>
-
-SDL_bool 
-D3D_LoadDLL( void **pD3DDLL, IDirect3D9 **pDirect3D9Interface )
-{
-	*pD3DDLL = SDL_LoadObject("D3D9.DLL");
-	if (*pD3DDLL) {
-		IDirect3D9 *(WINAPI * D3DCreate) (UINT SDKVersion);
-
-		D3DCreate =
-			(IDirect3D9 * (WINAPI *) (UINT)) SDL_LoadFunction(*pD3DDLL,
-			"Direct3DCreate9");
-		if (D3DCreate) {
-			*pDirect3D9Interface = D3DCreate(D3D_SDK_VERSION);
-		}
-		if (!*pDirect3D9Interface) {
-			SDL_UnloadObject(*pD3DDLL);
-			*pD3DDLL = NULL;
-			return SDL_FALSE;
-		}
-
-		return SDL_TRUE;
-	} else {
-		*pDirect3D9Interface = NULL;
-		return SDL_FALSE;
-	}
-}
-
-
-int
-SDL_Direct3D9GetAdapterIndex( int displayIndex )
-{
-	void *pD3DDLL;
-	IDirect3D9 *pD3D;
-	if (!D3D_LoadDLL(&pD3DDLL, &pD3D)) {
-		SDL_SetError("Unable to create Direct3D interface");
-		return D3DADAPTER_DEFAULT;
-	} else {
-		SDL_DisplayData *pData = (SDL_DisplayData *)SDL_GetDisplayDriverData(displayIndex);
-		int adapterIndex = D3DADAPTER_DEFAULT;
-
-		if (!pData) {
-			SDL_SetError("Invalid display index");
-			adapterIndex = -1; /* make sure we return something invalid */
-		} else {
-			char *displayName = WIN_StringToUTF8(pData->DeviceName);
-			unsigned int count = IDirect3D9_GetAdapterCount(pD3D);
-			unsigned int i;
-			for (i=0; i<count; i++) {
-				D3DADAPTER_IDENTIFIER9 id;
-				IDirect3D9_GetAdapterIdentifier(pD3D, i, 0, &id);
-
-				if (SDL_strcmp(id.DeviceName, displayName) == 0) {
-					adapterIndex = i;
-					break;
-				}
-			}
-			SDL_free(displayName);
-		}
-
-		/* free up the D3D stuff we inited */
-		IDirect3D9_Release(pD3D);
-		SDL_UnloadObject(pD3DDLL);
-
-		return adapterIndex;
-	}
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vim: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowsvideo.h b/deps/SDL2/src/video/windows/SDL_windowsvideo.h
deleted file mode 100644
index ff2b4a2..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowsvideo.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_windowsvideo_h
-#define _SDL_windowsvideo_h
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "../SDL_sysvideo.h"
-
-#if defined(_MSC_VER)
-#include <msctf.h>
-#else
-#include "SDL_msctf.h"
-#endif
-
-#include <imm.h>
-
-#define MAX_CANDLIST    10
-#define MAX_CANDLENGTH  256
-
-#include "SDL_windowsclipboard.h"
-#include "SDL_windowsevents.h"
-#include "SDL_windowskeyboard.h"
-#include "SDL_windowsmodes.h"
-#include "SDL_windowsmouse.h"
-#include "SDL_windowsopengl.h"
-#include "SDL_windowswindow.h"
-#include "SDL_events.h"
-#include "SDL_loadso.h"
-
-
-#if WINVER < 0x0601
-/* Touch input definitions */
-#define TWF_FINETOUCH   1
-#define TWF_WANTPALM    2
-
-#define TOUCHEVENTF_MOVE 0x0001
-#define TOUCHEVENTF_DOWN 0x0002
-#define TOUCHEVENTF_UP   0x0004
-
-DECLARE_HANDLE(HTOUCHINPUT);
-
-typedef struct _TOUCHINPUT {
-    LONG      x;
-    LONG      y;
-    HANDLE    hSource;
-    DWORD     dwID;
-    DWORD     dwFlags;
-    DWORD     dwMask;
-    DWORD     dwTime;
-    ULONG_PTR dwExtraInfo;
-    DWORD     cxContact;
-    DWORD     cyContact;
-} TOUCHINPUT, *PTOUCHINPUT;
-
-#endif /* WINVER < 0x0601 */
-
-typedef BOOL  (*PFNSHFullScreen)(HWND, DWORD);
-typedef void  (*PFCoordTransform)(SDL_Window*, POINT*);
-
-typedef struct
-{
-    void **lpVtbl;
-    int refcount;
-    void *data;
-} TSFSink;
-
-/* Definition from Win98DDK version of IMM.H */
-typedef struct tagINPUTCONTEXT2 {
-    HWND hWnd;
-    BOOL fOpen;
-    POINT ptStatusWndPos;
-    POINT ptSoftKbdPos;
-    DWORD fdwConversion;
-    DWORD fdwSentence;
-    union {
-        LOGFONTA A;
-        LOGFONTW W;
-    } lfFont;
-    COMPOSITIONFORM cfCompForm;
-    CANDIDATEFORM cfCandForm[4];
-    HIMCC hCompStr;
-    HIMCC hCandInfo;
-    HIMCC hGuideLine;
-    HIMCC hPrivate;
-    DWORD dwNumMsgBuf;
-    HIMCC hMsgBuf;
-    DWORD fdwInit;
-    DWORD dwReserve[3];
-} INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;
-
-/* Private display data */
-
-typedef struct SDL_VideoData
-{
-    int render;
-
-    DWORD clipboard_count;
-
-    /* Touch input functions */
-    void* userDLL;
-    BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT );
-    BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int );
-    BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG );
-
-    SDL_bool ime_com_initialized;
-    struct ITfThreadMgr *ime_threadmgr;
-    SDL_bool ime_initialized;
-    SDL_bool ime_enabled;
-    SDL_bool ime_available;
-    HWND ime_hwnd_main;
-    HWND ime_hwnd_current;
-    HIMC ime_himc;
-
-    WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
-    WCHAR ime_readingstring[16];
-    int ime_cursor;
-
-    SDL_bool ime_candlist;
-    WCHAR ime_candidates[MAX_CANDLIST][MAX_CANDLENGTH];
-    DWORD ime_candcount;
-    DWORD ime_candref;
-    DWORD ime_candsel;
-    UINT ime_candpgsize;
-    int ime_candlistindexbase;
-    SDL_bool ime_candvertical;
-
-    SDL_bool ime_dirty;
-    SDL_Rect ime_rect;
-    SDL_Rect ime_candlistrect;
-    int ime_winwidth;
-    int ime_winheight;
-
-    HKL ime_hkl;
-    void* ime_himm32;
-    UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
-    BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
-    LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
-    BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
-    LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
-    BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
-
-    SDL_bool ime_uiless;
-    struct ITfThreadMgrEx *ime_threadmgrex;
-    DWORD ime_uielemsinkcookie;
-    DWORD ime_alpnsinkcookie;
-    DWORD ime_openmodesinkcookie;
-    DWORD ime_convmodesinkcookie;
-    TSFSink *ime_uielemsink;
-    TSFSink *ime_ippasink;
-} SDL_VideoData;
-
-
-typedef struct IDirect3D9 IDirect3D9;
-extern SDL_bool D3D_LoadDLL( void **pD3DDLL, IDirect3D9 **pDirect3D9Interface );
-
-#endif /* _SDL_windowsvideo_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowswindow.c b/deps/SDL2/src/video/windows/SDL_windowswindow.c
deleted file mode 100644
index cd53975..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowswindow.c
+++ /dev/null
@@ -1,693 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_WINDOWS
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_assert.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_keyboard_c.h"
-
-#include "SDL_windowsvideo.h"
-#include "SDL_windowswindow.h"
-
-/* Dropfile support */
-#include <shellapi.h>
-
-/* This is included after SDL_windowsvideo.h, which includes windows.h */
-#include "SDL_syswm.h"
-
-/* Windows CE compatibility */
-#ifndef SWP_NOCOPYBITS
-#define SWP_NOCOPYBITS 0
-#endif
-
-/* Fake window to help with DirectInput events. */
-HWND SDL_HelperWindow = NULL;
-static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher");
-static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow");
-static ATOM SDL_HelperWindowClass = 0;
-
-#define STYLE_BASIC         (WS_CLIPSIBLINGS | WS_CLIPCHILDREN)
-#define STYLE_FULLSCREEN    (WS_POPUP)
-#define STYLE_BORDERLESS    (WS_POPUP)
-#define STYLE_NORMAL        (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
-#define STYLE_RESIZABLE     (WS_THICKFRAME | WS_MAXIMIZEBOX)
-#define STYLE_MASK          (STYLE_FULLSCREEN | STYLE_BORDERLESS | STYLE_NORMAL | STYLE_RESIZABLE)
-
-static DWORD
-GetWindowStyle(SDL_Window * window)
-{
-    DWORD style = 0;
-
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        style |= STYLE_FULLSCREEN;
-    } else {
-        if (window->flags & SDL_WINDOW_BORDERLESS) {
-            style |= STYLE_BORDERLESS;
-        } else {
-            style |= STYLE_NORMAL;
-        }
-        if (window->flags & SDL_WINDOW_RESIZABLE) {
-            style |= STYLE_RESIZABLE;
-        }
-    }
-    return style;
-}
-
-static void
-WIN_SetWindowPositionInternal(_THIS, SDL_Window * window, UINT flags)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    RECT rect;
-    DWORD style;
-    HWND top;
-    BOOL menu;
-    int x, y;
-    int w, h;
-
-    /* Figure out what the window area will be */
-    if (SDL_ShouldAllowTopmost() && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) {
-        top = HWND_TOPMOST;
-    } else {
-        top = HWND_NOTOPMOST;
-    }
-    style = GetWindowLong(hwnd, GWL_STYLE);
-    rect.left = 0;
-    rect.top = 0;
-    rect.right = window->w;
-    rect.bottom = window->h;
-    menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
-    AdjustWindowRectEx(&rect, style, menu, 0);
-    w = (rect.right - rect.left);
-    h = (rect.bottom - rect.top);
-    x = window->x + rect.left;
-    y = window->y + rect.top;
-
-    SetWindowPos(hwnd, top, x, y, w, h, flags);
-}
-
-static int
-SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-    SDL_WindowData *data;
-
-    /* Allocate the window data */
-    data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        return SDL_OutOfMemory();
-    }
-    data->window = window;
-    data->hwnd = hwnd;
-    data->hdc = GetDC(hwnd);
-    data->created = created;
-    data->mouse_button_flags = 0;
-    data->videodata = videodata;
-
-    window->driverdata = data;
-
-    /* Associate the data with the window */
-    if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) {
-        ReleaseDC(hwnd, data->hdc);
-        SDL_free(data);
-        return WIN_SetError("SetProp() failed");
-    }
-
-    /* Set up the window proc function */
-#ifdef GWLP_WNDPROC
-    data->wndproc = (WNDPROC) GetWindowLongPtr(hwnd, GWLP_WNDPROC);
-    if (data->wndproc == WIN_WindowProc) {
-        data->wndproc = NULL;
-    } else {
-        SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) WIN_WindowProc);
-    }
-#else
-    data->wndproc = (WNDPROC) GetWindowLong(hwnd, GWL_WNDPROC);
-    if (data->wndproc == WIN_WindowProc) {
-        data->wndproc = NULL;
-    } else {
-        SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR) WIN_WindowProc);
-    }
-#endif
-
-    /* Fill in the SDL window with the window data */
-    {
-        RECT rect;
-        if (GetClientRect(hwnd, &rect)) {
-            int w = rect.right;
-            int h = rect.bottom;
-            if ((window->w && window->w != w) || (window->h && window->h != h)) {
-                /* We tried to create a window larger than the desktop and Windows didn't allow it.  Override! */
-                WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE);
-            } else {
-                window->w = w;
-                window->h = h;
-            }
-        }
-    }
-    {
-        POINT point;
-        point.x = 0;
-        point.y = 0;
-        if (ClientToScreen(hwnd, &point)) {
-            window->x = point.x;
-            window->y = point.y;
-        }
-    }
-    {
-        DWORD style = GetWindowLong(hwnd, GWL_STYLE);
-        if (style & WS_VISIBLE) {
-            window->flags |= SDL_WINDOW_SHOWN;
-        } else {
-            window->flags &= ~SDL_WINDOW_SHOWN;
-        }
-        if (style & (WS_BORDER | WS_THICKFRAME)) {
-            window->flags &= ~SDL_WINDOW_BORDERLESS;
-        } else {
-            window->flags |= SDL_WINDOW_BORDERLESS;
-        }
-        if (style & WS_THICKFRAME) {
-            window->flags |= SDL_WINDOW_RESIZABLE;
-        } else {
-            window->flags &= ~SDL_WINDOW_RESIZABLE;
-        }
-#ifdef WS_MAXIMIZE
-        if (style & WS_MAXIMIZE) {
-            window->flags |= SDL_WINDOW_MAXIMIZED;
-        } else
-#endif
-        {
-            window->flags &= ~SDL_WINDOW_MAXIMIZED;
-        }
-#ifdef WS_MINIMIZE
-        if (style & WS_MINIMIZE) {
-            window->flags |= SDL_WINDOW_MINIMIZED;
-        } else
-#endif
-        {
-            window->flags &= ~SDL_WINDOW_MINIMIZED;
-        }
-    }
-    if (GetFocus() == hwnd) {
-        window->flags |= SDL_WINDOW_INPUT_FOCUS;
-        SDL_SetKeyboardFocus(data->window);
-
-        if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
-            RECT rect;
-            GetClientRect(hwnd, &rect);
-            ClientToScreen(hwnd, (LPPOINT) & rect);
-            ClientToScreen(hwnd, (LPPOINT) & rect + 1);
-            ClipCursor(&rect);
-        }
-    }
-
-    /* Enable multi-touch */
-    if (videodata->RegisterTouchWindow) {
-        videodata->RegisterTouchWindow(hwnd, (TWF_FINETOUCH|TWF_WANTPALM));
-    }
-
-    /* Enable dropping files */
-    DragAcceptFiles(hwnd, TRUE);
-
-    /* All done! */
-    return 0;
-}
-
-int
-WIN_CreateWindow(_THIS, SDL_Window * window)
-{
-    HWND hwnd;
-    RECT rect;
-    DWORD style = STYLE_BASIC;
-    int x, y;
-    int w, h;
-
-    style |= GetWindowStyle(window);
-
-    /* Figure out what the window area will be */
-    rect.left = window->x;
-    rect.top = window->y;
-    rect.right = window->x + window->w;
-    rect.bottom = window->y + window->h;
-    AdjustWindowRectEx(&rect, style, FALSE, 0);
-    x = rect.left;
-    y = rect.top;
-    w = (rect.right - rect.left);
-    h = (rect.bottom - rect.top);
-
-    hwnd =
-        CreateWindow(SDL_Appname, TEXT(""), style, x, y, w, h, NULL, NULL,
-                     SDL_Instance, NULL);
-    if (!hwnd) {
-        return WIN_SetError("Couldn't create window");
-    }
-
-    WIN_PumpEvents(_this);
-
-    if (SetupWindowData(_this, window, hwnd, SDL_TRUE) < 0) {
-        DestroyWindow(hwnd);
-        return -1;
-    }
-#if SDL_VIDEO_OPENGL_WGL
-    if (window->flags & SDL_WINDOW_OPENGL) {
-        if (WIN_GL_SetupWindow(_this, window) < 0) {
-            WIN_DestroyWindow(_this, window);
-            return -1;
-        }
-    }
-#endif
-    return 0;
-}
-
-int
-WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
-{
-    HWND hwnd = (HWND) data;
-    LPTSTR title;
-    int titleLen;
-
-    /* Query the title from the existing window */
-    titleLen = GetWindowTextLength(hwnd);
-    title = SDL_stack_alloc(TCHAR, titleLen + 1);
-    if (title) {
-        titleLen = GetWindowText(hwnd, title, titleLen);
-    } else {
-        titleLen = 0;
-    }
-    if (titleLen > 0) {
-        window->title = WIN_StringToUTF8(title);
-    }
-    if (title) {
-        SDL_stack_free(title);
-    }
-
-    if (SetupWindowData(_this, window, hwnd, SDL_FALSE) < 0) {
-        return -1;
-    }
-    return 0;
-}
-
-void
-WIN_SetWindowTitle(_THIS, SDL_Window * window)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    LPTSTR title;
-
-    if (window->title) {
-        title = WIN_UTF8ToString(window->title);
-    } else {
-        title = NULL;
-    }
-    SetWindowText(hwnd, title ? title : TEXT(""));
-    SDL_free(title);
-}
-
-void
-WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    HICON hicon = NULL;
-    BYTE *icon_bmp;
-    int icon_len, y;
-    SDL_RWops *dst;
-
-    /* Create temporary bitmap buffer */
-    icon_len = 40 + icon->h * icon->w * 4;
-    icon_bmp = SDL_stack_alloc(BYTE, icon_len);
-    dst = SDL_RWFromMem(icon_bmp, icon_len);
-    if (!dst) {
-        SDL_stack_free(icon_bmp);
-        return;
-    }
-
-    /* Write the BITMAPINFO header */
-    SDL_WriteLE32(dst, 40);
-    SDL_WriteLE32(dst, icon->w);
-    SDL_WriteLE32(dst, icon->h * 2);
-    SDL_WriteLE16(dst, 1);
-    SDL_WriteLE16(dst, 32);
-    SDL_WriteLE32(dst, BI_RGB);
-    SDL_WriteLE32(dst, icon->h * icon->w * 4);
-    SDL_WriteLE32(dst, 0);
-    SDL_WriteLE32(dst, 0);
-    SDL_WriteLE32(dst, 0);
-    SDL_WriteLE32(dst, 0);
-
-    /* Write the pixels upside down into the bitmap buffer */
-    SDL_assert(icon->format->format == SDL_PIXELFORMAT_ARGB8888);
-    y = icon->h;
-    while (y--) {
-        Uint8 *src = (Uint8 *) icon->pixels + y * icon->pitch;
-        SDL_RWwrite(dst, src, icon->pitch, 1);
-    }
-
-    hicon = CreateIconFromResource(icon_bmp, icon_len, TRUE, 0x00030000);
-
-    SDL_RWclose(dst);
-    SDL_stack_free(icon_bmp);
-
-    /* Set the icon for the window */
-    SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) hicon);
-
-    /* Set the icon in the task manager (should we do this?) */
-    SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) hicon);
-}
-
-void
-WIN_SetWindowPosition(_THIS, SDL_Window * window)
-{
-    WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOSIZE | SWP_NOACTIVATE);
-}
-
-void
-WIN_SetWindowSize(_THIS, SDL_Window * window)
-{
-    WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOACTIVATE);
-}
-
-void
-WIN_ShowWindow(_THIS, SDL_Window * window)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    ShowWindow(hwnd, SW_SHOW);
-}
-
-void
-WIN_HideWindow(_THIS, SDL_Window * window)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    ShowWindow(hwnd, SW_HIDE);
-}
-
-void
-WIN_RaiseWindow(_THIS, SDL_Window * window)
-{
-    WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE);
-
-    /* Raising the window while alt-tabbed can cause it to be minimized for some reason? */
-    WIN_RestoreWindow(_this, window);
-}
-
-void
-WIN_MaximizeWindow(_THIS, SDL_Window * window)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    ShowWindow(hwnd, SW_MAXIMIZE);
-}
-
-void
-WIN_MinimizeWindow(_THIS, SDL_Window * window)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    ShowWindow(hwnd, SW_MINIMIZE);
-}
-
-void
-WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    DWORD style = GetWindowLong(hwnd, GWL_STYLE);
-
-    if (bordered) {
-        style &= ~STYLE_BORDERLESS;
-        style |= STYLE_NORMAL;
-    } else {
-        style &= ~STYLE_NORMAL;
-        style |= STYLE_BORDERLESS;
-    }
-
-    SetWindowLong(hwnd, GWL_STYLE, style);
-    WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_NOREPOSITION | SWP_NOZORDER |SWP_NOACTIVATE | SWP_NOSENDCHANGING);
-}
-
-void
-WIN_RestoreWindow(_THIS, SDL_Window * window)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-
-    ShowWindow(hwnd, SW_RESTORE);
-}
-
-void
-WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    HWND hwnd = data->hwnd;
-    RECT rect;
-    SDL_Rect bounds;
-    DWORD style;
-    HWND top;
-    BOOL menu;
-    int x, y;
-    int w, h;
-
-    if (SDL_ShouldAllowTopmost() && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) {
-        top = HWND_TOPMOST;
-    } else {
-        top = HWND_NOTOPMOST;
-    }
-
-    style = GetWindowLong(hwnd, GWL_STYLE);
-    style &= ~STYLE_MASK;
-    style |= GetWindowStyle(window);
-
-    WIN_GetDisplayBounds(_this, display, &bounds);
-
-    if (fullscreen) {
-        x = bounds.x;
-        y = bounds.y;
-        w = bounds.w;
-        h = bounds.h;
-    } else {
-        rect.left = 0;
-        rect.top = 0;
-        rect.right = window->windowed.w;
-        rect.bottom = window->windowed.h;
-        menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
-        AdjustWindowRectEx(&rect, style, menu, 0);
-        w = (rect.right - rect.left);
-        h = (rect.bottom - rect.top);
-        x = window->windowed.x + rect.left;
-        y = window->windowed.y + rect.top;
-    }
-    SetWindowLong(hwnd, GWL_STYLE, style);
-    SetWindowPos(hwnd, top, x, y, w, h, SWP_NOCOPYBITS);
-}
-
-int
-WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
-{
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
-    HDC hdc;
-    BOOL succeeded = FALSE;
-
-    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
-    if (hdc) {
-        succeeded = SetDeviceGammaRamp(hdc, (LPVOID)ramp);
-        if (!succeeded) {
-            WIN_SetError("SetDeviceGammaRamp()");
-        }
-        DeleteDC(hdc);
-    }
-    return succeeded ? 0 : -1;
-}
-
-int
-WIN_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp)
-{
-    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
-    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
-    HDC hdc;
-    BOOL succeeded = FALSE;
-
-    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
-    if (hdc) {
-        succeeded = GetDeviceGammaRamp(hdc, (LPVOID)ramp);
-        if (!succeeded) {
-            WIN_SetError("GetDeviceGammaRamp()");
-        }
-        DeleteDC(hdc);
-    }
-    return succeeded ? 0 : -1;
-}
-
-void
-WIN_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-
-    if (grabbed) {
-        RECT rect;
-        GetClientRect(hwnd, &rect);
-        ClientToScreen(hwnd, (LPPOINT) & rect);
-        ClientToScreen(hwnd, (LPPOINT) & rect + 1);
-        ClipCursor(&rect);
-    } else {
-        ClipCursor(NULL);
-    }
-
-    if (window->flags & SDL_WINDOW_FULLSCREEN) {
-        UINT flags = SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE;
-
-        if (!(window->flags & SDL_WINDOW_SHOWN)) {
-            flags |= SWP_NOACTIVATE;
-        }
-        WIN_SetWindowPositionInternal(_this, window, flags);
-    }
-}
-
-void
-WIN_DestroyWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-
-    if (data) {
-        ReleaseDC(data->hwnd, data->hdc);
-        if (data->created) {
-            DestroyWindow(data->hwnd);
-        } else {
-            /* Restore any original event handler... */
-            if (data->wndproc != NULL) {
-#ifdef GWLP_WNDPROC
-                SetWindowLongPtr(data->hwnd, GWLP_WNDPROC,
-                                 (LONG_PTR) data->wndproc);
-#else
-                SetWindowLong(data->hwnd, GWL_WNDPROC,
-                              (LONG_PTR) data->wndproc);
-#endif
-            }
-        }
-        SDL_free(data);
-    }
-}
-
-SDL_bool
-WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
-{
-    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-    if (info->version.major <= SDL_MAJOR_VERSION) {
-        info->subsystem = SDL_SYSWM_WINDOWS;
-        info->info.win.window = hwnd;
-        return SDL_TRUE;
-    } else {
-        SDL_SetError("Application not compiled with SDL %d.%d\n",
-                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
-        return SDL_FALSE;
-    }
-}
-
-
-/*
- * Creates a HelperWindow used for DirectInput events.
- */
-int
-SDL_HelperWindowCreate(void)
-{
-    HINSTANCE hInstance = GetModuleHandle(NULL);
-    WNDCLASS wce;
-
-    /* Make sure window isn't created twice. */
-    if (SDL_HelperWindow != NULL) {
-        return 0;
-    }
-
-    /* Create the class. */
-    SDL_zero(wce);
-    wce.lpfnWndProc = DefWindowProc;
-    wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
-    wce.hInstance = hInstance;
-
-    /* Register the class. */
-    SDL_HelperWindowClass = RegisterClass(&wce);
-    if (SDL_HelperWindowClass == 0) {
-        return WIN_SetError("Unable to create Helper Window Class");
-    }
-
-    /* Create the window. */
-    SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName,
-                                      SDL_HelperWindowName,
-                                      WS_OVERLAPPED, CW_USEDEFAULT,
-                                      CW_USEDEFAULT, CW_USEDEFAULT,
-                                      CW_USEDEFAULT, HWND_MESSAGE, NULL,
-                                      hInstance, NULL);
-    if (SDL_HelperWindow == NULL) {
-        UnregisterClass(SDL_HelperWindowClassName, hInstance);
-        return WIN_SetError("Unable to create Helper Window");
-    }
-
-    return 0;
-}
-
-
-/*
- * Destroys the HelperWindow previously created with SDL_HelperWindowCreate.
- */
-void
-SDL_HelperWindowDestroy(void)
-{
-    HINSTANCE hInstance = GetModuleHandle(NULL);
-
-    /* Destroy the window. */
-    if (SDL_HelperWindow != NULL) {
-        if (DestroyWindow(SDL_HelperWindow) == 0) {
-            WIN_SetError("Unable to destroy Helper Window");
-            return;
-        }
-        SDL_HelperWindow = NULL;
-    }
-
-    /* Unregister the class. */
-    if (SDL_HelperWindowClass != 0) {
-        if ((UnregisterClass(SDL_HelperWindowClassName, hInstance)) == 0) {
-            WIN_SetError("Unable to destroy Helper Window Class");
-            return;
-        }
-        SDL_HelperWindowClass = 0;
-    }
-}
-
-void WIN_OnWindowEnter(_THIS, SDL_Window * window)
-{
-#ifdef WM_MOUSELEAVE
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    TRACKMOUSEEVENT trackMouseEvent;
-
-    if (!data || !data->hwnd) {
-        /* The window wasn't fully initialized */
-        return;
-    }
-
-    trackMouseEvent.cbSize = sizeof(TRACKMOUSEEVENT);
-    trackMouseEvent.dwFlags = TME_LEAVE;
-    trackMouseEvent.hwndTrack = data->hwnd;
-
-    TrackMouseEvent(&trackMouseEvent);
-#endif /* WM_MOUSELEAVE */
-}
-
-#endif /* SDL_VIDEO_DRIVER_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/SDL_windowswindow.h b/deps/SDL2/src/video/windows/SDL_windowswindow.h
deleted file mode 100644
index e85c201..0000000
--- a/deps/SDL2/src/video/windows/SDL_windowswindow.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_windowswindow_h
-#define _SDL_windowswindow_h
-
-typedef struct
-{
-    SDL_Window *window;
-    HWND hwnd;
-    HDC hdc;
-    HDC mdc;
-    HBITMAP hbm;
-    WNDPROC wndproc;
-    SDL_bool created;
-    WPARAM mouse_button_flags;
-    struct SDL_VideoData *videodata;
-} SDL_WindowData;
-
-extern int WIN_CreateWindow(_THIS, SDL_Window * window);
-extern int WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
-extern void WIN_SetWindowTitle(_THIS, SDL_Window * window);
-extern void WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
-extern void WIN_SetWindowPosition(_THIS, SDL_Window * window);
-extern void WIN_SetWindowSize(_THIS, SDL_Window * window);
-extern void WIN_ShowWindow(_THIS, SDL_Window * window);
-extern void WIN_HideWindow(_THIS, SDL_Window * window);
-extern void WIN_RaiseWindow(_THIS, SDL_Window * window);
-extern void WIN_MaximizeWindow(_THIS, SDL_Window * window);
-extern void WIN_MinimizeWindow(_THIS, SDL_Window * window);
-extern void WIN_RestoreWindow(_THIS, SDL_Window * window);
-extern void WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
-extern void WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
-extern int WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
-extern int WIN_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp);
-extern void WIN_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
-extern void WIN_DestroyWindow(_THIS, SDL_Window * window);
-extern SDL_bool WIN_GetWindowWMInfo(_THIS, SDL_Window * window,
-                                    struct SDL_SysWMinfo *info);
-extern void WIN_OnWindowEnter(_THIS, SDL_Window * window);
-
-#endif /* _SDL_windowswindow_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/windows/wmmsg.h b/deps/SDL2/src/video/windows/wmmsg.h
deleted file mode 100644
index 2cc7a84..0000000
--- a/deps/SDL2/src/video/windows/wmmsg.h
+++ /dev/null
@@ -1,1032 +0,0 @@
-
-#define MAX_WMMSG   (sizeof(wmtab)/sizeof(wmtab[0]))
-
-char *wmtab[] = {
-    "WM_NULL",
-    "WM_CREATE",
-    "WM_DESTROY",
-    "WM_MOVE",
-    "UNKNOWN (4)",
-    "WM_SIZE",
-    "WM_ACTIVATE",
-    "WM_SETFOCUS",
-    "WM_KILLFOCUS",
-    "UNKNOWN (9)",
-    "WM_ENABLE",
-    "WM_SETREDRAW",
-    "WM_SETTEXT",
-    "WM_GETTEXT",
-    "WM_GETTEXTLENGTH",
-    "WM_PAINT",
-    "WM_CLOSE",
-    "WM_QUERYENDSESSION",
-    "WM_QUIT",
-    "WM_QUERYOPEN",
-    "WM_ERASEBKGND",
-    "WM_SYSCOLORCHANGE",
-    "WM_ENDSESSION",
-    "UNKNOWN (23)",
-    "WM_SHOWWINDOW",
-    "UNKNOWN (25)",
-    "WM_SETTINGCHANGE",
-    "WM_DEVMODECHANGE",
-    "WM_ACTIVATEAPP",
-    "WM_FONTCHANGE",
-    "WM_TIMECHANGE",
-    "WM_CANCELMODE",
-    "WM_SETCURSOR",
-    "WM_MOUSEACTIVATE",
-    "WM_CHILDACTIVATE",
-    "WM_QUEUESYNC",
-    "WM_GETMINMAXINFO",
-    "UNKNOWN (37)",
-    "WM_PAINTICON",
-    "WM_ICONERASEBKGND",
-    "WM_NEXTDLGCTL",
-    "UNKNOWN (41)",
-    "WM_SPOOLERSTATUS",
-    "WM_DRAWITEM",
-    "WM_MEASUREITEM",
-    "WM_DELETEITEM",
-    "WM_VKEYTOITEM",
-    "WM_CHARTOITEM",
-    "WM_SETFONT",
-    "WM_GETFONT",
-    "WM_SETHOTKEY",
-    "WM_GETHOTKEY",
-    "UNKNOWN (52)",
-    "UNKNOWN (53)",
-    "UNKNOWN (54)",
-    "WM_QUERYDRAGICON",
-    "UNKNOWN (56)",
-    "WM_COMPAREITEM",
-    "UNKNOWN (58)",
-    "UNKNOWN (59)",
-    "UNKNOWN (60)",
-    "WM_GETOBJECT",
-    "UNKNOWN (62)",
-    "UNKNOWN (63)",
-    "UNKNOWN (64)",
-    "WM_COMPACTING",
-    "UNKNOWN (66)",
-    "UNKNOWN (67)",
-    "WM_COMMNOTIFY",
-    "UNKNOWN (69)",
-    "WM_WINDOWPOSCHANGING",
-    "WM_WINDOWPOSCHANGED",
-    "WM_POWER",
-    "UNKNOWN (73)",
-    "WM_COPYDATA",
-    "WM_CANCELJOURNAL",
-    "UNKNOWN (76)",
-    "UNKNOWN (77)",
-    "WM_NOTIFY",
-    "UNKNOWN (79)",
-    "WM_INPUTLANGCHANGEREQUEST",
-    "WM_INPUTLANGCHANGE",
-    "WM_TCARD",
-    "WM_HELP",
-    "WM_USERCHANGED",
-    "WM_NOTIFYFORMAT",
-    "UNKNOWN (86)",
-    "UNKNOWN (87)",
-    "UNKNOWN (88)",
-    "UNKNOWN (89)",
-    "UNKNOWN (90)",
-    "UNKNOWN (91)",
-    "UNKNOWN (92)",
-    "UNKNOWN (93)",
-    "UNKNOWN (94)",
-    "UNKNOWN (95)",
-    "UNKNOWN (96)",
-    "UNKNOWN (97)",
-    "UNKNOWN (98)",
-    "UNKNOWN (99)",
-    "UNKNOWN (100)",
-    "UNKNOWN (101)",
-    "UNKNOWN (102)",
-    "UNKNOWN (103)",
-    "UNKNOWN (104)",
-    "UNKNOWN (105)",
-    "UNKNOWN (106)",
-    "UNKNOWN (107)",
-    "UNKNOWN (108)",
-    "UNKNOWN (109)",
-    "UNKNOWN (110)",
-    "UNKNOWN (111)",
-    "UNKNOWN (112)",
-    "UNKNOWN (113)",
-    "UNKNOWN (114)",
-    "UNKNOWN (115)",
-    "UNKNOWN (116)",
-    "UNKNOWN (117)",
-    "UNKNOWN (118)",
-    "UNKNOWN (119)",
-    "UNKNOWN (120)",
-    "UNKNOWN (121)",
-    "UNKNOWN (122)",
-    "WM_CONTEXTMENU",
-    "WM_STYLECHANGING",
-    "WM_STYLECHANGED",
-    "WM_DISPLAYCHANGE",
-    "WM_GETICON",
-    "WM_SETICON",
-    "WM_NCCREATE",
-    "WM_NCDESTROY",
-    "WM_NCCALCSIZE",
-    "WM_NCHITTEST",
-    "WM_NCPAINT",
-    "WM_NCACTIVATE",
-    "WM_GETDLGCODE",
-    "WM_SYNCPAINT",
-    "UNKNOWN (137)",
-    "UNKNOWN (138)",
-    "UNKNOWN (139)",
-    "UNKNOWN (140)",
-    "UNKNOWN (141)",
-    "UNKNOWN (142)",
-    "UNKNOWN (143)",
-    "UNKNOWN (144)",
-    "UNKNOWN (145)",
-    "UNKNOWN (146)",
-    "UNKNOWN (147)",
-    "UNKNOWN (148)",
-    "UNKNOWN (149)",
-    "UNKNOWN (150)",
-    "UNKNOWN (151)",
-    "UNKNOWN (152)",
-    "UNKNOWN (153)",
-    "UNKNOWN (154)",
-    "UNKNOWN (155)",
-    "UNKNOWN (156)",
-    "UNKNOWN (157)",
-    "UNKNOWN (158)",
-    "UNKNOWN (159)",
-    "WM_NCMOUSEMOVE",
-    "WM_NCLBUTTONDOWN",
-    "WM_NCLBUTTONUP",
-    "WM_NCLBUTTONDBLCLK",
-    "WM_NCRBUTTONDOWN",
-    "WM_NCRBUTTONUP",
-    "WM_NCRBUTTONDBLCLK",
-    "WM_NCMBUTTONDOWN",
-    "WM_NCMBUTTONUP",
-    "WM_NCMBUTTONDBLCLK",
-    "UNKNOWN (170)",
-    "UNKNOWN (171)",
-    "UNKNOWN (172)",
-    "UNKNOWN (173)",
-    "UNKNOWN (174)",
-    "UNKNOWN (175)",
-    "UNKNOWN (176)",
-    "UNKNOWN (177)",
-    "UNKNOWN (178)",
-    "UNKNOWN (179)",
-    "UNKNOWN (180)",
-    "UNKNOWN (181)",
-    "UNKNOWN (182)",
-    "UNKNOWN (183)",
-    "UNKNOWN (184)",
-    "UNKNOWN (185)",
-    "UNKNOWN (186)",
-    "UNKNOWN (187)",
-    "UNKNOWN (188)",
-    "UNKNOWN (189)",
-    "UNKNOWN (190)",
-    "UNKNOWN (191)",
-    "UNKNOWN (192)",
-    "UNKNOWN (193)",
-    "UNKNOWN (194)",
-    "UNKNOWN (195)",
-    "UNKNOWN (196)",
-    "UNKNOWN (197)",
-    "UNKNOWN (198)",
-    "UNKNOWN (199)",
-    "UNKNOWN (200)",
-    "UNKNOWN (201)",
-    "UNKNOWN (202)",
-    "UNKNOWN (203)",
-    "UNKNOWN (204)",
-    "UNKNOWN (205)",
-    "UNKNOWN (206)",
-    "UNKNOWN (207)",
-    "UNKNOWN (208)",
-    "UNKNOWN (209)",
-    "UNKNOWN (210)",
-    "UNKNOWN (211)",
-    "UNKNOWN (212)",
-    "UNKNOWN (213)",
-    "UNKNOWN (214)",
-    "UNKNOWN (215)",
-    "UNKNOWN (216)",
-    "UNKNOWN (217)",
-    "UNKNOWN (218)",
-    "UNKNOWN (219)",
-    "UNKNOWN (220)",
-    "UNKNOWN (221)",
-    "UNKNOWN (222)",
-    "UNKNOWN (223)",
-    "UNKNOWN (224)",
-    "UNKNOWN (225)",
-    "UNKNOWN (226)",
-    "UNKNOWN (227)",
-    "UNKNOWN (228)",
-    "UNKNOWN (229)",
-    "UNKNOWN (230)",
-    "UNKNOWN (231)",
-    "UNKNOWN (232)",
-    "UNKNOWN (233)",
-    "UNKNOWN (234)",
-    "UNKNOWN (235)",
-    "UNKNOWN (236)",
-    "UNKNOWN (237)",
-    "UNKNOWN (238)",
-    "UNKNOWN (239)",
-    "UNKNOWN (240)",
-    "UNKNOWN (241)",
-    "UNKNOWN (242)",
-    "UNKNOWN (243)",
-    "UNKNOWN (244)",
-    "UNKNOWN (245)",
-    "UNKNOWN (246)",
-    "UNKNOWN (247)",
-    "UNKNOWN (248)",
-    "UNKNOWN (249)",
-    "UNKNOWN (250)",
-    "UNKNOWN (251)",
-    "UNKNOWN (252)",
-    "UNKNOWN (253)",
-    "UNKNOWN (254)",
-    "UNKNOWN (255)",
-    "WM_KEYDOWN",
-    "WM_KEYUP",
-    "WM_CHAR",
-    "WM_DEADCHAR",
-    "WM_SYSKEYDOWN",
-    "WM_SYSKEYUP",
-    "WM_SYSCHAR",
-    "WM_SYSDEADCHAR",
-    "WM_KEYLAST",
-    "UNKNOWN (265)",
-    "UNKNOWN (266)",
-    "UNKNOWN (267)",
-    "UNKNOWN (268)",
-    "UNKNOWN (269)",
-    "UNKNOWN (270)",
-    "UNKNOWN (271)",
-    "WM_INITDIALOG",
-    "WM_COMMAND",
-    "WM_SYSCOMMAND",
-    "WM_TIMER",
-    "WM_HSCROLL",
-    "WM_VSCROLL",
-    "WM_INITMENU",
-    "WM_INITMENUPOPUP",
-    "UNKNOWN (280)",
-    "WM_GESTURE",
-    "UNKNOWN (282)",
-    "UNKNOWN (283)",
-    "UNKNOWN (284)",
-    "UNKNOWN (285)",
-    "UNKNOWN (286)",
-    "WM_MENUSELECT",
-    "WM_MENUCHAR",
-    "WM_ENTERIDLE",
-    "WM_MENURBUTTONUP",
-    "WM_MENUDRAG",
-    "WM_MENUGETOBJECT",
-    "WM_UNINITMENUPOPUP",
-    "WM_MENUCOMMAND",
-    "UNKNOWN (295)",
-    "UNKNOWN (296)",
-    "UNKNOWN (297)",
-    "UNKNOWN (298)",
-    "UNKNOWN (299)",
-    "UNKNOWN (300)",
-    "UNKNOWN (301)",
-    "UNKNOWN (302)",
-    "UNKNOWN (303)",
-    "UNKNOWN (304)",
-    "UNKNOWN (305)",
-    "WM_CTLCOLORMSGBOX",
-    "WM_CTLCOLOREDIT",
-    "WM_CTLCOLORLISTBOX",
-    "WM_CTLCOLORBTN",
-    "WM_CTLCOLORDLG",
-    "WM_CTLCOLORSCROLLBAR",
-    "WM_CTLCOLORSTATIC",
-    "UNKNOWN (313)",
-    "UNKNOWN (314)",
-    "UNKNOWN (315)",
-    "UNKNOWN (316)",
-    "UNKNOWN (317)",
-    "UNKNOWN (318)",
-    "UNKNOWN (319)",
-    "UNKNOWN (320)",
-    "UNKNOWN (321)",
-    "UNKNOWN (322)",
-    "UNKNOWN (323)",
-    "UNKNOWN (324)",
-    "UNKNOWN (325)",
-    "UNKNOWN (326)",
-    "UNKNOWN (327)",
-    "UNKNOWN (328)",
-    "UNKNOWN (329)",
-    "UNKNOWN (330)",
-    "UNKNOWN (331)",
-    "UNKNOWN (332)",
-    "UNKNOWN (333)",
-    "UNKNOWN (334)",
-    "UNKNOWN (335)",
-    "UNKNOWN (336)",
-    "UNKNOWN (337)",
-    "UNKNOWN (338)",
-    "UNKNOWN (339)",
-    "UNKNOWN (340)",
-    "UNKNOWN (341)",
-    "UNKNOWN (342)",
-    "UNKNOWN (343)",
-    "UNKNOWN (344)",
-    "UNKNOWN (345)",
-    "UNKNOWN (346)",
-    "UNKNOWN (347)",
-    "UNKNOWN (348)",
-    "UNKNOWN (349)",
-    "UNKNOWN (350)",
-    "UNKNOWN (351)",
-    "UNKNOWN (352)",
-    "UNKNOWN (353)",
-    "UNKNOWN (354)",
-    "UNKNOWN (355)",
-    "UNKNOWN (356)",
-    "UNKNOWN (357)",
-    "UNKNOWN (358)",
-    "UNKNOWN (359)",
-    "UNKNOWN (360)",
-    "UNKNOWN (361)",
-    "UNKNOWN (362)",
-    "UNKNOWN (363)",
-    "UNKNOWN (364)",
-    "UNKNOWN (365)",
-    "UNKNOWN (366)",
-    "UNKNOWN (367)",
-    "UNKNOWN (368)",
-    "UNKNOWN (369)",
-    "UNKNOWN (370)",
-    "UNKNOWN (371)",
-    "UNKNOWN (372)",
-    "UNKNOWN (373)",
-    "UNKNOWN (374)",
-    "UNKNOWN (375)",
-    "UNKNOWN (376)",
-    "UNKNOWN (377)",
-    "UNKNOWN (378)",
-    "UNKNOWN (379)",
-    "UNKNOWN (380)",
-    "UNKNOWN (381)",
-    "UNKNOWN (382)",
-    "UNKNOWN (383)",
-    "UNKNOWN (384)",
-    "UNKNOWN (385)",
-    "UNKNOWN (386)",
-    "UNKNOWN (387)",
-    "UNKNOWN (388)",
-    "UNKNOWN (389)",
-    "UNKNOWN (390)",
-    "UNKNOWN (391)",
-    "UNKNOWN (392)",
-    "UNKNOWN (393)",
-    "UNKNOWN (394)",
-    "UNKNOWN (395)",
-    "UNKNOWN (396)",
-    "UNKNOWN (397)",
-    "UNKNOWN (398)",
-    "UNKNOWN (399)",
-    "UNKNOWN (400)",
-    "UNKNOWN (401)",
-    "UNKNOWN (402)",
-    "UNKNOWN (403)",
-    "UNKNOWN (404)",
-    "UNKNOWN (405)",
-    "UNKNOWN (406)",
-    "UNKNOWN (407)",
-    "UNKNOWN (408)",
-    "UNKNOWN (409)",
-    "UNKNOWN (410)",
-    "UNKNOWN (411)",
-    "UNKNOWN (412)",
-    "UNKNOWN (413)",
-    "UNKNOWN (414)",
-    "UNKNOWN (415)",
-    "UNKNOWN (416)",
-    "UNKNOWN (417)",
-    "UNKNOWN (418)",
-    "UNKNOWN (419)",
-    "UNKNOWN (420)",
-    "UNKNOWN (421)",
-    "UNKNOWN (422)",
-    "UNKNOWN (423)",
-    "UNKNOWN (424)",
-    "UNKNOWN (425)",
-    "UNKNOWN (426)",
-    "UNKNOWN (427)",
-    "UNKNOWN (428)",
-    "UNKNOWN (429)",
-    "UNKNOWN (430)",
-    "UNKNOWN (431)",
-    "UNKNOWN (432)",
-    "UNKNOWN (433)",
-    "UNKNOWN (434)",
-    "UNKNOWN (435)",
-    "UNKNOWN (436)",
-    "UNKNOWN (437)",
-    "UNKNOWN (438)",
-    "UNKNOWN (439)",
-    "UNKNOWN (440)",
-    "UNKNOWN (441)",
-    "UNKNOWN (442)",
-    "UNKNOWN (443)",
-    "UNKNOWN (444)",
-    "UNKNOWN (445)",
-    "UNKNOWN (446)",
-    "UNKNOWN (447)",
-    "UNKNOWN (448)",
-    "UNKNOWN (449)",
-    "UNKNOWN (450)",
-    "UNKNOWN (451)",
-    "UNKNOWN (452)",
-    "UNKNOWN (453)",
-    "UNKNOWN (454)",
-    "UNKNOWN (455)",
-    "UNKNOWN (456)",
-    "UNKNOWN (457)",
-    "UNKNOWN (458)",
-    "UNKNOWN (459)",
-    "UNKNOWN (460)",
-    "UNKNOWN (461)",
-    "UNKNOWN (462)",
-    "UNKNOWN (463)",
-    "UNKNOWN (464)",
-    "UNKNOWN (465)",
-    "UNKNOWN (466)",
-    "UNKNOWN (467)",
-    "UNKNOWN (468)",
-    "UNKNOWN (469)",
-    "UNKNOWN (470)",
-    "UNKNOWN (471)",
-    "UNKNOWN (472)",
-    "UNKNOWN (473)",
-    "UNKNOWN (474)",
-    "UNKNOWN (475)",
-    "UNKNOWN (476)",
-    "UNKNOWN (477)",
-    "UNKNOWN (478)",
-    "UNKNOWN (479)",
-    "UNKNOWN (480)",
-    "UNKNOWN (481)",
-    "UNKNOWN (482)",
-    "UNKNOWN (483)",
-    "UNKNOWN (484)",
-    "UNKNOWN (485)",
-    "UNKNOWN (486)",
-    "UNKNOWN (487)",
-    "UNKNOWN (488)",
-    "UNKNOWN (489)",
-    "UNKNOWN (490)",
-    "UNKNOWN (491)",
-    "UNKNOWN (492)",
-    "UNKNOWN (493)",
-    "UNKNOWN (494)",
-    "UNKNOWN (495)",
-    "UNKNOWN (496)",
-    "UNKNOWN (497)",
-    "UNKNOWN (498)",
-    "UNKNOWN (499)",
-    "UNKNOWN (500)",
-    "UNKNOWN (501)",
-    "UNKNOWN (502)",
-    "UNKNOWN (503)",
-    "UNKNOWN (504)",
-    "UNKNOWN (505)",
-    "UNKNOWN (506)",
-    "UNKNOWN (507)",
-    "UNKNOWN (508)",
-    "UNKNOWN (509)",
-    "UNKNOWN (510)",
-    "UNKNOWN (511)",
-    "WM_MOUSEMOVE",
-    "WM_LBUTTONDOWN",
-    "WM_LBUTTONUP",
-    "WM_LBUTTONDBLCLK",
-    "WM_RBUTTONDOWN",
-    "WM_RBUTTONUP",
-    "WM_RBUTTONDBLCLK",
-    "WM_MBUTTONDOWN",
-    "WM_MBUTTONUP",
-    "WM_MOUSELAST",
-    "WM_MOUSEWHEEL",
-    "WM_XBUTTONDOWN",
-    "WM_XBUTTONUP",
-    "UNKNOWN (525)",
-    "UNKNOWN (526)",
-    "UNKNOWN (527)",
-    "WM_PARENTNOTIFY",
-    "WM_ENTERMENULOOP",
-    "WM_EXITMENULOOP",
-    "WM_NEXTMENU",
-    "WM_SIZING",
-    "WM_CAPTURECHANGED",
-    "WM_MOVING",
-    "UNKNOWN (535)",
-    "WM_POWERBROADCAST",
-    "WM_DEVICECHANGE",
-    "UNKNOWN (538)",
-    "UNKNOWN (539)",
-    "UNKNOWN (540)",
-    "UNKNOWN (541)",
-    "UNKNOWN (542)",
-    "UNKNOWN (543)",
-    "WM_MDICREATE",
-    "WM_MDIDESTROY",
-    "WM_MDIACTIVATE",
-    "WM_MDIRESTORE",
-    "WM_MDINEXT",
-    "WM_MDIMAXIMIZE",
-    "WM_MDITILE",
-    "WM_MDICASCADE",
-    "WM_MDIICONARRANGE",
-    "WM_MDIGETACTIVE",
-    "UNKNOWN (554)",
-    "UNKNOWN (555)",
-    "UNKNOWN (556)",
-    "UNKNOWN (557)",
-    "UNKNOWN (558)",
-    "UNKNOWN (559)",
-    "WM_MDISETMENU",
-    "WM_ENTERSIZEMOVE",
-    "WM_EXITSIZEMOVE",
-    "WM_DROPFILES",
-    "WM_MDIREFRESHMENU",
-    "UNKNOWN (565)",
-    "UNKNOWN (566)",
-    "UNKNOWN (567)",
-    "UNKNOWN (568)",
-    "UNKNOWN (569)",
-    "UNKNOWN (570)",
-    "UNKNOWN (571)",
-    "UNKNOWN (572)",
-    "UNKNOWN (573)",
-    "UNKNOWN (574)",
-    "UNKNOWN (575)",
-    "WM_TOUCH",
-    "UNKNOWN (577)",
-    "UNKNOWN (578)",
-    "UNKNOWN (579)",
-    "UNKNOWN (580)",
-    "UNKNOWN (581)",
-    "UNKNOWN (582)",
-    "UNKNOWN (583)",
-    "UNKNOWN (584)",
-    "UNKNOWN (585)",
-    "UNKNOWN (586)",
-    "UNKNOWN (587)",
-    "UNKNOWN (588)",
-    "UNKNOWN (589)",
-    "UNKNOWN (590)",
-    "UNKNOWN (591)",
-    "UNKNOWN (592)",
-    "UNKNOWN (593)",
-    "UNKNOWN (594)",
-    "UNKNOWN (595)",
-    "UNKNOWN (596)",
-    "UNKNOWN (597)",
-    "UNKNOWN (598)",
-    "UNKNOWN (599)",
-    "UNKNOWN (600)",
-    "UNKNOWN (601)",
-    "UNKNOWN (602)",
-    "UNKNOWN (603)",
-    "UNKNOWN (604)",
-    "UNKNOWN (605)",
-    "UNKNOWN (606)",
-    "UNKNOWN (607)",
-    "UNKNOWN (608)",
-    "UNKNOWN (609)",
-    "UNKNOWN (610)",
-    "UNKNOWN (611)",
-    "UNKNOWN (612)",
-    "UNKNOWN (613)",
-    "UNKNOWN (614)",
-    "UNKNOWN (615)",
-    "UNKNOWN (616)",
-    "UNKNOWN (617)",
-    "UNKNOWN (618)",
-    "UNKNOWN (619)",
-    "UNKNOWN (620)",
-    "UNKNOWN (621)",
-    "UNKNOWN (622)",
-    "UNKNOWN (623)",
-    "UNKNOWN (624)",
-    "UNKNOWN (625)",
-    "UNKNOWN (626)",
-    "UNKNOWN (627)",
-    "UNKNOWN (628)",
-    "UNKNOWN (629)",
-    "UNKNOWN (630)",
-    "UNKNOWN (631)",
-    "UNKNOWN (632)",
-    "UNKNOWN (633)",
-    "UNKNOWN (634)",
-    "UNKNOWN (635)",
-    "UNKNOWN (636)",
-    "UNKNOWN (637)",
-    "UNKNOWN (638)",
-    "UNKNOWN (639)",
-    "UNKNOWN (640)",
-    "UNKNOWN (641)",
-    "UNKNOWN (642)",
-    "UNKNOWN (643)",
-    "UNKNOWN (644)",
-    "UNKNOWN (645)",
-    "UNKNOWN (646)",
-    "UNKNOWN (647)",
-    "UNKNOWN (648)",
-    "UNKNOWN (649)",
-    "UNKNOWN (650)",
-    "UNKNOWN (651)",
-    "UNKNOWN (652)",
-    "UNKNOWN (653)",
-    "UNKNOWN (654)",
-    "UNKNOWN (655)",
-    "UNKNOWN (656)",
-    "UNKNOWN (657)",
-    "UNKNOWN (658)",
-    "UNKNOWN (659)",
-    "UNKNOWN (660)",
-    "UNKNOWN (661)",
-    "UNKNOWN (662)",
-    "UNKNOWN (663)",
-    "UNKNOWN (664)",
-    "UNKNOWN (665)",
-    "UNKNOWN (666)",
-    "UNKNOWN (667)",
-    "UNKNOWN (668)",
-    "UNKNOWN (669)",
-    "UNKNOWN (670)",
-    "UNKNOWN (671)",
-    "UNKNOWN (672)",
-    "WM_MOUSEHOVER",
-    "UNKNOWN (674)",
-    "WM_MOUSELEAVE",
-    "UNKNOWN (676)",
-    "UNKNOWN (677)",
-    "UNKNOWN (678)",
-    "UNKNOWN (679)",
-    "UNKNOWN (680)",
-    "UNKNOWN (681)",
-    "UNKNOWN (682)",
-    "UNKNOWN (683)",
-    "UNKNOWN (684)",
-    "UNKNOWN (685)",
-    "UNKNOWN (686)",
-    "UNKNOWN (687)",
-    "UNKNOWN (688)",
-    "UNKNOWN (689)",
-    "UNKNOWN (690)",
-    "UNKNOWN (691)",
-    "UNKNOWN (692)",
-    "UNKNOWN (693)",
-    "UNKNOWN (694)",
-    "UNKNOWN (695)",
-    "UNKNOWN (696)",
-    "UNKNOWN (697)",
-    "UNKNOWN (698)",
-    "UNKNOWN (699)",
-    "UNKNOWN (700)",
-    "UNKNOWN (701)",
-    "UNKNOWN (702)",
-    "UNKNOWN (703)",
-    "UNKNOWN (704)",
-    "UNKNOWN (705)",
-    "UNKNOWN (706)",
-    "UNKNOWN (707)",
-    "UNKNOWN (708)",
-    "UNKNOWN (709)",
-    "UNKNOWN (710)",
-    "UNKNOWN (711)",
-    "UNKNOWN (712)",
-    "UNKNOWN (713)",
-    "UNKNOWN (714)",
-    "UNKNOWN (715)",
-    "UNKNOWN (716)",
-    "UNKNOWN (717)",
-    "UNKNOWN (718)",
-    "UNKNOWN (719)",
-    "UNKNOWN (720)",
-    "UNKNOWN (721)",
-    "UNKNOWN (722)",
-    "UNKNOWN (723)",
-    "UNKNOWN (724)",
-    "UNKNOWN (725)",
-    "UNKNOWN (726)",
-    "UNKNOWN (727)",
-    "UNKNOWN (728)",
-    "UNKNOWN (729)",
-    "UNKNOWN (730)",
-    "UNKNOWN (731)",
-    "UNKNOWN (732)",
-    "UNKNOWN (733)",
-    "UNKNOWN (734)",
-    "UNKNOWN (735)",
-    "UNKNOWN (736)",
-    "UNKNOWN (737)",
-    "UNKNOWN (738)",
-    "UNKNOWN (739)",
-    "UNKNOWN (740)",
-    "UNKNOWN (741)",
-    "UNKNOWN (742)",
-    "UNKNOWN (743)",
-    "UNKNOWN (744)",
-    "UNKNOWN (745)",
-    "UNKNOWN (746)",
-    "UNKNOWN (747)",
-    "UNKNOWN (748)",
-    "UNKNOWN (749)",
-    "UNKNOWN (750)",
-    "UNKNOWN (751)",
-    "UNKNOWN (752)",
-    "UNKNOWN (753)",
-    "UNKNOWN (754)",
-    "UNKNOWN (755)",
-    "UNKNOWN (756)",
-    "UNKNOWN (757)",
-    "UNKNOWN (758)",
-    "UNKNOWN (759)",
-    "UNKNOWN (760)",
-    "UNKNOWN (761)",
-    "UNKNOWN (762)",
-    "UNKNOWN (763)",
-    "UNKNOWN (764)",
-    "UNKNOWN (765)",
-    "UNKNOWN (766)",
-    "UNKNOWN (767)",
-    "WM_CUT",
-    "WM_COPY",
-    "WM_PASTE",
-    "WM_CLEAR",
-    "WM_UNDO",
-    "WM_RENDERFORMAT",
-    "WM_RENDERALLFORMATS",
-    "WM_DESTROYCLIPBOARD",
-    "WM_DRAWCLIPBOARD",
-    "WM_PAINTCLIPBOARD",
-    "WM_VSCROLLCLIPBOARD",
-    "WM_SIZECLIPBOARD",
-    "WM_ASKCBFORMATNAME",
-    "WM_CHANGECBCHAIN",
-    "WM_HSCROLLCLIPBOARD",
-    "WM_QUERYNEWPALETTE",
-    "WM_PALETTEISCHANGING",
-    "WM_PALETTECHANGED",
-    "WM_HOTKEY",
-    "UNKNOWN (787)",
-    "UNKNOWN (788)",
-    "UNKNOWN (789)",
-    "UNKNOWN (790)",
-    "WM_PRINT",
-    "WM_PRINTCLIENT",
-    "UNKNOWN (793)",
-    "UNKNOWN (794)",
-    "UNKNOWN (795)",
-    "UNKNOWN (796)",
-    "UNKNOWN (797)",
-    "UNKNOWN (798)",
-    "UNKNOWN (799)",
-    "UNKNOWN (800)",
-    "UNKNOWN (801)",
-    "UNKNOWN (802)",
-    "UNKNOWN (803)",
-    "UNKNOWN (804)",
-    "UNKNOWN (805)",
-    "UNKNOWN (806)",
-    "UNKNOWN (807)",
-    "UNKNOWN (808)",
-    "UNKNOWN (809)",
-    "UNKNOWN (810)",
-    "UNKNOWN (811)",
-    "UNKNOWN (812)",
-    "UNKNOWN (813)",
-    "UNKNOWN (814)",
-    "UNKNOWN (815)",
-    "UNKNOWN (816)",
-    "UNKNOWN (817)",
-    "UNKNOWN (818)",
-    "UNKNOWN (819)",
-    "UNKNOWN (820)",
-    "UNKNOWN (821)",
-    "UNKNOWN (822)",
-    "UNKNOWN (823)",
-    "UNKNOWN (824)",
-    "UNKNOWN (825)",
-    "UNKNOWN (826)",
-    "UNKNOWN (827)",
-    "UNKNOWN (828)",
-    "UNKNOWN (829)",
-    "UNKNOWN (830)",
-    "UNKNOWN (831)",
-    "UNKNOWN (832)",
-    "UNKNOWN (833)",
-    "UNKNOWN (834)",
-    "UNKNOWN (835)",
-    "UNKNOWN (836)",
-    "UNKNOWN (837)",
-    "UNKNOWN (838)",
-    "UNKNOWN (839)",
-    "UNKNOWN (840)",
-    "UNKNOWN (841)",
-    "UNKNOWN (842)",
-    "UNKNOWN (843)",
-    "UNKNOWN (844)",
-    "UNKNOWN (845)",
-    "UNKNOWN (846)",
-    "UNKNOWN (847)",
-    "UNKNOWN (848)",
-    "UNKNOWN (849)",
-    "UNKNOWN (850)",
-    "UNKNOWN (851)",
-    "UNKNOWN (852)",
-    "UNKNOWN (853)",
-    "UNKNOWN (854)",
-    "UNKNOWN (855)",
-    "WM_HANDHELDFIRST",
-    "UNKNOWN (857)",
-    "UNKNOWN (858)",
-    "UNKNOWN (859)",
-    "UNKNOWN (860)",
-    "UNKNOWN (861)",
-    "UNKNOWN (862)",
-    "WM_HANDHELDLAST",
-    "WM_AFXFIRST",
-    "UNKNOWN (865)",
-    "UNKNOWN (866)",
-    "UNKNOWN (867)",
-    "UNKNOWN (868)",
-    "UNKNOWN (869)",
-    "UNKNOWN (870)",
-    "UNKNOWN (871)",
-    "UNKNOWN (872)",
-    "UNKNOWN (873)",
-    "UNKNOWN (874)",
-    "UNKNOWN (875)",
-    "UNKNOWN (876)",
-    "UNKNOWN (877)",
-    "UNKNOWN (878)",
-    "UNKNOWN (879)",
-    "UNKNOWN (880)",
-    "UNKNOWN (881)",
-    "UNKNOWN (882)",
-    "UNKNOWN (883)",
-    "UNKNOWN (884)",
-    "UNKNOWN (885)",
-    "UNKNOWN (886)",
-    "UNKNOWN (887)",
-    "UNKNOWN (888)",
-    "UNKNOWN (889)",
-    "UNKNOWN (890)",
-    "UNKNOWN (891)",
-    "UNKNOWN (892)",
-    "UNKNOWN (893)",
-    "UNKNOWN (894)",
-    "WM_AFXLAST",
-    "WM_PENWINFIRST",
-    "UNKNOWN (897)",
-    "UNKNOWN (898)",
-    "UNKNOWN (899)",
-    "UNKNOWN (900)",
-    "UNKNOWN (901)",
-    "UNKNOWN (902)",
-    "UNKNOWN (903)",
-    "UNKNOWN (904)",
-    "UNKNOWN (905)",
-    "UNKNOWN (906)",
-    "UNKNOWN (907)",
-    "UNKNOWN (908)",
-    "UNKNOWN (909)",
-    "UNKNOWN (910)",
-    "WM_PENWINLAST",
-    "UNKNOWN (912)",
-    "UNKNOWN (913)",
-    "UNKNOWN (914)",
-    "UNKNOWN (915)",
-    "UNKNOWN (916)",
-    "UNKNOWN (917)",
-    "UNKNOWN (918)",
-    "UNKNOWN (919)",
-    "UNKNOWN (920)",
-    "UNKNOWN (921)",
-    "UNKNOWN (922)",
-    "UNKNOWN (923)",
-    "UNKNOWN (924)",
-    "UNKNOWN (925)",
-    "UNKNOWN (926)",
-    "UNKNOWN (927)",
-    "UNKNOWN (928)",
-    "UNKNOWN (929)",
-    "UNKNOWN (930)",
-    "UNKNOWN (931)",
-    "UNKNOWN (932)",
-    "UNKNOWN (933)",
-    "UNKNOWN (934)",
-    "UNKNOWN (935)",
-    "UNKNOWN (936)",
-    "UNKNOWN (937)",
-    "UNKNOWN (938)",
-    "UNKNOWN (939)",
-    "UNKNOWN (940)",
-    "UNKNOWN (941)",
-    "UNKNOWN (942)",
-    "UNKNOWN (943)",
-    "UNKNOWN (944)",
-    "UNKNOWN (945)",
-    "UNKNOWN (946)",
-    "UNKNOWN (947)",
-    "UNKNOWN (948)",
-    "UNKNOWN (949)",
-    "UNKNOWN (950)",
-    "UNKNOWN (951)",
-    "UNKNOWN (952)",
-    "UNKNOWN (953)",
-    "UNKNOWN (954)",
-    "UNKNOWN (955)",
-    "UNKNOWN (956)",
-    "UNKNOWN (957)",
-    "UNKNOWN (958)",
-    "UNKNOWN (959)",
-    "UNKNOWN (960)",
-    "UNKNOWN (961)",
-    "UNKNOWN (962)",
-    "UNKNOWN (963)",
-    "UNKNOWN (964)",
-    "UNKNOWN (965)",
-    "UNKNOWN (966)",
-    "UNKNOWN (967)",
-    "UNKNOWN (968)",
-    "UNKNOWN (969)",
-    "UNKNOWN (970)",
-    "UNKNOWN (971)",
-    "UNKNOWN (972)",
-    "UNKNOWN (973)",
-    "UNKNOWN (974)",
-    "UNKNOWN (975)",
-    "UNKNOWN (976)",
-    "UNKNOWN (977)",
-    "UNKNOWN (978)",
-    "UNKNOWN (979)",
-    "UNKNOWN (980)",
-    "UNKNOWN (981)",
-    "UNKNOWN (982)",
-    "UNKNOWN (983)",
-    "UNKNOWN (984)",
-    "UNKNOWN (985)",
-    "UNKNOWN (986)",
-    "UNKNOWN (987)",
-    "UNKNOWN (988)",
-    "UNKNOWN (989)",
-    "UNKNOWN (990)",
-    "UNKNOWN (991)",
-    "UNKNOWN (992)",
-    "UNKNOWN (993)",
-    "UNKNOWN (994)",
-    "UNKNOWN (995)",
-    "UNKNOWN (996)",
-    "UNKNOWN (997)",
-    "UNKNOWN (998)",
-    "UNKNOWN (999)",
-    "UNKNOWN (1000)",
-    "UNKNOWN (1001)",
-    "UNKNOWN (1002)",
-    "UNKNOWN (1003)",
-    "UNKNOWN (1004)",
-    "UNKNOWN (1005)",
-    "UNKNOWN (1006)",
-    "UNKNOWN (1007)",
-    "UNKNOWN (1008)",
-    "UNKNOWN (1009)",
-    "UNKNOWN (1010)",
-    "UNKNOWN (1011)",
-    "UNKNOWN (1012)",
-    "UNKNOWN (1013)",
-    "UNKNOWN (1014)",
-    "UNKNOWN (1015)",
-    "UNKNOWN (1016)",
-    "UNKNOWN (1017)",
-    "UNKNOWN (1018)",
-    "UNKNOWN (1019)",
-    "UNKNOWN (1020)",
-    "UNKNOWN (1021)",
-    "UNKNOWN (1022)",
-    "UNKNOWN (1023)",
-    "WM_USER"
-};
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11clipboard.c b/deps/SDL2/src/video/x11/SDL_x11clipboard.c
deleted file mode 100644
index e6ca86b..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11clipboard.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include <limits.h> /* For INT_MAX */
-
-#include "SDL_events.h"
-#include "SDL_x11video.h"
-#include "SDL_timer.h"
-
-
-/* If you don't support UTF-8, you might use XA_STRING here */
-#ifdef X_HAVE_UTF8_STRING
-#define TEXT_FORMAT X11_XInternAtom(display, "UTF8_STRING", False)
-#else
-#define TEXT_FORMAT XA_STRING
-#endif
-
-/* Get any application owned window handle for clipboard association */
-static Window
-GetWindow(_THIS)
-{
-    SDL_Window *window;
-
-    window = _this->windows;
-    if (window) {
-        return ((SDL_WindowData *) window->driverdata)->xwindow;
-    }
-    return None;
-}
-
-int
-X11_SetClipboardText(_THIS, const char *text)
-{
-    Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-    Atom format;
-    Window window;
-    Atom XA_CLIPBOARD = X11_XInternAtom(display, "CLIPBOARD", 0);
-
-    /* Get the SDL window that will own the selection */
-    window = GetWindow(_this);
-    if (window == None) {
-        return SDL_SetError("Couldn't find a window to own the selection");
-    }
-
-    /* Save the selection on the root window */
-    format = TEXT_FORMAT;
-    X11_XChangeProperty(display, DefaultRootWindow(display),
-        XA_CUT_BUFFER0, format, 8, PropModeReplace,
-        (const unsigned char *)text, SDL_strlen(text));
-
-    if (XA_CLIPBOARD != None &&
-        X11_XGetSelectionOwner(display, XA_CLIPBOARD) != window) {
-        X11_XSetSelectionOwner(display, XA_CLIPBOARD, window, CurrentTime);
-    }
-
-    if (X11_XGetSelectionOwner(display, XA_PRIMARY) != window) {
-        X11_XSetSelectionOwner(display, XA_PRIMARY, window, CurrentTime);
-    }
-    return 0;
-}
-
-char *
-X11_GetClipboardText(_THIS)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-    Display *display = videodata->display;
-    Atom format;
-    Window window;
-    Window owner;
-    Atom selection;
-    Atom seln_type;
-    int seln_format;
-    unsigned long nbytes;
-    unsigned long overflow;
-    unsigned char *src;
-    char *text;
-    Uint32 waitStart;
-    Uint32 waitElapsed;
-    Atom XA_CLIPBOARD = X11_XInternAtom(display, "CLIPBOARD", 0);
-    if (XA_CLIPBOARD == None) {
-        SDL_SetError("Couldn't access X clipboard");
-        return SDL_strdup("");
-    }
-
-    text = NULL;
-
-    /* Get the window that holds the selection */
-    window = GetWindow(_this);
-    format = TEXT_FORMAT;
-    owner = X11_XGetSelectionOwner(display, XA_CLIPBOARD);
-    if ((owner == None) || (owner == window)) {
-        owner = DefaultRootWindow(display);
-        selection = XA_CUT_BUFFER0;
-    } else {
-        /* Request that the selection owner copy the data to our window */
-        owner = window;
-        selection = X11_XInternAtom(display, "SDL_SELECTION", False);
-        X11_XConvertSelection(display, XA_CLIPBOARD, format, selection, owner,
-            CurrentTime);
-
-        /* When using synergy on Linux and when data has been put in the clipboard
-           on the remote (Windows anyway) machine then selection_waiting may never
-           be set to False. Time out after a while. */
-        waitStart = SDL_GetTicks();
-        videodata->selection_waiting = SDL_TRUE;
-        while (videodata->selection_waiting) {
-            SDL_PumpEvents();
-            waitElapsed = SDL_GetTicks() - waitStart;
-            /* Wait one second for a clipboard response. */
-            if (waitElapsed > 1000) {
-                videodata->selection_waiting = SDL_FALSE;
-                SDL_SetError("Clipboard timeout");
-                /* We need to set the clipboard text so that next time we won't
-                   timeout, otherwise we will hang on every call to this function. */
-                X11_SetClipboardText(_this, "");
-                return SDL_strdup("");
-            }
-        }
-    }
-
-    if (X11_XGetWindowProperty(display, owner, selection, 0, INT_MAX/4, False,
-            format, &seln_type, &seln_format, &nbytes, &overflow, &src)
-            == Success) {
-        if (seln_type == format) {
-            text = (char *)SDL_malloc(nbytes+1);
-            if (text) {
-                SDL_memcpy(text, src, nbytes);
-                text[nbytes] = '\0';
-            }
-        }
-        X11_XFree(src);
-    }
-
-    if (!text) {
-        text = SDL_strdup("");
-    }
-
-    return text;
-}
-
-SDL_bool
-X11_HasClipboardText(_THIS)
-{
-    SDL_bool result = SDL_FALSE;
-    char *text = X11_GetClipboardText(_this);
-    if (text) {
-        result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
-        SDL_free(text);
-    }
-    return result;
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11clipboard.h b/deps/SDL2/src/video/x11/SDL_x11clipboard.h
deleted file mode 100644
index 999d163..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11clipboard.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11clipboard_h
-#define _SDL_x11clipboard_h
-
-extern int X11_SetClipboardText(_THIS, const char *text);
-extern char *X11_GetClipboardText(_THIS);
-extern SDL_bool X11_HasClipboardText(_THIS);
-
-#endif /* _SDL_x11clipboard_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11dyn.c b/deps/SDL2/src/video/x11/SDL_x11dyn.c
deleted file mode 100644
index 24caea4..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11dyn.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#define DEBUG_DYNAMIC_X11 0
-
-#include "SDL_x11dyn.h"
-
-#if DEBUG_DYNAMIC_X11
-#include <stdio.h>
-#endif
-
-#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
-
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-
-typedef struct
-{
-    void *lib;
-    const char *libname;
-} x11dynlib;
-
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE NULL
-#endif
-
-static x11dynlib x11libs[] = {
-    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC},
-    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT},
-    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR},
-    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA},
-    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2},
-    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR},
-    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS},
-    {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE}
-};
-
-static void *
-X11_GetSym(const char *fnname, int *pHasModule)
-{
-    int i;
-    void *fn = NULL;
-    for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
-        if (x11libs[i].lib != NULL) {
-            fn = SDL_LoadFunction(x11libs[i].lib, fnname);
-            if (fn != NULL)
-                break;
-        }
-    }
-
-#if DEBUG_DYNAMIC_X11
-    if (fn != NULL)
-        printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, fn);
-    else
-        printf("X11: Symbol '%s' NOT FOUND!\n", fnname);
-#endif
-
-    if (fn == NULL)
-        *pHasModule = 0;  /* kill this module. */
-
-    return fn;
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11_DYNAMIC */
-
-/* Define all the function pointers and wrappers... */
-#define SDL_X11_MODULE(modname)
-#define SDL_X11_SYM(rc,fn,params,args,ret) SDL_DYNX11FN_##fn X11_##fn = NULL;
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-/* Annoying varargs entry point... */
-#ifdef X_HAVE_UTF8_STRING
-SDL_DYNX11FN_XCreateIC X11_XCreateIC = NULL;
-SDL_DYNX11FN_XGetICValues X11_XGetICValues = NULL;
-#endif
-
-/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
-#define SDL_X11_MODULE(modname) int SDL_X11_HAVE_##modname = 0;
-#define SDL_X11_SYM(rc,fn,params,args,ret)
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-static int x11_load_refcount = 0;
-
-void
-SDL_X11_UnloadSymbols(void)
-{
-    /* Don't actually unload if more than one module is using the libs... */
-    if (x11_load_refcount > 0) {
-        if (--x11_load_refcount == 0) {
-            int i;
-
-            /* set all the function pointers to NULL. */
-#define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 0;
-#define SDL_X11_SYM(rc,fn,params,args,ret) X11_##fn = NULL;
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-#ifdef X_HAVE_UTF8_STRING
-            X11_XCreateIC = NULL;
-            X11_XGetICValues = NULL;
-#endif
-
-#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
-            for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
-                if (x11libs[i].lib != NULL) {
-                    SDL_UnloadObject(x11libs[i].lib);
-                    x11libs[i].lib = NULL;
-                }
-            }
-#endif
-        }
-    }
-}
-
-/* returns non-zero if all needed symbols were loaded. */
-int
-SDL_X11_LoadSymbols(void)
-{
-    int rc = 1;                 /* always succeed if not using Dynamic X11 stuff. */
-
-    /* deal with multiple modules (dga, x11, etc) needing these symbols... */
-    if (x11_load_refcount++ == 0) {
-#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
-        int i;
-        int *thismod = NULL;
-        for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
-            if (x11libs[i].libname != NULL) {
-                x11libs[i].lib = SDL_LoadObject(x11libs[i].libname);
-            }
-        }
-
-#define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1; /* default yes */
-#define SDL_X11_SYM(a,fn,x,y,z)
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-#define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
-#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = (SDL_DYNX11FN_##fn) X11_GetSym(#fn,thismod);
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-#ifdef X_HAVE_UTF8_STRING
-        X11_XCreateIC = (SDL_DYNX11FN_XCreateIC)
-                        X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8);
-        X11_XGetICValues = (SDL_DYNX11FN_XGetICValues)
-                        X11_GetSym("XGetICValues", &SDL_X11_HAVE_UTF8);
-#endif
-
-        if (SDL_X11_HAVE_BASEXLIB) {
-            /* all required symbols loaded. */
-            SDL_ClearError();
-        } else {
-            /* in case something got loaded... */
-            SDL_X11_UnloadSymbols();
-            rc = 0;
-        }
-
-#else  /* no dynamic X11 */
-
-#define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1; /* default yes */
-#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = fn;
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-#ifdef X_HAVE_UTF8_STRING
-        X11_XCreateIC = XCreateIC;
-        X11_XGetICValues = XGetICValues;
-#endif
-#endif
-    }
-
-    return rc;
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11dyn.h b/deps/SDL2/src/video/x11/SDL_x11dyn.h
deleted file mode 100644
index 168c07e..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11dyn.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11dyn_h
-#define _SDL_x11dyn_h
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
-#include <X11/XKBlib.h>
-#endif
-
-/* Apparently some X11 systems can't include this multiple times... */
-#ifndef SDL_INCLUDED_XLIBINT_H
-#define SDL_INCLUDED_XLIBINT_H 1
-#include <X11/Xlibint.h>
-#endif
-
-#include <X11/Xproto.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-
-#ifndef NO_SHARED_MEMORY
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <X11/extensions/XShm.h>
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XCURSOR
-#include <X11/Xcursor/Xcursor.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-#include <X11/extensions/Xinerama.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XINPUT2
-#include <X11/extensions/XInput2.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-#include <X11/extensions/Xrandr.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER
-#include <X11/extensions/scrnsaver.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XSHAPE
-#include <X11/extensions/shape.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-#include <X11/extensions/xf86vmode.h>
-#endif
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/* evil function signatures... */
-typedef Bool(*SDL_X11_XESetWireToEventRetType) (Display *, XEvent *, xEvent *);
-typedef int (*SDL_X11_XSynchronizeRetType) (Display *);
-typedef Status(*SDL_X11_XESetEventToWireRetType) (Display *, XEvent *, xEvent *);
-
-int SDL_X11_LoadSymbols(void);
-void SDL_X11_UnloadSymbols(void);
-
-/* Declare all the function pointers and wrappers... */
-#define SDL_X11_MODULE(modname)
-#define SDL_X11_SYM(rc,fn,params,args,ret) \
-    typedef rc (*SDL_DYNX11FN_##fn) params; \
-    extern SDL_DYNX11FN_##fn X11_##fn;
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-/* Annoying varargs entry point... */
-#ifdef X_HAVE_UTF8_STRING
-typedef XIC(*SDL_DYNX11FN_XCreateIC) (XIM,...);
-typedef char *(*SDL_DYNX11FN_XGetICValues) (XIC, ...);
-extern SDL_DYNX11FN_XCreateIC X11_XCreateIC;
-extern SDL_DYNX11FN_XGetICValues X11_XGetICValues;
-#endif
-
-/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
-#define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname;
-#define SDL_X11_SYM(rc,fn,params,args,ret)
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif                          /* !defined _SDL_x11dyn_h */
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11events.c b/deps/SDL2/src/video/x11/SDL_x11events.c
deleted file mode 100644
index d9dcc2d..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11events.c
+++ /dev/null
@@ -1,1021 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <unistd.h>
-#include <limits.h> /* For INT_MAX */
-
-#include "SDL_x11video.h"
-#include "SDL_x11video.h"
-#include "SDL_x11touch.h"
-#include "SDL_x11xinput2.h"
-#include "../../events/SDL_events_c.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/SDL_touch_c.h"
-
-#include "SDL_timer.h"
-#include "SDL_syswm.h"
-
-#include <stdio.h>
-
-typedef struct {
-    unsigned char *data;
-    int format, count;
-    Atom type;
-} SDL_x11Prop;
-
-/* Reads property
-   Must call X11_XFree on results
- */
-static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop)
-{
-    unsigned char *ret=NULL;
-    Atom type;
-    int fmt;
-    unsigned long count;
-    unsigned long bytes_left;
-    int bytes_fetch = 0;
-
-    do {
-        if (ret != 0) X11_XFree(ret);
-        X11_XGetWindowProperty(disp, w, prop, 0, bytes_fetch, False, AnyPropertyType, &type, &fmt, &count, &bytes_left, &ret);
-        bytes_fetch += bytes_left;
-    } while (bytes_left != 0);
-
-    p->data=ret;
-    p->format=fmt;
-    p->count=count;
-    p->type=type;
-}
-
-/* Find text-uri-list in a list of targets and return it's atom
-   if available, else return None */
-static Atom X11_PickTarget(Display *disp, Atom list[], int list_count)
-{
-    Atom request = None;
-    char *name;
-    int i;
-    for (i=0; i < list_count && request == None; i++) {
-        name = X11_XGetAtomName(disp, list[i]);
-        if (strcmp("text/uri-list", name)==0) request = list[i];
-        X11_XFree(name);
-    }
-    return request;
-}
-
-/* Wrapper for X11_PickTarget for a maximum of three targets, a special
-   case in the Xdnd protocol */
-static Atom X11_PickTargetFromAtoms(Display *disp, Atom a0, Atom a1, Atom a2)
-{
-    int count=0;
-    Atom atom[3];
-    if (a0 != None) atom[count++] = a0;
-    if (a1 != None) atom[count++] = a1;
-    if (a2 != None) atom[count++] = a2;
-    return X11_PickTarget(disp, atom, count);
-}
-/* #define DEBUG_XEVENTS */
-
-struct KeyRepeatCheckData
-{
-    XEvent *event;
-    SDL_bool found;
-};
-
-static Bool X11_KeyRepeatCheckIfEvent(Display *display, XEvent *chkev,
-    XPointer arg)
-{
-    struct KeyRepeatCheckData *d = (struct KeyRepeatCheckData *) arg;
-    if (chkev->type == KeyPress &&
-        chkev->xkey.keycode == d->event->xkey.keycode &&
-        chkev->xkey.time - d->event->xkey.time < 2)
-        d->found = SDL_TRUE;
-    return False;
-}
-
-/* Check to see if this is a repeated key.
-   (idea shamelessly lifted from GII -- thanks guys! :)
- */
-static SDL_bool X11_KeyRepeat(Display *display, XEvent *event)
-{
-    XEvent dummyev;
-    struct KeyRepeatCheckData d;
-    d.event = event;
-    d.found = SDL_FALSE;
-    if (X11_XPending(display))
-        X11_XCheckIfEvent(display, &dummyev, X11_KeyRepeatCheckIfEvent,
-            (XPointer) &d);
-    return d.found;
-}
-
-static Bool X11_IsWheelCheckIfEvent(Display *display, XEvent *chkev,
-    XPointer arg)
-{
-    XEvent *event = (XEvent *) arg;
-    /* we only handle buttons 4 and 5 - false positive avoidance */
-    if (chkev->type == ButtonRelease &&
-        (event->xbutton.button == Button4 || event->xbutton.button == Button5) &&
-        chkev->xbutton.button == event->xbutton.button &&
-        chkev->xbutton.time == event->xbutton.time)
-        return True;
-    return False;
-}
-
-static SDL_bool X11_IsWheelEvent(Display * display,XEvent * event,int * ticks)
-{
-    XEvent relevent;
-    if (X11_XPending(display)) {
-        /* according to the xlib docs, no specific mouse wheel events exist.
-           however, mouse wheel events trigger a button press and a button release
-           immediately. thus, checking if the same button was released at the same
-           time as it was pressed, should be an adequate hack to derive a mouse
-           wheel event.
-           However, there is broken and unusual hardware out there...
-           - False positive: a button for which a release event is
-             generated (or synthesised) immediately.
-           - False negative: a wheel which, when rolled, doesn't have
-             a release event generated immediately. */
-        if (X11_XCheckIfEvent(display, &relevent, X11_IsWheelCheckIfEvent,
-            (XPointer) event)) {
-
-            /* by default, X11 only knows 5 buttons. on most 3 button + wheel mouse,
-               Button4 maps to wheel up, Button5 maps to wheel down. */
-            if (event->xbutton.button == Button4) {
-                *ticks = 1;
-            }
-            else if (event->xbutton.button == Button5) {
-                *ticks = -1;
-            }
-            return SDL_TRUE;
-        }
-    }
-    return SDL_FALSE;
-}
-
-/* Convert URI to local filename
-   return filename if possible, else NULL
-*/
-static char* X11_URIToLocal(char* uri) {
-    char *file = NULL;
-    SDL_bool local;
-
-    if (memcmp(uri,"file:/",6) == 0) uri += 6;      /* local file? */
-    else if (strstr(uri,":/") != NULL) return file; /* wrong scheme */
-
-    local = uri[0] != '/' || ( uri[0] != '\0' && uri[1] == '/' );
-
-    /* got a hostname? */
-    if ( !local && uri[0] == '/' && uri[2] != '/' ) {
-      char* hostname_end = strchr( uri+1, '/' );
-      if ( hostname_end != NULL ) {
-          char hostname[ 257 ];
-          if ( gethostname( hostname, 255 ) == 0 ) {
-            hostname[ 256 ] = '\0';
-            if ( memcmp( uri+1, hostname, hostname_end - ( uri+1 )) == 0 ) {
-                uri = hostname_end + 1;
-                local = SDL_TRUE;
-            }
-          }
-      }
-    }
-    if ( local ) {
-      file = uri;
-      if ( uri[1] == '/' ) {
-          file++;
-      } else {
-          file--;
-      }
-    }
-    return file;
-}
-
-#if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
-static void X11_HandleGenericEvent(SDL_VideoData *videodata,XEvent event)
-{
-    /* event is a union, so cookie == &event, but this is type safe. */
-    XGenericEventCookie *cookie = &event.xcookie;
-    if (X11_XGetEventData(videodata->display, cookie)) {
-        X11_HandleXinput2Event(videodata, cookie);
-        X11_XFreeEventData(videodata->display, cookie);
-    }
-}
-#endif /* SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */
-
-
-static void
-X11_DispatchFocusIn(SDL_WindowData *data)
-{
-#ifdef DEBUG_XEVENTS
-    printf("window %p: Dispatching FocusIn\n", data);
-#endif
-    SDL_SetKeyboardFocus(data->window);
-#ifdef X_HAVE_UTF8_STRING
-    if (data->ic) {
-        X11_XSetICFocus(data->ic);
-    }
-#endif
-}
-
-static void
-X11_DispatchFocusOut(SDL_WindowData *data)
-{
-#ifdef DEBUG_XEVENTS
-    printf("window %p: Dispatching FocusOut\n", data);
-#endif
-    SDL_SetKeyboardFocus(NULL);
-#ifdef X_HAVE_UTF8_STRING
-    if (data->ic) {
-        X11_XUnsetICFocus(data->ic);
-    }
-#endif
-}
-
-static void
-X11_DispatchMapNotify(SDL_WindowData *data)
-{
-    SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
-    SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0);
-}
-
-static void
-X11_DispatchUnmapNotify(SDL_WindowData *data)
-{
-    SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0);
-    SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
-}
-
-static void
-X11_DispatchEvent(_THIS)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-    Display *display = videodata->display;
-    SDL_WindowData *data;
-    XEvent xevent;
-    int i;
-    XClientMessageEvent m;
-
-    SDL_zero(xevent);           /* valgrind fix. --ryan. */
-    X11_XNextEvent(display, &xevent);
-
-    /* filter events catchs XIM events and sends them to the correct
-       handler */
-    if (X11_XFilterEvent(&xevent, None) == True) {
-#if 0
-        printf("Filtered event type = %d display = %d window = %d\n",
-               xevent.type, xevent.xany.display, xevent.xany.window);
-#endif
-        return;
-    }
-
-    /* Send a SDL_SYSWMEVENT if the application wants them */
-    if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) {
-        SDL_SysWMmsg wmmsg;
-
-        SDL_VERSION(&wmmsg.version);
-        wmmsg.subsystem = SDL_SYSWM_X11;
-        wmmsg.msg.x11.event = xevent;
-        SDL_SendSysWMEvent(&wmmsg);
-    }
-
-#if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
-    if(xevent.type == GenericEvent) {
-        X11_HandleGenericEvent(videodata,xevent);
-        return;
-    }
-#endif
-
-#if 0
-    printf("type = %d display = %d window = %d\n",
-           xevent.type, xevent.xany.display, xevent.xany.window);
-#endif
-
-    data = NULL;
-    if (videodata && videodata->windowlist) {
-        for (i = 0; i < videodata->numwindows; ++i) {
-            if ((videodata->windowlist[i] != NULL) &&
-                (videodata->windowlist[i]->xwindow == xevent.xany.window)) {
-                data = videodata->windowlist[i];
-                break;
-            }
-        }
-    }
-    if (!data) {
-        return;
-    }
-
-    switch (xevent.type) {
-
-        /* Gaining mouse coverage? */
-    case EnterNotify:{
-#ifdef DEBUG_XEVENTS
-            printf("window %p: EnterNotify! (%d,%d,%d)\n", data,
-                   xevent.xcrossing.x,
-                   xevent.xcrossing.y,
-                   xevent.xcrossing.mode);
-            if (xevent.xcrossing.mode == NotifyGrab)
-                printf("Mode: NotifyGrab\n");
-            if (xevent.xcrossing.mode == NotifyUngrab)
-                printf("Mode: NotifyUngrab\n");
-#endif
-            SDL_SetMouseFocus(data->window);
-
-            if (!SDL_GetMouse()->relative_mode) {
-                SDL_SendMouseMotion(data->window, 0, 0, xevent.xcrossing.x, xevent.xcrossing.y);
-            }
-        }
-        break;
-        /* Losing mouse coverage? */
-    case LeaveNotify:{
-#ifdef DEBUG_XEVENTS
-            printf("window %p: LeaveNotify! (%d,%d,%d)\n", data,
-                   xevent.xcrossing.x,
-                   xevent.xcrossing.y,
-                   xevent.xcrossing.mode);
-            if (xevent.xcrossing.mode == NotifyGrab)
-                printf("Mode: NotifyGrab\n");
-            if (xevent.xcrossing.mode == NotifyUngrab)
-                printf("Mode: NotifyUngrab\n");
-#endif
-            if (!SDL_GetMouse()->relative_mode) {
-                SDL_SendMouseMotion(data->window, 0, 0, xevent.xcrossing.x, xevent.xcrossing.y);
-            }
-
-            if (xevent.xcrossing.mode != NotifyGrab &&
-                xevent.xcrossing.mode != NotifyUngrab &&
-                xevent.xcrossing.detail != NotifyInferior) {
-                SDL_SetMouseFocus(NULL);
-            }
-        }
-        break;
-
-        /* Gaining input focus? */
-    case FocusIn:{
-            if (xevent.xfocus.detail == NotifyInferior) {
-#ifdef DEBUG_XEVENTS
-                printf("window %p: FocusIn (NotifierInferior, ignoring)\n", data);
-#endif
-                break;
-            }
-#ifdef DEBUG_XEVENTS
-            printf("window %p: FocusIn!\n", data);
-#endif
-            if (data->pending_focus == PENDING_FOCUS_OUT &&
-                data->window == SDL_GetKeyboardFocus()) {
-                /* We want to reset the keyboard here, because we may have
-                   missed keyboard messages after our previous FocusOut.
-                 */
-                /* Actually, if we do this we clear the ALT key on Unity
-                   because it briefly takes focus for their dashboard.
-
-                   I think it's better to think the ALT key is held down
-                   when it's not, then always lose the ALT modifier on Unity.
-                 */
-                /* SDL_ResetKeyboard(); */
-            }
-            data->pending_focus = PENDING_FOCUS_IN;
-            data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_IN_TIME;
-        }
-        break;
-
-        /* Losing input focus? */
-    case FocusOut:{
-            if (xevent.xfocus.detail == NotifyInferior) {
-                /* We still have focus if a child gets focus */
-#ifdef DEBUG_XEVENTS
-                printf("window %p: FocusOut (NotifierInferior, ignoring)\n", data);
-#endif
-                break;
-            }
-#ifdef DEBUG_XEVENTS
-            printf("window %p: FocusOut!\n", data);
-#endif
-            data->pending_focus = PENDING_FOCUS_OUT;
-            data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_OUT_TIME;
-        }
-        break;
-
-        /* Generated upon EnterWindow and FocusIn */
-    case KeymapNotify:{
-#ifdef DEBUG_XEVENTS
-            printf("window %p: KeymapNotify!\n", data);
-#endif
-            /* FIXME:
-               X11_SetKeyboardState(SDL_Display, xevent.xkeymap.key_vector);
-             */
-        }
-        break;
-
-        /* Has the keyboard layout changed? */
-    case MappingNotify:{
-#ifdef DEBUG_XEVENTS
-            printf("window %p: MappingNotify!\n", data);
-#endif
-            X11_UpdateKeymap(_this);
-        }
-        break;
-
-        /* Key press? */
-    case KeyPress:{
-            KeyCode keycode = xevent.xkey.keycode;
-            KeySym keysym = NoSymbol;
-            char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
-            Status status = 0;
-
-#ifdef DEBUG_XEVENTS
-            printf("window %p: KeyPress (X11 keycode = 0x%X)\n", data, xevent.xkey.keycode);
-#endif
-            SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]);
-#if 1
-            if (videodata->key_layout[keycode] == SDL_SCANCODE_UNKNOWN && keycode) {
-                int min_keycode, max_keycode;
-                X11_XDisplayKeycodes(display, &min_keycode, &max_keycode);
-#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
-                keysym = X11_XkbKeycodeToKeysym(display, keycode, 0, 0);
-#else
-                keysym = XKeycodeToKeysym(display, keycode, 0);
-#endif
-                fprintf(stderr,
-                        "The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list <sdl at libsdl.org> X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).\n",
-                        keycode, keycode - min_keycode, keysym,
-                        X11_XKeysymToString(keysym));
-            }
-#endif
-            /* */
-            SDL_zero(text);
-#ifdef X_HAVE_UTF8_STRING
-            if (data->ic) {
-                X11_Xutf8LookupString(data->ic, &xevent.xkey, text, sizeof(text),
-                                  &keysym, &status);
-            }
-#else
-            XLookupString(&xevent.xkey, text, sizeof(text), &keysym, NULL);
-#endif
-            if (*text) {
-                SDL_SendKeyboardText(text);
-            }
-        }
-        break;
-
-        /* Key release? */
-    case KeyRelease:{
-            KeyCode keycode = xevent.xkey.keycode;
-
-#ifdef DEBUG_XEVENTS
-            printf("window %p: KeyRelease (X11 keycode = 0x%X)\n", data, xevent.xkey.keycode);
-#endif
-            if (X11_KeyRepeat(display, &xevent)) {
-                /* We're about to get a repeated key down, ignore the key up */
-                break;
-            }
-            SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode]);
-        }
-        break;
-
-        /* Have we been iconified? */
-    case UnmapNotify:{
-#ifdef DEBUG_XEVENTS
-            printf("window %p: UnmapNotify!\n", data);
-#endif
-            X11_DispatchUnmapNotify(data);
-        }
-        break;
-
-        /* Have we been restored? */
-    case MapNotify:{
-#ifdef DEBUG_XEVENTS
-            printf("window %p: MapNotify!\n", data);
-#endif
-            X11_DispatchMapNotify(data);
-        }
-        break;
-
-        /* Have we been resized or moved? */
-    case ConfigureNotify:{
-#ifdef DEBUG_XEVENTS
-            printf("window %p: ConfigureNotify! (position: %d,%d, size: %dx%d)\n", data,
-                   xevent.xconfigure.x, xevent.xconfigure.y,
-                   xevent.xconfigure.width, xevent.xconfigure.height);
-#endif
-            long border_left = 0;
-            long border_right = 0;
-            long border_top = 0;
-            long border_bottom = 0;
-            if (data->xwindow) {
-                Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
-                Atom type = None;
-                int format;
-                unsigned long nitems = 0, bytes_after;
-                unsigned char *property;
-                X11_XGetWindowProperty(display, data->xwindow,
-                    _net_frame_extents, 0, 16, 0,
-                    XA_CARDINAL, &type, &format,
-                    &nitems, &bytes_after, &property);
-
-                if (type != None && nitems == 4)
-                {
-                    border_left = ((long*)property)[0];
-                    border_right = ((long*)property)[1];
-                    border_top = ((long*)property)[2];
-                    border_bottom = ((long*)property)[3];
-                }
-            }
-
-            if (xevent.xconfigure.x != data->last_xconfigure.x ||
-                xevent.xconfigure.y != data->last_xconfigure.y) {
-                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,
-                                    xevent.xconfigure.x - border_left,
-                                    xevent.xconfigure.y - border_top);
-            }
-            if (xevent.xconfigure.width != data->last_xconfigure.width ||
-                xevent.xconfigure.height != data->last_xconfigure.height) {
-                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED,
-                                    xevent.xconfigure.width,
-                                    xevent.xconfigure.height);
-            }
-            data->last_xconfigure = xevent.xconfigure;
-        }
-        break;
-
-        /* Have we been requested to quit (or another client message?) */
-    case ClientMessage:{
-
-            int xdnd_version=0;
-
-            if (xevent.xclient.message_type == videodata->XdndEnter) {
-                SDL_bool use_list = xevent.xclient.data.l[1] & 1;
-                data->xdnd_source = xevent.xclient.data.l[0];
-                xdnd_version = ( xevent.xclient.data.l[1] >> 24);
-                if (use_list) {
-                    /* fetch conversion targets */
-                    SDL_x11Prop p;
-                    X11_ReadProperty(&p, display, data->xdnd_source, videodata->XdndTypeList);
-                    /* pick one */
-                    data->xdnd_req = X11_PickTarget(display, (Atom*)p.data, p.count);
-                    X11_XFree(p.data);
-                } else {
-                    /* pick from list of three */
-                    data->xdnd_req = X11_PickTargetFromAtoms(display, xevent.xclient.data.l[2], xevent.xclient.data.l[3], xevent.xclient.data.l[4]);
-                }
-            }
-            else if (xevent.xclient.message_type == videodata->XdndPosition) {
-
-                /* reply with status */
-                memset(&m, 0, sizeof(XClientMessageEvent));
-                m.type = ClientMessage;
-                m.display = xevent.xclient.display;
-                m.window = xevent.xclient.data.l[0];
-                m.message_type = videodata->XdndStatus;
-                m.format=32;
-                m.data.l[0] = data->xwindow;
-                m.data.l[1] = (data->xdnd_req != None);
-                m.data.l[2] = 0; /* specify an empty rectangle */
-                m.data.l[3] = 0;
-                m.data.l[4] = videodata->XdndActionCopy; /* we only accept copying anyway */
-
-                X11_XSendEvent(display, xevent.xclient.data.l[0], False, NoEventMask, (XEvent*)&m);
-                X11_XFlush(display);
-            }
-            else if(xevent.xclient.message_type == videodata->XdndDrop) {
-                if (data->xdnd_req == None) {
-                    /* say again - not interested! */
-                    memset(&m, 0, sizeof(XClientMessageEvent));
-                    m.type = ClientMessage;
-                    m.display = xevent.xclient.display;
-                    m.window = xevent.xclient.data.l[0];
-                    m.message_type = videodata->XdndFinished;
-                    m.format=32;
-                    m.data.l[0] = data->xwindow;
-                    m.data.l[1] = 0;
-                    m.data.l[2] = None; /* fail! */
-                    X11_XSendEvent(display, xevent.xclient.data.l[0], False, NoEventMask, (XEvent*)&m);
-                } else {
-                    /* convert */
-                    if(xdnd_version >= 1) {
-                        X11_XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, xevent.xclient.data.l[2]);
-                    } else {
-                        X11_XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, CurrentTime);
-                    }
-                }
-            }
-            else if ((xevent.xclient.message_type == videodata->WM_PROTOCOLS) &&
-                (xevent.xclient.format == 32) &&
-                (xevent.xclient.data.l[0] == videodata->_NET_WM_PING)) {
-                Window root = DefaultRootWindow(display);
-
-#ifdef DEBUG_XEVENTS
-                printf("window %p: _NET_WM_PING\n", data);
-#endif
-                xevent.xclient.window = root;
-                X11_XSendEvent(display, root, False, SubstructureRedirectMask | SubstructureNotifyMask, &xevent);
-                break;
-            }
-
-            else if ((xevent.xclient.message_type == videodata->WM_PROTOCOLS) &&
-                (xevent.xclient.format == 32) &&
-                (xevent.xclient.data.l[0] == videodata->WM_DELETE_WINDOW)) {
-
-#ifdef DEBUG_XEVENTS
-                printf("window %p: WM_DELETE_WINDOW\n", data);
-#endif
-                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0);
-                break;
-            }
-        }
-        break;
-
-        /* Do we need to refresh ourselves? */
-    case Expose:{
-#ifdef DEBUG_XEVENTS
-            printf("window %p: Expose (count = %d)\n", data, xevent.xexpose.count);
-#endif
-            SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_EXPOSED, 0, 0);
-        }
-        break;
-
-    case MotionNotify:{
-            SDL_Mouse *mouse = SDL_GetMouse();
-            if(!mouse->relative_mode) {
-#ifdef DEBUG_MOTION
-                printf("window %p: X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
-#endif
-
-                SDL_SendMouseMotion(data->window, 0, 0, xevent.xmotion.x, xevent.xmotion.y);
-            }
-        }
-        break;
-
-    case ButtonPress:{
-            int ticks = 0;
-            if (X11_IsWheelEvent(display,&xevent,&ticks)) {
-                SDL_SendMouseWheel(data->window, 0, 0, ticks);
-            } else {
-                SDL_SendMouseButton(data->window, 0, SDL_PRESSED, xevent.xbutton.button);
-            }
-        }
-        break;
-
-    case ButtonRelease:{
-            SDL_SendMouseButton(data->window, 0, SDL_RELEASED, xevent.xbutton.button);
-        }
-        break;
-
-    case PropertyNotify:{
-#ifdef DEBUG_XEVENTS
-            unsigned char *propdata;
-            int status, real_format;
-            Atom real_type;
-            unsigned long items_read, items_left, i;
-
-            char *name = X11_XGetAtomName(display, xevent.xproperty.atom);
-            if (name) {
-                printf("window %p: PropertyNotify: %s %s\n", data, name, (xevent.xproperty.state == PropertyDelete) ? "deleted" : "changed");
-                X11_XFree(name);
-            }
-
-            status = X11_XGetWindowProperty(display, data->xwindow, xevent.xproperty.atom, 0L, 8192L, False, AnyPropertyType, &real_type, &real_format, &items_read, &items_left, &propdata);
-            if (status == Success && items_read > 0) {
-                if (real_type == XA_INTEGER) {
-                    int *values = (int *)propdata;
-
-                    printf("{");
-                    for (i = 0; i < items_read; i++) {
-                        printf(" %d", values[i]);
-                    }
-                    printf(" }\n");
-                } else if (real_type == XA_CARDINAL) {
-                    if (real_format == 32) {
-                        Uint32 *values = (Uint32 *)propdata;
-
-                        printf("{");
-                        for (i = 0; i < items_read; i++) {
-                            printf(" %d", values[i]);
-                        }
-                        printf(" }\n");
-                    } else if (real_format == 16) {
-                        Uint16 *values = (Uint16 *)propdata;
-
-                        printf("{");
-                        for (i = 0; i < items_read; i++) {
-                            printf(" %d", values[i]);
-                        }
-                        printf(" }\n");
-                    } else if (real_format == 8) {
-                        Uint8 *values = (Uint8 *)propdata;
-
-                        printf("{");
-                        for (i = 0; i < items_read; i++) {
-                            printf(" %d", values[i]);
-                        }
-                        printf(" }\n");
-                    }
-                } else if (real_type == XA_STRING ||
-                           real_type == videodata->UTF8_STRING) {
-                    printf("{ \"%s\" }\n", propdata);
-                } else if (real_type == XA_ATOM) {
-                    Atom *atoms = (Atom *)propdata;
-
-                    printf("{");
-                    for (i = 0; i < items_read; i++) {
-                        char *name = X11_XGetAtomName(display, atoms[i]);
-                        if (name) {
-                            printf(" %s", name);
-                            X11_XFree(name);
-                        }
-                    }
-                    printf(" }\n");
-                } else {
-                    char *name = X11_XGetAtomName(display, real_type);
-                    printf("Unknown type: %ld (%s)\n", real_type, name ? name : "UNKNOWN");
-                    if (name) {
-                        X11_XFree(name);
-                    }
-                }
-            }
-            if (status == Success) {
-                X11_XFree(propdata);
-            }
-#endif /* DEBUG_XEVENTS */
-
-            if (xevent.xproperty.atom == data->videodata->_NET_WM_STATE) {
-                /* Get the new state from the window manager.
-                   Compositing window managers can alter visibility of windows
-                   without ever mapping / unmapping them, so we handle that here,
-                   because they use the NETWM protocol to notify us of changes.
-                 */
-                Uint32 flags = X11_GetNetWMState(_this, xevent.xproperty.window);
-                if ((flags^data->window->flags) & SDL_WINDOW_HIDDEN) {
-                    if (flags & SDL_WINDOW_HIDDEN) {
-                        X11_DispatchUnmapNotify(data);
-                    } else {
-                        X11_DispatchMapNotify(data);
-                    }
-                }
-            }
-        }
-        break;
-
-    /* Copy the selection from XA_CUT_BUFFER0 to the requested property */
-    case SelectionRequest: {
-            XSelectionRequestEvent *req;
-            XEvent sevent;
-            int seln_format;
-            unsigned long nbytes;
-            unsigned long overflow;
-            unsigned char *seln_data;
-
-            req = &xevent.xselectionrequest;
-#ifdef DEBUG_XEVENTS
-            printf("window %p: SelectionRequest (requestor = %ld, target = %ld)\n", data,
-                req->requestor, req->target);
-#endif
-
-            SDL_zero(sevent);
-            sevent.xany.type = SelectionNotify;
-            sevent.xselection.selection = req->selection;
-            sevent.xselection.target = None;
-            sevent.xselection.property = None;
-            sevent.xselection.requestor = req->requestor;
-            sevent.xselection.time = req->time;
-            if (X11_XGetWindowProperty(display, DefaultRootWindow(display),
-                    XA_CUT_BUFFER0, 0, INT_MAX/4, False, req->target,
-                    &sevent.xselection.target, &seln_format, &nbytes,
-                    &overflow, &seln_data) == Success) {
-                Atom XA_TARGETS = X11_XInternAtom(display, "TARGETS", 0);
-                if (sevent.xselection.target == req->target) {
-                    X11_XChangeProperty(display, req->requestor, req->property,
-                        sevent.xselection.target, seln_format, PropModeReplace,
-                        seln_data, nbytes);
-                    sevent.xselection.property = req->property;
-                } else if (XA_TARGETS == req->target) {
-                    Atom SupportedFormats[] = { sevent.xselection.target, XA_TARGETS };
-                    X11_XChangeProperty(display, req->requestor, req->property,
-                        XA_ATOM, 32, PropModeReplace,
-                        (unsigned char*)SupportedFormats,
-                        sizeof(SupportedFormats)/sizeof(*SupportedFormats));
-                    sevent.xselection.property = req->property;
-                }
-                X11_XFree(seln_data);
-            }
-            X11_XSendEvent(display, req->requestor, False, 0, &sevent);
-            X11_XSync(display, False);
-        }
-        break;
-
-    case SelectionNotify: {
-#ifdef DEBUG_XEVENTS
-            printf("window %p: SelectionNotify (requestor = %ld, target = %ld)\n", data,
-                xevent.xselection.requestor, xevent.xselection.target);
-#endif
-            Atom target = xevent.xselection.target;
-            if (target == data->xdnd_req) {
-                /* read data */
-                SDL_x11Prop p;
-                X11_ReadProperty(&p, display, data->xwindow, videodata->PRIMARY);
-
-                if (p.format == 8) {
-                    SDL_bool expect_lf = SDL_FALSE;
-                    char *start = NULL;
-                    char *scan = (char*)p.data;
-                    char *fn;
-                    char *uri;
-                    int length = 0;
-                    while (p.count--) {
-                        if (!expect_lf) {
-                            if (*scan == 0x0D) {
-                                expect_lf = SDL_TRUE;
-                            }
-                            if (start == NULL) {
-                                start = scan;
-                                length = 0;
-                            }
-                            length++;
-                        } else {
-                            if (*scan == 0x0A && length > 0) {
-                                uri = SDL_malloc(length--);
-                                SDL_memcpy(uri, start, length);
-                                uri[length] = '\0';
-                                fn = X11_URIToLocal(uri);
-                                if (fn) {
-                                    SDL_SendDropFile(fn);
-                                }
-                                SDL_free(uri);
-                            }
-                            expect_lf = SDL_FALSE;
-                            start = NULL;
-                        }
-                        scan++;
-                    }
-                }
-
-                X11_XFree(p.data);
-
-                /* send reply */
-                SDL_memset(&m, 0, sizeof(XClientMessageEvent));
-                m.type = ClientMessage;
-                m.display = display;
-                m.window = data->xdnd_source;
-                m.message_type = videodata->XdndFinished;
-                m.format = 32;
-                m.data.l[0] = data->xwindow;
-                m.data.l[1] = 1;
-                m.data.l[2] = videodata->XdndActionCopy;
-                X11_XSendEvent(display, data->xdnd_source, False, NoEventMask, (XEvent*)&m);
-
-                X11_XSync(display, False);
-
-            } else {
-                videodata->selection_waiting = SDL_FALSE;
-            }
-        }
-        break;
-
-    default:{
-#ifdef DEBUG_XEVENTS
-            printf("window %p: Unhandled event %d\n", data, xevent.type);
-#endif
-        }
-        break;
-    }
-}
-
-static void
-X11_HandleFocusChanges(_THIS)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-    int i;
-
-    if (videodata && videodata->windowlist) {
-        for (i = 0; i < videodata->numwindows; ++i) {
-            SDL_WindowData *data = videodata->windowlist[i];
-            if (data && data->pending_focus != PENDING_FOCUS_NONE) {
-                Uint32 now = SDL_GetTicks();
-                if (SDL_TICKS_PASSED(now, data->pending_focus_time)) {
-                    if ( data->pending_focus == PENDING_FOCUS_IN ) {
-                        X11_DispatchFocusIn(data);
-                    } else {
-                        X11_DispatchFocusOut(data);
-                    }
-                    data->pending_focus = PENDING_FOCUS_NONE;
-                }
-            }
-        }
-    }
-}
-/* Ack!  X11_XPending() actually performs a blocking read if no events available */
-static int
-X11_Pending(Display * display)
-{
-    /* Flush the display connection and look to see if events are queued */
-    X11_XFlush(display);
-    if (X11_XEventsQueued(display, QueuedAlready)) {
-        return (1);
-    }
-
-    /* More drastic measures are required -- see if X is ready to talk */
-    {
-        static struct timeval zero_time;        /* static == 0 */
-        int x11_fd;
-        fd_set fdset;
-
-        x11_fd = ConnectionNumber(display);
-        FD_ZERO(&fdset);
-        FD_SET(x11_fd, &fdset);
-        if (select(x11_fd + 1, &fdset, NULL, NULL, &zero_time) == 1) {
-            return (X11_XPending(display));
-        }
-    }
-
-    /* Oh well, nothing is ready .. */
-    return (0);
-}
-
-
-/* !!! FIXME: this should be exposed in a header, or something. */
-int SDL_GetNumTouch(void);
-void SDL_dbus_screensaver_tickle(_THIS);
-
-void
-X11_PumpEvents(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    /* Update activity every 30 seconds to prevent screensaver */
-    if (_this->suspend_screensaver) {
-        Uint32 now = SDL_GetTicks();
-        if (!data->screensaver_activity ||
-            SDL_TICKS_PASSED(now, data->screensaver_activity + 30000)) {
-            X11_XResetScreenSaver(data->display);
-
-            #if SDL_USE_LIBDBUS
-            SDL_dbus_screensaver_tickle(_this);
-            #endif
-
-            data->screensaver_activity = now;
-        }
-    }
-
-    /* Keep processing pending events */
-    while (X11_Pending(data->display)) {
-        X11_DispatchEvent(_this);
-    }
-
-    /* FIXME: Only need to do this when there are pending focus changes */
-    X11_HandleFocusChanges(_this);
-}
-
-
-void
-X11_SuspendScreenSaver(_THIS)
-{
-#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    int dummy;
-    int major_version, minor_version;
-
-    if (SDL_X11_HAVE_XSS) {
-        /* X11_XScreenSaverSuspend was introduced in MIT-SCREEN-SAVER 1.1 */
-        if (!X11_XScreenSaverQueryExtension(data->display, &dummy, &dummy) ||
-            !X11_XScreenSaverQueryVersion(data->display,
-                                      &major_version, &minor_version) ||
-            major_version < 1 || (major_version == 1 && minor_version < 1)) {
-            return;
-        }
-
-        X11_XScreenSaverSuspend(data->display, _this->suspend_screensaver);
-        X11_XResetScreenSaver(data->display);
-    }
-#endif
-
-#if SDL_USE_LIBDBUS
-    if (_this->suspend_screensaver) {
-        SDL_dbus_screensaver_tickle(_this);
-    }
-#endif
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11events.h b/deps/SDL2/src/video/x11/SDL_x11events.h
deleted file mode 100644
index 3b61175..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11events.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11events_h
-#define _SDL_x11events_h
-
-extern void X11_PumpEvents(_THIS);
-extern void X11_SuspendScreenSaver(_THIS);
-
-#endif /* _SDL_x11events_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11framebuffer.c b/deps/SDL2/src/video/x11/SDL_x11framebuffer.c
deleted file mode 100644
index af39147..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11framebuffer.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include "SDL_x11video.h"
-#include "SDL_x11framebuffer.h"
-
-
-#ifndef NO_SHARED_MEMORY
-
-/* Shared memory error handler routine */
-static int shm_error;
-static int (*X_handler)(Display *, XErrorEvent *) = NULL;
-static int shm_errhandler(Display *d, XErrorEvent *e)
-{
-        if ( e->error_code == BadAccess ) {
-            shm_error = True;
-            return(0);
-        } else
-        return(X_handler(d,e));
-}
-
-static SDL_bool have_mitshm(void)
-{
-    /* Only use shared memory on local X servers */
-    if ( (SDL_strncmp(X11_XDisplayName(NULL), ":", 1) == 0) ||
-         (SDL_strncmp(X11_XDisplayName(NULL), "unix:", 5) == 0) ) {
-        return SDL_X11_HAVE_SHM;
-    }
-    return SDL_FALSE;
-}
-
-#endif /* !NO_SHARED_MEMORY */
-
-int
-X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format,
-                            void ** pixels, int *pitch)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-    XGCValues gcv;
-    XVisualInfo vinfo;
-
-    /* Free the old framebuffer surface */
-    X11_DestroyWindowFramebuffer(_this, window);
-
-    /* Create the graphics context for drawing */
-    gcv.graphics_exposures = False;
-    data->gc = X11_XCreateGC(display, data->xwindow, GCGraphicsExposures, &gcv);
-    if (!data->gc) {
-        return SDL_SetError("Couldn't create graphics context");
-    }
-
-    /* Find out the pixel format and depth */
-    if (X11_GetVisualInfoFromVisual(display, data->visual, &vinfo) < 0) {
-        return SDL_SetError("Couldn't get window visual information");
-    }
-
-    *format = X11_GetPixelFormatFromVisualInfo(display, &vinfo);
-    if (*format == SDL_PIXELFORMAT_UNKNOWN) {
-        return SDL_SetError("Unknown window pixel format");
-    }
-
-    /* Calculate pitch */
-    *pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3);
-
-    /* Create the actual image */
-#ifndef NO_SHARED_MEMORY
-    if (have_mitshm()) {
-        XShmSegmentInfo *shminfo = &data->shminfo;
-
-        shminfo->shmid = shmget(IPC_PRIVATE, window->h*(*pitch), IPC_CREAT | 0777);
-        if ( shminfo->shmid >= 0 ) {
-            shminfo->shmaddr = (char *)shmat(shminfo->shmid, 0, 0);
-            shminfo->readOnly = False;
-            if ( shminfo->shmaddr != (char *)-1 ) {
-                shm_error = False;
-                X_handler = X11_XSetErrorHandler(shm_errhandler);
-                X11_XShmAttach(display, shminfo);
-                X11_XSync(display, True);
-                X11_XSetErrorHandler(X_handler);
-                if ( shm_error )
-                    shmdt(shminfo->shmaddr);
-            } else {
-                shm_error = True;
-            }
-            shmctl(shminfo->shmid, IPC_RMID, NULL);
-        } else {
-            shm_error = True;
-        }
-        if (!shm_error) {
-            data->ximage = X11_XShmCreateImage(display, data->visual,
-                             vinfo.depth, ZPixmap,
-                             shminfo->shmaddr, shminfo,
-                             window->w, window->h);
-            if (!data->ximage) {
-                X11_XShmDetach(display, shminfo);
-                X11_XSync(display, False);
-                shmdt(shminfo->shmaddr);
-            } else {
-                /* Done! */
-                data->use_mitshm = SDL_TRUE;
-                *pixels = shminfo->shmaddr;
-                return 0;
-            }
-        }
-    }
-#endif /* not NO_SHARED_MEMORY */
-
-    *pixels = SDL_malloc(window->h*(*pitch));
-    if (*pixels == NULL) {
-        return SDL_OutOfMemory();
-    }
-
-    data->ximage = X11_XCreateImage(display, data->visual,
-                      vinfo.depth, ZPixmap, 0, (char *)(*pixels),
-                      window->w, window->h, 32, 0);
-    if (!data->ximage) {
-        SDL_free(*pixels);
-        return SDL_SetError("Couldn't create XImage");
-    }
-    return 0;
-}
-
-int
-X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects,
-                            int numrects)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-    int i;
-    int x, y, w ,h;
-#ifndef NO_SHARED_MEMORY
-    if (data->use_mitshm) {
-        for (i = 0; i < numrects; ++i) {
-            x = rects[i].x;
-            y = rects[i].y;
-            w = rects[i].w;
-            h = rects[i].h;
-
-            if (w <= 0 || h <= 0 || (x + w) <= 0 || (y + h) <= 0) {
-                /* Clipped? */
-                continue;
-            }
-            if (x < 0)
-            {
-                x += w;
-                w += rects[i].x;
-            }
-            if (y < 0)
-            {
-                y += h;
-                h += rects[i].y;
-            }
-            if (x + w > window->w)
-                w = window->w - x;
-            if (y + h > window->h)
-                h = window->h - y;
-
-            X11_XShmPutImage(display, data->xwindow, data->gc, data->ximage,
-                x, y, x, y, w, h, False);
-        }
-    }
-    else
-#endif /* !NO_SHARED_MEMORY */
-    {
-        for (i = 0; i < numrects; ++i) {
-            x = rects[i].x;
-            y = rects[i].y;
-            w = rects[i].w;
-            h = rects[i].h;
-
-            if (w <= 0 || h <= 0 || (x + w) <= 0 || (y + h) <= 0) {
-                /* Clipped? */
-                continue;
-            }
-            if (x < 0)
-            {
-                x += w;
-                w += rects[i].x;
-            }
-            if (y < 0)
-            {
-                y += h;
-                h += rects[i].y;
-            }
-            if (x + w > window->w)
-                w = window->w - x;
-            if (y + h > window->h)
-                h = window->h - y;
-
-            X11_XPutImage(display, data->xwindow, data->gc, data->ximage,
-                x, y, x, y, w, h);
-        }
-    }
-
-    X11_XSync(display, False);
-
-    return 0;
-}
-
-void
-X11_DestroyWindowFramebuffer(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display;
-
-    if (!data) {
-        /* The window wasn't fully initialized */
-        return;
-    }
-
-    display = data->videodata->display;
-
-    if (data->ximage) {
-        XDestroyImage(data->ximage);
-
-#ifndef NO_SHARED_MEMORY
-        if (data->use_mitshm) {
-            X11_XShmDetach(display, &data->shminfo);
-            X11_XSync(display, False);
-            shmdt(data->shminfo.shmaddr);
-            data->use_mitshm = SDL_FALSE;
-        }
-#endif /* !NO_SHARED_MEMORY */
-
-        data->ximage = NULL;
-    }
-    if (data->gc) {
-        X11_XFreeGC(display, data->gc);
-        data->gc = NULL;
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11framebuffer.h b/deps/SDL2/src/video/x11/SDL_x11framebuffer.h
deleted file mode 100644
index 8e4c21a..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11framebuffer.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-
-extern int X11_CreateWindowFramebuffer(_THIS, SDL_Window * window,
-                                       Uint32 * format,
-                                       void ** pixels, int *pitch);
-extern int X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
-                                       const SDL_Rect * rects, int numrects);
-extern void X11_DestroyWindowFramebuffer(_THIS, SDL_Window * window);
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11keyboard.c b/deps/SDL2/src/video/x11/SDL_x11keyboard.c
deleted file mode 100644
index f3b83c9..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11keyboard.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include "SDL_x11video.h"
-
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/scancodes_darwin.h"
-#include "../../events/scancodes_xfree86.h"
-
-#include <X11/keysym.h>
-
-#include "imKStoUCS.h"
-
-/* *INDENT-OFF* */
-static const struct {
-    KeySym keysym;
-    SDL_Scancode scancode;
-} KeySymToSDLScancode[] = {
-    { XK_Return, SDL_SCANCODE_RETURN },
-    { XK_Escape, SDL_SCANCODE_ESCAPE },
-    { XK_BackSpace, SDL_SCANCODE_BACKSPACE },
-    { XK_Tab, SDL_SCANCODE_TAB },
-    { XK_Caps_Lock, SDL_SCANCODE_CAPSLOCK },
-    { XK_F1, SDL_SCANCODE_F1 },
-    { XK_F2, SDL_SCANCODE_F2 },
-    { XK_F3, SDL_SCANCODE_F3 },
-    { XK_F4, SDL_SCANCODE_F4 },
-    { XK_F5, SDL_SCANCODE_F5 },
-    { XK_F6, SDL_SCANCODE_F6 },
-    { XK_F7, SDL_SCANCODE_F7 },
-    { XK_F8, SDL_SCANCODE_F8 },
-    { XK_F9, SDL_SCANCODE_F9 },
-    { XK_F10, SDL_SCANCODE_F10 },
-    { XK_F11, SDL_SCANCODE_F11 },
-    { XK_F12, SDL_SCANCODE_F12 },
-    { XK_Print, SDL_SCANCODE_PRINTSCREEN },
-    { XK_Scroll_Lock, SDL_SCANCODE_SCROLLLOCK },
-    { XK_Pause, SDL_SCANCODE_PAUSE },
-    { XK_Insert, SDL_SCANCODE_INSERT },
-    { XK_Home, SDL_SCANCODE_HOME },
-    { XK_Prior, SDL_SCANCODE_PAGEUP },
-    { XK_Delete, SDL_SCANCODE_DELETE },
-    { XK_End, SDL_SCANCODE_END },
-    { XK_Next, SDL_SCANCODE_PAGEDOWN },
-    { XK_Right, SDL_SCANCODE_RIGHT },
-    { XK_Left, SDL_SCANCODE_LEFT },
-    { XK_Down, SDL_SCANCODE_DOWN },
-    { XK_Up, SDL_SCANCODE_UP },
-    { XK_Num_Lock, SDL_SCANCODE_NUMLOCKCLEAR },
-    { XK_KP_Divide, SDL_SCANCODE_KP_DIVIDE },
-    { XK_KP_Multiply, SDL_SCANCODE_KP_MULTIPLY },
-    { XK_KP_Subtract, SDL_SCANCODE_KP_MINUS },
-    { XK_KP_Add, SDL_SCANCODE_KP_PLUS },
-    { XK_KP_Enter, SDL_SCANCODE_KP_ENTER },
-    { XK_KP_Delete, SDL_SCANCODE_KP_PERIOD },
-    { XK_KP_End, SDL_SCANCODE_KP_1 },
-    { XK_KP_Down, SDL_SCANCODE_KP_2 },
-    { XK_KP_Next, SDL_SCANCODE_KP_3 },
-    { XK_KP_Left, SDL_SCANCODE_KP_4 },
-    { XK_KP_Begin, SDL_SCANCODE_KP_5 },
-    { XK_KP_Right, SDL_SCANCODE_KP_6 },
-    { XK_KP_Home, SDL_SCANCODE_KP_7 },
-    { XK_KP_Up, SDL_SCANCODE_KP_8 },
-    { XK_KP_Prior, SDL_SCANCODE_KP_9 },
-    { XK_KP_Insert, SDL_SCANCODE_KP_0 },
-    { XK_KP_Decimal, SDL_SCANCODE_KP_PERIOD },
-    { XK_KP_1, SDL_SCANCODE_KP_1 },
-    { XK_KP_2, SDL_SCANCODE_KP_2 },
-    { XK_KP_3, SDL_SCANCODE_KP_3 },
-    { XK_KP_4, SDL_SCANCODE_KP_4 },
-    { XK_KP_5, SDL_SCANCODE_KP_5 },
-    { XK_KP_6, SDL_SCANCODE_KP_6 },
-    { XK_KP_7, SDL_SCANCODE_KP_7 },
-    { XK_KP_8, SDL_SCANCODE_KP_8 },
-    { XK_KP_9, SDL_SCANCODE_KP_9 },
-    { XK_KP_0, SDL_SCANCODE_KP_0 },
-    { XK_KP_Decimal, SDL_SCANCODE_KP_PERIOD },
-    { XK_Hyper_R, SDL_SCANCODE_APPLICATION },
-    { XK_KP_Equal, SDL_SCANCODE_KP_EQUALS },
-    { XK_F13, SDL_SCANCODE_F13 },
-    { XK_F14, SDL_SCANCODE_F14 },
-    { XK_F15, SDL_SCANCODE_F15 },
-    { XK_F16, SDL_SCANCODE_F16 },
-    { XK_F17, SDL_SCANCODE_F17 },
-    { XK_F18, SDL_SCANCODE_F18 },
-    { XK_F19, SDL_SCANCODE_F19 },
-    { XK_F20, SDL_SCANCODE_F20 },
-    { XK_F21, SDL_SCANCODE_F21 },
-    { XK_F22, SDL_SCANCODE_F22 },
-    { XK_F23, SDL_SCANCODE_F23 },
-    { XK_F24, SDL_SCANCODE_F24 },
-    { XK_Execute, SDL_SCANCODE_EXECUTE },
-    { XK_Help, SDL_SCANCODE_HELP },
-    { XK_Menu, SDL_SCANCODE_MENU },
-    { XK_Select, SDL_SCANCODE_SELECT },
-    { XK_Cancel, SDL_SCANCODE_STOP },
-    { XK_Redo, SDL_SCANCODE_AGAIN },
-    { XK_Undo, SDL_SCANCODE_UNDO },
-    { XK_Find, SDL_SCANCODE_FIND },
-    { XK_KP_Separator, SDL_SCANCODE_KP_COMMA },
-    { XK_Sys_Req, SDL_SCANCODE_SYSREQ },
-    { XK_Control_L, SDL_SCANCODE_LCTRL },
-    { XK_Shift_L, SDL_SCANCODE_LSHIFT },
-    { XK_Alt_L, SDL_SCANCODE_LALT },
-    { XK_Meta_L, SDL_SCANCODE_LGUI },
-    { XK_Super_L, SDL_SCANCODE_LGUI },
-    { XK_Control_R, SDL_SCANCODE_RCTRL },
-    { XK_Shift_R, SDL_SCANCODE_RSHIFT },
-    { XK_Alt_R, SDL_SCANCODE_RALT },
-    { XK_Meta_R, SDL_SCANCODE_RGUI },
-    { XK_Super_R, SDL_SCANCODE_RGUI },
-    { XK_Mode_switch, SDL_SCANCODE_MODE },
-};
-
-static const struct
-{
-    SDL_Scancode const *table;
-    int table_size;
-} scancode_set[] = {
-    { darwin_scancode_table, SDL_arraysize(darwin_scancode_table) },
-    { xfree86_scancode_table, SDL_arraysize(xfree86_scancode_table) },
-    { xfree86_scancode_table2, SDL_arraysize(xfree86_scancode_table2) },
-};
-/* *INDENT-OFF* */
-
-/* This function only works for keyboards in US QWERTY layout */
-static SDL_Scancode
-X11_KeyCodeToSDLScancode(Display *display, KeyCode keycode)
-{
-    KeySym keysym;
-    int i;
-
-#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
-    keysym = X11_XkbKeycodeToKeysym(display, keycode, 0, 0);
-#else
-    keysym = XKeycodeToKeysym(display, keycode, 0);
-#endif
-    if (keysym == NoSymbol) {
-        return SDL_SCANCODE_UNKNOWN;
-    }
-
-    if (keysym >= XK_A && keysym <= XK_Z) {
-        return SDL_SCANCODE_A + (keysym - XK_A);
-    }
-
-    if (keysym >= XK_0 && keysym <= XK_9) {
-        return SDL_SCANCODE_0 + (keysym - XK_0);
-    }
-
-    for (i = 0; i < SDL_arraysize(KeySymToSDLScancode); ++i) {
-        if (keysym == KeySymToSDLScancode[i].keysym) {
-            return KeySymToSDLScancode[i].scancode;
-        }
-    }
-    return SDL_SCANCODE_UNKNOWN;
-}
-
-static Uint32
-X11_KeyCodeToUcs4(Display *display, KeyCode keycode)
-{
-    KeySym keysym;
-
-#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
-    keysym = X11_XkbKeycodeToKeysym(display, keycode, 0, 0);
-#else
-    keysym = XKeycodeToKeysym(display, keycode, 0);
-#endif
-    if (keysym == NoSymbol) {
-        return 0;
-    }
-
-    return X11_KeySymToUcs4(keysym);
-}
-
-int
-X11_InitKeyboard(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    int i = 0;
-    int j = 0;
-    int min_keycode, max_keycode;
-    struct {
-        SDL_Scancode scancode;
-        KeySym keysym;
-        int value;
-    } fingerprint[] = {
-        { SDL_SCANCODE_HOME, XK_Home, 0 },
-        { SDL_SCANCODE_PAGEUP, XK_Prior, 0 },
-        { SDL_SCANCODE_PAGEDOWN, XK_Next, 0 },
-    };
-    SDL_bool fingerprint_detected;
-
-    X11_XAutoRepeatOn(data->display);
-
-    /* Try to determine which scancodes are being used based on fingerprint */
-    fingerprint_detected = SDL_FALSE;
-    X11_XDisplayKeycodes(data->display, &min_keycode, &max_keycode);
-    for (i = 0; i < SDL_arraysize(fingerprint); ++i) {
-        fingerprint[i].value =
-            X11_XKeysymToKeycode(data->display, fingerprint[i].keysym) -
-            min_keycode;
-    }
-    for (i = 0; i < SDL_arraysize(scancode_set); ++i) {
-        /* Make sure the scancode set isn't too big */
-        if ((max_keycode - min_keycode + 1) <= scancode_set[i].table_size) {
-            continue;
-        }
-        for (j = 0; j < SDL_arraysize(fingerprint); ++j) {
-            if (fingerprint[j].value < 0
-                || fingerprint[j].value >= scancode_set[i].table_size) {
-                break;
-            }
-            if (scancode_set[i].table[fingerprint[j].value] !=
-                fingerprint[j].scancode) {
-                break;
-            }
-        }
-        if (j == SDL_arraysize(fingerprint)) {
-#ifdef DEBUG_KEYBOARD
-            printf("Using scancode set %d, min_keycode = %d, max_keycode = %d, table_size = %d\n", i, min_keycode, max_keycode, scancode_set[i].table_size);
-#endif
-            SDL_memcpy(&data->key_layout[min_keycode], scancode_set[i].table,
-                       sizeof(SDL_Scancode) * scancode_set[i].table_size);
-            fingerprint_detected = SDL_TRUE;
-            break;
-        }
-    }
-
-    if (!fingerprint_detected) {
-        SDL_Keycode keymap[SDL_NUM_SCANCODES];
-
-        printf
-            ("Keyboard layout unknown, please send the following to the SDL mailing list (sdl at libsdl.org):\n");
-
-        /* Determine key_layout - only works on US QWERTY layout */
-        SDL_GetDefaultKeymap(keymap);
-        for (i = min_keycode; i <= max_keycode; ++i) {
-            KeySym sym;
-#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
-            sym = X11_XkbKeycodeToKeysym(data->display, i, 0, 0);
-#else
-            sym = XKeycodeToKeysym(data->display, i, 0);
-#endif
-            if (sym != NoSymbol) {
-                SDL_Scancode scancode;
-                printf("code = %d, sym = 0x%X (%s) ", i - min_keycode,
-                       (unsigned int) sym, X11_XKeysymToString(sym));
-                scancode = X11_KeyCodeToSDLScancode(data->display, i);
-                data->key_layout[i] = scancode;
-                if (scancode == SDL_SCANCODE_UNKNOWN) {
-                    printf("scancode not found\n");
-                } else {
-                    printf("scancode = %d (%s)\n", scancode, SDL_GetScancodeName(scancode));
-                }
-            }
-        }
-    }
-
-    X11_UpdateKeymap(_this);
-
-    SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu");
-
-    return 0;
-}
-
-void
-X11_UpdateKeymap(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    int i;
-    SDL_Scancode scancode;
-    SDL_Keycode keymap[SDL_NUM_SCANCODES];
-
-    SDL_GetDefaultKeymap(keymap);
-    for (i = 0; i < SDL_arraysize(data->key_layout); i++) {
-        Uint32 key;
-
-        /* Make sure this is a valid scancode */
-        scancode = data->key_layout[i];
-        if (scancode == SDL_SCANCODE_UNKNOWN) {
-            continue;
-        }
-
-        /* See if there is a UCS keycode for this scancode */
-        key = X11_KeyCodeToUcs4(data->display, (KeyCode)i);
-        if (key) {
-            keymap[scancode] = key;
-        }
-    }
-    SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
-}
-
-void
-X11_QuitKeyboard(_THIS)
-{
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11keyboard.h b/deps/SDL2/src/video/x11/SDL_x11keyboard.h
deleted file mode 100644
index 5a02311..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11keyboard.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11keyboard_h
-#define _SDL_x11keyboard_h
-
-extern int X11_InitKeyboard(_THIS);
-extern void X11_UpdateKeymap(_THIS);
-extern void X11_QuitKeyboard(_THIS);
-
-#endif /* _SDL_x11keyboard_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11messagebox.c b/deps/SDL2/src/video/x11/SDL_x11messagebox.c
deleted file mode 100644
index 81c1480..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11messagebox.c
+++ /dev/null
@@ -1,758 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include "SDL.h"
-#include "SDL_x11video.h"
-#include "SDL_x11dyn.h"
-#include "SDL_assert.h"
-
-#include <locale.h>
-
-
-#define SDL_FORK_MESSAGEBOX 0
-#define SDL_SET_LOCALE      0
-
-#if SDL_FORK_MESSAGEBOX
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <errno.h>
-#endif
-
-#define MAX_BUTTONS             8       /* Maximum number of buttons supported */
-#define MAX_TEXT_LINES          32      /* Maximum number of text lines supported */
-#define MIN_BUTTON_WIDTH        64      /* Minimum button width */
-#define MIN_DIALOG_WIDTH        200     /* Minimum dialog width */
-#define MIN_DIALOG_HEIGHT       100     /* Minimum dialog height */
-
-static const char g_MessageBoxFontLatin1[] = "-*-*-medium-r-normal--0-120-*-*-p-0-iso8859-1";
-static const char g_MessageBoxFont[] = "-*-*-*-*-*-*-*-*-*-*-*-*-*-*";
-
-static const SDL_MessageBoxColor g_default_colors[ SDL_MESSAGEBOX_COLOR_MAX ] = {
-    { 56,  54,  53  }, /* SDL_MESSAGEBOX_COLOR_BACKGROUND, */
-    { 209, 207, 205 }, /* SDL_MESSAGEBOX_COLOR_TEXT, */
-    { 140, 135, 129 }, /* SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, */
-    { 105, 102, 99  }, /* SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, */
-    { 205, 202, 53  }, /* SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, */
-};
-
-#define SDL_MAKE_RGB( _r, _g, _b )  ( ( ( Uint32 )( _r ) << 16 ) | \
-                                      ( ( Uint32 )( _g ) << 8 ) |  \
-                                      ( ( Uint32 )( _b ) ) )
-
-typedef struct SDL_MessageBoxButtonDataX11 {
-    int x, y;                           /* Text position */
-    int length;                         /* Text length */
-    int text_width;                     /* Text width */
-
-    SDL_Rect rect;                      /* Rectangle for entire button */
-
-    const SDL_MessageBoxButtonData *buttondata;   /* Button data from caller */
-} SDL_MessageBoxButtonDataX11;
-
-typedef struct TextLineData {
-    int width;                          /* Width of this text line */
-    int length;                         /* String length of this text line */
-    const char *text;                   /* Text for this line */
-} TextLineData;
-
-typedef struct SDL_MessageBoxDataX11
-{
-    Display *display;
-    int screen;
-    Window window;
-    long event_mask;
-    Atom wm_protocols;
-    Atom wm_delete_message;
-
-    int dialog_width;                   /* Dialog box width. */
-    int dialog_height;                  /* Dialog box height. */
-
-    XFontSet font_set;                  /* for UTF-8 systems */
-    XFontStruct *font_struct;           /* Latin1 (ASCII) fallback. */
-    int xtext, ytext;                   /* Text position to start drawing at. */
-    int numlines;                       /* Count of Text lines. */
-    int text_height;                    /* Height for text lines. */
-    TextLineData linedata[ MAX_TEXT_LINES ];
-
-    int *pbuttonid;                     /* Pointer to user return buttonid value. */
-
-    int button_press_index;             /* Index into buttondata/buttonpos for button which is pressed (or -1). */
-    int mouse_over_index;               /* Index into buttondata/buttonpos for button mouse is over (or -1). */
-
-    int numbuttons;                     /* Count of buttons. */
-    const SDL_MessageBoxButtonData *buttondata;
-    SDL_MessageBoxButtonDataX11 buttonpos[ MAX_BUTTONS ];
-
-    Uint32 color[ SDL_MESSAGEBOX_COLOR_MAX ];
-
-    const SDL_MessageBoxData *messageboxdata;
-} SDL_MessageBoxDataX11;
-
-/* Maximum helper for ints. */
-static SDL_INLINE int
-IntMax( int a, int b )
-{
-    return ( a > b  ) ? a : b;
-}
-
-/* Return width and height for a string. */
-static void
-GetTextWidthHeight( SDL_MessageBoxDataX11 *data, const char *str, int nbytes, int *pwidth, int *pheight )
-{
-    if (SDL_X11_HAVE_UTF8) {
-        XRectangle overall_ink, overall_logical;
-        X11_Xutf8TextExtents(data->font_set, str, nbytes, &overall_ink, &overall_logical);
-        *pwidth = overall_logical.width;
-        *pheight = overall_logical.height;
-    } else {
-        XCharStruct text_structure;
-        int font_direction, font_ascent, font_descent;
-        X11_XTextExtents( data->font_struct, str, nbytes,
-                      &font_direction, &font_ascent, &font_descent,
-                      &text_structure );
-        *pwidth = text_structure.width;
-        *pheight = text_structure.ascent + text_structure.descent;
-    }
-}
-
-/* Return index of button if position x,y is contained therein. */
-static int
-GetHitButtonIndex( SDL_MessageBoxDataX11 *data, int x, int y )
-{
-    int i;
-    int numbuttons = data->numbuttons;
-    SDL_MessageBoxButtonDataX11 *buttonpos = data->buttonpos;
-
-    for ( i = 0; i < numbuttons; i++ ) {
-        SDL_Rect *rect = &buttonpos[ i ].rect;
-
-        if ( ( x >= rect->x ) &&
-             ( x <= ( rect->x + rect->w ) ) &&
-             ( y >= rect->y ) &&
-             ( y <= ( rect->y + rect->h ) ) ) {
-            return i;
-        }
-    }
-
-    return -1;
-}
-
-/* Initialize SDL_MessageBoxData structure and Display, etc. */
-static int
-X11_MessageBoxInit( SDL_MessageBoxDataX11 *data, const SDL_MessageBoxData * messageboxdata, int * pbuttonid )
-{
-    int i;
-    int numbuttons = messageboxdata->numbuttons;
-    const SDL_MessageBoxButtonData *buttondata = messageboxdata->buttons;
-    const SDL_MessageBoxColor *colorhints;
-
-    if ( numbuttons > MAX_BUTTONS ) {
-        return SDL_SetError("Too many buttons (%d max allowed)", MAX_BUTTONS);
-    }
-
-    data->dialog_width = MIN_DIALOG_WIDTH;
-    data->dialog_height = MIN_DIALOG_HEIGHT;
-    data->messageboxdata = messageboxdata;
-    data->buttondata = buttondata;
-    data->numbuttons = numbuttons;
-    data->pbuttonid = pbuttonid;
-
-    data->display = X11_XOpenDisplay( NULL );
-    if ( !data->display ) {
-        return SDL_SetError("Couldn't open X11 display");
-    }
-
-    if (SDL_X11_HAVE_UTF8) {
-        char **missing = NULL;
-        int num_missing = 0;
-        data->font_set = X11_XCreateFontSet(data->display, g_MessageBoxFont,
-                                        &missing, &num_missing, NULL);
-        if ( missing != NULL ) {
-            X11_XFreeStringList(missing);
-        }
-        if ( data->font_set == NULL ) {
-            return SDL_SetError("Couldn't load font %s", g_MessageBoxFont);
-        }
-    } else {
-        data->font_struct = X11_XLoadQueryFont( data->display, g_MessageBoxFontLatin1 );
-        if ( data->font_struct == NULL ) {
-            return SDL_SetError("Couldn't load font %s", g_MessageBoxFontLatin1);
-        }
-    }
-
-    if ( messageboxdata->colorScheme ) {
-        colorhints = messageboxdata->colorScheme->colors;
-    } else {
-        colorhints = g_default_colors;
-    }
-
-    /* Convert our SDL_MessageBoxColor r,g,b values to packed RGB format. */
-    for ( i = 0; i < SDL_MESSAGEBOX_COLOR_MAX; i++ ) {
-        data->color[ i ] = SDL_MAKE_RGB( colorhints[ i ].r, colorhints[ i ].g, colorhints[ i ].b );
-    }
-
-    return 0;
-}
-
-/* Calculate and initialize text and button locations. */
-static int
-X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data )
-{
-    int i;
-    int ybuttons;
-    int text_width_max = 0;
-    int button_text_height = 0;
-    int button_width = MIN_BUTTON_WIDTH;
-    const SDL_MessageBoxData *messageboxdata = data->messageboxdata;
-
-    /* Go over text and break linefeeds into separate lines. */
-    if ( messageboxdata->message && messageboxdata->message[ 0 ] ) {
-        const char *text = messageboxdata->message;
-        TextLineData *plinedata = data->linedata;
-
-        for ( i = 0; i < MAX_TEXT_LINES; i++, plinedata++ ) {
-            int height;
-            char *lf = SDL_strchr( ( char * )text, '\n' );
-
-            data->numlines++;
-
-            /* Only grab length up to lf if it exists and isn't the last line. */
-            plinedata->length = ( lf && ( i < MAX_TEXT_LINES - 1 ) ) ? ( lf - text ) : SDL_strlen( text );
-            plinedata->text = text;
-
-            GetTextWidthHeight( data, text, plinedata->length, &plinedata->width, &height );
-
-            /* Text and widths are the largest we've ever seen. */
-            data->text_height = IntMax( data->text_height, height );
-            text_width_max = IntMax( text_width_max, plinedata->width );
-
-            if (lf && (lf > text) && (lf[-1] == '\r')) {
-                plinedata->length--;
-            }
-
-            text += plinedata->length + 1;
-
-            /* Break if there are no more linefeeds. */
-            if ( !lf )
-                break;
-        }
-
-        /* Bump up the text height slightly. */
-        data->text_height += 2;
-    }
-
-    /* Loop through all buttons and calculate the button widths and height. */
-    for ( i = 0; i < data->numbuttons; i++ ) {
-        int height;
-
-        data->buttonpos[ i ].buttondata = &data->buttondata[ i ];
-        data->buttonpos[ i ].length = SDL_strlen( data->buttondata[ i ].text );
-
-        GetTextWidthHeight( data, data->buttondata[ i ].text, SDL_strlen( data->buttondata[ i ].text ),
-                            &data->buttonpos[ i ].text_width, &height );
-
-        button_width = IntMax( button_width, data->buttonpos[ i ].text_width );
-        button_text_height = IntMax( button_text_height, height );
-    }
-
-    if ( data->numlines ) {
-        /* x,y for this line of text. */
-        data->xtext = data->text_height;
-        data->ytext = data->text_height + data->text_height;
-
-        /* Bump button y down to bottom of text. */
-        ybuttons = 3 * data->ytext / 2 + ( data->numlines - 1 ) * data->text_height;
-
-        /* Bump the dialog box width and height up if needed. */
-        data->dialog_width = IntMax( data->dialog_width, 2 * data->xtext + text_width_max );
-        data->dialog_height = IntMax( data->dialog_height, ybuttons );
-    } else {
-        /* Button y starts at height of button text. */
-        ybuttons = button_text_height;
-    }
-
-    if ( data->numbuttons ) {
-        int x, y;
-        int width_of_buttons;
-        int button_spacing = button_text_height;
-        int button_height = 2 * button_text_height;
-
-        /* Bump button width up a bit. */
-        button_width += button_text_height;
-
-        /* Get width of all buttons lined up. */
-        width_of_buttons = data->numbuttons * button_width + ( data->numbuttons - 1 ) * button_spacing;
-
-        /* Bump up dialog width and height if buttons are wider than text. */
-        data->dialog_width = IntMax( data->dialog_width, width_of_buttons + 2 * button_spacing );
-        data->dialog_height = IntMax( data->dialog_height, ybuttons + 2 * button_height );
-
-        /* Location for first button. */
-        x = ( data->dialog_width - width_of_buttons ) / 2;
-        y = ybuttons + ( data->dialog_height - ybuttons - button_height ) / 2;
-
-        for ( i = 0; i < data->numbuttons; i++ ) {
-            /* Button coordinates. */
-            data->buttonpos[ i ].rect.x = x;
-            data->buttonpos[ i ].rect.y = y;
-            data->buttonpos[ i ].rect.w = button_width;
-            data->buttonpos[ i ].rect.h = button_height;
-
-            /* Button text coordinates. */
-            data->buttonpos[ i ].x = x + ( button_width - data->buttonpos[ i ].text_width ) / 2;
-            data->buttonpos[ i ].y = y + ( button_height - button_text_height - 1 ) / 2 + button_text_height;
-
-            /* Scoot over for next button. */
-            x += button_width + button_spacing;
-        }
-    }
-
-    return 0;
-}
-
-/* Free SDL_MessageBoxData data. */
-static void
-X11_MessageBoxShutdown( SDL_MessageBoxDataX11 *data )
-{
-    if ( data->font_set != NULL ) {
-        X11_XFreeFontSet( data->display, data->font_set );
-        data->font_set = NULL;
-    }
-
-    if ( data->font_struct != NULL ) {
-        X11_XFreeFont( data->display, data->font_struct );
-        data->font_struct = NULL;
-    }
-
-    if ( data->display ) {
-        if ( data->window != None ) {
-            X11_XWithdrawWindow( data->display, data->window, data->screen );
-            X11_XDestroyWindow( data->display, data->window );
-            data->window = None;
-        }
-
-        X11_XCloseDisplay( data->display );
-        data->display = NULL;
-    }
-}
-
-/* Create and set up our X11 dialog box indow. */
-static int
-X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data )
-{
-    int x, y;
-    XSizeHints *sizehints;
-    XSetWindowAttributes wnd_attr;
-    Display *display = data->display;
-    SDL_WindowData *windowdata = NULL;
-    const SDL_MessageBoxData *messageboxdata = data->messageboxdata;
-
-    if ( messageboxdata->window ) {
-        SDL_DisplayData *displaydata =
-            (SDL_DisplayData *) SDL_GetDisplayForWindow(messageboxdata->window)->driverdata;
-        windowdata = (SDL_WindowData *)messageboxdata->window->driverdata;
-        data->screen = displaydata->screen;
-    } else {
-        data->screen = DefaultScreen( display );
-    }
-
-    data->event_mask = ExposureMask |
-                       ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask |
-                       StructureNotifyMask | FocusChangeMask | PointerMotionMask;
-    wnd_attr.event_mask = data->event_mask;
-
-    data->window = X11_XCreateWindow(
-                       display, RootWindow(display, data->screen),
-                       0, 0,
-                       data->dialog_width, data->dialog_height,
-                       0, CopyFromParent, InputOutput, CopyFromParent,
-                       CWEventMask, &wnd_attr );
-    if ( data->window == None ) {
-        return SDL_SetError("Couldn't create X window");
-    }
-
-    if ( windowdata ) {
-        /* http://tronche.com/gui/x/icccm/sec-4.html#WM_TRANSIENT_FOR */
-        X11_XSetTransientForHint( display, data->window, windowdata->xwindow );
-    }
-
-    X11_XStoreName( display, data->window, messageboxdata->title );
-
-    /* Allow the window to be deleted by the window manager */
-    data->wm_protocols = X11_XInternAtom( display, "WM_PROTOCOLS", False );
-    data->wm_delete_message = X11_XInternAtom( display, "WM_DELETE_WINDOW", False );
-    X11_XSetWMProtocols( display, data->window, &data->wm_delete_message, 1 );
-
-    if ( windowdata ) {
-        XWindowAttributes attrib;
-        Window dummy;
-
-        X11_XGetWindowAttributes(display, windowdata->xwindow, &attrib);
-        x = attrib.x + ( attrib.width - data->dialog_width ) / 2;
-        y = attrib.y + ( attrib.height - data->dialog_height ) / 3 ;
-        X11_XTranslateCoordinates(display, windowdata->xwindow, RootWindow(display, data->screen), x, y, &x, &y, &dummy);
-    } else {
-        x = ( DisplayWidth( display, data->screen ) - data->dialog_width ) / 2;
-        y = ( DisplayHeight( display, data->screen ) - data->dialog_height ) / 3 ;
-    }
-    X11_XMoveWindow( display, data->window, x, y );
-
-    sizehints = X11_XAllocSizeHints();
-    if ( sizehints ) {
-        sizehints->flags = USPosition | USSize | PMaxSize | PMinSize;
-        sizehints->x = x;
-        sizehints->y = y;
-        sizehints->width = data->dialog_width;
-        sizehints->height = data->dialog_height;
-
-        sizehints->min_width = sizehints->max_width = data->dialog_width;
-        sizehints->min_height = sizehints->max_height = data->dialog_height;
-
-        X11_XSetWMNormalHints( display, data->window, sizehints );
-
-        X11_XFree( sizehints );
-    }
-
-    X11_XMapRaised( display, data->window );
-    return 0;
-}
-
-/* Draw our message box. */
-static void
-X11_MessageBoxDraw( SDL_MessageBoxDataX11 *data, GC ctx )
-{
-    int i;
-    Window window = data->window;
-    Display *display = data->display;
-
-    X11_XSetForeground( display, ctx, data->color[ SDL_MESSAGEBOX_COLOR_BACKGROUND ] );
-    X11_XFillRectangle( display, window, ctx, 0, 0, data->dialog_width, data->dialog_height );
-
-    X11_XSetForeground( display, ctx, data->color[ SDL_MESSAGEBOX_COLOR_TEXT ] );
-    for ( i = 0; i < data->numlines; i++ ) {
-        TextLineData *plinedata = &data->linedata[ i ];
-
-        if (SDL_X11_HAVE_UTF8) {
-            X11_Xutf8DrawString( display, window, data->font_set, ctx,
-                             data->xtext, data->ytext + i * data->text_height,
-                             plinedata->text, plinedata->length );
-        } else {
-            X11_XDrawString( display, window, ctx,
-                         data->xtext, data->ytext + i * data->text_height,
-                         plinedata->text, plinedata->length );
-        }
-    }
-
-    for ( i = 0; i < data->numbuttons; i++ ) {
-        SDL_MessageBoxButtonDataX11 *buttondatax11 = &data->buttonpos[ i ];
-        const SDL_MessageBoxButtonData *buttondata = buttondatax11->buttondata;
-        int border = ( buttondata->flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT ) ? 2 : 0;
-        int offset = ( ( data->mouse_over_index == i ) && ( data->button_press_index == data->mouse_over_index ) ) ? 1 : 0;
-
-        X11_XSetForeground( display, ctx, data->color[ SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND ] );
-        X11_XFillRectangle( display, window, ctx,
-                        buttondatax11->rect.x - border, buttondatax11->rect.y - border,
-                        buttondatax11->rect.w + 2 * border, buttondatax11->rect.h + 2 * border );
-
-        X11_XSetForeground( display, ctx, data->color[ SDL_MESSAGEBOX_COLOR_BUTTON_BORDER ] );
-        X11_XDrawRectangle( display, window, ctx,
-                        buttondatax11->rect.x, buttondatax11->rect.y,
-                        buttondatax11->rect.w, buttondatax11->rect.h );
-
-        X11_XSetForeground( display, ctx, ( data->mouse_over_index == i ) ?
-                        data->color[ SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED ] :
-                        data->color[ SDL_MESSAGEBOX_COLOR_TEXT ] );
-
-        if (SDL_X11_HAVE_UTF8) {
-            X11_Xutf8DrawString( display, window, data->font_set, ctx,
-                             buttondatax11->x + offset,
-                             buttondatax11->y + offset,
-                             buttondata->text, buttondatax11->length );
-        } else {
-            X11_XDrawString( display, window, ctx,
-                         buttondatax11->x + offset, buttondatax11->y + offset,
-                         buttondata->text, buttondatax11->length );
-        }
-    }
-}
-
-/* Loop and handle message box event messages until something kills it. */
-static int
-X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data )
-{
-    GC ctx;
-    XGCValues ctx_vals;
-    SDL_bool close_dialog = SDL_FALSE;
-    SDL_bool has_focus = SDL_TRUE;
-    KeySym last_key_pressed = XK_VoidSymbol;
-    unsigned long gcflags = GCForeground | GCBackground;
-
-    SDL_zero(ctx_vals);
-    ctx_vals.foreground = data->color[ SDL_MESSAGEBOX_COLOR_BACKGROUND ];
-    ctx_vals.background = data->color[ SDL_MESSAGEBOX_COLOR_BACKGROUND ];
-
-    if (!SDL_X11_HAVE_UTF8) {
-        gcflags |= GCFont;
-        ctx_vals.font = data->font_struct->fid;
-    }
-
-    ctx = X11_XCreateGC( data->display, data->window, gcflags, &ctx_vals );
-    if ( ctx == None ) {
-        return SDL_SetError("Couldn't create graphics context");
-    }
-
-    data->button_press_index = -1;  /* Reset what button is currently depressed. */
-    data->mouse_over_index = -1;    /* Reset what button the mouse is over. */
-
-    while( !close_dialog ) {
-        XEvent e;
-        SDL_bool draw = SDL_TRUE;
-
-        X11_XWindowEvent( data->display, data->window, data->event_mask, &e );
-
-        /* If X11_XFilterEvent returns True, then some input method has filtered the
-           event, and the client should discard the event. */
-        if ( ( e.type != Expose ) && X11_XFilterEvent( &e, None ) )
-            continue;
-
-        switch( e.type ) {
-        case Expose:
-            if ( e.xexpose.count > 0 ) {
-                draw = SDL_FALSE;
-            }
-            break;
-
-        case FocusIn:
-            /* Got focus. */
-            has_focus = SDL_TRUE;
-            break;
-
-        case FocusOut:
-            /* lost focus. Reset button and mouse info. */
-            has_focus = SDL_FALSE;
-            data->button_press_index = -1;
-            data->mouse_over_index = -1;
-            break;
-
-        case MotionNotify:
-            if ( has_focus ) {
-                /* Mouse moved... */
-                data->mouse_over_index = GetHitButtonIndex( data, e.xbutton.x, e.xbutton.y );
-            }
-            break;
-
-        case ClientMessage:
-            if ( e.xclient.message_type == data->wm_protocols &&
-                 e.xclient.format == 32 &&
-                 e.xclient.data.l[ 0 ] == data->wm_delete_message ) {
-                close_dialog = SDL_TRUE;
-            }
-            break;
-
-        case KeyPress:
-            /* Store key press - we make sure in key release that we got both. */
-            last_key_pressed = X11_XLookupKeysym( &e.xkey, 0 );
-            break;
-
-        case KeyRelease: {
-            Uint32 mask = 0;
-            KeySym key = X11_XLookupKeysym( &e.xkey, 0 );
-
-            /* If this is a key release for something we didn't get the key down for, then bail. */
-            if ( key != last_key_pressed )
-                break;
-
-            if ( key == XK_Escape )
-                mask = SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT;
-            else if ( ( key == XK_Return ) || ( key == XK_KP_Enter ) )
-                mask = SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT;
-
-            if ( mask ) {
-                int i;
-
-                /* Look for first button with this mask set, and return it if found. */
-                for ( i = 0; i < data->numbuttons; i++ ) {
-                    SDL_MessageBoxButtonDataX11 *buttondatax11 = &data->buttonpos[ i ];
-
-                    if ( buttondatax11->buttondata->flags & mask ) {
-                        *data->pbuttonid = buttondatax11->buttondata->buttonid;
-                        close_dialog = SDL_TRUE;
-                        break;
-                    }
-                }
-            }
-            break;
-        }
-
-        case ButtonPress:
-            data->button_press_index = -1;
-            if ( e.xbutton.button == Button1 ) {
-                /* Find index of button they clicked on. */
-                data->button_press_index = GetHitButtonIndex( data, e.xbutton.x, e.xbutton.y );
-            }
-            break;
-
-        case ButtonRelease:
-            /* If button is released over the same button that was clicked down on, then return it. */
-            if ( ( e.xbutton.button == Button1 ) && ( data->button_press_index >= 0 ) ) {
-                int button = GetHitButtonIndex( data, e.xbutton.x, e.xbutton.y );
-
-                if ( data->button_press_index == button ) {
-                    SDL_MessageBoxButtonDataX11 *buttondatax11 = &data->buttonpos[ button ];
-
-                    *data->pbuttonid = buttondatax11->buttondata->buttonid;
-                    close_dialog = SDL_TRUE;
-                }
-            }
-            data->button_press_index = -1;
-            break;
-        }
-
-        if ( draw ) {
-            /* Draw our dialog box. */
-            X11_MessageBoxDraw( data, ctx );
-        }
-    }
-
-    X11_XFreeGC( data->display, ctx );
-    return 0;
-}
-
-static int
-X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid)
-{
-    int ret;
-    SDL_MessageBoxDataX11 data;
-#if SDL_SET_LOCALE
-    char *origlocale;
-#endif
-
-    SDL_zero(data);
-
-    if ( !SDL_X11_LoadSymbols() )
-        return -1;
-
-#if SDL_SET_LOCALE
-    origlocale = setlocale(LC_ALL, NULL);
-    if (origlocale != NULL) {
-        origlocale = SDL_strdup(origlocale);
-        if (origlocale == NULL) {
-            return SDL_OutOfMemory();
-        }
-        setlocale(LC_ALL, "");
-    }
-#endif
-
-    /* This code could get called from multiple threads maybe? */
-    X11_XInitThreads();
-
-    /* Initialize the return buttonid value to -1 (for error or dialogbox closed). */
-    *buttonid = -1;
-
-    /* Init and display the message box. */
-    ret = X11_MessageBoxInit( &data, messageboxdata, buttonid );
-    if ( ret != -1 ) {
-        ret = X11_MessageBoxInitPositions( &data );
-        if ( ret != -1 ) {
-            ret = X11_MessageBoxCreateWindow( &data );
-            if ( ret != -1 ) {
-                ret = X11_MessageBoxLoop( &data );
-            }
-        }
-    }
-
-    X11_MessageBoxShutdown( &data );
-
-#if SDL_SET_LOCALE
-    if (origlocale) {
-        setlocale(LC_ALL, origlocale);
-        SDL_free(origlocale);
-    }
-#endif
-
-    return ret;
-}
-
-/* Display an x11 message box. */
-int
-X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
-{
-#if SDL_FORK_MESSAGEBOX
-    /* Use a child process to protect against setlocale(). Annoying. */
-    pid_t pid;
-    int fds[2];
-    int status = 0;
-
-    /* Need to flush here in case someone has turned grab off and it hasn't gone through yet, etc. */
-    X11_XFlush(data->display);
-
-    if (pipe(fds) == -1) {
-        return X11_ShowMessageBoxImpl(messageboxdata, buttonid); /* oh well. */
-    }
-
-    pid = fork();
-    if (pid == -1) {  /* failed */
-        close(fds[0]);
-        close(fds[1]);
-        return X11_ShowMessageBoxImpl(messageboxdata, buttonid); /* oh well. */
-    } else if (pid == 0) {  /* we're the child */
-        int exitcode = 0;
-        close(fds[0]);
-        status = X11_ShowMessageBoxImpl(messageboxdata, buttonid);
-        if (write(fds[1], &status, sizeof (int)) != sizeof (int))
-            exitcode = 1;
-        else if (write(fds[1], buttonid, sizeof (int)) != sizeof (int))
-            exitcode = 1;
-        close(fds[1]);
-        _exit(exitcode);  /* don't run atexit() stuff, static destructors, etc. */
-    } else {  /* we're the parent */
-        pid_t rc;
-        close(fds[1]);
-        do {
-            rc = waitpid(pid, &status, 0);
-        } while ((rc == -1) && (errno == EINTR));
-
-        SDL_assert(rc == pid);  /* not sure what to do if this fails. */
-
-        if ((rc == -1) || (!WIFEXITED(status)) || (WEXITSTATUS(status) != 0)) {
-            return SDL_SetError("msgbox child process failed");
-        }
-
-        if (read(fds[0], &status, sizeof (int)) != sizeof (int))
-            status = -1;
-        else if (read(fds[0], buttonid, sizeof (int)) != sizeof (int))
-            status = -1;
-        close(fds[0]);
-
-        return status;
-    }
-#else
-    return X11_ShowMessageBoxImpl(messageboxdata, buttonid);
-#endif
-}
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11messagebox.h b/deps/SDL2/src/video/x11/SDL_x11messagebox.h
deleted file mode 100644
index 9b270f8..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11messagebox.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#if SDL_VIDEO_DRIVER_X11
-
-extern int X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11modes.c b/deps/SDL2/src/video/x11/SDL_x11modes.c
deleted file mode 100644
index a4c242c..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11modes.c
+++ /dev/null
@@ -1,888 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include "SDL_hints.h"
-#include "SDL_x11video.h"
-#include "edid.h"
-
-/* #define X11MODES_DEBUG */
-
-/* I'm becoming more and more convinced that the application should never
- * use XRandR, and it's the window manager's responsibility to track and
- * manage display modes for fullscreen windows.  Right now XRandR is completely
- * broken with respect to window manager behavior on every window manager that
- * I can find.  For example, on Unity 3D if you show a fullscreen window while
- * the resolution is changing (within ~250 ms) your window will retain the
- * fullscreen state hint but be decorated and windowed.
- *
- * However, many people swear by it, so let them swear at it. :)
-*/
-/* #define XRANDR_DISABLED_BY_DEFAULT */
-
-
-static int
-get_visualinfo(Display * display, int screen, XVisualInfo * vinfo)
-{
-    const char *visual_id = SDL_getenv("SDL_VIDEO_X11_VISUALID");
-    int depth;
-
-    /* Look for an exact visual, if requested */
-    if (visual_id) {
-        XVisualInfo *vi, template;
-        int nvis;
-
-        SDL_zero(template);
-        template.visualid = SDL_strtol(visual_id, NULL, 0);
-        vi = X11_XGetVisualInfo(display, VisualIDMask, &template, &nvis);
-        if (vi) {
-            *vinfo = *vi;
-            X11_XFree(vi);
-            return 0;
-        }
-    }
-
-    depth = DefaultDepth(display, screen);
-    if ((X11_UseDirectColorVisuals() &&
-         X11_XMatchVisualInfo(display, screen, depth, DirectColor, vinfo)) ||
-        X11_XMatchVisualInfo(display, screen, depth, TrueColor, vinfo) ||
-        X11_XMatchVisualInfo(display, screen, depth, PseudoColor, vinfo) ||
-        X11_XMatchVisualInfo(display, screen, depth, StaticColor, vinfo)) {
-        return 0;
-    }
-    return -1;
-}
-
-int
-X11_GetVisualInfoFromVisual(Display * display, Visual * visual, XVisualInfo * vinfo)
-{
-    XVisualInfo *vi;
-    int nvis;
-
-    vinfo->visualid = X11_XVisualIDFromVisual(visual);
-    vi = X11_XGetVisualInfo(display, VisualIDMask, vinfo, &nvis);
-    if (vi) {
-        *vinfo = *vi;
-        X11_XFree(vi);
-        return 0;
-    }
-    return -1;
-}
-
-Uint32
-X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo)
-{
-    if (vinfo->class == DirectColor || vinfo->class == TrueColor) {
-        int bpp;
-        Uint32 Rmask, Gmask, Bmask, Amask;
-
-        Rmask = vinfo->visual->red_mask;
-        Gmask = vinfo->visual->green_mask;
-        Bmask = vinfo->visual->blue_mask;
-        if (vinfo->depth == 32) {
-            Amask = (0xFFFFFFFF & ~(Rmask | Gmask | Bmask));
-        } else {
-            Amask = 0;
-        }
-
-        bpp = vinfo->depth;
-        if (bpp == 24) {
-            int i, n;
-            XPixmapFormatValues *p = X11_XListPixmapFormats(display, &n);
-            if (p) {
-                for (i = 0; i < n; ++i) {
-                    if (p[i].depth == 24) {
-                        bpp = p[i].bits_per_pixel;
-                        break;
-                    }
-                }
-                X11_XFree(p);
-            }
-        }
-
-        return SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
-    }
-
-    if (vinfo->class == PseudoColor || vinfo->class == StaticColor) {
-        switch (vinfo->depth) {
-        case 8:
-            return SDL_PIXELTYPE_INDEX8;
-        case 4:
-            if (BitmapBitOrder(display) == LSBFirst) {
-                return SDL_PIXELFORMAT_INDEX4LSB;
-            } else {
-                return SDL_PIXELFORMAT_INDEX4MSB;
-            }
-            break;
-        case 1:
-            if (BitmapBitOrder(display) == LSBFirst) {
-                return SDL_PIXELFORMAT_INDEX1LSB;
-            } else {
-                return SDL_PIXELFORMAT_INDEX1MSB;
-            }
-            break;
-        }
-    }
-
-    return SDL_PIXELFORMAT_UNKNOWN;
-}
-
-/* Global for the error handler */
-int vm_event, vm_error = -1;
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-static SDL_bool
-CheckXinerama(Display * display, int *major, int *minor)
-{
-    int event_base = 0;
-    int error_base = 0;
-    const char *env;
-
-    /* Default the extension not available */
-    *major = *minor = 0;
-
-    /* Allow environment override */
-    env = SDL_GetHint(SDL_HINT_VIDEO_X11_XINERAMA);
-    if (env && !SDL_atoi(env)) {
-#ifdef X11MODES_DEBUG
-        printf("Xinerama disabled due to hint\n");
-#endif
-        return SDL_FALSE;
-    }
-
-    if (!SDL_X11_HAVE_XINERAMA) {
-#ifdef X11MODES_DEBUG
-        printf("Xinerama support not available\n");
-#endif
-        return SDL_FALSE;
-    }
-
-    /* Query the extension version */
-    if (!X11_XineramaQueryExtension(display, &event_base, &error_base) ||
-        !X11_XineramaQueryVersion(display, major, minor) ||
-        !X11_XineramaIsActive(display)) {
-#ifdef X11MODES_DEBUG
-        printf("Xinerama not active on the display\n");
-#endif
-        return SDL_FALSE;
-    }
-#ifdef X11MODES_DEBUG
-    printf("Xinerama available at version %d.%d!\n", *major, *minor);
-#endif
-    return SDL_TRUE;
-}
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-static SDL_bool
-CheckXRandR(Display * display, int *major, int *minor)
-{
-    const char *env;
-
-    /* Default the extension not available */
-    *major = *minor = 0;
-
-    /* Allow environment override */
-    env = SDL_GetHint(SDL_HINT_VIDEO_X11_XRANDR);
-#ifdef XRANDR_DISABLED_BY_DEFAULT
-    if (!env || !SDL_atoi(env)) {
-#ifdef X11MODES_DEBUG
-        printf("XRandR disabled by default due to window manager issues\n");
-#endif
-        return SDL_FALSE;
-    }
-#else
-    if (env && !SDL_atoi(env)) {
-#ifdef X11MODES_DEBUG
-        printf("XRandR disabled due to hint\n");
-#endif
-        return SDL_FALSE;
-    }
-#endif /* XRANDR_ENABLED_BY_DEFAULT */
-
-    if (!SDL_X11_HAVE_XRANDR) {
-#ifdef X11MODES_DEBUG
-        printf("XRandR support not available\n");
-#endif
-        return SDL_FALSE;
-    }
-
-    /* Query the extension version */
-    if (!X11_XRRQueryVersion(display, major, minor)) {
-#ifdef X11MODES_DEBUG
-        printf("XRandR not active on the display\n");
-#endif
-        return SDL_FALSE;
-    }
-#ifdef X11MODES_DEBUG
-    printf("XRandR available at version %d.%d!\n", *major, *minor);
-#endif
-    return SDL_TRUE;
-}
-
-#define XRANDR_ROTATION_LEFT    (1 << 1)
-#define XRANDR_ROTATION_RIGHT   (1 << 3)
-
-static int
-CalculateXRandRRefreshRate(const XRRModeInfo *info)
-{
-    return (info->hTotal
-            && info->vTotal) ? (info->dotClock / (info->hTotal * info->vTotal)) : 0;
-}
-
-static SDL_bool
-SetXRandRModeInfo(Display *display, XRRScreenResources *res, XRROutputInfo *output_info,
-                  RRMode modeID, SDL_DisplayMode *mode)
-{
-    int i;
-    for (i = 0; i < res->nmode; ++i) {
-        if (res->modes[i].id == modeID) {
-            XRRCrtcInfo *crtc;
-            Rotation rotation = 0;
-            const XRRModeInfo *info = &res->modes[i];
-
-            crtc = X11_XRRGetCrtcInfo(display, res, output_info->crtc);
-            if (crtc) {
-                rotation = crtc->rotation;
-                X11_XRRFreeCrtcInfo(crtc);
-            }
-
-            if (rotation & (XRANDR_ROTATION_LEFT|XRANDR_ROTATION_RIGHT)) {
-                mode->w = info->height;
-                mode->h = info->width;
-            } else {
-                mode->w = info->width;
-                mode->h = info->height;
-            }
-            mode->refresh_rate = CalculateXRandRRefreshRate(info);
-            ((SDL_DisplayModeData*)mode->driverdata)->xrandr_mode = modeID;
-#ifdef X11MODES_DEBUG
-            printf("XRandR mode %d: %dx%d@%dHz\n", (int) modeID, mode->w, mode->h, mode->refresh_rate);
-#endif
-            return SDL_TRUE;
-        }
-    }
-    return SDL_FALSE;
-}
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-static SDL_bool
-CheckVidMode(Display * display, int *major, int *minor)
-{
-    const char *env;
-
-    /* Default the extension not available */
-    *major = *minor = 0;
-
-    /* Allow environment override */
-    env = SDL_GetHint(SDL_HINT_VIDEO_X11_XVIDMODE);
-    if (env && !SDL_atoi(env)) {
-#ifdef X11MODES_DEBUG
-        printf("XVidMode disabled due to hint\n");
-#endif
-        return SDL_FALSE;
-    }
-
-    if (!SDL_X11_HAVE_XVIDMODE) {
-#ifdef X11MODES_DEBUG
-        printf("XVidMode support not available\n");
-#endif
-        return SDL_FALSE;
-    }
-
-    /* Query the extension version */
-    vm_error = -1;
-    if (!X11_XF86VidModeQueryExtension(display, &vm_event, &vm_error)
-        || !X11_XF86VidModeQueryVersion(display, major, minor)) {
-#ifdef X11MODES_DEBUG
-        printf("XVidMode not active on the display\n");
-#endif
-        return SDL_FALSE;
-    }
-#ifdef X11MODES_DEBUG
-    printf("XVidMode available at version %d.%d!\n", *major, *minor);
-#endif
-    return SDL_TRUE;
-}
-
-static
-Bool XF86VidModeGetModeInfo(Display * dpy, int scr,
-                                       XF86VidModeModeInfo* info)
-{
-    Bool retval;
-    int dotclock;
-    XF86VidModeModeLine l;
-    SDL_zerop(info);
-    SDL_zero(l);
-    retval = X11_XF86VidModeGetModeLine(dpy, scr, &dotclock, &l);
-    info->dotclock = dotclock;
-    info->hdisplay = l.hdisplay;
-    info->hsyncstart = l.hsyncstart;
-    info->hsyncend = l.hsyncend;
-    info->htotal = l.htotal;
-    info->hskew = l.hskew;
-    info->vdisplay = l.vdisplay;
-    info->vsyncstart = l.vsyncstart;
-    info->vsyncend = l.vsyncend;
-    info->vtotal = l.vtotal;
-    info->flags = l.flags;
-    info->privsize = l.privsize;
-    info->private = l.private;
-    return retval;
-}
-
-static int
-CalculateXVidModeRefreshRate(const XF86VidModeModeInfo * info)
-{
-    return (info->htotal
-            && info->vtotal) ? (1000 * info->dotclock / (info->htotal *
-                                                         info->vtotal)) : 0;
-}
-
-SDL_bool
-SetXVidModeModeInfo(const XF86VidModeModeInfo *info, SDL_DisplayMode *mode)
-{
-    mode->w = info->hdisplay;
-    mode->h = info->vdisplay;
-    mode->refresh_rate = CalculateXVidModeRefreshRate(info);
-    ((SDL_DisplayModeData*)mode->driverdata)->vm_mode = *info;
-    return SDL_TRUE;
-}
-#endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
-
-int
-X11_InitModes(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    int screen, screencount;
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-    int xinerama_major, xinerama_minor;
-    int use_xinerama = 0;
-    XineramaScreenInfo *xinerama = NULL;
-#endif
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-    int xrandr_major, xrandr_minor;
-    int use_xrandr = 0;
-    XRRScreenResources *res = NULL;
-#endif
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-    int vm_major, vm_minor;
-    int use_vidmode = 0;
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-    /* Query Xinerama extention
-     * NOTE: This works with Nvidia Twinview correctly, but you need version 302.17 (released on June 2012)
-     *       or newer of the Nvidia binary drivers
-     */
-    if (CheckXinerama(data->display, &xinerama_major, &xinerama_minor)) {
-        xinerama = X11_XineramaQueryScreens(data->display, &screencount);
-        if (xinerama) {
-            use_xinerama = xinerama_major * 100 + xinerama_minor;
-        }
-    }
-    if (!xinerama) {
-        screencount = ScreenCount(data->display);
-    }
-#else
-    screencount = ScreenCount(data->display);
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-    /* require at least XRandR v1.2 */
-    if (CheckXRandR(data->display, &xrandr_major, &xrandr_minor) &&
-        (xrandr_major >= 2 || (xrandr_major == 1 && xrandr_minor >= 2))) {
-        use_xrandr = xrandr_major * 100 + xrandr_minor;
-    }
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-    if (CheckVidMode(data->display, &vm_major, &vm_minor)) {
-        use_vidmode = vm_major * 100 + vm_minor;
-    }
-#endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
-
-    for (screen = 0; screen < screencount; ++screen) {
-        XVisualInfo vinfo;
-        SDL_VideoDisplay display;
-        SDL_DisplayData *displaydata;
-        SDL_DisplayMode mode;
-        SDL_DisplayModeData *modedata;
-        XPixmapFormatValues *pixmapFormats;
-        char display_name[128];
-        int i, n;
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-        if (xinerama) {
-            if (get_visualinfo(data->display, 0, &vinfo) < 0) {
-                continue;
-            }
-        } else {
-            if (get_visualinfo(data->display, screen, &vinfo) < 0) {
-                continue;
-            }
-        }
-#else
-        if (get_visualinfo(data->display, screen, &vinfo) < 0) {
-            continue;
-        }
-#endif
-
-        displaydata = (SDL_DisplayData *) SDL_calloc(1, sizeof(*displaydata));
-        if (!displaydata) {
-            continue;
-        }
-        display_name[0] = '\0';
-
-        mode.format = X11_GetPixelFormatFromVisualInfo(data->display, &vinfo);
-        if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) {
-            /* We don't support palettized modes now */
-            SDL_free(displaydata);
-            continue;
-        }
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-        if (xinerama) {
-            mode.w = xinerama[screen].width;
-            mode.h = xinerama[screen].height;
-        } else {
-            mode.w = DisplayWidth(data->display, screen);
-            mode.h = DisplayHeight(data->display, screen);
-        }
-#else
-        mode.w = DisplayWidth(data->display, screen);
-        mode.h = DisplayHeight(data->display, screen);
-#endif
-        mode.refresh_rate = 0;
-
-        modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData));
-        if (!modedata) {
-            SDL_free(displaydata);
-            continue;
-        }
-        mode.driverdata = modedata;
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-        /* Most of SDL's calls to X11 are unwaware of Xinerama, and to X11 standard calls, when Xinerama is active,
-         * there's only one screen available. So we force the screen number to zero and
-         * let Xinerama specific code handle specific functionality using displaydata->xinerama_info
-         */
-        if (use_xinerama) {
-            displaydata->screen = 0;
-            displaydata->use_xinerama = use_xinerama;
-            displaydata->xinerama_info = xinerama[screen];
-            displaydata->xinerama_screen = screen;
-        }
-        else displaydata->screen = screen;
-#else
-        displaydata->screen = screen;
-#endif
-        displaydata->visual = vinfo.visual;
-        displaydata->depth = vinfo.depth;
-
-        displaydata->scanline_pad = SDL_BYTESPERPIXEL(mode.format) * 8;
-        pixmapFormats = X11_XListPixmapFormats(data->display, &n);
-        if (pixmapFormats) {
-            for (i = 0; i < n; ++i) {
-                if (pixmapFormats[i].depth == displaydata->depth) {
-                    displaydata->scanline_pad = pixmapFormats[i].scanline_pad;
-                    break;
-                }
-            }
-            X11_XFree(pixmapFormats);
-        }
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-        if (use_xinerama) {
-            displaydata->x = xinerama[screen].x_org;
-            displaydata->y = xinerama[screen].y_org;
-        }
-        else
-#endif
-        {
-            displaydata->x = 0;
-            displaydata->y = 0;
-        }
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-        if (use_xrandr) {
-            res = X11_XRRGetScreenResources(data->display, RootWindow(data->display, displaydata->screen));
-        }
-        if (res) {
-            XRROutputInfo *output_info;
-            XRRCrtcInfo *crtc;
-            int output;
-            Atom EDID = X11_XInternAtom(data->display, "EDID", False);
-            Atom *props;
-            int nprop;
-            unsigned long width_mm;
-            unsigned long height_mm;
-            int inches = 0;
-
-            for (output = 0; output < res->noutput; output++) {
-                output_info = X11_XRRGetOutputInfo(data->display, res, res->outputs[output]);
-                if (!output_info || !output_info->crtc ||
-                    output_info->connection == RR_Disconnected) {
-                    X11_XRRFreeOutputInfo(output_info);
-                    continue;
-                }
-
-                /* Is this the output that corresponds to the current screen?
-                   We're checking the crtc position, but that may not be a valid test
-                   in all cases.  Anybody want to give this some love?
-                 */
-                crtc = X11_XRRGetCrtcInfo(data->display, res, output_info->crtc);
-                if (!crtc || crtc->x != displaydata->x || crtc->y != displaydata->y) {
-                    X11_XRRFreeOutputInfo(output_info);
-                    X11_XRRFreeCrtcInfo(crtc);
-                    continue;
-                }
-
-                displaydata->use_xrandr = use_xrandr;
-                displaydata->xrandr_output = res->outputs[output];
-                SetXRandRModeInfo(data->display, res, output_info, crtc->mode, &mode);
-
-                /* Get the name of this display */
-                width_mm = output_info->mm_width;
-                height_mm = output_info->mm_height;
-                inches = (int)((sqrt(width_mm * width_mm +
-                                     height_mm * height_mm) / 25.4f) + 0.5f);
-                SDL_strlcpy(display_name, output_info->name, sizeof(display_name));
-
-                /* See if we can get the EDID data for the real monitor name */
-                props = X11_XRRListOutputProperties(data->display, res->outputs[output], &nprop);
-                for (i = 0; i < nprop; ++i) {
-                    unsigned char *prop;
-                    int actual_format;
-                    unsigned long nitems, bytes_after;
-                    Atom actual_type;
-
-                    if (props[i] == EDID) {
-                        if (X11_XRRGetOutputProperty(data->display,
-                                                 res->outputs[output], props[i],
-                                                 0, 100, False, False,
-                                                 AnyPropertyType,
-                                                 &actual_type, &actual_format,
-                                                 &nitems, &bytes_after, &prop) == Success ) {
-                            MonitorInfo *info = decode_edid(prop);
-                            if (info) {
-    #ifdef X11MODES_DEBUG
-                                printf("Found EDID data for %s\n", output_info->name);
-                                dump_monitor_info(info);
-    #endif
-                                SDL_strlcpy(display_name, info->dsc_product_name, sizeof(display_name));
-                                free(info);
-                            }
-                            X11_XFree(prop);
-                        }
-                        break;
-                    }
-                }
-                if (props) {
-                    X11_XFree(props);
-                }
-
-                if (*display_name && inches) {
-                    size_t len = SDL_strlen(display_name);
-                    SDL_snprintf(&display_name[len], sizeof(display_name)-len, " %d\"", inches);
-                }
-#ifdef X11MODES_DEBUG
-                printf("Display name: %s\n", display_name);
-#endif
-
-                X11_XRRFreeOutputInfo(output_info);
-                X11_XRRFreeCrtcInfo(crtc);
-                break;
-            }
-#ifdef X11MODES_DEBUG
-            if (output == res->noutput) {
-                printf("Couldn't find XRandR CRTC at %d,%d\n", displaydata->x, displaydata->y);
-            }
-#endif
-            X11_XRRFreeScreenResources(res);
-        }
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-        if (!displaydata->use_xrandr &&
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-            /* XVidMode only works on the screen at the origin */
-            (!displaydata->use_xinerama ||
-             (displaydata->x == 0 && displaydata->y == 0)) &&
-#endif
-            use_vidmode) {
-            displaydata->use_vidmode = use_vidmode;
-            if (displaydata->use_xinerama) {
-                displaydata->vidmode_screen = 0;
-            } else {
-                displaydata->vidmode_screen = screen;
-            }
-            XF86VidModeGetModeInfo(data->display, displaydata->vidmode_screen, &modedata->vm_mode);
-        }
-#endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
-
-        SDL_zero(display);
-        if (*display_name) {
-            display.name = display_name;
-        }
-        display.desktop_mode = mode;
-        display.current_mode = mode;
-        display.driverdata = displaydata;
-        SDL_AddVideoDisplay(&display);
-    }
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-    if (xinerama) X11_XFree(xinerama);
-#endif
-
-    if (_this->num_displays == 0) {
-        return SDL_SetError("No available displays");
-    }
-    return 0;
-}
-
-void
-X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display)
-{
-    Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-    SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata;
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-    int nmodes;
-    XF86VidModeModeInfo ** modes;
-#endif
-    int screen_w;
-    int screen_h;
-    SDL_DisplayMode mode;
-    SDL_DisplayModeData *modedata;
-
-    /* Unfortunately X11 requires the window to be created with the correct
-     * visual and depth ahead of time, but the SDL API allows you to create
-     * a window before setting the fullscreen display mode.  This means that
-     * we have to use the same format for all windows and all display modes.
-     * (or support recreating the window with a new visual behind the scenes)
-     */
-    mode.format = sdl_display->current_mode.format;
-    mode.driverdata = NULL;
-
-    screen_w = DisplayWidth(display, data->screen);
-    screen_h = DisplayHeight(display, data->screen);
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-    if (data->use_xinerama) {
-        if (data->use_vidmode && !data->xinerama_info.x_org && !data->xinerama_info.y_org &&
-           (screen_w > data->xinerama_info.width || screen_h > data->xinerama_info.height)) {
-            /* Add the full (both screens combined) xinerama mode only on the display that starts at 0,0
-             * if we're using vidmode.
-             */
-            mode.w = screen_w;
-            mode.h = screen_h;
-            mode.refresh_rate = 0;
-            modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData));
-            if (modedata) {
-                *modedata = *(SDL_DisplayModeData *)sdl_display->desktop_mode.driverdata;
-            }
-            mode.driverdata = modedata;
-            SDL_AddDisplayMode(sdl_display, &mode);
-        }
-        else if (!data->use_xrandr)
-        {
-            /* Add the current mode of each monitor otherwise if we can't get them from xrandr */
-            mode.w = data->xinerama_info.width;
-            mode.h = data->xinerama_info.height;
-            mode.refresh_rate = 0;
-            modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData));
-            if (modedata) {
-                *modedata = *(SDL_DisplayModeData *)sdl_display->desktop_mode.driverdata;
-            }
-            mode.driverdata = modedata;
-            SDL_AddDisplayMode(sdl_display, &mode);
-        }
-
-    }
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-    if (data->use_xrandr) {
-        XRRScreenResources *res;
-
-        res = X11_XRRGetScreenResources (display, RootWindow(display, data->screen));
-        if (res) {
-            SDL_DisplayModeData *modedata;
-            XRROutputInfo *output_info;
-            int i;
-
-            output_info = X11_XRRGetOutputInfo(display, res, data->xrandr_output);
-            if (output_info && output_info->connection != RR_Disconnected) {
-                for (i = 0; i < output_info->nmode; ++i) {
-                    modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData));
-                    if (!modedata) {
-                        continue;
-                    }
-                    mode.driverdata = modedata;
-
-                    if (SetXRandRModeInfo(display, res, output_info, output_info->modes[i], &mode)) {
-                        SDL_AddDisplayMode(sdl_display, &mode);
-                    } else {
-                        SDL_free(modedata);
-                    }
-                }
-            }
-            X11_XRRFreeOutputInfo(output_info);
-            X11_XRRFreeScreenResources(res);
-        }
-        return;
-    }
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-    if (data->use_vidmode &&
-        X11_XF86VidModeGetAllModeLines(display, data->vidmode_screen, &nmodes, &modes)) {
-        int i;
-
-#ifdef X11MODES_DEBUG
-        printf("VidMode modes: (unsorted)\n");
-        for (i = 0; i < nmodes; ++i) {
-            printf("Mode %d: %d x %d @ %d, flags: 0x%x\n", i,
-                   modes[i]->hdisplay, modes[i]->vdisplay,
-                   CalculateXVidModeRefreshRate(modes[i]), modes[i]->flags);
-        }
-#endif
-        for (i = 0; i < nmodes; ++i) {
-            modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData));
-            if (!modedata) {
-                continue;
-            }
-            mode.driverdata = modedata;
-
-            if (SetXVidModeModeInfo(modes[i], &mode)) {
-                SDL_AddDisplayMode(sdl_display, &mode);
-            } else {
-                SDL_free(modedata);
-            }
-        }
-        X11_XFree(modes);
-        return;
-    }
-#endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
-
-    if (!data->use_xrandr && !data->use_vidmode) {
-        /* Add the desktop mode */
-        mode = sdl_display->desktop_mode;
-        modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData));
-        if (modedata) {
-            *modedata = *(SDL_DisplayModeData *)sdl_display->desktop_mode.driverdata;
-        }
-        mode.driverdata = modedata;
-        SDL_AddDisplayMode(sdl_display, &mode);
-    }
-}
-
-int
-X11_SetDisplayMode(_THIS, SDL_VideoDisplay * sdl_display, SDL_DisplayMode * mode)
-{
-    Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-    SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata;
-    SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata;
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-    if (data->use_xrandr) {
-        XRRScreenResources *res;
-        XRROutputInfo *output_info;
-        XRRCrtcInfo *crtc;
-        Status status;
-
-        res = X11_XRRGetScreenResources (display, RootWindow(display, data->screen));
-        if (!res) {
-            return SDL_SetError("Couldn't get XRandR screen resources");
-        }
-
-        output_info = X11_XRRGetOutputInfo(display, res, data->xrandr_output);
-        if (!output_info || output_info->connection == RR_Disconnected) {
-            X11_XRRFreeScreenResources(res);
-            return SDL_SetError("Couldn't get XRandR output info");
-        }
-
-        crtc = X11_XRRGetCrtcInfo(display, res, output_info->crtc);
-        if (!crtc) {
-            X11_XRRFreeOutputInfo(output_info);
-            X11_XRRFreeScreenResources(res);
-            return SDL_SetError("Couldn't get XRandR crtc info");
-        }
-
-        status = X11_XRRSetCrtcConfig (display, res, output_info->crtc, CurrentTime,
-          crtc->x, crtc->y, modedata->xrandr_mode, crtc->rotation,
-          &data->xrandr_output, 1);
-
-        X11_XRRFreeCrtcInfo(crtc);
-        X11_XRRFreeOutputInfo(output_info);
-        X11_XRRFreeScreenResources(res);
-
-        if (status != Success) {
-            return SDL_SetError("X11_XRRSetCrtcConfig failed");
-        }
-    }
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-    if (data->use_vidmode) {
-        X11_XF86VidModeSwitchToMode(display, data->vidmode_screen, &modedata->vm_mode);
-    }
-#endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
-
-    return 0;
-}
-
-void
-X11_QuitModes(_THIS)
-{
-}
-
-int
-X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect)
-{
-    SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata;
-
-    rect->x = data->x;
-    rect->y = data->y;
-    rect->w = sdl_display->current_mode.w;
-    rect->h = sdl_display->current_mode.h;
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-    /* Get the real current bounds of the display */
-    if (data->use_xinerama) {
-        Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-        int screencount;
-        XineramaScreenInfo *xinerama = X11_XineramaQueryScreens(display, &screencount);
-        if (xinerama) {
-            rect->x = xinerama[data->xinerama_screen].x_org;
-            rect->y = xinerama[data->xinerama_screen].y_org;
-            X11_XFree(xinerama);
-        }
-    }
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-    return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11modes.h b/deps/SDL2/src/video/x11/SDL_x11modes.h
deleted file mode 100644
index 5d9789c..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11modes.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11modes_h
-#define _SDL_x11modes_h
-
-typedef struct
-{
-    int screen;
-    Visual *visual;
-    int depth;
-    int scanline_pad;
-    int x;
-    int y;
-
-    int use_xinerama;
-    int use_xrandr;
-    int use_vidmode;
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-    XineramaScreenInfo xinerama_info;
-    int xinerama_screen;
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-    RROutput xrandr_output;
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-    int vidmode_screen;
-#endif
-
-} SDL_DisplayData;
-
-typedef struct
-{
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-    RRMode xrandr_mode;
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-    XF86VidModeModeInfo vm_mode;
-#endif
-
-} SDL_DisplayModeData;
-
-extern int X11_InitModes(_THIS);
-extern void X11_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
-extern int X11_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
-extern void X11_QuitModes(_THIS);
-
-/* Some utility functions for working with visuals */
-extern int X11_GetVisualInfoFromVisual(Display * display, Visual * visual,
-                                       XVisualInfo * vinfo);
-extern Uint32 X11_GetPixelFormatFromVisualInfo(Display * display,
-                                               XVisualInfo * vinfo);
-extern int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect);
-
-#endif /* _SDL_x11modes_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11mouse.c b/deps/SDL2/src/video/x11/SDL_x11mouse.c
deleted file mode 100644
index 4bcd9d6..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11mouse.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include <X11/cursorfont.h>
-#include "SDL_assert.h"
-#include "SDL_x11video.h"
-#include "SDL_x11mouse.h"
-#include "SDL_x11xinput2.h"
-#include "../../events/SDL_mouse_c.h"
-
-
-/* FIXME: Find a better place to put this... */
-static Cursor x11_empty_cursor = None;
-
-static Display *
-GetDisplay(void)
-{
-    return ((SDL_VideoData *)SDL_GetVideoDevice()->driverdata)->display;
-}
-
-static Cursor
-X11_CreateEmptyCursor()
-{
-    if (x11_empty_cursor == None) {
-        Display *display = GetDisplay();
-        char data[1];
-        XColor color;
-        Pixmap pixmap;
-
-        SDL_zero(data);
-        color.red = color.green = color.blue = 0;
-        pixmap = X11_XCreateBitmapFromData(display, DefaultRootWindow(display),
-                                       data, 1, 1);
-        if (pixmap) {
-            x11_empty_cursor = X11_XCreatePixmapCursor(display, pixmap, pixmap,
-                                                   &color, &color, 0, 0);
-            X11_XFreePixmap(display, pixmap);
-        }
-    }
-    return x11_empty_cursor;
-}
-
-static void
-X11_DestroyEmptyCursor(void)
-{
-    if (x11_empty_cursor != None) {
-        X11_XFreeCursor(GetDisplay(), x11_empty_cursor);
-        x11_empty_cursor = None;
-    }
-}
-
-static SDL_Cursor *
-X11_CreateDefaultCursor()
-{
-    SDL_Cursor *cursor;
-
-    cursor = SDL_calloc(1, sizeof(*cursor));
-    if (cursor) {
-        /* None is used to indicate the default cursor */
-        cursor->driverdata = (void*)None;
-    } else {
-        SDL_OutOfMemory();
-    }
-
-    return cursor;
-}
-
-#if SDL_VIDEO_DRIVER_X11_XCURSOR
-static Cursor
-X11_CreateXCursorCursor(SDL_Surface * surface, int hot_x, int hot_y)
-{
-    Display *display = GetDisplay();
-    Cursor cursor = None;
-    XcursorImage *image;
-
-    image = X11_XcursorImageCreate(surface->w, surface->h);
-    if (!image) {
-        SDL_OutOfMemory();
-        return None;
-    }
-    image->xhot = hot_x;
-    image->yhot = hot_y;
-    image->delay = 0;
-
-    SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888);
-    SDL_assert(surface->pitch == surface->w * 4);
-    SDL_memcpy(image->pixels, surface->pixels, surface->h * surface->pitch);
-
-    cursor = X11_XcursorImageLoadCursor(display, image);
-
-    X11_XcursorImageDestroy(image);
-
-    return cursor;
-}
-#endif /* SDL_VIDEO_DRIVER_X11_XCURSOR */
-
-static Cursor
-X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y)
-{
-    Display *display = GetDisplay();
-    XColor fg, bg;
-    Cursor cursor = None;
-    Uint32 *ptr;
-    Uint8 *data_bits, *mask_bits;
-    Pixmap data_pixmap, mask_pixmap;
-    int x, y;
-    unsigned int rfg, gfg, bfg, rbg, gbg, bbg, fgBits, bgBits;
-    unsigned int width_bytes = ((surface->w + 7) & ~7) / 8;
-
-    data_bits = SDL_calloc(1, surface->h * width_bytes);
-    if (!data_bits) {
-        SDL_OutOfMemory();
-        return None;
-    }
-
-    mask_bits = SDL_calloc(1, surface->h * width_bytes);
-    if (!mask_bits) {
-        SDL_free(data_bits);
-        SDL_OutOfMemory();
-        return None;
-    }
-
-    /* Code below assumes ARGB pixel format */
-    SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888);
-
-    rfg = gfg = bfg = rbg = gbg = bbg = fgBits = bgBits = 0;
-    for (y = 0; y < surface->h; ++y) {
-        ptr = (Uint32 *)((Uint8 *)surface->pixels + y * surface->pitch);
-        for (x = 0; x < surface->w; ++x) {
-            int alpha = (*ptr >> 24) & 0xff;
-            int red   = (*ptr >> 16) & 0xff;
-            int green = (*ptr >> 8) & 0xff;
-            int blue  = (*ptr >> 0) & 0xff;
-            if (alpha > 25) {
-                mask_bits[y * width_bytes + x / 8] |= (0x01 << (x % 8));
-
-                if ((red + green + blue) > 0x40) {
-                    fgBits++;
-                    rfg += red;
-                    gfg += green;
-                    bfg += blue;
-                    data_bits[y * width_bytes + x / 8] |= (0x01 << (x % 8));
-                } else {
-                    bgBits++;
-                    rbg += red;
-                    gbg += green;
-                    bbg += blue;
-                }
-            }
-            ++ptr;
-        }
-    }
-
-    if (fgBits) {
-        fg.red   = rfg * 257 / fgBits;
-        fg.green = gfg * 257 / fgBits;
-        fg.blue  = bfg * 257 / fgBits;
-    }
-    else fg.red = fg.green = fg.blue = 0;
-
-    if (bgBits) {
-        bg.red   = rbg * 257 / bgBits;
-        bg.green = gbg * 257 / bgBits;
-        bg.blue  = bbg * 257 / bgBits;
-    }
-    else bg.red = bg.green = bg.blue = 0;
-
-    data_pixmap = X11_XCreateBitmapFromData(display, DefaultRootWindow(display),
-                                        (char*)data_bits,
-                                        surface->w, surface->h);
-    mask_pixmap = X11_XCreateBitmapFromData(display, DefaultRootWindow(display),
-                                        (char*)mask_bits,
-                                        surface->w, surface->h);
-    cursor = X11_XCreatePixmapCursor(display, data_pixmap, mask_pixmap,
-                                 &fg, &bg, hot_x, hot_y);
-    X11_XFreePixmap(display, data_pixmap);
-    X11_XFreePixmap(display, mask_pixmap);
-
-    return cursor;
-}
-
-static SDL_Cursor *
-X11_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
-{
-    SDL_Cursor *cursor;
-
-    cursor = SDL_calloc(1, sizeof(*cursor));
-    if (cursor) {
-        Cursor x11_cursor = None;
-
-#if SDL_VIDEO_DRIVER_X11_XCURSOR
-        if (SDL_X11_HAVE_XCURSOR) {
-            x11_cursor = X11_CreateXCursorCursor(surface, hot_x, hot_y);
-        }
-#endif
-        if (x11_cursor == None) {
-            x11_cursor = X11_CreatePixmapCursor(surface, hot_x, hot_y);
-        }
-        cursor->driverdata = (void*)x11_cursor;
-    } else {
-        SDL_OutOfMemory();
-    }
-
-    return cursor;
-}
-
-static SDL_Cursor *
-X11_CreateSystemCursor(SDL_SystemCursor id)
-{
-    SDL_Cursor *cursor;
-    unsigned int shape;
-
-    switch(id)
-    {
-    default:
-        SDL_assert(0);
-        return NULL;
-    /* X Font Cursors reference: */
-    /*   http://tronche.com/gui/x/xlib/appendix/b/ */
-    case SDL_SYSTEM_CURSOR_ARROW:     shape = XC_left_ptr; break;
-    case SDL_SYSTEM_CURSOR_IBEAM:     shape = XC_xterm; break;
-    case SDL_SYSTEM_CURSOR_WAIT:      shape = XC_watch; break;
-    case SDL_SYSTEM_CURSOR_CROSSHAIR: shape = XC_tcross; break;
-    case SDL_SYSTEM_CURSOR_WAITARROW: shape = XC_watch; break;
-    case SDL_SYSTEM_CURSOR_SIZENWSE:  shape = XC_fleur; break;
-    case SDL_SYSTEM_CURSOR_SIZENESW:  shape = XC_fleur; break;
-    case SDL_SYSTEM_CURSOR_SIZEWE:    shape = XC_sb_h_double_arrow; break;
-    case SDL_SYSTEM_CURSOR_SIZENS:    shape = XC_sb_v_double_arrow; break;
-    case SDL_SYSTEM_CURSOR_SIZEALL:   shape = XC_fleur; break;
-    case SDL_SYSTEM_CURSOR_NO:        shape = XC_pirate; break;
-    case SDL_SYSTEM_CURSOR_HAND:      shape = XC_hand2; break;
-    }
-
-    cursor = SDL_calloc(1, sizeof(*cursor));
-    if (cursor) {
-        Cursor x11_cursor;
-
-        x11_cursor = X11_XCreateFontCursor(GetDisplay(), shape);
-
-        cursor->driverdata = (void*)x11_cursor;
-    } else {
-        SDL_OutOfMemory();
-    }
-
-    return cursor;
-}
-
-static void
-X11_FreeCursor(SDL_Cursor * cursor)
-{
-    Cursor x11_cursor = (Cursor)cursor->driverdata;
-
-    if (x11_cursor != None) {
-        X11_XFreeCursor(GetDisplay(), x11_cursor);
-    }
-    SDL_free(cursor);
-}
-
-static int
-X11_ShowCursor(SDL_Cursor * cursor)
-{
-    Cursor x11_cursor = 0;
-
-    if (cursor) {
-        x11_cursor = (Cursor)cursor->driverdata;
-    } else {
-        x11_cursor = X11_CreateEmptyCursor();
-    }
-
-    /* FIXME: Is there a better way than this? */
-    {
-        SDL_VideoDevice *video = SDL_GetVideoDevice();
-        Display *display = GetDisplay();
-        SDL_Window *window;
-        SDL_WindowData *data;
-
-        for (window = video->windows; window; window = window->next) {
-            data = (SDL_WindowData *)window->driverdata;
-            if (x11_cursor != None) {
-                X11_XDefineCursor(display, data->xwindow, x11_cursor);
-            } else {
-                X11_XUndefineCursor(display, data->xwindow);
-            }
-        }
-        X11_XFlush(display);
-    }
-    return 0;
-}
-
-static void
-X11_WarpMouse(SDL_Window * window, int x, int y)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-
-    X11_XWarpPointer(display, None, data->xwindow, 0, 0, 0, 0, x, y);
-    X11_XSync(display, False);
-}
-
-static int
-X11_SetRelativeMouseMode(SDL_bool enabled)
-{
-#if SDL_VIDEO_DRIVER_X11_XINPUT2
-    if(X11_Xinput2IsInitialized())
-        return 0;
-#else
-    SDL_Unsupported();
-#endif
-    return -1;
-}
-
-void
-X11_InitMouse(_THIS)
-{
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    mouse->CreateCursor = X11_CreateCursor;
-    mouse->CreateSystemCursor = X11_CreateSystemCursor;
-    mouse->ShowCursor = X11_ShowCursor;
-    mouse->FreeCursor = X11_FreeCursor;
-    mouse->WarpMouse = X11_WarpMouse;
-    mouse->SetRelativeMouseMode = X11_SetRelativeMouseMode;
-
-    SDL_SetDefaultCursor(X11_CreateDefaultCursor());
-}
-
-void
-X11_QuitMouse(_THIS)
-{
-    X11_DestroyEmptyCursor();
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11mouse.h b/deps/SDL2/src/video/x11/SDL_x11mouse.h
deleted file mode 100644
index ee7a14a..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11mouse.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11mouse_h
-#define _SDL_x11mouse_h
-
-extern void X11_InitMouse(_THIS);
-extern void X11_QuitMouse(_THIS);
-
-#endif /* _SDL_x11mouse_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11opengl.c b/deps/SDL2/src/video/x11/SDL_x11opengl.c
deleted file mode 100644
index a41033a..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11opengl.c
+++ /dev/null
@@ -1,825 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include "SDL_x11video.h"
-#include "SDL_assert.h"
-
-/* GLX implementation of SDL OpenGL support */
-
-#if SDL_VIDEO_OPENGL_GLX
-#include "SDL_loadso.h"
-#include "SDL_x11opengles.h"
-
-#if defined(__IRIX__)
-/* IRIX doesn't have a GL library versioning system */
-#define DEFAULT_OPENGL  "libGL.so"
-#elif defined(__MACOSX__)
-#define DEFAULT_OPENGL  "/usr/X11R6/lib/libGL.1.dylib"
-#elif defined(__QNXNTO__)
-#define DEFAULT_OPENGL  "libGL.so.3"
-#else
-#define DEFAULT_OPENGL  "libGL.so.1"
-#endif
-
-#ifndef GLX_NONE_EXT
-#define GLX_NONE_EXT                       0x8000
-#endif
-
-#ifndef GLX_ARB_multisample
-#define GLX_ARB_multisample
-#define GLX_SAMPLE_BUFFERS_ARB             100000
-#define GLX_SAMPLES_ARB                    100001
-#endif
-
-#ifndef GLX_EXT_visual_rating
-#define GLX_EXT_visual_rating
-#define GLX_VISUAL_CAVEAT_EXT              0x20
-#define GLX_NONE_EXT                       0x8000
-#define GLX_SLOW_VISUAL_EXT                0x8001
-#define GLX_NON_CONFORMANT_VISUAL_EXT      0x800D
-#endif
-
-#ifndef GLX_EXT_visual_info
-#define GLX_EXT_visual_info
-#define GLX_X_VISUAL_TYPE_EXT              0x22
-#define GLX_DIRECT_COLOR_EXT               0x8003
-#endif
-
-#ifndef GLX_ARB_create_context
-#define GLX_ARB_create_context
-#define GLX_CONTEXT_MAJOR_VERSION_ARB      0x2091
-#define GLX_CONTEXT_MINOR_VERSION_ARB      0x2092
-#define GLX_CONTEXT_FLAGS_ARB              0x2094
-#define GLX_CONTEXT_DEBUG_BIT_ARB          0x0001
-#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
-
-/* Typedef for the GL 3.0 context creation function */
-typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy,
-                                                        GLXFBConfig config,
-                                                        GLXContext
-                                                        share_context,
-                                                        Bool direct,
-                                                        const int
-                                                        *attrib_list);
-#endif
-
-#ifndef GLX_ARB_create_context_profile
-#define GLX_ARB_create_context_profile
-#define GLX_CONTEXT_PROFILE_MASK_ARB       0x9126
-#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB   0x00000001
-#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
-#endif
-
-#ifndef GLX_ARB_create_context_robustness
-#define GLX_ARB_create_context_robustness
-#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB  0x00000004
-#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB     0x8256
-#define GLX_NO_RESET_NOTIFICATION_ARB                   0x8261
-#define GLX_LOSE_CONTEXT_ON_RESET_ARB                   0x8252
-#endif
-
-#ifndef GLX_EXT_create_context_es2_profile
-#define GLX_EXT_create_context_es2_profile
-#ifndef GLX_CONTEXT_ES2_PROFILE_BIT_EXT
-#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT    0x00000002
-#endif
-#endif
-
-#ifndef GLX_ARB_framebuffer_sRGB
-#define GLX_ARB_framebuffer_sRGB
-#ifndef GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB
-#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB                0x20B2
-#endif
-#endif
-
-#ifndef GLX_EXT_swap_control
-#define GLX_SWAP_INTERVAL_EXT              0x20F1
-#define GLX_MAX_SWAP_INTERVAL_EXT          0x20F2
-#endif
-
-#ifndef GLX_EXT_swap_control_tear
-#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
-#endif
-
-#define OPENGL_REQUIRES_DLOPEN
-#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
-#include <dlfcn.h>
-#define GL_LoadObject(X)    dlopen(X, (RTLD_NOW|RTLD_GLOBAL))
-#define GL_LoadFunction     dlsym
-#define GL_UnloadObject     dlclose
-#else
-#define GL_LoadObject   SDL_LoadObject
-#define GL_LoadFunction SDL_LoadFunction
-#define GL_UnloadObject SDL_UnloadObject
-#endif
-
-static void X11_GL_InitExtensions(_THIS);
-
-
-int
-X11_GL_LoadLibrary(_THIS, const char *path)
-{
-    Display *display;
-    void *handle;
-
-    if (_this->gl_data) {
-        return SDL_SetError("OpenGL context already created");
-    }
-
-    /* Load the OpenGL library */
-    if (path == NULL) {
-        path = SDL_getenv("SDL_OPENGL_LIBRARY");
-    }
-    if (path == NULL) {
-        path = DEFAULT_OPENGL;
-    }
-    _this->gl_config.dll_handle = GL_LoadObject(path);
-    if (!_this->gl_config.dll_handle) {
-#if defined(OPENGL_REQUIRES_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
-        SDL_SetError("Failed loading %s: %s", path, dlerror());
-#endif
-        return -1;
-    }
-    SDL_strlcpy(_this->gl_config.driver_path, path,
-                SDL_arraysize(_this->gl_config.driver_path));
-
-    /* Allocate OpenGL memory */
-    _this->gl_data =
-        (struct SDL_GLDriverData *) SDL_calloc(1,
-                                               sizeof(struct
-                                                      SDL_GLDriverData));
-    if (!_this->gl_data) {
-        return SDL_OutOfMemory();
-    }
-
-    /* Load function pointers */
-    handle = _this->gl_config.dll_handle;
-    _this->gl_data->glXQueryExtension =
-        (Bool (*)(Display *, int *, int *))
-            GL_LoadFunction(handle, "glXQueryExtension");
-    _this->gl_data->glXGetProcAddress =
-        (void *(*)(const GLubyte *))
-            GL_LoadFunction(handle, "glXGetProcAddressARB");
-    _this->gl_data->glXChooseVisual =
-        (XVisualInfo * (*)(Display *, int, int *))
-            X11_GL_GetProcAddress(_this, "glXChooseVisual");
-    _this->gl_data->glXCreateContext =
-        (GLXContext(*)(Display *, XVisualInfo *, GLXContext, int))
-            X11_GL_GetProcAddress(_this, "glXCreateContext");
-    _this->gl_data->glXDestroyContext =
-        (void (*)(Display *, GLXContext))
-            X11_GL_GetProcAddress(_this, "glXDestroyContext");
-    _this->gl_data->glXMakeCurrent =
-        (int (*)(Display *, GLXDrawable, GLXContext))
-            X11_GL_GetProcAddress(_this, "glXMakeCurrent");
-    _this->gl_data->glXSwapBuffers =
-        (void (*)(Display *, GLXDrawable))
-            X11_GL_GetProcAddress(_this, "glXSwapBuffers");
-    _this->gl_data->glXQueryDrawable =
-        (void (*)(Display*,GLXDrawable,int,unsigned int*))
-            X11_GL_GetProcAddress(_this, "glXQueryDrawable");
-
-    if (!_this->gl_data->glXQueryExtension ||
-        !_this->gl_data->glXChooseVisual ||
-        !_this->gl_data->glXCreateContext ||
-        !_this->gl_data->glXDestroyContext ||
-        !_this->gl_data->glXMakeCurrent ||
-        !_this->gl_data->glXSwapBuffers) {
-        return SDL_SetError("Could not retrieve OpenGL functions");
-    }
-
-    display = ((SDL_VideoData *) _this->driverdata)->display;
-    if (!_this->gl_data->glXQueryExtension(display, &_this->gl_data->errorBase, &_this->gl_data->eventBase)) {
-        return SDL_SetError("GLX is not supported");
-    }
-
-    /* Initialize extensions */
-    X11_GL_InitExtensions(_this);
-    
-    /* If we need a GL ES context and there's no  
-     * GLX_EXT_create_context_es2_profile extension, switch over to X11_GLES functions  
-     */
-    if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES && 
-        ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile ) {
-#if SDL_VIDEO_OPENGL_EGL
-        X11_GL_UnloadLibrary(_this);
-        /* Better avoid conflicts! */
-        if (_this->gl_config.dll_handle != NULL ) {
-            GL_UnloadObject(_this->gl_config.dll_handle);
-            _this->gl_config.dll_handle = NULL;
-        }
-        _this->GL_LoadLibrary = X11_GLES_LoadLibrary;
-        _this->GL_GetProcAddress = X11_GLES_GetProcAddress;
-        _this->GL_UnloadLibrary = X11_GLES_UnloadLibrary;
-        _this->GL_CreateContext = X11_GLES_CreateContext;
-        _this->GL_MakeCurrent = X11_GLES_MakeCurrent;
-        _this->GL_SetSwapInterval = X11_GLES_SetSwapInterval;
-        _this->GL_GetSwapInterval = X11_GLES_GetSwapInterval;
-        _this->GL_SwapWindow = X11_GLES_SwapWindow;
-        _this->GL_DeleteContext = X11_GLES_DeleteContext;
-        return X11_GLES_LoadLibrary(_this, NULL);
-#else
-        return SDL_SetError("SDL not configured with EGL support");
-#endif
-    }
-
-    return 0;
-}
-
-void *
-X11_GL_GetProcAddress(_THIS, const char *proc)
-{
-    if (_this->gl_data->glXGetProcAddress) {
-        return _this->gl_data->glXGetProcAddress((const GLubyte *) proc);
-    }
-    return GL_LoadFunction(_this->gl_config.dll_handle, proc);
-}
-
-void
-X11_GL_UnloadLibrary(_THIS)
-{
-    /* Don't actually unload the library, since it may have registered
-     * X11 shutdown hooks, per the notes at:
-     * http://dri.sourceforge.net/doc/DRIuserguide.html
-     */
-#if 0
-    GL_UnloadObject(_this->gl_config.dll_handle);
-    _this->gl_config.dll_handle = NULL;
-#endif
-
-    /* Free OpenGL memory */
-    SDL_free(_this->gl_data);
-    _this->gl_data = NULL;
-}
-
-static SDL_bool
-HasExtension(const char *extension, const char *extensions)
-{
-    const char *start;
-    const char *where, *terminator;
-
-    /* Extension names should not have spaces. */
-    where = SDL_strchr(extension, ' ');
-    if (where || *extension == '\0')
-        return SDL_FALSE;
-
-    if (!extensions)
-        return SDL_FALSE;
-
-    /* It takes a bit of care to be fool-proof about parsing the
-     * OpenGL extensions string. Don't be fooled by sub-strings,
-     * etc. */
-
-    start = extensions;
-
-    for (;;) {
-        where = SDL_strstr(start, extension);
-        if (!where)
-            break;
-
-        terminator = where + SDL_strlen(extension);
-        if (where == start || *(where - 1) == ' ')
-            if (*terminator == ' ' || *terminator == '\0')
-                return SDL_TRUE;
-
-        start = terminator;
-    }
-    return SDL_FALSE;
-}
-
-static void
-X11_GL_InitExtensions(_THIS)
-{
-    Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-    int screen = DefaultScreen(display);
-    XVisualInfo *vinfo;
-    XSetWindowAttributes xattr;
-    Window w;
-    GLXContext context;
-    const char *(*glXQueryExtensionsStringFunc) (Display *, int);
-    const char *extensions;
-
-    vinfo = X11_GL_GetVisual(_this, display, screen);
-    if (!vinfo) {
-        return;
-    }
-    xattr.background_pixel = 0;
-    xattr.border_pixel = 0;
-    xattr.colormap =
-        X11_XCreateColormap(display, RootWindow(display, screen), vinfo->visual,
-                        AllocNone);
-    w = X11_XCreateWindow(display, RootWindow(display, screen), 0, 0, 32, 32, 0,
-                      vinfo->depth, InputOutput, vinfo->visual,
-                      (CWBackPixel | CWBorderPixel | CWColormap), &xattr);
-    context = _this->gl_data->glXCreateContext(display, vinfo, NULL, True);
-    if (context) {
-        _this->gl_data->glXMakeCurrent(display, w, context);
-    }
-    X11_XFree(vinfo);
-
-    glXQueryExtensionsStringFunc =
-        (const char *(*)(Display *, int)) X11_GL_GetProcAddress(_this,
-                                                                "glXQueryExtensionsString");
-    if (glXQueryExtensionsStringFunc) {
-        extensions = glXQueryExtensionsStringFunc(display, screen);
-    } else {
-        extensions = NULL;
-    }
-
-    /* Check for GLX_EXT_swap_control(_tear) */
-    _this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_FALSE;
-    if (HasExtension("GLX_EXT_swap_control", extensions)) {
-        _this->gl_data->glXSwapIntervalEXT =
-            (void (*)(Display*,GLXDrawable,int))
-                X11_GL_GetProcAddress(_this, "glXSwapIntervalEXT");
-        if (HasExtension("GLX_EXT_swap_control_tear", extensions)) {
-            _this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_TRUE;
-        }
-    }
-
-    /* Check for GLX_MESA_swap_control */
-    if (HasExtension("GLX_MESA_swap_control", extensions)) {
-        _this->gl_data->glXSwapIntervalMESA =
-            (int(*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalMESA");
-        _this->gl_data->glXGetSwapIntervalMESA =
-            (int(*)(void)) X11_GL_GetProcAddress(_this,
-                                                   "glXGetSwapIntervalMESA");
-    }
-
-    /* Check for GLX_SGI_swap_control */
-    if (HasExtension("GLX_SGI_swap_control", extensions)) {
-        _this->gl_data->glXSwapIntervalSGI =
-            (int (*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI");
-    }
-
-    /* Check for GLX_EXT_visual_rating */
-    if (HasExtension("GLX_EXT_visual_rating", extensions)) {
-        _this->gl_data->HAS_GLX_EXT_visual_rating = SDL_TRUE;
-    }
-
-    /* Check for GLX_EXT_visual_info */
-    if (HasExtension("GLX_EXT_visual_info", extensions)) {
-        _this->gl_data->HAS_GLX_EXT_visual_info = SDL_TRUE;
-    }
-    
-    /* Check for GLX_EXT_create_context_es2_profile */
-    if (HasExtension("GLX_EXT_create_context_es2_profile", extensions)) {
-        _this->gl_data->HAS_GLX_EXT_create_context_es2_profile = SDL_TRUE;
-    }
-
-    if (context) {
-        _this->gl_data->glXMakeCurrent(display, None, NULL);
-        _this->gl_data->glXDestroyContext(display, context);
-    }
-    X11_XDestroyWindow(display, w);
-    X11_PumpEvents(_this);
-}
-
-/* glXChooseVisual and glXChooseFBConfig have some small differences in
- * the attribute encoding, it can be chosen with the for_FBConfig parameter.
- */
-int
-X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int size, Bool for_FBConfig)
-{
-    int i = 0;
-    const int MAX_ATTRIBUTES = 64;
-
-    /* assert buffer is large enough to hold all SDL attributes. */
-    SDL_assert(size >= MAX_ATTRIBUTES);
-
-    /* Setup our GLX attributes according to the gl_config. */
-    if( for_FBConfig ) {
-        attribs[i++] = GLX_RENDER_TYPE;
-        attribs[i++] = GLX_RGBA_BIT;
-    } else {
-        attribs[i++] = GLX_RGBA;
-    }
-    attribs[i++] = GLX_RED_SIZE;
-    attribs[i++] = _this->gl_config.red_size;
-    attribs[i++] = GLX_GREEN_SIZE;
-    attribs[i++] = _this->gl_config.green_size;
-    attribs[i++] = GLX_BLUE_SIZE;
-    attribs[i++] = _this->gl_config.blue_size;
-
-    if (_this->gl_config.alpha_size) {
-        attribs[i++] = GLX_ALPHA_SIZE;
-        attribs[i++] = _this->gl_config.alpha_size;
-    }
-
-    if (_this->gl_config.double_buffer) {
-        attribs[i++] = GLX_DOUBLEBUFFER;
-        if( for_FBConfig ) {
-            attribs[i++] = True;
-        }
-    }
-
-    attribs[i++] = GLX_DEPTH_SIZE;
-    attribs[i++] = _this->gl_config.depth_size;
-
-    if (_this->gl_config.stencil_size) {
-        attribs[i++] = GLX_STENCIL_SIZE;
-        attribs[i++] = _this->gl_config.stencil_size;
-    }
-
-    if (_this->gl_config.accum_red_size) {
-        attribs[i++] = GLX_ACCUM_RED_SIZE;
-        attribs[i++] = _this->gl_config.accum_red_size;
-    }
-
-    if (_this->gl_config.accum_green_size) {
-        attribs[i++] = GLX_ACCUM_GREEN_SIZE;
-        attribs[i++] = _this->gl_config.accum_green_size;
-    }
-
-    if (_this->gl_config.accum_blue_size) {
-        attribs[i++] = GLX_ACCUM_BLUE_SIZE;
-        attribs[i++] = _this->gl_config.accum_blue_size;
-    }
-
-    if (_this->gl_config.accum_alpha_size) {
-        attribs[i++] = GLX_ACCUM_ALPHA_SIZE;
-        attribs[i++] = _this->gl_config.accum_alpha_size;
-    }
-
-    if (_this->gl_config.stereo) {
-        attribs[i++] = GLX_STEREO;
-        if( for_FBConfig ) {
-            attribs[i++] = True;
-        }
-    }
-
-    if (_this->gl_config.multisamplebuffers) {
-        attribs[i++] = GLX_SAMPLE_BUFFERS_ARB;
-        attribs[i++] = _this->gl_config.multisamplebuffers;
-    }
-
-    if (_this->gl_config.multisamplesamples) {
-        attribs[i++] = GLX_SAMPLES_ARB;
-        attribs[i++] = _this->gl_config.multisamplesamples;
-    }
-
-    if (_this->gl_config.framebuffer_srgb_capable) {
-        attribs[i++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB;
-        if( for_FBConfig ) {
-            attribs[i++] = True;
-        }
-    }
-
-    if (_this->gl_config.accelerated >= 0 &&
-        _this->gl_data->HAS_GLX_EXT_visual_rating) {
-        attribs[i++] = GLX_VISUAL_CAVEAT_EXT;
-        attribs[i++] = _this->gl_config.accelerated ? GLX_NONE_EXT :
-                                                      GLX_SLOW_VISUAL_EXT;
-    }
-
-    /* If we're supposed to use DirectColor visuals, and we've got the
-       EXT_visual_info extension, then add GLX_X_VISUAL_TYPE_EXT. */
-    if (X11_UseDirectColorVisuals() &&
-        _this->gl_data->HAS_GLX_EXT_visual_info) {
-        attribs[i++] = GLX_X_VISUAL_TYPE_EXT;
-        attribs[i++] = GLX_DIRECT_COLOR_EXT;
-    }
-
-    attribs[i++] = None;
-
-    SDL_assert(i <= MAX_ATTRIBUTES);
-
-    return i;
-}
-
-XVisualInfo *
-X11_GL_GetVisual(_THIS, Display * display, int screen)
-{
-    XVisualInfo *vinfo;
-
-    /* 64 seems nice. */
-    int attribs[64];
-    X11_GL_GetAttributes(_this,display,screen,attribs,64,SDL_FALSE);
-
-    if (!_this->gl_data) {
-        /* The OpenGL library wasn't loaded, SDL_GetError() should have info */
-        return NULL;
-    }
-
-    vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs);
-    if (!vinfo) {
-        SDL_SetError("Couldn't find matching GLX visual");
-    }
-    return vinfo;
-}
-
-#ifndef GLXBadContext
-#define GLXBadContext 0
-#endif
-#ifndef GLXBadFBConfig
-#define GLXBadFBConfig 9
-#endif
-#ifndef GLXBadProfileARB
-#define GLXBadProfileARB 13
-#endif
-static int (*handler) (Display *, XErrorEvent *) = NULL;
-static int errorBase = 0;
-static int
-X11_GL_CreateContextErrorHandler(Display * d, XErrorEvent * e)
-{
-    switch (e->error_code) {
-    case BadRequest:
-    case BadMatch:
-    case BadValue:
-    case BadAlloc:
-        return (0);
-    default:
-        if (errorBase && 
-            (e->error_code == errorBase + GLXBadContext ||
-             e->error_code == errorBase + GLXBadFBConfig ||
-             e->error_code == errorBase + GLXBadProfileARB)) {
-            return (0);
-        }
-        return (handler(d, e));
-    }
-}
-
-SDL_GLContext
-X11_GL_CreateContext(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-    int screen =
-        ((SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata)->screen;
-    XWindowAttributes xattr;
-    XVisualInfo v, *vinfo;
-    int n;
-    GLXContext context = NULL, share_context;
-    PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribs = NULL;
-
-    if (_this->gl_config.share_with_current_context) {
-        share_context = (GLXContext)SDL_GL_GetCurrentContext();
-    } else {
-        share_context = NULL;
-    }
-
-    /* We do this to create a clean separation between X and GLX errors. */
-    X11_XSync(display, False);
-    errorBase = _this->gl_data->errorBase;
-    handler = X11_XSetErrorHandler(X11_GL_CreateContextErrorHandler);
-    X11_XGetWindowAttributes(display, data->xwindow, &xattr);
-    v.screen = screen;
-    v.visualid = X11_XVisualIDFromVisual(xattr.visual);
-    vinfo = X11_XGetVisualInfo(display, VisualScreenMask | VisualIDMask, &v, &n);
-    if (vinfo) {
-        if (_this->gl_config.major_version < 3 &&
-            _this->gl_config.profile_mask == 0 &&
-            _this->gl_config.flags == 0) {
-            /* Create legacy context */
-            context =
-                _this->gl_data->glXCreateContext(display, vinfo, share_context, True);
-        } else {
-            /* If we want a GL 3.0 context or later we need to get a temporary
-               context to grab the new context creation function */
-            GLXContext temp_context =
-                _this->gl_data->glXCreateContext(display, vinfo, NULL, True);
-            if (temp_context) {
-                /* max 8 attributes plus terminator */
-                int attribs[9] = {
-                    GLX_CONTEXT_MAJOR_VERSION_ARB,
-                    _this->gl_config.major_version,
-                    GLX_CONTEXT_MINOR_VERSION_ARB,
-                    _this->gl_config.minor_version,
-                    0
-                };
-                int iattr = 4;
-
-                /* SDL profile bits match GLX profile bits */
-                if( _this->gl_config.profile_mask != 0 ) {
-                    attribs[iattr++] = GLX_CONTEXT_PROFILE_MASK_ARB;
-                    attribs[iattr++] = _this->gl_config.profile_mask;
-                }
-
-                /* SDL flags match GLX flags */
-                if( _this->gl_config.flags != 0 ) {
-                    attribs[iattr++] = GLX_CONTEXT_FLAGS_ARB;
-                    attribs[iattr++] = _this->gl_config.flags;
-                }
-
-                attribs[iattr++] = 0;
-
-                /* Get a pointer to the context creation function for GL 3.0 */
-                glXCreateContextAttribs =
-                    (PFNGLXCREATECONTEXTATTRIBSARBPROC) _this->gl_data->
-                    glXGetProcAddress((GLubyte *)
-                                      "glXCreateContextAttribsARB");
-                if (!glXCreateContextAttribs) {
-                    SDL_SetError("GL 3.x is not supported");
-                    context = temp_context;
-                } else {
-                    int glxAttribs[64];
-
-                    /* Create a GL 3.x context */
-                    GLXFBConfig *framebuffer_config = NULL;
-                    int fbcount = 0;
-                    GLXFBConfig *(*glXChooseFBConfig) (Display * disp,
-                                                       int screen,
-                                                       const int *attrib_list,
-                                                       int *nelements);
-
-                    glXChooseFBConfig =
-                        (GLXFBConfig *
-                         (*)(Display *, int, const int *,
-                             int *)) _this->gl_data->
-                        glXGetProcAddress((GLubyte *) "glXChooseFBConfig");
-
-                    X11_GL_GetAttributes(_this,display,screen,glxAttribs,64,SDL_TRUE);
-
-                    if (!glXChooseFBConfig
-                        || !(framebuffer_config =
-                             glXChooseFBConfig(display,
-                                               DefaultScreen(display), glxAttribs,
-                                               &fbcount))) {
-                        SDL_SetError
-                            ("No good framebuffers found. GL 3.x disabled");
-                        context = temp_context;
-                    } else {
-                        context =
-                            glXCreateContextAttribs(display,
-                                                    framebuffer_config[0],
-                                                    share_context, True, attribs);
-                        _this->gl_data->glXDestroyContext(display,
-                                                          temp_context);
-                    }
-                }
-            }
-        }
-        X11_XFree(vinfo);
-    }
-    X11_XSync(display, False);
-    X11_XSetErrorHandler(handler);
-
-    if (!context) {
-        SDL_SetError("Could not create GL context");
-        return NULL;
-    }
-
-    if (X11_GL_MakeCurrent(_this, window, context) < 0) {
-        X11_GL_DeleteContext(_this, context);
-        return NULL;
-    }
-
-    return context;
-}
-
-int
-X11_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
-{
-    Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-    Window drawable =
-        (context ? ((SDL_WindowData *) window->driverdata)->xwindow : None);
-    GLXContext glx_context = (GLXContext) context;
-
-    if (!_this->gl_data) {
-        return SDL_SetError("OpenGL not initialized");
-    }
-
-    if (!_this->gl_data->glXMakeCurrent(display, drawable, glx_context)) {
-        return SDL_SetError("Unable to make GL context current");
-    }
-
-    return 0;
-}
-
-/*
-   0 is a valid argument to glxSwapInterval(MESA|EXT) and setting it to 0
-   will undo the effect of a previous call with a value that is greater
-   than zero (or at least that is what the docs say). OTOH, 0 is an invalid
-   argument to glxSwapIntervalSGI and it returns an error if you call it
-   with 0 as an argument.
-*/
-
-static int swapinterval = -1;
-int
-X11_GL_SetSwapInterval(_THIS, int interval)
-{
-    int status = -1;
-
-    if ((interval < 0) && (!_this->gl_data->HAS_GLX_EXT_swap_control_tear)) {
-        SDL_SetError("Negative swap interval unsupported in this GL");
-    } else if (_this->gl_data->glXSwapIntervalEXT) {
-        Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-        const SDL_WindowData *windowdata = (SDL_WindowData *)
-            SDL_GL_GetCurrentWindow()->driverdata;
-
-        Window drawable = windowdata->xwindow;
-
-        /*
-         * This is a workaround for a bug in NVIDIA drivers. Bug has been reported
-         * and will be fixed in a future release (probably 319.xx).
-         *
-         * There's a bug where glXSetSwapIntervalEXT ignores updates because
-         * it has the wrong value cached. To work around it, we just run a no-op
-         * update to the current value.
-         */
-        int currentInterval = X11_GL_GetSwapInterval(_this);
-        _this->gl_data->glXSwapIntervalEXT(display, drawable, currentInterval);
-        _this->gl_data->glXSwapIntervalEXT(display, drawable, interval);
-
-        status = 0;
-        swapinterval = interval;
-    } else if (_this->gl_data->glXSwapIntervalMESA) {
-        status = _this->gl_data->glXSwapIntervalMESA(interval);
-        if (status != 0) {
-            SDL_SetError("glxSwapIntervalMESA failed");
-        } else {
-            swapinterval = interval;
-        }
-    } else if (_this->gl_data->glXSwapIntervalSGI) {
-        status = _this->gl_data->glXSwapIntervalSGI(interval);
-        if (status != 0) {
-            SDL_SetError("glxSwapIntervalSGI failed");
-        } else {
-            swapinterval = interval;
-        }
-    } else {
-        SDL_Unsupported();
-    }
-    return status;
-}
-
-int
-X11_GL_GetSwapInterval(_THIS)
-{
-    if (_this->gl_data->glXSwapIntervalEXT) {
-        Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-        const SDL_WindowData *windowdata = (SDL_WindowData *)
-            SDL_GL_GetCurrentWindow()->driverdata;
-        Window drawable = windowdata->xwindow;
-        unsigned int allow_late_swap_tearing = 0;
-        unsigned int interval = 0;
-
-        if (_this->gl_data->HAS_GLX_EXT_swap_control_tear) {
-            _this->gl_data->glXQueryDrawable(display, drawable,
-                                            GLX_LATE_SWAPS_TEAR_EXT,
-                                            &allow_late_swap_tearing);
-        }
-
-        _this->gl_data->glXQueryDrawable(display, drawable,
-                                         GLX_SWAP_INTERVAL_EXT, &interval);
-
-        if ((allow_late_swap_tearing) && (interval > 0)) {
-            return -((int) interval);
-        }
-
-        return (int) interval;
-    } else if (_this->gl_data->glXGetSwapIntervalMESA) {
-        return _this->gl_data->glXGetSwapIntervalMESA();
-    } else {
-        return swapinterval;
-    }
-}
-
-void
-X11_GL_SwapWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-
-    _this->gl_data->glXSwapBuffers(display, data->xwindow);
-}
-
-void
-X11_GL_DeleteContext(_THIS, SDL_GLContext context)
-{
-    Display *display = ((SDL_VideoData *) _this->driverdata)->display;
-    GLXContext glx_context = (GLXContext) context;
-
-    if (!_this->gl_data) {
-        return;
-    }
-    _this->gl_data->glXDestroyContext(display, glx_context);
-    X11_XSync(display, False);
-}
-
-#endif /* SDL_VIDEO_OPENGL_GLX */
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11opengl.h b/deps/SDL2/src/video/x11/SDL_x11opengl.h
deleted file mode 100644
index 27d7f9a..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11opengl.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11opengl_h
-#define _SDL_x11opengl_h
-
-#if SDL_VIDEO_OPENGL_GLX
-#include "SDL_opengl.h"
-#include <GL/glx.h>
-
-struct SDL_GLDriverData
-{
-    int errorBase, eventBase;
-
-    SDL_bool HAS_GLX_EXT_visual_rating;
-    SDL_bool HAS_GLX_EXT_visual_info;
-    SDL_bool HAS_GLX_EXT_swap_control_tear;
-    SDL_bool HAS_GLX_EXT_create_context_es2_profile;
-
-    Bool (*glXQueryExtension) (Display*,int*,int*);
-    void *(*glXGetProcAddress) (const GLubyte*);
-    XVisualInfo *(*glXChooseVisual) (Display*,int,int*);
-    GLXContext (*glXCreateContext) (Display*,XVisualInfo*,GLXContext,Bool);
-    void (*glXDestroyContext) (Display*, GLXContext);
-    Bool(*glXMakeCurrent) (Display*,GLXDrawable,GLXContext);
-    void (*glXSwapBuffers) (Display*, GLXDrawable);
-    void (*glXQueryDrawable) (Display*,GLXDrawable,int,unsigned int*);
-    void (*glXSwapIntervalEXT) (Display*,GLXDrawable,int);
-    int (*glXSwapIntervalSGI) (int);
-    int (*glXSwapIntervalMESA) (int);
-    int (*glXGetSwapIntervalMESA) (void);
-};
-
-/* OpenGL functions */
-extern int X11_GL_LoadLibrary(_THIS, const char *path);
-extern void *X11_GL_GetProcAddress(_THIS, const char *proc);
-extern void X11_GL_UnloadLibrary(_THIS);
-extern XVisualInfo *X11_GL_GetVisual(_THIS, Display * display, int screen);
-extern SDL_GLContext X11_GL_CreateContext(_THIS, SDL_Window * window);
-extern int X11_GL_MakeCurrent(_THIS, SDL_Window * window,
-                              SDL_GLContext context);
-extern int X11_GL_SetSwapInterval(_THIS, int interval);
-extern int X11_GL_GetSwapInterval(_THIS);
-extern void X11_GL_SwapWindow(_THIS, SDL_Window * window);
-extern void X11_GL_DeleteContext(_THIS, SDL_GLContext context);
-
-#endif /* SDL_VIDEO_OPENGL_GLX */
-
-#endif /* _SDL_x11opengl_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11opengles.c b/deps/SDL2/src/video/x11/SDL_x11opengles.c
deleted file mode 100644
index f972cee..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11opengles.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11 && SDL_VIDEO_OPENGL_EGL
-
-#include "SDL_x11video.h"
-#include "SDL_x11opengles.h"
-#include "SDL_x11opengl.h"
-
-/* EGL implementation of SDL OpenGL support */
-
-int
-X11_GLES_LoadLibrary(_THIS, const char *path) {
-        
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    /* If the profile requested is not GL ES, switch over to X11_GL functions  */
-    if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) {
-        #if SDL_VIDEO_OPENGL_GLX
-        _this->GL_LoadLibrary = X11_GL_LoadLibrary;
-        _this->GL_GetProcAddress = X11_GL_GetProcAddress;
-        _this->GL_UnloadLibrary = X11_GL_UnloadLibrary;
-        _this->GL_CreateContext = X11_GL_CreateContext;
-        _this->GL_MakeCurrent = X11_GL_MakeCurrent;
-        _this->GL_SetSwapInterval = X11_GL_SetSwapInterval;
-        _this->GL_GetSwapInterval = X11_GL_GetSwapInterval;
-        _this->GL_SwapWindow = X11_GL_SwapWindow;
-        _this->GL_DeleteContext = X11_GL_DeleteContext;
-        return X11_GL_LoadLibrary(_this, path);
-        #else
-        return SDL_SetError("SDL not configured with OpenGL/GLX support");
-        #endif
-    }
-    
-    return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display);
-}
-
-XVisualInfo *
-X11_GLES_GetVisual(_THIS, Display * display, int screen)
-{
-   
-    XVisualInfo *egl_visualinfo = NULL;
-    EGLint visual_id;
-    XVisualInfo vi_in;
-    int out_count;
-
-    if (!_this->egl_data) {
-        /* The EGL library wasn't loaded, SDL_GetError() should have info */
-        return NULL;
-    }
-
-    if (_this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display,
-                                            _this->egl_data->egl_config,
-                                            EGL_NATIVE_VISUAL_ID,
-                                            &visual_id) == EGL_FALSE || !visual_id) {
-        /* Use the default visual when all else fails */
-        vi_in.screen = screen;
-        egl_visualinfo = X11_XGetVisualInfo(display,
-                                        VisualScreenMask,
-                                        &vi_in, &out_count);
-    } else {
-        vi_in.screen = screen;
-        vi_in.visualid = visual_id;
-        egl_visualinfo = X11_XGetVisualInfo(display, VisualScreenMask | VisualIDMask, &vi_in, &out_count);
-    }
-
-    return egl_visualinfo;
-}
-
-SDL_GLContext
-X11_GLES_CreateContext(_THIS, SDL_Window * window)
-{
-    SDL_GLContext context;
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-
-    X11_XSync(display, False);
-    context = SDL_EGL_CreateContext(_this, data->egl_surface);
-    X11_XSync(display, False);
-
-    return context;
-}
-
-SDL_EGL_SwapWindow_impl(X11)
-SDL_EGL_MakeCurrent_impl(X11)
-
-#endif /* SDL_VIDEO_DRIVER_X11 && SDL_VIDEO_OPENGL_EGL */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11opengles.h b/deps/SDL2/src/video/x11/SDL_x11opengles.h
deleted file mode 100644
index 978f91f..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11opengles.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11opengles_h
-#define _SDL_x11opengles_h
-
-#if SDL_VIDEO_OPENGL_EGL
-
-#include "../SDL_sysvideo.h"
-#include "../SDL_egl.h"
-
-typedef struct SDL_PrivateGLESData
-{
-} SDL_PrivateGLESData;
-
-/* OpenGLES functions */
-#define X11_GLES_GetAttribute SDL_EGL_GetAttribute
-#define X11_GLES_GetProcAddress SDL_EGL_GetProcAddress
-#define X11_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
-#define X11_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
-#define X11_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
-#define X11_GLES_DeleteContext SDL_EGL_DeleteContext
-
-extern int X11_GLES_LoadLibrary(_THIS, const char *path);
-extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen);
-extern SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window * window);
-extern void X11_GLES_SwapWindow(_THIS, SDL_Window * window);
-extern int X11_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
-
-#endif /* SDL_VIDEO_OPENGL_EGL */
-
-#endif /* _SDL_x11opengles_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11shape.c b/deps/SDL2/src/video/x11/SDL_x11shape.c
deleted file mode 100644
index af89851..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11shape.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include "SDL_assert.h"
-#include "SDL_x11video.h"
-#include "SDL_x11shape.h"
-#include "SDL_x11window.h"
-#include "../SDL_shape_internals.h"
-
-SDL_Window*
-X11_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags) {
-    return SDL_CreateWindow(title,x,y,w,h,flags);
-}
-
-SDL_WindowShaper*
-X11_CreateShaper(SDL_Window* window) {
-    SDL_WindowShaper* result = NULL;
-    SDL_ShapeData* data = NULL;
-    int resized_properly;
-
-#if SDL_VIDEO_DRIVER_X11_XSHAPE
-    if (SDL_X11_HAVE_XSHAPE) {  /* Make sure X server supports it. */
-        result = malloc(sizeof(SDL_WindowShaper));
-        result->window = window;
-        result->mode.mode = ShapeModeDefault;
-        result->mode.parameters.binarizationCutoff = 1;
-        result->userx = result->usery = 0;
-        data = SDL_malloc(sizeof(SDL_ShapeData));
-        result->driverdata = data;
-        data->bitmapsize = 0;
-        data->bitmap = NULL;
-        window->shaper = result;
-        resized_properly = X11_ResizeWindowShape(window);
-        SDL_assert(resized_properly == 0);
-    }
-#endif
-
-    return result;
-}
-
-int
-X11_ResizeWindowShape(SDL_Window* window) {
-    SDL_ShapeData* data = window->shaper->driverdata;
-    unsigned int bitmapsize = window->w / 8;
-    SDL_assert(data != NULL);
-
-    if(window->w % 8 > 0)
-        bitmapsize += 1;
-    bitmapsize *= window->h;
-    if(data->bitmapsize != bitmapsize || data->bitmap == NULL) {
-        data->bitmapsize = bitmapsize;
-        if(data->bitmap != NULL)
-            free(data->bitmap);
-        data->bitmap = malloc(data->bitmapsize);
-        if(data->bitmap == NULL) {
-            return SDL_SetError("Could not allocate memory for shaped-window bitmap.");
-        }
-    }
-    memset(data->bitmap,0,data->bitmapsize);
-
-    window->shaper->userx = window->x;
-    window->shaper->usery = window->y;
-    SDL_SetWindowPosition(window,-1000,-1000);
-
-    return 0;
-}
-
-int
-X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) {
-    SDL_ShapeData *data = NULL;
-    SDL_WindowData *windowdata = NULL;
-    Pixmap shapemask;
-    
-    if(shaper == NULL || shape == NULL || shaper->driverdata == NULL)
-        return -1;
-
-#if SDL_VIDEO_DRIVER_X11_XSHAPE
-    if(shape->format->Amask == 0 && SDL_SHAPEMODEALPHA(shape_mode->mode))
-        return -2;
-    if(shape->w != shaper->window->w || shape->h != shaper->window->h)
-        return -3;
-    data = shaper->driverdata;
-
-    /* Assume that shaper->alphacutoff already has a value, because SDL_SetWindowShape() should have given it one. */
-    SDL_CalculateShapeBitmap(shaper->mode,shape,data->bitmap,8);
-
-    windowdata = (SDL_WindowData*)(shaper->window->driverdata);
-    shapemask = X11_XCreateBitmapFromData(windowdata->videodata->display,windowdata->xwindow,data->bitmap,shaper->window->w,shaper->window->h);
-
-    X11_XShapeCombineMask(windowdata->videodata->display,windowdata->xwindow, ShapeBounding, 0, 0,shapemask, ShapeSet);
-    X11_XSync(windowdata->videodata->display,False);
-
-    X11_XFreePixmap(windowdata->videodata->display,shapemask);
-#endif
-
-    return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
diff --git a/deps/SDL2/src/video/x11/SDL_x11shape.h b/deps/SDL2/src/video/x11/SDL_x11shape.h
deleted file mode 100644
index 96b4a8b..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11shape.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11shape_h
-#define _SDL_x11shape_h
-
-#include "SDL_video.h"
-#include "SDL_shape.h"
-#include "../SDL_sysvideo.h"
-
-typedef struct {
-    void* bitmap;
-    Uint32 bitmapsize;
-} SDL_ShapeData;
-
-extern SDL_Window* X11_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
-extern SDL_WindowShaper* X11_CreateShaper(SDL_Window* window);
-extern int X11_ResizeWindowShape(SDL_Window* window);
-extern int X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode);
-
-#endif /* _SDL_x11shape_h */
diff --git a/deps/SDL2/src/video/x11/SDL_x11sym.h b/deps/SDL2/src/video/x11/SDL_x11sym.h
deleted file mode 100644
index 1ee982b..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11sym.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* *INDENT-OFF* */
-
-SDL_X11_MODULE(BASEXLIB)
-SDL_X11_SYM(XSizeHints*,XAllocSizeHints,(void),(),return)
-SDL_X11_SYM(XWMHints*,XAllocWMHints,(void),(),return)
-SDL_X11_SYM(XClassHint*,XAllocClassHint,(void),(),return)
-SDL_X11_SYM(int,XAutoRepeatOn,(Display* a),(a),return)
-SDL_X11_SYM(int,XAutoRepeatOff,(Display* a),(a),return)
-SDL_X11_SYM(int,XChangePointerControl,(Display* a,Bool b,Bool c,int d,int e,int f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(int,XChangeProperty,(Display* a,Window b,Atom c,Atom d,int e,int f,_Xconst unsigned char* g,int h),(a,b,c,d,e,f,g,h),return)
-SDL_X11_SYM(Bool,XCheckIfEvent,(Display* a,XEvent *b,Bool (*c)(Display*,XEvent*,XPointer),XPointer d),(a,b,c,d),return)
-SDL_X11_SYM(int,XClearWindow,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(int,XCloseDisplay,(Display* a),(a),return)
-SDL_X11_SYM(int,XConvertSelection,(Display* a,Atom b,Atom c,Atom d,Window e,Time f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(Pixmap,XCreateBitmapFromData,(Display *dpy,Drawable d,_Xconst char *data,unsigned int width,unsigned int height),(dpy,d,data,width,height),return)
-SDL_X11_SYM(Colormap,XCreateColormap,(Display* a,Window b,Visual* c,int d),(a,b,c,d),return)
-SDL_X11_SYM(Cursor,XCreatePixmapCursor,(Display* a,Pixmap b,Pixmap c,XColor* d,XColor* e,unsigned int f,unsigned int g),(a,b,c,d,e,f,g),return)
-SDL_X11_SYM(Cursor,XCreateFontCursor,(Display* a,unsigned int b),(a,b),return)
-SDL_X11_SYM(XFontSet,XCreateFontSet,(Display* a, _Xconst char* b, char*** c, int* d, char**	e),(a,b,c,d,e),return)
-SDL_X11_SYM(GC,XCreateGC,(Display* a,Drawable b,unsigned long c,XGCValues* d),(a,b,c,d),return)
-SDL_X11_SYM(XImage*,XCreateImage,(Display* a,Visual* b,unsigned int c,int d,int e,char* f,unsigned int g,unsigned int h,int i,int j),(a,b,c,d,e,f,g,h,i,j),return)
-SDL_X11_SYM(Window,XCreateWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,int h,unsigned int i,Visual* j,unsigned long k,XSetWindowAttributes* l),(a,b,c,d,e,f,g,h,i,j,k,l),return)
-SDL_X11_SYM(int,XDefineCursor,(Display* a,Window b,Cursor c),(a,b,c),return)
-SDL_X11_SYM(int,XDeleteProperty,(Display* a,Window b,Atom c),(a,b,c),return)
-SDL_X11_SYM(int,XDestroyWindow,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(int,XDisplayKeycodes,(Display* a,int* b,int* c),(a,b,c),return)
-SDL_X11_SYM(int,XDrawRectangle,(Display* a,Drawable b,GC c,int d,int e,unsigned int f,unsigned int g),(a,b,c,d,e,f,g),return)
-SDL_X11_SYM(char*,XDisplayName,(_Xconst char* a),(a),return)
-SDL_X11_SYM(int,XDrawString,(Display* a,Drawable b,GC c,int d,int e,_Xconst char* f,int g),(a,b,c,d,e,f,g),return)
-SDL_X11_SYM(int,XEventsQueued,(Display* a,int b),(a,b),return)
-SDL_X11_SYM(int,XFillRectangle,(Display* a,Drawable b,GC c,int d,int e,unsigned int f,unsigned int g),(a,b,c,d,e,f,g),return)
-SDL_X11_SYM(Bool,XFilterEvent,(XEvent *event,Window w),(event,w),return)
-SDL_X11_SYM(int,XFlush,(Display* a),(a),return)
-SDL_X11_SYM(int,XFree,(void*a),(a),return)
-SDL_X11_SYM(int,XFreeCursor,(Display* a,Cursor b),(a,b),return)
-SDL_X11_SYM(void,XFreeFontSet,(Display* a, XFontSet b),(a,b),)
-SDL_X11_SYM(int,XFreeGC,(Display* a,GC b),(a,b),return)
-SDL_X11_SYM(int,XFreeFont,(Display* a, XFontStruct* b),(a,b),return)
-SDL_X11_SYM(int,XFreeModifiermap,(XModifierKeymap* a),(a),return)
-SDL_X11_SYM(int,XFreePixmap,(Display* a,Pixmap b),(a,b),return)
-SDL_X11_SYM(void,XFreeStringList,(char** a),(a),)
-SDL_X11_SYM(char*,XGetAtomName,(Display *a,Atom b),(a,b),return)
-SDL_X11_SYM(int,XGetInputFocus,(Display *a,Window *b,int *c),(a,b,c),return)
-SDL_X11_SYM(int,XGetErrorDatabaseText,(Display* a,_Xconst char* b,_Xconst char* c,_Xconst char* d,char* e,int f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(XModifierKeymap*,XGetModifierMapping,(Display* a),(a),return)
-SDL_X11_SYM(int,XGetPointerControl,(Display* a,int* b,int* c,int* d),(a,b,c,d),return)
-SDL_X11_SYM(Window,XGetSelectionOwner,(Display* a,Atom b),(a,b),return)
-SDL_X11_SYM(XVisualInfo*,XGetVisualInfo,(Display* a,long b,XVisualInfo* c,int* d),(a,b,c,d),return)
-SDL_X11_SYM(Status,XGetWindowAttributes,(Display* a,Window b,XWindowAttributes* c),(a,b,c),return)
-SDL_X11_SYM(int,XGetWindowProperty,(Display* a,Window b,Atom c,long d,long e,Bool f,Atom g,Atom* h,int* i,unsigned long* j,unsigned long *k,unsigned char **l),(a,b,c,d,e,f,g,h,i,j,k,l),return)
-SDL_X11_SYM(XWMHints*,XGetWMHints,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(Status,XGetWMNormalHints,(Display *a,Window b, XSizeHints *c, long *d),(a,b,c,d),return)
-SDL_X11_SYM(int,XIfEvent,(Display* a,XEvent *b,Bool (*c)(Display*,XEvent*,XPointer),XPointer d),(a,b,c,d),return)
-SDL_X11_SYM(int,XGrabKeyboard,(Display* a,Window b,Bool c,int d,int e,Time f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(int,XGrabPointer,(Display* a,Window b,Bool c,unsigned int d,int e,int f,Window g,Cursor h,Time i),(a,b,c,d,e,f,g,h,i),return)
-SDL_X11_SYM(int,XGrabServer,(Display* a),(a),return)
-SDL_X11_SYM(Status,XIconifyWindow,(Display* a,Window b,int c),(a,b,c),return)
-SDL_X11_SYM(KeyCode,XKeysymToKeycode,(Display* a,KeySym b),(a,b),return)
-SDL_X11_SYM(char*,XKeysymToString,(KeySym a),(a),return)
-SDL_X11_SYM(int,XInstallColormap,(Display* a,Colormap b),(a,b),return)
-SDL_X11_SYM(Atom,XInternAtom,(Display* a,_Xconst char* b,Bool c),(a,b,c),return)
-SDL_X11_SYM(XPixmapFormatValues*,XListPixmapFormats,(Display* a,int* b),(a,b),return)
-SDL_X11_SYM(XFontStruct*,XLoadQueryFont,(Display* a,_Xconst char* b),(a,b),return)
-SDL_X11_SYM(KeySym,XLookupKeysym,(XKeyEvent* a,int b),(a,b),return)
-SDL_X11_SYM(int,XLookupString,(XKeyEvent* a,char* b,int c,KeySym* d,XComposeStatus* e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,XMapRaised,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(Status,XMatchVisualInfo,(Display* a,int b,int c,int d,XVisualInfo* e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,XMissingExtension,(Display* a,_Xconst char* b),(a,b),return)
-SDL_X11_SYM(int,XMoveWindow,(Display* a,Window b,int c,int d),(a,b,c,d),return)
-SDL_X11_SYM(int,XNextEvent,(Display* a,XEvent* b),(a,b),return)
-SDL_X11_SYM(Display*,XOpenDisplay,(_Xconst char* a),(a),return)
-SDL_X11_SYM(Status,XInitThreads,(void),(),return)
-SDL_X11_SYM(int,XPeekEvent,(Display* a,XEvent* b),(a,b),return)
-SDL_X11_SYM(int,XPending,(Display* a),(a),return)
-SDL_X11_SYM(int,XPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j),(a,b,c,d,e,f,g,h,i,j),return)
-SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
-SDL_X11_SYM(Bool,XQueryPointer,(Display* a,Window b,Window* c,Window* d,int* e,int* f,int* g,int* h,unsigned int* i),(a,b,c,d,e,f,g,h,i),return)
-SDL_X11_SYM(int,XRaiseWindow,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(int,XReparentWindow,(Display* a,Window b,Window c,int d,int e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,XResetScreenSaver,(Display* a),(a),return)
-SDL_X11_SYM(int,XResizeWindow,(Display* a,Window b,unsigned int c,unsigned int d),(a,b,c,d),return)
-SDL_X11_SYM(int,XSelectInput,(Display* a,Window b,long c),(a,b,c),return)
-SDL_X11_SYM(Status,XSendEvent,(Display* a,Window b,Bool c,long d,XEvent* e),(a,b,c,d,e),return)
-SDL_X11_SYM(XErrorHandler,XSetErrorHandler,(XErrorHandler a),(a),return)
-SDL_X11_SYM(int,XSetForeground,(Display* a,GC b,unsigned long c),(a,b,c),return)
-SDL_X11_SYM(XIOErrorHandler,XSetIOErrorHandler,(XIOErrorHandler a),(a),return)
-SDL_X11_SYM(int,XSetInputFocus,(Display *a,Window b,int c,Time d),(a,b,c,d),return)
-SDL_X11_SYM(int,XSetSelectionOwner,(Display* a,Atom b,Window c,Time d),(a,b,c,d),return)
-SDL_X11_SYM(int,XSetTransientForHint,(Display* a,Window b,Window c),(a,b,c),return)
-SDL_X11_SYM(void,XSetTextProperty,(Display* a,Window b,XTextProperty* c,Atom d),(a,b,c,d),)
-SDL_X11_SYM(int,XSetWindowBackground,(Display* a,Window b,unsigned long c),(a,b,c),return)
-SDL_X11_SYM(void,XSetWMProperties,(Display* a,Window b,XTextProperty* c,XTextProperty* d,char** e,int f,XSizeHints* g,XWMHints* h,XClassHint* i),(a,b,c,d,e,f,g,h,i),)
-SDL_X11_SYM(void,XSetWMNormalHints,(Display* a,Window b,XSizeHints* c),(a,b,c),)
-SDL_X11_SYM(Status,XSetWMProtocols,(Display* a,Window b,Atom* c,int d),(a,b,c,d),return)
-SDL_X11_SYM(int,XStoreColors,(Display* a,Colormap b,XColor* c,int d),(a,b,c,d),return)
-SDL_X11_SYM(int,XStoreName,(Display* a,Window b,_Xconst char* c),(a,b,c),return)
-SDL_X11_SYM(Status,XStringListToTextProperty,(char** a,int b,XTextProperty* c),(a,b,c),return)
-SDL_X11_SYM(int,XSync,(Display* a,Bool b),(a,b),return)
-SDL_X11_SYM(int,XTextExtents,(XFontStruct* a,_Xconst char* b,int c,int* d,int* e,int* f,XCharStruct* g),(a,b,c,d,e,f,g),return)
-SDL_X11_SYM(Bool,XTranslateCoordinates,(Display *a,Window b,Window c,int d,int e,int* f,int* g,Window* h),(a,b,c,d,e,f,g,h),return)
-SDL_X11_SYM(int,XUndefineCursor,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(int,XUngrabKeyboard,(Display* a,Time b),(a,b),return)
-SDL_X11_SYM(int,XUngrabPointer,(Display* a,Time b),(a,b),return)
-SDL_X11_SYM(int,XUngrabServer,(Display* a),(a),return)
-SDL_X11_SYM(int,XUninstallColormap,(Display* a,Colormap b),(a,b),return)
-SDL_X11_SYM(int,XUnloadFont,(Display* a,Font b),(a,b),return)
-SDL_X11_SYM(int,XWarpPointer,(Display* a,Window b,Window c,int d,int e,unsigned int f,unsigned int g,int h,int i),(a,b,c,d,e,f,g,h,i),return)
-SDL_X11_SYM(int,XWindowEvent,(Display* a,Window b,long c,XEvent* d),(a,b,c,d),return)
-SDL_X11_SYM(Status,XWithdrawWindow,(Display* a,Window b,int c),(a,b,c),return)
-SDL_X11_SYM(VisualID,XVisualIDFromVisual,(Visual* a),(a),return)
-#if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY
-SDL_X11_SYM(XExtDisplayInfo*,XextAddDisplay,(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f),(a,b,c,d,e,f),return)
-#else
-SDL_X11_SYM(XExtDisplayInfo*,XextAddDisplay,(XExtensionInfo* a,Display* b,char* c,XExtensionHooks* d,int e,XPointer f),(a,b,c,d,e,f),return)
-#endif
-SDL_X11_SYM(XExtensionInfo*,XextCreateExtension,(void),(),return)
-SDL_X11_SYM(void,XextDestroyExtension,(XExtensionInfo* a),(a),)
-SDL_X11_SYM(XExtDisplayInfo*,XextFindDisplay,(XExtensionInfo* a,Display* b),(a,b),return)
-SDL_X11_SYM(int,XextRemoveDisplay,(XExtensionInfo* a,Display* b),(a,b),return)
-SDL_X11_SYM(Bool,XQueryExtension,(Display* a,_Xconst char* b,int* c,int* d,int* e),(a,b,c,d,e),return)
-SDL_X11_SYM(char *,XDisplayString,(Display* a),(a),return)
-SDL_X11_SYM(int,XGetErrorText,(Display* a,int b,char* c,int d),(a,b,c,d),return)
-SDL_X11_SYM(void,_XEatData,(Display* a,unsigned long b),(a,b),)
-SDL_X11_SYM(void,_XFlush,(Display* a),(a),)
-SDL_X11_SYM(void,_XFlushGCCache,(Display* a,GC b),(a,b),)
-SDL_X11_SYM(int,_XRead,(Display* a,char* b,long c),(a,b,c),return)
-SDL_X11_SYM(void,_XReadPad,(Display* a,char* b,long c),(a,b,c),)
-SDL_X11_SYM(void,_XSend,(Display* a,_Xconst char* b,long c),(a,b,c),)
-SDL_X11_SYM(Status,_XReply,(Display* a,xReply* b,int c,Bool d),(a,b,c,d),return)
-SDL_X11_SYM(unsigned long,_XSetLastRequestRead,(Display* a,xGenericReply* b),(a,b),return)
-SDL_X11_SYM(SDL_X11_XSynchronizeRetType,XSynchronize,(Display* a,Bool b),(a,b),return)
-SDL_X11_SYM(SDL_X11_XESetWireToEventRetType,XESetWireToEvent,(Display* a,int b,SDL_X11_XESetWireToEventRetType c),(a,b,c),return)
-SDL_X11_SYM(SDL_X11_XESetEventToWireRetType,XESetEventToWire,(Display* a,int b,SDL_X11_XESetEventToWireRetType c),(a,b,c),return)
-
-#if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
-SDL_X11_SYM(Bool,XGetEventData,(Display* a,XGenericEventCookie* b),(a,b),return)
-SDL_X11_SYM(void,XFreeEventData,(Display* a,XGenericEventCookie* b),(a,b),)    
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
-#if NeedWidePrototypes
-SDL_X11_SYM(KeySym,XkbKeycodeToKeysym,(Display* a,unsigned int b,int c,int d),(a,b,c,d),return)
-#else
-SDL_X11_SYM(KeySym,XkbKeycodeToKeysym,(Display* a,KeyCode b,int c,int d),(a,b,c,d),return)
-#endif
-#endif
-
-#if NeedWidePrototypes
-SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),return)
-#else
-SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,KeyCode b,int c),(a,b,c),return)
-#endif
-
-#ifdef X_HAVE_UTF8_STRING
-SDL_X11_MODULE(UTF8)
-SDL_X11_SYM(int,Xutf8TextListToTextProperty,(Display* a,char** b,int c,XICCEncodingStyle d,XTextProperty* e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,Xutf8LookupString,(XIC a,XKeyPressedEvent* b,char* c,int d,KeySym* e,Status* f),(a,b,c,d,e,f),return)
-/* SDL_X11_SYM(XIC,XCreateIC,(XIM, ...),return)  !!! ARGH! */
-SDL_X11_SYM(void,XDestroyIC,(XIC a),(a),)
-/* SDL_X11_SYM(char*,XGetICValues,(XIC, ...),return)  !!! ARGH! */
-SDL_X11_SYM(void,XSetICFocus,(XIC a),(a),)
-SDL_X11_SYM(void,XUnsetICFocus,(XIC a),(a),)
-SDL_X11_SYM(XIM,XOpenIM,(Display* a,struct _XrmHashBucketRec* b,char* c,char* d),(a,b,c,d),return)
-SDL_X11_SYM(Status,XCloseIM,(XIM a),(a),return)
-SDL_X11_SYM(void,Xutf8DrawString,(Display *a, Drawable b, XFontSet c, GC d, int e, int f, _Xconst char *g, int h),(a,b,c,d,e,f,g,h),)
-SDL_X11_SYM(int,Xutf8TextExtents,(XFontSet a, _Xconst char*	b, int c, XRectangle* d, XRectangle* e),(a,b,c,d,e),return)
-#endif
-
-#ifndef NO_SHARED_MEMORY
-SDL_X11_MODULE(SHM)
-SDL_X11_SYM(Status,XShmAttach,(Display* a,XShmSegmentInfo* b),(a,b),return)
-SDL_X11_SYM(Status,XShmDetach,(Display* a,XShmSegmentInfo* b),(a,b),return)
-SDL_X11_SYM(Status,XShmPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j,Bool k),(a,b,c,d,e,f,g,h,i,j,k),return)
-SDL_X11_SYM(XImage*,XShmCreateImage,(Display* a,Visual* b,unsigned int c,int d,char* e,XShmSegmentInfo* f,unsigned int g,unsigned int h),(a,b,c,d,e,f,g,h),return)
-SDL_X11_SYM(Pixmap,XShmCreatePixmap,(Display *a,Drawable b,char* c,XShmSegmentInfo* d, unsigned int e, unsigned int f, unsigned int g),(a,b,c,d,e,f,g),return)
-SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return)
-#endif
-
-/*
- * Not required...these only exist in code in headers on some 64-bit platforms,
- *  and are removed via macros elsewhere, so it's safe for them to be missing.
- */
-#ifdef LONG64
-SDL_X11_MODULE(IO_32BIT)
-#if SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32
-SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
-#else
-SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
-#endif
-SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
-#endif
-
-/*
- * These only show up on some variants of Unix.
- */
-#if defined(__osf__)
-SDL_X11_MODULE(OSF_ENTRY_POINTS)
-SDL_X11_SYM(void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr p),(dpy,p),)
-SDL_X11_SYM(void,_SmtIpError,(Display *dpy,register smtDisplayPtr p,int i),(dpy,p,i),)
-SDL_X11_SYM(int,ipAllocateData,(ChannelPtr a,IPCard b,IPDataPtr * c),(a,b,c),return)
-SDL_X11_SYM(int,ipUnallocateAndSendData,(ChannelPtr a,IPCard b),(a,b),return)
-#endif
-
-/* XCursor support */
-#if SDL_VIDEO_DRIVER_X11_XCURSOR
-SDL_X11_MODULE(XCURSOR)
-SDL_X11_SYM(XcursorImage*,XcursorImageCreate,(int a,int b),(a,b),return)
-SDL_X11_SYM(void,XcursorImageDestroy,(XcursorImage *a),(a),)
-SDL_X11_SYM(Cursor,XcursorImageLoadCursor,(Display *a,const XcursorImage *b),(a,b),return)
-#endif
-
-/* Xinerama support */
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-SDL_X11_MODULE(XINERAMA)
-SDL_X11_SYM(Bool,XineramaIsActive,(Display *a),(a),return)
-SDL_X11_SYM(Bool,XineramaQueryExtension,(Display *a,int *b,int *c),(a,b,c),return)
-SDL_X11_SYM(Status,XineramaQueryVersion,(Display *a,int *b,int *c),(a,b,c),return)
-SDL_X11_SYM(XineramaScreenInfo*,XineramaQueryScreens,(Display *a, int *b),(a,b),return)
-#endif
-
-/* XInput2 support for multiple mice, tablets, etc. */
-#if SDL_VIDEO_DRIVER_X11_XINPUT2
-SDL_X11_MODULE(XINPUT2)
-SDL_X11_SYM(XIDeviceInfo*,XIQueryDevice,(Display *a,int b,int *c),(a,b,c),return)
-SDL_X11_SYM(void,XIFreeDeviceInfo,(XIDeviceInfo *a),(a),)
-SDL_X11_SYM(int,XISelectEvents,(Display *a,Window b,XIEventMask *c,int d),(a,b,c,d),return)
-SDL_X11_SYM(Status,XIQueryVersion,(Display *a,int *b,int *c),(a,b,c),return)
-SDL_X11_SYM(XIEventMask*,XIGetSelectedEvents,(Display *a,Window b,int *c),(a,b,c),return)
-#endif
-
-/* XRandR support */
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-SDL_X11_MODULE(XRANDR)
-SDL_X11_SYM(Status,XRRQueryVersion,(Display *dpy,int *major_versionp,int *minor_versionp),(dpy,major_versionp,minor_versionp),return)
-SDL_X11_SYM(XRRScreenConfiguration *,XRRGetScreenInfo,(Display *dpy,Drawable draw),(dpy,draw),return)
-SDL_X11_SYM(SizeID,XRRConfigCurrentConfiguration,(XRRScreenConfiguration *config,Rotation *rotation),(config,rotation),return)
-SDL_X11_SYM(short,XRRConfigCurrentRate,(XRRScreenConfiguration *config),(config),return)
-SDL_X11_SYM(short *,XRRConfigRates,(XRRScreenConfiguration *config,int sizeID,int *nrates),(config,sizeID,nrates),return)
-SDL_X11_SYM(XRRScreenSize *,XRRConfigSizes,(XRRScreenConfiguration *config,int *nsizes),(config,nsizes),return)
-SDL_X11_SYM(Status,XRRSetScreenConfigAndRate,(Display *dpy,XRRScreenConfiguration *config,Drawable draw,int size_index,Rotation rotation,short rate,Time timestamp),(dpy,config,draw,size_index,rotation,rate,timestamp),return)
-SDL_X11_SYM(void,XRRFreeScreenConfigInfo,(XRRScreenConfiguration *config),(config),)
-SDL_X11_SYM(void,XRRSetScreenSize,(Display *dpy, Window window,int width, int height,int mmWidth, int mmHeight),(dpy,window,width,height,mmWidth,mmHeight),)
-SDL_X11_SYM(Status,XRRGetScreenSizeRange,(Display *dpy, Window window,int *minWidth, int *minHeight, int *maxWidth, int *maxHeight),(dpy,window,minWidth,minHeight,maxWidth,maxHeight),return)
-SDL_X11_SYM(XRRScreenResources *,XRRGetScreenResources,(Display *dpy, Window window),(dpy, window),return)
-SDL_X11_SYM(void,XRRFreeScreenResources,(XRRScreenResources *resources),(resources),)
-SDL_X11_SYM(XRROutputInfo *,XRRGetOutputInfo,(Display *dpy, XRRScreenResources *resources, RROutput output),(dpy,resources,output),return)
-SDL_X11_SYM(void,XRRFreeOutputInfo,(XRROutputInfo *outputInfo),(outputInfo),)
-SDL_X11_SYM(XRRCrtcInfo *,XRRGetCrtcInfo,(Display *dpy, XRRScreenResources *resources, RRCrtc crtc),(dpy,resources,crtc),return)
-SDL_X11_SYM(void,XRRFreeCrtcInfo,(XRRCrtcInfo *crtcInfo),(crtcInfo),)
-SDL_X11_SYM(Status,XRRSetCrtcConfig,(Display *dpy, XRRScreenResources *resources, RRCrtc crtc, Time timestamp, int x, int y, RRMode mode, Rotation rotation, RROutput *outputs, int noutputs),(dpy,resources,crtc,timestamp,x,y,mode,rotation,outputs,noutputs),return)
-SDL_X11_SYM(Atom*,XRRListOutputProperties,(Display *dpy, RROutput output, int *nprop),(dpy,output,nprop),return)
-SDL_X11_SYM(XRRPropertyInfo*,XRRQueryOutputProperty,(Display *dpy,RROutput output, Atom property),(dpy,output,property),return)
-SDL_X11_SYM(int,XRRGetOutputProperty,(Display *dpy,RROutput output, Atom property, long offset, long length, Bool _delete, Bool pending, Atom req_type, Atom *actual_type, int *actual_format, unsigned long *nitems, unsigned long *bytes_after, unsigned char **prop),(dpy,output,property,offset,length, _delete, pending, req_type, actual_type, actual_format, nitems, bytes_after, prop),return)
-#endif
-
-/* MIT-SCREEN-SAVER support */
-#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER
-SDL_X11_MODULE(XSS)
-SDL_X11_SYM(Bool,XScreenSaverQueryExtension,(Display *dpy,int *event_base,int *error_base),(dpy,event_base,error_base),return)
-SDL_X11_SYM(Status,XScreenSaverQueryVersion,(Display *dpy,int *major_versionp,int *minor_versionp),(dpy,major_versionp,minor_versionp),return)
-SDL_X11_SYM(void,XScreenSaverSuspend,(Display *dpy,Bool suspend),(dpy,suspend),return)
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XSHAPE
-SDL_X11_MODULE(XSHAPE)
-SDL_X11_SYM(void,XShapeCombineMask,(Display *dpy,Window dest,int dest_kind,int x_off,int y_off,Pixmap src,int op),(dpy,dest,dest_kind,x_off,y_off,src,op),)
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-SDL_X11_MODULE(XVIDMODE)
-SDL_X11_SYM(Bool,XF86VidModeGetAllModeLines,(Display *a,int b,int *c,XF86VidModeModeInfo ***d),(a,b,c,d),return)
-SDL_X11_SYM(Bool,XF86VidModeGetModeLine,(Display *a,int b,int *c,XF86VidModeModeLine *d),(a,b,c,d),return)
-SDL_X11_SYM(Bool,XF86VidModeGetViewPort,(Display *a,int b,int *c,int *d),(a,b,c,d),return)
-SDL_X11_SYM(Bool,XF86VidModeQueryExtension,(Display *a,int *b,int *c),(a,b,c),return)
-SDL_X11_SYM(Bool,XF86VidModeQueryVersion,(Display *a,int *b,int *c),(a,b,c),return)
-SDL_X11_SYM(Bool,XF86VidModeSwitchToMode,(Display *a,int b,XF86VidModeModeInfo *c),(a,b,c),return)
-SDL_X11_SYM(Bool,XF86VidModeLockModeSwitch,(Display *a,int b,int c),(a,b,c),return)
-#endif
-
-/* *INDENT-ON* */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11touch.c b/deps/SDL2/src/video/x11/SDL_x11touch.c
deleted file mode 100644
index a6ce981..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11touch.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include "SDL_x11video.h"
-#include "SDL_x11touch.h"
-#include "SDL_x11xinput2.h"
-#include "../../events/SDL_touch_c.h"
-
-
-void
-X11_InitTouch(_THIS)
-{
-    if (X11_Xinput2IsMultitouchSupported()) {
-        X11_InitXinput2Multitouch(_this);
-    }
-}
-
-void
-X11_QuitTouch(_THIS)
-{
-    SDL_TouchQuit();
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11touch.h b/deps/SDL2/src/video/x11/SDL_x11touch.h
deleted file mode 100644
index ac451a8..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11touch.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11touch_h
-#define _SDL_x11touch_h
-
-extern void X11_InitTouch(_THIS);
-extern void X11_QuitTouch(_THIS);
-
-#endif /* _SDL_x11touch_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11video.c b/deps/SDL2/src/video/x11/SDL_x11video.c
deleted file mode 100644
index c84d4ec..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11video.c
+++ /dev/null
@@ -1,593 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include <unistd.h> /* For getpid() and readlink() */
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-
-#include "SDL_x11video.h"
-#include "SDL_x11framebuffer.h"
-#include "SDL_x11shape.h"
-#include "SDL_x11touch.h"
-#include "SDL_x11xinput2.h"
-
-#if SDL_VIDEO_OPENGL_EGL
-#include "SDL_x11opengles.h"
-#endif
-
-/* !!! FIXME: move dbus stuff to somewhere under src/core/linux ... */
-#if SDL_USE_LIBDBUS
-/* we never link directly to libdbus. */
-#include "SDL_loadso.h"
-static const char *dbus_library = "libdbus-1.so.3";
-static void *dbus_handle = NULL;
-
-/* !!! FIXME: this is kinda ugly. */
-static SDL_bool
-load_dbus_sym(const char *fn, void **addr)
-{
-    *addr = SDL_LoadFunction(dbus_handle, fn);
-    if (*addr == NULL) {
-        /* Don't call SDL_SetError(): SDL_LoadFunction already did. */
-        return SDL_FALSE;
-    }
-
-    return SDL_TRUE;
-}
-
-/* libdbus entry points... */
-static DBusConnection *(*DBUS_dbus_bus_get_private)(DBusBusType, DBusError *) = NULL;
-static void (*DBUS_dbus_connection_set_exit_on_disconnect)(DBusConnection *, dbus_bool_t) = NULL;
-static dbus_bool_t (*DBUS_dbus_connection_send)(DBusConnection *, DBusMessage *, dbus_uint32_t *) = NULL;
-static void (*DBUS_dbus_connection_close)(DBusConnection *) = NULL;
-static void (*DBUS_dbus_connection_unref)(DBusConnection *) = NULL;
-static void (*DBUS_dbus_connection_flush)(DBusConnection *) = NULL;
-static DBusMessage *(*DBUS_dbus_message_new_method_call)(const char *, const char *, const char *, const char *) = NULL;
-static void (*DBUS_dbus_message_unref)(DBusMessage *) = NULL;
-static void (*DBUS_dbus_error_init)(DBusError *) = NULL;
-static dbus_bool_t (*DBUS_dbus_error_is_set)(const DBusError *) = NULL;
-static void (*DBUS_dbus_error_free)(DBusError *) = NULL;
-
-static int
-load_dbus_syms(void)
-{
-    /* cast funcs to char* first, to please GCC's strict aliasing rules. */
-    #define SDL_DBUS_SYM(x) \
-        if (!load_dbus_sym(#x, (void **) (char *) &DBUS_##x)) return -1
-
-    SDL_DBUS_SYM(dbus_bus_get_private);
-    SDL_DBUS_SYM(dbus_connection_set_exit_on_disconnect);
-    SDL_DBUS_SYM(dbus_connection_send);
-    SDL_DBUS_SYM(dbus_connection_close);
-    SDL_DBUS_SYM(dbus_connection_unref);
-    SDL_DBUS_SYM(dbus_connection_flush);
-    SDL_DBUS_SYM(dbus_message_new_method_call);
-    SDL_DBUS_SYM(dbus_message_unref);
-    SDL_DBUS_SYM(dbus_error_init);
-    SDL_DBUS_SYM(dbus_error_is_set);
-    SDL_DBUS_SYM(dbus_error_free);
-
-    #undef SDL_DBUS_SYM
-
-    return 0;
-}
-
-static void
-UnloadDBUSLibrary(void)
-{
-    if (dbus_handle != NULL) {
-        SDL_UnloadObject(dbus_handle);
-        dbus_handle = NULL;
-    }
-}
-
-static int
-LoadDBUSLibrary(void)
-{
-    int retval = 0;
-    if (dbus_handle == NULL) {
-        dbus_handle = SDL_LoadObject(dbus_library);
-        if (dbus_handle == NULL) {
-            retval = -1;
-            /* Don't call SDL_SetError(): SDL_LoadObject already did. */
-        } else {
-            retval = load_dbus_syms();
-            if (retval < 0) {
-                UnloadDBUSLibrary();
-            }
-        }
-    }
-
-    return retval;
-}
-
-static void
-X11_InitDBus(_THIS)
-{
-    if (LoadDBUSLibrary() != -1) {
-        SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-        DBusError err;
-        DBUS_dbus_error_init(&err);
-        data->dbus = DBUS_dbus_bus_get_private(DBUS_BUS_SESSION, &err);
-        if (DBUS_dbus_error_is_set(&err)) {
-            DBUS_dbus_error_free(&err);
-            if (data->dbus) {
-                DBUS_dbus_connection_unref(data->dbus);
-                data->dbus = NULL;
-            }
-            return;  /* oh well */
-        }
-        DBUS_dbus_connection_set_exit_on_disconnect(data->dbus, 0);
-    }
-}
-
-static void
-X11_QuitDBus(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    if (data->dbus) {
-        DBUS_dbus_connection_close(data->dbus);
-        DBUS_dbus_connection_unref(data->dbus);
-        data->dbus = NULL;
-    }
-}
-
-void
-SDL_dbus_screensaver_tickle(_THIS)
-{
-    const SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    DBusConnection *conn = data->dbus;
-    if (conn != NULL) {
-        DBusMessage *msg = DBUS_dbus_message_new_method_call("org.gnome.ScreenSaver",
-                                                             "/org/gnome/ScreenSaver",
-                                                             "org.gnome.ScreenSaver",
-                                                             "SimulateUserActivity");
-        if (msg != NULL) {
-            if (DBUS_dbus_connection_send(conn, msg, NULL)) {
-                DBUS_dbus_connection_flush(conn);
-            }
-            DBUS_dbus_message_unref(msg);
-        }
-    }
-}
-#endif
-
-/* Initialization/Query functions */
-static int X11_VideoInit(_THIS);
-static void X11_VideoQuit(_THIS);
-
-/* Find out what class name we should use */
-static char *
-get_classname()
-{
-    char *spot;
-#if defined(__LINUX__) || defined(__FREEBSD__)
-    char procfile[1024];
-    char linkfile[1024];
-    int linksize;
-#endif
-
-    /* First allow environment variable override */
-    spot = SDL_getenv("SDL_VIDEO_X11_WMCLASS");
-    if (spot) {
-        return SDL_strdup(spot);
-    }
-
-    /* Next look at the application's executable name */
-#if defined(__LINUX__) || defined(__FREEBSD__)
-#if defined(__LINUX__)
-    SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid());
-#elif defined(__FREEBSD__)
-    SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file",
-                 getpid());
-#else
-#error Where can we find the executable name?
-#endif
-    linksize = readlink(procfile, linkfile, sizeof(linkfile) - 1);
-    if (linksize > 0) {
-        linkfile[linksize] = '\0';
-        spot = SDL_strrchr(linkfile, '/');
-        if (spot) {
-            return SDL_strdup(spot + 1);
-        } else {
-            return SDL_strdup(linkfile);
-        }
-    }
-#endif /* __LINUX__ || __FREEBSD__ */
-
-    /* Finally use the default we've used forever */
-    return SDL_strdup("SDL_App");
-}
-
-/* X11 driver bootstrap functions */
-
-static int
-X11_Available(void)
-{
-    Display *display = NULL;
-    if (SDL_X11_LoadSymbols()) {
-        display = X11_XOpenDisplay(NULL);
-        if (display != NULL) {
-            X11_XCloseDisplay(display);
-        }
-        SDL_X11_UnloadSymbols();
-    }
-    return (display != NULL);
-}
-
-static void
-X11_DeleteDevice(SDL_VideoDevice * device)
-{
-    SDL_VideoData *data = (SDL_VideoData *) device->driverdata;
-    if (data->display) {
-        X11_XCloseDisplay(data->display);
-    }
-    SDL_free(data->windowlist);
-    SDL_free(device->driverdata);
-    SDL_free(device);
-
-    SDL_X11_UnloadSymbols();
-}
-
-/* An error handler to reset the vidmode and then call the default handler. */
-static SDL_bool safety_net_triggered = SDL_FALSE;
-static int (*orig_x11_errhandler) (Display *, XErrorEvent *) = NULL;
-static int
-X11_SafetyNetErrHandler(Display * d, XErrorEvent * e)
-{
-    SDL_VideoDevice *device = NULL;
-    /* if we trigger an error in our error handler, don't try again. */
-    if (!safety_net_triggered) {
-        safety_net_triggered = SDL_TRUE;
-        device = SDL_GetVideoDevice();
-        if (device != NULL) {
-            int i;
-            for (i = 0; i < device->num_displays; i++) {
-                SDL_VideoDisplay *display = &device->displays[i];
-                if (SDL_memcmp(&display->current_mode, &display->desktop_mode,
-                               sizeof (SDL_DisplayMode)) != 0) {
-                    X11_SetDisplayMode(device, display, &display->desktop_mode);
-                }
-            }
-        }
-    }
-
-    if (orig_x11_errhandler != NULL) {
-        return orig_x11_errhandler(d, e);  /* probably terminate. */
-    }
-
-    return 0;
-}
-
-static SDL_VideoDevice *
-X11_CreateDevice(int devindex)
-{
-    SDL_VideoDevice *device;
-    SDL_VideoData *data;
-    const char *display = NULL; /* Use the DISPLAY environment variable */
-
-    if (!SDL_X11_LoadSymbols()) {
-        return NULL;
-    }
-
-    /* Need for threading gl calls. This is also required for the proprietary
-        nVidia driver to be threaded. */
-    X11_XInitThreads();
-
-    /* Initialize all variables that we clean on shutdown */
-    device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
-    if (!device) {
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
-    if (!data) {
-        SDL_free(device);
-        SDL_OutOfMemory();
-        return NULL;
-    }
-    device->driverdata = data;
-
-    /* FIXME: Do we need this?
-       if ( (SDL_strncmp(X11_XDisplayName(display), ":", 1) == 0) ||
-       (SDL_strncmp(X11_XDisplayName(display), "unix:", 5) == 0) ) {
-       local_X11 = 1;
-       } else {
-       local_X11 = 0;
-       }
-     */
-    data->display = X11_XOpenDisplay(display);
-#if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC)
-    /* On Tru64 if linking without -lX11, it fails and you get following message.
-     * Xlib: connection to ":0.0" refused by server
-     * Xlib: XDM authorization key matches an existing client!
-     *
-     * It succeeds if retrying 1 second later
-     * or if running xhost +localhost on shell.
-     */
-    if (data->display == NULL) {
-        SDL_Delay(1000);
-        data->display = X11_XOpenDisplay(display);
-    }
-#endif
-    if (data->display == NULL) {
-        SDL_free(device->driverdata);
-        SDL_free(device);
-        SDL_SetError("Couldn't open X11 display");
-        return NULL;
-    }
-#ifdef X11_DEBUG
-    X11_XSynchronize(data->display, True);
-#endif
-
-    /* Hook up an X11 error handler to recover the desktop resolution. */
-    safety_net_triggered = SDL_FALSE;
-    orig_x11_errhandler = X11_XSetErrorHandler(X11_SafetyNetErrHandler);
-
-    /* Set the function pointers */
-    device->VideoInit = X11_VideoInit;
-    device->VideoQuit = X11_VideoQuit;
-    device->GetDisplayModes = X11_GetDisplayModes;
-    device->GetDisplayBounds = X11_GetDisplayBounds;
-    device->SetDisplayMode = X11_SetDisplayMode;
-    device->SuspendScreenSaver = X11_SuspendScreenSaver;
-    device->PumpEvents = X11_PumpEvents;
-
-    device->CreateWindow = X11_CreateWindow;
-    device->CreateWindowFrom = X11_CreateWindowFrom;
-    device->SetWindowTitle = X11_SetWindowTitle;
-    device->SetWindowIcon = X11_SetWindowIcon;
-    device->SetWindowPosition = X11_SetWindowPosition;
-    device->SetWindowSize = X11_SetWindowSize;
-    device->SetWindowMinimumSize = X11_SetWindowMinimumSize;
-    device->SetWindowMaximumSize = X11_SetWindowMaximumSize;
-    device->ShowWindow = X11_ShowWindow;
-    device->HideWindow = X11_HideWindow;
-    device->RaiseWindow = X11_RaiseWindow;
-    device->MaximizeWindow = X11_MaximizeWindow;
-    device->MinimizeWindow = X11_MinimizeWindow;
-    device->RestoreWindow = X11_RestoreWindow;
-    device->SetWindowBordered = X11_SetWindowBordered;
-    device->SetWindowFullscreen = X11_SetWindowFullscreen;
-    device->SetWindowGammaRamp = X11_SetWindowGammaRamp;
-    device->SetWindowGrab = X11_SetWindowGrab;
-    device->DestroyWindow = X11_DestroyWindow;
-    device->CreateWindowFramebuffer = X11_CreateWindowFramebuffer;
-    device->UpdateWindowFramebuffer = X11_UpdateWindowFramebuffer;
-    device->DestroyWindowFramebuffer = X11_DestroyWindowFramebuffer;
-    device->GetWindowWMInfo = X11_GetWindowWMInfo;
-
-    device->shape_driver.CreateShaper = X11_CreateShaper;
-    device->shape_driver.SetWindowShape = X11_SetWindowShape;
-    device->shape_driver.ResizeWindowShape = X11_ResizeWindowShape;
-
-#if SDL_VIDEO_OPENGL_GLX
-    device->GL_LoadLibrary = X11_GL_LoadLibrary;
-    device->GL_GetProcAddress = X11_GL_GetProcAddress;
-    device->GL_UnloadLibrary = X11_GL_UnloadLibrary;
-    device->GL_CreateContext = X11_GL_CreateContext;
-    device->GL_MakeCurrent = X11_GL_MakeCurrent;
-    device->GL_SetSwapInterval = X11_GL_SetSwapInterval;
-    device->GL_GetSwapInterval = X11_GL_GetSwapInterval;
-    device->GL_SwapWindow = X11_GL_SwapWindow;
-    device->GL_DeleteContext = X11_GL_DeleteContext;
-#elif SDL_VIDEO_OPENGL_EGL
-    device->GL_LoadLibrary = X11_GLES_LoadLibrary;
-    device->GL_GetProcAddress = X11_GLES_GetProcAddress;
-    device->GL_UnloadLibrary = X11_GLES_UnloadLibrary;
-    device->GL_CreateContext = X11_GLES_CreateContext;
-    device->GL_MakeCurrent = X11_GLES_MakeCurrent;
-    device->GL_SetSwapInterval = X11_GLES_SetSwapInterval;
-    device->GL_GetSwapInterval = X11_GLES_GetSwapInterval;
-    device->GL_SwapWindow = X11_GLES_SwapWindow;
-    device->GL_DeleteContext = X11_GLES_DeleteContext;
-#endif
-
-    device->SetClipboardText = X11_SetClipboardText;
-    device->GetClipboardText = X11_GetClipboardText;
-    device->HasClipboardText = X11_HasClipboardText;
-
-    device->free = X11_DeleteDevice;
-
-    return device;
-}
-
-VideoBootStrap X11_bootstrap = {
-    "x11", "SDL X11 video driver",
-    X11_Available, X11_CreateDevice
-};
-
-static int (*handler) (Display *, XErrorEvent *) = NULL;
-static int
-X11_CheckWindowManagerErrorHandler(Display * d, XErrorEvent * e)
-{
-    if (e->error_code == BadWindow) {
-        return (0);
-    } else {
-        return (handler(d, e));
-    }
-}
-
-static void
-X11_CheckWindowManager(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    Display *display = data->display;
-    Atom _NET_SUPPORTING_WM_CHECK;
-    int status, real_format;
-    Atom real_type;
-    unsigned long items_read, items_left;
-    unsigned char *propdata;
-    Window wm_window = 0;
-#ifdef DEBUG_WINDOW_MANAGER
-    char *wm_name;
-#endif
-
-    /* Set up a handler to gracefully catch errors */
-    X11_XSync(display, False);
-    handler = X11_XSetErrorHandler(X11_CheckWindowManagerErrorHandler);
-
-    _NET_SUPPORTING_WM_CHECK = X11_XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False);
-    status = X11_XGetWindowProperty(display, DefaultRootWindow(display), _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
-    if (status == Success && items_read) {
-        wm_window = ((Window*)propdata)[0];
-    }
-    if (propdata) {
-        X11_XFree(propdata);
-    }
-
-    if (wm_window) {
-        status = X11_XGetWindowProperty(display, wm_window, _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
-        if (status != Success || !items_read || wm_window != ((Window*)propdata)[0]) {
-            wm_window = None;
-        }
-        if (propdata) {
-            X11_XFree(propdata);
-        }
-    }
-
-    /* Reset the error handler, we're done checking */
-    X11_XSync(display, False);
-    X11_XSetErrorHandler(handler);
-
-    if (!wm_window) {
-#ifdef DEBUG_WINDOW_MANAGER
-        printf("Couldn't get _NET_SUPPORTING_WM_CHECK property\n");
-#endif
-        return;
-    }
-    data->net_wm = SDL_TRUE;
-
-#ifdef DEBUG_WINDOW_MANAGER
-    wm_name = X11_GetWindowTitle(_this, wm_window);
-    printf("Window manager: %s\n", wm_name);
-    SDL_free(wm_name);
-#endif
-}
-
-
-int
-X11_VideoInit(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    /* Get the window class name, usually the name of the application */
-    data->classname = get_classname();
-
-    /* Get the process PID to be associated to the window */
-    data->pid = getpid();
-
-    /* Open a connection to the X input manager */
-#ifdef X_HAVE_UTF8_STRING
-    if (SDL_X11_HAVE_UTF8) {
-        data->im =
-            X11_XOpenIM(data->display, NULL, data->classname, data->classname);
-    }
-#endif
-
-    /* Look up some useful Atoms */
-#define GET_ATOM(X) data->X = X11_XInternAtom(data->display, #X, False)
-    GET_ATOM(WM_PROTOCOLS);
-    GET_ATOM(WM_DELETE_WINDOW);
-    GET_ATOM(_NET_WM_STATE);
-    GET_ATOM(_NET_WM_STATE_HIDDEN);
-    GET_ATOM(_NET_WM_STATE_FOCUSED);
-    GET_ATOM(_NET_WM_STATE_MAXIMIZED_VERT);
-    GET_ATOM(_NET_WM_STATE_MAXIMIZED_HORZ);
-    GET_ATOM(_NET_WM_STATE_FULLSCREEN);
-    GET_ATOM(_NET_WM_ALLOWED_ACTIONS);
-    GET_ATOM(_NET_WM_ACTION_FULLSCREEN);
-    GET_ATOM(_NET_WM_NAME);
-    GET_ATOM(_NET_WM_ICON_NAME);
-    GET_ATOM(_NET_WM_ICON);
-    GET_ATOM(_NET_WM_PING);
-    GET_ATOM(_NET_ACTIVE_WINDOW);
-    GET_ATOM(UTF8_STRING);
-    GET_ATOM(PRIMARY);
-    GET_ATOM(XdndEnter);
-    GET_ATOM(XdndPosition);
-    GET_ATOM(XdndStatus);
-    GET_ATOM(XdndTypeList);
-    GET_ATOM(XdndActionCopy);
-    GET_ATOM(XdndDrop);
-    GET_ATOM(XdndFinished);
-    GET_ATOM(XdndSelection);
-
-    /* Detect the window manager */
-    X11_CheckWindowManager(_this);
-
-    if (X11_InitModes(_this) < 0) {
-        return -1;
-    }
-
-    X11_InitXinput2(_this);
-
-    if (X11_InitKeyboard(_this) != 0) {
-        return -1;
-    }
-    X11_InitMouse(_this);
-
-    X11_InitTouch(_this);
-
-#if SDL_USE_LIBDBUS
-    X11_InitDBus(_this);
-#endif
-
-    return 0;
-}
-
-void
-X11_VideoQuit(_THIS)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    SDL_free(data->classname);
-#ifdef X_HAVE_UTF8_STRING
-    if (data->im) {
-        X11_XCloseIM(data->im);
-    }
-#endif
-
-    X11_QuitModes(_this);
-    X11_QuitKeyboard(_this);
-    X11_QuitMouse(_this);
-    X11_QuitTouch(_this);
-
-#if SDL_USE_LIBDBUS
-    X11_QuitDBus(_this);
-#endif
-}
-
-SDL_bool
-X11_UseDirectColorVisuals(void)
-{
-    return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vim: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11video.h b/deps/SDL2/src/video/x11/SDL_x11video.h
deleted file mode 100644
index 68a0413..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11video.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11video_h
-#define _SDL_x11video_h
-
-#include "SDL_keycode.h"
-
-#include "../SDL_sysvideo.h"
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-#if SDL_VIDEO_DRIVER_X11_XCURSOR
-#include <X11/Xcursor/Xcursor.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-#include <X11/extensions/Xinerama.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XINPUT2
-#include <X11/extensions/XInput2.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-#include <X11/extensions/Xrandr.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER
-#include <X11/extensions/scrnsaver.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XSHAPE
-#include <X11/extensions/shape.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-#include <X11/extensions/xf86vmode.h>
-#endif
-
-#ifdef HAVE_DBUS_DBUS_H
-#define SDL_USE_LIBDBUS 1
-#include <dbus/dbus.h>
-#endif
-
-#include "SDL_x11dyn.h"
-
-#include "SDL_x11clipboard.h"
-#include "SDL_x11events.h"
-#include "SDL_x11keyboard.h"
-#include "SDL_x11modes.h"
-#include "SDL_x11mouse.h"
-#include "SDL_x11opengl.h"
-#include "SDL_x11window.h"
-
-/* Private display data */
-
-typedef struct SDL_VideoData
-{
-    Display *display;
-    char *classname;
-    pid_t pid;
-    XIM im;
-    Uint32 screensaver_activity;
-    int numwindows;
-    SDL_WindowData **windowlist;
-    int windowlistlength;
-
-    /* This is true for ICCCM2.0-compliant window managers */
-    SDL_bool net_wm;
-
-    /* Useful atoms */
-    Atom WM_PROTOCOLS;
-    Atom WM_DELETE_WINDOW;
-    Atom _NET_WM_STATE;
-    Atom _NET_WM_STATE_HIDDEN;
-    Atom _NET_WM_STATE_FOCUSED;
-    Atom _NET_WM_STATE_MAXIMIZED_VERT;
-    Atom _NET_WM_STATE_MAXIMIZED_HORZ;
-    Atom _NET_WM_STATE_FULLSCREEN;
-    Atom _NET_WM_ALLOWED_ACTIONS;
-    Atom _NET_WM_ACTION_FULLSCREEN;
-    Atom _NET_WM_NAME;
-    Atom _NET_WM_ICON_NAME;
-    Atom _NET_WM_ICON;
-    Atom _NET_WM_PING;
-    Atom _NET_ACTIVE_WINDOW;
-    Atom UTF8_STRING;
-    Atom PRIMARY;
-    Atom XdndEnter;
-    Atom XdndPosition;
-    Atom XdndStatus;
-    Atom XdndTypeList;
-    Atom XdndActionCopy;
-    Atom XdndDrop;
-    Atom XdndFinished;
-    Atom XdndSelection;
-
-    SDL_Scancode key_layout[256];
-    SDL_bool selection_waiting;
-
-#if SDL_USE_LIBDBUS
-    DBusConnection *dbus;
-#endif
-} SDL_VideoData;
-
-extern SDL_bool X11_UseDirectColorVisuals(void);
-
-#endif /* _SDL_x11video_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11window.c b/deps/SDL2/src/video/x11/SDL_x11window.c
deleted file mode 100644
index 62a7e73..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11window.c
+++ /dev/null
@@ -1,1446 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include "SDL_assert.h"
-#include "SDL_hints.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_keyboard_c.h"
-#include "../../events/SDL_mouse_c.h"
-
-#include "SDL_x11video.h"
-#include "SDL_x11mouse.h"
-#include "SDL_x11shape.h"
-#include "SDL_x11xinput2.h"
-
-#if SDL_VIDEO_OPENGL_EGL
-#include "SDL_x11opengles.h"
-#endif
-
-#include "SDL_timer.h"
-#include "SDL_syswm.h"
-#include "SDL_assert.h"
-
-#define _NET_WM_STATE_REMOVE    0l
-#define _NET_WM_STATE_ADD       1l
-#define _NET_WM_STATE_TOGGLE    2l
-
-static Bool isMapNotify(Display *dpy, XEvent *ev, XPointer win)
-{
-    return ev->type == MapNotify && ev->xmap.window == *((Window*)win);
-}
-static Bool isUnmapNotify(Display *dpy, XEvent *ev, XPointer win)
-{
-    return ev->type == UnmapNotify && ev->xunmap.window == *((Window*)win);
-}
-static Bool isConfigureNotify(Display *dpy, XEvent *ev, XPointer win)
-{
-    return ev->type == ConfigureNotify && ev->xconfigure.window == *((Window*)win);
-}
-
-/*
-static Bool
-X11_XIfEventTimeout(Display *display, XEvent *event_return, Bool (*predicate)(), XPointer arg, int timeoutMS)
-{
-    Uint32 start = SDL_GetTicks();
-
-    while (!X11_XCheckIfEvent(display, event_return, predicate, arg)) {
-        if (SDL_TICKS_PASSED(SDL_GetTicks(), start + timeoutMS)) {
-            return False;
-        }
-    }
-    return True;
-}
-*/
-
-static SDL_bool
-X11_IsWindowLegacyFullscreen(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    return (data->fswindow != 0);
-}
-
-static SDL_bool
-X11_IsWindowMapped(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-    XWindowAttributes attr;
-
-    X11_XGetWindowAttributes(videodata->display, data->xwindow, &attr);
-    if (attr.map_state != IsUnmapped) {
-        return SDL_TRUE;
-    } else {
-        return SDL_FALSE;
-    }
-}
-
-#if 0
-static SDL_bool
-X11_IsActionAllowed(SDL_Window *window, Atom action)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Atom _NET_WM_ALLOWED_ACTIONS = data->videodata->_NET_WM_ALLOWED_ACTIONS;
-    Atom type;
-    Display *display = data->videodata->display;
-    int form;
-    unsigned long remain;
-    unsigned long len, i;
-    Atom *list;
-    SDL_bool ret = SDL_FALSE;
-
-    if (X11_XGetWindowProperty(display, data->xwindow, _NET_WM_ALLOWED_ACTIONS, 0, 1024, False, XA_ATOM, &type, &form, &len, &remain, (unsigned char **)&list) == Success)
-    {
-        for (i=0; i<len; ++i)
-        {
-            if (list[i] == action) {
-                ret = SDL_TRUE;
-                break;
-            }
-        }
-        X11_XFree(list);
-    }
-    return ret;
-}
-#endif /* 0 */
-
-void
-X11_SetNetWMState(_THIS, Window xwindow, Uint32 flags)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-    Display *display = videodata->display;
-    Atom _NET_WM_STATE = videodata->_NET_WM_STATE;
-    /* Atom _NET_WM_STATE_HIDDEN = videodata->_NET_WM_STATE_HIDDEN; */
-    Atom _NET_WM_STATE_FOCUSED = videodata->_NET_WM_STATE_FOCUSED;
-    Atom _NET_WM_STATE_MAXIMIZED_VERT = videodata->_NET_WM_STATE_MAXIMIZED_VERT;
-    Atom _NET_WM_STATE_MAXIMIZED_HORZ = videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
-    Atom _NET_WM_STATE_FULLSCREEN = videodata->_NET_WM_STATE_FULLSCREEN;
-    Atom atoms[5];
-    int count = 0;
-
-    /* The window manager sets this property, we shouldn't set it.
-       If we did, this would indicate to the window manager that we don't
-       actually want to be mapped during X11_XMapRaised(), which would be bad.
-     *
-    if (flags & SDL_WINDOW_HIDDEN) {
-        atoms[count++] = _NET_WM_STATE_HIDDEN;
-    }
-    */
-    if (flags & SDL_WINDOW_INPUT_FOCUS) {
-        atoms[count++] = _NET_WM_STATE_FOCUSED;
-    }
-    if (flags & SDL_WINDOW_MAXIMIZED) {
-        atoms[count++] = _NET_WM_STATE_MAXIMIZED_VERT;
-        atoms[count++] = _NET_WM_STATE_MAXIMIZED_HORZ;
-    }
-    if (flags & SDL_WINDOW_FULLSCREEN) {
-        atoms[count++] = _NET_WM_STATE_FULLSCREEN;
-    }
-    if (count > 0) {
-        X11_XChangeProperty(display, xwindow, _NET_WM_STATE, XA_ATOM, 32,
-                        PropModeReplace, (unsigned char *)atoms, count);
-    } else {
-        X11_XDeleteProperty(display, xwindow, _NET_WM_STATE);
-    }
-}
-
-Uint32
-X11_GetNetWMState(_THIS, Window xwindow)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-    Display *display = videodata->display;
-    Atom _NET_WM_STATE = videodata->_NET_WM_STATE;
-    Atom _NET_WM_STATE_HIDDEN = videodata->_NET_WM_STATE_HIDDEN;
-    Atom _NET_WM_STATE_FOCUSED = videodata->_NET_WM_STATE_FOCUSED;
-    Atom _NET_WM_STATE_MAXIMIZED_VERT = videodata->_NET_WM_STATE_MAXIMIZED_VERT;
-    Atom _NET_WM_STATE_MAXIMIZED_HORZ = videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
-    Atom _NET_WM_STATE_FULLSCREEN = videodata->_NET_WM_STATE_FULLSCREEN;
-    Atom actualType;
-    int actualFormat;
-    unsigned long i, numItems, bytesAfter;
-    unsigned char *propertyValue = NULL;
-    long maxLength = 1024;
-    Uint32 flags = 0;
-
-    if (X11_XGetWindowProperty(display, xwindow, _NET_WM_STATE,
-                           0l, maxLength, False, XA_ATOM, &actualType,
-                           &actualFormat, &numItems, &bytesAfter,
-                           &propertyValue) == Success) {
-        Atom *atoms = (Atom *) propertyValue;
-        int maximized = 0;
-        int fullscreen = 0;
-
-        for (i = 0; i < numItems; ++i) {
-            if (atoms[i] == _NET_WM_STATE_HIDDEN) {
-                flags |= SDL_WINDOW_HIDDEN;
-            } else if (atoms[i] == _NET_WM_STATE_FOCUSED) {
-                flags |= SDL_WINDOW_INPUT_FOCUS;
-            } else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_VERT) {
-                maximized |= 1;
-            } else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_HORZ) {
-                maximized |= 2;
-            } else if ( atoms[i] == _NET_WM_STATE_FULLSCREEN) {
-                fullscreen = 1;
-            }
-        }
-        if (maximized == 3) {
-            flags |= SDL_WINDOW_MAXIMIZED;
-        }  else if (fullscreen == 1) {
-            flags |= SDL_WINDOW_FULLSCREEN;
-        }
-        X11_XFree(propertyValue);
-    }
-
-    /* FIXME, check the size hints for resizable */
-    /* flags |= SDL_WINDOW_RESIZABLE; */
-
-    return flags;
-}
-
-static int
-SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created)
-{
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-    SDL_WindowData *data;
-    int numwindows = videodata->numwindows;
-    int windowlistlength = videodata->windowlistlength;
-    SDL_WindowData **windowlist = videodata->windowlist;
-
-    /* Allocate the window data */
-    data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
-    if (!data) {
-        return SDL_OutOfMemory();
-    }
-    data->window = window;
-    data->xwindow = w;
-#ifdef X_HAVE_UTF8_STRING
-    if (SDL_X11_HAVE_UTF8 && videodata->im) {
-        data->ic =
-            X11_XCreateIC(videodata->im, XNClientWindow, w, XNFocusWindow, w,
-                       XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
-                       XNResourceName, videodata->classname, XNResourceClass,
-                       videodata->classname, NULL);
-    }
-#endif
-    data->created = created;
-    data->videodata = videodata;
-
-    /* Associate the data with the window */
-
-    if (numwindows < windowlistlength) {
-        windowlist[numwindows] = data;
-        videodata->numwindows++;
-    } else {
-        windowlist =
-            (SDL_WindowData **) SDL_realloc(windowlist,
-                                            (numwindows +
-                                             1) * sizeof(*windowlist));
-        if (!windowlist) {
-            SDL_free(data);
-            return SDL_OutOfMemory();
-        }
-        windowlist[numwindows] = data;
-        videodata->numwindows++;
-        videodata->windowlistlength++;
-        videodata->windowlist = windowlist;
-    }
-
-    /* Fill in the SDL window with the window data */
-    {
-        XWindowAttributes attrib;
-
-        X11_XGetWindowAttributes(data->videodata->display, w, &attrib);
-        window->x = attrib.x;
-        window->y = attrib.y;
-        window->w = attrib.width;
-        window->h = attrib.height;
-        if (attrib.map_state != IsUnmapped) {
-            window->flags |= SDL_WINDOW_SHOWN;
-        } else {
-            window->flags &= ~SDL_WINDOW_SHOWN;
-        }
-        data->visual = attrib.visual;
-        data->colormap = attrib.colormap;
-    }
-
-    window->flags |= X11_GetNetWMState(_this, w);
-
-    {
-        Window FocalWindow;
-        int RevertTo=0;
-        X11_XGetInputFocus(data->videodata->display, &FocalWindow, &RevertTo);
-        if (FocalWindow==w)
-        {
-            window->flags |= SDL_WINDOW_INPUT_FOCUS;
-        }
-
-        if (window->flags & SDL_WINDOW_INPUT_FOCUS) {
-            SDL_SetKeyboardFocus(data->window);
-        }
-
-        if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
-            /* Tell x11 to clip mouse */
-        }
-    }
-
-    /* All done! */
-    window->driverdata = data;
-    return 0;
-}
-
-static void
-SetWindowBordered(Display *display, int screen, Window window, SDL_bool border)
-{
-    /*
-     * this code used to check for KWM_WIN_DECORATION, but KDE hasn't
-     *  supported it for years and years. It now respects _MOTIF_WM_HINTS.
-     *  Gnome is similar: just use the Motif atom.
-     */
-
-    Atom WM_HINTS = X11_XInternAtom(display, "_MOTIF_WM_HINTS", True);
-    if (WM_HINTS != None) {
-        /* Hints used by Motif compliant window managers */
-        struct
-        {
-            unsigned long flags;
-            unsigned long functions;
-            unsigned long decorations;
-            long input_mode;
-            unsigned long status;
-        } MWMHints = {
-            (1L << 1), 0, border ? 1 : 0, 0, 0
-        };
-
-        X11_XChangeProperty(display, window, WM_HINTS, WM_HINTS, 32,
-                        PropModeReplace, (unsigned char *) &MWMHints,
-                        sizeof(MWMHints) / 4);
-    } else {  /* set the transient hints instead, if necessary */
-        X11_XSetTransientForHint(display, window, RootWindow(display, screen));
-    }
-}
-
-int
-X11_CreateWindow(_THIS, SDL_Window * window)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    SDL_DisplayData *displaydata =
-        (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
-    SDL_WindowData *windowdata;
-    Display *display = data->display;
-    int screen = displaydata->screen;
-    Visual *visual;
-    int depth;
-    XSetWindowAttributes xattr;
-    Window w;
-    XSizeHints *sizehints;
-    XWMHints *wmhints;
-    XClassHint *classhints;
-    const long _NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1;
-    Atom _NET_WM_BYPASS_COMPOSITOR;
-    Atom _NET_WM_WINDOW_TYPE;
-    Atom _NET_WM_WINDOW_TYPE_NORMAL;
-    Atom _NET_WM_PID;
-    Atom XdndAware, xdnd_version = 5;
-    Uint32 fevent = 0;
-
-#if SDL_VIDEO_OPENGL_GLX || SDL_VIDEO_OPENGL_EGL
-    if ((window->flags & SDL_WINDOW_OPENGL) &&
-        !SDL_getenv("SDL_VIDEO_X11_VISUALID")) {
-        XVisualInfo *vinfo = NULL;
-
-#if SDL_VIDEO_OPENGL_EGL
-        if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES 
-#if SDL_VIDEO_OPENGL_GLX            
-            && ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )
-#endif
-        ){
-            vinfo = X11_GLES_GetVisual(_this, display, screen);
-        } else
-#endif
-        {
-#if SDL_VIDEO_OPENGL_GLX
-            vinfo = X11_GL_GetVisual(_this, display, screen);
-#endif
-        }
-
-        if (!vinfo) {
-            return -1;
-        }
-        visual = vinfo->visual;
-        depth = vinfo->depth;
-        X11_XFree(vinfo);
-    } else
-#endif
-    {
-        visual = displaydata->visual;
-        depth = displaydata->depth;
-    }
-
-    xattr.override_redirect = False;
-    xattr.background_pixmap = None;
-    xattr.border_pixel = 0;
-
-    if (visual->class == DirectColor) {
-        XColor *colorcells;
-        int i;
-        int ncolors;
-        int rmax, gmax, bmax;
-        int rmask, gmask, bmask;
-        int rshift, gshift, bshift;
-
-        xattr.colormap =
-            X11_XCreateColormap(display, RootWindow(display, screen),
-                            visual, AllocAll);
-
-        /* If we can't create a colormap, then we must die */
-        if (!xattr.colormap) {
-            return SDL_SetError("Could not create writable colormap");
-        }
-
-        /* OK, we got a colormap, now fill it in as best as we can */
-        colorcells = SDL_malloc(visual->map_entries * sizeof(XColor));
-        if (!colorcells) {
-            return SDL_OutOfMemory();
-        }
-        ncolors = visual->map_entries;
-        rmax = 0xffff;
-        gmax = 0xffff;
-        bmax = 0xffff;
-
-        rshift = 0;
-        rmask = visual->red_mask;
-        while (0 == (rmask & 1)) {
-            rshift++;
-            rmask >>= 1;
-        }
-
-        gshift = 0;
-        gmask = visual->green_mask;
-        while (0 == (gmask & 1)) {
-            gshift++;
-            gmask >>= 1;
-        }
-
-        bshift = 0;
-        bmask = visual->blue_mask;
-        while (0 == (bmask & 1)) {
-            bshift++;
-            bmask >>= 1;
-        }
-
-        /* build the color table pixel values */
-        for (i = 0; i < ncolors; i++) {
-            Uint32 red = (rmax * i) / (ncolors - 1);
-            Uint32 green = (gmax * i) / (ncolors - 1);
-            Uint32 blue = (bmax * i) / (ncolors - 1);
-
-            Uint32 rbits = (rmask * i) / (ncolors - 1);
-            Uint32 gbits = (gmask * i) / (ncolors - 1);
-            Uint32 bbits = (bmask * i) / (ncolors - 1);
-
-            Uint32 pix =
-                (rbits << rshift) | (gbits << gshift) | (bbits << bshift);
-
-            colorcells[i].pixel = pix;
-
-            colorcells[i].red = red;
-            colorcells[i].green = green;
-            colorcells[i].blue = blue;
-
-            colorcells[i].flags = DoRed | DoGreen | DoBlue;
-        }
-
-        X11_XStoreColors(display, xattr.colormap, colorcells, ncolors);
-
-        SDL_free(colorcells);
-    } else {
-        xattr.colormap =
-            X11_XCreateColormap(display, RootWindow(display, screen),
-                            visual, AllocNone);
-    }
-
-    w = X11_XCreateWindow(display, RootWindow(display, screen),
-                      window->x, window->y, window->w, window->h,
-                      0, depth, InputOutput, visual,
-                      (CWOverrideRedirect | CWBackPixmap | CWBorderPixel |
-                       CWColormap), &xattr);
-    if (!w) {
-        return SDL_SetError("Couldn't create window");
-    }
-
-    SetWindowBordered(display, screen, w,
-                      (window->flags & SDL_WINDOW_BORDERLESS) == 0);
-
-    sizehints = X11_XAllocSizeHints();
-    /* Setup the normal size hints */
-    sizehints->flags = 0;
-    if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
-        sizehints->min_width = sizehints->max_width = window->w;
-        sizehints->min_height = sizehints->max_height = window->h;
-        sizehints->flags |= (PMaxSize | PMinSize);
-    }
-    sizehints->x = window->x;
-    sizehints->y = window->y;
-    sizehints->flags |= USPosition;
-
-    /* Setup the input hints so we get keyboard input */
-    wmhints = X11_XAllocWMHints();
-    wmhints->input = True;
-    wmhints->flags = InputHint;
-
-    /* Setup the class hints so we can get an icon (AfterStep) */
-    classhints = X11_XAllocClassHint();
-    classhints->res_name = data->classname;
-    classhints->res_class = data->classname;
-
-    /* Set the size, input and class hints, and define WM_CLIENT_MACHINE and WM_LOCALE_NAME */
-    X11_XSetWMProperties(display, w, NULL, NULL, NULL, 0, sizehints, wmhints, classhints);
-
-    X11_XFree(sizehints);
-    X11_XFree(wmhints);
-    X11_XFree(classhints);
-    /* Set the PID related to the window for the given hostname, if possible */
-    if (data->pid > 0) {
-        _NET_WM_PID = X11_XInternAtom(display, "_NET_WM_PID", False);
-        X11_XChangeProperty(display, w, _NET_WM_PID, XA_CARDINAL, 32, PropModeReplace,
-                        (unsigned char *)&data->pid, 1);
-    }
-
-    /* Set the window manager state */
-    X11_SetNetWMState(_this, w, window->flags);
-
-    /* Let the window manager know we're a "normal" window */
-    _NET_WM_WINDOW_TYPE = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
-    _NET_WM_WINDOW_TYPE_NORMAL = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE_NORMAL", False);
-    X11_XChangeProperty(display, w, _NET_WM_WINDOW_TYPE, XA_ATOM, 32,
-                    PropModeReplace,
-                    (unsigned char *)&_NET_WM_WINDOW_TYPE_NORMAL, 1);
-
-    _NET_WM_BYPASS_COMPOSITOR = X11_XInternAtom(display, "_NET_WM_BYPASS_COMPOSITOR", False);
-    X11_XChangeProperty(display, w, _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32,
-                    PropModeReplace,
-                    (unsigned char *)&_NET_WM_BYPASS_COMPOSITOR_HINT_ON, 1);
-
-    {
-        Atom protocols[] = {
-            data->WM_DELETE_WINDOW, /* Allow window to be deleted by the WM */
-            data->_NET_WM_PING, /* Respond so WM knows we're alive */
-        };
-        X11_XSetWMProtocols(display, w, protocols, sizeof (protocols) / sizeof (protocols[0]));
-    }
-
-    if (SetupWindowData(_this, window, w, SDL_TRUE) < 0) {
-        X11_XDestroyWindow(display, w);
-        return -1;
-    }
-    windowdata = (SDL_WindowData *) window->driverdata;
-
-#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
-    if ((window->flags & SDL_WINDOW_OPENGL) && 
-        _this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES
-#if SDL_VIDEO_OPENGL_GLX            
-        && ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )
-#endif  
-    ) {
-        if (!_this->egl_data) {
-            X11_XDestroyWindow(display, w);
-            return -1;
-        }
-
-        /* Create the GLES window surface */
-        windowdata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) w);
-
-        if (windowdata->egl_surface == EGL_NO_SURFACE) {
-            X11_XDestroyWindow(display, w);
-            return SDL_SetError("Could not create GLES window surface");
-        }
-    }
-#endif
-    
-
-#ifdef X_HAVE_UTF8_STRING
-    if (SDL_X11_HAVE_UTF8 && windowdata->ic) {
-        X11_XGetICValues(windowdata->ic, XNFilterEvents, &fevent, NULL);
-    }
-#endif
-
-    X11_Xinput2SelectTouch(_this, window);
-
-    X11_XSelectInput(display, w,
-                 (FocusChangeMask | EnterWindowMask | LeaveWindowMask |
-                 ExposureMask | ButtonPressMask | ButtonReleaseMask |
-                 PointerMotionMask | KeyPressMask | KeyReleaseMask |
-                 PropertyChangeMask | StructureNotifyMask |
-                 KeymapStateMask | fevent));
-
-    XdndAware = X11_XInternAtom(display, "XdndAware", False);
-    X11_XChangeProperty(display, w, XdndAware, XA_ATOM, 32,
-                 PropModeReplace,
-                 (unsigned char*)&xdnd_version, 1);
-
-    X11_XFlush(display);
-
-    return 0;
-}
-
-int
-X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
-{
-    Window w = (Window) data;
-
-    window->title = X11_GetWindowTitle(_this, w);
-
-    if (SetupWindowData(_this, window, w, SDL_FALSE) < 0) {
-        return -1;
-    }
-    return 0;
-}
-
-char *
-X11_GetWindowTitle(_THIS, Window xwindow)
-{
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    Display *display = data->display;
-    int status, real_format;
-    Atom real_type;
-    unsigned long items_read, items_left;
-    unsigned char *propdata;
-    char *title = NULL;
-
-    status = X11_XGetWindowProperty(display, xwindow, data->_NET_WM_NAME,
-                0L, 8192L, False, data->UTF8_STRING, &real_type, &real_format,
-                &items_read, &items_left, &propdata);
-    if (status == Success && propdata) {
-        title = SDL_strdup(SDL_static_cast(char*, propdata));
-        X11_XFree(propdata);
-    } else {
-        status = X11_XGetWindowProperty(display, xwindow, XA_WM_NAME,
-                    0L, 8192L, False, XA_STRING, &real_type, &real_format,
-                    &items_read, &items_left, &propdata);
-        if (status == Success && propdata) {
-            title = SDL_iconv_string("UTF-8", "", SDL_static_cast(char*, propdata), items_read+1);
-        } else {
-            title = SDL_strdup("");
-        }
-    }
-    return title;
-}
-
-void
-X11_SetWindowTitle(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-    XTextProperty titleprop, iconprop;
-    Status status;
-    const char *title = window->title;
-    const char *icon = NULL;
-
-#ifdef X_HAVE_UTF8_STRING
-    Atom _NET_WM_NAME = data->videodata->_NET_WM_NAME;
-    Atom _NET_WM_ICON_NAME = data->videodata->_NET_WM_ICON_NAME;
-#endif
-
-    if (title != NULL) {
-        char *title_locale = SDL_iconv_utf8_locale(title);
-        if (!title_locale) {
-            SDL_OutOfMemory();
-            return;
-        }
-        status = X11_XStringListToTextProperty(&title_locale, 1, &titleprop);
-        SDL_free(title_locale);
-        if (status) {
-            X11_XSetTextProperty(display, data->xwindow, &titleprop, XA_WM_NAME);
-            X11_XFree(titleprop.value);
-        }
-#ifdef X_HAVE_UTF8_STRING
-        if (SDL_X11_HAVE_UTF8) {
-            status =
-                X11_Xutf8TextListToTextProperty(display, (char **) &title, 1,
-                                            XUTF8StringStyle, &titleprop);
-            if (status == Success) {
-                X11_XSetTextProperty(display, data->xwindow, &titleprop,
-                                 _NET_WM_NAME);
-                X11_XFree(titleprop.value);
-            }
-        }
-#endif
-    }
-    if (icon != NULL) {
-        char *icon_locale = SDL_iconv_utf8_locale(icon);
-        if (!icon_locale) {
-            SDL_OutOfMemory();
-            return;
-        }
-        status = X11_XStringListToTextProperty(&icon_locale, 1, &iconprop);
-        SDL_free(icon_locale);
-        if (status) {
-            X11_XSetTextProperty(display, data->xwindow, &iconprop,
-                             XA_WM_ICON_NAME);
-            X11_XFree(iconprop.value);
-        }
-#ifdef X_HAVE_UTF8_STRING
-        if (SDL_X11_HAVE_UTF8) {
-            status =
-                X11_Xutf8TextListToTextProperty(display, (char **) &icon, 1,
-                                            XUTF8StringStyle, &iconprop);
-            if (status == Success) {
-                X11_XSetTextProperty(display, data->xwindow, &iconprop,
-                                 _NET_WM_ICON_NAME);
-                X11_XFree(iconprop.value);
-            }
-        }
-#endif
-    }
-    X11_XFlush(display);
-}
-
-void
-X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-    Atom _NET_WM_ICON = data->videodata->_NET_WM_ICON;
-
-    if (icon) {
-        int propsize;
-        long *propdata;
-
-        /* Set the _NET_WM_ICON property */
-        SDL_assert(icon->format->format == SDL_PIXELFORMAT_ARGB8888);
-        propsize = 2 + (icon->w * icon->h);
-        propdata = SDL_malloc(propsize * sizeof(long));
-        if (propdata) {
-            int x, y;
-            Uint32 *src;
-            long *dst;
-
-            propdata[0] = icon->w;
-            propdata[1] = icon->h;
-            dst = &propdata[2];
-            for (y = 0; y < icon->h; ++y) {
-                src = (Uint32*)((Uint8*)icon->pixels + y * icon->pitch);
-                for (x = 0; x < icon->w; ++x) {
-                    *dst++ = *src++;
-                }
-            }
-            X11_XChangeProperty(display, data->xwindow, _NET_WM_ICON, XA_CARDINAL,
-                            32, PropModeReplace, (unsigned char *) propdata,
-                            propsize);
-        }
-        SDL_free(propdata);
-    } else {
-        X11_XDeleteProperty(display, data->xwindow, _NET_WM_ICON);
-    }
-    X11_XFlush(display);
-}
-
-void
-X11_SetWindowPosition(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-
-    X11_XMoveWindow(display, data->xwindow, window->x, window->y);
-    X11_XFlush(display);
-}
-
-void
-X11_SetWindowMinimumSize(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-
-    if (window->flags & SDL_WINDOW_RESIZABLE) {
-         XSizeHints *sizehints = X11_XAllocSizeHints();
-         long userhints;
-
-         X11_XGetWMNormalHints(display, data->xwindow, sizehints, &userhints);
-
-         sizehints->min_width = window->min_w;
-         sizehints->min_height = window->min_h;
-         sizehints->flags |= PMinSize;
-
-         X11_XSetWMNormalHints(display, data->xwindow, sizehints);
-
-         X11_XFree(sizehints);
-
-        /* See comment in X11_SetWindowSize. */
-        X11_XResizeWindow(display, data->xwindow, window->w, window->h);
-        X11_XMoveWindow(display, data->xwindow, window->x, window->y);
-        X11_XRaiseWindow(display, data->xwindow);
-    }
-
-    X11_XFlush(display);
-}
-
-void
-X11_SetWindowMaximumSize(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-
-    if (window->flags & SDL_WINDOW_RESIZABLE) {
-         XSizeHints *sizehints = X11_XAllocSizeHints();
-         long userhints;
-
-         X11_XGetWMNormalHints(display, data->xwindow, sizehints, &userhints);
-
-         sizehints->max_width = window->max_w;
-         sizehints->max_height = window->max_h;
-         sizehints->flags |= PMaxSize;
-
-         X11_XSetWMNormalHints(display, data->xwindow, sizehints);
-
-         X11_XFree(sizehints);
-
-        /* See comment in X11_SetWindowSize. */
-        X11_XResizeWindow(display, data->xwindow, window->w, window->h);
-        X11_XMoveWindow(display, data->xwindow, window->x, window->y);
-        X11_XRaiseWindow(display, data->xwindow);
-    }
-
-    X11_XFlush(display);
-}
-
-void
-X11_SetWindowSize(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-
-    if (SDL_IsShapedWindow(window)) {
-        X11_ResizeWindowShape(window);
-    }
-    if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
-         /* Apparently, if the X11 Window is set to a 'non-resizable' window, you cannot resize it using the X11_XResizeWindow, thus
-            we must set the size hints to adjust the window size. */
-         XSizeHints *sizehints = X11_XAllocSizeHints();
-         long userhints;
-
-         X11_XGetWMNormalHints(display, data->xwindow, sizehints, &userhints);
-
-         sizehints->min_width = sizehints->max_width = window->w;
-         sizehints->min_height = sizehints->max_height = window->h;
-         sizehints->flags |= PMinSize | PMaxSize;
-
-         X11_XSetWMNormalHints(display, data->xwindow, sizehints);
-
-         X11_XFree(sizehints);
-
-        /* From Pierre-Loup:
-           WMs each have their little quirks with that.  When you change the
-           size hints, they get a ConfigureNotify event with the
-           WM_NORMAL_SIZE_HINTS Atom.  They all save the hints then, but they
-           don't all resize the window right away to enforce the new hints.
-
-           Some of them resize only after:
-            - A user-initiated move or resize
-            - A code-initiated move or resize
-            - Hiding & showing window (Unmap & map)
-
-           The following move & resize seems to help a lot of WMs that didn't
-           properly update after the hints were changed. We don't do a
-           hide/show, because there are supposedly subtle problems with doing so
-           and transitioning from windowed to fullscreen in Unity.
-         */
-        X11_XResizeWindow(display, data->xwindow, window->w, window->h);
-        X11_XMoveWindow(display, data->xwindow, window->x, window->y);
-        X11_XRaiseWindow(display, data->xwindow);
-    } else {
-        X11_XResizeWindow(display, data->xwindow, window->w, window->h);
-    }
-
-    X11_XFlush(display);
-}
-
-void
-X11_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
-{
-    const SDL_bool focused = ((window->flags & SDL_WINDOW_INPUT_FOCUS) != 0);
-    const SDL_bool visible = ((window->flags & SDL_WINDOW_HIDDEN) == 0);
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *displaydata =
-        (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
-    Display *display = data->videodata->display;
-    XEvent event;
-
-    SetWindowBordered(display, displaydata->screen, data->xwindow, bordered);
-    X11_XFlush(display);
-    X11_XIfEvent(display, &event, &isConfigureNotify, (XPointer)&data->xwindow);
-
-    if (visible) {
-        XWindowAttributes attr;
-        do {
-            X11_XSync(display, False);
-            X11_XGetWindowAttributes(display, data->xwindow, &attr);
-        } while (attr.map_state != IsViewable);
-
-        if (focused) {
-            X11_XSetInputFocus(display, data->xwindow, RevertToParent, CurrentTime);
-        }
-    }
-
-    /* make sure these don't make it to the real event queue if they fired here. */
-    X11_XSync(display, False);
-    X11_XCheckIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow);
-    X11_XCheckIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow);
-}
-
-void
-X11_ShowWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-    XEvent event;
-
-    if (!X11_IsWindowMapped(_this, window)) {
-        X11_XMapRaised(display, data->xwindow);
-        /* Blocking wait for "MapNotify" event.
-         * We use X11_XIfEvent because pXWindowEvent takes a mask rather than a type,
-         * and XCheckTypedWindowEvent doesn't block */
-        X11_XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow);
-        X11_XFlush(display);
-    }
-}
-
-void
-X11_HideWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
-    Display *display = data->videodata->display;
-    XEvent event;
-
-    if (X11_IsWindowMapped(_this, window)) {
-        X11_XWithdrawWindow(display, data->xwindow, displaydata->screen);
-        /* Blocking wait for "UnmapNotify" event */
-        X11_XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow);
-        X11_XFlush(display);
-    }
-}
-
-static void
-SetWindowActive(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *displaydata =
-        (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
-    Display *display = data->videodata->display;
-    Atom _NET_ACTIVE_WINDOW = data->videodata->_NET_ACTIVE_WINDOW;
-
-    if (X11_IsWindowMapped(_this, window)) {
-        XEvent e;
-
-        SDL_zero(e);
-        e.xany.type = ClientMessage;
-        e.xclient.message_type = _NET_ACTIVE_WINDOW;
-        e.xclient.format = 32;
-        e.xclient.window = data->xwindow;
-        e.xclient.data.l[0] = 1;  /* source indication. 1 = application */
-        e.xclient.data.l[1] = CurrentTime;
-        e.xclient.data.l[2] = 0;
-
-        X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
-                   SubstructureNotifyMask | SubstructureRedirectMask, &e);
-
-        X11_XFlush(display);
-    }
-}
-
-void
-X11_RaiseWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-
-    X11_XRaiseWindow(display, data->xwindow);
-    SetWindowActive(_this, window);
-    X11_XFlush(display);
-}
-
-static void
-SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *displaydata =
-        (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
-    Display *display = data->videodata->display;
-    Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE;
-    Atom _NET_WM_STATE_MAXIMIZED_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT;
-    Atom _NET_WM_STATE_MAXIMIZED_HORZ = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
-
-    if (maximized) {
-        window->flags |= SDL_WINDOW_MAXIMIZED;
-    } else {
-        window->flags &= ~SDL_WINDOW_MAXIMIZED;
-    }
-
-    if (X11_IsWindowMapped(_this, window)) {
-        XEvent e;
-
-        SDL_zero(e);
-        e.xany.type = ClientMessage;
-        e.xclient.message_type = _NET_WM_STATE;
-        e.xclient.format = 32;
-        e.xclient.window = data->xwindow;
-        e.xclient.data.l[0] =
-            maximized ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
-        e.xclient.data.l[1] = _NET_WM_STATE_MAXIMIZED_VERT;
-        e.xclient.data.l[2] = _NET_WM_STATE_MAXIMIZED_HORZ;
-        e.xclient.data.l[3] = 0l;
-
-        X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
-                   SubstructureNotifyMask | SubstructureRedirectMask, &e);
-    } else {
-        X11_SetNetWMState(_this, data->xwindow, window->flags);
-    }
-    X11_XFlush(display);
-}
-
-void
-X11_MaximizeWindow(_THIS, SDL_Window * window)
-{
-    SetWindowMaximized(_this, window, SDL_TRUE);
-}
-
-void
-X11_MinimizeWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *displaydata =
-        (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
-    Display *display = data->videodata->display;
-
-    X11_XIconifyWindow(display, data->xwindow, displaydata->screen);
-    X11_XFlush(display);
-}
-
-void
-X11_RestoreWindow(_THIS, SDL_Window * window)
-{
-    SetWindowMaximized(_this, window, SDL_FALSE);
-    X11_ShowWindow(_this, window);
-    SetWindowActive(_this, window);
-}
-
-/* This asks the Window Manager to handle fullscreen for us. Most don't do it right, though. */
-static void
-X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _display, SDL_bool fullscreen)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *displaydata = (SDL_DisplayData *) _display->driverdata;
-    Display *display = data->videodata->display;
-    Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE;
-    Atom _NET_WM_STATE_FULLSCREEN = data->videodata->_NET_WM_STATE_FULLSCREEN;
-
-    if (X11_IsWindowMapped(_this, window)) {
-        XEvent e;
-
-        if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
-            /* Compiz refuses fullscreen toggle if we're not resizable, so update the hints so we
-               can be resized to the fullscreen resolution (or reset so we're not resizable again) */
-            XSizeHints *sizehints = X11_XAllocSizeHints();
-            long flags = 0;
-            X11_XGetWMNormalHints(display, data->xwindow, sizehints, &flags);
-            /* set the resize flags on */
-            if (fullscreen) {
-                /* we are going fullscreen so turn the flags off */
-                sizehints->flags &= ~(PMinSize | PMaxSize);
-            } else {
-                /* Reset the min/max width height to make the window non-resizable again */
-                sizehints->flags |= PMinSize | PMaxSize;
-                sizehints->min_width = sizehints->max_width = window->windowed.w;
-                sizehints->min_height = sizehints->max_height = window->windowed.h;
-            }
-            X11_XSetWMNormalHints(display, data->xwindow, sizehints);
-            X11_XFree(sizehints);
-        }
-
-        SDL_zero(e);
-        e.xany.type = ClientMessage;
-        e.xclient.message_type = _NET_WM_STATE;
-        e.xclient.format = 32;
-        e.xclient.window = data->xwindow;
-        e.xclient.data.l[0] =
-            fullscreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
-        e.xclient.data.l[1] = _NET_WM_STATE_FULLSCREEN;
-        e.xclient.data.l[3] = 0l;
-
-        X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0,
-                   SubstructureNotifyMask | SubstructureRedirectMask, &e);
-    } else {
-        Uint32 flags;
-
-        flags = window->flags;
-        if (fullscreen) {
-            flags |= SDL_WINDOW_FULLSCREEN;
-        } else {
-            flags &= ~SDL_WINDOW_FULLSCREEN;
-        }
-        X11_SetNetWMState(_this, data->xwindow, flags);
-    }
-
-    if (data->visual->class == DirectColor) {
-        if ( fullscreen ) {
-            X11_XInstallColormap(display, data->colormap);
-        } else {
-            X11_XUninstallColormap(display, data->colormap);
-        }
-    }
-
-    X11_XFlush(display);
-}
-
-/* This handles fullscreen itself, outside the Window Manager. */
-static void
-X11_BeginWindowFullscreenLegacy(_THIS, SDL_Window * window, SDL_VideoDisplay * _display)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *displaydata = (SDL_DisplayData *) _display->driverdata;
-    Visual *visual = data->visual;
-    Display *display = data->videodata->display;
-    const int screen = displaydata->screen;
-    Window root = RootWindow(display, screen);
-    const int def_vis = (visual == DefaultVisual(display, screen));
-    unsigned long xattrmask = 0;
-    XSetWindowAttributes xattr;
-    XEvent ev;
-    SDL_Rect rect;
-
-    if ( data->fswindow ) {
-        return;  /* already fullscreen, I hope. */
-    }
-
-    X11_GetDisplayBounds(_this, _display, &rect);
-
-    SDL_zero(xattr);
-    xattr.override_redirect = True;
-    xattrmask |= CWOverrideRedirect;
-    xattr.background_pixel = def_vis ? BlackPixel(display, screen) : 0;
-    xattrmask |= CWBackPixel;
-    xattr.border_pixel = 0;
-    xattrmask |= CWBorderPixel;
-    xattr.colormap = data->colormap;
-    xattrmask |= CWColormap;
-
-    data->fswindow = X11_XCreateWindow(display, root,
-                                   rect.x, rect.y, rect.w, rect.h, 0,
-                                   displaydata->depth, InputOutput,
-                                   visual, xattrmask, &xattr);
-
-    X11_XSelectInput(display, data->fswindow, StructureNotifyMask);
-    X11_XSetWindowBackground(display, data->fswindow, 0);
-    X11_XInstallColormap(display, data->colormap);
-    X11_XClearWindow(display, data->fswindow);
-    X11_XMapRaised(display, data->fswindow);
-
-    /* Make sure the fswindow is in view by warping mouse to the corner */
-    X11_XUngrabPointer(display, CurrentTime);
-    X11_XWarpPointer(display, None, root, 0, 0, 0, 0, rect.x, rect.y);
-
-    /* Wait to be mapped, filter Unmap event out if it arrives. */
-    X11_XIfEvent(display, &ev, &isMapNotify, (XPointer)&data->fswindow);
-    X11_XCheckIfEvent(display, &ev, &isUnmapNotify, (XPointer)&data->fswindow);
-
-#if SDL_VIDEO_DRIVER_X11_XVIDMODE
-    if ( displaydata->use_vidmode ) {
-        X11_XF86VidModeLockModeSwitch(display, screen, True);
-    }
-#endif
-
-    SetWindowBordered(display, displaydata->screen, data->xwindow, SDL_FALSE);
-
-    /* Center actual window within our cover-the-screen window. */
-    X11_XReparentWindow(display, data->xwindow, data->fswindow,
-                    (rect.w - window->w) / 2, (rect.h - window->h) / 2);
-
-    /* Move the mouse to the upper left to make sure it's on-screen */
-    X11_XWarpPointer(display, None, root, 0, 0, 0, 0, rect.x, rect.y);
-
-    /* Center mouse in the fullscreen window. */
-    rect.x += (rect.w / 2);
-    rect.y += (rect.h / 2);
-    X11_XWarpPointer(display, None, root, 0, 0, 0, 0, rect.x, rect.y);
-
-    /* Wait to be mapped, filter Unmap event out if it arrives. */
-    X11_XIfEvent(display, &ev, &isMapNotify, (XPointer)&data->xwindow);
-    X11_XCheckIfEvent(display, &ev, &isUnmapNotify, (XPointer)&data->xwindow);
-
-    SDL_UpdateWindowGrab(window);
-}
-
-static void
-X11_EndWindowFullscreenLegacy(_THIS, SDL_Window * window, SDL_VideoDisplay * _display)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    SDL_DisplayData *displaydata = (SDL_DisplayData *) _display->driverdata;
-    Display *display = data->videodata->display;
-    const int screen = displaydata->screen;
-    Window root = RootWindow(display, screen);
-    Window fswindow = data->fswindow;
-    XEvent ev;
-
-    if (!data->fswindow) {
-        return;  /* already not fullscreen, I hope. */
-    }
-
-    data->fswindow = None;
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
-    if ( displaydata->use_vidmode ) {
-        X11_XF86VidModeLockModeSwitch(display, screen, False);
-    }
-#endif
-
-    SDL_UpdateWindowGrab(window);
-
-    X11_XReparentWindow(display, data->xwindow, root, window->x, window->y);
-
-    /* flush these events so they don't confuse normal event handling */
-    X11_XSync(display, False);
-    X11_XCheckIfEvent(display, &ev, &isMapNotify, (XPointer)&data->xwindow);
-    X11_XCheckIfEvent(display, &ev, &isUnmapNotify, (XPointer)&data->xwindow);
-
-    SetWindowBordered(display, screen, data->xwindow,
-                      (window->flags & SDL_WINDOW_BORDERLESS) == 0);
-
-    X11_XWithdrawWindow(display, fswindow, screen);
-
-    /* Wait to be unmapped. */
-    X11_XIfEvent(display, &ev, &isUnmapNotify, (XPointer)&fswindow);
-    X11_XDestroyWindow(display, fswindow);
-}
-
-
-void
-X11_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * _display, SDL_bool fullscreen)
-{
-    /* !!! FIXME: SDL_Hint? */
-    SDL_bool legacy = SDL_FALSE;
-    const char *env = SDL_getenv("SDL_VIDEO_X11_LEGACY_FULLSCREEN");
-    if (env) {
-        legacy = SDL_atoi(env);
-    } else {
-        SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-        SDL_DisplayData *displaydata = (SDL_DisplayData *) _display->driverdata;
-        if ( displaydata->use_vidmode ) {
-            legacy = SDL_TRUE;  /* the new stuff only works with XRandR. */
-        } else if ( !videodata->net_wm ) {
-            legacy = SDL_TRUE;  /* The window manager doesn't support it */
-        } else {
-            /* !!! FIXME: look at the window manager name, and blacklist certain ones? */
-            /* http://stackoverflow.com/questions/758648/find-the-name-of-the-x-window-manager */
-            legacy = SDL_FALSE;  /* try the new way. */
-        }
-    }
-
-    if (legacy) {
-        if (fullscreen) {
-            X11_BeginWindowFullscreenLegacy(_this, window, _display);
-        } else {
-            X11_EndWindowFullscreenLegacy(_this, window, _display);
-        }
-    } else {
-        X11_SetWindowFullscreenViaWM(_this, window, _display, fullscreen);
-    }
-}
-
-
-int
-X11_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-    Visual *visual = data->visual;
-    Colormap colormap = data->colormap;
-    XColor *colorcells;
-    int ncolors;
-    int rmask, gmask, bmask;
-    int rshift, gshift, bshift;
-    int i;
-
-    if (visual->class != DirectColor) {
-        return SDL_SetError("Window doesn't have DirectColor visual");
-    }
-
-    ncolors = visual->map_entries;
-    colorcells = SDL_malloc(ncolors * sizeof(XColor));
-    if (!colorcells) {
-        return SDL_OutOfMemory();
-    }
-
-    rshift = 0;
-    rmask = visual->red_mask;
-    while (0 == (rmask & 1)) {
-        rshift++;
-        rmask >>= 1;
-    }
-
-    gshift = 0;
-    gmask = visual->green_mask;
-    while (0 == (gmask & 1)) {
-        gshift++;
-        gmask >>= 1;
-    }
-
-    bshift = 0;
-    bmask = visual->blue_mask;
-    while (0 == (bmask & 1)) {
-        bshift++;
-        bmask >>= 1;
-    }
-
-    /* build the color table pixel values */
-    for (i = 0; i < ncolors; i++) {
-        Uint32 rbits = (rmask * i) / (ncolors - 1);
-        Uint32 gbits = (gmask * i) / (ncolors - 1);
-        Uint32 bbits = (bmask * i) / (ncolors - 1);
-        Uint32 pix = (rbits << rshift) | (gbits << gshift) | (bbits << bshift);
-
-        colorcells[i].pixel = pix;
-
-        colorcells[i].red = ramp[(0 * 256) + i];
-        colorcells[i].green = ramp[(1 * 256) + i];
-        colorcells[i].blue = ramp[(2 * 256) + i];
-
-        colorcells[i].flags = DoRed | DoGreen | DoBlue;
-    }
-
-    X11_XStoreColors(display, colormap, colorcells, ncolors);
-    X11_XFlush(display);
-    SDL_free(colorcells);
-
-    return 0;
-}
-
-void
-X11_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-    SDL_bool oldstyle_fullscreen;
-    SDL_bool grab_keyboard;
-    const char *hint;
-
-    /* ICCCM2.0-compliant window managers can handle fullscreen windows
-       If we're using XVidMode to change resolution we need to confine
-       the cursor so we don't pan around the virtual desktop.
-     */
-    oldstyle_fullscreen = X11_IsWindowLegacyFullscreen(_this, window);
-
-    if (oldstyle_fullscreen || grabbed) {
-        /* Try to grab the mouse */
-        for (;;) {
-            int result =
-                X11_XGrabPointer(display, data->xwindow, True, 0, GrabModeAsync,
-                             GrabModeAsync, data->xwindow, None, CurrentTime);
-            if (result == GrabSuccess) {
-                break;
-            }
-            SDL_Delay(50);
-        }
-
-        /* Raise the window if we grab the mouse */
-        X11_XRaiseWindow(display, data->xwindow);
-
-        /* Now grab the keyboard */
-        hint = SDL_GetHint(SDL_HINT_GRAB_KEYBOARD);
-        if (hint && SDL_atoi(hint)) {
-            grab_keyboard = SDL_TRUE;
-        } else {
-            /* We need to do this with the old style override_redirect
-               fullscreen window otherwise we won't get keyboard focus.
-            */
-            grab_keyboard = oldstyle_fullscreen;
-        }
-        if (grab_keyboard) {
-            X11_XGrabKeyboard(display, data->xwindow, True, GrabModeAsync,
-                          GrabModeAsync, CurrentTime);
-        }
-    } else {
-        X11_XUngrabPointer(display, CurrentTime);
-        X11_XUngrabKeyboard(display, CurrentTime);
-    }
-    X11_XSync(display, False);
-}
-
-void
-X11_DestroyWindow(_THIS, SDL_Window * window)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    window->driverdata = NULL;
-
-    if (data) {
-        SDL_VideoData *videodata = (SDL_VideoData *) data->videodata;
-        Display *display = videodata->display;
-        int numwindows = videodata->numwindows;
-        SDL_WindowData **windowlist = videodata->windowlist;
-        int i;
-
-        if (windowlist) {
-            for (i = 0; i < numwindows; ++i) {
-                if (windowlist[i] && (windowlist[i]->window == window)) {
-                    windowlist[i] = windowlist[numwindows - 1];
-                    windowlist[numwindows - 1] = NULL;
-                    videodata->numwindows--;
-                    break;
-                }
-            }
-        }
-#ifdef X_HAVE_UTF8_STRING
-        if (data->ic) {
-            X11_XDestroyIC(data->ic);
-        }
-#endif
-        if (data->created) {
-            X11_XDestroyWindow(display, data->xwindow);
-            X11_XFlush(display);
-        }
-        SDL_free(data);
-    }
-}
-
-SDL_bool
-X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
-{
-    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
-    Display *display = data->videodata->display;
-
-    if (info->version.major == SDL_MAJOR_VERSION &&
-        info->version.minor == SDL_MINOR_VERSION) {
-        info->subsystem = SDL_SYSWM_X11;
-        info->info.x11.display = display;
-        info->info.x11.window = data->xwindow;
-        return SDL_TRUE;
-    } else {
-        SDL_SetError("Application not compiled with SDL %d.%d\n",
-                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
-        return SDL_FALSE;
-    }
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11window.h b/deps/SDL2/src/video/x11/SDL_x11window.h
deleted file mode 100644
index b0eff5c..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11window.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11window_h
-#define _SDL_x11window_h
-
-/* We need to queue the focus in/out changes because they may occur during
-   video mode changes and we can respond to them by triggering more mode
-   changes.
-*/
-#define PENDING_FOCUS_IN_TIME   200
-#define PENDING_FOCUS_OUT_TIME  200
-
-#if SDL_VIDEO_OPENGL_EGL   
-#include <EGL/egl.h>
-#endif
-
-typedef enum
-{
-    PENDING_FOCUS_NONE,
-    PENDING_FOCUS_IN,
-    PENDING_FOCUS_OUT
-} PendingFocusEnum;
-
-typedef struct
-{
-    SDL_Window *window;
-    Window xwindow;
-    Window fswindow;  /* used if we can't have the WM handle fullscreen. */
-    Visual *visual;
-    Colormap colormap;
-#ifndef NO_SHARED_MEMORY
-    /* MIT shared memory extension information */
-    SDL_bool use_mitshm;
-    XShmSegmentInfo shminfo;
-#endif
-    XImage *ximage;
-    GC gc;
-    XIC ic;
-    SDL_bool created;
-    PendingFocusEnum pending_focus;
-    Uint32 pending_focus_time;
-    XConfigureEvent last_xconfigure;
-    struct SDL_VideoData *videodata;
-    Atom xdnd_req;
-    Window xdnd_source;
-#if SDL_VIDEO_OPENGL_EGL  
-    EGLSurface egl_surface;
-#endif
-} SDL_WindowData;
-
-extern void X11_SetNetWMState(_THIS, Window xwindow, Uint32 flags);
-extern Uint32 X11_GetNetWMState(_THIS, Window xwindow);
-
-extern int X11_CreateWindow(_THIS, SDL_Window * window);
-extern int X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
-extern char *X11_GetWindowTitle(_THIS, Window xwindow);
-extern void X11_SetWindowTitle(_THIS, SDL_Window * window);
-extern void X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
-extern void X11_SetWindowPosition(_THIS, SDL_Window * window);
-extern void X11_SetWindowMinimumSize(_THIS, SDL_Window * window);
-extern void X11_SetWindowMaximumSize(_THIS, SDL_Window * window);
-extern void X11_SetWindowSize(_THIS, SDL_Window * window);
-extern void X11_ShowWindow(_THIS, SDL_Window * window);
-extern void X11_HideWindow(_THIS, SDL_Window * window);
-extern void X11_RaiseWindow(_THIS, SDL_Window * window);
-extern void X11_MaximizeWindow(_THIS, SDL_Window * window);
-extern void X11_MinimizeWindow(_THIS, SDL_Window * window);
-extern void X11_RestoreWindow(_THIS, SDL_Window * window);
-extern void X11_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
-extern void X11_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
-extern int X11_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
-extern void X11_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
-extern void X11_DestroyWindow(_THIS, SDL_Window * window);
-extern SDL_bool X11_GetWindowWMInfo(_THIS, SDL_Window * window,
-                                    struct SDL_SysWMinfo *info);
-
-#endif /* _SDL_x11window_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11xinput2.c b/deps/SDL2/src/video/x11/SDL_x11xinput2.c
deleted file mode 100644
index 719d2e3..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11xinput2.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-#include "SDL_x11video.h"
-#include "SDL_x11xinput2.h"
-#include "../../events/SDL_mouse_c.h"
-#include "../../events/SDL_touch_c.h"
-
-#define MAX_AXIS 16
-
-#if SDL_VIDEO_DRIVER_X11_XINPUT2
-static int xinput2_initialized = 0;
-
-#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
-static int xinput2_multitouch_supported = 0;
-#endif
-
-/* Opcode returned X11_XQueryExtension
- * It will be used in event processing
- * to know that the event came from
- * this extension */
-static int xinput2_opcode;
-
-static void parse_valuators(const double *input_values,unsigned char *mask,int mask_len,
-                            double *output_values,int output_values_len) {
-    int i = 0,z = 0;
-    int top = mask_len * 8;
-    if (top > MAX_AXIS)
-        top = MAX_AXIS;
-
-    SDL_memset(output_values,0,output_values_len * sizeof(double));
-    for (; i < top && z < output_values_len; i++) {
-        if (XIMaskIsSet(mask, i)) {
-            const int value = (int) *input_values;
-            output_values[z] = value;
-            input_values++;
-        }
-        z++;
-    }
-}
-#endif /* SDL_VIDEO_DRIVER_X11_XINPUT2 */
-
-void
-X11_InitXinput2(_THIS)
-{
-#if SDL_VIDEO_DRIVER_X11_XINPUT2
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-
-    XIEventMask eventmask;
-    unsigned char mask[3] = { 0,0,0 };
-    int event, err;
-    int major = 2, minor = 0;
-    int outmajor,outminor;
-#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
-    minor = 2;
-#endif
-    /*
-    * Initialize XInput 2
-    * According to http://who-t.blogspot.com/2009/05/xi2-recipes-part-1.html its better
-    * to inform Xserver what version of Xinput we support.The server will store the version we support.
-    * "As XI2 progresses it becomes important that you use this call as the server may treat the client
-    * differently depending on the supported version".
-    *
-    * FIXME:event and err are not needed but if not passed X11_XQueryExtension returns SegmentationFault
-    */
-    if (!SDL_X11_HAVE_XINPUT2 ||
-        !X11_XQueryExtension(data->display, "XInputExtension", &xinput2_opcode, &event, &err)) {
-        return;
-    }
-
-    outmajor = major;
-    outminor = minor;
-    if (X11_XIQueryVersion(data->display, &outmajor, &outminor) != Success) {
-        return;
-    }
-
-    /* Check supported version */
-    if(outmajor * 1000 + outminor < major * 1000 + minor) {
-        /* X server does not support the version we want */
-        return;
-    }
-    xinput2_initialized = 1;
-#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
-    /* XInput 2.2 */
-    if(outmajor * 1000 + outminor >= major * 1000 + minor) {
-        xinput2_multitouch_supported = 1;
-    }
-#endif
-
-    /* Enable  Raw motion events for this display */
-    eventmask.deviceid = XIAllMasterDevices;
-    eventmask.mask_len = sizeof(mask);
-    eventmask.mask = mask;
-
-    XISetMask(mask, XI_RawMotion);
-
-    if (X11_XISelectEvents(data->display,DefaultRootWindow(data->display),&eventmask,1) != Success) {
-        return;
-    }
-#endif
-}
-
-int
-X11_HandleXinput2Event(SDL_VideoData *videodata,XGenericEventCookie *cookie)
-{
-#if SDL_VIDEO_DRIVER_X11_XINPUT2
-    if(cookie->extension != xinput2_opcode) {
-        return 0;
-    }
-    switch(cookie->evtype) {
-        case XI_RawMotion: {
-            const XIRawEvent *rawev = (const XIRawEvent*)cookie->data;
-            SDL_Mouse *mouse = SDL_GetMouse();
-            double relative_cords[2];
-
-            if (!mouse->relative_mode) {
-                return 0;
-            }
-
-            parse_valuators(rawev->raw_values,rawev->valuators.mask,
-                            rawev->valuators.mask_len,relative_cords,2);
-            SDL_SendMouseMotion(mouse->focus,mouse->mouseID,1,(int)relative_cords[0],(int)relative_cords[1]);
-            return 1;
-            }
-            break;
-#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
-        case XI_TouchBegin: {
-            const XIDeviceEvent *xev = (const XIDeviceEvent *) cookie->data;
-            SDL_SendTouch(xev->sourceid,xev->detail,
-                      SDL_TRUE, xev->event_x, xev->event_y, 1.0);
-            return 1;
-            }
-            break;
-        case XI_TouchEnd: {
-            const XIDeviceEvent *xev = (const XIDeviceEvent *) cookie->data;
-            SDL_SendTouch(xev->sourceid,xev->detail,
-                      SDL_FALSE, xev->event_x, xev->event_y, 1.0);
-            return 1;
-            }
-            break;
-        case XI_TouchUpdate: {
-            const XIDeviceEvent *xev = (const XIDeviceEvent *) cookie->data;
-            SDL_SendTouchMotion(xev->sourceid,xev->detail,
-                                xev->event_x, xev->event_y, 1.0);
-            return 1;
-            }
-            break;
-#endif
-    }
-#endif
-    return 0;
-}
-
-void
-X11_InitXinput2Multitouch(_THIS)
-{
-#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
-    XIDeviceInfo *info;
-    int ndevices,i,j;
-    info = X11_XIQueryDevice(data->display, XIAllMasterDevices, &ndevices);
-
-    for (i = 0; i < ndevices; i++) {
-        XIDeviceInfo *dev = &info[i];
-        for (j = 0; j < dev->num_classes; j++) {
-            SDL_TouchID touchId;
-            XIAnyClassInfo *class = dev->classes[j];
-            XITouchClassInfo *t = (XITouchClassInfo*)class;
-
-            /* Only touch devices */
-            if (class->type != XITouchClass)
-                continue;
-
-            touchId = t->sourceid;
-            if (!SDL_GetTouch(touchId)) {
-                SDL_AddTouch(touchId, dev->name);
-            }
-        }
-    }
-    X11_XIFreeDeviceInfo(info);
-#endif
-}
-
-void
-X11_Xinput2SelectTouch(_THIS, SDL_Window *window)
-{
-#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
-    SDL_VideoData *data = NULL;
-    XIEventMask eventmask;
-    unsigned char mask[3] = { 0,0,0 };
-    SDL_WindowData *window_data = NULL;
-    
-    if (!X11_Xinput2IsMultitouchSupported()) {
-        return;
-    }
-
-    data = (SDL_VideoData *) _this->driverdata;
-    window_data = (SDL_WindowData*)window->driverdata;
-
-    eventmask.deviceid = XIAllMasterDevices;
-    eventmask.mask_len = sizeof(mask);
-    eventmask.mask = mask;
-
-    XISetMask(mask, XI_TouchBegin);
-    XISetMask(mask, XI_TouchUpdate);
-    XISetMask(mask, XI_TouchEnd);
-
-    X11_XISelectEvents(data->display,window_data->xwindow,&eventmask,1);
-#endif
-}
-
-
-int
-X11_Xinput2IsInitialized()
-{
-#if SDL_VIDEO_DRIVER_X11_XINPUT2
-    return xinput2_initialized;
-#else
-    return 0;
-#endif
-}
-
-int
-X11_Xinput2IsMultitouchSupported()
-{
-#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
-    return xinput2_initialized && xinput2_multitouch_supported;
-#else
-    return 0;
-#endif
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/SDL_x11xinput2.h b/deps/SDL2/src/video/x11/SDL_x11xinput2.h
deleted file mode 100644
index 920c170..0000000
--- a/deps/SDL2/src/video/x11/SDL_x11xinput2.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2013 Sam Lantinga <slouken at libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11xinput2_h
-#define _SDL_x11xinput2_h
-
-#ifndef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
-/* Define XGenericEventCookie as forward declaration when
- *xinput2 is not available in order to compile */
-struct XGenericEventCookie;
-typedef struct XGenericEventCookie XGenericEventCookie;
-#endif
-
-extern void X11_InitXinput2(_THIS);
-extern void X11_InitXinput2Multitouch(_THIS);
-extern int X11_HandleXinput2Event(SDL_VideoData *videodata,XGenericEventCookie *cookie);
-extern int X11_Xinput2IsInitialized(void);
-extern int X11_Xinput2IsMultitouchSupported(void);
-extern void X11_Xinput2SelectTouch(_THIS, SDL_Window *window);
-
-#endif /* _SDL_x11xinput2_h */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/deps/SDL2/src/video/x11/edid-parse.c b/deps/SDL2/src/video/x11/edid-parse.c
deleted file mode 100644
index 8608bf2..0000000
--- a/deps/SDL2/src/video/x11/edid-parse.c
+++ /dev/null
@@ -1,752 +0,0 @@
-/*
- * Copyright 2007 Red Hat, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* Author: Soren Sandmann <sandmann at redhat.com> */
-
-#include "edid.h"
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <stdio.h>
-
-#define TRUE 1
-#define FALSE 0
-
-static int
-get_bit (int in, int bit)
-{
-    return (in & (1 << bit)) >> bit;
-}
-
-static int
-get_bits (int in, int begin, int end)
-{
-    int mask = (1 << (end - begin + 1)) - 1;
-    
-    return (in >> begin) & mask;
-}
-
-static int
-decode_header (const uchar *edid)
-{
-    if (memcmp (edid, "\x00\xff\xff\xff\xff\xff\xff\x00", 8) == 0)
-	return TRUE;
-    return FALSE;
-}
-
-static int
-decode_vendor_and_product_identification (const uchar *edid, MonitorInfo *info)
-{
-    int is_model_year;
-    
-    /* Manufacturer Code */
-    info->manufacturer_code[0]  = get_bits (edid[0x08], 2, 6);
-    info->manufacturer_code[1]  = get_bits (edid[0x08], 0, 1) << 3;
-    info->manufacturer_code[1] |= get_bits (edid[0x09], 5, 7);
-    info->manufacturer_code[2]  = get_bits (edid[0x09], 0, 4);
-    info->manufacturer_code[3]  = '\0';
-    
-    info->manufacturer_code[0] += 'A' - 1;
-    info->manufacturer_code[1] += 'A' - 1;
-    info->manufacturer_code[2] += 'A' - 1;
-
-    /* Product Code */
-    info->product_code = edid[0x0b] << 8 | edid[0x0a];
-
-    /* Serial Number */
-    info->serial_number =
-	edid[0x0c] | edid[0x0d] << 8 | edid[0x0e] << 16 | edid[0x0f] << 24;
-
-    /* Week and Year */
-    is_model_year = FALSE;
-    switch (edid[0x10])
-    {
-    case 0x00:
-	info->production_week = -1;
-	break;
-
-    case 0xff:
-	info->production_week = -1;
-	is_model_year = TRUE;
-	break;
-
-    default:
-	info->production_week = edid[0x10];
-	break;
-    }
-
-    if (is_model_year)
-    {
-	info->production_year = -1;
-	info->model_year = 1990 + edid[0x11];
-    }
-    else
-    {
-	info->production_year = 1990 + edid[0x11];
-	info->model_year = -1;
-    }
-
-    return TRUE;
-}
-
-static int
-decode_edid_version (const uchar *edid, MonitorInfo *info)
-{
-    info->major_version = edid[0x12];
-    info->minor_version = edid[0x13];
-
-    return TRUE;
-}
-
-static int
-decode_display_parameters (const uchar *edid, MonitorInfo *info)
-{
-    /* Digital vs Analog */
-    info->is_digital = get_bit (edid[0x14], 7);
-
-    if (info->is_digital)
-    {
-	int bits;
-	
-	static const int bit_depth[8] =
-	{
-	    -1, 6, 8, 10, 12, 14, 16, -1
-	};
-
-	static const Interface interfaces[6] =
-	{
-	    UNDEFINED, DVI, HDMI_A, HDMI_B, MDDI, DISPLAY_PORT
-	};
-
-	bits = get_bits (edid[0x14], 4, 6);
-	info->digital.bits_per_primary = bit_depth[bits];
-
-	bits = get_bits (edid[0x14], 0, 3);
-	
-	if (bits <= 5)
-	    info->digital.interface = interfaces[bits];
-	else
-	    info->digital.interface = UNDEFINED;
-    }
-    else
-    {
-	int bits = get_bits (edid[0x14], 5, 6);
-	
-	static const double levels[][3] =
-	{
-	    { 0.7,   0.3,    1.0 },
-	    { 0.714, 0.286,  1.0 },
-	    { 1.0,   0.4,    1.4 },
-	    { 0.7,   0.0,    0.7 },
-	};
-
-	info->analog.video_signal_level = levels[bits][0];
-	info->analog.sync_signal_level = levels[bits][1];
-	info->analog.total_signal_level = levels[bits][2];
-
-	info->analog.blank_to_black = get_bit (edid[0x14], 4);
-
-	info->analog.separate_hv_sync = get_bit (edid[0x14], 3);
-	info->analog.composite_sync_on_h = get_bit (edid[0x14], 2);
-	info->analog.composite_sync_on_green = get_bit (edid[0x14], 1);
-
-	info->analog.serration_on_vsync = get_bit (edid[0x14], 0);
-    }
-
-    /* Screen Size / Aspect Ratio */
-    if (edid[0x15] == 0 && edid[0x16] == 0)
-    {
-	info->width_mm = -1;
-	info->height_mm = -1;
-	info->aspect_ratio = -1.0;
-    }
-    else if (edid[0x16] == 0)
-    {
-	info->width_mm = -1;
-	info->height_mm = -1; 
-	info->aspect_ratio = 100.0 / (edid[0x15] + 99);
-    }
-    else if (edid[0x15] == 0)
-    {
-	info->width_mm = -1;
-	info->height_mm = -1;
-	info->aspect_ratio = 100.0 / (edid[0x16] + 99);
-	info->aspect_ratio = 1/info->aspect_ratio; /* portrait */
-    }
-    else
-    {
-	info->width_mm = 10 * edid[0x15];
-	info->height_mm = 10 * edid[0x16];
-    }
-
-    /* Gamma */
-    if (edid[0x17] == 0xFF)
-	info->gamma = -1.0;
-    else
-	info->gamma = (edid[0x17] + 100.0) / 100.0;
-
-    /* Features */
-    info->standby = get_bit (edid[0x18], 7);
-    info->suspend = get_bit (edid[0x18], 6);
-    info->active_off = get_bit (edid[0x18], 5);
-
-    if (info->is_digital)
-    {
-	info->digital.rgb444 = TRUE;
-	if (get_bit (edid[0x18], 3))
-	    info->digital.ycrcb444 = 1;
-	if (get_bit (edid[0x18], 4))
-	    info->digital.ycrcb422 = 1;
-    }
-    else
-    {
-	int bits = get_bits (edid[0x18], 3, 4);
-	ColorType color_type[4] =
-	{
-	    MONOCHROME, RGB, OTHER_COLOR, UNDEFINED_COLOR
-	};
-
-	info->analog.color_type = color_type[bits];
-    }
-
-    info->srgb_is_standard = get_bit (edid[0x18], 2);
-
-    /* In 1.3 this is called "has preferred timing" */
-    info->preferred_timing_includes_native = get_bit (edid[0x18], 1);
-
-    /* FIXME: In 1.3 this indicates whether the monitor accepts GTF */
-    info->continuous_frequency = get_bit (edid[0x18], 0);
-    return TRUE;
-}
-
-static double
-decode_fraction (int high, int low)
-{
-    double result = 0.0;
-    int i;
-
-    high = (high << 2) | low;
-
-    for (i = 0; i < 10; ++i)
-	result += get_bit (high, i) * pow (2, i - 10);
-
-    return result;
-}
-
-static int
-decode_color_characteristics (const uchar *edid, MonitorInfo *info)
-{
-    info->red_x = decode_fraction (edid[0x1b], get_bits (edid[0x19], 6, 7));
-    info->red_y = decode_fraction (edid[0x1c], get_bits (edid[0x19], 5, 4));
-    info->green_x = decode_fraction (edid[0x1d], get_bits (edid[0x19], 2, 3));
-    info->green_y = decode_fraction (edid[0x1e], get_bits (edid[0x19], 0, 1));
-    info->blue_x = decode_fraction (edid[0x1f], get_bits (edid[0x1a], 6, 7));
-    info->blue_y = decode_fraction (edid[0x20], get_bits (edid[0x1a], 4, 5));
-    info->white_x = decode_fraction (edid[0x21], get_bits (edid[0x1a], 2, 3));
-    info->white_y = decode_fraction (edid[0x22], get_bits (edid[0x1a], 0, 1));
-
-    return TRUE;
-}
-
-static int
-decode_established_timings (const uchar *edid, MonitorInfo *info)
-{
-    static const Timing established[][8] = 
-    {
-	{
-	    { 800, 600, 60 },
-	    { 800, 600, 56 },
-	    { 640, 480, 75 },
-	    { 640, 480, 72 },
-	    { 640, 480, 67 },
-	    { 640, 480, 60 },
-	    { 720, 400, 88 },
-	    { 720, 400, 70 }
-	},
-	{
-	    { 1280, 1024, 75 },
-	    { 1024, 768, 75 },
-	    { 1024, 768, 70 },
-	    { 1024, 768, 60 },
-	    { 1024, 768, 87 },
-	    { 832, 624, 75 },
-	    { 800, 600, 75 },
-	    { 800, 600, 72 }
-	},
-	{
-	    { 0, 0, 0 },
-	    { 0, 0, 0 },
-	    { 0, 0, 0 },
-	    { 0, 0, 0 },
-	    { 0, 0, 0 },
-	    { 0, 0, 0 },
-	    { 0, 0, 0 },
-	    { 1152, 870, 75 }
-	},
-    };
-
-    int i, j, idx;
-
-    idx = 0;
-    for (i = 0; i < 3; ++i)
-    {
-	for (j = 0; j < 8; ++j)
-	{
-	    int byte = edid[0x23 + i];
-
-	    if (get_bit (byte, j) && established[i][j].frequency != 0)
-		info->established[idx++] = established[i][j];
-	}
-    }
-    return TRUE;
-}
-
-static int
-decode_standard_timings (const uchar *edid, MonitorInfo *info)
-{
-    int i;
-    
-    for (i = 0; i < 8; i++)
-    {
-	int first = edid[0x26 + 2 * i];
-	int second = edid[0x27 + 2 * i];
-
-	if (first != 0x01 && second != 0x01)
-	{
-	    int w = 8 * (first + 31);
-	    int h = 0;
-
-	    switch (get_bits (second, 6, 7))
-	    {
-	    case 0x00: h = (w / 16) * 10; break;
-	    case 0x01: h = (w / 4) * 3; break;
-	    case 0x02: h = (w / 5) * 4; break;
-	    case 0x03: h = (w / 16) * 9; break;
-	    }
-
-	    info->standard[i].width = w;
-	    info->standard[i].height = h;
-	    info->standard[i].frequency = get_bits (second, 0, 5) + 60;
-	}
-    }
-    
-    return TRUE;
-}
-
-static void
-decode_lf_string (const uchar *s, int n_chars, char *result)
-{
-    int i;
-    for (i = 0; i < n_chars; ++i)
-    {
-	if (s[i] == 0x0a)
-	{
-	    *result++ = '\0';
-	    break;
-	}
-	else if (s[i] == 0x00)
-	{
-	    /* Convert embedded 0's to spaces */
-	    *result++ = ' ';
-	}
-	else
-	{
-	    *result++ = s[i];
-	}
-    }
-}
-
-static void
-decode_display_descriptor (const uchar *desc,
-			   MonitorInfo *info)
-{
-    switch (desc[0x03])
-    {
-    case 0xFC:
-	decode_lf_string (desc + 5, 13, info->dsc_product_name);
-	break;
-    case 0xFF:
-	decode_lf_string (desc + 5, 13, info->dsc_serial_number);
-	break;
-    case 0xFE:
-	decode_lf_string (desc + 5, 13, info->dsc_string);
-	break;
-    case 0xFD:
-	/* Range Limits */
-	break;
-    case 0xFB:
-	/* Color Point */
-	break;
-    case 0xFA:
-	/* Timing Identifications */
-	break;
-    case 0xF9:
-	/* Color Management */
-	break;
-    case 0xF8:
-	/* Timing Codes */
-	break;
-    case 0xF7:
-	/* Established Timings */
-	break;
-    case 0x10:
-	break;
-    }
-}
-
-static void
-decode_detailed_timing (const uchar *timing,
-			DetailedTiming *detailed)
-{
-    int bits;
-    StereoType stereo[] =
-    {
-	NO_STEREO, NO_STEREO, FIELD_RIGHT, FIELD_LEFT,
-	TWO_WAY_RIGHT_ON_EVEN, TWO_WAY_LEFT_ON_EVEN,
-	FOUR_WAY_INTERLEAVED, SIDE_BY_SIDE
-    };
-    
-    detailed->pixel_clock = (timing[0x00] | timing[0x01] << 8) * 10000;
-    detailed->h_addr = timing[0x02] | ((timing[0x04] & 0xf0) << 4);
-    detailed->h_blank = timing[0x03] | ((timing[0x04] & 0x0f) << 8);
-    detailed->v_addr = timing[0x05] | ((timing[0x07] & 0xf0) << 4);
-    detailed->v_blank = timing[0x06] | ((timing[0x07] & 0x0f) << 8);
-    detailed->h_front_porch = timing[0x08] | get_bits (timing[0x0b], 6, 7) << 8;
-    detailed->h_sync = timing[0x09] | get_bits (timing[0x0b], 4, 5) << 8;
-    detailed->v_front_porch =
-	get_bits (timing[0x0a], 4, 7) | get_bits (timing[0x0b], 2, 3) << 4;
-    detailed->v_sync =
-	get_bits (timing[0x0a], 0, 3) | get_bits (timing[0x0b], 0, 1) << 4;
-    detailed->width_mm =  timing[0x0c] | get_bits (timing[0x0e], 4, 7) << 8;
-    detailed->height_mm = timing[0x0d] | get_bits (timing[0x0e], 0, 3) << 8;
-    detailed->right_border = timing[0x0f];
-    detailed->top_border = timing[0x10];
-
-    detailed->interlaced = get_bit (timing[0x11], 7);
-
-    /* Stereo */
-    bits = get_bits (timing[0x11], 5, 6) << 1 | get_bit (timing[0x11], 0);
-    detailed->stereo = stereo[bits];
-
-    /* Sync */
-    bits = timing[0x11];
-
-    detailed->digital_sync = get_bit (bits, 4);
-    if (detailed->digital_sync)
-    {
-	detailed->digital.composite = !get_bit (bits, 3);
-
-	if (detailed->digital.composite)
-	{
-	    detailed->digital.serrations = get_bit (bits, 2);
-	    detailed->digital.negative_vsync = FALSE;
-	}
-	else
-	{
-	    detailed->digital.serrations = FALSE;
-	    detailed->digital.negative_vsync = !get_bit (bits, 2);
-	}
-
-	detailed->digital.negative_hsync = !get_bit (bits, 0);
-    }
-    else
-    {
-	detailed->analog.bipolar = get_bit (bits, 3);
-	detailed->analog.serrations = get_bit (bits, 2);
-	detailed->analog.sync_on_green = !get_bit (bits, 1);
-    }
-}
-
-static int
-decode_descriptors (const uchar *edid, MonitorInfo *info)
-{
-    int i;
-    int timing_idx;
-    
-    timing_idx = 0;
-    
-    for (i = 0; i < 4; ++i)
-    {
-	int index = 0x36 + i * 18;
-
-	if (edid[index + 0] == 0x00 && edid[index + 1] == 0x00)
-	{
-	    decode_display_descriptor (edid + index, info);
-	}
-	else
-	{
-	    decode_detailed_timing (
-		edid + index, &(info->detailed_timings[timing_idx++]));
-	}
-    }
-
-    info->n_detailed_timings = timing_idx;
-
-    return TRUE;
-}
-
-static void
-decode_check_sum (const uchar *edid,
-		  MonitorInfo *info)
-{
-    int i;
-    uchar check = 0;
-
-    for (i = 0; i < 128; ++i)
-	check += edid[i];
-
-    info->checksum = check;
-}
-
-MonitorInfo *
-decode_edid (const uchar *edid)
-{
-    MonitorInfo *info = calloc (1, sizeof (MonitorInfo));
-
-    decode_check_sum (edid, info);
-    
-    if (!decode_header (edid) ||
-        !decode_vendor_and_product_identification (edid, info) ||
-        !decode_edid_version (edid, info) ||
-        !decode_display_parameters (edid, info) ||
-        !decode_color_characteristics (edid, info) ||
-        !decode_established_timings (edid, info) ||
-        !decode_standard_timings (edid, info) ||
-        !decode_descriptors (edid, info)) {
-        free(info);
-	return NULL;
-    }
-    
-    return info;
-}
-
-static const char *
-yesno (int v)
-{
-    return v? "yes" : "no";
-}
-
-void
-dump_monitor_info (MonitorInfo *info)
-{
-    char *s;
-    int i;
-    
-    printf ("Checksum: %d (%s)\n",
-	    info->checksum, info->checksum? "incorrect" : "correct");
-    printf ("Manufacturer Code: %s\n", info->manufacturer_code);
-    printf ("Product Code: 0x%x\n", info->product_code);
-    printf ("Serial Number: %u\n", info->serial_number);
-    
-    if (info->production_week != -1)
-	printf ("Production Week: %d\n", info->production_week);
-    else
-	printf ("Production Week: unspecified\n");
-    
-    if (info->production_year != -1)
-	printf ("Production Year: %d\n", info->production_year);
-    else
-	printf ("Production Year: unspecified\n");
-    
-    if (info->model_year != -1)
-	printf ("Model Year: %d\n", info->model_year);
-    else
-	printf ("Model Year: unspecified\n");
-    
-    printf ("EDID revision: %d.%d\n", info->major_version, info->minor_version);
-    
-    printf ("Display is %s\n", info->is_digital? "digital" : "analog");
-    if (info->is_digital)
-    {
-	const char *interface;
-	if (info->digital.bits_per_primary != -1)
-	    printf ("Bits Per Primary: %d\n", info->digital.bits_per_primary);
-	else
-	    printf ("Bits Per Primary: undefined\n");
-	
-	switch (info->digital.interface)
-	{
-	case DVI: interface = "DVI"; break;
-	case HDMI_A: interface = "HDMI-a"; break;
-	case HDMI_B: interface = "HDMI-b"; break;
-	case MDDI: interface = "MDDI"; break;
-	case DISPLAY_PORT: interface = "DisplayPort"; break;
-	case UNDEFINED: interface = "undefined"; break;
-	default: interface = "unknown"; break;
-	}
-	printf ("Interface: %s\n", interface);
-	
-	printf ("RGB 4:4:4: %s\n", yesno (info->digital.rgb444));
-	printf ("YCrCb 4:4:4: %s\n", yesno (info->digital.ycrcb444));
-	printf ("YCrCb 4:2:2: %s\n", yesno (info->digital.ycrcb422));
-    }
-    else
-    {
-	printf ("Video Signal Level: %f\n", info->analog.video_signal_level);
-	printf ("Sync Signal Level: %f\n", info->analog.sync_signal_level);
-	printf ("Total Signal Level: %f\n", info->analog.total_signal_level);
-	
-	printf ("Blank to Black: %s\n",
-		yesno (info->analog.blank_to_black));
-	printf ("Separate HV Sync: %s\n",
-		yesno (info->analog.separate_hv_sync));
-	printf ("Composite Sync on H: %s\n",
-		yesno (info->analog.composite_sync_on_h));
-	printf ("Serration on VSync: %s\n",
-		yesno (info->analog.serration_on_vsync));
-	
-	switch (info->analog.color_type)
-	{
-	case UNDEFINED_COLOR: s = "undefined"; break;
-	case MONOCHROME: s = "monochrome"; break;
-	case RGB: s = "rgb"; break;
-	case OTHER_COLOR: s = "other color"; break;
-	default: s = "unknown"; break;
-	};
-	
-	printf ("Color: %s\n", s);
-    }
-    
-    if (info->width_mm == -1)
-	printf ("Width: undefined\n");
-    else
-	printf ("Width: %d mm\n", info->width_mm);
-    
-    if (info->height_mm == -1)
-	printf ("Height: undefined\n");
-    else
-	printf ("Height: %d mm\n", info->height_mm);
-    
-    if (info->aspect_ratio > 0)
-	printf ("Aspect Ratio: %f\n", info->aspect_ratio);
-    else
-	printf ("Aspect Ratio: undefined\n");
-    
-    if (info->gamma >= 0)
-	printf ("Gamma: %f\n", info->gamma);
-    else
-	printf ("Gamma: undefined\n");
-    
-    printf ("Standby: %s\n", yesno (info->standby));
-    printf ("Suspend: %s\n", yesno (info->suspend));
-    printf ("Active Off: %s\n", yesno (info->active_off));
-    
-    printf ("SRGB is Standard: %s\n", yesno (info->srgb_is_standard));
-    printf ("Preferred Timing Includes Native: %s\n",
-	    yesno (info->preferred_timing_includes_native));
-    printf ("Continuous Frequency: %s\n", yesno (info->continuous_frequency));
-    
-    printf ("Red X: %f\n", info->red_x);
-    printf ("Red Y: %f\n", info->red_y);
-    printf ("Green X: %f\n", info->green_x);
-    printf ("Green Y: %f\n", info->green_y);
-    printf ("Blue X: %f\n", info->blue_x);
-    printf ("Blue Y: %f\n", info->blue_y);
-    printf ("White X: %f\n", info->white_x);
-    printf ("White Y: %f\n", info->white_y);
-    
-    printf ("Established Timings:\n");
-    
-    for (i = 0; i < 24; ++i)
-    {
-	Timing *timing = &(info->established[i]);
-	
-	if (timing->frequency == 0)
-	    break;
-	
-	printf ("  %d x %d @ %d Hz\n",
-		timing->width, timing->height, timing->frequency);
-	
-    }
-    
-    printf ("Standard Timings:\n");
-    for (i = 0; i < 8; ++i)
-    {
-	Timing *timing = &(info->standard[i]);
-	
-	if (timing->frequency == 0)
-	    break;
-	
-	printf ("  %d x %d @ %d Hz\n",
-		timing->width, timing->height, timing->frequency);
-    }
-    
-    for (i = 0; i < info->n_detailed_timings; ++i)
-    {
-	DetailedTiming *timing = &(info->detailed_timings[i]);
-	const char *s;
-	
-	printf ("Timing%s: \n",
-		(i == 0 && info->preferred_timing_includes_native)?
-		" (Preferred)" : "");
-	printf ("  Pixel Clock: %d\n", timing->pixel_clock);
-	printf ("  H Addressable: %d\n", timing->h_addr);
-	printf ("  H Blank: %d\n", timing->h_blank);
-	printf ("  H Front Porch: %d\n", timing->h_front_porch);
-	printf ("  H Sync: %d\n", timing->h_sync);
-	printf ("  V Addressable: %d\n", timing->v_addr);
-	printf ("  V Blank: %d\n", timing->v_blank);
-	printf ("  V Front Porch: %d\n", timing->v_front_porch);
-	printf ("  V Sync: %d\n", timing->v_sync);
-	printf ("  Width: %d mm\n", timing->width_mm);
-	printf ("  Height: %d mm\n", timing->height_mm);
-	printf ("  Right Border: %d\n", timing->right_border);
-	printf ("  Top Border: %d\n", timing->top_border);
-	switch (timing->stereo)
-	{
-	default:
-	case NO_STEREO:   s = "No Stereo"; break;
-	case FIELD_RIGHT: s = "Field Sequential, Right on Sync"; break;
-	case FIELD_LEFT:  s = "Field Sequential, Left on Sync"; break;
-	case TWO_WAY_RIGHT_ON_EVEN: s = "Two-way, Right on Even"; break;
-	case TWO_WAY_LEFT_ON_EVEN:  s = "Two-way, Left on Even"; break;
-	case FOUR_WAY_INTERLEAVED:  s = "Four-way Interleaved"; break;
-	case SIDE_BY_SIDE:          s = "Side-by-Side"; break;
-	}
-	printf ("  Stereo: %s\n", s);
-	
-	if (timing->digital_sync)
-	{
-	    printf ("  Digital Sync:\n");
-	    printf ("    composite: %s\n", yesno (timing->digital.composite));
-	    printf ("    serrations: %s\n", yesno (timing->digital.serrations));
-	    printf ("    negative vsync: %s\n",
-		    yesno (timing->digital.negative_vsync));
-	    printf ("    negative hsync: %s\n",
-		    yesno (timing->digital.negative_hsync));
-	}
-	else
-	{
-	    printf ("  Analog Sync:\n");
-	    printf ("    bipolar: %s\n", yesno (timing->analog.bipolar));
-	    printf ("    serrations: %s\n", yesno (timing->analog.serrations));
-	    printf ("    sync on green: %s\n", yesno (
-			timing->analog.sync_on_green));
-	}
-    }
-    
-    printf ("Detailed Product information:\n");
-    printf ("  Product Name: %s\n", info->dsc_product_name);
-    printf ("  Serial Number: %s\n", info->dsc_serial_number);
-    printf ("  Unspecified String: %s\n", info->dsc_string);
-}
-
diff --git a/deps/SDL2/src/video/x11/edid.h b/deps/SDL2/src/video/x11/edid.h
deleted file mode 100644
index 8c217eb..0000000
--- a/deps/SDL2/src/video/x11/edid.h
+++ /dev/null
@@ -1,167 +0,0 @@
-typedef unsigned char uchar;
-typedef struct MonitorInfo MonitorInfo;
-typedef struct Timing Timing;
-typedef struct DetailedTiming DetailedTiming;
-
-typedef enum
-{
-    UNDEFINED,
-    DVI,
-    HDMI_A,
-    HDMI_B,
-    MDDI,
-    DISPLAY_PORT
-} Interface;
-
-typedef enum
-{
-    UNDEFINED_COLOR,
-    MONOCHROME,
-    RGB,
-    OTHER_COLOR
-} ColorType;
-
-typedef enum
-{
-    NO_STEREO,
-    FIELD_RIGHT,
-    FIELD_LEFT,
-    TWO_WAY_RIGHT_ON_EVEN,
-    TWO_WAY_LEFT_ON_EVEN,
-    FOUR_WAY_INTERLEAVED,
-    SIDE_BY_SIDE
-} StereoType;
-
-struct Timing
-{
-    int width;
-    int height;
-    int frequency;
-};
-
-struct DetailedTiming
-{
-    int		pixel_clock;
-    int		h_addr;
-    int		h_blank;
-    int		h_sync;
-    int		h_front_porch;
-    int		v_addr;
-    int		v_blank;
-    int		v_sync;
-    int		v_front_porch;
-    int		width_mm;
-    int		height_mm;
-    int		right_border;
-    int		top_border;
-    int		interlaced;
-    StereoType	stereo;
-
-    int		digital_sync;
-    union
-    {
-	struct
-	{
-	    int bipolar;
-	    int serrations;
-	    int sync_on_green;
-	} analog;
-
-	struct
-	{
-	    int composite;
-	    int serrations;
-	    int negative_vsync;
-	    int negative_hsync;
-	} digital;
-    };
-};
-
-struct MonitorInfo
-{
-    int			checksum;
-    char		manufacturer_code[4];
-    int			product_code;
-    unsigned int	serial_number;
-    
-    int			production_week;	/* -1 if not specified */
-    int			production_year;	/* -1 if not specified */
-    int			model_year;		/* -1 if not specified */
-
-    int			major_version;
-    int			minor_version;
-
-    int			is_digital;
-    
-    union
-    {
-	struct
-	{
-	    int		bits_per_primary;
-	    Interface	interface;
-	    int		rgb444;
-	    int		ycrcb444;
-	    int		ycrcb422;
-	} digital;
-
-	struct
-	{
-	    double	video_signal_level;
-	    double	sync_signal_level;
-	    double	total_signal_level;
-
-	    int		blank_to_black;
-
-	    int		separate_hv_sync;
-	    int		composite_sync_on_h;
-	    int		composite_sync_on_green;
-	    int		serration_on_vsync;
-	    ColorType	color_type;
-	} analog;
-    };
-
-    int			width_mm;		/* -1 if not specified */
-    int			height_mm;		/* -1 if not specified */
-    double		aspect_ratio;		/* -1.0 if not specififed */
-
-    double		gamma;			/* -1.0 if not specified */
-
-    int			standby;
-    int			suspend;
-    int			active_off;
-
-    int			srgb_is_standard;
-    int			preferred_timing_includes_native;
-    int			continuous_frequency;
-
-    double		red_x;
-    double		red_y;
-    double		green_x;
-    double		green_y;
-    double		blue_x;
-    double		blue_y;
-    double		white_x;
-    double		white_y;
-
-    Timing		established[24];	/* Terminated by 0x0x0 */
-    Timing		standard[8];
-    
-    int			n_detailed_timings;
-    DetailedTiming	detailed_timings[4];	/* If monitor has a preferred
-						 * mode, it is the first one
-						 * (whether it has, is
-						 * determined by the 
-						 * preferred_timing_includes
-						 * bit.
-						 */
-
-    /* Optional product description */
-    char		dsc_serial_number[14];
-    char		dsc_product_name[14];
-    char		dsc_string[14];		/* Unspecified ASCII data */
-};
-
-MonitorInfo *decode_edid (const uchar *data);
-void         dump_monitor_info (MonitorInfo *info);
-char *       make_display_name (const char        *output_name,
-				const MonitorInfo *info);
diff --git a/deps/SDL2/src/video/x11/imKStoUCS.c b/deps/SDL2/src/video/x11/imKStoUCS.c
deleted file mode 100644
index 5dd6b1d..0000000
--- a/deps/SDL2/src/video/x11/imKStoUCS.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/* Copyright (C) 1994-2003 The XFree86 Project, Inc.  All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is fur-
-nished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
-NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
-NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the XFree86 Project shall not
-be used in advertising or otherwise to promote the sale, use or other deal-
-ings in this Software without prior written authorization from the XFree86
-Project.
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_DRIVER_X11
-
-/* $XFree86: xc/lib/X11/imKStoUCS.c,v 1.4 2003/04/29 11:29:18 pascal Exp $ */
-
-#include <X11/X.h>
-#include "imKStoUCS.h"
-
-static unsigned short const keysym_to_unicode_1a1_1ff[] = {
-    0x0104, 0x02d8, 0x0141, 0x0000, 0x013d, 0x015a, 0x0000,     /* 0x01a0-0x01a7 */
-    0x0000, 0x0160, 0x015e, 0x0164, 0x0179, 0x0000, 0x017d, 0x017b,     /* 0x01a8-0x01af */
-    0x0000, 0x0105, 0x02db, 0x0142, 0x0000, 0x013e, 0x015b, 0x02c7,     /* 0x01b0-0x01b7 */
-    0x0000, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c,     /* 0x01b8-0x01bf */
-    0x0154, 0x0000, 0x0000, 0x0102, 0x0000, 0x0139, 0x0106, 0x0000,     /* 0x01c0-0x01c7 */
-    0x010c, 0x0000, 0x0118, 0x0000, 0x011a, 0x0000, 0x0000, 0x010e,     /* 0x01c8-0x01cf */
-    0x0110, 0x0143, 0x0147, 0x0000, 0x0000, 0x0150, 0x0000, 0x0000,     /* 0x01d0-0x01d7 */
-    0x0158, 0x016e, 0x0000, 0x0170, 0x0000, 0x0000, 0x0162, 0x0000,     /* 0x01d8-0x01df */
-    0x0155, 0x0000, 0x0000, 0x0103, 0x0000, 0x013a, 0x0107, 0x0000,     /* 0x01e0-0x01e7 */
-    0x010d, 0x0000, 0x0119, 0x0000, 0x011b, 0x0000, 0x0000, 0x010f,     /* 0x01e8-0x01ef */
-    0x0111, 0x0144, 0x0148, 0x0000, 0x0000, 0x0151, 0x0000, 0x0000,     /* 0x01f0-0x01f7 */
-    0x0159, 0x016f, 0x0000, 0x0171, 0x0000, 0x0000, 0x0163, 0x02d9      /* 0x01f8-0x01ff */
-};
-
-static unsigned short const keysym_to_unicode_2a1_2fe[] = {
-    0x0126, 0x0000, 0x0000, 0x0000, 0x0000, 0x0124, 0x0000,     /* 0x02a0-0x02a7 */
-    0x0000, 0x0130, 0x0000, 0x011e, 0x0134, 0x0000, 0x0000, 0x0000,     /* 0x02a8-0x02af */
-    0x0000, 0x0127, 0x0000, 0x0000, 0x0000, 0x0000, 0x0125, 0x0000,     /* 0x02b0-0x02b7 */
-    0x0000, 0x0131, 0x0000, 0x011f, 0x0135, 0x0000, 0x0000, 0x0000,     /* 0x02b8-0x02bf */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x010a, 0x0108, 0x0000,     /* 0x02c0-0x02c7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x02c8-0x02cf */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0120, 0x0000, 0x0000,     /* 0x02d0-0x02d7 */
-    0x011c, 0x0000, 0x0000, 0x0000, 0x0000, 0x016c, 0x015c, 0x0000,     /* 0x02d8-0x02df */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x010b, 0x0109, 0x0000,     /* 0x02e0-0x02e7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x02e8-0x02ef */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0121, 0x0000, 0x0000,     /* 0x02f0-0x02f7 */
-    0x011d, 0x0000, 0x0000, 0x0000, 0x0000, 0x016d, 0x015d      /* 0x02f8-0x02ff */
-};
-
-static unsigned short const keysym_to_unicode_3a2_3fe[] = {
-    0x0138, 0x0156, 0x0000, 0x0128, 0x013b, 0x0000,     /* 0x03a0-0x03a7 */
-    0x0000, 0x0000, 0x0112, 0x0122, 0x0166, 0x0000, 0x0000, 0x0000,     /* 0x03a8-0x03af */
-    0x0000, 0x0000, 0x0000, 0x0157, 0x0000, 0x0129, 0x013c, 0x0000,     /* 0x03b0-0x03b7 */
-    0x0000, 0x0000, 0x0113, 0x0123, 0x0167, 0x014a, 0x0000, 0x014b,     /* 0x03b8-0x03bf */
-    0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x012e,     /* 0x03c0-0x03c7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0116, 0x0000, 0x0000, 0x012a,     /* 0x03c8-0x03cf */
-    0x0000, 0x0145, 0x014c, 0x0136, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x03d0-0x03d7 */
-    0x0000, 0x0172, 0x0000, 0x0000, 0x0000, 0x0168, 0x016a, 0x0000,     /* 0x03d8-0x03df */
-    0x0101, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x012f,     /* 0x03e0-0x03e7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0117, 0x0000, 0x0000, 0x012b,     /* 0x03e8-0x03ef */
-    0x0000, 0x0146, 0x014d, 0x0137, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x03f0-0x03f7 */
-    0x0000, 0x0173, 0x0000, 0x0000, 0x0000, 0x0169, 0x016b      /* 0x03f8-0x03ff */
-};
-
-static unsigned short const keysym_to_unicode_4a1_4df[] = {
-    0x3002, 0x3008, 0x3009, 0x3001, 0x30fb, 0x30f2, 0x30a1,     /* 0x04a0-0x04a7 */
-    0x30a3, 0x30a5, 0x30a7, 0x30a9, 0x30e3, 0x30e5, 0x30e7, 0x30c3,     /* 0x04a8-0x04af */
-    0x30fc, 0x30a2, 0x30a4, 0x30a6, 0x30a8, 0x30aa, 0x30ab, 0x30ad,     /* 0x04b0-0x04b7 */
-    0x30af, 0x30b1, 0x30b3, 0x30b5, 0x30b7, 0x30b9, 0x30bb, 0x30bd,     /* 0x04b8-0x04bf */
-    0x30bf, 0x30c1, 0x30c4, 0x30c6, 0x30c8, 0x30ca, 0x30cb, 0x30cc,     /* 0x04c0-0x04c7 */
-    0x30cd, 0x30ce, 0x30cf, 0x30d2, 0x30d5, 0x30d8, 0x30db, 0x30de,     /* 0x04c8-0x04cf */
-    0x30df, 0x30e0, 0x30e1, 0x30e2, 0x30e4, 0x30e6, 0x30e8, 0x30e9,     /* 0x04d0-0x04d7 */
-    0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ef, 0x30f3, 0x309b, 0x309c      /* 0x04d8-0x04df */
-};
-
-static unsigned short const keysym_to_unicode_590_5fe[] = {
-    0x06f0, 0x06f1, 0x06f2, 0x06f3, 0x06f4, 0x06f5, 0x06f6, 0x06f7,     /* 0x0590-0x0597 */
-    0x06f8, 0x06f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x0598-0x059f */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x066a, 0x0670, 0x0679,     /* 0x05a0-0x05a7 */
-
-    0x067e, 0x0686, 0x0688, 0x0691, 0x060c, 0x0000, 0x06d4, 0x0000,     /* 0x05ac-0x05af */
-    0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667,     /* 0x05b0-0x05b7 */
-    0x0668, 0x0669, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f,     /* 0x05b8-0x05bf */
-    0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,     /* 0x05c0-0x05c7 */
-    0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f,     /* 0x05c8-0x05cf */
-    0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637,     /* 0x05d0-0x05d7 */
-    0x0638, 0x0639, 0x063a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x05d8-0x05df */
-    0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647,     /* 0x05e0-0x05e7 */
-    0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f,     /* 0x05e8-0x05ef */
-    0x0650, 0x0651, 0x0652, 0x0653, 0x0654, 0x0655, 0x0698, 0x06a4,     /* 0x05f0-0x05f7 */
-    0x06a9, 0x06af, 0x06ba, 0x06be, 0x06cc, 0x06d2, 0x06c1      /* 0x05f8-0x05fe */
-};
-
-static unsigned short const keysym_to_unicode_680_6ff[] = {
-    0x0492, 0x0496, 0x049a, 0x049c, 0x04a2, 0x04ae, 0x04b0, 0x04b2,     /* 0x0680-0x0687 */
-    0x04b6, 0x04b8, 0x04ba, 0x0000, 0x04d8, 0x04e2, 0x04e8, 0x04ee,     /* 0x0688-0x068f */
-    0x0493, 0x0497, 0x049b, 0x049d, 0x04a3, 0x04af, 0x04b1, 0x04b3,     /* 0x0690-0x0697 */
-    0x04b7, 0x04b9, 0x04bb, 0x0000, 0x04d9, 0x04e3, 0x04e9, 0x04ef,     /* 0x0698-0x069f */
-    0x0000, 0x0452, 0x0453, 0x0451, 0x0454, 0x0455, 0x0456, 0x0457,     /* 0x06a0-0x06a7 */
-    0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x0491, 0x045e, 0x045f,     /* 0x06a8-0x06af */
-    0x2116, 0x0402, 0x0403, 0x0401, 0x0404, 0x0405, 0x0406, 0x0407,     /* 0x06b0-0x06b7 */
-    0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x0490, 0x040e, 0x040f,     /* 0x06b8-0x06bf */
-    0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,     /* 0x06c0-0x06c7 */
-    0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e,     /* 0x06c8-0x06cf */
-    0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432,     /* 0x06d0-0x06d7 */
-    0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a,     /* 0x06d8-0x06df */
-    0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413,     /* 0x06e0-0x06e7 */
-    0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e,     /* 0x06e8-0x06ef */
-    0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412,     /* 0x06f0-0x06f7 */
-    0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a      /* 0x06f8-0x06ff */
-};
-
-static unsigned short const keysym_to_unicode_7a1_7f9[] = {
-    0x0386, 0x0388, 0x0389, 0x038a, 0x03aa, 0x0000, 0x038c,     /* 0x07a0-0x07a7 */
-    0x038e, 0x03ab, 0x0000, 0x038f, 0x0000, 0x0000, 0x0385, 0x2015,     /* 0x07a8-0x07af */
-    0x0000, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03ca, 0x0390, 0x03cc,     /* 0x07b0-0x07b7 */
-    0x03cd, 0x03cb, 0x03b0, 0x03ce, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x07b8-0x07bf */
-    0x0000, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,     /* 0x07c0-0x07c7 */
-    0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f,     /* 0x07c8-0x07cf */
-    0x03a0, 0x03a1, 0x03a3, 0x0000, 0x03a4, 0x03a5, 0x03a6, 0x03a7,     /* 0x07d0-0x07d7 */
-    0x03a8, 0x03a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x07d8-0x07df */
-    0x0000, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,     /* 0x07e0-0x07e7 */
-    0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,     /* 0x07e8-0x07ef */
-    0x03c0, 0x03c1, 0x03c3, 0x03c2, 0x03c4, 0x03c5, 0x03c6, 0x03c7,     /* 0x07f0-0x07f7 */
-    0x03c8, 0x03c9              /* 0x07f8-0x07ff */
-};
-
-static unsigned short const keysym_to_unicode_8a4_8fe[] = {
-    0x2320, 0x2321, 0x0000, 0x231c,     /* 0x08a0-0x08a7 */
-    0x231d, 0x231e, 0x231f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x08a8-0x08af */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x08b0-0x08b7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x2264, 0x2260, 0x2265, 0x222b,     /* 0x08b8-0x08bf */
-    0x2234, 0x0000, 0x221e, 0x0000, 0x0000, 0x2207, 0x0000, 0x0000,     /* 0x08c0-0x08c7 */
-    0x2245, 0x2246, 0x0000, 0x0000, 0x0000, 0x0000, 0x22a2, 0x0000,     /* 0x08c8-0x08cf */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x221a, 0x0000,     /* 0x08d0-0x08d7 */
-    0x0000, 0x0000, 0x2282, 0x2283, 0x2229, 0x222a, 0x2227, 0x2228,     /* 0x08d8-0x08df */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x08e0-0x08e7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x08e8-0x08ef */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0192, 0x0000,     /* 0x08f0-0x08f7 */
-    0x0000, 0x0000, 0x0000, 0x2190, 0x2191, 0x2192, 0x2193      /* 0x08f8-0x08ff */
-};
-
-static unsigned short const keysym_to_unicode_9df_9f8[] = {
-    0x2422,                     /* 0x09d8-0x09df */
-    0x2666, 0x25a6, 0x2409, 0x240c, 0x240d, 0x240a, 0x0000, 0x0000,     /* 0x09e0-0x09e7 */
-    0x240a, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x2500,     /* 0x09e8-0x09ef */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x251c, 0x2524, 0x2534, 0x252c,     /* 0x09f0-0x09f7 */
-    0x2502                      /* 0x09f8-0x09ff */
-};
-
-static unsigned short const keysym_to_unicode_aa1_afe[] = {
-    0x2003, 0x2002, 0x2004, 0x2005, 0x2007, 0x2008, 0x2009,     /* 0x0aa0-0x0aa7 */
-    0x200a, 0x2014, 0x2013, 0x0000, 0x0000, 0x0000, 0x2026, 0x2025,     /* 0x0aa8-0x0aaf */
-    0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215a,     /* 0x0ab0-0x0ab7 */
-    0x2105, 0x0000, 0x0000, 0x2012, 0x2039, 0x2024, 0x203a, 0x0000,     /* 0x0ab8-0x0abf */
-    0x0000, 0x0000, 0x0000, 0x215b, 0x215c, 0x215d, 0x215e, 0x0000,     /* 0x0ac0-0x0ac7 */
-    0x0000, 0x2122, 0x2120, 0x0000, 0x25c1, 0x25b7, 0x25cb, 0x25ad,     /* 0x0ac8-0x0acf */
-    0x2018, 0x2019, 0x201c, 0x201d, 0x211e, 0x0000, 0x2032, 0x2033,     /* 0x0ad0-0x0ad7 */
-    0x0000, 0x271d, 0x0000, 0x220e, 0x25c2, 0x2023, 0x25cf, 0x25ac,     /* 0x0ad8-0x0adf */
-    0x25e6, 0x25ab, 0x25ae, 0x25b5, 0x25bf, 0x2606, 0x2022, 0x25aa,     /* 0x0ae0-0x0ae7 */
-    0x25b4, 0x25be, 0x261a, 0x261b, 0x2663, 0x2666, 0x2665, 0x0000,     /* 0x0ae8-0x0aef */
-    0x2720, 0x2020, 0x2021, 0x2713, 0x2612, 0x266f, 0x266d, 0x2642,     /* 0x0af0-0x0af7 */
-    0x2640, 0x2121, 0x2315, 0x2117, 0x2038, 0x201a, 0x201e      /* 0x0af8-0x0aff */
-};
-
-/* none of the APL keysyms match the Unicode characters */
-
-static unsigned short const keysym_to_unicode_cdf_cfa[] = {
-    0x2017,                     /* 0x0cd8-0x0cdf */
-    0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7,     /* 0x0ce0-0x0ce7 */
-    0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df,     /* 0x0ce8-0x0cef */
-    0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7,     /* 0x0cf0-0x0cf7 */
-    0x05e8, 0x05e9, 0x05ea      /* 0x0cf8-0x0cff */
-};
-
-static unsigned short const keysym_to_unicode_da1_df9[] = {
-    0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,     /* 0x0da0-0x0da7 */
-    0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,     /* 0x0da8-0x0daf */
-    0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,     /* 0x0db0-0x0db7 */
-    0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,     /* 0x0db8-0x0dbf */
-    0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,     /* 0x0dc0-0x0dc7 */
-    0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,     /* 0x0dc8-0x0dcf */
-    0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,     /* 0x0dd0-0x0dd7 */
-    0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0e3e, 0x0e3f,     /* 0x0dd8-0x0ddf */
-    0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,     /* 0x0de0-0x0de7 */
-    0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0000, 0x0000,     /* 0x0de8-0x0def */
-    0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,     /* 0x0df0-0x0df7 */
-    0x0e58, 0x0e59              /* 0x0df8-0x0dff */
-};
-
-static unsigned short const keysym_to_unicode_ea0_eff[] = {
-    0x0000, 0x1101, 0x1101, 0x11aa, 0x1102, 0x11ac, 0x11ad, 0x1103,     /* 0x0ea0-0x0ea7 */
-    0x1104, 0x1105, 0x11b0, 0x11b1, 0x11b2, 0x11b3, 0x11b4, 0x11b5,     /* 0x0ea8-0x0eaf */
-    0x11b6, 0x1106, 0x1107, 0x1108, 0x11b9, 0x1109, 0x110a, 0x110b,     /* 0x0eb0-0x0eb7 */
-    0x110c, 0x110d, 0x110e, 0x110f, 0x1110, 0x1111, 0x1112, 0x1161,     /* 0x0eb8-0x0ebf */
-    0x1162, 0x1163, 0x1164, 0x1165, 0x1166, 0x1167, 0x1168, 0x1169,     /* 0x0ec0-0x0ec7 */
-    0x116a, 0x116b, 0x116c, 0x116d, 0x116e, 0x116f, 0x1170, 0x1171,     /* 0x0ec8-0x0ecf */
-    0x1172, 0x1173, 0x1174, 0x1175, 0x11a8, 0x11a9, 0x11aa, 0x11ab,     /* 0x0ed0-0x0ed7 */
-    0x11ac, 0x11ad, 0x11ae, 0x11af, 0x11b0, 0x11b1, 0x11b2, 0x11b3,     /* 0x0ed8-0x0edf */
-    0x11b4, 0x11b5, 0x11b6, 0x11b7, 0x11b8, 0x11b9, 0x11ba, 0x11bb,     /* 0x0ee0-0x0ee7 */
-    0x11bc, 0x11bd, 0x11be, 0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x0000,     /* 0x0ee8-0x0eef */
-    0x0000, 0x0000, 0x1140, 0x0000, 0x0000, 0x1159, 0x119e, 0x0000,     /* 0x0ef0-0x0ef7 */
-    0x11eb, 0x0000, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x20a9,     /* 0x0ef8-0x0eff */
-};
-
-static unsigned short const keysym_to_unicode_12a1_12fe[] = {
-    0x1e02, 0x1e03, 0x0000, 0x0000, 0x0000, 0x1e0a, 0x0000,     /* 0x12a0-0x12a7 */
-    0x1e80, 0x0000, 0x1e82, 0x1e0b, 0x1ef2, 0x0000, 0x0000, 0x0000,     /* 0x12a8-0x12af */
-    0x1e1e, 0x1e1f, 0x0000, 0x0000, 0x1e40, 0x1e41, 0x0000, 0x1e56,     /* 0x12b0-0x12b7 */
-    0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61,     /* 0x12b8-0x12bf */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x12c0-0x12c7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x12c8-0x12cf */
-    0x0174, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1e6a,     /* 0x12d0-0x12d7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0176, 0x0000,     /* 0x12d8-0x12df */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x12e0-0x12e7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x12e8-0x12ef */
-    0x0175, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1e6b,     /* 0x12f0-0x12f7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0177      /* 0x12f0-0x12ff */
-};
-
-static unsigned short const keysym_to_unicode_13bc_13be[] = {
-    0x0152, 0x0153, 0x0178      /* 0x13b8-0x13bf */
-};
-
-static unsigned short const keysym_to_unicode_14a1_14ff[] = {
-    0x2741, 0x00a7, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab,     /* 0x14a0-0x14a7 */
-    0x2014, 0x002e, 0x055d, 0x002c, 0x2013, 0x058a, 0x2026, 0x055c,     /* 0x14a8-0x14af */
-    0x055b, 0x055e, 0x0531, 0x0561, 0x0532, 0x0562, 0x0533, 0x0563,     /* 0x14b0-0x14b7 */
-    0x0534, 0x0564, 0x0535, 0x0565, 0x0536, 0x0566, 0x0537, 0x0567,     /* 0x14b8-0x14bf */
-    0x0538, 0x0568, 0x0539, 0x0569, 0x053a, 0x056a, 0x053b, 0x056b,     /* 0x14c0-0x14c7 */
-    0x053c, 0x056c, 0x053d, 0x056d, 0x053e, 0x056e, 0x053f, 0x056f,     /* 0x14c8-0x14cf */
-    0x0540, 0x0570, 0x0541, 0x0571, 0x0542, 0x0572, 0x0543, 0x0573,     /* 0x14d0-0x14d7 */
-    0x0544, 0x0574, 0x0545, 0x0575, 0x0546, 0x0576, 0x0547, 0x0577,     /* 0x14d8-0x14df */
-    0x0548, 0x0578, 0x0549, 0x0579, 0x054a, 0x057a, 0x054b, 0x057b,     /* 0x14e0-0x14e7 */
-    0x054c, 0x057c, 0x054d, 0x057d, 0x054e, 0x057e, 0x054f, 0x057f,     /* 0x14e8-0x14ef */
-    0x0550, 0x0580, 0x0551, 0x0581, 0x0552, 0x0582, 0x0553, 0x0583,     /* 0x14f0-0x14f7 */
-    0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x2019, 0x0027,     /* 0x14f8-0x14ff */
-};
-
-static unsigned short const keysym_to_unicode_15d0_15f6[] = {
-    0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10d7,     /* 0x15d0-0x15d7 */
-    0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10dd, 0x10de, 0x10df,     /* 0x15d8-0x15df */
-    0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10e4, 0x10e5, 0x10e6, 0x10e7,     /* 0x15e0-0x15e7 */
-    0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x10ee, 0x10ef,     /* 0x15e8-0x15ef */
-    0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6      /* 0x15f0-0x15f7 */
-};
-
-static unsigned short const keysym_to_unicode_16a0_16f6[] = {
-    0x0000, 0x0000, 0xf0a2, 0x1e8a, 0x0000, 0xf0a5, 0x012c, 0xf0a7,     /* 0x16a0-0x16a7 */
-    0xf0a8, 0x01b5, 0x01e6, 0x0000, 0x0000, 0x0000, 0x0000, 0x019f,     /* 0x16a8-0x16af */
-    0x0000, 0x0000, 0xf0b2, 0x1e8b, 0x01d1, 0xf0b5, 0x012d, 0xf0b7,     /* 0x16b0-0x16b7 */
-    0xf0b8, 0x01b6, 0x01e7, 0x0000, 0x0000, 0x01d2, 0x0000, 0x0275,     /* 0x16b8-0x16bf */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x018f, 0x0000,     /* 0x16c0-0x16c7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x16c8-0x16cf */
-    0x0000, 0x1e36, 0xf0d2, 0xf0d3, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x16d0-0x16d7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x16d8-0x16df */
-    0x0000, 0x1e37, 0xf0e2, 0xf0e3, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x16e0-0x16e7 */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,     /* 0x16e8-0x16ef */
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0259      /* 0x16f0-0x16f6 */
-};
-
-static unsigned short const keysym_to_unicode_1e9f_1eff[] = {
-    0x0303,
-    0x1ea0, 0x1ea1, 0x1ea2, 0x1ea3, 0x1ea4, 0x1ea5, 0x1ea6, 0x1ea7,     /* 0x1ea0-0x1ea7 */
-    0x1ea8, 0x1ea9, 0x1eaa, 0x1eab, 0x1eac, 0x1ead, 0x1eae, 0x1eaf,     /* 0x1ea8-0x1eaf */
-    0x1eb0, 0x1eb1, 0x1eb2, 0x1eb3, 0x1eb4, 0x1eb5, 0x1eb6, 0x1eb7,     /* 0x1eb0-0x1eb7 */
-    0x1eb8, 0x1eb9, 0x1eba, 0x1ebb, 0x1ebc, 0x1ebd, 0x1ebe, 0x1ebf,     /* 0x1eb8-0x1ebf */
-    0x1ec0, 0x1ec1, 0x1ec2, 0x1ec3, 0x1ec4, 0x1ec5, 0x1ec6, 0x1ec7,     /* 0x1ec0-0x1ec7 */
-    0x1ec8, 0x1ec9, 0x1eca, 0x1ecb, 0x1ecc, 0x1ecd, 0x1ece, 0x1ecf,     /* 0x1ec8-0x1ecf */
-    0x1ed0, 0x1ed1, 0x1ed2, 0x1ed3, 0x1ed4, 0x1ed5, 0x1ed6, 0x1ed7,     /* 0x1ed0-0x1ed7 */
-    0x1ed8, 0x1ed9, 0x1eda, 0x1edb, 0x1edc, 0x1edd, 0x1ede, 0x1edf,     /* 0x1ed8-0x1edf */
-    0x1ee0, 0x1ee1, 0x1ee2, 0x1ee3, 0x1ee4, 0x1ee5, 0x1ee6, 0x1ee7,     /* 0x1ee0-0x1ee7 */
-    0x1ee8, 0x1ee9, 0x1eea, 0x1eeb, 0x1eec, 0x1eed, 0x1eee, 0x1eef,     /* 0x1ee8-0x1eef */
-    0x1ef0, 0x1ef1, 0x0300, 0x0301, 0x1ef4, 0x1ef5, 0x1ef6, 0x1ef7,     /* 0x1ef0-0x1ef7 */
-    0x1ef8, 0x1ef9, 0x01a0, 0x01a1, 0x01af, 0x01b0, 0x0309, 0x0323      /* 0x1ef8-0x1eff */
-};
-
-static unsigned short const keysym_to_unicode_20a0_20ac[] = {
-    0x20a0, 0x20a1, 0x20a2, 0x20a3, 0x20a4, 0x20a5, 0x20a6, 0x20a7,     /* 0x20a0-0x20a7 */
-    0x20a8, 0x20a9, 0x20aa, 0x20ab, 0x20ac      /* 0x20a8-0x20af */
-};
-
-unsigned int
-X11_KeySymToUcs4(KeySym keysym)
-{
-    /* 'Unicode keysym' */
-    if ((keysym & 0xff000000) == 0x01000000)
-        return (keysym & 0x00ffffff);
-
-    if (keysym > 0 && keysym < 0x100)
-        return keysym;
-    else if (keysym > 0x1a0 && keysym < 0x200)
-        return keysym_to_unicode_1a1_1ff[keysym - 0x1a1];
-    else if (keysym > 0x2a0 && keysym < 0x2ff)
-        return keysym_to_unicode_2a1_2fe[keysym - 0x2a1];
-    else if (keysym > 0x3a1 && keysym < 0x3ff)
-        return keysym_to_unicode_3a2_3fe[keysym - 0x3a2];
-    else if (keysym > 0x4a0 && keysym < 0x4e0)
-        return keysym_to_unicode_4a1_4df[keysym - 0x4a1];
-    else if (keysym > 0x589 && keysym < 0x5ff)
-        return keysym_to_unicode_590_5fe[keysym - 0x590];
-    else if (keysym > 0x67f && keysym < 0x700)
-        return keysym_to_unicode_680_6ff[keysym - 0x680];
-    else if (keysym > 0x7a0 && keysym < 0x7fa)
-        return keysym_to_unicode_7a1_7f9[keysym - 0x7a1];
-    else if (keysym > 0x8a3 && keysym < 0x8ff)
-        return keysym_to_unicode_8a4_8fe[keysym - 0x8a4];
-    else if (keysym > 0x9de && keysym < 0x9f9)
-        return keysym_to_unicode_9df_9f8[keysym - 0x9df];
-    else if (keysym > 0xaa0 && keysym < 0xaff)
-        return keysym_to_unicode_aa1_afe[keysym - 0xaa1];
-    else if (keysym > 0xcde && keysym < 0xcfb)
-        return keysym_to_unicode_cdf_cfa[keysym - 0xcdf];
-    else if (keysym > 0xda0 && keysym < 0xdfa)
-        return keysym_to_unicode_da1_df9[keysym - 0xda1];
-    else if (keysym > 0xe9f && keysym < 0xf00)
-        return keysym_to_unicode_ea0_eff[keysym - 0xea0];
-    else if (keysym > 0x12a0 && keysym < 0x12ff)
-        return keysym_to_unicode_12a1_12fe[keysym - 0x12a1];
-    else if (keysym > 0x13bb && keysym < 0x13bf)
-        return keysym_to_unicode_13bc_13be[keysym - 0x13bc];
-    else if (keysym > 0x14a0 && keysym < 0x1500)
-        return keysym_to_unicode_14a1_14ff[keysym - 0x14a1];
-    else if (keysym > 0x15cf && keysym < 0x15f7)
-        return keysym_to_unicode_15d0_15f6[keysym - 0x15d0];
-    else if (keysym > 0x169f && keysym < 0x16f7)
-        return keysym_to_unicode_16a0_16f6[keysym - 0x16a0];
-    else if (keysym > 0x1e9e && keysym < 0x1f00)
-        return keysym_to_unicode_1e9f_1eff[keysym - 0x1e9f];
-    else if (keysym > 0x209f && keysym < 0x20ad)
-        return keysym_to_unicode_20a0_20ac[keysym - 0x20a0];
-    else
-        return 0;
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11 */
diff --git a/deps/SDL2/src/video/x11/imKStoUCS.h b/deps/SDL2/src/video/x11/imKStoUCS.h
deleted file mode 100644
index cc684c2..0000000
--- a/deps/SDL2/src/video/x11/imKStoUCS.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _imKStoUCS_h
-#define _imKStoUCS_h
-
-/* Copyright (C) 1994-2003 The XFree86 Project, Inc.  All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is fur-
-nished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
-NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
-NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the XFree86 Project shall not
-be used in advertising or otherwise to promote the sale, use or other deal-
-ings in this Software without prior written authorization from the XFree86
-Project.
-*/
-
-extern unsigned int X11_KeySymToUcs4(KeySym keysym);
-
-#endif /* _imKStoUCS_h */
diff --git a/deps/ebur128/CMakeLists.txt b/deps/ebur128/CMakeLists.txt
deleted file mode 100644
index ffbbc9c..0000000
--- a/deps/ebur128/CMakeLists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-project(ebur128 C)
-
-#### queue.h
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/queuetest.c
-"#include <sys/queue.h>\nLIST_HEAD(listhead, entry) head;\nint main() { return 0; }")
-try_compile(HAS_QUEUE ${CMAKE_CURRENT_BINARY_DIR}
-                      ${CMAKE_CURRENT_BINARY_DIR}/queuetest.c)
-
-set(SUMMARY_HAS_QUEUE ${HAS_QUEUE} CACHE INTERNAL "")
-
-if(ENABLE_INTERNAL_QUEUE_H)
-    include_directories(SYSTEM queue)
-endif()
-
-
-#### speexdsp
-if(NOT DISABLE_SPEEXDSP)
-    find_package(PkgConfig)
-    if(PKG_CONFIG_FOUND)
-        pkg_check_modules(SPEEXDSP speexdsp)
-    endif()
-
-    if(SPEEXDSP_FOUND)
-        include_directories(SYSTEM ${SPEEXDSP_INCLUDE_DIRS})
-        link_directories(${SPEEXDSP_LIBRARY_DIRS})
-        add_definitions(${SPEEXDSP_CFLAGS_OTHER})
-        add_definitions(-DUSE_SPEEX_RESAMPLER)
-    endif()
-endif()
-
-
-if(MSVC)
-    add_definitions(-D_USE_MATH_DEFINES)
-endif()
-
-set(EBUR128_VERSION_MAJOR 1)
-set(EBUR128_VERSION 1.0.0)
-
-add_library(ebur128_static STATIC ebur128.c)
-set_target_properties(ebur128_static PROPERTIES
-    OUTPUT_NAME ebur128)
-set_target_properties(ebur128_static PROPERTIES
-    COMPILE_FLAGS "-fPIC")
-add_library(ebur128 SHARED ebur128.c)
-set_target_properties(ebur128 PROPERTIES
-    SOVERSION ${EBUR128_VERSION_MAJOR}
-    VERSION ${EBUR128_VERSION})
-
-target_link_libraries(ebur128 ${SPEEXDSP_LIBRARIES})
-
-set(SUMMARY_SPEEXDSP_FOUND ${SPEEXDSP_FOUND} CACHE INTERNAL "")
-set(EBUR128_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "")
diff --git a/deps/ebur128/ebur128.c b/deps/ebur128/ebur128.c
deleted file mode 100644
index f323d8c..0000000
--- a/deps/ebur128/ebur128.c
+++ /dev/null
@@ -1,977 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include "ebur128.h"
-
-#include <float.h>
-#include <limits.h>
-#include <math.h> /* You may have to define _USE_MATH_DEFINES if you use MSVC */
-#include <stdio.h>
-#include <stdlib.h>
-
-/* This can be replaced by any BSD-like queue implementation. */
-#include <sys/queue.h>
-
-#ifdef USE_SPEEX_RESAMPLER
-  #include <speex/speex_resampler.h>
-#endif
-
-#define CHECK_ERROR(condition, errorcode, goto_point)                          \
-  if ((condition)) {                                                           \
-    errcode = (errorcode);                                                     \
-    goto goto_point;                                                           \
-  }
-
-SLIST_HEAD(ebur128_double_queue, ebur128_dq_entry);
-struct ebur128_dq_entry {
-  double z;
-  SLIST_ENTRY(ebur128_dq_entry) entries;
-};
-
-struct ebur128_state_internal {
-  /** Filtered audio data (used as ring buffer). */
-  double* audio_data;
-  /** Size of audio_data array. */
-  size_t audio_data_frames;
-  /** Current index for audio_data. */
-  size_t audio_data_index;
-  /** How many frames are needed for a gating block. Will correspond to 400ms
-   *  of audio at initialization, and 100ms after the first block (75% overlap
-   *  as specified in the 2011 revision of BS1770). */
-  unsigned long needed_frames;
-  /** The channel map. Has as many elements as there are channels. */
-  int* channel_map;
-  /** How many samples fit in 100ms (rounded). */
-  unsigned long samples_in_100ms;
-  /** BS.1770 filter coefficients (nominator). */
-  double b[5];
-  /** BS.1770 filter coefficients (denominator). */
-  double a[5];
-  /** BS.1770 filter state. */
-  double v[5][5];
-  /** Linked list of block energies. */
-  struct ebur128_double_queue block_list;
-  /** Linked list of 3s-block energies, used to calculate LRA. */
-  struct ebur128_double_queue short_term_block_list;
-  int use_histogram;
-  unsigned long *block_energy_histogram;
-  unsigned long *short_term_block_energy_histogram;
-  /** Keeps track of when a new short term block is needed. */
-  size_t short_term_frame_counter;
-  /** Maximum sample peak, one per channel */
-  double* sample_peak;
-  /** Maximum true peak, one per channel */
-  double* true_peak;
-#ifdef USE_SPEEX_RESAMPLER
-  SpeexResamplerState* resampler;
-#endif
-  size_t oversample_factor;
-  float* resampler_buffer_input;
-  size_t resampler_buffer_input_frames;
-  float* resampler_buffer_output;
-  size_t resampler_buffer_output_frames;
-};
-
-static double relative_gate = -10.0;
-
-/* Those will be calculated when initializing the library */
-static double relative_gate_factor;
-static double minus_twenty_decibels;
-static double histogram_energies[1000];
-static double histogram_energy_boundaries[1001];
-
-static void ebur128_init_filter(ebur128_state* st) {
-  int i, j;
-
-  double f0 = 1681.974450955533;
-  double G  =    3.999843853973347;
-  double Q  =    0.7071752369554196;
-
-  double K  = tan(M_PI * f0 / (double) st->samplerate);
-  double Vh = pow(10.0, G / 20.0);
-  double Vb = pow(Vh, 0.4996667741545416);
-
-  double pb[3] = {0.0,  0.0, 0.0};
-  double pa[3] = {1.0,  0.0, 0.0};
-  double rb[3] = {1.0, -2.0, 1.0};
-  double ra[3] = {1.0,  0.0, 0.0};
-
-  double a0 =      1.0 + K / Q + K * K      ;
-  pb[0] =     (Vh + Vb * K / Q + K * K) / a0;
-  pb[1] =           2.0 * (K * K -  Vh) / a0;
-  pb[2] =     (Vh - Vb * K / Q + K * K) / a0;
-  pa[1] =           2.0 * (K * K - 1.0) / a0;
-  pa[2] =         (1.0 - K / Q + K * K) / a0;
-
-  /* fprintf(stderr, "%.14f %.14f %.14f %.14f %.14f\n",
-                     b1[0], b1[1], b1[2], a1[1], a1[2]); */
-
-  f0 = 38.13547087602444;
-  Q  =  0.5003270373238773;
-  K  = tan(M_PI * f0 / (double) st->samplerate);
-
-  ra[1] =   2.0 * (K * K - 1.0) / (1.0 + K / Q + K * K);
-  ra[2] = (1.0 - K / Q + K * K) / (1.0 + K / Q + K * K);
-
-  /* fprintf(stderr, "%.14f %.14f\n", a2[1], a2[2]); */
-
-  st->d->b[0] = pb[0] * rb[0];
-  st->d->b[1] = pb[0] * rb[1] + pb[1] * rb[0];
-  st->d->b[2] = pb[0] * rb[2] + pb[1] * rb[1] + pb[2] * rb[0];
-  st->d->b[3] = pb[1] * rb[2] + pb[2] * rb[1];
-  st->d->b[4] = pb[2] * rb[2];
-
-  st->d->a[0] = pa[0] * ra[0];
-  st->d->a[1] = pa[0] * ra[1] + pa[1] * ra[0];
-  st->d->a[2] = pa[0] * ra[2] + pa[1] * ra[1] + pa[2] * ra[0];
-  st->d->a[3] = pa[1] * ra[2] + pa[2] * ra[1];
-  st->d->a[4] = pa[2] * ra[2];
-
-  for (i = 0; i < 5; ++i) {
-    for (j = 0; j < 5; ++j) {
-      st->d->v[i][j] = 0.0;
-    }
-  }
-}
-
-static int ebur128_init_channel_map(ebur128_state* st) {
-  size_t i;
-  st->d->channel_map = (int*) malloc(st->channels * sizeof(int));
-  if (!st->d->channel_map) return EBUR128_ERROR_NOMEM;
-  for (i = 0; i < st->channels; ++i) {
-    switch (i) {
-      case 0:  st->d->channel_map[i] = EBUR128_LEFT;           break;
-      case 1:  st->d->channel_map[i] = EBUR128_RIGHT;          break;
-      case 2:  st->d->channel_map[i] = EBUR128_CENTER;         break;
-      case 3:  st->d->channel_map[i] = EBUR128_UNUSED;         break;
-      case 4:  st->d->channel_map[i] = EBUR128_LEFT_SURROUND;  break;
-      case 5:  st->d->channel_map[i] = EBUR128_RIGHT_SURROUND; break;
-      default: st->d->channel_map[i] = EBUR128_UNUSED;         break;
-    }
-  }
-  return EBUR128_SUCCESS;
-}
-
-#ifdef USE_SPEEX_RESAMPLER
-static int ebur128_init_resampler(ebur128_state* st) {
-  int errcode = EBUR128_SUCCESS;
-
-  if (st->samplerate < 96000) {
-    st->d->oversample_factor = 4;
-  } else if (st->samplerate < 192000) {
-    st->d->oversample_factor = 2;
-  } else {
-    st->d->oversample_factor = 1;
-    st->d->resampler_buffer_input = NULL;
-    st->d->resampler_buffer_output = NULL;
-    st->d->resampler = NULL;
-  }
-
-  st->d->resampler_buffer_input_frames = st->d->samples_in_100ms * 4;
-  st->d->resampler_buffer_input = malloc(st->d->resampler_buffer_input_frames *
-                                      st->channels *
-                                      sizeof(float));
-  CHECK_ERROR(!st->d->resampler_buffer_input, EBUR128_ERROR_NOMEM, exit)
-
-  st->d->resampler_buffer_output_frames =
-                                    st->d->resampler_buffer_input_frames *
-                                    st->d->oversample_factor;
-  st->d->resampler_buffer_output = malloc
-                                      (st->d->resampler_buffer_output_frames *
-                                       st->channels *
-                                       sizeof(float));
-  CHECK_ERROR(!st->d->resampler_buffer_output, EBUR128_ERROR_NOMEM, free_input)
-
-  st->d->resampler = speex_resampler_init
-                 ((spx_uint32_t) st->channels,
-                  (spx_uint32_t) st->samplerate,
-                  (spx_uint32_t) (st->samplerate * st->d->oversample_factor),
-                  8, NULL);
-  CHECK_ERROR(!st->d->resampler, EBUR128_ERROR_NOMEM, free_output)
-
-  return errcode;
-
-free_output:
-  free(st->d->resampler_buffer_output);
-  st->d->resampler_buffer_output = NULL;
-free_input:
-  free(st->d->resampler_buffer_input);
-  st->d->resampler_buffer_input = NULL;
-exit:
-  return errcode;
-}
-
-static void ebur128_destroy_resampler(ebur128_state* st) {
-  free(st->d->resampler_buffer_input);
-  st->d->resampler_buffer_input = NULL;
-  free(st->d->resampler_buffer_output);
-  st->d->resampler_buffer_output = NULL;
-  speex_resampler_destroy(st->d->resampler);
-  st->d->resampler = NULL;
-}
-#endif
-
-ebur128_state* ebur128_init(unsigned int channels,
-                            unsigned long samplerate,
-                            int mode) {
-  int errcode, result;
-  ebur128_state* st;
-  unsigned int i;
-
-  st = (ebur128_state*) malloc(sizeof(ebur128_state));
-  CHECK_ERROR(!st, 0, exit)
-  st->d = (struct ebur128_state_internal*)
-          malloc(sizeof(struct ebur128_state_internal));
-  CHECK_ERROR(!st->d, 0, free_state)
-  st->channels = channels;
-  errcode = ebur128_init_channel_map(st);
-  CHECK_ERROR(errcode, 0, free_internal)
-
-  st->d->sample_peak = (double*) malloc(channels * sizeof(double));
-  CHECK_ERROR(!st->d->sample_peak, 0, free_channel_map)
-  st->d->true_peak = (double*) malloc(channels * sizeof(double));
-  CHECK_ERROR(!st->d->true_peak, 0, free_sample_peak)
-  for (i = 0; i < channels; ++i) {
-    st->d->sample_peak[i] = 0.0;
-    st->d->true_peak[i] = 0.0;
-  }
-
-  st->d->use_histogram = mode & EBUR128_MODE_HISTOGRAM ? 1 : 0;
-
-  st->samplerate = samplerate;
-  st->d->samples_in_100ms = (st->samplerate + 5) / 10;
-  st->mode = mode;
-  if ((mode & EBUR128_MODE_S) == EBUR128_MODE_S) {
-    st->d->audio_data_frames = st->d->samples_in_100ms * 30;
-  } else if ((mode & EBUR128_MODE_M) == EBUR128_MODE_M) {
-    st->d->audio_data_frames = st->d->samples_in_100ms * 4;
-  } else {
-    return NULL;
-  }
-  st->d->audio_data = (double*) malloc(st->d->audio_data_frames *
-                                       st->channels *
-                                       sizeof(double));
-  CHECK_ERROR(!st->d->audio_data, 0, free_true_peak)
-  ebur128_init_filter(st);
-
-  if (st->d->use_histogram) {
-    st->d->block_energy_histogram = malloc(1000 * sizeof(unsigned long));
-    CHECK_ERROR(!st->d->block_energy_histogram, 0, free_audio_data)
-    for (i = 0; i < 1000; ++i) {
-      st->d->block_energy_histogram[i] = 0;
-    }
-  } else {
-    st->d->block_energy_histogram = NULL;
-  }
-  if (st->d->use_histogram) {
-    st->d->short_term_block_energy_histogram = malloc(1000 * sizeof(unsigned long));
-    CHECK_ERROR(!st->d->short_term_block_energy_histogram, 0, free_block_energy_histogram)
-    for (i = 0; i < 1000; ++i) {
-      st->d->short_term_block_energy_histogram[i] = 0;
-    }
-  } else {
-    st->d->short_term_block_energy_histogram = NULL;
-  }
-  SLIST_INIT(&st->d->block_list);
-  SLIST_INIT(&st->d->short_term_block_list);
-  st->d->short_term_frame_counter = 0;
-
-#ifdef USE_SPEEX_RESAMPLER
-  result = ebur128_init_resampler(st);
-  CHECK_ERROR(result, 0, free_short_term_block_energy_histogram)
-#endif
-
-  /* the first block needs 400ms of audio data */
-  st->d->needed_frames = st->d->samples_in_100ms * 4;
-  /* start at the beginning of the buffer */
-  st->d->audio_data_index = 0;
-
-  /* initialize static constants */
-  relative_gate_factor = pow(10.0, relative_gate / 10.0);
-  minus_twenty_decibels = pow(10.0, -20.0 / 10.0);
-  histogram_energy_boundaries[0] = pow(10.0, (-70.0 + 0.691) / 10.0);
-  if (st->d->use_histogram) {
-    for (i = 0; i < 1000; ++i) {
-      histogram_energies[i] = pow(10.0, ((double) i / 10.0 - 69.95 + 0.691) / 10.0);
-    }
-    for (i = 1; i < 1001; ++i) {
-      histogram_energy_boundaries[i] = pow(10.0, ((double) i / 10.0 - 70.0 + 0.691) / 10.0);
-    }
-  }
-
-  return st;
-
-free_short_term_block_energy_histogram:
-  free(st->d->short_term_block_energy_histogram);
-free_block_energy_histogram:
-  free(st->d->block_energy_histogram);
-free_audio_data:
-  free(st->d->audio_data);
-free_true_peak:
-  free(st->d->true_peak);
-free_sample_peak:
-  free(st->d->sample_peak);
-free_channel_map:
-  free(st->d->channel_map);
-free_internal:
-  free(st->d);
-free_state:
-  free(st);
-exit:
-  return NULL;
-}
-
-void ebur128_destroy(ebur128_state** st) {
-  struct ebur128_dq_entry* entry;
-  free((*st)->d->block_energy_histogram);
-  free((*st)->d->short_term_block_energy_histogram);
-  free((*st)->d->audio_data);
-  free((*st)->d->channel_map);
-  free((*st)->d->sample_peak);
-  free((*st)->d->true_peak);
-  while (!SLIST_EMPTY(&(*st)->d->block_list)) {
-    entry = SLIST_FIRST(&(*st)->d->block_list);
-    SLIST_REMOVE_HEAD(&(*st)->d->block_list, entries);
-    free(entry);
-  }
-  while (!SLIST_EMPTY(&(*st)->d->short_term_block_list)) {
-    entry = SLIST_FIRST(&(*st)->d->short_term_block_list);
-    SLIST_REMOVE_HEAD(&(*st)->d->short_term_block_list, entries);
-    free(entry);
-  }
-#ifdef USE_SPEEX_RESAMPLER
-  ebur128_destroy_resampler(*st);
-#endif
-
-  free((*st)->d);
-  free(*st);
-  *st = NULL;
-}
-
-static int ebur128_use_speex_resampler(ebur128_state* st) {
-#ifdef USE_SPEEX_RESAMPLER
-  return ((st->mode & EBUR128_MODE_TRUE_PEAK) == EBUR128_MODE_TRUE_PEAK);
-#else
-  (void) st;
-  return 0;
-#endif
-}
-
-static void ebur128_check_true_peak(ebur128_state* st, size_t frames) {
-#ifdef USE_SPEEX_RESAMPLER
-  size_t c, i;
-  spx_uint32_t in_len = (spx_uint32_t) frames;
-  spx_uint32_t out_len = (spx_uint32_t) st->d->resampler_buffer_output_frames;
-  speex_resampler_process_interleaved_float(
-                      st->d->resampler,
-                      st->d->resampler_buffer_input,  &in_len,
-                      st->d->resampler_buffer_output, &out_len);
-  for (c = 0; c < st->channels; ++c) {
-    for (i = 0; i < out_len; ++i) {
-      if (st->d->resampler_buffer_output[i * st->channels + c] >
-                                                         st->d->true_peak[c]) {
-        st->d->true_peak[c] =
-            st->d->resampler_buffer_output[i * st->channels + c];
-      } else if (-st->d->resampler_buffer_output[i * st->channels + c] >
-                                                         st->d->true_peak[c]) {
-        st->d->true_peak[c] =
-           -st->d->resampler_buffer_output[i * st->channels + c];
-      }
-    }
-  }
-#else
-  (void) st; (void) frames;
-#endif
-}
-
-#ifdef __SSE2_MATH__
-#include <xmmintrin.h>
-#define TURN_ON_FTZ \
-        unsigned int mxcsr = _mm_getcsr(); \
-        _mm_setcsr(mxcsr | _MM_FLUSH_ZERO_ON);
-#define TURN_OFF_FTZ _mm_setcsr(mxcsr);
-#define FLUSH_MANUALLY
-#else
-#warning "manual FTZ is being used, please enable SSE2 (-msse2 -mfpmath=sse)"
-#define TURN_ON_FTZ
-#define TURN_OFF_FTZ
-#define FLUSH_MANUALLY \
-    st->d->v[ci][4] = fabs(st->d->v[ci][4]) < DBL_MIN ? 0.0 : st->d->v[ci][4]; \
-    st->d->v[ci][3] = fabs(st->d->v[ci][3]) < DBL_MIN ? 0.0 : st->d->v[ci][3]; \
-    st->d->v[ci][2] = fabs(st->d->v[ci][2]) < DBL_MIN ? 0.0 : st->d->v[ci][2]; \
-    st->d->v[ci][1] = fabs(st->d->v[ci][1]) < DBL_MIN ? 0.0 : st->d->v[ci][1];
-#endif
-
-#define EBUR128_FILTER(type, min_scale, max_scale)                             \
-static void ebur128_filter_##type(ebur128_state* st, const type* src,          \
-                                  size_t frames) {                             \
-  static double scaling_factor = -((double) min_scale) > (double) max_scale ?  \
-                                 -((double) min_scale) : (double) max_scale;   \
-  double* audio_data = st->d->audio_data + st->d->audio_data_index;            \
-  size_t i, c;                                                                 \
-                                                                               \
-  TURN_ON_FTZ                                                                  \
-                                                                               \
-  if ((st->mode & EBUR128_MODE_SAMPLE_PEAK) == EBUR128_MODE_SAMPLE_PEAK) {     \
-    for (c = 0; c < st->channels; ++c) {                                       \
-      double max = 0.0;                                                        \
-      for (i = 0; i < frames; ++i) {                                           \
-        if (src[i * st->channels + c] > max) {                                 \
-          max =        src[i * st->channels + c];                              \
-        } else if (-src[i * st->channels + c] > max) {                         \
-          max = -1.0 * src[i * st->channels + c];                              \
-        }                                                                      \
-      }                                                                        \
-      max /= scaling_factor;                                                   \
-      if (max > st->d->sample_peak[c]) st->d->sample_peak[c] = max;            \
-    }                                                                          \
-  }                                                                            \
-  if (ebur128_use_speex_resampler(st)) {                                       \
-    for (c = 0; c < st->channels; ++c) {                                       \
-      for (i = 0; i < frames; ++i) {                                           \
-        st->d->resampler_buffer_input[i * st->channels + c] =                  \
-                      (float) (src[i * st->channels + c] / scaling_factor);    \
-      }                                                                        \
-    }                                                                          \
-    ebur128_check_true_peak(st, frames);                                       \
-  }                                                                            \
-  for (c = 0; c < st->channels; ++c) {                                         \
-    int ci = st->d->channel_map[c] - 1;                                        \
-    if (ci < 0) continue;                                                      \
-    else if (ci > 4) ci = 0; /* dual mono */                                   \
-    for (i = 0; i < frames; ++i) {                                             \
-      st->d->v[ci][0] = (double) (src[i * st->channels + c] / scaling_factor)  \
-                   - st->d->a[1] * st->d->v[ci][1]                             \
-                   - st->d->a[2] * st->d->v[ci][2]                             \
-                   - st->d->a[3] * st->d->v[ci][3]                             \
-                   - st->d->a[4] * st->d->v[ci][4];                            \
-      audio_data[i * st->channels + c] =                                       \
-                     st->d->b[0] * st->d->v[ci][0]                             \
-                   + st->d->b[1] * st->d->v[ci][1]                             \
-                   + st->d->b[2] * st->d->v[ci][2]                             \
-                   + st->d->b[3] * st->d->v[ci][3]                             \
-                   + st->d->b[4] * st->d->v[ci][4];                            \
-      st->d->v[ci][4] = st->d->v[ci][3];                                       \
-      st->d->v[ci][3] = st->d->v[ci][2];                                       \
-      st->d->v[ci][2] = st->d->v[ci][1];                                       \
-      st->d->v[ci][1] = st->d->v[ci][0];                                       \
-    }                                                                          \
-    FLUSH_MANUALLY                                                             \
-  }                                                                            \
-  TURN_OFF_FTZ                                                                 \
-}
-EBUR128_FILTER(short, SHRT_MIN, SHRT_MAX)
-EBUR128_FILTER(int, INT_MIN, INT_MAX)
-EBUR128_FILTER(float, -1.0f, 1.0f)
-EBUR128_FILTER(double, -1.0, 1.0)
-
-static double ebur128_energy_to_loudness(double energy) {
-  return 10 * (log(energy) / log(10.0)) - 0.691;
-}
-
-static size_t find_histogram_index(double energy) {
-  size_t index_min = 0;
-  size_t index_max = 1000;
-  size_t index_mid;
-
-  do {
-    index_mid = (index_min + index_max) / 2;
-    if (energy >= histogram_energy_boundaries[index_mid]) {
-      index_min = index_mid;
-    } else {
-      index_max = index_mid;
-    }
-  } while (index_max - index_min != 1);
-
-  return index_min;
-}
-
-static int ebur128_calc_gating_block(ebur128_state* st, size_t frames_per_block,
-                                     double* optional_output) {
-  size_t i, c;
-  double sum = 0.0;
-  double channel_sum;
-  for (c = 0; c < st->channels; ++c) {
-    if (st->d->channel_map[c] == EBUR128_UNUSED) continue;
-    channel_sum = 0.0;
-    if (st->d->audio_data_index < frames_per_block * st->channels) {
-      for (i = 0; i < st->d->audio_data_index / st->channels; ++i) {
-        channel_sum += st->d->audio_data[i * st->channels + c] *
-                       st->d->audio_data[i * st->channels + c];
-      }
-      for (i = st->d->audio_data_frames -
-              (frames_per_block -
-               st->d->audio_data_index / st->channels);
-           i < st->d->audio_data_frames; ++i) {
-        channel_sum += st->d->audio_data[i * st->channels + c] *
-                       st->d->audio_data[i * st->channels + c];
-      }
-    } else {
-      for (i = st->d->audio_data_index / st->channels - frames_per_block;
-           i < st->d->audio_data_index / st->channels;
-           ++i) {
-        channel_sum += st->d->audio_data[i * st->channels + c] *
-                       st->d->audio_data[i * st->channels + c];
-      }
-    }
-    if (st->d->channel_map[c] == EBUR128_LEFT_SURROUND ||
-        st->d->channel_map[c] == EBUR128_RIGHT_SURROUND) {
-      channel_sum *= 1.41;
-    } else if (st->d->channel_map[c] == EBUR128_DUAL_MONO) {
-      channel_sum *= 2.0;
-    }
-    sum += channel_sum;
-  }
-  sum /= (double) frames_per_block;
-  if (optional_output) {
-    *optional_output = sum;
-    return EBUR128_SUCCESS;
-  } else if (sum >= histogram_energy_boundaries[0]) {
-    if (st->d->use_histogram) {
-      ++st->d->block_energy_histogram[find_histogram_index(sum)];
-    } else {
-      struct ebur128_dq_entry* block;
-      block = (struct ebur128_dq_entry*) malloc(sizeof(struct ebur128_dq_entry));
-      if (!block) return EBUR128_ERROR_NOMEM;
-      block->z = sum;
-      SLIST_INSERT_HEAD(&st->d->block_list, block, entries);
-    }
-    return EBUR128_SUCCESS;
-  } else {
-    return EBUR128_SUCCESS;
-  }
-}
-
-int ebur128_set_channel(ebur128_state* st,
-                        unsigned int channel_number,
-                        int value) {
-  if (channel_number >= st->channels) {
-    return 1;
-  }
-  if (value == EBUR128_DUAL_MONO &&
-      (st->channels != 1 || channel_number != 0)) {
-    fprintf(stderr, "EBUR128_DUAL_MONO only works with mono files!\n");
-    return 1;
-  }
-  st->d->channel_map[channel_number] = value;
-  return 0;
-}
-
-int ebur128_change_parameters(ebur128_state* st,
-                              unsigned int channels,
-                              unsigned long samplerate) {
-  int errcode;
-  if (channels == st->channels &&
-      samplerate == st->samplerate) {
-    return 2;
-  }
-  free(st->d->audio_data);
-  st->d->audio_data = NULL;
-
-  if (channels != st->channels) {
-    unsigned int i;
-
-    free(st->d->channel_map); st->d->channel_map = NULL;
-    free(st->d->sample_peak); st->d->sample_peak = NULL;
-    free(st->d->true_peak);   st->d->true_peak = NULL;
-    st->channels = channels;
-
-#ifdef USE_SPEEX_RESAMPLER
-    ebur128_destroy_resampler(st);
-    ebur128_init_resampler(st);
-#endif
-
-    errcode = ebur128_init_channel_map(st);
-    CHECK_ERROR(errcode, EBUR128_ERROR_NOMEM, exit)
-
-    st->d->sample_peak = (double*) malloc(channels * sizeof(double));
-    CHECK_ERROR(!st->d->sample_peak, EBUR128_ERROR_NOMEM, exit)
-    st->d->true_peak = (double*) malloc(channels * sizeof(double));
-    CHECK_ERROR(!st->d->true_peak, EBUR128_ERROR_NOMEM, exit)
-    for (i = 0; i < channels; ++i) {
-      st->d->sample_peak[i] = 0.0;
-      st->d->true_peak[i] = 0.0;
-    }
-  }
-  if (samplerate != st->samplerate) {
-    st->samplerate = samplerate;
-    ebur128_init_filter(st);
-  }
-  if ((st->mode & EBUR128_MODE_S) == EBUR128_MODE_S) {
-    st->d->audio_data_frames = st->d->samples_in_100ms * 30;
-  } else if ((st->mode & EBUR128_MODE_M) == EBUR128_MODE_M) {
-    st->d->audio_data_frames = st->d->samples_in_100ms * 4;
-  } else {
-    return 1;
-  }
-  st->d->audio_data = (double*) malloc(st->d->audio_data_frames *
-                                       st->channels *
-                                       sizeof(double));
-  CHECK_ERROR(!st->d->audio_data, EBUR128_ERROR_NOMEM, exit)
-
-  /* the first block needs 400ms of audio data */
-  st->d->needed_frames = st->d->samples_in_100ms * 4;
-  /* start at the beginning of the buffer */
-  st->d->audio_data_index = 0;
-  /* reset short term frame counter */
-  st->d->short_term_frame_counter = 0;
-
-  return 0;
-
-exit:
-  return 1;
-}
-
-
-static int ebur128_energy_shortterm(ebur128_state* st, double* out);
-#define EBUR128_ADD_FRAMES(type)                                               \
-int ebur128_add_frames_##type(ebur128_state* st,                               \
-                              const type* src, size_t frames) {                \
-  size_t src_index = 0;                                                        \
-  while (frames > 0) {                                                         \
-    if (frames >= st->d->needed_frames) {                                      \
-      ebur128_filter_##type(st, src + src_index, st->d->needed_frames);        \
-      src_index += st->d->needed_frames * st->channels;                        \
-      frames -= st->d->needed_frames;                                          \
-      st->d->audio_data_index += st->d->needed_frames * st->channels;          \
-      /* calculate the new gating block */                                     \
-      if ((st->mode & EBUR128_MODE_I) == EBUR128_MODE_I) {                     \
-        if (ebur128_calc_gating_block(st, st->d->samples_in_100ms * 4, NULL)) {\
-          return EBUR128_ERROR_NOMEM;                                          \
-        }                                                                      \
-      }                                                                        \
-      if ((st->mode & EBUR128_MODE_LRA) == EBUR128_MODE_LRA) {                 \
-        st->d->short_term_frame_counter += st->d->needed_frames;               \
-        if (st->d->short_term_frame_counter == st->d->samples_in_100ms * 30) { \
-          struct ebur128_dq_entry* block;                                      \
-          double st_energy;                                                    \
-          ebur128_energy_shortterm(st, &st_energy);                            \
-          if (st_energy >= histogram_energy_boundaries[0]) {                   \
-            if (st->d->use_histogram) {                                        \
-              ++st->d->short_term_block_energy_histogram[                      \
-                                              find_histogram_index(st_energy)];\
-            } else {                                                           \
-              block = (struct ebur128_dq_entry*)                               \
-                      malloc(sizeof(struct ebur128_dq_entry));                 \
-              if (!block) return EBUR128_ERROR_NOMEM;                          \
-              block->z = st_energy;                                            \
-              SLIST_INSERT_HEAD(&st->d->short_term_block_list, block, entries);\
-            }                                                                  \
-          }                                                                    \
-          st->d->short_term_frame_counter = st->d->samples_in_100ms * 20;      \
-        }                                                                      \
-      }                                                                        \
-      /* 100ms are needed for all blocks besides the first one */              \
-      st->d->needed_frames = st->d->samples_in_100ms;                          \
-      /* reset audio_data_index when buffer full */                            \
-      if (st->d->audio_data_index == st->d->audio_data_frames * st->channels) {\
-        st->d->audio_data_index = 0;                                           \
-      }                                                                        \
-    } else {                                                                   \
-      ebur128_filter_##type(st, src + src_index, frames);                      \
-      st->d->audio_data_index += frames * st->channels;                        \
-      if ((st->mode & EBUR128_MODE_LRA) == EBUR128_MODE_LRA) {                 \
-        st->d->short_term_frame_counter += frames;                             \
-      }                                                                        \
-      st->d->needed_frames -= frames;                                          \
-      frames = 0;                                                              \
-    }                                                                          \
-  }                                                                            \
-  return EBUR128_SUCCESS;                                                      \
-}
-EBUR128_ADD_FRAMES(short)
-EBUR128_ADD_FRAMES(int)
-EBUR128_ADD_FRAMES(float)
-EBUR128_ADD_FRAMES(double)
-
-static int ebur128_gated_loudness(ebur128_state** sts, size_t size,
-                                  double* out) {
-  struct ebur128_dq_entry* it;
-  double relative_threshold = 0.0;
-  double gated_loudness = 0.0;
-  size_t above_thresh_counter = 0;
-  size_t i, j, start_index;
-
-  for (i = 0; i < size; i++) {
-    if (sts[i] && (sts[i]->mode & EBUR128_MODE_I) != EBUR128_MODE_I) {
-      return EBUR128_ERROR_INVALID_MODE;
-    }
-  }
-
-  for (i = 0; i < size; i++) {
-    if (!sts[i]) continue;
-    if (sts[i]->d->use_histogram) {
-      for (j = 0; j < 1000; ++j) {
-        relative_threshold += sts[i]->d->block_energy_histogram[j] *
-                              histogram_energies[j];
-        above_thresh_counter += sts[i]->d->block_energy_histogram[j];
-      }
-    } else {
-      SLIST_FOREACH(it, &sts[i]->d->block_list, entries) {
-        ++above_thresh_counter;
-        relative_threshold += it->z;
-      }
-    }
-  }
-  if (!above_thresh_counter) {
-    *out = -HUGE_VAL;
-    return EBUR128_SUCCESS;
-  }
-  relative_threshold /= (double) above_thresh_counter;
-  relative_threshold *= relative_gate_factor;
-  above_thresh_counter = 0;
-  if (relative_threshold < histogram_energy_boundaries[0]) {
-    start_index = 0;
-  } else {
-    start_index = find_histogram_index(relative_threshold);
-    if (relative_threshold > histogram_energies[start_index]) {
-      ++start_index;
-    }
-  }
-  for (i = 0; i < size; i++) {
-    if (!sts[i]) continue;
-    if (sts[i]->d->use_histogram) {
-      for (j = start_index; j < 1000; ++j) {
-        gated_loudness += sts[i]->d->block_energy_histogram[j] *
-                          histogram_energies[j];
-        above_thresh_counter += sts[i]->d->block_energy_histogram[j];
-      }
-    } else {
-      SLIST_FOREACH(it, &sts[i]->d->block_list, entries) {
-        if (it->z >= relative_threshold) {
-          ++above_thresh_counter;
-          gated_loudness += it->z;
-        }
-      }
-    }
-  }
-  if (!above_thresh_counter) {
-    *out = -HUGE_VAL;
-    return EBUR128_SUCCESS;
-  }
-  gated_loudness /= (double) above_thresh_counter;
-  *out = ebur128_energy_to_loudness(gated_loudness);
-  return EBUR128_SUCCESS;
-}
-
-int ebur128_loudness_global(ebur128_state* st, double* out) {
-  return ebur128_gated_loudness(&st, 1, out);
-}
-
-int ebur128_loudness_global_multiple(ebur128_state** sts, size_t size,
-                                     double* out) {
-  return ebur128_gated_loudness(sts, size, out);
-}
-
-static int ebur128_energy_in_interval(ebur128_state* st,
-                                      size_t interval_frames,
-                                      double* out) {
-  if (interval_frames > st->d->audio_data_frames) {
-    return EBUR128_ERROR_INVALID_MODE;
-  }
-  ebur128_calc_gating_block(st, interval_frames, out);
-  return EBUR128_SUCCESS;
-}
-
-static int ebur128_energy_shortterm(ebur128_state* st, double* out) {
-  return ebur128_energy_in_interval(st, st->d->samples_in_100ms * 30, out);
-}
-
-int ebur128_loudness_momentary(ebur128_state* st, double* out) {
-  double energy;
-  int error = ebur128_energy_in_interval(st, st->d->samples_in_100ms * 4,
-                                         &energy);
-  if (error) {
-    return error;
-  } else if (energy <= 0.0) {
-    *out = -HUGE_VAL;
-    return EBUR128_SUCCESS;
-  }
-  *out = ebur128_energy_to_loudness(energy);
-  return EBUR128_SUCCESS;
-}
-
-int ebur128_loudness_shortterm(ebur128_state* st, double* out) {
-  double energy;
-  int error = ebur128_energy_shortterm(st, &energy);
-  if (error) {
-    return error;
-  } else if (energy <= 0.0) {
-    *out = -HUGE_VAL;
-    return EBUR128_SUCCESS;
-  }
-  *out = ebur128_energy_to_loudness(energy);
-  return EBUR128_SUCCESS;
-}
-
-static int ebur128_double_cmp(const void *p1, const void *p2) {
-  const double* d1 = (const double*) p1;
-  const double* d2 = (const double*) p2;
-  return (*d1 > *d2) - (*d1 < *d2);
-}
-
-/* EBU - TECH 3342 */
-int ebur128_loudness_range_multiple(ebur128_state** sts, size_t size,
-                                    double* out) {
-  size_t i, j;
-  struct ebur128_dq_entry* it;
-  double* stl_vector;
-  size_t stl_size;
-  double* stl_relgated;
-  size_t stl_relgated_size;
-  double stl_power, stl_integrated;
-  /* High and low percentile energy */
-  double h_en, l_en;
-  int use_histogram = 0;
-
-  for (i = 0; i < size; ++i) {
-    if (sts[i]) {
-      if ((sts[i]->mode & EBUR128_MODE_LRA) != EBUR128_MODE_LRA) {
-        return EBUR128_ERROR_INVALID_MODE;
-      }
-      if (i == 0 && sts[i]->mode & EBUR128_MODE_HISTOGRAM) {
-        use_histogram = 1;
-      } else if (use_histogram != !!(sts[i]->mode & EBUR128_MODE_HISTOGRAM)) {
-        return EBUR128_ERROR_INVALID_MODE;
-      }
-    }
-  }
-
-  if (use_histogram) {
-    unsigned long hist[1000] = { 0 };
-    size_t percentile_low, percentile_high;
-    size_t index;
-
-    stl_size = 0;
-    stl_power = 0.0;
-    for (i = 0; i < size; ++i) {
-      if (!sts[i]) continue;
-      for (j = 0; j < 1000; ++j) {
-        hist[j]   += sts[i]->d->short_term_block_energy_histogram[j];
-        stl_size  += sts[i]->d->short_term_block_energy_histogram[j];
-        stl_power += sts[i]->d->short_term_block_energy_histogram[j]
-                     * histogram_energies[j];
-      }
-    }
-    if (!stl_size) {
-      *out = 0.0;
-      return EBUR128_SUCCESS;
-    }
-
-    stl_power /= stl_size;
-    stl_integrated = minus_twenty_decibels * stl_power;
-
-    if (stl_integrated < histogram_energy_boundaries[0]) {
-      index = 0;
-    } else {
-      index = find_histogram_index(stl_integrated);
-      if (stl_integrated > histogram_energies[index]) {
-        ++index;
-      }
-    }
-    stl_size = 0;
-    for (j = index; j < 1000; ++j) {
-      stl_size += hist[j];
-    }
-    if (!stl_size) {
-      *out = 0.0;
-      return EBUR128_SUCCESS;
-    }
-
-    percentile_low  = (size_t) ((stl_size - 1) * 0.1 + 0.5);
-    percentile_high = (size_t) ((stl_size - 1) * 0.95 + 0.5);
-
-    stl_size = 0;
-    j = index;
-    while (stl_size <= percentile_low) {
-      stl_size += hist[j++];
-    }
-    l_en = histogram_energies[j - 1];
-    while (stl_size <= percentile_high) {
-      stl_size += hist[j++];
-    }
-    h_en = histogram_energies[j - 1];
-    *out = ebur128_energy_to_loudness(h_en) - ebur128_energy_to_loudness(l_en);
-    return EBUR128_SUCCESS;
-
-  } else {
-    stl_size = 0;
-    for (i = 0; i < size; ++i) {
-      if (!sts[i]) continue;
-      SLIST_FOREACH(it, &sts[i]->d->short_term_block_list, entries) {
-        ++stl_size;
-      }
-    }
-    if (!stl_size) {
-      *out = 0.0;
-      return EBUR128_SUCCESS;
-    }
-    stl_vector = (double*) malloc(stl_size * sizeof(double));
-    if (!stl_vector)
-      return EBUR128_ERROR_NOMEM;
-
-    for (j = 0, i = 0; i < size; ++i) {
-      if (!sts[i]) continue;
-      SLIST_FOREACH(it, &sts[i]->d->short_term_block_list, entries) {
-        stl_vector[j] = it->z;
-        ++j;
-      }
-    }
-    qsort(stl_vector, stl_size, sizeof(double), ebur128_double_cmp);
-    stl_power = 0.0;
-    for (i = 0; i < stl_size; ++i) {
-      stl_power += stl_vector[i];
-    }
-    stl_power /= (double) stl_size;
-    stl_integrated = minus_twenty_decibels * stl_power;
-
-    stl_relgated = stl_vector;
-    stl_relgated_size = stl_size;
-    while (stl_relgated_size > 0 && *stl_relgated < stl_integrated) {
-      ++stl_relgated;
-      --stl_relgated_size;
-    }
-
-    if (stl_relgated_size) {
-      h_en = stl_relgated[(size_t) ((stl_relgated_size - 1) * 0.95 + 0.5)];
-      l_en = stl_relgated[(size_t) ((stl_relgated_size - 1) * 0.1 + 0.5)];
-      free(stl_vector);
-      *out = ebur128_energy_to_loudness(h_en) - ebur128_energy_to_loudness(l_en);
-      return EBUR128_SUCCESS;
-    } else {
-      free(stl_vector);
-      *out = 0.0;
-      return EBUR128_SUCCESS;
-    }
-  }
-}
-
-int ebur128_loudness_range(ebur128_state* st, double* out) {
-  return ebur128_loudness_range_multiple(&st, 1, out);
-}
-
-int ebur128_sample_peak(ebur128_state* st,
-                        unsigned int channel_number,
-                        double* out) {
-  if ((st->mode & EBUR128_MODE_SAMPLE_PEAK) != EBUR128_MODE_SAMPLE_PEAK) {
-    return EBUR128_ERROR_INVALID_MODE;
-  } else if (channel_number >= st->channels) {
-    return EBUR128_ERROR_INVALID_CHANNEL_INDEX;
-  }
-  *out = st->d->sample_peak[channel_number];
-  return EBUR128_SUCCESS;
-}
-
-#ifdef USE_SPEEX_RESAMPLER
-int ebur128_true_peak(ebur128_state* st,
-                      unsigned int channel_number,
-                      double* out) {
-  if ((st->mode & EBUR128_MODE_TRUE_PEAK) != EBUR128_MODE_TRUE_PEAK) {
-    return EBUR128_ERROR_INVALID_MODE;
-  } else if (channel_number >= st->channels) {
-    return EBUR128_ERROR_INVALID_CHANNEL_INDEX;
-  }
-  *out = st->d->true_peak[channel_number] > st->d->sample_peak[channel_number]
-       ? st->d->true_peak[channel_number]
-       : st->d->sample_peak[channel_number];
-  return EBUR128_SUCCESS;
-}
-#endif
diff --git a/deps/ebur128/ebur128.h b/deps/ebur128/ebur128.h
deleted file mode 100644
index 2a32e27..0000000
--- a/deps/ebur128/ebur128.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#ifndef EBUR128_H_
-#define EBUR128_H_
-
-/** \file ebur128.h
- *  \brief libebur128 - a library for loudness measurement according to
- *         the EBU R128 standard.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>       /* for size_t */
-
-/** \enum channel
- *  Use these values when setting the channel map with ebur128_set_channel().
- */
-enum channel {
-  EBUR128_UNUSED = 0,     /**< unused channel (for example LFE channel) */
-  EBUR128_LEFT,           /**< left channel */
-  EBUR128_RIGHT,          /**< right channel */
-  EBUR128_CENTER,         /**< center channel */
-  EBUR128_LEFT_SURROUND,  /**< left surround channel */
-  EBUR128_RIGHT_SURROUND, /**< right surround channel */
-  EBUR128_DUAL_MONO       /**< a channel that is counted twice */
-};
-
-/** \enum error
- *  Error return values.
- */
-enum error {
-  EBUR128_SUCCESS = 0,
-  EBUR128_ERROR_NOMEM,
-  EBUR128_ERROR_INVALID_MODE,
-  EBUR128_ERROR_INVALID_CHANNEL_INDEX,
-  EBUR128_ERROR_NO_CHANGE
-};
-
-/** \enum mode
- *  Use these values in ebur128_init (or'ed). Try to use the lowest possible
- *  modes that suit your needs, as performance will be better.
- */
-enum mode {
-  /** can call ebur128_loudness_momentary */
-  EBUR128_MODE_M           = (1 << 0),
-  /** can call ebur128_loudness_shortterm */
-  EBUR128_MODE_S           = (1 << 1) | EBUR128_MODE_M,
-  /** can call ebur128_gated_loudness_* */
-  EBUR128_MODE_I           = (1 << 2) | EBUR128_MODE_M,
-  /** can call ebur128_loudness_range */
-  EBUR128_MODE_LRA         = (1 << 3) | EBUR128_MODE_S,
-  /** can call ebur128_sample_peak */
-  EBUR128_MODE_SAMPLE_PEAK = (1 << 4) | EBUR128_MODE_M,
-  /** can call ebur128_true_peak */
-  EBUR128_MODE_TRUE_PEAK   = (1 << 5) | EBUR128_MODE_M
-                                      | EBUR128_MODE_SAMPLE_PEAK,
-  /** uses histogram algorithm to calculate loudness */
-  EBUR128_MODE_HISTOGRAM   = (1 << 6)
-};
-
-/** forward declaration of ebur128_state_internal */
-struct ebur128_state_internal;
-
-/** \brief Contains information about the state of a loudness measurement.
- *
- *  You should not need to modify this struct directly.
- */
-typedef struct {
-  int mode;                           /**< The current mode. */
-  unsigned int channels;              /**< The number of channels. */
-  unsigned long samplerate;           /**< The sample rate. */
-  struct ebur128_state_internal* d;   /**< Internal state. */
-} ebur128_state;
-
-/** \brief Initialize library state.
- *
- *  @param channels the number of channels.
- *  @param samplerate the sample rate.
- *  @param mode see the mode enum for possible values.
- *  @return an initialized library state.
- */
-ebur128_state* ebur128_init(unsigned int channels,
-                            unsigned long samplerate,
-                            int mode);
-
-/** \brief Destroy library state.
- *
- *  @param st pointer to a library state.
- */
-void ebur128_destroy(ebur128_state** st);
-
-/** \brief Set channel type.
- *
- *  The default is:
- *  - 0 -> EBUR128_LEFT
- *  - 1 -> EBUR128_RIGHT
- *  - 2 -> EBUR128_CENTER
- *  - 3 -> EBUR128_UNUSED
- *  - 4 -> EBUR128_LEFT_SURROUND
- *  - 5 -> EBUR128_RIGHT_SURROUND
- *
- *  @param st library state.
- *  @param channel_number zero based channel index.
- *  @param value channel type from the "channel" enum.
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_INVALID_CHANNEL_INDEX if invalid channel index.
- */
-int ebur128_set_channel(ebur128_state* st,
-                        unsigned int channel_number,
-                        int value);
-
-/** \brief Change library parameters.
- *
- *  Note that the channel map will be reset when setting a different number of
- *  channels. The current unfinished block will be lost.
- *
- *  @param st library state.
- *  @param channels new number of channels.
- *  @param samplerate new sample rate.
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_NOMEM on memory allocation error. The state will be
- *      invalid and must be destroyed.
- *    - EBUR128_ERROR_NO_CHANGE if channels and sample rate were not changed.
- */
-int ebur128_change_parameters(ebur128_state* st,
-                              unsigned int channels,
-                              unsigned long samplerate);
-
-/** \brief Add frames to be processed.
- *
- *  @param st library state.
- *  @param src array of source frames. Channels must be interleaved.
- *  @param frames number of frames. Not number of samples!
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_NOMEM on memory allocation error.
- */
-int ebur128_add_frames_short(ebur128_state* st,
-                             const short* src,
-                             size_t frames);
-/** \brief See \ref ebur128_add_frames_short */
-int ebur128_add_frames_int(ebur128_state* st,
-                             const int* src,
-                             size_t frames);
-/** \brief See \ref ebur128_add_frames_short */
-int ebur128_add_frames_float(ebur128_state* st,
-                             const float* src,
-                             size_t frames);
-/** \brief See \ref ebur128_add_frames_short */
-int ebur128_add_frames_double(ebur128_state* st,
-                             const double* src,
-                             size_t frames);
-
-/** \brief Get global integrated loudness in LUFS.
- *
- *  @param st library state.
- *  @param out integrated loudness in LUFS. -HUGE_VAL if result is negative
- *             infinity.
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_I" has not been set.
- */
-int ebur128_loudness_global(ebur128_state* st, double* out);
-/** \brief Get global integrated loudness in LUFS across multiple instances.
- *
- *  @param sts array of library states.
- *  @param size length of sts
- *  @param out integrated loudness in LUFS. -HUGE_VAL if result is negative
- *             infinity.
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_I" has not been set.
- */
-int ebur128_loudness_global_multiple(ebur128_state** sts,
-                                     size_t size,
-                                     double* out);
-
-/** \brief Get momentary loudness (last 400ms) in LUFS.
- *
- *  @param st library state.
- *  @param out momentary loudness in LUFS. -HUGE_VAL if result is negative
- *             infinity.
- *  @return
- *    - EBUR128_SUCCESS on success.
- */
-int ebur128_loudness_momentary(ebur128_state* st, double* out);
-/** \brief Get short-term loudness (last 3s) in LUFS.
- *
- *  @param st library state.
- *  @param out short-term loudness in LUFS. -HUGE_VAL if result is negative
- *             infinity.
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_S" has not been set.
- */
-int ebur128_loudness_shortterm(ebur128_state* st, double* out);
-
-/** \brief Get loudness range (LRA) of programme in LU.
- *
- *  Calculates loudness range according to EBU 3342.
- *
- *  @param st library state.
- *  @param out loudness range (LRA) in LU. Will not be changed in case of
- *             error. EBUR128_ERROR_NOMEM or EBUR128_ERROR_INVALID_MODE will be
- *             returned in this case.
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_NOMEM in case of memory allocation error.
- *    - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_LRA" has not been set.
- */
-int ebur128_loudness_range(ebur128_state* st, double* out);
-/** \brief Get loudness range (LRA) in LU across multiple instances.
- *
- *  Calculates loudness range according to EBU 3342.
- *
- *  @param sts array of library states.
- *  @param size length of sts
- *  @param out loudness range (LRA) in LU. Will not be changed in case of
- *             error. EBUR128_ERROR_NOMEM or EBUR128_ERROR_INVALID_MODE will be
- *             returned in this case.
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_NOMEM in case of memory allocation error.
- *    - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_LRA" has not been set.
- */
-int ebur128_loudness_range_multiple(ebur128_state** sts,
-                                    size_t size,
-                                    double* out);
-
-/** \brief Get maximum sample peak of selected channel in float format.
- *
- *  @param st library state
- *  @param channel_number channel to analyse
- *  @param out maximum sample peak in float format (1.0 is 0 dBFS)
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_SAMPLE_PEAK" has not
- *      been set.
- *    - EBUR128_ERROR_INVALID_CHANNEL_INDEX if invalid channel index.
- */
-int ebur128_sample_peak(ebur128_state* st,
-                        unsigned int channel_number,
-                        double* out);
-
-/** \brief Get maximum true peak of selected channel in float format.
- *
- *  Uses the Speex resampler with quality level 8 to calculate true peak. Will
- *  oversample 4x for sample rates < 96000 Hz, 2x for sample rates < 192000 Hz
- *  and leave the signal unchanged for 192000 Hz.
- *
- *  @param st library state
- *  @param channel_number channel to analyse
- *  @param out maximum true peak in float format (1.0 is 0 dBFS)
- *  @return
- *    - EBUR128_SUCCESS on success.
- *    - EBUR128_ERROR_INVALID_MODE if mode "EBUR128_MODE_TRUE_PEAK" has not
- *      been set.
- *    - EBUR128_ERROR_INVALID_CHANNEL_INDEX if invalid channel index.
- */
-int ebur128_true_peak(ebur128_state* st,
-                      unsigned int channel_number,
-                      double* out);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* EBUR128_H_ */
diff --git a/deps/ebur128/queue/sys/queue.h b/deps/ebur128/queue/sys/queue.h
deleted file mode 100644
index daf4553..0000000
--- a/deps/ebur128/queue/sys/queue.h
+++ /dev/null
@@ -1,574 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)queue.h	8.5 (Berkeley) 8/20/94
- */
-
-#ifndef	_SYS_QUEUE_H_
-#define	_SYS_QUEUE_H_
-
-/*
- * This file defines five types of data structures: singly-linked lists,
- * lists, simple queues, tail queues, and circular queues.
- *
- * A singly-linked list is headed by a single forward pointer. The
- * elements are singly linked for minimum space and pointer manipulation
- * overhead at the expense of O(n) removal for arbitrary elements. New
- * elements can be added to the list after an existing element or at the
- * head of the list.  Elements being removed from the head of the list
- * should use the explicit macro for this purpose for optimum
- * efficiency. A singly-linked list may only be traversed in the forward
- * direction.  Singly-linked lists are ideal for applications with large
- * datasets and few or no removals or for implementing a LIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may only be traversed in the forward direction.
- *
- * A simple queue is headed by a pair of pointers, one the head of the
- * list and the other to the tail of the list. The elements are singly
- * linked to save space, so elements can only be removed from the
- * head of the list. New elements can be added to the list after
- * an existing element, at the head of the list, or at the end of the
- * list. A simple queue may only be traversed in the forward direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may be traversed in either direction.
- *
- * A circle queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or after
- * an existing element, at the head of the list, or at the end of the list.
- * A circle queue may be traversed in either direction, but has a more
- * complex end of list detection.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- */
-
-/*
- * List definitions.
- */
-#define	LIST_HEAD(name, type)						\
-struct name {								\
-	struct type *lh_first;	/* first element */			\
-}
-
-#define	LIST_HEAD_INITIALIZER(head)					\
-	{ NULL }
-
-#define	LIST_ENTRY(type)						\
-struct {								\
-	struct type *le_next;	/* next element */			\
-	struct type **le_prev;	/* address of previous next element */	\
-}
-
-/*
- * List functions.
- */
-#define	LIST_INIT(head) do {						\
-	(head)->lh_first = NULL;					\
-} while (/*CONSTCOND*/0)
-
-#define	LIST_INSERT_AFTER(listelm, elm, field) do {			\
-	if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)	\
-		(listelm)->field.le_next->field.le_prev =		\
-		    &(elm)->field.le_next;				\
-	(listelm)->field.le_next = (elm);				\
-	(elm)->field.le_prev = &(listelm)->field.le_next;		\
-} while (/*CONSTCOND*/0)
-
-#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
-	(elm)->field.le_prev = (listelm)->field.le_prev;		\
-	(elm)->field.le_next = (listelm);				\
-	*(listelm)->field.le_prev = (elm);				\
-	(listelm)->field.le_prev = &(elm)->field.le_next;		\
-} while (/*CONSTCOND*/0)
-
-#define	LIST_INSERT_HEAD(head, elm, field) do {				\
-	if (((elm)->field.le_next = (head)->lh_first) != NULL)		\
-		(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
-	(head)->lh_first = (elm);					\
-	(elm)->field.le_prev = &(head)->lh_first;			\
-} while (/*CONSTCOND*/0)
-
-#define	LIST_REMOVE(elm, field) do {					\
-	if ((elm)->field.le_next != NULL)				\
-		(elm)->field.le_next->field.le_prev = 			\
-		    (elm)->field.le_prev;				\
-	*(elm)->field.le_prev = (elm)->field.le_next;			\
-} while (/*CONSTCOND*/0)
-
-#define	LIST_FOREACH(var, head, field)					\
-	for ((var) = ((head)->lh_first);				\
-		(var);							\
-		(var) = ((var)->field.le_next))
-
-/*
- * List access methods.
- */
-#define	LIST_EMPTY(head)		((head)->lh_first == NULL)
-#define	LIST_FIRST(head)		((head)->lh_first)
-#define	LIST_NEXT(elm, field)		((elm)->field.le_next)
-
-
-/*
- * Singly-linked List definitions.
- */
-#define	SLIST_HEAD(name, type)						\
-struct name {								\
-	struct type *slh_first;	/* first element */			\
-}
-
-#define	SLIST_HEAD_INITIALIZER(head)					\
-	{ NULL }
-
-#define	SLIST_ENTRY(type)						\
-struct {								\
-	struct type *sle_next;	/* next element */			\
-}
-
-/*
- * Singly-linked List functions.
- */
-#define	SLIST_INIT(head) do {						\
-	(head)->slh_first = NULL;					\
-} while (/*CONSTCOND*/0)
-
-#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
-	(elm)->field.sle_next = (slistelm)->field.sle_next;		\
-	(slistelm)->field.sle_next = (elm);				\
-} while (/*CONSTCOND*/0)
-
-#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
-	(elm)->field.sle_next = (head)->slh_first;			\
-	(head)->slh_first = (elm);					\
-} while (/*CONSTCOND*/0)
-
-#define	SLIST_REMOVE_HEAD(head, field) do {				\
-	(head)->slh_first = (head)->slh_first->field.sle_next;		\
-} while (/*CONSTCOND*/0)
-
-#define	SLIST_REMOVE(head, elm, type, field) do {			\
-	if ((head)->slh_first == (elm)) {				\
-		SLIST_REMOVE_HEAD((head), field);			\
-	}								\
-	else {								\
-		struct type *curelm = (head)->slh_first;		\
-		while(curelm->field.sle_next != (elm))			\
-			curelm = curelm->field.sle_next;		\
-		curelm->field.sle_next =				\
-		    curelm->field.sle_next->field.sle_next;		\
-	}								\
-} while (/*CONSTCOND*/0)
-
-#define	SLIST_FOREACH(var, head, field)					\
-	for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
-
-/*
- * Singly-linked List access methods.
- */
-#define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
-#define	SLIST_FIRST(head)	((head)->slh_first)
-#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
-
-
-/*
- * Singly-linked Tail queue declarations.
- */
-#define	STAILQ_HEAD(name, type)					\
-struct name {								\
-	struct type *stqh_first;	/* first element */			\
-	struct type **stqh_last;	/* addr of last next element */		\
-}
-
-#define	STAILQ_HEAD_INITIALIZER(head)					\
-	{ NULL, &(head).stqh_first }
-
-#define	STAILQ_ENTRY(type)						\
-struct {								\
-	struct type *stqe_next;	/* next element */			\
-}
-
-/*
- * Singly-linked Tail queue functions.
- */
-#define	STAILQ_INIT(head) do {						\
-	(head)->stqh_first = NULL;					\
-	(head)->stqh_last = &(head)->stqh_first;				\
-} while (/*CONSTCOND*/0)
-
-#define	STAILQ_INSERT_HEAD(head, elm, field) do {			\
-	if (((elm)->field.stqe_next = (head)->stqh_first) == NULL)	\
-		(head)->stqh_last = &(elm)->field.stqe_next;		\
-	(head)->stqh_first = (elm);					\
-} while (/*CONSTCOND*/0)
-
-#define	STAILQ_INSERT_TAIL(head, elm, field) do {			\
-	(elm)->field.stqe_next = NULL;					\
-	*(head)->stqh_last = (elm);					\
-	(head)->stqh_last = &(elm)->field.stqe_next;			\
-} while (/*CONSTCOND*/0)
-
-#define	STAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
-	if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
-		(head)->stqh_last = &(elm)->field.stqe_next;		\
-	(listelm)->field.stqe_next = (elm);				\
-} while (/*CONSTCOND*/0)
-
-#define	STAILQ_REMOVE_HEAD(head, field) do {				\
-	if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
-		(head)->stqh_last = &(head)->stqh_first;			\
-} while (/*CONSTCOND*/0)
-
-#define	STAILQ_REMOVE(head, elm, type, field) do {			\
-	if ((head)->stqh_first == (elm)) {				\
-		STAILQ_REMOVE_HEAD((head), field);			\
-	} else {							\
-		struct type *curelm = (head)->stqh_first;		\
-		while (curelm->field.stqe_next != (elm))			\
-			curelm = curelm->field.stqe_next;		\
-		if ((curelm->field.stqe_next =				\
-			curelm->field.stqe_next->field.stqe_next) == NULL) \
-			    (head)->stqh_last = &(curelm)->field.stqe_next; \
-	}								\
-} while (/*CONSTCOND*/0)
-
-#define	STAILQ_FOREACH(var, head, field)				\
-	for ((var) = ((head)->stqh_first);				\
-		(var);							\
-		(var) = ((var)->field.stqe_next))
-
-#define	STAILQ_CONCAT(head1, head2) do {				\
-	if (!STAILQ_EMPTY((head2))) {					\
-		*(head1)->stqh_last = (head2)->stqh_first;		\
-		(head1)->stqh_last = (head2)->stqh_last;		\
-		STAILQ_INIT((head2));					\
-	}								\
-} while (/*CONSTCOND*/0)
-
-/*
- * Singly-linked Tail queue access methods.
- */
-#define	STAILQ_EMPTY(head)	((head)->stqh_first == NULL)
-#define	STAILQ_FIRST(head)	((head)->stqh_first)
-#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
-
-
-/*
- * Simple queue definitions.
- */
-#define	SIMPLEQ_HEAD(name, type)					\
-struct name {								\
-	struct type *sqh_first;	/* first element */			\
-	struct type **sqh_last;	/* addr of last next element */		\
-}
-
-#define	SIMPLEQ_HEAD_INITIALIZER(head)					\
-	{ NULL, &(head).sqh_first }
-
-#define	SIMPLEQ_ENTRY(type)						\
-struct {								\
-	struct type *sqe_next;	/* next element */			\
-}
-
-/*
- * Simple queue functions.
- */
-#define	SIMPLEQ_INIT(head) do {						\
-	(head)->sqh_first = NULL;					\
-	(head)->sqh_last = &(head)->sqh_first;				\
-} while (/*CONSTCOND*/0)
-
-#define	SIMPLEQ_INSERT_HEAD(head, elm, field) do {			\
-	if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)	\
-		(head)->sqh_last = &(elm)->field.sqe_next;		\
-	(head)->sqh_first = (elm);					\
-} while (/*CONSTCOND*/0)
-
-#define	SIMPLEQ_INSERT_TAIL(head, elm, field) do {			\
-	(elm)->field.sqe_next = NULL;					\
-	*(head)->sqh_last = (elm);					\
-	(head)->sqh_last = &(elm)->field.sqe_next;			\
-} while (/*CONSTCOND*/0)
-
-#define	SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
-	if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
-		(head)->sqh_last = &(elm)->field.sqe_next;		\
-	(listelm)->field.sqe_next = (elm);				\
-} while (/*CONSTCOND*/0)
-
-#define	SIMPLEQ_REMOVE_HEAD(head, field) do {				\
-	if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
-		(head)->sqh_last = &(head)->sqh_first;			\
-} while (/*CONSTCOND*/0)
-
-#define	SIMPLEQ_REMOVE(head, elm, type, field) do {			\
-	if ((head)->sqh_first == (elm)) {				\
-		SIMPLEQ_REMOVE_HEAD((head), field);			\
-	} else {							\
-		struct type *curelm = (head)->sqh_first;		\
-		while (curelm->field.sqe_next != (elm))			\
-			curelm = curelm->field.sqe_next;		\
-		if ((curelm->field.sqe_next =				\
-			curelm->field.sqe_next->field.sqe_next) == NULL) \
-			    (head)->sqh_last = &(curelm)->field.sqe_next; \
-	}								\
-} while (/*CONSTCOND*/0)
-
-#define	SIMPLEQ_FOREACH(var, head, field)				\
-	for ((var) = ((head)->sqh_first);				\
-		(var);							\
-		(var) = ((var)->field.sqe_next))
-
-/*
- * Simple queue access methods.
- */
-#define	SIMPLEQ_EMPTY(head)		((head)->sqh_first == NULL)
-#define	SIMPLEQ_FIRST(head)		((head)->sqh_first)
-#define	SIMPLEQ_NEXT(elm, field)	((elm)->field.sqe_next)
-
-
-/*
- * Tail queue definitions.
- */
-#define	_TAILQ_HEAD(name, type, qual)					\
-struct name {								\
-	qual type *tqh_first;		/* first element */		\
-	qual type *qual *tqh_last;	/* addr of last next element */	\
-}
-#define TAILQ_HEAD(name, type)	_TAILQ_HEAD(name, struct type,)
-
-#define	TAILQ_HEAD_INITIALIZER(head)					\
-	{ NULL, &(head).tqh_first }
-
-#define	_TAILQ_ENTRY(type, qual)					\
-struct {								\
-	qual type *tqe_next;		/* next element */		\
-	qual type *qual *tqe_prev;	/* address of previous next element */\
-}
-#define TAILQ_ENTRY(type)	_TAILQ_ENTRY(struct type,)
-
-/*
- * Tail queue functions.
- */
-#define	TAILQ_INIT(head) do {						\
-	(head)->tqh_first = NULL;					\
-	(head)->tqh_last = &(head)->tqh_first;				\
-} while (/*CONSTCOND*/0)
-
-#define	TAILQ_INSERT_HEAD(head, elm, field) do {			\
-	if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)	\
-		(head)->tqh_first->field.tqe_prev =			\
-		    &(elm)->field.tqe_next;				\
-	else								\
-		(head)->tqh_last = &(elm)->field.tqe_next;		\
-	(head)->tqh_first = (elm);					\
-	(elm)->field.tqe_prev = &(head)->tqh_first;			\
-} while (/*CONSTCOND*/0)
-
-#define	TAILQ_INSERT_TAIL(head, elm, field) do {			\
-	(elm)->field.tqe_next = NULL;					\
-	(elm)->field.tqe_prev = (head)->tqh_last;			\
-	*(head)->tqh_last = (elm);					\
-	(head)->tqh_last = &(elm)->field.tqe_next;			\
-} while (/*CONSTCOND*/0)
-
-#define	TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
-	if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
-		(elm)->field.tqe_next->field.tqe_prev = 		\
-		    &(elm)->field.tqe_next;				\
-	else								\
-		(head)->tqh_last = &(elm)->field.tqe_next;		\
-	(listelm)->field.tqe_next = (elm);				\
-	(elm)->field.tqe_prev = &(listelm)->field.tqe_next;		\
-} while (/*CONSTCOND*/0)
-
-#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
-	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
-	(elm)->field.tqe_next = (listelm);				\
-	*(listelm)->field.tqe_prev = (elm);				\
-	(listelm)->field.tqe_prev = &(elm)->field.tqe_next;		\
-} while (/*CONSTCOND*/0)
-
-#define	TAILQ_REMOVE(head, elm, field) do {				\
-	if (((elm)->field.tqe_next) != NULL)				\
-		(elm)->field.tqe_next->field.tqe_prev = 		\
-		    (elm)->field.tqe_prev;				\
-	else								\
-		(head)->tqh_last = (elm)->field.tqe_prev;		\
-	*(elm)->field.tqe_prev = (elm)->field.tqe_next;			\
-} while (/*CONSTCOND*/0)
-
-#define	TAILQ_FOREACH(var, head, field)					\
-	for ((var) = ((head)->tqh_first);				\
-		(var);							\
-		(var) = ((var)->field.tqe_next))
-
-#define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
-	for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));	\
-		(var);							\
-		(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
-
-#define	TAILQ_CONCAT(head1, head2, field) do {				\
-	if (!TAILQ_EMPTY(head2)) {					\
-		*(head1)->tqh_last = (head2)->tqh_first;		\
-		(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;	\
-		(head1)->tqh_last = (head2)->tqh_last;			\
-		TAILQ_INIT((head2));					\
-	}								\
-} while (/*CONSTCOND*/0)
-
-/*
- * Tail queue access methods.
- */
-#define	TAILQ_EMPTY(head)		((head)->tqh_first == NULL)
-#define	TAILQ_FIRST(head)		((head)->tqh_first)
-#define	TAILQ_NEXT(elm, field)		((elm)->field.tqe_next)
-
-#define	TAILQ_LAST(head, headname) \
-	(*(((struct headname *)((head)->tqh_last))->tqh_last))
-#define	TAILQ_PREV(elm, headname, field) \
-	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
-
-
-/*
- * Circular queue definitions.
- */
-#define	CIRCLEQ_HEAD(name, type)					\
-struct name {								\
-	struct type *cqh_first;		/* first element */		\
-	struct type *cqh_last;		/* last element */		\
-}
-
-#define	CIRCLEQ_HEAD_INITIALIZER(head)					\
-	{ (void *)&head, (void *)&head }
-
-#define	CIRCLEQ_ENTRY(type)						\
-struct {								\
-	struct type *cqe_next;		/* next element */		\
-	struct type *cqe_prev;		/* previous element */		\
-}
-
-/*
- * Circular queue functions.
- */
-#define	CIRCLEQ_INIT(head) do {						\
-	(head)->cqh_first = (void *)(head);				\
-	(head)->cqh_last = (void *)(head);				\
-} while (/*CONSTCOND*/0)
-
-#define	CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
-	(elm)->field.cqe_next = (listelm)->field.cqe_next;		\
-	(elm)->field.cqe_prev = (listelm);				\
-	if ((listelm)->field.cqe_next == (void *)(head))		\
-		(head)->cqh_last = (elm);				\
-	else								\
-		(listelm)->field.cqe_next->field.cqe_prev = (elm);	\
-	(listelm)->field.cqe_next = (elm);				\
-} while (/*CONSTCOND*/0)
-
-#define	CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {		\
-	(elm)->field.cqe_next = (listelm);				\
-	(elm)->field.cqe_prev = (listelm)->field.cqe_prev;		\
-	if ((listelm)->field.cqe_prev == (void *)(head))		\
-		(head)->cqh_first = (elm);				\
-	else								\
-		(listelm)->field.cqe_prev->field.cqe_next = (elm);	\
-	(listelm)->field.cqe_prev = (elm);				\
-} while (/*CONSTCOND*/0)
-
-#define	CIRCLEQ_INSERT_HEAD(head, elm, field) do {			\
-	(elm)->field.cqe_next = (head)->cqh_first;			\
-	(elm)->field.cqe_prev = (void *)(head);				\
-	if ((head)->cqh_last == (void *)(head))				\
-		(head)->cqh_last = (elm);				\
-	else								\
-		(head)->cqh_first->field.cqe_prev = (elm);		\
-	(head)->cqh_first = (elm);					\
-} while (/*CONSTCOND*/0)
-
-#define	CIRCLEQ_INSERT_TAIL(head, elm, field) do {			\
-	(elm)->field.cqe_next = (void *)(head);				\
-	(elm)->field.cqe_prev = (head)->cqh_last;			\
-	if ((head)->cqh_first == (void *)(head))			\
-		(head)->cqh_first = (elm);				\
-	else								\
-		(head)->cqh_last->field.cqe_next = (elm);		\
-	(head)->cqh_last = (elm);					\
-} while (/*CONSTCOND*/0)
-
-#define	CIRCLEQ_REMOVE(head, elm, field) do {				\
-	if ((elm)->field.cqe_next == (void *)(head))			\
-		(head)->cqh_last = (elm)->field.cqe_prev;		\
-	else								\
-		(elm)->field.cqe_next->field.cqe_prev =			\
-		    (elm)->field.cqe_prev;				\
-	if ((elm)->field.cqe_prev == (void *)(head))			\
-		(head)->cqh_first = (elm)->field.cqe_next;		\
-	else								\
-		(elm)->field.cqe_prev->field.cqe_next =			\
-		    (elm)->field.cqe_next;				\
-} while (/*CONSTCOND*/0)
-
-#define	CIRCLEQ_FOREACH(var, head, field)				\
-	for ((var) = ((head)->cqh_first);				\
-		(var) != (const void *)(head);				\
-		(var) = ((var)->field.cqe_next))
-
-#define	CIRCLEQ_FOREACH_REVERSE(var, head, field)			\
-	for ((var) = ((head)->cqh_last);				\
-		(var) != (const void *)(head);				\
-		(var) = ((var)->field.cqe_prev))
-
-/*
- * Circular queue access methods.
- */
-#define	CIRCLEQ_EMPTY(head)		((head)->cqh_first == (void *)(head))
-#define	CIRCLEQ_FIRST(head)		((head)->cqh_first)
-#define	CIRCLEQ_LAST(head)		((head)->cqh_last)
-#define	CIRCLEQ_NEXT(elm, field)	((elm)->field.cqe_next)
-#define	CIRCLEQ_PREV(elm, field)	((elm)->field.cqe_prev)
-
-#define CIRCLEQ_LOOP_NEXT(head, elm, field)				\
-	(((elm)->field.cqe_next == (void *)(head))			\
-	    ? ((head)->cqh_first)					\
-	    : (elm->field.cqe_next))
-#define CIRCLEQ_LOOP_PREV(head, elm, field)				\
-	(((elm)->field.cqe_prev == (void *)(head))			\
-	    ? ((head)->cqh_last)					\
-	    : (elm->field.cqe_prev))
-
-#endif	/* sys/queue.h */
diff --git a/deps/libav/.gitignore b/deps/libav/.gitignore
deleted file mode 100644
index 2333950..0000000
--- a/deps/libav/.gitignore
+++ /dev/null
@@ -1,59 +0,0 @@
-*.a
-*.o
-*.d
-*.def
-*.dll
-*.exe
-*.exp
-*.gcda
-*.gcno
-*.h.c
-*.ilk
-*.lib
-*.pc
-*.pdb
-*.so
-*.so.*
-*.ver
-*-example
-*-test
-/.config
-/.version
-/avconv
-/avplay
-/avprobe
-/avserver
-/config.*
-/coverage.info
-/version.h
-/doc/*.1
-/doc/*.html
-/doc/*.pod
-/doc/avoptions_codec.texi
-/doc/avoptions_format.texi
-/doc/doxy/html/
-/doc/examples/avcodec
-/doc/examples/metadata
-/doc/examples/output
-/doc/examples/transcode_aac
-/doc/print_options
-/lcov/
-/libavcodec/*_tablegen
-/libavcodec/*_tables.c
-/libavcodec/*_tables.h
-/libavutil/avconfig.h
-/tests/audiogen
-/tests/base64
-/tests/data/
-/tests/rotozoom
-/tests/tiny_psnr
-/tests/videogen
-/tests/vsynth1/
-/tools/aviocat
-/tools/cws2fws
-/tools/graph2dot
-/tools/ismindex
-/tools/pktdumper
-/tools/probetest
-/tools/qt-faststart
-/tools/trasher
diff --git a/deps/libav/COPYING.GPLv2 b/deps/libav/COPYING.GPLv2
deleted file mode 100644
index d159169..0000000
--- a/deps/libav/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/deps/libav/COPYING.GPLv3 b/deps/libav/COPYING.GPLv3
deleted file mode 100644
index 94a9ed0..0000000
--- a/deps/libav/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/deps/libav/COPYING.LGPLv2.1 b/deps/libav/COPYING.LGPLv2.1
deleted file mode 100644
index 58af0d3..0000000
--- a/deps/libav/COPYING.LGPLv2.1
+++ /dev/null
@@ -1,502 +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/deps/libav/COPYING.LGPLv3 b/deps/libav/COPYING.LGPLv3
deleted file mode 100644
index 65c5ca8..0000000
--- a/deps/libav/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/deps/libav/CREDITS b/deps/libav/CREDITS
deleted file mode 100644
index 4a53778..0000000
--- a/deps/libav/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/deps/libav/Changelog b/deps/libav/Changelog
deleted file mode 100644
index 30e63c9..0000000
--- a/deps/libav/Changelog
+++ /dev/null
@@ -1,982 +0,0 @@
-Entries are sorted chronologically from oldest to youngest within each release,
-releases are sorted from youngest to oldest.
-
-version 10.1:
-- pcm-dvd: Fix 20bit decoding (bug/592)
-- avi: Improve non-interleaved detection (bug/666)
-- arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
-- arm: hpeldsp: prevent overreads in armv6 asm (bug/646)
-- avfilter: Add missing emms_c when needed
-- rtmpproto: Check the buffer sizes when copying app/playpath strings
-- swscale: Fix an undefined behaviour
-- vp9: Read the frame size as unsigned
-- dcadec: Use correct channel count in stereo downmix check
-- dcadec: Do not decode the XCh extension when downmixing to stereo
-- matroska: add the Opus mapping
-- matroskadec: read the CodecDelay element
-- rtmpproto: Make sure to pass on the error code if read_connect failed
-- lavr: allocate the resampling buffer with a positive size
-- mp3enc: Properly write bitrate value in XING header (debian/736088)
-- golomb: Fix the implementation of get_se_golomb_long
-
-version 10:
-- af_channelmap: fix ONE_STR mapping mode
-- matroskaenc: HEVC fixeswrite private data in hvcC format for HEVC.
-- doc: Point to the correct, actually maintained gas-preprocessor repo
-- http: Add support reading ICY metadata
-- configure: Support older version of openjpeg1
-
-version 10~beta2:
-- compand audio filter
-- and many various smaller fixes, for a full changelog, please refer to:
-  cf. https://git.libav.org/?p=libav.git;a=shortlog;h=refs/tags/v10_beta2
-
-version 10~beta1:
-- av_strnstr
-- support ID3v2 tags in ASF files
-- reference-counting for AVFrame and AVPacket data
-- avconv now fails when input options are used for output file
-  or vice versa
-- avconv options -filter_script and -filter_complex_script, which allow a
-  filtergraph description to be read from a file
-- uniform options syntax across all filters
-- interlace filter
-- JPEG 2000 decoder
-- asetpts filter (same as setpts, but for audio)
-- trim and atrim filters
-- avconv -t and -ss (output-only) options are now sample-accurate when
-  transcoding audio
-- Matroska muxer can now put the index at the beginning of the file.
-- avconv -deinterlace option removed, the yadif filter should be used instead
-- Apple Intermediate Codec decoder
-- Escape 130 video decoder
-- support for slice multithreading in libavfilter
-- VC-1 interlaced B-frame support
-- support for WavPack muxing (raw and in Matroska)
-- Go2Webinar decoder
-- WavPack encoding through libwavpack
-- Added the -n parameter to avconv
-- RTMP seek support
-- when transcoding with avconv (i.e. not streamcopying), -ss is now accurate
-  even when used as an input option. Previous behavior can be restored with
-  the -noaccurate_seek option.
-- avconv -t option can now be used for inputs, to limit the duration of
-  data read from an input file
-- Voxware MetaSound decoder
-- WebP decoder
-- Error Resilient AAC syntax (ER AAC LC) decoding
-- Low Delay AAC (ER AAC LD) decoding
-- mux chapters in ASF files
-- Opus in Ogg demuxing
-- Enhanced Low Delay AAC (ER AAC ELD) decoding (no LD SBR support)
-- F4V muxer
-- HNM version 4 demuxer and video decoder
-- HEVC decoder
-- raw HEVC, HEVC in MOV/MP4, HEVC in Matroska, HEVC in MPEG-TS demuxing
-- remove avplay -vismv option, which has not worked for a long time
-- Live HDS muxer
-- setsar/setdar filters now support variables in ratio expressions
-- dar variable in the scale filter now returns the actual DAR (i.e. a * sar)
-- VP9 decoder
-- support for decoding through VDPAU in avconv (the -hwaccel option)
-- remove mp3_header_(de)compress bitstream filters
-- stereoscopic 3d metadata handling
-- png standalone parser
-- WebP encoding via libwebp
-- ATRAC3+ decoder
-- framepack filter
-- Mirillis FIC video decoder
-- Support DNx444
-
-
-version 9:
-- av_basename and av_dirname
-- adobe and limelight publisher authentication in RTMP
-- VDPAU hardware acceleration through normal hwaccel
-- SRTP support
-
-
-version 9_beta3:
-- ashowinfo audio filter
-- 24-bit FLAC encoding
-- audio volume filter
-- deprecated the avconv -vol option. the volume filter is to be used instead.
-- multi-channel ALAC encoding up to 7.1
-- TAK demuxer, parser, and decoder
-- adaptive frame-level multithreading for H.264
-
-
-version 9_beta2:
-- metadata (INFO tag) support in WAV muxer
-- support for building DLLs using MSVC
-- remove avserver daemon mode
-- support building on the Plan 9 operating system
-- ffv1: support version 1.3
-
-
-version 9_beta1:
-
-- XWD encoder and decoder
-- Support for fragmentation in the mov/mp4 muxer
-- ISMV (Smooth Streaming) muxer
-- CDXL demuxer and decoder
-- Apple ProRes encoder
-- Sun Rasterfile Encoder
-- remove libpostproc
-- ID3v2 attached pictures reading and writing
-- WMA Lossless decoder
-- XBM encoder
-- RealAudio Lossless decoder
-- ZeroCodec decoder
-- drop support for avconv without libavfilter
-- add libavresample audio conversion library
-- audio filters support in libavfilter and avconv
-- add fps filter
-- audio split filter
-- audio mix filter
-- avprobe output is now standard INI or JSON. The old format can still
-  be used with -of old.
-- Indeo Audio decoder
-- channelsplit audio filter
-- RTMPT protocol support
-- iLBC encoding/decoding via libilbc
-- Microsoft Screen 1 decoder
-- join audio filter
-- audio channel mapping filter
-- Microsoft ATC Screen decoder
-- RTSP listen mode
-- TechSmith Screen Codec 2 decoder
-- AAC encoding via libfdk-aac
-- Microsoft Expression Encoder Screen decoder
-- RTMPS protocol support
-- RTMPTS protocol support
-- JPEG 2000 encoding support through OpenJPEG
-- G.723.1 demuxer and decoder
-- RTMPE protocol support
-- RTMPTE protocol support
-- Canopus Lossless Codec decoder
-- avconv -shortest option is now per-output file,
-  -pass and -passlogfile are now per-output stream
-- Ut Video encoder
-- Microsoft Screen 2 decoder
-- RTP depacketization of JPEG
-- Smooth Streaming live segmenter muxer
-- RTP packetization of JPEG
-- Opus decoder and encoder using libopus
-- remove -same_quant, it hasn't worked for years
-- support for building with MSVC
-
-
-version 0.8:
-
-- GSM audio parser
-- SMJPEG muxer
-
-
-version 0.8_beta2:
-
-- Automatic thread count based on detection number of (available) CPU cores
-- Deprecate libpostproc. If desired, the switch --enable-postproc will
-  enable it but it may be removed in a later Libav release.
-- rv34: frame-level multi-threading
-- optimized iMDCT transform on x86 using SSE for for mpegaudiodec
-
-
-version 0.8_beta1:
-
-- BWF muxer
-- Flash Screen Video 2 decoder
-- ffplay/ffprobe/ffserver renamed to avplay/avprobe/avserver
-- ffmpeg deprecated, added avconv, which is almost the same for now, except
-for a few incompatible changes in the options, which will hopefully make them
-easier to use. The changes are:
-    * The options placement is now strictly enforced! While in theory the
-      options for ffmpeg should be given in [input options] -i INPUT [output
-      options] OUTPUT order, in practice it was possible to give output options
-      before the -i and it mostly worked. Except when it didn't - the behavior was
-      a bit inconsistent. In avconv, it is not possible to mix input and output
-      options. All non-global options are reset after an input or output filename.
-    * All per-file options are now truly per-file - they apply only to the next
-      input or output file and specifying different values for different files
-      will now work properly (notably -ss and -t options).
-    * All per-stream options are now truly per-stream - it is possible to
-      specify which stream(s) should a given option apply to. See the Stream
-      specifiers section in the avconv manual for details.
-    * In ffmpeg some options (like -newvideo/-newaudio/...) are irregular in the
-      sense that they're specified after the output filename instead of before,
-      like all other options. In avconv this irregularity is removed, all options
-      apply to the next input or output file.
-    * -newvideo/-newaudio/-newsubtitle options were removed. Not only were they
-      irregular and highly confusing, they were also redundant. In avconv the -map
-      option will create new streams in the output file and map input streams to
-      them. E.g. avconv -i INPUT -map 0 OUTPUT will create an output stream for
-      each stream in the first input file.
-    * The -map option now has slightly different and more powerful syntax:
-        + Colons (':') are used to separate file index/stream type/stream index
-          instead of dots. Comma (',') is used to separate the sync stream instead
-          of colon.. This is done for consistency with other options.
-        + It's possible to specify stream type. E.g. -map 0:a:2 creates an
-          output stream from the third input audio stream.
-        + Omitting the stream index now maps all the streams of the given type,
-          not just the first. E.g. -map 0:s creates output streams for all the
-          subtitle streams in the first input file.
-        + Since -map can now match multiple streams, negative mappings were
-          introduced. Negative mappings disable some streams from an already
-          defined map. E.g. '-map 0 -map -0:a:1' means 'create output streams for
-          all the stream in the first input file, except for the second audio
-          stream'.
-    * There is a new option -c (or -codec) for choosing the decoder/encoder to
-      use, which allows to precisely specify target stream(s) consistently with
-      other options. E.g. -c:v lib264 sets the codec for all video streams, -c:a:0
-      libvorbis sets the codec for the first audio stream and -c copy copies all
-      the streams without reencoding. Old -vcodec/-acodec/-scodec options are now
-      aliases to -c:v/a/s
-    * It is now possible to precisely specify which stream should an AVOption
-      apply to. E.g. -b:v:0 2M sets the bitrate for the first video stream, while
-      -b:a 128k sets the bitrate for all audio streams. Note that the old -ab 128k
-      syntax is deprecated and will stop working soon.
-    * -map_chapters now takes only an input file index and applies to the next
-      output file. This is consistent with how all the other options work.
-    * -map_metadata now takes only an input metadata specifier and applies to
-      the next output file. Output metadata specifier is now part of the option
-      name, similarly to the AVOptions/map/codec feature above.
-    * -metadata can now be used to set metadata on streams and chapters, e.g.
-      -metadata:s:1 language=eng sets the language of the first stream to 'eng'.
-      This made -vlang/-alang/-slang options redundant, so they were removed.
-    * -qscale option now uses stream specifiers and applies to all streams, not
-      just video. I.e. plain -qscale number would now apply to all streams. To get
-      the old behavior, use -qscale:v. Also there is now a shortcut -q for -qscale
-      and -aq is now an alias for -q:a.
-    * -vbsf/-absf/-sbsf options were removed and replaced by a -bsf option which
-      uses stream specifiers. Use -bsf:v/a/s instead of the old options.
-    * -itsscale option now uses stream specifiers, so its argument is only the
-      scale parameter.
-    * -intra option was removed, use -g 0 for the same effect.
-    * -psnr option was removed, use -flags +psnr for the same effect.
-    * -vf option is now an alias to the new -filter option, which uses stream specifiers.
-    * -vframes/-aframes/-dframes options are now aliases to the new -frames option.
-    * -vtag/-atag/-stag options are now aliases to the new -tag option.
-- XMV demuxer
-- Windows Media Image decoder
-- LATM muxer/demuxer
-- showinfo filter
-- split filter
-- libcdio-paranoia input device for audio CD grabbing
-- select filter
-- Apple ProRes decoder
-- CELT in Ogg demuxing
-- VC-1 interlaced decoding
-- lut, lutrgb, and lutyuv filters
-- boxblur filter
-- Ut Video decoder
-- Speex encoding via libspeex
-- 4:2:2 H.264 decoding support
-- 4:2:2 and 4:4:4 H.264 encoding with libx264
-- Pulseaudio input device
-- replacement Indeo 3 decoder
-- TLS/SSL and HTTPS protocol support
-- AVOptions API rewritten and documented
-- most of CODEC_FLAG2_*, some CODEC_FLAG_* and many codec-specific fields in
-  AVCodecContext deprecated. Codec private options should be used instead.
-- Properly working defaults in libx264 wrapper, support for native presets.
-- Encrypted OMA files support
-- Discworld II BMV decoding support
-- VBLE Decoder
-- OS X Video Decoder Acceleration (VDA) support
-- CRI ADX audio format muxer and demuxer
-- Playstation Portable PMP format demuxer
-- PCM format support in OMA demuxer
-- CLJR encoder
-- Dxtory capture format decoder
-- v410 QuickTime uncompressed 4:4:4 10-bit encoder and decoder
-- OpenMG Audio muxer
-- Simple segmenting muxer
-- Indeo 4 decoder
-- SMJPEG demuxer
-
-
-version 0.7:
-
-- E-AC-3 audio encoder
-- ac3enc: add channel coupling support
-- floating-point sample format support for (E-)AC-3, DCA, AAC, Vorbis decoders
-- H.264/MPEG frame-level multithreading
-- av_metadata_* functions renamed to av_dict_* and moved to libavutil
-- 4:4:4 H.264 decoding support
-- 10-bit H.264 optimizations for x86
-- bump libswscale for recently reported ABI break
-
-
-version 0.7_beta2:
-
-- VP8 frame-level multithreading
-- NEON optimizations for VP8
-- removed a lot of deprecated API cruft
-- FFT and IMDCT optimizations for AVX (Sandy Bridge) processors
-- DPX image encoder
-- SMPTE 302M AES3 audio decoder
-- ffmpeg no longer quits after the 'q' key is pressed; use 'ctrl+c' instead
-- 9bit and 10bit per sample support in the H.264 decoder
-
-
-version 0.7_beta1:
-
-- WebM support in Matroska de/muxer
-- low overhead Ogg muxing
-- MMS-TCP support
-- VP8 de/encoding via libvpx
-- Demuxer for On2's IVF format
-- Pictor/PC Paint decoder
-- HE-AAC v2 decoder
-- libfaad2 wrapper removed
-- DTS-ES extension (XCh) decoding support
-- native VP8 decoder
-- RTSP tunneling over HTTP
-- RTP depacketization of SVQ3
-- -strict inofficial replaced by -strict unofficial
-- ffplay -exitonkeydown and -exitonmousedown options added
-- native GSM / GSM MS decoder
-- RTP depacketization of QDM2
-- ANSI/ASCII art playback system
-- Lego Mindstorms RSO de/muxer
-- SubRip subtitle file muxer and demuxer
-- Chinese AVS encoding via libxavs
-- ffprobe -show_packets option added
-- RTP packetization of Theora and Vorbis
-- RTP depacketization of MP4A-LATM
-- RTP packetization and depacketization of VP8
-- hflip filter
-- Apple HTTP Live Streaming demuxer
-- a64 codec
-- MMS-HTTP support
-- G.722 ADPCM audio encoder/decoder
-- R10k video decoder
-- ocv_smooth filter
-- frei0r wrapper filter
-- change crop filter syntax to width:height:x:y
-- make the crop filter accept parametric expressions
-- make ffprobe accept AVFormatContext options
-- yadif filter
-- blackframe filter
-- Demuxer for Leitch/Harris' VR native stream format (LXF)
-- RTP depacketization of the X-QT QuickTime format
-- SAP (Session Announcement Protocol, RFC 2974) muxer and demuxer
-- cropdetect filter
-- ffmpeg -crop* options removed
-- transpose filter added
-- ffmpeg -force_key_frames option added
-- demuxer for receiving raw rtp:// URLs without an SDP description
-- single stream LATM/LOAS decoder
-- setpts filter added
-- Win64 support for optimized x86 assembly functions
-- MJPEG/AVI1 to JPEG/JFIF bitstream filter
-- ASS subtitle encoder and decoder
-- IEC 61937 encapsulation for E-AC-3, TrueHD, DTS-HD (for HDMI passthrough)
-- overlay filter added
-- rename aspect filter to setdar, and pixelaspect to setsar
-- IEC 61937 demuxer
-- Mobotix .mxg demuxer
-- frei0r source added
-- hqdn3d filter added
-- RTP depacketization of QCELP
-- FLAC parser added
-- gradfun filter added
-- AMR-WB decoder
-- replace the ocv_smooth filter with a more generic ocv filter
-- Windows Televison (WTV) demuxer
-- FFmpeg metadata format muxer and demuxer
-- SubRip (srt) subtitle decoder
-- floating-point AC-3 encoder added
-- Lagarith decoder
-- ffmpeg -copytb option added
-- IVF muxer added
-- Wing Commander IV movies decoder added
-- movie source added
-- Bink version 'b' audio and video decoder
-- Bitmap Brothers JV playback system
-- Apple HTTP Live Streaming protocol handler
-- sndio support for playback and record
-- Linux framebuffer input device added
-- Chronomaster DFA decoder
-- Mobotix MxPEG decoder
-- AAC encoding via libvo-aacenc
-- AMR-WB encoding via libvo-amrwbenc
-- xWMA demuxer
-- fieldorder video filter added
-
-
-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
-- RealAudio 1.0 (14.4K) encoder
-
-
-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/deps/libav/INSTALL b/deps/libav/INSTALL
deleted file mode 100644
index ac5dc5d..0000000
--- a/deps/libav/INSTALL
+++ /dev/null
@@ -1,18 +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.
-
-NOTICE
-
- - Non system dependencies (e.g. libx264, libvpx) are disabled by default.
-
- - The default cflags include -g, if you want lean libraries you can either
-   pass --disable-debug or strip the debug symbols at a later time.
diff --git a/deps/libav/LICENSE b/deps/libav/LICENSE
deleted file mode 100644
index 20d82c3..0000000
--- a/deps/libav/LICENSE
+++ /dev/null
@@ -1,65 +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
-
-- the X11 grabber in libavdevice/x11grab.c
-- the texi2pod.pl tool
-- the following filters in libavfilter:
-    - vf_blackframe.c
-    - vf_boxblur.c
-    - vf_cropdetect.c
-    - vf_delogo.c
-    - vf_hqdn3d.c
-
-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.
-
-There are a handful of files under other licensing terms, namely:
-
-* The files libavcodec/jfdctfst.c, libavcodec/jfdctint_template.c and
-  libavcodec/jrevdct.c are taken from libjpeg, see the top of the files for
-  licensing details. Specifically note that you must credit the IJG in the
-  documentation accompanying your program if you only distribute executables.
-  You must also indicate any changes including additions and deletions to
-  those three files in the documentation.
-
-
-external libraries
-==================
-
-Libav can be combined with a number of external libraries, which sometimes
-affect the licensing of binaries resulting from the combination.
-
-compatible libraries
---------------------
-
-The libcdio, libx264, libxavs and libxvid libraries are under GPL. When
-combining them with Libav, Libav needs to be licensed as GPL as well by
-passing --enable-gpl to configure.
-
-The OpenCORE and VisualOn 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 these libraries with Libav, the
-license version needs to be upgraded by passing --enable-version3 to configure.
-
-incompatible libraries
-----------------------
-
-The Fraunhofer AAC library, FAAC and OpenSSL are under licenses incompatible
-with all (L)GPL versions. Thus, unfortunately, since both licenses cannot be
-satisfied simultaneously, binaries resulting from the combination of Libav
-with these libraries are nonfree und unredistributable. If you wish to enable
-any of these libraries nonetheless, pass --enable-nonfree to configure.
diff --git a/deps/libav/Makefile b/deps/libav/Makefile
deleted file mode 100644
index 25c3b32..0000000
--- a/deps/libav/Makefile
+++ /dev/null
@@ -1,226 +0,0 @@
-include config.mak
-
-vpath %.c    $(SRC_PATH)
-vpath %.h    $(SRC_PATH)
-vpath %.S    $(SRC_PATH)
-vpath %.asm  $(SRC_PATH)
-vpath %.v    $(SRC_PATH)
-vpath %.texi $(SRC_PATH)
-
-ifndef V
-Q      = @
-ECHO   = printf "$(1)\t%s\n" $(2)
-BRIEF  = CC HOSTCC HOSTLD AS YASM AR LD
-SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM STRIP
-MSG    = $@
-M      = @$(call ECHO,$(TAG),$@);
-$(foreach VAR,$(BRIEF), \
-    $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
-$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
-$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
-endif
-
-ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil swscale
-
-IFLAGS     := -I. -I$(SRC_PATH)
-CPPFLAGS   := $(IFLAGS) $(CPPFLAGS)
-CFLAGS     += $(ECFLAGS)
-CCFLAGS     = $(CPPFLAGS) $(CFLAGS)
-ASFLAGS    := $(CPPFLAGS) $(ASFLAGS)
-YASMFLAGS  += $(IFLAGS:%=%/) -Pconfig.asm
-HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
-LDFLAGS    := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
-
-define COMPILE
-	$(call $(1)DEP,$(1))
-	$($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
-endef
-
-COMPILE_C = $(call COMPILE,CC)
-COMPILE_S = $(call COMPILE,AS)
-COMPILE_HOSTC = $(call COMPILE,HOSTCC)
-
-%.o: %.c
-	$(COMPILE_C)
-
-%.o: %.S
-	$(COMPILE_S)
-
-%_host.o: %.c
-	$(COMPILE_HOSTC)
-
-%.i: %.c
-	$(CC) $(CCFLAGS) $(CC_E) $<
-
-%.h.c:
-	$(Q)echo '#include "$*.h"' >$@
-
-%.ver: %.v
-	$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
-
-%.c %.h: TAG = GEN
-
-AVPROGS-$(CONFIG_AVCONV)   += avconv
-AVPROGS-$(CONFIG_AVPLAY)   += avplay
-AVPROGS-$(CONFIG_AVPROBE)  += avprobe
-AVPROGS-$(CONFIG_AVSERVER) += avserver
-
-AVPROGS    := $(AVPROGS-yes:%=%$(EXESUF))
-PROGS      += $(AVPROGS)
-
-AVBASENAMES = avconv avplay avprobe avserver
-ALLAVPROGS  = $(AVBASENAMES:%=%$(EXESUF))
-
-$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog) += cmdutils.o))
-
-OBJS-avconv                   += avconv_opt.o avconv_filter.o
-OBJS-avconv-$(HAVE_VDPAU_X11) += avconv_vdpau.o
-
-TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
-HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
-TOOLS       = qt-faststart trasher
-TOOLS-$(CONFIG_ZLIB) += cws2fws
-
-FFLIBS-$(CONFIG_AVDEVICE) += avdevice
-FFLIBS-$(CONFIG_AVFILTER) += avfilter
-FFLIBS-$(CONFIG_AVFORMAT) += avformat
-FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
-FFLIBS-$(CONFIG_AVCODEC)  += avcodec
-FFLIBS-$(CONFIG_SWSCALE)  += swscale
-
-FFLIBS := avutil
-
-DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
-
-SKIPHEADERS = cmdutils_common_opts.h compat/w32pthreads.h
-
-include $(SRC_PATH)/common.mak
-
-FF_EXTRALIBS := $(FFEXTRALIBS)
-FF_DEP_LIBS  := $(DEP_LIBS)
-
-all: $(AVPROGS)
-
-$(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
-	$(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS)
-
-tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
-
-config.h: .config
-.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
-	@-tput bold 2>/dev/null
-	@-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
-	@-tput sgr0 2>/dev/null
-
-SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
-               HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS            \
-               ARMV5TE-OBJS ARMV6-OBJS VFP-OBJS NEON-OBJS                \
-               ALTIVEC-OBJS VIS-OBJS                                     \
-               MMX-OBJS YASM-OBJS                                        \
-               OBJS HOSTOBJS TESTOBJS
-
-define RESET
-$(1) :=
-$(1)-yes :=
-endef
-
-define DOSUBDIR
-$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
-SUBDIR := $(1)/
-include $(SRC_PATH)/$(1)/Makefile
--include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
-include $(SRC_PATH)/library.mak
-endef
-
-$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
-
-include $(SRC_PATH)/doc/Makefile
-
-define DOPROG
-OBJS-$(1) += $(1).o $(EXEOBJS) $(OBJS-$(1)-yes)
-$(1)$(EXESUF): $$(OBJS-$(1))
-$$(OBJS-$(1)): CFLAGS  += $(CFLAGS-$(1))
-$(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
-$(1)$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
--include $$(OBJS-$(1):.o=.d)
-endef
-
-$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(EXESUF)=))))
-
-$(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
-	$(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
-
-OBJDIRS += tools
-
--include $(wildcard tools/*.d)
-
-VERSION_SH  = $(SRC_PATH)/version.sh
-GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD
-
-.version: $(wildcard $(GIT_LOG)) $(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
-
-ifdef AVPROGS
-install: install-progs install-data
-endif
-
-install: install-libs install-headers
-
-install-libs: install-libs-yes
-
-install-progs-yes:
-install-progs-$(CONFIG_SHARED): install-libs
-
-install-progs: install-progs-yes $(AVPROGS)
-	$(Q)mkdir -p "$(BINDIR)"
-	$(INSTALL) -c -m 755 $(AVPROGS) "$(BINDIR)"
-
-install-data: $(DATA_FILES)
-	$(Q)mkdir -p "$(DATADIR)"
-	$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
-
-uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
-
-uninstall-progs:
-	$(RM) $(addprefix "$(BINDIR)/", $(ALLAVPROGS))
-
-uninstall-data:
-	$(RM) -r "$(DATADIR)"
-
-clean::
-	$(RM) $(ALLAVPROGS)
-	$(RM) $(CLEANSUFFIXES)
-	$(RM) $(CLEANSUFFIXES:%=tools/%)
-	$(RM) -rf coverage.info lcov
-
-distclean::
-	$(RM) $(DISTCLEANSUFFIXES)
-	$(RM) config.* .config libavutil/avconfig.h .version version.h
-
-config:
-	$(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
-
-check: all alltools checkheaders examples testprogs fate
-
-include $(SRC_PATH)/tests/Makefile
-
-$(sort $(OBJDIRS)):
-	$(Q)mkdir -p $@
-
-# Dummy rule to stop make trying to rebuild removed or renamed headers
-%.h:
-	@:
-
-# Disable suffix rules.  Most of the builtin rules are suffix rules,
-# so this saves some time on slow systems.
-.SUFFIXES:
-
-.PHONY: all all-yes alltools check *clean config examples install*
-.PHONY: testprogs uninstall*
diff --git a/deps/libav/README b/deps/libav/README
deleted file mode 100644
index afef671..0000000
--- a/deps/libav/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/deps/libav/RELEASE b/deps/libav/RELEASE
deleted file mode 100644
index ae425d6..0000000
--- a/deps/libav/RELEASE
+++ /dev/null
@@ -1 +0,0 @@
-10.1
diff --git a/deps/libav/arch.mak b/deps/libav/arch.mak
deleted file mode 100644
index 09d24af..0000000
--- a/deps/libav/arch.mak
+++ /dev/null
@@ -1,11 +0,0 @@
-OBJS-$(HAVE_ARMV5TE) += $(ARMV5TE-OBJS) $(ARMV5TE-OBJS-yes)
-OBJS-$(HAVE_ARMV6)   += $(ARMV6-OBJS)   $(ARMV6-OBJS-yes)
-OBJS-$(HAVE_VFP)     += $(VFP-OBJS)     $(VFP-OBJS-yes)
-OBJS-$(HAVE_NEON)    += $(NEON-OBJS)    $(NEON-OBJS-yes)
-
-OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
-
-OBJS-$(HAVE_VIS)     += $(VIS-OBJS)     $(VIS-OBJS-yes)
-
-OBJS-$(HAVE_MMX)     += $(MMX-OBJS)     $(MMX-OBJS-yes)
-OBJS-$(HAVE_YASM)    += $(YASM-OBJS)    $(YASM-OBJS-yes)
diff --git a/deps/libav/avconv.c b/deps/libav/avconv.c
deleted file mode 100644
index 64e8321..0000000
--- a/deps/libav/avconv.c
+++ /dev/null
@@ -1,2477 +0,0 @@
-/*
- * avconv main
- * Copyright (c) 2000-2011 The libav developers.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#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 <stdint.h>
-
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
-#include "libswscale/swscale.h"
-#include "libavresample/avresample.h"
-#include "libavutil/opt.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/samplefmt.h"
-#include "libavutil/fifo.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/avstring.h"
-#include "libavutil/libm.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/time.h"
-#include "libavformat/os_support.h"
-
-# include "libavfilter/avfilter.h"
-# include "libavfilter/buffersrc.h"
-# include "libavfilter/buffersink.h"
-
-#if HAVE_SYS_RESOURCE_H
-#include <sys/time.h>
-#include <sys/types.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_PTHREADS
-#include <pthread.h>
-#endif
-
-#include <time.h>
-
-#include "avconv.h"
-#include "cmdutils.h"
-
-#include "libavutil/avassert.h"
-
-const char program_name[] = "avconv";
-const int program_birth_year = 2000;
-
-static FILE *vstats_file;
-
-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;
-
-
-
-#if HAVE_PTHREADS
-/* signal to input threads that they should exit; set by the main thread */
-static int transcoding_finished;
-#endif
-
-#define DEFAULT_PASS_LOGFILENAME_PREFIX "av2pass"
-
-InputStream **input_streams = NULL;
-int        nb_input_streams = 0;
-InputFile   **input_files   = NULL;
-int        nb_input_files   = 0;
-
-OutputStream **output_streams = NULL;
-int         nb_output_streams = 0;
-OutputFile   **output_files   = NULL;
-int         nb_output_files   = 0;
-
-FilterGraph **filtergraphs;
-int        nb_filtergraphs;
-
-static void term_exit(void)
-{
-    av_log(NULL, AV_LOG_QUIET, "");
-}
-
-static volatile int received_sigterm = 0;
-static volatile int received_nb_signals = 0;
-
-static void
-sigterm_handler(int sig)
-{
-    received_sigterm = sig;
-    received_nb_signals++;
-    term_exit();
-}
-
-static void term_init(void)
-{
-    signal(SIGINT , sigterm_handler); /* Interrupt (ANSI).    */
-    signal(SIGTERM, sigterm_handler); /* Termination (ANSI).  */
-#ifdef SIGXCPU
-    signal(SIGXCPU, sigterm_handler);
-#endif
-}
-
-static int decode_interrupt_cb(void *ctx)
-{
-    return received_nb_signals > 1;
-}
-
-const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
-
-static void avconv_cleanup(int ret)
-{
-    int i, j;
-
-    for (i = 0; i < nb_filtergraphs; i++) {
-        avfilter_graph_free(&filtergraphs[i]->graph);
-        for (j = 0; j < filtergraphs[i]->nb_inputs; j++) {
-            av_freep(&filtergraphs[i]->inputs[j]->name);
-            av_freep(&filtergraphs[i]->inputs[j]);
-        }
-        av_freep(&filtergraphs[i]->inputs);
-        for (j = 0; j < filtergraphs[i]->nb_outputs; j++) {
-            av_freep(&filtergraphs[i]->outputs[j]->name);
-            av_freep(&filtergraphs[i]->outputs[j]);
-        }
-        av_freep(&filtergraphs[i]->outputs);
-        av_freep(&filtergraphs[i]->graph_desc);
-        av_freep(&filtergraphs[i]);
-    }
-    av_freep(&filtergraphs);
-
-    /* close files */
-    for (i = 0; i < nb_output_files; i++) {
-        AVFormatContext *s = output_files[i]->ctx;
-        if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE) && s->pb)
-            avio_close(s->pb);
-        avformat_free_context(s);
-        av_dict_free(&output_files[i]->opts);
-        av_freep(&output_files[i]);
-    }
-    for (i = 0; i < nb_output_streams; i++) {
-        AVBitStreamFilterContext *bsfc = output_streams[i]->bitstream_filters;
-        while (bsfc) {
-            AVBitStreamFilterContext *next = bsfc->next;
-            av_bitstream_filter_close(bsfc);
-            bsfc = next;
-        }
-        output_streams[i]->bitstream_filters = NULL;
-        av_frame_free(&output_streams[i]->filtered_frame);
-
-        av_parser_close(output_streams[i]->parser);
-
-        av_freep(&output_streams[i]->forced_keyframes);
-        av_freep(&output_streams[i]->avfilter);
-        av_freep(&output_streams[i]->logfile_prefix);
-        av_freep(&output_streams[i]);
-    }
-    for (i = 0; i < nb_input_files; i++) {
-        avformat_close_input(&input_files[i]->ctx);
-        av_freep(&input_files[i]);
-    }
-    for (i = 0; i < nb_input_streams; i++) {
-        av_frame_free(&input_streams[i]->decoded_frame);
-        av_frame_free(&input_streams[i]->filter_frame);
-        av_dict_free(&input_streams[i]->opts);
-        av_freep(&input_streams[i]->filters);
-        av_freep(&input_streams[i]->hwaccel_device);
-        av_freep(&input_streams[i]);
-    }
-
-    if (vstats_file)
-        fclose(vstats_file);
-    av_free(vstats_filename);
-
-    av_freep(&input_streams);
-    av_freep(&input_files);
-    av_freep(&output_streams);
-    av_freep(&output_files);
-
-    uninit_opts();
-
-    avformat_network_deinit();
-
-    if (received_sigterm) {
-        av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
-               (int) received_sigterm);
-        exit (255);
-    }
-}
-
-void assert_avoptions(AVDictionary *m)
-{
-    AVDictionaryEntry *t;
-    if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
-        av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key);
-        exit_program(1);
-    }
-}
-
-static void abort_codec_experimental(AVCodec *c, int encoder)
-{
-    const char *codec_string = encoder ? "encoder" : "decoder";
-    AVCodec *codec;
-    av_log(NULL, AV_LOG_FATAL, "%s '%s' is experimental and might produce bad "
-            "results.\nAdd '-strict experimental' if you want to use it.\n",
-            codec_string, c->name);
-    codec = encoder ? avcodec_find_encoder(c->id) : avcodec_find_decoder(c->id);
-    if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
-        av_log(NULL, AV_LOG_FATAL, "Or use the non experimental %s '%s'.\n",
-               codec_string, codec->name);
-    exit_program(1);
-}
-
-/*
- * Update the requested input sample format based on the output sample format.
- * This is currently only used to request float output from decoders which
- * support multiple sample formats, one of which is AV_SAMPLE_FMT_FLT.
- * Ideally this will be removed in the future when decoders do not do format
- * conversion and only output in their native format.
- */
-static void update_sample_fmt(AVCodecContext *dec, AVCodec *dec_codec,
-                              AVCodecContext *enc)
-{
-    /* if sample formats match or a decoder sample format has already been
-       requested, just return */
-    if (enc->sample_fmt == dec->sample_fmt ||
-        dec->request_sample_fmt > AV_SAMPLE_FMT_NONE)
-        return;
-
-    /* if decoder supports more than one output format */
-    if (dec_codec && dec_codec->sample_fmts &&
-        dec_codec->sample_fmts[0] != AV_SAMPLE_FMT_NONE &&
-        dec_codec->sample_fmts[1] != AV_SAMPLE_FMT_NONE) {
-        const enum AVSampleFormat *p;
-        int min_dec = INT_MAX, min_inc = INT_MAX;
-        enum AVSampleFormat dec_fmt = AV_SAMPLE_FMT_NONE;
-        enum AVSampleFormat inc_fmt = AV_SAMPLE_FMT_NONE;
-
-        /* find a matching sample format in the encoder */
-        for (p = dec_codec->sample_fmts; *p != AV_SAMPLE_FMT_NONE; p++) {
-            if (*p == enc->sample_fmt) {
-                dec->request_sample_fmt = *p;
-                return;
-            } else {
-                enum AVSampleFormat dfmt = av_get_packed_sample_fmt(*p);
-                enum AVSampleFormat efmt = av_get_packed_sample_fmt(enc->sample_fmt);
-                int fmt_diff = 32 * abs(dfmt - efmt);
-                if (av_sample_fmt_is_planar(*p) !=
-                    av_sample_fmt_is_planar(enc->sample_fmt))
-                    fmt_diff++;
-                if (dfmt == efmt) {
-                    min_inc = fmt_diff;
-                    inc_fmt = *p;
-                } else if (dfmt > efmt) {
-                    if (fmt_diff < min_inc) {
-                        min_inc = fmt_diff;
-                        inc_fmt = *p;
-                    }
-                } else {
-                    if (fmt_diff < min_dec) {
-                        min_dec = fmt_diff;
-                        dec_fmt = *p;
-                    }
-                }
-            }
-        }
-
-        /* if none match, provide the one that matches quality closest */
-        dec->request_sample_fmt = min_inc != INT_MAX ? inc_fmt : dec_fmt;
-    }
-}
-
-static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
-{
-    AVBitStreamFilterContext *bsfc = ost->bitstream_filters;
-    AVCodecContext          *avctx = ost->st->codec;
-    int ret;
-
-    /*
-     * Audio encoders may split the packets --  #frames in != #packets out.
-     * But there is no reordering, so we can limit the number of output packets
-     * by simply dropping them here.
-     * Counting encoded video frames needs to be done separately because of
-     * reordering, see do_video_out()
-     */
-    if (!(avctx->codec_type == AVMEDIA_TYPE_VIDEO && avctx->codec)) {
-        if (ost->frame_number >= ost->max_frames) {
-            av_free_packet(pkt);
-            return;
-        }
-        ost->frame_number++;
-    }
-
-    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.buf = av_buffer_create(new_pkt.data, new_pkt.size,
-                                           av_buffer_default_free, NULL, 0);
-            if (!new_pkt.buf)
-                exit_program(1);
-        } else if (a < 0) {
-            av_log(NULL, AV_LOG_ERROR, "%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)
-                exit_program(1);
-        }
-        *pkt = new_pkt;
-
-        bsfc = bsfc->next;
-    }
-
-    if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS) &&
-        ost->last_mux_dts != AV_NOPTS_VALUE &&
-        pkt->dts < ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT)) {
-        av_log(NULL, AV_LOG_WARNING, "Non-monotonous DTS in output stream "
-               "%d:%d; previous: %"PRId64", current: %"PRId64"; ",
-               ost->file_index, ost->st->index, ost->last_mux_dts, pkt->dts);
-        if (exit_on_error) {
-            av_log(NULL, AV_LOG_FATAL, "aborting.\n");
-            exit_program(1);
-        }
-        av_log(NULL, AV_LOG_WARNING, "changing to %"PRId64". This may result "
-               "in incorrect timestamps in the output file.\n",
-               ost->last_mux_dts + 1);
-        pkt->dts = ost->last_mux_dts + 1;
-        if (pkt->pts != AV_NOPTS_VALUE)
-            pkt->pts = FFMAX(pkt->pts, pkt->dts);
-    }
-    ost->last_mux_dts = pkt->dts;
-
-    pkt->stream_index = ost->index;
-    ret = av_interleaved_write_frame(s, pkt);
-    if (ret < 0) {
-        print_error("av_interleaved_write_frame()", ret);
-        exit_program(1);
-    }
-}
-
-static int check_recording_time(OutputStream *ost)
-{
-    OutputFile *of = output_files[ost->file_index];
-
-    if (of->recording_time != INT64_MAX &&
-        av_compare_ts(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, of->recording_time,
-                      AV_TIME_BASE_Q) >= 0) {
-        ost->finished = 1;
-        return 0;
-    }
-    return 1;
-}
-
-static void do_audio_out(AVFormatContext *s, OutputStream *ost,
-                         AVFrame *frame)
-{
-    AVCodecContext *enc = ost->st->codec;
-    AVPacket pkt;
-    int got_packet = 0;
-
-    av_init_packet(&pkt);
-    pkt.data = NULL;
-    pkt.size = 0;
-
-    if (frame->pts == AV_NOPTS_VALUE || audio_sync_method < 0)
-        frame->pts = ost->sync_opts;
-    ost->sync_opts = frame->pts + frame->nb_samples;
-
-    if (avcodec_encode_audio2(enc, &pkt, frame, &got_packet) < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Audio encoding failed\n");
-        exit_program(1);
-    }
-
-    if (got_packet) {
-        if (pkt.pts != AV_NOPTS_VALUE)
-            pkt.pts      = av_rescale_q(pkt.pts,      enc->time_base, ost->st->time_base);
-        if (pkt.dts != AV_NOPTS_VALUE)
-            pkt.dts      = av_rescale_q(pkt.dts,      enc->time_base, ost->st->time_base);
-        if (pkt.duration > 0)
-            pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base);
-
-        write_frame(s, &pkt, ost);
-
-        audio_size += pkt.size;
-    }
-}
-
-static void do_subtitle_out(AVFormatContext *s,
-                            OutputStream *ost,
-                            InputStream *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) {
-        av_log(NULL, AV_LOG_ERROR, "Subtitle packets must have a pts\n");
-        if (exit_on_error)
-            exit_program(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 == AV_CODEC_ID_DVB_SUBTITLE)
-        nb = 2;
-    else
-        nb = 1;
-
-    for (i = 0; i < nb; i++) {
-        ost->sync_opts = av_rescale_q(pts, ist->st->time_base, enc->time_base);
-        if (!check_recording_time(ost))
-            return;
-
-        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) {
-            av_log(NULL, AV_LOG_FATAL, "Subtitle encoding failed\n");
-            exit_program(1);
-        }
-
-        av_init_packet(&pkt);
-        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 == AV_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);
-    }
-}
-
-static void do_video_out(AVFormatContext *s,
-                         OutputStream *ost,
-                         AVFrame *in_picture,
-                         int *frame_size)
-{
-    int ret, format_video_sync;
-    AVPacket pkt;
-    AVCodecContext *enc = ost->st->codec;
-
-    *frame_size = 0;
-
-    format_video_sync = video_sync_method;
-    if (format_video_sync == VSYNC_AUTO)
-        format_video_sync = (s->oformat->flags & AVFMT_NOTIMESTAMPS) ? VSYNC_PASSTHROUGH :
-                            (s->oformat->flags & AVFMT_VARIABLE_FPS) ? VSYNC_VFR : VSYNC_CFR;
-    if (format_video_sync != VSYNC_PASSTHROUGH &&
-        ost->frame_number &&
-        in_picture->pts != AV_NOPTS_VALUE &&
-        in_picture->pts < ost->sync_opts) {
-        nb_frames_drop++;
-        av_log(NULL, AV_LOG_VERBOSE, "*** drop!\n");
-        return;
-    }
-
-    if (in_picture->pts == AV_NOPTS_VALUE)
-        in_picture->pts = ost->sync_opts;
-    ost->sync_opts = in_picture->pts;
-
-
-    if (!ost->frame_number)
-        ost->first_pts = in_picture->pts;
-
-    av_init_packet(&pkt);
-    pkt.data = NULL;
-    pkt.size = 0;
-
-    if (ost->frame_number >= ost->max_frames)
-        return;
-
-    if (s->oformat->flags & AVFMT_RAWPICTURE &&
-        enc->codec->id == AV_CODEC_ID_RAWVIDEO) {
-        /* raw pictures are written as AVPicture structure to
-           avoid any copies. We support temporarily the older
-           method. */
-        enc->coded_frame->interlaced_frame = in_picture->interlaced_frame;
-        enc->coded_frame->top_field_first  = in_picture->top_field_first;
-        pkt.data   = (uint8_t *)in_picture;
-        pkt.size   =  sizeof(AVPicture);
-        pkt.pts    = av_rescale_q(in_picture->pts, enc->time_base, ost->st->time_base);
-        pkt.flags |= AV_PKT_FLAG_KEY;
-
-        write_frame(s, &pkt, ost);
-    } else {
-        int got_packet;
-
-        if (ost->st->codec->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME) &&
-            ost->top_field_first >= 0)
-            in_picture->top_field_first = !!ost->top_field_first;
-
-        in_picture->quality = ost->st->codec->global_quality;
-        if (!enc->me_threshold)
-            in_picture->pict_type = 0;
-        if (ost->forced_kf_index < ost->forced_kf_count &&
-            in_picture->pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
-            in_picture->pict_type = AV_PICTURE_TYPE_I;
-            ost->forced_kf_index++;
-        }
-        ret = avcodec_encode_video2(enc, &pkt, in_picture, &got_packet);
-        if (ret < 0) {
-            av_log(NULL, AV_LOG_FATAL, "Video encoding failed\n");
-            exit_program(1);
-        }
-
-        if (got_packet) {
-            if (pkt.pts != AV_NOPTS_VALUE)
-                pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base);
-            if (pkt.dts != AV_NOPTS_VALUE)
-                pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);
-
-            write_frame(s, &pkt, ost);
-            *frame_size = pkt.size;
-            video_size += pkt.size;
-
-            /* if two pass, output log */
-            if (ost->logfile && enc->stats_out) {
-                fprintf(ost->logfile, "%s", enc->stats_out);
-            }
-        }
-    }
-    ost->sync_opts++;
-    /*
-     * For video, number of frames in == number of packets out.
-     * But there may be reordering, so we can't throw away frames on encoder
-     * flush, we need to limit them here, before they go into encoder.
-     */
-    ost->frame_number++;
-}
-
-static double psnr(double d)
-{
-    return -10.0 * log(d) / log(10.0);
-}
-
-static void do_video_stats(OutputStream *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");
-            exit_program(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_picture_type_char(enc->coded_frame->pict_type));
-    }
-}
-
-/*
- * Read one frame for lavfi output for ost and encode it.
- */
-static int poll_filter(OutputStream *ost)
-{
-    OutputFile    *of = output_files[ost->file_index];
-    AVFrame *filtered_frame = NULL;
-    int frame_size, ret;
-
-    if (!ost->filtered_frame && !(ost->filtered_frame = av_frame_alloc())) {
-        return AVERROR(ENOMEM);
-    }
-    filtered_frame = ost->filtered_frame;
-
-    if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
-        !(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
-        ret = av_buffersink_get_samples(ost->filter->filter, filtered_frame,
-                                         ost->st->codec->frame_size);
-    else
-        ret = av_buffersink_get_frame(ost->filter->filter, filtered_frame);
-
-    if (ret < 0)
-        return ret;
-
-    if (filtered_frame->pts != AV_NOPTS_VALUE) {
-        int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time;
-        filtered_frame->pts = av_rescale_q(filtered_frame->pts,
-                                           ost->filter->filter->inputs[0]->time_base,
-                                           ost->st->codec->time_base) -
-                              av_rescale_q(start_time,
-                                           AV_TIME_BASE_Q,
-                                           ost->st->codec->time_base);
-    }
-
-    switch (ost->filter->filter->inputs[0]->type) {
-    case AVMEDIA_TYPE_VIDEO:
-        if (!ost->frame_aspect_ratio)
-            ost->st->codec->sample_aspect_ratio = filtered_frame->sample_aspect_ratio;
-
-        do_video_out(of->ctx, ost, filtered_frame, &frame_size);
-        if (vstats_filename && frame_size)
-            do_video_stats(ost, frame_size);
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        do_audio_out(of->ctx, ost, filtered_frame);
-        break;
-    default:
-        // TODO support subtitle filters
-        av_assert0(0);
-    }
-
-    av_frame_unref(filtered_frame);
-
-    return 0;
-}
-
-/*
- * Read as many frames from possible from lavfi and encode them.
- *
- * Always read from the active stream with the lowest timestamp. If no frames
- * are available for it then return EAGAIN and wait for more input. This way we
- * can use lavfi sources that generate unlimited amount of frames without memory
- * usage exploding.
- */
-static int poll_filters(void)
-{
-    int i, j, ret = 0;
-
-    while (ret >= 0 && !received_sigterm) {
-        OutputStream *ost = NULL;
-        int64_t min_pts = INT64_MAX;
-
-        /* choose output stream with the lowest timestamp */
-        for (i = 0; i < nb_output_streams; i++) {
-            int64_t pts = output_streams[i]->sync_opts;
-
-            if (!output_streams[i]->filter || output_streams[i]->finished)
-                continue;
-
-            pts = av_rescale_q(pts, output_streams[i]->st->codec->time_base,
-                               AV_TIME_BASE_Q);
-            if (pts < min_pts) {
-                min_pts = pts;
-                ost = output_streams[i];
-            }
-        }
-
-        if (!ost)
-            break;
-
-        ret = poll_filter(ost);
-
-        if (ret == AVERROR_EOF) {
-            OutputFile *of = output_files[ost->file_index];
-
-            ost->finished = 1;
-
-            if (of->shortest) {
-                for (j = 0; j < of->ctx->nb_streams; j++)
-                    output_streams[of->ost_index + j]->finished = 1;
-            }
-
-            ret = 0;
-        } else if (ret == AVERROR(EAGAIN))
-            return 0;
-    }
-
-    return ret;
-}
-
-static void print_report(int is_last_report, int64_t timer_start)
-{
-    char buf[1024];
-    OutputStream *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 (!print_stats && !is_last_report)
-        return;
-
-    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]->ctx;
-
-    total_size = avio_size(oc->pb);
-    if (total_size <= 0) // FIXME improve avio_size() so it works with non seekable output too
-        total_size = avio_tell(oc->pb);
-    if (total_size < 0) {
-        char errbuf[128];
-        av_strerror(total_size, errbuf, sizeof(errbuf));
-        av_log(NULL, AV_LOG_VERBOSE, "Bitrate not available, "
-               "avio_tell() failed: %s\n", errbuf);
-        total_size = 0;
-    }
-
-    buf[0] = '\0';
-    ti1 = 1e10;
-    vid = 0;
-    for (i = 0; i < nb_output_streams; i++) {
-        float q = -1;
-        ost = output_streams[i];
-        enc = ost->st->codec;
-        if (!ost->stream_copy && enc->coded_frame)
-            q = enc->coded_frame->quality / (float)FF_QP2LAMBDA;
-        if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
-            snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", q);
-        }
-        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, q);
-            if (is_last_report)
-                snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L");
-            if (qp_hist) {
-                int j;
-                int qp = lrintf(q);
-                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(log2(qp_histogram[j] + 1)));
-            }
-            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;
-
-    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);
-
-    av_log(NULL, AV_LOG_INFO, "%s    \r", buf);
-
-    fflush(stderr);
-
-    if (is_last_report) {
-        int64_t raw   = audio_size + video_size + extra_size;
-        float percent = 0.0;
-
-        if (raw)
-            percent = 100.0 * (total_size - raw) / raw;
-
-        av_log(NULL, AV_LOG_INFO, "\n");
-        av_log(NULL, AV_LOG_INFO, "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,
-               percent);
-    }
-}
-
-static void flush_encoders(void)
-{
-    int i, ret;
-
-    for (i = 0; i < nb_output_streams; i++) {
-        OutputStream   *ost = output_streams[i];
-        AVCodecContext *enc = ost->st->codec;
-        AVFormatContext *os = output_files[ost->file_index]->ctx;
-        int stop_encoding = 0;
-
-        if (!ost->encoding_needed)
-            continue;
-
-        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) && enc->codec->id == AV_CODEC_ID_RAWVIDEO)
-            continue;
-
-        for (;;) {
-            int (*encode)(AVCodecContext*, AVPacket*, const AVFrame*, int*) = NULL;
-            const char *desc;
-            int64_t *size;
-
-            switch (ost->st->codec->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-                encode = avcodec_encode_audio2;
-                desc   = "Audio";
-                size   = &audio_size;
-                break;
-            case AVMEDIA_TYPE_VIDEO:
-                encode = avcodec_encode_video2;
-                desc   = "Video";
-                size   = &video_size;
-                break;
-            default:
-                stop_encoding = 1;
-            }
-
-            if (encode) {
-                AVPacket pkt;
-                int got_packet;
-                av_init_packet(&pkt);
-                pkt.data = NULL;
-                pkt.size = 0;
-
-                ret = encode(enc, &pkt, NULL, &got_packet);
-                if (ret < 0) {
-                    av_log(NULL, AV_LOG_FATAL, "%s encoding failed\n", desc);
-                    exit_program(1);
-                }
-                *size += ret;
-                if (ost->logfile && enc->stats_out) {
-                    fprintf(ost->logfile, "%s", enc->stats_out);
-                }
-                if (!got_packet) {
-                    stop_encoding = 1;
-                    break;
-                }
-                if (pkt.pts != AV_NOPTS_VALUE)
-                    pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base);
-                if (pkt.dts != AV_NOPTS_VALUE)
-                    pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);
-                if (pkt.duration > 0)
-                    pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base);
-                write_frame(os, &pkt, ost);
-            }
-
-            if (stop_encoding)
-                break;
-        }
-    }
-}
-
-/*
- * Check whether a packet from ist should be written into ost at this time
- */
-static int check_output_constraints(InputStream *ist, OutputStream *ost)
-{
-    OutputFile *of = output_files[ost->file_index];
-    int ist_index  = input_files[ist->file_index]->ist_index + ist->st->index;
-
-    if (ost->source_index != ist_index)
-        return 0;
-
-    if (of->start_time != AV_NOPTS_VALUE && ist->last_dts < of->start_time)
-        return 0;
-
-    return 1;
-}
-
-static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *pkt)
-{
-    OutputFile *of = output_files[ost->file_index];
-    InputFile   *f = input_files [ist->file_index];
-    int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time;
-    int64_t ost_tb_start_time = av_rescale_q(start_time, AV_TIME_BASE_Q, ost->st->time_base);
-    AVPacket opkt;
-
-    av_init_packet(&opkt);
-
-    if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&
-        !ost->copy_initial_nonkeyframes)
-        return;
-
-    if (of->recording_time != INT64_MAX &&
-        ist->last_dts >= of->recording_time + start_time) {
-        ost->finished = 1;
-        return;
-    }
-
-    if (f->recording_time != INT64_MAX) {
-        start_time = f->ctx->start_time;
-        if (f->start_time != AV_NOPTS_VALUE)
-            start_time += f->start_time;
-        if (ist->last_dts >= f->recording_time + start_time) {
-            ost->finished = 1;
-            return;
-        }
-    }
-
-    /* force the input stream PTS */
-    if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-        audio_size += pkt->size;
-    else if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        video_size += pkt->size;
-        ost->sync_opts++;
-    }
-
-    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->last_dts, 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 != AV_CODEC_ID_H264
-       && ost->st->codec->codec_id != AV_CODEC_ID_MPEG1VIDEO
-       && ost->st->codec->codec_id != AV_CODEC_ID_MPEG2VIDEO
-       && ost->st->codec->codec_id != AV_CODEC_ID_VC1
-       ) {
-        if (av_parser_change(ost->parser, ost->st->codec,
-                             &opkt.data, &opkt.size,
-                             pkt->data, pkt->size,
-                             pkt->flags & AV_PKT_FLAG_KEY)) {
-            opkt.buf = av_buffer_create(opkt.data, opkt.size, av_buffer_default_free, NULL, 0);
-            if (!opkt.buf)
-                exit_program(1);
-        }
-    } else {
-        opkt.data = pkt->data;
-        opkt.size = pkt->size;
-    }
-
-    write_frame(of->ctx, &opkt, ost);
-    ost->st->codec->frame_number++;
-}
-
-int guess_input_channel_layout(InputStream *ist)
-{
-    AVCodecContext *dec = ist->st->codec;
-
-    if (!dec->channel_layout) {
-        char layout_name[256];
-
-        dec->channel_layout = av_get_default_channel_layout(dec->channels);
-        if (!dec->channel_layout)
-            return 0;
-        av_get_channel_layout_string(layout_name, sizeof(layout_name),
-                                     dec->channels, dec->channel_layout);
-        av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for  Input Stream "
-               "#%d.%d : %s\n", ist->file_index, ist->st->index, layout_name);
-    }
-    return 1;
-}
-
-static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
-{
-    AVFrame *decoded_frame, *f;
-    AVCodecContext *avctx = ist->st->codec;
-    int i, ret, err = 0, resample_changed;
-
-    if (!ist->decoded_frame && !(ist->decoded_frame = av_frame_alloc()))
-        return AVERROR(ENOMEM);
-    if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))
-        return AVERROR(ENOMEM);
-    decoded_frame = ist->decoded_frame;
-
-    ret = avcodec_decode_audio4(avctx, decoded_frame, got_output, pkt);
-    if (!*got_output || ret < 0) {
-        if (!pkt->size) {
-            for (i = 0; i < ist->nb_filters; i++)
-                av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
-        }
-        return ret;
-    }
-
-    /* if the decoder provides a pts, use it instead of the last packet pts.
-       the decoder could be delaying output by a packet or more. */
-    if (decoded_frame->pts != AV_NOPTS_VALUE)
-        ist->next_dts = decoded_frame->pts;
-    else if (pkt->pts != AV_NOPTS_VALUE) {
-        decoded_frame->pts = pkt->pts;
-        pkt->pts           = AV_NOPTS_VALUE;
-    }
-
-    resample_changed = ist->resample_sample_fmt     != decoded_frame->format         ||
-                       ist->resample_channels       != avctx->channels               ||
-                       ist->resample_channel_layout != decoded_frame->channel_layout ||
-                       ist->resample_sample_rate    != decoded_frame->sample_rate;
-    if (resample_changed) {
-        char layout1[64], layout2[64];
-
-        if (!guess_input_channel_layout(ist)) {
-            av_log(NULL, AV_LOG_FATAL, "Unable to find default channel "
-                   "layout for Input Stream #%d.%d\n", ist->file_index,
-                   ist->st->index);
-            exit_program(1);
-        }
-        decoded_frame->channel_layout = avctx->channel_layout;
-
-        av_get_channel_layout_string(layout1, sizeof(layout1), ist->resample_channels,
-                                     ist->resample_channel_layout);
-        av_get_channel_layout_string(layout2, sizeof(layout2), avctx->channels,
-                                     decoded_frame->channel_layout);
-
-        av_log(NULL, AV_LOG_INFO,
-               "Input stream #%d:%d frame changed from rate:%d fmt:%s ch:%d chl:%s to rate:%d fmt:%s ch:%d chl:%s\n",
-               ist->file_index, ist->st->index,
-               ist->resample_sample_rate,  av_get_sample_fmt_name(ist->resample_sample_fmt),
-               ist->resample_channels, layout1,
-               decoded_frame->sample_rate, av_get_sample_fmt_name(decoded_frame->format),
-               avctx->channels, layout2);
-
-        ist->resample_sample_fmt     = decoded_frame->format;
-        ist->resample_sample_rate    = decoded_frame->sample_rate;
-        ist->resample_channel_layout = decoded_frame->channel_layout;
-        ist->resample_channels       = avctx->channels;
-
-        for (i = 0; i < nb_filtergraphs; i++)
-            if (ist_in_filtergraph(filtergraphs[i], ist) &&
-                configure_filtergraph(filtergraphs[i]) < 0) {
-                av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n");
-                exit_program(1);
-            }
-    }
-
-    if (decoded_frame->pts != AV_NOPTS_VALUE)
-        decoded_frame->pts = av_rescale_q(decoded_frame->pts,
-                                          ist->st->time_base,
-                                          (AVRational){1, ist->st->codec->sample_rate});
-    for (i = 0; i < ist->nb_filters; i++) {
-        if (i < ist->nb_filters - 1) {
-            f = ist->filter_frame;
-            err = av_frame_ref(f, decoded_frame);
-            if (err < 0)
-                break;
-        } else
-            f = decoded_frame;
-
-        err = av_buffersrc_add_frame(ist->filters[i]->filter, f);
-        if (err < 0)
-            break;
-    }
-
-    av_frame_unref(ist->filter_frame);
-    av_frame_unref(decoded_frame);
-    return err < 0 ? err : ret;
-}
-
-static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
-{
-    AVFrame *decoded_frame, *f;
-    int i, ret = 0, err = 0, resample_changed;
-
-    if (!ist->decoded_frame && !(ist->decoded_frame = av_frame_alloc()))
-        return AVERROR(ENOMEM);
-    if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))
-        return AVERROR(ENOMEM);
-    decoded_frame = ist->decoded_frame;
-
-    ret = avcodec_decode_video2(ist->st->codec,
-                                decoded_frame, got_output, pkt);
-    if (!*got_output || ret < 0) {
-        if (!pkt->size) {
-            for (i = 0; i < ist->nb_filters; i++)
-                av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
-        }
-        return ret;
-    }
-
-    if (ist->hwaccel_retrieve_data && decoded_frame->format == ist->hwaccel_pix_fmt) {
-        err = ist->hwaccel_retrieve_data(ist->st->codec, decoded_frame);
-        if (err < 0)
-            goto fail;
-    }
-    ist->hwaccel_retrieved_pix_fmt = decoded_frame->format;
-
-    decoded_frame->pts = guess_correct_pts(&ist->pts_ctx, decoded_frame->pkt_pts,
-                                           decoded_frame->pkt_dts);
-    pkt->size = 0;
-
-    if (ist->st->sample_aspect_ratio.num)
-        decoded_frame->sample_aspect_ratio = ist->st->sample_aspect_ratio;
-
-    resample_changed = ist->resample_width   != decoded_frame->width  ||
-                       ist->resample_height  != decoded_frame->height ||
-                       ist->resample_pix_fmt != decoded_frame->format;
-    if (resample_changed) {
-        av_log(NULL, AV_LOG_INFO,
-               "Input stream #%d:%d frame changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s\n",
-               ist->file_index, ist->st->index,
-               ist->resample_width,  ist->resample_height,  av_get_pix_fmt_name(ist->resample_pix_fmt),
-               decoded_frame->width, decoded_frame->height, av_get_pix_fmt_name(decoded_frame->format));
-
-        ret = poll_filters();
-        if (ret < 0 && (ret != AVERROR_EOF && ret != AVERROR(EAGAIN)))
-            av_log(NULL, AV_LOG_ERROR, "Error while filtering.\n");
-
-        ist->resample_width   = decoded_frame->width;
-        ist->resample_height  = decoded_frame->height;
-        ist->resample_pix_fmt = decoded_frame->format;
-
-        for (i = 0; i < nb_filtergraphs; i++)
-            if (ist_in_filtergraph(filtergraphs[i], ist) &&
-                configure_filtergraph(filtergraphs[i]) < 0) {
-                av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n");
-                exit_program(1);
-            }
-    }
-
-    for (i = 0; i < ist->nb_filters; i++) {
-        if (i < ist->nb_filters - 1) {
-            f = ist->filter_frame;
-            err = av_frame_ref(f, decoded_frame);
-            if (err < 0)
-                break;
-        } else
-            f = decoded_frame;
-
-        err = av_buffersrc_add_frame(ist->filters[i]->filter, f);
-        if (err < 0)
-            break;
-    }
-
-fail:
-    av_frame_unref(ist->filter_frame);
-    av_frame_unref(decoded_frame);
-    return err < 0 ? err : ret;
-}
-
-static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
-{
-    AVSubtitle subtitle;
-    int i, ret = avcodec_decode_subtitle2(ist->st->codec,
-                                          &subtitle, got_output, pkt);
-    if (ret < 0)
-        return ret;
-    if (!*got_output)
-        return ret;
-
-    for (i = 0; i < nb_output_streams; i++) {
-        OutputStream *ost = output_streams[i];
-
-        if (!check_output_constraints(ist, ost) || !ost->encoding_needed)
-            continue;
-
-        do_subtitle_out(output_files[ost->file_index]->ctx, ost, ist, &subtitle, pkt->pts);
-    }
-
-    avsubtitle_free(&subtitle);
-    return ret;
-}
-
-/* pkt = NULL means EOF (needed to flush decoder buffers) */
-static int output_packet(InputStream *ist, const AVPacket *pkt)
-{
-    int i;
-    int got_output;
-    AVPacket avpkt;
-
-    if (ist->next_dts == AV_NOPTS_VALUE)
-        ist->next_dts = ist->last_dts;
-
-    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_dts = ist->last_dts = 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 (ist->decoding_needed && (avpkt.size > 0 || (!pkt && got_output))) {
-        int ret = 0;
-    handle_eof:
-
-        ist->last_dts = ist->next_dts;
-
-        if (avpkt.size && avpkt.size != pkt->size) {
-            av_log(NULL, ist->showed_multi_packet_warning ? AV_LOG_VERBOSE : AV_LOG_WARNING,
-                   "Multiple frames in a packet from stream %d\n", pkt->stream_index);
-            ist->showed_multi_packet_warning = 1;
-        }
-
-        switch (ist->st->codec->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            ret = decode_audio    (ist, &avpkt, &got_output);
-            break;
-        case AVMEDIA_TYPE_VIDEO:
-            ret = decode_video    (ist, &avpkt, &got_output);
-            if (avpkt.duration)
-                ist->next_dts += av_rescale_q(avpkt.duration, ist->st->time_base, AV_TIME_BASE_Q);
-            else if (ist->st->avg_frame_rate.num)
-                ist->next_dts += av_rescale_q(1, av_inv_q(ist->st->avg_frame_rate),
-                                              AV_TIME_BASE_Q);
-            else 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_dts += av_rescale_q(ticks, ist->st->codec->time_base, AV_TIME_BASE_Q);
-            }
-            break;
-        case AVMEDIA_TYPE_SUBTITLE:
-            ret = transcode_subtitles(ist, &avpkt, &got_output);
-            break;
-        default:
-            return -1;
-        }
-
-        if (ret < 0)
-            return ret;
-        // touch data and size only if not EOF
-        if (pkt) {
-            avpkt.data += ret;
-            avpkt.size -= ret;
-        }
-        if (!got_output) {
-            continue;
-        }
-    }
-
-    /* handle stream copy */
-    if (!ist->decoding_needed) {
-        ist->last_dts = ist->next_dts;
-        switch (ist->st->codec->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            ist->next_dts += ((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_dts += ((int64_t)AV_TIME_BASE *
-                                  ist->st->codec->time_base.num * ticks) /
-                                  ist->st->codec->time_base.den;
-            }
-            break;
-        }
-    }
-    for (i = 0; pkt && i < nb_output_streams; i++) {
-        OutputStream *ost = output_streams[i];
-
-        if (!check_output_constraints(ist, ost) || ost->encoding_needed)
-            continue;
-
-        do_streamcopy(ist, ost, pkt);
-    }
-
-    return 0;
-}
-
-static void print_sdp(void)
-{
-    char sdp[16384];
-    int i;
-    AVFormatContext **avc = av_malloc(sizeof(*avc) * nb_output_files);
-
-    if (!avc)
-        exit_program(1);
-    for (i = 0; i < nb_output_files; i++)
-        avc[i] = output_files[i]->ctx;
-
-    av_sdp_create(avc, nb_output_files, sdp, sizeof(sdp));
-    printf("SDP:\n%s\n", sdp);
-    fflush(stdout);
-    av_freep(&avc);
-}
-
-static const HWAccel *get_hwaccel(enum AVPixelFormat pix_fmt)
-{
-    int i;
-    for (i = 0; hwaccels[i].name; i++)
-        if (hwaccels[i].pix_fmt == pix_fmt)
-            return &hwaccels[i];
-    return NULL;
-}
-
-static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
-{
-    InputStream *ist = s->opaque;
-    const enum AVPixelFormat *p;
-    int ret;
-
-    for (p = pix_fmts; *p != -1; p++) {
-        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p);
-        const HWAccel *hwaccel;
-
-        if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
-            break;
-
-        hwaccel = get_hwaccel(*p);
-        if (!hwaccel ||
-            (ist->active_hwaccel_id && ist->active_hwaccel_id != hwaccel->id) ||
-            (ist->hwaccel_id != HWACCEL_AUTO && ist->hwaccel_id != hwaccel->id))
-            continue;
-
-        ret = hwaccel->init(s);
-        if (ret < 0) {
-            if (ist->hwaccel_id == hwaccel->id) {
-                av_log(NULL, AV_LOG_FATAL,
-                       "%s hwaccel requested for input stream #%d:%d, "
-                       "but cannot be initialized.\n", hwaccel->name,
-                       ist->file_index, ist->st->index);
-                exit_program(1);
-            }
-            continue;
-        }
-        ist->active_hwaccel_id = hwaccel->id;
-        ist->hwaccel_pix_fmt   = *p;
-        break;
-    }
-
-    return *p;
-}
-
-static int get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
-{
-    InputStream *ist = s->opaque;
-
-    if (ist->hwaccel_get_buffer && frame->format == ist->hwaccel_pix_fmt)
-        return ist->hwaccel_get_buffer(s, frame, flags);
-
-    return avcodec_default_get_buffer2(s, frame, flags);
-}
-
-static int init_input_stream(int ist_index, char *error, int error_len)
-{
-    int i, ret;
-    InputStream *ist = input_streams[ist_index];
-    if (ist->decoding_needed) {
-        AVCodec *codec = ist->dec;
-        if (!codec) {
-            snprintf(error, error_len, "Decoder (codec id %d) not found for input stream #%d:%d",
-                    ist->st->codec->codec_id, ist->file_index, ist->st->index);
-            return AVERROR(EINVAL);
-        }
-
-        /* update requested sample format for the decoder based on the
-           corresponding encoder sample format */
-        for (i = 0; i < nb_output_streams; i++) {
-            OutputStream *ost = output_streams[i];
-            if (ost->source_index == ist_index) {
-                update_sample_fmt(ist->st->codec, codec, ost->st->codec);
-                break;
-            }
-        }
-
-        ist->st->codec->opaque      = ist;
-        ist->st->codec->get_format  = get_format;
-        ist->st->codec->get_buffer2 = get_buffer;
-        ist->st->codec->thread_safe_callbacks = 1;
-
-        av_opt_set_int(ist->st->codec, "refcounted_frames", 1, 0);
-
-        if (!av_dict_get(ist->opts, "threads", NULL, 0))
-            av_dict_set(&ist->opts, "threads", "auto", 0);
-        if ((ret = avcodec_open2(ist->st->codec, codec, &ist->opts)) < 0) {
-            char errbuf[128];
-            if (ret == AVERROR_EXPERIMENTAL)
-                abort_codec_experimental(codec, 0);
-
-            av_strerror(ret, errbuf, sizeof(errbuf));
-
-            snprintf(error, error_len,
-                     "Error while opening decoder for input stream "
-                     "#%d:%d : %s",
-                     ist->file_index, ist->st->index, errbuf);
-            return ret;
-        }
-        assert_avoptions(ist->opts);
-    }
-
-    ist->last_dts = ist->st->avg_frame_rate.num ? - ist->st->codec->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
-    ist->next_dts = AV_NOPTS_VALUE;
-    init_pts_correction(&ist->pts_ctx);
-    ist->is_start = 1;
-
-    return 0;
-}
-
-static InputStream *get_input_stream(OutputStream *ost)
-{
-    if (ost->source_index >= 0)
-        return input_streams[ost->source_index];
-
-    if (ost->filter) {
-        FilterGraph *fg = ost->filter->graph;
-        int i;
-
-        for (i = 0; i < fg->nb_inputs; i++)
-            if (fg->inputs[i]->ist->st->codec->codec_type == ost->st->codec->codec_type)
-                return fg->inputs[i]->ist;
-    }
-
-    return NULL;
-}
-
-static void parse_forced_key_frames(char *kf, OutputStream *ost,
-                                    AVCodecContext *avctx)
-{
-    char *p;
-    int n = 1, i;
-    int64_t t;
-
-    for (p = kf; *p; p++)
-        if (*p == ',')
-            n++;
-    ost->forced_kf_count = n;
-    ost->forced_kf_pts   = av_malloc(sizeof(*ost->forced_kf_pts) * n);
-    if (!ost->forced_kf_pts) {
-        av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n");
-        exit_program(1);
-    }
-
-    p = kf;
-    for (i = 0; i < n; i++) {
-        char *next = strchr(p, ',');
-
-        if (next)
-            *next++ = 0;
-
-        t = parse_time_or_die("force_key_frames", p, 1);
-        ost->forced_kf_pts[i] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base);
-
-        p = next;
-    }
-}
-
-static int transcode_init(void)
-{
-    int ret = 0, i, j, k;
-    AVFormatContext *oc;
-    AVCodecContext *codec;
-    OutputStream *ost;
-    InputStream *ist;
-    char error[1024];
-    int want_sdp = 1;
-
-    /* init framerate emulation */
-    for (i = 0; i < nb_input_files; i++) {
-        InputFile *ifile = input_files[i];
-        if (ifile->rate_emu)
-            for (j = 0; j < ifile->nb_streams; j++)
-                input_streams[j + ifile->ist_index]->start = av_gettime();
-    }
-
-    /* output stream init */
-    for (i = 0; i < nb_output_files; i++) {
-        oc = output_files[i]->ctx;
-        if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) {
-            av_dump_format(oc, i, oc->filename, 1);
-            av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any stream\n", i);
-            return AVERROR(EINVAL);
-        }
-    }
-
-    /* init complex filtergraphs */
-    for (i = 0; i < nb_filtergraphs; i++)
-        if ((ret = avfilter_graph_config(filtergraphs[i]->graph, NULL)) < 0)
-            return ret;
-
-    /* for each output stream, we compute the right encoding parameters */
-    for (i = 0; i < nb_output_streams; i++) {
-        AVCodecContext *icodec = NULL;
-        ost = output_streams[i];
-        oc  = output_files[ost->file_index]->ctx;
-        ist = get_input_stream(ost);
-
-        if (ost->attachment_filename)
-            continue;
-
-        codec  = ost->st->codec;
-
-        if (ist) {
-            icodec = ist->st->codec;
-
-            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->stream_copy) {
-            AVRational sar;
-            uint64_t extra_size;
-
-            av_assert0(ist && !ost->filter);
-
-            extra_size = (uint64_t)icodec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE;
-
-            if (extra_size > INT_MAX) {
-                return AVERROR(EINVAL);
-            }
-
-            /* 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 (!oc->oformat->codec_tag ||
-                     av_codec_get_id (oc->oformat->codec_tag, icodec->codec_tag) == codec->codec_id ||
-                     av_codec_get_tag(oc->oformat->codec_tag, icodec->codec_id) <= 0)
-                    codec->codec_tag = icodec->codec_tag;
-            }
-
-            codec->bit_rate       = icodec->bit_rate;
-            codec->rc_max_rate    = icodec->rc_max_rate;
-            codec->rc_buffer_size = icodec->rc_buffer_size;
-            codec->field_order    = icodec->field_order;
-            codec->extradata      = av_mallocz(extra_size);
-            if (!codec->extradata) {
-                return AVERROR(ENOMEM);
-            }
-            memcpy(codec->extradata, icodec->extradata, icodec->extradata_size);
-            codec->extradata_size = icodec->extradata_size;
-            if (!copy_tb) {
-                codec->time_base      = icodec->time_base;
-                codec->time_base.num *= icodec->ticks_per_frame;
-                av_reduce(&codec->time_base.num, &codec->time_base.den,
-                          codec->time_base.num, codec->time_base.den, INT_MAX);
-            } else
-                codec->time_base = ist->st->time_base;
-
-            ost->parser = av_parser_init(codec->codec_id);
-
-            switch (codec->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-                if (audio_volume != 256) {
-                    av_log(NULL, AV_LOG_FATAL, "-acodec copy and -vol are incompatible (frames are not decoded)\n");
-                    exit_program(1);
-                }
-                codec->channel_layout     = icodec->channel_layout;
-                codec->sample_rate        = icodec->sample_rate;
-                codec->channels           = icodec->channels;
-                codec->frame_size         = icodec->frame_size;
-                codec->audio_service_type = icodec->audio_service_type;
-                codec->block_align        = icodec->block_align;
-                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;
-                if (ost->frame_aspect_ratio)
-                    sar = av_d2q(ost->frame_aspect_ratio * codec->height / codec->width, 255);
-                else if (ist->st->sample_aspect_ratio.num)
-                    sar = ist->st->sample_aspect_ratio;
-                else
-                    sar = icodec->sample_aspect_ratio;
-                ost->st->sample_aspect_ratio = codec->sample_aspect_ratio = sar;
-                break;
-            case AVMEDIA_TYPE_SUBTITLE:
-                codec->width  = icodec->width;
-                codec->height = icodec->height;
-                break;
-            case AVMEDIA_TYPE_DATA:
-            case AVMEDIA_TYPE_ATTACHMENT:
-                break;
-            default:
-                abort();
-            }
-        } else {
-            if (!ost->enc) {
-                /* should only happen when a default codec is not present. */
-                snprintf(error, sizeof(error), "Automatic encoder selection "
-                         "failed for output stream #%d:%d. Default encoder for "
-                         "format %s is probably disabled. Please choose an "
-                         "encoder manually.\n", ost->file_index, ost->index,
-                         oc->oformat->name);
-                ret = AVERROR(EINVAL);
-                goto dump_format;
-            }
-
-            if (ist)
-                ist->decoding_needed = 1;
-            ost->encoding_needed = 1;
-
-            /*
-             * We want CFR output if and only if one of those is true:
-             * 1) user specified output framerate with -r
-             * 2) user specified -vsync cfr
-             * 3) output format is CFR and the user didn't force vsync to
-             *    something else than CFR
-             *
-             * in such a case, set ost->frame_rate
-             */
-            if (codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-                !ost->frame_rate.num && ist &&
-                (video_sync_method ==  VSYNC_CFR ||
-                 (video_sync_method ==  VSYNC_AUTO &&
-                  !(oc->oformat->flags & (AVFMT_NOTIMESTAMPS | AVFMT_VARIABLE_FPS))))) {
-                if (ist->framerate.num)
-                    ost->frame_rate = ist->framerate;
-                else if (ist->st->avg_frame_rate.num)
-                    ost->frame_rate = ist->st->avg_frame_rate;
-                else {
-                    av_log(NULL, AV_LOG_WARNING, "Constant framerate requested "
-                           "for the output stream #%d:%d, but no information "
-                           "about the input framerate is available. Falling "
-                           "back to a default value of 25fps. Use the -r option "
-                           "if you want a different framerate.\n",
-                           ost->file_index, ost->index);
-                    ost->frame_rate = (AVRational){ 25, 1 };
-                }
-
-                if (ost->enc && ost->enc->supported_framerates && !ost->force_fps) {
-                    int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates);
-                    ost->frame_rate = ost->enc->supported_framerates[idx];
-                }
-            }
-
-            if (!ost->filter &&
-                (codec->codec_type == AVMEDIA_TYPE_VIDEO ||
-                 codec->codec_type == AVMEDIA_TYPE_AUDIO)) {
-                    FilterGraph *fg;
-                    fg = init_simple_filtergraph(ist, ost);
-                    if (configure_filtergraph(fg)) {
-                        av_log(NULL, AV_LOG_FATAL, "Error opening filters!\n");
-                        exit_program(1);
-                    }
-            }
-
-            switch (codec->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-                codec->sample_fmt     = ost->filter->filter->inputs[0]->format;
-                codec->sample_rate    = ost->filter->filter->inputs[0]->sample_rate;
-                codec->channel_layout = ost->filter->filter->inputs[0]->channel_layout;
-                codec->channels       = av_get_channel_layout_nb_channels(codec->channel_layout);
-                codec->time_base      = (AVRational){ 1, codec->sample_rate };
-                break;
-            case AVMEDIA_TYPE_VIDEO:
-                codec->time_base = ost->filter->filter->inputs[0]->time_base;
-
-                codec->width  = ost->filter->filter->inputs[0]->w;
-                codec->height = ost->filter->filter->inputs[0]->h;
-                codec->sample_aspect_ratio = ost->st->sample_aspect_ratio =
-                    ost->frame_aspect_ratio ? // overridden by the -aspect cli option
-                    av_d2q(ost->frame_aspect_ratio * codec->height/codec->width, 255) :
-                    ost->filter->filter->inputs[0]->sample_aspect_ratio;
-                codec->pix_fmt = ost->filter->filter->inputs[0]->format;
-
-                if (icodec &&
-                    (codec->width   != icodec->width  ||
-                     codec->height  != icodec->height ||
-                     codec->pix_fmt != icodec->pix_fmt)) {
-                    codec->bits_per_raw_sample = 0;
-                }
-
-                if (ost->forced_keyframes)
-                    parse_forced_key_frames(ost->forced_keyframes, ost,
-                                            ost->st->codec);
-                break;
-            case AVMEDIA_TYPE_SUBTITLE:
-                codec->time_base = (AVRational){1, 1000};
-                break;
-            default:
-                abort();
-                break;
-            }
-            /* two pass mode */
-            if ((codec->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2))) {
-                char logfilename[1024];
-                FILE *f;
-
-                snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
-                         ost->logfile_prefix ? ost->logfile_prefix :
-                                               DEFAULT_PASS_LOGFILENAME_PREFIX,
-                         i);
-                if (!strcmp(ost->enc->name, "libx264")) {
-                    av_dict_set(&ost->opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
-                } else {
-                    if (codec->flags & CODEC_FLAG_PASS1) {
-                        f = fopen(logfilename, "wb");
-                        if (!f) {
-                            av_log(NULL, AV_LOG_FATAL, "Cannot write log file '%s' for pass-1 encoding: %s\n",
-                                   logfilename, strerror(errno));
-                            exit_program(1);
-                        }
-                        ost->logfile = f;
-                    } else {
-                        char  *logbuffer;
-                        size_t logbuffer_size;
-                        if (cmdutils_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
-                            av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
-                                   logfilename);
-                            exit_program(1);
-                        }
-                        codec->stats_in = logbuffer;
-                    }
-                }
-            }
-        }
-    }
-
-    /* open each encoder */
-    for (i = 0; i < nb_output_streams; i++) {
-        ost = output_streams[i];
-        if (ost->encoding_needed) {
-            AVCodec      *codec = ost->enc;
-            AVCodecContext *dec = NULL;
-
-            if ((ist = get_input_stream(ost)))
-                dec = ist->st->codec;
-            if (dec && dec->subtitle_header) {
-                ost->st->codec->subtitle_header = av_malloc(dec->subtitle_header_size);
-                if (!ost->st->codec->subtitle_header) {
-                    ret = AVERROR(ENOMEM);
-                    goto dump_format;
-                }
-                memcpy(ost->st->codec->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
-                ost->st->codec->subtitle_header_size = dec->subtitle_header_size;
-            }
-            if (!av_dict_get(ost->opts, "threads", NULL, 0))
-                av_dict_set(&ost->opts, "threads", "auto", 0);
-            if ((ret = avcodec_open2(ost->st->codec, codec, &ost->opts)) < 0) {
-                if (ret == AVERROR_EXPERIMENTAL)
-                    abort_codec_experimental(codec, 1);
-                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);
-                goto dump_format;
-            }
-            assert_avoptions(ost->opts);
-            if (ost->st->codec->bit_rate && ost->st->codec->bit_rate < 1000)
-                av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
-                                             "It takes bits/s as argument, not kbits/s\n");
-            extra_size += ost->st->codec->extradata_size;
-        } else {
-            av_opt_set_dict(ost->st->codec, &ost->opts);
-        }
-    }
-
-    /* init input streams */
-    for (i = 0; i < nb_input_streams; i++)
-        if ((ret = init_input_stream(i, error, sizeof(error))) < 0)
-            goto dump_format;
-
-    /* discard unused programs */
-    for (i = 0; i < nb_input_files; i++) {
-        InputFile *ifile = input_files[i];
-        for (j = 0; j < ifile->ctx->nb_programs; j++) {
-            AVProgram *p = ifile->ctx->programs[j];
-            int discard  = AVDISCARD_ALL;
-
-            for (k = 0; k < p->nb_stream_indexes; k++)
-                if (!input_streams[ifile->ist_index + p->stream_index[k]]->discard) {
-                    discard = AVDISCARD_DEFAULT;
-                    break;
-                }
-            p->discard = discard;
-        }
-    }
-
-    /* open files and write file headers */
-    for (i = 0; i < nb_output_files; i++) {
-        oc = output_files[i]->ctx;
-        oc->interrupt_callback = int_cb;
-        if ((ret = avformat_write_header(oc, &output_files[i]->opts)) < 0) {
-            char errbuf[128];
-            av_strerror(ret, errbuf, sizeof(errbuf));
-            snprintf(error, sizeof(error),
-                     "Could not write header for output file #%d "
-                     "(incorrect codec parameters ?): %s",
-                     i, errbuf);
-            ret = AVERROR(EINVAL);
-            goto dump_format;
-        }
-        assert_avoptions(output_files[i]->opts);
-        if (strcmp(oc->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++) {
-        av_dump_format(output_files[i]->ctx, i, output_files[i]->ctx->filename, 1);
-    }
-
-    /* dump the stream mapping */
-    av_log(NULL, AV_LOG_INFO, "Stream mapping:\n");
-    for (i = 0; i < nb_input_streams; i++) {
-        ist = input_streams[i];
-
-        for (j = 0; j < ist->nb_filters; j++) {
-            if (ist->filters[j]->graph->graph_desc) {
-                av_log(NULL, AV_LOG_INFO, "  Stream #%d:%d (%s) -> %s",
-                       ist->file_index, ist->st->index, ist->dec ? ist->dec->name : "?",
-                       ist->filters[j]->name);
-                if (nb_filtergraphs > 1)
-                    av_log(NULL, AV_LOG_INFO, " (graph %d)", ist->filters[j]->graph->index);
-                av_log(NULL, AV_LOG_INFO, "\n");
-            }
-        }
-    }
-
-    for (i = 0; i < nb_output_streams; i++) {
-        ost = output_streams[i];
-
-        if (ost->attachment_filename) {
-            /* an attached file */
-            av_log(NULL, AV_LOG_INFO, "  File %s -> Stream #%d:%d\n",
-                   ost->attachment_filename, ost->file_index, ost->index);
-            continue;
-        }
-
-        if (ost->filter && ost->filter->graph->graph_desc) {
-            /* output from a complex graph */
-            av_log(NULL, AV_LOG_INFO, "  %s", ost->filter->name);
-            if (nb_filtergraphs > 1)
-                av_log(NULL, AV_LOG_INFO, " (graph %d)", ost->filter->graph->index);
-
-            av_log(NULL, AV_LOG_INFO, " -> Stream #%d:%d (%s)\n", ost->file_index,
-                   ost->index, ost->enc ? ost->enc->name : "?");
-            continue;
-        }
-
-        av_log(NULL, AV_LOG_INFO, "  Stream #%d:%d -> #%d:%d",
-               input_streams[ost->source_index]->file_index,
-               input_streams[ost->source_index]->st->index,
-               ost->file_index,
-               ost->index);
-        if (ost->sync_ist != input_streams[ost->source_index])
-            av_log(NULL, AV_LOG_INFO, " [sync #%d:%d]",
-                   ost->sync_ist->file_index,
-                   ost->sync_ist->st->index);
-        if (ost->stream_copy)
-            av_log(NULL, AV_LOG_INFO, " (copy)");
-        else
-            av_log(NULL, AV_LOG_INFO, " (%s -> %s)", input_streams[ost->source_index]->dec ?
-                   input_streams[ost->source_index]->dec->name : "?",
-                   ost->enc ? ost->enc->name : "?");
-        av_log(NULL, AV_LOG_INFO, "\n");
-    }
-
-    if (ret) {
-        av_log(NULL, AV_LOG_ERROR, "%s\n", error);
-        return ret;
-    }
-
-    if (want_sdp) {
-        print_sdp();
-    }
-
-    return 0;
-}
-
-/* Return 1 if there remain streams where more output is wanted, 0 otherwise. */
-static int need_output(void)
-{
-    int i;
-
-    for (i = 0; i < nb_output_streams; i++) {
-        OutputStream *ost    = output_streams[i];
-        OutputFile *of       = output_files[ost->file_index];
-        AVFormatContext *os  = output_files[ost->file_index]->ctx;
-
-        if (ost->finished ||
-            (os->pb && avio_tell(os->pb) >= of->limit_filesize))
-            continue;
-        if (ost->frame_number >= ost->max_frames) {
-            int j;
-            for (j = 0; j < of->ctx->nb_streams; j++)
-                output_streams[of->ost_index + j]->finished = 1;
-            continue;
-        }
-
-        return 1;
-    }
-
-    return 0;
-}
-
-static InputFile *select_input_file(void)
-{
-    InputFile *ifile = NULL;
-    int64_t ipts_min = INT64_MAX;
-    int i;
-
-    for (i = 0; i < nb_input_streams; i++) {
-        InputStream *ist = input_streams[i];
-        int64_t ipts     = ist->last_dts;
-
-        if (ist->discard || input_files[ist->file_index]->eagain)
-            continue;
-        if (!input_files[ist->file_index]->eof_reached) {
-            if (ipts < ipts_min) {
-                ipts_min = ipts;
-                ifile    = input_files[ist->file_index];
-            }
-        }
-    }
-
-    return ifile;
-}
-
-#if HAVE_PTHREADS
-static void *input_thread(void *arg)
-{
-    InputFile *f = arg;
-    int ret = 0;
-
-    while (!transcoding_finished && ret >= 0) {
-        AVPacket pkt;
-        ret = av_read_frame(f->ctx, &pkt);
-
-        if (ret == AVERROR(EAGAIN)) {
-            av_usleep(10000);
-            ret = 0;
-            continue;
-        } else if (ret < 0)
-            break;
-
-        pthread_mutex_lock(&f->fifo_lock);
-        while (!av_fifo_space(f->fifo))
-            pthread_cond_wait(&f->fifo_cond, &f->fifo_lock);
-
-        av_dup_packet(&pkt);
-        av_fifo_generic_write(f->fifo, &pkt, sizeof(pkt), NULL);
-
-        pthread_mutex_unlock(&f->fifo_lock);
-    }
-
-    f->finished = 1;
-    return NULL;
-}
-
-static void free_input_threads(void)
-{
-    int i;
-
-    if (nb_input_files == 1)
-        return;
-
-    transcoding_finished = 1;
-
-    for (i = 0; i < nb_input_files; i++) {
-        InputFile *f = input_files[i];
-        AVPacket pkt;
-
-        if (!f->fifo || f->joined)
-            continue;
-
-        pthread_mutex_lock(&f->fifo_lock);
-        while (av_fifo_size(f->fifo)) {
-            av_fifo_generic_read(f->fifo, &pkt, sizeof(pkt), NULL);
-            av_free_packet(&pkt);
-        }
-        pthread_cond_signal(&f->fifo_cond);
-        pthread_mutex_unlock(&f->fifo_lock);
-
-        pthread_join(f->thread, NULL);
-        f->joined = 1;
-
-        while (av_fifo_size(f->fifo)) {
-            av_fifo_generic_read(f->fifo, &pkt, sizeof(pkt), NULL);
-            av_free_packet(&pkt);
-        }
-        av_fifo_free(f->fifo);
-    }
-}
-
-static int init_input_threads(void)
-{
-    int i, ret;
-
-    if (nb_input_files == 1)
-        return 0;
-
-    for (i = 0; i < nb_input_files; i++) {
-        InputFile *f = input_files[i];
-
-        if (!(f->fifo = av_fifo_alloc(8*sizeof(AVPacket))))
-            return AVERROR(ENOMEM);
-
-        pthread_mutex_init(&f->fifo_lock, NULL);
-        pthread_cond_init (&f->fifo_cond, NULL);
-
-        if ((ret = pthread_create(&f->thread, NULL, input_thread, f)))
-            return AVERROR(ret);
-    }
-    return 0;
-}
-
-static int get_input_packet_mt(InputFile *f, AVPacket *pkt)
-{
-    int ret = 0;
-
-    pthread_mutex_lock(&f->fifo_lock);
-
-    if (av_fifo_size(f->fifo)) {
-        av_fifo_generic_read(f->fifo, pkt, sizeof(*pkt), NULL);
-        pthread_cond_signal(&f->fifo_cond);
-    } else {
-        if (f->finished)
-            ret = AVERROR_EOF;
-        else
-            ret = AVERROR(EAGAIN);
-    }
-
-    pthread_mutex_unlock(&f->fifo_lock);
-
-    return ret;
-}
-#endif
-
-static int get_input_packet(InputFile *f, AVPacket *pkt)
-{
-    if (f->rate_emu) {
-        int i;
-        for (i = 0; i < f->nb_streams; i++) {
-            InputStream *ist = input_streams[f->ist_index + i];
-            int64_t pts = av_rescale(ist->last_dts, 1000000, AV_TIME_BASE);
-            int64_t now = av_gettime() - ist->start;
-            if (pts > now)
-                return AVERROR(EAGAIN);
-        }
-    }
-
-#if HAVE_PTHREADS
-    if (nb_input_files > 1)
-        return get_input_packet_mt(f, pkt);
-#endif
-    return av_read_frame(f->ctx, pkt);
-}
-
-static int got_eagain(void)
-{
-    int i;
-    for (i = 0; i < nb_input_files; i++)
-        if (input_files[i]->eagain)
-            return 1;
-    return 0;
-}
-
-static void reset_eagain(void)
-{
-    int i;
-    for (i = 0; i < nb_input_files; i++)
-        input_files[i]->eagain = 0;
-}
-
-/*
- * Read one packet from an input file and send it for
- * - decoding -> lavfi (audio/video)
- * - decoding -> encoding -> muxing (subtitles)
- * - muxing (streamcopy)
- *
- * Return
- * - 0 -- one packet was read and processed
- * - AVERROR(EAGAIN) -- no packets were available for selected file,
- *   this function should be called again
- * - AVERROR_EOF -- this function should not be called again
- */
-static int process_input(void)
-{
-    InputFile *ifile;
-    AVFormatContext *is;
-    InputStream *ist;
-    AVPacket pkt;
-    int ret, i, j;
-
-    /* select the stream that we must read now */
-    ifile = select_input_file();
-    /* if none, if is finished */
-    if (!ifile) {
-        if (got_eagain()) {
-            reset_eagain();
-            av_usleep(10000);
-            return AVERROR(EAGAIN);
-        }
-        av_log(NULL, AV_LOG_VERBOSE, "No more inputs to read from.\n");
-        return AVERROR_EOF;
-    }
-
-    is  = ifile->ctx;
-    ret = get_input_packet(ifile, &pkt);
-
-    if (ret == AVERROR(EAGAIN)) {
-        ifile->eagain = 1;
-        return ret;
-    }
-    if (ret < 0) {
-        if (ret != AVERROR_EOF) {
-            print_error(is->filename, ret);
-            if (exit_on_error)
-                exit_program(1);
-        }
-        ifile->eof_reached = 1;
-
-        for (i = 0; i < ifile->nb_streams; i++) {
-            ist = input_streams[ifile->ist_index + i];
-            if (ist->decoding_needed)
-                output_packet(ist, NULL);
-
-            /* mark all outputs that don't go through lavfi as finished */
-            for (j = 0; j < nb_output_streams; j++) {
-                OutputStream *ost = output_streams[j];
-
-                if (ost->source_index == ifile->ist_index + i &&
-                    (ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE))
-                    ost->finished= 1;
-            }
-        }
-
-        return AVERROR(EAGAIN);
-    }
-
-    reset_eagain();
-
-    if (do_pkt_dump) {
-        av_pkt_dump_log2(NULL, AV_LOG_DEBUG, &pkt, do_hex_dump,
-                         is->streams[pkt.stream_index]);
-    }
-    /* the following test is needed in case new streams appear
-       dynamically in stream : we ignore them */
-    if (pkt.stream_index >= ifile->nb_streams)
-        goto discard_packet;
-
-    ist = input_streams[ifile->ist_index + pkt.stream_index];
-    if (ist->discard)
-        goto discard_packet;
-
-    if (pkt.dts != AV_NOPTS_VALUE)
-        pkt.dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base);
-    if (pkt.pts != AV_NOPTS_VALUE)
-        pkt.pts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base);
-
-    if (pkt.pts != AV_NOPTS_VALUE)
-        pkt.pts *= ist->ts_scale;
-    if (pkt.dts != AV_NOPTS_VALUE)
-        pkt.dts *= ist->ts_scale;
-
-    if (pkt.dts != AV_NOPTS_VALUE && ist->next_dts != 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_dts;
-
-        if ((FFABS(delta) > 1LL * dts_delta_threshold * AV_TIME_BASE || pkt_dts + 1 < ist->last_dts) && !copy_ts) {
-            ifile->ts_offset -= delta;
-            av_log(NULL, AV_LOG_DEBUG,
-                   "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",
-                   delta, ifile->ts_offset);
-            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);
-        }
-    }
-
-    ret = output_packet(ist, &pkt);
-    if (ret < 0) {
-        av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d\n",
-               ist->file_index, ist->st->index);
-        if (exit_on_error)
-            exit_program(1);
-    }
-
-discard_packet:
-    av_free_packet(&pkt);
-
-    return 0;
-}
-
-/*
- * The following code is the main loop of the file converter
- */
-static int transcode(void)
-{
-    int ret, i, need_input = 1;
-    AVFormatContext *os;
-    OutputStream *ost;
-    InputStream *ist;
-    int64_t timer_start;
-
-    ret = transcode_init();
-    if (ret < 0)
-        goto fail;
-
-    av_log(NULL, AV_LOG_INFO, "Press ctrl-c to stop encoding\n");
-    term_init();
-
-    timer_start = av_gettime();
-
-#if HAVE_PTHREADS
-    if ((ret = init_input_threads()) < 0)
-        goto fail;
-#endif
-
-    while (!received_sigterm) {
-        /* check if there's any stream where output is still needed */
-        if (!need_output()) {
-            av_log(NULL, AV_LOG_VERBOSE, "No more output streams to write to, finishing.\n");
-            break;
-        }
-
-        /* read and process one input packet if needed */
-        if (need_input) {
-            ret = process_input();
-            if (ret == AVERROR_EOF)
-                need_input = 0;
-        }
-
-        ret = poll_filters();
-        if (ret < 0) {
-            if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN))
-                continue;
-
-            av_log(NULL, AV_LOG_ERROR, "Error while filtering.\n");
-            break;
-        }
-
-        /* dump report by using the output first video and audio streams */
-        print_report(0, timer_start);
-    }
-#if HAVE_PTHREADS
-    free_input_threads();
-#endif
-
-    /* at the end of stream, we must flush the decoder buffers */
-    for (i = 0; i < nb_input_streams; i++) {
-        ist = input_streams[i];
-        if (!input_files[ist->file_index]->eof_reached && ist->decoding_needed) {
-            output_packet(ist, NULL);
-        }
-    }
-    poll_filters();
-    flush_encoders();
-
-    term_exit();
-
-    /* write the trailer if needed and close file */
-    for (i = 0; i < nb_output_files; i++) {
-        os = output_files[i]->ctx;
-        av_write_trailer(os);
-    }
-
-    /* dump report by using the first video and audio streams */
-    print_report(1, timer_start);
-
-    /* close each encoder */
-    for (i = 0; i < nb_output_streams; i++) {
-        ost = output_streams[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_input_streams; i++) {
-        ist = input_streams[i];
-        if (ist->decoding_needed) {
-            avcodec_close(ist->st->codec);
-            if (ist->hwaccel_uninit)
-                ist->hwaccel_uninit(ist->st->codec);
-        }
-    }
-
-    /* finished ! */
-    ret = 0;
-
- fail:
-#if HAVE_PTHREADS
-    free_input_threads();
-#endif
-
-    if (output_streams) {
-        for (i = 0; i < nb_output_streams; i++) {
-            ost = output_streams[i];
-            if (ost) {
-                if (ost->stream_copy)
-                    av_freep(&ost->st->codec->extradata);
-                if (ost->logfile) {
-                    fclose(ost->logfile);
-                    ost->logfile = NULL;
-                }
-                av_freep(&ost->st->codec->subtitle_header);
-                av_free(ost->forced_kf_pts);
-                av_dict_free(&ost->opts);
-                av_dict_free(&ost->resample_opts);
-            }
-        }
-    }
-    return ret;
-}
-
-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
-}
-
-int main(int argc, char **argv)
-{
-    int ret;
-    int64_t ti;
-
-    register_exit(avconv_cleanup);
-
-    av_log_set_flags(AV_LOG_SKIP_REPEATED);
-    parse_loglevel(argc, argv, options);
-
-    avcodec_register_all();
-#if CONFIG_AVDEVICE
-    avdevice_register_all();
-#endif
-    avfilter_register_all();
-    av_register_all();
-    avformat_network_init();
-
-    show_banner();
-
-    /* parse options and open all input/output files */
-    ret = avconv_parse_options(argc, argv);
-    if (ret < 0)
-        exit_program(1);
-
-    if (nb_output_files <= 0 && nb_input_files == 0) {
-        show_usage();
-        av_log(NULL, AV_LOG_WARNING, "Use -h to get full help or, even better, run 'man %s'\n", program_name);
-        exit_program(1);
-    }
-
-    /* file converter / grab */
-    if (nb_output_files <= 0) {
-        fprintf(stderr, "At least one output file must be specified\n");
-        exit_program(1);
-    }
-
-    ti = getutime();
-    if (transcode() < 0)
-        exit_program(1);
-    ti = getutime() - ti;
-    if (do_benchmark) {
-        int maxrss = getmaxrss() / 1024;
-        printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
-    }
-
-    exit_program(0);
-    return 0;
-}
diff --git a/deps/libav/avconv.h b/deps/libav/avconv.h
deleted file mode 100644
index c270401..0000000
--- a/deps/libav/avconv.h
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCONV_H
-#define AVCONV_H
-
-#include "config.h"
-
-#include <stdint.h>
-#include <stdio.h>
-
-#if HAVE_PTHREADS
-#include <pthread.h>
-#endif
-
-#include "cmdutils.h"
-
-#include "libavformat/avformat.h"
-#include "libavformat/avio.h"
-
-#include "libavcodec/avcodec.h"
-
-#include "libavfilter/avfilter.h"
-
-#include "libavutil/avutil.h"
-#include "libavutil/dict.h"
-#include "libavutil/fifo.h"
-#include "libavutil/pixfmt.h"
-#include "libavutil/rational.h"
-
-#define VSYNC_AUTO       -1
-#define VSYNC_PASSTHROUGH 0
-#define VSYNC_CFR         1
-#define VSYNC_VFR         2
-
-enum HWAccelID {
-    HWACCEL_NONE = 0,
-    HWACCEL_AUTO,
-    HWACCEL_VDPAU,
-};
-
-typedef struct HWAccel {
-    const char *name;
-    int (*init)(AVCodecContext *s);
-    enum HWAccelID id;
-    enum AVPixelFormat pix_fmt;
-} HWAccel;
-
-/* select an input stream for an output stream */
-typedef struct StreamMap {
-    int disabled;           /* 1 is this mapping is disabled by a negative map */
-    int file_index;
-    int stream_index;
-    int sync_file_index;
-    int sync_stream_index;
-    char *linklabel;       /* name of an output link, for mapping lavfi outputs */
-} StreamMap;
-
-/* select an input file for an output file */
-typedef struct MetadataMap {
-    int  file;      // file index
-    char type;      // type of metadata to copy -- (g)lobal, (s)tream, (c)hapter or (p)rogram
-    int  index;     // stream/chapter/program number
-} MetadataMap;
-
-typedef struct OptionsContext {
-    OptionGroup *g;
-
-    /* input/output options */
-    int64_t start_time;
-    const char *format;
-
-    SpecifierOpt *codec_names;
-    int        nb_codec_names;
-    SpecifierOpt *audio_channels;
-    int        nb_audio_channels;
-    SpecifierOpt *audio_sample_rate;
-    int        nb_audio_sample_rate;
-    SpecifierOpt *frame_rates;
-    int        nb_frame_rates;
-    SpecifierOpt *frame_sizes;
-    int        nb_frame_sizes;
-    SpecifierOpt *frame_pix_fmts;
-    int        nb_frame_pix_fmts;
-
-    /* input options */
-    int64_t input_ts_offset;
-    int rate_emu;
-    int accurate_seek;
-
-    SpecifierOpt *ts_scale;
-    int        nb_ts_scale;
-    SpecifierOpt *dump_attachment;
-    int        nb_dump_attachment;
-    SpecifierOpt *hwaccels;
-    int        nb_hwaccels;
-    SpecifierOpt *hwaccel_devices;
-    int        nb_hwaccel_devices;
-
-    /* output options */
-    StreamMap *stream_maps;
-    int     nb_stream_maps;
-    /* first item specifies output metadata, second is input */
-    MetadataMap (*meta_data_maps)[2];
-    int nb_meta_data_maps;
-    int metadata_global_manual;
-    int metadata_streams_manual;
-    int metadata_chapters_manual;
-    const char **attachments;
-    int       nb_attachments;
-
-    int chapters_input_file;
-
-    int64_t recording_time;
-    uint64_t limit_filesize;
-    float mux_preload;
-    float mux_max_delay;
-    int shortest;
-
-    int video_disable;
-    int audio_disable;
-    int subtitle_disable;
-    int data_disable;
-
-    /* indexed by output file stream index */
-    int   *streamid_map;
-    int nb_streamid_map;
-
-    SpecifierOpt *metadata;
-    int        nb_metadata;
-    SpecifierOpt *max_frames;
-    int        nb_max_frames;
-    SpecifierOpt *bitstream_filters;
-    int        nb_bitstream_filters;
-    SpecifierOpt *codec_tags;
-    int        nb_codec_tags;
-    SpecifierOpt *sample_fmts;
-    int        nb_sample_fmts;
-    SpecifierOpt *qscale;
-    int        nb_qscale;
-    SpecifierOpt *forced_key_frames;
-    int        nb_forced_key_frames;
-    SpecifierOpt *force_fps;
-    int        nb_force_fps;
-    SpecifierOpt *frame_aspect_ratios;
-    int        nb_frame_aspect_ratios;
-    SpecifierOpt *rc_overrides;
-    int        nb_rc_overrides;
-    SpecifierOpt *intra_matrices;
-    int        nb_intra_matrices;
-    SpecifierOpt *inter_matrices;
-    int        nb_inter_matrices;
-    SpecifierOpt *top_field_first;
-    int        nb_top_field_first;
-    SpecifierOpt *metadata_map;
-    int        nb_metadata_map;
-    SpecifierOpt *presets;
-    int        nb_presets;
-    SpecifierOpt *copy_initial_nonkeyframes;
-    int        nb_copy_initial_nonkeyframes;
-    SpecifierOpt *filters;
-    int        nb_filters;
-    SpecifierOpt *filter_scripts;
-    int        nb_filter_scripts;
-    SpecifierOpt *pass;
-    int        nb_pass;
-    SpecifierOpt *passlogfiles;
-    int        nb_passlogfiles;
-} OptionsContext;
-
-typedef struct InputFilter {
-    AVFilterContext    *filter;
-    struct InputStream *ist;
-    struct FilterGraph *graph;
-    uint8_t            *name;
-} InputFilter;
-
-typedef struct OutputFilter {
-    AVFilterContext     *filter;
-    struct OutputStream *ost;
-    struct FilterGraph  *graph;
-    uint8_t             *name;
-
-    /* temporary storage until stream maps are processed */
-    AVFilterInOut       *out_tmp;
-} OutputFilter;
-
-typedef struct FilterGraph {
-    int            index;
-    const char    *graph_desc;
-
-    AVFilterGraph *graph;
-
-    InputFilter   **inputs;
-    int          nb_inputs;
-    OutputFilter **outputs;
-    int         nb_outputs;
-} FilterGraph;
-
-typedef struct InputStream {
-    int file_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' */
-    AVCodec *dec;
-    AVFrame *decoded_frame;
-    AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */
-
-    int64_t       start;     /* time when read started */
-    /* predicted dts of the next packet read for this stream or (when there are
-     * several frames in a packet) of the next frame in current packet */
-    int64_t       next_dts;
-    /* dts of the last packet read for this stream */
-    int64_t       last_dts;
-    PtsCorrectionContext pts_ctx;
-    double ts_scale;
-    int is_start;            /* is 1 at the start and after a discontinuity */
-    int showed_multi_packet_warning;
-    AVDictionary *opts;
-    AVRational framerate;               /* framerate forced with -r */
-
-    int resample_height;
-    int resample_width;
-    int resample_pix_fmt;
-
-    int      resample_sample_fmt;
-    int      resample_sample_rate;
-    int      resample_channels;
-    uint64_t resample_channel_layout;
-
-    /* decoded data from this stream goes into all those filters
-     * currently video and audio only */
-    InputFilter **filters;
-    int        nb_filters;
-
-    /* hwaccel options */
-    enum HWAccelID hwaccel_id;
-    char  *hwaccel_device;
-
-    /* hwaccel context */
-    enum HWAccelID active_hwaccel_id;
-    void  *hwaccel_ctx;
-    void (*hwaccel_uninit)(AVCodecContext *s);
-    int  (*hwaccel_get_buffer)(AVCodecContext *s, AVFrame *frame, int flags);
-    int  (*hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame);
-    enum AVPixelFormat hwaccel_pix_fmt;
-    enum AVPixelFormat hwaccel_retrieved_pix_fmt;
-} InputStream;
-
-typedef struct InputFile {
-    AVFormatContext *ctx;
-    int eof_reached;      /* true if eof reached */
-    int eagain;           /* true if last read attempt returned EAGAIN */
-    int ist_index;        /* index of first stream in ist_table */
-    int64_t ts_offset;
-    int64_t start_time;   /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */
-    int64_t recording_time;
-    int nb_streams;       /* number of stream that avconv is aware of; may be different
-                             from ctx.nb_streams if new streams appear during av_read_frame() */
-    int rate_emu;
-    int accurate_seek;
-
-#if HAVE_PTHREADS
-    pthread_t thread;           /* thread reading from this file */
-    int finished;               /* the thread has exited */
-    int joined;                 /* the thread has been joined */
-    pthread_mutex_t fifo_lock;  /* lock for access to fifo */
-    pthread_cond_t  fifo_cond;  /* the main thread will signal on this cond after reading from fifo */
-    AVFifoBuffer *fifo;         /* demuxed packets are stored here; freed by the main thread */
-#endif
-} InputFile;
-
-typedef struct OutputStream {
-    int file_index;          /* file index */
-    int index;               /* stream index in the output file */
-    int source_index;        /* InputStream 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 InputStream *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
-    /* pts of the first frame encoded for this stream, used for limiting
-     * recording time */
-    int64_t first_pts;
-    /* dts of the last packet sent to the muxer */
-    int64_t last_mux_dts;
-    AVBitStreamFilterContext *bitstream_filters;
-    AVCodec *enc;
-    int64_t max_frames;
-    AVFrame *filtered_frame;
-
-    /* video only */
-    AVRational frame_rate;
-    int force_fps;
-    int top_field_first;
-
-    float frame_aspect_ratio;
-
-    /* forced key frames */
-    int64_t *forced_kf_pts;
-    int forced_kf_count;
-    int forced_kf_index;
-    char *forced_keyframes;
-
-    char *logfile_prefix;
-    FILE *logfile;
-
-    OutputFilter *filter;
-    char *avfilter;
-
-    int64_t sws_flags;
-    AVDictionary *opts;
-    AVDictionary *resample_opts;
-    int finished;        /* no more packets should be written for this stream */
-    int stream_copy;
-    const char *attachment_filename;
-    int copy_initial_nonkeyframes;
-
-    enum AVPixelFormat pix_fmts[2];
-
-    AVCodecParserContext *parser;
-} OutputStream;
-
-typedef struct OutputFile {
-    AVFormatContext *ctx;
-    AVDictionary *opts;
-    int ost_index;       /* index of the first stream in output_streams */
-    int64_t recording_time; /* desired length of the resulting file in microseconds */
-    int64_t start_time;     /* start time in microseconds */
-    uint64_t limit_filesize;
-
-    int shortest;
-} OutputFile;
-
-extern InputStream **input_streams;
-extern int        nb_input_streams;
-extern InputFile   **input_files;
-extern int        nb_input_files;
-
-extern OutputStream **output_streams;
-extern int         nb_output_streams;
-extern OutputFile   **output_files;
-extern int         nb_output_files;
-
-extern FilterGraph **filtergraphs;
-extern int        nb_filtergraphs;
-
-extern char *vstats_filename;
-
-extern float audio_drift_threshold;
-extern float dts_delta_threshold;
-
-extern int audio_volume;
-extern int audio_sync_method;
-extern int video_sync_method;
-extern int do_benchmark;
-extern int do_deinterlace;
-extern int do_hex_dump;
-extern int do_pkt_dump;
-extern int copy_ts;
-extern int copy_tb;
-extern int exit_on_error;
-extern int print_stats;
-extern int qp_hist;
-
-extern const AVIOInterruptCB int_cb;
-
-extern const OptionDef options[];
-
-extern const HWAccel hwaccels[];
-
-void reset_options(OptionsContext *o);
-void show_usage(void);
-
-void opt_output_file(void *optctx, const char *filename);
-
-void assert_avoptions(AVDictionary *m);
-
-int guess_input_channel_layout(InputStream *ist);
-
-int configure_filtergraph(FilterGraph *fg);
-int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out);
-int ist_in_filtergraph(FilterGraph *fg, InputStream *ist);
-FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost);
-
-int avconv_parse_options(int argc, char **argv);
-
-int vdpau_init(AVCodecContext *s);
-
-#endif /* AVCONV_H */
diff --git a/deps/libav/avconv_filter.c b/deps/libav/avconv_filter.c
deleted file mode 100644
index 892db00..0000000
--- a/deps/libav/avconv_filter.c
+++ /dev/null
@@ -1,658 +0,0 @@
-/*
- * avconv filter configuration
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "avconv.h"
-
-#include "libavfilter/avfilter.h"
-
-#include "libavresample/avresample.h"
-
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/pixfmt.h"
-#include "libavutil/samplefmt.h"
-
-/* Define a function for building a string containing a list of
- * allowed formats. */
-#define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name)           \
-static char *choose_ ## var ## s(OutputStream *ost)                            \
-{                                                                              \
-    if (ost->st->codec->var != none) {                                         \
-        get_name(ost->st->codec->var);                                         \
-        return av_strdup(name);                                                \
-    } else if (ost->enc && ost->enc->supported_list) {                         \
-        const type *p;                                                         \
-        AVIOContext *s = NULL;                                                 \
-        uint8_t *ret;                                                          \
-        int len;                                                               \
-                                                                               \
-        if (avio_open_dyn_buf(&s) < 0)                                         \
-            exit(1);                                                           \
-                                                                               \
-        for (p = ost->enc->supported_list; *p != none; p++) {                  \
-            get_name(*p);                                                      \
-            avio_printf(s, "%s|", name);                                       \
-        }                                                                      \
-        len = avio_close_dyn_buf(s, &ret);                                     \
-        ret[len - 1] = 0;                                                      \
-        return ret;                                                            \
-    } else                                                                     \
-        return NULL;                                                           \
-}
-
-DEF_CHOOSE_FORMAT(enum AVPixelFormat, pix_fmt, pix_fmts, AV_PIX_FMT_NONE,
-                  GET_PIX_FMT_NAME)
-
-DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts,
-                  AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME)
-
-DEF_CHOOSE_FORMAT(int, sample_rate, supported_samplerates, 0,
-                  GET_SAMPLE_RATE_NAME)
-
-DEF_CHOOSE_FORMAT(uint64_t, channel_layout, channel_layouts, 0,
-                  GET_CH_LAYOUT_NAME)
-
-FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost)
-{
-    FilterGraph *fg = av_mallocz(sizeof(*fg));
-
-    if (!fg)
-        exit(1);
-    fg->index = nb_filtergraphs;
-
-    GROW_ARRAY(fg->outputs, fg->nb_outputs);
-    if (!(fg->outputs[0] = av_mallocz(sizeof(*fg->outputs[0]))))
-        exit(1);
-    fg->outputs[0]->ost   = ost;
-    fg->outputs[0]->graph = fg;
-
-    ost->filter = fg->outputs[0];
-
-    GROW_ARRAY(fg->inputs, fg->nb_inputs);
-    if (!(fg->inputs[0] = av_mallocz(sizeof(*fg->inputs[0]))))
-        exit(1);
-    fg->inputs[0]->ist   = ist;
-    fg->inputs[0]->graph = fg;
-
-    GROW_ARRAY(ist->filters, ist->nb_filters);
-    ist->filters[ist->nb_filters - 1] = fg->inputs[0];
-
-    GROW_ARRAY(filtergraphs, nb_filtergraphs);
-    filtergraphs[nb_filtergraphs - 1] = fg;
-
-    return fg;
-}
-
-static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
-{
-    InputStream *ist = NULL;
-    enum AVMediaType type = avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx);
-    int i;
-
-    // TODO: support other filter types
-    if (type != AVMEDIA_TYPE_VIDEO && type != AVMEDIA_TYPE_AUDIO) {
-        av_log(NULL, AV_LOG_FATAL, "Only video and audio filters supported "
-               "currently.\n");
-        exit(1);
-    }
-
-    if (in->name) {
-        AVFormatContext *s;
-        AVStream       *st = NULL;
-        char *p;
-        int file_idx = strtol(in->name, &p, 0);
-
-        if (file_idx < 0 || file_idx >= nb_input_files) {
-            av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtegraph description %s.\n",
-                   file_idx, fg->graph_desc);
-            exit(1);
-        }
-        s = input_files[file_idx]->ctx;
-
-        for (i = 0; i < s->nb_streams; i++) {
-            if (s->streams[i]->codec->codec_type != type)
-                continue;
-            if (check_stream_specifier(s, s->streams[i], *p == ':' ? p + 1 : p) == 1) {
-                st = s->streams[i];
-                break;
-            }
-        }
-        if (!st) {
-            av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s "
-                   "matches no streams.\n", p, fg->graph_desc);
-            exit(1);
-        }
-        ist = input_streams[input_files[file_idx]->ist_index + st->index];
-    } else {
-        /* find the first unused stream of corresponding type */
-        for (i = 0; i < nb_input_streams; i++) {
-            ist = input_streams[i];
-            if (ist->st->codec->codec_type == type && ist->discard)
-                break;
-        }
-        if (i == nb_input_streams) {
-            av_log(NULL, AV_LOG_FATAL, "Cannot find a matching stream for "
-                   "unlabeled input pad %d on filter %s\n", in->pad_idx,
-                   in->filter_ctx->name);
-            exit(1);
-        }
-    }
-    av_assert0(ist);
-
-    ist->discard         = 0;
-    ist->decoding_needed = 1;
-    ist->st->discard = AVDISCARD_NONE;
-
-    GROW_ARRAY(fg->inputs, fg->nb_inputs);
-    if (!(fg->inputs[fg->nb_inputs - 1] = av_mallocz(sizeof(*fg->inputs[0]))))
-        exit(1);
-    fg->inputs[fg->nb_inputs - 1]->ist   = ist;
-    fg->inputs[fg->nb_inputs - 1]->graph = fg;
-
-    GROW_ARRAY(ist->filters, ist->nb_filters);
-    ist->filters[ist->nb_filters - 1] = fg->inputs[fg->nb_inputs - 1];
-}
-
-static int insert_trim(int64_t start_time, int64_t duration,
-                       AVFilterContext **last_filter, int *pad_idx,
-                       const char *filter_name)
-{
-    AVFilterGraph *graph = (*last_filter)->graph;
-    AVFilterContext *ctx;
-    const AVFilter *trim;
-    enum AVMediaType type = avfilter_pad_get_type((*last_filter)->output_pads, *pad_idx);
-    const char *name = (type == AVMEDIA_TYPE_VIDEO) ? "trim" : "atrim";
-    int ret = 0;
-
-    if (duration == INT64_MAX && start_time == AV_NOPTS_VALUE)
-        return 0;
-
-    trim = avfilter_get_by_name(name);
-    if (!trim) {
-        av_log(NULL, AV_LOG_ERROR, "%s filter not present, cannot limit "
-               "recording time.\n", name);
-        return AVERROR_FILTER_NOT_FOUND;
-    }
-
-    ctx = avfilter_graph_alloc_filter(graph, trim, filter_name);
-    if (!ctx)
-        return AVERROR(ENOMEM);
-
-    if (duration != INT64_MAX) {
-        ret = av_opt_set_double(ctx, "duration", (double)duration / 1e6,
-                                AV_OPT_SEARCH_CHILDREN);
-    }
-    if (ret >= 0 && start_time != AV_NOPTS_VALUE) {
-        ret = av_opt_set_double(ctx, "start", (double)start_time / 1e6,
-                                AV_OPT_SEARCH_CHILDREN);
-    }
-    if (ret < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Error configuring the %s filter", name);
-        return ret;
-    }
-
-    ret = avfilter_init_str(ctx, NULL);
-    if (ret < 0)
-        return ret;
-
-    ret = avfilter_link(*last_filter, *pad_idx, ctx, 0);
-    if (ret < 0)
-        return ret;
-
-    *last_filter = ctx;
-    *pad_idx     = 0;
-    return 0;
-}
-
-static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
-{
-    char *pix_fmts;
-    OutputStream *ost = ofilter->ost;
-    OutputFile    *of = output_files[ost->file_index];
-    AVCodecContext *codec = ost->st->codec;
-    AVFilterContext *last_filter = out->filter_ctx;
-    int pad_idx = out->pad_idx;
-    int ret;
-    char name[255];
-
-    snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
-    ret = avfilter_graph_create_filter(&ofilter->filter,
-                                       avfilter_get_by_name("buffersink"),
-                                       name, NULL, NULL, fg->graph);
-    if (ret < 0)
-        return ret;
-
-    if (codec->width || codec->height) {
-        char args[255];
-        AVFilterContext *filter;
-
-        snprintf(args, sizeof(args), "%d:%d:0x%X",
-                 codec->width,
-                 codec->height,
-                 (unsigned)ost->sws_flags);
-        snprintf(name, sizeof(name), "scaler for output stream %d:%d",
-                 ost->file_index, ost->index);
-        if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
-                                                name, args, NULL, fg->graph)) < 0)
-            return ret;
-        if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0)
-            return ret;
-
-        last_filter = filter;
-        pad_idx = 0;
-    }
-
-    if ((pix_fmts = choose_pix_fmts(ost))) {
-        AVFilterContext *filter;
-        snprintf(name, sizeof(name), "pixel format for output stream %d:%d",
-                 ost->file_index, ost->index);
-        if ((ret = avfilter_graph_create_filter(&filter,
-                                                avfilter_get_by_name("format"),
-                                                "format", pix_fmts, NULL,
-                                                fg->graph)) < 0)
-            return ret;
-        if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0)
-            return ret;
-
-        last_filter = filter;
-        pad_idx     = 0;
-        av_freep(&pix_fmts);
-    }
-
-    if (ost->frame_rate.num) {
-        AVFilterContext *fps;
-        char args[255];
-
-        snprintf(args, sizeof(args), "fps=%d/%d", ost->frame_rate.num,
-                 ost->frame_rate.den);
-        snprintf(name, sizeof(name), "fps for output stream %d:%d",
-                 ost->file_index, ost->index);
-        ret = avfilter_graph_create_filter(&fps, avfilter_get_by_name("fps"),
-                                           name, args, NULL, fg->graph);
-        if (ret < 0)
-            return ret;
-
-        ret = avfilter_link(last_filter, pad_idx, fps, 0);
-        if (ret < 0)
-            return ret;
-        last_filter = fps;
-        pad_idx = 0;
-    }
-
-    snprintf(name, sizeof(name), "trim for output stream %d:%d",
-             ost->file_index, ost->index);
-    ret = insert_trim(of->start_time, of->recording_time,
-                      &last_filter, &pad_idx, name);
-    if (ret < 0)
-        return ret;
-
-
-    if ((ret = avfilter_link(last_filter, pad_idx, ofilter->filter, 0)) < 0)
-        return ret;
-
-    return 0;
-}
-
-static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
-{
-    OutputStream *ost = ofilter->ost;
-    OutputFile    *of = output_files[ost->file_index];
-    AVCodecContext *codec  = ost->st->codec;
-    AVFilterContext *last_filter = out->filter_ctx;
-    int pad_idx = out->pad_idx;
-    char *sample_fmts, *sample_rates, *channel_layouts;
-    char name[255];
-    int ret;
-
-
-    snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
-    ret = avfilter_graph_create_filter(&ofilter->filter,
-                                       avfilter_get_by_name("abuffersink"),
-                                       name, NULL, NULL, fg->graph);
-    if (ret < 0)
-        return ret;
-
-    if (codec->channels && !codec->channel_layout)
-        codec->channel_layout = av_get_default_channel_layout(codec->channels);
-
-    sample_fmts     = choose_sample_fmts(ost);
-    sample_rates    = choose_sample_rates(ost);
-    channel_layouts = choose_channel_layouts(ost);
-    if (sample_fmts || sample_rates || channel_layouts) {
-        AVFilterContext *format;
-        char args[256];
-        int len = 0;
-
-        if (sample_fmts)
-            len += snprintf(args + len, sizeof(args) - len, "sample_fmts=%s:",
-                            sample_fmts);
-        if (sample_rates)
-            len += snprintf(args + len, sizeof(args) - len, "sample_rates=%s:",
-                            sample_rates);
-        if (channel_layouts)
-            len += snprintf(args + len, sizeof(args) - len, "channel_layouts=%s:",
-                            channel_layouts);
-        args[len - 1] = 0;
-
-        av_freep(&sample_fmts);
-        av_freep(&sample_rates);
-        av_freep(&channel_layouts);
-
-        snprintf(name, sizeof(name), "audio format for output stream %d:%d",
-                 ost->file_index, ost->index);
-        ret = avfilter_graph_create_filter(&format,
-                                           avfilter_get_by_name("aformat"),
-                                           name, args, NULL, fg->graph);
-        if (ret < 0)
-            return ret;
-
-        ret = avfilter_link(last_filter, pad_idx, format, 0);
-        if (ret < 0)
-            return ret;
-
-        last_filter = format;
-        pad_idx = 0;
-    }
-
-    snprintf(name, sizeof(name), "trim for output stream %d:%d",
-             ost->file_index, ost->index);
-    ret = insert_trim(of->start_time, of->recording_time,
-                      &last_filter, &pad_idx, name);
-    if (ret < 0)
-        return ret;
-
-    if ((ret = avfilter_link(last_filter, pad_idx, ofilter->filter, 0)) < 0)
-        return ret;
-
-    return 0;
-}
-
-#define DESCRIBE_FILTER_LINK(f, inout, in)                         \
-{                                                                  \
-    AVFilterContext *ctx = inout->filter_ctx;                      \
-    AVFilterPad *pads = in ? ctx->input_pads  : ctx->output_pads;  \
-    int       nb_pads = in ? ctx->nb_inputs   : ctx->nb_outputs;   \
-    AVIOContext *pb;                                               \
-                                                                   \
-    if (avio_open_dyn_buf(&pb) < 0)                                \
-        exit(1);                                                   \
-                                                                   \
-    avio_printf(pb, "%s", ctx->filter->name);                      \
-    if (nb_pads > 1)                                               \
-        avio_printf(pb, ":%s", avfilter_pad_get_name(pads, inout->pad_idx));\
-    avio_w8(pb, 0);                                                \
-    avio_close_dyn_buf(pb, &f->name);                              \
-}
-
-int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
-{
-    av_freep(&ofilter->name);
-    DESCRIBE_FILTER_LINK(ofilter, out, 0);
-
-    switch (avfilter_pad_get_type(out->filter_ctx->output_pads, out->pad_idx)) {
-    case AVMEDIA_TYPE_VIDEO: return configure_output_video_filter(fg, ofilter, out);
-    case AVMEDIA_TYPE_AUDIO: return configure_output_audio_filter(fg, ofilter, out);
-    default: av_assert0(0);
-    }
-}
-
-static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
-                                        AVFilterInOut *in)
-{
-    AVFilterContext *last_filter;
-    const AVFilter *buffer_filt = avfilter_get_by_name("buffer");
-    InputStream *ist = ifilter->ist;
-    InputFile     *f = input_files[ist->file_index];
-    AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) :
-                                         ist->st->time_base;
-    AVRational sar;
-    char args[255], name[255];
-    int ret, pad_idx = 0;
-
-    sar = ist->st->sample_aspect_ratio.num ?
-          ist->st->sample_aspect_ratio :
-          ist->st->codec->sample_aspect_ratio;
-    snprintf(args, sizeof(args), "%d:%d:%d:%d:%d:%d:%d", ist->st->codec->width,
-             ist->st->codec->height,
-             ist->hwaccel_retrieve_data ? ist->hwaccel_retrieved_pix_fmt : ist->st->codec->pix_fmt,
-             tb.num, tb.den, sar.num, sar.den);
-    snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
-             ist->file_index, ist->st->index);
-
-    if ((ret = avfilter_graph_create_filter(&ifilter->filter, buffer_filt, name,
-                                            args, NULL, fg->graph)) < 0)
-        return ret;
-    last_filter = ifilter->filter;
-
-    if (ist->framerate.num) {
-        AVFilterContext *setpts;
-
-        snprintf(name, sizeof(name), "force CFR for input from stream %d:%d",
-                 ist->file_index, ist->st->index);
-        if ((ret = avfilter_graph_create_filter(&setpts,
-                                                avfilter_get_by_name("setpts"),
-                                                name, "N", NULL,
-                                                fg->graph)) < 0)
-            return ret;
-
-        if ((ret = avfilter_link(last_filter, 0, setpts, 0)) < 0)
-            return ret;
-
-        last_filter = setpts;
-    }
-
-    snprintf(name, sizeof(name), "trim for input stream %d:%d",
-             ist->file_index, ist->st->index);
-    ret = insert_trim(((f->start_time == AV_NOPTS_VALUE) || !f->accurate_seek) ?
-                      AV_NOPTS_VALUE : 0, f->recording_time, &last_filter, &pad_idx, name);
-    if (ret < 0)
-        return ret;
-
-    if ((ret = avfilter_link(last_filter, 0, in->filter_ctx, in->pad_idx)) < 0)
-        return ret;
-    return 0;
-}
-
-static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
-                                        AVFilterInOut *in)
-{
-    AVFilterContext *last_filter;
-    const AVFilter *abuffer_filt = avfilter_get_by_name("abuffer");
-    InputStream *ist = ifilter->ist;
-    InputFile     *f = input_files[ist->file_index];
-    char args[255], name[255];
-    int ret, pad_idx = 0;
-
-    snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s"
-             ":channel_layout=0x%"PRIx64,
-             1, ist->st->codec->sample_rate,
-             ist->st->codec->sample_rate,
-             av_get_sample_fmt_name(ist->st->codec->sample_fmt),
-             ist->st->codec->channel_layout);
-    snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
-             ist->file_index, ist->st->index);
-
-    if ((ret = avfilter_graph_create_filter(&ifilter->filter, abuffer_filt,
-                                            name, args, NULL,
-                                            fg->graph)) < 0)
-        return ret;
-    last_filter = ifilter->filter;
-
-    if (audio_sync_method > 0) {
-        AVFilterContext *async;
-        int  len = 0;
-
-        av_log(NULL, AV_LOG_WARNING, "-async has been deprecated. Used the "
-               "asyncts audio filter instead.\n");
-
-        if (audio_sync_method > 1)
-            len += snprintf(args + len, sizeof(args) - len, "compensate=1:"
-                            "max_comp=%d:", audio_sync_method);
-        snprintf(args + len, sizeof(args) - len, "min_delta=%f",
-                 audio_drift_threshold);
-
-        snprintf(name, sizeof(name), "graph %d audio sync for input stream %d:%d",
-                 fg->index, ist->file_index, ist->st->index);
-        ret = avfilter_graph_create_filter(&async,
-                                           avfilter_get_by_name("asyncts"),
-                                           name, args, NULL, fg->graph);
-        if (ret < 0)
-            return ret;
-
-        ret = avfilter_link(last_filter, 0, async, 0);
-        if (ret < 0)
-            return ret;
-
-        last_filter = async;
-    }
-    if (audio_volume != 256) {
-        AVFilterContext *volume;
-
-        av_log(NULL, AV_LOG_WARNING, "-vol has been deprecated. Use the volume "
-               "audio filter instead.\n");
-
-        snprintf(args, sizeof(args), "volume=%f", audio_volume / 256.0);
-
-        snprintf(name, sizeof(name), "graph %d volume for input stream %d:%d",
-                 fg->index, ist->file_index, ist->st->index);
-        ret = avfilter_graph_create_filter(&volume,
-                                           avfilter_get_by_name("volume"),
-                                           name, args, NULL, fg->graph);
-        if (ret < 0)
-            return ret;
-
-        ret = avfilter_link(last_filter, 0, volume, 0);
-        if (ret < 0)
-            return ret;
-
-        last_filter = volume;
-    }
-
-    snprintf(name, sizeof(name), "trim for input stream %d:%d",
-             ist->file_index, ist->st->index);
-    ret = insert_trim(((f->start_time == AV_NOPTS_VALUE) || !f->accurate_seek) ?
-                      AV_NOPTS_VALUE : 0, f->recording_time, &last_filter, &pad_idx, name);
-    if (ret < 0)
-        return ret;
-
-    if ((ret = avfilter_link(last_filter, 0, in->filter_ctx, in->pad_idx)) < 0)
-        return ret;
-
-    return 0;
-}
-
-static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
-                                  AVFilterInOut *in)
-{
-    av_freep(&ifilter->name);
-    DESCRIBE_FILTER_LINK(ifilter, in, 1);
-
-    switch (avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx)) {
-    case AVMEDIA_TYPE_VIDEO: return configure_input_video_filter(fg, ifilter, in);
-    case AVMEDIA_TYPE_AUDIO: return configure_input_audio_filter(fg, ifilter, in);
-    default: av_assert0(0);
-    }
-}
-
-int configure_filtergraph(FilterGraph *fg)
-{
-    AVFilterInOut *inputs, *outputs, *cur;
-    int ret, i, init = !fg->graph, simple = !fg->graph_desc;
-    const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
-                                      fg->graph_desc;
-
-    avfilter_graph_free(&fg->graph);
-    if (!(fg->graph = avfilter_graph_alloc()))
-        return AVERROR(ENOMEM);
-
-    if (simple) {
-        OutputStream *ost = fg->outputs[0]->ost;
-        char args[512];
-        AVDictionaryEntry *e = NULL;
-
-        snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
-        fg->graph->scale_sws_opts = av_strdup(args);
-
-        args[0] = '\0';
-        while ((e = av_dict_get(fg->outputs[0]->ost->resample_opts, "", e,
-                                AV_DICT_IGNORE_SUFFIX))) {
-            av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
-        }
-        if (strlen(args))
-            args[strlen(args) - 1] = '\0';
-        fg->graph->resample_lavr_opts = av_strdup(args);
-    }
-
-    if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)
-        return ret;
-
-    if (simple && (!inputs || inputs->next || !outputs || outputs->next)) {
-        av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' does not have "
-               "exactly one input and output.\n", graph_desc);
-        return AVERROR(EINVAL);
-    }
-
-    for (cur = inputs; !simple && init && cur; cur = cur->next)
-        init_input_filter(fg, cur);
-
-    for (cur = inputs, i = 0; cur; cur = cur->next, i++)
-        if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0)
-            return ret;
-    avfilter_inout_free(&inputs);
-
-    if (!init || simple) {
-        /* we already know the mappings between lavfi outputs and output streams,
-         * so we can finish the setup */
-        for (cur = outputs, i = 0; cur; cur = cur->next, i++)
-            configure_output_filter(fg, fg->outputs[i], cur);
-        avfilter_inout_free(&outputs);
-
-        if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)
-            return ret;
-    } else {
-        /* wait until output mappings are processed */
-        for (cur = outputs; cur;) {
-            GROW_ARRAY(fg->outputs, fg->nb_outputs);
-            if (!(fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]))))
-                exit(1);
-            fg->outputs[fg->nb_outputs - 1]->graph   = fg;
-            fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
-            cur = cur->next;
-            fg->outputs[fg->nb_outputs - 1]->out_tmp->next = NULL;
-        }
-    }
-
-    return 0;
-}
-
-int ist_in_filtergraph(FilterGraph *fg, InputStream *ist)
-{
-    int i;
-    for (i = 0; i < fg->nb_inputs; i++)
-        if (fg->inputs[i]->ist == ist)
-            return 1;
-    return 0;
-}
-
diff --git a/deps/libav/avconv_opt.c b/deps/libav/avconv_opt.c
deleted file mode 100644
index d62d11f..0000000
--- a/deps/libav/avconv_opt.c
+++ /dev/null
@@ -1,2389 +0,0 @@
-/*
- * avconv option parsing
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "avconv.h"
-#include "cmdutils.h"
-
-#include "libavformat/avformat.h"
-
-#include "libavcodec/avcodec.h"
-
-#include "libavfilter/avfilter.h"
-
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/avutil.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/fifo.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/pixfmt.h"
-
-#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
-{\
-    int i, ret;\
-    for (i = 0; i < o->nb_ ## name; i++) {\
-        char *spec = o->name[i].specifier;\
-        if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0)\
-            outvar = o->name[i].u.type;\
-        else if (ret < 0)\
-            exit_program(1);\
-    }\
-}
-
-const HWAccel hwaccels[] = {
-#if HAVE_VDPAU_X11
-    { "vdpau", vdpau_init, HWACCEL_VDPAU, AV_PIX_FMT_VDPAU },
-#endif
-    { 0 },
-};
-
-char *vstats_filename;
-
-float audio_drift_threshold = 0.1;
-float dts_delta_threshold   = 10;
-
-int audio_volume      = 256;
-int audio_sync_method = 0;
-int video_sync_method = VSYNC_AUTO;
-int do_benchmark      = 0;
-int do_hex_dump       = 0;
-int do_pkt_dump       = 0;
-int copy_ts           = 0;
-int copy_tb           = 1;
-int exit_on_error     = 0;
-int print_stats       = 1;
-int qp_hist           = 0;
-
-static int file_overwrite     = 0;
-static int file_skip          = 0;
-static int video_discard      = 0;
-static int intra_dc_precision = 8;
-static int using_stdin        = 0;
-static int input_sync;
-
-static void uninit_options(OptionsContext *o)
-{
-    const OptionDef *po = options;
-    int i;
-
-    /* all OPT_SPEC and OPT_STRING can be freed in generic way */
-    while (po->name) {
-        void *dst = (uint8_t*)o + po->u.off;
-
-        if (po->flags & OPT_SPEC) {
-            SpecifierOpt **so = dst;
-            int i, *count = (int*)(so + 1);
-            for (i = 0; i < *count; i++) {
-                av_freep(&(*so)[i].specifier);
-                if (po->flags & OPT_STRING)
-                    av_freep(&(*so)[i].u.str);
-            }
-            av_freep(so);
-            *count = 0;
-        } else if (po->flags & OPT_OFFSET && po->flags & OPT_STRING)
-            av_freep(dst);
-        po++;
-    }
-
-    for (i = 0; i < o->nb_stream_maps; i++)
-        av_freep(&o->stream_maps[i].linklabel);
-    av_freep(&o->stream_maps);
-    av_freep(&o->meta_data_maps);
-    av_freep(&o->streamid_map);
-}
-
-static void init_options(OptionsContext *o)
-{
-    memset(o, 0, sizeof(*o));
-
-    o->mux_max_delay  = 0.7;
-    o->start_time     = AV_NOPTS_VALUE;
-    o->recording_time = INT64_MAX;
-    o->limit_filesize = UINT64_MAX;
-    o->chapters_input_file = INT_MAX;
-    o->accurate_seek  = 1;
-}
-
-/* return a copy of the input with the stream specifiers removed from the keys */
-static AVDictionary *strip_specifiers(AVDictionary *dict)
-{
-    AVDictionaryEntry *e = NULL;
-    AVDictionary    *ret = NULL;
-
-    while ((e = av_dict_get(dict, "", e, AV_DICT_IGNORE_SUFFIX))) {
-        char *p = strchr(e->key, ':');
-
-        if (p)
-            *p = 0;
-        av_dict_set(&ret, e->key, e->value, 0);
-        if (p)
-            *p = ':';
-    }
-    return ret;
-}
-
-static double parse_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) {
-        av_log(NULL, AV_LOG_FATAL, "Incorrect aspect ratio specification.\n");
-        exit_program(1);
-    }
-    return ar;
-}
-
-static int opt_audio_codec(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "codec:a", arg, options);
-}
-
-static int opt_video_codec(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "codec:v", arg, options);
-}
-
-static int opt_subtitle_codec(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "codec:s", arg, options);
-}
-
-static int opt_data_codec(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "codec:d", arg, options);
-}
-
-static int opt_map(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    StreamMap *m = NULL;
-    int i, negative = 0, file_idx;
-    int sync_file_idx = -1, sync_stream_idx;
-    char *p, *sync;
-    char *map;
-
-    if (*arg == '-') {
-        negative = 1;
-        arg++;
-    }
-    map = av_strdup(arg);
-
-    /* parse sync stream first, just pick first matching stream */
-    if (sync = strchr(map, ',')) {
-        *sync = 0;
-        sync_file_idx = strtol(sync + 1, &sync, 0);
-        if (sync_file_idx >= nb_input_files || sync_file_idx < 0) {
-            av_log(NULL, AV_LOG_FATAL, "Invalid sync file index: %d.\n", sync_file_idx);
-            exit_program(1);
-        }
-        if (*sync)
-            sync++;
-        for (i = 0; i < input_files[sync_file_idx]->nb_streams; i++)
-            if (check_stream_specifier(input_files[sync_file_idx]->ctx,
-                                       input_files[sync_file_idx]->ctx->streams[i], sync) == 1) {
-                sync_stream_idx = i;
-                break;
-            }
-        if (i == input_files[sync_file_idx]->nb_streams) {
-            av_log(NULL, AV_LOG_FATAL, "Sync stream specification in map %s does not "
-                                       "match any streams.\n", arg);
-            exit_program(1);
-        }
-    }
-
-
-    if (map[0] == '[') {
-        /* this mapping refers to lavfi output */
-        const char *c = map + 1;
-        GROW_ARRAY(o->stream_maps, o->nb_stream_maps);
-        m = &o->stream_maps[o->nb_stream_maps - 1];
-        m->linklabel = av_get_token(&c, "]");
-        if (!m->linklabel) {
-            av_log(NULL, AV_LOG_ERROR, "Invalid output link label: %s.\n", map);
-            exit_program(1);
-        }
-    } else {
-        file_idx = strtol(map, &p, 0);
-        if (file_idx >= nb_input_files || file_idx < 0) {
-            av_log(NULL, AV_LOG_FATAL, "Invalid input file index: %d.\n", file_idx);
-            exit_program(1);
-        }
-        if (negative)
-            /* disable some already defined maps */
-            for (i = 0; i < o->nb_stream_maps; i++) {
-                m = &o->stream_maps[i];
-                if (file_idx == m->file_index &&
-                    check_stream_specifier(input_files[m->file_index]->ctx,
-                                           input_files[m->file_index]->ctx->streams[m->stream_index],
-                                           *p == ':' ? p + 1 : p) > 0)
-                    m->disabled = 1;
-            }
-        else
-            for (i = 0; i < input_files[file_idx]->nb_streams; i++) {
-                if (check_stream_specifier(input_files[file_idx]->ctx, input_files[file_idx]->ctx->streams[i],
-                            *p == ':' ? p + 1 : p) <= 0)
-                    continue;
-                GROW_ARRAY(o->stream_maps, o->nb_stream_maps);
-                m = &o->stream_maps[o->nb_stream_maps - 1];
-
-                m->file_index   = file_idx;
-                m->stream_index = i;
-
-                if (sync_file_idx >= 0) {
-                    m->sync_file_index   = sync_file_idx;
-                    m->sync_stream_index = sync_stream_idx;
-                } else {
-                    m->sync_file_index   = file_idx;
-                    m->sync_stream_index = i;
-                }
-            }
-    }
-
-    if (!m) {
-        av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n", arg);
-        exit_program(1);
-    }
-
-    av_freep(&map);
-    return 0;
-}
-
-static int opt_attach(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    GROW_ARRAY(o->attachments, o->nb_attachments);
-    o->attachments[o->nb_attachments - 1] = arg;
-    return 0;
-}
-
-/**
- * Parse a metadata specifier passed as 'arg' parameter.
- * @param arg  metadata string to parse
- * @param type metadata type is written here -- g(lobal)/s(tream)/c(hapter)/p(rogram)
- * @param index for type c/p, chapter/program index is written here
- * @param stream_spec for type s, the stream specifier is written here
- */
-static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec)
-{
-    if (*arg) {
-        *type = *arg;
-        switch (*arg) {
-        case 'g':
-            break;
-        case 's':
-            if (*(++arg) && *arg != ':') {
-                av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", arg);
-                exit_program(1);
-            }
-            *stream_spec = *arg == ':' ? arg + 1 : "";
-            break;
-        case 'c':
-        case 'p':
-            if (*(++arg) == ':')
-                *index = strtol(++arg, NULL, 0);
-            break;
-        default:
-            av_log(NULL, AV_LOG_FATAL, "Invalid metadata type %c.\n", *arg);
-            exit_program(1);
-        }
-    } else
-        *type = 'g';
-}
-
-static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o)
-{
-    AVDictionary **meta_in = NULL;
-    AVDictionary **meta_out;
-    int i, ret = 0;
-    char type_in, type_out;
-    const char *istream_spec = NULL, *ostream_spec = NULL;
-    int idx_in = 0, idx_out = 0;
-
-    parse_meta_type(inspec,  &type_in,  &idx_in,  &istream_spec);
-    parse_meta_type(outspec, &type_out, &idx_out, &ostream_spec);
-
-    if (type_in == 'g' || type_out == 'g')
-        o->metadata_global_manual = 1;
-    if (type_in == 's' || type_out == 's')
-        o->metadata_streams_manual = 1;
-    if (type_in == 'c' || type_out == 'c')
-        o->metadata_chapters_manual = 1;
-
-    /* ic is NULL when just disabling automatic mappings */
-    if (!ic)
-        return 0;
-
-#define METADATA_CHECK_INDEX(index, nb_elems, desc)\
-    if ((index) < 0 || (index) >= (nb_elems)) {\
-        av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\
-                (desc), (index));\
-        exit_program(1);\
-    }
-
-#define SET_DICT(type, meta, context, index)\
-        switch (type) {\
-        case 'g':\
-            meta = &context->metadata;\
-            break;\
-        case 'c':\
-            METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\
-            meta = &context->chapters[index]->metadata;\
-            break;\
-        case 'p':\
-            METADATA_CHECK_INDEX(index, context->nb_programs, "program")\
-            meta = &context->programs[index]->metadata;\
-            break;\
-        case 's':\
-            break; /* handled separately below */ \
-        default: av_assert0(0);\
-        }\
-
-    SET_DICT(type_in, meta_in, ic, idx_in);
-    SET_DICT(type_out, meta_out, oc, idx_out);
-
-    /* for input streams choose first matching stream */
-    if (type_in == 's') {
-        for (i = 0; i < ic->nb_streams; i++) {
-            if ((ret = check_stream_specifier(ic, ic->streams[i], istream_spec)) > 0) {
-                meta_in = &ic->streams[i]->metadata;
-                break;
-            } else if (ret < 0)
-                exit_program(1);
-        }
-        if (!meta_in) {
-            av_log(NULL, AV_LOG_FATAL, "Stream specifier %s does not match  any streams.\n", istream_spec);
-            exit_program(1);
-        }
-    }
-
-    if (type_out == 's') {
-        for (i = 0; i < oc->nb_streams; i++) {
-            if ((ret = check_stream_specifier(oc, oc->streams[i], ostream_spec)) > 0) {
-                meta_out = &oc->streams[i]->metadata;
-                av_dict_copy(meta_out, *meta_in, AV_DICT_DONT_OVERWRITE);
-            } else if (ret < 0)
-                exit_program(1);
-        }
-    } else
-        av_dict_copy(meta_out, *meta_in, AV_DICT_DONT_OVERWRITE);
-
-    return 0;
-}
-
-static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
-{
-    const AVCodecDescriptor *desc;
-    const char *codec_string = encoder ? "encoder" : "decoder";
-    AVCodec *codec;
-
-    codec = encoder ?
-        avcodec_find_encoder_by_name(name) :
-        avcodec_find_decoder_by_name(name);
-
-    if (!codec && (desc = avcodec_descriptor_get_by_name(name))) {
-        codec = encoder ? avcodec_find_encoder(desc->id) :
-                          avcodec_find_decoder(desc->id);
-        if (codec)
-            av_log(NULL, AV_LOG_VERBOSE, "Matched %s '%s' for codec '%s'.\n",
-                   codec_string, codec->name, desc->name);
-    }
-
-    if (!codec) {
-        av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);
-        exit_program(1);
-    }
-    if (codec->type != type) {
-        av_log(NULL, AV_LOG_FATAL, "Invalid %s type '%s'\n", codec_string, name);
-        exit_program(1);
-    }
-    return codec;
-}
-
-static AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st)
-{
-    char *codec_name = NULL;
-
-    MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, st);
-    if (codec_name) {
-        AVCodec *codec = find_codec_or_die(codec_name, st->codec->codec_type, 0);
-        st->codec->codec_id = codec->id;
-        return codec;
-    } else
-        return avcodec_find_decoder(st->codec->codec_id);
-}
-
-/* Add all the streams from the given input file to the global
- * list of input streams. */
-static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
-{
-    int i;
-
-    for (i = 0; i < ic->nb_streams; i++) {
-        AVStream *st = ic->streams[i];
-        AVCodecContext *dec = st->codec;
-        InputStream *ist = av_mallocz(sizeof(*ist));
-        char *framerate = NULL, *hwaccel = NULL, *hwaccel_device = NULL;
-
-        if (!ist)
-            exit_program(1);
-
-        GROW_ARRAY(input_streams, nb_input_streams);
-        input_streams[nb_input_streams - 1] = ist;
-
-        ist->st = st;
-        ist->file_index = nb_input_files;
-        ist->discard = 1;
-        st->discard  = AVDISCARD_ALL;
-
-        ist->ts_scale = 1.0;
-        MATCH_PER_STREAM_OPT(ts_scale, dbl, ist->ts_scale, ic, st);
-
-        ist->dec = choose_decoder(o, ic, st);
-        ist->opts = filter_codec_opts(o->g->codec_opts, ist->st->codec->codec_id, ic, st, ist->dec);
-
-        switch (dec->codec_type) {
-        case AVMEDIA_TYPE_VIDEO:
-            ist->resample_height  = dec->height;
-            ist->resample_width   = dec->width;
-            ist->resample_pix_fmt = dec->pix_fmt;
-
-            MATCH_PER_STREAM_OPT(frame_rates, str, framerate, ic, st);
-            if (framerate && av_parse_video_rate(&ist->framerate,
-                                                 framerate) < 0) {
-                av_log(NULL, AV_LOG_ERROR, "Error parsing framerate %s.\n",
-                       framerate);
-                exit_program(1);
-            }
-
-            MATCH_PER_STREAM_OPT(hwaccels, str, hwaccel, ic, st);
-            if (hwaccel) {
-                if (!strcmp(hwaccel, "none"))
-                    ist->hwaccel_id = HWACCEL_NONE;
-                else if (!strcmp(hwaccel, "auto"))
-                    ist->hwaccel_id = HWACCEL_AUTO;
-                else {
-                    int i;
-                    for (i = 0; hwaccels[i].name; i++) {
-                        if (!strcmp(hwaccels[i].name, hwaccel)) {
-                            ist->hwaccel_id = hwaccels[i].id;
-                            break;
-                        }
-                    }
-
-                    if (!ist->hwaccel_id) {
-                        av_log(NULL, AV_LOG_FATAL, "Unrecognized hwaccel: %s.\n",
-                               hwaccel);
-                        av_log(NULL, AV_LOG_FATAL, "Supported hwaccels: ");
-                        for (i = 0; hwaccels[i].name; i++)
-                            av_log(NULL, AV_LOG_FATAL, "%s ", hwaccels[i].name);
-                        av_log(NULL, AV_LOG_FATAL, "\n");
-                        exit_program(1);
-                    }
-                }
-            }
-
-            MATCH_PER_STREAM_OPT(hwaccel_devices, str, hwaccel_device, ic, st);
-            if (hwaccel_device) {
-                ist->hwaccel_device = av_strdup(hwaccel_device);
-                if (!ist->hwaccel_device)
-                    exit_program(1);
-            }
-            ist->hwaccel_pix_fmt = AV_PIX_FMT_NONE;
-
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            guess_input_channel_layout(ist);
-
-            ist->resample_sample_fmt     = dec->sample_fmt;
-            ist->resample_sample_rate    = dec->sample_rate;
-            ist->resample_channels       = dec->channels;
-            ist->resample_channel_layout = dec->channel_layout;
-
-            break;
-        case AVMEDIA_TYPE_DATA:
-        case AVMEDIA_TYPE_SUBTITLE:
-        case AVMEDIA_TYPE_ATTACHMENT:
-        case AVMEDIA_TYPE_UNKNOWN:
-            break;
-        default:
-            abort();
-        }
-    }
-}
-
-static void assert_file_overwrite(const char *filename)
-{
-    if (file_overwrite && file_skip) {
-        fprintf(stderr, "Error, both -y and -n supplied. Exiting.\n");
-        exit_program(1);
-    }
-
-    if (!file_overwrite &&
-        (strchr(filename, ':') == NULL || filename[1] == ':' ||
-         av_strstart(filename, "file:", NULL))) {
-        if (avio_check(filename, 0) == 0) {
-            if (!using_stdin && !file_skip) {
-                fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
-                fflush(stderr);
-                if (!read_yesno()) {
-                    fprintf(stderr, "Not overwriting - exiting\n");
-                    exit_program(1);
-                }
-            }
-            else {
-                fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);
-                exit_program(1);
-            }
-        }
-    }
-}
-
-static void dump_attachment(AVStream *st, const char *filename)
-{
-    int ret;
-    AVIOContext *out = NULL;
-    AVDictionaryEntry *e;
-
-    if (!st->codec->extradata_size) {
-        av_log(NULL, AV_LOG_WARNING, "No extradata to dump in stream #%d:%d.\n",
-               nb_input_files - 1, st->index);
-        return;
-    }
-    if (!*filename && (e = av_dict_get(st->metadata, "filename", NULL, 0)))
-        filename = e->value;
-    if (!*filename) {
-        av_log(NULL, AV_LOG_FATAL, "No filename specified and no 'filename' tag"
-               "in stream #%d:%d.\n", nb_input_files - 1, st->index);
-        exit_program(1);
-    }
-
-    assert_file_overwrite(filename);
-
-    if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, &int_cb, NULL)) < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Could not open file %s for writing.\n",
-               filename);
-        exit_program(1);
-    }
-
-    avio_write(out, st->codec->extradata, st->codec->extradata_size);
-    avio_flush(out);
-    avio_close(out);
-}
-
-static int open_input_file(OptionsContext *o, const char *filename)
-{
-    InputFile *f;
-    AVFormatContext *ic;
-    AVInputFormat *file_iformat = NULL;
-    int err, i, ret;
-    int64_t timestamp;
-    uint8_t buf[128];
-    AVDictionary **opts;
-    AVDictionary *unused_opts = NULL;
-    AVDictionaryEntry *e = NULL;
-    int orig_nb_streams;                     // number of streams before avformat_find_stream_info
-
-    if (o->format) {
-        if (!(file_iformat = av_find_input_format(o->format))) {
-            av_log(NULL, AV_LOG_FATAL, "Unknown input format: '%s'\n", o->format);
-            exit_program(1);
-        }
-    }
-
-    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));
-        exit_program(1);
-    }
-    if (o->nb_audio_sample_rate) {
-        snprintf(buf, sizeof(buf), "%d", o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i);
-        av_dict_set(&o->g->format_opts, "sample_rate", buf, 0);
-    }
-    if (o->nb_audio_channels) {
-        /* because we set audio_channels based on both the "ac" and
-         * "channel_layout" options, we need to check that the specified
-         * demuxer actually has the "channels" option before setting it */
-        if (file_iformat && file_iformat->priv_class &&
-            av_opt_find(&file_iformat->priv_class, "channels", NULL, 0,
-                        AV_OPT_SEARCH_FAKE_OBJ)) {
-            snprintf(buf, sizeof(buf), "%d",
-                     o->audio_channels[o->nb_audio_channels - 1].u.i);
-            av_dict_set(&o->g->format_opts, "channels", buf, 0);
-        }
-    }
-    if (o->nb_frame_rates) {
-        /* set the format-level framerate option;
-         * this is important for video grabbers, e.g. x11 */
-        if (file_iformat && file_iformat->priv_class &&
-            av_opt_find(&file_iformat->priv_class, "framerate", NULL, 0,
-                        AV_OPT_SEARCH_FAKE_OBJ)) {
-            av_dict_set(&o->g->format_opts, "framerate",
-                        o->frame_rates[o->nb_frame_rates - 1].u.str, 0);
-        }
-    }
-    if (o->nb_frame_sizes) {
-        av_dict_set(&o->g->format_opts, "video_size", o->frame_sizes[o->nb_frame_sizes - 1].u.str, 0);
-    }
-    if (o->nb_frame_pix_fmts)
-        av_dict_set(&o->g->format_opts, "pixel_format", o->frame_pix_fmts[o->nb_frame_pix_fmts - 1].u.str, 0);
-
-    ic->flags |= AVFMT_FLAG_NONBLOCK;
-    ic->interrupt_callback = int_cb;
-
-    /* open the input file with generic libav function */
-    err = avformat_open_input(&ic, filename, file_iformat, &o->g->format_opts);
-    if (err < 0) {
-        print_error(filename, err);
-        exit_program(1);
-    }
-    assert_avoptions(o->g->format_opts);
-
-    /* apply forced codec ids */
-    for (i = 0; i < ic->nb_streams; i++)
-        choose_decoder(o, ic, ic->streams[i]);
-
-    /* Set AVCodecContext options for avformat_find_stream_info */
-    opts = setup_find_stream_info_opts(ic, o->g->codec_opts);
-    orig_nb_streams = ic->nb_streams;
-
-    /* If not enough info to get the stream parameters, we decode the
-       first frames to get it. (used in mpeg case for example) */
-    ret = avformat_find_stream_info(ic, opts);
-    if (ret < 0) {
-        av_log(NULL, AV_LOG_FATAL, "%s: could not find codec parameters\n", filename);
-        avformat_close_input(&ic);
-        exit_program(1);
-    }
-
-    timestamp = (o->start_time == AV_NOPTS_VALUE) ? 0 : o->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 (o->start_time != AV_NOPTS_VALUE) {
-        ret = av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD);
-        if (ret < 0) {
-            av_log(NULL, AV_LOG_WARNING, "%s: could not seek to position %0.3f\n",
-                   filename, (double)timestamp / AV_TIME_BASE);
-        }
-    }
-
-    /* update the current parameters so that they match the one of the input stream */
-    add_input_streams(o, ic);
-
-    /* dump the file content */
-    av_dump_format(ic, nb_input_files, filename, 0);
-
-    GROW_ARRAY(input_files, nb_input_files);
-    f = av_mallocz(sizeof(*f));
-    if (!f)
-        exit_program(1);
-    input_files[nb_input_files - 1] = f;
-
-    f->ctx        = ic;
-    f->ist_index  = nb_input_streams - ic->nb_streams;
-    f->start_time = o->start_time;
-    f->recording_time = o->recording_time;
-    f->ts_offset  = o->input_ts_offset - (copy_ts ? 0 : timestamp);
-    f->nb_streams = ic->nb_streams;
-    f->rate_emu   = o->rate_emu;
-    f->accurate_seek = o->accurate_seek;
-
-    /* check if all codec options have been used */
-    unused_opts = strip_specifiers(o->g->codec_opts);
-    for (i = f->ist_index; i < nb_input_streams; i++) {
-        e = NULL;
-        while ((e = av_dict_get(input_streams[i]->opts, "", e,
-                                AV_DICT_IGNORE_SUFFIX)))
-            av_dict_set(&unused_opts, e->key, NULL, 0);
-    }
-
-    e = NULL;
-    while ((e = av_dict_get(unused_opts, "", e, AV_DICT_IGNORE_SUFFIX))) {
-        const AVClass *class = avcodec_get_class();
-        const AVOption *option = av_opt_find(&class, e->key, NULL, 0,
-                                             AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
-        if (!option)
-            continue;
-        if (!(option->flags & AV_OPT_FLAG_DECODING_PARAM)) {
-            av_log(NULL, AV_LOG_ERROR, "Codec AVOption %s (%s) specified for "
-                   "input file #%d (%s) is not a decoding option.\n", e->key,
-                   option->help ? option->help : "", nb_input_files - 1,
-                   filename);
-            exit_program(1);
-        }
-
-        av_log(NULL, AV_LOG_WARNING, "Codec AVOption %s (%s) specified for "
-               "input file #%d (%s) has not been used for any stream. The most "
-               "likely reason is either wrong type (e.g. a video option with "
-               "no video streams) or that it is a private option of some decoder "
-               "which was not actually used for any stream.\n", e->key,
-               option->help ? option->help : "", nb_input_files - 1, filename);
-    }
-    av_dict_free(&unused_opts);
-
-    for (i = 0; i < o->nb_dump_attachment; i++) {
-        int j;
-
-        for (j = 0; j < ic->nb_streams; j++) {
-            AVStream *st = ic->streams[j];
-
-            if (check_stream_specifier(ic, st, o->dump_attachment[i].specifier) == 1)
-                dump_attachment(st, o->dump_attachment[i].u.str);
-        }
-    }
-
-    for (i = 0; i < orig_nb_streams; i++)
-        av_dict_free(&opts[i]);
-    av_freep(&opts);
-
-    return 0;
-}
-
-static uint8_t *get_line(AVIOContext *s)
-{
-    AVIOContext *line;
-    uint8_t *buf;
-    char c;
-
-    if (avio_open_dyn_buf(&line) < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Could not alloc buffer for reading preset.\n");
-        exit_program(1);
-    }
-
-    while ((c = avio_r8(s)) && c != '\n')
-        avio_w8(line, c);
-    avio_w8(line, 0);
-    avio_close_dyn_buf(line, &buf);
-
-    return buf;
-}
-
-static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s)
-{
-    int i, ret = 1;
-    char filename[1000];
-    const char *base[3] = { getenv("AVCONV_DATADIR"),
-                            getenv("HOME"),
-                            AVCONV_DATADIR,
-                            };
-
-    for (i = 0; i < FF_ARRAY_ELEMS(base) && ret; i++) {
-        if (!base[i])
-            continue;
-        if (codec_name) {
-            snprintf(filename, sizeof(filename), "%s%s/%s-%s.avpreset", base[i],
-                     i != 1 ? "" : "/.avconv", codec_name, preset_name);
-            ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);
-        }
-        if (ret) {
-            snprintf(filename, sizeof(filename), "%s%s/%s.avpreset", base[i],
-                     i != 1 ? "" : "/.avconv", preset_name);
-            ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL);
-        }
-    }
-    return ret;
-}
-
-static void choose_encoder(OptionsContext *o, AVFormatContext *s, OutputStream *ost)
-{
-    char *codec_name = NULL;
-
-    MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, ost->st);
-    if (!codec_name) {
-        ost->st->codec->codec_id = av_guess_codec(s->oformat, NULL, s->filename,
-                                                  NULL, ost->st->codec->codec_type);
-        ost->enc = avcodec_find_encoder(ost->st->codec->codec_id);
-    } else if (!strcmp(codec_name, "copy"))
-        ost->stream_copy = 1;
-    else {
-        ost->enc = find_codec_or_die(codec_name, ost->st->codec->codec_type, 1);
-        ost->st->codec->codec_id = ost->enc->id;
-    }
-}
-
-static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type)
-{
-    OutputStream *ost;
-    AVStream *st = avformat_new_stream(oc, NULL);
-    int idx      = oc->nb_streams - 1, ret = 0;
-    char *bsf = NULL, *next, *codec_tag = NULL;
-    AVBitStreamFilterContext *bsfc, *bsfc_prev = NULL;
-    double qscale = -1;
-
-    if (!st) {
-        av_log(NULL, AV_LOG_FATAL, "Could not alloc stream.\n");
-        exit_program(1);
-    }
-
-    if (oc->nb_streams - 1 < o->nb_streamid_map)
-        st->id = o->streamid_map[oc->nb_streams - 1];
-
-    GROW_ARRAY(output_streams, nb_output_streams);
-    if (!(ost = av_mallocz(sizeof(*ost))))
-        exit_program(1);
-    output_streams[nb_output_streams - 1] = ost;
-
-    ost->file_index = nb_output_files - 1;
-    ost->index      = idx;
-    ost->st         = st;
-    st->codec->codec_type = type;
-    choose_encoder(o, oc, ost);
-    if (ost->enc) {
-        AVIOContext *s = NULL;
-        char *buf = NULL, *arg = NULL, *preset = NULL;
-
-        ost->opts  = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc);
-
-        MATCH_PER_STREAM_OPT(presets, str, preset, oc, st);
-        if (preset && (!(ret = get_preset_file_2(preset, ost->enc->name, &s)))) {
-            do  {
-                buf = get_line(s);
-                if (!buf[0] || buf[0] == '#') {
-                    av_free(buf);
-                    continue;
-                }
-                if (!(arg = strchr(buf, '='))) {
-                    av_log(NULL, AV_LOG_FATAL, "Invalid line found in the preset file.\n");
-                    exit_program(1);
-                }
-                *arg++ = 0;
-                av_dict_set(&ost->opts, buf, arg, AV_DICT_DONT_OVERWRITE);
-                av_free(buf);
-            } while (!s->eof_reached);
-            avio_close(s);
-        }
-        if (ret) {
-            av_log(NULL, AV_LOG_FATAL,
-                   "Preset %s specified for stream %d:%d, but could not be opened.\n",
-                   preset, ost->file_index, ost->index);
-            exit_program(1);
-        }
-    } else {
-        ost->opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
-    }
-
-    avcodec_get_context_defaults3(st->codec, ost->enc);
-    st->codec->codec_type = type; // XXX hack, avcodec_get_context_defaults2() sets type to unknown for stream copy
-
-    ost->max_frames = INT64_MAX;
-    MATCH_PER_STREAM_OPT(max_frames, i64, ost->max_frames, oc, st);
-
-    MATCH_PER_STREAM_OPT(bitstream_filters, str, bsf, oc, st);
-    while (bsf) {
-        if (next = strchr(bsf, ','))
-            *next++ = 0;
-        if (!(bsfc = av_bitstream_filter_init(bsf))) {
-            av_log(NULL, AV_LOG_FATAL, "Unknown bitstream filter %s\n", bsf);
-            exit_program(1);
-        }
-        if (bsfc_prev)
-            bsfc_prev->next = bsfc;
-        else
-            ost->bitstream_filters = bsfc;
-
-        bsfc_prev = bsfc;
-        bsf       = next;
-    }
-
-    MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, oc, st);
-    if (codec_tag) {
-        uint32_t tag = strtol(codec_tag, &next, 0);
-        if (*next)
-            tag = AV_RL32(codec_tag);
-        st->codec->codec_tag = tag;
-    }
-
-    MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st);
-    if (qscale >= 0) {
-        st->codec->flags |= CODEC_FLAG_QSCALE;
-        st->codec->global_quality = FF_QP2LAMBDA * qscale;
-    }
-
-    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
-        st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
-
-    av_opt_get_int(o->g->sws_opts, "sws_flags", 0, &ost->sws_flags);
-
-    av_dict_copy(&ost->resample_opts, o->g->resample_opts, 0);
-
-    ost->pix_fmts[0] = ost->pix_fmts[1] = AV_PIX_FMT_NONE;
-    ost->last_mux_dts = AV_NOPTS_VALUE;
-
-    return ost;
-}
-
-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) {
-            av_log(NULL, AV_LOG_FATAL, "Syntax error in matrix \"%s\" at coeff %d\n", str, i);
-            exit_program(1);
-        }
-        p++;
-    }
-}
-
-/* read file contents into a string */
-static uint8_t *read_file(const char *filename)
-{
-    AVIOContext *pb      = NULL;
-    AVIOContext *dyn_buf = NULL;
-    int ret = avio_open(&pb, filename, AVIO_FLAG_READ);
-    uint8_t buf[1024], *str;
-
-    if (ret < 0) {
-        av_log(NULL, AV_LOG_ERROR, "Error opening file %s.\n", filename);
-        return NULL;
-    }
-
-    ret = avio_open_dyn_buf(&dyn_buf);
-    if (ret < 0) {
-        avio_closep(&pb);
-        return NULL;
-    }
-    while ((ret = avio_read(pb, buf, sizeof(buf))) > 0)
-        avio_write(dyn_buf, buf, ret);
-    avio_w8(dyn_buf, 0);
-    avio_closep(&pb);
-
-    ret = avio_close_dyn_buf(dyn_buf, &str);
-    if (ret < 0)
-        return NULL;
-    return str;
-}
-
-static char *get_ost_filters(OptionsContext *o, AVFormatContext *oc,
-                             OutputStream *ost)
-{
-    AVStream *st = ost->st;
-    char *filter = NULL, *filter_script = NULL;
-
-    MATCH_PER_STREAM_OPT(filter_scripts, str, filter_script, oc, st);
-    MATCH_PER_STREAM_OPT(filters, str, filter, oc, st);
-
-    if (filter_script && filter) {
-        av_log(NULL, AV_LOG_ERROR, "Both -filter and -filter_script set for "
-               "output stream #%d:%d.\n", nb_output_files, st->index);
-        exit_program(1);
-    }
-
-    if (filter_script)
-        return read_file(filter_script);
-    else if (filter)
-        return av_strdup(filter);
-
-    return av_strdup(st->codec->codec_type == AVMEDIA_TYPE_VIDEO ?
-                     "null" : "anull");
-}
-
-static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
-{
-    AVStream *st;
-    OutputStream *ost;
-    AVCodecContext *video_enc;
-    char *frame_aspect_ratio = NULL;
-
-    ost = new_output_stream(o, oc, AVMEDIA_TYPE_VIDEO);
-    st  = ost->st;
-    video_enc = st->codec;
-
-    MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st);
-    if (frame_aspect_ratio)
-        ost->frame_aspect_ratio = parse_frame_aspect_ratio(frame_aspect_ratio);
-
-    if (!ost->stream_copy) {
-        const char *p = NULL;
-        char *frame_rate = NULL, *frame_size = NULL;
-        char *frame_pix_fmt = NULL;
-        char *intra_matrix = NULL, *inter_matrix = NULL;
-        int do_pass = 0;
-        int i;
-
-        MATCH_PER_STREAM_OPT(frame_rates, str, frame_rate, oc, st);
-        if (frame_rate && av_parse_video_rate(&ost->frame_rate, frame_rate) < 0) {
-            av_log(NULL, AV_LOG_FATAL, "Invalid framerate value: %s\n", frame_rate);
-            exit_program(1);
-        }
-
-        MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, oc, st);
-        if (frame_size && av_parse_video_size(&video_enc->width, &video_enc->height, frame_size) < 0) {
-            av_log(NULL, AV_LOG_FATAL, "Invalid frame size: %s.\n", frame_size);
-            exit_program(1);
-        }
-
-        MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st);
-        if (frame_pix_fmt && (video_enc->pix_fmt = av_get_pix_fmt(frame_pix_fmt)) == AV_PIX_FMT_NONE) {
-            av_log(NULL, AV_LOG_FATAL, "Unknown pixel format requested: %s.\n", frame_pix_fmt);
-            exit_program(1);
-        }
-        st->sample_aspect_ratio = video_enc->sample_aspect_ratio;
-
-        MATCH_PER_STREAM_OPT(intra_matrices, str, intra_matrix, oc, st);
-        if (intra_matrix) {
-            if (!(video_enc->intra_matrix = av_mallocz(sizeof(*video_enc->intra_matrix) * 64))) {
-                av_log(NULL, AV_LOG_FATAL, "Could not allocate memory for intra matrix.\n");
-                exit_program(1);
-            }
-            parse_matrix_coeffs(video_enc->intra_matrix, intra_matrix);
-        }
-        MATCH_PER_STREAM_OPT(inter_matrices, str, inter_matrix, oc, st);
-        if (inter_matrix) {
-            if (!(video_enc->inter_matrix = av_mallocz(sizeof(*video_enc->inter_matrix) * 64))) {
-                av_log(NULL, AV_LOG_FATAL, "Could not allocate memory for inter matrix.\n");
-                exit_program(1);
-            }
-            parse_matrix_coeffs(video_enc->inter_matrix, inter_matrix);
-        }
-
-        MATCH_PER_STREAM_OPT(rc_overrides, str, p, oc, st);
-        for (i = 0; p; i++) {
-            int start, end, q;
-            int e = sscanf(p, "%d,%d,%d", &start, &end, &q);
-            if (e != 3) {
-                av_log(NULL, AV_LOG_FATAL, "error parsing rc_override\n");
-                exit_program(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;
-        video_enc->intra_dc_precision = intra_dc_precision - 8;
-
-        /* two pass mode */
-        MATCH_PER_STREAM_OPT(pass, i, do_pass, oc, st);
-        if (do_pass) {
-            if (do_pass == 1) {
-                video_enc->flags |= CODEC_FLAG_PASS1;
-            } else {
-                video_enc->flags |= CODEC_FLAG_PASS2;
-            }
-        }
-
-        MATCH_PER_STREAM_OPT(passlogfiles, str, ost->logfile_prefix, oc, st);
-        if (ost->logfile_prefix &&
-            !(ost->logfile_prefix = av_strdup(ost->logfile_prefix)))
-            exit_program(1);
-
-        MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st);
-        if (ost->forced_keyframes)
-            ost->forced_keyframes = av_strdup(ost->forced_keyframes);
-
-        MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st);
-
-        ost->top_field_first = -1;
-        MATCH_PER_STREAM_OPT(top_field_first, i, ost->top_field_first, oc, st);
-
-
-        ost->avfilter = get_ost_filters(o, oc, ost);
-        if (!ost->avfilter)
-            exit_program(1);
-    } else {
-        MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st);
-    }
-
-    return ost;
-}
-
-static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc)
-{
-    AVStream *st;
-    OutputStream *ost;
-    AVCodecContext *audio_enc;
-
-    ost = new_output_stream(o, oc, AVMEDIA_TYPE_AUDIO);
-    st  = ost->st;
-
-    audio_enc = st->codec;
-    audio_enc->codec_type = AVMEDIA_TYPE_AUDIO;
-
-    if (!ost->stream_copy) {
-        char *sample_fmt = NULL;
-
-        MATCH_PER_STREAM_OPT(audio_channels, i, audio_enc->channels, oc, st);
-
-        MATCH_PER_STREAM_OPT(sample_fmts, str, sample_fmt, oc, st);
-        if (sample_fmt &&
-            (audio_enc->sample_fmt = av_get_sample_fmt(sample_fmt)) == AV_SAMPLE_FMT_NONE) {
-            av_log(NULL, AV_LOG_FATAL, "Invalid sample format '%s'\n", sample_fmt);
-            exit_program(1);
-        }
-
-        MATCH_PER_STREAM_OPT(audio_sample_rate, i, audio_enc->sample_rate, oc, st);
-
-        ost->avfilter = get_ost_filters(o, oc, ost);
-        if (!ost->avfilter)
-            exit_program(1);
-    }
-
-    return ost;
-}
-
-static OutputStream *new_data_stream(OptionsContext *o, AVFormatContext *oc)
-{
-    OutputStream *ost;
-
-    ost = new_output_stream(o, oc, AVMEDIA_TYPE_DATA);
-    if (!ost->stream_copy) {
-        av_log(NULL, AV_LOG_FATAL, "Data stream encoding not supported yet (only streamcopy)\n");
-        exit_program(1);
-    }
-
-    return ost;
-}
-
-static OutputStream *new_attachment_stream(OptionsContext *o, AVFormatContext *oc)
-{
-    OutputStream *ost = new_output_stream(o, oc, AVMEDIA_TYPE_ATTACHMENT);
-    ost->stream_copy = 1;
-    ost->finished    = 1;
-    return ost;
-}
-
-static OutputStream *new_subtitle_stream(OptionsContext *o, AVFormatContext *oc)
-{
-    AVStream *st;
-    OutputStream *ost;
-    AVCodecContext *subtitle_enc;
-
-    ost = new_output_stream(o, oc, AVMEDIA_TYPE_SUBTITLE);
-    st  = ost->st;
-    subtitle_enc = st->codec;
-
-    subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
-
-    return ost;
-}
-
-/* arg format is "output-stream-index:streamid-value". */
-static int opt_streamid(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    int idx;
-    char *p;
-    char idx_str[16];
-
-    av_strlcpy(idx_str, arg, sizeof(idx_str));
-    p = strchr(idx_str, ':');
-    if (!p) {
-        av_log(NULL, AV_LOG_FATAL,
-               "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
-               arg, opt);
-        exit_program(1);
-    }
-    *p++ = '\0';
-    idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, INT_MAX);
-    o->streamid_map = grow_array(o->streamid_map, sizeof(*o->streamid_map), &o->nb_streamid_map, idx+1);
-    o->streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
-    return 0;
-}
-
-static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
-{
-    AVFormatContext *is = ifile->ctx;
-    AVFormatContext *os = ofile->ctx;
-    AVChapter **tmp;
-    int i;
-
-    tmp = av_realloc(os->chapters, sizeof(*os->chapters) * (is->nb_chapters + os->nb_chapters));
-    if (!tmp)
-        return AVERROR(ENOMEM);
-    os->chapters = tmp;
-
-    for (i = 0; i < is->nb_chapters; i++) {
-        AVChapter *in_ch = is->chapters[i], *out_ch;
-        int64_t start_time = (ofile->start_time == AV_NOPTS_VALUE) ? 0 : ofile->start_time;
-        int64_t ts_off   = av_rescale_q(start_time - ifile->ts_offset,
-                                       AV_TIME_BASE_Q, in_ch->time_base);
-        int64_t rt       = (ofile->recording_time == INT64_MAX) ? INT64_MAX :
-                           av_rescale_q(ofile->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);
-
-        if (copy_metadata)
-            av_dict_copy(&out_ch->metadata, in_ch->metadata, 0);
-
-        os->chapters[os->nb_chapters++] = out_ch;
-    }
-    return 0;
-}
-
-static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
-                               AVFormatContext *oc)
-{
-    OutputStream *ost;
-
-    switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
-                                  ofilter->out_tmp->pad_idx)) {
-    case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc); break;
-    case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(o, oc); break;
-    default:
-        av_log(NULL, AV_LOG_FATAL, "Only video and audio filters are supported "
-               "currently.\n");
-        exit_program(1);
-    }
-
-    ost->source_index = -1;
-    ost->filter       = ofilter;
-
-    ofilter->ost      = ost;
-
-    if (ost->stream_copy) {
-        av_log(NULL, AV_LOG_ERROR, "Streamcopy requested for output stream %d:%d, "
-               "which is fed from a complex filtergraph. Filtering and streamcopy "
-               "cannot be used together.\n", ost->file_index, ost->index);
-        exit_program(1);
-    }
-
-    if (configure_output_filter(ofilter->graph, ofilter, ofilter->out_tmp) < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Error configuring filter.\n");
-        exit_program(1);
-    }
-    avfilter_inout_free(&ofilter->out_tmp);
-}
-
-static int configure_complex_filters(void)
-{
-    int i, ret = 0;
-
-    for (i = 0; i < nb_filtergraphs; i++)
-        if (!filtergraphs[i]->graph &&
-            (ret = configure_filtergraph(filtergraphs[i])) < 0)
-            return ret;
-    return 0;
-}
-
-static int open_output_file(OptionsContext *o, const char *filename)
-{
-    AVFormatContext *oc;
-    int i, j, err;
-    AVOutputFormat *file_oformat;
-    OutputFile *of;
-    OutputStream *ost;
-    InputStream  *ist;
-    AVDictionary *unused_opts = NULL;
-    AVDictionaryEntry *e = NULL;
-
-    if (configure_complex_filters() < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Error configuring filters.\n");
-        exit_program(1);
-    }
-
-    GROW_ARRAY(output_files, nb_output_files);
-    of = av_mallocz(sizeof(*of));
-    if (!of)
-        exit_program(1);
-    output_files[nb_output_files - 1] = of;
-
-    of->ost_index      = nb_output_streams;
-    of->recording_time = o->recording_time;
-    of->start_time     = o->start_time;
-    of->limit_filesize = o->limit_filesize;
-    of->shortest       = o->shortest;
-    av_dict_copy(&of->opts, o->g->format_opts, 0);
-
-    if (!strcmp(filename, "-"))
-        filename = "pipe:";
-
-    oc = avformat_alloc_context();
-    if (!oc) {
-        print_error(filename, AVERROR(ENOMEM));
-        exit_program(1);
-    }
-    of->ctx = oc;
-    if (o->recording_time != INT64_MAX)
-        oc->duration = o->recording_time;
-
-    if (o->format) {
-        file_oformat = av_guess_format(o->format, NULL, NULL);
-        if (!file_oformat) {
-            av_log(NULL, AV_LOG_FATAL, "Requested output format '%s' is not a suitable output format\n", o->format);
-            exit_program(1);
-        }
-    } else {
-        file_oformat = av_guess_format(NULL, filename, NULL);
-        if (!file_oformat) {
-            av_log(NULL, AV_LOG_FATAL, "Unable to find a suitable output format for '%s'\n",
-                   filename);
-            exit_program(1);
-        }
-    }
-
-    oc->oformat = file_oformat;
-    oc->interrupt_callback = int_cb;
-    av_strlcpy(oc->filename, filename, sizeof(oc->filename));
-
-    /* create streams for all unlabeled output pads */
-    for (i = 0; i < nb_filtergraphs; i++) {
-        FilterGraph *fg = filtergraphs[i];
-        for (j = 0; j < fg->nb_outputs; j++) {
-            OutputFilter *ofilter = fg->outputs[j];
-
-            if (!ofilter->out_tmp || ofilter->out_tmp->name)
-                continue;
-
-            switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
-                                          ofilter->out_tmp->pad_idx)) {
-            case AVMEDIA_TYPE_VIDEO:    o->video_disable    = 1; break;
-            case AVMEDIA_TYPE_AUDIO:    o->audio_disable    = 1; break;
-            case AVMEDIA_TYPE_SUBTITLE: o->subtitle_disable = 1; break;
-            }
-            init_output_filter(ofilter, o, oc);
-        }
-    }
-
-    if (!o->nb_stream_maps) {
-        /* pick the "best" stream of each type */
-#define NEW_STREAM(type, index)\
-        if (index >= 0) {\
-            ost = new_ ## type ## _stream(o, oc);\
-            ost->source_index = index;\
-            ost->sync_ist     = input_streams[index];\
-            input_streams[index]->discard = 0;\
-            input_streams[index]->st->discard = AVDISCARD_NONE;\
-        }
-
-        /* video: highest resolution */
-        if (!o->video_disable && oc->oformat->video_codec != AV_CODEC_ID_NONE) {
-            int area = 0, idx = -1;
-            for (i = 0; i < nb_input_streams; i++) {
-                ist = input_streams[i];
-                if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-                    ist->st->codec->width * ist->st->codec->height > area) {
-                    area = ist->st->codec->width * ist->st->codec->height;
-                    idx = i;
-                }
-            }
-            NEW_STREAM(video, idx);
-        }
-
-        /* audio: most channels */
-        if (!o->audio_disable && oc->oformat->audio_codec != AV_CODEC_ID_NONE) {
-            int channels = 0, idx = -1;
-            for (i = 0; i < nb_input_streams; i++) {
-                ist = input_streams[i];
-                if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
-                    ist->st->codec->channels > channels) {
-                    channels = ist->st->codec->channels;
-                    idx = i;
-                }
-            }
-            NEW_STREAM(audio, idx);
-        }
-
-        /* subtitles: pick first */
-        if (!o->subtitle_disable && oc->oformat->subtitle_codec != AV_CODEC_ID_NONE) {
-            for (i = 0; i < nb_input_streams; i++)
-                if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-                    NEW_STREAM(subtitle, i);
-                    break;
-                }
-        }
-        /* do something with data? */
-    } else {
-        for (i = 0; i < o->nb_stream_maps; i++) {
-            StreamMap *map = &o->stream_maps[i];
-
-            if (map->disabled)
-                continue;
-
-            if (map->linklabel) {
-                FilterGraph *fg;
-                OutputFilter *ofilter = NULL;
-                int j, k;
-
-                for (j = 0; j < nb_filtergraphs; j++) {
-                    fg = filtergraphs[j];
-                    for (k = 0; k < fg->nb_outputs; k++) {
-                        AVFilterInOut *out = fg->outputs[k]->out_tmp;
-                        if (out && !strcmp(out->name, map->linklabel)) {
-                            ofilter = fg->outputs[k];
-                            goto loop_end;
-                        }
-                    }
-                }
-loop_end:
-                if (!ofilter) {
-                    av_log(NULL, AV_LOG_FATAL, "Output with label '%s' does not exist "
-                           "in any defined filter graph.\n", map->linklabel);
-                    exit_program(1);
-                }
-                init_output_filter(ofilter, o, oc);
-            } else {
-                ist = input_streams[input_files[map->file_index]->ist_index + map->stream_index];
-                switch (ist->st->codec->codec_type) {
-                case AVMEDIA_TYPE_VIDEO:    ost = new_video_stream(o, oc);    break;
-                case AVMEDIA_TYPE_AUDIO:    ost = new_audio_stream(o, oc);    break;
-                case AVMEDIA_TYPE_SUBTITLE: ost = new_subtitle_stream(o, oc); break;
-                case AVMEDIA_TYPE_DATA:     ost = new_data_stream(o, oc);     break;
-                case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc); break;
-                default:
-                    av_log(NULL, AV_LOG_FATAL, "Cannot map stream #%d:%d - unsupported type.\n",
-                           map->file_index, map->stream_index);
-                    exit_program(1);
-                }
-
-                ost->source_index = input_files[map->file_index]->ist_index + map->stream_index;
-                ost->sync_ist     = input_streams[input_files[map->sync_file_index]->ist_index +
-                                               map->sync_stream_index];
-                ist->discard = 0;
-                ist->st->discard = AVDISCARD_NONE;
-            }
-        }
-    }
-
-    /* handle attached files */
-    for (i = 0; i < o->nb_attachments; i++) {
-        AVIOContext *pb;
-        uint8_t *attachment;
-        const char *p;
-        int64_t len;
-
-        if ((err = avio_open2(&pb, o->attachments[i], AVIO_FLAG_READ, &int_cb, NULL)) < 0) {
-            av_log(NULL, AV_LOG_FATAL, "Could not open attachment file %s.\n",
-                   o->attachments[i]);
-            exit_program(1);
-        }
-        if ((len = avio_size(pb)) <= 0) {
-            av_log(NULL, AV_LOG_FATAL, "Could not get size of the attachment %s.\n",
-                   o->attachments[i]);
-            exit_program(1);
-        }
-        if (!(attachment = av_malloc(len))) {
-            av_log(NULL, AV_LOG_FATAL, "Attachment %s too large to fit into memory.\n",
-                   o->attachments[i]);
-            exit_program(1);
-        }
-        avio_read(pb, attachment, len);
-
-        ost = new_attachment_stream(o, oc);
-        ost->stream_copy               = 0;
-        ost->source_index              = -1;
-        ost->attachment_filename       = o->attachments[i];
-        ost->st->codec->extradata      = attachment;
-        ost->st->codec->extradata_size = len;
-
-        p = strrchr(o->attachments[i], '/');
-        av_dict_set(&ost->st->metadata, "filename", (p && *p) ? p + 1 : o->attachments[i], AV_DICT_DONT_OVERWRITE);
-        avio_close(pb);
-    }
-
-    /* check if all codec options have been used */
-    unused_opts = strip_specifiers(o->g->codec_opts);
-    for (i = of->ost_index; i < nb_output_streams; i++) {
-        e = NULL;
-        while ((e = av_dict_get(output_streams[i]->opts, "", e,
-                                AV_DICT_IGNORE_SUFFIX)))
-            av_dict_set(&unused_opts, e->key, NULL, 0);
-    }
-
-    e = NULL;
-    while ((e = av_dict_get(unused_opts, "", e, AV_DICT_IGNORE_SUFFIX))) {
-        const AVClass *class = avcodec_get_class();
-        const AVOption *option = av_opt_find(&class, e->key, NULL, 0,
-                                             AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
-        if (!option)
-            continue;
-        if (!(option->flags & AV_OPT_FLAG_ENCODING_PARAM)) {
-            av_log(NULL, AV_LOG_ERROR, "Codec AVOption %s (%s) specified for "
-                   "output file #%d (%s) is not an encoding option.\n", e->key,
-                   option->help ? option->help : "", nb_output_files - 1,
-                   filename);
-            exit_program(1);
-        }
-
-        av_log(NULL, AV_LOG_WARNING, "Codec AVOption %s (%s) specified for "
-               "output file #%d (%s) has not been used for any stream. The most "
-               "likely reason is either wrong type (e.g. a video option with "
-               "no video streams) or that it is a private option of some encoder "
-               "which was not actually used for any stream.\n", e->key,
-               option->help ? option->help : "", nb_output_files - 1, filename);
-    }
-    av_dict_free(&unused_opts);
-
-    /* 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(EINVAL));
-            exit_program(1);
-        }
-    }
-
-    if (!(oc->oformat->flags & AVFMT_NOFILE)) {
-        /* test if it already exists to avoid losing precious files */
-        assert_file_overwrite(filename);
-
-        /* open the file */
-        if ((err = avio_open2(&oc->pb, filename, AVIO_FLAG_WRITE,
-                              &oc->interrupt_callback,
-                              &of->opts)) < 0) {
-            print_error(filename, err);
-            exit_program(1);
-        }
-    }
-
-    if (o->mux_preload) {
-        uint8_t buf[64];
-        snprintf(buf, sizeof(buf), "%d", (int)(o->mux_preload*AV_TIME_BASE));
-        av_dict_set(&of->opts, "preload", buf, 0);
-    }
-    oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE);
-    oc->flags |= AVFMT_FLAG_NONBLOCK;
-
-    /* copy metadata */
-    for (i = 0; i < o->nb_metadata_map; i++) {
-        char *p;
-        int in_file_index = strtol(o->metadata_map[i].u.str, &p, 0);
-
-        if (in_file_index >= nb_input_files) {
-            av_log(NULL, AV_LOG_FATAL, "Invalid input file index %d while processing metadata maps\n", in_file_index);
-            exit_program(1);
-        }
-        copy_metadata(o->metadata_map[i].specifier, *p ? p + 1 : p, oc,
-                      in_file_index >= 0 ?
-                      input_files[in_file_index]->ctx : NULL, o);
-    }
-
-    /* copy chapters */
-    if (o->chapters_input_file >= nb_input_files) {
-        if (o->chapters_input_file == INT_MAX) {
-            /* copy chapters from the first input file that has them*/
-            o->chapters_input_file = -1;
-            for (i = 0; i < nb_input_files; i++)
-                if (input_files[i]->ctx->nb_chapters) {
-                    o->chapters_input_file = i;
-                    break;
-                }
-        } else {
-            av_log(NULL, AV_LOG_FATAL, "Invalid input file index %d in chapter mapping.\n",
-                   o->chapters_input_file);
-            exit_program(1);
-        }
-    }
-    if (o->chapters_input_file >= 0)
-        copy_chapters(input_files[o->chapters_input_file], of,
-                      !o->metadata_chapters_manual);
-
-    /* copy global metadata by default */
-    if (!o->metadata_global_manual && nb_input_files)
-        av_dict_copy(&oc->metadata, input_files[0]->ctx->metadata,
-                     AV_DICT_DONT_OVERWRITE);
-    if (!o->metadata_streams_manual)
-        for (i = of->ost_index; i < nb_output_streams; i++) {
-            InputStream *ist;
-            if (output_streams[i]->source_index < 0)         /* this is true e.g. for attached files */
-                continue;
-            ist = input_streams[output_streams[i]->source_index];
-            av_dict_copy(&output_streams[i]->st->metadata, ist->st->metadata, AV_DICT_DONT_OVERWRITE);
-        }
-
-    /* process manually set metadata */
-    for (i = 0; i < o->nb_metadata; i++) {
-        AVDictionary **m;
-        char type, *val;
-        const char *stream_spec;
-        int index = 0, j, ret;
-
-        val = strchr(o->metadata[i].u.str, '=');
-        if (!val) {
-            av_log(NULL, AV_LOG_FATAL, "No '=' character in metadata string %s.\n",
-                   o->metadata[i].u.str);
-            exit_program(1);
-        }
-        *val++ = 0;
-
-        parse_meta_type(o->metadata[i].specifier, &type, &index, &stream_spec);
-        if (type == 's') {
-            for (j = 0; j < oc->nb_streams; j++) {
-                if ((ret = check_stream_specifier(oc, oc->streams[j], stream_spec)) > 0) {
-                    av_dict_set(&oc->streams[j]->metadata, o->metadata[i].u.str, *val ? val : NULL, 0);
-                } else if (ret < 0)
-                    exit_program(1);
-            }
-        }
-        else {
-            switch (type) {
-            case 'g':
-                m = &oc->metadata;
-                break;
-            case 'c':
-                if (index < 0 || index >= oc->nb_chapters) {
-                    av_log(NULL, AV_LOG_FATAL, "Invalid chapter index %d in metadata specifier.\n", index);
-                    exit_program(1);
-                }
-                m = &oc->chapters[index]->metadata;
-                break;
-            default:
-                av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", o->metadata[i].specifier);
-                exit_program(1);
-            }
-            av_dict_set(m, o->metadata[i].u.str, *val ? val : NULL, 0);
-        }
-    }
-
-    return 0;
-}
-
-static int opt_target(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    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 {
-        /* Try to determine PAL/NTSC by peeking in the input files */
-        if (nb_input_files) {
-            int i, j, fr;
-            for (j = 0; j < nb_input_files; j++) {
-                for (i = 0; i < input_files[j]->nb_streams; i++) {
-                    AVCodecContext *c = input_files[j]->ctx->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 (norm != UNKNOWN)
-            av_log(NULL, AV_LOG_INFO, "Assuming %s for target.\n", norm == PAL ? "PAL" : "NTSC");
-    }
-
-    if (norm == UNKNOWN) {
-        av_log(NULL, AV_LOG_FATAL, "Could not determine norm (PAL/NTSC/NTSC-Film) for target.\n");
-        av_log(NULL, AV_LOG_FATAL, "Please prefix target with \"pal-\", \"ntsc-\" or \"film-\",\n");
-        av_log(NULL, AV_LOG_FATAL, "or set a framerate with \"-r xxx\".\n");
-        exit_program(1);
-    }
-
-    if (!strcmp(arg, "vcd")) {
-        opt_video_codec(o, "c:v", "mpeg1video");
-        opt_audio_codec(o, "c:a", "mp2");
-        parse_option(o, "f", "vcd", options);
-
-        parse_option(o, "s", norm == PAL ? "352x288" : "352x240", options);
-        parse_option(o, "r", frame_rates[norm], options);
-        opt_default(NULL, "g", norm == PAL ? "15" : "18");
-
-        opt_default(NULL, "b", "1150000");
-        opt_default(NULL, "maxrate", "1150000");
-        opt_default(NULL, "minrate", "1150000");
-        opt_default(NULL, "bufsize", "327680"); // 40*1024*8;
-
-        opt_default(NULL, "b:a", "224000");
-        parse_option(o, "ar", "44100", options);
-        parse_option(o, "ac", "2", options);
-
-        opt_default(NULL, "packetsize", "2324");
-        opt_default(NULL, "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. */
-        o->mux_preload = (36000 + 3 * 1200) / 90000.0; // 0.44
-    } else if (!strcmp(arg, "svcd")) {
-
-        opt_video_codec(o, "c:v", "mpeg2video");
-        opt_audio_codec(o, "c:a", "mp2");
-        parse_option(o, "f", "svcd", options);
-
-        parse_option(o, "s", norm == PAL ? "480x576" : "480x480", options);
-        parse_option(o, "r", frame_rates[norm], options);
-        opt_default(NULL, "g", norm == PAL ? "15" : "18");
-
-        opt_default(NULL, "b", "2040000");
-        opt_default(NULL, "maxrate", "2516000");
-        opt_default(NULL, "minrate", "0"); // 1145000;
-        opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
-        opt_default(NULL, "flags", "+scan_offset");
-
-
-        opt_default(NULL, "b:a", "224000");
-        parse_option(o, "ar", "44100", options);
-
-        opt_default(NULL, "packetsize", "2324");
-
-    } else if (!strcmp(arg, "dvd")) {
-
-        opt_video_codec(o, "c:v", "mpeg2video");
-        opt_audio_codec(o, "c:a", "ac3");
-        parse_option(o, "f", "dvd", options);
-
-        parse_option(o, "s", norm == PAL ? "720x576" : "720x480", options);
-        parse_option(o, "r", frame_rates[norm], options);
-        opt_default(NULL, "g", norm == PAL ? "15" : "18");
-
-        opt_default(NULL, "b", "6000000");
-        opt_default(NULL, "maxrate", "9000000");
-        opt_default(NULL, "minrate", "0"); // 1500000;
-        opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
-
-        opt_default(NULL, "packetsize", "2048");  // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
-        opt_default(NULL, "muxrate", "10080000"); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
-
-        opt_default(NULL, "b:a", "448000");
-        parse_option(o, "ar", "48000", options);
-
-    } else if (!strncmp(arg, "dv", 2)) {
-
-        parse_option(o, "f", "dv", options);
-
-        parse_option(o, "s", norm == PAL ? "720x576" : "720x480", options);
-        parse_option(o, "pix_fmt", !strncmp(arg, "dv50", 4) ? "yuv422p" :
-                          norm == PAL ? "yuv420p" : "yuv411p", options);
-        parse_option(o, "r", frame_rates[norm], options);
-
-        parse_option(o, "ar", "48000", options);
-        parse_option(o, "ac", "2", options);
-
-    } else {
-        av_log(NULL, AV_LOG_ERROR, "Unknown target: %s\n", arg);
-        return AVERROR(EINVAL);
-    }
-    return 0;
-}
-
-static int opt_vstats_file(void *optctx, const char *opt, const char *arg)
-{
-    av_free (vstats_filename);
-    vstats_filename = av_strdup (arg);
-    return 0;
-}
-
-static int opt_vstats(void *optctx, const char *opt, const char *arg)
-{
-    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);
-    return opt_vstats_file(NULL, opt, filename);
-}
-
-static int opt_video_frames(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "frames:v", arg, options);
-}
-
-static int opt_audio_frames(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "frames:a", arg, options);
-}
-
-static int opt_data_frames(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "frames:d", arg, options);
-}
-
-static int opt_video_tag(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "tag:v", arg, options);
-}
-
-static int opt_audio_tag(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "tag:a", arg, options);
-}
-
-static int opt_subtitle_tag(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "tag:s", arg, options);
-}
-
-static int opt_video_filters(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "filter:v", arg, options);
-}
-
-static int opt_audio_filters(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "filter:a", arg, options);
-}
-
-static int opt_vsync(void *optctx, const char *opt, const char *arg)
-{
-    if      (!av_strcasecmp(arg, "cfr"))         video_sync_method = VSYNC_CFR;
-    else if (!av_strcasecmp(arg, "vfr"))         video_sync_method = VSYNC_VFR;
-    else if (!av_strcasecmp(arg, "passthrough")) video_sync_method = VSYNC_PASSTHROUGH;
-
-    if (video_sync_method == VSYNC_AUTO)
-        video_sync_method = parse_number_or_die("vsync", arg, OPT_INT, VSYNC_AUTO, VSYNC_VFR);
-    return 0;
-}
-
-static int opt_channel_layout(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    char layout_str[32];
-    char *stream_str;
-    char *ac_str;
-    int ret, channels, ac_str_size;
-    uint64_t layout;
-
-    layout = av_get_channel_layout(arg);
-    if (!layout) {
-        av_log(NULL, AV_LOG_ERROR, "Unknown channel layout: %s\n", arg);
-        return AVERROR(EINVAL);
-    }
-    snprintf(layout_str, sizeof(layout_str), "%"PRIu64, layout);
-    ret = opt_default(NULL, opt, layout_str);
-    if (ret < 0)
-        return ret;
-
-    /* set 'ac' option based on channel layout */
-    channels = av_get_channel_layout_nb_channels(layout);
-    snprintf(layout_str, sizeof(layout_str), "%d", channels);
-    stream_str = strchr(opt, ':');
-    ac_str_size = 3 + (stream_str ? strlen(stream_str) : 0);
-    ac_str = av_mallocz(ac_str_size);
-    if (!ac_str)
-        return AVERROR(ENOMEM);
-    av_strlcpy(ac_str, "ac", 3);
-    if (stream_str)
-        av_strlcat(ac_str, stream_str, ac_str_size);
-    ret = parse_option(o, ac_str, layout_str, options);
-    av_free(ac_str);
-
-    return ret;
-}
-
-static int opt_audio_qscale(void *optctx, const char *opt, const char *arg)
-{
-    OptionsContext *o = optctx;
-    return parse_option(o, "q:a", arg, options);
-}
-
-static int opt_filter_complex(void *optctx, const char *opt, const char *arg)
-{
-    GROW_ARRAY(filtergraphs, nb_filtergraphs);
-    if (!(filtergraphs[nb_filtergraphs - 1] = av_mallocz(sizeof(*filtergraphs[0]))))
-        return AVERROR(ENOMEM);
-    filtergraphs[nb_filtergraphs - 1]->index      = nb_filtergraphs - 1;
-    filtergraphs[nb_filtergraphs - 1]->graph_desc = av_strdup(arg);
-    if (!filtergraphs[nb_filtergraphs - 1]->graph_desc)
-        return AVERROR(ENOMEM);
-    return 0;
-}
-
-static int opt_filter_complex_script(void *optctx, const char *opt, const char *arg)
-{
-    uint8_t *graph_desc = read_file(arg);
-    if (!graph_desc)
-        return AVERROR(EINVAL);
-
-    GROW_ARRAY(filtergraphs, nb_filtergraphs);
-    if (!(filtergraphs[nb_filtergraphs - 1] = av_mallocz(sizeof(*filtergraphs[0]))))
-        return AVERROR(ENOMEM);
-    filtergraphs[nb_filtergraphs - 1]->index      = nb_filtergraphs - 1;
-    filtergraphs[nb_filtergraphs - 1]->graph_desc = graph_desc;
-    return 0;
-}
-
-void show_help_default(const char *opt, const char *arg)
-{
-    /* per-file options have at least one of those set */
-    const int per_file = OPT_SPEC | OPT_OFFSET | OPT_PERFILE;
-    int show_advanced = 0, show_avoptions = 0;
-
-    if (opt && *opt) {
-        if (!strcmp(opt, "long"))
-            show_advanced = 1;
-        else if (!strcmp(opt, "full"))
-            show_advanced = show_avoptions = 1;
-        else
-            av_log(NULL, AV_LOG_ERROR, "Unknown help option '%s'.\n", opt);
-    }
-
-    show_usage();
-
-    printf("Getting help:\n"
-           "    -h      -- print basic options\n"
-           "    -h long -- print more options\n"
-           "    -h full -- print all options (including all format and codec specific options, very long)\n"
-           "    See man %s for detailed description of the options.\n"
-           "\n", program_name);
-
-    show_help_options(options, "Print help / information / capabilities:",
-                      OPT_EXIT, 0, 0);
-
-    show_help_options(options, "Global options (affect whole program "
-                      "instead of just one file:",
-                      0, per_file | OPT_EXIT | OPT_EXPERT, 0);
-    if (show_advanced)
-        show_help_options(options, "Advanced global options:", OPT_EXPERT,
-                          per_file | OPT_EXIT, 0);
-
-    show_help_options(options, "Per-file main options:", 0,
-                      OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE |
-                      OPT_EXIT, per_file);
-    if (show_advanced)
-        show_help_options(options, "Advanced per-file options:",
-                          OPT_EXPERT, OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE, per_file);
-
-    show_help_options(options, "Video options:",
-                      OPT_VIDEO, OPT_EXPERT | OPT_AUDIO, 0);
-    if (show_advanced)
-        show_help_options(options, "Advanced Video options:",
-                          OPT_EXPERT | OPT_VIDEO, OPT_AUDIO, 0);
-
-    show_help_options(options, "Audio options:",
-                      OPT_AUDIO, OPT_EXPERT | OPT_VIDEO, 0);
-    if (show_advanced)
-        show_help_options(options, "Advanced Audio options:",
-                          OPT_EXPERT | OPT_AUDIO, OPT_VIDEO, 0);
-    show_help_options(options, "Subtitle options:",
-                      OPT_SUBTITLE, 0, 0);
-    printf("\n");
-
-    if (show_avoptions) {
-        int flags = AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM;
-        show_help_children(avcodec_get_class(), flags);
-        show_help_children(avformat_get_class(), flags);
-        show_help_children(sws_get_class(), flags);
-        show_help_children(avfilter_get_class(), AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM);
-    }
-}
-
-void show_usage(void)
-{
-    printf("Hyper fast Audio and Video encoder\n");
-    printf("usage: %s [options] [[infile options] -i infile]... {[outfile options] outfile}...\n", program_name);
-    printf("\n");
-}
-
-enum OptGroup {
-    GROUP_OUTFILE,
-    GROUP_INFILE,
-};
-
-static const OptionGroupDef groups[] = {
-    [GROUP_OUTFILE] = { "output file",  NULL, OPT_OUTPUT },
-    [GROUP_INFILE]  = { "input file",   "i",  OPT_INPUT },
-};
-
-static int open_files(OptionGroupList *l, const char *inout,
-                      int (*open_file)(OptionsContext*, const char*))
-{
-    int i, ret;
-
-    for (i = 0; i < l->nb_groups; i++) {
-        OptionGroup *g = &l->groups[i];
-        OptionsContext o;
-
-        init_options(&o);
-        o.g = g;
-
-        ret = parse_optgroup(&o, g);
-        if (ret < 0) {
-            av_log(NULL, AV_LOG_ERROR, "Error parsing options for %s file "
-                   "%s.\n", inout, g->arg);
-            return ret;
-        }
-
-        av_log(NULL, AV_LOG_DEBUG, "Opening an %s file: %s.\n", inout, g->arg);
-        ret = open_file(&o, g->arg);
-        uninit_options(&o);
-        if (ret < 0) {
-            av_log(NULL, AV_LOG_ERROR, "Error opening %s file %s.\n",
-                   inout, g->arg);
-            return ret;
-        }
-        av_log(NULL, AV_LOG_DEBUG, "Successfully opened the file.\n");
-    }
-
-    return 0;
-}
-
-int avconv_parse_options(int argc, char **argv)
-{
-    OptionParseContext octx;
-    uint8_t error[128];
-    int ret;
-
-    memset(&octx, 0, sizeof(octx));
-
-    /* split the commandline into an internal representation */
-    ret = split_commandline(&octx, argc, argv, options, groups,
-                            FF_ARRAY_ELEMS(groups));
-    if (ret < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Error splitting the argument list: ");
-        goto fail;
-    }
-
-    /* apply global options */
-    ret = parse_optgroup(NULL, &octx.global_opts);
-    if (ret < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Error parsing global options: ");
-        goto fail;
-    }
-
-    /* open input files */
-    ret = open_files(&octx.groups[GROUP_INFILE], "input", open_input_file);
-    if (ret < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Error opening input files: ");
-        goto fail;
-    }
-
-    /* open output files */
-    ret = open_files(&octx.groups[GROUP_OUTFILE], "output", open_output_file);
-    if (ret < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Error opening output files: ");
-        goto fail;
-    }
-
-fail:
-    uninit_parse_context(&octx);
-    if (ret < 0) {
-        av_strerror(ret, error, sizeof(error));
-        av_log(NULL, AV_LOG_FATAL, "%s\n", error);
-    }
-    return ret;
-}
-
-#define OFFSET(x) offsetof(OptionsContext, x)
-const OptionDef options[] = {
-    /* main options */
-#include "cmdutils_common_opts.h"
-    { "f",              HAS_ARG | OPT_STRING | OPT_OFFSET |
-                        OPT_INPUT | OPT_OUTPUT,                      { .off       = OFFSET(format) },
-        "force format", "fmt" },
-    { "y",              OPT_BOOL,                                    {              &file_overwrite },
-        "overwrite output files" },
-    { "n",              OPT_BOOL,                                    {              &file_skip },
-        "never overwrite output files" },
-    { "c",              HAS_ARG | OPT_STRING | OPT_SPEC |
-                        OPT_INPUT | OPT_OUTPUT,                      { .off       = OFFSET(codec_names) },
-        "codec name", "codec" },
-    { "codec",          HAS_ARG | OPT_STRING | OPT_SPEC |
-                        OPT_INPUT | OPT_OUTPUT,                      { .off       = OFFSET(codec_names) },
-        "codec name", "codec" },
-    { "pre",            HAS_ARG | OPT_STRING | OPT_SPEC |
-                        OPT_OUTPUT,                                  { .off       = OFFSET(presets) },
-        "preset name", "preset" },
-    { "map",            HAS_ARG | OPT_EXPERT | OPT_PERFILE |
-                        OPT_OUTPUT,                                  { .func_arg = opt_map },
-        "set input stream mapping",
-        "[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]" },
-    { "map_metadata",   HAS_ARG | OPT_STRING | OPT_SPEC |
-                        OPT_OUTPUT,                                  { .off       = OFFSET(metadata_map) },
-        "set metadata information of outfile from infile",
-        "outfile[,metadata]:infile[,metadata]" },
-    { "map_chapters",   HAS_ARG | OPT_INT | OPT_EXPERT | OPT_OFFSET |
-                        OPT_OUTPUT,                                  { .off = OFFSET(chapters_input_file) },
-        "set chapters mapping", "input_file_index" },
-    { "t",              HAS_ARG | OPT_TIME | OPT_OFFSET |
-                        OPT_INPUT | OPT_OUTPUT,                      { .off = OFFSET(recording_time) },
-        "record or transcode \"duration\" seconds of audio/video",
-        "duration" },
-    { "fs",             HAS_ARG | OPT_INT64 | OPT_OFFSET | OPT_OUTPUT, { .off = OFFSET(limit_filesize) },
-        "set the limit file size in bytes", "limit_size" },
-    { "ss",             HAS_ARG | OPT_TIME | OPT_OFFSET |
-                        OPT_INPUT | OPT_OUTPUT,                      { .off = OFFSET(start_time) },
-        "set the start time offset", "time_off" },
-    { "accurate_seek",  OPT_BOOL | OPT_OFFSET | OPT_EXPERT |
-                        OPT_INPUT,                                   { .off = OFFSET(accurate_seek) },
-        "enable/disable accurate seeking with -ss" },
-    { "itsoffset",      HAS_ARG | OPT_TIME | OPT_OFFSET |
-                        OPT_EXPERT | OPT_INPUT,                      { .off = OFFSET(input_ts_offset) },
-        "set the input ts offset", "time_off" },
-    { "itsscale",       HAS_ARG | OPT_DOUBLE | OPT_SPEC |
-                        OPT_EXPERT | OPT_INPUT,                      { .off = OFFSET(ts_scale) },
-        "set the input ts scale", "scale" },
-    { "metadata",       HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(metadata) },
-        "add metadata", "string=string" },
-    { "dframes",        HAS_ARG | OPT_PERFILE | OPT_EXPERT |
-                        OPT_OUTPUT,                                  { .func_arg = opt_data_frames },
-        "set the number of data frames to record", "number" },
-    { "benchmark",      OPT_BOOL | OPT_EXPERT,                       { &do_benchmark },
-        "add timings for benchmarking" },
-    { "timelimit",      HAS_ARG | OPT_EXPERT,                        { .func_arg = opt_timelimit },
-        "set max runtime in seconds", "limit" },
-    { "dump",           OPT_BOOL | OPT_EXPERT,                       { &do_pkt_dump },
-        "dump each input packet" },
-    { "hex",            OPT_BOOL | OPT_EXPERT,                       { &do_hex_dump },
-        "when dumping packets, also dump the payload" },
-    { "re",             OPT_BOOL | OPT_EXPERT | OPT_OFFSET |
-                        OPT_INPUT,                                   { .off = OFFSET(rate_emu) },
-        "read input at native frame rate", "" },
-    { "target",         HAS_ARG | OPT_PERFILE | OPT_OUTPUT,          { .func_arg = opt_target },
-        "specify target file type (\"vcd\", \"svcd\", \"dvd\","
-        " \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)", "type" },
-    { "vsync",          HAS_ARG | OPT_EXPERT,                        { opt_vsync },
-        "video sync method", "" },
-    { "async",          HAS_ARG | OPT_INT | OPT_EXPERT,              { &audio_sync_method },
-        "audio sync method", "" },
-    { "adrift_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT,          { &audio_drift_threshold },
-        "audio drift threshold", "threshold" },
-    { "copyts",         OPT_BOOL | OPT_EXPERT,                       { &copy_ts },
-        "copy timestamps" },
-    { "copytb",         OPT_BOOL | OPT_EXPERT,                       { &copy_tb },
-        "copy input stream time base when stream copying" },
-    { "shortest",       OPT_BOOL | OPT_EXPERT | OPT_OFFSET |
-                        OPT_OUTPUT,                                  { .off = OFFSET(shortest) },
-        "finish encoding within shortest input" },
-    { "dts_delta_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT,       { &dts_delta_threshold },
-        "timestamp discontinuity delta threshold", "threshold" },
-    { "xerror",         OPT_BOOL | OPT_EXPERT,                       { &exit_on_error },
-        "exit on error", "error" },
-    { "copyinkf",       OPT_BOOL | OPT_EXPERT | OPT_SPEC |
-                        OPT_OUTPUT,                                  { .off = OFFSET(copy_initial_nonkeyframes) },
-        "copy initial non-keyframes" },
-    { "frames",         OPT_INT64 | HAS_ARG | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(max_frames) },
-        "set the number of frames to record", "number" },
-    { "tag",            OPT_STRING | HAS_ARG | OPT_SPEC |
-                        OPT_EXPERT | OPT_OUTPUT,                     { .off = OFFSET(codec_tags) },
-        "force codec tag/fourcc", "fourcc/tag" },
-    { "q",              HAS_ARG | OPT_EXPERT | OPT_DOUBLE |
-                        OPT_SPEC | OPT_OUTPUT,                       { .off = OFFSET(qscale) },
-        "use fixed quality scale (VBR)", "q" },
-    { "qscale",         HAS_ARG | OPT_EXPERT | OPT_DOUBLE |
-                        OPT_SPEC | OPT_OUTPUT,                       { .off = OFFSET(qscale) },
-        "use fixed quality scale (VBR)", "q" },
-    { "filter",         HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(filters) },
-        "set stream filterchain", "filter_list" },
-    { "filter_script",  HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(filter_scripts) },
-        "read stream filtergraph description from a file", "filename" },
-    { "filter_complex", HAS_ARG | OPT_EXPERT,                        { .func_arg = opt_filter_complex },
-        "create a complex filtergraph", "graph_description" },
-    { "filter_complex_script", HAS_ARG | OPT_EXPERT,                 { .func_arg = opt_filter_complex_script },
-        "read complex filtergraph description from a file", "filename" },
-    { "stats",          OPT_BOOL,                                    { &print_stats },
-        "print progress report during encoding", },
-    { "attach",         HAS_ARG | OPT_PERFILE | OPT_EXPERT |
-                        OPT_OUTPUT,                                  { .func_arg = opt_attach },
-        "add an attachment to the output file", "filename" },
-    { "dump_attachment", HAS_ARG | OPT_STRING | OPT_SPEC |
-                         OPT_EXPERT | OPT_INPUT,                     { .off = OFFSET(dump_attachment) },
-        "extract an attachment into a file", "filename" },
-
-    /* video options */
-    { "vframes",      OPT_VIDEO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_video_frames },
-        "set the number of video frames to record", "number" },
-    { "r",            OPT_VIDEO | HAS_ARG  | OPT_STRING | OPT_SPEC |
-                      OPT_INPUT | OPT_OUTPUT,                                    { .off = OFFSET(frame_rates) },
-        "set frame rate (Hz value, fraction or abbreviation)", "rate" },
-    { "s",            OPT_VIDEO | HAS_ARG  | OPT_STRING | OPT_SPEC |
-                      OPT_INPUT | OPT_OUTPUT,                                    { .off = OFFSET(frame_sizes) },
-        "set frame size (WxH or abbreviation)", "size" },
-    { "aspect",       OPT_VIDEO | HAS_ARG  | OPT_STRING | OPT_SPEC |
-                      OPT_OUTPUT,                                                { .off = OFFSET(frame_aspect_ratios) },
-        "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)", "aspect" },
-    { "pix_fmt",      OPT_VIDEO | HAS_ARG | OPT_EXPERT  | OPT_STRING | OPT_SPEC |
-                      OPT_INPUT | OPT_OUTPUT,                                    { .off = OFFSET(frame_pix_fmts) },
-        "set pixel format", "format" },
-    { "vn",           OPT_VIDEO | OPT_BOOL  | OPT_OFFSET | OPT_OUTPUT,           { .off = OFFSET(video_disable) },
-        "disable video" },
-    { "vdt",          OPT_VIDEO | OPT_INT | HAS_ARG | OPT_EXPERT ,               { &video_discard },
-        "discard threshold", "n" },
-    { "rc_override",  OPT_VIDEO | HAS_ARG | OPT_EXPERT  | OPT_STRING | OPT_SPEC |
-                      OPT_OUTPUT,                                                { .off = OFFSET(rc_overrides) },
-        "rate control override for specific intervals", "override" },
-    { "vcodec",       OPT_VIDEO | HAS_ARG  | OPT_PERFILE | OPT_INPUT |
-                      OPT_OUTPUT,                                                { .func_arg = opt_video_codec },
-        "force video codec ('copy' to copy stream)", "codec" },
-    { "pass",         OPT_VIDEO | HAS_ARG | OPT_SPEC | OPT_INT | OPT_OUTPUT,     { .off = OFFSET(pass) },
-        "select the pass number (1 or 2)", "n" },
-    { "passlogfile",  OPT_VIDEO | HAS_ARG | OPT_STRING | OPT_EXPERT | OPT_SPEC |
-                      OPT_OUTPUT,                                                { .off = OFFSET(passlogfiles) },
-        "select two pass log file name prefix", "prefix" },
-    { "vstats",       OPT_VIDEO | OPT_EXPERT ,                                   { &opt_vstats },
-        "dump video coding statistics to file" },
-    { "vstats_file",  OPT_VIDEO | HAS_ARG | OPT_EXPERT ,                         { opt_vstats_file },
-        "dump video coding statistics to file", "file" },
-    { "vf",           OPT_VIDEO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_video_filters },
-        "video filters", "filter list" },
-    { "intra_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT  | OPT_STRING | OPT_SPEC |
-                      OPT_OUTPUT,                                                { .off = OFFSET(intra_matrices) },
-        "specify intra matrix coeffs", "matrix" },
-    { "inter_matrix", OPT_VIDEO | HAS_ARG | OPT_EXPERT  | OPT_STRING | OPT_SPEC |
-                      OPT_OUTPUT,                                                { .off = OFFSET(inter_matrices) },
-        "specify inter matrix coeffs", "matrix" },
-    { "top",          OPT_VIDEO | HAS_ARG | OPT_EXPERT  | OPT_INT| OPT_SPEC |
-                      OPT_OUTPUT,                                                { .off = OFFSET(top_field_first) },
-        "top=1/bottom=0/auto=-1 field first", "" },
-    { "dc",           OPT_VIDEO | OPT_INT | HAS_ARG | OPT_EXPERT ,               { &intra_dc_precision },
-        "intra_dc_precision", "precision" },
-    { "vtag",         OPT_VIDEO | HAS_ARG | OPT_EXPERT  | OPT_PERFILE |
-                      OPT_OUTPUT,                                                { .func_arg = opt_video_tag },
-        "force video tag/fourcc", "fourcc/tag" },
-    { "qphist",       OPT_VIDEO | OPT_BOOL | OPT_EXPERT ,                        { &qp_hist },
-        "show QP histogram" },
-    { "force_fps",    OPT_VIDEO | OPT_BOOL | OPT_EXPERT  | OPT_SPEC |
-                      OPT_OUTPUT,                                                { .off = OFFSET(force_fps) },
-        "force the selected framerate, disable the best supported framerate selection" },
-    { "streamid",     OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_PERFILE |
-                      OPT_OUTPUT,                                                { .func_arg = opt_streamid },
-        "set the value of an outfile streamid", "streamIndex:value" },
-    { "force_key_frames", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
-                          OPT_SPEC | OPT_OUTPUT,                                 { .off = OFFSET(forced_key_frames) },
-        "force key frames at specified timestamps", "timestamps" },
-    { "hwaccel",          OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
-                          OPT_SPEC | OPT_INPUT,                                  { .off = OFFSET(hwaccels) },
-        "use HW accelerated decoding", "hwaccel name" },
-    { "hwaccel_device",   OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
-                          OPT_SPEC | OPT_INPUT,                                  { .off = OFFSET(hwaccel_devices) },
-        "select a device for HW acceleration" "devicename" },
-
-    /* audio options */
-    { "aframes",        OPT_AUDIO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_audio_frames },
-        "set the number of audio frames to record", "number" },
-    { "aq",             OPT_AUDIO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_audio_qscale },
-        "set audio quality (codec-specific)", "quality", },
-    { "ar",             OPT_AUDIO | HAS_ARG  | OPT_INT | OPT_SPEC |
-                        OPT_INPUT | OPT_OUTPUT,                                    { .off = OFFSET(audio_sample_rate) },
-        "set audio sampling rate (in Hz)", "rate" },
-    { "ac",             OPT_AUDIO | HAS_ARG  | OPT_INT | OPT_SPEC |
-                        OPT_INPUT | OPT_OUTPUT,                                    { .off = OFFSET(audio_channels) },
-        "set number of audio channels", "channels" },
-    { "an",             OPT_AUDIO | OPT_BOOL | OPT_OFFSET | OPT_OUTPUT,            { .off = OFFSET(audio_disable) },
-        "disable audio" },
-    { "acodec",         OPT_AUDIO | HAS_ARG  | OPT_PERFILE |
-                        OPT_INPUT | OPT_OUTPUT,                                    { .func_arg = opt_audio_codec },
-        "force audio codec ('copy' to copy stream)", "codec" },
-    { "atag",           OPT_AUDIO | HAS_ARG  | OPT_EXPERT | OPT_PERFILE |
-                        OPT_OUTPUT,                                                { .func_arg = opt_audio_tag },
-        "force audio tag/fourcc", "fourcc/tag" },
-    { "vol",            OPT_AUDIO | HAS_ARG  | OPT_INT,                            { &audio_volume },
-        "change audio volume (256=normal)" , "volume" },
-    { "sample_fmt",     OPT_AUDIO | HAS_ARG  | OPT_EXPERT | OPT_SPEC |
-                        OPT_STRING | OPT_INPUT | OPT_OUTPUT,                       { .off = OFFSET(sample_fmts) },
-        "set sample format", "format" },
-    { "channel_layout", OPT_AUDIO | HAS_ARG  | OPT_EXPERT | OPT_PERFILE |
-                        OPT_INPUT | OPT_OUTPUT,                                    { .func_arg = opt_channel_layout },
-        "set channel layout", "layout" },
-    { "af",             OPT_AUDIO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_audio_filters },
-        "audio filters", "filter list" },
-
-    /* subtitle options */
-    { "sn",     OPT_SUBTITLE | OPT_BOOL | OPT_OFFSET | OPT_OUTPUT, { .off = OFFSET(subtitle_disable) },
-        "disable subtitle" },
-    { "scodec", OPT_SUBTITLE | HAS_ARG  | OPT_PERFILE | OPT_INPUT | OPT_OUTPUT, { .func_arg = opt_subtitle_codec },
-        "force subtitle codec ('copy' to copy stream)", "codec" },
-    { "stag",   OPT_SUBTITLE | HAS_ARG  | OPT_EXPERT  | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_subtitle_tag }
-        , "force subtitle tag/fourcc", "fourcc/tag" },
-
-    /* grab options */
-    { "isync", OPT_BOOL | OPT_EXPERT, { &input_sync }, "this option is deprecated and does nothing", "" },
-
-    /* muxer options */
-    { "muxdelay",   OPT_FLOAT | HAS_ARG | OPT_EXPERT | OPT_OFFSET | OPT_OUTPUT, { .off = OFFSET(mux_max_delay) },
-        "set the maximum demux-decode delay", "seconds" },
-    { "muxpreload", OPT_FLOAT | HAS_ARG | OPT_EXPERT | OPT_OFFSET | OPT_OUTPUT, { .off = OFFSET(mux_preload) },
-        "set the initial demux-decode delay", "seconds" },
-
-    { "bsf", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(bitstream_filters) },
-        "A comma-separated list of bitstream filters", "bitstream_filters" },
-
-    /* data codec support */
-    { "dcodec", HAS_ARG | OPT_DATA | OPT_PERFILE | OPT_EXPERT | OPT_INPUT | OPT_OUTPUT, { .func_arg = opt_data_codec },
-        "force data codec ('copy' to copy stream)", "codec" },
-
-    { NULL, },
-};
diff --git a/deps/libav/avconv_vdpau.c b/deps/libav/avconv_vdpau.c
deleted file mode 100644
index 820678e..0000000
--- a/deps/libav/avconv_vdpau.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include <vdpau/vdpau.h>
-#include <vdpau/vdpau_x11.h>
-
-#include <X11/Xlib.h>
-
-#include "avconv.h"
-
-#include "libavcodec/vdpau.h"
-
-#include "libavutil/avassert.h"
-#include "libavutil/buffer.h"
-#include "libavutil/frame.h"
-#include "libavutil/pixfmt.h"
-
-typedef struct VDPAUContext {
-    Display *dpy;
-
-    VdpDevice  device;
-    VdpDecoder decoder;
-    VdpGetProcAddress *get_proc_address;
-
-    VdpGetErrorString                               *get_error_string;
-    VdpGetInformationString                         *get_information_string;
-    VdpDeviceDestroy                                *device_destroy;
-    VdpDecoderCreate                                *decoder_create;
-    VdpDecoderDestroy                               *decoder_destroy;
-    VdpDecoderRender                                *decoder_render;
-    VdpVideoSurfaceCreate                           *video_surface_create;
-    VdpVideoSurfaceDestroy                          *video_surface_destroy;
-    VdpVideoSurfaceGetBitsYCbCr                     *video_surface_get_bits;
-    VdpVideoSurfaceGetParameters                    *video_surface_get_parameters;
-    VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities *video_surface_query;
-
-    AVFrame *tmp_frame;
-
-    enum AVPixelFormat pix_fmt;
-    VdpYCbCrFormat vdpau_format;
-} VDPAUContext;
-
-static void vdpau_uninit(AVCodecContext *s)
-{
-    InputStream  *ist = s->opaque;
-    VDPAUContext *ctx = ist->hwaccel_ctx;
-
-    ist->hwaccel_uninit        = NULL;
-    ist->hwaccel_get_buffer    = NULL;
-    ist->hwaccel_retrieve_data = NULL;
-
-    if (ctx->decoder_destroy)
-        ctx->decoder_destroy(ctx->decoder);
-
-    if (ctx->device_destroy)
-        ctx->device_destroy(ctx->device);
-
-    if (ctx->dpy)
-        XCloseDisplay(ctx->dpy);
-
-    av_frame_free(&ctx->tmp_frame);
-
-    av_freep(&ist->hwaccel_ctx);
-    av_freep(&s->hwaccel_context);
-}
-
-static void vdpau_release_buffer(void *opaque, uint8_t *data)
-{
-    VdpVideoSurface surface = *(VdpVideoSurface*)data;
-    VDPAUContext *ctx = opaque;
-
-    ctx->video_surface_destroy(surface);
-    av_freep(&data);
-}
-
-static int vdpau_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
-{
-    InputStream         *ist = s->opaque;
-    VDPAUContext        *ctx = ist->hwaccel_ctx;
-    VdpVideoSurface *surface;
-    VdpStatus err;
-
-    av_assert0(frame->format == AV_PIX_FMT_VDPAU);
-
-    surface = av_malloc(sizeof(*surface));
-    if (!surface)
-        return AVERROR(ENOMEM);
-
-    frame->buf[0] = av_buffer_create((uint8_t*)surface, sizeof(*surface),
-                                     vdpau_release_buffer, ctx,
-                                     AV_BUFFER_FLAG_READONLY);
-    if (!frame->buf[0]) {
-        av_freep(&surface);
-        return AVERROR(ENOMEM);
-    }
-
-    // properly we should keep a pool of surfaces instead of creating
-    // them anew for each frame, but since we don't care about speed
-    // much in this code, we don't bother
-    err = ctx->video_surface_create(ctx->device, VDP_CHROMA_TYPE_420,
-                                    frame->width, frame->height, surface);
-    if (err != VDP_STATUS_OK) {
-        av_log(NULL, AV_LOG_ERROR, "Error allocating a VDPAU video surface: %s\n",
-               ctx->get_error_string(err));
-        av_buffer_unref(&frame->buf[0]);
-        return AVERROR_UNKNOWN;
-    }
-
-    frame->data[3] = (uint8_t*)(uintptr_t)*surface;
-
-    return 0;
-}
-
-static int vdpau_retrieve_data(AVCodecContext *s, AVFrame *frame)
-{
-    VdpVideoSurface surface = (VdpVideoSurface)(uintptr_t)frame->data[3];
-    InputStream        *ist = s->opaque;
-    VDPAUContext       *ctx = ist->hwaccel_ctx;
-    VdpStatus err;
-    int ret, chroma_type;
-
-    err = ctx->video_surface_get_parameters(surface, &chroma_type,
-                                            &ctx->tmp_frame->width,
-                                            &ctx->tmp_frame->height);
-    if (err != VDP_STATUS_OK) {
-        av_log(NULL, AV_LOG_ERROR, "Error getting surface parameters: %s\n",
-               ctx->get_error_string(err));
-        return AVERROR_UNKNOWN;
-    }
-    ctx->tmp_frame->format = ctx->pix_fmt;
-
-    ret = av_frame_get_buffer(ctx->tmp_frame, 32);
-    if (ret < 0)
-        return ret;
-
-    ctx->tmp_frame->width  = frame->width;
-    ctx->tmp_frame->height = frame->height;
-
-    err = ctx->video_surface_get_bits(surface, ctx->vdpau_format,
-                                      (void * const *)ctx->tmp_frame->data,
-                                      ctx->tmp_frame->linesize);
-    if (err != VDP_STATUS_OK) {
-        av_log(NULL, AV_LOG_ERROR, "Error retrieving frame data from VDPAU: %s\n",
-               ctx->get_error_string(err));
-        ret = AVERROR_UNKNOWN;
-        goto fail;
-    }
-
-    if (ctx->vdpau_format == VDP_YCBCR_FORMAT_YV12)
-        FFSWAP(uint8_t*, ctx->tmp_frame->data[1], ctx->tmp_frame->data[2]);
-
-    ret = av_frame_copy_props(ctx->tmp_frame, frame);
-    if (ret < 0)
-        goto fail;
-
-    av_frame_unref(frame);
-    av_frame_move_ref(frame, ctx->tmp_frame);
-    return 0;
-
-fail:
-    av_frame_unref(ctx->tmp_frame);
-    return ret;
-}
-
-static const int vdpau_formats[][2] = {
-    { VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV420P },
-    { VDP_YCBCR_FORMAT_NV12, AV_PIX_FMT_NV12 },
-    { VDP_YCBCR_FORMAT_YUYV, AV_PIX_FMT_YUYV422 },
-    { VDP_YCBCR_FORMAT_UYVY, AV_PIX_FMT_UYVY422 },
-};
-
-static int vdpau_alloc(AVCodecContext *s)
-{
-    InputStream  *ist = s->opaque;
-    int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
-    AVVDPAUContext *vdpau_ctx;
-    VDPAUContext *ctx;
-    const char *display, *vendor;
-    VdpStatus err;
-    int i;
-
-    ctx = av_mallocz(sizeof(*ctx));
-    if (!ctx)
-        return AVERROR(ENOMEM);
-
-    ist->hwaccel_ctx           = ctx;
-    ist->hwaccel_uninit        = vdpau_uninit;
-    ist->hwaccel_get_buffer    = vdpau_get_buffer;
-    ist->hwaccel_retrieve_data = vdpau_retrieve_data;
-
-    ctx->tmp_frame = av_frame_alloc();
-    if (!ctx->tmp_frame)
-        goto fail;
-
-    ctx->dpy = XOpenDisplay(ist->hwaccel_device);
-    if (!ctx->dpy) {
-        av_log(NULL, loglevel, "Cannot open the X11 display %s.\n",
-               XDisplayName(ist->hwaccel_device));
-        goto fail;
-    }
-    display = XDisplayString(ctx->dpy);
-
-    err = vdp_device_create_x11(ctx->dpy, XDefaultScreen(ctx->dpy), &ctx->device,
-                                &ctx->get_proc_address);
-    if (err != VDP_STATUS_OK) {
-        av_log(NULL, loglevel, "VDPAU device creation on X11 display %s failed.\n",
-               display);
-        goto fail;
-    }
-
-#define GET_CALLBACK(id, result)                                                \
-do {                                                                            \
-    void *tmp;                                                                  \
-    err = ctx->get_proc_address(ctx->device, id, &tmp);                         \
-    if (err != VDP_STATUS_OK) {                                                 \
-        av_log(NULL, loglevel, "Error getting the " #id " callback.\n");        \
-        goto fail;                                                              \
-    }                                                                           \
-    ctx->result = tmp;                                                          \
-} while (0)
-
-    GET_CALLBACK(VDP_FUNC_ID_GET_ERROR_STRING,               get_error_string);
-    GET_CALLBACK(VDP_FUNC_ID_GET_INFORMATION_STRING,         get_information_string);
-    GET_CALLBACK(VDP_FUNC_ID_DEVICE_DESTROY,                 device_destroy);
-    GET_CALLBACK(VDP_FUNC_ID_DECODER_CREATE,                 decoder_create);
-    GET_CALLBACK(VDP_FUNC_ID_DECODER_DESTROY,                decoder_destroy);
-    GET_CALLBACK(VDP_FUNC_ID_DECODER_RENDER,                 decoder_render);
-    GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_CREATE,           video_surface_create);
-    GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_DESTROY,          video_surface_destroy);
-    GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR, video_surface_get_bits);
-    GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_GET_PARAMETERS,   video_surface_get_parameters);
-    GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES,
-                 video_surface_query);
-
-    for (i = 0; i < FF_ARRAY_ELEMS(vdpau_formats); i++) {
-        VdpBool supported;
-        err = ctx->video_surface_query(ctx->device, VDP_CHROMA_TYPE_420,
-                                       vdpau_formats[i][0], &supported);
-        if (err != VDP_STATUS_OK) {
-            av_log(NULL, loglevel,
-                   "Error querying VDPAU surface capabilities: %s\n",
-                   ctx->get_error_string(err));
-            goto fail;
-        }
-        if (supported)
-            break;
-    }
-    if (i == FF_ARRAY_ELEMS(vdpau_formats)) {
-        av_log(NULL, loglevel,
-               "No supported VDPAU format for retrieving the data.\n");
-        return AVERROR(EINVAL);
-    }
-    ctx->vdpau_format = vdpau_formats[i][0];
-    ctx->pix_fmt      = vdpau_formats[i][1];
-
-    vdpau_ctx = av_vdpau_alloc_context();
-    if (!vdpau_ctx)
-        goto fail;
-    vdpau_ctx->render = ctx->decoder_render;
-
-    s->hwaccel_context = vdpau_ctx;
-
-    ctx->get_information_string(&vendor);
-    av_log(NULL, AV_LOG_VERBOSE, "Using VDPAU -- %s -- on X11 display %s, "
-           "to decode input stream #%d:%d.\n", vendor,
-           display, ist->file_index, ist->st->index);
-
-    return 0;
-
-fail:
-    av_log(NULL, loglevel, "VDPAU init failed for stream #%d:%d.\n",
-           ist->file_index, ist->st->index);
-    vdpau_uninit(s);
-    return AVERROR(EINVAL);
-}
-
-int vdpau_init(AVCodecContext *s)
-{
-    InputStream *ist = s->opaque;
-    int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
-    AVVDPAUContext *vdpau_ctx;
-    VDPAUContext *ctx;
-    VdpStatus err;
-    int profile, ret;
-
-    if (!ist->hwaccel_ctx) {
-        ret = vdpau_alloc(s);
-        if (ret < 0)
-            return ret;
-    }
-    ctx       = ist->hwaccel_ctx;
-    vdpau_ctx = s->hwaccel_context;
-
-    ret = av_vdpau_get_profile(s, &profile);
-    if (ret < 0) {
-        av_log(NULL, loglevel, "No known VDPAU decoder profile for this stream.\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (ctx->decoder)
-        ctx->decoder_destroy(ctx->decoder);
-
-    err = ctx->decoder_create(ctx->device, profile,
-                              s->coded_width, s->coded_height,
-                              16, &ctx->decoder);
-    if (err != VDP_STATUS_OK) {
-        av_log(NULL, loglevel, "Error creating the VDPAU decoder: %s\n",
-               ctx->get_error_string(err));
-        return AVERROR_UNKNOWN;
-    }
-
-    vdpau_ctx->decoder = ctx->decoder;
-
-    ist->hwaccel_get_buffer    = vdpau_get_buffer;
-    ist->hwaccel_retrieve_data = vdpau_retrieve_data;
-
-    return 0;
-}
diff --git a/deps/libav/avplay.c b/deps/libav/avplay.c
deleted file mode 100644
index b70ee54..0000000
--- a/deps/libav/avplay.c
+++ /dev/null
@@ -1,3001 +0,0 @@
-/*
- * avplay : Simple Media Player based on the Libav libraries
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; 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 <stdint.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/colorspace.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/dict.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/samplefmt.h"
-#include "libavutil/time.h"
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
-#include "libswscale/swscale.h"
-#include "libavresample/avresample.h"
-#include "libavutil/opt.h"
-#include "libavcodec/avfft.h"
-
-#if CONFIG_AVFILTER
-# include "libavfilter/avfilter.h"
-# include "libavfilter/buffersink.h"
-# include "libavfilter/buffersrc.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 <assert.h>
-
-const char program_name[] = "avplay";
-const int program_birth_year = 2003;
-
-#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)
-
-static int64_t sws_flags = SWS_BICUBIC;
-
-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 timestamp 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;
-    int reallocate;
-    enum AVPixelFormat pix_fmt;
-
-    AVRational sar;
-} 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 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;
-    uint8_t silence_buf[SDL_AUDIO_BUFFER_SIZE];
-    uint8_t *audio_buf;
-    uint8_t *audio_buf1;
-    unsigned int audio_buf_size; /* in bytes */
-    int audio_buf_index; /* in bytes */
-    AVPacket audio_pkt_temp;
-    AVPacket audio_pkt;
-    enum AVSampleFormat sdl_sample_fmt;
-    uint64_t sdl_channel_layout;
-    int sdl_channels;
-    int sdl_sample_rate;
-    enum AVSampleFormat resample_sample_fmt;
-    uint64_t resample_channel_layout;
-    int resample_sample_rate;
-    AVAudioResampleContext *avr;
-    AVFrame *frame;
-
-    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;
-    FFTSample *rdft_data;
-    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;
-
-    PtsCorrectionContext pts_ctx;
-
-#if CONFIG_AVFILTER
-    AVFilterContext *in_video_filter;   // the first filter in the video chain
-    AVFilterContext *out_video_filter;  // the last filter in the video chain
-#endif
-
-    float skip_frames;
-    float skip_frames_index;
-    int refresh;
-} VideoState;
-
-/* 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 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 step = 0;
-static int workaround_bugs = 1;
-static int fast = 0;
-static int genpts = 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_concealment = 3;
-static int decoder_reorder_pts = -1;
-static int autoexit;
-static int exit_on_keydown;
-static int exit_on_mousedown;
-static int loop = 1;
-static int framedrop = 1;
-static int infinite_buffer = 0;
-
-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);
-}
-
-#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)
-{
-    avsubtitle_free(&sp->sub);
-}
-
-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->sar.num)
-             aspect_ratio = 0;
-         else
-             aspect_ratio = av_q2d(vp->sar);
-#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 (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;
-        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);
-    }
-}
-
-/* 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;
-}
-
-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->sdl_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->sdl_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);
-            av_free(s->rdft_data);
-            s->rdft = av_rdft_init(rdft_bits, DFT_R2C);
-            s->rdft_bits = rdft_bits;
-            s->rdft_data = av_malloc(4 * nb_freq * sizeof(*s->rdft_data));
-        }
-        {
-            FFTSample *data[2];
-            for (ch = 0; ch < nb_display_channels; ch++) {
-                data[ch] = s->rdft_data + 2 * nb_freq * 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 it is 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 = (nb_display_channels == 2 ) ? sqrt(w * sqrt(data[1][2 * y + 0] * data[1][2 * y + 0]
-                       + data[1][2 * y + 1] * data[1][2 * y + 1])) : a;
-                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;
-
-#if defined(__APPLE__) && !SDL_VERSION_ATLEAST(1, 2, 14)
-    /* setting bits_per_pixel = 0 or 32 causes blank video on OS X and older SDL */
-    screen = SDL_SetVideoMode(w, h, 24, flags);
-#else
-    screen = SDL_SetVideoMode(w, h, 0, 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);
-        }
-        av_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->sdl_sample_rate * is->sdl_channels *
-                        av_get_bytes_per_sample(is->sdl_sample_fmt);
-    }
-    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;
-
-    av_dlog(NULL, "video: delay=%0.3f pts=%0.3f A-V=%f\n",
-            delay, frame_current_pts, -diff);
-
-    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 */
-            if (!display_disable)
-                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 */
-        if (!display_disable)
-            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->pts_ctx.num_faulty_dts, is->pts_ctx.num_faulty_pts);
-            fflush(stdout);
-            last_time = cur_time;
-        }
-    }
-}
-
-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 (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 do_exit(void)
-{
-    if (cur_stream) {
-        stream_close(cur_stream);
-        cur_stream = NULL;
-    }
-    uninit_opts();
-    avformat_network_deinit();
-    if (show_status)
-        printf("\n");
-    SDL_Quit();
-    av_log(NULL, AV_LOG_QUIET, "");
-    exit(0);
-}
-
-/* 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
-    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);
-    if (!vp->bmp || vp->bmp->pitches[0] < vp->width) {
-        /* SDL allocates a buffer smaller than requested if the video
-         * overlay hardware is unable to support the requested size. */
-        fprintf(stderr, "Error: the video system does not support an image\n"
-                        "size of %dx%d pixels. Try using -vf \"scale=w:h\"\n"
-                        "to reduce the image size.\n", vp->width, vp->height );
-        do_exit();
-    }
-
-    SDL_LockMutex(is->pictq_mutex);
-    vp->allocated = 1;
-    SDL_CondSignal(is->pictq_cond);
-    SDL_UnlockMutex(is->pictq_mutex);
-}
-
-/* The 'pts' parameter is the dts of the packet / 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;
-#if CONFIG_AVFILTER
-    AVPicture pict_src;
-#else
-    int dst_pix_fmt = AV_PIX_FMT_YUV420P;
-#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 || vp->reallocate ||
-#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;
-        vp->reallocate = 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 = { { 0 } };
-
-        /* get a pointer on the bitmap */
-        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];
-
-#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
-        av_opt_get_int(sws_opts, "sws_flags", 0, &sws_flags);
-        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.
- * The 'pts1' parameter is the dts of the packet / pts of the frame. */
-static int output_picture2(VideoState *is, AVFrame *src_frame, double pts1, int64_t pos)
-{
-    double frame_delay, pts;
-    int ret;
-
-    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;
-
-    ret = queue_picture(is, src_frame, pts, pos);
-    av_frame_unref(src_frame);
-    return ret;
-}
-
-static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt)
-{
-    int 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);
-
-        init_pts_correction(&is->pts_ctx);
-        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;
-    }
-
-    avcodec_decode_video2(is->video_st->codec, frame, &got_picture, pkt);
-
-    if (got_picture) {
-        if (decoder_reorder_pts == -1) {
-            *pts = guess_correct_pts(&is->pts_ctx, frame->pkt_pts, frame->pkt_dts);
-        } else if (decoder_reorder_pts) {
-            *pts = frame->pkt_pts;
-        } else {
-            *pts = frame->pkt_dts;
-        }
-
-        if (*pts == AV_NOPTS_VALUE) {
-            *pts = 0;
-        }
-        if (is->video_st->sample_aspect_ratio.num) {
-            frame->sample_aspect_ratio = is->video_st->sample_aspect_ratio;
-        }
-
-        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;
-        }
-        av_frame_unref(frame);
-    }
-    return 0;
-}
-
-#if CONFIG_AVFILTER
-static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const char *vfilters)
-{
-    char sws_flags_str[128];
-    char buffersrc_args[256];
-    int ret;
-    AVFilterContext *filt_src = NULL, *filt_out = NULL, *filt_format;
-    AVCodecContext *codec = is->video_st->codec;
-
-    snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%"PRId64, sws_flags);
-    graph->scale_sws_opts = av_strdup(sws_flags_str);
-
-    snprintf(buffersrc_args, sizeof(buffersrc_args), "%d:%d:%d:%d:%d:%d:%d",
-             codec->width, codec->height, codec->pix_fmt,
-             is->video_st->time_base.num, is->video_st->time_base.den,
-             codec->sample_aspect_ratio.num, codec->sample_aspect_ratio.den);
-
-
-    if ((ret = avfilter_graph_create_filter(&filt_src,
-                                            avfilter_get_by_name("buffer"),
-                                            "src", buffersrc_args, NULL,
-                                            graph)) < 0)
-        return ret;
-    if ((ret = avfilter_graph_create_filter(&filt_out,
-                                            avfilter_get_by_name("buffersink"),
-                                            "out", NULL, NULL, graph)) < 0)
-        return ret;
-
-    if ((ret = avfilter_graph_create_filter(&filt_format,
-                                            avfilter_get_by_name("format"),
-                                            "format", "yuv420p", NULL, graph)) < 0)
-        return ret;
-    if ((ret = avfilter_link(filt_format, 0, filt_out, 0)) < 0)
-        return ret;
-
-
-    if (vfilters) {
-        AVFilterInOut *outputs = avfilter_inout_alloc();
-        AVFilterInOut *inputs  = avfilter_inout_alloc();
-
-        outputs->name    = av_strdup("in");
-        outputs->filter_ctx = filt_src;
-        outputs->pad_idx = 0;
-        outputs->next    = NULL;
-
-        inputs->name    = av_strdup("out");
-        inputs->filter_ctx = filt_format;
-        inputs->pad_idx = 0;
-        inputs->next    = NULL;
-
-        if ((ret = avfilter_graph_parse(graph, vfilters, inputs, outputs, NULL)) < 0)
-            return ret;
-    } else {
-        if ((ret = avfilter_link(filt_src, 0, filt_format, 0)) < 0)
-            return ret;
-    }
-
-    if ((ret = avfilter_graph_config(graph, NULL)) < 0)
-        return ret;
-
-    is->in_video_filter  = filt_src;
-    is->out_video_filter = filt_out;
-
-    return ret;
-}
-
-#endif  /* CONFIG_AVFILTER */
-
-static int video_thread(void *arg)
-{
-    AVPacket pkt = { 0 };
-    VideoState *is = arg;
-    AVFrame *frame = av_frame_alloc();
-    int64_t pts_int;
-    double pts;
-    int ret;
-
-#if CONFIG_AVFILTER
-    AVFilterGraph *graph = avfilter_graph_alloc();
-    AVFilterContext *filt_out = NULL, *filt_in = NULL;
-    int last_w = is->video_st->codec->width;
-    int last_h = is->video_st->codec->height;
-
-    if ((ret = configure_video_filters(graph, is, vfilters)) < 0)
-        goto the_end;
-    filt_in  = is->in_video_filter;
-    filt_out = is->out_video_filter;
-#endif
-
-    for (;;) {
-#if CONFIG_AVFILTER
-        AVRational tb;
-#endif
-        while (is->paused && !is->videoq.abort_request)
-            SDL_Delay(10);
-
-        av_free_packet(&pkt);
-
-        ret = get_video_frame(is, frame, &pts_int, &pkt);
-        if (ret < 0)
-            goto the_end;
-
-        if (!ret)
-            continue;
-
-#if CONFIG_AVFILTER
-        if (   last_w != is->video_st->codec->width
-            || last_h != is->video_st->codec->height) {
-            av_dlog(NULL, "Changing size %dx%d -> %dx%d\n", last_w, last_h,
-                    is->video_st->codec->width, is->video_st->codec->height);
-            avfilter_graph_free(&graph);
-            graph = avfilter_graph_alloc();
-            if ((ret = configure_video_filters(graph, is, vfilters)) < 0)
-                goto the_end;
-            filt_in  = is->in_video_filter;
-            filt_out = is->out_video_filter;
-            last_w = is->video_st->codec->width;
-            last_h = is->video_st->codec->height;
-        }
-
-        frame->pts = pts_int;
-        ret = av_buffersrc_add_frame(filt_in, frame);
-        if (ret < 0)
-            goto the_end;
-
-        while (ret >= 0) {
-            ret = av_buffersink_get_frame(filt_out, frame);
-            if (ret < 0) {
-                ret = 0;
-                break;
-            }
-
-            pts_int = frame->pts;
-            tb      = filt_out->inputs[0]->time_base;
-            if (av_cmp_q(tb, is->video_st->time_base)) {
-                av_unused int64_t pts1 = pts_int;
-                pts_int = av_rescale_q(pts_int, tb, is->video_st->time_base);
-                av_dlog(NULL, "video_thread(): "
-                        "tb:%d/%d pts:%"PRId64" -> tb:%d/%d pts:%"PRId64"\n",
-                        tb.num, tb.den, pts1,
-                        is->video_st->time_base.num, is->video_st->time_base.den, pts_int);
-            }
-            pts = pts_int * av_q2d(is->video_st->time_base);
-            ret = output_picture2(is, frame, pts, 0);
-        }
-#else
-        pts = pts_int * av_q2d(is->video_st->time_base);
-        ret = output_picture2(is, frame, pts,  pkt.pos);
-#endif
-
-        if (ret < 0)
-            goto the_end;
-
-
-        if (step)
-            if (cur_stream)
-                stream_pause(cur_stream);
-    }
- the_end:
-#if CONFIG_AVFILTER
-    av_freep(&vfilters);
-    avfilter_graph_free(&graph);
-#endif
-    av_free_packet(&pkt);
-    av_frame_free(&frame);
-    return 0;
-}
-
-static int subtitle_thread(void *arg)
-{
-    VideoState *is = arg;
-    SubPicture *sp;
-    AVPacket pkt1, *pkt = &pkt1;
-    int 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)
-            return 0;
-
-        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;
-
-        avcodec_decode_subtitle2(is->subtitle_st->codec, &sp->sub,
-                                 &got_subtitle, pkt);
-
-        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);
-    }
-    return 0;
-}
-
-/* copy samples for viewing in editor window */
-static void update_sample_display(VideoState *is, short *samples, int samples_size)
-{
-    int size, len;
-
-    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 = is->sdl_channels * av_get_bytes_per_sample(is->sdl_sample_fmt);
-    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->sdl_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;
-                    }
-                }
-                av_dlog(NULL, "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);
-            }
-        } 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, got_frame;
-    double pts;
-    int new_packet = 0;
-    int flush_complete = 0;
-
-    for (;;) {
-        /* NOTE: the audio packet can contain several frames */
-        while (pkt_temp->size > 0 || (!pkt_temp->data && new_packet)) {
-            int resample_changed, audio_resample;
-
-            if (!is->frame) {
-                if (!(is->frame = av_frame_alloc()))
-                    return AVERROR(ENOMEM);
-            }
-
-            if (flush_complete)
-                break;
-            new_packet = 0;
-            len1 = avcodec_decode_audio4(dec, is->frame, &got_frame, 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 (!got_frame) {
-                /* stop sending empty packets if the decoder is finished */
-                if (!pkt_temp->data && dec->codec->capabilities & CODEC_CAP_DELAY)
-                    flush_complete = 1;
-                continue;
-            }
-            data_size = av_samples_get_buffer_size(NULL, dec->channels,
-                                                   is->frame->nb_samples,
-                                                   is->frame->format, 1);
-
-            audio_resample = is->frame->format         != is->sdl_sample_fmt     ||
-                             is->frame->channel_layout != is->sdl_channel_layout ||
-                             is->frame->sample_rate    != is->sdl_sample_rate;
-
-            resample_changed = is->frame->format         != is->resample_sample_fmt     ||
-                               is->frame->channel_layout != is->resample_channel_layout ||
-                               is->frame->sample_rate    != is->resample_sample_rate;
-
-            if ((!is->avr && audio_resample) || resample_changed) {
-                int ret;
-                if (is->avr)
-                    avresample_close(is->avr);
-                else if (audio_resample) {
-                    is->avr = avresample_alloc_context();
-                    if (!is->avr) {
-                        fprintf(stderr, "error allocating AVAudioResampleContext\n");
-                        break;
-                    }
-                }
-                if (audio_resample) {
-                    av_opt_set_int(is->avr, "in_channel_layout",  is->frame->channel_layout, 0);
-                    av_opt_set_int(is->avr, "in_sample_fmt",      is->frame->format,         0);
-                    av_opt_set_int(is->avr, "in_sample_rate",     is->frame->sample_rate,    0);
-                    av_opt_set_int(is->avr, "out_channel_layout", is->sdl_channel_layout,    0);
-                    av_opt_set_int(is->avr, "out_sample_fmt",     is->sdl_sample_fmt,        0);
-                    av_opt_set_int(is->avr, "out_sample_rate",    is->sdl_sample_rate,       0);
-
-                    if ((ret = avresample_open(is->avr)) < 0) {
-                        fprintf(stderr, "error initializing libavresample\n");
-                        break;
-                    }
-                }
-                is->resample_sample_fmt     = is->frame->format;
-                is->resample_channel_layout = is->frame->channel_layout;
-                is->resample_sample_rate    = is->frame->sample_rate;
-            }
-
-            if (audio_resample) {
-                void *tmp_out;
-                int out_samples, out_size, out_linesize;
-                int osize      = av_get_bytes_per_sample(is->sdl_sample_fmt);
-                int nb_samples = is->frame->nb_samples;
-
-                out_size = av_samples_get_buffer_size(&out_linesize,
-                                                      is->sdl_channels,
-                                                      nb_samples,
-                                                      is->sdl_sample_fmt, 0);
-                tmp_out = av_realloc(is->audio_buf1, out_size);
-                if (!tmp_out)
-                    return AVERROR(ENOMEM);
-                is->audio_buf1 = tmp_out;
-
-                out_samples = avresample_convert(is->avr,
-                                                 &is->audio_buf1,
-                                                 out_linesize, nb_samples,
-                                                 is->frame->data,
-                                                 is->frame->linesize[0],
-                                                 is->frame->nb_samples);
-                if (out_samples < 0) {
-                    fprintf(stderr, "avresample_convert() failed\n");
-                    break;
-                }
-                is->audio_buf = is->audio_buf1;
-                data_size = out_samples * osize * is->sdl_channels;
-            } else {
-                is->audio_buf = is->frame->data[0];
-            }
-
-            /* if no pts, then compute it */
-            pts = is->audio_clock;
-            *pts_ptr = pts;
-            n = is->sdl_channels * av_get_bytes_per_sample(is->sdl_sample_fmt);
-            is->audio_clock += (double)data_size /
-                (double)(n * is->sdl_sample_rate);
-#ifdef DEBUG
-            {
-                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);
-        memset(pkt_temp, 0, sizeof(*pkt_temp));
-
-        if (is->paused || is->audioq.abort_request) {
-            return -1;
-        }
-
-        /* read next packet */
-        if ((new_packet = packet_queue_get(&is->audioq, pkt, 1)) < 0)
-            return -1;
-
-        if (pkt->data == flush_pkt.data) {
-            avcodec_flush_buffers(dec);
-            flush_complete = 0;
-        }
-
-        *pkt_temp = *pkt;
-
-        /* 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;
-        }
-    }
-}
-
-/* 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->silence_buf;
-               is->audio_buf_size = sizeof(is->silence_buf);
-           } 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;
-    AVDictionary *opts;
-    AVDictionaryEntry *t = NULL;
-
-    if (stream_index < 0 || stream_index >= ic->nb_streams)
-        return -1;
-    avctx = ic->streams[stream_index]->codec;
-
-    opts = filter_codec_opts(codec_opts, avctx->codec_id, ic, ic->streams[stream_index], NULL);
-
-    codec = avcodec_find_decoder(avctx->codec_id);
-    avctx->workaround_bugs   = workaround_bugs;
-    avctx->idct_algo         = idct;
-    avctx->skip_frame        = skip_frame;
-    avctx->skip_idct         = skip_idct;
-    avctx->skip_loop_filter  = skip_loop_filter;
-    avctx->error_concealment = error_concealment;
-
-    if (fast)   avctx->flags2 |= CODEC_FLAG2_FAST;
-
-    if (!av_dict_get(opts, "threads", NULL, 0))
-        av_dict_set(&opts, "threads", "auto", 0);
-    if (avctx->codec_type == AVMEDIA_TYPE_VIDEO)
-        av_dict_set(&opts, "refcounted_frames", "1", 0);
-    if (!codec ||
-        avcodec_open2(avctx, codec, &opts) < 0)
-        return -1;
-    if ((t = av_dict_get(opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
-        av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
-        return AVERROR_OPTION_NOT_FOUND;
-    }
-
-    /* prepare audio output */
-    if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
-        is->sdl_sample_rate = avctx->sample_rate;
-
-        if (!avctx->channel_layout)
-            avctx->channel_layout = av_get_default_channel_layout(avctx->channels);
-        if (!avctx->channel_layout) {
-            fprintf(stderr, "unable to guess channel layout\n");
-            return -1;
-        }
-        if (avctx->channels == 1)
-            is->sdl_channel_layout = AV_CH_LAYOUT_MONO;
-        else
-            is->sdl_channel_layout = AV_CH_LAYOUT_STEREO;
-        is->sdl_channels = av_get_channel_layout_nb_channels(is->sdl_channel_layout);
-
-        wanted_spec.format = AUDIO_S16SYS;
-        wanted_spec.freq = is->sdl_sample_rate;
-        wanted_spec.channels = is->sdl_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->sdl_sample_fmt          = AV_SAMPLE_FMT_S16;
-        is->resample_sample_fmt     = is->sdl_sample_fmt;
-        is->resample_channel_layout = avctx->channel_layout;
-        is->resample_sample_rate    = avctx->sample_rate;
-    }
-
-    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];
-
-        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);
-        av_free_packet(&is->audio_pkt);
-        if (is->avr)
-            avresample_free(&is->avr);
-        av_freep(&is->audio_buf1);
-        is->audio_buf = NULL;
-        av_frame_free(&is->frame);
-
-        if (is->rdft) {
-            av_rdft_end(is->rdft);
-            av_freep(&is->rdft_data);
-            is->rdft = NULL;
-            is->rdft_bits = 0;
-        }
-        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 *ctx)
-{
-    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 = NULL;
-    int err, i, ret;
-    int st_index[AVMEDIA_TYPE_NB];
-    AVPacket pkt1, *pkt = &pkt1;
-    int eof = 0;
-    int pkt_in_play_range = 0;
-    AVDictionaryEntry *t;
-    AVDictionary **opts;
-    int orig_nb_streams;
-
-    memset(st_index, -1, sizeof(st_index));
-    is->video_stream = -1;
-    is->audio_stream = -1;
-    is->subtitle_stream = -1;
-
-    global_video_state = is;
-
-    ic = avformat_alloc_context();
-    ic->interrupt_callback.callback = decode_interrupt_cb;
-    err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts);
-    if (err < 0) {
-        print_error(is->filename, err);
-        ret = -1;
-        goto fail;
-    }
-    if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
-        av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
-        ret = AVERROR_OPTION_NOT_FOUND;
-        goto fail;
-    }
-    is->ic = ic;
-
-    if (genpts)
-        ic->flags |= AVFMT_FLAG_GENPTS;
-
-    opts = setup_find_stream_info_opts(ic, codec_opts);
-    orig_nb_streams = ic->nb_streams;
-
-    err = avformat_find_stream_info(ic, opts);
-    if (err < 0) {
-        fprintf(stderr, "%s: could not find codec parameters\n", is->filename);
-        ret = -1;
-        goto fail;
-    }
-    for (i = 0; i < orig_nb_streams; i++)
-        av_dict_free(&opts[i]);
-    av_freep(&opts);
-
-    if (ic->pb)
-        ic->pb->eof_reached = 0; // FIXME hack, avplay 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++)
-        ic->streams[i]->discard = AVDISCARD_ALL;
-    if (!video_disable)
-        st_index[AVMEDIA_TYPE_VIDEO] =
-            av_find_best_stream(ic, AVMEDIA_TYPE_VIDEO,
-                                wanted_stream[AVMEDIA_TYPE_VIDEO], -1, NULL, 0);
-    if (!audio_disable)
-        st_index[AVMEDIA_TYPE_AUDIO] =
-            av_find_best_stream(ic, AVMEDIA_TYPE_AUDIO,
-                                wanted_stream[AVMEDIA_TYPE_AUDIO],
-                                st_index[AVMEDIA_TYPE_VIDEO],
-                                NULL, 0);
-    if (!video_disable)
-        st_index[AVMEDIA_TYPE_SUBTITLE] =
-            av_find_best_stream(ic, AVMEDIA_TYPE_SUBTITLE,
-                                wanted_stream[AVMEDIA_TYPE_SUBTITLE],
-                                (st_index[AVMEDIA_TYPE_AUDIO] >= 0 ?
-                                 st_index[AVMEDIA_TYPE_AUDIO] :
-                                 st_index[AVMEDIA_TYPE_VIDEO]),
-                                NULL, 0);
-    if (show_status) {
-        av_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 (!infinite_buffer &&
-              (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 (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);
-            }
-            if (is->audio_stream >= 0 &&
-                is->audio_st->codec->codec->capabilities & CODEC_CAP_DELAY) {
-                av_init_packet(pkt);
-                pkt->data = NULL;
-                pkt->size = 0;
-                pkt->stream_index = is->audio_stream;
-                packet_queue_put(&is->audioq, 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 || (ic->pb && ic->pb->eof_reached))
-                eof = 1;
-            if (ic->pb && ic->pb->error)
-                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) {
-        avformat_close_input(&is->ic);
-    }
-
-    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_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)
-{
-#if defined(__APPLE__) && SDL_VERSION_ATLEAST(1, 2, 14)
-    /* OS X needs to empty the picture_queue */
-    int i;
-    for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++)
-        cur_stream->pictq[i].reallocate = 1;
-#endif
-    is_full_screen = !is_full_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 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);
-    }
-}
-
-static void seek_chapter(VideoState *is, int incr)
-{
-    int64_t pos = get_master_clock(is) * AV_TIME_BASE;
-    int i;
-
-    if (!is->ic->nb_chapters)
-        return;
-
-    /* find the current chapter */
-    for (i = 0; i < is->ic->nb_chapters; i++) {
-        AVChapter *ch = is->ic->chapters[i];
-        if (av_compare_ts(pos, AV_TIME_BASE_Q, ch->start, ch->time_base) < 0) {
-            i--;
-            break;
-        }
-    }
-
-    i += incr;
-    i = FFMAX(i, 0);
-    if (i >= is->ic->nb_chapters)
-        return;
-
-    av_log(NULL, AV_LOG_VERBOSE, "Seeking to chapter %d.\n", i);
-    stream_seek(is, av_rescale_q(is->ic->chapters[i]->start, is->ic->chapters[i]->time_base,
-                                 AV_TIME_BASE_Q), 0, 0);
-}
-
-/* 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:
-            if (exit_on_keydown) {
-                do_exit();
-                break;
-            }
-            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_PAGEUP:
-                seek_chapter(cur_stream, 1);
-                break;
-            case SDLK_PAGEDOWN:
-                seek_chapter(cur_stream, -1);
-                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 = avio_tell(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:
-            if (exit_on_mousedown) {
-                do_exit();
-                break;
-            }
-        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 =  avio_size(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 int opt_frame_size(void *optctx, const char *opt, const char *arg)
-{
-    av_log(NULL, AV_LOG_ERROR,
-           "Option '%s' has been removed, use private format options instead\n", opt);
-    return AVERROR(EINVAL);
-}
-
-static int opt_width(void *optctx, 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(void *optctx, const char *opt, const char *arg)
-{
-    screen_height = parse_number_or_die(opt, arg, OPT_INT64, 1, INT_MAX);
-    return 0;
-}
-
-static int opt_format(void *optctx, const char *opt, const char *arg)
-{
-    file_iformat = av_find_input_format(arg);
-    if (!file_iformat) {
-        fprintf(stderr, "Unknown input format: %s\n", arg);
-        return AVERROR(EINVAL);
-    }
-    return 0;
-}
-
-static int opt_frame_pix_fmt(void *optctx, const char *opt, const char *arg)
-{
-    av_log(NULL, AV_LOG_ERROR,
-           "Option '%s' has been removed, use private format options instead\n", opt);
-    return AVERROR(EINVAL);
-}
-
-static int opt_sync(void *optctx, 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(void *optctx, const char *opt, const char *arg)
-{
-    start_time = parse_time_or_die(opt, arg, 1);
-    return 0;
-}
-
-static int opt_duration(void *optctx, const char *opt, const char *arg)
-{
-    duration = parse_time_or_die(opt, arg, 1);
-    return 0;
-}
-
-static const OptionDef options[] = {
-#include "cmdutils_common_opts.h"
-    { "x", HAS_ARG, { .func_arg = opt_width }, "force displayed width", "width" },
-    { "y", HAS_ARG, { .func_arg = opt_height }, "force displayed height", "height" },
-    { "s", HAS_ARG | OPT_VIDEO, { .func_arg = opt_frame_size }, "set frame size (WxH or abbreviation)", "size" },
-    { "fs", OPT_BOOL, { &is_full_screen }, "force full screen" },
-    { "an", OPT_BOOL, { &audio_disable }, "disable audio" },
-    { "vn", OPT_BOOL, { &video_disable }, "disable video" },
-    { "ast", OPT_INT | HAS_ARG | OPT_EXPERT, { &wanted_stream[AVMEDIA_TYPE_AUDIO] }, "select desired audio stream", "stream_number" },
-    { "vst", OPT_INT | HAS_ARG | OPT_EXPERT, { &wanted_stream[AVMEDIA_TYPE_VIDEO] }, "select desired video stream", "stream_number" },
-    { "sst", OPT_INT | HAS_ARG | OPT_EXPERT, { &wanted_stream[AVMEDIA_TYPE_SUBTITLE] }, "select desired subtitle stream", "stream_number" },
-    { "ss", HAS_ARG, { .func_arg = opt_seek }, "seek to a given position in seconds", "pos" },
-    { "t", HAS_ARG, { .func_arg = opt_duration }, "play  \"duration\" seconds of audio/video", "duration" },
-    { "bytes", OPT_INT | HAS_ARG, { &seek_by_bytes }, "seek by bytes 0=off 1=on -1=auto", "val" },
-    { "nodisp", OPT_BOOL, { &display_disable }, "disable graphical display" },
-    { "f", HAS_ARG, { .func_arg = opt_format }, "force format", "fmt" },
-    { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, { .func_arg = opt_frame_pix_fmt }, "set pixel format", "format" },
-    { "stats", OPT_BOOL | OPT_EXPERT, { &show_status }, "show status", "" },
-    { "bug", OPT_INT | HAS_ARG | OPT_EXPERT, { &workaround_bugs }, "workaround bugs", "" },
-    { "fast", OPT_BOOL | OPT_EXPERT, { &fast }, "non spec compliant optimizations", "" },
-    { "genpts", OPT_BOOL | OPT_EXPERT, { &genpts }, "generate pts", "" },
-    { "drp", OPT_INT | HAS_ARG | OPT_EXPERT, { &decoder_reorder_pts }, "let decoder reorder pts 0=off 1=on -1=auto", ""},
-    { "skiploop", OPT_INT | HAS_ARG | OPT_EXPERT, { &skip_loop_filter }, "", "" },
-    { "skipframe", OPT_INT | HAS_ARG | OPT_EXPERT, { &skip_frame }, "", "" },
-    { "skipidct", OPT_INT | HAS_ARG | OPT_EXPERT, { &skip_idct }, "", "" },
-    { "idct", OPT_INT | HAS_ARG | OPT_EXPERT, { &idct }, "set idct algo",  "algo" },
-    { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, { &error_concealment }, "set error concealment options",  "bit_mask" },
-    { "sync", HAS_ARG | OPT_EXPERT, { .func_arg = opt_sync }, "set audio-video sync. type (type=audio/video/ext)", "type" },
-    { "autoexit", OPT_BOOL | OPT_EXPERT, { &autoexit }, "exit at the end", "" },
-    { "exitonkeydown", OPT_BOOL | OPT_EXPERT, { &exit_on_keydown }, "exit on key down", "" },
-    { "exitonmousedown", OPT_BOOL | OPT_EXPERT, { &exit_on_mousedown }, "exit on mouse down", "" },
-    { "loop", OPT_INT | HAS_ARG | OPT_EXPERT, { &loop }, "set number of times the playback shall be looped", "loop count" },
-    { "framedrop", OPT_BOOL | OPT_EXPERT, { &framedrop }, "drop frames when cpu is too slow", "" },
-    { "infbuf", OPT_BOOL | OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" },
-    { "window_title", OPT_STRING | HAS_ARG, { &window_title }, "set window title", "window title" },
-#if CONFIG_AVFILTER
-    { "vf", OPT_STRING | HAS_ARG, { &vfilters }, "video filters", "filter list" },
-#endif
-    { "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, { &rdftspeed }, "rdft speed", "msecs" },
-    { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, { opt_default }, "generic catch all option", "" },
-    { "i", 0, { NULL }, "avconv compatibility dummy option", ""},
-    { NULL, },
-};
-
-static void show_usage(void)
-{
-    printf("Simple media player\n");
-    printf("usage: %s [options] input_file\n", program_name);
-    printf("\n");
-}
-
-void show_help_default(const char *opt, const char *arg)
-{
-    av_log_set_callback(log_callback_help);
-    show_usage();
-    show_help_options(options, "Main options:", 0, OPT_EXPERT, 0);
-    show_help_options(options, "Advanced options:", OPT_EXPERT, 0, 0);
-    printf("\n");
-    show_help_children(avcodec_get_class(), AV_OPT_FLAG_DECODING_PARAM);
-    show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
-#if !CONFIG_AVFILTER
-    show_help_children(sws_get_class(), AV_OPT_FLAG_ENCODING_PARAM);
-#endif
-    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(void *optctx, 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;
-
-    av_log_set_flags(AV_LOG_SKIP_REPEATED);
-    parse_loglevel(argc, argv, options);
-
-    /* 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();
-    avformat_network_init();
-
-    init_opts();
-
-    show_banner();
-
-    parse_options(NULL, 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 %s'\n", program_name);
-        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) {
-        const SDL_VideoInfo *vi = SDL_GetVideoInfo();
-        fs_screen_width = vi->current_w;
-        fs_screen_height = vi->current_h;
-    }
-
-    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 = (uint8_t *)&flush_pkt;
-
-    cur_stream = stream_open(input_filename, file_iformat);
-
-    event_loop();
-
-    /* never returns */
-
-    return 0;
-}
diff --git a/deps/libav/avprobe.c b/deps/libav/avprobe.c
deleted file mode 100644
index c7b3d39..0000000
--- a/deps/libav/avprobe.c
+++ /dev/null
@@ -1,969 +0,0 @@
-/*
- * avprobe : Simple Media Prober based on the Libav libraries
- * Copyright (c) 2007-2010 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; 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 "libavutil/avstring.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/dict.h"
-#include "libavutil/libm.h"
-#include "libavdevice/avdevice.h"
-#include "cmdutils.h"
-
-const char program_name[] = "avprobe";
-const int program_birth_year = 2007;
-
-static int do_show_format  = 0;
-static AVDictionary *fmt_entries_to_show = NULL;
-static int nb_fmt_entries_to_show;
-static int do_show_packets = 0;
-static int do_show_streams = 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;
-
-/* AVprobe context */
-static const char *input_filename;
-static AVInputFormat *iformat = NULL;
-
-static const char *const binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" };
-static const char *const 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 void avprobe_cleanup(int ret)
-{
-    av_dict_free(&fmt_entries_to_show);
-}
-
-/*
- * The output is structured in array and objects that might contain items
- * Array could require the objects within to not be named.
- * Object could require the items within to be named.
- *
- * For flat representation the name of each section is saved on prefix so it
- * can be rendered in order to represent nested structures (e.g. array of
- * objects for the packets list).
- *
- * Within an array each element can need an unique identifier or an index.
- *
- * Nesting level is accounted separately.
- */
-
-typedef enum {
-    ARRAY,
-    OBJECT
-} PrintElementType;
-
-typedef struct {
-    const char *name;
-    PrintElementType type;
-    int64_t index;
-    int64_t nb_elems;
-} PrintElement;
-
-typedef struct {
-    PrintElement *prefix;
-    int level;
-    void (*print_header)(void);
-    void (*print_footer)(void);
-
-    void (*print_array_header) (const char *name);
-    void (*print_array_footer) (const char *name);
-    void (*print_object_header)(const char *name);
-    void (*print_object_footer)(const char *name);
-
-    void (*print_integer) (const char *key, int64_t value);
-    void (*print_string)  (const char *key, const char *value);
-} PrintContext;
-
-static AVIOContext *probe_out = NULL;
-static PrintContext octx;
-#define AVP_INDENT() avio_printf(probe_out, "%*c", octx.level * 2, ' ')
-
-/*
- * Default format, INI
- *
- * - all key and values are utf8
- * - '.' is the subgroup separator
- * - newlines and the following characters are escaped
- * - '\' is the escape character
- * - '#' is the comment
- * - '=' is the key/value separators
- * - ':' is not used but usually parsed as key/value separator
- */
-
-static void ini_print_header(void)
-{
-    avio_printf(probe_out, "# avprobe output\n\n");
-}
-static void ini_print_footer(void)
-{
-    avio_w8(probe_out, '\n');
-}
-
-static void ini_escape_print(const char *s)
-{
-    int i = 0;
-    char c = 0;
-
-    while (c = s[i++]) {
-        switch (c) {
-        case '\r': avio_printf(probe_out, "%s", "\\r"); break;
-        case '\n': avio_printf(probe_out, "%s", "\\n"); break;
-        case '\f': avio_printf(probe_out, "%s", "\\f"); break;
-        case '\b': avio_printf(probe_out, "%s", "\\b"); break;
-        case '\t': avio_printf(probe_out, "%s", "\\t"); break;
-        case '\\':
-        case '#' :
-        case '=' :
-        case ':' : avio_w8(probe_out, '\\');
-        default:
-            if ((unsigned char)c < 32)
-                avio_printf(probe_out, "\\x00%02x", c & 0xff);
-            else
-                avio_w8(probe_out, c);
-        break;
-        }
-    }
-}
-
-static void ini_print_array_header(const char *name)
-{
-    if (octx.prefix[octx.level -1].nb_elems)
-        avio_printf(probe_out, "\n");
-}
-
-static void ini_print_object_header(const char *name)
-{
-    int i;
-    PrintElement *el = octx.prefix + octx.level -1;
-
-    if (el->nb_elems)
-        avio_printf(probe_out, "\n");
-
-    avio_printf(probe_out, "[");
-
-    for (i = 1; i < octx.level; i++) {
-        el = octx.prefix + i;
-        avio_printf(probe_out, "%s.", el->name);
-        if (el->index >= 0)
-            avio_printf(probe_out, "%"PRId64".", el->index);
-    }
-
-    avio_printf(probe_out, "%s", name);
-    if (el && el->type == ARRAY)
-        avio_printf(probe_out, ".%"PRId64"", el->nb_elems);
-    avio_printf(probe_out, "]\n");
-}
-
-static void ini_print_integer(const char *key, int64_t value)
-{
-    ini_escape_print(key);
-    avio_printf(probe_out, "=%"PRId64"\n", value);
-}
-
-
-static void ini_print_string(const char *key, const char *value)
-{
-    ini_escape_print(key);
-    avio_printf(probe_out, "=");
-    ini_escape_print(value);
-    avio_w8(probe_out, '\n');
-}
-
-/*
- * Alternate format, JSON
- */
-
-static void json_print_header(void)
-{
-    avio_printf(probe_out, "{");
-}
-static void json_print_footer(void)
-{
-    avio_printf(probe_out, "}\n");
-}
-
-static void json_print_array_header(const char *name)
-{
-    if (octx.prefix[octx.level -1].nb_elems)
-        avio_printf(probe_out, ",\n");
-    AVP_INDENT();
-    avio_printf(probe_out, "\"%s\" : ", name);
-    avio_printf(probe_out, "[\n");
-}
-
-static void json_print_array_footer(const char *name)
-{
-    avio_printf(probe_out, "\n");
-    AVP_INDENT();
-    avio_printf(probe_out, "]");
-}
-
-static void json_print_object_header(const char *name)
-{
-    if (octx.prefix[octx.level -1].nb_elems)
-        avio_printf(probe_out, ",\n");
-    AVP_INDENT();
-    if (octx.prefix[octx.level -1].type == OBJECT)
-        avio_printf(probe_out, "\"%s\" : ", name);
-    avio_printf(probe_out, "{\n");
-}
-
-static void json_print_object_footer(const char *name)
-{
-    avio_printf(probe_out, "\n");
-    AVP_INDENT();
-    avio_printf(probe_out, "}");
-}
-
-static void json_print_integer(const char *key, int64_t value)
-{
-    if (octx.prefix[octx.level -1].nb_elems)
-        avio_printf(probe_out, ",\n");
-    AVP_INDENT();
-    avio_printf(probe_out, "\"%s\" : %"PRId64"", key, value);
-}
-
-static void json_escape_print(const char *s)
-{
-    int i = 0;
-    char c = 0;
-
-    while (c = s[i++]) {
-        switch (c) {
-        case '\r': avio_printf(probe_out, "%s", "\\r"); break;
-        case '\n': avio_printf(probe_out, "%s", "\\n"); break;
-        case '\f': avio_printf(probe_out, "%s", "\\f"); break;
-        case '\b': avio_printf(probe_out, "%s", "\\b"); break;
-        case '\t': avio_printf(probe_out, "%s", "\\t"); break;
-        case '\\':
-        case '"' : avio_w8(probe_out, '\\');
-        default:
-            if ((unsigned char)c < 32)
-                avio_printf(probe_out, "\\u00%02x", c & 0xff);
-            else
-                avio_w8(probe_out, c);
-        break;
-        }
-    }
-}
-
-static void json_print_string(const char *key, const char *value)
-{
-    if (octx.prefix[octx.level -1].nb_elems)
-        avio_printf(probe_out, ",\n");
-    AVP_INDENT();
-    avio_w8(probe_out, '\"');
-    json_escape_print(key);
-    avio_printf(probe_out, "\" : \"");
-    json_escape_print(value);
-    avio_w8(probe_out, '\"');
-}
-
-/*
- * old-style pseudo-INI
- */
-static void old_print_object_header(const char *name)
-{
-    char *str, *p;
-
-    if (!strcmp(name, "tags"))
-        return;
-
-    str = p = av_strdup(name);
-    while (*p) {
-        *p = av_toupper(*p);
-        p++;
-    }
-
-    avio_printf(probe_out, "[%s]\n", str);
-    av_freep(&str);
-}
-
-static void old_print_object_footer(const char *name)
-{
-    char *str, *p;
-
-    if (!strcmp(name, "tags"))
-        return;
-
-    str = p = av_strdup(name);
-    while (*p) {
-        *p = av_toupper(*p);
-        p++;
-    }
-
-    avio_printf(probe_out, "[/%s]\n", str);
-    av_freep(&str);
-}
-
-static void old_print_string(const char *key, const char *value)
-{
-    if (!strcmp(octx.prefix[octx.level - 1].name, "tags"))
-        avio_printf(probe_out, "TAG:");
-    ini_print_string(key, value);
-}
-
-/*
- * Simple Formatter for single entries.
- */
-
-static void show_format_entry_integer(const char *key, int64_t value)
-{
-    if (key && av_dict_get(fmt_entries_to_show, key, NULL, 0)) {
-        if (nb_fmt_entries_to_show > 1)
-            avio_printf(probe_out, "%s=", key);
-        avio_printf(probe_out, "%"PRId64"\n", value);
-    }
-}
-
-static void show_format_entry_string(const char *key, const char *value)
-{
-    if (key && av_dict_get(fmt_entries_to_show, key, NULL, 0)) {
-        if (nb_fmt_entries_to_show > 1)
-            avio_printf(probe_out, "%s=", key);
-        avio_printf(probe_out, "%s\n", value);
-    }
-}
-
-static void probe_group_enter(const char *name, int type)
-{
-    int64_t count = -1;
-
-    octx.prefix =
-        av_realloc(octx.prefix, sizeof(PrintElement) * (octx.level + 1));
-
-    if (!octx.prefix || !name) {
-        fprintf(stderr, "Out of memory\n");
-        exit_program(1);
-    }
-
-    if (octx.level) {
-        PrintElement *parent = octx.prefix + octx.level -1;
-        if (parent->type == ARRAY)
-            count = parent->nb_elems;
-        parent->nb_elems++;
-    }
-
-    octx.prefix[octx.level++] = (PrintElement){name, type, count, 0};
-}
-
-static void probe_group_leave(void)
-{
-    --octx.level;
-}
-
-static void probe_header(void)
-{
-    if (octx.print_header)
-        octx.print_header();
-    probe_group_enter("root", OBJECT);
-}
-
-static void probe_footer(void)
-{
-    if (octx.print_footer)
-        octx.print_footer();
-    probe_group_leave();
-}
-
-
-static void probe_array_header(const char *name)
-{
-    if (octx.print_array_header)
-        octx.print_array_header(name);
-
-    probe_group_enter(name, ARRAY);
-}
-
-static void probe_array_footer(const char *name)
-{
-    probe_group_leave();
-    if (octx.print_array_footer)
-        octx.print_array_footer(name);
-}
-
-static void probe_object_header(const char *name)
-{
-    if (octx.print_object_header)
-        octx.print_object_header(name);
-
-    probe_group_enter(name, OBJECT);
-}
-
-static void probe_object_footer(const char *name)
-{
-    probe_group_leave();
-    if (octx.print_object_footer)
-        octx.print_object_footer(name);
-}
-
-static void probe_int(const char *key, int64_t value)
-{
-    octx.print_integer(key, value);
-    octx.prefix[octx.level -1].nb_elems++;
-}
-
-static void probe_str(const char *key, const char *value)
-{
-    octx.print_string(key, value);
-    octx.prefix[octx.level -1].nb_elems++;
-}
-
-static void probe_dict(AVDictionary *dict, const char *name)
-{
-    AVDictionaryEntry *entry = NULL;
-    if (!dict)
-        return;
-    probe_object_header(name);
-    while ((entry = av_dict_get(dict, "", entry, AV_DICT_IGNORE_SUFFIX))) {
-        probe_str(entry->key, entry->value);
-    }
-    probe_object_footer(name);
-}
-
-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) log2(val) / 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, "%.*f%s%s",
-                 index ? 3 : 0, 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 char *ts_value_string(char *buf, int buf_size, int64_t ts)
-{
-    if (ts == AV_NOPTS_VALUE) {
-        snprintf(buf, buf_size, "N/A");
-    } else {
-        snprintf(buf, buf_size, "%"PRId64, ts);
-    }
-
-    return buf;
-}
-
-static char *rational_string(char *buf, int buf_size, const char *sep,
-                             const AVRational *rat)
-{
-    snprintf(buf, buf_size, "%d%s%d", rat->num, sep, rat->den);
-    return buf;
-}
-
-static char *tag_string(char *buf, int buf_size, int tag)
-{
-    snprintf(buf, buf_size, "0x%04x", tag);
-    return buf;
-}
-
-static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt)
-{
-    char val_str[128];
-    AVStream *st = fmt_ctx->streams[pkt->stream_index];
-
-    probe_object_header("packet");
-    probe_str("codec_type", media_type_string(st->codec->codec_type));
-    probe_int("stream_index", pkt->stream_index);
-    probe_str("pts", ts_value_string(val_str, sizeof(val_str), pkt->pts));
-    probe_str("pts_time", time_value_string(val_str, sizeof(val_str),
-                                               pkt->pts, &st->time_base));
-    probe_str("dts", ts_value_string(val_str, sizeof(val_str), pkt->dts));
-    probe_str("dts_time", time_value_string(val_str, sizeof(val_str),
-                                               pkt->dts, &st->time_base));
-    probe_str("duration", ts_value_string(val_str, sizeof(val_str),
-                                             pkt->duration));
-    probe_str("duration_time", time_value_string(val_str, sizeof(val_str),
-                                                    pkt->duration,
-                                                    &st->time_base));
-    probe_str("size", value_string(val_str, sizeof(val_str),
-                                      pkt->size, unit_byte_str));
-    probe_int("pos", pkt->pos);
-    probe_str("flags", pkt->flags & AV_PKT_FLAG_KEY ? "K" : "_");
-    probe_object_footer("packet");
-}
-
-static void show_packets(AVFormatContext *fmt_ctx)
-{
-    AVPacket pkt;
-
-    av_init_packet(&pkt);
-    probe_array_header("packets");
-    while (!av_read_frame(fmt_ctx, &pkt))
-        show_packet(fmt_ctx, &pkt);
-    probe_array_footer("packets");
-}
-
-static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
-{
-    AVStream *stream = fmt_ctx->streams[stream_idx];
-    AVCodecContext *dec_ctx;
-    const AVCodec *dec;
-    const char *profile;
-    char val_str[128];
-    AVRational display_aspect_ratio, *sar = NULL;
-    const AVPixFmtDescriptor *desc;
-
-    probe_object_header("stream");
-
-    probe_int("index", stream->index);
-
-    if ((dec_ctx = stream->codec)) {
-        if ((dec = dec_ctx->codec)) {
-            probe_str("codec_name", dec->name);
-            probe_str("codec_long_name", dec->long_name);
-        } else {
-            probe_str("codec_name", "unknown");
-        }
-
-        probe_str("codec_type", media_type_string(dec_ctx->codec_type));
-        probe_str("codec_time_base",
-                  rational_string(val_str, sizeof(val_str),
-                                  "/", &dec_ctx->time_base));
-
-        /* print AVI/FourCC tag */
-        av_get_codec_tag_string(val_str, sizeof(val_str), dec_ctx->codec_tag);
-        probe_str("codec_tag_string", val_str);
-        probe_str("codec_tag", tag_string(val_str, sizeof(val_str),
-                                          dec_ctx->codec_tag));
-
-        /* print profile, if there is one */
-        if (dec && (profile = av_get_profile_name(dec, dec_ctx->profile)))
-            probe_str("profile", profile);
-
-        switch (dec_ctx->codec_type) {
-        case AVMEDIA_TYPE_VIDEO:
-            probe_int("width", dec_ctx->width);
-            probe_int("height", dec_ctx->height);
-            probe_int("has_b_frames", dec_ctx->has_b_frames);
-            if (dec_ctx->sample_aspect_ratio.num)
-                sar = &dec_ctx->sample_aspect_ratio;
-            else if (stream->sample_aspect_ratio.num)
-                sar = &stream->sample_aspect_ratio;
-
-            if (sar) {
-                probe_str("sample_aspect_ratio",
-                          rational_string(val_str, sizeof(val_str), ":", sar));
-                av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
-                          dec_ctx->width  * sar->num, dec_ctx->height * sar->den,
-                          1024*1024);
-                probe_str("display_aspect_ratio",
-                          rational_string(val_str, sizeof(val_str), ":",
-                          &display_aspect_ratio));
-            }
-            desc = av_pix_fmt_desc_get(dec_ctx->pix_fmt);
-            probe_str("pix_fmt", desc ? desc->name : "unknown");
-            probe_int("level", dec_ctx->level);
-            break;
-
-        case AVMEDIA_TYPE_AUDIO:
-            probe_str("sample_rate",
-                      value_string(val_str, sizeof(val_str),
-                                   dec_ctx->sample_rate,
-                                   unit_hertz_str));
-            probe_int("channels", dec_ctx->channels);
-            probe_int("bits_per_sample",
-                      av_get_bits_per_sample(dec_ctx->codec_id));
-            break;
-        }
-    } else {
-        probe_str("codec_type", "unknown");
-    }
-
-    if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS)
-        probe_int("id", stream->id);
-    probe_str("avg_frame_rate",
-              rational_string(val_str, sizeof(val_str), "/",
-              &stream->avg_frame_rate));
-    if (dec_ctx->bit_rate)
-        probe_str("bit_rate",
-                  value_string(val_str, sizeof(val_str),
-                               dec_ctx->bit_rate, unit_bit_per_second_str));
-    probe_str("time_base",
-              rational_string(val_str, sizeof(val_str), "/",
-              &stream->time_base));
-    probe_str("start_time",
-              time_value_string(val_str, sizeof(val_str),
-                                stream->start_time, &stream->time_base));
-    probe_str("duration",
-              time_value_string(val_str, sizeof(val_str),
-                                stream->duration, &stream->time_base));
-    if (stream->nb_frames)
-        probe_int("nb_frames", stream->nb_frames);
-
-    probe_dict(stream->metadata, "tags");
-
-    probe_object_footer("stream");
-}
-
-static void show_format(AVFormatContext *fmt_ctx)
-{
-    char val_str[128];
-    int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1;
-
-    probe_object_header("format");
-    probe_str("filename",         fmt_ctx->filename);
-    probe_int("nb_streams",       fmt_ctx->nb_streams);
-    probe_str("format_name",      fmt_ctx->iformat->name);
-    probe_str("format_long_name", fmt_ctx->iformat->long_name);
-    probe_str("start_time",
-                       time_value_string(val_str, sizeof(val_str),
-                                         fmt_ctx->start_time, &AV_TIME_BASE_Q));
-    probe_str("duration",
-                       time_value_string(val_str, sizeof(val_str),
-                                         fmt_ctx->duration, &AV_TIME_BASE_Q));
-    probe_str("size",
-                       size >= 0 ? value_string(val_str, sizeof(val_str),
-                                                size, unit_byte_str)
-                                  : "unknown");
-    probe_str("bit_rate",
-                       value_string(val_str, sizeof(val_str),
-                                    fmt_ctx->bit_rate, unit_bit_per_second_str));
-
-    probe_dict(fmt_ctx->metadata, "tags");
-
-    probe_object_footer("format");
-}
-
-static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
-{
-    int err, i;
-    AVFormatContext *fmt_ctx = NULL;
-    AVDictionaryEntry *t;
-
-    if ((err = avformat_open_input(&fmt_ctx, filename,
-                                   iformat, &format_opts)) < 0) {
-        print_error(filename, err);
-        return err;
-    }
-    if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
-        av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
-        return AVERROR_OPTION_NOT_FOUND;
-    }
-
-
-    /* fill the streams in the format context */
-    if ((err = avformat_find_stream_info(fmt_ctx, NULL)) < 0) {
-        print_error(filename, err);
-        return err;
-    }
-
-    av_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 (stream->codec->codec_id == AV_CODEC_ID_PROBE) {
-            fprintf(stderr, "Failed to probe codec for input stream %d\n",
-                    stream->index);
-        } else if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
-            fprintf(stderr,
-                    "Unsupported codec with id %d for input stream %d\n",
-                    stream->codec->codec_id, stream->index);
-        } else if (avcodec_open2(stream->codec, codec, NULL) < 0) {
-            fprintf(stderr, "Error while opening codec for input stream %d\n",
-                    stream->index);
-        }
-    }
-
-    *fmt_ctx_ptr = fmt_ctx;
-    return 0;
-}
-
-static void close_input_file(AVFormatContext **ctx_ptr)
-{
-    int i;
-    AVFormatContext *fmt_ctx = *ctx_ptr;
-
-    /* close decoder for each stream */
-    for (i = 0; i < fmt_ctx->nb_streams; i++) {
-        AVStream *stream = fmt_ctx->streams[i];
-
-        avcodec_close(stream->codec);
-    }
-    avformat_close_input(ctx_ptr);
-}
-
-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_format)
-        show_format(fmt_ctx);
-
-    if (do_show_streams) {
-        probe_array_header("streams");
-        for (i = 0; i < fmt_ctx->nb_streams; i++)
-            show_stream(fmt_ctx, i);
-        probe_array_footer("streams");
-    }
-
-    if (do_show_packets)
-        show_packets(fmt_ctx);
-
-    close_input_file(&fmt_ctx);
-    return 0;
-}
-
-static void show_usage(void)
-{
-    printf("Simple multimedia streams analyzer\n");
-    printf("usage: %s [OPTIONS] [INPUT_FILE]\n", program_name);
-    printf("\n");
-}
-
-static int opt_format(void *optctx, const char *opt, const char *arg)
-{
-    iformat = av_find_input_format(arg);
-    if (!iformat) {
-        fprintf(stderr, "Unknown input format: %s\n", arg);
-        return AVERROR(EINVAL);
-    }
-    return 0;
-}
-
-static int opt_output_format(void *optctx, const char *opt, const char *arg)
-{
-
-    if (!strcmp(arg, "json")) {
-        octx.print_header        = json_print_header;
-        octx.print_footer        = json_print_footer;
-        octx.print_array_header  = json_print_array_header;
-        octx.print_array_footer  = json_print_array_footer;
-        octx.print_object_header = json_print_object_header;
-        octx.print_object_footer = json_print_object_footer;
-
-        octx.print_integer = json_print_integer;
-        octx.print_string  = json_print_string;
-    } else if (!strcmp(arg, "ini")) {
-        octx.print_header        = ini_print_header;
-        octx.print_footer        = ini_print_footer;
-        octx.print_array_header  = ini_print_array_header;
-        octx.print_object_header = ini_print_object_header;
-
-        octx.print_integer = ini_print_integer;
-        octx.print_string  = ini_print_string;
-    } else if (!strcmp(arg, "old")) {
-        octx.print_header        = NULL;
-        octx.print_object_header = old_print_object_header;
-        octx.print_object_footer = old_print_object_footer;
-
-        octx.print_string        = old_print_string;
-    } else {
-        av_log(NULL, AV_LOG_ERROR, "Unsupported formatter %s\n", arg);
-        return AVERROR(EINVAL);
-    }
-    return 0;
-}
-
-static int opt_show_format_entry(void *optctx, const char *opt, const char *arg)
-{
-    do_show_format = 1;
-    nb_fmt_entries_to_show++;
-    octx.print_header        = NULL;
-    octx.print_footer        = NULL;
-    octx.print_array_header  = NULL;
-    octx.print_array_footer  = NULL;
-    octx.print_object_header = NULL;
-    octx.print_object_footer = NULL;
-
-    octx.print_integer = show_format_entry_integer;
-    octx.print_string  = show_format_entry_string;
-    av_dict_set(&fmt_entries_to_show, arg, "", 0);
-    return 0;
-}
-
-static void opt_input_file(void *optctx, const char *arg)
-{
-    if (input_filename) {
-        fprintf(stderr,
-                "Argument '%s' provided as input filename, but '%s' was already specified.\n",
-                arg, input_filename);
-        exit_program(1);
-    }
-    if (!strcmp(arg, "-"))
-        arg = "pipe:";
-    input_filename = arg;
-}
-
-void show_help_default(const char *opt, const char *arg)
-{
-    av_log_set_callback(log_callback_help);
-    show_usage();
-    show_help_options(options, "Main options:", 0, 0, 0);
-    printf("\n");
-    show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
-}
-
-static int opt_pretty(void *optctx, const char *opt, const char *arg)
-{
-    show_value_unit              = 1;
-    use_value_prefix             = 1;
-    use_byte_value_binary_prefix = 1;
-    use_value_sexagesimal_format = 1;
-    return 0;
-}
-
-static const OptionDef real_options[] = {
-#include "cmdutils_common_opts.h"
-    { "f", HAS_ARG, {.func_arg = opt_format}, "force format", "format" },
-    { "of", HAS_ARG, {.func_arg = opt_output_format}, "output the document either as ini or json", "output_format" },
-    { "unit", OPT_BOOL, {&show_value_unit},
-      "show unit of the displayed values" },
-    { "prefix", OPT_BOOL, {&use_value_prefix},
-      "use SI prefixes for the displayed values" },
-    { "byte_binary_prefix", OPT_BOOL, {&use_byte_value_binary_prefix},
-      "use binary prefixes for byte units" },
-    { "sexagesimal", OPT_BOOL,  {&use_value_sexagesimal_format},
-      "use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
-    { "pretty", 0, {.func_arg = opt_pretty},
-      "prettify the format of displayed values, make it more human readable" },
-    { "show_format",  OPT_BOOL, {&do_show_format} , "show format/container info" },
-    { "show_format_entry", HAS_ARG, {.func_arg = opt_show_format_entry},
-      "show a particular entry from the format/container info", "entry" },
-    { "show_packets", OPT_BOOL, {&do_show_packets}, "show packets info" },
-    { "show_streams", OPT_BOOL, {&do_show_streams}, "show streams info" },
-    { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {.func_arg = opt_default},
-      "generic catch all option", "" },
-    { NULL, },
-};
-
-static int probe_buf_write(void *opaque, uint8_t *buf, int buf_size)
-{
-    printf("%.*s", buf_size, buf);
-    return 0;
-}
-
-#define AVP_BUFFSIZE 4096
-
-int main(int argc, char **argv)
-{
-    int ret;
-    uint8_t *buffer = av_malloc(AVP_BUFFSIZE);
-
-    if (!buffer)
-        exit(1);
-
-    register_exit(avprobe_cleanup);
-
-    options = real_options;
-    parse_loglevel(argc, argv, options);
-    av_register_all();
-    avformat_network_init();
-    init_opts();
-#if CONFIG_AVDEVICE
-    avdevice_register_all();
-#endif
-
-    show_banner();
-
-    octx.print_header = ini_print_header;
-    octx.print_footer = ini_print_footer;
-
-    octx.print_array_header = ini_print_array_header;
-    octx.print_object_header = ini_print_object_header;
-
-    octx.print_integer = ini_print_integer;
-    octx.print_string = ini_print_string;
-
-    parse_options(NULL, 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 %s'.\n",
-                program_name);
-        exit_program(1);
-    }
-
-    probe_out = avio_alloc_context(buffer, AVP_BUFFSIZE, 1, NULL, NULL,
-                                 probe_buf_write, NULL);
-    if (!probe_out)
-        exit_program(1);
-
-    probe_header();
-    ret = probe_file(input_filename);
-    probe_footer();
-    avio_flush(probe_out);
-    avio_close(probe_out);
-
-    avformat_network_deinit();
-
-    return ret;
-}
diff --git a/deps/libav/avserver.c b/deps/libav/avserver.c
deleted file mode 100644
index 56bcda9..0000000
--- a/deps/libav/avserver.c
+++ /dev/null
@@ -1,4685 +0,0 @@
-/*
- * Multiple format streaming server
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#if !HAVE_CLOSESOCKET
-#define closesocket close
-#endif
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "libavformat/avformat.h"
-// FIXME those are internal headers, avserver _really_ shouldn't use them
-#include "libavformat/ffm.h"
-#include "libavformat/network.h"
-#include "libavformat/os_support.h"
-#include "libavformat/rtpdec.h"
-#include "libavformat/rtpproto.h"
-#include "libavformat/rtsp.h"
-#include "libavformat/avio_internal.h"
-#include "libavformat/internal.h"
-#include "libavformat/url.h"
-
-#include "libavutil/avstring.h"
-#include "libavutil/lfg.h"
-#include "libavutil/dict.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/random_seed.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/opt.h"
-#include "libavutil/time.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 <time.h>
-#include <sys/wait.h>
-#include <signal.h>
-
-#include "cmdutils.h"
-
-const char program_name[] = "avserver";
-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 MAX_STREAMS 20
-
-#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 */
-    AVIOContext *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 avserver.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) */
-    AVDictionary *in_opts;   /* 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 avconv process */
-    time_t pid_start;  /* of avconv 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 *config_filename;
-
-static int avserver_debug;
-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;
-
-static int64_t ffm_read_write_index(int fd)
-{
-    uint8_t buf[8];
-
-    lseek(fd, 8, SEEK_SET);
-    if (read(fd, buf, 8) != 8)
-        return AVERROR(EIO);
-    return AV_RB64(buf);
-}
-
-static int ffm_write_write_index(int fd, int64_t pos)
-{
-    uint8_t buf[8];
-    int i;
-
-    for(i=0;i<8;i++)
-        buf[i] = (pos >> (56 - i * 8)) & 0xff;
-    lseek(fd, 8, SEEK_SET);
-    if (write(fd, buf, 8) != 8)
-        return AVERROR(EIO);
-    return 8;
-}
-
-static void ffm_set_write_index(AVFormatContext *s, int64_t pos,
-                                int64_t file_size)
-{
-    FFMContext *ffm = s->priv_data;
-    ffm->write_index = pos;
-    ffm->file_size = file_size;
-}
-
-/* FIXME: make avserver 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 = { 0 };
-        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);
-    }
-}
-
-#ifdef __GNUC__
-__attribute__ ((format (printf, 1, 2)))
-#endif
-static void 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;
-    if (level > av_log_get_level())
-        return;
-    if (print_prefix && avc)
-        http_log("[%s @ %p]", avc->item_name(ptr), ptr);
-    print_prefix = strstr(fmt, "\n") != NULL;
-    http_vlog(fmt, vargs);
-}
-
-static void log_connection(HTTPContext *c)
-{
-    if (c->suppress_log)
-        return;
-
-    http_log("%s - - [%s] \"%s %s\" %d %"PRId64"\n",
-             inet_ntoa(c->from_addr.sin_addr), c->method, c->url,
-             c->protocol, (c->http_error ? c->http_error : 200), c->data_count);
-}
-
-static void update_datarate(DataRateData *drd, int64_t count)
-{
-    if (!drd->time1 && !drd->count1) {
-        drd->time1 = drd->time2 = cur_time;
-        drd->count1 = drd->count2 = count;
-    } else if (cur_time - drd->time2 > 5000) {
-        drd->time1 = drd->time2;
-        drd->count1 = drd->count2;
-        drd->time2 = cur_time;
-        drd->count2 = count;
-    }
-}
-
-/* In bytes per second */
-static int compute_datarate(DataRateData *drd, int64_t count)
-{
-    if (cur_time == drd->time1)
-        return 0;
-
-    return ((count - drd->count1) * 1000) / (cur_time - drd->time1);
-}
-
-
-static void start_children(FFStream *feed)
-{
-    if (no_launch)
-        return;
-
-    for (; feed; feed = feed->next) {
-        if (feed->child_argv && !feed->pid) {
-            feed->pid_start = time(0);
-
-            feed->pid = fork();
-
-            if (feed->pid < 0) {
-                http_log("Unable to create children\n");
-                exit(1);
-            }
-            if (!feed->pid) {
-                /* In child */
-                char pathname[1024];
-                char *slash;
-                int i;
-
-                av_strlcpy(pathname, my_program_name, sizeof(pathname));
-
-                slash = strrchr(pathname, '/');
-                if (!slash)
-                    slash = pathname;
-                else
-                    slash++;
-                strcpy(slash, "avconv");
-
-                http_log("Launch command line: ");
-                http_log("%s ", pathname);
-                for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
-                    http_log("%s ", feed->child_argv[i]);
-                http_log("\n");
-
-                for (i = 3; i < 256; i++)
-                    close(i);
-
-                if (!avserver_debug) {
-                    if (!freopen("/dev/null", "r", stdin))
-                        http_log("failed to redirect STDIN to /dev/null\n;");
-                    if (!freopen("/dev/null", "w", stdout))
-                        http_log("failed to redirect STDOUT to /dev/null\n;");
-                    if (!freopen("/dev/null", "w", stderr))
-                        http_log("failed to redirect STDERR to /dev/null\n;");
-                }
-
-                signal(SIGPIPE, SIG_DFL);
-
-                execvp(pathname, feed->child_argv);
-
-                _exit(1);
-            }
-        }
-    }
-}
-
-/* open a listening socket */
-static int socket_open_listen(struct sockaddr_in *my_addr)
-{
-    int server_fd, tmp;
-
-    server_fd = socket(AF_INET,SOCK_STREAM,0);
-    if (server_fd < 0) {
-        perror ("socket");
-        return -1;
-    }
-
-    tmp = 1;
-    setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));
-
-    my_addr->sin_family = AF_INET;
-    if (bind (server_fd, (struct sockaddr *) my_addr, sizeof (*my_addr)) < 0) {
-        char bindmsg[32];
-        snprintf(bindmsg, sizeof(bindmsg), "bind(port %d)", ntohs(my_addr->sin_port));
-        perror (bindmsg);
-        closesocket(server_fd);
-        return -1;
-    }
-
-    if (listen (server_fd, 5) < 0) {
-        perror ("listen");
-        closesocket(server_fd);
-        return -1;
-    }
-    ff_socket_nonblock(server_fd, 1);
-
-    return server_fd;
-}
-
-/* start all multicast streams */
-static void start_multicast(void)
-{
-    FFStream *stream;
-    char session_id[32];
-    HTTPContext *rtp_c;
-    struct sockaddr_in dest_addr;
-    int default_port, stream_index;
-
-    default_port = 6000;
-    for(stream = first_stream; stream != NULL; stream = stream->next) {
-        if (stream->is_multicast) {
-            /* open the RTP connection */
-            snprintf(session_id, sizeof(session_id), "%08x%08x",
-                     av_lfg_get(&random_state), av_lfg_get(&random_state));
-
-            /* choose a port if none given */
-            if (stream->multicast_port == 0) {
-                stream->multicast_port = default_port;
-                default_port += 100;
-            }
-
-            dest_addr.sin_family = AF_INET;
-            dest_addr.sin_addr = stream->multicast_ip;
-            dest_addr.sin_port = htons(stream->multicast_port);
-
-            rtp_c = rtp_new_connection(&dest_addr, stream, session_id,
-                                       RTSP_LOWER_TRANSPORT_UDP_MULTICAST);
-            if (!rtp_c)
-                continue;
-
-            if (open_input_stream(rtp_c, "") < 0) {
-                http_log("Could not open input stream for stream '%s'\n",
-                         stream->filename);
-                continue;
-            }
-
-            /* open each RTP stream */
-            for(stream_index = 0; stream_index < stream->nb_streams;
-                stream_index++) {
-                dest_addr.sin_port = htons(stream->multicast_port +
-                                           2 * stream_index);
-                if (rtp_new_av_stream(rtp_c, stream_index, &dest_addr, NULL) < 0) {
-                    http_log("Could not open output stream '%s/streamid=%d'\n",
-                             stream->filename, stream_index);
-                    exit(1);
-                }
-            }
-
-            /* change state to send data */
-            rtp_c->state = HTTPSTATE_SEND_DATA;
-        }
-    }
-}
-
-/* main loop of the http server */
-static int http_server(void)
-{
-    int server_fd = 0, rtsp_server_fd = 0;
-    int ret, delay, delay1;
-    struct pollfd *poll_table, *poll_entry;
-    HTTPContext *c, *c_next;
-
-    if(!(poll_table = av_mallocz((nb_max_http_connections + 2)*sizeof(*poll_table)))) {
-        http_log("Impossible to allocate a poll table handling %d connections.\n", nb_max_http_connections);
-        return -1;
-    }
-
-    if (my_http_addr.sin_port) {
-        server_fd = socket_open_listen(&my_http_addr);
-        if (server_fd < 0)
-            return -1;
-    }
-
-    if (my_rtsp_addr.sin_port) {
-        rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
-        if (rtsp_server_fd < 0)
-            return -1;
-    }
-
-    if (!rtsp_server_fd && !server_fd) {
-        http_log("HTTP and RTSP disabled.\n");
-        return -1;
-    }
-
-    http_log("AVserver started.\n");
-
-    start_children(first_feed);
-
-    start_multicast();
-
-    for(;;) {
-        poll_entry = poll_table;
-        if (server_fd) {
-            poll_entry->fd = server_fd;
-            poll_entry->events = POLLIN;
-            poll_entry++;
-        }
-        if (rtsp_server_fd) {
-            poll_entry->fd = rtsp_server_fd;
-            poll_entry->events = POLLIN;
-            poll_entry++;
-        }
-
-        /* wait for events on each HTTP handle */
-        c = first_http_ctx;
-        delay = 1000;
-        while (c != NULL) {
-            int fd;
-            fd = c->fd;
-            switch(c->state) {
-            case HTTPSTATE_SEND_HEADER:
-            case RTSPSTATE_SEND_REPLY:
-            case RTSPSTATE_SEND_PACKET:
-                c->poll_entry = poll_entry;
-                poll_entry->fd = fd;
-                poll_entry->events = POLLOUT;
-                poll_entry++;
-                break;
-            case HTTPSTATE_SEND_DATA_HEADER:
-            case HTTPSTATE_SEND_DATA:
-            case HTTPSTATE_SEND_DATA_TRAILER:
-                if (!c->is_packetized) {
-                    /* for TCP, we output as much as we can (may need to put a limit) */
-                    c->poll_entry = poll_entry;
-                    poll_entry->fd = fd;
-                    poll_entry->events = POLLOUT;
-                    poll_entry++;
-                } else {
-                    /* when avserver is doing the timing, we work by
-                       looking at which packet need to be sent every
-                       10 ms */
-                    delay1 = 10; /* one tick wait XXX: 10 ms assumed */
-                    if (delay1 < delay)
-                        delay = delay1;
-                }
-                break;
-            case HTTPSTATE_WAIT_REQUEST:
-            case HTTPSTATE_RECEIVE_DATA:
-            case HTTPSTATE_WAIT_FEED:
-            case RTSPSTATE_WAIT_REQUEST:
-                /* need to catch errors */
-                c->poll_entry = poll_entry;
-                poll_entry->fd = fd;
-                poll_entry->events = POLLIN;/* Maybe this will work */
-                poll_entry++;
-                break;
-            default:
-                c->poll_entry = NULL;
-                break;
-            }
-            c = c->next;
-        }
-
-        /* wait for an event on one connection. We poll at least every
-           second to handle timeouts */
-        do {
-            ret = poll(poll_table, poll_entry - poll_table, delay);
-            if (ret < 0 && ff_neterrno() != AVERROR(EAGAIN) &&
-                ff_neterrno() != AVERROR(EINTR))
-                return -1;
-        } while (ret < 0);
-
-        cur_time = av_gettime() / 1000;
-
-        if (need_to_start_children) {
-            need_to_start_children = 0;
-            start_children(first_feed);
-        }
-
-        /* now handle the events */
-        for(c = first_http_ctx; c != NULL; c = c_next) {
-            c_next = c->next;
-            if (handle_connection(c) < 0) {
-                /* close and free the connection */
-                log_connection(c);
-                close_connection(c);
-            }
-        }
-
-        poll_entry = poll_table;
-        if (server_fd) {
-            /* new HTTP connection request ? */
-            if (poll_entry->revents & POLLIN)
-                new_connection(server_fd, 0);
-            poll_entry++;
-        }
-        if (rtsp_server_fd) {
-            /* new RTSP connection request ? */
-            if (poll_entry->revents & POLLIN)
-                new_connection(rtsp_server_fd, 1);
-        }
-    }
-}
-
-/* start waiting for a new HTTP/RTSP request */
-static void start_wait_request(HTTPContext *c, int is_rtsp)
-{
-    c->buffer_ptr = c->buffer;
-    c->buffer_end = c->buffer + c->buffer_size - 1; /* leave room for '\0' */
-
-    if (is_rtsp) {
-        c->timeout = cur_time + RTSP_REQUEST_TIMEOUT;
-        c->state = RTSPSTATE_WAIT_REQUEST;
-    } else {
-        c->timeout = cur_time + HTTP_REQUEST_TIMEOUT;
-        c->state = HTTPSTATE_WAIT_REQUEST;
-    }
-}
-
-static void http_send_too_busy_reply(int fd)
-{
-    char buffer[300];
-    int len = snprintf(buffer, sizeof(buffer),
-                       "HTTP/1.0 503 Server too busy\r\n"
-                       "Content-type: text/html\r\n"
-                       "\r\n"
-                       "<html><head><title>Too busy</title></head><body>\r\n"
-                       "<p>The server is too busy to serve your request at this time.</p>\r\n"
-                       "<p>The number of current connections is %d, and this exceeds the limit of %d.</p>\r\n"
-                       "</body></html>\r\n",
-                       nb_connections, nb_max_connections);
-    send(fd, buffer, len, 0);
-}
-
-
-static void new_connection(int server_fd, int is_rtsp)
-{
-    struct sockaddr_in from_addr;
-    socklen_t len;
-    int fd;
-    HTTPContext *c = NULL;
-
-    len = sizeof(from_addr);
-    fd = accept(server_fd, (struct sockaddr *)&from_addr,
-                &len);
-    if (fd < 0) {
-        http_log("error during accept %s\n", strerror(errno));
-        return;
-    }
-    ff_socket_nonblock(fd, 1);
-
-    if (nb_connections >= nb_max_connections) {
-        http_send_too_busy_reply(fd);
-        goto fail;
-    }
-
-    /* add a new connection */
-    c = av_mallocz(sizeof(HTTPContext));
-    if (!c)
-        goto fail;
-
-    c->fd = fd;
-    c->poll_entry = NULL;
-    c->from_addr = from_addr;
-    c->buffer_size = IOBUFFER_INIT_SIZE;
-    c->buffer = av_malloc(c->buffer_size);
-    if (!c->buffer)
-        goto fail;
-
-    c->next = first_http_ctx;
-    first_http_ctx = c;
-    nb_connections++;
-
-    start_wait_request(c, is_rtsp);
-
-    return;
-
- fail:
-    if (c) {
-        av_free(c->buffer);
-        av_free(c);
-    }
-    closesocket(fd);
-}
-
-static void close_connection(HTTPContext *c)
-{
-    HTTPContext **cp, *c1;
-    int i, nb_streams;
-    AVFormatContext *ctx;
-    URLContext *h;
-    AVStream *st;
-
-    /* remove connection from list */
-    cp = &first_http_ctx;
-    while ((*cp) != NULL) {
-        c1 = *cp;
-        if (c1 == c)
-            *cp = c->next;
-        else
-            cp = &c1->next;
-    }
-
-    /* remove references, if any (XXX: do it faster) */
-    for(c1 = first_http_ctx; c1 != NULL; c1 = c1->next) {
-        if (c1->rtsp_c == c)
-            c1->rtsp_c = NULL;
-    }
-
-    /* remove connection associated resources */
-    if (c->fd >= 0)
-        closesocket(c->fd);
-    if (c->fmt_in) {
-        /* close each frame parser */
-        for(i=0;i<c->fmt_in->nb_streams;i++) {
-            st = c->fmt_in->streams[i];
-            if (st->codec->codec)
-                avcodec_close(st->codec);
-        }
-        avformat_close_input(&c->fmt_in);
-    }
-
-    /* free RTP output streams if any */
-    nb_streams = 0;
-    if (c->stream)
-        nb_streams = c->stream->nb_streams;
-
-    for(i=0;i<nb_streams;i++) {
-        ctx = c->rtp_ctx[i];
-        if (ctx) {
-            av_write_trailer(ctx);
-            av_dict_free(&ctx->metadata);
-            av_free(ctx->streams[0]);
-            av_free(ctx);
-        }
-        h = c->rtp_handles[i];
-        if (h)
-            ffurl_close(h);
-    }
-
-    ctx = &c->fmt_ctx;
-
-    if (!c->last_packet_sent && c->state == HTTPSTATE_SEND_DATA_TRAILER) {
-        if (ctx->oformat) {
-            /* prepare header */
-            if (avio_open_dyn_buf(&ctx->pb) >= 0) {
-                av_write_trailer(ctx);
-                av_freep(&c->pb_buffer);
-                avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
-            }
-        }
-    }
-
-    for(i=0; i<ctx->nb_streams; i++)
-        av_free(ctx->streams[i]);
-
-    if (c->stream && !c->post && c->stream->stream_type == STREAM_TYPE_LIVE)
-        current_bandwidth -= c->stream->bandwidth;
-
-    /* signal that there is no feed if we are the feeder socket */
-    if (c->state == HTTPSTATE_RECEIVE_DATA && c->stream) {
-        c->stream->feed_opened = 0;
-        close(c->feed_fd);
-    }
-
-    av_freep(&c->pb_buffer);
-    av_freep(&c->packet_buffer);
-    av_free(c->buffer);
-    av_free(c);
-    nb_connections--;
-}
-
-static int handle_connection(HTTPContext *c)
-{
-    int len, ret;
-
-    switch(c->state) {
-    case HTTPSTATE_WAIT_REQUEST:
-    case RTSPSTATE_WAIT_REQUEST:
-        /* timeout ? */
-        if ((c->timeout - cur_time) < 0)
-            return -1;
-        if (c->poll_entry->revents & (POLLERR | POLLHUP))
-            return -1;
-
-        /* no need to read if no events */
-        if (!(c->poll_entry->revents & POLLIN))
-            return 0;
-        /* read the data */
-    read_loop:
-        len = recv(c->fd, c->buffer_ptr, 1, 0);
-        if (len < 0) {
-            if (ff_neterrno() != AVERROR(EAGAIN) &&
-                ff_neterrno() != AVERROR(EINTR))
-                return -1;
-        } else if (len == 0) {
-            return -1;
-        } else {
-            /* search for end of request. */
-            uint8_t *ptr;
-            c->buffer_ptr += len;
-            ptr = c->buffer_ptr;
-            if ((ptr >= c->buffer + 2 && !memcmp(ptr-2, "\n\n", 2)) ||
-                (ptr >= c->buffer + 4 && !memcmp(ptr-4, "\r\n\r\n", 4))) {
-                /* request found : parse it and reply */
-                if (c->state == HTTPSTATE_WAIT_REQUEST) {
-                    ret = http_parse_request(c);
-                } else {
-                    ret = rtsp_parse_request(c);
-                }
-                if (ret < 0)
-                    return -1;
-            } else if (ptr >= c->buffer_end) {
-                /* request too long: cannot do anything */
-                return -1;
-            } else goto read_loop;
-        }
-        break;
-
-    case HTTPSTATE_SEND_HEADER:
-        if (c->poll_entry->revents & (POLLERR | POLLHUP))
-            return -1;
-
-        /* no need to write if no events */
-        if (!(c->poll_entry->revents & POLLOUT))
-            return 0;
-        len = send(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr, 0);
-        if (len < 0) {
-            if (ff_neterrno() != AVERROR(EAGAIN) &&
-                ff_neterrno() != AVERROR(EINTR)) {
-                /* error : close connection */
-                av_freep(&c->pb_buffer);
-                return -1;
-            }
-        } else {
-            c->buffer_ptr += len;
-            if (c->stream)
-                c->stream->bytes_served += len;
-            c->data_count += len;
-            if (c->buffer_ptr >= c->buffer_end) {
-                av_freep(&c->pb_buffer);
-                /* if error, exit */
-                if (c->http_error)
-                    return -1;
-                /* all the buffer was sent : synchronize to the incoming stream */
-                c->state = HTTPSTATE_SEND_DATA_HEADER;
-                c->buffer_ptr = c->buffer_end = c->buffer;
-            }
-        }
-        break;
-
-    case HTTPSTATE_SEND_DATA:
-    case HTTPSTATE_SEND_DATA_HEADER:
-    case HTTPSTATE_SEND_DATA_TRAILER:
-        /* for packetized output, we consider we can always write (the
-           input streams sets the speed). It may be better to verify
-           that we do not rely too much on the kernel queues */
-        if (!c->is_packetized) {
-            if (c->poll_entry->revents & (POLLERR | POLLHUP))
-                return -1;
-
-            /* no need to read if no events */
-            if (!(c->poll_entry->revents & POLLOUT))
-                return 0;
-        }
-        if (http_send_data(c) < 0)
-            return -1;
-        /* close connection if trailer sent */
-        if (c->state == HTTPSTATE_SEND_DATA_TRAILER)
-            return -1;
-        break;
-    case HTTPSTATE_RECEIVE_DATA:
-        /* no need to read if no events */
-        if (c->poll_entry->revents & (POLLERR | POLLHUP))
-            return -1;
-        if (!(c->poll_entry->revents & POLLIN))
-            return 0;
-        if (http_receive_data(c) < 0)
-            return -1;
-        break;
-    case HTTPSTATE_WAIT_FEED:
-        /* no need to read if no events */
-        if (c->poll_entry->revents & (POLLIN | POLLERR | POLLHUP))
-            return -1;
-
-        /* nothing to do, we'll be waken up by incoming feed packets */
-        break;
-
-    case RTSPSTATE_SEND_REPLY:
-        if (c->poll_entry->revents & (POLLERR | POLLHUP)) {
-            av_freep(&c->pb_buffer);
-            return -1;
-        }
-        /* no need to write if no events */
-        if (!(c->poll_entry->revents & POLLOUT))
-            return 0;
-        len = send(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr, 0);
-        if (len < 0) {
-            if (ff_neterrno() != AVERROR(EAGAIN) &&
-                ff_neterrno() != AVERROR(EINTR)) {
-                /* error : close connection */
-                av_freep(&c->pb_buffer);
-                return -1;
-            }
-        } else {
-            c->buffer_ptr += len;
-            c->data_count += len;
-            if (c->buffer_ptr >= c->buffer_end) {
-                /* all the buffer was sent : wait for a new request */
-                av_freep(&c->pb_buffer);
-                start_wait_request(c, 1);
-            }
-        }
-        break;
-    case RTSPSTATE_SEND_PACKET:
-        if (c->poll_entry->revents & (POLLERR | POLLHUP)) {
-            av_freep(&c->packet_buffer);
-            return -1;
-        }
-        /* no need to write if no events */
-        if (!(c->poll_entry->revents & POLLOUT))
-            return 0;
-        len = send(c->fd, c->packet_buffer_ptr,
-                    c->packet_buffer_end - c->packet_buffer_ptr, 0);
-        if (len < 0) {
-            if (ff_neterrno() != AVERROR(EAGAIN) &&
-                ff_neterrno() != AVERROR(EINTR)) {
-                /* error : close connection */
-                av_freep(&c->packet_buffer);
-                return -1;
-            }
-        } else {
-            c->packet_buffer_ptr += len;
-            if (c->packet_buffer_ptr >= c->packet_buffer_end) {
-                /* all the buffer was sent : wait for a new request */
-                av_freep(&c->packet_buffer);
-                c->state = RTSPSTATE_WAIT_REQUEST;
-            }
-        }
-        break;
-    case HTTPSTATE_READY:
-        /* nothing to do */
-        break;
-    default:
-        return -1;
-    }
-    return 0;
-}
-
-static int extract_rates(char *rates, int ratelen, const char *request)
-{
-    const char *p;
-
-    for (p = request; *p && *p != '\r' && *p != '\n'; ) {
-        if (av_strncasecmp(p, "Pragma:", 7) == 0) {
-            const char *q = p + 7;
-
-            while (*q && *q != '\n' && av_isspace(*q))
-                q++;
-
-            if (av_strncasecmp(q, "stream-switch-entry=", 20) == 0) {
-                int stream_no;
-                int rate_no;
-
-                q += 20;
-
-                memset(rates, 0xff, ratelen);
-
-                while (1) {
-                    while (*q && *q != '\n' && *q != ':')
-                        q++;
-
-                    if (sscanf(q, ":%d:%d", &stream_no, &rate_no) != 2)
-                        break;
-
-                    stream_no--;
-                    if (stream_no < ratelen && stream_no >= 0)
-                        rates[stream_no] = rate_no;
-
-                    while (*q && *q != '\n' && !av_isspace(*q))
-                        q++;
-                }
-
-                return 1;
-            }
-        }
-        p = strchr(p, '\n');
-        if (!p)
-            break;
-
-        p++;
-    }
-
-    return 0;
-}
-
-static int find_stream_in_feed(FFStream *feed, AVCodecContext *codec, int bit_rate)
-{
-    int i;
-    int best_bitrate = 100000000;
-    int best = -1;
-
-    for (i = 0; i < feed->nb_streams; i++) {
-        AVCodecContext *feed_codec = feed->streams[i]->codec;
-
-        if (feed_codec->codec_id != codec->codec_id ||
-            feed_codec->sample_rate != codec->sample_rate ||
-            feed_codec->width != codec->width ||
-            feed_codec->height != codec->height)
-            continue;
-
-        /* Potential stream */
-
-        /* We want the fastest stream less than bit_rate, or the slowest
-         * faster than bit_rate
-         */
-
-        if (feed_codec->bit_rate <= bit_rate) {
-            if (best_bitrate > bit_rate || feed_codec->bit_rate > best_bitrate) {
-                best_bitrate = feed_codec->bit_rate;
-                best = i;
-            }
-        } else {
-            if (feed_codec->bit_rate < best_bitrate) {
-                best_bitrate = feed_codec->bit_rate;
-                best = i;
-            }
-        }
-    }
-
-    return best;
-}
-
-static int modify_current_stream(HTTPContext *c, char *rates)
-{
-    int i;
-    FFStream *req = c->stream;
-    int action_required = 0;
-
-    /* Not much we can do for a feed */
-    if (!req->feed)
-        return 0;
-
-    for (i = 0; i < req->nb_streams; i++) {
-        AVCodecContext *codec = req->streams[i]->codec;
-
-        switch(rates[i]) {
-            case 0:
-                c->switch_feed_streams[i] = req->feed_streams[i];
-                break;
-            case 1:
-                c->switch_feed_streams[i] = find_stream_in_feed(req->feed, codec, codec->bit_rate / 2);
-                break;
-            case 2:
-                /* Wants off or slow */
-                c->switch_feed_streams[i] = find_stream_in_feed(req->feed, codec, codec->bit_rate / 4);
-#ifdef WANTS_OFF
-                /* This doesn't work well when it turns off the only stream! */
-                c->switch_feed_streams[i] = -2;
-                c->feed_streams[i] = -2;
-#endif
-                break;
-        }
-
-        if (c->switch_feed_streams[i] >= 0 && c->switch_feed_streams[i] != c->feed_streams[i])
-            action_required = 1;
-    }
-
-    return action_required;
-}
-
-/* XXX: factorize in utils.c ? */
-/* XXX: take care with different space meaning */
-static void skip_spaces(const char **pp)
-{
-    const char *p;
-    p = *pp;
-    while (*p == ' ' || *p == '\t')
-        p++;
-    *pp = p;
-}
-
-static void get_word(char *buf, int buf_size, const char **pp)
-{
-    const char *p;
-    char *q;
-
-    p = *pp;
-    skip_spaces(&p);
-    q = buf;
-    while (!av_isspace(*p) && *p != '\0') {
-        if ((q - buf) < buf_size - 1)
-            *q++ = *p;
-        p++;
-    }
-    if (buf_size > 0)
-        *q = '\0';
-    *pp = p;
-}
-
-static void get_arg(char *buf, int buf_size, const char **pp)
-{
-    const char *p;
-    char *q;
-    int quote;
-
-    p = *pp;
-    while (av_isspace(*p)) p++;
-    q = buf;
-    quote = 0;
-    if (*p == '\"' || *p == '\'')
-        quote = *p++;
-    for(;;) {
-        if (quote) {
-            if (*p == quote)
-                break;
-        } else {
-            if (av_isspace(*p))
-                break;
-        }
-        if (*p == '\0')
-            break;
-        if ((q - buf) < buf_size - 1)
-            *q++ = *p;
-        p++;
-    }
-    *q = '\0';
-    if (quote && *p == quote)
-        p++;
-    *pp = p;
-}
-
-static void parse_acl_row(FFStream *stream, FFStream* feed, IPAddressACL *ext_acl,
-                         const char *p, const char *filename, int line_num)
-{
-    char arg[1024];
-    IPAddressACL acl;
-    int errors = 0;
-
-    get_arg(arg, sizeof(arg), &p);
-    if (av_strcasecmp(arg, "allow") == 0)
-        acl.action = IP_ALLOW;
-    else if (av_strcasecmp(arg, "deny") == 0)
-        acl.action = IP_DENY;
-    else {
-        fprintf(stderr, "%s:%d: ACL action '%s' is not ALLOW or DENY\n",
-                filename, line_num, arg);
-        errors++;
-    }
-
-    get_arg(arg, sizeof(arg), &p);
-
-    if (resolve_host(&acl.first, arg) != 0) {
-        fprintf(stderr, "%s:%d: ACL refers to invalid host or ip address '%s'\n",
-                filename, line_num, arg);
-        errors++;
-    } else
-        acl.last = acl.first;
-
-    get_arg(arg, sizeof(arg), &p);
-
-    if (arg[0]) {
-        if (resolve_host(&acl.last, arg) != 0) {
-            fprintf(stderr, "%s:%d: ACL refers to invalid host or ip address '%s'\n",
-                    filename, line_num, arg);
-            errors++;
-        }
-    }
-
-    if (!errors) {
-        IPAddressACL *nacl = av_mallocz(sizeof(*nacl));
-        IPAddressACL **naclp = 0;
-
-        acl.next = 0;
-        *nacl = acl;
-
-        if (stream)
-            naclp = &stream->acl;
-        else if (feed)
-            naclp = &feed->acl;
-        else if (ext_acl)
-            naclp = &ext_acl;
-        else {
-            fprintf(stderr, "%s:%d: ACL found not in <stream> or <feed>\n",
-                    filename, line_num);
-            errors++;
-        }
-
-        if (naclp) {
-            while (*naclp)
-                naclp = &(*naclp)->next;
-
-            *naclp = nacl;
-        }
-    }
-}
-
-
-static IPAddressACL* parse_dynamic_acl(FFStream *stream, HTTPContext *c)
-{
-    FILE* f;
-    char line[1024];
-    char  cmd[1024];
-    IPAddressACL *acl = NULL;
-    int line_num = 0;
-    const char *p;
-
-    f = fopen(stream->dynamic_acl, "r");
-    if (!f) {
-        perror(stream->dynamic_acl);
-        return NULL;
-    }
-
-    acl = av_mallocz(sizeof(IPAddressACL));
-
-    /* Build ACL */
-    for(;;) {
-        if (fgets(line, sizeof(line), f) == NULL)
-            break;
-        line_num++;
-        p = line;
-        while (av_isspace(*p))
-            p++;
-        if (*p == '\0' || *p == '#')
-            continue;
-        get_arg(cmd, sizeof(cmd), &p);
-
-        if (!av_strcasecmp(cmd, "ACL"))
-            parse_acl_row(NULL, NULL, acl, p, stream->dynamic_acl, line_num);
-    }
-    fclose(f);
-    return acl;
-}
-
-
-static void free_acl_list(IPAddressACL *in_acl)
-{
-    IPAddressACL *pacl,*pacl2;
-
-    pacl = in_acl;
-    while(pacl) {
-        pacl2 = pacl;
-        pacl = pacl->next;
-        av_freep(pacl2);
-    }
-}
-
-static int validate_acl_list(IPAddressACL *in_acl, HTTPContext *c)
-{
-    enum IPAddressAction last_action = IP_DENY;
-    IPAddressACL *acl;
-    struct in_addr *src = &c->from_addr.sin_addr;
-    unsigned long src_addr = src->s_addr;
-
-    for (acl = in_acl; acl; acl = acl->next) {
-        if (src_addr >= acl->first.s_addr && src_addr <= acl->last.s_addr)
-            return (acl->action == IP_ALLOW) ? 1 : 0;
-        last_action = acl->action;
-    }
-
-    /* Nothing matched, so return not the last action */
-    return (last_action == IP_DENY) ? 1 : 0;
-}
-
-static int validate_acl(FFStream *stream, HTTPContext *c)
-{
-    int ret = 0;
-    IPAddressACL *acl;
-
-
-    /* if stream->acl is null validate_acl_list will return 1 */
-    ret = validate_acl_list(stream->acl, c);
-
-    if (stream->dynamic_acl[0]) {
-        acl = parse_dynamic_acl(stream, c);
-
-        ret = validate_acl_list(acl, c);
-
-        free_acl_list(acl);
-    }
-
-    return ret;
-}
-
-/* compute the real filename of a file by matching it without its
-   extensions to all the stream filenames */
-static void compute_real_filename(char *filename, int max_size)
-{
-    char file1[1024];
-    char file2[1024];
-    char *p;
-    FFStream *stream;
-
-    /* compute filename by matching without the file extensions */
-    av_strlcpy(file1, filename, sizeof(file1));
-    p = strrchr(file1, '.');
-    if (p)
-        *p = '\0';
-    for(stream = first_stream; stream != NULL; stream = stream->next) {
-        av_strlcpy(file2, stream->filename, sizeof(file2));
-        p = strrchr(file2, '.');
-        if (p)
-            *p = '\0';
-        if (!strcmp(file1, file2)) {
-            av_strlcpy(filename, stream->filename, max_size);
-            break;
-        }
-    }
-}
-
-enum RedirType {
-    REDIR_NONE,
-    REDIR_ASX,
-    REDIR_RAM,
-    REDIR_ASF,
-    REDIR_RTSP,
-    REDIR_SDP,
-};
-
-/* parse http request and prepare header */
-static int http_parse_request(HTTPContext *c)
-{
-    const char *p;
-    char *p1;
-    enum RedirType redir_type;
-    char cmd[32];
-    char info[1024], filename[1024];
-    char url[1024], *q;
-    char protocol[32];
-    char msg[1024];
-    const char *mime_type;
-    FFStream *stream;
-    int i;
-    char ratebuf[32];
-    const char *useragent = 0;
-
-    p = c->buffer;
-    get_word(cmd, sizeof(cmd), &p);
-    av_strlcpy(c->method, cmd, sizeof(c->method));
-
-    if (!strcmp(cmd, "GET"))
-        c->post = 0;
-    else if (!strcmp(cmd, "POST"))
-        c->post = 1;
-    else
-        return -1;
-
-    get_word(url, sizeof(url), &p);
-    av_strlcpy(c->url, url, sizeof(c->url));
-
-    get_word(protocol, sizeof(protocol), (const char **)&p);
-    if (strcmp(protocol, "HTTP/1.0") && strcmp(protocol, "HTTP/1.1"))
-        return -1;
-
-    av_strlcpy(c->protocol, protocol, sizeof(c->protocol));
-
-    if (avserver_debug)
-        http_log("%s - - New connection: %s %s\n", inet_ntoa(c->from_addr.sin_addr), cmd, url);
-
-    /* find the filename and the optional info string in the request */
-    p1 = strchr(url, '?');
-    if (p1) {
-        av_strlcpy(info, p1, sizeof(info));
-        *p1 = '\0';
-    } else
-        info[0] = '\0';
-
-    av_strlcpy(filename, url + ((*url == '/') ? 1 : 0), sizeof(filename)-1);
-
-    for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
-        if (av_strncasecmp(p, "User-Agent:", 11) == 0) {
-            useragent = p + 11;
-            if (*useragent && *useragent != '\n' && av_isspace(*useragent))
-                useragent++;
-            break;
-        }
-        p = strchr(p, '\n');
-        if (!p)
-            break;
-
-        p++;
-    }
-
-    redir_type = REDIR_NONE;
-    if (av_match_ext(filename, "asx")) {
-        redir_type = REDIR_ASX;
-        filename[strlen(filename)-1] = 'f';
-    } else if (av_match_ext(filename, "asf") &&
-        (!useragent || av_strncasecmp(useragent, "NSPlayer", 8) != 0)) {
-        /* if this isn't WMP or lookalike, return the redirector file */
-        redir_type = REDIR_ASF;
-    } else if (av_match_ext(filename, "rpm,ram")) {
-        redir_type = REDIR_RAM;
-        strcpy(filename + strlen(filename)-2, "m");
-    } else if (av_match_ext(filename, "rtsp")) {
-        redir_type = REDIR_RTSP;
-        compute_real_filename(filename, sizeof(filename) - 1);
-    } else if (av_match_ext(filename, "sdp")) {
-        redir_type = REDIR_SDP;
-        compute_real_filename(filename, sizeof(filename) - 1);
-    }
-
-    // "redirect" / request to index.html
-    if (!strlen(filename))
-        av_strlcpy(filename, "index.html", sizeof(filename) - 1);
-
-    stream = first_stream;
-    while (stream != NULL) {
-        if (!strcmp(stream->filename, filename) && validate_acl(stream, c))
-            break;
-        stream = stream->next;
-    }
-    if (stream == NULL) {
-        snprintf(msg, sizeof(msg), "File '%s' not found", url);
-        http_log("File '%s' not found\n", url);
-        goto send_error;
-    }
-
-    c->stream = stream;
-    memcpy(c->feed_streams, stream->feed_streams, sizeof(c->feed_streams));
-    memset(c->switch_feed_streams, -1, sizeof(c->switch_feed_streams));
-
-    if (stream->stream_type == STREAM_TYPE_REDIRECT) {
-        c->http_error = 301;
-        q = c->buffer;
-        q += snprintf(q, c->buffer_size,
-                      "HTTP/1.0 301 Moved\r\n"
-                      "Location: %s\r\n"
-                      "Content-type: text/html\r\n"
-                      "\r\n"
-                      "<html><head><title>Moved</title></head><body>\r\n"
-                      "You should be <a href=\"%s\">redirected</a>.\r\n"
-                      "</body></html>\r\n", stream->feed_filename, stream->feed_filename);
-        /* prepare output buffer */
-        c->buffer_ptr = c->buffer;
-        c->buffer_end = q;
-        c->state = HTTPSTATE_SEND_HEADER;
-        return 0;
-    }
-
-    /* If this is WMP, get the rate information */
-    if (extract_rates(ratebuf, sizeof(ratebuf), c->buffer)) {
-        if (modify_current_stream(c, ratebuf)) {
-            for (i = 0; i < FF_ARRAY_ELEMS(c->feed_streams); i++) {
-                if (c->switch_feed_streams[i] >= 0)
-                    c->switch_feed_streams[i] = -1;
-            }
-        }
-    }
-
-    if (c->post == 0 && stream->stream_type == STREAM_TYPE_LIVE)
-        current_bandwidth += stream->bandwidth;
-
-    /* If already streaming this feed, do not let start another feeder. */
-    if (stream->feed_opened) {
-        snprintf(msg, sizeof(msg), "This feed is already being received.");
-        http_log("Feed '%s' already being received\n", stream->feed_filename);
-        goto send_error;
-    }
-
-    if (c->post == 0 && max_bandwidth < current_bandwidth) {
-        c->http_error = 503;
-        q = c->buffer;
-        q += snprintf(q, c->buffer_size,
-                      "HTTP/1.0 503 Server too busy\r\n"
-                      "Content-type: text/html\r\n"
-                      "\r\n"
-                      "<html><head><title>Too busy</title></head><body>\r\n"
-                      "<p>The server is too busy to serve your request at this time.</p>\r\n"
-                      "<p>The bandwidth being served (including your stream) is %"PRIu64"kbit/sec, "
-                      "and this exceeds the limit of %"PRIu64"kbit/sec.</p>\r\n"
-                      "</body></html>\r\n", current_bandwidth, max_bandwidth);
-        /* prepare output buffer */
-        c->buffer_ptr = c->buffer;
-        c->buffer_end = q;
-        c->state = HTTPSTATE_SEND_HEADER;
-        return 0;
-    }
-
-    if (redir_type != REDIR_NONE) {
-        const char *hostinfo = 0;
-
-        for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
-            if (av_strncasecmp(p, "Host:", 5) == 0) {
-                hostinfo = p + 5;
-                break;
-            }
-            p = strchr(p, '\n');
-            if (!p)
-                break;
-
-            p++;
-        }
-
-        if (hostinfo) {
-            char *eoh;
-            char hostbuf[260];
-
-            while (av_isspace(*hostinfo))
-                hostinfo++;
-
-            eoh = strchr(hostinfo, '\n');
-            if (eoh) {
-                if (eoh[-1] == '\r')
-                    eoh--;
-
-                if (eoh - hostinfo < sizeof(hostbuf) - 1) {
-                    memcpy(hostbuf, hostinfo, eoh - hostinfo);
-                    hostbuf[eoh - hostinfo] = 0;
-
-                    c->http_error = 200;
-                    q = c->buffer;
-                    switch(redir_type) {
-                    case REDIR_ASX:
-                        q += snprintf(q, c->buffer_size,
-                                      "HTTP/1.0 200 ASX Follows\r\n"
-                                      "Content-type: video/x-ms-asf\r\n"
-                                      "\r\n"
-                                      "<ASX Version=\"3\">\r\n"
-                                      //"<!-- Autogenerated by avserver -->\r\n"
-                                      "<ENTRY><REF HREF=\"http://%s/%s%s\"/></ENTRY>\r\n"
-                                      "</ASX>\r\n", hostbuf, filename, info);
-                        break;
-                    case REDIR_RAM:
-                        q += snprintf(q, c->buffer_size,
-                                      "HTTP/1.0 200 RAM Follows\r\n"
-                                      "Content-type: audio/x-pn-realaudio\r\n"
-                                      "\r\n"
-                                      "# Autogenerated by avserver\r\n"
-                                      "http://%s/%s%s\r\n", hostbuf, filename, info);
-                        break;
-                    case REDIR_ASF:
-                        q += snprintf(q, c->buffer_size,
-                                      "HTTP/1.0 200 ASF Redirect follows\r\n"
-                                      "Content-type: video/x-ms-asf\r\n"
-                                      "\r\n"
-                                      "[Reference]\r\n"
-                                      "Ref1=http://%s/%s%s\r\n", hostbuf, filename, info);
-                        break;
-                    case REDIR_RTSP:
-                        {
-                            char hostname[256], *p;
-                            /* extract only hostname */
-                            av_strlcpy(hostname, hostbuf, sizeof(hostname));
-                            p = strrchr(hostname, ':');
-                            if (p)
-                                *p = '\0';
-                            q += snprintf(q, c->buffer_size,
-                                          "HTTP/1.0 200 RTSP Redirect follows\r\n"
-                                          /* XXX: incorrect mime type ? */
-                                          "Content-type: application/x-rtsp\r\n"
-                                          "\r\n"
-                                          "rtsp://%s:%d/%s\r\n", hostname, ntohs(my_rtsp_addr.sin_port), filename);
-                        }
-                        break;
-                    case REDIR_SDP:
-                        {
-                            uint8_t *sdp_data;
-                            int sdp_data_size;
-                            socklen_t len;
-                            struct sockaddr_in my_addr;
-
-                            q += snprintf(q, c->buffer_size,
-                                          "HTTP/1.0 200 OK\r\n"
-                                          "Content-type: application/sdp\r\n"
-                                          "\r\n");
-
-                            len = sizeof(my_addr);
-                            getsockname(c->fd, (struct sockaddr *)&my_addr, &len);
-
-                            /* XXX: should use a dynamic buffer */
-                            sdp_data_size = prepare_sdp_description(stream,
-                                                                    &sdp_data,
-                                                                    my_addr.sin_addr);
-                            if (sdp_data_size > 0) {
-                                memcpy(q, sdp_data, sdp_data_size);
-                                q += sdp_data_size;
-                                *q = '\0';
-                                av_free(sdp_data);
-                            }
-                        }
-                        break;
-                    default:
-                        abort();
-                        break;
-                    }
-
-                    /* prepare output buffer */
-                    c->buffer_ptr = c->buffer;
-                    c->buffer_end = q;
-                    c->state = HTTPSTATE_SEND_HEADER;
-                    return 0;
-                }
-            }
-        }
-
-        snprintf(msg, sizeof(msg), "ASX/RAM file not handled");
-        goto send_error;
-    }
-
-    stream->conns_served++;
-
-    /* XXX: add there authenticate and IP match */
-
-    if (c->post) {
-        /* if post, it means a feed is being sent */
-        if (!stream->is_feed) {
-            /* However it might be a status report from WMP! Let us log the
-             * data as it might come in handy one day. */
-            const char *logline = 0;
-            int client_id = 0;
-
-            for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
-                if (av_strncasecmp(p, "Pragma: log-line=", 17) == 0) {
-                    logline = p;
-                    break;
-                }
-                if (av_strncasecmp(p, "Pragma: client-id=", 18) == 0)
-                    client_id = strtol(p + 18, 0, 10);
-                p = strchr(p, '\n');
-                if (!p)
-                    break;
-
-                p++;
-            }
-
-            if (logline) {
-                char *eol = strchr(logline, '\n');
-
-                logline += 17;
-
-                if (eol) {
-                    if (eol[-1] == '\r')
-                        eol--;
-                    http_log("%.*s\n", (int) (eol - logline), logline);
-                    c->suppress_log = 1;
-                }
-            }
-
-#ifdef DEBUG
-            http_log("\nGot request:\n%s\n", c->buffer);
-#endif
-
-            if (client_id && extract_rates(ratebuf, sizeof(ratebuf), c->buffer)) {
-                HTTPContext *wmpc;
-
-                /* Now we have to find the client_id */
-                for (wmpc = first_http_ctx; wmpc; wmpc = wmpc->next) {
-                    if (wmpc->wmp_client_id == client_id)
-                        break;
-                }
-
-                if (wmpc && modify_current_stream(wmpc, ratebuf))
-                    wmpc->switch_pending = 1;
-            }
-
-            snprintf(msg, sizeof(msg), "POST command not handled");
-            c->stream = 0;
-            goto send_error;
-        }
-        if (http_start_receive_data(c) < 0) {
-            snprintf(msg, sizeof(msg), "could not open feed");
-            goto send_error;
-        }
-        c->http_error = 0;
-        c->state = HTTPSTATE_RECEIVE_DATA;
-        return 0;
-    }
-
-#ifdef DEBUG
-    if (strcmp(stream->filename + strlen(stream->filename) - 4, ".asf") == 0)
-        http_log("\nGot request:\n%s\n", c->buffer);
-#endif
-
-    if (c->stream->stream_type == STREAM_TYPE_STATUS)
-        goto send_status;
-
-    /* open input stream */
-    if (open_input_stream(c, info) < 0) {
-        snprintf(msg, sizeof(msg), "Input stream corresponding to '%s' not found", url);
-        goto send_error;
-    }
-
-    /* prepare http header */
-    q = c->buffer;
-    q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 200 OK\r\n");
-    mime_type = c->stream->fmt->mime_type;
-    if (!mime_type)
-        mime_type = "application/x-octet-stream";
-    q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Pragma: no-cache\r\n");
-
-    /* for asf, we need extra headers */
-    if (!strcmp(c->stream->fmt->name,"asf_stream")) {
-        /* Need to allocate a client id */
-
-        c->wmp_client_id = av_lfg_get(&random_state);
-
-        q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Server: Cougar 4.1.0.3923\r\nCache-Control: no-cache\r\nPragma: client-id=%d\r\nPragma: features=\"broadcast\"\r\n", c->wmp_client_id);
-    }
-    q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-Type: %s\r\n", mime_type);
-    q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n");
-
-    /* prepare output buffer */
-    c->http_error = 0;
-    c->buffer_ptr = c->buffer;
-    c->buffer_end = q;
-    c->state = HTTPSTATE_SEND_HEADER;
-    return 0;
- send_error:
-    c->http_error = 404;
-    q = c->buffer;
-    q += snprintf(q, c->buffer_size,
-                  "HTTP/1.0 404 Not Found\r\n"
-                  "Content-type: text/html\r\n"
-                  "\r\n"
-                  "<html>\n"
-                  "<head><title>404 Not Found</title></head>\n"
-                  "<body>%s</body>\n"
-                  "</html>\n", msg);
-    /* prepare output buffer */
-    c->buffer_ptr = c->buffer;
-    c->buffer_end = q;
-    c->state = HTTPSTATE_SEND_HEADER;
-    return 0;
- send_status:
-    compute_status(c);
-    c->http_error = 200; /* horrible : we use this value to avoid
-                            going to the send data state */
-    c->state = HTTPSTATE_SEND_HEADER;
-    return 0;
-}
-
-static void fmt_bytecount(AVIOContext *pb, int64_t count)
-{
-    static const char suffix[] = " kMGTP";
-    const char *s;
-
-    for (s = suffix; count >= 100000 && s[1]; count /= 1000, s++);
-
-    avio_printf(pb, "%"PRId64"%c", count, *s);
-}
-
-static void compute_status(HTTPContext *c)
-{
-    HTTPContext *c1;
-    FFStream *stream;
-    char *p;
-    time_t ti;
-    int i, len;
-    AVIOContext *pb;
-
-    if (avio_open_dyn_buf(&pb) < 0) {
-        /* XXX: return an error ? */
-        c->buffer_ptr = c->buffer;
-        c->buffer_end = c->buffer;
-        return;
-    }
-
-    avio_printf(pb, "HTTP/1.0 200 OK\r\n");
-    avio_printf(pb, "Content-type: %s\r\n", "text/html");
-    avio_printf(pb, "Pragma: no-cache\r\n");
-    avio_printf(pb, "\r\n");
-
-    avio_printf(pb, "<html><head><title>%s Status</title>\n", program_name);
-    if (c->stream->feed_filename[0])
-        avio_printf(pb, "<link rel=\"shortcut icon\" href=\"%s\">\n", c->stream->feed_filename);
-    avio_printf(pb, "</head>\n<body>");
-    avio_printf(pb, "<h1>%s Status</h1>\n", program_name);
-    /* format status */
-    avio_printf(pb, "<h2>Available Streams</h2>\n");
-    avio_printf(pb, "<table cellspacing=0 cellpadding=4>\n");
-    avio_printf(pb, "<tr><th valign=top>Path<th align=left>Served<br>Conns<th><br>bytes<th valign=top>Format<th>Bit rate<br>kbits/s<th align=left>Video<br>kbits/s<th><br>Codec<th align=left>Audio<br>kbits/s<th><br>Codec<th align=left valign=top>Feed\n");
-    stream = first_stream;
-    while (stream != NULL) {
-        char sfilename[1024];
-        char *eosf;
-
-        if (stream->feed != stream) {
-            av_strlcpy(sfilename, stream->filename, sizeof(sfilename) - 10);
-            eosf = sfilename + strlen(sfilename);
-            if (eosf - sfilename >= 4) {
-                if (strcmp(eosf - 4, ".asf") == 0)
-                    strcpy(eosf - 4, ".asx");
-                else if (strcmp(eosf - 3, ".rm") == 0)
-                    strcpy(eosf - 3, ".ram");
-                else if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
-                    /* generate a sample RTSP director if
-                       unicast. Generate an SDP redirector if
-                       multicast */
-                    eosf = strrchr(sfilename, '.');
-                    if (!eosf)
-                        eosf = sfilename + strlen(sfilename);
-                    if (stream->is_multicast)
-                        strcpy(eosf, ".sdp");
-                    else
-                        strcpy(eosf, ".rtsp");
-                }
-            }
-
-            avio_printf(pb, "<tr><td><a href=\"/%s\">%s</a> ",
-                         sfilename, stream->filename);
-            avio_printf(pb, "<td align=right> %d <td align=right> ",
-                        stream->conns_served);
-            fmt_bytecount(pb, stream->bytes_served);
-            switch(stream->stream_type) {
-            case STREAM_TYPE_LIVE: {
-                    int audio_bit_rate = 0;
-                    int video_bit_rate = 0;
-                    const char *audio_codec_name = "";
-                    const char *video_codec_name = "";
-                    const char *audio_codec_name_extra = "";
-                    const char *video_codec_name_extra = "";
-
-                    for(i=0;i<stream->nb_streams;i++) {
-                        AVStream *st = stream->streams[i];
-                        AVCodec *codec = avcodec_find_encoder(st->codec->codec_id);
-                        switch(st->codec->codec_type) {
-                        case AVMEDIA_TYPE_AUDIO:
-                            audio_bit_rate += st->codec->bit_rate;
-                            if (codec) {
-                                if (*audio_codec_name)
-                                    audio_codec_name_extra = "...";
-                                audio_codec_name = codec->name;
-                            }
-                            break;
-                        case AVMEDIA_TYPE_VIDEO:
-                            video_bit_rate += st->codec->bit_rate;
-                            if (codec) {
-                                if (*video_codec_name)
-                                    video_codec_name_extra = "...";
-                                video_codec_name = codec->name;
-                            }
-                            break;
-                        case AVMEDIA_TYPE_DATA:
-                            video_bit_rate += st->codec->bit_rate;
-                            break;
-                        default:
-                            abort();
-                        }
-                    }
-                    avio_printf(pb, "<td align=center> %s <td align=right> %d <td align=right> %d <td> %s %s <td align=right> %d <td> %s %s",
-                                 stream->fmt->name,
-                                 stream->bandwidth,
-                                 video_bit_rate / 1000, video_codec_name, video_codec_name_extra,
-                                 audio_bit_rate / 1000, audio_codec_name, audio_codec_name_extra);
-                    if (stream->feed)
-                        avio_printf(pb, "<td>%s", stream->feed->filename);
-                    else
-                        avio_printf(pb, "<td>%s", stream->feed_filename);
-                    avio_printf(pb, "\n");
-                }
-                break;
-            default:
-                avio_printf(pb, "<td align=center> - <td align=right> - <td align=right> - <td><td align=right> - <td>\n");
-                break;
-            }
-        }
-        stream = stream->next;
-    }
-    avio_printf(pb, "</table>\n");
-
-    stream = first_stream;
-    while (stream != NULL) {
-        if (stream->feed == stream) {
-            avio_printf(pb, "<h2>Feed %s</h2>", stream->filename);
-            if (stream->pid) {
-                avio_printf(pb, "Running as pid %d.\n", stream->pid);
-
-#if defined(linux) && !defined(CONFIG_NOCUTILS)
-                {
-                    FILE *pid_stat;
-                    char ps_cmd[64];
-
-                    /* This is somewhat linux specific I guess */
-                    snprintf(ps_cmd, sizeof(ps_cmd),
-                             "ps -o \"%%cpu,cputime\" --no-headers %d",
-                             stream->pid);
-
-                    pid_stat = popen(ps_cmd, "r");
-                    if (pid_stat) {
-                        char cpuperc[10];
-                        char cpuused[64];
-
-                        if (fscanf(pid_stat, "%10s %64s", cpuperc,
-                                   cpuused) == 2) {
-                            avio_printf(pb, "Currently using %s%% of the cpu. Total time used %s.\n",
-                                         cpuperc, cpuused);
-                        }
-                        fclose(pid_stat);
-                    }
-                }
-#endif
-
-                avio_printf(pb, "<p>");
-            }
-            avio_printf(pb, "<table cellspacing=0 cellpadding=4><tr><th>Stream<th>type<th>kbits/s<th align=left>codec<th align=left>Parameters\n");
-
-            for (i = 0; i < stream->nb_streams; i++) {
-                AVStream *st = stream->streams[i];
-                AVCodec *codec = avcodec_find_encoder(st->codec->codec_id);
-                const char *type = "unknown";
-                char parameters[64];
-
-                parameters[0] = 0;
-
-                switch(st->codec->codec_type) {
-                case AVMEDIA_TYPE_AUDIO:
-                    type = "audio";
-                    snprintf(parameters, sizeof(parameters), "%d channel(s), %d Hz", st->codec->channels, st->codec->sample_rate);
-                    break;
-                case AVMEDIA_TYPE_VIDEO:
-                    type = "video";
-                    snprintf(parameters, sizeof(parameters), "%dx%d, q=%d-%d, fps=%d", st->codec->width, st->codec->height,
-                                st->codec->qmin, st->codec->qmax, st->codec->time_base.den / st->codec->time_base.num);
-                    break;
-                default:
-                    abort();
-                }
-                avio_printf(pb, "<tr><td align=right>%d<td>%s<td align=right>%d<td>%s<td>%s\n",
-                        i, type, st->codec->bit_rate/1000, codec ? codec->name : "", parameters);
-            }
-            avio_printf(pb, "</table>\n");
-
-        }
-        stream = stream->next;
-    }
-
-    /* connection status */
-    avio_printf(pb, "<h2>Connection Status</h2>\n");
-
-    avio_printf(pb, "Number of connections: %d / %d<br>\n",
-                 nb_connections, nb_max_connections);
-
-    avio_printf(pb, "Bandwidth in use: %"PRIu64"k / %"PRIu64"k<br>\n",
-                 current_bandwidth, max_bandwidth);
-
-    avio_printf(pb, "<table>\n");
-    avio_printf(pb, "<tr><th>#<th>File<th>IP<th>Proto<th>State<th>Target bits/sec<th>Actual bits/sec<th>Bytes transferred\n");
-    c1 = first_http_ctx;
-    i = 0;
-    while (c1 != NULL) {
-        int bitrate;
-        int j;
-
-        bitrate = 0;
-        if (c1->stream) {
-            for (j = 0; j < c1->stream->nb_streams; j++) {
-                if (!c1->stream->feed)
-                    bitrate += c1->stream->streams[j]->codec->bit_rate;
-                else if (c1->feed_streams[j] >= 0)
-                    bitrate += c1->stream->feed->streams[c1->feed_streams[j]]->codec->bit_rate;
-            }
-        }
-
-        i++;
-        p = inet_ntoa(c1->from_addr.sin_addr);
-        avio_printf(pb, "<tr><td><b>%d</b><td>%s%s<td>%s<td>%s<td>%s<td align=right>",
-                    i,
-                    c1->stream ? c1->stream->filename : "",
-                    c1->state == HTTPSTATE_RECEIVE_DATA ? "(input)" : "",
-                    p,
-                    c1->protocol,
-                    http_state[c1->state]);
-        fmt_bytecount(pb, bitrate);
-        avio_printf(pb, "<td align=right>");
-        fmt_bytecount(pb, compute_datarate(&c1->datarate, c1->data_count) * 8);
-        avio_printf(pb, "<td align=right>");
-        fmt_bytecount(pb, c1->data_count);
-        avio_printf(pb, "\n");
-        c1 = c1->next;
-    }
-    avio_printf(pb, "</table>\n");
-
-    /* date */
-    ti = time(NULL);
-    p = ctime(&ti);
-    avio_printf(pb, "<hr size=1 noshade>Generated at %s", p);
-    avio_printf(pb, "</body>\n</html>\n");
-
-    len = avio_close_dyn_buf(pb, &c->pb_buffer);
-    c->buffer_ptr = c->pb_buffer;
-    c->buffer_end = c->pb_buffer + len;
-}
-
-static int open_input_stream(HTTPContext *c, const char *info)
-{
-    char buf[128];
-    char input_filename[1024];
-    AVFormatContext *s = NULL;
-    int i, ret;
-    int64_t stream_pos;
-
-    /* find file name */
-    if (c->stream->feed) {
-        strcpy(input_filename, c->stream->feed->feed_filename);
-        /* compute position (absolute time) */
-        if (av_find_info_tag(buf, sizeof(buf), "date", info)) {
-            if ((ret = av_parse_time(&stream_pos, buf, 0)) < 0)
-                return ret;
-        } else if (av_find_info_tag(buf, sizeof(buf), "buffer", info)) {
-            int prebuffer = strtol(buf, 0, 10);
-            stream_pos = av_gettime() - prebuffer * (int64_t)1000000;
-        } else
-            stream_pos = av_gettime() - c->stream->prebuffer * (int64_t)1000;
-    } else {
-        strcpy(input_filename, c->stream->feed_filename);
-        /* compute position (relative time) */
-        if (av_find_info_tag(buf, sizeof(buf), "date", info)) {
-            if ((ret = av_parse_time(&stream_pos, buf, 1)) < 0)
-                return ret;
-        } else
-            stream_pos = 0;
-    }
-    if (input_filename[0] == '\0')
-        return -1;
-
-    /* open stream */
-    if ((ret = avformat_open_input(&s, input_filename, c->stream->ifmt, &c->stream->in_opts)) < 0) {
-        http_log("could not open %s: %d\n", input_filename, ret);
-        return -1;
-    }
-    s->flags |= AVFMT_FLAG_GENPTS;
-    c->fmt_in = s;
-    if (strcmp(s->iformat->name, "ffm") && avformat_find_stream_info(c->fmt_in, NULL) < 0) {
-        http_log("Could not find stream info '%s'\n", input_filename);
-        avformat_close_input(&s);
-        return -1;
-    }
-
-    /* choose stream as clock source (we favorize video stream if
-       present) for packet sending */
-    c->pts_stream_index = 0;
-    for(i=0;i<c->stream->nb_streams;i++) {
-        if (c->pts_stream_index == 0 &&
-            c->stream->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            c->pts_stream_index = i;
-        }
-    }
-
-    if (c->fmt_in->iformat->read_seek)
-        av_seek_frame(c->fmt_in, -1, stream_pos, 0);
-    /* set the start time (needed for maxtime and RTP packet timing) */
-    c->start_time = cur_time;
-    c->first_pts = AV_NOPTS_VALUE;
-    return 0;
-}
-
-/* return the server clock (in us) */
-static int64_t get_server_clock(HTTPContext *c)
-{
-    /* compute current pts value from system time */
-    return (cur_time - c->start_time) * 1000;
-}
-
-/* return the estimated time at which the current packet must be sent
-   (in us) */
-static int64_t get_packet_send_clock(HTTPContext *c)
-{
-    int bytes_left, bytes_sent, frame_bytes;
-
-    frame_bytes = c->cur_frame_bytes;
-    if (frame_bytes <= 0)
-        return c->cur_pts;
-    else {
-        bytes_left = c->buffer_end - c->buffer_ptr;
-        bytes_sent = frame_bytes - bytes_left;
-        return c->cur_pts + (c->cur_frame_duration * bytes_sent) / frame_bytes;
-    }
-}
-
-
-static int http_prepare_data(HTTPContext *c)
-{
-    int i, len, ret;
-    AVFormatContext *ctx;
-
-    av_freep(&c->pb_buffer);
-    switch(c->state) {
-    case HTTPSTATE_SEND_DATA_HEADER:
-        memset(&c->fmt_ctx, 0, sizeof(c->fmt_ctx));
-        av_dict_set(&c->fmt_ctx.metadata, "author"   , c->stream->author   , 0);
-        av_dict_set(&c->fmt_ctx.metadata, "comment"  , c->stream->comment  , 0);
-        av_dict_set(&c->fmt_ctx.metadata, "copyright", c->stream->copyright, 0);
-        av_dict_set(&c->fmt_ctx.metadata, "title"    , c->stream->title    , 0);
-
-        c->fmt_ctx.streams = av_mallocz(sizeof(AVStream *) * c->stream->nb_streams);
-
-        for(i=0;i<c->stream->nb_streams;i++) {
-            AVStream *src;
-            c->fmt_ctx.streams[i] = av_mallocz(sizeof(AVStream));
-            /* if file or feed, then just take streams from FFStream struct */
-            if (!c->stream->feed ||
-                c->stream->feed == c->stream)
-                src = c->stream->streams[i];
-            else
-                src = c->stream->feed->streams[c->stream->feed_streams[i]];
-
-            *(c->fmt_ctx.streams[i]) = *src;
-            c->fmt_ctx.streams[i]->priv_data = 0;
-            c->fmt_ctx.streams[i]->codec->frame_number = 0; /* XXX: should be done in
-                                           AVStream, not in codec */
-        }
-        /* set output format parameters */
-        c->fmt_ctx.oformat = c->stream->fmt;
-        c->fmt_ctx.nb_streams = c->stream->nb_streams;
-
-        c->got_key_frame = 0;
-
-        /* prepare header and save header data in a stream */
-        if (avio_open_dyn_buf(&c->fmt_ctx.pb) < 0) {
-            /* XXX: potential leak */
-            return -1;
-        }
-        c->fmt_ctx.pb->seekable = 0;
-
-        /*
-         * HACK to avoid mpeg ps muxer to spit many underflow errors
-         * Default value from Libav
-         * Try to set it use configuration option
-         */
-        c->fmt_ctx.max_delay = (int)(0.7*AV_TIME_BASE);
-
-        if (avformat_write_header(&c->fmt_ctx, NULL) < 0) {
-            http_log("Error writing output header\n");
-            return -1;
-        }
-        av_dict_free(&c->fmt_ctx.metadata);
-
-        len = avio_close_dyn_buf(c->fmt_ctx.pb, &c->pb_buffer);
-        c->buffer_ptr = c->pb_buffer;
-        c->buffer_end = c->pb_buffer + len;
-
-        c->state = HTTPSTATE_SEND_DATA;
-        c->last_packet_sent = 0;
-        break;
-    case HTTPSTATE_SEND_DATA:
-        /* find a new packet */
-        /* read a packet from the input stream */
-        if (c->stream->feed)
-            ffm_set_write_index(c->fmt_in,
-                                c->stream->feed->feed_write_index,
-                                c->stream->feed->feed_size);
-
-        if (c->stream->max_time &&
-            c->stream->max_time + c->start_time - cur_time < 0)
-            /* We have timed out */
-            c->state = HTTPSTATE_SEND_DATA_TRAILER;
-        else {
-            AVPacket pkt;
-        redo:
-            ret = av_read_frame(c->fmt_in, &pkt);
-            if (ret < 0) {
-                if (c->stream->feed) {
-                    /* if coming from feed, it means we reached the end of the
-                       ffm file, so must wait for more data */
-                    c->state = HTTPSTATE_WAIT_FEED;
-                    return 1; /* state changed */
-                } else if (ret == AVERROR(EAGAIN)) {
-                    /* input not ready, come back later */
-                    return 0;
-                } else {
-                    if (c->stream->loop) {
-                        avformat_close_input(&c->fmt_in);
-                        if (open_input_stream(c, "") < 0)
-                            goto no_loop;
-                        goto redo;
-                    } else {
-                    no_loop:
-                        /* must send trailer now because eof or error */
-                        c->state = HTTPSTATE_SEND_DATA_TRAILER;
-                    }
-                }
-            } else {
-                int source_index = pkt.stream_index;
-                /* update first pts if needed */
-                if (c->first_pts == AV_NOPTS_VALUE) {
-                    c->first_pts = av_rescale_q(pkt.dts, c->fmt_in->streams[pkt.stream_index]->time_base, AV_TIME_BASE_Q);
-                    c->start_time = cur_time;
-                }
-                /* send it to the appropriate stream */
-                if (c->stream->feed) {
-                    /* if coming from a feed, select the right stream */
-                    if (c->switch_pending) {
-                        c->switch_pending = 0;
-                        for(i=0;i<c->stream->nb_streams;i++) {
-                            if (c->switch_feed_streams[i] == pkt.stream_index)
-                                if (pkt.flags & AV_PKT_FLAG_KEY)
-                                    c->switch_feed_streams[i] = -1;
-                            if (c->switch_feed_streams[i] >= 0)
-                                c->switch_pending = 1;
-                        }
-                    }
-                    for(i=0;i<c->stream->nb_streams;i++) {
-                        if (c->stream->feed_streams[i] == pkt.stream_index) {
-                            AVStream *st = c->fmt_in->streams[source_index];
-                            pkt.stream_index = i;
-                            if (pkt.flags & AV_PKT_FLAG_KEY &&
-                                (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
-                                 c->stream->nb_streams == 1))
-                                c->got_key_frame = 1;
-                            if (!c->stream->send_on_key || c->got_key_frame)
-                                goto send_it;
-                        }
-                    }
-                } else {
-                    AVCodecContext *codec;
-                    AVStream *ist, *ost;
-                send_it:
-                    ist = c->fmt_in->streams[source_index];
-                    /* specific handling for RTP: we use several
-                       output stream (one for each RTP
-                       connection). XXX: need more abstract handling */
-                    if (c->is_packetized) {
-                        /* compute send time and duration */
-                        c->cur_pts = av_rescale_q(pkt.dts, ist->time_base, AV_TIME_BASE_Q);
-                        c->cur_pts -= c->first_pts;
-                        c->cur_frame_duration = av_rescale_q(pkt.duration, ist->time_base, AV_TIME_BASE_Q);
-                        /* find RTP context */
-                        c->packet_stream_index = pkt.stream_index;
-                        ctx = c->rtp_ctx[c->packet_stream_index];
-                        if(!ctx) {
-                            av_free_packet(&pkt);
-                            break;
-                        }
-                        codec = ctx->streams[0]->codec;
-                        /* only one stream per RTP connection */
-                        pkt.stream_index = 0;
-                    } else {
-                        ctx = &c->fmt_ctx;
-                        /* Fudge here */
-                        codec = ctx->streams[pkt.stream_index]->codec;
-                    }
-
-                    if (c->is_packetized) {
-                        int max_packet_size;
-                        if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP)
-                            max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
-                        else
-                            max_packet_size = c->rtp_handles[c->packet_stream_index]->max_packet_size;
-                        ret = ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size);
-                    } else {
-                        ret = avio_open_dyn_buf(&ctx->pb);
-                    }
-                    if (ret < 0) {
-                        /* XXX: potential leak */
-                        return -1;
-                    }
-                    ost = ctx->streams[pkt.stream_index];
-
-                    ctx->pb->seekable = 0;
-                    if (pkt.dts != AV_NOPTS_VALUE)
-                        pkt.dts = av_rescale_q(pkt.dts, ist->time_base, ost->time_base);
-                    if (pkt.pts != AV_NOPTS_VALUE)
-                        pkt.pts = av_rescale_q(pkt.pts, ist->time_base, ost->time_base);
-                    pkt.duration = av_rescale_q(pkt.duration, ist->time_base, ost->time_base);
-                    if (av_write_frame(ctx, &pkt) < 0) {
-                        http_log("Error writing frame to output\n");
-                        c->state = HTTPSTATE_SEND_DATA_TRAILER;
-                    }
-
-                    len = avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
-                    c->cur_frame_bytes = len;
-                    c->buffer_ptr = c->pb_buffer;
-                    c->buffer_end = c->pb_buffer + len;
-
-                    codec->frame_number++;
-                    if (len == 0) {
-                        av_free_packet(&pkt);
-                        goto redo;
-                    }
-                }
-                av_free_packet(&pkt);
-            }
-        }
-        break;
-    default:
-    case HTTPSTATE_SEND_DATA_TRAILER:
-        /* last packet test ? */
-        if (c->last_packet_sent || c->is_packetized)
-            return -1;
-        ctx = &c->fmt_ctx;
-        /* prepare header */
-        if (avio_open_dyn_buf(&ctx->pb) < 0) {
-            /* XXX: potential leak */
-            return -1;
-        }
-        c->fmt_ctx.pb->seekable = 0;
-        av_write_trailer(ctx);
-        len = avio_close_dyn_buf(ctx->pb, &c->pb_buffer);
-        c->buffer_ptr = c->pb_buffer;
-        c->buffer_end = c->pb_buffer + len;
-
-        c->last_packet_sent = 1;
-        break;
-    }
-    return 0;
-}
-
-/* should convert the format at the same time */
-/* send data starting at c->buffer_ptr to the output connection
-   (either UDP or TCP connection) */
-static int http_send_data(HTTPContext *c)
-{
-    int len, ret;
-
-    for(;;) {
-        if (c->buffer_ptr >= c->buffer_end) {
-            ret = http_prepare_data(c);
-            if (ret < 0)
-                return -1;
-            else if (ret != 0)
-                /* state change requested */
-                break;
-        } else {
-            if (c->is_packetized) {
-                /* RTP data output */
-                len = c->buffer_end - c->buffer_ptr;
-                if (len < 4) {
-                    /* fail safe - should never happen */
-                fail1:
-                    c->buffer_ptr = c->buffer_end;
-                    return 0;
-                }
-                len = (c->buffer_ptr[0] << 24) |
-                    (c->buffer_ptr[1] << 16) |
-                    (c->buffer_ptr[2] << 8) |
-                    (c->buffer_ptr[3]);
-                if (len > (c->buffer_end - c->buffer_ptr))
-                    goto fail1;
-                if ((get_packet_send_clock(c) - get_server_clock(c)) > 0) {
-                    /* nothing to send yet: we can wait */
-                    return 0;
-                }
-
-                c->data_count += len;
-                update_datarate(&c->datarate, c->data_count);
-                if (c->stream)
-                    c->stream->bytes_served += len;
-
-                if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP) {
-                    /* RTP packets are sent inside the RTSP TCP connection */
-                    AVIOContext *pb;
-                    int interleaved_index, size;
-                    uint8_t header[4];
-                    HTTPContext *rtsp_c;
-
-                    rtsp_c = c->rtsp_c;
-                    /* if no RTSP connection left, error */
-                    if (!rtsp_c)
-                        return -1;
-                    /* if already sending something, then wait. */
-                    if (rtsp_c->state != RTSPSTATE_WAIT_REQUEST)
-                        break;
-                    if (avio_open_dyn_buf(&pb) < 0)
-                        goto fail1;
-                    interleaved_index = c->packet_stream_index * 2;
-                    /* RTCP packets are sent at odd indexes */
-                    if (c->buffer_ptr[1] == 200)
-                        interleaved_index++;
-                    /* write RTSP TCP header */
-                    header[0] = '$';
-                    header[1] = interleaved_index;
-                    header[2] = len >> 8;
-                    header[3] = len;
-                    avio_write(pb, header, 4);
-                    /* write RTP packet data */
-                    c->buffer_ptr += 4;
-                    avio_write(pb, c->buffer_ptr, len);
-                    size = avio_close_dyn_buf(pb, &c->packet_buffer);
-                    /* prepare asynchronous TCP sending */
-                    rtsp_c->packet_buffer_ptr = c->packet_buffer;
-                    rtsp_c->packet_buffer_end = c->packet_buffer + size;
-                    c->buffer_ptr += len;
-
-                    /* send everything we can NOW */
-                    len = send(rtsp_c->fd, rtsp_c->packet_buffer_ptr,
-                                rtsp_c->packet_buffer_end - rtsp_c->packet_buffer_ptr, 0);
-                    if (len > 0)
-                        rtsp_c->packet_buffer_ptr += len;
-                    if (rtsp_c->packet_buffer_ptr < rtsp_c->packet_buffer_end) {
-                        /* if we could not send all the data, we will
-                           send it later, so a new state is needed to
-                           "lock" the RTSP TCP connection */
-                        rtsp_c->state = RTSPSTATE_SEND_PACKET;
-                        break;
-                    } else
-                        /* all data has been sent */
-                        av_freep(&c->packet_buffer);
-                } else {
-                    /* send RTP packet directly in UDP */
-                    c->buffer_ptr += 4;
-                    ffurl_write(c->rtp_handles[c->packet_stream_index],
-                                c->buffer_ptr, len);
-                    c->buffer_ptr += len;
-                    /* here we continue as we can send several packets per 10 ms slot */
-                }
-            } else {
-                /* TCP data output */
-                len = send(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr, 0);
-                if (len < 0) {
-                    if (ff_neterrno() != AVERROR(EAGAIN) &&
-                        ff_neterrno() != AVERROR(EINTR))
-                        /* error : close connection */
-                        return -1;
-                    else
-                        return 0;
-                } else
-                    c->buffer_ptr += len;
-
-                c->data_count += len;
-                update_datarate(&c->datarate, c->data_count);
-                if (c->stream)
-                    c->stream->bytes_served += len;
-                break;
-            }
-        }
-    } /* for(;;) */
-    return 0;
-}
-
-static int http_start_receive_data(HTTPContext *c)
-{
-    int fd;
-
-    if (c->stream->feed_opened)
-        return -1;
-
-    /* Don't permit writing to this one */
-    if (c->stream->readonly)
-        return -1;
-
-    /* open feed */
-    fd = open(c->stream->feed_filename, O_RDWR);
-    if (fd < 0) {
-        http_log("Error opening feeder file: %s\n", strerror(errno));
-        return -1;
-    }
-    c->feed_fd = fd;
-
-    if (c->stream->truncate) {
-        /* truncate feed file */
-        ffm_write_write_index(c->feed_fd, FFM_PACKET_SIZE);
-        http_log("Truncating feed file '%s'\n", c->stream->feed_filename);
-        if (ftruncate(c->feed_fd, FFM_PACKET_SIZE) < 0) {
-            http_log("Error truncating feed file: %s\n", strerror(errno));
-            return -1;
-        }
-    } else {
-        if ((c->stream->feed_write_index = ffm_read_write_index(fd)) < 0) {
-            http_log("Error reading write index from feed file: %s\n", strerror(errno));
-            return -1;
-        }
-    }
-
-    c->stream->feed_write_index = FFMAX(ffm_read_write_index(fd), FFM_PACKET_SIZE);
-    c->stream->feed_size = lseek(fd, 0, SEEK_END);
-    lseek(fd, 0, SEEK_SET);
-
-    /* init buffer input */
-    c->buffer_ptr = c->buffer;
-    c->buffer_end = c->buffer + FFM_PACKET_SIZE;
-    c->stream->feed_opened = 1;
-    c->chunked_encoding = !!av_stristr(c->buffer, "Transfer-Encoding: chunked");
-    return 0;
-}
-
-static int http_receive_data(HTTPContext *c)
-{
-    HTTPContext *c1;
-    int len, loop_run = 0;
-
-    while (c->chunked_encoding && !c->chunk_size &&
-           c->buffer_end > c->buffer_ptr) {
-        /* read chunk header, if present */
-        len = recv(c->fd, c->buffer_ptr, 1, 0);
-
-        if (len < 0) {
-            if (ff_neterrno() != AVERROR(EAGAIN) &&
-                ff_neterrno() != AVERROR(EINTR))
-                /* error : close connection */
-                goto fail;
-            return 0;
-        } else if (len == 0) {
-            /* end of connection : close it */
-            goto fail;
-        } else if (c->buffer_ptr - c->buffer >= 2 &&
-                   !memcmp(c->buffer_ptr - 1, "\r\n", 2)) {
-            c->chunk_size = strtol(c->buffer, 0, 16);
-            if (c->chunk_size == 0) // end of stream
-                goto fail;
-            c->buffer_ptr = c->buffer;
-            break;
-        } else if (++loop_run > 10) {
-            /* no chunk header, abort */
-            goto fail;
-        } else {
-            c->buffer_ptr++;
-        }
-    }
-
-    if (c->buffer_end > c->buffer_ptr) {
-        len = recv(c->fd, c->buffer_ptr,
-                   FFMIN(c->chunk_size, c->buffer_end - c->buffer_ptr), 0);
-        if (len < 0) {
-            if (ff_neterrno() != AVERROR(EAGAIN) &&
-                ff_neterrno() != AVERROR(EINTR))
-                /* error : close connection */
-                goto fail;
-        } else if (len == 0)
-            /* end of connection : close it */
-            goto fail;
-        else {
-            c->chunk_size -= len;
-            c->buffer_ptr += len;
-            c->data_count += len;
-            update_datarate(&c->datarate, c->data_count);
-        }
-    }
-
-    if (c->buffer_ptr - c->buffer >= 2 && c->data_count > FFM_PACKET_SIZE) {
-        if (c->buffer[0] != 'f' ||
-            c->buffer[1] != 'm') {
-            http_log("Feed stream has become desynchronized -- disconnecting\n");
-            goto fail;
-        }
-    }
-
-    if (c->buffer_ptr >= c->buffer_end) {
-        FFStream *feed = c->stream;
-        /* a packet has been received : write it in the store, except
-           if header */
-        if (c->data_count > FFM_PACKET_SIZE) {
-            /* XXX: use llseek or url_seek */
-            lseek(c->feed_fd, feed->feed_write_index, SEEK_SET);
-            if (write(c->feed_fd, c->buffer, FFM_PACKET_SIZE) < 0) {
-                http_log("Error writing to feed file: %s\n", strerror(errno));
-                goto fail;
-            }
-
-            feed->feed_write_index += FFM_PACKET_SIZE;
-            /* update file size */
-            if (feed->feed_write_index > c->stream->feed_size)
-                feed->feed_size = feed->feed_write_index;
-
-            /* handle wrap around if max file size reached */
-            if (c->stream->feed_max_size && feed->feed_write_index >= c->stream->feed_max_size)
-                feed->feed_write_index = FFM_PACKET_SIZE;
-
-            /* write index */
-            if (ffm_write_write_index(c->feed_fd, feed->feed_write_index) < 0) {
-                http_log("Error writing index to feed file: %s\n", strerror(errno));
-                goto fail;
-            }
-
-            /* wake up any waiting connections */
-            for(c1 = first_http_ctx; c1 != NULL; c1 = c1->next) {
-                if (c1->state == HTTPSTATE_WAIT_FEED &&
-                    c1->stream->feed == c->stream->feed)
-                    c1->state = HTTPSTATE_SEND_DATA;
-            }
-        } else {
-            /* We have a header in our hands that contains useful data */
-            AVFormatContext *s = avformat_alloc_context();
-            AVIOContext *pb;
-            AVInputFormat *fmt_in;
-            int i;
-
-            if (!s)
-                goto fail;
-
-            /* use feed output format name to find corresponding input format */
-            fmt_in = av_find_input_format(feed->fmt->name);
-            if (!fmt_in)
-                goto fail;
-
-            pb = avio_alloc_context(c->buffer, c->buffer_end - c->buffer,
-                                    0, NULL, NULL, NULL, NULL);
-            pb->seekable = 0;
-
-            s->pb = pb;
-            if (avformat_open_input(&s, c->stream->feed_filename, fmt_in, NULL) < 0) {
-                av_free(pb);
-                goto fail;
-            }
-
-            /* Now we have the actual streams */
-            if (s->nb_streams != feed->nb_streams) {
-                avformat_close_input(&s);
-                av_free(pb);
-                http_log("Feed '%s' stream number does not match registered feed\n",
-                         c->stream->feed_filename);
-                goto fail;
-            }
-
-            for (i = 0; i < s->nb_streams; i++) {
-                AVStream *fst = feed->streams[i];
-                AVStream *st = s->streams[i];
-                avcodec_copy_context(fst->codec, st->codec);
-            }
-
-            avformat_close_input(&s);
-            av_free(pb);
-        }
-        c->buffer_ptr = c->buffer;
-    }
-
-    return 0;
- fail:
-    c->stream->feed_opened = 0;
-    close(c->feed_fd);
-    /* wake up any waiting connections to stop waiting for feed */
-    for(c1 = first_http_ctx; c1 != NULL; c1 = c1->next) {
-        if (c1->state == HTTPSTATE_WAIT_FEED &&
-            c1->stream->feed == c->stream->feed)
-            c1->state = HTTPSTATE_SEND_DATA_TRAILER;
-    }
-    return -1;
-}
-
-/********************************************************************/
-/* RTSP handling */
-
-static void rtsp_reply_header(HTTPContext *c, enum RTSPStatusCode error_number)
-{
-    const char *str;
-    time_t ti;
-    struct tm *tm;
-    char buf2[32];
-
-    switch(error_number) {
-    case RTSP_STATUS_OK:
-        str = "OK";
-        break;
-    case RTSP_STATUS_METHOD:
-        str = "Method Not Allowed";
-        break;
-    case RTSP_STATUS_BANDWIDTH:
-        str = "Not Enough Bandwidth";
-        break;
-    case RTSP_STATUS_SESSION:
-        str = "Session Not Found";
-        break;
-    case RTSP_STATUS_STATE:
-        str = "Method Not Valid in This State";
-        break;
-    case RTSP_STATUS_AGGREGATE:
-        str = "Aggregate operation not allowed";
-        break;
-    case RTSP_STATUS_ONLY_AGGREGATE:
-        str = "Only aggregate operation allowed";
-        break;
-    case RTSP_STATUS_TRANSPORT:
-        str = "Unsupported transport";
-        break;
-    case RTSP_STATUS_INTERNAL:
-        str = "Internal Server Error";
-        break;
-    case RTSP_STATUS_SERVICE:
-        str = "Service Unavailable";
-        break;
-    case RTSP_STATUS_VERSION:
-        str = "RTSP Version not supported";
-        break;
-    default:
-        str = "Unknown Error";
-        break;
-    }
-
-    avio_printf(c->pb, "RTSP/1.0 %d %s\r\n", error_number, str);
-    avio_printf(c->pb, "CSeq: %d\r\n", c->seq);
-
-    /* output GMT time */
-    ti = time(NULL);
-    tm = gmtime(&ti);
-    strftime(buf2, sizeof(buf2), "%a, %d %b %Y %H:%M:%S", tm);
-    avio_printf(c->pb, "Date: %s GMT\r\n", buf2);
-}
-
-static void rtsp_reply_error(HTTPContext *c, enum RTSPStatusCode error_number)
-{
-    rtsp_reply_header(c, error_number);
-    avio_printf(c->pb, "\r\n");
-}
-
-static int rtsp_parse_request(HTTPContext *c)
-{
-    const char *p, *p1, *p2;
-    char cmd[32];
-    char url[1024];
-    char protocol[32];
-    char line[1024];
-    int len;
-    RTSPMessageHeader header1 = { 0 }, *header = &header1;
-
-    c->buffer_ptr[0] = '\0';
-    p = c->buffer;
-
-    get_word(cmd, sizeof(cmd), &p);
-    get_word(url, sizeof(url), &p);
-    get_word(protocol, sizeof(protocol), &p);
-
-    av_strlcpy(c->method, cmd, sizeof(c->method));
-    av_strlcpy(c->url, url, sizeof(c->url));
-    av_strlcpy(c->protocol, protocol, sizeof(c->protocol));
-
-    if (avio_open_dyn_buf(&c->pb) < 0) {
-        /* XXX: cannot do more */
-        c->pb = NULL; /* safety */
-        return -1;
-    }
-
-    /* check version name */
-    if (strcmp(protocol, "RTSP/1.0") != 0) {
-        rtsp_reply_error(c, RTSP_STATUS_VERSION);
-        goto the_end;
-    }
-
-    /* parse each header line */
-    /* skip to next line */
-    while (*p != '\n' && *p != '\0')
-        p++;
-    if (*p == '\n')
-        p++;
-    while (*p != '\0') {
-        p1 = memchr(p, '\n', (char *)c->buffer_ptr - p);
-        if (!p1)
-            break;
-        p2 = p1;
-        if (p2 > p && p2[-1] == '\r')
-            p2--;
-        /* skip empty line */
-        if (p2 == p)
-            break;
-        len = p2 - p;
-        if (len > sizeof(line) - 1)
-            len = sizeof(line) - 1;
-        memcpy(line, p, len);
-        line[len] = '\0';
-        ff_rtsp_parse_line(header, line, NULL, NULL);
-        p = p1 + 1;
-    }
-
-    /* handle sequence number */
-    c->seq = header->seq;
-
-    if (!strcmp(cmd, "DESCRIBE"))
-        rtsp_cmd_describe(c, url);
-    else if (!strcmp(cmd, "OPTIONS"))
-        rtsp_cmd_options(c, url);
-    else if (!strcmp(cmd, "SETUP"))
-        rtsp_cmd_setup(c, url, header);
-    else if (!strcmp(cmd, "PLAY"))
-        rtsp_cmd_play(c, url, header);
-    else if (!strcmp(cmd, "PAUSE"))
-        rtsp_cmd_pause(c, url, header);
-    else if (!strcmp(cmd, "TEARDOWN"))
-        rtsp_cmd_teardown(c, url, header);
-    else
-        rtsp_reply_error(c, RTSP_STATUS_METHOD);
-
- the_end:
-    len = avio_close_dyn_buf(c->pb, &c->pb_buffer);
-    c->pb = NULL; /* safety */
-    if (len < 0) {
-        /* XXX: cannot do more */
-        return -1;
-    }
-    c->buffer_ptr = c->pb_buffer;
-    c->buffer_end = c->pb_buffer + len;
-    c->state = RTSPSTATE_SEND_REPLY;
-    return 0;
-}
-
-static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
-                                   struct in_addr my_ip)
-{
-    AVFormatContext *avc;
-    AVStream *avs = NULL;
-    int i;
-
-    avc =  avformat_alloc_context();
-    if (avc == NULL) {
-        return -1;
-    }
-    av_dict_set(&avc->metadata, "title",
-               stream->title[0] ? stream->title : "No Title", 0);
-    avc->nb_streams = stream->nb_streams;
-    if (stream->is_multicast) {
-        snprintf(avc->filename, 1024, "rtp://%s:%d?multicast=1?ttl=%d",
-                 inet_ntoa(stream->multicast_ip),
-                 stream->multicast_port, stream->multicast_ttl);
-    } else {
-        snprintf(avc->filename, 1024, "rtp://0.0.0.0");
-    }
-
-    if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) ||
-        !(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams))))
-        goto sdp_done;
-    if (avc->nb_streams >= INT_MAX/sizeof(*avs) ||
-        !(avs = av_malloc(avc->nb_streams * sizeof(*avs))))
-        goto sdp_done;
-
-    for(i = 0; i < stream->nb_streams; i++) {
-        avc->streams[i] = &avs[i];
-        avc->streams[i]->codec = stream->streams[i]->codec;
-    }
-    *pbuffer = av_mallocz(2048);
-    av_sdp_create(&avc, 1, *pbuffer, 2048);
-
- sdp_done:
-    av_free(avc->streams);
-    av_dict_free(&avc->metadata);
-    av_free(avc);
-    av_free(avs);
-
-    return strlen(*pbuffer);
-}
-
-static void rtsp_cmd_options(HTTPContext *c, const char *url)
-{
-//    rtsp_reply_header(c, RTSP_STATUS_OK);
-    avio_printf(c->pb, "RTSP/1.0 %d %s\r\n", RTSP_STATUS_OK, "OK");
-    avio_printf(c->pb, "CSeq: %d\r\n", c->seq);
-    avio_printf(c->pb, "Public: %s\r\n", "OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE");
-    avio_printf(c->pb, "\r\n");
-}
-
-static void rtsp_cmd_describe(HTTPContext *c, const char *url)
-{
-    FFStream *stream;
-    char path1[1024];
-    const char *path;
-    uint8_t *content;
-    int content_length;
-    socklen_t len;
-    struct sockaddr_in my_addr;
-
-    /* find which url is asked */
-    av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
-    path = path1;
-    if (*path == '/')
-        path++;
-
-    for(stream = first_stream; stream != NULL; stream = stream->next) {
-        if (!stream->is_feed &&
-            stream->fmt && !strcmp(stream->fmt->name, "rtp") &&
-            !strcmp(path, stream->filename)) {
-            goto found;
-        }
-    }
-    /* no stream found */
-    rtsp_reply_error(c, RTSP_STATUS_SERVICE); /* XXX: right error ? */
-    return;
-
- found:
-    /* prepare the media description in sdp format */
-
-    /* get the host IP */
-    len = sizeof(my_addr);
-    getsockname(c->fd, (struct sockaddr *)&my_addr, &len);
-    content_length = prepare_sdp_description(stream, &content, my_addr.sin_addr);
-    if (content_length < 0) {
-        rtsp_reply_error(c, RTSP_STATUS_INTERNAL);
-        return;
-    }
-    rtsp_reply_header(c, RTSP_STATUS_OK);
-    avio_printf(c->pb, "Content-Base: %s/\r\n", url);
-    avio_printf(c->pb, "Content-Type: application/sdp\r\n");
-    avio_printf(c->pb, "Content-Length: %d\r\n", content_length);
-    avio_printf(c->pb, "\r\n");
-    avio_write(c->pb, content, content_length);
-    av_free(content);
-}
-
-static HTTPContext *find_rtp_session(const char *session_id)
-{
-    HTTPContext *c;
-
-    if (session_id[0] == '\0')
-        return NULL;
-
-    for(c = first_http_ctx; c != NULL; c = c->next) {
-        if (!strcmp(c->session_id, session_id))
-            return c;
-    }
-    return NULL;
-}
-
-static RTSPTransportField *find_transport(RTSPMessageHeader *h, enum RTSPLowerTransport lower_transport)
-{
-    RTSPTransportField *th;
-    int i;
-
-    for(i=0;i<h->nb_transports;i++) {
-        th = &h->transports[i];
-        if (th->lower_transport == lower_transport)
-            return th;
-    }
-    return NULL;
-}
-
-static void rtsp_cmd_setup(HTTPContext *c, const char *url,
-                           RTSPMessageHeader *h)
-{
-    FFStream *stream;
-    int stream_index, rtp_port, rtcp_port;
-    char buf[1024];
-    char path1[1024];
-    const char *path;
-    HTTPContext *rtp_c;
-    RTSPTransportField *th;
-    struct sockaddr_in dest_addr;
-    RTSPActionServerSetup setup;
-
-    /* find which url is asked */
-    av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
-    path = path1;
-    if (*path == '/')
-        path++;
-
-    /* now check each stream */
-    for(stream = first_stream; stream != NULL; stream = stream->next) {
-        if (!stream->is_feed &&
-            stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
-            /* accept aggregate filenames only if single stream */
-            if (!strcmp(path, stream->filename)) {
-                if (stream->nb_streams != 1) {
-                    rtsp_reply_error(c, RTSP_STATUS_AGGREGATE);
-                    return;
-                }
-                stream_index = 0;
-                goto found;
-            }
-
-            for(stream_index = 0; stream_index < stream->nb_streams;
-                stream_index++) {
-                snprintf(buf, sizeof(buf), "%s/streamid=%d",
-                         stream->filename, stream_index);
-                if (!strcmp(path, buf))
-                    goto found;
-            }
-        }
-    }
-    /* no stream found */
-    rtsp_reply_error(c, RTSP_STATUS_SERVICE); /* XXX: right error ? */
-    return;
- found:
-
-    /* generate session id if needed */
-    if (h->session_id[0] == '\0')
-        snprintf(h->session_id, sizeof(h->session_id), "%08x%08x",
-                 av_lfg_get(&random_state), av_lfg_get(&random_state));
-
-    /* find rtp session, and create it if none found */
-    rtp_c = find_rtp_session(h->session_id);
-    if (!rtp_c) {
-        /* always prefer UDP */
-        th = find_transport(h, RTSP_LOWER_TRANSPORT_UDP);
-        if (!th) {
-            th = find_transport(h, RTSP_LOWER_TRANSPORT_TCP);
-            if (!th) {
-                rtsp_reply_error(c, RTSP_STATUS_TRANSPORT);
-                return;
-            }
-        }
-
-        rtp_c = rtp_new_connection(&c->from_addr, stream, h->session_id,
-                                   th->lower_transport);
-        if (!rtp_c) {
-            rtsp_reply_error(c, RTSP_STATUS_BANDWIDTH);
-            return;
-        }
-
-        /* open input stream */
-        if (open_input_stream(rtp_c, "") < 0) {
-            rtsp_reply_error(c, RTSP_STATUS_INTERNAL);
-            return;
-        }
-    }
-
-    /* test if stream is OK (test needed because several SETUP needs
-       to be done for a given file) */
-    if (rtp_c->stream != stream) {
-        rtsp_reply_error(c, RTSP_STATUS_SERVICE);
-        return;
-    }
-
-    /* test if stream is already set up */
-    if (rtp_c->rtp_ctx[stream_index]) {
-        rtsp_reply_error(c, RTSP_STATUS_STATE);
-        return;
-    }
-
-    /* check transport */
-    th = find_transport(h, rtp_c->rtp_protocol);
-    if (!th || (th->lower_transport == RTSP_LOWER_TRANSPORT_UDP &&
-                th->client_port_min <= 0)) {
-        rtsp_reply_error(c, RTSP_STATUS_TRANSPORT);
-        return;
-    }
-
-    /* setup default options */
-    setup.transport_option[0] = '\0';
-    dest_addr = rtp_c->from_addr;
-    dest_addr.sin_port = htons(th->client_port_min);
-
-    /* setup stream */
-    if (rtp_new_av_stream(rtp_c, stream_index, &dest_addr, c) < 0) {
-        rtsp_reply_error(c, RTSP_STATUS_TRANSPORT);
-        return;
-    }
-
-    /* now everything is OK, so we can send the connection parameters */
-    rtsp_reply_header(c, RTSP_STATUS_OK);
-    /* session ID */
-    avio_printf(c->pb, "Session: %s\r\n", rtp_c->session_id);
-
-    switch(rtp_c->rtp_protocol) {
-    case RTSP_LOWER_TRANSPORT_UDP:
-        rtp_port = ff_rtp_get_local_rtp_port(rtp_c->rtp_handles[stream_index]);
-        rtcp_port = ff_rtp_get_local_rtcp_port(rtp_c->rtp_handles[stream_index]);
-        avio_printf(c->pb, "Transport: RTP/AVP/UDP;unicast;"
-                    "client_port=%d-%d;server_port=%d-%d",
-                    th->client_port_min, th->client_port_max,
-                    rtp_port, rtcp_port);
-        break;
-    case RTSP_LOWER_TRANSPORT_TCP:
-        avio_printf(c->pb, "Transport: RTP/AVP/TCP;interleaved=%d-%d",
-                    stream_index * 2, stream_index * 2 + 1);
-        break;
-    default:
-        break;
-    }
-    if (setup.transport_option[0] != '\0')
-        avio_printf(c->pb, ";%s", setup.transport_option);
-    avio_printf(c->pb, "\r\n");
-
-
-    avio_printf(c->pb, "\r\n");
-}
-
-
-/* find an rtp connection by using the session ID. Check consistency
-   with filename */
-static HTTPContext *find_rtp_session_with_url(const char *url,
-                                              const char *session_id)
-{
-    HTTPContext *rtp_c;
-    char path1[1024];
-    const char *path;
-    char buf[1024];
-    int s, len;
-
-    rtp_c = find_rtp_session(session_id);
-    if (!rtp_c)
-        return NULL;
-
-    /* find which url is asked */
-    av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
-    path = path1;
-    if (*path == '/')
-        path++;
-    if(!strcmp(path, rtp_c->stream->filename)) return rtp_c;
-    for(s=0; s<rtp_c->stream->nb_streams; ++s) {
-      snprintf(buf, sizeof(buf), "%s/streamid=%d",
-        rtp_c->stream->filename, s);
-      if(!strncmp(path, buf, sizeof(buf))) {
-    // XXX: Should we reply with RTSP_STATUS_ONLY_AGGREGATE if nb_streams>1?
-        return rtp_c;
-      }
-    }
-    len = strlen(path);
-    if (len > 0 && path[len - 1] == '/' &&
-        !strncmp(path, rtp_c->stream->filename, len - 1))
-        return rtp_c;
-    return NULL;
-}
-
-static void rtsp_cmd_play(HTTPContext *c, const char *url, RTSPMessageHeader *h)
-{
-    HTTPContext *rtp_c;
-
-    rtp_c = find_rtp_session_with_url(url, h->session_id);
-    if (!rtp_c) {
-        rtsp_reply_error(c, RTSP_STATUS_SESSION);
-        return;
-    }
-
-    if (rtp_c->state != HTTPSTATE_SEND_DATA &&
-        rtp_c->state != HTTPSTATE_WAIT_FEED &&
-        rtp_c->state != HTTPSTATE_READY) {
-        rtsp_reply_error(c, RTSP_STATUS_STATE);
-        return;
-    }
-
-    rtp_c->state = HTTPSTATE_SEND_DATA;
-
-    /* now everything is OK, so we can send the connection parameters */
-    rtsp_reply_header(c, RTSP_STATUS_OK);
-    /* session ID */
-    avio_printf(c->pb, "Session: %s\r\n", rtp_c->session_id);
-    avio_printf(c->pb, "\r\n");
-}
-
-static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPMessageHeader *h)
-{
-    HTTPContext *rtp_c;
-
-    rtp_c = find_rtp_session_with_url(url, h->session_id);
-    if (!rtp_c) {
-        rtsp_reply_error(c, RTSP_STATUS_SESSION);
-        return;
-    }
-
-    if (rtp_c->state != HTTPSTATE_SEND_DATA &&
-        rtp_c->state != HTTPSTATE_WAIT_FEED) {
-        rtsp_reply_error(c, RTSP_STATUS_STATE);
-        return;
-    }
-
-    rtp_c->state = HTTPSTATE_READY;
-    rtp_c->first_pts = AV_NOPTS_VALUE;
-    /* now everything is OK, so we can send the connection parameters */
-    rtsp_reply_header(c, RTSP_STATUS_OK);
-    /* session ID */
-    avio_printf(c->pb, "Session: %s\r\n", rtp_c->session_id);
-    avio_printf(c->pb, "\r\n");
-}
-
-static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPMessageHeader *h)
-{
-    HTTPContext *rtp_c;
-
-    rtp_c = find_rtp_session_with_url(url, h->session_id);
-    if (!rtp_c) {
-        rtsp_reply_error(c, RTSP_STATUS_SESSION);
-        return;
-    }
-
-    /* now everything is OK, so we can send the connection parameters */
-    rtsp_reply_header(c, RTSP_STATUS_OK);
-    /* session ID */
-    avio_printf(c->pb, "Session: %s\r\n", rtp_c->session_id);
-    avio_printf(c->pb, "\r\n");
-
-    /* abort the session */
-    close_connection(rtp_c);
-}
-
-
-/********************************************************************/
-/* RTP handling */
-
-static HTTPContext *rtp_new_connection(struct sockaddr_in *from_addr,
-                                       FFStream *stream, const char *session_id,
-                                       enum RTSPLowerTransport rtp_protocol)
-{
-    HTTPContext *c = NULL;
-    const char *proto_str;
-
-    /* XXX: should output a warning page when coming
-       close to the connection limit */
-    if (nb_connections >= nb_max_connections)
-        goto fail;
-
-    /* add a new connection */
-    c = av_mallocz(sizeof(HTTPContext));
-    if (!c)
-        goto fail;
-
-    c->fd = -1;
-    c->poll_entry = NULL;
-    c->from_addr = *from_addr;
-    c->buffer_size = IOBUFFER_INIT_SIZE;
-    c->buffer = av_malloc(c->buffer_size);
-    if (!c->buffer)
-        goto fail;
-    nb_connections++;
-    c->stream = stream;
-    av_strlcpy(c->session_id, session_id, sizeof(c->session_id));
-    c->state = HTTPSTATE_READY;
-    c->is_packetized = 1;
-    c->rtp_protocol = rtp_protocol;
-
-    /* protocol is shown in statistics */
-    switch(c->rtp_protocol) {
-    case RTSP_LOWER_TRANSPORT_UDP_MULTICAST:
-        proto_str = "MCAST";
-        break;
-    case RTSP_LOWER_TRANSPORT_UDP:
-        proto_str = "UDP";
-        break;
-    case RTSP_LOWER_TRANSPORT_TCP:
-        proto_str = "TCP";
-        break;
-    default:
-        proto_str = "???";
-        break;
-    }
-    av_strlcpy(c->protocol, "RTP/", sizeof(c->protocol));
-    av_strlcat(c->protocol, proto_str, sizeof(c->protocol));
-
-    current_bandwidth += stream->bandwidth;
-
-    c->next = first_http_ctx;
-    first_http_ctx = c;
-    return c;
-
- fail:
-    if (c) {
-        av_free(c->buffer);
-        av_free(c);
-    }
-    return NULL;
-}
-
-/* add a new RTP stream in an RTP connection (used in RTSP SETUP
-   command). If RTP/TCP protocol is used, TCP connection 'rtsp_c' is
-   used. */
-static int rtp_new_av_stream(HTTPContext *c,
-                             int stream_index, struct sockaddr_in *dest_addr,
-                             HTTPContext *rtsp_c)
-{
-    AVFormatContext *ctx;
-    AVStream *st;
-    char *ipaddr;
-    URLContext *h = NULL;
-    uint8_t *dummy_buf;
-    int max_packet_size;
-
-    /* now we can open the relevant output stream */
-    ctx = avformat_alloc_context();
-    if (!ctx)
-        return -1;
-    ctx->oformat = av_guess_format("rtp", NULL, NULL);
-
-    st = av_mallocz(sizeof(AVStream));
-    if (!st)
-        goto fail;
-    ctx->nb_streams = 1;
-    ctx->streams = av_mallocz(sizeof(AVStream *) * ctx->nb_streams);
-    if (!ctx->streams)
-      goto fail;
-    ctx->streams[0] = st;
-
-    if (!c->stream->feed ||
-        c->stream->feed == c->stream)
-        memcpy(st, c->stream->streams[stream_index], sizeof(AVStream));
-    else
-        memcpy(st,
-               c->stream->feed->streams[c->stream->feed_streams[stream_index]],
-               sizeof(AVStream));
-    st->priv_data = NULL;
-
-    /* build destination RTP address */
-    ipaddr = inet_ntoa(dest_addr->sin_addr);
-
-    switch(c->rtp_protocol) {
-    case RTSP_LOWER_TRANSPORT_UDP:
-    case RTSP_LOWER_TRANSPORT_UDP_MULTICAST:
-        /* RTP/UDP case */
-
-        /* XXX: also pass as parameter to function ? */
-        if (c->stream->is_multicast) {
-            int ttl;
-            ttl = c->stream->multicast_ttl;
-            if (!ttl)
-                ttl = 16;
-            snprintf(ctx->filename, sizeof(ctx->filename),
-                     "rtp://%s:%d?multicast=1&ttl=%d",
-                     ipaddr, ntohs(dest_addr->sin_port), ttl);
-        } else {
-            snprintf(ctx->filename, sizeof(ctx->filename),
-                     "rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));
-        }
-
-        if (ffurl_open(&h, ctx->filename, AVIO_FLAG_WRITE, NULL, NULL) < 0)
-            goto fail;
-        c->rtp_handles[stream_index] = h;
-        max_packet_size = h->max_packet_size;
-        break;
-    case RTSP_LOWER_TRANSPORT_TCP:
-        /* RTP/TCP case */
-        c->rtsp_c = rtsp_c;
-        max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
-        break;
-    default:
-        goto fail;
-    }
-
-    http_log("%s:%d - - \"PLAY %s/streamid=%d %s\"\n",
-             ipaddr, ntohs(dest_addr->sin_port),
-             c->stream->filename, stream_index, c->protocol);
-
-    /* normally, no packets should be output here, but the packet size may be checked */
-    if (ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size) < 0) {
-        /* XXX: close stream */
-        goto fail;
-    }
-    if (avformat_write_header(ctx, NULL) < 0) {
-    fail:
-        if (h)
-            ffurl_close(h);
-        av_free(ctx);
-        return -1;
-    }
-    avio_close_dyn_buf(ctx->pb, &dummy_buf);
-    av_free(dummy_buf);
-
-    c->rtp_ctx[stream_index] = ctx;
-    return 0;
-}
-
-/********************************************************************/
-/* avserver initialization */
-
-static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int copy)
-{
-    AVStream *fst;
-
-    fst = av_mallocz(sizeof(AVStream));
-    if (!fst)
-        return NULL;
-    if (copy) {
-        fst->codec = avcodec_alloc_context3(NULL);
-        memcpy(fst->codec, codec, sizeof(AVCodecContext));
-        if (codec->extradata_size) {
-            fst->codec->extradata = av_malloc(codec->extradata_size);
-            memcpy(fst->codec->extradata, codec->extradata,
-                codec->extradata_size);
-        }
-    } else {
-        /* live streams must use the actual feed's codec since it may be
-         * updated later to carry extradata needed by the streams.
-         */
-        fst->codec = codec;
-    }
-    fst->priv_data = av_mallocz(sizeof(FeedData));
-    fst->index = stream->nb_streams;
-    avpriv_set_pts_info(fst, 33, 1, 90000);
-    fst->sample_aspect_ratio = codec->sample_aspect_ratio;
-    stream->streams[stream->nb_streams++] = fst;
-    return fst;
-}
-
-/* return the stream number in the feed */
-static int add_av_stream(FFStream *feed, AVStream *st)
-{
-    AVStream *fst;
-    AVCodecContext *av, *av1;
-    int i;
-
-    av = st->codec;
-    for(i=0;i<feed->nb_streams;i++) {
-        st = feed->streams[i];
-        av1 = st->codec;
-        if (av1->codec_id == av->codec_id &&
-            av1->codec_type == av->codec_type &&
-            av1->bit_rate == av->bit_rate) {
-
-            switch(av->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-                if (av1->channels == av->channels &&
-                    av1->sample_rate == av->sample_rate)
-                    return i;
-                break;
-            case AVMEDIA_TYPE_VIDEO:
-                if (av1->width == av->width &&
-                    av1->height == av->height &&
-                    av1->time_base.den == av->time_base.den &&
-                    av1->time_base.num == av->time_base.num &&
-                    av1->gop_size == av->gop_size)
-                    return i;
-                break;
-            default:
-                abort();
-            }
-        }
-    }
-
-    fst = add_av_stream1(feed, av, 0);
-    if (!fst)
-        return -1;
-    return feed->nb_streams - 1;
-}
-
-static void remove_stream(FFStream *stream)
-{
-    FFStream **ps;
-    ps = &first_stream;
-    while (*ps != NULL) {
-        if (*ps == stream)
-            *ps = (*ps)->next;
-        else
-            ps = &(*ps)->next;
-    }
-}
-
-/* specific mpeg4 handling : we extract the raw parameters */
-static void extract_mpeg4_header(AVFormatContext *infile)
-{
-    int mpeg4_count, i, size;
-    AVPacket pkt;
-    AVStream *st;
-    const uint8_t *p;
-
-    infile->flags |= AVFMT_FLAG_NOFILLIN | AVFMT_FLAG_NOPARSE;
-
-    mpeg4_count = 0;
-    for(i=0;i<infile->nb_streams;i++) {
-        st = infile->streams[i];
-        if (st->codec->codec_id == AV_CODEC_ID_MPEG4 &&
-            st->codec->extradata_size == 0) {
-            mpeg4_count++;
-        }
-    }
-    if (!mpeg4_count)
-        return;
-
-    printf("MPEG4 without extra data: trying to find header in %s\n", infile->filename);
-    while (mpeg4_count > 0) {
-        if (av_read_frame(infile, &pkt) < 0)
-            break;
-        st = infile->streams[pkt.stream_index];
-        if (st->codec->codec_id == AV_CODEC_ID_MPEG4 &&
-            st->codec->extradata_size == 0) {
-            av_freep(&st->codec->extradata);
-            /* fill extradata with the header */
-            /* XXX: we make hard suppositions here ! */
-            p = pkt.data;
-            while (p < pkt.data + pkt.size - 4) {
-                /* stop when vop header is found */
-                if (p[0] == 0x00 && p[1] == 0x00 &&
-                    p[2] == 0x01 && p[3] == 0xb6) {
-                    size = p - pkt.data;
-                    //                    av_hex_dump_log(infile, AV_LOG_DEBUG, pkt.data, size);
-                    st->codec->extradata = av_malloc(size);
-                    st->codec->extradata_size = size;
-                    memcpy(st->codec->extradata, pkt.data, size);
-                    break;
-                }
-                p++;
-            }
-            mpeg4_count--;
-        }
-        av_free_packet(&pkt);
-    }
-}
-
-/* compute the needed AVStream for each file */
-static void build_file_streams(void)
-{
-    FFStream *stream, *stream_next;
-    int i, ret;
-
-    /* gather all streams */
-    for(stream = first_stream; stream != NULL; stream = stream_next) {
-        AVFormatContext *infile = NULL;
-        stream_next = stream->next;
-        if (stream->stream_type == STREAM_TYPE_LIVE &&
-            !stream->feed) {
-            /* the stream comes from a file */
-            /* try to open the file */
-            /* open stream */
-            if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
-                /* specific case : if transport stream output to RTP,
-                   we use a raw transport stream reader */
-                av_dict_set(&stream->in_opts, "mpeg2ts_compute_pcr", "1", 0);
-            }
-
-            http_log("Opening file '%s'\n", stream->feed_filename);
-            if ((ret = avformat_open_input(&infile, stream->feed_filename, stream->ifmt, &stream->in_opts)) < 0) {
-                http_log("Could not open '%s': %d\n", stream->feed_filename, ret);
-                /* remove stream (no need to spend more time on it) */
-            fail:
-                remove_stream(stream);
-            } else {
-                /* find all the AVStreams inside and reference them in
-                   'stream' */
-                if (avformat_find_stream_info(infile, NULL) < 0) {
-                    http_log("Could not find codec parameters from '%s'\n",
-                             stream->feed_filename);
-                    avformat_close_input(&infile);
-                    goto fail;
-                }
-                extract_mpeg4_header(infile);
-
-                for(i=0;i<infile->nb_streams;i++)
-                    add_av_stream1(stream, infile->streams[i]->codec, 1);
-
-                avformat_close_input(&infile);
-            }
-        }
-    }
-}
-
-/* compute the needed AVStream for each feed */
-static void build_feed_streams(void)
-{
-    FFStream *stream, *feed;
-    int i;
-
-    /* gather all streams */
-    for(stream = first_stream; stream != NULL; stream = stream->next) {
-        feed = stream->feed;
-        if (feed) {
-            if (stream->is_feed) {
-                for(i=0;i<stream->nb_streams;i++)
-                    stream->feed_streams[i] = i;
-            } else {
-                /* we handle a stream coming from a feed */
-                for(i=0;i<stream->nb_streams;i++)
-                    stream->feed_streams[i] = add_av_stream(feed, stream->streams[i]);
-            }
-        }
-    }
-
-    /* create feed files if needed */
-    for(feed = first_feed; feed != NULL; feed = feed->next_feed) {
-        int fd;
-
-        if (avio_check(feed->feed_filename, AVIO_FLAG_READ) > 0) {
-            /* See if it matches */
-            AVFormatContext *s = NULL;
-            int matches = 0;
-
-            if (avformat_open_input(&s, feed->feed_filename, NULL, NULL) >= 0) {
-                /* Now see if it matches */
-                if (s->nb_streams == feed->nb_streams) {
-                    matches = 1;
-                    for(i=0;i<s->nb_streams;i++) {
-                        AVStream *sf, *ss;
-                        sf = feed->streams[i];
-                        ss = s->streams[i];
-
-                        if (sf->index != ss->index ||
-                            sf->id != ss->id) {
-                            http_log("Index & Id do not match for stream %d (%s)\n",
-                                   i, feed->feed_filename);
-                            matches = 0;
-                        } else {
-                            AVCodecContext *ccf, *ccs;
-
-                            ccf = sf->codec;
-                            ccs = ss->codec;
-#define CHECK_CODEC(x)  (ccf->x != ccs->x)
-
-                            if (CHECK_CODEC(codec_id) || CHECK_CODEC(codec_type)) {
-                                http_log("Codecs do not match for stream %d\n", i);
-                                matches = 0;
-                            } else if (CHECK_CODEC(bit_rate) || CHECK_CODEC(flags)) {
-                                http_log("Codec bitrates do not match for stream %d\n", i);
-                                matches = 0;
-                            } else if (ccf->codec_type == AVMEDIA_TYPE_VIDEO) {
-                                if (CHECK_CODEC(time_base.den) ||
-                                    CHECK_CODEC(time_base.num) ||
-                                    CHECK_CODEC(width) ||
-                                    CHECK_CODEC(height)) {
-                                    http_log("Codec width, height and framerate do not match for stream %d\n", i);
-                                    matches = 0;
-                                }
-                            } else if (ccf->codec_type == AVMEDIA_TYPE_AUDIO) {
-                                if (CHECK_CODEC(sample_rate) ||
-                                    CHECK_CODEC(channels) ||
-                                    CHECK_CODEC(frame_size)) {
-                                    http_log("Codec sample_rate, channels, frame_size do not match for stream %d\n", i);
-                                    matches = 0;
-                                }
-                            } else {
-                                http_log("Unknown codec type\n");
-                                matches = 0;
-                            }
-                        }
-                        if (!matches)
-                            break;
-                    }
-                } else
-                    http_log("Deleting feed file '%s' as stream counts differ (%d != %d)\n",
-                        feed->feed_filename, s->nb_streams, feed->nb_streams);
-
-                avformat_close_input(&s);
-            } else
-                http_log("Deleting feed file '%s' as it appears to be corrupt\n",
-                        feed->feed_filename);
-
-            if (!matches) {
-                if (feed->readonly) {
-                    http_log("Unable to delete feed file '%s' as it is marked readonly\n",
-                        feed->feed_filename);
-                    exit(1);
-                }
-                unlink(feed->feed_filename);
-            }
-        }
-        if (avio_check(feed->feed_filename, AVIO_FLAG_WRITE) <= 0) {
-            AVFormatContext s1 = {0}, *s = &s1;
-
-            if (feed->readonly) {
-                http_log("Unable to create feed file '%s' as it is marked readonly\n",
-                    feed->feed_filename);
-                exit(1);
-            }
-
-            /* only write the header of the ffm file */
-            if (avio_open(&s->pb, feed->feed_filename, AVIO_FLAG_WRITE) < 0) {
-                http_log("Could not open output feed file '%s'\n",
-                         feed->feed_filename);
-                exit(1);
-            }
-            s->oformat = feed->fmt;
-            s->nb_streams = feed->nb_streams;
-            s->streams = feed->streams;
-            if (avformat_write_header(s, NULL) < 0) {
-                http_log("Container doesn't supports the required parameters\n");
-                exit(1);
-            }
-            /* XXX: need better api */
-            av_freep(&s->priv_data);
-            avio_close(s->pb);
-        }
-        /* get feed size and write index */
-        fd = open(feed->feed_filename, O_RDONLY);
-        if (fd < 0) {
-            http_log("Could not open output feed file '%s'\n",
-                    feed->feed_filename);
-            exit(1);
-        }
-
-        feed->feed_write_index = FFMAX(ffm_read_write_index(fd), FFM_PACKET_SIZE);
-        feed->feed_size = lseek(fd, 0, SEEK_END);
-        /* ensure that we do not wrap before the end of file */
-        if (feed->feed_max_size && feed->feed_max_size < feed->feed_size)
-            feed->feed_max_size = feed->feed_size;
-
-        close(fd);
-    }
-}
-
-/* compute the bandwidth used by each stream */
-static void compute_bandwidth(void)
-{
-    unsigned bandwidth;
-    int i;
-    FFStream *stream;
-
-    for(stream = first_stream; stream != NULL; stream = stream->next) {
-        bandwidth = 0;
-        for(i=0;i<stream->nb_streams;i++) {
-            AVStream *st = stream->streams[i];
-            switch(st->codec->codec_type) {
-            case AVMEDIA_TYPE_AUDIO:
-            case AVMEDIA_TYPE_VIDEO:
-                bandwidth += st->codec->bit_rate;
-                break;
-            default:
-                break;
-            }
-        }
-        stream->bandwidth = (bandwidth + 999) / 1000;
-    }
-}
-
-/* add a codec and set the default parameters */
-static void add_codec(FFStream *stream, AVCodecContext *av)
-{
-    AVStream *st;
-
-    /* compute default parameters */
-    switch(av->codec_type) {
-    case AVMEDIA_TYPE_AUDIO:
-        if (av->bit_rate == 0)
-            av->bit_rate = 64000;
-        if (av->sample_rate == 0)
-            av->sample_rate = 22050;
-        if (av->channels == 0)
-            av->channels = 1;
-        break;
-    case AVMEDIA_TYPE_VIDEO:
-        if (av->bit_rate == 0)
-            av->bit_rate = 64000;
-        if (av->time_base.num == 0){
-            av->time_base.den = 5;
-            av->time_base.num = 1;
-        }
-        if (av->width == 0 || av->height == 0) {
-            av->width = 160;
-            av->height = 128;
-        }
-        /* Bitrate tolerance is less for streaming */
-        if (av->bit_rate_tolerance == 0)
-            av->bit_rate_tolerance = FFMAX(av->bit_rate / 4,
-                      (int64_t)av->bit_rate*av->time_base.num/av->time_base.den);
-        if (av->qmin == 0)
-            av->qmin = 3;
-        if (av->qmax == 0)
-            av->qmax = 31;
-        if (av->max_qdiff == 0)
-            av->max_qdiff = 3;
-        av->qcompress = 0.5;
-        av->qblur = 0.5;
-
-        if (!av->nsse_weight)
-            av->nsse_weight = 8;
-
-        av->frame_skip_cmp = FF_CMP_DCTMAX;
-        if (!av->me_method)
-            av->me_method = ME_EPZS;
-        av->rc_buffer_aggressivity = 1.0;
-
-        if (!av->rc_eq)
-            av->rc_eq = "tex^qComp";
-        if (!av->i_quant_factor)
-            av->i_quant_factor = -0.8;
-        if (!av->b_quant_factor)
-            av->b_quant_factor = 1.25;
-        if (!av->b_quant_offset)
-            av->b_quant_offset = 1.25;
-        if (!av->rc_max_rate)
-            av->rc_max_rate = av->bit_rate * 2;
-
-        if (av->rc_max_rate && !av->rc_buffer_size) {
-            av->rc_buffer_size = av->rc_max_rate;
-        }
-
-
-        break;
-    default:
-        abort();
-    }
-
-    st = av_mallocz(sizeof(AVStream));
-    if (!st)
-        return;
-    st->codec = avcodec_alloc_context3(NULL);
-    stream->streams[stream->nb_streams++] = st;
-    memcpy(st->codec, av, sizeof(AVCodecContext));
-}
-
-static enum AVCodecID opt_audio_codec(const char *arg)
-{
-    AVCodec *p= avcodec_find_encoder_by_name(arg);
-
-    if (p == NULL || p->type != AVMEDIA_TYPE_AUDIO)
-        return AV_CODEC_ID_NONE;
-
-    return p->id;
-}
-
-static enum AVCodecID opt_video_codec(const char *arg)
-{
-    AVCodec *p= avcodec_find_encoder_by_name(arg);
-
-    if (p == NULL || p->type != AVMEDIA_TYPE_VIDEO)
-        return AV_CODEC_ID_NONE;
-
-    return p->id;
-}
-
-static int avserver_opt_default(const char *opt, const char *arg,
-                       AVCodecContext *avctx, int type)
-{
-    int ret = 0;
-    const AVOption *o = av_opt_find(avctx, opt, NULL, type, 0);
-    if(o)
-        ret = av_opt_set(avctx, opt, arg, 0);
-    return ret;
-}
-
-static int avserver_opt_preset(const char *arg,
-                       AVCodecContext *avctx, int type,
-                       enum AVCodecID *audio_id, enum AVCodecID *video_id)
-{
-    FILE *f=NULL;
-    char filename[1000], tmp[1000], tmp2[1000], line[1000];
-    int ret = 0;
-    AVCodec *codec = avcodec_find_encoder(avctx->codec_id);
-
-    if (!(f = get_preset_file(filename, sizeof(filename), arg, 0,
-                              codec ? codec->name : NULL))) {
-        fprintf(stderr, "File for preset '%s' not found\n", arg);
-        return 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);
-            ret = 1;
-            break;
-        }
-        if(!strcmp(tmp, "acodec")){
-            *audio_id = opt_audio_codec(tmp2);
-        }else if(!strcmp(tmp, "vcodec")){
-            *video_id = opt_video_codec(tmp2);
-        }else if(!strcmp(tmp, "scodec")){
-            /* opt_subtitle_codec(tmp2); */
-        }else if(avserver_opt_default(tmp, tmp2, avctx, type) < 0){
-            fprintf(stderr, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n", filename, line, tmp, tmp2);
-            ret = 1;
-            break;
-        }
-    }
-
-    fclose(f);
-
-    return ret;
-}
-
-static AVOutputFormat *avserver_guess_format(const char *short_name, const char *filename,
-                                             const char *mime_type)
-{
-    AVOutputFormat *fmt = av_guess_format(short_name, filename, mime_type);
-
-    if (fmt) {
-        AVOutputFormat *stream_fmt;
-        char stream_format_name[64];
-
-        snprintf(stream_format_name, sizeof(stream_format_name), "%s_stream", fmt->name);
-        stream_fmt = av_guess_format(stream_format_name, NULL, NULL);
-
-        if (stream_fmt)
-            fmt = stream_fmt;
-    }
-
-    return fmt;
-}
-
-static void report_config_error(const char *filename, int line_num, int *errors, const char *fmt, ...)
-{
-    va_list vl;
-    va_start(vl, fmt);
-    fprintf(stderr, "%s:%d: ", filename, line_num);
-    vfprintf(stderr, fmt, vl);
-    va_end(vl);
-
-    (*errors)++;
-}
-
-static int parse_ffconfig(const char *filename)
-{
-    FILE *f;
-    char line[1024];
-    char cmd[64];
-    char arg[1024];
-    const char *p;
-    int val, errors, line_num;
-    FFStream **last_stream, *stream, *redirect;
-    FFStream **last_feed, *feed, *s;
-    AVCodecContext audio_enc, video_enc;
-    enum AVCodecID audio_id, video_id;
-
-    f = fopen(filename, "r");
-    if (!f) {
-        perror(filename);
-        return -1;
-    }
-
-    errors = 0;
-    line_num = 0;
-    first_stream = NULL;
-    last_stream = &first_stream;
-    first_feed = NULL;
-    last_feed = &first_feed;
-    stream = NULL;
-    feed = NULL;
-    redirect = NULL;
-    audio_id = AV_CODEC_ID_NONE;
-    video_id = AV_CODEC_ID_NONE;
-
-#define ERROR(...) report_config_error(filename, line_num, &errors, __VA_ARGS__)
-    for(;;) {
-        if (fgets(line, sizeof(line), f) == NULL)
-            break;
-        line_num++;
-        p = line;
-        while (av_isspace(*p))
-            p++;
-        if (*p == '\0' || *p == '#')
-            continue;
-
-        get_arg(cmd, sizeof(cmd), &p);
-
-        if (!av_strcasecmp(cmd, "Port")) {
-            get_arg(arg, sizeof(arg), &p);
-            val = atoi(arg);
-            if (val < 1 || val > 65536) {
-                ERROR("Invalid_port: %s\n", arg);
-            }
-            my_http_addr.sin_port = htons(val);
-        } else if (!av_strcasecmp(cmd, "BindAddress")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (resolve_host(&my_http_addr.sin_addr, arg) != 0) {
-                ERROR("%s:%d: Invalid host/IP address: %s\n", arg);
-            }
-        } else if (!av_strcasecmp(cmd, "RTSPPort")) {
-            get_arg(arg, sizeof(arg), &p);
-            val = atoi(arg);
-            if (val < 1 || val > 65536) {
-                ERROR("%s:%d: Invalid port: %s\n", arg);
-            }
-            my_rtsp_addr.sin_port = htons(atoi(arg));
-        } else if (!av_strcasecmp(cmd, "RTSPBindAddress")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (resolve_host(&my_rtsp_addr.sin_addr, arg) != 0) {
-                ERROR("Invalid host/IP address: %s\n", arg);
-            }
-        } else if (!av_strcasecmp(cmd, "MaxHTTPConnections")) {
-            get_arg(arg, sizeof(arg), &p);
-            val = atoi(arg);
-            if (val < 1 || val > 65536) {
-                ERROR("Invalid MaxHTTPConnections: %s\n", arg);
-            }
-            nb_max_http_connections = val;
-        } else if (!av_strcasecmp(cmd, "MaxClients")) {
-            get_arg(arg, sizeof(arg), &p);
-            val = atoi(arg);
-            if (val < 1 || val > nb_max_http_connections) {
-                ERROR("Invalid MaxClients: %s\n", arg);
-            } else {
-                nb_max_connections = val;
-            }
-        } else if (!av_strcasecmp(cmd, "MaxBandwidth")) {
-            int64_t llval;
-            get_arg(arg, sizeof(arg), &p);
-            llval = atoll(arg);
-            if (llval < 10 || llval > 10000000) {
-                ERROR("Invalid MaxBandwidth: %s\n", arg);
-            } else
-                max_bandwidth = llval;
-        } else if (!av_strcasecmp(cmd, "CustomLog")) {
-            if (!avserver_debug)
-                get_arg(logfilename, sizeof(logfilename), &p);
-        } else if (!av_strcasecmp(cmd, "<Feed")) {
-            /*********************************************/
-            /* Feed related options */
-            char *q;
-            if (stream || feed) {
-                ERROR("Already in a tag\n");
-            } else {
-                feed = av_mallocz(sizeof(FFStream));
-                get_arg(feed->filename, sizeof(feed->filename), &p);
-                q = strrchr(feed->filename, '>');
-                if (*q)
-                    *q = '\0';
-
-                for (s = first_feed; s; s = s->next) {
-                    if (!strcmp(feed->filename, s->filename)) {
-                        ERROR("Feed '%s' already registered\n", s->filename);
-                    }
-                }
-
-                feed->fmt = av_guess_format("ffm", NULL, NULL);
-                /* defaut feed file */
-                snprintf(feed->feed_filename, sizeof(feed->feed_filename),
-                         "/tmp/%s.ffm", feed->filename);
-                feed->feed_max_size = 5 * 1024 * 1024;
-                feed->is_feed = 1;
-                feed->feed = feed; /* self feeding :-) */
-
-                /* add in stream list */
-                *last_stream = feed;
-                last_stream = &feed->next;
-                /* add in feed list */
-                *last_feed = feed;
-                last_feed = &feed->next_feed;
-            }
-        } else if (!av_strcasecmp(cmd, "Launch")) {
-            if (feed) {
-                int i;
-
-                feed->child_argv = av_mallocz(64 * sizeof(char *));
-
-                for (i = 0; i < 62; i++) {
-                    get_arg(arg, sizeof(arg), &p);
-                    if (!arg[0])
-                        break;
-
-                    feed->child_argv[i] = av_strdup(arg);
-                }
-
-                feed->child_argv[i] = av_malloc(30 + strlen(feed->filename));
-
-                snprintf(feed->child_argv[i], 30+strlen(feed->filename),
-                    "http://%s:%d/%s",
-                        (my_http_addr.sin_addr.s_addr == INADDR_ANY) ? "127.0.0.1" :
-                    inet_ntoa(my_http_addr.sin_addr),
-                    ntohs(my_http_addr.sin_port), feed->filename);
-            }
-        } else if (!av_strcasecmp(cmd, "ReadOnlyFile")) {
-            if (feed) {
-                get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);
-                feed->readonly = 1;
-            } else if (stream) {
-                get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
-            }
-        } else if (!av_strcasecmp(cmd, "File")) {
-            if (feed) {
-                get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);
-            } else if (stream)
-                get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
-        } else if (!av_strcasecmp(cmd, "Truncate")) {
-            if (feed) {
-                get_arg(arg, sizeof(arg), &p);
-                feed->truncate = strtod(arg, NULL);
-            }
-        } else if (!av_strcasecmp(cmd, "FileMaxSize")) {
-            if (feed) {
-                char *p1;
-                double fsize;
-
-                get_arg(arg, sizeof(arg), &p);
-                p1 = arg;
-                fsize = strtod(p1, &p1);
-                switch(av_toupper(*p1)) {
-                case 'K':
-                    fsize *= 1024;
-                    break;
-                case 'M':
-                    fsize *= 1024 * 1024;
-                    break;
-                case 'G':
-                    fsize *= 1024 * 1024 * 1024;
-                    break;
-                }
-                feed->feed_max_size = (int64_t)fsize;
-                if (feed->feed_max_size < FFM_PACKET_SIZE*4) {
-                    ERROR("Feed max file size is too small, must be at least %d\n", FFM_PACKET_SIZE*4);
-                }
-            }
-        } else if (!av_strcasecmp(cmd, "</Feed>")) {
-            if (!feed) {
-                ERROR("No corresponding <Feed> for </Feed>\n");
-            }
-            feed = NULL;
-        } else if (!av_strcasecmp(cmd, "<Stream")) {
-            /*********************************************/
-            /* Stream related options */
-            char *q;
-            if (stream || feed) {
-                ERROR("Already in a tag\n");
-            } else {
-                FFStream *s;
-                stream = av_mallocz(sizeof(FFStream));
-                get_arg(stream->filename, sizeof(stream->filename), &p);
-                q = strrchr(stream->filename, '>');
-                if (*q)
-                    *q = '\0';
-
-                for (s = first_stream; s; s = s->next) {
-                    if (!strcmp(stream->filename, s->filename)) {
-                        ERROR("Stream '%s' already registered\n", s->filename);
-                    }
-                }
-
-                stream->fmt = avserver_guess_format(NULL, stream->filename, NULL);
-                avcodec_get_context_defaults3(&video_enc, NULL);
-                avcodec_get_context_defaults3(&audio_enc, NULL);
-                audio_id = AV_CODEC_ID_NONE;
-                video_id = AV_CODEC_ID_NONE;
-                if (stream->fmt) {
-                    audio_id = stream->fmt->audio_codec;
-                    video_id = stream->fmt->video_codec;
-                }
-
-                *last_stream = stream;
-                last_stream = &stream->next;
-            }
-        } else if (!av_strcasecmp(cmd, "Feed")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                FFStream *sfeed;
-
-                sfeed = first_feed;
-                while (sfeed != NULL) {
-                    if (!strcmp(sfeed->filename, arg))
-                        break;
-                    sfeed = sfeed->next_feed;
-                }
-                if (!sfeed)
-                    ERROR("feed '%s' not defined\n", arg);
-                else
-                    stream->feed = sfeed;
-            }
-        } else if (!av_strcasecmp(cmd, "Format")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                if (!strcmp(arg, "status")) {
-                    stream->stream_type = STREAM_TYPE_STATUS;
-                    stream->fmt = NULL;
-                } else {
-                    stream->stream_type = STREAM_TYPE_LIVE;
-                    /* jpeg cannot be used here, so use single frame jpeg */
-                    if (!strcmp(arg, "jpeg"))
-                        strcpy(arg, "mjpeg");
-                    stream->fmt = avserver_guess_format(arg, NULL, NULL);
-                    if (!stream->fmt) {
-                        ERROR("Unknown Format: %s\n", arg);
-                    }
-                }
-                if (stream->fmt) {
-                    audio_id = stream->fmt->audio_codec;
-                    video_id = stream->fmt->video_codec;
-                }
-            }
-        } else if (!av_strcasecmp(cmd, "InputFormat")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                stream->ifmt = av_find_input_format(arg);
-                if (!stream->ifmt) {
-                    ERROR("Unknown input format: %s\n", arg);
-                }
-            }
-        } else if (!av_strcasecmp(cmd, "FaviconURL")) {
-            if (stream && stream->stream_type == STREAM_TYPE_STATUS) {
-                get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
-            } else {
-                ERROR("FaviconURL only permitted for status streams\n");
-            }
-        } else if (!av_strcasecmp(cmd, "Author")) {
-            if (stream)
-                get_arg(stream->author, sizeof(stream->author), &p);
-        } else if (!av_strcasecmp(cmd, "Comment")) {
-            if (stream)
-                get_arg(stream->comment, sizeof(stream->comment), &p);
-        } else if (!av_strcasecmp(cmd, "Copyright")) {
-            if (stream)
-                get_arg(stream->copyright, sizeof(stream->copyright), &p);
-        } else if (!av_strcasecmp(cmd, "Title")) {
-            if (stream)
-                get_arg(stream->title, sizeof(stream->title), &p);
-        } else if (!av_strcasecmp(cmd, "Preroll")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                stream->prebuffer = atof(arg) * 1000;
-        } else if (!av_strcasecmp(cmd, "StartSendOnKey")) {
-            if (stream)
-                stream->send_on_key = 1;
-        } else if (!av_strcasecmp(cmd, "AudioCodec")) {
-            get_arg(arg, sizeof(arg), &p);
-            audio_id = opt_audio_codec(arg);
-            if (audio_id == AV_CODEC_ID_NONE) {
-                ERROR("Unknown AudioCodec: %s\n", arg);
-            }
-        } else if (!av_strcasecmp(cmd, "VideoCodec")) {
-            get_arg(arg, sizeof(arg), &p);
-            video_id = opt_video_codec(arg);
-            if (video_id == AV_CODEC_ID_NONE) {
-                ERROR("Unknown VideoCodec: %s\n", arg);
-            }
-        } else if (!av_strcasecmp(cmd, "MaxTime")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                stream->max_time = atof(arg) * 1000;
-        } else if (!av_strcasecmp(cmd, "AudioBitRate")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                audio_enc.bit_rate = lrintf(atof(arg) * 1000);
-        } else if (!av_strcasecmp(cmd, "AudioChannels")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                audio_enc.channels = atoi(arg);
-        } else if (!av_strcasecmp(cmd, "AudioSampleRate")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                audio_enc.sample_rate = atoi(arg);
-        } else if (!av_strcasecmp(cmd, "AudioQuality")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-//                audio_enc.quality = atof(arg) * 1000;
-            }
-        } else if (!av_strcasecmp(cmd, "VideoBitRateRange")) {
-            if (stream) {
-                int minrate, maxrate;
-
-                get_arg(arg, sizeof(arg), &p);
-
-                if (sscanf(arg, "%d-%d", &minrate, &maxrate) == 2) {
-                    video_enc.rc_min_rate = minrate * 1000;
-                    video_enc.rc_max_rate = maxrate * 1000;
-                } else {
-                    ERROR("Incorrect format for VideoBitRateRange -- should be <min>-<max>: %s\n", arg);
-                }
-            }
-        } else if (!av_strcasecmp(cmd, "Debug")) {
-            if (stream) {
-                get_arg(arg, sizeof(arg), &p);
-                video_enc.debug = strtol(arg,0,0);
-            }
-        } else if (!av_strcasecmp(cmd, "Strict")) {
-            if (stream) {
-                get_arg(arg, sizeof(arg), &p);
-                video_enc.strict_std_compliance = atoi(arg);
-            }
-        } else if (!av_strcasecmp(cmd, "VideoBufferSize")) {
-            if (stream) {
-                get_arg(arg, sizeof(arg), &p);
-                video_enc.rc_buffer_size = atoi(arg) * 8*1024;
-            }
-        } else if (!av_strcasecmp(cmd, "VideoBitRateTolerance")) {
-            if (stream) {
-                get_arg(arg, sizeof(arg), &p);
-                video_enc.bit_rate_tolerance = atoi(arg) * 1000;
-            }
-        } else if (!av_strcasecmp(cmd, "VideoBitRate")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                video_enc.bit_rate = atoi(arg) * 1000;
-            }
-        } else if (!av_strcasecmp(cmd, "VideoSize")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                av_parse_video_size(&video_enc.width, &video_enc.height, arg);
-                if ((video_enc.width % 16) != 0 ||
-                    (video_enc.height % 16) != 0) {
-                    ERROR("Image size must be a multiple of 16\n");
-                }
-            }
-        } else if (!av_strcasecmp(cmd, "VideoFrameRate")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                AVRational frame_rate;
-                if (av_parse_video_rate(&frame_rate, arg) < 0) {
-                    ERROR("Incorrect frame rate: %s\n", arg);
-                } else {
-                    video_enc.time_base.num = frame_rate.den;
-                    video_enc.time_base.den = frame_rate.num;
-                }
-            }
-        } else if (!av_strcasecmp(cmd, "VideoGopSize")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                video_enc.gop_size = atoi(arg);
-        } else if (!av_strcasecmp(cmd, "VideoIntraOnly")) {
-            if (stream)
-                video_enc.gop_size = 1;
-        } else if (!av_strcasecmp(cmd, "VideoHighQuality")) {
-            if (stream)
-                video_enc.mb_decision = FF_MB_DECISION_BITS;
-        } else if (!av_strcasecmp(cmd, "Video4MotionVector")) {
-            if (stream) {
-                video_enc.mb_decision = FF_MB_DECISION_BITS; //FIXME remove
-                video_enc.flags |= CODEC_FLAG_4MV;
-            }
-        } else if (!av_strcasecmp(cmd, "AVOptionVideo") ||
-                   !av_strcasecmp(cmd, "AVOptionAudio")) {
-            char arg2[1024];
-            AVCodecContext *avctx;
-            int type;
-            get_arg(arg, sizeof(arg), &p);
-            get_arg(arg2, sizeof(arg2), &p);
-            if (!av_strcasecmp(cmd, "AVOptionVideo")) {
-                avctx = &video_enc;
-                type = AV_OPT_FLAG_VIDEO_PARAM;
-            } else {
-                avctx = &audio_enc;
-                type = AV_OPT_FLAG_AUDIO_PARAM;
-            }
-            if (avserver_opt_default(arg, arg2, avctx, type|AV_OPT_FLAG_ENCODING_PARAM)) {
-                ERROR("AVOption error: %s %s\n", arg, arg2);
-            }
-        } else if (!av_strcasecmp(cmd, "AVPresetVideo") ||
-                   !av_strcasecmp(cmd, "AVPresetAudio")) {
-            AVCodecContext *avctx;
-            int type;
-            get_arg(arg, sizeof(arg), &p);
-            if (!av_strcasecmp(cmd, "AVPresetVideo")) {
-                avctx = &video_enc;
-                video_enc.codec_id = video_id;
-                type = AV_OPT_FLAG_VIDEO_PARAM;
-            } else {
-                avctx = &audio_enc;
-                audio_enc.codec_id = audio_id;
-                type = AV_OPT_FLAG_AUDIO_PARAM;
-            }
-            if (avserver_opt_preset(arg, avctx, type|AV_OPT_FLAG_ENCODING_PARAM, &audio_id, &video_id)) {
-                ERROR("AVPreset error: %s\n", arg);
-            }
-        } else if (!av_strcasecmp(cmd, "VideoTag")) {
-            get_arg(arg, sizeof(arg), &p);
-            if ((strlen(arg) == 4) && stream)
-                video_enc.codec_tag = MKTAG(arg[0], arg[1], arg[2], arg[3]);
-        } else if (!av_strcasecmp(cmd, "BitExact")) {
-            if (stream)
-                video_enc.flags |= CODEC_FLAG_BITEXACT;
-        } else if (!av_strcasecmp(cmd, "DctFastint")) {
-            if (stream)
-                video_enc.dct_algo  = FF_DCT_FASTINT;
-        } else if (!av_strcasecmp(cmd, "IdctSimple")) {
-            if (stream)
-                video_enc.idct_algo = FF_IDCT_SIMPLE;
-        } else if (!av_strcasecmp(cmd, "Qscale")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                video_enc.flags |= CODEC_FLAG_QSCALE;
-                video_enc.global_quality = FF_QP2LAMBDA * atoi(arg);
-            }
-        } else if (!av_strcasecmp(cmd, "VideoQDiff")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                video_enc.max_qdiff = atoi(arg);
-                if (video_enc.max_qdiff < 1 || video_enc.max_qdiff > 31) {
-                    ERROR("VideoQDiff out of range\n");
-                }
-            }
-        } else if (!av_strcasecmp(cmd, "VideoQMax")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                video_enc.qmax = atoi(arg);
-                if (video_enc.qmax < 1 || video_enc.qmax > 31) {
-                    ERROR("VideoQMax out of range\n");
-                }
-            }
-        } else if (!av_strcasecmp(cmd, "VideoQMin")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                video_enc.qmin = atoi(arg);
-                if (video_enc.qmin < 1 || video_enc.qmin > 31) {
-                    ERROR("VideoQMin out of range\n");
-                }
-            }
-        } else if (!av_strcasecmp(cmd, "LumiMask")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                video_enc.lumi_masking = atof(arg);
-        } else if (!av_strcasecmp(cmd, "DarkMask")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                video_enc.dark_masking = atof(arg);
-        } else if (!av_strcasecmp(cmd, "NoVideo")) {
-            video_id = AV_CODEC_ID_NONE;
-        } else if (!av_strcasecmp(cmd, "NoAudio")) {
-            audio_id = AV_CODEC_ID_NONE;
-        } else if (!av_strcasecmp(cmd, "ACL")) {
-            parse_acl_row(stream, feed, NULL, p, filename, line_num);
-        } else if (!av_strcasecmp(cmd, "DynamicACL")) {
-            if (stream) {
-                get_arg(stream->dynamic_acl, sizeof(stream->dynamic_acl), &p);
-            }
-        } else if (!av_strcasecmp(cmd, "RTSPOption")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                av_freep(&stream->rtsp_option);
-                stream->rtsp_option = av_strdup(arg);
-            }
-        } else if (!av_strcasecmp(cmd, "MulticastAddress")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream) {
-                if (resolve_host(&stream->multicast_ip, arg) != 0) {
-                    ERROR("Invalid host/IP address: %s\n", arg);
-                }
-                stream->is_multicast = 1;
-                stream->loop = 1; /* default is looping */
-            }
-        } else if (!av_strcasecmp(cmd, "MulticastPort")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                stream->multicast_port = atoi(arg);
-        } else if (!av_strcasecmp(cmd, "MulticastTTL")) {
-            get_arg(arg, sizeof(arg), &p);
-            if (stream)
-                stream->multicast_ttl = atoi(arg);
-        } else if (!av_strcasecmp(cmd, "NoLoop")) {
-            if (stream)
-                stream->loop = 0;
-        } else if (!av_strcasecmp(cmd, "</Stream>")) {
-            if (!stream) {
-                ERROR("No corresponding <Stream> for </Stream>\n");
-            } else {
-                if (stream->feed && stream->fmt && strcmp(stream->fmt->name, "ffm") != 0) {
-                    if (audio_id != AV_CODEC_ID_NONE) {
-                        audio_enc.codec_type = AVMEDIA_TYPE_AUDIO;
-                        audio_enc.codec_id = audio_id;
-                        add_codec(stream, &audio_enc);
-                    }
-                    if (video_id != AV_CODEC_ID_NONE) {
-                        video_enc.codec_type = AVMEDIA_TYPE_VIDEO;
-                        video_enc.codec_id = video_id;
-                        add_codec(stream, &video_enc);
-                    }
-                }
-                stream = NULL;
-            }
-        } else if (!av_strcasecmp(cmd, "<Redirect")) {
-            /*********************************************/
-            char *q;
-            if (stream || feed || redirect) {
-                ERROR("Already in a tag\n");
-            } else {
-                redirect = av_mallocz(sizeof(FFStream));
-                *last_stream = redirect;
-                last_stream = &redirect->next;
-
-                get_arg(redirect->filename, sizeof(redirect->filename), &p);
-                q = strrchr(redirect->filename, '>');
-                if (*q)
-                    *q = '\0';
-                redirect->stream_type = STREAM_TYPE_REDIRECT;
-            }
-        } else if (!av_strcasecmp(cmd, "URL")) {
-            if (redirect)
-                get_arg(redirect->feed_filename, sizeof(redirect->feed_filename), &p);
-        } else if (!av_strcasecmp(cmd, "</Redirect>")) {
-            if (!redirect) {
-                ERROR("No corresponding <Redirect> for </Redirect>\n");
-            } else {
-                if (!redirect->feed_filename[0]) {
-                    ERROR("No URL found for <Redirect>\n");
-                }
-                redirect = NULL;
-            }
-        } else if (!av_strcasecmp(cmd, "LoadModule")) {
-            ERROR("Loadable modules no longer supported\n");
-        } else {
-            ERROR("Incorrect keyword: '%s'\n", cmd);
-        }
-    }
-#undef ERROR
-
-    fclose(f);
-    if (errors)
-        return -1;
-    else
-        return 0;
-}
-
-static void handle_child_exit(int sig)
-{
-    pid_t pid;
-    int status;
-
-    while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
-        FFStream *feed;
-
-        for (feed = first_feed; feed; feed = feed->next) {
-            if (feed->pid == pid) {
-                int uptime = time(0) - feed->pid_start;
-
-                feed->pid = 0;
-                fprintf(stderr, "%s: Pid %d exited with status %d after %d seconds\n", feed->filename, pid, status, uptime);
-
-                if (uptime < 30)
-                    /* Turn off any more restarts */
-                    feed->child_argv = 0;
-            }
-        }
-    }
-
-    need_to_start_children = 1;
-}
-
-static void opt_debug(void)
-{
-    avserver_debug = 1;
-    logfilename[0] = '-';
-}
-
-void show_help_default(const char *opt, const char *arg)
-{
-    printf("usage: avserver [options]\n"
-           "Hyper fast multi format Audio/Video streaming server\n");
-    printf("\n");
-    show_help_options(options, "Main options:", 0, 0, 0);
-}
-
-static const OptionDef options[] = {
-#include "cmdutils_common_opts.h"
-    { "n", OPT_BOOL, {(void *)&no_launch }, "enable no-launch mode" },
-    { "d", 0, {(void*)opt_debug}, "enable debug mode" },
-    { "f", HAS_ARG | OPT_STRING, {(void*)&config_filename }, "use configfile instead of /etc/avserver.conf", "configfile" },
-    { NULL },
-};
-
-int main(int argc, char **argv)
-{
-    struct sigaction sigact = { { 0 } };
-
-    config_filename = av_strdup("/etc/avserver.conf");
-
-    parse_loglevel(argc, argv, options);
-    av_register_all();
-    avformat_network_init();
-
-    show_banner();
-
-    my_program_name = argv[0];
-
-    parse_options(NULL, argc, argv, options, NULL);
-
-    unsetenv("http_proxy");             /* Kill the http_proxy */
-
-    av_lfg_init(&random_state, av_get_random_seed());
-
-    sigact.sa_handler = handle_child_exit;
-    sigact.sa_flags = SA_NOCLDSTOP | SA_RESTART;
-    sigaction(SIGCHLD, &sigact, 0);
-
-    if (parse_ffconfig(config_filename) < 0) {
-        fprintf(stderr, "Incorrect config file - exiting.\n");
-        exit(1);
-    }
-
-    /* open log file if needed */
-    if (logfilename[0] != '\0') {
-        if (!strcmp(logfilename, "-"))
-            logfile = stdout;
-        else
-            logfile = fopen(logfilename, "a");
-        av_log_set_callback(http_av_log);
-    }
-
-    build_file_streams();
-
-    build_feed_streams();
-
-    compute_bandwidth();
-
-    /* signal init */
-    signal(SIGPIPE, SIG_IGN);
-
-    if (http_server() < 0) {
-        http_log("Could not start server\n");
-        exit(1);
-    }
-
-    return 0;
-}
diff --git a/deps/libav/cmdutils.c b/deps/libav/cmdutils.c
deleted file mode 100644
index a1e5116..0000000
--- a/deps/libav/cmdutils.c
+++ /dev/null
@@ -1,1645 +0,0 @@
-/*
- * Various utilities for command line tools
- * Copyright (c) 2000-2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-#include <stdint.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 "libavresample/avresample.h"
-#include "libswscale/swscale.h"
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/eval.h"
-#include "libavutil/dict.h"
-#include "libavutil/opt.h"
-#include "libavutil/cpu.h"
-#include "cmdutils.h"
-#include "version.h"
-#if CONFIG_NETWORK
-#include "libavformat/network.h"
-#endif
-#if HAVE_SYS_RESOURCE_H
-#include <sys/time.h>
-#include <sys/resource.h>
-#endif
-
-struct SwsContext *sws_opts;
-AVDictionary *format_opts, *codec_opts, *resample_opts;
-
-static const int this_year = 2014;
-
-void init_opts(void)
-{
-#if CONFIG_SWSCALE
-    sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
-                              NULL, NULL, NULL);
-#endif
-}
-
-void uninit_opts(void)
-{
-#if CONFIG_SWSCALE
-    sws_freeContext(sws_opts);
-    sws_opts = NULL;
-#endif
-    av_dict_free(&format_opts);
-    av_dict_free(&codec_opts);
-    av_dict_free(&resample_opts);
-}
-
-void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
-{
-    vfprintf(stdout, fmt, vl);
-}
-
-static void (*program_exit)(int ret);
-
-void register_exit(void (*cb)(int ret))
-{
-    program_exit = cb;
-}
-
-void exit_program(int ret)
-{
-    if (program_exit)
-        program_exit(ret);
-
-    exit(ret);
-}
-
-double parse_number_or_die(const char *context, const char *numstr, int type,
-                           double min, double max)
-{
-    char *tail;
-    const char *error;
-    double d = av_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 if (type == OPT_INT && (int)d != d)
-        error = "Expected int for %s but found %s\n";
-    else
-        return d;
-    av_log(NULL, AV_LOG_FATAL, error, context, numstr, min, max);
-    exit_program(1);
-    return 0;
-}
-
-int64_t parse_time_or_die(const char *context, const char *timestr,
-                          int is_duration)
-{
-    int64_t us;
-    if (av_parse_time(&us, timestr, is_duration) < 0) {
-        av_log(NULL, AV_LOG_FATAL, "Invalid %s specification for %s: %s\n",
-               is_duration ? "duration" : "date", context, timestr);
-        exit_program(1);
-    }
-    return us;
-}
-
-void show_help_options(const OptionDef *options, const char *msg, int req_flags,
-                       int rej_flags, int alt_flags)
-{
-    const OptionDef *po;
-    int first;
-
-    first = 1;
-    for (po = options; po->name != NULL; po++) {
-        char buf[64];
-
-        if (((po->flags & req_flags) != req_flags) ||
-            (alt_flags && !(po->flags & alt_flags)) ||
-            (po->flags & rej_flags))
-            continue;
-
-        if (first) {
-            printf("%s\n", msg);
-            first = 0;
-        }
-        av_strlcpy(buf, po->name, sizeof(buf));
-        if (po->argname) {
-            av_strlcat(buf, " ", sizeof(buf));
-            av_strlcat(buf, po->argname, sizeof(buf));
-        }
-        printf("-%-17s  %s\n", buf, po->help);
-    }
-    printf("\n");
-}
-
-void show_help_children(const AVClass *class, int flags)
-{
-    const AVClass *child = NULL;
-    av_opt_show2(&class, NULL, flags, 0);
-    printf("\n");
-
-    while (child = av_opt_child_class_next(class, child))
-        show_help_children(child, flags);
-}
-
-static const OptionDef *find_option(const OptionDef *po, const char *name)
-{
-    const char *p = strchr(name, ':');
-    int len = p ? p - name : strlen(name);
-
-    while (po->name != NULL) {
-        if (!strncmp(name, po->name, len) && strlen(po->name) == len)
-            break;
-        po++;
-    }
-    return po;
-}
-
-/* _WIN32 means using the windows libc - cygwin doesn't define that
- * by default. HAVE_COMMANDLINETOARGVW is true on cygwin, while
- * it doesn't provide the actual command line via GetCommandLineW(). */
-#if HAVE_COMMANDLINETOARGVW && defined(_WIN32)
-#include <windows.h>
-#include <shellapi.h>
-/* Will be leaked on exit */
-static char** win32_argv_utf8 = NULL;
-static int win32_argc = 0;
-
-/**
- * Prepare command line arguments for executable.
- * For Windows - perform wide-char to UTF-8 conversion.
- * Input arguments should be main() function arguments.
- * @param argc_ptr Arguments number (including executable)
- * @param argv_ptr Arguments list.
- */
-static void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
-{
-    char *argstr_flat;
-    wchar_t **argv_w;
-    int i, buffsize = 0, offset = 0;
-
-    if (win32_argv_utf8) {
-        *argc_ptr = win32_argc;
-        *argv_ptr = win32_argv_utf8;
-        return;
-    }
-
-    win32_argc = 0;
-    argv_w = CommandLineToArgvW(GetCommandLineW(), &win32_argc);
-    if (win32_argc <= 0 || !argv_w)
-        return;
-
-    /* determine the UTF-8 buffer size (including NULL-termination symbols) */
-    for (i = 0; i < win32_argc; i++)
-        buffsize += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1,
-                                        NULL, 0, NULL, NULL);
-
-    win32_argv_utf8 = av_mallocz(sizeof(char *) * (win32_argc + 1) + buffsize);
-    argstr_flat     = (char *)win32_argv_utf8 + sizeof(char *) * (win32_argc + 1);
-    if (win32_argv_utf8 == NULL) {
-        LocalFree(argv_w);
-        return;
-    }
-
-    for (i = 0; i < win32_argc; i++) {
-        win32_argv_utf8[i] = &argstr_flat[offset];
-        offset += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1,
-                                      &argstr_flat[offset],
-                                      buffsize - offset, NULL, NULL);
-    }
-    win32_argv_utf8[i] = NULL;
-    LocalFree(argv_w);
-
-    *argc_ptr = win32_argc;
-    *argv_ptr = win32_argv_utf8;
-}
-#else
-static inline void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
-{
-    /* nothing to do */
-}
-#endif /* HAVE_COMMANDLINETOARGVW */
-
-static int write_option(void *optctx, const OptionDef *po, const char *opt,
-                        const char *arg)
-{
-    /* new-style options contain an offset into optctx, old-style address of
-     * a global var*/
-    void *dst = po->flags & (OPT_OFFSET | OPT_SPEC) ?
-                (uint8_t *)optctx + po->u.off : po->u.dst_ptr;
-    int *dstcount;
-
-    if (po->flags & OPT_SPEC) {
-        SpecifierOpt **so = dst;
-        char *p = strchr(opt, ':');
-
-        dstcount = (int *)(so + 1);
-        *so = grow_array(*so, sizeof(**so), dstcount, *dstcount + 1);
-        (*so)[*dstcount - 1].specifier = av_strdup(p ? p + 1 : "");
-        dst = &(*so)[*dstcount - 1].u;
-    }
-
-    if (po->flags & OPT_STRING) {
-        char *str;
-        str = av_strdup(arg);
-        av_freep(dst);
-        *(char **)dst = str;
-    } else if (po->flags & OPT_BOOL || po->flags & OPT_INT) {
-        *(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
-    } else if (po->flags & OPT_INT64) {
-        *(int64_t *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX);
-    } else if (po->flags & OPT_TIME) {
-        *(int64_t *)dst = parse_time_or_die(opt, arg, 1);
-    } else if (po->flags & OPT_FLOAT) {
-        *(float *)dst = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY);
-    } else if (po->flags & OPT_DOUBLE) {
-        *(double *)dst = parse_number_or_die(opt, arg, OPT_DOUBLE, -INFINITY, INFINITY);
-    } else if (po->u.func_arg) {
-        int ret = po->u.func_arg(optctx, opt, arg);
-        if (ret < 0) {
-            av_log(NULL, AV_LOG_ERROR,
-                   "Failed to set value '%s' for option '%s'\n", arg, opt);
-            return ret;
-        }
-    }
-    if (po->flags & OPT_EXIT)
-        exit_program(0);
-
-    return 0;
-}
-
-int parse_option(void *optctx, const char *opt, const char *arg,
-                 const OptionDef *options)
-{
-    const OptionDef *po;
-    int ret;
-
-    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)))
-            arg = "0";
-    } else if (po->flags & OPT_BOOL)
-        arg = "1";
-
-    if (!po->name)
-        po = find_option(options, "default");
-    if (!po->name) {
-        av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", opt);
-        return AVERROR(EINVAL);
-    }
-    if (po->flags & HAS_ARG && !arg) {
-        av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'\n", opt);
-        return AVERROR(EINVAL);
-    }
-
-    ret = write_option(optctx, po, opt, arg);
-    if (ret < 0)
-        return ret;
-
-    return !!(po->flags & HAS_ARG);
-}
-
-void parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
-                   void (*parse_arg_function)(void *, const char*))
-{
-    const char *opt;
-    int optindex, handleoptions = 1, ret;
-
-    /* perform system-dependent conversions for arguments list */
-    prepare_app_arguments(&argc, &argv);
-
-    /* parse options */
-    optindex = 1;
-    while (optindex < argc) {
-        opt = argv[optindex++];
-
-        if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
-            if (opt[1] == '-' && opt[2] == '\0') {
-                handleoptions = 0;
-                continue;
-            }
-            opt++;
-
-            if ((ret = parse_option(optctx, opt, argv[optindex], options)) < 0)
-                exit_program(1);
-            optindex += ret;
-        } else {
-            if (parse_arg_function)
-                parse_arg_function(optctx, opt);
-        }
-    }
-}
-
-int parse_optgroup(void *optctx, OptionGroup *g)
-{
-    int i, ret;
-
-    av_log(NULL, AV_LOG_DEBUG, "Parsing a group of options: %s %s.\n",
-           g->group_def->name, g->arg);
-
-    for (i = 0; i < g->nb_opts; i++) {
-        Option *o = &g->opts[i];
-
-        if (g->group_def->flags &&
-            !(g->group_def->flags & o->opt->flags)) {
-            av_log(NULL, AV_LOG_ERROR, "Option %s (%s) cannot be applied to "
-                   "%s %s -- you are trying to apply an input option to an "
-                   "output file or vice versa. Move this option before the "
-                   "file it belongs to.\n", o->key, o->opt->help,
-                   g->group_def->name, g->arg);
-            return AVERROR(EINVAL);
-        }
-
-        av_log(NULL, AV_LOG_DEBUG, "Applying option %s (%s) with argument %s.\n",
-               o->key, o->opt->help, o->val);
-
-        ret = write_option(optctx, o->opt, o->key, o->val);
-        if (ret < 0)
-            return ret;
-    }
-
-    av_log(NULL, AV_LOG_DEBUG, "Successfully parsed a group of options.\n");
-
-    return 0;
-}
-
-int locate_option(int argc, char **argv, const OptionDef *options,
-                  const char *optname)
-{
-    const OptionDef *po;
-    int i;
-
-    for (i = 1; i < argc; i++) {
-        const char *cur_opt = argv[i];
-
-        if (*cur_opt++ != '-')
-            continue;
-
-        po = find_option(options, cur_opt);
-        if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o')
-            po = find_option(options, cur_opt + 2);
-
-        if ((!po->name && !strcmp(cur_opt, optname)) ||
-             (po->name && !strcmp(optname, po->name)))
-            return i;
-
-        if (!po || po->flags & HAS_ARG)
-            i++;
-    }
-    return 0;
-}
-
-void parse_loglevel(int argc, char **argv, const OptionDef *options)
-{
-    int idx = locate_option(argc, argv, options, "loglevel");
-    if (!idx)
-        idx = locate_option(argc, argv, options, "v");
-    if (idx && argv[idx + 1])
-        opt_loglevel(NULL, "loglevel", argv[idx + 1]);
-}
-
-#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
-int opt_default(void *optctx, const char *opt, const char *arg)
-{
-    const AVOption *o;
-    char opt_stripped[128];
-    const char *p;
-    const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
-#if CONFIG_AVRESAMPLE
-    const AVClass *rc = avresample_get_class();
-#endif
-#if CONFIG_SWSCALE
-    const AVClass *sc = sws_get_class();
-#endif
-
-    if (!(p = strchr(opt, ':')))
-        p = opt + strlen(opt);
-    av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1));
-
-    if ((o = av_opt_find(&cc, opt_stripped, NULL, 0,
-                         AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) ||
-        ((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&
-         (o = av_opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ))))
-        av_dict_set(&codec_opts, opt, arg, FLAGS);
-    else if ((o = av_opt_find(&fc, opt, NULL, 0,
-                              AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))
-        av_dict_set(&format_opts, opt, arg, FLAGS);
-#if CONFIG_AVRESAMPLE
-    else if ((o = av_opt_find(&rc, opt, NULL, 0,
-                              AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))
-        av_dict_set(&resample_opts, opt, arg, FLAGS);
-#endif
-#if CONFIG_SWSCALE
-    else if ((o = av_opt_find(&sc, opt, NULL, 0,
-                              AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
-        // XXX we only support sws_flags, not arbitrary sws options
-        int ret = av_opt_set(sws_opts, opt, arg, 0);
-        if (ret < 0) {
-            av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
-            return ret;
-        }
-    }
-#endif
-
-    if (o)
-        return 0;
-    return AVERROR_OPTION_NOT_FOUND;
-}
-
-/*
- * Check whether given option is a group separator.
- *
- * @return index of the group definition that matched or -1 if none
- */
-static int match_group_separator(const OptionGroupDef *groups, int nb_groups,
-                                 const char *opt)
-{
-    int i;
-
-    for (i = 0; i < nb_groups; i++) {
-        const OptionGroupDef *p = &groups[i];
-        if (p->sep && !strcmp(p->sep, opt))
-            return i;
-    }
-
-    return -1;
-}
-
-/*
- * Finish parsing an option group.
- *
- * @param group_idx which group definition should this group belong to
- * @param arg argument of the group delimiting option
- */
-static void finish_group(OptionParseContext *octx, int group_idx,
-                         const char *arg)
-{
-    OptionGroupList *l = &octx->groups[group_idx];
-    OptionGroup *g;
-
-    GROW_ARRAY(l->groups, l->nb_groups);
-    g = &l->groups[l->nb_groups - 1];
-
-    *g             = octx->cur_group;
-    g->arg         = arg;
-    g->group_def   = l->group_def;
-#if CONFIG_SWSCALE
-    g->sws_opts    = sws_opts;
-#endif
-    g->codec_opts  = codec_opts;
-    g->format_opts = format_opts;
-    g->resample_opts = resample_opts;
-
-    codec_opts  = NULL;
-    format_opts = NULL;
-    resample_opts = NULL;
-#if CONFIG_SWSCALE
-    sws_opts    = NULL;
-#endif
-    init_opts();
-
-    memset(&octx->cur_group, 0, sizeof(octx->cur_group));
-}
-
-/*
- * Add an option instance to currently parsed group.
- */
-static void add_opt(OptionParseContext *octx, const OptionDef *opt,
-                    const char *key, const char *val)
-{
-    int global = !(opt->flags & (OPT_PERFILE | OPT_SPEC | OPT_OFFSET));
-    OptionGroup *g = global ? &octx->global_opts : &octx->cur_group;
-
-    GROW_ARRAY(g->opts, g->nb_opts);
-    g->opts[g->nb_opts - 1].opt = opt;
-    g->opts[g->nb_opts - 1].key = key;
-    g->opts[g->nb_opts - 1].val = val;
-}
-
-static void init_parse_context(OptionParseContext *octx,
-                               const OptionGroupDef *groups, int nb_groups)
-{
-    static const OptionGroupDef global_group = { "global" };
-    int i;
-
-    memset(octx, 0, sizeof(*octx));
-
-    octx->nb_groups = nb_groups;
-    octx->groups    = av_mallocz(sizeof(*octx->groups) * octx->nb_groups);
-    if (!octx->groups)
-        exit_program(1);
-
-    for (i = 0; i < octx->nb_groups; i++)
-        octx->groups[i].group_def = &groups[i];
-
-    octx->global_opts.group_def = &global_group;
-    octx->global_opts.arg       = "";
-
-    init_opts();
-}
-
-void uninit_parse_context(OptionParseContext *octx)
-{
-    int i, j;
-
-    for (i = 0; i < octx->nb_groups; i++) {
-        OptionGroupList *l = &octx->groups[i];
-
-        for (j = 0; j < l->nb_groups; j++) {
-            av_freep(&l->groups[j].opts);
-            av_dict_free(&l->groups[j].codec_opts);
-            av_dict_free(&l->groups[j].format_opts);
-            av_dict_free(&l->groups[j].resample_opts);
-#if CONFIG_SWSCALE
-            sws_freeContext(l->groups[j].sws_opts);
-#endif
-        }
-        av_freep(&l->groups);
-    }
-    av_freep(&octx->groups);
-
-    av_freep(&octx->cur_group.opts);
-    av_freep(&octx->global_opts.opts);
-
-    uninit_opts();
-}
-
-int split_commandline(OptionParseContext *octx, int argc, char *argv[],
-                      const OptionDef *options,
-                      const OptionGroupDef *groups, int nb_groups)
-{
-    int optindex = 1;
-
-    /* perform system-dependent conversions for arguments list */
-    prepare_app_arguments(&argc, &argv);
-
-    init_parse_context(octx, groups, nb_groups);
-    av_log(NULL, AV_LOG_DEBUG, "Splitting the commandline.\n");
-
-    while (optindex < argc) {
-        const char *opt = argv[optindex++], *arg;
-        const OptionDef *po;
-        int ret;
-
-        av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt);
-
-        /* unnamed group separators, e.g. output filename */
-        if (opt[0] != '-' || !opt[1]) {
-            finish_group(octx, 0, opt);
-            av_log(NULL, AV_LOG_DEBUG, " matched as %s.\n", groups[0].name);
-            continue;
-        }
-        opt++;
-
-#define GET_ARG(arg)                                                           \
-do {                                                                           \
-    arg = argv[optindex++];                                                    \
-    if (!arg) {                                                                \
-        av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'.\n", opt);\
-        return AVERROR(EINVAL);                                                \
-    }                                                                          \
-} while (0)
-
-        /* named group separators, e.g. -i */
-        if ((ret = match_group_separator(groups, nb_groups, opt)) >= 0) {
-            GET_ARG(arg);
-            finish_group(octx, ret, arg);
-            av_log(NULL, AV_LOG_DEBUG, " matched as %s with argument '%s'.\n",
-                   groups[ret].name, arg);
-            continue;
-        }
-
-        /* normal options */
-        po = find_option(options, opt);
-        if (po->name) {
-            if (po->flags & OPT_EXIT) {
-                /* optional argument, e.g. -h */
-                arg = argv[optindex++];
-            } else if (po->flags & HAS_ARG) {
-                GET_ARG(arg);
-            } else {
-                arg = "1";
-            }
-
-            add_opt(octx, po, opt, arg);
-            av_log(NULL, AV_LOG_DEBUG, " matched as option '%s' (%s) with "
-                   "argument '%s'.\n", po->name, po->help, arg);
-            continue;
-        }
-
-        /* AVOptions */
-        if (argv[optindex]) {
-            ret = opt_default(NULL, opt, argv[optindex]);
-            if (ret >= 0) {
-                av_log(NULL, AV_LOG_DEBUG, " matched as AVOption '%s' with "
-                       "argument '%s'.\n", opt, argv[optindex]);
-                optindex++;
-                continue;
-            } else if (ret != AVERROR_OPTION_NOT_FOUND) {
-                av_log(NULL, AV_LOG_ERROR, "Error parsing option '%s' "
-                       "with argument '%s'.\n", opt, argv[optindex]);
-                return ret;
-            }
-        }
-
-        /* boolean -nofoo options */
-        if (opt[0] == 'n' && opt[1] == 'o' &&
-            (po = find_option(options, opt + 2)) &&
-            po->name && po->flags & OPT_BOOL) {
-            add_opt(octx, po, opt, "0");
-            av_log(NULL, AV_LOG_DEBUG, " matched as option '%s' (%s) with "
-                   "argument 0.\n", po->name, po->help);
-            continue;
-        }
-
-        av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'.\n", opt);
-        return AVERROR_OPTION_NOT_FOUND;
-    }
-
-    if (octx->cur_group.nb_opts || codec_opts || format_opts || resample_opts)
-        av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the "
-               "commandline.\n");
-
-    av_log(NULL, AV_LOG_DEBUG, "Finished splitting the commandline.\n");
-
-    return 0;
-}
-
-int opt_cpuflags(void *optctx, const char *opt, const char *arg)
-{
-    int flags = av_parse_cpu_flags(arg);
-
-    if (flags < 0)
-        return flags;
-
-    av_set_cpu_flags_mask(flags);
-    return 0;
-}
-
-int opt_loglevel(void *optctx, 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) {
-        av_log(NULL, AV_LOG_FATAL, "Invalid loglevel \"%s\". "
-               "Possible levels are numbers or:\n", arg);
-        for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++)
-            av_log(NULL, AV_LOG_FATAL, "\"%s\"\n", log_levels[i].name);
-        exit_program(1);
-    }
-    av_log_set_level(level);
-    return 0;
-}
-
-int opt_timelimit(void *optctx, 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
-    av_log(NULL, AV_LOG_WARNING, "-%s not implemented on this OS\n", opt);
-#endif
-    return 0;
-}
-
-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));
-    av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr);
-}
-
-static int warned_cfg = 0;
-
-#define INDENT        1
-#define SHOW_VERSION  2
-#define SHOW_CONFIG   4
-
-#define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
-    if (CONFIG_##LIBNAME) {                                             \
-        const char *indent = flags & INDENT? "  " : "";                 \
-        if (flags & SHOW_VERSION) {                                     \
-            unsigned int version = libname##_version();                 \
-            av_log(NULL, level,                                         \
-                   "%slib%-10s %2d.%3d.%2d / %2d.%3d.%2d\n",            \
-                   indent, #libname,                                    \
-                   LIB##LIBNAME##_VERSION_MAJOR,                        \
-                   LIB##LIBNAME##_VERSION_MINOR,                        \
-                   LIB##LIBNAME##_VERSION_MICRO,                        \
-                   version >> 16, version >> 8 & 0xff, version & 0xff); \
-        }                                                               \
-        if (flags & SHOW_CONFIG) {                                      \
-            const char *cfg = libname##_configuration();                \
-            if (strcmp(LIBAV_CONFIGURATION, cfg)) {                     \
-                if (!warned_cfg) {                                      \
-                    av_log(NULL, level,                                 \
-                            "%sWARNING: library configuration mismatch\n", \
-                            indent);                                    \
-                    warned_cfg = 1;                                     \
-                }                                                       \
-                av_log(NULL, level, "%s%-11s configuration: %s\n",      \
-                        indent, #libname, cfg);                         \
-            }                                                           \
-        }                                                               \
-    }                                                                   \
-
-static void print_all_libs_info(int flags, int level)
-{
-    PRINT_LIB_INFO(avutil,   AVUTIL,   flags, level);
-    PRINT_LIB_INFO(avcodec,  AVCODEC,  flags, level);
-    PRINT_LIB_INFO(avformat, AVFORMAT, flags, level);
-    PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level);
-    PRINT_LIB_INFO(avfilter, AVFILTER, flags, level);
-    PRINT_LIB_INFO(avresample, AVRESAMPLE, flags, level);
-    PRINT_LIB_INFO(swscale,  SWSCALE,  flags, level);
-}
-
-void show_banner(void)
-{
-    av_log(NULL, AV_LOG_INFO,
-           "%s version " LIBAV_VERSION ", Copyright (c) %d-%d the Libav developers\n",
-           program_name, program_birth_year, this_year);
-    av_log(NULL, AV_LOG_INFO, "  built on %s %s with %s\n",
-           __DATE__, __TIME__, CC_IDENT);
-    av_log(NULL, AV_LOG_VERBOSE, "  configuration: " LIBAV_CONFIGURATION "\n");
-    print_all_libs_info(INDENT|SHOW_CONFIG,  AV_LOG_VERBOSE);
-    print_all_libs_info(INDENT|SHOW_VERSION, AV_LOG_VERBOSE);
-}
-
-int show_version(void *optctx, const char *opt, const char *arg)
-{
-    av_log_set_callback(log_callback_help);
-    printf("%s " LIBAV_VERSION "\n", program_name);
-    print_all_libs_info(SHOW_VERSION, AV_LOG_INFO);
-
-    return 0;
-}
-
-int show_license(void *optctx, const char *opt, const char *arg)
-{
-    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
-    );
-
-    return 0;
-}
-
-int show_formats(void *optctx, const char *opt, const char *arg)
-{
-    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:" ");
-    }
-    return 0;
-}
-
-#define PRINT_CODEC_SUPPORTED(codec, field, type, list_name, term, get_name) \
-    if (codec->field) {                                                      \
-        const type *p = c->field;                                            \
-                                                                             \
-        printf("    Supported " list_name ":");                              \
-        while (*p != term) {                                                 \
-            get_name(*p);                                                    \
-            printf(" %s", name);                                             \
-            p++;                                                             \
-        }                                                                    \
-        printf("\n");                                                        \
-    }                                                                        \
-
-static void print_codec(const AVCodec *c)
-{
-    int encoder = av_codec_is_encoder(c);
-
-    printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name,
-           c->long_name ? c->long_name : "");
-
-    if (c->type == AVMEDIA_TYPE_VIDEO) {
-        printf("    Threading capabilities: ");
-        switch (c->capabilities & (CODEC_CAP_FRAME_THREADS |
-                                   CODEC_CAP_SLICE_THREADS)) {
-        case CODEC_CAP_FRAME_THREADS |
-             CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
-        case CODEC_CAP_FRAME_THREADS: printf("frame");           break;
-        case CODEC_CAP_SLICE_THREADS: printf("slice");           break;
-        default:                      printf("no");              break;
-        }
-        printf("\n");
-    }
-
-    if (c->supported_framerates) {
-        const AVRational *fps = c->supported_framerates;
-
-        printf("    Supported framerates:");
-        while (fps->num) {
-            printf(" %d/%d", fps->num, fps->den);
-            fps++;
-        }
-        printf("\n");
-    }
-    PRINT_CODEC_SUPPORTED(c, pix_fmts, enum AVPixelFormat, "pixel formats",
-                          AV_PIX_FMT_NONE, GET_PIX_FMT_NAME);
-    PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0,
-                          GET_SAMPLE_RATE_NAME);
-    PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats",
-                          AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME);
-    PRINT_CODEC_SUPPORTED(c, channel_layouts, uint64_t, "channel layouts",
-                          0, GET_CH_LAYOUT_DESC);
-
-    if (c->priv_class) {
-        show_help_children(c->priv_class,
-                           AV_OPT_FLAG_ENCODING_PARAM |
-                           AV_OPT_FLAG_DECODING_PARAM);
-    }
-}
-
-static char get_media_type_char(enum AVMediaType type)
-{
-    switch (type) {
-        case AVMEDIA_TYPE_VIDEO:    return 'V';
-        case AVMEDIA_TYPE_AUDIO:    return 'A';
-        case AVMEDIA_TYPE_SUBTITLE: return 'S';
-        default:                    return '?';
-    }
-}
-
-static const AVCodec *next_codec_for_id(enum AVCodecID id, const AVCodec *prev,
-                                        int encoder)
-{
-    while ((prev = av_codec_next(prev))) {
-        if (prev->id == id &&
-            (encoder ? av_codec_is_encoder(prev) : av_codec_is_decoder(prev)))
-            return prev;
-    }
-    return NULL;
-}
-
-static void print_codecs_for_id(enum AVCodecID id, int encoder)
-{
-    const AVCodec *codec = NULL;
-
-    printf(" (%s: ", encoder ? "encoders" : "decoders");
-
-    while ((codec = next_codec_for_id(id, codec, encoder)))
-        printf("%s ", codec->name);
-
-    printf(")");
-}
-
-int show_codecs(void *optctx, const char *opt, const char *arg)
-{
-    const AVCodecDescriptor *desc = NULL;
-
-    printf("Codecs:\n"
-           " D..... = Decoding supported\n"
-           " .E.... = Encoding supported\n"
-           " ..V... = Video codec\n"
-           " ..A... = Audio codec\n"
-           " ..S... = Subtitle codec\n"
-           " ...I.. = Intra frame-only codec\n"
-           " ....L. = Lossy compression\n"
-           " .....S = Lossless compression\n"
-           " -------\n");
-    while ((desc = avcodec_descriptor_next(desc))) {
-        const AVCodec *codec = NULL;
-
-        printf(avcodec_find_decoder(desc->id) ? "D" : ".");
-        printf(avcodec_find_encoder(desc->id) ? "E" : ".");
-
-        printf("%c", get_media_type_char(desc->type));
-        printf((desc->props & AV_CODEC_PROP_INTRA_ONLY) ? "I" : ".");
-        printf((desc->props & AV_CODEC_PROP_LOSSY)      ? "L" : ".");
-        printf((desc->props & AV_CODEC_PROP_LOSSLESS)   ? "S" : ".");
-
-        printf(" %-20s %s", desc->name, desc->long_name ? desc->long_name : "");
-
-        /* print decoders/encoders when there's more than one or their
-         * names are different from codec name */
-        while ((codec = next_codec_for_id(desc->id, codec, 0))) {
-            if (strcmp(codec->name, desc->name)) {
-                print_codecs_for_id(desc->id, 0);
-                break;
-            }
-        }
-        codec = NULL;
-        while ((codec = next_codec_for_id(desc->id, codec, 1))) {
-            if (strcmp(codec->name, desc->name)) {
-                print_codecs_for_id(desc->id, 1);
-                break;
-            }
-        }
-
-        printf("\n");
-    }
-    return 0;
-}
-
-static void print_codecs(int encoder)
-{
-    const AVCodecDescriptor *desc = NULL;
-
-    printf("%s:\n"
-           " V... = Video\n"
-           " A... = Audio\n"
-           " S... = Subtitle\n"
-           " .F.. = Frame-level multithreading\n"
-           " ..S. = Slice-level multithreading\n"
-           " ...X = Codec is experimental\n"
-           " ---\n",
-           encoder ? "Encoders" : "Decoders");
-    while ((desc = avcodec_descriptor_next(desc))) {
-        const AVCodec *codec = NULL;
-
-        while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
-            printf("%c", get_media_type_char(desc->type));
-            printf((codec->capabilities & CODEC_CAP_FRAME_THREADS) ? "F" : ".");
-            printf((codec->capabilities & CODEC_CAP_SLICE_THREADS) ? "S" : ".");
-            printf((codec->capabilities & CODEC_CAP_EXPERIMENTAL)  ? "X" : ".");
-
-            printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : "");
-            if (strcmp(codec->name, desc->name))
-                printf(" (codec %s)", desc->name);
-
-            printf("\n");
-        }
-    }
-}
-
-int show_decoders(void *optctx, const char *opt, const char *arg)
-{
-    print_codecs(0);
-    return 0;
-}
-
-int show_encoders(void *optctx, const char *opt, const char *arg)
-{
-    print_codecs(1);
-    return 0;
-}
-
-int show_bsfs(void *optctx, const char *opt, const char *arg)
-{
-    AVBitStreamFilter *bsf = NULL;
-
-    printf("Bitstream filters:\n");
-    while ((bsf = av_bitstream_filter_next(bsf)))
-        printf("%s\n", bsf->name);
-    printf("\n");
-    return 0;
-}
-
-int show_protocols(void *optctx, const char *opt, const char *arg)
-{
-    void *opaque = NULL;
-    const char *name;
-
-    printf("Supported file protocols:\n"
-           "Input:\n");
-    while ((name = avio_enum_protocols(&opaque, 0)))
-        printf("%s\n", name);
-    printf("Output:\n");
-    while ((name = avio_enum_protocols(&opaque, 1)))
-        printf("%s\n", name);
-    return 0;
-}
-
-int show_filters(void *optctx, const char *opt, const char *arg)
-{
-    const AVFilter av_unused(*filter) = NULL;
-
-    printf("Filters:\n");
-#if CONFIG_AVFILTER
-    while ((filter = avfilter_next(filter)))
-        printf("%-16s %s\n", filter->name, filter->description);
-#endif
-    return 0;
-}
-
-int show_pix_fmts(void *optctx, const char *opt, const char *arg)
-{
-    const AVPixFmtDescriptor *pix_desc = NULL;
-
-    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
-
-    while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) {
-        enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc);
-        printf("%c%c%c%c%c %-16s       %d            %2d\n",
-               sws_isSupportedInput (pix_fmt)              ? 'I' : '.',
-               sws_isSupportedOutput(pix_fmt)              ? 'O' : '.',
-               pix_desc->flags & AV_PIX_FMT_FLAG_HWACCEL   ? 'H' : '.',
-               pix_desc->flags & AV_PIX_FMT_FLAG_PAL       ? 'P' : '.',
-               pix_desc->flags & AV_PIX_FMT_FLAG_BITSTREAM ? 'B' : '.',
-               pix_desc->name,
-               pix_desc->nb_components,
-               av_get_bits_per_pixel(pix_desc));
-    }
-    return 0;
-}
-
-int show_sample_fmts(void *optctx, const char *opt, const char *arg)
-{
-    int i;
-    char fmt_str[128];
-    for (i = -1; i < AV_SAMPLE_FMT_NB; i++)
-        printf("%s\n", av_get_sample_fmt_string(fmt_str, sizeof(fmt_str), i));
-    return 0;
-}
-
-static void show_help_codec(const char *name, int encoder)
-{
-    const AVCodecDescriptor *desc;
-    const AVCodec *codec;
-
-    if (!name) {
-        av_log(NULL, AV_LOG_ERROR, "No codec name specified.\n");
-        return;
-    }
-
-    codec = encoder ? avcodec_find_encoder_by_name(name) :
-                      avcodec_find_decoder_by_name(name);
-
-    if (codec)
-        print_codec(codec);
-    else if ((desc = avcodec_descriptor_get_by_name(name))) {
-        int printed = 0;
-
-        while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
-            printed = 1;
-            print_codec(codec);
-        }
-
-        if (!printed) {
-            av_log(NULL, AV_LOG_ERROR, "Codec '%s' is known to Libav, "
-                   "but no %s for it are available. Libav might need to be "
-                   "recompiled with additional external libraries.\n",
-                   name, encoder ? "encoders" : "decoders");
-        }
-    } else {
-        av_log(NULL, AV_LOG_ERROR, "Codec '%s' is not recognized by Libav.\n",
-               name);
-    }
-}
-
-static void show_help_demuxer(const char *name)
-{
-    const AVInputFormat *fmt = av_find_input_format(name);
-
-    if (!fmt) {
-        av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name);
-        return;
-    }
-
-    printf("Demuxer %s [%s]:\n", fmt->name, fmt->long_name);
-
-    if (fmt->extensions)
-        printf("    Common extensions: %s.\n", fmt->extensions);
-
-    if (fmt->priv_class)
-        show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM);
-}
-
-static void show_help_muxer(const char *name)
-{
-    const AVCodecDescriptor *desc;
-    const AVOutputFormat *fmt = av_guess_format(name, NULL, NULL);
-
-    if (!fmt) {
-        av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name);
-        return;
-    }
-
-    printf("Muxer %s [%s]:\n", fmt->name, fmt->long_name);
-
-    if (fmt->extensions)
-        printf("    Common extensions: %s.\n", fmt->extensions);
-    if (fmt->mime_type)
-        printf("    Mime type: %s.\n", fmt->mime_type);
-    if (fmt->video_codec != AV_CODEC_ID_NONE &&
-        (desc = avcodec_descriptor_get(fmt->video_codec))) {
-        printf("    Default video codec: %s.\n", desc->name);
-    }
-    if (fmt->audio_codec != AV_CODEC_ID_NONE &&
-        (desc = avcodec_descriptor_get(fmt->audio_codec))) {
-        printf("    Default audio codec: %s.\n", desc->name);
-    }
-    if (fmt->subtitle_codec != AV_CODEC_ID_NONE &&
-        (desc = avcodec_descriptor_get(fmt->subtitle_codec))) {
-        printf("    Default subtitle codec: %s.\n", desc->name);
-    }
-
-    if (fmt->priv_class)
-        show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM);
-}
-
-#if CONFIG_AVFILTER
-static void show_help_filter(const char *name)
-{
-    const AVFilter *f = avfilter_get_by_name(name);
-    int i, count;
-
-    if (!name) {
-        av_log(NULL, AV_LOG_ERROR, "No filter name specified.\n");
-        return;
-    } else if (!f) {
-        av_log(NULL, AV_LOG_ERROR, "Unknown filter '%s'.\n", name);
-        return;
-    }
-
-    printf("Filter %s [%s]:\n", f->name, f->description);
-
-    if (f->flags & AVFILTER_FLAG_SLICE_THREADS)
-        printf("    slice threading supported\n");
-
-    printf("    Inputs:\n");
-    count = avfilter_pad_count(f->inputs);
-    for (i = 0; i < count; i++) {
-        printf("        %d %s (%s)\n", i, avfilter_pad_get_name(f->inputs, i),
-               media_type_string(avfilter_pad_get_type(f->inputs, i)));
-    }
-    if (f->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)
-        printf("        dynamic (depending on the options)\n");
-
-    printf("    Outputs:\n");
-    count = avfilter_pad_count(f->outputs);
-    for (i = 0; i < count; i++) {
-        printf("        %d %s (%s)\n", i, avfilter_pad_get_name(f->outputs, i),
-               media_type_string(avfilter_pad_get_type(f->outputs, i)));
-    }
-    if (f->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS)
-        printf("        dynamic (depending on the options)\n");
-
-    if (f->priv_class)
-        show_help_children(f->priv_class, AV_OPT_FLAG_VIDEO_PARAM |
-                                          AV_OPT_FLAG_AUDIO_PARAM);
-}
-#endif
-
-int show_help(void *optctx, const char *opt, const char *arg)
-{
-    char *topic, *par;
-    av_log_set_callback(log_callback_help);
-
-    topic = av_strdup(arg ? arg : "");
-    par = strchr(topic, '=');
-    if (par)
-        *par++ = 0;
-
-    if (!*topic) {
-        show_help_default(topic, par);
-    } else if (!strcmp(topic, "decoder")) {
-        show_help_codec(par, 0);
-    } else if (!strcmp(topic, "encoder")) {
-        show_help_codec(par, 1);
-    } else if (!strcmp(topic, "demuxer")) {
-        show_help_demuxer(par);
-    } else if (!strcmp(topic, "muxer")) {
-        show_help_muxer(par);
-#if CONFIG_AVFILTER
-    } else if (!strcmp(topic, "filter")) {
-        show_help_filter(par);
-#endif
-    } else {
-        show_help_default(topic, par);
-    }
-
-    av_freep(&topic);
-    return 0;
-}
-
-int read_yesno(void)
-{
-    int c = getchar();
-    int yesno = (av_toupper(c) == 'Y');
-
-    while (c != '\n' && c != EOF)
-        c = getchar();
-
-    return yesno;
-}
-
-int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
-{
-    int ret;
-    FILE *f = fopen(filename, "rb");
-
-    if (!f) {
-        av_log(NULL, AV_LOG_ERROR, "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) {
-        av_log(NULL, AV_LOG_ERROR, "Could not allocate file buffer\n");
-        fclose(f);
-        return AVERROR(ENOMEM);
-    }
-    ret = fread(*bufptr, 1, *size, f);
-    if (ret < *size) {
-        av_free(*bufptr);
-        if (ferror(f)) {
-            av_log(NULL, AV_LOG_ERROR, "Error while reading file '%s': %s\n",
-                   filename, strerror(errno));
-            ret = AVERROR(errno);
-        } else
-            ret = AVERROR_EOF;
-    } else {
-        ret = 0;
-        (*bufptr)[(*size)++] = '\0';
-    }
-
-    fclose(f);
-    return ret;
-}
-
-void init_pts_correction(PtsCorrectionContext *ctx)
-{
-    ctx->num_faulty_pts = ctx->num_faulty_dts = 0;
-    ctx->last_pts = ctx->last_dts = INT64_MIN;
-}
-
-int64_t guess_correct_pts(PtsCorrectionContext *ctx, int64_t reordered_pts,
-                          int64_t dts)
-{
-    int64_t pts = AV_NOPTS_VALUE;
-
-    if (dts != AV_NOPTS_VALUE) {
-        ctx->num_faulty_dts += dts <= ctx->last_dts;
-        ctx->last_dts = dts;
-    }
-    if (reordered_pts != AV_NOPTS_VALUE) {
-        ctx->num_faulty_pts += reordered_pts <= ctx->last_pts;
-        ctx->last_pts = reordered_pts;
-    }
-    if ((ctx->num_faulty_pts<=ctx->num_faulty_dts || dts == AV_NOPTS_VALUE)
-        && reordered_pts != AV_NOPTS_VALUE)
-        pts = reordered_pts;
-    else
-        pts = dts;
-
-    return pts;
-}
-
-FILE *get_preset_file(char *filename, size_t filename_size,
-                      const char *preset_name, int is_path,
-                      const char *codec_name)
-{
-    FILE *f = NULL;
-    int i;
-    const char *base[3] = { getenv("AVCONV_DATADIR"),
-                            getenv("HOME"),
-                            AVCONV_DATADIR, };
-
-    if (is_path) {
-        av_strlcpy(filename, preset_name, filename_size);
-        f = fopen(filename, "r");
-    } else {
-        for (i = 0; i < 3 && !f; i++) {
-            if (!base[i])
-                continue;
-            snprintf(filename, filename_size, "%s%s/%s.avpreset", base[i],
-                     i != 1 ? "" : "/.avconv", preset_name);
-            f = fopen(filename, "r");
-            if (!f && codec_name) {
-                snprintf(filename, filename_size,
-                         "%s%s/%s-%s.avpreset",
-                         base[i], i != 1 ? "" : "/.avconv", codec_name,
-                         preset_name);
-                f = fopen(filename, "r");
-            }
-        }
-    }
-
-    return f;
-}
-
-int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
-{
-    if (*spec <= '9' && *spec >= '0') /* opt:index */
-        return strtol(spec, NULL, 0) == st->index;
-    else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||
-             *spec == 't') { /* opt:[vasdt] */
-        enum AVMediaType type;
-
-        switch (*spec++) {
-        case 'v': type = AVMEDIA_TYPE_VIDEO;      break;
-        case 'a': type = AVMEDIA_TYPE_AUDIO;      break;
-        case 's': type = AVMEDIA_TYPE_SUBTITLE;   break;
-        case 'd': type = AVMEDIA_TYPE_DATA;       break;
-        case 't': type = AVMEDIA_TYPE_ATTACHMENT; break;
-        default:  av_assert0(0);
-        }
-        if (type != st->codec->codec_type)
-            return 0;
-        if (*spec++ == ':') { /* possibly followed by :index */
-            int i, index = strtol(spec, NULL, 0);
-            for (i = 0; i < s->nb_streams; i++)
-                if (s->streams[i]->codec->codec_type == type && index-- == 0)
-                   return i == st->index;
-            return 0;
-        }
-        return 1;
-    } else if (*spec == 'p' && *(spec + 1) == ':') {
-        int prog_id, i, j;
-        char *endptr;
-        spec += 2;
-        prog_id = strtol(spec, &endptr, 0);
-        for (i = 0; i < s->nb_programs; i++) {
-            if (s->programs[i]->id != prog_id)
-                continue;
-
-            if (*endptr++ == ':') {
-                int stream_idx = strtol(endptr, NULL, 0);
-                return stream_idx >= 0 &&
-                    stream_idx < s->programs[i]->nb_stream_indexes &&
-                    st->index == s->programs[i]->stream_index[stream_idx];
-            }
-
-            for (j = 0; j < s->programs[i]->nb_stream_indexes; j++)
-                if (st->index == s->programs[i]->stream_index[j])
-                    return 1;
-        }
-        return 0;
-    } else if (!*spec) /* empty specifier, matches everything */
-        return 1;
-
-    av_log(s, AV_LOG_ERROR, "Invalid stream specifier: %s.\n", spec);
-    return AVERROR(EINVAL);
-}
-
-AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
-                                AVFormatContext *s, AVStream *st, AVCodec *codec)
-{
-    AVDictionary    *ret = NULL;
-    AVDictionaryEntry *t = NULL;
-    int            flags = s->oformat ? AV_OPT_FLAG_ENCODING_PARAM
-                                      : AV_OPT_FLAG_DECODING_PARAM;
-    char          prefix = 0;
-    const AVClass    *cc = avcodec_get_class();
-
-    if (!codec)
-        codec            = s->oformat ? avcodec_find_encoder(codec_id)
-                                      : avcodec_find_decoder(codec_id);
-
-    switch (st->codec->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-        prefix  = 'v';
-        flags  |= AV_OPT_FLAG_VIDEO_PARAM;
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        prefix  = 'a';
-        flags  |= AV_OPT_FLAG_AUDIO_PARAM;
-        break;
-    case AVMEDIA_TYPE_SUBTITLE:
-        prefix  = 's';
-        flags  |= AV_OPT_FLAG_SUBTITLE_PARAM;
-        break;
-    }
-
-    while (t = av_dict_get(opts, "", t, AV_DICT_IGNORE_SUFFIX)) {
-        char *p = strchr(t->key, ':');
-
-        /* check stream specification in opt name */
-        if (p)
-            switch (check_stream_specifier(s, st, p + 1)) {
-            case  1: *p = 0; break;
-            case  0:         continue;
-            default:         return NULL;
-            }
-
-        if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) ||
-            (codec && codec->priv_class &&
-             av_opt_find(&codec->priv_class, t->key, NULL, flags,
-                         AV_OPT_SEARCH_FAKE_OBJ)))
-            av_dict_set(&ret, t->key, t->value, 0);
-        else if (t->key[0] == prefix &&
-                 av_opt_find(&cc, t->key + 1, NULL, flags,
-                             AV_OPT_SEARCH_FAKE_OBJ))
-            av_dict_set(&ret, t->key + 1, t->value, 0);
-
-        if (p)
-            *p = ':';
-    }
-    return ret;
-}
-
-AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
-                                           AVDictionary *codec_opts)
-{
-    int i;
-    AVDictionary **opts;
-
-    if (!s->nb_streams)
-        return NULL;
-    opts = av_mallocz(s->nb_streams * sizeof(*opts));
-    if (!opts) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Could not alloc memory for stream options.\n");
-        return NULL;
-    }
-    for (i = 0; i < s->nb_streams; i++)
-        opts[i] = filter_codec_opts(codec_opts, s->streams[i]->codec->codec_id,
-                                    s, s->streams[i], NULL);
-    return opts;
-}
-
-void *grow_array(void *array, int elem_size, int *size, int new_size)
-{
-    if (new_size >= INT_MAX / elem_size) {
-        av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
-        exit_program(1);
-    }
-    if (*size < new_size) {
-        uint8_t *tmp = av_realloc(array, new_size*elem_size);
-        if (!tmp) {
-            av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
-            exit_program(1);
-        }
-        memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
-        *size = new_size;
-        return tmp;
-    }
-    return array;
-}
-
-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";
-    }
-}
diff --git a/deps/libav/cmdutils.h b/deps/libav/cmdutils.h
deleted file mode 100644
index f1b69f9..0000000
--- a/deps/libav/cmdutils.h
+++ /dev/null
@@ -1,558 +0,0 @@
-/*
- * Various utilities for command line tools
- * copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBAV_CMDUTILS_H
-#define LIBAV_CMDUTILS_H
-
-#include <stdint.h>
-
-#include "libavcodec/avcodec.h"
-#include "libavfilter/avfilter.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 AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
-extern AVFormatContext *avformat_opts;
-extern struct SwsContext *sws_opts;
-extern AVDictionary *format_opts, *codec_opts, *resample_opts;
-
-/**
- * Register a program-specific cleanup routine.
- */
-void register_exit(void (*cb)(int ret));
-
-/**
- * Wraps exit with a program-specific cleanup routine.
- */
-void exit_program(int ret);
-
-/**
- * Initialize the cmdutils option system, in particular
- * allocate the *_opts contexts.
- */
-void init_opts(void);
-/**
- * Uninitialize the cmdutils option system, in particular
- * free the *_opts contexts and their contents.
- */
-void uninit_opts(void);
-
-/**
- * Trivial log callback.
- * Only suitable for show_help and similar since it lacks prefix handling.
- */
-void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
-
-/**
- * Override the cpuflags mask.
- */
-int opt_cpuflags(void *optctx, const char *opt, const char *arg);
-
-/**
- * Fallback for options that are not explicitly handled, these will be
- * parsed through AVOptions.
- */
-int opt_default(void *optctx, const char *opt, const char *arg);
-
-/**
- * Set the libav* libraries log level.
- */
-int opt_loglevel(void *optctx, const char *opt, const char *arg);
-
-/**
- * Limit the execution time.
- */
-int opt_timelimit(void *optctx, const char *opt, const char *arg);
-
-/**
- * Parse a string and return its corresponding value as a double.
- * Exit 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 command line 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);
-
-/**
- * Parse a string specifying a time and return its corresponding
- * value as a number of microseconds. Exit from the application if
- * the string cannot be correctly parsed.
- *
- * @param context the context of the value to be set (e.g. the
- * corresponding command line 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 SpecifierOpt {
-    char *specifier;    /**< stream/chapter/program/... specifier */
-    union {
-        uint8_t *str;
-        int        i;
-        int64_t  i64;
-        float      f;
-        double   dbl;
-    } u;
-} SpecifierOpt;
-
-typedef struct OptionDef {
-    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_INT    0x0080
-#define OPT_FLOAT  0x0100
-#define OPT_SUBTITLE 0x0200
-#define OPT_INT64  0x0400
-#define OPT_EXIT   0x0800
-#define OPT_DATA   0x1000
-#define OPT_PERFILE  0x2000     /* the option is per-file (currently avconv-only).
-                                   implied by OPT_OFFSET or OPT_SPEC */
-#define OPT_OFFSET 0x4000       /* option is specified as an offset in a passed optctx */
-#define OPT_SPEC   0x8000       /* option is to be stored in an array of SpecifierOpt.
-                                   Implies OPT_OFFSET. Next element after the offset is
-                                   an int containing element count in the array. */
-#define OPT_TIME  0x10000
-#define OPT_DOUBLE 0x20000
-#define OPT_INPUT  0x40000
-#define OPT_OUTPUT 0x80000
-     union {
-        void *dst_ptr;
-        int (*func_arg)(void *, const char *, const char *);
-        size_t off;
-    } u;
-    const char *help;
-    const char *argname;
-} OptionDef;
-
-/**
- * Print help for all options matching specified flags.
- *
- * @param options a list of options
- * @param msg title of this group. Only printed if at least one option matches.
- * @param req_flags print only options which have all those flags set.
- * @param rej_flags don't print options which have any of those flags set.
- * @param alt_flags print only options that have at least one of those flags set
- */
-void show_help_options(const OptionDef *options, const char *msg, int req_flags,
-                       int rej_flags, int alt_flags);
-
-/**
- * Show help for all options with given flags in class and all its
- * children.
- */
-void show_help_children(const AVClass *class, int flags);
-
-/**
- * Per-avtool specific help handler. Implemented in each
- * avtool, called by show_help().
- */
-void show_help_default(const char *opt, const char *arg);
-
-/**
- * Generic -h handler common to all avtools.
- */
-int show_help(void *optctx, const char *opt, const char *arg);
-
-/**
- * Parse the command line arguments.
- *
- * @param optctx an opaque options context
- * @param argc   number of command line arguments
- * @param argv   values of 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(void *optctx, int argc, char **argv, const OptionDef *options,
-                   void (* parse_arg_function)(void *optctx, const char*));
-
-/**
- * Parse one given option.
- *
- * @return on success 1 if arg was consumed, 0 otherwise; negative number on error
- */
-int parse_option(void *optctx, const char *opt, const char *arg,
-                 const OptionDef *options);
-
-/**
- * An option extracted from the commandline.
- * Cannot use AVDictionary because of options like -map which can be
- * used multiple times.
- */
-typedef struct Option {
-    const OptionDef  *opt;
-    const char       *key;
-    const char       *val;
-} Option;
-
-typedef struct OptionGroupDef {
-    /**< group name */
-    const char *name;
-    /**
-     * Option to be used as group separator. Can be NULL for groups which
-     * are terminated by a non-option argument (e.g. avconv output files)
-     */
-    const char *sep;
-    /**
-     * Option flags that must be set on each option that is
-     * applied to this group
-     */
-    int flags;
-} OptionGroupDef;
-
-typedef struct OptionGroup {
-    const OptionGroupDef *group_def;
-    const char *arg;
-
-    Option *opts;
-    int  nb_opts;
-
-    AVDictionary *codec_opts;
-    AVDictionary *format_opts;
-    AVDictionary *resample_opts;
-    struct SwsContext *sws_opts;
-} OptionGroup;
-
-/**
- * A list of option groups that all have the same group type
- * (e.g. input files or output files)
- */
-typedef struct OptionGroupList {
-    const OptionGroupDef *group_def;
-
-    OptionGroup *groups;
-    int       nb_groups;
-} OptionGroupList;
-
-typedef struct OptionParseContext {
-    OptionGroup global_opts;
-
-    OptionGroupList *groups;
-    int           nb_groups;
-
-    /* parsing state */
-    OptionGroup cur_group;
-} OptionParseContext;
-
-/**
- * Parse an options group and write results into optctx.
- *
- * @param optctx an app-specific options context. NULL for global options group
- */
-int parse_optgroup(void *optctx, OptionGroup *g);
-
-/**
- * Split the commandline into an intermediate form convenient for further
- * processing.
- *
- * The commandline is assumed to be composed of options which either belong to a
- * group (those with OPT_SPEC, OPT_OFFSET or OPT_PERFILE) or are global
- * (everything else).
- *
- * A group (defined by an OptionGroupDef struct) is a sequence of options
- * terminated by either a group separator option (e.g. -i) or a parameter that
- * is not an option (doesn't start with -). A group without a separator option
- * must always be first in the supplied groups list.
- *
- * All options within the same group are stored in one OptionGroup struct in an
- * OptionGroupList, all groups with the same group definition are stored in one
- * OptionGroupList in OptionParseContext.groups. The order of group lists is the
- * same as the order of group definitions.
- */
-int split_commandline(OptionParseContext *octx, int argc, char *argv[],
-                      const OptionDef *options,
-                      const OptionGroupDef *groups, int nb_groups);
-
-/**
- * Free all allocated memory in an OptionParseContext.
- */
-void uninit_parse_context(OptionParseContext *octx);
-
-/**
- * Find the '-loglevel' option in the command line args and apply it.
- */
-void parse_loglevel(int argc, char **argv, const OptionDef *options);
-
-/**
- * Return index of option opt in argv or 0 if not found.
- */
-int locate_option(int argc, char **argv, const OptionDef *options,
-                  const char *optname);
-
-/**
- * Check if the given stream matches a stream specifier.
- *
- * @param s  Corresponding format context.
- * @param st Stream from s to be checked.
- * @param spec A stream specifier of the [v|a|s|d]:[\<stream index\>] form.
- *
- * @return 1 if the stream matches, 0 if it doesn't, <0 on error
- */
-int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
-
-/**
- * Filter out options for given codec.
- *
- * Create a new options dictionary containing only the options from
- * opts which apply to the codec with ID codec_id.
- *
- * @param opts     dictionary to place options in
- * @param codec_id ID of the codec that should be filtered for
- * @param s Corresponding format context.
- * @param st A stream from s for which the options should be filtered.
- * @param codec The particular codec for which the options should be filtered.
- *              If null, the default one is looked up according to the codec id.
- * @return a pointer to the created dictionary
- */
-AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
-                                AVFormatContext *s, AVStream *st, AVCodec *codec);
-
-/**
- * Setup AVCodecContext options for avformat_find_stream_info().
- *
- * Create an array of dictionaries, one dictionary for each stream
- * contained in s.
- * Each dictionary will contain the options from codec_opts which can
- * be applied to the corresponding stream codec context.
- *
- * @return pointer to the created array of dictionaries, NULL if it
- * cannot be created
- */
-AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
-                                           AVDictionary *codec_opts);
-
-/**
- * Print 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);
-
-/**
- * Print 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);
-
-/**
- * Print the version of the program to stdout. The version message
- * depends on the current versions of the repository and of the libav*
- * libraries.
- */
-int show_version(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print the license of the program to stdout. The license depends on
- * the license of the libraries compiled into the program.
- */
-int show_license(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print a listing containing all the formats supported by the
- * program.
- */
-int show_formats(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print a listing containing all the codecs supported by the
- * program.
- */
-int show_codecs(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print a listing containing all the decoders supported by the
- * program.
- */
-int show_decoders(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print a listing containing all the encoders supported by the
- * program.
- */
-int show_encoders(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print a listing containing all the filters supported by the
- * program.
- */
-int show_filters(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print a listing containing all the bit stream filters supported by the
- * program.
- */
-int show_bsfs(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print a listing containing all the protocols supported by the
- * program.
- */
-int show_protocols(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print a listing containing all the pixel formats supported by the
- * program.
- */
-int show_pix_fmts(void *optctx, const char *opt, const char *arg);
-
-/**
- * Print a listing containing all the sample formats supported by the
- * program.
- */
-int show_sample_fmts(void *optctx, const char *opt, const char *arg);
-
-/**
- * Return a positive value if a line read from standard input
- * starts with [yY], otherwise return 0.
- */
-int read_yesno(void);
-
-/**
- * Read the file with name filename, and put its content in a newly
- * allocated 0-terminated buffer.
- *
- * @param filename file to read from
- * @param bufptr location where pointer to buffer is returned
- * @param size   location where size of buffer is returned
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR error code in case of failure.
- */
-int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
-
-typedef struct PtsCorrectionContext {
-    int64_t num_faulty_pts; /// Number of incorrect PTS values so far
-    int64_t num_faulty_dts; /// Number of incorrect DTS values so far
-    int64_t last_pts;       /// PTS of the last frame
-    int64_t last_dts;       /// DTS of the last frame
-} PtsCorrectionContext;
-
-/**
- * Reset the state of the PtsCorrectionContext.
- */
-void init_pts_correction(PtsCorrectionContext *ctx);
-
-/**
- * Attempt to guess proper monotonic timestamps for decoded video frames
- * which might have incorrect times. Input timestamps may wrap around, in
- * which case the output will as well.
- *
- * @param ctx the PtsCorrectionContext carrying stream pts information
- * @param pts the pts field of the decoded AVPacket, as passed through
- * AVCodecContext.reordered_opaque
- * @param dts the dts field of the decoded AVPacket
- * @return one of the input values, may be AV_NOPTS_VALUE
- */
-int64_t guess_correct_pts(PtsCorrectionContext *ctx, int64_t pts, int64_t dts);
-
-/**
- * Get a file corresponding to a preset file.
- *
- * If is_path is non-zero, look for the file in the path preset_name.
- * Otherwise search for a file named arg.avpreset in the directories
- * $AVCONV_DATADIR (if set), $HOME/.avconv, and in the datadir defined
- * at configuration time, in that order. If no such file is found and
- * codec_name is defined, then search for a file named
- * codec_name-preset_name.avpreset in the above-mentioned directories.
- *
- * @param filename buffer where the name of the found filename is written
- * @param filename_size size in bytes of the filename buffer
- * @param preset_name name of the preset to search
- * @param is_path tell if preset_name is a filename path
- * @param codec_name name of the codec for which to look for the
- * preset, may be NULL
- */
-FILE *get_preset_file(char *filename, size_t filename_size,
-                      const char *preset_name, int is_path, const char *codec_name);
-
-/**
- * Realloc array to hold new_size elements of elem_size.
- * Calls exit() on failure.
- *
- * @param array array to reallocate
- * @param elem_size size in bytes of each element
- * @param size new element count will be written here
- * @param new_size number of elements to place in reallocated array
- * @return reallocated array
- */
-void *grow_array(void *array, int elem_size, int *size, int new_size);
-
-/**
- * Get a string describing a media type.
- */
-const char *media_type_string(enum AVMediaType media_type);
-
-#define GROW_ARRAY(array, nb_elems)\
-    array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)
-
-#define GET_PIX_FMT_NAME(pix_fmt)\
-    const char *name = av_get_pix_fmt_name(pix_fmt);
-
-#define GET_SAMPLE_FMT_NAME(sample_fmt)\
-    const char *name = av_get_sample_fmt_name(sample_fmt)
-
-#define GET_SAMPLE_RATE_NAME(rate)\
-    char name[16];\
-    snprintf(name, sizeof(name), "%d", rate);
-
-#define GET_CH_LAYOUT_NAME(ch_layout)\
-    char name[16];\
-    snprintf(name, sizeof(name), "0x%"PRIx64, ch_layout);
-
-#define GET_CH_LAYOUT_DESC(ch_layout)\
-    char name[128];\
-    av_get_channel_layout_string(name, sizeof(name), 0, ch_layout);
-
-#endif /* LIBAV_CMDUTILS_H */
diff --git a/deps/libav/cmdutils_common_opts.h b/deps/libav/cmdutils_common_opts.h
deleted file mode 100644
index 8693f59..0000000
--- a/deps/libav/cmdutils_common_opts.h
+++ /dev/null
@@ -1,18 +0,0 @@
-    { "L"          , OPT_EXIT, {.func_arg = show_license},      "show license" },
-    { "h"          , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
-    { "?"          , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
-    { "help"       , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
-    { "-help"      , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
-    { "version"    , OPT_EXIT, {.func_arg = show_version},      "show version" },
-    { "formats"    , OPT_EXIT, {.func_arg = show_formats  },    "show available formats" },
-    { "codecs"     , OPT_EXIT, {.func_arg = show_codecs   },    "show available codecs" },
-    { "decoders"   , OPT_EXIT, {.func_arg = show_decoders },    "show available decoders" },
-    { "encoders"   , OPT_EXIT, {.func_arg = show_encoders },    "show available encoders" },
-    { "bsfs"       , OPT_EXIT, {.func_arg = show_bsfs     },    "show available bit stream filters" },
-    { "protocols"  , OPT_EXIT, {.func_arg = show_protocols},    "show available protocols" },
-    { "filters"    , OPT_EXIT, {.func_arg = show_filters  },    "show available filters" },
-    { "pix_fmts"   , OPT_EXIT, {.func_arg = show_pix_fmts },    "show available pixel formats" },
-    { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
-    { "loglevel"   , HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
-    { "v",           HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
-    { "cpuflags",    HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags },  "set CPU flags mask", "mask" },
diff --git a/deps/libav/common.mak b/deps/libav/common.mak
deleted file mode 100644
index ade9376..0000000
--- a/deps/libav/common.mak
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# common bits used by all libraries
-#
-
-# first so "all" becomes default target
-all: all-yes
-
-include $(SRC_PATH)/arch.mak
-
-OBJS      += $(OBJS-yes)
-FFLIBS    := $(FFLIBS-yes) $(FFLIBS)
-TESTPROGS += $(TESTPROGS-yes)
-
-LDLIBS       = $(FFLIBS:%=%$(BUILDSUF))
-FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
-
-OBJS      := $(sort $(OBJS:%=$(SUBDIR)%))
-TESTOBJS  := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
-TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
-HOSTOBJS  := $(HOSTPROGS:%=$(SUBDIR)%.o)
-HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
-TOOLS     += $(TOOLS-yes)
-TOOLOBJS  := $(TOOLS:%=tools/%.o)
-TOOLS     := $(TOOLS:%=tools/%$(EXESUF))
-HEADERS   += $(HEADERS-yes)
-
-PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
-DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
-
-SRC_DIR    := $(SRC_PATH)/lib$(NAME)
-ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
-SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
-SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
-HOBJS        = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
-checkheaders: $(HOBJS)
-.SECONDARY:   $(HOBJS:.o=.c)
-
-alltools: $(TOOLS)
-
-$(HOSTOBJS): %.o: %.c
-	$(COMPILE_HOSTC)
-
-$(HOSTPROGS): %$(HOSTEXESUF): %.o
-	$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTLIBS)
-
-$(OBJS):     | $(sort $(dir $(OBJS)))
-$(HOBJS):    | $(sort $(dir $(HOBJS)))
-$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
-$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
-$(TOOLOBJS): | tools
-
-OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
-
-CLEANSUFFIXES     = *.d *.o *~ *.h.c *.map *.ver *.gcno *.gcda
-DISTCLEANSUFFIXES = *.pc
-LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
-
-define RULES
-clean::
-	$(RM) $(OBJS) $(OBJS:.o=.d)
-	$(RM) $(HOSTPROGS)
-	$(RM) $(TOOLS)
-endef
-
-$(eval $(RULES))
-
--include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d))
diff --git a/deps/libav/compat/aix/math.h b/deps/libav/compat/aix/math.h
deleted file mode 100644
index 380f878..0000000
--- a/deps/libav/compat/aix/math.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Work around the class() function in AIX math.h clashing with
- * identifiers named "class".
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBAV_COMPAT_AIX_MATH_H
-#define LIBAV_COMPAT_AIX_MATH_H
-
-#define class class_in_math_h_causes_problems
-
-#include_next <math.h>
-
-#undef class
-
-#endif /* LIBAV_COMPAT_AIX_MATH_H */
diff --git a/deps/libav/compat/getopt.c b/deps/libav/compat/getopt.c
deleted file mode 100644
index 7c646f6..0000000
--- a/deps/libav/compat/getopt.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * This file was copied from the following newsgroup posting:
- *
- * Newsgroups: mod.std.unix
- * Subject: public domain AT&T getopt source
- * Date: 3 Nov 85 19:34:15 GMT
- *
- * Here's something you've all been waiting for:  the AT&T public domain
- * source for getopt(3).  It is the code which was given out at the 1985
- * UNIFORUM conference in Dallas.  I obtained it by electronic mail
- * directly from AT&T.  The people there assure me that it is indeed
- * in the public domain.
- */
-
-#include <stdio.h>
-#include <string.h>
-
-static int opterr = 1;
-static int optind = 1;
-static int optopt;
-static char *optarg;
-
-static int getopt(int argc, char *argv[], char *opts)
-{
-    static int sp = 1;
-    int c;
-    char *cp;
-
-    if (sp == 1)
-        if (optind >= argc ||
-            argv[optind][0] != '-' || argv[optind][1] == '\0')
-            return EOF;
-        else if (!strcmp(argv[optind], "--")) {
-            optind++;
-            return EOF;
-        }
-    optopt = c = argv[optind][sp];
-    if (c == ':' || (cp = strchr(opts, c)) == NULL) {
-        fprintf(stderr, ": illegal option -- %c\n", c);
-        if (argv[optind][++sp] == '\0') {
-            optind++;
-            sp = 1;
-        }
-        return '?';
-    }
-    if (*++cp == ':') {
-        if (argv[optind][sp+1] != '\0')
-            optarg = &argv[optind++][sp+1];
-        else if(++optind >= argc) {
-            fprintf(stderr, ": option requires an argument -- %c\n", c);
-            sp = 1;
-            return '?';
-        } else
-            optarg = argv[optind++];
-        sp = 1;
-    } else {
-        if (argv[optind][++sp] == '\0') {
-            sp = 1;
-            optind++;
-        }
-        optarg = NULL;
-    }
-
-    return c;
-}
diff --git a/deps/libav/compat/msvcrt/snprintf.c b/deps/libav/compat/msvcrt/snprintf.c
deleted file mode 100644
index 0af7b54..0000000
--- a/deps/libav/compat/msvcrt/snprintf.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * C99-compatible snprintf() and vsnprintf() implementations
- * Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <limits.h>
-#include <string.h>
-
-#include "libavutil/error.h"
-
-#if !defined(va_copy) && defined(_MSC_VER)
-#define va_copy(dst, src) ((dst) = (src))
-#endif
-
-int avpriv_snprintf(char *s, size_t n, const char *fmt, ...)
-{
-    va_list ap;
-    int ret;
-
-    va_start(ap, fmt);
-    ret = avpriv_vsnprintf(s, n, fmt, ap);
-    va_end(ap);
-
-    return ret;
-}
-
-int avpriv_vsnprintf(char *s, size_t n, const char *fmt,
-                     va_list ap)
-{
-    int ret;
-    va_list ap_copy;
-
-    if (n == 0)
-        return _vscprintf(fmt, ap);
-    else if (n > INT_MAX)
-        return AVERROR(EOVERFLOW);
-
-    /* we use n - 1 here because if the buffer is not big enough, the MS
-     * runtime libraries don't add a terminating zero at the end. MSDN
-     * recommends to provide _snprintf/_vsnprintf() a buffer size that
-     * is one less than the actual buffer, and zero it before calling
-     * _snprintf/_vsnprintf() to workaround this problem.
-     * See http://msdn.microsoft.com/en-us/library/1kt27hek(v=vs.80).aspx */
-    memset(s, 0, n);
-    va_copy(ap_copy, ap);
-    ret = _vsnprintf(s, n - 1, fmt, ap_copy);
-    va_end(ap_copy);
-    if (ret == -1)
-        ret = _vscprintf(fmt, ap);
-
-    return ret;
-}
diff --git a/deps/libav/compat/plan9/head b/deps/libav/compat/plan9/head
deleted file mode 100755
index 2840b2d..0000000
--- a/deps/libav/compat/plan9/head
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-n=10
-
-case "$1" in
-    -n)  n=$2;      shift 2 ;;
-    -n*) n=${1#-n}; shift   ;;
-esac
-
-exec sed ${n}q "$@"
diff --git a/deps/libav/compat/plan9/main.c b/deps/libav/compat/plan9/main.c
deleted file mode 100644
index 97d7067..0000000
--- a/deps/libav/compat/plan9/main.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-int plan9_main(int argc, char **argv);
-
-#undef main
-int main(int argc, char **argv)
-{
-    /* The setfcr() function in lib9 is broken, must use asm. */
-#ifdef __i386
-    short fcr;
-    __asm__ volatile ("fstcw        %0 \n"
-                      "or      $63, %0 \n"
-                      "fldcw        %0 \n"
-                      : "=m"(fcr));
-#endif
-
-    return plan9_main(argc, argv);
-}
diff --git a/deps/libav/compat/plan9/printf b/deps/libav/compat/plan9/printf
deleted file mode 100755
index 1a70a9e..0000000
--- a/deps/libav/compat/plan9/printf
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec awk "BEGIN { for (i = 2; i < ARGC; i++) printf \"$1\", ARGV[i] }" "$@"
diff --git a/deps/libav/compat/strtod.c b/deps/libav/compat/strtod.c
deleted file mode 100644
index 258909f..0000000
--- a/deps/libav/compat/strtod.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * C99-compatible strtod() implementation
- * Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <limits.h>
-#include <stdlib.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/mathematics.h"
-
-static char *check_nan_suffix(char *s)
-{
-    char *start = s;
-
-    if (*s++ != '(')
-        return start;
-
-    while ((*s >= 'a' && *s <= 'z') || (*s >= 'A' && *s <= 'Z') ||
-           (*s >= '0' && *s <= '9') ||  *s == '_')
-        s++;
-
-    return *s == ')' ? s + 1 : start;
-}
-
-#undef strtod
-double strtod(const char *, char **);
-
-double avpriv_strtod(const char *nptr, char **endptr)
-{
-    char *end;
-    double res;
-
-    /* Skip leading spaces */
-    while (av_isspace(*nptr))
-        nptr++;
-
-    if (!av_strncasecmp(nptr, "infinity", 8)) {
-        end = nptr + 8;
-        res = INFINITY;
-    } else if (!av_strncasecmp(nptr, "inf", 3)) {
-        end = nptr + 3;
-        res = INFINITY;
-    } else if (!av_strncasecmp(nptr, "+infinity", 9)) {
-        end = nptr + 9;
-        res = INFINITY;
-    } else if (!av_strncasecmp(nptr, "+inf", 4)) {
-        end = nptr + 4;
-        res = INFINITY;
-    } else if (!av_strncasecmp(nptr, "-infinity", 9)) {
-        end = nptr + 9;
-        res = -INFINITY;
-    } else if (!av_strncasecmp(nptr, "-inf", 4)) {
-        end = nptr + 4;
-        res = -INFINITY;
-    } else if (!av_strncasecmp(nptr, "nan", 3)) {
-        end = check_nan_suffix(nptr + 3);
-        res = NAN;
-    } else if (!av_strncasecmp(nptr, "+nan", 4) ||
-               !av_strncasecmp(nptr, "-nan", 4)) {
-        end = check_nan_suffix(nptr + 4);
-        res = NAN;
-    } else if (!av_strncasecmp(nptr, "0x", 2) ||
-               !av_strncasecmp(nptr, "-0x", 3) ||
-               !av_strncasecmp(nptr, "+0x", 3)) {
-        /* FIXME this doesn't handle exponents, non-integers (float/double)
-         * and numbers too large for long long */
-        res = strtoll(nptr, &end, 16);
-    } else {
-        res = strtod(nptr, &end);
-    }
-
-    if (endptr)
-        *endptr = end;
-
-    return res;
-}
diff --git a/deps/libav/compat/tms470/math.h b/deps/libav/compat/tms470/math.h
deleted file mode 100644
index b686d4d..0000000
--- a/deps/libav/compat/tms470/math.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBAV_COMPAT_TMS470_MATH_H
-#define LIBAV_COMPAT_TMS470_MATH_H
-
-#include_next <math.h>
-
-#undef INFINITY
-#undef NAN
-
-#define INFINITY (*(const float*)((const unsigned []){ 0x7f800000 }))
-#define NAN      (*(const float*)((const unsigned []){ 0x7fc00000 }))
-
-#endif /* LIBAV_COMPAT_TMS470_MATH_H */
diff --git a/deps/libav/compat/w32pthreads.h b/deps/libav/compat/w32pthreads.h
deleted file mode 100644
index be275ed..0000000
--- a/deps/libav/compat/w32pthreads.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (C) 2010-2011 x264 project
- *
- * Authors: Steven Walters <kemuri9 at gmail.com>
- *          Pegasys Inc. <http://www.pegasys-inc.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * w32threads to pthreads wrapper
- */
-
-#ifndef LIBAV_COMPAT_W32PTHREADS_H
-#define LIBAV_COMPAT_W32PTHREADS_H
-
-/* Build up a pthread-like API using underlying Windows API. Have only static
- * methods so as to not conflict with a potentially linked in pthread-win32
- * library.
- * As most functions here are used without checking return values,
- * only implement return values as necessary. */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <process.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-
-typedef struct pthread_t {
-    void *handle;
-    void *(*func)(void* arg);
-    void *arg;
-    void *ret;
-} pthread_t;
-
-/* the conditional variable api for windows 6.0+ uses critical sections and
- * not mutexes */
-typedef CRITICAL_SECTION pthread_mutex_t;
-
-/* This is the CONDITIONAL_VARIABLE typedef for using Window's native
- * conditional variables on kernels 6.0+.
- * MinGW does not currently have this typedef. */
-typedef struct pthread_cond_t {
-    void *ptr;
-} pthread_cond_t;
-
-/* function pointers to conditional variable API on windows 6.0+ kernels */
-#if _WIN32_WINNT < 0x0600
-static void (WINAPI *cond_broadcast)(pthread_cond_t *cond);
-static void (WINAPI *cond_init)(pthread_cond_t *cond);
-static void (WINAPI *cond_signal)(pthread_cond_t *cond);
-static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
-                                DWORD milliseconds);
-#else
-#define cond_init      InitializeConditionVariable
-#define cond_broadcast WakeAllConditionVariable
-#define cond_signal    WakeConditionVariable
-#define cond_wait      SleepConditionVariableCS
-#endif
-
-static unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
-{
-    pthread_t *h = arg;
-    h->ret = h->func(h->arg);
-    return 0;
-}
-
-static int pthread_create(pthread_t *thread, const void *unused_attr,
-                          void *(*start_routine)(void*), void *arg)
-{
-    thread->func   = start_routine;
-    thread->arg    = arg;
-    thread->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, thread,
-                                           0, NULL);
-    return !thread->handle;
-}
-
-static void pthread_join(pthread_t thread, void **value_ptr)
-{
-    DWORD ret = WaitForSingleObject(thread.handle, INFINITE);
-    if (ret != WAIT_OBJECT_0)
-        return;
-    if (value_ptr)
-        *value_ptr = thread.ret;
-    CloseHandle(thread.handle);
-}
-
-static inline int pthread_mutex_init(pthread_mutex_t *m, void* attr)
-{
-    InitializeCriticalSection(m);
-    return 0;
-}
-static inline int pthread_mutex_destroy(pthread_mutex_t *m)
-{
-    DeleteCriticalSection(m);
-    return 0;
-}
-static inline int pthread_mutex_lock(pthread_mutex_t *m)
-{
-    EnterCriticalSection(m);
-    return 0;
-}
-static inline int pthread_mutex_unlock(pthread_mutex_t *m)
-{
-    LeaveCriticalSection(m);
-    return 0;
-}
-
-/* for pre-Windows 6.0 platforms we need to define and use our own condition
- * variable and api */
-typedef struct  win32_cond_t {
-    pthread_mutex_t mtx_broadcast;
-    pthread_mutex_t mtx_waiter_count;
-    volatile int waiter_count;
-    HANDLE semaphore;
-    HANDLE waiters_done;
-    volatile int is_broadcast;
-} win32_cond_t;
-
-static void pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
-{
-    win32_cond_t *win32_cond = NULL;
-    if (cond_init) {
-        cond_init(cond);
-        return;
-    }
-
-    /* non native condition variables */
-    win32_cond = av_mallocz(sizeof(win32_cond_t));
-    if (!win32_cond)
-        return;
-    cond->ptr = win32_cond;
-    win32_cond->semaphore = CreateSemaphore(NULL, 0, 0x7fffffff, NULL);
-    if (!win32_cond->semaphore)
-        return;
-    win32_cond->waiters_done = CreateEvent(NULL, TRUE, FALSE, NULL);
-    if (!win32_cond->waiters_done)
-        return;
-
-    pthread_mutex_init(&win32_cond->mtx_waiter_count, NULL);
-    pthread_mutex_init(&win32_cond->mtx_broadcast, NULL);
-}
-
-static void pthread_cond_destroy(pthread_cond_t *cond)
-{
-    win32_cond_t *win32_cond = cond->ptr;
-    /* native condition variables do not destroy */
-    if (cond_init)
-        return;
-
-    /* non native condition variables */
-    CloseHandle(win32_cond->semaphore);
-    CloseHandle(win32_cond->waiters_done);
-    pthread_mutex_destroy(&win32_cond->mtx_waiter_count);
-    pthread_mutex_destroy(&win32_cond->mtx_broadcast);
-    av_freep(&win32_cond);
-    cond->ptr = NULL;
-}
-
-static void pthread_cond_broadcast(pthread_cond_t *cond)
-{
-    win32_cond_t *win32_cond = cond->ptr;
-    int have_waiter;
-
-    if (cond_broadcast) {
-        cond_broadcast(cond);
-        return;
-    }
-
-    /* non native condition variables */
-    pthread_mutex_lock(&win32_cond->mtx_broadcast);
-    pthread_mutex_lock(&win32_cond->mtx_waiter_count);
-    have_waiter = 0;
-
-    if (win32_cond->waiter_count) {
-        win32_cond->is_broadcast = 1;
-        have_waiter = 1;
-    }
-
-    if (have_waiter) {
-        ReleaseSemaphore(win32_cond->semaphore, win32_cond->waiter_count, NULL);
-        pthread_mutex_unlock(&win32_cond->mtx_waiter_count);
-        WaitForSingleObject(win32_cond->waiters_done, INFINITE);
-        ResetEvent(win32_cond->waiters_done);
-        win32_cond->is_broadcast = 0;
-    } else
-        pthread_mutex_unlock(&win32_cond->mtx_waiter_count);
-    pthread_mutex_unlock(&win32_cond->mtx_broadcast);
-}
-
-static int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
-{
-    win32_cond_t *win32_cond = cond->ptr;
-    int last_waiter;
-    if (cond_wait) {
-        cond_wait(cond, mutex, INFINITE);
-        return 0;
-    }
-
-    /* non native condition variables */
-    pthread_mutex_lock(&win32_cond->mtx_broadcast);
-    pthread_mutex_lock(&win32_cond->mtx_waiter_count);
-    win32_cond->waiter_count++;
-    pthread_mutex_unlock(&win32_cond->mtx_waiter_count);
-    pthread_mutex_unlock(&win32_cond->mtx_broadcast);
-
-    // unlock the external mutex
-    pthread_mutex_unlock(mutex);
-    WaitForSingleObject(win32_cond->semaphore, INFINITE);
-
-    pthread_mutex_lock(&win32_cond->mtx_waiter_count);
-    win32_cond->waiter_count--;
-    last_waiter = !win32_cond->waiter_count || !win32_cond->is_broadcast;
-    pthread_mutex_unlock(&win32_cond->mtx_waiter_count);
-
-    if (last_waiter)
-        SetEvent(win32_cond->waiters_done);
-
-    // lock the external mutex
-    return pthread_mutex_lock(mutex);
-}
-
-static void pthread_cond_signal(pthread_cond_t *cond)
-{
-    win32_cond_t *win32_cond = cond->ptr;
-    int have_waiter;
-    if (cond_signal) {
-        cond_signal(cond);
-        return;
-    }
-
-    pthread_mutex_lock(&win32_cond->mtx_broadcast);
-
-    /* non-native condition variables */
-    pthread_mutex_lock(&win32_cond->mtx_waiter_count);
-    have_waiter = win32_cond->waiter_count;
-    pthread_mutex_unlock(&win32_cond->mtx_waiter_count);
-
-    if (have_waiter) {
-        ReleaseSemaphore(win32_cond->semaphore, 1, NULL);
-        WaitForSingleObject(win32_cond->waiters_done, INFINITE);
-        ResetEvent(win32_cond->waiters_done);
-    }
-
-    pthread_mutex_unlock(&win32_cond->mtx_broadcast);
-}
-
-static void w32thread_init(void)
-{
-#if _WIN32_WINNT < 0x0600
-    HANDLE kernel_dll = GetModuleHandle(TEXT("kernel32.dll"));
-    /* if one is available, then they should all be available */
-    cond_init      =
-        (void*)GetProcAddress(kernel_dll, "InitializeConditionVariable");
-    cond_broadcast =
-        (void*)GetProcAddress(kernel_dll, "WakeAllConditionVariable");
-    cond_signal    =
-        (void*)GetProcAddress(kernel_dll, "WakeConditionVariable");
-    cond_wait      =
-        (void*)GetProcAddress(kernel_dll, "SleepConditionVariableCS");
-#endif
-
-}
-
-#endif /* LIBAV_COMPAT_W32PTHREADS_H */
diff --git a/deps/libav/compat/windows/makedef b/deps/libav/compat/windows/makedef
deleted file mode 100755
index fcaf108..0000000
--- a/deps/libav/compat/windows/makedef
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2013, Derek Buitenhuis
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-# mktemp isn't POSIX, so supply an implementation
-mktemp() {
-    echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
-}
-
-if [ $# -lt 2 ]; then
-    echo "Usage: makedef <version_script> <objects>" >&2
-    exit 0
-fi
-
-vscript=$1
-shift
-
-if [ ! -f "$vscript" ]; then
-    echo "Version script does not exist" >&2
-    exit 1
-fi
-
-for object in "$@"; do
-    if [ ! -f "$object" ]; then
-        echo "Object does not exist: ${object}" >&2
-        exit 1
-    fi
-done
-
-# Create a lib temporarily to dump symbols from.
-# It's just much easier to do it this way
-libname=$(mktemp -u "library").lib
-
-trap 'rm -f -- $libname' EXIT
-
-lib -out:${libname} $@ >/dev/null
-if [ $? != 0 ]; then
-    echo "Could not create temporary library." >&2
-    exit 1
-fi
-
-IFS='
-'
-
-# Determine if we're building for x86 or x86_64 and
-# set the symbol prefix accordingly.
-prefix=""
-arch=$(dumpbin -headers ${libname} |
-       tr '\t' ' ' |
-       grep '^ \+.\+machine \+(.\+)' |
-       head -1 |
-       sed -e 's/^ \{1,\}.\{1,\} \{1,\}machine \{1,\}(\(...\)).*/\1/')
-
-if [ "${arch}" = "x86" ]; then
-    prefix="_"
-else
-    if [ "${arch}" != "ARM" ] && [ "${arch}" != "x64" ]; then
-        echo "Unknown machine type." >&2
-        exit 1
-    fi
-fi
-
-started=0
-regex="none"
-
-for line in $(cat ${vscript} | tr '\t' ' '); do
-    # We only care about global symbols
-    echo "${line}" | grep -q '^ \+global:'
-    if [ $? = 0 ]; then
-        started=1
-        line=$(echo "${line}" | sed -e 's/^ \{1,\}global: *//')
-    else
-        echo "${line}" | grep -q '^ \+local:'
-        if [ $? = 0 ]; then
-            started=0
-        fi
-    fi
-
-    if [ ${started} = 0 ]; then
-        continue
-    fi
-
-    # Handle multiple symbols on one line
-    IFS=';'
-
-    # Work around stupid expansion to filenames
-    line=$(echo "${line}" | sed -e 's/\*/.\\+/g')
-    for exp in ${line}; do
-        # Remove leading and trailing whitespace
-        exp=$(echo "${exp}" | sed -e 's/^ *//' -e 's/ *$//')
-
-        if [ "${regex}" = "none" ]; then
-            regex="${exp}"
-        else
-            regex="${regex};${exp}"
-        fi
-    done
-
-    IFS='
-'
-done
-
-dump=$(dumpbin -linkermember:1 ${libname})
-
-rm ${libname}
-
-IFS=';'
-list=""
-for exp in ${regex}; do
-    list="${list}"'
-'$(echo "${dump}" |
-          sed -e '/public symbols/,$!d' -e '/^ \{1,\}Summary/,$d' -e "s/ \{1,\}${prefix}/ /" -e 's/ \{1,\}/ /g' |
-          tail -n +2 |
-          cut -d' ' -f3 |
-          grep "^${exp}" |
-          sed -e 's/^/    /')
-done
-
-echo "EXPORTS"
-echo "${list}" | sort | uniq | tail -n +2
diff --git a/deps/libav/configure b/deps/libav/configure
deleted file mode 100755
index 05acff5..0000000
--- a/deps/libav/configure
+++ /dev/null
@@ -1,4570 +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
-
-test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
-
-show_help(){
-    cat <<EOF
-Usage: configure [options]
-Options: [defaults in brackets after descriptions]
-
-Help options:
-  --help                   print this message
-  --list-decoders          show all available decoders
-  --list-encoders          show all available encoders
-  --list-hwaccels          show all available hardware accelerators
-  --list-demuxers          show all available demuxers
-  --list-muxers            show all available muxers
-  --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
-
-Standard options:
-  --logfile=FILE           log tests and output to FILE [config.log]
-  --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/avconv]
-  --docdir=DIR             install documentation in DIR [PREFIX/share/doc/libav]
-  --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]
-
-Licensing options:
-  --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]
-
-Configuration options:
-  --disable-static         do not build static libraries [no]
-  --enable-shared          build shared libraries [no]
-  --enable-small           optimize for size instead of speed
-  --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
-  --enable-gray            enable full grayscale support (slower color)
-  --disable-swscale-alpha  disable alpha channel support in swscale
-  --disable-all            disable building components, libraries and programs
-
-Program options:
-  --disable-programs       do not build command line programs
-  --disable-avconv         disable avconv build
-  --disable-avplay         disable avplay build
-  --disable-avprobe        disable avprobe build
-  --disable-avserver       disable avserver build
-
-Component options:
-  --disable-doc            do not build documentation
-  --disable-avdevice       disable libavdevice build
-  --disable-avcodec        disable libavcodec build
-  --disable-avformat       disable libavformat build
-  --disable-avutil         disable libavutil build
-  --disable-swscale        disable libswscale build
-  --disable-avfilter       disable video filter support [no]
-  --disable-avresample     disable libavresample build [no]
-  --disable-pthreads       disable pthreads [auto]
-  --disable-w32threads     disable Win32 threads [auto]
-  --disable-network        disable network support [no]
-  --disable-dct            disable DCT code
-  --disable-error-resilience disable error resilience code
-  --disable-lsp            disable LSP code
-  --disable-lzo            disable LZO decoder code
-  --disable-mdct           disable MDCT code
-  --disable-rdft           disable RDFT code
-  --disable-fft            disable FFT code
-
-Hardware accelerators:
-  --enable-dxva2           enable DXVA2 code
-  --enable-vaapi           enable VAAPI code
-  --enable-vda             enable VDA code
-  --enable-vdpau           enable VDPAU code
-
-Individual component options:
-  --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
-  --enable-indev=NAME      enable input device NAME
-  --disable-indev=NAME     disable input device NAME
-  --disable-indevs         disable input devices
-  --enable-outdev=NAME     enable output device NAME
-  --disable-outdev=NAME    disable output device NAME
-  --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
-
-External library support:
-  --enable-avisynth        enable reading of AviSynth script files [no]
-  --enable-bzlib           enable bzlib [autodetect]
-  --enable-frei0r          enable frei0r video filtering
-  --enable-gnutls          enable gnutls [no]
-  --enable-libcdio         enable audio CD grabbing with libcdio
-  --enable-libdc1394       enable IIDC-1394 grabbing using libdc1394
-                           and libraw1394 [no]
-  --enable-libfaac         enable AAC encoding via libfaac [no]
-  --enable-libfdk-aac      enable AAC de/encoding via libfdk-aac [no]
-  --enable-libfreetype     enable libfreetype [no]
-  --enable-libgsm          enable GSM de/encoding via libgsm [no]
-  --enable-libilbc         enable iLBC de/encoding via libilbc [no]
-  --enable-libmp3lame      enable MP3 encoding via libmp3lame [no]
-  --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
-  --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
-  --enable-libopencv       enable video filtering via libopencv [no]
-  --enable-libopenjpeg     enable JPEG 2000 de/encoding via OpenJPEG [no]
-  --enable-libopus         enable Opus decoding via libopus [no]
-  --enable-libpulse        enable Pulseaudio input via libpulse [no]
-  --enable-librtmp         enable RTMP[E] support via librtmp [no]
-  --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
-  --enable-libspeex        enable Speex de/encoding via libspeex [no]
-  --enable-libtheora       enable Theora encoding via libtheora [no]
-  --enable-libvo-aacenc    enable AAC encoding via libvo-aacenc [no]
-  --enable-libvo-amrwbenc  enable AMR-WB encoding via libvo-amrwbenc [no]
-  --enable-libvorbis       enable Vorbis encoding via libvorbis [no]
-  --enable-libvpx          enable VP8 and VP9 de/encoding via libvpx [no]
-  --enable-libwavpack      enable wavpack encoding via libwavpack [no]
-  --enable-libwebp         enable WebP encoding via libwebp [no]
-  --enable-libx264         enable H.264 encoding via x264 [no]
-  --enable-libxavs         enable AVS encoding via xavs [no]
-  --enable-libxvid         enable Xvid encoding via xvidcore,
-                           native MPEG-4/Xvid encoder exists [no]
-  --enable-openssl         enable openssl [no]
-  --enable-x11grab         enable X11 grabbing [no]
-  --enable-zlib            enable zlib [autodetect]
-
-Advanced options (experts only):
-  --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
-  --target-samples=DIR     path to samples directory on target
-  --toolchain=NAME         set tool defaults according to NAME
-  --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]
-  --dep-cc=DEPCC           use dependency generator DEPCC [$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-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
-  --host-ld=HOSTLD         use host linker HOSTLD
-  --host-ldflags=HLDFLAGS  use HLDFLAGS when linking for host
-  --host-libs=HLIBS        use libs HLIBS when linking for host
-  --host-os=OS             compiler host OS [$target_os]
-  --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 []
-  --optflags=OPTFLAGS      override optimization-related compiler flags
-  --build-suffix=SUFFIX    library name suffix []
-  --malloc-prefix=PREFIX   prefix malloc and related names with PREFIX
-  --arch=ARCH              select architecture [$arch]
-  --cpu=CPU                select the minimum required CPU (affects
-                           instruction selection, may crash on older CPUs)
-  --enable-pic             build position-independent code
-  --enable-sram            allow use of on-chip SRAM
-  --enable-thumb           compile for Thumb instruction set
-  --disable-symver         disable symbol versioning
-  --enable-hardcoded-tables use hardcoded tables instead of runtime generation
-  --disable-safe-bitstream-reader
-                           disable buffer boundary checking in bitreaders
-                           (faster, but may crash)
-  --enable-memalign-hack   emulate memalign, interferes with memory debuggers
-  --enable-lto             use link-time optimization
-
-Optimization options (experts only):
-  --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-mmxext         disable MMXEXT optimizations
-  --disable-sse            disable SSE optimizations
-  --disable-sse2           disable SSE2 optimizations
-  --disable-sse3           disable SSE3 optimizations
-  --disable-ssse3          disable SSSE3 optimizations
-  --disable-sse4           disable SSE4 optimizations
-  --disable-sse42          disable SSE4.2 optimizations
-  --disable-avx            disable AVX optimizations
-  --disable-fma4           disable FMA4 optimizations
-  --disable-avx2           disable AVX2 optimizations
-  --disable-armv5te        disable armv5te optimizations
-  --disable-armv6          disable armv6 optimizations
-  --disable-armv6t2        disable armv6t2 optimizations
-  --disable-vfp            disable VFP optimizations
-  --disable-neon           disable NEON optimizations
-  --disable-vis            disable VIS optimizations
-  --disable-inline-asm     disable use of inline assembler
-  --disable-yasm           disable use of yasm assembler
-
-Developer options (useful when working on Libav itself):
-  --disable-debug          disable debugging symbols
-  --enable-debug=LEVEL     set the debug level [$debuglevel]
-  --disable-optimizations  disable compiler optimizations
-  --enable-extra-warnings  enable more compiler warnings
-  --samples=PATH           location of test samples for FATE, if not set use
-                           \$LIBAV_SAMPLES at make invocation time.
-  --enable-neon-clobber-test check NEON registers for clobbering (should be
-                           used only for debugging purposes)
-  --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
-                           should be used only for debugging purposes)
-  --enable-random          randomly enable/disable components
-  --disable-random
-  --enable-random=LIST     randomly enable/disable specific components or
-  --disable-random=LIST    component groups. LIST is a comma-separated list
-                           of NAME[:PROB] entries where NAME is a component
-                           (group) and PROB the probability associated with
-                           NAME (default 0.5).
-  --random-seed=VALUE      seed value for --enable/disable-random
-
-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 "$@"
-}
-
-warn(){
-    log "WARNING: $*"
-    WARNINGS="${WARNINGS}WARNING: $*\n"
-}
-
-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-tools 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 "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
-    echo "$v"
-}
-
-cleanws(){
-    echo "$@" | sed 's/^ *//;s/  */ /g;s/ *$//'
-}
-
-filter(){
-    pat=$1
-    shift
-    for v; do
-        eval "case $v in $pat) echo $v ;; esac"
-    done
-}
-
-filter_out(){
-    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
-}
-
-add_suffix(){
-    suffix=$1
-    shift
-    for v; do echo ${v}${suffix}; 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
-}
-
-sanitize_var_name(){
-    echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
-}
-
-set_safe(){
-    var=$1
-    shift
-    eval $(sanitize_var_name "$var")='$*'
-}
-
-get_safe(){
-    eval echo \$$(sanitize_var_name "$1")
-}
-
-pushvar(){
-    for pvar in $*; do
-        eval level=\${${pvar}_level:=0}
-        eval ${pvar}_${level}="\$$pvar"
-        eval ${pvar}_level=$(($level+1))
-    done
-}
-
-popvar(){
-    for pvar in $*; do
-        eval level=\${${pvar}_level:-0}
-        test $level = 0 && continue
-        eval level=$(($level-1))
-        eval $pvar="\${${pvar}_${level}}"
-        eval ${pvar}_level=$level
-        eval unset ${pvar}_${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(){
-    for var; do
-        disabled $var && continue
-        pushvar var
-        do_enable_deep $var
-        popvar var
-        enable_weak $var
-    done
-}
-
-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
-}
-
-do_check_deps(){
-    for cfg; do
-        cfg="${cfg#!}"
-        enabled ${cfg}_checking && die "Circular dependency for $cfg."
-        disabled ${cfg}_checking && continue
-        enable ${cfg}_checking
-        append allopts $cfg
-
-        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
-        do_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
-            enable_deep $dep_sel
-            enable_deep_weak $dep_sgs
-        fi
-
-        disable ${cfg}_checking
-    done
-}
-
-check_deps(){
-    unset allopts
-
-    do_check_deps "$@"
-
-    for cfg in $allopts; do
-        enabled $cfg || continue
-        eval dep_extralibs="\$${cfg}_extralibs"
-        test -n "$dep_extralibs" && add_extralibs $dep_extralibs
-    done
-}
-
-print_config(){
-    pfx=$1
-    files=$2
-    shift 2
-    map 'eval echo "$v \${$v:-no}"' "$@" |
-    awk "BEGIN { split(\"$files\", files) }
-        {
-            c = \"$pfx\" toupper(\$1);
-            v = \$2;
-            sub(/yes/, 1, v);
-            sub(/no/,  0, v);
-            for (f in files) {
-                file = files[f];
-                if (file ~ /\\.h\$/) {
-                    printf(\"#define %s %d\\n\", c, v) >>file;
-                } else if (file ~ /\\.asm\$/) {
-                    printf(\"%%define %s %d\\n\", c, v) >>file;
-                } else if (file ~ /\\.mak\$/) {
-                    n = -v ? \"\" : \"!\";
-                    printf(\"%s%s=yes\\n\", n, c) >>file;
-                }
-            }
-        }"
-}
-
-print_enabled(){
-    suf=$1
-    shift
-    for v; do
-        enabled $v && printf "%s\n" ${v%$suf};
-    done
-}
-
-append(){
-    var=$1
-    shift
-    eval "$var=\"\$$var $*\""
-}
-
-prepend(){
-    var=$1
-    shift
-    eval "$var=\"$* \$$var\""
-}
-
-add_cppflags(){
-    append CPPFLAGS "$@"
-}
-
-add_cflags(){
-    append CFLAGS $($cflags_filter "$@")
-}
-
-add_asflags(){
-    append ASFLAGS $($asflags_filter "$@")
-}
-
-add_ldflags(){
-    append LDFLAGS $($ldflags_filter "$@")
-}
-
-add_stripflags(){
-    append STRIPFLAGS "$@"
-}
-
-add_extralibs(){
-    prepend extralibs $($ldflags_filter "$@")
-}
-
-add_host_cppflags(){
-    append host_cppflags "$@"
-}
-
-add_host_cflags(){
-    append host_cflags $($host_cflags_filter "$@")
-}
-
-add_host_ldflags(){
-    append host_ldflags $($host_ldflags_filter "$@")
-}
-
-add_compat(){
-    append compat_objs $1
-    shift
-    map 'add_cppflags -D$v' "$@"
-}
-
-check_cmd(){
-    log "$@"
-    "$@" >> $logfile 2>&1
-}
-
-cc_o(){
-    eval printf '%s\\n' $CC_O
-}
-
-cc_e(){
-    eval printf '%s\\n' $CC_E
-}
-
-check_cc(){
-    log check_cc "$@"
-    cat > $TMPC
-    log_file $TMPC
-    check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
-}
-
-check_cpp(){
-    log check_cpp "$@"
-    cat > $TMPC
-    log_file $TMPC
-    check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
-}
-
-as_o(){
-    eval printf '%s\\n' $AS_O
-}
-
-check_as(){
-    log check_as "$@"
-    cat > $TMPS
-    log_file $TMPS
-    check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
-}
-
-check_inline_asm(){
-    log check_inline_asm "$@"
-    name="$1"
-    code="$2"
-    shift 2
-    disable $name
-    check_cc "$@" <<EOF && enable $name
-void foo(void){ __asm__ volatile($code); }
-EOF
-}
-
-check_insn(){
-    log check_insn "$@"
-    check_inline_asm ${1}_inline "\"$2\""
-    echo "$2" | check_as && enable ${1}_external || disable ${1}_external
-}
-
-check_yasm(){
-    log check_yasm "$@"
-    echo "$1" > $TMPS
-    log_file $TMPS
-    shift 1
-    check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
-}
-
-ld_o(){
-    eval printf '%s\\n' $LD_O
-}
-
-check_ld(){
-    log check_ld "$@"
-    flags=$(filter_out '-l*' "$@")
-    libs=$(filter '-l*' "$@")
-    check_cc $($cflags_filter $flags) || return
-    flags=$($ldflags_filter $flags)
-    libs=$($ldflags_filter $libs)
-    check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
-}
-
-print_include(){
-    hdr=$1
-    test "${hdr%.h}" = "${hdr}" &&
-        echo "#include $hdr"    ||
-        echo "#include <$hdr>"
-}
-
-check_code(){
-    log check_code "$@"
-    check=$1
-    headers=$2
-    code=$3
-    shift 3
-    {
-        for hdr in $headers; do
-            print_include $hdr
-        done
-        echo "int main(void) { $code; return 0; }"
-    } | check_$check "$@"
-}
-
-check_cppflags(){
-    log check_cppflags "$@"
-    check_cc "$@" <<EOF && append CPPFLAGS "$@"
-int x;
-EOF
-}
-
-test_cflags(){
-    log test_cflags "$@"
-    set -- $($cflags_filter "$@")
-    check_cc "$@" <<EOF
-int x;
-EOF
-}
-
-check_cflags(){
-    log check_cflags "$@"
-    test_cflags "$@" && add_cflags "$@"
-}
-
-test_ldflags(){
-    log test_ldflags "$@"
-    check_ld "$@" <<EOF
-int main(void){ return 0; }
-EOF
-}
-
-check_ldflags(){
-    log check_ldflags "$@"
-    test_ldflags "$@" && add_ldflags "$@"
-}
-
-test_stripflags(){
-    log test_stripflags "$@"
-    # call check_cc to get a fresh TMPO
-    check_cc <<EOF
-int main(void) { return 0; }
-EOF
-    check_cmd $strip $STRIPFLAGS "$@" $TMPO
-}
-
-check_stripflags(){
-    log check_stripflags "$@"
-    test_stripflags "$@" && add_stripflags "$@"
-}
-
-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
-    narg=$2
-    shift 2
-    test $narg = 2 && args="f, g" || args="f"
-    disable $func
-    check_ld "$@" <<EOF && enable $func
-#include <math.h>
-float foo(float f, float g) { return $func($args); }
-int main(void){ return 0; }
-EOF
-}
-
-check_func_headers(){
-    log check_func_headers "$@"
-    headers=$1
-    funcs=$2
-    shift 2
-    {
-        for hdr in $headers; do
-            print_include $hdr
-        done
-        for func in $funcs; do
-            echo "long check_$func(void) { return (long) $func; }"
-        done
-        echo "int main(void) { return 0; }"
-    } | check_ld "$@" && enable $funcs && enable_safe $headers
-}
-
-check_cpp_condition(){
-    log check_cpp_condition "$@"
-    header=$1
-    condition=$2
-    shift 2
-    check_cpp "$@" <<EOF
-#include <$header>
-#if !($condition)
-#error "unsatisfied condition: $condition"
-#endif
-EOF
-}
-
-check_lib(){
-    log check_lib "$@"
-    header="$1"
-    func="$2"
-    shift 2
-    check_header $header && check_func $func "$@" && add_extralibs "$@"
-}
-
-check_lib2(){
-    log check_lib2 "$@"
-    headers="$1"
-    funcs="$2"
-    shift 2
-    check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
-}
-
-check_pkg_config(){
-    log check_pkg_config "$@"
-    pkg="$1"
-    headers="$2"
-    funcs="$3"
-    shift 3
-    check_cmd $pkg_config --exists --print-errors $pkg || return
-    pkg_cflags=$($pkg_config --cflags $pkg)
-    pkg_libs=$($pkg_config --libs $pkg)
-    check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
-        set_safe ${pkg}_cflags $pkg_cflags   &&
-        set_safe ${pkg}_libs   $pkg_libs
-}
-
-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 foo(void){
-    $code
-}
-int (*func_ptr)(void) = foo;
-int main(void){
-    signal(SIGILL, sighandler);
-    signal(SIGFPE, sighandler);
-    signal(SIGSEGV, sighandler);
-#ifdef SIGBUS
-    signal(SIGBUS, sighandler);
-#endif
-    return func_ptr();
-}
-EOF
-}
-
-check_type(){
-    log check_type "$@"
-    headers=$1
-    type=$2
-    shift 2
-    disable_safe "$type"
-    check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
-}
-
-check_struct(){
-    log check_struct "$@"
-    headers=$1
-    struct=$2
-    member=$3
-    shift 3
-    disable_safe "${struct}_${member}"
-    check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
-        enable_safe "${struct}_${member}"
-}
-
-check_builtin(){
-    log check_builtin "$@"
-    name=$1
-    headers=$2
-    builtin=$3
-    shift 3
-    disable "$name"
-    check_code ld "$headers" "$builtin" "$@" && enable "$name"
-}
-
-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"
-}
-
-require_pkg_config(){
-    pkg="$1"
-    check_pkg_config "$@" || die "ERROR: $pkg not found"
-    add_cflags    $(get_safe ${pkg}_cflags)
-    add_extralibs $(get_safe ${pkg}_libs)
-}
-
-hostcc_e(){
-    eval printf '%s\\n' $HOSTCC_E
-}
-
-hostcc_o(){
-    eval printf '%s\\n' $HOSTCC_O
-}
-
-check_host_cc(){
-    log check_host_cc "$@"
-    cat > $TMPC
-    log_file $TMPC
-    check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
-}
-
-check_host_cpp(){
-    log check_host_cpp "$@"
-    cat > $TMPC
-    log_file $TMPC
-    check_cmd $host_cc $HOSTCPPFLAGS $HOSTCFLAGS "$@" $(hostcc_e $TMPO) $TMPC
-}
-
-check_host_cppflags(){
-    log check_host_cppflags "$@"
-    check_host_cc "$@" <<EOF && append host_cppflags "$@"
-int x;
-EOF
-}
-
-check_host_cflags(){
-    log check_host_cflags "$@"
-    set -- $($host_cflags_filter "$@")
-    check_host_cc "$@" <<EOF && append host_cflags "$@"
-int x;
-EOF
-}
-
-check_host_cpp_condition(){
-    log check_host_cpp_condition "$@"
-    header=$1
-    condition=$2
-    shift 2
-    check_host_cpp "$@" <<EOF
-#include <$header>
-#if !($condition)
-#error "unsatisfied condition: $condition"
-#endif
-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" && return
-    mkdir -p "$(dirname $2)"
-    $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
-"
-
-EXAMPLE_LIST="
-    avcodec_example
-    metadata_example
-    output_example
-    transcode_aac_example
-"
-
-EXTERNAL_LIBRARY_LIST="
-    avisynth
-    bzlib
-    frei0r
-    gnutls
-    libcdio
-    libdc1394
-    libfaac
-    libfdk_aac
-    libfreetype
-    libgsm
-    libilbc
-    libmp3lame
-    libopencore_amrnb
-    libopencore_amrwb
-    libopencv
-    libopenjpeg
-    libopus
-    libpulse
-    librtmp
-    libschroedinger
-    libspeex
-    libtheora
-    libvo_aacenc
-    libvo_amrwbenc
-    libvorbis
-    libvpx
-    libwavpack
-    libwebp
-    libx264
-    libxavs
-    libxvid
-    openssl
-    x11grab
-    zlib
-"
-
-HWACCEL_LIST="
-    dxva2
-    vaapi
-    vda
-    vdpau
-"
-LIBRARY_LIST="
-    avcodec
-    avdevice
-    avfilter
-    avformat
-    avresample
-    avutil
-    swscale
-"
-
-PROGRAM_LIST="
-    avconv
-    avplay
-    avprobe
-    avserver
-"
-
-CONFIG_LIST="
-    $COMPONENT_LIST
-    $EXAMPLE_LIST
-    $EXTERNAL_LIBRARY_LIST
-    $HWACCEL_LIST
-    $LIBRARY_LIST
-    $PROGRAM_LIST
-    dct
-    doc
-    error_resilience
-    fft
-    gpl
-    gray
-    hardcoded_tables
-    lsp
-    lzo
-    mdct
-    memalign_hack
-    neon_clobber_test
-    network
-    nonfree
-    pod2man
-    pic
-    rdft
-    runtime_cpudetect
-    safe_bitstream_reader
-    shared
-    small
-    sram
-    static
-    swscale_alpha
-    texi2html
-    thumb
-    version3
-    xmm_clobber_test
-"
-
-THREADS_LIST='
-    pthreads
-    w32threads
-'
-
-ATOMICS_LIST='
-    atomics_gcc
-    atomics_suncc
-    atomics_win32
-'
-
-ARCH_LIST='
-    aarch64
-    alpha
-    arm
-    avr32
-    avr32_ap
-    avr32_uc
-    bfin
-    ia64
-    m68k
-    mips
-    mips64
-    parisc
-    ppc
-    ppc64
-    s390
-    sh4
-    sparc
-    sparc64
-    tilegx
-    tilepro
-    tomi
-    x86
-    x86_32
-    x86_64
-'
-
-ARCH_EXT_LIST_ARM='
-    armv5te
-    armv6
-    armv6t2
-    neon
-    vfp
-    vfpv3
-'
-
-ARCH_EXT_LIST_X86='
-    amd3dnow
-    amd3dnowext
-    avx
-    avx2
-    fma4
-    i686
-    mmx
-    mmxext
-    sse
-    sse2
-    sse3
-    sse4
-    sse42
-    ssse3
-'
-
-ARCH_EXT_LIST="
-    $ARCH_EXT_LIST_ARM
-    $ARCH_EXT_LIST_X86
-    altivec
-    ppc4xx
-    vis
-"
-
-HAVE_LIST_CMDLINE='
-    inline_asm
-    symver
-    yasm
-'
-
-HAVE_LIST_PUB='
-    bigendian
-    fast_unaligned
-'
-
-MATH_FUNCS="
-    atanf
-    atan2f
-    cbrtf
-    cosf
-    exp2
-    exp2f
-    expf
-    isinf
-    isnan
-    ldexpf
-    llrint
-    llrintf
-    log2
-    log2f
-    log10f
-    lrint
-    lrintf
-    powf
-    rint
-    round
-    roundf
-    sinf
-    trunc
-    truncf
-"
-
-HAVE_LIST="
-    $ARCH_EXT_LIST
-    $(add_suffix _external $ARCH_EXT_LIST)
-    $(add_suffix _inline   $ARCH_EXT_LIST)
-    $HAVE_LIST_CMDLINE
-    $HAVE_LIST_PUB
-    $THREADS_LIST
-    $ATOMICS_LIST
-    $MATH_FUNCS
-    aligned_malloc
-    aligned_stack
-    alsa_asoundlib_h
-    altivec_h
-    arpa_inet_h
-    asm_mod_q
-    asm_mod_y
-    atomic_cas_ptr
-    atomics_native
-    attribute_may_alias
-    attribute_packed
-    cdio_paranoia_h
-    cdio_paranoia_paranoia_h
-    closesocket
-    CommandLineToArgvW
-    cpunop
-    CryptGenRandom
-    dcbzl
-    dev_bktr_ioctl_bt848_h
-    dev_bktr_ioctl_meteor_h
-    dev_ic_bt8xx_h
-    dev_video_bktr_ioctl_bt848_h
-    dev_video_meteor_ioctl_meteor_h
-    direct_h
-    dlfcn_h
-    dlopen
-    dos_paths
-    dxva_h
-    ebp_available
-    ebx_available
-    fast_64bit
-    fast_clz
-    fast_cmov
-    fcntl
-    fork
-    getaddrinfo
-    gethrtime
-    getopt
-    GetProcessAffinityMask
-    GetProcessMemoryInfo
-    GetProcessTimes
-    GetSystemTimeAsFileTime
-    getrusage
-    getservbyport
-    gettimeofday
-    gnu_as
-    gsm_h
-    ibm_asm
-    inet_aton
-    io_h
-    inline_asm_labels
-    isatty
-    jack_port_get_latency_range
-    ldbrx
-    libc_msvcrt
-    libdc1394_1
-    libdc1394_2
-    local_aligned_16
-    local_aligned_8
-    localtime_r
-    loongson
-    machine_ioctl_bt848_h
-    machine_ioctl_meteor_h
-    machine_rw_barrier
-    malloc_h
-    MapViewOfFile
-    memalign
-    MemoryBarrier
-    mkstemp
-    mm_empty
-    mmap
-    mprotect
-    nanosleep
-    poll_h
-    posix_memalign
-    pragma_deprecated
-    rdtsc
-    sched_getaffinity
-    sdl
-    SetConsoleTextAttribute
-    setmode
-    setrlimit
-    Sleep
-    sndio_h
-    socklen_t
-    soundcard_h
-    strerror_r
-    strptime
-    struct_addrinfo
-    struct_group_source_req
-    struct_ip_mreq_source
-    struct_ipv6_mreq
-    struct_pollfd
-    struct_rusage_ru_maxrss
-    struct_sockaddr_in6
-    struct_sockaddr_sa_len
-    struct_sockaddr_storage
-    struct_v4l2_frmivalenum_discrete
-    symver_asm_label
-    symver_gnu_asm
-    sync_val_compare_and_swap
-    sysconf
-    sysctl
-    sys_mman_h
-    sys_param_h
-    sys_resource_h
-    sys_select_h
-    sys_soundcard_h
-    sys_time_h
-    sys_un_h
-    sys_videoio_h
-    threads
-    unistd_h
-    usleep
-    vdpau_x11
-    vfp_args
-    VirtualAlloc
-    windows_h
-    winsock2_h
-    xform_asm
-    xlib
-    xmm_clobbers
-"
-
-# options emitted with CONFIG_ prefix but not available on the command line
-CONFIG_EXTRA="
-    aandcttables
-    ac3dsp
-    audio_frame_queue
-    dsputil
-    gcrypt
-    golomb
-    gplv3
-    h263dsp
-    h264chroma
-    h264dsp
-    h264pred
-    h264qpel
-    hpeldsp
-    huffman
-    intrax8
-    lgplv3
-    lpc
-    mpegaudio
-    mpegaudiodsp
-    mpegvideo
-    mpegvideoenc
-    nettle
-    rangecoder
-    riffdec
-    riffenc
-    rtpdec
-    rtpenc_chain
-    sinewin
-    videodsp
-    vp3dsp
-"
-
-CMDLINE_SELECT="
-    $ARCH_EXT_LIST
-    $CONFIG_LIST
-    $HAVE_LIST_CMDLINE
-    $THREADS_LIST
-    asm
-    cross_compile
-    debug
-    extra_warnings
-    logging
-    lto
-    optimizations
-"
-
-PATHS_LIST='
-    bindir
-    datadir
-    docdir
-    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_ld
-    host_ldflags
-    host_libs
-    host_os
-    ld
-    logfile
-    malloc_prefix
-    nm
-    optflags
-    pkg_config
-    random_seed
-    samples
-    sysinclude
-    sysroot
-    target_exec
-    target_os
-    target_path
-    target_samples
-    toolchain
-"
-
-CMDLINE_APPEND="
-    extra_cflags
-    host_cppflags
-"
-
-# code dependency declarations
-
-# architecture extensions
-
-armv5te_deps="arm"
-armv6_deps="arm"
-armv6t2_deps="arm"
-neon_deps_any="aarch64 arm"
-vfp_deps_any="aarch64 arm"
-vfpv3_deps="vfp"
-
-map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
-
-altivec_deps="ppc"
-ppc4xx_deps="ppc"
-
-vis_deps="sparc"
-
-cpunop_deps="i686"
-x86_64_select="i686"
-x86_64_suggest="fast_cmov"
-
-amd3dnow_deps="mmx"
-amd3dnowext_deps="amd3dnow"
-i686_deps="x86"
-mmx_deps="x86"
-mmxext_deps="mmx"
-sse_deps="mmxext"
-sse2_deps="sse"
-sse3_deps="sse2"
-ssse3_deps="sse3"
-sse4_deps="ssse3"
-sse42_deps="sse4"
-avx_deps="sse42"
-fma4_deps="avx"
-avx2_deps="avx"
-
-mmx_external_deps="yasm"
-mmx_inline_deps="inline_asm"
-mmx_suggest="mmx_external mmx_inline"
-
-for ext in $(filter_out mmx $ARCH_EXT_LIST_X86); do
-    eval dep=\$${ext}_deps
-    eval ${ext}_external_deps='"${dep}_external"'
-    eval ${ext}_inline_deps='"${dep}_inline"'
-    eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
-done
-
-aligned_stack_if_any="aarch64 ppc x86"
-fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
-fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
-fast_unaligned_if_any="aarch64 ppc x86"
-
-need_memalign="altivec neon sse"
-
-# system capabilities
-log2_deps="!libc_msvcrt"
-
-symver_if_any="symver_asm_label symver_gnu_asm"
-
-# threading support
-atomics_gcc_if="sync_val_compare_and_swap"
-atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
-atomics_win32_if="MemoryBarrier"
-atomics_native_if_any="$ATOMICS_LIST"
-threads_if_any="$THREADS_LIST"
-
-# subsystems
-dct_select="rdft"
-error_resilience_select="dsputil"
-lpc_select="dsputil"
-mdct_select="fft"
-rdft_select="fft"
-mpegaudio_select="mpegaudiodsp"
-mpegaudiodsp_select="dct"
-mpegvideo_select="dsputil hpeldsp videodsp"
-mpegvideoenc_select="mpegvideo"
-
-# decoders / encoders
-aac_decoder_select="mdct sinewin"
-aac_encoder_select="audio_frame_queue mdct sinewin"
-aac_latm_decoder_select="aac_decoder aac_latm_parser"
-ac3_decoder_select="mdct ac3dsp ac3_parser dsputil"
-ac3_encoder_select="mdct ac3dsp dsputil"
-ac3_fixed_encoder_select="mdct ac3dsp dsputil"
-aic_decoder_select="dsputil golomb"
-alac_encoder_select="lpc"
-als_decoder_select="dsputil"
-amrnb_decoder_select="lsp"
-amrwb_decoder_select="lsp"
-amv_decoder_select="dsputil hpeldsp"
-ape_decoder_select="dsputil"
-asv1_decoder_select="dsputil"
-asv1_encoder_select="dsputil"
-asv2_decoder_select="dsputil"
-asv2_encoder_select="dsputil"
-atrac1_decoder_select="mdct sinewin"
-atrac3_decoder_select="mdct"
-atrac3p_decoder_select="mdct sinewin"
-bink_decoder_select="dsputil hpeldsp"
-binkaudio_dct_decoder_select="mdct rdft dct sinewin"
-binkaudio_rdft_decoder_select="mdct rdft sinewin"
-cavs_decoder_select="dsputil golomb h264chroma videodsp"
-cllc_decoder_select="dsputil"
-comfortnoise_encoder_select="lpc"
-cook_decoder_select="dsputil mdct sinewin"
-cscd_decoder_select="lzo"
-cscd_decoder_suggest="zlib"
-dca_decoder_select="mdct"
-dnxhd_decoder_select="dsputil"
-dnxhd_encoder_select="aandcttables dsputil mpegvideoenc"
-dvvideo_decoder_select="dsputil"
-dvvideo_encoder_select="dsputil"
-dxa_decoder_deps="zlib"
-eac3_decoder_select="ac3_decoder"
-eac3_encoder_select="ac3_encoder"
-eamad_decoder_select="aandcttables dsputil mpegvideo"
-eatgq_decoder_select="aandcttables dsputil"
-eatqi_decoder_select="aandcttables error_resilience mpegvideo"
-ffv1_decoder_select="dsputil golomb rangecoder"
-ffv1_encoder_select="dsputil rangecoder"
-ffvhuff_decoder_select="dsputil"
-ffvhuff_encoder_select="dsputil huffman"
-fic_decoder_select="dsputil golomb"
-flac_decoder_select="golomb"
-flac_encoder_select="dsputil golomb lpc"
-flashsv_decoder_deps="zlib"
-flashsv_encoder_deps="zlib"
-flashsv2_decoder_deps="zlib"
-flv_decoder_select="h263_decoder"
-flv_encoder_select="h263_encoder"
-fourxm_decoder_select="dsputil"
-fraps_decoder_select="dsputil huffman"
-g2m_decoder_deps="zlib"
-g2m_decoder_select="dsputil"
-h261_decoder_select="error_resilience mpegvideo"
-h261_encoder_select="aandcttables mpegvideoenc"
-h263_decoder_select="error_resilience h263_parser h263dsp mpegvideo"
-h263_encoder_select="aandcttables h263dsp mpegvideoenc"
-h263i_decoder_select="h263_decoder"
-h263p_encoder_select="h263_encoder"
-h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
-h264_decoder_suggest="error_resilience"
-hevc_decoder_select="dsputil golomb videodsp"
-huffyuv_decoder_select="dsputil"
-huffyuv_encoder_select="dsputil huffman"
-iac_decoder_select="dsputil fft mdct sinewin"
-imc_decoder_select="dsputil fft mdct sinewin"
-indeo3_decoder_select="hpeldsp"
-interplay_video_decoder_select="hpeldsp"
-jpegls_decoder_select="dsputil golomb hpeldsp"
-jpegls_encoder_select="golomb"
-jv_decoder_select="dsputil"
-lagarith_decoder_select="dsputil"
-ljpeg_encoder_select="aandcttables mpegvideoenc"
-loco_decoder_select="golomb"
-mdec_decoder_select="dsputil error_resilience mpegvideo"
-metasound_decoder_select="lsp mdct sinewin"
-mimic_decoder_select="dsputil hpeldsp"
-mjpeg_decoder_select="dsputil hpeldsp"
-mjpegb_decoder_select="dsputil hpeldsp"
-mjpeg_encoder_select="aandcttables dsputil mpegvideoenc"
-mlp_decoder_select="dsputil mlp_parser"
-motionpixels_decoder_select="dsputil"
-mp1_decoder_select="mpegaudio"
-mp1float_decoder_select="mpegaudio"
-mp2_decoder_select="mpegaudio"
-mp2float_decoder_select="mpegaudio"
-mp3_decoder_select="mpegaudio"
-mp3adu_decoder_select="mpegaudio"
-mp3adufloat_decoder_select="mpegaudio"
-mp3float_decoder_select="mpegaudio"
-mp3on4_decoder_select="mpegaudio"
-mp3on4float_decoder_select="mpegaudio"
-mpc7_decoder_select="dsputil mpegaudiodsp"
-mpc8_decoder_select="dsputil mpegaudiodsp"
-mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
-mpeg_xvmc_decoder_select="mpeg2video_decoder"
-mpeg1video_decoder_select="error_resilience mpegvideo"
-mpeg1video_encoder_select="aandcttables mpegvideoenc"
-mpeg2video_decoder_select="error_resilience mpegvideo"
-mpeg2video_encoder_select="aandcttables mpegvideoenc"
-mpeg4_decoder_select="h263_decoder mpeg4video_parser"
-mpeg4_encoder_select="h263_encoder"
-msmpeg4v1_decoder_select="h263_decoder"
-msmpeg4v2_decoder_select="h263_decoder"
-msmpeg4v2_encoder_select="h263_encoder"
-msmpeg4v3_decoder_select="h263_decoder"
-msmpeg4v3_encoder_select="h263_encoder"
-mss2_decoder_select="error_resilience vc1_decoder"
-mxpeg_decoder_select="dsputil hpeldsp"
-nellymoser_decoder_select="mdct sinewin"
-nellymoser_encoder_select="audio_frame_queue mdct sinewin"
-nuv_decoder_select="dsputil lzo"
-png_decoder_deps="zlib"
-png_decoder_select="dsputil"
-png_encoder_deps="zlib"
-png_encoder_select="dsputil"
-prores_decoder_select="dsputil"
-prores_encoder_select="dsputil"
-qcelp_decoder_select="lsp"
-qdm2_decoder_select="mdct rdft mpegaudiodsp"
-ra_144_encoder_select="audio_frame_queue lpc"
-ralf_decoder_select="golomb"
-rv10_decoder_select="error_resilience h263_decoder h263dsp"
-rv10_encoder_select="h263_encoder"
-rv20_decoder_select="error_resilience h263_decoder h263dsp"
-rv20_encoder_select="h263_encoder"
-rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp"
-rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp"
-shorten_decoder_select="golomb"
-sipr_decoder_select="lsp"
-sp5x_decoder_select="dsputil hpeldsp"
-svq1_decoder_select="hpeldsp"
-svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
-svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel hpeldsp mpegvideo videodsp"
-svq3_decoder_suggest="error_resilience zlib"
-tak_decoder_select="dsputil"
-theora_decoder_select="vp3_decoder"
-tiff_decoder_suggest="zlib"
-tiff_encoder_suggest="zlib"
-thp_decoder_select="dsputil hpeldsp"
-truehd_decoder_select="mlp_decoder"
-truemotion2_decoder_select="dsputil"
-truespeech_decoder_select="dsputil"
-tscc_decoder_deps="zlib"
-twinvq_decoder_select="mdct lsp sinewin"
-utvideo_decoder_select="dsputil"
-utvideo_encoder_select="dsputil huffman"
-vble_decoder_select="dsputil"
-vc1_decoder_select="error_resilience h263_decoder h264chroma h264qpel intrax8"
-vc1image_decoder_select="vc1_decoder"
-vorbis_decoder_select="mdct"
-vorbis_encoder_select="mdct"
-vp3_decoder_select="hpeldsp vp3dsp videodsp"
-vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp"
-vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
-vp6a_decoder_select="vp6_decoder"
-vp6f_decoder_select="vp6_decoder"
-vp8_decoder_select="h264pred videodsp"
-vp9_decoder_select="videodsp"
-webp_decoder_select="vp8_decoder"
-wmapro_decoder_select="mdct sinewin"
-wmav1_decoder_select="mdct sinewin"
-wmav1_encoder_select="mdct sinewin"
-wmav2_decoder_select="mdct sinewin"
-wmav2_encoder_select="mdct sinewin"
-wmavoice_decoder_select="lsp rdft dct mdct sinewin"
-wmv1_decoder_select="h263_decoder"
-wmv1_encoder_select="h263_encoder"
-wmv2_decoder_select="h263_decoder intrax8 videodsp"
-wmv2_encoder_select="h263_encoder"
-wmv3_decoder_select="vc1_decoder"
-wmv3image_decoder_select="wmv3_decoder"
-zerocodec_decoder_deps="zlib"
-zlib_decoder_deps="zlib"
-zlib_encoder_deps="zlib"
-zmbv_decoder_deps="zlib"
-zmbv_encoder_deps="zlib"
-
-# hardware accelerators
-dxva2_deps="dxva2api_h"
-vaapi_deps="va_va_h"
-vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
-vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
-vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
-
-h263_vaapi_hwaccel_deps="vaapi"
-h263_vaapi_hwaccel_select="h263_decoder"
-h263_vdpau_hwaccel_deps="vdpau"
-h263_vdpau_hwaccel_select="h263_decoder"
-h264_dxva2_hwaccel_deps="dxva2"
-h264_dxva2_hwaccel_select="h264_decoder"
-h264_vaapi_hwaccel_deps="vaapi"
-h264_vaapi_hwaccel_select="h264_decoder"
-h264_vda_hwaccel_deps="vda"
-h264_vda_hwaccel_select="h264_decoder"
-h264_vdpau_hwaccel_deps="vdpau"
-h264_vdpau_hwaccel_select="h264_decoder"
-mpeg1_vdpau_hwaccel_deps="vdpau"
-mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
-mpeg2_dxva2_hwaccel_deps="dxva2"
-mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
-mpeg2_vaapi_hwaccel_deps="vaapi"
-mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
-mpeg2_vdpau_hwaccel_deps="vdpau"
-mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
-mpeg4_vaapi_hwaccel_deps="vaapi"
-mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
-mpeg4_vdpau_hwaccel_deps="vdpau"
-mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
-vc1_dxva2_hwaccel_deps="dxva2"
-vc1_dxva2_hwaccel_select="vc1_decoder"
-vc1_vaapi_hwaccel_deps="vaapi"
-vc1_vaapi_hwaccel_select="vc1_decoder"
-vc1_vdpau_hwaccel_deps="vdpau"
-vc1_vdpau_hwaccel_select="vc1_decoder"
-wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
-wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
-wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
-
-# parsers
-h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
-mpeg4video_parser_select="error_resilience h263dsp mpegvideo"
-mpegvideo_parser_select="error_resilience mpegvideo"
-vc1_parser_select="mpegvideo"
-
-# external libraries
-libfaac_encoder_deps="libfaac"
-libfaac_encoder_select="audio_frame_queue"
-libfdk_aac_decoder_deps="libfdk_aac"
-libfdk_aac_encoder_deps="libfdk_aac"
-libfdk_aac_encoder_select="audio_frame_queue"
-libgsm_decoder_deps="libgsm"
-libgsm_encoder_deps="libgsm"
-libgsm_ms_decoder_deps="libgsm"
-libgsm_ms_encoder_deps="libgsm"
-libilbc_decoder_deps="libilbc"
-libilbc_encoder_deps="libilbc"
-libmp3lame_encoder_deps="libmp3lame"
-libmp3lame_encoder_select="audio_frame_queue"
-libopencore_amrnb_decoder_deps="libopencore_amrnb"
-libopencore_amrnb_encoder_deps="libopencore_amrnb"
-libopencore_amrnb_encoder_select="audio_frame_queue"
-libopencore_amrwb_decoder_deps="libopencore_amrwb"
-libopenjpeg_decoder_deps="libopenjpeg"
-libopenjpeg_encoder_deps="libopenjpeg"
-libopus_decoder_deps="libopus"
-libopus_encoder_deps="libopus"
-libopus_encoder_select="audio_frame_queue"
-libschroedinger_decoder_deps="libschroedinger"
-libschroedinger_encoder_deps="libschroedinger"
-libspeex_decoder_deps="libspeex"
-libspeex_encoder_deps="libspeex"
-libspeex_encoder_select="audio_frame_queue"
-libtheora_encoder_deps="libtheora"
-libvo_aacenc_encoder_deps="libvo_aacenc"
-libvo_aacenc_encoder_select="audio_frame_queue"
-libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
-libvorbis_encoder_deps="libvorbis"
-libvorbis_encoder_select="audio_frame_queue"
-libvpx_vp8_decoder_deps="libvpx"
-libvpx_vp8_encoder_deps="libvpx"
-libvpx_vp9_decoder_deps="libvpx"
-libvpx_vp9_encoder_deps="libvpx"
-libwavpack_encoder_deps="libwavpack"
-libwebp_encoder_deps="libwebp"
-libx264_encoder_deps="libx264"
-libxavs_encoder_deps="libxavs"
-libxvid_encoder_deps="libxvid"
-
-# demuxers / muxers
-ac3_demuxer_select="ac3_parser"
-asf_demuxer_select="riffdec"
-asf_muxer_select="riffenc"
-asf_stream_muxer_select="asf_muxer"
-avi_demuxer_select="riffdec"
-avi_muxer_select="riffenc"
-avisynth_demuxer_deps="avisynth"
-avisynth_demuxer_select="riffdec"
-caf_demuxer_select="riffdec"
-dirac_demuxer_select="dirac_parser"
-dxa_demuxer_select="riffdec"
-eac3_demuxer_select="ac3_parser"
-f4v_muxer_select="mov_muxer"
-flac_demuxer_select="flac_parser"
-hds_muxer_select="flv_muxer"
-hls_muxer_select="mpegts_muxer"
-ipod_muxer_select="mov_muxer"
-ismv_muxer_select="mov_muxer"
-matroska_audio_muxer_select="matroska_muxer"
-matroska_demuxer_select="riffdec"
-matroska_demuxer_suggest="bzlib lzo zlib"
-matroska_muxer_select="riffenc"
-mmf_muxer_select="riffenc"
-mov_demuxer_select="riffdec"
-mov_demuxer_suggest="zlib"
-mov_muxer_select="riffenc rtpenc_chain"
-mp3_demuxer_select="mpegaudio_parser"
-mp4_muxer_select="mov_muxer"
-mpegts_muxer_select="adts_muxer latm_muxer"
-mpegtsraw_demuxer_select="mpegts_demuxer"
-mxf_d10_muxer_select="mxf_muxer"
-nut_muxer_select="riffenc"
-nuv_demuxer_select="riffdec"
-ogg_demuxer_select="golomb"
-psp_muxer_select="mov_muxer"
-rtp_demuxer_select="sdp_demuxer"
-rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
-rtsp_demuxer_select="http_protocol rtpdec"
-rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
-sap_demuxer_select="sdp_demuxer"
-sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
-sdp_demuxer_select="rtpdec"
-smoothstreaming_muxer_select="ismv_muxer"
-spdif_muxer_select="aac_parser"
-tak_demuxer_select="tak_parser"
-tg2_muxer_select="mov_muxer"
-tgp_muxer_select="mov_muxer"
-w64_demuxer_select="wav_demuxer"
-wav_demuxer_select="riffdec"
-wav_muxer_select="riffenc"
-webm_muxer_select="riffenc"
-wtv_demuxer_select="riffdec"
-xmv_demuxer_select="riffdec"
-xwma_demuxer_select="riffdec"
-
-# indevs / outdevs
-alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
-alsa_outdev_deps="alsa_asoundlib_h"
-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"
-dv1394_indev_select="dv_demuxer"
-fbdev_indev_deps="linux_fb_h"
-jack_indev_deps="jack_jack_h pthreads"
-libcdio_indev_deps="libcdio"
-libdc1394_indev_deps="libdc1394"
-oss_indev_deps_any="soundcard_h sys_soundcard_h"
-oss_outdev_deps_any="soundcard_h sys_soundcard_h"
-pulse_indev_deps="libpulse"
-sndio_indev_deps="sndio_h"
-sndio_outdev_deps="sndio_h"
-v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
-vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
-vfwcap_indev_extralibs="-lavicap32"
-x11grab_indev_deps="x11grab XShmCreateImage"
-
-# protocols
-ffrtmpcrypt_protocol_deps="!librtmp_protocol"
-ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
-ffrtmpcrypt_protocol_select="tcp_protocol"
-ffrtmphttp_protocol_deps="!librtmp_protocol"
-ffrtmphttp_protocol_select="http_protocol"
-gopher_protocol_select="network"
-httpproxy_protocol_select="tcp_protocol"
-http_protocol_select="tcp_protocol"
-https_protocol_select="tls_protocol"
-librtmp_protocol_deps="librtmp"
-librtmpe_protocol_deps="librtmp"
-librtmps_protocol_deps="librtmp"
-librtmpt_protocol_deps="librtmp"
-librtmpte_protocol_deps="librtmp"
-mmsh_protocol_select="http_protocol"
-mmst_protocol_select="network"
-rtmp_protocol_deps="!librtmp_protocol"
-rtmp_protocol_select="tcp_protocol"
-rtmpe_protocol_select="ffrtmpcrypt_protocol"
-rtmps_protocol_deps="!librtmp_protocol"
-rtmps_protocol_select="tls_protocol"
-rtmpt_protocol_select="ffrtmphttp_protocol"
-rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
-rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
-rtp_protocol_select="udp_protocol"
-sctp_protocol_deps="struct_sctp_event_subscribe"
-sctp_protocol_select="network"
-srtp_protocol_select="rtp_protocol"
-tcp_protocol_select="network"
-tls_protocol_deps_any="openssl gnutls"
-tls_protocol_select="tcp_protocol"
-udp_protocol_select="network"
-unix_protocol_deps="sys_un_h"
-unix_protocol_select="network"
-
-# filters
-blackframe_filter_deps="gpl"
-boxblur_filter_deps="gpl"
-cropdetect_filter_deps="gpl"
-delogo_filter_deps="gpl"
-drawtext_filter_deps="libfreetype"
-frei0r_filter_deps="frei0r dlopen"
-frei0r_filter_extralibs='$ldl'
-frei0r_src_filter_deps="frei0r dlopen"
-frei0r_src_filter_extralibs='$ldl'
-hqdn3d_filter_deps="gpl"
-interlace_filter_deps="gpl"
-resample_filter_deps="avresample"
-ocv_filter_deps="libopencv"
-scale_filter_deps="swscale"
-
-# examples
-avcodec_example_deps="avcodec avutil"
-metadata_example_deps="avformat avutil"
-output_example_deps="avcodec avformat avutil swscale"
-transcode_aac_example_deps="avcodec avformat avresample"
-
-# libraries
-avcodec_deps="avutil"
-avdevice_deps="avutil avcodec avformat"
-avfilter_deps="avutil"
-avformat_deps="avutil avcodec"
-avresample_deps="avutil"
-swscale_deps="avutil"
-
-# programs
-avconv_deps="avcodec avfilter avformat avresample swscale"
-avconv_select="aformat_filter anull_filter asyncts_filter atrim_filter format_filter
-               fps_filter null_filter resample_filter scale_filter
-               setpts_filter trim_filter"
-avplay_deps="avcodec avformat avresample swscale sdl"
-avplay_libs='$sdl_libs'
-avplay_select="rdft"
-avprobe_deps="avcodec avformat"
-avserver_deps="avformat fork !shared"
-avserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
-
-# documentation
-pod2man_deps="doc"
-texi2html_deps="doc"
-
-# default parameters
-
-logfile="config.log"
-
-# installation paths
-prefix_default="/usr/local"
-bindir_default='${prefix}/bin'
-datadir_default='${prefix}/share/avconv'
-docdir_default='${prefix}/share/doc/libav'
-incdir_default='${prefix}/include'
-libdir_default='${prefix}/lib'
-mandir_default='${prefix}/share/man'
-shlibdir_default="$libdir_default"
-
-# toolchain
-ar_default="ar"
-cc_default="gcc"
-host_cc_default="gcc"
-cp_f="cp -f"
-ln_s="ln -s -f"
-nm_default="nm -g"
-objformat="elf"
-pkg_config_default=pkg-config
-ranlib="ranlib"
-strip="strip"
-yasmexe="yasm"
-
-nogas=":"
-
-# machine
-arch_default=$(uname -m)
-cpu="generic"
-
-# OS
-target_os_default=$(tolower $(uname -s))
-host_os=$target_os_default
-
-# configurable options
-enable $EXAMPLE_LIST $LIBRARY_LIST $PROGRAM_LIST
-
-enable asm
-enable debug
-enable doc
-enable optimizations
-enable safe_bitstream_reader
-enable static
-enable swscale_alpha
-
-# By default, enable only those hwaccels that have no external dependencies.
-enable dxva2 vdpau
-
-# build settings
-SHFLAGS='-shared -Wl,-soname,$$(@F)'
-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)"'
-SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
-SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
-
-asflags_filter=echo
-cflags_filter=echo
-ldflags_filter=echo
-
-AS_C='-c'
-AS_O='-o $@'
-CC_C='-c'
-CC_E='-E -o $@'
-CC_O='-o $@'
-LD_O='-o $@'
-LD_LIB='-l%'
-LD_PATH='-L'
-HOSTCC_C='-c'
-HOSTCC_E='-E -o $@'
-HOSTCC_O='-o $@'
-HOSTLD_O='-o $@'
-
-host_libs='-lm'
-host_cflags_filter=echo
-host_ldflags_filter=echo
-
-target_path='$(CURDIR)'
-
-# since the object filename is not given with the -MM flag, the compiler
-# is only able to print the basename, and we must add the path ourselves
-DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
-DEPFLAGS='-MM'
-
-# find source path
-if test -f configure; then
-    source_path=.
-else
-    source_path=$(cd $(dirname "$0"); 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")
-    LIBAV_CONFIGURATION="${LIBAV_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)
-
-ALL_COMPONENTS="
-    $BSF_LIST
-    $DECODER_LIST
-    $DEMUXER_LIST
-    $ENCODER_LIST
-    $FILTER_LIST
-    $HWACCEL_LIST
-    $INDEV_LIST
-    $MUXER_LIST
-    $OUTDEV_LIST
-    $PARSER_LIST
-    $PROTOCOL_LIST
-"
-
-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
-}
-
-print_3_columns() {
-    cat | tr ' ' '\n' | sort | pr -r -3 -t
-}
-
-show_list() {
-    suffix=_$1
-    shift
-    echo $* | sed s/$suffix//g | print_3_columns
-    exit 0
-}
-
-rand_list(){
-    IFS=', '
-    set -- $*
-    unset IFS
-    for thing; do
-        comp=${thing%:*}
-        prob=${thing#$comp}
-        prob=${prob#:}
-        is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
-        echo "prob ${prob:-0.5}"
-        printf '%s\n' $comp
-    done
-}
-
-do_random(){
-    action=$1
-    shift
-    random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
-    $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
-}
-
-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-programs)
-            disable $PROGRAM_LIST
-        ;;
-        --disable-everything)
-            map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
-        ;;
-        --disable-all)
-            map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
-            disable $LIBRARY_LIST $PROGRAM_LIST doc
-        ;;
-        --enable-random|--disable-random)
-            action=${opt%%-random}
-            do_random ${action#--} $COMPONENT_LIST
-        ;;
-        --enable-random=*|--disable-random=*)
-            action=${opt%%-random=*}
-            do_random ${action#--} $optval
-        ;;
-        --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 $LIBAV_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
-
-ar_default="${cross_prefix}${ar_default}"
-cc_default="${cross_prefix}${cc_default}"
-nm_default="${cross_prefix}${nm_default}"
-pkg_config_default="${cross_prefix}${pkg_config_default}"
-ranlib="${cross_prefix}${ranlib}"
-strip="${cross_prefix}${strip}"
-
-sysinclude_default="${sysroot}/usr/include"
-
-case "$toolchain" in
-    clang-asan)
-        cc_default="clang"
-        add_cflags  -fsanitize=address
-        add_ldflags -fsanitize=address
-    ;;
-    clang-tsan)
-        cc_default="clang"
-        add_cflags  -fsanitize=thread -pie
-        add_ldflags -fsanitize=thread -pie
-    ;;
-    gcc-asan)
-        cc_default="gcc"
-        add_cflags  -fsanitize=address
-        add_ldflags -fsanitize=address
-    ;;
-    gcc-tsan)
-        cc_default="gcc"
-        add_cflags  -fsanitize=thread -pie -fPIC
-        add_ldflags -fsanitize=thread -pie -fPIC
-    ;;
-    valgrind-massif)
-        target_exec_default="valgrind"
-        target_exec_args="--alloc-fn=av_malloc --alloc-fn=av_mallocz"
-    ;;
-    valgrind-memcheck)
-        target_exec_default="valgrind"
-        target_exec_args="--track-origins=yes --leak-check=full"
-    ;;
-    msvc)
-        # Check whether the current MSVC version needs the C99 converter.
-        # From MSVC 2013 (compiler major version 18) onwards, it does actually
-        # support enough of C99 to build libav. Default to the new
-        # behaviour if the regexp was unable to match anything, since this
-        # successfully parses the version number of existing supported
-        # versions that require the converter (MSVC 2010 and 2012).
-        cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
-        if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
-            cc_default="cl"
-        else
-            cc_default="c99wrap cl"
-        fi
-        ld_default="link"
-        nm_default="dumpbin -symbols"
-        ar_default="lib"
-        target_os_default="win32"
-        # Use a relative path for TMPDIR. This makes sure all the
-        # ffconf temp files are written with a relative path, avoiding
-        # issues with msys/win32 path conversion for MSVC parameters
-        # such as -Fo<file> or -out:<file>.
-        TMPDIR=.
-    ;;
-    icl)
-        cc_default="icl"
-        ld_default="xilink"
-        nm_default="dumpbin -symbols"
-        ar_default="xilib"
-        target_os_default="win32"
-        TMPDIR=.
-    ;;
-    gcov)
-        add_cflags  -fprofile-arcs -ftest-coverage
-        add_ldflags -fprofile-arcs -ftest-coverage
-    ;;
-    hardened)
-        add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all
-        add_ldflags -Wl,-z,relro -Wl,-z,now
-    ;;
-    ?*)
-        die "Unknown toolchain $toolchain"
-    ;;
-esac
-
-set_default arch cc pkg_config sysinclude target_exec target_os
-enabled cross_compile || host_cc_default=$cc
-set_default host_cc
-
-if ! $pkg_config --version >/dev/null 2>&1; then
-    warn "$pkg_config not found, library detection may fail."
-    pkg_config=false
-fi
-
-exesuf() {
-    case $1 in
-        mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
-    esac
-}
-
-EXESUF=$(exesuf $target_os)
-HOSTEXESUF=$(exesuf $host_os)
-
-# set temporary file name
-: ${TMPDIR:=$TEMPDIR}
-: ${TMPDIR:=$TMP}
-: ${TMPDIR:=/tmp}
-
-if ! check_cmd mktemp -u XXXXXX; 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
-
-tmpfile TMPASM .asm
-tmpfile TMPC   .c
-tmpfile TMPE   $EXESUF
-tmpfile TMPH   .h
-tmpfile TMPO   .o
-tmpfile TMPS   .S
-tmpfile TMPSH  .sh
-tmpfile TMPV   .ver
-
-unset -f mktemp
-
-chmod +x $TMPE
-
-# 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
-
-ccc_flags(){
-    for flag; do
-        case $flag in
-            -std=c99)           echo -c99                       ;;
-            -mcpu=*)            echo -arch ${flag#*=}           ;;
-            -mieee)             echo -ieee                      ;;
-            -O*|-fast)          echo $flag                      ;;
-            -fno-math-errno)    echo -assume nomath_errno       ;;
-            -g)                 echo -g3                        ;;
-            -Wall)              echo -msg_enable level2         ;;
-            -Wno-pointer-sign)  echo -msg_disable ptrmismatch1  ;;
-            -Wl,*)              echo $flag                      ;;
-            -f*|-W*)                                            ;;
-            *)                  echo $flag                      ;;
-        esac
-   done
-}
-
-cparser_flags(){
-    for flag; do
-        case $flag in
-            -Wno-switch)             echo -Wno-switch-enum ;;
-            -Wno-format-zero-length) ;;
-            -Wdisabled-optimization) ;;
-            -Wno-pointer-sign)       echo -Wno-other ;;
-            *)                       echo $flag ;;
-        esac
-    done
-}
-
-msvc_common_flags(){
-    for flag; do
-        case $flag in
-            # In addition to specifying certain flags under the compiler
-            # specific filters, they must be specified here as well or else the
-            # generic catch all at the bottom will print the original flag.
-            -Wall)                ;;
-            -std=c99)             ;;
-            # Common flags
-            -fomit-frame-pointer) ;;
-            -g)                   echo -Z7 ;;
-            -fno-math-errno)      ;;
-            -fno-common)          ;;
-            -fno-signed-zeros)    ;;
-            -fPIC)                ;;
-            -mthumb)              ;;
-            -march=*)             ;;
-            -lz)                  echo zlib.lib ;;
-            -lavifil32)           echo vfw32.lib ;;
-            -lavicap32)           echo vfw32.lib user32.lib ;;
-            -l*)                  echo ${flag#-l}.lib ;;
-            *)                    echo $flag ;;
-        esac
-    done
-}
-
-msvc_flags(){
-    msvc_common_flags "$@"
-    for flag; do
-        case $flag in
-            -Wall)                echo -W4 -wd4244 -wd4127 -wd4018 -wd4389     \
-                                       -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
-                                       -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
-                                       -wd4273 ;;
-        esac
-    done
-}
-
-icl_flags(){
-    msvc_common_flags "$@"
-    for flag; do
-        case $flag in
-            # Despite what Intel's documentation says -Wall, which is supported
-            # on Windows, does enable remarks so disable them here.
-            -Wall)                echo $flag -Qdiag-disable:remark ;;
-            -std=c99)             echo -Qstd=c99 ;;
-        esac
-    done
-}
-
-pgi_flags(){
-    for flag; do
-        case $flag in
-            -flto)                echo -Mipa=fast,libopt,libinline,vestigial ;;
-            -fomit-frame-pointer) echo -Mnoframe ;;
-            -g)                   echo -gopt ;;
-            *)                    echo $flag ;;
-        esac
-    done
-}
-
-suncc_flags(){
-    for flag; do
-        case $flag in
-            -march=*|-mcpu=*)
-                case "${flag#*=}" in
-                    native)                   echo -xtarget=native       ;;
-                    v9|niagara)               echo -xarch=sparc          ;;
-                    ultrasparc)               echo -xarch=sparcvis       ;;
-                    ultrasparc3|niagara2)     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   ;;
-                    corei7)           echo -xarch=sse4_2 -xchip=nehalem  ;;
-                    corei7-avx)       echo -xarch=avx -xchip=sandybridge ;;
-                    amdfam10|barcelona|bdver*) 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*|-mimpure-text)                      ;;
-            -shared)              echo -G                 ;;
-            *)                    echo $flag              ;;
-        esac
-    done
-}
-
-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        ;;
-            -mfpu=vfpv3-d16) echo --float_support=vfpv3d16    ;;
-            -msoft-float)   echo --float_support=vfplib       ;;
-            -O[0-3]|-mf=*)  echo $flag                        ;;
-            -g)             echo -g -mn                       ;;
-            -pds=*)         echo $flag                        ;;
-            -D*|-I*)        echo $flag                        ;;
-            --gcc|--abi=*)  echo $flag                        ;;
-            -me)            echo $flag                        ;;
-        esac
-    done
-}
-
-probe_cc(){
-    pfx=$1
-    _cc=$2
-
-    unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
-    unset _ld_o _ldflags _ld_lib _ld_path
-    unset _depflags _DEPCMD _DEPFLAGS
-    _flags_filter=echo
-
-    if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
-        _type=llvm_gcc
-        gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
-        _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
-        _depflags='-MMD -MF $(@:.o=.d) -MT $@'
-        _cflags_speed='-O3'
-        _cflags_size='-Os'
-    elif $_cc -v 2>&1 | grep -qi ^gcc; then
-        _type=gcc
-        gcc_version=$($_cc --version | head -n1)
-        gcc_basever=$($_cc -dumpversion)
-        gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
-        gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
-        _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
-        if ! $_cc -dumpversion | grep -q '^2\.'; then
-            _depflags='-MMD -MF $(@:.o=.d) -MT $@'
-        fi
-        _cflags_speed='-O3'
-        _cflags_size='-Os'
-    elif $_cc --version 2>/dev/null | grep -q ^icc; then
-        _type=icc
-        _ident=$($_cc --version | head -n1)
-        _depflags='-MMD'
-        _cflags_speed='-O3'
-        _cflags_size='-Os'
-        _cflags_noopt='-O1'
-    elif $_cc -v 2>&1 | grep -q xlc; then
-        _type=xlc
-        _ident=$($_cc -qversion 2>/dev/null | head -n1)
-        _cflags_speed='-O5'
-        _cflags_size='-O5 -qcompact'
-    elif $_cc -V 2>/dev/null | grep -q Compaq; then
-        _type=ccc
-        _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
-        _DEPFLAGS='-M'
-        _cflags_speed='-fast'
-        _cflags_size='-O1'
-        _flags_filter=ccc_flags
-    elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
-        test -d "$sysroot" || die "No valid sysroot specified."
-        _type=armcc
-        _ident=$($_cc --vsn | head -n1)
-        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 --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
-        _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
-        as_default="${cross_prefix}gcc"
-        _depflags='-MMD'
-        _cflags_speed='-O3'
-        _cflags_size='-Os'
-    elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
-        _type=tms470
-        _ident=$($_cc -version | head -n1 | tr -s ' ')
-        _flags='--gcc --abi=eabi -me'
-        _cc_e='-ppl -fe=$@'
-        _cc_o='-fe=$@'
-        _depflags='-ppa -ppd=$(@:.o=.d)'
-        _cflags_speed='-O3 -mf=5'
-        _cflags_size='-O3 -mf=2'
-        _flags_filter=tms470_flags
-    elif $_cc -v 2>&1 | grep -q clang; then
-        _type=clang
-        _ident=$($_cc --version | head -n1)
-        _depflags='-MMD -MF $(@:.o=.d) -MT $@'
-        _cflags_speed='-O3'
-        _cflags_size='-Os'
-    elif $_cc -V 2>&1 | grep -q Sun; then
-        _type=suncc
-        _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
-        _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
-        _DEPFLAGS='-xM1 -xc99'
-        _ldflags='-std=c99'
-        _cflags_speed='-O5'
-        _cflags_size='-O5 -xspace'
-        _flags_filter=suncc_flags
-    elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
-        _type=pathscale
-        _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
-        _depflags='-MMD -MF $(@:.o=.d) -MT $@'
-        _cflags_speed='-O2'
-        _cflags_size='-Os'
-        _flags_filter='filter_out -Wdisabled-optimization'
-    elif $_cc -v 2>&1 | grep -q Open64; then
-        _type=open64
-        _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
-        _depflags='-MMD -MF $(@:.o=.d) -MT $@'
-        _cflags_speed='-O2'
-        _cflags_size='-Os'
-        _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
-    elif $_cc -V 2>&1 | grep -q Portland; then
-        _type=pgi
-        _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
-        opt_common='-alias=ansi -Mdse -Mlre -Mpre'
-        _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
-        _cflags_size="-O2 -Munroll=c:1 $opt_common"
-        _cflags_noopt="-O1"
-        _flags_filter=pgi_flags
-    elif $_cc 2>&1 | grep -q Microsoft; then
-        _type=msvc
-        _ident=$($cc 2>&1 | head -n1)
-        _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
-        _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
-        _cflags_speed="-O2"
-        _cflags_size="-O1"
-        if $_cc 2>&1 | grep -q Linker; then
-            _ld_o='-out:$@'
-        else
-            _ld_o='-Fe$@'
-        fi
-        _cc_o='-Fo$@'
-        _cc_e='-P -Fi$@'
-        _flags_filter=msvc_flags
-        _ld_lib='lib%.a'
-        _ld_path='-libpath:'
-        _flags='-nologo'
-        _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
-        if [ $pfx = hostcc ]; then
-            append _cflags -Dsnprintf=_snprintf
-        fi
-    elif $_cc 2>&1 | grep -q Intel; then
-        _type=icl
-        _ident=$($cc 2>&1 | head -n1)
-        _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
-        # Not only is O3 broken on 13.x+ but it is slower on all previous
-        # versions (tested) as well.
-        _cflags_speed="-O2"
-        _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
-        if $_cc 2>&1 | grep -q Linker; then
-            _ld_o='-out:$@'
-        else
-            _ld_o='-Fe$@'
-        fi
-        _cc_o='-Fo$@'
-        _cc_e='-P'
-        _flags_filter=icl_flags
-        _ld_lib='lib%.a'
-        _ld_path='-libpath:'
-        # -Qdiag-error to make icl error when seeing certain unknown arguments
-        _flags='-nologo -Qdiag-error:4044,10157'
-        # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency
-        # with MSVC which enables it by default.
-        _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS'
-        if [ $pfx = hostcc ]; then
-            append _cflags -Dsnprintf=_snprintf
-        fi
-    elif $_cc --version 2>/dev/null | grep -q ^cparser; then
-        _type=cparser
-        _ident=$($_cc --version | head -n1)
-        _depflags='-MMD'
-        _cflags_speed='-O4'
-        _cflags_size='-O2'
-        _flags_filter=cparser_flags
-    fi
-
-    eval ${pfx}_type=\$_type
-    eval ${pfx}_ident=\$_ident
-}
-
-set_ccvars(){
-    eval ${1}_C=\${_cc_c-\${${1}_C}}
-    eval ${1}_E=\${_cc_e-\${${1}_E}}
-    eval ${1}_O=\${_cc_o-\${${1}_O}}
-
-    if [ -n "$_depflags" ]; then
-        eval ${1}_DEPFLAGS=\$_depflags
-    else
-        eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
-        eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
-        eval DEP${1}FLAGS=\$_flags
-    fi
-}
-
-probe_cc cc "$cc"
-cflags_filter=$_flags_filter
-cflags_speed=$_cflags_speed
-cflags_size=$_cflags_size
-cflags_noopt=$_cflags_noopt
-add_cflags $_flags $_cflags
-cc_ldflags=$_ldflags
-set_ccvars CC
-
-probe_cc hostcc "$host_cc"
-host_cflags_filter=$_flags_filter
-add_host_cflags  $_flags $_cflags
-set_ccvars HOSTCC
-
-test -n "$cc_type" && enable $cc_type ||
-    warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
-
-: ${as_default:=$cc}
-: ${dep_cc_default:=$cc}
-: ${ld_default:=$cc}
-: ${host_ld_default:=$host_cc}
-set_default ar as dep_cc ld host_ld
-
-probe_cc as "$as"
-asflags_filter=$_flags_filter
-add_asflags $_flags $_cflags
-set_ccvars AS
-
-probe_cc ld "$ld"
-ldflags_filter=$_flags_filter
-add_ldflags $_flags $_ldflags
-test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
-LD_O=${_ld_o-$LD_O}
-LD_LIB=${_ld_lib-$LD_LIB}
-LD_PATH=${_ld_path-$LD_PATH}
-
-probe_cc hostld "$host_ld"
-host_ldflags_filter=$_flags_filter
-add_host_ldflags $_flags $_ldflags
-HOSTLD_O=${_ld_o-$HOSTLD_O}
-
-if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
-    probe_cc depcc "$dep_cc"
-    CCDEP=${_DEPCMD:-$DEPCMD}
-    CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
-    DEPCCFLAGS=$_flags
-fi
-
-if $ar 2>&1 | grep -q Microsoft; then
-    arflags="-nologo"
-    ar_o='-out:$@'
-elif $ar 2>&1 | grep -q 'Texas Instruments'; then
-    arflags="rq"
-    ar_o='$@'
-elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
-    arflags='-Xany -r -c'
-    ar_o='$@'
-else
-    arflags="rc"
-    ar_o='$@'
-fi
-
-add_cflags $extra_cflags
-add_asflags $extra_cflags
-
-if test -n "$sysroot"; then
-    case "$cc_type" in
-        gcc|llvm_gcc|clang)
-            add_cppflags --sysroot="$sysroot"
-            add_ldflags --sysroot="$sysroot"
-        ;;
-        tms470)
-            add_cppflags -I"$sysinclude"
-            add_ldflags  --sysroot="$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|llvm_gcc)
-            check_native(){
-                $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
-                sed -n "/cc1.*$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
-    aarch64|arm64)
-        arch="aarch64"
-    ;;
-    arm*)
-        arch="arm"
-    ;;
-    mips*|IP*)
-        arch="mips"
-    ;;
-    parisc*|hppa*)
-        arch="parisc"
-    ;;
-    "Power Macintosh"|ppc*|powerpc*)
-        arch="ppc"
-    ;;
-    s390|s390x)
-        arch="s390"
-    ;;
-    sh4|sh)
-        arch="sh4"
-    ;;
-    sun4u|sparc*)
-        arch="sparc"
-    ;;
-    tilegx|tile-gx)
-        arch="tilegx"
-    ;;
-    i[3-6]86|i86pc|BePC|x86pc|x86_64|amd64)
-        arch="x86"
-    ;;
-esac
-
-is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
-enable $arch
-
-# Add processor-specific flags
-if enabled aarch64; then
-
-    case $cpu in
-        armv*)
-            cpuflags="-march=$cpu"
-        ;;
-        *)
-            cpuflags="-mcpu=$cpu"
-        ;;
-    esac
-
-elif enabled alpha; then
-
-    cpuflags="-mcpu=$cpu"
-
-elif enabled arm; then
-
-    check_arm_arch() {
-        check_cpp_condition stddef.h \
-            "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
-            $cpuflags
-    }
-
-    probe_arm_arch() {
-        if   check_arm_arch 4;        then echo armv4;
-        elif check_arm_arch 4T;       then echo armv4t;
-        elif check_arm_arch 5;        then echo armv5;
-        elif check_arm_arch 5E;       then echo armv5e;
-        elif check_arm_arch 5T;       then echo armv5t;
-        elif check_arm_arch 5TE;      then echo armv5te;
-        elif check_arm_arch 5TEJ;     then echo armv5te;
-        elif check_arm_arch 6;        then echo armv6;
-        elif check_arm_arch 6J;       then echo armv6j;
-        elif check_arm_arch 6K;       then echo armv6k;
-        elif check_arm_arch 6Z;       then echo armv6z;
-        elif check_arm_arch 6ZK;      then echo armv6zk;
-        elif check_arm_arch 6T2;      then echo armv6t2;
-        elif check_arm_arch 7;        then echo armv7;
-        elif check_arm_arch 7A  7_A;  then echo armv7-a;
-        elif check_arm_arch 7R  7_R;  then echo armv7-r;
-        elif check_arm_arch 7M  7_M;  then echo armv7-m;
-        elif check_arm_arch 7EM 7E_M; then echo armv7-m;
-        elif check_arm_arch 8A  8_A;  then echo armv8-a;
-        fi
-    }
-
-    [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
-
-    case $cpu in
-        armv*)
-            cpuflags="-march=$cpu"
-            subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
-        ;;
-        *)
-            cpuflags="-mcpu=$cpu"
-            case $cpu in
-                cortex-a*)                               subarch=armv7a  ;;
-                cortex-r*)                               subarch=armv7r  ;;
-                cortex-m*)                 enable thumb; subarch=armv7m  ;;
-                arm11*)                                  subarch=armv6   ;;
-                arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
-                armv4*|arm7*|arm9[24]*)                  subarch=armv4   ;;
-                *)                             subarch=$(probe_arm_arch) ;;
-            esac
-        ;;
-    esac
-
-    case "$subarch" in
-        armv5t*)    enable fast_clz                ;;
-        armv[6-8]*) enable fast_clz fast_unaligned ;;
-    esac
-
-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
-
-elif enabled bfin; then
-
-    cpuflags="-mcpu=$cpu"
-
-elif enabled mips; then
-
-    cpuflags="-march=$cpu"
-
-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"
-            disable altivec
-        ;;
-        g4|745*|ppc745*|powerpc745*)
-            cpuflags="-mcpu=7450"
-        ;;
-        74*|ppc74*|powerpc74*)
-            cpuflags="-mcpu=7400"
-        ;;
-        g5|970|ppc970|powerpc970)
-            cpuflags="-mcpu=970"
-        ;;
-        power[3-7]*)
-            cpuflags="-mcpu=$cpu"
-        ;;
-        cell)
-            cpuflags="-mcpu=cell"
-            enable ldbrx
-        ;;
-        e500mc)
-            cpuflags="-mcpu=e500mc"
-            disable altivec
-        ;;
-        e500v2)
-            cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
-            disable altivec
-        ;;
-        e500)
-            cpuflags="-mcpu=8540 -mhard-float"
-            disable altivec
-        ;;
-    esac
-
-elif enabled sparc; then
-
-    case $cpu in
-        cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
-            cpuflags="-mcpu=$cpu"
-            disable vis
-        ;;
-        ultrasparc*|niagara[234])
-            cpuflags="-mcpu=$cpu"
-        ;;
-    esac
-
-elif enabled x86; then
-
-    case $cpu in
-        i[345]86|pentium)
-            cpuflags="-march=$cpu"
-            disable mmx
-        ;;
-        # targets that do NOT support nopl and conditional mov (cmov)
-        pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
-            cpuflags="-march=$cpu"
-            disable i686
-        ;;
-        # targets that do support nopl and conditional mov (cmov)
-        i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|corei7*|amdfam10|barcelona|atom|bdver*)
-            cpuflags="-march=$cpu"
-            enable i686
-            enable fast_cmov
-        ;;
-        # targets that do support conditional mov but on which it's slow
-        pentium4|pentium4m|prescott|nocona)
-            cpuflags="-march=$cpu"
-            enable i686
-            disable fast_cmov
-        ;;
-    esac
-
-fi
-
-if [ "$cpu" != generic ]; then
-    add_cflags  $cpuflags
-    add_asflags $cpuflags
-fi
-
-# 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
-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
-
-add_host_cppflags -D_ISOC99_SOURCE
-check_host_cflags -std=c99
-check_host_cflags -Wall
-check_host_cflags -O3
-
-check_64bit(){
-    arch32=$1
-    arch64=$2
-    expr=$3
-    check_code cc "" "int test[2*($expr) - 1]" &&
-        subarch=$arch64 || subarch=$arch32
-}
-
-case "$arch" in
-    aarch64|alpha|ia64)
-        spic=$shared
-    ;;
-    mips)
-        check_64bit mips mips64 '_MIPS_SIM > 1'
-        spic=$shared
-    ;;
-    parisc)
-        check_64bit parisc parisc64 'sizeof(void *) > 4'
-        spic=$shared
-    ;;
-    ppc)
-        check_64bit ppc ppc64 'sizeof(void *) > 4'
-        spic=$shared
-    ;;
-    s390)
-        check_64bit s390 s390x 'sizeof(void *) > 4'
-        spic=$shared
-    ;;
-    sparc)
-        check_64bit sparc sparc64 'sizeof(void *) > 4'
-        spic=$shared
-    ;;
-    x86)
-        check_64bit x86_32 x86_64 'sizeof(void *) > 4'
-        if test "$subarch" = "x86_64"; then
-            spic=$shared
-        fi
-    ;;
-esac
-
-enable $subarch
-enabled spic && enable_weak pic
-
-# OS specific
-case $target_os in
-    aix)
-        SHFLAGS=-shared
-        add_cppflags '-I\$(SRC_PATH)/compat/aix'
-        enabled shared && add_ldflags -Wl,-brtl
-        ;;
-    haiku)
-        prefix_default="/boot/common"
-        network_extralibs="-lnetwork"
-        host_libs=
-        ;;
-    sunos)
-        SHFLAGS='-shared -Wl,-h,$$(@F)'
-        enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
-        network_extralibs="-lsocket -lnsl"
-        # When using suncc to build, the Solaris linker will mark
-        # an executable with each instruction set encountered by
-        # the Solaris assembler.  As our libraries contain their own
-        # guards for processor-specific code, instead suppress
-        # generation of the HWCAPS ELF section on Solaris x86 only.
-        enabled_all suncc x86 &&
-            echo "hwcap_1 = OVERRIDE;" > mapfile &&
-            add_ldflags -Wl,-M,mapfile
-        nm_default='nm -P -g'
-        ;;
-    netbsd)
-        disable symver
-        oss_indev_extralibs="-lossaudio"
-        oss_outdev_extralibs="-lossaudio"
-        ;;
-    openbsd|bitrig)
-        disable symver
-        SHFLAGS='-shared'
-        SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
-        SLIB_INSTALL_LINKS=
-        oss_indev_extralibs="-lossaudio"
-        oss_outdev_extralibs="-lossaudio"
-        ;;
-    dragonfly)
-        disable symver
-        ;;
-    freebsd)
-        ;;
-    bsd/os)
-        add_extralibs -lpoll -lgnugetopt
-        ;;
-    darwin)
-        gas="gas-preprocessor.pl $cc"
-        enabled ppc && add_asflags -force_cpusubtype_ALL
-        SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
-        enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
-        add_ldflags -Wl,-dynamic,-search_paths_first
-        SLIBSUF=".dylib"
-        SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
-        SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
-        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
-            LIBTARGET="i386:x86-64"
-        elif enabled arm; then
-            LIBTARGET=arm-wince
-        fi
-        check_ldflags -Wl,--nxcompat
-        check_ldflags -Wl,--dynamicbase
-        shlibdir_default="$bindir_default"
-        SLIBPREF=""
-        SLIBSUF=".dll"
-        SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
-        SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
-        SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
-        SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
-        SLIB_INSTALL_LINKS=
-        SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
-        SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
-        SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
-        objformat="win32"
-        dlltool="${cross_prefix}dlltool"
-        ranlib=:
-        enable dos_paths
-        ;;
-    win32|win64)
-        disable symver
-        if enabled shared; then
-            # Link to the import library instead of the normal static library
-            # for shared libs.
-            LD_LIB='%.lib'
-            # Cannot build both shared and static libs with MSVC or icl.
-            disable static
-        fi
-        shlibdir_default="$bindir_default"
-        SLIBPREF=""
-        SLIBSUF=".dll"
-        SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
-        SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
-        SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
-        SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
-        SLIB_INSTALL_LINKS=
-        SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
-        SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
-        SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
-        objformat="win32"
-        ranlib=:
-        enable dos_paths
-        ;;
-    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)'
-        SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
-        SLIB_INSTALL_LINKS=
-        SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
-        SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
-        objformat="win32"
-        enable dos_paths
-        ;;
-    *-dos|freedos|opendos)
-        network_extralibs="-lsocket"
-        objformat="coff"
-        enable dos_paths
-        add_cppflags -U__STRICT_ANSI__
-        ;;
-    linux)
-        enable dv1394
-        ;;
-    irix*)
-        target_os=irix
-        ranlib="echo ignoring ranlib"
-        ;;
-    os/2*)
-        ln_s="cp -f"
-        objformat="aout"
-        add_cppflags -D_GNU_SOURCE
-        add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
-        SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
-        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_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
-        enable dos_paths
-        ;;
-    gnu/kfreebsd)
-        add_cppflags -D_BSD_SOURCE
-        ;;
-    gnu)
-        ;;
-    qnx)
-        add_cppflags -D_QNX_SOURCE
-        network_extralibs="-lsocket"
-        ;;
-    symbian)
-        SLIBSUF=".dll"
-        enable dos_paths
-        add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
-        add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
-        add_ldflags -Wl,--target1-abs,--no-undefined \
-                    -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
-                    -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
-        add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
-                      -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
-                      -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
-        ;;
-    osf1)
-        add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
-        ;;
-    minix)
-        ;;
-    plan9)
-        add_cppflags -D_C99_SNPRINTF_EXTENSION  \
-                     -D_REENTRANT_SOURCE        \
-                     -D_RESEARCH_SOURCE         \
-                     -DFD_SETSIZE=96            \
-                     -DHAVE_SOCK_OPTS
-        add_compat strtod.o strtod=avpriv_strtod
-        network_extralibs='-lbsd'
-        exeobjs=compat/plan9/main.o
-        disable avserver
-        cp_f='cp'
-        ;;
-    none)
-        ;;
-    *)
-        die "Unknown OS '$target_os'."
-        ;;
-esac
-
-# determine libc flavour
-
-probe_libc(){
-    pfx=$1
-    pfx_no_=${pfx%_}
-    # uclibc defines __GLIBC__, so it needs to be checked before glibc.
-    if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
-        eval ${pfx}libc_type=uclibc
-        add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
-    elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
-        eval ${pfx}libc_type=glibc
-        add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
-    # MinGW headers can be installed on Cygwin, so check for newlib first.
-    elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
-        eval ${pfx}libc_type=newlib
-        add_${pfx}cppflags -U__STRICT_ANSI__
-    # MinGW64 is backwards compatible with MinGW32, so check for it first.
-    elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
-        eval ${pfx}libc_type=mingw64
-        add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
-        eval test \$${pfx_no_}cc_type = "gcc" &&
-            add_${pfx}cppflags -D__printf__=__gnu_printf__
-    elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION"  ||
-         check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
-        eval ${pfx}libc_type=mingw32
-        check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
-            (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
-            die "ERROR: MinGW32 runtime version must be >= 3.15."
-        add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
-        eval test \$${pfx_no_}cc_type = "gcc" &&
-            add_${pfx}cppflags -D__printf__=__gnu_printf__
-    elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
-        eval ${pfx}libc_type=msvcrt
-        # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
-        # 0x601 by default unless something else is set by the user.
-        # This can easily lead to us detecting functions only present
-        # in such new versions and producing binaries requiring windows 7.0.
-        # Therefore explicitly set the default to XP unless the user has
-        # set something else on the command line.
-        check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
-            add_${pfx}cppflags -D_WIN32_WINNT=0x0502
-    elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
-        eval ${pfx}libc_type=klibc
-    elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
-        eval ${pfx}libc_type=bionic
-    elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
-        eval ${pfx}libc_type=solaris
-        add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
-    fi
-}
-
-probe_libc
-test -n "$libc_type" && enable libc_$libc_type
-probe_libc host_
-test -n "$host_libc_type" && enable host_libc_$host_libc_type
-
-case $libc_type in
-    bionic)
-        add_compat strtod.o strtod=avpriv_strtod
-        ;;
-    msvcrt)
-        add_compat strtod.o strtod=avpriv_strtod
-        add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf   \
-                                     _snprintf=avpriv_snprintf  \
-                                     vsnprintf=avpriv_vsnprintf
-        ;;
-esac
-
-# hacks for compiler/libc/os combinations
-
-if enabled_all tms470 libc_glibc; then
-    CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
-    add_cppflags -D__USER_LABEL_PREFIX__=
-    add_cppflags -D__builtin_memset=memset
-    add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
-    add_cflags   -pds=48    # incompatible redefinition of macro
-fi
-
-if enabled_all ccc libc_glibc; then
-    add_ldflags -Wl,-z,now  # calls to libots crash without this
-fi
-
-esc(){
-    echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
-}
-
-echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" >config.fate
-
-check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
-
-set_default $PATHS_LIST
-set_default nm
-
-# 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
-
-die_license_disabled() {
-    enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
-}
-
-die_license_disabled gpl libcdio
-die_license_disabled gpl libx264
-die_license_disabled gpl libxavs
-die_license_disabled gpl libxvid
-die_license_disabled gpl x11grab
-
-die_license_disabled nonfree libfaac
-die_license_disabled nonfree libfdk_aac
-die_license_disabled nonfree openssl
-
-die_license_disabled version3 libopencore_amrnb
-die_license_disabled version3 libopencore_amrwb
-die_license_disabled version3 libvo_aacenc
-die_license_disabled version3 libvo_amrwbenc
-
-enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
-
-disabled optimizations || check_cflags -fomit-frame-pointer
-
-enable_weak_pic() {
-    disabled pic && return
-    enable pic
-    add_cppflags -DPIC
-    case "$target_os" in
-    mingw*|cygwin*)
-        ;;
-    *)
-        add_cflags -fPIC
-        ;;
-    esac
-    add_asflags  -fPIC
-}
-
-enabled pic && enable_weak_pic
-
-check_cc <<EOF || die "Symbol mangling check failed."
-int ff_extern;
-EOF
-sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
-extern_prefix=${sym%%ff_extern*}
-
-check_cc <<EOF && enable_weak 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 pragma_deprecated
-void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
-EOF
-
-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
-
-check_inline_asm inline_asm_labels '"1:\n"'
-
-if enabled aarch64; then
-    # internal assembler in clang 3.3 does not support this instruction
-    enabled neon && check_insn neon 'ext   v0.8B, v0.8B, v1.8B, #1'
-    enabled vfp  && check_insn vfp  'fmadd d0,    d0,    d1,    d2'
-
-    map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
-
-elif enabled alpha; then
-
-    check_cflags -mieee
-
-elif enabled arm; then
-
-    check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
-    enabled thumb && check_cflags -mthumb || check_cflags -marm
-    nogas=die
-
-    if     check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
-        enable vfp_args
-    elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
-        case "${cross_prefix:-$cc}" in
-            *hardfloat*)         enable vfp_args;   fpabi=vfp ;;
-            *) check_ld <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
-__asm__ (".eabi_attribute 28, 1");
-int main(void) { return 0; }
-EOF
-        esac
-        warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
-    fi
-
-    enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
-    enabled armv6   && check_insn armv6   'sadd16 r0, r0, r0'
-    enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
-    enabled neon    && check_insn neon    'vadd.i16 q0, q0, q0'
-    enabled vfp     && check_insn vfp     'fadds s0, s0, s0'
-    enabled vfpv3   && check_insn vfpv3   'vmov.f32 s0, #1.0'
-
-    [ $target_os = linux ] ||
-        map 'enabled_any ${v}_external ${v}_inline || disable $v' \
-            $ARCH_EXT_LIST_ARM
-
-    check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
-    check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
-
-    [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
-
-elif enabled mips; then
-
-    check_inline_asm loongson '"dmult.g $1, $2, $3"'
-
-elif enabled parisc; then
-
-    if enabled gcc; then
-        case $($cc -dumpversion) in
-            4.[3-8].*) check_cflags -fno-optimize-sibling-calls ;;
-        esac
-    fi
-
-elif enabled ppc; then
-
-    enable local_aligned_8 local_aligned_16
-
-    check_inline_asm dcbzl     '"dcbzl 0, %0" :: "r"(0)'
-    check_inline_asm ibm_asm   '"add 0, 0, 0"'
-    check_inline_asm ppc4xx    '"maclhw r10, r11, r12"'
-    check_inline_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
-        nogas=warn
-        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 = (vector signed int) { 0 };
-    vector signed int v2 = (vector signed int) { 1 };
-    v1 = vec_add(v1, v2);
-    return 0;
-}
-EOF
-
-        enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
-    fi
-
-elif enabled sparc; then
-
-    enabled vis && check_inline_asm vis '"pdist %f0, %f0, %f0"'
-
-elif enabled x86; then
-
-    check_builtin rdtsc    intrin.h   "__rdtsc()"
-    check_builtin mm_empty mmintrin.h "_mm_empty()"
-
-    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_inline_asm ebx_available '""::"b"(0)' &&
-        check_inline_asm ebx_available '"":::"%ebx"'
-
-    # check whether xmm clobbers are supported
-    check_inline_asm xmm_clobbers '"":::"%xmm0"'
-
-    # check whether binutils is new enough to compile SSSE3/MMXEXT
-    enabled ssse3  && check_inline_asm ssse3_inline  '"pabsw %xmm0, %xmm0"'
-    enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
-
-    if ! disabled_any asm mmx yasm; then
-        if check_cmd $yasmexe --version; then
-            enabled x86_64 && yasm_extra="-m amd64"
-            yasm_debug="-g dwarf2"
-        elif check_cmd nasm -v; then
-            yasmexe=nasm
-            yasm_debug="-g -F dwarf"
-            enabled x86_64 && test "$objformat" = elf && objformat=elf64
-        fi
-
-        YASMFLAGS="-f $objformat $yasm_extra"
-        enabled pic               && append YASMFLAGS "-DPIC"
-        test -n "$extern_prefix"  && append YASMFLAGS "-DPREFIX"
-        case "$objformat" in
-            elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
-        esac
-
-        check_yasm "movbe ecx, [5]" && enable yasm ||
-            die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
-        check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
-        check_yasm "CPU amdnop" && enable cpunop
-    fi
-
-    case "$cpu" in
-        athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
-            disable fast_clz
-        ;;
-    esac
-
-fi
-
-if enabled asm; then
-    as=${gas:=$as}
-    check_as <<EOF && enable gnu_as || \
-        $nogas "GNU assembler not found, install gas-preprocessor"
-.macro m n
-\n: .int 0
-.endm
-m x
-EOF
-fi
-
-check_ldflags -Wl,--as-needed
-
-if check_func dlopen; then
-    ldl=
-elif check_func dlopen -ldl; then
-    ldl=-ldl
-fi
-
-if ! disabled network; then
-    check_type "sys/types.h sys/socket.h" socklen_t
-    check_type netdb.h "struct addrinfo"
-    check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
-    check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
-    check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
-    check_type netinet/in.h "struct sockaddr_in6"
-    check_type poll.h "struct pollfd"
-    check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
-    check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
-    check_type netinet/sctp.h "struct sctp_event_subscribe"
-    check_func getaddrinfo $network_extralibs
-    check_func getservbyport $network_extralibs
-    # 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"; } || disable winsock2_h network
-        check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
-        check_type ws2tcpip.h socklen_t
-        check_type ws2tcpip.h "struct addrinfo"
-        check_type ws2tcpip.h "struct group_source_req"
-        check_type ws2tcpip.h "struct ip_mreq_source"
-        check_type ws2tcpip.h "struct ipv6_mreq"
-        check_type winsock2.h "struct pollfd"
-        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
-
-# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
-check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
-
-check_func  fcntl
-check_func  fork
-check_func_headers stdlib.h getenv
-check_func  gethrtime
-check_func  getopt
-check_func  getrusage
-check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
-check_func  gettimeofday
-check_func  inet_aton $network_extralibs
-check_func  isatty
-check_func  localtime_r
-check_func  ${malloc_prefix}memalign            && enable memalign
-check_func  mkstemp
-check_func  mmap
-check_func  mprotect
-check_func  ${malloc_prefix}posix_memalign      && enable posix_memalign
-check_func_headers malloc.h _aligned_malloc     && enable aligned_malloc
-check_func  setrlimit
-check_func  strerror_r
-check_func  strptime
-check_func  sched_getaffinity
-check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
-check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
-check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
-check_builtin MemoryBarrier windows.h "MemoryBarrier()"
-check_func  sysconf
-check_func  sysctl
-check_func  usleep
-check_func_headers io.h setmode
-check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
-check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
-check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
-check_func_headers windows.h GetProcessAffinityMask
-check_func_headers windows.h GetProcessTimes
-check_func_headers windows.h GetSystemTimeAsFileTime
-check_func_headers windows.h MapViewOfFile
-check_func_headers windows.h SetConsoleTextAttribute
-check_func_headers windows.h Sleep
-check_func_headers windows.h VirtualAlloc
-
-check_header direct.h
-check_header dlfcn.h
-check_header dxva.h
-check_header dxva2api.h
-check_header io.h
-check_header malloc.h
-check_header poll.h
-check_header sys/mman.h
-check_header sys/param.h
-check_header sys/resource.h
-check_header sys/select.h
-check_header sys/time.h
-check_header sys/un.h
-check_header unistd.h
-check_header vdpau/vdpau.h
-check_header vdpau/vdpau_x11.h
-check_header VideoDecodeAcceleration/VDADecoder.h
-check_header windows.h
-check_header X11/extensions/XvMClib.h
-
-if ! disabled w32threads && ! enabled pthreads; then
-    check_func_headers "windows.h process.h" _beginthreadex &&
-        enable w32threads || disable w32threads
-fi
-
-# check for some common methods of building with pthread support
-# do this before the optional library checks as some of them require pthreads
-if ! disabled pthreads && ! enabled w32threads; then
-    enable pthreads
-    if check_func pthread_join -pthread; then
-        add_cflags -pthread
-        add_extralibs -pthread
-    elif check_func pthread_join -pthreads; then
-        add_cflags -pthreads
-        add_extralibs -pthreads
-    elif check_func pthread_join -lpthreadGC2; then
-        add_extralibs -lpthreadGC2
-    elif check_lib pthread.h pthread_join -lpthread; then
-        :
-    elif ! check_func pthread_join; then
-        disable pthreads
-    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
-
-disabled  zlib || check_lib   zlib.h      zlibVersion -lz   || disable  zlib
-disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
-
-check_lib math.h sin -lm && LIBM="-lm"
-enabled vaapi && require vaapi va/va.h vaInitialize -lva
-
-atan2f_args=2
-ldexpf_args=2
-powf_args=2
-
-for func in $MATH_FUNCS; do
-    eval check_mathfunc $func \${${func}_args:-1}
-done
-
-# these are off by default, so fail if requested and not available
-enabled avisynth          && { { check_header "avisynth/avisynth_c.h" && check_lib2 "windows.h" LoadLibrary; } ||
-                               { check_header "avxsynth/avxsynth_c.h" && check_lib2 "dlfcn.h" dlopen -ldl; } ||
-                               die "ERROR: LoadLibrary/dlopen not found, or avisynth header not found"; }
-enabled frei0r            && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
-enabled gnutls            && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
-enabled libfaac           && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
-enabled libfdk_aac        && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
-enabled libfreetype       && require_pkg_config freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
-enabled libgsm            && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
-                                   check_lib "${gsm_hdr}" gsm_create -lgsm && break;
-                               done || die "ERROR: libgsm not found"; }
-enabled libilbc           && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
-enabled libmp3lame        && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
-enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
-enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
-enabled libopencv         && require_pkg_config opencv opencv/cv.h cvCreateImageHeader
-enabled libopenjpeg       && { { check_header openjpeg.h && check_lib2 openjpeg.h opj_version -lopenjpeg; } ||
-                               { require_pkg_config libopenjpeg1 openjpeg.h opj_version; } }
-enabled libopus           && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
-enabled libpulse          && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
-enabled librtmp           && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
-enabled libschroedinger   && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
-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 libvo_aacenc      && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
-enabled libvo_amrwbenc    && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
-enabled libvorbis         && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
-enabled libvpx            && {
-    enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
-                                    die "ERROR: libvpx decoder version must be >=0.9.1"; }
-    enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_CQ" -lvpx ||
-                                    die "ERROR: libvpx encoder version must be >=0.9.6"; }
-    enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
-    enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx" -lvpx || disable libvpx_vp9_encoder; } }
-enabled libwavpack        && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput  -lwavpack
-enabled libwebp           && require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion
-enabled libx264           && require libx264 x264.h x264_encoder_encode -lx264 &&
-                             { check_cpp_condition x264.h "X264_BUILD >= 118" ||
-                               die "ERROR: libx264 version must be >= 0.118."; }
-enabled libxavs           && require libxavs xavs.h xavs_encoder_encode -lxavs
-enabled libxvid           && require libxvid xvid.h xvid_global -lxvidcore
-enabled openssl           && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
-                               check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
-                               check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
-                               die "ERROR: openssl not found"; }
-
-if enabled gnutls; then
-    { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
-    { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
-fi
-
-# 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
-
-if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
-    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
-    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
-    enable sdl
-fi
-
-pod2man --help     > /dev/null 2>&1 && enable pod2man   || disable pod2man
-texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
-
-check_header linux/fb.h
-check_header linux/videodev2.h
-check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
-
-check_header sys/videoio.h
-
-check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
-# check that WM_CAP_DRIVER_CONNECT is defined to the proper value
-# w32api 3.12 had it defined wrong
-check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
-
-# 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 sndio.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 &&
-    check_func jack_port_get_latency_range -ljack
-
-enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
-
-if enabled libcdio; then
-    check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
-    check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio
-fi
-
-check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib
-
-enabled x11grab                                           &&
-require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
-require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes &&
-{ enabled xlib || die "ERROR: Xlib not found"; }
-
-enabled vdpau &&
-    check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
-    disable vdpau
-
-enabled vdpau && enabled xlib &&
-    check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
-    prepend avconv_libs $($ldflags_filter "-lvdpau") &&
-    enable vdpau_x11
-
-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 -Wdisabled-optimization
-check_cflags -Wpointer-arith
-check_cflags -Wredundant-decls
-check_cflags -Wcast-qual
-check_cflags -Wwrite-strings
-check_cflags -Wtype-limits
-check_cflags -Wundef
-check_cflags -Wmissing-prototypes
-check_cflags -Wstrict-prototypes
-enabled extra_warnings && check_cflags -Winline
-
-check_disable_warning(){
-    warning_flag=-W${1#-Wno-}
-    test_cflags $warning_flag && add_cflags $1
-}
-
-check_disable_warning -Wno-parentheses
-check_disable_warning -Wno-switch
-check_disable_warning -Wno-format-zero-length
-check_disable_warning -Wno-pointer-sign
-
-# add some linker flags
-check_ldflags -Wl,--warn-common
-check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
-test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
-
-# add some strip flags
-# -wN '..@*' is more selective than -x, but not available everywhere.
-check_stripflags -wN \'..@*\' || check_stripflags -x || strip='true'
-
-enabled neon_clobber_test &&
-    check_ldflags -Wl,--wrap,avcodec_open2              \
-                  -Wl,--wrap,avcodec_decode_audio4      \
-                  -Wl,--wrap,avcodec_decode_video2      \
-                  -Wl,--wrap,avcodec_decode_subtitle2   \
-                  -Wl,--wrap,avcodec_encode_audio2      \
-                  -Wl,--wrap,avcodec_encode_video2      \
-                  -Wl,--wrap,avcodec_encode_subtitle    \
-                  -Wl,--wrap,avresample_convert ||
-    disable neon_clobber_test
-
-enabled xmm_clobber_test &&
-    check_ldflags -Wl,--wrap,avcodec_open2              \
-                  -Wl,--wrap,avcodec_decode_audio4      \
-                  -Wl,--wrap,avcodec_decode_video2      \
-                  -Wl,--wrap,avcodec_decode_subtitle2   \
-                  -Wl,--wrap,avcodec_encode_audio2      \
-                  -Wl,--wrap,avcodec_encode_video2      \
-                  -Wl,--wrap,avcodec_encode_subtitle    \
-                  -Wl,--wrap,avresample_convert         \
-                  -Wl,--wrap,sws_scale ||
-    disable xmm_clobber_test
-
-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 [ -z "$optflags" ]; then
-    if enabled small; then
-        optflags=$cflags_size
-    elif enabled optimizations; then
-        optflags=$cflags_speed
-    else
-        optflags=$cflags_noopt
-    fi
-fi
-
-check_optflags(){
-    check_cflags "$@"
-    enabled lto && check_ldflags "$@"
-}
-
-
-if enabled lto; then
-    test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
-    check_cflags  -flto
-    check_ldflags -flto $cpuflags
-fi
-
-check_optflags $optflags
-check_optflags -fno-math-errno
-check_optflags -fno-signed-zeros
-
-if enabled icc; then
-    # Just warnings, no remarks
-    check_cflags -w1
-    # -wd: Disable following warnings
-    # 144, 167, 556: -Wno-pointer-sign
-    # 1292: attribute "foo" ignored
-    # 1419: external declaration in primary source file
-    # 10006: ignoring unknown option -fno-signed-zeros
-    # 10148: ignoring unknown option -Wno-parentheses
-    # 10156: ignoring option '-W'; no argument required
-    check_cflags -wd144,167,556,1292,1419,10006,10148,10156
-    # 11030: Warning unknown option --as-needed
-    # 10156: ignoring option '-export'; no argument required
-    check_ldflags -wd10156,11030
-    # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
-    enable ebp_available
-    if enabled x86_32; then
-        icc_version=$($cc -dumpversion)
-        test ${icc_version%%.*} -ge 11 &&
-            check_cflags -falign-stack=maintain-16-byte ||
-            disable aligned_stack
-    fi
-elif enabled ccc; then
-    # disable some annoying warnings
-    add_cflags -msg_disable bitnotint
-    add_cflags -msg_disable mixfuncvoid
-    add_cflags -msg_disable nonstandcast
-    add_cflags -msg_disable unsupieee
-elif enabled gcc; then
-    check_optflags -fno-tree-vectorize
-    check_cflags -Werror=implicit-function-declaration
-    check_cflags -Werror=missing-prototypes
-    check_cflags -Werror=return-type
-    check_cflags -Werror=declaration-after-statement
-    check_cflags -Werror=vla
-    enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
-elif enabled llvm_gcc; then
-    check_cflags -mllvm -stack-alignment=16
-elif enabled clang; then
-    check_cflags -mllvm -stack-alignment=16
-    check_cflags -Qunused-arguments
-    check_cflags -Werror=implicit-function-declaration
-    check_cflags -Werror=missing-prototypes
-    check_cflags -Werror=return-type
-elif enabled cparser; then
-    add_cflags -Wno-missing-variable-declarations
-    add_cflags -Wno-empty-statement
-elif enabled armcc; then
-    # 2523: use of inline assembler is deprecated
-    add_cflags -W${armcc_opt},--diag_suppress=2523
-    add_cflags -W${armcc_opt},--diag_suppress=1207
-    add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
-    add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
-    add_cflags -W${armcc_opt},--diag_suppress=167  # pointer sign
-    add_cflags -W${armcc_opt},--diag_suppress=513  # pointer sign
-elif enabled tms470; then
-    add_cflags -pds=824 -pds=837
-    disable inline_asm
-elif enabled pathscale; then
-    add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
-elif enabled_any msvc icl; then
-    enabled x86_32 && disable aligned_stack
-    enabled_all x86_32 debug && add_cflags -Oy-
-    enabled debug && add_ldflags -debug
-    enable pragma_deprecated
-    if enabled icl; then
-        # -Qansi-alias is basically -fstrict-aliasing, but does not work
-        # (correctly) on icl 13.x.
-        check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
-            add_cflags -Qansi-alias
-        # icl will pass the inline asm tests but inline asm is currently
-        # not supported (build will fail)
-        disable inline_asm
-    fi
-fi
-
-case $as_type in
-    clang)
-        add_asflags -Qunused-arguments
-    ;;
-esac
-
-case $ld_type in
-    clang)
-        check_ldflags -Qunused-arguments
-    ;;
-esac
-
-case $target_os in
-    osf1)
-        enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
-    ;;
-    plan9)
-        add_cppflags -Dmain=plan9_main
-    ;;
-esac
-
-enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
-
-check_deps $CONFIG_LIST       \
-           $CONFIG_EXTRA      \
-           $HAVE_LIST         \
-           $ALL_COMPONENTS    \
-
-! enabled_any memalign posix_memalign aligned_malloc &&
-    enabled_any $need_memalign && enable memalign_hack
-
-echo "install prefix            $prefix"
-echo "source path               $source_path"
-echo "C compiler                $cc"
-echo "C library                 $libc_type"
-if test "$host_cc" != "$cc"; then
-    echo "host C compiler           $host_cc"
-    echo "host C library            $host_libc_type"
-fi
-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 "${yasmexe}                      ${yasm-no}"
-    echo "MMX enabled               ${mmx-no}"
-    echo "MMXEXT enabled            ${mmxext-no}"
-    echo "3DNow! enabled            ${amd3dnow-no}"
-    echo "3DNow! extended enabled   ${amd3dnowext-no}"
-    echo "SSE enabled               ${sse-no}"
-    echo "SSSE3 enabled             ${ssse3-no}"
-    echo "AVX enabled               ${avx-no}"
-    echo "FMA4 enabled              ${fma4-no}"
-    echo "i686 features enabled     ${i686-no}"
-    echo "CMOV is fast              ${fast_cmov-no}"
-    echo "EBX available             ${ebx_available-no}"
-    echo "EBP available             ${ebp_available-no}"
-fi
-if enabled aarch64; then
-    echo "NEON enabled              ${neon-no}"
-    echo "VFP enabled               ${vfp-no}"
-fi
-if enabled arm; then
-    echo "ARMv5TE enabled           ${armv5te-no}"
-    echo "ARMv6 enabled             ${armv6-no}"
-    echo "ARMv6T2 enabled           ${armv6t2-no}"
-    echo "VFP enabled               ${vfp-no}"
-    echo "NEON enabled              ${neon-no}"
-fi
-if enabled ppc; then
-    echo "AltiVec enabled           ${altivec-no}"
-    echo "PPC 4xx optimizations     ${ppc4xx-no}"
-    echo "dcbzl available           ${dcbzl-no}"
-fi
-if enabled sparc; then
-    echo "VIS enabled               ${vis-no}"
-fi
-echo "debug symbols             ${debug-no}"
-echo "optimize for size         ${small-no}"
-echo "optimizations             ${optimizations-no}"
-echo "static                    ${static-no}"
-echo "shared                    ${shared-no}"
-echo "new filter support        ${avfilter-no}"
-echo "network support           ${network-no}"
-echo "threading support         ${thread_type-no}"
-echo "safe bitstream reader     ${safe_bitstream_reader-no}"
-echo "SDL support               ${sdl-no}"
-test -n "$random_seed" &&
-    echo "random seed               ${random_seed}"
-echo
-
-echo "External libraries:"
-print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
-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
-    print_enabled '_*' $list | print_3_columns
-    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..."
-
-test -e Makefile || echo "include $source_path/Makefile" > Makefile
-
-config_files="$TMPH config.mak"
-
-cat > config.mak <<EOF
-# Automatically generated by configure - do not modify!
-LIBAV_CONFIGURATION=$LIBAV_CONFIGURATION
-prefix=$prefix
-LIBDIR=\$(DESTDIR)$libdir
-SHLIBDIR=\$(DESTDIR)$shlibdir
-INCDIR=\$(DESTDIR)$incdir
-BINDIR=\$(DESTDIR)$bindir
-DATADIR=\$(DESTDIR)$datadir
-DOCDIR=\$(DESTDIR)$docdir
-MANDIR=\$(DESTDIR)$mandir
-SRC_PATH=$source_path
-CC_IDENT=$cc_ident
-ARCH=$arch
-CC=$cc
-AS=$as
-LD=$ld
-DEPCC=$dep_cc
-DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
-DEPAS=$as
-DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
-YASM=$yasmexe
-DEPYASM=$yasmexe
-AR=$ar
-ARFLAGS=$arflags
-AR_O=$ar_o
-RANLIB=$ranlib
-STRIP=$strip
-LN_S=$ln_s
-CPPFLAGS=$CPPFLAGS
-CFLAGS=$CFLAGS
-ASFLAGS=$ASFLAGS
-AS_C=$AS_C
-AS_O=$AS_O
-CC_C=$CC_C
-CC_E=$CC_E
-CC_O=$CC_O
-LD_O=$LD_O
-LD_LIB=$LD_LIB
-LD_PATH=$LD_PATH
-DLLTOOL=$dlltool
-LDFLAGS=$LDFLAGS
-SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
-STRIPFLAGS=$STRIPFLAGS
-YASMFLAGS=$YASMFLAGS
-BUILDSUF=$build_suffix
-FULLNAME=$FULLNAME
-LIBPREF=$LIBPREF
-LIBSUF=$LIBSUF
-LIBNAME=$LIBNAME
-SLIBPREF=$SLIBPREF
-SLIBSUF=$SLIBSUF
-EXESUF=$EXESUF
-EXTRA_VERSION=$extra_version
-CCDEP=$CCDEP
-CCDEP_FLAGS=$CCDEP_FLAGS
-ASDEP=$ASDEP
-ASDEP_FLAGS=$ASDEP_FLAGS
-CC_DEPFLAGS=$CC_DEPFLAGS
-AS_DEPFLAGS=$AS_DEPFLAGS
-HOSTCC=$host_cc
-HOSTLD=$host_ld
-HOSTCFLAGS=$host_cflags
-HOSTCPPFLAGS=$host_cppflags
-HOSTEXESUF=$HOSTEXESUF
-HOSTLDFLAGS=$host_ldflags
-HOSTLIBS=$host_libs
-DEPHOSTCC=$host_cc
-DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
-HOSTCCDEP=$HOSTCCDEP
-HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
-HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
-HOSTCC_C=$HOSTCC_C
-HOSTCC_O=$HOSTCC_O
-HOSTLD_O=$HOSTLD_O
-TARGET_EXEC=$target_exec $target_exec_args
-TARGET_PATH=$target_path
-TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
-CFLAGS-avplay=$sdl_cflags
-ZLIB=$($ldflags_filter -lz)
-LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
-EXTRALIBS=$extralibs
-COMPAT_OBJS=$compat_objs
-EXEOBJS=$exeobjs
-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_NAME=${SLIB_INSTALL_NAME}
-SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
-SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
-SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
-SAMPLES:=${samples:-\$(LIBAV_SAMPLES)}
-EOF
-
-get_version(){
-    lcname=lib${1}
-    name=$(toupper $lcname)
-    file=$source_path/$lcname/version.h
-    eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
-    eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
-    eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
-    eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
-    eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
-}
-
-map 'get_version $v' $LIBRARY_LIST
-
-print_program_libs(){
-    eval "program_libs=\$${1}_libs"
-    eval echo "LIBS-${1}=${program_libs}" >> config.mak
-}
-
-map 'print_program_libs $v' $PROGRAM_LIST
-
-cat > $TMPH <<EOF
-/* Automatically generated by configure - do not modify! */
-#ifndef LIBAV_CONFIG_H
-#define LIBAV_CONFIG_H
-#define LIBAV_CONFIGURATION "$(c_escape $LIBAV_CONFIGURATION)"
-#define LIBAV_LICENSE "$(c_escape $license)"
-#define AVCONV_DATADIR "$(eval c_escape $datadir)"
-#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
-#define restrict $_restrict
-#define EXTERN_PREFIX "${extern_prefix}"
-#define EXTERN_ASM ${extern_prefix}
-#define SLIBSUF "$SLIBSUF"
-EOF
-
-test -n "$malloc_prefix" &&
-    echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
-
-if enabled yasm; then
-    append config_files $TMPASM
-    printf '' >$TMPASM
-fi
-
-enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
-
-print_config ARCH_   "$config_files" $ARCH_LIST
-print_config HAVE_   "$config_files" $HAVE_LIST
-print_config CONFIG_ "$config_files" $CONFIG_LIST       \
-                                     $CONFIG_EXTRA      \
-                                     $ALL_COMPONENTS    \
-
-echo "#endif /* LIBAV_CONFIG_H */" >> $TMPH
-
-# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
-cp_if_changed $TMPH config.h
-touch .config
-
-enabled yasm && cp_if_changed $TMPASM config.asm
-
-cat > $TMPH <<EOF
-/* Generated by ffconf */
-#ifndef AVUTIL_AVCONFIG_H
-#define AVUTIL_AVCONFIG_H
-EOF
-
-print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
-
-echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
-
-cp_if_changed $TMPH libavutil/avconfig.h
-
-test -n "$WARNINGS" && printf "\n$WARNINGS"
-
-# build pkg-config files
-
-pkgconfig_generate(){
-    name=$1
-    shortname=${name#lib}${build_suffix}
-    comment=$2
-    version=$3
-    libs=$4
-    requires=$5
-    enabled ${name#lib} || return 0
-    mkdir -p $name
-    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
-}
-
-lavfi_libs="libavutil = $LIBAVUTIL_VERSION"
-enabled movie_filter    && prepend lavfi_libs "libavformat >= $LIBAVFORMAT_VERSION, libavcodec >= $LIBAVCODEC_VERSION,"
-enabled resample_filter && prepend lavfi_libs "libavresample >= $LIBAVRESAMPLE_VERSION,"
-enabled scale_filter    && prepend lavfi_libs "libswscale >= $LIBSWSCALE_VERSION,"
-
-pkgconfig_generate libavutil     "Libav utility library"          "$LIBAVUTIL_VERSION"     "$LIBM"
-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"
-pkgconfig_generate libavfilter   "Libav video filtering library"  "$LIBAVFILTER_VERSION"   "$extralibs" "$lavfi_libs"
-pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswscale    "Libav image rescaling library"  "$LIBSWSCALE_VERSION"    "$LIBM"      "libavutil = $LIBAVUTIL_VERSION"
diff --git a/deps/libav/doc/APIchanges b/deps/libav/doc/APIchanges
deleted file mode 100644
index 277bac6..0000000
--- a/deps/libav/doc/APIchanges
+++ /dev/null
@@ -1,1426 +0,0 @@
-Never assume the API of libav* to be stable unless at least 1 month has passed
-since the last major version increase.
-
-The last version increases were:
-libavcodec:    2013-03-xx
-libavdevice:   2013-03-xx
-libavfilter:   2013-12-xx
-libavformat:   2013-03-xx
-libavresample: 2012-10-05
-libswscale:    2011-06-20
-libavutil:     2013-12-xx
-
-
-API changes, most recent first:
-
-2014-02-xx - xxxxxxx - lavu 53.3.0 - frame.h
-  Add AV_FRAME_DATA_DOWNMIX_INFO value to the AVFrameSideDataType enum and
-  downmix_info.h API, which identify downmix-related metadata.
-
-2014-02-04 - d9ae103 - lavf 55.11.0 - avformat.h
-  Add AVFormatContext.max_interleave_delta for controlling amount of buffering
-  when interleaving.
-
-2014-01-20 - 93c553c - lavc 55.32.1 - avcodec.h
-  Edges are not required anymore on video buffers allocated by get_buffer2()
-  (i.e. as if the CODEC_FLAG_EMU_EDGE flag was always on). Deprecate
-  CODEC_FLAG_EMU_EDGE and avcodec_get_edge_width().
-
-2014-01-05 - 5b4797a - lavu 53.2.0 - frame.h
-  Add AV_FRAME_DATA_MATRIXENCODING value to the AVFrameSideDataType enum, which
-  identifies AVMatrixEncoding data.
-
-2014-01-05 - 5c437fb - lavu 53.1.0 - channel_layout.h
-  Add values for various Dolby flags to the AVMatrixEncoding enum.
-
-2013-12-20 - 2a41826 - lavc 55.30.0 - avcodec.h
-  Add HEVC profiles
-
-2013-12-11 - b9fb59d,9431356,d7b3ee9 - lavc 55.28.1 - avcodec.h
-  av_frame_alloc(), av_frame_unref() and av_frame_free() now can and should be
-  used instead of avcodec_alloc_frame(), avcodec_get_frame_defaults() and
-  avcodec_free_frame() respectively. The latter three functions are deprecated.
-
-2013-12-09 - 7e244c6- - lavu 52.20.0 - frame.h
-  Add AV_FRAME_DATA_STEREO3D value to the AVFrameSideDataType enum and
-  stereo3d.h API, that identify codec-independent stereo3d information.
-
-2013-11-26 - 1eaac1d- - lavu 52.19.0 - frame.h
-  Add AV_FRAME_DATA_A53_CC value to the AVFrameSideDataType enum, which
-  identifies ATSC A53 Part 4 Closed Captions data.
-
-2013-11-14 - cce3e0a - lavu 52.18.0 - mem.h
-  Move av_fast_malloc() and av_fast_realloc() for libavcodec to libavutil.
-
-2013-11-14 - 8941971 - lavc 55.27.0 - avcodec.h
-  Deprecate AVCodecContext.error_rate, it is replaced by the 'error_rate'
-  private option of the mpegvideo encoder family.
-
-2013-11-14 - 728c465 - lavc 55.26.0 - vdpau.h
-  Add av_vdpau_get_profile().
-  Add av_vdpau_alloc_context(). This function must from now on be
-  used for allocating AVVDPAUContext.
-
-2013-11-04 - cd8f772 - lavc 55.25.0 - avcodec.h
-  Add ITU-R BT.2020 and other not yet included values to color primaries,
-  transfer characteristics and colorspaces.
-
-2013-10-31 - 28096e0 - lavu 52.17.0 - frame.h
-  Add AVFrame.flags and AV_FRAME_FLAG_CORRUPT.
-
-2013-09-28 - 0767bfd - lavfi 3.11.0 - avfilter.h
-  Add AVFilterGraph.execute and AVFilterGraph.opaque for custom slice threading
-  implementations.
-
-2013-09-21 - e208e6d - lavu 52.16.0 - pixfmt.h
-  Add interleaved 4:2:2 8/10-bit formats AV_PIX_FMT_NV16 and
-  AV_PIX_FMT_NV20.
-
-2013-09-16 - 3feb3d6 - lavu 52.15.0 - mem.h
-  Add av_reallocp.
-
-2013-08-10 - 5a9a9d4 - lavc 55.16.0 - avcodec.h
-  Extend AVPacket API with av_packet_unref, av_packet_ref,
-  av_packet_move_ref, av_packet_copy_props, av_packet_free_side_data.
-
-2013-08-05 - f824535 - lavc 55.13.0 - avcodec.h
-  Deprecate the bitstream-related members from struct AVVDPAUContext.
-  The bistream buffers no longer need to be explicitly freed.
-
-2013-08-05 - 549294f - lavc 55.12.0 - avcodec.h
-  Deprecate the CODEC_CAP_HWACCEL_VDPAU codec capability. Use CODEC_CAP_HWACCEL
-  and select the AV_PIX_FMT_VDPAU format with get_format() instead.
-
-2013-08-05 - a0ad5d0 - lavu 52.14.0 - pixfmt.h
-  Deprecate AV_PIX_FMT_VDPAU_*. Use AV_PIX_FMT_VDPAU instead.
-
-2013-08-02 - a8b1927 - lavc 55.11.0 - avcodec.h
-  Add output_picture_number to AVCodecParserContext.
-
-2013-06-24 - 95d5246 - lavc 55.10.0 - avcodec.h
-  Add MPEG-2 AAC profiles
-
-2013-06-04 - fc962d4 - lavu 52.13.0 - mem.h
-  Add av_realloc_array and av_reallocp_array
-
-2013-05-24 - 129bb23 - lavfi 3.10.0 - avfilter.h
-  Add support for slice multithreading to lavfi. Filters supporting threading
-  are marked with AVFILTER_FLAG_SLICE_THREADS.
-  New fields AVFilterContext.thread_type, AVFilterGraph.thread_type and
-  AVFilterGraph.nb_threads (accessible directly or through AVOptions) may be
-  used to configure multithreading.
-
-2013-05-24 - 2a6eaea - lavu 52.12.0 - cpu.h
-  Add av_cpu_count() function for getting the number of logical CPUs.
-
-2013-05-24 - b493847 - lavc 55.7.0 - avcodec.h
-  Add picture_structure to AVCodecParserContext.
-
-2013-05-15 - e6c4ac7 - lavu 52.11.0 - pixdesc.h
-  Replace PIX_FMT_* flags with AV_PIX_FMT_FLAG_*.
-
-2013-04-03 - 507b1e4 - lavc 55.4.0 - avcodec.h
-  Add field_order to AVCodecParserContext.
-
-2013-04-19 - 5e83d9a - lavc 55.2.0 - avcodec.h
-  Add CODEC_FLAG_UNALIGNED to allow decoders to produce unaligned output.
-
-2013-04-11 - lavfi 3.8.0
-  38f0c07 - Move all content from avfiltergraph.h to avfilter.h. Deprecate
-            avfilterhraph.h, user applications should include just avfilter.h
-  bc1a985 - Add avfilter_graph_alloc_filter(), deprecate avfilter_open() and
-            avfilter_graph_add_filter().
-  1113672 - Add AVFilterContext.graph pointing to the AVFilterGraph that contains the
-            filter.
-  48a5ada - Add avfilter_init_str(), deprecate avfilter_init_filter().
-  1ba95a9 - Add avfilter_init_dict().
-  7cdd737 - Add AVFilter.flags field and AVFILTER_FLAG_DYNAMIC_{INPUTS,OUTPUTS} flags.
-  7e8fe4b - Add avfilter_pad_count() for counting filter inputs/outputs.
-  fa2a34c - Add avfilter_next(), deprecate av_filter_next().
-            Deprecate avfilter_uninit().
-
-2013-04-09 - lavfi 3.7.0 - avfilter.h
-  b439c99 - Add AVFilter.priv_class for exporting filter options through the
-            AVOptions API in the similar way private options work in lavc and lavf.
-  8114c10 - Add avfilter_get_class().
-  Switch all filters to use AVOptions.
-
-2013-03-19 - 2c328a9 - lavu 52.9.0 - pixdesc.h
-  Add av_pix_fmt_count_planes() function for counting planes in a pixel format.
-
-2013-03-16 - 42c7c61 - lavfi 3.6.0
-  Add AVFilterGraph.nb_filters, deprecate AVFilterGraph.filter_count.
-
-2013-03-08 - Reference counted buffers - lavu 52.8.0, lavc 55.0.0, lavf 55.0.0,
-lavd 54.0.0, lavfi 3.5.0
-  8e401db, 1cec062 - add a new API for reference counted buffers and buffer
-                     pools (new header libavutil/buffer.h).
-  1afddbe - add AVPacket.buf to allow reference counting for the AVPacket data.
-            Add av_packet_from_data() function for constructing packets from
-            av_malloc()ed data.
-  7ecc2d4 - move AVFrame from lavc to lavu (new header libavutil/frame.h), add
-            AVFrame.buf/extended_buf to allow reference counting for the AVFrame
-            data. Add new API for working with reference-counted AVFrames.
-  759001c - add the refcounted_frames field to AVCodecContext to make audio and
-            video decoders return reference-counted frames. Add get_buffer2()
-            callback to AVCodecContext which allocates reference-counted frames.
-            Add avcodec_default_get_buffer2() as the default get_buffer2()
-            implementation.
-            Deprecate AVCodecContext.get_buffer() / release_buffer() /
-            reget_buffer(), avcodec_default_get_buffer(),
-            avcodec_default_reget_buffer(), avcodec_default_release_buffer().
-            Remove avcodec_default_free_buffers(), which should not have ever
-            been called from outside of lavc.
-            Deprecate the following AVFrame fields:
-                * base -- is now stored in AVBufferRef
-                * reference, type, buffer_hints -- are unnecessary in the new API
-                * hwaccel_picture_private, owner, thread_opaque -- should not
-                  have been acessed from outside of lavc
-                * qscale_table, qstride, qscale_type, mbskip_table, motion_val,
-                  mb_type, dct_coeff, ref_index -- mpegvideo-specific tables,
-                  which are not exported anymore.
-  7e35037 - switch libavfilter to use AVFrame instead of AVFilterBufferRef. Add
-            av_buffersrc_add_frame(), deprecate av_buffersrc_buffer().
-            Add av_buffersink_get_frame() and av_buffersink_get_samples(),
-            deprecate av_buffersink_read() and av_buffersink_read_samples().
-            Deprecate AVFilterBufferRef and all functions for working with it.
-
-2013-03-17 - 12c5c1d - lavu 52.8.0 - avstring.h
-  Add av_isdigit, av_isgraph, av_isspace, av_isxdigit.
-
-2013-02-23 - 9f12235 - lavfi 3.4.0 - avfiltergraph.h
-  Add resample_lavr_opts to AVFilterGraph for setting libavresample options
-  for auto-inserted resample filters.
-
-2013-01-25 - 38c1466 - lavu 52.7.0 - dict.h
-  Add av_dict_parse_string() to set multiple key/value pairs at once from a
-  string.
-
-2013-01-25 - b85a5e8 - lavu 52.6.0 - avstring.h
-  Add av_strnstr()
-
-2013-01-15 - 8ee288d - lavu 52.5.0 - hmac.h
-  Add AVHMAC.
-
-2013-01-13 - 44e065d - lavc 54.36.0 - vdpau.h
-  Add AVVDPAUContext struct for VDPAU hardware-accelerated decoding.
-
-2013-01-12 - 169fb94 - lavu 52.4.0 - pixdesc.h
-  Add AV_PIX_FMT_VDPAU flag.
-
-2013-01-07 - 074a00d - lavr 1.1.0
-  Add avresample_set_channel_mapping() for input channel reordering,
-  duplication, and silencing.
-
-------------------------------8<-------------------------------------
-                   9 branch was cut here
------------------------------>8--------------------------------------
-
-2012-12-29 - d8fd06c - lavu 52.3.0 - avstring.h
-  Add av_basename() and av_dirname().
-
-2012-11-11 - 5980f5d - lavu 52.2.0 - audioconvert.h
-  Rename audioconvert.h to channel_layout.h. audioconvert.h is now deprecated.
-
-2012-11-05 - dfde8a3 - lavu 52.1.0 - intmath.h
-  Add av_ctz() for trailing zero bit count
-
-2012-10-21 - a893655 - lavu 51.45.0 - error.h
-  Add AVERROR_EXPERIMENTAL
-
-2012-10-12 - d2fcb35 - lavu 51.44.0 - pixdesc.h
-  Add functions for accessing pixel format descriptors.
-  Accessing the av_pix_fmt_descriptors array directly is now
-  deprecated.
-
-2012-10-11 - 9a92aea - lavu 51.43.0 - aes.h, md5.h, sha.h, tree.h
-  Add functions for allocating the opaque contexts for the algorithms,
-  deprecate the context size variables.
-
-2012-10-10 - b522000 - lavf 54.18.0 - avio.h
-  Add avio_closep to complement avio_close.
-
-2012-10-08 - 78071a1 - lavu 51.42.0 - pixfmt.h
-  Rename PixelFormat to AVPixelFormat and all PIX_FMT_* to AV_PIX_FMT_*.
-  To provide backwards compatibility, PixelFormat is now #defined as
-  AVPixelFormat.
-  Note that this can break user code that includes pixfmt.h and uses the
-  'PixelFormat' identifier. Such code should either #undef PixelFormat
-  or stop using the PixelFormat name.
-
-2012-10-05 - e7ba5b1 - lavr 1.0.0 - avresample.h
-  Data planes parameters to avresample_convert() and
-  avresample_read() are now uint8_t** instead of void**.
-  Libavresample is now stable.
-
-2012-09-24 - a42aada - lavc 54.28.0 - avcodec.h
-  Add avcodec_free_frame(). This function must now
-  be used for freeing an AVFrame.
-
-2012-09-12 - 8919fee - lavu 51.41.0 - audioconvert.h
-  Added AV_CH_LOW_FREQUENCY_2 channel mask value.
-
-2012-09-04 - 686a329 - lavu 51.40.0 - opt.h
-  Reordered the fields in default_val in AVOption, changed which
-  default_val field is used for which AVOptionType.
-
-2012-08-30 - a231832 - lavc 54.26.1 - avcodec.h
-  Add codec descriptor properties AV_CODEC_PROP_LOSSY and
-  AV_CODEC_PROP_LOSSLESS.
-
-2012-08-18 - lavc 54.26 - avcodec.h
-  Add codec descriptors for accessing codec properties without having
-  to refer to a specific decoder or encoder.
-
-  c223d79 - Add an AVCodecDescriptor struct and functions
-            avcodec_descriptor_get() and avcodec_descriptor_next().
-  51efed1 - Add AVCodecDescriptor.props and AV_CODEC_PROP_INTRA_ONLY.
-  91e59fe - Add avcodec_descriptor_get_by_name().
-
-
-2012-08-08 - 1d9c2dc - lavu 51.39 - avutil.h
-  Don't implicitly include libavutil/common.h in avutil.h
-
-2012-08-08 - 987170c - lavu 51.38 - dict.h
-  Add av_dict_count().
-
-2012-08-07 - 104e10f - lavc 54.25 - avcodec.h
-  Rename CodecID to AVCodecID and all CODEC_ID_* to AV_CODEC_ID_*.
-  To provide backwards compatibility, CodecID is now #defined as AVCodecID.
-  Note that this can break user code that includes avcodec.h and uses the
-  'CodecID' identifier. Such code should either #undef CodecID or stop using the
-  CodecID name.
-
-2012-08-03 - 239fdf1 - lavu 51.37.1 - cpu.h
-                       lsws 2.1.1   - swscale.h
-  Rename AV_CPU_FLAG_MMX2  ---> AV_CPU_FLAG_MMXEXT.
-  Rename SWS_CPU_CAPS_MMX2 ---> SWS_CPU_CAPS_MMXEXT.
-
-2012-07-29 - 681ed00 - lavf 54.13.0 - avformat.h
-  Add AVFMT_FLAG_NOBUFFER for low latency use cases.
-
-2012-07-20 - b70d89a - lavfi 3.0.0 - avfilter.h
-  Add avfilter_unref_bufferp().
-
-2012-07-10 - 5fade8a - lavu 51.37.0
-  Add av_malloc_array() and av_mallocz_array()
-
-2012-06-22 - d3d3a32 - lavu 51.34.0
-  Add av_usleep()
-
-2012-06-20 - ae0a301 - lavu 51.33.0
-  Move av_gettime() to libavutil, add libavutil/time.h
-
-2012-06-09 - 3971be0 - lavr 0.0.3
-  Add a parameter to avresample_build_matrix() for Dolby/DPLII downmixing.
-
-2012-06-12 - 9baeff9 - lavfi 2.23.0 - avfilter.h
-  Add AVFilterContext.nb_inputs/outputs. Deprecate
-  AVFilterContext.input/output_count.
-
-2012-06-12 - 84b9fbe - lavfi 2.22.0 - avfilter.h
-  Add avfilter_pad_get_type() and avfilter_pad_get_name(). Those
-  should now be used instead of accessing AVFilterPad members
-  directly.
-
-2012-06-12 - b0f0dfc - lavu 51.32.0 - audioconvert.h
-  Add av_get_channel_layout_channel_index(), av_get_channel_name()
-  and av_channel_layout_extract_channel().
-
-2012-05-25 - 154486f - lavu 51.31.0 - opt.h
-  Add av_opt_set_bin()
-
-2012-05-26 - e9cef89 - lavf 54.3.0
-  Add AVFMT_TS_NONSTRICT format flag to indicate that a muxer supports
-  non-increasing monotone timestamps.
-
-2012-05-15 - lavfi 2.17.0
-  Add support for audio filters
-  ac71230/a2cd9be - add video/audio buffer sink in a new installed
-                    header buffersink.h
-  720c6b7 - add av_buffersrc_write_frame(), deprecate
-            av_vsrc_buffer_add_frame()
-  ab16504 - add avfilter_copy_buf_props()
-  9453c9e - add extended_data to AVFilterBuffer
-  1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
-
-2012-05-09 - lavu 51.30.0 - samplefmt.h
-  142e740 - add av_samples_copy()
-  6d7f617 - add av_samples_set_silence()
-
-2012-05-09 - a5117a2 - lavc 54.13.1
-  For audio formats with fixed frame size, the last frame
-  no longer needs to be padded with silence, libavcodec
-  will handle this internally (effectively all encoders
-  behave as if they had CODEC_CAP_SMALL_LAST_FRAME set).
-
-2012-05-07 - 828bd08 - lavc 54.13.0 - avcodec.h
-  Add sample_rate and channel_layout fields to AVFrame.
-
-2012-05-01 - 4010d72 - lavr 0.0.1
-  Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8.
-
-2012-04-25 - 3527a73 - lavu 51.29.0 - cpu.h
-  Add av_parse_cpu_flags()
-
-2012-04-24 - c8af852 - lavr 0.0.0
-  Add libavresample audio conversion library
-
-2012-04-20 - 0c0d1bc - lavu 51.28.0 - audio_fifo.h
-  Add audio FIFO functions:
-    av_audio_fifo_free()
-    av_audio_fifo_alloc()
-    av_audio_fifo_realloc()
-    av_audio_fifo_write()
-    av_audio_fifo_read()
-    av_audio_fifo_drain()
-    av_audio_fifo_reset()
-    av_audio_fifo_size()
-    av_audio_fifo_space()
-
-2012-04-14 - lavfi 2.16.0 - avfiltergraph.h
-  d7bcc71 Add avfilter_graph_parse2().
-  91d3cbe Add avfilter_inout_alloc() and avfilter_inout_free().
-
-2012-04-08 - 4d693b0 - lavu 51.27.0 - samplefmt.h
-  Add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
-
-2012-04-05 - 5cc51a5 - lavu 51.26.0 - audioconvert.h
-  Add av_get_default_channel_layout()
-
-2012-03-20 - 3c90cc2 - lavfo 54.2.0
-  Deprecate av_read_packet(), use av_read_frame() with
-  AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN in AVFormatContext.flags
-
-2012-03-06 - 4d851f8 - lavu 51.25.0 - cpu.h
-  Add av_set_cpu_flags_mask().
-
-2012-03-05 - lavc 54.8.0
-  6699d07 Add av_get_exact_bits_per_sample()
-  9524cf7 Add av_get_audio_frame_duration()
-
-2012-03-04 - 44fe77b - lavc 54.7.0 - avcodec.h
-  Add av_codec_is_encoder/decoder().
-
-2012-03-01 - 442c132 - lavc 54.3.0 - avcodec.h
-  Add av_packet_shrink_side_data.
-
-2012-02-29 - dd2a4bc - lavf 54.2.0 - avformat.h
-  Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
-  used for dealing with attached pictures/cover art.
-
-2012-02-25 - c9bca80 - lavu 51.24.0 - error.h
-  Add AVERROR_UNKNOWN
-  NOTE: this was backported to 0.8
-
-2012-02-20 - e9cda85 - lavc 54.2.0
-  Add duration field to AVCodecParserContext
-
-2012-02-20 - 0b42a93 - lavu 51.23.1 - mathematics.h
-  Add av_rescale_q_rnd()
-
-2012-02-08 - 38d5533 - lavu 51.22.1 - pixdesc.h
-  Add PIX_FMT_PSEUDOPAL flag.
-
-2012-02-08 - 52f82a1 - lavc 54.01.0
-  Add avcodec_encode_video2() and deprecate avcodec_encode_video().
-
-2012-02-01 - 316fc74 - lavc 54.01.0
-  Add av_fast_padded_malloc() as alternative for av_realloc() when aligned
-  memory is required. The buffer will always have FF_INPUT_BUFFER_PADDING_SIZE
-  zero-padded bytes at the end.
-
-2012-01-31 - dd6d3b0 - lavf 54.01.0
-  Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
-  NOTE: this was backported to 0.8
-
-2012-01-31 - af08d9a - lavc 54.01.0
-  Add avcodec_is_open() function.
-  NOTE: this was backported to 0.8
-
-2012-01-30 - 8b93312 - lavu 51.22.0 - intfloat.h
-  Add a new installed header libavutil/intfloat.h with int/float punning
-  functions.
-  NOTE: this was backported to 0.8
-
-2012-01-25 - lavf 53.22.0
-  f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
-          buffered data within a muxer. Added AVFMT_ALLOW_FLUSH for
-          muxers supporting it (av_write_frame makes sure it is called
-          only for muxers with this flag).
-
-------------------------------8<-------------------------------------
-                   0.8 branch was cut here
------------------------------>8--------------------------------------
-
-2012-01-15 - lavc 53.34.0
-  New audio encoding API:
-  b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
-          encoders.
-  5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
-  b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
-          Add AVCodec.encode2().
-
-2012-01-12 - 3167dc9 - lavfi 2.15.0
-  Add a new installed header -- libavfilter/version.h -- with version macros.
-
-2011-01-03 - b73ec05 - lavu 51.21.0
-  Add av_popcount64
-
-2011-12-25 - lavfi 2.14.0
-  e1d9dbf Add a new installed header - buffersrc.h
-  It contains a new function av_buffersrc_buffer() that allows passing
-  frames to the 'buffer' filter, but unlike av_vsrc_buffer_add_frame()
-  it allows for direct rendering.
-  1c9e340 Add avfilter_copy_frame_props() for copying properties from
-  AVFrame to AVFilterBufferRef.
-
-2011-12-25 - lavc 53.31.0
-  Add the following new fields to AVFrame:
-    b58dbb5 sample_aspect_ratio
-    3a2ddf7 width, height
-    8a4a5f6 format
-
-2011-12-18 - 8400b12 - lavc 53.28.1
-  Deprecate AVFrame.age. The field is unused.
-
-2011-12-12 - 5266045 - lavf 53.17.0
-  Add avformat_close_input().
-  Deprecate av_close_input_file() and av_close_input_stream().
-
-2011-12-02 - 0eea212 - lavc 53.25.0
-  Add nb_samples and extended_data fields to AVFrame.
-  Deprecate AVCODEC_MAX_AUDIO_FRAME_SIZE.
-  Deprecate avcodec_decode_audio3() in favor of avcodec_decode_audio4().
-  avcodec_decode_audio4() writes output samples to an AVFrame, which allows
-  audio decoders to use get_buffer().
-
-2011-12-04 - 560f773 - lavc 53.24.0
-  Change AVFrame.data[4]/base[4]/linesize[4]/error[4] to [8] at next major bump.
-  Change AVPicture.data[4]/linesize[4] to [8] at next major bump.
-  Change AVCodecContext.error[4] to [8] at next major bump.
-  Add AV_NUM_DATA_POINTERS to simplify the bump transition.
-
-2011-11-23 - bbb46f3 - lavu 51.18.0
-  Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and
-  av_samples_alloc(), to samplefmt.h.
-
-2011-11-23 - 8889cc4 - lavu 51.17.0
-  Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h.
-
-2011-11-19 - f3a29b7 - lavc 53.21.0
-  Move some AVCodecContext fields to a new private struct, AVCodecInternal,
-  which is accessed from a new field, AVCodecContext.internal.
-  - fields moved:
-      AVCodecContext.internal_buffer       --> AVCodecInternal.buffer
-      AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count
-      AVCodecContext.is_copy               --> AVCodecInternal.is_copy
-
-2011-11-16 - 6270671 - lavu 51.16.0
-  Add av_timegm()
-
-2011-11-13 - lavf 53.15.0
-  New interrupt callback API, allowing per-AVFormatContext/AVIOContext
-  interrupt callbacks.
-  6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
-          AVFormatContext.
-  1dee0ac Add avio_open2() with additional parameters. Those are
-          an interrupt callback and an options AVDictionary.
-          This will allow passing AVOptions to protocols after lavf
-          54.0.
-
-2011-11-06 - ba04ecf - lavu 51.14.0
-  Add av_strcasecmp() and av_strncasecmp() to avstring.h.
-
-2011-11-06 - 07b172f - lavu 51.13.0
-  Add av_toupper()/av_tolower()
-
-2011-11-05 - b6d08f4 - lavf 53.13.0
-  Add avformat_network_init()/avformat_network_deinit()
-
-2011-10-27 - 512557b - lavc 53.15.0
-  Remove avcodec_parse_frame.
-  Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY.
-
-2011-10-19 - 569129a - lavf 53.10.0
-  Add avformat_new_stream(). Deprecate av_new_stream().
-
-2011-10-13 - b631fba - lavf 53.9.0
-  Add AVFMT_NO_BYTE_SEEK AVInputFormat flag.
-
-2011-10-12 - lavu 51.12.0
-  AVOptions API rewrite.
-
-  - 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
-  - new setting/getting functions with slightly different semantics:
-        dac66da av_set_string3 -> av_opt_set
-                av_set_double  -> av_opt_set_double
-                av_set_q       -> av_opt_set_q
-                av_set_int     -> av_opt_set_int
-
-        41d9d51 av_get_string  -> av_opt_get
-                av_get_double  -> av_opt_get_double
-                av_get_q       -> av_opt_get_q
-                av_get_int     -> av_opt_get_int
-
-  - 8c5dcaa trivial rename av_next_option -> av_opt_next
-  - 641c7af new functions - av_opt_child_next, av_opt_child_class_next
-    and av_opt_find2()
-
-2011-09-03 - fb4ca26 - lavc 53.10.0
-                       lavf 53.6.0
-                       lsws  2.1.0
-  Add {avcodec,avformat,sws}_get_class().
-
-2011-09-03 - c11fb82 - lavu 51.10.0
-  Add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find() function.
-
-2011-08-26 - lavu 51.9.0
-  - f2011ed Add av_fifo_peek2(), deprecate av_fifo_peek().
-  - add41de..abc78a5 Do not include intfloat_readwrite.h,
-    mathematics.h, rational.h, pixfmt.h, or log.h from avutil.h.
-
-2011-08-16 - 48f9e45 - lavf 53.4.0
-  Add avformat_query_codec().
-
-2011-08-16 - bca06e7 - lavc 53.8.0
-  Add avcodec_get_type().
-
-2011-08-06 - 2f63440 - lavf 53.4.0
-  Add error_recognition to AVFormatContext.
-
-2011-08-02 - 9d39cbf - lavc 53.7.1
-  Add AV_PKT_FLAG_CORRUPT AVPacket flag.
-
-2011-07-10 - a67c061 - lavf 53.3.0
-  Add avformat_find_stream_info(), deprecate av_find_stream_info().
-  NOTE: this was backported to 0.7
-
-2011-07-10 - 0b950fe - lavc 53.6.0
-  Add avcodec_open2(), deprecate avcodec_open().
-  NOTE: this was backported to 0.7
-
-  Add avcodec_alloc_context3. Deprecate avcodec_alloc_context() and
-  avcodec_alloc_context2().
-
-2011-06-23 - 67e9ae1 - lavu 51.8.0 - attributes.h
-  Add av_printf_format().
-
-------------------------------8<-------------------------------------
-                   0.7 branch was cut here
------------------------------>8--------------------------------------
-
-2011-06-16 - 05e84c9, 25de595 - lavf 53.2.0 - avformat.h
-  Add avformat_open_input and avformat_write_header().
-  Deprecate av_open_input_stream, av_open_input_file,
-  AVFormatParameters and av_write_header.
-
-2011-06-16 - 7e83e1c, dc59ec5 - lavu 51.7.0 - opt.h
-  Add av_opt_set_dict() and av_opt_find().
-  Deprecate av_find_opt().
-  Add AV_DICT_APPEND flag.
-
-2011-06-10 - cb7c11c - lavu 51.6.0 - opt.h
-  Add av_opt_flag_is_set().
-
-2011-06-08 - d9f80ea - lavu 51.5.0 - AVMetadata
-  Move AVMetadata from lavf to lavu and rename it to
-  AVDictionary -- new installed header dict.h.
-  All av_metadata_* functions renamed to av_dict_*.
-
-2011-06-07 - a6703fa - lavu 51.4.0 - av_get_bytes_per_sample()
-  Add av_get_bytes_per_sample() in libavutil/samplefmt.h.
-  Deprecate av_get_bits_per_sample_fmt().
-
-2011-06-05 - b39b062 - lavu 51.3.0 - opt.h
-  Add av_opt_free convenience function.
-
-2011-05-28 - 0420bd7 - lavu 51.2.0 - pixdesc.h
-  Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
-  avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
-
-2011-05-25 - 30315a8 - lavf 53.1.0 - avformat.h
-  Add fps_probe_size to AVFormatContext.
-
-2011-05-18 - 64150ff - lavc 53.4.0 - AVCodecContext.request_sample_fmt
-  Add request_sample_fmt field to AVCodecContext.
-
-2011-05-10 - 188dea1 - lavc 53.3.0 - avcodec.h
-  Deprecate AVLPCType and the following fields in
-  AVCodecContext: lpc_coeff_precision, prediction_order_method,
-  min_partition_order, max_partition_order, lpc_type, lpc_passes.
-  Corresponding FLAC encoder options should be used instead.
-
-2011-04-26 - bebe72f - lavu 51.1.0 - avutil.h
-  Add AVPictureType enum and av_get_picture_type_char(), deprecate
-  FF_*_TYPE defines and av_get_pict_type_char() defined in
-  libavcodec/avcodec.h.
-
-2011-04-26 - 10d3940 - lavfi 2.3.0 - avfilter.h
-  Add pict_type and key_frame fields to AVFilterBufferRefVideo.
-
-2011-04-26 - 7a11c82 - lavfi 2.2.0 - vsrc_buffer
-  Add sample_aspect_ratio fields to vsrc_buffer arguments
-
-2011-04-21 - 94f7451 - lavc 53.1.0 - avcodec.h
-  Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading.
-
-2011-04-15 - lavc 52.120.0 - avcodec.h
-  AVPacket structure got additional members for passing side information:
-    4de339e introduce side information for AVPacket
-    2d8591c make containers pass palette change in AVPacket
-
-2011-04-12 - lavf 52.107.0 - avio.h
-  Avio cleanup, part II - deprecate the entire URLContext API:
-    175389c add avio_check as a replacement for url_exist
-    ff1ec0c add avio_pause and avio_seek_time as replacements
-            for _av_url_read_fseek/fpause
-    cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
-            should be used instead.
-    80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
-    f87b1b3 rename open flags: URL_* -> AVIO_*
-    f8270bb add avio_enum_protocols.
-    5593f03 deprecate URLProtocol.
-    c486dad deprecate URLContext.
-    026e175 deprecate the typedef for URLInterruptCB
-    8e76a19 deprecate av_register_protocol2.
-    b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
-    1305d93 deprecate av_url_read_seek
-    fa104e1 deprecate av_url_read_pause
-    727c7aa deprecate url_get_filename().
-    5958df3 deprecate url_max_packet_size().
-    1869ea0 deprecate url_get_file_handle().
-    32a97d4 deprecate url_filesize().
-    e52a914 deprecate url_close().
-    58a48c6 deprecate url_seek().
-    925e908 deprecate url_write().
-    dce3756 deprecate url_read_complete().
-    bc371ac deprecate url_read().
-    0589da0 deprecate url_open().
-    62eaaea deprecate url_connect.
-    5652bb9 deprecate url_alloc.
-    333e894 deprecate url_open_protocol
-    e230705 deprecate url_poll and URLPollEntry
-
-2011-04-10 - lavu  50.40.0 - pixfmt.h
-  Add PIX_FMT_BGR48LE and PIX_FMT_BGR48BE pixel formats
-
-2011-04-08 - lavf 52.106.0 - avformat.h
-  Minor avformat.h cleanup:
-    a9bf9d8 deprecate av_guess_image2_codec
-    c3675df rename avf_sdp_create->av_sdp_create
-
-2011-04-03 - lavf 52.105.0 - avio.h
-  Large-scale renaming/deprecating of AVIOContext-related functions:
-    724f6a0 deprecate url_fdopen
-    403ee83 deprecate url_open_dyn_packet_buf
-    6dc7d80 rename url_close_dyn_buf       -> avio_close_dyn_buf
-    b92c545 rename url_open_dyn_buf        -> avio_open_dyn_buf
-    8978fed introduce an AVIOContext.seekable field as a replacement for
-            AVIOContext.is_streamed and url_is_streamed()
-    b64030f deprecate get_checksum()
-    4c4427a deprecate init_checksum()
-    4ec153b deprecate udp_set_remote_url/get_local_port
-    933e90a deprecate av_url_read_fseek/fpause
-    8d9769a deprecate url_fileno
-    b7f2fdd rename put_flush_packet -> avio_flush
-    35f1023 deprecate url_close_buf
-    83fddae deprecate url_open_buf
-    d9d86e0 rename url_fprintf -> avio_printf
-    59f65d9 deprecate url_setbufsize
-    3e68b3b deprecate url_ferror
-    66e5b1d deprecate url_feof
-    e8bb2e2 deprecate url_fget_max_packet_size
-    76aa876 rename url_fsize -> avio_size
-    e519753 deprecate url_fgetc
-    655e45e deprecate url_fgets
-    a2704c9 rename url_ftell -> avio_tell
-    e16ead0 deprecate get_strz() in favor of avio_get_str
-    0300db8,2af07d3 rename url_fskip -> avio_skip
-    6b4aa5d rename url_fseek -> avio_seek
-    61840b4 deprecate put_tag
-    22a3212 rename url_fopen/fclose -> avio_open/close.
-    0ac8e2b deprecate put_nbyte
-    77eb550 rename put_byte          -> avio_w8
-                   put_[b/l]e<type>  -> avio_w[b/l]<type>
-                   put_buffer        -> avio_write
-    b7effd4 rename get_byte          -> avio_r8,
-                   get_[b/l]e<type>  -> avio_r[b/l]<type>
-                   get_buffer        -> avio_read
-    b3db9ce deprecate get_partial_buffer
-    8d9ac96 rename av_alloc_put_byte -> avio_alloc_context
-
-2011-03-25 - 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type
-  Add audio_service_type field to AVCodecContext.
-
-2011-03-02 - 863c471 - lavf  52.103.0 - av_pkt_dump2, av_pkt_dump_log2
-  Add new functions av_pkt_dump2, av_pkt_dump_log2 that uses the
-  source stream timebase for outputting timestamps. Deprecate
-  av_pkt_dump and av_pkt_dump_log.
-
-2011-02-20 - e731b8d - lavf  52.102.0 - avio.h
-  * e731b8d - rename init_put_byte() to ffio_init_context(), deprecating the
-              original, and move it to a private header so it is no longer
-              part of our public API. Instead, use av_alloc_put_byte().
-  * ae628ec - rename ByteIOContext to AVIOContext.
-
-2011-02-16 - 09d171b - lavf  52.101.0 - avformat.h
-                       lavu  52.39.0  - parseutils.h
-  * 610219a - Add av_ prefix to dump_format().
-  * f6c7375 - Replace parse_date() in lavf with av_parse_time() in lavu.
-  * ab0287f - Move find_info_tag from lavf to lavu and add av_prefix to it.
-
-2011-02-15 - lavu 52.38.0 - merge libavcore
-  libavcore is merged back completely into libavutil
-
-2011-02-10 - 55bad0c - lavc 52.113.0 - vbv_delay
-  Add vbv_delay field to AVCodecContext
-
-2011-02-14 - 24a83bd - lavf 52.100.0 - AV_DISPOSITION_CLEAN_EFFECTS
-  Add AV_DISPOSITION_CLEAN_EFFECTS disposition flag.
-
-2011-02-14 - 910b5b8 - lavfi 1.76.0 - AVFilterLink sample_aspect_ratio
-  Add sample_aspect_ratio field to AVFilterLink.
-
-2011-02-10 - 12c14cd - lavf 52.99.0 - AVStream.disposition
-  Add AV_DISPOSITION_HEARING_IMPAIRED and AV_DISPOSITION_VISUAL_IMPAIRED.
-
-2011-02-09 - 5592734 - lavc 52.112.0 - avcodec_thread_init()
-  Deprecate avcodec_thread_init()/avcodec_thread_free() use; instead
-  set thread_count before calling avcodec_open.
-
-2011-02-09 - 778b08a - lavc 52.111.0 - threading API
-  Add CODEC_CAP_FRAME_THREADS with new restrictions on get_buffer()/
-  release_buffer()/draw_horiz_band() callbacks for appropriate codecs.
-  Add thread_type and active_thread_type fields to AVCodecContext.
-
-2011-02-08 - 3940caa - lavf 52.98.0 - av_probe_input_buffer
-  Add av_probe_input_buffer() to avformat.h for probing format from a
-  ByteIOContext.
-
-2011-02-06 - fe174fc - lavf 52.97.0 - avio.h
-  Add flag for non-blocking protocols: URL_FLAG_NONBLOCK
-
-2011-02-04 - f124b08 - lavf 52.96.0 - avformat_free_context()
-  Add avformat_free_context() in avformat.h.
-
-2011-02-03 - f5b82f4 - lavc 52.109.0 - add CODEC_ID_PRORES
-  Add CODEC_ID_PRORES to avcodec.h.
-
-2011-02-03 - fe9a3fb - lavc 52.109.0 - H.264 profile defines
-  Add defines for H.264 * Constrained Baseline and Intra profiles
-
-2011-02-02 - lavf 52.95.0
-  * 50196a9 - add a new installed header version.h.
-  * 4efd5cf, dccbd97, 93b78d1 - add several variants of public
-    avio_{put,get}_str* functions.  Deprecate corresponding semi-public
-    {put,get}_str*.
-
-2011-02-02 - dfd2a00 - lavu 50.37.0 - log.h
-  Make av_dlog public.
-
-2011-01-15 - a242ac3 - lavfi 1.74.0 - AVFilterBufferRefAudioProps
-  Rename AVFilterBufferRefAudioProps.samples_nb to nb_samples.
-
-2011-01-14 - 7f88a5b - lavf 52.93.0 - av_metadata_copy()
-  Add av_metadata_copy() in avformat.h.
-
-2011-01-07 - 81c623f - lavc 52.107.0 - deprecate reordered_opaque
-  Deprecate reordered_opaque in favor of pkt_pts/dts.
-
-2011-01-07 - 1919fea - lavc 52.106.0 - pkt_dts
-  Add pkt_dts to AVFrame, this will in the future allow multithreading decoders
-  to not mess up dts.
-
-2011-01-07 - 393cbb9 - lavc 52.105.0 - pkt_pts
-  Add pkt_pts to AVFrame.
-
-2011-01-07 - 060ec0a - lavc 52.104.0 - av_get_profile_name()
-  Add av_get_profile_name to libavcodec/avcodec.h.
-
-2010-12-27 - 0ccabee - lavfi 1.71.0 - AV_PERM_NEG_LINESIZES
-  Add AV_PERM_NEG_LINESIZES in avfilter.h.
-
-2010-12-27 - 9128ae0 - lavf 52.91.0 - av_find_best_stream()
-  Add av_find_best_stream to libavformat/avformat.h.
-
-2010-12-27 - 107a7e3 - lavf 52.90.0
-  Add AVFMT_NOSTREAMS flag for formats with no streams,
-  like e.g. text metadata.
-
-2010-12-22 - 0328b9e - lavu 50.36.0 - file.h
-  Add functions av_file_map() and av_file_unmap() in file.h.
-
-2010-12-19 - 0bc55f5 - lavu 50.35.0 - error.h
-  Add "not found" error codes:
-  AVERROR_DEMUXER_NOT_FOUND
-  AVERROR_MUXER_NOT_FOUND
-  AVERROR_DECODER_NOT_FOUND
-  AVERROR_ENCODER_NOT_FOUND
-  AVERROR_PROTOCOL_NOT_FOUND
-  AVERROR_FILTER_NOT_FOUND
-  AVERROR_BSF_NOT_FOUND
-  AVERROR_STREAM_NOT_FOUND
-
-2010-12-09 - c61cdd0 - lavcore 0.16.0 - avcore.h
-  Move AV_NOPTS_VALUE, AV_TIME_BASE, AV_TIME_BASE_Q symbols from
-  avcodec.h to avcore.h.
-
-2010-12-04 - 16cfc96 - lavc 52.98.0 - CODEC_CAP_NEG_LINESIZES
-  Add CODEC_CAP_NEG_LINESIZES codec capability flag in avcodec.h.
-
-2010-12-04 - bb4afa1 - lavu 50.34.0 - av_get_pix_fmt_string()
-  Deprecate avcodec_pix_fmt_string() in favor of
-  pixdesc.h/av_get_pix_fmt_string().
-
-2010-12-04 - 4da12e3 - lavcore 0.15.0 - av_image_alloc()
-  Add av_image_alloc() to libavcore/imgutils.h.
-
-2010-12-02 - 037be76 - lavfi 1.67.0 - avfilter_graph_create_filter()
-  Add function avfilter_graph_create_filter() in avfiltergraph.h.
-
-2010-11-25 - 4723bc2 - lavfi 1.65.0 - avfilter_get_video_buffer_ref_from_arrays()
-  Add function avfilter_get_video_buffer_ref_from_arrays() in
-  avfilter.h.
-
-2010-11-21 - 176a615 - lavcore 0.14.0 - audioconvert.h
-  Add a public audio channel API in audioconvert.h, and deprecate the
-  corresponding functions in libavcodec:
-  avcodec_get_channel_name()
-  avcodec_get_channel_layout()
-  avcodec_get_channel_layout_string()
-  avcodec_channel_layout_num_channels()
-  and the CH_* macros defined in libavcodec/avcodec.h.
-
-2010-11-21 - 6bfc268 - lavf 52.85.0 - avformat.h
-  Add av_append_packet().
-
-2010-11-21 - a08d918 - lavc 52.97.0 - avcodec.h
-  Add av_grow_packet().
-
-2010-11-17 - 0985e1a - lavcore 0.13.0 - parseutils.h
-  Add av_parse_color() declared in libavcore/parseutils.h.
-
-2010-11-13 - cb2c971 - lavc 52.95.0 - AVCodecContext
-  Add AVCodecContext.subtitle_header and AVCodecContext.subtitle_header_size
-  fields.
-
-2010-11-13 - 5aaea02 - lavfi 1.62.0 - avfiltergraph.h
-  Make avfiltergraph.h public.
-
-2010-11-13 - 4fcbb2a - lavfi 1.61.0 - avfiltergraph.h
-  Remove declarations from avfiltergraph.h for the functions:
-  avfilter_graph_check_validity()
-  avfilter_graph_config_links()
-  avfilter_graph_config_formats()
-  which are now internal.
-  Use avfilter_graph_config() instead.
-
-2010-11-08 - d2af720 - lavu 50.33.0 - eval.h
-  Deprecate functions:
-  av_parse_and_eval_expr(),
-  av_parse_expr(),
-  av_eval_expr(),
-  av_free_expr(),
-  in favor of the functions:
-  av_expr_parse_and_eval(),
-  av_expr_parse(),
-  av_expr_eval(),
-  av_expr_free().
-
-2010-11-08 - 24de0ed - lavfi 1.59.0 - avfilter_free()
-  Rename avfilter_destroy() to avfilter_free().
-  This change breaks libavfilter API/ABI.
-
-2010-11-07 - 1e80a0e - lavfi 1.58.0 - avfiltergraph.h
-  Remove graphparser.h header, move AVFilterInOut and
-  avfilter_graph_parse() declarations to libavfilter/avfiltergraph.h.
-
-2010-11-07 - 7313132 - lavfi 1.57.0 - AVFilterInOut
-  Rename field AVFilterInOut.filter to AVFilterInOut.filter_ctx.
-  This change breaks libavfilter API.
-
-2010-11-04 - 97dd1e4 - lavfi 1.56.0 - avfilter_graph_free()
-  Rename avfilter_graph_destroy() to avfilter_graph_free().
-  This change breaks libavfilter API/ABI.
-
-2010-11-04 - e15aeea - lavfi 1.55.0 - avfilter_graph_alloc()
-  Add avfilter_graph_alloc() to libavfilter/avfiltergraph.h.
-
-2010-11-02 - 6f84cd1 - lavcore 0.12.0 - av_get_bits_per_sample_fmt()
-  Add av_get_bits_per_sample_fmt() to libavcore/samplefmt.h and
-  deprecate av_get_bits_per_sample_format().
-
-2010-11-02 - d63e456 - lavcore 0.11.0 - samplefmt.h
-  Add sample format functions in libavcore/samplefmt.h:
-  av_get_sample_fmt_name(),
-  av_get_sample_fmt(),
-  av_get_sample_fmt_string(),
-  and deprecate the corresponding libavcodec/audioconvert.h functions:
-  avcodec_get_sample_fmt_name(),
-  avcodec_get_sample_fmt(),
-  avcodec_sample_fmt_string().
-
-2010-11-02 - 262d1c5 - lavcore 0.10.0 - samplefmt.h
-  Define enum AVSampleFormat in libavcore/samplefmt.h, deprecate enum
-  SampleFormat.
-
-2010-10-16 - 2a24df9 - lavfi 1.52.0 - avfilter_graph_config()
-  Add the function avfilter_graph_config() in avfiltergraph.h.
-
-2010-10-15 - 03700d3 - lavf 52.83.0 - metadata API
-  Change demuxers to export metadata in generic format and
-  muxers to accept generic format. Deprecate the public
-  conversion API.
-
-2010-10-10 - 867ae7a - lavfi 1.49.0 - AVFilterLink.time_base
-  Add time_base field to AVFilterLink.
-
-2010-09-27 - c85eef4 - lavu 50.31.0 - av_set_options_string()
-  Move av_set_options_string() from libavfilter/parseutils.h to
-  libavutil/opt.h.
-
-2010-09-27 - acc0490 - lavfi 1.47.0 - AVFilterLink
-  Make the AVFilterLink fields srcpad and dstpad store the pointers to
-  the source and destination pads, rather than their indexes.
-
-2010-09-27 - 372e288 - lavu 50.30.0 - av_get_token()
-  Move av_get_token() from libavfilter/parseutils.h to
-  libavutil/avstring.h.
-
-2010-09-26 - 635d4ae - lsws 0.12.0 - swscale.h
-  Add the functions sws_alloc_context() and sws_init_context().
-
-2010-09-26 - 6ed0404 - lavu 50.29.0 - opt.h
-  Move libavcodec/opt.h to libavutil/opt.h.
-
-2010-09-24 - 1c1c80f - lavu 50.28.0 - av_log_set_flags()
-  Default of av_log() changed due to many problems to the old no repeat
-  detection. Read the docs of AV_LOG_SKIP_REPEATED in log.h before
-  enabling it for your app!.
-
-2010-09-24 - f66eb58 - lavc 52.90.0 - av_opt_show2()
-  Deprecate av_opt_show() in favor or av_opt_show2().
-
-2010-09-14 - bc6f0af - lavu 50.27.0 - av_popcount()
-  Add av_popcount() to libavutil/common.h.
-
-2010-09-08 - c6c98d0 - lavu 50.26.0 - av_get_cpu_flags()
-  Add av_get_cpu_flags().
-
-2010-09-07 - 34017fd - lavcore 0.9.0 - av_image_copy()
-  Add av_image_copy().
-
-2010-09-07 - 9686abb - lavcore 0.8.0 - av_image_copy_plane()
-  Add av_image_copy_plane().
-
-2010-09-07 - 9b7269e - lavcore 0.7.0 - imgutils.h
-  Adopt hierarchical scheme for the imgutils.h function names,
-  deprecate the old names.
-
-2010-09-04 - 7160bb7 - lavu 50.25.0 - AV_CPU_FLAG_*
-  Deprecate the FF_MM_* flags defined in libavcodec/avcodec.h in favor
-  of the AV_CPU_FLAG_* flags defined in libavutil/cpu.h.
-
-2010-08-26 - 5da19b5 - lavc 52.87.0 - avcodec_get_channel_layout()
-  Add avcodec_get_channel_layout() in audioconvert.h.
-
-2010-08-20 - e344336 - lavcore 0.6.0 - av_fill_image_max_pixsteps()
-  Rename av_fill_image_max_pixstep() to av_fill_image_max_pixsteps().
-
-2010-08-18 - a6ddf8b - lavcore 0.5.0 - av_fill_image_max_pixstep()
-  Add av_fill_image_max_pixstep() in imgutils.h.
-
-2010-08-17 - 4f2d2e4 - lavu 50.24.0 - AV_NE()
-  Add the AV_NE macro.
-
-2010-08-17 - ad2c950 - lavfi 1.36.0 - audio framework
-  Implement AVFilterBufferRefAudioProps struct for audio properties,
-  get_audio_buffer(), filter_samples() functions and related changes.
-
-2010-08-12 - 81c1eca - lavcore 0.4.0 - av_get_image_linesize()
-  Add av_get_image_linesize() in imgutils.h.
-
-2010-08-11 - c1db7bf - lavfi 1.34.0 - AVFilterBufferRef
-  Resize data and linesize arrays in AVFilterBufferRef to 8.
-
-  This change breaks libavfilter API/ABI.
-
-2010-08-11 - 9f08d80 - lavc 52.85.0 - av_picture_data_copy()
-  Add av_picture_data_copy in avcodec.h.
-
-2010-08-11 - 84c0386 - lavfi 1.33.0 - avfilter_open()
-  Change avfilter_open() signature:
-  AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name) ->
-  int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);
-
-  This change breaks libavfilter API/ABI.
-
-2010-08-11 - cc80caf - lavfi 1.32.0 - AVFilterBufferRef
-  Add a type field to AVFilterBufferRef, and move video specific
-  properties to AVFilterBufferRefVideoProps.
-
-  This change breaks libavfilter API/ABI.
-
-2010-08-07 - 5d4890d - lavfi 1.31.0 - AVFilterLink
-  Rename AVFilterLink fields:
-  AVFilterLink.srcpic    ->  AVFilterLink.src_buf
-  AVFilterLink.cur_pic   ->  AVFilterLink.cur_buf
-  AVFilterLink.outpic    ->  AVFilterLink.out_buf
-
-2010-08-07 - 7fce481 - lavfi 1.30.0
-  Rename functions and fields:
-  avfilter_(un)ref_pic       -> avfilter_(un)ref_buffer
-  avfilter_copy_picref_props -> avfilter_copy_buffer_ref_props
-  AVFilterBufferRef.pic      -> AVFilterBufferRef.buffer
-
-2010-08-07 - ecc8dad - lavfi 1.29.0 - AVFilterBufferRef
-  Rename AVFilterPicRef to AVFilterBufferRef.
-
-2010-08-07 - d54e094 - lavfi 1.28.0 - AVFilterBuffer
-  Move format field from AVFilterBuffer to AVFilterPicRef.
-
-2010-08-06 - bf176f5 - lavcore 0.3.0 - av_check_image_size()
-  Deprecate avcodec_check_dimensions() in favor of the function
-  av_check_image_size() defined in libavcore/imgutils.h.
-
-2010-07-30 - 56b5e9d - lavfi 1.27.0 - AVFilterBuffer
-  Increase size of the arrays AVFilterBuffer.data and
-  AVFilterBuffer.linesize from 4 to 8.
-
-  This change breaks libavfilter ABI.
-
-2010-07-29 - e7bd48a - lavcore 0.2.0 - imgutils.h
-  Add functions av_fill_image_linesizes() and
-  av_fill_image_pointers(), declared in libavcore/imgutils.h.
-
-2010-07-27 - 126b638 - lavcore 0.1.0 - parseutils.h
-  Deprecate av_parse_video_frame_size() and av_parse_video_frame_rate()
-  defined in libavcodec in favor of the newly added functions
-  av_parse_video_size() and av_parse_video_rate() declared in
-  libavcore/parseutils.h.
-
-2010-07-23 - 4485247 - lavu 50.23.0 - mathematics.h
-  Add the M_PHI constant definition.
-
-2010-07-22 - bdab614 - lavfi 1.26.0 - media format generalization
-  Add a type field to AVFilterLink.
-
-  Change the field types:
-  enum PixelFormat format   -> int format   in AVFilterBuffer
-  enum PixelFormat *formats -> int *formats in AVFilterFormats
-  enum PixelFormat *format  -> int format   in AVFilterLink
-
-  Change the function signatures:
-  AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts); ->
-  AVFilterFormats *avfilter_make_format_list(const int *fmts);
-
-  int avfilter_add_colorspace(AVFilterFormats **avff, enum PixelFormat pix_fmt); ->
-  int avfilter_add_format    (AVFilterFormats **avff, int fmt);
-
-  AVFilterFormats *avfilter_all_colorspaces(void); ->
-  AVFilterFormats *avfilter_all_formats    (enum AVMediaType type);
-
-  This change breaks libavfilter API/ABI.
-
-2010-07-21 - aac6ca6 - lavcore 0.0.0
-  Add libavcore.
-
-2010-07-17 - b5c582f - lavfi 1.25.0 - AVFilterBuffer
-  Remove w and h fields from AVFilterBuffer.
-
-2010-07-17 - f0d77b2 - lavfi 1.24.0 - AVFilterBuffer
-  Rename AVFilterPic to AVFilterBuffer.
-
-2010-07-17 - 57fe80f - lavf 52.74.0 - url_fskip()
-  Make url_fskip() return an int error code instead of void.
-
-2010-07-11 - 23940f1 - lavc 52.83.0
-  Add AVCodecContext.lpc_type and AVCodecContext.lpc_passes fields.
-  Add AVLPCType enum.
-  Deprecate AVCodecContext.use_lpc.
-
-2010-07-11 - e1d7c88 - lavc 52.82.0 - avsubtitle_free()
-  Add a function for free the contents of a AVSubtitle generated by
-  avcodec_decode_subtitle.
-
-2010-07-11 - b91d08f - lavu 50.22.0 - bswap.h and intreadwrite.h
-  Make the bswap.h and intreadwrite.h API public.
-
-2010-07-08 - ce1cd1c - lavu 50.21.0 - pixdesc.h
-  Rename read/write_line() to av_read/write_image_line().
-
-2010-07-07 - 4d508e4 - lavfi 1.21.0 - avfilter_copy_picref_props()
-  Add avfilter_copy_picref_props().
-
-2010-07-03 - 2d525ef - lavc 52.79.0
-  Add FF_COMPLIANCE_UNOFFICIAL and change all instances of
-  FF_COMPLIANCE_INOFFICIAL to use FF_COMPLIANCE_UNOFFICIAL.
-
-2010-07-02 - 89eec74 - lavu 50.20.0 - lfg.h
-  Export av_lfg_init(), av_lfg_get(), av_mlfg_get(), and av_bmg_get() through
-  lfg.h.
-
-2010-06-28 - a52e2c3 - lavfi 1.20.1 - av_parse_color()
-  Extend av_parse_color() syntax, make it accept an alpha value specifier and
-  set the alpha value to 255 by default.
-
-2010-06-22 - 735cf6b - lavf 52.71.0 - URLProtocol.priv_data_size, priv_data_class
-  Add priv_data_size and priv_data_class to URLProtocol.
-
-2010-06-22 - ffbb289 - lavf 52.70.0 - url_alloc(), url_connect()
-  Add url_alloc() and url_connect().
-
-2010-06-22 - 9b07a2d - lavf 52.69.0 - av_register_protocol2()
-  Add av_register_protocol2(), deprecating av_register_protocol().
-
-2010-06-09 - 65db058 - lavu 50.19.0 - av_compare_mod()
-  Add av_compare_mod() to libavutil/mathematics.h.
-
-2010-06-05 - 0b99215 - lavu 50.18.0 - eval API
-  Make the eval API public.
-
-2010-06-04 - 31878fc - lavu 50.17.0 - AV_BASE64_SIZE
-  Add AV_BASE64_SIZE() macro.
-
-2010-06-02 - 7e566bb - lavc 52.73.0 - av_get_codec_tag_string()
-  Add av_get_codec_tag_string().
-
-2010-06-01 - 2b99142 - lsws 0.11.0 - convertPalette API
-  Add sws_convertPalette8ToPacked32() and sws_convertPalette8ToPacked24().
-
-2010-05-26 - 93ebfee - lavc 52.72.0 - CODEC_CAP_EXPERIMENTAL
-  Add CODEC_CAP_EXPERIMENTAL flag.
-  NOTE: this was backported to 0.6
-
-2010-05-23 - 9977863 - lavu 50.16.0 - av_get_random_seed()
-  Add av_get_random_seed().
-
-2010-05-18 - 796ac23 - lavf 52.63.0 - AVFMT_FLAG_RTP_HINT
-  Add AVFMT_FLAG_RTP_HINT as possible value for AVFormatContext.flags.
-  NOTE: this was backported to 0.6
-
-2010-05-09 - b6bc205 - lavfi 1.20.0 - AVFilterPicRef
-  Add interlaced and top_field_first fields to AVFilterPicRef.
-
-------------------------------8<-------------------------------------
-                   0.6 branch was cut here
------------------------------>8--------------------------------------
-
-2010-05-01 - 8e2ee18 - 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 - 3dd6180 - lavf 52.61.0 - metadata API
-  Add a flag for av_metadata_set2() to disable overwriting of
-  existing tags.
-
-2010-04-01 - 0fb49b5 - lavc 52.66.0
-  Add avcodec_get_edge_width().
-
-2010-03-31 - d103218 - lavc 52.65.0
-  Add avcodec_copy_context().
-
-2010-03-31 - 1a70d12 - lavf 52.60.0 - av_match_ext()
-  Make av_match_ext() public.
-
-2010-03-31 - 1149150 - lavu 50.14.0 - AVMediaType
-  Move AVMediaType enum from libavcodec to libavutil.
-
-2010-03-31 - 72415b2 - 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 - 8795823 - lavu 50.13.0 - av_strerror()
-  Implement av_strerror().
-
-2010-03-23 - e1484eb - lavc 52.60.0 - av_dct_init()
-  Support DCT-I and DST-I.
-
-2010-03-15 - b8819c8 - lavf 52.56.0 - AVFormatContext.start_time_realtime
-  Add AVFormatContext.start_time_realtime field.
-
-2010-03-13 - 5bb5c1d - lavfi 1.18.0 - AVFilterPicRef.pos
-  Add AVFilterPicRef.pos field.
-
-2010-03-13 - 60c144f - 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 - c709483 - lavc 52.56.0 - avfft.h
-  Add public FFT interface.
-
-2010-03-06 - ac6ef86 - lavu 50.11.0 - av_stristr()
-  Add av_stristr().
-
-2010-03-03 - 4b83fc0 - lavu 50.10.0 - av_tree_enumerate()
-  Add av_tree_enumerate().
-
-2010-02-07 - b687c1a - lavu 50.9.0 - av_compare_ts()
-  Add av_compare_ts().
-
-2010-02-05 - 3f3dc76 - lsws 0.10.0 - sws_getCoefficients()
-  Add sws_getCoefficients().
-
-2010-02-01 - ca76a11 - lavf 52.50.0 - metadata API
-  Add a list of generic tag names, change 'author' -> 'artist',
-  'year' -> 'date'.
-
-2010-01-30 - 80a07f6 - lavu 50.8.0 - av_get_pix_fmt()
-  Add av_get_pix_fmt().
-
-2010-01-21 - 01cc47d - lsws 0.9.0 - sws_scale()
-  Change constness attributes of sws_scale() parameters.
-
-2010-01-10 - 3fb8e77 - lavfi 1.15.0 - avfilter_graph_config_links()
-  Add a log_ctx parameter to avfilter_graph_config_links().
-
-2010-01-07 - 8e9767f - lsws 0.8.0 - sws_isSupported{In,Out}put()
-  Add sws_isSupportedInput() and sws_isSupportedOutput() functions.
-
-2010-01-06 - c1d662f - 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 - 4fd1f18 - lavfi 1.13.0 - avfilter_add_colorspace()
-  Add avfilter_add_colorspace().
-
-2010-01-02 - 8eb631f - lavf 52.46.0 - av_match_ext()
-  Add av_match_ext(), it should be used in place of match_ext().
-
-2010-01-01 - a1f547b - lavf 52.45.0 - av_guess_format()
-  Add av_guess_format(), it should be used in place of guess_format().
-
-2009-12-13 - a181981 - lavf 52.43.0 - metadata API
-  Add av_metadata_set2(), AV_METADATA_DONT_STRDUP_KEY and
-  AV_METADATA_DONT_STRDUP_VAL.
-
-2009-12-13 - 277c733 - lavu 50.7.0 - avstring.h API
-  Add av_d2str().
-
-2009-12-13 - 02b398e - lavc 52.42.0 - AVStream
-  Add avg_frame_rate.
-
-2009-12-12 - 3ba69a1 - lavu 50.6.0 - av_bmg_next()
-  Introduce the av_bmg_next() function.
-
-2009-12-05 - a13a543 - lavfi 1.12.0 - avfilter_draw_slice()
-  Add a slice_dir parameter to avfilter_draw_slice().
-
-2009-11-26 - 4cc3f6a - lavfi 1.11.0 - AVFilter
-  Remove the next field from AVFilter, this is not anymore required.
-
-2009-11-25 - 1433c4a - lavfi 1.10.0 - avfilter_next()
-  Introduce the avfilter_next() function.
-
-2009-11-25 - 86a60fa - 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 - 74a0059 - lavu 50.5.0 - pixdesc.h API
-  Make the pixdesc.h API public.
-
-2009-10-27 - 243110f - 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 - cccd292 - lavfi 1.4.1 - AVFilter.description
-  Add a description field to AVFilter.
-
-2009-10-19 - 6b5dc05 - 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 - 0eb4ff9 - 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 - 46c40e4 - lavfi 0.5.1 - AVFilterPic
-  Add w and h fields to AVFilterPic.
-
-2009-06-22 - 92400be - lavf 52.34.1 - AVFormatContext.packet_size
-  This is now an unsigned int instead of a signed int.
-
-2009-06-19 - a4276ba - 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 - 8f3f2e0 - 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 - f988ce6 - 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 - ce1d9c8 - lavc 52.28.0 - av_free_packet()
-  av_free_packet() is no longer an inline function. It is now exported.
-
-2009-04-11 - 80d403f - 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 - 7a00bba - 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 - 7b09db3 - lavu 50.3.0 - av_fifo_space()
-  Introduce the av_fifo_space() function.
-
-2009-04-02 - fabd246 - lavc 52.23.0 - AVPacket
-  Move AVPacket declaration from libavformat/avformat.h to
-  libavcodec/avcodec.h.
-
-2009-03-22 - 6e08ca9 - 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 - f82674e - 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 - ee6624e - 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 - 41dd680 - 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 - ec26457 - 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/deps/libav/doc/Doxyfile b/deps/libav/doc/Doxyfile
deleted file mode 100644
index 58f7dfb..0000000
--- a/deps/libav/doc/Doxyfile
+++ /dev/null
@@ -1,1624 +0,0 @@
-# Doxyfile 1.7.1
-
-# 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 (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# 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         =
-
-# With the PROJECT_LOGO tag one can specify an logo or icon that is included
-# in the documentation. The maximum height of the logo should not exceed 55
-# pixels and the maximum width should not exceed 200 pixels. Doxygen will
-# copy the logo to the output directory.
-PROJECT_LOGO           =
-
-# 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       = doc/doxy
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS         = NO
-
-# 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:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE        = English
-
-# 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
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF       =
-
-# 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. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH        = .
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH    =
-
-# 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 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 regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF      = YES
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF           = NO
-
-# 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 INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES  = 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
-
-# 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                =
-
-# 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 OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this
-# tag. The format is ext=language, where ext is a file extension, and language
-# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
-# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
-# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
-# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING      =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT   = 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
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING            = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT   = YES
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will roughly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE      = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# 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
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS  = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES   = NO
-
-# 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 classes 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
-
-# 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
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES       = YES
-
-# 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 SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES   = NO
-
-# 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       = NO
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# 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
-
-# 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 consists 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 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
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES        = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER    =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. The create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option.
-# You can optionally specify a file name after the option, if omitted
-# DoxygenLayout.xml will be used as the name of the layout file.
-
-LAYOUT_FILE            =
-
-#---------------------------------------------------------------------------
-# 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                  = YES
-
-# 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
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC       = NO
-
-# 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. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-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                  =
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING         = UTF-8
-
-# 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 *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-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. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       = *.git \
-                         *.d
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS        =
-
-# 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       = *-example.c
-
-# 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.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER           =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS        =
-
-# 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.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-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
-# 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
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS              = 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
-
-#---------------------------------------------------------------------------
-# 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    = 2
-
-# 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. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET        =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the stylesheet and background images
-# according to this color. Hue is specified as an angle on a colorwheel,
-# see http://en.wikipedia.org/wiki/Hue for more information.
-# For instance the value 0 represents red, 60 is yellow, 120 is green,
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
-# The allowed range is 0 to 359.
-
-HTML_COLORSTYLE_HUE    = 120
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
-# the colors in the HTML output. For a value of 0 the output will use
-# grayscales only. A value of 255 will produce the most vivid colors.
-
-HTML_COLORSTYLE_SAT    = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
-# the luminance component of the colors in the HTML output. Values below
-# 100 gradually make the output lighter, whereas values above 100 make
-# the output darker. The value divided by 100 is the actual gamma applied,
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
-# and 100 does not change the gamma.
-
-HTML_COLORSTYLE_GAMMA  = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP         = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OS X 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-
-GENERATE_DOCSET        = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-
-DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
-
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
-
-DOCSET_PUBLISHER_NAME  = Publisher
-
-# 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 compiled 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 directory.
-
-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 CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING     =
-
-# 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
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
-# Qt Compressed Help (.qch) of the generated HTML documentation.
-
-GENERATE_QHP           = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE               =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE          = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER     = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME   =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
-# Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS  =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
-# Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS  =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION           =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-#  will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
-
-GENERATE_ECLIPSEHELP   = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
-
-ECLIPSE_DOC_ID         = org.doxygen.Project
-
-# 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
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value 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, DHTML, CSS and frames is required (i.e. any modern browser).
-# 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
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
-# links to external symbols imported via tag files in a separate window.
-
-EXT_LINKS_IN_WINDOW    = NO
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE       = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are
-# not supported properly for IE 6.0, but are supported on all modern browsers.
-# Note that when changing this option you need to delete any form_*.png files
-# in the HTML output before the changes have effect.
-
-FORMULA_TRANSPARENT    = YES
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE           = NO
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a PHP enabled web server instead of at the web client
-# using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server
-# based approach is that it scales better to large projects and allows
-# full text search. The disadvances is that it is more difficult to setup
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH    = NO
-
-#---------------------------------------------------------------------------
-# 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         = NO
-
-# 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.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
-
-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
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES     = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE      = 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 assignments. 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.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML 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 `xml' will be used as the default path.
-
-XML_OUTPUT             = xml
-
-# 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                =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# 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_DEFINED 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. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED             = "__attribute__(x)=" \
-                         "DECLARE_ALIGNED(a,t,n)=t n" \
-                         "offsetof(x,y)=0x42" \
-                         av_alloc_size \
-
-# 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      = declare_idct  \
-                         READ_PAR_DATA \
-
-# 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::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-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 superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS         = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH            =
-
-# 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
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
-# allowed to run in parallel. When set to 0 (the default) doxygen will
-# base this on the number of processors available in the system. You can set it
-# explicitly to a value larger than 0 to get control over the balance
-# between CPU load and processing speed.
-
-DOT_NUM_THREADS        = 0
-
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-
-DOT_FONTNAME           = FreeSans
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE           = 10
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-
-DOT_FONTPATH           =
-
-# 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 the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK               = NO
-
-# 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 CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH           = NO
-
-# 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
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH        = 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 in 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 DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES    = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH    = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT        = YES
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS      = NO
-
-# 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 intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP            = YES
diff --git a/deps/libav/doc/Makefile b/deps/libav/doc/Makefile
deleted file mode 100644
index 0cb2335..0000000
--- a/deps/libav/doc/Makefile
+++ /dev/null
@@ -1,96 +0,0 @@
-ALLMANPAGES = $(AVBASENAMES:%=%.1)
-MANPAGES    = $(AVPROGS-yes:%=doc/%.1)
-PODPAGES    = $(AVPROGS-yes:%=doc/%.pod)
-HTMLPAGES   = $(AVPROGS-yes:%=doc/%.html)                               \
-              doc/developer.html                                        \
-              doc/faq.html                                              \
-              doc/fate.html                                             \
-              doc/general.html                                          \
-              doc/git-howto.html                                        \
-              doc/libavfilter.html                                      \
-              doc/nut.html                                              \
-              doc/platform.html                                         \
-
-DOCS-$(CONFIG_POD2MAN)                          += $(MANPAGES) $(PODPAGES)
-DOCS-$(CONFIG_TEXI2HTML)                        += $(HTMLPAGES)
-DOCS = $(DOCS-yes)
-
-DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE)          += avcodec
-DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)         += metadata
-DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)           += output
-DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)    += transcode_aac
-ALL_DOC_EXAMPLES = avcodec metadata output transcode_aac
-
-DOC_EXAMPLES     := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF))
-ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES:%=doc/examples/%$(EXESUF))
-PROGS            += $(DOC_EXAMPLES)
-
-all: $(DOCS)
-
-apidoc: doc/doxy/html
-documentation: $(DOCS)
-
-examples: $(DOC_EXAMPLES)
-
-TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
-
-GENTEXI  = format codec
-GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
-
-$(GENTEXI): TAG = GENTEXI
-$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
-	$(M)doc/print_options $* > $@
-
-doc/%.html: TAG = HTML
-doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
-	$(Q)$(TEXIDEP)
-	$(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
-
-doc/%.pod: TAG = POD
-doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
-	$(Q)$(TEXIDEP)
-	$(M)$(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
-
-doc/%.1: TAG = MAN
-doc/%.1: doc/%.pod $(GENTEXI)
-	$(M)pod2man --section=1 --center=" " --release=" " $< > $@
-
-$(DOCS) doc/doxy/html: | doc/
-$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
-OBJDIRS += doc/examples
-
-DOXY_INPUT      = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c))
-DOXY_TEMPLATES  = doxy_stylesheet.css footer.html header.html
-DOXY_TEMPLATES := $(addprefix $(SRC_PATH)/doc/doxy/, $(DOXY_TEMPLATES))
-
-doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(DOXY_INPUT) $(DOXY_TEMPLATES)
-	$(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXY_INPUT)
-
-install-progs-$(CONFIG_POD2MAN): install-man
-install-progs-$(CONFIG_TEXI2HTML): install-doc
-
-install-doc: $(HTMLPAGES)
-	$(Q)mkdir -p "$(DOCDIR)"
-	$(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
-
-install-man: $(MANPAGES)
-	$(Q)mkdir -p "$(MANDIR)/man1"
-	$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
-
-uninstall: uninstall-doc uninstall-man
-
-uninstall-doc:
-	$(RM) -r "$(DOCDIR)"
-
-uninstall-man:
-	$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
-
-clean::
-	$(RM) $(ALL_DOC_EXAMPLES)
-	$(RM) $(CLEANSUFFIXES:%=doc/%) $(CLEANSUFFIXES:%=doc/examples/%)
-	$(RM) doc/*.html doc/*.pod doc/*.1 doc/avoptions_*.texi
-	$(RM) -r doc/doxy/html
-
--include $(wildcard $(DOCS:%=%.d))
-
-.PHONY: apidoc documentation
diff --git a/deps/libav/doc/RELEASE_NOTES b/deps/libav/doc/RELEASE_NOTES
deleted file mode 100644
index 478bc1d..0000000
--- a/deps/libav/doc/RELEASE_NOTES
+++ /dev/null
@@ -1,84 +0,0 @@
-Release Notes
-=============
-
-* 10 "Eks"
-
-General notes
--------------
-
-One of the main features of this release is the addition of reference-counted
-data buffers to Libav and their use in various structures. Specifically, the
-data buffers used by AVPacket and AVFrame can now be reference counted, which
-should allow to significantly simplify many use cases. In addition,
-reference-counted AVFrames can now be used in libavfilter, avoiding the need
-for a separate libavfilter-specific frame structure. Frames can now be passed
-straight from the decoders into filters or from filters to encoders.
-
-These additions made it necessary to bump the major versions of libavcodec,
-libavformat, libavdevice, libavfilter, and libavutil, which was accompanied by
-dropping some old deprecated APIs. These libraries are thus not ABI- or API-
-compatible with the previous release. All the other libraries (libavresample
-and libswscale) should be both ABI- and API-compatible.
-
-Another major point is the inclusion of the HEVC (AKA H.265, the successor of
-H.264) decoder in the main codebase. It was started in 2012 as a Libav Google
-Summer of Code project by Guillaume Martres and subsequently completed with
-the assistance of the OpenHEVC project and several Libav developers.
-
-As usual, this release also contains support for other new formats, many smaller
-new features and countless bug fixes. We can highlight a native VP9 decoder,
-with encoding provided through libvpx, native decoders for WebP, JPEG 2000, and
-AIC, as well as improved WavPack support with encoding through libwavpack,
-support for more AAC flavors (LD - low delay, ELD - enhanced low delay), slice
-multithreading in libavfilter, or muxing chapters in ASF. Furthermore a few new
-filters have been introduced, namely compand, to change audio dynamics, framepack,
-to create stereoscopic videos, asetpts, to set audio pts, and interlace, to convert
-progressive video to interlaced. Finally there is more fine-grained detection of
-host and target libc, which should allow better portability to various cross
-compilation scenarios.
-
-See the Changelog file for a fuller 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 Libav trunk repository. If you are experiencing
-issues with any formally released version of Libav, 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 changes
------------
-
-A number of additional APIs have been introduced and some existing functions
-have been deprecated and are scheduled for removal in the next release.
-Significant API changes include:
-
-[libavutil]
-+ added the reference-counted buffers API (buffers.h)
-+ moved the AVFrame struct to libavutil and added a new API for working with
-  reference-counted AVFrames (frame.h)
-
-[libavcodec]
-+ added an API for working with reference-counted AVPackets (av_packet_*)
-+- converted VDPAU to the hwaccel framework; the old way of using VDPAU is no
-   longer supported
-- old audio encoding and decoding APIs removed
-- old video encoding API removed
-- deprecated enum CodecID removed (enum AVCodecID should be used instead)
-- deprecated audio resampling API removed (libavresample should be used
-  instead)
-
-[libavfilter]
-+- replaced AVFilterBufferRef with AVFrame; AVFilterBufferRef and everything
-   related to it still exists, but is deprecated
-+ converted all filters to use the AVOptions system for configuration, it is
-  now possible to query the supported options, their values and set them
-  directly with av_opt_*
-+ added a slice multithreading framework
-+- merged avfiltergraph.h to avfilter.h, using AVFilterGraph is now explicitly
-   mandatory (it was implicitly required even before); added new API for
-   allocating and initializing filters
-
-Please see the file doc/APIchanges for details along with similar
-programmer-centric information.
diff --git a/deps/libav/doc/avconv.texi b/deps/libav/doc/avconv.texi
deleted file mode 100644
index 7ef415f..0000000
--- a/deps/libav/doc/avconv.texi
+++ /dev/null
@@ -1,1149 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle avconv Documentation
- at titlepage
- at center @titlefont{avconv Documentation}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter Synopsis
-
-The generic syntax is:
-
- at example
- at c man begin SYNOPSIS
-avconv [global options] [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
- at c man end
- at end example
-
- at chapter Description
- at c man begin DESCRIPTION
-
-avconv is a very fast video and audio converter that can also grab from
-a live audio/video source. It can also convert between arbitrary sample
-rates and resize video on the fly with a high quality polyphase filter.
-
-avconv reads from an arbitrary number of input "files" (which can be regular
-files, pipes, network streams, grabbing devices, etc.), specified by the
- at code{-i} option, and writes to an arbitrary number of output "files", which are
-specified by a plain output filename. Anything found on the command line which
-cannot be interpreted as an option is considered to be an output filename.
-
-Each input or output file can in principle contain any number of streams of
-different types (video/audio/subtitle/attachment/data). Allowed number and/or
-types of streams can be limited by the container format. Selecting, which
-streams from which inputs go into output, is done either automatically or with
-the @code{-map} option (see the Stream selection chapter).
-
-To refer to input files in options, you must use their indices (0-based). E.g.
-the first input file is @code{0}, the second is @code{1} etc. Similarly, streams
-within a file are referred to by their indices. E.g. @code{2:3} refers to the
-fourth stream in the third input file. See also the Stream specifiers chapter.
-
-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.
-Exceptions from this rule are the global options (e.g. verbosity level),
-which should be specified first.
-
-Do not mix input and output files -- first specify all input files, then all
-output files. Also do not mix options which belong to different files. All
-options apply ONLY to the next input or output file and are reset between files.
-
- at itemize
- at item
-To set the video bitrate of the output file to 64kbit/s:
- at example
-avconv -i input.avi -b 64k output.avi
- at end example
-
- at item
-To force the frame rate of the output file to 24 fps:
- at example
-avconv -i input.avi -r 24 output.avi
- at end example
-
- at item
-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
-avconv -r 1 -i input.m2v -r 24 output.avi
- at end example
- at end itemize
-
-The format option may be needed for raw input files.
-
- at c man end DESCRIPTION
-
- at chapter Detailed description
- at c man begin DETAILED DESCRIPTION
-
-The transcoding process in @command{avconv} for each output can be described by
-the following diagram:
-
- at example
- _______              ______________               _________              ______________            ________
-|       |            |              |             |         |            |              |          |        |
-| input |  demuxer   | encoded data |   decoder   | decoded |  encoder   | encoded data |  muxer   | output |
-| file  | ---------> | packets      |  ---------> | frames  | ---------> | packets      | -------> | file   |
-|_______|            |______________|             |_________|            |______________|          |________|
-
- at end example
-
- at command{avconv} calls the libavformat library (containing demuxers) to read
-input files and get packets containing encoded data from them. When there are
-multiple input files, @command{avconv} tries to keep them synchronized by
-tracking lowest timestamp on any active input stream.
-
-Encoded packets are then passed to the decoder (unless streamcopy is selected
-for the stream, see further for a description). The decoder produces
-uncompressed frames (raw video/PCM audio/...) which can be processed further by
-filtering (see next section). After filtering the frames are passed to the
-encoder, which encodes them and outputs encoded packets again. Finally those are
-passed to the muxer, which writes the encoded packets to the output file.
-
- at section Filtering
-Before encoding, @command{avconv} can process raw audio and video frames using
-filters from the libavfilter library. Several chained filters form a filter
-graph.  @command{avconv} distinguishes between two types of filtergraphs -
-simple and complex.
-
- at subsection Simple filtergraphs
-Simple filtergraphs are those that have exactly one input and output, both of
-the same type. In the above diagram they can be represented by simply inserting
-an additional step between decoding and encoding:
-
- at example
- _________                        __________              ______________
-|         |                      |          |            |              |
-| decoded |  simple filtergraph  | filtered |  encoder   | encoded data |
-| frames  | -------------------> | frames   | ---------> | packets      |
-|_________|                      |__________|            |______________|
-
- at end example
-
-Simple filtergraphs are configured with the per-stream @option{-filter} option
-(with @option{-vf} and @option{-af} aliases for video and audio respectively).
-A simple filtergraph for video can look for example like this:
-
- at example
- _______        _____________        _______        _____        ________
-|       |      |             |      |       |      |     |      |        |
-| input | ---> | deinterlace | ---> | scale | ---> | fps | ---> | output |
-|_______|      |_____________|      |_______|      |_____|      |________|
-
- at end example
-
-Note that some filters change frame properties but not frame contents. E.g. the
- at code{fps} filter in the example above changes number of frames, but does not
-touch the frame contents. Another example is the @code{setpts} filter, which
-only sets timestamps and otherwise passes the frames unchanged.
-
- at subsection Complex filtergraphs
-Complex filtergraphs are those which cannot be described as simply a linear
-processing chain applied to one stream. This is the case e.g. when the graph has
-more than one input and/or output, or when output stream type is different from
-input. They can be represented with the following diagram:
-
- at example
- _________
-|         |
-| input 0 |\                    __________
-|_________| \                  |          |
-             \   _________    /| output 0 |
-              \ |         |  / |__________|
- _________     \| complex | /
-|         |     |         |/
-| input 1 |---->| filter  |\
-|_________|     |         | \   __________
-               /| graph   |  \ |          |
-              / |         |   \| output 1 |
- _________   /  |_________|    |__________|
-|         | /
-| input 2 |/
-|_________|
-
- at end example
-
-Complex filtergraphs are configured with the @option{-filter_complex} option.
-Note that this option is global, since a complex filtergraph by its nature
-cannot be unambiguously associated with a single stream or file.
-
-A trivial example of a complex filtergraph is the @code{overlay} filter, which
-has two video inputs and one video output, containing one video overlaid on top
-of the other. Its audio counterpart is the @code{amix} filter.
-
- at section Stream copy
-Stream copy is a mode selected by supplying the @code{copy} parameter to the
- at option{-codec} option. It makes @command{avconv} omit the decoding and encoding
-step for the specified stream, so it does only demuxing and muxing. It is useful
-for changing the container format or modifying container-level metadata. The
-diagram above will in this case simplify to this:
-
- at example
- _______              ______________            ________
-|       |            |              |          |        |
-| input |  demuxer   | encoded data |  muxer   | output |
-| file  | ---------> | packets      | -------> | file   |
-|_______|            |______________|          |________|
-
- at end example
-
-Since there is no decoding or encoding, it is very fast and there is no quality
-loss. However it might not work in some cases because of many factors. Applying
-filters is obviously also impossible, since filters work on uncompressed data.
-
- at c man end DETAILED DESCRIPTION
-
- at chapter Stream selection
- at c man begin STREAM SELECTION
-
-By default avconv tries to pick the "best" stream of each type present in input
-files and add them to each output file. For video, this means the highest
-resolution, for audio the highest channel count. For subtitle it's simply the
-first subtitle stream.
-
-You can disable some of those defaults by using @code{-vn/-an/-sn} options. For
-full manual control, use the @code{-map} option, which disables the defaults just
-described.
-
- at c man end STREAM SELECTION
-
- at chapter Options
- at c man begin OPTIONS
-
- at include avtools-common-opts.texi
-
- at section Main options
-
- at table @option
-
- at item -f @var{fmt} (@emph{input/output})
-Force input or output file format. The format is normally autodetected for input
-files and guessed from file extension for output files, so this option is not
-needed in most cases.
-
- at item -i @var{filename} (@emph{input})
-input file name
-
- at item -y (@emph{global})
-Overwrite output files without asking.
-
- at item -n (@emph{global})
-Immediately exit when output files already exist.
-
- at item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
- at itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
-Select an encoder (when used before an output file) or a decoder (when used
-before an input file) for one or more streams. @var{codec} is the name of a
-decoder/encoder or a special value @code{copy} (output only) to indicate that
-the stream is not to be reencoded.
-
-For example
- at example
-avconv -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
- at end example
-encodes all video streams with libx264 and copies all audio streams.
-
-For each stream, the last matching @code{c} option is applied, so
- at example
-avconv -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
- at end example
-will copy all the streams except the second video, which will be encoded with
-libx264, and the 138th audio, which will be encoded with libvorbis.
-
- at item -t @var{duration} (@emph{output})
-Stop writing the output after its duration reaches @var{duration}.
- at var{duration} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
-
- at item -fs @var{limit_size} (@emph{output})
-Set the file size limit.
-
- at item -ss @var{position} (@emph{input/output})
-When used as an input option (before @code{-i}), seeks in this input file to
- at var{position}. Note the in most formats it is not possible to seek exactly, so
- at command{avconv} will seek to the closest seek point before @var{position}.
-When transcoding and @option{-accurate_seek} is enabled (the default), this
-extra segment between the seek point and @var{position} will be decoded and
-discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it
-will be preserved.
-
-When used as an output option (before an output filename), decodes but discards
-input until the timestamps reach @var{position}.
-
- at var{position} may be either in seconds or in @code{hh:mm:ss[.xxx]} form.
-
- at item -itsoffset @var{offset} (@emph{input})
-Set the input time offset in seconds.
- at code{[-]hh:mm:ss[.xxx]} syntax is also supported.
-The offset is added to the timestamps of the input files.
-Specifying a positive offset means that the corresponding
-streams are delayed by @var{offset} seconds.
-
- at item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
-Set a metadata key/value pair.
-
-An optional @var{metadata_specifier} may be given to set metadata
-on streams or chapters. See @code{-map_metadata} documentation for
-details.
-
-This option overrides metadata set with @code{-map_metadata}. It is
-also possible to delete metadata by using an empty value.
-
-For example, for setting the title in the output file:
- at example
-avconv -i in.avi -metadata title="my title" out.flv
- at end example
-
-To set the language of the first audio stream:
- at example
-avconv -i INPUT -metadata:s:a:0 language=eng OUTPUT
- at end example
-
- at item -target @var{type} (@emph{output})
-Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
- at code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
- at code{film-} to use the corresponding standard. All the format options
-(bitrate, codecs, buffer sizes) are then set automatically. You can just type:
-
- at example
-avconv -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
-avconv -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
- at end example
-
- at item -dframes @var{number} (@emph{output})
-Set the number of data frames to record. This is an alias for @code{-frames:d}.
-
- at item -frames[:@var{stream_specifier}] @var{framecount} (@emph{output,per-stream})
-Stop writing to the stream after @var{framecount} frames.
-
- at item -q[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
- at itemx -qscale[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
-Use fixed quality scale (VBR). The meaning of @var{q} is
-codec-dependent.
-
- at item -filter[:@var{stream_specifier}] @var{filter_graph} (@emph{output,per-stream})
- at var{filter_graph} is a description of the filter graph to apply to
-the stream. Use @code{-filters} to show all the available filters
-(including also sources and sinks).
-
-See also the @option{-filter_complex} option if you want to create filter graphs
-with multiple inputs and/or outputs.
-
- at item -filter_script[:@var{stream_specifier}] @var{filename} (@emph{output,per-stream})
-This option is similar to @option{-filter}, the only difference is that its
-argument is the name of the file from which a filtergraph description is to be
-read.
-
- at item -pre[:@var{stream_specifier}] @var{preset_name} (@emph{output,per-stream})
-Specify the preset for matching stream(s).
-
- at item -stats (@emph{global})
-Print encoding progress/statistics. On by default.
-
- at item -attach @var{filename} (@emph{output})
-Add an attachment to the output file. This is supported by a few formats
-like Matroska for e.g. fonts used in rendering subtitles. Attachments
-are implemented as a specific type of stream, so this option will add
-a new stream to the file. It is then possible to use per-stream options
-on this stream in the usual way. Attachment streams created with this
-option will be created after all the other streams (i.e. those created
-with @code{-map} or automatic mappings).
-
-Note that for Matroska you also have to set the mimetype metadata tag:
- at example
-avconv -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
- at end example
-(assuming that the attachment stream will be third in the output file).
-
- at item -dump_attachment[:@var{stream_specifier}] @var{filename} (@emph{input,per-stream})
-Extract the matching attachment stream into a file named @var{filename}. If
- at var{filename} is empty, then the value of the @code{filename} metadata tag
-will be used.
-
-E.g. to extract the first attachment to a file named 'out.ttf':
- at example
-avconv -dump_attachment:t:0 out.ttf INPUT
- at end example
-To extract all attachments to files determined by the @code{filename} tag:
- at example
-avconv -dump_attachment:t "" INPUT
- at end example
-
-Technical note -- attachments are implemented as codec extradata, so this
-option can actually be used to extract extradata from any stream, not just
-attachments.
-
- at end table
-
- at section Video Options
-
- at table @option
- at item -vframes @var{number} (@emph{output})
-Set the number of video frames to record. This is an alias for @code{-frames:v}.
- at item -r[:@var{stream_specifier}] @var{fps} (@emph{input/output,per-stream})
-Set frame rate (Hz value, fraction or abbreviation).
-
-As an input option, ignore any timestamps stored in the file and instead
-generate timestamps assuming constant frame rate @var{fps}.
-
-As an output option, duplicate or drop input frames to achieve constant output
-frame rate @var{fps} (note that this actually causes the @code{fps} filter to be
-inserted to the end of the corresponding filtergraph).
-
- at item -s[:@var{stream_specifier}] @var{size} (@emph{input/output,per-stream})
-Set frame size.
-
-As an input option, this is a shortcut for the @option{video_size} private
-option, recognized by some demuxers for which the frame size is either not
-stored in the file or is configurable -- e.g. raw video or video grabbers.
-
-As an output option, this inserts the @code{scale} video filter to the
- at emph{end} of the corresponding filtergraph. Please use the @code{scale} filter
-directly to insert it at the beginning or some other place.
-
-The format is @samp{wxh} (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{stream_specifier}] @var{aspect} (@emph{output,per-stream})
-Set the video display aspect ratio specified by @var{aspect}.
-
- at var{aspect} can be a floating point number string, or a string of the
-form @var{num}:@var{den}, where @var{num} and @var{den} are the
-numerator and denominator of the aspect ratio. For example "4:3",
-"16:9", "1.3333", and "1.7777" are valid argument values.
-
- at item -vn (@emph{output})
-Disable video recording.
-
- at item -vcodec @var{codec} (@emph{output})
-Set the video codec. This is an alias for @code{-codec:v}.
-
- at item -pass[:@var{stream_specifier}] @var{n} (@emph{output,per-stream})
-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
-avconv -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
-avconv -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
- at end example
-
- at item -passlogfile[:@var{stream_specifier}] @var{prefix} (@emph{output,per-stream})
-Set two-pass log file name prefix to @var{prefix}, the default file name
-prefix is ``av2pass''. The complete file name will be
- at file{PREFIX-N.log}, where N is a number specific to the output
-stream.
-
- at item -vf @var{filter_graph} (@emph{output})
- at var{filter_graph} is a description of the filter graph to apply to
-the input video.
-Use the option "-filters" to show all the available filters (including
-also sources and sinks).  This is an alias for @code{-filter:v}.
-
- at end table
-
- at section Advanced Video Options
-
- at table @option
- at item -pix_fmt[:@var{stream_specifier}] @var{format} (@emph{input/output,per-stream})
-Set pixel format. Use @code{-pix_fmts} to show all the supported
-pixel formats.
- at item -sws_flags @var{flags} (@emph{input/output})
-Set SwScaler flags.
- at item -vdt @var{n}
-Discard threshold.
-
- at item -rc_override[:@var{stream_specifier}] @var{override} (@emph{output,per-stream})
-rate control override for specific intervals
-
- 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{stream_specifier}] @var{n} (@emph{output,per-stream})
-top=1/bottom=0/auto=-1 field first
- at item -dc @var{precision}
-Intra_dc_precision.
- at item -vtag @var{fourcc/tag} (@emph{output})
-Force video tag/fourcc. This is an alias for @code{-tag:v}.
- at item -qphist (@emph{global})
-Show QP histogram.
- at item -force_key_frames[:@var{stream_specifier}] @var{time}[, at var{time}...] (@emph{output,per-stream})
-Force key frames at the specified timestamps, more precisely at the first
-frames after each specified time.
-This option can be useful to ensure that a seek point is present at a
-chapter mark or any other designated place in the output file.
-The timestamps must be specified in ascending order.
-
- at item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
-When doing stream copy, copy also non-key frames found at the
-beginning.
-
- at item -hwaccel[:@var{stream_specifier}] @var{hwaccel} (@emph{input,per-stream})
-Use hardware acceleration to decode the matching stream(s). The allowed values
-of @var{hwaccel} are:
- at table @option
- at item none
-Do not use any hardware acceleration (the default).
-
- at item auto
-Automatically select the hardware acceleration method.
-
- at item vdpau
-Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
- at end table
-
-This option has no effect if the selected hwaccel is not available or not
-supported by the chosen decoder.
-
-Note that most acceleration methods are intended for playback and will not be
-faster than software decoding on modern CPUs. Additionally, @command{avconv}
-will usually need to copy the decoded frames from the GPU memory into the system
-memory, resulting in further performance loss. This option is thus mainly
-useful for testing.
-
- at item -hwaccel_device[:@var{stream_specifier}] @var{hwaccel_device} (@emph{input,per-stream})
-Select a device to use for hardware acceleration.
-
-This option only makes sense when the @option{-hwaccel} option is also
-specified. Its exact meaning depends on the specific hardware acceleration
-method chosen.
-
- at table @option
- at item vdpau
-For VDPAU, this option specifies the X11 display/screen to use. If this option
-is not specified, the value of the @var{DISPLAY} environment variable is used
- at end table
- at end table
-
- at section Audio Options
-
- at table @option
- at item -aframes @var{number} (@emph{output})
-Set the number of audio frames to record. This is an alias for @code{-frames:a}.
- at item -ar[:@var{stream_specifier}] @var{freq} (@emph{input/output,per-stream})
-Set the audio sampling frequency. For output streams it is set by
-default to the frequency of the corresponding input stream. For input
-streams this option only makes sense for audio grabbing devices and raw
-demuxers and is mapped to the corresponding demuxer options.
- at item -aq @var{q} (@emph{output})
-Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
- at item -ac[:@var{stream_specifier}] @var{channels} (@emph{input/output,per-stream})
-Set the number of audio channels. For output streams it is set by
-default to the number of input audio channels. For input streams
-this option only makes sense for audio grabbing devices and raw demuxers
-and is mapped to the corresponding demuxer options.
- at item -an (@emph{output})
-Disable audio recording.
- at item -acodec @var{codec} (@emph{input/output})
-Set the audio codec. This is an alias for @code{-codec:a}.
- at item -sample_fmt[:@var{stream_specifier}] @var{sample_fmt} (@emph{output,per-stream})
-Set the audio sample format. Use @code{-sample_fmts} to get a list
-of supported sample formats.
- at item -af @var{filter_graph} (@emph{output})
- at var{filter_graph} is a description of the filter graph to apply to
-the input audio.
-Use the option "-filters" to show all the available filters (including
-also sources and sinks).  This is an alias for @code{-filter:a}.
- at end table
-
- at section Advanced Audio options:
-
- at table @option
- at item -atag @var{fourcc/tag} (@emph{output})
-Force audio tag/fourcc. This is an alias for @code{-tag:a}.
- at end table
-
- at section Subtitle options:
-
- at table @option
- at item -scodec @var{codec} (@emph{input/output})
-Set the subtitle codec. This is an alias for @code{-codec:s}.
- at item -sn (@emph{output})
-Disable subtitle recording.
- at end table
-
- at section Advanced options
-
- at table @option
- at item -map [-]@var{input_file_id}[:@var{stream_specifier}][, at var{sync_file_id}[:@var{stream_specifier}]] | @var{[linklabel]} (@emph{output})
-
-Designate one or more input streams as a source for the output file. Each input
-stream is identified by the input file index @var{input_file_id} and
-the input stream index @var{input_stream_id} within the input
-file. Both indices start at 0. If specified,
- at var{sync_file_id}:@var{stream_specifier} sets which input stream
-is used as a presentation sync reference.
-
-The first @code{-map} option on the command line specifies the
-source for output stream 0, the second @code{-map} option specifies
-the source for output stream 1, etc.
-
-A @code{-} character before the stream identifier creates a "negative" mapping.
-It disables matching streams from already created mappings.
-
-An alternative @var{[linklabel]} form will map outputs from complex filter
-graphs (see the @option{-filter_complex} option) to the output file.
- at var{linklabel} must correspond to a defined output link label in the graph.
-
-For example, to map ALL streams from the first input file to output
- at example
-avconv -i INPUT -map 0 output
- at end example
-
-For example, if you have two audio streams in the first input file,
-these streams are identified by "0:0" and "0:1". You can use
- at code{-map} to select which streams to place in an output file. For
-example:
- at example
-avconv -i INPUT -map 0:1 out.wav
- at end example
-will map the input stream in @file{INPUT} identified by "0:1" to
-the (single) output stream in @file{out.wav}.
-
-For example, to select the stream with index 2 from input file
- at file{a.mov} (specified by the identifier "0:2"), and stream with
-index 6 from input @file{b.mov} (specified by the identifier "1:6"),
-and copy them to the output file @file{out.mov}:
- at example
-avconv -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
- at end example
-
-To select all video and the third audio stream from an input file:
- at example
-avconv -i INPUT -map 0:v -map 0:a:2 OUTPUT
- at end example
-
-To map all the streams except the second audio, use negative mappings
- at example
-avconv -i INPUT -map 0 -map -0:a:1 OUTPUT
- at end example
-
-Note that using this option disables the default mappings for this output file.
-
- at item -map_metadata[:@var{metadata_spec_out}] @var{infile}[:@var{metadata_spec_in}] (@emph{output,per-metadata})
-Set metadata information of the next output file from @var{infile}. Note that
-those are file indices (zero-based), not filenames.
-Optional @var{metadata_spec_in/out} parameters specify, which metadata to copy.
-A metadata specifier can have the following forms:
- at table @option
- at item @var{g}
-global metadata, i.e. metadata that applies to the whole file
-
- at item @var{s}[:@var{stream_spec}]
-per-stream metadata. @var{stream_spec} is a stream specifier as described
-in the @ref{Stream specifiers} chapter. In an input metadata specifier, the first
-matching stream is copied from. In an output metadata specifier, all matching
-streams are copied to.
-
- at item @var{c}:@var{chapter_index}
-per-chapter metadata. @var{chapter_index} is the zero-based chapter index.
-
- at item @var{p}:@var{program_index}
-per-program metadata. @var{program_index} is the zero-based program index.
- at end table
-If metadata specifier is omitted, it defaults to global.
-
-By default, global metadata is copied from the first input file,
-per-stream and per-chapter metadata is copied along with streams/chapters. These
-default mappings are disabled by creating any mapping of the relevant type. A negative
-file index can be used to create a dummy mapping that just disables automatic copying.
-
-For example to copy metadata from the first stream of the input file to global metadata
-of the output file:
- at example
-avconv -i in.ogg -map_metadata 0:s:0 out.mp3
- at end example
-
-To do the reverse, i.e. copy global metadata to all audio streams:
- at example
-avconv -i in.mkv -map_metadata:s:a 0:g out.mkv
- at end example
-Note that simple @code{0} would work as well in this example, since global
-metadata is assumed by default.
-
- at item -map_chapters @var{input_file_index} (@emph{output})
-Copy chapters from input file with index @var{input_file_index} to the next
-output file. If no chapter mapping is specified, then chapters are copied from
-the first input file with at least one chapter. Use a negative file index to
-disable any chapter copying.
- at item -debug
-Print specific debug info.
- at item -benchmark (@emph{global})
-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 -timelimit @var{duration} (@emph{global})
-Exit after avconv has been running for @var{duration} seconds.
- at item -dump (@emph{global})
-Dump each input packet to stderr.
- at item -hex (@emph{global})
-When dumping packets, also dump the payload.
- at item -re (@emph{input})
-Read input at native frame rate. Mainly used to simulate a grab device
-or live input stream (e.g. when reading from a file). Should not be used
-with actual grab devices or live input streams (where it can cause packet
-loss).
- at item -vsync @var{parameter}
-Video sync method.
-
- at table @option
- at item passthrough
-Each frame is passed with its timestamp from the demuxer to the muxer.
- at item cfr
-Frames will be duplicated and dropped to achieve exactly the requested
-constant framerate.
- at item vfr
-Frames are passed through with their timestamp or dropped so as to
-prevent 2 frames from having the same timestamp.
- at item auto
-Chooses between 1 and 2 depending on muxer capabilities. This is the
-default method.
- at end table
-
-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.
-This option has been deprecated. Use the @code{asyncts} audio filter instead.
- at item -copyts
-Copy timestamps from input to output.
- at item -copytb
-Copy input stream time base from input to output when stream copying.
- at item -shortest (@emph{output})
-Finish encoding when the shortest input stream ends.
- at item -dts_delta_threshold
-Timestamp discontinuity delta threshold.
- at item -muxdelay @var{seconds} (@emph{input})
-Set the maximum demux-decode delay.
- at item -muxpreload @var{seconds} (@emph{input})
-Set the initial demux-decode delay.
- at item -streamid @var{output-stream-index}:@var{new-value} (@emph{output})
-Assign a new stream-id value to an output stream. This option should be
-specified prior to the output filename to which it applies.
-For the situation where multiple output files exist, a streamid
-may be reassigned to a different value.
-
-For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
-an output mpegts file:
- at example
-avconv -i infile -streamid 0:33 -streamid 1:36 out.ts
- at end example
-
- at item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream})
-Set bitstream filters for matching streams. @var{bistream_filters} is
-a comma-separated list of bitstream filters. Use the @code{-bsfs} option
-to get the list of bitstream filters.
- at example
-avconv -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
- at end example
- at example
-avconv -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
- at end example
-
- at item -tag[:@var{stream_specifier}] @var{codec_tag} (@emph{output,per-stream})
-Force a tag/fourcc for matching streams.
-
- at item -filter_complex @var{filtergraph} (@emph{global})
-Define a complex filter graph, i.e. one with arbitrary number of inputs and/or
-outputs. For simple graphs -- those with one input and one output of the same
-type -- see the @option{-filter} options. @var{filtergraph} is a description of
-the filter graph, as described in @ref{Filtergraph syntax}.
-
-Input link labels must refer to input streams using the
- at code{[file_index:stream_specifier]} syntax (i.e. the same as @option{-map}
-uses). If @var{stream_specifier} matches multiple streams, the first one will be
-used. An unlabeled input will be connected to the first unused input stream of
-the matching type.
-
-Output link labels are referred to with @option{-map}. Unlabeled outputs are
-added to the first output file.
-
-Note that with this option it is possible to use only lavfi sources without
-normal input files.
-
-For example, to overlay an image over video
- at example
-avconv -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
-'[out]' out.mkv
- at end example
-Here @code{[0:v]} refers to the first video stream in the first input file,
-which is linked to the first (main) input of the overlay filter. Similarly the
-first video stream in the second input is linked to the second (overlay) input
-of overlay.
-
-Assuming there is only one video stream in each input file, we can omit input
-labels, so the above is equivalent to
- at example
-avconv -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
-'[out]' out.mkv
- at end example
-
-Furthermore we can omit the output label and the single output from the filter
-graph will be added to the output file automatically, so we can simply write
- at example
-avconv -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
- at end example
-
-To generate 5 seconds of pure red video using lavfi @code{color} source:
- at example
-avconv -filter_complex 'color=red' -t 5 out.mkv
- at end example
-
- at item -filter_complex_script @var{filename} (@emph{global})
-This option is similar to @option{-filter_complex}, the only difference is that
-its argument is the name of the file from which a complex filtergraph
-description is to be read.
-
- at item -accurate_seek (@emph{input})
-This option enables or disables accurate seeking in input files with the
- at option{-ss} option. It is enabled by default, so seeking is accurate when
-transcoding. Use @option{-noaccurate_seek} to disable it, which may be useful
-e.g. when copying some streams and transcoding the others.
-
- at end table
- at c man end OPTIONS
-
- at chapter Tips
- at c man begin 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
-avconv -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 '-g 0' 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 end itemize
- at c man end TIPS
-
- at chapter Examples
- at c man begin EXAMPLES
-
- at section Preset files
-
-A preset file contains a sequence of @var{option=value} pairs, one for
-each line, specifying a sequence of options which can be specified also on
-the command line. Lines starting with the hash ('#') character are ignored and
-are used to provide comments. Empty lines are also ignored. Check the
- at file{presets} directory in the Libav source tree for examples.
-
-Preset files are specified with the @code{pre} option, this option takes a
-preset name as input.  Avconv searches for a file named @var{preset_name}.avpreset in
-the directories @file{$AVCONV_DATADIR} (if set), and @file{$HOME/.avconv}, and in
-the data directory defined at configuration time (usually @file{$PREFIX/share/avconv})
-in that order.  For example, if the argument is @code{libx264-max}, it will
-search for the file @file{libx264-max.avpreset}.
-
- at section Video and Audio grabbing
-
-If you specify the input format and device then avconv can grab video
-and audio directly.
-
- at example
-avconv -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 avconv with any TV viewer such as
- at uref{http://linux.bytesex.org/xawtv/, xawtv} by Gerd Knorr. You also
-have to set the audio recording levels correctly with a
-standard mixer.
-
- at section X11 grabbing
-
-Grab the X11 display with avconv via
-
- at example
-avconv -f x11grab -s cif -r 25 -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
-avconv -f x11grab -s cif -r 25 -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
-
-Any supported file format and protocol can serve as input to avconv:
-
-Examples:
- at itemize
- at item
-You can use YUV files as input:
-
- at example
-avconv -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 avconv cannot guess it.
-
- at item
-You can input from a raw YUV420P file:
-
- at example
-avconv -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.
-
- at item
-You can output to a raw YUV420P file:
-
- at example
-avconv -i mydivx.avi hugefile.yuv
- at end example
-
- at item
-You can set several input files and output files:
-
- at example
-avconv -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.
-
- at item
-You can also do audio and video conversions at the same time:
-
- at example
-avconv -i /tmp/a.wav -ar 22050 /tmp/a.mp2
- at end example
-
-Converts a.wav to MPEG audio at 22050 Hz sample rate.
-
- at item
-You can encode to several formats at the same time and define a
-mapping from input stream to output streams:
-
- at example
-avconv -i /tmp/a.wav -map 0:a -b 64k /tmp/a.mp2 -map 0:a -b 128k /tmp/b.mp2
- 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.
-
- at item
-You can transcode decrypted VOBs:
-
- at example
-avconv -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 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{avconv -formats}.
-
- at item
-You can extract images from a video, or create a video from many images:
-
-For extracting images from a video:
- at example
-avconv -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
-avconv -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.
-
- at item
-You can put many streams of the same type in the output:
-
- at example
-avconv -i test1.avi -i test2.avi -map 0.3 -map 0.2 -map 0.1 -map 0.0 -c copy test12.nut
- at end example
-
-The resulting output file @file{test12.avi} will contain first four streams from
-the input file in reverse order.
-
- at item
-To force CBR video output:
- at example
-avconv -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
- at end example
-
- at item
-The four options lmin, lmax, mblmin and mblmax use 'lambda' units,
-but you may use the QP2LAMBDA constant to easily convert from 'q' units:
- at example
-avconv -i src.ext -lmax 21*QP2LAMBDA dst.ext
- at end example
-
- at end itemize
- at c man end EXAMPLES
-
- at include eval.texi
- at include decoders.texi
- at include encoders.texi
- at include demuxers.texi
- at include muxers.texi
- at include indevs.texi
- at include outdevs.texi
- at include protocols.texi
- at include bitstream_filters.texi
- at include filters.texi
- at include metadata.texi
-
- at ignore
-
- at setfilename avconv
- at settitle avconv video converter
-
- at c man begin SEEALSO
-avplay(1), avprobe(1) and the Libav HTML documentation
- at c man end
-
- at c man begin AUTHORS
-The Libav developers
- at c man end
-
- at end ignore
-
- at bye
diff --git a/deps/libav/doc/avplay.texi b/deps/libav/doc/avplay.texi
deleted file mode 100644
index 71981f6..0000000
--- a/deps/libav/doc/avplay.texi
+++ /dev/null
@@ -1,184 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle avplay Documentation
- at titlepage
- at center @titlefont{avplay Documentation}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter Synopsis
-
- at example
- at c man begin SYNOPSIS
-avplay [options] @file{input_file}
- at c man end
- at end example
-
- at chapter Description
- at c man begin DESCRIPTION
-
-AVplay is a very simple and portable media player using the Libav
-libraries and the SDL library. It is mostly used as a testbed for the
-various Libav APIs.
- at c man end
-
- at chapter Options
- at c man begin OPTIONS
-
- at include avtools-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}
-This option has been removed. Use private format options for specifying the
-input video size.  For example with the rawvideo demuxer you need to specify the
-option @var{video_size}.
- 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 item -vf @var{filter_graph}
- at var{filter_graph} is a description of the filter graph to apply to
-the input video.
-Use the option "-filters" to show all the available filters (including
-also sources and sinks).
-
- at end table
-
- at section Advanced options
- at table @option
- at item -pix_fmt @var{format}
-This option has been removed. Use private options for specifying the
-input pixel format. For example with the rawvideo demuxer you need to specify
-the option @var{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 -bug
-Work around bugs.
- 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 item -autoexit
-Exit when video is done playing.
- at item -exitonkeydown
-Exit if any key is pressed.
- at item -exitonmousedown
-Exit if any mouse button is pressed.
- 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 PGDOWN/PGUP
-Seek to the previous/next chapter.
-
- at item mouse click
-Seek to percentage in file corresponding to fraction of width.
-
- at end table
-
- at c man end
-
- at include eval.texi
- at include decoders.texi
- at include demuxers.texi
- at include muxers.texi
- at include indevs.texi
- at include outdevs.texi
- at include protocols.texi
- at include filters.texi
-
- at ignore
-
- at setfilename avplay
- at settitle AVplay media player
-
- at c man begin SEEALSO
-avconv(1), avprobe(1) and the Libav HTML documentation
- at c man end
-
- at c man begin AUTHORS
-The Libav developers
- at c man end
-
- at end ignore
-
- at bye
diff --git a/deps/libav/doc/avprobe.texi b/deps/libav/doc/avprobe.texi
deleted file mode 100644
index 7e6fedf..0000000
--- a/deps/libav/doc/avprobe.texi
+++ /dev/null
@@ -1,141 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle avprobe Documentation
- at titlepage
- at center @titlefont{avprobe Documentation}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter Synopsis
-
-The generic syntax is:
-
- at example
- at c man begin SYNOPSIS
-avprobe [options] [@file{input_file}]
- at c man end
- at end example
-
- at chapter Description
- at c man begin DESCRIPTION
-
-avprobe 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, avprobe 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.
-
-avprobe 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 avprobe or
-for specifying which information to display, and for setting how
-avprobe will show it.
-
-avprobe output is designed to be easily parsable by any INI or JSON
-parsers.
-
- at c man end
-
- at chapter Options
- at c man begin OPTIONS
-
- at include avtools-common-opts.texi
-
- at section Main options
-
- at table @option
-
- at item -f @var{format}
-Force format to use.
-
- at item -of @var{formatter}
-Use a specific formatter to output the document. The following
-formatters are available
- at table @option
- at item ini
-
- at item json
-
- at item old
-Pseudo-INI format that used to be the only one available in old
-avprobe versions.
- at end table
-
- at item -unit
-Show the unit of the displayed values.
-
- at item -prefix
-Use SI prefixes for the displayed values.
-Unless the "-byte_binary_prefix" option is used all the prefixes
-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_format_entry @var{name}
-Like @option{-show_format}, but only prints the specified entry of the
-container format information, rather than all. This option may be given more
-than once, then all specified entries will be shown.
-
- at item -show_packets
-Show information about each packet contained in the input multimedia
-stream.
-
-The information for each single packet is printed within a dedicated
-section with name "PACKET".
-
- 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 include demuxers.texi
- at include muxers.texi
- at include protocols.texi
- at include indevs.texi
-
- at ignore
-
- at setfilename avprobe
- at settitle avprobe media prober
-
- at c man begin SEEALSO
-avconv(1), avplay(1) and the Libav HTML documentation
- at c man end
-
- at c man begin AUTHORS
-The Libav developers
- at c man end
-
- at end ignore
-
- at bye
diff --git a/deps/libav/doc/avserver.conf b/deps/libav/doc/avserver.conf
deleted file mode 100644
index e1cd9fb..0000000
--- a/deps/libav/doc/avserver.conf
+++ /dev/null
@@ -1,372 +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 AVServer
-# 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 -
-
-
-##################################################################
-# Definition of the live feeds. Each live feed contains one video
-# and/or audio sequence coming from an avconv encoder or another
-# avserver. This sequence may be encoded simultaneously with several
-# codecs at several resolutions.
-
-<Feed feed1.ffm>
-
-# You must use 'avconv' to send a live feed to avserver. In this
-# example, you can type:
-#
-# avconv http://localhost:8090/feed1.ffm
-
-# avserver 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 avconv automatically.
-# First avconv must be defined with an appropriate path if needed,
-# after that options can follow, but avoid adding the http:// field
-#Launch avconv
-
-# 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'). AVServer 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>
-
-
-# Transcode an incoming live feed to another live feed,
-# using libx264 and video presets
-
-#<Stream live.h264>
-#Format rtp
-#Feed feed1.ffm
-#VideoCodec libx264
-#VideoFrameRate 24
-#VideoBitRate 100
-#VideoSize 480x272
-#AVPresetVideo default
-#AVPresetVideo baseline
-#AVOptionVideo flags +global_header
-#
-#AudioCodec libfaac
-#AudioBitRate 32
-#AudioChannels 2
-#AudioSampleRate 22050
-#AVOptionAudio flags +global_header
-#</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 avserver 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.libav.org/
-</Redirect>
diff --git a/deps/libav/doc/avserver.texi b/deps/libav/doc/avserver.texi
deleted file mode 100644
index 88e6221..0000000
--- a/deps/libav/doc/avserver.texi
+++ /dev/null
@@ -1,276 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle avserver Documentation
- at titlepage
- at center @titlefont{avserver Documentation}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter Synopsys
-
-The generic syntax is:
-
- at example
- at c man begin SYNOPSIS
-avserver [options]
- at c man end
- at end example
-
- at chapter Description
- at c man begin DESCRIPTION
-
-WARNING: avserver is unmaintained, largely broken and in need of a
-complete rewrite. It probably won't work for you. Use at your own
-risk.
-
-avserver 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 avserver.conf).
-
-This documentation covers only the streaming aspects of avserver /
-avconv. All questions about parameters for avconv, codec questions,
-etc. are not covered here. Read @file{avconv.html} for more
-information.
-
- at section How does it work?
-
-avserver receives prerecorded files or FFM streams from some avconv
-instance as input, then streams them over RTP/RTSP/HTTP.
-
-An avserver instance will listen on some port as specified in the
-configuration file. You can launch one or more instances of avconv and
-send one or more FFM streams to the port where avserver is expecting
-to receive them. Alternately, you can make avserver launch such avconv
-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
-
-avserver 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 avserver ./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 avconv:
-
- at example
-./avserver -f doc/avserver.conf &
-./avconv -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 avserver.conf file to suit your needs (in terms of
-frame rates etc). Then install avserver and avconv, 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 avconv 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 avconv.
-
- at subsection The audio and video lose 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
-avserver parameters must match the original parameters used to record the
-file. If they do not, then avserver 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
-avserver.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, avserver (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 avserver.conf that will
-add the 15 second prebuffering on all requests that do not otherwise
-specify a time. In addition, avserver 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 avserver.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 avserver, 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 Options
- at c man begin OPTIONS
-
- at include avtools-common-opts.texi
-
- at section Main options
-
- at table @option
- at item -f @var{configfile}
-Use @file{configfile} instead of @file{/etc/avserver.conf}.
- at item -n
-Enable no-launch mode. This option disables all the Launch directives
-within the various <Stream> sections. Since avserver will not launch
-any avconv instances, you will have to launch them manually.
- at item -d
-Enable debug mode. This option increases log verbosity, directs log
-messages to stdout.
- at end table
- at c man end
-
- at ignore
-
- at setfilename avserver
- at settitle avserver video server
-
- at c man begin SEEALSO
-
-avconv(1), avplay(1), avprobe(1), the @file{avserver.conf}
-example and the Libav HTML documentation
- at c man end
-
- at c man begin AUTHORS
-The Libav developers
- at c man end
-
- at end ignore
-
- at bye
diff --git a/deps/libav/doc/avtools-common-opts.texi b/deps/libav/doc/avtools-common-opts.texi
deleted file mode 100644
index 156319e..0000000
--- a/deps/libav/doc/avtools-common-opts.texi
+++ /dev/null
@@ -1,184 +0,0 @@
-All the numerical options, if not specified otherwise, accept in input
-a string representing a number, which may contain one of the
-SI unit prefixes, for example 'K', 'M', 'G'.
-If 'i' is appended after the prefix, binary prefixes are used,
-which are based on powers of 1024 instead of powers of 1000.
-The 'B' postfix multiplies the value by 8, and can be
-appended after a unit prefix or used alone. This allows using for
-example 'KB', 'MiB', 'G' and 'B' as number postfix.
-
-Options which do not take arguments are boolean options, and set the
-corresponding value to true. They can be set to false by prefixing
-with "no" the option name, for example using "-nofoo" in the
-command line will set to false the boolean option with name "foo".
-
- at anchor{Stream specifiers}
- at section Stream specifiers
-Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
-are used to precisely specify which stream(s) does a given option belong to.
-
-A stream specifier is a string generally appended to the option name and
-separated from it by a colon. E.g. @code{-codec:a:1 ac3} option contains
- at code{a:1} stream specifer, which matches the second audio stream. Therefore it
-would select the ac3 codec for the second audio stream.
-
-A stream specifier can match several stream, the option is then applied to all
-of them. E.g. the stream specifier in @code{-b:a 128k} matches all audio
-streams.
-
-An empty stream specifier matches all streams, for example @code{-codec copy}
-or @code{-codec: copy} would copy all the streams without reencoding.
-
-Possible forms of stream specifiers are:
- at table @option
- at item @var{stream_index}
-Matches the stream with this index. E.g. @code{-threads:1 4} would set the
-thread count for the second stream to 4.
- at item @var{stream_type}[:@var{stream_index}]
- at var{stream_type} is one of: 'v' for video, 'a' for audio, 's' for subtitle,
-'d' for data and 't' for attachments. If @var{stream_index} is given, then
-matches stream number @var{stream_index} of this type. Otherwise matches all
-streams of this type.
- at item p:@var{program_id}[:@var{stream_index}]
-If @var{stream_index} is given, then matches stream number @var{stream_index} in
-program with id @var{program_id}. Otherwise matches all streams in this program.
- at end table
- at section Generic options
-
-These options are shared amongst the av* tools.
-
- at table @option
-
- at item -L
-Show license.
-
- at item -h, -?, -help, --help [@var{arg}]
-Show help. An optional parameter may be specified to print help about a specific
-item.
-
-Possible values of @var{arg} are:
- at table @option
- at item decoder=@var{decoder_name}
-Print detailed information about the decoder named @var{decoder_name}. Use the
- at option{-decoders} option to get a list of all decoders.
-
- at item encoder=@var{encoder_name}
-Print detailed information about the encoder named @var{encoder_name}. Use the
- at option{-encoders} option to get a list of all encoders.
-
- at item demuxer=@var{demuxer_name}
-Print detailed information about the demuxer named @var{demuxer_name}. Use the
- at option{-formats} option to get a list of all demuxers and muxers.
-
- at item muxer=@var{muxer_name}
-Print detailed information about the muxer named @var{muxer_name}. Use the
- at option{-formats} option to get a list of all muxers and demuxers.
-
- at item filter=@var{filter_name}
-Print detailed information about the filter name @var{filter_name}. Use the
- at option{-filters} option to get a list of all filters.
-
- at end table
-
- 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 all codecs known to libavcodec.
-
-Note that the term 'codec' is used throughout this documentation as a shortcut
-for what is more correctly called a media bitstream format.
-
- at item -decoders
-Show available decoders.
-
- at item -encoders
-Show all available encoders.
-
- 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 -sample_fmts
-Show available sample formats.
-
- at item -loglevel @var{loglevel} | -v @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
-
-By default the program logs to stderr, if coloring is supported by the
-terminal, colors are used to mark errors and warnings. Log coloring
-can be disabled setting the environment variable
- at env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
-the environment variable @env{AV_LOG_FORCE_COLOR}.
-The use of the environment variable @env{NO_COLOR} is deprecated and
-will be dropped in a following Libav version.
-
- at item -cpuflags mask (@emph{global})
-Set a mask that's applied to autodetected CPU flags. This option is intended
-for testing. Do not use it unless you know what you're doing.
-
- at end table
-
- at section AVOptions
-
-These options are provided directly by the libavformat, libavdevice and
-libavcodec libraries. To see the list of available AVOptions, use the
- at option{-help} option. They are separated into two categories:
- at table @option
- at item generic
-These options can be set for any container, codec or device. Generic options
-are listed under AVFormatContext options for containers/devices and under
-AVCodecContext options for codecs.
- at item private
-These options are specific to the given container, device or codec. Private
-options are listed under their corresponding containers/devices/codecs.
- at end table
-
-For example to write an ID3v2.3 header instead of a default ID3v2.4 to
-an MP3 file, use the @option{id3v2_version} private option of the MP3
-muxer:
- at example
-avconv -i input.flac -id3v2_version 3 out.mp3
- at end example
-
-All codec AVOptions are obviously per-stream, so the chapter on stream
-specifiers applies to them
-
-Note @option{-nooption} syntax cannot be used for boolean AVOptions,
-use @option{-option 0}/@option{-option 1}.
-
-Note2 old undocumented way of specifying per-stream AVOptions by prepending
-v/a/s to the options name is now obsolete and will be removed soon.
-
- at include avoptions_codec.texi
- at include avoptions_format.texi
diff --git a/deps/libav/doc/avutil.txt b/deps/libav/doc/avutil.txt
deleted file mode 100644
index 0847683..0000000
--- a/deps/libav/doc/avutil.txt
+++ /dev/null
@@ -1,36 +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
-
-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/deps/libav/doc/bitstream_filters.texi b/deps/libav/doc/bitstream_filters.texi
deleted file mode 100644
index 6e7f878..0000000
--- a/deps/libav/doc/bitstream_filters.texi
+++ /dev/null
@@ -1,77 +0,0 @@
- at chapter Bitstream Filters
- at c man begin BITSTREAM FILTERS
-
-When you configure your Libav build, all the supported bitstream
-filters are enabled by default. You can list all available ones using
-the configure option @code{--list-bsfs}.
-
-You can disable all the bitstream filters using the configure option
- at code{--disable-bsfs}, and selectively enable any bitstream filter using
-the option @code{--enable-bsf=BSF}, or you can disable a particular
-bitstream filter using the option @code{--disable-bsf=BSF}.
-
-The option @code{-bsfs} of the av* tools will display the list of
-all the supported bitstream filters included in your build.
-
-Below is a description of the currently available bitstream filters.
-
- at section aac_adtstoasc
-
- at section chomp
-
- at section dump_extradata
-
- at section h264_mp4toannexb
-
- at section imx_dump_header
-
- at section mjpeg2jpeg
-
-Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
-
-MJPEG is a video codec wherein each video frame is essentially a
-JPEG image. The individual frames can be extracted without loss,
-e.g. by
-
- at example
-avconv -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
- at end example
-
-Unfortunately, these chunks are incomplete JPEG images, because
-they lack the DHT segment required for decoding. Quoting from
- at url{http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml}:
-
-Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
-commented that "MJPEG, or at least the MJPEG in AVIs having the
-MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
-Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
-and it must use basic Huffman encoding, not arithmetic or
-progressive. . . . You can indeed extract the MJPEG frames and
-decode them with a regular JPEG decoder, but you have to prepend
-the DHT segment to them, or else the decoder won't have any idea
-how to decompress the data. The exact table necessary is given in
-the OpenDML spec."
-
-This bitstream filter patches the header of frames extracted from an MJPEG
-stream (carrying the AVI1 header ID and lacking a DHT segment) to
-produce fully qualified JPEG images.
-
- at example
-avconv -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
-exiftran -i -9 frame*.jpg
-avconv -i frame_%d.jpg -c:v copy rotated.avi
- at end example
-
- at section mjpega_dump_header
-
- at section movsub
-
- at section mp3_header_compress
-
- at section mp3_header_decompress
-
- at section noise
-
- at section remove_extradata
-
- at c man end BITSTREAM FILTERS
diff --git a/deps/libav/doc/build_system.txt b/deps/libav/doc/build_system.txt
deleted file mode 100644
index c3dede7..0000000
--- a/deps/libav/doc/build_system.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Libav currently uses a custom build system, this text attempts to document
-some of its obscure features and options.
-
-Makefile variables:
-
-V
-    Disable the default terse mode, the full command issued by make and its
-    output will be shown on the screen.
-
-DESTDIR
-    Destination directory for the install targets, useful to prepare packages
-    or install Libav in cross-environments.
-
-Makefile targets:
-
-all
-    Default target, builds all the libraries and the executables.
-
-install
-    Install headers, libraries and programs.
-
-libavformat/output-example
-    Build the libavformat basic example.
-
-libavcodec/api-example
-    Build the libavcodec basic example.
-
-libswscale/swscale-test
-    Build the swscale self-test (useful also as example).
diff --git a/deps/libav/doc/decoders.texi b/deps/libav/doc/decoders.texi
deleted file mode 100644
index c3573a6..0000000
--- a/deps/libav/doc/decoders.texi
+++ /dev/null
@@ -1,56 +0,0 @@
- at chapter Decoders
- at c man begin DECODERS
-
-Decoders are configured elements in Libav which allow the decoding of
-multimedia streams.
-
-When you configure your Libav build, all the supported native decoders
-are enabled by default. Decoders requiring an external library must be enabled
-manually via the corresponding @code{--enable-lib} option. You can list all
-available decoders using the configure option @code{--list-decoders}.
-
-You can disable all the decoders with the configure option
- at code{--disable-decoders} and selectively enable / disable single decoders
-with the options @code{--enable-decoder=@var{DECODER}} /
- at code{--disable-decoder=@var{DECODER}}.
-
-The option @code{-decoders} of the av* tools will display the list of
-enabled decoders.
-
- at c man end DECODERS
-
- at chapter Audio Decoders
- at c man begin AUDIO DECODERS
-
-A description of some of the currently available audio decoders
-follows.
-
- at section ac3
-
-AC-3 audio decoder.
-
-This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
-the undocumented RealAudio 3 (a.k.a. dnet).
-
- at subsubsection AC-3 Decoder Options
-
- at table @option
-
- at item -drc_scale @var{value}
-Dynamic Range Scale Factor. The factor to apply to dynamic range values
-from the AC-3 stream. This factor is applied exponentially.
-There are 3 notable scale factor ranges:
- at table @option
- at item drc_scale == 0
-DRC disabled. Produces full range audio.
- at item 0 < drc_scale <= 1
-DRC enabled.  Applies a fraction of the stream DRC value.
-Audio reproduction is between full range and full compression.
- at item drc_scale > 1
-DRC enabled. Applies drc_scale asymmetrically.
-Loud sounds are fully compressed.  Soft sounds are enhanced.
- at end table
-
- at end table
-
- at c man end AUDIO DECODERS
diff --git a/deps/libav/doc/demuxers.texi b/deps/libav/doc/demuxers.texi
deleted file mode 100644
index 2f2f464..0000000
--- a/deps/libav/doc/demuxers.texi
+++ /dev/null
@@ -1,113 +0,0 @@
- at chapter Demuxers
- at c man begin DEMUXERS
-
-Demuxers are configured elements in Libav which allow to read the
-multimedia streams from a particular type of file.
-
-When you configure your Libav build, all the supported demuxers
-are enabled by default. You can list all available ones using the
-configure option "--list-demuxers".
-
-You can disable all the demuxers using the configure option
-"--disable-demuxers", and selectively enable a single demuxer with
-the option "--enable-demuxer=@var{DEMUXER}", or disable it
-with the option "--disable-demuxer=@var{DEMUXER}".
-
-The option "-formats" of the av* tools will display the list of
-enabled demuxers.
-
-The description of some of the currently available demuxers follows.
-
- at section image2
-
-Image file demuxer.
-
-This demuxer reads from a list of image files specified by a pattern.
-
-The pattern may contain the string "%d" or "%0 at var{N}d", which
-specifies the position of the characters representing a sequential
-number in each filename matched by the pattern. If the form
-"%d0 at var{N}d" is used, the string representing the number in each
-filename is 0-padded and @var{N} is the total number of 0-padded
-digits representing the number. The literal character '%' can be
-specified in the pattern with the string "%%".
-
-If the pattern contains "%d" or "%0 at var{N}d", the first filename of
-the file list specified by the pattern must contain a number
-inclusively contained between 0 and 4, all the following numbers must
-be sequential. This limitation may be hopefully fixed.
-
-The pattern may contain a suffix which is used to automatically
-determine the format of the images contained in the files.
-
-For example the pattern "img-%03d.bmp" will match a sequence of
-filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ...,
- at file{img-010.bmp}, etc.; the pattern "i%%m%%g-%d.jpg" will match a
-sequence of filenames of the form @file{i%m%g-1.jpg},
- at file{i%m%g-2.jpg}, ..., @file{i%m%g-10.jpg}, etc.
-
-The size, the pixel format, and the format of each image must be the
-same for all the files in the sequence.
-
-The following example shows how to use @command{avconv} for creating a
-video from the images in the file sequence @file{img-001.jpeg},
- at file{img-002.jpeg}, ..., assuming an input framerate of 10 frames per
-second:
- at example
-avconv -i 'img-%03d.jpeg' -r 10 out.mkv
- at end example
-
-Note that the pattern must not necessarily contain "%d" or
-"%0 at var{N}d", for example to convert a single image file
- at file{img.jpeg} you can employ the command:
- at example
-avconv -i img.jpeg img.png
- at end example
-
- at table @option
- at item -pixel_format @var{format}
-Set the pixel format (for raw image)
- at item -video_size   @var{size}
-Set the frame size (for raw image)
- at item -framerate    @var{rate}
-Set the frame rate
- at item -loop         @var{bool}
-Loop over the images
- at item -start_number @var{start}
-Specify the first number in the sequence
- at end table
-
- at section applehttp
-
-Apple HTTP Live Streaming demuxer.
-
-This demuxer presents all AVStreams from all variant streams.
-The id field is set to the bitrate variant index number. By setting
-the discard flags on AVStreams (by pressing 'a' or 'v' in avplay),
-the caller can decide which variant streams to actually receive.
-The total bitrate of the variant that the stream belongs to is
-available in a metadata key named "variant_bitrate".
-
- at section flv
-
-Adobe Flash Video Format demuxer.
-
-This demuxer is used to demux FLV files and RTMP network streams.
-
- at table @option
- at item -flv_metadata @var{bool}
-Allocate the streams according to the onMetaData array content.
- at end table
-
- at section asf
-
-Advanced Systems Format demuxer.
-
-This demuxer is used to demux ASF files and MMS network streams.
-
- at table @option
- at item -no_resync_search @var{bool}
-Do not try to resynchronize by looking for a certain optional start code.
- at end table
-
- at c man end INPUT DEVICES
diff --git a/deps/libav/doc/developer.texi b/deps/libav/doc/developer.texi
deleted file mode 100644
index 1ffdff1..0000000
--- a/deps/libav/doc/developer.texi
+++ /dev/null
@@ -1,784 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle Developer Documentation
- at titlepage
- at center @titlefont{Developer Documentation}
- at end titlepage
-
- at top
-
- at contents
-
- 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{avplay.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 libav in your program
-
-Shared libraries should be used whenever is possible in order to reduce
-the effort distributors have to pour to support programs and to ensure
-only the public API is used.
-
-You can use Libav in your commercial program, but you must abide to the
-license, LGPL or GPL depending on the specific features used, please refer
-to @uref{http://libav.org/legal.html, our legal page} for a quick checklist and to
-the following links for the exact text of each license:
- at uref{http://git.libav.org/?p=libav.git;a=blob;f=COPYING.GPLv2, GPL version 2},
- at uref{http://git.libav.org/?p=libav.git;a=blob;f=COPYING.GPLv3, GPL version 3},
- at uref{http://git.libav.org/?p=libav.git;a=blob;f=COPYING.LGPLv2.1, LGPL version 2.1},
- at uref{http://git.libav.org/?p=libav.git;a=blob;f=COPYING.LGPLv3, LGPL version 3}.
-Any modification to the source code can be suggested for inclusion.
-The best way to proceed is to send your patches to the
- at uref{https://lists.libav.org/mailman/listinfo/libav-devel, libav-devel}
-mailing list.
-
- at anchor{Coding Rules}
- at section Coding Rules
-
- at subsection Code formatting conventions
-The code is written in K&R C style. That means the following:
-
- at itemize @bullet
- at item
-The control statements are formatted by putting space between the statement
-and parenthesis in the following way:
- at example
-for (i = 0; i < filter->input_count; i++) @{
- at end example
-
- at item
-The case statement is always located at the same level as the switch itself:
- at example
-switch (link->init_state) @{
-case AVLINK_INIT:
-    continue;
-case AVLINK_STARTINIT:
-    av_log(filter, AV_LOG_INFO, "circular filter chain detected");
-    return 0;
- at end example
-
- at item
-Braces in function declarations are written on the new line:
- at example
-const char *avfilter_configuration(void)
-@{
-    return LIBAV_CONFIGURATION;
-@}
- at end example
-
- at item
-Do not check for NULL values by comparison, @samp{if (p)} and
- at samp{if (!p)} are correct; @samp{if (p == NULL)} and @samp{if (p != NULL)}
-are not.
-
- at item
-In case of a single-statement if, no curly braces are required:
- at example
-if (!pic || !picref)
-    goto fail;
- at end example
-
- at item
-Do not put spaces immediately inside parentheses. @samp{if (ret)} is
-a valid style; @samp{if ( ret )} is not.
- at end itemize
-
-There are the following guidelines regarding the indentation in files:
-
- at itemize @bullet
- at item
-Indent size is 4.
-
- at item
-The TAB character is forbidden outside of Makefiles as is any
-form of trailing whitespace. Commits containing either will be
-rejected by the git repository.
-
- at item
-You should try to limit your code lines to 80 characters; however, do so if
-and only if this improves readability.
- at end itemize
-The presentation is one inspired by 'indent -i4 -kr -nut'.
-
-The main priority in Libav is simplicity and small code size in order to
-minimize the bug count.
-
- at subsection 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.
-
-Avoid Qt-style and similar Doxygen syntax with @code{!} in it, i.e. replace
- at code{//!} with @code{///} and similar.  Also @@ syntax should be employed
-for markup commands, i.e. use @code{@@param} and not @code{\param}.
-
- at example
-/**
- * @@file
- * 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
-
- at subsection C language features
-
-Libav 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 recent versions of GCC and a number of other
-currently supported compilers. To ensure compatibility, please do not use
-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
-
- at subsection Naming conventions
-All names should be composed with underscores (_), not CamelCase. For example,
- at samp{avfilter_get_video_buffer} is an acceptable function name and
- at samp{AVFilterGetVideo} is not. The only exception are structure
-names; they should always be CamelCase.
-
-There are the following conventions for naming variables and functions:
-
- at itemize @bullet
- at item
-For local variables no prefix is required.
-
- at item
-For file-scope variables and functions declared as @code{static}, no prefix
-is required.
-
- at item
-For variables and functions visible outside of file scope, but only used
-internally by a library, an @code{ff_} prefix should be used,
-e.g. @samp{ff_w64_demuxer}.
-
- at item
-For variables and functions visible outside of file scope, used internally
-across multiple libraries, use @code{avpriv_} as prefix, for example,
- at samp{avpriv_aac_parse_header}.
-
- at item
-For externally visible symbols, each library has its own prefix. Check
-the existing code and choose names accordingly.
- at end itemize
-
-Furthermore, name space reserved for the system should not be invaded.
-Identifiers ending in @code{_t} are reserved by
- at url{http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html#tag_02_02_02, POSIX}.
-Also avoid names starting with @code{__} or @code{_} followed by an uppercase
-letter as they are reserved by the C standard. Names starting with @code{_}
-are reserved at the file level and may not be used for externally visible
-symbols. If in doubt, just avoid names starting with @code{_} altogether.
-
- at subsection Miscellaneous conventions
-
- at itemize @bullet
- at item
-fprintf and printf are forbidden in libavformat and libavcodec,
-please use av_log() instead.
-
- at item
-Casts should be used only when necessary. Unneeded parentheses
-should also be avoided if they don't make the code easier to understand.
- at end itemize
-
- at subsection Editor configuration
-In order to configure Vim to follow Libav formatting conventions, paste
-the following snippet into your @file{.vimrc}:
- at example
-" Indentation rules for Libav: 4 spaces, no tabs.
-set expandtab
-set shiftwidth=4
-set softtabstop=4
-set cindent
-set cinoptions=(0
-" Allow tabs in Makefiles.
-autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
-" Trailing whitespace and tabs are forbidden, so highlight them.
-highlight ForbiddenWhitespace ctermbg=red guibg=red
-match ForbiddenWhitespace /\s\+$\|\t/
-" Do not highlight spaces at the end of line while typing on that line.
-autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
- at end example
-
-For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
- at example
-(c-add-style "libav"
-             '("k&r"
-               (c-basic-offset . 4)
-               (indent-tabs-mode . nil)
-               (show-trailing-whitespace . t)
-               (c-offsets-alist
-                (statement-cont . (c-lineup-assignments +)))
-               )
-             )
-(setq c-default-style "libav")
- at end example
-
- at section Development Policy
-
- at enumerate
- at item
-Contributions should be licensed under the
- at uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
-including an "or any later version" clause, or, if you prefer
-a gift-style license, the
- at uref{http://opensource.org/licenses/isc-license.txt, ISC} or
- at uref{http://mit-license.org/, MIT} license.
- at uref{http://www.gnu.org/licenses/gpl-2.0.html, GPL 2} including
-an "or any later version" clause is also acceptable, but LGPL is
-preferred.
-
- at item
-All the patches MUST be reviewed in the mailing list before they are
-committed.
-
- at item
-The Libav coding style should remain consistent. Changes to
-conform will be suggested during the review or implemented on commit.
-
- at item
-Patches should be generated using @code{git format-patch} or directly sent
-using @code{git send-email}.
-Please make sure you give the proper credit by setting the correct author
-in the commit.
-
- at item
-The commit message should have a short first line in the form of
-a @samp{topic: short description} as a header, separated by a newline
-from the body consisting of an explanation of why the change is necessary.
-If the commit fixes a known bug on the bug tracker, the commit message
-should include its bug ID. Referring to the issue on the bug tracker does
-not exempt you from writing an excerpt of the bug in the commit message.
-If the patch is a bug fix which should be backported to stable releases,
-i.e. a non-API/ABI-breaking bug fix, add @code{CC: libav-stable@@libav.org}
-to the bottom of your commit message, and make sure to CC your patch to
-this address, too. Some git setups will do this automatically.
-
- at item
-Work in progress patches should be sent to the mailing list with the [WIP]
-or the [RFC] tag.
-
- at item
-Branches in public personal repos are advised as way to
-work on issues collaboratively.
-
- at item
-You do not have to over-test things. If it works for you and you think it
-should work for others, send it to the mailing list for review.
-If you have doubt about portability please state it in the submission so
-people with specific hardware could test it.
-
- 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.
-
- at item
-Patches that change behavior of the programs (renaming options etc) or
-public API or ABI should be discussed in depth and possible few days should
-pass between discussion and commit.
-Changes to the build system (Makefiles, configure script) which alter
-the expected behavior should be considered in the same regard.
-
- at item
-When applying patches that have been discussed (at length) on the mailing
-list, reference the thread in the log message.
-
- at item
-Subscribe to the
- at uref{https://lists.libav.org/mailman/listinfo/libav-devel, libav-devel} and
- at uref{https://lists.libav.org/mailman/listinfo/libav-commits, libav-commits}
-mailing lists.
-Bugs and possible improvements or general questions regarding commits
-are discussed on libav-devel. 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 an [RFC] patch to libav-devel.
-
- at item
-All discussions and decisions should be reported on the public developer
-mailing list, so that there is a reference to them.
-Other media (e.g. IRC) should be used for coordination and immediate
-collaboration.
-
- 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. Always use valgrind to double-check.
-
- 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 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.
-If a type of warning leads to too many false positives, that warning
-should be disabled, not the code changed.
-
- 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.
-
- at section Submitting patches
-
-First, read the @ref{Coding Rules} above if you did not yet, in particular
-the rules regarding patch submission.
-
-As stated already, 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 Libav to check your patch.
-The tool is located in the tools directory.
-
-Run the @ref{Regression Tests} before submitting a patch in order to verify
-it does not cause unexpected problems.
-
-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()'). This kind of explanation should be the body of the
-commit message.
-
-Also please if you send several patches, send each patch as a separate mail,
-do not attach several unrelated patches to the same mail.
-
-Patches should be posted to the
- at uref{https://lists.libav.org/mailman/listinfo/libav-devel, libav-devel}
-mailing list. Use @code{git send-email} when possible since it will properly
-send patches without requiring extra care. If you cannot, then send patches
-as base64-encoded attachments, so your patch is not trashed during
-transmission.
-
-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, it will be
-committed to the official Libav 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 (and reset the micro version
-number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
-
- at item
-Did you register it in @file{allcodecs.c} or @file{allformats.c}?
-
- at item
-Did you add the AVCodecID to @file{avcodec.h}?
-When adding new codec IDs, also add an entry to the codec descriptor
-list in @file{libavcodec/codec_desc.c}.
-
- 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 are 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
- at 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 @code{git add} the appropriate files before committing?
-
- at item
-Did you make sure it compiles standalone, i.e. with
- at code{configure --disable-everything --enable-decoder=foo}
-(or @code{--enable-demuxer} or whatever your component is)?
- at end enumerate
-
-
- at section patch submission checklist
-
- at enumerate
- at item
-Does @code{make check} pass with the patch applied?
-
- at item
-Is the patch against latest Libav git master branch?
-
- at item
-Are you subscribed to the
- at uref{https://lists.libav.org/mailman/listinfo/libav-devel, libav-devel}
-mailing list? (Only list subscribers are allowed to post.)
-
- 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, the noise bitstream filter, and
- at uref{http://caca.zoy.org/wiki/zzuf, zzuf}. Your decoder or demuxer
-should not crash, end in a (near) infinite loop, or allocate ridiculous
-amounts of memory when fed damaged data.
-
- 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.libav.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 Libav, 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
-Make sure you check the return values of function and return appropriate
-error codes. Especially memory allocation functions like @code{malloc()}
-are notoriously left unchecked, which is a serious problem.
- at end enumerate
-
- at section Patch review process
-
-All patches posted to the
- at uref{https://lists.libav.org/mailman/listinfo/libav-devel, libav-devel}
-mailing list will be reviewed, unless they contain a
-clear note that the patch is not for the git master branch.
-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, if their size grew or during the review different
-issues arisen please split the patch so each issue has a specific patch.
-
- at anchor{Regression Tests}
- at section Regression Tests
-
-Before submitting a patch (or committing to the repository), you should at
-least make sure that it does not break anything.
-
-If the code changed has already a test present in FATE you should run it,
-otherwise it is advised to add it.
-
-Improvements to codec or demuxer might change the FATE results. Make sure
-to commit the update reference with the change and to explain in the comment
-why the expected result changed.
-
-Please refer to @url{fate.html}.
-
- at subsection Visualizing Test Coverage
-
-The Libav build system allows visualizing the test coverage in an easy
-manner with the coverage tools @code{gcov}/@code{lcov}.  This involves
-the following steps:
-
- at enumerate
- at item
-    Configure to compile with instrumentation enabled:
-    @code{configure --toolchain=gcov}.
-
- at item
-    Run your test case, either manually or via FATE. This can be either
-    the full FATE regression suite, or any arbitrary invocation of any
-    front-end tool provided by Libav, in any combination.
-
- at item
-    Run @code{make lcov} to generate coverage data in HTML format.
-
- at item
-    View @code{lcov/index.html} in your preferred HTML viewer.
- at end enumerate
-
-You can use the command @code{make lcov-reset} to reset the coverage
-measurements. You will need to rerun @code{make lcov} after running a
-new test.
-
- at subsection Using Valgrind
-
-The configure script provides a shortcut for using valgrind to spot bugs
-related to memory handling. Just add the option
- at code{--toolchain=valgrind-memcheck} or @code{--toolchain=valgrind-massif}
-to your configure line, and reasonable defaults will be set for running
-FATE under the supervision of either the @strong{memcheck} or the
- at strong{massif} tool of the valgrind suite.
-
-In case you need finer control over how valgrind is invoked, use the
- at code{--target-exec='valgrind <your_custom_valgrind_options>} option in
-your configure line instead.
-
- at anchor{Release process}
- at section Release process
-
-Libav maintains a set of @strong{release branches}, which are the
-recommended deliverable for system integrators and distributors (such as
-Linux distributions, etc.). At irregular times, a @strong{release
-manager} prepares, tests and publishes tarballs on the
- at url{http://libav.org} website.
-
-There are two kinds of releases:
-
- at enumerate
- at item
- at strong{Major releases} always include the latest and greatest
-features and functionality.
-
- at item
- at strong{Point releases} are cut from @strong{release} branches,
-which are named @code{release/X}, with @code{X} being the release
-version number.
- at end enumerate
-
-Note that we promise to our users that shared libraries from any Libav
-release never break programs that have been @strong{compiled} against
-previous versions of @strong{the same release series} in any case!
-
-However, from time to time, we do make API changes that require adaptations
-in applications. Such changes are only allowed in (new) major releases and
-require further steps such as bumping library version numbers and/or
-adjustments to the symbol versioning file. Please discuss such changes
-on the @strong{libav-devel} mailing list in time to allow forward planning.
-
- at anchor{Criteria for Point Releases}
- at subsection Criteria for Point Releases
-
-Changes that match the following criteria are valid candidates for
-inclusion into a point release:
-
- at enumerate
- at item
-Fixes a security issue, preferably identified by a @strong{CVE
-number} issued by @url{http://cve.mitre.org/}.
-
- at item
-Fixes a documented bug in @url{http://bugzilla.libav.org}.
-
- at item
-Improves the included documentation.
-
- at item
-Retains both source code and binary compatibility with previous
-point releases of the same release branch.
- at end enumerate
-
-The order for checking the rules is (1 OR 2 OR 3) AND 4.
-
-All Libav developers are welcome to nominate commits that they push to
- at code{master} by mailing the @strong{libav-stable} mailing list. The
-easiest way to do so is to include @code{CC: libav-stable@@libav.org} in
-the commit message.
-
-
- at subsection Release Checklist
-
-The release process involves the following steps:
-
- at enumerate
- at item
-Ensure that the @file{RELEASE} file contains the version number for
-the upcoming release.
-
- at item
-File a release tracking bug in @url{http://bugzilla.libav.org}. Make
-sure that the bug has an alias named @code{ReleaseX.Y} for the
- at code{X.Y} release.
-
- at item
-Announce the intent to do a release to the mailing list.
-
- at item
-Reassign unresolved blocking bugs from previous release
-tracking bugs to the new bug.
-
- at item
-Review patch nominations that reach the @strong{libav-stable}
-mailing list, and push patches that fulfill the stable release
-criteria to the release branch.
-
- at item
-Ensure that the FATE regression suite still passes in the release
-branch on at least @strong{i386} and @strong{amd64}
-(cf. @ref{Regression Tests}).
-
- at item
-Prepare the release tarballs in @code{xz} and @code{gz} formats, and
-supplementing files that contain @code{md5} and @code{sha1}
-checksums.
-
- at item
-Publish the tarballs at @url{http://libav.org/releases}. Create and
-push an annotated tag in the form @code{vX}, with @code{X}
-containing the version number.
-
- at item
-Build the tarballs with the Windows binaries, and publish them at
- at url{http://win32.libav.org/releases}.
-
- at item
-Propose and send a patch to the @strong{libav-devel} mailing list
-with a news entry for the website.
-
- at item
-Publish the news entry.
-
- at item
-Send announcement to the mailing list.
- at end enumerate
-
- at bye
diff --git a/deps/libav/doc/doxy-wrapper.sh b/deps/libav/doc/doxy-wrapper.sh
deleted file mode 100755
index d38dd0b..0000000
--- a/deps/libav/doc/doxy-wrapper.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-SRC_PATH="${1}"
-DOXYFILE="${2}"
-
-shift 2
-
-doxygen - <<EOF
- at INCLUDE        = ${DOXYFILE}
-INPUT           = $@
-EXAMPLE_PATH    = ${SRC_PATH}/doc/examples
-HTML_HEADER     = ${SRC_PATH}/doc/doxy/header.html
-HTML_FOOTER     = ${SRC_PATH}/doc/doxy/footer.html
-HTML_STYLESHEET = ${SRC_PATH}/doc/doxy/doxy_stylesheet.css
-EOF
diff --git a/deps/libav/doc/doxy/doxy_stylesheet.css b/deps/libav/doc/doxy/doxy_stylesheet.css
deleted file mode 100644
index d6dadde..0000000
--- a/deps/libav/doc/doxy/doxy_stylesheet.css
+++ /dev/null
@@ -1,2021 +0,0 @@
-/*!
- * Bootstrap v2.1.1
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */
-
-html {
-  font-size: 100%;
-  -webkit-text-size-adjust: 100%;
-  -ms-text-size-adjust: 100%;
-}
-a:focus {
-  outline: thin dotted #333;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-a:hover,
-a:current {
-  outline: 0;
-}
-img {
-  /* Responsive images (ensure images don't scale beyond their parents) */
-
-  max-width: 100%;
-  /* Part 1: Set a maxium relative to the parent */
-
-  width: auto\9;
-  /* IE7-8 need help adjusting responsive images */
-
-  height: auto;
-  /* Part 2: Scale the height according to the width, otherwise you get stretching */
-
-  vertical-align: middle;
-  border: 0;
-  -ms-interpolation-mode: bicubic;
-}
-body {
-  margin: 0;
-  font-family: sans-serif;
-  font-size: 14px;
-  line-height: 20px;
-  color: #333333;
-  background-color: #ffffff;
-}
-a {
-  color: #0088cc;
-  text-decoration: none;
-}
-a:hover {
-  color: #005580;
-  text-decoration: underline;
-}
-.container {
-  width: 940px;
-}
-
-.container {
-  margin-right: auto;
-  margin-left: auto;
-  *zoom: 1;
-}
-
-.container:before,
-.container:after {
-  display: table;
-  content: "";
-  line-height: 0;
-}
-.container:after {
-  clear: both;
-}
-.container-fluid {
-  padding-right: 20px;
-  padding-left: 20px;
-  *zoom: 1;
-}
-small {
-  font-size: 85%;
-}
-strong {
-  font-weight: bold;
-}
-em {
-  font-style: italic;
-}
-cite {
-  font-style: normal;
-}
-.text-warning {
-  color: #c09853;
-}
-.text-error {
-  color: #b94a48;
-}
-.text-info {
-  color: #3a87ad;
-}
-.text-success {
-  color: #468847;
-}
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
-  margin: 10px 0;
-  font-family: inherit;
-  font-weight: bold;
-  line-height: 1;
-  color: inherit;
-  text-rendering: optimizelegibility;
-}
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small {
-  font-weight: normal;
-  line-height: 1;
-  color: #999999;
-}
-h1 {
-  font-size: 30px;
-  line-height: 40px;
-}
-h2 {
-  font-size: 20px;
-  line-height: 40px;
-}
-h3 {
-  font-size: 18px;
-  line-height: 40px;
-}
-h4 {
-  font-size: 18px;
-  line-height: 20px;
-}
-h5 {
-  font-size: 14px;
-  line-height: 20px;
-}
-h6 {
-  font-size: 12px;
-  line-height: 20px;
-}
-ul,
-ol {
-  padding: 0;
-  margin: 0 0 10px 25px;
-}
-ul ul,
-ul ol,
-ol ol,
-ol ul {
-  margin-bottom: 0;
-}
-li {
-  line-height: 20px;
-}
-ul.unstyled,
-ol.unstyled {
-  margin-left: 0;
-  list-style: none;
-}
-dl {
-  margin-bottom: 20px;
-}
-dt,
-dd {
-  line-height: 20px;
-}
-dt {
-  font-weight: bold;
-}
-dd {
-  margin-left: 10px;
-}
-blockquote {
-  padding: 0 0 0 15px;
-  margin: 0 0 20px;
-  border-left: 5px solid #eeeeee;
-}
-blockquote p {
-  margin-bottom: 0;
-  font-size: 16px;
-  font-weight: 300;
-  line-height: 25px;
-}
-blockquote:before,
-blockquote:after {
-  content: "";
-}
-.fragment,
-code,
-pre {
-  padding: 0 3px 2px;
-  font-family: monospace;
-  font-size: 12px;
-  color: #333333;
-  -webkit-border-radius: 3px;
-  -moz-border-radius: 3px;
-  border-radius: 3px;
-}
-.fragment,
-code {
-  padding: 2px 4px;
-  color: #d14;
-  background-color: #f7f7f9;
-  border: 1px solid #e1e1e8;
-}
-.fragment .line {
-  padding-left: 2em;
-  white-space: pre;
-}
-pre {
-  display: block;
-  padding: 9.5px;
-  margin: 0 0 10px;
-  font-size: 13px;
-  line-height: 20px;
-  word-break: break-all;
-  word-wrap: break-word;
-  white-space: pre-wrap;
-  background-color: #f5f5f5;
-  border: 1px solid #ccc;
-  border: 1px solid rgba(0, 0, 0, 0.15);
-  -webkit-border-radius: 4px;
-  -moz-border-radius: 4px;
-  border-radius: 4px;
-}
-pre code {
-  padding: 0;
-  color: inherit;
-  background-color: transparent;
-  border: 0;
-}
-.label,
-.badge {
-  font-size: 11.844px;
-  font-weight: bold;
-  line-height: 14px;
-  color: #ffffff;
-  vertical-align: baseline;
-  white-space: nowrap;
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-  background-color: #999999;
-}
-.label {
-  padding: 1px 4px 2px;
-  -webkit-border-radius: 3px;
-  -moz-border-radius: 3px;
-  border-radius: 3px;
-}
-.badge {
-  padding: 1px 9px 2px;
-  -webkit-border-radius: 9px;
-  -moz-border-radius: 9px;
-  border-radius: 9px;
-}
-
-.label a {
-  color:#ffffff;
-}
-a.label:hover,
-a.badge:hover {
-  color: #ffffff;
-  text-decoration: none;
-  cursor: pointer;
-}
-.label-important,
-.badge-important {
-  background-color: #b94a48;
-}
-.label-important[href],
-.badge-important[href] {
-  background-color: #953b39;
-}
-.label-warning,
-.badge-warning {
-  background-color: #f89406;
-}
-.label-warning[href],
-.badge-warning[href] {
-  background-color: #c67605;
-}
-.label-success,
-.badge-success {
-  background-color: #468847;
-}
-.label-success[href],
-.badge-success[href] {
-  background-color: #356635;
-}
-.label-info,
-.badge-info {
-  background-color: #3a87ad;
-}
-.label-info[href],
-.badge-info[href] {
-  background-color: #2d6987;
-}
-.label-inverse,
-.badge-inverse {
-  background-color: #333333;
-}
-.label-inverse[href],
-.badge-inverse[href] {
-  background-color: #1a1a1a;
-}
-table {
-  max-width: 100%;
-  background-color: transparent;
-  border-collapse: collapse;
-  border-spacing: 0;
-}
-
-table [class*=span],
-.row-fluid table [class*=span] {
-  display: table-cell;
-  float: none;
-  margin-left: 0;
-}
-fieldset {
-  padding: 0;
-  margin: 0;
-  border: 0;
-}
-legend {
-  display: block;
-  width: 100%;
-  padding: 0;
-  margin-bottom: 20px;
-  font-size: 21px;
-  line-height: 40px;
-  color: #333333;
-  border: 0;
-  border-bottom: 1px solid #e5e5e5;
-}
-legend small {
-  font-size: 15px;
-  color: #999999;
-}
-label,
-input,
-button,
-select,
-textarea {
-  font-size: 14px;
-  font-weight: normal;
-  line-height: 20px;
-}
-input,
-button,
-select,
-textarea {
-  font-family: sans-serif;
-}
-label {
-  display: block;
-  margin-bottom: 5px;
-}
-
-.tablist {
-  margin-left: 0;
-  margin-bottom: 20px;
-  list-style: none;
-}
-.tablist > li > a {
-  display: block;
-}
-.tablist > li > a:hover {
-  text-decoration: none;
-  background-color: #eeeeee;
-}
-.tablist > .pull-right {
-  float: right;
-}
-.tablist-header {
-  display: block;
-  padding: 3px 15px;
-  font-size: 11px;
-  font-weight: bold;
-  line-height: 20px;
-  color: #999999;
-  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-  text-transform: uppercase;
-}
-.tablist li + .tablist-header {
-  margin-top: 9px;
-}
-.tablist-list {
-  padding-left: 15px;
-  padding-right: 15px;
-  margin-bottom: 0;
-}
-.tablist-list > li > a,
-.tablist-list .tablist-header {
-  margin-left: -15px;
-  margin-right: -15px;
-  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-}
-.tablist-list > li > a {
-  padding: 3px 15px;
-}
-.tablist-list > .current > a,
-.tablist-list > .current > a:hover {
-  color: #ffffff;
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
-  background-color: #0088cc;
-}
-.tablist-list [class^="icon-"] {
-  margin-right: 2px;
-}
-.tablist-list .divider {
-  *width: 100%;
-  height: 1px;
-  margin: 9px 1px;
-  *margin: -5px 0 5px;
-  overflow: hidden;
-  background-color: #e5e5e5;
-  border-bottom: 1px solid #ffffff;
-}
-.tablist-tabs,
-.tablist {
-  *zoom: 1;
-}
-.tablist-tabs:before,
-.tablist:before,
-.tablist-tabs:after,
-.tablist:after {
-  display: table;
-  content: "";
-  line-height: 0;
-}
-.tablist-tabs:after,
-.tablist:after {
-  clear: both;
-}
-.tablist-tabs > li,
-.tablist > li {
-  float: left;
-}
-.tablist-tabs > li > a,
-.tablist > li > a {
-  padding-right: 12px;
-  padding-left: 12px;
-  margin-right: 2px;
-  line-height: 14px;
-}
-.tablist-tabs {
-  border-bottom: 1px solid #ddd;
-}
-.tablist-tabs > li {
-  margin-bottom: -1px;
-}
-.tablist-tabs > li > a {
-  padding-top: 8px;
-  padding-bottom: 8px;
-  line-height: 20px;
-  border: 1px solid transparent;
-  -webkit-border-radius: 4px 4px 0 0;
-  -moz-border-radius: 4px 4px 0 0;
-  border-radius: 4px 4px 0 0;
-}
-.tablist-tabs > li > a:hover {
-  border-color: #eeeeee #eeeeee #dddddd;
-}
-.tablist-tabs > .current > a,
-.tablist-tabs > .current > a:hover {
-  color: #555555;
-  background-color: #ffffff;
-  border: 1px solid #ddd;
-  border-bottom-color: transparent;
-  cursor: default;
-}
-.tablist > li > a {
-  padding-top: 8px;
-  padding-bottom: 8px;
-  margin-top: 2px;
-  margin-bottom: 2px;
-  -webkit-border-radius: 5px;
-  -moz-border-radius: 5px;
-  border-radius: 5px;
-}
-.tablist > .current > a,
-.tablist > .current > a:hover {
-  color: #ffffff;
-  background-color: #0088cc;
-}
-.tablist-stacked > li {
-  float: none;
-}
-.tablist-stacked > li > a {
-  margin-right: 0;
-}
-.tablist-tabs.tablist-stacked {
-  border-bottom: 0;
-}
-.tablist-tabs.tablist-stacked > li > a {
-  border: 1px solid #ddd;
-  -webkit-border-radius: 0;
-  -moz-border-radius: 0;
-  border-radius: 0;
-}
-.tablist-tabs.tablist-stacked > li:first-child > a {
-  -webkit-border-top-right-radius: 4px;
-  -moz-border-radius-topright: 4px;
-  border-top-right-radius: 4px;
-  -webkit-border-top-left-radius: 4px;
-  -moz-border-radius-topleft: 4px;
-  border-top-left-radius: 4px;
-}
-.tablist-tabs.tablist-stacked > li:last-child > a {
-  -webkit-border-bottom-right-radius: 4px;
-  -moz-border-radius-bottomright: 4px;
-  border-bottom-right-radius: 4px;
-  -webkit-border-bottom-left-radius: 4px;
-  -moz-border-radius-bottomleft: 4px;
-  border-bottom-left-radius: 4px;
-}
-.tablist-tabs.tablist-stacked > li > a:hover {
-  border-color: #ddd;
-  z-index: 2;
-}
-.tablist.tablist-stacked > li > a {
-  margin-bottom: 3px;
-}
-.tablist.tablist-stacked > li:last-child > a {
-  margin-bottom: 1px;
-}
-.tablist-tabs .dropdown-menu {
-  -webkit-border-radius: 0 0 6px 6px;
-  -moz-border-radius: 0 0 6px 6px;
-  border-radius: 0 0 6px 6px;
-}
-.tablist .dropdown-menu {
-  -webkit-border-radius: 6px;
-  -moz-border-radius: 6px;
-  border-radius: 6px;
-}
-.tablist .dropdown-toggle .caret {
-  border-top-color: #0088cc;
-  border-bottom-color: #0088cc;
-  margin-top: 6px;
-}
-.tablist .dropdown-toggle:hover .caret {
-  border-top-color: #005580;
-  border-bottom-color: #005580;
-}
-/* move down carets for tabs */
-.tablist-tabs .dropdown-toggle .caret {
-  margin-top: 8px;
-}
-.tablist .current .dropdown-toggle .caret {
-  border-top-color: #fff;
-  border-bottom-color: #fff;
-}
-.tablist-tabs .current .dropdown-toggle .caret {
-  border-top-color: #555555;
-  border-bottom-color: #555555;
-}
-.tablist > .dropdown.current > a:hover {
-  cursor: pointer;
-}
-.tablist-tabs .open .dropdown-toggle,
-.tablist .open .dropdown-toggle,
-.tablist > li.dropdown.open.current > a:hover {
-  color: #ffffff;
-  background-color: #999999;
-  border-color: #999999;
-}
-.tablist li.dropdown.open .caret,
-.tablist li.dropdown.open.current .caret,
-.tablist li.dropdown.open a:hover .caret {
-  border-top-color: #ffffff;
-  border-bottom-color: #ffffff;
-  opacity: 1;
-  filter: alpha(opacity=100);
-}
-.tabs-stacked .open > a:hover {
-  border-color: #999999;
-}
-.tab-content > .tab-pane,
-.pill-content > .pill-pane {
-  display: none;
-}
-.tab-content > .current,
-.pill-content > .current {
-  display: block;
-}
-.tabs-below > .tablist-tabs {
-  border-top: 1px solid #ddd;
-}
-.tabs-below > .tablist-tabs > li {
-  margin-top: -1px;
-  margin-bottom: 0;
-}
-.tabs-below > .tablist-tabs > li > a {
-  -webkit-border-radius: 0 0 4px 4px;
-  -moz-border-radius: 0 0 4px 4px;
-  border-radius: 0 0 4px 4px;
-}
-.tabs-below > .tablist-tabs > li > a:hover {
-  border-bottom-color: transparent;
-  border-top-color: #ddd;
-}
-.tabs-below > .tablist-tabs > .current > a,
-.tabs-below > .tablist-tabs > .current > a:hover {
-  border-color: transparent #ddd #ddd #ddd;
-}
-.tabs-left > .tablist-tabs > li,
-.tabs-right > .tablist-tabs > li {
-  float: none;
-}
-.tabs-left > .tablist-tabs > li > a,
-.tabs-right > .tablist-tabs > li > a {
-  min-width: 74px;
-  margin-right: 0;
-  margin-bottom: 3px;
-}
-.tabs-left > .tablist-tabs {
-  float: left;
-  margin-right: 19px;
-  border-right: 1px solid #ddd;
-}
-.tabs-left > .tablist-tabs > li > a {
-  margin-right: -1px;
-  -webkit-border-radius: 4px 0 0 4px;
-  -moz-border-radius: 4px 0 0 4px;
-  border-radius: 4px 0 0 4px;
-}
-.tabs-left > .tablist-tabs > li > a:hover {
-  border-color: #eeeeee #dddddd #eeeeee #eeeeee;
-}
-.tabs-left > .tablist-tabs .current > a,
-.tabs-left > .tablist-tabs .current > a:hover {
-  border-color: #ddd transparent #ddd #ddd;
-  *border-right-color: #ffffff;
-}
-.tabs-right > .tablist-tabs {
-  float: right;
-  margin-left: 19px;
-  border-left: 1px solid #ddd;
-}
-.tabs-right > .tablist-tabs > li > a {
-  margin-left: -1px;
-  -webkit-border-radius: 0 4px 4px 0;
-  -moz-border-radius: 0 4px 4px 0;
-  border-radius: 0 4px 4px 0;
-}
-.tabs-right > .tablist-tabs > li > a:hover {
-  border-color: #eeeeee #eeeeee #eeeeee #dddddd;
-}
-.tabs-right > .tablist-tabs .current > a,
-.tabs-right > .tablist-tabs .current > a:hover {
-  border-color: #ddd #ddd #ddd transparent;
-  *border-left-color: #ffffff;
-}
-.tablist > .disabled > a {
-  color: #999999;
-}
-.tablist > .disabled > a:hover {
-  text-decoration: none;
-  background-color: transparent;
-  cursor: default;
-}
-.tablistbar {
-  overflow: visible;
-  margin-bottom: 20px;
-  color: #ffffff;
-  *position: relative;
-  *z-index: 2;
-}
-.tablistbar-inner {
-  min-height: 40px;
-  padding-left: 20px;
-  padding-right: 20px;
-  background-color: #034c03;
-  background-image: -moz-linear-gradient(top, #024002, #045f04);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#024002), to(#045f04));
-  background-image: -webkit-linear-gradient(top, #024002, #045f04);
-  background-image: -o-linear-gradient(top, #024002, #045f04);
-  background-image: linear-gradient(to bottom, #024002, #045f04);
-  background-repeat: repeat-x;
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff024002', endColorstr='#ff045f04', GradientType=0);
-  border: 1px solid #022402;
-  -webkit-border-radius: 4px;
-  -moz-border-radius: 4px;
-  border-radius: 4px;
-  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
-  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
-  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
-  *zoom: 1;
-}
-.tablistbar-inner:before,
-.tablistbar-inner:after {
-  display: table;
-  content: "";
-  line-height: 0;
-}
-.tablistbar-inner:after {
-  clear: both;
-}
-.tablistbar .container {
-  width: auto;
-}
-.tablist-collapse.collapse {
-  height: auto;
-}
-.tablistbar .brand {
-  float: left;
-  display: block;
-  padding: 10px 20px 10px;
-  margin-left: -20px;
-  font-size: 20px;
-  font-weight: 200;
-  color: #ffffff;
-  text-shadow: 0 1px 0 #024002;
-}
-.tablistbar .brand:hover {
-  text-decoration: none;
-}
-.tablistbar-text {
-  margin-bottom: 0;
-  line-height: 40px;
-}
-.tablistbar-link {
-  color: #ffffff;
-}
-.tablistbar-link:hover {
-  color: #333333;
-}
-.tablistbar .tablist {
-  position: relative;
-  left: 0;
-  display: block;
-  float: left;
-  margin: 0 10px 0 0;
-}
-.tablistbar .tablist.pull-right {
-  float: right;
-  margin-right: 0;
-}
-.tablistbar .tablist > li {
-  float: left;
-}
-.tablistbar .tablist > li > a {
-  float: none;
-  padding: 10px 15px 10px;
-  color: #ffffff;
-  text-decoration: none;
-  text-shadow: 0 1px 0 #024002;
-}
-.tablistbar .tablist .dropdown-toggle .caret {
-  margin-top: 8px;
-}
-.tablistbar .tablist > li > a:focus,
-.tablistbar .tablist > li > a:hover {
-  background-color: transparent;
-  color: white;
-  text-decoration: none;
-}
-.tablistbar .tablist > .current > a,
-.tablistbar .tablist > .current > a:hover,
-.tablistbar .tablist > .current > a:focus {
-  color: #555555;
-  text-decoration: none;
-  background-color: #034703;
-  -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
-  -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
-  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
-}
-.tablistbar .btn-navbar {
-  display: none;
-  float: right;
-  padding: 7px 10px;
-  margin-left: 5px;
-  margin-right: 5px;
-  color: #ffffff;
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-  background-color: #023402;
-  background-image: -moz-linear-gradient(top, #012701, #034703);
-  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#012701), to(#034703));
-  background-image: -webkit-linear-gradient(top, #012701, #034703);
-  background-image: -o-linear-gradient(top, #012701, #034703);
-  background-image: linear-gradient(to bottom, #012701, #034703);
-  background-repeat: repeat-x;
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff012701', endColorstr='#ff034703', GradientType=0);
-  border-color: #034703 #034703 #000000;
-  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-  *background-color: #034703;
-  /* Darken IE7 buttons by default so they stand out more given they won't have borders */
-
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-}
-.tablistbar .tablist > li > .dropdown-menu:before {
-  content: '';
-  display: inline-block;
-  border-left: 7px solid transparent;
-  border-right: 7px solid transparent;
-  border-bottom: 7px solid #ccc;
-  border-bottom-color: rgba(0, 0, 0, 0.2);
-  position: absolute;
-  top: -7px;
-  left: 9px;
-}
-.tablistbar .tablist > li > .dropdown-menu:after {
-  content: '';
-  display: inline-block;
-  border-left: 6px solid transparent;
-  border-right: 6px solid transparent;
-  border-bottom: 6px solid #ffffff;
-  position: absolute;
-  top: -6px;
-  left: 10px;
-}
-.tablistbar .tablist li.dropdown.open > .dropdown-toggle,
-.tablistbar .tablist li.dropdown.current > .dropdown-toggle,
-.tablistbar .tablist li.dropdown.open.current > .dropdown-toggle {
-  background-color: #034703;
-  color: #555555;
-}
-.tablistbar .tablist li.dropdown > .dropdown-toggle .caret {
-  border-top-color: #ffffff;
-  border-bottom-color: #ffffff;
-}
-.tablistbar .tablist li.dropdown.open > .dropdown-toggle .caret,
-.tablistbar .tablist li.dropdown.current > .dropdown-toggle .caret,
-.tablistbar .tablist li.dropdown.open.current > .dropdown-toggle .caret {
-  border-top-color: #555555;
-  border-bottom-color: #555555;
-}
-.tablistbar .pull-right > li > .dropdown-menu,
-.tablistbar .tablist > li > .dropdown-menu.pull-right {
-  left: auto;
-  right: 0;
-}
-.tablistbar .pull-right > li > .dropdown-menu:before,
-.tablistbar .tablist > li > .dropdown-menu.pull-right:before {
-  left: auto;
-  right: 12px;
-}
-.tablistbar .pull-right > li > .dropdown-menu:after,
-.tablistbar .tablist > li > .dropdown-menu.pull-right:after {
-  left: auto;
-  right: 13px;
-}
-.tablistbar .pull-right > li > .dropdown-menu .dropdown-menu,
-.tablistbar .tablist > li > .dropdown-menu.pull-right .dropdown-menu {
-  left: auto;
-  right: 100%;
-  margin-left: 0;
-  margin-right: -1px;
-  -webkit-border-radius: 6px 0 6px 6px;
-  -moz-border-radius: 6px 0 6px 6px;
-  border-radius: 6px 0 6px 6px;
-}
-.breadcrumb {
-  padding: 8px 15px;
-  margin: 0 0 20px;
-  list-style: none;
-  background-color: #f5f5f5;
-  -webkit-border-radius: 4px;
-  -moz-border-radius: 4px;
-  border-radius: 4px;
-}
-.breadcrumb li {
-  display: inline-block;
-  *display: inline;
-  /* IE7 inline-block hack */
-
-  *zoom: 1;
-  text-shadow: 0 1px 0 #ffffff;
-}
-.breadcrumb .divider {
-  padding: 0 5px;
-  color: #ccc;
-}
-.breadcrumb .current {
-  color: #999999;
-}
-.pagination-right {
-  text-align: right;
-}
-.fade {
-  opacity: 0;
-  -webkit-transition: opacity 0.15s linear;
-  -moz-transition: opacity 0.15s linear;
-  -o-transition: opacity 0.15s linear;
-  transition: opacity 0.15s linear;
-}
-.fade.in {
-  opacity: 1;
-}
-.collapse {
-  position: relative;
-  height: 0;
-  overflow: hidden;
-  -webkit-transition: height 0.35s ease;
-  -moz-transition: height 0.35s ease;
-  -o-transition: height 0.35s ease;
-  transition: height 0.35s ease;
-}
-.collapse.in {
-  height: auto;
-}
-.hidden {
-  display: none;
-  visibility: hidden;
-}
-.visible-phone {
-  display: none !important;
-}
-.visible-tablet {
-  display: none !important;
-}
-.hidden-desktop {
-  display: none !important;
-}
-.visible-desktop {
-  display: inherit !important;
-}
- at media (min-width: 768px) and (max-width: 979px) {
-  .hidden-desktop {
-    display: inherit !important;
-  }
-  .visible-desktop {
-    display: none !important ;
-  }
-  .visible-tablet {
-    display: inherit !important;
-  }
-  .hidden-tablet {
-    display: none !important;
-  }
-}
- at media (max-width: 767px) {
-  .hidden-desktop {
-    display: inherit !important;
-  }
-  .visible-desktop {
-    display: none !important;
-  }
-  .visible-phone {
-    display: inherit !important;
-  }
-  .hidden-phone {
-    display: none !important;
-  }
-}
- at media (max-width: 767px) {
-  body {
-    padding-left: 20px;
-    padding-right: 20px;
-  }
-  .container {
-    width: auto;
-  }
-  .row,
-  .thumbnails {
-    margin-left: 0;
-  }
-}
- at media (max-width: 480px) {
-  .tablist-collapse {
-    -webkit-transform: translate3d(0, 0, 0);
-  }
-  .page-header h1 small {
-    display: block;
-    line-height: 20px;
-  }
-}
- at media (min-width: 768px) and (max-width: 979px) {
-  .row {
-    margin-left: -20px;
-    *zoom: 1;
-  }
-  .row:before,
-  .row:after {
-    display: table;
-    content: "";
-    line-height: 0;
-  }
-  .row:after {
-    clear: both;
-  }
-  [class*="span"] {
-    float: left;
-    min-height: 1px;
-    margin-left: 20px;
-  }
-  .container {
-    width: 724px;
-  }
-}
- at media (min-width: 1200px) {
-  .row {
-    margin-left: -30px;
-    *zoom: 1;
-  }
-  .row:before,
-  .row:after {
-    display: table;
-    content: "";
-    line-height: 0;
-  }
-  .row:after {
-    clear: both;
-  }
-  [class*="span"] {
-    float: left;
-    min-height: 1px;
-    margin-left: 30px;
-  }
-  .container {
-    width: 1070px;
-  }
-}
- at media (max-width: 979px) {
-  body {
-    padding-top: 0;
-  }
-}
- at media (min-width: 980px) {
-  .tablist-collapse.collapse {
-    height: auto !important;
-    overflow: visible !important;
-  }
-}
-.tablistbar .brand {
-  padding: 5px;
-  margin-left: 0;
-}
-.tablistbar .brand img {
-  width: 30px;
-  vertical-align: middle;
-}
-
-h1 small {
-  font-size: 18px;
-}
-
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small,
-.page-header small {
-  line-height: 0.8;
-  font-weight: normal;
-  color: #999999;
-  display:block;
-  vertical-align: middle;
-}
-
-.page-header h1, h1:first-child {
-  font-size: 40px;
-  padding-bottom: 5px;
-}
-
-.page-header h1 {
-  border-bottom: 1px solid #999999;
-  padding-bottom: 9px;
-}
-
-.page-header img {
-  height: 80px;
-  padding-bottom: 5px;
-}
-
-.page-header small {
-  line-height: 1.1;
-  font-size: 18px;
-}
-
-h2,
-h3,
-h4,
-div.ah,
-.title {
-  border-color: #D6E9C6;
-  color: #468847;
-  border-style: solid;
-  border-width: 0 0 1px;
-  padding-left: 0.5em;
-}
-
-
-.google {
-  color: white;
-}
-
-.breadcrumb {
-  font-size: 11px;
-  padding-top: 2px;
-  padding-bottom: 2px;
-}
-
-h1 a,
-h2 a,
-h3 a,
-h4 a {
-  color: inherit;
-}
-
-.tablistbar-inner a {
-  font-weight: bold;
-}
-
-.list-2panes:before,
-.list-2panes:after {
-  display: table;
-  content: "";
-  line-height: 0;
-}
-
-.list-2panes:after {
-  clear:both;
-}
-
-.list-2panes li {
-  width: 470px;
-  width: 470px;
-  float: left;
-  margin-left: 30px;
-  min-height: 1px;
-}
-/* The standard CSS for doxygen */
-
-/* @group Heading Levels */
-
-
-dt {
-    font-weight: bold;
-}
-
-div.multicol {
-    -moz-column-gap: 1em;
-    -webkit-column-gap: 1em;
-    -moz-column-count: 3;
-    -webkit-column-count: 3;
-}
-
-p.startli, p.startdd, p.starttd {
-    margin-top: 2px;
-}
-
-p.endli {
-    margin-bottom: 0px;
-}
-
-p.enddd {
-    margin-bottom: 4px;
-}
-
-p.endtd {
-    margin-bottom: 2px;
-}
-
-/* @end */
-
-caption {
-    font-weight: bold;
-}
-
-span.legend {
-        font-size: 70%;
-        text-align: center;
-}
-
-h3.version {
-        font-size: 90%;
-        text-align: center;
-}
-
-div.qindex, div.tablisttab{
-    background-color: #EBF6EB;
-    border: 1px solid #A3D7A3;
-    text-align: center;
-}
-
-div.qindex, div.tablistpath {
-    width: 100%;
-    line-height: 140%;
-}
-
-div.tablisttab {
-    margin-right: 15px;
-}
-
-/* @group Link Styling */
-
-a {
-    color: #3D8C3D;
-    font-weight: normal;
-    text-decoration: none;
-}
-
-.contents a:visited {
-    color: #46A246;
-}
-
-a:hover {
-    text-decoration: underline;
-}
-
-a.qindex {
-    font-weight: bold;
-}
-
-a.qindexHL {
-    font-weight: bold;
-    background-color: #9CD49C;
-    color: #ffffff;
-    border: 1px double #86CA86;
-}
-
-.contents a.qindexHL:visited {
-        color: #ffffff;
-}
-
-a.el {
-    font-weight: bold;
-}
-
-a.elRef {
-}
-
-a.code {
-    color: #4665A2;
-}
-
-a.codeRef {
-    color: #4665A2;
-}
-
-/* @end */
-
-dl.el {
-    margin-left: -1cm;
-}
-
-.fragment {
-    font-family: monospace, fixed;
-    font-size: 105%;
-}
-
-pre.fragment {
-    border: 1px solid #C4E5C4;
-    background-color: #FBFDFB;
-    padding: 4px 6px;
-    margin: 4px 8px 4px 2px;
-    overflow: auto;
-    word-wrap: break-word;
-    font-size:  9pt;
-    line-height: 125%;
-}
-
-div.groupHeader {
-    margin-left: 16px;
-    margin-top: 12px;
-    font-weight: bold;
-}
-
-div.groupText {
-    margin-left: 16px;
-    font-style: italic;
-}
-
-div.contents {
-    margin-top: 10px;
-    margin-left: 8px;
-    margin-right: 8px;
-}
-
-td.indexkey {
-    white-space: nowrap;
-    vertical-align: top;
-}
-
-
-tr.memlist {
-    background-color: #EEF7EE;
-}
-
-p.formulaDsp {
-    text-align: center;
-}
-
-img.formulaDsp {
-
-}
-
-img.formulaInl {
-    vertical-align: middle;
-}
-
-div.center {
-    text-align: center;
-        margin-top: 0px;
-        margin-bottom: 0px;
-        padding: 0px;
-}
-
-div.center img {
-    border: 0px;
-}
-
-#footer {
-    margin: -10px 1em 0;
-    padding-top: 20px;
-    text-align: center;
-    font-size: small;
-}
-
-address.footer {
-    background-color: #ffffff;
-    text-align: center;
-}
-
-img.footer {
-    border: 0px;
-    vertical-align: middle;
-}
-
-/* @group Code Colorization */
-
-span.keyword {
-    color: #008000
-}
-
-span.keywordtype {
-    color: #604020
-}
-
-span.keywordflow {
-    color: #e08000
-}
-
-span.comment {
-    color: #800000
-}
-
-span.preprocessor {
-    color: #806020
-}
-
-span.stringliteral {
-    color: #002080
-}
-
-span.charliteral {
-    color: #008080
-}
-
-span.vhdldigit {
-    color: #ff00ff
-}
-
-span.vhdlchar {
-    color: #000000
-}
-
-span.vhdlkeyword {
-    color: #700070
-}
-
-span.vhdllogic {
-    color: #ff0000
-}
-
-/* @end */
-
-/*
-.search {
-    color: #003399;
-    font-weight: bold;
-}
-
-form.search {
-    margin-bottom: 0px;
-    margin-top: 0px;
-}
-
-input.search {
-    font-size: 75%;
-    color: #000080;
-    font-weight: normal;
-    background-color: #e8eef2;
-}
-*/
-
-td.tiny {
-    font-size: 75%;
-}
-
-.dirtab {
-    padding: 4px;
-    border-collapse: collapse;
-    border: 1px solid #A3D7A3;
-}
-
-th.dirtab {
-    background: #EBF6EB;
-    font-weight: bold;
-}
-
-hr {
-    height: 0px;
-    border: none;
-    border-top: 1px solid #4AAA4A;
-}
-
-hr.footer {
-    height: 1px;
-}
-
-/* @group Member Descriptions */
-
-table.memberdecls {
-    border-spacing: 0px;
-    padding: 0px;
-}
-
-.mdescLeft, .mdescRight,
-.memItemLeft, .memItemRight,
-.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
-    background-color: #F9FCF9;
-    border: none;
-    margin: 4px;
-    padding: 1px 0 0 8px;
-}
-
-.mdescLeft, .mdescRight {
-    padding: 0px 8px 4px 8px;
-    color: #555;
-}
-
-.memItemLeft, .memItemRight, .memTemplParams {
-    border-top: 1px solid #C4E5C4;
-}
-
-.memItemLeft, .memTemplItemLeft {
-        white-space: nowrap;
-}
-
-.memItemRight {
-    width: 100%;
-}
-
-.memTemplParams {
-    color: #46A246;
-        white-space: nowrap;
-}
-
-/* @end */
-
-/* @group Member Details */
-
-/* Styles for detailed member documentation */
-
-.memtemplate {
-    font-size: 80%;
-    color: #46A246;
-    font-weight: normal;
-    margin-left: 9px;
-}
-
-.memnav {
-    background-color: #EBF6EB;
-    border: 1px solid #A3D7A3;
-    text-align: center;
-    margin: 2px;
-    margin-right: 15px;
-    padding: 2px;
-}
-
-.mempage {
-    width: 100%;
-}
-
-.memitem {
-    padding: 0;
-    margin-bottom: 10px;
-    margin-right: 5px;
-}
-
-.memname {
-        white-space: nowrap;
-        font-weight: bold;
-        margin-left: 6px;
-}
-
-.memproto, dl.reflist dt {
-        border-top: 1px solid #A8D9A8;
-        border-left: 1px solid #A8D9A8;
-        border-right: 1px solid #A8D9A8;
-        padding: 6px 0px 6px 0px;
-        color: #255525;
-        font-weight: bold;
-        text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
-        /* opera specific markup */
-        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-        border-top-right-radius: 8px;
-        border-top-left-radius: 8px;
-        /* firefox specific markup */
-        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
-        -moz-border-radius-topright: 8px;
-        -moz-border-radius-topleft: 8px;
-        /* webkit specific markup */
-        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-        -webkit-border-top-right-radius: 8px;
-        -webkit-border-top-left-radius: 8px;
-        background-repeat:repeat-x;
-        background-color: #E2F2E2;
-
-}
-
-.memdoc, dl.reflist dd {
-        border-bottom: 1px solid #A8D9A8;
-        border-left: 1px solid #A8D9A8;
-        border-right: 1px solid #A8D9A8;
-        padding: 2px 5px;
-        background-color: #FBFDFB;
-        border-top-width: 0;
-        /* opera specific markup */
-        border-bottom-left-radius: 8px;
-        border-bottom-right-radius: 8px;
-        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-        /* firefox specific markup */
-        -moz-border-radius-bottomleft: 8px;
-        -moz-border-radius-bottomright: 8px;
-        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
-        background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7FBF7 95%, #EEF7EE);
-        /* webkit specific markup */
-        -webkit-border-bottom-left-radius: 8px;
-        -webkit-border-bottom-right-radius: 8px;
-        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-        background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7FBF7), to(#EEF7EE));
-}
-
-dl.reflist dt {
-        padding: 5px;
-}
-
-dl.reflist dd {
-        margin: 0px 0px 10px 0px;
-        padding: 5px;
-}
-
-.paramkey {
-    text-align: right;
-}
-
-.paramtype {
-    white-space: nowrap;
-}
-
-.paramname {
-    color: #602020;
-    white-space: nowrap;
-}
-.paramname em {
-    font-style: normal;
-}
-
-.params, .retval, .exception, .tparams {
-        border-spacing: 6px 2px;
-}
-
-.params .paramname, .retval .paramname {
-        font-weight: bold;
-        vertical-align: top;
-}
-
-.params .paramtype {
-        font-style: italic;
-        vertical-align: top;
-}
-
-.params .paramdir {
-        font-family: "courier new",courier,monospace;
-        vertical-align: top;
-}
-
-
-
-
-/* @end */
-
-/* @group Directory (tree) */
-
-/* for the tree view */
-
-.ftvtree {
-    font-family: sans-serif;
-    margin: 0px;
-}
-
-/* these are for tree view when used as main index */
-
-.directory {
-    font-size: 9pt;
-    font-weight: bold;
-    margin: 5px;
-}
-
-.directory h3 {
-    margin: 0px;
-    margin-top: 1em;
-    font-size: 11pt;
-}
-
-/*
-The following two styles can be used to replace the root node title
-with an image of your choice.  Simply uncomment the next two styles,
-specify the name of your image and be sure to set 'height' to the
-proper pixel height of your image.
-*/
-
-/*
-.directory h3.swap {
-    height: 61px;
-    background-repeat: no-repeat;
-    background-image: url("yourimage.gif");
-}
-.directory h3.swap span {
-    display: none;
-}
-*/
-
-.directory > h3 {
-    margin-top: 0;
-}
-
-.directory p {
-    margin: 0px;
-    white-space: nowrap;
-}
-
-.directory div {
-    display: none;
-    margin: 0px;
-}
-
-.directory img {
-    vertical-align: -30%;
-}
-
-/* these are for tree view when not used as main index */
-
-.directory-alt {
-    font-size: 100%;
-    font-weight: bold;
-}
-
-.directory-alt h3 {
-    margin: 0px;
-    margin-top: 1em;
-    font-size: 11pt;
-}
-
-.directory-alt > h3 {
-    margin-top: 0;
-}
-
-.directory-alt p {
-    margin: 0px;
-    white-space: nowrap;
-}
-
-.directory-alt div {
-    display: none;
-    margin: 0px;
-}
-
-.directory-alt img {
-    vertical-align: -30%;
-}
-
-/* @end */
-
-div.dynheader {
-        margin-top: 8px;
-}
-
-address {
-    font-style: normal;
-    color: #2A612A;
-}
-
-table.doxtable {
-    border-collapse:collapse;
-}
-
-table.doxtable td, table.doxtable th {
-    border: 1px solid #2D682D;
-    padding: 3px 7px 2px;
-}
-
-table.doxtable th {
-    background-color: #377F37;
-    color: #FFFFFF;
-    font-size: 110%;
-    padding-bottom: 4px;
-    padding-top: 5px;
-    text-align:left;
-}
-
-table.fieldtable {
-        width: 100%;
-        margin-bottom: 10px;
-        border: 1px solid #A8D9A8;
-        border-spacing: 0px;
-        -moz-border-radius: 4px;
-        -webkit-border-radius: 4px;
-        border-radius: 4px;
-        -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
-        -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
-        box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
-}
-
-.fieldtable td, .fieldtable th {
-        padding: 3px 7px 2px;
-}
-
-.fieldtable td.fieldtype, .fieldtable td.fieldname {
-        white-space: nowrap;
-        border-right: 1px solid #A8D9A8;
-        border-bottom: 1px solid #A8D9A8;
-        vertical-align: top;
-}
-
-.fieldtable td.fielddoc {
-        border-bottom: 1px solid #A8D9A8;
-        width: 100%;
-}
-
-.fieldtable tr:last-child td {
-        border-bottom: none;
-}
-
-.fieldtable th {
-        background-repeat:repeat-x;
-        background-color: #E2F2E2;
-        font-size: 90%;
-        color: #255525;
-        padding-bottom: 4px;
-        padding-top: 5px;
-        text-align:left;
-        -moz-border-radius-topleft: 4px;
-        -moz-border-radius-topright: 4px;
-        -webkit-border-top-left-radius: 4px;
-        -webkit-border-top-right-radius: 4px;
-        border-top-left-radius: 4px;
-        border-top-right-radius: 4px;
-        border-bottom: 1px solid #A8D9A8;
-}
-
-
-.tabsearch {
-    top: 0px;
-    left: 10px;
-    height: 36px;
-    z-index: 101;
-    overflow: hidden;
-    font-size: 13px;
-}
-
-.tablistpath ul
-{
-    font-size: 11px;
-    background-repeat:repeat-x;
-    height:30px;
-    line-height:30px;
-    color:#8ACC8A;
-    border:solid 1px #C2E4C2;
-    overflow:hidden;
-    margin:0px;
-    padding:0px;
-}
-
-.tablistpath li
-{
-    list-style-type:none;
-    float:left;
-    padding-left:10px;
-    padding-right:15px;
-    background-repeat:no-repeat;
-    background-position:right;
-    color:#367C36;
-}
-
-.tablistpath li.tablistelem a
-{
-    height:32px;
-    display:block;
-    text-decoration: none;
-    outline: none;
-}
-
-.tablistpath li.tablistelem a:hover
-{
-    color:#68BD68;
-}
-
-.tablistpath li.footer
-{
-        list-style-type:none;
-        float:right;
-        padding-left:10px;
-        padding-right:15px;
-        background-image:none;
-        background-repeat:no-repeat;
-        background-position:right;
-        color:#367C36;
-        font-size: 8pt;
-}
-
-
-div.summary
-{
-    margin-top: 12px;
-    text-align: center;
-}
-
-div.summary a
-{
-    white-space: nowrap;
-}
-
-div.ingroups
-{
-    margin-left: 5px;
-    font-size: 8pt;
-    padding-left: 5px;
-    width: 50%;
-    text-align: left;
-}
-
-div.ingroups a
-{
-    white-space: nowrap;
-}
-
-div.headertitle
-{
-    padding: 5px 5px 5px 7px;
-}
-
-dl
-{
-        padding: 0 0 0 10px;
-}
-
-dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
-{
-        border-left:4px solid;
-        padding: 0 0 0 6px;
-}
-
-dl.note
-{
-        border-color: #D0C000;
-}
-
-dl.warning, dl.attention
-{
-        border-color: #FF0000;
-}
-
-dl.pre, dl.post, dl.invariant
-{
-        border-color: #00D000;
-}
-
-dl.deprecated
-{
-        border-color: #505050;
-}
-
-dl.todo
-{
-        border-color: #00C0E0;
-}
-
-dl.test
-{
-        border-color: #3030E0;
-}
-
-dl.bug
-{
-        border-color: #C08050;
-}
-
-#projectlogo
-{
-    text-align: center;
-    vertical-align: bottom;
-    border-collapse: separate;
-}
-
-#projectlogo img
-{
-    border: 0px none;
-}
-
-#projectname
-{
-    font: 300% Tahoma, Arial,sans-serif;
-    margin: 0px;
-    padding: 2px 0px;
-}
-
-#projectbrief
-{
-    font: 120% Tahoma, Arial,sans-serif;
-    margin: 0px;
-    padding: 0px;
-}
-
-#projectnumber
-{
-    font: 50% Tahoma, Arial,sans-serif;
-    margin: 0px;
-    padding: 0px;
-}
-
-#titlearea
-{
-    padding: 0px;
-    margin: 0px;
-    width: 100%;
-    border-bottom: 1px solid #53B453;
-}
-
-.image
-{
-        text-align: center;
-}
-
-.dotgraph
-{
-        text-align: center;
-}
-
-.mscgraph
-{
-        text-align: center;
-}
-
-.caption
-{
-    font-weight: bold;
-}
-
-div.zoom
-{
-    border: 1px solid #90CE90;
-}
-
-dl.citelist {
-        margin-bottom:50px;
-}
-
-dl.citelist dt {
-        color:#337533;
-        float:left;
-        font-weight:bold;
-        margin-right:10px;
-        padding:5px;
-}
-
-dl.citelist dd {
-        margin:2px 0;
-        padding:5px 0;
-}
-
- at media print
-{
-  #top { display: none; }
-  #side-nav { display: none; }
-  #nav-path { display: none; }
-  body { overflow:visible; }
-  h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
-  .summary { display: none; }
-  .memitem { page-break-inside: avoid; }
-  #doc-content
-  {
-    margin-left:0 !important;
-    height:auto !important;
-    width:auto !important;
-    overflow:inherit;
-    display:inline;
-  }
-  pre.fragment
-  {
-    overflow: visible;
-    text-wrap: unrestricted;
-    white-space: -moz-pre-wrap; /* Moz */
-    white-space: -pre-wrap; /* Opera 4-6 */
-    white-space: -o-pre-wrap; /* Opera 7 */
-    white-space: pre-wrap; /* CSS3  */
-    word-wrap: break-word; /* IE 5.5+ */
-  }
-}
-
-#proj_desc {
-    font-size: 1.2em;
-}
diff --git a/deps/libav/doc/doxy/footer.html b/deps/libav/doc/doxy/footer.html
deleted file mode 100644
index 101e6fe..0000000
--- a/deps/libav/doc/doxy/footer.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
- <footer class="footer pagination-right">
-   <span class="label label-info">
-    Generated on $datetime for $projectname by <a href="http://www.doxygen.org/index.html">doxygen</a> $doxygenversion
-   </span>
- </footer>
-</div>
-</body>
-</html>
diff --git a/deps/libav/doc/doxy/header.html b/deps/libav/doc/doxy/header.html
deleted file mode 100644
index 312990c..0000000
--- a/deps/libav/doc/doxy/header.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
-<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
-<link href="$relpath$doxy_stylesheet.css" rel="stylesheet" type="text/css" />
-<!--Header replace -->
-
-</head>
-
-<div class="container">
-
-<!--Header replace -->
-<div class="menu">
diff --git a/deps/libav/doc/encoders.texi b/deps/libav/doc/encoders.texi
deleted file mode 100644
index 24692b7..0000000
--- a/deps/libav/doc/encoders.texi
+++ /dev/null
@@ -1,754 +0,0 @@
- at chapter Encoders
- at c man begin ENCODERS
-
-Encoders are configured elements in Libav which allow the encoding of
-multimedia streams.
-
-When you configure your Libav build, all the supported native encoders
-are enabled by default. Encoders requiring an external library must be enabled
-manually via the corresponding @code{--enable-lib} option. You can list all
-available encoders using the configure option @code{--list-encoders}.
-
-You can disable all the encoders with the configure option
- at code{--disable-encoders} and selectively enable / disable single encoders
-with the options @code{--enable-encoder=@var{ENCODER}} /
- at code{--disable-encoder=@var{ENCODER}}.
-
-The option @code{-encoders} of the av* tools will display the list of
-enabled encoders.
-
- at c man end ENCODERS
-
- at chapter Audio Encoders
- at c man begin AUDIO ENCODERS
-
-A description of some of the currently available audio encoders
-follows.
-
- at section ac3 and ac3_fixed
-
-AC-3 audio encoders.
-
-These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
-the undocumented RealAudio 3 (a.k.a. dnet).
-
-The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
-encoder only uses fixed-point integer math. This does not mean that one is
-always faster, just that one or the other may be better suited to a
-particular system. The floating-point encoder will generally produce better
-quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
-default codec for any of the output formats, so it must be specified explicitly
-using the option @code{-acodec ac3_fixed} in order to use it.
-
- at subsection AC-3 Metadata
-
-The AC-3 metadata options are used to set parameters that describe the audio,
-but in most cases do not affect the audio encoding itself. Some of the options
-do directly affect or influence the decoding and playback of the resulting
-bitstream, while others are just for informational purposes. A few of the
-options will add bits to the output stream that could otherwise be used for
-audio data, and will thus affect the quality of the output. Those will be
-indicated accordingly with a note in the option list below.
-
-These parameters are described in detail in several publicly-available
-documents.
- at itemize
- at item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
- at item @uref{http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf,A/54 - Guide to the Use of the ATSC Digital Television Standard}
- at item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
- at item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
- at end itemize
-
- at subsubsection Metadata Control Options
-
- at table @option
-
- at item -per_frame_metadata @var{boolean}
-Allow Per-Frame Metadata. Specifies if the encoder should check for changing
-metadata for each frame.
- at table @option
- at item 0
-The metadata values set at initialization will be used for every frame in the
-stream. (default)
- at item 1
-Metadata values can be changed before encoding each frame.
- at end table
-
- at end table
-
- at subsubsection Downmix Levels
-
- at table @option
-
- at item -center_mixlev @var{level}
-Center Mix Level. The amount of gain the decoder should apply to the center
-channel when downmixing to stereo. This field will only be written to the
-bitstream if a center channel is present. The value is specified as a scale
-factor. There are 3 valid values:
- at table @option
- at item 0.707
-Apply -3dB gain
- at item 0.595
-Apply -4.5dB gain (default)
- at item 0.500
-Apply -6dB gain
- at end table
-
- at item -surround_mixlev @var{level}
-Surround Mix Level. The amount of gain the decoder should apply to the surround
-channel(s) when downmixing to stereo. This field will only be written to the
-bitstream if one or more surround channels are present. The value is specified
-as a scale factor.  There are 3 valid values:
- at table @option
- at item 0.707
-Apply -3dB gain
- at item 0.500
-Apply -6dB gain (default)
- at item 0.000
-Silence Surround Channel(s)
- at end table
-
- at end table
-
- at subsubsection Audio Production Information
-Audio Production Information is optional information describing the mixing
-environment.  Either none or both of the fields are written to the bitstream.
-
- at table @option
-
- at item -mixing_level @var{number}
-Mixing Level. Specifies peak sound pressure level (SPL) in the production
-environment when the mix was mastered. Valid values are 80 to 111, or -1 for
-unknown or not indicated. The default value is -1, but that value cannot be
-used if the Audio Production Information is written to the bitstream. Therefore,
-if the @code{room_type} option is not the default value, the @code{mixing_level}
-option must not be -1.
-
- at item -room_type @var{type}
-Room Type. Describes the equalization used during the final mixing session at
-the studio or on the dubbing stage. A large room is a dubbing stage with the
-industry standard X-curve equalization; a small room has flat equalization.
-This field will not be written to the bitstream if both the @code{mixing_level}
-option and the @code{room_type} option have the default values.
- at table @option
- at item 0
- at itemx notindicated
-Not Indicated (default)
- at item 1
- at itemx large
-Large Room
- at item 2
- at itemx small
-Small Room
- at end table
-
- at end table
-
- at subsubsection Other Metadata Options
-
- at table @option
-
- at item -copyright @var{boolean}
-Copyright Indicator. Specifies whether a copyright exists for this audio.
- at table @option
- at item 0
- at itemx off
-No Copyright Exists (default)
- at item 1
- at itemx on
-Copyright Exists
- at end table
-
- at item -dialnorm @var{value}
-Dialogue Normalization. Indicates how far the average dialogue level of the
-program is below digital 100% full scale (0 dBFS). This parameter determines a
-level shift during audio reproduction that sets the average volume of the
-dialogue to a preset level. The goal is to match volume level between program
-sources. A value of -31dB will result in no volume level change, relative to
-the source volume, during audio reproduction. Valid values are whole numbers in
-the range -31 to -1, with -31 being the default.
-
- at item -dsur_mode @var{mode}
-Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
-(Pro Logic). This field will only be written to the bitstream if the audio
-stream is stereo. Using this option does @b{NOT} mean the encoder will actually
-apply Dolby Surround processing.
- at table @option
- at item 0
- at itemx notindicated
-Not Indicated (default)
- at item 1
- at itemx off
-Not Dolby Surround Encoded
- at item 2
- at itemx on
-Dolby Surround Encoded
- at end table
-
- at item -original @var{boolean}
-Original Bit Stream Indicator. Specifies whether this audio is from the
-original source and not a copy.
- at table @option
- at item 0
- at itemx off
-Not Original Source
- at item 1
- at itemx on
-Original Source (default)
- at end table
-
- at end table
-
- at subsection Extended Bitstream Information
-The extended bitstream options are part of the Alternate Bit Stream Syntax as
-specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
-If any one parameter in a group is specified, all values in that group will be
-written to the bitstream.  Default values are used for those that are written
-but have not been specified.  If the mixing levels are written, the decoder
-will use these values instead of the ones specified in the @code{center_mixlev}
-and @code{surround_mixlev} options if it supports the Alternate Bit Stream
-Syntax.
-
- at subsubsection Extended Bitstream Information - Part 1
-
- at table @option
-
- at item -dmix_mode @var{mode}
-Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
-(Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
- at table @option
- at item 0
- at itemx notindicated
-Not Indicated (default)
- at item 1
- at itemx ltrt
-Lt/Rt Downmix Preferred
- at item 2
- at itemx loro
-Lo/Ro Downmix Preferred
- at end table
-
- at item -ltrt_cmixlev @var{level}
-Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
-center channel when downmixing to stereo in Lt/Rt mode.
- at table @option
- at item 1.414
-Apply +3dB gain
- at item 1.189
-Apply +1.5dB gain
- at item 1.000
-Apply 0dB gain
- at item 0.841
-Apply -1.5dB gain
- at item 0.707
-Apply -3.0dB gain
- at item 0.595
-Apply -4.5dB gain (default)
- at item 0.500
-Apply -6.0dB gain
- at item 0.000
-Silence Center Channel
- at end table
-
- at item -ltrt_surmixlev @var{level}
-Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
-surround channel(s) when downmixing to stereo in Lt/Rt mode.
- at table @option
- at item 0.841
-Apply -1.5dB gain
- at item 0.707
-Apply -3.0dB gain
- at item 0.595
-Apply -4.5dB gain
- at item 0.500
-Apply -6.0dB gain (default)
- at item 0.000
-Silence Surround Channel(s)
- at end table
-
- at item -loro_cmixlev @var{level}
-Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
-center channel when downmixing to stereo in Lo/Ro mode.
- at table @option
- at item 1.414
-Apply +3dB gain
- at item 1.189
-Apply +1.5dB gain
- at item 1.000
-Apply 0dB gain
- at item 0.841
-Apply -1.5dB gain
- at item 0.707
-Apply -3.0dB gain
- at item 0.595
-Apply -4.5dB gain (default)
- at item 0.500
-Apply -6.0dB gain
- at item 0.000
-Silence Center Channel
- at end table
-
- at item -loro_surmixlev @var{level}
-Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
-surround channel(s) when downmixing to stereo in Lo/Ro mode.
- at table @option
- at item 0.841
-Apply -1.5dB gain
- at item 0.707
-Apply -3.0dB gain
- at item 0.595
-Apply -4.5dB gain
- at item 0.500
-Apply -6.0dB gain (default)
- at item 0.000
-Silence Surround Channel(s)
- at end table
-
- at end table
-
- at subsubsection Extended Bitstream Information - Part 2
-
- at table @option
-
- at item -dsurex_mode @var{mode}
-Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
-(7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
-apply Dolby Surround EX processing.
- at table @option
- at item 0
- at itemx notindicated
-Not Indicated (default)
- at item 1
- at itemx on
-Dolby Surround EX Off
- at item 2
- at itemx off
-Dolby Surround EX On
- at end table
-
- at item -dheadphone_mode @var{mode}
-Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
-encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
-option does @b{NOT} mean the encoder will actually apply Dolby Headphone
-processing.
- at table @option
- at item 0
- at itemx notindicated
-Not Indicated (default)
- at item 1
- at itemx on
-Dolby Headphone Off
- at item 2
- at itemx off
-Dolby Headphone On
- at end table
-
- at item -ad_conv_type @var{type}
-A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
-conversion.
- at table @option
- at item 0
- at itemx standard
-Standard A/D Converter (default)
- at item 1
- at itemx hdcd
-HDCD A/D Converter
- at end table
-
- at end table
-
- at subsection Other AC-3 Encoding Options
-
- at table @option
-
- at item -stereo_rematrixing @var{boolean}
-Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
-is an optional AC-3 feature that increases quality by selectively encoding
-the left/right channels as mid/side. This option is enabled by default, and it
-is highly recommended that it be left as enabled except for testing purposes.
-
- at end table
-
- at subheading Floating-Point-Only AC-3 Encoding Options
-
-These options are only valid for the floating-point encoder and do not exist
-for the fixed-point encoder due to the corresponding features not being
-implemented in fixed-point.
-
- at table @option
-
- at item -channel_coupling @var{boolean}
-Enables/Disables use of channel coupling, which is an optional AC-3 feature
-that increases quality by combining high frequency information from multiple
-channels into a single channel. The per-channel high frequency information is
-sent with less accuracy in both the frequency and time domains. This allows
-more bits to be used for lower frequencies while preserving enough information
-to reconstruct the high frequencies. This option is enabled by default for the
-floating-point encoder and should generally be left as enabled except for
-testing purposes or to increase encoding speed.
- at table @option
- at item -1
- at itemx auto
-Selected by Encoder (default)
- at item 0
- at itemx off
-Disable Channel Coupling
- at item 1
- at itemx on
-Enable Channel Coupling
- at end table
-
- at item -cpl_start_band @var{number}
-Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
-value higher than the bandwidth is used, it will be reduced to 1 less than the
-coupling end band. If @var{auto} is used, the start band will be determined by
-the encoder based on the bit rate, sample rate, and channel layout. This option
-has no effect if channel coupling is disabled.
- at table @option
- at item -1
- at itemx auto
-Selected by Encoder (default)
- at end table
-
- at end table
-
- at section libwavpack
-
-A wrapper providing WavPack encoding through libwavpack.
-
-Only lossless mode using 32-bit integer samples is supported currently.
-The @option{compression_level} option can be used to control speed vs.
-compression tradeoff, with the values mapped to libwavpack as follows:
-
- at table @option
-
- at item 0
-Fast mode - corresponding to the wavpack @option{-f} option.
-
- at item 1
-Normal (default) settings.
-
- at item 2
-High quality - corresponding to the wavpack @option{-h} option.
-
- at item 3
-Very high quality - corresponding to the wavpack @option{-hh} option.
-
- at item 4-8
-Same as 3, but with extra processing enabled - corresponding to the wavpack
- at option{-x} option. I.e. 4 is the same as @option{-x2} and 8 is the same as
- at option{-x6}.
-
- at end table
-
- at c man end AUDIO ENCODERS
-
- at chapter Video Encoders
- at c man begin VIDEO ENCODERS
-
- at section libwebp
-
-libwebp WebP Image encoder wrapper
-
-libwebp is Google's official encoder for WebP images. It can encode in either
-lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
-frame. Lossless images are a separate codec developed by Google.
-
- at subsection Pixel Format
-
-Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
-to limitations of the format and libwebp. Alpha is supported for either mode.
-Because of API limitations, if RGB is passed in when encoding lossy or YUV is
-passed in for encoding lossless, the pixel format will automatically be
-converted using functions from libwebp. This is not ideal and is done only for
-convenience.
-
- at subsection Options
-
- at table @option
-
- at item -lossless @var{boolean}
-Enables/Disables use of lossless mode. Default is 0.
-
- at item -compression_level @var{integer}
-For lossy, this is a quality/speed tradeoff. Higher values give better quality
-for a given size at the cost of increased encoding time. For lossless, this is
-a size/speed tradeoff. Higher values give smaller size at the cost of increased
-encoding time. More specifically, it controls the number of extra algorithms
-and compression tools used, and varies the combination of these tools. This
-maps to the @var{method} option in libwebp. The valid range is 0 to 6.
-Default is 4.
-
- at item -qscale @var{float}
-For lossy encoding, this controls image quality, 0 to 100. For lossless
-encoding, this controls the effort and time spent at compressing more. The
-default value is 75. Note that for usage via libavcodec, this option is called
- at var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}.
-
- at item -preset @var{type}
-Configuration preset. This does some automatic settings based on the general
-type of the image.
- at table @option
- at item none
-Do not use a preset.
- at item default
-Use the encoder default.
- at item picture
-Digital picture, like portrait, inner shot
- at item photo
-Outdoor photograph, with natural lighting
- at item drawing
-Hand or line drawing, with high-contrast details
- at item icon
-Small-sized colorful images
- at item text
-Text-like
- at end table
-
- at end table
-
- at section libx264
-
-x264 H.264/MPEG-4 AVC encoder wrapper
-
-x264 supports an impressive number of features, including 8x8 and 4x4 adaptive
-spatial transform, adaptive B-frame placement, CAVLC/CABAC entropy coding,
-interlacing (MBAFF), lossless mode, psy optimizations for detail retention
-(adaptive quantization, psy-RD, psy-trellis).
-
-The Libav wrapper provides a mapping for most of them using global options
-that match those of the encoders and provides private options for the unique
-encoder options. Additionally an expert override is provided to directly pass
-a list of key=value tuples as accepted by x264_param_parse.
-
- at subsection Option Mapping
-
-The following options are supported by the x264 wrapper, the x264-equivalent
-options follow the Libav ones.
-
- at multitable @columnfractions .2 .2
- at item b                 @tab bitrate
-Libav @code{b} option is expressed in bits/s, x264 @code{bitrate} in kilobits/s.
- at item bf                @tab bframes
-Maximum number of B-frames.
- at item g                 @tab keyint
-Maximum GOP size.
- at item qmin              @tab qpmin
- at item qmax              @tab qpmax
- at item qdiff             @tab qpstep
- at item qblur             @tab qblur
- at item qcomp             @tab qcomp
- at item refs              @tab ref
- at item sc_threshold      @tab scenecut
- at item trellis           @tab trellis
- at item nr                @tab nr
-Noise reduction.
- at item me_range          @tab merange
- at item me_method         @tab me
- at item subq              @tab subme
- at item b_strategy        @tab b-adapt
- at item keyint_min        @tab keyint-min
- at item coder             @tab cabac
-Set coder to @code{ac} to use CABAC.
- at item cmp               @tab chroma-me
-Set to @code{chroma} to use chroma motion estimation.
- at item threads           @tab threads
- at item thread_type       @tab sliced_threads
-Set to @code{slice} to use sliced threading instead of frame threading.
- at item flags -cgop       @tab open-gop
-Set @code{-cgop} to use recovery points to close GOPs.
- at item rc_init_occupancy @tab vbv-init
-Initial buffer occupancy.
- at end multitable
-
- at subsection Private Options
- at table @option
- at item -preset @var{string}
-Set the encoding preset (cf. x264 --fullhelp).
- at item -tune @var{string}
-Tune the encoding params (cf. x264 --fullhelp).
- at item -profile @var{string}
-Set profile restrictions (cf. x264 --fullhelp).
- at item -fastfirstpass @var{integer}
-Use fast settings when encoding first pass.
- at item -crf @var{float}
-Select the quality for constant quality mode.
- at item -crf_max @var{float}
-In CRF mode, prevents VBV from lowering quality beyond this point.
- at item -qp @var{integer}
-Constant quantization parameter rate control method.
- at item -aq-mode @var{integer}
-AQ method
-
-Possible values:
- at table @samp
- at item none
-
- at item variance
-Variance AQ (complexity mask).
- at item autovariance
-Auto-variance AQ (experimental).
- at end table
- at item -aq-strength @var{float}
-AQ strength, reduces blocking and blurring in flat and textured areas.
- at item -psy @var{integer}
-Use psychovisual optimizations.
- at item -psy-rd @var{string}
-Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.
- at item -rc-lookahead @var{integer}
-Number of frames to look ahead for frametype and ratecontrol.
- at item -weightb @var{integer}
-Weighted prediction for B-frames.
- at item -weightp @var{integer}
-Weighted prediction analysis method.
-
-Possible values:
- at table @samp
- at item none
-
- at item simple
-
- at item smart
-
- at end table
- at item -ssim @var{integer}
-Calculate and print SSIM stats.
- at item -intra-refresh @var{integer}
-Use Periodic Intra Refresh instead of IDR frames.
- at item -bluray-compat @var{integer}
-Configure the encoder to be compatible with the bluray standard.
-It is a shorthand for setting "bluray-compat=1 force-cfr=1".
- at item -b-bias @var{integer}
-Influences how often B-frames are used.
- at item -b-pyramid @var{integer}
-Keep some B-frames as references.
-
-Possible values:
- at table @samp
- at item none
-
- at item strict
-Strictly hierarchical pyramid.
- at item normal
-Non-strict (not Blu-ray compatible).
- at end table
- at item -mixed-refs @var{integer}
-One reference per partition, as opposed to one reference per macroblock.
- at item -8x8dct @var{integer}
-High profile 8x8 transform.
- at item -fast-pskip @var{integer}
- at item -aud @var{integer}
-Use access unit delimiters.
- at item -mbtree @var{integer}
-Use macroblock tree ratecontrol.
- at item -deblock @var{string}
-Loop filter parameters, in <alpha:beta> form.
- at item -cplxblur @var{float}
-Reduce fluctuations in QP (before curve compression).
- at item -partitions @var{string}
-A comma-separated list of partitions to consider, possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all.
- at item -direct-pred @var{integer}
-Direct MV prediction mode
-
-Possible values:
- at table @samp
- at item none
-
- at item spatial
-
- at item temporal
-
- at item auto
-
- at end table
- at item -slice-max-size @var{integer}
-Limit the size of each slice in bytes.
- at item -stats @var{string}
-Filename for 2 pass stats.
- at item -nal-hrd @var{integer}
-Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4).
-
-Possible values:
- at table @samp
- at item none
-
- at item vbr
-
- at item cbr
-
- at end table
- at item -x264-params @var{string}
-Override the x264 configuration using a :-separated list of key=value parameters.
- at example
--x264-params level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:subq=6:8x8dct=0:trellis=0
- at end example
- at end table
-
-Encoding avpresets for common usages are provided so they can be used with the
-general presets system (e.g. passing the @code{-pre} option).
-
- at section ProRes
-
-Apple ProRes encoder.
-
- at subsection Private Options
-
- at table @option
- at item profile @var{integer}
-Select the ProRes profile to encode
- at table @samp
- at item proxy
- at item lt
- at item standard
- at item hq
- at item 4444
- at end table
-
- at item quant_mat @var{integer}
-Select quantization matrix.
- at table @samp
- at item auto
- at item default
- at item proxy
- at item lt
- at item standard
- at item hq
- at end table
-If set to @var{auto}, the matrix matching the profile will be picked.
-If not set, the matrix providing the highest quality, @var{default}, will be
-picked.
-
- at item bits_per_mb @var{integer}
-How many bits to allot for coding one macroblock. Different profiles use
-between 200 and 2400 bits per macroblock, the maximum is 8000.
-
- at item mbs_per_slice @var{integer}
-Number of macroblocks in each slice (1-8); the default value (8)
-should be good in almost all situations.
-
- at item vendor @var{string}
-Override the 4-byte vendor ID.
-A custom vendor ID like @var{apl0} would claim the stream was produced by
-the Apple encoder.
-
- at item alpha_bits @var{integer}
-Specify number of bits for alpha component.
-Possible values are @var{0}, @var{8} and @var{16}.
-Use @var{0} to disable alpha plane coding.
-
- at end table
-
- at subsection Speed considerations
-
-In the default mode of operation the encoder has to honor frame constraints
-(i.e. not produc frames with size bigger than requested) while still making
-output picture as good as possible.
-A frame containing a lot of small details is harder to compress and the encoder
-would spend more time searching for appropriate quantizers for each slice.
-
-Setting a higher @option{bits_per_mb} limit will improve the speed.
-
-For the fastest encoding speed set the @option{qscale} parameter (4 is the
-recommended value) and do not set a size constraint.
-
- at c man end VIDEO ENCODERS
diff --git a/deps/libav/doc/eval.texi b/deps/libav/doc/eval.texi
deleted file mode 100644
index e1fd7ee..0000000
--- a/deps/libav/doc/eval.texi
+++ /dev/null
@@ -1,156 +0,0 @@
- at chapter Expression Evaluation
- at c man begin EXPRESSION EVALUATION
-
-When evaluating an arithmetic expression, Libav uses an internal
-formula evaluator, implemented through the @file{libavutil/eval.h}
-interface.
-
-An expression may contain unary, binary operators, constants, and
-functions.
-
-Two expressions @var{expr1} and @var{expr2} can be combined to form
-another expression "@var{expr1};@var{expr2}".
- at var{expr1} and @var{expr2} are evaluated in turn, and the new
-expression evaluates to the value of @var{expr2}.
-
-The following binary operators are available: @code{+}, @code{-},
- at code{*}, @code{/}, @code{^}.
-
-The following unary operators are available: @code{+}, @code{-}.
-
-The following functions are available:
- at table @option
- 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 isinf(x)
-Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
- at item isnan(x)
-Return 1.0 if @var{x} is NAN, 0.0 otherwise.
-
- 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 st(var, expr)
-Allow to store the value of the expression @var{expr} in an internal
-variable. @var{var} specifies the number of the variable where to
-store the value, and it is a value ranging from 0 to 9. The function
-returns the value stored in the internal variable.
-
- at item ld(var)
-Allow to load the value of the internal variable with number
- at var{var}, which was previously stored with st(@var{var}, @var{expr}).
-The function returns the loaded value.
-
- at item while(cond, expr)
-Evaluate expression @var{expr} while the expression @var{cond} is
-non-zero, and returns the value of the last @var{expr} evaluation, or
-NAN if @var{cond} was always false.
-
- at item ceil(expr)
-Round the value of expression @var{expr} upwards to the nearest
-integer. For example, "ceil(1.5)" is "2.0".
-
- at item floor(expr)
-Round the value of expression @var{expr} downwards to the nearest
-integer. For example, "floor(-1.5)" is "-2.0".
-
- at item trunc(expr)
-Round the value of expression @var{expr} towards zero to the nearest
-integer. For example, "trunc(-1.5)" is "-1.0".
-
- at item sqrt(expr)
-Compute the square root of @var{expr}. This is equivalent to
-"(@var{expr})^.5".
-
- at item not(expr)
-Return 1.0 if @var{expr} is zero, 0.0 otherwise.
- at end table
-
-Note that:
-
- at code{*} works like AND
-
- at code{+} works like OR
-
-thus
- at example
-if A then B else C
- at end example
-is equivalent to
- at example
-A*B + not(A)*C
- at end example
-
-In your C code, you can extend the list of unary and binary functions,
-and define recognized constants, so that they are available for your
-expressions.
-
-The evaluator also recognizes the International System number
-postfixes. If 'i' is appended after the postfix, powers of 2 are used
-instead of powers of 10. The 'B' postfix multiplies the value for 8,
-and can be appended after another postfix or used alone. This allows
-using for example 'KB', 'MiB', 'G' and 'B' as postfix.
-
-Follows the list of available International System postfixes, with
-indication of the corresponding powers of 10 and of 2.
- at table @option
- at item y
--24 / -80
- at item z
--21 / -70
- at item a
--18 / -60
- at item f
--15 / -50
- at item p
--12 / -40
- at item n
--9 / -30
- at item u
--6 / -20
- at item m
--3 / -10
- at item c
--2
- at item d
--1
- at item h
-2
- at item k
-3 / 10
- at item K
-3 / 10
- at item M
-6 / 20
- at item G
-9 / 30
- at item T
-12 / 40
- at item P
-15 / 40
- at item E
-18 / 50
- at item Z
-21 / 60
- at item Y
-24 / 70
- at end table
-
- at c man end
diff --git a/deps/libav/doc/examples/avcodec.c b/deps/libav/doc/examples/avcodec.c
deleted file mode 100644
index 1478881..0000000
--- a/deps/libav/doc/examples/avcodec.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * libavcodec API use example.
- *
- * @example avcodec.c
- * Note that this library only handles codecs (mpeg, mpeg4, etc...),
- * not file formats (avi, vob, etc...). See library 'libavformat' for the
- * format handling
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef HAVE_AV_CONFIG_H
-#undef HAVE_AV_CONFIG_H
-#endif
-
-#include "libavcodec/avcodec.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/samplefmt.h"
-
-#define INBUF_SIZE 4096
-#define AUDIO_INBUF_SIZE 20480
-#define AUDIO_REFILL_THRESH 4096
-
-/* check that a given sample format is supported by the encoder */
-static int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt)
-{
-    const enum AVSampleFormat *p = codec->sample_fmts;
-
-    while (*p != AV_SAMPLE_FMT_NONE) {
-        if (*p == sample_fmt)
-            return 1;
-        p++;
-    }
-    return 0;
-}
-
-/* just pick the highest supported samplerate */
-static int select_sample_rate(AVCodec *codec)
-{
-    const int *p;
-    int best_samplerate = 0;
-
-    if (!codec->supported_samplerates)
-        return 44100;
-
-    p = codec->supported_samplerates;
-    while (*p) {
-        best_samplerate = FFMAX(*p, best_samplerate);
-        p++;
-    }
-    return best_samplerate;
-}
-
-/* select layout with the highest channel count */
-static int select_channel_layout(AVCodec *codec)
-{
-    const uint64_t *p;
-    uint64_t best_ch_layout = 0;
-    int best_nb_channels   = 0;
-
-    if (!codec->channel_layouts)
-        return AV_CH_LAYOUT_STEREO;
-
-    p = codec->channel_layouts;
-    while (*p) {
-        int nb_channels = av_get_channel_layout_nb_channels(*p);
-
-        if (nb_channels > best_nb_channels) {
-            best_ch_layout    = *p;
-            best_nb_channels = nb_channels;
-        }
-        p++;
-    }
-    return best_ch_layout;
-}
-
-/*
- * Audio encoding example
- */
-static void audio_encode_example(const char *filename)
-{
-    AVCodec *codec;
-    AVCodecContext *c= NULL;
-    AVFrame *frame;
-    AVPacket pkt;
-    int i, j, k, ret, got_output;
-    int buffer_size;
-    FILE *f;
-    uint16_t *samples;
-    float t, tincr;
-
-    printf("Audio encoding\n");
-
-    /* find the MP2 encoder */
-    codec = avcodec_find_encoder(AV_CODEC_ID_MP2);
-    if (!codec) {
-        fprintf(stderr, "codec not found\n");
-        exit(1);
-    }
-
-    c = avcodec_alloc_context3(codec);
-
-    /* put sample parameters */
-    c->bit_rate = 64000;
-
-    /* check that the encoder supports s16 pcm input */
-    c->sample_fmt = AV_SAMPLE_FMT_S16;
-    if (!check_sample_fmt(codec, c->sample_fmt)) {
-        fprintf(stderr, "encoder does not support %s",
-                av_get_sample_fmt_name(c->sample_fmt));
-        exit(1);
-    }
-
-    /* select other audio parameters supported by the encoder */
-    c->sample_rate    = select_sample_rate(codec);
-    c->channel_layout = select_channel_layout(codec);
-    c->channels       = av_get_channel_layout_nb_channels(c->channel_layout);
-
-    /* open it */
-    if (avcodec_open2(c, codec, NULL) < 0) {
-        fprintf(stderr, "could not open codec\n");
-        exit(1);
-    }
-
-    f = fopen(filename, "wb");
-    if (!f) {
-        fprintf(stderr, "could not open %s\n", filename);
-        exit(1);
-    }
-
-    /* frame containing input raw audio */
-    frame = av_frame_alloc();
-    if (!frame) {
-        fprintf(stderr, "could not allocate audio frame\n");
-        exit(1);
-    }
-
-    frame->nb_samples     = c->frame_size;
-    frame->format         = c->sample_fmt;
-    frame->channel_layout = c->channel_layout;
-
-    /* the codec gives us the frame size, in samples,
-     * we calculate the size of the samples buffer in bytes */
-    buffer_size = av_samples_get_buffer_size(NULL, c->channels, c->frame_size,
-                                             c->sample_fmt, 0);
-    samples = av_malloc(buffer_size);
-    if (!samples) {
-        fprintf(stderr, "could not allocate %d bytes for samples buffer\n",
-                buffer_size);
-        exit(1);
-    }
-    /* setup the data pointers in the AVFrame */
-    ret = avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt,
-                                   (const uint8_t*)samples, buffer_size, 0);
-    if (ret < 0) {
-        fprintf(stderr, "could not setup audio frame\n");
-        exit(1);
-    }
-
-    /* encode a single tone sound */
-    t = 0;
-    tincr = 2 * M_PI * 440.0 / c->sample_rate;
-    for(i=0;i<200;i++) {
-        av_init_packet(&pkt);
-        pkt.data = NULL; // packet data will be allocated by the encoder
-        pkt.size = 0;
-
-        for (j = 0; j < c->frame_size; j++) {
-            samples[2*j] = (int)(sin(t) * 10000);
-
-            for (k = 1; k < c->channels; k++)
-                samples[2*j + k] = samples[2*j];
-            t += tincr;
-        }
-        /* encode the samples */
-        ret = avcodec_encode_audio2(c, &pkt, frame, &got_output);
-        if (ret < 0) {
-            fprintf(stderr, "error encoding audio frame\n");
-            exit(1);
-        }
-        if (got_output) {
-            fwrite(pkt.data, 1, pkt.size, f);
-            av_free_packet(&pkt);
-        }
-    }
-    fclose(f);
-
-    av_freep(&samples);
-    av_frame_free(&frame);
-    avcodec_close(c);
-    av_free(c);
-}
-
-/*
- * Audio decoding.
- */
-static void audio_decode_example(const char *outfilename, const char *filename)
-{
-    AVCodec *codec;
-    AVCodecContext *c= NULL;
-    int len;
-    FILE *f, *outfile;
-    uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
-    AVPacket avpkt;
-    AVFrame *decoded_frame = NULL;
-
-    av_init_packet(&avpkt);
-
-    printf("Audio decoding\n");
-
-    /* find the mpeg audio decoder */
-    codec = avcodec_find_decoder(AV_CODEC_ID_MP2);
-    if (!codec) {
-        fprintf(stderr, "codec not found\n");
-        exit(1);
-    }
-
-    c = avcodec_alloc_context3(codec);
-
-    /* open it */
-    if (avcodec_open2(c, codec, NULL) < 0) {
-        fprintf(stderr, "could not open codec\n");
-        exit(1);
-    }
-
-    f = fopen(filename, "rb");
-    if (!f) {
-        fprintf(stderr, "could not open %s\n", filename);
-        exit(1);
-    }
-    outfile = fopen(outfilename, "wb");
-    if (!outfile) {
-        av_free(c);
-        exit(1);
-    }
-
-    /* decode until eof */
-    avpkt.data = inbuf;
-    avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
-
-    while (avpkt.size > 0) {
-        int got_frame = 0;
-
-        if (!decoded_frame) {
-            if (!(decoded_frame = av_frame_alloc())) {
-                fprintf(stderr, "out of memory\n");
-                exit(1);
-            }
-        }
-
-        len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
-        if (len < 0) {
-            fprintf(stderr, "Error while decoding\n");
-            exit(1);
-        }
-        if (got_frame) {
-            /* if a frame has been decoded, output it */
-            int data_size = av_samples_get_buffer_size(NULL, c->channels,
-                                                       decoded_frame->nb_samples,
-                                                       c->sample_fmt, 1);
-            fwrite(decoded_frame->data[0], 1, data_size, outfile);
-        }
-        avpkt.size -= len;
-        avpkt.data += len;
-        if (avpkt.size < AUDIO_REFILL_THRESH) {
-            /* Refill the input buffer, to avoid trying to decode
-             * incomplete frames. Instead of this, one could also use
-             * a parser, or use a proper container format through
-             * libavformat. */
-            memmove(inbuf, avpkt.data, avpkt.size);
-            avpkt.data = inbuf;
-            len = fread(avpkt.data + avpkt.size, 1,
-                        AUDIO_INBUF_SIZE - avpkt.size, f);
-            if (len > 0)
-                avpkt.size += len;
-        }
-    }
-
-    fclose(outfile);
-    fclose(f);
-
-    avcodec_close(c);
-    av_free(c);
-    av_frame_free(&decoded_frame);
-}
-
-/*
- * Video encoding example
- */
-static void video_encode_example(const char *filename)
-{
-    AVCodec *codec;
-    AVCodecContext *c= NULL;
-    int i, ret, x, y, got_output;
-    FILE *f;
-    AVFrame *picture;
-    AVPacket pkt;
-    uint8_t endcode[] = { 0, 0, 1, 0xb7 };
-
-    printf("Video encoding\n");
-
-    /* find the mpeg1 video encoder */
-    codec = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO);
-    if (!codec) {
-        fprintf(stderr, "codec not found\n");
-        exit(1);
-    }
-
-    c = avcodec_alloc_context3(codec);
-    picture = av_frame_alloc();
-
-    /* put sample parameters */
-    c->bit_rate = 400000;
-    /* resolution must be a multiple of two */
-    c->width = 352;
-    c->height = 288;
-    /* frames per second */
-    c->time_base= (AVRational){1,25};
-    c->gop_size = 10; /* emit one intra frame every ten frames */
-    c->max_b_frames=1;
-    c->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    /* open it */
-    if (avcodec_open2(c, codec, NULL) < 0) {
-        fprintf(stderr, "could not open codec\n");
-        exit(1);
-    }
-
-    f = fopen(filename, "wb");
-    if (!f) {
-        fprintf(stderr, "could not open %s\n", filename);
-        exit(1);
-    }
-
-    ret = av_image_alloc(picture->data, picture->linesize, c->width, c->height,
-                         c->pix_fmt, 32);
-    if (ret < 0) {
-        fprintf(stderr, "could not alloc raw picture buffer\n");
-        exit(1);
-    }
-    picture->format = c->pix_fmt;
-    picture->width  = c->width;
-    picture->height = c->height;
-
-    /* encode 1 second of video */
-    for(i=0;i<25;i++) {
-        av_init_packet(&pkt);
-        pkt.data = NULL;    // packet data will be allocated by the encoder
-        pkt.size = 0;
-
-        fflush(stdout);
-        /* prepare a dummy image */
-        /* Y */
-        for(y=0;y<c->height;y++) {
-            for(x=0;x<c->width;x++) {
-                picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3;
-            }
-        }
-
-        /* Cb and Cr */
-        for(y=0;y<c->height/2;y++) {
-            for(x=0;x<c->width/2;x++) {
-                picture->data[1][y * picture->linesize[1] + x] = 128 + y + i * 2;
-                picture->data[2][y * picture->linesize[2] + x] = 64 + x + i * 5;
-            }
-        }
-
-        picture->pts = i;
-
-        /* encode the image */
-        ret = avcodec_encode_video2(c, &pkt, picture, &got_output);
-        if (ret < 0) {
-            fprintf(stderr, "error encoding frame\n");
-            exit(1);
-        }
-
-        if (got_output) {
-            printf("encoding frame %3d (size=%5d)\n", i, pkt.size);
-            fwrite(pkt.data, 1, pkt.size, f);
-            av_free_packet(&pkt);
-        }
-    }
-
-    /* get the delayed frames */
-    for (got_output = 1; got_output; i++) {
-        fflush(stdout);
-
-        ret = avcodec_encode_video2(c, &pkt, NULL, &got_output);
-        if (ret < 0) {
-            fprintf(stderr, "error encoding frame\n");
-            exit(1);
-        }
-
-        if (got_output) {
-            printf("encoding frame %3d (size=%5d)\n", i, pkt.size);
-            fwrite(pkt.data, 1, pkt.size, f);
-            av_free_packet(&pkt);
-        }
-    }
-
-    /* add sequence end code to have a real mpeg file */
-    fwrite(endcode, 1, sizeof(endcode), f);
-    fclose(f);
-
-    avcodec_close(c);
-    av_free(c);
-    av_freep(&picture->data[0]);
-    av_frame_free(&picture);
-    printf("\n");
-}
-
-/*
- * Video decoding example
- */
-
-static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize,
-                     char *filename)
-{
-    FILE *f;
-    int i;
-
-    f=fopen(filename,"w");
-    fprintf(f,"P5\n%d %d\n%d\n",xsize,ysize,255);
-    for(i=0;i<ysize;i++)
-        fwrite(buf + i * wrap,1,xsize,f);
-    fclose(f);
-}
-
-static void video_decode_example(const char *outfilename, const char *filename)
-{
-    AVCodec *codec;
-    AVCodecContext *c= NULL;
-    int frame, got_picture, len;
-    FILE *f;
-    AVFrame *picture;
-    uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
-    char buf[1024];
-    AVPacket avpkt;
-
-    av_init_packet(&avpkt);
-
-    /* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */
-    memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-    printf("Video decoding\n");
-
-    /* find the mpeg1 video decoder */
-    codec = avcodec_find_decoder(AV_CODEC_ID_MPEG1VIDEO);
-    if (!codec) {
-        fprintf(stderr, "codec not found\n");
-        exit(1);
-    }
-
-    c = avcodec_alloc_context3(codec);
-    picture = av_frame_alloc();
-
-    if(codec->capabilities&CODEC_CAP_TRUNCATED)
-        c->flags|= CODEC_FLAG_TRUNCATED; /* we do not send complete frames */
-
-    /* For some codecs, such as msmpeg4 and mpeg4, width and height
-       MUST be initialized there because this information is not
-       available in the bitstream. */
-
-    /* open it */
-    if (avcodec_open2(c, codec, NULL) < 0) {
-        fprintf(stderr, "could not open codec\n");
-        exit(1);
-    }
-
-    /* the codec gives us the frame size, in samples */
-
-    f = fopen(filename, "rb");
-    if (!f) {
-        fprintf(stderr, "could not open %s\n", filename);
-        exit(1);
-    }
-
-    frame = 0;
-    for(;;) {
-        avpkt.size = fread(inbuf, 1, INBUF_SIZE, f);
-        if (avpkt.size == 0)
-            break;
-
-        /* NOTE1: some codecs are stream based (mpegvideo, mpegaudio)
-           and this is the only method to use them because you cannot
-           know the compressed data size before analysing it.
-
-           BUT some other codecs (msmpeg4, mpeg4) are inherently frame
-           based, so you must call them with all the data for one
-           frame exactly. You must also initialize 'width' and
-           'height' before initializing them. */
-
-        /* NOTE2: some codecs allow the raw parameters (frame size,
-           sample rate) to be changed at any frame. We handle this, so
-           you should also take care of it */
-
-        /* here, we use a stream based decoder (mpeg1video), so we
-           feed decoder and see if it could decode a frame */
-        avpkt.data = inbuf;
-        while (avpkt.size > 0) {
-            len = avcodec_decode_video2(c, picture, &got_picture, &avpkt);
-            if (len < 0) {
-                fprintf(stderr, "Error while decoding frame %d\n", frame);
-                exit(1);
-            }
-            if (got_picture) {
-                printf("saving frame %3d\n", frame);
-                fflush(stdout);
-
-                /* the picture is allocated by the decoder. no need to
-                   free it */
-                snprintf(buf, sizeof(buf), outfilename, frame);
-                pgm_save(picture->data[0], picture->linesize[0],
-                         c->width, c->height, buf);
-                frame++;
-            }
-            avpkt.size -= len;
-            avpkt.data += len;
-        }
-    }
-
-    /* some codecs, such as MPEG, transmit the I and P frame with a
-       latency of one frame. You must do the following to have a
-       chance to get the last frame of the video */
-    avpkt.data = NULL;
-    avpkt.size = 0;
-    len = avcodec_decode_video2(c, picture, &got_picture, &avpkt);
-    if (got_picture) {
-        printf("saving last frame %3d\n", frame);
-        fflush(stdout);
-
-        /* the picture is allocated by the decoder. no need to
-           free it */
-        snprintf(buf, sizeof(buf), outfilename, frame);
-        pgm_save(picture->data[0], picture->linesize[0],
-                 c->width, c->height, buf);
-        frame++;
-    }
-
-    fclose(f);
-
-    avcodec_close(c);
-    av_free(c);
-    av_frame_free(&picture);
-    printf("\n");
-}
-
-int main(int argc, char **argv)
-{
-    const char *filename;
-
-    /* register all the codecs */
-    avcodec_register_all();
-
-    if (argc <= 1) {
-        audio_encode_example("/tmp/test.mp2");
-        audio_decode_example("/tmp/test.sw", "/tmp/test.mp2");
-
-        video_encode_example("/tmp/test.mpg");
-        filename = "/tmp/test.mpg";
-    } else {
-        filename = argv[1];
-    }
-
-    //    audio_decode_example("/tmp/test.sw", filename);
-    video_decode_example("/tmp/test%d.pgm", filename);
-
-    return 0;
-}
diff --git a/deps/libav/doc/examples/metadata.c b/deps/libav/doc/examples/metadata.c
deleted file mode 100644
index f4c6eee..0000000
--- a/deps/libav/doc/examples/metadata.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2011 Reinhard Tartler
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-/**
- * @file
- * @example metadata.c
- * Shows how the metadata API can be used in application programs.
- */
-
-#include <stdio.h>
-
-#include <libavformat/avformat.h>
-#include <libavutil/dict.h>
-
-int main (int argc, char **argv)
-{
-    AVFormatContext *fmt_ctx = NULL;
-    AVDictionaryEntry *tag = NULL;
-    int ret;
-
-    if (argc != 2) {
-        printf("usage: %s <input_file>\n"
-               "example program to demonstrate the use of the libavformat metadata API.\n"
-               "\n", argv[0]);
-        return 1;
-    }
-
-    av_register_all();
-    if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL)))
-        return ret;
-
-    while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
-        printf("%s=%s\n", tag->key, tag->value);
-
-    avformat_free_context(fmt_ctx);
-    return 0;
-}
diff --git a/deps/libav/doc/examples/output.c b/deps/libav/doc/examples/output.c
deleted file mode 100644
index dd0e6a2..0000000
--- a/deps/libav/doc/examples/output.c
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- * Copyright (c) 2003 Fabrice Bellard
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-/**
- * @file
- * libavformat API example.
- *
- * @example output.c
- * Output a media file in any supported libavformat format. The default
- * codecs are used.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include "libavutil/mathematics.h"
-#include "libavformat/avformat.h"
-#include "libswscale/swscale.h"
-
-/* 5 seconds stream duration */
-#define STREAM_DURATION   5.0
-#define STREAM_FRAME_RATE 25 /* 25 images/s */
-#define STREAM_NB_FRAMES  ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
-#define STREAM_PIX_FMT    AV_PIX_FMT_YUV420P /* default pix_fmt */
-
-static int sws_flags = SWS_BICUBIC;
-
-/**************************************************************/
-/* audio output */
-
-static float t, tincr, tincr2;
-static int16_t *samples;
-static int audio_input_frame_size;
-
-/*
- * add an audio output stream
- */
-static AVStream *add_audio_stream(AVFormatContext *oc, enum AVCodecID codec_id)
-{
-    AVCodecContext *c;
-    AVStream *st;
-    AVCodec *codec;
-
-    /* find the audio encoder */
-    codec = avcodec_find_encoder(codec_id);
-    if (!codec) {
-        fprintf(stderr, "codec not found\n");
-        exit(1);
-    }
-
-    st = avformat_new_stream(oc, codec);
-    if (!st) {
-        fprintf(stderr, "Could not alloc stream\n");
-        exit(1);
-    }
-
-    c = st->codec;
-
-    /* put sample parameters */
-    c->sample_fmt  = AV_SAMPLE_FMT_S16;
-    c->bit_rate    = 64000;
-    c->sample_rate = 44100;
-    c->channels    = 2;
-
-    // some formats want stream headers to be separate
-    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
-        c->flags |= CODEC_FLAG_GLOBAL_HEADER;
-
-    return st;
-}
-
-static void open_audio(AVFormatContext *oc, AVStream *st)
-{
-    AVCodecContext *c;
-
-    c = st->codec;
-
-    /* open it */
-    if (avcodec_open2(c, NULL, NULL) < 0) {
-        fprintf(stderr, "could not open codec\n");
-        exit(1);
-    }
-
-    /* init signal generator */
-    t     = 0;
-    tincr = 2 * M_PI * 110.0 / c->sample_rate;
-    /* increment frequency by 110 Hz per second */
-    tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate;
-
-    if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
-        audio_input_frame_size = 10000;
-    else
-        audio_input_frame_size = c->frame_size;
-    samples = av_malloc(audio_input_frame_size *
-                        av_get_bytes_per_sample(c->sample_fmt) *
-                        c->channels);
-}
-
-/* Prepare a 16 bit dummy audio frame of 'frame_size' samples and
- * 'nb_channels' channels. */
-static void get_audio_frame(int16_t *samples, int frame_size, int nb_channels)
-{
-    int j, i, v;
-    int16_t *q;
-
-    q = samples;
-    for (j = 0; j < frame_size; j++) {
-        v = (int)(sin(t) * 10000);
-        for (i = 0; i < nb_channels; i++)
-            *q++ = v;
-        t     += tincr;
-        tincr += tincr2;
-    }
-}
-
-static void write_audio_frame(AVFormatContext *oc, AVStream *st)
-{
-    AVCodecContext *c;
-    AVPacket pkt = { 0 }; // data and size must be 0;
-    AVFrame *frame = av_frame_alloc();
-    int got_packet;
-
-    av_init_packet(&pkt);
-    c = st->codec;
-
-    get_audio_frame(samples, audio_input_frame_size, c->channels);
-    frame->nb_samples = audio_input_frame_size;
-    avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt,
-                             (uint8_t *)samples,
-                             audio_input_frame_size *
-                             av_get_bytes_per_sample(c->sample_fmt) *
-                             c->channels, 1);
-
-    avcodec_encode_audio2(c, &pkt, frame, &got_packet);
-    if (!got_packet)
-        return;
-
-    pkt.stream_index = st->index;
-
-    /* Write the compressed frame to the media file. */
-    if (av_interleaved_write_frame(oc, &pkt) != 0) {
-        fprintf(stderr, "Error while writing audio frame\n");
-        exit(1);
-    }
-    av_frame_free(&frame);
-}
-
-static void close_audio(AVFormatContext *oc, AVStream *st)
-{
-    avcodec_close(st->codec);
-
-    av_free(samples);
-}
-
-/**************************************************************/
-/* video output */
-
-static AVFrame *picture, *tmp_picture;
-static int frame_count;
-
-/* Add a video output stream. */
-static AVStream *add_video_stream(AVFormatContext *oc, enum AVCodecID codec_id)
-{
-    AVCodecContext *c;
-    AVStream *st;
-    AVCodec *codec;
-
-    /* find the video encoder */
-    codec = avcodec_find_encoder(codec_id);
-    if (!codec) {
-        fprintf(stderr, "codec not found\n");
-        exit(1);
-    }
-
-    st = avformat_new_stream(oc, codec);
-    if (!st) {
-        fprintf(stderr, "Could not alloc stream\n");
-        exit(1);
-    }
-
-    c = st->codec;
-
-    /* Put sample parameters. */
-    c->bit_rate = 400000;
-    /* Resolution must be a multiple of two. */
-    c->width    = 352;
-    c->height   = 288;
-    /* timebase: This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented. For fixed-fps content,
-     * timebase should be 1/framerate and timestamp increments should be
-     * identical to 1. */
-    c->time_base.den = STREAM_FRAME_RATE;
-    c->time_base.num = 1;
-    c->gop_size      = 12; /* emit one intra frame every twelve frames at most */
-    c->pix_fmt       = STREAM_PIX_FMT;
-    if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-        /* just for testing, we also add B frames */
-        c->max_b_frames = 2;
-    }
-    if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
-        /* Needed to avoid using macroblocks in which some coeffs overflow.
-         * This does not happen with normal video, it just happens here as
-         * the motion of the chroma plane does not match the luma plane. */
-        c->mb_decision = 2;
-    }
-    /* Some formats want stream headers to be separate. */
-    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
-        c->flags |= CODEC_FLAG_GLOBAL_HEADER;
-
-    return st;
-}
-
-static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height)
-{
-    AVFrame *picture;
-    uint8_t *picture_buf;
-    int size;
-
-    picture = av_frame_alloc();
-    if (!picture)
-        return NULL;
-    size        = avpicture_get_size(pix_fmt, width, height);
-    picture_buf = av_malloc(size);
-    if (!picture_buf) {
-        av_free(picture);
-        return NULL;
-    }
-    avpicture_fill((AVPicture *)picture, picture_buf,
-                   pix_fmt, width, height);
-    return picture;
-}
-
-static void open_video(AVFormatContext *oc, AVStream *st)
-{
-    AVCodecContext *c;
-
-    c = st->codec;
-
-    /* open the codec */
-    if (avcodec_open2(c, NULL, NULL) < 0) {
-        fprintf(stderr, "could not open codec\n");
-        exit(1);
-    }
-
-    /* Allocate the encoded raw picture. */
-    picture = alloc_picture(c->pix_fmt, c->width, c->height);
-    if (!picture) {
-        fprintf(stderr, "Could not allocate picture\n");
-        exit(1);
-    }
-
-    /* If the output format is not YUV420P, then a temporary YUV420P
-     * picture is needed too. It is then converted to the required
-     * output format. */
-    tmp_picture = NULL;
-    if (c->pix_fmt != AV_PIX_FMT_YUV420P) {
-        tmp_picture = alloc_picture(AV_PIX_FMT_YUV420P, c->width, c->height);
-        if (!tmp_picture) {
-            fprintf(stderr, "Could not allocate temporary picture\n");
-            exit(1);
-        }
-    }
-}
-
-/* Prepare a dummy image. */
-static void fill_yuv_image(AVFrame *pict, int frame_index,
-                           int width, int height)
-{
-    int x, y, i;
-
-    i = frame_index;
-
-    /* Y */
-    for (y = 0; y < height; y++)
-        for (x = 0; x < width; x++)
-            pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3;
-
-    /* Cb and Cr */
-    for (y = 0; y < height / 2; y++) {
-        for (x = 0; x < width / 2; x++) {
-            pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2;
-            pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5;
-        }
-    }
-}
-
-static void write_video_frame(AVFormatContext *oc, AVStream *st)
-{
-    int ret;
-    AVCodecContext *c;
-    static struct SwsContext *img_convert_ctx;
-
-    c = st->codec;
-
-    if (frame_count >= STREAM_NB_FRAMES) {
-        /* No more frames to compress. The codec has a latency of a few
-         * frames if using B-frames, so we get the last frames by
-         * passing the same picture again. */
-    } else {
-        if (c->pix_fmt != AV_PIX_FMT_YUV420P) {
-            /* as we only generate a YUV420P picture, we must convert it
-             * to the codec pixel format if needed */
-            if (img_convert_ctx == NULL) {
-                img_convert_ctx = sws_getContext(c->width, c->height,
-                                                 AV_PIX_FMT_YUV420P,
-                                                 c->width, c->height,
-                                                 c->pix_fmt,
-                                                 sws_flags, NULL, NULL, NULL);
-                if (img_convert_ctx == NULL) {
-                    fprintf(stderr,
-                            "Cannot initialize the conversion context\n");
-                    exit(1);
-                }
-            }
-            fill_yuv_image(tmp_picture, frame_count, c->width, c->height);
-            sws_scale(img_convert_ctx, tmp_picture->data, tmp_picture->linesize,
-                      0, c->height, picture->data, picture->linesize);
-        } else {
-            fill_yuv_image(picture, frame_count, c->width, c->height);
-        }
-    }
-
-    if (oc->oformat->flags & AVFMT_RAWPICTURE) {
-        /* Raw video case - the API will change slightly in the near
-         * future for that. */
-        AVPacket pkt;
-        av_init_packet(&pkt);
-
-        pkt.flags        |= AV_PKT_FLAG_KEY;
-        pkt.stream_index  = st->index;
-        pkt.data          = (uint8_t *)picture;
-        pkt.size          = sizeof(AVPicture);
-
-        ret = av_interleaved_write_frame(oc, &pkt);
-    } else {
-        AVPacket pkt = { 0 };
-        int got_packet;
-        av_init_packet(&pkt);
-
-        /* encode the image */
-        ret = avcodec_encode_video2(c, &pkt, picture, &got_packet);
-        /* If size is zero, it means the image was buffered. */
-        if (!ret && got_packet && pkt.size) {
-            if (pkt.pts != AV_NOPTS_VALUE) {
-                pkt.pts = av_rescale_q(pkt.pts,
-                                       c->time_base, st->time_base);
-            }
-            if (pkt.dts != AV_NOPTS_VALUE) {
-                pkt.dts = av_rescale_q(pkt.dts,
-                                       c->time_base, st->time_base);
-            }
-            pkt.stream_index = st->index;
-
-            /* Write the compressed frame to the media file. */
-            ret = av_interleaved_write_frame(oc, &pkt);
-        } else {
-            ret = 0;
-        }
-    }
-    if (ret != 0) {
-        fprintf(stderr, "Error while writing video frame\n");
-        exit(1);
-    }
-    frame_count++;
-}
-
-static void close_video(AVFormatContext *oc, AVStream *st)
-{
-    avcodec_close(st->codec);
-    av_free(picture->data[0]);
-    av_free(picture);
-    if (tmp_picture) {
-        av_free(tmp_picture->data[0]);
-        av_free(tmp_picture);
-    }
-}
-
-/**************************************************************/
-/* media file output */
-
-int main(int argc, char **argv)
-{
-    const char *filename;
-    AVOutputFormat *fmt;
-    AVFormatContext *oc;
-    AVStream *audio_st, *video_st;
-    double audio_pts, video_pts;
-    int i;
-
-    /* Initialize libavcodec, and register all codecs and formats. */
-    av_register_all();
-
-    if (argc != 2) {
-        printf("usage: %s output_file\n"
-               "API example program to output a media file with libavformat.\n"
-               "The output format is automatically guessed according to the file extension.\n"
-               "Raw images can also be output by using '%%d' in the filename\n"
-               "\n", argv[0]);
-        return 1;
-    }
-
-    filename = argv[1];
-
-    /* Autodetect the output format from the name. default is MPEG. */
-    fmt = av_guess_format(NULL, filename, NULL);
-    if (!fmt) {
-        printf("Could not deduce output format from file extension: using MPEG.\n");
-        fmt = av_guess_format("mpeg", NULL, NULL);
-    }
-    if (!fmt) {
-        fprintf(stderr, "Could not find suitable output format\n");
-        return 1;
-    }
-
-    /* Allocate the output media context. */
-    oc = avformat_alloc_context();
-    if (!oc) {
-        fprintf(stderr, "Memory error\n");
-        return 1;
-    }
-    oc->oformat = fmt;
-    snprintf(oc->filename, sizeof(oc->filename), "%s", filename);
-
-    /* Add the audio and video streams using the default format codecs
-     * and initialize the codecs. */
-    video_st = NULL;
-    audio_st = NULL;
-    if (fmt->video_codec != AV_CODEC_ID_NONE) {
-        video_st = add_video_stream(oc, fmt->video_codec);
-    }
-    if (fmt->audio_codec != AV_CODEC_ID_NONE) {
-        audio_st = add_audio_stream(oc, fmt->audio_codec);
-    }
-
-    /* Now that all the parameters are set, we can open the audio and
-     * video codecs and allocate the necessary encode buffers. */
-    if (video_st)
-        open_video(oc, video_st);
-    if (audio_st)
-        open_audio(oc, audio_st);
-
-    av_dump_format(oc, 0, filename, 1);
-
-    /* open the output file, if needed */
-    if (!(fmt->flags & AVFMT_NOFILE)) {
-        if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
-            fprintf(stderr, "Could not open '%s'\n", filename);
-            return 1;
-        }
-    }
-
-    /* Write the stream header, if any. */
-    avformat_write_header(oc, NULL);
-
-    for (;;) {
-        /* Compute current audio and video time. */
-        if (audio_st)
-            audio_pts = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;
-        else
-            audio_pts = 0.0;
-
-        if (video_st)
-            video_pts = (double)video_st->pts.val * video_st->time_base.num /
-                        video_st->time_base.den;
-        else
-            video_pts = 0.0;
-
-        if ((!audio_st || audio_pts >= STREAM_DURATION) &&
-            (!video_st || video_pts >= STREAM_DURATION))
-            break;
-
-        /* write interleaved audio and video frames */
-        if (!video_st || (video_st && audio_st && audio_pts < video_pts)) {
-            write_audio_frame(oc, audio_st);
-        } else {
-            write_video_frame(oc, video_st);
-        }
-    }
-
-    /* Write the trailer, if any. The trailer must be written before you
-     * close the CodecContexts open when you wrote the header; otherwise
-     * av_write_trailer() may try to use memory that was freed on
-     * av_codec_close(). */
-    av_write_trailer(oc);
-
-    /* Close each codec. */
-    if (video_st)
-        close_video(oc, video_st);
-    if (audio_st)
-        close_audio(oc, audio_st);
-
-    /* Free the streams. */
-    for (i = 0; i < oc->nb_streams; i++) {
-        av_freep(&oc->streams[i]->codec);
-        av_freep(&oc->streams[i]);
-    }
-
-    if (!(fmt->flags & AVFMT_NOFILE))
-        /* Close the output file. */
-        avio_close(oc->pb);
-
-    /* free the stream */
-    av_free(oc);
-
-    return 0;
-}
diff --git a/deps/libav/doc/examples/transcode_aac.c b/deps/libav/doc/examples/transcode_aac.c
deleted file mode 100644
index 6206afe..0000000
--- a/deps/libav/doc/examples/transcode_aac.c
+++ /dev/null
@@ -1,772 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * simple audio converter
- *
- * @example transcode_aac.c
- * Convert an input audio file to AAC in an MP4 container using Libav.
- * @author Andreas Unterweger (dustsigns at gmail.com)
- */
-
-#include <stdio.h>
-
-#include "libavformat/avformat.h"
-#include "libavformat/avio.h"
-
-#include "libavcodec/avcodec.h"
-
-#include "libavutil/audio_fifo.h"
-#include "libavutil/avstring.h"
-#include "libavutil/frame.h"
-#include "libavutil/opt.h"
-
-#include "libavresample/avresample.h"
-
-/** The output bit rate in kbit/s */
-#define OUTPUT_BIT_RATE 48000
-/** The number of output channels */
-#define OUTPUT_CHANNELS 2
-/** The audio sample output format */
-#define OUTPUT_SAMPLE_FORMAT AV_SAMPLE_FMT_S16
-
-/**
- * Convert an error code into a text message.
- * @param error Error code to be converted
- * @return Corresponding error text (not thread-safe)
- */
-static char *const get_error_text(const int error)
-{
-    static char error_buffer[255];
-    av_strerror(error, error_buffer, sizeof(error_buffer));
-    return error_buffer;
-}
-
-/** Open an input file and the required decoder. */
-static int open_input_file(const char *filename,
-                           AVFormatContext **input_format_context,
-                           AVCodecContext **input_codec_context)
-{
-    AVCodec *input_codec;
-    int error;
-
-    /** Open the input file to read from it. */
-    if ((error = avformat_open_input(input_format_context, filename, NULL,
-                                     NULL)) < 0) {
-        fprintf(stderr, "Could not open input file '%s' (error '%s')\n",
-                filename, get_error_text(error));
-        *input_format_context = NULL;
-        return error;
-    }
-
-    /** Get information on the input file (number of streams etc.). */
-    if ((error = avformat_find_stream_info(*input_format_context, NULL)) < 0) {
-        fprintf(stderr, "Could not open find stream info (error '%s')\n",
-                get_error_text(error));
-        avformat_close_input(input_format_context);
-        return error;
-    }
-
-    /** Make sure that there is only one stream in the input file. */
-    if ((*input_format_context)->nb_streams != 1) {
-        fprintf(stderr, "Expected one audio input stream, but found %d\n",
-                (*input_format_context)->nb_streams);
-        avformat_close_input(input_format_context);
-        return AVERROR_EXIT;
-    }
-
-    /** Find a decoder for the audio stream. */
-    if (!(input_codec = avcodec_find_decoder((*input_format_context)->streams[0]->codec->codec_id))) {
-        fprintf(stderr, "Could not find input codec\n");
-        avformat_close_input(input_format_context);
-        return AVERROR_EXIT;
-    }
-
-    /** Open the decoder for the audio stream to use it later. */
-    if ((error = avcodec_open2((*input_format_context)->streams[0]->codec,
-                               input_codec, NULL)) < 0) {
-        fprintf(stderr, "Could not open input codec (error '%s')\n",
-                get_error_text(error));
-        avformat_close_input(input_format_context);
-        return error;
-    }
-
-    /** Save the decoder context for easier access later. */
-    *input_codec_context = (*input_format_context)->streams[0]->codec;
-
-    return 0;
-}
-
-/**
- * Open an output file and the required encoder.
- * Also set some basic encoder parameters.
- * Some of these parameters are based on the input file's parameters.
- */
-static int open_output_file(const char *filename,
-                            AVCodecContext *input_codec_context,
-                            AVFormatContext **output_format_context,
-                            AVCodecContext **output_codec_context)
-{
-    AVIOContext *output_io_context = NULL;
-    AVStream *stream               = NULL;
-    AVCodec *output_codec          = NULL;
-    int error;
-
-    /** Open the output file to write to it. */
-    if ((error = avio_open(&output_io_context, filename,
-                           AVIO_FLAG_WRITE)) < 0) {
-        fprintf(stderr, "Could not open output file '%s' (error '%s')\n",
-                filename, get_error_text(error));
-        return error;
-    }
-
-    /** Create a new format context for the output container format. */
-    if (!(*output_format_context = avformat_alloc_context())) {
-        fprintf(stderr, "Could not allocate output format context\n");
-        return AVERROR(ENOMEM);
-    }
-
-    /** Associate the output file (pointer) with the container format context. */
-    (*output_format_context)->pb = output_io_context;
-
-    /** Guess the desired container format based on the file extension. */
-    if (!((*output_format_context)->oformat = av_guess_format(NULL, filename,
-                                                              NULL))) {
-        fprintf(stderr, "Could not find output file format\n");
-        goto cleanup;
-    }
-
-    av_strlcpy((*output_format_context)->filename, filename,
-               sizeof((*output_format_context)->filename));
-
-    /** Find the encoder to be used by its name. */
-    if (!(output_codec = avcodec_find_encoder(AV_CODEC_ID_AAC))) {
-        fprintf(stderr, "Could not find an AAC encoder.\n");
-        goto cleanup;
-    }
-
-    /** Create a new audio stream in the output file container. */
-    if (!(stream = avformat_new_stream(*output_format_context, output_codec))) {
-        fprintf(stderr, "Could not create new stream\n");
-        error = AVERROR(ENOMEM);
-        goto cleanup;
-    }
-
-    /** Save the encoder context for easiert access later. */
-    *output_codec_context = stream->codec;
-
-    /**
-     * Set the basic encoder parameters.
-     * The input file's sample rate is used to avoid a sample rate conversion.
-     */
-    (*output_codec_context)->channels       = OUTPUT_CHANNELS;
-    (*output_codec_context)->channel_layout = av_get_default_channel_layout(OUTPUT_CHANNELS);
-    (*output_codec_context)->sample_rate    = input_codec_context->sample_rate;
-    (*output_codec_context)->sample_fmt     = AV_SAMPLE_FMT_S16;
-    (*output_codec_context)->bit_rate       = OUTPUT_BIT_RATE;
-
-    /**
-     * Some container formats (like MP4) require global headers to be present
-     * Mark the encoder so that it behaves accordingly.
-     */
-    if ((*output_format_context)->oformat->flags & AVFMT_GLOBALHEADER)
-        (*output_codec_context)->flags |= CODEC_FLAG_GLOBAL_HEADER;
-
-    /** Open the encoder for the audio stream to use it later. */
-    if ((error = avcodec_open2(*output_codec_context, output_codec, NULL)) < 0) {
-        fprintf(stderr, "Could not open output codec (error '%s')\n",
-                get_error_text(error));
-        goto cleanup;
-    }
-
-    return 0;
-
-cleanup:
-    avio_close((*output_format_context)->pb);
-    avformat_free_context(*output_format_context);
-    *output_format_context = NULL;
-    return error < 0 ? error : AVERROR_EXIT;
-}
-
-/** Initialize one data packet for reading or writing. */
-static void init_packet(AVPacket *packet)
-{
-    av_init_packet(packet);
-    /** Set the packet data and size so that it is recognized as being empty. */
-    packet->data = NULL;
-    packet->size = 0;
-}
-
-/** Initialize one audio frame for reading from the input file */
-static int init_input_frame(AVFrame **frame)
-{
-    if (!(*frame = av_frame_alloc())) {
-        fprintf(stderr, "Could not allocate input frame\n");
-        return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-/**
- * Initialize the audio resampler based on the input and output codec settings.
- * If the input and output sample formats differ, a conversion is required
- * libavresample takes care of this, but requires initialization.
- */
-static int init_resampler(AVCodecContext *input_codec_context,
-                          AVCodecContext *output_codec_context,
-                          AVAudioResampleContext **resample_context)
-{
-    /**
-     * Only initialize the resampler if it is necessary, i.e.,
-     * if and only if the sample formats differ.
-     */
-    if (input_codec_context->sample_fmt != output_codec_context->sample_fmt ||
-        input_codec_context->channels != output_codec_context->channels) {
-        int error;
-
-        /** Create a resampler context for the conversion. */
-        if (!(*resample_context = avresample_alloc_context())) {
-            fprintf(stderr, "Could not allocate resample context\n");
-            return AVERROR(ENOMEM);
-        }
-
-        /**
-         * Set the conversion parameters.
-         * Default channel layouts based on the number of channels
-         * are assumed for simplicity (they are sometimes not detected
-         * properly by the demuxer and/or decoder).
-         */
-        av_opt_set_int(*resample_context, "in_channel_layout",
-                       av_get_default_channel_layout(input_codec_context->channels), 0);
-        av_opt_set_int(*resample_context, "out_channel_layout",
-                       av_get_default_channel_layout(output_codec_context->channels), 0);
-        av_opt_set_int(*resample_context, "in_sample_rate",
-                       input_codec_context->sample_rate, 0);
-        av_opt_set_int(*resample_context, "out_sample_rate",
-                       output_codec_context->sample_rate, 0);
-        av_opt_set_int(*resample_context, "in_sample_fmt",
-                       input_codec_context->sample_fmt, 0);
-        av_opt_set_int(*resample_context, "out_sample_fmt",
-                       output_codec_context->sample_fmt, 0);
-
-        /** Open the resampler with the specified parameters. */
-        if ((error = avresample_open(*resample_context)) < 0) {
-            fprintf(stderr, "Could not open resample context\n");
-            avresample_free(resample_context);
-            return error;
-        }
-    }
-    return 0;
-}
-
-/** Initialize a FIFO buffer for the audio samples to be encoded. */
-static int init_fifo(AVAudioFifo **fifo)
-{
-    /** Create the FIFO buffer based on the specified output sample format. */
-    if (!(*fifo = av_audio_fifo_alloc(OUTPUT_SAMPLE_FORMAT, OUTPUT_CHANNELS, 1))) {
-        fprintf(stderr, "Could not allocate FIFO\n");
-        return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-/** Write the header of the output file container. */
-static int write_output_file_header(AVFormatContext *output_format_context)
-{
-    int error;
-    if ((error = avformat_write_header(output_format_context, NULL)) < 0) {
-        fprintf(stderr, "Could not write output file header (error '%s')\n",
-                get_error_text(error));
-        return error;
-    }
-    return 0;
-}
-
-/** Decode one audio frame from the input file. */
-static int decode_audio_frame(AVFrame *frame,
-                              AVFormatContext *input_format_context,
-                              AVCodecContext *input_codec_context,
-                              int *data_present, int *finished)
-{
-    /** Packet used for temporary storage. */
-    AVPacket input_packet;
-    int error;
-    init_packet(&input_packet);
-
-    /** Read one audio frame from the input file into a temporary packet. */
-    if ((error = av_read_frame(input_format_context, &input_packet)) < 0) {
-        /** If we are the the end of the file, flush the decoder below. */
-        if (error == AVERROR_EOF)
-            *finished = 1;
-        else {
-            fprintf(stderr, "Could not read frame (error '%s')\n",
-                    get_error_text(error));
-            return error;
-        }
-    }
-
-    /**
-     * Decode the audio frame stored in the temporary packet.
-     * The input audio stream decoder is used to do this.
-     * If we are at the end of the file, pass an empty packet to the decoder
-     * to flush it.
-     */
-    if ((error = avcodec_decode_audio4(input_codec_context, frame,
-                                       data_present, &input_packet)) < 0) {
-        fprintf(stderr, "Could not decode frame (error '%s')\n",
-                get_error_text(error));
-        av_free_packet(&input_packet);
-        return error;
-    }
-
-    /**
-     * If the decoder has not been flushed completely, we are not finished,
-     * so that this function has to be called again.
-     */
-    if (*finished && *data_present)
-        *finished = 0;
-    av_free_packet(&input_packet);
-    return 0;
-}
-
-/**
- * Initialize a temporary storage for the specified number of audio samples.
- * The conversion requires temporary storage due to the different format.
- * The number of audio samples to be allocated is specified in frame_size.
- */
-static int init_converted_samples(uint8_t ***converted_input_samples,
-                                  AVCodecContext *output_codec_context,
-                                  int frame_size)
-{
-    int error;
-
-    /**
-     * Allocate as many pointers as there are audio channels.
-     * Each pointer will later point to the audio samples of the corresponding
-     * channels (although it may be NULL for interleaved formats).
-     */
-    if (!(*converted_input_samples = calloc(output_codec_context->channels,
-                                            sizeof(**converted_input_samples)))) {
-        fprintf(stderr, "Could not allocate converted input sample pointers\n");
-        return AVERROR(ENOMEM);
-    }
-
-    /**
-     * Allocate memory for the samples of all channels in one consecutive
-     * block for convenience.
-     */
-    if ((error = av_samples_alloc(*converted_input_samples, NULL,
-                                  output_codec_context->channels,
-                                  frame_size,
-                                  output_codec_context->sample_fmt, 0)) < 0) {
-        fprintf(stderr,
-                "Could not allocate converted input samples (error '%s')\n",
-                get_error_text(error));
-        av_freep(&(*converted_input_samples)[0]);
-        free(*converted_input_samples);
-        return error;
-    }
-    return 0;
-}
-
-/**
- * Convert the input audio samples into the output sample format.
- * The conversion happens on a per-frame basis, the size of which is specified
- * by frame_size.
- */
-static int convert_samples(uint8_t **input_data,
-                           uint8_t **converted_data, const int frame_size,
-                           AVAudioResampleContext *resample_context)
-{
-    int error;
-
-    /** Convert the samples using the resampler. */
-    if ((error = avresample_convert(resample_context, converted_data, 0,
-                                    frame_size, input_data, 0, frame_size)) < 0) {
-        fprintf(stderr, "Could not convert input samples (error '%s')\n",
-                get_error_text(error));
-        return error;
-    }
-
-    /**
-     * Perform a sanity check so that the number of converted samples is
-     * not greater than the number of samples to be converted.
-     * If the sample rates differ, this case has to be handled differently
-     */
-    if (avresample_available(resample_context)) {
-        fprintf(stderr, "Converted samples left over\n");
-        return AVERROR_EXIT;
-    }
-
-    return 0;
-}
-
-/** Add converted input audio samples to the FIFO buffer for later processing. */
-static int add_samples_to_fifo(AVAudioFifo *fifo,
-                               uint8_t **converted_input_samples,
-                               const int frame_size)
-{
-    int error;
-
-    /**
-     * Make the FIFO as large as it needs to be to hold both,
-     * the old and the new samples.
-     */
-    if ((error = av_audio_fifo_realloc(fifo, av_audio_fifo_size(fifo) + frame_size)) < 0) {
-        fprintf(stderr, "Could not reallocate FIFO\n");
-        return error;
-    }
-
-    /** Store the new samples in the FIFO buffer. */
-    if (av_audio_fifo_write(fifo, (void **)converted_input_samples,
-                            frame_size) < frame_size) {
-        fprintf(stderr, "Could not write data to FIFO\n");
-        return AVERROR_EXIT;
-    }
-    return 0;
-}
-
-/**
- * Read one audio frame from the input file, decodes, converts and stores
- * it in the FIFO buffer.
- */
-static int read_decode_convert_and_store(AVAudioFifo *fifo,
-                                         AVFormatContext *input_format_context,
-                                         AVCodecContext *input_codec_context,
-                                         AVCodecContext *output_codec_context,
-                                         AVAudioResampleContext *resampler_context,
-                                         int *finished)
-{
-    /** Temporary storage of the input samples of the frame read from the file. */
-    AVFrame *input_frame = NULL;
-    /** Temporary storage for the converted input samples. */
-    uint8_t **converted_input_samples = NULL;
-    int data_present;
-    int ret = AVERROR_EXIT;
-
-    /** Initialize temporary storage for one input frame. */
-    if (init_input_frame(&input_frame))
-        goto cleanup;
-    /** Decode one frame worth of audio samples. */
-    if (decode_audio_frame(input_frame, input_format_context,
-                           input_codec_context, &data_present, finished))
-        goto cleanup;
-    /**
-     * If we are at the end of the file and there are no more samples
-     * in the decoder which are delayed, we are actually finished.
-     * This must not be treated as an error.
-     */
-    if (*finished && !data_present) {
-        ret = 0;
-        goto cleanup;
-    }
-    /** If there is decoded data, convert and store it */
-    if (data_present) {
-        /** Initialize the temporary storage for the converted input samples. */
-        if (init_converted_samples(&converted_input_samples, output_codec_context,
-                                   input_frame->nb_samples))
-            goto cleanup;
-
-        /**
-         * Convert the input samples to the desired output sample format.
-         * This requires a temporary storage provided by converted_input_samples.
-         */
-        if (convert_samples(input_frame->extended_data, converted_input_samples,
-                            input_frame->nb_samples, resampler_context))
-            goto cleanup;
-
-        /** Add the converted input samples to the FIFO buffer for later processing. */
-        if (add_samples_to_fifo(fifo, converted_input_samples,
-                                input_frame->nb_samples))
-            goto cleanup;
-        ret = 0;
-    }
-    ret = 0;
-
-cleanup:
-    if (converted_input_samples) {
-        av_freep(&converted_input_samples[0]);
-        free(converted_input_samples);
-    }
-    av_frame_free(&input_frame);
-
-    return ret;
-}
-
-/**
- * Initialize one input frame for writing to the output file.
- * The frame will be exactly frame_size samples large.
- */
-static int init_output_frame(AVFrame **frame,
-                             AVCodecContext *output_codec_context,
-                             int frame_size)
-{
-    int error;
-
-    /** Create a new frame to store the audio samples. */
-    if (!(*frame = av_frame_alloc())) {
-        fprintf(stderr, "Could not allocate output frame\n");
-        return AVERROR_EXIT;
-    }
-
-    /**
-     * Set the frame's parameters, especially its size and format.
-     * av_frame_get_buffer needs this to allocate memory for the
-     * audio samples of the frame.
-     * Default channel layouts based on the number of channels
-     * are assumed for simplicity.
-     */
-    (*frame)->nb_samples     = frame_size;
-    (*frame)->channel_layout = output_codec_context->channel_layout;
-    (*frame)->format         = output_codec_context->sample_fmt;
-    (*frame)->sample_rate    = output_codec_context->sample_rate;
-
-    /**
-     * Allocate the samples of the created frame. This call will make
-     * sure that the audio frame can hold as many samples as specified.
-     */
-    if ((error = av_frame_get_buffer(*frame, 0)) < 0) {
-        fprintf(stderr, "Could allocate output frame samples (error '%s')\n",
-                get_error_text(error));
-        av_frame_free(frame);
-        return error;
-    }
-
-    return 0;
-}
-
-/** Encode one frame worth of audio to the output file. */
-static int encode_audio_frame(AVFrame *frame,
-                              AVFormatContext *output_format_context,
-                              AVCodecContext *output_codec_context,
-                              int *data_present)
-{
-    /** Packet used for temporary storage. */
-    AVPacket output_packet;
-    int error;
-    init_packet(&output_packet);
-
-    /**
-     * Encode the audio frame and store it in the temporary packet.
-     * The output audio stream encoder is used to do this.
-     */
-    if ((error = avcodec_encode_audio2(output_codec_context, &output_packet,
-                                       frame, data_present)) < 0) {
-        fprintf(stderr, "Could not encode frame (error '%s')\n",
-                get_error_text(error));
-        av_free_packet(&output_packet);
-        return error;
-    }
-
-    /** Write one audio frame from the temporary packet to the output file. */
-    if (*data_present) {
-        if ((error = av_write_frame(output_format_context, &output_packet)) < 0) {
-            fprintf(stderr, "Could not write frame (error '%s')\n",
-                    get_error_text(error));
-            av_free_packet(&output_packet);
-            return error;
-        }
-
-        av_free_packet(&output_packet);
-    }
-
-    return 0;
-}
-
-/**
- * Load one audio frame from the FIFO buffer, encode and write it to the
- * output file.
- */
-static int load_encode_and_write(AVAudioFifo *fifo,
-                                 AVFormatContext *output_format_context,
-                                 AVCodecContext *output_codec_context)
-{
-    /** Temporary storage of the output samples of the frame written to the file. */
-    AVFrame *output_frame;
-    /**
-     * Use the maximum number of possible samples per frame.
-     * If there is less than the maximum possible frame size in the FIFO
-     * buffer use this number. Otherwise, use the maximum possible frame size
-     */
-    const int frame_size = FFMIN(av_audio_fifo_size(fifo),
-                                 output_codec_context->frame_size);
-    int data_written;
-
-    /** Initialize temporary storage for one output frame. */
-    if (init_output_frame(&output_frame, output_codec_context, frame_size))
-        return AVERROR_EXIT;
-
-    /**
-     * Read as many samples from the FIFO buffer as required to fill the frame.
-     * The samples are stored in the frame temporarily.
-     */
-    if (av_audio_fifo_read(fifo, (void **)output_frame->data, frame_size) < frame_size) {
-        fprintf(stderr, "Could not read data from FIFO\n");
-        av_frame_free(&output_frame);
-        return AVERROR_EXIT;
-    }
-
-    /** Encode one frame worth of audio samples. */
-    if (encode_audio_frame(output_frame, output_format_context,
-                           output_codec_context, &data_written)) {
-        av_frame_free(&output_frame);
-        return AVERROR_EXIT;
-    }
-    av_frame_free(&output_frame);
-    return 0;
-}
-
-/** Write the trailer of the output file container. */
-static int write_output_file_trailer(AVFormatContext *output_format_context)
-{
-    int error;
-    if ((error = av_write_trailer(output_format_context)) < 0) {
-        fprintf(stderr, "Could not write output file trailer (error '%s')\n",
-                get_error_text(error));
-        return error;
-    }
-    return 0;
-}
-
-/** Convert an audio file to an AAC file in an MP4 container. */
-int main(int argc, char **argv)
-{
-    AVFormatContext *input_format_context = NULL, *output_format_context = NULL;
-    AVCodecContext *input_codec_context = NULL, *output_codec_context = NULL;
-    AVAudioResampleContext *resample_context = NULL;
-    AVAudioFifo *fifo = NULL;
-    int ret = AVERROR_EXIT;
-
-    if (argc < 3) {
-        fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]);
-        exit(1);
-    }
-
-    /** Register all codecs and formats so that they can be used. */
-    av_register_all();
-    /** Open the input file for reading. */
-    if (open_input_file(argv[1], &input_format_context,
-                        &input_codec_context))
-        goto cleanup;
-    /** Open the output file for writing. */
-    if (open_output_file(argv[2], input_codec_context,
-                         &output_format_context, &output_codec_context))
-        goto cleanup;
-    /** Initialize the resampler to be able to convert audio sample formats. */
-    if (init_resampler(input_codec_context, output_codec_context,
-                       &resample_context))
-        goto cleanup;
-    /** Initialize the FIFO buffer to store audio samples to be encoded. */
-    if (init_fifo(&fifo))
-        goto cleanup;
-    /** Write the header of the output file container. */
-    if (write_output_file_header(output_format_context))
-        goto cleanup;
-
-    /**
-     * Loop as long as we have input samples to read or output samples
-     * to write; abort as soon as we have neither.
-     */
-    while (1) {
-        /** Use the encoder's desired frame size for processing. */
-        const int output_frame_size = output_codec_context->frame_size;
-        int finished                = 0;
-
-        /**
-         * Make sure that there is one frame worth of samples in the FIFO
-         * buffer so that the encoder can do its work.
-         * Since the decoder's and the encoder's frame size may differ, we
-         * need to FIFO buffer to store as many frames worth of input samples
-         * that they make up at least one frame worth of output samples.
-         */
-        while (av_audio_fifo_size(fifo) < output_frame_size) {
-            /**
-             * Decode one frame worth of audio samples, convert it to the
-             * output sample format and put it into the FIFO buffer.
-             */
-            if (read_decode_convert_and_store(fifo, input_format_context,
-                                              input_codec_context,
-                                              output_codec_context,
-                                              resample_context, &finished))
-                goto cleanup;
-
-            /**
-             * If we are at the end of the input file, we continue
-             * encoding the remaining audio samples to the output file.
-             */
-            if (finished)
-                break;
-        }
-
-        /**
-         * If we have enough samples for the encoder, we encode them.
-         * At the end of the file, we pass the remaining samples to
-         * the encoder.
-         */
-        while (av_audio_fifo_size(fifo) >= output_frame_size ||
-               (finished && av_audio_fifo_size(fifo) > 0))
-            /**
-             * Take one frame worth of audio samples from the FIFO buffer,
-             * encode it and write it to the output file.
-             */
-            if (load_encode_and_write(fifo, output_format_context,
-                                      output_codec_context))
-                goto cleanup;
-
-        /**
-         * If we are at the end of the input file and have encoded
-         * all remaining samples, we can exit this loop and finish.
-         */
-        if (finished) {
-            int data_written;
-            /** Flush the encoder as it may have delayed frames. */
-            do {
-                if (encode_audio_frame(NULL, output_format_context,
-                                       output_codec_context, &data_written))
-                    goto cleanup;
-            } while (data_written);
-            break;
-        }
-    }
-
-    /** Write the trailer of the output file container. */
-    if (write_output_file_trailer(output_format_context))
-        goto cleanup;
-    ret = 0;
-
-cleanup:
-    if (fifo)
-        av_audio_fifo_free(fifo);
-    if (resample_context) {
-        avresample_close(resample_context);
-        avresample_free(&resample_context);
-    }
-    if (output_codec_context)
-        avcodec_close(output_codec_context);
-    if (output_format_context) {
-        avio_close(output_format_context->pb);
-        avformat_free_context(output_format_context);
-    }
-    if (input_codec_context)
-        avcodec_close(input_codec_context);
-    if (input_format_context)
-        avformat_close_input(&input_format_context);
-
-    return ret;
-}
diff --git a/deps/libav/doc/faq.texi b/deps/libav/doc/faq.texi
deleted file mode 100644
index b400124..0000000
--- a/deps/libav/doc/faq.texi
+++ /dev/null
@@ -1,354 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle Libav FAQ
- at titlepage
- at center @titlefont{Libav FAQ}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter General Questions
-
- at section Why doesn't Libav support feature [xyz]?
-
-Because no one has taken on that task yet. Libav 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 Libav 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 Libav strives to support all codecs natively.
-A DLL loader is not conducive to that goal.
-
- at section I cannot read this file although this format seems to be supported by avconv.
-
-Even if avconv can read the container format, it may not support all its
-codecs. Please consult the supported codec list in the avconv
-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 mpeg1video
-.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_s16le
-always
- at item libmp3lame
-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 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
-  avconv -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 -s "$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
-  avconv -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
- at end example
-
-The same logic is used for any image format that avconv reads.
-
- at section How do I encode movie to single pictures?
-
-Use:
-
- at example
-  avconv -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 -c:v ppm
- at item -c:v png
- at item -c:v mjpeg
- at end table
-to force the encoding.
-
-Applying that to the previous example:
- at example
-  avconv -i movie.mpg -f image2 -c:v 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 -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 -c:v command line option.
-
- at section How do I encode Xvid or DivX video with avconv?
-
-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 '-c:v 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 Which are good parameters for encoding high quality MPEG-4?
-
-'-mbd rd -flags +mv4+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 avconv, 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 Libav with @code{./configure --enable-avisynth}
-(only possible on MinGW/Cygwin platforms),
-then you may use any file that DirectShow can read as input.
-
-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 avconv:
- at example
-  avconv -i input.avs
- at end example
-
-For ANY other help on AviSynth, please visit the
- at uref{http://www.avisynth.org/, AviSynth homepage}.
-
- 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
-avconv -i input1.avi intermediate1.mpg
-avconv -i input2.avi intermediate2.mpg
-cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
-avconv -i intermediate_all.mpg output.avi
- at end example
-
-Notice that you should 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
-avconv -i input1.avi -y intermediate1.mpg < /dev/null &
-avconv -i input2.avi -y intermediate2.mpg < /dev/null &
-cat intermediate1.mpg intermediate2.mpg |\
-avconv -f mpeg -i - -c:v 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
-avconv -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
-avconv -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
-avconv -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
-@{ avconv -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 &
-avconv -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-       -f yuv4mpegpipe -i all.v \
-       -y output.flv
-rm temp[12].[av] all.[av]
- at end example
-
- at section -profile option fails when encoding H.264 video with AAC audio
-
- at command{avconv} prints an error like
-
- at example
-Undefined constant or missing '(' in 'baseline'
-Unable to parse option value "baseline"
-Error setting option profile to value baseline.
- at end example
-
-Short answer: write @option{-profile:v} instead of @option{-profile}.
-
-Long answer: this happens because the @option{-profile} option can apply to both
-video and audio.  Specifically the AAC encoder also defines some profiles, none
-of which are named @var{baseline}.
-
-The solution is to apply the @option{-profile} option to the video stream only
-by using @url{http://libav.org/avconv.html#Stream-specifiers-1, Stream specifiers}.
-Appending @code{:v} to it will do exactly that.
-
- at chapter Development
-
- at section Are there examples illustrating how to use the Libav libraries, particularly libavcodec and libavformat?
-
-Yes. Read the Developers Guide of the Libav documentation. Alternatively,
-examine the source code for one of the many open source projects that
-already incorporate Libav 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?
-
-Yes. Please see the @uref{platform.html, Microsoft Visual C++}
-section in the Libav documentation.
-
- 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 Libav in object-oriented C++?
-
-Libav 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 @uref{http://www.tux.org/lkml/#s15, "Programming Religion"}.
-
- 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'm using Libav from within my C++ application but the linker complains about missing symbols which seem to be available.
-
-Libav 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 Libav 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'm using libavutil from within my C++ application but the compiler complains about 'UINT64_C' was not declared in this scope
-
-Libav is a pure C project using C99 math features, in order to enable C++
-to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
-
- 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 create a custom AVIOContext using @code{avio_alloc_context},
-see @file{libavformat/aviobuf.c} in Libav and @file{libmpdemux/demux_lavf.c} in MPlayer2 sources.
-
- at section Why is @code{make fate} not running all tests?
-
-Make sure you have the fate-suite samples and the @code{SAMPLES} Make variable
-or @code{FATE_SAMPLES} environment variable or the @code{--samples}
- at command{configure} option is set to the right path.
-
- at section Why is @code{make fate} not finding the samples?
-
-Do you happen to have a @code{~} character in the samples path to indicate a
-home directory? The value is used in ways where the shell cannot expand it,
-causing FATE to not find files. Just replace @code{~} by the full path.
-
- at bye
diff --git a/deps/libav/doc/fate.texi b/deps/libav/doc/fate.texi
deleted file mode 100644
index 0185d87..0000000
--- a/deps/libav/doc/fate.texi
+++ /dev/null
@@ -1,168 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle FATE Automated Testing Environment
- at titlepage
- at center @titlefont{FATE Automated Testing Environment}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter Introduction
-
-FATE provides a regression testsuite embedded within the Libav build system.
-It can be run locally and optionally configured to send reports to a web
-aggregator and viewer @url{http://fate.libav.org}.
-
-It is advised to run FATE before submitting patches to the current codebase
-and provide new tests when submitting patches to add additional features.
-
- at chapter Running FATE
-
- at section Samples and References
-In order to run, FATE needs a large amount of data (samples and references)
-that is provided separately from the actual source distribution.
-
-To inform the build system about the testsuite location, pass
- at option{--samples=<path to the samples>} to @command{configure} or set the
- at var{SAMPLES} Make variable or the @var{LIBAV_SAMPLES} environment variable
-to a suitable value.
-
-To use a custom wrapper to run the test, pass @option{--target-exec} to
- at command{configure} or set the @var{TARGET_EXEC} Make variable.
-
-The dataset is available through @command{rsync}, is possible to fetch
-the current sample using the straight rsync command or through a specific
- at ref{Makefile target}.
-
- at example
-# rsync -aL rsync://fate-suite.libav.org/fate-suite/ fate-suite
- at end example
-
- at example
-# make fate-rsync SAMPLES=fate-suite
- at end example
-
-
- at chapter Manual Run
-FATE regression test can be run through @command{make}.
-Specific Makefile targets and Makefile variables are available:
-
- at anchor{Makefile target}
- at section FATE Makefile targets
-
- at table @option
- at item fate-list
-List all fate/regression test targets.
-
- at item fate-rsync
-Shortcut to download the fate test samples to the specified testsuite location.
-
- at item fate
-Run the FATE test suite (requires the fate-suite dataset).
- at end table
-
- at section FATE Makefile variables
- at table @option
- at item V
-Verbosity level, can be set to 0, 1 or 2.
-
- at table @option
- at item 0
-show just the test arguments
-
- at item 1
-show just the command used in the test
-
- at item 2
-show everything
- at end table
-
- at item SAMPLES
-Specify or override the path to the FATE samples at make time, it has a
-meaning only while running the regression tests.
-
- at item THREADS
-Specify how many threads to use while running regression tests, it is
-quite useful to detect thread-related regressions.
-
- at item THREAD_TYPE
-Specify which threading strategy test, either @var{slice} or @var{frame},
-by default @var{slice+frame}
-
- at item CPUFLAGS
-Specify a mask to be applied to autodetected CPU flags.
-
- at item TARGET_EXEC
-Specify or override the wrapper used to run the tests.
-
- at item GEN
-Set to @var{1} to generate the missing or mismatched references.
- at end table
-
- at example
-    make V=1 SAMPLES=/var/fate/samples THREADS=2 CPUFLAGS=mmx fate
- at end example
-
- at chapter Automated Tests
-In order to automatically testing specific configurations, e.g. multiple
-compilers, @command{tests/fate.sh} is provided.
-
-This shell script builds Libav, runs the regression tests and prepares
-a report that can be sent to @url{http://fate.libav.org/} or directly
-examined locally.
-
- at section Testing Profiles
-The configuration file passed to @command{fate.sh} is shell scripts as well.
-
-It must provide at least a @var{slot} identifier, the @var{repo} from
-which fetch the sources, the @var{samples} directory, a @var{workdir} with
-enough space to build and run all the tests.
-Optional submit command @var{fate_recv} and a @var{comment} to describe
-the testing profile are available.
-
-Additional optional parameter to tune the Libav building and reporting process
-can be passed.
-
- at example
-slot=                                   # some unique identifier
-repo=git://git.libav.org/libav.git      # the source repository
-samples=/path/to/fate/samples
-workdir=                                # directory in which to do all the work
-fate_recv="ssh -T fate@@fate.libav.org"  # command to submit report
-comment=                                # optional description
-build_only=     # set to "yes" for a compile-only instance that skips tests
-
-# the following are optional and map to configure options
-arch=
-cpu=
-cross_prefix=
-as=
-cc=
-ld=
-target_os=
-sysroot=
-target_exec=
-target_path=
-target_samples=
-extra_cflags=
-extra_ldflags=
-extra_libs=
-extra_conf=     # extra configure options not covered above
-
-#make=          # name of GNU make if not 'make'
-makeopts=       # extra options passed to 'make'
-#tar=           # command to create a tar archive from its arguments on
-                # stdout, defaults to 'tar c'
- at end example
-
- at section Special Instances
-The @var{TARGET_EXEC} option provides a way to run FATE wrapped in
- at command{valgrind}, @command{qemu-user} or @command{wine} or on remote targets
-through @command{ssh}.
-
- at section Submitting Reports
-In order to send reports you need to create an @command{ssh} key and send it
-to @email{root@@libav.org}.
-The current server fingerprint is @var{a4:99:d7:d3:1c:92:0d:56:d6:d5:61:be:01:ae:7d:e6}
diff --git a/deps/libav/doc/filters.texi b/deps/libav/doc/filters.texi
deleted file mode 100644
index 5b47709..0000000
--- a/deps/libav/doc/filters.texi
+++ /dev/null
@@ -1,2956 +0,0 @@
- at chapter Filtergraph description
- at c man begin FILTERGRAPH DESCRIPTION
-
-A filtergraph is a directed graph of connected filters. It can contain
-cycles, and there can be multiple links between a pair of
-filters. Each link has one input pad on one side connecting it to one
-filter from which it takes its input, and one output pad on the other
-side connecting it to the one filter accepting its output.
-
-Each filter in a filtergraph is an instance of a filter class
-registered in the application, which defines the features and the
-number of input and output pads of the filter.
-
-A filter with no input pads is called a "source", a filter with no
-output pads is called a "sink".
-
- at anchor{Filtergraph syntax}
- at section Filtergraph syntax
-
-A filtergraph can be represented using a textual representation, which is
-recognized by the @option{-filter}/@option{-vf} and @option{-filter_complex}
-options in @command{avconv} and @option{-vf} in @command{avplay}, and by the
- at code{avfilter_graph_parse()}/@code{avfilter_graph_parse2()} function defined in
- at file{libavfilter/avfilter.h}.
-
-A filterchain consists of a sequence of connected filters, each one
-connected to the previous one in the sequence. A filterchain is
-represented by a list of ","-separated filter descriptions.
-
-A filtergraph consists of a sequence of filterchains. A sequence of
-filterchains is represented by a list of ";"-separated filterchain
-descriptions.
-
-A filter is represented by a string of the form:
-[@var{in_link_1}]...[@var{in_link_N}]@var{filter_name}=@var{arguments}[@var{out_link_1}]...[@var{out_link_M}]
-
- at var{filter_name} is the name of the filter class of which the
-described filter is an instance of, and has to be the name of one of
-the filter classes registered in the program.
-The name of the filter class is optionally followed by a string
-"=@var{arguments}".
-
- at var{arguments} is a string which contains the parameters used to
-initialize the filter instance. It may have one of the two allowed forms:
- at itemize
-
- at item
-A ':'-separated list of @var{key=value} pairs.
-
- at item
-A ':'-separated list of @var{value}. In this case, the keys are assumed to be
-the option names in the order they are declared. E.g. the @code{fade} filter
-declares three options in this order -- @option{type}, @option{start_frame} and
- at option{nb_frames}. Then the parameter list @var{in:0:30} means that the value
- at var{in} is assigned to the option @option{type}, @var{0} to
- at option{start_frame} and @var{30} to @option{nb_frames}.
-
- at end itemize
-
-If the option value itself is a list of items (e.g. the @code{format} filter
-takes a list of pixel formats), the items in the list are usually separated by
-'|'.
-
-The list of arguments can be quoted using the character "'" as initial
-and ending mark, and the character '\' for escaping the characters
-within the quoted text; otherwise the argument string is considered
-terminated when the next special character (belonging to the set
-"[]=;,") is encountered.
-
-The name and arguments of the filter are optionally preceded and
-followed by a list of link labels.
-A link label allows to name a link and associate it to a filter output
-or input pad. The preceding labels @var{in_link_1}
-... @var{in_link_N}, are associated to the filter input pads,
-the following labels @var{out_link_1} ... @var{out_link_M}, are
-associated to the output pads.
-
-When two link labels with the same name are found in the
-filtergraph, a link between the corresponding input and output pad is
-created.
-
-If an output pad is not labelled, it is linked by default to the first
-unlabelled input pad of the next filter in the filterchain.
-For example in the filterchain:
- at example
-nullsrc, split[L1], [L2]overlay, nullsink
- at end example
-the split filter instance has two output pads, and the overlay filter
-instance two input pads. The first output pad of split is labelled
-"L1", the first input pad of overlay is labelled "L2", and the second
-output pad of split is linked to the second input pad of overlay,
-which are both unlabelled.
-
-In a complete filterchain all the unlabelled filter input and output
-pads must be connected. A filtergraph is considered valid if all the
-filter input and output pads of all the filterchains are connected.
-
-Libavfilter will automatically insert @ref{scale} filters where format
-conversion is required. It is possible to specify swscale flags
-for those automatically inserted scalers by prepending
- at code{sws_flags=@var{flags};}
-to the filtergraph description.
-
-Follows a BNF description for the filtergraph syntax:
- at example
- at var{NAME}             ::= sequence of alphanumeric characters and '_'
- at var{LINKLABEL}        ::= "[" @var{NAME} "]"
- at var{LINKLABELS}       ::= @var{LINKLABEL} [@var{LINKLABELS}]
- at var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted)
- at var{FILTER}           ::= [@var{LINKLABELS}] @var{NAME} ["=" @var{FILTER_ARGUMENTS}] [@var{LINKLABELS}]
- at var{FILTERCHAIN}      ::= @var{FILTER} [, at var{FILTERCHAIN}]
- at var{FILTERGRAPH}      ::= [sws_flags=@var{flags};] @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
- at end example
-
- at c man end FILTERGRAPH DESCRIPTION
-
- at chapter Audio Filters
- at c man begin AUDIO FILTERS
-
-When you configure your Libav build, you can disable any of the
-existing filters using --disable-filters.
-The configure output will show the audio filters included in your
-build.
-
-Below is a description of the currently available audio filters.
-
- at section aformat
-
-Convert the input audio to one of the specified formats. The framework will
-negotiate the most appropriate format to minimize conversions.
-
-The filter accepts the following named parameters:
- at table @option
-
- at item sample_fmts
-A '|'-separated list of requested sample formats.
-
- at item sample_rates
-A '|'-separated list of requested sample rates.
-
- at item channel_layouts
-A '|'-separated list of requested channel layouts.
-
- at end table
-
-If a parameter is omitted, all values are allowed.
-
-For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
- at example
-aformat=sample_fmts=u8|s16:channel_layouts=stereo
- at end example
-
- at section amix
-
-Mixes multiple audio inputs into a single output.
-
-For example
- at example
-avconv -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
- at end example
-will mix 3 input audio streams to a single output with the same duration as the
-first input and a dropout transition time of 3 seconds.
-
-The filter accepts the following named parameters:
- at table @option
-
- at item inputs
-Number of inputs. If unspecified, it defaults to 2.
-
- at item duration
-How to determine the end-of-stream.
- at table @option
-
- at item longest
-Duration of longest input. (default)
-
- at item shortest
-Duration of shortest input.
-
- at item first
-Duration of first input.
-
- at end table
-
- at item dropout_transition
-Transition time, in seconds, for volume renormalization when an input
-stream ends. The default value is 2 seconds.
-
- at end table
-
- at section anull
-
-Pass the audio source unchanged to the output.
-
- at section asetpts
-
-Change the PTS (presentation timestamp) of the input audio frames.
-
-This filter accepts the following options:
-
- at table @option
-
- at item expr
-The expression which is evaluated for each frame to construct its timestamp.
-
- at end table
-
-The expression is evaluated through the eval API and can contain the following
-constants:
-
- at table @option
- at item PTS
-the presentation timestamp in input
-
- at item PI
-Greek PI
-
- at item PHI
-golden ratio
-
- at item E
-Euler number
-
- at item N
-Number of the audio samples pass through the filter so far, starting at 0.
-
- at item S
-Number of the audio samples in the current frame.
-
- at item SR
-Audio sample rate.
-
- at item STARTPTS
-the PTS of the first frame
-
- at item PREV_INPTS
-previous input PTS
-
- at item PREV_OUTPTS
-previous output PTS
-
- at item RTCTIME
-wallclock (RTC) time in microseconds
-
- at item RTCSTART
-wallclock (RTC) time at the start of the movie in microseconds
-
- at end table
-
-Some examples follow:
-
- at example
-# start counting PTS from zero
-asetpts=expr=PTS-STARTPTS
-
-#generate timestamps by counting samples
-asetpts=expr=N/SR/TB
-
-# generate timestamps from a "live source" and rebase onto the current timebase
-asetpts='(RTCTIME - RTCSTART) / (TB * 1000000)"
- at end example
-
-
- at section ashowinfo
-
-Show a line containing various information for each input audio frame.
-The input audio is not modified.
-
-The shown line contains a sequence of key/value pairs of the form
- at var{key}:@var{value}.
-
-A description of each shown parameter follows:
-
- at table @option
- at item n
-sequential number of the input frame, starting from 0
-
- at item pts
-Presentation timestamp of the input frame, in time base units; the time base
-depends on the filter input pad, and is usually 1/@var{sample_rate}.
-
- at item pts_time
-presentation timestamp of the input frame in seconds
-
- at item fmt
-sample format
-
- at item chlayout
-channel layout
-
- at item rate
-sample rate for the audio frame
-
- at item nb_samples
-number of samples (per channel) in the frame
-
- at item checksum
-Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
-the data is treated as if all the planes were concatenated.
-
- at item plane_checksums
-A list of Adler-32 checksums for each data plane.
- at end table
-
- at section asplit
-
-Split input audio into several identical outputs.
-
-The filter accepts a single parameter which specifies the number of outputs. If
-unspecified, it defaults to 2.
-
-For example
- at example
-avconv -i INPUT -filter_complex asplit=5 OUTPUT
- at end example
-will create 5 copies of the input audio.
-
- at section asyncts
-Synchronize audio data with timestamps by squeezing/stretching it and/or
-dropping samples/adding silence when needed.
-
-The filter accepts the following named parameters:
- at table @option
-
- at item compensate
-Enable stretching/squeezing the data to make it match the timestamps. Disabled
-by default. When disabled, time gaps are covered with silence.
-
- at item min_delta
-Minimum difference between timestamps and audio data (in seconds) to trigger
-adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
-this filter, try setting this parameter to 0.
-
- at item max_comp
-Maximum compensation in samples per second. Relevant only with compensate=1.
-Default value 500.
-
- at item first_pts
-Assume the first pts should be this value. The time base is 1 / sample rate.
-This allows for padding/trimming at the start of stream. By default, no
-assumption is made about the first frame's expected pts, so no padding or
-trimming is done. For example, this could be set to 0 to pad the beginning with
-silence if an audio stream starts after the video stream or to trim any samples
-with a negative pts due to encoder delay.
-
- at end table
-
- at section atrim
-Trim the input so that the output contains one continuous subpart of the input.
-
-This filter accepts the following options:
- at table @option
- at item start
-Timestamp (in seconds) of the start of the kept section. I.e. the audio sample
-with the timestamp @var{start} will be the first sample in the output.
-
- at item end
-Timestamp (in seconds) of the first audio sample that will be dropped. I.e. the
-audio sample immediately preceding the one with the timestamp @var{end} will be
-the last sample in the output.
-
- at item start_pts
-Same as @var{start}, except this option sets the start timestamp in samples
-instead of seconds.
-
- at item end_pts
-Same as @var{end}, except this option sets the end timestamp in samples instead
-of seconds.
-
- at item duration
-Maximum duration of the output in seconds.
-
- at item start_sample
-Number of the first sample that should be passed to output.
-
- at item end_sample
-Number of the first sample that should be dropped.
- at end table
-
-Note that the first two sets of the start/end options and the @option{duration}
-option look at the frame timestamp, while the _sample options simply count the
-samples that pass through the filter. So start/end_pts and start/end_sample will
-give different results when the timestamps are wrong, inexact or do not start at
-zero. Also note that this filter does not modify the timestamps. If you wish
-that the output timestamps start at zero, insert the asetpts filter after the
-atrim filter.
-
-If multiple start or end options are set, this filter tries to be greedy and
-keep all samples that match at least one of the specified constraints. To keep
-only the part that matches all the constraints at once, chain multiple atrim
-filters.
-
-The defaults are such that all the input is kept. So it is possible to set e.g.
-just the end values to keep everything before the specified time.
-
-Examples:
- at itemize
- at item
-drop everything except the second minute of input
- at example
-avconv -i INPUT -af atrim=60:120
- at end example
-
- at item
-keep only the first 1000 samples
- at example
-avconv -i INPUT -af atrim=end_sample=1000
- at end example
-
- at end itemize
-
- at section channelsplit
-Split each channel in input audio stream into a separate output stream.
-
-This filter accepts the following named parameters:
- at table @option
- at item channel_layout
-Channel layout of the input stream. Default is "stereo".
- at end table
-
-For example, assuming a stereo input MP3 file
- at example
-avconv -i in.mp3 -filter_complex channelsplit out.mkv
- at end example
-will create an output Matroska file with two audio streams, one containing only
-the left channel and the other the right channel.
-
-To split a 5.1 WAV file into per-channel files
- at example
-avconv -i in.wav -filter_complex
-'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
--map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
-front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
-side_right.wav
- at end example
-
- at section channelmap
-Remap input channels to new locations.
-
-This filter accepts the following named parameters:
- at table @option
- at item channel_layout
-Channel layout of the output stream.
-
- at item map
-Map channels from input to output. The argument is a '|'-separated list of
-mappings, each in the @code{@var{in_channel}- at var{out_channel}} or
- at var{in_channel} form. @var{in_channel} can be either the name of the input
-channel (e.g. FL for front left) or its index in the input channel layout.
- at var{out_channel} is the name of the output channel or its index in the output
-channel layout. If @var{out_channel} is not given then it is implicitly an
-index, starting with zero and increasing by one for each mapping.
- at end table
-
-If no mapping is present, the filter will implicitly map input channels to
-output channels preserving index.
-
-For example, assuming a 5.1+downmix input MOV file
- at example
-avconv -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
- at end example
-will create an output WAV file tagged as stereo from the downmix channels of
-the input.
-
-To fix a 5.1 WAV improperly encoded in AAC's native channel order
- at example
-avconv -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
- at end example
-
- at section compand
-Compress or expand audio dynamic range.
-
-A description of the accepted options follows.
-
- at table @option
-
- at item attacks
- at item decays
-Set list of times in seconds for each channel over which the instantaneous level
-of the input signal is averaged to determine its volume. @var{attacks} refers to
-increase of volume and @var{decays} refers to decrease of volume. For most
-situations, the attack time (response to the audio getting louder) should be
-shorter than the decay time because the human ear is more sensitive to sudden
-loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
-a typical value for decay is 0.8 seconds.
-
- at item points
-Set list of points for the transfer function, specified in dB relative to the
-maximum possible signal amplitude. Each key points list must be defined using
-the following syntax: @code{x0/y0|x1/y1|x2/y2|....}
-
-The input values must be in strictly increasing order but the transfer function
-does not have to be monotonically rising. The point @code{0/0} is assumed but
-may be overridden (by @code{0/out-dBn}). Typical values for the transfer
-function are @code{-70/-70|-60/-20}.
-
- at item soft-knee
-Set the curve radius in dB for all joints. Defaults to 0.01.
-
- at item gain
-Set additional gain in dB to be applied at all points on the transfer function.
-This allows easy adjustment of the overall gain. Defaults to 0.
-
- at item volume
-Set initial volume in dB to be assumed for each channel when filtering starts.
-This permits the user to supply a nominal level initially, so that, for
-example, a very large gain is not applied to initial signal levels before the
-companding has begun to operate. A typical value for audio which is initially
-quiet is -90 dB. Defaults to 0.
-
- at item delay
-Set delay in seconds. The input audio is analyzed immediately, but audio is
-delayed before being fed to the volume adjuster. Specifying a delay
-approximately equal to the attack/decay times allows the filter to effectively
-operate in predictive rather than reactive mode. Defaults to 0.
-
- at end table
-
- at subsection Examples
-
- at itemize
- at item
-Make music with both quiet and loud passages suitable for listening in a noisy
-environment:
- at example
-compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
- at end example
-
- at item
-Noise gate for when the noise is at a lower level than the signal:
- at example
-compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
- at end example
-
- at item
-Here is another noise gate, this time for when the noise is at a higher level
-than the signal (making it, in some ways, similar to squelch):
- at example
-compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
- at end example
- at end itemize
-
- at section join
-Join multiple input streams into one multi-channel stream.
-
-The filter accepts the following named parameters:
- at table @option
-
- at item inputs
-Number of input streams. Defaults to 2.
-
- at item channel_layout
-Desired output channel layout. Defaults to stereo.
-
- at item map
-Map channels from inputs to output. The argument is a '|'-separated list of
-mappings, each in the @code{@var{input_idx}. at var{in_channel}- at var{out_channel}}
-form. @var{input_idx} is the 0-based index of the input stream. @var{in_channel}
-can be either the name of the input channel (e.g. FL for front left) or its
-index in the specified input stream. @var{out_channel} is the name of the output
-channel.
- at end table
-
-The filter will attempt to guess the mappings when those are not specified
-explicitly. It does so by first trying to find an unused matching input channel
-and if that fails it picks the first unused input channel.
-
-E.g. to join 3 inputs (with properly set channel layouts)
- at example
-avconv -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
- at end example
-
-To build a 5.1 output from 6 single-channel streams:
- at example
-avconv -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
-'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
-out
- at end example
-
- at section resample
-Convert the audio sample format, sample rate and channel layout. This filter is
-not meant to be used directly, it is inserted automatically by libavfilter
-whenever conversion is needed. Use the @var{aformat} filter to force a specific
-conversion.
-
- at section volume
-
-Adjust the input audio volume.
-
-The filter accepts the following named parameters:
- at table @option
-
- at item volume
-Expresses how the audio volume will be increased or decreased.
-
-Output values are clipped to the maximum value.
-
-The output audio volume is given by the relation:
- at example
- at var{output_volume} = @var{volume} * @var{input_volume}
- at end example
-
-Default value for @var{volume} is 1.0.
-
- at item precision
-Mathematical precision.
-
-This determines which input sample formats will be allowed, which affects the
-precision of the volume scaling.
-
- at table @option
- at item fixed
-8-bit fixed-point; limits input sample format to U8, S16, and S32.
- at item float
-32-bit floating-point; limits input sample format to FLT. (default)
- at item double
-64-bit floating-point; limits input sample format to DBL.
- at end table
- at end table
-
- at subsection Examples
-
- at itemize
- at item
-Halve the input audio volume:
- at example
-volume=volume=0.5
-volume=volume=1/2
-volume=volume=-6.0206dB
- at end example
-
- at item
-Increase input audio power by 6 decibels using fixed-point precision:
- at example
-volume=volume=6dB:precision=fixed
- at end example
- at end itemize
-
- at c man end AUDIO FILTERS
-
- at chapter Audio Sources
- at c man begin AUDIO SOURCES
-
-Below is a description of the currently available audio sources.
-
- at section anullsrc
-
-Null audio source, never return audio frames. 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{sample_rate}:@var{channel_layout}.
-
- at var{sample_rate} specify the sample rate, and defaults to 44100.
-
- at var{channel_layout} specify the channel layout, and can be either an
-integer or a string representing a channel layout. The default value
-of @var{channel_layout} is 3, which corresponds to CH_LAYOUT_STEREO.
-
-Check the channel_layout_map definition in
- at file{libavutil/channel_layout.c} for the mapping between strings and
-channel layout values.
-
-Follow some examples:
- at example
-#  set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
-anullsrc=48000:4
-
-# same as
-anullsrc=48000:mono
- at end example
-
- at section abuffer
-Buffer audio frames, and make them available to the filter chain.
-
-This source is not intended to be part of user-supplied graph descriptions but
-for insertion by calling programs through the interface defined in
- at file{libavfilter/buffersrc.h}.
-
-It accepts the following named parameters:
- at table @option
-
- at item time_base
-Timebase which will be used for timestamps of submitted frames. It must be
-either a floating-point number or in @var{numerator}/@var{denominator} form.
-
- at item sample_rate
-Audio sample rate.
-
- at item sample_fmt
-Name of the sample format, as returned by @code{av_get_sample_fmt_name()}.
-
- at item channel_layout
-Channel layout of the audio data, in the form that can be accepted by
- at code{av_get_channel_layout()}.
- at end table
-
-All the parameters need to be explicitly defined.
-
- at c man end AUDIO SOURCES
-
- at chapter Audio Sinks
- at c man begin AUDIO SINKS
-
-Below is a description of the currently available audio sinks.
-
- at section anullsink
-
-Null audio sink, do absolutely nothing with the input audio. It is
-mainly useful as a template and to be employed in analysis / debugging
-tools.
-
- at section abuffersink
-This sink is intended for programmatic use. Frames that arrive on this sink can
-be retrieved by the calling program using the interface defined in
- at file{libavfilter/buffersink.h}.
-
-This filter accepts no parameters.
-
- at c man end AUDIO SINKS
-
- at chapter Video Filters
- at c man begin VIDEO FILTERS
-
-When you configure your Libav build, you can disable any of the
-existing filters using --disable-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 blackframe
-
-Detect frames that are (almost) completely black. Can be useful to
-detect chapter transitions or commercials. Output lines consist of
-the frame number of the detected frame, the percentage of blackness,
-the position in the file if known or -1 and the timestamp in seconds.
-
-In order to display the output lines, you need to set the loglevel at
-least to the AV_LOG_INFO value.
-
-The filter accepts the following options:
-
- at table @option
-
- at item amount
-The percentage of the pixels that have to be below the threshold, defaults to
-98.
-
- at item threshold
-Threshold below which a pixel value is considered black, defaults to 32.
-
- at end table
-
- at section boxblur
-
-Apply boxblur algorithm to the input video.
-
-This filter accepts the following options:
-
- at table @option
-
- at item luma_radius
- at item luma_power
- at item chroma_radius
- at item chroma_power
- at item alpha_radius
- at item alpha_power
-
- at end table
-
-Chroma and alpha parameters are optional, if not specified they default
-to the corresponding values set for @var{luma_radius} and
- at var{luma_power}.
-
- at var{luma_radius}, @var{chroma_radius}, and @var{alpha_radius} represent
-the radius in pixels of the box used for blurring the corresponding
-input plane. They are expressions, and can contain the following
-constants:
- at table @option
- at item w, h
-the input width and height in pixels
-
- at item cw, ch
-the input chroma image width and height in pixels
-
- at item hsub, vsub
-horizontal and vertical chroma subsample values. For example for the
-pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
- at end table
-
-The radius must be a non-negative number, and must not be greater than
-the value of the expression @code{min(w,h)/2} for the luma and alpha planes,
-and of @code{min(cw,ch)/2} for the chroma planes.
-
- at var{luma_power}, @var{chroma_power}, and @var{alpha_power} represent
-how many times the boxblur filter is applied to the corresponding
-plane.
-
-Some examples follow:
-
- at itemize
-
- at item
-Apply a boxblur filter with luma, chroma, and alpha radius
-set to 2:
- at example
-boxblur=luma_radius=2:luma_power=1
- at end example
-
- at item
-Set luma radius to 2, alpha and chroma radius to 0
- at example
-boxblur=2:1:0:0:0:0
- at end example
-
- at item
-Set luma and chroma radius to a fraction of the video dimension
- at example
-boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
- at end example
-
- at end itemize
-
- at section copy
-
-Copy the input source unchanged to the output. Mainly useful for
-testing purposes.
-
- at section crop
-
-Crop the input video to given dimensions.
-
-This filter accepts the following options:
-
- at table @option
-
- at item out_w
-Width of the output video.
-
- at item out_h
-Height of the output video.
-
- at item x
-Horizontal position, in the input video, of the left edge of the output video.
-
- at item y
-Vertical position, in the input video, of the top edge of the output video.
-
- at end table
-
-The parameters are expressions containing the following constants:
-
- at table @option
- at item E, PI, PHI
-the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), PHI (golden ratio)
-
- at item x, y
-the computed values for @var{x} and @var{y}. They are evaluated for
-each new frame.
-
- at item in_w, in_h
-the input width and height
-
- at item iw, ih
-same as @var{in_w} and @var{in_h}
-
- at item out_w, out_h
-the output (cropped) width and height
-
- at item ow, oh
-same as @var{out_w} and @var{out_h}
-
- at item n
-the number of input frame, starting from 0
-
- at item t
-timestamp expressed in seconds, NAN if the input timestamp is unknown
-
- at end table
-
-The @var{out_w} and @var{out_h} parameters specify the expressions for
-the width and height of the output (cropped) video. They are
-evaluated just at the configuration of the filter.
-
-The default value of @var{out_w} is "in_w", and the default value of
- at var{out_h} is "in_h".
-
-The expression for @var{out_w} may depend on the value of @var{out_h},
-and the expression for @var{out_h} may depend on @var{out_w}, but they
-cannot depend on @var{x} and @var{y}, as @var{x} and @var{y} are
-evaluated after @var{out_w} and @var{out_h}.
-
-The @var{x} and @var{y} parameters specify the expressions for the
-position of the top-left corner of the output (non-cropped) area. They
-are evaluated for each frame. If the evaluated value is not valid, it
-is approximated to the nearest valid value.
-
-The default value of @var{x} is "(in_w-out_w)/2", and the default
-value for @var{y} is "(in_h-out_h)/2", which set the cropped area at
-the center of the input image.
-
-The expression for @var{x} may depend on @var{y}, and the expression
-for @var{y} may depend on @var{x}.
-
-Follow some examples:
- at example
-# crop the central input area with size 100x100
-crop=out_w=100:out_h=100
-
-# crop the central input area with size 2/3 of the input video
-"crop=out_w=2/3*in_w:out_h=2/3*in_h"
-
-# crop the input video central square
-crop=out_w=in_h
-
-# 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.
-crop=out_w=in_w-100:out_h=in_h-100:x=100:y=100
-
-# crop 10 pixels from the left and right borders, and 20 pixels from
-# the top and bottom borders
-"crop=out_w=in_w-2*10:out_h=in_h-2*20"
-
-# keep only the bottom right quarter of the input image
-"crop=out_w=in_w/2:out_h=in_h/2:x=in_w/2:y=in_h/2"
-
-# crop height for getting Greek harmony
-"crop=out_w=in_w:out_h=1/PHI*in_w"
-
-# trembling effect
-"crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)"
-
-# erratic camera effect depending on timestamp
-"crop=out_w=in_w/2:out_h=in_h/2:x=(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):y=(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)"
-
-# set x depending on the value of y
-"crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
- at end example
-
- at section cropdetect
-
-Auto-detect crop size.
-
-Calculate necessary cropping parameters and prints the recommended
-parameters through the logging system. The detected dimensions
-correspond to the non-black area of the input video.
-
-This filter accepts the following options:
-
- at table @option
-
- at item limit
-Threshold, which can be optionally specified from nothing (0) to
-everything (255), defaults to 24.
-
- at item round
-Value which the width/height should be divisible by, defaults to
-16. The offset is automatically adjusted to center the video. Use 2 to
-get only even dimensions (needed for 4:2:2 video). 16 is best when
-encoding to most video codecs.
-
- at item reset
-Counter that determines after how many frames cropdetect will reset
-the previously detected largest video area and start over to detect
-the current optimal crop area. Defaults to 0.
-
-This can be useful when channel logos distort the video area. 0
-indicates never reset and return the largest area encountered during
-playback.
- at end table
-
- at section delogo
-
-Suppress a TV station logo by a simple interpolation of the surrounding
-pixels. Just set a rectangle covering the logo and watch it disappear
-(and sometimes something even uglier appear - your mileage may vary).
-
-This filter accepts the following options:
- at table @option
-
- at item x, y
-Specify the top left corner coordinates of the logo. They must be
-specified.
-
- at item w, h
-Specify the width and height of the logo to clear. They must be
-specified.
-
- at item band, t
-Specify the thickness of the fuzzy edge of the rectangle (added to
- at var{w} and @var{h}). The default value is 4.
-
- at item show
-When set to 1, a green rectangle is drawn on the screen to simplify
-finding the right @var{x}, @var{y}, @var{w}, @var{h} parameters, and
- at var{band} is set to 4. The default value is 0.
-
- at end table
-
-Some examples follow.
-
- at itemize
-
- at item
-Set a rectangle covering the area with top left corner coordinates 0,0
-and size 100x77, setting a band of size 10:
- at example
-delogo=x=0:y=0:w=100:h=77:band=10
- at end example
-
- at end itemize
-
- at section drawbox
-
-Draw a colored box on the input image.
-
-This filter accepts the following options:
-
- at table @option
-
- at item x, y
-Specify the top left corner coordinates of the box. Default to 0.
-
- at item width, height
-Specify the width and height of the box, if 0 they are interpreted as
-the input width and height. Default to 0.
-
- at item color
-Specify the color of the box to write, it can be the name of a color
-(case insensitive match) or a 0xRRGGBB[AA] sequence.
- at end table
-
-Follow some examples:
- at example
-# draw a black box around the edge of the input image
-drawbox
-
-# draw a box with color red and an opacity of 50%
-drawbox=x=10:y=20:width=200:height=60:color=red@@0.5"
- at end example
-
- at section drawtext
-
-Draw text string or text from specified file on top of video using the
-libfreetype library.
-
-To enable compilation of this filter you need to configure Libav with
- at code{--enable-libfreetype}.
-
-The filter also recognizes strftime() sequences in the provided text
-and expands them accordingly. Check the documentation of strftime().
-
-The description of the accepted parameters follows.
-
- at table @option
-
- at item fontfile
-The font file to be used for drawing text. Path must be included.
-This parameter is mandatory.
-
- at item text
-The text string to be drawn. The text must be a sequence of UTF-8
-encoded characters.
-This parameter is mandatory if no file is specified with the parameter
- at var{textfile}.
-
- at item textfile
-A text file containing text to be drawn. The text must be a sequence
-of UTF-8 encoded characters.
-
-This parameter is mandatory if no text string is specified with the
-parameter @var{text}.
-
-If both text and textfile are specified, an error is thrown.
-
- at item x, y
-The offsets where text will be drawn within the video frame.
-Relative to the top/left border of the output image.
-They accept expressions similar to the @ref{overlay} filter:
- at table @option
-
- at item x, y
-the computed values for @var{x} and @var{y}. They are evaluated for
-each new frame.
-
- at item main_w, main_h
-main input width and height
-
- at item W, H
-same as @var{main_w} and @var{main_h}
-
- at item text_w, text_h
-rendered text width and height
-
- at item w, h
-same as @var{text_w} and @var{text_h}
-
- at item n
-the number of frames processed, starting from 0
-
- at item t
-timestamp expressed in seconds, NAN if the input timestamp is unknown
-
- at end table
-
-The default value of @var{x} and @var{y} is 0.
-
- at item fontsize
-The font size to be used for drawing text.
-The default value of @var{fontsize} is 16.
-
- at item fontcolor
-The color to be used for drawing fonts.
-Either a string (e.g. "red") or in 0xRRGGBB[AA] format
-(e.g. "0xff000033"), possibly followed by an alpha specifier.
-The default value of @var{fontcolor} is "black".
-
- at item boxcolor
-The color to be used for drawing box around text.
-Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
-(e.g. "0xff00ff"), possibly followed by an alpha specifier.
-The default value of @var{boxcolor} is "white".
-
- at item box
-Used to draw a box around text using background color.
-Value should be either 1 (enable) or 0 (disable).
-The default value of @var{box} is 0.
-
- at item shadowx, shadowy
-The x and y offsets for the text shadow position with respect to the
-position of the text. They can be either positive or negative
-values. Default value for both is "0".
-
- at item shadowcolor
-The color to be used for drawing a shadow behind the drawn text.  It
-can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
-form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
-The default value of @var{shadowcolor} is "black".
-
- at item ft_load_flags
-Flags to be used for loading the fonts.
-
-The flags map the corresponding flags supported by libfreetype, and are
-a combination of the following values:
- at table @var
- at item default
- at item no_scale
- at item no_hinting
- at item render
- at item no_bitmap
- at item vertical_layout
- at item force_autohint
- at item crop_bitmap
- at item pedantic
- at item ignore_global_advance_width
- at item no_recurse
- at item ignore_transform
- at item monochrome
- at item linear_design
- at item no_autohint
- at item end table
- at end table
-
-Default value is "render".
-
-For more information consult the documentation for the FT_LOAD_*
-libfreetype flags.
-
- at item tabsize
-The size in number of spaces to use for rendering the tab.
-Default value is 4.
-
- at item fix_bounds
-If true, check and fix text coords to avoid clipping.
- at end table
-
-For example the command:
- at example
-drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
- at end example
-
-will draw "Test Text" with font FreeSerif, using the default values
-for the optional parameters.
-
-The command:
- at example
-drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
-          x=100: y=50: fontsize=24: fontcolor=yellow@@0.2: box=1: boxcolor=red@@0.2"
- at end example
-
-will draw 'Test Text' with font FreeSerif of size 24 at position x=100
-and y=50 (counting from the top-left corner of the screen), text is
-yellow with a red box around it. Both the text and the box have an
-opacity of 20%.
-
-Note that the double quotes are not necessary if spaces are not used
-within the parameter list.
-
-For more information about libfreetype, check:
- at url{http://www.freetype.org/}.
-
- at section fade
-
-Apply fade-in/out effect to input video.
-
-This filter accepts the following options:
-
- at table @option
-
- at item type
-The effect type -- can be either "in" for fade-in, or "out" for a fade-out
-effect.
-
- at item start_frame
-The number of the start frame for starting to apply the fade effect.
-
- at item nb_frames
-The number of frames for which the fade effect has to last. At the end of the
-fade-in effect the output video will have the same intensity as the input video,
-at the end of the fade-out transition the output video will be completely black.
-
- at end table
-
-A few usage examples follow, usable too as test scenarios.
- at example
-# fade in first 30 frames of video
-fade=type=in:nb_frames=30
-
-# fade out last 45 frames of a 200-frame video
-fade=type=out:start_frame=155:nb_frames=45
-
-# fade in first 25 frames and fade out last 25 frames of a 1000-frame video
-fade=type=in:start_frame=0:nb_frames=25, fade=type=out:start_frame=975:nb_frames=25
-
-# make first 5 frames black, then fade in from frame 5-24
-fade=type=in:start_frame=5:nb_frames=20
- at end example
-
- at section fieldorder
-
-Transform the field order of the input video.
-
-This filter accepts the following options:
-
- at table @option
-
- at item order
-Output field order. Valid values are @var{tff} for top field first or @var{bff}
-for bottom field first.
- at end table
-
-Default value is "tff".
-
-Transformation is achieved by shifting the picture content up or down
-by one line, and filling the remaining line with appropriate picture content.
-This method is consistent with most broadcast field order converters.
-
-If the input video is not flagged as being interlaced, or it is already
-flagged as being of the required output field order then this filter does
-not alter the incoming video.
-
-This filter is very useful when converting to or from PAL DV material,
-which is bottom field first.
-
-For example:
- at example
-./avconv -i in.vob -vf "fieldorder=order=bff" out.dv
- at end example
-
- at section fifo
-
-Buffer input images and send them when they are requested.
-
-This filter is mainly useful when auto-inserted by the libavfilter
-framework.
-
-The filter does not take parameters.
-
- 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.
-
-This filter accepts the following parameters:
- at table @option
-
- at item pix_fmts
-A '|'-separated list of pixel format names, for example
-"pix_fmts=yuv420p|monow|rgb24".
-
- at end table
-
-Some examples follow:
- at example
-# convert the input video to the format "yuv420p"
-format=pix_fmts=yuv420p
-
-# convert the input video to any of the formats in the list
-format=pix_fmts=yuv420p|yuv444p|yuv410p
- at end example
-
- at anchor{fps}
- at section fps
-
-Convert the video to specified constant framerate by duplicating or dropping
-frames as necessary.
-
-This filter accepts the following named parameters:
- at table @option
-
- at item fps
-Desired output framerate.
-
- at item start_time
-Assume the first PTS should be the given value, in seconds. This allows for
-padding/trimming at the start of stream. By default, no assumption is made
-about the first frame's expected PTS, so no padding or trimming is done.
-For example, this could be set to 0 to pad the beginning with duplicates of
-the first frame if a video stream starts after the audio stream or to trim any
-frames with a negative PTS.
-
- at end table
-
- at section framepack
-
-Pack two different video streams into a stereoscopic video, setting proper
-metadata on supported codecs. The two views should have the same size and
-framerate and processing will stop when the shorter video ends. Please note
-that you may conveniently adjust view properties with the @ref{scale} and
- at ref{fps} filters.
-
-This filter accepts the following named parameters:
- at table @option
-
- at item format
-Desired packing format. Supported values are:
-
- at table @option
-
- at item sbs
-Views are next to each other (default).
-
- at item tab
-Views are on top of each other.
-
- at item lines
-Views are packed by line.
-
- at item columns
-Views are eacked by column.
-
- at item frameseq
-Views are temporally interleaved.
-
- at end table
-
- at end table
-
-Some examples follow:
-
- at example
-# Convert left and right views into a frame sequential video.
-avconv -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
-
-# Convert views into a side-by-side video with the same output resolution as the input.
-avconv -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
- at end example
-
- at anchor{frei0r}
- at section frei0r
-
-Apply a frei0r effect to the input video.
-
-To enable compilation of this filter you need to install the frei0r
-header and configure Libav with --enable-frei0r.
-
-This filter accepts the following options:
-
- at table @option
-
- at item filter_name
-The name to the frei0r effect to load. If the environment variable
- at env{FREI0R_PATH} is defined, the frei0r effect is searched in each one of the
-directories specified by the colon separated list in @env{FREIOR_PATH},
-otherwise in the standard frei0r paths, which are in this order:
- at file{HOME/.frei0r-1/lib/}, @file{/usr/local/lib/frei0r-1/},
- at file{/usr/lib/frei0r-1/}.
-
- at item filter_params
-A '|'-separated list of parameters to pass to the frei0r effect.
-
- at end table
-
-A frei0r effect parameter can be a boolean (whose values are specified
-with "y" and "n"), a double, a color (specified by the syntax
- at var{R}/@var{G}/@var{B}, @var{R}, @var{G}, and @var{B} being float
-numbers from 0.0 to 1.0) or by an @code{av_parse_color()} color
-description), a position (specified by the syntax @var{X}/@var{Y},
- at var{X} and @var{Y} being float numbers) and a string.
-
-The number and kind of parameters depend on the loaded effect. If an
-effect parameter is not specified the default value is set.
-
-Some examples follow:
- at example
-# apply the distort0r effect, set the first two double parameters
-frei0r=filter_name=distort0r:filter_params=0.5|0.01
-
-# apply the colordistance effect, takes a color as first parameter
-frei0r=colordistance:0.2/0.3/0.4
-frei0r=colordistance:violet
-frei0r=colordistance:0x112233
-
-# apply the perspective effect, specify the top left and top right
-# image positions
-frei0r=perspective:0.2/0.2|0.8/0.2
- at end example
-
-For more information see:
- at url{http://piksel.org/frei0r}
-
- at section gradfun
-
-Fix the banding artifacts that are sometimes introduced into nearly flat
-regions by truncation to 8bit colordepth.
-Interpolate the gradients that should go where the bands are, and
-dither them.
-
-This filter is designed for playback only.  Do not use it prior to
-lossy compression, because compression tends to lose the dither and
-bring back the bands.
-
-This filter accepts the following options:
-
- at table @option
-
- at item strength
-The maximum amount by which the filter will change any one pixel. Also the
-threshold for detecting nearly flat regions. Acceptable values range from .51 to
-64, default value is 1.2, out-of-range values will be clipped to the valid
-range.
-
- at item radius
-The neighborhood to fit the gradient to. A larger radius makes for smoother
-gradients, but also prevents the filter from modifying the pixels near detailed
-regions. Acceptable values are 8-32, default value is 16, out-of-range values
-will be clipped to the valid range.
-
- at end table
-
- at example
-# default parameters
-gradfun=strength=1.2:radius=16
-
-# omitting radius
-gradfun=1.2
- at end example
-
- at section hflip
-
-Flip the input video horizontally.
-
-For example to horizontally flip the input video with @command{avconv}:
- at example
-avconv -i in.avi -vf "hflip" out.avi
- at end example
-
- at section hqdn3d
-
-High precision/quality 3d denoise filter. This filter aims to reduce
-image noise producing smooth images and making still images really
-still. It should enhance compressibility.
-
-It accepts the following optional parameters:
-
- at table @option
- at item luma_spatial
-a non-negative float number which specifies spatial luma strength,
-defaults to 4.0
-
- at item chroma_spatial
-a non-negative float number which specifies spatial chroma strength,
-defaults to 3.0*@var{luma_spatial}/4.0
-
- at item luma_tmp
-a float number which specifies luma temporal strength, defaults to
-6.0*@var{luma_spatial}/4.0
-
- at item chroma_tmp
-a float number which specifies chroma temporal strength, defaults to
- at var{luma_tmp}*@var{chroma_spatial}/@var{luma_spatial}
- at end table
-
- at section interlace
-
-Simple interlacing filter from progressive contents. This interleaves upper (or
-lower) lines from odd frames with lower (or upper) lines from even frames,
-halving the frame rate and preserving image height.
-
- at example
-   Original        Original             New Frame
-   Frame 'j'      Frame 'j+1'             (tff)
-  ==========      ===========       ==================
-    Line 0  -------------------->    Frame 'j' Line 0
-    Line 1          Line 1  ---->   Frame 'j+1' Line 1
-    Line 2 --------------------->    Frame 'j' Line 2
-    Line 3          Line 3  ---->   Frame 'j+1' Line 3
-     ...             ...                   ...
-New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
- at end example
-
-It accepts the following optional parameters:
-
- at table @option
- at item scan
-determines whether the interlaced frame is taken from the even (tff - default)
-or odd (bff) lines of the progressive frame.
-
- at item lowpass
-Enable (default) or disable the vertical lowpass filter to avoid twitter
-interlacing and reduce moire patterns.
- at end table
-
- at section lut, lutrgb, lutyuv
-
-Compute a look-up table for binding each pixel component input value
-to an output value, and apply it to input video.
-
- at var{lutyuv} applies a lookup table to a YUV input video, @var{lutrgb}
-to an RGB input video.
-
-These filters accept the following options:
- at table @option
- at item @var{c0} (first  pixel component)
- at item @var{c1} (second pixel component)
- at item @var{c2} (third  pixel component)
- at item @var{c3} (fourth pixel component, corresponds to the alpha component)
-
- at item @var{r} (red component)
- at item @var{g} (green component)
- at item @var{b} (blue component)
- at item @var{a} (alpha component)
-
- at item @var{y} (Y/luminance component)
- at item @var{u} (U/Cb component)
- at item @var{v} (V/Cr component)
- at end table
-
-Each of them specifies the expression to use for computing the lookup table for
-the corresponding pixel component values.
-
-The exact component associated to each of the @var{c*} options depends on the
-format in input.
-
-The @var{lut} filter requires either YUV or RGB pixel formats in input,
- at var{lutrgb} requires RGB pixel formats in input, and @var{lutyuv} requires YUV.
-
-The expressions can contain the following constants and functions:
-
- at table @option
- at item E, PI, PHI
-the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), PHI (golden ratio)
-
- at item w, h
-the input width and height
-
- at item val
-input value for the pixel component
-
- at item clipval
-the input value clipped in the @var{minval}- at var{maxval} range
-
- at item maxval
-maximum value for the pixel component
-
- at item minval
-minimum value for the pixel component
-
- at item negval
-the negated value for the pixel component value clipped in the
- at var{minval}- at var{maxval} range , it corresponds to the expression
-"maxval-clipval+minval"
-
- at item clip(val)
-the computed value in @var{val} clipped in the
- at var{minval}- at var{maxval} range
-
- at item gammaval(gamma)
-the computed gamma correction value of the pixel component value
-clipped in the @var{minval}- at var{maxval} range, corresponds to the
-expression
-"pow((clipval-minval)/(maxval-minval)\, at var{gamma})*(maxval-minval)+minval"
-
- at end table
-
-All expressions default to "val".
-
-Some examples follow:
- at example
-# negate input video
-lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
-lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
-
-# the above is the same as
-lutrgb="r=negval:g=negval:b=negval"
-lutyuv="y=negval:u=negval:v=negval"
-
-# negate luminance
-lutyuv=negval
-
-# remove chroma components, turns the video into a graytone image
-lutyuv="u=128:v=128"
-
-# apply a luma burning effect
-lutyuv="y=2*val"
-
-# remove green and blue components
-lutrgb="g=0:b=0"
-
-# set a constant alpha channel value on input
-format=rgba,lutrgb=a="maxval-minval/2"
-
-# correct luminance gamma by a 0.5 factor
-lutyuv=y=gammaval(0.5)
- at end example
-
- at section negate
-
-Negate input video.
-
-This filter accepts an integer in input, if non-zero it negates the
-alpha component (if available). The default value in input is 0.
-
- at section noformat
-
-Force libavfilter not to use any of the specified pixel formats for the
-input to the next filter.
-
-This filter accepts the following parameters:
- at table @option
-
- at item pix_fmts
-A '|'-separated list of pixel format names, for example
-"pix_fmts=yuv420p|monow|rgb24".
-
- at end table
-
-Some examples follow:
- at example
-# force libavfilter to use a format different from "yuv420p" for the
-# input to the vflip filter
-noformat=pix_fmts=yuv420p,vflip
-
-# convert the input video to any of the formats not contained in the list
-noformat=yuv420p|yuv444p|yuv410p
- at end example
-
- at section null
-
-Pass the video source unchanged to the output.
-
- at section ocv
-
-Apply video transform using libopencv.
-
-To enable this filter install libopencv library and headers and
-configure Libav with --enable-libopencv.
-
-This filter accepts the following parameters:
-
- at table @option
-
- at item filter_name
-The name of the libopencv filter to apply.
-
- at item filter_params
-The parameters to pass to the libopencv filter. If not specified the default
-values are assumed.
-
- at end table
-
-Refer to the official libopencv documentation for more precise
-information:
- at url{http://opencv.willowgarage.com/documentation/c/image_filtering.html}
-
-Follows the list of supported libopencv filters.
-
- at anchor{dilate}
- at subsection dilate
-
-Dilate an image by using a specific structuring element.
-This filter corresponds to the libopencv function @code{cvDilate}.
-
-It accepts the parameters: @var{struct_el}|@var{nb_iterations}.
-
- at var{struct_el} represents a structuring element, and has the syntax:
- at var{cols}x at var{rows}+ at var{anchor_x}x at var{anchor_y}/@var{shape}
-
- at var{cols} and @var{rows} represent the number of columns and rows of
-the structuring element, @var{anchor_x} and @var{anchor_y} the anchor
-point, and @var{shape} the shape for the structuring element, and
-can be one of the values "rect", "cross", "ellipse", "custom".
-
-If the value for @var{shape} is "custom", it must be followed by a
-string of the form "=@var{filename}". The file with name
- at var{filename} is assumed to represent a binary image, with each
-printable character corresponding to a bright pixel. When a custom
- at var{shape} is used, @var{cols} and @var{rows} are ignored, the number
-or columns and rows of the read file are assumed instead.
-
-The default value for @var{struct_el} is "3x3+0x0/rect".
-
- at var{nb_iterations} specifies the number of times the transform is
-applied to the image, and defaults to 1.
-
-Follow some example:
- at example
-# use the default values
-ocv=dilate
-
-# dilate using a structuring element with a 5x5 cross, iterate two times
-ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
-
-# read the shape from the file diamond.shape, iterate two times
-# the file diamond.shape may contain a pattern of characters like this:
-#   *
-#  ***
-# *****
-#  ***
-#   *
-# the specified cols and rows are ignored (but not the anchor point coordinates)
-ocv=dilate:0x0+2x2/custom=diamond.shape|2
- at end example
-
- at subsection erode
-
-Erode an image by using a specific structuring element.
-This filter corresponds to the libopencv function @code{cvErode}.
-
-The filter accepts the parameters: @var{struct_el}:@var{nb_iterations},
-with the same syntax and semantics as the @ref{dilate} filter.
-
- at subsection smooth
-
-Smooth the input video.
-
-The filter takes the following parameters:
- at var{type}|@var{param1}|@var{param2}|@var{param3}|@var{param4}.
-
- at var{type} is the type of smooth filter to apply, and can be one of
-the following values: "blur", "blur_no_scale", "median", "gaussian",
-"bilateral". The default value is "gaussian".
-
- at var{param1}, @var{param2}, @var{param3}, and @var{param4} are
-parameters whose meanings depend on smooth type. @var{param1} and
- at var{param2} accept integer positive values or 0, @var{param3} and
- at var{param4} accept float values.
-
-The default value for @var{param1} is 3, the default value for the
-other parameters is 0.
-
-These parameters correspond to the parameters assigned to the
-libopencv function @code{cvSmooth}.
-
- at anchor{overlay}
- at section overlay
-
-Overlay one video on top of another.
-
-It takes two inputs and one output, the first input is the "main"
-video on which the second input is overlayed.
-
-This filter accepts the following parameters:
-
- at table @option
-
- at item x
-The horizontal position of the left edge of the overlaid video on the main video.
-
- at item y
-The vertical position of the top edge of the overlaid video on the main video.
-
- at end table
-
-The parameters are expressions containing the following parameters:
-
- at table @option
- at item main_w, main_h
-main input width and height
-
- at item W, H
-same as @var{main_w} and @var{main_h}
-
- at item overlay_w, overlay_h
-overlay input width and height
-
- at item w, h
-same as @var{overlay_w} and @var{overlay_h}
-
- at item eof_action
-The action to take when EOF is encountered on the secondary input, accepts one
-of the following values:
-
- at table @option
- at item repeat
-repeat the last frame (the default)
- at item endall
-end both streams
- at item pass
-pass through the main input
- at end table
-
- at end table
-
-Be aware that frames are taken from each input video in timestamp
-order, hence, if their initial timestamps differ, it is a a good idea
-to pass the two inputs through a @var{setpts=PTS-STARTPTS} filter to
-have them begin in the same zero timestamp, as it does the example for
-the @var{movie} filter.
-
-Follow some examples:
- at example
-# draw the overlay at 10 pixels from the bottom right
-# corner of the main video.
-overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
-
-# insert a transparent PNG logo in the bottom left corner of the input
-avconv -i input -i logo -filter_complex 'overlay=x=10:y=main_h-overlay_h-10' output
-
-# insert 2 different transparent PNG logos (second logo on bottom
-# right corner):
-avconv -i input -i logo1 -i logo2 -filter_complex
-'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
-
-# add a transparent color layer on top of the main video,
-# WxH specifies the size of the main input to the overlay filter
-color=red at .3:WxH [over]; [in][over] overlay [out]
-
-# mask 10-20 seconds of a video by applying the delogo filter to a section
-avconv -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
--vf '[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]'
-masked.avi
- at end example
-
-You can chain together more overlays but the efficiency of such
-approach is yet to be tested.
-
- at section pad
-
-Add paddings to the input image, and places the original input at the
-given coordinates @var{x}, @var{y}.
-
-This filter accepts the following parameters:
-
- at table @option
- at item width, height
-
-Specify the size of the output image with the paddings added. If the
-value for @var{width} or @var{height} is 0, the corresponding input size
-is used for the output.
-
-The @var{width} expression can reference the value set by the
- at var{height} expression, and vice versa.
-
-The default value of @var{width} and @var{height} is 0.
-
- at item x, y
-
-Specify the offsets where to place the input image in the padded area
-with respect to the top/left border of the output image.
-
-The @var{x} expression can reference the value set by the @var{y}
-expression, and vice versa.
-
-The default value of @var{x} and @var{y} is 0.
-
- at item color
-
-Specify the color of the padded area, it can be the name of a color
-(case insensitive match) or a 0xRRGGBB[AA] sequence.
-
-The default value of @var{color} is "black".
-
- at end table
-
-The parameters @var{width}, @var{height}, @var{x}, and @var{y} are
-expressions containing the following constants:
-
- at table @option
- at item E, PI, PHI
-the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-
- at item in_w, in_h
-the input video width and height
-
- at item iw, ih
-same as @var{in_w} and @var{in_h}
-
- at item out_w, out_h
-the output width and height, that is the size of the padded area as
-specified by the @var{width} and @var{height} expressions
-
- at item ow, oh
-same as @var{out_w} and @var{out_h}
-
- at item x, y
-x and y offsets as specified by the @var{x} and @var{y}
-expressions, or NAN if not yet specified
-
- at item a
-input display aspect ratio, same as @var{iw} / @var{ih}
-
- at item hsub, vsub
-horizontal and vertical chroma subsample values. For example for the
-pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
- at end table
-
-Some examples follow:
-
- at example
-# Add paddings with color "violet" to the input video. Output video
-# size is 640x480, the top-left corner of the input video is placed at
-# column 0, row 40.
-pad=width=640:height=480:x=0:y=40:color=violet
-
-# pad the input to get an output with dimensions increased bt 3/2,
-# and put the input video at the center of the padded area
-pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
-
-# pad the input to get a squared output with size equal to the maximum
-# value between the input width and height, and put the input video at
-# the center of the padded area
-pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
-
-# pad the input to get a final w/h ratio of 16:9
-pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
-
-# double output size and put the input video in the bottom-right
-# corner of the output padded area
-pad="2*iw:2*ih:ow-iw:oh-ih"
- at end example
-
- at section pixdesctest
-
-Pixel format descriptor test filter, mainly useful for internal
-testing. The output video should be equal to the input video.
-
-For example:
- at example
-format=monow, pixdesctest
- at end example
-
-can be used to test the monowhite pixel format descriptor definition.
-
- at anchor{scale}
- at section scale
-
-Scale the input video and/or convert the image format.
-
-This filter accepts the following options:
-
- at table @option
-
- at item w
-Output video width.
-
- at item h
-Output video height.
-
- at end table
-
-The parameters @var{w} and @var{h} are expressions containing
-the following constants:
-
- at table @option
- at item E, PI, PHI
-the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-
- at item in_w, in_h
-the input width and height
-
- at item iw, ih
-same as @var{in_w} and @var{in_h}
-
- at item out_w, out_h
-the output (cropped) width and height
-
- at item ow, oh
-same as @var{out_w} and @var{out_h}
-
- at item a
-same as @var{iw} / @var{ih}
-
- at item sar
-input sample aspect ratio
-
- at item dar
-input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
-
- at item hsub, vsub
-horizontal and vertical chroma subsample values. For example for the
-pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
- at end table
-
-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{w} or @var{h} is 0, the respective input
-size is used for the output.
-
-If the value for @var{w} or @var{h} 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{w} and @var{h} is 0.
-
-Some examples follow:
- at example
-# scale the input video to a size of 200x100.
-scale=w=200:h=100
-
-# scale the input to 2x
-scale=w=2*iw:h=2*ih
-# the above is the same as
-scale=2*in_w:2*in_h
-
-# scale the input to half size
-scale=w=iw/2:h=ih/2
-
-# increase the width, and set the height to the same size
-scale=3/2*iw:ow
-
-# seek for Greek harmony
-scale=iw:1/PHI*iw
-scale=ih*PHI:ih
-
-# increase the height, and set the width to 3/2 of the height
-scale=w=3/2*oh:h=3/5*ih
-
-# increase the size, but make the size a multiple of the chroma
-scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
-
-# increase the width to a maximum of 500 pixels, keep the same input aspect ratio
-scale=w='min(500\, iw*3/2):h=-1'
- at end example
-
- at section select
-Select frames to pass in output.
-
-This filter accepts the following options:
-
- at table @option
-
- at item expr
-An expression, which is evaluated for each input frame. If the expression is
-evaluated to a non-zero value, the frame is selected and passed to the output,
-otherwise it is discarded.
-
- at end table
-
-The expression can contain the following constants:
-
- at table @option
- at item PI
-Greek PI
-
- at item PHI
-golden ratio
-
- at item E
-Euler number
-
- at item n
-the sequential number of the filtered frame, starting from 0
-
- at item selected_n
-the sequential number of the selected frame, starting from 0
-
- at item prev_selected_n
-the sequential number of the last selected frame, NAN if undefined
-
- at item TB
-timebase of the input timestamps
-
- at item pts
-the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in @var{TB} units, NAN if undefined
-
- at item t
-the PTS (Presentation TimeStamp) of the filtered video frame,
-expressed in seconds, NAN if undefined
-
- at item prev_pts
-the PTS of the previously filtered video frame, NAN if undefined
-
- at item prev_selected_pts
-the PTS of the last previously filtered video frame, NAN if undefined
-
- at item prev_selected_t
-the PTS of the last previously selected video frame, NAN if undefined
-
- at item start_pts
-the PTS of the first video frame in the video, NAN if undefined
-
- at item start_t
-the time of the first video frame in the video, NAN if undefined
-
- at item pict_type
-the type of the filtered frame, can assume one of the following
-values:
- at table @option
- at item I
- at item P
- at item B
- at item S
- at item SI
- at item SP
- at item BI
- at end table
-
- at item interlace_type
-the frame interlace type, can assume one of the following values:
- at table @option
- at item PROGRESSIVE
-the frame is progressive (not interlaced)
- at item TOPFIRST
-the frame is top-field-first
- at item BOTTOMFIRST
-the frame is bottom-field-first
- at end table
-
- at item key
-1 if the filtered frame is a key-frame, 0 otherwise
-
- at end table
-
-The default value of the select expression is "1".
-
-Some examples follow:
-
- at example
-# select all frames in input
-select
-
-# the above is the same as:
-select=expr=1
-
-# skip all frames:
-select=expr=0
-
-# select only I-frames
-select='expr=eq(pict_type\,I)'
-
-# select one frame every 100
-select='not(mod(n\,100))'
-
-# select only frames contained in the 10-20 time interval
-select='gte(t\,10)*lte(t\,20)'
-
-# select only I frames contained in the 10-20 time interval
-select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)'
-
-# select frames with a minimum distance of 10 seconds
-select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
- at end example
-
- at anchor{setdar}
- at section setdar
-
-Set the Display Aspect Ratio for the filter output video.
-
-This is done by changing the specified Sample (aka Pixel) Aspect
-Ratio, according to the following equation:
- at math{DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR}
-
-Keep in mind that this filter does not modify the pixel dimensions of
-the video frame. Also the display aspect ratio set by this filter may
-be changed by later filters in the filterchain, e.g. in case of
-scaling or if another "setdar" or a "setsar" filter is applied.
-
-This filter accepts the following options:
-
- at table @option
-
- at item dar
-Output display aspect ratio.
-
- at end table
-
-The parameter @var{dar} is an expression containing
-the following constants:
-
- at table @option
- at item E, PI, PHI
-the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-
- at item w, h
-the input width and height
-
- at item a
-same as @var{w} / @var{h}
-
- at item sar
-input sample aspect ratio
-
- at item dar
-input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}
-
- at item hsub, vsub
-horizontal and vertical chroma subsample values. For example for the
-pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
- at end table
-
-For example to change the display aspect ratio to 16:9, specify:
- at example
-setdar=dar=16/9
-# the above is equivalent to
-setdar=dar=1.77777
- at end example
-
-See also the @ref{setsar} filter documentation.
-
- at section setpts
-
-Change the PTS (presentation timestamp) of the input video frames.
-
-This filter accepts the following options:
-
- at table @option
-
- at item expr
-The expression which is evaluated for each frame to construct its timestamp.
-
- at end table
-
-The expression is evaluated through the eval API and can contain the following
-constants:
-
- at table @option
- at item PTS
-the presentation timestamp in input
-
- at item PI
-Greek PI
-
- at item PHI
-golden ratio
-
- at item E
-Euler number
-
- at item N
-the count of the input frame, starting from 0.
-
- at item STARTPTS
-the PTS of the first video frame
-
- at item INTERLACED
-tell if the current frame is interlaced
-
- at item PREV_INPTS
-previous input PTS
-
- at item PREV_OUTPTS
-previous output PTS
-
- at item RTCTIME
-wallclock (RTC) time in microseconds
-
- at item RTCSTART
-wallclock (RTC) time at the start of the movie in microseconds
-
- at item TB
-timebase of the input timestamps
-
- at end table
-
-Some examples follow:
-
- at example
-# start counting PTS from zero
-setpts=expr=PTS-STARTPTS
-
-# fast motion
-setpts=expr=0.5*PTS
-
-# slow motion
-setpts=2.0*PTS
-
-# fixed rate 25 fps
-setpts=N/(25*TB)
-
-# fixed rate 25 fps with some jitter
-setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
-
-# generate timestamps from a "live source" and rebase onto the current timebase
-setpts='(RTCTIME - RTCSTART) / (TB * 1000000)"
- at end example
-
- at anchor{setsar}
- at section setsar
-
-Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
-
-Note that as a consequence of the application of this filter, the
-output display aspect ratio will change according to the following
-equation:
- at math{DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR}
-
-Keep in mind that the sample aspect ratio set by this filter may be
-changed by later filters in the filterchain, e.g. if another "setsar"
-or a "setdar" filter is applied.
-
-This filter accepts the following options:
-
- at table @option
-
- at item sar
-Output sample aspect ratio.
-
- at end table
-
-The parameter @var{sar} is an expression containing
-the following constants:
-
- at table @option
- at item E, PI, PHI
-the corresponding mathematical approximated values for e
-(euler number), pi (greek PI), phi (golden ratio)
-
- at item w, h
-the input width and height
-
- at item a
-same as @var{w} / @var{h}
-
- at item sar
-input sample aspect ratio
-
- at item dar
-input display aspect ratio, it is the same as (@var{w} / @var{h}) * @var{sar}
-
- at item hsub, vsub
-horizontal and vertical chroma subsample values. For example for the
-pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
- at end table
-
-For example to change the sample aspect ratio to 10:11, specify:
- at example
-setsar=sar=10/11
- at end example
-
- at section settb
-
-Set the timebase to use for the output frames timestamps.
-It is mainly useful for testing timebase configuration.
-
-This filter accepts the following options:
-
- at table @option
-
- at item expr
-The expression which is evaluated into the output timebase.
-
- at end table
-
-The expression can contain the constants "PI", "E", "PHI", "AVTB" (the
-default timebase), and "intb" (the input timebase).
-
-The default value for the input is "intb".
-
-Follow some examples.
-
- at example
-# set the timebase to 1/25
-settb=expr=1/25
-
-# set the timebase to 1/10
-settb=expr=0.1
-
-#set the timebase to 1001/1000
-settb=1+0.001
-
-#set the timebase to 2*intb
-settb=2*intb
-
-#set the default timebase value
-settb=AVTB
- at end example
-
- at section showinfo
-
-Show a line containing various information for each input video frame.
-The input video is not modified.
-
-The shown line contains a sequence of key/value pairs of the form
- at var{key}:@var{value}.
-
-A description of each shown parameter follows:
-
- at table @option
- at item n
-sequential number of the input frame, starting from 0
-
- at item pts
-Presentation TimeStamp of the input frame, expressed as a number of
-time base units. The time base unit depends on the filter input pad.
-
- at item pts_time
-Presentation TimeStamp of the input frame, expressed as a number of
-seconds
-
- at item pos
-position of the frame in the input stream, -1 if this information in
-unavailable and/or meaningless (for example in case of synthetic video)
-
- at item fmt
-pixel format name
-
- at item sar
-sample aspect ratio of the input frame, expressed in the form
- at var{num}/@var{den}
-
- at item s
-size of the input frame, expressed in the form
- at var{width}x at var{height}
-
- at item i
-interlaced mode ("P" for "progressive", "T" for top field first, "B"
-for bottom field first)
-
- at item iskey
-1 if the frame is a key frame, 0 otherwise
-
- at item type
-picture type of the input frame ("I" for an I-frame, "P" for a
-P-frame, "B" for a B-frame, "?" for unknown type).
-Check also the documentation of the @code{AVPictureType} enum and of
-the @code{av_get_picture_type_char} function defined in
- at file{libavutil/avutil.h}.
-
- at item checksum
-Adler-32 checksum of all the planes of the input frame
-
- at item plane_checksum
-Adler-32 checksum of each plane of the input frame, expressed in the form
-"[@var{c0} @var{c1} @var{c2} @var{c3}]"
- at end table
-
- at section split
-
-Split input video into several identical outputs.
-
-The filter accepts a single parameter which specifies the number of outputs. If
-unspecified, it defaults to 2.
-
-For example
- at example
-avconv -i INPUT -filter_complex split=5 OUTPUT
- at end example
-will create 5 copies of the input video.
-
- at section transpose
-
-Transpose rows with columns in the input video and optionally flip it.
-
-This filter accepts the following options:
-
- at table @option
-
- at item dir
-The direction of the transpose.
-
- at end table
-
-The direction can assume the following values:
-
- at table @samp
- at item cclock_flip
-Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
- at example
-L.R     L.l
-. . ->  . .
-l.r     R.r
- at end example
-
- at item clock
-Rotate by 90 degrees clockwise, that is:
- at example
-L.R     l.L
-. . ->  . .
-l.r     r.R
- at end example
-
- at item cclock
-Rotate by 90 degrees counterclockwise, that is:
- at example
-L.R     R.r
-. . ->  . .
-l.r     L.l
- at end example
-
- at item clock_flip
-Rotate by 90 degrees clockwise and vertically flip, that is:
- at example
-L.R     r.R
-. . ->  . .
-l.r     l.L
- at end example
- at end table
-
- at section trim
-Trim the input so that the output contains one continuous subpart of the input.
-
-This filter accepts the following options:
- at table @option
- at item start
-Timestamp (in seconds) of the start of the kept section. I.e. the frame with the
-timestamp @var{start} will be the first frame in the output.
-
- at item end
-Timestamp (in seconds) of the first frame that will be dropped. I.e. the frame
-immediately preceding the one with the timestamp @var{end} will be the last
-frame in the output.
-
- at item start_pts
-Same as @var{start}, except this option sets the start timestamp in timebase
-units instead of seconds.
-
- at item end_pts
-Same as @var{end}, except this option sets the end timestamp in timebase units
-instead of seconds.
-
- at item duration
-Maximum duration of the output in seconds.
-
- at item start_frame
-Number of the first frame that should be passed to output.
-
- at item end_frame
-Number of the first frame that should be dropped.
- at end table
-
-Note that the first two sets of the start/end options and the @option{duration}
-option look at the frame timestamp, while the _frame variants simply count the
-frames that pass through the filter. Also note that this filter does not modify
-the timestamps. If you wish that the output timestamps start at zero, insert a
-setpts filter after the trim filter.
-
-If multiple start or end options are set, this filter tries to be greedy and
-keep all the frames that match at least one of the specified constraints. To keep
-only the part that matches all the constraints at once, chain multiple trim
-filters.
-
-The defaults are such that all the input is kept. So it is possible to set e.g.
-just the end values to keep everything before the specified time.
-
-Examples:
- at itemize
- at item
-drop everything except the second minute of input
- at example
-avconv -i INPUT -vf trim=60:120
- at end example
-
- at item
-keep only the first second
- at example
-avconv -i INPUT -vf trim=duration=1
- at end example
-
- at end itemize
- at section unsharp
-
-Sharpen or blur the input video.
-
-It accepts the following parameters:
-
- at table @option
-
- at item luma_msize_x
-Set the luma matrix horizontal size. It can be an integer between 3
-and 13, default value is 5.
-
- at item luma_msize_y
-Set the luma matrix vertical size. It can be an integer between 3
-and 13, default value is 5.
-
- at item luma_amount
-Set the luma effect strength. It can be a float number between -2.0
-and 5.0, default value is 1.0.
-
- at item chroma_msize_x
-Set the chroma matrix horizontal size. It can be an integer between 3
-and 13, default value is 5.
-
- at item chroma_msize_y
-Set the chroma matrix vertical size. It can be an integer between 3
-and 13, default value is 5.
-
- at item chroma_amount
-Set the chroma effect strength. It can be a float number between -2.0
-and 5.0, default value is 0.0.
-
- at end table
-
-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:5:5:0.0'.
-
- at example
-# Strong luma sharpen effect parameters
-unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
-
-# Strong blur of both luma and chroma parameters
-unsharp=7:7:-2:7:7:-2
-
-# Use the default values with @command{avconv}
-./avconv -i in.avi -vf "unsharp" out.mp4
- at end example
-
- at section vflip
-
-Flip the input video vertically.
-
- at example
-./avconv -i in.avi -vf "vflip" out.avi
- at end example
-
- at section yadif
-
-Deinterlace the input video ("yadif" means "yet another deinterlacing
-filter").
-
-This filter accepts the following options:
-
- at table @option
-
- at item mode
-The interlacing mode to adopt, accepts one of the following values:
-
- at table @option
- at item 0
-output 1 frame for each frame
- at item 1
-output 1 frame for each field
- at item 2
-like 0 but skips spatial interlacing check
- at item 3
-like 1 but skips spatial interlacing check
- at end table
-
-Default value is 0.
-
- at item parity
-The picture field parity assumed for the input interlaced video, accepts one of
-the following values:
-
- at table @option
- at item 0
-assume top field first
- at item 1
-assume bottom field first
- at item -1
-enable automatic detection
- at end table
-
-Default value is -1.
-If interlacing is unknown or decoder does not export this information,
-top field first will be assumed.
-
- at item auto
-Whether deinterlacer should trust the interlaced flag and only deinterlace
-frames marked as interlaced
-
- at table @option
- at item 0
-deinterlace all frames
- at item 1
-only deinterlace frames marked as interlaced
- at end table
-
-Default value is 0.
-
- at end table
-
- at c man end VIDEO FILTERS
-
- at chapter Video Sources
- at c man begin VIDEO SOURCES
-
-Below is a description of the currently available video sources.
-
- at section buffer
-
-Buffer video frames, and make them available to the filter chain.
-
-This source is mainly intended for a programmatic use, in particular
-through the interface defined in @file{libavfilter/vsrc_buffer.h}.
-
-This filter accepts the following parameters:
-
- at table @option
-
- at item width
-Input video width.
-
- at item height
-Input video height.
-
- at item pix_fmt
-Name of the input video pixel format.
-
- at item time_base
-The time base used for input timestamps.
-
- at item sar
-Sample (pixel) aspect ratio of the input video.
-
- at end table
-
-For example:
- at example
-buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
- at end example
-
-will instruct the source to accept video frames with size 320x240 and
-with format "yuv410p", assuming 1/24 as the timestamps timebase and
-square pixels (1:1 sample aspect ratio).
-
- at section color
-
-Provide an uniformly colored input.
-
-It accepts the following parameters:
-
- at table @option
-
- at item color
-Specify the color of the source. It can be the name of a color (case
-insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
-alpha specifier. The default value is "black".
-
- at item size
-Specify the size of the sourced video, it may be a string of the form
- at var{width}x at var{height}, or the name of a size abbreviation. The
-default value is "320x240".
-
- at item framerate
-Specify the frame rate of the sourced video, as the number of frames
-generated per second. It has to be a string in the format
- at var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
-number or a valid video frame rate abbreviation. The default value is
-"25".
-
- at end table
-
-For example the following graph description will generate a red source
-with an opacity of 0.2, with size "qcif" and a frame rate of 10
-frames per second, which will be overlayed over the source connected
-to the pad with identifier "in".
-
- at example
-"color=red@@0.2:qcif:10 [color]; [in][color] overlay [out]"
- at end example
-
- at section movie
-
-Read a video stream from a movie container.
-
-Note that this source is a hack that bypasses the standard input path. It can be
-useful in applications that do not support arbitrary filter graphs, but its use
-is discouraged in those that do. Specifically in @command{avconv} this filter
-should never be used, the @option{-filter_complex} option fully replaces it.
-
-This filter accepts the following options:
-
- at table @option
-
- at item filename
-The name of the resource to read (not necessarily a file but also a device or a
-stream accessed through some protocol).
-
- at item format_name, f
-Specifies the format assumed for the movie to read, and can be either
-the name of a container or an input device. If not specified the
-format is guessed from @var{movie_name} or by probing.
-
- at item seek_point, sp
-Specifies the seek point in seconds, the frames will be output
-starting from this seek point, the parameter is evaluated with
- at code{av_strtod} so the numerical value may be suffixed by an IS
-postfix. Default value is "0".
-
- at item stream_index, si
-Specifies the index of the video stream to read. If the value is -1,
-the best suited video stream will be automatically selected. Default
-value is "-1".
-
- at end table
-
-This filter allows to overlay a second video on top of main input of
-a filtergraph as shown in this graph:
- at example
-input -----------> deltapts0 --> overlay --> output
-                                    ^
-                                    |
-movie --> scale--> deltapts1 -------+
- at end example
-
-Some examples follow:
- at example
-# skip 3.2 seconds from the start of the avi file in.avi, and overlay it
-# on top of the input labelled as "in".
-movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
-# read from a video4linux2 device, and overlay it on top of the input
-# labelled as "in"
-movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
-[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
-
- at end example
-
- 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}:@var{timebase}.
-
- at 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 var{timebase} specifies an arithmetic expression representing a
-timebase. The expression can contain the constants "PI", "E", "PHI",
-"AVTB" (the default timebase), and defaults to the value "AVTB".
-
- at section frei0r_src
-
-Provide a frei0r source.
-
-To enable compilation of this filter you need to install the frei0r
-header and configure Libav with --enable-frei0r.
-
-This source accepts the following options:
-
- at table @option
-
- at item size
-The size of the video to generate, may be a string of the form
- at var{width}x at var{height} or a frame size abbreviation.
-
- at item framerate
-Framerate of the generated video, may be a string of the form
- at var{num}/@var{den} or a frame rate abbreviation.
-
- at item filter_name
-The name to the frei0r source to load. For more information regarding frei0r and
-how to set the parameters read the section @ref{frei0r} in the description of
-the video filters.
-
- at item filter_params
-A '|'-separated list of parameters to pass to the frei0r source.
-
- at end table
-
-Some examples follow:
- at example
-# generate a frei0r partik0l source with size 200x200 and framerate 10
-# which is overlayed on the overlay filter main input
-frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
- at end example
-
- at section rgbtestsrc, testsrc
-
-The @code{rgbtestsrc} source generates an RGB test pattern useful for
-detecting RGB vs BGR issues. You should see a red, green and blue
-stripe from top to bottom.
-
-The @code{testsrc} source generates a test video pattern, showing a
-color pattern, a scrolling gradient and a timestamp. This is mainly
-intended for testing purposes.
-
-The sources accept the following options:
-
- at table @option
-
- at item size, s
-Specify the size of the sourced video, it may be a string of the form
- at var{width}x at var{height}, or the name of a size abbreviation. The
-default value is "320x240".
-
- at item rate, r
-Specify the frame rate of the sourced video, as the number of frames
-generated per second. It has to be a string in the format
- at var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
-number or a valid video frame rate abbreviation. The default value is
-"25".
-
- at item sar
-Set the sample aspect ratio of the sourced video.
-
- at item duration
-Set the video duration of the sourced video. The accepted syntax is:
- at example
-[-]HH[:MM[:SS[.m...]]]
-[-]S+[.m...]
- at end example
-See also the function @code{av_parse_time()}.
-
-If not specified, or the expressed duration is negative, the video is
-supposed to be generated forever.
- at end table
-
-For example the following:
- at example
-testsrc=duration=5.3:size=qcif:rate=10
- at end example
-
-will generate a video with a duration of 5.3 seconds, with size
-176x144 and a framerate of 10 frames per second.
-
- at c man end VIDEO SOURCES
-
- at chapter Video Sinks
- at c man begin VIDEO SINKS
-
-Below is a description of the currently available video sinks.
-
- at section buffersink
-
-Buffer video frames, and make them available to the end of the filter
-graph.
-
-This sink is intended for a programmatic use through the interface defined in
- at file{libavfilter/buffersink.h}.
-
- 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 c man end VIDEO SINKS
diff --git a/deps/libav/doc/general.texi b/deps/libav/doc/general.texi
deleted file mode 100644
index c069455..0000000
--- a/deps/libav/doc/general.texi
+++ /dev/null
@@ -1,946 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle General Documentation
- at titlepage
- at center @titlefont{General Documentation}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter External libraries
-
-Libav 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
- at command{./configure}.
-
- at section OpenCORE and VisualOn libraries
-
-Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer
-libraries provide encoders for a number of audio codecs.
-
- at float NOTE
-OpenCORE and VisualOn libraries are under the Apache License 2.0
-(see @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 Libav's license to LGPL version 3 (or if you have enabled
-GPL components, GPL version 3) to use it.
- at end float
-
- at subsection OpenCORE AMR
-
-Libav 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 them.
-
- at subsection VisualOn AAC encoder library
-
-Libav can make use of the VisualOn AACenc library for AAC encoding.
-
-Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
-instructions for installing the library.
-Then pass @code{--enable-libvo-aacenc} to configure to enable it.
-
- at subsection VisualOn AMR-WB encoder library
-
-Libav can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
-
-Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
-instructions for installing the library.
-Then pass @code{--enable-libvo-amrwbenc} to configure to enable it.
-
- at subsection Fraunhofer AAC library
-
-Libav can make use of the Fraunhofer AAC library for AAC encoding.
-
-Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
-instructions for installing the library.
-Then pass @code{--enable-libfdk-aac} to configure to enable it.
-
- at section LAME
-
-Libav can make use of the LAME library for MP3 encoding.
-
-Go to @url{http://lame.sourceforge.net/} and follow the
-instructions for installing the library.
-Then pass @code{--enable-libmp3lame} to configure to enable it.
-
- at section libvpx
-
-Libav can make use of the libvpx library for VP8 encoding.
-
-Go to @url{http://www.webmproject.org/} and follow the instructions for
-installing the library. Then pass @code{--enable-libvpx} to configure to
-enable it.
-
- at section libwavpack
-
-Libav can make use of the libwavpack library for WavPack encoding.
-
-Go to @url{http://www.wavpack.com/} and follow the instructions for
-installing the library. Then pass @code{--enable-libwavpack} to configure to
-enable it.
-
- at section x264
-
-Libav can make use of the x264 library for H.264 encoding.
-
-Go to @url{http://www.videolan.org/developers/x264.html} and follow the
-instructions for installing the library. Then pass @code{--enable-libx264} to
-configure to enable it.
-
- at float NOTE
-x264 is under the GNU Public License Version 2 or later
-(see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for
-details), you must upgrade Libav's license to GPL in order to use it.
- at end float
-
- at section libilbc
-
-iLBC is a narrowband speech codec that has been made freely available
-by Google as part of the WebRTC project. libilbc is a packaging friendly
-copy of the iLBC codec. Libav can make use of the libilbc library for
-iLBC encoding and decoding.
-
-Go to @url{https://github.com/dekkers/libilbc} and follow the instructions for
-installing the library. Then pass @code{--enable-libilbc} to configure to
-enable it.
-
- at section AviSynth
-
-Libav can read AviSynth scripts as input. To enable support you need a
-suitable @file{avisynth_c.h} header to compile against. The header in
-classic AviSynth's CVS repository is not compatible as it has not been
-updated to support AviSynth 2.6. AviSynth 2.5 is not supported by Libav.
-Once you have the appropriate header, pass @code{--enable-avisynth} to
-configure to enable AviSynth support.
-
-For Windows, supported AviSynth variants are
- at url{http://avisynth.nl, AviSynth 2.6} for 32-bit builds and
- at url{http://avs-plus.net, AviSynth+ 0.1} for 32-bit and 64-bit builds.
-The necessary @file{avisynth_c.h} header is the variant in the @file{extras/}
-directory of the @url{https://www.videolan.org/developers/x264.html, x264}
-source tree. For convenience, this header is also available from a
- at url{https://github.com/qyot27/avisynth_headers, temporary repository}
-along with an installation routine.
-
-For Linux and OS X, the supported AviSynth variant is
- at url{https://github.com/avxsynth/avxsynth, AvxSynth}.
- at file{avxsynth_c.h} is installed as part of the normal
-build routine, as illustrated on
- at url{https://github.com/avxsynth/avxsynth/wiki/System-Setup, AvxSynth's wiki}.
-(the instructions for compiling its prerequisites are outdated, as FFMS 2.18
-or higher is now needed; the list of dependencies to be downloaded from the
-repositories is still the same, though).
-
- at float NOTE
-AviSynth and AvxSynth are loaded dynamically.  Distributors can build Libav
-with @code{--enable-avisynth}, and the binaries will work regardless of the
-end user having AviSynth or AvxSynth installed - they'll only need to be
-installed to use AviSynth scripts (obviously).
- at end float
-
- 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
-
-Libav 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 Apple HTTP Live Streaming @tab   @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 Bitmap Brothers JV        @tab   @tab X
-    @tab Used in Z and Z95 games.
- at item Brute Force & Ignorance   @tab   @tab X
-    @tab Used in the game Flash Traffic: City of Angels.
- at item BWF                       @tab X @tab X
- at item CRI ADX                   @tab X @tab X
-    @tab Audio-only format used in console video games.
- at item Discworld II BMV          @tab   @tab X
- 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 Commodore CDXL            @tab   @tab X
-    @tab Amiga CD video format
- 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 DFA                       @tab   @tab X
-    @tab This format is used in Chronomaster game
- 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 (AVserver 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 X @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 HNM @tab   @tab X
-    @tab Only version 4 supported, used in some games from Cryo Interactive
- 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 X
- at item IFF                       @tab   @tab X
-    @tab Interchange File Format
- at item iLBC                      @tab X @tab X
- 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 IVF (On2)                 @tab X @tab X
-    @tab A format used by libvpx
- at item LATM                      @tab X @tab X
- at item LMLM4                     @tab   @tab X
-    @tab Used by Linux Media Labs MPEG-4 PCI boards
- at item LXF                       @tab   @tab X
-    @tab VR native stream format, used by Leitch/Harris' video servers.
- at item Matroska                  @tab X @tab X
- at item Matroska audio            @tab X @tab
- at item FFmpeg metadata           @tab X @tab X
-    @tab Metadata in text format.
- 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 Mobotix .mxg              @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 Mirillis FIC video        @tab   @tab X
-    @tab No cursor rendering.
- 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 Playstation Portable PMP  @tab   @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 X @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 HEVC                  @tab   @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 TAK                   @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 Lego Mindstorms RSO       @tab X @tab X
- at item RTMP                      @tab X @tab X
-    @tab Output is performed by publishing stream to RTMP server
- at item RTP                       @tab X @tab X
- at item RTSP                      @tab X @tab X
- at item SAP                       @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 SMJPEG                    @tab X @tab X
-    @tab Used in certain Loki game ports.
- at item Sony OpenMG (OMA)         @tab X @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 Text files                @tab   @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 Windows Televison (WTV)   @tab   @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 XMV                       @tab   @tab X
-    @tab Microsoft video container used in Xbox games.
- at item xWMA                      @tab   @tab X
-    @tab Microsoft audio container used by XAudio 2.
- at item YUV4MPEG pipe             @tab X @tab X
- at item Psygnosis YOP             @tab   @tab X
- at item ZeroCodec Lossless Video  @tab   @tab X
- at end multitable
-
- at code{X} means that encoding (resp. decoding) is supported.
-
- at section Image Formats
-
-Libav 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 X @tab X
-    @tab Digital Picture Exchange
- at item JPEG         @tab X @tab X
-    @tab Progressive JPEG is not supported.
- at item JPEG 2000    @tab E @tab X
-    @tab encoding 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 PIC          @tab @tab X
-    @tab Pictor/PC Paint
- 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 X @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 item WebP         @tab E @tab X
-    @tab WebP image format, encoding supported through external library libwebp
- at item XBM  @tab X @tab
-    @tab X BitMap image format
- at item XWD  @tab X @tab X
-    @tab X Window Dump 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 A64 multicolor         @tab  X  @tab
-    @tab Creates video suitable to be played on a commodore 64 (multicolor mode).
- 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 ANSI/ASCII art         @tab     @tab  X
- at item Apple Intermediate Codec @tab     @tab  X
- at item Apple MJPEG-B          @tab     @tab  X
- at item Apple ProRes           @tab  X  @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
- at item Bitmap Brothers JV video  @tab   @tab X
- 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 CDXL                   @tab     @tab  X
-    @tab Amiga CD video codec
- at item Chinese AVS video      @tab  E  @tab  X
-    @tab AVS1-P2, JiZhun profile, encoding through external library libxavs
- at item Delphine Software International CIN video  @tab     @tab  X
-    @tab Codec used in Delphine Software International games.
- at item Discworld II BMV Video @tab     @tab  X
- at item Canopus Lossless Codec @tab     @tab  X
- at item Cinepak                @tab     @tab  X
- at item Cirrus Logic AccuPak   @tab  X  @tab  X
-    @tab fourcc: CLJR
- at item Creative YUV (CYUV)    @tab     @tab  X
- at item DFA                    @tab     @tab  X
-    @tab Codec used in Chronomaster game.
- at item Dirac                  @tab  E  @tab  E
-    @tab supported through external library libschroedinger
- 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 Dxtory capture format  @tab     @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 Escape 130             @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 Screen Video v2  @tab     @tab  X
- at item Flash Video (FLV)      @tab  X  @tab  X
-    @tab Sorenson H.263 used in Flash
- at item Forward Uncompressed   @tab     @tab  X
- at item Fraps                  @tab     @tab  X
- at item Go2Webinar             @tab     @tab  X
-    @tab fourcc: G2M4
- 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 HEVC                   @tab     @tab  X
- at item HNM version 4          @tab     @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 interleaved 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 4          @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 Lagarith               @tab     @tab  X
- 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 ATC Screen   @tab     @tab  X
-    @tab Also known as Microsoft Screen 3.
- at item Microsoft Expression Encoder Screen  @tab     @tab  X
-    @tab Also known as Microsoft Titanium Screen 2.
- at item Microsoft RLE          @tab     @tab  X
- at item Microsoft Screen 1     @tab     @tab  X
-    @tab Also known as Windows Media Video V7 Screen.
- at item Microsoft Screen 2     @tab     @tab  X
-    @tab Also known as Windows Media Video V9 Screen.
- 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 Mobotix MxPEG video    @tab     @tab  X
- at item Motion Pixels video    @tab     @tab  X
- at item MPEG-1 video           @tab  X  @tab  X
- at item MPEG-2 video           @tab  X  @tab  X
- at item MPEG-4 part 2          @tab  X  @tab  X
-    @tab libxvidcore can be used alternatively for encoding.
- at item MPEG-4 part 2 Microsoft variant version 1  @tab     @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  E  @tab  X
-    @tab fourcc: VP80, encoding supported through external library libvpx
- at item VP9                    @tab  E  @tab  X
-    @tab 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 R10K AJA Kona 10-bit RGB Codec     @tab     @tab  X
- 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 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 TechSmith Screen Capture Codec 2  @tab     @tab  X
-    @tab fourcc: TSC2
- 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 Ut Video               @tab  X  @tab  X
- at item v210 QuickTime uncompressed 4:2:2 10-bit     @tab  X  @tab  X
- at item v410 QuickTime uncompressed 4:4:4 10-bit     @tab  X  @tab  X
- at item VBLE Lossless Codec    @tab     @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 Image    @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 Wing Commander IV / Xan  @tab     @tab  X
-    @tab Used in Wing Commander IV.
- 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 and libvo-aacenc
- 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.722            @tab  X  @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  E  @tab  X
-    @tab encoding supported through external library libvo-amrwbenc
- at item Apple lossless audio   @tab  X  @tab  X
-    @tab QuickTime fourcc 'alac'
- at item ATRAC1                 @tab     @tab  X
- at item ATRAC3                 @tab     @tab  X
- at item ATRAC3+                @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 Discworld II BMV Audio @tab     @tab  X
- 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  X  @tab  X
- at item FLAC (Free Lossless Audio Codec)  @tab  X  @tab  IX
- at item G.723.1                @tab     @tab  X
- at item GSM                    @tab  E  @tab  X
-    @tab encoding supported through external library libgsm
- at item GSM Microsoft variant  @tab  E  @tab  X
-    @tab encoding supported through external library libgsm
- at item IAC (Indeo Audio Coder)  @tab     @tab  X
- at item iLBC (Internet Low Bitrate Codec) @tab  E  @tab  E
-    @tab encoding and decoding supported through external library libilbc
- 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 Opus                   @tab  E  @tab  E
-    @tab supported through external library libopus
- at item PCM A-law              @tab  X  @tab  X
- at item PCM mu-law             @tab  X  @tab  X
- at item PCM signed 16-bit little-endian planar  @tab     @tab  X
- at item PCM signed 24-bit little-endian planar  @tab     @tab  X
- at item PCM signed 32-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     @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  X  @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 Lossless     @tab     @tab  X
- 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 SMPTE 302M AES3 audio  @tab     @tab  X
- at item Speex                  @tab  E  @tab  E
-    @tab supported through external library libspeex
- at item TAK (Tom's lossless Audio Kompressor)  @tab     @tab  X
- 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 Voxware MetaSound      @tab     @tab  X
- at item WavPack                @tab  E  @tab  X
-    @tab supported through external library libwavpack
- 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 Lossless @tab  @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 @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 SubRip (SRT) @tab X @tab X @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 HLS          @tab X
- at item HTTP         @tab X
- at item HTTPS        @tab X
- at item MMSH         @tab X
- at item MMST         @tab X
- at item pipe         @tab X
- at item RTMP         @tab X
- at item RTMPE        @tab X
- at item RTMPS        @tab X
- at item RTMPT        @tab X
- at item RTMPTE       @tab X
- at item RTMPTS       @tab X
- at item RTP          @tab X
- at item SCTP         @tab X
- at item TCP          @tab X
- at item TLS          @tab X
- at item UDP          @tab X
- at end multitable
-
- at code{X} means that the protocol is supported.
-
- at code{E} means that support is provided through an external library.
-
-
- 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 BKTR              @tab X      @tab
- at item DV1394            @tab X      @tab
- at item Linux framebuffer @tab X      @tab
- at item JACK              @tab X      @tab
- at item LIBCDIO           @tab X
- at item LIBDC1394         @tab X      @tab
- at item OSS               @tab X      @tab X
- at item Pulseaudio        @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 bye
diff --git a/deps/libav/doc/git-howto.texi b/deps/libav/doc/git-howto.texi
deleted file mode 100644
index 5a8e2a3..0000000
--- a/deps/libav/doc/git-howto.texi
+++ /dev/null
@@ -1,440 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle Using git to develop Libav
-
- at titlepage
- at center @titlefont{Using git to develop Libav}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter Introduction
-
-This document aims in giving some quick references on a set of useful git
-commands. You should always use the extensive and detailed documentation
-provided directly by git:
-
- at example
-git --help
-man git
- at end example
-
-shows you the available subcommands,
-
- at example
-git <command> --help
-man git-<command>
- at end example
-
-shows information about the subcommand <command>.
-
-Additional information could be found on the
- at url{http://gitref.org, Git Reference} website
-
-For more information about the Git project, visit the
-
- at url{http://git-scm.com/, Git website}
-
-Consult these resources whenever you have problems, they are quite exhaustive.
-
-What follows now is a basic introduction to Git and some Libav-specific
-guidelines to ease the contribution to the project
-
- at chapter Basics Usage
-
- at section Get GIT
-
-You can get git from @url{http://git-scm.com/}
-Most distribution and operating system provide a package for it.
-
-
- at section Cloning the source tree
-
- at example
-git clone git://git.libav.org/libav.git <target>
- at end example
-
-This will put the Libav sources into the directory @var{<target>}.
-
- at example
-git clone git@@git.libav.org:libav.git <target>
- at end example
-
-This will put the Libav sources into the directory @var{<target>} and let
-you push back your changes to the remote repository.
-
-Make sure that you do not have Windows line endings in your checkouts,
-otherwise you may experience spurious compilation failures. One way to
-achieve this is to run
-
- at example
-git config --global core.autocrlf false
- at end example
-
-
- at section Updating the source tree to the latest revision
-
- at example
-git pull (--rebase)
- at end example
-
-pulls in the latest changes from the tracked branch. The tracked branch
-can be remote. By default the master branch tracks the branch master in
-the remote origin.
-
- at float IMPORTANT
-Since merge commits are forbidden @command{--rebase} (see below) is recommended.
- at end float
-
- at section Rebasing your local branches
-
- at example
-git pull --rebase
- at end example
-
-fetches the changes from the main repository and replays your local commits
-over it. This is required to keep all your local changes at the top of
-Libav's master tree. The master tree will reject pushes with merge commits.
-
-
- at section Adding/removing files/directories
-
- at example
-git add [-A] <filename/dirname>
-git rm [-r] <filename/dirname>
- at end example
-
-GIT needs to get notified of all changes you make to your working
-directory that makes files appear or disappear.
-Line moves across files are automatically tracked.
-
-
- at section Showing modifications
-
- at example
-git diff <filename(s)>
- at end example
-
-will show all local modifications in your working directory as unified diff.
-
-
- at section Inspecting the changelog
-
- at example
-git log <filename(s)>
- at end example
-
-You may also use the graphical tools like gitview or gitk or the web
-interface available at http://git.libav.org/
-
- at section Checking source tree status
-
- at example
-git status
- at end example
-
-detects all the changes you made and lists what actions will be taken in case
-of a commit (additions, modifications, deletions, etc.).
-
-
- at section Committing
-
- at example
-git diff --check
- at end example
-
-to double check your changes before committing them to avoid trouble later
-on. All experienced developers do this on each and every commit, no matter
-how small.
-Every one of them has been saved from looking like a fool by this many times.
-It's very easy for stray debug output or cosmetic modifications to slip in,
-please avoid problems through this extra level of scrutiny.
-
-For cosmetics-only commits you should get (almost) empty output from
-
- at example
-git diff -w -b <filename(s)>
- at end example
-
-Also check the output of
-
- at example
-git status
- at end example
-
-to make sure you don't have untracked files or deletions.
-
- at example
-git add [-i|-p|-A] <filenames/dirnames>
- at end example
-
-Make sure you have told git your name and email address
-
- at example
-git config --global user.name "My Name"
-git config --global user.email my@@email.invalid
- at end example
-
-Use @var{--global} to set the global configuration for all your git checkouts.
-
-Git will select the changes to the files for commit. Optionally you can use
-the interactive or the patch mode to select hunk by hunk what should be
-added to the commit.
-
-
- at example
-git commit
- at end example
-
-Git will commit the selected changes to your current local branch.
-
-You will be prompted for a log message in an editor, which is either
-set in your personal configuration file through
-
- at example
-git config --global core.editor
- at end example
-
-or set by one of the following environment variables:
- at var{GIT_EDITOR}, @var{VISUAL} or @var{EDITOR}.
-
-Log messages should be concise but descriptive. Explain why you made a change,
-what you did will be obvious from the changes themselves most of the time.
-Saying just "bug fix" or "10l" is bad. Remember that people of varying skill
-levels look at and educate themselves while reading through your code. Don't
-include filenames in log messages, Git provides that information.
-
-Possibly make the commit message have a terse, descriptive first line, an
-empty line and then a full description. The first line will be used to name
-the patch by git format-patch.
-
- at section Preparing a patchset
-
- at example
-git format-patch <commit> [-o directory]
- at end example
-
-will generate a set of patches for each commit between @var{<commit>} and
-current @var{HEAD}. E.g.
-
- at example
-git format-patch origin/master
- at end example
-
-will generate patches for all commits on current branch which are not
-present in upstream.
-A useful shortcut is also
-
- at example
-git format-patch -n
- at end example
-
-which will generate patches from last @var{n} commits.
-By default the patches are created in the current directory.
-
- at section Sending patches for review
-
- at example
-git send-email <commit list|directory>
- at end example
-
-will send the patches created by @command{git format-patch} or directly
-generates them. All the email fields can be configured in the global/local
-configuration or overridden by command line.
-Note that this tool must often be installed separately (e.g. @var{git-email}
-package on Debian-based distros).
-
-
- at section Renaming/moving/copying files or contents of files
-
-Git automatically tracks such changes, making those normal commits.
-
- at example
-mv/cp path/file otherpath/otherfile
-git add [-A] .
-git commit
- at end example
-
-
- at chapter Git configuration
-
-In order to simplify a few workflows, it is advisable to configure both
-your personal Git installation and your local Libav repository.
-
- at section Personal Git installation
-
-Add the following to your @file{~/.gitconfig} to help @command{git send-email}
-and @command{git format-patch} detect renames:
-
- at example
-[diff]
-        renames = copy
- at end example
-
- at section Repository configuration
-
-In order to have @command{git send-email} automatically send patches
-to the libav-devel mailing list, add the following stanza
-to @file{/path/to/libav/repository/.git/config}:
-
- at example
-[sendemail]
-        to = libav-devel@@libav.org
- at end example
-
- at chapter Libav specific
-
- at section Reverting broken commits
-
- at example
-git reset <commit>
- at end example
-
- at command{git reset} will uncommit the changes till @var{<commit>} rewriting
-the current branch history.
-
- at example
-git commit --amend
- at end example
-
-allows to amend the last commit details quickly.
-
- at example
-git rebase -i origin/master
- at end example
-
-will replay local commits over the main repository allowing to edit, merge
-or remove some of them in the process.
-
- at float NOTE
- at command{git reset}, @command{git commit --amend} and @command{git rebase}
-rewrite history, so you should use them ONLY on your local or topic branches.
-The main repository will reject those changes.
- at end float
-
- at example
-git revert <commit>
- at end example
-
- at command{git revert} will generate a revert commit. This will not make the
-faulty commit disappear from the history.
-
- at section Pushing changes to remote trees
-
- at example
-git push
- at end example
-
-Will push the changes to the default remote (@var{origin}).
-Git will prevent you from pushing changes if the local and remote trees are
-out of sync. Refer to and to sync the local tree.
-
- at example
-git remote add <name> <url>
- at end example
-
-Will add additional remote with a name reference, it is useful if you want
-to push your local branch for review on a remote host.
-
- at example
-git push <remote> <refspec>
- at end example
-
-Will push the changes to the @var{<remote>} repository.
-Omitting @var{<refspec>} makes @command{git push} update all the remote
-branches matching the local ones.
-
- at section Finding a specific svn revision
-
-Since version 1.7.1 git supports @var{:/foo} syntax for specifying commits
-based on a regular expression. see man gitrevisions
-
- at example
-git show :/'as revision 23456'
- at end example
-
-will show the svn changeset @var{r23456}. With older git versions searching in
-the @command{git log} output is the easiest option (especially if a pager with
-search capabilities is used).
-This commit can be checked out with
-
- at example
-git checkout -b svn_23456 :/'as revision 23456'
- at end example
-
-or for git < 1.7.1 with
-
- at example
-git checkout -b svn_23456 $SHA1
- at end example
-
-where @var{$SHA1} is the commit hash from the @command{git log} output.
-
-
- at chapter pre-push checklist
-
-Once you have a set of commits that you feel are ready for pushing,
-work through the following checklist to doublecheck everything is in
-proper order. This list tries to be exhaustive. In case you are just
-pushing a typo in a comment, some of the steps may be unnecessary.
-Apply your common sense, but if in doubt, err on the side of caution.
-
-First make sure your Git repository is on a branch that is a direct
-descendant of the Libav master branch, which is the only one from which
-pushing to Libav is possible. Then run the following command:
-
- at itemize
- at item @command{git log --patch --stat origin/master..}
-
-to make sure that only the commits you want to push are pending, that
-the log messages of the commits are correct and descriptive and contain
-no cruft from @command{git am} and to doublecheck that the commits you
-want to push really only contain the changes they are supposed to contain.
-
- at item @command{git status}
-
-to ensure no local changes still need to be committed and that no local
-changes may have thrown off the results of your testing.
- at end itemize
-
-Next let the code pass through a full run of our testsuite. Before you do,
-the command @command{make fate-rsync} will update the test samples. Changes
-to the samples set are not very common and commits depending on samples
-changes are delayed for at least 24 hours to allow the new samples to
-propagate, so updating it once per day is sufficient.  Now execute
-
- at itemize
- at item @command{make distclean}
- at item @command{/path/to/libav/configure}
- at item @command{make check}
- at end itemize
-
-While the test suite covers a wide range of possible problems, it is not
-a panacea. Do not hesitate to perform any other tests necessary to convince
-yourself that the changes you are about to push actually work as expected.
-
-Also note that every single commit should pass the test suite, not just
-the result of a series of patches. So if you have a series of commits
-to push, run the test suite on every single commit.
-
-Give other developers a reasonable amount of time to look at and review
-patches before you push them. Not everybody is online 24/7, but may wish
-to look at and comment on a patch nonetheless. The time you leave depends
-on the urgency and complexity of the patch. Use your common sense to pick
-a timeframe that allows everybody that you think may wish to comment
-and/or should comment on the change an opportunity to see it.
-
-Finally, after pushing, mark all patches as committed on
- at url{http://patches.libav.org/,patchwork}.
-Sometimes this is not automatically done when a patch has been
-slightly modified from the version on the mailing list.
-Also update previous incarnations of the patches you push so that
-patchwork is not cluttered with cruft.
-
-
- at chapter Server Issues
-
-Contact the project admins @email{git@@libav.org} if you have technical
-problems with the GIT server.
diff --git a/deps/libav/doc/git-howto.txt b/deps/libav/doc/git-howto.txt
deleted file mode 100644
index 036b567..0000000
--- a/deps/libav/doc/git-howto.txt
+++ /dev/null
@@ -1,272 +0,0 @@
-
-About Git write access:
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Before everything else, you should know how to use GIT properly.
-Luckily Git comes with excellent documentation.
-
-  git --help
-  man git
-
-shows you the available subcommands,
-
-  git <command> --help
-  man git-<command>
-
-shows information about the subcommand <command>.
-
-The most comprehensive manual is the website Git Reference
-
-http://gitref.org/
-
-For more information about the Git project, visit
-
-http://git-scm.com/
-
-Consult these resources whenever you have problems, they are quite exhaustive.
-
-You do not need a special username or password.
-All you need is to provide a ssh public key to the Git server admin.
-
-What follows now is a basic introduction to Git and some Libav-specific
-guidelines. Read it at least once, if you are granted commit privileges to the
-Libav project you are expected to be familiar with these rules.
-
-
-
-I. BASICS:
-==========
-
-0. Get GIT:
-
-  You can get git from http://git-scm.com/
-
-
-1. Cloning the source tree:
-
-    git clone git://git.libav.org/libav.git <target>
-
-  This will put the Libav sources into the directory <target>.
-
-    git clone git at git.libav.org:libav.git <target>
-
-  This will put the Libav sources into the directory <target> and let
-  you push back your changes to the remote repository.
-
-
-2. Updating the source tree to the latest revision:
-
-    git pull (--ff-only)
-
-  pulls in the latest changes from the tracked branch. The tracked branch
-  can be remote. By default the master branch tracks the branch master in
-  the remote origin.
-  Caveat: Since merge commits are forbidden at least for the initial
-          months of git --ff-only or --rebase (see below) are recommended.
-          --ff-only will fail and not create merge commits if your branch
-          has diverged (has a different history) from the tracked branch.
-
-2.a Rebasing your local branches:
-
-    git pull --rebase
-
-  fetches the changes from the main repository and replays your local commits
-  over it. This is required to keep all your local changes at the top of
-  Libav's master tree. The master tree will reject pushes with merge commits.
-
-
-3. Adding/removing files/directories:
-
-    git add [-A] <filename/dirname>
-    git rm [-r] <filename/dirname>
-
-  GIT needs to get notified of all changes you make to your working
-  directory that makes files appear or disappear.
-  Line moves across files are automatically tracked.
-
-
-4. Showing modifications:
-
-    git diff <filename(s)>
-
-  will show all local modifications in your working directory as unified diff.
-
-
-5. Inspecting the changelog:
-
-    git log <filename(s)>
-
-  You may also use the graphical tools like gitview or gitk or the web
-  interface available at http://git.libav.org/
-
-6. Checking source tree status:
-
-    git status
-
-  detects all the changes you made and lists what actions will be taken in case
-  of a commit (additions, modifications, deletions, etc.).
-
-
-7. Committing:
-
-    git diff --check
-
-  to double check your changes before committing them to avoid trouble later
-  on. All experienced developers do this on each and every commit, no matter
-  how small.
-  Every one of them has been saved from looking like a fool by this many times.
-  It's very easy for stray debug output or cosmetic modifications to slip in,
-  please avoid problems through this extra level of scrutiny.
-
-  For cosmetics-only commits you should get (almost) empty output from
-
-    git diff -w -b <filename(s)>
-
-  Also check the output of
-
-    git status
-
-  to make sure you don't have untracked files or deletions.
-
-    git add [-i|-p|-A] <filenames/dirnames>
-
-  Make sure you have told git your name and email address, e.g. by running
-    git config --global user.name "My Name"
-    git config --global user.email my at email.invalid
-  (--global to set the global configuration for all your git checkouts).
-
-  Git will select the changes to the files for commit. Optionally you can use
-  the interactive or the patch mode to select hunk by hunk what should be
-  added to the commit.
-
-    git commit
-
-  Git will commit the selected changes to your current local branch.
-
-  You will be prompted for a log message in an editor, which is either
-  set in your personal configuration file through
-
-    git config core.editor
-
-  or set by one of the following environment variables:
-  GIT_EDITOR, VISUAL or EDITOR.
-
-  Log messages should be concise but descriptive. Explain why you made a change,
-  what you did will be obvious from the changes themselves most of the time.
-  Saying just "bug fix" or "10l" is bad. Remember that people of varying skill
-  levels look at and educate themselves while reading through your code. Don't
-  include filenames in log messages, Git provides that information.
-
-  Possibly make the commit message have a terse, descriptive first line, an
-  empty line and then a full description. The first line will be used to name
-  the patch by git format-patch.
-
-
-8. Renaming/moving/copying files or contents of files:
-
-  Git automatically tracks such changes, making those normal commits.
-
-    mv/cp path/file otherpath/otherfile
-
-    git add [-A] .
-
-    git commit
-
-  Do not move, rename or copy files of which you are not the maintainer without
-  discussing it on the mailing list first!
-
-9. Reverting broken commits
-
-    git revert <commit>
-
-  git revert will generate a revert commit. This will not make the faulty
-  commit disappear from the history.
-
-    git reset <commit>
-
-  git reset will uncommit the changes till <commit> rewriting the current
-  branch history.
-
-    git commit --amend
-
-  allows to amend the last commit details quickly.
-
-    git rebase -i origin/master
-
-  will replay local commits over the main repository allowing to edit,
-  merge or remove some of them in the process.
-
-  Note that the reset, commit --amend and rebase rewrite history, so you
-  should use them ONLY on your local or topic branches.
-
-  The main repository will reject those changes.
-
-10. Preparing a patchset.
-
-    git format-patch <commit> [-o directory]
-
-  will generate a set of patches for each commit between <commit> and
-  current HEAD. E.g.
-
-    git format-patch origin/master
-
-  will generate patches for all commits on current branch which are not
-  present in upstream.
-  A useful shortcut is also
-
-    git format-patch -n
-
-  which will generate patches from last n commits.
-  By default the patches are created in the current directory.
-
-11. Sending patches for review
-
-    git send-email <commit list|directory>
-
-  will send the patches created by git format-patch or directly generates
-  them. All the email fields can be configured in the global/local
-  configuration or overridden by command line.
-  Note that this tool must often be installed separately (e.g. git-email
-  package on Debian-based distros).
-
-12. Pushing changes to remote trees
-
-    git push
-
-  Will push the changes to the default remote (origin).
-  Git will prevent you from pushing changes if the local and remote trees are
-  out of sync. Refer to 2 and 2.a to sync the local tree.
-
-    git remote add <name> <url>
-
-  Will add additional remote with a name reference, it is useful if you want
-  to push your local branch for review on a remote host.
-
-    git push <remote> <refspec>
-
-  Will push the changes to the remote repository. Omitting refspec makes git
-  push update all the remote branches matching the local ones.
-
-13. Finding a specific svn revision
-
-  Since version 1.7.1 git supports ':/foo' syntax for specifying commits
-  based on a regular expression. see man gitrevisions
-
-    git show :/'as revision 23456'
-
-  will show the svn changeset r23456. With older git versions searching in
-  the git log output is the easiest option (especially if a pager with
-  search capabilities is used).
-  This commit can be checked out with
-
-    git checkout -b svn_23456 :/'as revision 23456'
-
-  or for git < 1.7.1 with
-
-    git checkout -b svn_23456 $SHA1
-
-  where $SHA1 is the commit SHA1 from the 'git log' output.
-
-
-Contact the project admins <git at libav dot org> if you have technical
-problems with the GIT server.
diff --git a/deps/libav/doc/indevs.texi b/deps/libav/doc/indevs.texi
deleted file mode 100644
index 8ff64a7..0000000
--- a/deps/libav/doc/indevs.texi
+++ /dev/null
@@ -1,362 +0,0 @@
- at chapter Input Devices
- at c man begin INPUT DEVICES
-
-Input devices are configured elements in Libav which allow to access
-the data coming from a multimedia device attached to your system.
-
-When you configure your Libav build, all the supported input devices
-are enabled by default. You can list all available ones using the
-configure option "--list-indevs".
-
-You can disable all the input devices using the configure option
-"--disable-indevs", and selectively enable an input device using the
-option "--enable-indev=@var{INDEV}", or you can disable a particular
-input device using the option "--disable-indev=@var{INDEV}".
-
-The option "-formats" of the av* tools will display the list of
-supported input devices (amongst the demuxers).
-
-A description of the currently available input devices follows.
-
- at section alsa
-
-ALSA (Advanced Linux Sound Architecture) input device.
-
-To enable this input device during configuration you need libasound
-installed on your system.
-
-This device allows capturing from an ALSA device. The name of the
-device to capture has to be an ALSA card identifier.
-
-An ALSA identifier has the syntax:
- at example
-hw:@var{CARD}[, at var{DEV}[, at var{SUBDEV}]]
- at end example
-
-where the @var{DEV} and @var{SUBDEV} components are optional.
-
-The three arguments (in order: @var{CARD}, at var{DEV}, at var{SUBDEV})
-specify card number or identifier, device number and subdevice number
-(-1 means any).
-
-To see the list of cards currently recognized by your system check the
-files @file{/proc/asound/cards} and @file{/proc/asound/devices}.
-
-For example to capture with @command{avconv} from an ALSA device with
-card id 0, you may run the command:
- at example
-avconv -f alsa -i hw:0 alsaout.wav
- at end example
-
-For more information see:
- at url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html}
-
- at section bktr
-
-BSD video input device.
-
- at section dv1394
-
-Linux DV 1394 input device.
-
- at section fbdev
-
-Linux framebuffer input device.
-
-The Linux framebuffer is a graphic hardware-independent abstraction
-layer to show graphics on a computer monitor, typically on the
-console. It is accessed through a file device node, usually
- at file{/dev/fb0}.
-
-For more detailed information read the file
-Documentation/fb/framebuffer.txt included in the Linux source tree.
-
-To record from the framebuffer device @file{/dev/fb0} with
- at command{avconv}:
- at example
-avconv -f fbdev -r 10 -i /dev/fb0 out.avi
- at end example
-
-You can take a single screenshot image with the command:
- at example
-avconv -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
- at end example
-
-See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
-
- at section jack
-
-JACK input device.
-
-To enable this input device during configuration you need libjack
-installed on your system.
-
-A JACK input device creates one or more JACK writable clients, one for
-each audio channel, with name @var{client_name}:input_ at var{N}, where
- at var{client_name} is the name provided by the application, and @var{N}
-is a number which identifies the channel.
-Each writable client will send the acquired data to the Libav input
-device.
-
-Once you have created one or more JACK readable clients, you need to
-connect them to one or more JACK writable clients.
-
-To connect or disconnect JACK clients you can use the
- at file{jack_connect} and @file{jack_disconnect} programs, or do it
-through a graphical interface, for example with @file{qjackctl}.
-
-To list the JACK clients and their properties you can invoke the command
- at file{jack_lsp}.
-
-Follows an example which shows how to capture a JACK readable client
-with @command{avconv}.
- at example
-# Create a JACK writable client with name "libav".
-$ avconv -f jack -i libav -y out.wav
-
-# Start the sample jack_metro readable client.
-$ jack_metro -b 120 -d 0.2 -f 4000
-
-# List the current JACK clients.
-$ jack_lsp -c
-system:capture_1
-system:capture_2
-system:playback_1
-system:playback_2
-libav:input_1
-metro:120_bpm
-
-# Connect metro to the avconv writable client.
-$ jack_connect metro:120_bpm libav:input_1
- at end example
-
-For more information read:
- at url{http://jackaudio.org/}
-
- at section libdc1394
-
-IIDC1394 input device, based on libdc1394 and libraw1394.
-
- at section oss
-
-Open Sound System input device.
-
-The filename to provide to the input device is the device node
-representing the OSS input device, and is usually set to
- at file{/dev/dsp}.
-
-For example to grab from @file{/dev/dsp} using @command{avconv} use the
-command:
- at example
-avconv -f oss -i /dev/dsp /tmp/oss.wav
- at end example
-
-For more information about OSS see:
- at url{http://manuals.opensound.com/usersguide/dsp.html}
-
- at section pulse
-
-pulseaudio input device.
-
-To enable this input device during configuration you need libpulse-simple
-installed in your system.
-
-The filename to provide to the input device is a source device or the
-string "default"
-
-To list the pulse source devices and their properties you can invoke
-the command @file{pactl list sources}.
-
- at example
-avconv -f pulse -i default /tmp/pulse.wav
- at end example
-
- at subsection @var{server} AVOption
-
-The syntax is:
- at example
--server @var{server name}
- at end example
-
-Connects to a specific server.
-
- at subsection @var{name} AVOption
-
-The syntax is:
- at example
--name @var{application name}
- at end example
-
-Specify the application name pulse will use when showing active clients,
-by default it is "libav"
-
- at subsection @var{stream_name} AVOption
-
-The syntax is:
- at example
--stream_name @var{stream name}
- at end example
-
-Specify the stream name pulse will use when showing active streams,
-by default it is "record"
-
- at subsection @var{sample_rate} AVOption
-
-The syntax is:
- at example
--sample_rate @var{samplerate}
- at end example
-
-Specify the samplerate in Hz, by default 48kHz is used.
-
- at subsection @var{channels} AVOption
-
-The syntax is:
- at example
--channels @var{N}
- at end example
-
-Specify the channels in use, by default 2 (stereo) is set.
-
- at subsection @var{frame_size} AVOption
-
-The syntax is:
- at example
--frame_size @var{bytes}
- at end example
-
-Specify the number of byte per frame, by default it is set to 1024.
-
- at subsection @var{fragment_size} AVOption
-
-The syntax is:
- at example
--fragment_size @var{bytes}
- at end example
-
-Specify the minimal buffering fragment in pulseaudio, it will affect the
-audio latency. By default it is unset.
-
- at section sndio
-
-sndio input device.
-
-To enable this input device during configuration you need libsndio
-installed on your system.
-
-The filename to provide to the input device is the device node
-representing the sndio input device, and is usually set to
- at file{/dev/audio0}.
-
-For example to grab from @file{/dev/audio0} using @command{avconv} use the
-command:
- at example
-avconv -f sndio -i /dev/audio0 /tmp/oss.wav
- at end example
-
- at section video4linux2
-
-Video4Linux2 input video device.
-
-The name of the device to grab is a file device node, usually Linux
-systems tend to automatically create such nodes when the device
-(e.g. an USB webcam) is plugged into the system, and has a name of the
-kind @file{/dev/video at var{N}}, where @var{N} is a number associated to
-the device.
-
-Video4Linux2 devices usually support a limited set of
- at var{width}x at var{height} sizes and framerates. You can check which are
-supported using @command{-list_formats all} for Video4Linux2 devices.
-
-Some usage examples of the video4linux2 devices with avconv and avplay:
-
- at example
-# Grab and show the input of a video4linux2 device.
-avplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
-
-# Grab and record the input of a video4linux2 device, leave the
-framerate and size as previously set.
-avconv -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
- at end example
-
- at section vfwcap
-
-VfW (Video for Windows) capture input device.
-
-The filename passed as input is the capture driver number, ranging from
-0 to 9. You may use "list" as filename to print a list of drivers. Any
-other filename will be interpreted as device number 0.
-
- at section x11grab
-
-X11 video input device.
-
-This device allows to capture a region of an X11 display.
-
-The filename passed as input has the syntax:
- at example
-[@var{hostname}]:@var{display_number}. at var{screen_number}[+ at var{x_offset}, at var{y_offset}]
- at end example
-
- at var{hostname}:@var{display_number}. at var{screen_number} specifies the
-X11 display name of the screen to grab from. @var{hostname} can be
-omitted, and defaults to "localhost". The environment variable
- at env{DISPLAY} contains the default display name.
-
- at var{x_offset} and @var{y_offset} specify the offsets of the grabbed
-area with respect to the top-left border of the X11 screen. They
-default to 0.
-
-Check the X11 documentation (e.g. man X) for more detailed information.
-
-Use the @file{dpyinfo} program for getting basic information about the
-properties of your X11 display (e.g. grep for "name" or "dimensions").
-
-For example to grab from @file{:0.0} using @command{avconv}:
- at example
-avconv -f x11grab -r 25 -s cif -i :0.0 out.mpg
-
-# Grab at position 10,20.
-avconv -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
- at end example
-
- at subsection @var{follow_mouse} AVOption
-
-The syntax is:
- at example
--follow_mouse centered|@var{PIXELS}
- at end example
-
-When it is specified with "centered", the grabbing region follows the mouse
-pointer and keeps the pointer at the center of region; otherwise, the region
-follows only when the mouse pointer reaches within @var{PIXELS} (greater than
-zero) to the edge of region.
-
-For example:
- at example
-avconv -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
-
-# Follows only when the mouse pointer reaches within 100 pixels to edge
-avconv -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
- at end example
-
- at subsection @var{show_region} AVOption
-
-The syntax is:
- at example
--show_region 1
- at end example
-
-If @var{show_region} AVOption is specified with @var{1}, then the grabbing
-region will be indicated on screen. With this option, it's easy to know what is
-being grabbed if only a portion of the screen is grabbed.
-
-For example:
- at example
-avconv -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
-
-# With follow_mouse
-avconv -f x11grab -follow_mouse centered -show_region 1  -r 25 -s cif -i :0.0 out.mpg
- at end example
-
- at c man end INPUT DEVICES
diff --git a/deps/libav/doc/libavfilter.texi b/deps/libav/doc/libavfilter.texi
deleted file mode 100644
index b452294..0000000
--- a/deps/libav/doc/libavfilter.texi
+++ /dev/null
@@ -1,92 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle Libavfilter Documentation
- at titlepage
- at center @titlefont{Libavfilter Documentation}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter Introduction
-
-Libavfilter is the filtering API of Libav. It is the substitute of the
-now deprecated 'vhooks' and started as a Google Summer of Code project.
-
-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
-./avconv -i input -vf "[in] split [T1], fifo, [T2] overlay=0:H/2 [out]; [T1] fifo, crop=iw:ih/2:0:ih/2, vflip [T2]" output
- at end example
-
-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{-vf} option passed to
-avconv or to avplay. 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 Libav @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 include filters.texi
-
- at bye
diff --git a/deps/libav/doc/metadata.texi b/deps/libav/doc/metadata.texi
deleted file mode 100644
index cfaf491..0000000
--- a/deps/libav/doc/metadata.texi
+++ /dev/null
@@ -1,68 +0,0 @@
- at chapter Metadata
- at c man begin METADATA
-
-Libav is able to dump metadata from media files into a simple UTF-8-encoded
-INI-like text file and then load it back using the metadata muxer/demuxer.
-
-The file format is as follows:
- at enumerate
-
- at item
-A file consists of a header and a number of metadata tags divided into sections,
-each on its own line.
-
- at item
-The header is a ';FFMETADATA' string, followed by a version number (now 1).
-
- at item
-Metadata tags are of the form 'key=value'
-
- at item
-Immediately after header follows global metadata
-
- at item
-After global metadata there may be sections with per-stream/per-chapter
-metadata.
-
- at item
-A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
-brackets ('[', ']') and ends with next section or end of file.
-
- at item
-At the beginning of a chapter section there may be an optional timebase to be
-used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
-den are integers. If the timebase is missing then start/end times are assumed to
-be in milliseconds.
-Next a chapter section must contain chapter start and end times in form
-'START=num', 'END=num', where num is a positive integer.
-
- at item
-Empty lines and lines starting with ';' or '#' are ignored.
-
- at item
-Metadata keys or values containing special characters ('=', ';', '#', '\' and a
-newline) must be escaped with a backslash '\'.
-
- at item
-Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
-the tag (in the example above key is 'foo ', value is ' bar').
- at end enumerate
-
-A ffmetadata file might look like this:
- at example
-;FFMETADATA1
-title=bike\\shed
-;this is a comment
-artist=Libav troll team
-
-[CHAPTER]
-TIMEBASE=1/1000
-START=0
-#chapter ends at 0:01:00
-END=60000
-title=chapter \#1
-[STREAM]
-title=multi\
-line
- at end example
- at c man end METADATA
diff --git a/deps/libav/doc/multithreading.txt b/deps/libav/doc/multithreading.txt
deleted file mode 100644
index 9b27b10..0000000
--- a/deps/libav/doc/multithreading.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-Libav multithreading methods
-==============================================
-
-Libav provides two methods for multithreading codecs.
-
-Slice threading decodes multiple parts of a frame at the same time, using
-AVCodecContext execute() and execute2().
-
-Frame threading decodes multiple frames at the same time.
-It accepts N future frames and delays decoded pictures by N-1 frames.
-The later frames are decoded in separate threads while the user is
-displaying the current one.
-
-Restrictions on clients
-==============================================
-
-Slice threading -
-* The client's draw_horiz_band() must be thread-safe according to the comment
-  in avcodec.h.
-
-Frame threading -
-* Restrictions with slice threading also apply.
-* For best performance, the client should set thread_safe_callbacks if it
-  provides a thread-safe get_buffer() callback.
-* There is one frame of delay added for every thread beyond the first one.
-  Clients must be able to handle this; the pkt_dts and pkt_pts fields in
-  AVFrame will work as usual.
-
-Restrictions on codec implementations
-==============================================
-
-Slice threading -
- None except that there must be something worth executing in parallel.
-
-Frame threading -
-* Codecs can only accept entire pictures per packet.
-* Codecs similar to ffv1, whose streams don't reset across frames,
-  will not work because their bitstreams cannot be decoded in parallel.
-
-* The contents of buffers must not be read before ff_thread_await_progress()
-  has been called on them. reget_buffer() and buffer age optimizations no longer work.
-* The contents of buffers must not be written to after ff_thread_report_progress()
-  has been called on them. This includes draw_edges().
-
-Porting codecs to frame threading
-==============================================
-
-Find all context variables that are needed by the next frame. Move all
-code changing them, as well as code calling get_buffer(), up to before
-the decode process starts. Call ff_thread_finish_setup() afterwards. If
-some code can't be moved, have update_thread_context() run it in the next
-thread.
-
-If the codec allocates writable tables in its init(), add an init_thread_copy()
-which re-allocates them for other threads.
-
-Add CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
-speed gain at this point but it should work.
-
-If there are inter-frame dependencies, so the codec calls
-ff_thread_report/await_progress(), set AVCodecInternal.allocate_progress. The
-frames must then be freed with ff_thread_release_buffer().
-Otherwise leave it at zero and decode directly into the user-supplied frames.
-
-Call ff_thread_report_progress() after some part of the current picture has decoded.
-A good place to put this is where draw_horiz_band() is called - add this if it isn't
-called anywhere, as it's useful too and the implementation is trivial when you're
-doing this. Note that draw_edges() needs to be called before reporting progress.
-
-Before accessing a reference frame or its MVs, call ff_thread_await_progress().
diff --git a/deps/libav/doc/muxers.texi b/deps/libav/doc/muxers.texi
deleted file mode 100644
index 143e595..0000000
--- a/deps/libav/doc/muxers.texi
+++ /dev/null
@@ -1,491 +0,0 @@
- at chapter Muxers
- at c man begin MUXERS
-
-Muxers are configured elements in Libav which allow writing
-multimedia streams to a particular type of file.
-
-When you configure your Libav build, all the supported muxers
-are enabled by default. You can list all available muxers using the
-configure option @code{--list-muxers}.
-
-You can disable all the muxers with the configure option
- at code{--disable-muxers} and selectively enable / disable single muxers
-with the options @code{--enable-muxer=@var{MUXER}} /
- at code{--disable-muxer=@var{MUXER}}.
-
-The option @code{-formats} of the av* tools will display the list of
-enabled muxers.
-
-A description of some of the currently available muxers follows.
-
- at anchor{crc}
- at section crc
-
-CRC (Cyclic Redundancy Check) testing format.
-
-This muxer computes and prints the Adler-32 CRC of all the input audio
-and video frames. By default audio frames are converted to signed
-16-bit raw audio and video frames to raw video before computing the
-CRC.
-
-The output of the muxer consists of a single line of the form:
-CRC=0x at var{CRC}, where @var{CRC} is a hexadecimal number 0-padded to
-8 digits containing the CRC for all the decoded input frames.
-
-For example to compute the CRC of the input, and store it in the file
- at file{out.crc}:
- at example
-avconv -i INPUT -f crc out.crc
- at end example
-
-You can print the CRC to stdout with the command:
- at example
-avconv -i INPUT -f crc -
- at end example
-
-You can select the output format of each frame with @command{avconv} by
-specifying the audio and video codec and format. For example to
-compute the CRC of the input audio converted to PCM unsigned 8-bit
-and the input video converted to MPEG-2 video, use the command:
- at example
-avconv -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
- at end example
-
-See also the @ref{framecrc} muxer.
-
- at anchor{framecrc}
- at section framecrc
-
-Per-frame CRC (Cyclic Redundancy Check) testing format.
-
-This muxer computes and prints the Adler-32 CRC for each decoded audio
-and video frame. By default audio frames are converted to signed
-16-bit raw audio and video frames to raw video before computing the
-CRC.
-
-The output of the muxer consists of a line for each audio and video
-frame of the form: @var{stream_index}, @var{frame_dts},
- at var{frame_size}, 0x at var{CRC}, where @var{CRC} is a hexadecimal
-number 0-padded to 8 digits containing the CRC of the decoded frame.
-
-For example to compute the CRC of each decoded frame in the input, and
-store it in the file @file{out.crc}:
- at example
-avconv -i INPUT -f framecrc out.crc
- at end example
-
-You can print the CRC of each decoded frame to stdout with the command:
- at example
-avconv -i INPUT -f framecrc -
- at end example
-
-You can select the output format of each frame with @command{avconv} by
-specifying the audio and video codec and format. For example, to
-compute the CRC of each decoded input audio frame converted to PCM
-unsigned 8-bit and of each decoded input video frame converted to
-MPEG-2 video, use the command:
- at example
-avconv -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
- at end example
-
-See also the @ref{crc} muxer.
-
- at anchor{hls}
- at section hls
-
-Apple HTTP Live Streaming muxer that segments MPEG-TS according to
-the HTTP Live Streaming specification.
-
-It creates a playlist file and numbered segment files. The output
-filename specifies the playlist filename; the segment filenames
-receive the same basename as the playlist, a sequential number and
-a .ts extension.
-
- at example
-avconv -i in.nut out.m3u8
- at end example
-
- at table @option
- at item -hls_time @var{seconds}
-Set the segment length in seconds.
- at item -hls_list_size @var{size}
-Set the maximum number of playlist entries.
- at item -hls_wrap @var{wrap}
-Set the number after which index wraps.
- at item -start_number @var{number}
-Start the sequence from @var{number}.
- at end table
-
- at anchor{image2}
- at section image2
-
-Image file muxer.
-
-The image file muxer writes video frames to image files.
-
-The output filenames are specified by a pattern, which can be used to
-produce sequentially numbered series of files.
-The pattern may contain the string "%d" or "%0 at var{N}d", this string
-specifies the position of the characters representing a numbering in
-the filenames. If the form "%0 at var{N}d" is used, the string
-representing the number in each filename is 0-padded to @var{N}
-digits. The literal character '%' can be specified in the pattern with
-the string "%%".
-
-If the pattern contains "%d" or "%0 at var{N}d", the first filename of
-the file list specified will contain the number 1, all the following
-numbers will be sequential.
-
-The pattern may contain a suffix which is used to automatically
-determine the format of the image files to write.
-
-For example the pattern "img-%03d.bmp" will specify a sequence of
-filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ...,
- at file{img-010.bmp}, etc.
-The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
-form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg},
-etc.
-
-The following example shows how to use @command{avconv} for creating a
-sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ...,
-taking one image every second from the input video:
- at example
-avconv -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
- at end example
-
-Note that with @command{avconv}, if the format is not specified with the
- at code{-f} option and the output filename specifies an image file
-format, the image2 muxer is automatically selected, so the previous
-command can be written as:
- at example
-avconv -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
- at end example
-
-Note also that the pattern must not necessarily contain "%d" or
-"%0 at var{N}d", for example to create a single image file
- at file{img.jpeg} from the input video you can employ the command:
- at example
-avconv -i in.avi -f image2 -frames:v 1 img.jpeg
- at end example
-
- at table @option
- at item -start_number @var{number}
-Start the sequence from @var{number}.
-
- at item -update @var{number}
-If @var{number} is nonzero, the filename will always be interpreted as just a
-filename, not a pattern, and this file will be continuously overwritten with new
-images.
-
- at end table
-
- at section matroska
-
-Matroska container muxer.
-
-This muxer implements the matroska and webm container specs.
-
-The recognized metadata settings in this muxer are:
-
- at table @option
-
- at item title=@var{title name}
-Name provided to a single track
- at end table
-
- at table @option
-
- at item language=@var{language name}
-Specifies the language of the track in the Matroska languages form
- at end table
-
- at table @option
-
- at item STEREO_MODE=@var{mode}
-Stereo 3D video layout of two views in a single video track
- at table @option
- at item mono
-video is not stereo
- at item left_right
-Both views are arranged side by side, Left-eye view is on the left
- at item bottom_top
-Both views are arranged in top-bottom orientation, Left-eye view is at bottom
- at item top_bottom
-Both views are arranged in top-bottom orientation, Left-eye view is on top
- at item checkerboard_rl
-Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
- at item checkerboard_lr
-Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
- at item row_interleaved_rl
-Each view is constituted by a row based interleaving, Right-eye view is first row
- at item row_interleaved_lr
-Each view is constituted by a row based interleaving, Left-eye view is first row
- at item col_interleaved_rl
-Both views are arranged in a column based interleaving manner, Right-eye view is first column
- at item col_interleaved_lr
-Both views are arranged in a column based interleaving manner, Left-eye view is first column
- at item anaglyph_cyan_red
-All frames are in anaglyph format viewable through red-cyan filters
- at item right_left
-Both views are arranged side by side, Right-eye view is on the left
- at item anaglyph_green_magenta
-All frames are in anaglyph format viewable through green-magenta filters
- at item block_lr
-Both eyes laced in one Block, Left-eye view is first
- at item block_rl
-Both eyes laced in one Block, Right-eye view is first
- at end table
- at end table
-
-For example a 3D WebM clip can be created using the following command line:
- at example
-avconv -i sample_left_right_clip.mpg -an -c:v libvpx -metadata STEREO_MODE=left_right -y stereo_clip.webm
- at end example
-
-This muxer supports the following options:
-
- at table @option
-
- at item reserve_index_space
-By default, this muxer writes the index for seeking (called cues in Matroska
-terms) at the end of the file, because it cannot know in advance how much space
-to leave for the index at the beginning of the file. However for some use cases
--- e.g.  streaming where seeking is possible but slow -- it is useful to put the
-index at the beginning of the file.
-
-If this option is set to a non-zero value, the muxer will reserve a given amount
-of space in the file header and then try to write the cues there when the muxing
-finishes. If the available space does not suffice, muxing will fail. A safe size
-for most use cases should be about 50kB per hour of video.
-
-Note that cues are only written if the output is seekable and this option will
-have no effect if it is not.
-
- at end table
-
- at section mov, mp4, ismv
-
-The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
-file has all the metadata about all packets stored in one location
-(written at the end of the file, it can be moved to the start for
-better playback using the @command{qt-faststart} tool). A fragmented
-file consists of a number of fragments, where packets and metadata
-about these packets are stored together. Writing a fragmented
-file has the advantage that the file is decodable even if the
-writing is interrupted (while a normal MOV/MP4 is undecodable if
-it is not properly finished), and it requires less memory when writing
-very long files (since writing normal MOV/MP4 files stores info about
-every single packet in memory until the file is closed). The downside
-is that it is less compatible with other applications.
-
-Fragmentation is enabled by setting one of the AVOptions that define
-how to cut the file into fragments:
-
- at table @option
- at item -movflags frag_keyframe
-Start a new fragment at each video keyframe.
- at item -frag_duration @var{duration}
-Create fragments that are @var{duration} microseconds long.
- at item -frag_size @var{size}
-Create fragments that contain up to @var{size} bytes of payload data.
- at item -movflags frag_custom
-Allow the caller to manually choose when to cut fragments, by
-calling @code{av_write_frame(ctx, NULL)} to write a fragment with
-the packets written so far. (This is only useful with other
-applications integrating libavformat, not from @command{avconv}.)
- at item -min_frag_duration @var{duration}
-Don't create fragments that are shorter than @var{duration} microseconds long.
- at end table
-
-If more than one condition is specified, fragments are cut when
-one of the specified conditions is fulfilled. The exception to this is
- at code{-min_frag_duration}, which has to be fulfilled for any of the other
-conditions to apply.
-
-Additionally, the way the output file is written can be adjusted
-through a few other options:
-
- at table @option
- at item -movflags empty_moov
-Write an initial moov atom directly at the start of the file, without
-describing any samples in it. Generally, an mdat/moov pair is written
-at the start of the file, as a normal MOV/MP4 file, containing only
-a short portion of the file. With this option set, there is no initial
-mdat atom, and the moov atom only describes the tracks but has
-a zero duration.
-
-Files written with this option set do not work in QuickTime.
-This option is implicitly set when writing ismv (Smooth Streaming) files.
- at item -movflags separate_moof
-Write a separate moof (movie fragment) atom for each track. Normally,
-packets for all tracks are written in a moof atom (which is slightly
-more efficient), but with this option set, the muxer writes one moof/mdat
-pair for each track, making it easier to separate tracks.
-
-This option is implicitly set when writing ismv (Smooth Streaming) files.
- at item -movflags faststart
-Run a second pass moving the index (moov atom) to the beginning of the file.
-This operation can take a while, and will not work in various situations such
-as fragmented output, thus it is not enabled by default.
- at end table
-
-Smooth Streaming content can be pushed in real time to a publishing
-point on IIS with this muxer. Example:
- at example
-avconv -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
- at end example
-
- at section mp3
-
-The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
-optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
- at code{id3v2_version} option controls which one is used. Setting
- at code{id3v2_version} to 0 will disable the ID3v2 header completely. The legacy
-ID3v1 tag is not written by default, but may be enabled with the
- at code{write_id3v1} option.
-
-The muxer may also write a Xing frame at the beginning, which contains the
-number of frames in the file. It is useful for computing duration of VBR files.
-The Xing frame is written if the output stream is seekable and if the
- at code{write_xing} option is set to 1 (the default).
-
-The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
-are supplied to the muxer in form of a video stream with a single packet. There
-can be any number of those streams, each will correspond to a single APIC frame.
-The stream metadata tags @var{title} and @var{comment} map to APIC
- at var{description} and @var{picture type} respectively. See
- at url{http://id3.org/id3v2.4.0-frames} for allowed picture types.
-
-Note that the APIC frames must be written at the beginning, so the muxer will
-buffer the audio frames until it gets all the pictures. It is therefore advised
-to provide the pictures as soon as possible to avoid excessive buffering.
-
-Examples:
-
-Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
- at example
-avconv -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
- at end example
-
-Attach a picture to an mp3:
- at example
-avconv -i input.mp3 -i cover.png -c copy -metadata:s:v title="Album cover"
--metadata:s:v comment="Cover (Front)" out.mp3
- at end example
-
-Write a "clean" MP3 without any extra features:
- at example
-avconv -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
- at end example
-
- at section mpegts
-
-MPEG transport stream muxer.
-
-This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
-
-The muxer options are:
-
- at table @option
- at item -mpegts_original_network_id @var{number}
-Set the original_network_id (default 0x0001). This is unique identifier
-of a network in DVB. Its main use is in the unique identification of a
-service through the path Original_Network_ID, Transport_Stream_ID.
- at item -mpegts_transport_stream_id @var{number}
-Set the transport_stream_id (default 0x0001). This identifies a
-transponder in DVB.
- at item -mpegts_service_id @var{number}
-Set the service_id (default 0x0001) also known as program in DVB.
- at item -mpegts_pmt_start_pid @var{number}
-Set the first PID for PMT (default 0x1000, max 0x1f00).
- at item -mpegts_start_pid @var{number}
-Set the first PID for data packets (default 0x0100, max 0x0f00).
- at end table
-
-The recognized metadata settings in mpegts muxer are @code{service_provider}
-and @code{service_name}. If they are not set the default for
- at code{service_provider} is "Libav" and the default for
- at code{service_name} is "Service01".
-
- at example
-avconv -i file.mpg -c copy \
-     -mpegts_original_network_id 0x1122 \
-     -mpegts_transport_stream_id 0x3344 \
-     -mpegts_service_id 0x5566 \
-     -mpegts_pmt_start_pid 0x1500 \
-     -mpegts_start_pid 0x150 \
-     -metadata service_provider="Some provider" \
-     -metadata service_name="Some Channel" \
-     -y out.ts
- at end example
-
- at section null
-
-Null muxer.
-
-This muxer does not generate any output file, it is mainly useful for
-testing or benchmarking purposes.
-
-For example to benchmark decoding with @command{avconv} you can use the
-command:
- at example
-avconv -benchmark -i INPUT -f null out.null
- at end example
-
-Note that the above command does not read or write the @file{out.null}
-file, but specifying the output file is required by the @command{avconv}
-syntax.
-
-Alternatively you can write the command as:
- at example
-avconv -benchmark -i INPUT -f null -
- at end example
-
- at section ogg
-
-Ogg container muxer.
-
- at table @option
- at item -page_duration @var{duration}
-Preferred page duration, in microseconds. The muxer will attempt to create
-pages that are approximately @var{duration} microseconds long. This allows the
-user to compromise between seek granularity and container overhead. The default
-is 1 second. A value of 0 will fill all segments, making pages as large as
-possible. A value of 1 will effectively use 1 packet-per-page in most
-situations, giving a small seek granularity at the cost of additional container
-overhead.
- at end table
-
- at section segment
-
-Basic stream segmenter.
-
-The segmenter muxer outputs streams to a number of separate files of nearly
-fixed duration. Output filename pattern can be set in a fashion similar to
- at ref{image2}.
-
-Every segment starts with a video keyframe, if a video stream is present.
-The segment muxer works best with a single constant frame rate video.
-
-Optionally it can generate a flat list of the created segments, one segment
-per line.
-
- at table @option
- at item segment_format @var{format}
-Override the inner container format, by default it is guessed by the filename
-extension.
- at item segment_time @var{t}
-Set segment duration to @var{t} seconds.
- at item segment_list @var{name}
-Generate also a listfile named @var{name}.
- at item segment_list_size @var{size}
-Overwrite the listfile once it reaches @var{size} entries.
- at item segment_wrap @var{limit}
-Wrap around segment index once it reaches @var{limit}.
- at end table
-
- at example
-avconv -i in.mkv -c copy -map 0 -f segment -list out.list out%03d.nut
- at end example
-
- at c man end MUXERS
diff --git a/deps/libav/doc/nut.texi b/deps/libav/doc/nut.texi
deleted file mode 100644
index 39a22ff..0000000
--- a/deps/libav/doc/nut.texi
+++ /dev/null
@@ -1,133 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle NUT
-
- at titlepage
- at center @titlefont{NUT}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter Description
-NUT is a low overhead generic container format. It stores audio, video,
-subtitle and user-defined streams in a simple, yet efficient, way.
-
-It was created by a group of FFmpeg and MPlayer developers in 2003
-and was finalized in 2008.
-
- at chapter Container-specific codec tags
-
- at section Generic raw YUVA formats
-
-Since many exotic planar YUVA pixel formats are not considered by
-the AVI/QuickTime FourCC lists, the following scheme is adopted for
-representing them.
-
-The first two bytes can contain the values:
-Y1 = only Y
-Y2 = Y+A
-Y3 = YUV
-Y4 = YUVA
-
-The third byte represents the width and height chroma subsampling
-values for the UV planes, that is the amount to shift the luma
-width/height right to find the chroma width/height.
-
-The fourth byte is the number of bits used (8, 16, ...).
-
-If the order of bytes is inverted, that means that each component has
-to be read big-endian.
-
- at section Raw Audio
-
- at multitable @columnfractions .4 .4
- at item ALAW  @tab A-LAW
- at item ULAW  @tab MU-LAW
- at item P<type><interleaving><bits> @tab little-endian PCM
- at item <bits><interleaving><type>P @tab big-endian PCM
- at end multitable
-
-<type> is S for signed integer, U for unsigned integer, F for IEEE float
-<interleaving> is D for default, P is for planar.
-<bits> is 8/16/24/32
-
- at example
-PFD[32]   would for example be signed 32 bit little-endian IEEE float
- at end example
-
- at section Subtitles
-
- at multitable @columnfractions .4 .4
- at item UTF8   @tab Raw UTF-8
- at item SSA[0] @tab SubStation Alpha
- at item DVDS   @tab DVD subtitles
- at item DVBS   @tab DVB subtitles
- at end multitable
-
- at section Raw Data
-
- at multitable @columnfractions .4 .4
- at item UTF8   @tab Raw UTF-8
- at end multitable
-
- at section Codecs
-
- at multitable @columnfractions .4 .4
- at item 3IV1 @tab non-compliant MPEG-4 generated by old 3ivx
- at item ASV1 @tab Asus Video
- at item ASV2 @tab Asus Video 2
- at item CVID @tab Cinepak
- at item CYUV @tab Creative YUV
- at item DIVX @tab non-compliant MPEG-4 generated by old DivX
- at item DUCK @tab Truemotion 1
- at item FFV1 @tab FFmpeg video 1
- at item FFVH @tab FFmpeg Huffyuv
- at item H261 @tab ITU H.261
- at item H262 @tab ITU H.262
- at item H263 @tab ITU H.263
- at item H264 @tab ITU H.264
- at item HFYU @tab Huffyuv
- at item I263 @tab Intel H.263
- at item IV31 @tab Indeo 3.1
- at item IV32 @tab Indeo 3.2
- at item IV50 @tab Indeo 5.0
- at item LJPG @tab ITU JPEG (lossless)
- at item MJLS @tab ITU JPEG-LS
- at item MJPG @tab ITU JPEG
- at item MPG4 @tab MS MPEG-4v1 (not ISO MPEG-4)
- at item MP42 @tab MS MPEG-4v2
- at item MP43 @tab MS MPEG-4v3
- at item MP4V @tab ISO MPEG-4 Part 2 Video (from old encoders)
- at item mpg1 @tab ISO MPEG-1 Video
- at item mpg2 @tab ISO MPEG-2 Video
- at item MRLE @tab MS RLE
- at item MSVC @tab MS Video 1
- at item RT21 @tab Indeo 2.1
- at item RV10 @tab RealVideo 1.0
- at item RV20 @tab RealVideo 2.0
- at item RV30 @tab RealVideo 3.0
- at item RV40 @tab RealVideo 4.0
- at item SVQ1 @tab Sorenson Video 1
- at item SVQ3 @tab Sorenson Video 3
- at item theo @tab Xiph Theora
- at item TM20 @tab Truemotion 2.0
- at item UMP4 @tab non-compliant MPEG-4 generated by UB Video MPEG-4
- at item VCR1 @tab ATI VCR1
- at item VP30 @tab VP 3.0
- at item VP31 @tab VP 3.1
- at item VP50 @tab VP 5.0
- at item VP60 @tab VP 6.0
- at item VP61 @tab VP 6.1
- at item VP62 @tab VP 6.2
- at item VP70 @tab VP 7.0
- at item WMV1 @tab MS WMV7
- at item WMV2 @tab MS WMV8
- at item WMV3 @tab MS WMV9
- at item WV1F @tab non-compliant MPEG-4 generated by ?
- at item WVC1 @tab VC-1
- at item XVID @tab non-compliant MPEG-4 generated by old Xvid
- at item XVIX @tab non-compliant MPEG-4 generated by old Xvid with interlacing bug
- at end multitable
-
diff --git a/deps/libav/doc/optimization.txt b/deps/libav/doc/optimization.txt
deleted file mode 100644
index 2b8c51b..0000000
--- a/deps/libav/doc/optimization.txt
+++ /dev/null
@@ -1,288 +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 (web frontends for the various Libav
-branches are listed at http://libav.org/download.html).
-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!!!
-(https://lists.libav.org/mailman/listinfo/libav-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 int16_t *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
-
-
-General Tips:
--------------
-Use asm loops like:
-__asm__(
-    "1: ....
-    ...
-    "jump_instruction ....
-Do not use C loops:
-do{
-    __asm__(
-        ...
-}while()
-
-For x86, mark registers that are clobbered in your asm. This means both
-general x86 registers (e.g. eax) as well as XMM registers. This last one is
-particularly important on Win64, where xmm6-15 are callee-save, and not
-restoring their contents leads to undefined results. In external asm (e.g.
-yasm), you do this by using:
-cglobal functon_name, num_args, num_regs, num_xmm_regs
-In inline asm, you specify clobbered registers at the end of your asm:
-__asm__(".." ::: "%eax").
-If gcc is not set to support sse (-msse) it will not accept xmm registers
-in the clobber list. For that we use two macros to declare the clobbers.
-XMM_CLOBBERS should be used when there are other clobbers, for example:
-__asm__(".." ::: XMM_CLOBBERS("xmm0",) "eax");
-and XMM_CLOBBERS_ONLY should be used when the only clobbers are xmm registers:
-__asm__(".." :: XMM_CLOBBERS_ONLY("xmm0"));
-
-Do not expect a compiler to maintain values in your registers between separate
-(inline) asm code blocks. It is not required to. For example, this is bad:
-__asm__("movdqa %0, %%xmm7" : src);
-/* do something */
-__asm__("movdqa %%xmm7, %1" : dst);
-- first of all, you're assuming that the compiler will not use xmm7 in
-   between the two asm blocks.  It probably won't when you test it, but it's
-   a poor assumption that will break at some point for some --cpu compiler flag
-- secondly, you didn't mark xmm7 as clobbered. If you did, the compiler would
-   have restored the original value of xmm7 after the first asm block, thus
-   rendering the combination of the two blocks of code invalid
-Code that depends on data in registries being untouched, should be written as
-a single __asm__() statement. Ideally, a single function contains only one
-__asm__() block.
-
-Use external asm (nasm/yasm) or inline asm (__asm__()), do not use intrinsics.
-The latter requires a good optimizing compiler which gcc is not.
-
-Inline asm vs. external asm
----------------------------
-Both inline asm (__asm__("..") in a .c file, handled by a compiler such as gcc)
-and external asm (.s or .asm files, handled by an assembler such as yasm/nasm)
-are accepted in Libav. Which one to use differs per specific case.
-
-- if your code is intended to be inlined in a C function, inline asm is always
-   better, because external asm cannot be inlined
-- if your code calls external functions, yasm is always better
-- if your code takes huge and complex structs as function arguments (e.g.
-   MpegEncContext; note that this is not ideal and is discouraged if there
-   are alternatives), then inline asm is always better, because predicting
-   member offsets in complex structs is almost impossible. It's safest to let
-   the compiler take care of that
-- in many cases, both can be used and it just depends on the preference of the
-   person writing the asm. For new asm, the choice is up to you. For existing
-   asm, you'll likely want to maintain whatever form it is currently in unless
-   there is a good reason to change it.
-- if, for some reason, you believe that a particular chunk of existing external
-   asm could be improved upon further if written in inline asm (or the other
-   way around), then please make the move from external asm <-> inline asm a
-   separate patch before your patches that actually improve the asm.
-
-
-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 MMX 2 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/deps/libav/doc/outdevs.texi b/deps/libav/doc/outdevs.texi
deleted file mode 100644
index dd7bd64..0000000
--- a/deps/libav/doc/outdevs.texi
+++ /dev/null
@@ -1,33 +0,0 @@
- at chapter Output Devices
- at c man begin OUTPUT DEVICES
-
-Output devices are configured elements in Libav which allow to write
-multimedia data to an output device attached to your system.
-
-When you configure your Libav build, all the supported output devices
-are enabled by default. You can list all available ones using the
-configure option "--list-outdevs".
-
-You can disable all the output devices using the configure option
-"--disable-outdevs", and selectively enable an output device using the
-option "--enable-outdev=@var{OUTDEV}", or you can disable a particular
-input device using the option "--disable-outdev=@var{OUTDEV}".
-
-The option "-formats" of the av* tools will display the list of
-enabled output devices (amongst the muxers).
-
-A description of the currently available output devices follows.
-
- at section alsa
-
-ALSA (Advanced Linux Sound Architecture) output device.
-
- at section oss
-
-OSS (Open Sound System) output device.
-
- at section sndio
-
-sndio audio output device.
-
- at c man end OUTPUT DEVICES
diff --git a/deps/libav/doc/platform.texi b/deps/libav/doc/platform.texi
deleted file mode 100644
index 45ec275..0000000
--- a/deps/libav/doc/platform.texi
+++ /dev/null
@@ -1,371 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-
- at settitle Platform Specific information
- at titlepage
- at center @titlefont{Platform Specific information}
- at end titlepage
-
- at top
-
- at contents
-
- at chapter Unix-like
-
-Some parts of Libav 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 section BSD
-
-BSD make will not build Libav, you need to install and use GNU Make
-(@command{gmake}).
-
- at section (Open)Solaris
-
-GNU Make is required to build Libav, so you have to invoke (@command{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 anchor{Darwin}
- at section Darwin (OS X, iPhone)
-
-The toolchain provided with Xcode is sufficient to build the basic
-unacelerated code.
-
-OS X on PowerPC or ARM (iPhone) requires a preprocessor from
- at url{git://git.libav.org/gas-preprocessor.git} to build the optimized
-assembler functions. Put the Perl script somewhere
-in your PATH, Libav's configure will pick it up automatically.
-
-OS X on AMD64 and x86 requires @command{yasm} to build most of the
-optimized assembler functions @url{http://mxcl.github.com/homebrew/, Homebrew},
- at url{http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml, Gentoo Prefix}
-or @url{http://www.macports.org, MacPorts} can easily provide it.
-
-
- at chapter DOS
-
-Using a cross-compiler is preferred for various reasons.
- at url{http://www.delorie.com/howto/djgpp/linux-x-djgpp.html}
-
-
- at chapter OS/2
-
-For information about compiling Libav on OS/2 see
- at url{http://www.edm2.com/index.php/FFmpeg}.
-
-
- at chapter Windows
-
- at section Native Windows compilation using MinGW or MinGW-w64
-
-Libav can be built to run natively on Windows using the MinGW or MinGW-w64
-toolchains. Install the latest versions of MSYS and MinGW or MinGW-w64 from
- at url{http://www.mingw.org/} or @url{http://mingw-w64.sourceforge.net/}.
-You can find detailed installation instructions in the download section and
-the FAQ.
-
-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 during
- at code{make install}).
-
- at item In order to compile AVplay, you must have the MinGW development library
-of @uref{http://www.libsdl.org/, SDL} and @code{pkg-config} installed.
-
- at item By using @code{./configure --enable-shared} when configuring Libav,
-you can build all libraries as DLLs.
-
- at end itemize
-
- at section Microsoft Visual C++ or Intel C++ Compiler for Windows
-
-Libav can be built with MSVC 2012 or earlier using a C99-to-C89 conversion utility
-and wrapper, or with MSVC 2013 and ICL natively.
-
-You will need the following prerequisites:
-
- at itemize
- at item @uref{https://github.com/libav/c99-to-c89/, C99-to-C89 Converter & Wrapper}
-(if using MSVC 2012 or earlier)
- at item @uref{http://code.google.com/p/msinttypes/, msinttypes}
-(if using MSVC 2012 or earlier)
- at item @uref{http://www.mingw.org/, MSYS}
- at item @uref{http://yasm.tortall.net/, YASM}
- at item @uref{http://gnuwin32.sourceforge.net/packages/bc.htm, bc for Windows} if
-you want to run @uref{fate.html, FATE}.
- at end itemize
-
-To set up a proper environment in MSYS, you need to run @code{msys.bat} from
-the Visual Studio or Intel Compiler command prompt.
-
-Place @code{yasm.exe} somewhere in your @code{PATH}. If using MSVC 2012 or
-earlier, place @code{c99wrap.exe} and @code{c99conv.exe} somewhere in your
- at code{PATH} as well.
-
-Next, make sure any other headers and libs you want to use, such as zlib, are
-located in a spot that the compiler can see. Do so by modifying the @code{LIB}
-and @code{INCLUDE} environment variables to include the @strong{Windows-style}
-paths to these directories. Alternatively, you can try and use the
- at code{--extra-cflags}/@code{--extra-ldflags} configure options. If using MSVC
-2012 or earlier, place @code{inttypes.h} somewhere the compiler can see too.
-
-Finally, run:
-
- at example
-For MSVC:
-./configure --toolchain=msvc
-
-For ICL:
-./configure --toolchain=icl
-
-make
-make install
- at end example
-
-If you wish to compile shared libraries, add @code{--enable-shared} to your
-configure options. Note that due to the way MSVC and ICL handle DLL imports and
-exports, you cannot compile static and shared libraries at the same time, and
-enabling shared libraries will automatically disable the static ones.
-
-Notes:
-
- at itemize
-
- at item It is possible that coreutils' @code{link.exe} conflicts with MSVC's linker.
-You can find out by running @code{which link} to see which @code{link.exe} you
-are using. If it is located at @code{/bin/link.exe}, then you have the wrong one
-in your @code{PATH}. Either move or remove that copy, or make sure MSVC's
- at code{link.exe} takes precedence in your @code{PATH} over coreutils'.
-
- at item If you wish to build with zlib support, you will have to grab a compatible
-zlib binary from somewhere, with an MSVC import lib, or if you wish to link
-statically, you can follow the instructions below to build a compatible
- at code{zlib.lib} with MSVC. Regardless of which method you use, you must still
-follow step 3, or compilation will fail.
- at enumerate
- at item Grab the @uref{http://zlib.net/, zlib sources}.
- at item Edit @code{win32/Makefile.msc} so that it uses -MT instead of -MD, since
-this is how Libav is built as well.
- at item Edit @code{zconf.h} and remove its inclusion of @code{unistd.h}. This gets
-erroneously included when building Libav.
- at item Run @code{nmake -f win32/Makefile.msc}.
- at item Move @code{zlib.lib}, @code{zconf.h}, and @code{zlib.h} to somewhere MSVC
-can see.
- at end enumerate
-
- at item Libav has been tested with the following on i686 and x86_64:
- at itemize
- at item Visual Studio 2010 Pro and Express
- at item Visual Studio 2012 Pro and Express
- at item Visual Studio 2013 Pro and Express
- at item Intel Composer XE 2013
- at item Intel Composer XE 2013 SP1
- at end itemize
-Anything else is not officially supported.
-
- at end itemize
-
- at subsection Linking to Libav with Microsoft Visual C++
-
-If you plan to link with MSVC-built static libraries, you will need
-to make sure you have @code{Runtime Library} set to
- at code{Multi-threaded (/MT)} in your project's settings.
-
-You will need to define @code{inline} to something MSVC understands:
- at example
-#define inline __inline
- at end example
-
-Also note, that as stated in @strong{Microsoft Visual C++}, you will need
-an MSVC-compatible @uref{http://code.google.com/p/msinttypes/, inttypes.h}.
-
-If you plan on using import libraries created by dlltool, you must
-set @code{References} to @code{No (/OPT:NOREF)} under the linker optimization
-settings, otherwise the resulting binaries will fail during runtime.
-This is not required when using import libraries generated by @code{lib.exe}.
-This issue is reported upstream at
- at url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}.
-
-To create import libraries that work with the @code{/OPT:REF} option
-(which is enabled by default in Release mode), follow these steps:
-
- at enumerate
-
- at item Open the @emph{Visual Studio Command Prompt}.
-
-Alternatively, in a normal command line prompt, call @file{vcvars32.bat}
-which sets up the environment variables for the Visual C++ tools
-(the standard location for this file is something like
- at file{C:\Program Files (x86_\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat}).
-
- at item Enter the @file{bin} directory where the created LIB and DLL files
-are stored.
-
- at item Generate new import libraries with @command{lib.exe}:
-
- at example
-lib /machine:i386 /def:..\lib\foo-version.def  /out:foo.lib
- at end example
-
-Replace @code{foo-version} and @code{foo} with the respective library names.
-
- at end enumerate
-
- at anchor{Cross compilation for Windows with Linux}
- at section Cross compilation for Windows with Linux
-
-You must use the MinGW cross compilation tools available at
- at url{http://www.mingw.org/}.
-
-Then configure Libav 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 Libav with @uref{http://www.winehq.com/, Wine}.
-
- at section 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, git, mingw-runtime, texi2html
- at end example
-
-In order to run FATE you will also need the following "Utils" packages:
- at example
-bc, diffutils
- at end example
-
-If you want to build Libav 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
- at uref{http://sourceware.org/cygwinports/, Cygwin Ports}:
-
- at example
-yasm, libSDL-devel, libfaac-devel, libgsm-devel, libmp3lame-devel,
-libschroedinger1.0-devel, speex-devel, libtheora-devel, libxvidcore-devel
- at end example
-
-The recommendation for x264 is to build it from source, as it evolves too
-quickly for Cygwin Ports to be up to date.
-
- at section 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 --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-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
- at end example
-
- at chapter Plan 9
-
-The native @uref{http://plan9.bell-labs.com/plan9/, Plan 9} compiler
-does not implement all the C99 features needed by Libav so the gcc
-port must be used.  Furthermore, a few items missing from the C
-library and shell environment need to be fixed.
-
- at itemize
-
- at item GNU awk, grep, make, and sed
-
-Working packages of these tools can be found at
- at uref{http://code.google.com/p/ports2plan9/downloads/list, ports2plan9}.
-They can be installed with @uref{http://9front.org/, 9front's} @code{pkg}
-utility by setting @code{pkgpath} to
- at code{http://ports2plan9.googlecode.com/files/}.
-
- at item Missing/broken @code{head} and @code{printf} commands
-
-Replacements adequate for building Libav can be found in the
- at code{compat/plan9} directory.  Place these somewhere they will be
-found by the shell.  These are not full implementations of the
-commands and are @emph{not} suitable for general use.
-
- at item Missing C99 @code{stdint.h} and @code{inttypes.h}
-
-Replacement headers are available from
- at url{http://code.google.com/p/plan9front/issues/detail?id=152}.
-
- at item Missing or non-standard library functions
-
-Some functions in the C library are missing or incomplete.  The
- at code{@uref{http://ports2plan9.googlecode.com/files/gcc-apelibs-1207.tbz,
-gcc-apelibs-1207}} package from
- at uref{http://code.google.com/p/ports2plan9/downloads/list, ports2plan9}
-includes an updated C library, but installing the full package gives
-unusable executables.  Instead, keep the files from @code{gccbin.tgz}
-under @code{/386/lib/gnu}.  From the @code{libc.a} archive in the
- at code{gcc-apelibs-1207} package, extract the following object files and
-turn them into a library:
-
- at itemize
- at item @code{strerror.o}
- at item @code{strtoll.o}
- at item @code{snprintf.o}
- at item @code{vsnprintf.o}
- at item @code{vfprintf.o}
- at item @code{_IO_getc.o}
- at item @code{_IO_putc.o}
- at end itemize
-
-Use the @code{--extra-libs} option of @code{configure} to inform the
-build system of this library.
-
- at item FPU exceptions enabled by default
-
-Unlike most other systems, Plan 9 enables FPU exceptions by default.
-These must be disabled before calling any Libav functions.  While the
-included tools will do this automatically, other users of the
-libraries must do it themselves.
-
- at end itemize
-
- at bye
diff --git a/deps/libav/doc/print_options.c b/deps/libav/doc/print_options.c
deleted file mode 100644
index aa75a00..0000000
--- a/deps/libav/doc/print_options.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2012 Anton Khirnov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * generate texinfo manpages for avoptions
- */
-
-#include <stddef.h>
-#include <string.h>
-#include <float.h>
-
-#include "libavformat/avformat.h"
-#include "libavformat/options_table.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/options_table.h"
-#include "libavutil/opt.h"
-
-static void print_usage(void)
-{
-    fprintf(stderr, "Usage: enum_options type\n"
-            "type: format codec\n");
-    exit(1);
-}
-
-static void print_option(const AVOption *opts, const AVOption *o, int per_stream)
-{
-    if (!(o->flags & (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM)))
-        return;
-
-    printf("@item -%s%s @var{", o->name, per_stream ? "[:stream_specifier]" : "");
-    switch (o->type) {
-    case AV_OPT_TYPE_BINARY:   printf("hexadecimal string"); break;
-    case AV_OPT_TYPE_STRING:   printf("string");             break;
-    case AV_OPT_TYPE_INT:
-    case AV_OPT_TYPE_INT64:    printf("integer");            break;
-    case AV_OPT_TYPE_FLOAT:
-    case AV_OPT_TYPE_DOUBLE:   printf("float");              break;
-    case AV_OPT_TYPE_RATIONAL: printf("rational number");    break;
-    case AV_OPT_TYPE_FLAGS:    printf("flags");              break;
-    default:                   printf("value");              break;
-    }
-    printf("} (@emph{");
-
-    if (o->flags & AV_OPT_FLAG_DECODING_PARAM) {
-        printf("input");
-        if (o->flags & AV_OPT_FLAG_ENCODING_PARAM)
-            printf("/");
-    }
-    if (o->flags & AV_OPT_FLAG_ENCODING_PARAM) printf("output");
-    if (o->flags & AV_OPT_FLAG_AUDIO_PARAM)    printf(",audio");
-    if (o->flags & AV_OPT_FLAG_VIDEO_PARAM)    printf(",video");
-    if (o->flags & AV_OPT_FLAG_SUBTITLE_PARAM) printf(",subtitles");
-
-    printf("})\n");
-    if (o->help)
-        printf("%s\n", o->help);
-
-    if (o->unit) {
-        const AVOption *u;
-        printf("\nPossible values:\n at table @samp\n");
-
-        for (u = opts; u->name; u++) {
-            if (u->type == AV_OPT_TYPE_CONST && u->unit && !strcmp(u->unit, o->unit))
-                printf("@item %s\n%s\n", u->name, u->help ? u->help : "");
-        }
-        printf("@end table\n");
-    }
-}
-
-static void show_opts(const AVOption *opts, int per_stream)
-{
-    const AVOption *o;
-
-    printf("@table @option\n");
-    for (o = opts; o->name; o++) {
-        if (o->type != AV_OPT_TYPE_CONST)
-            print_option(opts, o, per_stream);
-    }
-    printf("@end table\n");
-}
-
-static void show_format_opts(void)
-{
-    printf("@section Format AVOptions\n");
-    show_opts(avformat_options, 0);
-}
-
-static void show_codec_opts(void)
-{
-    printf("@section Codec AVOptions\n");
-    show_opts(avcodec_options, 1);
-}
-
-int main(int argc, char **argv)
-{
-    if (argc < 2)
-        print_usage();
-
-    if (!strcmp(argv[1], "format"))
-        show_format_opts();
-    else if (!strcmp(argv[1], "codec"))
-        show_codec_opts();
-    else
-        print_usage();
-
-    return 0;
-}
diff --git a/deps/libav/doc/protocols.texi b/deps/libav/doc/protocols.texi
deleted file mode 100644
index 1501dab..0000000
--- a/deps/libav/doc/protocols.texi
+++ /dev/null
@@ -1,757 +0,0 @@
- at chapter Protocols
- at c man begin PROTOCOLS
-
-Protocols are configured elements in Libav which allow to access
-resources which require the use of a particular protocol.
-
-When you configure your Libav build, all the supported protocols are
-enabled by default. You can list all available ones using the
-configure option "--list-protocols".
-
-You can disable all the protocols using the configure option
-"--disable-protocols", and selectively enable a protocol using the
-option "--enable-protocol=@var{PROTOCOL}", or you can disable a
-particular protocol using the option
-"--disable-protocol=@var{PROTOCOL}".
-
-The option "-protocols" of the av* tools will display the list of
-supported protocols.
-
-A description of the currently available protocols follows.
-
- at section concat
-
-Physical concatenation protocol.
-
-Allow to read and seek from many resource in sequence as if they were
-a unique resource.
-
-A URL accepted by this protocol has the syntax:
- at example
-concat:@var{URL1}|@var{URL2}|...|@var{URLN}
- at end example
-
-where @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of the
-resource to be concatenated, each one possibly specifying a distinct
-protocol.
-
-For example to read a sequence of files @file{split1.mpeg},
- at file{split2.mpeg}, @file{split3.mpeg} with @command{avplay} use the
-command:
- at example
-avplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
- at end example
-
-Note that you may need to escape the character "|" which is special for
-many shells.
-
- at section file
-
-File access protocol.
-
-Allow to read from or read to a file.
-
-For example to read from a file @file{input.mpeg} with @command{avconv}
-use the command:
- at example
-avconv -i file:input.mpeg output.mpeg
- at end example
-
-The av* tools default to the file protocol, that is a resource
-specified with the name "FILE.mpeg" is interpreted as the URL
-"file:FILE.mpeg".
-
- at section gopher
-
-Gopher protocol.
-
- at section hls
-
-Read Apple HTTP Live Streaming compliant segmented stream as
-a uniform one. The M3U8 playlists describing the segments can be
-remote HTTP resources or local files, accessed using the standard
-file protocol.
-The nested protocol is declared by specifying
-"+ at var{proto}" after the hls URI scheme name, where @var{proto}
-is either "file" or "http".
-
- at example
-hls+http://host/path/to/remote/resource.m3u8
-hls+file://path/to/local/resource.m3u8
- at end example
-
-Using this protocol is discouraged - the hls demuxer should work
-just as well (if not, please report the issues) and is more complete.
-To use the hls demuxer instead, simply use the direct URLs to the
-m3u8 files.
-
- at section http
-
-HTTP (Hyper Text Transfer Protocol).
-
-This protocol accepts the following options:
-
- at table @option
- at item chunked_post
-If set to 1 use chunked Transfer-Encoding for posts, default is 1.
-
- at item content_type
-Set a specific content type for the POST messages.
-
- at item headers
-Set custom HTTP headers, can override built in default headers. The
-value must be a string encoding the headers.
-
- at item multiple_requests
-Use persistent connections if set to 1, default is 0.
-
- at item post_data
-Set custom HTTP post data.
-
- at item user_agent
-Override the User-Agent header. If not specified a string of the form
-"Lavf/<version>" will be used.
-
- at item mime_type
-Export the MIME type.
-
- at item icy
-If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
-supports this, the metadata has to be retrieved by the application by reading
-the @option{icy_metadata_headers} and @option{icy_metadata_packet} options.
-The default is 0.
-
- at item icy_metadata_headers
-If the server supports ICY metadata, this contains the ICY-specific HTTP reply
-headers, separated by newline characters.
-
- at item icy_metadata_packet
-If the server supports ICY metadata, and @option{icy} was set to 1, this
-contains the last non-empty metadata packet sent by the server. It should be
-polled in regular intervals by applications interested in mid-stream metadata
-updates.
-
- at item offset
-Set initial byte offset.
-
- at item end_offset
-Try to limit the request to bytes preceding this offset.
- at end table
-
- at section mmst
-
-MMS (Microsoft Media Server) protocol over TCP.
-
- at section mmsh
-
-MMS (Microsoft Media Server) protocol over HTTP.
-
-The required syntax is:
- at example
-mmsh://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
- at end example
-
- at section md5
-
-MD5 output protocol.
-
-Computes the MD5 hash of the data to be written, and on close writes
-this to the designated output or stdout if none is specified. It can
-be used to test muxers without writing an actual file.
-
-Some examples follow.
- at example
-# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
-avconv -i input.flv -f avi -y md5:output.avi.md5
-
-# Write the MD5 hash of the encoded AVI file to stdout.
-avconv -i input.flv -f avi -y md5:
- at end example
-
-Note that some formats (typically MOV) require the output protocol to
-be seekable, so they will fail with the MD5 output protocol.
-
- at section pipe
-
-UNIX pipe access protocol.
-
-Allow to read and write from UNIX pipes.
-
-The accepted syntax is:
- at example
-pipe:[@var{number}]
- at end example
-
- at var{number} is the number corresponding to the file descriptor of the
-pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If @var{number}
-is not specified, by default the stdout file descriptor will be used
-for writing, stdin for reading.
-
-For example to read from stdin with @command{avconv}:
- at example
-cat test.wav | avconv -i pipe:0
-# ...this is the same as...
-cat test.wav | avconv -i pipe:
- at end example
-
-For writing to stdout with @command{avconv}:
- at example
-avconv -i test.wav -f avi pipe:1 | cat > test.avi
-# ...this is the same as...
-avconv -i test.wav -f avi pipe: | cat > test.avi
- at end example
-
-Note that some formats (typically MOV), require the output protocol to
-be seekable, so they will fail with the pipe output protocol.
-
- at section rtmp
-
-Real-Time Messaging Protocol.
-
-The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
-content across a TCP/IP network.
-
-The required syntax is:
- at example
-rtmp://[@var{username}:@var{password}@@]@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
- at end example
-
-The accepted parameters are:
- at table @option
-
- at item username
-An optional username (mostly for publishing).
-
- at item password
-An optional password (mostly for publishing).
-
- at item server
-The address of the RTMP server.
-
- at item port
-The number of the TCP port to use (by default is 1935).
-
- at item app
-It is the name of the application to access. It usually corresponds to
-the path where the application is installed on the RTMP server
-(e.g. @file{/ondemand/}, @file{/flash/live/}, etc.). You can override
-the value parsed from the URI through the @code{rtmp_app} option, too.
-
- at item playpath
-It is the path or name of the resource to play with reference to the
-application specified in @var{app}, may be prefixed by "mp4:". You
-can override the value parsed from the URI through the @code{rtmp_playpath}
-option, too.
-
- at item listen
-Act as a server, listening for an incoming connection.
-
- at item timeout
-Maximum time to wait for the incoming connection. Implies listen.
- at end table
-
-Additionally, the following parameters can be set via command line options
-(or in code via @code{AVOption}s):
- at table @option
-
- at item rtmp_app
-Name of application to connect on the RTMP server. This option
-overrides the parameter specified in the URI.
-
- at item rtmp_buffer
-Set the client buffer time in milliseconds. The default is 3000.
-
- at item rtmp_conn
-Extra arbitrary AMF connection parameters, parsed from a string,
-e.g. like @code{B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0}.
-Each value is prefixed by a single character denoting the type,
-B for Boolean, N for number, S for string, O for object, or Z for null,
-followed by a colon. For Booleans the data must be either 0 or 1 for
-FALSE or TRUE, respectively.  Likewise for Objects the data must be 0 or
-1 to end or begin an object, respectively. Data items in subobjects may
-be named, by prefixing the type with 'N' and specifying the name before
-the value (i.e. @code{NB:myFlag:1}). This option may be used multiple
-times to construct arbitrary AMF sequences.
-
- at item rtmp_flashver
-Version of the Flash plugin used to run the SWF player. The default
-is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
-<libavformat version>).)
-
- at item rtmp_flush_interval
-Number of packets flushed in the same request (RTMPT only). The default
-is 10.
-
- at item rtmp_live
-Specify that the media is a live stream. No resuming or seeking in
-live streams is possible. The default value is @code{any}, which means the
-subscriber first tries to play the live stream specified in the
-playpath. If a live stream of that name is not found, it plays the
-recorded stream. The other possible values are @code{live} and
- at code{recorded}.
-
- at item rtmp_pageurl
-URL of the web page in which the media was embedded. By default no
-value will be sent.
-
- at item rtmp_playpath
-Stream identifier to play or to publish. This option overrides the
-parameter specified in the URI.
-
- at item rtmp_subscribe
-Name of live stream to subscribe to. By default no value will be sent.
-It is only sent if the option is specified or if rtmp_live
-is set to live.
-
- at item rtmp_swfhash
-SHA256 hash of the decompressed SWF file (32 bytes).
-
- at item rtmp_swfsize
-Size of the decompressed SWF file, required for SWFVerification.
-
- at item rtmp_swfurl
-URL of the SWF player for the media. By default no value will be sent.
-
- at item rtmp_swfverify
-URL to player swf file, compute hash/size automatically.
-
- at item rtmp_tcurl
-URL of the target stream. Defaults to proto://host[:port]/app.
-
- at end table
-
-For example to read with @command{avplay} a multimedia resource named
-"sample" from the application "vod" from an RTMP server "myserver":
- at example
-avplay rtmp://myserver/vod/sample
- at end example
-
-To publish to a password protected server, passing the playpath and
-app names separately:
- at example
-avconv -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@@myserver/
- at end example
-
- at section rtmpe
-
-Encrypted Real-Time Messaging Protocol.
-
-The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
-streaming multimedia content within standard cryptographic primitives,
-consisting of Diffie-Hellman key exchange and HMACSHA256, generating
-a pair of RC4 keys.
-
- at section rtmps
-
-Real-Time Messaging Protocol over a secure SSL connection.
-
-The Real-Time Messaging Protocol (RTMPS) is used for streaming
-multimedia content across an encrypted connection.
-
- at section rtmpt
-
-Real-Time Messaging Protocol tunneled through HTTP.
-
-The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
-for streaming multimedia content within HTTP requests to traverse
-firewalls.
-
- at section rtmpte
-
-Encrypted Real-Time Messaging Protocol tunneled through HTTP.
-
-The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
-is used for streaming multimedia content within HTTP requests to traverse
-firewalls.
-
- at section rtmpts
-
-Real-Time Messaging Protocol tunneled through HTTPS.
-
-The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
-for streaming multimedia content within HTTPS requests to traverse
-firewalls.
-
- at section librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte
-
-Real-Time Messaging Protocol and its variants supported through
-librtmp.
-
-Requires the presence of the librtmp headers and library during
-configuration. You need to explicitly configure the build with
-"--enable-librtmp". If enabled this will replace the native RTMP
-protocol.
-
-This protocol provides most client functions and a few server
-functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
-encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
-variants of these encrypted types (RTMPTE, RTMPTS).
-
-The required syntax is:
- at example
- at var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options}
- at end example
-
-where @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe",
-"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
- at var{server}, @var{port}, @var{app} and @var{playpath} have the same
-meaning as specified for the RTMP native protocol.
- at var{options} contains a list of space-separated options of the form
- at var{key}=@var{val}.
-
-See the librtmp manual page (man 3 librtmp) for more information.
-
-For example, to stream a file in real-time to an RTMP server using
- at command{avconv}:
- at example
-avconv -re -i myfile -f flv rtmp://myserver/live/mystream
- at end example
-
-To play the same stream using @command{avplay}:
- at example
-avplay "rtmp://myserver/live/mystream live=1"
- at end example
-
- at section rtp
-
-Real-Time Protocol.
-
- at section rtsp
-
-RTSP is not technically a protocol handler in libavformat, it is a demuxer
-and muxer. The demuxer supports both normal RTSP (with data transferred
-over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
-data transferred over RDT).
-
-The muxer can be used to send a stream using RTSP ANNOUNCE to a server
-supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
- at uref{http://github.com/revmischa/rtsp-server, RTSP server}).
-
-The required syntax for a RTSP url is:
- at example
-rtsp://@var{hostname}[:@var{port}]/@var{path}
- at end example
-
-The following options (set on the @command{avconv}/@command{avplay} command
-line, or set in code via @code{AVOption}s or in @code{avformat_open_input}),
-are supported:
-
-Flags for @code{rtsp_transport}:
-
- at table @option
-
- at item udp
-Use UDP as lower transport protocol.
-
- at item tcp
-Use TCP (interleaving within the RTSP control channel) as lower
-transport protocol.
-
- at item udp_multicast
-Use UDP multicast as lower transport protocol.
-
- at item http
-Use HTTP tunneling as lower transport protocol, which is useful for
-passing proxies.
- at end table
-
-Multiple lower transport protocols may be specified, in that case they are
-tried one at a time (if the setup of one fails, the next one is tried).
-For the muxer, only the @code{tcp} and @code{udp} options are supported.
-
-Flags for @code{rtsp_flags}:
-
- at table @option
- at item filter_src
-Accept packets only from negotiated peer address and port.
- at item listen
-Act as a server, listening for an incoming connection.
- at end table
-
-When receiving data over UDP, the demuxer tries to reorder received packets
-(since they may arrive out of order, or packets may get lost totally). This
-can be disabled by setting the maximum demuxing delay to zero (via
-the @code{max_delay} field of AVFormatContext).
-
-When watching multi-bitrate Real-RTSP streams with @command{avplay}, the
-streams to display can be chosen with @code{-vst} @var{n} and
- at code{-ast} @var{n} for video and audio respectively, and can be switched
-on the fly by pressing @code{v} and @code{a}.
-
-Example command lines:
-
-To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
-
- at example
-avplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
- at end example
-
-To watch a stream tunneled over HTTP:
-
- at example
-avplay -rtsp_transport http rtsp://server/video.mp4
- at end example
-
-To send a stream in realtime to a RTSP server, for others to watch:
-
- at example
-avconv -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
- at end example
-
-To receive a stream in realtime:
-
- at example
-avconv -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output}
- at end example
-
- at section sap
-
-Session Announcement Protocol (RFC 2974). This is not technically a
-protocol handler in libavformat, it is a muxer and demuxer.
-It is used for signalling of RTP streams, by announcing the SDP for the
-streams regularly on a separate port.
-
- at subsection Muxer
-
-The syntax for a SAP url given to the muxer is:
- at example
-sap://@var{destination}[:@var{port}][?@var{options}]
- at end example
-
-The RTP packets are sent to @var{destination} on port @var{port},
-or to port 5004 if no port is specified.
- at var{options} is a @code{&}-separated list. The following options
-are supported:
-
- at table @option
-
- at item announce_addr=@var{address}
-Specify the destination IP address for sending the announcements to.
-If omitted, the announcements are sent to the commonly used SAP
-announcement multicast address 224.2.127.254 (sap.mcast.net), or
-ff0e::2:7ffe if @var{destination} is an IPv6 address.
-
- at item announce_port=@var{port}
-Specify the port to send the announcements on, defaults to
-9875 if not specified.
-
- at item ttl=@var{ttl}
-Specify the time to live value for the announcements and RTP packets,
-defaults to 255.
-
- at item same_port=@var{0|1}
-If set to 1, send all RTP streams on the same port pair. If zero (the
-default), all streams are sent on unique ports, with each stream on a
-port 2 numbers higher than the previous.
-VLC/Live555 requires this to be set to 1, to be able to receive the stream.
-The RTP stack in libavformat for receiving requires all streams to be sent
-on unique ports.
- at end table
-
-Example command lines follow.
-
-To broadcast a stream on the local subnet, for watching in VLC:
-
- at example
-avconv -re -i @var{input} -f sap sap://224.0.0.255?same_port=1
- at end example
-
-Similarly, for watching in avplay:
-
- at example
-avconv -re -i @var{input} -f sap sap://224.0.0.255
- at end example
-
-And for watching in avplay, over IPv6:
-
- at example
-avconv -re -i @var{input} -f sap sap://[ff0e::1:2:3:4]
- at end example
-
- at subsection Demuxer
-
-The syntax for a SAP url given to the demuxer is:
- at example
-sap://[@var{address}][:@var{port}]
- at end example
-
- at var{address} is the multicast address to listen for announcements on,
-if omitted, the default 224.2.127.254 (sap.mcast.net) is used. @var{port}
-is the port that is listened on, 9875 if omitted.
-
-The demuxers listens for announcements on the given address and port.
-Once an announcement is received, it tries to receive that particular stream.
-
-Example command lines follow.
-
-To play back the first stream announced on the normal SAP multicast address:
-
- at example
-avplay sap://
- at end example
-
-To play back the first stream announced on one the default IPv6 SAP multicast address:
-
- at example
-avplay sap://[ff0e::2:7ffe]
- at end example
-
- at section tcp
-
-Trasmission Control Protocol.
-
-The required syntax for a TCP url is:
- at example
-tcp://@var{hostname}:@var{port}[?@var{options}]
- at end example
-
- at table @option
-
- at item listen
-Listen for an incoming connection
-
- at example
-avconv -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen
-avplay tcp://@var{hostname}:@var{port}
- at end example
-
- at end table
-
- at section tls
-
-Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
-
-The required syntax for a TLS url is:
- at example
-tls://@var{hostname}:@var{port}
- at end example
-
-The following parameters can be set via command line options
-(or in code via @code{AVOption}s):
-
- at table @option
-
- at item ca_file
-A file containing certificate authority (CA) root certificates to treat
-as trusted. If the linked TLS library contains a default this might not
-need to be specified for verification to work, but not all libraries and
-setups have defaults built in.
-
- at item tls_verify=@var{1|0}
-If enabled, try to verify the peer that we are communicating with.
-Note, if using OpenSSL, this currently only makes sure that the
-peer certificate is signed by one of the root certificates in the CA
-database, but it does not validate that the certificate actually
-matches the host name we are trying to connect to. (With GnuTLS,
-the host name is validated as well.)
-
-This is disabled by default since it requires a CA database to be
-provided by the caller in many cases.
-
- at item cert_file
-A file containing a certificate to use in the handshake with the peer.
-(When operating as server, in listen mode, this is more often required
-by the peer, while client certificates only are mandated in certain
-setups.)
-
- at item key_file
-A file containing the private key for the certificate.
-
- at item listen=@var{1|0}
-If enabled, listen for connections on the provided port, and assume
-the server role in the handshake instead of the client role.
-
- at end table
-
- at section udp
-
-User Datagram Protocol.
-
-The required syntax for a UDP url is:
- at example
-udp://@var{hostname}:@var{port}[?@var{options}]
- at end example
-
- at var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
-Follow the list of supported options.
-
- at table @option
-
- at item buffer_size=@var{size}
-set the UDP buffer size in bytes
-
- at item localport=@var{port}
-override the local UDP port to bind with
-
- at item localaddr=@var{addr}
-Choose the local IP address. This is useful e.g. if sending multicast
-and the host has multiple interfaces, where the user can choose
-which interface to send on by specifying the IP address of that interface.
-
- at item pkt_size=@var{size}
-set the size in bytes of UDP packets
-
- at item reuse=@var{1|0}
-explicitly allow or disallow reusing UDP sockets
-
- at item ttl=@var{ttl}
-set the time to live value (for multicast only)
-
- at item connect=@var{1|0}
-Initialize the UDP socket with @code{connect()}. In this case, the
-destination address can't be changed with ff_udp_set_remote_url later.
-If the destination address isn't known at the start, this option can
-be specified in ff_udp_set_remote_url, too.
-This allows finding out the source address for the packets with getsockname,
-and makes writes return with AVERROR(ECONNREFUSED) if "destination
-unreachable" is received.
-For receiving, this gives the benefit of only receiving packets from
-the specified peer address/port.
-
- at item sources=@var{address}[, at var{address}]
-Only receive packets sent to the multicast group from one of the
-specified sender IP addresses.
-
- at item block=@var{address}[, at var{address}]
-Ignore packets sent to the multicast group from the specified
-sender IP addresses.
- at end table
-
-Some usage examples of the udp protocol with @command{avconv} follow.
-
-To stream over UDP to a remote endpoint:
- at example
-avconv -i @var{input} -f @var{format} udp://@var{hostname}:@var{port}
- at end example
-
-To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
- at example
-avconv -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535
- at end example
-
-To receive over UDP from a remote endpoint:
- at example
-avconv -i udp://[@var{multicast-address}]:@var{port}
- at end example
-
- at section unix
-
-Unix local socket
-
-The required syntax for a Unix socket URL is:
-
- at example
-unix://@var{filepath}
- at end example
-
-The following parameters can be set via command line options
-(or in code via @code{AVOption}s):
-
- at table @option
- at item timeout
-Timeout in ms.
- at item listen
-Create the Unix socket in listening mode.
- at end table
-
- at c man end PROTOCOLS
diff --git a/deps/libav/doc/rate_distortion.txt b/deps/libav/doc/rate_distortion.txt
deleted file mode 100644
index e9711c2..0000000
--- a/deps/libav/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 chosen 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/deps/libav/doc/soc.txt b/deps/libav/doc/soc.txt
deleted file mode 100644
index 89728b5..0000000
--- a/deps/libav/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 Libav, to reach this goal, code must
-* conform to the development policy and patch submission guidelines
-* must improve Libav 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 git
-* separation of cosmetic from non-cosmetic changes (this is almost entirely
-  ignored by mentors and students in soc 2006 which might lead to a surprise
-  when the code will be reviewed at the end before a possible inclusion in
-  Libav, individual changes were generally not reviewable due to cosmetics).
-* frequent commits, so that comments can be provided early
diff --git a/deps/libav/doc/swscale.txt b/deps/libav/doc/swscale.txt
deleted file mode 100644
index 2066009..0000000
--- a/deps/libav/doc/swscale.txt
+++ /dev/null
@@ -1,98 +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 MMXEXT 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/deps/libav/doc/t2h.init b/deps/libav/doc/t2h.init
deleted file mode 100644
index a42637a..0000000
--- a/deps/libav/doc/t2h.init
+++ /dev/null
@@ -1,230 +0,0 @@
-# no horiz rules between sections
-$end_section = \&Libav_end_section;
-sub Libav_end_section($$)
-{
-}
-
-$EXTRA_HEAD =
-'<link rel="icon" href="favicon.png" type="image/png" />
-';
-
-$CSS_LINES = $ENV{"LIBAV_CSS"} || <<EOT;
-<style type="text/css">
-<!--
-.container {
-  margin-right: auto;
-  margin-left: auto;
-  width: 1070px;
-}
-body {
-  font-size: 14px;
-  line-height: 20px;
-  color: #333333;
-  background-color: #ffffff;
-}
-a {
-  color: #0088cc;
-  text-decoration: none;
-}
-a:hover {
-  color: #005580;
-  text-decoration: underline;
-}
-p {
-  margin: 0 0 10px;
-}
-h2,
-h3,
-h4 {
-  margin: 10px 0;
-  font-family: inherit;
-  font-weight: bold;
-  line-height: 1;
-  border-color: #D6E9C6;
-  color: #468847;
-  border-style: solid;
-  border-width: 0 0 1px;
-  padding-left: 0.5em;
-}
-
-h1 a,
-h2 a,
-h3 a,
-h4 a {
-  color: inherit;
-}
-h1 {
-  font-size: 30px;
-  line-height: 40px;
-}
-h2 {
-  font-size: 20px;
-  line-height: 40px;
-}
-h3 {
-  font-size: 18px;
-  line-height: 40px;
-}
-code,
-pre {
-  padding: 0 3px 2px;
-  font-family: monospace;
-  font-size: 12px;
-  color: #333333;
-  border-radius: 3px;
-}
-pre {
-  display: block;
-  padding: 9.5px;
-  margin: 0 0 10px;
-  font-size: 13px;
-  line-height: 20px;
-  word-break: break-all;
-  word-wrap: break-word;
-  white-space: pre;
-  white-space: pre-wrap;
-  background-color: #f5f5f5;
-  border: 1px solid #ccc;
-  border-radius: 4px;
-}
-
-code {
-  padding: 2px 4px;
-  color: #d14;
-  background-color: #f7f7f9;
-  border: 1px solid #e1e1e8;
-}
-pre code {
-  padding: 0;
-  color: inherit;
-  background-color: transparent;
-  border: 0;
-}
-.alert {
-  padding: 8px 35px 8px 14px;
-  margin-bottom: 20px;
-  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-  background-color: #fcf8e3;
-  border: 1px solid #fbeed5;
-  border-radius: 4px;
-  color: #c09853;
-}
-
-.alert-danger,
-.alert-error {
-  background-color: #f2dede;
-  border-color: #eed3d7;
-  color: #b94a48;
-}
-.alert-info {
-  background-color: #d9edf7;
-  border-color: #bce8f1;
-  color: #3a87ad;
-}
-
-ul.toc {
-  list-style-type: none;
-}
--->
-</style>
-EOT
-
-my $TEMPLATE_HEADER = $ENV{"LIBAV_HEADER"} || <<EOT;
-<link rel="icon" href="favicon.png" type="image/png" />
-</head>
-<body>
-<div class="container">
-EOT
-
-$PRE_BODY_CLOSE = '</div></div>';
-
-$SMALL_RULE = '';
-$BODYTEXT = '';
-
-$print_page_foot = \&Libav_print_page_foot;
-sub Libav_print_page_foot($$)
-{
-    my $fh = shift;
-    my $program_string = defined &T2H_DEFAULT_program_string ?
-        T2H_DEFAULT_program_string() : program_string();
-    print $fh '<footer class="footer pagination-right">' . "\n";
-    print $fh '<span class="label label-info">' . $program_string;
-    print $fh "</span></footer></div>\n";
-}
-
-$float = \&Libav_float;
-
-sub Libav_float($$$$)
-{
-    my $text = shift;
-    my $float = shift;
-    my $caption = shift;
-    my $shortcaption = shift;
-
-    my $label = '';
-    if (exists($float->{'id'}))
-    {
-        $label = &$anchor($float->{'id'});
-    }
-    my $class = '';
-    my $subject = '';
-
-    if ($caption =~ /NOTE/)
-    {
-        $class = "alert alert-info";
-    }
-    elsif ($caption =~ /IMPORTANT/)
-    {
-        $class = "alert alert-warning";
-    }
-
-    return '<div class="float ' . $class . '">' . "$label\n" . $text . '</div>';
-}
-
-$print_page_head = \&Libav_print_page_head;
-sub Libav_print_page_head($$)
-{
-    my $fh = shift;
-    my $longtitle = "$Texi2HTML::THISDOC{'fulltitle_no_texi'}";
-    $longtitle .= ": $Texi2HTML::NO_TEXI{'This'}" if exists $Texi2HTML::NO_TEXI{'This'};
-    my $description = $DOCUMENT_DESCRIPTION;
-    $description = $longtitle if (!defined($description));
-    $description = "<meta name=\"description\" content=\"$description\">" if
-         ($description ne '');
-    $description = $Texi2HTML::THISDOC{'documentdescription'} if (defined($Texi2HTML::THISDOC{'documentdescription'}));
-    my $encoding = '';
-    $encoding = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$ENCODING\">" if (defined($ENCODING) and ($ENCODING ne ''));
-    $longtitle =~ s/Documentation.*//g;
-    $longtitle = "Libav documentation : " . $longtitle;
-
-    print $fh <<EOT;
-<!DOCTYPE html>
-<html>
-$Texi2HTML::THISDOC{'copying'}<!-- Created on $Texi2HTML::THISDOC{today} by $Texi2HTML::THISDOC{program} -->
-<!--
-$Texi2HTML::THISDOC{program_authors}
--->
-<head>
-<title>$longtitle</title>
-
-$description
-<meta name="keywords" content="$longtitle">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="$Texi2HTML::THISDOC{program}">
-$encoding
-$CSS_LINES
-$TEMPLATE_HEADER
-EOT
-}
-
-# no navigation elements
-$SECTION_NAVIGATION = 0;
-# the same for texi2html 5.0
-$HEADERS = 0;
-
-# TOC and Chapter headings link
-$TOC_LINKS = 1;
-
-# print the TOC where @contents is used
-$INLINE_CONTENTS = 1;
diff --git a/deps/libav/doc/tablegen.txt b/deps/libav/doc/tablegen.txt
deleted file mode 100644
index 4c4f036..0000000
--- a/deps/libav/doc/tablegen.txt
+++ /dev/null
@@ -1,70 +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.
-This means that e.g. libavutil/mathematics.h is ok but libavutil/libm.h is not.
-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_t_array(my_array, 100);
-    printf("};\n");
-
-This is the more generic form, in case you need to do something special.
-Usually you should instead use the short form:
-    write_fileheader();
-    WRITE_ARRAY("static const", uint8_t, my_array);
-
-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/deps/libav/doc/texi2pod.pl b/deps/libav/doc/texi2pod.pl
deleted file mode 100755
index fb4f7be..0000000
--- a/deps/libav/doc/texi2pod.pl
+++ /dev/null
@@ -1,448 +0,0 @@
-#!/usr/bin/env perl
-
-#   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.
-
-use warnings;
-
-$output = 0;
-$skipping = 0;
-%sects = ();
- at sects_sequence = ();
-$section = "";
- at icstack = ();
- at endwstack = ();
- at skstack = ();
- at instack = ();
-$shift = "";
-%defs = ();
-$fnno = 1;
-$inf = "";
- at 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 (/^-I(.*)$/) {
-        push @ibase, $1 ne "" ? $1 : shift;
-    } elsif (/^-/) {
-        usage();
-    } else {
-        $in = $_, next unless defined $in;
-        $out = $_, next unless defined $out;
-        usage();
-    }
-}
-
-push @ibase, ".";
-
-if (defined $in) {
-    $inf = gensym();
-    open($inf, "<$in") or die "opening \"$in\": $!\n";
-    push @ibase, $1 if $in =~ m|^(.+)/[^/]+$|;
-} else {
-    $inf = \*STDIN;
-}
-
-if (defined $out) {
-    open(STDOUT, ">$out") or die "opening \"$out\": $!\n";
-}
-
-while(defined $inf) {
-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;
-    };
-
-    /^\@include\s+(.+)$/ and do {
-        push @instack, $inf;
-        $inf = gensym();
-
-        for (@ibase) {
-            open($inf, "<" . $_ . "/" . $1) and next INF;
-        }
-        die "cannot open $1: $!\n";
-    };
-
-    # 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-Za-z ]+)/ and $sect = $1, push (@sects_sequence, $sect), $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|(?:multi|[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/&/&/g;
-    s/\@\{/{/g;
-    s/\@\}/}/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/</</g;
-        s/>/>/g;
-    } else {
-        s/</</g;
-        s/>/>/g;
-    }
-
-    # Single line command handlers.
-
-    /^\@(?:section|unnumbered|unnumberedsec|center|heading)\s+(.+)$/
-        and $_ = "\n=head2 $1\n";
-    /^\@(?:subsection|subheading)\s+(.+)$/
-        and $_ = "\n=head3 $1\n";
-    /^\@(?:subsubsection|subsubheading)\s+(.+)$/
-        and $_ = "\n=head4 $1\n";
-
-    # Block command handlers:
-    /^\@itemize\s*(\@[a-z]+|\*|-)?/ and do {
-        push @endwstack, $endw;
-        push @icstack, $ic;
-        $ic = $1 ? $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";
-    };
-
-    /^\@((?:multi|[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/;
-        $ic =~ s/\@(?:columnfractions)//;
-        $_ = "\n=over 4\n";
-    };
-
-    /^\@((?:small)?example|display)/ and do {
-        push @endwstack, $endw;
-        $endw = $1;
-        $shift = "\t";
-        $_ = "";        # need a paragraph break
-    };
-
-    /^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
-        my $columns = $1;
-        $columns =~ s/\@tab/ : /;
-
-        $_ = "\n=item B<". $columns .">\n";
-    };
-
-    /^\@tab\s+(.*\S)\s*$/ and $endw eq "multitable" and do {
-        my $columns = $1;
-        $columns =~ s/\@tab/ : /;
-
-        $_ = " : ". $columns;
-        $section =~ s/\n+\s+$//;
-    };
-
-    /^\@itemx?\s*(.+)?$/ and do {
-        if (defined $1) {
-            # Entity escapes prevent munging by the <> processing below.
-            $_ = "\n=item $ic\<$1\>\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};
-
-unshift @sects_sequence, "NAME";
-for $sect (@sects_sequence) {
-    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/\@anchor{(?:[^\}]*)\}//g;
-    s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
-    s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
-    s/;\s+\@pxref\{(?:[^\}]*)\}//g;
-    s/\@ref\{([^\}]*)\}/$1/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)\{([^\},]*)\}/<B<$1>>/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/</</g;
-    s/>/>/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/</E<lt>/g;
-    s/>/E<gt>/g;
-    s/{/\{/g;
-    s/}/\}/g;
-    s/&at;/\@/g;
-    s/&/&/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/deps/libav/doc/viterbi.txt b/deps/libav/doc/viterbi.txt
deleted file mode 100644
index 9782546..0000000
--- a/deps/libav/doc/viterbi.txt
+++ /dev/null
@@ -1,109 +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 paths and scores for each point of our new column is
-trivial given we know the previous column best paths 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/deps/libav/libavcodec/4xm.c b/deps/libav/libavcodec/4xm.c
deleted file mode 100644
index 687fb89..0000000
--- a/deps/libav/libavcodec/4xm.c
+++ /dev/null
@@ -1,976 +0,0 @@
-/*
- * 4XM codec
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * 4XM codec.
- */
-
-#include "libavutil/frame.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "internal.h"
-
-#define BLOCK_TYPE_VLC_BITS 5
-#define ACDC_VLC_BITS 9
-
-#define CFRAME_BUFFER_COUNT 100
-
-static const uint8_t block_type_tab[2][4][8][2] = {
-    {
-        {    // { 8, 4, 2 } x { 8, 4, 2}
-            { 0, 1 }, { 2, 2 }, { 6, 3 }, { 14, 4 }, { 30, 5 }, { 31, 5 }, { 0, 0 }
-        }, { // { 8, 4 } x 1
-            { 0, 1 }, { 0, 0 }, { 2, 2 }, { 6, 3 }, { 14, 4 }, { 15, 4 }, { 0, 0 }
-        }, { // 1 x { 8, 4 }
-            { 0, 1 }, { 2, 2 }, { 0, 0 }, { 6, 3 }, { 14, 4 }, { 15, 4 }, { 0, 0 }
-        }, { // 1 x 2, 2 x 1
-            { 0, 1 }, { 0, 0 }, { 0, 0 }, { 2, 2 }, { 6, 3 }, { 14, 4 }, { 15, 4 }
-        }
-    }, {
-        {   // { 8, 4, 2 } x { 8, 4, 2}
-            { 1, 2 }, { 4, 3 }, { 5, 3 }, { 0, 2 }, { 6, 3 }, { 7, 3 }, { 0, 0 }
-        }, {// { 8, 4 } x 1
-            { 1, 2 }, { 0, 0 }, { 2, 2 }, { 0, 2 }, { 6, 3 }, { 7, 3 }, { 0, 0 }
-        }, {// 1 x { 8, 4 }
-            { 1, 2 }, { 2, 2 }, { 0, 0 }, { 0, 2 }, { 6, 3 }, { 7, 3 }, { 0, 0 }
-        }, {// 1 x 2, 2 x 1
-            { 1, 2 }, { 0, 0 }, { 0, 0 }, { 0, 2 }, { 2, 2 }, { 6, 3 }, { 7, 3 }
-      }
-    }
-};
-
-static const uint8_t size2index[4][4] = {
-    { -1, 3, 1, 1 },
-    {  3, 0, 0, 0 },
-    {  2, 0, 0, 0 },
-    {  2, 0, 0, 0 },
-};
-
-static const int8_t mv[256][2] = {
-    {   0,   0 }, {   0,  -1 }, {  -1,   0 }, {   1,   0 }, {   0,   1 }, {  -1,  -1 }, {   1,  -1 }, {  -1,   1 },
-    {   1,   1 }, {   0,  -2 }, {  -2,   0 }, {   2,   0 }, {   0,   2 }, {  -1,  -2 }, {   1,  -2 }, {  -2,  -1 },
-    {   2,  -1 }, {  -2,   1 }, {   2,   1 }, {  -1,   2 }, {   1,   2 }, {  -2,  -2 }, {   2,  -2 }, {  -2,   2 },
-    {   2,   2 }, {   0,  -3 }, {  -3,   0 }, {   3,   0 }, {   0,   3 }, {  -1,  -3 }, {   1,  -3 }, {  -3,  -1 },
-    {   3,  -1 }, {  -3,   1 }, {   3,   1 }, {  -1,   3 }, {   1,   3 }, {  -2,  -3 }, {   2,  -3 }, {  -3,  -2 },
-    {   3,  -2 }, {  -3,   2 }, {   3,   2 }, {  -2,   3 }, {   2,   3 }, {   0,  -4 }, {  -4,   0 }, {   4,   0 },
-    {   0,   4 }, {  -1,  -4 }, {   1,  -4 }, {  -4,  -1 }, {   4,  -1 }, {   4,   1 }, {  -1,   4 }, {   1,   4 },
-    {  -3,  -3 }, {  -3,   3 }, {   3,   3 }, {  -2,  -4 }, {  -4,  -2 }, {   4,  -2 }, {  -4,   2 }, {  -2,   4 },
-    {   2,   4 }, {  -3,  -4 }, {   3,  -4 }, {   4,  -3 }, {  -5,   0 }, {  -4,   3 }, {  -3,   4 }, {   3,   4 },
-    {  -1,  -5 }, {  -5,  -1 }, {  -5,   1 }, {  -1,   5 }, {  -2,  -5 }, {   2,  -5 }, {   5,  -2 }, {   5,   2 },
-    {  -4,  -4 }, {  -4,   4 }, {  -3,  -5 }, {  -5,  -3 }, {  -5,   3 }, {   3,   5 }, {  -6,   0 }, {   0,   6 },
-    {  -6,  -1 }, {  -6,   1 }, {   1,   6 }, {   2,  -6 }, {  -6,   2 }, {   2,   6 }, {  -5,  -4 }, {   5,   4 },
-    {   4,   5 }, {  -6,  -3 }, {   6,   3 }, {  -7,   0 }, {  -1,  -7 }, {   5,  -5 }, {  -7,   1 }, {  -1,   7 },
-    {   4,  -6 }, {   6,   4 }, {  -2,  -7 }, {  -7,   2 }, {  -3,  -7 }, {   7,  -3 }, {   3,   7 }, {   6,  -5 },
-    {   0,  -8 }, {  -1,  -8 }, {  -7,  -4 }, {  -8,   1 }, {   4,   7 }, {   2,  -8 }, {  -2,   8 }, {   6,   6 },
-    {  -8,   3 }, {   5,  -7 }, {  -5,   7 }, {   8,  -4 }, {   0,  -9 }, {  -9,  -1 }, {   1,   9 }, {   7,  -6 },
-    {  -7,   6 }, {  -5,  -8 }, {  -5,   8 }, {  -9,   3 }, {   9,  -4 }, {   7,  -7 }, {   8,  -6 }, {   6,   8 },
-    {  10,   1 }, { -10,   2 }, {   9,  -5 }, {  10,  -3 }, {  -8,  -7 }, { -10,  -4 }, {   6,  -9 }, { -11,   0 },
-    {  11,   1 }, { -11,  -2 }, {  -2,  11 }, {   7,  -9 }, {  -7,   9 }, {  10,   6 }, {  -4,  11 }, {   8,  -9 },
-    {   8,   9 }, {   5,  11 }, {   7, -10 }, {  12,  -3 }, {  11,   6 }, {  -9,  -9 }, {   8,  10 }, {   5,  12 },
-    { -11,   7 }, {  13,   2 }, {   6, -12 }, {  10,   9 }, { -11,   8 }, {  -7,  12 }, {   0,  14 }, {  14,  -2 },
-    {  -9,  11 }, {  -6,  13 }, { -14,  -4 }, {  -5, -14 }, {   5,  14 }, { -15,  -1 }, { -14,  -6 }, {   3, -15 },
-    {  11, -11 }, {  -7,  14 }, {  -5,  15 }, {   8, -14 }, {  15,   6 }, {   3,  16 }, {   7, -15 }, { -16,   5 },
-    {   0,  17 }, { -16,  -6 }, { -10,  14 }, { -16,   7 }, {  12,  13 }, { -16,   8 }, { -17,   6 }, { -18,   3 },
-    {  -7,  17 }, {  15,  11 }, {  16,  10 }, {   2, -19 }, {   3, -19 }, { -11, -16 }, { -18,   8 }, { -19,  -6 },
-    {   2, -20 }, { -17, -11 }, { -10, -18 }, {   8,  19 }, { -21,  -1 }, { -20,   7 }, {  -4,  21 }, {  21,   5 },
-    {  15,  16 }, {   2, -22 }, { -10, -20 }, { -22,   5 }, {  20, -11 }, {  -7, -22 }, { -12,  20 }, {  23,  -5 },
-    {  13, -20 }, {  24,  -2 }, { -15,  19 }, { -11,  22 }, {  16,  19 }, {  23, -10 }, { -18, -18 }, {  -9, -24 },
-    {  24, -10 }, {  -3,  26 }, { -23,  13 }, { -18, -20 }, {  17,  21 }, {  -4,  27 }, {  27,   6 }, {   1, -28 },
-    { -11,  26 }, { -17, -23 }, {   7,  28 }, {  11, -27 }, {  29,   5 }, { -23, -19 }, { -28, -11 }, { -21,  22 },
-    { -30,   7 }, { -17,  26 }, { -27,  16 }, {  13,  29 }, {  19, -26 }, {  10, -31 }, { -14, -30 }, {  20, -27 },
-    { -29,  18 }, { -16, -31 }, { -28, -22 }, {  21, -30 }, { -25,  28 }, {  26, -29 }, {  25, -32 }, { -32, -32 }
-};
-
-/* This is simply the scaled down elementwise product of the standard JPEG
- * quantizer table and the AAN premul table. */
-static const uint8_t dequant_table[64] = {
-    16, 15, 13, 19, 24, 31, 28, 17,
-    17, 23, 25, 31, 36, 63, 45, 21,
-    18, 24, 27, 37, 52, 59, 49, 20,
-    16, 28, 34, 40, 60, 80, 51, 20,
-    18, 31, 48, 66, 68, 86, 56, 21,
-    19, 38, 56, 59, 64, 64, 48, 20,
-    27, 48, 55, 55, 56, 51, 35, 15,
-    20, 35, 34, 32, 31, 22, 15,  8,
-};
-
-static VLC block_type_vlc[2][4];
-
-
-typedef struct CFrameBuffer {
-    unsigned int allocated_size;
-    unsigned int size;
-    int id;
-    uint8_t *data;
-} CFrameBuffer;
-
-typedef struct FourXContext {
-    AVCodecContext *avctx;
-    DSPContext dsp;
-    uint16_t *frame_buffer;
-    uint16_t *last_frame_buffer;
-    GetBitContext pre_gb;          ///< ac/dc prefix
-    GetBitContext gb;
-    GetByteContext g;
-    GetByteContext g2;
-    int mv[256];
-    VLC pre_vlc;
-    int last_dc;
-    DECLARE_ALIGNED(16, int16_t, block)[6][64];
-    void *bitstream_buffer;
-    unsigned int bitstream_buffer_size;
-    int version;
-    CFrameBuffer cfrm[CFRAME_BUFFER_COUNT];
-} FourXContext;
-
-
-#define FIX_1_082392200  70936
-#define FIX_1_414213562  92682
-#define FIX_1_847759065 121095
-#define FIX_2_613125930 171254
-
-#define MULTIPLY(var, const) (((var) * (const)) >> 16)
-
-static void idct(int16_t block[64])
-{
-    int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-    int tmp10, tmp11, tmp12, tmp13;
-    int z5, z10, z11, z12, z13;
-    int i;
-    int temp[64];
-
-    for (i = 0; i < 8; i++) {
-        tmp10 = block[8 * 0 + i] + block[8 * 4 + i];
-        tmp11 = block[8 * 0 + i] - block[8 * 4 + i];
-
-        tmp13 = block[8 * 2 + i] + block[8 * 6 + i];
-        tmp12 = MULTIPLY(block[8 * 2 + i] - block[8 * 6 + i], FIX_1_414213562) - tmp13;
-
-        tmp0 = tmp10 + tmp13;
-        tmp3 = tmp10 - tmp13;
-        tmp1 = tmp11 + tmp12;
-        tmp2 = tmp11 - tmp12;
-
-        z13 = block[8 * 5 + i] + block[8 * 3 + i];
-        z10 = block[8 * 5 + i] - block[8 * 3 + i];
-        z11 = block[8 * 1 + i] + block[8 * 7 + i];
-        z12 = block[8 * 1 + i] - block[8 * 7 + i];
-
-        tmp7  =          z11 + z13;
-        tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);
-
-        z5    = MULTIPLY(z10 + z12, FIX_1_847759065);
-        tmp10 = MULTIPLY(z12,  FIX_1_082392200) - z5;
-        tmp12 = MULTIPLY(z10, -FIX_2_613125930) + z5;
-
-        tmp6 = tmp12 - tmp7;
-        tmp5 = tmp11 - tmp6;
-        tmp4 = tmp10 + tmp5;
-
-        temp[8 * 0 + i] = tmp0 + tmp7;
-        temp[8 * 7 + i] = tmp0 - tmp7;
-        temp[8 * 1 + i] = tmp1 + tmp6;
-        temp[8 * 6 + i] = tmp1 - tmp6;
-        temp[8 * 2 + i] = tmp2 + tmp5;
-        temp[8 * 5 + i] = tmp2 - tmp5;
-        temp[8 * 4 + i] = tmp3 + tmp4;
-        temp[8 * 3 + i] = tmp3 - tmp4;
-    }
-
-    for (i = 0; i < 8 * 8; i += 8) {
-        tmp10 = temp[0 + i] + temp[4 + i];
-        tmp11 = temp[0 + i] - temp[4 + i];
-
-        tmp13 = temp[2 + i] + temp[6 + i];
-        tmp12 = MULTIPLY(temp[2 + i] - temp[6 + i], FIX_1_414213562) - tmp13;
-
-        tmp0 = tmp10 + tmp13;
-        tmp3 = tmp10 - tmp13;
-        tmp1 = tmp11 + tmp12;
-        tmp2 = tmp11 - tmp12;
-
-        z13 = temp[5 + i] + temp[3 + i];
-        z10 = temp[5 + i] - temp[3 + i];
-        z11 = temp[1 + i] + temp[7 + i];
-        z12 = temp[1 + i] - temp[7 + i];
-
-        tmp7  = z11 + z13;
-        tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);
-
-        z5    = MULTIPLY(z10 + z12, FIX_1_847759065);
-        tmp10 = MULTIPLY(z12,  FIX_1_082392200) - z5;
-        tmp12 = MULTIPLY(z10, -FIX_2_613125930) + z5;
-
-        tmp6 = tmp12 - tmp7;
-        tmp5 = tmp11 - tmp6;
-        tmp4 = tmp10 + tmp5;
-
-        block[0 + i] = (tmp0 + tmp7) >> 6;
-        block[7 + i] = (tmp0 - tmp7) >> 6;
-        block[1 + i] = (tmp1 + tmp6) >> 6;
-        block[6 + i] = (tmp1 - tmp6) >> 6;
-        block[2 + i] = (tmp2 + tmp5) >> 6;
-        block[5 + i] = (tmp2 - tmp5) >> 6;
-        block[4 + i] = (tmp3 + tmp4) >> 6;
-        block[3 + i] = (tmp3 - tmp4) >> 6;
-    }
-}
-
-static av_cold void init_vlcs(FourXContext *f)
-{
-    static VLC_TYPE table[2][4][32][2];
-    int i, j;
-
-    for (i = 0; i < 2; i++) {
-        for (j = 0; j < 4; j++) {
-            block_type_vlc[i][j].table           = table[i][j];
-            block_type_vlc[i][j].table_allocated = 32;
-            init_vlc(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7,
-                     &block_type_tab[i][j][0][1], 2, 1,
-                     &block_type_tab[i][j][0][0], 2, 1,
-                     INIT_VLC_USE_NEW_STATIC);
-        }
-    }
-}
-
-static void init_mv(FourXContext *f, int linesize)
-{
-    int i;
-
-    for (i = 0; i < 256; i++) {
-        if (f->version > 1)
-            f->mv[i] = mv[i][0] + mv[i][1] * linesize / 2;
-        else
-            f->mv[i] = (i & 15) - 8 + ((i >> 4) - 8) * linesize / 2;
-    }
-}
-
-#if HAVE_BIGENDIAN
-#define LE_CENTRIC_MUL(dst, src, scale, dc)             \
-    {                                                   \
-        unsigned tmpval = AV_RN32(src);                 \
-        tmpval = (tmpval << 16) | (tmpval >> 16);       \
-        tmpval = tmpval * (scale) + (dc);               \
-        tmpval = (tmpval << 16) | (tmpval >> 16);       \
-        AV_WN32A(dst, tmpval);                          \
-    }
-#else
-#define LE_CENTRIC_MUL(dst, src, scale, dc)              \
-    {                                                    \
-        unsigned tmpval = AV_RN32(src) * (scale) + (dc); \
-        AV_WN32A(dst, tmpval);                           \
-    }
-#endif
-
-static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w,
-                        int h, int stride, int scale, unsigned dc)
-{
-    int i;
-    dc *= 0x10001;
-
-    switch (log2w) {
-    case 0:
-        for (i = 0; i < h; i++) {
-            dst[0] = scale * src[0] + dc;
-            if (scale)
-                src += stride;
-            dst += stride;
-        }
-        break;
-    case 1:
-        for (i = 0; i < h; i++) {
-            LE_CENTRIC_MUL(dst, src, scale, dc);
-            if (scale)
-                src += stride;
-            dst += stride;
-        }
-        break;
-    case 2:
-        for (i = 0; i < h; i++) {
-            LE_CENTRIC_MUL(dst, src, scale, dc);
-            LE_CENTRIC_MUL(dst + 2, src + 2, scale, dc);
-            if (scale)
-                src += stride;
-            dst += stride;
-        }
-        break;
-    case 3:
-        for (i = 0; i < h; i++) {
-            LE_CENTRIC_MUL(dst,     src,     scale, dc);
-            LE_CENTRIC_MUL(dst + 2, src + 2, scale, dc);
-            LE_CENTRIC_MUL(dst + 4, src + 4, scale, dc);
-            LE_CENTRIC_MUL(dst + 6, src + 6, scale, dc);
-            if (scale)
-                src += stride;
-            dst += stride;
-        }
-        break;
-    default:
-        break;
-    }
-}
-
-static int decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
-                          int log2w, int log2h, int stride)
-{
-    const int index = size2index[log2h][log2w];
-    const int h     = 1 << log2h;
-    int code        = get_vlc2(&f->gb,
-                               block_type_vlc[1 - (f->version > 1)][index].table,
-                               BLOCK_TYPE_VLC_BITS, 1);
-    uint16_t *start = f->last_frame_buffer;
-    uint16_t *end   = start + stride * (f->avctx->height - h + 1) - (1 << log2w);
-    int ret;
-    int scale   = 1;
-    unsigned dc = 0;
-
-    if (code < 0 || code > 6 || log2w < 0)
-        return AVERROR_INVALIDDATA;
-
-    if (code == 1) {
-        log2h--;
-        if ((ret = decode_p_block(f, dst, src, log2w, log2h, stride)) < 0)
-            return ret;
-        return decode_p_block(f, dst + (stride << log2h),
-                              src + (stride << log2h),
-                              log2w, log2h, stride);
-    } else if (code == 2) {
-        log2w--;
-        if ((ret = decode_p_block(f, dst , src, log2w, log2h, stride)) < 0)
-            return ret;
-        return decode_p_block(f, dst + (1 << log2w),
-                              src + (1 << log2w),
-                              log2w, log2h, stride);
-    } else if (code == 6) {
-        if (log2w) {
-            dst[0]      = bytestream2_get_le16(&f->g2);
-            dst[1]      = bytestream2_get_le16(&f->g2);
-        } else {
-            dst[0]      = bytestream2_get_le16(&f->g2);
-            dst[stride] = bytestream2_get_le16(&f->g2);
-        }
-        return 0;
-    }
-
-    if (code == 0) {
-        src  += f->mv[bytestream2_get_byte(&f->g)];
-    } else if (code == 3 && f->version >= 2) {
-        return 0;
-    } else if (code == 4) {
-        src  += f->mv[bytestream2_get_byte(&f->g)];
-        dc    = bytestream2_get_le16(&f->g2);
-    } else if (code == 5) {
-        scale = 0;
-        dc    = bytestream2_get_le16(&f->g2);
-    }
-
-    if (start > src || src > end) {
-        av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    mcdc(dst, src, log2w, h, stride, scale, dc);
-
-    return 0;
-}
-
-static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
-{
-    int x, y;
-    const int width  = f->avctx->width;
-    const int height = f->avctx->height;
-    uint16_t *dst    = f->frame_buffer;
-    uint16_t *src;
-    unsigned int bitstream_size, bytestream_size, wordstream_size, extra,
-                 bytestream_offset, wordstream_offset;
-    int ret;
-
-    src = f->last_frame_buffer;
-
-    if (f->version > 1) {
-        if (length < 20)
-            return AVERROR_INVALIDDATA;
-        extra           = 20;
-        bitstream_size  = AV_RL32(buf + 8);
-        wordstream_size = AV_RL32(buf + 12);
-        bytestream_size = AV_RL32(buf + 16);
-    } else {
-        extra           = 0;
-        bitstream_size  = AV_RL16(buf - 4);
-        wordstream_size = AV_RL16(buf - 2);
-        bytestream_size = FFMAX(length - bitstream_size - wordstream_size, 0);
-    }
-
-    if (bitstream_size + bytestream_size + wordstream_size + extra != length
-        || bitstream_size  > (1 << 26)
-        || bytestream_size > (1 << 26)
-        || wordstream_size > (1 << 26)) {
-        av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n",
-               bitstream_size, bytestream_size, wordstream_size,
-               bitstream_size + bytestream_size + wordstream_size - length);
-        return AVERROR_INVALIDDATA;
-    }
-
-    av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size,
-                   bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!f->bitstream_buffer)
-        return AVERROR(ENOMEM);
-    f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)(buf + extra),
-                     bitstream_size / 4);
-    memset((uint8_t*)f->bitstream_buffer + bitstream_size,
-           0, FF_INPUT_BUFFER_PADDING_SIZE);
-    init_get_bits(&f->gb, f->bitstream_buffer, 8 * bitstream_size);
-
-    wordstream_offset = extra + bitstream_size;
-    bytestream_offset = extra + bitstream_size + wordstream_size;
-    bytestream2_init(&f->g2, buf + wordstream_offset,
-                     length - wordstream_offset);
-    bytestream2_init(&f->g, buf + bytestream_offset,
-                     length - bytestream_offset);
-
-    init_mv(f, width * 2);
-
-    for (y = 0; y < height; y += 8) {
-        for (x = 0; x < width; x += 8)
-            if ((ret = decode_p_block(f, dst + x, src + x, 3, 3, width)) < 0)
-                return ret;
-        src += 8 * width;
-        dst += 8 * width;
-    }
-
-    return 0;
-}
-
-/**
- * decode block and dequantize.
- * Note this is almost identical to MJPEG.
- */
-static int decode_i_block(FourXContext *f, int16_t *block)
-{
-    int code, i, j, level, val;
-
-    /* DC coef */
-    val = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
-    if (val >> 4)
-        av_log(f->avctx, AV_LOG_ERROR, "error dc run != 0\n");
-
-    if (val)
-        val = get_xbits(&f->gb, val);
-
-    val        = val * dequant_table[0] + f->last_dc;
-    f->last_dc = block[0] = val;
-    /* AC coefs */
-    i = 1;
-    for (;;) {
-        code = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
-
-        /* EOB */
-        if (code == 0)
-            break;
-        if (code == 0xf0) {
-            i += 16;
-        } else {
-            level = get_xbits(&f->gb, code & 0xf);
-            i    += code >> 4;
-            if (i >= 64) {
-                av_log(f->avctx, AV_LOG_ERROR, "run %d oveflow\n", i);
-                return 0;
-            }
-
-            j = ff_zigzag_direct[i];
-            block[j] = level * dequant_table[j];
-            i++;
-            if (i >= 64)
-                break;
-        }
-    }
-
-    return 0;
-}
-
-static inline void idct_put(FourXContext *f, int x, int y)
-{
-    int16_t (*block)[64] = f->block;
-    int stride           = f->avctx->width;
-    int i;
-    uint16_t *dst = f->frame_buffer + y * stride + x;
-
-    for (i = 0; i < 4; i++) {
-        block[i][0] += 0x80 * 8 * 8;
-        idct(block[i]);
-    }
-
-    if (!(f->avctx->flags & CODEC_FLAG_GRAY)) {
-        for (i = 4; i < 6; i++)
-            idct(block[i]);
-    }
-
-    /* Note transform is:
-     * y  = ( 1b + 4g + 2r) / 14
-     * cb = ( 3b - 2g - 1r) / 14
-     * cr = (-1b - 4g + 5r) / 14 */
-    for (y = 0; y < 8; y++) {
-        for (x = 0; x < 8; x++) {
-            int16_t *temp = block[(x >> 2) + 2 * (y >> 2)] +
-                            2 * (x & 3) + 2 * 8 * (y & 3); // FIXME optimize
-            int cb = block[4][x + 8 * y];
-            int cr = block[5][x + 8 * y];
-            int cg = (cb + cr) >> 1;
-            int y;
-
-            cb += cb;
-
-            y               = temp[0];
-            dst[0]          = ((y + cb) >> 3) + (((y - cg) & 0xFC) << 3) + (((y + cr) & 0xF8) << 8);
-            y               = temp[1];
-            dst[1]          = ((y + cb) >> 3) + (((y - cg) & 0xFC) << 3) + (((y + cr) & 0xF8) << 8);
-            y               = temp[8];
-            dst[stride]     = ((y + cb) >> 3) + (((y - cg) & 0xFC) << 3) + (((y + cr) & 0xF8) << 8);
-            y               = temp[9];
-            dst[1 + stride] = ((y + cb) >> 3) + (((y - cg) & 0xFC) << 3) + (((y + cr) & 0xF8) << 8);
-            dst            += 2;
-        }
-        dst += 2 * stride - 2 * 8;
-    }
-}
-
-static int decode_i_mb(FourXContext *f)
-{
-    int ret;
-    int i;
-
-    f->dsp.clear_blocks(f->block[0]);
-
-    for (i = 0; i < 6; i++)
-        if ((ret = decode_i_block(f, f->block[i])) < 0)
-            return ret;
-
-    return 0;
-}
-
-static const uint8_t *read_huffman_tables(FourXContext *f,
-                                          const uint8_t * const buf,
-                                          int len)
-{
-    int frequency[512] = { 0 };
-    uint8_t flag[512];
-    int up[512];
-    uint8_t len_tab[257];
-    int bits_tab[257];
-    int start, end;
-    const uint8_t *ptr = buf;
-    int j;
-
-    memset(up, -1, sizeof(up));
-
-    start = *ptr++;
-    end   = *ptr++;
-    for (;;) {
-        int i;
-
-        len -= end - start + 1;
-
-        if (end < start || len < 0)
-            return NULL;
-
-        for (i = start; i <= end; i++)
-            frequency[i] = *ptr++;
-        start = *ptr++;
-        if (start == 0)
-            break;
-
-        if (--len < 0)
-            return NULL;
-
-        end = *ptr++;
-    }
-    frequency[256] = 1;
-
-    while ((ptr - buf) & 3)
-        ptr++; // 4byte align
-
-    for (j = 257; j < 512; j++) {
-        int min_freq[2] = { 256 * 256, 256 * 256 };
-        int smallest[2] = { 0, 0 };
-        int i;
-        for (i = 0; i < j; i++) {
-            if (frequency[i] == 0)
-                continue;
-            if (frequency[i] < min_freq[1]) {
-                if (frequency[i] < min_freq[0]) {
-                    min_freq[1] = min_freq[0];
-                    smallest[1] = smallest[0];
-                    min_freq[0] = frequency[i];
-                    smallest[0] = i;
-                } else {
-                    min_freq[1] = frequency[i];
-                    smallest[1] = i;
-                }
-            }
-        }
-        if (min_freq[1] == 256 * 256)
-            break;
-
-        frequency[j]           = min_freq[0] + min_freq[1];
-        flag[smallest[0]]      = 0;
-        flag[smallest[1]]      = 1;
-        up[smallest[0]]        =
-        up[smallest[1]]        = j;
-        frequency[smallest[0]] = frequency[smallest[1]] = 0;
-    }
-
-    for (j = 0; j < 257; j++) {
-        int node, len = 0, bits = 0;
-
-        for (node = j; up[node] != -1; node = up[node]) {
-            bits += flag[node] << len;
-            len++;
-            if (len > 31)
-                // can this happen at all ?
-                av_log(f->avctx, AV_LOG_ERROR,
-                       "vlc length overflow\n");
-        }
-
-        bits_tab[j] = bits;
-        len_tab[j]  = len;
-    }
-
-    if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1,
-                 bits_tab, 4, 4, 0))
-        return NULL;
-
-    return ptr;
-}
-
-static int mix(int c0, int c1)
-{
-    int blue  =  2 * (c0 & 0x001F) + (c1 & 0x001F);
-    int green = (2 * (c0 & 0x03E0) + (c1 & 0x03E0)) >> 5;
-    int red   =  2 * (c0 >> 10)    + (c1 >> 10);
-    return red / 3 * 1024 + green / 3 * 32 + blue / 3;
-}
-
-static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
-{
-    int x, y, x2, y2;
-    const int width  = f->avctx->width;
-    const int height = f->avctx->height;
-    const int mbs    = (FFALIGN(width, 16) >> 4) * (FFALIGN(height, 16) >> 4);
-    uint16_t *dst    = f->frame_buffer;
-    GetByteContext g3;
-
-    if (length < mbs * 8) {
-        av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-    bytestream2_init(&g3, buf, length);
-
-    for (y = 0; y < height; y += 16) {
-        for (x = 0; x < width; x += 16) {
-            unsigned int color[4] = { 0 }, bits;
-            // warning following is purely guessed ...
-            color[0] = bytestream2_get_le16u(&g3);
-            color[1] = bytestream2_get_le16u(&g3);
-
-            if (color[0] & 0x8000)
-                av_log(f->avctx, AV_LOG_ERROR, "unk bit 1\n");
-            if (color[1] & 0x8000)
-                av_log(f->avctx, AV_LOG_ERROR, "unk bit 2\n");
-
-            color[2] = mix(color[0], color[1]);
-            color[3] = mix(color[1], color[0]);
-
-            bits = bytestream2_get_le32u(&g3);
-            for (y2 = 0; y2 < 16; y2++) {
-                for (x2 = 0; x2 < 16; x2++) {
-                    int index = 2 * (x2 >> 2) + 8 * (y2 >> 2);
-                    dst[y2 * width + x2] = color[(bits >> index) & 3];
-                }
-            }
-            dst += 16;
-        }
-        dst += 16 * width - x;
-    }
-
-    return 0;
-}
-
-static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
-{
-    int x, y, ret;
-    const int width  = f->avctx->width;
-    const int height = f->avctx->height;
-    const unsigned int bitstream_size = AV_RL32(buf);
-    int token_count av_unused;
-    unsigned int prestream_size;
-    const uint8_t *prestream;
-
-    if (bitstream_size > (1 << 26))
-        return AVERROR_INVALIDDATA;
-
-    if (length < bitstream_size + 12) {
-        av_log(f->avctx, AV_LOG_ERROR, "packet size too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    token_count    =     AV_RL32(buf + bitstream_size + 8);
-    prestream_size = 4 * AV_RL32(buf + bitstream_size + 4);
-    prestream      =             buf + bitstream_size + 12;
-
-    if (prestream_size + bitstream_size + 12 != length
-        || prestream_size > (1 << 26)) {
-        av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n",
-               prestream_size, bitstream_size, length);
-        return AVERROR_INVALIDDATA;
-    }
-
-    prestream = read_huffman_tables(f, prestream, prestream_size);
-    if (!prestream) {
-        av_log(f->avctx, AV_LOG_ERROR, "Error reading Huffman tables.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    init_get_bits(&f->gb, buf + 4, 8 * bitstream_size);
-
-    prestream_size = length + buf - prestream;
-
-    av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size,
-                   prestream_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!f->bitstream_buffer)
-        return AVERROR(ENOMEM);
-    f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)prestream,
-                     prestream_size / 4);
-    memset((uint8_t*)f->bitstream_buffer + prestream_size,
-           0, FF_INPUT_BUFFER_PADDING_SIZE);
-    init_get_bits(&f->pre_gb, f->bitstream_buffer, 8 * prestream_size);
-
-    f->last_dc = 0 * 128 * 8 * 8;
-
-    for (y = 0; y < height; y += 16) {
-        for (x = 0; x < width; x += 16) {
-            if ((ret = decode_i_mb(f)) < 0)
-                return ret;
-
-            idct_put(f, x, y);
-        }
-    }
-
-    if (get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3) != 256)
-        av_log(f->avctx, AV_LOG_ERROR, "end mismatch\n");
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data,
-                        int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf    = avpkt->data;
-    int buf_size          = avpkt->size;
-    FourXContext *const f = avctx->priv_data;
-    AVFrame *picture      = data;
-    int i, frame_4cc, frame_size, ret;
-
-    if (buf_size < 20)
-        return AVERROR_INVALIDDATA;
-
-    if (avctx->width % 16 || avctx->height % 16) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Dimensions non-multiple of 16 are invalid.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (buf_size < AV_RL32(buf + 4) + 8) {
-        av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n",
-               buf_size, AV_RL32(buf + 4));
-        return AVERROR_INVALIDDATA;
-    }
-
-    frame_4cc = AV_RL32(buf);
-
-    if (frame_4cc == AV_RL32("cfrm")) {
-        int free_index       = -1;
-        int id, whole_size;
-        const int data_size  = buf_size - 20;
-        CFrameBuffer *cfrm;
-
-        if (data_size < 0)
-            return AVERROR_INVALIDDATA;
-
-        id         = AV_RL32(buf + 12);
-        whole_size = AV_RL32(buf + 16);
-
-        for (i = 0; i < CFRAME_BUFFER_COUNT; i++)
-            if (f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
-                av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n",
-                       f->cfrm[i].id);
-
-        for (i = 0; i < CFRAME_BUFFER_COUNT; i++) {
-            if (f->cfrm[i].id == id)
-                break;
-            if (f->cfrm[i].size == 0)
-                free_index = i;
-        }
-
-        if (i >= CFRAME_BUFFER_COUNT) {
-            i             = free_index;
-            f->cfrm[i].id = id;
-        }
-        cfrm = &f->cfrm[i];
-
-        cfrm->data = av_fast_realloc(cfrm->data, &cfrm->allocated_size,
-                                     cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
-        // explicit check needed as memcpy below might not catch a NULL
-        if (!cfrm->data) {
-            av_log(f->avctx, AV_LOG_ERROR, "realloc failure");
-            return AVERROR(ENOMEM);
-        }
-
-        memcpy(cfrm->data + cfrm->size, buf + 20, data_size);
-        cfrm->size += data_size;
-
-        if (cfrm->size >= whole_size) {
-            buf        = cfrm->data;
-            frame_size = cfrm->size;
-
-            if (id != avctx->frame_number)
-                av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n",
-                       id, avctx->frame_number);
-
-            if (f->version <= 1)
-                return AVERROR_INVALIDDATA;
-
-            cfrm->size = cfrm->id = 0;
-            frame_4cc  = AV_RL32("pfrm");
-        } else
-            return buf_size;
-    } else {
-        buf        = buf      + 12;
-        frame_size = buf_size - 12;
-    }
-
-
-    if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (frame_4cc == AV_RL32("ifr2")) {
-        picture->pict_type = AV_PICTURE_TYPE_I;
-        if ((ret = decode_i2_frame(f, buf - 4, frame_size + 4)) < 0)
-            return ret;
-    } else if (frame_4cc == AV_RL32("ifrm")) {
-        picture->pict_type = AV_PICTURE_TYPE_I;
-        if ((ret = decode_i_frame(f, buf, frame_size)) < 0)
-            return ret;
-    } else if (frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")) {
-        picture->pict_type = AV_PICTURE_TYPE_P;
-        if ((ret = decode_p_frame(f, buf, frame_size)) < 0)
-            return ret;
-    } else if (frame_4cc == AV_RL32("snd_")) {
-        av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n",
-               buf_size);
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "ignoring unknown chunk length:%d\n",
-               buf_size);
-    }
-
-    picture->key_frame = picture->pict_type == AV_PICTURE_TYPE_I;
-
-    av_image_copy_plane(picture->data[0], picture->linesize[0],
-                        (const uint8_t*)f->frame_buffer,  avctx->width * 2,
-                        avctx->width * 2, avctx->height);
-    FFSWAP(uint16_t *, f->frame_buffer, f->last_frame_buffer);
-
-    *got_frame = 1;
-
-    emms_c();
-
-    return buf_size;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    FourXContext * const f = avctx->priv_data;
-    int i;
-
-    av_freep(&f->frame_buffer);
-    av_freep(&f->last_frame_buffer);
-    av_freep(&f->bitstream_buffer);
-    f->bitstream_buffer_size = 0;
-    for (i = 0; i < CFRAME_BUFFER_COUNT; i++) {
-        av_freep(&f->cfrm[i].data);
-        f->cfrm[i].allocated_size = 0;
-    }
-    ff_free_vlc(&f->pre_vlc);
-
-    return 0;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    FourXContext * const f = avctx->priv_data;
-    int ret;
-
-    if (avctx->extradata_size != 4 || !avctx->extradata) {
-        av_log(avctx, AV_LOG_ERROR, "extradata wrong or missing\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
-    if (ret < 0)
-        return ret;
-
-    f->frame_buffer      = av_mallocz(avctx->width * avctx->height * 2);
-    f->last_frame_buffer = av_mallocz(avctx->width * avctx->height * 2);
-    if (!f->frame_buffer || !f->last_frame_buffer) {
-        decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    f->version = AV_RL32(avctx->extradata) >> 16;
-    ff_dsputil_init(&f->dsp, avctx);
-    f->avctx = avctx;
-    init_vlcs(f);
-
-    if (f->version > 2)
-        avctx->pix_fmt = AV_PIX_FMT_RGB565;
-    else
-        avctx->pix_fmt = AV_PIX_FMT_BGR555;
-
-    return 0;
-}
-
-AVCodec ff_fourxm_decoder = {
-    .name           = "4xm",
-    .long_name      = NULL_IF_CONFIG_SMALL("4X Movie"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_4XM,
-    .priv_data_size = sizeof(FourXContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/8bps.c b/deps/libav/libavcodec/8bps.c
deleted file mode 100644
index cfeb486..0000000
--- a/deps/libav/libavcodec/8bps.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Quicktime Planar RGB (8BPS) Video Decoder
- * Copyright (C) 2003 Roberto Togni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * QT 8BPS Video Decoder by Roberto Togni
- * For more information about the 8BPS format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *
- * Supports: PAL8 (RGB 8bpp, paletted)
- *         : BGR24 (RGB 24bpp) (can also output it as RGB32)
- *         : RGB32 (RGB 32bpp, 4th plane is probably alpha and it's ignored)
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-
-static const enum AVPixelFormat pixfmt_rgb24[] = {
-    AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE };
-
-typedef struct EightBpsContext {
-    AVCodecContext *avctx;
-
-    unsigned char planes;
-    unsigned char planemap[4];
-
-    uint32_t pal[256];
-} EightBpsContext;
-
-static int decode_frame(AVCodecContext *avctx, void *data,
-                        int *got_frame, AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    EightBpsContext * const c = avctx->priv_data;
-    const unsigned char *encoded = buf;
-    unsigned char *pixptr, *pixptr_end;
-    unsigned int height = avctx->height; // Real image height
-    unsigned int dlen, p, row;
-    const unsigned char *lp, *dp, *ep;
-    unsigned char count;
-    unsigned int px_inc;
-    unsigned int planes     = c->planes;
-    unsigned char *planemap = c->planemap;
-    int ret;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    ep = encoded + buf_size;
-
-    /* Set data pointer after line lengths */
-    dp = encoded + planes * (height << 1);
-
-    /* Ignore alpha plane, don't know what to do with it */
-    if (planes == 4)
-        planes--;
-
-    px_inc = planes + (avctx->pix_fmt == AV_PIX_FMT_RGB32);
-
-    for (p = 0; p < planes; p++) {
-        /* Lines length pointer for this plane */
-        lp = encoded + p * (height << 1);
-
-        /* Decode a plane */
-        for (row = 0; row < height; row++) {
-            pixptr = frame->data[0] + row * frame->linesize[0] + planemap[p];
-            pixptr_end = pixptr + frame->linesize[0];
-            if (ep - lp < row * 2 + 2)
-                return AVERROR_INVALIDDATA;
-            dlen = av_be2ne16(*(const unsigned short *)(lp + row * 2));
-            /* Decode a row of this plane */
-            while (dlen > 0) {
-                if (ep - dp <= 1)
-                    return AVERROR_INVALIDDATA;
-                if ((count = *dp++) <= 127) {
-                    count++;
-                    dlen -= count + 1;
-                    if (pixptr_end - pixptr < count * px_inc)
-                        break;
-                    if (ep - dp < count)
-                        return AVERROR_INVALIDDATA;
-                    while (count--) {
-                        *pixptr = *dp++;
-                        pixptr += px_inc;
-                    }
-                } else {
-                    count = 257 - count;
-                    if (pixptr_end - pixptr < count * px_inc)
-                        break;
-                    while (count--) {
-                        *pixptr = *dp;
-                        pixptr += px_inc;
-                    }
-                    dp++;
-                    dlen -= 2;
-                }
-            }
-        }
-    }
-
-    if (avctx->bits_per_coded_sample <= 8) {
-        const uint8_t *pal = av_packet_get_side_data(avpkt,
-                                                     AV_PKT_DATA_PALETTE,
-                                                     NULL);
-        if (pal) {
-            frame->palette_has_changed = 1;
-            memcpy(c->pal, pal, AVPALETTE_SIZE);
-        }
-
-        memcpy (frame->data[1], c->pal, AVPALETTE_SIZE);
-    }
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    EightBpsContext * const c = avctx->priv_data;
-
-    c->avctx       = avctx;
-
-    switch (avctx->bits_per_coded_sample) {
-    case 8:
-        avctx->pix_fmt = AV_PIX_FMT_PAL8;
-        c->planes      = 1;
-        c->planemap[0] = 0; // 1st plane is palette indexes
-        break;
-    case 24:
-        avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24);
-        c->planes      = 3;
-        c->planemap[0] = 2; // 1st plane is red
-        c->planemap[1] = 1; // 2nd plane is green
-        c->planemap[2] = 0; // 3rd plane is blue
-        break;
-    case 32:
-        avctx->pix_fmt = AV_PIX_FMT_RGB32;
-        c->planes      = 4;
-        /* handle planemap setup later for decoding rgb24 data as rbg32 */
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n",
-               avctx->bits_per_coded_sample);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avctx->pix_fmt == AV_PIX_FMT_RGB32) {
-        c->planemap[0] = HAVE_BIGENDIAN ? 1 : 2; // 1st plane is red
-        c->planemap[1] = HAVE_BIGENDIAN ? 2 : 1; // 2nd plane is green
-        c->planemap[2] = HAVE_BIGENDIAN ? 3 : 0; // 3rd plane is blue
-        c->planemap[3] = HAVE_BIGENDIAN ? 0 : 3; // 4th plane is alpha???
-    }
-    return 0;
-}
-
-AVCodec ff_eightbps_decoder = {
-    .name           = "8bps",
-    .long_name      = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_8BPS,
-    .priv_data_size = sizeof(EightBpsContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/8svx.c b/deps/libav/libavcodec/8svx.c
deleted file mode 100644
index 11fbf19..0000000
--- a/deps/libav/libavcodec/8svx.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * 8SVX audio decoder
- * Copyright (C) 2008 Jaikrishnan Menon
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * 8svx audio decoder
- * @author Jaikrishnan Menon
- *
- * supports: fibonacci delta encoding
- *         : exponential encoding
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/common.h"
-
-/** decoder context */
-typedef struct EightSvxContext {
-    uint8_t fib_acc[2];
-    const int8_t *table;
-
-    /* buffer used to store the whole first packet.
-       data is only sent as one large packet */
-    uint8_t *data[2];
-    int data_size;
-    int data_idx;
-} EightSvxContext;
-
-static const int8_t fibonacci[16]   = { -34, -21, -13,  -8, -5, -3, -2, -1,
-                                          0,   1,   2,   3,  5,  8, 13, 21 };
-static const int8_t exponential[16] = { -128, -64, -32, -16, -8, -4, -2, -1,
-                                           0,   1,   2,   4,  8, 16, 32, 64 };
-
-#define MAX_FRAME_SIZE 32768
-
-/**
- * Delta decode the compressed values in src, and put the resulting
- * decoded samples in dst.
- *
- * @param[in,out] state starting value. it is saved for use in the next call.
- */
-static void delta_decode(uint8_t *dst, const uint8_t *src, int src_size,
-                         uint8_t *state, const int8_t *table)
-{
-    uint8_t val = *state;
-
-    while (src_size--) {
-        uint8_t d = *src++;
-        val = av_clip_uint8(val + table[d & 0xF]);
-        *dst++ = val;
-        val = av_clip_uint8(val + table[d >> 4]);
-        *dst++ = val;
-    }
-
-    *state = val;
-}
-
-static void raw_decode(uint8_t *dst, const int8_t *src, int src_size)
-{
-    while (src_size--)
-        *dst++ = *src++ + 128;
-}
-
-/** decode a frame */
-static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
-                                 int *got_frame_ptr, AVPacket *avpkt)
-{
-    EightSvxContext *esc = avctx->priv_data;
-    AVFrame *frame       = data;
-    int buf_size;
-    int ch, ret;
-    int is_compr = (avctx->codec_id != AV_CODEC_ID_PCM_S8_PLANAR);
-
-    /* for the first packet, copy data to buffer */
-    if (avpkt->data) {
-        int hdr_size  = is_compr ? 2 : 0;
-        int chan_size = (avpkt->size - hdr_size * avctx->channels) / avctx->channels;
-
-        if (avpkt->size < hdr_size * avctx->channels) {
-            av_log(avctx, AV_LOG_ERROR, "packet size is too small\n");
-            return AVERROR(EINVAL);
-        }
-        if (esc->data[0]) {
-            av_log(avctx, AV_LOG_ERROR, "unexpected data after first packet\n");
-            return AVERROR(EINVAL);
-        }
-
-        if (is_compr) {
-        esc->fib_acc[0] = avpkt->data[1] + 128;
-        if (avctx->channels == 2)
-            esc->fib_acc[1] = avpkt->data[2+chan_size+1] + 128;
-        }
-
-        esc->data_idx  = 0;
-        esc->data_size = chan_size;
-        if (!(esc->data[0] = av_malloc(chan_size)))
-            return AVERROR(ENOMEM);
-        if (avctx->channels == 2) {
-            if (!(esc->data[1] = av_malloc(chan_size))) {
-                av_freep(&esc->data[0]);
-                return AVERROR(ENOMEM);
-            }
-        }
-        memcpy(esc->data[0], &avpkt->data[hdr_size], chan_size);
-        if (avctx->channels == 2)
-            memcpy(esc->data[1], &avpkt->data[2*hdr_size+chan_size], chan_size);
-    }
-    if (!esc->data[0]) {
-        av_log(avctx, AV_LOG_ERROR, "unexpected empty packet\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* decode next piece of data from the buffer */
-    buf_size = FFMIN(MAX_FRAME_SIZE, esc->data_size - esc->data_idx);
-    if (buf_size <= 0) {
-        *got_frame_ptr = 0;
-        return avpkt->size;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = buf_size * (is_compr + 1);
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    for (ch = 0; ch < avctx->channels; ch++) {
-        if (is_compr) {
-            delta_decode(frame->data[ch], &esc->data[ch][esc->data_idx],
-                         buf_size, &esc->fib_acc[ch], esc->table);
-        } else {
-            raw_decode(frame->data[ch], &esc->data[ch][esc->data_idx],
-                       buf_size);
-        }
-    }
-
-    esc->data_idx += buf_size;
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-/** initialize 8svx decoder */
-static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
-{
-    EightSvxContext *esc = avctx->priv_data;
-
-    if (avctx->channels < 1 || avctx->channels > 2) {
-        av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 channels\n");
-        return AVERROR(EINVAL);
-    }
-
-    switch(avctx->codec->id) {
-        case AV_CODEC_ID_8SVX_FIB:
-          esc->table = fibonacci;
-          break;
-        case AV_CODEC_ID_8SVX_EXP:
-          esc->table = exponential;
-          break;
-        case AV_CODEC_ID_PCM_S8_PLANAR:
-            break;
-        default:
-          return -1;
-    }
-    avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
-
-    return 0;
-}
-
-static av_cold int eightsvx_decode_close(AVCodecContext *avctx)
-{
-    EightSvxContext *esc = avctx->priv_data;
-
-    av_freep(&esc->data[0]);
-    av_freep(&esc->data[1]);
-
-    return 0;
-}
-
-AVCodec ff_eightsvx_fib_decoder = {
-  .name           = "8svx_fib",
-  .long_name      = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
-  .type           = AVMEDIA_TYPE_AUDIO,
-  .id             = AV_CODEC_ID_8SVX_FIB,
-  .priv_data_size = sizeof (EightSvxContext),
-  .init           = eightsvx_decode_init,
-  .close          = eightsvx_decode_close,
-  .decode         = eightsvx_decode_frame,
-  .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_DR1,
-  .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
-                                                    AV_SAMPLE_FMT_NONE },
-};
-
-AVCodec ff_eightsvx_exp_decoder = {
-  .name           = "8svx_exp",
-  .long_name      = NULL_IF_CONFIG_SMALL("8SVX exponential"),
-  .type           = AVMEDIA_TYPE_AUDIO,
-  .id             = AV_CODEC_ID_8SVX_EXP,
-  .priv_data_size = sizeof (EightSvxContext),
-  .init           = eightsvx_decode_init,
-  .close          = eightsvx_decode_close,
-  .decode         = eightsvx_decode_frame,
-  .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_DR1,
-  .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
-                                                    AV_SAMPLE_FMT_NONE },
-};
-
-AVCodec ff_pcm_s8_planar_decoder = {
-    .name           = "pcm_s8_planar",
-    .long_name      = NULL_IF_CONFIG_SMALL("PCM signed 8-bit planar"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_PCM_S8_PLANAR,
-    .priv_data_size = sizeof(EightSvxContext),
-    .init           = eightsvx_decode_init,
-    .close          = eightsvx_decode_close,
-    .decode         = eightsvx_decode_frame,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/Makefile b/deps/libav/libavcodec/Makefile
deleted file mode 100644
index 9e4dd25..0000000
--- a/deps/libav/libavcodec/Makefile
+++ /dev/null
@@ -1,755 +0,0 @@
-NAME = avcodec
-FFLIBS = avutil
-
-HEADERS = avcodec.h                                                     \
-          avfft.h                                                       \
-          dxva2.h                                                       \
-          vaapi.h                                                       \
-          vda.h                                                         \
-          vdpau.h                                                       \
-          version.h                                                     \
-          xvmc.h                                                        \
-
-OBJS = allcodecs.o                                                      \
-       avpacket.o                                                       \
-       avpicture.o                                                      \
-       bitstream.o                                                      \
-       bitstream_filter.o                                               \
-       codec_desc.o                                                     \
-       fmtconvert.o                                                     \
-       imgconvert.o                                                     \
-       log2_tab.o                                                       \
-       mathtables.o                                                     \
-       options.o                                                        \
-       parser.o                                                         \
-       raw.o                                                            \
-       utils.o                                                          \
-
-# parts needed for many different codecs
-OBJS-$(CONFIG_AANDCTTABLES)            += aandcttab.o
-OBJS-$(CONFIG_AC3DSP)                  += ac3dsp.o
-OBJS-$(CONFIG_AUDIO_FRAME_QUEUE)       += audio_frame_queue.o
-OBJS-$(CONFIG_DCT)                     += dct.o dct32_fixed.o dct32_float.o
-OBJS-$(CONFIG_DXVA2)                   += dxva2.o
-OBJS-$(CONFIG_DSPUTIL)                 += dsputil.o faanidct.o          \
-                                          simple_idct.o jrevdct.o
-OBJS-$(CONFIG_ENCODERS)                += faandct.o jfdctfst.o jfdctint.o
-OBJS-$(CONFIG_ERROR_RESILIENCE)        += error_resilience.o
-FFT-OBJS-$(CONFIG_HARDCODED_TABLES)    += cos_tables.o cos_fixed_tables.o
-OBJS-$(CONFIG_FFT)                     += avfft.o fft_fixed.o fft_float.o \
-                                          $(FFT-OBJS-yes)
-OBJS-$(CONFIG_GOLOMB)                  += golomb.o
-OBJS-$(CONFIG_H263DSP)                 += h263dsp.o
-OBJS-$(CONFIG_H264CHROMA)              += h264chroma.o
-OBJS-$(CONFIG_H264DSP)                 += h264dsp.o h264idct.o
-OBJS-$(CONFIG_H264PRED)                += h264pred.o
-OBJS-$(CONFIG_H264QPEL)                += h264qpel.o
-OBJS-$(CONFIG_HPELDSP)                 += hpeldsp.o
-OBJS-$(CONFIG_HUFFMAN)                 += huffman.o
-OBJS-$(CONFIG_INTRAX8)                 += intrax8.o intrax8dsp.o
-OBJS-$(CONFIG_LIBXVID)                 += libxvid_rc.o
-OBJS-$(CONFIG_LPC)                     += lpc.o
-OBJS-$(CONFIG_LSP)                     += lsp.o
-OBJS-$(CONFIG_MDCT)                    += mdct_fixed.o mdct_float.o
-OBJS-$(CONFIG_MPEGAUDIO)               += mpegaudio.o mpegaudiodata.o   \
-                                          mpegaudiodecheader.o
-OBJS-$(CONFIG_MPEGAUDIODSP)            += mpegaudiodsp.o                \
-                                          mpegaudiodsp_data.o           \
-                                          mpegaudiodsp_fixed.o          \
-                                          mpegaudiodsp_float.o
-OBJS-$(CONFIG_MPEGVIDEO)               += mpegvideo.o mpegvideo_motion.o
-OBJS-$(CONFIG_MPEGVIDEOENC)            += mpegvideo_enc.o mpeg12data.o  \
-                                          motion_est.o ratecontrol.o
-OBJS-$(CONFIG_RANGECODER)              += rangecoder.o
-RDFT-OBJS-$(CONFIG_HARDCODED_TABLES)   += sin_tables.o
-OBJS-$(CONFIG_RDFT)                    += rdft.o $(RDFT-OBJS-yes)
-OBJS-$(CONFIG_SINEWIN)                 += sinewin.o
-OBJS-$(CONFIG_VAAPI)                   += vaapi.o
-OBJS-$(CONFIG_VDPAU)                   += vdpau.o
-OBJS-$(CONFIG_VIDEODSP)                += videodsp.o
-OBJS-$(CONFIG_VP3DSP)                  += vp3dsp.o
-
-# decoders/encoders
-OBJS-$(CONFIG_A64MULTI_ENCODER)        += a64multienc.o elbg.o
-OBJS-$(CONFIG_A64MULTI5_ENCODER)       += a64multienc.o elbg.o
-OBJS-$(CONFIG_AAC_DECODER)             += aacdec.o aactab.o aacsbr.o aacps.o \
-                                          aacadtsdec.o mpeg4audio.o kbdwin.o \
-                                          sbrdsp.o aacpsdsp.o
-OBJS-$(CONFIG_AAC_ENCODER)             += aacenc.o aaccoder.o    \
-                                          aacpsy.o aactab.o      \
-                                          psymodel.o iirfilter.o \
-                                          mpeg4audio.o kbdwin.o
-OBJS-$(CONFIG_AASC_DECODER)            += aasc.o msrledec.o
-OBJS-$(CONFIG_AC3_DECODER)             += ac3dec.o ac3dec_data.o ac3.o kbdwin.o
-OBJS-$(CONFIG_AC3_ENCODER)             += ac3enc_float.o ac3enc.o ac3tab.o \
-                                          ac3.o kbdwin.o
-OBJS-$(CONFIG_AC3_FIXED_ENCODER)       += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o
-OBJS-$(CONFIG_AIC_DECODER)             += aic.o
-OBJS-$(CONFIG_ALAC_DECODER)            += alac.o alac_data.o
-OBJS-$(CONFIG_ALAC_ENCODER)            += alacenc.o alac_data.o
-OBJS-$(CONFIG_ALS_DECODER)             += alsdec.o bgmc.o mpeg4audio.o
-OBJS-$(CONFIG_AMRNB_DECODER)           += amrnbdec.o celp_filters.o   \
-                                          celp_math.o acelp_filters.o \
-                                          acelp_vectors.o             \
-                                          acelp_pitch_delay.o
-OBJS-$(CONFIG_AMRWB_DECODER)           += amrwbdec.o celp_filters.o   \
-                                          celp_math.o acelp_filters.o \
-                                          acelp_vectors.o             \
-                                          acelp_pitch_delay.o
-OBJS-$(CONFIG_AMV_DECODER)             += sp5xdec.o mjpegdec.o mjpeg.o
-OBJS-$(CONFIG_ANM_DECODER)             += anm.o
-OBJS-$(CONFIG_ANSI_DECODER)            += ansi.o cga_data.o
-OBJS-$(CONFIG_APE_DECODER)             += apedec.o
-OBJS-$(CONFIG_ASS_DECODER)             += assdec.o ass.o
-OBJS-$(CONFIG_ASS_ENCODER)             += assenc.o ass.o
-OBJS-$(CONFIG_ASV1_DECODER)            += asvdec.o asv.o mpeg12data.o
-OBJS-$(CONFIG_ASV1_ENCODER)            += asvenc.o asv.o mpeg12data.o
-OBJS-$(CONFIG_ASV2_DECODER)            += asvdec.o asv.o mpeg12data.o
-OBJS-$(CONFIG_ASV2_ENCODER)            += asvenc.o asv.o mpeg12data.o
-OBJS-$(CONFIG_ATRAC1_DECODER)          += atrac1.o atrac.o
-OBJS-$(CONFIG_ATRAC3_DECODER)          += atrac3.o atrac.o
-OBJS-$(CONFIG_ATRAC3P_DECODER)         += atrac3plusdec.o atrac3plus.o \
-                                          atrac3plusdsp.o atrac.o
-OBJS-$(CONFIG_AURA_DECODER)            += cyuv.o
-OBJS-$(CONFIG_AURA2_DECODER)           += aura.o
-OBJS-$(CONFIG_AVS_DECODER)             += avs.o
-OBJS-$(CONFIG_BETHSOFTVID_DECODER)     += bethsoftvideo.o
-OBJS-$(CONFIG_BFI_DECODER)             += bfi.o
-OBJS-$(CONFIG_BINK_DECODER)            += bink.o binkdsp.o
-OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER)   += binkaudio.o wma.o wma_common.o
-OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER)  += binkaudio.o wma.o wma_common.o
-OBJS-$(CONFIG_BMP_DECODER)             += bmp.o msrledec.o
-OBJS-$(CONFIG_BMP_ENCODER)             += bmpenc.o
-OBJS-$(CONFIG_BMV_VIDEO_DECODER)       += bmv.o
-OBJS-$(CONFIG_BMV_AUDIO_DECODER)       += bmv.o
-OBJS-$(CONFIG_C93_DECODER)             += c93.o
-OBJS-$(CONFIG_CAVS_DECODER)            += cavs.o cavsdec.o cavsdsp.o \
-                                          cavsdata.o mpeg12data.o
-OBJS-$(CONFIG_CDGRAPHICS_DECODER)      += cdgraphics.o
-OBJS-$(CONFIG_CDXL_DECODER)            += cdxl.o
-OBJS-$(CONFIG_CINEPAK_DECODER)         += cinepak.o
-OBJS-$(CONFIG_CLJR_DECODER)            += cljr.o
-OBJS-$(CONFIG_CLJR_ENCODER)            += cljr.o
-OBJS-$(CONFIG_CLLC_DECODER)            += cllc.o
-OBJS-$(CONFIG_COOK_DECODER)            += cook.o
-OBJS-$(CONFIG_COMFORTNOISE_DECODER)    += cngdec.o celp_filters.o
-OBJS-$(CONFIG_COMFORTNOISE_ENCODER)    += cngenc.o
-OBJS-$(CONFIG_CSCD_DECODER)            += cscd.o
-OBJS-$(CONFIG_CYUV_DECODER)            += cyuv.o
-OBJS-$(CONFIG_DCA_DECODER)             += dcadec.o dca.o dcadsp.o      \
-                                          synth_filter.o
-OBJS-$(CONFIG_DFA_DECODER)             += dfa.o
-OBJS-$(CONFIG_DNXHD_DECODER)           += dnxhddec.o dnxhddata.o
-OBJS-$(CONFIG_DNXHD_ENCODER)           += dnxhdenc.o dnxhddata.o
-OBJS-$(CONFIG_DPX_DECODER)             += dpx.o
-OBJS-$(CONFIG_DPX_ENCODER)             += dpxenc.o
-OBJS-$(CONFIG_DSICINAUDIO_DECODER)     += dsicinav.o
-OBJS-$(CONFIG_DSICINVIDEO_DECODER)     += dsicinav.o
-OBJS-$(CONFIG_DVBSUB_DECODER)          += dvbsubdec.o
-OBJS-$(CONFIG_DVBSUB_ENCODER)          += dvbsub.o
-OBJS-$(CONFIG_DVDSUB_DECODER)          += dvdsubdec.o
-OBJS-$(CONFIG_DVDSUB_ENCODER)          += dvdsubenc.o
-OBJS-$(CONFIG_DVVIDEO_DECODER)         += dvdec.o dv.o dvdata.o dv_profile.o
-OBJS-$(CONFIG_DVVIDEO_ENCODER)         += dvenc.o dv.o dvdata.o dv_profile.o
-OBJS-$(CONFIG_DXA_DECODER)             += dxa.o
-OBJS-$(CONFIG_DXTORY_DECODER)          += dxtory.o
-OBJS-$(CONFIG_EAC3_DECODER)            += eac3dec.o eac3_data.o
-OBJS-$(CONFIG_EAC3_ENCODER)            += eac3enc.o eac3_data.o
-OBJS-$(CONFIG_EACMV_DECODER)           += eacmv.o
-OBJS-$(CONFIG_EAMAD_DECODER)           += eamad.o eaidct.o mpeg12.o \
-                                          mpeg12data.o
-OBJS-$(CONFIG_EATGQ_DECODER)           += eatgq.o eaidct.o
-OBJS-$(CONFIG_EATGV_DECODER)           += eatgv.o
-OBJS-$(CONFIG_EATQI_DECODER)           += eatqi.o eaidct.o mpeg12dec.o  \
-                                          mpeg12.o mpeg12data.o
-OBJS-$(CONFIG_EIGHTBPS_DECODER)        += 8bps.o
-OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER)    += 8svx.o
-OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER)    += 8svx.o
-OBJS-$(CONFIG_ESCAPE124_DECODER)       += escape124.o
-OBJS-$(CONFIG_ESCAPE130_DECODER)       += escape130.o
-OBJS-$(CONFIG_FFV1_DECODER)            += ffv1dec.o ffv1.o
-OBJS-$(CONFIG_FFV1_ENCODER)            += ffv1enc.o ffv1.o
-OBJS-$(CONFIG_FFVHUFF_DECODER)         += huffyuv.o huffyuvdec.o
-OBJS-$(CONFIG_FFVHUFF_ENCODER)         += huffyuv.o huffyuvenc.o
-OBJS-$(CONFIG_FIC_DECODER)             += fic.o
-OBJS-$(CONFIG_FLAC_DECODER)            += flacdec.o flacdata.o flac.o flacdsp.o
-OBJS-$(CONFIG_FLAC_ENCODER)            += flacenc.o flacdata.o flac.o flacdsp.o
-OBJS-$(CONFIG_FLASHSV_DECODER)         += flashsv.o
-OBJS-$(CONFIG_FLASHSV_ENCODER)         += flashsvenc.o
-OBJS-$(CONFIG_FLASHSV2_DECODER)        += flashsv.o
-OBJS-$(CONFIG_FLIC_DECODER)            += flicvideo.o
-OBJS-$(CONFIG_FOURXM_DECODER)          += 4xm.o
-OBJS-$(CONFIG_FRAPS_DECODER)           += fraps.o
-OBJS-$(CONFIG_FRWU_DECODER)            += frwu.o
-OBJS-$(CONFIG_G2M_DECODER)             += g2meet.o mjpeg.o
-OBJS-$(CONFIG_G723_1_DECODER)          += g723_1.o acelp_vectors.o \
-                                          celp_filters.o
-OBJS-$(CONFIG_GIF_DECODER)             += gifdec.o lzw.o
-OBJS-$(CONFIG_GIF_ENCODER)             += gif.o lzwenc.o
-OBJS-$(CONFIG_GSM_DECODER)             += gsmdec.o gsmdec_data.o msgsmdec.o
-OBJS-$(CONFIG_GSM_MS_DECODER)          += gsmdec.o gsmdec_data.o msgsmdec.o
-OBJS-$(CONFIG_H261_DECODER)            += h261dec.o h261data.o h261.o
-OBJS-$(CONFIG_H261_ENCODER)            += h261enc.o h261data.o h261.o
-OBJS-$(CONFIG_H263_DECODER)            += h263dec.o h263.o ituh263dec.o        \
-                                          mpeg4video.o mpeg4videodec.o flvdec.o\
-                                          intelh263dec.o
-OBJS-$(CONFIG_H263_ENCODER)            += mpeg4videoenc.o mpeg4video.o  \
-                                          h263.o ituh263enc.o flvenc.o
-OBJS-$(CONFIG_H264_DECODER)            += h264.o                               \
-                                          h264_loopfilter.o h264_direct.o      \
-                                          cabac.o h264_sei.o h264_ps.o         \
-                                          h264_refs.o h264_cavlc.o h264_cabac.o
-OBJS-$(CONFIG_HEVC_DECODER)            += hevc.o hevc_mvs.o hevc_ps.o hevc_sei.o \
-                                          hevc_cabac.o hevc_refs.o hevcpred.o    \
-                                          hevcdsp.o hevc_filter.o cabac.o
-OBJS-$(CONFIG_HNM4_VIDEO_DECODER)      += hnm4video.o
-OBJS-$(CONFIG_HUFFYUV_DECODER)         += huffyuv.o huffyuvdec.o
-OBJS-$(CONFIG_HUFFYUV_ENCODER)         += huffyuv.o huffyuvenc.o
-OBJS-$(CONFIG_IAC_DECODER)             += imc.o
-OBJS-$(CONFIG_IDCIN_DECODER)           += idcinvideo.o
-OBJS-$(CONFIG_IFF_BYTERUN1_DECODER)    += iff.o
-OBJS-$(CONFIG_IFF_ILBM_DECODER)        += iff.o
-OBJS-$(CONFIG_IMC_DECODER)             += imc.o
-OBJS-$(CONFIG_INDEO2_DECODER)          += indeo2.o
-OBJS-$(CONFIG_INDEO3_DECODER)          += indeo3.o
-OBJS-$(CONFIG_INDEO4_DECODER)          += indeo4.o ivi_common.o ivi_dsp.o
-OBJS-$(CONFIG_INDEO5_DECODER)          += indeo5.o ivi_common.o ivi_dsp.o
-OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER)  += dpcm.o
-OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
-OBJS-$(CONFIG_JPEG2000_DECODER)        += jpeg2000dec.o jpeg2000.o      \
-                                          jpeg2000dwt.o mqcdec.o mqc.o
-OBJS-$(CONFIG_JPEGLS_DECODER)          += jpeglsdec.o jpegls.o \
-                                          mjpegdec.o mjpeg.o
-OBJS-$(CONFIG_JPEGLS_ENCODER)          += jpeglsenc.o jpegls.o
-OBJS-$(CONFIG_JV_DECODER)              += jvdec.o
-OBJS-$(CONFIG_KGV1_DECODER)            += kgv1dec.o
-OBJS-$(CONFIG_KMVC_DECODER)            += kmvc.o
-OBJS-$(CONFIG_LAGARITH_DECODER)        += lagarith.o lagarithrac.o
-OBJS-$(CONFIG_LJPEG_ENCODER)           += ljpegenc.o mjpegenc.o mjpeg.o
-OBJS-$(CONFIG_LOCO_DECODER)            += loco.o
-OBJS-$(CONFIG_MACE3_DECODER)           += mace.o
-OBJS-$(CONFIG_MACE6_DECODER)           += mace.o
-OBJS-$(CONFIG_MDEC_DECODER)            += mdec.o mpeg12.o mpeg12data.o
-OBJS-$(CONFIG_METASOUND_DECODER)       += metasound.o metasound_data.o \
-                                          twinvq.o
-OBJS-$(CONFIG_MIMIC_DECODER)           += mimic.o
-OBJS-$(CONFIG_MJPEG_DECODER)           += mjpegdec.o mjpeg.o
-OBJS-$(CONFIG_MJPEG_ENCODER)           += mjpegenc.o mjpeg.o
-OBJS-$(CONFIG_MJPEGB_DECODER)          += mjpegbdec.o mjpegdec.o mjpeg.o
-OBJS-$(CONFIG_MLP_DECODER)             += mlpdec.o mlpdsp.o
-OBJS-$(CONFIG_MMVIDEO_DECODER)         += mmvideo.o
-OBJS-$(CONFIG_MOTIONPIXELS_DECODER)    += motionpixels.o
-OBJS-$(CONFIG_MP1_DECODER)             += mpegaudiodec_fixed.o
-OBJS-$(CONFIG_MP1FLOAT_DECODER)        += mpegaudiodec_float.o
-OBJS-$(CONFIG_MP2_DECODER)             += mpegaudiodec_fixed.o
-OBJS-$(CONFIG_MP2_ENCODER)             += mpegaudioenc.o mpegaudio.o \
-                                          mpegaudiodata.o mpegaudiodsp_data.o
-OBJS-$(CONFIG_MP2FLOAT_DECODER)        += mpegaudiodec_float.o
-OBJS-$(CONFIG_MP3_DECODER)             += mpegaudiodec_fixed.o
-OBJS-$(CONFIG_MP3ADU_DECODER)          += mpegaudiodec_fixed.o
-OBJS-$(CONFIG_MP3ADUFLOAT_DECODER)     += mpegaudiodec_float.o
-OBJS-$(CONFIG_MP3FLOAT_DECODER)        += mpegaudiodec_float.o
-OBJS-$(CONFIG_MP3ON4_DECODER)          += mpegaudiodec_fixed.o mpeg4audio.o
-OBJS-$(CONFIG_MP3ON4FLOAT_DECODER)     += mpegaudiodec_float.o mpeg4audio.o
-OBJS-$(CONFIG_MPC7_DECODER)            += mpc7.o mpc.o
-OBJS-$(CONFIG_MPC8_DECODER)            += mpc8.o mpc.o
-OBJS-$(CONFIG_MPEG_XVMC_DECODER)       += mpegvideo_xvmc.o
-OBJS-$(CONFIG_MPEG1VIDEO_DECODER)      += mpeg12dec.o mpeg12.o mpeg12data.o
-OBJS-$(CONFIG_MPEG1VIDEO_ENCODER)      += mpeg12enc.o mpeg12.o
-OBJS-$(CONFIG_MPEG2VIDEO_DECODER)      += mpeg12dec.o mpeg12.o mpeg12data.o
-OBJS-$(CONFIG_MPEG2VIDEO_ENCODER)      += mpeg12enc.o mpeg12.o
-OBJS-$(CONFIG_MSMPEG4V1_DECODER)       += msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_MSMPEG4V2_DECODER)       += msmpeg4dec.o msmpeg4.o msmpeg4data.o \
-                                          h263dec.o h263.o ituh263dec.o \
-                                          mpeg4videodec.o
-OBJS-$(CONFIG_MSMPEG4V2_ENCODER)       += msmpeg4.o msmpeg4enc.o msmpeg4data.o \
-                                          h263.o
-OBJS-$(CONFIG_MSMPEG4V3_DECODER)       += msmpeg4dec.o msmpeg4.o msmpeg4data.o \
-                                          h263dec.o h263.o ituh263dec.o \
-                                          mpeg4videodec.o
-OBJS-$(CONFIG_MSMPEG4V3_ENCODER)       += msmpeg4.o msmpeg4enc.o msmpeg4data.o \
-                                          h263.o
-OBJS-$(CONFIG_MSRLE_DECODER)           += msrle.o msrledec.o
-OBJS-$(CONFIG_MSA1_DECODER)            += mss3.o mss34dsp.o
-OBJS-$(CONFIG_MSS1_DECODER)            += mss1.o mss12.o
-OBJS-$(CONFIG_MSS2_DECODER)            += mss2.o mss12.o mss2dsp.o
-OBJS-$(CONFIG_MSVIDEO1_DECODER)        += msvideo1.o
-OBJS-$(CONFIG_MSZH_DECODER)            += lcldec.o
-OBJS-$(CONFIG_MTS2_DECODER)            += mss4.o mss34dsp.o
-OBJS-$(CONFIG_MXPEG_DECODER)           += mxpegdec.o mjpegdec.o mjpeg.o
-OBJS-$(CONFIG_NELLYMOSER_DECODER)      += nellymoserdec.o nellymoser.o
-OBJS-$(CONFIG_NELLYMOSER_ENCODER)      += nellymoserenc.o nellymoser.o
-OBJS-$(CONFIG_NUV_DECODER)             += nuv.o rtjpeg.o
-OBJS-$(CONFIG_PAM_DECODER)             += pnmdec.o pnm.o
-OBJS-$(CONFIG_PAM_ENCODER)             += pamenc.o
-OBJS-$(CONFIG_PBM_DECODER)             += pnmdec.o pnm.o
-OBJS-$(CONFIG_PBM_ENCODER)             += pnmenc.o
-OBJS-$(CONFIG_PCX_DECODER)             += pcx.o
-OBJS-$(CONFIG_PCX_ENCODER)             += pcxenc.o
-OBJS-$(CONFIG_PGM_DECODER)             += pnmdec.o pnm.o
-OBJS-$(CONFIG_PGM_ENCODER)             += pnmenc.o
-OBJS-$(CONFIG_PGMYUV_DECODER)          += pnmdec.o pnm.o
-OBJS-$(CONFIG_PGMYUV_ENCODER)          += pnmenc.o
-OBJS-$(CONFIG_PGSSUB_DECODER)          += pgssubdec.o
-OBJS-$(CONFIG_PICTOR_DECODER)          += pictordec.o cga_data.o
-OBJS-$(CONFIG_PNG_DECODER)             += png.o pngdec.o pngdsp.o
-OBJS-$(CONFIG_PNG_ENCODER)             += png.o pngenc.o
-OBJS-$(CONFIG_PPM_DECODER)             += pnmdec.o pnm.o
-OBJS-$(CONFIG_PPM_ENCODER)             += pnmenc.o
-OBJS-$(CONFIG_PRORES_DECODER)          += proresdec.o proresdata.o proresdsp.o
-OBJS-$(CONFIG_PRORES_ENCODER)          += proresenc.o proresdata.o proresdsp.o
-OBJS-$(CONFIG_PTX_DECODER)             += ptx.o
-OBJS-$(CONFIG_QCELP_DECODER)           += qcelpdec.o                     \
-                                          celp_filters.o acelp_vectors.o \
-                                          acelp_filters.o
-OBJS-$(CONFIG_QDM2_DECODER)            += qdm2.o
-OBJS-$(CONFIG_QDRAW_DECODER)           += qdrw.o
-OBJS-$(CONFIG_QPEG_DECODER)            += qpeg.o
-OBJS-$(CONFIG_QTRLE_DECODER)           += qtrle.o
-OBJS-$(CONFIG_QTRLE_ENCODER)           += qtrleenc.o
-OBJS-$(CONFIG_R10K_DECODER)            += r210dec.o
-OBJS-$(CONFIG_R210_DECODER)            += r210dec.o
-OBJS-$(CONFIG_RA_144_DECODER)          += ra144dec.o ra144.o celp_filters.o
-OBJS-$(CONFIG_RA_144_ENCODER)          += ra144enc.o ra144.o celp_filters.o
-OBJS-$(CONFIG_RA_288_DECODER)          += ra288.o celp_filters.o
-OBJS-$(CONFIG_RALF_DECODER)            += ralf.o
-OBJS-$(CONFIG_RAWVIDEO_DECODER)        += rawdec.o
-OBJS-$(CONFIG_RAWVIDEO_ENCODER)        += rawenc.o
-OBJS-$(CONFIG_RL2_DECODER)             += rl2.o
-OBJS-$(CONFIG_ROQ_DECODER)             += roqvideodec.o roqvideo.o
-OBJS-$(CONFIG_ROQ_ENCODER)             += roqvideoenc.o roqvideo.o elbg.o
-OBJS-$(CONFIG_ROQ_DPCM_DECODER)        += dpcm.o
-OBJS-$(CONFIG_ROQ_DPCM_ENCODER)        += roqaudioenc.o
-OBJS-$(CONFIG_RPZA_DECODER)            += rpza.o
-OBJS-$(CONFIG_RV10_DECODER)            += rv10.o
-OBJS-$(CONFIG_RV10_ENCODER)            += rv10enc.o
-OBJS-$(CONFIG_RV20_DECODER)            += rv10.o
-OBJS-$(CONFIG_RV20_ENCODER)            += rv20enc.o
-OBJS-$(CONFIG_RV30_DECODER)            += rv30.o rv34.o rv30dsp.o rv34dsp.o
-OBJS-$(CONFIG_RV40_DECODER)            += rv40.o rv34.o rv34dsp.o rv40dsp.o
-OBJS-$(CONFIG_S302M_DECODER)           += s302m.o
-OBJS-$(CONFIG_SGI_DECODER)             += sgidec.o
-OBJS-$(CONFIG_SGI_ENCODER)             += sgienc.o rle.o
-OBJS-$(CONFIG_SHORTEN_DECODER)         += shorten.o
-OBJS-$(CONFIG_SIPR_DECODER)            += sipr.o acelp_pitch_delay.o \
-                                          celp_math.o acelp_vectors.o \
-                                          acelp_filters.o celp_filters.o \
-                                          sipr16k.o
-OBJS-$(CONFIG_SMACKAUD_DECODER)        += smacker.o
-OBJS-$(CONFIG_SMACKER_DECODER)         += smacker.o
-OBJS-$(CONFIG_SMC_DECODER)             += smc.o
-OBJS-$(CONFIG_SOL_DPCM_DECODER)        += dpcm.o
-OBJS-$(CONFIG_SP5X_DECODER)            += sp5xdec.o mjpegdec.o mjpeg.o
-OBJS-$(CONFIG_SRT_DECODER)             += srtdec.o ass.o
-OBJS-$(CONFIG_SUNRAST_DECODER)         += sunrast.o
-OBJS-$(CONFIG_SUNRAST_ENCODER)         += sunrastenc.o
-OBJS-$(CONFIG_SVQ1_DECODER)            += svq1dec.o svq1.o svq13.o h263.o
-OBJS-$(CONFIG_SVQ1_ENCODER)            += svq1enc.o svq1.o    \
-                                          h263.o ituh263enc.o
-OBJS-$(CONFIG_SVQ3_DECODER)            += svq3.o svq13.o h263.o h264.o        \
-                                          h264_loopfilter.o h264_direct.o     \
-                                          h264_sei.o h264_ps.o h264_refs.o    \
-                                          h264_cavlc.o h264_cabac.o cabac.o
-OBJS-$(CONFIG_TAK_DECODER)             += takdec.o tak.o
-OBJS-$(CONFIG_TARGA_DECODER)           += targa.o
-OBJS-$(CONFIG_TARGA_ENCODER)           += targaenc.o rle.o
-OBJS-$(CONFIG_THEORA_DECODER)          += xiph.o
-OBJS-$(CONFIG_THP_DECODER)             += mjpegdec.o mjpeg.o
-OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
-OBJS-$(CONFIG_TIFF_DECODER)            += tiff.o lzw.o faxcompr.o
-OBJS-$(CONFIG_TIFF_ENCODER)            += tiffenc.o rle.o lzwenc.o
-OBJS-$(CONFIG_TMV_DECODER)             += tmv.o cga_data.o
-OBJS-$(CONFIG_TRUEMOTION1_DECODER)     += truemotion1.o
-OBJS-$(CONFIG_TRUEMOTION2_DECODER)     += truemotion2.o
-OBJS-$(CONFIG_TRUESPEECH_DECODER)      += truespeech.o
-OBJS-$(CONFIG_TSCC_DECODER)            += tscc.o msrledec.o
-OBJS-$(CONFIG_TSCC2_DECODER)           += tscc2.o
-OBJS-$(CONFIG_TTA_DECODER)             += tta.o
-OBJS-$(CONFIG_TWINVQ_DECODER)          += twinvqdec.o twinvq.o
-OBJS-$(CONFIG_TXD_DECODER)             += txd.o s3tc.o
-OBJS-$(CONFIG_ULTI_DECODER)            += ulti.o
-OBJS-$(CONFIG_UTVIDEO_DECODER)         += utvideodec.o utvideo.o
-OBJS-$(CONFIG_UTVIDEO_ENCODER)         += utvideoenc.o utvideo.o
-OBJS-$(CONFIG_V210_DECODER)            += v210dec.o
-OBJS-$(CONFIG_V210_ENCODER)            += v210enc.o
-OBJS-$(CONFIG_V410_DECODER)            += v410dec.o
-OBJS-$(CONFIG_V410_ENCODER)            += v410enc.o
-OBJS-$(CONFIG_V210X_DECODER)           += v210x.o
-OBJS-$(CONFIG_VB_DECODER)              += vb.o
-OBJS-$(CONFIG_VBLE_DECODER)            += vble.o
-OBJS-$(CONFIG_VC1_DECODER)             += vc1dec.o vc1.o vc1data.o vc1dsp.o \
-                                          msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_VCR1_DECODER)            += vcr1.o
-OBJS-$(CONFIG_VMDAUDIO_DECODER)        += vmdav.o
-OBJS-$(CONFIG_VMDVIDEO_DECODER)        += vmdav.o
-OBJS-$(CONFIG_VMNC_DECODER)            += vmnc.o
-OBJS-$(CONFIG_VORBIS_DECODER)          += vorbisdec.o vorbisdsp.o vorbis.o \
-                                          vorbis_data.o xiph.o
-OBJS-$(CONFIG_VORBIS_ENCODER)          += vorbisenc.o vorbis.o \
-                                          vorbis_data.o
-OBJS-$(CONFIG_VP3_DECODER)             += vp3.o
-OBJS-$(CONFIG_VP5_DECODER)             += vp5.o vp56.o vp56data.o vp56dsp.o \
-                                          vp56rac.o
-OBJS-$(CONFIG_VP6_DECODER)             += vp6.o vp56.o vp56data.o vp56dsp.o \
-                                          vp6dsp.o vp56rac.o
-OBJS-$(CONFIG_VP8_DECODER)             += vp8.o vp8dsp.o vp56rac.o
-OBJS-$(CONFIG_VP9_DECODER)             += vp9.o vp9data.o vp9dsp.o \
-                                          vp9block.o vp9prob.o vp9mvs.o vp56rac.o
-OBJS-$(CONFIG_VQA_DECODER)             += vqavideo.o
-OBJS-$(CONFIG_WAVPACK_DECODER)         += wavpack.o
-OBJS-$(CONFIG_WEBP_DECODER)            += webp.o
-OBJS-$(CONFIG_WMALOSSLESS_DECODER)     += wmalosslessdec.o wma_common.o
-OBJS-$(CONFIG_WMAPRO_DECODER)          += wmaprodec.o wma.o wma_common.o
-OBJS-$(CONFIG_WMAV1_DECODER)           += wmadec.o wma.o wma_common.o aactab.o
-OBJS-$(CONFIG_WMAV1_ENCODER)           += wmaenc.o wma.o wma_common.o aactab.o
-OBJS-$(CONFIG_WMAV2_DECODER)           += wmadec.o wma.o wma_common.o aactab.o
-OBJS-$(CONFIG_WMAV2_ENCODER)           += wmaenc.o wma.o wma_common.o aactab.o
-OBJS-$(CONFIG_WMAVOICE_DECODER)        += wmavoice.o \
-                                          celp_filters.o \
-                                          acelp_vectors.o acelp_filters.o
-OBJS-$(CONFIG_WMV1_DECODER)            += msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_WMV2_DECODER)            += wmv2dec.o wmv2.o wmv2dsp.o \
-                                          msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_WMV2_ENCODER)            += wmv2enc.o wmv2.o wmv2dsp.o \
-                                          msmpeg4.o msmpeg4enc.o msmpeg4data.o
-OBJS-$(CONFIG_WNV1_DECODER)            += wnv1.o
-OBJS-$(CONFIG_WS_SND1_DECODER)         += ws-snd1.o
-OBJS-$(CONFIG_XAN_DPCM_DECODER)        += dpcm.o
-OBJS-$(CONFIG_XAN_WC3_DECODER)         += xan.o
-OBJS-$(CONFIG_XAN_WC4_DECODER)         += xxan.o
-OBJS-$(CONFIG_XBM_ENCODER)             += xbmenc.o
-OBJS-$(CONFIG_XL_DECODER)              += xl.o
-OBJS-$(CONFIG_XSUB_DECODER)            += xsubdec.o
-OBJS-$(CONFIG_XSUB_ENCODER)            += xsubenc.o
-OBJS-$(CONFIG_XWD_DECODER)             += xwddec.o
-OBJS-$(CONFIG_XWD_ENCODER)             += xwdenc.o
-OBJS-$(CONFIG_YOP_DECODER)             += yop.o
-OBJS-$(CONFIG_ZEROCODEC_DECODER)       += zerocodec.o
-OBJS-$(CONFIG_ZLIB_DECODER)            += lcldec.o
-OBJS-$(CONFIG_ZLIB_ENCODER)            += lclenc.o
-OBJS-$(CONFIG_ZMBV_DECODER)            += zmbv.o
-OBJS-$(CONFIG_ZMBV_ENCODER)            += zmbvenc.o
-
-# (AD)PCM decoders/encoders
-OBJS-$(CONFIG_PCM_ALAW_DECODER)           += pcm.o
-OBJS-$(CONFIG_PCM_ALAW_ENCODER)           += pcm.o
-OBJS-$(CONFIG_PCM_BLURAY_DECODER)         += pcm-bluray.o
-OBJS-$(CONFIG_PCM_DVD_DECODER)            += pcm-dvd.o
-OBJS-$(CONFIG_PCM_F32BE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_F32BE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_F32LE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_F32LE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_F64BE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_F64BE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_F64LE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_F64LE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_LXF_DECODER)            += pcm.o
-OBJS-$(CONFIG_PCM_MULAW_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_MULAW_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S8_DECODER)             += pcm.o
-OBJS-$(CONFIG_PCM_S8_ENCODER)             += pcm.o
-OBJS-$(CONFIG_PCM_S8_PLANAR_DECODER)      += 8svx.o
-OBJS-$(CONFIG_PCM_S16BE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S16BE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S16LE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S16LE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S16LE_PLANAR_DECODER)   += pcm.o
-OBJS-$(CONFIG_PCM_S24BE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S24BE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S24DAUD_DECODER)        += pcm.o
-OBJS-$(CONFIG_PCM_S24DAUD_ENCODER)        += pcm.o
-OBJS-$(CONFIG_PCM_S24LE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S24LE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S24LE_PLANAR_DECODER)   += pcm.o
-OBJS-$(CONFIG_PCM_S32BE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S32BE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S32LE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S32LE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_S32LE_PLANAR_DECODER)   += pcm.o
-OBJS-$(CONFIG_PCM_U8_DECODER)             += pcm.o
-OBJS-$(CONFIG_PCM_U8_ENCODER)             += pcm.o
-OBJS-$(CONFIG_PCM_U16BE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U16BE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U16LE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U16LE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U24BE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U24BE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U24LE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U24LE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U32BE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U32BE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U32LE_DECODER)          += pcm.o
-OBJS-$(CONFIG_PCM_U32LE_ENCODER)          += pcm.o
-OBJS-$(CONFIG_PCM_ZORK_DECODER)           += pcm.o
-
-OBJS-$(CONFIG_ADPCM_4XM_DECODER)          += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_ADX_DECODER)          += adxdec.o adx.o
-OBJS-$(CONFIG_ADPCM_ADX_ENCODER)          += adxenc.o adx.o
-OBJS-$(CONFIG_ADPCM_CT_DECODER)           += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_EA_DECODER)           += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_EA_MAXIS_XA_DECODER)  += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_EA_R1_DECODER)        += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_EA_R2_DECODER)        += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_EA_R3_DECODER)        += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_EA_XAS_DECODER)       += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_G722_DECODER)         += g722.o g722dec.o
-OBJS-$(CONFIG_ADPCM_G722_ENCODER)         += g722.o g722enc.o
-OBJS-$(CONFIG_ADPCM_G726_DECODER)         += g726.o
-OBJS-$(CONFIG_ADPCM_G726_ENCODER)         += g726.o
-OBJS-$(CONFIG_ADPCM_IMA_AMV_DECODER)      += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_APC_DECODER)      += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER)      += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER)      += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER)  += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_EA_SEAD_DECODER)  += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_ISS_DECODER)      += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER)       += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER)       += adpcmenc.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER)   += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_WAV_DECODER)      += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER)      += adpcmenc.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_IMA_WS_DECODER)       += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_MS_DECODER)           += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_MS_ENCODER)           += adpcmenc.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_SBPRO_2_DECODER)      += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_SBPRO_3_DECODER)      += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_SBPRO_4_DECODER)      += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_SWF_DECODER)          += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_SWF_ENCODER)          += adpcmenc.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_THP_DECODER)          += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_XA_DECODER)           += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER)       += adpcm.o adpcm_data.o
-OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER)       += adpcmenc.o adpcm_data.o
-
-# hardware accelerators
-OBJS-$(CONFIG_H263_VAAPI_HWACCEL)         += vaapi_mpeg4.o
-OBJS-$(CONFIG_H263_VDPAU_HWACCEL)         += vdpau_mpeg4.o
-OBJS-$(CONFIG_H264_DXVA2_HWACCEL)         += dxva2_h264.o
-OBJS-$(CONFIG_H264_VAAPI_HWACCEL)         += vaapi_h264.o
-OBJS-$(CONFIG_H264_VDA_HWACCEL)           += vda_h264.o
-OBJS-$(CONFIG_H264_VDPAU_HWACCEL)         += vdpau_h264.o
-OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL)        += vdpau_mpeg12.o
-OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL)        += dxva2_mpeg2.o
-OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL)        += vaapi_mpeg2.o
-OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL)        += vdpau_mpeg12.o
-OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL)        += vaapi_mpeg4.o
-OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL)        += vdpau_mpeg4.o
-OBJS-$(CONFIG_VC1_DXVA2_HWACCEL)          += dxva2_vc1.o
-OBJS-$(CONFIG_VC1_VAAPI_HWACCEL)          += vaapi_vc1.o
-OBJS-$(CONFIG_VC1_VDPAU_HWACCEL)          += vdpau_vc1.o
-
-# libavformat dependencies
-OBJS-$(CONFIG_ADTS_MUXER)              += mpeg4audio.o
-OBJS-$(CONFIG_ADX_DEMUXER)             += adx.o
-OBJS-$(CONFIG_CAF_DEMUXER)             += mpeg4audio.o mpegaudiodata.o  \
-                                          ac3tab.o
-OBJS-$(CONFIG_DV_DEMUXER)              += dv_profile.o
-OBJS-$(CONFIG_DV_MUXER)                += dv_profile.o
-OBJS-$(CONFIG_FLAC_DEMUXER)            += flac.o flacdata.o             \
-                                          vorbis_parser.o xiph.o
-OBJS-$(CONFIG_FLAC_MUXER)              += flac.o flacdata.o
-OBJS-$(CONFIG_FLV_DEMUXER)             += mpeg4audio.o
-OBJS-$(CONFIG_GXF_DEMUXER)             += mpeg12data.o
-OBJS-$(CONFIG_IFF_DEMUXER)             += iff.o
-OBJS-$(CONFIG_ISMV_MUXER)              += mpeg4audio.o mpegaudiodata.o
-OBJS-$(CONFIG_LATM_MUXER)              += mpeg4audio.o
-OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER)    += xiph.o mpeg4audio.o           \
-                                          flac.o flacdata.o
-OBJS-$(CONFIG_MATROSKA_DEMUXER)        += mpeg4audio.o mpegaudiodata.o
-OBJS-$(CONFIG_MATROSKA_MUXER)          += mpeg4audio.o mpegaudiodata.o  \
-                                          flac.o flacdata.o xiph.o
-OBJS-$(CONFIG_MP2_MUXER)               += mpegaudiodata.o mpegaudiodecheader.o
-OBJS-$(CONFIG_MP3_MUXER)               += mpegaudiodata.o mpegaudiodecheader.o
-OBJS-$(CONFIG_MOV_DEMUXER)             += mpeg4audio.o mpegaudiodata.o ac3tab.o
-OBJS-$(CONFIG_MOV_MUXER)               += mpeg4audio.o mpegaudiodata.o
-OBJS-$(CONFIG_MPEGTS_MUXER)            += mpeg4audio.o
-OBJS-$(CONFIG_MPEGTS_DEMUXER)          += mpeg4audio.o mpegaudiodata.o
-OBJS-$(CONFIG_NUT_MUXER)               += mpegaudiodata.o
-OBJS-$(CONFIG_OGG_DEMUXER)             += xiph.o flac.o flacdata.o     \
-                                          mpeg12data.o vorbis_parser.o \
-                                          dirac.o
-OBJS-$(CONFIG_OGG_MUXER)               += xiph.o flac.o flacdata.o
-OBJS-$(CONFIG_RTP_MUXER)               += mpeg4audio.o xiph.o
-OBJS-$(CONFIG_RTPDEC)                  += mjpeg.o
-OBJS-$(CONFIG_SPDIF_DEMUXER)           += aacadtsdec.o mpeg4audio.o
-OBJS-$(CONFIG_SPDIF_MUXER)             += dca.o
-OBJS-$(CONFIG_TAK_DEMUXER)             += tak.o
-OBJS-$(CONFIG_WEBM_MUXER)              += mpeg4audio.o mpegaudiodata.o  \
-                                          xiph.o flac.o flacdata.o
-OBJS-$(CONFIG_WTV_DEMUXER)             += mpeg4audio.o mpegaudiodata.o
-
-# external codec libraries
-OBJS-$(CONFIG_LIBFAAC_ENCODER)            += libfaac.o
-OBJS-$(CONFIG_LIBFDK_AAC_DECODER)         += libfdk-aacdec.o
-OBJS-$(CONFIG_LIBFDK_AAC_ENCODER)         += libfdk-aacenc.o
-OBJS-$(CONFIG_LIBGSM_DECODER)             += libgsm.o
-OBJS-$(CONFIG_LIBGSM_ENCODER)             += libgsm.o
-OBJS-$(CONFIG_LIBGSM_MS_DECODER)          += libgsm.o
-OBJS-$(CONFIG_LIBGSM_MS_ENCODER)          += libgsm.o
-OBJS-$(CONFIG_LIBILBC_DECODER)            += libilbc.o
-OBJS-$(CONFIG_LIBILBC_ENCODER)            += libilbc.o
-OBJS-$(CONFIG_LIBMP3LAME_ENCODER)         += libmp3lame.o mpegaudiodecheader.o
-OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER)  += libopencore-amr.o
-OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER)  += libopencore-amr.o
-OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER)  += libopencore-amr.o
-OBJS-$(CONFIG_LIBOPENJPEG_DECODER)        += libopenjpegdec.o
-OBJS-$(CONFIG_LIBOPENJPEG_ENCODER)        += libopenjpegenc.o
-OBJS-$(CONFIG_LIBOPUS_DECODER)            += libopusdec.o libopus.o     \
-                                             vorbis_data.o
-OBJS-$(CONFIG_LIBOPUS_ENCODER)            += libopusenc.o libopus.o     \
-                                             vorbis_data.o
-OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER)    += libschroedingerdec.o \
-                                             libschroedinger.o
-OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER)    += libschroedingerenc.o \
-                                             libschroedinger.o
-OBJS-$(CONFIG_LIBSPEEX_DECODER)           += libspeexdec.o
-OBJS-$(CONFIG_LIBSPEEX_ENCODER)           += libspeexenc.o
-OBJS-$(CONFIG_LIBTHEORA_ENCODER)          += libtheoraenc.o
-OBJS-$(CONFIG_LIBVO_AACENC_ENCODER)       += libvo-aacenc.o mpeg4audio.o
-OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER)     += libvo-amrwbenc.o
-OBJS-$(CONFIG_LIBVORBIS_ENCODER)          += libvorbis.o \
-                                             vorbis_data.o vorbis_parser.o
-OBJS-$(CONFIG_LIBVPX_VP8_DECODER)         += libvpxdec.o
-OBJS-$(CONFIG_LIBVPX_VP8_ENCODER)         += libvpxenc.o
-OBJS-$(CONFIG_LIBVPX_VP9_DECODER)         += libvpxdec.o libvpx.o
-OBJS-$(CONFIG_LIBVPX_VP9_ENCODER)         += libvpxenc.o libvpx.o
-OBJS-$(CONFIG_LIBWAVPACK_ENCODER)         += libwavpackenc.o
-OBJS-$(CONFIG_LIBWEBP_ENCODER)            += libwebpenc.o
-OBJS-$(CONFIG_LIBX264_ENCODER)            += libx264.o
-OBJS-$(CONFIG_LIBXAVS_ENCODER)            += libxavs.o
-OBJS-$(CONFIG_LIBXVID_ENCODER)            += libxvid.o
-
-# parsers
-OBJS-$(CONFIG_AAC_PARSER)              += aac_parser.o aac_ac3_parser.o \
-                                          aacadtsdec.o mpeg4audio.o
-OBJS-$(CONFIG_AAC_LATM_PARSER)         += latm_parser.o
-OBJS-$(CONFIG_AC3_PARSER)              += ac3_parser.o ac3tab.o \
-                                          aac_ac3_parser.o
-OBJS-$(CONFIG_ADX_PARSER)              += adx_parser.o adx.o
-OBJS-$(CONFIG_CAVSVIDEO_PARSER)        += cavs_parser.o
-OBJS-$(CONFIG_COOK_PARSER)             += cook_parser.o
-OBJS-$(CONFIG_DCA_PARSER)              += dca_parser.o dca.o
-OBJS-$(CONFIG_DIRAC_PARSER)            += dirac_parser.o
-OBJS-$(CONFIG_DNXHD_PARSER)            += dnxhd_parser.o
-OBJS-$(CONFIG_DVBSUB_PARSER)           += dvbsub_parser.o
-OBJS-$(CONFIG_DVDSUB_PARSER)           += dvdsub_parser.o
-OBJS-$(CONFIG_FLAC_PARSER)             += flac_parser.o flacdata.o flac.o
-OBJS-$(CONFIG_GSM_PARSER)              += gsm_parser.o
-OBJS-$(CONFIG_H261_PARSER)             += h261_parser.o
-OBJS-$(CONFIG_H263_PARSER)             += h263_parser.o
-OBJS-$(CONFIG_H264_PARSER)             += h264_parser.o h264.o            \
-                                          cabac.o                         \
-                                          h264_refs.o h264_sei.o h264_direct.o \
-                                          h264_loopfilter.o h264_cabac.o \
-                                          h264_cavlc.o h264_ps.o
-OBJS-$(CONFIG_HEVC_PARSER)             += hevc_parser.o
-OBJS-$(CONFIG_MJPEG_PARSER)            += mjpeg_parser.o
-OBJS-$(CONFIG_MLP_PARSER)              += mlp_parser.o mlp.o
-OBJS-$(CONFIG_MPEG4VIDEO_PARSER)       += mpeg4video_parser.o h263.o \
-                                          mpeg4videodec.o mpeg4video.o \
-                                          ituh263dec.o h263dec.o
-OBJS-$(CONFIG_MPEGAUDIO_PARSER)        += mpegaudio_parser.o \
-                                          mpegaudiodecheader.o mpegaudiodata.o
-OBJS-$(CONFIG_MPEGVIDEO_PARSER)        += mpegvideo_parser.o    \
-                                          mpeg12.o mpeg12data.o
-OBJS-$(CONFIG_PNG_PARSER)              += png_parser.o
-OBJS-$(CONFIG_PNM_PARSER)              += pnm_parser.o pnm.o
-OBJS-$(CONFIG_RV30_PARSER)             += rv34_parser.o
-OBJS-$(CONFIG_RV40_PARSER)             += rv34_parser.o
-OBJS-$(CONFIG_TAK_PARSER)              += tak_parser.o tak.o
-OBJS-$(CONFIG_VC1_PARSER)              += vc1_parser.o vc1.o vc1data.o \
-                                          msmpeg4.o msmpeg4data.o mpeg4video.o \
-                                          h263.o
-OBJS-$(CONFIG_VORBIS_PARSER)           += vorbis_parser.o xiph.o
-OBJS-$(CONFIG_VP3_PARSER)              += vp3_parser.o
-OBJS-$(CONFIG_VP8_PARSER)              += vp8_parser.o
-
-# bitstream filters
-OBJS-$(CONFIG_AAC_ADTSTOASC_BSF)          += aac_adtstoasc_bsf.o aacadtsdec.o \
-                                             mpeg4audio.o
-OBJS-$(CONFIG_CHOMP_BSF)                  += chomp_bsf.o
-OBJS-$(CONFIG_DUMP_EXTRADATA_BSF)         += dump_extradata_bsf.o
-OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF)       += h264_mp4toannexb_bsf.o
-OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF)        += imx_dump_header_bsf.o
-OBJS-$(CONFIG_MJPEG2JPEG_BSF)             += mjpeg2jpeg_bsf.o mjpeg.o
-OBJS-$(CONFIG_MJPEGA_DUMP_HEADER_BSF)     += mjpega_dump_header_bsf.o
-OBJS-$(CONFIG_MOV2TEXTSUB_BSF)            += movsub_bsf.o
-OBJS-$(CONFIG_NOISE_BSF)                  += noise_bsf.o
-OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)       += remove_extradata_bsf.o
-OBJS-$(CONFIG_TEXT2MOVSUB_BSF)            += movsub_bsf.o
-
-# thread libraries
-OBJS-$(HAVE_LIBC_MSVCRT)               += file_open.o
-OBJS-$(HAVE_THREADS)                   += pthread.o pthread_slice.o pthread_frame.o
-
-SKIPHEADERS                            += %_tablegen.h                  \
-                                          %_tables.h                    \
-                                          aac_tablegen_decl.h           \
-                                          fft-internal.h                \
-                                          tableprint.h                  \
-                                          $(ARCH)/vp56_arith.h          \
-
-SKIPHEADERS-$(CONFIG_DXVA2)            += dxva2.h dxva2_internal.h
-SKIPHEADERS-$(CONFIG_LIBSCHROEDINGER)  += libschroedinger.h
-SKIPHEADERS-$(CONFIG_MPEG_XVMC_DECODER) += xvmc.h
-SKIPHEADERS-$(CONFIG_VAAPI)            += vaapi_internal.h
-SKIPHEADERS-$(CONFIG_VDA)              += vda.h
-SKIPHEADERS-$(CONFIG_VDPAU)            += vdpau.h vdpau_internal.h
-
-TESTPROGS = dct                                                         \
-            fft                                                         \
-            fft-fixed                                                   \
-            golomb                                                      \
-            iirfilter                                                   \
-            rangecoder                                                  \
-
-TESTOBJS = dctref.o
-
-HOSTPROGS = aac_tablegen                                                \
-            aacps_tablegen                                              \
-            cbrt_tablegen                                               \
-            cos_tablegen                                                \
-            dv_tablegen                                                 \
-            motionpixels_tablegen                                       \
-            mpegaudio_tablegen                                          \
-            pcm_tablegen                                                \
-            qdm2_tablegen                                               \
-            sinewin_tablegen                                            \
-
-CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
-
-$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o $(SUBDIR)aandcttab.o
-$(SUBDIR)dv_tablegen$(HOSTEXESUF): $(SUBDIR)dvdata_host.o
-
-TRIG_TABLES  = cos cos_fixed sin
-TRIG_TABLES := $(TRIG_TABLES:%=$(SUBDIR)%_tables.c)
-
-$(TRIG_TABLES): $(SUBDIR)%_tables.c: $(SUBDIR)cos_tablegen$(HOSTEXESUF)
-	$(M)./$< $* > $@
-
-ifdef CONFIG_SMALL
-$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=1
-else
-$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=0
-endif
-
-GEN_HEADERS = cbrt_tables.h aacps_tables.h aac_tables.h dv_tables.h     \
-              sinewin_tables.h mpegaudio_tables.h motionpixels_tables.h \
-              pcm_tables.h qdm2_tables.h
-GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS))
-
-$(GEN_HEADERS): $(SUBDIR)%_tables.h: $(SUBDIR)%_tablegen$(HOSTEXESUF)
-	$(M)./$< > $@
-
-ifdef CONFIG_HARDCODED_TABLES
-$(SUBDIR)aacdec.o: $(SUBDIR)cbrt_tables.h
-$(SUBDIR)aacps.o: $(SUBDIR)aacps_tables.h
-$(SUBDIR)aactab.o: $(SUBDIR)aac_tables.h
-$(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
-$(SUBDIR)sinewin.o: $(SUBDIR)sinewin_tables.h
-$(SUBDIR)mpegaudiodec_fixed.o: $(SUBDIR)mpegaudio_tables.h
-$(SUBDIR)mpegaudiodec_float.o: $(SUBDIR)mpegaudio_tables.h
-$(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h
-$(SUBDIR)pcm.o: $(SUBDIR)pcm_tables.h
-$(SUBDIR)qdm2.o: $(SUBDIR)qdm2_tables.h
-endif
diff --git a/deps/libav/libavcodec/a64colors.h b/deps/libav/libavcodec/a64colors.h
deleted file mode 100644
index d977426..0000000
--- a/deps/libav/libavcodec/a64colors.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * a64 video encoder - c64 colors in rgb (Pepto)
- * Copyright (c) 2009 Tobias Bindhammer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * a64 video encoder - c64 colors in rgb
- */
-
-#ifndef AVCODEC_A64COLORS_H
-#define AVCODEC_A64COLORS_H
-
-#include <stdint.h>
-
-/* c64 palette in RGB */
-static const uint8_t a64_palette[16][3] = {
-    {0x00, 0x00, 0x00},
-    {0xff, 0xff, 0xff},
-    {0x68, 0x37, 0x2b},
-    {0x70, 0xa4, 0xb2},
-    {0x6f, 0x3d, 0x86},
-    {0x58, 0x8d, 0x43},
-    {0x35, 0x28, 0x79},
-    {0xb8, 0xc7, 0x6f},
-    {0x6f, 0x4f, 0x25},
-    {0x43, 0x39, 0x00},
-    {0x9a, 0x67, 0x59},
-    {0x44, 0x44, 0x44},
-    {0x6c, 0x6c, 0x6c},
-    {0x9a, 0xd2, 0x84},
-    {0x6c, 0x5e, 0xb5},
-    {0x95, 0x95, 0x95},
-};
-
-#endif /* AVCODEC_A64COLORS_H */
diff --git a/deps/libav/libavcodec/a64enc.h b/deps/libav/libavcodec/a64enc.h
deleted file mode 100644
index 65c1d30..0000000
--- a/deps/libav/libavcodec/a64enc.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * a64 video encoder - basic headers
- * Copyright (c) 2009 Tobias Bindhammer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * a64 video encoder - basic headers
- */
-
-#ifndef AVCODEC_A64ENC_H
-#define AVCODEC_A64ENC_H
-
-#include "libavutil/lfg.h"
-#include "avcodec.h"
-
-#define C64XRES 320
-#define C64YRES 200
-
-typedef struct A64Context {
-    /* variables for multicolor modes */
-    AVLFG randctx;
-    int mc_lifetime;
-    int mc_use_5col;
-    unsigned mc_frame_counter;
-    int *mc_meta_charset;
-    int *mc_charmap;
-    int *mc_best_cb;
-    int mc_luma_vals[5];
-    uint8_t *mc_charset;
-    uint8_t *mc_colram;
-    uint8_t *mc_palette;
-    int mc_pal_size;
-
-    /* pts of the next packet that will be output */
-    int64_t next_pts;
-} A64Context;
-
-#endif /* AVCODEC_A64ENC_H */
diff --git a/deps/libav/libavcodec/a64multienc.c b/deps/libav/libavcodec/a64multienc.c
deleted file mode 100644
index 11d6e2c..0000000
--- a/deps/libav/libavcodec/a64multienc.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * a64 video encoder - multicolor modes
- * Copyright (c) 2009 Tobias Bindhammer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * a64 video encoder - multicolor modes
- */
-
-#include "a64enc.h"
-#include "a64colors.h"
-#include "a64tables.h"
-#include "elbg.h"
-#include "internal.h"
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-
-#define DITHERSTEPS   8
-#define CHARSET_CHARS 256
-#define INTERLACED    1
-#define CROP_SCREENS  1
-
-/* gray gradient */
-static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1};
-
-/* other possible gradients - to be tested */
-//static const int mc_colors[5]={0x0,0x8,0xa,0xf,0x7};
-//static const int mc_colors[5]={0x0,0x9,0x8,0xa,0x3};
-
-static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
-{
-    int blockx, blocky, x, y;
-    int luma = 0;
-    int height = FFMIN(avctx->height, C64YRES);
-    int width  = FFMIN(avctx->width , C64XRES);
-    uint8_t *src = p->data[0];
-
-    for (blocky = 0; blocky < C64YRES; blocky += 8) {
-        for (blockx = 0; blockx < C64XRES; blockx += 8) {
-            for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {
-                for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {
-                    if(x < width && y < height) {
-                        /* build average over 2 pixels */
-                        luma = (src[(x + 0 + y * p->linesize[0])] +
-                                src[(x + 1 + y * p->linesize[0])]) / 2;
-                        /* write blocks as linear data now so they are suitable for elbg */
-                        dest[0] = luma;
-                    }
-                    dest++;
-                }
-            }
-        }
-    }
-}
-
-static void render_charset(AVCodecContext *avctx, uint8_t *charset,
-                           uint8_t *colrammap)
-{
-    A64Context *c = avctx->priv_data;
-    uint8_t row1, row2;
-    int charpos, x, y;
-    int a, b;
-    uint8_t pix;
-    int lowdiff, highdiff;
-    int *best_cb = c->mc_best_cb;
-    static uint8_t index1[256];
-    static uint8_t index2[256];
-    static uint8_t dither[256];
-    int i;
-    int distance;
-
-    /* generate lookup-tables for dither and index before looping */
-    i = 0;
-    for (a=0; a < 256; a++) {
-        if(i < c->mc_pal_size -1 && a == c->mc_luma_vals[i + 1]) {
-            distance = c->mc_luma_vals[i + 1] - c->mc_luma_vals[i];
-            for(b = 0; b <= distance; b++) {
-                  dither[c->mc_luma_vals[i] + b] = b * (DITHERSTEPS - 1) / distance;
-            }
-            i++;
-        }
-        if(i >= c->mc_pal_size - 1) dither[a] = 0;
-        index1[a] = i;
-        index2[a] = FFMIN(i + 1, c->mc_pal_size - 1);
-    }
-
-    /* and render charset */
-    for (charpos = 0; charpos < CHARSET_CHARS; charpos++) {
-        lowdiff  = 0;
-        highdiff = 0;
-        for (y = 0; y < 8; y++) {
-            row1 = 0; row2 = 0;
-            for (x = 0; x < 4; x++) {
-                pix = best_cb[y * 4 + x];
-
-                /* accumulate error for brightest/darkest color */
-                if (index1[pix] >= 3)
-                    highdiff += pix - c->mc_luma_vals[3];
-                if (index1[pix] < 1)
-                    lowdiff += c->mc_luma_vals[1] - pix;
-
-                row1 <<= 2;
-
-                if (INTERLACED) {
-                    row2 <<= 2;
-                    if (interlaced_dither_patterns[dither[pix]][(y & 3) * 2 + 0][x & 3])
-                        row1 |= 3-(index2[pix] & 3);
-                    else
-                        row1 |= 3-(index1[pix] & 3);
-
-                    if (interlaced_dither_patterns[dither[pix]][(y & 3) * 2 + 1][x & 3])
-                        row2 |= 3-(index2[pix] & 3);
-                    else
-                        row2 |= 3-(index1[pix] & 3);
-                }
-                else {
-                    if (multi_dither_patterns[dither[pix]][(y & 3)][x & 3])
-                        row1 |= 3-(index2[pix] & 3);
-                    else
-                        row1 |= 3-(index1[pix] & 3);
-                }
-            }
-            charset[y+0x000] = row1;
-            if (INTERLACED) charset[y+0x800] = row2;
-        }
-        /* do we need to adjust pixels? */
-        if (highdiff > 0 && lowdiff > 0 && c->mc_use_5col) {
-            if (lowdiff > highdiff) {
-                for (x = 0; x < 32; x++)
-                    best_cb[x] = FFMIN(c->mc_luma_vals[3], best_cb[x]);
-            } else {
-                for (x = 0; x < 32; x++)
-                    best_cb[x] = FFMAX(c->mc_luma_vals[1], best_cb[x]);
-            }
-            charpos--;          /* redo now adjusted char */
-        /* no adjustment needed, all fine */
-        } else {
-            /* advance pointers */
-            best_cb += 32;
-            charset += 8;
-
-            /* remember colorram value */
-            colrammap[charpos] = (highdiff > 0);
-        }
-    }
-}
-
-static av_cold int a64multi_close_encoder(AVCodecContext *avctx)
-{
-    A64Context *c = avctx->priv_data;
-    av_frame_free(&avctx->coded_frame);
-    av_free(c->mc_meta_charset);
-    av_free(c->mc_best_cb);
-    av_free(c->mc_charset);
-    av_free(c->mc_charmap);
-    av_free(c->mc_colram);
-    return 0;
-}
-
-static av_cold int a64multi_init_encoder(AVCodecContext *avctx)
-{
-    A64Context *c = avctx->priv_data;
-    int a;
-    av_lfg_init(&c->randctx, 1);
-
-    if (avctx->global_quality < 1) {
-        c->mc_lifetime = 4;
-    } else {
-        c->mc_lifetime = avctx->global_quality /= FF_QP2LAMBDA;
-    }
-
-    av_log(avctx, AV_LOG_INFO, "charset lifetime set to %d frame(s)\n", c->mc_lifetime);
-
-    c->mc_frame_counter = 0;
-    c->mc_use_5col      = avctx->codec->id == AV_CODEC_ID_A64_MULTI5;
-    c->mc_pal_size      = 4 + c->mc_use_5col;
-
-    /* precalc luma values for later use */
-    for (a = 0; a < c->mc_pal_size; a++) {
-        c->mc_luma_vals[a]=a64_palette[mc_colors[a]][0] * 0.30 +
-                           a64_palette[mc_colors[a]][1] * 0.59 +
-                           a64_palette[mc_colors[a]][2] * 0.11;
-    }
-
-    if (!(c->mc_meta_charset = av_malloc(32000 * c->mc_lifetime * sizeof(int))) ||
-       !(c->mc_best_cb       = av_malloc(CHARSET_CHARS * 32 * sizeof(int)))     ||
-       !(c->mc_charmap       = av_mallocz(1000 * c->mc_lifetime * sizeof(int))) ||
-       !(c->mc_colram        = av_mallocz(CHARSET_CHARS * sizeof(uint8_t)))     ||
-       !(c->mc_charset       = av_malloc(0x800 * (INTERLACED+1) * sizeof(uint8_t)))) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to allocate buffer memory.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    /* set up extradata */
-    if (!(avctx->extradata = av_mallocz(8 * 4 + FF_INPUT_BUFFER_PADDING_SIZE))) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to allocate memory for extradata.\n");
-        return AVERROR(ENOMEM);
-    }
-    avctx->extradata_size = 8 * 4;
-    AV_WB32(avctx->extradata, c->mc_lifetime);
-    AV_WB32(avctx->extradata + 16, INTERLACED);
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame) {
-        a64multi_close_encoder(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-    if (!avctx->codec_tag)
-         avctx->codec_tag = AV_RL32("a64m");
-
-    c->next_pts = AV_NOPTS_VALUE;
-
-    return 0;
-}
-
-static void a64_compress_colram(unsigned char *buf, int *charmap, uint8_t *colram)
-{
-    int a;
-    uint8_t temp;
-    /* only needs to be done in 5col mode */
-    /* XXX could be squeezed to 0x80 bytes */
-    for (a = 0; a < 256; a++) {
-        temp  = colram[charmap[a + 0x000]] << 0;
-        temp |= colram[charmap[a + 0x100]] << 1;
-        temp |= colram[charmap[a + 0x200]] << 2;
-        if (a < 0xe8) temp |= colram[charmap[a + 0x300]] << 3;
-        buf[a] = temp << 2;
-    }
-}
-
-static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                                 const AVFrame *pict, int *got_packet)
-{
-    A64Context *c = avctx->priv_data;
-    AVFrame *const p = avctx->coded_frame;
-
-    int frame;
-    int x, y;
-    int b_height;
-    int b_width;
-
-    int req_size, ret;
-    uint8_t *buf;
-
-    int *charmap     = c->mc_charmap;
-    uint8_t *colram  = c->mc_colram;
-    uint8_t *charset = c->mc_charset;
-    int *meta        = c->mc_meta_charset;
-    int *best_cb     = c->mc_best_cb;
-
-    int charset_size = 0x800 * (INTERLACED + 1);
-    int colram_size  = 0x100 * c->mc_use_5col;
-    int screen_size;
-
-    if(CROP_SCREENS) {
-        b_height = FFMIN(avctx->height,C64YRES) >> 3;
-        b_width  = FFMIN(avctx->width ,C64XRES) >> 3;
-        screen_size = b_width * b_height;
-    } else {
-        b_height = C64YRES >> 3;
-        b_width  = C64XRES >> 3;
-        screen_size = 0x400;
-    }
-
-    /* no data, means end encoding asap */
-    if (!pict) {
-        /* all done, end encoding */
-        if (!c->mc_lifetime) return 0;
-        /* no more frames in queue, prepare to flush remaining frames */
-        if (!c->mc_frame_counter) {
-            c->mc_lifetime = 0;
-        }
-        /* still frames in queue so limit lifetime to remaining frames */
-        else c->mc_lifetime = c->mc_frame_counter;
-    /* still new data available */
-    } else {
-        /* fill up mc_meta_charset with data until lifetime exceeds */
-        if (c->mc_frame_counter < c->mc_lifetime) {
-            *p = *pict;
-            p->pict_type = AV_PICTURE_TYPE_I;
-            p->key_frame = 1;
-            to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter);
-            c->mc_frame_counter++;
-            if (c->next_pts == AV_NOPTS_VALUE)
-                c->next_pts = pict->pts;
-            /* lifetime is not reached so wait for next frame first */
-            return 0;
-        }
-    }
-
-    /* lifetime reached so now convert X frames at once */
-    if (c->mc_frame_counter == c->mc_lifetime) {
-        req_size = 0;
-        /* any frames to encode? */
-        if (c->mc_lifetime) {
-            req_size = charset_size + c->mc_lifetime*(screen_size + colram_size);
-            if ((ret = ff_alloc_packet(pkt, req_size)) < 0) {
-                av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", req_size);
-                return ret;
-            }
-            buf = pkt->data;
-
-            /* calc optimal new charset + charmaps */
-            ff_init_elbg(meta, 32, 1000 * c->mc_lifetime, best_cb, CHARSET_CHARS, 50, charmap, &c->randctx);
-            ff_do_elbg  (meta, 32, 1000 * c->mc_lifetime, best_cb, CHARSET_CHARS, 50, charmap, &c->randctx);
-
-            /* create colorram map and a c64 readable charset */
-            render_charset(avctx, charset, colram);
-
-            /* copy charset to buf */
-            memcpy(buf, charset, charset_size);
-
-            /* advance pointers */
-            buf      += charset_size;
-            charset  += charset_size;
-        }
-
-        /* write x frames to buf */
-        for (frame = 0; frame < c->mc_lifetime; frame++) {
-            /* copy charmap to buf. buf is uchar*, charmap is int*, so no memcpy here, sorry */
-            for (y = 0; y < b_height; y++) {
-                for (x = 0; x < b_width; x++) {
-                    buf[y * b_width + x] = charmap[y * b_width + x];
-                }
-            }
-            /* advance pointers */
-            buf += screen_size;
-            req_size += screen_size;
-
-            /* compress and copy colram to buf */
-            if (c->mc_use_5col) {
-                a64_compress_colram(buf, charmap, colram);
-                /* advance pointers */
-                buf += colram_size;
-                req_size += colram_size;
-            }
-
-            /* advance to next charmap */
-            charmap += 1000;
-        }
-
-        AV_WB32(avctx->extradata + 4,  c->mc_frame_counter);
-        AV_WB32(avctx->extradata + 8,  charset_size);
-        AV_WB32(avctx->extradata + 12, screen_size + colram_size);
-
-        /* reset counter */
-        c->mc_frame_counter = 0;
-
-        pkt->pts = pkt->dts = c->next_pts;
-        c->next_pts         = AV_NOPTS_VALUE;
-
-        pkt->size   = req_size;
-        pkt->flags |= AV_PKT_FLAG_KEY;
-        *got_packet = !!req_size;
-    }
-    return 0;
-}
-
-AVCodec ff_a64multi_encoder = {
-    .name           = "a64multi",
-    .long_name      = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_A64_MULTI,
-    .priv_data_size = sizeof(A64Context),
-    .init           = a64multi_init_encoder,
-    .encode2        = a64multi_encode_frame,
-    .close          = a64multi_close_encoder,
-    .pix_fmts       = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
-    .capabilities   = CODEC_CAP_DELAY,
-};
-
-AVCodec ff_a64multi5_encoder = {
-    .name           = "a64multi5",
-    .long_name      = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_A64_MULTI5,
-    .priv_data_size = sizeof(A64Context),
-    .init           = a64multi_init_encoder,
-    .encode2        = a64multi_encode_frame,
-    .close          = a64multi_close_encoder,
-    .pix_fmts       = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
-    .capabilities   = CODEC_CAP_DELAY,
-};
diff --git a/deps/libav/libavcodec/a64tables.h b/deps/libav/libavcodec/a64tables.h
deleted file mode 100644
index b95c5ce..0000000
--- a/deps/libav/libavcodec/a64tables.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * a64 video encoder - tables used by a64 encoders
- * Copyright (c) 2009 Tobias Bindhammer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * a64 video encoder - tables used by a64 encoders
- */
-
-#ifndef AVCODEC_A64TABLES_H
-#define AVCODEC_A64TABLES_H
-
-#include <stdint.h>
-
-/**
- * dither patterns used vor rendering the multicolor charset
- */
-
-static const uint8_t multi_dither_patterns[9][4][4] = {
-    {
-     {0, 0, 0, 0},
-     {0, 0, 0, 0},
-     {0, 0, 0, 0},
-     {0, 0, 0, 0}
-     },
-    {
-     {1, 0, 0, 0},
-     {0, 0, 0, 0},
-     {0, 0, 1, 0},
-     {0, 0, 0, 0}
-     },
-    {
-     {1, 0, 0, 0},
-     {0, 0, 1, 0},
-     {0, 1, 0, 0},
-     {0, 0, 0, 1}
-     },
-    {
-     {1, 0, 0, 0},
-     {0, 1, 0, 1},
-     {0, 0, 1, 0},
-     {0, 1, 0, 1}
-     },
-    {
-     {1, 0, 1, 0},
-     {0, 1, 0, 1},
-     {1, 0, 1, 0},
-     {0, 1, 0, 1}
-     },
-    {
-     {1, 1, 1, 0},
-     {0, 1, 0, 1},
-     {1, 0, 1, 1},
-     {0, 1, 0, 1}
-     },
-    {
-     {0, 1, 1, 1},
-     {1, 1, 0, 1},
-     {1, 0, 1, 1},
-     {1, 1, 1, 0}
-     },
-    {
-     {0, 1, 1, 1},
-     {1, 1, 1, 1},
-     {1, 1, 0, 1},
-     {1, 1, 1, 1}
-     },
-    {
-     {1, 1, 1, 1},
-     {1, 1, 1, 1},
-     {1, 1, 1, 1},
-     {1, 1, 1, 1}
-     },
-};
-
-static const uint8_t interlaced_dither_patterns[9][8][4] = {
-    {
-     {0, 0, 0, 0}, {0, 0, 0, 0},
-     {0, 0, 0, 0}, {0, 0, 0, 0},
-     {0, 0, 0, 0}, {0, 0, 0, 0},
-     {0, 0, 0, 0}, {0, 0, 0, 0},
-     },
-    {
-     {1, 0, 1, 0}, {0, 0, 0, 0},
-     {0, 0, 0, 0}, {0, 0, 0, 0},
-     {1, 0, 1, 0}, {0, 0, 0, 0},
-     {0, 0, 0, 0}, {0, 0, 0, 0},
-     },
-    {
-     {1, 0, 1, 0}, {0, 0, 0, 0},
-     {0, 0, 0, 0}, {0, 1, 0, 1},
-     {1, 0, 1, 0}, {0, 0, 0, 0},
-     {0, 0, 0, 0}, {0, 1, 0, 1},
-     },
-    {
-     {1, 0, 1, 0}, {0, 1, 0, 1},
-     {0, 1, 0, 1}, {0, 0, 0, 0},
-     {1, 0, 1, 0}, {0, 1, 0, 1},
-     {0, 1, 0, 1}, {0, 0, 0, 0},
-     },
-    {
-     {1, 0, 1, 0}, {0, 1, 0, 1},
-     {0, 1, 0, 1}, {1, 0, 1, 0},
-     {1, 0, 1, 0}, {0, 1, 0, 1},
-     {0, 1, 0, 1}, {1, 0, 1, 0},
-     },
-    {
-     {1, 0, 1, 0}, {0, 1, 0, 1},
-     {1, 1, 1, 1}, {1, 0, 1, 0},
-     {1, 0, 1, 0}, {0, 1, 0, 1},
-     {1, 1, 1, 1}, {1, 0, 1, 0},
-     },
-    {
-     {1, 0, 1, 0}, {1, 1, 1, 1},
-     {1, 1, 1, 1}, {0, 1, 0, 1},
-     {1, 0, 1, 0}, {1, 1, 1, 1},
-     {1, 1, 1, 1}, {0, 1, 0, 1},
-     },
-    {
-     {1, 1, 1, 1}, {1, 1, 1, 1},
-     {1, 1, 1, 1}, {0, 1, 0, 1},
-     {1, 1, 1, 1}, {1, 1, 1, 1},
-     {1, 1, 1, 1}, {0, 1, 0, 1},
-     },
-    {
-     {1, 1, 1, 1}, {1, 1, 1, 1},
-     {1, 1, 1, 1}, {1, 1, 1, 1},
-     {1, 1, 1, 1}, {1, 1, 1, 1},
-     {1, 1, 1, 1}, {1, 1, 1, 1},
-     }
-};
-
-#endif /* AVCODEC_A64TABLES_H */
diff --git a/deps/libav/libavcodec/aac.h b/deps/libav/libavcodec/aac.h
deleted file mode 100644
index 375e6b1..0000000
--- a/deps/libav/libavcodec/aac.h
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * AAC definitions and structures
- * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
- * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC definitions and structures
- * @author Oded Shimon  ( ods15 ods15 dyndns org )
- * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
- */
-
-#ifndef AVCODEC_AAC_H
-#define AVCODEC_AAC_H
-
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "fft.h"
-#include "mpeg4audio.h"
-#include "sbr.h"
-#include "fmtconvert.h"
-
-#include <stdint.h>
-
-#define MAX_CHANNELS 64
-#define MAX_ELEM_ID 16
-
-#define TNS_MAX_ORDER 20
-#define MAX_LTP_LONG_SFB 40
-
-enum RawDataBlockType {
-    TYPE_SCE,
-    TYPE_CPE,
-    TYPE_CCE,
-    TYPE_LFE,
-    TYPE_DSE,
-    TYPE_PCE,
-    TYPE_FIL,
-    TYPE_END,
-};
-
-enum ExtensionPayloadID {
-    EXT_FILL,
-    EXT_FILL_DATA,
-    EXT_DATA_ELEMENT,
-    EXT_DYNAMIC_RANGE = 0xb,
-    EXT_SBR_DATA      = 0xd,
-    EXT_SBR_DATA_CRC  = 0xe,
-};
-
-enum WindowSequence {
-    ONLY_LONG_SEQUENCE,
-    LONG_START_SEQUENCE,
-    EIGHT_SHORT_SEQUENCE,
-    LONG_STOP_SEQUENCE,
-};
-
-enum BandType {
-    ZERO_BT        = 0,     ///< Scalefactors and spectral data are all zero.
-    FIRST_PAIR_BT  = 5,     ///< This and later band types encode two values (rather than four) with one code word.
-    ESC_BT         = 11,    ///< Spectral data are coded with an escape sequence.
-    NOISE_BT       = 13,    ///< Spectral data are scaled white noise not coded in the bitstream.
-    INTENSITY_BT2  = 14,    ///< Scalefactor data are intensity stereo positions.
-    INTENSITY_BT   = 15,    ///< Scalefactor data are intensity stereo positions.
-};
-
-#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
-
-enum ChannelPosition {
-    AAC_CHANNEL_OFF   = 0,
-    AAC_CHANNEL_FRONT = 1,
-    AAC_CHANNEL_SIDE  = 2,
-    AAC_CHANNEL_BACK  = 3,
-    AAC_CHANNEL_LFE   = 4,
-    AAC_CHANNEL_CC    = 5,
-};
-
-/**
- * The point during decoding at which channel coupling is applied.
- */
-enum CouplingPoint {
-    BEFORE_TNS,
-    BETWEEN_TNS_AND_IMDCT,
-    AFTER_IMDCT = 3,
-};
-
-/**
- * Output configuration status
- */
-enum OCStatus {
-    OC_NONE,        ///< Output unconfigured
-    OC_TRIAL_PCE,   ///< Output configuration under trial specified by an inband PCE
-    OC_TRIAL_FRAME, ///< Output configuration under trial specified by a frame header
-    OC_GLOBAL_HDR,  ///< Output configuration set in a global header but not yet locked
-    OC_LOCKED,      ///< Output configuration locked in place
-};
-
-typedef struct OutputConfiguration {
-    MPEG4AudioConfig m4ac;
-    uint8_t layout_map[MAX_ELEM_ID*4][3];
-    int layout_map_tags;
-    int channels;
-    uint64_t channel_layout;
-    enum OCStatus status;
-} OutputConfiguration;
-
-/**
- * Predictor State
- */
-typedef struct PredictorState {
-    float cor0;
-    float cor1;
-    float var0;
-    float var1;
-    float r0;
-    float r1;
-} PredictorState;
-
-#define MAX_PREDICTORS 672
-
-#define SCALE_DIV_512    36    ///< scalefactor difference that corresponds to scale difference in 512 times
-#define SCALE_ONE_POS   140    ///< scalefactor index that corresponds to scale=1.0
-#define SCALE_MAX_POS   255    ///< scalefactor index maximum value
-#define SCALE_MAX_DIFF   60    ///< maximum scalefactor difference allowed by standard
-#define SCALE_DIFF_ZERO  60    ///< codebook index corresponding to zero scalefactor indices difference
-
-/**
- * Long Term Prediction
- */
-typedef struct LongTermPrediction {
-    int8_t present;
-    int16_t lag;
-    float coef;
-    int8_t used[MAX_LTP_LONG_SFB];
-} LongTermPrediction;
-
-/**
- * Individual Channel Stream
- */
-typedef struct IndividualChannelStream {
-    uint8_t max_sfb;            ///< number of scalefactor bands per group
-    enum WindowSequence window_sequence[2];
-    uint8_t use_kb_window[2];   ///< If set, use Kaiser-Bessel window, otherwise use a sine window.
-    int num_window_groups;
-    uint8_t group_len[8];
-    LongTermPrediction ltp;
-    const uint16_t *swb_offset; ///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window
-    const uint8_t *swb_sizes;   ///< table of scalefactor band sizes for a particular window
-    int num_swb;                ///< number of scalefactor window bands
-    int num_windows;
-    int tns_max_bands;
-    int predictor_present;
-    int predictor_initialized;
-    int predictor_reset_group;
-    uint8_t prediction_used[41];
-} IndividualChannelStream;
-
-/**
- * Temporal Noise Shaping
- */
-typedef struct TemporalNoiseShaping {
-    int present;
-    int n_filt[8];
-    int length[8][4];
-    int direction[8][4];
-    int order[8][4];
-    float coef[8][4][TNS_MAX_ORDER];
-} TemporalNoiseShaping;
-
-/**
- * Dynamic Range Control - decoded from the bitstream but not processed further.
- */
-typedef struct DynamicRangeControl {
-    int pce_instance_tag;                           ///< Indicates with which program the DRC info is associated.
-    int dyn_rng_sgn[17];                            ///< DRC sign information; 0 - positive, 1 - negative
-    int dyn_rng_ctl[17];                            ///< DRC magnitude information
-    int exclude_mask[MAX_CHANNELS];                 ///< Channels to be excluded from DRC processing.
-    int band_incr;                                  ///< Number of DRC bands greater than 1 having DRC info.
-    int interpolation_scheme;                       ///< Indicates the interpolation scheme used in the SBR QMF domain.
-    int band_top[17];                               ///< Indicates the top of the i-th DRC band in units of 4 spectral lines.
-    int prog_ref_level;                             /**< A reference level for the long-term program audio level for all
-                                                     *   channels combined.
-                                                     */
-} DynamicRangeControl;
-
-typedef struct Pulse {
-    int num_pulse;
-    int start;
-    int pos[4];
-    int amp[4];
-} Pulse;
-
-/**
- * coupling parameters
- */
-typedef struct ChannelCoupling {
-    enum CouplingPoint coupling_point;  ///< The point during decoding at which coupling is applied.
-    int num_coupled;       ///< number of target elements
-    enum RawDataBlockType type[8];   ///< Type of channel element to be coupled - SCE or CPE.
-    int id_select[8];      ///< element id
-    int ch_select[8];      /**< [0] shared list of gains; [1] list of gains for right channel;
-                            *   [2] list of gains for left channel; [3] lists of gains for both channels
-                            */
-    float gain[16][120];
-} ChannelCoupling;
-
-/**
- * Single Channel Element - used for both SCE and LFE elements.
- */
-typedef struct SingleChannelElement {
-    IndividualChannelStream ics;
-    TemporalNoiseShaping tns;
-    Pulse pulse;
-    enum BandType band_type[128];                   ///< band types
-    int band_type_run_end[120];                     ///< band type run end points
-    float sf[120];                                  ///< scalefactors
-    int sf_idx[128];                                ///< scalefactor indices (used by encoder)
-    uint8_t zeroes[128];                            ///< band is not coded (used by encoder)
-    DECLARE_ALIGNED(32, float,   coeffs)[1024];     ///< coefficients for IMDCT
-    DECLARE_ALIGNED(32, float,   saved)[1536];      ///< overlap
-    DECLARE_ALIGNED(32, float,   ret_buf)[2048];    ///< PCM output buffer
-    DECLARE_ALIGNED(16, float,   ltp_state)[3072];  ///< time signal for LTP
-    PredictorState predictor_state[MAX_PREDICTORS];
-    float *ret;                                     ///< PCM output
-} SingleChannelElement;
-
-/**
- * channel element - generic struct for SCE/CPE/CCE/LFE
- */
-typedef struct ChannelElement {
-    // CPE specific
-    int common_window;        ///< Set if channels share a common 'IndividualChannelStream' in bitstream.
-    int     ms_mode;          ///< Signals mid/side stereo flags coding mode (used by encoder)
-    uint8_t ms_mask[128];     ///< Set if mid/side stereo is used for each scalefactor window band
-    // shared
-    SingleChannelElement ch[2];
-    // CCE specific
-    ChannelCoupling coup;
-    SpectralBandReplication sbr;
-} ChannelElement;
-
-/**
- * main AAC context
- */
-typedef struct AACContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    int is_saved;                 ///< Set if elements have stored overlap from previous frame.
-    DynamicRangeControl che_drc;
-
-    /**
-     * @name Channel element related data
-     * @{
-     */
-    ChannelElement          *che[4][MAX_ELEM_ID];
-    ChannelElement  *tag_che_map[4][MAX_ELEM_ID];
-    int tags_mapped;
-    /** @} */
-
-    /**
-     * @name temporary aligned temporary buffers
-     * (We do not want to have these on the stack.)
-     * @{
-     */
-    DECLARE_ALIGNED(32, float, buf_mdct)[1024];
-    /** @} */
-
-    /**
-     * @name Computed / set up during initialization
-     * @{
-     */
-    FFTContext mdct;
-    FFTContext mdct_small;
-    FFTContext mdct_ld;
-    FFTContext mdct_ltp;
-    FmtConvertContext fmt_conv;
-    AVFloatDSPContext fdsp;
-    int random_state;
-    /** @} */
-
-    /**
-     * @name Members used for output
-     * @{
-     */
-    SingleChannelElement *output_element[MAX_CHANNELS]; ///< Points to each SingleChannelElement
-    /** @} */
-
-    DECLARE_ALIGNED(32, float, temp)[128];
-
-    OutputConfiguration oc[2];
-} AACContext;
-
-#endif /* AVCODEC_AAC_H */
diff --git a/deps/libav/libavcodec/aac_ac3_parser.c b/deps/libav/libavcodec/aac_ac3_parser.c
deleted file mode 100644
index d3da9b7..0000000
--- a/deps/libav/libavcodec/aac_ac3_parser.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Common AAC and AC-3 parser
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "parser.h"
-#include "aac_ac3_parser.h"
-
-int ff_aac_ac3_parse(AVCodecParserContext *s1,
-                     AVCodecContext *avctx,
-                     const uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size)
-{
-    AACAC3ParseContext *s = s1->priv_data;
-    ParseContext *pc = &s->pc;
-    int len, i;
-    int new_frame_start;
-
-get_next:
-    i=END_NOT_FOUND;
-    if(s->remaining_size <= buf_size){
-        if(s->remaining_size && !s->need_next_header){
-            i= s->remaining_size;
-            s->remaining_size = 0;
-        }else{ //we need a header first
-            len=0;
-            for(i=s->remaining_size; i<buf_size; i++){
-                s->state = (s->state<<8) + buf[i];
-                if((len=s->sync(s->state, s, &s->need_next_header, &new_frame_start)))
-                    break;
-            }
-            if(len<=0){
-                i=END_NOT_FOUND;
-            }else{
-                s->state=0;
-                i-= s->header_size -1;
-                s->remaining_size = len;
-                if(!new_frame_start || pc->index+i<=0){
-                    s->remaining_size += i;
-                    goto get_next;
-                }
-            }
-        }
-    }
-
-    if(ff_combine_frame(pc, i, &buf, &buf_size)<0){
-        s->remaining_size -= FFMIN(s->remaining_size, buf_size);
-        *poutbuf = NULL;
-        *poutbuf_size = 0;
-        return buf_size;
-    }
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-
-    /* update codec info */
-    if(s->codec_id)
-        avctx->codec_id = s->codec_id;
-
-    /* Due to backwards compatible HE-AAC the sample rate, channel count,
-       and total number of samples found in an AAC ADTS header are not
-       reliable. Bit rate is still accurate because the total frame duration in
-       seconds is still correct (as is the number of bits in the frame). */
-    if (avctx->codec_id != AV_CODEC_ID_AAC) {
-        avctx->sample_rate = s->sample_rate;
-
-        /* (E-)AC-3: allow downmixing to stereo or mono */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
-        if (avctx->request_channels == 1)
-            avctx->request_channel_layout = AV_CH_LAYOUT_MONO;
-        else if (avctx->request_channels == 2)
-            avctx->request_channel_layout = AV_CH_LAYOUT_STEREO;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-        if (s->channels > 1 &&
-            avctx->request_channel_layout == AV_CH_LAYOUT_MONO) {
-            avctx->channels       = 1;
-            avctx->channel_layout = AV_CH_LAYOUT_MONO;
-        } else if (s->channels > 2 &&
-                   avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
-            avctx->channels       = 2;
-            avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-        } else {
-            avctx->channels = s->channels;
-            avctx->channel_layout = s->channel_layout;
-        }
-        s1->duration = s->samples;
-        avctx->audio_service_type = s->service_type;
-    }
-
-    avctx->bit_rate = s->bit_rate;
-
-    return i;
-}
diff --git a/deps/libav/libavcodec/aac_ac3_parser.h b/deps/libav/libavcodec/aac_ac3_parser.h
deleted file mode 100644
index 99286f0..0000000
--- a/deps/libav/libavcodec/aac_ac3_parser.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Common AAC and AC-3 parser prototypes
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AAC_AC3_PARSER_H
-#define AVCODEC_AAC_AC3_PARSER_H
-
-#include <stdint.h>
-#include "avcodec.h"
-#include "parser.h"
-
-typedef enum {
-    AAC_AC3_PARSE_ERROR_SYNC        = -0x1030c0a,
-    AAC_AC3_PARSE_ERROR_BSID        = -0x2030c0a,
-    AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a,
-    AAC_AC3_PARSE_ERROR_FRAME_SIZE  = -0x4030c0a,
-    AAC_AC3_PARSE_ERROR_FRAME_TYPE  = -0x5030c0a,
-    AAC_AC3_PARSE_ERROR_CRC         = -0x6030c0a,
-    AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -0x7030c0a,
-} AACAC3ParseError;
-
-typedef struct AACAC3ParseContext {
-    ParseContext pc;
-    int frame_size;
-    int header_size;
-    int (*sync)(uint64_t state, struct AACAC3ParseContext *hdr_info,
-            int *need_next_header, int *new_frame_start);
-
-    int channels;
-    int sample_rate;
-    int bit_rate;
-    int samples;
-    uint64_t channel_layout;
-    int service_type;
-
-    int remaining_size;
-    uint64_t state;
-
-    int need_next_header;
-    enum AVCodecID codec_id;
-} AACAC3ParseContext;
-
-int ff_aac_ac3_parse(AVCodecParserContext *s1,
-                     AVCodecContext *avctx,
-                     const uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size);
-
-#endif /* AVCODEC_AAC_AC3_PARSER_H */
diff --git a/deps/libav/libavcodec/aac_adtstoasc_bsf.c b/deps/libav/libavcodec/aac_adtstoasc_bsf.c
deleted file mode 100644
index bec6e7f..0000000
--- a/deps/libav/libavcodec/aac_adtstoasc_bsf.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration bitstream filter
- * Copyright (c) 2009 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "aacadtsdec.h"
-#include "put_bits.h"
-#include "get_bits.h"
-#include "mpeg4audio.h"
-#include "internal.h"
-
-typedef struct AACBSFContext {
-    int first_frame_done;
-} AACBSFContext;
-
-/**
- * This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
- * ADTS header and removes the ADTS header.
- */
-static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
-                                AVCodecContext *avctx, const char *args,
-                                uint8_t  **poutbuf, int *poutbuf_size,
-                                const uint8_t *buf, int      buf_size,
-                                int keyframe)
-{
-    GetBitContext gb;
-    PutBitContext pb;
-    AACADTSHeaderInfo hdr;
-
-    AACBSFContext *ctx = bsfc->priv_data;
-
-    init_get_bits(&gb, buf, AAC_ADTS_HEADER_SIZE*8);
-
-    *poutbuf = (uint8_t*) buf;
-    *poutbuf_size = buf_size;
-
-    if (avctx->extradata)
-        if (show_bits(&gb, 12) != 0xfff)
-            return 0;
-
-    if (avpriv_aac_parse_header(&gb, &hdr) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
-        return -1;
-    }
-
-    if (!hdr.crc_absent && hdr.num_aac_frames > 1) {
-        avpriv_report_missing_feature(avctx,
-                                      "Multiple RDBs per frame with CRC");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    buf      += AAC_ADTS_HEADER_SIZE + 2*!hdr.crc_absent;
-    buf_size -= AAC_ADTS_HEADER_SIZE + 2*!hdr.crc_absent;
-
-    if (!ctx->first_frame_done) {
-        int            pce_size = 0;
-        uint8_t        pce_data[MAX_PCE_SIZE];
-        if (!hdr.chan_config) {
-            init_get_bits(&gb, buf, buf_size * 8);
-            if (get_bits(&gb, 3) != 5) {
-                avpriv_report_missing_feature(avctx,
-                                              "PCE-based channel configuration "
-                                              "without PCE as first syntax "
-                                              "element");
-                return AVERROR_PATCHWELCOME;
-            }
-            init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
-            pce_size = avpriv_copy_pce_data(&pb, &gb)/8;
-            flush_put_bits(&pb);
-            buf_size -= get_bits_count(&gb)/8;
-            buf      += get_bits_count(&gb)/8;
-        }
-        avctx->extradata_size = 2 + pce_size;
-        avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
-        init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
-        put_bits(&pb, 5, hdr.object_type);
-        put_bits(&pb, 4, hdr.sampling_index);
-        put_bits(&pb, 4, hdr.chan_config);
-        put_bits(&pb, 1, 0); //frame length - 1024 samples
-        put_bits(&pb, 1, 0); //does not depend on core coder
-        put_bits(&pb, 1, 0); //is not extension
-        flush_put_bits(&pb);
-        if (pce_size) {
-            memcpy(avctx->extradata + 2, pce_data, pce_size);
-        }
-
-        ctx->first_frame_done = 1;
-    }
-
-    *poutbuf = (uint8_t*) buf;
-    *poutbuf_size = buf_size;
-
-    return 0;
-}
-
-AVBitStreamFilter ff_aac_adtstoasc_bsf = {
-    "aac_adtstoasc",
-    sizeof(AACBSFContext),
-    aac_adtstoasc_filter,
-};
diff --git a/deps/libav/libavcodec/aac_parser.c b/deps/libav/libavcodec/aac_parser.c
deleted file mode 100644
index fdaa5f8..0000000
--- a/deps/libav/libavcodec/aac_parser.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Audio and Video frame extraction
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "parser.h"
-#include "aac_ac3_parser.h"
-#include "aacadtsdec.h"
-#include "get_bits.h"
-#include "mpeg4audio.h"
-
-static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
-        int *need_next_header, int *new_frame_start)
-{
-    GetBitContext bits;
-    AACADTSHeaderInfo hdr;
-    int size;
-    union {
-        uint64_t u64;
-        uint8_t  u8[8];
-    } tmp;
-
-    tmp.u64 = av_be2ne64(state);
-    init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8);
-
-    if ((size = avpriv_aac_parse_header(&bits, &hdr)) < 0)
-        return 0;
-    *need_next_header = 0;
-    *new_frame_start  = 1;
-    hdr_info->sample_rate = hdr.sample_rate;
-    hdr_info->channels    = ff_mpeg4audio_channels[hdr.chan_config];
-    hdr_info->samples     = hdr.samples;
-    hdr_info->bit_rate    = hdr.bit_rate;
-    return size;
-}
-
-static av_cold int aac_parse_init(AVCodecParserContext *s1)
-{
-    AACAC3ParseContext *s = s1->priv_data;
-    s->header_size = AAC_ADTS_HEADER_SIZE;
-    s->sync = aac_sync;
-    return 0;
-}
-
-
-AVCodecParser ff_aac_parser = {
-    .codec_ids      = { AV_CODEC_ID_AAC },
-    .priv_data_size = sizeof(AACAC3ParseContext),
-    .parser_init    = aac_parse_init,
-    .parser_parse   = ff_aac_ac3_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/aac_tablegen.c b/deps/libav/libavcodec/aac_tablegen.c
deleted file mode 100644
index b2c6c95..0000000
--- a/deps/libav/libavcodec/aac_tablegen.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Generate a header file for hardcoded AAC tables
- *
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#include "aac_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
-    ff_aac_tableinit();
-
-    write_fileheader();
-
-    WRITE_ARRAY("const", float, ff_aac_pow2sf_tab);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/aac_tablegen.h b/deps/libav/libavcodec/aac_tablegen.h
deleted file mode 100644
index 8a05ec5..0000000
--- a/deps/libav/libavcodec/aac_tablegen.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Header file for hardcoded AAC tables
- *
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AAC_TABLEGEN_H
-#define AVCODEC_AAC_TABLEGEN_H
-
-#include "aac_tablegen_decl.h"
-
-#if CONFIG_HARDCODED_TABLES
-#include "libavcodec/aac_tables.h"
-#else
-#include "libavutil/mathematics.h"
-float ff_aac_pow2sf_tab[428];
-
-void ff_aac_tableinit(void)
-{
-    int i;
-    for (i = 0; i < 428; i++)
-        ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.0);
-}
-#endif /* CONFIG_HARDCODED_TABLES */
-
-#endif /* AVCODEC_AAC_TABLEGEN_H */
diff --git a/deps/libav/libavcodec/aac_tablegen_decl.h b/deps/libav/libavcodec/aac_tablegen_decl.h
deleted file mode 100644
index a5fd1cf..0000000
--- a/deps/libav/libavcodec/aac_tablegen_decl.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Header file for hardcoded AAC tables
- *
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AAC_TABLEGEN_DECL_H
-#define AVCODEC_AAC_TABLEGEN_DECL_H
-
-#define POW_SF2_ZERO    200    ///< ff_aac_pow2sf_tab index corresponding to pow(2, 0);
-
-#if CONFIG_HARDCODED_TABLES
-#define ff_aac_tableinit()
-extern const float ff_aac_pow2sf_tab[428];
-#else
-void ff_aac_tableinit(void);
-extern       float ff_aac_pow2sf_tab[428];
-#endif /* CONFIG_HARDCODED_TABLES */
-
-#endif /* AVCODEC_AAC_TABLEGEN_DECL_H */
diff --git a/deps/libav/libavcodec/aacadtsdec.c b/deps/libav/libavcodec/aacadtsdec.c
deleted file mode 100644
index 30f92e0..0000000
--- a/deps/libav/libavcodec/aacadtsdec.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Audio and Video frame extraction
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- * Copyright (c) 2009 Alex Converse
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "aac_ac3_parser.h"
-#include "aacadtsdec.h"
-#include "get_bits.h"
-#include "mpeg4audio.h"
-
-int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
-{
-    int size, rdb, ch, sr;
-    int aot, crc_abs;
-
-    if(get_bits(gbc, 12) != 0xfff)
-        return AAC_AC3_PARSE_ERROR_SYNC;
-
-    skip_bits1(gbc);             /* id */
-    skip_bits(gbc, 2);           /* layer */
-    crc_abs = get_bits1(gbc);    /* protection_absent */
-    aot     = get_bits(gbc, 2);  /* profile_objecttype */
-    sr      = get_bits(gbc, 4);  /* sample_frequency_index */
-    if(!avpriv_mpeg4audio_sample_rates[sr])
-        return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;
-    skip_bits1(gbc);             /* private_bit */
-    ch      = get_bits(gbc, 3);  /* channel_configuration */
-
-    skip_bits1(gbc);             /* original/copy */
-    skip_bits1(gbc);             /* home */
-
-    /* adts_variable_header */
-    skip_bits1(gbc);             /* copyright_identification_bit */
-    skip_bits1(gbc);             /* copyright_identification_start */
-    size    = get_bits(gbc, 13); /* aac_frame_length */
-    if(size < AAC_ADTS_HEADER_SIZE)
-        return AAC_AC3_PARSE_ERROR_FRAME_SIZE;
-
-    skip_bits(gbc, 11);          /* adts_buffer_fullness */
-    rdb = get_bits(gbc, 2);      /* number_of_raw_data_blocks_in_frame */
-
-    hdr->object_type    = aot + 1;
-    hdr->chan_config    = ch;
-    hdr->crc_absent     = crc_abs;
-    hdr->num_aac_frames = rdb + 1;
-    hdr->sampling_index = sr;
-    hdr->sample_rate    = avpriv_mpeg4audio_sample_rates[sr];
-    hdr->samples        = (rdb + 1) * 1024;
-    hdr->bit_rate       = size * 8 * hdr->sample_rate / hdr->samples;
-
-    return size;
-}
diff --git a/deps/libav/libavcodec/aacadtsdec.h b/deps/libav/libavcodec/aacadtsdec.h
deleted file mode 100644
index 6319efc..0000000
--- a/deps/libav/libavcodec/aacadtsdec.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * AAC ADTS header decoding prototypes and structures
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AACADTSDEC_H
-#define AVCODEC_AACADTSDEC_H
-
-#include <stdint.h>
-#include "get_bits.h"
-
-#define AAC_ADTS_HEADER_SIZE 7
-
-typedef struct AACADTSHeaderInfo {
-    uint32_t sample_rate;
-    uint32_t samples;
-    uint32_t bit_rate;
-    uint8_t  crc_absent;
-    uint8_t  object_type;
-    uint8_t  sampling_index;
-    uint8_t  chan_config;
-    uint8_t  num_aac_frames;
-} AACADTSHeaderInfo;
-
-/**
- * Parse AAC frame header.
- * Parse the ADTS frame header to the end of the variable header, which is
- * the first 54 bits.
- * @param[in]  gbc BitContext containing the first 54 bits of the frame.
- * @param[out] hdr Pointer to struct where header info is written.
- * @return Returns 0 on success, -1 if there is a sync word mismatch,
- * -2 if the version element is invalid, -3 if the sample rate
- * element is invalid, or -4 if the bit rate element is invalid.
- */
-int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr);
-
-#endif /* AVCODEC_AACADTSDEC_H */
diff --git a/deps/libav/libavcodec/aaccoder.c b/deps/libav/libavcodec/aaccoder.c
deleted file mode 100644
index 35b98a9..0000000
--- a/deps/libav/libavcodec/aaccoder.c
+++ /dev/null
@@ -1,1140 +0,0 @@
-/*
- * AAC coefficients encoder
- * Copyright (C) 2008-2009 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC coefficients encoder
- */
-
-/***********************************
- *              TODOs:
- * speedup quantizer selection
- * add sane pulse detection
- ***********************************/
-
-#include "libavutil/libm.h" // brought forward to work around cygwin header breakage
-
-#include <float.h>
-#include "libavutil/mathematics.h"
-#include "avcodec.h"
-#include "put_bits.h"
-#include "aac.h"
-#include "aacenc.h"
-#include "aactab.h"
-
-/** bits needed to code codebook run value for long windows */
-static const uint8_t run_value_bits_long[64] = {
-     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
-};
-
-/** bits needed to code codebook run value for short windows */
-static const uint8_t run_value_bits_short[16] = {
-    3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
-};
-
-static const uint8_t *run_value_bits[2] = {
-    run_value_bits_long, run_value_bits_short
-};
-
-
-/**
- * Quantize one coefficient.
- * @return absolute value of the quantized coefficient
- * @see 3GPP TS26.403 5.6.2 "Scalefactor determination"
- */
-static av_always_inline int quant(float coef, const float Q)
-{
-    float a = coef * Q;
-    return sqrtf(a * sqrtf(a)) + 0.4054;
-}
-
-static void quantize_bands(int *out, const float *in, const float *scaled,
-                           int size, float Q34, int is_signed, int maxval)
-{
-    int i;
-    double qc;
-    for (i = 0; i < size; i++) {
-        qc = scaled[i] * Q34;
-        out[i] = (int)FFMIN(qc + 0.4054, (double)maxval);
-        if (is_signed && in[i] < 0.0f) {
-            out[i] = -out[i];
-        }
-    }
-}
-
-static void abs_pow34_v(float *out, const float *in, const int size)
-{
-#ifndef USE_REALLY_FULL_SEARCH
-    int i;
-    for (i = 0; i < size; i++) {
-        float a = fabsf(in[i]);
-        out[i] = sqrtf(a * sqrtf(a));
-    }
-#endif /* USE_REALLY_FULL_SEARCH */
-}
-
-static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17};
-static const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16};
-
-/**
- * Calculate rate distortion cost for quantizing with given codebook
- *
- * @return quantization distortion
- */
-static av_always_inline float quantize_and_encode_band_cost_template(
-                                struct AACEncContext *s,
-                                PutBitContext *pb, const float *in,
-                                const float *scaled, int size, int scale_idx,
-                                int cb, const float lambda, const float uplim,
-                                int *bits, int BT_ZERO, int BT_UNSIGNED,
-                                int BT_PAIR, int BT_ESC)
-{
-    const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512;
-    const float Q   = ff_aac_pow2sf_tab [q_idx];
-    const float Q34 = ff_aac_pow34sf_tab[q_idx];
-    const float IQ  = ff_aac_pow2sf_tab [POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
-    const float CLIPPED_ESCAPE = 165140.0f*IQ;
-    int i, j;
-    float cost = 0;
-    const int dim = BT_PAIR ? 2 : 4;
-    int resbits = 0;
-    const int range  = aac_cb_range[cb];
-    const int maxval = aac_cb_maxval[cb];
-    int off;
-
-    if (BT_ZERO) {
-        for (i = 0; i < size; i++)
-            cost += in[i]*in[i];
-        if (bits)
-            *bits = 0;
-        return cost * lambda;
-    }
-    if (!scaled) {
-        abs_pow34_v(s->scoefs, in, size);
-        scaled = s->scoefs;
-    }
-    quantize_bands(s->qcoefs, in, scaled, size, Q34, !BT_UNSIGNED, maxval);
-    if (BT_UNSIGNED) {
-        off = 0;
-    } else {
-        off = maxval;
-    }
-    for (i = 0; i < size; i += dim) {
-        const float *vec;
-        int *quants = s->qcoefs + i;
-        int curidx = 0;
-        int curbits;
-        float rd = 0.0f;
-        for (j = 0; j < dim; j++) {
-            curidx *= range;
-            curidx += quants[j] + off;
-        }
-        curbits =  ff_aac_spectral_bits[cb-1][curidx];
-        vec     = &ff_aac_codebook_vectors[cb-1][curidx*dim];
-        if (BT_UNSIGNED) {
-            for (j = 0; j < dim; j++) {
-                float t = fabsf(in[i+j]);
-                float di;
-                if (BT_ESC && vec[j] == 64.0f) { //FIXME: slow
-                    if (t >= CLIPPED_ESCAPE) {
-                        di = t - CLIPPED_ESCAPE;
-                        curbits += 21;
-                    } else {
-                        int c = av_clip(quant(t, Q), 0, 8191);
-                        di = t - c*cbrtf(c)*IQ;
-                        curbits += av_log2(c)*2 - 4 + 1;
-                    }
-                } else {
-                    di = t - vec[j]*IQ;
-                }
-                if (vec[j] != 0.0f)
-                    curbits++;
-                rd += di*di;
-            }
-        } else {
-            for (j = 0; j < dim; j++) {
-                float di = in[i+j] - vec[j]*IQ;
-                rd += di*di;
-            }
-        }
-        cost    += rd * lambda + curbits;
-        resbits += curbits;
-        if (cost >= uplim)
-            return uplim;
-        if (pb) {
-            put_bits(pb, ff_aac_spectral_bits[cb-1][curidx], ff_aac_spectral_codes[cb-1][curidx]);
-            if (BT_UNSIGNED)
-                for (j = 0; j < dim; j++)
-                    if (ff_aac_codebook_vectors[cb-1][curidx*dim+j] != 0.0f)
-                        put_bits(pb, 1, in[i+j] < 0.0f);
-            if (BT_ESC) {
-                for (j = 0; j < 2; j++) {
-                    if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) {
-                        int coef = av_clip(quant(fabsf(in[i+j]), Q), 0, 8191);
-                        int len = av_log2(coef);
-
-                        put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);
-                        put_bits(pb, len, coef & ((1 << len) - 1));
-                    }
-                }
-            }
-        }
-    }
-
-    if (bits)
-        *bits = resbits;
-    return cost;
-}
-
-#define QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NAME, BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC) \
-static float quantize_and_encode_band_cost_ ## NAME(                                        \
-                                struct AACEncContext *s,                                \
-                                PutBitContext *pb, const float *in,                     \
-                                const float *scaled, int size, int scale_idx,           \
-                                int cb, const float lambda, const float uplim,          \
-                                int *bits) {                                            \
-    return quantize_and_encode_band_cost_template(                                      \
-                                s, pb, in, scaled, size, scale_idx,                     \
-                                BT_ESC ? ESC_BT : cb, lambda, uplim, bits,              \
-                                BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC);                 \
-}
-
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ZERO,  1, 0, 0, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SQUAD, 0, 0, 0, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UQUAD, 0, 1, 0, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SPAIR, 0, 0, 1, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UPAIR, 0, 1, 1, 0)
-QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC,   0, 1, 1, 1)
-
-static float (*const quantize_and_encode_band_cost_arr[])(
-                                struct AACEncContext *s,
-                                PutBitContext *pb, const float *in,
-                                const float *scaled, int size, int scale_idx,
-                                int cb, const float lambda, const float uplim,
-                                int *bits) = {
-    quantize_and_encode_band_cost_ZERO,
-    quantize_and_encode_band_cost_SQUAD,
-    quantize_and_encode_band_cost_SQUAD,
-    quantize_and_encode_band_cost_UQUAD,
-    quantize_and_encode_band_cost_UQUAD,
-    quantize_and_encode_band_cost_SPAIR,
-    quantize_and_encode_band_cost_SPAIR,
-    quantize_and_encode_band_cost_UPAIR,
-    quantize_and_encode_band_cost_UPAIR,
-    quantize_and_encode_band_cost_UPAIR,
-    quantize_and_encode_band_cost_UPAIR,
-    quantize_and_encode_band_cost_ESC,
-};
-
-#define quantize_and_encode_band_cost(                                  \
-                                s, pb, in, scaled, size, scale_idx, cb, \
-                                lambda, uplim, bits)                    \
-    quantize_and_encode_band_cost_arr[cb](                              \
-                                s, pb, in, scaled, size, scale_idx, cb, \
-                                lambda, uplim, bits)
-
-static float quantize_band_cost(struct AACEncContext *s, const float *in,
-                                const float *scaled, int size, int scale_idx,
-                                int cb, const float lambda, const float uplim,
-                                int *bits)
-{
-    return quantize_and_encode_band_cost(s, NULL, in, scaled, size, scale_idx,
-                                         cb, lambda, uplim, bits);
-}
-
-static void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb,
-                                     const float *in, int size, int scale_idx,
-                                     int cb, const float lambda)
-{
-    quantize_and_encode_band_cost(s, pb, in, NULL, size, scale_idx, cb, lambda,
-                                  INFINITY, NULL);
-}
-
-static float find_max_val(int group_len, int swb_size, const float *scaled) {
-    float maxval = 0.0f;
-    int w2, i;
-    for (w2 = 0; w2 < group_len; w2++) {
-        for (i = 0; i < swb_size; i++) {
-            maxval = FFMAX(maxval, scaled[w2*128+i]);
-        }
-    }
-    return maxval;
-}
-
-static int find_min_book(float maxval, int sf) {
-    float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
-    float Q34 = sqrtf(Q * sqrtf(Q));
-    int qmaxval, cb;
-    qmaxval = maxval * Q34 + 0.4054f;
-    if      (qmaxval ==  0) cb = 0;
-    else if (qmaxval ==  1) cb = 1;
-    else if (qmaxval ==  2) cb = 3;
-    else if (qmaxval <=  4) cb = 5;
-    else if (qmaxval <=  7) cb = 7;
-    else if (qmaxval <= 12) cb = 9;
-    else                    cb = 11;
-    return cb;
-}
-
-/**
- * structure used in optimal codebook search
- */
-typedef struct BandCodingPath {
-    int prev_idx; ///< pointer to the previous path point
-    float cost;   ///< path cost
-    int run;
-} BandCodingPath;
-
-/**
- * Encode band info for single window group bands.
- */
-static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce,
-                                     int win, int group_len, const float lambda)
-{
-    BandCodingPath path[120][12];
-    int w, swb, cb, start, size;
-    int i, j;
-    const int max_sfb  = sce->ics.max_sfb;
-    const int run_bits = sce->ics.num_windows == 1 ? 5 : 3;
-    const int run_esc  = (1 << run_bits) - 1;
-    int idx, ppos, count;
-    int stackrun[120], stackcb[120], stack_len;
-    float next_minrd = INFINITY;
-    int next_mincb = 0;
-
-    abs_pow34_v(s->scoefs, sce->coeffs, 1024);
-    start = win*128;
-    for (cb = 0; cb < 12; cb++) {
-        path[0][cb].cost     = 0.0f;
-        path[0][cb].prev_idx = -1;
-        path[0][cb].run      = 0;
-    }
-    for (swb = 0; swb < max_sfb; swb++) {
-        size = sce->ics.swb_sizes[swb];
-        if (sce->zeroes[win*16 + swb]) {
-            for (cb = 0; cb < 12; cb++) {
-                path[swb+1][cb].prev_idx = cb;
-                path[swb+1][cb].cost     = path[swb][cb].cost;
-                path[swb+1][cb].run      = path[swb][cb].run + 1;
-            }
-        } else {
-            float minrd = next_minrd;
-            int mincb = next_mincb;
-            next_minrd = INFINITY;
-            next_mincb = 0;
-            for (cb = 0; cb < 12; cb++) {
-                float cost_stay_here, cost_get_here;
-                float rd = 0.0f;
-                for (w = 0; w < group_len; w++) {
-                    FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(win+w)*16+swb];
-                    rd += quantize_band_cost(s, sce->coeffs + start + w*128,
-                                             s->scoefs + start + w*128, size,
-                                             sce->sf_idx[(win+w)*16+swb], cb,
-                                             lambda / band->threshold, INFINITY, NULL);
-                }
-                cost_stay_here = path[swb][cb].cost + rd;
-                cost_get_here  = minrd              + rd + run_bits + 4;
-                if (   run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run]
-                    != run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1])
-                    cost_stay_here += run_bits;
-                if (cost_get_here < cost_stay_here) {
-                    path[swb+1][cb].prev_idx = mincb;
-                    path[swb+1][cb].cost     = cost_get_here;
-                    path[swb+1][cb].run      = 1;
-                } else {
-                    path[swb+1][cb].prev_idx = cb;
-                    path[swb+1][cb].cost     = cost_stay_here;
-                    path[swb+1][cb].run      = path[swb][cb].run + 1;
-                }
-                if (path[swb+1][cb].cost < next_minrd) {
-                    next_minrd = path[swb+1][cb].cost;
-                    next_mincb = cb;
-                }
-            }
-        }
-        start += sce->ics.swb_sizes[swb];
-    }
-
-    //convert resulting path from backward-linked list
-    stack_len = 0;
-    idx       = 0;
-    for (cb = 1; cb < 12; cb++)
-        if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
-            idx = cb;
-    ppos = max_sfb;
-    while (ppos > 0) {
-        cb = idx;
-        stackrun[stack_len] = path[ppos][cb].run;
-        stackcb [stack_len] = cb;
-        idx = path[ppos-path[ppos][cb].run+1][cb].prev_idx;
-        ppos -= path[ppos][cb].run;
-        stack_len++;
-    }
-    //perform actual band info encoding
-    start = 0;
-    for (i = stack_len - 1; i >= 0; i--) {
-        put_bits(&s->pb, 4, stackcb[i]);
-        count = stackrun[i];
-        memset(sce->zeroes + win*16 + start, !stackcb[i], count);
-        //XXX: memset when band_type is also uint8_t
-        for (j = 0; j < count; j++) {
-            sce->band_type[win*16 + start] =  stackcb[i];
-            start++;
-        }
-        while (count >= run_esc) {
-            put_bits(&s->pb, run_bits, run_esc);
-            count -= run_esc;
-        }
-        put_bits(&s->pb, run_bits, count);
-    }
-}
-
-static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
-                                  int win, int group_len, const float lambda)
-{
-    BandCodingPath path[120][12];
-    int w, swb, cb, start, size;
-    int i, j;
-    const int max_sfb  = sce->ics.max_sfb;
-    const int run_bits = sce->ics.num_windows == 1 ? 5 : 3;
-    const int run_esc  = (1 << run_bits) - 1;
-    int idx, ppos, count;
-    int stackrun[120], stackcb[120], stack_len;
-    float next_minbits = INFINITY;
-    int next_mincb = 0;
-
-    abs_pow34_v(s->scoefs, sce->coeffs, 1024);
-    start = win*128;
-    for (cb = 0; cb < 12; cb++) {
-        path[0][cb].cost     = run_bits+4;
-        path[0][cb].prev_idx = -1;
-        path[0][cb].run      = 0;
-    }
-    for (swb = 0; swb < max_sfb; swb++) {
-        size = sce->ics.swb_sizes[swb];
-        if (sce->zeroes[win*16 + swb]) {
-            float cost_stay_here = path[swb][0].cost;
-            float cost_get_here  = next_minbits + run_bits + 4;
-            if (   run_value_bits[sce->ics.num_windows == 8][path[swb][0].run]
-                != run_value_bits[sce->ics.num_windows == 8][path[swb][0].run+1])
-                cost_stay_here += run_bits;
-            if (cost_get_here < cost_stay_here) {
-                path[swb+1][0].prev_idx = next_mincb;
-                path[swb+1][0].cost     = cost_get_here;
-                path[swb+1][0].run      = 1;
-            } else {
-                path[swb+1][0].prev_idx = 0;
-                path[swb+1][0].cost     = cost_stay_here;
-                path[swb+1][0].run      = path[swb][0].run + 1;
-            }
-            next_minbits = path[swb+1][0].cost;
-            next_mincb = 0;
-            for (cb = 1; cb < 12; cb++) {
-                path[swb+1][cb].cost = 61450;
-                path[swb+1][cb].prev_idx = -1;
-                path[swb+1][cb].run = 0;
-            }
-        } else {
-            float minbits = next_minbits;
-            int mincb = next_mincb;
-            int startcb = sce->band_type[win*16+swb];
-            next_minbits = INFINITY;
-            next_mincb = 0;
-            for (cb = 0; cb < startcb; cb++) {
-                path[swb+1][cb].cost = 61450;
-                path[swb+1][cb].prev_idx = -1;
-                path[swb+1][cb].run = 0;
-            }
-            for (cb = startcb; cb < 12; cb++) {
-                float cost_stay_here, cost_get_here;
-                float bits = 0.0f;
-                for (w = 0; w < group_len; w++) {
-                    bits += quantize_band_cost(s, sce->coeffs + start + w*128,
-                                               s->scoefs + start + w*128, size,
-                                               sce->sf_idx[(win+w)*16+swb], cb,
-                                               0, INFINITY, NULL);
-                }
-                cost_stay_here = path[swb][cb].cost + bits;
-                cost_get_here  = minbits            + bits + run_bits + 4;
-                if (   run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run]
-                    != run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1])
-                    cost_stay_here += run_bits;
-                if (cost_get_here < cost_stay_here) {
-                    path[swb+1][cb].prev_idx = mincb;
-                    path[swb+1][cb].cost     = cost_get_here;
-                    path[swb+1][cb].run      = 1;
-                } else {
-                    path[swb+1][cb].prev_idx = cb;
-                    path[swb+1][cb].cost     = cost_stay_here;
-                    path[swb+1][cb].run      = path[swb][cb].run + 1;
-                }
-                if (path[swb+1][cb].cost < next_minbits) {
-                    next_minbits = path[swb+1][cb].cost;
-                    next_mincb = cb;
-                }
-            }
-        }
-        start += sce->ics.swb_sizes[swb];
-    }
-
-    //convert resulting path from backward-linked list
-    stack_len = 0;
-    idx       = 0;
-    for (cb = 1; cb < 12; cb++)
-        if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
-            idx = cb;
-    ppos = max_sfb;
-    while (ppos > 0) {
-        assert(idx >= 0);
-        cb = idx;
-        stackrun[stack_len] = path[ppos][cb].run;
-        stackcb [stack_len] = cb;
-        idx = path[ppos-path[ppos][cb].run+1][cb].prev_idx;
-        ppos -= path[ppos][cb].run;
-        stack_len++;
-    }
-    //perform actual band info encoding
-    start = 0;
-    for (i = stack_len - 1; i >= 0; i--) {
-        put_bits(&s->pb, 4, stackcb[i]);
-        count = stackrun[i];
-        memset(sce->zeroes + win*16 + start, !stackcb[i], count);
-        //XXX: memset when band_type is also uint8_t
-        for (j = 0; j < count; j++) {
-            sce->band_type[win*16 + start] =  stackcb[i];
-            start++;
-        }
-        while (count >= run_esc) {
-            put_bits(&s->pb, run_bits, run_esc);
-            count -= run_esc;
-        }
-        put_bits(&s->pb, run_bits, count);
-    }
-}
-
-/** Return the minimum scalefactor where the quantized coef does not clip. */
-static av_always_inline uint8_t coef2minsf(float coef) {
-    return av_clip_uint8(log2f(coef)*4 - 69 + SCALE_ONE_POS - SCALE_DIV_512);
-}
-
-/** Return the maximum scalefactor where the quantized coef is not zero. */
-static av_always_inline uint8_t coef2maxsf(float coef) {
-    return av_clip_uint8(log2f(coef)*4 +  6 + SCALE_ONE_POS - SCALE_DIV_512);
-}
-
-typedef struct TrellisPath {
-    float cost;
-    int prev;
-} TrellisPath;
-
-#define TRELLIS_STAGES 121
-#define TRELLIS_STATES (SCALE_MAX_DIFF+1)
-
-static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
-                                       SingleChannelElement *sce,
-                                       const float lambda)
-{
-    int q, w, w2, g, start = 0;
-    int i, j;
-    int idx;
-    TrellisPath paths[TRELLIS_STAGES][TRELLIS_STATES];
-    int bandaddr[TRELLIS_STAGES];
-    int minq;
-    float mincost;
-    float q0f = FLT_MAX, q1f = 0.0f, qnrgf = 0.0f;
-    int q0, q1, qcnt = 0;
-
-    for (i = 0; i < 1024; i++) {
-        float t = fabsf(sce->coeffs[i]);
-        if (t > 0.0f) {
-            q0f = FFMIN(q0f, t);
-            q1f = FFMAX(q1f, t);
-            qnrgf += t*t;
-            qcnt++;
-        }
-    }
-
-    if (!qcnt) {
-        memset(sce->sf_idx, 0, sizeof(sce->sf_idx));
-        memset(sce->zeroes, 1, sizeof(sce->zeroes));
-        return;
-    }
-
-    //minimum scalefactor index is when minimum nonzero coefficient after quantizing is not clipped
-    q0 = coef2minsf(q0f);
-    //maximum scalefactor index is when maximum coefficient after quantizing is still not zero
-    q1 = coef2maxsf(q1f);
-    if (q1 - q0 > 60) {
-        int q0low  = q0;
-        int q1high = q1;
-        //minimum scalefactor index is when maximum nonzero coefficient after quantizing is not clipped
-        int qnrg = av_clip_uint8(log2f(sqrtf(qnrgf/qcnt))*4 - 31 + SCALE_ONE_POS - SCALE_DIV_512);
-        q1 = qnrg + 30;
-        q0 = qnrg - 30;
-        if (q0 < q0low) {
-            q1 += q0low - q0;
-            q0  = q0low;
-        } else if (q1 > q1high) {
-            q0 -= q1 - q1high;
-            q1  = q1high;
-        }
-    }
-
-    for (i = 0; i < TRELLIS_STATES; i++) {
-        paths[0][i].cost    = 0.0f;
-        paths[0][i].prev    = -1;
-    }
-    for (j = 1; j < TRELLIS_STAGES; j++) {
-        for (i = 0; i < TRELLIS_STATES; i++) {
-            paths[j][i].cost    = INFINITY;
-            paths[j][i].prev    = -2;
-        }
-    }
-    idx = 1;
-    abs_pow34_v(s->scoefs, sce->coeffs, 1024);
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-        start = w*128;
-        for (g = 0; g < sce->ics.num_swb; g++) {
-            const float *coefs = sce->coeffs + start;
-            float qmin, qmax;
-            int nz = 0;
-
-            bandaddr[idx] = w * 16 + g;
-            qmin = INT_MAX;
-            qmax = 0.0f;
-            for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
-                FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
-                if (band->energy <= band->threshold || band->threshold == 0.0f) {
-                    sce->zeroes[(w+w2)*16+g] = 1;
-                    continue;
-                }
-                sce->zeroes[(w+w2)*16+g] = 0;
-                nz = 1;
-                for (i = 0; i < sce->ics.swb_sizes[g]; i++) {
-                    float t = fabsf(coefs[w2*128+i]);
-                    if (t > 0.0f)
-                        qmin = FFMIN(qmin, t);
-                    qmax = FFMAX(qmax, t);
-                }
-            }
-            if (nz) {
-                int minscale, maxscale;
-                float minrd = INFINITY;
-                float maxval;
-                //minimum scalefactor index is when minimum nonzero coefficient after quantizing is not clipped
-                minscale = coef2minsf(qmin);
-                //maximum scalefactor index is when maximum coefficient after quantizing is still not zero
-                maxscale = coef2maxsf(qmax);
-                minscale = av_clip(minscale - q0, 0, TRELLIS_STATES - 1);
-                maxscale = av_clip(maxscale - q0, 0, TRELLIS_STATES);
-                maxval = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], s->scoefs+start);
-                for (q = minscale; q < maxscale; q++) {
-                    float dist = 0;
-                    int cb = find_min_book(maxval, sce->sf_idx[w*16+g]);
-                    for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
-                        FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
-                        dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
-                                                   q + q0, cb, lambda / band->threshold, INFINITY, NULL);
-                    }
-                    minrd = FFMIN(minrd, dist);
-
-                    for (i = 0; i < q1 - q0; i++) {
-                        float cost;
-                        cost = paths[idx - 1][i].cost + dist
-                               + ff_aac_scalefactor_bits[q - i + SCALE_DIFF_ZERO];
-                        if (cost < paths[idx][q].cost) {
-                            paths[idx][q].cost    = cost;
-                            paths[idx][q].prev    = i;
-                        }
-                    }
-                }
-            } else {
-                for (q = 0; q < q1 - q0; q++) {
-                    paths[idx][q].cost = paths[idx - 1][q].cost + 1;
-                    paths[idx][q].prev = q;
-                }
-            }
-            sce->zeroes[w*16+g] = !nz;
-            start += sce->ics.swb_sizes[g];
-            idx++;
-        }
-    }
-    idx--;
-    mincost = paths[idx][0].cost;
-    minq    = 0;
-    for (i = 1; i < TRELLIS_STATES; i++) {
-        if (paths[idx][i].cost < mincost) {
-            mincost = paths[idx][i].cost;
-            minq = i;
-        }
-    }
-    while (idx) {
-        sce->sf_idx[bandaddr[idx]] = minq + q0;
-        minq = paths[idx][minq].prev;
-        idx--;
-    }
-    //set the same quantizers inside window groups
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
-        for (g = 0;  g < sce->ics.num_swb; g++)
-            for (w2 = 1; w2 < sce->ics.group_len[w]; w2++)
-                sce->sf_idx[(w+w2)*16+g] = sce->sf_idx[w*16+g];
-}
-
-/**
- * two-loop quantizers search taken from ISO 13818-7 Appendix C
- */
-static void search_for_quantizers_twoloop(AVCodecContext *avctx,
-                                          AACEncContext *s,
-                                          SingleChannelElement *sce,
-                                          const float lambda)
-{
-    int start = 0, i, w, w2, g;
-    int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
-    float dists[128] = { 0 }, uplims[128];
-    float maxvals[128];
-    int fflag, minscaler;
-    int its  = 0;
-    int allz = 0;
-    float minthr = INFINITY;
-
-    // for values above this the decoder might end up in an endless loop
-    // due to always having more bits than what can be encoded.
-    destbits = FFMIN(destbits, 5800);
-    //XXX: some heuristic to determine initial quantizers will reduce search time
-    //determine zero bands and upper limits
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-        for (g = 0;  g < sce->ics.num_swb; g++) {
-            int nz = 0;
-            float uplim = 0.0f;
-            for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
-                FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
-                uplim += band->threshold;
-                if (band->energy <= band->threshold || band->threshold == 0.0f) {
-                    sce->zeroes[(w+w2)*16+g] = 1;
-                    continue;
-                }
-                nz = 1;
-            }
-            uplims[w*16+g] = uplim *512;
-            sce->zeroes[w*16+g] = !nz;
-            if (nz)
-                minthr = FFMIN(minthr, uplim);
-            allz |= nz;
-        }
-    }
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-        for (g = 0;  g < sce->ics.num_swb; g++) {
-            if (sce->zeroes[w*16+g]) {
-                sce->sf_idx[w*16+g] = SCALE_ONE_POS;
-                continue;
-            }
-            sce->sf_idx[w*16+g] = SCALE_ONE_POS + FFMIN(log2f(uplims[w*16+g]/minthr)*4,59);
-        }
-    }
-
-    if (!allz)
-        return;
-    abs_pow34_v(s->scoefs, sce->coeffs, 1024);
-
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-        start = w*128;
-        for (g = 0;  g < sce->ics.num_swb; g++) {
-            const float *scaled = s->scoefs + start;
-            maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled);
-            start += sce->ics.swb_sizes[g];
-        }
-    }
-
-    //perform two-loop search
-    //outer loop - improve quality
-    do {
-        int tbits, qstep;
-        minscaler = sce->sf_idx[0];
-        //inner loop - quantize spectrum to fit into given number of bits
-        qstep = its ? 1 : 32;
-        do {
-            int prev = -1;
-            tbits = 0;
-            fflag = 0;
-            for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-                start = w*128;
-                for (g = 0;  g < sce->ics.num_swb; g++) {
-                    const float *coefs = sce->coeffs + start;
-                    const float *scaled = s->scoefs + start;
-                    int bits = 0;
-                    int cb;
-                    float dist = 0.0f;
-
-                    if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
-                        start += sce->ics.swb_sizes[g];
-                        continue;
-                    }
-                    minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
-                    cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
-                    for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
-                        int b;
-                        dist += quantize_band_cost(s, coefs + w2*128,
-                                                   scaled + w2*128,
-                                                   sce->ics.swb_sizes[g],
-                                                   sce->sf_idx[w*16+g],
-                                                   cb,
-                                                   1.0f,
-                                                   INFINITY,
-                                                   &b);
-                        bits += b;
-                    }
-                    dists[w*16+g] = dist - bits;
-                    if (prev != -1) {
-                        bits += ff_aac_scalefactor_bits[sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO];
-                    }
-                    tbits += bits;
-                    start += sce->ics.swb_sizes[g];
-                    prev = sce->sf_idx[w*16+g];
-                }
-            }
-            if (tbits > destbits) {
-                for (i = 0; i < 128; i++)
-                    if (sce->sf_idx[i] < 218 - qstep)
-                        sce->sf_idx[i] += qstep;
-            } else {
-                for (i = 0; i < 128; i++)
-                    if (sce->sf_idx[i] > 60 - qstep)
-                        sce->sf_idx[i] -= qstep;
-            }
-            qstep >>= 1;
-            if (!qstep && tbits > destbits*1.02 && sce->sf_idx[0] < 217)
-                qstep = 1;
-        } while (qstep);
-
-        fflag = 0;
-        minscaler = av_clip(minscaler, 60, 255 - SCALE_MAX_DIFF);
-        for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-            for (g = 0; g < sce->ics.num_swb; g++) {
-                int prevsc = sce->sf_idx[w*16+g];
-                if (dists[w*16+g] > uplims[w*16+g] && sce->sf_idx[w*16+g] > 60) {
-                    if (find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]-1))
-                        sce->sf_idx[w*16+g]--;
-                    else //Try to make sure there is some energy in every band
-                        sce->sf_idx[w*16+g]-=2;
-                }
-                sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF);
-                sce->sf_idx[w*16+g] = FFMIN(sce->sf_idx[w*16+g], 219);
-                if (sce->sf_idx[w*16+g] != prevsc)
-                    fflag = 1;
-                sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
-            }
-        }
-        its++;
-    } while (fflag && its < 10);
-}
-
-static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
-                                       SingleChannelElement *sce,
-                                       const float lambda)
-{
-    int start = 0, i, w, w2, g;
-    float uplim[128], maxq[128];
-    int minq, maxsf;
-    float distfact = ((sce->ics.num_windows > 1) ? 85.80 : 147.84) / lambda;
-    int last = 0, lastband = 0, curband = 0;
-    float avg_energy = 0.0;
-    if (sce->ics.num_windows == 1) {
-        start = 0;
-        for (i = 0; i < 1024; i++) {
-            if (i - start >= sce->ics.swb_sizes[curband]) {
-                start += sce->ics.swb_sizes[curband];
-                curband++;
-            }
-            if (sce->coeffs[i]) {
-                avg_energy += sce->coeffs[i] * sce->coeffs[i];
-                last = i;
-                lastband = curband;
-            }
-        }
-    } else {
-        for (w = 0; w < 8; w++) {
-            const float *coeffs = sce->coeffs + w*128;
-            start = 0;
-            for (i = 0; i < 128; i++) {
-                if (i - start >= sce->ics.swb_sizes[curband]) {
-                    start += sce->ics.swb_sizes[curband];
-                    curband++;
-                }
-                if (coeffs[i]) {
-                    avg_energy += coeffs[i] * coeffs[i];
-                    last = FFMAX(last, i);
-                    lastband = FFMAX(lastband, curband);
-                }
-            }
-        }
-    }
-    last++;
-    avg_energy /= last;
-    if (avg_energy == 0.0f) {
-        for (i = 0; i < FF_ARRAY_ELEMS(sce->sf_idx); i++)
-            sce->sf_idx[i] = SCALE_ONE_POS;
-        return;
-    }
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-        start = w*128;
-        for (g = 0; g < sce->ics.num_swb; g++) {
-            float *coefs   = sce->coeffs + start;
-            const int size = sce->ics.swb_sizes[g];
-            int start2 = start, end2 = start + size, peakpos = start;
-            float maxval = -1, thr = 0.0f, t;
-            maxq[w*16+g] = 0.0f;
-            if (g > lastband) {
-                maxq[w*16+g] = 0.0f;
-                start += size;
-                for (w2 = 0; w2 < sce->ics.group_len[w]; w2++)
-                    memset(coefs + w2*128, 0, sizeof(coefs[0])*size);
-                continue;
-            }
-            for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
-                for (i = 0; i < size; i++) {
-                    float t = coefs[w2*128+i]*coefs[w2*128+i];
-                    maxq[w*16+g] = FFMAX(maxq[w*16+g], fabsf(coefs[w2*128 + i]));
-                    thr += t;
-                    if (sce->ics.num_windows == 1 && maxval < t) {
-                        maxval  = t;
-                        peakpos = start+i;
-                    }
-                }
-            }
-            if (sce->ics.num_windows == 1) {
-                start2 = FFMAX(peakpos - 2, start2);
-                end2   = FFMIN(peakpos + 3, end2);
-            } else {
-                start2 -= start;
-                end2   -= start;
-            }
-            start += size;
-            thr = pow(thr / (avg_energy * (end2 - start2)), 0.3 + 0.1*(lastband - g) / lastband);
-            t   = 1.0 - (1.0 * start2 / last);
-            uplim[w*16+g] = distfact / (1.4 * thr + t*t*t + 0.075);
-        }
-    }
-    memset(sce->sf_idx, 0, sizeof(sce->sf_idx));
-    abs_pow34_v(s->scoefs, sce->coeffs, 1024);
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-        start = w*128;
-        for (g = 0;  g < sce->ics.num_swb; g++) {
-            const float *coefs  = sce->coeffs + start;
-            const float *scaled = s->scoefs   + start;
-            const int size      = sce->ics.swb_sizes[g];
-            int scf, prev_scf, step;
-            int min_scf = -1, max_scf = 256;
-            float curdiff;
-            if (maxq[w*16+g] < 21.544) {
-                sce->zeroes[w*16+g] = 1;
-                start += size;
-                continue;
-            }
-            sce->zeroes[w*16+g] = 0;
-            scf  = prev_scf = av_clip(SCALE_ONE_POS - SCALE_DIV_512 - log2f(1/maxq[w*16+g])*16/3, 60, 218);
-            step = 16;
-            for (;;) {
-                float dist = 0.0f;
-                int quant_max;
-
-                for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
-                    int b;
-                    dist += quantize_band_cost(s, coefs + w2*128,
-                                               scaled + w2*128,
-                                               sce->ics.swb_sizes[g],
-                                               scf,
-                                               ESC_BT,
-                                               lambda,
-                                               INFINITY,
-                                               &b);
-                    dist -= b;
-                }
-                dist *= 1.0f / 512.0f / lambda;
-                quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[POW_SF2_ZERO - scf + SCALE_ONE_POS - SCALE_DIV_512]);
-                if (quant_max >= 8191) { // too much, return to the previous quantizer
-                    sce->sf_idx[w*16+g] = prev_scf;
-                    break;
-                }
-                prev_scf = scf;
-                curdiff = fabsf(dist - uplim[w*16+g]);
-                if (curdiff <= 1.0f)
-                    step = 0;
-                else
-                    step = log2f(curdiff);
-                if (dist > uplim[w*16+g])
-                    step = -step;
-                scf += step;
-                scf = av_clip_uint8(scf);
-                step = scf - prev_scf;
-                if (FFABS(step) <= 1 || (step > 0 && scf >= max_scf) || (step < 0 && scf <= min_scf)) {
-                    sce->sf_idx[w*16+g] = av_clip(scf, min_scf, max_scf);
-                    break;
-                }
-                if (step > 0)
-                    min_scf = prev_scf;
-                else
-                    max_scf = prev_scf;
-            }
-            start += size;
-        }
-    }
-    minq = sce->sf_idx[0] ? sce->sf_idx[0] : INT_MAX;
-    for (i = 1; i < 128; i++) {
-        if (!sce->sf_idx[i])
-            sce->sf_idx[i] = sce->sf_idx[i-1];
-        else
-            minq = FFMIN(minq, sce->sf_idx[i]);
-    }
-    if (minq == INT_MAX)
-        minq = 0;
-    minq = FFMIN(minq, SCALE_MAX_POS);
-    maxsf = FFMIN(minq + SCALE_MAX_DIFF, SCALE_MAX_POS);
-    for (i = 126; i >= 0; i--) {
-        if (!sce->sf_idx[i])
-            sce->sf_idx[i] = sce->sf_idx[i+1];
-        sce->sf_idx[i] = av_clip(sce->sf_idx[i], minq, maxsf);
-    }
-}
-
-static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s,
-                                       SingleChannelElement *sce,
-                                       const float lambda)
-{
-    int i, w, w2, g;
-    int minq = 255;
-
-    memset(sce->sf_idx, 0, sizeof(sce->sf_idx));
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-        for (g = 0; g < sce->ics.num_swb; g++) {
-            for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
-                FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
-                if (band->energy <= band->threshold) {
-                    sce->sf_idx[(w+w2)*16+g] = 218;
-                    sce->zeroes[(w+w2)*16+g] = 1;
-                } else {
-                    sce->sf_idx[(w+w2)*16+g] = av_clip(SCALE_ONE_POS - SCALE_DIV_512 + log2f(band->threshold), 80, 218);
-                    sce->zeroes[(w+w2)*16+g] = 0;
-                }
-                minq = FFMIN(minq, sce->sf_idx[(w+w2)*16+g]);
-            }
-        }
-    }
-    for (i = 0; i < 128; i++) {
-        sce->sf_idx[i] = 140;
-        //av_clip(sce->sf_idx[i], minq, minq + SCALE_MAX_DIFF - 1);
-    }
-    //set the same quantizers inside window groups
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
-        for (g = 0;  g < sce->ics.num_swb; g++)
-            for (w2 = 1; w2 < sce->ics.group_len[w]; w2++)
-                sce->sf_idx[(w+w2)*16+g] = sce->sf_idx[w*16+g];
-}
-
-static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
-                          const float lambda)
-{
-    int start = 0, i, w, w2, g;
-    float M[128], S[128];
-    float *L34 = s->scoefs, *R34 = s->scoefs + 128, *M34 = s->scoefs + 128*2, *S34 = s->scoefs + 128*3;
-    SingleChannelElement *sce0 = &cpe->ch[0];
-    SingleChannelElement *sce1 = &cpe->ch[1];
-    if (!cpe->common_window)
-        return;
-    for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {
-        for (g = 0;  g < sce0->ics.num_swb; g++) {
-            if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) {
-                float dist1 = 0.0f, dist2 = 0.0f;
-                for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
-                    FFPsyBand *band0 = &s->psy.ch[s->cur_channel+0].psy_bands[(w+w2)*16+g];
-                    FFPsyBand *band1 = &s->psy.ch[s->cur_channel+1].psy_bands[(w+w2)*16+g];
-                    float minthr = FFMIN(band0->threshold, band1->threshold);
-                    float maxthr = FFMAX(band0->threshold, band1->threshold);
-                    for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
-                        M[i] = (sce0->coeffs[start+w2*128+i]
-                              + sce1->coeffs[start+w2*128+i]) * 0.5;
-                        S[i] =  M[i]
-                              - sce1->coeffs[start+w2*128+i];
-                    }
-                    abs_pow34_v(L34, sce0->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);
-                    abs_pow34_v(R34, sce1->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);
-                    abs_pow34_v(M34, M,                         sce0->ics.swb_sizes[g]);
-                    abs_pow34_v(S34, S,                         sce0->ics.swb_sizes[g]);
-                    dist1 += quantize_band_cost(s, sce0->coeffs + start + w2*128,
-                                                L34,
-                                                sce0->ics.swb_sizes[g],
-                                                sce0->sf_idx[(w+w2)*16+g],
-                                                sce0->band_type[(w+w2)*16+g],
-                                                lambda / band0->threshold, INFINITY, NULL);
-                    dist1 += quantize_band_cost(s, sce1->coeffs + start + w2*128,
-                                                R34,
-                                                sce1->ics.swb_sizes[g],
-                                                sce1->sf_idx[(w+w2)*16+g],
-                                                sce1->band_type[(w+w2)*16+g],
-                                                lambda / band1->threshold, INFINITY, NULL);
-                    dist2 += quantize_band_cost(s, M,
-                                                M34,
-                                                sce0->ics.swb_sizes[g],
-                                                sce0->sf_idx[(w+w2)*16+g],
-                                                sce0->band_type[(w+w2)*16+g],
-                                                lambda / maxthr, INFINITY, NULL);
-                    dist2 += quantize_band_cost(s, S,
-                                                S34,
-                                                sce1->ics.swb_sizes[g],
-                                                sce1->sf_idx[(w+w2)*16+g],
-                                                sce1->band_type[(w+w2)*16+g],
-                                                lambda / minthr, INFINITY, NULL);
-                }
-                cpe->ms_mask[w*16+g] = dist2 < dist1;
-            }
-            start += sce0->ics.swb_sizes[g];
-        }
-    }
-}
-
-AACCoefficientsEncoder ff_aac_coders[] = {
-    {
-        search_for_quantizers_faac,
-        encode_window_bands_info,
-        quantize_and_encode_band,
-        search_for_ms,
-    },
-    {
-        search_for_quantizers_anmr,
-        encode_window_bands_info,
-        quantize_and_encode_band,
-        search_for_ms,
-    },
-    {
-        search_for_quantizers_twoloop,
-        codebook_trellis_rate,
-        quantize_and_encode_band,
-        search_for_ms,
-    },
-    {
-        search_for_quantizers_fast,
-        encode_window_bands_info,
-        quantize_and_encode_band,
-        search_for_ms,
-    },
-};
diff --git a/deps/libav/libavcodec/aacdec.c b/deps/libav/libavcodec/aacdec.c
deleted file mode 100644
index e25838f..0000000
--- a/deps/libav/libavcodec/aacdec.c
+++ /dev/null
@@ -1,3286 +0,0 @@
-/*
- * AAC decoder
- * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
- * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
- * Copyright (c) 2008-2013 Alex Converse <alex.converse at gmail.com>
- *
- * AAC LATM decoder
- * Copyright (c) 2008-2010 Paul Kendall <paul at kcbbs.gen.nz>
- * Copyright (c) 2010      Janne Grunau <janne-libav at jannau.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC decoder
- * @author Oded Shimon  ( ods15 ods15 dyndns org )
- * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
- */
-
-/*
- * supported tools
- *
- * Support?             Name
- * N (code in SoC repo) gain control
- * Y                    block switching
- * Y                    window shapes - standard
- * N                    window shapes - Low Delay
- * Y                    filterbank - standard
- * N (code in SoC repo) filterbank - Scalable Sample Rate
- * Y                    Temporal Noise Shaping
- * Y                    Long Term Prediction
- * Y                    intensity stereo
- * Y                    channel coupling
- * Y                    frequency domain prediction
- * Y                    Perceptual Noise Substitution
- * Y                    Mid/Side stereo
- * N                    Scalable Inverse AAC Quantization
- * N                    Frequency Selective Switch
- * N                    upsampling filter
- * Y                    quantization & coding - AAC
- * N                    quantization & coding - TwinVQ
- * N                    quantization & coding - BSAC
- * N                    AAC Error Resilience tools
- * N                    Error Resilience payload syntax
- * N                    Error Protection tool
- * N                    CELP
- * N                    Silence Compression
- * N                    HVXC
- * N                    HVXC 4kbits/s VR
- * N                    Structured Audio tools
- * N                    Structured Audio Sample Bank Format
- * N                    MIDI
- * N                    Harmonic and Individual Lines plus Noise
- * N                    Text-To-Speech Interface
- * Y                    Spectral Band Replication
- * Y (not in this code) Layer-1
- * Y (not in this code) Layer-2
- * Y (not in this code) Layer-3
- * N                    SinuSoidal Coding (Transient, Sinusoid, Noise)
- * Y                    Parametric Stereo
- * N                    Direct Stream Transfer
- *
- * Note: - HE AAC v1 comprises LC AAC with Spectral Band Replication.
- *       - HE AAC v2 comprises LC AAC with Spectral Band Replication and
-           Parametric Stereo.
- */
-
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "fft.h"
-#include "fmtconvert.h"
-#include "lpc.h"
-#include "kbdwin.h"
-#include "sinewin.h"
-
-#include "aac.h"
-#include "aactab.h"
-#include "aacdectab.h"
-#include "cbrt_tablegen.h"
-#include "sbr.h"
-#include "aacsbr.h"
-#include "mpeg4audio.h"
-#include "aacadtsdec.h"
-#include "libavutil/intfloat.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <math.h>
-#include <stdint.h>
-#include <string.h>
-
-#if ARCH_ARM
-#   include "arm/aac.h"
-#endif
-
-static VLC vlc_scalefactors;
-static VLC vlc_spectral[11];
-
-static const char overread_err[] = "Input buffer exhausted before END element found\n";
-
-static int count_channels(uint8_t (*layout)[3], int tags)
-{
-    int i, sum = 0;
-    for (i = 0; i < tags; i++) {
-        int syn_ele = layout[i][0];
-        int pos     = layout[i][2];
-        sum += (1 + (syn_ele == TYPE_CPE)) *
-               (pos != AAC_CHANNEL_OFF && pos != AAC_CHANNEL_CC);
-    }
-    return sum;
-}
-
-/**
- * Check for the channel element in the current channel position configuration.
- * If it exists, make sure the appropriate element is allocated and map the
- * channel order to match the internal Libav channel layout.
- *
- * @param   che_pos current channel position configuration
- * @param   type channel element type
- * @param   id channel element id
- * @param   channels count of the number of channels in the configuration
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static av_cold int che_configure(AACContext *ac,
-                                 enum ChannelPosition che_pos,
-                                 int type, int id, int *channels)
-{
-    if (*channels >= MAX_CHANNELS)
-        return AVERROR_INVALIDDATA;
-    if (che_pos) {
-        if (!ac->che[type][id]) {
-            if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
-                return AVERROR(ENOMEM);
-            ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);
-        }
-        if (type != TYPE_CCE) {
-            ac->output_element[(*channels)++] = &ac->che[type][id]->ch[0];
-            if (type == TYPE_CPE ||
-                (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) {
-                ac->output_element[(*channels)++] = &ac->che[type][id]->ch[1];
-            }
-        }
-    } else {
-        if (ac->che[type][id])
-            ff_aac_sbr_ctx_close(&ac->che[type][id]->sbr);
-        av_freep(&ac->che[type][id]);
-    }
-    return 0;
-}
-
-static int frame_configure_elements(AVCodecContext *avctx)
-{
-    AACContext *ac = avctx->priv_data;
-    int type, id, ch, ret;
-
-    /* set channel pointers to internal buffers by default */
-    for (type = 0; type < 4; type++) {
-        for (id = 0; id < MAX_ELEM_ID; id++) {
-            ChannelElement *che = ac->che[type][id];
-            if (che) {
-                che->ch[0].ret = che->ch[0].ret_buf;
-                che->ch[1].ret = che->ch[1].ret_buf;
-            }
-        }
-    }
-
-    /* get output buffer */
-    av_frame_unref(ac->frame);
-    ac->frame->nb_samples = 2048;
-    if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    /* map output channel pointers to AVFrame data */
-    for (ch = 0; ch < avctx->channels; ch++) {
-        if (ac->output_element[ch])
-            ac->output_element[ch]->ret = (float *)ac->frame->extended_data[ch];
-    }
-
-    return 0;
-}
-
-struct elem_to_channel {
-    uint64_t av_position;
-    uint8_t syn_ele;
-    uint8_t elem_id;
-    uint8_t aac_position;
-};
-
-static int assign_pair(struct elem_to_channel e2c_vec[MAX_ELEM_ID],
-                       uint8_t (*layout_map)[3], int offset, uint64_t left,
-                       uint64_t right, int pos)
-{
-    if (layout_map[offset][0] == TYPE_CPE) {
-        e2c_vec[offset] = (struct elem_to_channel) {
-            .av_position  = left | right,
-            .syn_ele      = TYPE_CPE,
-            .elem_id      = layout_map[offset][1],
-            .aac_position = pos
-        };
-        return 1;
-    } else {
-        e2c_vec[offset] = (struct elem_to_channel) {
-            .av_position  = left,
-            .syn_ele      = TYPE_SCE,
-            .elem_id      = layout_map[offset][1],
-            .aac_position = pos
-        };
-        e2c_vec[offset + 1] = (struct elem_to_channel) {
-            .av_position  = right,
-            .syn_ele      = TYPE_SCE,
-            .elem_id      = layout_map[offset + 1][1],
-            .aac_position = pos
-        };
-        return 2;
-    }
-}
-
-static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos,
-                                 int *current)
-{
-    int num_pos_channels = 0;
-    int first_cpe        = 0;
-    int sce_parity       = 0;
-    int i;
-    for (i = *current; i < tags; i++) {
-        if (layout_map[i][2] != pos)
-            break;
-        if (layout_map[i][0] == TYPE_CPE) {
-            if (sce_parity) {
-                if (pos == AAC_CHANNEL_FRONT && !first_cpe) {
-                    sce_parity = 0;
-                } else {
-                    return -1;
-                }
-            }
-            num_pos_channels += 2;
-            first_cpe         = 1;
-        } else {
-            num_pos_channels++;
-            sce_parity ^= 1;
-        }
-    }
-    if (sce_parity &&
-        ((pos == AAC_CHANNEL_FRONT && first_cpe) || pos == AAC_CHANNEL_SIDE))
-        return -1;
-    *current = i;
-    return num_pos_channels;
-}
-
-static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
-{
-    int i, n, total_non_cc_elements;
-    struct elem_to_channel e2c_vec[4 * MAX_ELEM_ID] = { { 0 } };
-    int num_front_channels, num_side_channels, num_back_channels;
-    uint64_t layout;
-
-    if (FF_ARRAY_ELEMS(e2c_vec) < tags)
-        return 0;
-
-    i = 0;
-    num_front_channels =
-        count_paired_channels(layout_map, tags, AAC_CHANNEL_FRONT, &i);
-    if (num_front_channels < 0)
-        return 0;
-    num_side_channels =
-        count_paired_channels(layout_map, tags, AAC_CHANNEL_SIDE, &i);
-    if (num_side_channels < 0)
-        return 0;
-    num_back_channels =
-        count_paired_channels(layout_map, tags, AAC_CHANNEL_BACK, &i);
-    if (num_back_channels < 0)
-        return 0;
-
-    i = 0;
-    if (num_front_channels & 1) {
-        e2c_vec[i] = (struct elem_to_channel) {
-            .av_position  = AV_CH_FRONT_CENTER,
-            .syn_ele      = TYPE_SCE,
-            .elem_id      = layout_map[i][1],
-            .aac_position = AAC_CHANNEL_FRONT
-        };
-        i++;
-        num_front_channels--;
-    }
-    if (num_front_channels >= 4) {
-        i += assign_pair(e2c_vec, layout_map, i,
-                         AV_CH_FRONT_LEFT_OF_CENTER,
-                         AV_CH_FRONT_RIGHT_OF_CENTER,
-                         AAC_CHANNEL_FRONT);
-        num_front_channels -= 2;
-    }
-    if (num_front_channels >= 2) {
-        i += assign_pair(e2c_vec, layout_map, i,
-                         AV_CH_FRONT_LEFT,
-                         AV_CH_FRONT_RIGHT,
-                         AAC_CHANNEL_FRONT);
-        num_front_channels -= 2;
-    }
-    while (num_front_channels >= 2) {
-        i += assign_pair(e2c_vec, layout_map, i,
-                         UINT64_MAX,
-                         UINT64_MAX,
-                         AAC_CHANNEL_FRONT);
-        num_front_channels -= 2;
-    }
-
-    if (num_side_channels >= 2) {
-        i += assign_pair(e2c_vec, layout_map, i,
-                         AV_CH_SIDE_LEFT,
-                         AV_CH_SIDE_RIGHT,
-                         AAC_CHANNEL_FRONT);
-        num_side_channels -= 2;
-    }
-    while (num_side_channels >= 2) {
-        i += assign_pair(e2c_vec, layout_map, i,
-                         UINT64_MAX,
-                         UINT64_MAX,
-                         AAC_CHANNEL_SIDE);
-        num_side_channels -= 2;
-    }
-
-    while (num_back_channels >= 4) {
-        i += assign_pair(e2c_vec, layout_map, i,
-                         UINT64_MAX,
-                         UINT64_MAX,
-                         AAC_CHANNEL_BACK);
-        num_back_channels -= 2;
-    }
-    if (num_back_channels >= 2) {
-        i += assign_pair(e2c_vec, layout_map, i,
-                         AV_CH_BACK_LEFT,
-                         AV_CH_BACK_RIGHT,
-                         AAC_CHANNEL_BACK);
-        num_back_channels -= 2;
-    }
-    if (num_back_channels) {
-        e2c_vec[i] = (struct elem_to_channel) {
-            .av_position  = AV_CH_BACK_CENTER,
-            .syn_ele      = TYPE_SCE,
-            .elem_id      = layout_map[i][1],
-            .aac_position = AAC_CHANNEL_BACK
-        };
-        i++;
-        num_back_channels--;
-    }
-
-    if (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
-        e2c_vec[i] = (struct elem_to_channel) {
-            .av_position  = AV_CH_LOW_FREQUENCY,
-            .syn_ele      = TYPE_LFE,
-            .elem_id      = layout_map[i][1],
-            .aac_position = AAC_CHANNEL_LFE
-        };
-        i++;
-    }
-    while (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) {
-        e2c_vec[i] = (struct elem_to_channel) {
-            .av_position  = UINT64_MAX,
-            .syn_ele      = TYPE_LFE,
-            .elem_id      = layout_map[i][1],
-            .aac_position = AAC_CHANNEL_LFE
-        };
-        i++;
-    }
-
-    // Must choose a stable sort
-    total_non_cc_elements = n = i;
-    do {
-        int next_n = 0;
-        for (i = 1; i < n; i++)
-            if (e2c_vec[i - 1].av_position > e2c_vec[i].av_position) {
-                FFSWAP(struct elem_to_channel, e2c_vec[i - 1], e2c_vec[i]);
-                next_n = i;
-            }
-        n = next_n;
-    } while (n > 0);
-
-    layout = 0;
-    for (i = 0; i < total_non_cc_elements; i++) {
-        layout_map[i][0] = e2c_vec[i].syn_ele;
-        layout_map[i][1] = e2c_vec[i].elem_id;
-        layout_map[i][2] = e2c_vec[i].aac_position;
-        if (e2c_vec[i].av_position != UINT64_MAX) {
-            layout |= e2c_vec[i].av_position;
-        }
-    }
-
-    return layout;
-}
-
-/**
- * Save current output configuration if and only if it has been locked.
- */
-static void push_output_configuration(AACContext *ac) {
-    if (ac->oc[1].status == OC_LOCKED) {
-        ac->oc[0] = ac->oc[1];
-    }
-    ac->oc[1].status = OC_NONE;
-}
-
-/**
- * Restore the previous output configuration if and only if the current
- * configuration is unlocked.
- */
-static void pop_output_configuration(AACContext *ac) {
-    if (ac->oc[1].status != OC_LOCKED && ac->oc[0].status != OC_NONE) {
-        ac->oc[1] = ac->oc[0];
-        ac->avctx->channels = ac->oc[1].channels;
-        ac->avctx->channel_layout = ac->oc[1].channel_layout;
-    }
-}
-
-/**
- * Configure output channel order based on the current program
- * configuration element.
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int output_configure(AACContext *ac,
-                            uint8_t layout_map[MAX_ELEM_ID * 4][3], int tags,
-                            enum OCStatus oc_type, int get_new_frame)
-{
-    AVCodecContext *avctx = ac->avctx;
-    int i, channels = 0, ret;
-    uint64_t layout = 0;
-
-    if (ac->oc[1].layout_map != layout_map) {
-        memcpy(ac->oc[1].layout_map, layout_map, tags * sizeof(layout_map[0]));
-        ac->oc[1].layout_map_tags = tags;
-    }
-
-    // Try to sniff a reasonable channel order, otherwise output the
-    // channels in the order the PCE declared them.
-    if (avctx->request_channel_layout != AV_CH_LAYOUT_NATIVE)
-        layout = sniff_channel_order(layout_map, tags);
-    for (i = 0; i < tags; i++) {
-        int type =     layout_map[i][0];
-        int id =       layout_map[i][1];
-        int position = layout_map[i][2];
-        // Allocate or free elements depending on if they are in the
-        // current program configuration.
-        ret = che_configure(ac, position, type, id, &channels);
-        if (ret < 0)
-            return ret;
-    }
-    if (ac->oc[1].m4ac.ps == 1 && channels == 2) {
-        if (layout == AV_CH_FRONT_CENTER) {
-            layout = AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT;
-        } else {
-            layout = 0;
-        }
-    }
-
-    memcpy(ac->tag_che_map, ac->che, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0]));
-    avctx->channel_layout = ac->oc[1].channel_layout = layout;
-    avctx->channels       = ac->oc[1].channels       = channels;
-    ac->oc[1].status = oc_type;
-
-    if (get_new_frame) {
-        if ((ret = frame_configure_elements(ac->avctx)) < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-/**
- * Set up channel positions based on a default channel configuration
- * as specified in table 1.17.
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int set_default_channel_config(AVCodecContext *avctx,
-                                      uint8_t (*layout_map)[3],
-                                      int *tags,
-                                      int channel_config)
-{
-    if (channel_config < 1 || channel_config > 7) {
-        av_log(avctx, AV_LOG_ERROR,
-               "invalid default channel configuration (%d)\n",
-               channel_config);
-        return AVERROR_INVALIDDATA;
-    }
-    *tags = tags_per_config[channel_config];
-    memcpy(layout_map, aac_channel_layout_map[channel_config - 1],
-           *tags * sizeof(*layout_map));
-    return 0;
-}
-
-static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
-{
-    /* For PCE based channel configurations map the channels solely based
-     * on tags. */
-    if (!ac->oc[1].m4ac.chan_config) {
-        return ac->tag_che_map[type][elem_id];
-    }
-    // Allow single CPE stereo files to be signalled with mono configuration.
-    if (!ac->tags_mapped && type == TYPE_CPE &&
-        ac->oc[1].m4ac.chan_config == 1) {
-        uint8_t layout_map[MAX_ELEM_ID*4][3];
-        int layout_map_tags;
-        push_output_configuration(ac);
-
-        if (set_default_channel_config(ac->avctx, layout_map,
-                                       &layout_map_tags, 2) < 0)
-            return NULL;
-        if (output_configure(ac, layout_map, layout_map_tags,
-                             OC_TRIAL_FRAME, 1) < 0)
-            return NULL;
-
-        ac->oc[1].m4ac.chan_config = 2;
-        ac->oc[1].m4ac.ps = 0;
-    }
-    // And vice-versa
-    if (!ac->tags_mapped && type == TYPE_SCE &&
-        ac->oc[1].m4ac.chan_config == 2) {
-        uint8_t layout_map[MAX_ELEM_ID * 4][3];
-        int layout_map_tags;
-        push_output_configuration(ac);
-
-        if (set_default_channel_config(ac->avctx, layout_map,
-                                       &layout_map_tags, 1) < 0)
-            return NULL;
-        if (output_configure(ac, layout_map, layout_map_tags,
-                             OC_TRIAL_FRAME, 1) < 0)
-            return NULL;
-
-        ac->oc[1].m4ac.chan_config = 1;
-        if (ac->oc[1].m4ac.sbr)
-            ac->oc[1].m4ac.ps = -1;
-    }
-    /* For indexed channel configurations map the channels solely based
-     * on position. */
-    switch (ac->oc[1].m4ac.chan_config) {
-    case 7:
-        if (ac->tags_mapped == 3 && type == TYPE_CPE) {
-            ac->tags_mapped++;
-            return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2];
-        }
-    case 6:
-        /* Some streams incorrectly code 5.1 audio as
-         * SCE[0] CPE[0] CPE[1] SCE[1]
-         * instead of
-         * SCE[0] CPE[0] CPE[1] LFE[0].
-         * If we seem to have encountered such a stream, transfer
-         * the LFE[0] element to the SCE[1]'s mapping */
-        if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
-            ac->tags_mapped++;
-            return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0];
-        }
-    case 5:
-        if (ac->tags_mapped == 2 && type == TYPE_CPE) {
-            ac->tags_mapped++;
-            return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1];
-        }
-    case 4:
-        if (ac->tags_mapped == 2 &&
-            ac->oc[1].m4ac.chan_config == 4 &&
-            type == TYPE_SCE) {
-            ac->tags_mapped++;
-            return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
-        }
-    case 3:
-    case 2:
-        if (ac->tags_mapped == (ac->oc[1].m4ac.chan_config != 2) &&
-            type == TYPE_CPE) {
-            ac->tags_mapped++;
-            return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][0];
-        } else if (ac->oc[1].m4ac.chan_config == 2) {
-            return NULL;
-        }
-    case 1:
-        if (!ac->tags_mapped && type == TYPE_SCE) {
-            ac->tags_mapped++;
-            return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][0];
-        }
-    default:
-        return NULL;
-    }
-}
-
-/**
- * Decode an array of 4 bit element IDs, optionally interleaved with a
- * stereo/mono switching bit.
- *
- * @param type speaker type/position for these channels
- */
-static void decode_channel_map(uint8_t layout_map[][3],
-                               enum ChannelPosition type,
-                               GetBitContext *gb, int n)
-{
-    while (n--) {
-        enum RawDataBlockType syn_ele;
-        switch (type) {
-        case AAC_CHANNEL_FRONT:
-        case AAC_CHANNEL_BACK:
-        case AAC_CHANNEL_SIDE:
-            syn_ele = get_bits1(gb);
-            break;
-        case AAC_CHANNEL_CC:
-            skip_bits1(gb);
-            syn_ele = TYPE_CCE;
-            break;
-        case AAC_CHANNEL_LFE:
-            syn_ele = TYPE_LFE;
-            break;
-        }
-        layout_map[0][0] = syn_ele;
-        layout_map[0][1] = get_bits(gb, 4);
-        layout_map[0][2] = type;
-        layout_map++;
-    }
-}
-
-/**
- * Decode program configuration element; reference: table 4.2.
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
-                      uint8_t (*layout_map)[3],
-                      GetBitContext *gb)
-{
-    int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc;
-    int sampling_index;
-    int comment_len;
-    int tags;
-
-    skip_bits(gb, 2);  // object_type
-
-    sampling_index = get_bits(gb, 4);
-    if (m4ac->sampling_index != sampling_index)
-        av_log(avctx, AV_LOG_WARNING,
-               "Sample rate index in program config element does not "
-               "match the sample rate index configured by the container.\n");
-
-    num_front       = get_bits(gb, 4);
-    num_side        = get_bits(gb, 4);
-    num_back        = get_bits(gb, 4);
-    num_lfe         = get_bits(gb, 2);
-    num_assoc_data  = get_bits(gb, 3);
-    num_cc          = get_bits(gb, 4);
-
-    if (get_bits1(gb))
-        skip_bits(gb, 4); // mono_mixdown_tag
-    if (get_bits1(gb))
-        skip_bits(gb, 4); // stereo_mixdown_tag
-
-    if (get_bits1(gb))
-        skip_bits(gb, 3); // mixdown_coeff_index and pseudo_surround
-
-    decode_channel_map(layout_map       , AAC_CHANNEL_FRONT, gb, num_front);
-    tags = num_front;
-    decode_channel_map(layout_map + tags, AAC_CHANNEL_SIDE,  gb, num_side);
-    tags += num_side;
-    decode_channel_map(layout_map + tags, AAC_CHANNEL_BACK,  gb, num_back);
-    tags += num_back;
-    decode_channel_map(layout_map + tags, AAC_CHANNEL_LFE,   gb, num_lfe);
-    tags += num_lfe;
-
-    skip_bits_long(gb, 4 * num_assoc_data);
-
-    decode_channel_map(layout_map + tags, AAC_CHANNEL_CC,    gb, num_cc);
-    tags += num_cc;
-
-    align_get_bits(gb);
-
-    /* comment field, first byte is length */
-    comment_len = get_bits(gb, 8) * 8;
-    if (get_bits_left(gb) < comment_len) {
-        av_log(avctx, AV_LOG_ERROR, overread_err);
-        return AVERROR_INVALIDDATA;
-    }
-    skip_bits_long(gb, comment_len);
-    return tags;
-}
-
-/**
- * Decode GA "General Audio" specific configuration; reference: table 4.1.
- *
- * @param   ac          pointer to AACContext, may be null
- * @param   avctx       pointer to AVCCodecContext, used for logging
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
-                                     GetBitContext *gb,
-                                     MPEG4AudioConfig *m4ac,
-                                     int channel_config)
-{
-    int extension_flag, ret, ep_config, res_flags;
-    uint8_t layout_map[MAX_ELEM_ID*4][3];
-    int tags = 0;
-
-    if (get_bits1(gb)) { // frameLengthFlag
-        avpriv_request_sample(avctx, "960/120 MDCT window");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (get_bits1(gb))       // dependsOnCoreCoder
-        skip_bits(gb, 14);   // coreCoderDelay
-    extension_flag = get_bits1(gb);
-
-    if (m4ac->object_type == AOT_AAC_SCALABLE ||
-        m4ac->object_type == AOT_ER_AAC_SCALABLE)
-        skip_bits(gb, 3);     // layerNr
-
-    if (channel_config == 0) {
-        skip_bits(gb, 4);  // element_instance_tag
-        tags = decode_pce(avctx, m4ac, layout_map, gb);
-        if (tags < 0)
-            return tags;
-    } else {
-        if ((ret = set_default_channel_config(avctx, layout_map,
-                                              &tags, channel_config)))
-            return ret;
-    }
-
-    if (count_channels(layout_map, tags) > 1) {
-        m4ac->ps = 0;
-    } else if (m4ac->sbr == 1 && m4ac->ps == -1)
-        m4ac->ps = 1;
-
-    if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR, 0)))
-        return ret;
-
-    if (extension_flag) {
-        switch (m4ac->object_type) {
-        case AOT_ER_BSAC:
-            skip_bits(gb, 5);    // numOfSubFrame
-            skip_bits(gb, 11);   // layer_length
-            break;
-        case AOT_ER_AAC_LC:
-        case AOT_ER_AAC_LTP:
-        case AOT_ER_AAC_SCALABLE:
-        case AOT_ER_AAC_LD:
-            res_flags = get_bits(gb, 3);
-            if (res_flags) {
-                avpriv_report_missing_feature(avctx,
-                                              "AAC data resilience (flags %x)",
-                                              res_flags);
-                return AVERROR_PATCHWELCOME;
-            }
-            break;
-        }
-        skip_bits1(gb);    // extensionFlag3 (TBD in version 3)
-    }
-    switch (m4ac->object_type) {
-    case AOT_ER_AAC_LC:
-    case AOT_ER_AAC_LTP:
-    case AOT_ER_AAC_SCALABLE:
-    case AOT_ER_AAC_LD:
-        ep_config = get_bits(gb, 2);
-        if (ep_config) {
-            avpriv_report_missing_feature(avctx,
-                                          "epConfig %d", ep_config);
-            return AVERROR_PATCHWELCOME;
-        }
-    }
-    return 0;
-}
-
-static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
-                                     GetBitContext *gb,
-                                     MPEG4AudioConfig *m4ac,
-                                     int channel_config)
-{
-    int ret, ep_config, res_flags;
-    uint8_t layout_map[MAX_ELEM_ID*4][3];
-    int tags = 0;
-    const int ELDEXT_TERM = 0;
-
-    m4ac->ps  = 0;
-    m4ac->sbr = 0;
-
-    if (get_bits1(gb)) { // frameLengthFlag
-        avpriv_request_sample(avctx, "960/120 MDCT window");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    res_flags = get_bits(gb, 3);
-    if (res_flags) {
-        avpriv_report_missing_feature(avctx,
-                                      "AAC data resilience (flags %x)",
-                                      res_flags);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (get_bits1(gb)) { // ldSbrPresentFlag
-        avpriv_report_missing_feature(avctx,
-                                      "Low Delay SBR");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    while (get_bits(gb, 4) != ELDEXT_TERM) {
-        int len = get_bits(gb, 4);
-        if (len == 15)
-            len += get_bits(gb, 8);
-        if (len == 15 + 255)
-            len += get_bits(gb, 16);
-        if (get_bits_left(gb) < len * 8 + 4) {
-            av_log(ac->avctx, AV_LOG_ERROR, overread_err);
-            return AVERROR_INVALIDDATA;
-        }
-        skip_bits_long(gb, 8 * len);
-    }
-
-    if ((ret = set_default_channel_config(avctx, layout_map,
-                                          &tags, channel_config)))
-        return ret;
-
-    if (ac && (ret = output_configure(ac, layout_map, tags, OC_GLOBAL_HDR, 0)))
-        return ret;
-
-    ep_config = get_bits(gb, 2);
-    if (ep_config) {
-        avpriv_report_missing_feature(avctx,
-                                      "epConfig %d", ep_config);
-        return AVERROR_PATCHWELCOME;
-    }
-    return 0;
-}
-
-/**
- * Decode audio specific configuration; reference: table 1.13.
- *
- * @param   ac          pointer to AACContext, may be null
- * @param   avctx       pointer to AVCCodecContext, used for logging
- * @param   m4ac        pointer to MPEG4AudioConfig, used for parsing
- * @param   data        pointer to buffer holding an audio specific config
- * @param   bit_size    size of audio specific config or data in bits
- * @param   sync_extension look for an appended sync extension
- *
- * @return  Returns error status or number of consumed bits. <0 - error
- */
-static int decode_audio_specific_config(AACContext *ac,
-                                        AVCodecContext *avctx,
-                                        MPEG4AudioConfig *m4ac,
-                                        const uint8_t *data, int bit_size,
-                                        int sync_extension)
-{
-    GetBitContext gb;
-    int i, ret;
-
-    av_dlog(avctx, "extradata size %d\n", avctx->extradata_size);
-    for (i = 0; i < avctx->extradata_size; i++)
-        av_dlog(avctx, "%02x ", avctx->extradata[i]);
-    av_dlog(avctx, "\n");
-
-    if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
-        return ret;
-
-    if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size,
-                                          sync_extension)) < 0)
-        return AVERROR_INVALIDDATA;
-    if (m4ac->sampling_index > 12) {
-        av_log(avctx, AV_LOG_ERROR,
-               "invalid sampling rate index %d\n",
-               m4ac->sampling_index);
-        return AVERROR_INVALIDDATA;
-    }
-    if (m4ac->object_type == AOT_ER_AAC_LD &&
-        (m4ac->sampling_index < 3 || m4ac->sampling_index > 7)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "invalid low delay sampling rate index %d\n",
-               m4ac->sampling_index);
-        return AVERROR_INVALIDDATA;
-    }
-
-    skip_bits_long(&gb, i);
-
-    switch (m4ac->object_type) {
-    case AOT_AAC_MAIN:
-    case AOT_AAC_LC:
-    case AOT_AAC_LTP:
-    case AOT_ER_AAC_LC:
-    case AOT_ER_AAC_LD:
-        if ((ret = decode_ga_specific_config(ac, avctx, &gb,
-                                            m4ac, m4ac->chan_config)) < 0)
-            return ret;
-        break;
-    case AOT_ER_AAC_ELD:
-        if ((ret = decode_eld_specific_config(ac, avctx, &gb,
-                                              m4ac, m4ac->chan_config)) < 0)
-            return ret;
-        break;
-    default:
-        avpriv_report_missing_feature(avctx,
-                                      "Audio object type %s%d",
-                                      m4ac->sbr == 1 ? "SBR+" : "",
-                                      m4ac->object_type);
-        return AVERROR(ENOSYS);
-    }
-
-    av_dlog(avctx,
-            "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
-            m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
-            m4ac->sample_rate, m4ac->sbr,
-            m4ac->ps);
-
-    return get_bits_count(&gb);
-}
-
-/**
- * linear congruential pseudorandom number generator
- *
- * @param   previous_val    pointer to the current state of the generator
- *
- * @return  Returns a 32-bit pseudorandom integer
- */
-static av_always_inline int lcg_random(int previous_val)
-{
-    union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 };
-    return v.s;
-}
-
-static av_always_inline void reset_predict_state(PredictorState *ps)
-{
-    ps->r0   = 0.0f;
-    ps->r1   = 0.0f;
-    ps->cor0 = 0.0f;
-    ps->cor1 = 0.0f;
-    ps->var0 = 1.0f;
-    ps->var1 = 1.0f;
-}
-
-static void reset_all_predictors(PredictorState *ps)
-{
-    int i;
-    for (i = 0; i < MAX_PREDICTORS; i++)
-        reset_predict_state(&ps[i]);
-}
-
-static int sample_rate_idx (int rate)
-{
-         if (92017 <= rate) return 0;
-    else if (75132 <= rate) return 1;
-    else if (55426 <= rate) return 2;
-    else if (46009 <= rate) return 3;
-    else if (37566 <= rate) return 4;
-    else if (27713 <= rate) return 5;
-    else if (23004 <= rate) return 6;
-    else if (18783 <= rate) return 7;
-    else if (13856 <= rate) return 8;
-    else if (11502 <= rate) return 9;
-    else if (9391  <= rate) return 10;
-    else                    return 11;
-}
-
-static void reset_predictor_group(PredictorState *ps, int group_num)
-{
-    int i;
-    for (i = group_num - 1; i < MAX_PREDICTORS; i += 30)
-        reset_predict_state(&ps[i]);
-}
-
-#define AAC_INIT_VLC_STATIC(num, size)                                     \
-    INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num],     \
-         ff_aac_spectral_bits[num], sizeof(ff_aac_spectral_bits[num][0]),  \
-                                    sizeof(ff_aac_spectral_bits[num][0]),  \
-        ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), \
-                                    sizeof(ff_aac_spectral_codes[num][0]), \
-        size);
-
-static av_cold int aac_decode_init(AVCodecContext *avctx)
-{
-    AACContext *ac = avctx->priv_data;
-    int ret;
-
-    ac->avctx = avctx;
-    ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    if (avctx->extradata_size > 0) {
-        if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
-                                                avctx->extradata,
-                                                avctx->extradata_size * 8,
-                                                1)) < 0)
-            return ret;
-    } else {
-        int sr, i;
-        uint8_t layout_map[MAX_ELEM_ID*4][3];
-        int layout_map_tags;
-
-        sr = sample_rate_idx(avctx->sample_rate);
-        ac->oc[1].m4ac.sampling_index = sr;
-        ac->oc[1].m4ac.channels = avctx->channels;
-        ac->oc[1].m4ac.sbr = -1;
-        ac->oc[1].m4ac.ps = -1;
-
-        for (i = 0; i < FF_ARRAY_ELEMS(ff_mpeg4audio_channels); i++)
-            if (ff_mpeg4audio_channels[i] == avctx->channels)
-                break;
-        if (i == FF_ARRAY_ELEMS(ff_mpeg4audio_channels)) {
-            i = 0;
-        }
-        ac->oc[1].m4ac.chan_config = i;
-
-        if (ac->oc[1].m4ac.chan_config) {
-            int ret = set_default_channel_config(avctx, layout_map,
-                &layout_map_tags, ac->oc[1].m4ac.chan_config);
-            if (!ret)
-                output_configure(ac, layout_map, layout_map_tags,
-                                 OC_GLOBAL_HDR, 0);
-            else if (avctx->err_recognition & AV_EF_EXPLODE)
-                return AVERROR_INVALIDDATA;
-        }
-    }
-
-    AAC_INIT_VLC_STATIC( 0, 304);
-    AAC_INIT_VLC_STATIC( 1, 270);
-    AAC_INIT_VLC_STATIC( 2, 550);
-    AAC_INIT_VLC_STATIC( 3, 300);
-    AAC_INIT_VLC_STATIC( 4, 328);
-    AAC_INIT_VLC_STATIC( 5, 294);
-    AAC_INIT_VLC_STATIC( 6, 306);
-    AAC_INIT_VLC_STATIC( 7, 268);
-    AAC_INIT_VLC_STATIC( 8, 510);
-    AAC_INIT_VLC_STATIC( 9, 366);
-    AAC_INIT_VLC_STATIC(10, 462);
-
-    ff_aac_sbr_init();
-
-    ff_fmt_convert_init(&ac->fmt_conv, avctx);
-    avpriv_float_dsp_init(&ac->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    ac->random_state = 0x1f2e3d4c;
-
-    ff_aac_tableinit();
-
-    INIT_VLC_STATIC(&vlc_scalefactors, 7,
-                    FF_ARRAY_ELEMS(ff_aac_scalefactor_code),
-                    ff_aac_scalefactor_bits,
-                    sizeof(ff_aac_scalefactor_bits[0]),
-                    sizeof(ff_aac_scalefactor_bits[0]),
-                    ff_aac_scalefactor_code,
-                    sizeof(ff_aac_scalefactor_code[0]),
-                    sizeof(ff_aac_scalefactor_code[0]),
-                    352);
-
-    ff_mdct_init(&ac->mdct,       11, 1, 1.0 / (32768.0 * 1024.0));
-    ff_mdct_init(&ac->mdct_ld,    10, 1, 1.0 / (32768.0 * 512.0));
-    ff_mdct_init(&ac->mdct_small,  8, 1, 1.0 / (32768.0 * 128.0));
-    ff_mdct_init(&ac->mdct_ltp,   11, 0, -2.0 * 32768.0);
-    // window initialization
-    ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
-    ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
-    ff_init_ff_sine_windows(10);
-    ff_init_ff_sine_windows( 9);
-    ff_init_ff_sine_windows( 7);
-
-    cbrt_tableinit();
-
-    return 0;
-}
-
-/**
- * Skip data_stream_element; reference: table 4.10.
- */
-static int skip_data_stream_element(AACContext *ac, GetBitContext *gb)
-{
-    int byte_align = get_bits1(gb);
-    int count = get_bits(gb, 8);
-    if (count == 255)
-        count += get_bits(gb, 8);
-    if (byte_align)
-        align_get_bits(gb);
-
-    if (get_bits_left(gb) < 8 * count) {
-        av_log(ac->avctx, AV_LOG_ERROR, overread_err);
-        return AVERROR_INVALIDDATA;
-    }
-    skip_bits_long(gb, 8 * count);
-    return 0;
-}
-
-static int decode_prediction(AACContext *ac, IndividualChannelStream *ics,
-                             GetBitContext *gb)
-{
-    int sfb;
-    if (get_bits1(gb)) {
-        ics->predictor_reset_group = get_bits(gb, 5);
-        if (ics->predictor_reset_group == 0 ||
-            ics->predictor_reset_group > 30) {
-            av_log(ac->avctx, AV_LOG_ERROR,
-                   "Invalid Predictor Reset Group.\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    for (sfb = 0; sfb < FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index]); sfb++) {
-        ics->prediction_used[sfb] = get_bits1(gb);
-    }
-    return 0;
-}
-
-/**
- * Decode Long Term Prediction data; reference: table 4.xx.
- */
-static void decode_ltp(LongTermPrediction *ltp,
-                       GetBitContext *gb, uint8_t max_sfb)
-{
-    int sfb;
-
-    ltp->lag  = get_bits(gb, 11);
-    ltp->coef = ltp_coef[get_bits(gb, 3)];
-    for (sfb = 0; sfb < FFMIN(max_sfb, MAX_LTP_LONG_SFB); sfb++)
-        ltp->used[sfb] = get_bits1(gb);
-}
-
-/**
- * Decode Individual Channel Stream info; reference: table 4.6.
- */
-static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
-                           GetBitContext *gb)
-{
-    int aot = ac->oc[1].m4ac.object_type;
-    if (aot != AOT_ER_AAC_ELD) {
-        if (get_bits1(gb)) {
-            av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        ics->window_sequence[1] = ics->window_sequence[0];
-        ics->window_sequence[0] = get_bits(gb, 2);
-        if (aot == AOT_ER_AAC_LD &&
-            ics->window_sequence[0] != ONLY_LONG_SEQUENCE) {
-            av_log(ac->avctx, AV_LOG_ERROR,
-                   "AAC LD is only defined for ONLY_LONG_SEQUENCE but "
-                   "window sequence %d found.\n", ics->window_sequence[0]);
-            ics->window_sequence[0] = ONLY_LONG_SEQUENCE;
-            return AVERROR_INVALIDDATA;
-        }
-        ics->use_kb_window[1]   = ics->use_kb_window[0];
-        ics->use_kb_window[0]   = get_bits1(gb);
-    }
-    ics->num_window_groups  = 1;
-    ics->group_len[0]       = 1;
-    if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
-        int i;
-        ics->max_sfb = get_bits(gb, 4);
-        for (i = 0; i < 7; i++) {
-            if (get_bits1(gb)) {
-                ics->group_len[ics->num_window_groups - 1]++;
-            } else {
-                ics->num_window_groups++;
-                ics->group_len[ics->num_window_groups - 1] = 1;
-            }
-        }
-        ics->num_windows       = 8;
-        ics->swb_offset        =    ff_swb_offset_128[ac->oc[1].m4ac.sampling_index];
-        ics->num_swb           =   ff_aac_num_swb_128[ac->oc[1].m4ac.sampling_index];
-        ics->tns_max_bands     = ff_tns_max_bands_128[ac->oc[1].m4ac.sampling_index];
-        ics->predictor_present = 0;
-    } else {
-        ics->max_sfb               = get_bits(gb, 6);
-        ics->num_windows           = 1;
-        if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD) {
-            ics->swb_offset        =     ff_swb_offset_512[ac->oc[1].m4ac.sampling_index];
-            ics->num_swb           =    ff_aac_num_swb_512[ac->oc[1].m4ac.sampling_index];
-            ics->tns_max_bands     =  ff_tns_max_bands_512[ac->oc[1].m4ac.sampling_index];
-            if (!ics->num_swb || !ics->swb_offset)
-                return AVERROR_BUG;
-        } else {
-            ics->swb_offset        =    ff_swb_offset_1024[ac->oc[1].m4ac.sampling_index];
-            ics->num_swb           =   ff_aac_num_swb_1024[ac->oc[1].m4ac.sampling_index];
-            ics->tns_max_bands     = ff_tns_max_bands_1024[ac->oc[1].m4ac.sampling_index];
-        }
-        if (aot != AOT_ER_AAC_ELD) {
-            ics->predictor_present     = get_bits1(gb);
-            ics->predictor_reset_group = 0;
-        }
-        if (ics->predictor_present) {
-            if (aot == AOT_AAC_MAIN) {
-                if (decode_prediction(ac, ics, gb)) {
-                    return AVERROR_INVALIDDATA;
-                }
-            } else if (aot == AOT_AAC_LC ||
-                       aot == AOT_ER_AAC_LC) {
-                av_log(ac->avctx, AV_LOG_ERROR,
-                       "Prediction is not allowed in AAC-LC.\n");
-                return AVERROR_INVALIDDATA;
-            } else {
-                if (aot == AOT_ER_AAC_LD) {
-                    av_log(ac->avctx, AV_LOG_ERROR,
-                           "LTP in ER AAC LD not yet implemented.\n");
-                    return AVERROR_PATCHWELCOME;
-                }
-                if ((ics->ltp.present = get_bits(gb, 1)))
-                    decode_ltp(&ics->ltp, gb, ics->max_sfb);
-            }
-        }
-    }
-
-    if (ics->max_sfb > ics->num_swb) {
-        av_log(ac->avctx, AV_LOG_ERROR,
-               "Number of scalefactor bands in group (%d) "
-               "exceeds limit (%d).\n",
-               ics->max_sfb, ics->num_swb);
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-/**
- * Decode band types (section_data payload); reference: table 4.46.
- *
- * @param   band_type           array of the used band type
- * @param   band_type_run_end   array of the last scalefactor band of a band type run
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int decode_band_types(AACContext *ac, enum BandType band_type[120],
-                             int band_type_run_end[120], GetBitContext *gb,
-                             IndividualChannelStream *ics)
-{
-    int g, idx = 0;
-    const int bits = (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5;
-    for (g = 0; g < ics->num_window_groups; g++) {
-        int k = 0;
-        while (k < ics->max_sfb) {
-            uint8_t sect_end = k;
-            int sect_len_incr;
-            int sect_band_type = get_bits(gb, 4);
-            if (sect_band_type == 12) {
-                av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
-                return AVERROR_INVALIDDATA;
-            }
-            do {
-                sect_len_incr = get_bits(gb, bits);
-                sect_end += sect_len_incr;
-                if (get_bits_left(gb) < 0) {
-                    av_log(ac->avctx, AV_LOG_ERROR, overread_err);
-                    return AVERROR_INVALIDDATA;
-                }
-                if (sect_end > ics->max_sfb) {
-                    av_log(ac->avctx, AV_LOG_ERROR,
-                           "Number of bands (%d) exceeds limit (%d).\n",
-                           sect_end, ics->max_sfb);
-                    return AVERROR_INVALIDDATA;
-                }
-            } while (sect_len_incr == (1 << bits) - 1);
-            for (; k < sect_end; k++) {
-                band_type        [idx]   = sect_band_type;
-                band_type_run_end[idx++] = sect_end;
-            }
-        }
-    }
-    return 0;
-}
-
-/**
- * Decode scalefactors; reference: table 4.47.
- *
- * @param   global_gain         first scalefactor value as scalefactors are differentially coded
- * @param   band_type           array of the used band type
- * @param   band_type_run_end   array of the last scalefactor band of a band type run
- * @param   sf                  array of scalefactors or intensity stereo positions
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
-                               unsigned int global_gain,
-                               IndividualChannelStream *ics,
-                               enum BandType band_type[120],
-                               int band_type_run_end[120])
-{
-    int g, i, idx = 0;
-    int offset[3] = { global_gain, global_gain - 90, 0 };
-    int clipped_offset;
-    int noise_flag = 1;
-    for (g = 0; g < ics->num_window_groups; g++) {
-        for (i = 0; i < ics->max_sfb;) {
-            int run_end = band_type_run_end[idx];
-            if (band_type[idx] == ZERO_BT) {
-                for (; i < run_end; i++, idx++)
-                    sf[idx] = 0.0;
-            } else if ((band_type[idx] == INTENSITY_BT) ||
-                       (band_type[idx] == INTENSITY_BT2)) {
-                for (; i < run_end; i++, idx++) {
-                    offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
-                    clipped_offset = av_clip(offset[2], -155, 100);
-                    if (offset[2] != clipped_offset) {
-                        avpriv_request_sample(ac->avctx,
-                                              "If you heard an audible artifact, there may be a bug in the decoder. "
-                                              "Clipped intensity stereo position (%d -> %d)",
-                                              offset[2], clipped_offset);
-                    }
-                    sf[idx] = ff_aac_pow2sf_tab[-clipped_offset + POW_SF2_ZERO];
-                }
-            } else if (band_type[idx] == NOISE_BT) {
-                for (; i < run_end; i++, idx++) {
-                    if (noise_flag-- > 0)
-                        offset[1] += get_bits(gb, 9) - 256;
-                    else
-                        offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
-                    clipped_offset = av_clip(offset[1], -100, 155);
-                    if (offset[1] != clipped_offset) {
-                        avpriv_request_sample(ac->avctx,
-                                              "If you heard an audible artifact, there may be a bug in the decoder. "
-                                              "Clipped noise gain (%d -> %d)",
-                                              offset[1], clipped_offset);
-                    }
-                    sf[idx] = -ff_aac_pow2sf_tab[clipped_offset + POW_SF2_ZERO];
-                }
-            } else {
-                for (; i < run_end; i++, idx++) {
-                    offset[0] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
-                    if (offset[0] > 255U) {
-                        av_log(ac->avctx, AV_LOG_ERROR,
-                               "Scalefactor (%d) out of range.\n", offset[0]);
-                        return AVERROR_INVALIDDATA;
-                    }
-                    sf[idx] = -ff_aac_pow2sf_tab[offset[0] - 100 + POW_SF2_ZERO];
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-/**
- * Decode pulse data; reference: table 4.7.
- */
-static int decode_pulses(Pulse *pulse, GetBitContext *gb,
-                         const uint16_t *swb_offset, int num_swb)
-{
-    int i, pulse_swb;
-    pulse->num_pulse = get_bits(gb, 2) + 1;
-    pulse_swb        = get_bits(gb, 6);
-    if (pulse_swb >= num_swb)
-        return -1;
-    pulse->pos[0]    = swb_offset[pulse_swb];
-    pulse->pos[0]   += get_bits(gb, 5);
-    if (pulse->pos[0] > 1023)
-        return -1;
-    pulse->amp[0]    = get_bits(gb, 4);
-    for (i = 1; i < pulse->num_pulse; i++) {
-        pulse->pos[i] = get_bits(gb, 5) + pulse->pos[i - 1];
-        if (pulse->pos[i] > 1023)
-            return -1;
-        pulse->amp[i] = get_bits(gb, 4);
-    }
-    return 0;
-}
-
-/**
- * Decode Temporal Noise Shaping data; reference: table 4.48.
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int decode_tns(AACContext *ac, TemporalNoiseShaping *tns,
-                      GetBitContext *gb, const IndividualChannelStream *ics)
-{
-    int w, filt, i, coef_len, coef_res, coef_compress;
-    const int is8 = ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE;
-    const int tns_max_order = is8 ? 7 : ac->oc[1].m4ac.object_type == AOT_AAC_MAIN ? 20 : 12;
-    for (w = 0; w < ics->num_windows; w++) {
-        if ((tns->n_filt[w] = get_bits(gb, 2 - is8))) {
-            coef_res = get_bits1(gb);
-
-            for (filt = 0; filt < tns->n_filt[w]; filt++) {
-                int tmp2_idx;
-                tns->length[w][filt] = get_bits(gb, 6 - 2 * is8);
-
-                if ((tns->order[w][filt] = get_bits(gb, 5 - 2 * is8)) > tns_max_order) {
-                    av_log(ac->avctx, AV_LOG_ERROR,
-                           "TNS filter order %d is greater than maximum %d.\n",
-                           tns->order[w][filt], tns_max_order);
-                    tns->order[w][filt] = 0;
-                    return AVERROR_INVALIDDATA;
-                }
-                if (tns->order[w][filt]) {
-                    tns->direction[w][filt] = get_bits1(gb);
-                    coef_compress = get_bits1(gb);
-                    coef_len = coef_res + 3 - coef_compress;
-                    tmp2_idx = 2 * coef_compress + coef_res;
-
-                    for (i = 0; i < tns->order[w][filt]; i++)
-                        tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)];
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-/**
- * Decode Mid/Side data; reference: table 4.54.
- *
- * @param   ms_present  Indicates mid/side stereo presence. [0] mask is all 0s;
- *                      [1] mask is decoded from bitstream; [2] mask is all 1s;
- *                      [3] reserved for scalable AAC
- */
-static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb,
-                                   int ms_present)
-{
-    int idx;
-    if (ms_present == 1) {
-        for (idx = 0;
-             idx < cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb;
-             idx++)
-            cpe->ms_mask[idx] = get_bits1(gb);
-    } else if (ms_present == 2) {
-        memset(cpe->ms_mask, 1, cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb * sizeof(cpe->ms_mask[0]));
-    }
-}
-
-#ifndef VMUL2
-static inline float *VMUL2(float *dst, const float *v, unsigned idx,
-                           const float *scale)
-{
-    float s = *scale;
-    *dst++ = v[idx    & 15] * s;
-    *dst++ = v[idx>>4 & 15] * s;
-    return dst;
-}
-#endif
-
-#ifndef VMUL4
-static inline float *VMUL4(float *dst, const float *v, unsigned idx,
-                           const float *scale)
-{
-    float s = *scale;
-    *dst++ = v[idx    & 3] * s;
-    *dst++ = v[idx>>2 & 3] * s;
-    *dst++ = v[idx>>4 & 3] * s;
-    *dst++ = v[idx>>6 & 3] * s;
-    return dst;
-}
-#endif
-
-#ifndef VMUL2S
-static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
-                            unsigned sign, const float *scale)
-{
-    union av_intfloat32 s0, s1;
-
-    s0.f = s1.f = *scale;
-    s0.i ^= sign >> 1 << 31;
-    s1.i ^= sign      << 31;
-
-    *dst++ = v[idx    & 15] * s0.f;
-    *dst++ = v[idx>>4 & 15] * s1.f;
-
-    return dst;
-}
-#endif
-
-#ifndef VMUL4S
-static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
-                            unsigned sign, const float *scale)
-{
-    unsigned nz = idx >> 12;
-    union av_intfloat32 s = { .f = *scale };
-    union av_intfloat32 t;
-
-    t.i = s.i ^ (sign & 1U<<31);
-    *dst++ = v[idx    & 3] * t.f;
-
-    sign <<= nz & 1; nz >>= 1;
-    t.i = s.i ^ (sign & 1U<<31);
-    *dst++ = v[idx>>2 & 3] * t.f;
-
-    sign <<= nz & 1; nz >>= 1;
-    t.i = s.i ^ (sign & 1U<<31);
-    *dst++ = v[idx>>4 & 3] * t.f;
-
-    sign <<= nz & 1;
-    t.i = s.i ^ (sign & 1U<<31);
-    *dst++ = v[idx>>6 & 3] * t.f;
-
-    return dst;
-}
-#endif
-
-/**
- * Decode spectral data; reference: table 4.50.
- * Dequantize and scale spectral data; reference: 4.6.3.3.
- *
- * @param   coef            array of dequantized, scaled spectral data
- * @param   sf              array of scalefactors or intensity stereo positions
- * @param   pulse_present   set if pulses are present
- * @param   pulse           pointer to pulse data struct
- * @param   band_type       array of the used band type
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
-                                       GetBitContext *gb, const float sf[120],
-                                       int pulse_present, const Pulse *pulse,
-                                       const IndividualChannelStream *ics,
-                                       enum BandType band_type[120])
-{
-    int i, k, g, idx = 0;
-    const int c = 1024 / ics->num_windows;
-    const uint16_t *offsets = ics->swb_offset;
-    float *coef_base = coef;
-
-    for (g = 0; g < ics->num_windows; g++)
-        memset(coef + g * 128 + offsets[ics->max_sfb], 0,
-               sizeof(float) * (c - offsets[ics->max_sfb]));
-
-    for (g = 0; g < ics->num_window_groups; g++) {
-        unsigned g_len = ics->group_len[g];
-
-        for (i = 0; i < ics->max_sfb; i++, idx++) {
-            const unsigned cbt_m1 = band_type[idx] - 1;
-            float *cfo = coef + offsets[i];
-            int off_len = offsets[i + 1] - offsets[i];
-            int group;
-
-            if (cbt_m1 >= INTENSITY_BT2 - 1) {
-                for (group = 0; group < g_len; group++, cfo+=128) {
-                    memset(cfo, 0, off_len * sizeof(float));
-                }
-            } else if (cbt_m1 == NOISE_BT - 1) {
-                for (group = 0; group < g_len; group++, cfo+=128) {
-                    float scale;
-                    float band_energy;
-
-                    for (k = 0; k < off_len; k++) {
-                        ac->random_state  = lcg_random(ac->random_state);
-                        cfo[k] = ac->random_state;
-                    }
-
-                    band_energy = ac->fdsp.scalarproduct_float(cfo, cfo, off_len);
-                    scale = sf[idx] / sqrtf(band_energy);
-                    ac->fdsp.vector_fmul_scalar(cfo, cfo, scale, off_len);
-                }
-            } else {
-                const float *vq = ff_aac_codebook_vector_vals[cbt_m1];
-                const uint16_t *cb_vector_idx = ff_aac_codebook_vector_idx[cbt_m1];
-                VLC_TYPE (*vlc_tab)[2] = vlc_spectral[cbt_m1].table;
-                OPEN_READER(re, gb);
-
-                switch (cbt_m1 >> 1) {
-                case 0:
-                    for (group = 0; group < g_len; group++, cfo+=128) {
-                        float *cf = cfo;
-                        int len = off_len;
-
-                        do {
-                            int code;
-                            unsigned cb_idx;
-
-                            UPDATE_CACHE(re, gb);
-                            GET_VLC(code, re, gb, vlc_tab, 8, 2);
-                            cb_idx = cb_vector_idx[code];
-                            cf = VMUL4(cf, vq, cb_idx, sf + idx);
-                        } while (len -= 4);
-                    }
-                    break;
-
-                case 1:
-                    for (group = 0; group < g_len; group++, cfo+=128) {
-                        float *cf = cfo;
-                        int len = off_len;
-
-                        do {
-                            int code;
-                            unsigned nnz;
-                            unsigned cb_idx;
-                            uint32_t bits;
-
-                            UPDATE_CACHE(re, gb);
-                            GET_VLC(code, re, gb, vlc_tab, 8, 2);
-                            cb_idx = cb_vector_idx[code];
-                            nnz = cb_idx >> 8 & 15;
-                            bits = nnz ? GET_CACHE(re, gb) : 0;
-                            LAST_SKIP_BITS(re, gb, nnz);
-                            cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
-                        } while (len -= 4);
-                    }
-                    break;
-
-                case 2:
-                    for (group = 0; group < g_len; group++, cfo+=128) {
-                        float *cf = cfo;
-                        int len = off_len;
-
-                        do {
-                            int code;
-                            unsigned cb_idx;
-
-                            UPDATE_CACHE(re, gb);
-                            GET_VLC(code, re, gb, vlc_tab, 8, 2);
-                            cb_idx = cb_vector_idx[code];
-                            cf = VMUL2(cf, vq, cb_idx, sf + idx);
-                        } while (len -= 2);
-                    }
-                    break;
-
-                case 3:
-                case 4:
-                    for (group = 0; group < g_len; group++, cfo+=128) {
-                        float *cf = cfo;
-                        int len = off_len;
-
-                        do {
-                            int code;
-                            unsigned nnz;
-                            unsigned cb_idx;
-                            unsigned sign;
-
-                            UPDATE_CACHE(re, gb);
-                            GET_VLC(code, re, gb, vlc_tab, 8, 2);
-                            cb_idx = cb_vector_idx[code];
-                            nnz = cb_idx >> 8 & 15;
-                            sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
-                            LAST_SKIP_BITS(re, gb, nnz);
-                            cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
-                        } while (len -= 2);
-                    }
-                    break;
-
-                default:
-                    for (group = 0; group < g_len; group++, cfo+=128) {
-                        float *cf = cfo;
-                        uint32_t *icf = (uint32_t *) cf;
-                        int len = off_len;
-
-                        do {
-                            int code;
-                            unsigned nzt, nnz;
-                            unsigned cb_idx;
-                            uint32_t bits;
-                            int j;
-
-                            UPDATE_CACHE(re, gb);
-                            GET_VLC(code, re, gb, vlc_tab, 8, 2);
-
-                            if (!code) {
-                                *icf++ = 0;
-                                *icf++ = 0;
-                                continue;
-                            }
-
-                            cb_idx = cb_vector_idx[code];
-                            nnz = cb_idx >> 12;
-                            nzt = cb_idx >> 8;
-                            bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
-                            LAST_SKIP_BITS(re, gb, nnz);
-
-                            for (j = 0; j < 2; j++) {
-                                if (nzt & 1<<j) {
-                                    uint32_t b;
-                                    int n;
-                                    /* The total length of escape_sequence must be < 22 bits according
-                                       to the specification (i.e. max is 111111110xxxxxxxxxxxx). */
-                                    UPDATE_CACHE(re, gb);
-                                    b = GET_CACHE(re, gb);
-                                    b = 31 - av_log2(~b);
-
-                                    if (b > 8) {
-                                        av_log(ac->avctx, AV_LOG_ERROR, "error in spectral data, ESC overflow\n");
-                                        return AVERROR_INVALIDDATA;
-                                    }
-
-                                    SKIP_BITS(re, gb, b + 1);
-                                    b += 4;
-                                    n = (1 << b) + SHOW_UBITS(re, gb, b);
-                                    LAST_SKIP_BITS(re, gb, b);
-                                    *icf++ = cbrt_tab[n] | (bits & 1U<<31);
-                                    bits <<= 1;
-                                } else {
-                                    unsigned v = ((const uint32_t*)vq)[cb_idx & 15];
-                                    *icf++ = (bits & 1U<<31) | v;
-                                    bits <<= !!v;
-                                }
-                                cb_idx >>= 4;
-                            }
-                        } while (len -= 2);
-
-                        ac->fdsp.vector_fmul_scalar(cfo, cfo, sf[idx], off_len);
-                    }
-                }
-
-                CLOSE_READER(re, gb);
-            }
-        }
-        coef += g_len << 7;
-    }
-
-    if (pulse_present) {
-        idx = 0;
-        for (i = 0; i < pulse->num_pulse; i++) {
-            float co = coef_base[ pulse->pos[i] ];
-            while (offsets[idx + 1] <= pulse->pos[i])
-                idx++;
-            if (band_type[idx] != NOISE_BT && sf[idx]) {
-                float ico = -pulse->amp[i];
-                if (co) {
-                    co /= sf[idx];
-                    ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
-                }
-                coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico * sf[idx];
-            }
-        }
-    }
-    return 0;
-}
-
-static av_always_inline float flt16_round(float pf)
-{
-    union av_intfloat32 tmp;
-    tmp.f = pf;
-    tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
-    return tmp.f;
-}
-
-static av_always_inline float flt16_even(float pf)
-{
-    union av_intfloat32 tmp;
-    tmp.f = pf;
-    tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
-    return tmp.f;
-}
-
-static av_always_inline float flt16_trunc(float pf)
-{
-    union av_intfloat32 pun;
-    pun.f = pf;
-    pun.i &= 0xFFFF0000U;
-    return pun.f;
-}
-
-static av_always_inline void predict(PredictorState *ps, float *coef,
-                                     int output_enable)
-{
-    const float a     = 0.953125; // 61.0 / 64
-    const float alpha = 0.90625;  // 29.0 / 32
-    float e0, e1;
-    float pv;
-    float k1, k2;
-    float   r0 = ps->r0,     r1 = ps->r1;
-    float cor0 = ps->cor0, cor1 = ps->cor1;
-    float var0 = ps->var0, var1 = ps->var1;
-
-    k1 = var0 > 1 ? cor0 * flt16_even(a / var0) : 0;
-    k2 = var1 > 1 ? cor1 * flt16_even(a / var1) : 0;
-
-    pv = flt16_round(k1 * r0 + k2 * r1);
-    if (output_enable)
-        *coef += pv;
-
-    e0 = *coef;
-    e1 = e0 - k1 * r0;
-
-    ps->cor1 = flt16_trunc(alpha * cor1 + r1 * e1);
-    ps->var1 = flt16_trunc(alpha * var1 + 0.5f * (r1 * r1 + e1 * e1));
-    ps->cor0 = flt16_trunc(alpha * cor0 + r0 * e0);
-    ps->var0 = flt16_trunc(alpha * var0 + 0.5f * (r0 * r0 + e0 * e0));
-
-    ps->r1 = flt16_trunc(a * (r0 - k1 * e0));
-    ps->r0 = flt16_trunc(a * e0);
-}
-
-/**
- * Apply AAC-Main style frequency domain prediction.
- */
-static void apply_prediction(AACContext *ac, SingleChannelElement *sce)
-{
-    int sfb, k;
-
-    if (!sce->ics.predictor_initialized) {
-        reset_all_predictors(sce->predictor_state);
-        sce->ics.predictor_initialized = 1;
-    }
-
-    if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
-        for (sfb = 0;
-             sfb < ff_aac_pred_sfb_max[ac->oc[1].m4ac.sampling_index];
-             sfb++) {
-            for (k = sce->ics.swb_offset[sfb];
-                 k < sce->ics.swb_offset[sfb + 1];
-                 k++) {
-                predict(&sce->predictor_state[k], &sce->coeffs[k],
-                        sce->ics.predictor_present &&
-                        sce->ics.prediction_used[sfb]);
-            }
-        }
-        if (sce->ics.predictor_reset_group)
-            reset_predictor_group(sce->predictor_state,
-                                  sce->ics.predictor_reset_group);
-    } else
-        reset_all_predictors(sce->predictor_state);
-}
-
-/**
- * Decode an individual_channel_stream payload; reference: table 4.44.
- *
- * @param   common_window   Channels have independent [0], or shared [1], Individual Channel Stream information.
- * @param   scale_flag      scalable [1] or non-scalable [0] AAC (Unused until scalable AAC is implemented.)
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int decode_ics(AACContext *ac, SingleChannelElement *sce,
-                      GetBitContext *gb, int common_window, int scale_flag)
-{
-    Pulse pulse;
-    TemporalNoiseShaping    *tns = &sce->tns;
-    IndividualChannelStream *ics = &sce->ics;
-    float *out = sce->coeffs;
-    int global_gain, eld_syntax, er_syntax, pulse_present = 0;
-    int ret;
-
-    eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
-    er_syntax  = ac->oc[1].m4ac.object_type == AOT_ER_AAC_LC ||
-                 ac->oc[1].m4ac.object_type == AOT_ER_AAC_LTP ||
-                 ac->oc[1].m4ac.object_type == AOT_ER_AAC_LD ||
-                 ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
-
-    /* This assignment is to silence a GCC warning about the variable being used
-     * uninitialized when in fact it always is.
-     */
-    pulse.num_pulse = 0;
-
-    global_gain = get_bits(gb, 8);
-
-    if (!common_window && !scale_flag) {
-        if (decode_ics_info(ac, ics, gb) < 0)
-            return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = decode_band_types(ac, sce->band_type,
-                                 sce->band_type_run_end, gb, ics)) < 0)
-        return ret;
-    if ((ret = decode_scalefactors(ac, sce->sf, gb, global_gain, ics,
-                                  sce->band_type, sce->band_type_run_end)) < 0)
-        return ret;
-
-    pulse_present = 0;
-    if (!scale_flag) {
-        if (!eld_syntax && (pulse_present = get_bits1(gb))) {
-            if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
-                av_log(ac->avctx, AV_LOG_ERROR,
-                       "Pulse tool not allowed in eight short sequence.\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (decode_pulses(&pulse, gb, ics->swb_offset, ics->num_swb)) {
-                av_log(ac->avctx, AV_LOG_ERROR,
-                       "Pulse data corrupt or invalid.\n");
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        tns->present = get_bits1(gb);
-        if (tns->present && !er_syntax)
-            if (decode_tns(ac, tns, gb, ics) < 0)
-                return AVERROR_INVALIDDATA;
-        if (!eld_syntax && get_bits1(gb)) {
-            avpriv_request_sample(ac->avctx, "SSR");
-            return AVERROR_PATCHWELCOME;
-        }
-        // I see no textual basis in the spec for this occuring after SSR gain
-        // control, but this is what both reference and real implmentations do
-        if (tns->present && er_syntax)
-            if (decode_tns(ac, tns, gb, ics) < 0)
-                return AVERROR_INVALIDDATA;
-    }
-
-    if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
-                                    &pulse, ics, sce->band_type) < 0)
-        return AVERROR_INVALIDDATA;
-
-    if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN && !common_window)
-        apply_prediction(ac, sce);
-
-    return 0;
-}
-
-/**
- * Mid/Side stereo decoding; reference: 4.6.8.1.3.
- */
-static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
-{
-    const IndividualChannelStream *ics = &cpe->ch[0].ics;
-    float *ch0 = cpe->ch[0].coeffs;
-    float *ch1 = cpe->ch[1].coeffs;
-    int g, i, group, idx = 0;
-    const uint16_t *offsets = ics->swb_offset;
-    for (g = 0; g < ics->num_window_groups; g++) {
-        for (i = 0; i < ics->max_sfb; i++, idx++) {
-            if (cpe->ms_mask[idx] &&
-                cpe->ch[0].band_type[idx] < NOISE_BT &&
-                cpe->ch[1].band_type[idx] < NOISE_BT) {
-                for (group = 0; group < ics->group_len[g]; group++) {
-                    ac->fdsp.butterflies_float(ch0 + group * 128 + offsets[i],
-                                               ch1 + group * 128 + offsets[i],
-                                               offsets[i+1] - offsets[i]);
-                }
-            }
-        }
-        ch0 += ics->group_len[g] * 128;
-        ch1 += ics->group_len[g] * 128;
-    }
-}
-
-/**
- * intensity stereo decoding; reference: 4.6.8.2.3
- *
- * @param   ms_present  Indicates mid/side stereo presence. [0] mask is all 0s;
- *                      [1] mask is decoded from bitstream; [2] mask is all 1s;
- *                      [3] reserved for scalable AAC
- */
-static void apply_intensity_stereo(AACContext *ac,
-                                   ChannelElement *cpe, int ms_present)
-{
-    const IndividualChannelStream *ics = &cpe->ch[1].ics;
-    SingleChannelElement         *sce1 = &cpe->ch[1];
-    float *coef0 = cpe->ch[0].coeffs, *coef1 = cpe->ch[1].coeffs;
-    const uint16_t *offsets = ics->swb_offset;
-    int g, group, i, idx = 0;
-    int c;
-    float scale;
-    for (g = 0; g < ics->num_window_groups; g++) {
-        for (i = 0; i < ics->max_sfb;) {
-            if (sce1->band_type[idx] == INTENSITY_BT ||
-                sce1->band_type[idx] == INTENSITY_BT2) {
-                const int bt_run_end = sce1->band_type_run_end[idx];
-                for (; i < bt_run_end; i++, idx++) {
-                    c = -1 + 2 * (sce1->band_type[idx] - 14);
-                    if (ms_present)
-                        c *= 1 - 2 * cpe->ms_mask[idx];
-                    scale = c * sce1->sf[idx];
-                    for (group = 0; group < ics->group_len[g]; group++)
-                        ac->fdsp.vector_fmul_scalar(coef1 + group * 128 + offsets[i],
-                                                    coef0 + group * 128 + offsets[i],
-                                                    scale,
-                                                    offsets[i + 1] - offsets[i]);
-                }
-            } else {
-                int bt_run_end = sce1->band_type_run_end[idx];
-                idx += bt_run_end - i;
-                i    = bt_run_end;
-            }
-        }
-        coef0 += ics->group_len[g] * 128;
-        coef1 += ics->group_len[g] * 128;
-    }
-}
-
-/**
- * Decode a channel_pair_element; reference: table 4.4.
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe)
-{
-    int i, ret, common_window, ms_present = 0;
-    int eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD;
-
-    common_window = eld_syntax || get_bits1(gb);
-    if (common_window) {
-        if (decode_ics_info(ac, &cpe->ch[0].ics, gb))
-            return AVERROR_INVALIDDATA;
-        i = cpe->ch[1].ics.use_kb_window[0];
-        cpe->ch[1].ics = cpe->ch[0].ics;
-        cpe->ch[1].ics.use_kb_window[1] = i;
-        if (cpe->ch[1].ics.predictor_present &&
-            (ac->oc[1].m4ac.object_type != AOT_AAC_MAIN))
-            if ((cpe->ch[1].ics.ltp.present = get_bits(gb, 1)))
-                decode_ltp(&cpe->ch[1].ics.ltp, gb, cpe->ch[1].ics.max_sfb);
-        ms_present = get_bits(gb, 2);
-        if (ms_present == 3) {
-            av_log(ac->avctx, AV_LOG_ERROR, "ms_present = 3 is reserved.\n");
-            return AVERROR_INVALIDDATA;
-        } else if (ms_present)
-            decode_mid_side_stereo(cpe, gb, ms_present);
-    }
-    if ((ret = decode_ics(ac, &cpe->ch[0], gb, common_window, 0)))
-        return ret;
-    if ((ret = decode_ics(ac, &cpe->ch[1], gb, common_window, 0)))
-        return ret;
-
-    if (common_window) {
-        if (ms_present)
-            apply_mid_side_stereo(ac, cpe);
-        if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN) {
-            apply_prediction(ac, &cpe->ch[0]);
-            apply_prediction(ac, &cpe->ch[1]);
-        }
-    }
-
-    apply_intensity_stereo(ac, cpe, ms_present);
-    return 0;
-}
-
-static const float cce_scale[] = {
-    1.09050773266525765921, //2^(1/8)
-    1.18920711500272106672, //2^(1/4)
-    M_SQRT2,
-    2,
-};
-
-/**
- * Decode coupling_channel_element; reference: table 4.8.
- *
- * @return  Returns error status. 0 - OK, !0 - error
- */
-static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
-{
-    int num_gain = 0;
-    int c, g, sfb, ret;
-    int sign;
-    float scale;
-    SingleChannelElement *sce = &che->ch[0];
-    ChannelCoupling     *coup = &che->coup;
-
-    coup->coupling_point = 2 * get_bits1(gb);
-    coup->num_coupled = get_bits(gb, 3);
-    for (c = 0; c <= coup->num_coupled; c++) {
-        num_gain++;
-        coup->type[c] = get_bits1(gb) ? TYPE_CPE : TYPE_SCE;
-        coup->id_select[c] = get_bits(gb, 4);
-        if (coup->type[c] == TYPE_CPE) {
-            coup->ch_select[c] = get_bits(gb, 2);
-            if (coup->ch_select[c] == 3)
-                num_gain++;
-        } else
-            coup->ch_select[c] = 2;
-    }
-    coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1);
-
-    sign  = get_bits(gb, 1);
-    scale = cce_scale[get_bits(gb, 2)];
-
-    if ((ret = decode_ics(ac, sce, gb, 0, 0)))
-        return ret;
-
-    for (c = 0; c < num_gain; c++) {
-        int idx  = 0;
-        int cge  = 1;
-        int gain = 0;
-        float gain_cache = 1.0;
-        if (c) {
-            cge = coup->coupling_point == AFTER_IMDCT ? 1 : get_bits1(gb);
-            gain = cge ? get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60: 0;
-            gain_cache = powf(scale, -gain);
-        }
-        if (coup->coupling_point == AFTER_IMDCT) {
-            coup->gain[c][0] = gain_cache;
-        } else {
-            for (g = 0; g < sce->ics.num_window_groups; g++) {
-                for (sfb = 0; sfb < sce->ics.max_sfb; sfb++, idx++) {
-                    if (sce->band_type[idx] != ZERO_BT) {
-                        if (!cge) {
-                            int t = get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
-                            if (t) {
-                                int s = 1;
-                                t = gain += t;
-                                if (sign) {
-                                    s  -= 2 * (t & 0x1);
-                                    t >>= 1;
-                                }
-                                gain_cache = powf(scale, -t) * s;
-                            }
-                        }
-                        coup->gain[c][idx] = gain_cache;
-                    }
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-/**
- * Parse whether channels are to be excluded from Dynamic Range Compression; reference: table 4.53.
- *
- * @return  Returns number of bytes consumed.
- */
-static int decode_drc_channel_exclusions(DynamicRangeControl *che_drc,
-                                         GetBitContext *gb)
-{
-    int i;
-    int num_excl_chan = 0;
-
-    do {
-        for (i = 0; i < 7; i++)
-            che_drc->exclude_mask[num_excl_chan++] = get_bits1(gb);
-    } while (num_excl_chan < MAX_CHANNELS - 7 && get_bits1(gb));
-
-    return num_excl_chan / 7;
-}
-
-/**
- * Decode dynamic range information; reference: table 4.52.
- *
- * @return  Returns number of bytes consumed.
- */
-static int decode_dynamic_range(DynamicRangeControl *che_drc,
-                                GetBitContext *gb)
-{
-    int n             = 1;
-    int drc_num_bands = 1;
-    int i;
-
-    /* pce_tag_present? */
-    if (get_bits1(gb)) {
-        che_drc->pce_instance_tag  = get_bits(gb, 4);
-        skip_bits(gb, 4); // tag_reserved_bits
-        n++;
-    }
-
-    /* excluded_chns_present? */
-    if (get_bits1(gb)) {
-        n += decode_drc_channel_exclusions(che_drc, gb);
-    }
-
-    /* drc_bands_present? */
-    if (get_bits1(gb)) {
-        che_drc->band_incr            = get_bits(gb, 4);
-        che_drc->interpolation_scheme = get_bits(gb, 4);
-        n++;
-        drc_num_bands += che_drc->band_incr;
-        for (i = 0; i < drc_num_bands; i++) {
-            che_drc->band_top[i] = get_bits(gb, 8);
-            n++;
-        }
-    }
-
-    /* prog_ref_level_present? */
-    if (get_bits1(gb)) {
-        che_drc->prog_ref_level = get_bits(gb, 7);
-        skip_bits1(gb); // prog_ref_level_reserved_bits
-        n++;
-    }
-
-    for (i = 0; i < drc_num_bands; i++) {
-        che_drc->dyn_rng_sgn[i] = get_bits1(gb);
-        che_drc->dyn_rng_ctl[i] = get_bits(gb, 7);
-        n++;
-    }
-
-    return n;
-}
-
-/**
- * Decode extension data (incomplete); reference: table 4.51.
- *
- * @param   cnt length of TYPE_FIL syntactic element in bytes
- *
- * @return Returns number of bytes consumed
- */
-static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
-                                    ChannelElement *che, enum RawDataBlockType elem_type)
-{
-    int crc_flag = 0;
-    int res = cnt;
-    switch (get_bits(gb, 4)) { // extension type
-    case EXT_SBR_DATA_CRC:
-        crc_flag++;
-    case EXT_SBR_DATA:
-        if (!che) {
-            av_log(ac->avctx, AV_LOG_ERROR, "SBR was found before the first channel element.\n");
-            return res;
-        } else if (!ac->oc[1].m4ac.sbr) {
-            av_log(ac->avctx, AV_LOG_ERROR, "SBR signaled to be not-present but was found in the bitstream.\n");
-            skip_bits_long(gb, 8 * cnt - 4);
-            return res;
-        } else if (ac->oc[1].m4ac.sbr == -1 && ac->oc[1].status == OC_LOCKED) {
-            av_log(ac->avctx, AV_LOG_ERROR, "Implicit SBR was found with a first occurrence after the first frame.\n");
-            skip_bits_long(gb, 8 * cnt - 4);
-            return res;
-        } else if (ac->oc[1].m4ac.ps == -1 && ac->oc[1].status < OC_LOCKED && ac->avctx->channels == 1) {
-            ac->oc[1].m4ac.sbr = 1;
-            ac->oc[1].m4ac.ps = 1;
-            ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
-            output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
-                             ac->oc[1].status, 1);
-        } else {
-            ac->oc[1].m4ac.sbr = 1;
-            ac->avctx->profile = FF_PROFILE_AAC_HE;
-        }
-        res = ff_decode_sbr_extension(ac, &che->sbr, gb, crc_flag, cnt, elem_type);
-        break;
-    case EXT_DYNAMIC_RANGE:
-        res = decode_dynamic_range(&ac->che_drc, gb);
-        break;
-    case EXT_FILL:
-    case EXT_FILL_DATA:
-    case EXT_DATA_ELEMENT:
-    default:
-        skip_bits_long(gb, 8 * cnt - 4);
-        break;
-    };
-    return res;
-}
-
-/**
- * Decode Temporal Noise Shaping filter coefficients and apply all-pole filters; reference: 4.6.9.3.
- *
- * @param   decode  1 if tool is used normally, 0 if tool is used in LTP.
- * @param   coef    spectral coefficients
- */
-static void apply_tns(float coef[1024], TemporalNoiseShaping *tns,
-                      IndividualChannelStream *ics, int decode)
-{
-    const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb);
-    int w, filt, m, i;
-    int bottom, top, order, start, end, size, inc;
-    float lpc[TNS_MAX_ORDER];
-    float tmp[TNS_MAX_ORDER + 1];
-
-    for (w = 0; w < ics->num_windows; w++) {
-        bottom = ics->num_swb;
-        for (filt = 0; filt < tns->n_filt[w]; filt++) {
-            top    = bottom;
-            bottom = FFMAX(0, top - tns->length[w][filt]);
-            order  = tns->order[w][filt];
-            if (order == 0)
-                continue;
-
-            // tns_decode_coef
-            compute_lpc_coefs(tns->coef[w][filt], order, lpc, 0, 0, 0);
-
-            start = ics->swb_offset[FFMIN(bottom, mmm)];
-            end   = ics->swb_offset[FFMIN(   top, mmm)];
-            if ((size = end - start) <= 0)
-                continue;
-            if (tns->direction[w][filt]) {
-                inc = -1;
-                start = end - 1;
-            } else {
-                inc = 1;
-            }
-            start += w * 128;
-
-            if (decode) {
-                // ar filter
-                for (m = 0; m < size; m++, start += inc)
-                    for (i = 1; i <= FFMIN(m, order); i++)
-                        coef[start] -= coef[start - i * inc] * lpc[i - 1];
-            } else {
-                // ma filter
-                for (m = 0; m < size; m++, start += inc) {
-                    tmp[0] = coef[start];
-                    for (i = 1; i <= FFMIN(m, order); i++)
-                        coef[start] += tmp[i] * lpc[i - 1];
-                    for (i = order; i > 0; i--)
-                        tmp[i] = tmp[i - 1];
-                }
-            }
-        }
-    }
-}
-
-/**
- *  Apply windowing and MDCT to obtain the spectral
- *  coefficient from the predicted sample by LTP.
- */
-static void windowing_and_mdct_ltp(AACContext *ac, float *out,
-                                   float *in, IndividualChannelStream *ics)
-{
-    const float *lwindow      = ics->use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
-    const float *swindow      = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
-    const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
-    const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
-
-    if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) {
-        ac->fdsp.vector_fmul(in, in, lwindow_prev, 1024);
-    } else {
-        memset(in, 0, 448 * sizeof(float));
-        ac->fdsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
-    }
-    if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
-        ac->fdsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
-    } else {
-        ac->fdsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
-        memset(in + 1024 + 576, 0, 448 * sizeof(float));
-    }
-    ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in);
-}
-
-/**
- * Apply the long term prediction
- */
-static void apply_ltp(AACContext *ac, SingleChannelElement *sce)
-{
-    const LongTermPrediction *ltp = &sce->ics.ltp;
-    const uint16_t *offsets = sce->ics.swb_offset;
-    int i, sfb;
-
-    if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
-        float *predTime = sce->ret;
-        float *predFreq = ac->buf_mdct;
-        int16_t num_samples = 2048;
-
-        if (ltp->lag < 1024)
-            num_samples = ltp->lag + 1024;
-        for (i = 0; i < num_samples; i++)
-            predTime[i] = sce->ltp_state[i + 2048 - ltp->lag] * ltp->coef;
-        memset(&predTime[i], 0, (2048 - i) * sizeof(float));
-
-        windowing_and_mdct_ltp(ac, predFreq, predTime, &sce->ics);
-
-        if (sce->tns.present)
-            apply_tns(predFreq, &sce->tns, &sce->ics, 0);
-
-        for (sfb = 0; sfb < FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++)
-            if (ltp->used[sfb])
-                for (i = offsets[sfb]; i < offsets[sfb + 1]; i++)
-                    sce->coeffs[i] += predFreq[i];
-    }
-}
-
-/**
- * Update the LTP buffer for next frame
- */
-static void update_ltp(AACContext *ac, SingleChannelElement *sce)
-{
-    IndividualChannelStream *ics = &sce->ics;
-    float *saved     = sce->saved;
-    float *saved_ltp = sce->coeffs;
-    const float *lwindow = ics->use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
-    const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
-    int i;
-
-    if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
-        memcpy(saved_ltp,       saved, 512 * sizeof(float));
-        memset(saved_ltp + 576, 0,     448 * sizeof(float));
-        ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960,     &swindow[64],      64);
-        for (i = 0; i < 64; i++)
-            saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
-    } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
-        memcpy(saved_ltp,       ac->buf_mdct + 512, 448 * sizeof(float));
-        memset(saved_ltp + 576, 0,                  448 * sizeof(float));
-        ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960,     &swindow[64],      64);
-        for (i = 0; i < 64; i++)
-            saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
-    } else { // LONG_STOP or ONLY_LONG
-        ac->fdsp.vector_fmul_reverse(saved_ltp,       ac->buf_mdct + 512,     &lwindow[512],     512);
-        for (i = 0; i < 512; i++)
-            saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * lwindow[511 - i];
-    }
-
-    memcpy(sce->ltp_state,      sce->ltp_state+1024, 1024 * sizeof(*sce->ltp_state));
-    memcpy(sce->ltp_state+1024, sce->ret,            1024 * sizeof(*sce->ltp_state));
-    memcpy(sce->ltp_state+2048, saved_ltp,           1024 * sizeof(*sce->ltp_state));
-}
-
-/**
- * Conduct IMDCT and windowing.
- */
-static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
-{
-    IndividualChannelStream *ics = &sce->ics;
-    float *in    = sce->coeffs;
-    float *out   = sce->ret;
-    float *saved = sce->saved;
-    const float *swindow      = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
-    const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
-    const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
-    float *buf  = ac->buf_mdct;
-    float *temp = ac->temp;
-    int i;
-
-    // imdct
-    if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
-        for (i = 0; i < 1024; i += 128)
-            ac->mdct_small.imdct_half(&ac->mdct_small, buf + i, in + i);
-    } else
-        ac->mdct.imdct_half(&ac->mdct, buf, in);
-
-    /* window overlapping
-     * NOTE: To simplify the overlapping code, all 'meaningless' short to long
-     * and long to short transitions are considered to be short to short
-     * transitions. This leaves just two cases (long to long and short to short)
-     * with a little special sauce for EIGHT_SHORT_SEQUENCE.
-     */
-    if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
-            (ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
-        ac->fdsp.vector_fmul_window(    out,               saved,            buf,         lwindow_prev, 512);
-    } else {
-        memcpy(                         out,               saved,            448 * sizeof(float));
-
-        if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
-            ac->fdsp.vector_fmul_window(out + 448 + 0*128, saved + 448,      buf + 0*128, swindow_prev, 64);
-            ac->fdsp.vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow,      64);
-            ac->fdsp.vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow,      64);
-            ac->fdsp.vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow,      64);
-            ac->fdsp.vector_fmul_window(temp,              buf + 3*128 + 64, buf + 4*128, swindow,      64);
-            memcpy(                     out + 448 + 4*128, temp, 64 * sizeof(float));
-        } else {
-            ac->fdsp.vector_fmul_window(out + 448,         saved + 448,      buf,         swindow_prev, 64);
-            memcpy(                     out + 576,         buf + 64,         448 * sizeof(float));
-        }
-    }
-
-    // buffer update
-    if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
-        memcpy(                     saved,       temp + 64,         64 * sizeof(float));
-        ac->fdsp.vector_fmul_window(saved + 64,  buf + 4*128 + 64, buf + 5*128, swindow, 64);
-        ac->fdsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
-        ac->fdsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
-        memcpy(                     saved + 448, buf + 7*128 + 64,  64 * sizeof(float));
-    } else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
-        memcpy(                     saved,       buf + 512,        448 * sizeof(float));
-        memcpy(                     saved + 448, buf + 7*128 + 64,  64 * sizeof(float));
-    } else { // LONG_STOP or ONLY_LONG
-        memcpy(                     saved,       buf + 512,        512 * sizeof(float));
-    }
-}
-
-static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
-{
-    IndividualChannelStream *ics = &sce->ics;
-    float *in    = sce->coeffs;
-    float *out   = sce->ret;
-    float *saved = sce->saved;
-    float *buf  = ac->buf_mdct;
-
-    // imdct
-    ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
-
-    // window overlapping
-    if (ics->use_kb_window[1]) {
-        // AAC LD uses a low overlap sine window instead of a KBD window
-        memcpy(out, saved, 192 * sizeof(float));
-        ac->fdsp.vector_fmul_window(out + 192, saved + 192, buf, ff_sine_128, 64);
-        memcpy(                     out + 320, buf + 64, 192 * sizeof(float));
-    } else {
-        ac->fdsp.vector_fmul_window(out, saved, buf, ff_sine_512, 256);
-    }
-
-    // buffer update
-    memcpy(saved, buf + 256, 256 * sizeof(float));
-}
-
-static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce)
-{
-    float *in    = sce->coeffs;
-    float *out   = sce->ret;
-    float *saved = sce->saved;
-    const float *const window = ff_aac_eld_window;
-    float *buf  = ac->buf_mdct;
-    int i;
-    const int n  = 512;
-    const int n2 = n >> 1;
-    const int n4 = n >> 2;
-
-    // Inverse transform, mapped to the conventional IMDCT by
-    // Chivukula, R.K.; Reznik, Y.A.; Devarajan, V.,
-    // "Efficient algorithms for MPEG-4 AAC-ELD, AAC-LD and AAC-LC filterbanks,"
-    // Audio, Language and Image Processing, 2008. ICALIP 2008. International Conference on
-    // URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4590245&isnumber=4589950
-    for (i = 0; i < n2; i+=2) {
-        float temp;
-        temp =  in[i    ]; in[i    ] = -in[n - 1 - i]; in[n - 1 - i] = temp;
-        temp = -in[i + 1]; in[i + 1] =  in[n - 2 - i]; in[n - 2 - i] = temp;
-    }
-    ac->mdct.imdct_half(&ac->mdct_ld, buf, in);
-    for (i = 0; i < n; i+=2) {
-        buf[i] = -buf[i];
-    }
-    // Like with the regular IMDCT at this point we still have the middle half
-    // of a transform but with even symmetry on the left and odd symmetry on
-    // the right
-
-    // window overlapping
-    // The spec says to use samples [0..511] but the reference decoder uses
-    // samples [128..639].
-    for (i = n4; i < n2; i ++) {
-        out[i - n4] =    buf[n2 - 1 - i]       * window[i       - n4] +
-                       saved[      i + n2]     * window[i +   n - n4] +
-                      -saved[  n + n2 - 1 - i] * window[i + 2*n - n4] +
-                      -saved[2*n + n2 + i]     * window[i + 3*n - n4];
-    }
-    for (i = 0; i < n2; i ++) {
-        out[n4 + i] =    buf[i]               * window[i + n2       - n4] +
-                      -saved[      n - 1 - i] * window[i + n2 +   n - n4] +
-                      -saved[  n + i]         * window[i + n2 + 2*n - n4] +
-                       saved[2*n + n - 1 - i] * window[i + n2 + 3*n - n4];
-    }
-    for (i = 0; i < n4; i ++) {
-        out[n2 + n4 + i] =    buf[      i + n2]     * window[i +   n - n4] +
-                           -saved[      n2 - 1 - i] * window[i + 2*n - n4] +
-                           -saved[  n + n2 + i]     * window[i + 3*n - n4];
-    }
-
-    // buffer update
-    memmove(saved + n, saved, 2 * n * sizeof(float));
-    memcpy( saved,       buf,     n * sizeof(float));
-}
-
-/**
- * Apply dependent channel coupling (applied before IMDCT).
- *
- * @param   index   index into coupling gain array
- */
-static void apply_dependent_coupling(AACContext *ac,
-                                     SingleChannelElement *target,
-                                     ChannelElement *cce, int index)
-{
-    IndividualChannelStream *ics = &cce->ch[0].ics;
-    const uint16_t *offsets = ics->swb_offset;
-    float *dest = target->coeffs;
-    const float *src = cce->ch[0].coeffs;
-    int g, i, group, k, idx = 0;
-    if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
-        av_log(ac->avctx, AV_LOG_ERROR,
-               "Dependent coupling is not supported together with LTP\n");
-        return;
-    }
-    for (g = 0; g < ics->num_window_groups; g++) {
-        for (i = 0; i < ics->max_sfb; i++, idx++) {
-            if (cce->ch[0].band_type[idx] != ZERO_BT) {
-                const float gain = cce->coup.gain[index][idx];
-                for (group = 0; group < ics->group_len[g]; group++) {
-                    for (k = offsets[i]; k < offsets[i + 1]; k++) {
-                        // XXX dsputil-ize
-                        dest[group * 128 + k] += gain * src[group * 128 + k];
-                    }
-                }
-            }
-        }
-        dest += ics->group_len[g] * 128;
-        src  += ics->group_len[g] * 128;
-    }
-}
-
-/**
- * Apply independent channel coupling (applied after IMDCT).
- *
- * @param   index   index into coupling gain array
- */
-static void apply_independent_coupling(AACContext *ac,
-                                       SingleChannelElement *target,
-                                       ChannelElement *cce, int index)
-{
-    int i;
-    const float gain = cce->coup.gain[index][0];
-    const float *src = cce->ch[0].ret;
-    float *dest = target->ret;
-    const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);
-
-    for (i = 0; i < len; i++)
-        dest[i] += gain * src[i];
-}
-
-/**
- * channel coupling transformation interface
- *
- * @param   apply_coupling_method   pointer to (in)dependent coupling function
- */
-static void apply_channel_coupling(AACContext *ac, ChannelElement *cc,
-                                   enum RawDataBlockType type, int elem_id,
-                                   enum CouplingPoint coupling_point,
-                                   void (*apply_coupling_method)(AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index))
-{
-    int i, c;
-
-    for (i = 0; i < MAX_ELEM_ID; i++) {
-        ChannelElement *cce = ac->che[TYPE_CCE][i];
-        int index = 0;
-
-        if (cce && cce->coup.coupling_point == coupling_point) {
-            ChannelCoupling *coup = &cce->coup;
-
-            for (c = 0; c <= coup->num_coupled; c++) {
-                if (coup->type[c] == type && coup->id_select[c] == elem_id) {
-                    if (coup->ch_select[c] != 1) {
-                        apply_coupling_method(ac, &cc->ch[0], cce, index);
-                        if (coup->ch_select[c] != 0)
-                            index++;
-                    }
-                    if (coup->ch_select[c] != 2)
-                        apply_coupling_method(ac, &cc->ch[1], cce, index++);
-                } else
-                    index += 1 + (coup->ch_select[c] == 3);
-            }
-        }
-    }
-}
-
-/**
- * Convert spectral data to float samples, applying all supported tools as appropriate.
- */
-static void spectral_to_sample(AACContext *ac)
-{
-    int i, type;
-    void (*imdct_and_window)(AACContext *ac, SingleChannelElement *sce);
-    switch (ac->oc[1].m4ac.object_type) {
-    case AOT_ER_AAC_LD:
-        imdct_and_window = imdct_and_windowing_ld;
-        break;
-    case AOT_ER_AAC_ELD:
-        imdct_and_window = imdct_and_windowing_eld;
-        break;
-    default:
-        imdct_and_window = imdct_and_windowing;
-    }
-    for (type = 3; type >= 0; type--) {
-        for (i = 0; i < MAX_ELEM_ID; i++) {
-            ChannelElement *che = ac->che[type][i];
-            if (che) {
-                if (type <= TYPE_CPE)
-                    apply_channel_coupling(ac, che, type, i, BEFORE_TNS, apply_dependent_coupling);
-                if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
-                    if (che->ch[0].ics.predictor_present) {
-                        if (che->ch[0].ics.ltp.present)
-                            apply_ltp(ac, &che->ch[0]);
-                        if (che->ch[1].ics.ltp.present && type == TYPE_CPE)
-                            apply_ltp(ac, &che->ch[1]);
-                    }
-                }
-                if (che->ch[0].tns.present)
-                    apply_tns(che->ch[0].coeffs, &che->ch[0].tns, &che->ch[0].ics, 1);
-                if (che->ch[1].tns.present)
-                    apply_tns(che->ch[1].coeffs, &che->ch[1].tns, &che->ch[1].ics, 1);
-                if (type <= TYPE_CPE)
-                    apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, apply_dependent_coupling);
-                if (type != TYPE_CCE || che->coup.coupling_point == AFTER_IMDCT) {
-                    imdct_and_window(ac, &che->ch[0]);
-                    if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
-                        update_ltp(ac, &che->ch[0]);
-                    if (type == TYPE_CPE) {
-                        imdct_and_window(ac, &che->ch[1]);
-                        if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP)
-                            update_ltp(ac, &che->ch[1]);
-                    }
-                    if (ac->oc[1].m4ac.sbr > 0) {
-                        ff_sbr_apply(ac, &che->sbr, type, che->ch[0].ret, che->ch[1].ret);
-                    }
-                }
-                if (type <= TYPE_CCE)
-                    apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, apply_independent_coupling);
-            }
-        }
-    }
-}
-
-static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
-{
-    int size;
-    AACADTSHeaderInfo hdr_info;
-    uint8_t layout_map[MAX_ELEM_ID*4][3];
-    int layout_map_tags, ret;
-
-    size = avpriv_aac_parse_header(gb, &hdr_info);
-    if (size > 0) {
-        if (hdr_info.num_aac_frames != 1) {
-            avpriv_report_missing_feature(ac->avctx,
-                                          "More than one AAC RDB per ADTS frame");
-            return AVERROR_PATCHWELCOME;
-        }
-        push_output_configuration(ac);
-        if (hdr_info.chan_config) {
-            ac->oc[1].m4ac.chan_config = hdr_info.chan_config;
-            if ((ret = set_default_channel_config(ac->avctx,
-                                                  layout_map,
-                                                  &layout_map_tags,
-                                                  hdr_info.chan_config)) < 0)
-                return ret;
-            if ((ret = output_configure(ac, layout_map, layout_map_tags,
-                                        FFMAX(ac->oc[1].status,
-                                              OC_TRIAL_FRAME), 0)) < 0)
-                return ret;
-        } else {
-            ac->oc[1].m4ac.chan_config = 0;
-        }
-        ac->oc[1].m4ac.sample_rate     = hdr_info.sample_rate;
-        ac->oc[1].m4ac.sampling_index  = hdr_info.sampling_index;
-        ac->oc[1].m4ac.object_type     = hdr_info.object_type;
-        if (ac->oc[0].status != OC_LOCKED ||
-            ac->oc[0].m4ac.chan_config != hdr_info.chan_config ||
-            ac->oc[0].m4ac.sample_rate != hdr_info.sample_rate) {
-            ac->oc[1].m4ac.sbr = -1;
-            ac->oc[1].m4ac.ps  = -1;
-        }
-        if (!hdr_info.crc_absent)
-            skip_bits(gb, 16);
-    }
-    return size;
-}
-
-static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, GetBitContext *gb)
-{
-    AACContext *ac = avctx->priv_data;
-    ChannelElement *che;
-    int err, i;
-    int samples = 1024;
-    int chan_config = ac->oc[1].m4ac.chan_config;
-    int aot = ac->oc[1].m4ac.object_type;
-
-    if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD)
-        samples >>= 1;
-
-    ac->frame = data;
-
-    if ((err = frame_configure_elements(avctx)) < 0)
-        return err;
-
-    // The FF_PROFILE_AAC_* defines are all object_type - 1
-    // This may lead to an undefined profile being signaled
-    ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
-
-    ac->tags_mapped = 0;
-
-    if (chan_config < 0 || chan_config >= 8) {
-        avpriv_request_sample(avctx, "Unknown ER channel configuration %d",
-                              ac->oc[1].m4ac.chan_config);
-        return AVERROR_INVALIDDATA;
-    }
-    for (i = 0; i < tags_per_config[chan_config]; i++) {
-        const int elem_type = aac_channel_layout_map[chan_config-1][i][0];
-        const int elem_id   = aac_channel_layout_map[chan_config-1][i][1];
-        if (!(che=get_che(ac, elem_type, elem_id))) {
-            av_log(ac->avctx, AV_LOG_ERROR,
-                   "channel element %d.%d is not allocated\n",
-                   elem_type, elem_id);
-            return AVERROR_INVALIDDATA;
-        }
-        if (aot != AOT_ER_AAC_ELD)
-            skip_bits(gb, 4);
-        switch (elem_type) {
-        case TYPE_SCE:
-            err = decode_ics(ac, &che->ch[0], gb, 0, 0);
-            break;
-        case TYPE_CPE:
-            err = decode_cpe(ac, gb, che);
-            break;
-        case TYPE_LFE:
-            err = decode_ics(ac, &che->ch[0], gb, 0, 0);
-            break;
-        }
-        if (err < 0)
-            return err;
-    }
-
-    spectral_to_sample(ac);
-
-    ac->frame->nb_samples = samples;
-    ac->frame->sample_rate = avctx->sample_rate;
-    *got_frame_ptr = 1;
-
-    skip_bits_long(gb, get_bits_left(gb));
-    return 0;
-}
-
-static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
-                                int *got_frame_ptr, GetBitContext *gb)
-{
-    AACContext *ac = avctx->priv_data;
-    ChannelElement *che = NULL, *che_prev = NULL;
-    enum RawDataBlockType elem_type, elem_type_prev = TYPE_END;
-    int err, elem_id;
-    int samples = 0, multiplier, audio_found = 0, pce_found = 0;
-
-    ac->frame = data;
-
-    if (show_bits(gb, 12) == 0xfff) {
-        if ((err = parse_adts_frame_header(ac, gb)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
-            goto fail;
-        }
-        if (ac->oc[1].m4ac.sampling_index > 12) {
-            av_log(ac->avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->oc[1].m4ac.sampling_index);
-            err = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-    }
-
-    if ((err = frame_configure_elements(avctx)) < 0)
-        goto fail;
-
-    // The FF_PROFILE_AAC_* defines are all object_type - 1
-    // This may lead to an undefined profile being signaled
-    ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
-
-    ac->tags_mapped = 0;
-    // parse
-    while ((elem_type = get_bits(gb, 3)) != TYPE_END) {
-        elem_id = get_bits(gb, 4);
-
-        if (elem_type < TYPE_DSE) {
-            if (!(che=get_che(ac, elem_type, elem_id))) {
-                av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
-                       elem_type, elem_id);
-                err = AVERROR_INVALIDDATA;
-                goto fail;
-            }
-            samples = 1024;
-        }
-
-        switch (elem_type) {
-
-        case TYPE_SCE:
-            err = decode_ics(ac, &che->ch[0], gb, 0, 0);
-            audio_found = 1;
-            break;
-
-        case TYPE_CPE:
-            err = decode_cpe(ac, gb, che);
-            audio_found = 1;
-            break;
-
-        case TYPE_CCE:
-            err = decode_cce(ac, gb, che);
-            break;
-
-        case TYPE_LFE:
-            err = decode_ics(ac, &che->ch[0], gb, 0, 0);
-            audio_found = 1;
-            break;
-
-        case TYPE_DSE:
-            err = skip_data_stream_element(ac, gb);
-            break;
-
-        case TYPE_PCE: {
-            uint8_t layout_map[MAX_ELEM_ID*4][3];
-            int tags;
-            push_output_configuration(ac);
-            tags = decode_pce(avctx, &ac->oc[1].m4ac, layout_map, gb);
-            if (tags < 0) {
-                err = tags;
-                break;
-            }
-            if (pce_found) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Not evaluating a further program_config_element as this construct is dubious at best.\n");
-                pop_output_configuration(ac);
-            } else {
-                err = output_configure(ac, layout_map, tags, OC_TRIAL_PCE, 1);
-                pce_found = 1;
-            }
-            break;
-        }
-
-        case TYPE_FIL:
-            if (elem_id == 15)
-                elem_id += get_bits(gb, 8) - 1;
-            if (get_bits_left(gb) < 8 * elem_id) {
-                    av_log(avctx, AV_LOG_ERROR, overread_err);
-                    err = AVERROR_INVALIDDATA;
-                    goto fail;
-            }
-            while (elem_id > 0)
-                elem_id -= decode_extension_payload(ac, gb, elem_id, che_prev, elem_type_prev);
-            err = 0; /* FIXME */
-            break;
-
-        default:
-            err = AVERROR_BUG; /* should not happen, but keeps compiler happy */
-            break;
-        }
-
-        che_prev       = che;
-        elem_type_prev = elem_type;
-
-        if (err)
-            goto fail;
-
-        if (get_bits_left(gb) < 3) {
-            av_log(avctx, AV_LOG_ERROR, overread_err);
-            err = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-    }
-
-    spectral_to_sample(ac);
-
-    multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0;
-    samples <<= multiplier;
-
-    if (ac->oc[1].status && audio_found) {
-        avctx->sample_rate = ac->oc[1].m4ac.sample_rate << multiplier;
-        avctx->frame_size = samples;
-        ac->oc[1].status = OC_LOCKED;
-    }
-
-    if (samples) {
-        ac->frame->nb_samples = samples;
-        ac->frame->sample_rate = avctx->sample_rate;
-    }
-    *got_frame_ptr = !!samples;
-
-    return 0;
-fail:
-    pop_output_configuration(ac);
-    return err;
-}
-
-static int aac_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    AACContext *ac = avctx->priv_data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    GetBitContext gb;
-    int buf_consumed;
-    int buf_offset;
-    int err;
-    int new_extradata_size;
-    const uint8_t *new_extradata = av_packet_get_side_data(avpkt,
-                                       AV_PKT_DATA_NEW_EXTRADATA,
-                                       &new_extradata_size);
-
-    if (new_extradata) {
-        av_free(avctx->extradata);
-        avctx->extradata = av_mallocz(new_extradata_size +
-                                      FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!avctx->extradata)
-            return AVERROR(ENOMEM);
-        avctx->extradata_size = new_extradata_size;
-        memcpy(avctx->extradata, new_extradata, new_extradata_size);
-        push_output_configuration(ac);
-        if (decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
-                                         avctx->extradata,
-                                         avctx->extradata_size*8, 1) < 0) {
-            pop_output_configuration(ac);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    if ((err = init_get_bits(&gb, buf, buf_size * 8)) < 0)
-        return err;
-
-    switch (ac->oc[1].m4ac.object_type) {
-    case AOT_ER_AAC_LC:
-    case AOT_ER_AAC_LTP:
-    case AOT_ER_AAC_LD:
-    case AOT_ER_AAC_ELD:
-        err = aac_decode_er_frame(avctx, data, got_frame_ptr, &gb);
-        break;
-    default:
-        err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb);
-    }
-    if (err < 0)
-        return err;
-
-    buf_consumed = (get_bits_count(&gb) + 7) >> 3;
-    for (buf_offset = buf_consumed; buf_offset < buf_size; buf_offset++)
-        if (buf[buf_offset])
-            break;
-
-    return buf_size > buf_offset ? buf_consumed : buf_size;
-}
-
-static av_cold int aac_decode_close(AVCodecContext *avctx)
-{
-    AACContext *ac = avctx->priv_data;
-    int i, type;
-
-    for (i = 0; i < MAX_ELEM_ID; i++) {
-        for (type = 0; type < 4; type++) {
-            if (ac->che[type][i])
-                ff_aac_sbr_ctx_close(&ac->che[type][i]->sbr);
-            av_freep(&ac->che[type][i]);
-        }
-    }
-
-    ff_mdct_end(&ac->mdct);
-    ff_mdct_end(&ac->mdct_small);
-    ff_mdct_end(&ac->mdct_ld);
-    ff_mdct_end(&ac->mdct_ltp);
-    return 0;
-}
-
-
-#define LOAS_SYNC_WORD   0x2b7       ///< 11 bits LOAS sync word
-
-struct LATMContext {
-    AACContext aac_ctx;     ///< containing AACContext
-    int initialized;        ///< initilized after a valid extradata was seen
-
-    // parser data
-    int audio_mux_version_A; ///< LATM syntax version
-    int frame_length_type;   ///< 0/1 variable/fixed frame length
-    int frame_length;        ///< frame length for fixed frame length
-};
-
-static inline uint32_t latm_get_value(GetBitContext *b)
-{
-    int length = get_bits(b, 2);
-
-    return get_bits_long(b, (length+1)*8);
-}
-
-static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
-                                             GetBitContext *gb, int asclen)
-{
-    AACContext *ac        = &latmctx->aac_ctx;
-    AVCodecContext *avctx = ac->avctx;
-    MPEG4AudioConfig m4ac = { 0 };
-    int config_start_bit  = get_bits_count(gb);
-    int sync_extension    = 0;
-    int bits_consumed, esize;
-
-    if (asclen) {
-        sync_extension = 1;
-        asclen         = FFMIN(asclen, get_bits_left(gb));
-    } else
-        asclen         = get_bits_left(gb);
-
-    if (config_start_bit % 8) {
-        avpriv_request_sample(latmctx->aac_ctx.avctx,
-                              "Non-byte-aligned audio-specific config");
-        return AVERROR_PATCHWELCOME;
-    }
-    if (asclen <= 0)
-        return AVERROR_INVALIDDATA;
-    bits_consumed = decode_audio_specific_config(NULL, avctx, &m4ac,
-                                         gb->buffer + (config_start_bit / 8),
-                                         asclen, sync_extension);
-
-    if (bits_consumed < 0)
-        return AVERROR_INVALIDDATA;
-
-    if (!latmctx->initialized ||
-        ac->oc[1].m4ac.sample_rate != m4ac.sample_rate ||
-        ac->oc[1].m4ac.chan_config != m4ac.chan_config) {
-
-        av_log(avctx, AV_LOG_INFO, "audio config changed\n");
-        latmctx->initialized = 0;
-
-        esize = (bits_consumed+7) / 8;
-
-        if (avctx->extradata_size < esize) {
-            av_free(avctx->extradata);
-            avctx->extradata = av_malloc(esize + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!avctx->extradata)
-                return AVERROR(ENOMEM);
-        }
-
-        avctx->extradata_size = esize;
-        memcpy(avctx->extradata, gb->buffer + (config_start_bit/8), esize);
-        memset(avctx->extradata+esize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    }
-    skip_bits_long(gb, bits_consumed);
-
-    return bits_consumed;
-}
-
-static int read_stream_mux_config(struct LATMContext *latmctx,
-                                  GetBitContext *gb)
-{
-    int ret, audio_mux_version = get_bits(gb, 1);
-
-    latmctx->audio_mux_version_A = 0;
-    if (audio_mux_version)
-        latmctx->audio_mux_version_A = get_bits(gb, 1);
-
-    if (!latmctx->audio_mux_version_A) {
-
-        if (audio_mux_version)
-            latm_get_value(gb);                 // taraFullness
-
-        skip_bits(gb, 1);                       // allStreamSameTimeFraming
-        skip_bits(gb, 6);                       // numSubFrames
-        // numPrograms
-        if (get_bits(gb, 4)) {                  // numPrograms
-            avpriv_request_sample(latmctx->aac_ctx.avctx, "Multiple programs");
-            return AVERROR_PATCHWELCOME;
-        }
-
-        // for each program (which there is only on in DVB)
-
-        // for each layer (which there is only on in DVB)
-        if (get_bits(gb, 3)) {                   // numLayer
-            avpriv_request_sample(latmctx->aac_ctx.avctx, "Multiple layers");
-            return AVERROR_PATCHWELCOME;
-        }
-
-        // for all but first stream: use_same_config = get_bits(gb, 1);
-        if (!audio_mux_version) {
-            if ((ret = latm_decode_audio_specific_config(latmctx, gb, 0)) < 0)
-                return ret;
-        } else {
-            int ascLen = latm_get_value(gb);
-            if ((ret = latm_decode_audio_specific_config(latmctx, gb, ascLen)) < 0)
-                return ret;
-            ascLen -= ret;
-            skip_bits_long(gb, ascLen);
-        }
-
-        latmctx->frame_length_type = get_bits(gb, 3);
-        switch (latmctx->frame_length_type) {
-        case 0:
-            skip_bits(gb, 8);       // latmBufferFullness
-            break;
-        case 1:
-            latmctx->frame_length = get_bits(gb, 9);
-            break;
-        case 3:
-        case 4:
-        case 5:
-            skip_bits(gb, 6);       // CELP frame length table index
-            break;
-        case 6:
-        case 7:
-            skip_bits(gb, 1);       // HVXC frame length table index
-            break;
-        }
-
-        if (get_bits(gb, 1)) {                  // other data
-            if (audio_mux_version) {
-                latm_get_value(gb);             // other_data_bits
-            } else {
-                int esc;
-                do {
-                    esc = get_bits(gb, 1);
-                    skip_bits(gb, 8);
-                } while (esc);
-            }
-        }
-
-        if (get_bits(gb, 1))                     // crc present
-            skip_bits(gb, 8);                    // config_crc
-    }
-
-    return 0;
-}
-
-static int read_payload_length_info(struct LATMContext *ctx, GetBitContext *gb)
-{
-    uint8_t tmp;
-
-    if (ctx->frame_length_type == 0) {
-        int mux_slot_length = 0;
-        do {
-            tmp = get_bits(gb, 8);
-            mux_slot_length += tmp;
-        } while (tmp == 255);
-        return mux_slot_length;
-    } else if (ctx->frame_length_type == 1) {
-        return ctx->frame_length;
-    } else if (ctx->frame_length_type == 3 ||
-               ctx->frame_length_type == 5 ||
-               ctx->frame_length_type == 7) {
-        skip_bits(gb, 2);          // mux_slot_length_coded
-    }
-    return 0;
-}
-
-static int read_audio_mux_element(struct LATMContext *latmctx,
-                                  GetBitContext *gb)
-{
-    int err;
-    uint8_t use_same_mux = get_bits(gb, 1);
-    if (!use_same_mux) {
-        if ((err = read_stream_mux_config(latmctx, gb)) < 0)
-            return err;
-    } else if (!latmctx->aac_ctx.avctx->extradata) {
-        av_log(latmctx->aac_ctx.avctx, AV_LOG_DEBUG,
-               "no decoder config found\n");
-        return AVERROR(EAGAIN);
-    }
-    if (latmctx->audio_mux_version_A == 0) {
-        int mux_slot_length_bytes = read_payload_length_info(latmctx, gb);
-        if (mux_slot_length_bytes * 8 > get_bits_left(gb)) {
-            av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n");
-            return AVERROR_INVALIDDATA;
-        } else if (mux_slot_length_bytes * 8 + 256 < get_bits_left(gb)) {
-            av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR,
-                   "frame length mismatch %d << %d\n",
-                   mux_slot_length_bytes * 8, get_bits_left(gb));
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    return 0;
-}
-
-
-static int latm_decode_frame(AVCodecContext *avctx, void *out,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    struct LATMContext *latmctx = avctx->priv_data;
-    int                 muxlength, err;
-    GetBitContext       gb;
-
-    if ((err = init_get_bits(&gb, avpkt->data, avpkt->size * 8)) < 0)
-        return err;
-
-    // check for LOAS sync word
-    if (get_bits(&gb, 11) != LOAS_SYNC_WORD)
-        return AVERROR_INVALIDDATA;
-
-    muxlength = get_bits(&gb, 13) + 3;
-    // not enough data, the parser should have sorted this
-    if (muxlength > avpkt->size)
-        return AVERROR_INVALIDDATA;
-
-    if ((err = read_audio_mux_element(latmctx, &gb)) < 0)
-        return err;
-
-    if (!latmctx->initialized) {
-        if (!avctx->extradata) {
-            *got_frame_ptr = 0;
-            return avpkt->size;
-        } else {
-            push_output_configuration(&latmctx->aac_ctx);
-            if ((err = decode_audio_specific_config(
-                    &latmctx->aac_ctx, avctx, &latmctx->aac_ctx.oc[1].m4ac,
-                    avctx->extradata, avctx->extradata_size*8, 1)) < 0) {
-                pop_output_configuration(&latmctx->aac_ctx);
-                return err;
-            }
-            latmctx->initialized = 1;
-        }
-    }
-
-    if (show_bits(&gb, 12) == 0xfff) {
-        av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR,
-               "ADTS header detected, probably as result of configuration "
-               "misparsing\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((err = aac_decode_frame_int(avctx, out, got_frame_ptr, &gb)) < 0)
-        return err;
-
-    return muxlength;
-}
-
-static av_cold int latm_decode_init(AVCodecContext *avctx)
-{
-    struct LATMContext *latmctx = avctx->priv_data;
-    int ret = aac_decode_init(avctx);
-
-    if (avctx->extradata_size > 0)
-        latmctx->initialized = !ret;
-
-    return ret;
-}
-
-
-AVCodec ff_aac_decoder = {
-    .name            = "aac",
-    .long_name       = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
-    .type            = AVMEDIA_TYPE_AUDIO,
-    .id              = AV_CODEC_ID_AAC,
-    .priv_data_size  = sizeof(AACContext),
-    .init            = aac_decode_init,
-    .close           = aac_decode_close,
-    .decode          = aac_decode_frame,
-    .sample_fmts     = (const enum AVSampleFormat[]) {
-        AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
-    },
-    .capabilities    = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
-    .channel_layouts = aac_channel_layout,
-};
-
-/*
-    Note: This decoder filter is intended to decode LATM streams transferred
-    in MPEG transport streams which only contain one program.
-    To do a more complex LATM demuxing a separate LATM demuxer should be used.
-*/
-AVCodec ff_aac_latm_decoder = {
-    .name            = "aac_latm",
-    .long_name       = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
-    .type            = AVMEDIA_TYPE_AUDIO,
-    .id              = AV_CODEC_ID_AAC_LATM,
-    .priv_data_size  = sizeof(struct LATMContext),
-    .init            = latm_decode_init,
-    .close           = aac_decode_close,
-    .decode          = latm_decode_frame,
-    .sample_fmts     = (const enum AVSampleFormat[]) {
-        AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
-    },
-    .capabilities    = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
-    .channel_layouts = aac_channel_layout,
-};
diff --git a/deps/libav/libavcodec/aacdectab.h b/deps/libav/libavcodec/aacdectab.h
deleted file mode 100644
index 4c23f2d..0000000
--- a/deps/libav/libavcodec/aacdectab.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * AAC decoder data
- * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
- * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC decoder data
- * @author Oded Shimon  ( ods15 ods15 dyndns org )
- * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
- */
-
-#ifndef AVCODEC_AACDECTAB_H
-#define AVCODEC_AACDECTAB_H
-
-#include "libavutil/channel_layout.h"
-#include "aac.h"
-
-#include <stdint.h>
-
-/* @name ltp_coef
- * Table of the LTP coefficients
- */
-static const float ltp_coef[8] = {
-    0.570829, 0.696616, 0.813004, 0.911304,
-    0.984900, 1.067894, 1.194601, 1.369533,
-};
-
-/* @name tns_tmp2_map
- * Tables of the tmp2[] arrays of LPC coefficients used for TNS.
- * The suffix _M_N[] indicate the values of coef_compress and coef_res
- * respectively.
- * @{
- */
-static const float tns_tmp2_map_1_3[4] = {
-     0.00000000, -0.43388373,  0.64278758,  0.34202015,
-};
-
-static const float tns_tmp2_map_0_3[8] = {
-     0.00000000, -0.43388373, -0.78183150, -0.97492790,
-     0.98480773,  0.86602539,  0.64278758,  0.34202015,
-};
-
-static const float tns_tmp2_map_1_4[8] = {
-     0.00000000, -0.20791170, -0.40673664, -0.58778524,
-     0.67369562,  0.52643216,  0.36124167,  0.18374951,
-};
-
-static const float tns_tmp2_map_0_4[16] = {
-     0.00000000, -0.20791170, -0.40673664, -0.58778524,
-    -0.74314481, -0.86602539, -0.95105654, -0.99452192,
-     0.99573416,  0.96182561,  0.89516330,  0.79801720,
-     0.67369562,  0.52643216,  0.36124167,  0.18374951,
-};
-
-static const float * const tns_tmp2_map[4] = {
-    tns_tmp2_map_0_3,
-    tns_tmp2_map_0_4,
-    tns_tmp2_map_1_3,
-    tns_tmp2_map_1_4
-};
-// @}
-
-static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-static const uint8_t aac_channel_layout_map[7][5][3] = {
-    { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, },
-    { { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
-    { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
-    { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, },
-    { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, },
-    { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE  }, },
-    { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE  }, },
-};
-
-static const uint64_t aac_channel_layout[8] = {
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_5POINT0_BACK,
-    AV_CH_LAYOUT_5POINT1_BACK,
-    AV_CH_LAYOUT_7POINT1_WIDE_BACK,
-    0,
-};
-
-#endif /* AVCODEC_AACDECTAB_H */
diff --git a/deps/libav/libavcodec/aacenc.c b/deps/libav/libavcodec/aacenc.c
deleted file mode 100644
index 55aa2f1..0000000
--- a/deps/libav/libavcodec/aacenc.c
+++ /dev/null
@@ -1,819 +0,0 @@
-/*
- * AAC encoder
- * Copyright (C) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC encoder
- */
-
-/***********************************
- *              TODOs:
- * add sane pulse detection
- * add temporal noise shaping
- ***********************************/
-
-#include "libavutil/float_dsp.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "put_bits.h"
-#include "internal.h"
-#include "mpeg4audio.h"
-#include "kbdwin.h"
-#include "sinewin.h"
-
-#include "aac.h"
-#include "aactab.h"
-#include "aacenc.h"
-
-#include "psymodel.h"
-
-#define AAC_MAX_CHANNELS 6
-
-#define ERROR_IF(cond, ...) \
-    if (cond) { \
-        av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \
-        return AVERROR(EINVAL); \
-    }
-
-float ff_aac_pow34sf_tab[428];
-
-static const uint8_t swb_size_1024_96[] = {
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,
-    12, 12, 12, 12, 12, 16, 16, 24, 28, 36, 44,
-    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
-};
-
-static const uint8_t swb_size_1024_64[] = {
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8,
-    12, 12, 12, 16, 16, 16, 20, 24, 24, 28, 36,
-    40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40
-};
-
-static const uint8_t swb_size_1024_48[] = {
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8,
-    12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28,
-    32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
-    96
-};
-
-static const uint8_t swb_size_1024_32[] = {
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8,
-    12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28,
-    32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32
-};
-
-static const uint8_t swb_size_1024_24[] = {
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    12, 12, 12, 12, 16, 16, 16, 20, 20, 24, 24, 28, 28,
-    32, 36, 36, 40, 44, 48, 52, 52, 64, 64, 64, 64, 64
-};
-
-static const uint8_t swb_size_1024_16[] = {
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 24, 24, 28, 28,
-    32, 36, 40, 40, 44, 48, 52, 56, 60, 64, 64, 64
-};
-
-static const uint8_t swb_size_1024_8[] = {
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 24, 24, 24, 28, 28,
-    32, 36, 36, 40, 44, 48, 52, 56, 60, 64, 80
-};
-
-static const uint8_t *swb_size_1024[] = {
-    swb_size_1024_96, swb_size_1024_96, swb_size_1024_64,
-    swb_size_1024_48, swb_size_1024_48, swb_size_1024_32,
-    swb_size_1024_24, swb_size_1024_24, swb_size_1024_16,
-    swb_size_1024_16, swb_size_1024_16, swb_size_1024_8
-};
-
-static const uint8_t swb_size_128_96[] = {
-    4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36
-};
-
-static const uint8_t swb_size_128_48[] = {
-    4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 16
-};
-
-static const uint8_t swb_size_128_24[] = {
-    4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 20
-};
-
-static const uint8_t swb_size_128_16[] = {
-    4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 20
-};
-
-static const uint8_t swb_size_128_8[] = {
-    4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, 16, 20, 20
-};
-
-static const uint8_t *swb_size_128[] = {
-    /* the last entry on the following row is swb_size_128_64 but is a
-       duplicate of swb_size_128_96 */
-    swb_size_128_96, swb_size_128_96, swb_size_128_96,
-    swb_size_128_48, swb_size_128_48, swb_size_128_48,
-    swb_size_128_24, swb_size_128_24, swb_size_128_16,
-    swb_size_128_16, swb_size_128_16, swb_size_128_8
-};
-
-/** default channel configurations */
-static const uint8_t aac_chan_configs[6][5] = {
- {1, TYPE_SCE},                               // 1 channel  - single channel element
- {1, TYPE_CPE},                               // 2 channels - channel pair
- {2, TYPE_SCE, TYPE_CPE},                     // 3 channels - center + stereo
- {3, TYPE_SCE, TYPE_CPE, TYPE_SCE},           // 4 channels - front center + stereo + back center
- {3, TYPE_SCE, TYPE_CPE, TYPE_CPE},           // 5 channels - front center + stereo + back stereo
- {4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
-};
-
-/**
- * Table to remap channels from Libav's default order to AAC order.
- */
-static const uint8_t aac_chan_maps[AAC_MAX_CHANNELS][AAC_MAX_CHANNELS] = {
-    { 0 },
-    { 0, 1 },
-    { 2, 0, 1 },
-    { 2, 0, 1, 3 },
-    { 2, 0, 1, 3, 4 },
-    { 2, 0, 1, 4, 5, 3 },
-};
-
-/**
- * Make AAC audio config object.
- * @see 1.6.2.1 "Syntax - AudioSpecificConfig"
- */
-static void put_audio_specific_config(AVCodecContext *avctx)
-{
-    PutBitContext pb;
-    AACEncContext *s = avctx->priv_data;
-
-    init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
-    put_bits(&pb, 5, 2); //object type - AAC-LC
-    put_bits(&pb, 4, s->samplerate_index); //sample rate index
-    put_bits(&pb, 4, s->channels);
-    //GASpecificConfig
-    put_bits(&pb, 1, 0); //frame length - 1024 samples
-    put_bits(&pb, 1, 0); //does not depend on core coder
-    put_bits(&pb, 1, 0); //is not extension
-
-    //Explicitly Mark SBR absent
-    put_bits(&pb, 11, 0x2b7); //sync extension
-    put_bits(&pb, 5,  AOT_SBR);
-    put_bits(&pb, 1,  0);
-    flush_put_bits(&pb);
-}
-
-#define WINDOW_FUNC(type) \
-static void apply_ ##type ##_window(AVFloatDSPContext *fdsp, \
-                                    SingleChannelElement *sce, \
-                                    const float *audio)
-
-WINDOW_FUNC(only_long)
-{
-    const float *lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
-    const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
-    float *out = sce->ret_buf;
-
-    fdsp->vector_fmul        (out,        audio,        lwindow, 1024);
-    fdsp->vector_fmul_reverse(out + 1024, audio + 1024, pwindow, 1024);
-}
-
-WINDOW_FUNC(long_start)
-{
-    const float *lwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;
-    const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
-    float *out = sce->ret_buf;
-
-    fdsp->vector_fmul(out, audio, lwindow, 1024);
-    memcpy(out + 1024, audio + 1024, sizeof(out[0]) * 448);
-    fdsp->vector_fmul_reverse(out + 1024 + 448, audio + 1024 + 448, swindow, 128);
-    memset(out + 1024 + 576, 0, sizeof(out[0]) * 448);
-}
-
-WINDOW_FUNC(long_stop)
-{
-    const float *lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;
-    const float *swindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
-    float *out = sce->ret_buf;
-
-    memset(out, 0, sizeof(out[0]) * 448);
-    fdsp->vector_fmul(out + 448, audio + 448, swindow, 128);
-    memcpy(out + 576, audio + 576, sizeof(out[0]) * 448);
-    fdsp->vector_fmul_reverse(out + 1024, audio + 1024, lwindow, 1024);
-}
-
-WINDOW_FUNC(eight_short)
-{
-    const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;
-    const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
-    const float *in = audio + 448;
-    float *out = sce->ret_buf;
-    int w;
-
-    for (w = 0; w < 8; w++) {
-        fdsp->vector_fmul        (out, in, w ? pwindow : swindow, 128);
-        out += 128;
-        in  += 128;
-        fdsp->vector_fmul_reverse(out, in, swindow, 128);
-        out += 128;
-    }
-}
-
-static void (*const apply_window[4])(AVFloatDSPContext *fdsp,
-                                     SingleChannelElement *sce,
-                                     const float *audio) = {
-    [ONLY_LONG_SEQUENCE]   = apply_only_long_window,
-    [LONG_START_SEQUENCE]  = apply_long_start_window,
-    [EIGHT_SHORT_SEQUENCE] = apply_eight_short_window,
-    [LONG_STOP_SEQUENCE]   = apply_long_stop_window
-};
-
-static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
-                                  float *audio)
-{
-    int i;
-    float *output = sce->ret_buf;
-
-    apply_window[sce->ics.window_sequence[0]](&s->fdsp, sce, audio);
-
-    if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE)
-        s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);
-    else
-        for (i = 0; i < 1024; i += 128)
-            s->mdct128.mdct_calc(&s->mdct128, sce->coeffs + i, output + i*2);
-    memcpy(audio, audio + 1024, sizeof(audio[0]) * 1024);
-}
-
-/**
- * Encode ics_info element.
- * @see Table 4.6 (syntax of ics_info)
- */
-static void put_ics_info(AACEncContext *s, IndividualChannelStream *info)
-{
-    int w;
-
-    put_bits(&s->pb, 1, 0);                // ics_reserved bit
-    put_bits(&s->pb, 2, info->window_sequence[0]);
-    put_bits(&s->pb, 1, info->use_kb_window[0]);
-    if (info->window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
-        put_bits(&s->pb, 6, info->max_sfb);
-        put_bits(&s->pb, 1, 0);            // no prediction
-    } else {
-        put_bits(&s->pb, 4, info->max_sfb);
-        for (w = 1; w < 8; w++)
-            put_bits(&s->pb, 1, !info->group_len[w]);
-    }
-}
-
-/**
- * Encode MS data.
- * @see 4.6.8.1 "Joint Coding - M/S Stereo"
- */
-static void encode_ms_info(PutBitContext *pb, ChannelElement *cpe)
-{
-    int i, w;
-
-    put_bits(pb, 2, cpe->ms_mode);
-    if (cpe->ms_mode == 1)
-        for (w = 0; w < cpe->ch[0].ics.num_windows; w += cpe->ch[0].ics.group_len[w])
-            for (i = 0; i < cpe->ch[0].ics.max_sfb; i++)
-                put_bits(pb, 1, cpe->ms_mask[w*16 + i]);
-}
-
-/**
- * Produce integer coefficients from scalefactors provided by the model.
- */
-static void adjust_frame_information(ChannelElement *cpe, int chans)
-{
-    int i, w, w2, g, ch;
-    int start, maxsfb, cmaxsfb;
-
-    for (ch = 0; ch < chans; ch++) {
-        IndividualChannelStream *ics = &cpe->ch[ch].ics;
-        start = 0;
-        maxsfb = 0;
-        cpe->ch[ch].pulse.num_pulse = 0;
-        for (w = 0; w < ics->num_windows*16; w += 16) {
-            for (g = 0; g < ics->num_swb; g++) {
-                //apply M/S
-                if (cpe->common_window && !ch && cpe->ms_mask[w + g]) {
-                    for (i = 0; i < ics->swb_sizes[g]; i++) {
-                        cpe->ch[0].coeffs[start+i] = (cpe->ch[0].coeffs[start+i] + cpe->ch[1].coeffs[start+i]) / 2.0;
-                        cpe->ch[1].coeffs[start+i] =  cpe->ch[0].coeffs[start+i] - cpe->ch[1].coeffs[start+i];
-                    }
-                }
-                start += ics->swb_sizes[g];
-            }
-            for (cmaxsfb = ics->num_swb; cmaxsfb > 0 && cpe->ch[ch].zeroes[w+cmaxsfb-1]; cmaxsfb--)
-                ;
-            maxsfb = FFMAX(maxsfb, cmaxsfb);
-        }
-        ics->max_sfb = maxsfb;
-
-        //adjust zero bands for window groups
-        for (w = 0; w < ics->num_windows; w += ics->group_len[w]) {
-            for (g = 0; g < ics->max_sfb; g++) {
-                i = 1;
-                for (w2 = w; w2 < w + ics->group_len[w]; w2++) {
-                    if (!cpe->ch[ch].zeroes[w2*16 + g]) {
-                        i = 0;
-                        break;
-                    }
-                }
-                cpe->ch[ch].zeroes[w*16 + g] = i;
-            }
-        }
-    }
-
-    if (chans > 1 && cpe->common_window) {
-        IndividualChannelStream *ics0 = &cpe->ch[0].ics;
-        IndividualChannelStream *ics1 = &cpe->ch[1].ics;
-        int msc = 0;
-        ics0->max_sfb = FFMAX(ics0->max_sfb, ics1->max_sfb);
-        ics1->max_sfb = ics0->max_sfb;
-        for (w = 0; w < ics0->num_windows*16; w += 16)
-            for (i = 0; i < ics0->max_sfb; i++)
-                if (cpe->ms_mask[w+i])
-                    msc++;
-        if (msc == 0 || ics0->max_sfb == 0)
-            cpe->ms_mode = 0;
-        else
-            cpe->ms_mode = msc < ics0->max_sfb * ics0->num_windows ? 1 : 2;
-    }
-}
-
-/**
- * Encode scalefactor band coding type.
- */
-static void encode_band_info(AACEncContext *s, SingleChannelElement *sce)
-{
-    int w;
-
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
-        s->coder->encode_window_bands_info(s, sce, w, sce->ics.group_len[w], s->lambda);
-}
-
-/**
- * Encode scalefactors.
- */
-static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
-                                 SingleChannelElement *sce)
-{
-    int off = sce->sf_idx[0], diff;
-    int i, w;
-
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-        for (i = 0; i < sce->ics.max_sfb; i++) {
-            if (!sce->zeroes[w*16 + i]) {
-                diff = sce->sf_idx[w*16 + i] - off + SCALE_DIFF_ZERO;
-                if (diff < 0 || diff > 120)
-                    av_log(avctx, AV_LOG_ERROR, "Scalefactor difference is too big to be coded\n");
-                off = sce->sf_idx[w*16 + i];
-                put_bits(&s->pb, ff_aac_scalefactor_bits[diff], ff_aac_scalefactor_code[diff]);
-            }
-        }
-    }
-}
-
-/**
- * Encode pulse data.
- */
-static void encode_pulses(AACEncContext *s, Pulse *pulse)
-{
-    int i;
-
-    put_bits(&s->pb, 1, !!pulse->num_pulse);
-    if (!pulse->num_pulse)
-        return;
-
-    put_bits(&s->pb, 2, pulse->num_pulse - 1);
-    put_bits(&s->pb, 6, pulse->start);
-    for (i = 0; i < pulse->num_pulse; i++) {
-        put_bits(&s->pb, 5, pulse->pos[i]);
-        put_bits(&s->pb, 4, pulse->amp[i]);
-    }
-}
-
-/**
- * Encode spectral coefficients processed by psychoacoustic model.
- */
-static void encode_spectral_coeffs(AACEncContext *s, SingleChannelElement *sce)
-{
-    int start, i, w, w2;
-
-    for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
-        start = 0;
-        for (i = 0; i < sce->ics.max_sfb; i++) {
-            if (sce->zeroes[w*16 + i]) {
-                start += sce->ics.swb_sizes[i];
-                continue;
-            }
-            for (w2 = w; w2 < w + sce->ics.group_len[w]; w2++)
-                s->coder->quantize_and_encode_band(s, &s->pb, sce->coeffs + start + w2*128,
-                                                   sce->ics.swb_sizes[i],
-                                                   sce->sf_idx[w*16 + i],
-                                                   sce->band_type[w*16 + i],
-                                                   s->lambda);
-            start += sce->ics.swb_sizes[i];
-        }
-    }
-}
-
-/**
- * Encode one channel of audio data.
- */
-static int encode_individual_channel(AVCodecContext *avctx, AACEncContext *s,
-                                     SingleChannelElement *sce,
-                                     int common_window)
-{
-    put_bits(&s->pb, 8, sce->sf_idx[0]);
-    if (!common_window)
-        put_ics_info(s, &sce->ics);
-    encode_band_info(s, sce);
-    encode_scale_factors(avctx, s, sce);
-    encode_pulses(s, &sce->pulse);
-    put_bits(&s->pb, 1, 0); //tns
-    put_bits(&s->pb, 1, 0); //ssr
-    encode_spectral_coeffs(s, sce);
-    return 0;
-}
-
-/**
- * Write some auxiliary information about the created AAC file.
- */
-static void put_bitstream_info(AACEncContext *s, const char *name)
-{
-    int i, namelen, padbits;
-
-    namelen = strlen(name) + 2;
-    put_bits(&s->pb, 3, TYPE_FIL);
-    put_bits(&s->pb, 4, FFMIN(namelen, 15));
-    if (namelen >= 15)
-        put_bits(&s->pb, 8, namelen - 14);
-    put_bits(&s->pb, 4, 0); //extension type - filler
-    padbits = -put_bits_count(&s->pb) & 7;
-    avpriv_align_put_bits(&s->pb);
-    for (i = 0; i < namelen - 2; i++)
-        put_bits(&s->pb, 8, name[i]);
-    put_bits(&s->pb, 12 - padbits, 0);
-}
-
-/*
- * Copy input samples.
- * Channels are reordered from Libav's default order to AAC order.
- */
-static void copy_input_samples(AACEncContext *s, const AVFrame *frame)
-{
-    int ch;
-    int end = 2048 + (frame ? frame->nb_samples : 0);
-    const uint8_t *channel_map = aac_chan_maps[s->channels - 1];
-
-    /* copy and remap input samples */
-    for (ch = 0; ch < s->channels; ch++) {
-        /* copy last 1024 samples of previous frame to the start of the current frame */
-        memcpy(&s->planar_samples[ch][1024], &s->planar_samples[ch][2048], 1024 * sizeof(s->planar_samples[0][0]));
-
-        /* copy new samples and zero any remaining samples */
-        if (frame) {
-            memcpy(&s->planar_samples[ch][2048],
-                   frame->extended_data[channel_map[ch]],
-                   frame->nb_samples * sizeof(s->planar_samples[0][0]));
-        }
-        memset(&s->planar_samples[ch][end], 0,
-               (3072 - end) * sizeof(s->planar_samples[0][0]));
-    }
-}
-
-static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                            const AVFrame *frame, int *got_packet_ptr)
-{
-    AACEncContext *s = avctx->priv_data;
-    float **samples = s->planar_samples, *samples2, *la, *overlap;
-    ChannelElement *cpe;
-    int i, ch, w, g, chans, tag, start_ch, ret;
-    int chan_el_counter[4];
-    FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
-
-    if (s->last_frame == 2)
-        return 0;
-
-    /* add current frame to queue */
-    if (frame) {
-        if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
-            return ret;
-    }
-
-    copy_input_samples(s, frame);
-    if (s->psypp)
-        ff_psy_preprocess(s->psypp, s->planar_samples, s->channels);
-
-    if (!avctx->frame_number)
-        return 0;
-
-    start_ch = 0;
-    for (i = 0; i < s->chan_map[0]; i++) {
-        FFPsyWindowInfo* wi = windows + start_ch;
-        tag      = s->chan_map[i+1];
-        chans    = tag == TYPE_CPE ? 2 : 1;
-        cpe      = &s->cpe[i];
-        for (ch = 0; ch < chans; ch++) {
-            IndividualChannelStream *ics = &cpe->ch[ch].ics;
-            int cur_channel = start_ch + ch;
-            overlap  = &samples[cur_channel][0];
-            samples2 = overlap + 1024;
-            la       = samples2 + (448+64);
-            if (!frame)
-                la = NULL;
-            if (tag == TYPE_LFE) {
-                wi[ch].window_type[0] = ONLY_LONG_SEQUENCE;
-                wi[ch].window_shape   = 0;
-                wi[ch].num_windows    = 1;
-                wi[ch].grouping[0]    = 1;
-
-                /* Only the lowest 12 coefficients are used in a LFE channel.
-                 * The expression below results in only the bottom 8 coefficients
-                 * being used for 11.025kHz to 16kHz sample rates.
-                 */
-                ics->num_swb = s->samplerate_index >= 8 ? 1 : 3;
-            } else {
-                wi[ch] = s->psy.model->window(&s->psy, samples2, la, cur_channel,
-                                              ics->window_sequence[0]);
-            }
-            ics->window_sequence[1] = ics->window_sequence[0];
-            ics->window_sequence[0] = wi[ch].window_type[0];
-            ics->use_kb_window[1]   = ics->use_kb_window[0];
-            ics->use_kb_window[0]   = wi[ch].window_shape;
-            ics->num_windows        = wi[ch].num_windows;
-            ics->swb_sizes          = s->psy.bands    [ics->num_windows == 8];
-            ics->num_swb            = tag == TYPE_LFE ? ics->num_swb : s->psy.num_bands[ics->num_windows == 8];
-            for (w = 0; w < ics->num_windows; w++)
-                ics->group_len[w] = wi[ch].grouping[w];
-
-            apply_window_and_mdct(s, &cpe->ch[ch], overlap);
-        }
-        start_ch += chans;
-    }
-    if ((ret = ff_alloc_packet(avpkt, 768 * s->channels))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    do {
-        int frame_bits;
-
-        init_put_bits(&s->pb, avpkt->data, avpkt->size);
-
-        if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & CODEC_FLAG_BITEXACT))
-            put_bitstream_info(s, LIBAVCODEC_IDENT);
-        start_ch = 0;
-        memset(chan_el_counter, 0, sizeof(chan_el_counter));
-        for (i = 0; i < s->chan_map[0]; i++) {
-            FFPsyWindowInfo* wi = windows + start_ch;
-            const float *coeffs[2];
-            tag      = s->chan_map[i+1];
-            chans    = tag == TYPE_CPE ? 2 : 1;
-            cpe      = &s->cpe[i];
-            put_bits(&s->pb, 3, tag);
-            put_bits(&s->pb, 4, chan_el_counter[tag]++);
-            for (ch = 0; ch < chans; ch++)
-                coeffs[ch] = cpe->ch[ch].coeffs;
-            s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
-            for (ch = 0; ch < chans; ch++) {
-                s->cur_channel = start_ch + ch;
-                s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
-            }
-            cpe->common_window = 0;
-            if (chans > 1
-                && wi[0].window_type[0] == wi[1].window_type[0]
-                && wi[0].window_shape   == wi[1].window_shape) {
-
-                cpe->common_window = 1;
-                for (w = 0; w < wi[0].num_windows; w++) {
-                    if (wi[0].grouping[w] != wi[1].grouping[w]) {
-                        cpe->common_window = 0;
-                        break;
-                    }
-                }
-            }
-            s->cur_channel = start_ch;
-            if (s->options.stereo_mode && cpe->common_window) {
-                if (s->options.stereo_mode > 0) {
-                    IndividualChannelStream *ics = &cpe->ch[0].ics;
-                    for (w = 0; w < ics->num_windows; w += ics->group_len[w])
-                        for (g = 0;  g < ics->num_swb; g++)
-                            cpe->ms_mask[w*16+g] = 1;
-                } else if (s->coder->search_for_ms) {
-                    s->coder->search_for_ms(s, cpe, s->lambda);
-                }
-            }
-            adjust_frame_information(cpe, chans);
-            if (chans == 2) {
-                put_bits(&s->pb, 1, cpe->common_window);
-                if (cpe->common_window) {
-                    put_ics_info(s, &cpe->ch[0].ics);
-                    encode_ms_info(&s->pb, cpe);
-                }
-            }
-            for (ch = 0; ch < chans; ch++) {
-                s->cur_channel = start_ch + ch;
-                encode_individual_channel(avctx, s, &cpe->ch[ch], cpe->common_window);
-            }
-            start_ch += chans;
-        }
-
-        frame_bits = put_bits_count(&s->pb);
-        if (frame_bits <= 6144 * s->channels - 3) {
-            s->psy.bitres.bits = frame_bits / s->channels;
-            break;
-        }
-
-        s->lambda *= avctx->bit_rate * 1024.0f / avctx->sample_rate / frame_bits;
-
-    } while (1);
-
-    put_bits(&s->pb, 3, TYPE_END);
-    flush_put_bits(&s->pb);
-    avctx->frame_bits = put_bits_count(&s->pb);
-
-    // rate control stuff
-    if (!(avctx->flags & CODEC_FLAG_QSCALE)) {
-        float ratio = avctx->bit_rate * 1024.0f / avctx->sample_rate / avctx->frame_bits;
-        s->lambda *= ratio;
-        s->lambda = FFMIN(s->lambda, 65536.f);
-    }
-
-    if (!frame)
-        s->last_frame++;
-
-    ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
-                       &avpkt->duration);
-
-    avpkt->size = put_bits_count(&s->pb) >> 3;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-static av_cold int aac_encode_end(AVCodecContext *avctx)
-{
-    AACEncContext *s = avctx->priv_data;
-
-    ff_mdct_end(&s->mdct1024);
-    ff_mdct_end(&s->mdct128);
-    ff_psy_end(&s->psy);
-    if (s->psypp)
-        ff_psy_preprocess_end(s->psypp);
-    av_freep(&s->buffer.samples);
-    av_freep(&s->cpe);
-    ff_af_queue_close(&s->afq);
-    return 0;
-}
-
-static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
-{
-    int ret = 0;
-
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    // window init
-    ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
-    ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
-    ff_init_ff_sine_windows(10);
-    ff_init_ff_sine_windows(7);
-
-    if (ret = ff_mdct_init(&s->mdct1024, 11, 0, 32768.0))
-        return ret;
-    if (ret = ff_mdct_init(&s->mdct128,   8, 0, 32768.0))
-        return ret;
-
-    return 0;
-}
-
-static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
-{
-    int ch;
-    FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail);
-    FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail);
-    FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + FF_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
-
-    for(ch = 0; ch < s->channels; ch++)
-        s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch;
-
-    return 0;
-alloc_fail:
-    return AVERROR(ENOMEM);
-}
-
-static av_cold int aac_encode_init(AVCodecContext *avctx)
-{
-    AACEncContext *s = avctx->priv_data;
-    int i, ret = 0;
-    const uint8_t *sizes[2];
-    uint8_t grouping[AAC_MAX_CHANNELS];
-    int lengths[2];
-
-    avctx->frame_size = 1024;
-
-    for (i = 0; i < 16; i++)
-        if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[i])
-            break;
-
-    s->channels = avctx->channels;
-
-    ERROR_IF(i == 16,
-             "Unsupported sample rate %d\n", avctx->sample_rate);
-    ERROR_IF(s->channels > AAC_MAX_CHANNELS,
-             "Unsupported number of channels: %d\n", s->channels);
-    ERROR_IF(avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW,
-             "Unsupported profile %d\n", avctx->profile);
-    ERROR_IF(1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * s->channels,
-             "Too many bits per frame requested\n");
-
-    s->samplerate_index = i;
-
-    s->chan_map = aac_chan_configs[s->channels-1];
-
-    if (ret = dsp_init(avctx, s))
-        goto fail;
-
-    if (ret = alloc_buffers(avctx, s))
-        goto fail;
-
-    avctx->extradata_size = 5;
-    put_audio_specific_config(avctx);
-
-    sizes[0]   = swb_size_1024[i];
-    sizes[1]   = swb_size_128[i];
-    lengths[0] = ff_aac_num_swb_1024[i];
-    lengths[1] = ff_aac_num_swb_128[i];
-    for (i = 0; i < s->chan_map[0]; i++)
-        grouping[i] = s->chan_map[i + 1] == TYPE_CPE;
-    if (ret = ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], grouping))
-        goto fail;
-    s->psypp = ff_psy_preprocess_init(avctx);
-    s->coder = &ff_aac_coders[2];
-
-    s->lambda = avctx->global_quality ? avctx->global_quality : 120;
-
-    ff_aac_tableinit();
-
-    for (i = 0; i < 428; i++)
-        ff_aac_pow34sf_tab[i] = sqrt(ff_aac_pow2sf_tab[i] * sqrt(ff_aac_pow2sf_tab[i]));
-
-    avctx->delay = 1024;
-    ff_af_queue_init(avctx, &s->afq);
-
-    return 0;
-fail:
-    aac_encode_end(avctx);
-    return ret;
-}
-
-#define AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption aacenc_options[] = {
-    {"stereo_mode", "Stereo coding method", offsetof(AACEncContext, options.stereo_mode), AV_OPT_TYPE_INT, {.i64 = 0}, -1, 1, AACENC_FLAGS, "stereo_mode"},
-        {"auto",     "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
-        {"ms_off",   "Disable Mid/Side coding", 0, AV_OPT_TYPE_CONST, {.i64 =  0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
-        {"ms_force", "Force Mid/Side for the whole frame if possible", 0, AV_OPT_TYPE_CONST, {.i64 =  1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
-    {NULL}
-};
-
-static const AVClass aacenc_class = {
-    "AAC encoder",
-    av_default_item_name,
-    aacenc_options,
-    LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_aac_encoder = {
-    .name           = "aac",
-    .long_name      = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AAC,
-    .priv_data_size = sizeof(AACEncContext),
-    .init           = aac_encode_init,
-    .encode2        = aac_encode_frame,
-    .close          = aac_encode_end,
-    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY |
-                      CODEC_CAP_EXPERIMENTAL,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
-                                                     AV_SAMPLE_FMT_NONE },
-    .priv_class     = &aacenc_class,
-};
diff --git a/deps/libav/libavcodec/aacenc.h b/deps/libav/libavcodec/aacenc.h
deleted file mode 100644
index dec445c..0000000
--- a/deps/libav/libavcodec/aacenc.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * AAC encoder
- * Copyright (C) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AACENC_H
-#define AVCODEC_AACENC_H
-
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "put_bits.h"
-
-#include "aac.h"
-#include "audio_frame_queue.h"
-#include "psymodel.h"
-
-typedef struct AACEncOptions {
-    int stereo_mode;
-} AACEncOptions;
-
-struct AACEncContext;
-
-typedef struct AACCoefficientsEncoder {
-    void (*search_for_quantizers)(AVCodecContext *avctx, struct AACEncContext *s,
-                                  SingleChannelElement *sce, const float lambda);
-    void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
-                                     int win, int group_len, const float lambda);
-    void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
-                                     int scale_idx, int cb, const float lambda);
-    void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
-} AACCoefficientsEncoder;
-
-extern AACCoefficientsEncoder ff_aac_coders[];
-
-/**
- * AAC encoder context
- */
-typedef struct AACEncContext {
-    AVClass *av_class;
-    AACEncOptions options;                       ///< encoding options
-    PutBitContext pb;
-    FFTContext mdct1024;                         ///< long (1024 samples) frame transform context
-    FFTContext mdct128;                          ///< short (128 samples) frame transform context
-    AVFloatDSPContext fdsp;
-    float *planar_samples[6];                    ///< saved preprocessed input
-
-    int samplerate_index;                        ///< MPEG-4 samplerate index
-    int channels;                                ///< channel count
-    const uint8_t *chan_map;                     ///< channel configuration map
-
-    ChannelElement *cpe;                         ///< channel elements
-    FFPsyContext psy;
-    struct FFPsyPreprocessContext* psypp;
-    AACCoefficientsEncoder *coder;
-    int cur_channel;
-    int last_frame;
-    float lambda;
-    AudioFrameQueue afq;
-    DECLARE_ALIGNED(16, int,   qcoefs)[96];      ///< quantized coefficients
-    DECLARE_ALIGNED(32, float, scoefs)[1024];    ///< scaled coefficients
-
-    struct {
-        float *samples;
-    } buffer;
-} AACEncContext;
-
-extern float ff_aac_pow34sf_tab[428];
-
-#endif /* AVCODEC_AACENC_H */
diff --git a/deps/libav/libavcodec/aacps.c b/deps/libav/libavcodec/aacps.c
deleted file mode 100644
index 8f55c7f..0000000
--- a/deps/libav/libavcodec/aacps.c
+++ /dev/null
@@ -1,956 +0,0 @@
-/*
- * MPEG-4 Parametric Stereo decoding functions
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "aacps.h"
-#include "aacps_tablegen.h"
-#include "aacpsdata.c"
-
-#define PS_BASELINE 0  ///< Operate in Baseline PS mode
-                       ///< Baseline implies 10 or 20 stereo bands,
-                       ///< mixing mode A, and no ipd/opd
-
-#define numQMFSlots 32 //numTimeSlots * RATE
-
-static const int8_t num_env_tab[2][4] = {
-    { 0, 1, 2, 4, },
-    { 1, 2, 3, 4, },
-};
-
-static const int8_t nr_iidicc_par_tab[] = {
-    10, 20, 34, 10, 20, 34,
-};
-
-static const int8_t nr_iidopd_par_tab[] = {
-     5, 11, 17,  5, 11, 17,
-};
-
-enum {
-    huff_iid_df1,
-    huff_iid_dt1,
-    huff_iid_df0,
-    huff_iid_dt0,
-    huff_icc_df,
-    huff_icc_dt,
-    huff_ipd_df,
-    huff_ipd_dt,
-    huff_opd_df,
-    huff_opd_dt,
-};
-
-static const int huff_iid[] = {
-    huff_iid_df0,
-    huff_iid_df1,
-    huff_iid_dt0,
-    huff_iid_dt1,
-};
-
-static VLC vlc_ps[10];
-
-#define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION) \
-/** \
- * Read Inter-channel Intensity Difference/Inter-Channel Coherence/ \
- * Inter-channel Phase Difference/Overall Phase Difference parameters from the \
- * bitstream. \
- * \
- * @param avctx contains the current codec context \
- * @param gb    pointer to the input bitstream \
- * @param ps    pointer to the Parametric Stereo context \
- * @param PAR   pointer to the parameter to be read \
- * @param e     envelope to decode \
- * @param dt    1: time delta-coded, 0: frequency delta-coded \
- */ \
-static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, \
-                        int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
-{ \
-    int b, num = ps->nr_ ## PAR ## _par; \
-    VLC_TYPE (*vlc_table)[2] = vlc_ps[table_idx].table; \
-    if (dt) { \
-        int e_prev = e ? e - 1 : ps->num_env_old - 1; \
-        e_prev = FFMAX(e_prev, 0); \
-        for (b = 0; b < num; b++) { \
-            int val = PAR[e_prev][b] + get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \
-            if (MASK) val &= MASK; \
-            PAR[e][b] = val; \
-            if (ERR_CONDITION) \
-                goto err; \
-        } \
-    } else { \
-        int val = 0; \
-        for (b = 0; b < num; b++) { \
-            val += get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \
-            if (MASK) val &= MASK; \
-            PAR[e][b] = val; \
-            if (ERR_CONDITION) \
-                goto err; \
-        } \
-    } \
-    return 0; \
-err: \
-    av_log(avctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \
-    return -1; \
-}
-
-READ_PAR_DATA(iid,    huff_offset[table_idx],    0, FFABS(ps->iid_par[e][b]) > 7 + 8 * ps->iid_quant)
-READ_PAR_DATA(icc,    huff_offset[table_idx],    0, ps->icc_par[e][b] > 7U)
-READ_PAR_DATA(ipdopd,                      0, 0x07, 0)
-
-static int ps_read_extension_data(GetBitContext *gb, PSContext *ps, int ps_extension_id)
-{
-    int e;
-    int count = get_bits_count(gb);
-
-    if (ps_extension_id)
-        return 0;
-
-    ps->enable_ipdopd = get_bits1(gb);
-    if (ps->enable_ipdopd) {
-        for (e = 0; e < ps->num_env; e++) {
-            int dt = get_bits1(gb);
-            read_ipdopd_data(NULL, gb, ps, ps->ipd_par, dt ? huff_ipd_dt : huff_ipd_df, e, dt);
-            dt = get_bits1(gb);
-            read_ipdopd_data(NULL, gb, ps, ps->opd_par, dt ? huff_opd_dt : huff_opd_df, e, dt);
-        }
-    }
-    skip_bits1(gb);      //reserved_ps
-    return get_bits_count(gb) - count;
-}
-
-static void ipdopd_reset(int8_t *opd_hist, int8_t *ipd_hist)
-{
-    int i;
-    for (i = 0; i < PS_MAX_NR_IPDOPD; i++) {
-        opd_hist[i] = 0;
-        ipd_hist[i] = 0;
-    }
-}
-
-int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, PSContext *ps, int bits_left)
-{
-    int e;
-    int bit_count_start = get_bits_count(gb_host);
-    int header;
-    int bits_consumed;
-    GetBitContext gbc = *gb_host, *gb = &gbc;
-
-    header = get_bits1(gb);
-    if (header) {     //enable_ps_header
-        ps->enable_iid = get_bits1(gb);
-        if (ps->enable_iid) {
-            int iid_mode = get_bits(gb, 3);
-            if (iid_mode > 5) {
-                av_log(avctx, AV_LOG_ERROR, "iid_mode %d is reserved.\n",
-                       iid_mode);
-                goto err;
-            }
-            ps->nr_iid_par    = nr_iidicc_par_tab[iid_mode];
-            ps->iid_quant     = iid_mode > 2;
-            ps->nr_ipdopd_par = nr_iidopd_par_tab[iid_mode];
-        }
-        ps->enable_icc = get_bits1(gb);
-        if (ps->enable_icc) {
-            ps->icc_mode = get_bits(gb, 3);
-            if (ps->icc_mode > 5) {
-                av_log(avctx, AV_LOG_ERROR, "icc_mode %d is reserved.\n",
-                       ps->icc_mode);
-                goto err;
-            }
-            ps->nr_icc_par = nr_iidicc_par_tab[ps->icc_mode];
-        }
-        ps->enable_ext = get_bits1(gb);
-    }
-
-    ps->frame_class = get_bits1(gb);
-    ps->num_env_old = ps->num_env;
-    ps->num_env     = num_env_tab[ps->frame_class][get_bits(gb, 2)];
-
-    ps->border_position[0] = -1;
-    if (ps->frame_class) {
-        for (e = 1; e <= ps->num_env; e++)
-            ps->border_position[e] = get_bits(gb, 5);
-    } else
-        for (e = 1; e <= ps->num_env; e++)
-            ps->border_position[e] = (e * numQMFSlots >> ff_log2_tab[ps->num_env]) - 1;
-
-    if (ps->enable_iid) {
-        for (e = 0; e < ps->num_env; e++) {
-            int dt = get_bits1(gb);
-            if (read_iid_data(avctx, gb, ps, ps->iid_par, huff_iid[2*dt+ps->iid_quant], e, dt))
-                goto err;
-        }
-    } else
-        memset(ps->iid_par, 0, sizeof(ps->iid_par));
-
-    if (ps->enable_icc)
-        for (e = 0; e < ps->num_env; e++) {
-            int dt = get_bits1(gb);
-            if (read_icc_data(avctx, gb, ps, ps->icc_par, dt ? huff_icc_dt : huff_icc_df, e, dt))
-                goto err;
-        }
-    else
-        memset(ps->icc_par, 0, sizeof(ps->icc_par));
-
-    if (ps->enable_ext) {
-        int cnt = get_bits(gb, 4);
-        if (cnt == 15) {
-            cnt += get_bits(gb, 8);
-        }
-        cnt *= 8;
-        while (cnt > 7) {
-            int ps_extension_id = get_bits(gb, 2);
-            cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id);
-        }
-        if (cnt < 0) {
-            av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt);
-            goto err;
-        }
-        skip_bits(gb, cnt);
-    }
-
-    ps->enable_ipdopd &= !PS_BASELINE;
-
-    //Fix up envelopes
-    if (!ps->num_env || ps->border_position[ps->num_env] < numQMFSlots - 1) {
-        //Create a fake envelope
-        int source = ps->num_env ? ps->num_env - 1 : ps->num_env_old - 1;
-        if (source >= 0 && source != ps->num_env) {
-            if (ps->enable_iid) {
-                memcpy(ps->iid_par+ps->num_env, ps->iid_par+source, sizeof(ps->iid_par[0]));
-            }
-            if (ps->enable_icc) {
-                memcpy(ps->icc_par+ps->num_env, ps->icc_par+source, sizeof(ps->icc_par[0]));
-            }
-            if (ps->enable_ipdopd) {
-                memcpy(ps->ipd_par+ps->num_env, ps->ipd_par+source, sizeof(ps->ipd_par[0]));
-                memcpy(ps->opd_par+ps->num_env, ps->opd_par+source, sizeof(ps->opd_par[0]));
-            }
-        }
-        ps->num_env++;
-        ps->border_position[ps->num_env] = numQMFSlots - 1;
-    }
-
-
-    ps->is34bands_old = ps->is34bands;
-    if (!PS_BASELINE && (ps->enable_iid || ps->enable_icc))
-        ps->is34bands = (ps->enable_iid && ps->nr_iid_par == 34) ||
-                        (ps->enable_icc && ps->nr_icc_par == 34);
-
-    //Baseline
-    if (!ps->enable_ipdopd) {
-        memset(ps->ipd_par, 0, sizeof(ps->ipd_par));
-        memset(ps->opd_par, 0, sizeof(ps->opd_par));
-    }
-
-    if (header)
-        ps->start = 1;
-
-    bits_consumed = get_bits_count(gb) - bit_count_start;
-    if (bits_consumed <= bits_left) {
-        skip_bits_long(gb_host, bits_consumed);
-        return bits_consumed;
-    }
-    av_log(avctx, AV_LOG_ERROR, "Expected to read %d PS bits actually read %d.\n", bits_left, bits_consumed);
-err:
-    ps->start = 0;
-    skip_bits_long(gb_host, bits_left);
-    memset(ps->iid_par, 0, sizeof(ps->iid_par));
-    memset(ps->icc_par, 0, sizeof(ps->icc_par));
-    memset(ps->ipd_par, 0, sizeof(ps->ipd_par));
-    memset(ps->opd_par, 0, sizeof(ps->opd_par));
-    return bits_left;
-}
-
-/** Split one subband into 2 subsubbands with a symmetric real filter.
- * The filter must have its non-center even coefficients equal to zero. */
-static void hybrid2_re(float (*in)[2], float (*out)[32][2], const float filter[8], int len, int reverse)
-{
-    int i, j;
-    for (i = 0; i < len; i++, in++) {
-        float re_in = filter[6] * in[6][0];          //real inphase
-        float re_op = 0.0f;                          //real out of phase
-        float im_in = filter[6] * in[6][1];          //imag inphase
-        float im_op = 0.0f;                          //imag out of phase
-        for (j = 0; j < 6; j += 2) {
-            re_op += filter[j+1] * (in[j+1][0] + in[12-j-1][0]);
-            im_op += filter[j+1] * (in[j+1][1] + in[12-j-1][1]);
-        }
-        out[ reverse][i][0] = re_in + re_op;
-        out[ reverse][i][1] = im_in + im_op;
-        out[!reverse][i][0] = re_in - re_op;
-        out[!reverse][i][1] = im_in - im_op;
-    }
-}
-
-/** Split one subband into 6 subsubbands with a complex filter */
-static void hybrid6_cx(PSDSPContext *dsp, float (*in)[2], float (*out)[32][2],
-                       TABLE_CONST float (*filter)[8][2], int len)
-{
-    int i;
-    int N = 8;
-    LOCAL_ALIGNED_16(float, temp, [8], [2]);
-
-    for (i = 0; i < len; i++, in++) {
-        dsp->hybrid_analysis(temp, in, (const float (*)[8][2]) filter, 1, N);
-        out[0][i][0] = temp[6][0];
-        out[0][i][1] = temp[6][1];
-        out[1][i][0] = temp[7][0];
-        out[1][i][1] = temp[7][1];
-        out[2][i][0] = temp[0][0];
-        out[2][i][1] = temp[0][1];
-        out[3][i][0] = temp[1][0];
-        out[3][i][1] = temp[1][1];
-        out[4][i][0] = temp[2][0] + temp[5][0];
-        out[4][i][1] = temp[2][1] + temp[5][1];
-        out[5][i][0] = temp[3][0] + temp[4][0];
-        out[5][i][1] = temp[3][1] + temp[4][1];
-    }
-}
-
-static void hybrid4_8_12_cx(PSDSPContext *dsp,
-                            float (*in)[2], float (*out)[32][2],
-                            TABLE_CONST float (*filter)[8][2], int N, int len)
-{
-    int i;
-
-    for (i = 0; i < len; i++, in++) {
-        dsp->hybrid_analysis(out[0] + i, in, (const float (*)[8][2]) filter, 32, N);
-    }
-}
-
-static void hybrid_analysis(PSDSPContext *dsp, float out[91][32][2],
-                            float in[5][44][2], float L[2][38][64],
-                            int is34, int len)
-{
-    int i, j;
-    for (i = 0; i < 5; i++) {
-        for (j = 0; j < 38; j++) {
-            in[i][j+6][0] = L[0][j][i];
-            in[i][j+6][1] = L[1][j][i];
-        }
-    }
-    if (is34) {
-        hybrid4_8_12_cx(dsp, in[0], out,    f34_0_12, 12, len);
-        hybrid4_8_12_cx(dsp, in[1], out+12, f34_1_8,   8, len);
-        hybrid4_8_12_cx(dsp, in[2], out+20, f34_2_4,   4, len);
-        hybrid4_8_12_cx(dsp, in[3], out+24, f34_2_4,   4, len);
-        hybrid4_8_12_cx(dsp, in[4], out+28, f34_2_4,   4, len);
-        dsp->hybrid_analysis_ileave(out + 27, L, 5, len);
-    } else {
-        hybrid6_cx(dsp, in[0], out, f20_0_8, len);
-        hybrid2_re(in[1], out+6, g1_Q2, len, 1);
-        hybrid2_re(in[2], out+8, g1_Q2, len, 0);
-        dsp->hybrid_analysis_ileave(out + 7, L, 3, len);
-    }
-    //update in_buf
-    for (i = 0; i < 5; i++) {
-        memcpy(in[i], in[i]+32, 6 * sizeof(in[i][0]));
-    }
-}
-
-static void hybrid_synthesis(PSDSPContext *dsp, float out[2][38][64],
-                             float in[91][32][2], int is34, int len)
-{
-    int i, n;
-    if (is34) {
-        for (n = 0; n < len; n++) {
-            memset(out[0][n], 0, 5*sizeof(out[0][n][0]));
-            memset(out[1][n], 0, 5*sizeof(out[1][n][0]));
-            for (i = 0; i < 12; i++) {
-                out[0][n][0] += in[   i][n][0];
-                out[1][n][0] += in[   i][n][1];
-            }
-            for (i = 0; i < 8; i++) {
-                out[0][n][1] += in[12+i][n][0];
-                out[1][n][1] += in[12+i][n][1];
-            }
-            for (i = 0; i < 4; i++) {
-                out[0][n][2] += in[20+i][n][0];
-                out[1][n][2] += in[20+i][n][1];
-                out[0][n][3] += in[24+i][n][0];
-                out[1][n][3] += in[24+i][n][1];
-                out[0][n][4] += in[28+i][n][0];
-                out[1][n][4] += in[28+i][n][1];
-            }
-        }
-        dsp->hybrid_synthesis_deint(out, in + 27, 5, len);
-    } else {
-        for (n = 0; n < len; n++) {
-            out[0][n][0] = in[0][n][0] + in[1][n][0] + in[2][n][0] +
-                           in[3][n][0] + in[4][n][0] + in[5][n][0];
-            out[1][n][0] = in[0][n][1] + in[1][n][1] + in[2][n][1] +
-                           in[3][n][1] + in[4][n][1] + in[5][n][1];
-            out[0][n][1] = in[6][n][0] + in[7][n][0];
-            out[1][n][1] = in[6][n][1] + in[7][n][1];
-            out[0][n][2] = in[8][n][0] + in[9][n][0];
-            out[1][n][2] = in[8][n][1] + in[9][n][1];
-        }
-        dsp->hybrid_synthesis_deint(out, in + 7, 3, len);
-    }
-}
-
-/// All-pass filter decay slope
-#define DECAY_SLOPE      0.05f
-/// Number of frequency bands that can be addressed by the parameter index, b(k)
-static const int   NR_PAR_BANDS[]      = { 20, 34 };
-/// Number of frequency bands that can be addressed by the sub subband index, k
-static const int   NR_BANDS[]          = { 71, 91 };
-/// Start frequency band for the all-pass filter decay slope
-static const int   DECAY_CUTOFF[]      = { 10, 32 };
-/// Number of all-pass filer bands
-static const int   NR_ALLPASS_BANDS[]  = { 30, 50 };
-/// First stereo band using the short one sample delay
-static const int   SHORT_DELAY_BAND[]  = { 42, 62 };
-
-/** Table 8.46 */
-static void map_idx_10_to_20(int8_t *par_mapped, const int8_t *par, int full)
-{
-    int b;
-    if (full)
-        b = 9;
-    else {
-        b = 4;
-        par_mapped[10] = 0;
-    }
-    for (; b >= 0; b--) {
-        par_mapped[2*b+1] = par_mapped[2*b] = par[b];
-    }
-}
-
-static void map_idx_34_to_20(int8_t *par_mapped, const int8_t *par, int full)
-{
-    par_mapped[ 0] = (2*par[ 0] +   par[ 1]) / 3;
-    par_mapped[ 1] = (  par[ 1] + 2*par[ 2]) / 3;
-    par_mapped[ 2] = (2*par[ 3] +   par[ 4]) / 3;
-    par_mapped[ 3] = (  par[ 4] + 2*par[ 5]) / 3;
-    par_mapped[ 4] = (  par[ 6] +   par[ 7]) / 2;
-    par_mapped[ 5] = (  par[ 8] +   par[ 9]) / 2;
-    par_mapped[ 6] =    par[10];
-    par_mapped[ 7] =    par[11];
-    par_mapped[ 8] = (  par[12] +   par[13]) / 2;
-    par_mapped[ 9] = (  par[14] +   par[15]) / 2;
-    par_mapped[10] =    par[16];
-    if (full) {
-        par_mapped[11] =    par[17];
-        par_mapped[12] =    par[18];
-        par_mapped[13] =    par[19];
-        par_mapped[14] = (  par[20] +   par[21]) / 2;
-        par_mapped[15] = (  par[22] +   par[23]) / 2;
-        par_mapped[16] = (  par[24] +   par[25]) / 2;
-        par_mapped[17] = (  par[26] +   par[27]) / 2;
-        par_mapped[18] = (  par[28] +   par[29] +   par[30] +   par[31]) / 4;
-        par_mapped[19] = (  par[32] +   par[33]) / 2;
-    }
-}
-
-static void map_val_34_to_20(float par[PS_MAX_NR_IIDICC])
-{
-    par[ 0] = (2*par[ 0] +   par[ 1]) * 0.33333333f;
-    par[ 1] = (  par[ 1] + 2*par[ 2]) * 0.33333333f;
-    par[ 2] = (2*par[ 3] +   par[ 4]) * 0.33333333f;
-    par[ 3] = (  par[ 4] + 2*par[ 5]) * 0.33333333f;
-    par[ 4] = (  par[ 6] +   par[ 7]) * 0.5f;
-    par[ 5] = (  par[ 8] +   par[ 9]) * 0.5f;
-    par[ 6] =    par[10];
-    par[ 7] =    par[11];
-    par[ 8] = (  par[12] +   par[13]) * 0.5f;
-    par[ 9] = (  par[14] +   par[15]) * 0.5f;
-    par[10] =    par[16];
-    par[11] =    par[17];
-    par[12] =    par[18];
-    par[13] =    par[19];
-    par[14] = (  par[20] +   par[21]) * 0.5f;
-    par[15] = (  par[22] +   par[23]) * 0.5f;
-    par[16] = (  par[24] +   par[25]) * 0.5f;
-    par[17] = (  par[26] +   par[27]) * 0.5f;
-    par[18] = (  par[28] +   par[29] +   par[30] +   par[31]) * 0.25f;
-    par[19] = (  par[32] +   par[33]) * 0.5f;
-}
-
-static void map_idx_10_to_34(int8_t *par_mapped, const int8_t *par, int full)
-{
-    if (full) {
-        par_mapped[33] = par[9];
-        par_mapped[32] = par[9];
-        par_mapped[31] = par[9];
-        par_mapped[30] = par[9];
-        par_mapped[29] = par[9];
-        par_mapped[28] = par[9];
-        par_mapped[27] = par[8];
-        par_mapped[26] = par[8];
-        par_mapped[25] = par[8];
-        par_mapped[24] = par[8];
-        par_mapped[23] = par[7];
-        par_mapped[22] = par[7];
-        par_mapped[21] = par[7];
-        par_mapped[20] = par[7];
-        par_mapped[19] = par[6];
-        par_mapped[18] = par[6];
-        par_mapped[17] = par[5];
-        par_mapped[16] = par[5];
-    } else {
-        par_mapped[16] =      0;
-    }
-    par_mapped[15] = par[4];
-    par_mapped[14] = par[4];
-    par_mapped[13] = par[4];
-    par_mapped[12] = par[4];
-    par_mapped[11] = par[3];
-    par_mapped[10] = par[3];
-    par_mapped[ 9] = par[2];
-    par_mapped[ 8] = par[2];
-    par_mapped[ 7] = par[2];
-    par_mapped[ 6] = par[2];
-    par_mapped[ 5] = par[1];
-    par_mapped[ 4] = par[1];
-    par_mapped[ 3] = par[1];
-    par_mapped[ 2] = par[0];
-    par_mapped[ 1] = par[0];
-    par_mapped[ 0] = par[0];
-}
-
-static void map_idx_20_to_34(int8_t *par_mapped, const int8_t *par, int full)
-{
-    if (full) {
-        par_mapped[33] =  par[19];
-        par_mapped[32] =  par[19];
-        par_mapped[31] =  par[18];
-        par_mapped[30] =  par[18];
-        par_mapped[29] =  par[18];
-        par_mapped[28] =  par[18];
-        par_mapped[27] =  par[17];
-        par_mapped[26] =  par[17];
-        par_mapped[25] =  par[16];
-        par_mapped[24] =  par[16];
-        par_mapped[23] =  par[15];
-        par_mapped[22] =  par[15];
-        par_mapped[21] =  par[14];
-        par_mapped[20] =  par[14];
-        par_mapped[19] =  par[13];
-        par_mapped[18] =  par[12];
-        par_mapped[17] =  par[11];
-    }
-    par_mapped[16] =  par[10];
-    par_mapped[15] =  par[ 9];
-    par_mapped[14] =  par[ 9];
-    par_mapped[13] =  par[ 8];
-    par_mapped[12] =  par[ 8];
-    par_mapped[11] =  par[ 7];
-    par_mapped[10] =  par[ 6];
-    par_mapped[ 9] =  par[ 5];
-    par_mapped[ 8] =  par[ 5];
-    par_mapped[ 7] =  par[ 4];
-    par_mapped[ 6] =  par[ 4];
-    par_mapped[ 5] =  par[ 3];
-    par_mapped[ 4] = (par[ 2] + par[ 3]) / 2;
-    par_mapped[ 3] =  par[ 2];
-    par_mapped[ 2] =  par[ 1];
-    par_mapped[ 1] = (par[ 0] + par[ 1]) / 2;
-    par_mapped[ 0] =  par[ 0];
-}
-
-static void map_val_20_to_34(float par[PS_MAX_NR_IIDICC])
-{
-    par[33] =  par[19];
-    par[32] =  par[19];
-    par[31] =  par[18];
-    par[30] =  par[18];
-    par[29] =  par[18];
-    par[28] =  par[18];
-    par[27] =  par[17];
-    par[26] =  par[17];
-    par[25] =  par[16];
-    par[24] =  par[16];
-    par[23] =  par[15];
-    par[22] =  par[15];
-    par[21] =  par[14];
-    par[20] =  par[14];
-    par[19] =  par[13];
-    par[18] =  par[12];
-    par[17] =  par[11];
-    par[16] =  par[10];
-    par[15] =  par[ 9];
-    par[14] =  par[ 9];
-    par[13] =  par[ 8];
-    par[12] =  par[ 8];
-    par[11] =  par[ 7];
-    par[10] =  par[ 6];
-    par[ 9] =  par[ 5];
-    par[ 8] =  par[ 5];
-    par[ 7] =  par[ 4];
-    par[ 6] =  par[ 4];
-    par[ 5] =  par[ 3];
-    par[ 4] = (par[ 2] + par[ 3]) * 0.5f;
-    par[ 3] =  par[ 2];
-    par[ 2] =  par[ 1];
-    par[ 1] = (par[ 0] + par[ 1]) * 0.5f;
-    par[ 0] =  par[ 0];
-}
-
-static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[32][2], int is34)
-{
-    LOCAL_ALIGNED_16(float, power, [34], [PS_QMF_TIME_SLOTS]);
-    LOCAL_ALIGNED_16(float, transient_gain, [34], [PS_QMF_TIME_SLOTS]);
-    float *peak_decay_nrg = ps->peak_decay_nrg;
-    float *power_smooth = ps->power_smooth;
-    float *peak_decay_diff_smooth = ps->peak_decay_diff_smooth;
-    float (*delay)[PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2] = ps->delay;
-    float (*ap_delay)[PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2] = ps->ap_delay;
-    const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
-    const float peak_decay_factor = 0.76592833836465f;
-    const float transient_impact  = 1.5f;
-    const float a_smooth          = 0.25f; ///< Smoothing coefficient
-    int i, k, m, n;
-    int n0 = 0, nL = 32;
-
-    memset(power, 0, 34 * sizeof(*power));
-
-    if (is34 != ps->is34bands_old) {
-        memset(ps->peak_decay_nrg,         0, sizeof(ps->peak_decay_nrg));
-        memset(ps->power_smooth,           0, sizeof(ps->power_smooth));
-        memset(ps->peak_decay_diff_smooth, 0, sizeof(ps->peak_decay_diff_smooth));
-        memset(ps->delay,                  0, sizeof(ps->delay));
-        memset(ps->ap_delay,               0, sizeof(ps->ap_delay));
-    }
-
-    for (k = 0; k < NR_BANDS[is34]; k++) {
-        int i = k_to_i[k];
-        ps->dsp.add_squares(power[i], s[k], nL - n0);
-    }
-
-    //Transient detection
-    for (i = 0; i < NR_PAR_BANDS[is34]; i++) {
-        for (n = n0; n < nL; n++) {
-            float decayed_peak = peak_decay_factor * peak_decay_nrg[i];
-            float denom;
-            peak_decay_nrg[i] = FFMAX(decayed_peak, power[i][n]);
-            power_smooth[i] += a_smooth * (power[i][n] - power_smooth[i]);
-            peak_decay_diff_smooth[i] += a_smooth * (peak_decay_nrg[i] - power[i][n] - peak_decay_diff_smooth[i]);
-            denom = transient_impact * peak_decay_diff_smooth[i];
-            transient_gain[i][n]   = (denom > power_smooth[i]) ?
-                                         power_smooth[i] / denom : 1.0f;
-        }
-    }
-
-    //Decorrelation and transient reduction
-    //                         PS_AP_LINKS - 1
-    //                               -----
-    //                                | |  Q_fract_allpass[k][m]*z^-link_delay[m] - a[m]*g_decay_slope[k]
-    //H[k][z] = z^-2 * phi_fract[k] * | | ----------------------------------------------------------------
-    //                                | | 1 - a[m]*g_decay_slope[k]*Q_fract_allpass[k][m]*z^-link_delay[m]
-    //                               m = 0
-    //d[k][z] (out) = transient_gain_mapped[k][z] * H[k][z] * s[k][z]
-    for (k = 0; k < NR_ALLPASS_BANDS[is34]; k++) {
-        int b = k_to_i[k];
-        float g_decay_slope = 1.f - DECAY_SLOPE * (k - DECAY_CUTOFF[is34]);
-        g_decay_slope = av_clipf(g_decay_slope, 0.f, 1.f);
-        memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0]));
-        memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0]));
-        for (m = 0; m < PS_AP_LINKS; m++) {
-            memcpy(ap_delay[k][m],   ap_delay[k][m]+numQMFSlots,           5*sizeof(ap_delay[k][m][0]));
-        }
-        ps->dsp.decorrelate(out[k], delay[k] + PS_MAX_DELAY - 2, ap_delay[k],
-                            phi_fract[is34][k],
-                            (const float (*)[2]) Q_fract_allpass[is34][k],
-                            transient_gain[b], g_decay_slope, nL - n0);
-    }
-    for (; k < SHORT_DELAY_BAND[is34]; k++) {
-        int i = k_to_i[k];
-        memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0]));
-        memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0]));
-        //H = delay 14
-        ps->dsp.mul_pair_single(out[k], delay[k] + PS_MAX_DELAY - 14,
-                                transient_gain[i], nL - n0);
-    }
-    for (; k < NR_BANDS[is34]; k++) {
-        int i = k_to_i[k];
-        memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0]));
-        memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0]));
-        //H = delay 1
-        ps->dsp.mul_pair_single(out[k], delay[k] + PS_MAX_DELAY - 1,
-                                transient_gain[i], nL - n0);
-    }
-}
-
-static void remap34(int8_t (**p_par_mapped)[PS_MAX_NR_IIDICC],
-                    int8_t           (*par)[PS_MAX_NR_IIDICC],
-                    int num_par, int num_env, int full)
-{
-    int8_t (*par_mapped)[PS_MAX_NR_IIDICC] = *p_par_mapped;
-    int e;
-    if (num_par == 20 || num_par == 11) {
-        for (e = 0; e < num_env; e++) {
-            map_idx_20_to_34(par_mapped[e], par[e], full);
-        }
-    } else if (num_par == 10 || num_par == 5) {
-        for (e = 0; e < num_env; e++) {
-            map_idx_10_to_34(par_mapped[e], par[e], full);
-        }
-    } else {
-        *p_par_mapped = par;
-    }
-}
-
-static void remap20(int8_t (**p_par_mapped)[PS_MAX_NR_IIDICC],
-                    int8_t           (*par)[PS_MAX_NR_IIDICC],
-                    int num_par, int num_env, int full)
-{
-    int8_t (*par_mapped)[PS_MAX_NR_IIDICC] = *p_par_mapped;
-    int e;
-    if (num_par == 34 || num_par == 17) {
-        for (e = 0; e < num_env; e++) {
-            map_idx_34_to_20(par_mapped[e], par[e], full);
-        }
-    } else if (num_par == 10 || num_par == 5) {
-        for (e = 0; e < num_env; e++) {
-            map_idx_10_to_20(par_mapped[e], par[e], full);
-        }
-    } else {
-        *p_par_mapped = par;
-    }
-}
-
-static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2], int is34)
-{
-    int e, b, k;
-
-    float (*H11)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H11;
-    float (*H12)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H12;
-    float (*H21)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H21;
-    float (*H22)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H22;
-    int8_t *opd_hist = ps->opd_hist;
-    int8_t *ipd_hist = ps->ipd_hist;
-    int8_t iid_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
-    int8_t icc_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
-    int8_t ipd_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
-    int8_t opd_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
-    int8_t (*iid_mapped)[PS_MAX_NR_IIDICC] = iid_mapped_buf;
-    int8_t (*icc_mapped)[PS_MAX_NR_IIDICC] = icc_mapped_buf;
-    int8_t (*ipd_mapped)[PS_MAX_NR_IIDICC] = ipd_mapped_buf;
-    int8_t (*opd_mapped)[PS_MAX_NR_IIDICC] = opd_mapped_buf;
-    const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
-    TABLE_CONST float (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB;
-
-    //Remapping
-    if (ps->num_env_old) {
-        memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));
-        memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));
-        memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));
-        memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));
-        memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));
-        memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));
-        memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));
-        memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
-    }
-
-    if (is34) {
-        remap34(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
-        remap34(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);
-        if (ps->enable_ipdopd) {
-            remap34(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0);
-            remap34(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0);
-        }
-        if (!ps->is34bands_old) {
-            map_val_20_to_34(H11[0][0]);
-            map_val_20_to_34(H11[1][0]);
-            map_val_20_to_34(H12[0][0]);
-            map_val_20_to_34(H12[1][0]);
-            map_val_20_to_34(H21[0][0]);
-            map_val_20_to_34(H21[1][0]);
-            map_val_20_to_34(H22[0][0]);
-            map_val_20_to_34(H22[1][0]);
-            ipdopd_reset(ipd_hist, opd_hist);
-        }
-    } else {
-        remap20(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
-        remap20(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);
-        if (ps->enable_ipdopd) {
-            remap20(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0);
-            remap20(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0);
-        }
-        if (ps->is34bands_old) {
-            map_val_34_to_20(H11[0][0]);
-            map_val_34_to_20(H11[1][0]);
-            map_val_34_to_20(H12[0][0]);
-            map_val_34_to_20(H12[1][0]);
-            map_val_34_to_20(H21[0][0]);
-            map_val_34_to_20(H21[1][0]);
-            map_val_34_to_20(H22[0][0]);
-            map_val_34_to_20(H22[1][0]);
-            ipdopd_reset(ipd_hist, opd_hist);
-        }
-    }
-
-    //Mixing
-    for (e = 0; e < ps->num_env; e++) {
-        for (b = 0; b < NR_PAR_BANDS[is34]; b++) {
-            float h11, h12, h21, h22;
-            h11 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][0];
-            h12 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][1];
-            h21 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][2];
-            h22 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][3];
-            if (!PS_BASELINE && ps->enable_ipdopd && b < ps->nr_ipdopd_par) {
-                //The spec say says to only run this smoother when enable_ipdopd
-                //is set but the reference decoder appears to run it constantly
-                float h11i, h12i, h21i, h22i;
-                float ipd_adj_re, ipd_adj_im;
-                int opd_idx = opd_hist[b] * 8 + opd_mapped[e][b];
-                int ipd_idx = ipd_hist[b] * 8 + ipd_mapped[e][b];
-                float opd_re = pd_re_smooth[opd_idx];
-                float opd_im = pd_im_smooth[opd_idx];
-                float ipd_re = pd_re_smooth[ipd_idx];
-                float ipd_im = pd_im_smooth[ipd_idx];
-                opd_hist[b] = opd_idx & 0x3F;
-                ipd_hist[b] = ipd_idx & 0x3F;
-
-                ipd_adj_re = opd_re*ipd_re + opd_im*ipd_im;
-                ipd_adj_im = opd_im*ipd_re - opd_re*ipd_im;
-                h11i = h11 * opd_im;
-                h11  = h11 * opd_re;
-                h12i = h12 * ipd_adj_im;
-                h12  = h12 * ipd_adj_re;
-                h21i = h21 * opd_im;
-                h21  = h21 * opd_re;
-                h22i = h22 * ipd_adj_im;
-                h22  = h22 * ipd_adj_re;
-                H11[1][e+1][b] = h11i;
-                H12[1][e+1][b] = h12i;
-                H21[1][e+1][b] = h21i;
-                H22[1][e+1][b] = h22i;
-            }
-            H11[0][e+1][b] = h11;
-            H12[0][e+1][b] = h12;
-            H21[0][e+1][b] = h21;
-            H22[0][e+1][b] = h22;
-        }
-        for (k = 0; k < NR_BANDS[is34]; k++) {
-            float h[2][4];
-            float h_step[2][4];
-            int start = ps->border_position[e];
-            int stop  = ps->border_position[e+1];
-            float width = 1.f / (stop - start);
-            b = k_to_i[k];
-            h[0][0] = H11[0][e][b];
-            h[0][1] = H12[0][e][b];
-            h[0][2] = H21[0][e][b];
-            h[0][3] = H22[0][e][b];
-            if (!PS_BASELINE && ps->enable_ipdopd) {
-            //Is this necessary? ps_04_new seems unchanged
-            if ((is34 && k <= 13 && k >= 9) || (!is34 && k <= 1)) {
-                h[1][0] = -H11[1][e][b];
-                h[1][1] = -H12[1][e][b];
-                h[1][2] = -H21[1][e][b];
-                h[1][3] = -H22[1][e][b];
-            } else {
-                h[1][0] = H11[1][e][b];
-                h[1][1] = H12[1][e][b];
-                h[1][2] = H21[1][e][b];
-                h[1][3] = H22[1][e][b];
-            }
-            }
-            //Interpolation
-            h_step[0][0] = (H11[0][e+1][b] - h[0][0]) * width;
-            h_step[0][1] = (H12[0][e+1][b] - h[0][1]) * width;
-            h_step[0][2] = (H21[0][e+1][b] - h[0][2]) * width;
-            h_step[0][3] = (H22[0][e+1][b] - h[0][3]) * width;
-            if (!PS_BASELINE && ps->enable_ipdopd) {
-                h_step[1][0] = (H11[1][e+1][b] - h[1][0]) * width;
-                h_step[1][1] = (H12[1][e+1][b] - h[1][1]) * width;
-                h_step[1][2] = (H21[1][e+1][b] - h[1][2]) * width;
-                h_step[1][3] = (H22[1][e+1][b] - h[1][3]) * width;
-            }
-            ps->dsp.stereo_interpolate[!PS_BASELINE && ps->enable_ipdopd](
-                l[k] + start + 1, r[k] + start + 1,
-                h, h_step, stop - start);
-        }
-    }
-}
-
-int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top)
-{
-    LOCAL_ALIGNED_16(float, Lbuf, [91], [32][2]);
-    LOCAL_ALIGNED_16(float, Rbuf, [91], [32][2]);
-    const int len = 32;
-    int is34 = ps->is34bands;
-
-    top += NR_BANDS[is34] - 64;
-    memset(ps->delay+top, 0, (NR_BANDS[is34] - top)*sizeof(ps->delay[0]));
-    if (top < NR_ALLPASS_BANDS[is34])
-        memset(ps->ap_delay + top, 0, (NR_ALLPASS_BANDS[is34] - top)*sizeof(ps->ap_delay[0]));
-
-    hybrid_analysis(&ps->dsp, Lbuf, ps->in_buf, L, is34, len);
-    decorrelation(ps, Rbuf, (const float (*)[32][2]) Lbuf, is34);
-    stereo_processing(ps, Lbuf, Rbuf, is34);
-    hybrid_synthesis(&ps->dsp, L, Lbuf, is34, len);
-    hybrid_synthesis(&ps->dsp, R, Rbuf, is34, len);
-
-    return 0;
-}
-
-#define PS_INIT_VLC_STATIC(num, size) \
-    INIT_VLC_STATIC(&vlc_ps[num], 9, ps_tmp[num].table_size / ps_tmp[num].elem_size,    \
-                    ps_tmp[num].ps_bits, 1, 1,                                          \
-                    ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \
-                    size);
-
-#define PS_VLC_ROW(name) \
-    { name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
-
-av_cold void ff_ps_init(void) {
-    // Syntax initialization
-    static const struct {
-        const void *ps_codes, *ps_bits;
-        const unsigned int table_size, elem_size;
-    } ps_tmp[] = {
-        PS_VLC_ROW(huff_iid_df1),
-        PS_VLC_ROW(huff_iid_dt1),
-        PS_VLC_ROW(huff_iid_df0),
-        PS_VLC_ROW(huff_iid_dt0),
-        PS_VLC_ROW(huff_icc_df),
-        PS_VLC_ROW(huff_icc_dt),
-        PS_VLC_ROW(huff_ipd_df),
-        PS_VLC_ROW(huff_ipd_dt),
-        PS_VLC_ROW(huff_opd_df),
-        PS_VLC_ROW(huff_opd_dt),
-    };
-
-    PS_INIT_VLC_STATIC(0, 1544);
-    PS_INIT_VLC_STATIC(1,  832);
-    PS_INIT_VLC_STATIC(2, 1024);
-    PS_INIT_VLC_STATIC(3, 1036);
-    PS_INIT_VLC_STATIC(4,  544);
-    PS_INIT_VLC_STATIC(5,  544);
-    PS_INIT_VLC_STATIC(6,  512);
-    PS_INIT_VLC_STATIC(7,  512);
-    PS_INIT_VLC_STATIC(8,  512);
-    PS_INIT_VLC_STATIC(9,  512);
-
-    ps_tableinit();
-}
-
-av_cold void ff_ps_ctx_init(PSContext *ps)
-{
-    ff_psdsp_init(&ps->dsp);
-}
diff --git a/deps/libav/libavcodec/aacps.h b/deps/libav/libavcodec/aacps.h
deleted file mode 100644
index e8a195a..0000000
--- a/deps/libav/libavcodec/aacps.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * MPEG-4 Parametric Stereo definitions and declarations
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PS_H
-#define AVCODEC_PS_H
-
-#include <stdint.h>
-
-#include "aacpsdsp.h"
-#include "avcodec.h"
-#include "get_bits.h"
-
-#define PS_MAX_NUM_ENV 5
-#define PS_MAX_NR_IIDICC 34
-#define PS_MAX_NR_IPDOPD 17
-#define PS_MAX_SSB 91
-#define PS_MAX_AP_BANDS 50
-#define PS_QMF_TIME_SLOTS 32
-#define PS_MAX_DELAY 14
-#define PS_AP_LINKS 3
-#define PS_MAX_AP_DELAY 5
-
-typedef struct PSContext {
-    int    start;
-    int    enable_iid;
-    int    iid_quant;
-    int    nr_iid_par;
-    int    nr_ipdopd_par;
-    int    enable_icc;
-    int    icc_mode;
-    int    nr_icc_par;
-    int    enable_ext;
-    int    frame_class;
-    int    num_env_old;
-    int    num_env;
-    int    enable_ipdopd;
-    int    border_position[PS_MAX_NUM_ENV+1];
-    int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Intensity Difference Parameters
-    int8_t icc_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-Channel Coherence Parameters
-    /* ipd/opd is iid/icc sized so that the same functions can handle both */
-    int8_t ipd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Phase Difference Parameters
-    int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Overall Phase Difference Parameters
-    int    is34bands;
-    int    is34bands_old;
-
-    DECLARE_ALIGNED(16, float, in_buf)[5][44][2];
-    DECLARE_ALIGNED(16, float, delay)[PS_MAX_SSB][PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2];
-    DECLARE_ALIGNED(16, float, ap_delay)[PS_MAX_AP_BANDS][PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2];
-    DECLARE_ALIGNED(16, float, peak_decay_nrg)[34];
-    DECLARE_ALIGNED(16, float, power_smooth)[34];
-    DECLARE_ALIGNED(16, float, peak_decay_diff_smooth)[34];
-    DECLARE_ALIGNED(16, float, H11)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
-    DECLARE_ALIGNED(16, float, H12)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
-    DECLARE_ALIGNED(16, float, H21)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
-    DECLARE_ALIGNED(16, float, H22)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
-    int8_t opd_hist[PS_MAX_NR_IIDICC];
-    int8_t ipd_hist[PS_MAX_NR_IIDICC];
-    PSDSPContext dsp;
-} PSContext;
-
-void ff_ps_init(void);
-void ff_ps_ctx_init(PSContext *ps);
-int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, int bits_left);
-int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top);
-
-#endif /* AVCODEC_PS_H */
diff --git a/deps/libav/libavcodec/aacps_tablegen.c b/deps/libav/libavcodec/aacps_tablegen.c
deleted file mode 100644
index 537b6ba..0000000
--- a/deps/libav/libavcodec/aacps_tablegen.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Generate a header file for hardcoded Parametric Stereo tables
- *
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#include "aacps_tablegen.h"
-#include "tableprint.h"
-
-void write_float_3d_array (const void *p, int b, int c, int d)
-{
-    int i;
-    const float *f = p;
-    for (i = 0; i < b; i++) {
-        printf("{\n");
-        write_float_2d_array(f, c, d);
-        printf("},\n");
-        f += c * d;
-    }
-}
-
-void write_float_4d_array (const void *p, int a, int b, int c, int d)
-{
-    int i;
-    const float *f = p;
-    for (i = 0; i < a; i++) {
-        printf("{\n");
-        write_float_3d_array(f, b, c, d);
-        printf("},\n");
-        f += b * c * d;
-    }
-}
-
-int main(void)
-{
-    ps_tableinit();
-
-    write_fileheader();
-
-    printf("static const float pd_re_smooth[8*8*8] = {\n");
-    write_float_array(pd_re_smooth, 8*8*8);
-    printf("};\n");
-    printf("static const float pd_im_smooth[8*8*8] = {\n");
-    write_float_array(pd_im_smooth, 8*8*8);
-    printf("};\n");
-
-    printf("static const float HA[46][8][4] = {\n");
-    write_float_3d_array(HA, 46, 8, 4);
-    printf("};\n");
-    printf("static const float HB[46][8][4] = {\n");
-    write_float_3d_array(HB, 46, 8, 4);
-    printf("};\n");
-
-    printf("static const DECLARE_ALIGNED(16, float, f20_0_8)[8][8][2] = {\n");
-    write_float_3d_array(f20_0_8, 8, 8, 2);
-    printf("};\n");
-    printf("static const DECLARE_ALIGNED(16, float, f34_0_12)[12][8][2] = {\n");
-    write_float_3d_array(f34_0_12, 12, 8, 2);
-    printf("};\n");
-    printf("static const DECLARE_ALIGNED(16, float, f34_1_8)[8][8][2] = {\n");
-    write_float_3d_array(f34_1_8, 8, 8, 2);
-    printf("};\n");
-    printf("static const DECLARE_ALIGNED(16, float, f34_2_4)[4][8][2] = {\n");
-    write_float_3d_array(f34_2_4, 4, 8, 2);
-    printf("};\n");
-
-    printf("static TABLE_CONST DECLARE_ALIGNED(16, float, Q_fract_allpass)[2][50][3][2] = {\n");
-    write_float_4d_array(Q_fract_allpass, 2, 50, 3, 2);
-    printf("};\n");
-    printf("static const DECLARE_ALIGNED(16, float, phi_fract)[2][50][2] = {\n");
-    write_float_3d_array(phi_fract, 2, 50, 2);
-    printf("};\n");
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/aacps_tablegen.h b/deps/libav/libavcodec/aacps_tablegen.h
deleted file mode 100644
index a53f9fa..0000000
--- a/deps/libav/libavcodec/aacps_tablegen.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Header file for hardcoded Parametric Stereo tables
- *
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AACPS_TABLEGEN_H
-#define AACPS_TABLEGEN_H
-
-#include <math.h>
-#include <stdint.h>
-
-#if CONFIG_HARDCODED_TABLES
-#define ps_tableinit()
-#define TABLE_CONST const
-#include "libavcodec/aacps_tables.h"
-#else
-#include "libavutil/common.h"
-#include "libavutil/libm.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/mem.h"
-#define NR_ALLPASS_BANDS20 30
-#define NR_ALLPASS_BANDS34 50
-#define PS_AP_LINKS 3
-#define TABLE_CONST
-static float pd_re_smooth[8*8*8];
-static float pd_im_smooth[8*8*8];
-static float HA[46][8][4];
-static float HB[46][8][4];
-static DECLARE_ALIGNED(16, float, f20_0_8) [ 8][8][2];
-static DECLARE_ALIGNED(16, float, f34_0_12)[12][8][2];
-static DECLARE_ALIGNED(16, float, f34_1_8) [ 8][8][2];
-static DECLARE_ALIGNED(16, float, f34_2_4) [ 4][8][2];
-static TABLE_CONST DECLARE_ALIGNED(16, float, Q_fract_allpass)[2][50][3][2];
-static DECLARE_ALIGNED(16, float, phi_fract)[2][50][2];
-
-static const float g0_Q8[] = {
-    0.00746082949812f, 0.02270420949825f, 0.04546865930473f, 0.07266113929591f,
-    0.09885108575264f, 0.11793710567217f, 0.125f
-};
-
-static const float g0_Q12[] = {
-    0.04081179924692f, 0.03812810994926f, 0.05144908135699f, 0.06399831151592f,
-    0.07428313801106f, 0.08100347892914f, 0.08333333333333f
-};
-
-static const float g1_Q8[] = {
-    0.01565675600122f, 0.03752716391991f, 0.05417891378782f, 0.08417044116767f,
-    0.10307344158036f, 0.12222452249753f, 0.125f
-};
-
-static const float g2_Q4[] = {
-    -0.05908211155639f, -0.04871498374946f, 0.0f,   0.07778723915851f,
-     0.16486303567403f,  0.23279856662996f, 0.25f
-};
-
-static void make_filters_from_proto(float (*filter)[8][2], const float *proto, int bands)
-{
-    int q, n;
-    for (q = 0; q < bands; q++) {
-        for (n = 0; n < 7; n++) {
-            double theta = 2 * M_PI * (q + 0.5) * (n - 6) / bands;
-            filter[q][n][0] = proto[n] *  cos(theta);
-            filter[q][n][1] = proto[n] * -sin(theta);
-        }
-    }
-}
-
-static void ps_tableinit(void)
-{
-    static const float ipdopd_sin[] = { 0, M_SQRT1_2, 1,  M_SQRT1_2,  0, -M_SQRT1_2, -1, -M_SQRT1_2 };
-    static const float ipdopd_cos[] = { 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2,  0,  M_SQRT1_2 };
-    int pd0, pd1, pd2;
-
-    static const float iid_par_dequant[] = {
-        //iid_par_dequant_default
-        0.05623413251903, 0.12589254117942, 0.19952623149689, 0.31622776601684,
-        0.44668359215096, 0.63095734448019, 0.79432823472428, 1,
-        1.25892541179417, 1.58489319246111, 2.23872113856834, 3.16227766016838,
-        5.01187233627272, 7.94328234724282, 17.7827941003892,
-        //iid_par_dequant_fine
-        0.00316227766017, 0.00562341325190, 0.01,             0.01778279410039,
-        0.03162277660168, 0.05623413251903, 0.07943282347243, 0.11220184543020,
-        0.15848931924611, 0.22387211385683, 0.31622776601684, 0.39810717055350,
-        0.50118723362727, 0.63095734448019, 0.79432823472428, 1,
-        1.25892541179417, 1.58489319246111, 1.99526231496888, 2.51188643150958,
-        3.16227766016838, 4.46683592150963, 6.30957344480193, 8.91250938133745,
-        12.5892541179417, 17.7827941003892, 31.6227766016838, 56.2341325190349,
-        100,              177.827941003892, 316.227766016837,
-    };
-    static const float icc_invq[] = {
-        1, 0.937,      0.84118,    0.60092,    0.36764,   0,      -0.589,    -1
-    };
-    static const float acos_icc_invq[] = {
-        0, 0.35685527, 0.57133466, 0.92614472, 1.1943263, M_PI/2, 2.2006171, M_PI
-    };
-    int iid, icc;
-
-    int k, m;
-    static const int8_t f_center_20[] = {
-        -3, -1, 1, 3, 5, 7, 10, 14, 18, 22,
-    };
-    static const int8_t f_center_34[] = {
-         2,  6, 10, 14, 18, 22, 26, 30,
-        34,-10, -6, -2, 51, 57, 15, 21,
-        27, 33, 39, 45, 54, 66, 78, 42,
-       102, 66, 78, 90,102,114,126, 90,
-    };
-    static const float fractional_delay_links[] = { 0.43f, 0.75f, 0.347f };
-    const float fractional_delay_gain = 0.39f;
-
-    for (pd0 = 0; pd0 < 8; pd0++) {
-        float pd0_re = ipdopd_cos[pd0];
-        float pd0_im = ipdopd_sin[pd0];
-        for (pd1 = 0; pd1 < 8; pd1++) {
-            float pd1_re = ipdopd_cos[pd1];
-            float pd1_im = ipdopd_sin[pd1];
-            for (pd2 = 0; pd2 < 8; pd2++) {
-                float pd2_re = ipdopd_cos[pd2];
-                float pd2_im = ipdopd_sin[pd2];
-                float re_smooth = 0.25f * pd0_re + 0.5f * pd1_re + pd2_re;
-                float im_smooth = 0.25f * pd0_im + 0.5f * pd1_im + pd2_im;
-                float pd_mag = 1 / sqrt(im_smooth * im_smooth + re_smooth * re_smooth);
-                pd_re_smooth[pd0*64+pd1*8+pd2] = re_smooth * pd_mag;
-                pd_im_smooth[pd0*64+pd1*8+pd2] = im_smooth * pd_mag;
-            }
-        }
-    }
-
-    for (iid = 0; iid < 46; iid++) {
-        float c = iid_par_dequant[iid]; ///< Linear Inter-channel Intensity Difference
-        float c1 = (float)M_SQRT2 / sqrtf(1.0f + c*c);
-        float c2 = c * c1;
-        for (icc = 0; icc < 8; icc++) {
-            /*if (PS_BASELINE || ps->icc_mode < 3)*/ {
-                float alpha = 0.5f * acos_icc_invq[icc];
-                float beta  = alpha * (c1 - c2) * (float)M_SQRT1_2;
-                HA[iid][icc][0] = c2 * cosf(beta + alpha);
-                HA[iid][icc][1] = c1 * cosf(beta - alpha);
-                HA[iid][icc][2] = c2 * sinf(beta + alpha);
-                HA[iid][icc][3] = c1 * sinf(beta - alpha);
-            } /* else */ {
-                float alpha, gamma, mu, rho;
-                float alpha_c, alpha_s, gamma_c, gamma_s;
-                rho = FFMAX(icc_invq[icc], 0.05f);
-                alpha = 0.5f * atan2f(2.0f * c * rho, c*c - 1.0f);
-                mu = c + 1.0f / c;
-                mu = sqrtf(1 + (4 * rho * rho - 4)/(mu * mu));
-                gamma = atanf(sqrtf((1.0f - mu)/(1.0f + mu)));
-                if (alpha < 0) alpha += M_PI/2;
-                alpha_c = cosf(alpha);
-                alpha_s = sinf(alpha);
-                gamma_c = cosf(gamma);
-                gamma_s = sinf(gamma);
-                HB[iid][icc][0] =  M_SQRT2 * alpha_c * gamma_c;
-                HB[iid][icc][1] =  M_SQRT2 * alpha_s * gamma_c;
-                HB[iid][icc][2] = -M_SQRT2 * alpha_s * gamma_s;
-                HB[iid][icc][3] =  M_SQRT2 * alpha_c * gamma_s;
-            }
-        }
-    }
-
-    for (k = 0; k < NR_ALLPASS_BANDS20; k++) {
-        double f_center, theta;
-        if (k < FF_ARRAY_ELEMS(f_center_20))
-            f_center = f_center_20[k] * 0.125;
-        else
-            f_center = k - 6.5f;
-        for (m = 0; m < PS_AP_LINKS; m++) {
-            theta = -M_PI * fractional_delay_links[m] * f_center;
-            Q_fract_allpass[0][k][m][0] = cos(theta);
-            Q_fract_allpass[0][k][m][1] = sin(theta);
-        }
-        theta = -M_PI*fractional_delay_gain*f_center;
-        phi_fract[0][k][0] = cos(theta);
-        phi_fract[0][k][1] = sin(theta);
-    }
-    for (k = 0; k < NR_ALLPASS_BANDS34; k++) {
-        double f_center, theta;
-        if (k < FF_ARRAY_ELEMS(f_center_34))
-            f_center = f_center_34[k] / 24.0;
-        else
-            f_center = k - 26.5f;
-        for (m = 0; m < PS_AP_LINKS; m++) {
-            theta = -M_PI * fractional_delay_links[m] * f_center;
-            Q_fract_allpass[1][k][m][0] = cos(theta);
-            Q_fract_allpass[1][k][m][1] = sin(theta);
-        }
-        theta = -M_PI*fractional_delay_gain*f_center;
-        phi_fract[1][k][0] = cos(theta);
-        phi_fract[1][k][1] = sin(theta);
-    }
-
-    make_filters_from_proto(f20_0_8,  g0_Q8,   8);
-    make_filters_from_proto(f34_0_12, g0_Q12, 12);
-    make_filters_from_proto(f34_1_8,  g1_Q8,   8);
-    make_filters_from_proto(f34_2_4,  g2_Q4,   4);
-}
-#endif /* CONFIG_HARDCODED_TABLES */
-
-#endif /* AACPS_TABLEGEN_H */
diff --git a/deps/libav/libavcodec/aacpsdata.c b/deps/libav/libavcodec/aacpsdata.c
deleted file mode 100644
index 675bd8e..0000000
--- a/deps/libav/libavcodec/aacpsdata.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * MPEG-4 Parametric Stereo data tables
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-static const uint8_t huff_iid_df1_bits[] = {
-    18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 18, 17, 17, 16, 16, 15, 14, 14,
-    13, 12, 12, 11, 10, 10,  8,  7,  6,  5,  4,  3,  1,  3,  4,  5,  6,  7,
-     8,  9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 17, 18, 18,
-    18, 18, 18, 18, 18, 18, 18,
-};
-
-static const uint32_t huff_iid_df1_codes[] = {
-    0x01FEB4, 0x01FEB5, 0x01FD76, 0x01FD77, 0x01FD74, 0x01FD75, 0x01FE8A,
-    0x01FE8B, 0x01FE88, 0x00FE80, 0x01FEB6, 0x00FE82, 0x00FEB8, 0x007F42,
-    0x007FAE, 0x003FAF, 0x001FD1, 0x001FE9, 0x000FE9, 0x0007EA, 0x0007FB,
-    0x0003FB, 0x0001FB, 0x0001FF, 0x00007C, 0x00003C, 0x00001C, 0x00000C,
-    0x000000, 0x000001, 0x000001, 0x000002, 0x000001, 0x00000D, 0x00001D,
-    0x00003D, 0x00007D, 0x0000FC, 0x0001FC, 0x0003FC, 0x0003F4, 0x0007EB,
-    0x000FEA, 0x001FEA, 0x001FD6, 0x003FD0, 0x007FAF, 0x007F43, 0x00FEB9,
-    0x00FE83, 0x01FEB7, 0x00FE81, 0x01FE89, 0x01FE8E, 0x01FE8F, 0x01FE8C,
-    0x01FE8D, 0x01FEB2, 0x01FEB3, 0x01FEB0, 0x01FEB1,
-};
-
-static const uint8_t huff_iid_dt1_bits[] = {
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 13,
-    13, 13, 12, 12, 11, 10,  9,  9,  7,  6,  5,  3,  1,  2,  5,  6,  7,  8,
-     9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16,
-};
-
-static const uint16_t huff_iid_dt1_codes[] = {
-    0x004ED4, 0x004ED5, 0x004ECE, 0x004ECF, 0x004ECC, 0x004ED6, 0x004ED8,
-    0x004F46, 0x004F60, 0x002718, 0x002719, 0x002764, 0x002765, 0x00276D,
-    0x0027B1, 0x0013B7, 0x0013D6, 0x0009C7, 0x0009E9, 0x0009ED, 0x0004EE,
-    0x0004F7, 0x000278, 0x000139, 0x00009A, 0x00009F, 0x000020, 0x000011,
-    0x00000A, 0x000003, 0x000001, 0x000000, 0x00000B, 0x000012, 0x000021,
-    0x00004C, 0x00009B, 0x00013A, 0x000279, 0x000270, 0x0004EF, 0x0004E2,
-    0x0009EA, 0x0009D8, 0x0013D7, 0x0013D0, 0x0027B2, 0x0027A2, 0x00271A,
-    0x00271B, 0x004F66, 0x004F67, 0x004F61, 0x004F47, 0x004ED9, 0x004ED7,
-    0x004ECD, 0x004ED2, 0x004ED3, 0x004ED0, 0x004ED1,
-};
-
-static const uint8_t huff_iid_df0_bits[] = {
-    17, 17, 17, 17, 16, 15, 13, 10,  9,  7,  6,  5,  4,  3,  1,  3,  4,  5,
-     6,  6,  8, 11, 13, 14, 14, 15, 17, 18, 18,
-};
-
-static const uint32_t huff_iid_df0_codes[] = {
-    0x01FFFB, 0x01FFFC, 0x01FFFD, 0x01FFFA, 0x00FFFC, 0x007FFC, 0x001FFD,
-    0x0003FE, 0x0001FE, 0x00007E, 0x00003C, 0x00001D, 0x00000D, 0x000005,
-    0x000000, 0x000004, 0x00000C, 0x00001C, 0x00003D, 0x00003E, 0x0000FE,
-    0x0007FE, 0x001FFC, 0x003FFC, 0x003FFD, 0x007FFD, 0x01FFFE, 0x03FFFE,
-    0x03FFFF,
-};
-
-static const uint8_t huff_iid_dt0_bits[] = {
-    19, 19, 19, 20, 20, 20, 17, 15, 12, 10,  8,  6,  4,  2,  1,  3,  5,  7,
-     9, 11, 13, 14, 17, 19, 20, 20, 20, 20, 20,
-};
-
-static const uint32_t huff_iid_dt0_codes[] = {
-    0x07FFF9, 0x07FFFA, 0x07FFFB, 0x0FFFF8, 0x0FFFF9, 0x0FFFFA, 0x01FFFD,
-    0x007FFE, 0x000FFE, 0x0003FE, 0x0000FE, 0x00003E, 0x00000E, 0x000002,
-    0x000000, 0x000006, 0x00001E, 0x00007E, 0x0001FE, 0x0007FE, 0x001FFE,
-    0x003FFE, 0x01FFFC, 0x07FFF8, 0x0FFFFB, 0x0FFFFC, 0x0FFFFD, 0x0FFFFE,
-    0x0FFFFF,
-};
-
-static const uint8_t huff_icc_df_bits[] = {
-    14, 14, 12, 10, 7, 5, 3, 1, 2, 4, 6, 8, 9, 11, 13,
-};
-
-static const uint16_t huff_icc_df_codes[] = {
-    0x3FFF, 0x3FFE, 0x0FFE, 0x03FE, 0x007E, 0x001E, 0x0006, 0x0000,
-    0x0002, 0x000E, 0x003E, 0x00FE, 0x01FE, 0x07FE, 0x1FFE,
-};
-
-static const uint8_t huff_icc_dt_bits[] = {
-    14, 13, 11, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12, 14,
-};
-
-static const uint16_t huff_icc_dt_codes[] = {
-    0x3FFE, 0x1FFE, 0x07FE, 0x01FE, 0x007E, 0x001E, 0x0006, 0x0000,
-    0x0002, 0x000E, 0x003E, 0x00FE, 0x03FE, 0x0FFE, 0x3FFF,
-};
-
-static const uint8_t huff_ipd_df_bits[] = {
-    1, 3, 4, 4, 4, 4, 4, 4,
-};
-
-static const uint8_t huff_ipd_df_codes[] = {
-    0x01, 0x00, 0x06, 0x04, 0x02, 0x03, 0x05, 0x07,
-};
-
-static const uint8_t huff_ipd_dt_bits[] = {
-    1, 3, 4, 5, 5, 4, 4, 3,
-};
-
-static const uint8_t huff_ipd_dt_codes[] = {
-    0x01, 0x02, 0x02, 0x03, 0x02, 0x00, 0x03, 0x03,
-};
-
-static const uint8_t huff_opd_df_bits[] = {
-    1, 3, 4, 4, 5, 5, 4, 3,
-};
-
-static const uint8_t huff_opd_df_codes[] = {
-    0x01, 0x01, 0x06, 0x04, 0x0F, 0x0E, 0x05, 0x00,
-};
-
-static const uint8_t huff_opd_dt_bits[] = {
-    1, 3, 4, 5, 5, 4, 4, 3,
-};
-
-static const uint8_t huff_opd_dt_codes[] = {
-    0x01, 0x02, 0x01, 0x07, 0x06, 0x00, 0x02, 0x03,
-};
-
-static const int8_t huff_offset[] = {
-    30, 30,
-    14, 14,
-    7, 7,
-    0, 0,
-    0, 0,
-};
-
-///Table 8.48
-static const int8_t k_to_i_20[] = {
-     1,  0,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 14, 15,
-    15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19
-};
-///Table 8.49
-static const int8_t k_to_i_34[] = {
-     0,  1,  2,  3,  4,  5,  6,  6,  7,  2,  1,  0, 10, 10,  4,  5,  6,  7,  8,
-     9, 10, 11, 12,  9, 14, 11, 12, 13, 14, 15, 16, 13, 16, 17, 18, 19, 20, 21,
-    22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29,
-    30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 33,
-    33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33
-};
-
-static const float g1_Q2[] = {
-    0.0f,  0.01899487526049f, 0.0f, -0.07293139167538f,
-    0.0f,  0.30596630545168f, 0.5f
-};
diff --git a/deps/libav/libavcodec/aacpsdsp.c b/deps/libav/libavcodec/aacpsdsp.c
deleted file mode 100644
index 88e731f..0000000
--- a/deps/libav/libavcodec/aacpsdsp.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "aacpsdsp.h"
-
-static void ps_add_squares_c(float *dst, const float (*src)[2], int n)
-{
-    int i;
-    for (i = 0; i < n; i++)
-        dst[i] += src[i][0] * src[i][0] + src[i][1] * src[i][1];
-}
-
-static void ps_mul_pair_single_c(float (*dst)[2], float (*src0)[2], float *src1,
-                                 int n)
-{
-    int i;
-    for (i = 0; i < n; i++) {
-        dst[i][0] = src0[i][0] * src1[i];
-        dst[i][1] = src0[i][1] * src1[i];
-    }
-}
-
-static void ps_hybrid_analysis_c(float (*out)[2], float (*in)[2],
-                                 const float (*filter)[8][2],
-                                 int stride, int n)
-{
-    int i, j;
-
-    for (i = 0; i < n; i++) {
-        float sum_re = filter[i][6][0] * in[6][0];
-        float sum_im = filter[i][6][0] * in[6][1];
-
-        for (j = 0; j < 6; j++) {
-            float in0_re = in[j][0];
-            float in0_im = in[j][1];
-            float in1_re = in[12-j][0];
-            float in1_im = in[12-j][1];
-            sum_re += filter[i][j][0] * (in0_re + in1_re) -
-                      filter[i][j][1] * (in0_im - in1_im);
-            sum_im += filter[i][j][0] * (in0_im + in1_im) +
-                      filter[i][j][1] * (in0_re - in1_re);
-        }
-        out[i * stride][0] = sum_re;
-        out[i * stride][1] = sum_im;
-    }
-}
-
-static void ps_hybrid_analysis_ileave_c(float (*out)[32][2], float L[2][38][64],
-                                        int i, int len)
-{
-    int j;
-
-    for (; i < 64; i++) {
-        for (j = 0; j < len; j++) {
-            out[i][j][0] = L[0][j][i];
-            out[i][j][1] = L[1][j][i];
-        }
-    }
-}
-
-static void ps_hybrid_synthesis_deint_c(float out[2][38][64],
-                                        float (*in)[32][2],
-                                        int i, int len)
-{
-    int n;
-
-    for (; i < 64; i++) {
-        for (n = 0; n < len; n++) {
-            out[0][n][i] = in[i][n][0];
-            out[1][n][i] = in[i][n][1];
-        }
-    }
-}
-
-static void ps_decorrelate_c(float (*out)[2], float (*delay)[2],
-                             float (*ap_delay)[PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2],
-                             const float phi_fract[2], const float (*Q_fract)[2],
-                             const float *transient_gain,
-                             float g_decay_slope,
-                             int len)
-{
-    static const float a[] = { 0.65143905753106f,
-                               0.56471812200776f,
-                               0.48954165955695f };
-    float ag[PS_AP_LINKS];
-    int m, n;
-
-    for (m = 0; m < PS_AP_LINKS; m++)
-        ag[m] = a[m] * g_decay_slope;
-
-    for (n = 0; n < len; n++) {
-        float in_re = delay[n][0] * phi_fract[0] - delay[n][1] * phi_fract[1];
-        float in_im = delay[n][0] * phi_fract[1] + delay[n][1] * phi_fract[0];
-        for (m = 0; m < PS_AP_LINKS; m++) {
-            float a_re                = ag[m] * in_re;
-            float a_im                = ag[m] * in_im;
-            float link_delay_re       = ap_delay[m][n+2-m][0];
-            float link_delay_im       = ap_delay[m][n+2-m][1];
-            float fractional_delay_re = Q_fract[m][0];
-            float fractional_delay_im = Q_fract[m][1];
-            float apd_re = in_re;
-            float apd_im = in_im;
-            in_re = link_delay_re * fractional_delay_re -
-                    link_delay_im * fractional_delay_im - a_re;
-            in_im = link_delay_re * fractional_delay_im +
-                    link_delay_im * fractional_delay_re - a_im;
-            ap_delay[m][n+5][0] = apd_re + ag[m] * in_re;
-            ap_delay[m][n+5][1] = apd_im + ag[m] * in_im;
-        }
-        out[n][0] = transient_gain[n] * in_re;
-        out[n][1] = transient_gain[n] * in_im;
-    }
-}
-
-static void ps_stereo_interpolate_c(float (*l)[2], float (*r)[2],
-                                    float h[2][4], float h_step[2][4],
-                                    int len)
-{
-    float h0 = h[0][0];
-    float h1 = h[0][1];
-    float h2 = h[0][2];
-    float h3 = h[0][3];
-    float hs0 = h_step[0][0];
-    float hs1 = h_step[0][1];
-    float hs2 = h_step[0][2];
-    float hs3 = h_step[0][3];
-    int n;
-
-    for (n = 0; n < len; n++) {
-        //l is s, r is d
-        float l_re = l[n][0];
-        float l_im = l[n][1];
-        float r_re = r[n][0];
-        float r_im = r[n][1];
-        h0 += hs0;
-        h1 += hs1;
-        h2 += hs2;
-        h3 += hs3;
-        l[n][0] = h0 * l_re + h2 * r_re;
-        l[n][1] = h0 * l_im + h2 * r_im;
-        r[n][0] = h1 * l_re + h3 * r_re;
-        r[n][1] = h1 * l_im + h3 * r_im;
-    }
-}
-
-static void ps_stereo_interpolate_ipdopd_c(float (*l)[2], float (*r)[2],
-                                           float h[2][4], float h_step[2][4],
-                                           int len)
-{
-    float h00  = h[0][0],      h10  = h[1][0];
-    float h01  = h[0][1],      h11  = h[1][1];
-    float h02  = h[0][2],      h12  = h[1][2];
-    float h03  = h[0][3],      h13  = h[1][3];
-    float hs00 = h_step[0][0], hs10 = h_step[1][0];
-    float hs01 = h_step[0][1], hs11 = h_step[1][1];
-    float hs02 = h_step[0][2], hs12 = h_step[1][2];
-    float hs03 = h_step[0][3], hs13 = h_step[1][3];
-    int n;
-
-    for (n = 0; n < len; n++) {
-        //l is s, r is d
-        float l_re = l[n][0];
-        float l_im = l[n][1];
-        float r_re = r[n][0];
-        float r_im = r[n][1];
-        h00 += hs00;
-        h01 += hs01;
-        h02 += hs02;
-        h03 += hs03;
-        h10 += hs10;
-        h11 += hs11;
-        h12 += hs12;
-        h13 += hs13;
-
-        l[n][0] = h00 * l_re + h02 * r_re - h10 * l_im - h12 * r_im;
-        l[n][1] = h00 * l_im + h02 * r_im + h10 * l_re + h12 * r_re;
-        r[n][0] = h01 * l_re + h03 * r_re - h11 * l_im - h13 * r_im;
-        r[n][1] = h01 * l_im + h03 * r_im + h11 * l_re + h13 * r_re;
-    }
-}
-
-av_cold void ff_psdsp_init(PSDSPContext *s)
-{
-    s->add_squares            = ps_add_squares_c;
-    s->mul_pair_single        = ps_mul_pair_single_c;
-    s->hybrid_analysis        = ps_hybrid_analysis_c;
-    s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_c;
-    s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_c;
-    s->decorrelate            = ps_decorrelate_c;
-    s->stereo_interpolate[0]  = ps_stereo_interpolate_c;
-    s->stereo_interpolate[1]  = ps_stereo_interpolate_ipdopd_c;
-
-    if (ARCH_ARM)
-        ff_psdsp_init_arm(s);
-}
diff --git a/deps/libav/libavcodec/aacpsdsp.h b/deps/libav/libavcodec/aacpsdsp.h
deleted file mode 100644
index dc380b1..0000000
--- a/deps/libav/libavcodec/aacpsdsp.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBAVCODEC_AACPSDSP_H
-#define LIBAVCODEC_AACPSDSP_H
-
-#define PS_QMF_TIME_SLOTS 32
-#define PS_AP_LINKS 3
-#define PS_MAX_AP_DELAY 5
-
-typedef struct PSDSPContext {
-    void (*add_squares)(float *dst, const float (*src)[2], int n);
-    void (*mul_pair_single)(float (*dst)[2], float (*src0)[2], float *src1,
-                            int n);
-    void (*hybrid_analysis)(float (*out)[2], float (*in)[2],
-                            const float (*filter)[8][2],
-                            int stride, int n);
-    void (*hybrid_analysis_ileave)(float (*out)[32][2], float L[2][38][64],
-                                   int i, int len);
-    void (*hybrid_synthesis_deint)(float out[2][38][64], float (*in)[32][2],
-                                   int i, int len);
-    void (*decorrelate)(float (*out)[2], float (*delay)[2],
-                        float (*ap_delay)[PS_QMF_TIME_SLOTS+PS_MAX_AP_DELAY][2],
-                        const float phi_fract[2], const float (*Q_fract)[2],
-                        const float *transient_gain,
-                        float g_decay_slope,
-                        int len);
-    void (*stereo_interpolate[2])(float (*l)[2], float (*r)[2],
-                                  float h[2][4], float h_step[2][4],
-                                  int len);
-} PSDSPContext;
-
-void ff_psdsp_init(PSDSPContext *s);
-void ff_psdsp_init_arm(PSDSPContext *s);
-
-#endif /* LIBAVCODEC_AACPSDSP_H */
diff --git a/deps/libav/libavcodec/aacpsy.c b/deps/libav/libavcodec/aacpsy.c
deleted file mode 100644
index 66cf6d5..0000000
--- a/deps/libav/libavcodec/aacpsy.c
+++ /dev/null
@@ -1,934 +0,0 @@
-/*
- * AAC encoder psychoacoustic model
- * Copyright (C) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC encoder psychoacoustic model
- */
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "aactab.h"
-#include "psymodel.h"
-
-/***********************************
- *              TODOs:
- * try other bitrate controlling mechanism (maybe use ratecontrol.c?)
- * control quality for quality-based output
- **********************************/
-
-/**
- * constants for 3GPP AAC psychoacoustic model
- * @{
- */
-#define PSY_3GPP_THR_SPREAD_HI   1.5f // spreading factor for low-to-hi threshold spreading  (15 dB/Bark)
-#define PSY_3GPP_THR_SPREAD_LOW  3.0f // spreading factor for hi-to-low threshold spreading  (30 dB/Bark)
-/* spreading factor for low-to-hi energy spreading, long block, > 22kbps/channel (20dB/Bark) */
-#define PSY_3GPP_EN_SPREAD_HI_L1 2.0f
-/* spreading factor for low-to-hi energy spreading, long block, <= 22kbps/channel (15dB/Bark) */
-#define PSY_3GPP_EN_SPREAD_HI_L2 1.5f
-/* spreading factor for low-to-hi energy spreading, short block (15 dB/Bark) */
-#define PSY_3GPP_EN_SPREAD_HI_S  1.5f
-/* spreading factor for hi-to-low energy spreading, long block (30dB/Bark) */
-#define PSY_3GPP_EN_SPREAD_LOW_L 3.0f
-/* spreading factor for hi-to-low energy spreading, short block (20dB/Bark) */
-#define PSY_3GPP_EN_SPREAD_LOW_S 2.0f
-
-#define PSY_3GPP_RPEMIN      0.01f
-#define PSY_3GPP_RPELEV      2.0f
-
-#define PSY_3GPP_C1          3.0f           /* log2(8) */
-#define PSY_3GPP_C2          1.3219281f     /* log2(2.5) */
-#define PSY_3GPP_C3          0.55935729f    /* 1 - C2 / C1 */
-
-#define PSY_SNR_1DB          7.9432821e-1f  /* -1dB */
-#define PSY_SNR_25DB         3.1622776e-3f  /* -25dB */
-
-#define PSY_3GPP_SAVE_SLOPE_L  -0.46666667f
-#define PSY_3GPP_SAVE_SLOPE_S  -0.36363637f
-#define PSY_3GPP_SAVE_ADD_L    -0.84285712f
-#define PSY_3GPP_SAVE_ADD_S    -0.75f
-#define PSY_3GPP_SPEND_SLOPE_L  0.66666669f
-#define PSY_3GPP_SPEND_SLOPE_S  0.81818181f
-#define PSY_3GPP_SPEND_ADD_L   -0.35f
-#define PSY_3GPP_SPEND_ADD_S   -0.26111111f
-#define PSY_3GPP_CLIP_LO_L      0.2f
-#define PSY_3GPP_CLIP_LO_S      0.2f
-#define PSY_3GPP_CLIP_HI_L      0.95f
-#define PSY_3GPP_CLIP_HI_S      0.75f
-
-#define PSY_3GPP_AH_THR_LONG    0.5f
-#define PSY_3GPP_AH_THR_SHORT   0.63f
-
-enum {
-    PSY_3GPP_AH_NONE,
-    PSY_3GPP_AH_INACTIVE,
-    PSY_3GPP_AH_ACTIVE
-};
-
-#define PSY_3GPP_BITS_TO_PE(bits) ((bits) * 1.18f)
-
-/* LAME psy model constants */
-#define PSY_LAME_FIR_LEN 21         ///< LAME psy model FIR order
-#define AAC_BLOCK_SIZE_LONG 1024    ///< long block size
-#define AAC_BLOCK_SIZE_SHORT 128    ///< short block size
-#define AAC_NUM_BLOCKS_SHORT 8      ///< number of blocks in a short sequence
-#define PSY_LAME_NUM_SUBBLOCKS 3    ///< Number of sub-blocks in each short block
-
-/**
- * @}
- */
-
-/**
- * information for single band used by 3GPP TS26.403-inspired psychoacoustic model
- */
-typedef struct AacPsyBand{
-    float energy;       ///< band energy
-    float thr;          ///< energy threshold
-    float thr_quiet;    ///< threshold in quiet
-    float nz_lines;     ///< number of non-zero spectral lines
-    float active_lines; ///< number of active spectral lines
-    float pe;           ///< perceptual entropy
-    float pe_const;     ///< constant part of the PE calculation
-    float norm_fac;     ///< normalization factor for linearization
-    int   avoid_holes;  ///< hole avoidance flag
-}AacPsyBand;
-
-/**
- * single/pair channel context for psychoacoustic model
- */
-typedef struct AacPsyChannel{
-    AacPsyBand band[128];               ///< bands information
-    AacPsyBand prev_band[128];          ///< bands information from the previous frame
-
-    float       win_energy;              ///< sliding average of channel energy
-    float       iir_state[2];            ///< hi-pass IIR filter state
-    uint8_t     next_grouping;           ///< stored grouping scheme for the next frame (in case of 8 short window sequence)
-    enum WindowSequence next_window_seq; ///< window sequence to be used in the next frame
-    /* LAME psy model specific members */
-    float attack_threshold;              ///< attack threshold for this channel
-    float prev_energy_subshort[AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS];
-    int   prev_attack;                   ///< attack value for the last short block in the previous sequence
-}AacPsyChannel;
-
-/**
- * psychoacoustic model frame type-dependent coefficients
- */
-typedef struct AacPsyCoeffs{
-    float ath;           ///< absolute threshold of hearing per bands
-    float barks;         ///< Bark value for each spectral band in long frame
-    float spread_low[2]; ///< spreading factor for low-to-high threshold spreading in long frame
-    float spread_hi [2]; ///< spreading factor for high-to-low threshold spreading in long frame
-    float min_snr;       ///< minimal SNR
-}AacPsyCoeffs;
-
-/**
- * 3GPP TS26.403-inspired psychoacoustic model specific data
- */
-typedef struct AacPsyContext{
-    int chan_bitrate;     ///< bitrate per channel
-    int frame_bits;       ///< average bits per frame
-    int fill_level;       ///< bit reservoir fill level
-    struct {
-        float min;        ///< minimum allowed PE for bit factor calculation
-        float max;        ///< maximum allowed PE for bit factor calculation
-        float previous;   ///< allowed PE of the previous frame
-        float correction; ///< PE correction factor
-    } pe;
-    AacPsyCoeffs psy_coef[2][64];
-    AacPsyChannel *ch;
-}AacPsyContext;
-
-/**
- * LAME psy model preset struct
- */
-typedef struct {
-    int   quality;  ///< Quality to map the rest of the vaules to.
-     /* This is overloaded to be both kbps per channel in ABR mode, and
-      * requested quality in constant quality mode.
-      */
-    float st_lrm;   ///< short threshold for L, R, and M channels
-} PsyLamePreset;
-
-/**
- * LAME psy model preset table for ABR
- */
-static const PsyLamePreset psy_abr_map[] = {
-/* TODO: Tuning. These were taken from LAME. */
-/* kbps/ch st_lrm   */
-    {  8,  6.60},
-    { 16,  6.60},
-    { 24,  6.60},
-    { 32,  6.60},
-    { 40,  6.60},
-    { 48,  6.60},
-    { 56,  6.60},
-    { 64,  6.40},
-    { 80,  6.00},
-    { 96,  5.60},
-    {112,  5.20},
-    {128,  5.20},
-    {160,  5.20}
-};
-
-/**
-* LAME psy model preset table for constant quality
-*/
-static const PsyLamePreset psy_vbr_map[] = {
-/* vbr_q  st_lrm    */
-    { 0,  4.20},
-    { 1,  4.20},
-    { 2,  4.20},
-    { 3,  4.20},
-    { 4,  4.20},
-    { 5,  4.20},
-    { 6,  4.20},
-    { 7,  4.20},
-    { 8,  4.20},
-    { 9,  4.20},
-    {10,  4.20}
-};
-
-/**
- * LAME psy model FIR coefficient table
- */
-static const float psy_fir_coeffs[] = {
-    -8.65163e-18 * 2, -0.00851586 * 2, -6.74764e-18 * 2, 0.0209036 * 2,
-    -3.36639e-17 * 2, -0.0438162 * 2,  -1.54175e-17 * 2, 0.0931738 * 2,
-    -5.52212e-17 * 2, -0.313819 * 2
-};
-
-/**
- * Calculate the ABR attack threshold from the above LAME psymodel table.
- */
-static float lame_calc_attack_threshold(int bitrate)
-{
-    /* Assume max bitrate to start with */
-    int lower_range = 12, upper_range = 12;
-    int lower_range_kbps = psy_abr_map[12].quality;
-    int upper_range_kbps = psy_abr_map[12].quality;
-    int i;
-
-    /* Determine which bitrates the value specified falls between.
-     * If the loop ends without breaking our above assumption of 320kbps was correct.
-     */
-    for (i = 1; i < 13; i++) {
-        if (FFMAX(bitrate, psy_abr_map[i].quality) != bitrate) {
-            upper_range = i;
-            upper_range_kbps = psy_abr_map[i    ].quality;
-            lower_range = i - 1;
-            lower_range_kbps = psy_abr_map[i - 1].quality;
-            break; /* Upper range found */
-        }
-    }
-
-    /* Determine which range the value specified is closer to */
-    if ((upper_range_kbps - bitrate) > (bitrate - lower_range_kbps))
-        return psy_abr_map[lower_range].st_lrm;
-    return psy_abr_map[upper_range].st_lrm;
-}
-
-/**
- * LAME psy model specific initialization
- */
-static av_cold void lame_window_init(AacPsyContext *ctx, AVCodecContext *avctx)
-{
-    int i, j;
-
-    for (i = 0; i < avctx->channels; i++) {
-        AacPsyChannel *pch = &ctx->ch[i];
-
-        if (avctx->flags & CODEC_FLAG_QSCALE)
-            pch->attack_threshold = psy_vbr_map[avctx->global_quality / FF_QP2LAMBDA].st_lrm;
-        else
-            pch->attack_threshold = lame_calc_attack_threshold(avctx->bit_rate / avctx->channels / 1000);
-
-        for (j = 0; j < AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS; j++)
-            pch->prev_energy_subshort[j] = 10.0f;
-    }
-}
-
-/**
- * Calculate Bark value for given line.
- */
-static av_cold float calc_bark(float f)
-{
-    return 13.3f * atanf(0.00076f * f) + 3.5f * atanf((f / 7500.0f) * (f / 7500.0f));
-}
-
-#define ATH_ADD 4
-/**
- * Calculate ATH value for given frequency.
- * Borrowed from Lame.
- */
-static av_cold float ath(float f, float add)
-{
-    f /= 1000.0f;
-    return    3.64 * pow(f, -0.8)
-            - 6.8  * exp(-0.6  * (f - 3.4) * (f - 3.4))
-            + 6.0  * exp(-0.15 * (f - 8.7) * (f - 8.7))
-            + (0.6 + 0.04 * add) * 0.001 * f * f * f * f;
-}
-
-static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
-    AacPsyContext *pctx;
-    float bark;
-    int i, j, g, start;
-    float prev, minscale, minath, minsnr, pe_min;
-    const int chan_bitrate = ctx->avctx->bit_rate / ctx->avctx->channels;
-    const int bandwidth    = ctx->avctx->cutoff ? ctx->avctx->cutoff : ctx->avctx->sample_rate / 2;
-    const float num_bark   = calc_bark((float)bandwidth);
-
-    ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext));
-    pctx = (AacPsyContext*) ctx->model_priv_data;
-
-    pctx->chan_bitrate = chan_bitrate;
-    pctx->frame_bits   = chan_bitrate * AAC_BLOCK_SIZE_LONG / ctx->avctx->sample_rate;
-    pctx->pe.min       =  8.0f * AAC_BLOCK_SIZE_LONG * bandwidth / (ctx->avctx->sample_rate * 2.0f);
-    pctx->pe.max       = 12.0f * AAC_BLOCK_SIZE_LONG * bandwidth / (ctx->avctx->sample_rate * 2.0f);
-    ctx->bitres.size   = 6144 - pctx->frame_bits;
-    ctx->bitres.size  -= ctx->bitres.size % 8;
-    pctx->fill_level   = ctx->bitres.size;
-    minath = ath(3410, ATH_ADD);
-    for (j = 0; j < 2; j++) {
-        AacPsyCoeffs *coeffs = pctx->psy_coef[j];
-        const uint8_t *band_sizes = ctx->bands[j];
-        float line_to_frequency = ctx->avctx->sample_rate / (j ? 256.f : 2048.0f);
-        float avg_chan_bits = chan_bitrate * (j ? 128.0f : 1024.0f) / ctx->avctx->sample_rate;
-        /* reference encoder uses 2.4% here instead of 60% like the spec says */
-        float bark_pe = 0.024f * PSY_3GPP_BITS_TO_PE(avg_chan_bits) / num_bark;
-        float en_spread_low = j ? PSY_3GPP_EN_SPREAD_LOW_S : PSY_3GPP_EN_SPREAD_LOW_L;
-        /* High energy spreading for long blocks <= 22kbps/channel and short blocks are the same. */
-        float en_spread_hi  = (j || (chan_bitrate <= 22.0f)) ? PSY_3GPP_EN_SPREAD_HI_S : PSY_3GPP_EN_SPREAD_HI_L1;
-
-        i = 0;
-        prev = 0.0;
-        for (g = 0; g < ctx->num_bands[j]; g++) {
-            i += band_sizes[g];
-            bark = calc_bark((i-1) * line_to_frequency);
-            coeffs[g].barks = (bark + prev) / 2.0;
-            prev = bark;
-        }
-        for (g = 0; g < ctx->num_bands[j] - 1; g++) {
-            AacPsyCoeffs *coeff = &coeffs[g];
-            float bark_width = coeffs[g+1].barks - coeffs->barks;
-            coeff->spread_low[0] = pow(10.0, -bark_width * PSY_3GPP_THR_SPREAD_LOW);
-            coeff->spread_hi [0] = pow(10.0, -bark_width * PSY_3GPP_THR_SPREAD_HI);
-            coeff->spread_low[1] = pow(10.0, -bark_width * en_spread_low);
-            coeff->spread_hi [1] = pow(10.0, -bark_width * en_spread_hi);
-            pe_min = bark_pe * bark_width;
-            minsnr = pow(2.0f, pe_min / band_sizes[g]) - 1.5f;
-            coeff->min_snr = av_clipf(1.0f / minsnr, PSY_SNR_25DB, PSY_SNR_1DB);
-        }
-        start = 0;
-        for (g = 0; g < ctx->num_bands[j]; g++) {
-            minscale = ath(start * line_to_frequency, ATH_ADD);
-            for (i = 1; i < band_sizes[g]; i++)
-                minscale = FFMIN(minscale, ath((start + i) * line_to_frequency, ATH_ADD));
-            coeffs[g].ath = minscale - minath;
-            start += band_sizes[g];
-        }
-    }
-
-    pctx->ch = av_mallocz(sizeof(AacPsyChannel) * ctx->avctx->channels);
-
-    lame_window_init(pctx, ctx->avctx);
-
-    return 0;
-}
-
-/**
- * IIR filter used in block switching decision
- */
-static float iir_filter(int in, float state[2])
-{
-    float ret;
-
-    ret = 0.7548f * (in - state[0]) + 0.5095f * state[1];
-    state[0] = in;
-    state[1] = ret;
-    return ret;
-}
-
-/**
- * window grouping information stored as bits (0 - new group, 1 - group continues)
- */
-static const uint8_t window_grouping[9] = {
-    0xB6, 0x6C, 0xD8, 0xB2, 0x66, 0xC6, 0x96, 0x36, 0x36
-};
-
-/**
- * Tell encoder which window types to use.
- * @see 3GPP TS26.403 5.4.1 "Blockswitching"
- */
-static av_unused FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
-                                                 const int16_t *audio,
-                                                 const int16_t *la,
-                                                 int channel, int prev_type)
-{
-    int i, j;
-    int br               = ctx->avctx->bit_rate / ctx->avctx->channels;
-    int attack_ratio     = br <= 16000 ? 18 : 10;
-    AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
-    AacPsyChannel *pch  = &pctx->ch[channel];
-    uint8_t grouping     = 0;
-    int next_type        = pch->next_window_seq;
-    FFPsyWindowInfo wi  = { { 0 } };
-
-    if (la) {
-        float s[8], v;
-        int switch_to_eight = 0;
-        float sum = 0.0, sum2 = 0.0;
-        int attack_n = 0;
-        int stay_short = 0;
-        for (i = 0; i < 8; i++) {
-            for (j = 0; j < 128; j++) {
-                v = iir_filter(la[i*128+j], pch->iir_state);
-                sum += v*v;
-            }
-            s[i]  = sum;
-            sum2 += sum;
-        }
-        for (i = 0; i < 8; i++) {
-            if (s[i] > pch->win_energy * attack_ratio) {
-                attack_n        = i + 1;
-                switch_to_eight = 1;
-                break;
-            }
-        }
-        pch->win_energy = pch->win_energy*7/8 + sum2/64;
-
-        wi.window_type[1] = prev_type;
-        switch (prev_type) {
-        case ONLY_LONG_SEQUENCE:
-            wi.window_type[0] = switch_to_eight ? LONG_START_SEQUENCE : ONLY_LONG_SEQUENCE;
-            next_type = switch_to_eight ? EIGHT_SHORT_SEQUENCE : ONLY_LONG_SEQUENCE;
-            break;
-        case LONG_START_SEQUENCE:
-            wi.window_type[0] = EIGHT_SHORT_SEQUENCE;
-            grouping = pch->next_grouping;
-            next_type = switch_to_eight ? EIGHT_SHORT_SEQUENCE : LONG_STOP_SEQUENCE;
-            break;
-        case LONG_STOP_SEQUENCE:
-            wi.window_type[0] = switch_to_eight ? LONG_START_SEQUENCE : ONLY_LONG_SEQUENCE;
-            next_type = switch_to_eight ? EIGHT_SHORT_SEQUENCE : ONLY_LONG_SEQUENCE;
-            break;
-        case EIGHT_SHORT_SEQUENCE:
-            stay_short = next_type == EIGHT_SHORT_SEQUENCE || switch_to_eight;
-            wi.window_type[0] = stay_short ? EIGHT_SHORT_SEQUENCE : LONG_STOP_SEQUENCE;
-            grouping = next_type == EIGHT_SHORT_SEQUENCE ? pch->next_grouping : 0;
-            next_type = switch_to_eight ? EIGHT_SHORT_SEQUENCE : LONG_STOP_SEQUENCE;
-            break;
-        }
-
-        pch->next_grouping = window_grouping[attack_n];
-        pch->next_window_seq = next_type;
-    } else {
-        for (i = 0; i < 3; i++)
-            wi.window_type[i] = prev_type;
-        grouping = (prev_type == EIGHT_SHORT_SEQUENCE) ? window_grouping[0] : 0;
-    }
-
-    wi.window_shape   = 1;
-    if (wi.window_type[0] != EIGHT_SHORT_SEQUENCE) {
-        wi.num_windows = 1;
-        wi.grouping[0] = 1;
-    } else {
-        int lastgrp = 0;
-        wi.num_windows = 8;
-        for (i = 0; i < 8; i++) {
-            if (!((grouping >> i) & 1))
-                lastgrp = i;
-            wi.grouping[lastgrp]++;
-        }
-    }
-
-    return wi;
-}
-
-/* 5.6.1.2 "Calculation of Bit Demand" */
-static int calc_bit_demand(AacPsyContext *ctx, float pe, int bits, int size,
-                           int short_window)
-{
-    const float bitsave_slope  = short_window ? PSY_3GPP_SAVE_SLOPE_S  : PSY_3GPP_SAVE_SLOPE_L;
-    const float bitsave_add    = short_window ? PSY_3GPP_SAVE_ADD_S    : PSY_3GPP_SAVE_ADD_L;
-    const float bitspend_slope = short_window ? PSY_3GPP_SPEND_SLOPE_S : PSY_3GPP_SPEND_SLOPE_L;
-    const float bitspend_add   = short_window ? PSY_3GPP_SPEND_ADD_S   : PSY_3GPP_SPEND_ADD_L;
-    const float clip_low       = short_window ? PSY_3GPP_CLIP_LO_S     : PSY_3GPP_CLIP_LO_L;
-    const float clip_high      = short_window ? PSY_3GPP_CLIP_HI_S     : PSY_3GPP_CLIP_HI_L;
-    float clipped_pe, bit_save, bit_spend, bit_factor, fill_level;
-
-    ctx->fill_level += ctx->frame_bits - bits;
-    ctx->fill_level  = av_clip(ctx->fill_level, 0, size);
-    fill_level = av_clipf((float)ctx->fill_level / size, clip_low, clip_high);
-    clipped_pe = av_clipf(pe, ctx->pe.min, ctx->pe.max);
-    bit_save   = (fill_level + bitsave_add) * bitsave_slope;
-    assert(bit_save <= 0.3f && bit_save >= -0.05000001f);
-    bit_spend  = (fill_level + bitspend_add) * bitspend_slope;
-    assert(bit_spend <= 0.5f && bit_spend >= -0.1f);
-    /* The bit factor graph in the spec is obviously incorrect.
-     *      bit_spend + ((bit_spend - bit_spend))...
-     * The reference encoder subtracts everything from 1, but also seems incorrect.
-     *      1 - bit_save + ((bit_spend + bit_save))...
-     * Hopefully below is correct.
-     */
-    bit_factor = 1.0f - bit_save + ((bit_spend - bit_save) / (ctx->pe.max - ctx->pe.min)) * (clipped_pe - ctx->pe.min);
-    /* NOTE: The reference encoder attempts to center pe max/min around the current pe. */
-    ctx->pe.max = FFMAX(pe, ctx->pe.max);
-    ctx->pe.min = FFMIN(pe, ctx->pe.min);
-
-    return FFMIN(ctx->frame_bits * bit_factor, ctx->frame_bits + size - bits);
-}
-
-static float calc_pe_3gpp(AacPsyBand *band)
-{
-    float pe, a;
-
-    band->pe           = 0.0f;
-    band->pe_const     = 0.0f;
-    band->active_lines = 0.0f;
-    if (band->energy > band->thr) {
-        a  = log2f(band->energy);
-        pe = a - log2f(band->thr);
-        band->active_lines = band->nz_lines;
-        if (pe < PSY_3GPP_C1) {
-            pe = pe * PSY_3GPP_C3 + PSY_3GPP_C2;
-            a  = a  * PSY_3GPP_C3 + PSY_3GPP_C2;
-            band->active_lines *= PSY_3GPP_C3;
-        }
-        band->pe       = pe * band->nz_lines;
-        band->pe_const = a  * band->nz_lines;
-    }
-
-    return band->pe;
-}
-
-static float calc_reduction_3gpp(float a, float desired_pe, float pe,
-                                 float active_lines)
-{
-    float thr_avg, reduction;
-
-    thr_avg   = powf(2.0f, (a - pe) / (4.0f * active_lines));
-    reduction = powf(2.0f, (a - desired_pe) / (4.0f * active_lines)) - thr_avg;
-
-    return FFMAX(reduction, 0.0f);
-}
-
-static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr,
-                                   float reduction)
-{
-    float thr = band->thr;
-
-    if (band->energy > thr) {
-        thr = powf(thr, 0.25f) + reduction;
-        thr = powf(thr, 4.0f);
-
-        /* This deviates from the 3GPP spec to match the reference encoder.
-         * It performs min(thr_reduced, max(thr, energy/min_snr)) only for bands
-         * that have hole avoidance on (active or inactive). It always reduces the
-         * threshold of bands with hole avoidance off.
-         */
-        if (thr > band->energy * min_snr && band->avoid_holes != PSY_3GPP_AH_NONE) {
-            thr = FFMAX(band->thr, band->energy * min_snr);
-            band->avoid_holes = PSY_3GPP_AH_ACTIVE;
-        }
-    }
-
-    return thr;
-}
-
-/**
- * Calculate band thresholds as suggested in 3GPP TS26.403
- */
-static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
-                                     const float *coefs, const FFPsyWindowInfo *wi)
-{
-    AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
-    AacPsyChannel *pch  = &pctx->ch[channel];
-    int start = 0;
-    int i, w, g;
-    float desired_bits, desired_pe, delta_pe, reduction, spread_en[128] = {0};
-    float a = 0.0f, active_lines = 0.0f, norm_fac = 0.0f;
-    float pe = pctx->chan_bitrate > 32000 ? 0.0f : FFMAX(50.0f, 100.0f - pctx->chan_bitrate * 100.0f / 32000.0f);
-    const int      num_bands   = ctx->num_bands[wi->num_windows == 8];
-    const uint8_t *band_sizes  = ctx->bands[wi->num_windows == 8];
-    AacPsyCoeffs  *coeffs      = pctx->psy_coef[wi->num_windows == 8];
-    const float avoid_hole_thr = wi->num_windows == 8 ? PSY_3GPP_AH_THR_SHORT : PSY_3GPP_AH_THR_LONG;
-
-    //calculate energies, initial thresholds and related values - 5.4.2 "Threshold Calculation"
-    for (w = 0; w < wi->num_windows*16; w += 16) {
-        for (g = 0; g < num_bands; g++) {
-            AacPsyBand *band = &pch->band[w+g];
-
-            float form_factor = 0.0f;
-            band->energy = 0.0f;
-            for (i = 0; i < band_sizes[g]; i++) {
-                band->energy += coefs[start+i] * coefs[start+i];
-                form_factor  += sqrtf(fabs(coefs[start+i]));
-            }
-            band->thr      = band->energy * 0.001258925f;
-            band->nz_lines = form_factor / powf(band->energy / band_sizes[g], 0.25f);
-
-            start += band_sizes[g];
-        }
-    }
-    //modify thresholds and energies - spread, threshold in quiet, pre-echo control
-    for (w = 0; w < wi->num_windows*16; w += 16) {
-        AacPsyBand *bands = &pch->band[w];
-
-        /* 5.4.2.3 "Spreading" & 5.4.3 "Spread Energy Calculation" */
-        spread_en[0] = bands[0].energy;
-        for (g = 1; g < num_bands; g++) {
-            bands[g].thr   = FFMAX(bands[g].thr,    bands[g-1].thr * coeffs[g].spread_hi[0]);
-            spread_en[w+g] = FFMAX(bands[g].energy, spread_en[w+g-1] * coeffs[g].spread_hi[1]);
-        }
-        for (g = num_bands - 2; g >= 0; g--) {
-            bands[g].thr   = FFMAX(bands[g].thr,   bands[g+1].thr * coeffs[g].spread_low[0]);
-            spread_en[w+g] = FFMAX(spread_en[w+g], spread_en[w+g+1] * coeffs[g].spread_low[1]);
-        }
-        //5.4.2.4 "Threshold in quiet"
-        for (g = 0; g < num_bands; g++) {
-            AacPsyBand *band = &bands[g];
-
-            band->thr_quiet = band->thr = FFMAX(band->thr, coeffs[g].ath);
-            //5.4.2.5 "Pre-echo control"
-            if (!(wi->window_type[0] == LONG_STOP_SEQUENCE || (wi->window_type[1] == LONG_START_SEQUENCE && !w)))
-                band->thr = FFMAX(PSY_3GPP_RPEMIN*band->thr, FFMIN(band->thr,
-                                  PSY_3GPP_RPELEV*pch->prev_band[w+g].thr_quiet));
-
-            /* 5.6.1.3.1 "Preparatory steps of the perceptual entropy calculation" */
-            pe += calc_pe_3gpp(band);
-            a  += band->pe_const;
-            active_lines += band->active_lines;
-
-            /* 5.6.1.3.3 "Selection of the bands for avoidance of holes" */
-            if (spread_en[w+g] * avoid_hole_thr > band->energy || coeffs[g].min_snr > 1.0f)
-                band->avoid_holes = PSY_3GPP_AH_NONE;
-            else
-                band->avoid_holes = PSY_3GPP_AH_INACTIVE;
-        }
-    }
-
-    /* 5.6.1.3.2 "Calculation of the desired perceptual entropy" */
-    ctx->ch[channel].entropy = pe;
-    desired_bits = calc_bit_demand(pctx, pe, ctx->bitres.bits, ctx->bitres.size, wi->num_windows == 8);
-    desired_pe = PSY_3GPP_BITS_TO_PE(desired_bits);
-    /* NOTE: PE correction is kept simple. During initial testing it had very
-     *       little effect on the final bitrate. Probably a good idea to come
-     *       back and do more testing later.
-     */
-    if (ctx->bitres.bits > 0)
-        desired_pe *= av_clipf(pctx->pe.previous / PSY_3GPP_BITS_TO_PE(ctx->bitres.bits),
-                               0.85f, 1.15f);
-    pctx->pe.previous = PSY_3GPP_BITS_TO_PE(desired_bits);
-
-    if (desired_pe < pe) {
-        /* 5.6.1.3.4 "First Estimation of the reduction value" */
-        for (w = 0; w < wi->num_windows*16; w += 16) {
-            reduction = calc_reduction_3gpp(a, desired_pe, pe, active_lines);
-            pe = 0.0f;
-            a  = 0.0f;
-            active_lines = 0.0f;
-            for (g = 0; g < num_bands; g++) {
-                AacPsyBand *band = &pch->band[w+g];
-
-                band->thr = calc_reduced_thr_3gpp(band, coeffs[g].min_snr, reduction);
-                /* recalculate PE */
-                pe += calc_pe_3gpp(band);
-                a  += band->pe_const;
-                active_lines += band->active_lines;
-            }
-        }
-
-        /* 5.6.1.3.5 "Second Estimation of the reduction value" */
-        for (i = 0; i < 2; i++) {
-            float pe_no_ah = 0.0f, desired_pe_no_ah;
-            active_lines = a = 0.0f;
-            for (w = 0; w < wi->num_windows*16; w += 16) {
-                for (g = 0; g < num_bands; g++) {
-                    AacPsyBand *band = &pch->band[w+g];
-
-                    if (band->avoid_holes != PSY_3GPP_AH_ACTIVE) {
-                        pe_no_ah += band->pe;
-                        a        += band->pe_const;
-                        active_lines += band->active_lines;
-                    }
-                }
-            }
-            desired_pe_no_ah = FFMAX(desired_pe - (pe - pe_no_ah), 0.0f);
-            if (active_lines > 0.0f)
-                reduction += calc_reduction_3gpp(a, desired_pe_no_ah, pe_no_ah, active_lines);
-
-            pe = 0.0f;
-            for (w = 0; w < wi->num_windows*16; w += 16) {
-                for (g = 0; g < num_bands; g++) {
-                    AacPsyBand *band = &pch->band[w+g];
-
-                    if (active_lines > 0.0f)
-                        band->thr = calc_reduced_thr_3gpp(band, coeffs[g].min_snr, reduction);
-                    pe += calc_pe_3gpp(band);
-                    band->norm_fac = band->active_lines / band->thr;
-                    norm_fac += band->norm_fac;
-                }
-            }
-            delta_pe = desired_pe - pe;
-            if (fabs(delta_pe) > 0.05f * desired_pe)
-                break;
-        }
-
-        if (pe < 1.15f * desired_pe) {
-            /* 6.6.1.3.6 "Final threshold modification by linearization" */
-            norm_fac = 1.0f / norm_fac;
-            for (w = 0; w < wi->num_windows*16; w += 16) {
-                for (g = 0; g < num_bands; g++) {
-                    AacPsyBand *band = &pch->band[w+g];
-
-                    if (band->active_lines > 0.5f) {
-                        float delta_sfb_pe = band->norm_fac * norm_fac * delta_pe;
-                        float thr = band->thr;
-
-                        thr *= powf(2.0f, delta_sfb_pe / band->active_lines);
-                        if (thr > coeffs[g].min_snr * band->energy && band->avoid_holes == PSY_3GPP_AH_INACTIVE)
-                            thr = FFMAX(band->thr, coeffs[g].min_snr * band->energy);
-                        band->thr = thr;
-                    }
-                }
-            }
-        } else {
-            /* 5.6.1.3.7 "Further perceptual entropy reduction" */
-            g = num_bands;
-            while (pe > desired_pe && g--) {
-                for (w = 0; w < wi->num_windows*16; w+= 16) {
-                    AacPsyBand *band = &pch->band[w+g];
-                    if (band->avoid_holes != PSY_3GPP_AH_NONE && coeffs[g].min_snr < PSY_SNR_1DB) {
-                        coeffs[g].min_snr = PSY_SNR_1DB;
-                        band->thr = band->energy * PSY_SNR_1DB;
-                        pe += band->active_lines * 1.5f - band->pe;
-                    }
-                }
-            }
-            /* TODO: allow more holes (unused without mid/side) */
-        }
-    }
-
-    for (w = 0; w < wi->num_windows*16; w += 16) {
-        for (g = 0; g < num_bands; g++) {
-            AacPsyBand *band     = &pch->band[w+g];
-            FFPsyBand  *psy_band = &ctx->ch[channel].psy_bands[w+g];
-
-            psy_band->threshold = band->thr;
-            psy_band->energy    = band->energy;
-        }
-    }
-
-    memcpy(pch->prev_band, pch->band, sizeof(pch->band));
-}
-
-static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
-                                   const float **coeffs, const FFPsyWindowInfo *wi)
-{
-    int ch;
-    FFPsyChannelGroup *group = ff_psy_find_group(ctx, channel);
-
-    for (ch = 0; ch < group->num_ch; ch++)
-        psy_3gpp_analyze_channel(ctx, channel + ch, coeffs[ch], &wi[ch]);
-}
-
-static av_cold void psy_3gpp_end(FFPsyContext *apc)
-{
-    AacPsyContext *pctx = (AacPsyContext*) apc->model_priv_data;
-    av_freep(&pctx->ch);
-    av_freep(&apc->model_priv_data);
-}
-
-static void lame_apply_block_type(AacPsyChannel *ctx, FFPsyWindowInfo *wi, int uselongblock)
-{
-    int blocktype = ONLY_LONG_SEQUENCE;
-    if (uselongblock) {
-        if (ctx->next_window_seq == EIGHT_SHORT_SEQUENCE)
-            blocktype = LONG_STOP_SEQUENCE;
-    } else {
-        blocktype = EIGHT_SHORT_SEQUENCE;
-        if (ctx->next_window_seq == ONLY_LONG_SEQUENCE)
-            ctx->next_window_seq = LONG_START_SEQUENCE;
-        if (ctx->next_window_seq == LONG_STOP_SEQUENCE)
-            ctx->next_window_seq = EIGHT_SHORT_SEQUENCE;
-    }
-
-    wi->window_type[0] = ctx->next_window_seq;
-    ctx->next_window_seq = blocktype;
-}
-
-static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
-                                       const float *la, int channel, int prev_type)
-{
-    AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
-    AacPsyChannel *pch  = &pctx->ch[channel];
-    int grouping     = 0;
-    int uselongblock = 1;
-    int attacks[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };
-    int i;
-    FFPsyWindowInfo wi = { { 0 } };
-
-    if (la) {
-        float hpfsmpl[AAC_BLOCK_SIZE_LONG];
-        float const *pf = hpfsmpl;
-        float attack_intensity[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
-        float energy_subshort[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS];
-        float energy_short[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };
-        const float *firbuf = la + (AAC_BLOCK_SIZE_SHORT/4 - PSY_LAME_FIR_LEN);
-        int j, att_sum = 0;
-
-        /* LAME comment: apply high pass filter of fs/4 */
-        for (i = 0; i < AAC_BLOCK_SIZE_LONG; i++) {
-            float sum1, sum2;
-            sum1 = firbuf[i + (PSY_LAME_FIR_LEN - 1) / 2];
-            sum2 = 0.0;
-            for (j = 0; j < ((PSY_LAME_FIR_LEN - 1) / 2) - 1; j += 2) {
-                sum1 += psy_fir_coeffs[j] * (firbuf[i + j] + firbuf[i + PSY_LAME_FIR_LEN - j]);
-                sum2 += psy_fir_coeffs[j + 1] * (firbuf[i + j + 1] + firbuf[i + PSY_LAME_FIR_LEN - j - 1]);
-            }
-            /* NOTE: The LAME psymodel expects its input in the range -32768 to
-             * 32768. Tuning this for normalized floats would be difficult. */
-            hpfsmpl[i] = (sum1 + sum2) * 32768.0f;
-        }
-
-        /* Calculate the energies of each sub-shortblock */
-        for (i = 0; i < PSY_LAME_NUM_SUBBLOCKS; i++) {
-            energy_subshort[i] = pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 1) * PSY_LAME_NUM_SUBBLOCKS)];
-            assert(pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 2) * PSY_LAME_NUM_SUBBLOCKS + 1)] > 0);
-            attack_intensity[i] = energy_subshort[i] / pch->prev_energy_subshort[i + ((AAC_NUM_BLOCKS_SHORT - 2) * PSY_LAME_NUM_SUBBLOCKS + 1)];
-            energy_short[0] += energy_subshort[i];
-        }
-
-        for (i = 0; i < AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS; i++) {
-            float const *const pfe = pf + AAC_BLOCK_SIZE_LONG / (AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS);
-            float p = 1.0f;
-            for (; pf < pfe; pf++)
-                p = FFMAX(p, fabsf(*pf));
-            pch->prev_energy_subshort[i] = energy_subshort[i + PSY_LAME_NUM_SUBBLOCKS] = p;
-            energy_short[1 + i / PSY_LAME_NUM_SUBBLOCKS] += p;
-            /* NOTE: The indexes below are [i + 3 - 2] in the LAME source.
-             *       Obviously the 3 and 2 have some significance, or this would be just [i + 1]
-             *       (which is what we use here). What the 3 stands for is ambiguous, as it is both
-             *       number of short blocks, and the number of sub-short blocks.
-             *       It seems that LAME is comparing each sub-block to sub-block + 1 in the
-             *       previous block.
-             */
-            if (p > energy_subshort[i + 1])
-                p = p / energy_subshort[i + 1];
-            else if (energy_subshort[i + 1] > p * 10.0f)
-                p = energy_subshort[i + 1] / (p * 10.0f);
-            else
-                p = 0.0;
-            attack_intensity[i + PSY_LAME_NUM_SUBBLOCKS] = p;
-        }
-
-        /* compare energy between sub-short blocks */
-        for (i = 0; i < (AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS; i++)
-            if (!attacks[i / PSY_LAME_NUM_SUBBLOCKS])
-                if (attack_intensity[i] > pch->attack_threshold)
-                    attacks[i / PSY_LAME_NUM_SUBBLOCKS] = (i % PSY_LAME_NUM_SUBBLOCKS) + 1;
-
-        /* should have energy change between short blocks, in order to avoid periodic signals */
-        /* Good samples to show the effect are Trumpet test songs */
-        /* GB: tuned (1) to avoid too many short blocks for test sample TRUMPET */
-        /* RH: tuned (2) to let enough short blocks through for test sample FSOL and SNAPS */
-        for (i = 1; i < AAC_NUM_BLOCKS_SHORT + 1; i++) {
-            float const u = energy_short[i - 1];
-            float const v = energy_short[i];
-            float const m = FFMAX(u, v);
-            if (m < 40000) {                          /* (2) */
-                if (u < 1.7f * v && v < 1.7f * u) {   /* (1) */
-                    if (i == 1 && attacks[0] < attacks[i])
-                        attacks[0] = 0;
-                    attacks[i] = 0;
-                }
-            }
-            att_sum += attacks[i];
-        }
-
-        if (attacks[0] <= pch->prev_attack)
-            attacks[0] = 0;
-
-        att_sum += attacks[0];
-        /* 3 below indicates the previous attack happened in the last sub-block of the previous sequence */
-        if (pch->prev_attack == 3 || att_sum) {
-            uselongblock = 0;
-
-            for (i = 1; i < AAC_NUM_BLOCKS_SHORT + 1; i++)
-                if (attacks[i] && attacks[i-1])
-                    attacks[i] = 0;
-        }
-    } else {
-        /* We have no lookahead info, so just use same type as the previous sequence. */
-        uselongblock = !(prev_type == EIGHT_SHORT_SEQUENCE);
-    }
-
-    lame_apply_block_type(pch, &wi, uselongblock);
-
-    wi.window_type[1] = prev_type;
-    if (wi.window_type[0] != EIGHT_SHORT_SEQUENCE) {
-        wi.num_windows  = 1;
-        wi.grouping[0]  = 1;
-        if (wi.window_type[0] == LONG_START_SEQUENCE)
-            wi.window_shape = 0;
-        else
-            wi.window_shape = 1;
-    } else {
-        int lastgrp = 0;
-
-        wi.num_windows = 8;
-        wi.window_shape = 0;
-        for (i = 0; i < 8; i++) {
-            if (!((pch->next_grouping >> i) & 1))
-                lastgrp = i;
-            wi.grouping[lastgrp]++;
-        }
-    }
-
-    /* Determine grouping, based on the location of the first attack, and save for
-     * the next frame.
-     * FIXME: Move this to analysis.
-     * TODO: Tune groupings depending on attack location
-     * TODO: Handle more than one attack in a group
-     */
-    for (i = 0; i < 9; i++) {
-        if (attacks[i]) {
-            grouping = i;
-            break;
-        }
-    }
-    pch->next_grouping = window_grouping[grouping];
-
-    pch->prev_attack = attacks[8];
-
-    return wi;
-}
-
-const FFPsyModel ff_aac_psy_model =
-{
-    .name    = "3GPP TS 26.403-inspired model",
-    .init    = psy_3gpp_init,
-    .window  = psy_lame_window,
-    .analyze = psy_3gpp_analyze,
-    .end     = psy_3gpp_end,
-};
diff --git a/deps/libav/libavcodec/aacsbr.c b/deps/libav/libavcodec/aacsbr.c
deleted file mode 100644
index 4d2ac6c..0000000
--- a/deps/libav/libavcodec/aacsbr.c
+++ /dev/null
@@ -1,1725 +0,0 @@
-/*
- * AAC Spectral Band Replication decoding functions
- * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
- * Copyright (c) 2009-2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC Spectral Band Replication decoding functions
- * @author Robert Swain ( rob opendot cl )
- */
-
-#include "aac.h"
-#include "sbr.h"
-#include "aacsbr.h"
-#include "aacsbrdata.h"
-#include "fft.h"
-#include "aacps.h"
-#include "sbrdsp.h"
-#include "libavutil/internal.h"
-#include "libavutil/libm.h"
-
-#include <stdint.h>
-#include <float.h>
-
-#define ENVELOPE_ADJUSTMENT_OFFSET 2
-#define NOISE_FLOOR_OFFSET 6.0f
-
-/**
- * SBR VLC tables
- */
-enum {
-    T_HUFFMAN_ENV_1_5DB,
-    F_HUFFMAN_ENV_1_5DB,
-    T_HUFFMAN_ENV_BAL_1_5DB,
-    F_HUFFMAN_ENV_BAL_1_5DB,
-    T_HUFFMAN_ENV_3_0DB,
-    F_HUFFMAN_ENV_3_0DB,
-    T_HUFFMAN_ENV_BAL_3_0DB,
-    F_HUFFMAN_ENV_BAL_3_0DB,
-    T_HUFFMAN_NOISE_3_0DB,
-    T_HUFFMAN_NOISE_BAL_3_0DB,
-};
-
-/**
- * bs_frame_class - frame class of current SBR frame (14496-3 sp04 p98)
- */
-enum {
-    FIXFIX,
-    FIXVAR,
-    VARFIX,
-    VARVAR,
-};
-
-enum {
-    EXTENSION_ID_PS = 2,
-};
-
-static VLC vlc_sbr[10];
-static const int8_t vlc_sbr_lav[10] =
-    { 60, 60, 24, 24, 31, 31, 12, 12, 31, 12 };
-
-#define SBR_INIT_VLC_STATIC(num, size) \
-    INIT_VLC_STATIC(&vlc_sbr[num], 9, sbr_tmp[num].table_size / sbr_tmp[num].elem_size,     \
-                    sbr_tmp[num].sbr_bits ,                      1,                      1, \
-                    sbr_tmp[num].sbr_codes, sbr_tmp[num].elem_size, sbr_tmp[num].elem_size, \
-                    size)
-
-#define SBR_VLC_ROW(name) \
-    { name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
-
-av_cold void ff_aac_sbr_init(void)
-{
-    int n;
-    static const struct {
-        const void *sbr_codes, *sbr_bits;
-        const unsigned int table_size, elem_size;
-    } sbr_tmp[] = {
-        SBR_VLC_ROW(t_huffman_env_1_5dB),
-        SBR_VLC_ROW(f_huffman_env_1_5dB),
-        SBR_VLC_ROW(t_huffman_env_bal_1_5dB),
-        SBR_VLC_ROW(f_huffman_env_bal_1_5dB),
-        SBR_VLC_ROW(t_huffman_env_3_0dB),
-        SBR_VLC_ROW(f_huffman_env_3_0dB),
-        SBR_VLC_ROW(t_huffman_env_bal_3_0dB),
-        SBR_VLC_ROW(f_huffman_env_bal_3_0dB),
-        SBR_VLC_ROW(t_huffman_noise_3_0dB),
-        SBR_VLC_ROW(t_huffman_noise_bal_3_0dB),
-    };
-
-    // SBR VLC table initialization
-    SBR_INIT_VLC_STATIC(0, 1098);
-    SBR_INIT_VLC_STATIC(1, 1092);
-    SBR_INIT_VLC_STATIC(2, 768);
-    SBR_INIT_VLC_STATIC(3, 1026);
-    SBR_INIT_VLC_STATIC(4, 1058);
-    SBR_INIT_VLC_STATIC(5, 1052);
-    SBR_INIT_VLC_STATIC(6, 544);
-    SBR_INIT_VLC_STATIC(7, 544);
-    SBR_INIT_VLC_STATIC(8, 592);
-    SBR_INIT_VLC_STATIC(9, 512);
-
-    for (n = 1; n < 320; n++)
-        sbr_qmf_window_us[320 + n] = sbr_qmf_window_us[320 - n];
-    sbr_qmf_window_us[384] = -sbr_qmf_window_us[384];
-    sbr_qmf_window_us[512] = -sbr_qmf_window_us[512];
-
-    for (n = 0; n < 320; n++)
-        sbr_qmf_window_ds[n] = sbr_qmf_window_us[2*n];
-
-    ff_ps_init();
-}
-
-/** Places SBR in pure upsampling mode. */
-static void sbr_turnoff(SpectralBandReplication *sbr) {
-    sbr->start = 0;
-    // Init defults used in pure upsampling mode
-    sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
-    sbr->m[1] = 0;
-    // Reset values for first SBR header
-    sbr->data[0].e_a[1] = sbr->data[1].e_a[1] = -1;
-    memset(&sbr->spectrum_params, -1, sizeof(SpectrumParameters));
-}
-
-av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
-{
-    sbr->kx[0] = sbr->kx[1];
-    sbr_turnoff(sbr);
-    sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
-    sbr->data[1].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
-    /* SBR requires samples to be scaled to +/-32768.0 to work correctly.
-     * mdct scale factors are adjusted to scale up from +/-1.0 at analysis
-     * and scale back down at synthesis. */
-    ff_mdct_init(&sbr->mdct,     7, 1, 1.0 / (64 * 32768.0));
-    ff_mdct_init(&sbr->mdct_ana, 7, 1, -2.0 * 32768.0);
-    ff_ps_ctx_init(&sbr->ps);
-    ff_sbrdsp_init(&sbr->dsp);
-}
-
-av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr)
-{
-    ff_mdct_end(&sbr->mdct);
-    ff_mdct_end(&sbr->mdct_ana);
-}
-
-static int qsort_comparison_function_int16(const void *a, const void *b)
-{
-    return *(const int16_t *)a - *(const int16_t *)b;
-}
-
-static inline int in_table_int16(const int16_t *table, int last_el, int16_t needle)
-{
-    int i;
-    for (i = 0; i <= last_el; i++)
-        if (table[i] == needle)
-            return 1;
-    return 0;
-}
-
-/// Limiter Frequency Band Table (14496-3 sp04 p198)
-static void sbr_make_f_tablelim(SpectralBandReplication *sbr)
-{
-    int k;
-    if (sbr->bs_limiter_bands > 0) {
-        static const float bands_warped[3] = { 1.32715174233856803909f,   //2^(0.49/1.2)
-                                               1.18509277094158210129f,   //2^(0.49/2)
-                                               1.11987160404675912501f }; //2^(0.49/3)
-        const float lim_bands_per_octave_warped = bands_warped[sbr->bs_limiter_bands - 1];
-        int16_t patch_borders[7];
-        uint16_t *in = sbr->f_tablelim + 1, *out = sbr->f_tablelim;
-
-        patch_borders[0] = sbr->kx[1];
-        for (k = 1; k <= sbr->num_patches; k++)
-            patch_borders[k] = patch_borders[k-1] + sbr->patch_num_subbands[k-1];
-
-        memcpy(sbr->f_tablelim, sbr->f_tablelow,
-               (sbr->n[0] + 1) * sizeof(sbr->f_tablelow[0]));
-        if (sbr->num_patches > 1)
-            memcpy(sbr->f_tablelim + sbr->n[0] + 1, patch_borders + 1,
-                   (sbr->num_patches - 1) * sizeof(patch_borders[0]));
-
-        qsort(sbr->f_tablelim, sbr->num_patches + sbr->n[0],
-              sizeof(sbr->f_tablelim[0]),
-              qsort_comparison_function_int16);
-
-        sbr->n_lim = sbr->n[0] + sbr->num_patches - 1;
-        while (out < sbr->f_tablelim + sbr->n_lim) {
-            if (*in >= *out * lim_bands_per_octave_warped) {
-                *++out = *in++;
-            } else if (*in == *out ||
-                !in_table_int16(patch_borders, sbr->num_patches, *in)) {
-                in++;
-                sbr->n_lim--;
-            } else if (!in_table_int16(patch_borders, sbr->num_patches, *out)) {
-                *out = *in++;
-                sbr->n_lim--;
-            } else {
-                *++out = *in++;
-            }
-        }
-    } else {
-        sbr->f_tablelim[0] = sbr->f_tablelow[0];
-        sbr->f_tablelim[1] = sbr->f_tablelow[sbr->n[0]];
-        sbr->n_lim = 1;
-    }
-}
-
-static unsigned int read_sbr_header(SpectralBandReplication *sbr, GetBitContext *gb)
-{
-    unsigned int cnt = get_bits_count(gb);
-    uint8_t bs_header_extra_1;
-    uint8_t bs_header_extra_2;
-    int old_bs_limiter_bands = sbr->bs_limiter_bands;
-    SpectrumParameters old_spectrum_params;
-
-    sbr->start = 1;
-
-    // Save last spectrum parameters variables to compare to new ones
-    memcpy(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters));
-
-    sbr->bs_amp_res_header              = get_bits1(gb);
-    sbr->spectrum_params.bs_start_freq  = get_bits(gb, 4);
-    sbr->spectrum_params.bs_stop_freq   = get_bits(gb, 4);
-    sbr->spectrum_params.bs_xover_band  = get_bits(gb, 3);
-                                          skip_bits(gb, 2); // bs_reserved
-
-    bs_header_extra_1 = get_bits1(gb);
-    bs_header_extra_2 = get_bits1(gb);
-
-    if (bs_header_extra_1) {
-        sbr->spectrum_params.bs_freq_scale  = get_bits(gb, 2);
-        sbr->spectrum_params.bs_alter_scale = get_bits1(gb);
-        sbr->spectrum_params.bs_noise_bands = get_bits(gb, 2);
-    } else {
-        sbr->spectrum_params.bs_freq_scale  = 2;
-        sbr->spectrum_params.bs_alter_scale = 1;
-        sbr->spectrum_params.bs_noise_bands = 2;
-    }
-
-    // Check if spectrum parameters changed
-    if (memcmp(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters)))
-        sbr->reset = 1;
-
-    if (bs_header_extra_2) {
-        sbr->bs_limiter_bands  = get_bits(gb, 2);
-        sbr->bs_limiter_gains  = get_bits(gb, 2);
-        sbr->bs_interpol_freq  = get_bits1(gb);
-        sbr->bs_smoothing_mode = get_bits1(gb);
-    } else {
-        sbr->bs_limiter_bands  = 2;
-        sbr->bs_limiter_gains  = 2;
-        sbr->bs_interpol_freq  = 1;
-        sbr->bs_smoothing_mode = 1;
-    }
-
-    if (sbr->bs_limiter_bands != old_bs_limiter_bands && !sbr->reset)
-        sbr_make_f_tablelim(sbr);
-
-    return get_bits_count(gb) - cnt;
-}
-
-static int array_min_int16(const int16_t *array, int nel)
-{
-    int i, min = array[0];
-    for (i = 1; i < nel; i++)
-        min = FFMIN(array[i], min);
-    return min;
-}
-
-static void make_bands(int16_t* bands, int start, int stop, int num_bands)
-{
-    int k, previous, present;
-    float base, prod;
-
-    base = powf((float)stop / start, 1.0f / num_bands);
-    prod = start;
-    previous = start;
-
-    for (k = 0; k < num_bands-1; k++) {
-        prod *= base;
-        present  = lrintf(prod);
-        bands[k] = present - previous;
-        previous = present;
-    }
-    bands[num_bands-1] = stop - previous;
-}
-
-static int check_n_master(AVCodecContext *avctx, int n_master, int bs_xover_band)
-{
-    // Requirements (14496-3 sp04 p205)
-    if (n_master <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid n_master: %d\n", n_master);
-        return -1;
-    }
-    if (bs_xover_band >= n_master) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Invalid bitstream, crossover band index beyond array bounds: %d\n",
-               bs_xover_band);
-        return -1;
-    }
-    return 0;
-}
-
-/// Master Frequency Band Table (14496-3 sp04 p194)
-static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
-                             SpectrumParameters *spectrum)
-{
-    unsigned int temp, max_qmf_subbands;
-    unsigned int start_min, stop_min;
-    int k;
-    const int8_t *sbr_offset_ptr;
-    int16_t stop_dk[13];
-
-    if (sbr->sample_rate < 32000) {
-        temp = 3000;
-    } else if (sbr->sample_rate < 64000) {
-        temp = 4000;
-    } else
-        temp = 5000;
-
-    start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
-    stop_min  = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
-
-    switch (sbr->sample_rate) {
-    case 16000:
-        sbr_offset_ptr = sbr_offset[0];
-        break;
-    case 22050:
-        sbr_offset_ptr = sbr_offset[1];
-        break;
-    case 24000:
-        sbr_offset_ptr = sbr_offset[2];
-        break;
-    case 32000:
-        sbr_offset_ptr = sbr_offset[3];
-        break;
-    case 44100: case 48000: case 64000:
-        sbr_offset_ptr = sbr_offset[4];
-        break;
-    case 88200: case 96000: case 128000: case 176400: case 192000:
-        sbr_offset_ptr = sbr_offset[5];
-        break;
-    default:
-        av_log(ac->avctx, AV_LOG_ERROR,
-               "Unsupported sample rate for SBR: %d\n", sbr->sample_rate);
-        return -1;
-    }
-
-    sbr->k[0] = start_min + sbr_offset_ptr[spectrum->bs_start_freq];
-
-    if (spectrum->bs_stop_freq < 14) {
-        sbr->k[2] = stop_min;
-        make_bands(stop_dk, stop_min, 64, 13);
-        qsort(stop_dk, 13, sizeof(stop_dk[0]), qsort_comparison_function_int16);
-        for (k = 0; k < spectrum->bs_stop_freq; k++)
-            sbr->k[2] += stop_dk[k];
-    } else if (spectrum->bs_stop_freq == 14) {
-        sbr->k[2] = 2*sbr->k[0];
-    } else if (spectrum->bs_stop_freq == 15) {
-        sbr->k[2] = 3*sbr->k[0];
-    } else {
-        av_log(ac->avctx, AV_LOG_ERROR,
-               "Invalid bs_stop_freq: %d\n", spectrum->bs_stop_freq);
-        return -1;
-    }
-    sbr->k[2] = FFMIN(64, sbr->k[2]);
-
-    // Requirements (14496-3 sp04 p205)
-    if (sbr->sample_rate <= 32000) {
-        max_qmf_subbands = 48;
-    } else if (sbr->sample_rate == 44100) {
-        max_qmf_subbands = 35;
-    } else if (sbr->sample_rate >= 48000)
-        max_qmf_subbands = 32;
-
-    if (sbr->k[2] - sbr->k[0] > max_qmf_subbands) {
-        av_log(ac->avctx, AV_LOG_ERROR,
-               "Invalid bitstream, too many QMF subbands: %d\n", sbr->k[2] - sbr->k[0]);
-        return -1;
-    }
-
-    if (!spectrum->bs_freq_scale) {
-        int dk, k2diff;
-
-        dk = spectrum->bs_alter_scale + 1;
-        sbr->n_master = ((sbr->k[2] - sbr->k[0] + (dk&2)) >> dk) << 1;
-        if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band))
-            return -1;
-
-        for (k = 1; k <= sbr->n_master; k++)
-            sbr->f_master[k] = dk;
-
-        k2diff = sbr->k[2] - sbr->k[0] - sbr->n_master * dk;
-        if (k2diff < 0) {
-            sbr->f_master[1]--;
-            sbr->f_master[2]-= (k2diff < -1);
-        } else if (k2diff) {
-            sbr->f_master[sbr->n_master]++;
-        }
-
-        sbr->f_master[0] = sbr->k[0];
-        for (k = 1; k <= sbr->n_master; k++)
-            sbr->f_master[k] += sbr->f_master[k - 1];
-
-    } else {
-        int half_bands = 7 - spectrum->bs_freq_scale;      // bs_freq_scale  = {1,2,3}
-        int two_regions, num_bands_0;
-        int vdk0_max, vdk1_min;
-        int16_t vk0[49];
-
-        if (49 * sbr->k[2] > 110 * sbr->k[0]) {
-            two_regions = 1;
-            sbr->k[1] = 2 * sbr->k[0];
-        } else {
-            two_regions = 0;
-            sbr->k[1] = sbr->k[2];
-        }
-
-        num_bands_0 = lrintf(half_bands * log2f(sbr->k[1] / (float)sbr->k[0])) * 2;
-
-        if (num_bands_0 <= 0) { // Requirements (14496-3 sp04 p205)
-            av_log(ac->avctx, AV_LOG_ERROR, "Invalid num_bands_0: %d\n", num_bands_0);
-            return -1;
-        }
-
-        vk0[0] = 0;
-
-        make_bands(vk0+1, sbr->k[0], sbr->k[1], num_bands_0);
-
-        qsort(vk0 + 1, num_bands_0, sizeof(vk0[1]), qsort_comparison_function_int16);
-        vdk0_max = vk0[num_bands_0];
-
-        vk0[0] = sbr->k[0];
-        for (k = 1; k <= num_bands_0; k++) {
-            if (vk0[k] <= 0) { // Requirements (14496-3 sp04 p205)
-                av_log(ac->avctx, AV_LOG_ERROR, "Invalid vDk0[%d]: %d\n", k, vk0[k]);
-                return -1;
-            }
-            vk0[k] += vk0[k-1];
-        }
-
-        if (two_regions) {
-            int16_t vk1[49];
-            float invwarp = spectrum->bs_alter_scale ? 0.76923076923076923077f
-                                                     : 1.0f; // bs_alter_scale = {0,1}
-            int num_bands_1 = lrintf(half_bands * invwarp *
-                                     log2f(sbr->k[2] / (float)sbr->k[1])) * 2;
-
-            make_bands(vk1+1, sbr->k[1], sbr->k[2], num_bands_1);
-
-            vdk1_min = array_min_int16(vk1 + 1, num_bands_1);
-
-            if (vdk1_min < vdk0_max) {
-                int change;
-                qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16);
-                change = FFMIN(vdk0_max - vk1[1], (vk1[num_bands_1] - vk1[1]) >> 1);
-                vk1[1]           += change;
-                vk1[num_bands_1] -= change;
-            }
-
-            qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16);
-
-            vk1[0] = sbr->k[1];
-            for (k = 1; k <= num_bands_1; k++) {
-                if (vk1[k] <= 0) { // Requirements (14496-3 sp04 p205)
-                    av_log(ac->avctx, AV_LOG_ERROR, "Invalid vDk1[%d]: %d\n", k, vk1[k]);
-                    return -1;
-                }
-                vk1[k] += vk1[k-1];
-            }
-
-            sbr->n_master = num_bands_0 + num_bands_1;
-            if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band))
-                return -1;
-            memcpy(&sbr->f_master[0],               vk0,
-                   (num_bands_0 + 1) * sizeof(sbr->f_master[0]));
-            memcpy(&sbr->f_master[num_bands_0 + 1], vk1 + 1,
-                    num_bands_1      * sizeof(sbr->f_master[0]));
-
-        } else {
-            sbr->n_master = num_bands_0;
-            if (check_n_master(ac->avctx, sbr->n_master, sbr->spectrum_params.bs_xover_band))
-                return -1;
-            memcpy(sbr->f_master, vk0, (num_bands_0 + 1) * sizeof(sbr->f_master[0]));
-        }
-    }
-
-    return 0;
-}
-
-/// High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46)
-static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
-{
-    int i, k, sb = 0;
-    int msb = sbr->k[0];
-    int usb = sbr->kx[1];
-    int goal_sb = ((1000 << 11) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
-
-    sbr->num_patches = 0;
-
-    if (goal_sb < sbr->kx[1] + sbr->m[1]) {
-        for (k = 0; sbr->f_master[k] < goal_sb; k++) ;
-    } else
-        k = sbr->n_master;
-
-    do {
-        int odd = 0;
-        for (i = k; i == k || sb > (sbr->k[0] - 1 + msb - odd); i--) {
-            sb = sbr->f_master[i];
-            odd = (sb + sbr->k[0]) & 1;
-        }
-
-        // Requirements (14496-3 sp04 p205) sets the maximum number of patches to 5.
-        // After this check the final number of patches can still be six which is
-        // illegal however the Coding Technologies decoder check stream has a final
-        // count of 6 patches
-        if (sbr->num_patches > 5) {
-            av_log(ac->avctx, AV_LOG_ERROR, "Too many patches: %d\n", sbr->num_patches);
-            return -1;
-        }
-
-        sbr->patch_num_subbands[sbr->num_patches]  = FFMAX(sb - usb, 0);
-        sbr->patch_start_subband[sbr->num_patches] = sbr->k[0] - odd - sbr->patch_num_subbands[sbr->num_patches];
-
-        if (sbr->patch_num_subbands[sbr->num_patches] > 0) {
-            usb = sb;
-            msb = sb;
-            sbr->num_patches++;
-        } else
-            msb = sbr->kx[1];
-
-        if (sbr->f_master[k] - sb < 3)
-            k = sbr->n_master;
-    } while (sb != sbr->kx[1] + sbr->m[1]);
-
-    if (sbr->patch_num_subbands[sbr->num_patches-1] < 3 && sbr->num_patches > 1)
-        sbr->num_patches--;
-
-    return 0;
-}
-
-/// Derived Frequency Band Tables (14496-3 sp04 p197)
-static int sbr_make_f_derived(AACContext *ac, SpectralBandReplication *sbr)
-{
-    int k, temp;
-
-    sbr->n[1] = sbr->n_master - sbr->spectrum_params.bs_xover_band;
-    sbr->n[0] = (sbr->n[1] + 1) >> 1;
-
-    memcpy(sbr->f_tablehigh, &sbr->f_master[sbr->spectrum_params.bs_xover_band],
-           (sbr->n[1] + 1) * sizeof(sbr->f_master[0]));
-    sbr->m[1] = sbr->f_tablehigh[sbr->n[1]] - sbr->f_tablehigh[0];
-    sbr->kx[1] = sbr->f_tablehigh[0];
-
-    // Requirements (14496-3 sp04 p205)
-    if (sbr->kx[1] + sbr->m[1] > 64) {
-        av_log(ac->avctx, AV_LOG_ERROR,
-               "Stop frequency border too high: %d\n", sbr->kx[1] + sbr->m[1]);
-        return -1;
-    }
-    if (sbr->kx[1] > 32) {
-        av_log(ac->avctx, AV_LOG_ERROR, "Start frequency border too high: %d\n", sbr->kx[1]);
-        return -1;
-    }
-
-    sbr->f_tablelow[0] = sbr->f_tablehigh[0];
-    temp = sbr->n[1] & 1;
-    for (k = 1; k <= sbr->n[0]; k++)
-        sbr->f_tablelow[k] = sbr->f_tablehigh[2 * k - temp];
-
-    sbr->n_q = FFMAX(1, lrintf(sbr->spectrum_params.bs_noise_bands *
-                               log2f(sbr->k[2] / (float)sbr->kx[1]))); // 0 <= bs_noise_bands <= 3
-    if (sbr->n_q > 5) {
-        av_log(ac->avctx, AV_LOG_ERROR, "Too many noise floor scale factors: %d\n", sbr->n_q);
-        return -1;
-    }
-
-    sbr->f_tablenoise[0] = sbr->f_tablelow[0];
-    temp = 0;
-    for (k = 1; k <= sbr->n_q; k++) {
-        temp += (sbr->n[0] - temp) / (sbr->n_q + 1 - k);
-        sbr->f_tablenoise[k] = sbr->f_tablelow[temp];
-    }
-
-    if (sbr_hf_calc_npatches(ac, sbr) < 0)
-        return -1;
-
-    sbr_make_f_tablelim(sbr);
-
-    sbr->data[0].f_indexnoise = 0;
-    sbr->data[1].f_indexnoise = 0;
-
-    return 0;
-}
-
-static av_always_inline void get_bits1_vector(GetBitContext *gb, uint8_t *vec,
-                                              int elements)
-{
-    int i;
-    for (i = 0; i < elements; i++) {
-        vec[i] = get_bits1(gb);
-    }
-}
-
-/** ceil(log2(index+1)) */
-static const int8_t ceil_log2[] = {
-    0, 1, 2, 2, 3, 3,
-};
-
-static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
-                         GetBitContext *gb, SBRData *ch_data)
-{
-    int i;
-    unsigned bs_pointer = 0;
-    // frameLengthFlag ? 15 : 16; 960 sample length frames unsupported; this value is numTimeSlots
-    int abs_bord_trail = 16;
-    int num_rel_lead, num_rel_trail;
-    unsigned bs_num_env_old = ch_data->bs_num_env;
-
-    ch_data->bs_freq_res[0] = ch_data->bs_freq_res[ch_data->bs_num_env];
-    ch_data->bs_amp_res = sbr->bs_amp_res_header;
-    ch_data->t_env_num_env_old = ch_data->t_env[bs_num_env_old];
-
-    switch (ch_data->bs_frame_class = get_bits(gb, 2)) {
-    case FIXFIX:
-        ch_data->bs_num_env                 = 1 << get_bits(gb, 2);
-        num_rel_lead                        = ch_data->bs_num_env - 1;
-        if (ch_data->bs_num_env == 1)
-            ch_data->bs_amp_res = 0;
-
-        if (ch_data->bs_num_env > 4) {
-            av_log(ac->avctx, AV_LOG_ERROR,
-                   "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
-                   ch_data->bs_num_env);
-            return -1;
-        }
-
-        ch_data->t_env[0]                   = 0;
-        ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
-
-        abs_bord_trail = (abs_bord_trail + (ch_data->bs_num_env >> 1)) /
-                   ch_data->bs_num_env;
-        for (i = 0; i < num_rel_lead; i++)
-            ch_data->t_env[i + 1] = ch_data->t_env[i] + abs_bord_trail;
-
-        ch_data->bs_freq_res[1] = get_bits1(gb);
-        for (i = 1; i < ch_data->bs_num_env; i++)
-            ch_data->bs_freq_res[i + 1] = ch_data->bs_freq_res[1];
-        break;
-    case FIXVAR:
-        abs_bord_trail                     += get_bits(gb, 2);
-        num_rel_trail                       = get_bits(gb, 2);
-        ch_data->bs_num_env                 = num_rel_trail + 1;
-        ch_data->t_env[0]                   = 0;
-        ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
-
-        for (i = 0; i < num_rel_trail; i++)
-            ch_data->t_env[ch_data->bs_num_env - 1 - i] =
-                ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
-
-        bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
-
-        for (i = 0; i < ch_data->bs_num_env; i++)
-            ch_data->bs_freq_res[ch_data->bs_num_env - i] = get_bits1(gb);
-        break;
-    case VARFIX:
-        ch_data->t_env[0]                   = get_bits(gb, 2);
-        num_rel_lead                        = get_bits(gb, 2);
-        ch_data->bs_num_env                 = num_rel_lead + 1;
-        ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
-
-        for (i = 0; i < num_rel_lead; i++)
-            ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2;
-
-        bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
-
-        get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env);
-        break;
-    case VARVAR:
-        ch_data->t_env[0]                   = get_bits(gb, 2);
-        abs_bord_trail                     += get_bits(gb, 2);
-        num_rel_lead                        = get_bits(gb, 2);
-        num_rel_trail                       = get_bits(gb, 2);
-        ch_data->bs_num_env                 = num_rel_lead + num_rel_trail + 1;
-
-        if (ch_data->bs_num_env > 5) {
-            av_log(ac->avctx, AV_LOG_ERROR,
-                   "Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n",
-                   ch_data->bs_num_env);
-            return -1;
-        }
-
-        ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
-
-        for (i = 0; i < num_rel_lead; i++)
-            ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2;
-        for (i = 0; i < num_rel_trail; i++)
-            ch_data->t_env[ch_data->bs_num_env - 1 - i] =
-                ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
-
-        bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
-
-        get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env);
-        break;
-    }
-
-    if (bs_pointer > ch_data->bs_num_env + 1) {
-        av_log(ac->avctx, AV_LOG_ERROR,
-               "Invalid bitstream, bs_pointer points to a middle noise border outside the time borders table: %d\n",
-               bs_pointer);
-        return -1;
-    }
-
-    for (i = 1; i <= ch_data->bs_num_env; i++) {
-        if (ch_data->t_env[i-1] > ch_data->t_env[i]) {
-            av_log(ac->avctx, AV_LOG_ERROR, "Non monotone time borders\n");
-            return -1;
-        }
-    }
-
-    ch_data->bs_num_noise = (ch_data->bs_num_env > 1) + 1;
-
-    ch_data->t_q[0]                     = ch_data->t_env[0];
-    ch_data->t_q[ch_data->bs_num_noise] = ch_data->t_env[ch_data->bs_num_env];
-    if (ch_data->bs_num_noise > 1) {
-        unsigned int idx;
-        if (ch_data->bs_frame_class == FIXFIX) {
-            idx = ch_data->bs_num_env >> 1;
-        } else if (ch_data->bs_frame_class & 1) { // FIXVAR or VARVAR
-            idx = ch_data->bs_num_env - FFMAX(bs_pointer - 1, 1);
-        } else { // VARFIX
-            if (!bs_pointer)
-                idx = 1;
-            else if (bs_pointer == 1)
-                idx = ch_data->bs_num_env - 1;
-            else // bs_pointer > 1
-                idx = bs_pointer - 1;
-        }
-        ch_data->t_q[1] = ch_data->t_env[idx];
-    }
-
-    ch_data->e_a[0] = -(ch_data->e_a[1] != bs_num_env_old); // l_APrev
-    ch_data->e_a[1] = -1;
-    if ((ch_data->bs_frame_class & 1) && bs_pointer) { // FIXVAR or VARVAR and bs_pointer != 0
-        ch_data->e_a[1] = ch_data->bs_num_env + 1 - bs_pointer;
-    } else if ((ch_data->bs_frame_class == 2) && (bs_pointer > 1)) // VARFIX and bs_pointer > 1
-        ch_data->e_a[1] = bs_pointer - 1;
-
-    return 0;
-}
-
-static void copy_sbr_grid(SBRData *dst, const SBRData *src) {
-    //These variables are saved from the previous frame rather than copied
-    dst->bs_freq_res[0]    = dst->bs_freq_res[dst->bs_num_env];
-    dst->t_env_num_env_old = dst->t_env[dst->bs_num_env];
-    dst->e_a[0]            = -(dst->e_a[1] != dst->bs_num_env);
-
-    //These variables are read from the bitstream and therefore copied
-    memcpy(dst->bs_freq_res+1, src->bs_freq_res+1, sizeof(dst->bs_freq_res)-sizeof(*dst->bs_freq_res));
-    memcpy(dst->t_env,         src->t_env,         sizeof(dst->t_env));
-    memcpy(dst->t_q,           src->t_q,           sizeof(dst->t_q));
-    dst->bs_num_env        = src->bs_num_env;
-    dst->bs_amp_res        = src->bs_amp_res;
-    dst->bs_num_noise      = src->bs_num_noise;
-    dst->bs_frame_class    = src->bs_frame_class;
-    dst->e_a[1]            = src->e_a[1];
-}
-
-/// Read how the envelope and noise floor data is delta coded
-static void read_sbr_dtdf(SpectralBandReplication *sbr, GetBitContext *gb,
-                          SBRData *ch_data)
-{
-    get_bits1_vector(gb, ch_data->bs_df_env,   ch_data->bs_num_env);
-    get_bits1_vector(gb, ch_data->bs_df_noise, ch_data->bs_num_noise);
-}
-
-/// Read inverse filtering data
-static void read_sbr_invf(SpectralBandReplication *sbr, GetBitContext *gb,
-                          SBRData *ch_data)
-{
-    int i;
-
-    memcpy(ch_data->bs_invf_mode[1], ch_data->bs_invf_mode[0], 5 * sizeof(uint8_t));
-    for (i = 0; i < sbr->n_q; i++)
-        ch_data->bs_invf_mode[0][i] = get_bits(gb, 2);
-}
-
-static void read_sbr_envelope(SpectralBandReplication *sbr, GetBitContext *gb,
-                              SBRData *ch_data, int ch)
-{
-    int bits;
-    int i, j, k;
-    VLC_TYPE (*t_huff)[2], (*f_huff)[2];
-    int t_lav, f_lav;
-    const int delta = (ch == 1 && sbr->bs_coupling == 1) + 1;
-    const int odd = sbr->n[1] & 1;
-
-    if (sbr->bs_coupling && ch) {
-        if (ch_data->bs_amp_res) {
-            bits   = 5;
-            t_huff = vlc_sbr[T_HUFFMAN_ENV_BAL_3_0DB].table;
-            t_lav  = vlc_sbr_lav[T_HUFFMAN_ENV_BAL_3_0DB];
-            f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_3_0DB].table;
-            f_lav  = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_3_0DB];
-        } else {
-            bits   = 6;
-            t_huff = vlc_sbr[T_HUFFMAN_ENV_BAL_1_5DB].table;
-            t_lav  = vlc_sbr_lav[T_HUFFMAN_ENV_BAL_1_5DB];
-            f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_1_5DB].table;
-            f_lav  = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_1_5DB];
-        }
-    } else {
-        if (ch_data->bs_amp_res) {
-            bits   = 6;
-            t_huff = vlc_sbr[T_HUFFMAN_ENV_3_0DB].table;
-            t_lav  = vlc_sbr_lav[T_HUFFMAN_ENV_3_0DB];
-            f_huff = vlc_sbr[F_HUFFMAN_ENV_3_0DB].table;
-            f_lav  = vlc_sbr_lav[F_HUFFMAN_ENV_3_0DB];
-        } else {
-            bits   = 7;
-            t_huff = vlc_sbr[T_HUFFMAN_ENV_1_5DB].table;
-            t_lav  = vlc_sbr_lav[T_HUFFMAN_ENV_1_5DB];
-            f_huff = vlc_sbr[F_HUFFMAN_ENV_1_5DB].table;
-            f_lav  = vlc_sbr_lav[F_HUFFMAN_ENV_1_5DB];
-        }
-    }
-
-    for (i = 0; i < ch_data->bs_num_env; i++) {
-        if (ch_data->bs_df_env[i]) {
-            // bs_freq_res[0] == bs_freq_res[bs_num_env] from prev frame
-            if (ch_data->bs_freq_res[i + 1] == ch_data->bs_freq_res[i]) {
-                for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++)
-                    ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][j] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
-            } else if (ch_data->bs_freq_res[i + 1]) {
-                for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) {
-                    k = (j + odd) >> 1; // find k such that f_tablelow[k] <= f_tablehigh[j] < f_tablelow[k + 1]
-                    ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][k] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
-                }
-            } else {
-                for (j = 0; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++) {
-                    k = j ? 2*j - odd : 0; // find k such that f_tablehigh[k] == f_tablelow[j]
-                    ch_data->env_facs[i + 1][j] = ch_data->env_facs[i][k] + delta * (get_vlc2(gb, t_huff, 9, 3) - t_lav);
-                }
-            }
-        } else {
-            ch_data->env_facs[i + 1][0] = delta * get_bits(gb, bits); // bs_env_start_value_balance
-            for (j = 1; j < sbr->n[ch_data->bs_freq_res[i + 1]]; j++)
-                ch_data->env_facs[i + 1][j] = ch_data->env_facs[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav);
-        }
-    }
-
-    //assign 0th elements of env_facs from last elements
-    memcpy(ch_data->env_facs[0], ch_data->env_facs[ch_data->bs_num_env],
-           sizeof(ch_data->env_facs[0]));
-}
-
-static void read_sbr_noise(SpectralBandReplication *sbr, GetBitContext *gb,
-                           SBRData *ch_data, int ch)
-{
-    int i, j;
-    VLC_TYPE (*t_huff)[2], (*f_huff)[2];
-    int t_lav, f_lav;
-    int delta = (ch == 1 && sbr->bs_coupling == 1) + 1;
-
-    if (sbr->bs_coupling && ch) {
-        t_huff = vlc_sbr[T_HUFFMAN_NOISE_BAL_3_0DB].table;
-        t_lav  = vlc_sbr_lav[T_HUFFMAN_NOISE_BAL_3_0DB];
-        f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_3_0DB].table;
-        f_lav  = vlc_sbr_lav[F_HUFFMAN_ENV_BAL_3_0DB];
-    } else {
-        t_huff = vlc_sbr[T_HUFFMAN_NOISE_3_0DB].table;
-        t_lav  = vlc_sbr_lav[T_HUFFMAN_NOISE_3_0DB];
-        f_huff = vlc_sbr[F_HUFFMAN_ENV_3_0DB].table;
-        f_lav  = vlc_sbr_lav[F_HUFFMAN_ENV_3_0DB];
-    }
-
-    for (i = 0; i < ch_data->bs_num_noise; i++) {
-        if (ch_data->bs_df_noise[i]) {
-            for (j = 0; j < sbr->n_q; j++)
-                ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i][j] + delta * (get_vlc2(gb, t_huff, 9, 2) - t_lav);
-        } else {
-            ch_data->noise_facs[i + 1][0] = delta * get_bits(gb, 5); // bs_noise_start_value_balance or bs_noise_start_value_level
-            for (j = 1; j < sbr->n_q; j++)
-                ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav);
-        }
-    }
-
-    //assign 0th elements of noise_facs from last elements
-    memcpy(ch_data->noise_facs[0], ch_data->noise_facs[ch_data->bs_num_noise],
-           sizeof(ch_data->noise_facs[0]));
-}
-
-static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
-                               GetBitContext *gb,
-                               int bs_extension_id, int *num_bits_left)
-{
-    switch (bs_extension_id) {
-    case EXTENSION_ID_PS:
-        if (!ac->oc[1].m4ac.ps) {
-            av_log(ac->avctx, AV_LOG_ERROR, "Parametric Stereo signaled to be not-present but was found in the bitstream.\n");
-            skip_bits_long(gb, *num_bits_left); // bs_fill_bits
-            *num_bits_left = 0;
-        } else {
-#if 1
-            *num_bits_left -= ff_ps_read_data(ac->avctx, gb, &sbr->ps, *num_bits_left);
-            ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
-#else
-            avpriv_report_missing_feature(ac->avctx, "Parametric Stereo");
-            skip_bits_long(gb, *num_bits_left); // bs_fill_bits
-            *num_bits_left = 0;
-#endif
-        }
-        break;
-    default:
-        avpriv_request_sample(ac->avctx, "Reserved SBR extensions");
-        skip_bits_long(gb, *num_bits_left); // bs_fill_bits
-        *num_bits_left = 0;
-        break;
-    }
-}
-
-static int read_sbr_single_channel_element(AACContext *ac,
-                                            SpectralBandReplication *sbr,
-                                            GetBitContext *gb)
-{
-    if (get_bits1(gb)) // bs_data_extra
-        skip_bits(gb, 4); // bs_reserved
-
-    if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]))
-        return -1;
-    read_sbr_dtdf(sbr, gb, &sbr->data[0]);
-    read_sbr_invf(sbr, gb, &sbr->data[0]);
-    read_sbr_envelope(sbr, gb, &sbr->data[0], 0);
-    read_sbr_noise(sbr, gb, &sbr->data[0], 0);
-
-    if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb)))
-        get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]);
-
-    return 0;
-}
-
-static int read_sbr_channel_pair_element(AACContext *ac,
-                                          SpectralBandReplication *sbr,
-                                          GetBitContext *gb)
-{
-    if (get_bits1(gb))    // bs_data_extra
-        skip_bits(gb, 8); // bs_reserved
-
-    if ((sbr->bs_coupling = get_bits1(gb))) {
-        if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]))
-            return -1;
-        copy_sbr_grid(&sbr->data[1], &sbr->data[0]);
-        read_sbr_dtdf(sbr, gb, &sbr->data[0]);
-        read_sbr_dtdf(sbr, gb, &sbr->data[1]);
-        read_sbr_invf(sbr, gb, &sbr->data[0]);
-        memcpy(sbr->data[1].bs_invf_mode[1], sbr->data[1].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0]));
-        memcpy(sbr->data[1].bs_invf_mode[0], sbr->data[0].bs_invf_mode[0], sizeof(sbr->data[1].bs_invf_mode[0]));
-        read_sbr_envelope(sbr, gb, &sbr->data[0], 0);
-        read_sbr_noise(sbr, gb, &sbr->data[0], 0);
-        read_sbr_envelope(sbr, gb, &sbr->data[1], 1);
-        read_sbr_noise(sbr, gb, &sbr->data[1], 1);
-    } else {
-        if (read_sbr_grid(ac, sbr, gb, &sbr->data[0]) ||
-            read_sbr_grid(ac, sbr, gb, &sbr->data[1]))
-            return -1;
-        read_sbr_dtdf(sbr, gb, &sbr->data[0]);
-        read_sbr_dtdf(sbr, gb, &sbr->data[1]);
-        read_sbr_invf(sbr, gb, &sbr->data[0]);
-        read_sbr_invf(sbr, gb, &sbr->data[1]);
-        read_sbr_envelope(sbr, gb, &sbr->data[0], 0);
-        read_sbr_envelope(sbr, gb, &sbr->data[1], 1);
-        read_sbr_noise(sbr, gb, &sbr->data[0], 0);
-        read_sbr_noise(sbr, gb, &sbr->data[1], 1);
-    }
-
-    if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb)))
-        get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]);
-    if ((sbr->data[1].bs_add_harmonic_flag = get_bits1(gb)))
-        get_bits1_vector(gb, sbr->data[1].bs_add_harmonic, sbr->n[1]);
-
-    return 0;
-}
-
-static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,
-                                  GetBitContext *gb, int id_aac)
-{
-    unsigned int cnt = get_bits_count(gb);
-
-    if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {
-        if (read_sbr_single_channel_element(ac, sbr, gb)) {
-            sbr_turnoff(sbr);
-            return get_bits_count(gb) - cnt;
-        }
-    } else if (id_aac == TYPE_CPE) {
-        if (read_sbr_channel_pair_element(ac, sbr, gb)) {
-            sbr_turnoff(sbr);
-            return get_bits_count(gb) - cnt;
-        }
-    } else {
-        av_log(ac->avctx, AV_LOG_ERROR,
-            "Invalid bitstream - cannot apply SBR to element type %d\n", id_aac);
-        sbr_turnoff(sbr);
-        return get_bits_count(gb) - cnt;
-    }
-    if (get_bits1(gb)) { // bs_extended_data
-        int num_bits_left = get_bits(gb, 4); // bs_extension_size
-        if (num_bits_left == 15)
-            num_bits_left += get_bits(gb, 8); // bs_esc_count
-
-        num_bits_left <<= 3;
-        while (num_bits_left > 7) {
-            num_bits_left -= 2;
-            read_sbr_extension(ac, sbr, gb, get_bits(gb, 2), &num_bits_left); // bs_extension_id
-        }
-        if (num_bits_left < 0) {
-            av_log(ac->avctx, AV_LOG_ERROR, "SBR Extension over read.\n");
-        }
-        if (num_bits_left > 0)
-            skip_bits(gb, num_bits_left);
-    }
-
-    return get_bits_count(gb) - cnt;
-}
-
-static void sbr_reset(AACContext *ac, SpectralBandReplication *sbr)
-{
-    int err;
-    err = sbr_make_f_master(ac, sbr, &sbr->spectrum_params);
-    if (err >= 0)
-        err = sbr_make_f_derived(ac, sbr);
-    if (err < 0) {
-        av_log(ac->avctx, AV_LOG_ERROR,
-               "SBR reset failed. Switching SBR to pure upsampling mode.\n");
-        sbr_turnoff(sbr);
-    }
-}
-
-/**
- * Decode Spectral Band Replication extension data; reference: table 4.55.
- *
- * @param   crc flag indicating the presence of CRC checksum
- * @param   cnt length of TYPE_FIL syntactic element in bytes
- *
- * @return  Returns number of bytes consumed from the TYPE_FIL element.
- */
-int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
-                            GetBitContext *gb_host, int crc, int cnt, int id_aac)
-{
-    unsigned int num_sbr_bits = 0, num_align_bits;
-    unsigned bytes_read;
-    GetBitContext gbc = *gb_host, *gb = &gbc;
-    skip_bits_long(gb_host, cnt*8 - 4);
-
-    sbr->reset = 0;
-
-    if (!sbr->sample_rate)
-        sbr->sample_rate = 2 * ac->oc[1].m4ac.sample_rate; //TODO use the nominal sample rate for arbitrary sample rate support
-    if (!ac->oc[1].m4ac.ext_sample_rate)
-        ac->oc[1].m4ac.ext_sample_rate = 2 * ac->oc[1].m4ac.sample_rate;
-
-    if (crc) {
-        skip_bits(gb, 10); // bs_sbr_crc_bits; TODO - implement CRC check
-        num_sbr_bits += 10;
-    }
-
-    //Save some state from the previous frame.
-    sbr->kx[0] = sbr->kx[1];
-    sbr->m[0] = sbr->m[1];
-    sbr->kx_and_m_pushed = 1;
-
-    num_sbr_bits++;
-    if (get_bits1(gb)) // bs_header_flag
-        num_sbr_bits += read_sbr_header(sbr, gb);
-
-    if (sbr->reset)
-        sbr_reset(ac, sbr);
-
-    if (sbr->start)
-        num_sbr_bits  += read_sbr_data(ac, sbr, gb, id_aac);
-
-    num_align_bits = ((cnt << 3) - 4 - num_sbr_bits) & 7;
-    bytes_read = ((num_sbr_bits + num_align_bits + 4) >> 3);
-
-    if (bytes_read > cnt) {
-        av_log(ac->avctx, AV_LOG_ERROR,
-               "Expected to read %d SBR bytes actually read %d.\n", cnt, bytes_read);
-    }
-    return cnt;
-}
-
-/// Dequantization and stereo decoding (14496-3 sp04 p203)
-static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
-{
-    int k, e;
-    int ch;
-
-    if (id_aac == TYPE_CPE && sbr->bs_coupling) {
-        float alpha      = sbr->data[0].bs_amp_res ?  1.0f :  0.5f;
-        float pan_offset = sbr->data[0].bs_amp_res ? 12.0f : 24.0f;
-        for (e = 1; e <= sbr->data[0].bs_num_env; e++) {
-            for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
-                float temp1 = exp2f(sbr->data[0].env_facs[e][k] * alpha + 7.0f);
-                float temp2 = exp2f((pan_offset - sbr->data[1].env_facs[e][k]) * alpha);
-                float fac   = temp1 / (1.0f + temp2);
-                sbr->data[0].env_facs[e][k] = fac;
-                sbr->data[1].env_facs[e][k] = fac * temp2;
-            }
-        }
-        for (e = 1; e <= sbr->data[0].bs_num_noise; e++) {
-            for (k = 0; k < sbr->n_q; k++) {
-                float temp1 = exp2f(NOISE_FLOOR_OFFSET - sbr->data[0].noise_facs[e][k] + 1);
-                float temp2 = exp2f(12 - sbr->data[1].noise_facs[e][k]);
-                float fac   = temp1 / (1.0f + temp2);
-                sbr->data[0].noise_facs[e][k] = fac;
-                sbr->data[1].noise_facs[e][k] = fac * temp2;
-            }
-        }
-    } else { // SCE or one non-coupled CPE
-        for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
-            float alpha = sbr->data[ch].bs_amp_res ? 1.0f : 0.5f;
-            for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
-                for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++)
-                    sbr->data[ch].env_facs[e][k] =
-                        exp2f(alpha * sbr->data[ch].env_facs[e][k] + 6.0f);
-            for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
-                for (k = 0; k < sbr->n_q; k++)
-                    sbr->data[ch].noise_facs[e][k] =
-                        exp2f(NOISE_FLOOR_OFFSET - sbr->data[ch].noise_facs[e][k]);
-        }
-    }
-}
-
-/**
- * Analysis QMF Bank (14496-3 sp04 p206)
- *
- * @param   x       pointer to the beginning of the first sample window
- * @param   W       array of complex-valued samples split into subbands
- */
-static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
-                             SBRDSPContext *sbrdsp, const float *in, float *x,
-                             float z[320], float W[2][32][32][2], int buf_idx)
-{
-    int i;
-    memcpy(x    , x+1024, (320-32)*sizeof(x[0]));
-    memcpy(x+288, in,         1024*sizeof(x[0]));
-    for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
-                               // are not supported
-        dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);
-        sbrdsp->sum64x5(z);
-        sbrdsp->qmf_pre_shuffle(z);
-        mdct->imdct_half(mdct, z, z+64);
-        sbrdsp->qmf_post_shuffle(W[buf_idx][i], z);
-        x += 32;
-    }
-}
-
-/**
- * Synthesis QMF Bank (14496-3 sp04 p206) and Downsampled Synthesis QMF Bank
- * (14496-3 sp04 p206)
- */
-static void sbr_qmf_synthesis(FFTContext *mdct,
-                              SBRDSPContext *sbrdsp, AVFloatDSPContext *dsp,
-                              float *out, float X[2][38][64],
-                              float mdct_buf[2][64],
-                              float *v0, int *v_off, const unsigned int div)
-{
-    int i, n;
-    const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us;
-    const int step = 128 >> div;
-    float *v;
-    for (i = 0; i < 32; i++) {
-        if (*v_off < step) {
-            int saved_samples = (1280 - 128) >> div;
-            memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(float));
-            *v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - step;
-        } else {
-            *v_off -= step;
-        }
-        v = v0 + *v_off;
-        if (div) {
-            for (n = 0; n < 32; n++) {
-                X[0][i][   n] = -X[0][i][n];
-                X[0][i][32+n] =  X[1][i][31-n];
-            }
-            mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
-            sbrdsp->qmf_deint_neg(v, mdct_buf[0]);
-        } else {
-            sbrdsp->neg_odd_64(X[1][i]);
-            mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
-            mdct->imdct_half(mdct, mdct_buf[1], X[1][i]);
-            sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]);
-        }
-        dsp->vector_fmul    (out, v                , sbr_qmf_window                       , 64 >> div);
-        dsp->vector_fmul_add(out, v + ( 192 >> div), sbr_qmf_window + ( 64 >> div), out   , 64 >> div);
-        dsp->vector_fmul_add(out, v + ( 256 >> div), sbr_qmf_window + (128 >> div), out   , 64 >> div);
-        dsp->vector_fmul_add(out, v + ( 448 >> div), sbr_qmf_window + (192 >> div), out   , 64 >> div);
-        dsp->vector_fmul_add(out, v + ( 512 >> div), sbr_qmf_window + (256 >> div), out   , 64 >> div);
-        dsp->vector_fmul_add(out, v + ( 704 >> div), sbr_qmf_window + (320 >> div), out   , 64 >> div);
-        dsp->vector_fmul_add(out, v + ( 768 >> div), sbr_qmf_window + (384 >> div), out   , 64 >> div);
-        dsp->vector_fmul_add(out, v + ( 960 >> div), sbr_qmf_window + (448 >> div), out   , 64 >> div);
-        dsp->vector_fmul_add(out, v + (1024 >> div), sbr_qmf_window + (512 >> div), out   , 64 >> div);
-        dsp->vector_fmul_add(out, v + (1216 >> div), sbr_qmf_window + (576 >> div), out   , 64 >> div);
-        out += 64 >> div;
-    }
-}
-
-/** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering
- * (14496-3 sp04 p214)
- * Warning: This routine does not seem numerically stable.
- */
-static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
-                                  float (*alpha0)[2], float (*alpha1)[2],
-                                  const float X_low[32][40][2], int k0)
-{
-    int k;
-    for (k = 0; k < k0; k++) {
-        LOCAL_ALIGNED_16(float, phi, [3], [2][2]);
-        float dk;
-
-        dsp->autocorrelate(X_low[k], phi);
-
-        dk =  phi[2][1][0] * phi[1][0][0] -
-             (phi[1][1][0] * phi[1][1][0] + phi[1][1][1] * phi[1][1][1]) / 1.000001f;
-
-        if (!dk) {
-            alpha1[k][0] = 0;
-            alpha1[k][1] = 0;
-        } else {
-            float temp_real, temp_im;
-            temp_real = phi[0][0][0] * phi[1][1][0] -
-                        phi[0][0][1] * phi[1][1][1] -
-                        phi[0][1][0] * phi[1][0][0];
-            temp_im   = phi[0][0][0] * phi[1][1][1] +
-                        phi[0][0][1] * phi[1][1][0] -
-                        phi[0][1][1] * phi[1][0][0];
-
-            alpha1[k][0] = temp_real / dk;
-            alpha1[k][1] = temp_im   / dk;
-        }
-
-        if (!phi[1][0][0]) {
-            alpha0[k][0] = 0;
-            alpha0[k][1] = 0;
-        } else {
-            float temp_real, temp_im;
-            temp_real = phi[0][0][0] + alpha1[k][0] * phi[1][1][0] +
-                                       alpha1[k][1] * phi[1][1][1];
-            temp_im   = phi[0][0][1] + alpha1[k][1] * phi[1][1][0] -
-                                       alpha1[k][0] * phi[1][1][1];
-
-            alpha0[k][0] = -temp_real / phi[1][0][0];
-            alpha0[k][1] = -temp_im   / phi[1][0][0];
-        }
-
-        if (alpha1[k][0] * alpha1[k][0] + alpha1[k][1] * alpha1[k][1] >= 16.0f ||
-           alpha0[k][0] * alpha0[k][0] + alpha0[k][1] * alpha0[k][1] >= 16.0f) {
-            alpha1[k][0] = 0;
-            alpha1[k][1] = 0;
-            alpha0[k][0] = 0;
-            alpha0[k][1] = 0;
-        }
-    }
-}
-
-/// Chirp Factors (14496-3 sp04 p214)
-static void sbr_chirp(SpectralBandReplication *sbr, SBRData *ch_data)
-{
-    int i;
-    float new_bw;
-    static const float bw_tab[] = { 0.0f, 0.75f, 0.9f, 0.98f };
-
-    for (i = 0; i < sbr->n_q; i++) {
-        if (ch_data->bs_invf_mode[0][i] + ch_data->bs_invf_mode[1][i] == 1) {
-            new_bw = 0.6f;
-        } else
-            new_bw = bw_tab[ch_data->bs_invf_mode[0][i]];
-
-        if (new_bw < ch_data->bw_array[i]) {
-            new_bw = 0.75f    * new_bw + 0.25f    * ch_data->bw_array[i];
-        } else
-            new_bw = 0.90625f * new_bw + 0.09375f * ch_data->bw_array[i];
-        ch_data->bw_array[i] = new_bw < 0.015625f ? 0.0f : new_bw;
-    }
-}
-
-/// Generate the subband filtered lowband
-static int sbr_lf_gen(AACContext *ac, SpectralBandReplication *sbr,
-                      float X_low[32][40][2], const float W[2][32][32][2],
-                      int buf_idx)
-{
-    int i, k;
-    const int t_HFGen = 8;
-    const int i_f = 32;
-    memset(X_low, 0, 32*sizeof(*X_low));
-    for (k = 0; k < sbr->kx[1]; k++) {
-        for (i = t_HFGen; i < i_f + t_HFGen; i++) {
-            X_low[k][i][0] = W[buf_idx][i - t_HFGen][k][0];
-            X_low[k][i][1] = W[buf_idx][i - t_HFGen][k][1];
-        }
-    }
-    buf_idx = 1-buf_idx;
-    for (k = 0; k < sbr->kx[0]; k++) {
-        for (i = 0; i < t_HFGen; i++) {
-            X_low[k][i][0] = W[buf_idx][i + i_f - t_HFGen][k][0];
-            X_low[k][i][1] = W[buf_idx][i + i_f - t_HFGen][k][1];
-        }
-    }
-    return 0;
-}
-
-/// High Frequency Generator (14496-3 sp04 p215)
-static int sbr_hf_gen(AACContext *ac, SpectralBandReplication *sbr,
-                      float X_high[64][40][2], const float X_low[32][40][2],
-                      const float (*alpha0)[2], const float (*alpha1)[2],
-                      const float bw_array[5], const uint8_t *t_env,
-                      int bs_num_env)
-{
-    int j, x;
-    int g = 0;
-    int k = sbr->kx[1];
-    for (j = 0; j < sbr->num_patches; j++) {
-        for (x = 0; x < sbr->patch_num_subbands[j]; x++, k++) {
-            const int p = sbr->patch_start_subband[j] + x;
-            while (g <= sbr->n_q && k >= sbr->f_tablenoise[g])
-                g++;
-            g--;
-
-            if (g < 0) {
-                av_log(ac->avctx, AV_LOG_ERROR,
-                       "ERROR : no subband found for frequency %d\n", k);
-                return -1;
-            }
-
-            sbr->dsp.hf_gen(X_high[k] + ENVELOPE_ADJUSTMENT_OFFSET,
-                            X_low[p]  + ENVELOPE_ADJUSTMENT_OFFSET,
-                            alpha0[p], alpha1[p], bw_array[g],
-                            2 * t_env[0], 2 * t_env[bs_num_env]);
-        }
-    }
-    if (k < sbr->m[1] + sbr->kx[1])
-        memset(X_high + k, 0, (sbr->m[1] + sbr->kx[1] - k) * sizeof(*X_high));
-
-    return 0;
-}
-
-/// Generate the subband filtered lowband
-static int sbr_x_gen(SpectralBandReplication *sbr, float X[2][38][64],
-                     const float Y0[38][64][2], const float Y1[38][64][2],
-                     const float X_low[32][40][2], int ch)
-{
-    int k, i;
-    const int i_f = 32;
-    const int i_Temp = FFMAX(2*sbr->data[ch].t_env_num_env_old - i_f, 0);
-    memset(X, 0, 2*sizeof(*X));
-    for (k = 0; k < sbr->kx[0]; k++) {
-        for (i = 0; i < i_Temp; i++) {
-            X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0];
-            X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1];
-        }
-    }
-    for (; k < sbr->kx[0] + sbr->m[0]; k++) {
-        for (i = 0; i < i_Temp; i++) {
-            X[0][i][k] = Y0[i + i_f][k][0];
-            X[1][i][k] = Y0[i + i_f][k][1];
-        }
-    }
-
-    for (k = 0; k < sbr->kx[1]; k++) {
-        for (i = i_Temp; i < 38; i++) {
-            X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0];
-            X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1];
-        }
-    }
-    for (; k < sbr->kx[1] + sbr->m[1]; k++) {
-        for (i = i_Temp; i < i_f; i++) {
-            X[0][i][k] = Y1[i][k][0];
-            X[1][i][k] = Y1[i][k][1];
-        }
-    }
-    return 0;
-}
-
-/** High Frequency Adjustment (14496-3 sp04 p217) and Mapping
- * (14496-3 sp04 p217)
- */
-static int sbr_mapping(AACContext *ac, SpectralBandReplication *sbr,
-                        SBRData *ch_data, int e_a[2])
-{
-    int e, i, m;
-
-    memset(ch_data->s_indexmapped[1], 0, 7*sizeof(ch_data->s_indexmapped[1]));
-    for (e = 0; e < ch_data->bs_num_env; e++) {
-        const unsigned int ilim = sbr->n[ch_data->bs_freq_res[e + 1]];
-        uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
-        int k;
-
-        if (sbr->kx[1] != table[0]) {
-            av_log(ac->avctx, AV_LOG_ERROR, "kx != f_table{high,low}[0]. "
-                   "Derived frequency tables were not regenerated.\n");
-            sbr_turnoff(sbr);
-            return AVERROR_BUG;
-        }
-        for (i = 0; i < ilim; i++)
-            for (m = table[i]; m < table[i + 1]; m++)
-                sbr->e_origmapped[e][m - sbr->kx[1]] = ch_data->env_facs[e+1][i];
-
-        // ch_data->bs_num_noise > 1 => 2 noise floors
-        k = (ch_data->bs_num_noise > 1) && (ch_data->t_env[e] >= ch_data->t_q[1]);
-        for (i = 0; i < sbr->n_q; i++)
-            for (m = sbr->f_tablenoise[i]; m < sbr->f_tablenoise[i + 1]; m++)
-                sbr->q_mapped[e][m - sbr->kx[1]] = ch_data->noise_facs[k+1][i];
-
-        for (i = 0; i < sbr->n[1]; i++) {
-            if (ch_data->bs_add_harmonic_flag) {
-                const unsigned int m_midpoint =
-                    (sbr->f_tablehigh[i] + sbr->f_tablehigh[i + 1]) >> 1;
-
-                ch_data->s_indexmapped[e + 1][m_midpoint - sbr->kx[1]] = ch_data->bs_add_harmonic[i] *
-                    (e >= e_a[1] || (ch_data->s_indexmapped[0][m_midpoint - sbr->kx[1]] == 1));
-            }
-        }
-
-        for (i = 0; i < ilim; i++) {
-            int additional_sinusoid_present = 0;
-            for (m = table[i]; m < table[i + 1]; m++) {
-                if (ch_data->s_indexmapped[e + 1][m - sbr->kx[1]]) {
-                    additional_sinusoid_present = 1;
-                    break;
-                }
-            }
-            memset(&sbr->s_mapped[e][table[i] - sbr->kx[1]], additional_sinusoid_present,
-                   (table[i + 1] - table[i]) * sizeof(sbr->s_mapped[e][0]));
-        }
-    }
-
-    memcpy(ch_data->s_indexmapped[0], ch_data->s_indexmapped[ch_data->bs_num_env], sizeof(ch_data->s_indexmapped[0]));
-    return 0;
-}
-
-/// Estimation of current envelope (14496-3 sp04 p218)
-static void sbr_env_estimate(float (*e_curr)[48], float X_high[64][40][2],
-                             SpectralBandReplication *sbr, SBRData *ch_data)
-{
-    int e, m;
-    int kx1 = sbr->kx[1];
-
-    if (sbr->bs_interpol_freq) {
-        for (e = 0; e < ch_data->bs_num_env; e++) {
-            const float recip_env_size = 0.5f / (ch_data->t_env[e + 1] - ch_data->t_env[e]);
-            int ilb = ch_data->t_env[e]     * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
-            int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
-
-            for (m = 0; m < sbr->m[1]; m++) {
-                float sum = sbr->dsp.sum_square(X_high[m+kx1] + ilb, iub - ilb);
-                e_curr[e][m] = sum * recip_env_size;
-            }
-        }
-    } else {
-        int k, p;
-
-        for (e = 0; e < ch_data->bs_num_env; e++) {
-            const int env_size = 2 * (ch_data->t_env[e + 1] - ch_data->t_env[e]);
-            int ilb = ch_data->t_env[e]     * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
-            int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
-            const uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
-
-            for (p = 0; p < sbr->n[ch_data->bs_freq_res[e + 1]]; p++) {
-                float sum = 0.0f;
-                const int den = env_size * (table[p + 1] - table[p]);
-
-                for (k = table[p]; k < table[p + 1]; k++) {
-                    sum += sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb);
-                }
-                sum /= den;
-                for (k = table[p]; k < table[p + 1]; k++) {
-                    e_curr[e][k - kx1] = sum;
-                }
-            }
-        }
-    }
-}
-
-/**
- * Calculation of levels of additional HF signal components (14496-3 sp04 p219)
- * and Calculation of gain (14496-3 sp04 p219)
- */
-static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr,
-                          SBRData *ch_data, const int e_a[2])
-{
-    int e, k, m;
-    // max gain limits : -3dB, 0dB, 3dB, inf dB (limiter off)
-    static const float limgain[4] = { 0.70795, 1.0, 1.41254, 10000000000 };
-
-    for (e = 0; e < ch_data->bs_num_env; e++) {
-        int delta = !((e == e_a[1]) || (e == e_a[0]));
-        for (k = 0; k < sbr->n_lim; k++) {
-            float gain_boost, gain_max;
-            float sum[2] = { 0.0f, 0.0f };
-            for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
-                const float temp = sbr->e_origmapped[e][m] / (1.0f + sbr->q_mapped[e][m]);
-                sbr->q_m[e][m] = sqrtf(temp * sbr->q_mapped[e][m]);
-                sbr->s_m[e][m] = sqrtf(temp * ch_data->s_indexmapped[e + 1][m]);
-                if (!sbr->s_mapped[e][m]) {
-                    sbr->gain[e][m] = sqrtf(sbr->e_origmapped[e][m] /
-                                            ((1.0f + sbr->e_curr[e][m]) *
-                                             (1.0f + sbr->q_mapped[e][m] * delta)));
-                } else {
-                    sbr->gain[e][m] = sqrtf(sbr->e_origmapped[e][m] * sbr->q_mapped[e][m] /
-                                            ((1.0f + sbr->e_curr[e][m]) *
-                                             (1.0f + sbr->q_mapped[e][m])));
-                }
-            }
-            for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
-                sum[0] += sbr->e_origmapped[e][m];
-                sum[1] += sbr->e_curr[e][m];
-            }
-            gain_max = limgain[sbr->bs_limiter_gains] * sqrtf((FLT_EPSILON + sum[0]) / (FLT_EPSILON + sum[1]));
-            gain_max = FFMIN(100000.f, gain_max);
-            for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
-                float q_m_max   = sbr->q_m[e][m] * gain_max / sbr->gain[e][m];
-                sbr->q_m[e][m]  = FFMIN(sbr->q_m[e][m], q_m_max);
-                sbr->gain[e][m] = FFMIN(sbr->gain[e][m], gain_max);
-            }
-            sum[0] = sum[1] = 0.0f;
-            for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
-                sum[0] += sbr->e_origmapped[e][m];
-                sum[1] += sbr->e_curr[e][m] * sbr->gain[e][m] * sbr->gain[e][m]
-                          + sbr->s_m[e][m] * sbr->s_m[e][m]
-                          + (delta && !sbr->s_m[e][m]) * sbr->q_m[e][m] * sbr->q_m[e][m];
-            }
-            gain_boost = sqrtf((FLT_EPSILON + sum[0]) / (FLT_EPSILON + sum[1]));
-            gain_boost = FFMIN(1.584893192f, gain_boost);
-            for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
-                sbr->gain[e][m] *= gain_boost;
-                sbr->q_m[e][m]  *= gain_boost;
-                sbr->s_m[e][m]  *= gain_boost;
-            }
-        }
-    }
-}
-
-/// Assembling HF Signals (14496-3 sp04 p220)
-static void sbr_hf_assemble(float Y1[38][64][2],
-                            const float X_high[64][40][2],
-                            SpectralBandReplication *sbr, SBRData *ch_data,
-                            const int e_a[2])
-{
-    int e, i, j, m;
-    const int h_SL = 4 * !sbr->bs_smoothing_mode;
-    const int kx = sbr->kx[1];
-    const int m_max = sbr->m[1];
-    static const float h_smooth[5] = {
-        0.33333333333333,
-        0.30150283239582,
-        0.21816949906249,
-        0.11516383427084,
-        0.03183050093751,
-    };
-    static const int8_t phi[2][4] = {
-        {  1,  0, -1,  0}, // real
-        {  0,  1,  0, -1}, // imaginary
-    };
-    float (*g_temp)[48] = ch_data->g_temp, (*q_temp)[48] = ch_data->q_temp;
-    int indexnoise = ch_data->f_indexnoise;
-    int indexsine  = ch_data->f_indexsine;
-
-    if (sbr->reset) {
-        for (i = 0; i < h_SL; i++) {
-            memcpy(g_temp[i + 2*ch_data->t_env[0]], sbr->gain[0], m_max * sizeof(sbr->gain[0][0]));
-            memcpy(q_temp[i + 2*ch_data->t_env[0]], sbr->q_m[0],  m_max * sizeof(sbr->q_m[0][0]));
-        }
-    } else if (h_SL) {
-        memcpy(g_temp[2*ch_data->t_env[0]], g_temp[2*ch_data->t_env_num_env_old], 4*sizeof(g_temp[0]));
-        memcpy(q_temp[2*ch_data->t_env[0]], q_temp[2*ch_data->t_env_num_env_old], 4*sizeof(q_temp[0]));
-    }
-
-    for (e = 0; e < ch_data->bs_num_env; e++) {
-        for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
-            memcpy(g_temp[h_SL + i], sbr->gain[e], m_max * sizeof(sbr->gain[0][0]));
-            memcpy(q_temp[h_SL + i], sbr->q_m[e],  m_max * sizeof(sbr->q_m[0][0]));
-        }
-    }
-
-    for (e = 0; e < ch_data->bs_num_env; e++) {
-        for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
-            int phi_sign = (1 - 2*(kx & 1));
-            LOCAL_ALIGNED_16(float, g_filt_tab, [48]);
-            LOCAL_ALIGNED_16(float, q_filt_tab, [48]);
-            float *g_filt, *q_filt;
-
-            if (h_SL && e != e_a[0] && e != e_a[1]) {
-                g_filt = g_filt_tab;
-                q_filt = q_filt_tab;
-                for (m = 0; m < m_max; m++) {
-                    const int idx1 = i + h_SL;
-                    g_filt[m] = 0.0f;
-                    q_filt[m] = 0.0f;
-                    for (j = 0; j <= h_SL; j++) {
-                        g_filt[m] += g_temp[idx1 - j][m] * h_smooth[j];
-                        q_filt[m] += q_temp[idx1 - j][m] * h_smooth[j];
-                    }
-                }
-            } else {
-                g_filt = g_temp[i + h_SL];
-                q_filt = q_temp[i];
-            }
-
-            sbr->dsp.hf_g_filt(Y1[i] + kx, X_high + kx, g_filt, m_max,
-                               i + ENVELOPE_ADJUSTMENT_OFFSET);
-
-            if (e != e_a[0] && e != e_a[1]) {
-                sbr->dsp.hf_apply_noise[indexsine](Y1[i] + kx, sbr->s_m[e],
-                                                   q_filt, indexnoise,
-                                                   kx, m_max);
-            } else {
-                for (m = 0; m < m_max; m++) {
-                    Y1[i][m + kx][0] +=
-                        sbr->s_m[e][m] * phi[0][indexsine];
-                    Y1[i][m + kx][1] +=
-                        sbr->s_m[e][m] * (phi[1][indexsine] * phi_sign);
-                    phi_sign = -phi_sign;
-                }
-            }
-            indexnoise = (indexnoise + m_max) & 0x1ff;
-            indexsine = (indexsine + 1) & 3;
-        }
-    }
-    ch_data->f_indexnoise = indexnoise;
-    ch_data->f_indexsine  = indexsine;
-}
-
-void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
-                  float* L, float* R)
-{
-    int downsampled = ac->oc[1].m4ac.ext_sample_rate < sbr->sample_rate;
-    int ch;
-    int nch = (id_aac == TYPE_CPE) ? 2 : 1;
-    int err;
-
-    if (!sbr->kx_and_m_pushed) {
-        sbr->kx[0] = sbr->kx[1];
-        sbr->m[0] = sbr->m[1];
-    } else {
-        sbr->kx_and_m_pushed = 0;
-    }
-
-    if (sbr->start) {
-        sbr_dequant(sbr, id_aac);
-    }
-    for (ch = 0; ch < nch; ch++) {
-        /* decode channel */
-        sbr_qmf_analysis(&ac->fdsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
-                         (float*)sbr->qmf_filter_scratch,
-                         sbr->data[ch].W, sbr->data[ch].Ypos);
-        sbr_lf_gen(ac, sbr, sbr->X_low,
-                   (const float (*)[32][32][2]) sbr->data[ch].W,
-                   sbr->data[ch].Ypos);
-        sbr->data[ch].Ypos ^= 1;
-        if (sbr->start) {
-            sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1,
-                                  (const float (*)[40][2]) sbr->X_low, sbr->k[0]);
-            sbr_chirp(sbr, &sbr->data[ch]);
-            sbr_hf_gen(ac, sbr, sbr->X_high,
-                       (const float (*)[40][2]) sbr->X_low,
-                       (const float (*)[2]) sbr->alpha0,
-                       (const float (*)[2]) sbr->alpha1,
-                       sbr->data[ch].bw_array, sbr->data[ch].t_env,
-                       sbr->data[ch].bs_num_env);
-
-            // hf_adj
-            err = sbr_mapping(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a);
-            if (!err) {
-                sbr_env_estimate(sbr->e_curr, sbr->X_high, sbr, &sbr->data[ch]);
-                sbr_gain_calc(ac, sbr, &sbr->data[ch], sbr->data[ch].e_a);
-                sbr_hf_assemble(sbr->data[ch].Y[sbr->data[ch].Ypos],
-                                (const float (*)[40][2]) sbr->X_high,
-                                sbr, &sbr->data[ch],
-                                sbr->data[ch].e_a);
-            }
-        }
-
-        /* synthesis */
-        sbr_x_gen(sbr, sbr->X[ch],
-                  (const float (*)[64][2]) sbr->data[ch].Y[1-sbr->data[ch].Ypos],
-                  (const float (*)[64][2]) sbr->data[ch].Y[  sbr->data[ch].Ypos],
-                  (const float (*)[40][2]) sbr->X_low, ch);
-    }
-
-    if (ac->oc[1].m4ac.ps == 1) {
-        if (sbr->ps.start) {
-            ff_ps_apply(ac->avctx, &sbr->ps, sbr->X[0], sbr->X[1], sbr->kx[1] + sbr->m[1]);
-        } else {
-            memcpy(sbr->X[1], sbr->X[0], sizeof(sbr->X[0]));
-        }
-        nch = 2;
-    }
-
-    sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, &ac->fdsp,
-                      L, sbr->X[0], sbr->qmf_filter_scratch,
-                      sbr->data[0].synthesis_filterbank_samples,
-                      &sbr->data[0].synthesis_filterbank_samples_offset,
-                      downsampled);
-    if (nch == 2)
-        sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, &ac->fdsp,
-                          R, sbr->X[1], sbr->qmf_filter_scratch,
-                          sbr->data[1].synthesis_filterbank_samples,
-                          &sbr->data[1].synthesis_filterbank_samples_offset,
-                          downsampled);
-}
diff --git a/deps/libav/libavcodec/aacsbr.h b/deps/libav/libavcodec/aacsbr.h
deleted file mode 100644
index 9bc5e29..0000000
--- a/deps/libav/libavcodec/aacsbr.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * AAC Spectral Band Replication function declarations
- * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
- * Copyright (c) 2010      Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC Spectral Band Replication function declarations
- * @author Robert Swain ( rob opendot cl )
- */
-
-#ifndef AVCODEC_AACSBR_H
-#define AVCODEC_AACSBR_H
-
-#include "get_bits.h"
-#include "aac.h"
-#include "sbr.h"
-
-/** Initialize SBR. */
-void ff_aac_sbr_init(void);
-/** Initialize one SBR context. */
-void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr);
-/** Close one SBR context. */
-void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr);
-/** Decode one SBR element. */
-int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
-                            GetBitContext *gb, int crc, int cnt, int id_aac);
-/** Apply one SBR element to one AAC element. */
-void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
-                  float* L, float *R);
-
-#endif /* AVCODEC_AACSBR_H */
diff --git a/deps/libav/libavcodec/aacsbrdata.h b/deps/libav/libavcodec/aacsbrdata.h
deleted file mode 100644
index f309059..0000000
--- a/deps/libav/libavcodec/aacsbrdata.h
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
- * AAC Spectral Band Replication decoding data
- * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC Spectral Band Replication decoding data
- * @author Robert Swain ( rob opendot cl )
- */
-
-#ifndef AVCODEC_AACSBRDATA_H
-#define AVCODEC_AACSBRDATA_H
-
-#include <stdint.h>
-#include "libavutil/mem.h"
-
-///< Huffman tables for SBR
-
-static const uint8_t t_huffman_env_1_5dB_bits[121] = {
-    18, 18, 18, 18, 18, 18, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 17, 18, 16, 17, 18, 17,
-    16, 16, 16, 16, 15, 14, 14, 13,
-    13, 12, 11, 10,  9,  8,  7,  6,
-     5,  4,  3,  2,  2,  3,  4,  5,
-     6,  7,  8,  9, 10, 12, 13, 14,
-    14, 15, 16, 17, 16, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19,
-};
-
-static const uint32_t t_huffman_env_1_5dB_codes[121] = {
-    0x3ffd6, 0x3ffd7, 0x3ffd8, 0x3ffd9, 0x3ffda, 0x3ffdb, 0x7ffb8, 0x7ffb9,
-    0x7ffba, 0x7ffbb, 0x7ffbc, 0x7ffbd, 0x7ffbe, 0x7ffbf, 0x7ffc0, 0x7ffc1,
-    0x7ffc2, 0x7ffc3, 0x7ffc4, 0x7ffc5, 0x7ffc6, 0x7ffc7, 0x7ffc8, 0x7ffc9,
-    0x7ffca, 0x7ffcb, 0x7ffcc, 0x7ffcd, 0x7ffce, 0x7ffcf, 0x7ffd0, 0x7ffd1,
-    0x7ffd2, 0x7ffd3, 0x1ffe6, 0x3ffd4, 0x0fff0, 0x1ffe9, 0x3ffd5, 0x1ffe7,
-    0x0fff1, 0x0ffec, 0x0ffed, 0x0ffee, 0x07ff4, 0x03ff9, 0x03ff7, 0x01ffa,
-    0x01ff9, 0x00ffb, 0x007fc, 0x003fc, 0x001fd, 0x000fd, 0x0007d, 0x0003d,
-    0x0001d, 0x0000d, 0x00005, 0x00001, 0x00000, 0x00004, 0x0000c, 0x0001c,
-    0x0003c, 0x0007c, 0x000fc, 0x001fc, 0x003fd, 0x00ffa, 0x01ff8, 0x03ff6,
-    0x03ff8, 0x07ff5, 0x0ffef, 0x1ffe8, 0x0fff2, 0x7ffd4, 0x7ffd5, 0x7ffd6,
-    0x7ffd7, 0x7ffd8, 0x7ffd9, 0x7ffda, 0x7ffdb, 0x7ffdc, 0x7ffdd, 0x7ffde,
-    0x7ffdf, 0x7ffe0, 0x7ffe1, 0x7ffe2, 0x7ffe3, 0x7ffe4, 0x7ffe5, 0x7ffe6,
-    0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb, 0x7ffec, 0x7ffed, 0x7ffee,
-    0x7ffef, 0x7fff0, 0x7fff1, 0x7fff2, 0x7fff3, 0x7fff4, 0x7fff5, 0x7fff6,
-    0x7fff7, 0x7fff8, 0x7fff9, 0x7fffa, 0x7fffb, 0x7fffc, 0x7fffd, 0x7fffe,
-    0x7ffff,
-};
-
-static const uint8_t f_huffman_env_1_5dB_bits[121] = {
-    19, 19, 20, 20, 20, 20, 20, 20,
-    20, 19, 20, 20, 20, 20, 19, 20,
-    19, 19, 20, 18, 20, 20, 20, 19,
-    20, 20, 20, 19, 20, 19, 18, 19,
-    18, 18, 17, 18, 17, 17, 17, 16,
-    16, 16, 15, 15, 14, 13, 13, 12,
-    12, 11, 10,  9,  9,  8,  7,  6,
-     5,  4,  3,  2,  2,  3,  4,  5,
-     6,  8,  8,  9, 10, 11, 11, 11,
-    12, 12, 13, 13, 14, 14, 16, 16,
-    17, 17, 18, 18, 18, 18, 18, 18,
-    18, 20, 19, 20, 20, 20, 20, 20,
-    20, 19, 20, 20, 20, 20, 19, 20,
-    18, 20, 20, 19, 19, 20, 20, 20,
-    20, 20, 20, 20, 20, 20, 20, 20,
-    20,
-};
-
-static const uint32_t f_huffman_env_1_5dB_codes[121] = {
-    0x7ffe7, 0x7ffe8, 0xfffd2, 0xfffd3, 0xfffd4, 0xfffd5, 0xfffd6, 0xfffd7,
-    0xfffd8, 0x7ffda, 0xfffd9, 0xfffda, 0xfffdb, 0xfffdc, 0x7ffdb, 0xfffdd,
-    0x7ffdc, 0x7ffdd, 0xfffde, 0x3ffe4, 0xfffdf, 0xfffe0, 0xfffe1, 0x7ffde,
-    0xfffe2, 0xfffe3, 0xfffe4, 0x7ffdf, 0xfffe5, 0x7ffe0, 0x3ffe8, 0x7ffe1,
-    0x3ffe0, 0x3ffe9, 0x1ffef, 0x3ffe5, 0x1ffec, 0x1ffed, 0x1ffee, 0x0fff4,
-    0x0fff3, 0x0fff0, 0x07ff7, 0x07ff6, 0x03ffa, 0x01ffa, 0x01ff9, 0x00ffa,
-    0x00ff8, 0x007f9, 0x003fb, 0x001fc, 0x001fa, 0x000fb, 0x0007c, 0x0003c,
-    0x0001c, 0x0000c, 0x00005, 0x00001, 0x00000, 0x00004, 0x0000d, 0x0001d,
-    0x0003d, 0x000fa, 0x000fc, 0x001fb, 0x003fa, 0x007f8, 0x007fa, 0x007fb,
-    0x00ff9, 0x00ffb, 0x01ff8, 0x01ffb, 0x03ff8, 0x03ff9, 0x0fff1, 0x0fff2,
-    0x1ffea, 0x1ffeb, 0x3ffe1, 0x3ffe2, 0x3ffea, 0x3ffe3, 0x3ffe6, 0x3ffe7,
-    0x3ffeb, 0xfffe6, 0x7ffe2, 0xfffe7, 0xfffe8, 0xfffe9, 0xfffea, 0xfffeb,
-    0xfffec, 0x7ffe3, 0xfffed, 0xfffee, 0xfffef, 0xffff0, 0x7ffe4, 0xffff1,
-    0x3ffec, 0xffff2, 0xffff3, 0x7ffe5, 0x7ffe6, 0xffff4, 0xffff5, 0xffff6,
-    0xffff7, 0xffff8, 0xffff9, 0xffffa, 0xffffb, 0xffffc, 0xffffd, 0xffffe,
-    0xfffff,
-};
-
-static const uint8_t t_huffman_env_bal_1_5dB_bits[49] = {
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 12, 11,  9,  7,  5,  3,
-     1,  2,  4,  6,  8, 11, 12, 15,
-    16, 16, 16, 16, 16, 16, 16, 17,
-    17, 17, 17, 17, 17, 17, 17, 17,
-    17,
-};
-
-static const uint32_t t_huffman_env_bal_1_5dB_codes[49] = {
-    0x0ffe4, 0x0ffe5, 0x0ffe6, 0x0ffe7, 0x0ffe8, 0x0ffe9, 0x0ffea, 0x0ffeb,
-    0x0ffec, 0x0ffed, 0x0ffee, 0x0ffef, 0x0fff0, 0x0fff1, 0x0fff2, 0x0fff3,
-    0x0fff4, 0x0ffe2, 0x00ffc, 0x007fc, 0x001fe, 0x0007e, 0x0001e, 0x00006,
-    0x00000, 0x00002, 0x0000e, 0x0003e, 0x000fe, 0x007fd, 0x00ffd, 0x07ff0,
-    0x0ffe3, 0x0fff5, 0x0fff6, 0x0fff7, 0x0fff8, 0x0fff9, 0x0fffa, 0x1fff6,
-    0x1fff7, 0x1fff8, 0x1fff9, 0x1fffa, 0x1fffb, 0x1fffc, 0x1fffd, 0x1fffe,
-    0x1ffff,
-};
-
-static const uint8_t f_huffman_env_bal_1_5dB_bits[49] = {
-    18, 18, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 18, 18, 18, 16,
-    17, 14, 11, 11,  8,  7,  4,  2,
-     1,  3,  5,  6,  9, 11, 12, 15,
-    16, 18, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 18, 18, 18, 19,
-    19,
-};
-
-static const uint32_t f_huffman_env_bal_1_5dB_codes[49] = {
-    0x3ffe2, 0x3ffe3, 0x3ffe4, 0x3ffe5, 0x3ffe6, 0x3ffe7, 0x3ffe8, 0x3ffe9,
-    0x3ffea, 0x3ffeb, 0x3ffec, 0x3ffed, 0x3ffee, 0x3ffef, 0x3fff0, 0x0fff7,
-    0x1fff0, 0x03ffc, 0x007fe, 0x007fc, 0x000fe, 0x0007e, 0x0000e, 0x00002,
-    0x00000, 0x00006, 0x0001e, 0x0003e, 0x001fe, 0x007fd, 0x00ffe, 0x07ffa,
-    0x0fff6, 0x3fff1, 0x3fff2, 0x3fff3, 0x3fff4, 0x3fff5, 0x3fff6, 0x3fff7,
-    0x3fff8, 0x3fff9, 0x3fffa, 0x3fffb, 0x3fffc, 0x3fffd, 0x3fffe, 0x7fffe,
-    0x7ffff,
-};
-
-static const uint8_t t_huffman_env_3_0dB_bits[63] = {
-    18, 18, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 17, 16, 16, 16, 14, 14, 14,
-    13, 12, 11,  8,  6,  4,  2,  1,
-     3,  5,  7,  9, 11, 13, 14, 14,
-    15, 16, 17, 18, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19,
-};
-
-static const uint32_t t_huffman_env_3_0dB_codes[63] = {
-    0x3ffed, 0x3ffee, 0x7ffde, 0x7ffdf, 0x7ffe0, 0x7ffe1, 0x7ffe2, 0x7ffe3,
-    0x7ffe4, 0x7ffe5, 0x7ffe6, 0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb,
-    0x7ffec, 0x1fff4, 0x0fff7, 0x0fff9, 0x0fff8, 0x03ffb, 0x03ffa, 0x03ff8,
-    0x01ffa, 0x00ffc, 0x007fc, 0x000fe, 0x0003e, 0x0000e, 0x00002, 0x00000,
-    0x00006, 0x0001e, 0x0007e, 0x001fe, 0x007fd, 0x01ffb, 0x03ff9, 0x03ffc,
-    0x07ffa, 0x0fff6, 0x1fff5, 0x3ffec, 0x7ffed, 0x7ffee, 0x7ffef, 0x7fff0,
-    0x7fff1, 0x7fff2, 0x7fff3, 0x7fff4, 0x7fff5, 0x7fff6, 0x7fff7, 0x7fff8,
-    0x7fff9, 0x7fffa, 0x7fffb, 0x7fffc, 0x7fffd, 0x7fffe, 0x7ffff,
-};
-
-static const uint8_t f_huffman_env_3_0dB_bits[63] = {
-    20, 20, 20, 20, 20, 20, 20, 18,
-    19, 19, 19, 19, 18, 18, 20, 19,
-    17, 18, 17, 16, 16, 15, 14, 12,
-    11, 10,  9,  8,  6,  4,  2,  1,
-     3,  5,  8,  9, 10, 11, 12, 13,
-    14, 15, 15, 16, 16, 17, 17, 18,
-    18, 18, 20, 19, 19, 19, 20, 19,
-    19, 20, 20, 20, 20, 20, 20,
-};
-
-static const uint32_t f_huffman_env_3_0dB_codes[63] = {
-    0xffff0, 0xffff1, 0xffff2, 0xffff3, 0xffff4, 0xffff5, 0xffff6, 0x3fff3,
-    0x7fff5, 0x7ffee, 0x7ffef, 0x7fff6, 0x3fff4, 0x3fff2, 0xffff7, 0x7fff0,
-    0x1fff5, 0x3fff0, 0x1fff4, 0x0fff7, 0x0fff6, 0x07ff8, 0x03ffb, 0x00ffd,
-    0x007fd, 0x003fd, 0x001fd, 0x000fd, 0x0003e, 0x0000e, 0x00002, 0x00000,
-    0x00006, 0x0001e, 0x000fc, 0x001fc, 0x003fc, 0x007fc, 0x00ffc, 0x01ffc,
-    0x03ffa, 0x07ff9, 0x07ffa, 0x0fff8, 0x0fff9, 0x1fff6, 0x1fff7, 0x3fff5,
-    0x3fff6, 0x3fff1, 0xffff8, 0x7fff1, 0x7fff2, 0x7fff3, 0xffff9, 0x7fff7,
-    0x7fff4, 0xffffa, 0xffffb, 0xffffc, 0xffffd, 0xffffe, 0xfffff,
-};
-
-static const uint8_t t_huffman_env_bal_3_0dB_bits[25] = {
-    13, 13, 13, 13, 13, 13, 13, 12,
-     8,  7,  4,  3,  1,  2,  5,  6,
-     9, 13, 13, 13, 13, 13, 13, 14,
-    14,
-};
-
-static const uint16_t t_huffman_env_bal_3_0dB_codes[25] = {
-    0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, 0x1ff8, 0x0ff8,
-    0x00fe, 0x007e, 0x000e, 0x0006, 0x0000, 0x0002, 0x001e, 0x003e,
-    0x01fe, 0x1ff9, 0x1ffa, 0x1ffb, 0x1ffc, 0x1ffd, 0x1ffe, 0x3ffe,
-    0x3fff,
-};
-
-static const uint8_t f_huffman_env_bal_3_0dB_bits[25] = {
-    13, 13, 13, 13, 13, 14, 14, 11,
-     8,  7,  4,  2,  1,  3,  5,  6,
-     9, 12, 13, 14, 14, 14, 14, 14,
-    14,
-};
-
-static const uint16_t f_huffman_env_bal_3_0dB_codes[25] = {
-    0x1ff7, 0x1ff8, 0x1ff9, 0x1ffa, 0x1ffb, 0x3ff8, 0x3ff9, 0x07fc,
-    0x00fe, 0x007e, 0x000e, 0x0002, 0x0000, 0x0006, 0x001e, 0x003e,
-    0x01fe, 0x0ffa, 0x1ff6, 0x3ffa, 0x3ffb, 0x3ffc, 0x3ffd, 0x3ffe,
-    0x3fff,
-};
-
-static const uint8_t t_huffman_noise_3_0dB_bits[63] = {
-    13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 11,  8,  6,  4,  3,  1,
-     2,  5,  8, 10, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 14, 14,
-};
-
-static const uint16_t t_huffman_noise_3_0dB_codes[63] = {
-    0x1fce, 0x1fcf, 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x1fd4, 0x1fd5,
-    0x1fd6, 0x1fd7, 0x1fd8, 0x1fd9, 0x1fda, 0x1fdb, 0x1fdc, 0x1fdd,
-    0x1fde, 0x1fdf, 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5,
-    0x1fe6, 0x1fe7, 0x07f2, 0x00fd, 0x003e, 0x000e, 0x0006, 0x0000,
-    0x0002, 0x001e, 0x00fc, 0x03f8, 0x1fcc, 0x1fe8, 0x1fe9, 0x1fea,
-    0x1feb, 0x1fec, 0x1fcd, 0x1fed, 0x1fee, 0x1fef, 0x1ff0, 0x1ff1,
-    0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, 0x1ff8, 0x1ff9,
-    0x1ffa, 0x1ffb, 0x1ffc, 0x1ffd, 0x1ffe, 0x3ffe, 0x3fff,
-};
-
-static const uint8_t t_huffman_noise_bal_3_0dB_bits[25] = {
-    8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 5, 2, 1, 3, 6, 8,
-    8, 8, 8, 8, 8, 8, 8, 8,
-    8,
-};
-
-static const uint8_t t_huffman_noise_bal_3_0dB_codes[25] = {
-    0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3,
-    0xf4, 0xf5, 0x1c, 0x02, 0x00, 0x06, 0x3a, 0xf6,
-    0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe,
-    0xff,
-};
-
-static const int8_t sbr_offset[6][16] = {
-    {-8, -7, -6, -5, -4, -3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7}, //             fs_sbr  = 16000 Hz
-    {-5, -4, -3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13}, //             fs_sbr  = 22050 Hz
-    {-5, -3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13, 16}, //             fs_sbr  = 24000 Hz
-    {-6, -4, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13, 16}, //             fs_sbr  = 32000 Hz
-    {-4, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13, 16, 20}, // 44100 Hz <= fs_sbr <= 64000 Hz
-    {-2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13, 16, 20, 24}, // 64000 Hz <  fs_sbr
-};
-
-///< window coefficients for analysis/synthesis QMF banks
-static DECLARE_ALIGNED(32, float, sbr_qmf_window_ds)[320];
-static DECLARE_ALIGNED(32, float, sbr_qmf_window_us)[640] = {
-     0.0000000000, -0.0005525286, -0.0005617692, -0.0004947518,
-    -0.0004875227, -0.0004893791, -0.0005040714, -0.0005226564,
-    -0.0005466565, -0.0005677802, -0.0005870930, -0.0006132747,
-    -0.0006312493, -0.0006540333, -0.0006777690, -0.0006941614,
-    -0.0007157736, -0.0007255043, -0.0007440941, -0.0007490598,
-    -0.0007681371, -0.0007724848, -0.0007834332, -0.0007779869,
-    -0.0007803664, -0.0007801449, -0.0007757977, -0.0007630793,
-    -0.0007530001, -0.0007319357, -0.0007215391, -0.0006917937,
-    -0.0006650415, -0.0006341594, -0.0005946118, -0.0005564576,
-    -0.0005145572, -0.0004606325, -0.0004095121, -0.0003501175,
-    -0.0002896981, -0.0002098337, -0.0001446380, -0.0000617334,
-     0.0000134949,  0.0001094383,  0.0002043017,  0.0002949531,
-     0.0004026540,  0.0005107388,  0.0006239376,  0.0007458025,
-     0.0008608443,  0.0009885988,  0.0011250155,  0.0012577884,
-     0.0013902494,  0.0015443219,  0.0016868083,  0.0018348265,
-     0.0019841140,  0.0021461583,  0.0023017254,  0.0024625616,
-     0.0026201758,  0.0027870464,  0.0029469447,  0.0031125420,
-     0.0032739613,  0.0034418874,  0.0036008268,  0.0037603922,
-     0.0039207432,  0.0040819753,  0.0042264269,  0.0043730719,
-     0.0045209852,  0.0046606460,  0.0047932560,  0.0049137603,
-     0.0050393022,  0.0051407353,  0.0052461166,  0.0053471681,
-     0.0054196775,  0.0054876040,  0.0055475714,  0.0055938023,
-     0.0056220643,  0.0056455196,  0.0056389199,  0.0056266114,
-     0.0055917128,  0.0055404363,  0.0054753783,  0.0053838975,
-     0.0052715758,  0.0051382275,  0.0049839687,  0.0048109469,
-     0.0046039530,  0.0043801861,  0.0041251642,  0.0038456408,
-     0.0035401246,  0.0032091885,  0.0028446757,  0.0024508540,
-     0.0020274176,  0.0015784682,  0.0010902329,  0.0005832264,
-     0.0000276045, -0.0005464280, -0.0011568135, -0.0018039472,
-    -0.0024826723, -0.0031933778, -0.0039401124, -0.0047222596,
-    -0.0055337211, -0.0063792293, -0.0072615816, -0.0081798233,
-    -0.0091325329, -0.0101150215, -0.0111315548, -0.0121849995,
-     0.0132718220,  0.0143904666,  0.0155405553,  0.0167324712,
-     0.0179433381,  0.0191872431,  0.0204531793,  0.0217467550,
-     0.0230680169,  0.0244160992,  0.0257875847,  0.0271859429,
-     0.0286072173,  0.0300502657,  0.0315017608,  0.0329754081,
-     0.0344620948,  0.0359697560,  0.0374812850,  0.0390053679,
-     0.0405349170,  0.0420649094,  0.0436097542,  0.0451488405,
-     0.0466843027,  0.0482165720,  0.0497385755,  0.0512556155,
-     0.0527630746,  0.0542452768,  0.0557173648,  0.0571616450,
-     0.0585915683,  0.0599837480,  0.0613455171,  0.0626857808,
-     0.0639715898,  0.0652247106,  0.0664367512,  0.0676075985,
-     0.0687043828,  0.0697630244,  0.0707628710,  0.0717002673,
-     0.0725682583,  0.0733620255,  0.0741003642,  0.0747452558,
-     0.0753137336,  0.0758008358,  0.0761992479,  0.0764992170,
-     0.0767093490,  0.0768173975,  0.0768230011,  0.0767204924,
-     0.0765050718,  0.0761748321,  0.0757305756,  0.0751576255,
-     0.0744664394,  0.0736406005,  0.0726774642,  0.0715826364,
-     0.0703533073,  0.0689664013,  0.0674525021,  0.0657690668,
-     0.0639444805,  0.0619602779,  0.0598166570,  0.0575152691,
-     0.0550460034,  0.0524093821,  0.0495978676,  0.0466303305,
-     0.0434768782,  0.0401458278,  0.0366418116,  0.0329583930,
-     0.0290824006,  0.0250307561,  0.0207997072,  0.0163701258,
-     0.0117623832,  0.0069636862,  0.0019765601, -0.0032086896,
-    -0.0085711749, -0.0141288827, -0.0198834129, -0.0258227288,
-    -0.0319531274, -0.0382776572, -0.0447806821, -0.0514804176,
-    -0.0583705326, -0.0654409853, -0.0726943300, -0.0801372934,
-    -0.0877547536, -0.0955533352, -0.1035329531, -0.1116826931,
-    -0.1200077984, -0.1285002850, -0.1371551761, -0.1459766491,
-    -0.1549607071, -0.1640958855, -0.1733808172, -0.1828172548,
-    -0.1923966745, -0.2021250176, -0.2119735853, -0.2219652696,
-    -0.2320690870, -0.2423016884, -0.2526480309, -0.2631053299,
-    -0.2736634040, -0.2843214189, -0.2950716717, -0.3059098575,
-    -0.3168278913, -0.3278113727, -0.3388722693, -0.3499914122,
-     0.3611589903,  0.3723795546,  0.3836350013,  0.3949211761,
-     0.4062317676,  0.4175696896,  0.4289119920,  0.4402553754,
-     0.4515996535,  0.4629308085,  0.4742453214,  0.4855253091,
-     0.4967708254,  0.5079817500,  0.5191234970,  0.5302240895,
-     0.5412553448,  0.5522051258,  0.5630789140,  0.5738524131,
-     0.5845403235,  0.5951123086,  0.6055783538,  0.6159109932,
-     0.6261242695,  0.6361980107,  0.6461269695,  0.6559016302,
-     0.6655139880,  0.6749663190,  0.6842353293,  0.6933282376,
-     0.7022388719,  0.7109410426,  0.7194462634,  0.7277448900,
-     0.7358211758,  0.7436827863,  0.7513137456,  0.7587080760,
-     0.7658674865,  0.7727780881,  0.7794287519,  0.7858353120,
-     0.7919735841,  0.7978466413,  0.8034485751,  0.8087695004,
-     0.8138191270,  0.8185776004,  0.8230419890,  0.8272275347,
-     0.8311038457,  0.8346937361,  0.8379717337,  0.8409541392,
-     0.8436238281,  0.8459818469,  0.8480315777,  0.8497805198,
-     0.8511971524,  0.8523047035,  0.8531020949,  0.8535720573,
-     0.8537385600,
-};
-
-/* First two entries repeated at end to simplify SIMD implementations. */
-const DECLARE_ALIGNED(16, float, ff_sbr_noise_table)[][2] = {
-{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
-{ 0.14130051758487, -0.95090983575689}, {-0.47005496701697, -0.37340549728647},
-{ 0.80705063769351,  0.29653668284408}, {-0.38981478896926,  0.89572605717087},
-{-0.01053049862020, -0.66959058036166}, {-0.91266367957293, -0.11522938140034},
-{ 0.54840422910309,  0.75221367176302}, { 0.40009252867955, -0.98929400334421},
-{-0.99867974711855, -0.88147068645358}, {-0.95531076805040,  0.90908757154593},
-{-0.45725933317144, -0.56716323646760}, {-0.72929675029275, -0.98008272727324},
-{ 0.75622801399036,  0.20950329995549}, { 0.07069442601050, -0.78247898470706},
-{ 0.74496252926055, -0.91169004445807}, {-0.96440182703856, -0.94739918296622},
-{ 0.30424629369539, -0.49438267012479}, { 0.66565033746925,  0.64652935542491},
-{ 0.91697008020594,  0.17514097332009}, {-0.70774918760427,  0.52548653416543},
-{-0.70051415345560, -0.45340028808763}, {-0.99496513054797, -0.90071908066973},
-{ 0.98164490790123, -0.77463155528697}, {-0.54671580548181, -0.02570928536004},
-{-0.01689629065389,  0.00287506445732}, {-0.86110349531986,  0.42548583726477},
-{-0.98892980586032, -0.87881132267556}, { 0.51756627678691,  0.66926784710139},
-{-0.99635026409640, -0.58107730574765}, {-0.99969370862163,  0.98369989360250},
-{ 0.55266258627194,  0.59449057465591}, { 0.34581177741673,  0.94879421061866},
-{ 0.62664209577999, -0.74402970906471}, {-0.77149701404973, -0.33883658042801},
-{-0.91592244254432,  0.03687901376713}, {-0.76285492357887, -0.91371867919124},
-{ 0.79788337195331, -0.93180971199849}, { 0.54473080610200, -0.11919206037186},
-{-0.85639281671058,  0.42429854760451}, {-0.92882402971423,  0.27871809078609},
-{-0.11708371046774, -0.99800843444966}, { 0.21356749817493, -0.90716295627033},
-{-0.76191692573909,  0.99768118356265}, { 0.98111043100884, -0.95854459734407},
-{-0.85913269895572,  0.95766566168880}, {-0.93307242253692,  0.49431757696466},
-{ 0.30485754879632, -0.70540034357529}, { 0.85289650925190,  0.46766131791044},
-{ 0.91328082618125, -0.99839597361769}, {-0.05890199924154,  0.70741827819497},
-{ 0.28398686150148,  0.34633555702188}, { 0.95258164539612, -0.54893416026939},
-{-0.78566324168507, -0.75568541079691}, {-0.95789495447877, -0.20423194696966},
-{ 0.82411158711197,  0.96654618432562}, {-0.65185446735885, -0.88734990773289},
-{-0.93643603134666,  0.99870790442385}, { 0.91427159529618, -0.98290505544444},
-{-0.70395684036886,  0.58796798221039}, { 0.00563771969365,  0.61768196727244},
-{ 0.89065051931895,  0.52783352697585}, {-0.68683707712762,  0.80806944710339},
-{ 0.72165342518718, -0.69259857349564}, {-0.62928247730667,  0.13627037407335},
-{ 0.29938434065514, -0.46051329682246}, {-0.91781958879280, -0.74012716684186},
-{ 0.99298717043688,  0.40816610075661}, { 0.82368298622748, -0.74036047190173},
-{-0.98512833386833, -0.99972330709594}, {-0.95915368242257, -0.99237800466040},
-{-0.21411126572790, -0.93424819052545}, {-0.68821476106884, -0.26892306315457},
-{ 0.91851997982317,  0.09358228901785}, {-0.96062769559127,  0.36099095133739},
-{ 0.51646184922287, -0.71373332873917}, { 0.61130721139669,  0.46950141175917},
-{ 0.47336129371299, -0.27333178296162}, { 0.90998308703519,  0.96715662938132},
-{ 0.44844799194357,  0.99211574628306}, { 0.66614891079092,  0.96590176169121},
-{ 0.74922239129237, -0.89879858826087}, {-0.99571588506485,  0.52785521494349},
-{ 0.97401082477563, -0.16855870075190}, { 0.72683747733879, -0.48060774432251},
-{ 0.95432193457128,  0.68849603408441}, {-0.72962208425191, -0.76608443420917},
-{-0.85359479233537,  0.88738125901579}, {-0.81412430338535, -0.97480768049637},
-{-0.87930772356786,  0.74748307690436}, {-0.71573331064977, -0.98570608178923},
-{ 0.83524300028228,  0.83702537075163}, {-0.48086065601423, -0.98848504923531},
-{ 0.97139128574778,  0.80093621198236}, { 0.51992825347895,  0.80247631400510},
-{-0.00848591195325, -0.76670128000486}, {-0.70294374303036,  0.55359910445577},
-{-0.95894428168140, -0.43265504344783}, { 0.97079252950321,  0.09325857238682},
-{-0.92404293670797,  0.85507704027855}, {-0.69506469500450,  0.98633412625459},
-{ 0.26559203620024,  0.73314307966524}, { 0.28038443336943,  0.14537913654427},
-{-0.74138124825523,  0.99310339807762}, {-0.01752795995444, -0.82616635284178},
-{-0.55126773094930, -0.98898543862153}, { 0.97960898850996, -0.94021446752851},
-{-0.99196309146936,  0.67019017358456}, {-0.67684928085260,  0.12631491649378},
-{ 0.09140039465500, -0.20537731453108}, {-0.71658965751996, -0.97788200391224},
-{ 0.81014640078925,  0.53722648362443}, { 0.40616991671205, -0.26469008598449},
-{-0.67680188682972,  0.94502052337695}, { 0.86849774348749, -0.18333598647899},
-{-0.99500381284851, -0.02634122068550}, { 0.84329189340667,  0.10406957462213},
-{-0.09215968531446,  0.69540012101253}, { 0.99956173327206, -0.12358542001404},
-{-0.79732779473535, -0.91582524736159}, { 0.96349973642406,  0.96640458041000},
-{-0.79942778496547,  0.64323902822857}, {-0.11566039853896,  0.28587846253726},
-{-0.39922954514662,  0.94129601616966}, { 0.99089197565987, -0.92062625581587},
-{ 0.28631285179909, -0.91035047143603}, {-0.83302725605608, -0.67330410892084},
-{ 0.95404443402072,  0.49162765398743}, {-0.06449863579434,  0.03250560813135},
-{-0.99575054486311,  0.42389784469507}, {-0.65501142790847,  0.82546114655624},
-{-0.81254441908887, -0.51627234660629}, {-0.99646369485481,  0.84490533520752},
-{ 0.00287840603348,  0.64768261158166}, { 0.70176989408455, -0.20453028573322},
-{ 0.96361882270190,  0.40706967140989}, {-0.68883758192426,  0.91338958840772},
-{-0.34875585502238,  0.71472290693300}, { 0.91980081243087,  0.66507455644919},
-{-0.99009048343881,  0.85868021604848}, { 0.68865791458395,  0.55660316809678},
-{-0.99484402129368, -0.20052559254934}, { 0.94214511408023, -0.99696425367461},
-{-0.67414626793544,  0.49548221180078}, {-0.47339353684664, -0.85904328834047},
-{ 0.14323651387360, -0.94145598222488}, {-0.29268293575672,  0.05759224927952},
-{ 0.43793861458754, -0.78904969892724}, {-0.36345126374441,  0.64874435357162},
-{-0.08750604656825,  0.97686944362527}, {-0.96495267812511, -0.53960305946511},
-{ 0.55526940659947,  0.78891523734774}, { 0.73538215752630,  0.96452072373404},
-{-0.30889773919437, -0.80664389776860}, { 0.03574995626194, -0.97325616900959},
-{ 0.98720684660488,  0.48409133691962}, {-0.81689296271203, -0.90827703628298},
-{ 0.67866860118215,  0.81284503870856}, {-0.15808569732583,  0.85279555024382},
-{ 0.80723395114371, -0.24717418514605}, { 0.47788757329038, -0.46333147839295},
-{ 0.96367554763201,  0.38486749303242}, {-0.99143875716818, -0.24945277239809},
-{ 0.83081876925833, -0.94780851414763}, {-0.58753191905341,  0.01290772389163},
-{ 0.95538108220960, -0.85557052096538}, {-0.96490920476211, -0.64020970923102},
-{-0.97327101028521,  0.12378128133110}, { 0.91400366022124,  0.57972471346930},
-{-0.99925837363824,  0.71084847864067}, {-0.86875903507313, -0.20291699203564},
-{-0.26240034795124, -0.68264554369108}, {-0.24664412953388, -0.87642273115183},
-{ 0.02416275806869,  0.27192914288905}, { 0.82068619590515, -0.85087787994476},
-{ 0.88547373760759, -0.89636802901469}, {-0.18173078152226, -0.26152145156800},
-{ 0.09355476558534,  0.54845123045604}, {-0.54668414224090,  0.95980774020221},
-{ 0.37050990604091, -0.59910140383171}, {-0.70373594262891,  0.91227665827081},
-{-0.34600785879594, -0.99441426144200}, {-0.68774481731008, -0.30238837956299},
-{-0.26843291251234,  0.83115668004362}, { 0.49072334613242, -0.45359708737775},
-{ 0.38975993093975,  0.95515358099121}, {-0.97757125224150,  0.05305894580606},
-{-0.17325552859616, -0.92770672250494}, { 0.99948035025744,  0.58285545563426},
-{-0.64946246527458,  0.68645507104960}, {-0.12016920576437, -0.57147322153312},
-{-0.58947456517751, -0.34847132454388}, {-0.41815140454465,  0.16276422358861},
-{ 0.99885650204884,  0.11136095490444}, {-0.56649614128386, -0.90494866361587},
-{ 0.94138021032330,  0.35281916733018}, {-0.75725076534641,  0.53650549640587},
-{ 0.20541973692630, -0.94435144369918}, { 0.99980371023351,  0.79835913565599},
-{ 0.29078277605775,  0.35393777921520}, {-0.62858772103030,  0.38765693387102},
-{ 0.43440904467688, -0.98546330463232}, {-0.98298583762390,  0.21021524625209},
-{ 0.19513029146934, -0.94239832251867}, {-0.95476662400101,  0.98364554179143},
-{ 0.93379635304810, -0.70881994583682}, {-0.85235410573336, -0.08342347966410},
-{-0.86425093011245, -0.45795025029466}, { 0.38879779059045,  0.97274429344593},
-{ 0.92045124735495, -0.62433652524220}, { 0.89162532251878,  0.54950955570563},
-{-0.36834336949252,  0.96458298020975}, { 0.93891760988045, -0.89968353740388},
-{ 0.99267657565094, -0.03757034316958}, {-0.94063471614176,  0.41332338538963},
-{ 0.99740224117019, -0.16830494996370}, {-0.35899413170555, -0.46633226649613},
-{ 0.05237237274947, -0.25640361602661}, { 0.36703583957424, -0.38653265641875},
-{ 0.91653180367913, -0.30587628726597}, { 0.69000803499316,  0.90952171386132},
-{-0.38658751133527,  0.99501571208985}, {-0.29250814029851,  0.37444994344615},
-{-0.60182204677608,  0.86779651036123}, {-0.97418588163217,  0.96468523666475},
-{ 0.88461574003963,  0.57508405276414}, { 0.05198933055162,  0.21269661669964},
-{-0.53499621979720,  0.97241553731237}, {-0.49429560226497,  0.98183865291903},
-{-0.98935142339139, -0.40249159006933}, {-0.98081380091130, -0.72856895534041},
-{-0.27338148835532,  0.99950922447209}, { 0.06310802338302, -0.54539587529618},
-{-0.20461677199539, -0.14209977628489}, { 0.66223843141647,  0.72528579940326},
-{-0.84764345483665,  0.02372316801261}, {-0.89039863483811,  0.88866581484602},
-{ 0.95903308477986,  0.76744927173873}, { 0.73504123909879, -0.03747203173192},
-{-0.31744434966056, -0.36834111883652}, {-0.34110827591623,  0.40211222807691},
-{ 0.47803883714199, -0.39423219786288}, { 0.98299195879514,  0.01989791390047},
-{-0.30963073129751, -0.18076720599336}, { 0.99992588229018, -0.26281872094289},
-{-0.93149731080767, -0.98313162570490}, { 0.99923472302773, -0.80142993767554},
-{-0.26024169633417, -0.75999759855752}, {-0.35712514743563,  0.19298963768574},
-{-0.99899084509530,  0.74645156992493}, { 0.86557171579452,  0.55593866696299},
-{ 0.33408042438752,  0.86185953874709}, { 0.99010736374716,  0.04602397576623},
-{-0.66694269691195, -0.91643611810148}, { 0.64016792079480,  0.15649530836856},
-{ 0.99570534804836,  0.45844586038111}, {-0.63431466947340,  0.21079116459234},
-{-0.07706847005931, -0.89581437101329}, { 0.98590090577724,  0.88241721133981},
-{ 0.80099335254678, -0.36851896710853}, { 0.78368131392666,  0.45506999802597},
-{ 0.08707806671691,  0.80938994918745}, {-0.86811883080712,  0.39347308654705},
-{-0.39466529740375, -0.66809432114456}, { 0.97875325649683, -0.72467840967746},
-{-0.95038560288864,  0.89563219587625}, { 0.17005239424212,  0.54683053962658},
-{-0.76910792026848, -0.96226617549298}, { 0.99743281016846,  0.42697157037567},
-{ 0.95437383549973,  0.97002324109952}, { 0.99578905365569, -0.54106826257356},
-{ 0.28058259829990, -0.85361420634036}, { 0.85256524470573, -0.64567607735589},
-{-0.50608540105128, -0.65846015480300}, {-0.97210735183243, -0.23095213067791},
-{ 0.95424048234441, -0.99240147091219}, {-0.96926570524023,  0.73775654896574},
-{ 0.30872163214726,  0.41514960556126}, {-0.24523839572639,  0.63206633394807},
-{-0.33813265086024, -0.38661779441897}, {-0.05826828420146, -0.06940774188029},
-{-0.22898461455054,  0.97054853316316}, {-0.18509915019881,  0.47565762892084},
-{-0.10488238045009, -0.87769947402394}, {-0.71886586182037,  0.78030982480538},
-{ 0.99793873738654,  0.90041310491497}, { 0.57563307626120, -0.91034337352097},
-{ 0.28909646383717,  0.96307783970534}, { 0.42188998312520,  0.48148651230437},
-{ 0.93335049681047, -0.43537023883588}, {-0.97087374418267,  0.86636445711364},
-{ 0.36722871286923,  0.65291654172961}, {-0.81093025665696,  0.08778370229363},
-{-0.26240603062237, -0.92774095379098}, { 0.83996497984604,  0.55839849139647},
-{-0.99909615720225, -0.96024605713970}, { 0.74649464155061,  0.12144893606462},
-{-0.74774595569805, -0.26898062008959}, { 0.95781667469567, -0.79047927052628},
-{ 0.95472308713099, -0.08588776019550}, { 0.48708332746299,  0.99999041579432},
-{ 0.46332038247497,  0.10964126185063}, {-0.76497004940162,  0.89210929242238},
-{ 0.57397389364339,  0.35289703373760}, { 0.75374316974495,  0.96705214651335},
-{-0.59174397685714, -0.89405370422752}, { 0.75087906691890, -0.29612672982396},
-{-0.98607857336230,  0.25034911730023}, {-0.40761056640505, -0.90045573444695},
-{ 0.66929266740477,  0.98629493401748}, {-0.97463695257310, -0.00190223301301},
-{ 0.90145509409859,  0.99781390365446}, {-0.87259289048043,  0.99233587353666},
-{-0.91529461447692, -0.15698707534206}, {-0.03305738840705, -0.37205262859764},
-{ 0.07223051368337, -0.88805001733626}, { 0.99498012188353,  0.97094358113387},
-{-0.74904939500519,  0.99985483641521}, { 0.04585228574211,  0.99812337444082},
-{-0.89054954257993, -0.31791913188064}, {-0.83782144651251,  0.97637632547466},
-{ 0.33454804933804, -0.86231516800408}, {-0.99707579362824,  0.93237990079441},
-{-0.22827527843994,  0.18874759397997}, { 0.67248046289143, -0.03646211390569},
-{-0.05146538187944, -0.92599700120679}, { 0.99947295749905,  0.93625229707912},
-{ 0.66951124390363,  0.98905825623893}, {-0.99602956559179, -0.44654715757688},
-{ 0.82104905483590,  0.99540741724928}, { 0.99186510988782,  0.72023001312947},
-{-0.65284592392918,  0.52186723253637}, { 0.93885443798188, -0.74895312615259},
-{ 0.96735248738388,  0.90891816978629}, {-0.22225968841114,  0.57124029781228},
-{-0.44132783753414, -0.92688840659280}, {-0.85694974219574,  0.88844532719844},
-{ 0.91783042091762, -0.46356892383970}, { 0.72556974415690, -0.99899555770747},
-{-0.99711581834508,  0.58211560180426}, { 0.77638976371966,  0.94321834873819},
-{ 0.07717324253925,  0.58638399856595}, {-0.56049829194163,  0.82522301569036},
-{ 0.98398893639988,  0.39467440420569}, { 0.47546946844938,  0.68613044836811},
-{ 0.65675089314631,  0.18331637134880}, { 0.03273375457980, -0.74933109564108},
-{-0.38684144784738,  0.51337349030406}, {-0.97346267944545, -0.96549364384098},
-{-0.53282156061942, -0.91423265091354}, { 0.99817310731176,  0.61133572482148},
-{-0.50254500772635, -0.88829338134294}, { 0.01995873238855,  0.85223515096765},
-{ 0.99930381973804,  0.94578896296649}, { 0.82907767600783, -0.06323442598128},
-{-0.58660709669728,  0.96840773806582}, {-0.17573736667267, -0.48166920859485},
-{ 0.83434292401346, -0.13023450646997}, { 0.05946491307025,  0.20511047074866},
-{ 0.81505484574602, -0.94685947861369}, {-0.44976380954860,  0.40894572671545},
-{-0.89746474625671,  0.99846578838537}, { 0.39677256130792, -0.74854668609359},
-{-0.07588948563079,  0.74096214084170}, { 0.76343198951445,  0.41746629422634},
-{-0.74490104699626,  0.94725911744610}, { 0.64880119792759,  0.41336660830571},
-{ 0.62319537462542, -0.93098313552599}, { 0.42215817594807, -0.07712787385208},
-{ 0.02704554141885, -0.05417518053666}, { 0.80001773566818,  0.91542195141039},
-{-0.79351832348816, -0.36208897989136}, { 0.63872359151636,  0.08128252493444},
-{ 0.52890520960295,  0.60048872455592}, { 0.74238552914587,  0.04491915291044},
-{ 0.99096131449250, -0.19451182854402}, {-0.80412329643109, -0.88513818199457},
-{-0.64612616129736,  0.72198674804544}, { 0.11657770663191, -0.83662833815041},
-{-0.95053182488101, -0.96939905138082}, {-0.62228872928622,  0.82767262846661},
-{ 0.03004475787316, -0.99738896333384}, {-0.97987214341034,  0.36526129686425},
-{-0.99986980746200, -0.36021610299715}, { 0.89110648599879, -0.97894250343044},
-{ 0.10407960510582,  0.77357793811619}, { 0.95964737821728, -0.35435818285502},
-{ 0.50843233159162,  0.96107691266205}, { 0.17006334670615, -0.76854025314829},
-{ 0.25872675063360,  0.99893303933816}, {-0.01115998681937,  0.98496019742444},
-{-0.79598702973261,  0.97138411318894}, {-0.99264708948101, -0.99542822402536},
-{-0.99829663752818,  0.01877138824311}, {-0.70801016548184,  0.33680685948117},
-{-0.70467057786826,  0.93272777501857}, { 0.99846021905254, -0.98725746254433},
-{-0.63364968534650, -0.16473594423746}, {-0.16258217500792, -0.95939125400802},
-{-0.43645594360633, -0.94805030113284}, {-0.99848471702976,  0.96245166923809},
-{-0.16796458968998, -0.98987511890470}, {-0.87979225745213, -0.71725725041680},
-{ 0.44183099021786, -0.93568974498761}, { 0.93310180125532, -0.99913308068246},
-{-0.93941931782002, -0.56409379640356}, {-0.88590003188677,  0.47624600491382},
-{ 0.99971463703691, -0.83889954253462}, {-0.75376385639978,  0.00814643438625},
-{ 0.93887685615875, -0.11284528204636}, { 0.85126435782309,  0.52349251543547},
-{ 0.39701421446381,  0.81779634174316}, {-0.37024464187437, -0.87071656222959},
-{-0.36024828242896,  0.34655735648287}, {-0.93388812549209, -0.84476541096429},
-{-0.65298804552119, -0.18439575450921}, { 0.11960319006843,  0.99899346780168},
-{ 0.94292565553160,  0.83163906518293}, { 0.75081145286948, -0.35533223142265},
-{ 0.56721979748394, -0.24076836414499}, { 0.46857766746029, -0.30140233457198},
-{ 0.97312313923635, -0.99548191630031}, {-0.38299976567017,  0.98516909715427},
-{ 0.41025800019463,  0.02116736935734}, { 0.09638062008048,  0.04411984381457},
-{-0.85283249275397,  0.91475563922421}, { 0.88866808958124, -0.99735267083226},
-{-0.48202429536989, -0.96805608884164}, { 0.27572582416567,  0.58634753335832},
-{-0.65889129659168,  0.58835634138583}, { 0.98838086953732,  0.99994349600236},
-{-0.20651349620689,  0.54593044066355}, {-0.62126416356920, -0.59893681700392},
-{ 0.20320105410437, -0.86879180355289}, {-0.97790548600584,  0.96290806999242},
-{ 0.11112534735126,  0.21484763313301}, {-0.41368337314182,  0.28216837680365},
-{ 0.24133038992960,  0.51294362630238}, {-0.66393410674885, -0.08249679629081},
-{-0.53697829178752, -0.97649903936228}, {-0.97224737889348,  0.22081333579837},
-{ 0.87392477144549, -0.12796173740361}, { 0.19050361015753,  0.01602615387195},
-{-0.46353441212724, -0.95249041539006}, {-0.07064096339021, -0.94479803205886},
-{-0.92444085484466, -0.10457590187436}, {-0.83822593578728, -0.01695043208885},
-{ 0.75214681811150, -0.99955681042665}, {-0.42102998829339,  0.99720941999394},
-{-0.72094786237696, -0.35008961934255}, { 0.78843311019251,  0.52851398958271},
-{ 0.97394027897442, -0.26695944086561}, { 0.99206463477946, -0.57010120849429},
-{ 0.76789609461795, -0.76519356730966}, {-0.82002421836409, -0.73530179553767},
-{ 0.81924990025724,  0.99698425250579}, {-0.26719850873357,  0.68903369776193},
-{-0.43311260380975,  0.85321815947490}, { 0.99194979673836,  0.91876249766422},
-{-0.80692001248487, -0.32627540663214}, { 0.43080003649976, -0.21919095636638},
-{ 0.67709491937357, -0.95478075822906}, { 0.56151770568316, -0.70693811747778},
-{ 0.10831862810749, -0.08628837174592}, { 0.91229417540436, -0.65987351408410},
-{-0.48972893932274,  0.56289246362686}, {-0.89033658689697, -0.71656563987082},
-{ 0.65269447475094,  0.65916004833932}, { 0.67439478141121, -0.81684380846796},
-{-0.47770832416973, -0.16789556203025}, {-0.99715979260878, -0.93565784007648},
-{-0.90889593602546,  0.62034397054380}, {-0.06618622548177, -0.23812217221359},
-{ 0.99430266919728,  0.18812555317553}, { 0.97686402381843, -0.28664534366620},
-{ 0.94813650221268, -0.97506640027128}, {-0.95434497492853, -0.79607978501983},
-{-0.49104783137150,  0.32895214359663}, { 0.99881175120751,  0.88993983831354},
-{ 0.50449166760303, -0.85995072408434}, { 0.47162891065108, -0.18680204049569},
-{-0.62081581361840,  0.75000676218956}, {-0.43867015250812,  0.99998069244322},
-{ 0.98630563232075, -0.53578899600662}, {-0.61510362277374, -0.89515019899997},
-{-0.03841517601843, -0.69888815681179}, {-0.30102157304644, -0.07667808922205},
-{ 0.41881284182683,  0.02188098922282}, {-0.86135454941237,  0.98947480909359},
-{ 0.67226861393788, -0.13494389011014}, {-0.70737398842068, -0.76547349325992},
-{ 0.94044946687963,  0.09026201157416}, {-0.82386352534327,  0.08924768823676},
-{-0.32070666698656,  0.50143421908753}, { 0.57593163224487, -0.98966422921509},
-{-0.36326018419965,  0.07440243123228}, { 0.99979044674350, -0.14130287347405},
-{-0.92366023326932, -0.97979298068180}, {-0.44607178518598, -0.54233252016394},
-{ 0.44226800932956,  0.71326756742752}, { 0.03671907158312,  0.63606389366675},
-{ 0.52175424682195, -0.85396826735705}, {-0.94701139690956, -0.01826348194255},
-{-0.98759606946049,  0.82288714303073}, { 0.87434794743625,  0.89399495655433},
-{-0.93412041758744,  0.41374052024363}, { 0.96063943315511,  0.93116709541280},
-{ 0.97534253457837,  0.86150930812689}, { 0.99642466504163,  0.70190043427512},
-{-0.94705089665984, -0.29580042814306}, { 0.91599807087376, -0.98147830385781},
-{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
-};
-
-#endif /* AVCODEC_AACSBRDATA_H */
diff --git a/deps/libav/libavcodec/aactab.c b/deps/libav/libavcodec/aactab.c
deleted file mode 100644
index ee9a735..0000000
--- a/deps/libav/libavcodec/aactab.c
+++ /dev/null
@@ -1,1729 +0,0 @@
-/*
- * AAC data
- * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
- * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC data
- * @author Oded Shimon  ( ods15 ods15 dyndns org )
- * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
- */
-
-#include "libavutil/mem.h"
-#include "aac.h"
-#include "aac_tablegen.h"
-
-#include <stdint.h>
-
-DECLARE_ALIGNED(32, float,  ff_aac_kbd_long_1024)[1024];
-DECLARE_ALIGNED(32, float,  ff_aac_kbd_short_128)[128];
-
-const uint8_t ff_aac_num_swb_1024[] = {
-    41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40, 40
-};
-
-const uint8_t ff_aac_num_swb_512[] = {
-     0,  0,  0, 36, 36, 37, 31, 31,  0,  0,  0,  0,  0
-};
-
-const uint8_t ff_aac_num_swb_128[] = {
-    12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15
-};
-
-const uint8_t ff_aac_pred_sfb_max[] = {
-    33, 33, 38, 40, 40, 40, 41, 41, 37, 37, 37, 34, 34
-};
-
-const uint32_t ff_aac_scalefactor_code[121] = {
-    0x3ffe8, 0x3ffe6, 0x3ffe7, 0x3ffe5, 0x7fff5, 0x7fff1, 0x7ffed, 0x7fff6,
-    0x7ffee, 0x7ffef, 0x7fff0, 0x7fffc, 0x7fffd, 0x7ffff, 0x7fffe, 0x7fff7,
-    0x7fff8, 0x7fffb, 0x7fff9, 0x3ffe4, 0x7fffa, 0x3ffe3, 0x1ffef, 0x1fff0,
-    0x0fff5, 0x1ffee, 0x0fff2, 0x0fff3, 0x0fff4, 0x0fff1, 0x07ff6, 0x07ff7,
-    0x03ff9, 0x03ff5, 0x03ff7, 0x03ff3, 0x03ff6, 0x03ff2, 0x01ff7, 0x01ff5,
-    0x00ff9, 0x00ff7, 0x00ff6, 0x007f9, 0x00ff4, 0x007f8, 0x003f9, 0x003f7,
-    0x003f5, 0x001f8, 0x001f7, 0x000fa, 0x000f8, 0x000f6, 0x00079, 0x0003a,
-    0x00038, 0x0001a, 0x0000b, 0x00004, 0x00000, 0x0000a, 0x0000c, 0x0001b,
-    0x00039, 0x0003b, 0x00078, 0x0007a, 0x000f7, 0x000f9, 0x001f6, 0x001f9,
-    0x003f4, 0x003f6, 0x003f8, 0x007f5, 0x007f4, 0x007f6, 0x007f7, 0x00ff5,
-    0x00ff8, 0x01ff4, 0x01ff6, 0x01ff8, 0x03ff8, 0x03ff4, 0x0fff0, 0x07ff4,
-    0x0fff6, 0x07ff5, 0x3ffe2, 0x7ffd9, 0x7ffda, 0x7ffdb, 0x7ffdc, 0x7ffdd,
-    0x7ffde, 0x7ffd8, 0x7ffd2, 0x7ffd3, 0x7ffd4, 0x7ffd5, 0x7ffd6, 0x7fff2,
-    0x7ffdf, 0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb, 0x7ffe6, 0x7ffe0,
-    0x7ffe1, 0x7ffe2, 0x7ffe3, 0x7ffe4, 0x7ffe5, 0x7ffd7, 0x7ffec, 0x7fff4,
-    0x7fff3,
-};
-
-const uint8_t ff_aac_scalefactor_bits[121] = {
-    18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 18, 19, 18, 17, 17, 16, 17, 16, 16, 16, 16, 15, 15,
-    14, 14, 14, 14, 14, 14, 13, 13, 12, 12, 12, 11, 12, 11, 10, 10,
-    10,  9,  9,  8,  8,  8,  7,  6,  6,  5,  4,  3,  1,  4,  4,  5,
-     6,  6,  7,  7,  8,  8,  9,  9, 10, 10, 10, 11, 11, 11, 11, 12,
-    12, 13, 13, 13, 14, 14, 16, 15, 16, 15, 18, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19, 19,
-};
-
-static const uint16_t codes1[81] = {
-    0x7f8, 0x1f1, 0x7fd, 0x3f5, 0x068, 0x3f0, 0x7f7, 0x1ec,
-    0x7f5, 0x3f1, 0x072, 0x3f4, 0x074, 0x011, 0x076, 0x1eb,
-    0x06c, 0x3f6, 0x7fc, 0x1e1, 0x7f1, 0x1f0, 0x061, 0x1f6,
-    0x7f2, 0x1ea, 0x7fb, 0x1f2, 0x069, 0x1ed, 0x077, 0x017,
-    0x06f, 0x1e6, 0x064, 0x1e5, 0x067, 0x015, 0x062, 0x012,
-    0x000, 0x014, 0x065, 0x016, 0x06d, 0x1e9, 0x063, 0x1e4,
-    0x06b, 0x013, 0x071, 0x1e3, 0x070, 0x1f3, 0x7fe, 0x1e7,
-    0x7f3, 0x1ef, 0x060, 0x1ee, 0x7f0, 0x1e2, 0x7fa, 0x3f3,
-    0x06a, 0x1e8, 0x075, 0x010, 0x073, 0x1f4, 0x06e, 0x3f7,
-    0x7f6, 0x1e0, 0x7f9, 0x3f2, 0x066, 0x1f5, 0x7ff, 0x1f7,
-    0x7f4,
-};
-
-static const uint8_t bits1[81] = {
-    11,  9, 11, 10,  7, 10, 11,  9, 11, 10,  7, 10,  7,  5,  7,  9,
-     7, 10, 11,  9, 11,  9,  7,  9, 11,  9, 11,  9,  7,  9,  7,  5,
-     7,  9,  7,  9,  7,  5,  7,  5,  1,  5,  7,  5,  7,  9,  7,  9,
-     7,  5,  7,  9,  7,  9, 11,  9, 11,  9,  7,  9, 11,  9, 11, 10,
-     7,  9,  7,  5,  7,  9,  7, 10, 11,  9, 11, 10,  7,  9, 11,  9,
-    11,
-};
-
-static const uint16_t codes2[81] = {
-    0x1f3, 0x06f, 0x1fd, 0x0eb, 0x023, 0x0ea, 0x1f7, 0x0e8,
-    0x1fa, 0x0f2, 0x02d, 0x070, 0x020, 0x006, 0x02b, 0x06e,
-    0x028, 0x0e9, 0x1f9, 0x066, 0x0f8, 0x0e7, 0x01b, 0x0f1,
-    0x1f4, 0x06b, 0x1f5, 0x0ec, 0x02a, 0x06c, 0x02c, 0x00a,
-    0x027, 0x067, 0x01a, 0x0f5, 0x024, 0x008, 0x01f, 0x009,
-    0x000, 0x007, 0x01d, 0x00b, 0x030, 0x0ef, 0x01c, 0x064,
-    0x01e, 0x00c, 0x029, 0x0f3, 0x02f, 0x0f0, 0x1fc, 0x071,
-    0x1f2, 0x0f4, 0x021, 0x0e6, 0x0f7, 0x068, 0x1f8, 0x0ee,
-    0x022, 0x065, 0x031, 0x002, 0x026, 0x0ed, 0x025, 0x06a,
-    0x1fb, 0x072, 0x1fe, 0x069, 0x02e, 0x0f6, 0x1ff, 0x06d,
-    0x1f6,
-};
-
-static const uint8_t bits2[81] = {
-    9, 7, 9, 8, 6, 8, 9, 8, 9, 8, 6, 7, 6, 5, 6, 7,
-    6, 8, 9, 7, 8, 8, 6, 8, 9, 7, 9, 8, 6, 7, 6, 5,
-    6, 7, 6, 8, 6, 5, 6, 5, 3, 5, 6, 5, 6, 8, 6, 7,
-    6, 5, 6, 8, 6, 8, 9, 7, 9, 8, 6, 8, 8, 7, 9, 8,
-    6, 7, 6, 4, 6, 8, 6, 7, 9, 7, 9, 7, 6, 8, 9, 7,
-    9,
-};
-
-static const uint16_t codes3[81] = {
-    0x0000, 0x0009, 0x00ef, 0x000b, 0x0019, 0x00f0, 0x01eb, 0x01e6,
-    0x03f2, 0x000a, 0x0035, 0x01ef, 0x0034, 0x0037, 0x01e9, 0x01ed,
-    0x01e7, 0x03f3, 0x01ee, 0x03ed, 0x1ffa, 0x01ec, 0x01f2, 0x07f9,
-    0x07f8, 0x03f8, 0x0ff8, 0x0008, 0x0038, 0x03f6, 0x0036, 0x0075,
-    0x03f1, 0x03eb, 0x03ec, 0x0ff4, 0x0018, 0x0076, 0x07f4, 0x0039,
-    0x0074, 0x03ef, 0x01f3, 0x01f4, 0x07f6, 0x01e8, 0x03ea, 0x1ffc,
-    0x00f2, 0x01f1, 0x0ffb, 0x03f5, 0x07f3, 0x0ffc, 0x00ee, 0x03f7,
-    0x7ffe, 0x01f0, 0x07f5, 0x7ffd, 0x1ffb, 0x3ffa, 0xffff, 0x00f1,
-    0x03f0, 0x3ffc, 0x01ea, 0x03ee, 0x3ffb, 0x0ff6, 0x0ffa, 0x7ffc,
-    0x07f2, 0x0ff5, 0xfffe, 0x03f4, 0x07f7, 0x7ffb, 0x0ff7, 0x0ff9,
-    0x7ffa,
-};
-
-static const uint8_t bits3[81] = {
-     1,  4,  8,  4,  5,  8,  9,  9, 10,  4,  6,  9,  6,  6,  9,  9,
-     9, 10,  9, 10, 13,  9,  9, 11, 11, 10, 12,  4,  6, 10,  6,  7,
-    10, 10, 10, 12,  5,  7, 11,  6,  7, 10,  9,  9, 11,  9, 10, 13,
-     8,  9, 12, 10, 11, 12,  8, 10, 15,  9, 11, 15, 13, 14, 16,  8,
-    10, 14,  9, 10, 14, 12, 12, 15, 11, 12, 16, 10, 11, 15, 12, 12,
-    15,
-};
-
-static const uint16_t codes4[81] = {
-    0x007, 0x016, 0x0f6, 0x018, 0x008, 0x0ef, 0x1ef, 0x0f3,
-    0x7f8, 0x019, 0x017, 0x0ed, 0x015, 0x001, 0x0e2, 0x0f0,
-    0x070, 0x3f0, 0x1ee, 0x0f1, 0x7fa, 0x0ee, 0x0e4, 0x3f2,
-    0x7f6, 0x3ef, 0x7fd, 0x005, 0x014, 0x0f2, 0x009, 0x004,
-    0x0e5, 0x0f4, 0x0e8, 0x3f4, 0x006, 0x002, 0x0e7, 0x003,
-    0x000, 0x06b, 0x0e3, 0x069, 0x1f3, 0x0eb, 0x0e6, 0x3f6,
-    0x06e, 0x06a, 0x1f4, 0x3ec, 0x1f0, 0x3f9, 0x0f5, 0x0ec,
-    0x7fb, 0x0ea, 0x06f, 0x3f7, 0x7f9, 0x3f3, 0xfff, 0x0e9,
-    0x06d, 0x3f8, 0x06c, 0x068, 0x1f5, 0x3ee, 0x1f2, 0x7f4,
-    0x7f7, 0x3f1, 0xffe, 0x3ed, 0x1f1, 0x7f5, 0x7fe, 0x3f5,
-    0x7fc,
-};
-
-static const uint8_t bits4[81] = {
-     4,  5,  8,  5,  4,  8,  9,  8, 11,  5,  5,  8,  5,  4,  8,  8,
-     7, 10,  9,  8, 11,  8,  8, 10, 11, 10, 11,  4,  5,  8,  4,  4,
-     8,  8,  8, 10,  4,  4,  8,  4,  4,  7,  8,  7,  9,  8,  8, 10,
-     7,  7,  9, 10,  9, 10,  8,  8, 11,  8,  7, 10, 11, 10, 12,  8,
-     7, 10,  7,  7,  9, 10,  9, 11, 11, 10, 12, 10,  9, 11, 11, 10,
-    11,
-};
-
-static const uint16_t codes5[81] = {
-    0x1fff, 0x0ff7, 0x07f4, 0x07e8, 0x03f1, 0x07ee, 0x07f9, 0x0ff8,
-    0x1ffd, 0x0ffd, 0x07f1, 0x03e8, 0x01e8, 0x00f0, 0x01ec, 0x03ee,
-    0x07f2, 0x0ffa, 0x0ff4, 0x03ef, 0x01f2, 0x00e8, 0x0070, 0x00ec,
-    0x01f0, 0x03ea, 0x07f3, 0x07eb, 0x01eb, 0x00ea, 0x001a, 0x0008,
-    0x0019, 0x00ee, 0x01ef, 0x07ed, 0x03f0, 0x00f2, 0x0073, 0x000b,
-    0x0000, 0x000a, 0x0071, 0x00f3, 0x07e9, 0x07ef, 0x01ee, 0x00ef,
-    0x0018, 0x0009, 0x001b, 0x00eb, 0x01e9, 0x07ec, 0x07f6, 0x03eb,
-    0x01f3, 0x00ed, 0x0072, 0x00e9, 0x01f1, 0x03ed, 0x07f7, 0x0ff6,
-    0x07f0, 0x03e9, 0x01ed, 0x00f1, 0x01ea, 0x03ec, 0x07f8, 0x0ff9,
-    0x1ffc, 0x0ffc, 0x0ff5, 0x07ea, 0x03f3, 0x03f2, 0x07f5, 0x0ffb,
-    0x1ffe,
-};
-
-static const uint8_t bits5[81] = {
-    13, 12, 11, 11, 10, 11, 11, 12, 13, 12, 11, 10,  9,  8,  9, 10,
-    11, 12, 12, 10,  9,  8,  7,  8,  9, 10, 11, 11,  9,  8,  5,  4,
-     5,  8,  9, 11, 10,  8,  7,  4,  1,  4,  7,  8, 11, 11,  9,  8,
-     5,  4,  5,  8,  9, 11, 11, 10,  9,  8,  7,  8,  9, 10, 11, 12,
-    11, 10,  9,  8,  9, 10, 11, 12, 13, 12, 12, 11, 10, 10, 11, 12,
-    13,
-};
-
-static const uint16_t codes6[81] = {
-    0x7fe, 0x3fd, 0x1f1, 0x1eb, 0x1f4, 0x1ea, 0x1f0, 0x3fc,
-    0x7fd, 0x3f6, 0x1e5, 0x0ea, 0x06c, 0x071, 0x068, 0x0f0,
-    0x1e6, 0x3f7, 0x1f3, 0x0ef, 0x032, 0x027, 0x028, 0x026,
-    0x031, 0x0eb, 0x1f7, 0x1e8, 0x06f, 0x02e, 0x008, 0x004,
-    0x006, 0x029, 0x06b, 0x1ee, 0x1ef, 0x072, 0x02d, 0x002,
-    0x000, 0x003, 0x02f, 0x073, 0x1fa, 0x1e7, 0x06e, 0x02b,
-    0x007, 0x001, 0x005, 0x02c, 0x06d, 0x1ec, 0x1f9, 0x0ee,
-    0x030, 0x024, 0x02a, 0x025, 0x033, 0x0ec, 0x1f2, 0x3f8,
-    0x1e4, 0x0ed, 0x06a, 0x070, 0x069, 0x074, 0x0f1, 0x3fa,
-    0x7ff, 0x3f9, 0x1f6, 0x1ed, 0x1f8, 0x1e9, 0x1f5, 0x3fb,
-    0x7fc,
-};
-
-static const uint8_t bits6[81] = {
-    11, 10,  9,  9,  9,  9,  9, 10, 11, 10,  9,  8,  7,  7,  7,  8,
-     9, 10,  9,  8,  6,  6,  6,  6,  6,  8,  9,  9,  7,  6,  4,  4,
-     4,  6,  7,  9,  9,  7,  6,  4,  4,  4,  6,  7,  9,  9,  7,  6,
-     4,  4,  4,  6,  7,  9,  9,  8,  6,  6,  6,  6,  6,  8,  9, 10,
-     9,  8,  7,  7,  7,  7,  8, 10, 11, 10,  9,  9,  9,  9,  9, 10,
-    11,
-};
-
-static const uint16_t codes7[64] = {
-    0x000, 0x005, 0x037, 0x074, 0x0f2, 0x1eb, 0x3ed, 0x7f7,
-    0x004, 0x00c, 0x035, 0x071, 0x0ec, 0x0ee, 0x1ee, 0x1f5,
-    0x036, 0x034, 0x072, 0x0ea, 0x0f1, 0x1e9, 0x1f3, 0x3f5,
-    0x073, 0x070, 0x0eb, 0x0f0, 0x1f1, 0x1f0, 0x3ec, 0x3fa,
-    0x0f3, 0x0ed, 0x1e8, 0x1ef, 0x3ef, 0x3f1, 0x3f9, 0x7fb,
-    0x1ed, 0x0ef, 0x1ea, 0x1f2, 0x3f3, 0x3f8, 0x7f9, 0x7fc,
-    0x3ee, 0x1ec, 0x1f4, 0x3f4, 0x3f7, 0x7f8, 0xffd, 0xffe,
-    0x7f6, 0x3f0, 0x3f2, 0x3f6, 0x7fa, 0x7fd, 0xffc, 0xfff,
-};
-
-static const uint8_t bits7[64] = {
-     1,  3,  6,  7,  8,  9, 10, 11,  3,  4,  6,  7,  8,  8,  9,  9,
-     6,  6,  7,  8,  8,  9,  9, 10,  7,  7,  8,  8,  9,  9, 10, 10,
-     8,  8,  9,  9, 10, 10, 10, 11,  9,  8,  9,  9, 10, 10, 11, 11,
-    10,  9,  9, 10, 10, 11, 12, 12, 11, 10, 10, 10, 11, 11, 12, 12,
-};
-
-static const uint16_t codes8[64] = {
-    0x00e, 0x005, 0x010, 0x030, 0x06f, 0x0f1, 0x1fa, 0x3fe,
-    0x003, 0x000, 0x004, 0x012, 0x02c, 0x06a, 0x075, 0x0f8,
-    0x00f, 0x002, 0x006, 0x014, 0x02e, 0x069, 0x072, 0x0f5,
-    0x02f, 0x011, 0x013, 0x02a, 0x032, 0x06c, 0x0ec, 0x0fa,
-    0x071, 0x02b, 0x02d, 0x031, 0x06d, 0x070, 0x0f2, 0x1f9,
-    0x0ef, 0x068, 0x033, 0x06b, 0x06e, 0x0ee, 0x0f9, 0x3fc,
-    0x1f8, 0x074, 0x073, 0x0ed, 0x0f0, 0x0f6, 0x1f6, 0x1fd,
-    0x3fd, 0x0f3, 0x0f4, 0x0f7, 0x1f7, 0x1fb, 0x1fc, 0x3ff,
-};
-
-static const uint8_t bits8[64] = {
-     5,  4,  5,  6,  7,  8,  9, 10,  4,  3,  4,  5,  6,  7,  7,  8,
-     5,  4,  4,  5,  6,  7,  7,  8,  6,  5,  5,  6,  6,  7,  8,  8,
-     7,  6,  6,  6,  7,  7,  8,  9,  8,  7,  6,  7,  7,  8,  8, 10,
-     9,  7,  7,  8,  8,  8,  9,  9, 10,  8,  8,  8,  9,  9,  9, 10,
-};
-
-static const uint16_t codes9[169] = {
-    0x0000, 0x0005, 0x0037, 0x00e7, 0x01de, 0x03ce, 0x03d9, 0x07c8,
-    0x07cd, 0x0fc8, 0x0fdd, 0x1fe4, 0x1fec, 0x0004, 0x000c, 0x0035,
-    0x0072, 0x00ea, 0x00ed, 0x01e2, 0x03d1, 0x03d3, 0x03e0, 0x07d8,
-    0x0fcf, 0x0fd5, 0x0036, 0x0034, 0x0071, 0x00e8, 0x00ec, 0x01e1,
-    0x03cf, 0x03dd, 0x03db, 0x07d0, 0x0fc7, 0x0fd4, 0x0fe4, 0x00e6,
-    0x0070, 0x00e9, 0x01dd, 0x01e3, 0x03d2, 0x03dc, 0x07cc, 0x07ca,
-    0x07de, 0x0fd8, 0x0fea, 0x1fdb, 0x01df, 0x00eb, 0x01dc, 0x01e6,
-    0x03d5, 0x03de, 0x07cb, 0x07dd, 0x07dc, 0x0fcd, 0x0fe2, 0x0fe7,
-    0x1fe1, 0x03d0, 0x01e0, 0x01e4, 0x03d6, 0x07c5, 0x07d1, 0x07db,
-    0x0fd2, 0x07e0, 0x0fd9, 0x0feb, 0x1fe3, 0x1fe9, 0x07c4, 0x01e5,
-    0x03d7, 0x07c6, 0x07cf, 0x07da, 0x0fcb, 0x0fda, 0x0fe3, 0x0fe9,
-    0x1fe6, 0x1ff3, 0x1ff7, 0x07d3, 0x03d8, 0x03e1, 0x07d4, 0x07d9,
-    0x0fd3, 0x0fde, 0x1fdd, 0x1fd9, 0x1fe2, 0x1fea, 0x1ff1, 0x1ff6,
-    0x07d2, 0x03d4, 0x03da, 0x07c7, 0x07d7, 0x07e2, 0x0fce, 0x0fdb,
-    0x1fd8, 0x1fee, 0x3ff0, 0x1ff4, 0x3ff2, 0x07e1, 0x03df, 0x07c9,
-    0x07d6, 0x0fca, 0x0fd0, 0x0fe5, 0x0fe6, 0x1feb, 0x1fef, 0x3ff3,
-    0x3ff4, 0x3ff5, 0x0fe0, 0x07ce, 0x07d5, 0x0fc6, 0x0fd1, 0x0fe1,
-    0x1fe0, 0x1fe8, 0x1ff0, 0x3ff1, 0x3ff8, 0x3ff6, 0x7ffc, 0x0fe8,
-    0x07df, 0x0fc9, 0x0fd7, 0x0fdc, 0x1fdc, 0x1fdf, 0x1fed, 0x1ff5,
-    0x3ff9, 0x3ffb, 0x7ffd, 0x7ffe, 0x1fe7, 0x0fcc, 0x0fd6, 0x0fdf,
-    0x1fde, 0x1fda, 0x1fe5, 0x1ff2, 0x3ffa, 0x3ff7, 0x3ffc, 0x3ffd,
-    0x7fff,
-};
-
-static const uint8_t bits9[169] = {
-     1,  3,  6,  8,  9, 10, 10, 11, 11, 12, 12, 13, 13,  3,  4,  6,
-     7,  8,  8,  9, 10, 10, 10, 11, 12, 12,  6,  6,  7,  8,  8,  9,
-    10, 10, 10, 11, 12, 12, 12,  8,  7,  8,  9,  9, 10, 10, 11, 11,
-    11, 12, 12, 13,  9,  8,  9,  9, 10, 10, 11, 11, 11, 12, 12, 12,
-    13, 10,  9,  9, 10, 11, 11, 11, 12, 11, 12, 12, 13, 13, 11,  9,
-    10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 11, 10, 10, 11, 11,
-    12, 12, 13, 13, 13, 13, 13, 13, 11, 10, 10, 11, 11, 11, 12, 12,
-    13, 13, 14, 13, 14, 11, 10, 11, 11, 12, 12, 12, 12, 13, 13, 14,
-    14, 14, 12, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 12,
-    11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 15, 15, 13, 12, 12, 12,
-    13, 13, 13, 13, 14, 14, 14, 14, 15,
-};
-
-static const uint16_t codes10[169] = {
-    0x022, 0x008, 0x01d, 0x026, 0x05f, 0x0d3, 0x1cf, 0x3d0,
-    0x3d7, 0x3ed, 0x7f0, 0x7f6, 0xffd, 0x007, 0x000, 0x001,
-    0x009, 0x020, 0x054, 0x060, 0x0d5, 0x0dc, 0x1d4, 0x3cd,
-    0x3de, 0x7e7, 0x01c, 0x002, 0x006, 0x00c, 0x01e, 0x028,
-    0x05b, 0x0cd, 0x0d9, 0x1ce, 0x1dc, 0x3d9, 0x3f1, 0x025,
-    0x00b, 0x00a, 0x00d, 0x024, 0x057, 0x061, 0x0cc, 0x0dd,
-    0x1cc, 0x1de, 0x3d3, 0x3e7, 0x05d, 0x021, 0x01f, 0x023,
-    0x027, 0x059, 0x064, 0x0d8, 0x0df, 0x1d2, 0x1e2, 0x3dd,
-    0x3ee, 0x0d1, 0x055, 0x029, 0x056, 0x058, 0x062, 0x0ce,
-    0x0e0, 0x0e2, 0x1da, 0x3d4, 0x3e3, 0x7eb, 0x1c9, 0x05e,
-    0x05a, 0x05c, 0x063, 0x0ca, 0x0da, 0x1c7, 0x1ca, 0x1e0,
-    0x3db, 0x3e8, 0x7ec, 0x1e3, 0x0d2, 0x0cb, 0x0d0, 0x0d7,
-    0x0db, 0x1c6, 0x1d5, 0x1d8, 0x3ca, 0x3da, 0x7ea, 0x7f1,
-    0x1e1, 0x0d4, 0x0cf, 0x0d6, 0x0de, 0x0e1, 0x1d0, 0x1d6,
-    0x3d1, 0x3d5, 0x3f2, 0x7ee, 0x7fb, 0x3e9, 0x1cd, 0x1c8,
-    0x1cb, 0x1d1, 0x1d7, 0x1df, 0x3cf, 0x3e0, 0x3ef, 0x7e6,
-    0x7f8, 0xffa, 0x3eb, 0x1dd, 0x1d3, 0x1d9, 0x1db, 0x3d2,
-    0x3cc, 0x3dc, 0x3ea, 0x7ed, 0x7f3, 0x7f9, 0xff9, 0x7f2,
-    0x3ce, 0x1e4, 0x3cb, 0x3d8, 0x3d6, 0x3e2, 0x3e5, 0x7e8,
-    0x7f4, 0x7f5, 0x7f7, 0xffb, 0x7fa, 0x3ec, 0x3df, 0x3e1,
-    0x3e4, 0x3e6, 0x3f0, 0x7e9, 0x7ef, 0xff8, 0xffe, 0xffc,
-    0xfff,
-};
-
-static const uint8_t bits10[169] = {
-     6,  5,  6,  6,  7,  8,  9, 10, 10, 10, 11, 11, 12,  5,  4,  4,
-     5,  6,  7,  7,  8,  8,  9, 10, 10, 11,  6,  4,  5,  5,  6,  6,
-     7,  8,  8,  9,  9, 10, 10,  6,  5,  5,  5,  6,  7,  7,  8,  8,
-     9,  9, 10, 10,  7,  6,  6,  6,  6,  7,  7,  8,  8,  9,  9, 10,
-    10,  8,  7,  6,  7,  7,  7,  8,  8,  8,  9, 10, 10, 11,  9,  7,
-     7,  7,  7,  8,  8,  9,  9,  9, 10, 10, 11,  9,  8,  8,  8,  8,
-     8,  9,  9,  9, 10, 10, 11, 11,  9,  8,  8,  8,  8,  8,  9,  9,
-    10, 10, 10, 11, 11, 10,  9,  9,  9,  9,  9,  9, 10, 10, 10, 11,
-    11, 12, 10,  9,  9,  9,  9, 10, 10, 10, 10, 11, 11, 11, 12, 11,
-    10,  9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 12, 11, 10, 10, 10,
-    10, 10, 10, 11, 11, 12, 12, 12, 12,
-};
-
-static const uint16_t codes11[289] = {
-    0x000, 0x006, 0x019, 0x03d, 0x09c, 0x0c6, 0x1a7, 0x390,
-    0x3c2, 0x3df, 0x7e6, 0x7f3, 0xffb, 0x7ec, 0xffa, 0xffe,
-    0x38e, 0x005, 0x001, 0x008, 0x014, 0x037, 0x042, 0x092,
-    0x0af, 0x191, 0x1a5, 0x1b5, 0x39e, 0x3c0, 0x3a2, 0x3cd,
-    0x7d6, 0x0ae, 0x017, 0x007, 0x009, 0x018, 0x039, 0x040,
-    0x08e, 0x0a3, 0x0b8, 0x199, 0x1ac, 0x1c1, 0x3b1, 0x396,
-    0x3be, 0x3ca, 0x09d, 0x03c, 0x015, 0x016, 0x01a, 0x03b,
-    0x044, 0x091, 0x0a5, 0x0be, 0x196, 0x1ae, 0x1b9, 0x3a1,
-    0x391, 0x3a5, 0x3d5, 0x094, 0x09a, 0x036, 0x038, 0x03a,
-    0x041, 0x08c, 0x09b, 0x0b0, 0x0c3, 0x19e, 0x1ab, 0x1bc,
-    0x39f, 0x38f, 0x3a9, 0x3cf, 0x093, 0x0bf, 0x03e, 0x03f,
-    0x043, 0x045, 0x09e, 0x0a7, 0x0b9, 0x194, 0x1a2, 0x1ba,
-    0x1c3, 0x3a6, 0x3a7, 0x3bb, 0x3d4, 0x09f, 0x1a0, 0x08f,
-    0x08d, 0x090, 0x098, 0x0a6, 0x0b6, 0x0c4, 0x19f, 0x1af,
-    0x1bf, 0x399, 0x3bf, 0x3b4, 0x3c9, 0x3e7, 0x0a8, 0x1b6,
-    0x0ab, 0x0a4, 0x0aa, 0x0b2, 0x0c2, 0x0c5, 0x198, 0x1a4,
-    0x1b8, 0x38c, 0x3a4, 0x3c4, 0x3c6, 0x3dd, 0x3e8, 0x0ad,
-    0x3af, 0x192, 0x0bd, 0x0bc, 0x18e, 0x197, 0x19a, 0x1a3,
-    0x1b1, 0x38d, 0x398, 0x3b7, 0x3d3, 0x3d1, 0x3db, 0x7dd,
-    0x0b4, 0x3de, 0x1a9, 0x19b, 0x19c, 0x1a1, 0x1aa, 0x1ad,
-    0x1b3, 0x38b, 0x3b2, 0x3b8, 0x3ce, 0x3e1, 0x3e0, 0x7d2,
-    0x7e5, 0x0b7, 0x7e3, 0x1bb, 0x1a8, 0x1a6, 0x1b0, 0x1b2,
-    0x1b7, 0x39b, 0x39a, 0x3ba, 0x3b5, 0x3d6, 0x7d7, 0x3e4,
-    0x7d8, 0x7ea, 0x0ba, 0x7e8, 0x3a0, 0x1bd, 0x1b4, 0x38a,
-    0x1c4, 0x392, 0x3aa, 0x3b0, 0x3bc, 0x3d7, 0x7d4, 0x7dc,
-    0x7db, 0x7d5, 0x7f0, 0x0c1, 0x7fb, 0x3c8, 0x3a3, 0x395,
-    0x39d, 0x3ac, 0x3ae, 0x3c5, 0x3d8, 0x3e2, 0x3e6, 0x7e4,
-    0x7e7, 0x7e0, 0x7e9, 0x7f7, 0x190, 0x7f2, 0x393, 0x1be,
-    0x1c0, 0x394, 0x397, 0x3ad, 0x3c3, 0x3c1, 0x3d2, 0x7da,
-    0x7d9, 0x7df, 0x7eb, 0x7f4, 0x7fa, 0x195, 0x7f8, 0x3bd,
-    0x39c, 0x3ab, 0x3a8, 0x3b3, 0x3b9, 0x3d0, 0x3e3, 0x3e5,
-    0x7e2, 0x7de, 0x7ed, 0x7f1, 0x7f9, 0x7fc, 0x193, 0xffd,
-    0x3dc, 0x3b6, 0x3c7, 0x3cc, 0x3cb, 0x3d9, 0x3da, 0x7d3,
-    0x7e1, 0x7ee, 0x7ef, 0x7f5, 0x7f6, 0xffc, 0xfff, 0x19d,
-    0x1c2, 0x0b5, 0x0a1, 0x096, 0x097, 0x095, 0x099, 0x0a0,
-    0x0a2, 0x0ac, 0x0a9, 0x0b1, 0x0b3, 0x0bb, 0x0c0, 0x18f,
-    0x004,
-};
-
-static const uint8_t bits11[289] = {
-     4,  5,  6,  7,  8,  8,  9, 10, 10, 10, 11, 11, 12, 11, 12, 12,
-    10,  5,  4,  5,  6,  7,  7,  8,  8,  9,  9,  9, 10, 10, 10, 10,
-    11,  8,  6,  5,  5,  6,  7,  7,  8,  8,  8,  9,  9,  9, 10, 10,
-    10, 10,  8,  7,  6,  6,  6,  7,  7,  8,  8,  8,  9,  9,  9, 10,
-    10, 10, 10,  8,  8,  7,  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,
-    10, 10, 10, 10,  8,  8,  7,  7,  7,  7,  8,  8,  8,  9,  9,  9,
-     9, 10, 10, 10, 10,  8,  9,  8,  8,  8,  8,  8,  8,  8,  9,  9,
-     9, 10, 10, 10, 10, 10,  8,  9,  8,  8,  8,  8,  8,  8,  9,  9,
-     9, 10, 10, 10, 10, 10, 10,  8, 10,  9,  8,  8,  9,  9,  9,  9,
-     9, 10, 10, 10, 10, 10, 10, 11,  8, 10,  9,  9,  9,  9,  9,  9,
-     9, 10, 10, 10, 10, 10, 10, 11, 11,  8, 11,  9,  9,  9,  9,  9,
-     9, 10, 10, 10, 10, 10, 11, 10, 11, 11,  8, 11, 10,  9,  9, 10,
-     9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11,  8, 11, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11,  9, 11, 10,  9,
-     9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11,  9, 11, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11,  9, 12,
-    10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12,  9,
-     9,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  9,
-     5,
-};
-
-const uint16_t * const ff_aac_spectral_codes[11] = {
-    codes1,  codes2,  codes3, codes4, codes5, codes6, codes7, codes8,
-    codes9, codes10, codes11,
-};
-
-const uint8_t * const ff_aac_spectral_bits[11] = {
-    bits1,  bits2,  bits3, bits4, bits5, bits6, bits7, bits8,
-    bits9, bits10, bits11,
-};
-
-const uint16_t ff_aac_spectral_sizes[11] = {
-    81, 81, 81, 81, 81, 81, 64, 64, 169, 169, 289,
-};
-
-/* NOTE:
- * 64.0f is a special value indicating the existence of an escape code in the
- * bitstream.
- */
-static const DECLARE_ALIGNED(16, float, codebook_vector0)[324] = {
- -1.0000000, -1.0000000, -1.0000000, -1.0000000,
- -1.0000000, -1.0000000, -1.0000000,  0.0000000,
- -1.0000000, -1.0000000, -1.0000000,  1.0000000,
- -1.0000000, -1.0000000,  0.0000000, -1.0000000,
- -1.0000000, -1.0000000,  0.0000000,  0.0000000,
- -1.0000000, -1.0000000,  0.0000000,  1.0000000,
- -1.0000000, -1.0000000,  1.0000000, -1.0000000,
- -1.0000000, -1.0000000,  1.0000000,  0.0000000,
- -1.0000000, -1.0000000,  1.0000000,  1.0000000,
- -1.0000000,  0.0000000, -1.0000000, -1.0000000,
- -1.0000000,  0.0000000, -1.0000000,  0.0000000,
- -1.0000000,  0.0000000, -1.0000000,  1.0000000,
- -1.0000000,  0.0000000,  0.0000000, -1.0000000,
- -1.0000000,  0.0000000,  0.0000000,  0.0000000,
- -1.0000000,  0.0000000,  0.0000000,  1.0000000,
- -1.0000000,  0.0000000,  1.0000000, -1.0000000,
- -1.0000000,  0.0000000,  1.0000000,  0.0000000,
- -1.0000000,  0.0000000,  1.0000000,  1.0000000,
- -1.0000000,  1.0000000, -1.0000000, -1.0000000,
- -1.0000000,  1.0000000, -1.0000000,  0.0000000,
- -1.0000000,  1.0000000, -1.0000000,  1.0000000,
- -1.0000000,  1.0000000,  0.0000000, -1.0000000,
- -1.0000000,  1.0000000,  0.0000000,  0.0000000,
- -1.0000000,  1.0000000,  0.0000000,  1.0000000,
- -1.0000000,  1.0000000,  1.0000000, -1.0000000,
- -1.0000000,  1.0000000,  1.0000000,  0.0000000,
- -1.0000000,  1.0000000,  1.0000000,  1.0000000,
-  0.0000000, -1.0000000, -1.0000000, -1.0000000,
-  0.0000000, -1.0000000, -1.0000000,  0.0000000,
-  0.0000000, -1.0000000, -1.0000000,  1.0000000,
-  0.0000000, -1.0000000,  0.0000000, -1.0000000,
-  0.0000000, -1.0000000,  0.0000000,  0.0000000,
-  0.0000000, -1.0000000,  0.0000000,  1.0000000,
-  0.0000000, -1.0000000,  1.0000000, -1.0000000,
-  0.0000000, -1.0000000,  1.0000000,  0.0000000,
-  0.0000000, -1.0000000,  1.0000000,  1.0000000,
-  0.0000000,  0.0000000, -1.0000000, -1.0000000,
-  0.0000000,  0.0000000, -1.0000000,  0.0000000,
-  0.0000000,  0.0000000, -1.0000000,  1.0000000,
-  0.0000000,  0.0000000,  0.0000000, -1.0000000,
-  0.0000000,  0.0000000,  0.0000000,  0.0000000,
-  0.0000000,  0.0000000,  0.0000000,  1.0000000,
-  0.0000000,  0.0000000,  1.0000000, -1.0000000,
-  0.0000000,  0.0000000,  1.0000000,  0.0000000,
-  0.0000000,  0.0000000,  1.0000000,  1.0000000,
-  0.0000000,  1.0000000, -1.0000000, -1.0000000,
-  0.0000000,  1.0000000, -1.0000000,  0.0000000,
-  0.0000000,  1.0000000, -1.0000000,  1.0000000,
-  0.0000000,  1.0000000,  0.0000000, -1.0000000,
-  0.0000000,  1.0000000,  0.0000000,  0.0000000,
-  0.0000000,  1.0000000,  0.0000000,  1.0000000,
-  0.0000000,  1.0000000,  1.0000000, -1.0000000,
-  0.0000000,  1.0000000,  1.0000000,  0.0000000,
-  0.0000000,  1.0000000,  1.0000000,  1.0000000,
-  1.0000000, -1.0000000, -1.0000000, -1.0000000,
-  1.0000000, -1.0000000, -1.0000000,  0.0000000,
-  1.0000000, -1.0000000, -1.0000000,  1.0000000,
-  1.0000000, -1.0000000,  0.0000000, -1.0000000,
-  1.0000000, -1.0000000,  0.0000000,  0.0000000,
-  1.0000000, -1.0000000,  0.0000000,  1.0000000,
-  1.0000000, -1.0000000,  1.0000000, -1.0000000,
-  1.0000000, -1.0000000,  1.0000000,  0.0000000,
-  1.0000000, -1.0000000,  1.0000000,  1.0000000,
-  1.0000000,  0.0000000, -1.0000000, -1.0000000,
-  1.0000000,  0.0000000, -1.0000000,  0.0000000,
-  1.0000000,  0.0000000, -1.0000000,  1.0000000,
-  1.0000000,  0.0000000,  0.0000000, -1.0000000,
-  1.0000000,  0.0000000,  0.0000000,  0.0000000,
-  1.0000000,  0.0000000,  0.0000000,  1.0000000,
-  1.0000000,  0.0000000,  1.0000000, -1.0000000,
-  1.0000000,  0.0000000,  1.0000000,  0.0000000,
-  1.0000000,  0.0000000,  1.0000000,  1.0000000,
-  1.0000000,  1.0000000, -1.0000000, -1.0000000,
-  1.0000000,  1.0000000, -1.0000000,  0.0000000,
-  1.0000000,  1.0000000, -1.0000000,  1.0000000,
-  1.0000000,  1.0000000,  0.0000000, -1.0000000,
-  1.0000000,  1.0000000,  0.0000000,  0.0000000,
-  1.0000000,  1.0000000,  0.0000000,  1.0000000,
-  1.0000000,  1.0000000,  1.0000000, -1.0000000,
-  1.0000000,  1.0000000,  1.0000000,  0.0000000,
-  1.0000000,  1.0000000,  1.0000000,  1.0000000,
-};
-
-static const DECLARE_ALIGNED(16, float, codebook_vector2)[324] = {
-  0.0000000,  0.0000000,  0.0000000,  0.0000000,
-  0.0000000,  0.0000000,  0.0000000,  1.0000000,
-  0.0000000,  0.0000000,  0.0000000,  2.5198421,
-  0.0000000,  0.0000000,  1.0000000,  0.0000000,
-  0.0000000,  0.0000000,  1.0000000,  1.0000000,
-  0.0000000,  0.0000000,  1.0000000,  2.5198421,
-  0.0000000,  0.0000000,  2.5198421,  0.0000000,
-  0.0000000,  0.0000000,  2.5198421,  1.0000000,
-  0.0000000,  0.0000000,  2.5198421,  2.5198421,
-  0.0000000,  1.0000000,  0.0000000,  0.0000000,
-  0.0000000,  1.0000000,  0.0000000,  1.0000000,
-  0.0000000,  1.0000000,  0.0000000,  2.5198421,
-  0.0000000,  1.0000000,  1.0000000,  0.0000000,
-  0.0000000,  1.0000000,  1.0000000,  1.0000000,
-  0.0000000,  1.0000000,  1.0000000,  2.5198421,
-  0.0000000,  1.0000000,  2.5198421,  0.0000000,
-  0.0000000,  1.0000000,  2.5198421,  1.0000000,
-  0.0000000,  1.0000000,  2.5198421,  2.5198421,
-  0.0000000,  2.5198421,  0.0000000,  0.0000000,
-  0.0000000,  2.5198421,  0.0000000,  1.0000000,
-  0.0000000,  2.5198421,  0.0000000,  2.5198421,
-  0.0000000,  2.5198421,  1.0000000,  0.0000000,
-  0.0000000,  2.5198421,  1.0000000,  1.0000000,
-  0.0000000,  2.5198421,  1.0000000,  2.5198421,
-  0.0000000,  2.5198421,  2.5198421,  0.0000000,
-  0.0000000,  2.5198421,  2.5198421,  1.0000000,
-  0.0000000,  2.5198421,  2.5198421,  2.5198421,
-  1.0000000,  0.0000000,  0.0000000,  0.0000000,
-  1.0000000,  0.0000000,  0.0000000,  1.0000000,
-  1.0000000,  0.0000000,  0.0000000,  2.5198421,
-  1.0000000,  0.0000000,  1.0000000,  0.0000000,
-  1.0000000,  0.0000000,  1.0000000,  1.0000000,
-  1.0000000,  0.0000000,  1.0000000,  2.5198421,
-  1.0000000,  0.0000000,  2.5198421,  0.0000000,
-  1.0000000,  0.0000000,  2.5198421,  1.0000000,
-  1.0000000,  0.0000000,  2.5198421,  2.5198421,
-  1.0000000,  1.0000000,  0.0000000,  0.0000000,
-  1.0000000,  1.0000000,  0.0000000,  1.0000000,
-  1.0000000,  1.0000000,  0.0000000,  2.5198421,
-  1.0000000,  1.0000000,  1.0000000,  0.0000000,
-  1.0000000,  1.0000000,  1.0000000,  1.0000000,
-  1.0000000,  1.0000000,  1.0000000,  2.5198421,
-  1.0000000,  1.0000000,  2.5198421,  0.0000000,
-  1.0000000,  1.0000000,  2.5198421,  1.0000000,
-  1.0000000,  1.0000000,  2.5198421,  2.5198421,
-  1.0000000,  2.5198421,  0.0000000,  0.0000000,
-  1.0000000,  2.5198421,  0.0000000,  1.0000000,
-  1.0000000,  2.5198421,  0.0000000,  2.5198421,
-  1.0000000,  2.5198421,  1.0000000,  0.0000000,
-  1.0000000,  2.5198421,  1.0000000,  1.0000000,
-  1.0000000,  2.5198421,  1.0000000,  2.5198421,
-  1.0000000,  2.5198421,  2.5198421,  0.0000000,
-  1.0000000,  2.5198421,  2.5198421,  1.0000000,
-  1.0000000,  2.5198421,  2.5198421,  2.5198421,
-  2.5198421,  0.0000000,  0.0000000,  0.0000000,
-  2.5198421,  0.0000000,  0.0000000,  1.0000000,
-  2.5198421,  0.0000000,  0.0000000,  2.5198421,
-  2.5198421,  0.0000000,  1.0000000,  0.0000000,
-  2.5198421,  0.0000000,  1.0000000,  1.0000000,
-  2.5198421,  0.0000000,  1.0000000,  2.5198421,
-  2.5198421,  0.0000000,  2.5198421,  0.0000000,
-  2.5198421,  0.0000000,  2.5198421,  1.0000000,
-  2.5198421,  0.0000000,  2.5198421,  2.5198421,
-  2.5198421,  1.0000000,  0.0000000,  0.0000000,
-  2.5198421,  1.0000000,  0.0000000,  1.0000000,
-  2.5198421,  1.0000000,  0.0000000,  2.5198421,
-  2.5198421,  1.0000000,  1.0000000,  0.0000000,
-  2.5198421,  1.0000000,  1.0000000,  1.0000000,
-  2.5198421,  1.0000000,  1.0000000,  2.5198421,
-  2.5198421,  1.0000000,  2.5198421,  0.0000000,
-  2.5198421,  1.0000000,  2.5198421,  1.0000000,
-  2.5198421,  1.0000000,  2.5198421,  2.5198421,
-  2.5198421,  2.5198421,  0.0000000,  0.0000000,
-  2.5198421,  2.5198421,  0.0000000,  1.0000000,
-  2.5198421,  2.5198421,  0.0000000,  2.5198421,
-  2.5198421,  2.5198421,  1.0000000,  0.0000000,
-  2.5198421,  2.5198421,  1.0000000,  1.0000000,
-  2.5198421,  2.5198421,  1.0000000,  2.5198421,
-  2.5198421,  2.5198421,  2.5198421,  0.0000000,
-  2.5198421,  2.5198421,  2.5198421,  1.0000000,
-  2.5198421,  2.5198421,  2.5198421,  2.5198421,
-};
-
-static const DECLARE_ALIGNED(16, float, codebook_vector4)[162] = {
- -6.3496042, -6.3496042, -6.3496042, -4.3267487,
- -6.3496042, -2.5198421, -6.3496042, -1.0000000,
- -6.3496042,  0.0000000, -6.3496042,  1.0000000,
- -6.3496042,  2.5198421, -6.3496042,  4.3267487,
- -6.3496042,  6.3496042, -4.3267487, -6.3496042,
- -4.3267487, -4.3267487, -4.3267487, -2.5198421,
- -4.3267487, -1.0000000, -4.3267487,  0.0000000,
- -4.3267487,  1.0000000, -4.3267487,  2.5198421,
- -4.3267487,  4.3267487, -4.3267487,  6.3496042,
- -2.5198421, -6.3496042, -2.5198421, -4.3267487,
- -2.5198421, -2.5198421, -2.5198421, -1.0000000,
- -2.5198421,  0.0000000, -2.5198421,  1.0000000,
- -2.5198421,  2.5198421, -2.5198421,  4.3267487,
- -2.5198421,  6.3496042, -1.0000000, -6.3496042,
- -1.0000000, -4.3267487, -1.0000000, -2.5198421,
- -1.0000000, -1.0000000, -1.0000000,  0.0000000,
- -1.0000000,  1.0000000, -1.0000000,  2.5198421,
- -1.0000000,  4.3267487, -1.0000000,  6.3496042,
-  0.0000000, -6.3496042,  0.0000000, -4.3267487,
-  0.0000000, -2.5198421,  0.0000000, -1.0000000,
-  0.0000000,  0.0000000,  0.0000000,  1.0000000,
-  0.0000000,  2.5198421,  0.0000000,  4.3267487,
-  0.0000000,  6.3496042,  1.0000000, -6.3496042,
-  1.0000000, -4.3267487,  1.0000000, -2.5198421,
-  1.0000000, -1.0000000,  1.0000000,  0.0000000,
-  1.0000000,  1.0000000,  1.0000000,  2.5198421,
-  1.0000000,  4.3267487,  1.0000000,  6.3496042,
-  2.5198421, -6.3496042,  2.5198421, -4.3267487,
-  2.5198421, -2.5198421,  2.5198421, -1.0000000,
-  2.5198421,  0.0000000,  2.5198421,  1.0000000,
-  2.5198421,  2.5198421,  2.5198421,  4.3267487,
-  2.5198421,  6.3496042,  4.3267487, -6.3496042,
-  4.3267487, -4.3267487,  4.3267487, -2.5198421,
-  4.3267487, -1.0000000,  4.3267487,  0.0000000,
-  4.3267487,  1.0000000,  4.3267487,  2.5198421,
-  4.3267487,  4.3267487,  4.3267487,  6.3496042,
-  6.3496042, -6.3496042,  6.3496042, -4.3267487,
-  6.3496042, -2.5198421,  6.3496042, -1.0000000,
-  6.3496042,  0.0000000,  6.3496042,  1.0000000,
-  6.3496042,  2.5198421,  6.3496042,  4.3267487,
-  6.3496042,  6.3496042,
-};
-
-static const DECLARE_ALIGNED(16, float, codebook_vector6)[128] = {
-  0.0000000,  0.0000000,  0.0000000,  1.0000000,
-  0.0000000,  2.5198421,  0.0000000,  4.3267487,
-  0.0000000,  6.3496042,  0.0000000,  8.5498797,
-  0.0000000, 10.9027236,  0.0000000, 13.3905183,
-  1.0000000,  0.0000000,  1.0000000,  1.0000000,
-  1.0000000,  2.5198421,  1.0000000,  4.3267487,
-  1.0000000,  6.3496042,  1.0000000,  8.5498797,
-  1.0000000, 10.9027236,  1.0000000, 13.3905183,
-  2.5198421,  0.0000000,  2.5198421,  1.0000000,
-  2.5198421,  2.5198421,  2.5198421,  4.3267487,
-  2.5198421,  6.3496042,  2.5198421,  8.5498797,
-  2.5198421, 10.9027236,  2.5198421, 13.3905183,
-  4.3267487,  0.0000000,  4.3267487,  1.0000000,
-  4.3267487,  2.5198421,  4.3267487,  4.3267487,
-  4.3267487,  6.3496042,  4.3267487,  8.5498797,
-  4.3267487, 10.9027236,  4.3267487, 13.3905183,
-  6.3496042,  0.0000000,  6.3496042,  1.0000000,
-  6.3496042,  2.5198421,  6.3496042,  4.3267487,
-  6.3496042,  6.3496042,  6.3496042,  8.5498797,
-  6.3496042, 10.9027236,  6.3496042, 13.3905183,
-  8.5498797,  0.0000000,  8.5498797,  1.0000000,
-  8.5498797,  2.5198421,  8.5498797,  4.3267487,
-  8.5498797,  6.3496042,  8.5498797,  8.5498797,
-  8.5498797, 10.9027236,  8.5498797, 13.3905183,
- 10.9027236,  0.0000000, 10.9027236,  1.0000000,
- 10.9027236,  2.5198421, 10.9027236,  4.3267487,
- 10.9027236,  6.3496042, 10.9027236,  8.5498797,
- 10.9027236, 10.9027236, 10.9027236, 13.3905183,
- 13.3905183,  0.0000000, 13.3905183,  1.0000000,
- 13.3905183,  2.5198421, 13.3905183,  4.3267487,
- 13.3905183,  6.3496042, 13.3905183,  8.5498797,
- 13.3905183, 10.9027236, 13.3905183, 13.3905183,
-};
-
-static const DECLARE_ALIGNED(16, float, codebook_vector8)[338] = {
-  0.0000000,  0.0000000,  0.0000000,  1.0000000,
-  0.0000000,  2.5198421,  0.0000000,  4.3267487,
-  0.0000000,  6.3496042,  0.0000000,  8.5498797,
-  0.0000000, 10.9027236,  0.0000000, 13.3905183,
-  0.0000000, 16.0000000,  0.0000000, 18.7207544,
-  0.0000000, 21.5443469,  0.0000000, 24.4637810,
-  0.0000000, 27.4731418,  1.0000000,  0.0000000,
-  1.0000000,  1.0000000,  1.0000000,  2.5198421,
-  1.0000000,  4.3267487,  1.0000000,  6.3496042,
-  1.0000000,  8.5498797,  1.0000000, 10.9027236,
-  1.0000000, 13.3905183,  1.0000000, 16.0000000,
-  1.0000000, 18.7207544,  1.0000000, 21.5443469,
-  1.0000000, 24.4637810,  1.0000000, 27.4731418,
-  2.5198421,  0.0000000,  2.5198421,  1.0000000,
-  2.5198421,  2.5198421,  2.5198421,  4.3267487,
-  2.5198421,  6.3496042,  2.5198421,  8.5498797,
-  2.5198421, 10.9027236,  2.5198421, 13.3905183,
-  2.5198421, 16.0000000,  2.5198421, 18.7207544,
-  2.5198421, 21.5443469,  2.5198421, 24.4637810,
-  2.5198421, 27.4731418,  4.3267487,  0.0000000,
-  4.3267487,  1.0000000,  4.3267487,  2.5198421,
-  4.3267487,  4.3267487,  4.3267487,  6.3496042,
-  4.3267487,  8.5498797,  4.3267487, 10.9027236,
-  4.3267487, 13.3905183,  4.3267487, 16.0000000,
-  4.3267487, 18.7207544,  4.3267487, 21.5443469,
-  4.3267487, 24.4637810,  4.3267487, 27.4731418,
-  6.3496042,  0.0000000,  6.3496042,  1.0000000,
-  6.3496042,  2.5198421,  6.3496042,  4.3267487,
-  6.3496042,  6.3496042,  6.3496042,  8.5498797,
-  6.3496042, 10.9027236,  6.3496042, 13.3905183,
-  6.3496042, 16.0000000,  6.3496042, 18.7207544,
-  6.3496042, 21.5443469,  6.3496042, 24.4637810,
-  6.3496042, 27.4731418,  8.5498797,  0.0000000,
-  8.5498797,  1.0000000,  8.5498797,  2.5198421,
-  8.5498797,  4.3267487,  8.5498797,  6.3496042,
-  8.5498797,  8.5498797,  8.5498797, 10.9027236,
-  8.5498797, 13.3905183,  8.5498797, 16.0000000,
-  8.5498797, 18.7207544,  8.5498797, 21.5443469,
-  8.5498797, 24.4637810,  8.5498797, 27.4731418,
- 10.9027236,  0.0000000, 10.9027236,  1.0000000,
- 10.9027236,  2.5198421, 10.9027236,  4.3267487,
- 10.9027236,  6.3496042, 10.9027236,  8.5498797,
- 10.9027236, 10.9027236, 10.9027236, 13.3905183,
- 10.9027236, 16.0000000, 10.9027236, 18.7207544,
- 10.9027236, 21.5443469, 10.9027236, 24.4637810,
- 10.9027236, 27.4731418, 13.3905183,  0.0000000,
- 13.3905183,  1.0000000, 13.3905183,  2.5198421,
- 13.3905183,  4.3267487, 13.3905183,  6.3496042,
- 13.3905183,  8.5498797, 13.3905183, 10.9027236,
- 13.3905183, 13.3905183, 13.3905183, 16.0000000,
- 13.3905183, 18.7207544, 13.3905183, 21.5443469,
- 13.3905183, 24.4637810, 13.3905183, 27.4731418,
- 16.0000000,  0.0000000, 16.0000000,  1.0000000,
- 16.0000000,  2.5198421, 16.0000000,  4.3267487,
- 16.0000000,  6.3496042, 16.0000000,  8.5498797,
- 16.0000000, 10.9027236, 16.0000000, 13.3905183,
- 16.0000000, 16.0000000, 16.0000000, 18.7207544,
- 16.0000000, 21.5443469, 16.0000000, 24.4637810,
- 16.0000000, 27.4731418, 18.7207544,  0.0000000,
- 18.7207544,  1.0000000, 18.7207544,  2.5198421,
- 18.7207544,  4.3267487, 18.7207544,  6.3496042,
- 18.7207544,  8.5498797, 18.7207544, 10.9027236,
- 18.7207544, 13.3905183, 18.7207544, 16.0000000,
- 18.7207544, 18.7207544, 18.7207544, 21.5443469,
- 18.7207544, 24.4637810, 18.7207544, 27.4731418,
- 21.5443469,  0.0000000, 21.5443469,  1.0000000,
- 21.5443469,  2.5198421, 21.5443469,  4.3267487,
- 21.5443469,  6.3496042, 21.5443469,  8.5498797,
- 21.5443469, 10.9027236, 21.5443469, 13.3905183,
- 21.5443469, 16.0000000, 21.5443469, 18.7207544,
- 21.5443469, 21.5443469, 21.5443469, 24.4637810,
- 21.5443469, 27.4731418, 24.4637810,  0.0000000,
- 24.4637810,  1.0000000, 24.4637810,  2.5198421,
- 24.4637810,  4.3267487, 24.4637810,  6.3496042,
- 24.4637810,  8.5498797, 24.4637810, 10.9027236,
- 24.4637810, 13.3905183, 24.4637810, 16.0000000,
- 24.4637810, 18.7207544, 24.4637810, 21.5443469,
- 24.4637810, 24.4637810, 24.4637810, 27.4731418,
- 27.4731418,  0.0000000, 27.4731418,  1.0000000,
- 27.4731418,  2.5198421, 27.4731418,  4.3267487,
- 27.4731418,  6.3496042, 27.4731418,  8.5498797,
- 27.4731418, 10.9027236, 27.4731418, 13.3905183,
- 27.4731418, 16.0000000, 27.4731418, 18.7207544,
- 27.4731418, 21.5443469, 27.4731418, 24.4637810,
- 27.4731418, 27.4731418,
-};
-
-static const DECLARE_ALIGNED(16, float, codebook_vector10)[578] = {
-  0.0000000,  0.0000000,  0.0000000,  1.0000000,
-  0.0000000,  2.5198421,  0.0000000,  4.3267487,
-  0.0000000,  6.3496042,  0.0000000,  8.5498797,
-  0.0000000, 10.9027236,  0.0000000, 13.3905183,
-  0.0000000, 16.0000000,  0.0000000, 18.7207544,
-  0.0000000, 21.5443469,  0.0000000, 24.4637810,
-  0.0000000, 27.4731418,  0.0000000, 30.5673509,
-  0.0000000, 33.7419917,  0.0000000, 36.9931811,
-  0.0000000,      64.0f,  1.0000000,  0.0000000,
-  1.0000000,  1.0000000,  1.0000000,  2.5198421,
-  1.0000000,  4.3267487,  1.0000000,  6.3496042,
-  1.0000000,  8.5498797,  1.0000000, 10.9027236,
-  1.0000000, 13.3905183,  1.0000000, 16.0000000,
-  1.0000000, 18.7207544,  1.0000000, 21.5443469,
-  1.0000000, 24.4637810,  1.0000000, 27.4731418,
-  1.0000000, 30.5673509,  1.0000000, 33.7419917,
-  1.0000000, 36.9931811,  1.0000000,      64.0f,
-  2.5198421,  0.0000000,  2.5198421,  1.0000000,
-  2.5198421,  2.5198421,  2.5198421,  4.3267487,
-  2.5198421,  6.3496042,  2.5198421,  8.5498797,
-  2.5198421, 10.9027236,  2.5198421, 13.3905183,
-  2.5198421, 16.0000000,  2.5198421, 18.7207544,
-  2.5198421, 21.5443469,  2.5198421, 24.4637810,
-  2.5198421, 27.4731418,  2.5198421, 30.5673509,
-  2.5198421, 33.7419917,  2.5198421, 36.9931811,
-  2.5198421,      64.0f,  4.3267487,  0.0000000,
-  4.3267487,  1.0000000,  4.3267487,  2.5198421,
-  4.3267487,  4.3267487,  4.3267487,  6.3496042,
-  4.3267487,  8.5498797,  4.3267487, 10.9027236,
-  4.3267487, 13.3905183,  4.3267487, 16.0000000,
-  4.3267487, 18.7207544,  4.3267487, 21.5443469,
-  4.3267487, 24.4637810,  4.3267487, 27.4731418,
-  4.3267487, 30.5673509,  4.3267487, 33.7419917,
-  4.3267487, 36.9931811,  4.3267487,      64.0f,
-  6.3496042,  0.0000000,  6.3496042,  1.0000000,
-  6.3496042,  2.5198421,  6.3496042,  4.3267487,
-  6.3496042,  6.3496042,  6.3496042,  8.5498797,
-  6.3496042, 10.9027236,  6.3496042, 13.3905183,
-  6.3496042, 16.0000000,  6.3496042, 18.7207544,
-  6.3496042, 21.5443469,  6.3496042, 24.4637810,
-  6.3496042, 27.4731418,  6.3496042, 30.5673509,
-  6.3496042, 33.7419917,  6.3496042, 36.9931811,
-  6.3496042,      64.0f,  8.5498797,  0.0000000,
-  8.5498797,  1.0000000,  8.5498797,  2.5198421,
-  8.5498797,  4.3267487,  8.5498797,  6.3496042,
-  8.5498797,  8.5498797,  8.5498797, 10.9027236,
-  8.5498797, 13.3905183,  8.5498797, 16.0000000,
-  8.5498797, 18.7207544,  8.5498797, 21.5443469,
-  8.5498797, 24.4637810,  8.5498797, 27.4731418,
-  8.5498797, 30.5673509,  8.5498797, 33.7419917,
-  8.5498797, 36.9931811,  8.5498797,      64.0f,
- 10.9027236,  0.0000000, 10.9027236,  1.0000000,
- 10.9027236,  2.5198421, 10.9027236,  4.3267487,
- 10.9027236,  6.3496042, 10.9027236,  8.5498797,
- 10.9027236, 10.9027236, 10.9027236, 13.3905183,
- 10.9027236, 16.0000000, 10.9027236, 18.7207544,
- 10.9027236, 21.5443469, 10.9027236, 24.4637810,
- 10.9027236, 27.4731418, 10.9027236, 30.5673509,
- 10.9027236, 33.7419917, 10.9027236, 36.9931811,
- 10.9027236,      64.0f, 13.3905183,  0.0000000,
- 13.3905183,  1.0000000, 13.3905183,  2.5198421,
- 13.3905183,  4.3267487, 13.3905183,  6.3496042,
- 13.3905183,  8.5498797, 13.3905183, 10.9027236,
- 13.3905183, 13.3905183, 13.3905183, 16.0000000,
- 13.3905183, 18.7207544, 13.3905183, 21.5443469,
- 13.3905183, 24.4637810, 13.3905183, 27.4731418,
- 13.3905183, 30.5673509, 13.3905183, 33.7419917,
- 13.3905183, 36.9931811, 13.3905183,      64.0f,
- 16.0000000,  0.0000000, 16.0000000,  1.0000000,
- 16.0000000,  2.5198421, 16.0000000,  4.3267487,
- 16.0000000,  6.3496042, 16.0000000,  8.5498797,
- 16.0000000, 10.9027236, 16.0000000, 13.3905183,
- 16.0000000, 16.0000000, 16.0000000, 18.7207544,
- 16.0000000, 21.5443469, 16.0000000, 24.4637810,
- 16.0000000, 27.4731418, 16.0000000, 30.5673509,
- 16.0000000, 33.7419917, 16.0000000, 36.9931811,
- 16.0000000,      64.0f, 18.7207544,  0.0000000,
- 18.7207544,  1.0000000, 18.7207544,  2.5198421,
- 18.7207544,  4.3267487, 18.7207544,  6.3496042,
- 18.7207544,  8.5498797, 18.7207544, 10.9027236,
- 18.7207544, 13.3905183, 18.7207544, 16.0000000,
- 18.7207544, 18.7207544, 18.7207544, 21.5443469,
- 18.7207544, 24.4637810, 18.7207544, 27.4731418,
- 18.7207544, 30.5673509, 18.7207544, 33.7419917,
- 18.7207544, 36.9931811, 18.7207544,      64.0f,
- 21.5443469,  0.0000000, 21.5443469,  1.0000000,
- 21.5443469,  2.5198421, 21.5443469,  4.3267487,
- 21.5443469,  6.3496042, 21.5443469,  8.5498797,
- 21.5443469, 10.9027236, 21.5443469, 13.3905183,
- 21.5443469, 16.0000000, 21.5443469, 18.7207544,
- 21.5443469, 21.5443469, 21.5443469, 24.4637810,
- 21.5443469, 27.4731418, 21.5443469, 30.5673509,
- 21.5443469, 33.7419917, 21.5443469, 36.9931811,
- 21.5443469,      64.0f, 24.4637810,  0.0000000,
- 24.4637810,  1.0000000, 24.4637810,  2.5198421,
- 24.4637810,  4.3267487, 24.4637810,  6.3496042,
- 24.4637810,  8.5498797, 24.4637810, 10.9027236,
- 24.4637810, 13.3905183, 24.4637810, 16.0000000,
- 24.4637810, 18.7207544, 24.4637810, 21.5443469,
- 24.4637810, 24.4637810, 24.4637810, 27.4731418,
- 24.4637810, 30.5673509, 24.4637810, 33.7419917,
- 24.4637810, 36.9931811, 24.4637810,      64.0f,
- 27.4731418,  0.0000000, 27.4731418,  1.0000000,
- 27.4731418,  2.5198421, 27.4731418,  4.3267487,
- 27.4731418,  6.3496042, 27.4731418,  8.5498797,
- 27.4731418, 10.9027236, 27.4731418, 13.3905183,
- 27.4731418, 16.0000000, 27.4731418, 18.7207544,
- 27.4731418, 21.5443469, 27.4731418, 24.4637810,
- 27.4731418, 27.4731418, 27.4731418, 30.5673509,
- 27.4731418, 33.7419917, 27.4731418, 36.9931811,
- 27.4731418,      64.0f, 30.5673509,  0.0000000,
- 30.5673509,  1.0000000, 30.5673509,  2.5198421,
- 30.5673509,  4.3267487, 30.5673509,  6.3496042,
- 30.5673509,  8.5498797, 30.5673509, 10.9027236,
- 30.5673509, 13.3905183, 30.5673509, 16.0000000,
- 30.5673509, 18.7207544, 30.5673509, 21.5443469,
- 30.5673509, 24.4637810, 30.5673509, 27.4731418,
- 30.5673509, 30.5673509, 30.5673509, 33.7419917,
- 30.5673509, 36.9931811, 30.5673509,      64.0f,
- 33.7419917,  0.0000000, 33.7419917,  1.0000000,
- 33.7419917,  2.5198421, 33.7419917,  4.3267487,
- 33.7419917,  6.3496042, 33.7419917,  8.5498797,
- 33.7419917, 10.9027236, 33.7419917, 13.3905183,
- 33.7419917, 16.0000000, 33.7419917, 18.7207544,
- 33.7419917, 21.5443469, 33.7419917, 24.4637810,
- 33.7419917, 27.4731418, 33.7419917, 30.5673509,
- 33.7419917, 33.7419917, 33.7419917, 36.9931811,
- 33.7419917,      64.0f, 36.9931811,  0.0000000,
- 36.9931811,  1.0000000, 36.9931811,  2.5198421,
- 36.9931811,  4.3267487, 36.9931811,  6.3496042,
- 36.9931811,  8.5498797, 36.9931811, 10.9027236,
- 36.9931811, 13.3905183, 36.9931811, 16.0000000,
- 36.9931811, 18.7207544, 36.9931811, 21.5443469,
- 36.9931811, 24.4637810, 36.9931811, 27.4731418,
- 36.9931811, 30.5673509, 36.9931811, 33.7419917,
- 36.9931811, 36.9931811, 36.9931811,      64.0f,
-      64.0f,  0.0000000,      64.0f,  1.0000000,
-      64.0f,  2.5198421,      64.0f,  4.3267487,
-      64.0f,  6.3496042,      64.0f,  8.5498797,
-      64.0f, 10.9027236,      64.0f, 13.3905183,
-      64.0f, 16.0000000,      64.0f, 18.7207544,
-      64.0f, 21.5443469,      64.0f, 24.4637810,
-      64.0f, 27.4731418,      64.0f, 30.5673509,
-      64.0f, 33.7419917,      64.0f, 36.9931811,
-      64.0f,      64.0f,
-};
-
-const float * const ff_aac_codebook_vectors[] = {
-    codebook_vector0, codebook_vector0, codebook_vector2,
-    codebook_vector2, codebook_vector4, codebook_vector4,
-    codebook_vector6, codebook_vector6, codebook_vector8,
-    codebook_vector8, codebook_vector10,
-};
-
-static const float codebook_vector0_vals[] = {
-   -1.0000000,  0.0000000,  1.0000000
-};
-
-/*
- * bits  0:1, 2:3, 4:5, 6:7  index into _vals array
- *       8:11                number of non-zero values
- *      12:15                bit mask of non-zero values
- */
-static const uint16_t codebook_vector02_idx[] = {
-    0x0000, 0x8140, 0x8180, 0x4110, 0xc250, 0xc290, 0x4120, 0xc260, 0xc2a0,
-    0x2104, 0xa244, 0xa284, 0x6214, 0xe354, 0xe394, 0x6224, 0xe364, 0xe3a4,
-    0x2108, 0xa248, 0xa288, 0x6218, 0xe358, 0xe398, 0x6228, 0xe368, 0xe3a8,
-    0x1101, 0x9241, 0x9281, 0x5211, 0xd351, 0xd391, 0x5221, 0xd361, 0xd3a1,
-    0x3205, 0xb345, 0xb385, 0x7315, 0xf455, 0xf495, 0x7325, 0xf465, 0xf4a5,
-    0x3209, 0xb349, 0xb389, 0x7319, 0xf459, 0xf499, 0x7329, 0xf469, 0xf4a9,
-    0x1102, 0x9242, 0x9282, 0x5212, 0xd352, 0xd392, 0x5222, 0xd362, 0xd3a2,
-    0x3206, 0xb346, 0xb386, 0x7316, 0xf456, 0xf496, 0x7326, 0xf466, 0xf4a6,
-    0x320a, 0xb34a, 0xb38a, 0x731a, 0xf45a, 0xf49a, 0x732a, 0xf46a, 0xf4aa,
-};
-
-static const float codebook_vector4_vals[] = {
-   -6.3496042, -4.3267487,
-   -2.5198421, -1.0000000,
-    0.0000000,  1.0000000,
-    2.5198421,  4.3267487,
-    6.3496042,
-};
-
-/*
- * bits  0:3, 4:7  index into _vals array
- */
-static const uint16_t codebook_vector4_idx[] = {
-    0x0000, 0x0010, 0x0020, 0x0030, 0x0040, 0x0050, 0x0060, 0x0070, 0x0080,
-    0x0001, 0x0011, 0x0021, 0x0031, 0x0041, 0x0051, 0x0061, 0x0071, 0x0081,
-    0x0002, 0x0012, 0x0022, 0x0032, 0x0042, 0x0052, 0x0062, 0x0072, 0x0082,
-    0x0003, 0x0013, 0x0023, 0x0033, 0x0043, 0x0053, 0x0063, 0x0073, 0x0083,
-    0x0004, 0x0014, 0x0024, 0x0034, 0x0044, 0x0054, 0x0064, 0x0074, 0x0084,
-    0x0005, 0x0015, 0x0025, 0x0035, 0x0045, 0x0055, 0x0065, 0x0075, 0x0085,
-    0x0006, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0076, 0x0086,
-    0x0007, 0x0017, 0x0027, 0x0037, 0x0047, 0x0057, 0x0067, 0x0077, 0x0087,
-    0x0008, 0x0018, 0x0028, 0x0038, 0x0048, 0x0058, 0x0068, 0x0078, 0x0088,
-};
-
-/*
- * bits  0:3, 4:7  index into _vals array
- *       8:11      number of non-zero values
- *      12:15      1: only second value non-zero
- *                 0: other cases
- */
-static const uint16_t codebook_vector6_idx[] = {
-    0x0000, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170,
-    0x1101, 0x0211, 0x0221, 0x0231, 0x0241, 0x0251, 0x0261, 0x0271,
-    0x1102, 0x0212, 0x0222, 0x0232, 0x0242, 0x0252, 0x0262, 0x0272,
-    0x1103, 0x0213, 0x0223, 0x0233, 0x0243, 0x0253, 0x0263, 0x0273,
-    0x1104, 0x0214, 0x0224, 0x0234, 0x0244, 0x0254, 0x0264, 0x0274,
-    0x1105, 0x0215, 0x0225, 0x0235, 0x0245, 0x0255, 0x0265, 0x0275,
-    0x1106, 0x0216, 0x0226, 0x0236, 0x0246, 0x0256, 0x0266, 0x0276,
-    0x1107, 0x0217, 0x0227, 0x0237, 0x0247, 0x0257, 0x0267, 0x0277,
-};
-
-/*
- * bits  0:3, 4:7  index into _vals array
- *       8:11      number of non-zero values
- *      12:15      1: only second value non-zero
- *                 0: other cases
- */
-static const uint16_t codebook_vector8_idx[] = {
-  0x0000, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160,
-  0x0170, 0x0180, 0x0190, 0x01a0, 0x01b0, 0x01c0,
-  0x1101, 0x0211, 0x0221, 0x0231, 0x0241, 0x0251, 0x0261,
-  0x0271, 0x0281, 0x0291, 0x02a1, 0x02b1, 0x02c1,
-  0x1102, 0x0212, 0x0222, 0x0232, 0x0242, 0x0252, 0x0262,
-  0x0272, 0x0282, 0x0292, 0x02a2, 0x02b2, 0x02c2,
-  0x1103, 0x0213, 0x0223, 0x0233, 0x0243, 0x0253, 0x0263,
-  0x0273, 0x0283, 0x0293, 0x02a3, 0x02b3, 0x02c3,
-  0x1104, 0x0214, 0x0224, 0x0234, 0x0244, 0x0254, 0x0264,
-  0x0274, 0x0284, 0x0294, 0x02a4, 0x02b4, 0x02c4,
-  0x1105, 0x0215, 0x0225, 0x0235, 0x0245, 0x0255, 0x0265,
-  0x0275, 0x0285, 0x0295, 0x02a5, 0x02b5, 0x02c5,
-  0x1106, 0x0216, 0x0226, 0x0236, 0x0246, 0x0256, 0x0266,
-  0x0276, 0x0286, 0x0296, 0x02a6, 0x02b6, 0x02c6,
-  0x1107, 0x0217, 0x0227, 0x0237, 0x0247, 0x0257, 0x0267,
-  0x0277, 0x0287, 0x0297, 0x02a7, 0x02b7, 0x02c7,
-  0x1108, 0x0218, 0x0228, 0x0238, 0x0248, 0x0258, 0x0268,
-  0x0278, 0x0288, 0x0298, 0x02a8, 0x02b8, 0x02c8,
-  0x1109, 0x0219, 0x0229, 0x0239, 0x0249, 0x0259, 0x0269,
-  0x0279, 0x0289, 0x0299, 0x02a9, 0x02b9, 0x02c9,
-  0x110a, 0x021a, 0x022a, 0x023a, 0x024a, 0x025a, 0x026a,
-  0x027a, 0x028a, 0x029a, 0x02aa, 0x02ba, 0x02ca,
-  0x110b, 0x021b, 0x022b, 0x023b, 0x024b, 0x025b, 0x026b,
-  0x027b, 0x028b, 0x029b, 0x02ab, 0x02bb, 0x02cb,
-  0x110c, 0x021c, 0x022c, 0x023c, 0x024c, 0x025c, 0x026c,
-  0x027c, 0x028c, 0x029c, 0x02ac, 0x02bc, 0x02cc,
-};
-
-static const float codebook_vector10_vals[] = {
-     0.0000000,  1.0000000,
-     2.5198421,  4.3267487,
-     6.3496042,  8.5498797,
-    10.9027236, 13.3905183,
-    16.0000000, 18.7207544,
-    21.5443469, 24.4637810,
-    27.4731418, 30.5673509,
-    33.7419917, 36.9931811,
-};
-
-/*
- * bits  0:3, 4:7  index into _vals array
- *       8:9       bit mask of escape-coded entries
- *      12:15      number of non-zero values
- */
-static const uint16_t codebook_vector10_idx[] = {
-    0x0000, 0x1010, 0x1020, 0x1030, 0x1040, 0x1050, 0x1060, 0x1070,
-    0x1080, 0x1090, 0x10a0, 0x10b0, 0x10c0, 0x10d0, 0x10e0, 0x10f0, 0x1200,
-    0x1001, 0x2011, 0x2021, 0x2031, 0x2041, 0x2051, 0x2061, 0x2071,
-    0x2081, 0x2091, 0x20a1, 0x20b1, 0x20c1, 0x20d1, 0x20e1, 0x20f1, 0x2201,
-    0x1002, 0x2012, 0x2022, 0x2032, 0x2042, 0x2052, 0x2062, 0x2072,
-    0x2082, 0x2092, 0x20a2, 0x20b2, 0x20c2, 0x20d2, 0x20e2, 0x20f2, 0x2202,
-    0x1003, 0x2013, 0x2023, 0x2033, 0x2043, 0x2053, 0x2063, 0x2073,
-    0x2083, 0x2093, 0x20a3, 0x20b3, 0x20c3, 0x20d3, 0x20e3, 0x20f3, 0x2203,
-    0x1004, 0x2014, 0x2024, 0x2034, 0x2044, 0x2054, 0x2064, 0x2074,
-    0x2084, 0x2094, 0x20a4, 0x20b4, 0x20c4, 0x20d4, 0x20e4, 0x20f4, 0x2204,
-    0x1005, 0x2015, 0x2025, 0x2035, 0x2045, 0x2055, 0x2065, 0x2075,
-    0x2085, 0x2095, 0x20a5, 0x20b5, 0x20c5, 0x20d5, 0x20e5, 0x20f5, 0x2205,
-    0x1006, 0x2016, 0x2026, 0x2036, 0x2046, 0x2056, 0x2066, 0x2076,
-    0x2086, 0x2096, 0x20a6, 0x20b6, 0x20c6, 0x20d6, 0x20e6, 0x20f6, 0x2206,
-    0x1007, 0x2017, 0x2027, 0x2037, 0x2047, 0x2057, 0x2067, 0x2077,
-    0x2087, 0x2097, 0x20a7, 0x20b7, 0x20c7, 0x20d7, 0x20e7, 0x20f7, 0x2207,
-    0x1008, 0x2018, 0x2028, 0x2038, 0x2048, 0x2058, 0x2068, 0x2078,
-    0x2088, 0x2098, 0x20a8, 0x20b8, 0x20c8, 0x20d8, 0x20e8, 0x20f8, 0x2208,
-    0x1009, 0x2019, 0x2029, 0x2039, 0x2049, 0x2059, 0x2069, 0x2079,
-    0x2089, 0x2099, 0x20a9, 0x20b9, 0x20c9, 0x20d9, 0x20e9, 0x20f9, 0x2209,
-    0x100a, 0x201a, 0x202a, 0x203a, 0x204a, 0x205a, 0x206a, 0x207a,
-    0x208a, 0x209a, 0x20aa, 0x20ba, 0x20ca, 0x20da, 0x20ea, 0x20fa, 0x220a,
-    0x100b, 0x201b, 0x202b, 0x203b, 0x204b, 0x205b, 0x206b, 0x207b,
-    0x208b, 0x209b, 0x20ab, 0x20bb, 0x20cb, 0x20db, 0x20eb, 0x20fb, 0x220b,
-    0x100c, 0x201c, 0x202c, 0x203c, 0x204c, 0x205c, 0x206c, 0x207c,
-    0x208c, 0x209c, 0x20ac, 0x20bc, 0x20cc, 0x20dc, 0x20ec, 0x20fc, 0x220c,
-    0x100d, 0x201d, 0x202d, 0x203d, 0x204d, 0x205d, 0x206d, 0x207d,
-    0x208d, 0x209d, 0x20ad, 0x20bd, 0x20cd, 0x20dd, 0x20ed, 0x20fd, 0x220d,
-    0x100e, 0x201e, 0x202e, 0x203e, 0x204e, 0x205e, 0x206e, 0x207e,
-    0x208e, 0x209e, 0x20ae, 0x20be, 0x20ce, 0x20de, 0x20ee, 0x20fe, 0x220e,
-    0x100f, 0x201f, 0x202f, 0x203f, 0x204f, 0x205f, 0x206f, 0x207f,
-    0x208f, 0x209f, 0x20af, 0x20bf, 0x20cf, 0x20df, 0x20ef, 0x20ff, 0x220f,
-    0x1100, 0x2110, 0x2120, 0x2130, 0x2140, 0x2150, 0x2160, 0x2170,
-    0x2180, 0x2190, 0x21a0, 0x21b0, 0x21c0, 0x21d0, 0x21e0, 0x21f0, 0x2300,
-};
-
-const float *const ff_aac_codebook_vector_vals[] = {
-    codebook_vector0_vals,  codebook_vector0_vals,
-    codebook_vector10_vals, codebook_vector10_vals,
-    codebook_vector4_vals,  codebook_vector4_vals,
-    codebook_vector10_vals, codebook_vector10_vals,
-    codebook_vector10_vals, codebook_vector10_vals,
-    codebook_vector10_vals,
-};
-
-const uint16_t *const ff_aac_codebook_vector_idx[] = {
-    codebook_vector02_idx, codebook_vector02_idx,
-    codebook_vector02_idx, codebook_vector02_idx,
-    codebook_vector4_idx,  codebook_vector4_idx,
-    codebook_vector6_idx,  codebook_vector6_idx,
-    codebook_vector8_idx,  codebook_vector8_idx,
-    codebook_vector10_idx,
-};
-
-/* @name swb_offsets
- * Sample offset into the window indicating the beginning of a scalefactor
- * window band
- *
- * scalefactor window band - term for scalefactor bands within a window,
- * given in Table 4.110 to Table 4.128.
- *
- * scalefactor band - a set of spectral coefficients which are scaled by one
- * scalefactor. In case of EIGHT_SHORT_SEQUENCE and grouping a scalefactor band
- * may contain several scalefactor window bands of corresponding frequency. For
- * all other window_sequences scalefactor bands and scalefactor window bands are
- * identical.
- * @{
- */
-
-static const uint16_t swb_offset_1024_96[] = {
-      0,   4,   8,  12,  16,  20,  24,  28,
-     32,  36,  40,  44,  48,  52,  56,  64,
-     72,  80,  88,  96, 108, 120, 132, 144,
-    156, 172, 188, 212, 240, 276, 320, 384,
-    448, 512, 576, 640, 704, 768, 832, 896,
-    960, 1024
-};
-
-static const uint16_t swb_offset_128_96[] = {
-    0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128
-};
-
-static const uint16_t swb_offset_1024_64[] = {
-      0,   4,   8,  12,  16,  20,  24,  28,
-     32,  36,  40,  44,  48,  52,  56,  64,
-     72,  80,  88, 100, 112, 124, 140, 156,
-    172, 192, 216, 240, 268, 304, 344, 384,
-    424, 464, 504, 544, 584, 624, 664, 704,
-    744, 784, 824, 864, 904, 944, 984, 1024
-};
-
-static const uint16_t swb_offset_1024_48[] = {
-      0,   4,   8,  12,  16,  20,  24,  28,
-     32,  36,  40,  48,  56,  64,  72,  80,
-     88,  96, 108, 120, 132, 144, 160, 176,
-    196, 216, 240, 264, 292, 320, 352, 384,
-    416, 448, 480, 512, 544, 576, 608, 640,
-    672, 704, 736, 768, 800, 832, 864, 896,
-    928, 1024
-};
-
-static const uint16_t swb_offset_512_48[] = {
-      0,   4,   8,  12,  16,  20,  24,  28,
-     32,  36,  40,  44,  48,  52,  56,  60,
-     68,  76,  84,  92, 100, 112, 124, 136,
-    148, 164, 184, 208, 236, 268, 300, 332,
-    364, 396, 428, 460, 512
-};
-
-static const uint16_t swb_offset_128_48[] = {
-     0,   4,   8,  12,  16,  20,  28,  36,
-    44,  56,  68,  80,  96, 112, 128
-};
-
-static const uint16_t swb_offset_1024_32[] = {
-      0,   4,   8,  12,  16,  20,  24,  28,
-     32,  36,  40,  48,  56,  64,  72,  80,
-     88,  96, 108, 120, 132, 144, 160, 176,
-    196, 216, 240, 264, 292, 320, 352, 384,
-    416, 448, 480, 512, 544, 576, 608, 640,
-    672, 704, 736, 768, 800, 832, 864, 896,
-    928, 960, 992, 1024
-};
-
-static const uint16_t swb_offset_512_32[] = {
-      0,   4,   8,  12,  16,  20,  24,  28,
-     32,  36,  40,  44,  48,  52,  56,  64,
-     72,  80,  88,  96, 108, 120, 132, 144,
-    160, 176, 192, 212, 236, 260, 288, 320,
-    352, 384, 416, 448, 480, 512
-};
-
-static const uint16_t swb_offset_1024_24[] = {
-      0,   4,   8,  12,  16,  20,  24,  28,
-     32,  36,  40,  44,  52,  60,  68,  76,
-     84,  92, 100, 108, 116, 124, 136, 148,
-    160, 172, 188, 204, 220, 240, 260, 284,
-    308, 336, 364, 396, 432, 468, 508, 552,
-    600, 652, 704, 768, 832, 896, 960, 1024
-};
-
-static const uint16_t swb_offset_512_24[] = {
-      0,   4,   8,  12,  16,  20,  24,  28,
-     32,  36,  40,  44,  52,  60,  68,  80,
-     92, 104, 120, 140, 164, 192, 224, 256,
-    288, 320, 352, 384, 416, 448, 480, 512,
-};
-
-static const uint16_t swb_offset_128_24[] = {
-     0,   4,   8,  12,  16,  20,  24,  28,
-    36,  44,  52,  64,  76,  92, 108, 128
-};
-
-static const uint16_t swb_offset_1024_16[] = {
-      0,   8,  16,  24,  32,  40,  48,  56,
-     64,  72,  80,  88, 100, 112, 124, 136,
-    148, 160, 172, 184, 196, 212, 228, 244,
-    260, 280, 300, 320, 344, 368, 396, 424,
-    456, 492, 532, 572, 616, 664, 716, 772,
-    832, 896, 960, 1024
-};
-
-static const uint16_t swb_offset_128_16[] = {
-     0,   4,   8,  12,  16,  20,  24,  28,
-    32,  40,  48,  60,  72,  88, 108, 128
-};
-
-static const uint16_t swb_offset_1024_8[] = {
-      0,  12,  24,  36,  48,  60,  72,  84,
-     96, 108, 120, 132, 144, 156, 172, 188,
-    204, 220, 236, 252, 268, 288, 308, 328,
-    348, 372, 396, 420, 448, 476, 508, 544,
-    580, 620, 664, 712, 764, 820, 880, 944,
-    1024
-};
-
-static const uint16_t swb_offset_128_8[] = {
-     0,   4,   8,  12,  16,  20,  24,  28,
-    36,  44,  52,  60,  72,  88, 108, 128
-};
-
-const uint16_t * const ff_swb_offset_1024[] = {
-    swb_offset_1024_96, swb_offset_1024_96, swb_offset_1024_64,
-    swb_offset_1024_48, swb_offset_1024_48, swb_offset_1024_32,
-    swb_offset_1024_24, swb_offset_1024_24, swb_offset_1024_16,
-    swb_offset_1024_16, swb_offset_1024_16, swb_offset_1024_8,
-    swb_offset_1024_8
-};
-
-const uint16_t * const ff_swb_offset_512[] = {
-    NULL,               NULL,               NULL,
-    swb_offset_512_48,  swb_offset_512_48,  swb_offset_512_32,
-    swb_offset_512_24,  swb_offset_512_24,  NULL,
-    NULL,               NULL,               NULL,
-    NULL
-};
-
-const uint16_t * const ff_swb_offset_128[] = {
-    /* The last entry on the following row is swb_offset_128_64 but is a
-       duplicate of swb_offset_128_96. */
-    swb_offset_128_96, swb_offset_128_96, swb_offset_128_96,
-    swb_offset_128_48, swb_offset_128_48, swb_offset_128_48,
-    swb_offset_128_24, swb_offset_128_24, swb_offset_128_16,
-    swb_offset_128_16, swb_offset_128_16, swb_offset_128_8,
-    swb_offset_128_8
-};
-
-// @}
-
-/* @name ff_tns_max_bands
- * The maximum number of scalefactor bands on which TNS can operate for the long
- * and short transforms respectively. The index to these tables is related to
- * the sample rate of the audio.
- * @{
- */
-const uint8_t ff_tns_max_bands_1024[] = {
-    31, 31, 34, 40, 42, 51, 46, 46, 42, 42, 42, 39, 39
-};
-
-const uint8_t ff_tns_max_bands_512[] = {
-    0, 0, 0, 31, 32, 37, 31, 31, 0, 0, 0, 0, 0
-};
-
-const uint8_t ff_tns_max_bands_128[] = {
-    9, 9, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14
-};
-// @}
-
-const DECLARE_ALIGNED(32, float, ff_aac_eld_window)[1920] = {
-     0.00338834,  0.00567745,  0.00847677,  0.01172641,
-     0.01532555,  0.01917664,  0.02318809,  0.02729259,
-     0.03144503,  0.03560261,  0.03972499,  0.04379783,
-     0.04783094,  0.05183357,  0.05581342,  0.05977723,
-     0.06373173,  0.06768364,  0.07163937,  0.07559976,
-     0.07956096,  0.08352024,  0.08747623,  0.09143035,
-     0.09538618,  0.09934771,  0.10331917,  0.10730456,
-     0.11130697,  0.11532867,  0.11937133,  0.12343922,
-     0.12753911,  0.13167705,  0.13585812,  0.14008529,
-     0.14435986,  0.14868291,  0.15305531,  0.15747594,
-     0.16194193,  0.16645070,  0.17099991,  0.17558633,
-     0.18020600,  0.18485548,  0.18953191,  0.19423322,
-     0.19895800,  0.20370512,  0.20847374,  0.21326312,
-     0.21807244,  0.22290083,  0.22774742,  0.23261210,
-     0.23749542,  0.24239767,  0.24731889,  0.25225887,
-     0.25721719,  0.26219330,  0.26718648,  0.27219630,
-     0.27722262,  0.28226514,  0.28732336,  0.29239628,
-     0.29748247,  0.30258055,  0.30768914,  0.31280508,
-     0.31792385,  0.32304172,  0.32815579,  0.33326397,
-     0.33836470,  0.34345661,  0.34853868,  0.35361188,
-     0.35867865,  0.36374072,  0.36879900,  0.37385347,
-     0.37890349,  0.38394836,  0.38898730,  0.39401912,
-     0.39904236,  0.40405575,  0.40905820,  0.41404819,
-     0.41902398,  0.42398423,  0.42892805,  0.43385441,
-     0.43876210,  0.44365014,  0.44851786,  0.45336632,
-     0.45819759,  0.46301302,  0.46781309,  0.47259722,
-     0.47736435,  0.48211365,  0.48684450,  0.49155594,
-     0.49624679,  0.50091636,  0.50556440,  0.51019132,
-     0.51479771,  0.51938391,  0.52394998,  0.52849587,
-     0.53302151,  0.53752680,  0.54201160,  0.54647575,
-     0.55091916,  0.55534181,  0.55974376,  0.56412513,
-     0.56848615,  0.57282710,  0.57714834,  0.58145030,
-     0.58492489,  0.58918511,  0.59342326,  0.59763936,
-     0.60183347,  0.60600561,  0.61015581,  0.61428412,
-     0.61839056,  0.62247517,  0.62653799,  0.63057912,
-     0.63459872,  0.63859697,  0.64257403,  0.64653001,
-     0.65046495,  0.65437887,  0.65827181,  0.66214383,
-     0.66599499,  0.66982535,  0.67363499,  0.67742394,
-     0.68119219,  0.68493972,  0.68866653,  0.69237258,
-     0.69605778,  0.69972207,  0.70336537,  0.70698758,
-     0.71058862,  0.71416837,  0.71772674,  0.72126361,
-     0.72477889,  0.72827246,  0.73174419,  0.73519392,
-     0.73862141,  0.74202643,  0.74540874,  0.74876817,
-     0.75210458,  0.75541785,  0.75870785,  0.76197437,
-     0.76521709,  0.76843570,  0.77162988,  0.77479939,
-     0.77794403,  0.78106359,  0.78415789,  0.78722670,
-     0.79026979,  0.79328694,  0.79627791,  0.79924244,
-     0.80218027,  0.80509112,  0.80797472,  0.81083081,
-     0.81365915,  0.81645949,  0.81923160,  0.82197528,
-     0.82469037,  0.82737673,  0.83003419,  0.83266262,
-     0.83526186,  0.83783176,  0.84037217,  0.84288297,
-     0.84536401,  0.84781517,  0.85023632,  0.85262739,
-     0.85498836,  0.85731921,  0.85961993,  0.86189052,
-     0.86413101,  0.86634140,  0.86852173,  0.87067211,
-     0.87279275,  0.87488384,  0.87694559,  0.87897824,
-     0.88098206,  0.88295729,  0.88490423,  0.88682332,
-     0.88871519,  0.89058048,  0.89241983,  0.89423391,
-     0.89602338,  0.89778893,  0.89953126,  0.90125142,
-     0.90295086,  0.90463104,  0.90629341,  0.90793946,
-     0.90957067,  0.91118856,  0.91279464,  0.91439073,
-     0.91597898,  0.91756153,  0.91914049,  0.92071690,
-     0.92229070,  0.92386182,  0.92542993,  0.92698946,
-     0.92852960,  0.93003929,  0.93150727,  0.93291739,
-     0.93424863,  0.93547974,  0.93658982,  0.93756587,
-     0.93894072,  0.93922780,  0.93955477,  0.93991290,
-     0.94029104,  0.94067794,  0.94106258,  0.94144084,
-     0.94181549,  0.94218963,  0.94256628,  0.94294662,
-     0.94332998,  0.94371562,  0.94410280,  0.94449122,
-     0.94488106,  0.94527249,  0.94566568,  0.94606074,
-     0.94645772,  0.94685665,  0.94725759,  0.94766054,
-     0.94806547,  0.94847234,  0.94888115,  0.94929190,
-     0.94970469,  0.95011960,  0.95053672,  0.95095604,
-     0.95137751,  0.95180105,  0.95222658,  0.95265413,
-     0.95308380,  0.95351571,  0.95394994,  0.95438653,
-     0.95482538,  0.95526643,  0.95570958,  0.95615486,
-     0.95660234,  0.95705214,  0.95750433,  0.95795892,
-     0.95841582,  0.95887493,  0.95933616,  0.95979949,
-     0.96026500,  0.96073277,  0.96120286,  0.96167526,
-     0.96214986,  0.96262655,  0.96310522,  0.96358586,
-     0.96406853,  0.96455330,  0.96504026,  0.96552936,
-     0.96602051,  0.96651360,  0.96700850,  0.96750520,
-     0.96800376,  0.96850424,  0.96900670,  0.96951112,
-     0.97001738,  0.97052533,  0.97103488,  0.97154597,
-     0.97205867,  0.97257304,  0.97308915,  0.97360694,
-     0.97412631,  0.97464711,  0.97516923,  0.97569262,
-     0.97621735,  0.97674350,  0.97727111,  0.97780016,
-     0.97833051,  0.97886205,  0.97939463,  0.97992823,
-     0.98046291,  0.98099875,  0.98153580,  0.98207405,
-     0.98261337,  0.98315364,  0.98369474,  0.98423664,
-     0.98477941,  0.98532311,  0.98586780,  0.98641348,
-     0.98696003,  0.98750734,  0.98805530,  0.98860389,
-     0.98915320,  0.98970328,  0.99025423,  0.99080602,
-     0.99135855,  0.99191171,  0.99246541,  0.99301962,
-     0.99357443,  0.99412992,  0.99468617,  0.99524320,
-     0.99580092,  0.99635926,  0.99691814,  0.99747748,
-     0.99803721,  0.99859725,  0.99915752,  0.99971793,
-     1.00028215,  1.00084319,  1.00140472,  1.00196665,
-     1.00252889,  1.00309139,  1.00365404,  1.00421679,
-     1.00477954,  1.00534221,  1.00590474,  1.00646713,
-     1.00702945,  1.00759179,  1.00815424,  1.00871678,
-     1.00927930,  1.00984169,  1.01040384,  1.01096575,
-     1.01152747,  1.01208910,  1.01265070,  1.01321226,
-     1.01377365,  1.01433478,  1.01489551,  1.01545584,
-     1.01601582,  1.01657553,  1.01713502,  1.01769427,
-     1.01825316,  1.01881154,  1.01936929,  1.01992639,
-     1.02048289,  1.02103888,  1.02159441,  1.02214945,
-     1.02270387,  1.02325751,  1.02381025,  1.02436204,
-     1.02491295,  1.02546304,  1.02601238,  1.02656092,
-     1.02710853,  1.02765508,  1.02820041,  1.02874449,
-     1.02928737,  1.02982913,  1.03036981,  1.03090937,
-     1.03144768,  1.03198460,  1.03252000,  1.03305384,
-     1.03358617,  1.03411707,  1.03464659,  1.03517470,
-     1.03570128,  1.03622620,  1.03674934,  1.03727066,
-     1.03779024,  1.03830815,  1.03882446,  1.03933914,
-     1.03985206,  1.04036312,  1.04087217,  1.04137920,
-     1.04188428,  1.04238748,  1.04288888,  1.04338845,
-     1.04388610,  1.04438170,  1.04487515,  1.04536645,
-     1.04585569,  1.04634297,  1.04682838,  1.04731192,
-     1.04779350,  1.04827303,  1.04875042,  1.04922568,
-     1.04969891,  1.05017022,  1.05063974,  1.05110746,
-     1.05157332,  1.05203721,  1.05249907,  1.05295889,
-     1.05341676,  1.05387277,  1.05432700,  1.05477948,
-     1.05523018,  1.05567906,  1.05612608,  1.05657124,
-     1.05701459,  1.05745616,  1.05789601,  1.05833426,
-     1.05877109,  1.05920669,  1.05964125,  1.06007444,
-     1.06050542,  1.06093335,  1.06135746,  1.06177909,
-     1.06220164,  1.06262858,  1.06306309,  1.06350050,
-     1.06392837,  1.06433391,  1.06470443,  1.06502996,
-     1.06481076,  1.06469765,  1.06445004,  1.06408002,
-     1.06361382,  1.06307719,  1.06249453,  1.06188365,
-     1.06125612,  1.06062291,  1.05999418,  1.05937132,
-     1.05874726,  1.05811486,  1.05746728,  1.05680000,
-     1.05611070,  1.05539715,  1.05465735,  1.05389329,
-     1.05311083,  1.05231578,  1.05151372,  1.05070811,
-     1.04990044,  1.04909210,  1.04828434,  1.04747647,
-     1.04666590,  1.04585003,  1.04502628,  1.04419009,
-     1.04333499,  1.04245452,  1.04154244,  1.04059452,
-     1.03960846,  1.03858207,  1.03751326,  1.03640189,
-     1.03524976,  1.03405868,  1.03283047,  1.03156812,
-     1.03027574,  1.02895743,  1.02761717,  1.02625804,
-     1.02488222,  1.02349184,  1.02208892,  1.02067450,
-     1.01924861,  1.01781123,  1.01636229,  1.01490045,
-     1.01342315,  1.01192778,  1.01041175,  1.00887284,
-     1.00730915,  1.00571882,  1.00409996,  1.00245032,
-     1.00076734,  0.99904842,  0.99729101,  0.99549380,
-     0.99365664,  0.99177946,  0.98986234,  0.98791024,
-     0.98593294,  0.98394037,  0.98194226,  0.97994532,
-     0.97795324,  0.97596955,  0.97399748,  0.97203326,
-     0.97006624,  0.96808546,  0.96608018,  0.96404416,
-     0.96197556,  0.95987276,  0.95773420,  0.95556018,
-     0.95335291,  0.95111462,  0.94884764,  0.94655663,
-     0.94424858,  0.94193055,  0.93960953,  0.93729154,
-     0.93498157,  0.93268456,  0.93040503,  0.92813771,
-     0.92586755,  0.92357910,  0.92125731,  0.91889642,
-     0.91649998,  0.91407191,  0.91161623,  0.90913975,
-     0.90665202,  0.90416271,  0.90168115,  0.89920934,
-     0.89674189,  0.89427312,  0.89179743,  0.88931147,
-     0.88681415,  0.88430445,  0.88178141,  0.87924528,
-     0.87669753,  0.87413966,  0.87157318,  0.86899958,
-     0.86642037,  0.86383703,  0.86125106,  0.85866393,
-     0.85604236,  0.85344385,  0.85083093,  0.84820550,
-     0.84556943,  0.84292458,  0.84027278,  0.83761586,
-     0.83495565,  0.83229393,  0.82963243,  0.82697135,
-     0.82430933,  0.82164496,  0.81897669,  0.81630017,
-     0.81360822,  0.81089355,  0.80814924,  0.80537741,
-     0.80258920,  0.79979611,  0.79700954,  0.79423813,
-     0.79148780,  0.78876432,  0.78607290,  0.78340590,
-     0.78074288,  0.77806279,  0.77534514,  0.77258187,
-     0.76977737,  0.76693654,  0.76406441,  0.76116851,
-     0.75825892,  0.75534582,  0.75243924,  0.74954634,
-     0.74667135,  0.74381840,  0.74099145,  0.73819147,
-     0.73541641,  0.73266408,  0.72993193,  0.72720913,
-     0.72447661,  0.72171494,  0.71890515,  0.71603932,
-     0.71312056,  0.71015250,  0.70713900,  0.70409084,
-     0.70102565,  0.69796137,  0.69491556,  0.69189772,
-     0.68890931,  0.68595141,  0.68302498,  0.68012852,
-     0.67725801,  0.67440936,  0.67157841,  0.66876081,
-     0.66595195,  0.66314722,  0.66034194,  0.65753027,
-     0.65470525,  0.65185984,  0.64898709,  0.64608214,
-     0.64314221,  0.64016460,  0.63714680,  0.63409034,
-     0.63100082,  0.62788400,  0.62474577,  0.62159473,
-     0.61844225,  0.61529977,  0.61217866,  0.60908811,
-     0.60603510,  0.60302654,  0.60006916,  0.59716588,
-     0.59431580,  0.59151787,  0.58877068,  0.58606495,
-     0.58338353,  0.58070891,  0.57802356,  0.57530864,
-     0.57254404,  0.56970958,  0.56678577,  0.56376860,
-     0.56066951,  0.55750064,  0.55427451,  0.55101301,
-     0.54774732,  0.54450907,  0.54132936,  0.53822744,
-     0.53521072,  0.53228613,  0.52945979,  0.52671997,
-     0.52403708,  0.52138072,  0.51872085,  0.51603570,
-     0.51331170,  0.51053560,  0.50769466,  0.50478931,
-     0.50183308,  0.49884001,  0.49582406,  0.49279905,
-     0.48985748,  0.48679641,  0.48379429,  0.48085363,
-     0.47796576,  0.47512151,  0.47231151,  0.46952402,
-     0.46674486,  0.46395978,  0.46115496,  0.45832607,
-     0.45547830,  0.45261727,  0.44974866,  0.44688011,
-     0.44402125,  0.44118178,  0.43837094,  0.43558772,
-     0.43282082,  0.43005847,  0.42728913,  0.42450572,
-     0.42170567,  0.41888658,  0.41604633,  0.41318897,
-     0.41032472,  0.40746405,  0.40461724,  0.40178943,
-     0.39898066,  0.39619073,  0.39341940,  0.39066519,
-     0.38792536,  0.38519713,  0.38247773,  0.37976476,
-     0.37705620,  0.37435006,  0.37164438,  0.36893869,
-     0.36623396,  0.36353124,  0.36083153,  0.35813533,
-     0.35544262,  0.35275338,  0.35006755,  0.34738530,
-     0.34470699,  0.34203296,  0.33936359,  0.33669922,
-     0.33404027,  0.33138711,  0.32874013,  0.32609944,
-     0.32346493,  0.32083645,  0.31821388,  0.31559703,
-     0.31298573,  0.31037987,  0.30777941,  0.30518446,
-     0.30259525,  0.30001202,  0.29743499,  0.29486428,
-     0.29229989,  0.28974179,  0.28718997,  0.28464452,
-     0.28210562,  0.27957346,  0.27704820,  0.27452992,
-     0.27201854,  0.26951399,  0.26701622,  0.26452533,
-     0.26204158,  0.25956526,  0.25709662,  0.25463583,
-     0.25218294,  0.24973798,  0.24730100,  0.24487207,
-     0.24245133,  0.24003893,  0.23763500,  0.23523959,
-     0.23285262,  0.23047401,  0.22810369,  0.22574170,
-     0.22338818,  0.22104329,  0.21870719,  0.21637986,
-     0.21406117,  0.21175095,  0.20944904,  0.20715535,
-     0.20486987,  0.20259261,  0.20032356,  0.19806259,
-     0.19580944,  0.19356385,  0.19132556,  0.18909442,
-     0.18687040,  0.18465350,  0.18244372,  0.18024164,
-     0.17804841,  0.17586521,  0.17369322,  0.17153360,
-     0.16938755,  0.16725622,  0.16514081,  0.16304247,
-     0.16098974,  0.15896561,  0.15696026,  0.15497259,
-     0.15300151,  0.15104590,  0.14910466,  0.14717666,
-     0.14526081,  0.14335599,  0.14146111,  0.13957570,
-     0.13769993,  0.13583399,  0.13397806,  0.13213229,
-     0.13029682,  0.12847178,  0.12665729,  0.12485353,
-     0.12306074,  0.12127916,  0.11950900,  0.11775043,
-     0.11600347,  0.11426820,  0.11254464,  0.11083292,
-     0.10913318,  0.10744559,  0.10577028,  0.10410733,
-     0.10245672,  0.10081842,  0.09919240,  0.09757872,
-     0.09597750,  0.09438884,  0.09281288,  0.09124964,
-     0.08969907,  0.08816111,  0.08663570,  0.08512288,
-     0.08362274,  0.08213540,  0.08066096,  0.07919944,
-     0.07775076,  0.07631484,  0.07489161,  0.07348108,
-     0.07208335,  0.07069851,  0.06932666,  0.06796781,
-     0.06662187,  0.06528874,  0.06396833,  0.06266065,
-     0.06136578,  0.06008380,  0.05881480,  0.05755876,
-     0.05631557,  0.05508511,  0.05386728,  0.05266206,
-     0.05146951,  0.05028971,  0.04912272,  0.04796855,
-     0.04682709,  0.04569825,  0.04458194,  0.04347817,
-     0.04238704,  0.04130868,  0.04024318,  0.03919056,
-     0.03815071,  0.03712352,  0.03610890,  0.03510679,
-     0.03411720,  0.03314013,  0.03217560,  0.03122343,
-     0.03028332,  0.02935494,  0.02843799,  0.02753230,
-     0.02663788,  0.02575472,  0.02488283,  0.02402232,
-     0.02317341,  0.02233631,  0.02151124,  0.02069866,
-     0.01989922,  0.01911359,  0.01834241,  0.01758563,
-     0.01684248,  0.01611219,  0.01539397,  0.01468726,
-     0.01399167,  0.01330687,  0.01263250,  0.01196871,
-     0.01131609,  0.01067527,  0.01004684,  0.00943077,
-     0.00882641,  0.00823307,  0.00765011,  0.00707735,
-     0.00651513,  0.00596377,  0.00542364,  0.00489514,
-     0.00437884,  0.00387530,  0.00338509,  0.00290795,
-     0.00244282,  0.00198860,  0.00154417,  0.00110825,
-     0.00067934,  0.00025589, -0.00016357, -0.00057897,
-    -0.00098865, -0.00139089, -0.00178397, -0.00216547,
-    -0.00253230, -0.00288133, -0.00320955, -0.00351626,
-    -0.00380315, -0.00407198, -0.00432457, -0.00456373,
-    -0.00479326, -0.00501699, -0.00523871, -0.00546066,
-    -0.00568360, -0.00590821, -0.00613508, -0.00636311,
-    -0.00658944, -0.00681117, -0.00702540, -0.00722982,
-    -0.00742268, -0.00760226, -0.00776687, -0.00791580,
-    -0.00804933, -0.00816774, -0.00827139, -0.00836122,
-    -0.00843882, -0.00850583, -0.00856383, -0.00861430,
-    -0.00865853, -0.00869781, -0.00873344, -0.00876633,
-    -0.00879707, -0.00882622, -0.00885433, -0.00888132,
-    -0.00890652, -0.00892925, -0.00894881, -0.00896446,
-    -0.00897541, -0.00898088, -0.00898010, -0.00897234,
-    -0.00895696, -0.00893330, -0.00890076, -0.00885914,
-    -0.00880875, -0.00874987, -0.00868282, -0.00860825,
-    -0.00852716, -0.00844055, -0.00834941, -0.00825485,
-    -0.00815807, -0.00806025, -0.00796253, -0.00786519,
-    -0.00776767, -0.00766937, -0.00756971, -0.00746790,
-    -0.00736305, -0.00725422, -0.00714055, -0.00702161,
-    -0.00689746, -0.00676816, -0.00663381, -0.00649489,
-    -0.00635230, -0.00620694, -0.00605969, -0.00591116,
-    -0.00576167, -0.00561155, -0.00546110, -0.00531037,
-    -0.00515917, -0.00500732, -0.00485462, -0.00470075,
-    -0.00454530, -0.00438786, -0.00422805, -0.00406594,
-    -0.00390204, -0.00373686, -0.00357091, -0.00340448,
-    -0.00323770, -0.00307066, -0.00290344, -0.00273610,
-    -0.00256867, -0.00240117, -0.00223365, -0.00206614,
-    -0.00189866, -0.00173123, -0.00156390, -0.00139674,
-    -0.00122989, -0.00106351, -0.00089772, -0.00073267,
-    -0.00056849, -0.00040530, -0.00024324, -0.00008241,
-     0.00008214,  0.00024102,  0.00039922,  0.00055660,
-     0.00071299,  0.00086826,  0.00102224,  0.00117480,
-     0.00132579,  0.00147507,  0.00162252,  0.00176804,
-     0.00191161,  0.00205319,  0.00219277,  0.00233029,
-     0.00246567,  0.00259886,  0.00272975,  0.00285832,
-     0.00298453,  0.00310839,  0.00322990,  0.00334886,
-     0.00346494,  0.00357778,  0.00368706,  0.00379273,
-     0.00389501,  0.00399411,  0.00409020,  0.00418350,
-     0.00427419,  0.00436249,  0.00444858,  0.00453250,
-     0.00461411,  0.00469328,  0.00476988,  0.00484356,
-     0.00491375,  0.00497987,  0.00504139,  0.00509806,
-     0.00514990,  0.00519693,  0.00523920,  0.00527700,
-     0.00531083,  0.00534122,  0.00536864,  0.00539357,
-     0.00541649,  0.00543785,  0.00545809,  0.00547713,
-     0.00549441,  0.00550936,  0.00552146,  0.00553017,
-     0.00553494,  0.00553524,  0.00553058,  0.00552065,
-     0.00550536,  0.00548459,  0.00545828,  0.00542662,
-     0.00539007,  0.00534910,  0.00530415,  0.00525568,
-     0.00520417,  0.00515009,  0.00509387,  0.00503595,
-     0.00497674,  0.00491665,  0.00485605,  0.00479503,
-     0.00473336,  0.00467082,  0.00460721,  0.00454216,
-     0.00447517,  0.00440575,  0.00433344,  0.00425768,
-     0.00417786,  0.00409336,  0.00400363,  0.00390837,
-     0.00380759,  0.00370130,  0.00358952,  0.00347268,
-     0.00335157,  0.00322699,  0.00309975,  0.00297088,
-     0.00284164,  0.00271328,  0.00258700,  0.00246328,
-     0.00234195,  0.00222281,  0.00210562,  0.00198958,
-     0.00187331,  0.00175546,  0.00163474,  0.00151020,
-     0.00138130,  0.00124750,  0.00110831,  0.00096411,
-     0.00081611,  0.00066554,  0.00051363,  0.00036134,
-     0.00020940,  0.00005853, -0.00009058, -0.00023783,
-    -0.00038368, -0.00052861, -0.00067310, -0.00081757,
-    -0.00096237, -0.00110786, -0.00125442, -0.00140210,
-    -0.00155065, -0.00169984, -0.00184940, -0.00199910,
-    -0.00214872, -0.00229798, -0.00244664, -0.00259462,
-    -0.00274205, -0.00288912, -0.00303596, -0.00318259,
-    -0.00332890, -0.00347480, -0.00362024, -0.00376519,
-    -0.00390962, -0.00405345, -0.00419658, -0.00433902,
-    -0.00448085, -0.00462219, -0.00476309, -0.00490357,
-    -0.00504361, -0.00518321, -0.00532243, -0.00546132,
-    -0.00559988, -0.00573811, -0.00587602, -0.00601363,
-    -0.00615094, -0.00628795, -0.00642466, -0.00656111,
-    -0.00669737, -0.00683352, -0.00696963, -0.00710578,
-    -0.00724208, -0.00737862, -0.00751554, -0.00765295,
-    -0.00779098, -0.00792976, -0.00806941, -0.00821006,
-    -0.00835183, -0.00849485, -0.00863926, -0.00878522,
-    -0.00893293, -0.00908260, -0.00923444, -0.00938864,
-    -0.00954537, -0.00970482, -0.00986715, -0.01003173,
-    -0.01019711, -0.01036164, -0.01052357, -0.01068184,
-    -0.01083622, -0.01098652, -0.01113252, -0.01127409,
-    -0.01141114, -0.01154358, -0.01167135, -0.01179439,
-    -0.01191268, -0.01202619, -0.01213493, -0.01223891,
-    -0.01233817, -0.01243275, -0.01252272, -0.01260815,
-    -0.01268915, -0.01276583, -0.01283832, -0.01290685,
-    -0.01297171, -0.01303320, -0.01309168, -0.01314722,
-    -0.01319969, -0.01324889, -0.01329466, -0.01333693,
-    -0.01337577, -0.01341125, -0.01344345, -0.01347243,
-    -0.01349823, -0.01352089, -0.01354045, -0.01355700,
-    -0.01357068, -0.01358164, -0.01359003, -0.01359587,
-    -0.01359901, -0.01359931, -0.01359661, -0.01359087,
-    -0.01358219, -0.01357065, -0.01355637, -0.01353935,
-    -0.01351949, -0.01349670, -0.01347088, -0.01344214,
-    -0.01341078, -0.01337715, -0.01334158, -0.01330442,
-    -0.01326601, -0.01322671, -0.01318689, -0.01314692,
-    -0.01310123, -0.01306470, -0.01302556, -0.01298381,
-    -0.01293948, -0.01289255, -0.01284305, -0.01279095,
-    -0.01273625, -0.01267893, -0.01261897, -0.01255632,
-    -0.01249096, -0.01242283, -0.01235190, -0.01227827,
-    -0.01220213, -0.01212366, -0.01204304, -0.01196032,
-    -0.01187543, -0.01178829, -0.01169884, -0.01160718,
-    -0.01151352, -0.01141809, -0.01132111, -0.01122272,
-    -0.01112304, -0.01102217, -0.01092022, -0.01081730,
-    -0.01071355, -0.01060912, -0.01050411, -0.01039854,
-    -0.01029227, -0.01018521, -0.01007727, -0.00996859,
-    -0.00985959, -0.00975063, -0.00964208, -0.00953420,
-    -0.00942723, -0.00932135, -0.00921677, -0.00911364,
-    -0.00901208, -0.00891220, -0.00881412, -0.00871792,
-    -0.00862369, -0.00853153, -0.00844149, -0.00835360,
-    -0.00826785, -0.00818422, -0.00810267, -0.00802312,
-    -0.00794547, -0.00786959, -0.00779533, -0.00772165,
-    -0.00764673, -0.00756886, -0.00748649, -0.00739905,
-    -0.00730681, -0.00721006, -0.00710910, -0.00700419,
-    -0.00689559, -0.00678354, -0.00666829, -0.00655007,
-    -0.00642916, -0.00630579, -0.00618022, -0.00605267,
-    -0.00592333, -0.00579240, -0.00566006, -0.00552651,
-    -0.00539194, -0.00525653, -0.00512047, -0.00498390,
-    -0.00484693, -0.00470969, -0.00457228, -0.00443482,
-    -0.00429746, -0.00416034, -0.00402359, -0.00388738,
-    -0.00375185, -0.00361718, -0.00348350, -0.00335100,
-    -0.00321991, -0.00309043, -0.00296276, -0.00283698,
-    -0.00271307, -0.00259098, -0.00247066, -0.00235210,
-    -0.00223531, -0.00212030, -0.00200709, -0.00189576,
-    -0.00178647, -0.00167936, -0.00157457, -0.00147216,
-    -0.00137205, -0.00127418, -0.00117849, -0.00108498,
-    -0.00099375, -0.00090486, -0.00081840, -0.00073444,
-    -0.00065309, -0.00057445, -0.00049860, -0.00042551,
-    -0.00035503, -0.00028700, -0.00022125, -0.00015761,
-    -0.00009588, -0.00003583,  0.00002272,  0.00007975,
-     0.00013501,  0.00018828,  0.00023933,  0.00028784,
-     0.00033342,  0.00037572,  0.00041438,  0.00044939,
-     0.00048103,  0.00050958,  0.00053533,  0.00055869,
-     0.00058015,  0.00060022,  0.00061935,  0.00063781,
-     0.00065568,  0.00067303,  0.00068991,  0.00070619,
-     0.00072155,  0.00073567,  0.00074826,  0.00075912,
-     0.00076811,  0.00077509,  0.00077997,  0.00078275,
-     0.00078351,  0.00078237,  0.00077943,  0.00077484,
-     0.00076884,  0.00076160,  0.00075335,  0.00074423,
-     0.00073442,  0.00072404,  0.00071323,  0.00070209,
-     0.00069068,  0.00067906,  0.00066728,  0.00065534,
-     0.00064321,  0.00063086,  0.00061824,  0.00060534,
-     0.00059211,  0.00057855,  0.00056462,  0.00055033,
-     0.00053566,  0.00052063,  0.00050522,  0.00048949,
-     0.00047349,  0.00045728,  0.00044092,  0.00042447,
-     0.00040803,  0.00039166,  0.00037544,  0.00035943,
-     0.00034371,  0.00032833,  0.00031333,  0.00029874,
-     0.00028452,  0.00027067,  0.00025715,  0.00024395,
-     0.00023104,  0.00021842,  0.00020606,  0.00019398,
-     0.00018218,  0.00017069,  0.00015953,  0.00014871,
-     0.00013827,  0.00012823,  0.00011861,  0.00010942,
-     0.00010067,  0.00009236,  0.00008448,  0.00007703,
-     0.00006999,  0.00006337,  0.00005714,  0.00005129,
-     0.00004583,  0.00004072,  0.00003597,  0.00003157,
-     0.00002752,  0.00002380,  0.00002042,  0.00001736,
-     0.00001461,  0.00001215,  0.00000998,  0.00000807,
-     0.00000641,  0.00000499,  0.00000378,  0.00000278,
-     0.00000196,  0.00000132,  0.00000082,  0.00000046,
-     0.00000020,  0.00000005, -0.00000003, -0.00000006,
-    -0.00000004, -0.00000001,  0.00000001,  0.00000001,
-     0.00000001,  0.00000001, -0.00000001, -0.00000004,
-    -0.00000005, -0.00000003,  0.00000005,  0.00000020,
-     0.00000043,  0.00000077,  0.00000123,  0.00000183,
-     0.00000257,  0.00000348,  0.00000455,  0.00000581,
-     0.00000727,  0.00000893,  0.00001080,  0.00001290,
-     0.00001522,  0.00001778,  0.00002057,  0.00002362,
-     0.00002691,  0.00003044,  0.00003422,  0.00003824,
-     0.00004250,  0.00004701,  0.00005176,  0.00005676,
-     0.00006200,  0.00006749,  0.00007322,  0.00007920,
-     0.00008541,  0.00009186,  0.00009854,  0.00010543,
-     0.00011251,  0.00011975,  0.00012714,  0.00013465,
-     0.00014227,  0.00014997,  0.00015775,  0.00016558,
-     0.00017348,  0.00018144,  0.00018947,  0.00019756,
-     0.00020573,  0.00021399,  0.00022233,  0.00023076,
-     0.00023924,  0.00024773,  0.00025621,  0.00026462,
-     0.00027293,  0.00028108,  0.00028904,  0.00029675,
-     0.00030419,  0.00031132,  0.00031810,  0.00032453,
-     0.00033061,  0.00033632,  0.00034169,  0.00034672,
-     0.00035142,  0.00035580,  0.00035988,  0.00036369,
-     0.00036723,  0.00037053,  0.00037361,  0.00037647,
-     0.00037909,  0.00038145,  0.00038352,  0.00038527,
-     0.00038663,  0.00038757,  0.00038801,  0.00038790,
-     0.00038717,  0.00038572,  0.00038350,  0.00038044,
-     0.00037651,  0.00037170,  0.00036597,  0.00035936,
-     0.00035191,  0.00034370,  0.00033480,  0.00032531,
-     0.00031537,  0.00030512,  0.00029470,  0.00028417,
-     0.00027354,  0.00026279,  0.00025191,  0.00024081,
-     0.00022933,  0.00021731,  0.00020458,  0.00019101,
-     0.00017654,  0.00016106,  0.00014452,  0.00012694,
-     0.00010848,  0.00008929,  0.00006953,  0.00004935,
-     0.00002884,  0.00000813, -0.00001268, -0.00003357,
-    -0.00005457, -0.00007574, -0.00009714, -0.00011882,
-    -0.00014082, -0.00016318, -0.00018595, -0.00020912,
-    -0.00023265, -0.00025650, -0.00028060, -0.00030492,
-    -0.00032941, -0.00035400, -0.00037865, -0.00040333,
-    -0.00042804, -0.00045279, -0.00047759, -0.00050243,
-    -0.00052728, -0.00055209, -0.00057685, -0.00060153,
-    -0.00062611, -0.00065056, -0.00067485, -0.00069895,
-    -0.00072287, -0.00074660, -0.00077013, -0.00079345,
-    -0.00081653, -0.00083936, -0.00086192, -0.00088421,
-    -0.00090619, -0.00092786, -0.00094919, -0.00097017,
-    -0.00099077, -0.00101098, -0.00103077, -0.00105012,
-    -0.00106904, -0.00108750, -0.00110549, -0.00112301,
-    -0.00114005, -0.00115660, -0.00117265, -0.00118821,
-    -0.00120325, -0.00121779, -0.00123180, -0.00124528,
-    -0.00125822, -0.00127061, -0.00128243, -0.00129368,
-    -0.00130435, -0.00131445, -0.00132395, -0.00133285,
-    -0.00134113, -0.00134878, -0.00135577, -0.00136215,
-    -0.00136797, -0.00137333, -0.00137834, -0.00138305,
-    -0.00138748, -0.00139163, -0.00139551, -0.00139913,
-    -0.00140249, -0.00140559, -0.00140844, -0.00141102,
-    -0.00141334, -0.00141538, -0.00141714, -0.00141861,
-    -0.00141978, -0.00142064, -0.00142117, -0.00142138,
-    -0.00142125, -0.00142077, -0.00141992, -0.00141870,
-    -0.00141710, -0.00141510, -0.00141268, -0.00140986,
-    -0.00140663, -0.00140301, -0.00139900, -0.00139460,
-    -0.00138981, -0.00138464, -0.00137908, -0.00137313,
-    -0.00136680, -0.00136010, -0.00135301, -0.00134555,
-    -0.00133772, -0.00132952, -0.00132095, -0.00131201,
-    -0.00130272, -0.00129307, -0.00128309, -0.00127277,
-    -0.00126211, -0.00125113, -0.00123981, -0.00122817,
-    -0.00121622, -0.00120397, -0.00119141, -0.00117859,
-    -0.00116552, -0.00115223, -0.00113877, -0.00112517,
-    -0.00111144, -0.00109764, -0.00108377, -0.00106989,
-};
diff --git a/deps/libav/libavcodec/aactab.h b/deps/libav/libavcodec/aactab.h
deleted file mode 100644
index d19b3fd..0000000
--- a/deps/libav/libavcodec/aactab.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * AAC data declarations
- * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
- * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC data declarations
- * @author Oded Shimon  ( ods15 ods15 dyndns org )
- * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
- */
-
-#ifndef AVCODEC_AACTAB_H
-#define AVCODEC_AACTAB_H
-
-#include "libavutil/mem.h"
-#include "aac.h"
-#include "aac_tablegen_decl.h"
-
-#include <stdint.h>
-
-/* NOTE:
- * Tables in this file are used by the AAC decoder and will be used by the AAC
- * encoder.
- */
-
-/* @name window coefficients
- * @{
- */
-DECLARE_ALIGNED(32, extern float,  ff_aac_kbd_long_1024)[1024];
-DECLARE_ALIGNED(32, extern float,  ff_aac_kbd_short_128)[128];
-const DECLARE_ALIGNED(32, extern float, ff_aac_eld_window)[1920];
-// @}
-
-/* @name number of scalefactor window bands for long and short transform windows respectively
- * @{
- */
-extern const uint8_t ff_aac_num_swb_1024[];
-extern const uint8_t ff_aac_num_swb_512 [];
-extern const uint8_t ff_aac_num_swb_128 [];
-// @}
-
-extern const uint8_t ff_aac_pred_sfb_max [];
-
-extern const uint32_t ff_aac_scalefactor_code[121];
-extern const uint8_t  ff_aac_scalefactor_bits[121];
-
-extern const uint16_t * const ff_aac_spectral_codes[11];
-extern const uint8_t  * const ff_aac_spectral_bits [11];
-extern const uint16_t  ff_aac_spectral_sizes[11];
-
-extern const float *ff_aac_codebook_vectors[];
-extern const float *ff_aac_codebook_vector_vals[];
-extern const uint16_t *ff_aac_codebook_vector_idx[];
-
-extern const uint16_t * const ff_swb_offset_1024[13];
-extern const uint16_t * const ff_swb_offset_512 [13];
-extern const uint16_t * const ff_swb_offset_128 [13];
-
-extern const uint8_t ff_tns_max_bands_1024[13];
-extern const uint8_t ff_tns_max_bands_512 [13];
-extern const uint8_t ff_tns_max_bands_128 [13];
-
-#endif /* AVCODEC_AACTAB_H */
diff --git a/deps/libav/libavcodec/aandcttab.c b/deps/libav/libavcodec/aandcttab.c
deleted file mode 100644
index 0c5b573..0000000
--- a/deps/libav/libavcodec/aandcttab.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAN (Arai Agui Aakajima) (I)DCT tables
- */
-
-#include <stdint.h>
-
-const uint16_t ff_aanscales[64] = {
-    /* precomputed values scaled up by 14 bits */
-    16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
-    22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,
-    21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,
-    19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,
-    16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
-    12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,
-    8867 , 12299, 11585, 10426,  8867,  6967,  4799,  2446,
-    4520 ,  6270,  5906,  5315,  4520,  3552,  2446,  1247
-};
-
-const uint16_t ff_inv_aanscales[64] = {
-  4096,  2953,  3135,  3483,  4096,  5213,  7568, 14846,
-  2953,  2129,  2260,  2511,  2953,  3759,  5457, 10703,
-  3135,  2260,  2399,  2666,  3135,  3990,  5793, 11363,
-  3483,  2511,  2666,  2962,  3483,  4433,  6436, 12625,
-  4096,  2953,  3135,  3483,  4096,  5213,  7568, 14846,
-  5213,  3759,  3990,  4433,  5213,  6635,  9633, 18895,
-  7568,  5457,  5793,  6436,  7568,  9633, 13985, 27432,
- 14846, 10703, 11363, 12625, 14846, 18895, 27432, 53809,
-};
diff --git a/deps/libav/libavcodec/aandcttab.h b/deps/libav/libavcodec/aandcttab.h
deleted file mode 100644
index daccb7b..0000000
--- a/deps/libav/libavcodec/aandcttab.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAN (Arai Agui Nakajima) (I)DCT tables
- */
-
-#ifndef AVCODEC_AANDCTTAB_H
-#define AVCODEC_AANDCTTAB_H
-
-#include <stdint.h>
-
-extern const uint16_t ff_aanscales[64];
-extern const uint16_t ff_inv_aanscales[64];
-
-#endif /* AVCODEC_AANDCTTAB_H */
diff --git a/deps/libav/libavcodec/aarch64/Makefile b/deps/libav/libavcodec/aarch64/Makefile
deleted file mode 100644
index af89f93..0000000
--- a/deps/libav/libavcodec/aarch64/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-OBJS-$(CONFIG_H264CHROMA)               += aarch64/h264chroma_init_aarch64.o
-OBJS-$(CONFIG_H264DSP)                  += aarch64/h264dsp_init_aarch64.o
-OBJS-$(CONFIG_H264QPEL)                 += aarch64/h264qpel_init_aarch64.o
-OBJS-$(CONFIG_HPELDSP)                  += aarch64/hpeldsp_init_aarch64.o
-OBJS-$(CONFIG_NEON_CLOBBER_TEST)        += aarch64/neontest.o
-OBJS-$(CONFIG_RV40_DECODER)             += aarch64/rv40dsp_init_aarch64.o
-OBJS-$(CONFIG_VC1_DECODER)              += aarch64/vc1dsp_init_aarch64.o
-
-NEON-OBJS-$(CONFIG_H264CHROMA)          += aarch64/h264cmc_neon.o
-NEON-OBJS-$(CONFIG_H264DSP)             += aarch64/h264dsp_neon.o              \
-                                           aarch64/h264idct_neon.o
-NEON-OBJS-$(CONFIG_H264QPEL)            += aarch64/h264qpel_neon.o             \
-                                           aarch64/hpeldsp_neon.o
-NEON-OBJS-$(CONFIG_HPELDSP)             += aarch64/hpeldsp_neon.o
diff --git a/deps/libav/libavcodec/aarch64/h264chroma_init_aarch64.c b/deps/libav/libavcodec/aarch64/h264chroma_init_aarch64.c
deleted file mode 100644
index c7679ab..0000000
--- a/deps/libav/libavcodec/aarch64/h264chroma_init_aarch64.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * ARM NEON optimised H.264 chroma functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/aarch64/cpu.h"
-#include "libavcodec/h264chroma.h"
-
-#include "config.h"
-
-void ff_put_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride,
-                                 int h, int x, int y);
-void ff_put_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride,
-                                 int h, int x, int y);
-void ff_put_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, int stride,
-                                 int h, int x, int y);
-
-void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride,
-                                 int h, int x, int y);
-void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride,
-                                 int h, int x, int y);
-void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, int stride,
-                                 int h, int x, int y);
-
-av_cold void ff_h264chroma_init_aarch64(H264ChromaContext *c, int bit_depth)
-{
-    const int high_bit_depth = bit_depth > 8;
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags) && !high_bit_depth) {
-        c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_neon;
-        c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_neon;
-        c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_neon;
-
-        c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_neon;
-        c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_neon;
-        c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/aarch64/h264cmc_neon.S b/deps/libav/libavcodec/aarch64/h264cmc_neon.S
deleted file mode 100644
index 50d12b4..0000000
--- a/deps/libav/libavcodec/aarch64/h264cmc_neon.S
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- * Copyright (c) 2013 Janne Grunau <janne-libav at jannau.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/aarch64/asm.S"
-
-/* chroma_mc8(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y) */
-.macro  h264_chroma_mc8 type, codec=h264
-function ff_\type\()_\codec\()_chroma_mc8_neon, export=1
-        sxtw            x2,  w2
-  .ifc \type,avg
-        mov             x8,  x0
-  .endif
-        prfm            pldl1strm, [x1]
-        prfm            pldl1strm, [x1, x2]
-  .ifc \codec,rv40
-        movrel          x6,  rv40bias
-        lsr             w9,  w5,  #1
-        lsr             w10, w4,  #1
-        lsl             w9,  w9,  #3
-        lsl             w10, w10, #1
-        add             w9,  w9,  w10
-        add             x6,  x6,  w9, UXTW
-        ld1r            {v22.8H}, [x6]
-  .endif
-  .ifc \codec,vc1
-        movi            v22.8H,   #28
-  .endif
-        mul             w7,  w4,  w5
-        lsl             w14, w5,  #3
-        lsl             w13, w4,  #3
-        cmp             w7,  #0
-        sub             w6,  w14, w7
-        sub             w12, w13, w7
-        sub             w4,  w7,  w13
-        sub             w4,  w4,  w14
-        add             w4,  w4,  #64
-        b.eq            2f
-
-        dup             v0.8B,  w4
-        dup             v1.8B,  w12
-        ld1             {v4.8B, v5.8B}, [x1], x2
-        dup             v2.8B,  w6
-        dup             v3.8B,  w7
-        ext             v5.8B,  v4.8B,  v5.8B,  #1
-1:      ld1             {v6.8B, v7.8B}, [x1], x2
-        umull           v16.8H, v4.8B,  v0.8B
-        umlal           v16.8H, v5.8B,  v1.8B
-        ext             v7.8B,  v6.8B,  v7.8B,  #1
-        ld1             {v4.8B, v5.8B}, [x1], x2
-        umlal           v16.8H, v6.8B,  v2.8B
-        prfm            pldl1strm, [x1]
-        ext             v5.8B,  v4.8B,  v5.8B,  #1
-        umlal           v16.8H, v7.8B,  v3.8B
-        umull           v17.8H, v6.8B,  v0.8B
-        subs            w3,  w3,  #2
-        umlal           v17.8H, v7.8B, v1.8B
-        umlal           v17.8H, v4.8B, v2.8B
-        umlal           v17.8H, v5.8B, v3.8B
-        prfm            pldl1strm, [x1, x2]
-  .ifc \codec,h264
-        rshrn           v16.8B, v16.8H, #6
-        rshrn           v17.8B, v17.8H, #6
-  .else
-        add             v16.8H, v16.8H, v22.8H
-        add             v17.8H, v17.8H, v22.8H
-        shrn            v16.8B, v16.8H, #6
-        shrn            v17.8B, v17.8H, #6
-  .endif
-  .ifc \type,avg
-        ld1             {v20.8B}, [x8], x2
-        ld1             {v21.8B}, [x8], x2
-        urhadd          v16.8B, v16.8B, v20.8B
-        urhadd          v17.8B, v17.8B, v21.8B
-  .endif
-        st1             {v16.8B}, [x0], x2
-        st1             {v17.8B}, [x0], x2
-        b.gt            1b
-        ret
-
-2:      tst             w6,  w6
-        add             w12, w12, w6
-        dup             v0.8B, w4
-        dup             v1.8B, w12
-        b.eq            4f
-
-        ld1             {v4.8B}, [x1], x2
-3:      ld1             {v6.8B}, [x1], x2
-        umull           v16.8H, v4.8B,  v0.8B
-        umlal           v16.8H, v6.8B,  v1.8B
-        ld1             {v4.8B}, [x1], x2
-        umull           v17.8H, v6.8B,  v0.8B
-        umlal           v17.8H, v4.8B,  v1.8B
-        prfm            pldl1strm, [x1]
-  .ifc \codec,h264
-        rshrn           v16.8B, v16.8H, #6
-        rshrn           v17.8B, v17.8H, #6
-  .else
-        add             v16.8H, v16.8H, v22.8H
-        add             v17.8H, v17.8H, v22.8H
-        shrn            v16.8B, v16.8H, #6
-        shrn            v17.8B, v17.8H, #6
-  .endif
-        prfm            pldl1strm, [x1, x2]
-  .ifc \type,avg
-        ld1             {v20.8B}, [x8], x2
-        ld1             {v21.8B}, [x8], x2
-        urhadd          v16.8B, v16.8B, v20.8B
-        urhadd          v17.8B, v17.8B, v21.8B
-  .endif
-        subs            w3,  w3,  #2
-        st1             {v16.8B}, [x0], x2
-        st1             {v17.8B}, [x0], x2
-        b.gt            3b
-        ret
-
-4:      ld1             {v4.8B, v5.8B}, [x1], x2
-        ld1             {v6.8B, v7.8B}, [x1], x2
-        ext             v5.8B,  v4.8B,  v5.8B,  #1
-        ext             v7.8B,  v6.8B,  v7.8B,  #1
-        prfm            pldl1strm, [x1]
-        subs            w3,  w3,  #2
-        umull           v16.8H, v4.8B, v0.8B
-        umlal           v16.8H, v5.8B, v1.8B
-        umull           v17.8H, v6.8B, v0.8B
-        umlal           v17.8H, v7.8B, v1.8B
-        prfm            pldl1strm, [x1, x2]
-  .ifc \codec,h264
-        rshrn           v16.8B, v16.8H, #6
-        rshrn           v17.8B, v17.8H, #6
-  .else
-        add             v16.8H, v16.8H, v22.8H
-        add             v17.8H, v17.8H, v22.8H
-        shrn            v16.8B, v16.8H, #6
-        shrn            v17.8B, v17.8H, #6
-  .endif
-  .ifc \type,avg
-        ld1             {v20.8B}, [x8], x2
-        ld1             {v21.8B}, [x8], x2
-        urhadd          v16.8B, v16.8B, v20.8B
-        urhadd          v17.8B, v17.8B, v21.8B
-  .endif
-        st1             {v16.8B}, [x0], x2
-        st1             {v17.8B}, [x0], x2
-        b.gt            4b
-        ret
-endfunc
-.endm
-
-/* chroma_mc4(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y) */
-.macro  h264_chroma_mc4 type, codec=h264
-function ff_\type\()_\codec\()_chroma_mc4_neon, export=1
-        sxtw            x2,  w2
-  .ifc \type,avg
-        mov             x8,  x0
-  .endif
-        prfm            pldl1strm, [x1]
-        prfm            pldl1strm, [x1, x2]
-  .ifc \codec,rv40
-        movrel          x6,  rv40bias
-        lsr             w9,  w5,  #1
-        lsr             w10, w4,  #1
-        lsl             w9,  w9,  #3
-        lsl             w10, w10, #1
-        add             w9,  w9,  w10
-        add             x6,  x6,  w9, UXTW
-        ld1r            {v22.8H}, [x6]
-  .endif
-  .ifc \codec,vc1
-        movi            v22.8H,   #28
-  .endif
-        mul             w7,  w4,  w5
-        lsl             w14, w5,  #3
-        lsl             w13, w4,  #3
-        cmp             w7,  #0
-        sub             w6,  w14, w7
-        sub             w12, w13, w7
-        sub             w4,  w7,  w13
-        sub             w4,  w4,  w14
-        add             w4,  w4,  #64
-        b.eq            2f
-
-        dup             v24.8B,  w4
-        dup             v25.8B,  w12
-        ld1             {v4.8B}, [x1], x2
-        dup             v26.8B,  w6
-        dup             v27.8B,  w7
-        ext             v5.8B,  v4.8B,  v5.8B, #1
-        trn1            v0.2S,  v24.2S, v25.2S
-        trn1            v2.2S,  v26.2S, v27.2S
-        trn1            v4.2S,  v4.2S,  v5.2S
-1:      ld1             {v6.8B}, [x1], x2
-        ext             v7.8B,  v6.8B,  v7.8B, #1
-        trn1            v6.2S,  v6.2S,  v7.2S
-        umull           v18.8H, v4.8B,  v0.8B
-        umlal           v18.8H, v6.8B,  v2.8B
-        ld1             {v4.8B}, [x1], x2
-        ext             v5.8B,  v4.8B,  v5.8B, #1
-        trn1            v4.2S,  v4.2S,  v5.2S
-        prfm            pldl1strm, [x1]
-        umull           v19.8H, v6.8B,  v0.8B
-        umlal           v19.8H, v4.8B,  v2.8B
-        trn1            v30.2D, v18.2D, v19.2D
-        trn2            v31.2D, v18.2D, v19.2D
-        add             v18.8H, v30.8H, v31.8H
-  .ifc \codec,h264
-        rshrn           v16.8B, v18.8H, #6
-  .else
-        add             v18.8H, v18.8H, v22.8H
-        shrn            v16.8B, v18.8H, #6
-  .endif
-        subs            w3,  w3,  #2
-        prfm            pldl1strm, [x1, x2]
-  .ifc \type,avg
-        ld1             {v20.S}[0], [x8], x2
-        ld1             {v20.S}[1], [x8], x2
-        urhadd          v16.8B, v16.8B, v20.8B
-  .endif
-        st1             {v16.S}[0], [x0], x2
-        st1             {v16.S}[1], [x0], x2
-        b.gt            1b
-        ret
-
-2:      tst             w6,  w6
-        add             w12, w12, w6
-        dup             v30.8B, w4
-        dup             v31.8B, w12
-        trn1            v0.2S,  v30.2S, v31.2S
-        trn2            v1.2S,  v30.2S, v31.2S
-        b.eq            4f
-
-        ext             v1.8B,  v0.8B,  v1.8B, #4
-        ld1             {v4.S}[0], [x1], x2
-3:      ld1             {v4.S}[1], [x1], x2
-        umull           v18.8H, v4.8B,  v0.8B
-        ld1             {v4.S}[0], [x1], x2
-        umull           v19.8H, v4.8B,  v1.8B
-        trn1            v30.2D, v18.2D, v19.2D
-        trn2            v31.2D, v18.2D, v19.2D
-        add             v18.8H, v30.8H, v31.8H
-        prfm            pldl1strm, [x1]
-  .ifc \codec,h264
-        rshrn           v16.8B, v18.8H, #6
-  .else
-        add             v18.8H, v18.8H, v22.8H
-        shrn            v16.8B, v18.8H, #6
-  .endif
-  .ifc \type,avg
-        ld1             {v20.S}[0], [x8], x2
-        ld1             {v20.S}[1], [x8], x2
-        urhadd          v16.8B, v16.8B, v20.8B
-  .endif
-        subs            w3,  w3,  #2
-        prfm            pldl1strm, [x1, x2]
-        st1             {v16.S}[0], [x0], x2
-        st1             {v16.S}[1], [x0], x2
-        b.gt            3b
-        ret
-
-4:      ld1             {v4.8B}, [x1], x2
-        ld1             {v6.8B}, [x1], x2
-        ext             v5.8B,  v4.8B,  v5.8B, #1
-        ext             v7.8B,  v6.8B,  v7.8B, #1
-        trn1            v4.2S,  v4.2S,  v5.2S
-        trn1            v6.2S,  v6.2S,  v7.2S
-        umull           v18.8H, v4.8B,  v0.8B
-        umull           v19.8H, v6.8B,  v0.8B
-        subs            w3,  w3,  #2
-        trn1            v30.2D, v18.2D, v19.2D
-        trn2            v31.2D, v18.2D, v19.2D
-        add             v18.8H, v30.8H, v31.8H
-        prfm            pldl1strm, [x1]
-  .ifc \codec,h264
-        rshrn           v16.8B, v18.8H, #6
-  .else
-        add             v18.8H, v18.8H, v22.8H
-        shrn            v16.8B, v18.8H, #6
-  .endif
-  .ifc \type,avg
-        ld1             {v20.S}[0], [x8], x2
-        ld1             {v20.S}[1], [x8], x2
-        urhadd          v16.8B, v16.8B, v20.8B
-  .endif
-        prfm            pldl1strm, [x1]
-        st1             {v16.S}[0], [x0], x2
-        st1             {v16.S}[1], [x0], x2
-        b.gt            4b
-        ret
-endfunc
-.endm
-
-.macro  h264_chroma_mc2 type
-function ff_\type\()_h264_chroma_mc2_neon, export=1
-        sxtw            x2,  w2
-        prfm            pldl1strm, [x1]
-        prfm            pldl1strm, [x1, x2]
-        orr             w7,  w4,  w5
-        cbz             w7,  2f
-
-        mul             w7,  w4,  w5
-        lsl             w14, w5,  #3
-        lsl             w13, w4,  #3
-        sub             w6,  w14, w7
-        sub             w12, w13, w7
-        sub             w4,  w7,  w13
-        sub             w4,  w4,  w14
-        add             w4,  w4,  #64
-        dup             v0.8B,  w4
-        dup             v2.8B,  w12
-        dup             v1.8B,  w6
-        dup             v3.8B,  w7
-        trn1            v0.4H,  v0.4H,  v2.4H
-        trn1            v1.4H,  v1.4H,  v3.4H
-1:
-        ld1             {v4.S}[0],  [x1], x2
-        ld1             {v4.S}[1],  [x1], x2
-        rev64           v5.2S,  v4.2S
-        ld1             {v5.S}[1],  [x1]
-        ext             v6.8B,  v4.8B,  v5.8B,  #1
-        ext             v7.8B,  v5.8B,  v4.8B,  #1
-        trn1            v4.4H,  v4.4H,  v6.4H
-        trn1            v5.4H,  v5.4H,  v7.4H
-        umull           v16.8H, v4.8B,  v0.8B
-        umlal           v16.8H, v5.8B,  v1.8B
-  .ifc \type,avg
-        ld1             {v18.H}[0], [x0], x2
-        ld1             {v18.H}[2], [x0]
-        sub             x0,  x0,  x2
-  .endif
-        rev64           v17.4S, v16.4S
-        add             v16.8H, v16.8H, v17.8H
-        rshrn           v16.8B, v16.8H, #6
-  .ifc \type,avg
-        urhadd          v16.8B, v16.8B, v18.8B
-  .endif
-        st1             {v16.H}[0], [x0], x2
-        st1             {v16.H}[2], [x0], x2
-        subs            w3,  w3,  #2
-        b.gt            1b
-        ret
-
-2:
-        ld1             {v16.H}[0], [x1], x2
-        ld1             {v16.H}[1], [x1], x2
-  .ifc \type,avg
-        ld1             {v18.H}[0], [x0], x2
-        ld1             {v18.H}[1], [x0]
-        sub             x0,  x0,  x2
-        urhadd          v16.8B, v16.8B, v18.8B
-  .endif
-        st1             {v16.H}[0], [x0], x2
-        st1             {v16.H}[1], [x0], x2
-        subs            w3,  w3,  #2
-        b.gt            2b
-        ret
-endfunc
-.endm
-
-        h264_chroma_mc8 put
-        h264_chroma_mc8 avg
-        h264_chroma_mc4 put
-        h264_chroma_mc4 avg
-        h264_chroma_mc2 put
-        h264_chroma_mc2 avg
-
-#if CONFIG_RV40_DECODER
-const   rv40bias
-        .short           0, 16, 32, 16
-        .short          32, 28, 32, 28
-        .short           0, 32, 16, 32
-        .short          32, 28, 32, 28
-endconst
-
-        h264_chroma_mc8 put, rv40
-        h264_chroma_mc8 avg, rv40
-        h264_chroma_mc4 put, rv40
-        h264_chroma_mc4 avg, rv40
-#endif
-
-#if CONFIG_VC1_DECODER
-        h264_chroma_mc8 put, vc1
-        h264_chroma_mc8 avg, vc1
-        h264_chroma_mc4 put, vc1
-        h264_chroma_mc4 avg, vc1
-#endif
diff --git a/deps/libav/libavcodec/aarch64/h264dsp_init_aarch64.c b/deps/libav/libavcodec/aarch64/h264dsp_init_aarch64.c
deleted file mode 100644
index b106f11..0000000
--- a/deps/libav/libavcodec/aarch64/h264dsp_init_aarch64.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/aarch64/cpu.h"
-#include "libavcodec/h264dsp.h"
-
-void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
-                                     int beta, int8_t *tc0);
-void ff_h264_h_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
-                                     int beta, int8_t *tc0);
-void ff_h264_v_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
-                                       int beta, int8_t *tc0);
-void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
-                                       int beta, int8_t *tc0);
-
-void ff_weight_h264_pixels_16_neon(uint8_t *dst, int stride, int height,
-                                   int log2_den, int weight, int offset);
-void ff_weight_h264_pixels_8_neon(uint8_t *dst, int stride, int height,
-                                  int log2_den, int weight, int offset);
-void ff_weight_h264_pixels_4_neon(uint8_t *dst, int stride, int height,
-                                  int log2_den, int weight, int offset);
-
-void ff_biweight_h264_pixels_16_neon(uint8_t *dst, uint8_t *src, int stride,
-                                     int height, int log2_den, int weightd,
-                                     int weights, int offset);
-void ff_biweight_h264_pixels_8_neon(uint8_t *dst, uint8_t *src, int stride,
-                                    int height, int log2_den, int weightd,
-                                    int weights, int offset);
-void ff_biweight_h264_pixels_4_neon(uint8_t *dst, uint8_t *src, int stride,
-                                    int height, int log2_den, int weightd,
-                                    int weights, int offset);
-
-void ff_h264_idct_add_neon(uint8_t *dst, int16_t *block, int stride);
-void ff_h264_idct_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
-void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset,
-                             int16_t *block, int stride,
-                             const uint8_t nnzc[6*8]);
-void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset,
-                                  int16_t *block, int stride,
-                                  const uint8_t nnzc[6*8]);
-void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset,
-                            int16_t *block, int stride,
-                            const uint8_t nnzc[6*8]);
-
-void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride);
-void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
-void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset,
-                             int16_t *block, int stride,
-                             const uint8_t nnzc[6*8]);
-
-av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
-                                     const int chroma_format_idc)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags) && bit_depth == 8) {
-        c->h264_v_loop_filter_luma   = ff_h264_v_loop_filter_luma_neon;
-        c->h264_h_loop_filter_luma   = ff_h264_h_loop_filter_luma_neon;
-        c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
-        c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
-
-        c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
-        c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
-        c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
-
-        c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
-        c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
-        c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
-
-        c->h264_idct_add        = ff_h264_idct_add_neon;
-        c->h264_idct_dc_add     = ff_h264_idct_dc_add_neon;
-        c->h264_idct_add16      = ff_h264_idct_add16_neon;
-        c->h264_idct_add16intra = ff_h264_idct_add16intra_neon;
-        if (chroma_format_idc <= 1)
-            c->h264_idct_add8   = ff_h264_idct_add8_neon;
-        c->h264_idct8_add       = ff_h264_idct8_add_neon;
-        c->h264_idct8_dc_add    = ff_h264_idct8_dc_add_neon;
-        c->h264_idct8_add4      = ff_h264_idct8_add4_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/aarch64/h264dsp_neon.S b/deps/libav/libavcodec/aarch64/h264dsp_neon.S
deleted file mode 100644
index 9b4610a..0000000
--- a/deps/libav/libavcodec/aarch64/h264dsp_neon.S
+++ /dev/null
@@ -1,498 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- * Copyright (c) 2013 Janne Grunau <janne-libav at jannau.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/aarch64/asm.S"
-#include "neon.S"
-
-.macro  h264_loop_filter_start
-        cmp             w2,  #0
-        ldr             w6,  [x4]
-        ccmp            w3,  #0, #0, ne
-        mov             v24.S[0], w6
-        and             w6,  w6,  w6,  lsl #16
-        b.eq            1f
-        ands            w6,  w6,  w6,  lsl #8
-        b.ge            2f
-1:
-        ret
-2:
-.endm
-
-.macro  h264_loop_filter_luma
-        dup             v22.16B, w2                     // alpha
-        uxtl            v24.8H,  v24.8B
-        uabd            v21.16B, v16.16B, v0.16B        // abs(p0 - q0)
-        uxtl            v24.4S,  v24.4H
-        uabd            v28.16B, v18.16B, v16.16B       // abs(p1 - p0)
-        sli             v24.8H,  v24.8H,  #8
-        uabd            v30.16B, v2.16B,  v0.16B        // abs(q1 - q0)
-        sli             v24.4S,  v24.4S,  #16
-        cmhi            v21.16B, v22.16B, v21.16B       // < alpha
-        dup             v22.16B, w3                     // beta
-        cmlt            v23.16B, v24.16B, #0
-        cmhi            v28.16B, v22.16B, v28.16B       // < beta
-        cmhi            v30.16B, v22.16B, v30.16B       // < beta
-        bic             v21.16B, v21.16B, v23.16B
-        uabd            v17.16B, v20.16B, v16.16B       // abs(p2 - p0)
-        and             v21.16B, v21.16B, v28.16B
-        uabd            v19.16B,  v4.16B,  v0.16B       // abs(q2 - q0)
-        cmhi            v17.16B, v22.16B, v17.16B       // < beta
-        and             v21.16B, v21.16B, v30.16B
-        cmhi            v19.16B, v22.16B, v19.16B       // < beta
-        and             v17.16B, v17.16B, v21.16B
-        and             v19.16B, v19.16B, v21.16B
-        and             v24.16B, v24.16B, v21.16B
-        urhadd          v28.16B, v16.16B,  v0.16B
-        sub             v21.16B, v24.16B, v17.16B
-        uqadd           v23.16B, v18.16B, v24.16B
-        uhadd           v20.16B, v20.16B, v28.16B
-        sub             v21.16B, v21.16B, v19.16B
-        uhadd           v28.16B,  v4.16B, v28.16B
-        umin            v23.16B, v23.16B, v20.16B
-        uqsub           v22.16B, v18.16B, v24.16B
-        uqadd           v4.16B,   v2.16B, v24.16B
-        umax            v23.16B, v23.16B, v22.16B
-        uqsub           v22.16B,  v2.16B, v24.16B
-        umin            v28.16B,  v4.16B, v28.16B
-        uxtl            v4.8H,    v0.8B
-        umax            v28.16B, v28.16B, v22.16B
-        uxtl2           v20.8H,   v0.16B
-        usubw           v4.8H,    v4.8H,  v16.8B
-        usubw2          v20.8H,  v20.8H,  v16.16B
-        shl             v4.8H,    v4.8H,  #2
-        shl             v20.8H,  v20.8H,  #2
-        uaddw           v4.8H,    v4.8H,  v18.8B
-        uaddw2          v20.8H,  v20.8H,  v18.16B
-        usubw           v4.8H,    v4.8H,   v2.8B
-        usubw2          v20.8H,  v20.8H,   v2.16B
-        rshrn           v4.8B,    v4.8H,  #3
-        rshrn2          v4.16B,  v20.8H,  #3
-        bsl             v17.16B, v23.16B, v18.16B
-        bsl             v19.16B, v28.16B,  v2.16B
-        neg             v23.16B, v21.16B
-        uxtl            v28.8H,  v16.8B
-        smin            v4.16B,   v4.16B, v21.16B
-        uxtl2           v21.8H,  v16.16B
-        smax            v4.16B,   v4.16B, v23.16B
-        uxtl            v22.8H,   v0.8B
-        uxtl2           v24.8H,   v0.16B
-        saddw           v28.8H,  v28.8H,  v4.8B
-        saddw2          v21.8H,  v21.8H,  v4.16B
-        ssubw           v22.8H,  v22.8H,  v4.8B
-        ssubw2          v24.8H,  v24.8H,  v4.16B
-        sqxtun          v16.8B,  v28.8H
-        sqxtun2         v16.16B, v21.8H
-        sqxtun          v0.8B,   v22.8H
-        sqxtun2         v0.16B,  v24.8H
-.endm
-
-function ff_h264_v_loop_filter_luma_neon, export=1
-        h264_loop_filter_start
-        sxtw            x1,  w1
-
-        ld1             {v0.16B},  [x0], x1
-        ld1             {v2.16B},  [x0], x1
-        ld1             {v4.16B},  [x0], x1
-        sub             x0,  x0,  x1, lsl #2
-        sub             x0,  x0,  x1, lsl #1
-        ld1             {v20.16B},  [x0], x1
-        ld1             {v18.16B},  [x0], x1
-        ld1             {v16.16B},  [x0], x1
-
-        h264_loop_filter_luma
-
-        sub             x0,  x0,  x1, lsl #1
-        st1             {v17.16B},  [x0], x1
-        st1             {v16.16B}, [x0], x1
-        st1             {v0.16B},  [x0], x1
-        st1             {v19.16B}, [x0]
-
-        ret
-endfunc
-
-function ff_h264_h_loop_filter_luma_neon, export=1
-        h264_loop_filter_start
-
-        sub             x0,  x0,  #4
-        ld1             {v6.8B},  [x0], x1
-        ld1             {v20.8B}, [x0], x1
-        ld1             {v18.8B}, [x0], x1
-        ld1             {v16.8B}, [x0], x1
-        ld1             {v0.8B},  [x0], x1
-        ld1             {v2.8B},  [x0], x1
-        ld1             {v4.8B},  [x0], x1
-        ld1             {v26.8B}, [x0], x1
-        ld1             {v6.D}[1],  [x0], x1
-        ld1             {v20.D}[1], [x0], x1
-        ld1             {v18.D}[1], [x0], x1
-        ld1             {v16.D}[1], [x0], x1
-        ld1             {v0.D}[1],  [x0], x1
-        ld1             {v2.D}[1],  [x0], x1
-        ld1             {v4.D}[1],  [x0], x1
-        ld1             {v26.D}[1], [x0], x1
-
-        transpose_8x16B v6, v20, v18, v16, v0, v2, v4, v26, v21, v23
-
-        h264_loop_filter_luma
-
-        transpose_4x16B v17, v16, v0, v19, v21, v23, v25, v27
-
-        sub             x0,  x0,  x1, lsl #4
-        add             x0,  x0,  #2
-        st1             {v17.S}[0],  [x0], x1
-        st1             {v16.S}[0], [x0], x1
-        st1             {v0.S}[0],  [x0], x1
-        st1             {v19.S}[0], [x0], x1
-        st1             {v17.S}[1],  [x0], x1
-        st1             {v16.S}[1], [x0], x1
-        st1             {v0.S}[1],  [x0], x1
-        st1             {v19.S}[1], [x0], x1
-        st1             {v17.S}[2],  [x0], x1
-        st1             {v16.S}[2], [x0], x1
-        st1             {v0.S}[2],  [x0], x1
-        st1             {v19.S}[2], [x0], x1
-        st1             {v17.S}[3],  [x0], x1
-        st1             {v16.S}[3], [x0], x1
-        st1             {v0.S}[3],  [x0], x1
-        st1             {v19.S}[3], [x0], x1
-
-        ret
-endfunc
-
-.macro  h264_loop_filter_chroma
-        dup             v22.8B, w2              // alpha
-        uxtl            v24.8H, v24.8B
-        uabd            v26.8B, v16.8B, v0.8B   // abs(p0 - q0)
-        uxtl            v4.8H,  v0.8B
-        uabd            v28.8B, v18.8B, v16.8B  // abs(p1 - p0)
-        usubw           v4.8H,  v4.8H,  v16.8B
-        sli             v24.8H, v24.8H, #8
-        shl             v4.8H,  v4.8H,  #2
-        uabd            v30.8B, v2.8B,  v0.8B   // abs(q1 - q0)
-        uaddw           v4.8H,  v4.8H,  v18.8B
-        cmhi            v26.8B, v22.8B, v26.8B  // < alpha
-        usubw           v4.8H,  v4.8H,  v2.8B
-        dup             v22.8B, w3              // beta
-        rshrn           v4.8B,  v4.8H,  #3
-        cmhi            v28.8B, v22.8B, v28.8B  // < beta
-        cmhi            v30.8B, v22.8B, v30.8B  // < beta
-        smin            v4.8B,  v4.8B,  v24.8B
-        neg             v25.8B, v24.8B
-        and             v26.8B, v26.8B, v28.8B
-        smax            v4.8B,  v4.8B,  v25.8B
-        and             v26.8B, v26.8B, v30.8B
-        uxtl            v22.8H, v0.8B
-        and             v4.8B,  v4.8B,  v26.8B
-        uxtl            v28.8H, v16.8B
-        saddw           v28.8H, v28.8H, v4.8B
-        ssubw           v22.8H, v22.8H, v4.8B
-        sqxtun          v16.8B, v28.8H
-        sqxtun          v0.8B,  v22.8H
-.endm
-
-function ff_h264_v_loop_filter_chroma_neon, export=1
-        h264_loop_filter_start
-
-        sub             x0,  x0,  x1, lsl #1
-        ld1             {v18.8B}, [x0], x1
-        ld1             {v16.8B}, [x0], x1
-        ld1             {v0.8B},  [x0], x1
-        ld1             {v2.8B},  [x0]
-
-        h264_loop_filter_chroma
-
-        sub             x0,  x0,  x1, lsl #1
-        st1             {v16.8B}, [x0], x1
-        st1             {v0.8B},  [x0], x1
-
-        ret
-endfunc
-
-function ff_h264_h_loop_filter_chroma_neon, export=1
-        h264_loop_filter_start
-
-        sub             x0,  x0,  #2
-        ld1             {v18.S}[0], [x0], x1
-        ld1             {v16.S}[0], [x0], x1
-        ld1             {v0.S}[0],  [x0], x1
-        ld1             {v2.S}[0],  [x0], x1
-        ld1             {v18.S}[1], [x0], x1
-        ld1             {v16.S}[1], [x0], x1
-        ld1             {v0.S}[1],  [x0], x1
-        ld1             {v2.S}[1],  [x0], x1
-
-        transpose_4x8B  v18, v16, v0, v2, v28, v29, v30, v31
-
-        h264_loop_filter_chroma
-
-        transpose_4x8B  v18, v16, v0, v2, v28, v29, v30, v31
-
-        sub             x0,  x0,  x1, lsl #3
-        st1             {v18.S}[0], [x0], x1
-        st1             {v16.S}[0], [x0], x1
-        st1             {v0.S}[0],  [x0], x1
-        st1             {v2.S}[0],  [x0], x1
-        st1             {v18.S}[1], [x0], x1
-        st1             {v16.S}[1], [x0], x1
-        st1             {v0.S}[1],  [x0], x1
-        st1             {v2.S}[1],  [x0], x1
-
-        ret
-endfunc
-
-.macro  biweight_16     macs, macd
-        dup             v0.16B,  w5
-        dup             v1.16B,  w6
-        mov             v4.16B,  v16.16B
-        mov             v6.16B,  v16.16B
-1:      subs            w3,  w3,  #2
-        ld1             {v20.16B}, [x0], x2
-        \macd           v4.8H,   v0.8B,  v20.8B
-        \macd\()2       v6.8H,   v0.16B, v20.16B
-        ld1             {v22.16B}, [x1], x2
-        \macs           v4.8H,   v1.8B,  v22.8B
-        \macs\()2       v6.8H,   v1.16B, v22.16B
-        mov             v24.16B, v16.16B
-        ld1             {v28.16B}, [x0], x2
-        mov             v26.16B, v16.16B
-        \macd           v24.8H,  v0.8B,  v28.8B
-        \macd\()2       v26.8H,  v0.16B, v28.16B
-        ld1             {v30.16B}, [x1], x2
-        \macs           v24.8H,  v1.8B,  v30.8B
-        \macs\()2       v26.8H,  v1.16B, v30.16B
-        sshl            v4.8H,   v4.8H,  v18.8H
-        sshl            v6.8H,   v6.8H,  v18.8H
-        sqxtun          v4.8B,   v4.8H
-        sqxtun2         v4.16B,  v6.8H
-        sshl            v24.8H,  v24.8H, v18.8H
-        sshl            v26.8H,  v26.8H, v18.8H
-        sqxtun          v24.8B,  v24.8H
-        sqxtun2         v24.16B, v26.8H
-        mov             v6.16B,  v16.16B
-        st1             {v4.16B},  [x7], x2
-        mov             v4.16B,  v16.16B
-        st1             {v24.16B}, [x7], x2
-        b.ne            1b
-        ret
-.endm
-
-.macro  biweight_8      macs, macd
-        dup             v0.8B,  w5
-        dup             v1.8B,  w6
-        mov             v2.16B,  v16.16B
-        mov             v20.16B, v16.16B
-1:      subs            w3,  w3,  #2
-        ld1             {v4.8B}, [x0], x2
-        \macd           v2.8H,  v0.8B,  v4.8B
-        ld1             {v5.8B}, [x1], x2
-        \macs           v2.8H,  v1.8B,  v5.8B
-        ld1             {v6.8B}, [x0], x2
-        \macd           v20.8H, v0.8B,  v6.8B
-        ld1             {v7.8B}, [x1], x2
-        \macs           v20.8H, v1.8B,  v7.8B
-        sshl            v2.8H,  v2.8H,  v18.8H
-        sqxtun          v2.8B,  v2.8H
-        sshl            v20.8H, v20.8H, v18.8H
-        sqxtun          v4.8B,  v20.8H
-        mov             v20.16B, v16.16B
-        st1             {v2.8B}, [x7], x2
-        mov             v2.16B,  v16.16B
-        st1             {v4.8B}, [x7], x2
-        b.ne            1b
-        ret
-.endm
-
-.macro  biweight_4      macs, macd
-        dup             v0.8B,  w5
-        dup             v1.8B,  w6
-        mov             v2.16B, v16.16B
-        mov             v20.16B,v16.16B
-1:      subs            w3,  w3,  #4
-        ld1             {v4.S}[0], [x0], x2
-        ld1             {v4.S}[1], [x0], x2
-        \macd           v2.8H,  v0.8B,  v4.8B
-        ld1             {v5.S}[0], [x1], x2
-        ld1             {v5.S}[1], [x1], x2
-        \macs           v2.8H,  v1.8B,  v5.8B
-        b.lt            2f
-        ld1             {v6.S}[0], [x0], x2
-        ld1             {v6.S}[1], [x0], x2
-        \macd           v20.8H, v0.8B,  v6.8B
-        ld1             {v7.S}[0], [x1], x2
-        ld1             {v7.S}[1], [x1], x2
-        \macs           v20.8H, v1.8B,  v7.8B
-        sshl            v2.8H,  v2.8H,  v18.8H
-        sqxtun          v2.8B,  v2.8H
-        sshl            v20.8H, v20.8H, v18.8H
-        sqxtun          v4.8B,  v20.8H
-        mov             v20.16B, v16.16B
-        st1             {v2.S}[0], [x7], x2
-        st1             {v2.S}[1], [x7], x2
-        mov             v2.16B,  v16.16B
-        st1             {v4.S}[0], [x7], x2
-        st1             {v4.S}[1], [x7], x2
-        b.ne            1b
-        ret
-2:      sshl            v2.8H,  v2.8H,  v18.8H
-        sqxtun          v2.8B,  v2.8H
-        st1             {v2.S}[0], [x7], x2
-        st1             {v2.S}[1], [x7], x2
-        ret
-.endm
-
-.macro  biweight_func   w
-function ff_biweight_h264_pixels_\w\()_neon, export=1
-        sxtw            x2,  w2
-        lsr             w8,  w5,  #31
-        add             w7,  w7,  #1
-        eor             w8,  w8,  w6,  lsr #30
-        orr             w7,  w7,  #1
-        dup             v18.8H,   w4
-        lsl             w7,  w7,  w4
-        not             v18.16B,  v18.16B
-        dup             v16.8H,   w7
-        mov             x7,  x0
-        cbz             w8,  10f
-        subs            w8,  w8,  #1
-        b.eq            20f
-        subs            w8,  w8,  #1
-        b.eq            30f
-        b               40f
-10:     biweight_\w     umlal, umlal
-20:     neg             w5, w5
-        biweight_\w     umlal, umlsl
-30:     neg             w5, w5
-        neg             w6, w6
-        biweight_\w     umlsl, umlsl
-40:     neg             w6, w6
-        biweight_\w     umlsl, umlal
-endfunc
-.endm
-
-        biweight_func   16
-        biweight_func   8
-        biweight_func   4
-
-.macro  weight_16       add
-        dup             v0.16B,  w4
-1:      subs            w2,  w2,  #2
-        ld1             {v20.16B}, [x0], x1
-        umull           v4.8H,   v0.8B,  v20.8B
-        umull2          v6.8H,   v0.16B, v20.16B
-        ld1             {v28.16B}, [x0], x1
-        umull           v24.8H,  v0.8B,  v28.8B
-        umull2          v26.8H,  v0.16B, v28.16B
-        \add            v4.8H,   v16.8H, v4.8H
-        srshl           v4.8H,   v4.8H,  v18.8H
-        \add            v6.8H,   v16.8H, v6.8H
-        srshl           v6.8H,   v6.8H,  v18.8H
-        sqxtun          v4.8B,   v4.8H
-        sqxtun2         v4.16B,  v6.8H
-        \add            v24.8H,  v16.8H, v24.8H
-        srshl           v24.8H,  v24.8H, v18.8H
-        \add            v26.8H,  v16.8H, v26.8H
-        srshl           v26.8H,  v26.8H, v18.8H
-        sqxtun          v24.8B,  v24.8H
-        sqxtun2         v24.16B, v26.8H
-        st1             {v4.16B},  [x5], x1
-        st1             {v24.16B}, [x5], x1
-        b.ne            1b
-        ret
-.endm
-
-.macro  weight_8        add
-        dup             v0.8B,  w4
-1:      subs            w2,  w2,  #2
-        ld1             {v4.8B}, [x0], x1
-        umull           v2.8H,  v0.8B,  v4.8B
-        ld1             {v6.8B}, [x0], x1
-        umull           v20.8H, v0.8B,  v6.8B
-        \add            v2.8H,  v16.8H,  v2.8H
-        srshl           v2.8H,  v2.8H,  v18.8H
-        sqxtun          v2.8B,  v2.8H
-        \add            v20.8H, v16.8H,  v20.8H
-        srshl           v20.8H, v20.8H, v18.8H
-        sqxtun          v4.8B,  v20.8H
-        st1             {v2.8B}, [x5], x1
-        st1             {v4.8B}, [x5], x1
-        b.ne            1b
-        ret
-.endm
-
-.macro  weight_4        add
-        dup             v0.8B,  w4
-1:      subs            w2,  w2,  #4
-        ld1             {v4.S}[0], [x0], x1
-        ld1             {v4.S}[1], [x0], x1
-        umull           v2.8H,  v0.8B,  v4.8B
-        b.lt            2f
-        ld1             {v6.S}[0], [x0], x1
-        ld1             {v6.S}[1], [x0], x1
-        umull           v20.8H, v0.8B,  v6.8B
-        \add            v2.8H,  v16.8H,  v2.8H
-        srshl           v2.8H,  v2.8H,  v18.8H
-        sqxtun          v2.8B,  v2.8H
-        \add            v20.8H, v16.8H,  v20.8H
-        srshl           v20.8H, v20.8h, v18.8H
-        sqxtun          v4.8B,  v20.8H
-        st1             {v2.S}[0], [x5], x1
-        st1             {v2.S}[1], [x5], x1
-        st1             {v4.S}[0], [x5], x1
-        st1             {v4.S}[1], [x5], x1
-        b.ne            1b
-        ret
-2:      \add            v2.8H,  v16.8H,  v2.8H
-        srshl           v2.8H,  v2.8H,  v18.8H
-        sqxtun          v2.8B,  v2.8H
-        st1             {v2.S}[0], [x5], x1
-        st1             {v2.S}[1], [x5], x1
-        ret
-.endm
-
-.macro  weight_func     w
-function ff_weight_h264_pixels_\w\()_neon, export=1
-        sxtw            x1,  w1
-        cmp             w3,  #1
-        mov             w6,  #1
-        lsl             w5,  w5,  w3
-        dup             v16.8H,  w5
-        mov             x5,  x0
-        b.le            20f
-        sub             w6,  w6,  w3
-        dup             v18.8H,  w6
-        cmp             w4, #0
-        b.lt            10f
-        weight_\w       shadd
-10:     neg             w4,  w4
-        weight_\w       shsub
-20:     neg             w6,  w3
-        dup             v18.8H,  w6
-        cmp             w4,  #0
-        b.lt            10f
-        weight_\w       add
-10:     neg             w4,  w4
-        weight_\w       sub
-endfunc
-.endm
-
-        weight_func     16
-        weight_func     8
-        weight_func     4
diff --git a/deps/libav/libavcodec/aarch64/h264idct_neon.S b/deps/libav/libavcodec/aarch64/h264idct_neon.S
deleted file mode 100644
index 1c90c4c..0000000
--- a/deps/libav/libavcodec/aarch64/h264idct_neon.S
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- * Copyright (c) 2013 Janne Grunau <janne-libav at jannau.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/aarch64/asm.S"
-#include "neon.S"
-
-function ff_h264_idct_add_neon, export=1
-        ld1             {v0.4H, v1.4H, v2.4H, v3.4H},  [x1]
-        sxtw            x2,     w2
-        movi            v30.8H, #0
-
-        add             v4.4H,  v0.4H,  v2.4H
-        sshr            v16.4H, v1.4H,  #1
-        st1             {v30.8H},    [x1], #16
-        sshr            v17.4H, v3.4H,  #1
-        st1             {v30.8H},    [x1], #16
-        sub             v5.4H,  v0.4H,  v2.4H
-        add             v6.4H,  v1.4H,  v17.4H
-        sub             v7.4H,  v16.4H, v3.4H
-        add             v0.4H,  v4.4H,  v6.4H
-        add             v1.4H,  v5.4H,  v7.4H
-        sub             v2.4H,  v4.4H,  v6.4H
-        sub             v3.4H,  v5.4H,  v7.4H
-
-        transpose_4x4H  v0, v1, v2, v3, v4, v5, v6, v7
-
-        add             v4.4H,  v0.4H,  v3.4H
-        ld1             {v18.S}[0], [x0], x2
-        sshr            v16.4H,  v2.4H,  #1
-        sshr            v17.4H,  v1.4H,  #1
-        ld1             {v19.S}[1], [x0], x2
-        sub             v5.4H,  v0.4H,  v3.4H
-        ld1             {v18.S}[1], [x0], x2
-        add             v6.4H,  v16.4H, v1.4H
-        ins             v4.D[1],  v5.D[0]
-        sub             v7.4H,  v2.4H,  v17.4H
-        ld1             {v19.S}[0], [x0], x2
-        ins             v6.D[1],  v7.D[0]
-        sub             x0,  x0,  x2, lsl #2
-        add             v0.8H,  v4.8H,  v6.8H
-        sub             v1.8H,  v4.8H,  v6.8H
-
-        srshr           v0.8H,  v0.8H,  #6
-        srshr           v1.8H,  v1.8H,  #6
-
-        uaddw           v0.8H,  v0.8H,  v18.8B
-        uaddw           v1.8H,  v1.8H,  v19.8B
-
-        sqxtun          v0.8B, v0.8H
-        sqxtun          v1.8B, v1.8H
-
-        st1             {v0.S}[0],  [x0], x2
-        st1             {v1.S}[1],  [x0], x2
-        st1             {v0.S}[1],  [x0], x2
-        st1             {v1.S}[0],  [x0], x2
-
-        sub             x1,  x1,  #32
-        ret
-endfunc
-
-function ff_h264_idct_dc_add_neon, export=1
-        sxtw            x2,  w2
-        mov             w3,       #0
-        ld1r            {v2.8H},  [x1]
-        strh            w3,       [x1]
-        srshr           v2.8H,  v2.8H,  #6
-        ld1             {v0.S}[0],  [x0], x2
-        ld1             {v0.S}[1],  [x0], x2
-        uaddw           v3.8H,  v2.8H,  v0.8B
-        ld1             {v1.S}[0],  [x0], x2
-        ld1             {v1.S}[1],  [x0], x2
-        uaddw           v4.8H,  v2.8H,  v1.8B
-        sqxtun          v0.8B,  v3.8H
-        sqxtun          v1.8B,  v4.8H
-        sub             x0,  x0,  x2, lsl #2
-        st1             {v0.S}[0],  [x0], x2
-        st1             {v0.S}[1],  [x0], x2
-        st1             {v1.S}[0],  [x0], x2
-        st1             {v1.S}[1],  [x0], x2
-        ret
-endfunc
-
-function ff_h264_idct_add16_neon, export=1
-        mov             x12, x30
-        mov             x6,  x0         // dest
-        mov             x5,  x1         // block_offset
-        mov             x1,  x2         // block
-        mov             w9,  w3         // stride
-        movrel          x7,  scan8
-        mov             x10, #16
-        movrel          x13, ff_h264_idct_dc_add_neon
-        movrel          x14, ff_h264_idct_add_neon
-1:      mov             w2,  w9
-        ldrb            w3,  [x7], #1
-        ldrsw           x0,  [x5], #4
-        ldrb            w3,  [x4,  w3,  uxtw]
-        subs            w3,  w3,  #1
-        b.lt            2f
-        ldrsh           w3,  [x1]
-        add             x0,  x0,  x6
-        ccmp            w3,  #0,  #4,  eq
-        csel            x15, x13, x14, ne
-        blr             x15
-2:      subs            x10, x10, #1
-        add             x1,  x1,  #32
-        b.ne            1b
-        ret             x12
-endfunc
-
-function ff_h264_idct_add16intra_neon, export=1
-        mov             x12, x30
-        mov             x6,  x0         // dest
-        mov             x5,  x1         // block_offset
-        mov             x1,  x2         // block
-        mov             w9,  w3         // stride
-        movrel          x7,  scan8
-        mov             x10, #16
-        movrel          x13, ff_h264_idct_dc_add_neon
-        movrel          x14, ff_h264_idct_add_neon
-1:      mov             w2,  w9
-        ldrb            w3,  [x7], #1
-        ldrsw           x0,  [x5], #4
-        ldrb            w3,  [x4,  w3,  uxtw]
-        add             x0,  x0,  x6
-        cmp             w3,  #0
-        ldrsh           w3,  [x1]
-        csel            x15, x13, x14, eq
-        ccmp            w3,  #0,  #0,  eq
-        b.eq            2f
-        blr             x15
-2:      subs            x10, x10, #1
-        add             x1,  x1,  #32
-        b.ne            1b
-        ret             x12
-endfunc
-
-function ff_h264_idct_add8_neon, export=1
-        sub             sp,  sp, #0x40
-        stp             x19, x20, [sp]
-        mov             x12, x30
-        ldp             x6,  x15, [x0]          // dest[0], dest[1]
-        add             x5,  x1,  #16*4         // block_offset
-        add             x9,  x2,  #16*32        // block
-        mov             w19, w3                 // stride
-        movrel          x13, ff_h264_idct_dc_add_neon
-        movrel          x14, ff_h264_idct_add_neon
-        movrel          x7,  scan8+16
-        mov             x10, #0
-        mov             x11, #16
-1:      mov             w2,  w19
-        ldrb            w3,  [x7, x10]          // scan8[i]
-        ldrsw           x0,  [x5, x10, lsl #2]  // block_offset[i]
-        ldrb            w3,  [x4, w3,  uxtw]    // nnzc[ scan8[i] ]
-        add             x0,  x0,  x6            // block_offset[i] + dst[j-1]
-        add             x1,  x9,  x10, lsl #5   // block + i * 16
-        cmp             w3,  #0
-        ldrsh           w3,  [x1]               // block[i*16]
-        csel            x20, x13, x14, eq
-        ccmp            w3,  #0,  #0,  eq
-        b.eq            2f
-        blr             x20
-2:      add             x10, x10, #1
-        cmp             x10, #4
-        csel            x10, x11, x10, eq     // mov x10, #16
-        csel            x6,  x15, x6,  eq
-        cmp             x10, #20
-        b.lt            1b
-        ldp             x19, x20, [sp]
-        add             sp,  sp,  #0x40
-        ret             x12
-endfunc
-
-.macro  idct8x8_cols    pass
-  .if \pass == 0
-        va      .req    v18
-        vb      .req    v30
-        sshr            v18.8H, v26.8H, #1
-        add             v16.8H, v24.8H, v28.8H
-        ld1             {v30.8H, v31.8H}, [x1]
-        st1             {v19.8H}, [x1],  #16
-        st1             {v19.8H}, [x1],  #16
-        sub             v17.8H,  v24.8H, v28.8H
-        sshr            v19.8H,  v30.8H, #1
-        sub             v18.8H,  v18.8H,  v30.8H
-        add             v19.8H,  v19.8H,  v26.8H
-  .else
-        va      .req    v30
-        vb      .req    v18
-        sshr            v30.8H, v26.8H, #1
-        sshr            v19.8H, v18.8H, #1
-        add             v16.8H, v24.8H, v28.8H
-        sub             v17.8H, v24.8H, v28.8H
-        sub             v30.8H, v30.8H, v18.8H
-        add             v19.8H, v19.8H, v26.8H
-  .endif
-        add             v26.8H, v17.8H, va.8H
-        sub             v28.8H, v17.8H, va.8H
-        add             v24.8H, v16.8H, v19.8H
-        sub             vb.8H,  v16.8H, v19.8H
-        sub             v16.8H, v29.8H, v27.8H
-        add             v17.8H, v31.8H, v25.8H
-        sub             va.8H,  v31.8H, v25.8H
-        add             v19.8H, v29.8H, v27.8H
-        sub             v16.8H, v16.8H, v31.8H
-        sub             v17.8H, v17.8H, v27.8H
-        add             va.8H,  va.8H,  v29.8H
-        add             v19.8H, v19.8H, v25.8H
-        sshr            v25.8H, v25.8H, #1
-        sshr            v27.8H, v27.8H, #1
-        sshr            v29.8H, v29.8H, #1
-        sshr            v31.8H, v31.8H, #1
-        sub             v16.8H, v16.8H, v31.8H
-        sub             v17.8H, v17.8H, v27.8H
-        add             va.8H,  va.8H,  v29.8H
-        add             v19.8H, v19.8H, v25.8H
-        sshr            v25.8H, v16.8H, #2
-        sshr            v27.8H, v17.8H, #2
-        sshr            v29.8H, va.8H,  #2
-        sshr            v31.8H, v19.8H, #2
-        sub             v19.8H, v19.8H, v25.8H
-        sub             va.8H,  v27.8H, va.8H
-        add             v17.8H, v17.8H, v29.8H
-        add             v16.8H, v16.8H, v31.8H
-  .if \pass == 0
-        sub             v31.8H, v24.8H, v19.8H
-        add             v24.8H, v24.8H, v19.8H
-        add             v25.8H, v26.8H, v18.8H
-        sub             v18.8H, v26.8H, v18.8H
-        add             v26.8H, v28.8H, v17.8H
-        add             v27.8H, v30.8H, v16.8H
-        sub             v29.8H, v28.8H, v17.8H
-        sub             v28.8H, v30.8H, v16.8H
-  .else
-        sub             v31.8H, v24.8H, v19.8H
-        add             v24.8H, v24.8H, v19.8H
-        add             v25.8H, v26.8H, v30.8H
-        sub             v30.8H, v26.8H, v30.8H
-        add             v26.8H, v28.8H, v17.8H
-        sub             v29.8H, v28.8H, v17.8H
-        add             v27.8H, v18.8H, v16.8H
-        sub             v28.8H, v18.8H, v16.8H
-  .endif
-        .unreq          va
-        .unreq          vb
-.endm
-
-function ff_h264_idct8_add_neon, export=1
-        movi            v19.8H,   #0
-        ld1             {v24.8H, v25.8H}, [x1]
-        st1             {v19.8H},  [x1],   #16
-        st1             {v19.8H},  [x1],   #16
-        ld1             {v26.8H, v27.8H}, [x1]
-        st1             {v19.8H},  [x1],   #16
-        st1             {v19.8H},  [x1],   #16
-        ld1             {v28.8H, v29.8H}, [x1]
-        st1             {v19.8H},  [x1],   #16
-        st1             {v19.8H},  [x1],   #16
-
-        idct8x8_cols    0
-        transpose_8x8H  v24, v25, v26, v27, v28, v29, v18, v31, v6, v7
-        idct8x8_cols    1
-
-        mov             x3,  x0
-        srshr           v24.8H, v24.8H, #6
-        ld1             {v0.8B},     [x0], x2
-        srshr           v25.8H, v25.8H, #6
-        ld1             {v1.8B},     [x0], x2
-        srshr           v26.8H, v26.8H, #6
-        ld1             {v2.8B},     [x0], x2
-        srshr           v27.8H, v27.8H, #6
-        ld1             {v3.8B},     [x0], x2
-        srshr           v28.8H, v28.8H, #6
-        ld1             {v4.8B},     [x0], x2
-        srshr           v29.8H, v29.8H, #6
-        ld1             {v5.8B},     [x0], x2
-        srshr           v30.8H, v30.8H, #6
-        ld1             {v6.8B},     [x0], x2
-        srshr           v31.8H, v31.8H, #6
-        ld1             {v7.8B},     [x0], x2
-        uaddw           v24.8H, v24.8H, v0.8B
-        uaddw           v25.8H, v25.8H, v1.8B
-        uaddw           v26.8H, v26.8H, v2.8B
-        sqxtun          v0.8B,  v24.8H
-        uaddw           v27.8H, v27.8H, v3.8B
-        sqxtun          v1.8B,  v25.8H
-        uaddw           v28.8H, v28.8H, v4.8B
-        sqxtun          v2.8B,  v26.8H
-        st1             {v0.8B},     [x3], x2
-        uaddw           v29.8H, v29.8H, v5.8B
-        sqxtun          v3.8B,  v27.8H
-        st1             {v1.8B},     [x3], x2
-        uaddw           v30.8H, v30.8H, v6.8B
-        sqxtun          v4.8B,  v28.8H
-        st1             {v2.8B},     [x3], x2
-        uaddw           v31.8H, v31.8H, v7.8B
-        sqxtun          v5.8B,  v29.8H
-        st1             {v3.8B},     [x3], x2
-        sqxtun          v6.8B,  v30.8H
-        sqxtun          v7.8B,  v31.8H
-        st1             {v4.8B},     [x3], x2
-        st1             {v5.8B},     [x3], x2
-        st1             {v6.8B},     [x3], x2
-        st1             {v7.8B},     [x3], x2
-
-        sub             x1,  x1,  #128
-        ret
-endfunc
-
-function ff_h264_idct8_dc_add_neon, export=1
-        mov             w3,       #0
-        sxtw            x2,       w2
-        ld1r            {v31.8H}, [x1]
-        strh            w3,       [x1]
-        ld1             {v0.8B},  [x0], x2
-        srshr           v31.8H, v31.8H, #6
-        ld1             {v1.8B},     [x0], x2
-        ld1             {v2.8B},     [x0], x2
-        uaddw           v24.8H, v31.8H, v0.8B
-        ld1             {v3.8B},     [x0], x2
-        uaddw           v25.8H, v31.8H, v1.8B
-        ld1             {v4.8B},     [x0], x2
-        uaddw           v26.8H, v31.8H, v2.8B
-        ld1             {v5.8B},     [x0], x2
-        uaddw           v27.8H, v31.8H, v3.8B
-        ld1             {v6.8B},     [x0], x2
-        uaddw           v28.8H, v31.8H, v4.8B
-        ld1             {v7.8B},     [x0], x2
-        uaddw           v29.8H, v31.8H, v5.8B
-        uaddw           v30.8H, v31.8H, v6.8B
-        uaddw           v31.8H, v31.8H, v7.8B
-        sqxtun          v0.8B,  v24.8H
-        sqxtun          v1.8B,  v25.8H
-        sqxtun          v2.8B,  v26.8H
-        sqxtun          v3.8B,  v27.8H
-        sub             x0,  x0,  x2, lsl #3
-        st1             {v0.8B},     [x0], x2
-        sqxtun          v4.8B,  v28.8H
-        st1             {v1.8B},     [x0], x2
-        sqxtun          v5.8B,  v29.8H
-        st1             {v2.8B},     [x0], x2
-        sqxtun          v6.8B,  v30.8H
-        st1             {v3.8B},     [x0], x2
-        sqxtun          v7.8B,  v31.8H
-        st1             {v4.8B},     [x0], x2
-        st1             {v5.8B},     [x0], x2
-        st1             {v6.8B},     [x0], x2
-        st1             {v7.8B},     [x0], x2
-        ret
-endfunc
-
-function ff_h264_idct8_add4_neon, export=1
-        mov             x12, x30
-        mov             x6,  x0
-        mov             x5,  x1
-        mov             x1,  x2
-        mov             w2,  w3
-        movrel          x7,  scan8
-        mov             w10, #16
-        movrel          x13, ff_h264_idct8_dc_add_neon
-        movrel          x14, ff_h264_idct8_add_neon
-1:      ldrb            w9,  [x7], #4
-        ldrsw           x0,  [x5], #16
-        ldrb            w9,  [x4, w9, UXTW]
-        subs            w9,  w9,  #1
-        b.lt            2f
-        ldrsh           w11,  [x1]
-        add             x0,  x6,  x0
-        ccmp            w11, #0,  #4,  eq
-        csel            x15, x13, x14, ne
-        blr             x15
-2:      subs            w10, w10, #4
-        add             x1,  x1,  #128
-        b.ne            1b
-        ret             x12
-endfunc
-
-const   scan8
-        .byte           4+ 1*8, 5+ 1*8, 4+ 2*8, 5+ 2*8
-        .byte           6+ 1*8, 7+ 1*8, 6+ 2*8, 7+ 2*8
-        .byte           4+ 3*8, 5+ 3*8, 4+ 4*8, 5+ 4*8
-        .byte           6+ 3*8, 7+ 3*8, 6+ 4*8, 7+ 4*8
-        .byte           4+ 6*8, 5+ 6*8, 4+ 7*8, 5+ 7*8
-        .byte           6+ 6*8, 7+ 6*8, 6+ 7*8, 7+ 7*8
-        .byte           4+ 8*8, 5+ 8*8, 4+ 9*8, 5+ 9*8
-        .byte           6+ 8*8, 7+ 8*8, 6+ 9*8, 7+ 9*8
-        .byte           4+11*8, 5+11*8, 4+12*8, 5+12*8
-        .byte           6+11*8, 7+11*8, 6+12*8, 7+12*8
-        .byte           4+13*8, 5+13*8, 4+14*8, 5+14*8
-        .byte           6+13*8, 7+13*8, 6+14*8, 7+14*8
-endconst
diff --git a/deps/libav/libavcodec/aarch64/h264qpel_init_aarch64.c b/deps/libav/libavcodec/aarch64/h264qpel_init_aarch64.c
deleted file mode 100644
index 4beb11b..0000000
--- a/deps/libav/libavcodec/aarch64/h264qpel_init_aarch64.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/aarch64/cpu.h"
-#include "libavcodec/h264qpel.h"
-
-void ff_put_h264_qpel16_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel16_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-
-void ff_put_h264_qpel8_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_h264_qpel8_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-
-void ff_avg_h264_qpel16_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel16_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-
-void ff_avg_h264_qpel8_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_h264_qpel8_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-
-av_cold void ff_h264qpel_init_aarch64(H264QpelContext *c, int bit_depth)
-{
-    const int high_bit_depth = bit_depth > 8;
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags) && !high_bit_depth) {
-        c->put_h264_qpel_pixels_tab[0][ 0] = ff_put_h264_qpel16_mc00_neon;
-        c->put_h264_qpel_pixels_tab[0][ 1] = ff_put_h264_qpel16_mc10_neon;
-        c->put_h264_qpel_pixels_tab[0][ 2] = ff_put_h264_qpel16_mc20_neon;
-        c->put_h264_qpel_pixels_tab[0][ 3] = ff_put_h264_qpel16_mc30_neon;
-        c->put_h264_qpel_pixels_tab[0][ 4] = ff_put_h264_qpel16_mc01_neon;
-        c->put_h264_qpel_pixels_tab[0][ 5] = ff_put_h264_qpel16_mc11_neon;
-        c->put_h264_qpel_pixels_tab[0][ 6] = ff_put_h264_qpel16_mc21_neon;
-        c->put_h264_qpel_pixels_tab[0][ 7] = ff_put_h264_qpel16_mc31_neon;
-        c->put_h264_qpel_pixels_tab[0][ 8] = ff_put_h264_qpel16_mc02_neon;
-        c->put_h264_qpel_pixels_tab[0][ 9] = ff_put_h264_qpel16_mc12_neon;
-        c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_neon;
-        c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_neon;
-        c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_neon;
-        c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_neon;
-        c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_neon;
-        c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_neon;
-
-        c->put_h264_qpel_pixels_tab[1][ 0] = ff_put_h264_qpel8_mc00_neon;
-        c->put_h264_qpel_pixels_tab[1][ 1] = ff_put_h264_qpel8_mc10_neon;
-        c->put_h264_qpel_pixels_tab[1][ 2] = ff_put_h264_qpel8_mc20_neon;
-        c->put_h264_qpel_pixels_tab[1][ 3] = ff_put_h264_qpel8_mc30_neon;
-        c->put_h264_qpel_pixels_tab[1][ 4] = ff_put_h264_qpel8_mc01_neon;
-        c->put_h264_qpel_pixels_tab[1][ 5] = ff_put_h264_qpel8_mc11_neon;
-        c->put_h264_qpel_pixels_tab[1][ 6] = ff_put_h264_qpel8_mc21_neon;
-        c->put_h264_qpel_pixels_tab[1][ 7] = ff_put_h264_qpel8_mc31_neon;
-        c->put_h264_qpel_pixels_tab[1][ 8] = ff_put_h264_qpel8_mc02_neon;
-        c->put_h264_qpel_pixels_tab[1][ 9] = ff_put_h264_qpel8_mc12_neon;
-        c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_neon;
-        c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_neon;
-        c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_neon;
-        c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_neon;
-        c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_neon;
-        c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_neon;
-
-        c->avg_h264_qpel_pixels_tab[0][ 0] = ff_avg_h264_qpel16_mc00_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 1] = ff_avg_h264_qpel16_mc10_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 2] = ff_avg_h264_qpel16_mc20_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 3] = ff_avg_h264_qpel16_mc30_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 4] = ff_avg_h264_qpel16_mc01_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 5] = ff_avg_h264_qpel16_mc11_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 6] = ff_avg_h264_qpel16_mc21_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 7] = ff_avg_h264_qpel16_mc31_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 8] = ff_avg_h264_qpel16_mc02_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 9] = ff_avg_h264_qpel16_mc12_neon;
-        c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_neon;
-        c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_neon;
-        c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_neon;
-        c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_neon;
-        c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_neon;
-        c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_neon;
-
-        c->avg_h264_qpel_pixels_tab[1][ 0] = ff_avg_h264_qpel8_mc00_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 1] = ff_avg_h264_qpel8_mc10_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 2] = ff_avg_h264_qpel8_mc20_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 3] = ff_avg_h264_qpel8_mc30_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 4] = ff_avg_h264_qpel8_mc01_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 5] = ff_avg_h264_qpel8_mc11_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 6] = ff_avg_h264_qpel8_mc21_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 7] = ff_avg_h264_qpel8_mc31_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 8] = ff_avg_h264_qpel8_mc02_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 9] = ff_avg_h264_qpel8_mc12_neon;
-        c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_neon;
-        c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_neon;
-        c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_neon;
-        c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_neon;
-        c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_neon;
-        c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/aarch64/h264qpel_neon.S b/deps/libav/libavcodec/aarch64/h264qpel_neon.S
deleted file mode 100644
index 731dc06..0000000
--- a/deps/libav/libavcodec/aarch64/h264qpel_neon.S
+++ /dev/null
@@ -1,934 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- * Copyright (c) 2013 Janne Grunau <janne-libav at jannau.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/aarch64/asm.S"
-#include "neon.S"
-
-        /* H.264 qpel MC */
-
-.macro  lowpass_const   r
-        movz            \r, #20, lsl #16
-        movk            \r, #5
-        mov             v6.S[0], \r
-.endm
-
-//trashes v0-v5
-.macro  lowpass_8       r0,  r1,  r2,  r3,  d0,  d1,  narrow=1
-        ext             v2.8B,      \r0\().8B, \r1\().8B, #2
-        ext             v3.8B,      \r0\().8B, \r1\().8B, #3
-        uaddl           v2.8H,      v2.8B,     v3.8B
-        ext             v4.8B,      \r0\().8B, \r1\().8B, #1
-        ext             v5.8B,      \r0\().8B, \r1\().8B, #4
-        uaddl           v4.8H,      v4.8B,     v5.8B
-        ext             v1.8B,      \r0\().8B, \r1\().8B, #5
-        uaddl           \d0\().8H,  \r0\().8B, v1.8B
-        ext             v0.8B,      \r2\().8B, \r3\().8B, #2
-        mla             \d0\().8H,  v2.8H,     v6.H[1]
-        ext             v1.8B,      \r2\().8B, \r3\().8B, #3
-        uaddl           v0.8H,      v0.8B,     v1.8B
-        ext             v1.8B,      \r2\().8B, \r3\().8B, #1
-        mls             \d0\().8H,  v4.8H,     v6.H[0]
-        ext             v3.8B,      \r2\().8B, \r3\().8B, #4
-        uaddl           v1.8H,      v1.8B,     v3.8B
-        ext             v2.8B,      \r2\().8B, \r3\().8B, #5
-        uaddl           \d1\().8H,  \r2\().8B, v2.8B
-        mla             \d1\().8H,  v0.8H,     v6.H[1]
-        mls             \d1\().8H,  v1.8H,     v6.H[0]
-  .if \narrow
-        sqrshrun        \d0\().8B,  \d0\().8H, #5
-        sqrshrun        \d1\().8B,  \d1\().8H, #5
-  .endif
-.endm
-
-//trashes v0-v5, v7, v30-v31
-.macro  lowpass_8H      r0,  r1
-        ext             v0.16B,     \r0\().16B, \r0\().16B, #2
-        ext             v1.16B,     \r0\().16B, \r0\().16B, #3
-        uaddl           v0.8H,      v0.8B,      v1.8B
-        ext             v2.16B,     \r0\().16B, \r0\().16B, #1
-        ext             v3.16B,     \r0\().16B, \r0\().16B, #4
-        uaddl           v2.8H,      v2.8B,      v3.8B
-        ext             v30.16B,    \r0\().16B, \r0\().16B, #5
-        uaddl           \r0\().8H,  \r0\().8B,  v30.8B
-        ext             v4.16B,     \r1\().16B, \r1\().16B, #2
-        mla             \r0\().8H,  v0.8H,      v6.H[1]
-        ext             v5.16B,     \r1\().16B, \r1\().16B, #3
-        uaddl           v4.8H,      v4.8B,      v5.8B
-        ext             v7.16B,     \r1\().16B, \r1\().16B, #1
-        mls             \r0\().8H,  v2.8H,      v6.H[0]
-        ext             v0.16B,     \r1\().16B, \r1\().16B, #4
-        uaddl           v7.8H,      v7.8B,      v0.8B
-        ext             v31.16B,    \r1\().16B, \r1\().16B, #5
-        uaddl           \r1\().8H,  \r1\().8B,  v31.8B
-        mla             \r1\().8H,  v4.8H,      v6.H[1]
-        mls             \r1\().8H,  v7.8H,      v6.H[0]
-.endm
-
-// trashes v2-v5, v30
-.macro  lowpass_8_1     r0,  r1,  d0,  narrow=1
-        ext             v2.8B,     \r0\().8B, \r1\().8B, #2
-        ext             v3.8B,     \r0\().8B, \r1\().8B, #3
-        uaddl           v2.8H,     v2.8B,     v3.8B
-        ext             v4.8B,     \r0\().8B, \r1\().8B, #1
-        ext             v5.8B,     \r0\().8B, \r1\().8B, #4
-        uaddl           v4.8H,     v4.8B,     v5.8B
-        ext             v30.8B,    \r0\().8B, \r1\().8B, #5
-        uaddl           \d0\().8H, \r0\().8B, v30.8B
-        mla             \d0\().8H, v2.8H,     v6.H[1]
-        mls             \d0\().8H, v4.8H,     v6.H[0]
-  .if \narrow
-        sqrshrun        \d0\().8B, \d0\().8H, #5
-  .endif
-.endm
-
-// trashed v0-v7
-.macro  lowpass_8.16    r0,  r1,  r2
-        ext             v1.16B,     \r0\().16B, \r1\().16B, #4
-        ext             v0.16B,     \r0\().16B, \r1\().16B, #6
-        saddl           v5.4S,      v1.4H,      v0.4H
-        ext             v2.16B,     \r0\().16B, \r1\().16B, #2
-        saddl2          v1.4S,      v1.8H,      v0.8H
-        ext             v3.16B,     \r0\().16B, \r1\().16B, #8
-        saddl           v6.4S,      v2.4H,      v3.4H
-        ext             \r1\().16B, \r0\().16B, \r1\().16B, #10
-        saddl2          v2.4S,      v2.8H,      v3.8H
-        saddl           v0.4S,      \r0\().4H,  \r1\().4H
-        saddl2          v4.4S,      \r0\().8H,  \r1\().8H
-
-        shl             v3.4S,  v5.4S,  #4
-        shl             v5.4S,  v5.4S,  #2
-        shl             v7.4S,  v6.4S,  #2
-        add             v5.4S,  v5.4S,  v3.4S
-        add             v6.4S,  v6.4S,  v7.4S
-
-        shl             v3.4S,  v1.4S,  #4
-        shl             v1.4S,  v1.4S,  #2
-        shl             v7.4S,  v2.4S,  #2
-        add             v1.4S,  v1.4S,  v3.4S
-        add             v2.4S,  v2.4S,  v7.4S
-
-        add             v5.4S,  v5.4S,  v0.4S
-        sub             v5.4S,  v5.4S,  v6.4S
-
-        add             v1.4S,  v1.4S,  v4.4S
-        sub             v1.4S,  v1.4S,  v2.4S
-
-        rshrn           v5.4H,  v5.4S,  #10
-        rshrn2          v5.8H,  v1.4S,  #10
-
-        sqxtun          \r2\().8B,  v5.8H
-.endm
-
-function put_h264_qpel16_h_lowpass_neon_packed
-        mov             x4,  x30
-        mov             x12, #16
-        mov             x3,  #8
-        bl              put_h264_qpel8_h_lowpass_neon
-        sub             x1,  x1,  x2, lsl #4
-        add             x1,  x1,  #8
-        mov             x12, #16
-        mov             x30, x4
-        b               put_h264_qpel8_h_lowpass_neon
-endfunc
-
-.macro  h264_qpel_h_lowpass type
-function \type\()_h264_qpel16_h_lowpass_neon
-        mov             x13, x30
-        mov             x12, #16
-        bl              \type\()_h264_qpel8_h_lowpass_neon
-        sub             x0,  x0,  x3, lsl #4
-        sub             x1,  x1,  x2, lsl #4
-        add             x0,  x0,  #8
-        add             x1,  x1,  #8
-        mov             x12, #16
-        mov             x30, x13
-endfunc
-
-function \type\()_h264_qpel8_h_lowpass_neon
-1:      ld1             {v28.8B, v29.8B}, [x1], x2
-        ld1             {v16.8B, v17.8B}, [x1], x2
-        subs            x12, x12, #2
-        lowpass_8       v28, v29, v16, v17, v28, v16
-  .ifc \type,avg
-        ld1             {v2.8B},    [x0], x3
-        urhadd          v28.8B, v28.8B,  v2.8B
-        ld1             {v3.8B},    [x0]
-        urhadd          v16.8B, v16.8B, v3.8B
-        sub             x0,  x0,  x3
-  .endif
-        st1             {v28.8B},    [x0], x3
-        st1             {v16.8B},    [x0], x3
-        b.ne            1b
-        ret
-endfunc
-.endm
-
-        h264_qpel_h_lowpass put
-        h264_qpel_h_lowpass avg
-
-.macro  h264_qpel_h_lowpass_l2 type
-function \type\()_h264_qpel16_h_lowpass_l2_neon
-        mov             x13, x30
-        mov             x12, #16
-        bl              \type\()_h264_qpel8_h_lowpass_l2_neon
-        sub             x0,  x0,  x2, lsl #4
-        sub             x1,  x1,  x2, lsl #4
-        sub             x3,  x3,  x2, lsl #4
-        add             x0,  x0,  #8
-        add             x1,  x1,  #8
-        add             x3,  x3,  #8
-        mov             x12, #16
-        mov             x30, x13
-endfunc
-
-function \type\()_h264_qpel8_h_lowpass_l2_neon
-1:      ld1             {v26.8B, v27.8B}, [x1], x2
-        ld1             {v16.8B, v17.8B}, [x1], x2
-        ld1             {v28.8B},     [x3], x2
-        ld1             {v29.8B},     [x3], x2
-        subs            x12, x12, #2
-        lowpass_8       v26, v27, v16, v17, v26, v27
-        urhadd          v26.8B, v26.8B, v28.8B
-        urhadd          v27.8B, v27.8B, v29.8B
-  .ifc \type,avg
-        ld1             {v2.8B},      [x0], x2
-        urhadd          v26.8B, v26.8B, v2.8B
-        ld1             {v3.8B},      [x0]
-        urhadd          v27.8B, v27.8B, v3.8B
-        sub             x0,  x0,  x2
-  .endif
-        st1             {v26.8B},     [x0], x2
-        st1             {v27.8B},     [x0], x2
-        b.ne            1b
-        ret
-endfunc
-.endm
-
-        h264_qpel_h_lowpass_l2 put
-        h264_qpel_h_lowpass_l2 avg
-
-function put_h264_qpel16_v_lowpass_neon_packed
-        mov             x4,  x30
-        mov             x2,  #8
-        bl              put_h264_qpel8_v_lowpass_neon
-        sub             x1,  x1,  x3, lsl #2
-        bl              put_h264_qpel8_v_lowpass_neon
-        sub             x1,  x1,  x3, lsl #4
-        sub             x1,  x1,  x3, lsl #2
-        add             x1,  x1,  #8
-        bl              put_h264_qpel8_v_lowpass_neon
-        sub             x1,  x1,  x3, lsl #2
-        mov             x30, x4
-        b               put_h264_qpel8_v_lowpass_neon
-endfunc
-
-.macro  h264_qpel_v_lowpass type
-function \type\()_h264_qpel16_v_lowpass_neon
-        mov             x4,  x30
-        bl              \type\()_h264_qpel8_v_lowpass_neon
-        sub             x1,  x1,  x3, lsl #2
-        bl              \type\()_h264_qpel8_v_lowpass_neon
-        sub             x0,  x0,  x2, lsl #4
-        add             x0,  x0,  #8
-        sub             x1,  x1,  x3, lsl #4
-        sub             x1,  x1,  x3, lsl #2
-        add             x1,  x1,  #8
-        bl              \type\()_h264_qpel8_v_lowpass_neon
-        sub             x1,  x1,  x3, lsl #2
-        mov             x30, x4
-endfunc
-
-function \type\()_h264_qpel8_v_lowpass_neon
-        ld1             {v16.8B}, [x1], x3
-        ld1             {v18.8B}, [x1], x3
-        ld1             {v20.8B}, [x1], x3
-        ld1             {v22.8B}, [x1], x3
-        ld1             {v24.8B}, [x1], x3
-        ld1             {v26.8B}, [x1], x3
-        ld1             {v28.8B}, [x1], x3
-        ld1             {v30.8B}, [x1], x3
-        ld1             {v17.8B}, [x1], x3
-        ld1             {v19.8B}, [x1], x3
-        ld1             {v21.8B}, [x1], x3
-        ld1             {v23.8B}, [x1], x3
-        ld1             {v25.8B}, [x1]
-
-        transpose_8x8B  v16, v18, v20, v22, v24, v26, v28, v30, v0,  v1
-        transpose_8x8B  v17, v19, v21, v23, v25, v27, v29, v31, v0,  v1
-        lowpass_8       v16, v17, v18, v19, v16, v17
-        lowpass_8       v20, v21, v22, v23, v18, v19
-        lowpass_8       v24, v25, v26, v27, v20, v21
-        lowpass_8       v28, v29, v30, v31, v22, v23
-        transpose_8x8B  v16, v17, v18, v19, v20, v21, v22, v23, v0,  v1
-
-  .ifc \type,avg
-        ld1             {v24.8B},  [x0], x2
-        urhadd          v16.8B, v16.8B, v24.8B
-        ld1             {v25.8B}, [x0], x2
-        urhadd          v17.8B, v17.8B, v25.8B
-        ld1             {v26.8B}, [x0], x2
-        urhadd          v18.8B, v18.8B, v26.8B
-        ld1             {v27.8B}, [x0], x2
-        urhadd          v19.8B, v19.8B, v27.8B
-        ld1             {v28.8B}, [x0], x2
-        urhadd          v20.8B, v20.8B, v28.8B
-        ld1             {v29.8B}, [x0], x2
-        urhadd          v21.8B, v21.8B, v29.8B
-        ld1             {v30.8B}, [x0], x2
-        urhadd          v22.8B, v22.8B, v30.8B
-        ld1             {v31.8B}, [x0], x2
-        urhadd          v23.8B, v23.8B, v31.8B
-        sub             x0,  x0,  x2,  lsl #3
-  .endif
-
-        st1             {v16.8B}, [x0], x2
-        st1             {v17.8B}, [x0], x2
-        st1             {v18.8B}, [x0], x2
-        st1             {v19.8B}, [x0], x2
-        st1             {v20.8B}, [x0], x2
-        st1             {v21.8B}, [x0], x2
-        st1             {v22.8B}, [x0], x2
-        st1             {v23.8B}, [x0], x2
-
-        ret
-endfunc
-.endm
-
-        h264_qpel_v_lowpass put
-        h264_qpel_v_lowpass avg
-
-.macro  h264_qpel_v_lowpass_l2 type
-function \type\()_h264_qpel16_v_lowpass_l2_neon
-        mov             x4,  x30
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        sub             x1,  x1,  x3, lsl #2
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        sub             x0,  x0,  x3, lsl #4
-        sub             x12, x12, x2, lsl #4
-        add             x0,  x0,  #8
-        add             x12, x12, #8
-        sub             x1,  x1,  x3, lsl #4
-        sub             x1,  x1,  x3, lsl #2
-        add             x1,  x1,  #8
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        sub             x1,  x1,  x3, lsl #2
-        mov             x30, x4
-endfunc
-
-function \type\()_h264_qpel8_v_lowpass_l2_neon
-        ld1             {v16.8B}, [x1], x3
-        ld1             {v18.8B}, [x1], x3
-        ld1             {v20.8B}, [x1], x3
-        ld1             {v22.8B}, [x1], x3
-        ld1             {v24.8B}, [x1], x3
-        ld1             {v26.8B}, [x1], x3
-        ld1             {v28.8B}, [x1], x3
-        ld1             {v30.8B}, [x1], x3
-        ld1             {v17.8B}, [x1], x3
-        ld1             {v19.8B}, [x1], x3
-        ld1             {v21.8B}, [x1], x3
-        ld1             {v23.8B}, [x1], x3
-        ld1             {v25.8B}, [x1]
-
-        transpose_8x8B  v16, v18, v20, v22, v24, v26, v28, v30, v0,  v1
-        transpose_8x8B  v17, v19, v21, v23, v25, v27, v29, v31, v0,  v1
-        lowpass_8       v16, v17, v18, v19, v16, v17
-        lowpass_8       v20, v21, v22, v23, v18, v19
-        lowpass_8       v24, v25, v26, v27, v20, v21
-        lowpass_8       v28, v29, v30, v31, v22, v23
-        transpose_8x8B  v16, v17, v18, v19, v20, v21, v22, v23, v0,  v1
-
-        ld1             {v24.8B},  [x12], x2
-        ld1             {v25.8B},  [x12], x2
-        ld1             {v26.8B},  [x12], x2
-        ld1             {v27.8B},  [x12], x2
-        ld1             {v28.8B},  [x12], x2
-        urhadd          v16.8B, v24.8B, v16.8B
-        urhadd          v17.8B, v25.8B, v17.8B
-        ld1             {v29.8B},  [x12], x2
-        urhadd          v18.8B, v26.8B, v18.8B
-        urhadd          v19.8B, v27.8B, v19.8B
-        ld1             {v30.8B}, [x12], x2
-        urhadd          v20.8B, v28.8B, v20.8B
-        urhadd          v21.8B, v29.8B, v21.8B
-        ld1             {v31.8B}, [x12], x2
-        urhadd          v22.8B, v30.8B, v22.8B
-        urhadd          v23.8B, v31.8B, v23.8B
-
-  .ifc \type,avg
-        ld1             {v24.8B}, [x0], x3
-        urhadd          v16.8B, v16.8B, v24.8B
-        ld1             {v25.8B}, [x0], x3
-        urhadd          v17.8B, v17.8B, v25.8B
-        ld1             {v26.8B}, [x0], x3
-        urhadd          v18.8B, v18.8B, v26.8B
-        ld1             {v27.8B}, [x0], x3
-        urhadd          v19.8B, v19.8B, v27.8B
-        ld1             {v28.8B}, [x0], x3
-        urhadd          v20.8B, v20.8B, v28.8B
-        ld1             {v29.8B}, [x0], x3
-        urhadd          v21.8B, v21.8B, v29.8B
-        ld1             {v30.8B}, [x0], x3
-        urhadd          v22.8B, v22.8B, v30.8B
-        ld1             {v31.8B}, [x0], x3
-        urhadd          v23.8B, v23.8B, v31.8B
-        sub             x0,  x0,  x3,  lsl #3
-  .endif
-
-        st1             {v16.8B}, [x0], x3
-        st1             {v17.8B}, [x0], x3
-        st1             {v18.8B}, [x0], x3
-        st1             {v19.8B}, [x0], x3
-        st1             {v20.8B}, [x0], x3
-        st1             {v21.8B}, [x0], x3
-        st1             {v22.8B}, [x0], x3
-        st1             {v23.8B}, [x0], x3
-
-        ret
-endfunc
-.endm
-
-        h264_qpel_v_lowpass_l2 put
-        h264_qpel_v_lowpass_l2 avg
-
-function put_h264_qpel8_hv_lowpass_neon_top
-        lowpass_const   w12
-        ld1             {v16.8H}, [x1], x3
-        ld1             {v17.8H}, [x1], x3
-        ld1             {v18.8H}, [x1], x3
-        ld1             {v19.8H}, [x1], x3
-        ld1             {v20.8H}, [x1], x3
-        ld1             {v21.8H}, [x1], x3
-        ld1             {v22.8H}, [x1], x3
-        ld1             {v23.8H}, [x1], x3
-        ld1             {v24.8H}, [x1], x3
-        ld1             {v25.8H}, [x1], x3
-        ld1             {v26.8H}, [x1], x3
-        ld1             {v27.8H}, [x1], x3
-        ld1             {v28.8H}, [x1]
-        lowpass_8H      v16, v17
-        lowpass_8H      v18, v19
-        lowpass_8H      v20, v21
-        lowpass_8H      v22, v23
-        lowpass_8H      v24, v25
-        lowpass_8H      v26, v27
-        lowpass_8H      v28, v29
-
-        transpose_8x8H  v16, v17, v18, v19, v20, v21, v22, v23, v0,  v1
-        transpose_8x8H  v24, v25, v26, v27, v28, v29, v30, v31, v0,  v1
-
-        lowpass_8.16    v16, v24, v16
-        lowpass_8.16    v17, v25, v17
-
-        lowpass_8.16    v18, v26, v18
-        lowpass_8.16    v19, v27, v19
-
-        lowpass_8.16    v20, v28, v20
-        lowpass_8.16    v21, v29, v21
-
-        lowpass_8.16    v22, v30, v22
-        lowpass_8.16    v23, v31, v23
-
-        transpose_8x8B v16, v17, v18, v19, v20, v21, v22, v23, v0,  v1
-
-        ret
-endfunc
-
-.macro  h264_qpel8_hv_lowpass type
-function \type\()_h264_qpel8_hv_lowpass_neon
-        mov             x10, x30
-        bl              put_h264_qpel8_hv_lowpass_neon_top
-  .ifc \type,avg
-        ld1             {v0.8B},      [x0], x2
-        urhadd          v16.8B, v16.8B, v0.8B
-        ld1             {v1.8B},      [x0], x2
-        urhadd          v17.8B, v17.8B, v1.8B
-        ld1             {v2.8B},      [x0], x2
-        urhadd          v18.8B, v18.8B, v2.8B
-        ld1             {v3.8B},      [x0], x2
-        urhadd          v19.8B, v19.8B, v3.8B
-        ld1             {v4.8B},      [x0], x2
-        urhadd          v20.8B, v20.8B, v4.8B
-        ld1             {v5.8B},      [x0], x2
-        urhadd          v21.8B, v21.8B, v5.8B
-        ld1             {v6.8B},      [x0], x2
-        urhadd          v22.8B, v22.8B, v6.8B
-        ld1             {v7.8B},      [x0], x2
-        urhadd          v23.8B, v23.8B, v7.8B
-        sub             x0,  x0,  x2,  lsl #3
-  .endif
-
-        st1             {v16.8B},     [x0], x2
-        st1             {v17.8B},     [x0], x2
-        st1             {v18.8B},     [x0], x2
-        st1             {v19.8B},     [x0], x2
-        st1             {v20.8B},     [x0], x2
-        st1             {v21.8B},     [x0], x2
-        st1             {v22.8B},     [x0], x2
-        st1             {v23.8B},     [x0], x2
-
-        ret             x10
-endfunc
-.endm
-
-        h264_qpel8_hv_lowpass put
-        h264_qpel8_hv_lowpass avg
-
-.macro  h264_qpel8_hv_lowpass_l2 type
-function \type\()_h264_qpel8_hv_lowpass_l2_neon
-        mov             x10, x30
-        bl              put_h264_qpel8_hv_lowpass_neon_top
-
-        ld1             {v0.8B, v1.8B},  [x2], #16
-        ld1             {v2.8B, v3.8B},  [x2], #16
-        urhadd          v0.8B,  v0.8B,  v16.8B
-        urhadd          v1.8B,  v1.8B,  v17.8B
-        ld1             {v4.8B, v5.8B},  [x2], #16
-        urhadd          v2.8B,  v2.8B,  v18.8B
-        urhadd          v3.8B,  v3.8B,  v19.8B
-        ld1             {v6.8B, v7.8B},  [x2], #16
-        urhadd          v4.8B,  v4.8B,  v20.8B
-        urhadd          v5.8B,  v5.8B,  v21.8B
-        urhadd          v6.8B,  v6.8B,  v22.8B
-        urhadd          v7.8B,  v7.8B,  v23.8B
-  .ifc \type,avg
-        ld1             {v16.8B},     [x0], x3
-        urhadd          v0.8B,  v0.8B,  v16.8B
-        ld1             {v17.8B},     [x0], x3
-        urhadd          v1.8B,  v1.8B,  v17.8B
-        ld1             {v18.8B},     [x0], x3
-        urhadd          v2.8B,  v2.8B,  v18.8B
-        ld1             {v19.8B},     [x0], x3
-        urhadd          v3.8B,  v3.8B,  v19.8B
-        ld1             {v20.8B},     [x0], x3
-        urhadd          v4.8B,  v4.8B,  v20.8B
-        ld1             {v21.8B},     [x0], x3
-        urhadd          v5.8B,  v5.8B,  v21.8B
-        ld1             {v22.8B},     [x0], x3
-        urhadd          v6.8B,  v6.8B,  v22.8B
-        ld1             {v23.8B},     [x0], x3
-        urhadd          v7.8B,  v7.8B,  v23.8B
-        sub             x0,  x0,  x3,  lsl #3
-  .endif
-        st1             {v0.8B},      [x0], x3
-        st1             {v1.8B},      [x0], x3
-        st1             {v2.8B},      [x0], x3
-        st1             {v3.8B},      [x0], x3
-        st1             {v4.8B},      [x0], x3
-        st1             {v5.8B},      [x0], x3
-        st1             {v6.8B},      [x0], x3
-        st1             {v7.8B},      [x0], x3
-
-        ret             x10
-endfunc
-.endm
-
-        h264_qpel8_hv_lowpass_l2 put
-        h264_qpel8_hv_lowpass_l2 avg
-
-.macro  h264_qpel16_hv  type
-function \type\()_h264_qpel16_hv_lowpass_neon
-        mov             x13, x30
-        bl              \type\()_h264_qpel8_hv_lowpass_neon
-        sub             x1,  x1,  x3, lsl #2
-        bl              \type\()_h264_qpel8_hv_lowpass_neon
-        sub             x1,  x1,  x3, lsl #4
-        sub             x1,  x1,  x3, lsl #2
-        add             x1,  x1,  #8
-        sub             x0,  x0,  x2, lsl #4
-        add             x0,  x0,  #8
-        bl              \type\()_h264_qpel8_hv_lowpass_neon
-        sub             x1,  x1,  x3, lsl #2
-        mov             x30, x13
-        b               \type\()_h264_qpel8_hv_lowpass_neon
-endfunc
-
-function \type\()_h264_qpel16_hv_lowpass_l2_neon
-        mov             x13, x30
-        sub             x2,  x4,  #256
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        sub             x1,  x1,  x3, lsl #2
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        sub             x1,  x1,  x3, lsl #4
-        sub             x1,  x1,  x3, lsl #2
-        add             x1,  x1,  #8
-        sub             x0,  x0,  x3, lsl #4
-        add             x0,  x0,  #8
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        sub             x1,  x1,  x3, lsl #2
-        mov             x30, x13
-        b               \type\()_h264_qpel8_hv_lowpass_l2_neon
-endfunc
-.endm
-
-        h264_qpel16_hv put
-        h264_qpel16_hv avg
-
-.macro  h264_qpel8      type
-function ff_\type\()_h264_qpel8_mc10_neon, export=1
-        lowpass_const   w3
-        mov             x3,  x1
-        sub             x1,  x1,  #2
-        mov             x12, #8
-        b               \type\()_h264_qpel8_h_lowpass_l2_neon
-endfunc
-
-function ff_\type\()_h264_qpel8_mc20_neon, export=1
-        lowpass_const   w3
-        sub             x1,  x1,  #2
-        mov             x3,  x2
-        mov             x12, #8
-        b               \type\()_h264_qpel8_h_lowpass_neon
-endfunc
-
-function ff_\type\()_h264_qpel8_mc30_neon, export=1
-        lowpass_const   w3
-        add             x3,  x1,  #1
-        sub             x1,  x1,  #2
-        mov             x12, #8
-        b               \type\()_h264_qpel8_h_lowpass_l2_neon
-endfunc
-
-function ff_\type\()_h264_qpel8_mc01_neon, export=1
-        mov             x14, x30
-        mov             x12, x1
-\type\()_h264_qpel8_mc01:
-        lowpass_const   w3
-        mov             x3,  x2
-        sub             x1,  x1,  x2, lsl #1
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel8_mc11_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-\type\()_h264_qpel8_mc11:
-        lowpass_const   w3
-        mov             x11, sp
-        sub             sp,  sp,  #64
-        mov             x0,  sp
-        sub             x1,  x1,  #2
-        mov             x3,  #8
-        mov             x12, #8
-        bl              put_h264_qpel8_h_lowpass_neon
-        mov             x0,  x8
-        mov             x3,  x2
-        mov             x12, sp
-        sub             x1,  x9,  x2, lsl #1
-        mov             x2,  #8
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        mov             sp,  x11
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel8_mc21_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-\type\()_h264_qpel8_mc21:
-        lowpass_const   w3
-        mov             x11, sp
-        sub             sp,  sp,  #(8*8+16*12)
-        sub             x1,  x1,  #2
-        mov             x3,  #8
-        mov             x0,  sp
-        mov             x12, #8
-        bl              put_h264_qpel8_h_lowpass_neon
-        mov             x4,  x0
-        mov             x0,  x8
-        sub             x1,  x9,  x2, lsl #1
-        sub             x1,  x1,  #2
-        mov             x3,  x2
-        sub             x2,  x4,  #64
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        mov             sp,  x11
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel8_mc31_neon, export=1
-        add             x1,  x1,  #1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        sub             x1,  x1,  #1
-        b               \type\()_h264_qpel8_mc11
-endfunc
-
-function ff_\type\()_h264_qpel8_mc02_neon, export=1
-        mov             x14, x30
-        lowpass_const   w3
-        sub             x1,  x1,  x2, lsl #1
-        mov             x3,  x2
-        bl              \type\()_h264_qpel8_v_lowpass_neon
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel8_mc12_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-\type\()_h264_qpel8_mc12:
-        lowpass_const   w3
-        mov             x11, sp
-        sub             sp,  sp,  #(8*8+16*12)
-        sub             x1,  x1,  x2, lsl #1
-        mov             x3,  x2
-        mov             x2,  #8
-        mov             x0,  sp
-        bl              put_h264_qpel8_v_lowpass_neon
-        mov             x4,  x0
-        mov             x0,  x8
-        sub             x1,  x9,  x3, lsl #1
-        sub             x1,  x1,  #2
-        sub             x2,  x4,  #64
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        mov             sp,  x11
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel8_mc22_neon, export=1
-        mov             x14, x30
-        mov             x11, sp
-        sub             x1,  x1,  x2, lsl #1
-        sub             x1,  x1,  #2
-        mov             x3,  x2
-        bl              \type\()_h264_qpel8_hv_lowpass_neon
-        mov             sp,  x11
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel8_mc32_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        add             x1,  x1,  #1
-        b               \type\()_h264_qpel8_mc12
-endfunc
-
-function ff_\type\()_h264_qpel8_mc03_neon, export=1
-        mov             x14, x30
-        add             x12, x1,  x2
-        b               \type\()_h264_qpel8_mc01
-endfunc
-
-function ff_\type\()_h264_qpel8_mc13_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        add             x1,  x1,  x2
-        b               \type\()_h264_qpel8_mc11
-endfunc
-
-function ff_\type\()_h264_qpel8_mc23_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        add             x1,  x1,  x2
-        b               \type\()_h264_qpel8_mc21
-endfunc
-
-function ff_\type\()_h264_qpel8_mc33_neon, export=1
-        add             x1,  x1,  #1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        add             x1,  x1,  x2
-        sub             x1,  x1,  #1
-        b               \type\()_h264_qpel8_mc11
-endfunc
-.endm
-
-        h264_qpel8 put
-        h264_qpel8 avg
-
-.macro  h264_qpel16     type
-function ff_\type\()_h264_qpel16_mc10_neon, export=1
-        lowpass_const   w3
-        mov             x3,  x1
-        sub             x1,  x1,  #2
-        b               \type\()_h264_qpel16_h_lowpass_l2_neon
-endfunc
-
-function ff_\type\()_h264_qpel16_mc20_neon, export=1
-        lowpass_const   w3
-        sub             x1,  x1,  #2
-        mov             x3,  x2
-        b               \type\()_h264_qpel16_h_lowpass_neon
-endfunc
-
-function ff_\type\()_h264_qpel16_mc30_neon, export=1
-        lowpass_const   w3
-        add             x3,  x1,  #1
-        sub             x1,  x1,  #2
-        b               \type\()_h264_qpel16_h_lowpass_l2_neon
-endfunc
-
-function ff_\type\()_h264_qpel16_mc01_neon, export=1
-        mov             x14, x30
-        mov             x12, x1
-\type\()_h264_qpel16_mc01:
-        lowpass_const   w3
-        mov             x3,  x2
-        sub             x1,  x1,  x2, lsl #1
-        bl              \type\()_h264_qpel16_v_lowpass_l2_neon
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel16_mc11_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-\type\()_h264_qpel16_mc11:
-        lowpass_const   w3
-        mov             x11, sp
-        sub             sp,  sp,  #256
-        mov             x0,  sp
-        sub             x1,  x1,  #2
-        mov             x3,  #16
-        bl              put_h264_qpel16_h_lowpass_neon
-        mov             x0,  x8
-        mov             x3,  x2
-        mov             x12, sp
-        sub             x1,  x9,  x2, lsl #1
-        mov             x2,  #16
-        bl              \type\()_h264_qpel16_v_lowpass_l2_neon
-        mov             sp,  x11
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel16_mc21_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-\type\()_h264_qpel16_mc21:
-        lowpass_const   w3
-        mov             x11, sp
-        sub             sp,  sp,  #(16*16+16*12)
-        sub             x1,  x1,  #2
-        mov             x0,  sp
-        bl              put_h264_qpel16_h_lowpass_neon_packed
-        mov             x4,  x0
-        mov             x0,  x8
-        sub             x1,  x9,  x2, lsl #1
-        sub             x1,  x1,  #2
-        mov             x3,  x2
-        bl              \type\()_h264_qpel16_hv_lowpass_l2_neon
-        mov             sp,  x11
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel16_mc31_neon, export=1
-        add             x1,  x1,  #1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        sub             x1,  x1,  #1
-        b               \type\()_h264_qpel16_mc11
-endfunc
-
-function ff_\type\()_h264_qpel16_mc02_neon, export=1
-        mov             x14, x30
-        lowpass_const   w3
-        sub             x1,  x1,  x2, lsl #1
-        mov             x3,  x2
-        bl              \type\()_h264_qpel16_v_lowpass_neon
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel16_mc12_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-\type\()_h264_qpel16_mc12:
-        lowpass_const   w3
-        mov             x11, sp
-        sub             sp,  sp,  #(16*16+16*12)
-        sub             x1,  x1,  x2, lsl #1
-        mov             x0,  sp
-        mov             x3,  x2
-        bl              put_h264_qpel16_v_lowpass_neon_packed
-        mov             x4,  x0
-        mov             x0,  x8
-        sub             x1,  x9,  x3, lsl #1
-        sub             x1,  x1,  #2
-        mov             x2,  x3
-        bl              \type\()_h264_qpel16_hv_lowpass_l2_neon
-        mov             sp,  x11
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel16_mc22_neon, export=1
-        mov             x14, x30
-        lowpass_const   w3
-        mov             x11, sp
-        sub             x1,  x1,  x2, lsl #1
-        sub             x1,  x1,  #2
-        mov             x3,  x2
-        bl              \type\()_h264_qpel16_hv_lowpass_neon
-        mov             sp,  x11 // restore stack
-        ret             x14
-endfunc
-
-function ff_\type\()_h264_qpel16_mc32_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        add             x1,  x1,  #1
-        b               \type\()_h264_qpel16_mc12
-endfunc
-
-function ff_\type\()_h264_qpel16_mc03_neon, export=1
-        mov             x14, x30
-        add             x12, x1,  x2
-        b               \type\()_h264_qpel16_mc01
-endfunc
-
-function ff_\type\()_h264_qpel16_mc13_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        add             x1,  x1,  x2
-        b               \type\()_h264_qpel16_mc11
-endfunc
-
-function ff_\type\()_h264_qpel16_mc23_neon, export=1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        add             x1,  x1,  x2
-        b               \type\()_h264_qpel16_mc21
-endfunc
-
-function ff_\type\()_h264_qpel16_mc33_neon, export=1
-        add             x1,  x1,  #1
-        mov             x14, x30
-        mov             x8,  x0
-        mov             x9,  x1
-        add             x1,  x1,  x2
-        sub             x1,  x1,  #1
-        b               \type\()_h264_qpel16_mc11
-endfunc
-.endm
-
-        h264_qpel16 put
-        h264_qpel16 avg
diff --git a/deps/libav/libavcodec/aarch64/hpeldsp_init_aarch64.c b/deps/libav/libavcodec/aarch64/hpeldsp_init_aarch64.c
deleted file mode 100644
index 6bc4c09..0000000
--- a/deps/libav/libavcodec/aarch64/hpeldsp_init_aarch64.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "config.h"
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/aarch64/cpu.h"
-#include "libavcodec/hpeldsp.h"
-
-void     ff_put_pixels16_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void  ff_put_pixels16_x2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void  ff_put_pixels16_y2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void ff_put_pixels16_xy2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void      ff_put_pixels8_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void   ff_put_pixels8_x2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void   ff_put_pixels8_y2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void  ff_put_pixels8_xy2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-
-void  ff_put_pixels16_x2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-void  ff_put_pixels16_y2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-void ff_put_pixels16_xy2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-void   ff_put_pixels8_x2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-void   ff_put_pixels8_y2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-void  ff_put_pixels8_xy2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-
-void     ff_avg_pixels16_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void  ff_avg_pixels16_x2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void  ff_avg_pixels16_y2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void ff_avg_pixels16_xy2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void      ff_avg_pixels8_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void   ff_avg_pixels8_x2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void   ff_avg_pixels8_y2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void  ff_avg_pixels8_xy2_neon(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-
-void  ff_avg_pixels16_x2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-void  ff_avg_pixels16_y2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-void ff_avg_pixels16_xy2_no_rnd_neon(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-
-av_cold void ff_hpeldsp_init_aarch64(HpelDSPContext *c, int flags)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        c->put_pixels_tab[0][0] = ff_put_pixels16_neon;
-        c->put_pixels_tab[0][1] = ff_put_pixels16_x2_neon;
-        c->put_pixels_tab[0][2] = ff_put_pixels16_y2_neon;
-        c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_neon;
-        c->put_pixels_tab[1][0] = ff_put_pixels8_neon;
-        c->put_pixels_tab[1][1] = ff_put_pixels8_x2_neon;
-        c->put_pixels_tab[1][2] = ff_put_pixels8_y2_neon;
-        c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_neon;
-
-        c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_neon;
-        c->put_no_rnd_pixels_tab[0][1] = ff_put_pixels16_x2_no_rnd_neon;
-        c->put_no_rnd_pixels_tab[0][2] = ff_put_pixels16_y2_no_rnd_neon;
-        c->put_no_rnd_pixels_tab[0][3] = ff_put_pixels16_xy2_no_rnd_neon;
-        c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_neon;
-        c->put_no_rnd_pixels_tab[1][1] = ff_put_pixels8_x2_no_rnd_neon;
-        c->put_no_rnd_pixels_tab[1][2] = ff_put_pixels8_y2_no_rnd_neon;
-        c->put_no_rnd_pixels_tab[1][3] = ff_put_pixels8_xy2_no_rnd_neon;
-
-        c->avg_pixels_tab[0][0] = ff_avg_pixels16_neon;
-        c->avg_pixels_tab[0][1] = ff_avg_pixels16_x2_neon;
-        c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_neon;
-        c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_neon;
-        c->avg_pixels_tab[1][0] = ff_avg_pixels8_neon;
-        c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_neon;
-        c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_neon;
-        c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_neon;
-
-        c->avg_no_rnd_pixels_tab[0] = ff_avg_pixels16_neon;
-        c->avg_no_rnd_pixels_tab[1] = ff_avg_pixels16_x2_no_rnd_neon;
-        c->avg_no_rnd_pixels_tab[2] = ff_avg_pixels16_y2_no_rnd_neon;
-        c->avg_no_rnd_pixels_tab[3] = ff_avg_pixels16_xy2_no_rnd_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/aarch64/hpeldsp_neon.S b/deps/libav/libavcodec/aarch64/hpeldsp_neon.S
deleted file mode 100644
index 2978290..0000000
--- a/deps/libav/libavcodec/aarch64/hpeldsp_neon.S
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- * Copyright (c) 2013 Janne Grunau <janne-libav at jannau.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/aarch64/asm.S"
-
-.macro  pixels16        rnd=1, avg=0
-  .if \avg
-        mov             x12, x0
-  .endif
-1:      ld1             {v0.16B},  [x1], x2
-        ld1             {v1.16B},  [x1], x2
-        ld1             {v2.16B},  [x1], x2
-        ld1             {v3.16B},  [x1], x2
-  .if \avg
-        ld1             {v4.16B},  [x12], x2
-        urhadd          v0.16B,  v0.16B,  v4.16B
-        ld1             {v5.16B},  [x12], x2
-        urhadd          v1.16B,  v1.16B,  v5.16B
-        ld1             {v6.16B},  [x12], x2
-        urhadd          v2.16B,  v2.16B,  v6.16B
-        ld1             {v7.16B},  [x12], x2
-        urhadd          v3.16B,  v3.16B,  v7.16B
-  .endif
-        subs            w3,  w3,  #4
-        st1             {v0.16B},  [x0], x2
-        st1             {v1.16B},  [x0], x2
-        st1             {v2.16B},  [x0], x2
-        st1             {v3.16B},  [x0], x2
-        b.ne            1b
-        ret
-.endm
-
-.macro  pixels16_x2     rnd=1, avg=0
-1:      ld1             {v0.16B, v1.16B}, [x1], x2
-        ld1             {v2.16B, v3.16B}, [x1], x2
-        subs            w3,  w3,  #2
-        ext             v1.16B,  v0.16B,  v1.16B,  #1
-        avg             v0.16B,  v0.16B,  v1.16B
-        ext             v3.16B,  v2.16B,  v3.16B,  #1
-        avg             v2.16B,  v2.16B,  v3.16B
-  .if \avg
-        ld1             {v1.16B}, [x0], x2
-        ld1             {v3.16B}, [x0]
-        urhadd          v0.16B,  v0.16B,  v1.16B
-        urhadd          v2.16B,  v2.16B,  v3.16B
-        sub             x0,  x0,  x2
-  .endif
-        st1             {v0.16B}, [x0], x2
-        st1             {v2.16B}, [x0], x2
-        b.ne            1b
-        ret
-.endm
-
-.macro  pixels16_y2     rnd=1, avg=0
-        sub             w3,  w3,  #2
-        ld1             {v0.16B}, [x1], x2
-        ld1             {v1.16B}, [x1], x2
-1:      subs            w3,  w3,  #2
-        avg             v2.16B,  v0.16B,  v1.16B
-        ld1             {v0.16B}, [x1], x2
-        avg             v3.16B,  v0.16B,  v1.16B
-        ld1             {v1.16B}, [x1], x2
-  .if \avg
-        ld1             {v4.16B}, [x0], x2
-        ld1             {v5.16B}, [x0]
-        urhadd          v2.16B,  v2.16B,  v4.16B
-        urhadd          v3.16B,  v3.16B,  v5.16B
-        sub             x0,  x0,  x2
-  .endif
-        st1             {v2.16B}, [x0], x2
-        st1             {v3.16B}, [x0], x2
-        b.ne            1b
-
-        avg             v2.16B,  v0.16B,  v1.16B
-        ld1             {v0.16B}, [x1], x2
-        avg             v3.16B,  v0.16B,  v1.16B
-  .if \avg
-        ld1             {v4.16B}, [x0], x2
-        ld1             {v5.16B}, [x0]
-        urhadd          v2.16B,  v2.16B,  v4.16B
-        urhadd          v3.16B,  v3.16B,  v5.16B
-        sub             x0,  x0,  x2
-  .endif
-        st1             {v2.16B},     [x0], x2
-        st1             {v3.16B},     [x0], x2
-
-        ret
-.endm
-
-.macro  pixels16_xy2    rnd=1, avg=0
-        sub             w3,  w3,  #2
-        ld1             {v0.16B, v1.16B}, [x1], x2
-        ld1             {v4.16B, v5.16B}, [x1], x2
-NRND    movi            v26.8H, #1
-        ext             v1.16B,  v0.16B,  v1.16B,  #1
-        ext             v5.16B,  v4.16B,  v5.16B,  #1
-        uaddl           v16.8H,  v0.8B,   v1.8B
-        uaddl2          v20.8H,  v0.16B,  v1.16B
-        uaddl           v18.8H,  v4.8B,   v5.8B
-        uaddl2          v22.8H,  v4.16B,  v5.16B
-1:      subs            w3,  w3,  #2
-        ld1             {v0.16B, v1.16B}, [x1], x2
-        add             v24.8H,  v16.8H,  v18.8H
-NRND    add             v24.8H,  v24.8H,  v26.8H
-        ext             v30.16B, v0.16B,  v1.16B,  #1
-        add             v1.8H,   v20.8H,  v22.8H
-        mshrn           v28.8B,  v24.8H,  #2
-NRND    add             v1.8H,   v1.8H,   v26.8H
-        mshrn2          v28.16B, v1.8H,   #2
-  .if \avg
-        ld1             {v16.16B},        [x0]
-        urhadd          v28.16B, v28.16B, v16.16B
-  .endif
-        uaddl           v16.8H,  v0.8B,   v30.8B
-        ld1             {v2.16B, v3.16B}, [x1], x2
-        uaddl2          v20.8H,  v0.16B,  v30.16B
-        st1             {v28.16B},        [x0], x2
-        add             v24.8H,  v16.8H,  v18.8H
-NRND    add             v24.8H,  v24.8H,  v26.8H
-        ext             v3.16B,  v2.16B,  v3.16B,  #1
-        add             v0.8H,   v20.8H,  v22.8H
-        mshrn           v30.8B,  v24.8H,  #2
-NRND    add             v0.8H,   v0.8H,   v26.8H
-        mshrn2          v30.16B, v0.8H,   #2
-  .if \avg
-        ld1             {v18.16B},        [x0]
-        urhadd          v30.16B, v30.16B, v18.16B
-  .endif
-        uaddl           v18.8H,   v2.8B,  v3.8B
-        uaddl2          v22.8H,   v2.16B, v3.16B
-        st1             {v30.16B},        [x0], x2
-        b.gt            1b
-
-        ld1             {v0.16B, v1.16B}, [x1], x2
-        add             v24.8H,  v16.8H,  v18.8H
-NRND    add             v24.8H,  v24.8H,  v26.8H
-        ext             v30.16B, v0.16B,  v1.16B,  #1
-        add             v1.8H,   v20.8H,  v22.8H
-        mshrn           v28.8B,  v24.8H,  #2
-NRND    add             v1.8H,   v1.8H,   v26.8H
-        mshrn2          v28.16B, v1.8H,   #2
-  .if \avg
-        ld1             {v16.16B},        [x0]
-        urhadd          v28.16B, v28.16B, v16.16B
-  .endif
-        uaddl           v16.8H,  v0.8B,   v30.8B
-        uaddl2          v20.8H,  v0.16B,  v30.16B
-        st1             {v28.16B},        [x0], x2
-        add             v24.8H,  v16.8H,  v18.8H
-NRND    add             v24.8H,  v24.8H,  v26.8H
-        add             v0.8H,   v20.8H,  v22.8H
-        mshrn           v30.8B,  v24.8H,  #2
-NRND    add             v0.8H,   v0.8H,   v26.8H
-        mshrn2          v30.16B, v0.8H,   #2
-  .if \avg
-        ld1             {v18.16B},        [x0]
-        urhadd          v30.16B, v30.16B, v18.16B
-  .endif
-        st1             {v30.16B},        [x0], x2
-
-        ret
-.endm
-
-.macro  pixels8         rnd=1, avg=0
-1:      ld1             {v0.8B}, [x1], x2
-        ld1             {v1.8B}, [x1], x2
-        ld1             {v2.8B}, [x1], x2
-        ld1             {v3.8B}, [x1], x2
-  .if \avg
-        ld1             {v4.8B}, [x0], x2
-        urhadd          v0.8B,  v0.8B,  v4.8B
-        ld1             {v5.8B}, [x0], x2
-        urhadd          v1.8B,  v1.8B,  v5.8B
-        ld1             {v6.8B}, [x0], x2
-        urhadd          v2.8B,  v2.8B,  v6.8B
-        ld1             {v7.8B}, [x0], x2
-        urhadd          v3.8B,  v3.8B,  v7.8B
-        sub             x0,  x0,  x2,  lsl #2
-  .endif
-        subs            w3,  w3,  #4
-        st1             {v0.8B}, [x0], x2
-        st1             {v1.8B}, [x0], x2
-        st1             {v2.8B}, [x0], x2
-        st1             {v3.8B}, [x0], x2
-        b.ne            1b
-        ret
-.endm
-
-.macro  pixels8_x2      rnd=1, avg=0
-1:      ld1             {v0.8B, v1.8B}, [x1], x2
-        ext             v1.8B,  v0.8B,  v1.8B,  #1
-        ld1             {v2.8B, v3.8B}, [x1], x2
-        ext             v3.8B,  v2.8B,  v3.8B,  #1
-        subs            w3,  w3,  #2
-        avg             v0.8B,   v0.8B,   v1.8B
-        avg             v2.8B,   v2.8B,   v3.8B
-  .if \avg
-        ld1             {v4.8B},     [x0], x2
-        ld1             {v5.8B},     [x0]
-        urhadd          v0.8B,   v0.8B,   v4.8B
-        urhadd          v2.8B,   v2.8B,   v5.8B
-        sub             x0,  x0,  x2
-  .endif
-        st1             {v0.8B}, [x0], x2
-        st1             {v2.8B}, [x0], x2
-        b.ne            1b
-        ret
-.endm
-
-.macro  pixels8_y2      rnd=1, avg=0
-        sub             w3,  w3,  #2
-        ld1             {v0.8B},  [x1], x2
-        ld1             {v1.8B},  [x1], x2
-1:      subs            w3,  w3,  #2
-        avg             v4.8B,  v0.8B,  v1.8B
-        ld1             {v0.8B},  [x1], x2
-        avg             v5.8B,  v0.8B,  v1.8B
-        ld1             {v1.8B},  [x1], x2
-  .if \avg
-        ld1             {v2.8B},     [x0], x2
-        ld1             {v3.8B},     [x0]
-        urhadd          v4.8B,  v4.8B,  v2.8B
-        urhadd          v5.8B,  v5.8B,  v3.8B
-        sub             x0,  x0,  x2
-  .endif
-        st1             {v4.8B},     [x0], x2
-        st1             {v5.8B},     [x0], x2
-        b.ne            1b
-
-        avg             v4.8B,  v0.8B,  v1.8B
-        ld1             {v0.8B},  [x1], x2
-        avg             v5.8B,  v0.8B,  v1.8B
-  .if \avg
-        ld1             {v2.8B},     [x0], x2
-        ld1             {v3.8B},     [x0]
-        urhadd          v4.8B,  v4.8B,  v2.8B
-        urhadd          v5.8B,  v5.8B,  v3.8B
-        sub             x0,  x0,  x2
-  .endif
-        st1             {v4.8B},     [x0], x2
-        st1             {v5.8B},     [x0], x2
-
-        ret
-.endm
-
-.macro  pixels8_xy2     rnd=1, avg=0
-        sub             w3,  w3,  #2
-        ld1             {v0.16B},     [x1], x2
-        ld1             {v1.16B},     [x1], x2
-NRND    movi            v19.8H, #1
-        ext             v4.16B,  v0.16B,  v4.16B,  #1
-        ext             v6.16B,  v1.16B,  v6.16B,  #1
-        uaddl           v16.8H,  v0.8B,  v4.8B
-        uaddl           v17.8H,  v1.8B,  v6.8B
-1:      subs            w3,  w3,  #2
-        ld1             {v0.16B},     [x1], x2
-        add             v18.8H, v16.8H,  v17.8H
-        ext             v4.16B,  v0.16B,  v4.16B,  #1
-NRND    add             v18.8H, v18.8H, v19.8H
-        uaddl           v16.8H,  v0.8B,  v4.8B
-        mshrn           v5.8B,  v18.8H, #2
-        ld1             {v1.16B},     [x1], x2
-        add             v18.8H, v16.8H,  v17.8H
-  .if \avg
-        ld1             {v7.8B},     [x0]
-        urhadd          v5.8B,  v5.8B,  v7.8B
-  .endif
-NRND    add             v18.8H, v18.8H, v19.8H
-        st1             {v5.8B},     [x0], x2
-        mshrn           v7.8B,  v18.8H, #2
-  .if \avg
-        ld1             {v5.8B},     [x0]
-        urhadd          v7.8B,  v7.8B,  v5.8B
-  .endif
-        ext             v6.16B,  v1.16B,  v6.16B,  #1
-        uaddl           v17.8H,  v1.8B,   v6.8B
-        st1             {v7.8B},     [x0], x2
-        b.gt            1b
-
-        ld1             {v0.16B},     [x1], x2
-        add             v18.8H, v16.8H, v17.8H
-        ext             v4.16B, v0.16B, v4.16B,  #1
-NRND    add             v18.8H, v18.8H, v19.8H
-        uaddl           v16.8H,  v0.8B, v4.8B
-        mshrn           v5.8B,  v18.8H, #2
-        add             v18.8H, v16.8H, v17.8H
-  .if \avg
-        ld1             {v7.8B},     [x0]
-        urhadd          v5.8B,  v5.8B,  v7.8B
-  .endif
-NRND    add             v18.8H, v18.8H, v19.8H
-        st1             {v5.8B},     [x0], x2
-        mshrn           v7.8B,  v18.8H, #2
-  .if \avg
-        ld1             {v5.8B},     [x0]
-        urhadd          v7.8B,  v7.8B,  v5.8B
-  .endif
-        st1             {v7.8B},     [x0], x2
-
-        ret
-.endm
-
-.macro  pixfunc         pfx, name, suf, rnd=1, avg=0
-  .if \rnd
-    .macro avg  rd, rn, rm
-        urhadd          \rd, \rn, \rm
-    .endm
-    .macro mshrn rd, rn, rm
-        rshrn           \rd, \rn, \rm
-    .endm
-    .macro mshrn2 rd, rn, rm
-        rshrn2          \rd, \rn, \rm
-    .endm
-    .macro NRND insn:vararg
-    .endm
-  .else
-    .macro avg  rd, rn, rm
-        uhadd           \rd, \rn, \rm
-    .endm
-    .macro mshrn rd, rn, rm
-        shrn            \rd, \rn, \rm
-    .endm
-    .macro mshrn2 rd, rn, rm
-        shrn2           \rd, \rn, \rm
-    .endm
-    .macro NRND insn:vararg
-        \insn
-    .endm
-  .endif
-function ff_\pfx\name\suf\()_neon, export=1
-        \name           \rnd, \avg
-endfunc
-        .purgem         avg
-        .purgem         mshrn
-        .purgem         mshrn2
-        .purgem         NRND
-.endm
-
-.macro  pixfunc2        pfx, name, avg=0
-        pixfunc         \pfx, \name,          rnd=1, avg=\avg
-        pixfunc         \pfx, \name, _no_rnd, rnd=0, avg=\avg
-.endm
-
-function ff_put_h264_qpel16_mc00_neon, export=1
-        mov             w3,  #16
-endfunc
-
-        pixfunc         put_, pixels16,     avg=0
-        pixfunc2        put_, pixels16_x2,  avg=0
-        pixfunc2        put_, pixels16_y2,  avg=0
-        pixfunc2        put_, pixels16_xy2, avg=0
-
-function ff_avg_h264_qpel16_mc00_neon, export=1
-        mov             w3,  #16
-endfunc
-
-        pixfunc         avg_, pixels16,     avg=1
-        pixfunc2        avg_, pixels16_x2,  avg=1
-        pixfunc2        avg_, pixels16_y2,  avg=1
-        pixfunc2        avg_, pixels16_xy2, avg=1
-
-function ff_put_h264_qpel8_mc00_neon, export=1
-        mov             w3,  #8
-endfunc
-
-        pixfunc         put_, pixels8,     avg=0
-        pixfunc2        put_, pixels8_x2,  avg=0
-        pixfunc2        put_, pixels8_y2,  avg=0
-        pixfunc2        put_, pixels8_xy2, avg=0
-
-function ff_avg_h264_qpel8_mc00_neon, export=1
-        mov             w3,  #8
-endfunc
-
-        pixfunc         avg_, pixels8,     avg=1
-        pixfunc         avg_, pixels8_x2,  avg=1
-        pixfunc         avg_, pixels8_y2,  avg=1
-        pixfunc         avg_, pixels8_xy2, avg=1
diff --git a/deps/libav/libavcodec/aarch64/neon.S b/deps/libav/libavcodec/aarch64/neon.S
deleted file mode 100644
index f1072b7..0000000
--- a/deps/libav/libavcodec/aarch64/neon.S
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-.macro  transpose_8x8B  r0, r1, r2, r3, r4, r5, r6, r7, r8, r9
-        trn1            \r8\().8B,  \r0\().8B,  \r1\().8B
-        trn2            \r9\().8B,  \r0\().8B,  \r1\().8B
-        trn1            \r1\().8B,  \r2\().8B,  \r3\().8B
-        trn2            \r3\().8B,  \r2\().8B,  \r3\().8B
-        trn1            \r0\().8B,  \r4\().8B,  \r5\().8B
-        trn2            \r5\().8B,  \r4\().8B,  \r5\().8B
-        trn1            \r2\().8B,  \r6\().8B,  \r7\().8B
-        trn2            \r7\().8B,  \r6\().8B,  \r7\().8B
-
-        trn1            \r4\().4H,  \r0\().4H,  \r2\().4H
-        trn2            \r2\().4H,  \r0\().4H,  \r2\().4H
-        trn1            \r6\().4H,  \r5\().4H,  \r7\().4H
-        trn2            \r7\().4H,  \r5\().4H,  \r7\().4H
-        trn1            \r5\().4H,  \r9\().4H,  \r3\().4H
-        trn2            \r9\().4H,  \r9\().4H,  \r3\().4H
-        trn1            \r3\().4H,  \r8\().4H,  \r1\().4H
-        trn2            \r8\().4H,  \r8\().4H,  \r1\().4H
-
-        trn1            \r0\().2S,  \r3\().2S,  \r4\().2S
-        trn2            \r4\().2S,  \r3\().2S,  \r4\().2S
-
-        trn1            \r1\().2S,  \r5\().2S,  \r6\().2S
-        trn2            \r5\().2S,  \r5\().2S,  \r6\().2S
-
-        trn2            \r6\().2S,  \r8\().2S,  \r2\().2S
-        trn1            \r2\().2S,  \r8\().2S,  \r2\().2S
-
-        trn1            \r3\().2S,  \r9\().2S,  \r7\().2S
-        trn2            \r7\().2S,  \r9\().2S,  \r7\().2S
-.endm
-
-.macro  transpose_8x16B r0, r1, r2, r3, r4, r5, r6, r7, t0, t1
-        trn1            \t0\().16B, \r0\().16B, \r1\().16B
-        trn2            \t1\().16B, \r0\().16B, \r1\().16B
-        trn1            \r1\().16B, \r2\().16B, \r3\().16B
-        trn2            \r3\().16B, \r2\().16B, \r3\().16B
-        trn1            \r0\().16B, \r4\().16B, \r5\().16B
-        trn2            \r5\().16B, \r4\().16B, \r5\().16B
-        trn1            \r2\().16B, \r6\().16B, \r7\().16B
-        trn2            \r7\().16B, \r6\().16B, \r7\().16B
-
-        trn1            \r4\().8H,  \r0\().8H,  \r2\().8H
-        trn2            \r2\().8H,  \r0\().8H,  \r2\().8H
-        trn1            \r6\().8H,  \r5\().8H,  \r7\().8H
-        trn2            \r7\().8H,  \r5\().8H,  \r7\().8H
-        trn1            \r5\().8H,  \t1\().8H,  \r3\().8H
-        trn2            \t1\().8H,  \t1\().8H,  \r3\().8H
-        trn1            \r3\().8H,  \t0\().8H,  \r1\().8H
-        trn2            \t0\().8H,  \t0\().8H,  \r1\().8H
-
-        trn1            \r0\().4S,  \r3\().4S,  \r4\().4S
-        trn2            \r4\().4S,  \r3\().4S,  \r4\().4S
-
-        trn1            \r1\().4S,  \r5\().4S,  \r6\().4S
-        trn2            \r5\().4S,  \r5\().4S,  \r6\().4S
-
-        trn2            \r6\().4S,  \t0\().4S,  \r2\().4S
-        trn1            \r2\().4S,  \t0\().4S,  \r2\().4S
-
-        trn1            \r3\().4S,  \t1\().4S,  \r7\().4S
-        trn2            \r7\().4S,  \t1\().4S,  \r7\().4S
-.endm
-
-.macro  transpose_4x16B r0, r1, r2, r3, t4, t5, t6, t7
-        trn1            \t4\().16B, \r0\().16B,  \r1\().16B
-        trn2            \t5\().16B, \r0\().16B,  \r1\().16B
-        trn1            \t6\().16B, \r2\().16B,  \r3\().16B
-        trn2            \t7\().16B, \r2\().16B,  \r3\().16B
-
-        trn1            \r0\().8H,  \t4\().8H,  \t6\().8H
-        trn2            \r2\().8H,  \t4\().8H,  \t6\().8H
-        trn1            \r1\().8H,  \t5\().8H,  \t7\().8H
-        trn2            \r3\().8H,  \t5\().8H,  \t7\().8H
-.endm
-
-.macro  transpose_4x8B  r0, r1, r2, r3, t4, t5, t6, t7
-        trn1            \t4\().8B,  \r0\().8B,  \r1\().8B
-        trn2            \t5\().8B,  \r0\().8B,  \r1\().8B
-        trn1            \t6\().8B,  \r2\().8B,  \r3\().8B
-        trn2            \t7\().8B,  \r2\().8B,  \r3\().8B
-
-        trn1            \r0\().4H,  \t4\().4H,  \t6\().4H
-        trn2            \r2\().4H,  \t4\().4H,  \t6\().4H
-        trn1            \r1\().4H,  \t5\().4H,  \t7\().4H
-        trn2            \r3\().4H,  \t5\().4H,  \t7\().4H
-.endm
-
-.macro  transpose_4x4H  r0, r1, r2, r3, r4, r5, r6, r7
-        trn1            \r4\().4H,  \r0\().4H,  \r1\().4H
-        trn2            \r5\().4H,  \r0\().4H,  \r1\().4H
-        trn1            \r7\().4H,  \r3\().4H,  \r2\().4H
-        trn2            \r6\().4H,  \r3\().4H,  \r2\().4H
-        trn1            \r0\().2S,  \r4\().2S,  \r7\().2S
-        trn2            \r3\().2S,  \r4\().2S,  \r7\().2S
-        trn1            \r1\().2S,  \r5\().2S,  \r6\().2S
-        trn2            \r2\().2S,  \r5\().2S,  \r6\().2S
-.endm
-
-.macro  transpose_8x8H  r0, r1, r2, r3, r4, r5, r6, r7, r8, r9
-        trn1            \r8\().8H,  \r0\().8H,  \r1\().8H
-        trn2            \r9\().8H,  \r0\().8H,  \r1\().8H
-        trn1            \r1\().8H,  \r2\().8H,  \r3\().8H
-        trn2            \r3\().8H,  \r2\().8H,  \r3\().8H
-        trn1            \r0\().8H,  \r4\().8H,  \r5\().8H
-        trn2            \r5\().8H,  \r4\().8H,  \r5\().8H
-        trn1            \r2\().8H,  \r6\().8H,  \r7\().8H
-        trn2            \r7\().8H,  \r6\().8H,  \r7\().8H
-
-        trn1            \r4\().4S,  \r0\().4S,  \r2\().4S
-        trn2            \r2\().4S,  \r0\().4S,  \r2\().4S
-        trn1            \r6\().4S,  \r5\().4S,  \r7\().4S
-        trn2            \r7\().4S,  \r5\().4S,  \r7\().4S
-        trn1            \r5\().4S,  \r9\().4S,  \r3\().4S
-        trn2            \r9\().4S,  \r9\().4S,  \r3\().4S
-        trn1            \r3\().4S,  \r8\().4S,  \r1\().4S
-        trn2            \r8\().4S,  \r8\().4S,  \r1\().4S
-
-        trn1            \r0\().2D,  \r3\().2D,  \r4\().2D
-        trn2            \r4\().2D,  \r3\().2D,  \r4\().2D
-
-        trn1            \r1\().2D,  \r5\().2D,  \r6\().2D
-        trn2            \r5\().2D,  \r5\().2D,  \r6\().2D
-
-        trn2            \r6\().2D,  \r8\().2D,  \r2\().2D
-        trn1            \r2\().2D,  \r8\().2D,  \r2\().2D
-
-        trn1            \r3\().2D,  \r9\().2D,  \r7\().2D
-        trn2            \r7\().2D,  \r9\().2D,  \r7\().2D
-
-.endm
diff --git a/deps/libav/libavcodec/aarch64/neontest.c b/deps/libav/libavcodec/aarch64/neontest.c
deleted file mode 100644
index 0414829..0000000
--- a/deps/libav/libavcodec/aarch64/neontest.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * check NEON registers for clobbers
- * Copyright (c) 2013 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/avcodec.h"
-#include "libavutil/aarch64/neontest.h"
-
-wrap(avcodec_open2(AVCodecContext *avctx,
-                   AVCodec *codec,
-                   AVDictionary **options))
-{
-    testneonclobbers(avcodec_open2, avctx, codec, options);
-}
-
-wrap(avcodec_decode_audio4(AVCodecContext *avctx,
-                           AVFrame *frame,
-                           int *got_frame_ptr,
-                           AVPacket *avpkt))
-{
-    testneonclobbers(avcodec_decode_audio4, avctx, frame,
-                     got_frame_ptr, avpkt);
-}
-
-wrap(avcodec_decode_video2(AVCodecContext *avctx,
-                           AVFrame *picture,
-                           int *got_picture_ptr,
-                           AVPacket *avpkt))
-{
-    testneonclobbers(avcodec_decode_video2, avctx, picture,
-                     got_picture_ptr, avpkt);
-}
-
-wrap(avcodec_decode_subtitle2(AVCodecContext *avctx,
-                              AVSubtitle *sub,
-                              int *got_sub_ptr,
-                              AVPacket *avpkt))
-{
-    testneonclobbers(avcodec_decode_subtitle2, avctx, sub,
-                     got_sub_ptr, avpkt);
-}
-
-wrap(avcodec_encode_audio2(AVCodecContext *avctx,
-                           AVPacket *avpkt,
-                           const AVFrame *frame,
-                           int *got_packet_ptr))
-{
-    testneonclobbers(avcodec_encode_audio2, avctx, avpkt, frame,
-                     got_packet_ptr);
-}
-
-wrap(avcodec_encode_subtitle(AVCodecContext *avctx,
-                             uint8_t *buf, int buf_size,
-                             const AVSubtitle *sub))
-{
-    testneonclobbers(avcodec_encode_subtitle, avctx, buf, buf_size, sub);
-}
-
-wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
-                           const AVFrame *frame, int *got_packet_ptr))
-{
-    testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, got_packet_ptr);
-}
diff --git a/deps/libav/libavcodec/aarch64/rv40dsp_init_aarch64.c b/deps/libav/libavcodec/aarch64/rv40dsp_init_aarch64.c
deleted file mode 100644
index 0bb404f..0000000
--- a/deps/libav/libavcodec/aarch64/rv40dsp_init_aarch64.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/aarch64/cpu.h"
-#include "libavcodec/rv34dsp.h"
-
-#include "config.h"
-
-void ff_put_rv40_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                 int x, int y);
-void ff_put_rv40_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                 int x, int y);
-
-void ff_avg_rv40_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                 int x, int y);
-void ff_avg_rv40_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                 int x, int y);
-
-av_cold void ff_rv40dsp_init_aarch64(RV34DSPContext *c)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        c->put_chroma_pixels_tab[0] = ff_put_rv40_chroma_mc8_neon;
-        c->put_chroma_pixels_tab[1] = ff_put_rv40_chroma_mc4_neon;
-        c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_neon;
-        c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/aarch64/vc1dsp_init_aarch64.c b/deps/libav/libavcodec/aarch64/vc1dsp_init_aarch64.c
deleted file mode 100644
index 11cd81e..0000000
--- a/deps/libav/libavcodec/aarch64/vc1dsp_init_aarch64.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/aarch64/cpu.h"
-#include "libavcodec/vc1dsp.h"
-
-#include "config.h"
-
-void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                int x, int y);
-void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                int x, int y);
-void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                int x, int y);
-void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                int x, int y);
-
-av_cold void ff_vc1dsp_init_aarch64(VC1DSPContext *dsp)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_neon;
-        dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_neon;
-        dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = ff_put_vc1_chroma_mc4_neon;
-        dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = ff_avg_vc1_chroma_mc4_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/aasc.c b/deps/libav/libavcodec/aasc.c
deleted file mode 100644
index 468e394..0000000
--- a/deps/libav/libavcodec/aasc.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Autodesk RLE Decoder
- * Copyright (C) 2005 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Autodesk RLE Video Decoder by Konstantin Shishkov
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "msrledec.h"
-
-typedef struct AascContext {
-    AVCodecContext *avctx;
-    GetByteContext gb;
-    AVFrame *frame;
-} AascContext;
-
-static av_cold int aasc_decode_init(AVCodecContext *avctx)
-{
-    AascContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    avctx->pix_fmt = AV_PIX_FMT_BGR24;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int aasc_decode_frame(AVCodecContext *avctx,
-                              void *data, int *got_frame,
-                              AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    AascContext *s     = avctx->priv_data;
-    int compr, i, stride, ret;
-
-    if (buf_size < 4)
-        return AVERROR_INVALIDDATA;
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    compr     = AV_RL32(buf);
-    buf      += 4;
-    buf_size -= 4;
-    switch (compr) {
-    case 0:
-        stride = (avctx->width * 3 + 3) & ~3;
-        if (buf_size < stride * avctx->height)
-            return AVERROR_INVALIDDATA;
-        for (i = avctx->height - 1; i >= 0; i--) {
-            memcpy(s->frame->data[0] + i * s->frame->linesize[0], buf, avctx->width * 3);
-            buf += stride;
-        }
-        break;
-    case 1:
-        bytestream2_init(&s->gb, buf, buf_size);
-        ff_msrle_decode(avctx, (AVPicture*)s->frame, 8, &s->gb);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr);
-        return AVERROR_INVALIDDATA;
-    }
-
-    *got_frame = 1;
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    /* report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int aasc_decode_end(AVCodecContext *avctx)
-{
-    AascContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_aasc_decoder = {
-    .name           = "aasc",
-    .long_name      = NULL_IF_CONFIG_SMALL("Autodesk RLE"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_AASC,
-    .priv_data_size = sizeof(AascContext),
-    .init           = aasc_decode_init,
-    .close          = aasc_decode_end,
-    .decode         = aasc_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/ac3.c b/deps/libav/libavcodec/ac3.c
deleted file mode 100644
index 99e5b50..0000000
--- a/deps/libav/libavcodec/ac3.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Common code between the AC-3 encoder and decoder
- * Copyright (c) 2000 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Common code between the AC-3 encoder and decoder.
- */
-
-#include "avcodec.h"
-#include "ac3.h"
-#include "get_bits.h"
-
-/**
- * Starting frequency coefficient bin for each critical band.
- */
-const uint8_t ff_ac3_band_start_tab[AC3_CRITICAL_BANDS+1] = {
-      0,  1,   2,   3,   4,   5,   6,   7,   8,   9,
-     10,  11, 12,  13,  14,  15,  16,  17,  18,  19,
-     20,  21, 22,  23,  24,  25,  26,  27,  28,  31,
-     34,  37, 40,  43,  46,  49,  55,  61,  67,  73,
-     79,  85, 97, 109, 121, 133, 157, 181, 205, 229, 253
-};
-
-#if CONFIG_HARDCODED_TABLES
-
-/**
- * Map each frequency coefficient bin to the critical band that contains it.
- */
-const uint8_t ff_ac3_bin_to_band_tab[253] = {
-     0,
-     1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12,
-    13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
-    25, 26, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30,
-    31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34,
-    35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36,
-    37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38,
-    39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40,
-    41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
-    42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
-    43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
-    44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
-    45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-    45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-    46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-    46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-    47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
-    47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
-    48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
-    49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49
-};
-
-#else /* CONFIG_HARDCODED_TABLES */
-uint8_t ff_ac3_bin_to_band_tab[253];
-#endif
-
-static inline int calc_lowcomp1(int a, int b0, int b1, int c)
-{
-    if ((b0 + 256) == b1) {
-        a = c;
-    } else if (b0 > b1) {
-        a = FFMAX(a - 64, 0);
-    }
-    return a;
-}
-
-static inline int calc_lowcomp(int a, int b0, int b1, int bin)
-{
-    if (bin < 7) {
-        return calc_lowcomp1(a, b0, b1, 384);
-    } else if (bin < 20) {
-        return calc_lowcomp1(a, b0, b1, 320);
-    } else {
-        return FFMAX(a - 128, 0);
-    }
-}
-
-void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd,
-                               int16_t *band_psd)
-{
-    int bin, band;
-
-    /* exponent mapping to PSD */
-    for (bin = start; bin < end; bin++) {
-        psd[bin]=(3072 - (exp[bin] << 7));
-    }
-
-    /* PSD integration */
-    bin  = start;
-    band = ff_ac3_bin_to_band_tab[start];
-    do {
-        int v = psd[bin++];
-        int band_end = FFMIN(ff_ac3_band_start_tab[band+1], end);
-        for (; bin < band_end; bin++) {
-            int max = FFMAX(v, psd[bin]);
-            /* logadd */
-            int adr = FFMIN(max - ((v + psd[bin] + 1) >> 1), 255);
-            v = max + ff_ac3_log_add_tab[adr];
-        }
-        band_psd[band++] = v;
-    } while (end > ff_ac3_band_start_tab[band]);
-}
-
-int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
-                               int start, int end, int fast_gain, int is_lfe,
-                               int dba_mode, int dba_nsegs, uint8_t *dba_offsets,
-                               uint8_t *dba_lengths, uint8_t *dba_values,
-                               int16_t *mask)
-{
-    int16_t excite[AC3_CRITICAL_BANDS]; /* excitation */
-    int band;
-    int band_start, band_end, begin, end1;
-    int lowcomp, fastleak, slowleak;
-
-    /* excitation function */
-    band_start = ff_ac3_bin_to_band_tab[start];
-    band_end   = ff_ac3_bin_to_band_tab[end-1] + 1;
-
-    if (band_start == 0) {
-        lowcomp = 0;
-        lowcomp = calc_lowcomp1(lowcomp, band_psd[0], band_psd[1], 384);
-        excite[0] = band_psd[0] - fast_gain - lowcomp;
-        lowcomp = calc_lowcomp1(lowcomp, band_psd[1], band_psd[2], 384);
-        excite[1] = band_psd[1] - fast_gain - lowcomp;
-        begin = 7;
-        for (band = 2; band < 7; band++) {
-            if (!(is_lfe && band == 6))
-                lowcomp = calc_lowcomp1(lowcomp, band_psd[band], band_psd[band+1], 384);
-            fastleak = band_psd[band] - fast_gain;
-            slowleak = band_psd[band] - s->slow_gain;
-            excite[band] = fastleak - lowcomp;
-            if (!(is_lfe && band == 6)) {
-                if (band_psd[band] <= band_psd[band+1]) {
-                    begin = band + 1;
-                    break;
-                }
-            }
-        }
-
-        end1 = FFMIN(band_end, 22);
-        for (band = begin; band < end1; band++) {
-            if (!(is_lfe && band == 6))
-                lowcomp = calc_lowcomp(lowcomp, band_psd[band], band_psd[band+1], band);
-            fastleak = FFMAX(fastleak - s->fast_decay, band_psd[band] - fast_gain);
-            slowleak = FFMAX(slowleak - s->slow_decay, band_psd[band] - s->slow_gain);
-            excite[band] = FFMAX(fastleak - lowcomp, slowleak);
-        }
-        begin = 22;
-    } else {
-        /* coupling channel */
-        begin = band_start;
-        fastleak = (s->cpl_fast_leak << 8) + 768;
-        slowleak = (s->cpl_slow_leak << 8) + 768;
-    }
-
-    for (band = begin; band < band_end; band++) {
-        fastleak = FFMAX(fastleak - s->fast_decay, band_psd[band] - fast_gain);
-        slowleak = FFMAX(slowleak - s->slow_decay, band_psd[band] - s->slow_gain);
-        excite[band] = FFMAX(fastleak, slowleak);
-    }
-
-    /* compute masking curve */
-
-    for (band = band_start; band < band_end; band++) {
-        int tmp = s->db_per_bit - band_psd[band];
-        if (tmp > 0) {
-            excite[band] += tmp >> 2;
-        }
-        mask[band] = FFMAX(ff_ac3_hearing_threshold_tab[band >> s->sr_shift][s->sr_code], excite[band]);
-    }
-
-    /* delta bit allocation */
-
-    if (dba_mode == DBA_REUSE || dba_mode == DBA_NEW) {
-        int i, seg, delta;
-        if (dba_nsegs > 8)
-            return -1;
-        band = band_start;
-        for (seg = 0; seg < dba_nsegs; seg++) {
-            band += dba_offsets[seg];
-            if (band >= AC3_CRITICAL_BANDS || dba_lengths[seg] > AC3_CRITICAL_BANDS-band)
-                return -1;
-            if (dba_values[seg] >= 4) {
-                delta = (dba_values[seg] - 3) << 7;
-            } else {
-                delta = (dba_values[seg] - 4) << 7;
-            }
-            for (i = 0; i < dba_lengths[seg]; i++) {
-                mask[band++] += delta;
-            }
-        }
-    }
-    return 0;
-}
-
-/**
- * Initialize some tables.
- * note: This function must remain thread safe because it is called by the
- *       AVParser init code.
- */
-av_cold void ff_ac3_common_init(void)
-{
-#if !CONFIG_HARDCODED_TABLES
-    /* compute ff_ac3_bin_to_band_tab from ff_ac3_band_start_tab */
-    int bin = 0, band;
-    for (band = 0; band < AC3_CRITICAL_BANDS; band++) {
-        int band_end = ff_ac3_band_start_tab[band+1];
-        while (bin < band_end)
-            ff_ac3_bin_to_band_tab[bin++] = band;
-    }
-#endif /* !CONFIG_HARDCODED_TABLES */
-}
diff --git a/deps/libav/libavcodec/ac3.h b/deps/libav/libavcodec/ac3.h
deleted file mode 100644
index f2cb6c3..0000000
--- a/deps/libav/libavcodec/ac3.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Common code between the AC-3 encoder and decoder
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Common code between the AC-3 encoder and decoder.
- */
-
-#ifndef AVCODEC_AC3_H
-#define AVCODEC_AC3_H
-
-#define AC3_MAX_CODED_FRAME_SIZE 3840 /* in bytes */
-#define AC3_MAX_CHANNELS 7            /**< maximum number of channels, including coupling channel */
-#define CPL_CH 0                      /**< coupling channel index */
-
-#define AC3_MAX_COEFS   256
-#define AC3_BLOCK_SIZE  256
-#define AC3_MAX_BLOCKS    6
-#define AC3_FRAME_SIZE (AC3_MAX_BLOCKS * 256)
-#define AC3_WINDOW_SIZE (AC3_BLOCK_SIZE * 2)
-#define AC3_CRITICAL_BANDS 50
-#define AC3_MAX_CPL_BANDS  18
-
-#include "ac3tab.h"
-
-/* exponent encoding strategy */
-#define EXP_REUSE 0
-#define EXP_NEW   1
-
-#define EXP_D15   1
-#define EXP_D25   2
-#define EXP_D45   3
-
-/* pre-defined gain values */
-#define LEVEL_PLUS_3DB          1.4142135623730950
-#define LEVEL_PLUS_1POINT5DB    1.1892071150027209
-#define LEVEL_MINUS_1POINT5DB   0.8408964152537145
-#define LEVEL_MINUS_3DB         0.7071067811865476
-#define LEVEL_MINUS_4POINT5DB   0.5946035575013605
-#define LEVEL_MINUS_6DB         0.5000000000000000
-#define LEVEL_MINUS_9DB         0.3535533905932738
-#define LEVEL_ZERO              0.0000000000000000
-#define LEVEL_ONE               1.0000000000000000
-
-/** Delta bit allocation strategy */
-typedef enum {
-    DBA_REUSE = 0,
-    DBA_NEW,
-    DBA_NONE,
-    DBA_RESERVED
-} AC3DeltaStrategy;
-
-/** Channel mode (audio coding mode) */
-typedef enum {
-    AC3_CHMODE_DUALMONO = 0,
-    AC3_CHMODE_MONO,
-    AC3_CHMODE_STEREO,
-    AC3_CHMODE_3F,
-    AC3_CHMODE_2F1R,
-    AC3_CHMODE_3F1R,
-    AC3_CHMODE_2F2R,
-    AC3_CHMODE_3F2R
-} AC3ChannelMode;
-
-/** Dolby Surround mode */
-typedef enum AC3DolbySurroundMode {
-    AC3_DSURMOD_NOTINDICATED = 0,
-    AC3_DSURMOD_OFF,
-    AC3_DSURMOD_ON,
-    AC3_DSURMOD_RESERVED
-} AC3DolbySurroundMode;
-
-/** Dolby Surround EX mode */
-typedef enum AC3DolbySurroundEXMode {
-    AC3_DSUREXMOD_NOTINDICATED = 0,
-    AC3_DSUREXMOD_OFF,
-    AC3_DSUREXMOD_ON,
-    AC3_DSUREXMOD_PLIIZ
-} AC3DolbySurroundEXMode;
-
-/** Dolby Headphone mode */
-typedef enum AC3DolbyHeadphoneMode {
-    AC3_DHEADPHONMOD_NOTINDICATED = 0,
-    AC3_DHEADPHONMOD_OFF,
-    AC3_DHEADPHONMOD_ON,
-    AC3_DHEADPHONMOD_RESERVED
-} AC3DolbyHeadphoneMode;
-
-/** Preferred Stereo Downmix mode */
-typedef enum AC3PreferredStereoDownmixMode {
-    AC3_DMIXMOD_NOTINDICATED = 0,
-    AC3_DMIXMOD_LTRT,
-    AC3_DMIXMOD_LORO,
-    AC3_DMIXMOD_DPLII // reserved value in A/52, but used by encoders to indicate DPL2
-} AC3PreferredStereoDownmixMode;
-
-typedef struct AC3BitAllocParameters {
-    int sr_code;
-    int sr_shift;
-    int slow_gain, slow_decay, fast_decay, db_per_bit, floor;
-    int cpl_fast_leak, cpl_slow_leak;
-} AC3BitAllocParameters;
-
-/**
- * @struct AC3HeaderInfo
- * Coded AC-3 header values up to the lfeon element, plus derived values.
- */
-typedef struct AC3HeaderInfo {
-    /** @name Coded elements
-     * @{
-     */
-    uint16_t sync_word;
-    uint16_t crc1;
-    uint8_t sr_code;
-    uint8_t bitstream_id;
-    uint8_t bitstream_mode;
-    uint8_t channel_mode;
-    uint8_t lfe_on;
-    uint8_t frame_type;
-    int substreamid;                        ///< substream identification
-    int center_mix_level;                   ///< Center mix level index
-    int surround_mix_level;                 ///< Surround mix level index
-    uint16_t channel_map;
-    int num_blocks;                         ///< number of audio blocks
-    int dolby_surround_mode;
-    /** @} */
-
-    /** @name Derived values
-     * @{
-     */
-    uint8_t sr_shift;
-    uint16_t sample_rate;
-    uint32_t bit_rate;
-    uint8_t channels;
-    uint16_t frame_size;
-    uint64_t channel_layout;
-    /** @} */
-} AC3HeaderInfo;
-
-typedef enum {
-    EAC3_FRAME_TYPE_INDEPENDENT = 0,
-    EAC3_FRAME_TYPE_DEPENDENT,
-    EAC3_FRAME_TYPE_AC3_CONVERT,
-    EAC3_FRAME_TYPE_RESERVED
-} EAC3FrameType;
-
-void ff_ac3_common_init(void);
-
-/**
- * Calculate the log power-spectral density of the input signal.
- * This gives a rough estimate of signal power in the frequency domain by using
- * the spectral envelope (exponents).  The psd is also separately grouped
- * into critical bands for use in the calculating the masking curve.
- * 128 units in psd = -6 dB.  The dbknee parameter in AC3BitAllocParameters
- * determines the reference level.
- *
- * @param[in]  exp        frequency coefficient exponents
- * @param[in]  start      starting bin location
- * @param[in]  end        ending bin location
- * @param[out] psd        signal power for each frequency bin
- * @param[out] band_psd   signal power for each critical band
- */
-void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd,
-                               int16_t *band_psd);
-
-/**
- * Calculate the masking curve.
- * First, the excitation is calculated using parameters in s and the signal
- * power in each critical band.  The excitation is compared with a predefined
- * hearing threshold table to produce the masking curve.  If delta bit
- * allocation information is provided, it is used for adjusting the masking
- * curve, usually to give a closer match to a better psychoacoustic model.
- *
- * @param[in]  s            adjustable bit allocation parameters
- * @param[in]  band_psd     signal power for each critical band
- * @param[in]  start        starting bin location
- * @param[in]  end          ending bin location
- * @param[in]  fast_gain    fast gain (estimated signal-to-mask ratio)
- * @param[in]  is_lfe       whether or not the channel being processed is the LFE
- * @param[in]  dba_mode     delta bit allocation mode (none, reuse, or new)
- * @param[in]  dba_nsegs    number of delta segments
- * @param[in]  dba_offsets  location offsets for each segment
- * @param[in]  dba_lengths  length of each segment
- * @param[in]  dba_values   delta bit allocation for each segment
- * @param[out] mask         calculated masking curve
- * @return returns 0 for success, non-zero for error
- */
-int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
-                               int start, int end, int fast_gain, int is_lfe,
-                               int dba_mode, int dba_nsegs, uint8_t *dba_offsets,
-                               uint8_t *dba_lengths, uint8_t *dba_values,
-                               int16_t *mask);
-
-#endif /* AVCODEC_AC3_H */
diff --git a/deps/libav/libavcodec/ac3_parser.c b/deps/libav/libavcodec/ac3_parser.c
deleted file mode 100644
index 5ea09f8..0000000
--- a/deps/libav/libavcodec/ac3_parser.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * AC-3 parser
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "parser.h"
-#include "ac3_parser.h"
-#include "aac_ac3_parser.h"
-#include "get_bits.h"
-
-
-#define AC3_HEADER_SIZE 7
-
-
-static const uint8_t eac3_blocks[4] = {
-    1, 2, 3, 6
-};
-
-/**
- * Table for center mix levels
- * reference: Section 5.4.2.4 cmixlev
- */
-static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
-
-/**
- * Table for surround mix levels
- * reference: Section 5.4.2.5 surmixlev
- */
-static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
-
-
-int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
-{
-    int frame_size_code;
-
-    memset(hdr, 0, sizeof(*hdr));
-
-    hdr->sync_word = get_bits(gbc, 16);
-    if(hdr->sync_word != 0x0B77)
-        return AAC_AC3_PARSE_ERROR_SYNC;
-
-    /* read ahead to bsid to distinguish between AC-3 and E-AC-3 */
-    hdr->bitstream_id = show_bits_long(gbc, 29) & 0x1F;
-    if(hdr->bitstream_id > 16)
-        return AAC_AC3_PARSE_ERROR_BSID;
-
-    hdr->num_blocks = 6;
-
-    /* set default mix levels */
-    hdr->center_mix_level   = 5;  // -4.5dB
-    hdr->surround_mix_level = 6;  // -6.0dB
-
-    /* set default dolby surround mode */
-    hdr->dolby_surround_mode = AC3_DSURMOD_NOTINDICATED;
-
-    if(hdr->bitstream_id <= 10) {
-        /* Normal AC-3 */
-        hdr->crc1 = get_bits(gbc, 16);
-        hdr->sr_code = get_bits(gbc, 2);
-        if(hdr->sr_code == 3)
-            return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;
-
-        frame_size_code = get_bits(gbc, 6);
-        if(frame_size_code > 37)
-            return AAC_AC3_PARSE_ERROR_FRAME_SIZE;
-
-        skip_bits(gbc, 5); // skip bsid, already got it
-
-        hdr->bitstream_mode = get_bits(gbc, 3);
-        hdr->channel_mode = get_bits(gbc, 3);
-
-        if(hdr->channel_mode == AC3_CHMODE_STEREO) {
-            hdr->dolby_surround_mode = get_bits(gbc, 2);
-        } else {
-            if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO)
-                hdr->  center_mix_level =   center_levels[get_bits(gbc, 2)];
-            if(hdr->channel_mode & 4)
-                hdr->surround_mix_level = surround_levels[get_bits(gbc, 2)];
-        }
-        hdr->lfe_on = get_bits1(gbc);
-
-        hdr->sr_shift = FFMAX(hdr->bitstream_id, 8) - 8;
-        hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift;
-        hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift;
-        hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
-        hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2;
-        hdr->frame_type = EAC3_FRAME_TYPE_AC3_CONVERT; //EAC3_FRAME_TYPE_INDEPENDENT;
-        hdr->substreamid = 0;
-    } else {
-        /* Enhanced AC-3 */
-        hdr->crc1 = 0;
-        hdr->frame_type = get_bits(gbc, 2);
-        if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED)
-            return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
-
-        hdr->substreamid = get_bits(gbc, 3);
-
-        hdr->frame_size = (get_bits(gbc, 11) + 1) << 1;
-        if(hdr->frame_size < AC3_HEADER_SIZE)
-            return AAC_AC3_PARSE_ERROR_FRAME_SIZE;
-
-        hdr->sr_code = get_bits(gbc, 2);
-        if (hdr->sr_code == 3) {
-            int sr_code2 = get_bits(gbc, 2);
-            if(sr_code2 == 3)
-                return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;
-            hdr->sample_rate = ff_ac3_sample_rate_tab[sr_code2] / 2;
-            hdr->sr_shift = 1;
-        } else {
-            hdr->num_blocks = eac3_blocks[get_bits(gbc, 2)];
-            hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code];
-            hdr->sr_shift = 0;
-        }
-
-        hdr->channel_mode = get_bits(gbc, 3);
-        hdr->lfe_on = get_bits1(gbc);
-
-        hdr->bit_rate = (uint32_t)(8.0 * hdr->frame_size * hdr->sample_rate /
-                        (hdr->num_blocks * 256.0));
-        hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
-    }
-    hdr->channel_layout = avpriv_ac3_channel_layout_tab[hdr->channel_mode];
-    if (hdr->lfe_on)
-        hdr->channel_layout |= AV_CH_LOW_FREQUENCY;
-
-    return 0;
-}
-
-static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
-        int *need_next_header, int *new_frame_start)
-{
-    int err;
-    union {
-        uint64_t u64;
-        uint8_t  u8[8];
-    } tmp = { av_be2ne64(state) };
-    AC3HeaderInfo hdr;
-    GetBitContext gbc;
-
-    init_get_bits(&gbc, tmp.u8+8-AC3_HEADER_SIZE, 54);
-    err = avpriv_ac3_parse_header(&gbc, &hdr);
-
-    if(err < 0)
-        return 0;
-
-    hdr_info->sample_rate = hdr.sample_rate;
-    hdr_info->bit_rate = hdr.bit_rate;
-    hdr_info->channels = hdr.channels;
-    hdr_info->channel_layout = hdr.channel_layout;
-    hdr_info->samples = hdr.num_blocks * 256;
-    hdr_info->service_type = hdr.bitstream_mode;
-    if (hdr.bitstream_mode == 0x7 && hdr.channels > 1)
-        hdr_info->service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
-    if(hdr.bitstream_id>10)
-        hdr_info->codec_id = AV_CODEC_ID_EAC3;
-    else if (hdr_info->codec_id == AV_CODEC_ID_NONE)
-        hdr_info->codec_id = AV_CODEC_ID_AC3;
-
-    *need_next_header = (hdr.frame_type != EAC3_FRAME_TYPE_AC3_CONVERT);
-    *new_frame_start  = (hdr.frame_type != EAC3_FRAME_TYPE_DEPENDENT);
-    return hdr.frame_size;
-}
-
-static av_cold int ac3_parse_init(AVCodecParserContext *s1)
-{
-    AACAC3ParseContext *s = s1->priv_data;
-    s->header_size = AC3_HEADER_SIZE;
-    s->sync = ac3_sync;
-    return 0;
-}
-
-
-AVCodecParser ff_ac3_parser = {
-    .codec_ids      = { AV_CODEC_ID_AC3, AV_CODEC_ID_EAC3 },
-    .priv_data_size = sizeof(AACAC3ParseContext),
-    .parser_init    = ac3_parse_init,
-    .parser_parse   = ff_aac_ac3_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/ac3_parser.h b/deps/libav/libavcodec/ac3_parser.h
deleted file mode 100644
index 9322550..0000000
--- a/deps/libav/libavcodec/ac3_parser.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * AC-3 parser prototypes
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AC3_PARSER_H
-#define AVCODEC_AC3_PARSER_H
-
-#include "ac3.h"
-#include "get_bits.h"
-
-/**
- * Parse AC-3 frame header.
- * Parse the header up to the lfeon element, which is the first 52 or 54 bits
- * depending on the audio coding mode.
- * @param[in]  gbc BitContext containing the first 54 bits of the frame.
- * @param[out] hdr Pointer to struct where header info is written.
- * @return Returns 0 on success, -1 if there is a sync word mismatch,
- * -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate)
- * element is invalid, or -4 if the frmsizecod (bit rate) element is invalid.
- */
-int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr);
-
-#endif /* AVCODEC_AC3_PARSER_H */
diff --git a/deps/libav/libavcodec/ac3dec.c b/deps/libav/libavcodec/ac3dec.c
deleted file mode 100644
index 0487679..0000000
--- a/deps/libav/libavcodec/ac3dec.c
+++ /dev/null
@@ -1,1587 +0,0 @@
-/*
- * AC-3 Audio Decoder
- * This code was developed as part of Google Summer of Code 2006.
- * E-AC-3 support was added as part of Google Summer of Code 2007.
- *
- * Copyright (c) 2006 Kartikey Mahendra BHATT (bhattkm at gmail dot com)
- * Copyright (c) 2007-2008 Bartlomiej Wolowiec <bartek.wolowiec at gmail.com>
- * Copyright (c) 2007 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stddef.h>
-#include <math.h>
-#include <string.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/crc.h"
-#include "libavutil/downmix_info.h"
-#include "libavutil/opt.h"
-#include "internal.h"
-#include "aac_ac3_parser.h"
-#include "ac3_parser.h"
-#include "ac3dec.h"
-#include "ac3dec_data.h"
-#include "kbdwin.h"
-
-/**
- * table for ungrouping 3 values in 7 bits.
- * used for exponents and bap=2 mantissas
- */
-static uint8_t ungroup_3_in_7_bits_tab[128][3];
-
-/** tables for ungrouping mantissas */
-static int b1_mantissas[32][3];
-static int b2_mantissas[128][3];
-static int b3_mantissas[8];
-static int b4_mantissas[128][2];
-static int b5_mantissas[16];
-
-/**
- * Quantization table: levels for symmetric. bits for asymmetric.
- * reference: Table 7.18 Mapping of bap to Quantizer
- */
-static const uint8_t quantization_tab[16] = {
-    0, 3, 5, 7, 11, 15,
-    5, 6, 7, 8, 9, 10, 11, 12, 14, 16
-};
-
-/** dynamic range table. converts codes to scale factors. */
-static float dynamic_range_tab[256];
-
-/** Adjustments in dB gain */
-static const float gain_levels[9] = {
-    LEVEL_PLUS_3DB,
-    LEVEL_PLUS_1POINT5DB,
-    LEVEL_ONE,
-    LEVEL_MINUS_1POINT5DB,
-    LEVEL_MINUS_3DB,
-    LEVEL_MINUS_4POINT5DB,
-    LEVEL_MINUS_6DB,
-    LEVEL_ZERO,
-    LEVEL_MINUS_9DB
-};
-
-/** Adjustments in dB gain (LFE, +10 to -21 dB) */
-static const float gain_levels_lfe[32] = {
-    3.162275, 2.818382, 2.511886, 2.238719, 1.995261, 1.778278, 1.584893,
-    1.412536, 1.258924, 1.122018, 1.000000, 0.891251, 0.794328, 0.707946,
-    0.630957, 0.562341, 0.501187, 0.446683, 0.398107, 0.354813, 0.316227,
-    0.281838, 0.251188, 0.223872, 0.199526, 0.177828, 0.158489, 0.141253,
-    0.125892, 0.112201, 0.100000, 0.089125
-};
-
-/**
- * Table for default stereo downmixing coefficients
- * reference: Section 7.8.2 Downmixing Into Two Channels
- */
-static const uint8_t ac3_default_coeffs[8][5][2] = {
-    { { 2, 7 }, { 7, 2 },                               },
-    { { 4, 4 },                                         },
-    { { 2, 7 }, { 7, 2 },                               },
-    { { 2, 7 }, { 5, 5 }, { 7, 2 },                     },
-    { { 2, 7 }, { 7, 2 }, { 6, 6 },                     },
-    { { 2, 7 }, { 5, 5 }, { 7, 2 }, { 8, 8 },           },
-    { { 2, 7 }, { 7, 2 }, { 6, 7 }, { 7, 6 },           },
-    { { 2, 7 }, { 5, 5 }, { 7, 2 }, { 6, 7 }, { 7, 6 }, },
-};
-
-/**
- * Symmetrical Dequantization
- * reference: Section 7.3.3 Expansion of Mantissas for Symmetrical Quantization
- *            Tables 7.19 to 7.23
- */
-static inline int
-symmetric_dequant(int code, int levels)
-{
-    return ((code - (levels >> 1)) << 24) / levels;
-}
-
-/*
- * Initialize tables at runtime.
- */
-static av_cold void ac3_tables_init(void)
-{
-    int i;
-
-    /* generate table for ungrouping 3 values in 7 bits
-       reference: Section 7.1.3 Exponent Decoding */
-    for (i = 0; i < 128; i++) {
-        ungroup_3_in_7_bits_tab[i][0] =  i / 25;
-        ungroup_3_in_7_bits_tab[i][1] = (i % 25) / 5;
-        ungroup_3_in_7_bits_tab[i][2] = (i % 25) % 5;
-    }
-
-    /* generate grouped mantissa tables
-       reference: Section 7.3.5 Ungrouping of Mantissas */
-    for (i = 0; i < 32; i++) {
-        /* bap=1 mantissas */
-        b1_mantissas[i][0] = symmetric_dequant(ff_ac3_ungroup_3_in_5_bits_tab[i][0], 3);
-        b1_mantissas[i][1] = symmetric_dequant(ff_ac3_ungroup_3_in_5_bits_tab[i][1], 3);
-        b1_mantissas[i][2] = symmetric_dequant(ff_ac3_ungroup_3_in_5_bits_tab[i][2], 3);
-    }
-    for (i = 0; i < 128; i++) {
-        /* bap=2 mantissas */
-        b2_mantissas[i][0] = symmetric_dequant(ungroup_3_in_7_bits_tab[i][0], 5);
-        b2_mantissas[i][1] = symmetric_dequant(ungroup_3_in_7_bits_tab[i][1], 5);
-        b2_mantissas[i][2] = symmetric_dequant(ungroup_3_in_7_bits_tab[i][2], 5);
-
-        /* bap=4 mantissas */
-        b4_mantissas[i][0] = symmetric_dequant(i / 11, 11);
-        b4_mantissas[i][1] = symmetric_dequant(i % 11, 11);
-    }
-    /* generate ungrouped mantissa tables
-       reference: Tables 7.21 and 7.23 */
-    for (i = 0; i < 7; i++) {
-        /* bap=3 mantissas */
-        b3_mantissas[i] = symmetric_dequant(i, 7);
-    }
-    for (i = 0; i < 15; i++) {
-        /* bap=5 mantissas */
-        b5_mantissas[i] = symmetric_dequant(i, 15);
-    }
-
-    /* generate dynamic range table
-       reference: Section 7.7.1 Dynamic Range Control */
-    for (i = 0; i < 256; i++) {
-        int v = (i >> 5) - ((i >> 7) << 3) - 5;
-        dynamic_range_tab[i] = powf(2.0f, v) * ((i & 0x1F) | 0x20);
-    }
-}
-
-/**
- * AVCodec initialization
- */
-static av_cold int ac3_decode_init(AVCodecContext *avctx)
-{
-    AC3DecodeContext *s = avctx->priv_data;
-    int i;
-
-    s->avctx = avctx;
-
-    ff_ac3_common_init();
-    ac3_tables_init();
-    ff_mdct_init(&s->imdct_256, 8, 1, 1.0);
-    ff_mdct_init(&s->imdct_512, 9, 1, 1.0);
-    ff_kbd_window_init(s->window, 5.0, 256);
-    ff_dsputil_init(&s->dsp, avctx);
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-    ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
-    ff_fmt_convert_init(&s->fmt_conv, avctx);
-    av_lfg_init(&s->dith_state, 0);
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    /* allow downmixing to stereo or mono */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
-    if (avctx->request_channels == 1)
-        avctx->request_channel_layout = AV_CH_LAYOUT_MONO;
-    else if (avctx->request_channels == 2)
-        avctx->request_channel_layout = AV_CH_LAYOUT_STEREO;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-    if (avctx->channels > 1 &&
-        avctx->request_channel_layout == AV_CH_LAYOUT_MONO)
-        avctx->channels = 1;
-    else if (avctx->channels > 2 &&
-             avctx->request_channel_layout == AV_CH_LAYOUT_STEREO)
-        avctx->channels = 2;
-    s->downmixed = 1;
-
-    for (i = 0; i < AC3_MAX_CHANNELS; i++) {
-        s->xcfptr[i] = s->transform_coeffs[i];
-        s->dlyptr[i] = s->delay[i];
-    }
-
-    return 0;
-}
-
-/**
- * Parse the 'sync info' and 'bit stream info' from the AC-3 bitstream.
- * GetBitContext within AC3DecodeContext must point to
- * the start of the synchronized AC-3 bitstream.
- */
-static int ac3_parse_header(AC3DecodeContext *s)
-{
-    GetBitContext *gbc = &s->gbc;
-    int i;
-
-    /* read the rest of the bsi. read twice for dual mono mode. */
-    i = !s->channel_mode;
-    do {
-        skip_bits(gbc, 5); // skip dialog normalization
-        if (get_bits1(gbc))
-            skip_bits(gbc, 8); //skip compression
-        if (get_bits1(gbc))
-            skip_bits(gbc, 8); //skip language code
-        if (get_bits1(gbc))
-            skip_bits(gbc, 7); //skip audio production information
-    } while (i--);
-
-    skip_bits(gbc, 2); //skip copyright bit and original bitstream bit
-
-    /* skip the timecodes or parse the Alternate Bit Stream Syntax */
-    if (s->bitstream_id != 6) {
-        if (get_bits1(gbc))
-            skip_bits(gbc, 14); //skip timecode1
-        if (get_bits1(gbc))
-            skip_bits(gbc, 14); //skip timecode2
-    } else {
-        if (get_bits1(gbc)) {
-            s->preferred_downmix       = get_bits(gbc, 2);
-            s->center_mix_level_ltrt   = get_bits(gbc, 3);
-            s->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7);
-            s->center_mix_level        = get_bits(gbc, 3);
-            s->surround_mix_level      = av_clip(get_bits(gbc, 3), 3, 7);
-        }
-        if (get_bits1(gbc)) {
-            s->dolby_surround_ex_mode = get_bits(gbc, 2);
-            s->dolby_headphone_mode   = get_bits(gbc, 2);
-            skip_bits(gbc, 10); // skip adconvtyp (1), xbsi2 (8), encinfo (1)
-        }
-    }
-
-    /* skip additional bitstream info */
-    if (get_bits1(gbc)) {
-        i = get_bits(gbc, 6);
-        do {
-            skip_bits(gbc, 8);
-        } while (i--);
-    }
-
-    return 0;
-}
-
-/**
- * Common function to parse AC-3 or E-AC-3 frame header
- */
-static int parse_frame_header(AC3DecodeContext *s)
-{
-    AC3HeaderInfo hdr;
-    int err;
-
-    err = avpriv_ac3_parse_header(&s->gbc, &hdr);
-    if (err)
-        return err;
-
-    /* get decoding parameters from header info */
-    s->bit_alloc_params.sr_code     = hdr.sr_code;
-    s->bitstream_id                 = hdr.bitstream_id;
-    s->bitstream_mode               = hdr.bitstream_mode;
-    s->channel_mode                 = hdr.channel_mode;
-    s->lfe_on                       = hdr.lfe_on;
-    s->bit_alloc_params.sr_shift    = hdr.sr_shift;
-    s->sample_rate                  = hdr.sample_rate;
-    s->bit_rate                     = hdr.bit_rate;
-    s->channels                     = hdr.channels;
-    s->fbw_channels                 = s->channels - s->lfe_on;
-    s->lfe_ch                       = s->fbw_channels + 1;
-    s->frame_size                   = hdr.frame_size;
-    s->preferred_downmix            = AC3_DMIXMOD_NOTINDICATED;
-    s->center_mix_level             = hdr.center_mix_level;
-    s->center_mix_level_ltrt        = 4; // -3.0dB
-    s->surround_mix_level           = hdr.surround_mix_level;
-    s->surround_mix_level_ltrt      = 4; // -3.0dB
-    s->lfe_mix_level_exists         = 0;
-    s->num_blocks                   = hdr.num_blocks;
-    s->frame_type                   = hdr.frame_type;
-    s->substreamid                  = hdr.substreamid;
-    s->dolby_surround_mode          = hdr.dolby_surround_mode;
-    s->dolby_surround_ex_mode       = AC3_DSUREXMOD_NOTINDICATED;
-    s->dolby_headphone_mode         = AC3_DHEADPHONMOD_NOTINDICATED;
-
-    if (s->lfe_on) {
-        s->start_freq[s->lfe_ch]     = 0;
-        s->end_freq[s->lfe_ch]       = 7;
-        s->num_exp_groups[s->lfe_ch] = 2;
-        s->channel_in_cpl[s->lfe_ch] = 0;
-    }
-
-    if (s->bitstream_id <= 10) {
-        s->eac3                  = 0;
-        s->snr_offset_strategy   = 2;
-        s->block_switch_syntax   = 1;
-        s->dither_flag_syntax    = 1;
-        s->bit_allocation_syntax = 1;
-        s->fast_gain_syntax      = 0;
-        s->first_cpl_leak        = 0;
-        s->dba_syntax            = 1;
-        s->skip_syntax           = 1;
-        memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));
-        return ac3_parse_header(s);
-    } else if (CONFIG_EAC3_DECODER) {
-        s->eac3 = 1;
-        return ff_eac3_parse_header(s);
-    } else {
-        av_log(s->avctx, AV_LOG_ERROR, "E-AC-3 support not compiled in\n");
-        return AVERROR(ENOSYS);
-    }
-}
-
-/**
- * Set stereo downmixing coefficients based on frame header info.
- * reference: Section 7.8.2 Downmixing Into Two Channels
- */
-static void set_downmix_coeffs(AC3DecodeContext *s)
-{
-    int i;
-    float cmix = gain_levels[s->  center_mix_level];
-    float smix = gain_levels[s->surround_mix_level];
-    float norm0, norm1;
-
-    for (i = 0; i < s->fbw_channels; i++) {
-        s->downmix_coeffs[i][0] = gain_levels[ac3_default_coeffs[s->channel_mode][i][0]];
-        s->downmix_coeffs[i][1] = gain_levels[ac3_default_coeffs[s->channel_mode][i][1]];
-    }
-    if (s->channel_mode > 1 && s->channel_mode & 1) {
-        s->downmix_coeffs[1][0] = s->downmix_coeffs[1][1] = cmix;
-    }
-    if (s->channel_mode == AC3_CHMODE_2F1R || s->channel_mode == AC3_CHMODE_3F1R) {
-        int nf = s->channel_mode - 2;
-        s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf][1] = smix * LEVEL_MINUS_3DB;
-    }
-    if (s->channel_mode == AC3_CHMODE_2F2R || s->channel_mode == AC3_CHMODE_3F2R) {
-        int nf = s->channel_mode - 4;
-        s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf+1][1] = smix;
-    }
-
-    /* renormalize */
-    norm0 = norm1 = 0.0;
-    for (i = 0; i < s->fbw_channels; i++) {
-        norm0 += s->downmix_coeffs[i][0];
-        norm1 += s->downmix_coeffs[i][1];
-    }
-    norm0 = 1.0f / norm0;
-    norm1 = 1.0f / norm1;
-    for (i = 0; i < s->fbw_channels; i++) {
-        s->downmix_coeffs[i][0] *= norm0;
-        s->downmix_coeffs[i][1] *= norm1;
-    }
-
-    if (s->output_mode == AC3_CHMODE_MONO) {
-        for (i = 0; i < s->fbw_channels; i++)
-            s->downmix_coeffs[i][0] = (s->downmix_coeffs[i][0] +
-                                       s->downmix_coeffs[i][1]) * LEVEL_MINUS_3DB;
-    }
-}
-
-/**
- * Decode the grouped exponents according to exponent strategy.
- * reference: Section 7.1.3 Exponent Decoding
- */
-static int decode_exponents(GetBitContext *gbc, int exp_strategy, int ngrps,
-                            uint8_t absexp, int8_t *dexps)
-{
-    int i, j, grp, group_size;
-    int dexp[256];
-    int expacc, prevexp;
-
-    /* unpack groups */
-    group_size = exp_strategy + (exp_strategy == EXP_D45);
-    for (grp = 0, i = 0; grp < ngrps; grp++) {
-        expacc = get_bits(gbc, 7);
-        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][0];
-        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][1];
-        dexp[i++] = ungroup_3_in_7_bits_tab[expacc][2];
-    }
-
-    /* convert to absolute exps and expand groups */
-    prevexp = absexp;
-    for (i = 0, j = 0; i < ngrps * 3; i++) {
-        prevexp += dexp[i] - 2;
-        if (prevexp > 24U)
-            return -1;
-        switch (group_size) {
-        case 4: dexps[j++] = prevexp;
-                dexps[j++] = prevexp;
-        case 2: dexps[j++] = prevexp;
-        case 1: dexps[j++] = prevexp;
-        }
-    }
-    return 0;
-}
-
-/**
- * Generate transform coefficients for each coupled channel in the coupling
- * range using the coupling coefficients and coupling coordinates.
- * reference: Section 7.4.3 Coupling Coordinate Format
- */
-static void calc_transform_coeffs_cpl(AC3DecodeContext *s)
-{
-    int bin, band, ch;
-
-    bin = s->start_freq[CPL_CH];
-    for (band = 0; band < s->num_cpl_bands; band++) {
-        int band_start = bin;
-        int band_end = bin + s->cpl_band_sizes[band];
-        for (ch = 1; ch <= s->fbw_channels; ch++) {
-            if (s->channel_in_cpl[ch]) {
-                int cpl_coord = s->cpl_coords[ch][band] << 5;
-                for (bin = band_start; bin < band_end; bin++) {
-                    s->fixed_coeffs[ch][bin] =
-                        MULH(s->fixed_coeffs[CPL_CH][bin] << 4, cpl_coord);
-                }
-                if (ch == 2 && s->phase_flags[band]) {
-                    for (bin = band_start; bin < band_end; bin++)
-                        s->fixed_coeffs[2][bin] = -s->fixed_coeffs[2][bin];
-                }
-            }
-        }
-        bin = band_end;
-    }
-}
-
-/**
- * Grouped mantissas for 3-level 5-level and 11-level quantization
- */
-typedef struct {
-    int b1_mant[2];
-    int b2_mant[2];
-    int b4_mant;
-    int b1;
-    int b2;
-    int b4;
-} mant_groups;
-
-/**
- * Decode the transform coefficients for a particular channel
- * reference: Section 7.3 Quantization and Decoding of Mantissas
- */
-static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, mant_groups *m)
-{
-    int start_freq = s->start_freq[ch_index];
-    int end_freq   = s->end_freq[ch_index];
-    uint8_t *baps  = s->bap[ch_index];
-    int8_t *exps   = s->dexps[ch_index];
-    int32_t *coeffs = s->fixed_coeffs[ch_index];
-    int dither     = (ch_index == CPL_CH) || s->dither_flag[ch_index];
-    GetBitContext *gbc = &s->gbc;
-    int freq;
-
-    for (freq = start_freq; freq < end_freq; freq++) {
-        int bap = baps[freq];
-        int mantissa;
-        switch (bap) {
-        case 0:
-            /* random noise with approximate range of -0.707 to 0.707 */
-            if (dither)
-                mantissa = (av_lfg_get(&s->dith_state) / 362) - 5932275;
-            else
-                mantissa = 0;
-            break;
-        case 1:
-            if (m->b1) {
-                m->b1--;
-                mantissa = m->b1_mant[m->b1];
-            } else {
-                int bits      = get_bits(gbc, 5);
-                mantissa      = b1_mantissas[bits][0];
-                m->b1_mant[1] = b1_mantissas[bits][1];
-                m->b1_mant[0] = b1_mantissas[bits][2];
-                m->b1         = 2;
-            }
-            break;
-        case 2:
-            if (m->b2) {
-                m->b2--;
-                mantissa = m->b2_mant[m->b2];
-            } else {
-                int bits      = get_bits(gbc, 7);
-                mantissa      = b2_mantissas[bits][0];
-                m->b2_mant[1] = b2_mantissas[bits][1];
-                m->b2_mant[0] = b2_mantissas[bits][2];
-                m->b2         = 2;
-            }
-            break;
-        case 3:
-            mantissa = b3_mantissas[get_bits(gbc, 3)];
-            break;
-        case 4:
-            if (m->b4) {
-                m->b4 = 0;
-                mantissa = m->b4_mant;
-            } else {
-                int bits   = get_bits(gbc, 7);
-                mantissa   = b4_mantissas[bits][0];
-                m->b4_mant = b4_mantissas[bits][1];
-                m->b4      = 1;
-            }
-            break;
-        case 5:
-            mantissa = b5_mantissas[get_bits(gbc, 4)];
-            break;
-        default: /* 6 to 15 */
-            /* Shift mantissa and sign-extend it. */
-            mantissa = get_sbits(gbc, quantization_tab[bap]);
-            mantissa <<= 24 - quantization_tab[bap];
-            break;
-        }
-        coeffs[freq] = mantissa >> exps[freq];
-    }
-}
-
-/**
- * Remove random dithering from coupling range coefficients with zero-bit
- * mantissas for coupled channels which do not use dithering.
- * reference: Section 7.3.4 Dither for Zero Bit Mantissas (bap=0)
- */
-static void remove_dithering(AC3DecodeContext *s) {
-    int ch, i;
-
-    for (ch = 1; ch <= s->fbw_channels; ch++) {
-        if (!s->dither_flag[ch] && s->channel_in_cpl[ch]) {
-            for (i = s->start_freq[CPL_CH]; i < s->end_freq[CPL_CH]; i++) {
-                if (!s->bap[CPL_CH][i])
-                    s->fixed_coeffs[ch][i] = 0;
-            }
-        }
-    }
-}
-
-static void decode_transform_coeffs_ch(AC3DecodeContext *s, int blk, int ch,
-                                       mant_groups *m)
-{
-    if (!s->channel_uses_aht[ch]) {
-        ac3_decode_transform_coeffs_ch(s, ch, m);
-    } else {
-        /* if AHT is used, mantissas for all blocks are encoded in the first
-           block of the frame. */
-        int bin;
-        if (!blk && CONFIG_EAC3_DECODER)
-            ff_eac3_decode_transform_coeffs_aht_ch(s, ch);
-        for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
-            s->fixed_coeffs[ch][bin] = s->pre_mantissa[ch][bin][blk] >> s->dexps[ch][bin];
-        }
-    }
-}
-
-/**
- * Decode the transform coefficients.
- */
-static void decode_transform_coeffs(AC3DecodeContext *s, int blk)
-{
-    int ch, end;
-    int got_cplchan = 0;
-    mant_groups m;
-
-    m.b1 = m.b2 = m.b4 = 0;
-
-    for (ch = 1; ch <= s->channels; ch++) {
-        /* transform coefficients for full-bandwidth channel */
-        decode_transform_coeffs_ch(s, blk, ch, &m);
-        /* transform coefficients for coupling channel come right after the
-           coefficients for the first coupled channel*/
-        if (s->channel_in_cpl[ch])  {
-            if (!got_cplchan) {
-                decode_transform_coeffs_ch(s, blk, CPL_CH, &m);
-                calc_transform_coeffs_cpl(s);
-                got_cplchan = 1;
-            }
-            end = s->end_freq[CPL_CH];
-        } else {
-            end = s->end_freq[ch];
-        }
-        do
-            s->fixed_coeffs[ch][end] = 0;
-        while (++end < 256);
-    }
-
-    /* zero the dithered coefficients for appropriate channels */
-    remove_dithering(s);
-}
-
-/**
- * Stereo rematrixing.
- * reference: Section 7.5.4 Rematrixing : Decoding Technique
- */
-static void do_rematrixing(AC3DecodeContext *s)
-{
-    int bnd, i;
-    int end, bndend;
-
-    end = FFMIN(s->end_freq[1], s->end_freq[2]);
-
-    for (bnd = 0; bnd < s->num_rematrixing_bands; bnd++) {
-        if (s->rematrixing_flags[bnd]) {
-            bndend = FFMIN(end, ff_ac3_rematrix_band_tab[bnd + 1]);
-            for (i = ff_ac3_rematrix_band_tab[bnd]; i < bndend; i++) {
-                int tmp0 = s->fixed_coeffs[1][i];
-                s->fixed_coeffs[1][i] += s->fixed_coeffs[2][i];
-                s->fixed_coeffs[2][i]  = tmp0 - s->fixed_coeffs[2][i];
-            }
-        }
-    }
-}
-
-/**
- * Inverse MDCT Transform.
- * Convert frequency domain coefficients to time-domain audio samples.
- * reference: Section 7.9.4 Transformation Equations
- */
-static inline void do_imdct(AC3DecodeContext *s, int channels)
-{
-    int ch;
-
-    for (ch = 1; ch <= channels; ch++) {
-        if (s->block_switch[ch]) {
-            int i;
-            float *x = s->tmp_output + 128;
-            for (i = 0; i < 128; i++)
-                x[i] = s->transform_coeffs[ch][2 * i];
-            s->imdct_256.imdct_half(&s->imdct_256, s->tmp_output, x);
-            s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
-                                       s->tmp_output, s->window, 128);
-            for (i = 0; i < 128; i++)
-                x[i] = s->transform_coeffs[ch][2 * i + 1];
-            s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch - 1], x);
-        } else {
-            s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
-            s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
-                                       s->tmp_output, s->window, 128);
-            memcpy(s->delay[ch - 1], s->tmp_output + 128, 128 * sizeof(float));
-        }
-    }
-}
-
-/**
- * Upmix delay samples from stereo to original channel layout.
- */
-static void ac3_upmix_delay(AC3DecodeContext *s)
-{
-    int channel_data_size = sizeof(s->delay[0]);
-    switch (s->channel_mode) {
-    case AC3_CHMODE_DUALMONO:
-    case AC3_CHMODE_STEREO:
-        /* upmix mono to stereo */
-        memcpy(s->delay[1], s->delay[0], channel_data_size);
-        break;
-    case AC3_CHMODE_2F2R:
-        memset(s->delay[3], 0, channel_data_size);
-    case AC3_CHMODE_2F1R:
-        memset(s->delay[2], 0, channel_data_size);
-        break;
-    case AC3_CHMODE_3F2R:
-        memset(s->delay[4], 0, channel_data_size);
-    case AC3_CHMODE_3F1R:
-        memset(s->delay[3], 0, channel_data_size);
-    case AC3_CHMODE_3F:
-        memcpy(s->delay[2], s->delay[1], channel_data_size);
-        memset(s->delay[1], 0, channel_data_size);
-        break;
-    }
-}
-
-/**
- * Decode band structure for coupling, spectral extension, or enhanced coupling.
- * The band structure defines how many subbands are in each band.  For each
- * subband in the range, 1 means it is combined with the previous band, and 0
- * means that it starts a new band.
- *
- * @param[in] gbc bit reader context
- * @param[in] blk block number
- * @param[in] eac3 flag to indicate E-AC-3
- * @param[in] ecpl flag to indicate enhanced coupling
- * @param[in] start_subband subband number for start of range
- * @param[in] end_subband subband number for end of range
- * @param[in] default_band_struct default band structure table
- * @param[out] num_bands number of bands (optionally NULL)
- * @param[out] band_sizes array containing the number of bins in each band (optionally NULL)
- */
-static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
-                                  int ecpl, int start_subband, int end_subband,
-                                  const uint8_t *default_band_struct,
-                                  int *num_bands, uint8_t *band_sizes)
-{
-    int subbnd, bnd, n_subbands, n_bands=0;
-    uint8_t bnd_sz[22];
-    uint8_t coded_band_struct[22];
-    const uint8_t *band_struct;
-
-    n_subbands = end_subband - start_subband;
-
-    /* decode band structure from bitstream or use default */
-    if (!eac3 || get_bits1(gbc)) {
-        for (subbnd = 0; subbnd < n_subbands - 1; subbnd++) {
-            coded_band_struct[subbnd] = get_bits1(gbc);
-        }
-        band_struct = coded_band_struct;
-    } else if (!blk) {
-        band_struct = &default_band_struct[start_subband+1];
-    } else {
-        /* no change in band structure */
-        return;
-    }
-
-    /* calculate number of bands and band sizes based on band structure.
-       note that the first 4 subbands in enhanced coupling span only 6 bins
-       instead of 12. */
-    if (num_bands || band_sizes ) {
-        n_bands = n_subbands;
-        bnd_sz[0] = ecpl ? 6 : 12;
-        for (bnd = 0, subbnd = 1; subbnd < n_subbands; subbnd++) {
-            int subbnd_size = (ecpl && subbnd < 4) ? 6 : 12;
-            if (band_struct[subbnd - 1]) {
-                n_bands--;
-                bnd_sz[bnd] += subbnd_size;
-            } else {
-                bnd_sz[++bnd] = subbnd_size;
-            }
-        }
-    }
-
-    /* set optional output params */
-    if (num_bands)
-        *num_bands = n_bands;
-    if (band_sizes)
-        memcpy(band_sizes, bnd_sz, n_bands);
-}
-
-/**
- * Decode a single audio block from the AC-3 bitstream.
- */
-static int decode_audio_block(AC3DecodeContext *s, int blk)
-{
-    int fbw_channels = s->fbw_channels;
-    int channel_mode = s->channel_mode;
-    int i, bnd, seg, ch;
-    int different_transforms;
-    int downmix_output;
-    int cpl_in_use;
-    GetBitContext *gbc = &s->gbc;
-    uint8_t bit_alloc_stages[AC3_MAX_CHANNELS] = { 0 };
-
-    /* block switch flags */
-    different_transforms = 0;
-    if (s->block_switch_syntax) {
-        for (ch = 1; ch <= fbw_channels; ch++) {
-            s->block_switch[ch] = get_bits1(gbc);
-            if (ch > 1 && s->block_switch[ch] != s->block_switch[1])
-                different_transforms = 1;
-        }
-    }
-
-    /* dithering flags */
-    if (s->dither_flag_syntax) {
-        for (ch = 1; ch <= fbw_channels; ch++) {
-            s->dither_flag[ch] = get_bits1(gbc);
-        }
-    }
-
-    /* dynamic range */
-    i = !s->channel_mode;
-    do {
-        if (get_bits1(gbc)) {
-            /* Allow asymmetric application of DRC when drc_scale > 1.
-               Amplification of quiet sounds is enhanced */
-            float range = dynamic_range_tab[get_bits(gbc, 8)];
-            if (range > 1.0 || s->drc_scale <= 1.0)
-                s->dynamic_range[i] = powf(range, s->drc_scale);
-            else
-                s->dynamic_range[i] = range;
-        } else if (blk == 0) {
-            s->dynamic_range[i] = 1.0f;
-        }
-    } while (i--);
-
-    /* spectral extension strategy */
-    if (s->eac3 && (!blk || get_bits1(gbc))) {
-        s->spx_in_use = get_bits1(gbc);
-        if (s->spx_in_use) {
-            int dst_start_freq, dst_end_freq, src_start_freq,
-                start_subband, end_subband;
-
-            /* determine which channels use spx */
-            if (s->channel_mode == AC3_CHMODE_MONO) {
-                s->channel_uses_spx[1] = 1;
-            } else {
-                for (ch = 1; ch <= fbw_channels; ch++)
-                    s->channel_uses_spx[ch] = get_bits1(gbc);
-            }
-
-            /* get the frequency bins of the spx copy region and the spx start
-               and end subbands */
-            dst_start_freq = get_bits(gbc, 2);
-            start_subband  = get_bits(gbc, 3) + 2;
-            if (start_subband > 7)
-                start_subband += start_subband - 7;
-            end_subband    = get_bits(gbc, 3) + 5;
-            if (end_subband   > 7)
-                end_subband   += end_subband   - 7;
-            dst_start_freq = dst_start_freq * 12 + 25;
-            src_start_freq = start_subband  * 12 + 25;
-            dst_end_freq   = end_subband    * 12 + 25;
-
-            /* check validity of spx ranges */
-            if (start_subband >= end_subband) {
-                av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "
-                       "range (%d >= %d)\n", start_subband, end_subband);
-                return AVERROR_INVALIDDATA;
-            }
-            if (dst_start_freq >= src_start_freq) {
-                av_log(s->avctx, AV_LOG_ERROR, "invalid spectral extension "
-                       "copy start bin (%d >= %d)\n", dst_start_freq, src_start_freq);
-                return AVERROR_INVALIDDATA;
-            }
-
-            s->spx_dst_start_freq = dst_start_freq;
-            s->spx_src_start_freq = src_start_freq;
-            s->spx_dst_end_freq   = dst_end_freq;
-
-            decode_band_structure(gbc, blk, s->eac3, 0,
-                                  start_subband, end_subband,
-                                  ff_eac3_default_spx_band_struct,
-                                  &s->num_spx_bands,
-                                  s->spx_band_sizes);
-        } else {
-            for (ch = 1; ch <= fbw_channels; ch++) {
-                s->channel_uses_spx[ch] = 0;
-                s->first_spx_coords[ch] = 1;
-            }
-        }
-    }
-
-    /* spectral extension coordinates */
-    if (s->spx_in_use) {
-        for (ch = 1; ch <= fbw_channels; ch++) {
-            if (s->channel_uses_spx[ch]) {
-                if (s->first_spx_coords[ch] || get_bits1(gbc)) {
-                    float spx_blend;
-                    int bin, master_spx_coord;
-
-                    s->first_spx_coords[ch] = 0;
-                    spx_blend = get_bits(gbc, 5) * (1.0f/32);
-                    master_spx_coord = get_bits(gbc, 2) * 3;
-
-                    bin = s->spx_src_start_freq;
-                    for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
-                        int bandsize;
-                        int spx_coord_exp, spx_coord_mant;
-                        float nratio, sblend, nblend, spx_coord;
-
-                        /* calculate blending factors */
-                        bandsize = s->spx_band_sizes[bnd];
-                        nratio = ((float)((bin + (bandsize >> 1))) / s->spx_dst_end_freq) - spx_blend;
-                        nratio = av_clipf(nratio, 0.0f, 1.0f);
-                        nblend = sqrtf(3.0f * nratio); // noise is scaled by sqrt(3)
-                                                       // to give unity variance
-                        sblend = sqrtf(1.0f - nratio);
-                        bin += bandsize;
-
-                        /* decode spx coordinates */
-                        spx_coord_exp  = get_bits(gbc, 4);
-                        spx_coord_mant = get_bits(gbc, 2);
-                        if (spx_coord_exp == 15) spx_coord_mant <<= 1;
-                        else                     spx_coord_mant += 4;
-                        spx_coord_mant <<= (25 - spx_coord_exp - master_spx_coord);
-                        spx_coord = spx_coord_mant * (1.0f / (1 << 23));
-
-                        /* multiply noise and signal blending factors by spx coordinate */
-                        s->spx_noise_blend [ch][bnd] = nblend * spx_coord;
-                        s->spx_signal_blend[ch][bnd] = sblend * spx_coord;
-                    }
-                }
-            } else {
-                s->first_spx_coords[ch] = 1;
-            }
-        }
-    }
-
-    /* coupling strategy */
-    if (s->eac3 ? s->cpl_strategy_exists[blk] : get_bits1(gbc)) {
-        memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS);
-        if (!s->eac3)
-            s->cpl_in_use[blk] = get_bits1(gbc);
-        if (s->cpl_in_use[blk]) {
-            /* coupling in use */
-            int cpl_start_subband, cpl_end_subband;
-
-            if (channel_mode < AC3_CHMODE_STEREO) {
-                av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            /* check for enhanced coupling */
-            if (s->eac3 && get_bits1(gbc)) {
-                /* TODO: parse enhanced coupling strategy info */
-                avpriv_request_sample(s->avctx, "Enhanced coupling");
-                return AVERROR_PATCHWELCOME;
-            }
-
-            /* determine which channels are coupled */
-            if (s->eac3 && s->channel_mode == AC3_CHMODE_STEREO) {
-                s->channel_in_cpl[1] = 1;
-                s->channel_in_cpl[2] = 1;
-            } else {
-                for (ch = 1; ch <= fbw_channels; ch++)
-                    s->channel_in_cpl[ch] = get_bits1(gbc);
-            }
-
-            /* phase flags in use */
-            if (channel_mode == AC3_CHMODE_STEREO)
-                s->phase_flags_in_use = get_bits1(gbc);
-
-            /* coupling frequency range */
-            cpl_start_subband = get_bits(gbc, 4);
-            cpl_end_subband = s->spx_in_use ? (s->spx_src_start_freq - 37) / 12 :
-                                              get_bits(gbc, 4) + 3;
-            if (cpl_start_subband >= cpl_end_subband) {
-                av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d >= %d)\n",
-                       cpl_start_subband, cpl_end_subband);
-                return AVERROR_INVALIDDATA;
-            }
-            s->start_freq[CPL_CH] = cpl_start_subband * 12 + 37;
-            s->end_freq[CPL_CH]   = cpl_end_subband   * 12 + 37;
-
-            decode_band_structure(gbc, blk, s->eac3, 0, cpl_start_subband,
-                                  cpl_end_subband,
-                                  ff_eac3_default_cpl_band_struct,
-                                  &s->num_cpl_bands, s->cpl_band_sizes);
-        } else {
-            /* coupling not in use */
-            for (ch = 1; ch <= fbw_channels; ch++) {
-                s->channel_in_cpl[ch] = 0;
-                s->first_cpl_coords[ch] = 1;
-            }
-            s->first_cpl_leak = s->eac3;
-            s->phase_flags_in_use = 0;
-        }
-    } else if (!s->eac3) {
-        if (!blk) {
-            av_log(s->avctx, AV_LOG_ERROR, "new coupling strategy must "
-                   "be present in block 0\n");
-            return AVERROR_INVALIDDATA;
-        } else {
-            s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
-        }
-    }
-    cpl_in_use = s->cpl_in_use[blk];
-
-    /* coupling coordinates */
-    if (cpl_in_use) {
-        int cpl_coords_exist = 0;
-
-        for (ch = 1; ch <= fbw_channels; ch++) {
-            if (s->channel_in_cpl[ch]) {
-                if ((s->eac3 && s->first_cpl_coords[ch]) || get_bits1(gbc)) {
-                    int master_cpl_coord, cpl_coord_exp, cpl_coord_mant;
-                    s->first_cpl_coords[ch] = 0;
-                    cpl_coords_exist = 1;
-                    master_cpl_coord = 3 * get_bits(gbc, 2);
-                    for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
-                        cpl_coord_exp = get_bits(gbc, 4);
-                        cpl_coord_mant = get_bits(gbc, 4);
-                        if (cpl_coord_exp == 15)
-                            s->cpl_coords[ch][bnd] = cpl_coord_mant << 22;
-                        else
-                            s->cpl_coords[ch][bnd] = (cpl_coord_mant + 16) << 21;
-                        s->cpl_coords[ch][bnd] >>= (cpl_coord_exp + master_cpl_coord);
-                    }
-                } else if (!blk) {
-                    av_log(s->avctx, AV_LOG_ERROR, "new coupling coordinates must "
-                           "be present in block 0\n");
-                    return AVERROR_INVALIDDATA;
-                }
-            } else {
-                /* channel not in coupling */
-                s->first_cpl_coords[ch] = 1;
-            }
-        }
-        /* phase flags */
-        if (channel_mode == AC3_CHMODE_STEREO && cpl_coords_exist) {
-            for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
-                s->phase_flags[bnd] = s->phase_flags_in_use? get_bits1(gbc) : 0;
-            }
-        }
-    }
-
-    /* stereo rematrixing strategy and band structure */
-    if (channel_mode == AC3_CHMODE_STEREO) {
-        if ((s->eac3 && !blk) || get_bits1(gbc)) {
-            s->num_rematrixing_bands = 4;
-            if (cpl_in_use && s->start_freq[CPL_CH] <= 61) {
-                s->num_rematrixing_bands -= 1 + (s->start_freq[CPL_CH] == 37);
-            } else if (s->spx_in_use && s->spx_src_start_freq <= 61) {
-                s->num_rematrixing_bands--;
-            }
-            for (bnd = 0; bnd < s->num_rematrixing_bands; bnd++)
-                s->rematrixing_flags[bnd] = get_bits1(gbc);
-        } else if (!blk) {
-            av_log(s->avctx, AV_LOG_WARNING, "Warning: "
-                   "new rematrixing strategy not present in block 0\n");
-            s->num_rematrixing_bands = 0;
-        }
-    }
-
-    /* exponent strategies for each channel */
-    for (ch = !cpl_in_use; ch <= s->channels; ch++) {
-        if (!s->eac3)
-            s->exp_strategy[blk][ch] = get_bits(gbc, 2 - (ch == s->lfe_ch));
-        if (s->exp_strategy[blk][ch] != EXP_REUSE)
-            bit_alloc_stages[ch] = 3;
-    }
-
-    /* channel bandwidth */
-    for (ch = 1; ch <= fbw_channels; ch++) {
-        s->start_freq[ch] = 0;
-        if (s->exp_strategy[blk][ch] != EXP_REUSE) {
-            int group_size;
-            int prev = s->end_freq[ch];
-            if (s->channel_in_cpl[ch])
-                s->end_freq[ch] = s->start_freq[CPL_CH];
-            else if (s->channel_uses_spx[ch])
-                s->end_freq[ch] = s->spx_src_start_freq;
-            else {
-                int bandwidth_code = get_bits(gbc, 6);
-                if (bandwidth_code > 60) {
-                    av_log(s->avctx, AV_LOG_ERROR, "bandwidth code = %d > 60\n", bandwidth_code);
-                    return AVERROR_INVALIDDATA;
-                }
-                s->end_freq[ch] = bandwidth_code * 3 + 73;
-            }
-            group_size = 3 << (s->exp_strategy[blk][ch] - 1);
-            s->num_exp_groups[ch] = (s->end_freq[ch] + group_size-4) / group_size;
-            if (blk > 0 && s->end_freq[ch] != prev)
-                memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS);
-        }
-    }
-    if (cpl_in_use && s->exp_strategy[blk][CPL_CH] != EXP_REUSE) {
-        s->num_exp_groups[CPL_CH] = (s->end_freq[CPL_CH] - s->start_freq[CPL_CH]) /
-                                    (3 << (s->exp_strategy[blk][CPL_CH] - 1));
-    }
-
-    /* decode exponents for each channel */
-    for (ch = !cpl_in_use; ch <= s->channels; ch++) {
-        if (s->exp_strategy[blk][ch] != EXP_REUSE) {
-            s->dexps[ch][0] = get_bits(gbc, 4) << !ch;
-            if (decode_exponents(gbc, s->exp_strategy[blk][ch],
-                                 s->num_exp_groups[ch], s->dexps[ch][0],
-                                 &s->dexps[ch][s->start_freq[ch]+!!ch])) {
-                av_log(s->avctx, AV_LOG_ERROR, "exponent out-of-range\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (ch != CPL_CH && ch != s->lfe_ch)
-                skip_bits(gbc, 2); /* skip gainrng */
-        }
-    }
-
-    /* bit allocation information */
-    if (s->bit_allocation_syntax) {
-        if (get_bits1(gbc)) {
-            s->bit_alloc_params.slow_decay = ff_ac3_slow_decay_tab[get_bits(gbc, 2)] >> s->bit_alloc_params.sr_shift;
-            s->bit_alloc_params.fast_decay = ff_ac3_fast_decay_tab[get_bits(gbc, 2)] >> s->bit_alloc_params.sr_shift;
-            s->bit_alloc_params.slow_gain  = ff_ac3_slow_gain_tab[get_bits(gbc, 2)];
-            s->bit_alloc_params.db_per_bit = ff_ac3_db_per_bit_tab[get_bits(gbc, 2)];
-            s->bit_alloc_params.floor  = ff_ac3_floor_tab[get_bits(gbc, 3)];
-            for (ch = !cpl_in_use; ch <= s->channels; ch++)
-                bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
-        } else if (!blk) {
-            av_log(s->avctx, AV_LOG_ERROR, "new bit allocation info must "
-                   "be present in block 0\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    /* signal-to-noise ratio offsets and fast gains (signal-to-mask ratios) */
-    if (!s->eac3 || !blk) {
-        if (s->snr_offset_strategy && get_bits1(gbc)) {
-            int snr = 0;
-            int csnr;
-            csnr = (get_bits(gbc, 6) - 15) << 4;
-            for (i = ch = !cpl_in_use; ch <= s->channels; ch++) {
-                /* snr offset */
-                if (ch == i || s->snr_offset_strategy == 2)
-                    snr = (csnr + get_bits(gbc, 4)) << 2;
-                /* run at least last bit allocation stage if snr offset changes */
-                if (blk && s->snr_offset[ch] != snr) {
-                    bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 1);
-                }
-                s->snr_offset[ch] = snr;
-
-                /* fast gain (normal AC-3 only) */
-                if (!s->eac3) {
-                    int prev = s->fast_gain[ch];
-                    s->fast_gain[ch] = ff_ac3_fast_gain_tab[get_bits(gbc, 3)];
-                    /* run last 2 bit allocation stages if fast gain changes */
-                    if (blk && prev != s->fast_gain[ch])
-                        bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
-                }
-            }
-        } else if (!s->eac3 && !blk) {
-            av_log(s->avctx, AV_LOG_ERROR, "new snr offsets must be present in block 0\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    /* fast gain (E-AC-3 only) */
-    if (s->fast_gain_syntax && get_bits1(gbc)) {
-        for (ch = !cpl_in_use; ch <= s->channels; ch++) {
-            int prev = s->fast_gain[ch];
-            s->fast_gain[ch] = ff_ac3_fast_gain_tab[get_bits(gbc, 3)];
-            /* run last 2 bit allocation stages if fast gain changes */
-            if (blk && prev != s->fast_gain[ch])
-                bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
-        }
-    } else if (s->eac3 && !blk) {
-        for (ch = !cpl_in_use; ch <= s->channels; ch++)
-            s->fast_gain[ch] = ff_ac3_fast_gain_tab[4];
-    }
-
-    /* E-AC-3 to AC-3 converter SNR offset */
-    if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && get_bits1(gbc)) {
-        skip_bits(gbc, 10); // skip converter snr offset
-    }
-
-    /* coupling leak information */
-    if (cpl_in_use) {
-        if (s->first_cpl_leak || get_bits1(gbc)) {
-            int fl = get_bits(gbc, 3);
-            int sl = get_bits(gbc, 3);
-            /* run last 2 bit allocation stages for coupling channel if
-               coupling leak changes */
-            if (blk && (fl != s->bit_alloc_params.cpl_fast_leak ||
-                sl != s->bit_alloc_params.cpl_slow_leak)) {
-                bit_alloc_stages[CPL_CH] = FFMAX(bit_alloc_stages[CPL_CH], 2);
-            }
-            s->bit_alloc_params.cpl_fast_leak = fl;
-            s->bit_alloc_params.cpl_slow_leak = sl;
-        } else if (!s->eac3 && !blk) {
-            av_log(s->avctx, AV_LOG_ERROR, "new coupling leak info must "
-                   "be present in block 0\n");
-            return AVERROR_INVALIDDATA;
-        }
-        s->first_cpl_leak = 0;
-    }
-
-    /* delta bit allocation information */
-    if (s->dba_syntax && get_bits1(gbc)) {
-        /* delta bit allocation exists (strategy) */
-        for (ch = !cpl_in_use; ch <= fbw_channels; ch++) {
-            s->dba_mode[ch] = get_bits(gbc, 2);
-            if (s->dba_mode[ch] == DBA_RESERVED) {
-                av_log(s->avctx, AV_LOG_ERROR, "delta bit allocation strategy reserved\n");
-                return AVERROR_INVALIDDATA;
-            }
-            bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
-        }
-        /* channel delta offset, len and bit allocation */
-        for (ch = !cpl_in_use; ch <= fbw_channels; ch++) {
-            if (s->dba_mode[ch] == DBA_NEW) {
-                s->dba_nsegs[ch] = get_bits(gbc, 3) + 1;
-                for (seg = 0; seg < s->dba_nsegs[ch]; seg++) {
-                    s->dba_offsets[ch][seg] = get_bits(gbc, 5);
-                    s->dba_lengths[ch][seg] = get_bits(gbc, 4);
-                    s->dba_values[ch][seg]  = get_bits(gbc, 3);
-                }
-                /* run last 2 bit allocation stages if new dba values */
-                bit_alloc_stages[ch] = FFMAX(bit_alloc_stages[ch], 2);
-            }
-        }
-    } else if (blk == 0) {
-        for (ch = 0; ch <= s->channels; ch++) {
-            s->dba_mode[ch] = DBA_NONE;
-        }
-    }
-
-    /* Bit allocation */
-    for (ch = !cpl_in_use; ch <= s->channels; ch++) {
-        if (bit_alloc_stages[ch] > 2) {
-            /* Exponent mapping into PSD and PSD integration */
-            ff_ac3_bit_alloc_calc_psd(s->dexps[ch],
-                                      s->start_freq[ch], s->end_freq[ch],
-                                      s->psd[ch], s->band_psd[ch]);
-        }
-        if (bit_alloc_stages[ch] > 1) {
-            /* Compute excitation function, Compute masking curve, and
-               Apply delta bit allocation */
-            if (ff_ac3_bit_alloc_calc_mask(&s->bit_alloc_params, s->band_psd[ch],
-                                           s->start_freq[ch],  s->end_freq[ch],
-                                           s->fast_gain[ch],   (ch == s->lfe_ch),
-                                           s->dba_mode[ch],    s->dba_nsegs[ch],
-                                           s->dba_offsets[ch], s->dba_lengths[ch],
-                                           s->dba_values[ch],  s->mask[ch])) {
-                av_log(s->avctx, AV_LOG_ERROR, "error in bit allocation\n");
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        if (bit_alloc_stages[ch] > 0) {
-            /* Compute bit allocation */
-            const uint8_t *bap_tab = s->channel_uses_aht[ch] ?
-                                     ff_eac3_hebap_tab : ff_ac3_bap_tab;
-            s->ac3dsp.bit_alloc_calc_bap(s->mask[ch], s->psd[ch],
-                                      s->start_freq[ch], s->end_freq[ch],
-                                      s->snr_offset[ch],
-                                      s->bit_alloc_params.floor,
-                                      bap_tab, s->bap[ch]);
-        }
-    }
-
-    /* unused dummy data */
-    if (s->skip_syntax && get_bits1(gbc)) {
-        int skipl = get_bits(gbc, 9);
-        while (skipl--)
-            skip_bits(gbc, 8);
-    }
-
-    /* unpack the transform coefficients
-       this also uncouples channels if coupling is in use. */
-    decode_transform_coeffs(s, blk);
-
-    /* TODO: generate enhanced coupling coordinates and uncouple */
-
-    /* recover coefficients if rematrixing is in use */
-    if (s->channel_mode == AC3_CHMODE_STEREO)
-        do_rematrixing(s);
-
-    /* apply scaling to coefficients (headroom, dynrng) */
-    for (ch = 1; ch <= s->channels; ch++) {
-        float gain = 1.0 / 4194304.0f;
-        if (s->channel_mode == AC3_CHMODE_DUALMONO) {
-            gain *= s->dynamic_range[2 - ch];
-        } else {
-            gain *= s->dynamic_range[0];
-        }
-        s->fmt_conv.int32_to_float_fmul_scalar(s->transform_coeffs[ch],
-                                               s->fixed_coeffs[ch], gain, 256);
-    }
-
-    /* apply spectral extension to high frequency bins */
-    if (s->spx_in_use && CONFIG_EAC3_DECODER) {
-        ff_eac3_apply_spectral_extension(s);
-    }
-
-    /* downmix and MDCT. order depends on whether block switching is used for
-       any channel in this block. this is because coefficients for the long
-       and short transforms cannot be mixed. */
-    downmix_output = s->channels != s->out_channels &&
-                     !((s->output_mode & AC3_OUTPUT_LFEON) &&
-                     s->fbw_channels == s->out_channels);
-    if (different_transforms) {
-        /* the delay samples have already been downmixed, so we upmix the delay
-           samples in order to reconstruct all channels before downmixing. */
-        if (s->downmixed) {
-            s->downmixed = 0;
-            ac3_upmix_delay(s);
-        }
-
-        do_imdct(s, s->channels);
-
-        if (downmix_output) {
-            s->ac3dsp.downmix(s->outptr, s->downmix_coeffs,
-                              s->out_channels, s->fbw_channels, 256);
-        }
-    } else {
-        if (downmix_output) {
-            s->ac3dsp.downmix(s->xcfptr + 1, s->downmix_coeffs,
-                              s->out_channels, s->fbw_channels, 256);
-        }
-
-        if (downmix_output && !s->downmixed) {
-            s->downmixed = 1;
-            s->ac3dsp.downmix(s->dlyptr, s->downmix_coeffs, s->out_channels,
-                              s->fbw_channels, 128);
-        }
-
-        do_imdct(s, s->out_channels);
-    }
-
-    return 0;
-}
-
-/**
- * Decode a single AC-3 frame.
- */
-static int ac3_decode_frame(AVCodecContext * avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    AC3DecodeContext *s = avctx->priv_data;
-    int blk, ch, err, ret;
-    const uint8_t *channel_map;
-    const float *output[AC3_MAX_CHANNELS];
-    enum AVMatrixEncoding matrix_encoding;
-    AVDownmixInfo *downmix_info;
-
-    /* copy input buffer to decoder context to avoid reading past the end
-       of the buffer, which can be caused by a damaged input stream. */
-    if (buf_size >= 2 && AV_RB16(buf) == 0x770B) {
-        // seems to be byte-swapped AC-3
-        int cnt = FFMIN(buf_size, AC3_FRAME_BUFFER_SIZE) >> 1;
-        s->dsp.bswap16_buf((uint16_t *)s->input_buffer, (const uint16_t *)buf, cnt);
-    } else
-        memcpy(s->input_buffer, buf, FFMIN(buf_size, AC3_FRAME_BUFFER_SIZE));
-    buf = s->input_buffer;
-    /* initialize the GetBitContext with the start of valid AC-3 Frame */
-    init_get_bits(&s->gbc, buf, buf_size * 8);
-
-    /* parse the syncinfo */
-    err = parse_frame_header(s);
-
-    if (err) {
-        switch (err) {
-        case AAC_AC3_PARSE_ERROR_SYNC:
-            av_log(avctx, AV_LOG_ERROR, "frame sync error\n");
-            return AVERROR_INVALIDDATA;
-        case AAC_AC3_PARSE_ERROR_BSID:
-            av_log(avctx, AV_LOG_ERROR, "invalid bitstream id\n");
-            break;
-        case AAC_AC3_PARSE_ERROR_SAMPLE_RATE:
-            av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
-            break;
-        case AAC_AC3_PARSE_ERROR_FRAME_SIZE:
-            av_log(avctx, AV_LOG_ERROR, "invalid frame size\n");
-            break;
-        case AAC_AC3_PARSE_ERROR_FRAME_TYPE:
-            /* skip frame if CRC is ok. otherwise use error concealment. */
-            /* TODO: add support for substreams and dependent frames */
-            if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT || s->substreamid) {
-                av_log(avctx, AV_LOG_WARNING, "unsupported frame type : "
-                       "skipping frame\n");
-                *got_frame_ptr = 0;
-                return buf_size;
-            } else {
-                av_log(avctx, AV_LOG_ERROR, "invalid frame type\n");
-            }
-            break;
-        case AAC_AC3_PARSE_ERROR_CRC:
-        case AAC_AC3_PARSE_ERROR_CHANNEL_CFG:
-            break;
-        default: // Normal AVERROR do not try to recover.
-            *got_frame_ptr = 0;
-            return err;
-        }
-    } else {
-        /* check that reported frame size fits in input buffer */
-        if (s->frame_size > buf_size) {
-            av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
-            err = AAC_AC3_PARSE_ERROR_FRAME_SIZE;
-        } else if (avctx->err_recognition & AV_EF_CRCCHECK) {
-            /* check for crc mismatch */
-            if (av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2],
-                       s->frame_size - 2)) {
-                av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
-                if (avctx->err_recognition & AV_EF_EXPLODE)
-                    return AVERROR_INVALIDDATA;
-                err = AAC_AC3_PARSE_ERROR_CRC;
-            }
-        }
-    }
-
-    /* if frame is ok, set audio parameters */
-    if (!err) {
-        avctx->sample_rate = s->sample_rate;
-        avctx->bit_rate    = s->bit_rate;
-    }
-
-    /* channel config */
-    if (!err || (s->channels && s->out_channels != s->channels)) {
-        s->out_channels = s->channels;
-        s->output_mode  = s->channel_mode;
-        if (s->lfe_on)
-            s->output_mode |= AC3_OUTPUT_LFEON;
-        if (s->channels > 1 &&
-            avctx->request_channel_layout == AV_CH_LAYOUT_MONO) {
-            s->out_channels = 1;
-            s->output_mode  = AC3_CHMODE_MONO;
-        } else if (s->channels > 2 &&
-                   avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
-            s->out_channels = 2;
-            s->output_mode  = AC3_CHMODE_STEREO;
-        }
-
-        /* set downmixing coefficients if needed */
-        if (s->channels != s->out_channels && !((s->output_mode & AC3_OUTPUT_LFEON) &&
-                s->fbw_channels == s->out_channels)) {
-            set_downmix_coeffs(s);
-        }
-    } else if (!s->channels) {
-        av_log(avctx, AV_LOG_ERROR, "unable to determine channel mode\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->channels = s->out_channels;
-    avctx->channel_layout = avpriv_ac3_channel_layout_tab[s->output_mode & ~AC3_OUTPUT_LFEON];
-    if (s->output_mode & AC3_OUTPUT_LFEON)
-        avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
-
-    /* set audio service type based on bitstream mode for AC-3 */
-    avctx->audio_service_type = s->bitstream_mode;
-    if (s->bitstream_mode == 0x7 && s->channels > 1)
-        avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
-
-    /* get output buffer */
-    frame->nb_samples = s->num_blocks * AC3_BLOCK_SIZE;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    /* decode the audio blocks */
-    channel_map = ff_ac3_dec_channel_map[s->output_mode & ~AC3_OUTPUT_LFEON][s->lfe_on];
-    for (ch = 0; ch < s->channels; ch++) {
-        if (ch < s->out_channels)
-            s->outptr[channel_map[ch]] = (float *)frame->data[ch];
-        else
-            s->outptr[ch] = s->output[ch];
-        output[ch] = s->output[ch];
-    }
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        if (!err && decode_audio_block(s, blk)) {
-            av_log(avctx, AV_LOG_ERROR, "error decoding the audio block\n");
-            err = 1;
-        }
-        if (err)
-            for (ch = 0; ch < s->out_channels; ch++)
-                memcpy(s->outptr[channel_map[ch]], output[ch], sizeof(**output) * AC3_BLOCK_SIZE);
-        for (ch = 0; ch < s->out_channels; ch++)
-            output[ch] = s->outptr[channel_map[ch]];
-        for (ch = 0; ch < s->out_channels; ch++)
-            s->outptr[ch] += AC3_BLOCK_SIZE;
-    }
-
-    /* keep last block for error concealment in next frame */
-    for (ch = 0; ch < s->out_channels; ch++)
-        memcpy(s->output[ch], output[ch], sizeof(**output) * AC3_BLOCK_SIZE);
-
-    /*
-     * AVMatrixEncoding
-     *
-     * Check whether the input layout is compatible, and make sure we're not
-     * downmixing (else the matrix encoding is no longer applicable).
-     */
-    matrix_encoding = AV_MATRIX_ENCODING_NONE;
-    if (s->channel_mode == AC3_CHMODE_STEREO &&
-        s->channel_mode == (s->output_mode & ~AC3_OUTPUT_LFEON)) {
-        if (s->dolby_surround_mode == AC3_DSURMOD_ON)
-            matrix_encoding = AV_MATRIX_ENCODING_DOLBY;
-        else if (s->dolby_headphone_mode == AC3_DHEADPHONMOD_ON)
-            matrix_encoding = AV_MATRIX_ENCODING_DOLBYHEADPHONE;
-    } else if (s->channel_mode >= AC3_CHMODE_2F2R &&
-               s->channel_mode == (s->output_mode & ~AC3_OUTPUT_LFEON)) {
-        switch (s->dolby_surround_ex_mode) {
-        case AC3_DSUREXMOD_ON: // EX or PLIIx
-            matrix_encoding = AV_MATRIX_ENCODING_DOLBYEX;
-            break;
-        case AC3_DSUREXMOD_PLIIZ:
-            matrix_encoding = AV_MATRIX_ENCODING_DPLIIZ;
-            break;
-        default: // not indicated or off
-            break;
-        }
-    }
-    if ((ret = ff_side_data_update_matrix_encoding(frame, matrix_encoding)) < 0)
-        return ret;
-
-    /* AVDownmixInfo */
-    if ((downmix_info = av_downmix_info_update_side_data(frame))) {
-        switch (s->preferred_downmix) {
-        case AC3_DMIXMOD_LTRT:
-            downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_LTRT;
-            break;
-        case AC3_DMIXMOD_LORO:
-            downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_LORO;
-            break;
-        case AC3_DMIXMOD_DPLII:
-            downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_DPLII;
-            break;
-        default:
-            downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_UNKNOWN;
-            break;
-        }
-        downmix_info->center_mix_level        = gain_levels[s->       center_mix_level];
-        downmix_info->center_mix_level_ltrt   = gain_levels[s->  center_mix_level_ltrt];
-        downmix_info->surround_mix_level      = gain_levels[s->     surround_mix_level];
-        downmix_info->surround_mix_level_ltrt = gain_levels[s->surround_mix_level_ltrt];
-        if (s->lfe_mix_level_exists)
-            downmix_info->lfe_mix_level       = gain_levels_lfe[s->lfe_mix_level];
-        else
-            downmix_info->lfe_mix_level       = 0.0; // -inf dB
-    } else
-        return AVERROR(ENOMEM);
-
-    *got_frame_ptr = 1;
-
-    return FFMIN(buf_size, s->frame_size);
-}
-
-/**
- * Uninitialize the AC-3 decoder.
- */
-static av_cold int ac3_decode_end(AVCodecContext *avctx)
-{
-    AC3DecodeContext *s = avctx->priv_data;
-    ff_mdct_end(&s->imdct_512);
-    ff_mdct_end(&s->imdct_256);
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(AC3DecodeContext, x)
-#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
-static const AVOption options[] = {
-    { "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, 0.0, 6.0, PAR },
-    { NULL},
-};
-
-static const AVClass ac3_decoder_class = {
-    .class_name = "AC3 decoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_ac3_decoder = {
-    .name           = "ac3",
-    .long_name      = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AC3,
-    .priv_data_size = sizeof (AC3DecodeContext),
-    .init           = ac3_decode_init,
-    .close          = ac3_decode_end,
-    .decode         = ac3_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-    .priv_class     = &ac3_decoder_class,
-};
-
-#if CONFIG_EAC3_DECODER
-static const AVClass eac3_decoder_class = {
-    .class_name = "E-AC3 decoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_eac3_decoder = {
-    .name           = "eac3",
-    .long_name      = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_EAC3,
-    .priv_data_size = sizeof (AC3DecodeContext),
-    .init           = ac3_decode_init,
-    .close          = ac3_decode_end,
-    .decode         = ac3_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-    .priv_class     = &eac3_decoder_class,
-};
-#endif
diff --git a/deps/libav/libavcodec/ac3dec.h b/deps/libav/libavcodec/ac3dec.h
deleted file mode 100644
index 8fcd142..0000000
--- a/deps/libav/libavcodec/ac3dec.h
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Common code between the AC-3 and E-AC-3 decoders
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Common code between the AC-3 and E-AC-3 decoders.
- *
- * Summary of MDCT Coefficient Grouping:
- * The individual MDCT coefficient indices are often referred to in the
- * (E-)AC-3 specification as frequency bins.  These bins are grouped together
- * into subbands of 12 coefficients each.  The subbands are grouped together
- * into bands as defined in the bitstream by the band structures, which
- * determine the number of bands and the size of each band.  The full spectrum
- * of 256 frequency bins is divided into 1 DC bin + 21 subbands = 253 bins.
- * This system of grouping coefficients is used for channel bandwidth, stereo
- * rematrixing, channel coupling, enhanced coupling, and spectral extension.
- *
- * +-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-+
- * |1|  |12|  |  [12|12|12|12]  |  |  |  |  |  |  |  |  |  |  |  |  |3|
- * +-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-+
- * ~~~  ~~~~     ~~~~~~~~~~~~~                                      ~~~
- *  |     |            |                                             |
- *  |     |            |                    3 unused frequency bins--+
- *  |     |            |
- *  |     |            +--1 band containing 4 subbands
- *  |     |
- *  |     +--1 subband of 12 frequency bins
- *  |
- *  +--DC frequency bin
- */
-
-#ifndef AVCODEC_AC3DEC_H
-#define AVCODEC_AC3DEC_H
-
-#include "libavutil/float_dsp.h"
-#include "libavutil/lfg.h"
-#include "ac3.h"
-#include "ac3dsp.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "fft.h"
-#include "fmtconvert.h"
-
-#define AC3_OUTPUT_LFEON  8
-
-#define SPX_MAX_BANDS    17
-
-/** Large enough for maximum possible frame size when the specification limit is ignored */
-#define AC3_FRAME_BUFFER_SIZE 32768
-
-typedef struct AC3DecodeContext {
-    AVClass        *class;                  ///< class for AVOptions
-    AVCodecContext *avctx;                  ///< parent context
-    GetBitContext gbc;                      ///< bitstream reader
-
-///@name Bit stream information
-///@{
-    int frame_type;                         ///< frame type                             (strmtyp)
-    int substreamid;                        ///< substream identification
-    int frame_size;                         ///< current frame size, in bytes
-    int bit_rate;                           ///< stream bit rate, in bits-per-second
-    int sample_rate;                        ///< sample frequency, in Hz
-    int num_blocks;                         ///< number of audio blocks
-    int bitstream_id;                       ///< bitstream id                           (bsid)
-    int bitstream_mode;                     ///< bitstream mode                         (bsmod)
-    int channel_mode;                       ///< channel mode                           (acmod)
-    int lfe_on;                             ///< lfe channel in use
-    int channel_map;                        ///< custom channel map
-    int preferred_downmix;                  ///< Preferred 2-channel downmix mode       (dmixmod)
-    int center_mix_level;                   ///< Center mix level index
-    int center_mix_level_ltrt;              ///< Center mix level index for Lt/Rt       (ltrtcmixlev)
-    int surround_mix_level;                 ///< Surround mix level index
-    int surround_mix_level_ltrt;            ///< Surround mix level index for Lt/Rt     (ltrtsurmixlev)
-    int lfe_mix_level_exists;               ///< indicates if lfemixlevcod is specified (lfemixlevcode)
-    int lfe_mix_level;                      ///< LFE mix level index                    (lfemixlevcod)
-    int eac3;                               ///< indicates if current frame is E-AC-3
-    int dolby_surround_mode;                ///< dolby surround mode                    (dsurmod)
-    int dolby_surround_ex_mode;             ///< dolby surround ex mode                 (dsurexmod)
-    int dolby_headphone_mode;               ///< dolby headphone mode                   (dheadphonmod)
-///@}
-
-///@name Frame syntax parameters
-    int snr_offset_strategy;                ///< SNR offset strategy                    (snroffststr)
-    int block_switch_syntax;                ///< block switch syntax enabled            (blkswe)
-    int dither_flag_syntax;                 ///< dither flag syntax enabled             (dithflage)
-    int bit_allocation_syntax;              ///< bit allocation model syntax enabled    (bamode)
-    int fast_gain_syntax;                   ///< fast gain codes enabled                (frmfgaincode)
-    int dba_syntax;                         ///< delta bit allocation syntax enabled    (dbaflde)
-    int skip_syntax;                        ///< skip field syntax enabled              (skipflde)
- ///@}
-
-///@name Standard coupling
-    int cpl_in_use[AC3_MAX_BLOCKS];         ///< coupling in use                        (cplinu)
-    int cpl_strategy_exists[AC3_MAX_BLOCKS];///< coupling strategy exists               (cplstre)
-    int channel_in_cpl[AC3_MAX_CHANNELS];   ///< channel in coupling                    (chincpl)
-    int phase_flags_in_use;                 ///< phase flags in use                     (phsflginu)
-    int phase_flags[AC3_MAX_CPL_BANDS];     ///< phase flags                            (phsflg)
-    int num_cpl_bands;                      ///< number of coupling bands               (ncplbnd)
-    uint8_t cpl_band_sizes[AC3_MAX_CPL_BANDS]; ///< number of coeffs in each coupling band
-    int firstchincpl;                       ///< first channel in coupling
-    int first_cpl_coords[AC3_MAX_CHANNELS]; ///< first coupling coordinates states      (firstcplcos)
-    int cpl_coords[AC3_MAX_CHANNELS][AC3_MAX_CPL_BANDS]; ///< coupling coordinates      (cplco)
-///@}
-
-///@name Spectral extension
-///@{
-    int spx_in_use;                             ///< spectral extension in use              (spxinu)
-    uint8_t channel_uses_spx[AC3_MAX_CHANNELS]; ///< channel uses spectral extension        (chinspx)
-    int8_t spx_atten_code[AC3_MAX_CHANNELS];    ///< spx attenuation code                   (spxattencod)
-    int spx_src_start_freq;                     ///< spx start frequency bin
-    int spx_dst_end_freq;                       ///< spx end frequency bin
-    int spx_dst_start_freq;                     ///< spx starting frequency bin for copying (copystartmant)
-                                                ///< the copy region ends at the start of the spx region.
-    int num_spx_bands;                          ///< number of spx bands                    (nspxbnds)
-    uint8_t spx_band_sizes[SPX_MAX_BANDS];      ///< number of bins in each spx band
-    uint8_t first_spx_coords[AC3_MAX_CHANNELS]; ///< first spx coordinates states           (firstspxcos)
-    float spx_noise_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx noise blending factor  (nblendfact)
-    float spx_signal_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS];///< spx signal blending factor (sblendfact)
-///@}
-
-///@name Adaptive hybrid transform
-    int channel_uses_aht[AC3_MAX_CHANNELS];                         ///< channel AHT in use (chahtinu)
-    int pre_mantissa[AC3_MAX_CHANNELS][AC3_MAX_COEFS][AC3_MAX_BLOCKS];  ///< pre-IDCT mantissas
-///@}
-
-///@name Channel
-    int fbw_channels;                           ///< number of full-bandwidth channels
-    int channels;                               ///< number of total channels
-    int lfe_ch;                                 ///< index of LFE channel
-    float downmix_coeffs[AC3_MAX_CHANNELS][2];  ///< stereo downmix coefficients
-    int downmixed;                              ///< indicates if coeffs are currently downmixed
-    int output_mode;                            ///< output channel configuration
-    int out_channels;                           ///< number of output channels
-///@}
-
-///@name Dynamic range
-    float dynamic_range[2];                 ///< dynamic range
-    float drc_scale;                        ///< percentage of dynamic range compression to be applied
-///@}
-
-///@name Bandwidth
-    int start_freq[AC3_MAX_CHANNELS];       ///< start frequency bin                    (strtmant)
-    int end_freq[AC3_MAX_CHANNELS];         ///< end frequency bin                      (endmant)
-///@}
-
-///@name Rematrixing
-    int num_rematrixing_bands;              ///< number of rematrixing bands            (nrematbnd)
-    int rematrixing_flags[4];               ///< rematrixing flags                      (rematflg)
-///@}
-
-///@name Exponents
-    int num_exp_groups[AC3_MAX_CHANNELS];           ///< Number of exponent groups      (nexpgrp)
-    int8_t dexps[AC3_MAX_CHANNELS][AC3_MAX_COEFS];  ///< decoded exponents
-    int exp_strategy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS]; ///< exponent strategies        (expstr)
-///@}
-
-///@name Bit allocation
-    AC3BitAllocParameters bit_alloc_params;         ///< bit allocation parameters
-    int first_cpl_leak;                             ///< first coupling leak state      (firstcplleak)
-    int snr_offset[AC3_MAX_CHANNELS];               ///< signal-to-noise ratio offsets  (snroffst)
-    int fast_gain[AC3_MAX_CHANNELS];                ///< fast gain values/SMR's         (fgain)
-    uint8_t bap[AC3_MAX_CHANNELS][AC3_MAX_COEFS];   ///< bit allocation pointers
-    int16_t psd[AC3_MAX_CHANNELS][AC3_MAX_COEFS];   ///< scaled exponents
-    int16_t band_psd[AC3_MAX_CHANNELS][AC3_CRITICAL_BANDS]; ///< interpolated exponents
-    int16_t mask[AC3_MAX_CHANNELS][AC3_CRITICAL_BANDS];     ///< masking curve values
-    int dba_mode[AC3_MAX_CHANNELS];                 ///< delta bit allocation mode
-    int dba_nsegs[AC3_MAX_CHANNELS];                ///< number of delta segments
-    uint8_t dba_offsets[AC3_MAX_CHANNELS][8];       ///< delta segment offsets
-    uint8_t dba_lengths[AC3_MAX_CHANNELS][8];       ///< delta segment lengths
-    uint8_t dba_values[AC3_MAX_CHANNELS][8];        ///< delta values for each segment
-///@}
-
-///@name Zero-mantissa dithering
-    int dither_flag[AC3_MAX_CHANNELS];      ///< dither flags                           (dithflg)
-    AVLFG dith_state;                       ///< for dither generation
-///@}
-
-///@name IMDCT
-    int block_switch[AC3_MAX_CHANNELS];     ///< block switch flags                     (blksw)
-    FFTContext imdct_512;                   ///< for 512 sample IMDCT
-    FFTContext imdct_256;                   ///< for 256 sample IMDCT
-///@}
-
-///@name Optimization
-    DSPContext dsp;                         ///< for optimization
-    AVFloatDSPContext fdsp;
-    AC3DSPContext ac3dsp;
-    FmtConvertContext fmt_conv;             ///< optimized conversion functions
-///@}
-
-    float *outptr[AC3_MAX_CHANNELS];
-    float *xcfptr[AC3_MAX_CHANNELS];
-    float *dlyptr[AC3_MAX_CHANNELS];
-
-///@name Aligned arrays
-    DECLARE_ALIGNED(16, int32_t, fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS];     ///< fixed-point transform coefficients
-    DECLARE_ALIGNED(32, float, transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS];   ///< transform coefficients
-    DECLARE_ALIGNED(32, float, delay)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE];             ///< delay - added to the next block
-    DECLARE_ALIGNED(32, float, window)[AC3_BLOCK_SIZE];                              ///< window coefficients
-    DECLARE_ALIGNED(32, float, tmp_output)[AC3_BLOCK_SIZE];                          ///< temporary storage for output before windowing
-    DECLARE_ALIGNED(32, float, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE];            ///< output after imdct transform and windowing
-    DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread
-///@}
-} AC3DecodeContext;
-
-/**
- * Parse the E-AC-3 frame header.
- * This parses both the bit stream info and audio frame header.
- */
-int ff_eac3_parse_header(AC3DecodeContext *s);
-
-/**
- * Decode mantissas in a single channel for the entire frame.
- * This is used when AHT mode is enabled.
- */
-void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
-
-/**
- * Apply spectral extension to each channel by copying lower frequency
- * coefficients to higher frequency bins and applying side information to
- * approximate the original high frequency signal.
- */
-void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
-
-#endif /* AVCODEC_AC3DEC_H */
diff --git a/deps/libav/libavcodec/ac3dec_data.c b/deps/libav/libavcodec/ac3dec_data.c
deleted file mode 100644
index 272a963..0000000
--- a/deps/libav/libavcodec/ac3dec_data.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * AC-3 and E-AC-3 decoder tables
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Tables taken directly from the AC-3 spec.
- */
-
-#include "ac3dec_data.h"
-#include "ac3.h"
-
-/**
- * Table used to ungroup 3 values stored in 5 bits.
- * Used by bap=1 mantissas and GAQ.
- * ff_ac3_ungroup_3_in_5_bits_tab[i] = { i/9, (i%9)/3, (i%9)%3 }
- */
-const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3] = {
-    { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 1, 0 },
-    { 0, 1, 1 }, { 0, 1, 2 }, { 0, 2, 0 }, { 0, 2, 1 },
-    { 0, 2, 2 }, { 1, 0, 0 }, { 1, 0, 1 }, { 1, 0, 2 },
-    { 1, 1, 0 }, { 1, 1, 1 }, { 1, 1, 2 }, { 1, 2, 0 },
-    { 1, 2, 1 }, { 1, 2, 2 }, { 2, 0, 0 }, { 2, 0, 1 },
-    { 2, 0, 2 }, { 2, 1, 0 }, { 2, 1, 1 }, { 2, 1, 2 },
-    { 2, 2, 0 }, { 2, 2, 1 }, { 2, 2, 2 }, { 3, 0, 0 },
-    { 3, 0, 1 }, { 3, 0, 2 }, { 3, 1, 0 }, { 3, 1, 1 }
-};
-
-const uint8_t ff_eac3_hebap_tab[64] = {
-    0, 1, 2, 3, 4, 5, 6, 7, 8, 8,
-    8, 8, 9, 9, 9, 10, 10, 10, 10, 11,
-    11, 11, 11, 12, 12, 12, 12, 13, 13, 13,
-    13, 14, 14, 14, 14, 15, 15, 15, 15, 16,
-    16, 16, 16, 17, 17, 17, 17, 18, 18, 18,
-    18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
-    19, 19, 19, 19,
-};
-
-/**
- * Table E2.15 Default Spectral Extension Banding Structure
- */
-const uint8_t ff_eac3_default_spx_band_struct[17] =
-{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 };
diff --git a/deps/libav/libavcodec/ac3dec_data.h b/deps/libav/libavcodec/ac3dec_data.h
deleted file mode 100644
index c0a584e..0000000
--- a/deps/libav/libavcodec/ac3dec_data.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * AC-3 and E-AC-3 decoder tables
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AC3DEC_DATA_H
-#define AVCODEC_AC3DEC_DATA_H
-
-#include <stdint.h>
-
-extern const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3];
-
-extern const uint8_t ff_eac3_hebap_tab[64];
-extern const uint8_t ff_eac3_default_spx_band_struct[17];
-
-#endif /* AVCODEC_AC3DEC_DATA_H */
diff --git a/deps/libav/libavcodec/ac3dsp.c b/deps/libav/libavcodec/ac3dsp.c
deleted file mode 100644
index e792bcf..0000000
--- a/deps/libav/libavcodec/ac3dsp.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * AC-3 DSP utils
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avassert.h"
-#include "avcodec.h"
-#include "ac3.h"
-#include "ac3dsp.h"
-#include "mathops.h"
-
-static void ac3_exponent_min_c(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
-{
-    int blk, i;
-
-    if (!num_reuse_blocks)
-        return;
-
-    for (i = 0; i < nb_coefs; i++) {
-        uint8_t min_exp = *exp;
-        uint8_t *exp1 = exp + 256;
-        for (blk = 0; blk < num_reuse_blocks; blk++) {
-            uint8_t next_exp = *exp1;
-            if (next_exp < min_exp)
-                min_exp = next_exp;
-            exp1 += 256;
-        }
-        *exp++ = min_exp;
-    }
-}
-
-static int ac3_max_msb_abs_int16_c(const int16_t *src, int len)
-{
-    int i, v = 0;
-    for (i = 0; i < len; i++)
-        v |= abs(src[i]);
-    return v;
-}
-
-static void ac3_lshift_int16_c(int16_t *src, unsigned int len,
-                               unsigned int shift)
-{
-    uint32_t *src32 = (uint32_t *)src;
-    const uint32_t mask = ~(((1 << shift) - 1) << 16);
-    int i;
-    len >>= 1;
-    for (i = 0; i < len; i += 8) {
-        src32[i  ] = (src32[i  ] << shift) & mask;
-        src32[i+1] = (src32[i+1] << shift) & mask;
-        src32[i+2] = (src32[i+2] << shift) & mask;
-        src32[i+3] = (src32[i+3] << shift) & mask;
-        src32[i+4] = (src32[i+4] << shift) & mask;
-        src32[i+5] = (src32[i+5] << shift) & mask;
-        src32[i+6] = (src32[i+6] << shift) & mask;
-        src32[i+7] = (src32[i+7] << shift) & mask;
-    }
-}
-
-static void ac3_rshift_int32_c(int32_t *src, unsigned int len,
-                               unsigned int shift)
-{
-    do {
-        *src++ >>= shift;
-        *src++ >>= shift;
-        *src++ >>= shift;
-        *src++ >>= shift;
-        *src++ >>= shift;
-        *src++ >>= shift;
-        *src++ >>= shift;
-        *src++ >>= shift;
-        len -= 8;
-    } while (len > 0);
-}
-
-static void float_to_fixed24_c(int32_t *dst, const float *src, unsigned int len)
-{
-    const float scale = 1 << 24;
-    do {
-        *dst++ = lrintf(*src++ * scale);
-        *dst++ = lrintf(*src++ * scale);
-        *dst++ = lrintf(*src++ * scale);
-        *dst++ = lrintf(*src++ * scale);
-        *dst++ = lrintf(*src++ * scale);
-        *dst++ = lrintf(*src++ * scale);
-        *dst++ = lrintf(*src++ * scale);
-        *dst++ = lrintf(*src++ * scale);
-        len -= 8;
-    } while (len > 0);
-}
-
-static void ac3_bit_alloc_calc_bap_c(int16_t *mask, int16_t *psd,
-                                     int start, int end,
-                                     int snr_offset, int floor,
-                                     const uint8_t *bap_tab, uint8_t *bap)
-{
-    int bin, band, band_end;
-
-    /* special case, if snr offset is -960, set all bap's to zero */
-    if (snr_offset == -960) {
-        memset(bap, 0, AC3_MAX_COEFS);
-        return;
-    }
-
-    bin  = start;
-    band = ff_ac3_bin_to_band_tab[start];
-    do {
-        int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor;
-        band_end = ff_ac3_band_start_tab[++band];
-        band_end = FFMIN(band_end, end);
-
-        for (; bin < band_end; bin++) {
-            int address = av_clip((psd[bin] - m) >> 5, 0, 63);
-            bap[bin] = bap_tab[address];
-        }
-    } while (end > band_end);
-}
-
-static void ac3_update_bap_counts_c(uint16_t mant_cnt[16], uint8_t *bap,
-                                    int len)
-{
-    while (len-- > 0)
-        mant_cnt[bap[len]]++;
-}
-
-DECLARE_ALIGNED(16, const uint16_t, ff_ac3_bap_bits)[16] = {
-    0,  0,  0,  3,  0,  4,  5,  6,  7,  8,  9, 10, 11, 12, 14, 16
-};
-
-static int ac3_compute_mantissa_size_c(uint16_t mant_cnt[6][16])
-{
-    int blk, bap;
-    int bits = 0;
-
-    for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
-        // bap=1 : 3 mantissas in 5 bits
-        bits += (mant_cnt[blk][1] / 3) * 5;
-        // bap=2 : 3 mantissas in 7 bits
-        // bap=4 : 2 mantissas in 7 bits
-        bits += ((mant_cnt[blk][2] / 3) + (mant_cnt[blk][4] >> 1)) * 7;
-        // bap=3 : 1 mantissa in 3 bits
-        bits += mant_cnt[blk][3] * 3;
-        // bap=5 to 15 : get bits per mantissa from table
-        for (bap = 5; bap < 16; bap++)
-            bits += mant_cnt[blk][bap] * ff_ac3_bap_bits[bap];
-    }
-    return bits;
-}
-
-static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs)
-{
-    int i;
-
-    for (i = 0; i < nb_coefs; i++) {
-        int v = abs(coef[i]);
-        exp[i] = v ? 23 - av_log2(v) : 24;
-    }
-}
-
-static void ac3_downmix_c(float **samples, float (*matrix)[2],
-                          int out_ch, int in_ch, int len)
-{
-    int i, j;
-    float v0, v1;
-    if (out_ch == 2) {
-        for (i = 0; i < len; i++) {
-            v0 = v1 = 0.0f;
-            for (j = 0; j < in_ch; j++) {
-                v0 += samples[j][i] * matrix[j][0];
-                v1 += samples[j][i] * matrix[j][1];
-            }
-            samples[0][i] = v0;
-            samples[1][i] = v1;
-        }
-    } else if (out_ch == 1) {
-        for (i = 0; i < len; i++) {
-            v0 = 0.0f;
-            for (j = 0; j < in_ch; j++)
-                v0 += samples[j][i] * matrix[j][0];
-            samples[0][i] = v0;
-        }
-    }
-}
-
-static void apply_window_int16_c(int16_t *output, const int16_t *input,
-                                 const int16_t *window, unsigned int len)
-{
-    int i;
-    int len2 = len >> 1;
-
-    for (i = 0; i < len2; i++) {
-        int16_t w       = window[i];
-        output[i]       = (MUL16(input[i],       w) + (1 << 14)) >> 15;
-        output[len-i-1] = (MUL16(input[len-i-1], w) + (1 << 14)) >> 15;
-    }
-}
-
-av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
-{
-    c->ac3_exponent_min = ac3_exponent_min_c;
-    c->ac3_max_msb_abs_int16 = ac3_max_msb_abs_int16_c;
-    c->ac3_lshift_int16 = ac3_lshift_int16_c;
-    c->ac3_rshift_int32 = ac3_rshift_int32_c;
-    c->float_to_fixed24 = float_to_fixed24_c;
-    c->bit_alloc_calc_bap = ac3_bit_alloc_calc_bap_c;
-    c->update_bap_counts = ac3_update_bap_counts_c;
-    c->compute_mantissa_size = ac3_compute_mantissa_size_c;
-    c->extract_exponents = ac3_extract_exponents_c;
-    c->downmix = ac3_downmix_c;
-    c->apply_window_int16 = apply_window_int16_c;
-
-    if (ARCH_ARM)
-        ff_ac3dsp_init_arm(c, bit_exact);
-    if (ARCH_X86)
-        ff_ac3dsp_init_x86(c, bit_exact);
-}
diff --git a/deps/libav/libavcodec/ac3dsp.h b/deps/libav/libavcodec/ac3dsp.h
deleted file mode 100644
index e350c88..0000000
--- a/deps/libav/libavcodec/ac3dsp.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * AC-3 DSP utils
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AC3DSP_H
-#define AVCODEC_AC3DSP_H
-
-#include <stdint.h>
-
-/**
- * Number of mantissa bits written for each bap value.
- * bap values with fractional bits are set to 0 and are calculated separately.
- */
-extern const uint16_t ff_ac3_bap_bits[16];
-
-typedef struct AC3DSPContext {
-    /**
-     * Set each encoded exponent in a block to the minimum of itself and the
-     * exponents in the same frequency bin of up to 5 following blocks.
-     * @param exp   pointer to the start of the current block of exponents.
-     *              constraints: align 16
-     * @param num_reuse_blocks  number of blocks that will reuse exponents from the current block.
-     *                          constraints: range 0 to 5
-     * @param nb_coefs  number of frequency coefficients.
-     */
-    void (*ac3_exponent_min)(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-
-    /**
-     * Calculate the maximum MSB of the absolute value of each element in an
-     * array of int16_t.
-     * @param src input array
-     *            constraints: align 16. values must be in range [-32767,32767]
-     * @param len number of values in the array
-     *            constraints: multiple of 16 greater than 0
-     * @return    a value with the same MSB as max(abs(src[]))
-     */
-    int (*ac3_max_msb_abs_int16)(const int16_t *src, int len);
-
-    /**
-     * Left-shift each value in an array of int16_t by a specified amount.
-     * @param src    input array
-     *               constraints: align 16
-     * @param len    number of values in the array
-     *               constraints: multiple of 32 greater than 0
-     * @param shift  left shift amount
-     *               constraints: range [0,15]
-     */
-    void (*ac3_lshift_int16)(int16_t *src, unsigned int len, unsigned int shift);
-
-    /**
-     * Right-shift each value in an array of int32_t by a specified amount.
-     * @param src    input array
-     *               constraints: align 16
-     * @param len    number of values in the array
-     *               constraints: multiple of 16 greater than 0
-     * @param shift  right shift amount
-     *               constraints: range [0,31]
-     */
-    void (*ac3_rshift_int32)(int32_t *src, unsigned int len, unsigned int shift);
-
-    /**
-     * Convert an array of float in range [-1.0,1.0] to int32_t with range
-     * [-(1<<24),(1<<24)]
-     *
-     * @param dst destination array of int32_t.
-     *            constraints: 16-byte aligned
-     * @param src source array of float.
-     *            constraints: 16-byte aligned
-     * @param len number of elements to convert.
-     *            constraints: multiple of 32 greater than zero
-     */
-    void (*float_to_fixed24)(int32_t *dst, const float *src, unsigned int len);
-
-    /**
-     * Calculate bit allocation pointers.
-     * The SNR is the difference between the masking curve and the signal.  AC-3
-     * uses this value for each frequency bin to allocate bits.  The snroffset
-     * parameter is a global adjustment to the SNR for all bins.
-     *
-     * @param[in]  mask       masking curve
-     * @param[in]  psd        signal power for each frequency bin
-     * @param[in]  start      starting bin location
-     * @param[in]  end        ending bin location
-     * @param[in]  snr_offset SNR adjustment
-     * @param[in]  floor      noise floor
-     * @param[in]  bap_tab    look-up table for bit allocation pointers
-     * @param[out] bap        bit allocation pointers
-     */
-    void (*bit_alloc_calc_bap)(int16_t *mask, int16_t *psd, int start, int end,
-                               int snr_offset, int floor,
-                               const uint8_t *bap_tab, uint8_t *bap);
-
-    /**
-     * Update bap counts using the supplied array of bap.
-     *
-     * @param[out] mant_cnt   bap counts for 1 block
-     * @param[in]  bap        array of bap, pointing to start coef bin
-     * @param[in]  len        number of elements to process
-     */
-    void (*update_bap_counts)(uint16_t mant_cnt[16], uint8_t *bap, int len);
-
-    /**
-     * Calculate the number of bits needed to encode a set of mantissas.
-     *
-     * @param[in] mant_cnt    bap counts for all blocks
-     * @return                mantissa bit count
-     */
-    int (*compute_mantissa_size)(uint16_t mant_cnt[6][16]);
-
-    void (*extract_exponents)(uint8_t *exp, int32_t *coef, int nb_coefs);
-
-    void (*downmix)(float **samples, float (*matrix)[2], int out_ch,
-                    int in_ch, int len);
-
-    /**
-     * Apply symmetric window in 16-bit fixed-point.
-     * @param output destination array
-     *               constraints: 16-byte aligned
-     * @param input  source array
-     *               constraints: 16-byte aligned
-     * @param window window array
-     *               constraints: 16-byte aligned, at least len/2 elements
-     * @param len    full window length
-     *               constraints: multiple of ? greater than zero
-     */
-    void (*apply_window_int16)(int16_t *output, const int16_t *input,
-                               const int16_t *window, unsigned int len);
-} AC3DSPContext;
-
-void ff_ac3dsp_init    (AC3DSPContext *c, int bit_exact);
-void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact);
-void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact);
-
-#endif /* AVCODEC_AC3DSP_H */
diff --git a/deps/libav/libavcodec/ac3enc.c b/deps/libav/libavcodec/ac3enc.c
deleted file mode 100644
index ce6c1a6..0000000
--- a/deps/libav/libavcodec/ac3enc.c
+++ /dev/null
@@ -1,2493 +0,0 @@
-/*
- * The simplest AC-3 encoder
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2010 Justin Ruggles <justin.ruggles at gmail.com>
- * Copyright (c) 2006-2010 Prakash Punnoor <prakash at punnoor.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * The simplest AC-3 encoder.
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/crc.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "put_bits.h"
-#include "ac3dsp.h"
-#include "ac3.h"
-#include "fft.h"
-#include "ac3enc.h"
-#include "eac3enc.h"
-
-typedef struct AC3Mant {
-    int16_t *qmant1_ptr, *qmant2_ptr, *qmant4_ptr; ///< mantissa pointers for bap=1,2,4
-    int mant1_cnt, mant2_cnt, mant4_cnt;    ///< mantissa counts for bap=1,2,4
-} AC3Mant;
-
-#define CMIXLEV_NUM_OPTIONS 3
-static const float cmixlev_options[CMIXLEV_NUM_OPTIONS] = {
-    LEVEL_MINUS_3DB, LEVEL_MINUS_4POINT5DB, LEVEL_MINUS_6DB
-};
-
-#define SURMIXLEV_NUM_OPTIONS 3
-static const float surmixlev_options[SURMIXLEV_NUM_OPTIONS] = {
-    LEVEL_MINUS_3DB, LEVEL_MINUS_6DB, LEVEL_ZERO
-};
-
-#define EXTMIXLEV_NUM_OPTIONS 8
-static const float extmixlev_options[EXTMIXLEV_NUM_OPTIONS] = {
-    LEVEL_PLUS_3DB,  LEVEL_PLUS_1POINT5DB,  LEVEL_ONE,       LEVEL_MINUS_4POINT5DB,
-    LEVEL_MINUS_3DB, LEVEL_MINUS_4POINT5DB, LEVEL_MINUS_6DB, LEVEL_ZERO
-};
-
-
-/**
- * LUT for number of exponent groups.
- * exponent_group_tab[coupling][exponent strategy-1][number of coefficients]
- */
-static uint8_t exponent_group_tab[2][3][256];
-
-
-/**
- * List of supported channel layouts.
- */
-const uint64_t ff_ac3_channel_layouts[19] = {
-     AV_CH_LAYOUT_MONO,
-     AV_CH_LAYOUT_STEREO,
-     AV_CH_LAYOUT_2_1,
-     AV_CH_LAYOUT_SURROUND,
-     AV_CH_LAYOUT_2_2,
-     AV_CH_LAYOUT_QUAD,
-     AV_CH_LAYOUT_4POINT0,
-     AV_CH_LAYOUT_5POINT0,
-     AV_CH_LAYOUT_5POINT0_BACK,
-    (AV_CH_LAYOUT_MONO     | AV_CH_LOW_FREQUENCY),
-    (AV_CH_LAYOUT_STEREO   | AV_CH_LOW_FREQUENCY),
-    (AV_CH_LAYOUT_2_1      | AV_CH_LOW_FREQUENCY),
-    (AV_CH_LAYOUT_SURROUND | AV_CH_LOW_FREQUENCY),
-    (AV_CH_LAYOUT_2_2      | AV_CH_LOW_FREQUENCY),
-    (AV_CH_LAYOUT_QUAD     | AV_CH_LOW_FREQUENCY),
-    (AV_CH_LAYOUT_4POINT0  | AV_CH_LOW_FREQUENCY),
-     AV_CH_LAYOUT_5POINT1,
-     AV_CH_LAYOUT_5POINT1_BACK,
-     0
-};
-
-
-/**
- * LUT to select the bandwidth code based on the bit rate, sample rate, and
- * number of full-bandwidth channels.
- * bandwidth_tab[fbw_channels-1][sample rate code][bit rate code]
- */
-static const uint8_t ac3_bandwidth_tab[5][3][19] = {
-//      32  40  48  56  64  80  96 112 128 160 192 224 256 320 384 448 512 576 640
-
-    { {  0,  0,  0, 12, 16, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 },
-      {  0,  0,  0, 16, 20, 36, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56 },
-      {  0,  0,  0, 32, 40, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60 } },
-
-    { {  0,  0,  0,  0,  0,  0,  0, 20, 24, 32, 48, 48, 48, 48, 48, 48, 48, 48, 48 },
-      {  0,  0,  0,  0,  0,  0,  4, 24, 28, 36, 56, 56, 56, 56, 56, 56, 56, 56, 56 },
-      {  0,  0,  0,  0,  0,  0, 20, 44, 52, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60 } },
-
-    { {  0,  0,  0,  0,  0,  0,  0,  0,  0, 16, 24, 32, 40, 48, 48, 48, 48, 48, 48 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  4, 20, 28, 36, 44, 56, 56, 56, 56, 56, 56 },
-      {  0,  0,  0,  0,  0,  0,  0,  0, 20, 40, 48, 60, 60, 60, 60, 60, 60, 60, 60 } },
-
-    { {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 12, 24, 32, 48, 48, 48, 48, 48, 48 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 16, 28, 36, 56, 56, 56, 56, 56, 56 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 32, 48, 60, 60, 60, 60, 60, 60, 60 } },
-
-    { {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  8, 20, 32, 40, 48, 48, 48, 48 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 12, 24, 36, 44, 56, 56, 56, 56 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 28, 44, 60, 60, 60, 60, 60, 60 } }
-};
-
-
-/**
- * LUT to select the coupling start band based on the bit rate, sample rate, and
- * number of full-bandwidth channels. -1 = coupling off
- * ac3_coupling_start_tab[channel_mode-2][sample rate code][bit rate code]
- *
- * TODO: more testing for optimal parameters.
- *       multi-channel tests at 44.1kHz and 32kHz.
- */
-static const int8_t ac3_coupling_start_tab[6][3][19] = {
-//      32  40  48  56  64  80  96 112 128 160 192 224 256 320 384 448 512 576 640
-
-    // 2/0
-    { {  0,  0,  0,  0,  0,  0,  0,  1,  1,  7,  8, 11, 12, -1, -1, -1, -1, -1, -1 },
-      {  0,  0,  0,  0,  0,  0,  1,  3,  5,  7, 10, 12, 13, -1, -1, -1, -1, -1, -1 },
-      {  0,  0,  0,  0,  1,  2,  2,  9, 13, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
-    // 3/0
-    { {  0,  0,  0,  0,  0,  0,  0,  0,  2,  2,  6,  9, 11, 12, 13, -1, -1, -1, -1 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  2,  2,  6,  9, 11, 12, 13, -1, -1, -1, -1 },
-      { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
-    // 2/1 - untested
-    { {  0,  0,  0,  0,  0,  0,  0,  0,  2,  2,  6,  9, 11, 12, 13, -1, -1, -1, -1 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  2,  2,  6,  9, 11, 12, 13, -1, -1, -1, -1 },
-      { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
-    // 3/1
-    { {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  2, 10, 11, 11, 12, 12, 14, -1 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  2, 10, 11, 11, 12, 12, 14, -1 },
-      { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
-    // 2/2 - untested
-    { {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  2, 10, 11, 11, 12, 12, 14, -1 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  2, 10, 11, 11, 12, 12, 14, -1 },
-      { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-
-    // 3/2
-    { {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  6,  8, 11, 12, 12, -1, -1 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  6,  8, 11, 12, 12, -1, -1 },
-      { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } },
-};
-
-
-/**
- * Adjust the frame size to make the average bit rate match the target bit rate.
- * This is only needed for 11025, 22050, and 44100 sample rates or any E-AC-3.
- *
- * @param s  AC-3 encoder private context
- */
-void ff_ac3_adjust_frame_size(AC3EncodeContext *s)
-{
-    while (s->bits_written >= s->bit_rate && s->samples_written >= s->sample_rate) {
-        s->bits_written    -= s->bit_rate;
-        s->samples_written -= s->sample_rate;
-    }
-    s->frame_size = s->frame_size_min +
-                    2 * (s->bits_written * s->sample_rate < s->samples_written * s->bit_rate);
-    s->bits_written    += s->frame_size * 8;
-    s->samples_written += AC3_BLOCK_SIZE * s->num_blocks;
-}
-
-
-/**
- * Set the initial coupling strategy parameters prior to coupling analysis.
- *
- * @param s  AC-3 encoder private context
- */
-void ff_ac3_compute_coupling_strategy(AC3EncodeContext *s)
-{
-    int blk, ch;
-    int got_cpl_snr;
-    int num_cpl_blocks;
-
-    /* set coupling use flags for each block/channel */
-    /* TODO: turn coupling on/off and adjust start band based on bit usage */
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        for (ch = 1; ch <= s->fbw_channels; ch++)
-            block->channel_in_cpl[ch] = s->cpl_on;
-    }
-
-    /* enable coupling for each block if at least 2 channels have coupling
-       enabled for that block */
-    got_cpl_snr = 0;
-    num_cpl_blocks = 0;
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        block->num_cpl_channels = 0;
-        for (ch = 1; ch <= s->fbw_channels; ch++)
-            block->num_cpl_channels += block->channel_in_cpl[ch];
-        block->cpl_in_use = block->num_cpl_channels > 1;
-        num_cpl_blocks += block->cpl_in_use;
-        if (!block->cpl_in_use) {
-            block->num_cpl_channels = 0;
-            for (ch = 1; ch <= s->fbw_channels; ch++)
-                block->channel_in_cpl[ch] = 0;
-        }
-
-        block->new_cpl_strategy = !blk;
-        if (blk) {
-            for (ch = 1; ch <= s->fbw_channels; ch++) {
-                if (block->channel_in_cpl[ch] != s->blocks[blk-1].channel_in_cpl[ch]) {
-                    block->new_cpl_strategy = 1;
-                    break;
-                }
-            }
-        }
-        block->new_cpl_leak = block->new_cpl_strategy;
-
-        if (!blk || (block->cpl_in_use && !got_cpl_snr)) {
-            block->new_snr_offsets = 1;
-            if (block->cpl_in_use)
-                got_cpl_snr = 1;
-        } else {
-            block->new_snr_offsets = 0;
-        }
-    }
-    if (!num_cpl_blocks)
-        s->cpl_on = 0;
-
-    /* set bandwidth for each channel */
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        for (ch = 1; ch <= s->fbw_channels; ch++) {
-            if (block->channel_in_cpl[ch])
-                block->end_freq[ch] = s->start_freq[CPL_CH];
-            else
-                block->end_freq[ch] = s->bandwidth_code * 3 + 73;
-        }
-    }
-}
-
-
-/**
- * Apply stereo rematrixing to coefficients based on rematrixing flags.
- *
- * @param s  AC-3 encoder private context
- */
-void ff_ac3_apply_rematrixing(AC3EncodeContext *s)
-{
-    int nb_coefs;
-    int blk, bnd, i;
-    int start, end;
-    uint8_t *flags;
-
-    if (!s->rematrixing_enabled)
-        return;
-
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        if (block->new_rematrixing_strategy)
-            flags = block->rematrixing_flags;
-        nb_coefs = FFMIN(block->end_freq[1], block->end_freq[2]);
-        for (bnd = 0; bnd < block->num_rematrixing_bands; bnd++) {
-            if (flags[bnd]) {
-                start = ff_ac3_rematrix_band_tab[bnd];
-                end   = FFMIN(nb_coefs, ff_ac3_rematrix_band_tab[bnd+1]);
-                for (i = start; i < end; i++) {
-                    int32_t lt = block->fixed_coef[1][i];
-                    int32_t rt = block->fixed_coef[2][i];
-                    block->fixed_coef[1][i] = (lt + rt) >> 1;
-                    block->fixed_coef[2][i] = (lt - rt) >> 1;
-                }
-            }
-        }
-    }
-}
-
-
-/*
- * Initialize exponent tables.
- */
-static av_cold void exponent_init(AC3EncodeContext *s)
-{
-    int expstr, i, grpsize;
-
-    for (expstr = EXP_D15-1; expstr <= EXP_D45-1; expstr++) {
-        grpsize = 3 << expstr;
-        for (i = 12; i < 256; i++) {
-            exponent_group_tab[0][expstr][i] = (i + grpsize - 4) / grpsize;
-            exponent_group_tab[1][expstr][i] = (i              ) / grpsize;
-        }
-    }
-    /* LFE */
-    exponent_group_tab[0][0][7] = 2;
-
-    if (CONFIG_EAC3_ENCODER && s->eac3)
-        ff_eac3_exponent_init();
-}
-
-
-/*
- * Extract exponents from the MDCT coefficients.
- */
-static void extract_exponents(AC3EncodeContext *s)
-{
-    int ch        = !s->cpl_on;
-    int chan_size = AC3_MAX_COEFS * s->num_blocks * (s->channels - ch + 1);
-    AC3Block *block = &s->blocks[0];
-
-    s->ac3dsp.extract_exponents(block->exp[ch], block->fixed_coef[ch], chan_size);
-}
-
-
-/**
- * Exponent Difference Threshold.
- * New exponents are sent if their SAD exceed this number.
- */
-#define EXP_DIFF_THRESHOLD 500
-
-/**
- * Table used to select exponent strategy based on exponent reuse block interval.
- */
-static const uint8_t exp_strategy_reuse_tab[4][6] = {
-    { EXP_D15, EXP_D15, EXP_D15, EXP_D15, EXP_D15, EXP_D15 },
-    { EXP_D15, EXP_D15, EXP_D15, EXP_D15, EXP_D15, EXP_D15 },
-    { EXP_D25, EXP_D25, EXP_D15, EXP_D15, EXP_D15, EXP_D15 },
-    { EXP_D45, EXP_D25, EXP_D25, EXP_D15, EXP_D15, EXP_D15 }
-};
-
-/*
- * Calculate exponent strategies for all channels.
- * Array arrangement is reversed to simplify the per-channel calculation.
- */
-static void compute_exp_strategy(AC3EncodeContext *s)
-{
-    int ch, blk, blk1;
-
-    for (ch = !s->cpl_on; ch <= s->fbw_channels; ch++) {
-        uint8_t *exp_strategy = s->exp_strategy[ch];
-        uint8_t *exp          = s->blocks[0].exp[ch];
-        int exp_diff;
-
-        /* estimate if the exponent variation & decide if they should be
-           reused in the next frame */
-        exp_strategy[0] = EXP_NEW;
-        exp += AC3_MAX_COEFS;
-        for (blk = 1; blk < s->num_blocks; blk++, exp += AC3_MAX_COEFS) {
-            if (ch == CPL_CH) {
-                if (!s->blocks[blk-1].cpl_in_use) {
-                    exp_strategy[blk] = EXP_NEW;
-                    continue;
-                } else if (!s->blocks[blk].cpl_in_use) {
-                    exp_strategy[blk] = EXP_REUSE;
-                    continue;
-                }
-            } else if (s->blocks[blk].channel_in_cpl[ch] != s->blocks[blk-1].channel_in_cpl[ch]) {
-                exp_strategy[blk] = EXP_NEW;
-                continue;
-            }
-            exp_diff = s->dsp.sad[0](NULL, exp, exp - AC3_MAX_COEFS, 16, 16);
-            exp_strategy[blk] = EXP_REUSE;
-            if (ch == CPL_CH && exp_diff > (EXP_DIFF_THRESHOLD * (s->blocks[blk].end_freq[ch] - s->start_freq[ch]) / AC3_MAX_COEFS))
-                exp_strategy[blk] = EXP_NEW;
-            else if (ch > CPL_CH && exp_diff > EXP_DIFF_THRESHOLD)
-                exp_strategy[blk] = EXP_NEW;
-        }
-
-        /* now select the encoding strategy type : if exponents are often
-           recoded, we use a coarse encoding */
-        blk = 0;
-        while (blk < s->num_blocks) {
-            blk1 = blk + 1;
-            while (blk1 < s->num_blocks && exp_strategy[blk1] == EXP_REUSE)
-                blk1++;
-            exp_strategy[blk] = exp_strategy_reuse_tab[s->num_blks_code][blk1-blk-1];
-            blk = blk1;
-        }
-    }
-    if (s->lfe_on) {
-        ch = s->lfe_channel;
-        s->exp_strategy[ch][0] = EXP_D15;
-        for (blk = 1; blk < s->num_blocks; blk++)
-            s->exp_strategy[ch][blk] = EXP_REUSE;
-    }
-
-    /* for E-AC-3, determine frame exponent strategy */
-    if (CONFIG_EAC3_ENCODER && s->eac3)
-        ff_eac3_get_frame_exp_strategy(s);
-}
-
-
-/**
- * Update the exponents so that they are the ones the decoder will decode.
- *
- * @param[in,out] exp   array of exponents for 1 block in 1 channel
- * @param nb_exps       number of exponents in active bandwidth
- * @param exp_strategy  exponent strategy for the block
- * @param cpl           indicates if the block is in the coupling channel
- */
-static void encode_exponents_blk_ch(uint8_t *exp, int nb_exps, int exp_strategy,
-                                    int cpl)
-{
-    int nb_groups, i, k;
-
-    nb_groups = exponent_group_tab[cpl][exp_strategy-1][nb_exps] * 3;
-
-    /* for each group, compute the minimum exponent */
-    switch(exp_strategy) {
-    case EXP_D25:
-        for (i = 1, k = 1-cpl; i <= nb_groups; i++) {
-            uint8_t exp_min = exp[k];
-            if (exp[k+1] < exp_min)
-                exp_min = exp[k+1];
-            exp[i-cpl] = exp_min;
-            k += 2;
-        }
-        break;
-    case EXP_D45:
-        for (i = 1, k = 1-cpl; i <= nb_groups; i++) {
-            uint8_t exp_min = exp[k];
-            if (exp[k+1] < exp_min)
-                exp_min = exp[k+1];
-            if (exp[k+2] < exp_min)
-                exp_min = exp[k+2];
-            if (exp[k+3] < exp_min)
-                exp_min = exp[k+3];
-            exp[i-cpl] = exp_min;
-            k += 4;
-        }
-        break;
-    }
-
-    /* constraint for DC exponent */
-    if (!cpl && exp[0] > 15)
-        exp[0] = 15;
-
-    /* decrease the delta between each groups to within 2 so that they can be
-       differentially encoded */
-    for (i = 1; i <= nb_groups; i++)
-        exp[i] = FFMIN(exp[i], exp[i-1] + 2);
-    i--;
-    while (--i >= 0)
-        exp[i] = FFMIN(exp[i], exp[i+1] + 2);
-
-    if (cpl)
-        exp[-1] = exp[0] & ~1;
-
-    /* now we have the exponent values the decoder will see */
-    switch (exp_strategy) {
-    case EXP_D25:
-        for (i = nb_groups, k = (nb_groups * 2)-cpl; i > 0; i--) {
-            uint8_t exp1 = exp[i-cpl];
-            exp[k--] = exp1;
-            exp[k--] = exp1;
-        }
-        break;
-    case EXP_D45:
-        for (i = nb_groups, k = (nb_groups * 4)-cpl; i > 0; i--) {
-            exp[k] = exp[k-1] = exp[k-2] = exp[k-3] = exp[i-cpl];
-            k -= 4;
-        }
-        break;
-    }
-}
-
-
-/*
- * Encode exponents from original extracted form to what the decoder will see.
- * This copies and groups exponents based on exponent strategy and reduces
- * deltas between adjacent exponent groups so that they can be differentially
- * encoded.
- */
-static void encode_exponents(AC3EncodeContext *s)
-{
-    int blk, blk1, ch, cpl;
-    uint8_t *exp, *exp_strategy;
-    int nb_coefs, num_reuse_blocks;
-
-    for (ch = !s->cpl_on; ch <= s->channels; ch++) {
-        exp          = s->blocks[0].exp[ch] + s->start_freq[ch];
-        exp_strategy = s->exp_strategy[ch];
-
-        cpl = (ch == CPL_CH);
-        blk = 0;
-        while (blk < s->num_blocks) {
-            AC3Block *block = &s->blocks[blk];
-            if (cpl && !block->cpl_in_use) {
-                exp += AC3_MAX_COEFS;
-                blk++;
-                continue;
-            }
-            nb_coefs = block->end_freq[ch] - s->start_freq[ch];
-            blk1 = blk + 1;
-
-            /* count the number of EXP_REUSE blocks after the current block
-               and set exponent reference block numbers */
-            s->exp_ref_block[ch][blk] = blk;
-            while (blk1 < s->num_blocks && exp_strategy[blk1] == EXP_REUSE) {
-                s->exp_ref_block[ch][blk1] = blk;
-                blk1++;
-            }
-            num_reuse_blocks = blk1 - blk - 1;
-
-            /* for the EXP_REUSE case we select the min of the exponents */
-            s->ac3dsp.ac3_exponent_min(exp-s->start_freq[ch], num_reuse_blocks,
-                                       AC3_MAX_COEFS);
-
-            encode_exponents_blk_ch(exp, nb_coefs, exp_strategy[blk], cpl);
-
-            exp += AC3_MAX_COEFS * (num_reuse_blocks + 1);
-            blk = blk1;
-        }
-    }
-
-    /* reference block numbers have been changed, so reset ref_bap_set */
-    s->ref_bap_set = 0;
-}
-
-
-/*
- * Count exponent bits based on bandwidth, coupling, and exponent strategies.
- */
-static int count_exponent_bits(AC3EncodeContext *s)
-{
-    int blk, ch;
-    int nb_groups, bit_count;
-
-    bit_count = 0;
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
-            int exp_strategy = s->exp_strategy[ch][blk];
-            int cpl          = (ch == CPL_CH);
-            int nb_coefs     = block->end_freq[ch] - s->start_freq[ch];
-
-            if (exp_strategy == EXP_REUSE)
-                continue;
-
-            nb_groups = exponent_group_tab[cpl][exp_strategy-1][nb_coefs];
-            bit_count += 4 + (nb_groups * 7);
-        }
-    }
-
-    return bit_count;
-}
-
-
-/**
- * Group exponents.
- * 3 delta-encoded exponents are in each 7-bit group. The number of groups
- * varies depending on exponent strategy and bandwidth.
- *
- * @param s  AC-3 encoder private context
- */
-void ff_ac3_group_exponents(AC3EncodeContext *s)
-{
-    int blk, ch, i, cpl;
-    int group_size, nb_groups;
-    uint8_t *p;
-    int delta0, delta1, delta2;
-    int exp0, exp1;
-
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
-            int exp_strategy = s->exp_strategy[ch][blk];
-            if (exp_strategy == EXP_REUSE)
-                continue;
-            cpl = (ch == CPL_CH);
-            group_size = exp_strategy + (exp_strategy == EXP_D45);
-            nb_groups = exponent_group_tab[cpl][exp_strategy-1][block->end_freq[ch]-s->start_freq[ch]];
-            p = block->exp[ch] + s->start_freq[ch] - cpl;
-
-            /* DC exponent */
-            exp1 = *p++;
-            block->grouped_exp[ch][0] = exp1;
-
-            /* remaining exponents are delta encoded */
-            for (i = 1; i <= nb_groups; i++) {
-                /* merge three delta in one code */
-                exp0   = exp1;
-                exp1   = p[0];
-                p     += group_size;
-                delta0 = exp1 - exp0 + 2;
-                av_assert2(delta0 >= 0 && delta0 <= 4);
-
-                exp0   = exp1;
-                exp1   = p[0];
-                p     += group_size;
-                delta1 = exp1 - exp0 + 2;
-                av_assert2(delta1 >= 0 && delta1 <= 4);
-
-                exp0   = exp1;
-                exp1   = p[0];
-                p     += group_size;
-                delta2 = exp1 - exp0 + 2;
-                av_assert2(delta2 >= 0 && delta2 <= 4);
-
-                block->grouped_exp[ch][i] = ((delta0 * 5 + delta1) * 5) + delta2;
-            }
-        }
-    }
-}
-
-
-/**
- * Calculate final exponents from the supplied MDCT coefficients and exponent shift.
- * Extract exponents from MDCT coefficients, calculate exponent strategies,
- * and encode final exponents.
- *
- * @param s  AC-3 encoder private context
- */
-void ff_ac3_process_exponents(AC3EncodeContext *s)
-{
-    extract_exponents(s);
-
-    compute_exp_strategy(s);
-
-    encode_exponents(s);
-
-    emms_c();
-}
-
-
-/*
- * Count frame bits that are based solely on fixed parameters.
- * This only has to be run once when the encoder is initialized.
- */
-static void count_frame_bits_fixed(AC3EncodeContext *s)
-{
-    static const int frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 };
-    int blk;
-    int frame_bits;
-
-    /* assumptions:
-     *   no dynamic range codes
-     *   bit allocation parameters do not change between blocks
-     *   no delta bit allocation
-     *   no skipped data
-     *   no auxiliary data
-     *   no E-AC-3 metadata
-     */
-
-    /* header */
-    frame_bits = 16; /* sync info */
-    if (s->eac3) {
-        /* bitstream info header */
-        frame_bits += 35;
-        frame_bits += 1 + 1;
-        if (s->num_blocks != 0x6)
-            frame_bits++;
-        frame_bits++;
-        /* audio frame header */
-        if (s->num_blocks == 6)
-            frame_bits += 2;
-        frame_bits += 10;
-        /* exponent strategy */
-        if (s->use_frame_exp_strategy)
-            frame_bits += 5 * s->fbw_channels;
-        else
-            frame_bits += s->num_blocks * 2 * s->fbw_channels;
-        if (s->lfe_on)
-            frame_bits += s->num_blocks;
-        /* converter exponent strategy */
-        if (s->num_blks_code != 0x3)
-            frame_bits++;
-        else
-            frame_bits += s->fbw_channels * 5;
-        /* snr offsets */
-        frame_bits += 10;
-        /* block start info */
-        if (s->num_blocks != 1)
-            frame_bits++;
-    } else {
-        frame_bits += 49;
-        frame_bits += frame_bits_inc[s->channel_mode];
-    }
-
-    /* audio blocks */
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        if (!s->eac3) {
-            /* block switch flags */
-            frame_bits += s->fbw_channels;
-
-            /* dither flags */
-            frame_bits += s->fbw_channels;
-        }
-
-        /* dynamic range */
-        frame_bits++;
-
-        /* spectral extension */
-        if (s->eac3)
-            frame_bits++;
-
-        if (!s->eac3) {
-            /* exponent strategy */
-            frame_bits += 2 * s->fbw_channels;
-            if (s->lfe_on)
-                frame_bits++;
-
-            /* bit allocation params */
-            frame_bits++;
-            if (!blk)
-                frame_bits += 2 + 2 + 2 + 2 + 3;
-        }
-
-        /* converter snr offset */
-        if (s->eac3)
-            frame_bits++;
-
-        if (!s->eac3) {
-            /* delta bit allocation */
-            frame_bits++;
-
-            /* skipped data */
-            frame_bits++;
-        }
-    }
-
-    /* auxiliary data */
-    frame_bits++;
-
-    /* CRC */
-    frame_bits += 1 + 16;
-
-    s->frame_bits_fixed = frame_bits;
-}
-
-
-/*
- * Initialize bit allocation.
- * Set default parameter codes and calculate parameter values.
- */
-static av_cold void bit_alloc_init(AC3EncodeContext *s)
-{
-    int ch;
-
-    /* init default parameters */
-    s->slow_decay_code = 2;
-    s->fast_decay_code = 1;
-    s->slow_gain_code  = 1;
-    s->db_per_bit_code = s->eac3 ? 2 : 3;
-    s->floor_code      = 7;
-    for (ch = 0; ch <= s->channels; ch++)
-        s->fast_gain_code[ch] = 4;
-
-    /* initial snr offset */
-    s->coarse_snr_offset = 40;
-
-    /* compute real values */
-    /* currently none of these values change during encoding, so we can just
-       set them once at initialization */
-    s->bit_alloc.slow_decay = ff_ac3_slow_decay_tab[s->slow_decay_code] >> s->bit_alloc.sr_shift;
-    s->bit_alloc.fast_decay = ff_ac3_fast_decay_tab[s->fast_decay_code] >> s->bit_alloc.sr_shift;
-    s->bit_alloc.slow_gain  = ff_ac3_slow_gain_tab[s->slow_gain_code];
-    s->bit_alloc.db_per_bit = ff_ac3_db_per_bit_tab[s->db_per_bit_code];
-    s->bit_alloc.floor      = ff_ac3_floor_tab[s->floor_code];
-    s->bit_alloc.cpl_fast_leak = 0;
-    s->bit_alloc.cpl_slow_leak = 0;
-
-    count_frame_bits_fixed(s);
-}
-
-
-/*
- * Count the bits used to encode the frame, minus exponents and mantissas.
- * Bits based on fixed parameters have already been counted, so now we just
- * have to add the bits based on parameters that change during encoding.
- */
-static void count_frame_bits(AC3EncodeContext *s)
-{
-    AC3EncOptions *opt = &s->options;
-    int blk, ch;
-    int frame_bits = 0;
-
-    /* header */
-    if (s->eac3) {
-        if (opt->eac3_mixing_metadata) {
-            if (s->channel_mode > AC3_CHMODE_STEREO)
-                frame_bits += 2;
-            if (s->has_center)
-                frame_bits += 6;
-            if (s->has_surround)
-                frame_bits += 6;
-            frame_bits += s->lfe_on;
-            frame_bits += 1 + 1 + 2;
-            if (s->channel_mode < AC3_CHMODE_STEREO)
-                frame_bits++;
-            frame_bits++;
-        }
-        if (opt->eac3_info_metadata) {
-            frame_bits += 3 + 1 + 1;
-            if (s->channel_mode == AC3_CHMODE_STEREO)
-                frame_bits += 2 + 2;
-            if (s->channel_mode >= AC3_CHMODE_2F2R)
-                frame_bits += 2;
-            frame_bits++;
-            if (opt->audio_production_info)
-                frame_bits += 5 + 2 + 1;
-            frame_bits++;
-        }
-        /* coupling */
-        if (s->channel_mode > AC3_CHMODE_MONO) {
-            frame_bits++;
-            for (blk = 1; blk < s->num_blocks; blk++) {
-                AC3Block *block = &s->blocks[blk];
-                frame_bits++;
-                if (block->new_cpl_strategy)
-                    frame_bits++;
-            }
-        }
-        /* coupling exponent strategy */
-        if (s->cpl_on) {
-            if (s->use_frame_exp_strategy) {
-                frame_bits += 5 * s->cpl_on;
-            } else {
-                for (blk = 0; blk < s->num_blocks; blk++)
-                    frame_bits += 2 * s->blocks[blk].cpl_in_use;
-            }
-        }
-    } else {
-        if (opt->audio_production_info)
-            frame_bits += 7;
-        if (s->bitstream_id == 6) {
-            if (opt->extended_bsi_1)
-                frame_bits += 14;
-            if (opt->extended_bsi_2)
-                frame_bits += 14;
-        }
-    }
-
-    /* audio blocks */
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-
-        /* coupling strategy */
-        if (!s->eac3)
-            frame_bits++;
-        if (block->new_cpl_strategy) {
-            if (!s->eac3)
-                frame_bits++;
-            if (block->cpl_in_use) {
-                if (s->eac3)
-                    frame_bits++;
-                if (!s->eac3 || s->channel_mode != AC3_CHMODE_STEREO)
-                    frame_bits += s->fbw_channels;
-                if (s->channel_mode == AC3_CHMODE_STEREO)
-                    frame_bits++;
-                frame_bits += 4 + 4;
-                if (s->eac3)
-                    frame_bits++;
-                else
-                    frame_bits += s->num_cpl_subbands - 1;
-            }
-        }
-
-        /* coupling coordinates */
-        if (block->cpl_in_use) {
-            for (ch = 1; ch <= s->fbw_channels; ch++) {
-                if (block->channel_in_cpl[ch]) {
-                    if (!s->eac3 || block->new_cpl_coords[ch] != 2)
-                        frame_bits++;
-                    if (block->new_cpl_coords[ch]) {
-                        frame_bits += 2;
-                        frame_bits += (4 + 4) * s->num_cpl_bands;
-                    }
-                }
-            }
-        }
-
-        /* stereo rematrixing */
-        if (s->channel_mode == AC3_CHMODE_STEREO) {
-            if (!s->eac3 || blk > 0)
-                frame_bits++;
-            if (s->blocks[blk].new_rematrixing_strategy)
-                frame_bits += block->num_rematrixing_bands;
-        }
-
-        /* bandwidth codes & gain range */
-        for (ch = 1; ch <= s->fbw_channels; ch++) {
-            if (s->exp_strategy[ch][blk] != EXP_REUSE) {
-                if (!block->channel_in_cpl[ch])
-                    frame_bits += 6;
-                frame_bits += 2;
-            }
-        }
-
-        /* coupling exponent strategy */
-        if (!s->eac3 && block->cpl_in_use)
-            frame_bits += 2;
-
-        /* snr offsets and fast gain codes */
-        if (!s->eac3) {
-            frame_bits++;
-            if (block->new_snr_offsets)
-                frame_bits += 6 + (s->channels + block->cpl_in_use) * (4 + 3);
-        }
-
-        /* coupling leak info */
-        if (block->cpl_in_use) {
-            if (!s->eac3 || block->new_cpl_leak != 2)
-                frame_bits++;
-            if (block->new_cpl_leak)
-                frame_bits += 3 + 3;
-        }
-    }
-
-    s->frame_bits = s->frame_bits_fixed + frame_bits;
-}
-
-
-/*
- * Calculate masking curve based on the final exponents.
- * Also calculate the power spectral densities to use in future calculations.
- */
-static void bit_alloc_masking(AC3EncodeContext *s)
-{
-    int blk, ch;
-
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
-            /* We only need psd and mask for calculating bap.
-               Since we currently do not calculate bap when exponent
-               strategy is EXP_REUSE we do not need to calculate psd or mask. */
-            if (s->exp_strategy[ch][blk] != EXP_REUSE) {
-                ff_ac3_bit_alloc_calc_psd(block->exp[ch], s->start_freq[ch],
-                                          block->end_freq[ch], block->psd[ch],
-                                          block->band_psd[ch]);
-                ff_ac3_bit_alloc_calc_mask(&s->bit_alloc, block->band_psd[ch],
-                                           s->start_freq[ch], block->end_freq[ch],
-                                           ff_ac3_fast_gain_tab[s->fast_gain_code[ch]],
-                                           ch == s->lfe_channel,
-                                           DBA_NONE, 0, NULL, NULL, NULL,
-                                           block->mask[ch]);
-            }
-        }
-    }
-}
-
-
-/*
- * Ensure that bap for each block and channel point to the current bap_buffer.
- * They may have been switched during the bit allocation search.
- */
-static void reset_block_bap(AC3EncodeContext *s)
-{
-    int blk, ch;
-    uint8_t *ref_bap;
-
-    if (s->ref_bap[0][0] == s->bap_buffer && s->ref_bap_set)
-        return;
-
-    ref_bap = s->bap_buffer;
-    for (ch = 0; ch <= s->channels; ch++) {
-        for (blk = 0; blk < s->num_blocks; blk++)
-            s->ref_bap[ch][blk] = ref_bap + AC3_MAX_COEFS * s->exp_ref_block[ch][blk];
-        ref_bap += AC3_MAX_COEFS * s->num_blocks;
-    }
-    s->ref_bap_set = 1;
-}
-
-
-/**
- * Initialize mantissa counts.
- * These are set so that they are padded to the next whole group size when bits
- * are counted in compute_mantissa_size.
- *
- * @param[in,out] mant_cnt  running counts for each bap value for each block
- */
-static void count_mantissa_bits_init(uint16_t mant_cnt[AC3_MAX_BLOCKS][16])
-{
-    int blk;
-
-    for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
-        memset(mant_cnt[blk], 0, sizeof(mant_cnt[blk]));
-        mant_cnt[blk][1] = mant_cnt[blk][2] = 2;
-        mant_cnt[blk][4] = 1;
-    }
-}
-
-
-/**
- * Update mantissa bit counts for all blocks in 1 channel in a given bandwidth
- * range.
- *
- * @param s                 AC-3 encoder private context
- * @param ch                channel index
- * @param[in,out] mant_cnt  running counts for each bap value for each block
- * @param start             starting coefficient bin
- * @param end               ending coefficient bin
- */
-static void count_mantissa_bits_update_ch(AC3EncodeContext *s, int ch,
-                                          uint16_t mant_cnt[AC3_MAX_BLOCKS][16],
-                                          int start, int end)
-{
-    int blk;
-
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        if (ch == CPL_CH && !block->cpl_in_use)
-            continue;
-        s->ac3dsp.update_bap_counts(mant_cnt[blk],
-                                    s->ref_bap[ch][blk] + start,
-                                    FFMIN(end, block->end_freq[ch]) - start);
-    }
-}
-
-
-/*
- * Count the number of mantissa bits in the frame based on the bap values.
- */
-static int count_mantissa_bits(AC3EncodeContext *s)
-{
-    int ch, max_end_freq;
-    LOCAL_ALIGNED_16(uint16_t, mant_cnt, [AC3_MAX_BLOCKS], [16]);
-
-    count_mantissa_bits_init(mant_cnt);
-
-    max_end_freq = s->bandwidth_code * 3 + 73;
-    for (ch = !s->cpl_enabled; ch <= s->channels; ch++)
-        count_mantissa_bits_update_ch(s, ch, mant_cnt, s->start_freq[ch],
-                                      max_end_freq);
-
-    return s->ac3dsp.compute_mantissa_size(mant_cnt);
-}
-
-
-/**
- * Run the bit allocation with a given SNR offset.
- * This calculates the bit allocation pointers that will be used to determine
- * the quantization of each mantissa.
- *
- * @param s           AC-3 encoder private context
- * @param snr_offset  SNR offset, 0 to 1023
- * @return the number of bits needed for mantissas if the given SNR offset is
- *         is used.
- */
-static int bit_alloc(AC3EncodeContext *s, int snr_offset)
-{
-    int blk, ch;
-
-    snr_offset = (snr_offset - 240) << 2;
-
-    reset_block_bap(s);
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-
-        for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
-            /* Currently the only bit allocation parameters which vary across
-               blocks within a frame are the exponent values.  We can take
-               advantage of that by reusing the bit allocation pointers
-               whenever we reuse exponents. */
-            if (s->exp_strategy[ch][blk] != EXP_REUSE) {
-                s->ac3dsp.bit_alloc_calc_bap(block->mask[ch], block->psd[ch],
-                                             s->start_freq[ch], block->end_freq[ch],
-                                             snr_offset, s->bit_alloc.floor,
-                                             ff_ac3_bap_tab, s->ref_bap[ch][blk]);
-            }
-        }
-    }
-    return count_mantissa_bits(s);
-}
-
-
-/*
- * Constant bitrate bit allocation search.
- * Find the largest SNR offset that will allow data to fit in the frame.
- */
-static int cbr_bit_allocation(AC3EncodeContext *s)
-{
-    int ch;
-    int bits_left;
-    int snr_offset, snr_incr;
-
-    bits_left = 8 * s->frame_size - (s->frame_bits + s->exponent_bits);
-    if (bits_left < 0)
-        return AVERROR(EINVAL);
-
-    snr_offset = s->coarse_snr_offset << 4;
-
-    /* if previous frame SNR offset was 1023, check if current frame can also
-       use SNR offset of 1023. if so, skip the search. */
-    if ((snr_offset | s->fine_snr_offset[1]) == 1023) {
-        if (bit_alloc(s, 1023) <= bits_left)
-            return 0;
-    }
-
-    while (snr_offset >= 0 &&
-           bit_alloc(s, snr_offset) > bits_left) {
-        snr_offset -= 64;
-    }
-    if (snr_offset < 0)
-        return AVERROR(EINVAL);
-
-    FFSWAP(uint8_t *, s->bap_buffer, s->bap1_buffer);
-    for (snr_incr = 64; snr_incr > 0; snr_incr >>= 2) {
-        while (snr_offset + snr_incr <= 1023 &&
-               bit_alloc(s, snr_offset + snr_incr) <= bits_left) {
-            snr_offset += snr_incr;
-            FFSWAP(uint8_t *, s->bap_buffer, s->bap1_buffer);
-        }
-    }
-    FFSWAP(uint8_t *, s->bap_buffer, s->bap1_buffer);
-    reset_block_bap(s);
-
-    s->coarse_snr_offset = snr_offset >> 4;
-    for (ch = !s->cpl_on; ch <= s->channels; ch++)
-        s->fine_snr_offset[ch] = snr_offset & 0xF;
-
-    return 0;
-}
-
-
-/*
- * Perform bit allocation search.
- * Finds the SNR offset value that maximizes quality and fits in the specified
- * frame size.  Output is the SNR offset and a set of bit allocation pointers
- * used to quantize the mantissas.
- */
-int ff_ac3_compute_bit_allocation(AC3EncodeContext *s)
-{
-    count_frame_bits(s);
-
-    s->exponent_bits = count_exponent_bits(s);
-
-    bit_alloc_masking(s);
-
-    return cbr_bit_allocation(s);
-}
-
-
-/**
- * Symmetric quantization on 'levels' levels.
- *
- * @param c       unquantized coefficient
- * @param e       exponent
- * @param levels  number of quantization levels
- * @return        quantized coefficient
- */
-static inline int sym_quant(int c, int e, int levels)
-{
-    int v = (((levels * c) >> (24 - e)) + levels) >> 1;
-    av_assert2(v >= 0 && v < levels);
-    return v;
-}
-
-
-/**
- * Asymmetric quantization on 2^qbits levels.
- *
- * @param c      unquantized coefficient
- * @param e      exponent
- * @param qbits  number of quantization bits
- * @return       quantized coefficient
- */
-static inline int asym_quant(int c, int e, int qbits)
-{
-    int m;
-
-    c = (((c << e) >> (24 - qbits)) + 1) >> 1;
-    m = (1 << (qbits-1));
-    if (c >= m)
-        c = m - 1;
-    av_assert2(c >= -m);
-    return c;
-}
-
-
-/**
- * Quantize a set of mantissas for a single channel in a single block.
- *
- * @param s           Mantissa count context
- * @param fixed_coef  unquantized fixed-point coefficients
- * @param exp         exponents
- * @param bap         bit allocation pointer indices
- * @param[out] qmant  quantized coefficients
- * @param start_freq  starting coefficient bin
- * @param end_freq    ending coefficient bin
- */
-static void quantize_mantissas_blk_ch(AC3Mant *s, int32_t *fixed_coef,
-                                      uint8_t *exp, uint8_t *bap,
-                                      int16_t *qmant, int start_freq,
-                                      int end_freq)
-{
-    int i;
-
-    for (i = start_freq; i < end_freq; i++) {
-        int v;
-        int c = fixed_coef[i];
-        int e = exp[i];
-        int b = bap[i];
-        switch (b) {
-        case 0:
-            v = 0;
-            break;
-        case 1:
-            v = sym_quant(c, e, 3);
-            switch (s->mant1_cnt) {
-            case 0:
-                s->qmant1_ptr = &qmant[i];
-                v = 9 * v;
-                s->mant1_cnt = 1;
-                break;
-            case 1:
-                *s->qmant1_ptr += 3 * v;
-                s->mant1_cnt = 2;
-                v = 128;
-                break;
-            default:
-                *s->qmant1_ptr += v;
-                s->mant1_cnt = 0;
-                v = 128;
-                break;
-            }
-            break;
-        case 2:
-            v = sym_quant(c, e, 5);
-            switch (s->mant2_cnt) {
-            case 0:
-                s->qmant2_ptr = &qmant[i];
-                v = 25 * v;
-                s->mant2_cnt = 1;
-                break;
-            case 1:
-                *s->qmant2_ptr += 5 * v;
-                s->mant2_cnt = 2;
-                v = 128;
-                break;
-            default:
-                *s->qmant2_ptr += v;
-                s->mant2_cnt = 0;
-                v = 128;
-                break;
-            }
-            break;
-        case 3:
-            v = sym_quant(c, e, 7);
-            break;
-        case 4:
-            v = sym_quant(c, e, 11);
-            switch (s->mant4_cnt) {
-            case 0:
-                s->qmant4_ptr = &qmant[i];
-                v = 11 * v;
-                s->mant4_cnt = 1;
-                break;
-            default:
-                *s->qmant4_ptr += v;
-                s->mant4_cnt = 0;
-                v = 128;
-                break;
-            }
-            break;
-        case 5:
-            v = sym_quant(c, e, 15);
-            break;
-        case 14:
-            v = asym_quant(c, e, 14);
-            break;
-        case 15:
-            v = asym_quant(c, e, 16);
-            break;
-        default:
-            v = asym_quant(c, e, b - 1);
-            break;
-        }
-        qmant[i] = v;
-    }
-}
-
-
-/**
- * Quantize mantissas using coefficients, exponents, and bit allocation pointers.
- *
- * @param s  AC-3 encoder private context
- */
-void ff_ac3_quantize_mantissas(AC3EncodeContext *s)
-{
-    int blk, ch, ch0=0, got_cpl;
-
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        AC3Mant m = { 0 };
-
-        got_cpl = !block->cpl_in_use;
-        for (ch = 1; ch <= s->channels; ch++) {
-            if (!got_cpl && ch > 1 && block->channel_in_cpl[ch-1]) {
-                ch0     = ch - 1;
-                ch      = CPL_CH;
-                got_cpl = 1;
-            }
-            quantize_mantissas_blk_ch(&m, block->fixed_coef[ch],
-                                      s->blocks[s->exp_ref_block[ch][blk]].exp[ch],
-                                      s->ref_bap[ch][blk], block->qmant[ch],
-                                      s->start_freq[ch], block->end_freq[ch]);
-            if (ch == CPL_CH)
-                ch = ch0;
-        }
-    }
-}
-
-
-/*
- * Write the AC-3 frame header to the output bitstream.
- */
-static void ac3_output_frame_header(AC3EncodeContext *s)
-{
-    AC3EncOptions *opt = &s->options;
-
-    put_bits(&s->pb, 16, 0x0b77);   /* frame header */
-    put_bits(&s->pb, 16, 0);        /* crc1: will be filled later */
-    put_bits(&s->pb, 2,  s->bit_alloc.sr_code);
-    put_bits(&s->pb, 6,  s->frame_size_code + (s->frame_size - s->frame_size_min) / 2);
-    put_bits(&s->pb, 5,  s->bitstream_id);
-    put_bits(&s->pb, 3,  s->bitstream_mode);
-    put_bits(&s->pb, 3,  s->channel_mode);
-    if ((s->channel_mode & 0x01) && s->channel_mode != AC3_CHMODE_MONO)
-        put_bits(&s->pb, 2, s->center_mix_level);
-    if (s->channel_mode & 0x04)
-        put_bits(&s->pb, 2, s->surround_mix_level);
-    if (s->channel_mode == AC3_CHMODE_STEREO)
-        put_bits(&s->pb, 2, opt->dolby_surround_mode);
-    put_bits(&s->pb, 1, s->lfe_on); /* LFE */
-    put_bits(&s->pb, 5, -opt->dialogue_level);
-    put_bits(&s->pb, 1, 0);         /* no compression control word */
-    put_bits(&s->pb, 1, 0);         /* no lang code */
-    put_bits(&s->pb, 1, opt->audio_production_info);
-    if (opt->audio_production_info) {
-        put_bits(&s->pb, 5, opt->mixing_level - 80);
-        put_bits(&s->pb, 2, opt->room_type);
-    }
-    put_bits(&s->pb, 1, opt->copyright);
-    put_bits(&s->pb, 1, opt->original);
-    if (s->bitstream_id == 6) {
-        /* alternate bit stream syntax */
-        put_bits(&s->pb, 1, opt->extended_bsi_1);
-        if (opt->extended_bsi_1) {
-            put_bits(&s->pb, 2, opt->preferred_stereo_downmix);
-            put_bits(&s->pb, 3, s->ltrt_center_mix_level);
-            put_bits(&s->pb, 3, s->ltrt_surround_mix_level);
-            put_bits(&s->pb, 3, s->loro_center_mix_level);
-            put_bits(&s->pb, 3, s->loro_surround_mix_level);
-        }
-        put_bits(&s->pb, 1, opt->extended_bsi_2);
-        if (opt->extended_bsi_2) {
-            put_bits(&s->pb, 2, opt->dolby_surround_ex_mode);
-            put_bits(&s->pb, 2, opt->dolby_headphone_mode);
-            put_bits(&s->pb, 1, opt->ad_converter_type);
-            put_bits(&s->pb, 9, 0);     /* xbsi2 and encinfo : reserved */
-        }
-    } else {
-    put_bits(&s->pb, 1, 0);         /* no time code 1 */
-    put_bits(&s->pb, 1, 0);         /* no time code 2 */
-    }
-    put_bits(&s->pb, 1, 0);         /* no additional bit stream info */
-}
-
-
-/*
- * Write one audio block to the output bitstream.
- */
-static void output_audio_block(AC3EncodeContext *s, int blk)
-{
-    int ch, i, baie, bnd, got_cpl, ch0;
-    AC3Block *block = &s->blocks[blk];
-
-    /* block switching */
-    if (!s->eac3) {
-        for (ch = 0; ch < s->fbw_channels; ch++)
-            put_bits(&s->pb, 1, 0);
-    }
-
-    /* dither flags */
-    if (!s->eac3) {
-        for (ch = 0; ch < s->fbw_channels; ch++)
-            put_bits(&s->pb, 1, 1);
-    }
-
-    /* dynamic range codes */
-    put_bits(&s->pb, 1, 0);
-
-    /* spectral extension */
-    if (s->eac3)
-        put_bits(&s->pb, 1, 0);
-
-    /* channel coupling */
-    if (!s->eac3)
-        put_bits(&s->pb, 1, block->new_cpl_strategy);
-    if (block->new_cpl_strategy) {
-        if (!s->eac3)
-            put_bits(&s->pb, 1, block->cpl_in_use);
-        if (block->cpl_in_use) {
-            int start_sub, end_sub;
-            if (s->eac3)
-                put_bits(&s->pb, 1, 0); /* enhanced coupling */
-            if (!s->eac3 || s->channel_mode != AC3_CHMODE_STEREO) {
-                for (ch = 1; ch <= s->fbw_channels; ch++)
-                    put_bits(&s->pb, 1, block->channel_in_cpl[ch]);
-            }
-            if (s->channel_mode == AC3_CHMODE_STEREO)
-                put_bits(&s->pb, 1, 0); /* phase flags in use */
-            start_sub = (s->start_freq[CPL_CH] - 37) / 12;
-            end_sub   = (s->cpl_end_freq       - 37) / 12;
-            put_bits(&s->pb, 4, start_sub);
-            put_bits(&s->pb, 4, end_sub - 3);
-            /* coupling band structure */
-            if (s->eac3) {
-                put_bits(&s->pb, 1, 0); /* use default */
-            } else {
-                for (bnd = start_sub+1; bnd < end_sub; bnd++)
-                    put_bits(&s->pb, 1, ff_eac3_default_cpl_band_struct[bnd]);
-            }
-        }
-    }
-
-    /* coupling coordinates */
-    if (block->cpl_in_use) {
-        for (ch = 1; ch <= s->fbw_channels; ch++) {
-            if (block->channel_in_cpl[ch]) {
-                if (!s->eac3 || block->new_cpl_coords[ch] != 2)
-                    put_bits(&s->pb, 1, block->new_cpl_coords[ch]);
-                if (block->new_cpl_coords[ch]) {
-                    put_bits(&s->pb, 2, block->cpl_master_exp[ch]);
-                    for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
-                        put_bits(&s->pb, 4, block->cpl_coord_exp [ch][bnd]);
-                        put_bits(&s->pb, 4, block->cpl_coord_mant[ch][bnd]);
-                    }
-                }
-            }
-        }
-    }
-
-    /* stereo rematrixing */
-    if (s->channel_mode == AC3_CHMODE_STEREO) {
-        if (!s->eac3 || blk > 0)
-            put_bits(&s->pb, 1, block->new_rematrixing_strategy);
-        if (block->new_rematrixing_strategy) {
-            /* rematrixing flags */
-            for (bnd = 0; bnd < block->num_rematrixing_bands; bnd++)
-                put_bits(&s->pb, 1, block->rematrixing_flags[bnd]);
-        }
-    }
-
-    /* exponent strategy */
-    if (!s->eac3) {
-        for (ch = !block->cpl_in_use; ch <= s->fbw_channels; ch++)
-            put_bits(&s->pb, 2, s->exp_strategy[ch][blk]);
-        if (s->lfe_on)
-            put_bits(&s->pb, 1, s->exp_strategy[s->lfe_channel][blk]);
-    }
-
-    /* bandwidth */
-    for (ch = 1; ch <= s->fbw_channels; ch++) {
-        if (s->exp_strategy[ch][blk] != EXP_REUSE && !block->channel_in_cpl[ch])
-            put_bits(&s->pb, 6, s->bandwidth_code);
-    }
-
-    /* exponents */
-    for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
-        int nb_groups;
-        int cpl = (ch == CPL_CH);
-
-        if (s->exp_strategy[ch][blk] == EXP_REUSE)
-            continue;
-
-        /* DC exponent */
-        put_bits(&s->pb, 4, block->grouped_exp[ch][0] >> cpl);
-
-        /* exponent groups */
-        nb_groups = exponent_group_tab[cpl][s->exp_strategy[ch][blk]-1][block->end_freq[ch]-s->start_freq[ch]];
-        for (i = 1; i <= nb_groups; i++)
-            put_bits(&s->pb, 7, block->grouped_exp[ch][i]);
-
-        /* gain range info */
-        if (ch != s->lfe_channel && !cpl)
-            put_bits(&s->pb, 2, 0);
-    }
-
-    /* bit allocation info */
-    if (!s->eac3) {
-        baie = (blk == 0);
-        put_bits(&s->pb, 1, baie);
-        if (baie) {
-            put_bits(&s->pb, 2, s->slow_decay_code);
-            put_bits(&s->pb, 2, s->fast_decay_code);
-            put_bits(&s->pb, 2, s->slow_gain_code);
-            put_bits(&s->pb, 2, s->db_per_bit_code);
-            put_bits(&s->pb, 3, s->floor_code);
-        }
-    }
-
-    /* snr offset */
-    if (!s->eac3) {
-        put_bits(&s->pb, 1, block->new_snr_offsets);
-        if (block->new_snr_offsets) {
-            put_bits(&s->pb, 6, s->coarse_snr_offset);
-            for (ch = !block->cpl_in_use; ch <= s->channels; ch++) {
-                put_bits(&s->pb, 4, s->fine_snr_offset[ch]);
-                put_bits(&s->pb, 3, s->fast_gain_code[ch]);
-            }
-        }
-    } else {
-        put_bits(&s->pb, 1, 0); /* no converter snr offset */
-    }
-
-    /* coupling leak */
-    if (block->cpl_in_use) {
-        if (!s->eac3 || block->new_cpl_leak != 2)
-            put_bits(&s->pb, 1, block->new_cpl_leak);
-        if (block->new_cpl_leak) {
-            put_bits(&s->pb, 3, s->bit_alloc.cpl_fast_leak);
-            put_bits(&s->pb, 3, s->bit_alloc.cpl_slow_leak);
-        }
-    }
-
-    if (!s->eac3) {
-        put_bits(&s->pb, 1, 0); /* no delta bit allocation */
-        put_bits(&s->pb, 1, 0); /* no data to skip */
-    }
-
-    /* mantissas */
-    got_cpl = !block->cpl_in_use;
-    for (ch = 1; ch <= s->channels; ch++) {
-        int b, q;
-
-        if (!got_cpl && ch > 1 && block->channel_in_cpl[ch-1]) {
-            ch0     = ch - 1;
-            ch      = CPL_CH;
-            got_cpl = 1;
-        }
-        for (i = s->start_freq[ch]; i < block->end_freq[ch]; i++) {
-            q = block->qmant[ch][i];
-            b = s->ref_bap[ch][blk][i];
-            switch (b) {
-            case 0:                                          break;
-            case 1: if (q != 128) put_bits (&s->pb,   5, q); break;
-            case 2: if (q != 128) put_bits (&s->pb,   7, q); break;
-            case 3:               put_sbits(&s->pb,   3, q); break;
-            case 4: if (q != 128) put_bits (&s->pb,   7, q); break;
-            case 14:              put_sbits(&s->pb,  14, q); break;
-            case 15:              put_sbits(&s->pb,  16, q); break;
-            default:              put_sbits(&s->pb, b-1, q); break;
-            }
-        }
-        if (ch == CPL_CH)
-            ch = ch0;
-    }
-}
-
-
-/** CRC-16 Polynomial */
-#define CRC16_POLY ((1 << 0) | (1 << 2) | (1 << 15) | (1 << 16))
-
-
-static unsigned int mul_poly(unsigned int a, unsigned int b, unsigned int poly)
-{
-    unsigned int c;
-
-    c = 0;
-    while (a) {
-        if (a & 1)
-            c ^= b;
-        a = a >> 1;
-        b = b << 1;
-        if (b & (1 << 16))
-            b ^= poly;
-    }
-    return c;
-}
-
-
-static unsigned int pow_poly(unsigned int a, unsigned int n, unsigned int poly)
-{
-    unsigned int r;
-    r = 1;
-    while (n) {
-        if (n & 1)
-            r = mul_poly(r, a, poly);
-        a = mul_poly(a, a, poly);
-        n >>= 1;
-    }
-    return r;
-}
-
-
-/*
- * Fill the end of the frame with 0's and compute the two CRCs.
- */
-static void output_frame_end(AC3EncodeContext *s)
-{
-    const AVCRC *crc_ctx = av_crc_get_table(AV_CRC_16_ANSI);
-    int frame_size_58, pad_bytes, crc1, crc2_partial, crc2, crc_inv;
-    uint8_t *frame;
-
-    frame_size_58 = ((s->frame_size >> 2) + (s->frame_size >> 4)) << 1;
-
-    /* pad the remainder of the frame with zeros */
-    av_assert2(s->frame_size * 8 - put_bits_count(&s->pb) >= 18);
-    flush_put_bits(&s->pb);
-    frame = s->pb.buf;
-    pad_bytes = s->frame_size - (put_bits_ptr(&s->pb) - frame) - 2;
-    av_assert2(pad_bytes >= 0);
-    if (pad_bytes > 0)
-        memset(put_bits_ptr(&s->pb), 0, pad_bytes);
-
-    if (s->eac3) {
-        /* compute crc2 */
-        crc2_partial = av_crc(crc_ctx, 0, frame + 2, s->frame_size - 5);
-    } else {
-    /* compute crc1 */
-    /* this is not so easy because it is at the beginning of the data... */
-    crc1    = av_bswap16(av_crc(crc_ctx, 0, frame + 4, frame_size_58 - 4));
-    crc_inv = s->crc_inv[s->frame_size > s->frame_size_min];
-    crc1    = mul_poly(crc_inv, crc1, CRC16_POLY);
-    AV_WB16(frame + 2, crc1);
-
-    /* compute crc2 */
-    crc2_partial = av_crc(crc_ctx, 0, frame + frame_size_58,
-                          s->frame_size - frame_size_58 - 3);
-    }
-    crc2 = av_crc(crc_ctx, crc2_partial, frame + s->frame_size - 3, 1);
-    /* ensure crc2 does not match sync word by flipping crcrsv bit if needed */
-    if (crc2 == 0x770B) {
-        frame[s->frame_size - 3] ^= 0x1;
-        crc2 = av_crc(crc_ctx, crc2_partial, frame + s->frame_size - 3, 1);
-    }
-    crc2 = av_bswap16(crc2);
-    AV_WB16(frame + s->frame_size - 2, crc2);
-}
-
-
-/**
- * Write the frame to the output bitstream.
- *
- * @param s      AC-3 encoder private context
- * @param frame  output data buffer
- */
-void ff_ac3_output_frame(AC3EncodeContext *s, unsigned char *frame)
-{
-    int blk;
-
-    init_put_bits(&s->pb, frame, AC3_MAX_CODED_FRAME_SIZE);
-
-    s->output_frame_header(s);
-
-    for (blk = 0; blk < s->num_blocks; blk++)
-        output_audio_block(s, blk);
-
-    output_frame_end(s);
-}
-
-
-static void dprint_options(AC3EncodeContext *s)
-{
-#ifdef DEBUG
-    AVCodecContext *avctx = s->avctx;
-    AC3EncOptions *opt = &s->options;
-    char strbuf[32];
-
-    switch (s->bitstream_id) {
-    case  6:  av_strlcpy(strbuf, "AC-3 (alt syntax)",       32); break;
-    case  8:  av_strlcpy(strbuf, "AC-3 (standard)",         32); break;
-    case  9:  av_strlcpy(strbuf, "AC-3 (dnet half-rate)",   32); break;
-    case 10:  av_strlcpy(strbuf, "AC-3 (dnet quater-rate)", 32); break;
-    case 16:  av_strlcpy(strbuf, "E-AC-3 (enhanced)",       32); break;
-    default: snprintf(strbuf, 32, "ERROR");
-    }
-    av_dlog(avctx, "bitstream_id: %s (%d)\n", strbuf, s->bitstream_id);
-    av_dlog(avctx, "sample_fmt: %s\n", av_get_sample_fmt_name(avctx->sample_fmt));
-    av_get_channel_layout_string(strbuf, 32, s->channels, avctx->channel_layout);
-    av_dlog(avctx, "channel_layout: %s\n", strbuf);
-    av_dlog(avctx, "sample_rate: %d\n", s->sample_rate);
-    av_dlog(avctx, "bit_rate: %d\n", s->bit_rate);
-    av_dlog(avctx, "blocks/frame: %d (code=%d)\n", s->num_blocks, s->num_blks_code);
-    if (s->cutoff)
-        av_dlog(avctx, "cutoff: %d\n", s->cutoff);
-
-    av_dlog(avctx, "per_frame_metadata: %s\n",
-            opt->allow_per_frame_metadata?"on":"off");
-    if (s->has_center)
-        av_dlog(avctx, "center_mixlev: %0.3f (%d)\n", opt->center_mix_level,
-                s->center_mix_level);
-    else
-        av_dlog(avctx, "center_mixlev: {not written}\n");
-    if (s->has_surround)
-        av_dlog(avctx, "surround_mixlev: %0.3f (%d)\n", opt->surround_mix_level,
-                s->surround_mix_level);
-    else
-        av_dlog(avctx, "surround_mixlev: {not written}\n");
-    if (opt->audio_production_info) {
-        av_dlog(avctx, "mixing_level: %ddB\n", opt->mixing_level);
-        switch (opt->room_type) {
-        case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
-        case AC3ENC_OPT_LARGE_ROOM:    av_strlcpy(strbuf, "large", 32);        break;
-        case AC3ENC_OPT_SMALL_ROOM:    av_strlcpy(strbuf, "small", 32);        break;
-        default: snprintf(strbuf, 32, "ERROR (%d)", opt->room_type);
-        }
-        av_dlog(avctx, "room_type: %s\n", strbuf);
-    } else {
-        av_dlog(avctx, "mixing_level: {not written}\n");
-        av_dlog(avctx, "room_type: {not written}\n");
-    }
-    av_dlog(avctx, "copyright: %s\n", opt->copyright?"on":"off");
-    av_dlog(avctx, "dialnorm: %ddB\n", opt->dialogue_level);
-    if (s->channel_mode == AC3_CHMODE_STEREO) {
-        switch (opt->dolby_surround_mode) {
-        case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
-        case AC3ENC_OPT_MODE_ON:       av_strlcpy(strbuf, "on", 32);           break;
-        case AC3ENC_OPT_MODE_OFF:      av_strlcpy(strbuf, "off", 32);          break;
-        default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_mode);
-        }
-        av_dlog(avctx, "dsur_mode: %s\n", strbuf);
-    } else {
-        av_dlog(avctx, "dsur_mode: {not written}\n");
-    }
-    av_dlog(avctx, "original: %s\n", opt->original?"on":"off");
-
-    if (s->bitstream_id == 6) {
-        if (opt->extended_bsi_1) {
-            switch (opt->preferred_stereo_downmix) {
-            case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
-            case AC3ENC_OPT_DOWNMIX_LTRT:  av_strlcpy(strbuf, "ltrt", 32);         break;
-            case AC3ENC_OPT_DOWNMIX_LORO:  av_strlcpy(strbuf, "loro", 32);         break;
-            default: snprintf(strbuf, 32, "ERROR (%d)", opt->preferred_stereo_downmix);
-            }
-            av_dlog(avctx, "dmix_mode: %s\n", strbuf);
-            av_dlog(avctx, "ltrt_cmixlev: %0.3f (%d)\n",
-                    opt->ltrt_center_mix_level, s->ltrt_center_mix_level);
-            av_dlog(avctx, "ltrt_surmixlev: %0.3f (%d)\n",
-                    opt->ltrt_surround_mix_level, s->ltrt_surround_mix_level);
-            av_dlog(avctx, "loro_cmixlev: %0.3f (%d)\n",
-                    opt->loro_center_mix_level, s->loro_center_mix_level);
-            av_dlog(avctx, "loro_surmixlev: %0.3f (%d)\n",
-                    opt->loro_surround_mix_level, s->loro_surround_mix_level);
-        } else {
-            av_dlog(avctx, "extended bitstream info 1: {not written}\n");
-        }
-        if (opt->extended_bsi_2) {
-            switch (opt->dolby_surround_ex_mode) {
-            case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
-            case AC3ENC_OPT_MODE_ON:       av_strlcpy(strbuf, "on", 32);           break;
-            case AC3ENC_OPT_MODE_OFF:      av_strlcpy(strbuf, "off", 32);          break;
-            default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_ex_mode);
-            }
-            av_dlog(avctx, "dsurex_mode: %s\n", strbuf);
-            switch (opt->dolby_headphone_mode) {
-            case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
-            case AC3ENC_OPT_MODE_ON:       av_strlcpy(strbuf, "on", 32);           break;
-            case AC3ENC_OPT_MODE_OFF:      av_strlcpy(strbuf, "off", 32);          break;
-            default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_headphone_mode);
-            }
-            av_dlog(avctx, "dheadphone_mode: %s\n", strbuf);
-
-            switch (opt->ad_converter_type) {
-            case AC3ENC_OPT_ADCONV_STANDARD: av_strlcpy(strbuf, "standard", 32); break;
-            case AC3ENC_OPT_ADCONV_HDCD:     av_strlcpy(strbuf, "hdcd", 32);     break;
-            default: snprintf(strbuf, 32, "ERROR (%d)", opt->ad_converter_type);
-            }
-            av_dlog(avctx, "ad_conv_type: %s\n", strbuf);
-        } else {
-            av_dlog(avctx, "extended bitstream info 2: {not written}\n");
-        }
-    }
-#endif
-}
-
-
-#define FLT_OPTION_THRESHOLD 0.01
-
-static int validate_float_option(float v, const float *v_list, int v_list_size)
-{
-    int i;
-
-    for (i = 0; i < v_list_size; i++) {
-        if (v < (v_list[i] + FLT_OPTION_THRESHOLD) &&
-            v > (v_list[i] - FLT_OPTION_THRESHOLD))
-            break;
-    }
-    if (i == v_list_size)
-        return -1;
-
-    return i;
-}
-
-
-static void validate_mix_level(void *log_ctx, const char *opt_name,
-                               float *opt_param, const float *list,
-                               int list_size, int default_value, int min_value,
-                               int *ctx_param)
-{
-    int mixlev = validate_float_option(*opt_param, list, list_size);
-    if (mixlev < min_value) {
-        mixlev = default_value;
-        if (*opt_param >= 0.0) {
-            av_log(log_ctx, AV_LOG_WARNING, "requested %s is not valid. using "
-                   "default value: %0.3f\n", opt_name, list[mixlev]);
-        }
-    }
-    *opt_param = list[mixlev];
-    *ctx_param = mixlev;
-}
-
-
-/**
- * Validate metadata options as set by AVOption system.
- * These values can optionally be changed per-frame.
- *
- * @param s  AC-3 encoder private context
- */
-int ff_ac3_validate_metadata(AC3EncodeContext *s)
-{
-    AVCodecContext *avctx = s->avctx;
-    AC3EncOptions *opt = &s->options;
-
-    opt->audio_production_info = 0;
-    opt->extended_bsi_1        = 0;
-    opt->extended_bsi_2        = 0;
-    opt->eac3_mixing_metadata  = 0;
-    opt->eac3_info_metadata    = 0;
-
-    /* determine mixing metadata / xbsi1 use */
-    if (s->channel_mode > AC3_CHMODE_STEREO && opt->preferred_stereo_downmix != AC3ENC_OPT_NONE) {
-        opt->extended_bsi_1       = 1;
-        opt->eac3_mixing_metadata = 1;
-    }
-    if (s->has_center &&
-        (opt->ltrt_center_mix_level >= 0 || opt->loro_center_mix_level >= 0)) {
-        opt->extended_bsi_1       = 1;
-        opt->eac3_mixing_metadata = 1;
-    }
-    if (s->has_surround &&
-        (opt->ltrt_surround_mix_level >= 0 || opt->loro_surround_mix_level >= 0)) {
-        opt->extended_bsi_1       = 1;
-        opt->eac3_mixing_metadata = 1;
-    }
-
-    if (s->eac3) {
-        /* determine info metadata use */
-        if (avctx->audio_service_type != AV_AUDIO_SERVICE_TYPE_MAIN)
-            opt->eac3_info_metadata = 1;
-        if (opt->copyright != AC3ENC_OPT_NONE || opt->original != AC3ENC_OPT_NONE)
-            opt->eac3_info_metadata = 1;
-        if (s->channel_mode == AC3_CHMODE_STEREO &&
-            (opt->dolby_headphone_mode != AC3ENC_OPT_NONE || opt->dolby_surround_mode != AC3ENC_OPT_NONE))
-            opt->eac3_info_metadata = 1;
-        if (s->channel_mode >= AC3_CHMODE_2F2R && opt->dolby_surround_ex_mode != AC3ENC_OPT_NONE)
-            opt->eac3_info_metadata = 1;
-        if (opt->mixing_level != AC3ENC_OPT_NONE || opt->room_type != AC3ENC_OPT_NONE ||
-            opt->ad_converter_type != AC3ENC_OPT_NONE) {
-            opt->audio_production_info = 1;
-            opt->eac3_info_metadata    = 1;
-        }
-    } else {
-        /* determine audio production info use */
-        if (opt->mixing_level != AC3ENC_OPT_NONE || opt->room_type != AC3ENC_OPT_NONE)
-            opt->audio_production_info = 1;
-
-        /* determine xbsi2 use */
-        if (s->channel_mode >= AC3_CHMODE_2F2R && opt->dolby_surround_ex_mode != AC3ENC_OPT_NONE)
-            opt->extended_bsi_2 = 1;
-        if (s->channel_mode == AC3_CHMODE_STEREO && opt->dolby_headphone_mode != AC3ENC_OPT_NONE)
-            opt->extended_bsi_2 = 1;
-        if (opt->ad_converter_type != AC3ENC_OPT_NONE)
-            opt->extended_bsi_2 = 1;
-    }
-
-    /* validate AC-3 mixing levels */
-    if (!s->eac3) {
-        if (s->has_center) {
-            validate_mix_level(avctx, "center_mix_level", &opt->center_mix_level,
-                            cmixlev_options, CMIXLEV_NUM_OPTIONS, 1, 0,
-                            &s->center_mix_level);
-        }
-        if (s->has_surround) {
-            validate_mix_level(avctx, "surround_mix_level", &opt->surround_mix_level,
-                            surmixlev_options, SURMIXLEV_NUM_OPTIONS, 1, 0,
-                            &s->surround_mix_level);
-        }
-    }
-
-    /* validate extended bsi 1 / mixing metadata */
-    if (opt->extended_bsi_1 || opt->eac3_mixing_metadata) {
-        /* default preferred stereo downmix */
-        if (opt->preferred_stereo_downmix == AC3ENC_OPT_NONE)
-            opt->preferred_stereo_downmix = AC3ENC_OPT_NOT_INDICATED;
-        if (!s->eac3 || s->has_center) {
-            /* validate Lt/Rt center mix level */
-            validate_mix_level(avctx, "ltrt_center_mix_level",
-                               &opt->ltrt_center_mix_level, extmixlev_options,
-                               EXTMIXLEV_NUM_OPTIONS, 5, 0,
-                               &s->ltrt_center_mix_level);
-            /* validate Lo/Ro center mix level */
-            validate_mix_level(avctx, "loro_center_mix_level",
-                               &opt->loro_center_mix_level, extmixlev_options,
-                               EXTMIXLEV_NUM_OPTIONS, 5, 0,
-                               &s->loro_center_mix_level);
-        }
-        if (!s->eac3 || s->has_surround) {
-            /* validate Lt/Rt surround mix level */
-            validate_mix_level(avctx, "ltrt_surround_mix_level",
-                               &opt->ltrt_surround_mix_level, extmixlev_options,
-                               EXTMIXLEV_NUM_OPTIONS, 6, 3,
-                               &s->ltrt_surround_mix_level);
-            /* validate Lo/Ro surround mix level */
-            validate_mix_level(avctx, "loro_surround_mix_level",
-                               &opt->loro_surround_mix_level, extmixlev_options,
-                               EXTMIXLEV_NUM_OPTIONS, 6, 3,
-                               &s->loro_surround_mix_level);
-        }
-    }
-
-    /* validate audio service type / channels combination */
-    if ((avctx->audio_service_type == AV_AUDIO_SERVICE_TYPE_KARAOKE &&
-         avctx->channels == 1) ||
-        ((avctx->audio_service_type == AV_AUDIO_SERVICE_TYPE_COMMENTARY ||
-          avctx->audio_service_type == AV_AUDIO_SERVICE_TYPE_EMERGENCY  ||
-          avctx->audio_service_type == AV_AUDIO_SERVICE_TYPE_VOICE_OVER)
-         && avctx->channels > 1)) {
-        av_log(avctx, AV_LOG_ERROR, "invalid audio service type for the "
-                                    "specified number of channels\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* validate extended bsi 2 / info metadata */
-    if (opt->extended_bsi_2 || opt->eac3_info_metadata) {
-        /* default dolby headphone mode */
-        if (opt->dolby_headphone_mode == AC3ENC_OPT_NONE)
-            opt->dolby_headphone_mode = AC3ENC_OPT_NOT_INDICATED;
-        /* default dolby surround ex mode */
-        if (opt->dolby_surround_ex_mode == AC3ENC_OPT_NONE)
-            opt->dolby_surround_ex_mode = AC3ENC_OPT_NOT_INDICATED;
-        /* default A/D converter type */
-        if (opt->ad_converter_type == AC3ENC_OPT_NONE)
-            opt->ad_converter_type = AC3ENC_OPT_ADCONV_STANDARD;
-    }
-
-    /* copyright & original defaults */
-    if (!s->eac3 || opt->eac3_info_metadata) {
-        /* default copyright */
-        if (opt->copyright == AC3ENC_OPT_NONE)
-            opt->copyright = AC3ENC_OPT_OFF;
-        /* default original */
-        if (opt->original == AC3ENC_OPT_NONE)
-            opt->original = AC3ENC_OPT_ON;
-    }
-
-    /* dolby surround mode default */
-    if (!s->eac3 || opt->eac3_info_metadata) {
-        if (opt->dolby_surround_mode == AC3ENC_OPT_NONE)
-            opt->dolby_surround_mode = AC3ENC_OPT_NOT_INDICATED;
-    }
-
-    /* validate audio production info */
-    if (opt->audio_production_info) {
-        if (opt->mixing_level == AC3ENC_OPT_NONE) {
-            av_log(avctx, AV_LOG_ERROR, "mixing_level must be set if "
-                   "room_type is set\n");
-            return AVERROR(EINVAL);
-        }
-        if (opt->mixing_level < 80) {
-            av_log(avctx, AV_LOG_ERROR, "invalid mixing level. must be between "
-                   "80dB and 111dB\n");
-            return AVERROR(EINVAL);
-        }
-        /* default room type */
-        if (opt->room_type == AC3ENC_OPT_NONE)
-            opt->room_type = AC3ENC_OPT_NOT_INDICATED;
-    }
-
-    /* set bitstream id for alternate bitstream syntax */
-    if (!s->eac3 && (opt->extended_bsi_1 || opt->extended_bsi_2)) {
-        if (s->bitstream_id > 8 && s->bitstream_id < 11) {
-            static int warn_once = 1;
-            if (warn_once) {
-                av_log(avctx, AV_LOG_WARNING, "alternate bitstream syntax is "
-                       "not compatible with reduced samplerates. writing of "
-                       "extended bitstream information will be disabled.\n");
-                warn_once = 0;
-            }
-        } else {
-            s->bitstream_id = 6;
-        }
-    }
-
-    return 0;
-}
-
-
-/**
- * Finalize encoding and free any memory allocated by the encoder.
- *
- * @param avctx  Codec context
- */
-av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
-{
-    int blk, ch;
-    AC3EncodeContext *s = avctx->priv_data;
-
-    av_freep(&s->windowed_samples);
-    for (ch = 0; ch < s->channels; ch++)
-        av_freep(&s->planar_samples[ch]);
-    av_freep(&s->planar_samples);
-    av_freep(&s->bap_buffer);
-    av_freep(&s->bap1_buffer);
-    av_freep(&s->mdct_coef_buffer);
-    av_freep(&s->fixed_coef_buffer);
-    av_freep(&s->exp_buffer);
-    av_freep(&s->grouped_exp_buffer);
-    av_freep(&s->psd_buffer);
-    av_freep(&s->band_psd_buffer);
-    av_freep(&s->mask_buffer);
-    av_freep(&s->qmant_buffer);
-    av_freep(&s->cpl_coord_exp_buffer);
-    av_freep(&s->cpl_coord_mant_buffer);
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        av_freep(&block->mdct_coef);
-        av_freep(&block->fixed_coef);
-        av_freep(&block->exp);
-        av_freep(&block->grouped_exp);
-        av_freep(&block->psd);
-        av_freep(&block->band_psd);
-        av_freep(&block->mask);
-        av_freep(&block->qmant);
-        av_freep(&block->cpl_coord_exp);
-        av_freep(&block->cpl_coord_mant);
-    }
-
-    s->mdct_end(s);
-
-    return 0;
-}
-
-
-/*
- * Set channel information during initialization.
- */
-static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
-                                    uint64_t *channel_layout)
-{
-    int ch_layout;
-
-    if (channels < 1 || channels > AC3_MAX_CHANNELS)
-        return AVERROR(EINVAL);
-    if (*channel_layout > 0x7FF)
-        return AVERROR(EINVAL);
-    ch_layout = *channel_layout;
-    if (!ch_layout)
-        ch_layout = av_get_default_channel_layout(channels);
-
-    s->lfe_on       = !!(ch_layout & AV_CH_LOW_FREQUENCY);
-    s->channels     = channels;
-    s->fbw_channels = channels - s->lfe_on;
-    s->lfe_channel  = s->lfe_on ? s->fbw_channels + 1 : -1;
-    if (s->lfe_on)
-        ch_layout -= AV_CH_LOW_FREQUENCY;
-
-    switch (ch_layout) {
-    case AV_CH_LAYOUT_MONO:           s->channel_mode = AC3_CHMODE_MONO;   break;
-    case AV_CH_LAYOUT_STEREO:         s->channel_mode = AC3_CHMODE_STEREO; break;
-    case AV_CH_LAYOUT_SURROUND:       s->channel_mode = AC3_CHMODE_3F;     break;
-    case AV_CH_LAYOUT_2_1:            s->channel_mode = AC3_CHMODE_2F1R;   break;
-    case AV_CH_LAYOUT_4POINT0:        s->channel_mode = AC3_CHMODE_3F1R;   break;
-    case AV_CH_LAYOUT_QUAD:
-    case AV_CH_LAYOUT_2_2:            s->channel_mode = AC3_CHMODE_2F2R;   break;
-    case AV_CH_LAYOUT_5POINT0:
-    case AV_CH_LAYOUT_5POINT0_BACK:   s->channel_mode = AC3_CHMODE_3F2R;   break;
-    default:
-        return AVERROR(EINVAL);
-    }
-    s->has_center   = (s->channel_mode & 0x01) && s->channel_mode != AC3_CHMODE_MONO;
-    s->has_surround =  s->channel_mode & 0x04;
-
-    s->channel_map  = ff_ac3_enc_channel_map[s->channel_mode][s->lfe_on];
-    *channel_layout = ch_layout;
-    if (s->lfe_on)
-        *channel_layout |= AV_CH_LOW_FREQUENCY;
-
-    return 0;
-}
-
-
-static av_cold int validate_options(AC3EncodeContext *s)
-{
-    AVCodecContext *avctx = s->avctx;
-    int i, ret, max_sr;
-
-    /* validate channel layout */
-    if (!avctx->channel_layout) {
-        av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The "
-                                      "encoder will guess the layout, but it "
-                                      "might be incorrect.\n");
-    }
-    ret = set_channel_info(s, avctx->channels, &avctx->channel_layout);
-    if (ret) {
-        av_log(avctx, AV_LOG_ERROR, "invalid channel layout\n");
-        return ret;
-    }
-
-    /* validate sample rate */
-    /* note: max_sr could be changed from 2 to 5 for E-AC-3 once we find a
-             decoder that supports half sample rate so we can validate that
-             the generated files are correct. */
-    max_sr = s->eac3 ? 2 : 8;
-    for (i = 0; i <= max_sr; i++) {
-        if ((ff_ac3_sample_rate_tab[i % 3] >> (i / 3)) == avctx->sample_rate)
-            break;
-    }
-    if (i > max_sr) {
-        av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
-        return AVERROR(EINVAL);
-    }
-    s->sample_rate        = avctx->sample_rate;
-    s->bit_alloc.sr_shift = i / 3;
-    s->bit_alloc.sr_code  = i % 3;
-    s->bitstream_id       = s->eac3 ? 16 : 8 + s->bit_alloc.sr_shift;
-
-    /* select a default bit rate if not set by the user */
-    if (!avctx->bit_rate) {
-        switch (s->fbw_channels) {
-        case 1: avctx->bit_rate =  96000; break;
-        case 2: avctx->bit_rate = 192000; break;
-        case 3: avctx->bit_rate = 320000; break;
-        case 4: avctx->bit_rate = 384000; break;
-        case 5: avctx->bit_rate = 448000; break;
-        }
-    }
-
-    /* validate bit rate */
-    if (s->eac3) {
-        int max_br, min_br, wpf, min_br_dist, min_br_code;
-        int num_blks_code, num_blocks, frame_samples;
-
-        /* calculate min/max bitrate */
-        /* TODO: More testing with 3 and 2 blocks. All E-AC-3 samples I've
-                 found use either 6 blocks or 1 block, even though 2 or 3 blocks
-                 would work as far as the bit rate is concerned. */
-        for (num_blks_code = 3; num_blks_code >= 0; num_blks_code--) {
-            num_blocks = ((int[]){ 1, 2, 3, 6 })[num_blks_code];
-            frame_samples  = AC3_BLOCK_SIZE * num_blocks;
-            max_br = 2048 * s->sample_rate / frame_samples * 16;
-            min_br = ((s->sample_rate + (frame_samples-1)) / frame_samples) * 16;
-            if (avctx->bit_rate <= max_br)
-                break;
-        }
-        if (avctx->bit_rate < min_br || avctx->bit_rate > max_br) {
-            av_log(avctx, AV_LOG_ERROR, "invalid bit rate. must be %d to %d "
-                   "for this sample rate\n", min_br, max_br);
-            return AVERROR(EINVAL);
-        }
-        s->num_blks_code = num_blks_code;
-        s->num_blocks    = num_blocks;
-
-        /* calculate words-per-frame for the selected bitrate */
-        wpf = (avctx->bit_rate / 16) * frame_samples / s->sample_rate;
-        av_assert1(wpf > 0 && wpf <= 2048);
-
-        /* find the closest AC-3 bitrate code to the selected bitrate.
-           this is needed for lookup tables for bandwidth and coupling
-           parameter selection */
-        min_br_code = -1;
-        min_br_dist = INT_MAX;
-        for (i = 0; i < 19; i++) {
-            int br_dist = abs(ff_ac3_bitrate_tab[i] * 1000 - avctx->bit_rate);
-            if (br_dist < min_br_dist) {
-                min_br_dist = br_dist;
-                min_br_code = i;
-            }
-        }
-
-        /* make sure the minimum frame size is below the average frame size */
-        s->frame_size_code = min_br_code << 1;
-        while (wpf > 1 && wpf * s->sample_rate / AC3_FRAME_SIZE * 16 > avctx->bit_rate)
-            wpf--;
-        s->frame_size_min = 2 * wpf;
-    } else {
-        int best_br = 0, best_code = 0, best_diff = INT_MAX;
-        for (i = 0; i < 19; i++) {
-            int br   = (ff_ac3_bitrate_tab[i] >> s->bit_alloc.sr_shift) * 1000;
-            int diff = abs(br - avctx->bit_rate);
-            if (diff < best_diff) {
-                best_br   = br;
-                best_code = i;
-                best_diff = diff;
-            }
-            if (!best_diff)
-                break;
-        }
-        avctx->bit_rate    = best_br;
-        s->frame_size_code = best_code << 1;
-        s->frame_size_min  = 2 * ff_ac3_frame_size_tab[s->frame_size_code][s->bit_alloc.sr_code];
-        s->num_blks_code   = 0x3;
-        s->num_blocks      = 6;
-    }
-    s->bit_rate   = avctx->bit_rate;
-    s->frame_size = s->frame_size_min;
-
-    /* validate cutoff */
-    if (avctx->cutoff < 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid cutoff frequency\n");
-        return AVERROR(EINVAL);
-    }
-    s->cutoff = avctx->cutoff;
-    if (s->cutoff > (s->sample_rate >> 1))
-        s->cutoff = s->sample_rate >> 1;
-
-    ret = ff_ac3_validate_metadata(s);
-    if (ret)
-        return ret;
-
-    s->rematrixing_enabled = s->options.stereo_rematrixing &&
-                             (s->channel_mode == AC3_CHMODE_STEREO);
-
-    s->cpl_enabled = s->options.channel_coupling &&
-                     s->channel_mode >= AC3_CHMODE_STEREO;
-
-    return 0;
-}
-
-
-/*
- * Set bandwidth for all channels.
- * The user can optionally supply a cutoff frequency. Otherwise an appropriate
- * default value will be used.
- */
-static av_cold void set_bandwidth(AC3EncodeContext *s)
-{
-    int blk, ch, cpl_start;
-
-    if (s->cutoff) {
-        /* calculate bandwidth based on user-specified cutoff frequency */
-        int fbw_coeffs;
-        fbw_coeffs     = s->cutoff * 2 * AC3_MAX_COEFS / s->sample_rate;
-        s->bandwidth_code = av_clip((fbw_coeffs - 73) / 3, 0, 60);
-    } else {
-        /* use default bandwidth setting */
-        s->bandwidth_code = ac3_bandwidth_tab[s->fbw_channels-1][s->bit_alloc.sr_code][s->frame_size_code/2];
-    }
-
-    /* set number of coefficients for each channel */
-    for (ch = 1; ch <= s->fbw_channels; ch++) {
-        s->start_freq[ch] = 0;
-        for (blk = 0; blk < s->num_blocks; blk++)
-            s->blocks[blk].end_freq[ch] = s->bandwidth_code * 3 + 73;
-    }
-    /* LFE channel always has 7 coefs */
-    if (s->lfe_on) {
-        s->start_freq[s->lfe_channel] = 0;
-        for (blk = 0; blk < s->num_blocks; blk++)
-            s->blocks[blk].end_freq[ch] = 7;
-    }
-
-    /* initialize coupling strategy */
-    if (s->cpl_enabled) {
-        if (s->options.cpl_start != AC3ENC_OPT_AUTO) {
-            cpl_start = s->options.cpl_start;
-        } else {
-            cpl_start = ac3_coupling_start_tab[s->channel_mode-2][s->bit_alloc.sr_code][s->frame_size_code/2];
-            if (cpl_start < 0) {
-                if (s->options.channel_coupling == AC3ENC_OPT_AUTO)
-                    s->cpl_enabled = 0;
-                else
-                    cpl_start = 15;
-            }
-        }
-    }
-    if (s->cpl_enabled) {
-        int i, cpl_start_band, cpl_end_band;
-        uint8_t *cpl_band_sizes = s->cpl_band_sizes;
-
-        cpl_end_band   = s->bandwidth_code / 4 + 3;
-        cpl_start_band = av_clip(cpl_start, 0, FFMIN(cpl_end_band-1, 15));
-
-        s->num_cpl_subbands = cpl_end_band - cpl_start_band;
-
-        s->num_cpl_bands = 1;
-        *cpl_band_sizes  = 12;
-        for (i = cpl_start_band + 1; i < cpl_end_band; i++) {
-            if (ff_eac3_default_cpl_band_struct[i]) {
-                *cpl_band_sizes += 12;
-            } else {
-                s->num_cpl_bands++;
-                cpl_band_sizes++;
-                *cpl_band_sizes = 12;
-            }
-        }
-
-        s->start_freq[CPL_CH] = cpl_start_band * 12 + 37;
-        s->cpl_end_freq       = cpl_end_band   * 12 + 37;
-        for (blk = 0; blk < s->num_blocks; blk++)
-            s->blocks[blk].end_freq[CPL_CH] = s->cpl_end_freq;
-    }
-}
-
-
-static av_cold int allocate_buffers(AC3EncodeContext *s)
-{
-    AVCodecContext *avctx = s->avctx;
-    int blk, ch;
-    int channels = s->channels + 1; /* includes coupling channel */
-    int channel_blocks = channels * s->num_blocks;
-    int total_coefs    = AC3_MAX_COEFS * channel_blocks;
-
-    if (s->allocate_sample_buffers(s))
-        goto alloc_fail;
-
-    FF_ALLOC_OR_GOTO(avctx, s->bap_buffer, total_coefs *
-                     sizeof(*s->bap_buffer), alloc_fail);
-    FF_ALLOC_OR_GOTO(avctx, s->bap1_buffer, total_coefs *
-                     sizeof(*s->bap1_buffer), alloc_fail);
-    FF_ALLOCZ_OR_GOTO(avctx, s->mdct_coef_buffer, total_coefs *
-                      sizeof(*s->mdct_coef_buffer), alloc_fail);
-    FF_ALLOC_OR_GOTO(avctx, s->exp_buffer, total_coefs *
-                     sizeof(*s->exp_buffer), alloc_fail);
-    FF_ALLOC_OR_GOTO(avctx, s->grouped_exp_buffer, channel_blocks * 128 *
-                     sizeof(*s->grouped_exp_buffer), alloc_fail);
-    FF_ALLOC_OR_GOTO(avctx, s->psd_buffer, total_coefs *
-                     sizeof(*s->psd_buffer), alloc_fail);
-    FF_ALLOC_OR_GOTO(avctx, s->band_psd_buffer, channel_blocks * 64 *
-                     sizeof(*s->band_psd_buffer), alloc_fail);
-    FF_ALLOC_OR_GOTO(avctx, s->mask_buffer, channel_blocks * 64 *
-                     sizeof(*s->mask_buffer), alloc_fail);
-    FF_ALLOC_OR_GOTO(avctx, s->qmant_buffer, total_coefs *
-                     sizeof(*s->qmant_buffer), alloc_fail);
-    if (s->cpl_enabled) {
-        FF_ALLOC_OR_GOTO(avctx, s->cpl_coord_exp_buffer, channel_blocks * 16 *
-                         sizeof(*s->cpl_coord_exp_buffer), alloc_fail);
-        FF_ALLOC_OR_GOTO(avctx, s->cpl_coord_mant_buffer, channel_blocks * 16 *
-                         sizeof(*s->cpl_coord_mant_buffer), alloc_fail);
-    }
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        FF_ALLOCZ_OR_GOTO(avctx, block->mdct_coef, channels * sizeof(*block->mdct_coef),
-                          alloc_fail);
-        FF_ALLOCZ_OR_GOTO(avctx, block->exp, channels * sizeof(*block->exp),
-                          alloc_fail);
-        FF_ALLOCZ_OR_GOTO(avctx, block->grouped_exp, channels * sizeof(*block->grouped_exp),
-                          alloc_fail);
-        FF_ALLOCZ_OR_GOTO(avctx, block->psd, channels * sizeof(*block->psd),
-                          alloc_fail);
-        FF_ALLOCZ_OR_GOTO(avctx, block->band_psd, channels * sizeof(*block->band_psd),
-                          alloc_fail);
-        FF_ALLOCZ_OR_GOTO(avctx, block->mask, channels * sizeof(*block->mask),
-                          alloc_fail);
-        FF_ALLOCZ_OR_GOTO(avctx, block->qmant, channels * sizeof(*block->qmant),
-                          alloc_fail);
-        if (s->cpl_enabled) {
-            FF_ALLOCZ_OR_GOTO(avctx, block->cpl_coord_exp, channels * sizeof(*block->cpl_coord_exp),
-                              alloc_fail);
-            FF_ALLOCZ_OR_GOTO(avctx, block->cpl_coord_mant, channels * sizeof(*block->cpl_coord_mant),
-                              alloc_fail);
-        }
-
-        for (ch = 0; ch < channels; ch++) {
-            /* arrangement: block, channel, coeff */
-            block->grouped_exp[ch] = &s->grouped_exp_buffer[128           * (blk * channels + ch)];
-            block->psd[ch]         = &s->psd_buffer        [AC3_MAX_COEFS * (blk * channels + ch)];
-            block->band_psd[ch]    = &s->band_psd_buffer   [64            * (blk * channels + ch)];
-            block->mask[ch]        = &s->mask_buffer       [64            * (blk * channels + ch)];
-            block->qmant[ch]       = &s->qmant_buffer      [AC3_MAX_COEFS * (blk * channels + ch)];
-            if (s->cpl_enabled) {
-                block->cpl_coord_exp[ch]  = &s->cpl_coord_exp_buffer [16  * (blk * channels + ch)];
-                block->cpl_coord_mant[ch] = &s->cpl_coord_mant_buffer[16  * (blk * channels + ch)];
-            }
-
-            /* arrangement: channel, block, coeff */
-            block->exp[ch]         = &s->exp_buffer        [AC3_MAX_COEFS * (s->num_blocks * ch + blk)];
-            block->mdct_coef[ch]   = &s->mdct_coef_buffer  [AC3_MAX_COEFS * (s->num_blocks * ch + blk)];
-        }
-    }
-
-    if (!s->fixed_point) {
-        FF_ALLOCZ_OR_GOTO(avctx, s->fixed_coef_buffer, total_coefs *
-                          sizeof(*s->fixed_coef_buffer), alloc_fail);
-        for (blk = 0; blk < s->num_blocks; blk++) {
-            AC3Block *block = &s->blocks[blk];
-            FF_ALLOCZ_OR_GOTO(avctx, block->fixed_coef, channels *
-                              sizeof(*block->fixed_coef), alloc_fail);
-            for (ch = 0; ch < channels; ch++)
-                block->fixed_coef[ch] = &s->fixed_coef_buffer[AC3_MAX_COEFS * (s->num_blocks * ch + blk)];
-        }
-    } else {
-        for (blk = 0; blk < s->num_blocks; blk++) {
-            AC3Block *block = &s->blocks[blk];
-            FF_ALLOCZ_OR_GOTO(avctx, block->fixed_coef, channels *
-                              sizeof(*block->fixed_coef), alloc_fail);
-            for (ch = 0; ch < channels; ch++)
-                block->fixed_coef[ch] = (int32_t *)block->mdct_coef[ch];
-        }
-    }
-
-    return 0;
-alloc_fail:
-    return AVERROR(ENOMEM);
-}
-
-
-av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
-{
-    AC3EncodeContext *s = avctx->priv_data;
-    int ret, frame_size_58;
-
-    s->avctx = avctx;
-
-    s->eac3 = avctx->codec_id == AV_CODEC_ID_EAC3;
-
-    ff_ac3_common_init();
-
-    ret = validate_options(s);
-    if (ret)
-        return ret;
-
-    avctx->frame_size = AC3_BLOCK_SIZE * s->num_blocks;
-    avctx->delay      = AC3_BLOCK_SIZE;
-
-    s->bitstream_mode = avctx->audio_service_type;
-    if (s->bitstream_mode == AV_AUDIO_SERVICE_TYPE_KARAOKE)
-        s->bitstream_mode = 0x7;
-
-    s->bits_written    = 0;
-    s->samples_written = 0;
-
-    /* calculate crc_inv for both possible frame sizes */
-    frame_size_58 = (( s->frame_size    >> 2) + ( s->frame_size    >> 4)) << 1;
-    s->crc_inv[0] = pow_poly((CRC16_POLY >> 1), (8 * frame_size_58) - 16, CRC16_POLY);
-    if (s->bit_alloc.sr_code == 1) {
-        frame_size_58 = (((s->frame_size+2) >> 2) + ((s->frame_size+2) >> 4)) << 1;
-        s->crc_inv[1] = pow_poly((CRC16_POLY >> 1), (8 * frame_size_58) - 16, CRC16_POLY);
-    }
-
-    /* set function pointers */
-    if (CONFIG_AC3_FIXED_ENCODER && s->fixed_point) {
-        s->mdct_end                     = ff_ac3_fixed_mdct_end;
-        s->mdct_init                    = ff_ac3_fixed_mdct_init;
-        s->allocate_sample_buffers      = ff_ac3_fixed_allocate_sample_buffers;
-    } else if (CONFIG_AC3_ENCODER || CONFIG_EAC3_ENCODER) {
-        s->mdct_end                     = ff_ac3_float_mdct_end;
-        s->mdct_init                    = ff_ac3_float_mdct_init;
-        s->allocate_sample_buffers      = ff_ac3_float_allocate_sample_buffers;
-    }
-    if (CONFIG_EAC3_ENCODER && s->eac3)
-        s->output_frame_header = ff_eac3_output_frame_header;
-    else
-        s->output_frame_header = ac3_output_frame_header;
-
-    set_bandwidth(s);
-
-    exponent_init(s);
-
-    bit_alloc_init(s);
-
-    ret = s->mdct_init(s);
-    if (ret)
-        goto init_fail;
-
-    ret = allocate_buffers(s);
-    if (ret)
-        goto init_fail;
-
-    ff_dsputil_init(&s->dsp, avctx);
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-    ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    dprint_options(s);
-
-    return 0;
-init_fail:
-    ff_ac3_encode_close(avctx);
-    return ret;
-}
diff --git a/deps/libav/libavcodec/ac3enc.h b/deps/libav/libavcodec/ac3enc.h
deleted file mode 100644
index be9dcf2..0000000
--- a/deps/libav/libavcodec/ac3enc.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * AC-3 encoder & E-AC-3 encoder common header
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2010 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AC-3 encoder & E-AC-3 encoder common header
- */
-
-#ifndef AVCODEC_AC3ENC_H
-#define AVCODEC_AC3ENC_H
-
-#include <stdint.h>
-
-#include "libavutil/float_dsp.h"
-#include "ac3.h"
-#include "ac3dsp.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "put_bits.h"
-#include "fft.h"
-
-#ifndef CONFIG_AC3ENC_FLOAT
-#define CONFIG_AC3ENC_FLOAT 0
-#endif
-
-#define OFFSET(param) offsetof(AC3EncodeContext, options.param)
-#define AC3ENC_PARAM (AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
-
-#define AC3ENC_TYPE_AC3_FIXED   0
-#define AC3ENC_TYPE_AC3         1
-#define AC3ENC_TYPE_EAC3        2
-
-#if CONFIG_AC3ENC_FLOAT
-#define AC3_NAME(x) ff_ac3_float_ ## x
-#define MAC_COEF(d,a,b) ((d)+=(a)*(b))
-#define COEF_MIN (-16777215.0/16777216.0)
-#define COEF_MAX ( 16777215.0/16777216.0)
-#define NEW_CPL_COORD_THRESHOLD 0.03
-typedef float SampleType;
-typedef float CoefType;
-typedef float CoefSumType;
-#else
-#define AC3_NAME(x) ff_ac3_fixed_ ## x
-#define MAC_COEF(d,a,b) MAC64(d,a,b)
-#define COEF_MIN -16777215
-#define COEF_MAX  16777215
-#define NEW_CPL_COORD_THRESHOLD 503317
-typedef int16_t SampleType;
-typedef int32_t CoefType;
-typedef int64_t CoefSumType;
-#endif
-
-/* common option values */
-#define AC3ENC_OPT_NONE            -1
-#define AC3ENC_OPT_AUTO            -1
-#define AC3ENC_OPT_OFF              0
-#define AC3ENC_OPT_ON               1
-#define AC3ENC_OPT_NOT_INDICATED    0
-#define AC3ENC_OPT_MODE_ON          2
-#define AC3ENC_OPT_MODE_OFF         1
-
-/* specific option values */
-#define AC3ENC_OPT_LARGE_ROOM       1
-#define AC3ENC_OPT_SMALL_ROOM       2
-#define AC3ENC_OPT_DOWNMIX_LTRT     1
-#define AC3ENC_OPT_DOWNMIX_LORO     2
-#define AC3ENC_OPT_ADCONV_STANDARD  0
-#define AC3ENC_OPT_ADCONV_HDCD      1
-
-
-/**
- * Encoding Options used by AVOption.
- */
-typedef struct AC3EncOptions {
-    /* AC-3 metadata options*/
-    int dialogue_level;
-    int bitstream_mode;
-    float center_mix_level;
-    float surround_mix_level;
-    int dolby_surround_mode;
-    int audio_production_info;
-    int mixing_level;
-    int room_type;
-    int copyright;
-    int original;
-    int extended_bsi_1;
-    int preferred_stereo_downmix;
-    float ltrt_center_mix_level;
-    float ltrt_surround_mix_level;
-    float loro_center_mix_level;
-    float loro_surround_mix_level;
-    int extended_bsi_2;
-    int dolby_surround_ex_mode;
-    int dolby_headphone_mode;
-    int ad_converter_type;
-    int eac3_mixing_metadata;
-    int eac3_info_metadata;
-
-    /* other encoding options */
-    int allow_per_frame_metadata;
-    int stereo_rematrixing;
-    int channel_coupling;
-    int cpl_start;
-} AC3EncOptions;
-
-/**
- * Data for a single audio block.
- */
-typedef struct AC3Block {
-    CoefType **mdct_coef;                       ///< MDCT coefficients
-    int32_t  **fixed_coef;                      ///< fixed-point MDCT coefficients
-    uint8_t  **exp;                             ///< original exponents
-    uint8_t  **grouped_exp;                     ///< grouped exponents
-    int16_t  **psd;                             ///< psd per frequency bin
-    int16_t  **band_psd;                        ///< psd per critical band
-    int16_t  **mask;                            ///< masking curve
-    uint16_t **qmant;                           ///< quantized mantissas
-    uint8_t  **cpl_coord_exp;                   ///< coupling coord exponents           (cplcoexp)
-    uint8_t  **cpl_coord_mant;                  ///< coupling coord mantissas           (cplcomant)
-    uint8_t  coeff_shift[AC3_MAX_CHANNELS];     ///< fixed-point coefficient shift values
-    uint8_t  new_rematrixing_strategy;          ///< send new rematrixing flags in this block
-    int      num_rematrixing_bands;             ///< number of rematrixing bands
-    uint8_t  rematrixing_flags[4];              ///< rematrixing flags
-    int      new_cpl_strategy;                  ///< send new coupling strategy
-    int      cpl_in_use;                        ///< coupling in use for this block     (cplinu)
-    uint8_t  channel_in_cpl[AC3_MAX_CHANNELS];  ///< channel in coupling                (chincpl)
-    int      num_cpl_channels;                  ///< number of channels in coupling
-    uint8_t  new_cpl_coords[AC3_MAX_CHANNELS];  ///< send new coupling coordinates      (cplcoe)
-    uint8_t  cpl_master_exp[AC3_MAX_CHANNELS];  ///< coupling coord master exponents    (mstrcplco)
-    int      new_snr_offsets;                   ///< send new SNR offsets
-    int      new_cpl_leak;                      ///< send new coupling leak info
-    int      end_freq[AC3_MAX_CHANNELS];        ///< end frequency bin                  (endmant)
-} AC3Block;
-
-/**
- * AC-3 encoder private context.
- */
-typedef struct AC3EncodeContext {
-    AVClass *av_class;                      ///< AVClass used for AVOption
-    AC3EncOptions options;                  ///< encoding options
-    AVCodecContext *avctx;                  ///< parent AVCodecContext
-    PutBitContext pb;                       ///< bitstream writer context
-    DSPContext dsp;
-    AVFloatDSPContext fdsp;
-    AC3DSPContext ac3dsp;                   ///< AC-3 optimized functions
-    FFTContext mdct;                        ///< FFT context for MDCT calculation
-    const SampleType *mdct_window;          ///< MDCT window function array
-
-    AC3Block blocks[AC3_MAX_BLOCKS];        ///< per-block info
-
-    int fixed_point;                        ///< indicates if fixed-point encoder is being used
-    int eac3;                               ///< indicates if this is E-AC-3 vs. AC-3
-    int bitstream_id;                       ///< bitstream id                           (bsid)
-    int bitstream_mode;                     ///< bitstream mode                         (bsmod)
-
-    int bit_rate;                           ///< target bit rate, in bits-per-second
-    int sample_rate;                        ///< sampling frequency, in Hz
-
-    int num_blks_code;                      ///< number of blocks code                  (numblkscod)
-    int num_blocks;                         ///< number of blocks per frame
-    int frame_size_min;                     ///< minimum frame size in case rounding is necessary
-    int frame_size;                         ///< current frame size in bytes
-    int frame_size_code;                    ///< frame size code                        (frmsizecod)
-    uint16_t crc_inv[2];
-    int64_t bits_written;                   ///< bit count    (used to avg. bitrate)
-    int64_t samples_written;                ///< sample count (used to avg. bitrate)
-
-    int fbw_channels;                       ///< number of full-bandwidth channels      (nfchans)
-    int channels;                           ///< total number of channels               (nchans)
-    int lfe_on;                             ///< indicates if there is an LFE channel   (lfeon)
-    int lfe_channel;                        ///< channel index of the LFE channel
-    int has_center;                         ///< indicates if there is a center channel
-    int has_surround;                       ///< indicates if there are one or more surround channels
-    int channel_mode;                       ///< channel mode                           (acmod)
-    const uint8_t *channel_map;             ///< channel map used to reorder channels
-
-    int center_mix_level;                   ///< center mix level code
-    int surround_mix_level;                 ///< surround mix level code
-    int ltrt_center_mix_level;              ///< Lt/Rt center mix level code
-    int ltrt_surround_mix_level;            ///< Lt/Rt surround mix level code
-    int loro_center_mix_level;              ///< Lo/Ro center mix level code
-    int loro_surround_mix_level;            ///< Lo/Ro surround mix level code
-
-    int cutoff;                             ///< user-specified cutoff frequency, in Hz
-    int bandwidth_code;                     ///< bandwidth code (0 to 60)               (chbwcod)
-    int start_freq[AC3_MAX_CHANNELS];       ///< start frequency bin                    (strtmant)
-    int cpl_end_freq;                       ///< coupling channel end frequency bin
-
-    int cpl_on;                             ///< coupling turned on for this frame
-    int cpl_enabled;                        ///< coupling enabled for all frames
-    int num_cpl_subbands;                   ///< number of coupling subbands            (ncplsubnd)
-    int num_cpl_bands;                      ///< number of coupling bands               (ncplbnd)
-    uint8_t cpl_band_sizes[AC3_MAX_CPL_BANDS];  ///< number of coeffs in each coupling band
-
-    int rematrixing_enabled;                ///< stereo rematrixing enabled
-
-    /* bitrate allocation control */
-    int slow_gain_code;                     ///< slow gain code                         (sgaincod)
-    int slow_decay_code;                    ///< slow decay code                        (sdcycod)
-    int fast_decay_code;                    ///< fast decay code                        (fdcycod)
-    int db_per_bit_code;                    ///< dB/bit code                            (dbpbcod)
-    int floor_code;                         ///< floor code                             (floorcod)
-    AC3BitAllocParameters bit_alloc;        ///< bit allocation parameters
-    int coarse_snr_offset;                  ///< coarse SNR offsets                     (csnroffst)
-    int fast_gain_code[AC3_MAX_CHANNELS];   ///< fast gain codes (signal-to-mask ratio) (fgaincod)
-    int fine_snr_offset[AC3_MAX_CHANNELS];  ///< fine SNR offsets                       (fsnroffst)
-    int frame_bits_fixed;                   ///< number of non-coefficient bits for fixed parameters
-    int frame_bits;                         ///< all frame bits except exponents and mantissas
-    int exponent_bits;                      ///< number of bits used for exponents
-
-    SampleType *windowed_samples;
-    SampleType **planar_samples;
-    uint8_t *bap_buffer;
-    uint8_t *bap1_buffer;
-    CoefType *mdct_coef_buffer;
-    int32_t *fixed_coef_buffer;
-    uint8_t *exp_buffer;
-    uint8_t *grouped_exp_buffer;
-    int16_t *psd_buffer;
-    int16_t *band_psd_buffer;
-    int16_t *mask_buffer;
-    int16_t *qmant_buffer;
-    uint8_t *cpl_coord_exp_buffer;
-    uint8_t *cpl_coord_mant_buffer;
-
-    uint8_t exp_strategy[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< exponent strategies
-    uint8_t frame_exp_strategy[AC3_MAX_CHANNELS];           ///< frame exp strategy index
-    int use_frame_exp_strategy;                             ///< indicates use of frame exp strategy
-    uint8_t exp_ref_block[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< reference blocks for EXP_REUSE
-    uint8_t *ref_bap     [AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< bit allocation pointers (bap)
-    int ref_bap_set;                                         ///< indicates if ref_bap pointers have been set
-
-    /* fixed vs. float function pointers */
-    void (*mdct_end)(struct AC3EncodeContext *s);
-    int  (*mdct_init)(struct AC3EncodeContext *s);
-
-    /* fixed vs. float templated function pointers */
-    int  (*allocate_sample_buffers)(struct AC3EncodeContext *s);
-
-    /* AC-3 vs. E-AC-3 function pointers */
-    void (*output_frame_header)(struct AC3EncodeContext *s);
-} AC3EncodeContext;
-
-
-extern const uint64_t ff_ac3_channel_layouts[19];
-
-int ff_ac3_encode_init(AVCodecContext *avctx);
-
-int ff_ac3_encode_close(AVCodecContext *avctx);
-
-int ff_ac3_validate_metadata(AC3EncodeContext *s);
-
-void ff_ac3_adjust_frame_size(AC3EncodeContext *s);
-
-void ff_ac3_compute_coupling_strategy(AC3EncodeContext *s);
-
-void ff_ac3_apply_rematrixing(AC3EncodeContext *s);
-
-void ff_ac3_process_exponents(AC3EncodeContext *s);
-
-int ff_ac3_compute_bit_allocation(AC3EncodeContext *s);
-
-void ff_ac3_group_exponents(AC3EncodeContext *s);
-
-void ff_ac3_quantize_mantissas(AC3EncodeContext *s);
-
-void ff_ac3_output_frame(AC3EncodeContext *s, unsigned char *frame);
-
-
-/* prototypes for functions in ac3enc_fixed.c and ac3enc_float.c */
-
-void ff_ac3_fixed_mdct_end(AC3EncodeContext *s);
-void ff_ac3_float_mdct_end(AC3EncodeContext *s);
-
-int ff_ac3_fixed_mdct_init(AC3EncodeContext *s);
-int ff_ac3_float_mdct_init(AC3EncodeContext *s);
-
-
-/* prototypes for functions in ac3enc_template.c */
-
-int ff_ac3_fixed_allocate_sample_buffers(AC3EncodeContext *s);
-int ff_ac3_float_allocate_sample_buffers(AC3EncodeContext *s);
-
-int ff_ac3_fixed_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                              const AVFrame *frame, int *got_packet_ptr);
-int ff_ac3_float_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                              const AVFrame *frame, int *got_packet_ptr);
-
-#endif /* AVCODEC_AC3ENC_H */
diff --git a/deps/libav/libavcodec/ac3enc_fixed.c b/deps/libav/libavcodec/ac3enc_fixed.c
deleted file mode 100644
index f76d2ad..0000000
--- a/deps/libav/libavcodec/ac3enc_fixed.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * The simplest AC-3 encoder
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2010 Justin Ruggles <justin.ruggles at gmail.com>
- * Copyright (c) 2006-2010 Prakash Punnoor <prakash at punnoor.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * fixed-point AC-3 encoder.
- */
-
-#define FFT_FLOAT 0
-#undef CONFIG_AC3ENC_FLOAT
-#include "internal.h"
-#include "ac3enc.h"
-#include "eac3enc.h"
-
-#define AC3ENC_TYPE AC3ENC_TYPE_AC3_FIXED
-#include "ac3enc_opts_template.c"
-static const AVClass ac3enc_class = { "Fixed-Point AC-3 Encoder", av_default_item_name,
-                                      ac3_options, LIBAVUTIL_VERSION_INT };
-
-#include "ac3enc_template.c"
-
-
-/**
- * Finalize MDCT and free allocated memory.
- *
- * @param s  AC-3 encoder private context
- */
-av_cold void AC3_NAME(mdct_end)(AC3EncodeContext *s)
-{
-    ff_mdct_end(&s->mdct);
-}
-
-
-/**
- * Initialize MDCT tables.
- *
- * @param s  AC-3 encoder private context
- * @return   0 on success, negative error code on failure
- */
-av_cold int AC3_NAME(mdct_init)(AC3EncodeContext *s)
-{
-    int ret = ff_mdct_init(&s->mdct, 9, 0, -1.0);
-    s->mdct_window = ff_ac3_window;
-    return ret;
-}
-
-
-/*
- * Normalize the input samples to use the maximum available precision.
- * This assumes signed 16-bit input samples.
- */
-static int normalize_samples(AC3EncodeContext *s)
-{
-    int v = s->ac3dsp.ac3_max_msb_abs_int16(s->windowed_samples, AC3_WINDOW_SIZE);
-    v = 14 - av_log2(v);
-    if (v > 0)
-        s->ac3dsp.ac3_lshift_int16(s->windowed_samples, AC3_WINDOW_SIZE, v);
-    /* +6 to right-shift from 31-bit to 25-bit */
-    return v + 6;
-}
-
-
-/*
- * Scale MDCT coefficients to 25-bit signed fixed-point.
- */
-static void scale_coefficients(AC3EncodeContext *s)
-{
-    int blk, ch;
-
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        for (ch = 1; ch <= s->channels; ch++) {
-            s->ac3dsp.ac3_rshift_int32(block->mdct_coef[ch], AC3_MAX_COEFS,
-                                       block->coeff_shift[ch]);
-        }
-    }
-}
-
-
-/*
- * Clip MDCT coefficients to allowable range.
- */
-static void clip_coefficients(DSPContext *dsp, int32_t *coef, unsigned int len)
-{
-    dsp->vector_clip_int32(coef, coef, COEF_MIN, COEF_MAX, len);
-}
-
-
-/*
- * Calculate a single coupling coordinate.
- */
-static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
-{
-    if (energy_cpl <= COEF_MAX) {
-        return 1048576;
-    } else {
-        uint64_t coord   = energy_ch / (energy_cpl >> 24);
-        uint32_t coord32 = FFMIN(coord, 1073741824);
-        coord32          = ff_sqrt(coord32) << 9;
-        return FFMIN(coord32, COEF_MAX);
-    }
-}
-
-
-static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx)
-{
-    AC3EncodeContext *s = avctx->priv_data;
-    s->fixed_point = 1;
-    return ff_ac3_encode_init(avctx);
-}
-
-
-AVCodec ff_ac3_fixed_encoder = {
-    .name            = "ac3_fixed",
-    .long_name       = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
-    .type            = AVMEDIA_TYPE_AUDIO,
-    .id              = AV_CODEC_ID_AC3,
-    .priv_data_size  = sizeof(AC3EncodeContext),
-    .init            = ac3_fixed_encode_init,
-    .encode2         = ff_ac3_fixed_encode_frame,
-    .close           = ff_ac3_encode_close,
-    .sample_fmts     = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_NONE },
-    .priv_class      = &ac3enc_class,
-    .channel_layouts = ff_ac3_channel_layouts,
-    .defaults        = ac3_defaults,
-};
diff --git a/deps/libav/libavcodec/ac3enc_float.c b/deps/libav/libavcodec/ac3enc_float.c
deleted file mode 100644
index 71db68c..0000000
--- a/deps/libav/libavcodec/ac3enc_float.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * The simplest AC-3 encoder
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2010 Justin Ruggles <justin.ruggles at gmail.com>
- * Copyright (c) 2006-2010 Prakash Punnoor <prakash at punnoor.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * floating-point AC-3 encoder.
- */
-
-#define CONFIG_AC3ENC_FLOAT 1
-#include "internal.h"
-#include "ac3enc.h"
-#include "eac3enc.h"
-#include "kbdwin.h"
-
-
-#if CONFIG_AC3_ENCODER
-#define AC3ENC_TYPE AC3ENC_TYPE_AC3
-#include "ac3enc_opts_template.c"
-static const AVClass ac3enc_class = { "AC-3 Encoder", av_default_item_name,
-                                      ac3_options, LIBAVUTIL_VERSION_INT };
-#endif
-
-#include "ac3enc_template.c"
-
-
-/**
- * Finalize MDCT and free allocated memory.
- *
- * @param s  AC-3 encoder private context
- */
-av_cold void ff_ac3_float_mdct_end(AC3EncodeContext *s)
-{
-    ff_mdct_end(&s->mdct);
-    av_freep(&s->mdct_window);
-}
-
-
-/**
- * Initialize MDCT tables.
- *
- * @param s  AC-3 encoder private context
- * @return   0 on success, negative error code on failure
- */
-av_cold int ff_ac3_float_mdct_init(AC3EncodeContext *s)
-{
-    float *window;
-    int i, n, n2;
-
-    n  = 1 << 9;
-    n2 = n >> 1;
-
-    window = av_malloc(n * sizeof(*window));
-    if (!window) {
-        av_log(s->avctx, AV_LOG_ERROR, "Cannot allocate memory.\n");
-        return AVERROR(ENOMEM);
-    }
-    ff_kbd_window_init(window, 5.0, n2);
-    for (i = 0; i < n2; i++)
-        window[n-1-i] = window[i];
-    s->mdct_window = window;
-
-    return ff_mdct_init(&s->mdct, 9, 0, -2.0 / n);
-}
-
-
-/*
- * Normalize the input samples.
- * Not needed for the floating-point encoder.
- */
-static int normalize_samples(AC3EncodeContext *s)
-{
-    return 0;
-}
-
-
-/*
- * Scale MDCT coefficients from float to 24-bit fixed-point.
- */
-static void scale_coefficients(AC3EncodeContext *s)
-{
-    int chan_size = AC3_MAX_COEFS * s->num_blocks;
-    int cpl       = s->cpl_on;
-    s->ac3dsp.float_to_fixed24(s->fixed_coef_buffer + (chan_size * !cpl),
-                               s->mdct_coef_buffer  + (chan_size * !cpl),
-                               chan_size * (s->channels + cpl));
-}
-
-
-/*
- * Clip MDCT coefficients to allowable range.
- */
-static void clip_coefficients(DSPContext *dsp, float *coef, unsigned int len)
-{
-    dsp->vector_clipf(coef, coef, COEF_MIN, COEF_MAX, len);
-}
-
-
-/*
- * Calculate a single coupling coordinate.
- */
-static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
-{
-    float coord = 0.125;
-    if (energy_cpl > 0)
-        coord *= sqrtf(energy_ch / energy_cpl);
-    return FFMIN(coord, COEF_MAX);
-}
-
-
-#if CONFIG_AC3_ENCODER
-AVCodec ff_ac3_encoder = {
-    .name            = "ac3",
-    .long_name       = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
-    .type            = AVMEDIA_TYPE_AUDIO,
-    .id              = AV_CODEC_ID_AC3,
-    .priv_data_size  = sizeof(AC3EncodeContext),
-    .init            = ff_ac3_encode_init,
-    .encode2         = ff_ac3_float_encode_frame,
-    .close           = ff_ac3_encode_close,
-    .sample_fmts     = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-    .priv_class      = &ac3enc_class,
-    .channel_layouts = ff_ac3_channel_layouts,
-    .defaults        = ac3_defaults,
-};
-#endif
diff --git a/deps/libav/libavcodec/ac3enc_opts_template.c b/deps/libav/libavcodec/ac3enc_opts_template.c
deleted file mode 100644
index 339a08f..0000000
--- a/deps/libav/libavcodec/ac3enc_opts_template.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * AC-3 encoder options
- * Copyright (c) 2011 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/opt.h"
-#include "internal.h"
-#include "ac3.h"
-
-static const AVOption ac3_options[] = {
-/* Metadata Options */
-{"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, AC3ENC_PARAM},
-#if AC3ENC_TYPE != AC3ENC_TYPE_EAC3
-/* AC-3 downmix levels */
-{"center_mixlev", "Center Mix Level", OFFSET(center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_4POINT5DB }, 0.0, 1.0, AC3ENC_PARAM},
-{"surround_mixlev", "Surround Mix Level", OFFSET(surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_6DB }, 0.0, 1.0, AC3ENC_PARAM},
-#endif
-/* audio production information */
-{"mixing_level", "Mixing Level", OFFSET(mixing_level), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 111, AC3ENC_PARAM},
-{"room_type", "Room Type", OFFSET(room_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_SMALL_ROOM, AC3ENC_PARAM, "room_type"},
-    {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
-    {"large",        "Large Room",              0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_LARGE_ROOM    }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
-    {"small",        "Small Room",              0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_SMALL_ROOM    }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
-/* other metadata options */
-{"copyright", "Copyright Bit", OFFSET(copyright), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM},
-{"dialnorm", "Dialogue Level (dB)", OFFSET(dialogue_level), AV_OPT_TYPE_INT, {.i64 = -31 }, -31, -1, AC3ENC_PARAM},
-{"dsur_mode", "Dolby Surround Mode", OFFSET(dolby_surround_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dsur_mode"},
-    {"notindicated", "Not Indicated (default)",    0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
-    {"on",           "Dolby Surround Encoded",     0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON       }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
-    {"off",          "Not Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF      }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
-{"original", "Original Bit Stream", OFFSET(original), AV_OPT_TYPE_INT,   {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM},
-/* extended bitstream information */
-{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DOWNMIX_LORO, AC3ENC_PARAM, "dmix_mode"},
-    {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
-    {"ltrt", "Lt/Rt Downmix Preferred",         0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LTRT  }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
-    {"loro", "Lo/Ro Downmix Preferred",         0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LORO  }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
-{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
-{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
-{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
-{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
-{"dsurex_mode", "Dolby Surround EX Mode", OFFSET(dolby_surround_ex_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dsurex_mode"},
-    {"notindicated", "Not Indicated (default)",       0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
-    {"on",           "Dolby Surround EX Encoded",     0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON       }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
-    {"off",          "Not Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF      }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
-{"dheadphone_mode", "Dolby Headphone Mode", OFFSET(dolby_headphone_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dheadphone_mode"},
-    {"notindicated", "Not Indicated (default)",     0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
-    {"on",           "Dolby Headphone Encoded",     0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON       }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
-    {"off",          "Not Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF      }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
-{"ad_conv_type", "A/D Converter Type", OFFSET(ad_converter_type), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_ADCONV_HDCD, AC3ENC_PARAM, "ad_conv_type"},
-    {"standard", "Standard (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_STANDARD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"},
-    {"hdcd",     "HDCD",               0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_ADCONV_HDCD     }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"},
-/* Other Encoding Options */
-{"stereo_rematrixing", "Stereo Rematrixing", OFFSET(stereo_rematrixing), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_ON }, AC3ENC_OPT_OFF, AC3ENC_OPT_ON, AC3ENC_PARAM},
-{"channel_coupling",   "Channel Coupling",   OFFSET(channel_coupling),   AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, AC3ENC_OPT_ON, AC3ENC_PARAM, "channel_coupling"},
-    {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "channel_coupling"},
-{"cpl_start_band", "Coupling Start Band", OFFSET(cpl_start), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, 15, AC3ENC_PARAM, "cpl_start_band"},
-    {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "cpl_start_band"},
-{NULL}
-};
-
-static const AVCodecDefault ac3_defaults[] = {
-    { "b",  "0" },
-    { NULL }
-};
diff --git a/deps/libav/libavcodec/ac3enc_template.c b/deps/libav/libavcodec/ac3enc_template.c
deleted file mode 100644
index 1b88726..0000000
--- a/deps/libav/libavcodec/ac3enc_template.c
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * AC-3 encoder float/fixed template
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2006-2011 Justin Ruggles <justin.ruggles at gmail.com>
- * Copyright (c) 2006-2010 Prakash Punnoor <prakash at punnoor.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AC-3 encoder float/fixed template
- */
-
-#include <stdint.h>
-
-#include "libavutil/internal.h"
-
-/* prototypes for static functions in ac3enc_fixed.c and ac3enc_float.c */
-
-static void scale_coefficients(AC3EncodeContext *s);
-
-static int normalize_samples(AC3EncodeContext *s);
-
-static void clip_coefficients(DSPContext *dsp, CoefType *coef, unsigned int len);
-
-static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl);
-
-
-int AC3_NAME(allocate_sample_buffers)(AC3EncodeContext *s)
-{
-    int ch;
-
-    FF_ALLOC_OR_GOTO(s->avctx, s->windowed_samples, AC3_WINDOW_SIZE *
-                     sizeof(*s->windowed_samples), alloc_fail);
-    FF_ALLOC_OR_GOTO(s->avctx, s->planar_samples, s->channels * sizeof(*s->planar_samples),
-                     alloc_fail);
-    for (ch = 0; ch < s->channels; ch++) {
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->planar_samples[ch],
-                          (AC3_FRAME_SIZE+AC3_BLOCK_SIZE) * sizeof(**s->planar_samples),
-                          alloc_fail);
-    }
-
-    return 0;
-alloc_fail:
-    return AVERROR(ENOMEM);
-}
-
-
-/*
- * Copy input samples.
- * Channels are reordered from Libav's default order to AC-3 order.
- */
-static void copy_input_samples(AC3EncodeContext *s, SampleType **samples)
-{
-    int ch;
-
-    /* copy and remap input samples */
-    for (ch = 0; ch < s->channels; ch++) {
-        /* copy last 256 samples of previous frame to the start of the current frame */
-        memcpy(&s->planar_samples[ch][0], &s->planar_samples[ch][AC3_BLOCK_SIZE * s->num_blocks],
-               AC3_BLOCK_SIZE * sizeof(s->planar_samples[0][0]));
-
-        /* copy new samples for current frame */
-        memcpy(&s->planar_samples[ch][AC3_BLOCK_SIZE],
-               samples[s->channel_map[ch]],
-               AC3_BLOCK_SIZE * s->num_blocks * sizeof(s->planar_samples[0][0]));
-    }
-}
-
-
-/*
- * Apply the MDCT to input samples to generate frequency coefficients.
- * This applies the KBD window and normalizes the input to reduce precision
- * loss due to fixed-point calculations.
- */
-static void apply_mdct(AC3EncodeContext *s)
-{
-    int blk, ch;
-
-    for (ch = 0; ch < s->channels; ch++) {
-        for (blk = 0; blk < s->num_blocks; blk++) {
-            AC3Block *block = &s->blocks[blk];
-            const SampleType *input_samples = &s->planar_samples[ch][blk * AC3_BLOCK_SIZE];
-
-#if CONFIG_AC3ENC_FLOAT
-            s->fdsp.vector_fmul(s->windowed_samples, input_samples,
-                                s->mdct_window, AC3_WINDOW_SIZE);
-#else
-            s->ac3dsp.apply_window_int16(s->windowed_samples, input_samples,
-                                         s->mdct_window, AC3_WINDOW_SIZE);
-#endif
-
-            if (s->fixed_point)
-                block->coeff_shift[ch+1] = normalize_samples(s);
-
-            s->mdct.mdct_calcw(&s->mdct, block->mdct_coef[ch+1],
-                               s->windowed_samples);
-        }
-    }
-}
-
-
-/*
- * Calculate coupling channel and coupling coordinates.
- */
-static void apply_channel_coupling(AC3EncodeContext *s)
-{
-    LOCAL_ALIGNED_16(CoefType, cpl_coords,      [AC3_MAX_BLOCKS], [AC3_MAX_CHANNELS][16]);
-#if CONFIG_AC3ENC_FLOAT
-    LOCAL_ALIGNED_16(int32_t, fixed_cpl_coords, [AC3_MAX_BLOCKS], [AC3_MAX_CHANNELS][16]);
-#else
-    int32_t (*fixed_cpl_coords)[AC3_MAX_CHANNELS][16] = cpl_coords;
-#endif
-    int blk, ch, bnd, i, j;
-    CoefSumType energy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS][16] = {{{0}}};
-    int cpl_start, num_cpl_coefs;
-
-    memset(cpl_coords,       0, AC3_MAX_BLOCKS * sizeof(*cpl_coords));
-#if CONFIG_AC3ENC_FLOAT
-    memset(fixed_cpl_coords, 0, AC3_MAX_BLOCKS * sizeof(*cpl_coords));
-#endif
-
-    /* align start to 16-byte boundary. align length to multiple of 32.
-        note: coupling start bin % 4 will always be 1 */
-    cpl_start     = s->start_freq[CPL_CH] - 1;
-    num_cpl_coefs = FFALIGN(s->num_cpl_subbands * 12 + 1, 32);
-    cpl_start     = FFMIN(256, cpl_start + num_cpl_coefs) - num_cpl_coefs;
-
-    /* calculate coupling channel from fbw channels */
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        CoefType *cpl_coef = &block->mdct_coef[CPL_CH][cpl_start];
-        if (!block->cpl_in_use)
-            continue;
-        memset(cpl_coef, 0, num_cpl_coefs * sizeof(*cpl_coef));
-        for (ch = 1; ch <= s->fbw_channels; ch++) {
-            CoefType *ch_coef = &block->mdct_coef[ch][cpl_start];
-            if (!block->channel_in_cpl[ch])
-                continue;
-            for (i = 0; i < num_cpl_coefs; i++)
-                cpl_coef[i] += ch_coef[i];
-        }
-
-        /* coefficients must be clipped in order to be encoded */
-        clip_coefficients(&s->dsp, cpl_coef, num_cpl_coefs);
-    }
-
-    /* calculate energy in each band in coupling channel and each fbw channel */
-    /* TODO: possibly use SIMD to speed up energy calculation */
-    bnd = 0;
-    i = s->start_freq[CPL_CH];
-    while (i < s->cpl_end_freq) {
-        int band_size = s->cpl_band_sizes[bnd];
-        for (ch = CPL_CH; ch <= s->fbw_channels; ch++) {
-            for (blk = 0; blk < s->num_blocks; blk++) {
-                AC3Block *block = &s->blocks[blk];
-                if (!block->cpl_in_use || (ch > CPL_CH && !block->channel_in_cpl[ch]))
-                    continue;
-                for (j = 0; j < band_size; j++) {
-                    CoefType v = block->mdct_coef[ch][i+j];
-                    MAC_COEF(energy[blk][ch][bnd], v, v);
-                }
-            }
-        }
-        i += band_size;
-        bnd++;
-    }
-
-    /* calculate coupling coordinates for all blocks for all channels */
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block  = &s->blocks[blk];
-        if (!block->cpl_in_use)
-            continue;
-        for (ch = 1; ch <= s->fbw_channels; ch++) {
-            if (!block->channel_in_cpl[ch])
-                continue;
-            for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
-                cpl_coords[blk][ch][bnd] = calc_cpl_coord(energy[blk][ch][bnd],
-                                                          energy[blk][CPL_CH][bnd]);
-            }
-        }
-    }
-
-    /* determine which blocks to send new coupling coordinates for */
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block  = &s->blocks[blk];
-        AC3Block *block0 = blk ? &s->blocks[blk-1] : NULL;
-
-        memset(block->new_cpl_coords, 0, sizeof(block->new_cpl_coords));
-
-        if (block->cpl_in_use) {
-            /* send new coordinates if this is the first block, if previous
-             * block did not use coupling but this block does, the channels
-             * using coupling has changed from the previous block, or the
-             * coordinate difference from the last block for any channel is
-             * greater than a threshold value. */
-            if (blk == 0 || !block0->cpl_in_use) {
-                for (ch = 1; ch <= s->fbw_channels; ch++)
-                    block->new_cpl_coords[ch] = 1;
-            } else {
-                for (ch = 1; ch <= s->fbw_channels; ch++) {
-                    if (!block->channel_in_cpl[ch])
-                        continue;
-                    if (!block0->channel_in_cpl[ch]) {
-                        block->new_cpl_coords[ch] = 1;
-                    } else {
-                        CoefSumType coord_diff = 0;
-                        for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
-                            coord_diff += FFABS(cpl_coords[blk-1][ch][bnd] -
-                                                cpl_coords[blk  ][ch][bnd]);
-                        }
-                        coord_diff /= s->num_cpl_bands;
-                        if (coord_diff > NEW_CPL_COORD_THRESHOLD)
-                            block->new_cpl_coords[ch] = 1;
-                    }
-                }
-            }
-        }
-    }
-
-    /* calculate final coupling coordinates, taking into account reusing of
-       coordinates in successive blocks */
-    for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
-        blk = 0;
-        while (blk < s->num_blocks) {
-            int av_uninit(blk1);
-            AC3Block *block  = &s->blocks[blk];
-
-            if (!block->cpl_in_use) {
-                blk++;
-                continue;
-            }
-
-            for (ch = 1; ch <= s->fbw_channels; ch++) {
-                CoefSumType energy_ch, energy_cpl;
-                if (!block->channel_in_cpl[ch])
-                    continue;
-                energy_cpl = energy[blk][CPL_CH][bnd];
-                energy_ch = energy[blk][ch][bnd];
-                blk1 = blk+1;
-                while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
-                    if (s->blocks[blk1].cpl_in_use) {
-                        energy_cpl += energy[blk1][CPL_CH][bnd];
-                        energy_ch += energy[blk1][ch][bnd];
-                    }
-                    blk1++;
-                }
-                cpl_coords[blk][ch][bnd] = calc_cpl_coord(energy_ch, energy_cpl);
-            }
-            blk = blk1;
-        }
-    }
-
-    /* calculate exponents/mantissas for coupling coordinates */
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        if (!block->cpl_in_use)
-            continue;
-
-#if CONFIG_AC3ENC_FLOAT
-        s->ac3dsp.float_to_fixed24(fixed_cpl_coords[blk][1],
-                                   cpl_coords[blk][1],
-                                   s->fbw_channels * 16);
-#endif
-        s->ac3dsp.extract_exponents(block->cpl_coord_exp[1],
-                                    fixed_cpl_coords[blk][1],
-                                    s->fbw_channels * 16);
-
-        for (ch = 1; ch <= s->fbw_channels; ch++) {
-            int bnd, min_exp, max_exp, master_exp;
-
-            if (!block->new_cpl_coords[ch])
-                continue;
-
-            /* determine master exponent */
-            min_exp = max_exp = block->cpl_coord_exp[ch][0];
-            for (bnd = 1; bnd < s->num_cpl_bands; bnd++) {
-                int exp = block->cpl_coord_exp[ch][bnd];
-                min_exp = FFMIN(exp, min_exp);
-                max_exp = FFMAX(exp, max_exp);
-            }
-            master_exp = ((max_exp - 15) + 2) / 3;
-            master_exp = FFMAX(master_exp, 0);
-            while (min_exp < master_exp * 3)
-                master_exp--;
-            for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
-                block->cpl_coord_exp[ch][bnd] = av_clip(block->cpl_coord_exp[ch][bnd] -
-                                                        master_exp * 3, 0, 15);
-            }
-            block->cpl_master_exp[ch] = master_exp;
-
-            /* quantize mantissas */
-            for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
-                int cpl_exp  = block->cpl_coord_exp[ch][bnd];
-                int cpl_mant = (fixed_cpl_coords[blk][ch][bnd] << (5 + cpl_exp + master_exp * 3)) >> 24;
-                if (cpl_exp == 15)
-                    cpl_mant >>= 1;
-                else
-                    cpl_mant -= 16;
-
-                block->cpl_coord_mant[ch][bnd] = cpl_mant;
-            }
-        }
-    }
-
-    if (CONFIG_EAC3_ENCODER && s->eac3)
-        ff_eac3_set_cpl_states(s);
-}
-
-
-/*
- * Determine rematrixing flags for each block and band.
- */
-static void compute_rematrixing_strategy(AC3EncodeContext *s)
-{
-    int nb_coefs;
-    int blk, bnd, i;
-    AC3Block *block, *block0;
-
-    if (s->channel_mode != AC3_CHMODE_STEREO)
-        return;
-
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        block = &s->blocks[blk];
-        block->new_rematrixing_strategy = !blk;
-
-        block->num_rematrixing_bands = 4;
-        if (block->cpl_in_use) {
-            block->num_rematrixing_bands -= (s->start_freq[CPL_CH] <= 61);
-            block->num_rematrixing_bands -= (s->start_freq[CPL_CH] == 37);
-            if (blk && block->num_rematrixing_bands != block0->num_rematrixing_bands)
-                block->new_rematrixing_strategy = 1;
-        }
-        nb_coefs = FFMIN(block->end_freq[1], block->end_freq[2]);
-
-        if (!s->rematrixing_enabled) {
-            block0 = block;
-            continue;
-        }
-
-        for (bnd = 0; bnd < block->num_rematrixing_bands; bnd++) {
-            /* calculate calculate sum of squared coeffs for one band in one block */
-            int start = ff_ac3_rematrix_band_tab[bnd];
-            int end   = FFMIN(nb_coefs, ff_ac3_rematrix_band_tab[bnd+1]);
-            CoefSumType sum[4] = {0,};
-            for (i = start; i < end; i++) {
-                CoefType lt = block->mdct_coef[1][i];
-                CoefType rt = block->mdct_coef[2][i];
-                CoefType md = lt + rt;
-                CoefType sd = lt - rt;
-                MAC_COEF(sum[0], lt, lt);
-                MAC_COEF(sum[1], rt, rt);
-                MAC_COEF(sum[2], md, md);
-                MAC_COEF(sum[3], sd, sd);
-            }
-
-            /* compare sums to determine if rematrixing will be used for this band */
-            if (FFMIN(sum[2], sum[3]) < FFMIN(sum[0], sum[1]))
-                block->rematrixing_flags[bnd] = 1;
-            else
-                block->rematrixing_flags[bnd] = 0;
-
-            /* determine if new rematrixing flags will be sent */
-            if (blk &&
-                block->rematrixing_flags[bnd] != block0->rematrixing_flags[bnd]) {
-                block->new_rematrixing_strategy = 1;
-            }
-        }
-        block0 = block;
-    }
-}
-
-
-int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket *avpkt,
-                           const AVFrame *frame, int *got_packet_ptr)
-{
-    AC3EncodeContext *s = avctx->priv_data;
-    int ret;
-
-    if (s->options.allow_per_frame_metadata) {
-        ret = ff_ac3_validate_metadata(s);
-        if (ret)
-            return ret;
-    }
-
-    if (s->bit_alloc.sr_code == 1 || s->eac3)
-        ff_ac3_adjust_frame_size(s);
-
-    copy_input_samples(s, (SampleType **)frame->extended_data);
-
-    apply_mdct(s);
-
-    if (s->fixed_point)
-        scale_coefficients(s);
-
-    clip_coefficients(&s->dsp, s->blocks[0].mdct_coef[1],
-                      AC3_MAX_COEFS * s->num_blocks * s->channels);
-
-    s->cpl_on = s->cpl_enabled;
-    ff_ac3_compute_coupling_strategy(s);
-
-    if (s->cpl_on)
-        apply_channel_coupling(s);
-
-    compute_rematrixing_strategy(s);
-
-    if (!s->fixed_point)
-        scale_coefficients(s);
-
-    ff_ac3_apply_rematrixing(s);
-
-    ff_ac3_process_exponents(s);
-
-    ret = ff_ac3_compute_bit_allocation(s);
-    if (ret) {
-        av_log(avctx, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n");
-        return ret;
-    }
-
-    ff_ac3_group_exponents(s);
-
-    ff_ac3_quantize_mantissas(s);
-
-    if ((ret = ff_alloc_packet(avpkt, s->frame_size))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-    ff_ac3_output_frame(s, avpkt->data);
-
-    if (frame->pts != AV_NOPTS_VALUE)
-        avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
-
-    *got_packet_ptr = 1;
-    return 0;
-}
diff --git a/deps/libav/libavcodec/ac3tab.c b/deps/libav/libavcodec/ac3tab.c
deleted file mode 100644
index ebcfb0b..0000000
--- a/deps/libav/libavcodec/ac3tab.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * AC-3 tables
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * tables taken directly from the AC-3 spec.
- */
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "ac3tab.h"
-
-/**
- * Possible frame sizes.
- * from ATSC A/52 Table 5.18 Frame Size Code Table.
- */
-const uint16_t ff_ac3_frame_size_tab[38][3] = {
-    { 64,   69,   96   },
-    { 64,   70,   96   },
-    { 80,   87,   120  },
-    { 80,   88,   120  },
-    { 96,   104,  144  },
-    { 96,   105,  144  },
-    { 112,  121,  168  },
-    { 112,  122,  168  },
-    { 128,  139,  192  },
-    { 128,  140,  192  },
-    { 160,  174,  240  },
-    { 160,  175,  240  },
-    { 192,  208,  288  },
-    { 192,  209,  288  },
-    { 224,  243,  336  },
-    { 224,  244,  336  },
-    { 256,  278,  384  },
-    { 256,  279,  384  },
-    { 320,  348,  480  },
-    { 320,  349,  480  },
-    { 384,  417,  576  },
-    { 384,  418,  576  },
-    { 448,  487,  672  },
-    { 448,  488,  672  },
-    { 512,  557,  768  },
-    { 512,  558,  768  },
-    { 640,  696,  960  },
-    { 640,  697,  960  },
-    { 768,  835,  1152 },
-    { 768,  836,  1152 },
-    { 896,  975,  1344 },
-    { 896,  976,  1344 },
-    { 1024, 1114, 1536 },
-    { 1024, 1115, 1536 },
-    { 1152, 1253, 1728 },
-    { 1152, 1254, 1728 },
-    { 1280, 1393, 1920 },
-    { 1280, 1394, 1920 },
-};
-
-/**
- * Map audio coding mode (acmod) to number of full-bandwidth channels.
- * from ATSC A/52 Table 5.8 Audio Coding Mode
- */
-const uint8_t ff_ac3_channels_tab[8] = {
-    2, 1, 2, 3, 3, 4, 4, 5
-};
-
-/**
- * Map audio coding mode (acmod) to channel layout mask.
- */
-const uint16_t avpriv_ac3_channel_layout_tab[8] = {
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_2_1,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_2_2,
-    AV_CH_LAYOUT_5POINT0
-};
-
-#define COMMON_CHANNEL_MAP \
-    { { 0, 1,          }, { 0, 1, 2,         } },\
-    { { 0,             }, { 0, 1,            } },\
-    { { 0, 1,          }, { 0, 1, 2,         } },\
-    { { 0, 2, 1,       }, { 0, 2, 1, 3,      } },\
-    { { 0, 1, 2,       }, { 0, 1, 3, 2,      } },\
-    { { 0, 2, 1, 3,    }, { 0, 2, 1, 4, 3,   } },
-
-/**
- * Table to remap channels from SMPTE order to AC-3 order.
- * [channel_mode][lfe][ch]
- */
-const uint8_t ff_ac3_enc_channel_map[8][2][6] = {
-    COMMON_CHANNEL_MAP
-    { { 0, 1, 2, 3,    }, { 0, 1, 3, 4, 2,   } },
-    { { 0, 2, 1, 3, 4, }, { 0, 2, 1, 4, 5, 3 } },
-};
-
-/**
- * Table to remap channels from from AC-3 order to SMPTE order.
- * [channel_mode][lfe][ch]
- */
-const uint8_t ff_ac3_dec_channel_map[8][2][6] = {
-    COMMON_CHANNEL_MAP
-    { { 0, 1, 2, 3,    }, { 0, 1, 4, 2, 3,   } },
-    { { 0, 2, 1, 3, 4, }, { 0, 2, 1, 5, 3, 4 } },
-};
-
-/* possible frequencies */
-const uint16_t ff_ac3_sample_rate_tab[3] = { 48000, 44100, 32000 };
-
-/* possible bitrates */
-const uint16_t ff_ac3_bitrate_tab[19] = {
-    32, 40, 48, 56, 64, 80, 96, 112, 128,
-    160, 192, 224, 256, 320, 384, 448, 512, 576, 640
-};
-
-/**
- * Table of bin locations for rematrixing bands
- * reference: Section 7.5.2 Rematrixing : Frequency Band Definitions
- */
-const uint8_t ff_ac3_rematrix_band_tab[5] = { 13, 25, 37, 61, 253 };
-
-/**
- * Table E2.16 Default Coupling Banding Structure
- */
-const uint8_t ff_eac3_default_cpl_band_struct[18] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1
-};
-
-/* AC-3 MDCT window */
-
-/* MDCT window */
-DECLARE_ALIGNED(16, const int16_t, ff_ac3_window)[AC3_WINDOW_SIZE/2] = {
-    4,    7,   12,   16,   21,   28,   34,   42,
-   51,   61,   72,   84,   97,  111,  127,  145,
-  164,  184,  207,  231,  257,  285,  315,  347,
-  382,  419,  458,  500,  544,  591,  641,  694,
-  750,  810,  872,  937, 1007, 1079, 1155, 1235,
- 1318, 1406, 1497, 1593, 1692, 1796, 1903, 2016,
- 2132, 2253, 2379, 2509, 2644, 2783, 2927, 3076,
- 3230, 3389, 3552, 3721, 3894, 4072, 4255, 4444,
- 4637, 4835, 5038, 5246, 5459, 5677, 5899, 6127,
- 6359, 6596, 6837, 7083, 7334, 7589, 7848, 8112,
- 8380, 8652, 8927, 9207, 9491, 9778,10069,10363,
-10660,10960,11264,11570,11879,12190,12504,12820,
-13138,13458,13780,14103,14427,14753,15079,15407,
-15735,16063,16392,16720,17049,17377,17705,18032,
-18358,18683,19007,19330,19651,19970,20287,20602,
-20914,21225,21532,21837,22139,22438,22733,23025,
-23314,23599,23880,24157,24430,24699,24964,25225,
-25481,25732,25979,26221,26459,26691,26919,27142,
-27359,27572,27780,27983,28180,28373,28560,28742,
-28919,29091,29258,29420,29577,29729,29876,30018,
-30155,30288,30415,30538,30657,30771,30880,30985,
-31086,31182,31274,31363,31447,31528,31605,31678,
-31747,31814,31877,31936,31993,32046,32097,32145,
-32190,32232,32272,32310,32345,32378,32409,32438,
-32465,32490,32513,32535,32556,32574,32592,32608,
-32623,32636,32649,32661,32671,32681,32690,32698,
-32705,32712,32718,32724,32729,32733,32737,32741,
-32744,32747,32750,32752,32754,32756,32757,32759,
-32760,32761,32762,32763,32764,32764,32765,32765,
-32766,32766,32766,32766,32767,32767,32767,32767,
-32767,32767,32767,32767,32767,32767,32767,32767,
-32767,32767,32767,32767,32767,32767,32767,32767,
-};
-
-const uint8_t ff_ac3_log_add_tab[260]= {
-0x40,0x3f,0x3e,0x3d,0x3c,0x3b,0x3a,0x39,0x38,0x37,
-0x36,0x35,0x34,0x34,0x33,0x32,0x31,0x30,0x2f,0x2f,
-0x2e,0x2d,0x2c,0x2c,0x2b,0x2a,0x29,0x29,0x28,0x27,
-0x26,0x26,0x25,0x24,0x24,0x23,0x23,0x22,0x21,0x21,
-0x20,0x20,0x1f,0x1e,0x1e,0x1d,0x1d,0x1c,0x1c,0x1b,
-0x1b,0x1a,0x1a,0x19,0x19,0x18,0x18,0x17,0x17,0x16,
-0x16,0x15,0x15,0x15,0x14,0x14,0x13,0x13,0x13,0x12,
-0x12,0x12,0x11,0x11,0x11,0x10,0x10,0x10,0x0f,0x0f,
-0x0f,0x0e,0x0e,0x0e,0x0d,0x0d,0x0d,0x0d,0x0c,0x0c,
-0x0c,0x0c,0x0b,0x0b,0x0b,0x0b,0x0a,0x0a,0x0a,0x0a,
-0x0a,0x09,0x09,0x09,0x09,0x09,0x08,0x08,0x08,0x08,
-0x08,0x08,0x07,0x07,0x07,0x07,0x07,0x07,0x06,0x06,
-0x06,0x06,0x06,0x06,0x06,0x06,0x05,0x05,0x05,0x05,
-0x05,0x05,0x05,0x05,0x04,0x04,0x04,0x04,0x04,0x04,
-0x04,0x04,0x04,0x04,0x04,0x03,0x03,0x03,0x03,0x03,
-0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x02,
-0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
-0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,
-0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
-0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
-0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-};
-
-const uint16_t ff_ac3_hearing_threshold_tab[AC3_CRITICAL_BANDS][3]= {
-{ 0x04d0,0x04f0,0x0580 },
-{ 0x04d0,0x04f0,0x0580 },
-{ 0x0440,0x0460,0x04b0 },
-{ 0x0400,0x0410,0x0450 },
-{ 0x03e0,0x03e0,0x0420 },
-{ 0x03c0,0x03d0,0x03f0 },
-{ 0x03b0,0x03c0,0x03e0 },
-{ 0x03b0,0x03b0,0x03d0 },
-{ 0x03a0,0x03b0,0x03c0 },
-{ 0x03a0,0x03a0,0x03b0 },
-{ 0x03a0,0x03a0,0x03b0 },
-{ 0x03a0,0x03a0,0x03b0 },
-{ 0x03a0,0x03a0,0x03a0 },
-{ 0x0390,0x03a0,0x03a0 },
-{ 0x0390,0x0390,0x03a0 },
-{ 0x0390,0x0390,0x03a0 },
-{ 0x0380,0x0390,0x03a0 },
-{ 0x0380,0x0380,0x03a0 },
-{ 0x0370,0x0380,0x03a0 },
-{ 0x0370,0x0380,0x03a0 },
-{ 0x0360,0x0370,0x0390 },
-{ 0x0360,0x0370,0x0390 },
-{ 0x0350,0x0360,0x0390 },
-{ 0x0350,0x0360,0x0390 },
-{ 0x0340,0x0350,0x0380 },
-{ 0x0340,0x0350,0x0380 },
-{ 0x0330,0x0340,0x0380 },
-{ 0x0320,0x0340,0x0370 },
-{ 0x0310,0x0320,0x0360 },
-{ 0x0300,0x0310,0x0350 },
-{ 0x02f0,0x0300,0x0340 },
-{ 0x02f0,0x02f0,0x0330 },
-{ 0x02f0,0x02f0,0x0320 },
-{ 0x02f0,0x02f0,0x0310 },
-{ 0x0300,0x02f0,0x0300 },
-{ 0x0310,0x0300,0x02f0 },
-{ 0x0340,0x0320,0x02f0 },
-{ 0x0390,0x0350,0x02f0 },
-{ 0x03e0,0x0390,0x0300 },
-{ 0x0420,0x03e0,0x0310 },
-{ 0x0460,0x0420,0x0330 },
-{ 0x0490,0x0450,0x0350 },
-{ 0x04a0,0x04a0,0x03c0 },
-{ 0x0460,0x0490,0x0410 },
-{ 0x0440,0x0460,0x0470 },
-{ 0x0440,0x0440,0x04a0 },
-{ 0x0520,0x0480,0x0460 },
-{ 0x0800,0x0630,0x0440 },
-{ 0x0840,0x0840,0x0450 },
-{ 0x0840,0x0840,0x04e0 },
-};
-
-const uint8_t ff_ac3_bap_tab[64]= {
-    0, 1, 1, 1, 1, 1, 2, 2, 3, 3,
-    3, 4, 4, 5, 5, 6, 6, 6, 6, 7,
-    7, 7, 7, 8, 8, 8, 8, 9, 9, 9,
-    9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
-    12, 12, 12, 13, 13, 13, 13, 14, 14, 14,
-    14, 14, 14, 14, 14, 15, 15, 15, 15, 15,
-    15, 15, 15, 15,
-};
-
-const uint8_t ff_ac3_slow_decay_tab[4]={
-    0x0f, 0x11, 0x13, 0x15,
-};
-
-const uint8_t ff_ac3_fast_decay_tab[4]={
-    0x3f, 0x53, 0x67, 0x7b,
-};
-
-const uint16_t ff_ac3_slow_gain_tab[4]= {
-    0x540, 0x4d8, 0x478, 0x410,
-};
-
-const uint16_t ff_ac3_db_per_bit_tab[4]= {
-    0x000, 0x700, 0x900, 0xb00,
-};
-
-const int16_t ff_ac3_floor_tab[8]= {
-    0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf800,
-};
-
-const uint16_t ff_ac3_fast_gain_tab[8]= {
-    0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400,
-};
-
-/**
- * Default channel map for a dependent substream defined by acmod
- */
-const uint16_t ff_eac3_default_chmap[8] = {
-    AC3_CHMAP_L |               AC3_CHMAP_R, // FIXME Ch1+Ch2
-                  AC3_CHMAP_C,
-    AC3_CHMAP_L |               AC3_CHMAP_R,
-    AC3_CHMAP_L | AC3_CHMAP_C | AC3_CHMAP_R,
-    AC3_CHMAP_L |               AC3_CHMAP_R |                   AC3_CHMAP_C_SUR,
-    AC3_CHMAP_L | AC3_CHMAP_C | AC3_CHMAP_R |                   AC3_CHMAP_C_SUR,
-    AC3_CHMAP_L |               AC3_CHMAP_R | AC3_CHMAP_L_SUR |                  AC3_CHMAP_R_SUR,
-    AC3_CHMAP_L | AC3_CHMAP_C | AC3_CHMAP_R | AC3_CHMAP_L_SUR |                  AC3_CHMAP_R_SUR
-};
diff --git a/deps/libav/libavcodec/ac3tab.h b/deps/libav/libavcodec/ac3tab.h
deleted file mode 100644
index 83edec5..0000000
--- a/deps/libav/libavcodec/ac3tab.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * AC-3 tables
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AC3TAB_H
-#define AVCODEC_AC3TAB_H
-
-#include <stdint.h>
-
-#include "libavutil/internal.h"
-#include "ac3.h"
-
-#if CONFIG_HARDCODED_TABLES
-#   define HCONST const
-#else
-#   define HCONST
-#endif
-
-extern const uint16_t ff_ac3_frame_size_tab[38][3];
-extern const uint8_t  ff_ac3_channels_tab[8];
-extern av_export const uint16_t avpriv_ac3_channel_layout_tab[8];
-extern const uint8_t  ff_ac3_enc_channel_map[8][2][6];
-extern const uint8_t  ff_ac3_dec_channel_map[8][2][6];
-extern const uint16_t ff_ac3_sample_rate_tab[3];
-extern const uint16_t ff_ac3_bitrate_tab[19];
-extern const uint8_t  ff_ac3_rematrix_band_tab[5];
-extern const uint8_t  ff_eac3_default_cpl_band_struct[18];
-extern const int16_t  ff_ac3_window[AC3_WINDOW_SIZE/2];
-extern const uint8_t  ff_ac3_log_add_tab[260];
-extern const uint16_t ff_ac3_hearing_threshold_tab[AC3_CRITICAL_BANDS][3];
-extern const uint8_t  ff_ac3_bap_tab[64];
-extern const uint8_t  ff_ac3_slow_decay_tab[4];
-extern const uint8_t  ff_ac3_fast_decay_tab[4];
-extern const uint16_t ff_ac3_slow_gain_tab[4];
-extern const uint16_t ff_ac3_db_per_bit_tab[4];
-extern const int16_t  ff_ac3_floor_tab[8];
-extern const uint16_t ff_ac3_fast_gain_tab[8];
-extern const uint16_t ff_eac3_default_chmap[8];
-extern const uint8_t  ff_ac3_band_start_tab[AC3_CRITICAL_BANDS+1];
-extern HCONST uint8_t ff_ac3_bin_to_band_tab[253];
-
-/** Custom channel map locations bitmask
- *  Other channels described in documentation:
- *      Lc/Rc pair, Lrs/Rrs pair, Ts, Lsd/Rsd pair,
- *      Lw/Rw pair, Lvh/Rvh pair, Cvh, Reserved, LFE2
- */
-enum CustomChannelMapLocation{
-    AC3_CHMAP_L=        1<<(15-0),
-    AC3_CHMAP_C=        1<<(15-1),
-    AC3_CHMAP_R=        1<<(15-2),
-    AC3_CHMAP_L_SUR=    1<<(15-3),
-    AC3_CHMAP_R_SUR =   1<<(15-4),
-    AC3_CHMAP_C_SUR=    1<<(15-7),
-    AC3_CHMAP_LFE =     1<<(15-15)
-};
-
-#endif /* AVCODEC_AC3TAB_H */
diff --git a/deps/libav/libavcodec/acelp_filters.c b/deps/libav/libavcodec/acelp_filters.c
deleted file mode 100644
index 93bec65..0000000
--- a/deps/libav/libavcodec/acelp_filters.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * various filters for ACELP-based codecs
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "acelp_filters.h"
-
-const int16_t ff_acelp_interp_filter[61] = { /* (0.15) */
-  29443, 28346, 25207, 20449, 14701,  8693,
-   3143, -1352, -4402, -5865, -5850, -4673,
-  -2783,  -672,  1211,  2536,  3130,  2991,
-   2259,  1170,     0, -1001, -1652, -1868,
-  -1666, -1147,  -464,   218,   756,  1060,
-   1099,   904,   550,   135,  -245,  -514,
-   -634,  -602,  -451,  -231,     0,   191,
-    308,   340,   296,   198,    78,   -36,
-   -120,  -163,  -165,  -132,   -79,   -19,
-     34,    73,    91,    89,    70,    38,
-      0,
-};
-
-void ff_acelp_interpolate(int16_t* out, const int16_t* in,
-                          const int16_t* filter_coeffs, int precision,
-                          int frac_pos, int filter_length, int length)
-{
-    int n, i;
-
-    assert(frac_pos >= 0 && frac_pos < precision);
-
-    for (n = 0; n < length; n++) {
-        int idx = 0;
-        int v = 0x4000;
-
-        for (i = 0; i < filter_length;) {
-
-            /* The reference G.729 and AMR fixed point code performs clipping after
-               each of the two following accumulations.
-               Since clipping affects only the synthetic OVERFLOW test without
-               causing an int type overflow, it was moved outside the loop. */
-
-            /*  R(x):=ac_v[-k+x]
-                v += R(n-i)*ff_acelp_interp_filter(t+6i)
-                v += R(n+i+1)*ff_acelp_interp_filter(6-t+6i) */
-
-            v += in[n + i] * filter_coeffs[idx + frac_pos];
-            idx += precision;
-            i++;
-            v += in[n - i] * filter_coeffs[idx - frac_pos];
-        }
-        if (av_clip_int16(v >> 15) != (v >> 15))
-            av_log(NULL, AV_LOG_WARNING, "overflow that would need cliping in ff_acelp_interpolate()\n");
-        out[n] = v >> 15;
-    }
-}
-
-void ff_acelp_interpolatef(float *out, const float *in,
-                           const float *filter_coeffs, int precision,
-                           int frac_pos, int filter_length, int length)
-{
-    int n, i;
-
-    for (n = 0; n < length; n++) {
-        int idx = 0;
-        float v = 0;
-
-        for (i = 0; i < filter_length;) {
-            v += in[n + i] * filter_coeffs[idx + frac_pos];
-            idx += precision;
-            i++;
-            v += in[n - i] * filter_coeffs[idx - frac_pos];
-        }
-        out[n] = v;
-    }
-}
-
-
-void ff_acelp_high_pass_filter(int16_t* out, int hpf_f[2],
-                               const int16_t* in, int length)
-{
-    int i;
-    int tmp;
-
-    for (i = 0; i < length; i++) {
-        tmp  = (hpf_f[0]* 15836LL) >> 13;
-        tmp += (hpf_f[1]* -7667LL) >> 13;
-        tmp += 7699 * (in[i] - 2*in[i-1] + in[i-2]);
-
-        /* With "+0x800" rounding, clipping is needed
-           for ALGTHM and SPEECH tests. */
-        out[i] = av_clip_int16((tmp + 0x800) >> 12);
-
-        hpf_f[1] = hpf_f[0];
-        hpf_f[0] = tmp;
-    }
-}
-
-void ff_acelp_apply_order_2_transfer_function(float *out, const float *in,
-                                              const float zero_coeffs[2],
-                                              const float pole_coeffs[2],
-                                              float gain, float mem[2], int n)
-{
-    int i;
-    float tmp;
-
-    for (i = 0; i < n; i++) {
-        tmp = gain * in[i] - pole_coeffs[0] * mem[0] - pole_coeffs[1] * mem[1];
-        out[i] =       tmp + zero_coeffs[0] * mem[0] + zero_coeffs[1] * mem[1];
-
-        mem[1] = mem[0];
-        mem[0] = tmp;
-    }
-}
-
-void ff_tilt_compensation(float *mem, float tilt, float *samples, int size)
-{
-    float new_tilt_mem = samples[size - 1];
-    int i;
-
-    for (i = size - 1; i > 0; i--)
-        samples[i] -= tilt * samples[i - 1];
-
-    samples[0] -= tilt * *mem;
-    *mem = new_tilt_mem;
-}
diff --git a/deps/libav/libavcodec/acelp_filters.h b/deps/libav/libavcodec/acelp_filters.h
deleted file mode 100644
index 6a9ebd9..0000000
--- a/deps/libav/libavcodec/acelp_filters.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * various filters for ACELP-based codecs
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ACELP_FILTERS_H
-#define AVCODEC_ACELP_FILTERS_H
-
-#include <stdint.h>
-
-/**
- * low-pass Finite Impulse Response filter coefficients.
- *
- * Hamming windowed sinc filter with cutoff freq 3/40 of the sampling freq,
- * the coefficients are scaled by 2^15.
- * This array only contains the right half of the filter.
- * This filter is likely identical to the one used in G.729, though this
- * could not be determined from the original comments with certainty.
- */
-extern const int16_t ff_acelp_interp_filter[61];
-
-/**
- * Generic FIR interpolation routine.
- * @param[out] out buffer for interpolated data
- * @param in input data
- * @param filter_coeffs interpolation filter coefficients (0.15)
- * @param precision sub sample factor, that is the precision of the position
- * @param frac_pos fractional part of position [0..precision-1]
- * @param filter_length filter length
- * @param length length of output
- *
- * filter_coeffs contains coefficients of the right half of the symmetric
- * interpolation filter. filter_coeffs[0] should the central (unpaired) coefficient.
- * See ff_acelp_interp_filter for an example.
- *
- */
-void ff_acelp_interpolate(int16_t* out, const int16_t* in,
-                          const int16_t* filter_coeffs, int precision,
-                          int frac_pos, int filter_length, int length);
-
-/**
- * Floating point version of ff_acelp_interpolate()
- */
-void ff_acelp_interpolatef(float *out, const float *in,
-                           const float *filter_coeffs, int precision,
-                           int frac_pos, int filter_length, int length);
-
-
-/**
- * high-pass filtering and upscaling (4.2.5 of G.729).
- * @param[out]     out   output buffer for filtered speech data
- * @param[in,out]  hpf_f past filtered data from previous (2 items long)
- *                       frames (-0x20000000 <= (14.13) < 0x20000000)
- * @param in speech data to process
- * @param length input data size
- *
- * out[i] = 0.93980581 * in[i] - 1.8795834 * in[i-1] + 0.93980581 * in[i-2] +
- *          1.9330735 * out[i-1] - 0.93589199 * out[i-2]
- *
- * The filter has a cut-off frequency of 1/80 of the sampling freq
- *
- * @note Two items before the top of the out buffer must contain two items from the
- *       tail of the previous subframe.
- *
- * @remark It is safe to pass the same array in in and out parameters.
- *
- * @remark AMR uses mostly the same filter (cut-off frequency 60Hz, same formula,
- *         but constants differs in 5th sign after comma). Fortunately in
- *         fixed-point all coefficients are the same as in G.729. Thus this
- *         routine can be used for the fixed-point AMR decoder, too.
- */
-void ff_acelp_high_pass_filter(int16_t* out, int hpf_f[2],
-                               const int16_t* in, int length);
-
-/**
- * Apply an order 2 rational transfer function in-place.
- *
- * @param out output buffer for filtered speech samples
- * @param in input buffer containing speech data (may be the same as out)
- * @param zero_coeffs z^-1 and z^-2 coefficients of the numerator
- * @param pole_coeffs z^-1 and z^-2 coefficients of the denominator
- * @param gain scale factor for final output
- * @param mem intermediate values used by filter (should be 0 initially)
- * @param n number of samples
- */
-void ff_acelp_apply_order_2_transfer_function(float *out, const float *in,
-                                              const float zero_coeffs[2],
-                                              const float pole_coeffs[2],
-                                              float gain,
-                                              float mem[2], int n);
-
-/**
- * Apply tilt compensation filter, 1 - tilt * z-1.
- *
- * @param mem pointer to the filter's state (one single float)
- * @param tilt tilt factor
- * @param samples array where the filter is applied
- * @param size the size of the samples array
- */
-void ff_tilt_compensation(float *mem, float tilt, float *samples, int size);
-
-
-#endif /* AVCODEC_ACELP_FILTERS_H */
diff --git a/deps/libav/libavcodec/acelp_pitch_delay.c b/deps/libav/libavcodec/acelp_pitch_delay.c
deleted file mode 100644
index ab09bdb..0000000
--- a/deps/libav/libavcodec/acelp_pitch_delay.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * gain code, gain pitch and pitch delay decoding
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/mathematics.h"
-#include "avcodec.h"
-#include "acelp_pitch_delay.h"
-#include "celp_math.h"
-
-int ff_acelp_decode_8bit_to_1st_delay3(int ac_index)
-{
-    ac_index += 58;
-    if(ac_index > 254)
-        ac_index = 3 * ac_index - 510;
-    return ac_index;
-}
-
-int ff_acelp_decode_4bit_to_2nd_delay3(
-        int ac_index,
-        int pitch_delay_min)
-{
-    if(ac_index < 4)
-        return 3 * (ac_index + pitch_delay_min);
-    else if(ac_index < 12)
-        return 3 * pitch_delay_min + ac_index + 6;
-    else
-        return 3 * (ac_index + pitch_delay_min) - 18;
-}
-
-int ff_acelp_decode_5_6_bit_to_2nd_delay3(
-        int ac_index,
-        int pitch_delay_min)
-{
-        return 3 * pitch_delay_min + ac_index - 2;
-}
-
-int ff_acelp_decode_9bit_to_1st_delay6(int ac_index)
-{
-    if(ac_index < 463)
-        return ac_index + 105;
-    else
-        return 6 * (ac_index - 368);
-}
-int ff_acelp_decode_6bit_to_2nd_delay6(
-        int ac_index,
-        int pitch_delay_min)
-{
-    return 6 * pitch_delay_min + ac_index - 3;
-}
-
-void ff_acelp_update_past_gain(
-    int16_t* quant_energy,
-    int gain_corr_factor,
-    int log2_ma_pred_order,
-    int erasure)
-{
-    int i;
-    int avg_gain=quant_energy[(1 << log2_ma_pred_order) - 1]; // (5.10)
-
-    for(i=(1 << log2_ma_pred_order) - 1; i>0; i--)
-    {
-        avg_gain       += quant_energy[i-1];
-        quant_energy[i] = quant_energy[i-1];
-    }
-
-    if(erasure)
-        quant_energy[0] = FFMAX(avg_gain >> log2_ma_pred_order, -10240) - 4096; // -10 and -4 in (5.10)
-    else
-        quant_energy[0] = (6165 * ((ff_log2_q15(gain_corr_factor) >> 2) - (13 << 13))) >> 13;
-}
-
-int16_t ff_acelp_decode_gain_code(
-    DSPContext *dsp,
-    int gain_corr_factor,
-    const int16_t* fc_v,
-    int mr_energy,
-    const int16_t* quant_energy,
-    const int16_t* ma_prediction_coeff,
-    int subframe_size,
-    int ma_pred_order)
-{
-    int i;
-
-    mr_energy <<= 10;
-
-    for(i=0; i<ma_pred_order; i++)
-        mr_energy += quant_energy[i] * ma_prediction_coeff[i];
-
-    mr_energy = gain_corr_factor * exp(M_LN10 / (20 << 23) * mr_energy) /
-                sqrt(dsp->scalarproduct_int16(fc_v, fc_v, subframe_size));
-    return mr_energy >> 12;
-}
-
-float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
-                            float *prediction_error, float energy_mean,
-                            const float *pred_table)
-{
-    // Equations 66-69:
-    // ^g_c = ^gamma_gc * 100.05 (predicted dB + mean dB - dB of fixed vector)
-    // Note 10^(0.05 * -10log(average x2)) = 1/sqrt((average x2)).
-    float val = fixed_gain_factor *
-        exp2f(M_LOG2_10 * 0.05 *
-              (avpriv_scalarproduct_float_c(pred_table, prediction_error, 4) +
-               energy_mean)) /
-        sqrtf(fixed_mean_energy);
-
-    // update quantified prediction error energy history
-    memmove(&prediction_error[0], &prediction_error[1],
-            3 * sizeof(prediction_error[0]));
-    prediction_error[3] = 20.0 * log10f(fixed_gain_factor);
-
-    return val;
-}
-
-void ff_decode_pitch_lag(int *lag_int, int *lag_frac, int pitch_index,
-                         const int prev_lag_int, const int subframe,
-                         int third_as_first, int resolution)
-{
-    /* Note n * 10923 >> 15 is floor(x/3) for 0 <= n <= 32767 */
-    if (subframe == 0 || (subframe == 2 && third_as_first)) {
-
-        if (pitch_index < 197)
-            pitch_index += 59;
-        else
-            pitch_index = 3 * pitch_index - 335;
-
-    } else {
-        if (resolution == 4) {
-            int search_range_min = av_clip(prev_lag_int - 5, PITCH_DELAY_MIN,
-                                           PITCH_DELAY_MAX - 9);
-
-            // decoding with 4-bit resolution
-            if (pitch_index < 4) {
-                // integer only precision for [search_range_min, search_range_min+3]
-                pitch_index = 3 * (pitch_index + search_range_min) + 1;
-            } else if (pitch_index < 12) {
-                // 1/3 fractional precision for [search_range_min+3 1/3, search_range_min+5 2/3]
-                pitch_index += 3 * search_range_min + 7;
-            } else {
-                // integer only precision for [search_range_min+6, search_range_min+9]
-                pitch_index = 3 * (pitch_index + search_range_min - 6) + 1;
-            }
-        } else {
-            // decoding with 5 or 6 bit resolution, 1/3 fractional precision
-            pitch_index--;
-
-            if (resolution == 5) {
-                pitch_index += 3 * av_clip(prev_lag_int - 10, PITCH_DELAY_MIN,
-                                           PITCH_DELAY_MAX - 19);
-            } else
-                pitch_index += 3 * av_clip(prev_lag_int - 5, PITCH_DELAY_MIN,
-                                           PITCH_DELAY_MAX - 9);
-        }
-    }
-    *lag_int  = pitch_index * 10923 >> 15;
-    *lag_frac = pitch_index - 3 * *lag_int - 1;
-}
diff --git a/deps/libav/libavcodec/acelp_pitch_delay.h b/deps/libav/libavcodec/acelp_pitch_delay.h
deleted file mode 100644
index e5410bb..0000000
--- a/deps/libav/libavcodec/acelp_pitch_delay.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * gain code, gain pitch and pitch delay decoding
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ACELP_PITCH_DELAY_H
-#define AVCODEC_ACELP_PITCH_DELAY_H
-
-#include <stdint.h>
-#include "dsputil.h"
-
-#define PITCH_DELAY_MIN             20
-#define PITCH_DELAY_MAX             143
-
-/**
- * @brief Decode pitch delay of the first subframe encoded by 8 bits with 1/3
- *        resolution.
- * @param ac_index adaptive codebook index (8 bits)
- *
- * @return pitch delay in 1/3 units
- *
- * Pitch delay is coded:
- *    with 1/3 resolution, 19  < pitch_delay <  85
- *    integers only,       85 <= pitch_delay <= 143
- */
-int ff_acelp_decode_8bit_to_1st_delay3(int ac_index);
-
-/**
- * @brief Decode pitch delay of the second subframe encoded by 5 or 6 bits
- *        with 1/3 precision.
- * @param ac_index adaptive codebook index (5 or 6 bits)
- * @param pitch_delay_min lower bound (integer) of pitch delay interval
- *                      for second subframe
- *
- * @return pitch delay in 1/3 units
- *
- * Pitch delay is coded:
- *    with 1/3 resolution, -6 < pitch_delay - int(prev_pitch_delay) < 5
- *
- * @remark The routine is used in G.729 @@8k, AMR @@10.2k, AMR @@7.95k,
- *         AMR @@7.4k for the second subframe.
- */
-int ff_acelp_decode_5_6_bit_to_2nd_delay3(
-        int ac_index,
-        int pitch_delay_min);
-
-/**
- * @brief Decode pitch delay with 1/3 precision.
- * @param ac_index adaptive codebook index (4 bits)
- * @param pitch_delay_min lower bound (integer) of pitch delay interval for
- *                      second subframe
- *
- * @return pitch delay in 1/3 units
- *
- * Pitch delay is coded:
- *    integers only,          -6  < pitch_delay - int(prev_pitch_delay) <= -2
- *    with 1/3 resolution,    -2  < pitch_delay - int(prev_pitch_delay) <  1
- *    integers only,           1 <= pitch_delay - int(prev_pitch_delay) <  5
- *
- * @remark The routine is used in G.729 @@6.4k, AMR @@6.7k, AMR @@5.9k,
- *         AMR @@5.15k, AMR @@4.75k for the second subframe.
- */
-int ff_acelp_decode_4bit_to_2nd_delay3(
-        int ac_index,
-        int pitch_delay_min);
-
-/**
- * @brief Decode pitch delay of the first subframe encoded by 9 bits
- *        with 1/6 precision.
- * @param ac_index adaptive codebook index (9 bits)
- *
- * @return pitch delay in 1/6 units
- *
- * Pitch delay is coded:
- *    with 1/6 resolution,  17  < pitch_delay <  95
- *    integers only,        95 <= pitch_delay <= 143
- *
- * @remark The routine is used in AMR @@12.2k for the first and third subframes.
- */
-int ff_acelp_decode_9bit_to_1st_delay6(int ac_index);
-
-/**
- * @brief Decode pitch delay of the second subframe encoded by 6 bits
- *        with 1/6 precision.
- * @param ac_index adaptive codebook index (6 bits)
- * @param pitch_delay_min lower bound (integer) of pitch delay interval for
- *                      second subframe
- *
- * @return pitch delay in 1/6 units
- *
- * Pitch delay is coded:
- *    with 1/6 resolution, -6 < pitch_delay - int(prev_pitch_delay) < 5
- *
- * @remark The routine is used in AMR @@12.2k for the second and fourth subframes.
- */
-int ff_acelp_decode_6bit_to_2nd_delay6(
-        int ac_index,
-        int pitch_delay_min);
-
-/**
- * @brief Update past quantized energies
- * @param[in,out]  quant_energy  past quantized energies (5.10)
- * @param gain_corr_factor gain correction factor
- * @param log2_ma_pred_order log2() of MA prediction order
- * @param erasure frame erasure flag
- *
- * If frame erasure flag is not equal to zero, memory is updated with
- * averaged energy, attenuated by 4dB:
- *     max(avg(quant_energy[i])-4, -14), i=0,ma_pred_order
- *
- * In normal mode memory is updated with
- *     Er - Ep = 20 * log10(gain_corr_factor)
- *
- * @remark The routine is used in G.729 and AMR (all modes).
- */
-void ff_acelp_update_past_gain(
-        int16_t* quant_energy,
-        int gain_corr_factor,
-        int log2_ma_pred_order,
-        int erasure);
-
-/**
- * @brief Decode the adaptive codebook gain and add
- *        correction (4.1.5 and 3.9.1 of G.729).
- * @param dsp initialized dsputil context
- * @param gain_corr_factor gain correction factor (2.13)
- * @param fc_v fixed-codebook vector (2.13)
- * @param mr_energy mean innovation energy and fixed-point correction (7.13)
- * @param[in,out]  quant_energy  past quantized energies (5.10)
- * @param subframe_size length of subframe
- *
- * @return quantized fixed-codebook gain (14.1)
- *
- * The routine implements equations 69, 66 and 71 of the G.729 specification (3.9.1)
- *
- *    Em   - mean innovation energy (dB, constant, depends on decoding algorithm)
- *    Ep   - mean-removed predicted energy (dB)
- *    Er   - mean-removed innovation energy (dB)
- *    Ei   - mean energy of the fixed-codebook contribution (dB)
- *    N    - subframe_size
- *    M    - MA (Moving Average) prediction order
- *    gc   - fixed-codebook gain
- *    gc_p - predicted fixed-codebook gain
- *
- *    Fixed codebook gain is computed using predicted gain gc_p and
- *    correction factor gain_corr_factor as shown below:
- *
- *        gc = gc_p * gain_corr_factor
- *
- *    The predicted fixed codebook gain gc_p is found by predicting
- *    the energy of the fixed-codebook contribution from the energy
- *    of previous fixed-codebook contributions.
- *
- *        mean = 1/N * sum(i,0,N){ fc_v[i] * fc_v[i] }
- *
- *        Ei = 10log(mean)
- *
- *        Er = 10log(1/N * gc^2 * mean) - Em = 20log(gc) + Ei - Em
- *
- *    Replacing Er with Ep and gc with gc_p we will receive:
- *
- *        Ep = 10log(1/N * gc_p^2 * mean) - Em = 20log(gc_p) + Ei - Em
- *
- *    and from above:
- *
- *        gc_p = 10^((Ep - Ei + Em) / 20)
- *
- *    Ep is predicted using past energies and prediction coefficients:
- *
- *        Ep = sum(i,0,M){ ma_prediction_coeff[i] * quant_energy[i] }
- *
- *    gc_p in fixed-point arithmetic is calculated as following:
- *
- *        mean = 1/N * sum(i,0,N){ (fc_v[i] / 2^13) * (fc_v[i] / 2^13) } =
- *        = 1/N * sum(i,0,N) { fc_v[i] * fc_v[i] } / 2^26
- *
- *        Ei = 10log(mean) = -10log(N) - 10log(2^26) +
- *        + 10log(sum(i,0,N) { fc_v[i] * fc_v[i] })
- *
- *        Ep - Ei + Em = Ep + Em + 10log(N) + 10log(2^26) -
- *        - 10log(sum(i,0,N) { fc_v[i] * fc_v[i] }) =
- *        = Ep + mr_energy - 10log(sum(i,0,N) { fc_v[i] * fc_v[i] })
- *
- *        gc_p = 10 ^ ((Ep - Ei + Em) / 20) =
- *        = 2 ^ (3.3219 * (Ep - Ei + Em) / 20) = 2 ^ (0.166 * (Ep - Ei + Em))
- *
- *    where
- *
- *        mr_energy = Em + 10log(N) + 10log(2^26)
- *
- * @remark The routine is used in G.729 and AMR (all modes).
- */
-int16_t ff_acelp_decode_gain_code(
-    DSPContext *dsp,
-    int gain_corr_factor,
-    const int16_t* fc_v,
-    int mr_energy,
-    const int16_t* quant_energy,
-    const int16_t* ma_prediction_coeff,
-    int subframe_size,
-    int max_pred_order);
-
-/**
- * Calculate fixed gain (part of section 6.1.3 of AMR spec)
- *
- * @param fixed_gain_factor gain correction factor
- * @param fixed_mean_energy mean decoded algebraic codebook vector energy
- * @param prediction_error vector of the quantified predictor errors of
- *        the four previous subframes. It is updated by this function.
- * @param energy_mean desired mean innovation energy
- * @param pred_table table of four moving average coefficients
- */
-float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
-                            float *prediction_error, float energy_mean,
-                            const float *pred_table);
-
-
-/**
- * Decode the adaptive codebook index to the integer and fractional parts
- * of the pitch lag for one subframe at 1/3 fractional precision.
- *
- * The choice of pitch lag is described in 3GPP TS 26.090 section 5.6.1.
- *
- * @param lag_int             integer part of pitch lag of the current subframe
- * @param lag_frac            fractional part of pitch lag of the current subframe
- * @param pitch_index         parsed adaptive codebook (pitch) index
- * @param prev_lag_int        integer part of pitch lag for the previous subframe
- * @param subframe            current subframe number
- * @param third_as_first      treat the third frame the same way as the first
- */
-void ff_decode_pitch_lag(int *lag_int, int *lag_frac, int pitch_index,
-                         const int prev_lag_int, const int subframe,
-                         int third_as_first, int resolution);
-
-#endif /* AVCODEC_ACELP_PITCH_DELAY_H */
diff --git a/deps/libav/libavcodec/acelp_vectors.c b/deps/libav/libavcodec/acelp_vectors.c
deleted file mode 100644
index 0c660ac..0000000
--- a/deps/libav/libavcodec/acelp_vectors.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * adaptive and fixed codebook vector operations for ACELP-based codecs
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "acelp_vectors.h"
-
-const uint8_t ff_fc_2pulses_9bits_track1[16] =
-{
-    1,  3,
-    6,  8,
-    11, 13,
-    16, 18,
-    21, 23,
-    26, 28,
-    31, 33,
-    36, 38
-};
-const uint8_t ff_fc_2pulses_9bits_track1_gray[16] =
-{
-  1,  3,
-  8,  6,
-  18, 16,
-  11, 13,
-  38, 36,
-  31, 33,
-  21, 23,
-  28, 26,
-};
-
-const uint8_t ff_fc_4pulses_8bits_tracks_13[16] =
-{
-  0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75,
-};
-
-const uint8_t ff_fc_4pulses_8bits_track_4[32] =
-{
-    3,  4,
-    8,  9,
-    13, 14,
-    18, 19,
-    23, 24,
-    28, 29,
-    33, 34,
-    38, 39,
-    43, 44,
-    48, 49,
-    53, 54,
-    58, 59,
-    63, 64,
-    68, 69,
-    73, 74,
-    78, 79,
-};
-
-const float ff_pow_0_7[10] = {
-    0.700000, 0.490000, 0.343000, 0.240100, 0.168070,
-    0.117649, 0.082354, 0.057648, 0.040354, 0.028248
-};
-
-const float ff_pow_0_75[10] = {
-    0.750000, 0.562500, 0.421875, 0.316406, 0.237305,
-    0.177979, 0.133484, 0.100113, 0.075085, 0.056314
-};
-
-const float ff_pow_0_55[10] = {
-    0.550000, 0.302500, 0.166375, 0.091506, 0.050328,
-    0.027681, 0.015224, 0.008373, 0.004605, 0.002533
-};
-
-const float ff_b60_sinc[61] = {
- 0.898529  ,  0.865051  ,  0.769257  ,  0.624054  ,  0.448639  ,  0.265289   ,
- 0.0959167 , -0.0412598 , -0.134338  , -0.178986  , -0.178528  , -0.142609   ,
--0.0849304 , -0.0205078 ,  0.0369568 ,  0.0773926 ,  0.0955200 ,  0.0912781  ,
- 0.0689392 ,  0.0357056 ,  0.0       , -0.0305481 , -0.0504150 , -0.0570068  ,
--0.0508423 , -0.0350037 , -0.0141602 ,  0.00665283,  0.0230713 ,  0.0323486  ,
- 0.0335388 ,  0.0275879 ,  0.0167847 ,  0.00411987, -0.00747681, -0.0156860  ,
--0.0193481 , -0.0183716 , -0.0137634 , -0.00704956,  0.0       ,  0.00582886 ,
- 0.00939941,  0.0103760 ,  0.00903320,  0.00604248,  0.00238037, -0.00109863 ,
--0.00366211, -0.00497437, -0.00503540, -0.00402832, -0.00241089, -0.000579834,
- 0.00103760,  0.00222778,  0.00277710,  0.00271606,  0.00213623,  0.00115967 ,
- 0.
-};
-
-void ff_acelp_fc_pulse_per_track(
-        int16_t* fc_v,
-        const uint8_t *tab1,
-        const uint8_t *tab2,
-        int pulse_indexes,
-        int pulse_signs,
-        int pulse_count,
-        int bits)
-{
-    int mask = (1 << bits) - 1;
-    int i;
-
-    for(i=0; i<pulse_count; i++)
-    {
-        fc_v[i + tab1[pulse_indexes & mask]] +=
-                (pulse_signs & 1) ? 8191 : -8192; // +/-1 in (2.13)
-
-        pulse_indexes >>= bits;
-        pulse_signs >>= 1;
-    }
-
-    fc_v[tab2[pulse_indexes]] += (pulse_signs & 1) ? 8191 : -8192;
-}
-
-void ff_decode_10_pulses_35bits(const int16_t *fixed_index,
-                                AMRFixed *fixed_sparse,
-                                const uint8_t *gray_decode,
-                                int half_pulse_count, int bits)
-{
-    int i;
-    int mask = (1 << bits) - 1;
-
-    fixed_sparse->no_repeat_mask = 0;
-    fixed_sparse->n = 2 * half_pulse_count;
-    for (i = 0; i < half_pulse_count; i++) {
-        const int pos1   = gray_decode[fixed_index[2*i+1] & mask] + i;
-        const int pos2   = gray_decode[fixed_index[2*i  ] & mask] + i;
-        const float sign = (fixed_index[2*i+1] & (1 << bits)) ? -1.0 : 1.0;
-        fixed_sparse->x[2*i+1] = pos1;
-        fixed_sparse->x[2*i  ] = pos2;
-        fixed_sparse->y[2*i+1] = sign;
-        fixed_sparse->y[2*i  ] = pos2 < pos1 ? -sign : sign;
-    }
-}
-
-void ff_acelp_weighted_vector_sum(
-        int16_t* out,
-        const int16_t *in_a,
-        const int16_t *in_b,
-        int16_t weight_coeff_a,
-        int16_t weight_coeff_b,
-        int16_t rounder,
-        int shift,
-        int length)
-{
-    int i;
-
-    // Clipping required here; breaks OVERFLOW test.
-    for(i=0; i<length; i++)
-        out[i] = av_clip_int16((
-                 in_a[i] * weight_coeff_a +
-                 in_b[i] * weight_coeff_b +
-                 rounder) >> shift);
-}
-
-void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b,
-                             float weight_coeff_a, float weight_coeff_b, int length)
-{
-    int i;
-
-    for(i=0; i<length; i++)
-        out[i] = weight_coeff_a * in_a[i]
-               + weight_coeff_b * in_b[i];
-}
-
-void ff_adaptive_gain_control(float *out, const float *in, float speech_energ,
-                              int size, float alpha, float *gain_mem)
-{
-    int i;
-    float postfilter_energ = avpriv_scalarproduct_float_c(in, in, size);
-    float gain_scale_factor = 1.0;
-    float mem = *gain_mem;
-
-    if (postfilter_energ)
-        gain_scale_factor = sqrt(speech_energ / postfilter_energ);
-
-    gain_scale_factor *= 1.0 - alpha;
-
-    for (i = 0; i < size; i++) {
-        mem = alpha * mem + gain_scale_factor;
-        out[i] = in[i] * mem;
-    }
-
-    *gain_mem = mem;
-}
-
-void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in,
-                                             float sum_of_squares, const int n)
-{
-    int i;
-    float scalefactor = avpriv_scalarproduct_float_c(in, in, n);
-    if (scalefactor)
-        scalefactor = sqrt(sum_of_squares / scalefactor);
-    for (i = 0; i < n; i++)
-        out[i] = in[i] * scalefactor;
-}
-
-void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size)
-{
-    int i;
-
-    for (i=0; i < in->n; i++) {
-        int x   = in->x[i], repeats = !((in->no_repeat_mask >> i) & 1);
-        float y = in->y[i] * scale;
-
-        do {
-            out[x] += y;
-            y *= in->pitch_fac;
-            x += in->pitch_lag;
-        } while (x < size && repeats);
-    }
-}
-
-void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size)
-{
-    int i;
-
-    for (i=0; i < in->n; i++) {
-        int x  = in->x[i], repeats = !((in->no_repeat_mask >> i) & 1);
-
-        do {
-            out[x] = 0.0;
-            x += in->pitch_lag;
-        } while (x < size && repeats);
-    }
-}
diff --git a/deps/libav/libavcodec/acelp_vectors.h b/deps/libav/libavcodec/acelp_vectors.h
deleted file mode 100644
index d6226bf..0000000
--- a/deps/libav/libavcodec/acelp_vectors.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * adaptive and fixed codebook vector operations for ACELP-based codecs
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ACELP_VECTORS_H
-#define AVCODEC_ACELP_VECTORS_H
-
-#include <stdint.h>
-
-/** Sparse representation for the algebraic codebook (fixed) vector */
-typedef struct AMRFixed {
-    int      n;
-    int      x[10];
-    float    y[10];
-    int      no_repeat_mask;
-    int      pitch_lag;
-    float    pitch_fac;
-} AMRFixed;
-
-/**
- * Track|Pulse|        Positions
- * -------------------------------------------------------------------------
- *  1   | 0   | 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75
- * -------------------------------------------------------------------------
- *  2   | 1   | 1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76
- * -------------------------------------------------------------------------
- *  3   | 2   | 2, 7, 12, 17, 22, 27, 32, 37, 42, 47, 52, 57, 62, 67, 72, 77
- * -------------------------------------------------------------------------
- *
- * Table contains only first the pulse indexes.
- *
- * Used in G.729 @@8k, G.729 @@4.4k, AMR @@7.95k, AMR @@7.40k
- */
-extern const uint8_t ff_fc_4pulses_8bits_tracks_13[16];
-
-/**
- * Track|Pulse|        Positions
- * -------------------------------------------------------------------------
- *  4   | 3   | 3, 8, 13, 18, 23, 28, 33, 38, 43, 48, 53, 58, 63, 68, 73, 78
- *      |     | 4, 9, 14, 19, 24, 29, 34, 39, 44, 49, 54, 59, 64, 69, 74, 79
- * -------------------------------------------------------------------------
- *
- * @remark Track in the table should be read top-to-bottom, left-to-right.
- *
- * Used in G.729 @@8k, G.729 @@4.4k, AMR @@7.95k, AMR @@7.40k
- */
-extern const uint8_t ff_fc_4pulses_8bits_track_4[32];
-
-/**
- * Track|Pulse|        Positions
- * -----------------------------------------
- *  1   | 0   | 1, 6, 11, 16, 21, 26, 31, 36
- *      |     | 3, 8, 13, 18, 23, 28, 33, 38
- * -----------------------------------------
- *
- * @remark Track in the table should be read top-to-bottom, left-to-right.
- *
- * @note (EE) Reference G.729D code also uses gray decoding for each
- *            pulse index before looking up the value in the table.
- *
- * Used in G.729 @@6.4k (with gray coding), AMR @@5.9k (without gray coding)
- */
-extern const uint8_t ff_fc_2pulses_9bits_track1[16];
-extern const uint8_t ff_fc_2pulses_9bits_track1_gray[16];
-
-/**
- * b60 hamming windowed sinc function coefficients
- */
-extern const float ff_b60_sinc[61];
-
-/**
- * Table of pow(0.7,n)
- */
-extern const float ff_pow_0_7[10];
-
-/**
- * Table of pow(0.75,n)
- */
-extern const float ff_pow_0_75[10];
-
-/**
- * Table of pow(0.55,n)
- */
-extern const float ff_pow_0_55[10];
-
-/**
- * Decode fixed-codebook vector (3.8 and D.5.8 of G.729, 5.7.1 of AMR).
- * @param[out] fc_v decoded fixed codebook vector (2.13)
- * @param tab1 table used for first pulse_count pulses
- * @param tab2 table used for last pulse
- * @param pulse_indexes fixed codebook indexes
- * @param pulse_signs signs of the excitation pulses (0 bit value
- *                     means negative sign)
- * @param bits number of bits per one pulse index
- * @param pulse_count number of pulses decoded using first table
- * @param bits length of one pulse index in bits
- *
- * Used in G.729 @@8k, G.729 @@4.4k, G.729 @@6.4k, AMR @@7.95k, AMR @@7.40k
- */
-void ff_acelp_fc_pulse_per_track(int16_t* fc_v,
-                                 const uint8_t *tab1,
-                                 const uint8_t *tab2,
-                                 int pulse_indexes,
-                                 int pulse_signs,
-                                 int pulse_count,
-                                 int bits);
-
-/**
- * Decode the algebraic codebook index to pulse positions and signs and
- * construct the algebraic codebook vector for MODE_12k2.
- *
- * @note: The positions and signs are explicitly coded in MODE_12k2.
- *
- * @param fixed_index          positions of the ten pulses
- * @param fixed_sparse         pointer to the algebraic codebook vector
- * @param gray_decode          gray decoding table
- * @param half_pulse_count     number of couples of pulses
- * @param bits                 length of one pulse index in bits
- */
-void ff_decode_10_pulses_35bits(const int16_t *fixed_index,
-                                AMRFixed *fixed_sparse,
-                                const uint8_t *gray_decode,
-                                int half_pulse_count, int bits);
-
-
-/**
- * weighted sum of two vectors with rounding.
- * @param[out] out result of addition
- * @param in_a first vector
- * @param in_b second vector
- * @param weight_coeff_a first vector weight coefficient
- * @param weight_coeff_a second vector weight coefficient
- * @param rounder this value will be added to the sum of the two vectors
- * @param shift result will be shifted to right by this value
- * @param length vectors length
- *
- * @note It is safe to pass the same buffer for out and in_a or in_b.
- *
- *  out[i] = (in_a[i]*weight_a + in_b[i]*weight_b + rounder) >> shift
- */
-void ff_acelp_weighted_vector_sum(int16_t* out,
-                                  const int16_t *in_a,
-                                  const int16_t *in_b,
-                                  int16_t weight_coeff_a,
-                                  int16_t weight_coeff_b,
-                                  int16_t rounder,
-                                  int shift,
-                                  int length);
-
-/**
- * float implementation of weighted sum of two vectors.
- * @param[out] out result of addition
- * @param in_a first vector
- * @param in_b second vector
- * @param weight_coeff_a first vector weight coefficient
- * @param weight_coeff_a second vector weight coefficient
- * @param length vectors length
- *
- * @note It is safe to pass the same buffer for out and in_a or in_b.
- */
-void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b,
-                             float weight_coeff_a, float weight_coeff_b,
-                             int length);
-
-/**
- * Adaptive gain control (as used in AMR postfiltering)
- *
- * @param out output buffer for filtered speech data
- * @param in the input speech buffer (may be the same as out)
- * @param speech_energ input energy
- * @param size the input buffer size
- * @param alpha exponential filter factor
- * @param gain_mem a pointer to the filter memory (single float of size)
- */
-void ff_adaptive_gain_control(float *out, const float *in, float speech_energ,
-                              int size, float alpha, float *gain_mem);
-
-/**
- * Set the sum of squares of a signal by scaling
- *
- * @param out output samples
- * @param in input samples
- * @param sum_of_squares new sum of squares
- * @param n number of samples
- *
- * @note If the input is zero (or its energy underflows), the output is zero.
- *       This is the behavior of AGC in the AMR reference decoder. The QCELP
- *       reference decoder seems to have undefined behavior.
- *
- * TIA/EIA/IS-733 2.4.8.3-2/3/4/5, 2.4.8.6
- * 3GPP TS 26.090 6.1 (6)
- */
-void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in,
-                                             float sum_of_squares, const int n);
-
-/**
- * Add fixed vector to an array from a sparse representation
- *
- * @param out fixed vector with pitch sharpening
- * @param in sparse fixed vector
- * @param scale number to multiply the fixed vector by
- * @param size the output vector size
- */
-void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size);
-
-/**
- * Clear array values set by set_fixed_vector
- *
- * @param out fixed vector to be cleared
- * @param in sparse fixed vector
- * @param size the output vector size
- */
-void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size);
-
-#endif /* AVCODEC_ACELP_VECTORS_H */
diff --git a/deps/libav/libavcodec/adpcm.c b/deps/libav/libavcodec/adpcm.c
deleted file mode 100644
index c6bc4d0..0000000
--- a/deps/libav/libavcodec/adpcm.c
+++ /dev/null
@@ -1,1332 +0,0 @@
-/*
- * Copyright (c) 2001-2003 The ffmpeg Project
- *
- * first version by Francois Revol (revol at free.fr)
- * fringe ADPCM codecs (e.g., DK3, DK4, Westwood)
- *   by Mike Melanson (melanson at pcisys.net)
- * CD-ROM XA ADPCM codec by BERO
- * EA ADPCM decoder by Robin Kay (komadori at myrealbox.com)
- * EA ADPCM R1/R2/R3 decoder by Peter Ross (pross at xvid.org)
- * EA IMA EACS decoder by Peter Ross (pross at xvid.org)
- * EA IMA SEAD decoder by Peter Ross (pross at xvid.org)
- * EA ADPCM XAS decoder by Peter Ross (pross at xvid.org)
- * MAXIS EA ADPCM decoder by Robert Marston (rmarston at gmail.com)
- * THP ADPCM decoder by Marco Gerards (mgerards at xs4all.nl)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "bytestream.h"
-#include "adpcm.h"
-#include "adpcm_data.h"
-#include "internal.h"
-
-/**
- * @file
- * ADPCM decoders
- * Features and limitations:
- *
- * Reference documents:
- * http://wiki.multimedia.cx/index.php?title=Category:ADPCM_Audio_Codecs
- * http://www.pcisys.net/~melanson/codecs/simpleaudio.html [dead]
- * http://www.geocities.com/SiliconValley/8682/aud3.txt [dead]
- * http://openquicktime.sourceforge.net/
- * XAnim sources (xa_codec.c) http://xanim.polter.net/
- * http://www.cs.ucla.edu/~leec/mediabench/applications.html [dead]
- * SoX source code http://sox.sourceforge.net/
- *
- * CD-ROM XA:
- * http://ku-www.ss.titech.ac.jp/~yatsushi/xaadpcm.html [dead]
- * vagpack & depack http://homepages.compuserve.de/bITmASTER32/psx-index.html [dead]
- * readstr http://www.geocities.co.jp/Playtown/2004/
- */
-
-/* These are for CD-ROM XA ADPCM */
-static const int xa_adpcm_table[5][2] = {
-    {   0,   0 },
-    {  60,   0 },
-    { 115, -52 },
-    {  98, -55 },
-    { 122, -60 }
-};
-
-static const int ea_adpcm_table[] = {
-    0,  240,  460,  392,
-    0,    0, -208, -220,
-    0,    1,    3,    4,
-    7,    8,   10,   11,
-    0,   -1,   -3,   -4
-};
-
-// padded to zero where table size is less then 16
-static const int swf_index_tables[4][16] = {
-    /*2*/ { -1, 2 },
-    /*3*/ { -1, -1, 2, 4 },
-    /*4*/ { -1, -1, -1, -1, 2, 4, 6, 8 },
-    /*5*/ { -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16 }
-};
-
-/* end of tables */
-
-typedef struct ADPCMDecodeContext {
-    ADPCMChannelStatus status[6];
-    int vqa_version;                /**< VQA version. Used for ADPCM_IMA_WS */
-} ADPCMDecodeContext;
-
-static av_cold int adpcm_decode_init(AVCodecContext * avctx)
-{
-    ADPCMDecodeContext *c = avctx->priv_data;
-    unsigned int min_channels = 1;
-    unsigned int max_channels = 2;
-
-    switch(avctx->codec->id) {
-    case AV_CODEC_ID_ADPCM_EA:
-        min_channels = 2;
-        break;
-    case AV_CODEC_ID_ADPCM_EA_R1:
-    case AV_CODEC_ID_ADPCM_EA_R2:
-    case AV_CODEC_ID_ADPCM_EA_R3:
-    case AV_CODEC_ID_ADPCM_EA_XAS:
-        max_channels = 6;
-        break;
-    }
-    if (avctx->channels < min_channels || avctx->channels > max_channels) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
-        return AVERROR(EINVAL);
-    }
-
-    switch(avctx->codec->id) {
-    case AV_CODEC_ID_ADPCM_CT:
-        c->status[0].step = c->status[1].step = 511;
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_WAV:
-        if (avctx->bits_per_coded_sample != 4) {
-            av_log(avctx, AV_LOG_ERROR, "Only 4-bit ADPCM IMA WAV files are supported\n");
-            return -1;
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_APC:
-        if (avctx->extradata && avctx->extradata_size >= 8) {
-            c->status[0].predictor = AV_RL32(avctx->extradata);
-            c->status[1].predictor = AV_RL32(avctx->extradata + 4);
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_WS:
-        if (avctx->extradata && avctx->extradata_size >= 2)
-            c->vqa_version = AV_RL16(avctx->extradata);
-        break;
-    default:
-        break;
-    }
-
-    switch(avctx->codec->id) {
-        case AV_CODEC_ID_ADPCM_IMA_QT:
-        case AV_CODEC_ID_ADPCM_IMA_WAV:
-        case AV_CODEC_ID_ADPCM_4XM:
-        case AV_CODEC_ID_ADPCM_XA:
-        case AV_CODEC_ID_ADPCM_EA_R1:
-        case AV_CODEC_ID_ADPCM_EA_R2:
-        case AV_CODEC_ID_ADPCM_EA_R3:
-        case AV_CODEC_ID_ADPCM_EA_XAS:
-        case AV_CODEC_ID_ADPCM_THP:
-            avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-            break;
-        case AV_CODEC_ID_ADPCM_IMA_WS:
-            avctx->sample_fmt = c->vqa_version == 3 ? AV_SAMPLE_FMT_S16P :
-                                                      AV_SAMPLE_FMT_S16;
-            break;
-        default:
-            avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-    }
-
-    return 0;
-}
-
-static inline short adpcm_ima_expand_nibble(ADPCMChannelStatus *c, char nibble, int shift)
-{
-    int step_index;
-    int predictor;
-    int sign, delta, diff, step;
-
-    step = ff_adpcm_step_table[c->step_index];
-    step_index = c->step_index + ff_adpcm_index_table[(unsigned)nibble];
-    step_index = av_clip(step_index, 0, 88);
-
-    sign = nibble & 8;
-    delta = nibble & 7;
-    /* perform direct multiplication instead of series of jumps proposed by
-     * the reference ADPCM implementation since modern CPUs can do the mults
-     * quickly enough */
-    diff = ((2 * delta + 1) * step) >> shift;
-    predictor = c->predictor;
-    if (sign) predictor -= diff;
-    else predictor += diff;
-
-    c->predictor = av_clip_int16(predictor);
-    c->step_index = step_index;
-
-    return (short)c->predictor;
-}
-
-static inline int adpcm_ima_qt_expand_nibble(ADPCMChannelStatus *c, int nibble, int shift)
-{
-    int step_index;
-    int predictor;
-    int diff, step;
-
-    step = ff_adpcm_step_table[c->step_index];
-    step_index = c->step_index + ff_adpcm_index_table[nibble];
-    step_index = av_clip(step_index, 0, 88);
-
-    diff = step >> 3;
-    if (nibble & 4) diff += step;
-    if (nibble & 2) diff += step >> 1;
-    if (nibble & 1) diff += step >> 2;
-
-    if (nibble & 8)
-        predictor = c->predictor - diff;
-    else
-        predictor = c->predictor + diff;
-
-    c->predictor = av_clip_int16(predictor);
-    c->step_index = step_index;
-
-    return c->predictor;
-}
-
-static inline short adpcm_ms_expand_nibble(ADPCMChannelStatus *c, int nibble)
-{
-    int predictor;
-
-    predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 64;
-    predictor += ((nibble & 0x08)?(nibble - 0x10):(nibble)) * c->idelta;
-
-    c->sample2 = c->sample1;
-    c->sample1 = av_clip_int16(predictor);
-    c->idelta = (ff_adpcm_AdaptationTable[(int)nibble] * c->idelta) >> 8;
-    if (c->idelta < 16) c->idelta = 16;
-
-    return c->sample1;
-}
-
-static inline short adpcm_ct_expand_nibble(ADPCMChannelStatus *c, char nibble)
-{
-    int sign, delta, diff;
-    int new_step;
-
-    sign = nibble & 8;
-    delta = nibble & 7;
-    /* perform direct multiplication instead of series of jumps proposed by
-     * the reference ADPCM implementation since modern CPUs can do the mults
-     * quickly enough */
-    diff = ((2 * delta + 1) * c->step) >> 3;
-    /* predictor update is not so trivial: predictor is multiplied on 254/256 before updating */
-    c->predictor = ((c->predictor * 254) >> 8) + (sign ? -diff : diff);
-    c->predictor = av_clip_int16(c->predictor);
-    /* calculate new step and clamp it to range 511..32767 */
-    new_step = (ff_adpcm_AdaptationTable[nibble & 7] * c->step) >> 8;
-    c->step = av_clip(new_step, 511, 32767);
-
-    return (short)c->predictor;
-}
-
-static inline short adpcm_sbpro_expand_nibble(ADPCMChannelStatus *c, char nibble, int size, int shift)
-{
-    int sign, delta, diff;
-
-    sign = nibble & (1<<(size-1));
-    delta = nibble & ((1<<(size-1))-1);
-    diff = delta << (7 + c->step + shift);
-
-    /* clamp result */
-    c->predictor = av_clip(c->predictor + (sign ? -diff : diff), -16384,16256);
-
-    /* calculate new step */
-    if (delta >= (2*size - 3) && c->step < 3)
-        c->step++;
-    else if (delta == 0 && c->step > 0)
-        c->step--;
-
-    return (short) c->predictor;
-}
-
-static inline short adpcm_yamaha_expand_nibble(ADPCMChannelStatus *c, unsigned char nibble)
-{
-    if(!c->step) {
-        c->predictor = 0;
-        c->step = 127;
-    }
-
-    c->predictor += (c->step * ff_adpcm_yamaha_difflookup[nibble]) / 8;
-    c->predictor = av_clip_int16(c->predictor);
-    c->step = (c->step * ff_adpcm_yamaha_indexscale[nibble]) >> 8;
-    c->step = av_clip(c->step, 127, 24567);
-    return c->predictor;
-}
-
-static int xa_decode(AVCodecContext *avctx, int16_t *out0, int16_t *out1,
-                     const uint8_t *in, ADPCMChannelStatus *left,
-                     ADPCMChannelStatus *right, int channels, int sample_offset)
-{
-    int i, j;
-    int shift,filter,f0,f1;
-    int s_1,s_2;
-    int d,s,t;
-
-    out0 += sample_offset;
-    if (channels == 1)
-        out1 = out0 + 28;
-    else
-        out1 += sample_offset;
-
-    for(i=0;i<4;i++) {
-        shift  = 12 - (in[4+i*2] & 15);
-        filter = in[4+i*2] >> 4;
-        if (filter > 4) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid XA-ADPCM filter %d (max. allowed is 4)\n",
-                   filter);
-            return AVERROR_INVALIDDATA;
-        }
-        f0 = xa_adpcm_table[filter][0];
-        f1 = xa_adpcm_table[filter][1];
-
-        s_1 = left->sample1;
-        s_2 = left->sample2;
-
-        for(j=0;j<28;j++) {
-            d = in[16+i+j*4];
-
-            t = sign_extend(d, 4);
-            s = ( t<<shift ) + ((s_1*f0 + s_2*f1+32)>>6);
-            s_2 = s_1;
-            s_1 = av_clip_int16(s);
-            out0[j] = s_1;
-        }
-
-        if (channels == 2) {
-            left->sample1 = s_1;
-            left->sample2 = s_2;
-            s_1 = right->sample1;
-            s_2 = right->sample2;
-        }
-
-        shift  = 12 - (in[5+i*2] & 15);
-        filter = in[5+i*2] >> 4;
-        if (filter > 4) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid XA-ADPCM filter %d (max. allowed is 4)\n",
-                   filter);
-            return AVERROR_INVALIDDATA;
-        }
-        f0 = xa_adpcm_table[filter][0];
-        f1 = xa_adpcm_table[filter][1];
-
-        for(j=0;j<28;j++) {
-            d = in[16+i+j*4];
-
-            t = sign_extend(d >> 4, 4);
-            s = ( t<<shift ) + ((s_1*f0 + s_2*f1+32)>>6);
-            s_2 = s_1;
-            s_1 = av_clip_int16(s);
-            out1[j] = s_1;
-        }
-
-        if (channels == 2) {
-            right->sample1 = s_1;
-            right->sample2 = s_2;
-        } else {
-            left->sample1 = s_1;
-            left->sample2 = s_2;
-        }
-
-        out0 += 28 * (3 - channels);
-        out1 += 28 * (3 - channels);
-    }
-
-    return 0;
-}
-
-static void adpcm_swf_decode(AVCodecContext *avctx, const uint8_t *buf, int buf_size, int16_t *samples)
-{
-    ADPCMDecodeContext *c = avctx->priv_data;
-    GetBitContext gb;
-    const int *table;
-    int k0, signmask, nb_bits, count;
-    int size = buf_size*8;
-    int i;
-
-    init_get_bits(&gb, buf, size);
-
-    //read bits & initial values
-    nb_bits = get_bits(&gb, 2)+2;
-    table = swf_index_tables[nb_bits-2];
-    k0 = 1 << (nb_bits-2);
-    signmask = 1 << (nb_bits-1);
-
-    while (get_bits_count(&gb) <= size - 22*avctx->channels) {
-        for (i = 0; i < avctx->channels; i++) {
-            *samples++ = c->status[i].predictor = get_sbits(&gb, 16);
-            c->status[i].step_index = get_bits(&gb, 6);
-        }
-
-        for (count = 0; get_bits_count(&gb) <= size - nb_bits*avctx->channels && count < 4095; count++) {
-            int i;
-
-            for (i = 0; i < avctx->channels; i++) {
-                // similar to IMA adpcm
-                int delta = get_bits(&gb, nb_bits);
-                int step = ff_adpcm_step_table[c->status[i].step_index];
-                long vpdiff = 0; // vpdiff = (delta+0.5)*step/4
-                int k = k0;
-
-                do {
-                    if (delta & k)
-                        vpdiff += step;
-                    step >>= 1;
-                    k >>= 1;
-                } while(k);
-                vpdiff += step;
-
-                if (delta & signmask)
-                    c->status[i].predictor -= vpdiff;
-                else
-                    c->status[i].predictor += vpdiff;
-
-                c->status[i].step_index += table[delta & (~signmask)];
-
-                c->status[i].step_index = av_clip(c->status[i].step_index, 0, 88);
-                c->status[i].predictor = av_clip_int16(c->status[i].predictor);
-
-                *samples++ = c->status[i].predictor;
-            }
-        }
-    }
-}
-
-/**
- * Get the number of samples that will be decoded from the packet.
- * In one case, this is actually the maximum number of samples possible to
- * decode with the given buf_size.
- *
- * @param[out] coded_samples set to the number of samples as coded in the
- *                           packet, or 0 if the codec does not encode the
- *                           number of samples in each frame.
- */
-static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
-                          int buf_size, int *coded_samples)
-{
-    ADPCMDecodeContext *s = avctx->priv_data;
-    int nb_samples        = 0;
-    int ch                = avctx->channels;
-    int has_coded_samples = 0;
-    int header_size;
-
-    *coded_samples = 0;
-
-    switch (avctx->codec->id) {
-    /* constant, only check buf_size */
-    case AV_CODEC_ID_ADPCM_EA_XAS:
-        if (buf_size < 76 * ch)
-            return 0;
-        nb_samples = 128;
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_QT:
-        if (buf_size < 34 * ch)
-            return 0;
-        nb_samples = 64;
-        break;
-    /* simple 4-bit adpcm */
-    case AV_CODEC_ID_ADPCM_CT:
-    case AV_CODEC_ID_ADPCM_IMA_APC:
-    case AV_CODEC_ID_ADPCM_IMA_EA_SEAD:
-    case AV_CODEC_ID_ADPCM_IMA_WS:
-    case AV_CODEC_ID_ADPCM_YAMAHA:
-        nb_samples = buf_size * 2 / ch;
-        break;
-    }
-    if (nb_samples)
-        return nb_samples;
-
-    /* simple 4-bit adpcm, with header */
-    header_size = 0;
-    switch (avctx->codec->id) {
-        case AV_CODEC_ID_ADPCM_4XM:
-        case AV_CODEC_ID_ADPCM_IMA_ISS:     header_size = 4 * ch;      break;
-        case AV_CODEC_ID_ADPCM_IMA_AMV:     header_size = 8;           break;
-        case AV_CODEC_ID_ADPCM_IMA_SMJPEG:  header_size = 4;           break;
-    }
-    if (header_size > 0)
-        return (buf_size - header_size) * 2 / ch;
-
-    /* more complex formats */
-    switch (avctx->codec->id) {
-    case AV_CODEC_ID_ADPCM_EA:
-        has_coded_samples = 1;
-        *coded_samples  = bytestream2_get_le32(gb);
-        *coded_samples -= *coded_samples % 28;
-        nb_samples      = (buf_size - 12) / 30 * 28;
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_EA_EACS:
-        has_coded_samples = 1;
-        *coded_samples = bytestream2_get_le32(gb);
-        nb_samples     = (buf_size - (4 + 8 * ch)) * 2 / ch;
-        break;
-    case AV_CODEC_ID_ADPCM_EA_MAXIS_XA:
-        nb_samples = (buf_size - ch) / ch * 2;
-        break;
-    case AV_CODEC_ID_ADPCM_EA_R1:
-    case AV_CODEC_ID_ADPCM_EA_R2:
-    case AV_CODEC_ID_ADPCM_EA_R3:
-        /* maximum number of samples */
-        /* has internal offsets and a per-frame switch to signal raw 16-bit */
-        has_coded_samples = 1;
-        switch (avctx->codec->id) {
-        case AV_CODEC_ID_ADPCM_EA_R1:
-            header_size    = 4 + 9 * ch;
-            *coded_samples = bytestream2_get_le32(gb);
-            break;
-        case AV_CODEC_ID_ADPCM_EA_R2:
-            header_size    = 4 + 5 * ch;
-            *coded_samples = bytestream2_get_le32(gb);
-            break;
-        case AV_CODEC_ID_ADPCM_EA_R3:
-            header_size    = 4 + 5 * ch;
-            *coded_samples = bytestream2_get_be32(gb);
-            break;
-        }
-        *coded_samples -= *coded_samples % 28;
-        nb_samples      = (buf_size - header_size) * 2 / ch;
-        nb_samples     -= nb_samples % 28;
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_DK3:
-        if (avctx->block_align > 0)
-            buf_size = FFMIN(buf_size, avctx->block_align);
-        nb_samples = ((buf_size - 16) * 2 / 3 * 4) / ch;
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_DK4:
-        if (avctx->block_align > 0)
-            buf_size = FFMIN(buf_size, avctx->block_align);
-        nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch;
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_WAV:
-        if (avctx->block_align > 0)
-            buf_size = FFMIN(buf_size, avctx->block_align);
-        nb_samples = 1 + (buf_size - 4 * ch) / (4 * ch) * 8;
-        break;
-    case AV_CODEC_ID_ADPCM_MS:
-        if (avctx->block_align > 0)
-            buf_size = FFMIN(buf_size, avctx->block_align);
-        nb_samples = 2 + (buf_size - 7 * ch) * 2 / ch;
-        break;
-    case AV_CODEC_ID_ADPCM_SBPRO_2:
-    case AV_CODEC_ID_ADPCM_SBPRO_3:
-    case AV_CODEC_ID_ADPCM_SBPRO_4:
-    {
-        int samples_per_byte;
-        switch (avctx->codec->id) {
-        case AV_CODEC_ID_ADPCM_SBPRO_2: samples_per_byte = 4; break;
-        case AV_CODEC_ID_ADPCM_SBPRO_3: samples_per_byte = 3; break;
-        case AV_CODEC_ID_ADPCM_SBPRO_4: samples_per_byte = 2; break;
-        }
-        if (!s->status[0].step_index) {
-            nb_samples++;
-            buf_size -= ch;
-        }
-        nb_samples += buf_size * samples_per_byte / ch;
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_SWF:
-    {
-        int buf_bits       = buf_size * 8 - 2;
-        int nbits          = (bytestream2_get_byte(gb) >> 6) + 2;
-        int block_hdr_size = 22 * ch;
-        int block_size     = block_hdr_size + nbits * ch * 4095;
-        int nblocks        = buf_bits / block_size;
-        int bits_left      = buf_bits - nblocks * block_size;
-        nb_samples         = nblocks * 4096;
-        if (bits_left >= block_hdr_size)
-            nb_samples += 1 + (bits_left - block_hdr_size) / (nbits * ch);
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_THP:
-        has_coded_samples = 1;
-        bytestream2_skip(gb, 4); // channel size
-        *coded_samples  = bytestream2_get_be32(gb);
-        *coded_samples -= *coded_samples % 14;
-        nb_samples      = (buf_size - 80) / (8 * ch) * 14;
-        break;
-    case AV_CODEC_ID_ADPCM_XA:
-        nb_samples = (buf_size / 128) * 224 / ch;
-        break;
-    }
-
-    /* validate coded sample count */
-    if (has_coded_samples && (*coded_samples <= 0 || *coded_samples > nb_samples))
-        return AVERROR_INVALIDDATA;
-
-    return nb_samples;
-}
-
-static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
-                              int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    ADPCMDecodeContext *c = avctx->priv_data;
-    ADPCMChannelStatus *cs;
-    int n, m, channel, i;
-    short *samples;
-    int16_t **samples_p;
-    int st; /* stereo */
-    int count1, count2;
-    int nb_samples, coded_samples, ret;
-    GetByteContext gb;
-
-    bytestream2_init(&gb, buf, buf_size);
-    nb_samples = get_nb_samples(avctx, &gb, buf_size, &coded_samples);
-    if (nb_samples <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of samples in packet\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = nb_samples;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (short *)frame->data[0];
-    samples_p = (int16_t **)frame->extended_data;
-
-    /* use coded_samples when applicable */
-    /* it is always <= nb_samples, so the output buffer will be large enough */
-    if (coded_samples) {
-        if (coded_samples != nb_samples)
-            av_log(avctx, AV_LOG_WARNING, "mismatch in coded sample count\n");
-        frame->nb_samples = nb_samples = coded_samples;
-    }
-
-    st = avctx->channels == 2 ? 1 : 0;
-
-    switch(avctx->codec->id) {
-    case AV_CODEC_ID_ADPCM_IMA_QT:
-        /* In QuickTime, IMA is encoded by chunks of 34 bytes (=64 samples).
-           Channel data is interleaved per-chunk. */
-        for (channel = 0; channel < avctx->channels; channel++) {
-            int predictor;
-            int step_index;
-            cs = &(c->status[channel]);
-            /* (pppppp) (piiiiiii) */
-
-            /* Bits 15-7 are the _top_ 9 bits of the 16-bit initial predictor value */
-            predictor = sign_extend(bytestream2_get_be16u(&gb), 16);
-            step_index = predictor & 0x7F;
-            predictor &= ~0x7F;
-
-            if (cs->step_index == step_index) {
-                int diff = predictor - cs->predictor;
-                if (diff < 0)
-                    diff = - diff;
-                if (diff > 0x7f)
-                    goto update;
-            } else {
-            update:
-                cs->step_index = step_index;
-                cs->predictor = predictor;
-            }
-
-            if (cs->step_index > 88u){
-                av_log(avctx, AV_LOG_ERROR, "ERROR: step_index[%d] = %i\n",
-                       channel, cs->step_index);
-                return AVERROR_INVALIDDATA;
-            }
-
-            samples = samples_p[channel];
-
-            for (m = 0; m < 64; m += 2) {
-                int byte = bytestream2_get_byteu(&gb);
-                samples[m    ] = adpcm_ima_qt_expand_nibble(cs, byte & 0x0F, 3);
-                samples[m + 1] = adpcm_ima_qt_expand_nibble(cs, byte >> 4  , 3);
-            }
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_WAV:
-        for(i=0; i<avctx->channels; i++){
-            cs = &(c->status[i]);
-            cs->predictor = samples_p[i][0] = sign_extend(bytestream2_get_le16u(&gb), 16);
-
-            cs->step_index = sign_extend(bytestream2_get_le16u(&gb), 16);
-            if (cs->step_index > 88u){
-                av_log(avctx, AV_LOG_ERROR, "ERROR: step_index[%d] = %i\n",
-                       i, cs->step_index);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-
-        for (n = 0; n < (nb_samples - 1) / 8; n++) {
-            for (i = 0; i < avctx->channels; i++) {
-                cs = &c->status[i];
-                samples = &samples_p[i][1 + n * 8];
-                for (m = 0; m < 8; m += 2) {
-                    int v = bytestream2_get_byteu(&gb);
-                    samples[m    ] = adpcm_ima_expand_nibble(cs, v & 0x0F, 3);
-                    samples[m + 1] = adpcm_ima_expand_nibble(cs, v >> 4  , 3);
-                }
-            }
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_4XM:
-        for (i = 0; i < avctx->channels; i++)
-            c->status[i].predictor = sign_extend(bytestream2_get_le16u(&gb), 16);
-
-        for (i = 0; i < avctx->channels; i++) {
-            c->status[i].step_index = sign_extend(bytestream2_get_le16u(&gb), 16);
-            if (c->status[i].step_index > 88u) {
-                av_log(avctx, AV_LOG_ERROR, "ERROR: step_index[%d] = %i\n",
-                       i, c->status[i].step_index);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-
-        for (i = 0; i < avctx->channels; i++) {
-            samples = (int16_t *)frame->data[i];
-            cs = &c->status[i];
-            for (n = nb_samples >> 1; n > 0; n--) {
-                int v = bytestream2_get_byteu(&gb);
-                *samples++ = adpcm_ima_expand_nibble(cs, v & 0x0F, 4);
-                *samples++ = adpcm_ima_expand_nibble(cs, v >> 4  , 4);
-            }
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_MS:
-    {
-        int block_predictor;
-
-        block_predictor = bytestream2_get_byteu(&gb);
-        if (block_predictor > 6) {
-            av_log(avctx, AV_LOG_ERROR, "ERROR: block_predictor[0] = %d\n",
-                   block_predictor);
-            return AVERROR_INVALIDDATA;
-        }
-        c->status[0].coeff1 = ff_adpcm_AdaptCoeff1[block_predictor];
-        c->status[0].coeff2 = ff_adpcm_AdaptCoeff2[block_predictor];
-        if (st) {
-            block_predictor = bytestream2_get_byteu(&gb);
-            if (block_predictor > 6) {
-                av_log(avctx, AV_LOG_ERROR, "ERROR: block_predictor[1] = %d\n",
-                       block_predictor);
-                return AVERROR_INVALIDDATA;
-            }
-            c->status[1].coeff1 = ff_adpcm_AdaptCoeff1[block_predictor];
-            c->status[1].coeff2 = ff_adpcm_AdaptCoeff2[block_predictor];
-        }
-        c->status[0].idelta = sign_extend(bytestream2_get_le16u(&gb), 16);
-        if (st){
-            c->status[1].idelta = sign_extend(bytestream2_get_le16u(&gb), 16);
-        }
-
-        c->status[0].sample1 = sign_extend(bytestream2_get_le16u(&gb), 16);
-        if (st) c->status[1].sample1 = sign_extend(bytestream2_get_le16u(&gb), 16);
-        c->status[0].sample2 = sign_extend(bytestream2_get_le16u(&gb), 16);
-        if (st) c->status[1].sample2 = sign_extend(bytestream2_get_le16u(&gb), 16);
-
-        *samples++ = c->status[0].sample2;
-        if (st) *samples++ = c->status[1].sample2;
-        *samples++ = c->status[0].sample1;
-        if (st) *samples++ = c->status[1].sample1;
-        for(n = (nb_samples - 2) >> (1 - st); n > 0; n--) {
-            int byte = bytestream2_get_byteu(&gb);
-            *samples++ = adpcm_ms_expand_nibble(&c->status[0 ], byte >> 4  );
-            *samples++ = adpcm_ms_expand_nibble(&c->status[st], byte & 0x0F);
-        }
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_IMA_DK4:
-        for (channel = 0; channel < avctx->channels; channel++) {
-            cs = &c->status[channel];
-            cs->predictor  = *samples++ = sign_extend(bytestream2_get_le16u(&gb), 16);
-            cs->step_index = sign_extend(bytestream2_get_le16u(&gb), 16);
-            if (cs->step_index > 88u){
-                av_log(avctx, AV_LOG_ERROR, "ERROR: step_index[%d] = %i\n",
-                       channel, cs->step_index);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        for (n = (nb_samples >> (1 - st)) - 1; n > 0; n--) {
-            int v = bytestream2_get_byteu(&gb);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[0 ], v >> 4  , 3);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[st], v & 0x0F, 3);
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_DK3:
-    {
-        int last_byte = 0;
-        int nibble;
-        int decode_top_nibble_next = 0;
-        int diff_channel;
-        const int16_t *samples_end = samples + avctx->channels * nb_samples;
-
-        bytestream2_skipu(&gb, 10);
-        c->status[0].predictor  = sign_extend(bytestream2_get_le16u(&gb), 16);
-        c->status[1].predictor  = sign_extend(bytestream2_get_le16u(&gb), 16);
-        c->status[0].step_index = bytestream2_get_byteu(&gb);
-        c->status[1].step_index = bytestream2_get_byteu(&gb);
-        if (c->status[0].step_index > 88u || c->status[1].step_index > 88u){
-            av_log(avctx, AV_LOG_ERROR, "ERROR: step_index = %i/%i\n",
-                   c->status[0].step_index, c->status[1].step_index);
-            return AVERROR_INVALIDDATA;
-        }
-        /* sign extend the predictors */
-        diff_channel = c->status[1].predictor;
-
-        /* DK3 ADPCM support macro */
-#define DK3_GET_NEXT_NIBBLE() \
-    if (decode_top_nibble_next) { \
-        nibble = last_byte >> 4; \
-        decode_top_nibble_next = 0; \
-    } else { \
-        last_byte = bytestream2_get_byteu(&gb); \
-        nibble = last_byte & 0x0F; \
-        decode_top_nibble_next = 1; \
-    }
-
-        while (samples < samples_end) {
-
-            /* for this algorithm, c->status[0] is the sum channel and
-             * c->status[1] is the diff channel */
-
-            /* process the first predictor of the sum channel */
-            DK3_GET_NEXT_NIBBLE();
-            adpcm_ima_expand_nibble(&c->status[0], nibble, 3);
-
-            /* process the diff channel predictor */
-            DK3_GET_NEXT_NIBBLE();
-            adpcm_ima_expand_nibble(&c->status[1], nibble, 3);
-
-            /* process the first pair of stereo PCM samples */
-            diff_channel = (diff_channel + c->status[1].predictor) / 2;
-            *samples++ = c->status[0].predictor + c->status[1].predictor;
-            *samples++ = c->status[0].predictor - c->status[1].predictor;
-
-            /* process the second predictor of the sum channel */
-            DK3_GET_NEXT_NIBBLE();
-            adpcm_ima_expand_nibble(&c->status[0], nibble, 3);
-
-            /* process the second pair of stereo PCM samples */
-            diff_channel = (diff_channel + c->status[1].predictor) / 2;
-            *samples++ = c->status[0].predictor + c->status[1].predictor;
-            *samples++ = c->status[0].predictor - c->status[1].predictor;
-        }
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_IMA_ISS:
-        for (channel = 0; channel < avctx->channels; channel++) {
-            cs = &c->status[channel];
-            cs->predictor  = sign_extend(bytestream2_get_le16u(&gb), 16);
-            cs->step_index = sign_extend(bytestream2_get_le16u(&gb), 16);
-            if (cs->step_index > 88u){
-                av_log(avctx, AV_LOG_ERROR, "ERROR: step_index[%d] = %i\n",
-                       channel, cs->step_index);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-
-        for (n = nb_samples >> (1 - st); n > 0; n--) {
-            int v1, v2;
-            int v = bytestream2_get_byteu(&gb);
-            /* nibbles are swapped for mono */
-            if (st) {
-                v1 = v >> 4;
-                v2 = v & 0x0F;
-            } else {
-                v2 = v >> 4;
-                v1 = v & 0x0F;
-            }
-            *samples++ = adpcm_ima_expand_nibble(&c->status[0 ], v1, 3);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[st], v2, 3);
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_APC:
-        while (bytestream2_get_bytes_left(&gb) > 0) {
-            int v = bytestream2_get_byteu(&gb);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[0],  v >> 4  , 3);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[st], v & 0x0F, 3);
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_WS:
-        if (c->vqa_version == 3) {
-            for (channel = 0; channel < avctx->channels; channel++) {
-                int16_t *smp = samples_p[channel];
-
-                for (n = nb_samples / 2; n > 0; n--) {
-                    int v = bytestream2_get_byteu(&gb);
-                    *smp++ = adpcm_ima_expand_nibble(&c->status[channel], v >> 4  , 3);
-                    *smp++ = adpcm_ima_expand_nibble(&c->status[channel], v & 0x0F, 3);
-                }
-            }
-        } else {
-            for (n = nb_samples / 2; n > 0; n--) {
-                for (channel = 0; channel < avctx->channels; channel++) {
-                    int v = bytestream2_get_byteu(&gb);
-                    *samples++  = adpcm_ima_expand_nibble(&c->status[channel], v >> 4  , 3);
-                    samples[st] = adpcm_ima_expand_nibble(&c->status[channel], v & 0x0F, 3);
-                }
-                samples += avctx->channels;
-            }
-        }
-        bytestream2_seek(&gb, 0, SEEK_END);
-        break;
-    case AV_CODEC_ID_ADPCM_XA:
-    {
-        int16_t *out0 = samples_p[0];
-        int16_t *out1 = samples_p[1];
-        int samples_per_block = 28 * (3 - avctx->channels) * 4;
-        int sample_offset = 0;
-        while (bytestream2_get_bytes_left(&gb) >= 128) {
-            if ((ret = xa_decode(avctx, out0, out1, buf + bytestream2_tell(&gb),
-                                 &c->status[0], &c->status[1],
-                                 avctx->channels, sample_offset)) < 0)
-                return ret;
-            bytestream2_skipu(&gb, 128);
-            sample_offset += samples_per_block;
-        }
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_IMA_EA_EACS:
-        for (i=0; i<=st; i++) {
-            c->status[i].step_index = bytestream2_get_le32u(&gb);
-            if (c->status[i].step_index > 88u) {
-                av_log(avctx, AV_LOG_ERROR, "ERROR: step_index[%d] = %i\n",
-                       i, c->status[i].step_index);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        for (i=0; i<=st; i++)
-            c->status[i].predictor  = bytestream2_get_le32u(&gb);
-
-        for (n = nb_samples >> (1 - st); n > 0; n--) {
-            int byte   = bytestream2_get_byteu(&gb);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[0],  byte >> 4,   3);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[st], byte & 0x0F, 3);
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_EA_SEAD:
-        for (n = nb_samples >> (1 - st); n > 0; n--) {
-            int byte = bytestream2_get_byteu(&gb);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[0],  byte >> 4,   6);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[st], byte & 0x0F, 6);
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_EA:
-    {
-        int previous_left_sample, previous_right_sample;
-        int current_left_sample, current_right_sample;
-        int next_left_sample, next_right_sample;
-        int coeff1l, coeff2l, coeff1r, coeff2r;
-        int shift_left, shift_right;
-
-        /* Each EA ADPCM frame has a 12-byte header followed by 30-byte pieces,
-           each coding 28 stereo samples. */
-
-        current_left_sample   = sign_extend(bytestream2_get_le16u(&gb), 16);
-        previous_left_sample  = sign_extend(bytestream2_get_le16u(&gb), 16);
-        current_right_sample  = sign_extend(bytestream2_get_le16u(&gb), 16);
-        previous_right_sample = sign_extend(bytestream2_get_le16u(&gb), 16);
-
-        for (count1 = 0; count1 < nb_samples / 28; count1++) {
-            int byte = bytestream2_get_byteu(&gb);
-            coeff1l = ea_adpcm_table[ byte >> 4       ];
-            coeff2l = ea_adpcm_table[(byte >> 4  ) + 4];
-            coeff1r = ea_adpcm_table[ byte & 0x0F];
-            coeff2r = ea_adpcm_table[(byte & 0x0F) + 4];
-
-            byte = bytestream2_get_byteu(&gb);
-            shift_left  = 20 - (byte >> 4);
-            shift_right = 20 - (byte & 0x0F);
-
-            for (count2 = 0; count2 < 28; count2++) {
-                byte = bytestream2_get_byteu(&gb);
-                next_left_sample  = sign_extend(byte >> 4, 4) << shift_left;
-                next_right_sample = sign_extend(byte,      4) << shift_right;
-
-                next_left_sample = (next_left_sample +
-                    (current_left_sample * coeff1l) +
-                    (previous_left_sample * coeff2l) + 0x80) >> 8;
-                next_right_sample = (next_right_sample +
-                    (current_right_sample * coeff1r) +
-                    (previous_right_sample * coeff2r) + 0x80) >> 8;
-
-                previous_left_sample = current_left_sample;
-                current_left_sample = av_clip_int16(next_left_sample);
-                previous_right_sample = current_right_sample;
-                current_right_sample = av_clip_int16(next_right_sample);
-                *samples++ = current_left_sample;
-                *samples++ = current_right_sample;
-            }
-        }
-
-        bytestream2_skip(&gb, 2); // Skip terminating 0x0000
-
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_EA_MAXIS_XA:
-    {
-        int coeff[2][2], shift[2];
-
-        for(channel = 0; channel < avctx->channels; channel++) {
-            int byte = bytestream2_get_byteu(&gb);
-            for (i=0; i<2; i++)
-                coeff[channel][i] = ea_adpcm_table[(byte >> 4) + 4*i];
-            shift[channel] = 20 - (byte & 0x0F);
-        }
-        for (count1 = 0; count1 < nb_samples / 2; count1++) {
-            int byte[2];
-
-            byte[0] = bytestream2_get_byteu(&gb);
-            if (st) byte[1] = bytestream2_get_byteu(&gb);
-            for(i = 4; i >= 0; i-=4) { /* Pairwise samples LL RR (st) or LL LL (mono) */
-                for(channel = 0; channel < avctx->channels; channel++) {
-                    int sample = sign_extend(byte[channel] >> i, 4) << shift[channel];
-                    sample = (sample +
-                             c->status[channel].sample1 * coeff[channel][0] +
-                             c->status[channel].sample2 * coeff[channel][1] + 0x80) >> 8;
-                    c->status[channel].sample2 = c->status[channel].sample1;
-                    c->status[channel].sample1 = av_clip_int16(sample);
-                    *samples++ = c->status[channel].sample1;
-                }
-            }
-        }
-        bytestream2_seek(&gb, 0, SEEK_END);
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_EA_R1:
-    case AV_CODEC_ID_ADPCM_EA_R2:
-    case AV_CODEC_ID_ADPCM_EA_R3: {
-        /* channel numbering
-           2chan: 0=fl, 1=fr
-           4chan: 0=fl, 1=rl, 2=fr, 3=rr
-           6chan: 0=fl, 1=c,  2=fr, 3=rl,  4=rr, 5=sub */
-        const int big_endian = avctx->codec->id == AV_CODEC_ID_ADPCM_EA_R3;
-        int previous_sample, current_sample, next_sample;
-        int coeff1, coeff2;
-        int shift;
-        unsigned int channel;
-        uint16_t *samplesC;
-        int count = 0;
-        int offsets[6];
-
-        for (channel=0; channel<avctx->channels; channel++)
-            offsets[channel] = (big_endian ? bytestream2_get_be32(&gb) :
-                                             bytestream2_get_le32(&gb)) +
-                               (avctx->channels + 1) * 4;
-
-        for (channel=0; channel<avctx->channels; channel++) {
-            bytestream2_seek(&gb, offsets[channel], SEEK_SET);
-            samplesC = samples_p[channel];
-
-            if (avctx->codec->id == AV_CODEC_ID_ADPCM_EA_R1) {
-                current_sample  = sign_extend(bytestream2_get_le16(&gb), 16);
-                previous_sample = sign_extend(bytestream2_get_le16(&gb), 16);
-            } else {
-                current_sample  = c->status[channel].predictor;
-                previous_sample = c->status[channel].prev_sample;
-            }
-
-            for (count1 = 0; count1 < nb_samples / 28; count1++) {
-                int byte = bytestream2_get_byte(&gb);
-                if (byte == 0xEE) {  /* only seen in R2 and R3 */
-                    current_sample  = sign_extend(bytestream2_get_be16(&gb), 16);
-                    previous_sample = sign_extend(bytestream2_get_be16(&gb), 16);
-
-                    for (count2=0; count2<28; count2++)
-                        *samplesC++ = sign_extend(bytestream2_get_be16(&gb), 16);
-                } else {
-                    coeff1 = ea_adpcm_table[ byte >> 4     ];
-                    coeff2 = ea_adpcm_table[(byte >> 4) + 4];
-                    shift = 20 - (byte & 0x0F);
-
-                    for (count2=0; count2<28; count2++) {
-                        if (count2 & 1)
-                            next_sample = sign_extend(byte,    4) << shift;
-                        else {
-                            byte = bytestream2_get_byte(&gb);
-                            next_sample = sign_extend(byte >> 4, 4) << shift;
-                        }
-
-                        next_sample += (current_sample  * coeff1) +
-                                       (previous_sample * coeff2);
-                        next_sample = av_clip_int16(next_sample >> 8);
-
-                        previous_sample = current_sample;
-                        current_sample  = next_sample;
-                        *samplesC++ = current_sample;
-                    }
-                }
-            }
-            if (!count) {
-                count = count1;
-            } else if (count != count1) {
-                av_log(avctx, AV_LOG_WARNING, "per-channel sample count mismatch\n");
-                count = FFMAX(count, count1);
-            }
-
-            if (avctx->codec->id != AV_CODEC_ID_ADPCM_EA_R1) {
-                c->status[channel].predictor   = current_sample;
-                c->status[channel].prev_sample = previous_sample;
-            }
-        }
-
-        frame->nb_samples = count * 28;
-        bytestream2_seek(&gb, 0, SEEK_END);
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_EA_XAS:
-        for (channel=0; channel<avctx->channels; channel++) {
-            int coeff[2][4], shift[4];
-            int16_t *s = samples_p[channel];
-            for (n = 0; n < 4; n++, s += 32) {
-                int val = sign_extend(bytestream2_get_le16u(&gb), 16);
-                for (i=0; i<2; i++)
-                    coeff[i][n] = ea_adpcm_table[(val&0x0F)+4*i];
-                s[0] = val & ~0x0F;
-
-                val = sign_extend(bytestream2_get_le16u(&gb), 16);
-                shift[n] = 20 - (val & 0x0F);
-                s[1] = val & ~0x0F;
-            }
-
-            for (m=2; m<32; m+=2) {
-                s = &samples_p[channel][m];
-                for (n = 0; n < 4; n++, s += 32) {
-                    int level, pred;
-                    int byte = bytestream2_get_byteu(&gb);
-
-                    level = sign_extend(byte >> 4, 4) << shift[n];
-                    pred  = s[-1] * coeff[0][n] + s[-2] * coeff[1][n];
-                    s[0]  = av_clip_int16((level + pred + 0x80) >> 8);
-
-                    level = sign_extend(byte, 4) << shift[n];
-                    pred  = s[0] * coeff[0][n] + s[-1] * coeff[1][n];
-                    s[1]  = av_clip_int16((level + pred + 0x80) >> 8);
-                }
-            }
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_AMV:
-    case AV_CODEC_ID_ADPCM_IMA_SMJPEG:
-        if (avctx->codec->id == AV_CODEC_ID_ADPCM_IMA_AMV) {
-            c->status[0].predictor = sign_extend(bytestream2_get_le16u(&gb), 16);
-            c->status[0].step_index = bytestream2_get_le16u(&gb);
-            bytestream2_skipu(&gb, 4);
-        } else {
-            c->status[0].predictor = sign_extend(bytestream2_get_be16u(&gb), 16);
-            c->status[0].step_index = bytestream2_get_byteu(&gb);
-            bytestream2_skipu(&gb, 1);
-        }
-        if (c->status[0].step_index > 88u) {
-            av_log(avctx, AV_LOG_ERROR, "ERROR: step_index = %i\n",
-                   c->status[0].step_index);
-            return AVERROR_INVALIDDATA;
-        }
-
-        for (n = nb_samples >> (1 - st); n > 0; n--) {
-            int hi, lo, v = bytestream2_get_byteu(&gb);
-
-            if (avctx->codec->id == AV_CODEC_ID_ADPCM_IMA_AMV) {
-                hi = v & 0x0F;
-                lo = v >> 4;
-            } else {
-                lo = v & 0x0F;
-                hi = v >> 4;
-            }
-
-            *samples++ = adpcm_ima_expand_nibble(&c->status[0], lo, 3);
-            *samples++ = adpcm_ima_expand_nibble(&c->status[0], hi, 3);
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_CT:
-        for (n = nb_samples >> (1 - st); n > 0; n--) {
-            int v = bytestream2_get_byteu(&gb);
-            *samples++ = adpcm_ct_expand_nibble(&c->status[0 ], v >> 4  );
-            *samples++ = adpcm_ct_expand_nibble(&c->status[st], v & 0x0F);
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_SBPRO_4:
-    case AV_CODEC_ID_ADPCM_SBPRO_3:
-    case AV_CODEC_ID_ADPCM_SBPRO_2:
-        if (!c->status[0].step_index) {
-            /* the first byte is a raw sample */
-            *samples++ = 128 * (bytestream2_get_byteu(&gb) - 0x80);
-            if (st)
-                *samples++ = 128 * (bytestream2_get_byteu(&gb) - 0x80);
-            c->status[0].step_index = 1;
-            nb_samples--;
-        }
-        if (avctx->codec->id == AV_CODEC_ID_ADPCM_SBPRO_4) {
-            for (n = nb_samples >> (1 - st); n > 0; n--) {
-                int byte = bytestream2_get_byteu(&gb);
-                *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
-                                                       byte >> 4,   4, 0);
-                *samples++ = adpcm_sbpro_expand_nibble(&c->status[st],
-                                                       byte & 0x0F, 4, 0);
-            }
-        } else if (avctx->codec->id == AV_CODEC_ID_ADPCM_SBPRO_3) {
-            for (n = nb_samples / 3; n > 0; n--) {
-                int byte = bytestream2_get_byteu(&gb);
-                *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
-                                                        byte >> 5        , 3, 0);
-                *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
-                                                       (byte >> 2) & 0x07, 3, 0);
-                *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
-                                                        byte & 0x03,       2, 0);
-            }
-        } else {
-            for (n = nb_samples >> (2 - st); n > 0; n--) {
-                int byte = bytestream2_get_byteu(&gb);
-                *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
-                                                        byte >> 6        , 2, 2);
-                *samples++ = adpcm_sbpro_expand_nibble(&c->status[st],
-                                                       (byte >> 4) & 0x03, 2, 2);
-                *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
-                                                       (byte >> 2) & 0x03, 2, 2);
-                *samples++ = adpcm_sbpro_expand_nibble(&c->status[st],
-                                                        byte & 0x03,       2, 2);
-            }
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_SWF:
-        adpcm_swf_decode(avctx, buf, buf_size, samples);
-        bytestream2_seek(&gb, 0, SEEK_END);
-        break;
-    case AV_CODEC_ID_ADPCM_YAMAHA:
-        for (n = nb_samples >> (1 - st); n > 0; n--) {
-            int v = bytestream2_get_byteu(&gb);
-            *samples++ = adpcm_yamaha_expand_nibble(&c->status[0 ], v & 0x0F);
-            *samples++ = adpcm_yamaha_expand_nibble(&c->status[st], v >> 4  );
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_THP:
-    {
-        int table[2][16];
-        int prev[2][2];
-        int ch;
-
-        for (i = 0; i < 2; i++)
-            for (n = 0; n < 16; n++)
-                table[i][n] = sign_extend(bytestream2_get_be16u(&gb), 16);
-
-        /* Initialize the previous sample.  */
-        for (i = 0; i < 2; i++)
-            for (n = 0; n < 2; n++)
-                prev[i][n] = sign_extend(bytestream2_get_be16u(&gb), 16);
-
-        for (ch = 0; ch <= st; ch++) {
-            samples = samples_p[ch];
-
-            /* Read in every sample for this channel.  */
-            for (i = 0; i < nb_samples / 14; i++) {
-                int byte = bytestream2_get_byteu(&gb);
-                int index = (byte >> 4) & 7;
-                unsigned int exp = byte & 0x0F;
-                int factor1 = table[ch][index * 2];
-                int factor2 = table[ch][index * 2 + 1];
-
-                /* Decode 14 samples.  */
-                for (n = 0; n < 14; n++) {
-                    int32_t sampledat;
-
-                    if (n & 1) {
-                        sampledat = sign_extend(byte, 4);
-                    } else {
-                        byte = bytestream2_get_byteu(&gb);
-                        sampledat = sign_extend(byte >> 4, 4);
-                    }
-
-                    sampledat = ((prev[ch][0]*factor1
-                                + prev[ch][1]*factor2) >> 11) + (sampledat << exp);
-                    *samples = av_clip_int16(sampledat);
-                    prev[ch][1] = prev[ch][0];
-                    prev[ch][0] = *samples++;
-                }
-            }
-        }
-        break;
-    }
-
-    default:
-        return -1;
-    }
-
-    *got_frame_ptr = 1;
-
-    return bytestream2_tell(&gb);
-}
-
-
-static const enum AVSampleFormat sample_fmts_s16[]  = { AV_SAMPLE_FMT_S16,
-                                                        AV_SAMPLE_FMT_NONE };
-static const enum AVSampleFormat sample_fmts_s16p[] = { AV_SAMPLE_FMT_S16,
-                                                        AV_SAMPLE_FMT_NONE };
-static const enum AVSampleFormat sample_fmts_both[] = { AV_SAMPLE_FMT_S16,
-                                                        AV_SAMPLE_FMT_S16P,
-                                                        AV_SAMPLE_FMT_NONE };
-
-#define ADPCM_DECODER(id_, sample_fmts_, name_, long_name_) \
-AVCodec ff_ ## name_ ## _decoder = {                        \
-    .name           = #name_,                               \
-    .long_name      = NULL_IF_CONFIG_SMALL(long_name_),     \
-    .type           = AVMEDIA_TYPE_AUDIO,                   \
-    .id             = id_,                                  \
-    .priv_data_size = sizeof(ADPCMDecodeContext),           \
-    .init           = adpcm_decode_init,                    \
-    .decode         = adpcm_decode_frame,                   \
-    .capabilities   = CODEC_CAP_DR1,                        \
-    .sample_fmts    = sample_fmts_,                         \
-}
-
-/* Note: Do not forget to add new entries to the Makefile as well. */
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_4XM,         sample_fmts_s16p, adpcm_4xm,         "ADPCM 4X Movie");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_CT,          sample_fmts_s16,  adpcm_ct,          "ADPCM Creative Technology");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA,          sample_fmts_s16,  adpcm_ea,          "ADPCM Electronic Arts");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_MAXIS_XA, sample_fmts_s16,  adpcm_ea_maxis_xa, "ADPCM Electronic Arts Maxis CDROM XA");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R1,       sample_fmts_s16p, adpcm_ea_r1,       "ADPCM Electronic Arts R1");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R2,       sample_fmts_s16p, adpcm_ea_r2,       "ADPCM Electronic Arts R2");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R3,       sample_fmts_s16p, adpcm_ea_r3,       "ADPCM Electronic Arts R3");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_XAS,      sample_fmts_s16p, adpcm_ea_xas,      "ADPCM Electronic Arts XAS");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_AMV,     sample_fmts_s16,  adpcm_ima_amv,     "ADPCM IMA AMV");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_APC,     sample_fmts_s16,  adpcm_ima_apc,     "ADPCM IMA CRYO APC");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_DK3,     sample_fmts_s16,  adpcm_ima_dk3,     "ADPCM IMA Duck DK3");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_DK4,     sample_fmts_s16,  adpcm_ima_dk4,     "ADPCM IMA Duck DK4");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_EA_EACS, sample_fmts_s16,  adpcm_ima_ea_eacs, "ADPCM IMA Electronic Arts EACS");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_EA_SEAD, sample_fmts_s16,  adpcm_ima_ea_sead, "ADPCM IMA Electronic Arts SEAD");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_ISS,     sample_fmts_s16,  adpcm_ima_iss,     "ADPCM IMA Funcom ISS");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_QT,      sample_fmts_s16p, adpcm_ima_qt,      "ADPCM IMA QuickTime");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_SMJPEG,  sample_fmts_s16,  adpcm_ima_smjpeg,  "ADPCM IMA Loki SDL MJPEG");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_WAV,     sample_fmts_s16p, adpcm_ima_wav,     "ADPCM IMA WAV");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_WS,      sample_fmts_both, adpcm_ima_ws,      "ADPCM IMA Westwood");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_MS,          sample_fmts_s16,  adpcm_ms,          "ADPCM Microsoft");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_SBPRO_2,     sample_fmts_s16,  adpcm_sbpro_2,     "ADPCM Sound Blaster Pro 2-bit");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_SBPRO_3,     sample_fmts_s16,  adpcm_sbpro_3,     "ADPCM Sound Blaster Pro 2.6-bit");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_SBPRO_4,     sample_fmts_s16,  adpcm_sbpro_4,     "ADPCM Sound Blaster Pro 4-bit");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_SWF,         sample_fmts_s16,  adpcm_swf,         "ADPCM Shockwave Flash");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_THP,         sample_fmts_s16p, adpcm_thp,         "ADPCM Nintendo Gamecube THP");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_XA,          sample_fmts_s16p, adpcm_xa,          "ADPCM CDROM XA");
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_YAMAHA,      sample_fmts_s16,  adpcm_yamaha,      "ADPCM Yamaha");
diff --git a/deps/libav/libavcodec/adpcm.h b/deps/libav/libavcodec/adpcm.h
deleted file mode 100644
index 16facb6..0000000
--- a/deps/libav/libavcodec/adpcm.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2001-2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ADPCM encoder/decoder common header.
- */
-
-#ifndef AVCODEC_ADPCM_H
-#define AVCODEC_ADPCM_H
-
-#include <stdint.h>
-
-#define BLKSIZE 1024
-
-typedef struct ADPCMChannelStatus {
-    int predictor;
-    int16_t step_index;
-    int step;
-    /* for encoding */
-    int prev_sample;
-
-    /* MS version */
-    int16_t sample1;
-    int16_t sample2;
-    int coeff1;
-    int coeff2;
-    int idelta;
-} ADPCMChannelStatus;
-
-#endif /* AVCODEC_ADPCM_H */
diff --git a/deps/libav/libavcodec/adpcm_data.c b/deps/libav/libavcodec/adpcm_data.c
deleted file mode 100644
index 3bc5de2..0000000
--- a/deps/libav/libavcodec/adpcm_data.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2001-2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ADPCM tables
- */
-
-#include <stdint.h>
-
-/* ff_adpcm_step_table[] and ff_adpcm_index_table[] are from the ADPCM
-   reference source */
-/* This is the index table: */
-const int8_t ff_adpcm_index_table[16] = {
-    -1, -1, -1, -1, 2, 4, 6, 8,
-    -1, -1, -1, -1, 2, 4, 6, 8,
-};
-
-/**
- * This is the step table. Note that many programs use slight deviations from
- * this table, but such deviations are negligible:
- */
-const int16_t ff_adpcm_step_table[89] = {
-        7,     8,     9,    10,    11,    12,    13,    14,    16,    17,
-       19,    21,    23,    25,    28,    31,    34,    37,    41,    45,
-       50,    55,    60,    66,    73,    80,    88,    97,   107,   118,
-      130,   143,   157,   173,   190,   209,   230,   253,   279,   307,
-      337,   371,   408,   449,   494,   544,   598,   658,   724,   796,
-      876,   963,  1060,  1166,  1282,  1411,  1552,  1707,  1878,  2066,
-     2272,  2499,  2749,  3024,  3327,  3660,  4026,  4428,  4871,  5358,
-     5894,  6484,  7132,  7845,  8630,  9493, 10442, 11487, 12635, 13899,
-    15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
-};
-
-/* These are for MS-ADPCM */
-/* ff_adpcm_AdaptationTable[], ff_adpcm_AdaptCoeff1[], and
-   ff_adpcm_AdaptCoeff2[] are from libsndfile */
-const int16_t ff_adpcm_AdaptationTable[] = {
-    230, 230, 230, 230, 307, 409, 512, 614,
-    768, 614, 512, 409, 307, 230, 230, 230
-};
-
-/** Divided by 4 to fit in 8-bit integers */
-const uint8_t ff_adpcm_AdaptCoeff1[] = {
-    64, 128, 0, 48, 60, 115, 98
-};
-
-/** Divided by 4 to fit in 8-bit integers */
-const int8_t ff_adpcm_AdaptCoeff2[] = {
-    0, -64, 0, 16, 0, -52, -58
-};
-
-const int16_t ff_adpcm_yamaha_indexscale[] = {
-    230, 230, 230, 230, 307, 409, 512, 614,
-    230, 230, 230, 230, 307, 409, 512, 614
-};
-
-const int8_t ff_adpcm_yamaha_difflookup[] = {
-     1,  3,  5,  7,  9,  11,  13,  15,
-    -1, -3, -5, -7, -9, -11, -13, -15
-};
diff --git a/deps/libav/libavcodec/adpcm_data.h b/deps/libav/libavcodec/adpcm_data.h
deleted file mode 100644
index a46cb5b..0000000
--- a/deps/libav/libavcodec/adpcm_data.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2001-2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ADPCM tables
- */
-
-#ifndef AVCODEC_ADPCM_DATA_H
-#define AVCODEC_ADPCM_DATA_H
-
-#include <stdint.h>
-
-extern const int8_t  ff_adpcm_index_table[16];
-extern const int16_t ff_adpcm_step_table[89];
-extern const int16_t ff_adpcm_AdaptationTable[];
-extern const uint8_t ff_adpcm_AdaptCoeff1[];
-extern const int8_t  ff_adpcm_AdaptCoeff2[];
-extern const int16_t ff_adpcm_yamaha_indexscale[];
-extern const int8_t  ff_adpcm_yamaha_difflookup[];
-
-#endif /* AVCODEC_ADPCM_DATA_H */
diff --git a/deps/libav/libavcodec/adpcmenc.c b/deps/libav/libavcodec/adpcmenc.c
deleted file mode 100644
index fb3ce0d..0000000
--- a/deps/libav/libavcodec/adpcmenc.c
+++ /dev/null
@@ -1,725 +0,0 @@
-/*
- * Copyright (c) 2001-2003 The ffmpeg Project
- *
- * first version by Francois Revol (revol at free.fr)
- * fringe ADPCM codecs (e.g., DK3, DK4, Westwood)
- *   by Mike Melanson (melanson at pcisys.net)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "bytestream.h"
-#include "adpcm.h"
-#include "adpcm_data.h"
-#include "internal.h"
-
-/**
- * @file
- * ADPCM encoders
- * See ADPCM decoder reference documents for codec information.
- */
-
-typedef struct TrellisPath {
-    int nibble;
-    int prev;
-} TrellisPath;
-
-typedef struct TrellisNode {
-    uint32_t ssd;
-    int path;
-    int sample1;
-    int sample2;
-    int step;
-} TrellisNode;
-
-typedef struct ADPCMEncodeContext {
-    ADPCMChannelStatus status[6];
-    TrellisPath *paths;
-    TrellisNode *node_buf;
-    TrellisNode **nodep_buf;
-    uint8_t *trellis_hash;
-} ADPCMEncodeContext;
-
-#define FREEZE_INTERVAL 128
-
-static av_cold int adpcm_encode_init(AVCodecContext *avctx)
-{
-    ADPCMEncodeContext *s = avctx->priv_data;
-    uint8_t *extradata;
-    int i;
-    int ret = AVERROR(ENOMEM);
-
-    if (avctx->channels > 2) {
-        av_log(avctx, AV_LOG_ERROR, "only stereo or mono is supported\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (avctx->trellis && (unsigned)avctx->trellis > 16U) {
-        av_log(avctx, AV_LOG_ERROR, "invalid trellis size\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (avctx->trellis) {
-        int frontier  = 1 << avctx->trellis;
-        int max_paths =  frontier * FREEZE_INTERVAL;
-        FF_ALLOC_OR_GOTO(avctx, s->paths,
-                         max_paths * sizeof(*s->paths), error);
-        FF_ALLOC_OR_GOTO(avctx, s->node_buf,
-                         2 * frontier * sizeof(*s->node_buf),  error);
-        FF_ALLOC_OR_GOTO(avctx, s->nodep_buf,
-                         2 * frontier * sizeof(*s->nodep_buf), error);
-        FF_ALLOC_OR_GOTO(avctx, s->trellis_hash,
-                         65536 * sizeof(*s->trellis_hash), error);
-    }
-
-    avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
-
-    switch (avctx->codec->id) {
-    case AV_CODEC_ID_ADPCM_IMA_WAV:
-        /* each 16 bits sample gives one nibble
-           and we have 4 bytes per channel overhead */
-        avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 /
-                            (4 * avctx->channels) + 1;
-        /* seems frame_size isn't taken into account...
-           have to buffer the samples :-( */
-        avctx->block_align = BLKSIZE;
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_QT:
-        avctx->frame_size  = 64;
-        avctx->block_align = 34 * avctx->channels;
-        break;
-    case AV_CODEC_ID_ADPCM_MS:
-        /* each 16 bits sample gives one nibble
-           and we have 7 bytes per channel overhead */
-        avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 /
-                             avctx->channels + 2;
-        avctx->block_align    = BLKSIZE;
-        if (!(avctx->extradata = av_malloc(32 + FF_INPUT_BUFFER_PADDING_SIZE)))
-            goto error;
-        avctx->extradata_size = 32;
-        extradata = avctx->extradata;
-        bytestream_put_le16(&extradata, avctx->frame_size);
-        bytestream_put_le16(&extradata, 7); /* wNumCoef */
-        for (i = 0; i < 7; i++) {
-            bytestream_put_le16(&extradata, ff_adpcm_AdaptCoeff1[i] * 4);
-            bytestream_put_le16(&extradata, ff_adpcm_AdaptCoeff2[i] * 4);
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_YAMAHA:
-        avctx->frame_size  = BLKSIZE * 2 / avctx->channels;
-        avctx->block_align = BLKSIZE;
-        break;
-    case AV_CODEC_ID_ADPCM_SWF:
-        if (avctx->sample_rate != 11025 &&
-            avctx->sample_rate != 22050 &&
-            avctx->sample_rate != 44100) {
-            av_log(avctx, AV_LOG_ERROR, "Sample rate must be 11025, "
-                   "22050 or 44100\n");
-            ret = AVERROR(EINVAL);
-            goto error;
-        }
-        avctx->frame_size = 512 * (avctx->sample_rate / 11025);
-        break;
-    default:
-        ret = AVERROR(EINVAL);
-        goto error;
-    }
-
-    return 0;
-error:
-    av_freep(&s->paths);
-    av_freep(&s->node_buf);
-    av_freep(&s->nodep_buf);
-    av_freep(&s->trellis_hash);
-    return ret;
-}
-
-static av_cold int adpcm_encode_close(AVCodecContext *avctx)
-{
-    ADPCMEncodeContext *s = avctx->priv_data;
-    av_freep(&s->paths);
-    av_freep(&s->node_buf);
-    av_freep(&s->nodep_buf);
-    av_freep(&s->trellis_hash);
-
-    return 0;
-}
-
-
-static inline uint8_t adpcm_ima_compress_sample(ADPCMChannelStatus *c,
-                                                int16_t sample)
-{
-    int delta  = sample - c->prev_sample;
-    int nibble = FFMIN(7, abs(delta) * 4 /
-                       ff_adpcm_step_table[c->step_index]) + (delta < 0) * 8;
-    c->prev_sample += ((ff_adpcm_step_table[c->step_index] *
-                        ff_adpcm_yamaha_difflookup[nibble]) / 8);
-    c->prev_sample = av_clip_int16(c->prev_sample);
-    c->step_index  = av_clip(c->step_index + ff_adpcm_index_table[nibble], 0, 88);
-    return nibble;
-}
-
-static inline uint8_t adpcm_ima_qt_compress_sample(ADPCMChannelStatus *c,
-                                                   int16_t sample)
-{
-    int delta  = sample - c->prev_sample;
-    int mask, step = ff_adpcm_step_table[c->step_index];
-    int diff   = step >> 3;
-    int nibble = 0;
-
-    if (delta < 0) {
-        nibble = 8;
-        delta  = -delta;
-    }
-
-    for (mask = 4; mask;) {
-        if (delta >= step) {
-            nibble |= mask;
-            delta  -= step;
-            diff   += step;
-        }
-        step >>= 1;
-        mask >>= 1;
-    }
-
-    if (nibble & 8)
-        c->prev_sample -= diff;
-    else
-        c->prev_sample += diff;
-
-    c->prev_sample = av_clip_int16(c->prev_sample);
-    c->step_index  = av_clip(c->step_index + ff_adpcm_index_table[nibble], 0, 88);
-
-    return nibble;
-}
-
-static inline uint8_t adpcm_ms_compress_sample(ADPCMChannelStatus *c,
-                                               int16_t sample)
-{
-    int predictor, nibble, bias;
-
-    predictor = (((c->sample1) * (c->coeff1)) +
-                (( c->sample2) * (c->coeff2))) / 64;
-
-    nibble = sample - predictor;
-    if (nibble >= 0)
-        bias =  c->idelta / 2;
-    else
-        bias = -c->idelta / 2;
-
-    nibble = (nibble + bias) / c->idelta;
-    nibble = av_clip(nibble, -8, 7) & 0x0F;
-
-    predictor += ((nibble & 0x08) ? (nibble - 0x10) : nibble) * c->idelta;
-
-    c->sample2 = c->sample1;
-    c->sample1 = av_clip_int16(predictor);
-
-    c->idelta = (ff_adpcm_AdaptationTable[nibble] * c->idelta) >> 8;
-    if (c->idelta < 16)
-        c->idelta = 16;
-
-    return nibble;
-}
-
-static inline uint8_t adpcm_yamaha_compress_sample(ADPCMChannelStatus *c,
-                                                   int16_t sample)
-{
-    int nibble, delta;
-
-    if (!c->step) {
-        c->predictor = 0;
-        c->step      = 127;
-    }
-
-    delta = sample - c->predictor;
-
-    nibble = FFMIN(7, abs(delta) * 4 / c->step) + (delta < 0) * 8;
-
-    c->predictor += ((c->step * ff_adpcm_yamaha_difflookup[nibble]) / 8);
-    c->predictor = av_clip_int16(c->predictor);
-    c->step = (c->step * ff_adpcm_yamaha_indexscale[nibble]) >> 8;
-    c->step = av_clip(c->step, 127, 24567);
-
-    return nibble;
-}
-
-static void adpcm_compress_trellis(AVCodecContext *avctx,
-                                   const int16_t *samples, uint8_t *dst,
-                                   ADPCMChannelStatus *c, int n, int stride)
-{
-    //FIXME 6% faster if frontier is a compile-time constant
-    ADPCMEncodeContext *s = avctx->priv_data;
-    const int frontier = 1 << avctx->trellis;
-    const int version  = avctx->codec->id;
-    TrellisPath *paths       = s->paths, *p;
-    TrellisNode *node_buf    = s->node_buf;
-    TrellisNode **nodep_buf  = s->nodep_buf;
-    TrellisNode **nodes      = nodep_buf; // nodes[] is always sorted by .ssd
-    TrellisNode **nodes_next = nodep_buf + frontier;
-    int pathn = 0, froze = -1, i, j, k, generation = 0;
-    uint8_t *hash = s->trellis_hash;
-    memset(hash, 0xff, 65536 * sizeof(*hash));
-
-    memset(nodep_buf, 0, 2 * frontier * sizeof(*nodep_buf));
-    nodes[0]          = node_buf + frontier;
-    nodes[0]->ssd     = 0;
-    nodes[0]->path    = 0;
-    nodes[0]->step    = c->step_index;
-    nodes[0]->sample1 = c->sample1;
-    nodes[0]->sample2 = c->sample2;
-    if (version == AV_CODEC_ID_ADPCM_IMA_WAV ||
-        version == AV_CODEC_ID_ADPCM_IMA_QT  ||
-        version == AV_CODEC_ID_ADPCM_SWF)
-        nodes[0]->sample1 = c->prev_sample;
-    if (version == AV_CODEC_ID_ADPCM_MS)
-        nodes[0]->step = c->idelta;
-    if (version == AV_CODEC_ID_ADPCM_YAMAHA) {
-        if (c->step == 0) {
-            nodes[0]->step    = 127;
-            nodes[0]->sample1 = 0;
-        } else {
-            nodes[0]->step    = c->step;
-            nodes[0]->sample1 = c->predictor;
-        }
-    }
-
-    for (i = 0; i < n; i++) {
-        TrellisNode *t = node_buf + frontier*(i&1);
-        TrellisNode **u;
-        int sample   = samples[i * stride];
-        int heap_pos = 0;
-        memset(nodes_next, 0, frontier * sizeof(TrellisNode*));
-        for (j = 0; j < frontier && nodes[j]; j++) {
-            // higher j have higher ssd already, so they're likely
-            // to yield a suboptimal next sample too
-            const int range = (j < frontier / 2) ? 1 : 0;
-            const int step  = nodes[j]->step;
-            int nidx;
-            if (version == AV_CODEC_ID_ADPCM_MS) {
-                const int predictor = ((nodes[j]->sample1 * c->coeff1) +
-                                       (nodes[j]->sample2 * c->coeff2)) / 64;
-                const int div  = (sample - predictor) / step;
-                const int nmin = av_clip(div-range, -8, 6);
-                const int nmax = av_clip(div+range, -7, 7);
-                for (nidx = nmin; nidx <= nmax; nidx++) {
-                    const int nibble = nidx & 0xf;
-                    int dec_sample   = predictor + nidx * step;
-#define STORE_NODE(NAME, STEP_INDEX)\
-                    int d;\
-                    uint32_t ssd;\
-                    int pos;\
-                    TrellisNode *u;\
-                    uint8_t *h;\
-                    dec_sample = av_clip_int16(dec_sample);\
-                    d = sample - dec_sample;\
-                    ssd = nodes[j]->ssd + d*d;\
-                    /* Check for wraparound, skip such samples completely. \
-                     * Note, changing ssd to a 64 bit variable would be \
-                     * simpler, avoiding this check, but it's slower on \
-                     * x86 32 bit at the moment. */\
-                    if (ssd < nodes[j]->ssd)\
-                        goto next_##NAME;\
-                    /* Collapse any two states with the same previous sample value. \
-                     * One could also distinguish states by step and by 2nd to last
-                     * sample, but the effects of that are negligible.
-                     * Since nodes in the previous generation are iterated
-                     * through a heap, they're roughly ordered from better to
-                     * worse, but not strictly ordered. Therefore, an earlier
-                     * node with the same sample value is better in most cases
-                     * (and thus the current is skipped), but not strictly
-                     * in all cases. Only skipping samples where ssd >=
-                     * ssd of the earlier node with the same sample gives
-                     * slightly worse quality, though, for some reason. */ \
-                    h = &hash[(uint16_t) dec_sample];\
-                    if (*h == generation)\
-                        goto next_##NAME;\
-                    if (heap_pos < frontier) {\
-                        pos = heap_pos++;\
-                    } else {\
-                        /* Try to replace one of the leaf nodes with the new \
-                         * one, but try a different slot each time. */\
-                        pos = (frontier >> 1) +\
-                              (heap_pos & ((frontier >> 1) - 1));\
-                        if (ssd > nodes_next[pos]->ssd)\
-                            goto next_##NAME;\
-                        heap_pos++;\
-                    }\
-                    *h = generation;\
-                    u  = nodes_next[pos];\
-                    if (!u) {\
-                        assert(pathn < FREEZE_INTERVAL << avctx->trellis);\
-                        u = t++;\
-                        nodes_next[pos] = u;\
-                        u->path = pathn++;\
-                    }\
-                    u->ssd  = ssd;\
-                    u->step = STEP_INDEX;\
-                    u->sample2 = nodes[j]->sample1;\
-                    u->sample1 = dec_sample;\
-                    paths[u->path].nibble = nibble;\
-                    paths[u->path].prev   = nodes[j]->path;\
-                    /* Sift the newly inserted node up in the heap to \
-                     * restore the heap property. */\
-                    while (pos > 0) {\
-                        int parent = (pos - 1) >> 1;\
-                        if (nodes_next[parent]->ssd <= ssd)\
-                            break;\
-                        FFSWAP(TrellisNode*, nodes_next[parent], nodes_next[pos]);\
-                        pos = parent;\
-                    }\
-                    next_##NAME:;
-                    STORE_NODE(ms, FFMAX(16,
-                               (ff_adpcm_AdaptationTable[nibble] * step) >> 8));
-                }
-            } else if (version == AV_CODEC_ID_ADPCM_IMA_WAV ||
-                       version == AV_CODEC_ID_ADPCM_IMA_QT  ||
-                       version == AV_CODEC_ID_ADPCM_SWF) {
-#define LOOP_NODES(NAME, STEP_TABLE, STEP_INDEX)\
-                const int predictor = nodes[j]->sample1;\
-                const int div = (sample - predictor) * 4 / STEP_TABLE;\
-                int nmin = av_clip(div - range, -7, 6);\
-                int nmax = av_clip(div + range, -6, 7);\
-                if (nmin <= 0)\
-                    nmin--; /* distinguish -0 from +0 */\
-                if (nmax < 0)\
-                    nmax--;\
-                for (nidx = nmin; nidx <= nmax; nidx++) {\
-                    const int nibble = nidx < 0 ? 7 - nidx : nidx;\
-                    int dec_sample = predictor +\
-                                    (STEP_TABLE *\
-                                     ff_adpcm_yamaha_difflookup[nibble]) / 8;\
-                    STORE_NODE(NAME, STEP_INDEX);\
-                }
-                LOOP_NODES(ima, ff_adpcm_step_table[step],
-                           av_clip(step + ff_adpcm_index_table[nibble], 0, 88));
-            } else { //AV_CODEC_ID_ADPCM_YAMAHA
-                LOOP_NODES(yamaha, step,
-                           av_clip((step * ff_adpcm_yamaha_indexscale[nibble]) >> 8,
-                                   127, 24567));
-#undef LOOP_NODES
-#undef STORE_NODE
-            }
-        }
-
-        u = nodes;
-        nodes = nodes_next;
-        nodes_next = u;
-
-        generation++;
-        if (generation == 255) {
-            memset(hash, 0xff, 65536 * sizeof(*hash));
-            generation = 0;
-        }
-
-        // prevent overflow
-        if (nodes[0]->ssd > (1 << 28)) {
-            for (j = 1; j < frontier && nodes[j]; j++)
-                nodes[j]->ssd -= nodes[0]->ssd;
-            nodes[0]->ssd = 0;
-        }
-
-        // merge old paths to save memory
-        if (i == froze + FREEZE_INTERVAL) {
-            p = &paths[nodes[0]->path];
-            for (k = i; k > froze; k--) {
-                dst[k] = p->nibble;
-                p = &paths[p->prev];
-            }
-            froze = i;
-            pathn = 0;
-            // other nodes might use paths that don't coincide with the frozen one.
-            // checking which nodes do so is too slow, so just kill them all.
-            // this also slightly improves quality, but I don't know why.
-            memset(nodes + 1, 0, (frontier - 1) * sizeof(TrellisNode*));
-        }
-    }
-
-    p = &paths[nodes[0]->path];
-    for (i = n - 1; i > froze; i--) {
-        dst[i] = p->nibble;
-        p = &paths[p->prev];
-    }
-
-    c->predictor  = nodes[0]->sample1;
-    c->sample1    = nodes[0]->sample1;
-    c->sample2    = nodes[0]->sample2;
-    c->step_index = nodes[0]->step;
-    c->step       = nodes[0]->step;
-    c->idelta     = nodes[0]->step;
-}
-
-static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                              const AVFrame *frame, int *got_packet_ptr)
-{
-    int n, i, ch, st, pkt_size, ret;
-    const int16_t *samples;
-    int16_t **samples_p;
-    uint8_t *dst;
-    ADPCMEncodeContext *c = avctx->priv_data;
-    uint8_t *buf;
-
-    samples = (const int16_t *)frame->data[0];
-    samples_p = (int16_t **)frame->extended_data;
-    st = avctx->channels == 2;
-
-    if (avctx->codec_id == AV_CODEC_ID_ADPCM_SWF)
-        pkt_size = (2 + avctx->channels * (22 + 4 * (frame->nb_samples - 1)) + 7) / 8;
-    else
-        pkt_size = avctx->block_align;
-    if ((ret = ff_alloc_packet(avpkt, pkt_size))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-    dst = avpkt->data;
-
-    switch(avctx->codec->id) {
-    case AV_CODEC_ID_ADPCM_IMA_WAV:
-    {
-        int blocks, j;
-
-        blocks = (frame->nb_samples - 1) / 8;
-
-        for (ch = 0; ch < avctx->channels; ch++) {
-            ADPCMChannelStatus *status = &c->status[ch];
-            status->prev_sample = samples_p[ch][0];
-            /* status->step_index = 0;
-               XXX: not sure how to init the state machine */
-            bytestream_put_le16(&dst, status->prev_sample);
-            *dst++ = status->step_index;
-            *dst++ = 0; /* unknown */
-        }
-
-        /* stereo: 4 bytes (8 samples) for left, 4 bytes for right */
-        if (avctx->trellis > 0) {
-            FF_ALLOC_OR_GOTO(avctx, buf, avctx->channels * blocks * 8, error);
-            for (ch = 0; ch < avctx->channels; ch++) {
-                adpcm_compress_trellis(avctx, &samples_p[ch][1],
-                                       buf + ch * blocks * 8, &c->status[ch],
-                                       blocks * 8, 1);
-            }
-            for (i = 0; i < blocks; i++) {
-                for (ch = 0; ch < avctx->channels; ch++) {
-                    uint8_t *buf1 = buf + ch * blocks * 8 + i * 8;
-                    for (j = 0; j < 8; j += 2)
-                        *dst++ = buf1[j] | (buf1[j + 1] << 4);
-                }
-            }
-            av_free(buf);
-        } else {
-            for (i = 0; i < blocks; i++) {
-                for (ch = 0; ch < avctx->channels; ch++) {
-                    ADPCMChannelStatus *status = &c->status[ch];
-                    const int16_t *smp = &samples_p[ch][1 + i * 8];
-                    for (j = 0; j < 8; j += 2) {
-                        uint8_t v = adpcm_ima_compress_sample(status, smp[j    ]);
-                        v        |= adpcm_ima_compress_sample(status, smp[j + 1]) << 4;
-                        *dst++ = v;
-                    }
-                }
-            }
-        }
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_IMA_QT:
-    {
-        PutBitContext pb;
-        init_put_bits(&pb, dst, pkt_size * 8);
-
-        for (ch = 0; ch < avctx->channels; ch++) {
-            ADPCMChannelStatus *status = &c->status[ch];
-            put_bits(&pb, 9, (status->prev_sample & 0xFFFF) >> 7);
-            put_bits(&pb, 7,  status->step_index);
-            if (avctx->trellis > 0) {
-                uint8_t buf[64];
-                adpcm_compress_trellis(avctx, &samples_p[ch][1], buf, status,
-                                       64, 1);
-                for (i = 0; i < 64; i++)
-                    put_bits(&pb, 4, buf[i ^ 1]);
-            } else {
-                for (i = 0; i < 64; i += 2) {
-                    int t1, t2;
-                    t1 = adpcm_ima_qt_compress_sample(status, samples_p[ch][i    ]);
-                    t2 = adpcm_ima_qt_compress_sample(status, samples_p[ch][i + 1]);
-                    put_bits(&pb, 4, t2);
-                    put_bits(&pb, 4, t1);
-                }
-            }
-        }
-
-        flush_put_bits(&pb);
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_SWF:
-    {
-        PutBitContext pb;
-        init_put_bits(&pb, dst, pkt_size * 8);
-
-        n = frame->nb_samples - 1;
-
-        // store AdpcmCodeSize
-        put_bits(&pb, 2, 2);    // set 4-bit flash adpcm format
-
-        // init the encoder state
-        for (i = 0; i < avctx->channels; i++) {
-            // clip step so it fits 6 bits
-            c->status[i].step_index = av_clip(c->status[i].step_index, 0, 63);
-            put_sbits(&pb, 16, samples[i]);
-            put_bits(&pb, 6, c->status[i].step_index);
-            c->status[i].prev_sample = samples[i];
-        }
-
-        if (avctx->trellis > 0) {
-            FF_ALLOC_OR_GOTO(avctx, buf, 2 * n, error);
-            adpcm_compress_trellis(avctx, samples + avctx->channels, buf,
-                                   &c->status[0], n, avctx->channels);
-            if (avctx->channels == 2)
-                adpcm_compress_trellis(avctx, samples + avctx->channels + 1,
-                                       buf + n, &c->status[1], n,
-                                       avctx->channels);
-            for (i = 0; i < n; i++) {
-                put_bits(&pb, 4, buf[i]);
-                if (avctx->channels == 2)
-                    put_bits(&pb, 4, buf[n + i]);
-            }
-            av_free(buf);
-        } else {
-            for (i = 1; i < frame->nb_samples; i++) {
-                put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[0],
-                         samples[avctx->channels * i]));
-                if (avctx->channels == 2)
-                    put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[1],
-                             samples[2 * i + 1]));
-            }
-        }
-        flush_put_bits(&pb);
-        break;
-    }
-    case AV_CODEC_ID_ADPCM_MS:
-        for (i = 0; i < avctx->channels; i++) {
-            int predictor = 0;
-            *dst++ = predictor;
-            c->status[i].coeff1 = ff_adpcm_AdaptCoeff1[predictor];
-            c->status[i].coeff2 = ff_adpcm_AdaptCoeff2[predictor];
-        }
-        for (i = 0; i < avctx->channels; i++) {
-            if (c->status[i].idelta < 16)
-                c->status[i].idelta = 16;
-            bytestream_put_le16(&dst, c->status[i].idelta);
-        }
-        for (i = 0; i < avctx->channels; i++)
-            c->status[i].sample2= *samples++;
-        for (i = 0; i < avctx->channels; i++) {
-            c->status[i].sample1 = *samples++;
-            bytestream_put_le16(&dst, c->status[i].sample1);
-        }
-        for (i = 0; i < avctx->channels; i++)
-            bytestream_put_le16(&dst, c->status[i].sample2);
-
-        if (avctx->trellis > 0) {
-            n = avctx->block_align - 7 * avctx->channels;
-            FF_ALLOC_OR_GOTO(avctx, buf, 2 * n, error);
-            if (avctx->channels == 1) {
-                adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n,
-                                       avctx->channels);
-                for (i = 0; i < n; i += 2)
-                    *dst++ = (buf[i] << 4) | buf[i + 1];
-            } else {
-                adpcm_compress_trellis(avctx, samples,     buf,
-                                       &c->status[0], n, avctx->channels);
-                adpcm_compress_trellis(avctx, samples + 1, buf + n,
-                                       &c->status[1], n, avctx->channels);
-                for (i = 0; i < n; i++)
-                    *dst++ = (buf[i] << 4) | buf[n + i];
-            }
-            av_free(buf);
-        } else {
-            for (i = 7 * avctx->channels; i < avctx->block_align; i++) {
-                int nibble;
-                nibble  = adpcm_ms_compress_sample(&c->status[ 0], *samples++) << 4;
-                nibble |= adpcm_ms_compress_sample(&c->status[st], *samples++);
-                *dst++  = nibble;
-            }
-        }
-        break;
-    case AV_CODEC_ID_ADPCM_YAMAHA:
-        n = frame->nb_samples / 2;
-        if (avctx->trellis > 0) {
-            FF_ALLOC_OR_GOTO(avctx, buf, 2 * n * 2, error);
-            n *= 2;
-            if (avctx->channels == 1) {
-                adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n,
-                                       avctx->channels);
-                for (i = 0; i < n; i += 2)
-                    *dst++ = buf[i] | (buf[i + 1] << 4);
-            } else {
-                adpcm_compress_trellis(avctx, samples,     buf,
-                                       &c->status[0], n, avctx->channels);
-                adpcm_compress_trellis(avctx, samples + 1, buf + n,
-                                       &c->status[1], n, avctx->channels);
-                for (i = 0; i < n; i++)
-                    *dst++ = buf[i] | (buf[n + i] << 4);
-            }
-            av_free(buf);
-        } else
-            for (n *= avctx->channels; n > 0; n--) {
-                int nibble;
-                nibble  = adpcm_yamaha_compress_sample(&c->status[ 0], *samples++);
-                nibble |= adpcm_yamaha_compress_sample(&c->status[st], *samples++) << 4;
-                *dst++  = nibble;
-            }
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-
-    avpkt->size = pkt_size;
-    *got_packet_ptr = 1;
-    return 0;
-error:
-    return AVERROR(ENOMEM);
-}
-
-static const enum AVSampleFormat sample_fmts[] = {
-    AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
-};
-
-static const enum AVSampleFormat sample_fmts_p[] = {
-    AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE
-};
-
-#define ADPCM_ENCODER(id_, name_, sample_fmts_, long_name_) \
-AVCodec ff_ ## name_ ## _encoder = {                        \
-    .name           = #name_,                               \
-    .long_name      = NULL_IF_CONFIG_SMALL(long_name_),     \
-    .type           = AVMEDIA_TYPE_AUDIO,                   \
-    .id             = id_,                                  \
-    .priv_data_size = sizeof(ADPCMEncodeContext),           \
-    .init           = adpcm_encode_init,                    \
-    .encode2        = adpcm_encode_frame,                   \
-    .close          = adpcm_encode_close,                   \
-    .sample_fmts    = sample_fmts_,                         \
-}
-
-ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_QT,  adpcm_ima_qt,  sample_fmts_p, "ADPCM IMA QuickTime");
-ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav, sample_fmts_p, "ADPCM IMA WAV");
-ADPCM_ENCODER(AV_CODEC_ID_ADPCM_MS,      adpcm_ms,      sample_fmts,   "ADPCM Microsoft");
-ADPCM_ENCODER(AV_CODEC_ID_ADPCM_SWF,     adpcm_swf,     sample_fmts,   "ADPCM Shockwave Flash");
-ADPCM_ENCODER(AV_CODEC_ID_ADPCM_YAMAHA,  adpcm_yamaha,  sample_fmts,   "ADPCM Yamaha");
diff --git a/deps/libav/libavcodec/adx.c b/deps/libav/libavcodec/adx.c
deleted file mode 100644
index a9cf4ff..0000000
--- a/deps/libav/libavcodec/adx.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2011  Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "adx.h"
-
-void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff)
-{
-    double a, b, c;
-
-    a = M_SQRT2 - cos(2.0 * M_PI * cutoff / sample_rate);
-    b = M_SQRT2 - 1.0;
-    c = (a - sqrt((a + b) * (a - b))) / b;
-
-    coeff[0] = lrintf(c * 2.0  * (1 << bits));
-    coeff[1] = lrintf(-(c * c) * (1 << bits));
-}
-
-int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
-                             int bufsize, int *header_size, int *coeff)
-{
-    int offset, cutoff;
-
-    if (bufsize < 24)
-        return AVERROR_INVALIDDATA;
-
-    if (AV_RB16(buf) != 0x8000)
-        return AVERROR_INVALIDDATA;
-    offset = AV_RB16(buf + 2) + 4;
-
-    /* if copyright string is within the provided data, validate it */
-    if (bufsize >= offset && offset >= 6 && memcmp(buf + offset - 6, "(c)CRI", 6))
-        return AVERROR_INVALIDDATA;
-
-    /* check for encoding=3 block_size=18, sample_size=4 */
-    if (buf[4] != 3 || buf[5] != 18 || buf[6] != 4) {
-        avpriv_request_sample(avctx, "Support for this ADX format");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* channels */
-    avctx->channels = buf[7];
-    if (avctx->channels <= 0 || avctx->channels > 2)
-        return AVERROR_INVALIDDATA;
-
-    /* sample rate */
-    avctx->sample_rate = AV_RB32(buf + 8);
-    if (avctx->sample_rate < 1 ||
-        avctx->sample_rate > INT_MAX / (avctx->channels * BLOCK_SIZE * 8))
-        return AVERROR_INVALIDDATA;
-
-    /* bit rate */
-    avctx->bit_rate = avctx->sample_rate * avctx->channels * BLOCK_SIZE * 8 / BLOCK_SAMPLES;
-
-    /* LPC coefficients */
-    if (coeff) {
-        cutoff = AV_RB16(buf + 16);
-        ff_adx_calculate_coeffs(cutoff, avctx->sample_rate, COEFF_BITS, coeff);
-    }
-
-    *header_size = offset;
-    return 0;
-}
diff --git a/deps/libav/libavcodec/adx.h b/deps/libav/libavcodec/adx.h
deleted file mode 100644
index ff4c2d6..0000000
--- a/deps/libav/libavcodec/adx.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * ADX ADPCM codecs
- * Copyright (c) 2001,2003 BERO
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * SEGA CRI adx codecs.
- *
- * Reference documents:
- * http://ku-www.ss.titech.ac.jp/~yatsushi/adx.html
- * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/
- */
-
-#ifndef AVCODEC_ADX_H
-#define AVCODEC_ADX_H
-
-#include <stdint.h>
-
-#include "avcodec.h"
-
-typedef struct ADXChannelState {
-    int s1,s2;
-} ADXChannelState;
-
-typedef struct ADXContext {
-    int channels;
-    ADXChannelState prev[2];
-    int header_parsed;
-    int eof;
-    int cutoff;
-    int coeff[2];
-} ADXContext;
-
-#define COEFF_BITS  12
-
-#define BLOCK_SIZE      18
-#define BLOCK_SAMPLES   32
-
-/**
- * Calculate LPC coefficients based on cutoff frequency and sample rate.
- *
- * @param cutoff       cutoff frequency
- * @param sample_rate  sample rate
- * @param bits         number of bits used to quantize coefficients
- * @param[out] coeff   2 quantized LPC coefficients
- */
-void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff);
-
-/**
- * Decode ADX stream header.
- * Sets avctx->channels and avctx->sample_rate.
- *
- * @param      avctx        codec context
- * @param      buf          header data
- * @param      bufsize      data size, should be at least 24 bytes
- * @param[out] header_size  size of ADX header
- * @param[out] coeff        2 LPC coefficients, can be NULL
- * @return data offset or negative error code if header is invalid
- */
-int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
-                             int bufsize, int *header_size, int *coeff);
-
-#endif /* AVCODEC_ADX_H */
diff --git a/deps/libav/libavcodec/adx_parser.c b/deps/libav/libavcodec/adx_parser.c
deleted file mode 100644
index 706e242..0000000
--- a/deps/libav/libavcodec/adx_parser.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2011  Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ADX audio parser
- *
- * Splits packets into individual blocks.
- */
-
-#include "libavutil/intreadwrite.h"
-#include "parser.h"
-#include "adx.h"
-
-typedef struct ADXParseContext {
-    ParseContext pc;
-    int header_size;
-    int block_size;
-    int remaining;
-} ADXParseContext;
-
-static int adx_parse(AVCodecParserContext *s1,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
-{
-    ADXParseContext *s = s1->priv_data;
-    ParseContext *pc = &s->pc;
-    int next = END_NOT_FOUND;
-    int i;
-    uint64_t state = pc->state64;
-
-    if (!s->header_size) {
-        for (i = 0; i < buf_size; i++) {
-            state = (state << 8) | buf[i];
-            /* check for fixed fields in ADX header for possible match */
-            if ((state & 0xFFFF0000FFFFFF00) == 0x8000000003120400ULL) {
-                int channels    = state & 0xFF;
-                int header_size = ((state >> 32) & 0xFFFF) + 4;
-                if (channels > 0 && header_size >= 8) {
-                    s->header_size = header_size;
-                    s->block_size  = BLOCK_SIZE * channels;
-                    s->remaining   = i - 7 + s->header_size + s->block_size;
-                    break;
-                }
-            }
-        }
-        pc->state64 = state;
-    }
-
-    if (s->header_size) {
-        if (!s->remaining)
-            s->remaining = s->block_size;
-        if (s->remaining <= buf_size) {
-            next = s->remaining;
-            s->remaining = 0;
-        } else
-            s->remaining -= buf_size;
-    }
-
-    if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) {
-        *poutbuf      = NULL;
-        *poutbuf_size = 0;
-        return buf_size;
-    }
-
-    s1->duration = BLOCK_SAMPLES;
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_adx_parser = {
-    .codec_ids      = { AV_CODEC_ID_ADPCM_ADX },
-    .priv_data_size = sizeof(ADXParseContext),
-    .parser_parse   = adx_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/adxdec.c b/deps/libav/libavcodec/adxdec.c
deleted file mode 100644
index 17d5bec..0000000
--- a/deps/libav/libavcodec/adxdec.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * ADX ADPCM codecs
- * Copyright (c) 2001,2003 BERO
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "adx.h"
-#include "get_bits.h"
-#include "internal.h"
-
-/**
- * @file
- * SEGA CRI adx codecs.
- *
- * Reference documents:
- * http://ku-www.ss.titech.ac.jp/~yatsushi/adx.html
- * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/
- */
-
-static av_cold int adx_decode_init(AVCodecContext *avctx)
-{
-    ADXContext *c = avctx->priv_data;
-    int ret, header_size;
-
-    if (avctx->extradata_size >= 24) {
-        if ((ret = avpriv_adx_decode_header(avctx, avctx->extradata,
-                                            avctx->extradata_size, &header_size,
-                                            c->coeff)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "error parsing ADX header\n");
-            return AVERROR_INVALIDDATA;
-        }
-        c->channels      = avctx->channels;
-        c->header_parsed = 1;
-    }
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-
-    return 0;
-}
-
-/**
- * Decode 32 samples from 18 bytes.
- *
- * A 16-bit scalar value is applied to 32 residuals, which then have a
- * 2nd-order LPC filter applied to it to form the output signal for a single
- * channel.
- */
-static int adx_decode(ADXContext *c, int16_t *out, int offset,
-                      const uint8_t *in, int ch)
-{
-    ADXChannelState *prev = &c->prev[ch];
-    GetBitContext gb;
-    int scale = AV_RB16(in);
-    int i;
-    int s0, s1, s2, d;
-
-    /* check if this is an EOF packet */
-    if (scale & 0x8000)
-        return -1;
-
-    init_get_bits(&gb, in + 2, (BLOCK_SIZE - 2) * 8);
-    out += offset;
-    s1 = prev->s1;
-    s2 = prev->s2;
-    for (i = 0; i < BLOCK_SAMPLES; i++) {
-        d  = get_sbits(&gb, 4);
-        s0 = ((d << COEFF_BITS) * scale + c->coeff[0] * s1 + c->coeff[1] * s2) >> COEFF_BITS;
-        s2 = s1;
-        s1 = av_clip_int16(s0);
-        *out++ = s1;
-    }
-    prev->s1 = s1;
-    prev->s2 = s2;
-
-    return 0;
-}
-
-static int adx_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame      = data;
-    int buf_size        = avpkt->size;
-    ADXContext *c       = avctx->priv_data;
-    int16_t **samples;
-    int samples_offset;
-    const uint8_t *buf  = avpkt->data;
-    int num_blocks, ch, ret;
-
-    if (c->eof) {
-        *got_frame_ptr = 0;
-        return buf_size;
-    }
-
-    if (!c->header_parsed && buf_size >= 2 && AV_RB16(buf) == 0x8000) {
-        int header_size;
-        if ((ret = avpriv_adx_decode_header(avctx, buf, buf_size, &header_size,
-                                            c->coeff)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "error parsing ADX header\n");
-            return AVERROR_INVALIDDATA;
-        }
-        c->channels      = avctx->channels;
-        c->header_parsed = 1;
-        if (buf_size < header_size)
-            return AVERROR_INVALIDDATA;
-        buf      += header_size;
-        buf_size -= header_size;
-    }
-    if (!c->header_parsed)
-        return AVERROR_INVALIDDATA;
-
-    /* calculate number of blocks in the packet */
-    num_blocks = buf_size / (BLOCK_SIZE * c->channels);
-
-    /* if the packet is not an even multiple of BLOCK_SIZE, check for an EOF
-       packet */
-    if (!num_blocks || buf_size % (BLOCK_SIZE * avctx->channels)) {
-        if (buf_size >= 4 && (AV_RB16(buf) & 0x8000)) {
-            c->eof = 1;
-            *got_frame_ptr = 0;
-            return avpkt->size;
-        }
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = num_blocks * BLOCK_SAMPLES;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (int16_t **)frame->extended_data;
-    samples_offset = 0;
-
-    while (num_blocks--) {
-        for (ch = 0; ch < c->channels; ch++) {
-            if (adx_decode(c, samples[ch], samples_offset, buf, ch)) {
-                c->eof = 1;
-                buf = avpkt->data + avpkt->size;
-                break;
-            }
-            buf_size -= BLOCK_SIZE;
-            buf      += BLOCK_SIZE;
-        }
-        samples_offset += BLOCK_SAMPLES;
-    }
-
-    *got_frame_ptr = 1;
-
-    return buf - avpkt->data;
-}
-
-static void adx_decode_flush(AVCodecContext *avctx)
-{
-    ADXContext *c = avctx->priv_data;
-    memset(c->prev, 0, sizeof(c->prev));
-    c->eof = 0;
-}
-
-AVCodec ff_adpcm_adx_decoder = {
-    .name           = "adpcm_adx",
-    .long_name      = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ADPCM_ADX,
-    .priv_data_size = sizeof(ADXContext),
-    .init           = adx_decode_init,
-    .decode         = adx_decode_frame,
-    .flush          = adx_decode_flush,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/adxenc.c b/deps/libav/libavcodec/adxenc.c
deleted file mode 100644
index e730811..0000000
--- a/deps/libav/libavcodec/adxenc.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * ADX ADPCM codecs
- * Copyright (c) 2001,2003 BERO
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "adx.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "put_bits.h"
-
-/**
- * @file
- * SEGA CRI adx codecs.
- *
- * Reference documents:
- * http://ku-www.ss.titech.ac.jp/~yatsushi/adx.html
- * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/
- */
-
-static void adx_encode(ADXContext *c, uint8_t *adx, const int16_t *wav,
-                       ADXChannelState *prev, int channels)
-{
-    PutBitContext pb;
-    int scale;
-    int i, j;
-    int s0, s1, s2, d;
-    int max = 0;
-    int min = 0;
-    int data[BLOCK_SAMPLES];
-
-    s1 = prev->s1;
-    s2 = prev->s2;
-    for (i = 0, j = 0; j < 32; i += channels, j++) {
-        s0 = wav[i];
-        d = ((s0 << COEFF_BITS) - c->coeff[0] * s1 - c->coeff[1] * s2) >> COEFF_BITS;
-        data[j] = d;
-        if (max < d)
-            max = d;
-        if (min > d)
-            min = d;
-        s2 = s1;
-        s1 = s0;
-    }
-    prev->s1 = s1;
-    prev->s2 = s2;
-
-    if (max == 0 && min == 0) {
-        memset(adx, 0, BLOCK_SIZE);
-        return;
-    }
-
-    if (max / 7 > -min / 8)
-        scale = max / 7;
-    else
-        scale = -min / 8;
-
-    if (scale == 0)
-        scale = 1;
-
-    AV_WB16(adx, scale);
-
-    init_put_bits(&pb, adx + 2, 16);
-    for (i = 0; i < BLOCK_SAMPLES; i++)
-        put_sbits(&pb, 4, av_clip(data[i] / scale, -8, 7));
-    flush_put_bits(&pb);
-}
-
-#define HEADER_SIZE 36
-
-static int adx_encode_header(AVCodecContext *avctx, uint8_t *buf, int bufsize)
-{
-    ADXContext *c = avctx->priv_data;
-
-    bytestream_put_be16(&buf, 0x8000);              /* header signature */
-    bytestream_put_be16(&buf, HEADER_SIZE - 4);     /* copyright offset */
-    bytestream_put_byte(&buf, 3);                   /* encoding */
-    bytestream_put_byte(&buf, BLOCK_SIZE);          /* block size */
-    bytestream_put_byte(&buf, 4);                   /* sample size */
-    bytestream_put_byte(&buf, avctx->channels);     /* channels */
-    bytestream_put_be32(&buf, avctx->sample_rate);  /* sample rate */
-    bytestream_put_be32(&buf, 0);                   /* total sample count */
-    bytestream_put_be16(&buf, c->cutoff);           /* cutoff frequency */
-    bytestream_put_byte(&buf, 3);                   /* version */
-    bytestream_put_byte(&buf, 0);                   /* flags */
-    bytestream_put_be32(&buf, 0);                   /* unknown */
-    bytestream_put_be32(&buf, 0);                   /* loop enabled */
-    bytestream_put_be16(&buf, 0);                   /* padding */
-    bytestream_put_buffer(&buf, "(c)CRI", 6);       /* copyright signature */
-
-    return HEADER_SIZE;
-}
-
-static av_cold int adx_encode_init(AVCodecContext *avctx)
-{
-    ADXContext *c = avctx->priv_data;
-
-    if (avctx->channels > 2) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
-        return AVERROR(EINVAL);
-    }
-    avctx->frame_size = BLOCK_SAMPLES;
-
-    /* the cutoff can be adjusted, but this seems to work pretty well */
-    c->cutoff = 500;
-    ff_adx_calculate_coeffs(c->cutoff, avctx->sample_rate, COEFF_BITS, c->coeff);
-
-    return 0;
-}
-
-static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                            const AVFrame *frame, int *got_packet_ptr)
-{
-    ADXContext *c          = avctx->priv_data;
-    const int16_t *samples = (const int16_t *)frame->data[0];
-    uint8_t *dst;
-    int ch, out_size, ret;
-
-    out_size = BLOCK_SIZE * avctx->channels + !c->header_parsed * HEADER_SIZE;
-    if ((ret = ff_alloc_packet(avpkt, out_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-    dst = avpkt->data;
-
-    if (!c->header_parsed) {
-        int hdrsize;
-        if ((hdrsize = adx_encode_header(avctx, dst, avpkt->size)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n");
-            return AVERROR(EINVAL);
-        }
-        dst      += hdrsize;
-        c->header_parsed = 1;
-    }
-
-    for (ch = 0; ch < avctx->channels; ch++) {
-        adx_encode(c, dst, samples + ch, &c->prev[ch], avctx->channels);
-        dst += BLOCK_SIZE;
-    }
-
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-AVCodec ff_adpcm_adx_encoder = {
-    .name           = "adpcm_adx",
-    .long_name      = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ADPCM_ADX,
-    .priv_data_size = sizeof(ADXContext),
-    .init           = adx_encode_init,
-    .encode2        = adx_encode_frame,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/aic.c b/deps/libav/libavcodec/aic.c
deleted file mode 100644
index 5981dd8..0000000
--- a/deps/libav/libavcodec/aic.c
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * Apple Intermediate Codec decoder
- *
- * Copyright (c) 2013 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "golomb.h"
-#include "unary.h"
-
-#define AIC_HDR_SIZE    24
-#define AIC_BAND_COEFFS (64 + 32 + 192 + 96)
-
-enum AICBands {
-    COEFF_LUMA = 0,
-    COEFF_CHROMA,
-    COEFF_LUMA_EXT,
-    COEFF_CHROMA_EXT,
-    NUM_BANDS
-};
-
-static const int aic_num_band_coeffs[NUM_BANDS] = { 64, 32, 192, 96 };
-
-static const int aic_band_off[NUM_BANDS] = { 0, 64, 96, 288 };
-
-static const uint8_t aic_quant_matrix[64] = {
-     8, 16, 19, 22, 22, 26, 26, 27,
-    16, 16, 22, 22, 26, 27, 27, 29,
-    19, 22, 26, 26, 27, 29, 29, 35,
-    22, 24, 27, 27, 29, 32, 34, 38,
-    26, 27, 29, 29, 32, 35, 38, 46,
-    27, 29, 34, 34, 35, 40, 46, 56,
-    29, 34, 34, 37, 40, 48, 56, 69,
-    34, 37, 38, 40, 48, 58, 69, 83,
-};
-
-static const uint8_t aic_y_scan[64] = {
-     0,  4,  1,  2,  5,  8, 12,  9,
-     6,  3,  7, 10, 13, 14, 11, 15,
-    47, 43, 46, 45, 42, 39, 35, 38,
-    41, 44, 40, 37, 34, 33, 36, 32,
-    16, 20, 17, 18, 21, 24, 28, 25,
-    22, 19, 23, 26, 29, 30, 27, 31,
-    63, 59, 62, 61, 58, 55, 51, 54,
-    57, 60, 56, 53, 50, 49, 52, 48,
-};
-
-static const uint8_t aic_y_ext_scan[192] = {
-     64,  72,  65,  66,  73,  80,  88,  81,
-     74,  67,  75,  82,  89,  90,  83,  91,
-      0,   4,   1,   2,   5,   8,  12,   9,
-      6,   3,   7,  10,  13,  14,  11,  15,
-     16,  20,  17,  18,  21,  24,  28,  25,
-     22,  19,  23,  26,  29,  30,  27,  31,
-    155, 147, 154, 153, 146, 139, 131, 138,
-    145, 152, 144, 137, 130, 129, 136, 128,
-     47,  43,  46,  45,  42,  39,  35,  38,
-     41,  44,  40,  37,  34,  33,  36,  32,
-     63,  59,  62,  61,  58,  55,  51,  54,
-     57,  60,  56,  53,  50,  49,  52,  48,
-     96, 104,  97,  98, 105, 112, 120, 113,
-    106,  99, 107, 114, 121, 122, 115, 123,
-     68,  76,  69,  70,  77,  84,  92,  85,
-     78,  71,  79,  86,  93,  94,  87,  95,
-    100, 108, 101, 102, 109, 116, 124, 117,
-    110, 103, 111, 118, 125, 126, 119, 127,
-    187, 179, 186, 185, 178, 171, 163, 170,
-    177, 184, 176, 169, 162, 161, 168, 160,
-    159, 151, 158, 157, 150, 143, 135, 142,
-    149, 156, 148, 141, 134, 133, 140, 132,
-    191, 183, 190, 189, 182, 175, 167, 174,
-    181, 188, 180, 173, 166, 165, 172, 164,
-};
-
-static const uint8_t aic_c_scan[64] = {
-     0,  4,  1,  2,  5,  8, 12,  9,
-     6,  3,  7, 10, 13, 14, 11, 15,
-    31, 27, 30, 29, 26, 23, 19, 22,
-    25, 28, 24, 21, 18, 17, 20, 16,
-    32, 36, 33, 34, 37, 40, 44, 41,
-    38, 35, 39, 42, 45, 46, 43, 47,
-    63, 59, 62, 61, 58, 55, 51, 54,
-    57, 60, 56, 53, 50, 49, 52, 48,
-};
-
-static const uint8_t aic_c_ext_scan[192] = {
-     16,  24,  17,  18,  25,  32,  40,  33,
-     26,  19,  27,  34,  41,  42,  35,  43,
-      0,   4,   1,   2,   5,   8,  12,   9,
-      6,   3,   7,  10,  13,  14,  11,  15,
-     20,  28,  21,  22,  29,  36,  44,  37,
-     30,  23,  31,  38,  45,  46,  39,  47,
-     95,  87,  94,  93,  86,  79,  71,  78,
-     85,  92,  84,  77,  70,  69,  76,  68,
-     63,  59,  62,  61,  58,  55,  51,  54,
-     57,  60,  56,  53,  50,  49,  52,  48,
-     91,  83,  90,  89,  82,  75,  67,  74,
-     81,  88,  80,  73,  66,  65,  72,  64,
-    112, 120, 113, 114, 121, 128, 136, 129,
-    122, 115, 123, 130, 137, 138, 131, 139,
-     96, 100,  97,  98, 101, 104, 108, 105,
-    102,  99, 103, 106, 109, 110, 107, 111,
-    116, 124, 117, 118, 125, 132, 140, 133,
-    126, 119, 127, 134, 141, 142, 135, 143,
-    191, 183, 190, 189, 182, 175, 167, 174,
-    181, 188, 180, 173, 166, 165, 172, 164,
-    159, 155, 158, 157, 154, 151, 147, 150,
-    153, 156, 152, 149, 146, 145, 148, 144,
-    187, 179, 186, 185, 178, 171, 163, 170,
-    177, 184, 176, 169, 162, 161, 168, 160,
-};
-
-static const uint8_t *aic_scan[NUM_BANDS] = {
-    aic_y_scan, aic_c_scan, aic_y_ext_scan, aic_c_ext_scan
-};
-
-typedef struct AICContext {
-    AVCodecContext *avctx;
-    AVFrame        *frame;
-    DSPContext     dsp;
-    ScanTable      scantable;
-
-    int            num_x_slices;
-    int            slice_width;
-    int            mb_width, mb_height;
-    int            quant;
-    int            interlaced;
-
-    int16_t        *slice_data;
-    int16_t        *data_ptr[NUM_BANDS];
-
-    DECLARE_ALIGNED(16, int16_t, block)[64];
-} AICContext;
-
-static int aic_decode_header(AICContext *ctx, const uint8_t *src, int size)
-{
-    uint32_t frame_size;
-    int width, height;
-
-    if (src[0] != 1) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Invalid version %d\n", src[0]);
-        return AVERROR_INVALIDDATA;
-    }
-    if (src[1] != AIC_HDR_SIZE - 2) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Invalid header size %d\n", src[1]);
-        return AVERROR_INVALIDDATA;
-    }
-    frame_size = AV_RB32(src + 2);
-    width      = AV_RB16(src + 6);
-    height     = AV_RB16(src + 8);
-    if (frame_size > size) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Frame size should be %d got %d\n",
-               frame_size, size);
-        return AVERROR_INVALIDDATA;
-    }
-    if (width != ctx->avctx->width || height != ctx->avctx->height) {
-        av_log(ctx->avctx, AV_LOG_ERROR,
-               "Picture dimension changed: old: %d x %d, new: %d x %d\n",
-               ctx->avctx->width, ctx->avctx->height, width, height);
-        return AVERROR_INVALIDDATA;
-    }
-    ctx->quant      = src[15];
-    ctx->interlaced = ((src[16] >> 4) == 3);
-
-    return 0;
-}
-
-#define GET_CODE(val, type, add_bits)                         \
-    do {                                                      \
-        if (type)                                             \
-            val = get_ue_golomb(gb);                          \
-        else                                                  \
-            val = get_unary(gb, 1, 31);                       \
-        if (add_bits)                                         \
-            val = (val << add_bits) + get_bits(gb, add_bits); \
-    } while (0)
-
-static int aic_decode_coeffs(GetBitContext *gb, int16_t *dst,
-                             int band, int slice_width, int force_chroma)
-{
-    int has_skips, coeff_type, coeff_bits, skip_type, skip_bits;
-    const int num_coeffs = aic_num_band_coeffs[band];
-    const uint8_t *scan = aic_scan[band | force_chroma];
-    int mb, idx, val;
-
-    has_skips  = get_bits1(gb);
-    coeff_type = get_bits1(gb);
-    coeff_bits = get_bits(gb, 3);
-
-    if (has_skips) {
-        skip_type = get_bits1(gb);
-        skip_bits = get_bits(gb, 3);
-
-        for (mb = 0; mb < slice_width; mb++) {
-            idx = -1;
-            do {
-                GET_CODE(val, skip_type, skip_bits);
-                if (val < 0)
-                    return AVERROR_INVALIDDATA;
-                idx += val + 1;
-                if (idx >= num_coeffs)
-                    break;
-                GET_CODE(val, coeff_type, coeff_bits);
-                val++;
-                if (val >= 0x10000 || val < 0)
-                    return AVERROR_INVALIDDATA;
-                dst[scan[idx]] = val;
-            } while (idx < num_coeffs - 1);
-            dst += num_coeffs;
-        }
-    } else {
-        for (mb = 0; mb < slice_width; mb++) {
-            for (idx = 0; idx < num_coeffs; idx++) {
-                GET_CODE(val, coeff_type, coeff_bits);
-                if (val >= 0x10000 || val < 0)
-                    return AVERROR_INVALIDDATA;
-                dst[scan[idx]] = val;
-            }
-            dst += num_coeffs;
-        }
-    }
-    return 0;
-}
-
-static void recombine_block(int16_t *dst, const uint8_t *scan,
-                            int16_t **base, int16_t **ext)
-{
-    int i, j;
-
-    for (i = 0; i < 4; i++) {
-        for (j = 0; j < 4; j++)
-            dst[scan[i * 8 + j]]     = (*base)[j];
-        for (j = 0; j < 4; j++)
-            dst[scan[i * 8 + j + 4]] = (*ext)[j];
-        *base += 4;
-        *ext  += 4;
-    }
-    for (; i < 8; i++) {
-        for (j = 0; j < 8; j++)
-            dst[scan[i * 8 + j]] = (*ext)[j];
-        *ext  += 8;
-    }
-}
-
-static void recombine_block_il(int16_t *dst, const uint8_t *scan,
-                               int16_t **base, int16_t **ext,
-                               int block_no)
-{
-    int i, j;
-
-    if (block_no < 2) {
-        for (i = 0; i < 8; i++) {
-            for (j = 0; j < 4; j++)
-                dst[scan[i * 8 + j]]     = (*base)[j];
-            for (j = 0; j < 4; j++)
-                dst[scan[i * 8 + j + 4]] = (*ext)[j];
-            *base += 4;
-            *ext  += 4;
-        }
-    } else {
-        for (i = 0; i < 64; i++)
-            dst[scan[i]] = (*ext)[i];
-        *ext += 64;
-    }
-}
-
-static void unquant_block(int16_t *block, int q)
-{
-    int i;
-
-    for (i = 0; i < 64; i++) {
-        int val  = (uint16_t)block[i];
-        int sign = val & 1;
-
-        block[i] = (((val >> 1) ^ -sign) * q * aic_quant_matrix[i] >> 4)
-                   + sign;
-    }
-}
-
-static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
-                            const uint8_t *src, int src_size)
-{
-    GetBitContext gb;
-    int ret, i, mb, blk;
-    int slice_width = FFMIN(ctx->slice_width, ctx->mb_width - mb_x);
-    uint8_t *Y, *C[2];
-    uint8_t *dst;
-    int16_t *base_y = ctx->data_ptr[COEFF_LUMA];
-    int16_t *base_c = ctx->data_ptr[COEFF_CHROMA];
-    int16_t *ext_y  = ctx->data_ptr[COEFF_LUMA_EXT];
-    int16_t *ext_c  = ctx->data_ptr[COEFF_CHROMA_EXT];
-    const int ystride = ctx->frame->linesize[0];
-
-    Y = ctx->frame->data[0] + mb_x * 16 + mb_y * 16 * ystride;
-    for (i = 0; i < 2; i++)
-        C[i] = ctx->frame->data[i + 1] + mb_x * 8
-               + mb_y * 8 * ctx->frame->linesize[i + 1];
-    init_get_bits(&gb, src, src_size * 8);
-
-    memset(ctx->slice_data, 0,
-           sizeof(*ctx->slice_data) * slice_width * AIC_BAND_COEFFS);
-    for (i = 0; i < NUM_BANDS; i++)
-        if ((ret = aic_decode_coeffs(&gb, ctx->data_ptr[i],
-                                     i, slice_width,
-                                     !ctx->interlaced)) < 0)
-            return ret;
-
-    for (mb = 0; mb < slice_width; mb++) {
-        for (blk = 0; blk < 4; blk++) {
-            if (!ctx->interlaced)
-                recombine_block(ctx->block, ctx->scantable.permutated,
-                                &base_y, &ext_y);
-            else
-                recombine_block_il(ctx->block, ctx->scantable.permutated,
-                                   &base_y, &ext_y, blk);
-            unquant_block(ctx->block, ctx->quant);
-            ctx->dsp.idct(ctx->block);
-
-            if (!ctx->interlaced) {
-                dst = Y + (blk >> 1) * 8 * ystride + (blk & 1) * 8;
-                ctx->dsp.put_signed_pixels_clamped(ctx->block, dst,
-                                                   ystride);
-            } else {
-                dst = Y + (blk & 1) * 8 + (blk >> 1) * ystride;
-                ctx->dsp.put_signed_pixels_clamped(ctx->block, dst,
-                                                   ystride * 2);
-            }
-        }
-        Y += 16;
-
-        for (blk = 0; blk < 2; blk++) {
-            recombine_block(ctx->block, ctx->scantable.permutated,
-                            &base_c, &ext_c);
-            unquant_block(ctx->block, ctx->quant);
-            ctx->dsp.idct(ctx->block);
-            ctx->dsp.put_signed_pixels_clamped(ctx->block, C[blk],
-                                               ctx->frame->linesize[blk + 1]);
-            C[blk] += 8;
-        }
-    }
-
-    return 0;
-}
-
-static int aic_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    AICContext *ctx    = avctx->priv_data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    GetByteContext gb;
-    uint32_t off;
-    int x, y, ret;
-    int slice_size;
-
-    ctx->frame            = data;
-    ctx->frame->pict_type = AV_PICTURE_TYPE_I;
-    ctx->frame->key_frame = 1;
-
-    off = FFALIGN(AIC_HDR_SIZE + ctx->num_x_slices * ctx->mb_height * 2, 4);
-
-    if (buf_size < off) {
-        av_log(avctx, AV_LOG_ERROR, "Too small frame\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = aic_decode_header(ctx, buf, buf_size)) < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, ctx->frame, 0)) < 0)
-        return ret;
-
-    bytestream2_init(&gb, buf + AIC_HDR_SIZE,
-                     ctx->num_x_slices * ctx->mb_height * 2);
-
-    for (y = 0; y < ctx->mb_height; y++) {
-        for (x = 0; x < ctx->mb_width; x += ctx->slice_width) {
-            slice_size = bytestream2_get_le16(&gb) * 4;
-            if (slice_size + off > buf_size || !slice_size) {
-                av_log(avctx, AV_LOG_ERROR, "Incorrect slice size\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            if ((ret = aic_decode_slice(ctx, x, y,
-                                        buf + off, slice_size)) < 0)
-                return ret;
-
-            off += slice_size;
-        }
-    }
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int aic_decode_init(AVCodecContext *avctx)
-{
-    AICContext *ctx = avctx->priv_data;
-    int i;
-    uint8_t scan[64];
-
-    ctx->avctx = avctx;
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    ff_dsputil_init(&ctx->dsp, avctx);
-
-    for (i = 0; i < 64; i++)
-        scan[i] = i;
-    ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, scan);
-
-    ctx->mb_width  = FFALIGN(avctx->width,  16) >> 4;
-    ctx->mb_height = FFALIGN(avctx->height, 16) >> 4;
-
-    ctx->num_x_slices = 16;
-    ctx->slice_width  = ctx->mb_width / 16;
-    for (i = 1; i < 32; i++) {
-        if (!(ctx->mb_width % i) && (ctx->mb_width / i < 32)) {
-            ctx->slice_width  = ctx->mb_width / i;
-            ctx->num_x_slices = i;
-            break;
-        }
-    }
-
-    ctx->slice_data = av_malloc(ctx->slice_width * AIC_BAND_COEFFS
-                                * sizeof(*ctx->slice_data));
-    if (!ctx->slice_data) {
-        av_log(avctx, AV_LOG_ERROR, "Error allocating slice buffer\n");
-
-        return AVERROR(ENOMEM);
-    }
-
-    for (i = 0; i < NUM_BANDS; i++)
-        ctx->data_ptr[i] = ctx->slice_data + ctx->slice_width
-                                             * aic_band_off[i];
-
-    return 0;
-}
-
-static av_cold int aic_decode_close(AVCodecContext *avctx)
-{
-    AICContext *ctx = avctx->priv_data;
-
-    av_freep(&ctx->slice_data);
-
-    return 0;
-}
-
-AVCodec ff_aic_decoder = {
-    .name           = "aic",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple Intermediate Codec"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_AIC,
-    .priv_data_size = sizeof(AICContext),
-    .init           = aic_decode_init,
-    .close          = aic_decode_close,
-    .decode         = aic_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/alac.c b/deps/libav/libavcodec/alac.c
deleted file mode 100644
index f972531..0000000
--- a/deps/libav/libavcodec/alac.c
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * ALAC (Apple Lossless Audio Codec) decoder
- * Copyright (c) 2005 David Hammerton
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ALAC (Apple Lossless Audio Codec) decoder
- * @author 2005 David Hammerton
- * @see http://crazney.net/programs/itunes/alac.html
- *
- * Note: This decoder expects a 36-byte QuickTime atom to be
- * passed through the extradata[_size] fields. This atom is tacked onto
- * the end of an 'alac' stsd atom and has the following format:
- *
- * 32bit  atom size
- * 32bit  tag                  ("alac")
- * 32bit  tag version          (0)
- * 32bit  samples per frame    (used when not set explicitly in the frames)
- *  8bit  compatible version   (0)
- *  8bit  sample size
- *  8bit  history mult         (40)
- *  8bit  initial history      (14)
- *  8bit  rice param limit     (10)
- *  8bit  channels
- * 16bit  maxRun               (255)
- * 32bit  max coded frame size (0 means unknown)
- * 32bit  average bitrate      (0 means unknown)
- * 32bit  samplerate
- */
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "unary.h"
-#include "mathops.h"
-#include "alac_data.h"
-
-#define ALAC_EXTRADATA_SIZE 36
-
-typedef struct {
-    AVCodecContext *avctx;
-    GetBitContext gb;
-    int channels;
-
-    int32_t *predict_error_buffer[2];
-    int32_t *output_samples_buffer[2];
-    int32_t *extra_bits_buffer[2];
-
-    uint32_t max_samples_per_frame;
-    uint8_t  sample_size;
-    uint8_t  rice_history_mult;
-    uint8_t  rice_initial_history;
-    uint8_t  rice_limit;
-
-    int extra_bits;     /**< number of extra bits beyond 16-bit */
-    int nb_samples;     /**< number of samples in the current frame */
-} ALACContext;
-
-static inline unsigned int decode_scalar(GetBitContext *gb, int k, int bps)
-{
-    unsigned int x = get_unary_0_9(gb);
-
-    if (x > 8) { /* RICE THRESHOLD */
-        /* use alternative encoding */
-        x = get_bits_long(gb, bps);
-    } else if (k != 1) {
-        int extrabits = show_bits(gb, k);
-
-        /* multiply x by 2^k - 1, as part of their strange algorithm */
-        x = (x << k) - x;
-
-        if (extrabits > 1) {
-            x += extrabits - 1;
-            skip_bits(gb, k);
-        } else
-            skip_bits(gb, k - 1);
-    }
-    return x;
-}
-
-static void rice_decompress(ALACContext *alac, int32_t *output_buffer,
-                            int nb_samples, int bps, int rice_history_mult)
-{
-    int i;
-    unsigned int history = alac->rice_initial_history;
-    int sign_modifier = 0;
-
-    for (i = 0; i < nb_samples; i++) {
-        int k;
-        unsigned int x;
-
-        /* calculate rice param and decode next value */
-        k = av_log2((history >> 9) + 3);
-        k = FFMIN(k, alac->rice_limit);
-        x = decode_scalar(&alac->gb, k, bps);
-        x += sign_modifier;
-        sign_modifier = 0;
-        output_buffer[i] = (x >> 1) ^ -(x & 1);
-
-        /* update the history */
-        if (x > 0xffff)
-            history = 0xffff;
-        else
-            history +=         x * rice_history_mult -
-                       ((history * rice_history_mult) >> 9);
-
-        /* special case: there may be compressed blocks of 0 */
-        if ((history < 128) && (i + 1 < nb_samples)) {
-            int block_size;
-
-            /* calculate rice param and decode block size */
-            k = 7 - av_log2(history) + ((history + 16) >> 6);
-            k = FFMIN(k, alac->rice_limit);
-            block_size = decode_scalar(&alac->gb, k, 16);
-
-            if (block_size > 0) {
-                if (block_size >= nb_samples - i) {
-                    av_log(alac->avctx, AV_LOG_ERROR,
-                           "invalid zero block size of %d %d %d\n", block_size,
-                           nb_samples, i);
-                    block_size = nb_samples - i - 1;
-                }
-                memset(&output_buffer[i + 1], 0,
-                       block_size * sizeof(*output_buffer));
-                i += block_size;
-            }
-            if (block_size <= 0xffff)
-                sign_modifier = 1;
-            history = 0;
-        }
-    }
-}
-
-static inline int sign_only(int v)
-{
-    return v ? FFSIGN(v) : 0;
-}
-
-static void lpc_prediction(int32_t *error_buffer, int32_t *buffer_out,
-                           int nb_samples, int bps, int16_t *lpc_coefs,
-                           int lpc_order, int lpc_quant)
-{
-    int i;
-    int32_t *pred = buffer_out;
-
-    /* first sample always copies */
-    *buffer_out = *error_buffer;
-
-    if (nb_samples <= 1)
-        return;
-
-    if (!lpc_order) {
-        memcpy(&buffer_out[1], &error_buffer[1],
-               (nb_samples - 1) * sizeof(*buffer_out));
-        return;
-    }
-
-    if (lpc_order == 31) {
-        /* simple 1st-order prediction */
-        for (i = 1; i < nb_samples; i++) {
-            buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i],
-                                        bps);
-        }
-        return;
-    }
-
-    /* read warm-up samples */
-    for (i = 1; i <= lpc_order; i++)
-        buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i], bps);
-
-    /* NOTE: 4 and 8 are very common cases that could be optimized. */
-
-    for (; i < nb_samples; i++) {
-        int j;
-        int val = 0;
-        int error_val = error_buffer[i];
-        int error_sign;
-        int d = *pred++;
-
-        /* LPC prediction */
-        for (j = 0; j < lpc_order; j++)
-            val += (pred[j] - d) * lpc_coefs[j];
-        val = (val + (1 << (lpc_quant - 1))) >> lpc_quant;
-        val += d + error_val;
-        buffer_out[i] = sign_extend(val, bps);
-
-        /* adapt LPC coefficients */
-        error_sign = sign_only(error_val);
-        if (error_sign) {
-            for (j = 0; j < lpc_order && error_val * error_sign > 0; j++) {
-                int sign;
-                val  = d - pred[j];
-                sign = sign_only(val) * error_sign;
-                lpc_coefs[j] -= sign;
-                val *= sign;
-                error_val -= (val >> lpc_quant) * (j + 1);
-            }
-        }
-    }
-}
-
-static void decorrelate_stereo(int32_t *buffer[2], int nb_samples,
-                               int decorr_shift, int decorr_left_weight)
-{
-    int i;
-
-    for (i = 0; i < nb_samples; i++) {
-        int32_t a, b;
-
-        a = buffer[0][i];
-        b = buffer[1][i];
-
-        a -= (b * decorr_left_weight) >> decorr_shift;
-        b += a;
-
-        buffer[0][i] = b;
-        buffer[1][i] = a;
-    }
-}
-
-static void append_extra_bits(int32_t *buffer[2], int32_t *extra_bits_buffer[2],
-                              int extra_bits, int channels, int nb_samples)
-{
-    int i, ch;
-
-    for (ch = 0; ch < channels; ch++)
-        for (i = 0; i < nb_samples; i++)
-            buffer[ch][i] = (buffer[ch][i] << extra_bits) | extra_bits_buffer[ch][i];
-}
-
-static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
-                          int channels)
-{
-    ALACContext *alac = avctx->priv_data;
-    int has_size, bps, is_compressed, decorr_shift, decorr_left_weight, ret;
-    uint32_t output_samples;
-    int i, ch;
-
-    skip_bits(&alac->gb, 4);  /* element instance tag */
-    skip_bits(&alac->gb, 12); /* unused header bits */
-
-    /* the number of output samples is stored in the frame */
-    has_size = get_bits1(&alac->gb);
-
-    alac->extra_bits = get_bits(&alac->gb, 2) << 3;
-    bps = alac->sample_size - alac->extra_bits + channels - 1;
-    if (bps > 32) {
-        av_log(avctx, AV_LOG_ERROR, "bps is unsupported: %d\n", bps);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* whether the frame is compressed */
-    is_compressed = !get_bits1(&alac->gb);
-
-    if (has_size)
-        output_samples = get_bits_long(&alac->gb, 32);
-    else
-        output_samples = alac->max_samples_per_frame;
-    if (!output_samples || output_samples > alac->max_samples_per_frame) {
-        av_log(avctx, AV_LOG_ERROR, "invalid samples per frame: %d\n",
-               output_samples);
-        return AVERROR_INVALIDDATA;
-    }
-    if (!alac->nb_samples) {
-        /* get output buffer */
-        frame->nb_samples = output_samples;
-        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-    } else if (output_samples != alac->nb_samples) {
-        av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %u != %d\n",
-               output_samples, alac->nb_samples);
-        return AVERROR_INVALIDDATA;
-    }
-    alac->nb_samples = output_samples;
-    if (alac->sample_size > 16) {
-        for (ch = 0; ch < channels; ch++)
-            alac->output_samples_buffer[ch] = (int32_t *)frame->extended_data[ch_index + ch];
-    }
-
-    if (is_compressed) {
-        int16_t lpc_coefs[2][32];
-        int lpc_order[2];
-        int prediction_type[2];
-        int lpc_quant[2];
-        int rice_history_mult[2];
-
-        decorr_shift       = get_bits(&alac->gb, 8);
-        decorr_left_weight = get_bits(&alac->gb, 8);
-
-        for (ch = 0; ch < channels; ch++) {
-            prediction_type[ch]   = get_bits(&alac->gb, 4);
-            lpc_quant[ch]         = get_bits(&alac->gb, 4);
-            rice_history_mult[ch] = get_bits(&alac->gb, 3);
-            lpc_order[ch]         = get_bits(&alac->gb, 5);
-
-            if (lpc_order[ch] >= alac->max_samples_per_frame)
-                return AVERROR_INVALIDDATA;
-
-            /* read the predictor table */
-            for (i = lpc_order[ch] - 1; i >= 0; i--)
-                lpc_coefs[ch][i] = get_sbits(&alac->gb, 16);
-        }
-
-        if (alac->extra_bits) {
-            for (i = 0; i < alac->nb_samples; i++) {
-                for (ch = 0; ch < channels; ch++)
-                    alac->extra_bits_buffer[ch][i] = get_bits(&alac->gb, alac->extra_bits);
-            }
-        }
-        for (ch = 0; ch < channels; ch++) {
-            rice_decompress(alac, alac->predict_error_buffer[ch],
-                            alac->nb_samples, bps,
-                            rice_history_mult[ch] * alac->rice_history_mult / 4);
-
-            /* adaptive FIR filter */
-            if (prediction_type[ch] == 15) {
-                /* Prediction type 15 runs the adaptive FIR twice.
-                 * The first pass uses the special-case coef_num = 31, while
-                 * the second pass uses the coefs from the bitstream.
-                 *
-                 * However, this prediction type is not currently used by the
-                 * reference encoder.
-                 */
-                lpc_prediction(alac->predict_error_buffer[ch],
-                               alac->predict_error_buffer[ch],
-                               alac->nb_samples, bps, NULL, 31, 0);
-            } else if (prediction_type[ch] > 0) {
-                av_log(avctx, AV_LOG_WARNING, "unknown prediction type: %i\n",
-                       prediction_type[ch]);
-            }
-            lpc_prediction(alac->predict_error_buffer[ch],
-                           alac->output_samples_buffer[ch], alac->nb_samples,
-                           bps, lpc_coefs[ch], lpc_order[ch], lpc_quant[ch]);
-        }
-    } else {
-        /* not compressed, easy case */
-        for (i = 0; i < alac->nb_samples; i++) {
-            for (ch = 0; ch < channels; ch++) {
-                alac->output_samples_buffer[ch][i] =
-                         get_sbits_long(&alac->gb, alac->sample_size);
-            }
-        }
-        alac->extra_bits   = 0;
-        decorr_shift       = 0;
-        decorr_left_weight = 0;
-    }
-
-    if (channels == 2 && decorr_left_weight) {
-        decorrelate_stereo(alac->output_samples_buffer, alac->nb_samples,
-                           decorr_shift, decorr_left_weight);
-    }
-
-    if (alac->extra_bits) {
-        append_extra_bits(alac->output_samples_buffer, alac->extra_bits_buffer,
-                          alac->extra_bits, channels, alac->nb_samples);
-    }
-
-    switch(alac->sample_size) {
-    case 16: {
-        for (ch = 0; ch < channels; ch++) {
-            int16_t *outbuffer = (int16_t *)frame->extended_data[ch_index + ch];
-            for (i = 0; i < alac->nb_samples; i++)
-                *outbuffer++ = alac->output_samples_buffer[ch][i];
-        }}
-        break;
-    case 24: {
-        for (ch = 0; ch < channels; ch++) {
-            for (i = 0; i < alac->nb_samples; i++)
-                alac->output_samples_buffer[ch][i] <<= 8;
-        }}
-        break;
-    }
-
-    return 0;
-}
-
-static int alac_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    ALACContext *alac = avctx->priv_data;
-    AVFrame *frame    = data;
-    enum AlacRawDataBlockType element;
-    int channels;
-    int ch, ret, got_end;
-
-    init_get_bits(&alac->gb, avpkt->data, avpkt->size * 8);
-
-    got_end = 0;
-    alac->nb_samples = 0;
-    ch = 0;
-    while (get_bits_left(&alac->gb) >= 3) {
-        element = get_bits(&alac->gb, 3);
-        if (element == TYPE_END) {
-            got_end = 1;
-            break;
-        }
-        if (element > TYPE_CPE && element != TYPE_LFE) {
-            av_log(avctx, AV_LOG_ERROR, "syntax element unsupported: %d", element);
-            return AVERROR_PATCHWELCOME;
-        }
-
-        channels = (element == TYPE_CPE) ? 2 : 1;
-        if (ch + channels > alac->channels ||
-            ff_alac_channel_layout_offsets[alac->channels - 1][ch] + channels > alac->channels) {
-            av_log(avctx, AV_LOG_ERROR, "invalid element channel count\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        ret = decode_element(avctx, frame,
-                             ff_alac_channel_layout_offsets[alac->channels - 1][ch],
-                             channels);
-        if (ret < 0 && get_bits_left(&alac->gb))
-            return ret;
-
-        ch += channels;
-    }
-    if (!got_end) {
-        av_log(avctx, AV_LOG_ERROR, "no end tag found. incomplete packet.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avpkt->size * 8 - get_bits_count(&alac->gb) > 8) {
-        av_log(avctx, AV_LOG_ERROR, "Error : %d bits left\n",
-               avpkt->size * 8 - get_bits_count(&alac->gb));
-    }
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int alac_decode_close(AVCodecContext *avctx)
-{
-    ALACContext *alac = avctx->priv_data;
-
-    int ch;
-    for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
-        av_freep(&alac->predict_error_buffer[ch]);
-        if (alac->sample_size == 16)
-            av_freep(&alac->output_samples_buffer[ch]);
-        av_freep(&alac->extra_bits_buffer[ch]);
-    }
-
-    return 0;
-}
-
-static int allocate_buffers(ALACContext *alac)
-{
-    int ch;
-    int buf_size = alac->max_samples_per_frame * sizeof(int32_t);
-
-    for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
-        FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],
-                         buf_size, buf_alloc_fail);
-
-        if (alac->sample_size == 16) {
-            FF_ALLOC_OR_GOTO(alac->avctx, alac->output_samples_buffer[ch],
-                             buf_size, buf_alloc_fail);
-        }
-
-        FF_ALLOC_OR_GOTO(alac->avctx, alac->extra_bits_buffer[ch],
-                         buf_size, buf_alloc_fail);
-    }
-    return 0;
-buf_alloc_fail:
-    alac_decode_close(alac->avctx);
-    return AVERROR(ENOMEM);
-}
-
-static int alac_set_info(ALACContext *alac)
-{
-    GetByteContext gb;
-
-    bytestream2_init(&gb, alac->avctx->extradata,
-                     alac->avctx->extradata_size);
-
-    bytestream2_skipu(&gb, 12); // size:4, alac:4, version:4
-
-    alac->max_samples_per_frame = bytestream2_get_be32u(&gb);
-    if (!alac->max_samples_per_frame ||
-        alac->max_samples_per_frame > INT_MAX / sizeof(int32_t)) {
-        av_log(alac->avctx, AV_LOG_ERROR, "max samples per frame invalid: %u\n",
-               alac->max_samples_per_frame);
-        return AVERROR_INVALIDDATA;
-    }
-    bytestream2_skipu(&gb, 1);  // compatible version
-    alac->sample_size          = bytestream2_get_byteu(&gb);
-    alac->rice_history_mult    = bytestream2_get_byteu(&gb);
-    alac->rice_initial_history = bytestream2_get_byteu(&gb);
-    alac->rice_limit           = bytestream2_get_byteu(&gb);
-    alac->channels             = bytestream2_get_byteu(&gb);
-    bytestream2_get_be16u(&gb); // maxRun
-    bytestream2_get_be32u(&gb); // max coded frame size
-    bytestream2_get_be32u(&gb); // average bitrate
-    bytestream2_get_be32u(&gb); // samplerate
-
-    return 0;
-}
-
-static av_cold int alac_decode_init(AVCodecContext * avctx)
-{
-    int ret;
-    ALACContext *alac = avctx->priv_data;
-    alac->avctx = avctx;
-
-    /* initialize from the extradata */
-    if (alac->avctx->extradata_size < ALAC_EXTRADATA_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "alac: extradata is too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (alac_set_info(alac)) {
-        av_log(avctx, AV_LOG_ERROR, "alac: set_info failed\n");
-        return -1;
-    }
-
-    switch (alac->sample_size) {
-    case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-             break;
-    case 24:
-    case 32: avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
-             break;
-    default: avpriv_request_sample(avctx, "Sample depth %d", alac->sample_size);
-             return AVERROR_PATCHWELCOME;
-    }
-    avctx->bits_per_raw_sample = alac->sample_size;
-
-    if (alac->channels < 1) {
-        av_log(avctx, AV_LOG_WARNING, "Invalid channel count\n");
-        alac->channels = avctx->channels;
-    } else {
-        if (alac->channels > ALAC_MAX_CHANNELS)
-            alac->channels = avctx->channels;
-        else
-            avctx->channels = alac->channels;
-    }
-    if (avctx->channels > ALAC_MAX_CHANNELS) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported channel count: %d\n",
-               avctx->channels);
-        return AVERROR_PATCHWELCOME;
-    }
-    avctx->channel_layout = ff_alac_channel_layouts[alac->channels - 1];
-
-    if ((ret = allocate_buffers(alac)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error allocating buffers\n");
-        return ret;
-    }
-
-    return 0;
-}
-
-AVCodec ff_alac_decoder = {
-    .name           = "alac",
-    .long_name      = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ALAC,
-    .priv_data_size = sizeof(ALACContext),
-    .init           = alac_decode_init,
-    .close          = alac_decode_close,
-    .decode         = alac_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/alac_data.c b/deps/libav/libavcodec/alac_data.c
deleted file mode 100644
index 9e13119..0000000
--- a/deps/libav/libavcodec/alac_data.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * ALAC encoder and decoder common data
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "alac_data.h"
-
-const uint8_t ff_alac_channel_layout_offsets[ALAC_MAX_CHANNELS][ALAC_MAX_CHANNELS] = {
-    { 0 },
-    { 0, 1 },
-    { 2, 0, 1 },
-    { 2, 0, 1, 3 },
-    { 2, 0, 1, 3, 4 },
-    { 2, 0, 1, 4, 5, 3 },
-    { 2, 0, 1, 4, 5, 6, 3 },
-    { 2, 6, 7, 0, 1, 4, 5, 3 }
-};
-
-const uint64_t ff_alac_channel_layouts[ALAC_MAX_CHANNELS + 1] = {
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_5POINT0_BACK,
-    AV_CH_LAYOUT_5POINT1_BACK,
-    AV_CH_LAYOUT_6POINT1_BACK,
-    AV_CH_LAYOUT_7POINT1_WIDE_BACK,
-    0
-};
-
-const enum AlacRawDataBlockType ff_alac_channel_elements[ALAC_MAX_CHANNELS][5] = {
-    { TYPE_SCE,                                         },
-    { TYPE_CPE,                                         },
-    { TYPE_SCE, TYPE_CPE,                               },
-    { TYPE_SCE, TYPE_CPE, TYPE_SCE                      },
-    { TYPE_SCE, TYPE_CPE, TYPE_CPE,                     },
-    { TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE,           },
-    { TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_SCE, },
-    { TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, },
-};
diff --git a/deps/libav/libavcodec/alac_data.h b/deps/libav/libavcodec/alac_data.h
deleted file mode 100644
index ebb1f33..0000000
--- a/deps/libav/libavcodec/alac_data.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * ALAC encoder and decoder common data
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ALAC_DATA_H
-#define AVCODEC_ALAC_DATA_H
-
-#include <stdint.h>
-
-enum AlacRawDataBlockType {
-    /* At the moment, only SCE, CPE, LFE, and END are recognized. */
-    TYPE_SCE,
-    TYPE_CPE,
-    TYPE_CCE,
-    TYPE_LFE,
-    TYPE_DSE,
-    TYPE_PCE,
-    TYPE_FIL,
-    TYPE_END
-};
-
-#define ALAC_MAX_CHANNELS 8
-
-extern const uint8_t ff_alac_channel_layout_offsets[ALAC_MAX_CHANNELS][ALAC_MAX_CHANNELS];
-
-extern const uint64_t ff_alac_channel_layouts[ALAC_MAX_CHANNELS + 1];
-
-extern const enum AlacRawDataBlockType ff_alac_channel_elements[ALAC_MAX_CHANNELS][5];
-
-#endif /* AVCODEC_ALAC_DATA_H */
diff --git a/deps/libav/libavcodec/alacenc.c b/deps/libav/libavcodec/alacenc.c
deleted file mode 100644
index 401f26f..0000000
--- a/deps/libav/libavcodec/alacenc.c
+++ /dev/null
@@ -1,658 +0,0 @@
-/*
- * ALAC audio encoder
- * Copyright (c) 2008  Jaikrishnan Menon <realityman at gmx.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "put_bits.h"
-#include "internal.h"
-#include "lpc.h"
-#include "mathops.h"
-#include "alac_data.h"
-
-#define DEFAULT_FRAME_SIZE        4096
-#define ALAC_EXTRADATA_SIZE       36
-#define ALAC_FRAME_HEADER_SIZE    55
-#define ALAC_FRAME_FOOTER_SIZE    3
-
-#define ALAC_ESCAPE_CODE          0x1FF
-#define ALAC_MAX_LPC_ORDER        30
-#define DEFAULT_MAX_PRED_ORDER    6
-#define DEFAULT_MIN_PRED_ORDER    4
-#define ALAC_MAX_LPC_PRECISION    9
-#define ALAC_MAX_LPC_SHIFT        9
-
-#define ALAC_CHMODE_LEFT_RIGHT    0
-#define ALAC_CHMODE_LEFT_SIDE     1
-#define ALAC_CHMODE_RIGHT_SIDE    2
-#define ALAC_CHMODE_MID_SIDE      3
-
-typedef struct RiceContext {
-    int history_mult;
-    int initial_history;
-    int k_modifier;
-    int rice_modifier;
-} RiceContext;
-
-typedef struct AlacLPCContext {
-    int lpc_order;
-    int lpc_coeff[ALAC_MAX_LPC_ORDER+1];
-    int lpc_quant;
-} AlacLPCContext;
-
-typedef struct AlacEncodeContext {
-    int frame_size;                     /**< current frame size               */
-    int verbatim;                       /**< current frame verbatim mode flag */
-    int compression_level;
-    int min_prediction_order;
-    int max_prediction_order;
-    int max_coded_frame_size;
-    int write_sample_size;
-    int extra_bits;
-    int32_t sample_buf[2][DEFAULT_FRAME_SIZE];
-    int32_t predictor_buf[DEFAULT_FRAME_SIZE];
-    int interlacing_shift;
-    int interlacing_leftweight;
-    PutBitContext pbctx;
-    RiceContext rc;
-    AlacLPCContext lpc[2];
-    LPCContext lpc_ctx;
-    AVCodecContext *avctx;
-} AlacEncodeContext;
-
-
-static void init_sample_buffers(AlacEncodeContext *s, int channels,
-                                uint8_t const *samples[2])
-{
-    int ch, i;
-    int shift = av_get_bytes_per_sample(s->avctx->sample_fmt) * 8 -
-                s->avctx->bits_per_raw_sample;
-
-#define COPY_SAMPLES(type) do {                             \
-        for (ch = 0; ch < channels; ch++) {                 \
-            int32_t       *bptr = s->sample_buf[ch];        \
-            const type *sptr = (const type *)samples[ch];   \
-            for (i = 0; i < s->frame_size; i++)             \
-                bptr[i] = sptr[i] >> shift;                 \
-        }                                                   \
-    } while (0)
-
-    if (s->avctx->sample_fmt == AV_SAMPLE_FMT_S32P)
-        COPY_SAMPLES(int32_t);
-    else
-        COPY_SAMPLES(int16_t);
-}
-
-static void encode_scalar(AlacEncodeContext *s, int x,
-                          int k, int write_sample_size)
-{
-    int divisor, q, r;
-
-    k = FFMIN(k, s->rc.k_modifier);
-    divisor = (1<<k) - 1;
-    q = x / divisor;
-    r = x % divisor;
-
-    if (q > 8) {
-        // write escape code and sample value directly
-        put_bits(&s->pbctx, 9, ALAC_ESCAPE_CODE);
-        put_bits(&s->pbctx, write_sample_size, x);
-    } else {
-        if (q)
-            put_bits(&s->pbctx, q, (1<<q) - 1);
-        put_bits(&s->pbctx, 1, 0);
-
-        if (k != 1) {
-            if (r > 0)
-                put_bits(&s->pbctx, k, r+1);
-            else
-                put_bits(&s->pbctx, k-1, 0);
-        }
-    }
-}
-
-static void write_element_header(AlacEncodeContext *s,
-                                 enum AlacRawDataBlockType element,
-                                 int instance)
-{
-    int encode_fs = 0;
-
-    if (s->frame_size < DEFAULT_FRAME_SIZE)
-        encode_fs = 1;
-
-    put_bits(&s->pbctx, 3,  element);               // element type
-    put_bits(&s->pbctx, 4,  instance);              // element instance
-    put_bits(&s->pbctx, 12, 0);                     // unused header bits
-    put_bits(&s->pbctx, 1,  encode_fs);             // Sample count is in the header
-    put_bits(&s->pbctx, 2,  s->extra_bits >> 3);    // Extra bytes (for 24-bit)
-    put_bits(&s->pbctx, 1,  s->verbatim);           // Audio block is verbatim
-    if (encode_fs)
-        put_bits32(&s->pbctx, s->frame_size);       // No. of samples in the frame
-}
-
-static void calc_predictor_params(AlacEncodeContext *s, int ch)
-{
-    int32_t coefs[MAX_LPC_ORDER][MAX_LPC_ORDER];
-    int shift[MAX_LPC_ORDER];
-    int opt_order;
-
-    if (s->compression_level == 1) {
-        s->lpc[ch].lpc_order = 6;
-        s->lpc[ch].lpc_quant = 6;
-        s->lpc[ch].lpc_coeff[0] =  160;
-        s->lpc[ch].lpc_coeff[1] = -190;
-        s->lpc[ch].lpc_coeff[2] =  170;
-        s->lpc[ch].lpc_coeff[3] = -130;
-        s->lpc[ch].lpc_coeff[4] =   80;
-        s->lpc[ch].lpc_coeff[5] =  -25;
-    } else {
-        opt_order = ff_lpc_calc_coefs(&s->lpc_ctx, s->sample_buf[ch],
-                                      s->frame_size,
-                                      s->min_prediction_order,
-                                      s->max_prediction_order,
-                                      ALAC_MAX_LPC_PRECISION, coefs, shift,
-                                      FF_LPC_TYPE_LEVINSON, 0,
-                                      ORDER_METHOD_EST, ALAC_MAX_LPC_SHIFT, 1);
-
-        s->lpc[ch].lpc_order = opt_order;
-        s->lpc[ch].lpc_quant = shift[opt_order-1];
-        memcpy(s->lpc[ch].lpc_coeff, coefs[opt_order-1], opt_order*sizeof(int));
-    }
-}
-
-static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n)
-{
-    int i, best;
-    int32_t lt, rt;
-    uint64_t sum[4];
-    uint64_t score[4];
-
-    /* calculate sum of 2nd order residual for each channel */
-    sum[0] = sum[1] = sum[2] = sum[3] = 0;
-    for (i = 2; i < n; i++) {
-        lt =  left_ch[i] - 2 *  left_ch[i - 1] +  left_ch[i - 2];
-        rt = right_ch[i] - 2 * right_ch[i - 1] + right_ch[i - 2];
-        sum[2] += FFABS((lt + rt) >> 1);
-        sum[3] += FFABS(lt - rt);
-        sum[0] += FFABS(lt);
-        sum[1] += FFABS(rt);
-    }
-
-    /* calculate score for each mode */
-    score[0] = sum[0] + sum[1];
-    score[1] = sum[0] + sum[3];
-    score[2] = sum[1] + sum[3];
-    score[3] = sum[2] + sum[3];
-
-    /* return mode with lowest score */
-    best = 0;
-    for (i = 1; i < 4; i++) {
-        if (score[i] < score[best])
-            best = i;
-    }
-    return best;
-}
-
-static void alac_stereo_decorrelation(AlacEncodeContext *s)
-{
-    int32_t *left = s->sample_buf[0], *right = s->sample_buf[1];
-    int i, mode, n = s->frame_size;
-    int32_t tmp;
-
-    mode = estimate_stereo_mode(left, right, n);
-
-    switch (mode) {
-    case ALAC_CHMODE_LEFT_RIGHT:
-        s->interlacing_leftweight = 0;
-        s->interlacing_shift      = 0;
-        break;
-    case ALAC_CHMODE_LEFT_SIDE:
-        for (i = 0; i < n; i++)
-            right[i] = left[i] - right[i];
-        s->interlacing_leftweight = 1;
-        s->interlacing_shift      = 0;
-        break;
-    case ALAC_CHMODE_RIGHT_SIDE:
-        for (i = 0; i < n; i++) {
-            tmp = right[i];
-            right[i] = left[i] - right[i];
-            left[i]  = tmp + (right[i] >> 31);
-        }
-        s->interlacing_leftweight = 1;
-        s->interlacing_shift      = 31;
-        break;
-    default:
-        for (i = 0; i < n; i++) {
-            tmp = left[i];
-            left[i]  = (tmp + right[i]) >> 1;
-            right[i] =  tmp - right[i];
-        }
-        s->interlacing_leftweight = 1;
-        s->interlacing_shift      = 1;
-        break;
-    }
-}
-
-static void alac_linear_predictor(AlacEncodeContext *s, int ch)
-{
-    int i;
-    AlacLPCContext lpc = s->lpc[ch];
-
-    if (lpc.lpc_order == 31) {
-        s->predictor_buf[0] = s->sample_buf[ch][0];
-
-        for (i = 1; i < s->frame_size; i++) {
-            s->predictor_buf[i] = s->sample_buf[ch][i    ] -
-                                  s->sample_buf[ch][i - 1];
-        }
-
-        return;
-    }
-
-    // generalised linear predictor
-
-    if (lpc.lpc_order > 0) {
-        int32_t *samples  = s->sample_buf[ch];
-        int32_t *residual = s->predictor_buf;
-
-        // generate warm-up samples
-        residual[0] = samples[0];
-        for (i = 1; i <= lpc.lpc_order; i++)
-            residual[i] = samples[i] - samples[i-1];
-
-        // perform lpc on remaining samples
-        for (i = lpc.lpc_order + 1; i < s->frame_size; i++) {
-            int sum = 1 << (lpc.lpc_quant - 1), res_val, j;
-
-            for (j = 0; j < lpc.lpc_order; j++) {
-                sum += (samples[lpc.lpc_order-j] - samples[0]) *
-                       lpc.lpc_coeff[j];
-            }
-
-            sum >>= lpc.lpc_quant;
-            sum += samples[0];
-            residual[i] = sign_extend(samples[lpc.lpc_order+1] - sum,
-                                      s->write_sample_size);
-            res_val = residual[i];
-
-            if (res_val) {
-                int index = lpc.lpc_order - 1;
-                int neg = (res_val < 0);
-
-                while (index >= 0 && (neg ? (res_val < 0) : (res_val > 0))) {
-                    int val  = samples[0] - samples[lpc.lpc_order - index];
-                    int sign = (val ? FFSIGN(val) : 0);
-
-                    if (neg)
-                        sign *= -1;
-
-                    lpc.lpc_coeff[index] -= sign;
-                    val *= sign;
-                    res_val -= (val >> lpc.lpc_quant) * (lpc.lpc_order - index);
-                    index--;
-                }
-            }
-            samples++;
-        }
-    }
-}
-
-static void alac_entropy_coder(AlacEncodeContext *s)
-{
-    unsigned int history = s->rc.initial_history;
-    int sign_modifier = 0, i, k;
-    int32_t *samples = s->predictor_buf;
-
-    for (i = 0; i < s->frame_size;) {
-        int x;
-
-        k = av_log2((history >> 9) + 3);
-
-        x  = -2 * (*samples) -1;
-        x ^= x >> 31;
-
-        samples++;
-        i++;
-
-        encode_scalar(s, x - sign_modifier, k, s->write_sample_size);
-
-        history += x * s->rc.history_mult -
-                   ((history * s->rc.history_mult) >> 9);
-
-        sign_modifier = 0;
-        if (x > 0xFFFF)
-            history = 0xFFFF;
-
-        if (history < 128 && i < s->frame_size) {
-            unsigned int block_size = 0;
-
-            k = 7 - av_log2(history) + ((history + 16) >> 6);
-
-            while (*samples == 0 && i < s->frame_size) {
-                samples++;
-                i++;
-                block_size++;
-            }
-            encode_scalar(s, block_size, k, 16);
-            sign_modifier = (block_size <= 0xFFFF);
-            history = 0;
-        }
-
-    }
-}
-
-static void write_element(AlacEncodeContext *s,
-                          enum AlacRawDataBlockType element, int instance,
-                          const uint8_t *samples0, const uint8_t *samples1)
-{
-    uint8_t const *samples[2] = { samples0, samples1 };
-    int i, j, channels;
-    int prediction_type = 0;
-    PutBitContext *pb = &s->pbctx;
-
-    channels = element == TYPE_CPE ? 2 : 1;
-
-    if (s->verbatim) {
-        write_element_header(s, element, instance);
-        /* samples are channel-interleaved in verbatim mode */
-        if (s->avctx->sample_fmt == AV_SAMPLE_FMT_S32P) {
-            int shift = 32 - s->avctx->bits_per_raw_sample;
-            int32_t const *samples_s32[2] = { (const int32_t *)samples0,
-                                              (const int32_t *)samples1 };
-            for (i = 0; i < s->frame_size; i++)
-                for (j = 0; j < channels; j++)
-                    put_sbits(pb, s->avctx->bits_per_raw_sample,
-                              samples_s32[j][i] >> shift);
-        } else {
-            int16_t const *samples_s16[2] = { (const int16_t *)samples0,
-                                              (const int16_t *)samples1 };
-            for (i = 0; i < s->frame_size; i++)
-                for (j = 0; j < channels; j++)
-                    put_sbits(pb, s->avctx->bits_per_raw_sample,
-                              samples_s16[j][i]);
-        }
-    } else {
-        s->write_sample_size = s->avctx->bits_per_raw_sample - s->extra_bits +
-                               channels - 1;
-
-        init_sample_buffers(s, channels, samples);
-        write_element_header(s, element, instance);
-
-        if (channels == 2)
-            alac_stereo_decorrelation(s);
-        else
-            s->interlacing_shift = s->interlacing_leftweight = 0;
-        put_bits(pb, 8, s->interlacing_shift);
-        put_bits(pb, 8, s->interlacing_leftweight);
-
-        for (i = 0; i < channels; i++) {
-            calc_predictor_params(s, i);
-
-            put_bits(pb, 4, prediction_type);
-            put_bits(pb, 4, s->lpc[i].lpc_quant);
-
-            put_bits(pb, 3, s->rc.rice_modifier);
-            put_bits(pb, 5, s->lpc[i].lpc_order);
-            // predictor coeff. table
-            for (j = 0; j < s->lpc[i].lpc_order; j++)
-                put_sbits(pb, 16, s->lpc[i].lpc_coeff[j]);
-        }
-
-        // write extra bits if needed
-        if (s->extra_bits) {
-            uint32_t mask = (1 << s->extra_bits) - 1;
-            for (i = 0; i < s->frame_size; i++) {
-                for (j = 0; j < channels; j++) {
-                    put_bits(pb, s->extra_bits, s->sample_buf[j][i] & mask);
-                    s->sample_buf[j][i] >>= s->extra_bits;
-                }
-            }
-        }
-
-        // apply lpc and entropy coding to audio samples
-        for (i = 0; i < channels; i++) {
-            alac_linear_predictor(s, i);
-
-            // TODO: determine when this will actually help. for now it's not used.
-            if (prediction_type == 15) {
-                // 2nd pass 1st order filter
-                for (j = s->frame_size - 1; j > 0; j--)
-                    s->predictor_buf[j] -= s->predictor_buf[j - 1];
-            }
-            alac_entropy_coder(s);
-        }
-    }
-}
-
-static int write_frame(AlacEncodeContext *s, AVPacket *avpkt,
-                       uint8_t * const *samples)
-{
-    PutBitContext *pb = &s->pbctx;
-    const enum AlacRawDataBlockType *ch_elements = ff_alac_channel_elements[s->avctx->channels - 1];
-    const uint8_t *ch_map = ff_alac_channel_layout_offsets[s->avctx->channels - 1];
-    int ch, element, sce, cpe;
-
-    init_put_bits(pb, avpkt->data, avpkt->size);
-
-    ch = element = sce = cpe = 0;
-    while (ch < s->avctx->channels) {
-        if (ch_elements[element] == TYPE_CPE) {
-            write_element(s, TYPE_CPE, cpe, samples[ch_map[ch]],
-                          samples[ch_map[ch + 1]]);
-            cpe++;
-            ch += 2;
-        } else {
-            write_element(s, TYPE_SCE, sce, samples[ch_map[ch]], NULL);
-            sce++;
-            ch++;
-        }
-        element++;
-    }
-
-    put_bits(pb, 3, TYPE_END);
-    flush_put_bits(pb);
-
-    return put_bits_count(pb) >> 3;
-}
-
-static av_always_inline int get_max_frame_size(int frame_size, int ch, int bps)
-{
-    int header_bits = 23 + 32 * (frame_size < DEFAULT_FRAME_SIZE);
-    return FFALIGN(header_bits + bps * ch * frame_size + 3, 8) / 8;
-}
-
-static av_cold int alac_encode_close(AVCodecContext *avctx)
-{
-    AlacEncodeContext *s = avctx->priv_data;
-    ff_lpc_end(&s->lpc_ctx);
-    av_freep(&avctx->extradata);
-    avctx->extradata_size = 0;
-    av_freep(&avctx->coded_frame);
-    return 0;
-}
-
-static av_cold int alac_encode_init(AVCodecContext *avctx)
-{
-    AlacEncodeContext *s = avctx->priv_data;
-    int ret;
-    uint8_t *alac_extradata;
-
-    avctx->frame_size = s->frame_size = DEFAULT_FRAME_SIZE;
-
-    if (avctx->sample_fmt == AV_SAMPLE_FMT_S32P) {
-        if (avctx->bits_per_raw_sample != 24)
-            av_log(avctx, AV_LOG_WARNING, "encoding as 24 bits-per-sample\n");
-        avctx->bits_per_raw_sample = 24;
-    } else {
-        avctx->bits_per_raw_sample = 16;
-        s->extra_bits              = 0;
-    }
-
-    // Set default compression level
-    if (avctx->compression_level == FF_COMPRESSION_DEFAULT)
-        s->compression_level = 2;
-    else
-        s->compression_level = av_clip(avctx->compression_level, 0, 2);
-
-    // Initialize default Rice parameters
-    s->rc.history_mult    = 40;
-    s->rc.initial_history = 10;
-    s->rc.k_modifier      = 14;
-    s->rc.rice_modifier   = 4;
-
-    s->max_coded_frame_size = get_max_frame_size(avctx->frame_size,
-                                                 avctx->channels,
-                                                 avctx->bits_per_raw_sample);
-
-    avctx->extradata = av_mallocz(ALAC_EXTRADATA_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!avctx->extradata) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-    avctx->extradata_size = ALAC_EXTRADATA_SIZE;
-
-    alac_extradata = avctx->extradata;
-    AV_WB32(alac_extradata,    ALAC_EXTRADATA_SIZE);
-    AV_WB32(alac_extradata+4,  MKBETAG('a','l','a','c'));
-    AV_WB32(alac_extradata+12, avctx->frame_size);
-    AV_WB8 (alac_extradata+17, avctx->bits_per_raw_sample);
-    AV_WB8 (alac_extradata+21, avctx->channels);
-    AV_WB32(alac_extradata+24, s->max_coded_frame_size);
-    AV_WB32(alac_extradata+28,
-            avctx->sample_rate * avctx->channels * avctx->bits_per_raw_sample); // average bitrate
-    AV_WB32(alac_extradata+32, avctx->sample_rate);
-
-    // Set relevant extradata fields
-    if (s->compression_level > 0) {
-        AV_WB8(alac_extradata+18, s->rc.history_mult);
-        AV_WB8(alac_extradata+19, s->rc.initial_history);
-        AV_WB8(alac_extradata+20, s->rc.k_modifier);
-    }
-
-    s->min_prediction_order = DEFAULT_MIN_PRED_ORDER;
-    if (avctx->min_prediction_order >= 0) {
-        if (avctx->min_prediction_order < MIN_LPC_ORDER ||
-           avctx->min_prediction_order > ALAC_MAX_LPC_ORDER) {
-            av_log(avctx, AV_LOG_ERROR, "invalid min prediction order: %d\n",
-                   avctx->min_prediction_order);
-            ret = AVERROR(EINVAL);
-            goto error;
-        }
-
-        s->min_prediction_order = avctx->min_prediction_order;
-    }
-
-    s->max_prediction_order = DEFAULT_MAX_PRED_ORDER;
-    if (avctx->max_prediction_order >= 0) {
-        if (avctx->max_prediction_order < MIN_LPC_ORDER ||
-            avctx->max_prediction_order > ALAC_MAX_LPC_ORDER) {
-            av_log(avctx, AV_LOG_ERROR, "invalid max prediction order: %d\n",
-                   avctx->max_prediction_order);
-            ret = AVERROR(EINVAL);
-            goto error;
-        }
-
-        s->max_prediction_order = avctx->max_prediction_order;
-    }
-
-    if (s->max_prediction_order < s->min_prediction_order) {
-        av_log(avctx, AV_LOG_ERROR,
-               "invalid prediction orders: min=%d max=%d\n",
-               s->min_prediction_order, s->max_prediction_order);
-        ret = AVERROR(EINVAL);
-        goto error;
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-
-    s->avctx = avctx;
-
-    if ((ret = ff_lpc_init(&s->lpc_ctx, avctx->frame_size,
-                           s->max_prediction_order,
-                           FF_LPC_TYPE_LEVINSON)) < 0) {
-        goto error;
-    }
-
-    return 0;
-error:
-    alac_encode_close(avctx);
-    return ret;
-}
-
-static int alac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                             const AVFrame *frame, int *got_packet_ptr)
-{
-    AlacEncodeContext *s = avctx->priv_data;
-    int out_bytes, max_frame_size, ret;
-
-    s->frame_size = frame->nb_samples;
-
-    if (frame->nb_samples < DEFAULT_FRAME_SIZE)
-        max_frame_size = get_max_frame_size(s->frame_size, avctx->channels,
-                                            avctx->bits_per_raw_sample);
-    else
-        max_frame_size = s->max_coded_frame_size;
-
-    if ((ret = ff_alloc_packet(avpkt, 2 * max_frame_size))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    /* use verbatim mode for compression_level 0 */
-    if (s->compression_level) {
-        s->verbatim   = 0;
-        s->extra_bits = avctx->bits_per_raw_sample - 16;
-    } else {
-        s->verbatim   = 1;
-        s->extra_bits = 0;
-    }
-
-    out_bytes = write_frame(s, avpkt, frame->extended_data);
-
-    if (out_bytes > max_frame_size) {
-        /* frame too large. use verbatim mode */
-        s->verbatim = 1;
-        s->extra_bits = 0;
-        out_bytes = write_frame(s, avpkt, frame->extended_data);
-    }
-
-    avpkt->size = out_bytes;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-AVCodec ff_alac_encoder = {
-    .name           = "alac",
-    .long_name      = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ALAC,
-    .priv_data_size = sizeof(AlacEncodeContext),
-    .init           = alac_encode_init,
-    .encode2        = alac_encode_frame,
-    .close          = alac_encode_close,
-    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME,
-    .channel_layouts = ff_alac_channel_layouts,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P,
-                                                     AV_SAMPLE_FMT_S16P,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/allcodecs.c b/deps/libav/libavcodec/allcodecs.c
deleted file mode 100644
index b6c27c0..0000000
--- a/deps/libav/libavcodec/allcodecs.c
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
- * Provide registration of all codecs, parsers and bitstream filters for libavcodec.
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Provide registration of all codecs, parsers and bitstream filters for libavcodec.
- */
-
-#include "config.h"
-#include "avcodec.h"
-#include "version.h"
-
-#define REGISTER_HWACCEL(X, x)                                          \
-    {                                                                   \
-        extern AVHWAccel ff_##x##_hwaccel;                              \
-        if (CONFIG_##X##_HWACCEL)                                       \
-            av_register_hwaccel(&ff_##x##_hwaccel);                     \
-    }
-
-#define REGISTER_ENCODER(X, x)                                          \
-    {                                                                   \
-        extern AVCodec ff_##x##_encoder;                                \
-        if (CONFIG_##X##_ENCODER)                                       \
-            avcodec_register(&ff_##x##_encoder);                        \
-    }
-
-#define REGISTER_DECODER(X, x)                                          \
-    {                                                                   \
-        extern AVCodec ff_##x##_decoder;                                \
-        if (CONFIG_##X##_DECODER)                                       \
-            avcodec_register(&ff_##x##_decoder);                        \
-    }
-
-#define REGISTER_ENCDEC(X, x) REGISTER_ENCODER(X, x); REGISTER_DECODER(X, x)
-
-#define REGISTER_PARSER(X, x)                                           \
-    {                                                                   \
-        extern AVCodecParser ff_##x##_parser;                           \
-        if (CONFIG_##X##_PARSER)                                        \
-            av_register_codec_parser(&ff_##x##_parser);                 \
-    }
-
-#define REGISTER_BSF(X, x)                                              \
-    {                                                                   \
-        extern AVBitStreamFilter ff_##x##_bsf;                          \
-        if (CONFIG_##X##_BSF)                                           \
-            av_register_bitstream_filter(&ff_##x##_bsf);                \
-    }
-
-void avcodec_register_all(void)
-{
-    static int initialized;
-
-    if (initialized)
-        return;
-    initialized = 1;
-
-    /* hardware accelerators */
-    REGISTER_HWACCEL(H263_VAAPI,        h263_vaapi);
-    REGISTER_HWACCEL(H263_VDPAU,        h263_vdpau);
-    REGISTER_HWACCEL(H264_DXVA2,        h264_dxva2);
-    REGISTER_HWACCEL(H264_VAAPI,        h264_vaapi);
-    REGISTER_HWACCEL(H264_VDA,          h264_vda);
-    REGISTER_HWACCEL(H264_VDPAU,        h264_vdpau);
-    REGISTER_HWACCEL(MPEG1_VDPAU,       mpeg1_vdpau);
-    REGISTER_HWACCEL(MPEG2_DXVA2,       mpeg2_dxva2);
-    REGISTER_HWACCEL(MPEG2_VAAPI,       mpeg2_vaapi);
-    REGISTER_HWACCEL(MPEG2_VDPAU,       mpeg2_vdpau);
-    REGISTER_HWACCEL(MPEG4_VAAPI,       mpeg4_vaapi);
-    REGISTER_HWACCEL(MPEG4_VDPAU,       mpeg4_vdpau);
-    REGISTER_HWACCEL(VC1_DXVA2,         vc1_dxva2);
-    REGISTER_HWACCEL(VC1_VAAPI,         vc1_vaapi);
-    REGISTER_HWACCEL(VC1_VDPAU,         vc1_vdpau);
-    REGISTER_HWACCEL(WMV3_DXVA2,        wmv3_dxva2);
-    REGISTER_HWACCEL(WMV3_VAAPI,        wmv3_vaapi);
-    REGISTER_HWACCEL(WMV3_VDPAU,        wmv3_vdpau);
-
-    /* video codecs */
-    REGISTER_ENCODER(A64MULTI,          a64multi);
-    REGISTER_ENCODER(A64MULTI5,         a64multi5);
-    REGISTER_DECODER(AASC,              aasc);
-    REGISTER_DECODER(AIC,               aic);
-    REGISTER_DECODER(AMV,               amv);
-    REGISTER_DECODER(ANM,               anm);
-    REGISTER_DECODER(ANSI,              ansi);
-    REGISTER_ENCDEC (ASV1,              asv1);
-    REGISTER_ENCDEC (ASV2,              asv2);
-    REGISTER_DECODER(AURA,              aura);
-    REGISTER_DECODER(AURA2,             aura2);
-    REGISTER_DECODER(AVS,               avs);
-    REGISTER_DECODER(BETHSOFTVID,       bethsoftvid);
-    REGISTER_DECODER(BFI,               bfi);
-    REGISTER_DECODER(BINK,              bink);
-    REGISTER_ENCDEC (BMP,               bmp);
-    REGISTER_DECODER(BMV_VIDEO,         bmv_video);
-    REGISTER_DECODER(C93,               c93);
-    REGISTER_DECODER(CAVS,              cavs);
-    REGISTER_DECODER(CDGRAPHICS,        cdgraphics);
-    REGISTER_DECODER(CDXL,              cdxl);
-    REGISTER_DECODER(CINEPAK,           cinepak);
-    REGISTER_ENCDEC (CLJR,              cljr);
-    REGISTER_DECODER(CLLC,              cllc);
-    REGISTER_ENCDEC (COMFORTNOISE,      comfortnoise);
-    REGISTER_DECODER(CSCD,              cscd);
-    REGISTER_DECODER(CYUV,              cyuv);
-    REGISTER_DECODER(DFA,               dfa);
-    REGISTER_ENCDEC (DNXHD,             dnxhd);
-    REGISTER_ENCDEC (DPX,               dpx);
-    REGISTER_DECODER(DSICINVIDEO,       dsicinvideo);
-    REGISTER_ENCDEC (DVVIDEO,           dvvideo);
-    REGISTER_DECODER(DXA,               dxa);
-    REGISTER_DECODER(DXTORY,            dxtory);
-    REGISTER_DECODER(EACMV,             eacmv);
-    REGISTER_DECODER(EAMAD,             eamad);
-    REGISTER_DECODER(EATGQ,             eatgq);
-    REGISTER_DECODER(EATGV,             eatgv);
-    REGISTER_DECODER(EATQI,             eatqi);
-    REGISTER_DECODER(EIGHTBPS,          eightbps);
-    REGISTER_DECODER(EIGHTSVX_EXP,      eightsvx_exp);
-    REGISTER_DECODER(EIGHTSVX_FIB,      eightsvx_fib);
-    REGISTER_DECODER(ESCAPE124,         escape124);
-    REGISTER_DECODER(ESCAPE130,         escape130);
-    REGISTER_ENCDEC (FFV1,              ffv1);
-    REGISTER_ENCDEC (FFVHUFF,           ffvhuff);
-    REGISTER_DECODER(FIC,               fic);
-    REGISTER_ENCDEC (FLASHSV,           flashsv);
-    REGISTER_DECODER(FLASHSV2,          flashsv2);
-    REGISTER_DECODER(FLIC,              flic);
-    REGISTER_ENCDEC (FLV,               flv);
-    REGISTER_DECODER(FOURXM,            fourxm);
-    REGISTER_DECODER(FRAPS,             fraps);
-    REGISTER_DECODER(FRWU,              frwu);
-    REGISTER_DECODER(G2M,               g2m);
-    REGISTER_ENCDEC (GIF,               gif);
-    REGISTER_ENCDEC (H261,              h261);
-    REGISTER_ENCDEC (H263,              h263);
-    REGISTER_DECODER(H263I,             h263i);
-    REGISTER_ENCODER(H263P,             h263p);
-    REGISTER_DECODER(H264,              h264);
-    REGISTER_DECODER(HEVC,              hevc);
-    REGISTER_DECODER(HNM4_VIDEO,        hnm4_video);
-    REGISTER_ENCDEC (HUFFYUV,           huffyuv);
-    REGISTER_DECODER(IDCIN,             idcin);
-    REGISTER_DECODER(IFF_BYTERUN1,      iff_byterun1);
-    REGISTER_DECODER(IFF_ILBM,          iff_ilbm);
-    REGISTER_DECODER(INDEO2,            indeo2);
-    REGISTER_DECODER(INDEO3,            indeo3);
-    REGISTER_DECODER(INDEO4,            indeo4);
-    REGISTER_DECODER(INDEO5,            indeo5);
-    REGISTER_DECODER(INTERPLAY_VIDEO,   interplay_video);
-    REGISTER_DECODER(JPEG2000,          jpeg2000);
-    REGISTER_ENCDEC (JPEGLS,            jpegls);
-    REGISTER_DECODER(JV,                jv);
-    REGISTER_DECODER(KGV1,              kgv1);
-    REGISTER_DECODER(KMVC,              kmvc);
-    REGISTER_DECODER(LAGARITH,          lagarith);
-    REGISTER_ENCODER(LJPEG,             ljpeg);
-    REGISTER_DECODER(LOCO,              loco);
-    REGISTER_DECODER(MDEC,              mdec);
-    REGISTER_DECODER(MIMIC,             mimic);
-    REGISTER_ENCDEC (MJPEG,             mjpeg);
-    REGISTER_DECODER(MJPEGB,            mjpegb);
-    REGISTER_DECODER(MMVIDEO,           mmvideo);
-    REGISTER_DECODER(MOTIONPIXELS,      motionpixels);
-#if FF_API_XVMC
-    REGISTER_DECODER(MPEG_XVMC,         mpeg_xvmc);
-#endif /* FF_API_XVMC */
-    REGISTER_ENCDEC (MPEG1VIDEO,        mpeg1video);
-    REGISTER_ENCDEC (MPEG2VIDEO,        mpeg2video);
-    REGISTER_ENCDEC (MPEG4,             mpeg4);
-    REGISTER_DECODER(MSA1,              msa1);
-    REGISTER_DECODER(MSMPEG4V1,         msmpeg4v1);
-    REGISTER_ENCDEC (MSMPEG4V2,         msmpeg4v2);
-    REGISTER_ENCDEC (MSMPEG4V3,         msmpeg4v3);
-    REGISTER_DECODER(MSRLE,             msrle);
-    REGISTER_DECODER(MSS1,              mss1);
-    REGISTER_DECODER(MSS2,              mss2);
-    REGISTER_DECODER(MSVIDEO1,          msvideo1);
-    REGISTER_DECODER(MSZH,              mszh);
-    REGISTER_DECODER(MTS2,              mts2);
-    REGISTER_DECODER(MXPEG,             mxpeg);
-    REGISTER_DECODER(NUV,               nuv);
-    REGISTER_ENCDEC (PAM,               pam);
-    REGISTER_ENCDEC (PBM,               pbm);
-    REGISTER_ENCDEC (PCX,               pcx);
-    REGISTER_ENCDEC (PGM,               pgm);
-    REGISTER_ENCDEC (PGMYUV,            pgmyuv);
-    REGISTER_DECODER(PICTOR,            pictor);
-    REGISTER_ENCDEC (PNG,               png);
-    REGISTER_ENCDEC (PPM,               ppm);
-    REGISTER_ENCDEC (PRORES,            prores);
-    REGISTER_DECODER(PTX,               ptx);
-    REGISTER_DECODER(QDRAW,             qdraw);
-    REGISTER_DECODER(QPEG,              qpeg);
-    REGISTER_ENCDEC (QTRLE,             qtrle);
-    REGISTER_DECODER(R10K,              r10k);
-    REGISTER_DECODER(R210,              r210);
-    REGISTER_ENCDEC (RAWVIDEO,          rawvideo);
-    REGISTER_DECODER(RL2,               rl2);
-    REGISTER_ENCDEC (ROQ,               roq);
-    REGISTER_DECODER(RPZA,              rpza);
-    REGISTER_ENCDEC (RV10,              rv10);
-    REGISTER_ENCDEC (RV20,              rv20);
-    REGISTER_DECODER(RV30,              rv30);
-    REGISTER_DECODER(RV40,              rv40);
-    REGISTER_DECODER(S302M,             s302m);
-    REGISTER_ENCDEC (SGI,               sgi);
-    REGISTER_DECODER(SMACKER,           smacker);
-    REGISTER_DECODER(SMC,               smc);
-    REGISTER_DECODER(SP5X,              sp5x);
-    REGISTER_ENCDEC (SUNRAST,           sunrast);
-    REGISTER_ENCDEC (SVQ1,              svq1);
-    REGISTER_DECODER(SVQ3,              svq3);
-    REGISTER_ENCDEC (TARGA,             targa);
-    REGISTER_DECODER(THEORA,            theora);
-    REGISTER_DECODER(THP,               thp);
-    REGISTER_DECODER(TIERTEXSEQVIDEO,   tiertexseqvideo);
-    REGISTER_ENCDEC (TIFF,              tiff);
-    REGISTER_DECODER(TMV,               tmv);
-    REGISTER_DECODER(TRUEMOTION1,       truemotion1);
-    REGISTER_DECODER(TRUEMOTION2,       truemotion2);
-    REGISTER_DECODER(TSCC,              tscc);
-    REGISTER_DECODER(TSCC2,             tscc2);
-    REGISTER_DECODER(TXD,               txd);
-    REGISTER_DECODER(ULTI,              ulti);
-    REGISTER_ENCDEC (UTVIDEO,           utvideo);
-    REGISTER_ENCDEC (V210,              v210);
-    REGISTER_DECODER(V210X,             v210x);
-    REGISTER_ENCDEC (V410,              v410);
-    REGISTER_DECODER(VB,                vb);
-    REGISTER_DECODER(VBLE,              vble);
-    REGISTER_DECODER(VC1,               vc1);
-    REGISTER_DECODER(VC1IMAGE,          vc1image);
-    REGISTER_DECODER(VCR1,              vcr1);
-    REGISTER_DECODER(VMDVIDEO,          vmdvideo);
-    REGISTER_DECODER(VMNC,              vmnc);
-    REGISTER_DECODER(VP3,               vp3);
-    REGISTER_DECODER(VP5,               vp5);
-    REGISTER_DECODER(VP6,               vp6);
-    REGISTER_DECODER(VP6A,              vp6a);
-    REGISTER_DECODER(VP6F,              vp6f);
-    REGISTER_DECODER(VP8,               vp8);
-    REGISTER_DECODER(VP9,               vp9);
-    REGISTER_DECODER(VQA,               vqa);
-    REGISTER_DECODER(WEBP,              webp);
-    REGISTER_ENCDEC (WMV1,              wmv1);
-    REGISTER_ENCDEC (WMV2,              wmv2);
-    REGISTER_DECODER(WMV3,              wmv3);
-    REGISTER_DECODER(WMV3IMAGE,         wmv3image);
-    REGISTER_DECODER(WNV1,              wnv1);
-    REGISTER_DECODER(XAN_WC3,           xan_wc3);
-    REGISTER_DECODER(XAN_WC4,           xan_wc4);
-    REGISTER_ENCODER(XBM,               xbm);
-    REGISTER_DECODER(XL,                xl);
-    REGISTER_ENCDEC (XWD,               xwd);
-    REGISTER_DECODER(YOP,               yop);
-    REGISTER_DECODER(ZEROCODEC,         zerocodec);
-    REGISTER_ENCDEC (ZLIB,              zlib);
-    REGISTER_ENCDEC (ZMBV,              zmbv);
-
-    /* audio codecs */
-    REGISTER_ENCDEC (AAC,               aac);
-    REGISTER_DECODER(AAC_LATM,          aac_latm);
-    REGISTER_ENCDEC (AC3,               ac3);
-    REGISTER_ENCODER(AC3_FIXED,         ac3_fixed);
-    REGISTER_ENCDEC (ALAC,              alac);
-    REGISTER_DECODER(ALS,               als);
-    REGISTER_DECODER(AMRNB,             amrnb);
-    REGISTER_DECODER(AMRWB,             amrwb);
-    REGISTER_DECODER(APE,               ape);
-    REGISTER_DECODER(ATRAC1,            atrac1);
-    REGISTER_DECODER(ATRAC3,            atrac3);
-    REGISTER_DECODER(ATRAC3P,           atrac3p);
-    REGISTER_DECODER(BINKAUDIO_DCT,     binkaudio_dct);
-    REGISTER_DECODER(BINKAUDIO_RDFT,    binkaudio_rdft);
-    REGISTER_DECODER(BMV_AUDIO,         bmv_audio);
-    REGISTER_DECODER(COOK,              cook);
-    REGISTER_DECODER(DCA,               dca);
-    REGISTER_DECODER(DSICINAUDIO,       dsicinaudio);
-    REGISTER_ENCDEC (EAC3,              eac3);
-    REGISTER_ENCDEC (FLAC,              flac);
-    REGISTER_DECODER(G723_1,            g723_1);
-    REGISTER_DECODER(GSM,               gsm);
-    REGISTER_DECODER(GSM_MS,            gsm_ms);
-    REGISTER_DECODER(IAC,               iac);
-    REGISTER_DECODER(IMC,               imc);
-    REGISTER_DECODER(MACE3,             mace3);
-    REGISTER_DECODER(MACE6,             mace6);
-    REGISTER_DECODER(METASOUND,         metasound);
-    REGISTER_DECODER(MLP,               mlp);
-    REGISTER_DECODER(MP1,               mp1);
-    REGISTER_DECODER(MP1FLOAT,          mp1float);
-    REGISTER_ENCDEC (MP2,               mp2);
-    REGISTER_DECODER(MP2FLOAT,          mp2float);
-    REGISTER_DECODER(MP3,               mp3);
-    REGISTER_DECODER(MP3FLOAT,          mp3float);
-    REGISTER_DECODER(MP3ADU,            mp3adu);
-    REGISTER_DECODER(MP3ADUFLOAT,       mp3adufloat);
-    REGISTER_DECODER(MP3ON4,            mp3on4);
-    REGISTER_DECODER(MP3ON4FLOAT,       mp3on4float);
-    REGISTER_DECODER(MPC7,              mpc7);
-    REGISTER_DECODER(MPC8,              mpc8);
-    REGISTER_ENCDEC (NELLYMOSER,        nellymoser);
-    REGISTER_DECODER(QCELP,             qcelp);
-    REGISTER_DECODER(QDM2,              qdm2);
-    REGISTER_ENCDEC (RA_144,            ra_144);
-    REGISTER_DECODER(RA_288,            ra_288);
-    REGISTER_DECODER(RALF,              ralf);
-    REGISTER_DECODER(SHORTEN,           shorten);
-    REGISTER_DECODER(SIPR,              sipr);
-    REGISTER_DECODER(SMACKAUD,          smackaud);
-    REGISTER_DECODER(TAK,               tak);
-    REGISTER_DECODER(TRUEHD,            truehd);
-    REGISTER_DECODER(TRUESPEECH,        truespeech);
-    REGISTER_DECODER(TTA,               tta);
-    REGISTER_DECODER(TWINVQ,            twinvq);
-    REGISTER_DECODER(VMDAUDIO,          vmdaudio);
-    REGISTER_ENCDEC (VORBIS,            vorbis);
-    REGISTER_DECODER(WAVPACK,           wavpack);
-    REGISTER_DECODER(WMALOSSLESS,       wmalossless);
-    REGISTER_DECODER(WMAPRO,            wmapro);
-    REGISTER_ENCDEC (WMAV1,             wmav1);
-    REGISTER_ENCDEC (WMAV2,             wmav2);
-    REGISTER_DECODER(WMAVOICE,          wmavoice);
-    REGISTER_DECODER(WS_SND1,           ws_snd1);
-
-    /* PCM codecs */
-    REGISTER_ENCDEC (PCM_ALAW,          pcm_alaw);
-    REGISTER_DECODER(PCM_BLURAY,        pcm_bluray);
-    REGISTER_DECODER(PCM_DVD,           pcm_dvd);
-    REGISTER_ENCDEC (PCM_F32BE,         pcm_f32be);
-    REGISTER_ENCDEC (PCM_F32LE,         pcm_f32le);
-    REGISTER_ENCDEC (PCM_F64BE,         pcm_f64be);
-    REGISTER_ENCDEC (PCM_F64LE,         pcm_f64le);
-    REGISTER_DECODER(PCM_LXF,           pcm_lxf);
-    REGISTER_ENCDEC (PCM_MULAW,         pcm_mulaw);
-    REGISTER_ENCDEC (PCM_S8,            pcm_s8);
-    REGISTER_DECODER(PCM_S8_PLANAR,     pcm_s8_planar);
-    REGISTER_ENCDEC (PCM_S16BE,         pcm_s16be);
-    REGISTER_ENCDEC (PCM_S16LE,         pcm_s16le);
-    REGISTER_DECODER(PCM_S16LE_PLANAR,  pcm_s16le_planar);
-    REGISTER_ENCDEC (PCM_S24BE,         pcm_s24be);
-    REGISTER_ENCDEC (PCM_S24DAUD,       pcm_s24daud);
-    REGISTER_ENCDEC (PCM_S24LE,         pcm_s24le);
-    REGISTER_DECODER(PCM_S24LE_PLANAR,  pcm_s24le_planar);
-    REGISTER_ENCDEC (PCM_S32BE,         pcm_s32be);
-    REGISTER_ENCDEC (PCM_S32LE,         pcm_s32le);
-    REGISTER_DECODER(PCM_S32LE_PLANAR,  pcm_s32le_planar);
-    REGISTER_ENCDEC (PCM_U8,            pcm_u8);
-    REGISTER_ENCDEC (PCM_U16BE,         pcm_u16be);
-    REGISTER_ENCDEC (PCM_U16LE,         pcm_u16le);
-    REGISTER_ENCDEC (PCM_U24BE,         pcm_u24be);
-    REGISTER_ENCDEC (PCM_U24LE,         pcm_u24le);
-    REGISTER_ENCDEC (PCM_U32BE,         pcm_u32be);
-    REGISTER_ENCDEC (PCM_U32LE,         pcm_u32le);
-    REGISTER_DECODER(PCM_ZORK ,         pcm_zork);
-
-    /* DPCM codecs */
-    REGISTER_DECODER(INTERPLAY_DPCM,    interplay_dpcm);
-    REGISTER_ENCDEC (ROQ_DPCM,          roq_dpcm);
-    REGISTER_DECODER(SOL_DPCM,          sol_dpcm);
-    REGISTER_DECODER(XAN_DPCM,          xan_dpcm);
-
-    /* ADPCM codecs */
-    REGISTER_DECODER(ADPCM_4XM,         adpcm_4xm);
-    REGISTER_ENCDEC (ADPCM_ADX,         adpcm_adx);
-    REGISTER_DECODER(ADPCM_CT,          adpcm_ct);
-    REGISTER_DECODER(ADPCM_EA,          adpcm_ea);
-    REGISTER_DECODER(ADPCM_EA_MAXIS_XA, adpcm_ea_maxis_xa);
-    REGISTER_DECODER(ADPCM_EA_R1,       adpcm_ea_r1);
-    REGISTER_DECODER(ADPCM_EA_R2,       adpcm_ea_r2);
-    REGISTER_DECODER(ADPCM_EA_R3,       adpcm_ea_r3);
-    REGISTER_DECODER(ADPCM_EA_XAS,      adpcm_ea_xas);
-    REGISTER_ENCDEC (ADPCM_G722,        adpcm_g722);
-    REGISTER_ENCDEC (ADPCM_G726,        adpcm_g726);
-    REGISTER_DECODER(ADPCM_IMA_AMV,     adpcm_ima_amv);
-    REGISTER_DECODER(ADPCM_IMA_APC,     adpcm_ima_apc);
-    REGISTER_DECODER(ADPCM_IMA_DK3,     adpcm_ima_dk3);
-    REGISTER_DECODER(ADPCM_IMA_DK4,     adpcm_ima_dk4);
-    REGISTER_DECODER(ADPCM_IMA_EA_EACS, adpcm_ima_ea_eacs);
-    REGISTER_DECODER(ADPCM_IMA_EA_SEAD, adpcm_ima_ea_sead);
-    REGISTER_DECODER(ADPCM_IMA_ISS,     adpcm_ima_iss);
-    REGISTER_ENCDEC (ADPCM_IMA_QT,      adpcm_ima_qt);
-    REGISTER_DECODER(ADPCM_IMA_SMJPEG,  adpcm_ima_smjpeg);
-    REGISTER_ENCDEC (ADPCM_IMA_WAV,     adpcm_ima_wav);
-    REGISTER_DECODER(ADPCM_IMA_WS,      adpcm_ima_ws);
-    REGISTER_ENCDEC (ADPCM_MS,          adpcm_ms);
-    REGISTER_DECODER(ADPCM_SBPRO_2,     adpcm_sbpro_2);
-    REGISTER_DECODER(ADPCM_SBPRO_3,     adpcm_sbpro_3);
-    REGISTER_DECODER(ADPCM_SBPRO_4,     adpcm_sbpro_4);
-    REGISTER_ENCDEC (ADPCM_SWF,         adpcm_swf);
-    REGISTER_DECODER(ADPCM_THP,         adpcm_thp);
-    REGISTER_DECODER(ADPCM_XA,          adpcm_xa);
-    REGISTER_ENCDEC (ADPCM_YAMAHA,      adpcm_yamaha);
-
-    /* subtitles */
-    REGISTER_ENCDEC (ASS,               ass);
-    REGISTER_ENCDEC (DVBSUB,            dvbsub);
-    REGISTER_ENCDEC (DVDSUB,            dvdsub);
-    REGISTER_DECODER(PGSSUB,            pgssub);
-    REGISTER_DECODER(SRT,               srt);
-    REGISTER_ENCDEC (XSUB,              xsub);
-
-    /* external libraries */
-    REGISTER_ENCODER(LIBFAAC,           libfaac);
-    REGISTER_ENCDEC (LIBFDK_AAC,        libfdk_aac);
-    REGISTER_ENCDEC (LIBGSM,            libgsm);
-    REGISTER_ENCDEC (LIBGSM_MS,         libgsm_ms);
-    REGISTER_ENCDEC (LIBILBC,           libilbc);
-    REGISTER_ENCODER(LIBMP3LAME,        libmp3lame);
-    REGISTER_ENCDEC (LIBOPENCORE_AMRNB, libopencore_amrnb);
-    REGISTER_DECODER(LIBOPENCORE_AMRWB, libopencore_amrwb);
-    REGISTER_ENCDEC (LIBOPENJPEG,       libopenjpeg);
-    REGISTER_ENCDEC (LIBOPUS,           libopus);
-    REGISTER_ENCDEC (LIBSCHROEDINGER,   libschroedinger);
-    REGISTER_ENCDEC (LIBSPEEX,          libspeex);
-    REGISTER_ENCODER(LIBTHEORA,         libtheora);
-    REGISTER_ENCODER(LIBVO_AACENC,      libvo_aacenc);
-    REGISTER_ENCODER(LIBVO_AMRWBENC,    libvo_amrwbenc);
-    REGISTER_ENCODER(LIBVORBIS,         libvorbis);
-    REGISTER_ENCDEC (LIBVPX_VP8,        libvpx_vp8);
-    REGISTER_ENCDEC (LIBVPX_VP9,        libvpx_vp9);
-    REGISTER_ENCODER(LIBWAVPACK,        libwavpack);
-    REGISTER_ENCODER(LIBWEBP,           libwebp);
-    REGISTER_ENCODER(LIBX264,           libx264);
-    REGISTER_ENCODER(LIBXAVS,           libxavs);
-    REGISTER_ENCODER(LIBXVID,           libxvid);
-
-    /* parsers */
-    REGISTER_PARSER(AAC,                aac);
-    REGISTER_PARSER(AAC_LATM,           aac_latm);
-    REGISTER_PARSER(AC3,                ac3);
-    REGISTER_PARSER(ADX,                adx);
-    REGISTER_PARSER(CAVSVIDEO,          cavsvideo);
-    REGISTER_PARSER(COOK,               cook);
-    REGISTER_PARSER(DCA,                dca);
-    REGISTER_PARSER(DIRAC,              dirac);
-    REGISTER_PARSER(DNXHD,              dnxhd);
-    REGISTER_PARSER(DVBSUB,             dvbsub);
-    REGISTER_PARSER(DVDSUB,             dvdsub);
-    REGISTER_PARSER(FLAC,               flac);
-    REGISTER_PARSER(GSM,                gsm);
-    REGISTER_PARSER(H261,               h261);
-    REGISTER_PARSER(H263,               h263);
-    REGISTER_PARSER(H264,               h264);
-    REGISTER_PARSER(HEVC,               hevc);
-    REGISTER_PARSER(MJPEG,              mjpeg);
-    REGISTER_PARSER(MLP,                mlp);
-    REGISTER_PARSER(MPEG4VIDEO,         mpeg4video);
-    REGISTER_PARSER(MPEGAUDIO,          mpegaudio);
-    REGISTER_PARSER(MPEGVIDEO,          mpegvideo);
-    REGISTER_PARSER(PNG,                png);
-    REGISTER_PARSER(PNM,                pnm);
-    REGISTER_PARSER(RV30,               rv30);
-    REGISTER_PARSER(RV40,               rv40);
-    REGISTER_PARSER(TAK,                tak);
-    REGISTER_PARSER(VC1,                vc1);
-    REGISTER_PARSER(VORBIS,             vorbis);
-    REGISTER_PARSER(VP3,                vp3);
-    REGISTER_PARSER(VP8,                vp8);
-
-    /* bitstream filters */
-    REGISTER_BSF(AAC_ADTSTOASC,         aac_adtstoasc);
-    REGISTER_BSF(CHOMP,                 chomp);
-    REGISTER_BSF(DUMP_EXTRADATA,        dump_extradata);
-    REGISTER_BSF(H264_MP4TOANNEXB,      h264_mp4toannexb);
-    REGISTER_BSF(IMX_DUMP_HEADER,       imx_dump_header);
-    REGISTER_BSF(MJPEG2JPEG,            mjpeg2jpeg);
-    REGISTER_BSF(MJPEGA_DUMP_HEADER,    mjpega_dump_header);
-    REGISTER_BSF(MOV2TEXTSUB,           mov2textsub);
-    REGISTER_BSF(NOISE,                 noise);
-    REGISTER_BSF(REMOVE_EXTRADATA,      remove_extradata);
-    REGISTER_BSF(TEXT2MOVSUB,           text2movsub);
-}
diff --git a/deps/libav/libavcodec/alsdec.c b/deps/libav/libavcodec/alsdec.c
deleted file mode 100644
index f7dee7d..0000000
--- a/deps/libav/libavcodec/alsdec.c
+++ /dev/null
@@ -1,1785 +0,0 @@
-/*
- * MPEG-4 ALS decoder
- * Copyright (c) 2009 Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG-4 ALS decoder
- * @author Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "unary.h"
-#include "mpeg4audio.h"
-#include "bytestream.h"
-#include "bgmc.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "libavutil/samplefmt.h"
-#include "libavutil/crc.h"
-
-#include <stdint.h>
-
-/** Rice parameters and corresponding index offsets for decoding the
- *  indices of scaled PARCOR values. The table chosen is set globally
- *  by the encoder and stored in ALSSpecificConfig.
- */
-static const int8_t parcor_rice_table[3][20][2] = {
-    { {-52, 4}, {-29, 5}, {-31, 4}, { 19, 4}, {-16, 4},
-      { 12, 3}, { -7, 3}, {  9, 3}, { -5, 3}, {  6, 3},
-      { -4, 3}, {  3, 3}, { -3, 2}, {  3, 2}, { -2, 2},
-      {  3, 2}, { -1, 2}, {  2, 2}, { -1, 2}, {  2, 2} },
-    { {-58, 3}, {-42, 4}, {-46, 4}, { 37, 5}, {-36, 4},
-      { 29, 4}, {-29, 4}, { 25, 4}, {-23, 4}, { 20, 4},
-      {-17, 4}, { 16, 4}, {-12, 4}, { 12, 3}, {-10, 4},
-      {  7, 3}, { -4, 4}, {  3, 3}, { -1, 3}, {  1, 3} },
-    { {-59, 3}, {-45, 5}, {-50, 4}, { 38, 4}, {-39, 4},
-      { 32, 4}, {-30, 4}, { 25, 3}, {-23, 3}, { 20, 3},
-      {-20, 3}, { 16, 3}, {-13, 3}, { 10, 3}, { -7, 3},
-      {  3, 3}, {  0, 3}, { -1, 3}, {  2, 3}, { -1, 2} }
-};
-
-
-/** Scaled PARCOR values used for the first two PARCOR coefficients.
- *  To be indexed by the Rice coded indices.
- *  Generated by: parcor_scaled_values[i] = 32 + ((i * (i+1)) << 7) - (1 << 20)
- *  Actual values are divided by 32 in order to be stored in 16 bits.
- */
-static const int16_t parcor_scaled_values[] = {
-    -1048544 / 32, -1048288 / 32, -1047776 / 32, -1047008 / 32,
-    -1045984 / 32, -1044704 / 32, -1043168 / 32, -1041376 / 32,
-    -1039328 / 32, -1037024 / 32, -1034464 / 32, -1031648 / 32,
-    -1028576 / 32, -1025248 / 32, -1021664 / 32, -1017824 / 32,
-    -1013728 / 32, -1009376 / 32, -1004768 / 32,  -999904 / 32,
-     -994784 / 32,  -989408 / 32,  -983776 / 32,  -977888 / 32,
-     -971744 / 32,  -965344 / 32,  -958688 / 32,  -951776 / 32,
-     -944608 / 32,  -937184 / 32,  -929504 / 32,  -921568 / 32,
-     -913376 / 32,  -904928 / 32,  -896224 / 32,  -887264 / 32,
-     -878048 / 32,  -868576 / 32,  -858848 / 32,  -848864 / 32,
-     -838624 / 32,  -828128 / 32,  -817376 / 32,  -806368 / 32,
-     -795104 / 32,  -783584 / 32,  -771808 / 32,  -759776 / 32,
-     -747488 / 32,  -734944 / 32,  -722144 / 32,  -709088 / 32,
-     -695776 / 32,  -682208 / 32,  -668384 / 32,  -654304 / 32,
-     -639968 / 32,  -625376 / 32,  -610528 / 32,  -595424 / 32,
-     -580064 / 32,  -564448 / 32,  -548576 / 32,  -532448 / 32,
-     -516064 / 32,  -499424 / 32,  -482528 / 32,  -465376 / 32,
-     -447968 / 32,  -430304 / 32,  -412384 / 32,  -394208 / 32,
-     -375776 / 32,  -357088 / 32,  -338144 / 32,  -318944 / 32,
-     -299488 / 32,  -279776 / 32,  -259808 / 32,  -239584 / 32,
-     -219104 / 32,  -198368 / 32,  -177376 / 32,  -156128 / 32,
-     -134624 / 32,  -112864 / 32,   -90848 / 32,   -68576 / 32,
-      -46048 / 32,   -23264 / 32,     -224 / 32,    23072 / 32,
-       46624 / 32,    70432 / 32,    94496 / 32,   118816 / 32,
-      143392 / 32,   168224 / 32,   193312 / 32,   218656 / 32,
-      244256 / 32,   270112 / 32,   296224 / 32,   322592 / 32,
-      349216 / 32,   376096 / 32,   403232 / 32,   430624 / 32,
-      458272 / 32,   486176 / 32,   514336 / 32,   542752 / 32,
-      571424 / 32,   600352 / 32,   629536 / 32,   658976 / 32,
-      688672 / 32,   718624 / 32,   748832 / 32,   779296 / 32,
-      810016 / 32,   840992 / 32,   872224 / 32,   903712 / 32,
-      935456 / 32,   967456 / 32,   999712 / 32,  1032224 / 32
-};
-
-
-/** Gain values of p(0) for long-term prediction.
- *  To be indexed by the Rice coded indices.
- */
-static const uint8_t ltp_gain_values [4][4] = {
-    { 0,  8, 16,  24},
-    {32, 40, 48,  56},
-    {64, 70, 76,  82},
-    {88, 92, 96, 100}
-};
-
-
-/** Inter-channel weighting factors for multi-channel correlation.
- *  To be indexed by the Rice coded indices.
- */
-static const int16_t mcc_weightings[] = {
-    204,  192,  179,  166,  153,  140,  128,  115,
-    102,   89,   76,   64,   51,   38,   25,   12,
-      0,  -12,  -25,  -38,  -51,  -64,  -76,  -89,
-   -102, -115, -128, -140, -153, -166, -179, -192
-};
-
-
-/** Tail codes used in arithmetic coding using block Gilbert-Moore codes.
- */
-static const uint8_t tail_code[16][6] = {
-    { 74, 44, 25, 13,  7, 3},
-    { 68, 42, 24, 13,  7, 3},
-    { 58, 39, 23, 13,  7, 3},
-    {126, 70, 37, 19, 10, 5},
-    {132, 70, 37, 20, 10, 5},
-    {124, 70, 38, 20, 10, 5},
-    {120, 69, 37, 20, 11, 5},
-    {116, 67, 37, 20, 11, 5},
-    {108, 66, 36, 20, 10, 5},
-    {102, 62, 36, 20, 10, 5},
-    { 88, 58, 34, 19, 10, 5},
-    {162, 89, 49, 25, 13, 7},
-    {156, 87, 49, 26, 14, 7},
-    {150, 86, 47, 26, 14, 7},
-    {142, 84, 47, 26, 14, 7},
-    {131, 79, 46, 26, 14, 7}
-};
-
-
-enum RA_Flag {
-    RA_FLAG_NONE,
-    RA_FLAG_FRAMES,
-    RA_FLAG_HEADER
-};
-
-
-typedef struct {
-    uint32_t samples;         ///< number of samples, 0xFFFFFFFF if unknown
-    int resolution;           ///< 000 = 8-bit; 001 = 16-bit; 010 = 24-bit; 011 = 32-bit
-    int floating;             ///< 1 = IEEE 32-bit floating-point, 0 = integer
-    int msb_first;            ///< 1 = original CRC calculated on big-endian system, 0 = little-endian
-    int frame_length;         ///< frame length for each frame (last frame may differ)
-    int ra_distance;          ///< distance between RA frames (in frames, 0...255)
-    enum RA_Flag ra_flag;     ///< indicates where the size of ra units is stored
-    int adapt_order;          ///< adaptive order: 1 = on, 0 = off
-    int coef_table;           ///< table index of Rice code parameters
-    int long_term_prediction; ///< long term prediction (LTP): 1 = on, 0 = off
-    int max_order;            ///< maximum prediction order (0..1023)
-    int block_switching;      ///< number of block switching levels
-    int bgmc;                 ///< "Block Gilbert-Moore Code": 1 = on, 0 = off (Rice coding only)
-    int sb_part;              ///< sub-block partition
-    int joint_stereo;         ///< joint stereo: 1 = on, 0 = off
-    int mc_coding;            ///< extended inter-channel coding (multi channel coding): 1 = on, 0 = off
-    int chan_config;          ///< indicates that a chan_config_info field is present
-    int chan_sort;            ///< channel rearrangement: 1 = on, 0 = off
-    int rlslms;               ///< use "Recursive Least Square-Least Mean Square" predictor: 1 = on, 0 = off
-    int chan_config_info;     ///< mapping of channels to loudspeaker locations. Unused until setting channel configuration is implemented.
-    int *chan_pos;            ///< original channel positions
-    int crc_enabled;          ///< enable Cyclic Redundancy Checksum
-} ALSSpecificConfig;
-
-
-typedef struct {
-    int stop_flag;
-    int master_channel;
-    int time_diff_flag;
-    int time_diff_sign;
-    int time_diff_index;
-    int weighting[6];
-} ALSChannelData;
-
-
-typedef struct {
-    AVCodecContext *avctx;
-    ALSSpecificConfig sconf;
-    GetBitContext gb;
-    DSPContext dsp;
-    const AVCRC *crc_table;
-    uint32_t crc_org;               ///< CRC value of the original input data
-    uint32_t crc;                   ///< CRC value calculated from decoded data
-    unsigned int cur_frame_length;  ///< length of the current frame to decode
-    unsigned int frame_id;          ///< the frame ID / number of the current frame
-    unsigned int js_switch;         ///< if true, joint-stereo decoding is enforced
-    unsigned int num_blocks;        ///< number of blocks used in the current frame
-    unsigned int s_max;             ///< maximum Rice parameter allowed in entropy coding
-    uint8_t *bgmc_lut;              ///< pointer at lookup tables used for BGMC
-    int *bgmc_lut_status;           ///< pointer at lookup table status flags used for BGMC
-    int ltp_lag_length;             ///< number of bits used for ltp lag value
-    int *const_block;               ///< contains const_block flags for all channels
-    unsigned int *shift_lsbs;       ///< contains shift_lsbs flags for all channels
-    unsigned int *opt_order;        ///< contains opt_order flags for all channels
-    int *store_prev_samples;        ///< contains store_prev_samples flags for all channels
-    int *use_ltp;                   ///< contains use_ltp flags for all channels
-    int *ltp_lag;                   ///< contains ltp lag values for all channels
-    int **ltp_gain;                 ///< gain values for ltp 5-tap filter for a channel
-    int *ltp_gain_buffer;           ///< contains all gain values for ltp 5-tap filter
-    int32_t **quant_cof;            ///< quantized parcor coefficients for a channel
-    int32_t *quant_cof_buffer;      ///< contains all quantized parcor coefficients
-    int32_t **lpc_cof;              ///< coefficients of the direct form prediction filter for a channel
-    int32_t *lpc_cof_buffer;        ///< contains all coefficients of the direct form prediction filter
-    int32_t *lpc_cof_reversed_buffer; ///< temporary buffer to set up a reversed versio of lpc_cof_buffer
-    ALSChannelData **chan_data;     ///< channel data for multi-channel correlation
-    ALSChannelData *chan_data_buffer; ///< contains channel data for all channels
-    int *reverted_channels;         ///< stores a flag for each reverted channel
-    int32_t *prev_raw_samples;      ///< contains unshifted raw samples from the previous block
-    int32_t **raw_samples;          ///< decoded raw samples for each channel
-    int32_t *raw_buffer;            ///< contains all decoded raw samples including carryover samples
-    uint8_t *crc_buffer;            ///< buffer of byte order corrected samples used for CRC check
-} ALSDecContext;
-
-
-typedef struct {
-    unsigned int block_length;      ///< number of samples within the block
-    unsigned int ra_block;          ///< if true, this is a random access block
-    int          *const_block;      ///< if true, this is a constant value block
-    int          js_blocks;         ///< true if this block contains a difference signal
-    unsigned int *shift_lsbs;       ///< shift of values for this block
-    unsigned int *opt_order;        ///< prediction order of this block
-    int          *store_prev_samples;///< if true, carryover samples have to be stored
-    int          *use_ltp;          ///< if true, long-term prediction is used
-    int          *ltp_lag;          ///< lag value for long-term prediction
-    int          *ltp_gain;         ///< gain values for ltp 5-tap filter
-    int32_t      *quant_cof;        ///< quantized parcor coefficients
-    int32_t      *lpc_cof;          ///< coefficients of the direct form prediction
-    int32_t      *raw_samples;      ///< decoded raw samples / residuals for this block
-    int32_t      *prev_raw_samples; ///< contains unshifted raw samples from the previous block
-    int32_t      *raw_other;        ///< decoded raw samples of the other channel of a channel pair
-} ALSBlockData;
-
-
-static av_cold void dprint_specific_config(ALSDecContext *ctx)
-{
-#ifdef DEBUG
-    AVCodecContext *avctx    = ctx->avctx;
-    ALSSpecificConfig *sconf = &ctx->sconf;
-
-    av_dlog(avctx, "resolution = %i\n",           sconf->resolution);
-    av_dlog(avctx, "floating = %i\n",             sconf->floating);
-    av_dlog(avctx, "frame_length = %i\n",         sconf->frame_length);
-    av_dlog(avctx, "ra_distance = %i\n",          sconf->ra_distance);
-    av_dlog(avctx, "ra_flag = %i\n",              sconf->ra_flag);
-    av_dlog(avctx, "adapt_order = %i\n",          sconf->adapt_order);
-    av_dlog(avctx, "coef_table = %i\n",           sconf->coef_table);
-    av_dlog(avctx, "long_term_prediction = %i\n", sconf->long_term_prediction);
-    av_dlog(avctx, "max_order = %i\n",            sconf->max_order);
-    av_dlog(avctx, "block_switching = %i\n",      sconf->block_switching);
-    av_dlog(avctx, "bgmc = %i\n",                 sconf->bgmc);
-    av_dlog(avctx, "sb_part = %i\n",              sconf->sb_part);
-    av_dlog(avctx, "joint_stereo = %i\n",         sconf->joint_stereo);
-    av_dlog(avctx, "mc_coding = %i\n",            sconf->mc_coding);
-    av_dlog(avctx, "chan_config = %i\n",          sconf->chan_config);
-    av_dlog(avctx, "chan_sort = %i\n",            sconf->chan_sort);
-    av_dlog(avctx, "RLSLMS = %i\n",               sconf->rlslms);
-    av_dlog(avctx, "chan_config_info = %i\n",     sconf->chan_config_info);
-#endif
-}
-
-
-/** Read an ALSSpecificConfig from a buffer into the output struct.
- */
-static av_cold int read_specific_config(ALSDecContext *ctx)
-{
-    GetBitContext gb;
-    uint64_t ht_size;
-    int i, config_offset;
-    MPEG4AudioConfig m4ac;
-    ALSSpecificConfig *sconf = &ctx->sconf;
-    AVCodecContext *avctx    = ctx->avctx;
-    uint32_t als_id, header_size, trailer_size;
-
-    init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8);
-
-    config_offset = avpriv_mpeg4audio_get_config(&m4ac, avctx->extradata,
-                                                 avctx->extradata_size * 8, 1);
-
-    if (config_offset < 0)
-        return AVERROR_INVALIDDATA;
-
-    skip_bits_long(&gb, config_offset);
-
-    if (get_bits_left(&gb) < (30 << 3))
-        return AVERROR_INVALIDDATA;
-
-    // read the fixed items
-    als_id                      = get_bits_long(&gb, 32);
-    avctx->sample_rate          = m4ac.sample_rate;
-    skip_bits_long(&gb, 32); // sample rate already known
-    sconf->samples              = get_bits_long(&gb, 32);
-    avctx->channels             = m4ac.channels;
-    skip_bits(&gb, 16);      // number of channels already knwon
-    skip_bits(&gb, 3);       // skip file_type
-    sconf->resolution           = get_bits(&gb, 3);
-    sconf->floating             = get_bits1(&gb);
-    sconf->msb_first            = get_bits1(&gb);
-    sconf->frame_length         = get_bits(&gb, 16) + 1;
-    sconf->ra_distance          = get_bits(&gb, 8);
-    sconf->ra_flag              = get_bits(&gb, 2);
-    sconf->adapt_order          = get_bits1(&gb);
-    sconf->coef_table           = get_bits(&gb, 2);
-    sconf->long_term_prediction = get_bits1(&gb);
-    sconf->max_order            = get_bits(&gb, 10);
-    sconf->block_switching      = get_bits(&gb, 2);
-    sconf->bgmc                 = get_bits1(&gb);
-    sconf->sb_part              = get_bits1(&gb);
-    sconf->joint_stereo         = get_bits1(&gb);
-    sconf->mc_coding            = get_bits1(&gb);
-    sconf->chan_config          = get_bits1(&gb);
-    sconf->chan_sort            = get_bits1(&gb);
-    sconf->crc_enabled          = get_bits1(&gb);
-    sconf->rlslms               = get_bits1(&gb);
-    skip_bits(&gb, 5);       // skip 5 reserved bits
-    skip_bits1(&gb);         // skip aux_data_enabled
-
-
-    // check for ALSSpecificConfig struct
-    if (als_id != MKBETAG('A','L','S','\0'))
-        return AVERROR_INVALIDDATA;
-
-    ctx->cur_frame_length = sconf->frame_length;
-
-    // read channel config
-    if (sconf->chan_config)
-        sconf->chan_config_info = get_bits(&gb, 16);
-    // TODO: use this to set avctx->channel_layout
-
-
-    // read channel sorting
-    if (sconf->chan_sort && avctx->channels > 1) {
-        int chan_pos_bits = av_ceil_log2(avctx->channels);
-        int bits_needed  = avctx->channels * chan_pos_bits + 7;
-        if (get_bits_left(&gb) < bits_needed)
-            return AVERROR_INVALIDDATA;
-
-        if (!(sconf->chan_pos = av_malloc(avctx->channels * sizeof(*sconf->chan_pos))))
-            return AVERROR(ENOMEM);
-
-        for (i = 0; i < avctx->channels; i++)
-            sconf->chan_pos[i] = get_bits(&gb, chan_pos_bits);
-
-        align_get_bits(&gb);
-        // TODO: use this to actually do channel sorting
-    } else {
-        sconf->chan_sort = 0;
-    }
-
-
-    // read fixed header and trailer sizes,
-    // if size = 0xFFFFFFFF then there is no data field!
-    if (get_bits_left(&gb) < 64)
-        return AVERROR_INVALIDDATA;
-
-    header_size  = get_bits_long(&gb, 32);
-    trailer_size = get_bits_long(&gb, 32);
-    if (header_size  == 0xFFFFFFFF)
-        header_size  = 0;
-    if (trailer_size == 0xFFFFFFFF)
-        trailer_size = 0;
-
-    ht_size = ((int64_t)(header_size) + (int64_t)(trailer_size)) << 3;
-
-
-    // skip the header and trailer data
-    if (get_bits_left(&gb) < ht_size)
-        return AVERROR_INVALIDDATA;
-
-    if (ht_size > INT32_MAX)
-        return AVERROR_PATCHWELCOME;
-
-    skip_bits_long(&gb, ht_size);
-
-
-    // initialize CRC calculation
-    if (sconf->crc_enabled) {
-        if (get_bits_left(&gb) < 32)
-            return AVERROR_INVALIDDATA;
-
-        if (avctx->err_recognition & AV_EF_CRCCHECK) {
-            ctx->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
-            ctx->crc       = 0xFFFFFFFF;
-            ctx->crc_org   = ~get_bits_long(&gb, 32);
-        } else
-            skip_bits_long(&gb, 32);
-    }
-
-
-    // no need to read the rest of ALSSpecificConfig (ra_unit_size & aux data)
-
-    dprint_specific_config(ctx);
-
-    return 0;
-}
-
-
-/** Check the ALSSpecificConfig for unsupported features.
- */
-static int check_specific_config(ALSDecContext *ctx)
-{
-    ALSSpecificConfig *sconf = &ctx->sconf;
-    int error = 0;
-
-    // report unsupported feature and set error value
-    #define MISSING_ERR(cond, str, errval)              \
-    {                                                   \
-        if (cond) {                                     \
-            avpriv_report_missing_feature(ctx->avctx,   \
-                                          str);         \
-            error = errval;                             \
-        }                                               \
-    }
-
-    MISSING_ERR(sconf->floating,  "Floating point decoding",     AVERROR_PATCHWELCOME);
-    MISSING_ERR(sconf->rlslms,    "Adaptive RLS-LMS prediction", AVERROR_PATCHWELCOME);
-    MISSING_ERR(sconf->chan_sort, "Channel sorting",             0);
-
-    return error;
-}
-
-
-/** Parse the bs_info field to extract the block partitioning used in
- *  block switching mode, refer to ISO/IEC 14496-3, section 11.6.2.
- */
-static void parse_bs_info(const uint32_t bs_info, unsigned int n,
-                          unsigned int div, unsigned int **div_blocks,
-                          unsigned int *num_blocks)
-{
-    if (n < 31 && ((bs_info << n) & 0x40000000)) {
-        // if the level is valid and the investigated bit n is set
-        // then recursively check both children at bits (2n+1) and (2n+2)
-        n   *= 2;
-        div += 1;
-        parse_bs_info(bs_info, n + 1, div, div_blocks, num_blocks);
-        parse_bs_info(bs_info, n + 2, div, div_blocks, num_blocks);
-    } else {
-        // else the bit is not set or the last level has been reached
-        // (bit implicitly not set)
-        **div_blocks = div;
-        (*div_blocks)++;
-        (*num_blocks)++;
-    }
-}
-
-
-/** Read and decode a Rice codeword.
- */
-static int32_t decode_rice(GetBitContext *gb, unsigned int k)
-{
-    int max = get_bits_left(gb) - k;
-    int q   = get_unary(gb, 0, max);
-    int r   = k ? get_bits1(gb) : !(q & 1);
-
-    if (k > 1) {
-        q <<= (k - 1);
-        q  += get_bits_long(gb, k - 1);
-    } else if (!k) {
-        q >>= 1;
-    }
-    return r ? q : ~q;
-}
-
-
-/** Convert PARCOR coefficient k to direct filter coefficient.
- */
-static void parcor_to_lpc(unsigned int k, const int32_t *par, int32_t *cof)
-{
-    int i, j;
-
-    for (i = 0, j = k - 1; i < j; i++, j--) {
-        int tmp1 = ((MUL64(par[k], cof[j]) + (1 << 19)) >> 20);
-        cof[j]  += ((MUL64(par[k], cof[i]) + (1 << 19)) >> 20);
-        cof[i]  += tmp1;
-    }
-    if (i == j)
-        cof[i] += ((MUL64(par[k], cof[j]) + (1 << 19)) >> 20);
-
-    cof[k] = par[k];
-}
-
-
-/** Read block switching field if necessary and set actual block sizes.
- *  Also assure that the block sizes of the last frame correspond to the
- *  actual number of samples.
- */
-static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks,
-                            uint32_t *bs_info)
-{
-    ALSSpecificConfig *sconf     = &ctx->sconf;
-    GetBitContext *gb            = &ctx->gb;
-    unsigned int *ptr_div_blocks = div_blocks;
-    unsigned int b;
-
-    if (sconf->block_switching) {
-        unsigned int bs_info_len = 1 << (sconf->block_switching + 2);
-        *bs_info = get_bits_long(gb, bs_info_len);
-        *bs_info <<= (32 - bs_info_len);
-    }
-
-    ctx->num_blocks = 0;
-    parse_bs_info(*bs_info, 0, 0, &ptr_div_blocks, &ctx->num_blocks);
-
-    // The last frame may have an overdetermined block structure given in
-    // the bitstream. In that case the defined block structure would need
-    // more samples than available to be consistent.
-    // The block structure is actually used but the block sizes are adapted
-    // to fit the actual number of available samples.
-    // Example: 5 samples, 2nd level block sizes: 2 2 2 2.
-    // This results in the actual block sizes:    2 2 1 0.
-    // This is not specified in 14496-3 but actually done by the reference
-    // codec RM22 revision 2.
-    // This appears to happen in case of an odd number of samples in the last
-    // frame which is actually not allowed by the block length switching part
-    // of 14496-3.
-    // The ALS conformance files feature an odd number of samples in the last
-    // frame.
-
-    for (b = 0; b < ctx->num_blocks; b++)
-        div_blocks[b] = ctx->sconf.frame_length >> div_blocks[b];
-
-    if (ctx->cur_frame_length != ctx->sconf.frame_length) {
-        unsigned int remaining = ctx->cur_frame_length;
-
-        for (b = 0; b < ctx->num_blocks; b++) {
-            if (remaining <= div_blocks[b]) {
-                div_blocks[b] = remaining;
-                ctx->num_blocks = b + 1;
-                break;
-            }
-
-            remaining -= div_blocks[b];
-        }
-    }
-}
-
-
-/** Read the block data for a constant block
- */
-static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
-{
-    ALSSpecificConfig *sconf = &ctx->sconf;
-    AVCodecContext *avctx    = ctx->avctx;
-    GetBitContext *gb        = &ctx->gb;
-
-    *bd->raw_samples = 0;
-    *bd->const_block = get_bits1(gb);    // 1 = constant value, 0 = zero block (silence)
-    bd->js_blocks    = get_bits1(gb);
-
-    // skip 5 reserved bits
-    skip_bits(gb, 5);
-
-    if (*bd->const_block) {
-        unsigned int const_val_bits = sconf->floating ? 24 : avctx->bits_per_raw_sample;
-        *bd->raw_samples = get_sbits_long(gb, const_val_bits);
-    }
-
-    // ensure constant block decoding by reusing this field
-    *bd->const_block = 1;
-}
-
-
-/** Decode the block data for a constant block
- */
-static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
-{
-    int      smp = bd->block_length - 1;
-    int32_t  val = *bd->raw_samples;
-    int32_t *dst = bd->raw_samples + 1;
-
-    // write raw samples into buffer
-    for (; smp; smp--)
-        *dst++ = val;
-}
-
-
-/** Read the block data for a non-constant block
- */
-static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
-{
-    ALSSpecificConfig *sconf = &ctx->sconf;
-    AVCodecContext *avctx    = ctx->avctx;
-    GetBitContext *gb        = &ctx->gb;
-    unsigned int k;
-    unsigned int s[8];
-    unsigned int sx[8];
-    unsigned int sub_blocks, log2_sub_blocks, sb_length;
-    unsigned int start      = 0;
-    unsigned int opt_order;
-    int          sb;
-    int32_t      *quant_cof = bd->quant_cof;
-    int32_t      *current_res;
-
-
-    // ensure variable block decoding by reusing this field
-    *bd->const_block = 0;
-
-    *bd->opt_order  = 1;
-    bd->js_blocks   = get_bits1(gb);
-
-    opt_order       = *bd->opt_order;
-
-    // determine the number of subblocks for entropy decoding
-    if (!sconf->bgmc && !sconf->sb_part) {
-        log2_sub_blocks = 0;
-    } else {
-        if (sconf->bgmc && sconf->sb_part)
-            log2_sub_blocks = get_bits(gb, 2);
-        else
-            log2_sub_blocks = 2 * get_bits1(gb);
-    }
-
-    sub_blocks = 1 << log2_sub_blocks;
-
-    // do not continue in case of a damaged stream since
-    // block_length must be evenly divisible by sub_blocks
-    if (bd->block_length & (sub_blocks - 1)) {
-        av_log(avctx, AV_LOG_WARNING,
-               "Block length is not evenly divisible by the number of subblocks.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    sb_length = bd->block_length >> log2_sub_blocks;
-
-    if (sconf->bgmc) {
-        s[0] = get_bits(gb, 8 + (sconf->resolution > 1));
-        for (k = 1; k < sub_blocks; k++)
-            s[k] = s[k - 1] + decode_rice(gb, 2);
-
-        for (k = 0; k < sub_blocks; k++) {
-            sx[k]   = s[k] & 0x0F;
-            s [k] >>= 4;
-        }
-    } else {
-        s[0] = get_bits(gb, 4 + (sconf->resolution > 1));
-        for (k = 1; k < sub_blocks; k++)
-            s[k] = s[k - 1] + decode_rice(gb, 0);
-    }
-    for (k = 1; k < sub_blocks; k++)
-        if (s[k] > 32) {
-            av_log(avctx, AV_LOG_ERROR, "k invalid for rice code.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-    if (get_bits1(gb))
-        *bd->shift_lsbs = get_bits(gb, 4) + 1;
-
-    *bd->store_prev_samples = (bd->js_blocks && bd->raw_other) || *bd->shift_lsbs;
-
-
-    if (!sconf->rlslms) {
-        if (sconf->adapt_order) {
-            int opt_order_length = av_ceil_log2(av_clip((bd->block_length >> 3) - 1,
-                                                2, sconf->max_order + 1));
-            *bd->opt_order       = get_bits(gb, opt_order_length);
-            if (*bd->opt_order > sconf->max_order) {
-                *bd->opt_order = sconf->max_order;
-                av_log(avctx, AV_LOG_ERROR, "Predictor order too large!\n");
-                return AVERROR_INVALIDDATA;
-            }
-        } else {
-            *bd->opt_order = sconf->max_order;
-        }
-
-        opt_order = *bd->opt_order;
-
-        if (opt_order) {
-            int add_base;
-
-            if (sconf->coef_table == 3) {
-                add_base = 0x7F;
-
-                // read coefficient 0
-                quant_cof[0] = 32 * parcor_scaled_values[get_bits(gb, 7)];
-
-                // read coefficient 1
-                if (opt_order > 1)
-                    quant_cof[1] = -32 * parcor_scaled_values[get_bits(gb, 7)];
-
-                // read coefficients 2 to opt_order
-                for (k = 2; k < opt_order; k++)
-                    quant_cof[k] = get_bits(gb, 7);
-            } else {
-                int k_max;
-                add_base = 1;
-
-                // read coefficient 0 to 19
-                k_max = FFMIN(opt_order, 20);
-                for (k = 0; k < k_max; k++) {
-                    int rice_param = parcor_rice_table[sconf->coef_table][k][1];
-                    int offset     = parcor_rice_table[sconf->coef_table][k][0];
-                    quant_cof[k] = decode_rice(gb, rice_param) + offset;
-                    if (quant_cof[k] < -64 || quant_cof[k] > 63) {
-                        av_log(avctx, AV_LOG_ERROR, "quant_cof %d is out of range\n", quant_cof[k]);
-                        return AVERROR_INVALIDDATA;
-                    }
-                }
-
-                // read coefficients 20 to 126
-                k_max = FFMIN(opt_order, 127);
-                for (; k < k_max; k++)
-                    quant_cof[k] = decode_rice(gb, 2) + (k & 1);
-
-                // read coefficients 127 to opt_order
-                for (; k < opt_order; k++)
-                    quant_cof[k] = decode_rice(gb, 1);
-
-                quant_cof[0] = 32 * parcor_scaled_values[quant_cof[0] + 64];
-
-                if (opt_order > 1)
-                    quant_cof[1] = -32 * parcor_scaled_values[quant_cof[1] + 64];
-            }
-
-            for (k = 2; k < opt_order; k++)
-                quant_cof[k] = (quant_cof[k] << 14) + (add_base << 13);
-        }
-    }
-
-    // read LTP gain and lag values
-    if (sconf->long_term_prediction) {
-        *bd->use_ltp = get_bits1(gb);
-
-        if (*bd->use_ltp) {
-            int r, c;
-
-            bd->ltp_gain[0]   = decode_rice(gb, 1) << 3;
-            bd->ltp_gain[1]   = decode_rice(gb, 2) << 3;
-
-            r                 = get_unary(gb, 0, 3);
-            c                 = get_bits(gb, 2);
-            bd->ltp_gain[2]   = ltp_gain_values[r][c];
-
-            bd->ltp_gain[3]   = decode_rice(gb, 2) << 3;
-            bd->ltp_gain[4]   = decode_rice(gb, 1) << 3;
-
-            *bd->ltp_lag      = get_bits(gb, ctx->ltp_lag_length);
-            *bd->ltp_lag     += FFMAX(4, opt_order + 1);
-        }
-    }
-
-    // read first value and residuals in case of a random access block
-    if (bd->ra_block) {
-        if (opt_order)
-            bd->raw_samples[0] = decode_rice(gb, avctx->bits_per_raw_sample - 4);
-        if (opt_order > 1)
-            bd->raw_samples[1] = decode_rice(gb, FFMIN(s[0] + 3, ctx->s_max));
-        if (opt_order > 2)
-            bd->raw_samples[2] = decode_rice(gb, FFMIN(s[0] + 1, ctx->s_max));
-
-        start = FFMIN(opt_order, 3);
-    }
-
-    // read all residuals
-    if (sconf->bgmc) {
-        int          delta[8];
-        unsigned int k    [8];
-        unsigned int b = av_clip((av_ceil_log2(bd->block_length) - 3) >> 1, 0, 5);
-
-        // read most significant bits
-        unsigned int high;
-        unsigned int low;
-        unsigned int value;
-
-        ff_bgmc_decode_init(gb, &high, &low, &value);
-
-        current_res = bd->raw_samples + start;
-
-        for (sb = 0; sb < sub_blocks; sb++) {
-            unsigned int sb_len  = sb_length - (sb ? 0 : start);
-
-            k    [sb] = s[sb] > b ? s[sb] - b : 0;
-            delta[sb] = 5 - s[sb] + k[sb];
-
-            ff_bgmc_decode(gb, sb_len, current_res,
-                        delta[sb], sx[sb], &high, &low, &value, ctx->bgmc_lut, ctx->bgmc_lut_status);
-
-            current_res += sb_len;
-        }
-
-        ff_bgmc_decode_end(gb);
-
-
-        // read least significant bits and tails
-        current_res = bd->raw_samples + start;
-
-        for (sb = 0; sb < sub_blocks; sb++, start = 0) {
-            unsigned int cur_tail_code = tail_code[sx[sb]][delta[sb]];
-            unsigned int cur_k         = k[sb];
-            unsigned int cur_s         = s[sb];
-
-            for (; start < sb_length; start++) {
-                int32_t res = *current_res;
-
-                if (res == cur_tail_code) {
-                    unsigned int max_msb =   (2 + (sx[sb] > 2) + (sx[sb] > 10))
-                                          << (5 - delta[sb]);
-
-                    res = decode_rice(gb, cur_s);
-
-                    if (res >= 0) {
-                        res += (max_msb    ) << cur_k;
-                    } else {
-                        res -= (max_msb - 1) << cur_k;
-                    }
-                } else {
-                    if (res > cur_tail_code)
-                        res--;
-
-                    if (res & 1)
-                        res = -res;
-
-                    res >>= 1;
-
-                    if (cur_k) {
-                        res <<= cur_k;
-                        res  |= get_bits_long(gb, cur_k);
-                    }
-                }
-
-                *current_res++ = res;
-            }
-        }
-    } else {
-        current_res = bd->raw_samples + start;
-
-        for (sb = 0; sb < sub_blocks; sb++, start = 0)
-            for (; start < sb_length; start++)
-                *current_res++ = decode_rice(gb, s[sb]);
-     }
-
-    if (!sconf->mc_coding || ctx->js_switch)
-        align_get_bits(gb);
-
-    return 0;
-}
-
-
-/** Decode the block data for a non-constant block
- */
-static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
-{
-    ALSSpecificConfig *sconf = &ctx->sconf;
-    unsigned int block_length = bd->block_length;
-    unsigned int smp = 0;
-    unsigned int k;
-    int opt_order             = *bd->opt_order;
-    int sb;
-    int64_t y;
-    int32_t *quant_cof        = bd->quant_cof;
-    int32_t *lpc_cof          = bd->lpc_cof;
-    int32_t *raw_samples      = bd->raw_samples;
-    int32_t *raw_samples_end  = bd->raw_samples + bd->block_length;
-    int32_t *lpc_cof_reversed = ctx->lpc_cof_reversed_buffer;
-
-    // reverse long-term prediction
-    if (*bd->use_ltp) {
-        int ltp_smp;
-
-        for (ltp_smp = FFMAX(*bd->ltp_lag - 2, 0); ltp_smp < block_length; ltp_smp++) {
-            int center = ltp_smp - *bd->ltp_lag;
-            int begin  = FFMAX(0, center - 2);
-            int end    = center + 3;
-            int tab    = 5 - (end - begin);
-            int base;
-
-            y = 1 << 6;
-
-            for (base = begin; base < end; base++, tab++)
-                y += MUL64(bd->ltp_gain[tab], raw_samples[base]);
-
-            raw_samples[ltp_smp] += y >> 7;
-        }
-    }
-
-    // reconstruct all samples from residuals
-    if (bd->ra_block) {
-        for (smp = 0; smp < opt_order; smp++) {
-            y = 1 << 19;
-
-            for (sb = 0; sb < smp; sb++)
-                y += MUL64(lpc_cof[sb], raw_samples[-(sb + 1)]);
-
-            *raw_samples++ -= y >> 20;
-            parcor_to_lpc(smp, quant_cof, lpc_cof);
-        }
-    } else {
-        for (k = 0; k < opt_order; k++)
-            parcor_to_lpc(k, quant_cof, lpc_cof);
-
-        // store previous samples in case that they have to be altered
-        if (*bd->store_prev_samples)
-            memcpy(bd->prev_raw_samples, raw_samples - sconf->max_order,
-                   sizeof(*bd->prev_raw_samples) * sconf->max_order);
-
-        // reconstruct difference signal for prediction (joint-stereo)
-        if (bd->js_blocks && bd->raw_other) {
-            int32_t *left, *right;
-
-            if (bd->raw_other > raw_samples) {  // D = R - L
-                left  = raw_samples;
-                right = bd->raw_other;
-            } else {                                // D = R - L
-                left  = bd->raw_other;
-                right = raw_samples;
-            }
-
-            for (sb = -1; sb >= -sconf->max_order; sb--)
-                raw_samples[sb] = right[sb] - left[sb];
-        }
-
-        // reconstruct shifted signal
-        if (*bd->shift_lsbs)
-            for (sb = -1; sb >= -sconf->max_order; sb--)
-                raw_samples[sb] >>= *bd->shift_lsbs;
-    }
-
-    // reverse linear prediction coefficients for efficiency
-    lpc_cof = lpc_cof + opt_order;
-
-    for (sb = 0; sb < opt_order; sb++)
-        lpc_cof_reversed[sb] = lpc_cof[-(sb + 1)];
-
-    // reconstruct raw samples
-    raw_samples = bd->raw_samples + smp;
-    lpc_cof     = lpc_cof_reversed + opt_order;
-
-    for (; raw_samples < raw_samples_end; raw_samples++) {
-        y = 1 << 19;
-
-        for (sb = -opt_order; sb < 0; sb++)
-            y += MUL64(lpc_cof[sb], raw_samples[sb]);
-
-        *raw_samples -= y >> 20;
-    }
-
-    raw_samples = bd->raw_samples;
-
-    // restore previous samples in case that they have been altered
-    if (*bd->store_prev_samples)
-        memcpy(raw_samples - sconf->max_order, bd->prev_raw_samples,
-               sizeof(*raw_samples) * sconf->max_order);
-
-    return 0;
-}
-
-
-/** Read the block data.
- */
-static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
-{
-    int ret = 0;
-    GetBitContext *gb        = &ctx->gb;
-
-    *bd->shift_lsbs = 0;
-    // read block type flag and read the samples accordingly
-    if (get_bits1(gb)) {
-        ret = read_var_block_data(ctx, bd);
-    } else {
-        read_const_block_data(ctx, bd);
-    }
-
-    return ret;
-}
-
-
-/** Decode the block data.
- */
-static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)
-{
-    unsigned int smp;
-    int ret = 0;
-
-    // read block type flag and read the samples accordingly
-    if (*bd->const_block)
-        decode_const_block_data(ctx, bd);
-    else
-        ret = decode_var_block_data(ctx, bd); // always return 0
-
-    if (ret < 0)
-        return ret;
-
-    // TODO: read RLSLMS extension data
-
-    if (*bd->shift_lsbs)
-        for (smp = 0; smp < bd->block_length; smp++)
-            bd->raw_samples[smp] <<= *bd->shift_lsbs;
-
-    return 0;
-}
-
-
-/** Read and decode block data successively.
- */
-static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd)
-{
-    int ret;
-
-    if ((ret = read_block(ctx, bd)) < 0)
-        return ret;
-
-    return decode_block(ctx, bd);
-}
-
-
-/** Compute the number of samples left to decode for the current frame and
- *  sets these samples to zero.
- */
-static void zero_remaining(unsigned int b, unsigned int b_max,
-                           const unsigned int *div_blocks, int32_t *buf)
-{
-    unsigned int count = 0;
-
-    for (; b < b_max; b++)
-        count += div_blocks[b];
-
-    if (count)
-        memset(buf, 0, sizeof(*buf) * count);
-}
-
-
-/** Decode blocks independently.
- */
-static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame,
-                             unsigned int c, const unsigned int *div_blocks,
-                             unsigned int *js_blocks)
-{
-    int ret;
-    unsigned int b;
-    ALSBlockData bd = { 0 };
-
-    bd.ra_block         = ra_frame;
-    bd.const_block      = ctx->const_block;
-    bd.shift_lsbs       = ctx->shift_lsbs;
-    bd.opt_order        = ctx->opt_order;
-    bd.store_prev_samples = ctx->store_prev_samples;
-    bd.use_ltp          = ctx->use_ltp;
-    bd.ltp_lag          = ctx->ltp_lag;
-    bd.ltp_gain         = ctx->ltp_gain[0];
-    bd.quant_cof        = ctx->quant_cof[0];
-    bd.lpc_cof          = ctx->lpc_cof[0];
-    bd.prev_raw_samples = ctx->prev_raw_samples;
-    bd.raw_samples      = ctx->raw_samples[c];
-
-
-    for (b = 0; b < ctx->num_blocks; b++) {
-        bd.block_length     = div_blocks[b];
-
-        if ((ret = read_decode_block(ctx, &bd)) < 0) {
-            // damaged block, write zero for the rest of the frame
-            zero_remaining(b, ctx->num_blocks, div_blocks, bd.raw_samples);
-            return ret;
-        }
-        bd.raw_samples += div_blocks[b];
-        bd.ra_block     = 0;
-    }
-
-    return 0;
-}
-
-
-/** Decode blocks dependently.
- */
-static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,
-                         unsigned int c, const unsigned int *div_blocks,
-                         unsigned int *js_blocks)
-{
-    ALSSpecificConfig *sconf = &ctx->sconf;
-    unsigned int offset = 0;
-    unsigned int b;
-    int ret;
-    ALSBlockData bd[2] = { { 0 } };
-
-    bd[0].ra_block         = ra_frame;
-    bd[0].const_block      = ctx->const_block;
-    bd[0].shift_lsbs       = ctx->shift_lsbs;
-    bd[0].opt_order        = ctx->opt_order;
-    bd[0].store_prev_samples = ctx->store_prev_samples;
-    bd[0].use_ltp          = ctx->use_ltp;
-    bd[0].ltp_lag          = ctx->ltp_lag;
-    bd[0].ltp_gain         = ctx->ltp_gain[0];
-    bd[0].quant_cof        = ctx->quant_cof[0];
-    bd[0].lpc_cof          = ctx->lpc_cof[0];
-    bd[0].prev_raw_samples = ctx->prev_raw_samples;
-    bd[0].js_blocks        = *js_blocks;
-
-    bd[1].ra_block         = ra_frame;
-    bd[1].const_block      = ctx->const_block;
-    bd[1].shift_lsbs       = ctx->shift_lsbs;
-    bd[1].opt_order        = ctx->opt_order;
-    bd[1].store_prev_samples = ctx->store_prev_samples;
-    bd[1].use_ltp          = ctx->use_ltp;
-    bd[1].ltp_lag          = ctx->ltp_lag;
-    bd[1].ltp_gain         = ctx->ltp_gain[0];
-    bd[1].quant_cof        = ctx->quant_cof[0];
-    bd[1].lpc_cof          = ctx->lpc_cof[0];
-    bd[1].prev_raw_samples = ctx->prev_raw_samples;
-    bd[1].js_blocks        = *(js_blocks + 1);
-
-    // decode all blocks
-    for (b = 0; b < ctx->num_blocks; b++) {
-        unsigned int s;
-
-        bd[0].block_length = div_blocks[b];
-        bd[1].block_length = div_blocks[b];
-
-        bd[0].raw_samples  = ctx->raw_samples[c    ] + offset;
-        bd[1].raw_samples  = ctx->raw_samples[c + 1] + offset;
-
-        bd[0].raw_other    = bd[1].raw_samples;
-        bd[1].raw_other    = bd[0].raw_samples;
-
-        if ((ret = read_decode_block(ctx, &bd[0])) < 0 ||
-            (ret = read_decode_block(ctx, &bd[1])) < 0)
-            goto fail;
-
-        // reconstruct joint-stereo blocks
-        if (bd[0].js_blocks) {
-            if (bd[1].js_blocks)
-                av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel pair!\n");
-
-            for (s = 0; s < div_blocks[b]; s++)
-                bd[0].raw_samples[s] = bd[1].raw_samples[s] - bd[0].raw_samples[s];
-        } else if (bd[1].js_blocks) {
-            for (s = 0; s < div_blocks[b]; s++)
-                bd[1].raw_samples[s] = bd[1].raw_samples[s] + bd[0].raw_samples[s];
-        }
-
-        offset  += div_blocks[b];
-        bd[0].ra_block = 0;
-        bd[1].ra_block = 0;
-    }
-
-    // store carryover raw samples,
-    // the others channel raw samples are stored by the calling function.
-    memmove(ctx->raw_samples[c] - sconf->max_order,
-            ctx->raw_samples[c] - sconf->max_order + sconf->frame_length,
-            sizeof(*ctx->raw_samples[c]) * sconf->max_order);
-
-    return 0;
-fail:
-    // damaged block, write zero for the rest of the frame
-    zero_remaining(b, ctx->num_blocks, div_blocks, bd[0].raw_samples);
-    zero_remaining(b, ctx->num_blocks, div_blocks, bd[1].raw_samples);
-    return ret;
-}
-
-static inline int als_weighting(GetBitContext *gb, int k, int off)
-{
-    int idx = av_clip(decode_rice(gb, k) + off,
-                      0, FF_ARRAY_ELEMS(mcc_weightings) - 1);
-    return mcc_weightings[idx];
-}
-
-/** Read the channel data.
-  */
-static int read_channel_data(ALSDecContext *ctx, ALSChannelData *cd, int c)
-{
-    GetBitContext *gb       = &ctx->gb;
-    ALSChannelData *current = cd;
-    unsigned int channels   = ctx->avctx->channels;
-    int entries             = 0;
-
-    while (entries < channels && !(current->stop_flag = get_bits1(gb))) {
-        current->master_channel = get_bits_long(gb, av_ceil_log2(channels));
-
-        if (current->master_channel >= channels) {
-            av_log(ctx->avctx, AV_LOG_ERROR, "Invalid master channel!\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (current->master_channel != c) {
-            current->time_diff_flag = get_bits1(gb);
-            current->weighting[0]   = als_weighting(gb, 1, 16);
-            current->weighting[1]   = als_weighting(gb, 2, 14);
-            current->weighting[2]   = als_weighting(gb, 1, 16);
-
-            if (current->time_diff_flag) {
-                current->weighting[3] = als_weighting(gb, 1, 16);
-                current->weighting[4] = als_weighting(gb, 1, 16);
-                current->weighting[5] = als_weighting(gb, 1, 16);
-
-                current->time_diff_sign  = get_bits1(gb);
-                current->time_diff_index = get_bits(gb, ctx->ltp_lag_length - 3) + 3;
-            }
-        }
-
-        current++;
-        entries++;
-    }
-
-    if (entries == channels) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Damaged channel data!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    align_get_bits(gb);
-    return 0;
-}
-
-
-/** Recursively reverts the inter-channel correlation for a block.
- */
-static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
-                                       ALSChannelData **cd, int *reverted,
-                                       unsigned int offset, int c)
-{
-    ALSChannelData *ch = cd[c];
-    unsigned int   dep = 0;
-    unsigned int channels = ctx->avctx->channels;
-
-    if (reverted[c])
-        return 0;
-
-    reverted[c] = 1;
-
-    while (dep < channels && !ch[dep].stop_flag) {
-        revert_channel_correlation(ctx, bd, cd, reverted, offset,
-                                   ch[dep].master_channel);
-
-        dep++;
-    }
-
-    if (dep == channels) {
-        av_log(ctx->avctx, AV_LOG_WARNING, "Invalid channel correlation!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    bd->const_block = ctx->const_block + c;
-    bd->shift_lsbs  = ctx->shift_lsbs + c;
-    bd->opt_order   = ctx->opt_order + c;
-    bd->store_prev_samples = ctx->store_prev_samples + c;
-    bd->use_ltp     = ctx->use_ltp + c;
-    bd->ltp_lag     = ctx->ltp_lag + c;
-    bd->ltp_gain    = ctx->ltp_gain[c];
-    bd->lpc_cof     = ctx->lpc_cof[c];
-    bd->quant_cof   = ctx->quant_cof[c];
-    bd->raw_samples = ctx->raw_samples[c] + offset;
-
-    dep = 0;
-    while (!ch[dep].stop_flag) {
-        unsigned int smp;
-        unsigned int begin = 1;
-        unsigned int end   = bd->block_length - 1;
-        int64_t y;
-        int32_t *master = ctx->raw_samples[ch[dep].master_channel] + offset;
-
-        if (ch[dep].time_diff_flag) {
-            int t = ch[dep].time_diff_index;
-
-            if (ch[dep].time_diff_sign) {
-                t      = -t;
-                begin -= t;
-            } else {
-                end   -= t;
-            }
-
-            for (smp = begin; smp < end; smp++) {
-                y  = (1 << 6) +
-                     MUL64(ch[dep].weighting[0], master[smp - 1    ]) +
-                     MUL64(ch[dep].weighting[1], master[smp        ]) +
-                     MUL64(ch[dep].weighting[2], master[smp + 1    ]) +
-                     MUL64(ch[dep].weighting[3], master[smp - 1 + t]) +
-                     MUL64(ch[dep].weighting[4], master[smp     + t]) +
-                     MUL64(ch[dep].weighting[5], master[smp + 1 + t]);
-
-                bd->raw_samples[smp] += y >> 7;
-            }
-        } else {
-            for (smp = begin; smp < end; smp++) {
-                y  = (1 << 6) +
-                     MUL64(ch[dep].weighting[0], master[smp - 1]) +
-                     MUL64(ch[dep].weighting[1], master[smp    ]) +
-                     MUL64(ch[dep].weighting[2], master[smp + 1]);
-
-                bd->raw_samples[smp] += y >> 7;
-            }
-        }
-
-        dep++;
-    }
-
-    return 0;
-}
-
-
-/** Read the frame data.
- */
-static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
-{
-    ALSSpecificConfig *sconf = &ctx->sconf;
-    AVCodecContext *avctx    = ctx->avctx;
-    GetBitContext *gb = &ctx->gb;
-    unsigned int div_blocks[32];                ///< block sizes.
-    unsigned int c;
-    unsigned int js_blocks[2];
-    uint32_t bs_info = 0;
-    int ret;
-
-    // skip the size of the ra unit if present in the frame
-    if (sconf->ra_flag == RA_FLAG_FRAMES && ra_frame)
-        skip_bits_long(gb, 32);
-
-    if (sconf->mc_coding && sconf->joint_stereo) {
-        ctx->js_switch = get_bits1(gb);
-        align_get_bits(gb);
-    }
-
-    if (!sconf->mc_coding || ctx->js_switch) {
-        int independent_bs = !sconf->joint_stereo;
-
-        for (c = 0; c < avctx->channels; c++) {
-            js_blocks[0] = 0;
-            js_blocks[1] = 0;
-
-            get_block_sizes(ctx, div_blocks, &bs_info);
-
-            // if joint_stereo and block_switching is set, independent decoding
-            // is signaled via the first bit of bs_info
-            if (sconf->joint_stereo && sconf->block_switching)
-                if (bs_info >> 31)
-                    independent_bs = 2;
-
-            // if this is the last channel, it has to be decoded independently
-            if (c == avctx->channels - 1)
-                independent_bs = 1;
-
-            if (independent_bs) {
-                ret = decode_blocks_ind(ctx, ra_frame, c,
-                                        div_blocks, js_blocks);
-                if (ret < 0)
-                    return ret;
-                independent_bs--;
-            } else {
-                ret = decode_blocks(ctx, ra_frame, c, div_blocks, js_blocks);
-                if (ret < 0)
-                    return ret;
-
-                c++;
-            }
-
-            // store carryover raw samples
-            memmove(ctx->raw_samples[c] - sconf->max_order,
-                    ctx->raw_samples[c] - sconf->max_order + sconf->frame_length,
-                    sizeof(*ctx->raw_samples[c]) * sconf->max_order);
-        }
-    } else { // multi-channel coding
-        ALSBlockData   bd = { 0 };
-        int            b, ret;
-        int            *reverted_channels = ctx->reverted_channels;
-        unsigned int   offset             = 0;
-
-        for (c = 0; c < avctx->channels; c++)
-            if (ctx->chan_data[c] < ctx->chan_data_buffer) {
-                av_log(ctx->avctx, AV_LOG_ERROR, "Invalid channel data!\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-        memset(reverted_channels, 0, sizeof(*reverted_channels) * avctx->channels);
-
-        bd.ra_block         = ra_frame;
-        bd.prev_raw_samples = ctx->prev_raw_samples;
-
-        get_block_sizes(ctx, div_blocks, &bs_info);
-
-        for (b = 0; b < ctx->num_blocks; b++) {
-            bd.block_length = div_blocks[b];
-            if (bd.block_length <= 0) {
-                av_log(ctx->avctx, AV_LOG_WARNING,
-                       "Invalid block length %d in channel data!\n", bd.block_length);
-                continue;
-            }
-
-            for (c = 0; c < avctx->channels; c++) {
-                bd.const_block = ctx->const_block + c;
-                bd.shift_lsbs  = ctx->shift_lsbs + c;
-                bd.opt_order   = ctx->opt_order + c;
-                bd.store_prev_samples = ctx->store_prev_samples + c;
-                bd.use_ltp     = ctx->use_ltp + c;
-                bd.ltp_lag     = ctx->ltp_lag + c;
-                bd.ltp_gain    = ctx->ltp_gain[c];
-                bd.lpc_cof     = ctx->lpc_cof[c];
-                bd.quant_cof   = ctx->quant_cof[c];
-                bd.raw_samples = ctx->raw_samples[c] + offset;
-                bd.raw_other   = NULL;
-
-                if ((ret = read_block(ctx, &bd)) < 0)
-                    return ret;
-                if ((ret = read_channel_data(ctx, ctx->chan_data[c], c)) < 0)
-                    return ret;
-            }
-
-            for (c = 0; c < avctx->channels; c++) {
-                ret = revert_channel_correlation(ctx, &bd, ctx->chan_data,
-                                                 reverted_channels, offset, c);
-                if (ret < 0)
-                    return ret;
-            }
-            for (c = 0; c < avctx->channels; c++) {
-                bd.const_block = ctx->const_block + c;
-                bd.shift_lsbs  = ctx->shift_lsbs + c;
-                bd.opt_order   = ctx->opt_order + c;
-                bd.store_prev_samples = ctx->store_prev_samples + c;
-                bd.use_ltp     = ctx->use_ltp + c;
-                bd.ltp_lag     = ctx->ltp_lag + c;
-                bd.ltp_gain    = ctx->ltp_gain[c];
-                bd.lpc_cof     = ctx->lpc_cof[c];
-                bd.quant_cof   = ctx->quant_cof[c];
-                bd.raw_samples = ctx->raw_samples[c] + offset;
-                if ((ret = decode_block(ctx, &bd)) < 0)
-                    return ret;
-            }
-
-            memset(reverted_channels, 0, avctx->channels * sizeof(*reverted_channels));
-            offset      += div_blocks[b];
-            bd.ra_block  = 0;
-        }
-
-        // store carryover raw samples
-        for (c = 0; c < avctx->channels; c++)
-            memmove(ctx->raw_samples[c] - sconf->max_order,
-                    ctx->raw_samples[c] - sconf->max_order + sconf->frame_length,
-                    sizeof(*ctx->raw_samples[c]) * sconf->max_order);
-    }
-
-    // TODO: read_diff_float_data
-
-    return 0;
-}
-
-
-/** Decode an ALS frame.
- */
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
-                        AVPacket *avpkt)
-{
-    ALSDecContext *ctx       = avctx->priv_data;
-    AVFrame *frame           = data;
-    ALSSpecificConfig *sconf = &ctx->sconf;
-    const uint8_t *buffer    = avpkt->data;
-    int buffer_size          = avpkt->size;
-    int invalid_frame, ret;
-    unsigned int c, sample, ra_frame, bytes_read, shift;
-
-    init_get_bits(&ctx->gb, buffer, buffer_size * 8);
-
-    // In the case that the distance between random access frames is set to zero
-    // (sconf->ra_distance == 0) no frame is treated as a random access frame.
-    // For the first frame, if prediction is used, all samples used from the
-    // previous frame are assumed to be zero.
-    ra_frame = sconf->ra_distance && !(ctx->frame_id % sconf->ra_distance);
-
-    // the last frame to decode might have a different length
-    if (sconf->samples != 0xFFFFFFFF)
-        ctx->cur_frame_length = FFMIN(sconf->samples - ctx->frame_id * (uint64_t) sconf->frame_length,
-                                      sconf->frame_length);
-    else
-        ctx->cur_frame_length = sconf->frame_length;
-
-    // decode the frame data
-    if ((invalid_frame = read_frame_data(ctx, ra_frame)) < 0)
-        av_log(ctx->avctx, AV_LOG_WARNING,
-               "Reading frame data failed. Skipping RA unit.\n");
-
-    ctx->frame_id++;
-
-    /* get output buffer */
-    frame->nb_samples = ctx->cur_frame_length;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    // transform decoded frame into output format
-    #define INTERLEAVE_OUTPUT(bps)                                 \
-    {                                                              \
-        int##bps##_t *dest = (int##bps##_t*)frame->data[0];        \
-        shift = bps - ctx->avctx->bits_per_raw_sample;             \
-        for (sample = 0; sample < ctx->cur_frame_length; sample++) \
-            for (c = 0; c < avctx->channels; c++)                  \
-                *dest++ = ctx->raw_samples[c][sample] << shift;    \
-    }
-
-    if (ctx->avctx->bits_per_raw_sample <= 16) {
-        INTERLEAVE_OUTPUT(16)
-    } else {
-        INTERLEAVE_OUTPUT(32)
-    }
-
-    // update CRC
-    if (sconf->crc_enabled && (avctx->err_recognition & AV_EF_CRCCHECK)) {
-        int swap = HAVE_BIGENDIAN != sconf->msb_first;
-
-        if (ctx->avctx->bits_per_raw_sample == 24) {
-            int32_t *src = (int32_t *)frame->data[0];
-
-            for (sample = 0;
-                 sample < ctx->cur_frame_length * avctx->channels;
-                 sample++) {
-                int32_t v;
-
-                if (swap)
-                    v = av_bswap32(src[sample]);
-                else
-                    v = src[sample];
-                if (!HAVE_BIGENDIAN)
-                    v >>= 8;
-
-                ctx->crc = av_crc(ctx->crc_table, ctx->crc, (uint8_t*)(&v), 3);
-            }
-        } else {
-            uint8_t *crc_source;
-
-            if (swap) {
-                if (ctx->avctx->bits_per_raw_sample <= 16) {
-                    int16_t *src  = (int16_t*) frame->data[0];
-                    int16_t *dest = (int16_t*) ctx->crc_buffer;
-                    for (sample = 0;
-                         sample < ctx->cur_frame_length * avctx->channels;
-                         sample++)
-                        *dest++ = av_bswap16(src[sample]);
-                } else {
-                    ctx->dsp.bswap_buf((uint32_t*)ctx->crc_buffer,
-                                       (uint32_t *)frame->data[0],
-                                       ctx->cur_frame_length * avctx->channels);
-                }
-                crc_source = ctx->crc_buffer;
-            } else {
-                crc_source = frame->data[0];
-            }
-
-            ctx->crc = av_crc(ctx->crc_table, ctx->crc, crc_source,
-                              ctx->cur_frame_length * avctx->channels *
-                              av_get_bytes_per_sample(avctx->sample_fmt));
-        }
-
-
-        // check CRC sums if this is the last frame
-        if (ctx->cur_frame_length != sconf->frame_length &&
-            ctx->crc_org != ctx->crc) {
-            av_log(avctx, AV_LOG_ERROR, "CRC error.\n");
-            if (avctx->err_recognition & AV_EF_EXPLODE)
-                return AVERROR_INVALIDDATA;
-        }
-    }
-
-    *got_frame_ptr = 1;
-
-    bytes_read = invalid_frame ? buffer_size :
-                                 (get_bits_count(&ctx->gb) + 7) >> 3;
-
-    return bytes_read;
-}
-
-
-/** Uninitialize the ALS decoder.
- */
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    ALSDecContext *ctx = avctx->priv_data;
-
-    av_freep(&ctx->sconf.chan_pos);
-
-    ff_bgmc_end(&ctx->bgmc_lut, &ctx->bgmc_lut_status);
-
-    av_freep(&ctx->const_block);
-    av_freep(&ctx->shift_lsbs);
-    av_freep(&ctx->opt_order);
-    av_freep(&ctx->store_prev_samples);
-    av_freep(&ctx->use_ltp);
-    av_freep(&ctx->ltp_lag);
-    av_freep(&ctx->ltp_gain);
-    av_freep(&ctx->ltp_gain_buffer);
-    av_freep(&ctx->quant_cof);
-    av_freep(&ctx->lpc_cof);
-    av_freep(&ctx->quant_cof_buffer);
-    av_freep(&ctx->lpc_cof_buffer);
-    av_freep(&ctx->lpc_cof_reversed_buffer);
-    av_freep(&ctx->prev_raw_samples);
-    av_freep(&ctx->raw_samples);
-    av_freep(&ctx->raw_buffer);
-    av_freep(&ctx->chan_data);
-    av_freep(&ctx->chan_data_buffer);
-    av_freep(&ctx->reverted_channels);
-    av_freep(&ctx->crc_buffer);
-
-    return 0;
-}
-
-
-/** Initialize the ALS decoder.
- */
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    unsigned int c;
-    unsigned int channel_size;
-    int num_buffers, ret;
-    ALSDecContext *ctx = avctx->priv_data;
-    ALSSpecificConfig *sconf = &ctx->sconf;
-    ctx->avctx = avctx;
-
-    if (!avctx->extradata) {
-        av_log(avctx, AV_LOG_ERROR, "Missing required ALS extradata.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = read_specific_config(ctx)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Reading ALSSpecificConfig failed.\n");
-        goto fail;
-    }
-
-    if ((ret = check_specific_config(ctx)) < 0) {
-        goto fail;
-    }
-
-    if (sconf->bgmc) {
-        ret = ff_bgmc_init(avctx, &ctx->bgmc_lut, &ctx->bgmc_lut_status);
-        if (ret < 0)
-            goto fail;
-    }
-    if (sconf->floating) {
-        avctx->sample_fmt          = AV_SAMPLE_FMT_FLT;
-        avctx->bits_per_raw_sample = 32;
-    } else {
-        avctx->sample_fmt          = sconf->resolution > 1
-                                     ? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
-        avctx->bits_per_raw_sample = (sconf->resolution + 1) * 8;
-    }
-
-    // set maximum Rice parameter for progressive decoding based on resolution
-    // This is not specified in 14496-3 but actually done by the reference
-    // codec RM22 revision 2.
-    ctx->s_max = sconf->resolution > 1 ? 31 : 15;
-
-    // set lag value for long-term prediction
-    ctx->ltp_lag_length = 8 + (avctx->sample_rate >=  96000) +
-                              (avctx->sample_rate >= 192000);
-
-    // allocate quantized parcor coefficient buffer
-    num_buffers = sconf->mc_coding ? avctx->channels : 1;
-
-    ctx->quant_cof        = av_malloc(sizeof(*ctx->quant_cof) * num_buffers);
-    ctx->lpc_cof          = av_malloc(sizeof(*ctx->lpc_cof)   * num_buffers);
-    ctx->quant_cof_buffer = av_malloc(sizeof(*ctx->quant_cof_buffer) *
-                                      num_buffers * sconf->max_order);
-    ctx->lpc_cof_buffer   = av_malloc(sizeof(*ctx->lpc_cof_buffer) *
-                                      num_buffers * sconf->max_order);
-    ctx->lpc_cof_reversed_buffer = av_malloc(sizeof(*ctx->lpc_cof_buffer) *
-                                             sconf->max_order);
-
-    if (!ctx->quant_cof              || !ctx->lpc_cof        ||
-        !ctx->quant_cof_buffer       || !ctx->lpc_cof_buffer ||
-        !ctx->lpc_cof_reversed_buffer) {
-        av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    // assign quantized parcor coefficient buffers
-    for (c = 0; c < num_buffers; c++) {
-        ctx->quant_cof[c] = ctx->quant_cof_buffer + c * sconf->max_order;
-        ctx->lpc_cof[c]   = ctx->lpc_cof_buffer   + c * sconf->max_order;
-    }
-
-    // allocate and assign lag and gain data buffer for ltp mode
-    ctx->const_block     = av_malloc (sizeof(*ctx->const_block) * num_buffers);
-    ctx->shift_lsbs      = av_malloc (sizeof(*ctx->shift_lsbs)  * num_buffers);
-    ctx->opt_order       = av_malloc (sizeof(*ctx->opt_order)   * num_buffers);
-    ctx->store_prev_samples = av_malloc(sizeof(*ctx->store_prev_samples) * num_buffers);
-    ctx->use_ltp         = av_mallocz(sizeof(*ctx->use_ltp)  * num_buffers);
-    ctx->ltp_lag         = av_malloc (sizeof(*ctx->ltp_lag)  * num_buffers);
-    ctx->ltp_gain        = av_malloc (sizeof(*ctx->ltp_gain) * num_buffers);
-    ctx->ltp_gain_buffer = av_malloc (sizeof(*ctx->ltp_gain_buffer) *
-                                      num_buffers * 5);
-
-    if (!ctx->const_block || !ctx->shift_lsbs ||
-        !ctx->opt_order || !ctx->store_prev_samples ||
-        !ctx->use_ltp  || !ctx->ltp_lag ||
-        !ctx->ltp_gain || !ctx->ltp_gain_buffer) {
-        av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    for (c = 0; c < num_buffers; c++)
-        ctx->ltp_gain[c] = ctx->ltp_gain_buffer + c * 5;
-
-    // allocate and assign channel data buffer for mcc mode
-    if (sconf->mc_coding) {
-        ctx->chan_data_buffer  = av_malloc(sizeof(*ctx->chan_data_buffer) *
-                                           num_buffers * num_buffers);
-        ctx->chan_data         = av_malloc(sizeof(*ctx->chan_data) *
-                                           num_buffers);
-        ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) *
-                                           num_buffers);
-
-        if (!ctx->chan_data_buffer || !ctx->chan_data || !ctx->reverted_channels) {
-            av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        for (c = 0; c < num_buffers; c++)
-            ctx->chan_data[c] = ctx->chan_data_buffer + c * num_buffers;
-    } else {
-        ctx->chan_data         = NULL;
-        ctx->chan_data_buffer  = NULL;
-        ctx->reverted_channels = NULL;
-    }
-
-    channel_size      = sconf->frame_length + sconf->max_order;
-
-    ctx->prev_raw_samples = av_malloc (sizeof(*ctx->prev_raw_samples) * sconf->max_order);
-    ctx->raw_buffer       = av_mallocz(sizeof(*ctx->     raw_buffer)  * avctx->channels * channel_size);
-    ctx->raw_samples      = av_malloc (sizeof(*ctx->     raw_samples) * avctx->channels);
-
-    // allocate previous raw sample buffer
-    if (!ctx->prev_raw_samples || !ctx->raw_buffer|| !ctx->raw_samples) {
-        av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    // assign raw samples buffers
-    ctx->raw_samples[0] = ctx->raw_buffer + sconf->max_order;
-    for (c = 1; c < avctx->channels; c++)
-        ctx->raw_samples[c] = ctx->raw_samples[c - 1] + channel_size;
-
-    // allocate crc buffer
-    if (HAVE_BIGENDIAN != sconf->msb_first && sconf->crc_enabled &&
-        (avctx->err_recognition & AV_EF_CRCCHECK)) {
-        ctx->crc_buffer = av_malloc(sizeof(*ctx->crc_buffer) *
-                                    ctx->cur_frame_length *
-                                    avctx->channels *
-                                    av_get_bytes_per_sample(avctx->sample_fmt));
-        if (!ctx->crc_buffer) {
-            av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-    }
-
-    ff_dsputil_init(&ctx->dsp, avctx);
-
-    return 0;
-
-fail:
-    decode_end(avctx);
-    return ret;
-}
-
-
-/** Flush (reset) the frame ID after seeking.
- */
-static av_cold void flush(AVCodecContext *avctx)
-{
-    ALSDecContext *ctx = avctx->priv_data;
-
-    ctx->frame_id = 0;
-}
-
-
-AVCodec ff_als_decoder = {
-    .name           = "als",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP4ALS,
-    .priv_data_size = sizeof(ALSDecContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .flush          = flush,
-    .capabilities   = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/amr.h b/deps/libav/libavcodec/amr.h
deleted file mode 100644
index 676c963..0000000
--- a/deps/libav/libavcodec/amr.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Shared functions between AMR codecs
- *
- * Copyright (c) 2010 Marcelo Galvao Povoa
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AMR_H
-#define AVCODEC_AMR_H
-
-#include <string.h>
-
-#include "avcodec.h"
-
-#ifdef AMR_USE_16BIT_TABLES
-#define R_TABLE_TYPE uint16_t
-#else
-#define R_TABLE_TYPE uint8_t
-#endif
-
-/**
- * Fill the frame structure variables from bitstream by parsing the
- * given reordering table that uses the following format:
- *
- * Each field (16 bits) in the AMR Frame is stored as:
- * - one byte for the number of bits in the field
- * - one byte for the field index
- * - then, one byte for each bit of the field (from most-significant to least)
- *         of the position of that bit in the AMR frame.
- *
- * @param out pointer to the frame struct
- * @param size the size in bytes of the frame struct
- * @param data input bitstream after the frame header
- * @param ord_table the reordering table as above
- */
-static inline void ff_amr_bit_reorder(uint16_t *out, int size,
-                                      const uint8_t *data,
-                                      const R_TABLE_TYPE *ord_table)
-{
-    int field_size;
-
-    memset(out, 0, size);
-    while ((field_size = *ord_table++)) {
-        int field = 0;
-        int field_offset = *ord_table++;
-        while (field_size--) {
-           int bit = *ord_table++;
-           field <<= 1;
-           field |= data[bit >> 3] >> (bit & 7) & 1;
-        }
-        out[field_offset >> 1] = field;
-    }
-}
-
-#endif /* AVCODEC_AMR_H */
diff --git a/deps/libav/libavcodec/amrnbdata.h b/deps/libav/libavcodec/amrnbdata.h
deleted file mode 100644
index b7d1b89..0000000
--- a/deps/libav/libavcodec/amrnbdata.h
+++ /dev/null
@@ -1,1671 +0,0 @@
-/*
- * AMR narrowband data and definitions
- * Copyright (c) 2006-2007 Robert Swain
- * Copyright (c) 2009 Colin McQuillan
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-/**
- * @file
- * AMR narrowband data and definitions
- */
-
-#ifndef AVCODEC_AMRNBDATA_H
-#define AVCODEC_AMRNBDATA_H
-
-#include <stdint.h>
-
-#include "libavutil/common.h"      /* offsetof */
-
-#define AMR_SUBFRAME_SIZE            40   ///< samples per subframe
-
-/** Frame type (Table 1a in 3GPP TS 26.101) */
-enum Mode {
-    MODE_4k75 = 0,                        ///< 4.75 kbit/s
-    MODE_5k15,                            ///< 5.15 kbit/s
-    MODE_5k9,                             ///< 5.90 kbit/s
-    MODE_6k7,                             ///< 6.70 kbit/s
-    MODE_7k4,                             ///< 7.40 kbit/s
-    MODE_7k95,                            ///< 7.95 kbit/s
-    MODE_10k2,                            ///< 10.2 kbit/s
-    MODE_12k2,                            ///< 12.2 kbit/s
-    MODE_DTX,                             ///< silent frame
-    N_MODES,                              ///< number of modes
-    NO_DATA = 15                          ///< no transmission
-};
-
-#define LP_FILTER_ORDER 10        ///< linear predictive coding filter order
-
-/**
- * AMRNB unpacked data subframe
- */
-typedef struct AMRNBSubframe {
-    uint16_t p_lag;      ///< index to decode the pitch lag
-    uint16_t p_gain;     ///< index to decode the pitch gain
-    uint16_t fixed_gain; ///< index to decode the fixed gain factor, for MODE_12k2 and MODE_7k95
-    uint16_t pulses[10]; ///< pulses: 10 for MODE_12k2, 7 for MODE_10k2, and index and sign for others
-} AMRNBSubframe;
-
-/**
- * AMRNB unpacked data frame
- */
-typedef struct AMRNBFrame {
-    uint16_t lsf[5];           ///< lsf parameters: 5 parameters for MODE_12k2, only 3 for other modes
-    AMRNBSubframe subframe[4]; ///< unpacked data for each subframe
-} AMRNBFrame;
-
-/** The index of a frame parameter */
-#define AMR_BIT(field)                  (offsetof(AMRNBFrame, field))
-/** The index of a subframe-specific parameter */
-#define AMR_OF(frame_num, variable)     AMR_BIT(subframe[frame_num].variable)
-
-// The following order* tables are used to convert AMR frame parameters to and
-// from a bitstream. See 3GPP TS 26.101 for more information.
-// Each field in AMRNBFrame is stored as:
-// * one byte for the number of bits in the field
-// * one byte for the field index
-// * then, one byte for each bit of the field (from most-significant to least)
-//         of the position of that bit in the AMR frame.
-static const uint8_t order_MODE_4k75[] = {
-     8, AMR_BIT(lsf[0]),        7,   6,   5,   4,   3,   2,   1,   0,
-     8, AMR_BIT(lsf[1]),       15,  14,  13,  12,  11,  10,   9,   8,
-     7, AMR_BIT(lsf[2]),       51,  35,  34,  50,  33,  49,  32,
-     8, AMR_OF(0,p_lag),       23,  22,  21,  20,  19,  18,  43,  42,
-     8, AMR_OF(0,p_gain),      54,  55,  40,  41,  24,  25,  26,  27,
-     7, AMR_OF(0,pulses[0]),   92,  68,  67,  84,  66,  65,  80,
-     2, AMR_OF(0,pulses[1]),   53,  52,
-     4, AMR_OF(1,p_lag),       17,  16,  48,  63,
-     7, AMR_OF(1,pulses[0]),   91,  64,  79,  83,  78,  77,  95,
-     2, AMR_OF(1,pulses[1]),   62,  61,
-     4, AMR_OF(2,p_lag),       31,  30,  60,  59,
-     8, AMR_OF(2,p_gain),      44,  45,  46,  47,  36,  37,  38,  39,
-     7, AMR_OF(2,pulses[0]),   90,  76,  75,  82,  74,  73,  94,
-     2, AMR_OF(2,pulses[1]),   58,  57,
-     4, AMR_OF(3,p_lag),       29,  28,  56,  71,
-     7, AMR_OF(3,pulses[0]),   89,  72,  87,  81,  86,  85,  93,
-     2, AMR_OF(3,pulses[1]),   70,  69,
-     0
-};
-
-static const uint8_t order_MODE_5k15[] = {
-     8, AMR_BIT(lsf[0]),        0,   1,   2,   3,   4,   5,   6,   7,
-     8, AMR_BIT(lsf[1]),        8,   9,  10,  11,  12,  13,  14,  15,
-     7, AMR_BIT(lsf[2]),       70,  51,  43,  71,  50,  60,  49,
-     8, AMR_OF(0,p_lag),       23,  22,  21,  20,  19,  47,  54,  59,
-     6, AMR_OF(0,p_gain),      48,  42,  35,  29,  30,  31,
-     7, AMR_OF(0,pulses[0]),   92,  84,  82, 100,  79,  72,  88,
-     2, AMR_OF(0,pulses[1]),   67,  68,
-     4, AMR_OF(1,p_lag),       18,  46,  53,  58,
-     6, AMR_OF(1,p_gain),      63,  41,  34,  26,  27,  28,
-     7, AMR_OF(1,pulses[0]),   91,  83,  81,  99,  78,  87, 103,
-     2, AMR_OF(1,pulses[1]),   65,  66,
-     4, AMR_OF(2,p_lag),       17,  45,  52,  57,
-     6, AMR_OF(2,p_gain),      62,  40,  33,  39,  24,  25,
-     7, AMR_OF(2,pulses[0]),   90,  80,  95,  98,  77,  86, 102,
-     2, AMR_OF(2,pulses[1]),   75,  64,
-     4, AMR_OF(3,p_lag),       16,  44,  56,  69,
-     6, AMR_OF(3,p_gain),      61,  55,  32,  36,  37,  38,
-     7, AMR_OF(3,pulses[0]),   89,  94,  93,  97,  76,  85, 101,
-     2, AMR_OF(3,pulses[1]),   73,  74,
-     0
-};
-
-static const uint8_t order_MODE_5k9[] = {
-     8, AMR_BIT(lsf[0]),        7,   6,   0,   3,   5,   4,   2,   1,
-     9, AMR_BIT(lsf[1]),       13,  12,   8,  11,  10,  15,   9,  14,  23,
-     9, AMR_BIT(lsf[2]),       71,  56,  60,  70,  59,  57,  58,  69,  76,
-     8, AMR_OF(0,p_lag),       16,  18,  22,  20,  30,  38,  44,  42,
-     6, AMR_OF(0,p_gain),      75,  48,  52,  40,  34,  26,
-     9, AMR_OF(0,pulses[0]),  101,  89,  93, 117, 105,  81,  85, 109,  97,
-     2, AMR_OF(0,pulses[1]),   67,  78,
-     4, AMR_OF(1,p_lag),       28,  36,  46,  87,
-     6, AMR_OF(1,p_gain),      74,  63,  51,  55,  33,  25,
-     9, AMR_OF(1,pulses[0]),  100,  88,  92, 116, 104,  80,  84, 108,  96,
-     2, AMR_OF(1,pulses[1]),   64,  79,
-     8, AMR_OF(2,p_lag),       31,  17,  21,  19,  29,  37,  43,  41,
-     6, AMR_OF(2,p_gain),      73,  62,  50,  54,  32,  24,
-     9, AMR_OF(2,pulses[0]),   99, 103,  91, 115, 119,  95,  83, 107, 111,
-     2, AMR_OF(2,pulses[1]),   66,  77,
-     4, AMR_OF(3,p_lag),       27,  35,  45,  86,
-     6, AMR_OF(3,p_gain),      72,  61,  49,  53,  47,  39,
-     9, AMR_OF(3,pulses[0]),   98, 102,  90, 114, 118,  94,  82, 106, 110,
-     2, AMR_OF(3,pulses[1]),   65,  68,
-     0
-};
-
-static const uint8_t order_MODE_6k7[] = {
-     8, AMR_BIT(lsf[0]),        7,   6,  15,   4,   5,   3,   2,   0,
-     9, AMR_BIT(lsf[1]),       14,  13,   8,  12,  10,   1,   9,  11,  29,
-     9, AMR_BIT(lsf[2]),       57,  58,  50,  56,  60,  59,  49,  71,  70,
-     8, AMR_OF(0,p_lag),       17,  19,  23,  21,  31,  24,  32,  52,
-     7, AMR_OF(0,p_gain),      36,  82,  69,  46,  42,  48,  77,
-    11, AMR_OF(0,pulses[0]),  109,  97, 133, 121, 101,  89, 125, 113,  93, 117,
-                              105,
-     3, AMR_OF(0,pulses[1]),   81,  73,  65,
-     4, AMR_OF(1,p_lag),       28,  26,  38,  54,
-     7, AMR_OF(1,p_gain),      35,  83,  68,  45,  41,  63,  76,
-    11, AMR_OF(1,pulses[0]),  108,  96, 132, 120, 100,  88, 124, 112,  92, 116,
-                              104,
-     3, AMR_OF(1,pulses[1]),   80,  72,  64,
-     8, AMR_OF(2,p_lag),       16,  18,  22,  20,  30,  39,  47,  51,
-     7, AMR_OF(2,p_gain),      34,  84,  67,  44,  40,  62,  75,
-    11, AMR_OF(2,pulses[0]),  107, 111, 131, 135,  99, 103, 123, 127,  91, 115,
-                              119,
-     3, AMR_OF(2,pulses[1]),   95,  87,  79,
-     4, AMR_OF(3,p_lag),       27,  25,  37,  53,
-     7, AMR_OF(3,p_gain),      33,  85,  66,  43,  55,  61,  74,
-    11, AMR_OF(3,pulses[0]),  106, 110, 130, 134,  98, 102, 122, 126,  90, 114,
-                              118,
-     3, AMR_OF(3,pulses[1]),   94,  86,  78,
-     0
-};
-
-static const uint8_t order_MODE_7k4[] = {
-     8, AMR_BIT(lsf[0]),        7,   6,   5,   4,   3,   2,   1,   0,
-     9, AMR_BIT(lsf[1]),       15,  14,  13,  12,  11,  10,   9,   8,  23,
-     9, AMR_BIT(lsf[2]),       53,  52,  51,  58,  40,  55,  54,  57,  56,
-     8, AMR_OF(0,p_lag),       22,  20,  18,  16,  30,  50,  95,  94,
-     7, AMR_OF(0,p_gain),      28,  24,  73,  36,  32,  62,  67,
-    13, AMR_OF(0,pulses[0]),  127, 123, 135, 131, 143, 139, 151, 103, 102, 101,
-                              100,  99,  98,
-     4, AMR_OF(0,pulses[1]),   83,  75,  79,  71,
-     5, AMR_OF(1,p_lag),       44,  42,  49,  93,  92,
-     7, AMR_OF(1,p_gain),      27,  39,  72,  35,  47,  61,  66,
-    13, AMR_OF(1,pulses[0]),  126, 122, 134, 130, 142, 138, 150,  97,  96, 111,
-                              110, 109, 108,
-     4, AMR_OF(1,pulses[1]),   82,  74,  78,  70,
-     8, AMR_OF(2,p_lag),       21,  19,  17,  31,  29,  48,  91,  90,
-     7, AMR_OF(2,p_gain),      26,  38,  87,  34,  46,  60,  65,
-    13, AMR_OF(2,pulses[0]),  125, 121, 133, 129, 141, 137, 149, 107, 106, 105,
-                              104, 119, 118,
-     4, AMR_OF(2,pulses[1]),   81,  85,  77,  69,
-     5, AMR_OF(3,p_lag),       43,  41,  63,  89,  88,
-     7, AMR_OF(3,p_gain),      25,  37,  86,  33,  45,  59,  64,
-    13, AMR_OF(3,pulses[0]),  124, 120, 132, 128, 140, 136, 148, 117, 116, 115,
-                              114, 113, 112,
-     4, AMR_OF(3,pulses[1]),   80,  84,  76,  68,
-     0
-};
-
-static const uint8_t order_MODE_7k95[] = {
-     9, AMR_BIT(lsf[0]),       67,  68,   1,   2,   3,   4,   5,   6,   7,
-     9, AMR_BIT(lsf[1]),       14,  13,   9,  12,  11,   0,  10,  15,   8,
-     9, AMR_BIT(lsf[2]),       18,  19,  23,  17,  22,  20,  21,  66,  65,
-     8, AMR_OF(0,p_lag),       44,  42,  40,  54,  52,  56,  64,  78,
-     4, AMR_OF(0,p_gain),      36,  32,  72,  80,
-     5, AMR_OF(0,fixed_gain),  16,  28,  24,  60,  84,
-    13, AMR_OF(0,pulses[0]),  135, 109, 144, 156, 120,  97, 148, 121, 101, 122,
-                              123,  89, 124,
-     4, AMR_OF(0,pulses[1]),  125, 126, 127, 112,
-     6, AMR_OF(1,p_lag),       50,  48,  62,  70,  76,  74,
-     4, AMR_OF(1,p_gain),      35,  47,  87,  95,
-     5, AMR_OF(1,fixed_gain),  31,  27,  39,  59,  83,
-    13, AMR_OF(1,pulses[0]),  129, 108, 159, 155, 130,  96, 147, 131, 100, 132,
-                              133,  88, 134,
-     4, AMR_OF(1,pulses[1]),  113, 114, 115, 116,
-     8, AMR_OF(2,p_lag),       43,  41,  55,  53,  51,  71,  79,  77,
-     4, AMR_OF(2,p_gain),      34,  46,  86,  94,
-     5, AMR_OF(2,fixed_gain),  30,  26,  38,  58,  82,
-    13, AMR_OF(2,pulses[0]),  139, 107, 158, 154, 140, 111, 146, 141,  99, 142,
-                              143, 103, 128,
-     4, AMR_OF(2,pulses[1]),  105,  90,  91,  92,
-     6, AMR_OF(3,p_lag),       49,  63,  61,  69,  75,  73,
-     4, AMR_OF(3,p_gain),      33,  45,  85,  93,
-     5, AMR_OF(3,fixed_gain),  29,  25,  37,  57,  81,
-    13, AMR_OF(3,pulses[0]),  149, 106, 157, 153, 150, 110, 145, 151,  98, 136,
-                              137, 102, 138,
-     4, AMR_OF(3,pulses[1]),  117, 118, 119, 104,
-     0
-};
-
-static const uint8_t order_MODE_10k2[] = {
-     8, AMR_BIT(lsf[0]),        0,   1,   2,   3,   4,   5,   6,   7,
-     9, AMR_BIT(lsf[1]),       23,   8,   9,  10,  11,  12,  13,  14,  15,
-     9, AMR_BIT(lsf[2]),       57,  58,  62,  56,  60,  59,  61,  71,  70,
-     8, AMR_OF(0,p_lag),       22,  21,  20,  19,  18,  17,  42,  41,
-     7, AMR_OF(0,p_gain),      38,  50,  84,  37,  36,  85,  83,
-     1, AMR_OF(0,pulses[0]),   66,
-     1, AMR_OF(0,pulses[1]),   67,
-     1, AMR_OF(0,pulses[2]),   68,
-     1, AMR_OF(0,pulses[3]),   69,
-    10, AMR_OF(0,pulses[4]),  145, 144, 156, 153, 154, 163, 161, 192, 206, 195,
-    10, AMR_OF(0,pulses[5]),  158, 159, 157, 152, 155, 165, 160, 205, 204, 194,
-     7, AMR_OF(0,pulses[6]),  167, 166, 162, 164, 196, 207, 193,
-     5, AMR_OF(1,p_lag),       26,  25,  54,  53,  89,
-     7, AMR_OF(1,p_gain),      35,  49,  81,  34,  33,  82,  80,
-     1, AMR_OF(1,pulses[0]),   78,
-     1, AMR_OF(1,pulses[1]),   79,
-     1, AMR_OF(1,pulses[2]),   64,
-     1, AMR_OF(1,pulses[3]),   65,
-    10, AMR_OF(1,pulses[4]),  103, 102,  98, 111,  96, 105, 119, 185, 199, 188,
-    10, AMR_OF(1,pulses[5]),  100, 101,  99, 110,  97, 107, 118, 198, 197, 187,
-     7, AMR_OF(1,pulses[6]),  109, 108, 104, 106, 189, 184, 186,
-     8, AMR_OF(2,p_lag),       16,  31,  30,  29,  28,  27,  40,  55,
-     7, AMR_OF(2,p_gain),      32,  48,  94,  47,  46,  95,  93,
-     1, AMR_OF(2,pulses[0]),   74,
-     1, AMR_OF(2,pulses[1]),   75,
-     1, AMR_OF(2,pulses[2]),   76,
-     1, AMR_OF(2,pulses[3]),   77,
-    10, AMR_OF(2,pulses[4]),  117, 116, 112, 125, 126, 135, 133, 178, 176, 181,
-    10, AMR_OF(2,pulses[5]),  114, 115, 113, 124, 127, 121, 132, 191, 190, 180,
-     7, AMR_OF(2,pulses[6]),  123, 122, 134, 120, 182, 177, 179,
-     5, AMR_OF(3,p_lag),       24,  39,  52,  51,  88,
-     7, AMR_OF(3,p_gain),      45,  63,  91,  44,  43,  92,  90,
-     1, AMR_OF(3,pulses[0]),   86,
-     1, AMR_OF(3,pulses[1]),   87,
-     1, AMR_OF(3,pulses[2]),   72,
-     1, AMR_OF(3,pulses[3]),   73,
-    10, AMR_OF(3,pulses[4]),  131, 130, 142, 139, 140, 149, 147, 171, 169, 174,
-    10, AMR_OF(3,pulses[5]),  128, 129, 143, 138, 141, 151, 146, 168, 183, 173,
-     7, AMR_OF(3,pulses[6]),  137, 136, 148, 150, 175, 170, 172,
-     0
-};
-
-static const uint8_t order_MODE_12k2[] = {
-     7, AMR_BIT(lsf[0]),        7,   6,   5,   4,   3,   2,   1,
-     8, AMR_BIT(lsf[1]),        0,  15,  14,  13,  12,  11,  10,   9,
-     9, AMR_BIT(lsf[2]),       23,  22,  21,  20,  19,  18,  17,  16,   8,
-     8, AMR_BIT(lsf[3]),       31,  30,  29,  28,  27,  86,  85,  84,
-     6, AMR_BIT(lsf[4]),       83,  82,  81,  80, 127, 126,
-     9, AMR_OF(0,p_lag),       26,  24,  38,  36,  34,  32,  46,  44,  42,
-     4, AMR_OF(0,p_gain),      40,  52,  48,  95,
-     5, AMR_OF(0,fixed_gain),  60,  56,  68,  91, 111,
-     3, AMR_OF(0,pulses[0]),  191, 176, 177,
-     4, AMR_OF(0,pulses[1]),  103, 123, 124, 125,
-     3, AMR_OF(0,pulses[2]),  188, 189, 190,
-     4, AMR_OF(0,pulses[3]),   99, 120, 121, 122,
-     3, AMR_OF(0,pulses[4]),  185, 186, 187,
-     4, AMR_OF(0,pulses[5]),  107, 133, 134, 135,
-     3, AMR_OF(0,pulses[6]),  198, 199, 184,
-     4, AMR_OF(0,pulses[7]),  119, 130, 131, 132,
-     3, AMR_OF(0,pulses[8]),  195, 196, 197,
-     4, AMR_OF(0,pulses[9]),  115, 143, 128, 129,
-     6, AMR_OF(1,p_lag),       64,  78,  76,  74,  72, 245,
-     4, AMR_OF(1,p_gain),      55,  51,  63,  94,
-     5, AMR_OF(1,fixed_gain),  59,  71,  67,  90, 110,
-     3, AMR_OF(1,pulses[0]),  192, 193, 194,
-     4, AMR_OF(1,pulses[1]),  102, 140, 141, 142,
-     3, AMR_OF(1,pulses[2]),  205, 206, 207,
-     4, AMR_OF(1,pulses[3]),   98, 137, 138, 139,
-     3, AMR_OF(1,pulses[4]),  202, 203, 204,
-     4, AMR_OF(1,pulses[5]),  106, 150, 151, 136,
-     3, AMR_OF(1,pulses[6]),  215, 200, 201,
-     4, AMR_OF(1,pulses[7]),  118, 147, 148, 149,
-     3, AMR_OF(1,pulses[8]),  212, 213, 214,
-     4, AMR_OF(1,pulses[9]),  114, 144, 145, 146,
-     9, AMR_OF(2,p_lag),       25,  39,  37,  35,  33,  47,  45,  43,  41,
-     4, AMR_OF(2,p_gain),      54,  50,  62,  93,
-     5, AMR_OF(2,fixed_gain),  58,  70,  66,  89, 109,
-     3, AMR_OF(2,pulses[0]),  209, 210, 211,
-     4, AMR_OF(2,pulses[1]),  101, 157, 158, 159,
-     3, AMR_OF(2,pulses[2]),  222, 223, 208,
-     4, AMR_OF(2,pulses[3]),   97, 154, 155, 156,
-     3, AMR_OF(2,pulses[4]),  219, 220, 221,
-     4, AMR_OF(2,pulses[5]),  105, 167, 152, 153,
-     3, AMR_OF(2,pulses[6]),  216, 217, 218,
-     4, AMR_OF(2,pulses[7]),  117, 164, 165, 166,
-     3, AMR_OF(2,pulses[8]),  229, 230, 231,
-     4, AMR_OF(2,pulses[9]),  113, 161, 162, 163,
-     6, AMR_OF(3,p_lag),       79,  77,  75,  73,  87, 244,
-     4, AMR_OF(3,p_gain),      53,  49,  61,  92,
-     5, AMR_OF(3,fixed_gain),  57,  69,  65,  88, 108,
-     3, AMR_OF(3,pulses[0]),  226, 227, 228,
-     4, AMR_OF(3,pulses[1]),  100, 174, 175, 160,
-     3, AMR_OF(3,pulses[2]),  239, 224, 225,
-     4, AMR_OF(3,pulses[3]),   96, 171, 172, 173,
-     3, AMR_OF(3,pulses[4]),  236, 237, 238,
-     4, AMR_OF(3,pulses[5]),  104, 168, 169, 170,
-     3, AMR_OF(3,pulses[6]),  233, 234, 235,
-     4, AMR_OF(3,pulses[7]),  116, 181, 182, 183,
-     3, AMR_OF(3,pulses[8]),  246, 247, 232,
-     4, AMR_OF(3,pulses[9]),  112, 178, 179, 180,
-     0
-};
-
-/**
- * position of the bitmapping data for each packet type in
- * the AMRNBFrame
- */
-static const uint8_t * const amr_unpacking_bitmaps_per_mode[N_MODES] = {
-    order_MODE_4k75,
-    order_MODE_5k15,
-    order_MODE_5k9,
-    order_MODE_6k7,
-    order_MODE_7k4,
-    order_MODE_7k95,
-    order_MODE_10k2,
-    order_MODE_12k2,
-};
-
-/** number of bytes for each mode */
-static const uint8_t frame_sizes_nb[N_MODES] = {
-    12, 13, 15, 17, 19, 20, 26, 31, 5
-};
-
-/**
- * Base-5 representation for values 0-124
- *
- * This is useful for decoding pulse positions in 10.2 kbit/s frames.
- * Safe values are provided for out of range positions 125-127.
- */
-static const uint8_t base_five_table[128][3] = {
- {0, 0, 0}, {0, 0, 1}, {0, 0, 2}, {0, 0, 3}, {0, 0, 4}, {0, 1, 0}, {0, 1, 1},
- {0, 1, 2}, {0, 1, 3}, {0, 1, 4}, {0, 2, 0}, {0, 2, 1}, {0, 2, 2}, {0, 2, 3},
- {0, 2, 4}, {0, 3, 0}, {0, 3, 1}, {0, 3, 2}, {0, 3, 3}, {0, 3, 4}, {0, 4, 0},
- {0, 4, 1}, {0, 4, 2}, {0, 4, 3}, {0, 4, 4}, {1, 0, 0}, {1, 0, 1}, {1, 0, 2},
- {1, 0, 3}, {1, 0, 4}, {1, 1, 0}, {1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4},
- {1, 2, 0}, {1, 2, 1}, {1, 2, 2}, {1, 2, 3}, {1, 2, 4}, {1, 3, 0}, {1, 3, 1},
- {1, 3, 2}, {1, 3, 3}, {1, 3, 4}, {1, 4, 0}, {1, 4, 1}, {1, 4, 2}, {1, 4, 3},
- {1, 4, 4}, {2, 0, 0}, {2, 0, 1}, {2, 0, 2}, {2, 0, 3}, {2, 0, 4}, {2, 1, 0},
- {2, 1, 1}, {2, 1, 2}, {2, 1, 3}, {2, 1, 4}, {2, 2, 0}, {2, 2, 1}, {2, 2, 2},
- {2, 2, 3}, {2, 2, 4}, {2, 3, 0}, {2, 3, 1}, {2, 3, 2}, {2, 3, 3}, {2, 3, 4},
- {2, 4, 0}, {2, 4, 1}, {2, 4, 2}, {2, 4, 3}, {2, 4, 4}, {3, 0, 0}, {3, 0, 1},
- {3, 0, 2}, {3, 0, 3}, {3, 0, 4}, {3, 1, 0}, {3, 1, 1}, {3, 1, 2}, {3, 1, 3},
- {3, 1, 4}, {3, 2, 0}, {3, 2, 1}, {3, 2, 2}, {3, 2, 3}, {3, 2, 4}, {3, 3, 0},
- {3, 3, 1}, {3, 3, 2}, {3, 3, 3}, {3, 3, 4}, {3, 4, 0}, {3, 4, 1}, {3, 4, 2},
- {3, 4, 3}, {3, 4, 4}, {4, 0, 0}, {4, 0, 1}, {4, 0, 2}, {4, 0, 3}, {4, 0, 4},
- {4, 1, 0}, {4, 1, 1}, {4, 1, 2}, {4, 1, 3}, {4, 1, 4}, {4, 2, 0}, {4, 2, 1},
- {4, 2, 2}, {4, 2, 3}, {4, 2, 4}, {4, 3, 0}, {4, 3, 1}, {4, 3, 2}, {4, 3, 3},
- {4, 3, 4}, {4, 4, 0}, {4, 4, 1}, {4, 4, 2}, {4, 4, 3}, {4, 4, 4}, {0, 0, 0},
- {0, 0, 0}, {0, 0, 0}
-};
-
-/**
- * Values for the lsp vector from the 4th subframe of the
- * previous subframe values.
- *
- * @note: Taken from Decoder_amr_reset in Q15 using val/1000
- */
-static const int8_t lsp_sub4_init[LP_FILTER_ORDER] = {
-    30, 26, 21, 15, 8, 0, -8, -15, -21, -26
-};
-
-/**
- * Mean lsp values.
- *
- * @note: Taken from Decoder_amr_reset in Q15
- */
-static const int16_t lsp_avg_init[LP_FILTER_ORDER] = {
-    1384, 2077, 3420, 5108, 6742, 8122, 9863, 11092, 12714, 13701
-};
-
-// LSF tables
-
-// These are stored as integers to save space. The values are taken from
-// q_plsf_3.tab and q_plsf_5.tab in 3GPP TS 26.090.
-
-static const int16_t lsf_3_3_MODE_5k15[128][4] = {
-{  419,  163,  -30, -262}, { -455, -789,-1430, -721}, { 1006,  664,  269,   25},
-{  619,  260,  183,   96}, { -968,-1358, -388,  135}, { -693,  835,  456,  154},
-{ 1105,  703,  569,  363}, { 1625, 1326,  985,  748}, { -220,  219,   76, -208},
-{-1455,-1662,   49,  149}, { -964, -172, -752, -336}, {  625,  209, -250,  -66},
-{-1017, -838,   -2,  317}, {-2168,-1485, -138,  123}, {-1876,-2099, -521,   85},
-{ -967, -366, -695, -881}, { -921,-1011, -763, -949}, { -124, -256, -352, -660},
-{  178,  463,  354,  304}, {-1744, -591, -282,   79}, {-2249,  175,  867,  499},
-{ -138, -180, -181,  -21}, {-2291,-1241, -460, -520}, { -771,  451,  -10, -308},
-{  271,  -65,    4,  214}, { -279, -435,  -43, -348}, { -670,   35,  -65, -211},
-{  806,  535,   85,  297}, {   57,  239,  722,  493}, {  225,  661,  840,  547},
-{ -540, -376,   14,  349}, {  469,  721,  331,  162}, { -544, -752,  -62,  -10},
-{  398,  -88,  724,  701}, {  -19, -533,  -94,  601}, {  136,  -71, -681, -747},
-{ -166, -344,  261,  -50}, {  161,  -52,  485,  337}, {-1675,   50,  190,  -93},
-{-2282, -231, -194,  -82}, {  -95, -595, -154,  128}, {  894,  501,  588,  457},
-{ -345,  206,  122,  110}, { -631, -227, -569,    3}, {  408,  239,  397,  226},
-{ -197,   -2,  128,  491}, { 1281,  904,  292,  215}, {  538,  306,  259,  509},
-{ -677,-1047,   13,  321}, { -679, -588, -358, -212}, { -558,  243,  646,  479},
-{  486,  342,  634,  532}, {  107,  802,  331,  136}, { -112, -398,-1031, -286},
-{ -326, -705,  288,  272}, { 1299, 1144, 1178,  860}, { -423,  121, -385, -148},
-{ -295, -302, -834, -819}, {   16,  -24, -201, -476}, {  555,   91, -245,  294},
-{  -38, -379, -962,-1221}, {-1191,-1518, -273, -395}, { -390,-1013, -645,  573},
-{-1843,-1030,  505,  468}, {  744,  947,  609,  493}, { -689,-1172, -628, -135},
-{-1026,  195,  411,  196}, { 1582, 1147,  575,  337}, {-1239, -777, -648, -142},
-{  595,  825,  967,  735}, {-1206, -970,  -81, -342}, { -745,   13,  -72,  375},
-{  454,   19, 1407,  921}, {-1647, -172,  861,  562}, {  928, 1537, 1063,  740},
-{-2472, -952,  264,   82}, { -502, -965,-1334,  123}, {  867, 1236,  534,  171},
-{-2320, -460,  780,  363}, {-1190, -617,  252,  -61}, { -174,   34, 1011,  788},
-{-2333,  247,  423,  153}, {  -16, -355,  262,  449}, {-1576,-1073, -544, -371},
-{ -615, -305, 1051,  805}, {  687,  528,    6, -182}, {  935,  875, 1002,  809},
-{  199,  257,  126,   76}, { -584,-1138,  599,  556}, {-1105,-1391,-1591, -519},
-{ -977,-1325,  108,  347}, { -722, -975,  365,  101}, { -145,  681,  249, -153},
-{    0, -334, -570,  159}, {  412,  285, -336, -617}, { -953, -966,  887,  689},
-{-1251,   84, -185, -398}, { -592,  433, 1044,  653}, {   85,  329,  -40,  361},
-{ -433, -705,  466,  574}, { -154,  654,  592,  290}, { -167,   72,  349,  175},
-{  674,  297,  977,  720}, { 1235, 1204,  757,  488}, { -400, -269,  538,  372},
-{-1350,-1387,-1194,  -91}, { 1262,  876,  775,  700}, { -599,  -38, -430, -722},
-{ 1976, 1630,  991,  608}, {  111,  276, -226,  -96}, { -947, -388,  -11,   -7},
-{ -303, -531, -839,  338}, { 1734, 1710, 1405, 1013}, { -516, -855, -645,  210},
-{ -688, -416,  513,  230}, { -822, -637,-1146, -320}, { -952, -658, -694,  183},
-{ -114, -623,  818,  674}, { -191, -204,  731,  635}, {   51, 1221,  883,  576},
-{ -954, -431,  826,  598}, { -342, -755, -900, -407}, {-1126, -354, -206, -512},
-{ -547, -810, -357, -620}, {   66,  515,  -73, -410}, { -872, -945,-1444,-1227},
-{  191,  -17, -544, -231}, {-1540, -544, -901, -886}
-};
-
-static const int16_t lsf_3_1_MODE_7k95[512][3] = {
-{ -890,-1550,-2541}, { -819, -970,  175}, { -826,-1234, -762},
-{ -599,  -22,  634}, { -811, -987, -902}, { -323,  203,   26},
-{ -383, -235, -781}, { -399, 1262,  906}, { -932,-1399,-1380},
-{ -624,   93,   87}, { -414, -539, -691}, {   37,  633,  510},
-{ -387, -476,-1330}, {  399,   66,  263}, { -407,  -49, -335},
-{ -417, 1041, 1865}, { -779,-1089,-1440}, { -746, -858,  832},
-{ -581, -759, -371}, { -673, -506, 2088}, { -560, -634,-1179},
-{  271,  241,   14}, { -438, -244, -397}, {  463, 1202, 1047},
-{ -606, -797,-1438}, {  -51, -323,  481}, { -224, -584, -527},
-{  494,  881,  682}, { -433, -306,-1002}, {  554,  659,  222},
-{  171, -160, -353}, {  681, 1798, 1565}, { -852,-1181,-1695},
-{ -336, -666,  114}, { -581, -756, -744}, { -195,  375,  497},
-{ -465, -804,-1098}, {  154,  282, -131}, {  -50, -191, -719},
-{  323,  732, 1542}, { -722, -819,-1404}, {  105, -250,  185},
-{ -178, -502, -742}, {  321,  510, 1111}, { -323, -567, -966},
-{  127,  484,  338}, { -160,   52, -338}, {  732, 1367, 1554},
-{ -626, -802,-1696}, { -286, -586,  676}, { -695, -343, -370},
-{ -490,  295, 1893}, { -630, -574,-1014}, {  -80,  645,  -69},
-{   -6, -318, -364}, {  782, 1450, 1038}, { -313, -733,-1395},
-{  120,   60,  477}, { -264, -585, -123}, {  711, 1245,  633},
-{  -91, -355,-1016}, {  771,  758,  261}, {  253,   81, -474},
-{  930, 2215, 1720}, { -808,-1099,-1925}, { -560, -782,  169},
-{ -804,-1074, -188}, { -626,  -55, 1405}, { -694, -716,-1194},
-{ -660,  354,  329}, { -514,  -55, -543}, {  366, 1033, 1182},
-{ -658, -959,-1357}, {  -55, -184,   93}, { -605, -286, -662},
-{  404,  449,  827}, { -286, -350,-1263}, {  628,  306,  227},
-{  -16,  147, -623}, {  186,  923, 2146}, { -674, -890,-1606},
-{ -443, -228,  339}, { -369, -790, -409}, {  231,   86, 1469},
-{ -448, -581,-1061}, {  594,  450, -177}, { -124, -170, -447},
-{  671, 1159, 1404}, { -476, -667,-1511}, {  -77, -138,  716},
-{ -177, -372, -381}, {  451,  934,  915}, { -250, -432, -822},
-{  272,  828,  446}, {   26,   19,  -31}, {  698, 1692, 2168},
-{ -646, -977,-1924}, { -179, -473,  268}, { -379, -745, -691},
-{   11,  127, 1033}, { -488, -917, -825}, {   61,  323,  135},
-{  147, -145, -686}, {  685,  786, 1682}, { -506, -848,-1297},
-{   35,   90,  222}, {  -23, -346, -670}, {  455,  591, 1287},
-{ -203, -593,-1086}, {  652,  352,  437}, {   39,   63, -457},
-{  841, 1265, 2105}, { -520, -882,-1584}, { -328, -711, 1421},
-{ -596, -342,  -70}, {  209,  173, 1928}, { -423, -598, -921},
-{  421,  605,  -38}, {   -2, -245, -127}, {  896, 1969, 1135},
-{ -379, -518,-1579}, {  173,  118,  753}, {  -55, -381,  -52},
-{  985, 1021,  753}, {   -2, -291, -891}, {  753,  992,  423},
-{  264,  131, -196}, {  895, 2274, 2543}, { -635,-1088,-2499},
-{ -529, -982,  526}, { -764, -830, -548}, { -436,  316,  599},
-{ -675, -940, -746}, {  -57,  236,  -11}, { -201,  -81, -798},
-{   16,  845, 1558}, { -737, -985,-1212}, { -468,   17,  290},
-{ -279, -584, -700}, {  183,  822,  705}, { -265, -492,-1187},
-{  421,  152,  468}, { -390,  166, -268}, {   39, 1550, 1868},
-{ -635, -966,-1571}, { -453, -492,  910}, { -284,-1027,  -75},
-{ -181, -133, 1852}, { -445, -624,-1174}, {  420,  367,  -49},
-{ -389, -212, -169}, {  707, 1073, 1208}, { -539, -710,-1449},
-{   83, -163,  484}, { -236, -543, -355}, {  338, 1175,  814},
-{ -246, -309, -958}, {  606,  760,   60}, {  166,   -8, -163},
-{ -306, 1849, 2563}, { -747,-1025,-1783}, { -419, -446,  209},
-{ -718, -566, -534}, { -506,  693,  857}, { -463, -697,-1082},
-{  325,  431, -206}, {  -15,   -8, -763}, {  545,  919, 1518},
-{ -611, -783,-1313}, {  256,  -55,  208}, { -165, -348, -662},
-{  321,  680,  930}, { -326, -429, -951}, {  484,  446,  570},
-{ -197,   72,  -73}, {  909, 1455, 1741}, { -563, -737,-1974},
-{ -124, -416,  718}, { -478, -404, -314}, {  -16,  446, 1636},
-{ -551, -537, -750}, {  -58,  638,  214}, {   55, -185, -271},
-{ 1148, 1301, 1212}, { -483, -671,-1264}, {  117,  285,  543},
-{ -204, -391, -111}, {  513, 1538,  854}, { -114, -190, -978},
-{  877,  595,  464}, {  260,  260, -311}, {  748, 2283, 2216},
-{ -517, -945,-2171}, { -326, -708,  378}, { -812, -691, -232},
-{ -560,  687, 1409}, { -732, -690, -836}, { -359,  645,  386},
-{ -265,   62, -678}, {  145, 1644, 1208}, { -555, -988,-1233},
-{  -78,   14,  114}, { -327, -358, -489}, {  392,  677,  697},
-{ -201, -236,-1140}, {  693,  449,  178}, { -243,  256, -433},
-{  611, 1385, 2456}, { -612, -901,-1464}, { -307,  -17,  499},
-{ -315, -667, -254}, {  256,  428, 1463}, { -486, -422,-1056},
-{  655,  370,   18}, { -102, -185, -276}, {  755, 1578, 1335},
-{ -488, -603,-1418}, {  182,  -93,  870}, {  -73, -458, -348},
-{  835,  862,  957}, { -282, -333, -746}, {  547,  839,  428},
-{  273,  -89,   13}, {  940, 1708, 2576}, { -418,-1084,-1758},
-{  -44, -358,  259}, { -497, -643, -560}, {   99,  557,  961},
-{ -421, -766, -917}, {  295,  326,  184}, {  175,   15, -626},
-{  532,  878, 1981}, { -443, -768,-1275}, {  221,  156,  268},
-{   39, -363, -505}, {  695,  772, 1140}, { -162, -459, -912},
-{  709,  444,  658}, {   25,  303, -312}, { 1268, 1410, 1715},
-{ -297, -766,-1836}, { -263, -108, 1070}, { -406,  -13, -129},
-{   57,  438, 2734}, { -374, -487, -835}, {  304,  696,  164},
-{  104, -235,    5}, { 1611, 1900, 1399}, { -229, -582,-1325},
-{  405,  192,  817}, {  -87, -438,  111}, { 1028, 1199,  993},
-{   68, -175, -934}, { 1033, 1117,  451}, {  478,  200, -248},
-{ 2127, 2696, 2042}, { -835,-1323,-2131}, { -799, -692,  466},
-{ -812,-1032, -469}, { -622,  288,  920}, { -701, -841,-1070},
-{ -411,  512,    8}, { -390,  -91, -744}, {  -30, 1043, 1161},
-{ -822,-1148,-1156}, { -294,  -46,  110}, { -411, -374, -678},
-{  214,  531,  668}, { -406, -420,-1194}, {  487,  232,  303},
-{ -318,   91, -472}, {  123, 1232, 2445}, { -722, -952,-1495},
-{ -738, -675, 1332}, { -543, -606, -211}, {  -95,  -98, 1508},
-{ -549, -514,-1193}, {  473,  211,   73}, { -288, -112, -389},
-{  537, 1332, 1258}, { -567, -755,-1545}, {   71, -283,  632},
-{ -170, -481, -493}, {  681, 1002,  817}, { -356, -331, -877},
-{  419,  706,  346}, {  241,  -34, -326}, {  377, 1950, 1883},
-{ -727,-1075,-1625}, { -233, -543,  116}, { -524, -806, -585},
-{  -73,  478,  729}, { -288, -925,-1143}, {  173,  447,  -52},
-{   68, -229, -606}, {  449,  529, 1797}, { -591, -875,-1363},
-{  183, -144,  324}, { -103, -452, -666}, {  623,  488, 1176},
-{ -238, -511,-1004}, {  326,  552,  458}, {  136,  108, -319},
-{  626, 1343, 1883}, { -490, -646,-1730}, { -186, -449,  984},
-{ -738,  -76, -170}, { -550,  755, 2560}, { -496, -510, -947},
-{  210,  694,  -52}, {   84, -322, -199}, { 1090, 1625, 1224},
-{ -376, -603,-1396}, {  343,   74,  632}, { -175, -502,  -32},
-{  972, 1332,  734}, {   52, -295,-1113}, { 1065,  918,  160},
-{  393,  107, -397}, { 1214, 2649, 1741}, { -632,-1201,-1891},
-{ -719, -277,  353}, { -651, -880, -122}, { -211,  209, 1338},
-{ -562, -714,-1059}, { -208,  388,  159}, { -320,  -61, -551},
-{  293, 1092, 1443}, { -648, -865,-1253}, {  -49, -143,  305},
-{ -401, -227, -585}, {  561,  532,  927}, { -117, -443,-1188},
-{  507,  436,  292}, {  -79,  233, -458}, {  671, 1025, 2396},
-{ -633, -842,-1525}, { -308, -286,  640}, { -373, -621, -407},
-{  418,  253, 1305}, { -315, -581,-1137}, {  572,  685, -281},
-{   61,  -68, -371}, {  991, 1101, 1498}, { -493, -683,-1362},
-{  -47,  164,  704}, { -256, -314, -268}, {  631,  949, 1052},
-{ -118, -348, -833}, {   68, 1180,  568}, {  152,  117,   34},
-{ 1113, 1902, 2239}, { -601, -959,-1706}, { -143, -489,  480},
-{ -332, -655, -574}, {   54,  353, 1192}, { -462, -652, -796},
-{  150,  549,  112}, {  195, -111, -515}, {  679, 1108, 1647},
-{ -558, -749,-1217}, {   -9,  272,  341}, {  -53, -265, -535},
-{  489,  843, 1298}, { -120, -482,-1032}, {  632,  543,  408},
-{  179,  306, -526}, { 1124, 1464, 2244}, { -417, -786,-1562},
-{ -224, -384, 1364}, { -377, -459,  -25}, {  385,  489, 2174},
-{ -332, -651, -829}, {  544,  553,   61}, {   22, -113,  -89},
-{ 1128, 1725, 1524}, { -216, -373,-1653}, {  161,  316,  908},
-{ -165, -222,  -67}, { 1362, 1175,  789}, {   73, -252, -767},
-{  738,  932,  616}, {  362,  246, -126}, {  787, 2654, 3027},
-{ -691,-1106,-2190}, { -565, -588,  524}, { -590, -979, -490},
-{ -263,  397,  982}, { -577, -837, -945}, {  -22,  435,  -49},
-{ -190, -118, -629}, {  -88, 1240, 1513}, { -636,-1051,-1019},
-{ -291,  189,  259}, { -257, -470, -629}, {  145,  945,  894},
-{ -326, -364,-1094}, {  543,  260,  630}, { -202,  189, -209},
-{  357, 1379, 2091}, { -569,-1075,-1449}, { -714, -239,  919},
-{ -420, -705,  -84}, { -109, -114, 2407}, { -413, -529,-1177},
-{  482,  368,  131}, { -186,  -72, -131}, {  861, 1255, 1220},
-{ -611, -658,-1341}, {  227, -121,  631}, { -176, -489, -218},
-{  745, 1175,  957}, { -321, -148, -936}, {  671,  966,  216},
-{  340,   -3, -143}, {  469, 1848, 2437}, { -729, -961,-1683},
-{ -213, -254,  321}, { -511, -438, -521}, { -126,  725,  903},
-{ -340, -685,-1032}, {  316,  480,   20}, {   23,  -89, -551},
-{  353, 1051, 1789}, { -544, -757,-1364}, {  298,  -25,  436},
-{ -100, -392, -519}, {  467,  754, 1078}, { -210, -398,-1078},
-{  620,  658,  630}, {   33,  147, -178}, {  921, 1687, 1921},
-{ -325, -528,-1978}, {    2, -285,  910}, { -371, -490, -230},
-{    0,  597, 2010}, { -496, -395, -834}, {   37,  945,  245},
-{  181, -160, -144}, { 1481, 1373, 1357}, { -355, -601,-1270},
-{  298,  322,  672}, { -193, -336,   77}, { 1089, 1533,  922},
-{  177,  -39,-1125}, {  996,  781,  536}, {  456,  366, -432},
-{ 1415, 2440, 2279}, { -466, -758,-2325}, { -303, -509,  387},
-{ -727, -557,   66}, { -145,  643, 1248}, { -544, -676, -916},
-{ -225,  862,  588}, { -152,   40, -533}, {  423, 1423, 1558},
-{ -572, -843,-1145}, { -128,   85,  461}, { -238, -257, -584},
-{  605,  748,  861}, {   24, -202,-1409}, {  797,  487,  303},
-{ -181,  364, -182}, {  616, 1378, 2942}, { -494, -852,-1441},
-{ -292,   61,  812}, {  -84, -723, -182}, {  555,  532, 1506},
-{ -365, -493,-1057}, {  822,  588,   11}, {  -14,  -18, -230},
-{ 1001, 1401, 1451}, { -474, -569,-1292}, {  302,   62, 1062},
-{  -70, -376, -222}, {  982,  974, 1149}, { -196, -234, -795},
-{  479, 1098,  499}, {  362,   58,   70}, { 1147, 2069, 2857},
-{ -487, -878,-1824}, {   73, -288,  348}, { -358, -500, -508},
-{  199,  721, 1242}, {  -78, -697, -795}, {  361,  536,  196},
-{  374,  110, -735}, {  847, 1051, 1896}, { -366, -713,-1182},
-{  315,  320,  429}, {   72, -215, -450}, {  759,  886, 1363},
-{  -30, -428, -834}, {  861,  627,  796}, {  118,  468, -279},
-{ 1355, 1883, 1893}, { -188, -642,-1612}, {   63, -175, 1198},
-{ -418, -211,   51}, {  414,  587, 2601}, { -234, -557, -858},
-{  424,  889,  222}, {  136, -101,   83}, { 1413, 2278, 1383},
-{  -84, -445,-1389}, {  414,  313, 1045}, {   29, -343,   65},
-{ 1552, 1647,  980}, {  183,  -91, -829}, { 1273, 1413,  360},
-{  553,  272, -107}, { 1587, 3149, 2603}
-};
-
-static const int16_t lsf_3_1[256][3] = {
-{    6,   82, -131}, {  154,  -56, -735}, {  183,  -65, -265},
-{    9, -210, -361}, {  113,  718, 1817}, { 1010, 1214, 1573},
-{  857, 1333, 2276}, {  827, 1568, 1933}, {  717, 1989, 2206},
-{  838, 1172, 1823}, {  721, 1000, 2154}, {  286,  476, 1509},
-{ -247, -531,  230}, {  147,  -82,  569}, {   26, -177, -944},
-{  -27, -273,  692}, { -164, -264, -183}, {  224,  790, 1039},
-{  899,  946,  601}, {  485,  771, 1150}, {  524,  677,  903},
-{ -140,  375,  778}, {  410,  676,  429}, {  301,  530, 1009},
-{  719,  646,   38}, {  226,  367,   40}, {  145,  -45, -505},
-{  290,  121, -121}, {  302,  127,  166}, { -124, -383, -956},
-{ -358, -455, -977}, {  715,  878,  894}, {  978,  923,  211},
-{  477,  272,   64}, {  188,  -78,   17}, { -143,  -65,   38},
-{  643,  586,  621}, { -134, -426, -651}, {  347,  545, 2820},
-{ 1188, 2726, 2442}, {  142,  -80, 1735}, {  283,  130,  461},
-{ -262, -399,-1145}, { -411,  155,  430}, {  329,  375,  779},
-{   53, -226, -139}, { -129, -236, 1682}, {  285,  744, 1327},
-{  738,  697, 1664}, {  312,  409,  266}, {  325,  720,  135},
-{    1,  221,  453}, {    8,  203,  145}, {  299,  640,  760},
-{   29,  468,  638}, {  103,  429,  379}, {  420,  954,  932},
-{ 1326, 1210, 1258}, {  704, 1012, 1152}, { -166, -444, -266},
-{ -316, -130, -376}, {  191, 1151, 1904}, { -240, -543,-1260},
-{ -112,  268, 1207}, {   70, 1062, 1583}, {  278, 1360, 1574},
-{ -258, -272, -768}, {   19,  563, 2240}, {   -3, -265,  135},
-{ -295, -591, -388}, {  140,  354, -206}, { -260, -504, -795},
-{ -433, -718,-1319}, {  109,  331,  962}, { -429,  -87,  652},
-{ -296,  426, 1019}, { -239,  775,  851}, {  489, 1334, 1073},
-{ -334, -332,   25}, {  543, 1206, 1807}, {  326,   61,  727},
-{  578,  849, 1405}, { -208, -277,  329}, { -152,   64,  669},
-{ -434, -678, -727}, { -454,  -71,  251}, {  605,  480,  254},
-{ -482,   11,  996}, { -289,  395,  486}, {  722, 1049, 1440},
-{  -30, -316, -786}, { -106, -115, -619}, {  861, 1474, 1412},
-{ 1055, 1366, 1184}, {  812, 1237,  925}, {   42, -251, -576},
-{  342,  141, -454}, { -168,  -80, 1359}, { -342, -656,-1763},
-{  100,  821,  725}, {  990,  747,  800}, {  332,  440,  568},
-{  663,  379,  852}, {  112,  165, -369}, {  597,  910,  282},
-{   -8,  834, 1281}, { -352,  572,  695}, {  462, 2246, 1806},
-{  345,  190, 1374}, {  416,  915, 2166}, {  168,  -82,  280},
-{ -516, -446,  840}, {   47,  533,   44}, { -362, -711,-1143},
-{   22,  193, 1472}, {  -85,  233, 1813}, {  -62,  579, 1504},
-{  550,  944, 1749}, {  723,  650, 1148}, {  972,  884, 1395},
-{ -425,  643,    0}, { 1000,  952, 1098}, {  249, 1446,  672},
-{ -334,  -87, 2172}, { -554, 1882, 2672}, {  140, 1826, 1853},
-{  920, 1749, 2590}, { 1076, 1933, 2038}, { -137, -443,-1555},
-{ 1269, 1174,  468}, { -493, -122, 1521}, { -451, 1033, 1214},
-{  482, 1695, 1118}, {  815,  649,  384}, { -446, -692,  107},
-{ -319, -605, -118}, { -207, -505,  525}, { -468,  -12, 2736},
-{   75, 1934, 1305}, {  880, 2358, 2267}, { 1285, 1575, 2004},
-{  -48, -304,-1186}, { -435, -461, -251}, { -366, -404, -547},
-{ -289, -605, -597}, { -538, -810, -165}, { -120,    3,  356},
-{  639, 1241, 1502}, {   96,  177,  750}, { -435, -585,-1174},
-{ -356,  109,  -79}, { -485,  288, 2005}, {    9, 1116,  731},
-{  880, 2134,  946}, { -265, 1585, 1065}, { 1157, 1210,  843},
-{ -498, -668,  431}, {  374,  321, -229}, { 1440, 2101, 1381},
-{  449,  461, 1155}, { -105,   39, -384}, { -263,  367,  182},
-{ -371, -660,  773}, { -188, 1151,  971}, { 1333, 1632, 1435},
-{  774, 1267, 1221}, { -482, -832,-1489}, { -237, -210,  860},
-{  890, 1615, 1064}, {  472, 1062, 1192}, {  185, 1077,  989},
-{ -568, -992,-1704}, { -449, -902,-2043}, { -142, -377, -458},
-{ -210, -554,-1029}, {  -11, 1133, 2265}, { -329, -675, -893},
-{ -250,  657, 1187}, {  519, 1510, 1779}, {  520,  539, 1403},
-{  527, 1421, 1302}, { -563, -871,-1248}, { -147, -463,  879},
-{  -76, 2334, 2840}, {  563, 2573, 2385}, {  632, 1926, 2920},
-{  719, 2023, 1840}, { -545, -723, 1108}, {  129, -125,  884},
-{ 1417, 1632,  925}, {  -94, 1566, 1751}, { -341, 1533, 1551},
-{  591,  395, -274}, {  -76,  981, 2831}, {  153, 2985, 1844},
-{ 1032, 2565, 2749}, { 1508, 2832, 1879}, {  791, 1199,  538},
-{ -190, -453, 1489}, { -278, -548, 1158}, { -245, 1941, 2044},
-{ 1024, 1560, 1650}, {  512,  253,  466}, {  -62, -323, 1151},
-{ -473, -376,  507}, { -433, 1380, 2162}, {  899, 1943, 1445},
-{  134,  704,  440}, {  460,  525,  -28}, { -450,  279, 1338},
-{    0,  971,  252}, { -445, -627, -991}, { -348, -602,-1424},
-{  398,  712, 1656}, { -107,  314, -178}, {   93, 2226, 2238},
-{  518,  849,  656}, { -462, -711, -447}, {  174,  -34, 1191},
-{ -119,   42, 1005}, { -372,  274,  758}, { 1036, 2352, 1838},
-{  675, 1724, 1498}, {  430, 1286, 2133}, { -129, -439,    0},
-{ -373,  800, 2144}, {    6, 1587, 2478}, {  478,  596, 2128},
-{ -428, -736, 1505}, {  385,  178,  980}, {  139,  449, 1225},
-{ -526, -842, -982}, {  145, 1554, 1242}, {  623, 1448,  656},
-{  349, 1016, 1482}, {   31, -280,  415}, { -316,  724, 1641},
-{  360, 1058,  556}, { -436, -358, 1201}, { -355, 1123, 1939},
-{  401, 1584, 2248}, { -527,-1012,  355}, {  233,  238, 2233},
-{ -550, -897, -639}, { -365, -501, 1957}, {  389, 1860, 1621},
-{  162, 1132, 1264}, { -237, 1174, 1390}, { -640, -411,  116},
-{ -228, 1694, 2298}, { 1639, 2186, 2267}, {  562, 1273, 2658},
-{  323,  338, 1774}, {  578, 1107,  852}, {   22,  594,  934},
-{ -143,  718,  446}
-};
-
-
-static const int16_t lsf_3_2[512][3] = {
-{   50,   71,   -9}, { -338, -698,-1407}, {  102, -138, -820},
-{ -310, -469,-1147}, {  414,   67, -267}, { 1060,  814, 1441},
-{ 1548, 1360, 1272}, { 1754, 1895, 1661}, { 2019, 2133, 1820},
-{ 1808, 2318, 1845}, {  644,  -93,  454}, {  858,  329, -136},
-{  489, -258, -128}, { -198, -745,  -41}, {  -52, -265, -985},
-{  346,  137,  479}, {-1741, -748, -684}, {-1163,-1725, -367},
-{ -895,-1145, -784}, { -488, -946, -968}, {  -85, -390, -725},
-{  215, -340, -171}, { 1020,  916, 1969}, {  564,  179,  746},
-{  662,  977, 1734}, {  887,  622,  914}, {  939,  856, 1165},
-{  309,  688,  803}, {  917,  161,  570}, {  118,  -20, -283},
-{ -816,  -42,  204}, {-1228, -325, -462}, { -963, -202, -143},
-{ -988, -484, -361}, { -702, -978, -477}, { -302, -790,-1188},
-{ -100, -786,-1088}, {-1054, -947,-1684}, { -202, -843, -782},
-{-1039,-1378, -901}, { -624, -110,  -85}, {  356,  213,  -10},
-{ -493,  364,  774}, {  425,  822,  479}, {  -83,  557,  520},
-{ -992,-1560, -572}, { -603, -741,  -26}, { -502, -638, -903},
-{  209,  306,  147}, { -316, -593, -596}, {  -85, -211, -225},
-{ -918, -529,  117}, {  233, -439, -738}, { 1101,  751,  633},
-{ 1457, 1716, 1511}, { 1765, 1457,  910}, { 1122, 1156,  849},
-{ 1354,  868,  470}, { -871,-1150,-1796}, { -871, -861, -992},
-{ -118,  155,  212}, {-1051, -849, -606}, {-1117,-1849,-2750},
-{-1019,-1427,-1869}, {  370, -184, -414}, {  959,  493,  104},
-{  958, 1039,  543}, {  154,  653,  201}, { 1249,  507,  150},
-{  663,  503,  230}, {  623,  777,  675}, {  659,   88, -110},
-{  843,  244,  224}, {  382,  541,  302}, {  724,  433,  666},
-{ 1166,  734,  341}, { -138,   20, -397}, {-1183, -424,  -46},
-{ -321, -352, -124}, { 1333, 1021, 1080}, {  262,  366,  723},
-{  922,  283, -551}, {   31, -636, -611}, { -689, -697, -415},
-{ -952, -779, -201}, {-1329, -598, -359}, { -953,-1285,  166},
-{  493,  305,  221}, {  846,  703,  610}, {  840,  936,  774},
-{ -723,-1324,-1261}, { -357,-1025,-1388}, {-1096,-1376, -365},
-{-1416,-1881, -608}, {-1798,-1727, -674}, { -545,-1173, -703},
-{  678,  786,  148}, { -123,  696, 1288}, {  644,  350,  -10},
-{  414,  614,   15}, {  137,  344, -211}, { -814,-1512, -819},
-{ -391, -930, -588}, {   47, -591, -898}, { -909,-1097, -163},
-{-1272,-1167, -157}, {-1464,-1525, -389}, {-1274,-1188, -624},
-{  671,  213,  454}, {  124, -274, -525}, { -729, -496, -152},
-{-1344,  122,  135}, {-2905, -589, -394}, {-1728,  441,  -50},
-{ 1476,  904,  787}, {  316,  236, -440}, { -347,  217,  413},
-{ -911, -917,  121}, { -455, -932,  202}, {  -92, -465, -375},
-{  488,  390,  474}, {  876,  729,  316}, {-1815,-1312, -669},
-{   87,  962,  432}, {  563, -249,-1058}, {  250,  285, 1105},
-{ 1141,  427,  696}, {-1038,-1664,-1582}, { -948,  346,  160},
-{ -309, -272, -858}, {  670,  624, 1250}, { -944, -408, -666},
-{ -606, -320, -384}, { -492,  230,   65}, {  334,  -50,  -16},
-{  -16, -690,-1397}, { 1791, 1716, 1399}, { 2478, 2063, 1404},
-{ 1245, 1471, 1426}, { -382,-1037,   -2}, {  173, -398, 1145},
-{ 1491, 2024, 1801}, {  772, 1274, 1506}, { 1429, 1735, 2001},
-{ 1079, 1218, 1273}, {-1154,-1851,-1329}, { -808,-1133,-1096},
-{ -451,-1033,-1722}, {   65,  578,  -84}, {-1476,-2434,-1778},
-{ -765,-1366, -494}, { -218, -594, -931}, {  337, -236,  562},
-{ 2357, 2662, 1938}, { 1489, 1276,  874}, {  189,  358,  374},
-{-1519,-2281,-2346}, { -967,-1271,-2095}, { -628,-1188,-1542},
-{ 1661, 1043,  546}, {  565, 1061,  732}, {  -64, -836, -434},
-{ -436,  -96,  203}, { 1078, 1216, 1636}, {  907, 1534,  986},
-{  326,  965,  845}, {  142,  -84,  197}, {  470, 2379, 1570},
-{ 1133,  470, 1214}, {  395, 1376, 1200}, { 1125, 1042,  348},
-{ -543,-1234, -376}, { -215, -181,  481}, {-1947,-1621, -210},
-{ -750,-1185,  390}, {   29, -399,   27}, {  820, 1236,  755},
-{  695,  979,  409}, { -174, 1197, 1035}, {  912, 1356, 1846},
-{ -992,-1437,  484}, {-1485,-1700,  208}, { -412, 1204, 1432},
-{ -271,  896, 1144}, { -416, 1777, 1434}, {-1696,-2644, -204},
-{-1789,-1551, 1033}, {-1656,-1559, 1303}, {-1253,-1589, 1081},
-{ -669,-1095,  -66}, { -682,  320, -345}, {  659,  305, 1069},
-{-1292, -804,  -19}, {-1635,-1291,   29}, {-1683, -497,   71},
-{ -287,   -7, -100}, { -494, -962, -237}, {  852, 1881, 1740},
-{-1217,-1387,  227}, { -660,  302,  373}, {   96, 1087, 1257},
-{-1074,-1669,  160}, {  485, 2076, 1798}, { -934, -220,  552},
-{ -596, -612,  237}, {  336, 1720,  879}, {  643,  629,  434},
-{ 1267,  522, 1633}, {   15,  244, -441}, { 1475,  717,  184},
-{ 1819, 1590, 1709}, {  988,  261,  937}, { 2093, 2345, 1520},
-{ 2139, 1858, 1606}, { -577, -579,-1203}, { -956,  135, -488},
-{ -464,   51, -338}, { -629, -348, -723}, { 1146, 2073, 1442},
-{ 2192, 1466,  911}, {-1444,-1572,-2278}, { 1400,  710, 1297},
-{ 1335,  633,  928}, { 1434, 2194, 2594}, { 2422, 2204, 1881},
-{  982, 2242, 1854}, {  380,  792, 1145}, {  -63, -539,  414},
-{ -252, -964, -314}, {-1261, -683, -780}, { -831, -526,-1005},
-{-1666,-1135, -424}, {-1611, -452, -299}, { 1268, 1048,  642},
-{ 1147,  853,  856}, { -675, -336,  139}, { 2268, 1343, 1418},
-{   29,  768,  797}, {-1224,  423,  564}, {-1318,-1082,  245},
-{-1302, -812,  573}, {-1298,-1617,  646}, { -968,  834,  723},
-{  993, 1652, 2027}, { -191, -817,  432}, {  662,   60,  198},
-{  626,  997, 1330}, { 1648, 1963, 1289}, {-1597,  -93,  -45},
-{-1088,   37,  -84}, { 1653, 2607, 2337}, { 1065, 2040, 2377},
-{ 1139, 2326, 2118}, {  859,  357, 1510}, {  664, 1227, 1099},
-{  479, 1360,  912}, { 1897, 1754, 2019}, { 1168, 1909, 1784},
-{  399,   34,  256}, { -593, -304,-1053}, {  547, 1694, 1407},
-{  647,  -99, -341}, { 1492, 1647, 1190}, {   38, -644, -212},
-{  395,  846,  222}, { -704, -765, -716}, { -724,-1964,-2804},
-{ -150,  291,  -82}, { 1233, 1459, 1007}, { -140, -155,  153},
-{  439,  297, 1568}, {-1529, -410, -636}, { 1536,  455, -237},
-{-1328, -139, -260}, {  531,  554,  868}, {  269, 1264,  606},
-{ -233,  883,  463}, {  742,  600, -120}, {  -73,  421,  212},
-{ -439,  -58,  804}, {-1286,-1241,  728}, {  294, -490,   50},
-{ -591, -905,-1254}, {   42, -687,  147}, {  -25,  273,  596},
-{ -311, 1213,  601}, { -754,  849,  584}, {  429,  607,  587},
-{ -602, -166,  461}, { -796, -823,  777}, { 1380,  910, 1755},
-{  119, 1417,  972}, { -219, -880,-1596}, {-1049,-1010,  438},
-{ -713,-1379,   78}, {    0, -447,-1179}, {-1136,-1319,-1573},
-{ 2248, 1767, 1309}, {  946, 1583, 1432}, { 1150,  482,  436},
-{ -469,-1108,  618}, { -447, -966, 1088}, {-1252,-1515, -114},
-{-1104,-2008, -579}, {  210,  613,  497}, {-1975,-1437,  642},
-{-1269, -856, 1011}, {-1646,-1185, 1063}, {-1555, -672, 1204},
-{-1692,-1114,  623}, { -979,-1326,-1277}, {  539, -147,  894},
-{-1354, -897, -434}, {  888,  475,  428}, {  153, -384,  338},
-{-1492, -511,  359}, { -974,-1115, -470}, {  105, -550,  677},
-{ -937,-1145,  877}, {  380, -260,  210}, { 1685,  924, 1256},
-{ 1775, 1190, 1095}, { 1419,  631,  533}, {  627,  299, -347},
-{ -411, -534,  647}, { -650,   29, -595}, { -378,-1367, 1563},
-{ 1402, 1121, 1465}, { 1089, 1410,  648}, {-2096,-1090,   -6},
-{  311, -194, -869}, { -639, -831,  416}, {-1162,-1224, 1349},
-{-1247, -941, 1813}, {-2193,-1987,  453}, { -619,-1367, -956},
-{-1606,-1972,-1507}, {-1175,-1057,-1104}, { -377,  601,  201},
-{ 1876,  825,  374}, { -430,-1323,   29}, {-1397,-1249,-1331},
-{-1007,-1504,  960}, {-1401,-2009,  197}, {-1379,-1949, -236},
-{-1077,  123,  422}, {  615, 1269,  546}, { -306, 1526,  904},
-{ 1194, 1788, 1177}, { -626, -884,-1526}, {  199,  766, 1504},
-{-1065,  862,  197}, {-1034,-1773, -887}, { -800,  145,  599},
-{-1134, -519,  626}, {-1205,-1926,  500}, { -910,-1041,-1395},
-{-1476,-1567, -969}, { -523,  842,   34}, { 1794,  646,  862},
-{-1207,-1888,-1002}, {  -78,   -9, -672}, { 1044,  759,   80},
-{ -600, 1139, 1019}, {   57, 2000, 1422}, { -833, 1414, 1121},
-{-1202, 1630, 1260}, { -461, 1420, 1244}, { 1537,  975,  253},
-{ -283,  324, -359}, {  599, -195,  106}, {  588,   62, -587},
-{ -757,  645,  205}, {   51, 1201,  758}, {-1209,  673, -390},
-{ -624, 1581,  941}, { -151, 1023,  735}, { 2820, 1301,  690},
-{ -302,  524,  -99}, { -900,-1588,-1189}, { 1084,  251,  238},
-{ 2014, 1792, 1010}, { 1245, 1633, 1741}, {-1227,-1540,-1208},
-{ -621,  456, -109}, {   40,  -65,  788}, { -805, -699,-1350},
-{ -583,  904,  832}, { -801,  532,  594}, { 1972, 1408, 1351},
-{-1177,-1880,-2114}, { -773,  568,  948}, {-1015, 1079, 1260},
-{-1111,  482, -130}, { 1778, 1044,  780}, {-1491,  245,  912},
-{ -316,-1141, -917}, { -536,-1442,-2346}, { -785,-1546,-1988},
-{-2003,  257,  909}, {-1849, -633,-1209}, {-1538,-1918,-1054},
-{ 1606, 2239, 1576}, { -567,-1500,-1544}, {-1279,  195, 1369},
-{ -817,  293, 1219}, { -525,  630, 1197}, {-1698,-2425,-1840},
-{ -303,  731,  747}, {-1169, -251,  269}, { -950,  -75, 1684},
-{-1182, -453, 1005}, {-1599,  585,  378}, {-2075, -571, -427},
-{ -529,-1159,-1171}, { -283, -205, -564}, { -796, 1246,  717},
-{ 2277,  927,  539}, { -454,  559,  440}, { -717, 1460, 1615},
-{-1030, 1052, 1610}, {-1169, -138,  847}, {  226,   39, -612},
-{-1251, -106, -729}, { -651,  968, 1302}, { -714, -636, 1727},
-{  353, 1069,  410}, { -798, -156, 1099}, { -574,  918,  446},
-{-1310, 1012,  466}, { 1408, 1591,  765}, { 1429, 1380, 1757},
-{ 1949, 1956, 2378}, { 1578, 2047, 2148}, {  916,   98,   -7},
-{ 1893, 1418, 2141}, {  348, 1405, 1579}, {  152, 1134, 1801},
-{ -267,  154, 1395}, {-1166,  469, 1054}, {-1142, -405,-1073},
-{-1341,-2264,-1581}, { -364,  869, 1706}, {-1162,  549, 1550},
-{-1225,-1932,-1666}, {-1485,-1977,-2055}, {-1727, -906,  -98},
-{-1897,  233, 1492}, {  892,  108, -331}, {-1728,-1170,-1700},
-{-1060, 1980, 1790}, {-1070,-1741,-1909}, {  -11, 1539, 1317},
-{-1600,   94,  497}, {  421,  443, -197}, {-1578, -349, -994},
-{ -599, -539, 1140}, { -965,-1419, -129}, {-1341,  175, -447},
-{ -375, 1311, 2055}, { -371, -650, -307}, {-1073,  605,  365},
-{-2057, -113,  430}, {  652,  914,  967}, {-1012,-1586,-2323},
-{ 1505, 1248,  559}, {  262, -486, -401}, {-1727, 1342, 1546},
-{   50,   56,  432}, { -330,  119, -604}, {-1517,-1080, -810},
-{  946, 1127, 1055}, {-1400,-1703,-1712}, {-1270, -704,-1317},
-{  807, 1821, 1143}, { 2760, 1606, 2171}, { 1120,  409, -150},
-{ -147,  404,  959}, { 2439, 1911, 2189}, { -906, -141, -866},
-{ -904, -142, -458}, { -557, -708,-1679}, { -830,-1431,-1583},
-{-1842,-1346,-1086}, {-1604, -272,  915}, {-1196,  772, 1056},
-{ -638,-1234,-1897}, { -500,  -81, -822}, {-1289,-1613, -735},
-{ -117,  785,  168}, {-1090, 1133,  922}, {-1096, -746, 1384},
-{  287, -547,-1063}, {-1376,-2201,-1204}, {-2176,-1570,-1757},
-{-1511,-2241, -771}, {-1737, 1099,  830}, {-1588,  724, 1243},
-{-1542,  693,  805}, {-1690, -240, 1665}, {-1700,   -4, -668},
-{ 2149,  816, 1042}, { -818,-1841,   22}, { -764, -507,  449},
-{-1151, -617,  289}, { -843,-1596, -240}, {  498, -234, -657},
-{ -752,  480, 1678}, { -319, -481,  193}, { -811,  171, -119},
-{-2128, -202, -848}, { 1717, 1140, 1700}
-};
-
-static const int16_t lsf_3_3[512][4] = {
-{   67,  -17,   66,  -12}, {-1690, -581, -104, -272}, {-1076,-1186,-1845, -376},
-{-1140, -926, -420,  -58}, { -259, -656,-1134, -553}, { 1788, 1227,  455,  129},
-{  462,  441, -240, -528}, {  840,  514,  130,  -75}, { 1114,  623,  153,  216},
-{ 1068,  564,   -6, -276}, { 1119,  727,  190,  -68}, {  704,  306,  119, -264},
-{  329,   61, -100,  156}, {  364,  123,  183, -208}, { -171, -123,  220,  -65},
-{ -306,  -62,  402,   17}, { -660, -938, -266,    0}, {  385,  235,  276,  285},
-{  320,  268, -336, -200}, { -724,   17,  -84,  381}, { -544,  429,  494,  519},
-{ -117,  288,  304,  329}, {  643,  157,  701,  508}, { 1200,  625,  796,  608},
-{  998,  421,  492,  632}, { 1204,  780,  446,  132}, { 1257,  844,  547,  449},
-{  829,  658,  541,  470}, { 1132, 1258,  918,  639}, {  547,   51,  423,  279},
-{    9,  392,   83,   94}, {  542,  543,  229, -147}, { -198,  129,  194, -185},
-{ -863,-1321, -302,   30}, { -597, -629,  -19,  114}, { -900,-1081,  466,  353},
-{-1483,-1573,   15, -143}, {-1708,-2059, -751,  196}, {-1876,-2067, -642, -258},
-{-2335,-1470, -450, -564}, { -584, -186, -872, -414}, {-1805, -988,-1125,-1310},
-{ -726,-1129,   28,  169}, {-1039, -864, -718, -246}, {  484,   36, -233,  -49},
-{  265,   67,  289,  467}, {  178,  543,  810,  540}, {   84,  282,  672,  703},
-{ -975, -777,  129,  287}, { -938, -227,  955,  595}, {-1617, -289,  836,  649},
-{-1847, -215, 1106,  718}, {-2034,-1085,  650,  440}, {-2101, -529,  907,  575},
-{-2011, -336,  670,  204}, {-2389, -692,  360,  137}, {-2156,-2204,   -9,  280},
-{ -266,  119,   39,  193}, {   78,  -59, -120,  226}, { -975, -858, -781,-1095},
-{ -619, -413, -451, -842}, {-1216,-1321, -813, -883}, {-1376,-1615, -394, -428},
-{ -737,-1113, -549, -790}, { -880, -975, -967, -642}, { -985, -886,-1273,-1361},
-{ -473, -804,-1401,-1407}, {  160, -265, -919, -275}, { -248, -250, -718, -380},
-{   97, -103, -375, -229}, { -415, -193, -135, -555}, {  628,  361,  119,  216},
-{  579,  364,  391,  209}, {  634,  522, -154, -148}, {  526,  389,  170,   33},
-{  105,  267,   64,  380}, {-1503,-1000,  -30, -369}, {-1070,   58,  647,  223},
-{-1520, -291,  621,  307}, {-1531,  156,  762,  404}, {-2029,  141,  734,  499},
-{-1849, -650,  306,  512}, { -187, -104,  -59,  438}, {  134, -230,  156, -186},
-{  -61, -260,  -16,   10}, { -569,   -3, -421, -297}, {-1725, -521, -346,  178},
-{-1362,  -59,  -44,  157}, {-2146, -461, -470, -349}, {-2170,   -1, -369, -121},
-{-1579, -373, -900,-1015}, {-1117, -591, -613, -784}, { -561,  122,  -75, -449},
-{   -4, -171, -123, -372}, {  192,  168,  -76, -132}, {  252, -107,  340,  210},
-{  392,  509,  272,  181}, { -109,  145,  218,  119}, { -416, -263,  485,  265},
-{ -181,   -8, -286,  226}, { -244, -218,   69, -290}, { -158,  191,   -1,  -64},
-{ -592,  -90,  213,  -96}, {  255,  435,  178,  -80}, { -369,  -18,  -33,  -80},
-{  -42,  415,  140, -222}, { 1143,  651,  649,  329}, {  767,  556,  249,  235},
-{  948,  413,  442,  279}, {  141,  339,  356,  557}, { -470, -170,   99,  237},
-{ -569, -800,  352,  565}, {  282,  473,  470,  332}, { -199, -690,-1284, -917},
-{ -193, -426, -800,-1122}, {  -26, -371, -490, -193}, {  637,  595,  519,  330},
-{  408, -115,   79,   12}, {  477,   87, -103, -376}, { -666, -347, -277, -291},
-{ -510, -481,  169,  297}, { -829, -738, -205, -171}, { -320, -540,  328,  283},
-{ -859, -958,  442,   -2}, {  556,  686,  130,   56}, { 1383, 1012,  755,  427},
-{  612,  741,  628,  553}, { -339, -796,  134,  277}, { -633,-1085,   -2, -246},
-{ -880,-1035,-1607,-1064}, { -994, -474,-1138, -488}, { -414, -795,   73, -206},
-{   -8, -139,  439,  204}, { -176, -578,   23,  131}, { -269, -757, -191,  245},
-{ -109, -338,  112,  316}, {  120, -406, -118,  611}, { -180, -186, -645,  115},
-{ -173,   34, -518, -489}, { -151,   61, -583, -844}, {  220, -138, -681,-1020},
-{  391,  -17, -598, -321}, {  157, -295,  129,  155}, { -926, -875, -987,  285},
-{  241,  -83, -125, -125}, {  620,  597,  432,   92}, {  393,   78,  409,   61},
-{ -393, -739, -413, -748}, {   83,   54,  361,   27}, {-1084,  130, -337, -694},
-{-1565,  297,  318,  -19}, {-1873,   36,   51, -317}, {-2323, -246,  231,  -84},
-{-2306, -783,   40, -179}, {-2233, -930, -474, -462}, { -754,  -86, -288, -626},
-{-2411, -455,  -63,  171}, {-1099,-1094,  -26, -143}, {-1193, -455, -406, -381},
-{ -605, -210,  -96,  -51}, { -580, -476, -276,  -15}, {-1195, -634,-1203, -881},
-{ -378, -221, -669, -952}, {  594,  178, -403, -676}, {  763,  327,  601,  290},
-{  172,  300,  203,  157}, {  -56, -336,  356,   24}, { -228, -296, -259,  -29},
-{ -186,  263,  416,   14}, { -353,  373,  -12, -216}, {  257,   96,  174,   57},
-{-1526, -616, -954, -499}, { -497, -152, -333,  125}, {  105,  200,  179,  -97},
-{ -331, -224,  765,  697}, {  760,  256,  301,   59}, {  455,  -85,  204,  288},
-{ -514,  240,  251, -109}, {  256,  417,  -34, -413}, {  101,  430,  384,  156},
-{  -31,  -10,  206,  426}, {  589,  145,  143,   71}, {  808,  906,  333,  349},
-{  986,  938,  589,  331}, { 1300,  824,  187,  509}, { 1062,  653,  379,  466},
-{ 1462,  937,  401,  274}, {  787,  861,  265,    2}, {  609,  553,   28,  305},
-{  926,  340,  106,  386}, {  241, -267, -147,  225}, { -178, -534,  347,  502},
-{ -643, -381,  397,   30}, { -651, -733, -435,  398}, { -407, -726, -484, -248},
-{ -789, -914, -438, -476}, { -498, -390,   75, -295}, { -964, -590, -606,  150},
-{ -121,  -49, -155,  -78}, {  935,  550,  389,   38}, { -321,  127,  424,  315},
-{ -285, -113,  283,  259}, {  658,  203,  322,  486}, {  903,  505,  748,  417},
-{  611,  423,  555,  512}, {  239,  -83, -578,  -19}, { -339, -731,  349,   13},
-{ -934,-1399, -114, -360}, {  107,  692,  182,   90}, {-1243,-1538,-1551, -725},
-{ -568, -903,-1363, -525}, { -517, -853, -861,-1004}, { -168, -690, -835,   63},
-{ -137, -556, -547,  144}, { -286, -817,  485,  319}, { -147, -408,  526,  246},
-{ -347, -434,  297,  -28}, { -290, -471,-1110,-1285}, { -460, -359, -988, -794},
-{ 1347, 1299,  690,  523}, { 1216, 1068, 1094,  757}, {  825, 1140,  752,  494},
-{ 1252, 1365, 1195,  898}, {  521, 1053,  532,  432}, { -334, -216, -313, -263},
-{ -160,   52, -472, -155}, {  127,  136, -380,   44}, {  851,  410, -162, -489},
-{  123, -255, -796, -667}, { 1090,  917,  789,  493}, { 1397, 1197,  558,  202},
-{  -51, -118, -342, -701}, {   83,  108,  -42, -441}, {   61,   95,  287,  256},
-{  -27,   89,  524,  531}, {  351,  227,  592,  545}, {  697,  155, -164,  307},
-{  638,  274, -489,  -50}, {  754,  240, -166, -124}, { -116, -579,-1212,  -63},
-{  190, -295,-1040,-1296}, {  147, -376, -177, -113}, {  841, 1241, 1051,  668},
-{    2,  293,  551,  304}, {-1096, -953, -248,  376}, { -750, -965,   87,  516},
-{ -275, -516,  689,  391}, { -379, -643,  876,  594}, { -390,-1013, -645,  573},
-{ -107, -568, -689, -826}, {-1025,  -27, -328, -203}, {  861,  749,  548,  233},
-{-1660,-1043,  451,  108}, { -660, -620,  430,  236}, {   21, -396,-1158, -631},
-{ 1372, 1298,  967,  577}, { 1125, 1125,  589,  454}, { -323, -865, -467,  153},
-{ -468, -699, -804, -509}, { -392, -718, -204,  -35}, { -603,-1093, -567, -162},
-{ -505,-1004, -102,  350}, {  219,  224,  423,  252}, {  395,  591,  608,  363},
-{ -746,  -96,  373,  172}, {  171,  295,  714,  339}, {  233,   77,  107,  277},
-{  157,  153, -499, -356}, { 1547, 1073,  576,  494}, { -292, -339, -504, -592},
-{ -903,  -72, -619, -481}, {-1594,-1117, -567, -254}, { -793, -507, -564, -291},
-{ -492, -532,  502,  560}, { -382,  427,  600,  230}, { -227,  477,  251,   75},
-{  285,  842,  813,  476}, {-1310,-1333,  186,  377}, { -587, -917,  643,  381},
-{-1186, -553,  411,   82}, {-1127, -820, -174, -540}, { -604,  119,  543,  205},
-{ -380,  657,  909,  567}, {  112, -298, -374,  114}, { -857, -251,   56,  159},
-{  401,  345,  -34, -140}, { -111, -607,   41,  614}, {  355, -114,  -77,  474},
-{  578,   56, 1450,  924}, { 1098, 1420,  741,  400}, {  246,   22,  588,  313},
-{ -121,  327,  831,  472}, {-1138, -608,  856,  552}, {-1241,-1072,  638,  600},
-{ -358,  254, -333, -303}, { -646,  739,  358,   74}, { 1226, 1671, 1221,  849},
-{ 2241, 1624,  983,  636}, { 1841, 1477,  749,  384}, {  350,  263,   87,  128},
-{-1902, -941, -144,  -64}, {-1734, -255,  288,  -31}, {-2644,-1238,  366,  235},
-{-1643,-1092,-1344, -304}, { -541,-1075,-1116,  123}, {-1178, -252, -816, -180},
-{-1016,  533,  565,  233}, { -487, -430, -188,  334}, {  867, 1236,  534,  171},
-{-1590,-1607,  635,  630}, {-2196,  310,  924,  412}, {-2358, -328,  956,  529},
-{-2639, -377,  630,  278}, {-2602,  317,  799,  299}, {-2406,  133,  340,   31},
-{-2156,-1468,  131,  125}, {-1184, -490, -139,   46}, { -744,  447,  891,  564},
-{   67, -451,  646,  604}, { -553, -429, -876,  396}, {  162,  -66, 1305,  915},
-{  479,  579, 1088,  794}, {  450,  278,  566,  324}, {-1057, -154,  148, -177},
-{-2545,  168, 1070,  592}, {-2351,  -42,  819,  345}, {-2344, -707,  721,  250},
-{-2175,-1497, -309,  122}, {  -78,  -73,  120,  173}, {   -4,  262, -263, -261},
-{ -431,  -64, -405, -732}, {-2609,  116,  -83, -193}, {-1525, -944, -477, -725},
-{ -508,  307,  170,  172}, {  832,  417,  832,  686}, { -225,  177,  894,  818},
-{ -482, -389, 1279, 1039}, { -383,  201, -350,   40}, {  730,  635,  226,  526},
-{  503,  462,  338,  398}, {  535,  714,   40, -282}, { 1482, 1471, 1085,  731},
-{ 1561, 1072,  909,  693}, { 1419, 1282,  889,  879}, { 1153,  728, 1186,  840},
-{ -226, 1130,  949,  689}, { -494, -986,-1556, -128}, { -568, -721, -713,  -26},
-{  317,  524,   70,  135}, { -405, -865,-1766, -652}, { -174, -801,  885,  773},
-{ -153,  -91, 1099,  751}, { -506,-1149,  853,  646}, {  241,  782,  519,  539},
-{ 1853, 1700, 1101,  684}, {-1249,-1486, -464,  188}, { -893,-1409,-1312, -341},
-{ -135,  438, -175,   18}, { 1111,  976,  319,  208}, {-1430,-1768,   83,  458},
-{ -530,-1000,  307,  129}, { -840,  -15,  -29, -356}, { -911, -924,-1147, -242},
-{ -119, -528,  127, -133}, { -761, -765,  190,  -83}, { -315,  895,  522,  231},
-{ -222,  102,  -63, -428}, {  316,  699,  379,   70}, {   25,  716,  314, -108},
-{  507,  874,  566,  238}, {  108,  941,  519,  195}, {  425,  -60, -427,  257},
-{  139, -103, -630,  446}, {  334,  370,  412,   48}, { -172, -690, -283,  557},
-{  187, -286,  158,  483}, {  140,  270, -344, -631}, {  924,  579, -116,  132},
-{  142,  466,  -68,  -64}, {  230, -145, -302, -542}, { -803, -912, 1018,  737},
-{ -773, 1015,  630,  297}, {-2596,   95,  445,  336}, {-2122,  491,  510,  191},
-{-1253,  161,   -2, -324}, {-1450, -633, -712, -105}, { -842, -254, -411,  100},
-{ -640, -290, 1010,  763}, { -650,  313, 1169,  730}, {  140,  505, 1030,  766},
-{  772,  287, 1067,  823}, {  495,  749,  305,  323}, { -164,  462,   78,  399},
-{ -342, -874,   69,  597}, {  -16,  620,  621,  337}, { -138, -444, -265,  218},
-{   84, -450,  953,  666}, { -222, -803,  541,  604}, { -921,-1376,  244,  116},
-{ -841, -723,  630,  588}, {  140,  663,  294,  368}, {  935, 1046,  881,  759},
-{ 1746, 1464,  916,  628}, {  436,  963,  281,    1}, { -119,   74,  542,  213},
-{    1, -567,  301,  241}, {  260,  435,  222,  396}, {  936,  957, 1108,  703},
-{  510,  506,  808,  478}, {  601,  694,  960,  620}, {  972,  741,  980,  600},
-{  834,  717,  767,  684}, {  643,  972,  935,  638}, {  501,  661,  720,  851},
-{ -105, -632, -303, -117}, { -429,  130,  789,  442}, { -522, -188,  704,  373},
-{ -759,   42,  814,  523}, { -531,-1137,  373,  578}, { -682,-1203, -455,  285},
-{-1163,-1577,-1098,   44}, {   81,  -82,  712,  363}, {  477,  246,  954,  622},
-{ 1604, 1622, 1277,  891}, { 1409,  859,  924,  892}, {  774, 1041,  947, 1142},
-{   40, -546,  -75,  288}, { -616, -106, -697,  -26}, { -169, -160, -891, -739},
-{ -279, -384,-1029, -350}, { 1781, 1308, 1046,  816}, { 1580, 1533, 1472, 1178},
-{ 1505, 1076, 1216,  899}, {  890,  904,  564,  654}, {  920,  692, 1021,  856},
-{ -493,  132,  177,  505}, {   71,  195,  -28,   97}, {  456,  351, -164,   88},
-{  439,  278,  -40,  350}, { 1395,  949,  234,  -95}, { -805, -472,   38, -163},
-{  367,  -98,  489,  523}, { 1025, 1178, 1212,  906}, {  319, 1314,  814,  461},
-{ -123, -543, -804,  447}, { -748, -324, -897,-1127}, { -737, -501, -789, -713},
-{  715,  777, 1239,  922}, { 1949, 1939, 1368,  865}, {  730,  880,  758,  388},
-{ -871,  454,   17, -251}, { -381, -810,-1583,  239}, { -521, -966, -792,  259},
-{ -890,-1358, -770,  -73}, {  166,  349, -212,  323}, { -840, -301,  473,  435},
-{ -679, -464,  728,  351}, { -156, -199,  667,  432}, {   29, -252,  415,  480},
-{ -731, -379,  145,  559}, { -528, -631,-1158, -159}, {  445,  273,  123,  639},
-{  373, -126,  800,  568}, {   84, -162,  720,  712}, { -830, -536, -185,  222},
-{  408,  452,  501,  771}, { -897,-1355,  -67,  442}, { -792,-1406,  566,  602},
-{  167, -326,  509,  330}, {  -95, -626, -730, -344}, { 1668, 1217,  779,  455},
-{ 1316,  828,  584,  719}, {  404,  -31, 1013,  789}, {   89,  107,  891,  549},
-{  871, 1581,  917,  671}, {  866, 1479, 1289,  854}, {  391, 1068, 1122,  812},
-{   78, -562,  345,  563}, {  429, -103,  417,  787}, { -122, -437,  411,  788},
-{ -913, -417,  602,  754}, { -226,  -16,  151,  760}, { -700,  118, -104,  -14},
-{-1128,   48,  284,  393}, { -390, -419, -639, -116}, { -910,  306,  316,  -13},
-{ 1207,  984,  821,  669}, {-1195, -693,  140, -213}, { -884, -416, -199, -558},
-{ -616,  245, -404, -664}, {  262,   56, -617, -724}, {  -85, -491, -320, -656},
-{ -570, -831, -129, -528}, {-1506,  -63, -367, -385}, { -358, -321,    4,   51},
-{ -366, -214,  319,  511}, {  146,  671,  -17, -291}, { -110,  464, -139, -496},
-{ -202,  220, -312, -631}, { -660,  -73, -655, -820}, { -662, -653,-1288, -857},
-{ -430, -953, -959, -264}, {  -49, -468,  -72, -381}, { -350, -563, -193, -407},
-{   55, -408, -803,   11}, { -309,  649,  188, -198}, { -512,  461,  -79, -458},
-{-1318, -263, -134, -523}, {-1657, -435, -495, -765}, {   57, -347, -414,  434},
-{-1141, -242, -664, -857}, {   34,  -68, -707, -338}
-};
-
-static const int16_t lsf_5_1[128][4] = {
-{ -451,-1065, -529,-1305}, { -450, -756, -497, -863}, { -384, -619, -413, -669},
-{ -317, -538, -331, -556}, { -414, -508, -424, -378}, { -274, -324, -434, -614},
-{ -226, -500, -232, -514}, { -263, -377, -298, -410}, { -151, -710, -174, -818},
-{ -149, -412, -156, -429}, { -288, -462, -186, -203}, { -170, -302, -191, -321},
-{ -131, -147, -297, -395}, { -228, -214, -245, -192}, {  -67, -316,  -71, -327},
-{ -104, -205,  -94, -183}, { -143,  -38, -193,  -95}, {   16,  -76, -124, -248},
-{   23, -237,   24, -244}, {   18, -136,   44, -111}, {  -33,  -24,  -25,    0},
-{  149,   19,   23, -143}, {  158, -169,  174, -181}, {  133,  -55,  165,  -26},
-{  111,   84,   98,   75}, {   87,  183, -115,  -11}, {   -8,  130,   11,  170},
-{  254,   77,  205,   17}, {  183,  112,  262,  194}, {  202,  287,   95,  189},
-{  -42, -105,  234,  179}, {   39,  186,  163,  345}, {  332,  199,  299,  161},
-{  -54,  285,  -78,  281}, { -133,  141, -182,  111}, {  249,  341,  271,  364},
-{   93,  403,   75,  391}, {   92,  510, -138,  220}, { -185,  -29,  -34,  361},
-{ -115,  320,    3,  554}, {   99,  286,  218,  591}, { -245,  406, -268,  453},
-{    0,  580,   25,  606}, {  275,  532,  148,  450}, {  -73,  739, -285,  518},
-{ -288,   94, -203,  674}, { -140,  -74,  205,  714}, { -114,  299,  176,  923},
-{  182,  557,  240,  705}, {  -16,  513,  485,  593}, {  293,  384,  451,  617},
-{  -38,   50,  563,  529}, {  303,  209,  459,  363}, {  433,  452,  450,  454},
-{  367,  606,  477,  741}, {  432,  353,  368,  267}, {  361,  716,  273,  583},
-{  453,  166,  510,  172}, {  201,  629,  274,  191}, {  568,  639,  302,  298},
-{  634,  387,  643,  350}, {  587,  560,  612,  565}, {  600,  788,  487,  672},
-{  512, 1015,  321,  333}, {  357,  854, -125,  413}, {  474,  712,   17, -151},
-{  564,  285,  270, -241}, {  971,  889,  489,  220}, {  510,  896,  549,  924},
-{  327,  825,  290,  911}, {  540, 1108,  158,  805}, {  199,  957,  511,  730},
-{  100,  874,   13,  791}, {  435,  632,  676,  972}, {  249,  900,  467, 1218},
-{  781, 1074,  585,  785}, {  -23,  669,  267, 1043}, {  619, 1084,  615, 1145},
-{  622,  905,  916, 1049}, {   80,  331,  584, 1075}, {   89,  639,  988,  961},
-{  770,  720,  798,  699}, {  492,  447,  899,  627}, {  271, 1188,  725, 1333},
-{   87,  603,  832, 1603}, {  616, 1127,  890, 1505}, { 1000, 1156,  866, 1009},
-{  995,  827, 1149,  858}, {  817, 1450,  773, 1320}, {  500, 1389,  312, 1153},
-{  -20, 1084,   64, 1283}, {    2, 1172,  399, 1869}, {  514, 1706,  502, 1636},
-{  886, 1522,  416,  600}, { 1131, 1350, 1275, 1390}, {  889, 1795,  914, 1766},
-{  227, 1183, 1250, 1826}, {  505, 1854,  919, 2353}, { -199,  431,  152, 1735},
-{ -213,  -28,  392, 1334}, { -153,  -52,  978, 1151}, { -323, -400,  813, 1703},
-{ -136,   84, 1449, 2015}, { -331, -143, -137, 1192}, { -256,  534, -157, 1031},
-{ -307, -439,  542,  731}, { -329, -420,  -97,  616}, { -362, -168, -322,  366},
-{ -247, -110, -211,   89}, { -196, -309,   20,   59}, { -364, -463, -286,   89},
-{ -336,  175, -432,  141}, { -379, -190, -434, -196}, {  -79,  150, -278, -227},
-{ -280,  166, -555, -422}, { -155,  541, -366,   54}, {  -29,  -83, -301, -774},
-{  186,  628, -397, -264}, {  242,  293, -197, -585}, {  124,  410,   53, -133},
-{   10,  340, -570,-1065}, {   65, -446,   68, -493}, {  383,  937, -357, -711},
-{ -359, -250, -677,-1068}, {  292,  -26,  363,    6}, {  607, 1313, -127,  -10},
-{ 1513, 1886,  713,  972}, { 1469, 2181, 1443, 2016}
-};
-
-static const int16_t lsf_5_2[256][4] = {
-{-1631,-1600,-1796,-2290}, {-1027,-1770,-1100,-2025}, {-1277,-1388,-1367,-1534},
-{ -947,-1461, -972,-1524}, { -999,-1222,-1020,-1172}, { -815, -987, -992,-1371},
-{-1216,-1006,-1289,-1094}, { -744,-1268, -755,-1293}, { -862, -923, -905, -984},
-{ -678,-1051, -685,-1050}, {-1087, -985,-1062, -679}, { -989, -641,-1127, -976},
-{ -762, -654, -890, -806}, { -833,-1091, -706, -629}, { -621, -806, -640, -812},
-{ -775, -634, -779, -543}, { -996, -565,-1075, -580}, { -546, -611, -572, -619},
-{ -760, -290, -879, -526}, { -823, -462, -795, -253}, { -553, -415, -589, -439},
-{ -533, -340, -692, -935}, { -505, -772, -702,-1131}, { -263, -306, -971, -483},
-{ -445,  -74, -555, -548}, { -614, -129, -693, -234}, { -396, -246, -475, -250},
-{ -265, -404, -376, -514}, { -417, -510, -300, -313}, { -334, -664, -463, -814},
-{ -386, -704, -337, -615}, { -234, -201, -233, -239}, { -167, -567, -203, -619},
-{ -147, -415, -115, -352}, { -166, -750, -171, -761}, { -270, -879, -264, -903},
-{ -367, -744,   43, -475}, {   14, -653,   43, -670}, {   11, -448,  -59, -521},
-{ -126, -119, -155, -613}, {  -42, -863,  -27, -931}, {  136, -483,  183, -468},
-{   55, -298,   55, -304}, {  313, -609,  313, -720}, {  322, -167,  100, -541},
-{   -3, -119, -111, -187}, {  233, -236,  260, -234}, {   26, -165,  134,  -45},
-{  -40, -549,  360, -203}, {  378, -388,  450, -383}, {  275,   20,  182, -103},
-{  246, -111,  431,   37}, {  462, -146,  487, -157}, { -284,  -59,  503, -184},
-{   24,   53,   -3,   54}, {  122,  259,  333,   66}, {  484,  104,  436,   68},
-{  195,  116,  190,  206}, {  269,   -9,  482,  352}, {  382,  285,  399,  277},
-{  452,  256,   69,  186}, {   13,  297,  -13,  259}, {  -95,   30,   56,  394},
-{  196,  425,  205,  456}, {  281,  577,   15,  191}, {  375,  290,  407,  576},
-{  -56,  227,  544,  405}, {    0,  549,  -92,  528}, { -229,  351, -245,  338},
-{ -362,  435,  167,  527}, {  -75,  302,   91,  824}, {  129,  599,  496,  679},
-{  186,  749,  153,  737}, { -281,  600, -348,  615}, { -236,  769,   41,  881},
-{   38,  890, -220,  841}, { -357,  883, -393,  903}, { -634,  474, -444,  850},
-{ -175,  678, -493,  242}, { -519,  785, -714,  582}, { -541,  366, -543,  434},
-{ -597,  500, -765,  222}, { -702,  917, -743,  962}, { -869,  501, -899,  548},
-{ -379,  200, -435,  157}, { -819,  214, -861,  157}, { -614,   40, -632,   94},
-{ -883,  -54, -741,  516}, { -501,  298, -614, -171}, { -870, -161, -865,  -23},
-{ -818,   93,-1015, -267}, { -662, -359, -549,    2}, { -442, -121, -377,    0},
-{ -227,   33, -414, -126}, { -129,  212, -934,   34}, {-1082, -282,-1119, -268},
-{ -710, -825, -420, -191}, {-1076, -928, -917,  -93}, { -628, -358,   97,    7},
-{ -206, -393, -101,   24}, { -203,   38, -168,   83}, { -599, -423, -279,  426},
-{ -700,  118,  -75,  206}, { -981, -673, -680,  417}, { -367,   37, -279,  474},
-{ -129, -318,  319,  296}, { -626,  -39,  343,  602}, { -696,  -39, -303,  940},
-{  104,  233, -380,  137}, {  -36,  269,  -75, -214}, {  120,   43, -529, -477},
-{  459,  164, -202, -229}, {  -49, -167,  609,  792}, {   98, -220,  915,  148},
-{  293,  283,  869,   91}, {  575,  394,  326,  -78}, {  717,   67,  365, -323},
-{  616,  -36,  731,   27}, {  619,  238,  632,  273}, {  448,   99,  801,  476},
-{  869,  273,  685,   64}, {  789,   72, 1021,  217}, {  793,  459,  734,  360},
-{  646,  480,  360,  322}, {  429,  464,  638,  430}, {  756,  363, 1000,  404},
-{  683,  528,  602,  615}, {  655,  413,  946,  687}, {  937,  602,  904,  604},
-{  555,  737,  786,  662}, {  467,  654,  362,  589}, {  929,  710,  498,  478},
-{  415,  420,  693,  883}, {  813,  683,  781,  925}, {  913,  939,  726,  732},
-{  491,  853,  531,  948}, {  734,  963,  315,  808}, {  761,  755, 1144,  760},
-{  655, 1076,  826, 1057}, { 1091,  838, 1003,  808}, { 1047, 1133,  659, 1101},
-{  992, 1050, 1074, 1075}, {  971,  694, 1226, 1054}, {  571,  841,  884, 1404},
-{ 1379, 1096, 1080,  861}, { 1231,  735, 1284,  760}, { 1272,  991, 1367, 1053},
-{ 1257,  700, 1050,  534}, {  988,  453, 1264,  599}, { 1140,  679, 1621,  815},
-{ 1384,  521, 1317,  393}, { 1564,  805, 1448,  686}, { 1068,  648,  875,  307},
-{ 1083,  361, 1047,  317}, { 1417,  964,  675,  571}, { 1152,   79, 1114,  -47},
-{ 1530,  311, 1721,  314}, { 1166,  689,  514,  -94}, {  349,  282, 1412,  328},
-{ 1025,  487,  -65,   57}, {  805,  970,   36,   62}, {  769, -263,  791, -346},
-{  637,  699, -137,  620}, {  534,  541, -735,  194}, {  711,  300, -268, -863},
-{  926,  769, -708, -428}, {  506,  174, -892, -630}, {  435,  547,-1435, -258},
-{  621,  471,-1018,-1368}, { -393,  521, -920, -686}, {  -25,   20, -982,-1156},
-{  340,    9,-1558,-1135}, { -352,   48,-1579, -402}, { -887,    6,-1156, -888},
-{ -548, -352,-1643,-1168}, { -159,  610,-2024, -963}, { -225,  193,-1656,-1960},
-{ -245, -493, -964,-1680}, { -936, -635,-1299,-1744}, {-1388, -604,-1540, -835},
-{-1397, -135,-1588, -290}, {-1670, -712,-2011,-1632}, {-1663,  -27,-2258, -811},
-{-1157,  184,-1265,  189}, {-1367,  586,-2011,  201}, { -790,  712,-1210,    3},
-{-1033,  808,-1251,  830}, { -111,  635,-1636,  447}, { -463, -949, -445, -928},
-{ -504,-1162, -501,-1211}, {  144, -351, -372,-1052}, { -283,-1059, -279,-1123},
-{ -575,-1438, -587,-1614}, { -935, -984,  229,  690}, { -921, -719, -403, 1362},
-{ -685, -465,  874,  397}, { -509,  -46,  317, 1334}, { -485,  456,  813,  439},
-{ -411,  339,  898, 1067}, { -425,   46, 1441,  497}, { -909, -800, 1465, 1046},
-{ -254, -321, 1430, 1165}, {   68,  350, 1034,  666}, {  370,   11, 1311,  790},
-{  143,  232, 1041, 1562}, { -114,  663, 1616, 1078}, {  454,  579, 1275, 1040},
-{  -76,  909,  752, 1067}, {  153,  512,  348, 1214}, {  614,  385, 1843,  808},
-{  269, 1034,  203, 1086}, {  652, 1017, 1783, 1130}, {  429, 1327,  387, 1384},
-{  -49, 1183,  -72, 1215}, { -416, 1001,  544, 1749}, { -352, 1223, -502, 1199},
-{ -589,  569, -227, 1630}, { -142, 1578, -230, 1715}, { -714, 1288, -838, 1398},
-{ 1131, 1357, -208, 1232}, {  437,  965, -929,  818}, {  811, 1410,  859, 1507},
-{  164, 1212, 1387, 1793}, {  484, 1874,  456, 2063}, {  996, 1170, 1326, 1402},
-{ 1316, 1360, 1135, 1262}, { 1234, 1618, 1361, 1768}, { 1421, 1227, 1584, 1347},
-{  854,  672, 1685, 1566}, { 1139, 1270, 2016, 1825}, { 1773, 1581, 1532, 1460},
-{ 1487,  946, 1659, 1021}, { 1744, 1212, 1392,  977}, { 1772, 1161, 1826, 1164},
-{ 1718, 1429, 1973, 1591}, { 1185,  864, 2132, 1061}, { 1799,  814, 1838,  757},
-{ 2104, 1315, 2054, 1258}, { 2113,  915, 2331,  930}, { 1467, 1147, 2590, 1439},
-{ 2245, 1744, 2090, 1620}, { 2358, 1454, 2666, 1506}, { 1876, 1837, 2070, 1975},
-{ 1739, 1577,  682, 1289}, { 1584, 2045, 1454, 2098}, { 2498, 2004, 2711, 2066},
-{  726, 1588, 2756, 2336}, {  228,  847, 2456, 1659}, {   36,  301, 1942, 1957},
-{ -446,  -96, 2154, 1396}, { 1533, 1101,   14,  608}, { -923, -732, 1383, 1982},
-{ 1345,  952, -680,  321}, { 1281, 1268,-1594,  365}, {  941,  946,-1737, -822},
-{ 2374, 2787, 1821, 2788}
-};
-
-static const int16_t lsf_5_3[256][4] = {
-{-1812,-2275,-1879,-2537}, {-1640,-1848,-1695,-2004}, {-1220,-1912,-1221,-2106},
-{-1559,-1588,-1573,-1556}, {-1195,-1615,-1224,-1727}, {-1359,-1151,-1616,-1948},
-{-1274,-1391,-1305,-1403}, {-1607,-1179,-1676,-1311}, {-1443,-1478,-1367, -898},
-{-1256,-1059,-1331,-1134}, { -982,-1133,-1149,-1504}, {-1080,-1308,-1020,-1183},
-{ -980,-1486, -967,-1495}, { -988, -922,-1047,-1077}, { -838,-1179, -858,-1222},
-{-1131,-1041,-1064, -767}, { -872,-1157, -701, -880}, { -706, -906, -774,-1016},
-{ -578,-1080, -801,-1478}, { -591,-1111, -592,-1146}, { -713,-1388, -640,-1376},
-{ -597,-1059, -416, -903}, { -686, -832, -661, -708}, { -444, -868, -490, -921},
-{ -374, -776, -619,-1170}, { -585, -549, -769, -795}, { -435, -659, -530, -741},
-{ -498, -837, -357, -597}, { -279, -871, -243, -887}, { -282, -665, -280, -667},
-{ -165, -560, -394, -903}, { -362, -410, -448, -583}, { -409, -574, -313, -357},
-{ -637, -548, -570, -436}, { -896, -504, -382, -757}, {  -58, -481, -165, -618},
-{ -191, -374, -234, -382}, { -222, -683,  -25, -480}, { -418, -359, -730, -353},
-{ -324, -157, -432, -322}, { -394, -303, -284, -104}, { -601, -289, -556, -196},
-{ -588, -150, -659, -608}, { -473,  -24,  -68, -448}, { -474,   -8, -506,  -45},
-{ -748, -184, -844, -252}, { -901,  -91, -584,  -97}, { -652,  138, -764, -131},
-{ -678,  -12, -670,  165}, { -259,   -3, -840, -107}, { -909,   37, -992,   44},
-{ -854, -415, -839,   13}, {-1001, -271,-1026, -309}, { -798, -478, -832, -488},
-{ -943,  168,-1112, -387}, {-1185, -101,-1183,  -40}, { -941, -316,-1030, -770},
-{-1044, -625,-1081, -538}, {-1224, -299,-1312, -436}, {-1197, -663,-1167, -161},
-{-1216, -690,-1237, -831}, {-1432, -720,-1403, -493}, { -898, -740, -922, -801},
-{-1102, -402,-1579, -964}, {-1061, -638,-1269,-1438}, {-1499, -934,-1502, -895},
-{-1598, -564,-1723, -717}, { -606, -597,-1166,-1085}, {-1369, -468,-1946,-1493},
-{-1838, -953,-1932, -931}, {-1499, -188,-1635, -421}, {-1457, -338,-1448,  -22},
-{-1942, -422,-2006, -249}, { -496, -114,-1910, -755}, {-1289,  174,-1451, -109},
-{ -482, -257,-1221, -508}, {-1617,  151,-1694,  208}, { -654,  107,-1651,   29},
-{-1141,  279,-1215,  306}, {-1228, -506, -730, -175}, {-1236, -101, -969,  551},
-{ -870,  278, -823,  315}, { -563,  376,-1051,  228}, { -507,  280, -599,  281},
-{ -758,  253, -305,  379}, { -755, -134, -611,  660}, { -824,  536, -817,  646},
-{ -413,   49, -341,  177}, { -453,  526, -482,  589}, {  -71,  339, -657,  264},
-{ -244,  295, -237,  315}, { -387,  569, -506,   -9}, { -377,   14, -160,  661},
-{ -216,   40, -308,  -46}, {   95,  214, -242,  167}, {  -86,  192,  -56,   27},
-{  -76,   31,   36,  309}, { -106, -182, -113,   74}, { -441,  -22,   23,  139},
-{   81,  -11,   44,   15}, {  -87, -137, -118, -207}, { -158,  -58,  272,  -92},
-{ -156, -441,    8, -136}, {  128, -221,  101, -218}, {   40, -197,  -76, -456},
-{    9, -445,   33, -423}, {  226,   60,   73, -222}, {  156, -399,  280, -318},
-{  245, -341,  166, -499}, {  339, -190,  327, -219}, {  325, -137,  -89, -596},
-{  100, -627,  144, -677}, {  487,   28,  252, -391}, {  214,  -41,  282,  -28},
-{   99, -286,  331,   49}, {  459, -388,  565, -369}, {  436,   28,  336,   -9},
-{  397, -167,  618,   34}, {  596,  -17,  561, -140}, {  299,   79,  522,  125},
-{  203,    2,  244,  288}, {  255,  211,  175,   82}, {  596,  187,  517,  108},
-{  381,  255,  365,  297}, {  497,  352,  327,  -82}, {   25,  210,  371,  245},
-{  261,    3,  545,  449}, {  140,  294,   44,  295}, {  212,  347,  244,  494},
-{  331,  528,  201,  307}, {  349,  411,  613,  284}, {  614,  413,  464,  322},
-{  624,  397,   97,  200}, { -160,  384,  149,  362}, {  495,  525,  269,  585},
-{   33,  491, -121,  433}, {  427,  611,  498,  516}, {  171,  443,  497,  666},
-{  440,  275,  566,  575}, {  146,  639,  155,  670}, {  -33,  173,  212,  696},
-{ -166,  601, -191,  695}, { -489,  503,  175,  742}, {  214,  476,  372, 1083},
-{  578,  530,  586,  777}, {  425,  874,  315,  841}, {  374,  848, -165,  565},
-{   35,  991,  -39, 1062}, {  329,  712,  786,  840}, {  645,  795,  661,  676},
-{  571,  918,  632, 1079}, {  673,  817,  318,  388}, {  874, 1012,  564,  848},
-{  880,  620,  557,  479}, {  671,  453,  692,  468}, {  840,  642,  844,  645},
-{  506,  428,  897,  567}, {  837,  387,  962,  499}, {  691,  561,  939,  926},
-{  783,  296,  790,  268}, { 1028,  530,  874,  329}, {  548,  143,  675,  291},
-{  503,   66, 1041,  359}, {  786,   97,  805,   33}, {  837,  470,  511,   49},
-{ 1092,  327, 1174,  323}, {    3,  242,  872,  474}, {  689,  429, 1329,  678},
-{ 1042,  620, 1109,  664}, {  321,  193,  889,  950}, { 1153,  874,  893,  635},
-{  877,  862,  948,  913}, { 1293,  665, 1320,  639}, {  997,  793, 1402, 1030},
-{ 1176, 1012, 1110,  959}, { 1410,  925, 1403,  915}, {  543,  862, 1116, 1222},
-{  835, 1190,  835, 1190}, {  959, 1148, 1147, 1376}, { 1300, 1193, 1415, 1231},
-{ 1335, 1341,  746, 1092}, { 1711, 1283, 1389, 1073}, { 1334, 1566, 1153, 1475},
-{ 1645, 1137, 1825, 1220}, { 1056, 1382, 1521, 1730}, { 1632, 1545, 1620, 1542},
-{  855, 1596,  865, 1667}, {  693,  885, 1716, 1519}, { 1167, 1296, 2209, 1760},
-{ 1952, 1493, 2020, 1482}, { 1534, 1866, 1694, 2008}, { 1566,  748, 1761,  825},
-{  294, 1392, 1084, 2058}, {  621, 1315,  365, 1287}, {  198, 1028,  488, 1408},
-{  249,  403, 1014, 1561}, {  324,  363, 1645, 1044}, {  193,  367, 2034, 1859},
-{ -251,  579,  750,  994}, { -243,   30, 1325,  879}, {  -28, -169,  624,  917},
-{ -453,  159,  186, 1370}, { -614,    6,  537,  392}, {  -94, -291,  781,  229},
-{ -128, -298,  245,  491}, { -701, -648,  972,  789}, { -501, -640,  178,  255},
-{ -365, -390, -255,  317}, { -958, -294, -191,  228}, { -775, -447,  157, -237},
-{ -657, -720, -407,   92}, { -117, -611,  334, -230}, { -679,-1084, -144, -317},
-{ -901, -861, -738, -360}, {  -85, -727,  -90, -787}, {  100,  -22, -391, -263},
-{  -56,  -73, -337, -754}, {    5, -189, -706, -624}, {   89, -344, -135,-1113},
-{ -353, -237, -684,-1135}, { -275,-1102, -269,-1203}, {  152,  145, -722,-1232},
-{   49,   80,-1248, -776}, { -248,  391, -732, -547}, {  469,  218, -255, -864},
-{   69,  366, -166, -485}, { -688,  191,-1212,-1196}, { -170, -169,-1308,-1631},
-{  321,  470,-1419,-1243}, {  -64,  272,-1361, -248}, {  492,  565, -721, -609},
-{  195,  485, -573, -133}, {  427,  202, -171, -118}, {  199,  575,    2,  -31},
-{  694,  755,-1366,  -39}, {  552,  557, -489,  271}, {  680,  537,   13, -453},
-{  855,  954, -133,  -52}, {  -81,  738,-1169,  637}, { 1055, 1059,  -95,  676},
-{ 1259, 1081,  489,  305}, { -449,  954, -534,  996}, { -969,  866,-1058, 1059},
-{-1294,  618,-1416,  617}, { -458, 1366, -159, 1821}, { -774, -528,  -14, 1110},
-{-1202, -901, -772,  433}, {-1256,-1255,-1011, -302}, { -602, -585, -759,-1618},
-{ -760,-1549, -840,-1921}, { -816, -539,-1769,-2235}, { -227,  -36,-2034,-1831},
-{-2107,-1126,-2471,-1816}, {-1470,  252,-2701, -415}, { -571, -467, 1509, 1554},
-{ 2180, 1975, 2326, 2020}
-};
-
-static const int16_t lsf_5_4[256][4] = {
-{-1857,-1681,-1857,-1755}, {-2056,-1150,-2134,-1654}, {-1619,-1099,-1704,-1131},
-{-1345,-1608,-1359,-1638}, {-1338,-1293,-1325,-1265}, {-1664,-1649,-1487, -851},
-{-1346,-1832,-1413,-2188}, {-1282, -681,-1785,-1649}, { -966,-1082,-1183,-1676},
-{-1054,-1073,-1142,-1158}, {-1207, -744,-1274, -997}, { -934,-1383, -927,-1416},
-{-1010,-1305, -783, -955}, {-1049, -900, -993, -817}, { -737, -823, -972,-1189},
-{ -738,-1094, -738,-1154}, { -784, -801, -810, -786}, { -892, -520,-1000, -818},
-{ -644, -965, -577, -882}, { -541, -694, -671, -917}, { -595, -642, -646, -615},
-{ -956, -621, -925, -515}, { -727, -483, -815, -485}, { -840, -578, -440, -713},
-{ -578, -325, -657, -670}, { -386, -570, -441, -666}, { -514, -787, -392, -529},
-{ -522, -453, -487, -423}, { -616, -585, -617, -157}, { -662, -268, -680, -348},
-{ -322, -323, -632, -444}, { -304, -430, -332, -458}, { -277, -468, -659, -793},
-{ -319, -636, -227, -554}, { -373, -347, -334, -210}, { -456, -192, -530, -242},
-{ -216, -198, -366, -370}, { -338, -161, -409, -748}, { -107, -380, -294, -643},
-{ -223, -665, -234, -741}, { -141, -496, -130, -510}, { -139, -327, -172, -305},
-{ -306, -580, -164, -263}, { -262, -172,  -67, -402}, {   31, -366,  -10, -436},
-{  -86, -527,   71, -377}, {  -22, -609,  -12, -678}, {  -67, -319,   63, -191},
-{   35, -181,  -39, -242}, {  126, -167, -140, -544}, {  155, -297,  174, -297},
-{   38,   -8,  117, -380}, {  197, -452,  240, -522}, {  223, -103,  110, -187},
-{   87, -155,  169,  -47}, {  157,   26,  -83, -100}, {  128,   80,  209,  -62},
-{    6,    7,   22,    5}, {  318,  -20,  248,  -45}, { -200,  -63,  156,  -69},
-{  250, -183,  369, -126}, { -113,  -76, -142, -122}, {  -64, -254,  -31,   35},
-{ -177,  -71,   -7,  171}, {   93,   27,  108,  212}, { -330, -209, -123,  -70},
-{ -279,   95,  -96,   20}, { -188,  -61, -314,   87}, { -300,  -78, -354, -134},
-{   11,  122, -140,  122}, { -275,  152, -293,  140}, {  -82,  138, -321, -111},
-{ -480, -156, -359,   76}, { -254,  -40, -635,  -96}, { -522,   79, -507,    8},
-{ -268,  303, -539,   68}, { -446,   61, -522,  306}, {  111,  189, -435,  122},
-{ -379,  166, -571, -398}, { -632,  -74, -747,  -95}, { -455,  194, -952,   83},
-{ -798,  192, -755,  192}, { -781, -162, -619,  234}, { -663, -297, -488, -109},
-{ -964, -132, -838,  -68}, { -843,   58,-1112,  -86}, { -805, -299, -944, -253},
-{ -778,  -50, -965, -549}, { -352,  -98, -992, -343}, {-1117, -315,-1117, -307},
-{-1155, -374, -637, -230}, {-1166,  -43,-1299, -100}, { -925, -393,-1274, -600},
-{ -689, -130,-1479, -312}, {-1321, -254,-1464, -442}, {-1292, -613,-1261, -503},
-{-1501, -368,-1322,   26}, {-1432,  -66,-1743, -161}, {-1644, -467,-1760, -548},
-{-1393, -568,-1556, -871}, {-1495,-1034,-1387, -571}, {-1917, -528,-1783, -123},
-{-1897, -231,-2054, -323}, {-2052, -906,-1976, -567}, {-1917, -620,-2047, -989},
-{-1077, -370,-2031, -704}, {-2355, -749,-2740,-1089}, {-1909,  159,-2012,  248},
-{ -626, -123,-2339, -962}, { -669, -408,-1379,-1174}, { -452, -364,-1044, -735},
-{ -132,  183,-1620, -752}, { -547, -307, -777,-1261}, {  -98,   41, -880,-1091},
-{ -257,   97,-1602,-1833}, {   31,  -26, -644, -561}, { -180, -546, -385,-1095},
-{ -410, -802, -414, -827}, { -457, -970, -490,-1109}, { -215, -916, -144, -937},
-{ -493,-1269, -517,-1507}, {  181,  101, -332, -889}, { -836, -937, -559, -429},
-{ -629, -547, -183, -337}, { -545,  -82, -250, -286}, {    5, -132, -348, -252},
-{ -293, -472, -158,  100}, {  -29,  197, -236, -424}, { -861, -213, -140,   -7},
-{ -427, -443,  187,  -97}, { -684, -736, -293,  258}, { -368, -152, -150,  392},
-{ -609,  175, -142,  299}, { -138,  152, -119,  329}, { -486,  -52,  293,  198},
-{ -183,  117,  175,  331}, {  -58, -274,  231,  300}, { -288,  330, -305,  372},
-{ -111,  409,   -9,  423}, {   83,  256,   67,  367}, {  -19,  248,   91,  113},
-{  -35,  406, -191,  154}, {  238,  296,    5,  197}, {  141,  221,  313,  198},
-{  211,  421,  244,  334}, {   88,  426, -243,  454}, {  202,  552,   -5,  403},
-{  291,  185,  219,  301}, {  251,  138,  128,   69}, {  197,  288, -140,  -61},
-{  188,  361,  197,  598}, {  442,  273,  290,  143}, {  472,  482,  157,  370},
-{  415,  321,  372,  385}, {  402,  552,  155,   24}, {  550,  263,  -11,   21},
-{  360,  227,  147, -254}, {  424,   97,  366,  -13}, {  375,  141,  449,  232},
-{  396,  507,  474,  272}, {  701,  324,  362,  -47}, {  587,  148,  543,   69},
-{  400,  -51,  561,   59}, {  220,  -10,  352,  147}, {  206,  211,  653,  185},
-{  563,  297,  565,  284}, {  594,  121,  766,  192}, {  398,  118,  642,  434},
-{  233,  264,  481,  467}, {  129, -165,  699,  239}, {   90,   26,  342,  474},
-{  -55,   27,  388,   94}, { -172,    0,  725,  379}, {  -60,  337,  370,  465},
-{   95,  319,  806,  595}, {   78,  260,  497,  851}, {  210,  560,  458,  574},
-{ -464,  202,  497,  625}, { -202,  152,   48,  712}, {  -20,  566,  100,  715},
-{  455,  468,  411,  605}, {  319,  646,  195,  615}, {  401,  538,  680,  739},
-{  201,  667,  434,  954}, {  454,  425,  646,  491}, {  606,  681,  416,  508},
-{  497,  822,  426,  815}, {  660,  647,  628,  716}, {  697,  466,  618,  457},
-{  685,  460,  365,  309}, {  721,  567,  836,  601}, {  609,  300,  825,  459},
-{  943,  687,  681,  533}, {  915,  598,  591,  243}, {  876,  451,  874,  420},
-{  786,  317,  732,  220}, {  922,  317, 1108,  367}, {  531,  466, 1028,  649},
-{ 1053,  615, 1034,  553}, {  829,  602, 1021,  799}, {  927,  803,  878,  763},
-{  799,  496, 1373,  773}, {  585,  770,  803,  930}, { 1099,  793, 1222,  862},
-{ 1209,  895, 1025,  727}, {  772,  845, 1172, 1115}, {  867, 1021,  830, 1013},
-{  841,  910,  506,  703}, { 1239, 1077,  620,  819}, { 1196, 1083, 1155, 1081},
-{ 1142,  907, 1547, 1121}, { 1309,  648, 1343,  612}, { 1484,  988, 1479,  937},
-{  985, 1328,  955, 1341}, {  429,  910,  841, 1338}, {  564, 1179,  412, 1156},
-{ 1427, 1320, 1434, 1330}, {  640,  760, 1726, 1410}, {  190,  555, 1073, 1005},
-{  426,  257,  839,  980}, {  235,  231, 1520, 1167}, {  109,  293, 1014, 1569},
-{  305,  142, 1148,  539}, { -291, -108, 1213,  972}, {   22, -216,  667,  828},
-{ -482,  438,  453, 1431}, { -581, -422,  789,  387}, { -358, -454,  174,  780},
-{  -36, -372,  390, -134}, { -629,  160, -306,  751}, {-1258, -331,  177,  522},
-{ -248,  574, -251,  639}, { -531,  407, -596,  394}, { -419,  789, -617,  801},
-{ -986,  399, -857,  727}, {   -7,  518, -703,  310}, {-1143,  -24,-1002,  287},
-{ -960,  363,-1299,  312}, {-1534,  245,-1557,  305}, {   28,  153, -859, -175},
-{  -33,  332,-1398, -154}, {  212,  410, -593, -197}, {-1092, -704, -904,  -65},
-{  282,  367, -918, -686}, {  345,   93, -258, -357}, {  696,  644, -693,  -28},
-{  448,  493, -273,  193}, {  527,  546, -243, -513}, {  384, -136,  273, -353},
-{  512, -142,  537, -198}, {  941,  750,   83,  248}, {  578,  861,  -56,  592},
-{  842,   44,  892,   24}, {   33,  890,  -16,  982}, {  831, 1398, 1535, 1898},
-{ 1716, 1376, 1948, 1465}
-};
-
-static const int16_t lsf_5_5[64][4] = {
-{-1002, -929,-1096,-1203}, { -641, -931, -604, -961}, { -779, -673, -835, -788},
-{ -416, -664, -458, -766}, { -652, -521, -662, -495}, {-1023, -509,-1023, -428},
-{ -444, -552, -368, -449}, { -479, -211,-1054, -903}, { -316, -249, -569, -591},
-{ -569, -275, -541, -191}, { -716, -188, -842, -264}, { -333, -248, -318, -228},
-{ -275,    1, -567, -228}, { -115, -221, -238, -374}, { -197, -507, -222, -579},
-{ -258, -432,  -61, -244}, { -345,    2, -338,   39}, { -215, -169,  -58,    0},
-{  -56,   -6, -203, -131}, {    1, -186,   -5, -211}, {    6, -380,   11, -418},
-{ -116,  131, -134,  113}, {   89,   -4,   71,   -2}, {  -19, -192,  262,   24},
-{  189,  151, -133, -109}, {  186, -153,  166, -219}, {   37,  139,  193,  171},
-{  337,  124,  158,  -61}, {  141,  226,  -13,  190}, {  231,   34,  354,  109},
-{  316,  201,  244,  164}, {  330,  -85,  390,  -84}, {  254,  327,  257,  335},
-{  491,  147,  476,  105}, {   54,   77,  437,  370}, {  421,  314,  449,  342},
-{  329,  126,  673,  292}, {  571,  388,  243,  193}, {  653,  320,  621,  280},
-{  194,  380,  517,  581}, {   45,  323,  111,  422}, {  489,  395,  734,  534},
-{  622,  546,  486,  502}, {  318,  572,  189,  550}, {  385,  422, -157,  153},
-{ -125,  382, -197,  386}, { -263,  334,  228,  697}, { -188,    1,   51,  297},
-{ -507,  213, -376,  397}, {  -24,  255, -547,   89}, { -502,  -94,  387,  179},
-{ -620,   68, -684,  112}, { -642, -350, -260,  172}, { -438, -324,  264,  648},
-{ -964,   -4,-1121,    7}, { -134,  134,-1133, -306}, {  143,   96, -420, -497},
-{-1221, -350,-1527, -685}, { -161,   72,  873,  691}, {  732,  283,  921,  353},
-{  334,  475, 1095,  821}, {  864,  524,  843,  497}, {  714,  711,  788,  750},
-{ 1076,  714, 1204,  753}
-};
-
-static const float lsf_3_mean[LP_FILTER_ORDER] = {
-     377.441,  554.688,  922.363, 1339.84, 1702.15,
-    2046.390, 2452.880, 2741.460, 3116.70, 3348.14
-};
-
-static const float lsf_5_mean[LP_FILTER_ORDER] = {
-     337.891,  507.080,  834.961, 1247.07, 1646.00,
-    1982.910, 2407.960, 2708.010, 3104.00, 3344.97
-};
-
-/** Prediction factor table for modes other than 12.2kbit/s */
-static const float pred_fac[LP_FILTER_ORDER] = {
-    0.291626, 0.328644, 0.383636, 0.405640, 0.438873,
-    0.355560, 0.323120, 0.298065, 0.262238, 0.197876,
-};
-
-// fixed tables
-
-/**
- * number of pulses per mode
- */
-static const uint8_t pulses_nb_per_mode[] = {2, 2, 2, 3, 4, 4, 8, 10};
-
-/** track start positions for algebraic code book routines */
-static const uint8_t track_position[16] = {
-    0, 2, 0, 3, 0, 2, 0, 3, 1, 3, 2, 4, 1, 4, 1, 4
-};
-
-/** 3-bit Gray code to binary lookup table */
-static const uint8_t gray_decode[8] = { 0, 5, 15, 10, 25, 30, 20, 35 };
-
-
-// gain tables
-
-/** scalar quantized pitch gain table for 7.95 and 12.2 kbps modes */
-static const uint16_t qua_gain_pit[16] = {
-     0,  3277,  6556,  8192,  9830, 11469, 12288, 13107,
- 13926, 14746, 15565, 16384, 17203, 18022, 18842, 19661
-};
-
-/** scalar quantized fixed gain table for 7.95 and 12.2 kbps modes */
-static const uint16_t qua_gain_code[32] = {
-   159,   206,   268,   349,   419,   482,   554,   637,
-   733,   842,   969,  1114,  1281,  1473,  1694,  1948,
-  2241,  2577,  2963,  3408,  3919,  4507,  5183,  5960,
-  6855,  7883,  9065, 10425, 12510, 16263, 21142, 27485
-};
-
-/** desired mean innovation energy, indexed by active mode */
-static const float energy_mean[8] = {
-    33.0, 33.0, 33.0, 28.75, 30.0, 36.0, 33.0, 36.0
-};
-
-/** 4-tap moving average prediction coefficients in reverse order */
-static const float energy_pred_fac[4] = { 0.19, 0.34, 0.58, 0.68 };
-
-/** gain table for 4.75 kbps mode
- *
- * first index has even/odd indexes for subframes 0,2/1,3
- * second index is {pitch_gain, fixed_gain_factor} */
-static const uint16_t gains_MODE_4k75[512][2] = {
-{  812,  128}, {  542,  140}, { 2873, 1135}, { 2266, 3402}, { 2067,  563},
-{12677,  647}, { 4132, 1798}, { 5601, 5285}, { 7689,  374}, { 3735,  441},
-{10912, 2638}, {11807, 2494}, {20490,  797}, { 5218,  675}, { 6724, 8354},
-{ 5282, 1696}, { 1488,  428}, { 5882,  452}, { 5332, 4072}, { 3583, 1268},
-{ 2469,  901}, {15894, 1005}, {14982, 3271}, {10331, 4858}, { 3635, 2021},
-{ 2596,  835}, {12360, 4892}, {12206, 1704}, {13432, 1604}, { 9118, 2341},
-{ 3968, 1538}, { 5479, 9936}, { 3795,  417}, { 1359,  414}, { 3640, 1569},
-{ 7995, 3541}, {11405,  645}, { 8552,  635}, { 4056, 1377}, {16608, 6124},
-{11420,  700}, { 2007,  607}, {12415, 1578}, {11119, 4654}, {13680, 1708},
-{11990, 1229}, { 7996, 7297}, {13231, 5715}, { 2428, 1159}, { 2073, 1941},
-{ 6218, 6121}, { 3546, 1804}, { 8925, 1802}, { 8679, 1580}, {13935, 3576},
-{13313, 6237}, { 6142, 1130}, { 5994, 1734}, {14141, 4662}, {11271, 3321},
-{12226, 1551}, {13931, 3015}, { 5081,10464}, { 9444, 6706}, { 1689,  683},
-{ 1436, 1306}, { 7212, 3933}, { 4082, 2713}, { 7793,  704}, {15070,  802},
-{ 6299, 5212}, { 4337, 5357}, { 6676,  541}, { 6062,  626}, {13651, 3700},
-{11498, 2408}, {16156,  716}, {12177,  751}, { 8065,11489}, { 6314, 2256},
-{ 4466,  496}, { 7293,  523}, {10213, 3833}, { 8394, 3037}, { 8403,  966},
-{14228, 1880}, { 8703, 5409}, {16395, 4863}, { 7420, 1979}, { 6089, 1230},
-{ 9371, 4398}, {14558, 3363}, {13559, 2873}, {13163, 1465}, { 5534, 1678},
-{13138,14771}, { 7338,  600}, { 1318,  548}, { 4252, 3539}, {10044, 2364},
-{10587,  622}, {13088,  669}, {14126, 3526}, { 5039, 9784}, {15338,  619},
-{ 3115,  590}, {16442, 3013}, {15542, 4168}, {15537, 1611}, {15405, 1228},
-{16023, 9299}, { 7534, 4976}, { 1990, 1213}, {11447, 1157}, {12512, 5519},
-{ 9475, 2644}, { 7716, 2034}, {13280, 2239}, {16011, 5093}, { 8066, 6761},
-{10083, 1413}, { 5002, 2347}, {12523, 5975}, {15126, 2899}, {18264, 2289},
-{15827, 2527}, {16265,10254}, {14651,11319}, { 1797,  337}, { 3115,  397},
-{ 3510, 2928}, { 4592, 2670}, { 7519,  628}, {11415,  656}, { 5946, 2435},
-{ 6544, 7367}, { 8238,  829}, { 4000,  863}, {10032, 2492}, {16057, 3551},
-{18204, 1054}, { 6103, 1454}, { 5884, 7900}, {18752, 3468}, { 1864,  544},
-{ 9198,  683}, {11623, 4160}, { 4594, 1644}, { 3158, 1157}, {15953, 2560},
-{12349, 3733}, {17420, 5260}, { 6106, 2004}, { 2917, 1742}, {16467, 5257},
-{16787, 1680}, {17205, 1759}, { 4773, 3231}, { 7386, 6035}, {14342,10012},
-{ 4035,  442}, { 4194,  458}, { 9214, 2242}, { 7427, 4217}, {12860,  801},
-{11186,  825}, {12648, 2084}, {12956, 6554}, { 9505,  996}, { 6629,  985},
-{10537, 2502}, {15289, 5006}, {12602, 2055}, {15484, 1653}, {16194, 6921},
-{14231, 5790}, { 2626,  828}, { 5615, 1686}, {13663, 5778}, { 3668, 1554},
-{11313, 2633}, { 9770, 1459}, {14003, 4733}, {15897, 6291}, { 6278, 1870},
-{ 7910, 2285}, {16978, 4571}, {16576, 3849}, {15248, 2311}, {16023, 3244},
-{14459,17808}, {11847, 2763}, { 1981, 1407}, { 1400,  876}, { 4335, 3547},
-{ 4391, 4210}, { 5405,  680}, {17461,  781}, { 6501, 5118}, { 8091, 7677},
-{ 7355,  794}, { 8333, 1182}, {15041, 3160}, {14928, 3039}, {20421,  880},
-{14545,  852}, {12337,14708}, { 6904, 1920}, { 4225,  933}, { 8218, 1087},
-{10659, 4084}, {10082, 4533}, { 2735,  840}, {20657, 1081}, {16711, 5966},
-{15873, 4578}, {10871, 2574}, { 3773, 1166}, {14519, 4044}, {20699, 2627},
-{15219, 2734}, {15274, 2186}, { 6257, 3226}, {13125,19480}, { 7196,  930},
-{ 2462, 1618}, { 4515, 3092}, {13852, 4277}, {10460,  833}, {17339,  810},
-{16891, 2289}, {15546, 8217}, {13603, 1684}, { 3197, 1834}, {15948, 2820},
-{15812, 5327}, {17006, 2438}, {16788, 1326}, {15671, 8156}, {11726, 8556},
-{ 3762, 2053}, { 9563, 1317}, {13561, 6790}, {12227, 1936}, { 8180, 3550},
-{13287, 1778}, {16299, 6599}, {16291, 7758}, { 8521, 2551}, { 7225, 2645},
-{18269, 7489}, {16885, 2248}, {17882, 2884}, {17265, 3328}, { 9417,20162},
-{11042, 8320}, { 1286,  620}, { 1431,  583}, { 5993, 2289}, { 3978, 3626},
-{ 5144,  752}, {13409,  830}, { 5553, 2860}, {11764, 5908}, {10737,  560},
-{ 5446,  564}, {13321, 3008}, {11946, 3683}, {19887,  798}, { 9825,  728},
-{13663, 8748}, { 7391, 3053}, { 2515,  778}, { 6050,  833}, { 6469, 5074},
-{ 8305, 2463}, { 6141, 1865}, {15308, 1262}, {14408, 4547}, {13663, 4515},
-{ 3137, 2983}, { 2479, 1259}, {15088, 4647}, {15382, 2607}, {14492, 2392},
-{12462, 2537}, { 7539, 2949}, {12909,12060}, { 5468,  684}, { 3141,  722},
-{ 5081, 1274}, {12732, 4200}, {15302,  681}, { 7819,  592}, { 6534, 2021},
-{16478, 8737}, {13364,  882}, { 5397,  899}, {14656, 2178}, {14741, 4227},
-{14270, 1298}, {13929, 2029}, {15477, 7482}, {15815, 4572}, { 2521, 2013},
-{ 5062, 1804}, { 5159, 6582}, { 7130, 3597}, {10920, 1611}, {11729, 1708},
-{16903, 3455}, {16268, 6640}, { 9306, 1007}, { 9369, 2106}, {19182, 5037},
-{12441, 4269}, {15919, 1332}, {15357, 3512}, {11898,14141}, {16101, 6854},
-{ 2010,  737}, { 3779,  861}, {11454, 2880}, { 3564, 3540}, { 9057, 1241},
-{12391,  896}, { 8546, 4629}, {11561, 5776}, { 8129,  589}, { 8218,  588},
-{18728, 3755}, {12973, 3149}, {15729,  758}, {16634,  754}, {15222,11138},
-{15871, 2208}, { 4673,  610}, {10218,  678}, {15257, 4146}, { 5729, 3327},
-{ 8377, 1670}, {19862, 2321}, {15450, 5511}, {14054, 5481}, { 5728, 2888},
-{ 7580, 1346}, {14384, 5325}, {16236, 3950}, {15118, 3744}, {15306, 1435},
-{14597, 4070}, {12301,15696}, { 7617, 1699}, { 2170,  884}, { 4459, 4567},
-{18094, 3306}, {12742,  815}, {14926,  907}, {15016, 4281}, {15518, 8368},
-{17994, 1087}, { 2358,  865}, {16281, 3787}, {15679, 4596}, {16356, 1534},
-{16584, 2210}, {16833, 9697}, {15929, 4513}, { 3277, 1085}, { 9643, 2187},
-{11973, 6068}, { 9199, 4462}, { 8955, 1629}, {10289, 3062}, {16481, 5155},
-{15466, 7066}, {13678, 2543}, { 5273, 2277}, {16746, 6213}, {16655, 3408},
-{20304, 3363}, {18688, 1985}, {14172,12867}, {15154,15703}, { 4473, 1020},
-{ 1681,  886}, { 4311, 4301}, { 8952, 3657}, { 5893, 1147}, {11647, 1452},
-{15886, 2227}, { 4582, 6644}, { 6929, 1205}, { 6220,  799}, {12415, 3409},
-{15968, 3877}, {19859, 2109}, { 9689, 2141}, {14742, 8830}, {14480, 2599},
-{ 1817, 1238}, { 7771,  813}, {19079, 4410}, { 5554, 2064}, { 3687, 2844},
-{17435, 2256}, {16697, 4486}, {16199, 5388}, { 8028, 2763}, { 3405, 2119},
-{17426, 5477}, {13698, 2786}, {19879, 2720}, { 9098, 3880}, {18172, 4833},
-{17336,12207}, { 5116,  996}, { 4935,  988}, { 9888, 3081}, { 6014, 5371},
-{15881, 1667}, { 8405, 1183}, {15087, 2366}, {19777, 7002}, {11963, 1562},
-{ 7279, 1128}, {16859, 1532}, {15762, 5381}, {14708, 2065}, {20105, 2155},
-{17158, 8245}, {17911, 6318}, { 5467, 1504}, { 4100, 2574}, {17421, 6810},
-{ 5673, 2888}, {16636, 3382}, { 8975, 1831}, {20159, 4737}, {19550, 7294},
-{ 6658, 2781}, {11472, 3321}, {19397, 5054}, {18878, 4722}, {16439, 2373},
-{20430, 4386}, {11353,26526}, {11593, 3068}, { 2866, 1566}, { 5108, 1070},
-{ 9614, 4915}, { 4939, 3536}, { 7541,  878}, {20717,  851}, { 6938, 4395},
-{16799, 7733}, {10137, 1019}, { 9845,  964}, {15494, 3955}, {15459, 3430},
-{18863,  982}, {20120,  963}, {16876,12887}, {14334, 4200}, { 6599, 1220},
-{ 9222,  814}, {16942, 5134}, { 5661, 4898}, { 5488, 1798}, {20258, 3962},
-{17005, 6178}, {17929, 5929}, { 9365, 3420}, { 7474, 1971}, {19537, 5177},
-{19003, 3006}, {16454, 3788}, {16070, 2367}, { 8664, 2743}, { 9445,26358},
-{10856, 1287}, { 3555, 1009}, { 5606, 3622}, {19453, 5512}, {12453,  797},
-{20634,  911}, {15427, 3066}, {17037,10275}, {18883, 2633}, { 3913, 1268},
-{19519, 3371}, {18052, 5230}, {19291, 1678}, {19508, 3172}, {18072,10754},
-{16625, 6845}, { 3134, 2298}, {10869, 2437}, {15580, 6913}, {12597, 3381},
-{11116, 3297}, {16762, 2424}, {18853, 6715}, {17171, 9887}, {12743, 2605},
-{ 8937, 3140}, {19033, 7764}, {18347, 3880}, {20475, 3682}, {19602, 3380},
-{13044,19373}, {10526,23124}
-};
-
-/** gain table for 6.70, 7.40 and 10.2 kbps modes
- *
- * second index is {pitch_gain, fixed_gain_factor} */
-static const uint16_t gains_high[128][2] = {
-{  577,  662}, {  806, 1836}, { 3109, 1052}, { 4181, 1387}, { 2373, 1425},
-{ 3248, 1985}, { 1827, 2320}, {  941, 3314}, { 2351, 2977}, { 3616, 2420},
-{ 3451, 3096}, { 2955, 4301}, { 1848, 4500}, { 3884, 5416}, { 1187, 7210},
-{ 3083, 9000}, { 7384,  883}, { 5962, 1506}, { 5155, 2134}, { 7944, 2009},
-{ 6507, 2250}, { 7670, 2752}, { 5952, 3016}, { 4898, 3764}, { 6989, 3588},
-{ 8174, 3978}, { 6064, 4404}, { 7709, 5087}, { 5523, 6021}, { 7769, 7126},
-{ 6060, 7938}, { 5594,11487}, {10581, 1356}, { 9049, 1597}, { 9794, 2035},
-{ 8946, 2415}, {10296, 2584}, { 9407, 2734}, { 8700, 3218}, { 9757, 3395},
-{10177, 3892}, { 9170, 4528}, {10152, 5004}, { 9114, 5735}, {10500, 6266},
-{10110, 7631}, { 8844, 8727}, { 8956,12496}, {12924,  976}, {11435, 1755},
-{12138, 2328}, {11388, 2368}, {10700, 3064}, {12332, 2861}, {11722, 3327},
-{11270, 3700}, {10861, 4413}, {12082, 4533}, {11283, 5205}, {11960, 6305},
-{11167, 7534}, {12128, 8329}, {10969,10777}, {10300,17376}, {13899, 1681},
-{12580, 2045}, {13265, 2439}, {14033, 2989}, {13452, 3098}, {12396, 3658},
-{13510, 3780}, {12880, 4272}, {13533, 4861}, {12667, 5457}, {13854, 6106},
-{13031, 6483}, {13557, 7721}, {12957, 9311}, {13714,11551}, {12591,15206},
-{15113, 1540}, {15072, 2333}, {14527, 2511}, {14692, 3199}, {15382, 3560},
-{14133, 3960}, {15102, 4236}, {14332, 4824}, {14846, 5451}, {15306, 6083},
-{14329, 6888}, {15060, 7689}, {14406, 9426}, {15387, 9741}, {14824,14271},
-{13600,24939}, {16396, 1969}, {16817, 2832}, {15713, 2843}, {16104, 3336},
-{16384, 3963}, {16940, 4579}, {15711, 4599}, {16222, 5448}, {16832, 6382},
-{15745, 7141}, {16326, 7469}, {16611, 8624}, {17028,10418}, {15905,11817},
-{16878,14690}, {16515,20870}, {18142, 2083}, {19401, 3178}, {17508, 3426},
-{20054, 4027}, {18069, 4249}, {18952, 5066}, {17711, 5402}, {19835, 6192},
-{17950, 7014}, {21318, 7877}, {17910, 9289}, {19144, 9290}, {20517,11381},
-{18075,14485}, {19999,17882}, {18842,32764}
-};
-
-/** gain table for 5.15 and 5.90 kbps modes
- *
- * second index is {pitch_gain, fixed_gain_factor} */
-static const uint16_t gains_low[64][2] = {
-{10813,28753}, {20480, 2785}, {18841, 6594}, { 6225, 7413}, {17203,10444},
-{21626, 1269}, {21135, 4423}, {11304, 1556}, {19005,12820}, {17367, 2498},
-{17858, 4833}, { 9994, 2498}, {17530, 7864}, {14254, 1884}, {15892, 3153},
-{ 6717, 1802}, {18186,20193}, {18022, 3031}, {16711, 5857}, { 8847, 4014},
-{15892, 8970}, {18022, 1392}, {16711, 4096}, { 8192,  655}, {15237,13926},
-{14254, 3112}, {14090, 4669}, { 5406, 2703}, {13434, 6553}, {12451,  901},
-{12451, 2662}, { 3768,  655}, {14745,23511}, {19169, 2457}, {20152, 5079},
-{ 6881, 4096}, {20480, 8560}, {19660,  737}, {19005, 4259}, { 7864, 2088},
-{11468,12288}, {15892, 1474}, {15728, 4628}, { 9175, 1433}, {16056, 7004},
-{14827,  737}, {15073, 2252}, { 5079, 1228}, {13271,17326}, {16547, 2334},
-{15073, 5816}, { 3932, 3686}, {14254, 8601}, {16875,  778}, {15073, 3809},
-{ 6062,  614}, { 9338, 9256}, {13271, 1761}, {13271, 3522}, { 2457, 1966},
-{11468, 5529}, {10485,  737}, {11632, 3194}, { 1474,  778}
-};
-
-
-// pre-processing tables
-
-/** impulse response filter tables converted to float from Q15 int32_t
- * used for anti-sparseness processing */
-static const float ir_filter_strong_MODE_7k95[AMR_SUBFRAME_SIZE] = {
- 0.817169,  0.024445,  0.076447, -0.020844, -0.042175,  0.017761,  0.018433,
--0.038879,  0.107147, -0.179871,  0.138367, -0.015228, -0.059204,  0.091888,
--0.154358,  0.171326, -0.060730, -0.032379, -0.044525,  0.135559, -0.021362,
--0.162811,  0.140656,  0.013794, -0.017975, -0.102295,  0.090118,  0.038666,
--0.036987, -0.079041,  0.052826,  0.112000, -0.136566, -0.029755,  0.134003,
--0.077423,  0.028961, -0.041595, -0.029877,  0.174988,
-};
-
-static const float ir_filter_strong[AMR_SUBFRAME_SIZE] = {
- 0.448303,  0.351501,  0.038696, -0.084259, -0.173065,  0.229309, -0.001068,
--0.085663, -0.092773,  0.147186,  0.090088, -0.257080,  0.115509,  0.044403,
- 0.066498, -0.263580,  0.245697, -0.064178, -0.044373,  0.023712,  0.033813,
--0.072784,  0.068787, -0.011078, -0.020569, -0.064178,  0.184509, -0.173370,
- 0.032715,  0.095306, -0.154358,  0.162109, -0.071075, -0.113770,  0.211304,
--0.118683,  0.020599, -0.054169,  0.000885,  0.309601,
-};
-
-static const float ir_filter_medium[AMR_SUBFRAME_SIZE] = {
- 0.923889,  0.116913, -0.123169,  0.090698, -0.031982, -0.030579,  0.075592,
--0.092865,  0.085907, -0.068085,  0.053497, -0.049164,  0.052307, -0.054169,
- 0.047089, -0.030762,  0.013092, -0.005157,  0.014404, -0.038574,  0.066406,
--0.082581,  0.076996, -0.049469,  0.010498,  0.025208, -0.046661,  0.052612,
--0.050568,  0.051910, -0.062958,  0.080688, -0.093384,  0.088409, -0.060364,
- 0.016998,  0.023804, -0.041779,  0.025696,  0.019989,
-};
-
-static const float *ir_filters_lookup[2]           = {
-    ir_filter_strong,           ir_filter_medium
-};
-static const float *ir_filters_lookup_MODE_7k95[2] = {
-    ir_filter_strong_MODE_7k95, ir_filter_medium
-};
-
-// High-pass coefficients
-
-static const float highpass_zeros[2] = { -2.0, 1.0 };
-static const float highpass_poles[2] = { -1.933105469, 0.935913085 };
-static const float highpass_gain     = 0.939819335;
-
-#endif /* AVCODEC_AMRNBDATA_H */
diff --git a/deps/libav/libavcodec/amrnbdec.c b/deps/libav/libavcodec/amrnbdec.c
deleted file mode 100644
index 7692cf0..0000000
--- a/deps/libav/libavcodec/amrnbdec.c
+++ /dev/null
@@ -1,1076 +0,0 @@
-/*
- * AMR narrowband decoder
- * Copyright (c) 2006-2007 Robert Swain
- * Copyright (c) 2009 Colin McQuillan
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-/**
- * @file
- * AMR narrowband decoder
- *
- * This decoder uses floats for simplicity and so is not bit-exact. One
- * difference is that differences in phase can accumulate. The test sequences
- * in 3GPP TS 26.074 can still be useful.
- *
- * - Comparing this file's output to the output of the ref decoder gives a
- *   PSNR of 30 to 80. Plotting the output samples shows a difference in
- *   phase in some areas.
- *
- * - Comparing both decoders against their input, this decoder gives a similar
- *   PSNR. If the test sequence homing frames are removed (this decoder does
- *   not detect them), the PSNR is at least as good as the reference on 140
- *   out of 169 tests.
- */
-
-
-#include <string.h>
-#include <math.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "libavutil/common.h"
-#include "celp_filters.h"
-#include "acelp_filters.h"
-#include "acelp_vectors.h"
-#include "acelp_pitch_delay.h"
-#include "lsp.h"
-#include "amr.h"
-#include "internal.h"
-
-#include "amrnbdata.h"
-
-#define AMR_BLOCK_SIZE              160   ///< samples per frame
-#define AMR_SAMPLE_BOUND        32768.0   ///< threshold for synthesis overflow
-
-/**
- * Scale from constructed speech to [-1,1]
- *
- * AMR is designed to produce 16-bit PCM samples (3GPP TS 26.090 4.2) but
- * upscales by two (section 6.2.2).
- *
- * Fundamentally, this scale is determined by energy_mean through
- * the fixed vector contribution to the excitation vector.
- */
-#define AMR_SAMPLE_SCALE  (2.0 / 32768.0)
-
-/** Prediction factor for 12.2kbit/s mode */
-#define PRED_FAC_MODE_12k2             0.65
-
-#define LSF_R_FAC          (8000.0 / 32768.0) ///< LSF residual tables to Hertz
-#define MIN_LSF_SPACING    (50.0488 / 8000.0) ///< Ensures stability of LPC filter
-#define PITCH_LAG_MIN_MODE_12k2          18   ///< Lower bound on decoded lag search in 12.2kbit/s mode
-
-/** Initial energy in dB. Also used for bad frames (unimplemented). */
-#define MIN_ENERGY -14.0
-
-/** Maximum sharpening factor
- *
- * The specification says 0.8, which should be 13107, but the reference C code
- * uses 13017 instead. (Amusingly the same applies to SHARP_MAX in bitexact G.729.)
- */
-#define SHARP_MAX 0.79449462890625
-
-/** Number of impulse response coefficients used for tilt factor */
-#define AMR_TILT_RESPONSE   22
-/** Tilt factor = 1st reflection coefficient * gamma_t */
-#define AMR_TILT_GAMMA_T   0.8
-/** Adaptive gain control factor used in post-filter */
-#define AMR_AGC_ALPHA      0.9
-
-typedef struct AMRContext {
-    AMRNBFrame                        frame; ///< decoded AMR parameters (lsf coefficients, codebook indexes, etc)
-    uint8_t             bad_frame_indicator; ///< bad frame ? 1 : 0
-    enum Mode                cur_frame_mode;
-
-    int16_t     prev_lsf_r[LP_FILTER_ORDER]; ///< residual LSF vector from previous subframe
-    double          lsp[4][LP_FILTER_ORDER]; ///< lsp vectors from current frame
-    double   prev_lsp_sub4[LP_FILTER_ORDER]; ///< lsp vector for the 4th subframe of the previous frame
-
-    float         lsf_q[4][LP_FILTER_ORDER]; ///< Interpolated LSF vector for fixed gain smoothing
-    float          lsf_avg[LP_FILTER_ORDER]; ///< vector of averaged lsf vector
-
-    float           lpc[4][LP_FILTER_ORDER]; ///< lpc coefficient vectors for 4 subframes
-
-    uint8_t                   pitch_lag_int; ///< integer part of pitch lag from current subframe
-
-    float excitation_buf[PITCH_DELAY_MAX + LP_FILTER_ORDER + 1 + AMR_SUBFRAME_SIZE]; ///< current excitation and all necessary excitation history
-    float                       *excitation; ///< pointer to the current excitation vector in excitation_buf
-
-    float   pitch_vector[AMR_SUBFRAME_SIZE]; ///< adaptive code book (pitch) vector
-    float   fixed_vector[AMR_SUBFRAME_SIZE]; ///< algebraic codebook (fixed) vector (must be kept zero between frames)
-
-    float               prediction_error[4]; ///< quantified prediction errors {20log10(^gamma_gc)} for previous four subframes
-    float                     pitch_gain[5]; ///< quantified pitch gains for the current and previous four subframes
-    float                     fixed_gain[5]; ///< quantified fixed gains for the current and previous four subframes
-
-    float                              beta; ///< previous pitch_gain, bounded by [0.0,SHARP_MAX]
-    uint8_t                      diff_count; ///< the number of subframes for which diff has been above 0.65
-    uint8_t                      hang_count; ///< the number of subframes since a hangover period started
-
-    float            prev_sparse_fixed_gain; ///< previous fixed gain; used by anti-sparseness processing to determine "onset"
-    uint8_t               prev_ir_filter_nr; ///< previous impulse response filter "impNr": 0 - strong, 1 - medium, 2 - none
-    uint8_t                 ir_filter_onset; ///< flag for impulse response filter strength
-
-    float                postfilter_mem[10]; ///< previous intermediate values in the formant filter
-    float                          tilt_mem; ///< previous input to tilt compensation filter
-    float                    postfilter_agc; ///< previous factor used for adaptive gain control
-    float                  high_pass_mem[2]; ///< previous intermediate values in the high-pass filter
-
-    float samples_in[LP_FILTER_ORDER + AMR_SUBFRAME_SIZE]; ///< floating point samples
-
-} AMRContext;
-
-/** Double version of ff_weighted_vector_sumf() */
-static void weighted_vector_sumd(double *out, const double *in_a,
-                                 const double *in_b, double weight_coeff_a,
-                                 double weight_coeff_b, int length)
-{
-    int i;
-
-    for (i = 0; i < length; i++)
-        out[i] = weight_coeff_a * in_a[i]
-               + weight_coeff_b * in_b[i];
-}
-
-static av_cold int amrnb_decode_init(AVCodecContext *avctx)
-{
-    AMRContext *p = avctx->priv_data;
-    int i;
-
-    if (avctx->channels > 1) {
-        avpriv_report_missing_feature(avctx, "multi-channel AMR");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_rate    = 8000;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_FLT;
-
-    // p->excitation always points to the same position in p->excitation_buf
-    p->excitation = &p->excitation_buf[PITCH_DELAY_MAX + LP_FILTER_ORDER + 1];
-
-    for (i = 0; i < LP_FILTER_ORDER; i++) {
-        p->prev_lsp_sub4[i] =    lsp_sub4_init[i] * 1000 / (float)(1 << 15);
-        p->lsf_avg[i] = p->lsf_q[3][i] = lsp_avg_init[i] / (float)(1 << 15);
-    }
-
-    for (i = 0; i < 4; i++)
-        p->prediction_error[i] = MIN_ENERGY;
-
-    return 0;
-}
-
-
-/**
- * Unpack an RFC4867 speech frame into the AMR frame mode and parameters.
- *
- * The order of speech bits is specified by 3GPP TS 26.101.
- *
- * @param p the context
- * @param buf               pointer to the input buffer
- * @param buf_size          size of the input buffer
- *
- * @return the frame mode
- */
-static enum Mode unpack_bitstream(AMRContext *p, const uint8_t *buf,
-                                  int buf_size)
-{
-    enum Mode mode;
-
-    // Decode the first octet.
-    mode = buf[0] >> 3 & 0x0F;                      // frame type
-    p->bad_frame_indicator = (buf[0] & 0x4) != 0x4; // quality bit
-
-    if (mode >= N_MODES || buf_size < frame_sizes_nb[mode] + 1) {
-        return NO_DATA;
-    }
-
-    if (mode < MODE_DTX)
-        ff_amr_bit_reorder((uint16_t *) &p->frame, sizeof(AMRNBFrame), buf + 1,
-                           amr_unpacking_bitmaps_per_mode[mode]);
-
-    return mode;
-}
-
-
-/// @name AMR pitch LPC coefficient decoding functions
-/// @{
-
-/**
- * Interpolate the LSF vector (used for fixed gain smoothing).
- * The interpolation is done over all four subframes even in MODE_12k2.
- *
- * @param[in,out] lsf_q     LSFs in [0,1] for each subframe
- * @param[in]     lsf_new   New LSFs in [0,1] for subframe 4
- */
-static void interpolate_lsf(float lsf_q[4][LP_FILTER_ORDER], float *lsf_new)
-{
-    int i;
-
-    for (i = 0; i < 4; i++)
-        ff_weighted_vector_sumf(lsf_q[i], lsf_q[3], lsf_new,
-                                0.25 * (3 - i), 0.25 * (i + 1),
-                                LP_FILTER_ORDER);
-}
-
-/**
- * Decode a set of 5 split-matrix quantized lsf indexes into an lsp vector.
- *
- * @param p the context
- * @param lsp output LSP vector
- * @param lsf_no_r LSF vector without the residual vector added
- * @param lsf_quantizer pointers to LSF dictionary tables
- * @param quantizer_offset offset in tables
- * @param sign for the 3 dictionary table
- * @param update store data for computing the next frame's LSFs
- */
-static void lsf2lsp_for_mode12k2(AMRContext *p, double lsp[LP_FILTER_ORDER],
-                                 const float lsf_no_r[LP_FILTER_ORDER],
-                                 const int16_t *lsf_quantizer[5],
-                                 const int quantizer_offset,
-                                 const int sign, const int update)
-{
-    int16_t lsf_r[LP_FILTER_ORDER]; // residual LSF vector
-    float lsf_q[LP_FILTER_ORDER]; // quantified LSF vector
-    int i;
-
-    for (i = 0; i < LP_FILTER_ORDER >> 1; i++)
-        memcpy(&lsf_r[i << 1], &lsf_quantizer[i][quantizer_offset],
-               2 * sizeof(*lsf_r));
-
-    if (sign) {
-        lsf_r[4] *= -1;
-        lsf_r[5] *= -1;
-    }
-
-    if (update)
-        memcpy(p->prev_lsf_r, lsf_r, LP_FILTER_ORDER * sizeof(*lsf_r));
-
-    for (i = 0; i < LP_FILTER_ORDER; i++)
-        lsf_q[i] = lsf_r[i] * (LSF_R_FAC / 8000.0) + lsf_no_r[i] * (1.0 / 8000.0);
-
-    ff_set_min_dist_lsf(lsf_q, MIN_LSF_SPACING, LP_FILTER_ORDER);
-
-    if (update)
-        interpolate_lsf(p->lsf_q, lsf_q);
-
-    ff_acelp_lsf2lspd(lsp, lsf_q, LP_FILTER_ORDER);
-}
-
-/**
- * Decode a set of 5 split-matrix quantized lsf indexes into 2 lsp vectors.
- *
- * @param p                 pointer to the AMRContext
- */
-static void lsf2lsp_5(AMRContext *p)
-{
-    const uint16_t *lsf_param = p->frame.lsf;
-    float lsf_no_r[LP_FILTER_ORDER]; // LSFs without the residual vector
-    const int16_t *lsf_quantizer[5];
-    int i;
-
-    lsf_quantizer[0] = lsf_5_1[lsf_param[0]];
-    lsf_quantizer[1] = lsf_5_2[lsf_param[1]];
-    lsf_quantizer[2] = lsf_5_3[lsf_param[2] >> 1];
-    lsf_quantizer[3] = lsf_5_4[lsf_param[3]];
-    lsf_quantizer[4] = lsf_5_5[lsf_param[4]];
-
-    for (i = 0; i < LP_FILTER_ORDER; i++)
-        lsf_no_r[i] = p->prev_lsf_r[i] * LSF_R_FAC * PRED_FAC_MODE_12k2 + lsf_5_mean[i];
-
-    lsf2lsp_for_mode12k2(p, p->lsp[1], lsf_no_r, lsf_quantizer, 0, lsf_param[2] & 1, 0);
-    lsf2lsp_for_mode12k2(p, p->lsp[3], lsf_no_r, lsf_quantizer, 2, lsf_param[2] & 1, 1);
-
-    // interpolate LSP vectors at subframes 1 and 3
-    weighted_vector_sumd(p->lsp[0], p->prev_lsp_sub4, p->lsp[1], 0.5, 0.5, LP_FILTER_ORDER);
-    weighted_vector_sumd(p->lsp[2], p->lsp[1]       , p->lsp[3], 0.5, 0.5, LP_FILTER_ORDER);
-}
-
-/**
- * Decode a set of 3 split-matrix quantized lsf indexes into an lsp vector.
- *
- * @param p                 pointer to the AMRContext
- */
-static void lsf2lsp_3(AMRContext *p)
-{
-    const uint16_t *lsf_param = p->frame.lsf;
-    int16_t lsf_r[LP_FILTER_ORDER]; // residual LSF vector
-    float lsf_q[LP_FILTER_ORDER]; // quantified LSF vector
-    const int16_t *lsf_quantizer;
-    int i, j;
-
-    lsf_quantizer = (p->cur_frame_mode == MODE_7k95 ? lsf_3_1_MODE_7k95 : lsf_3_1)[lsf_param[0]];
-    memcpy(lsf_r, lsf_quantizer, 3 * sizeof(*lsf_r));
-
-    lsf_quantizer = lsf_3_2[lsf_param[1] << (p->cur_frame_mode <= MODE_5k15)];
-    memcpy(lsf_r + 3, lsf_quantizer, 3 * sizeof(*lsf_r));
-
-    lsf_quantizer = (p->cur_frame_mode <= MODE_5k15 ? lsf_3_3_MODE_5k15 : lsf_3_3)[lsf_param[2]];
-    memcpy(lsf_r + 6, lsf_quantizer, 4 * sizeof(*lsf_r));
-
-    // calculate mean-removed LSF vector and add mean
-    for (i = 0; i < LP_FILTER_ORDER; i++)
-        lsf_q[i] = (lsf_r[i] + p->prev_lsf_r[i] * pred_fac[i]) * (LSF_R_FAC / 8000.0) + lsf_3_mean[i] * (1.0 / 8000.0);
-
-    ff_set_min_dist_lsf(lsf_q, MIN_LSF_SPACING, LP_FILTER_ORDER);
-
-    // store data for computing the next frame's LSFs
-    interpolate_lsf(p->lsf_q, lsf_q);
-    memcpy(p->prev_lsf_r, lsf_r, LP_FILTER_ORDER * sizeof(*lsf_r));
-
-    ff_acelp_lsf2lspd(p->lsp[3], lsf_q, LP_FILTER_ORDER);
-
-    // interpolate LSP vectors at subframes 1, 2 and 3
-    for (i = 1; i <= 3; i++)
-        for(j = 0; j < LP_FILTER_ORDER; j++)
-            p->lsp[i-1][j] = p->prev_lsp_sub4[j] +
-                (p->lsp[3][j] - p->prev_lsp_sub4[j]) * 0.25 * i;
-}
-
-/// @}
-
-
-/// @name AMR pitch vector decoding functions
-/// @{
-
-/**
- * Like ff_decode_pitch_lag(), but with 1/6 resolution
- */
-static void decode_pitch_lag_1_6(int *lag_int, int *lag_frac, int pitch_index,
-                                 const int prev_lag_int, const int subframe)
-{
-    if (subframe == 0 || subframe == 2) {
-        if (pitch_index < 463) {
-            *lag_int  = (pitch_index + 107) * 10923 >> 16;
-            *lag_frac = pitch_index - *lag_int * 6 + 105;
-        } else {
-            *lag_int  = pitch_index - 368;
-            *lag_frac = 0;
-        }
-    } else {
-        *lag_int  = ((pitch_index + 5) * 10923 >> 16) - 1;
-        *lag_frac = pitch_index - *lag_int * 6 - 3;
-        *lag_int += av_clip(prev_lag_int - 5, PITCH_LAG_MIN_MODE_12k2,
-                            PITCH_DELAY_MAX - 9);
-    }
-}
-
-static void decode_pitch_vector(AMRContext *p,
-                                const AMRNBSubframe *amr_subframe,
-                                const int subframe)
-{
-    int pitch_lag_int, pitch_lag_frac;
-    enum Mode mode = p->cur_frame_mode;
-
-    if (p->cur_frame_mode == MODE_12k2) {
-        decode_pitch_lag_1_6(&pitch_lag_int, &pitch_lag_frac,
-                             amr_subframe->p_lag, p->pitch_lag_int,
-                             subframe);
-    } else
-        ff_decode_pitch_lag(&pitch_lag_int, &pitch_lag_frac,
-                            amr_subframe->p_lag,
-                            p->pitch_lag_int, subframe,
-                            mode != MODE_4k75 && mode != MODE_5k15,
-                            mode <= MODE_6k7 ? 4 : (mode == MODE_7k95 ? 5 : 6));
-
-    p->pitch_lag_int = pitch_lag_int; // store previous lag in a uint8_t
-
-    pitch_lag_frac <<= (p->cur_frame_mode != MODE_12k2);
-
-    pitch_lag_int += pitch_lag_frac > 0;
-
-    /* Calculate the pitch vector by interpolating the past excitation at the
-       pitch lag using a b60 hamming windowed sinc function.   */
-    ff_acelp_interpolatef(p->excitation, p->excitation + 1 - pitch_lag_int,
-                          ff_b60_sinc, 6,
-                          pitch_lag_frac + 6 - 6*(pitch_lag_frac > 0),
-                          10, AMR_SUBFRAME_SIZE);
-
-    memcpy(p->pitch_vector, p->excitation, AMR_SUBFRAME_SIZE * sizeof(float));
-}
-
-/// @}
-
-
-/// @name AMR algebraic code book (fixed) vector decoding functions
-/// @{
-
-/**
- * Decode a 10-bit algebraic codebook index from a 10.2 kbit/s frame.
- */
-static void decode_10bit_pulse(int code, int pulse_position[8],
-                               int i1, int i2, int i3)
-{
-    // coded using 7+3 bits with the 3 LSBs being, individually, the LSB of 1 of
-    // the 3 pulses and the upper 7 bits being coded in base 5
-    const uint8_t *positions = base_five_table[code >> 3];
-    pulse_position[i1] = (positions[2] << 1) + ( code       & 1);
-    pulse_position[i2] = (positions[1] << 1) + ((code >> 1) & 1);
-    pulse_position[i3] = (positions[0] << 1) + ((code >> 2) & 1);
-}
-
-/**
- * Decode the algebraic codebook index to pulse positions and signs and
- * construct the algebraic codebook vector for MODE_10k2.
- *
- * @param fixed_index          positions of the eight pulses
- * @param fixed_sparse         pointer to the algebraic codebook vector
- */
-static void decode_8_pulses_31bits(const int16_t *fixed_index,
-                                   AMRFixed *fixed_sparse)
-{
-    int pulse_position[8];
-    int i, temp;
-
-    decode_10bit_pulse(fixed_index[4], pulse_position, 0, 4, 1);
-    decode_10bit_pulse(fixed_index[5], pulse_position, 2, 6, 5);
-
-    // coded using 5+2 bits with the 2 LSBs being, individually, the LSB of 1 of
-    // the 2 pulses and the upper 5 bits being coded in base 5
-    temp = ((fixed_index[6] >> 2) * 25 + 12) >> 5;
-    pulse_position[3] = temp % 5;
-    pulse_position[7] = temp / 5;
-    if (pulse_position[7] & 1)
-        pulse_position[3] = 4 - pulse_position[3];
-    pulse_position[3] = (pulse_position[3] << 1) + ( fixed_index[6]       & 1);
-    pulse_position[7] = (pulse_position[7] << 1) + ((fixed_index[6] >> 1) & 1);
-
-    fixed_sparse->n = 8;
-    for (i = 0; i < 4; i++) {
-        const int pos1   = (pulse_position[i]     << 2) + i;
-        const int pos2   = (pulse_position[i + 4] << 2) + i;
-        const float sign = fixed_index[i] ? -1.0 : 1.0;
-        fixed_sparse->x[i    ] = pos1;
-        fixed_sparse->x[i + 4] = pos2;
-        fixed_sparse->y[i    ] = sign;
-        fixed_sparse->y[i + 4] = pos2 < pos1 ? -sign : sign;
-    }
-}
-
-/**
- * Decode the algebraic codebook index to pulse positions and signs,
- * then construct the algebraic codebook vector.
- *
- *                              nb of pulses | bits encoding pulses
- * For MODE_4k75 or MODE_5k15,             2 | 1-3, 4-6, 7
- *                  MODE_5k9,              2 | 1,   2-4, 5-6, 7-9
- *                  MODE_6k7,              3 | 1-3, 4,   5-7, 8,  9-11
- *      MODE_7k4 or MODE_7k95,             4 | 1-3, 4-6, 7-9, 10, 11-13
- *
- * @param fixed_sparse pointer to the algebraic codebook vector
- * @param pulses       algebraic codebook indexes
- * @param mode         mode of the current frame
- * @param subframe     current subframe number
- */
-static void decode_fixed_sparse(AMRFixed *fixed_sparse, const uint16_t *pulses,
-                                const enum Mode mode, const int subframe)
-{
-    assert(MODE_4k75 <= mode && mode <= MODE_12k2);
-
-    if (mode == MODE_12k2) {
-        ff_decode_10_pulses_35bits(pulses, fixed_sparse, gray_decode, 5, 3);
-    } else if (mode == MODE_10k2) {
-        decode_8_pulses_31bits(pulses, fixed_sparse);
-    } else {
-        int *pulse_position = fixed_sparse->x;
-        int i, pulse_subset;
-        const int fixed_index = pulses[0];
-
-        if (mode <= MODE_5k15) {
-            pulse_subset      = ((fixed_index >> 3) & 8)     + (subframe << 1);
-            pulse_position[0] = ( fixed_index       & 7) * 5 + track_position[pulse_subset];
-            pulse_position[1] = ((fixed_index >> 3) & 7) * 5 + track_position[pulse_subset + 1];
-            fixed_sparse->n = 2;
-        } else if (mode == MODE_5k9) {
-            pulse_subset      = ((fixed_index & 1) << 1) + 1;
-            pulse_position[0] = ((fixed_index >> 1) & 7) * 5 + pulse_subset;
-            pulse_subset      = (fixed_index  >> 4) & 3;
-            pulse_position[1] = ((fixed_index >> 6) & 7) * 5 + pulse_subset + (pulse_subset == 3 ? 1 : 0);
-            fixed_sparse->n = pulse_position[0] == pulse_position[1] ? 1 : 2;
-        } else if (mode == MODE_6k7) {
-            pulse_position[0] = (fixed_index        & 7) * 5;
-            pulse_subset      = (fixed_index  >> 2) & 2;
-            pulse_position[1] = ((fixed_index >> 4) & 7) * 5 + pulse_subset + 1;
-            pulse_subset      = (fixed_index  >> 6) & 2;
-            pulse_position[2] = ((fixed_index >> 8) & 7) * 5 + pulse_subset + 2;
-            fixed_sparse->n = 3;
-        } else { // mode <= MODE_7k95
-            pulse_position[0] = gray_decode[ fixed_index        & 7];
-            pulse_position[1] = gray_decode[(fixed_index >> 3)  & 7] + 1;
-            pulse_position[2] = gray_decode[(fixed_index >> 6)  & 7] + 2;
-            pulse_subset      = (fixed_index >> 9) & 1;
-            pulse_position[3] = gray_decode[(fixed_index >> 10) & 7] + pulse_subset + 3;
-            fixed_sparse->n = 4;
-        }
-        for (i = 0; i < fixed_sparse->n; i++)
-            fixed_sparse->y[i] = (pulses[1] >> i) & 1 ? 1.0 : -1.0;
-    }
-}
-
-/**
- * Apply pitch lag to obtain the sharpened fixed vector (section 6.1.2)
- *
- * @param p the context
- * @param subframe unpacked amr subframe
- * @param mode mode of the current frame
- * @param fixed_sparse sparse respresentation of the fixed vector
- */
-static void pitch_sharpening(AMRContext *p, int subframe, enum Mode mode,
-                             AMRFixed *fixed_sparse)
-{
-    // The spec suggests the current pitch gain is always used, but in other
-    // modes the pitch and codebook gains are joinly quantized (sec 5.8.2)
-    // so the codebook gain cannot depend on the quantized pitch gain.
-    if (mode == MODE_12k2)
-        p->beta = FFMIN(p->pitch_gain[4], 1.0);
-
-    fixed_sparse->pitch_lag  = p->pitch_lag_int;
-    fixed_sparse->pitch_fac  = p->beta;
-
-    // Save pitch sharpening factor for the next subframe
-    // MODE_4k75 only updates on the 2nd and 4th subframes - this follows from
-    // the fact that the gains for two subframes are jointly quantized.
-    if (mode != MODE_4k75 || subframe & 1)
-        p->beta = av_clipf(p->pitch_gain[4], 0.0, SHARP_MAX);
-}
-/// @}
-
-
-/// @name AMR gain decoding functions
-/// @{
-
-/**
- * fixed gain smoothing
- * Note that where the spec specifies the "spectrum in the q domain"
- * in section 6.1.4, in fact frequencies should be used.
- *
- * @param p the context
- * @param lsf LSFs for the current subframe, in the range [0,1]
- * @param lsf_avg averaged LSFs
- * @param mode mode of the current frame
- *
- * @return fixed gain smoothed
- */
-static float fixed_gain_smooth(AMRContext *p , const float *lsf,
-                               const float *lsf_avg, const enum Mode mode)
-{
-    float diff = 0.0;
-    int i;
-
-    for (i = 0; i < LP_FILTER_ORDER; i++)
-        diff += fabs(lsf_avg[i] - lsf[i]) / lsf_avg[i];
-
-    // If diff is large for ten subframes, disable smoothing for a 40-subframe
-    // hangover period.
-    p->diff_count++;
-    if (diff <= 0.65)
-        p->diff_count = 0;
-
-    if (p->diff_count > 10) {
-        p->hang_count = 0;
-        p->diff_count--; // don't let diff_count overflow
-    }
-
-    if (p->hang_count < 40) {
-        p->hang_count++;
-    } else if (mode < MODE_7k4 || mode == MODE_10k2) {
-        const float smoothing_factor = av_clipf(4.0 * diff - 1.6, 0.0, 1.0);
-        const float fixed_gain_mean = (p->fixed_gain[0] + p->fixed_gain[1] +
-                                       p->fixed_gain[2] + p->fixed_gain[3] +
-                                       p->fixed_gain[4]) * 0.2;
-        return smoothing_factor * p->fixed_gain[4] +
-               (1.0 - smoothing_factor) * fixed_gain_mean;
-    }
-    return p->fixed_gain[4];
-}
-
-/**
- * Decode pitch gain and fixed gain factor (part of section 6.1.3).
- *
- * @param p the context
- * @param amr_subframe unpacked amr subframe
- * @param mode mode of the current frame
- * @param subframe current subframe number
- * @param fixed_gain_factor decoded gain correction factor
- */
-static void decode_gains(AMRContext *p, const AMRNBSubframe *amr_subframe,
-                         const enum Mode mode, const int subframe,
-                         float *fixed_gain_factor)
-{
-    if (mode == MODE_12k2 || mode == MODE_7k95) {
-        p->pitch_gain[4]   = qua_gain_pit [amr_subframe->p_gain    ]
-            * (1.0 / 16384.0);
-        *fixed_gain_factor = qua_gain_code[amr_subframe->fixed_gain]
-            * (1.0 /  2048.0);
-    } else {
-        const uint16_t *gains;
-
-        if (mode >= MODE_6k7) {
-            gains = gains_high[amr_subframe->p_gain];
-        } else if (mode >= MODE_5k15) {
-            gains = gains_low [amr_subframe->p_gain];
-        } else {
-            // gain index is only coded in subframes 0,2 for MODE_4k75
-            gains = gains_MODE_4k75[(p->frame.subframe[subframe & 2].p_gain << 1) + (subframe & 1)];
-        }
-
-        p->pitch_gain[4]   = gains[0] * (1.0 / 16384.0);
-        *fixed_gain_factor = gains[1] * (1.0 /  4096.0);
-    }
-}
-
-/// @}
-
-
-/// @name AMR preprocessing functions
-/// @{
-
-/**
- * Circularly convolve a sparse fixed vector with a phase dispersion impulse
- * response filter (D.6.2 of G.729 and 6.1.5 of AMR).
- *
- * @param out vector with filter applied
- * @param in source vector
- * @param filter phase filter coefficients
- *
- *  out[n] = sum(i,0,len-1){ in[i] * filter[(len + n - i)%len] }
- */
-static void apply_ir_filter(float *out, const AMRFixed *in,
-                            const float *filter)
-{
-    float filter1[AMR_SUBFRAME_SIZE],     ///< filters at pitch lag*1 and *2
-          filter2[AMR_SUBFRAME_SIZE];
-    int   lag = in->pitch_lag;
-    float fac = in->pitch_fac;
-    int i;
-
-    if (lag < AMR_SUBFRAME_SIZE) {
-        ff_celp_circ_addf(filter1, filter, filter, lag, fac,
-                          AMR_SUBFRAME_SIZE);
-
-        if (lag < AMR_SUBFRAME_SIZE >> 1)
-            ff_celp_circ_addf(filter2, filter, filter1, lag, fac,
-                              AMR_SUBFRAME_SIZE);
-    }
-
-    memset(out, 0, sizeof(float) * AMR_SUBFRAME_SIZE);
-    for (i = 0; i < in->n; i++) {
-        int   x = in->x[i];
-        float y = in->y[i];
-        const float *filterp;
-
-        if (x >= AMR_SUBFRAME_SIZE - lag) {
-            filterp = filter;
-        } else if (x >= AMR_SUBFRAME_SIZE - (lag << 1)) {
-            filterp = filter1;
-        } else
-            filterp = filter2;
-
-        ff_celp_circ_addf(out, out, filterp, x, y, AMR_SUBFRAME_SIZE);
-    }
-}
-
-/**
- * Reduce fixed vector sparseness by smoothing with one of three IR filters.
- * Also know as "adaptive phase dispersion".
- *
- * This implements 3GPP TS 26.090 section 6.1(5).
- *
- * @param p the context
- * @param fixed_sparse algebraic codebook vector
- * @param fixed_vector unfiltered fixed vector
- * @param fixed_gain smoothed gain
- * @param out space for modified vector if necessary
- */
-static const float *anti_sparseness(AMRContext *p, AMRFixed *fixed_sparse,
-                                    const float *fixed_vector,
-                                    float fixed_gain, float *out)
-{
-    int ir_filter_nr;
-
-    if (p->pitch_gain[4] < 0.6) {
-        ir_filter_nr = 0;      // strong filtering
-    } else if (p->pitch_gain[4] < 0.9) {
-        ir_filter_nr = 1;      // medium filtering
-    } else
-        ir_filter_nr = 2;      // no filtering
-
-    // detect 'onset'
-    if (fixed_gain > 2.0 * p->prev_sparse_fixed_gain) {
-        p->ir_filter_onset = 2;
-    } else if (p->ir_filter_onset)
-        p->ir_filter_onset--;
-
-    if (!p->ir_filter_onset) {
-        int i, count = 0;
-
-        for (i = 0; i < 5; i++)
-            if (p->pitch_gain[i] < 0.6)
-                count++;
-        if (count > 2)
-            ir_filter_nr = 0;
-
-        if (ir_filter_nr > p->prev_ir_filter_nr + 1)
-            ir_filter_nr--;
-    } else if (ir_filter_nr < 2)
-        ir_filter_nr++;
-
-    // Disable filtering for very low level of fixed_gain.
-    // Note this step is not specified in the technical description but is in
-    // the reference source in the function Ph_disp.
-    if (fixed_gain < 5.0)
-        ir_filter_nr = 2;
-
-    if (p->cur_frame_mode != MODE_7k4 && p->cur_frame_mode < MODE_10k2
-         && ir_filter_nr < 2) {
-        apply_ir_filter(out, fixed_sparse,
-                        (p->cur_frame_mode == MODE_7k95 ?
-                             ir_filters_lookup_MODE_7k95 :
-                             ir_filters_lookup)[ir_filter_nr]);
-        fixed_vector = out;
-    }
-
-    // update ir filter strength history
-    p->prev_ir_filter_nr       = ir_filter_nr;
-    p->prev_sparse_fixed_gain  = fixed_gain;
-
-    return fixed_vector;
-}
-
-/// @}
-
-
-/// @name AMR synthesis functions
-/// @{
-
-/**
- * Conduct 10th order linear predictive coding synthesis.
- *
- * @param p             pointer to the AMRContext
- * @param lpc           pointer to the LPC coefficients
- * @param fixed_gain    fixed codebook gain for synthesis
- * @param fixed_vector  algebraic codebook vector
- * @param samples       pointer to the output speech samples
- * @param overflow      16-bit overflow flag
- */
-static int synthesis(AMRContext *p, float *lpc,
-                     float fixed_gain, const float *fixed_vector,
-                     float *samples, uint8_t overflow)
-{
-    int i;
-    float excitation[AMR_SUBFRAME_SIZE];
-
-    // if an overflow has been detected, the pitch vector is scaled down by a
-    // factor of 4
-    if (overflow)
-        for (i = 0; i < AMR_SUBFRAME_SIZE; i++)
-            p->pitch_vector[i] *= 0.25;
-
-    ff_weighted_vector_sumf(excitation, p->pitch_vector, fixed_vector,
-                            p->pitch_gain[4], fixed_gain, AMR_SUBFRAME_SIZE);
-
-    // emphasize pitch vector contribution
-    if (p->pitch_gain[4] > 0.5 && !overflow) {
-        float energy = avpriv_scalarproduct_float_c(excitation, excitation,
-                                                    AMR_SUBFRAME_SIZE);
-        float pitch_factor =
-            p->pitch_gain[4] *
-            (p->cur_frame_mode == MODE_12k2 ?
-                0.25 * FFMIN(p->pitch_gain[4], 1.0) :
-                0.5  * FFMIN(p->pitch_gain[4], SHARP_MAX));
-
-        for (i = 0; i < AMR_SUBFRAME_SIZE; i++)
-            excitation[i] += pitch_factor * p->pitch_vector[i];
-
-        ff_scale_vector_to_given_sum_of_squares(excitation, excitation, energy,
-                                                AMR_SUBFRAME_SIZE);
-    }
-
-    ff_celp_lp_synthesis_filterf(samples, lpc, excitation, AMR_SUBFRAME_SIZE,
-                                 LP_FILTER_ORDER);
-
-    // detect overflow
-    for (i = 0; i < AMR_SUBFRAME_SIZE; i++)
-        if (fabsf(samples[i]) > AMR_SAMPLE_BOUND) {
-            return 1;
-        }
-
-    return 0;
-}
-
-/// @}
-
-
-/// @name AMR update functions
-/// @{
-
-/**
- * Update buffers and history at the end of decoding a subframe.
- *
- * @param p             pointer to the AMRContext
- */
-static void update_state(AMRContext *p)
-{
-    memcpy(p->prev_lsp_sub4, p->lsp[3], LP_FILTER_ORDER * sizeof(p->lsp[3][0]));
-
-    memmove(&p->excitation_buf[0], &p->excitation_buf[AMR_SUBFRAME_SIZE],
-            (PITCH_DELAY_MAX + LP_FILTER_ORDER + 1) * sizeof(float));
-
-    memmove(&p->pitch_gain[0], &p->pitch_gain[1], 4 * sizeof(float));
-    memmove(&p->fixed_gain[0], &p->fixed_gain[1], 4 * sizeof(float));
-
-    memmove(&p->samples_in[0], &p->samples_in[AMR_SUBFRAME_SIZE],
-            LP_FILTER_ORDER * sizeof(float));
-}
-
-/// @}
-
-
-/// @name AMR Postprocessing functions
-/// @{
-
-/**
- * Get the tilt factor of a formant filter from its transfer function
- *
- * @param lpc_n LP_FILTER_ORDER coefficients of the numerator
- * @param lpc_d LP_FILTER_ORDER coefficients of the denominator
- */
-static float tilt_factor(float *lpc_n, float *lpc_d)
-{
-    float rh0, rh1; // autocorrelation at lag 0 and 1
-
-    // LP_FILTER_ORDER prior zeros are needed for ff_celp_lp_synthesis_filterf
-    float impulse_buffer[LP_FILTER_ORDER + AMR_TILT_RESPONSE] = { 0 };
-    float *hf = impulse_buffer + LP_FILTER_ORDER; // start of impulse response
-
-    hf[0] = 1.0;
-    memcpy(hf + 1, lpc_n, sizeof(float) * LP_FILTER_ORDER);
-    ff_celp_lp_synthesis_filterf(hf, lpc_d, hf, AMR_TILT_RESPONSE,
-                                 LP_FILTER_ORDER);
-
-    rh0 = avpriv_scalarproduct_float_c(hf, hf,     AMR_TILT_RESPONSE);
-    rh1 = avpriv_scalarproduct_float_c(hf, hf + 1, AMR_TILT_RESPONSE - 1);
-
-    // The spec only specifies this check for 12.2 and 10.2 kbit/s
-    // modes. But in the ref source the tilt is always non-negative.
-    return rh1 >= 0.0 ? rh1 / rh0 * AMR_TILT_GAMMA_T : 0.0;
-}
-
-/**
- * Perform adaptive post-filtering to enhance the quality of the speech.
- * See section 6.2.1.
- *
- * @param p             pointer to the AMRContext
- * @param lpc           interpolated LP coefficients for this subframe
- * @param buf_out       output of the filter
- */
-static void postfilter(AMRContext *p, float *lpc, float *buf_out)
-{
-    int i;
-    float *samples          = p->samples_in + LP_FILTER_ORDER; // Start of input
-
-    float speech_gain       = avpriv_scalarproduct_float_c(samples, samples,
-                                                           AMR_SUBFRAME_SIZE);
-
-    float pole_out[AMR_SUBFRAME_SIZE + LP_FILTER_ORDER];  // Output of pole filter
-    const float *gamma_n, *gamma_d;                       // Formant filter factor table
-    float lpc_n[LP_FILTER_ORDER], lpc_d[LP_FILTER_ORDER]; // Transfer function coefficients
-
-    if (p->cur_frame_mode == MODE_12k2 || p->cur_frame_mode == MODE_10k2) {
-        gamma_n = ff_pow_0_7;
-        gamma_d = ff_pow_0_75;
-    } else {
-        gamma_n = ff_pow_0_55;
-        gamma_d = ff_pow_0_7;
-    }
-
-    for (i = 0; i < LP_FILTER_ORDER; i++) {
-         lpc_n[i] = lpc[i] * gamma_n[i];
-         lpc_d[i] = lpc[i] * gamma_d[i];
-    }
-
-    memcpy(pole_out, p->postfilter_mem, sizeof(float) * LP_FILTER_ORDER);
-    ff_celp_lp_synthesis_filterf(pole_out + LP_FILTER_ORDER, lpc_d, samples,
-                                 AMR_SUBFRAME_SIZE, LP_FILTER_ORDER);
-    memcpy(p->postfilter_mem, pole_out + AMR_SUBFRAME_SIZE,
-           sizeof(float) * LP_FILTER_ORDER);
-
-    ff_celp_lp_zero_synthesis_filterf(buf_out, lpc_n,
-                                      pole_out + LP_FILTER_ORDER,
-                                      AMR_SUBFRAME_SIZE, LP_FILTER_ORDER);
-
-    ff_tilt_compensation(&p->tilt_mem, tilt_factor(lpc_n, lpc_d), buf_out,
-                         AMR_SUBFRAME_SIZE);
-
-    ff_adaptive_gain_control(buf_out, buf_out, speech_gain, AMR_SUBFRAME_SIZE,
-                             AMR_AGC_ALPHA, &p->postfilter_agc);
-}
-
-/// @}
-
-static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
-                              int *got_frame_ptr, AVPacket *avpkt)
-{
-
-    AMRContext *p = avctx->priv_data;        // pointer to private data
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    float *buf_out;                          // pointer to the output data buffer
-    int i, subframe, ret;
-    float fixed_gain_factor;
-    AMRFixed fixed_sparse = {0};             // fixed vector up to anti-sparseness processing
-    float spare_vector[AMR_SUBFRAME_SIZE];   // extra stack space to hold result from anti-sparseness processing
-    float synth_fixed_gain;                  // the fixed gain that synthesis should use
-    const float *synth_fixed_vector;         // pointer to the fixed vector that synthesis should use
-
-    /* get output buffer */
-    frame->nb_samples = AMR_BLOCK_SIZE;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    buf_out = (float *)frame->data[0];
-
-    p->cur_frame_mode = unpack_bitstream(p, buf, buf_size);
-    if (p->cur_frame_mode == NO_DATA) {
-        av_log(avctx, AV_LOG_ERROR, "Corrupt bitstream\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (p->cur_frame_mode == MODE_DTX) {
-        avpriv_request_sample(avctx, "dtx mode");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (p->cur_frame_mode == MODE_12k2) {
-        lsf2lsp_5(p);
-    } else
-        lsf2lsp_3(p);
-
-    for (i = 0; i < 4; i++)
-        ff_acelp_lspd2lpc(p->lsp[i], p->lpc[i], 5);
-
-    for (subframe = 0; subframe < 4; subframe++) {
-        const AMRNBSubframe *amr_subframe = &p->frame.subframe[subframe];
-
-        decode_pitch_vector(p, amr_subframe, subframe);
-
-        decode_fixed_sparse(&fixed_sparse, amr_subframe->pulses,
-                            p->cur_frame_mode, subframe);
-
-        // The fixed gain (section 6.1.3) depends on the fixed vector
-        // (section 6.1.2), but the fixed vector calculation uses
-        // pitch sharpening based on the on the pitch gain (section 6.1.3).
-        // So the correct order is: pitch gain, pitch sharpening, fixed gain.
-        decode_gains(p, amr_subframe, p->cur_frame_mode, subframe,
-                     &fixed_gain_factor);
-
-        pitch_sharpening(p, subframe, p->cur_frame_mode, &fixed_sparse);
-
-        if (fixed_sparse.pitch_lag == 0) {
-            av_log(avctx, AV_LOG_ERROR, "The file is corrupted, pitch_lag = 0 is not allowed\n");
-            return AVERROR_INVALIDDATA;
-        }
-        ff_set_fixed_vector(p->fixed_vector, &fixed_sparse, 1.0,
-                            AMR_SUBFRAME_SIZE);
-
-        p->fixed_gain[4] =
-            ff_amr_set_fixed_gain(fixed_gain_factor,
-                                  avpriv_scalarproduct_float_c(p->fixed_vector,
-                                                               p->fixed_vector,
-                                                               AMR_SUBFRAME_SIZE) /
-                                  AMR_SUBFRAME_SIZE,
-                       p->prediction_error,
-                       energy_mean[p->cur_frame_mode], energy_pred_fac);
-
-        // The excitation feedback is calculated without any processing such
-        // as fixed gain smoothing. This isn't mentioned in the specification.
-        for (i = 0; i < AMR_SUBFRAME_SIZE; i++)
-            p->excitation[i] *= p->pitch_gain[4];
-        ff_set_fixed_vector(p->excitation, &fixed_sparse, p->fixed_gain[4],
-                            AMR_SUBFRAME_SIZE);
-
-        // In the ref decoder, excitation is stored with no fractional bits.
-        // This step prevents buzz in silent periods. The ref encoder can
-        // emit long sequences with pitch factor greater than one. This
-        // creates unwanted feedback if the excitation vector is nonzero.
-        // (e.g. test sequence T19_795.COD in 3GPP TS 26.074)
-        for (i = 0; i < AMR_SUBFRAME_SIZE; i++)
-            p->excitation[i] = truncf(p->excitation[i]);
-
-        // Smooth fixed gain.
-        // The specification is ambiguous, but in the reference source, the
-        // smoothed value is NOT fed back into later fixed gain smoothing.
-        synth_fixed_gain = fixed_gain_smooth(p, p->lsf_q[subframe],
-                                             p->lsf_avg, p->cur_frame_mode);
-
-        synth_fixed_vector = anti_sparseness(p, &fixed_sparse, p->fixed_vector,
-                                             synth_fixed_gain, spare_vector);
-
-        if (synthesis(p, p->lpc[subframe], synth_fixed_gain,
-                      synth_fixed_vector, &p->samples_in[LP_FILTER_ORDER], 0))
-            // overflow detected -> rerun synthesis scaling pitch vector down
-            // by a factor of 4, skipping pitch vector contribution emphasis
-            // and adaptive gain control
-            synthesis(p, p->lpc[subframe], synth_fixed_gain,
-                      synth_fixed_vector, &p->samples_in[LP_FILTER_ORDER], 1);
-
-        postfilter(p, p->lpc[subframe], buf_out + subframe * AMR_SUBFRAME_SIZE);
-
-        // update buffers and history
-        ff_clear_fixed_vector(p->fixed_vector, &fixed_sparse, AMR_SUBFRAME_SIZE);
-        update_state(p);
-    }
-
-    ff_acelp_apply_order_2_transfer_function(buf_out, buf_out, highpass_zeros,
-                                             highpass_poles,
-                                             highpass_gain * AMR_SAMPLE_SCALE,
-                                             p->high_pass_mem, AMR_BLOCK_SIZE);
-
-    /* Update averaged lsf vector (used for fixed gain smoothing).
-     *
-     * Note that lsf_avg should not incorporate the current frame's LSFs
-     * for fixed_gain_smooth.
-     * The specification has an incorrect formula: the reference decoder uses
-     * qbar(n-1) rather than qbar(n) in section 6.1(4) equation 71. */
-    ff_weighted_vector_sumf(p->lsf_avg, p->lsf_avg, p->lsf_q[3],
-                            0.84, 0.16, LP_FILTER_ORDER);
-
-    *got_frame_ptr = 1;
-
-    /* return the amount of bytes consumed if everything was OK */
-    return frame_sizes_nb[p->cur_frame_mode] + 1; // +7 for rounding and +8 for TOC
-}
-
-
-AVCodec ff_amrnb_decoder = {
-    .name           = "amrnb",
-    .long_name      = NULL_IF_CONFIG_SMALL("AMR-NB (Adaptive Multi-Rate NarrowBand)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AMR_NB,
-    .priv_data_size = sizeof(AMRContext),
-    .init           = amrnb_decode_init,
-    .decode         = amrnb_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/amrwbdata.h b/deps/libav/libavcodec/amrwbdata.h
deleted file mode 100644
index 81f8b47..0000000
--- a/deps/libav/libavcodec/amrwbdata.h
+++ /dev/null
@@ -1,1890 +0,0 @@
-/*
- * AMR wideband data and definitions
- * Copyright (c) 2010 Marcelo Galvao Povoa
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AMR wideband data and definitions
- */
-
-#ifndef AVCODEC_AMRWBDATA_H
-#define AVCODEC_AMRWBDATA_H
-
-#include <stdint.h>
-#include <stddef.h>
-
-#define LP_ORDER            16                ///< linear predictive coding filter order
-#define LP_ORDER_16k        20                ///< lpc filter order at 16kHz
-#define HB_FIR_SIZE         30                ///< amount of past data needed by HB filters
-#define UPS_FIR_SIZE        12                ///< upsampling filter size
-#define UPS_MEM_SIZE        (2 * UPS_FIR_SIZE)
-
-#define MIN_ISF_SPACING     (128.0 / 32768.0) ///< minimum isf gap
-#define PRED_FACTOR         (1.0 / 3.0)
-#define MIN_ENERGY         -14.0              ///< initial innnovation energy (dB)
-#define ENERGY_MEAN         30.0              ///< mean innovation energy (dB) in all modes
-#define PREEMPH_FAC         0.68              ///< factor used to de-emphasize synthesis
-
-#define AMRWB_SFR_SIZE      64                ///< samples per subframe at 12.8 kHz
-#define AMRWB_SFR_SIZE_16k  80                ///< samples per subframe at 16 kHz
-#define AMRWB_P_DELAY_MAX   231               ///< maximum pitch delay value
-#define AMRWB_P_DELAY_MIN   34
-
-/* Relative mode ordering is sensitive */
-enum Mode {
-    MODE_6k60 = 0,                         ///< 6.60 kbit/s
-    MODE_8k85,                             ///< 8.85 kbit/s
-    MODE_12k65,                            ///< 12.65 kbit/s
-    MODE_14k25,                            ///< 14.25 kbit/s
-    MODE_15k85,                            ///< 15.85 kbit/s
-    MODE_18k25,                            ///< 18.25 kbit/s
-    MODE_19k85,                            ///< 19.85 kbit/s
-    MODE_23k05,                            ///< 23.05 kbit/s
-    MODE_23k85,                            ///< 23.85 kbit/s
-    MODE_SID,                              ///< comfort noise frame
-    /* 10-13:  Future use */
-    SP_LOST = 14,                          ///< speech lost
-    NO_DATA                                ///< no transmission
-};
-
-/* All decoded parameters in these structs must be 2 bytes long
- * because of the direct indexing at the frame parsing */
-typedef struct AMRWBSubFrame {
-    uint16_t adap;                         ///< adaptive codebook index
-    uint16_t ltp;                          ///< ltp-filtering flag
-    uint16_t vq_gain;                      ///< VQ adaptive and innovative gains
-    uint16_t hb_gain;                      ///< high-band energy index (mode 23k85 only)
-    uint16_t pul_ih[4];                    ///< MSBs part of codebook index (high modes only)
-    uint16_t pul_il[4];                    ///< LSBs part of codebook index
-} AMRWBSubFrame;
-
-typedef struct AMRWBFrame {
-    uint16_t vad;                          ///< voice activity detection flag
-    uint16_t isp_id[7];                    ///< index of ISP subvectors
-    AMRWBSubFrame subframe[4];             ///< data for subframes
-} AMRWBFrame;
-
-/** The index of a frame parameter */
-#define AMR_BIT(field)                  (offsetof(AMRWBFrame, field))
-/** The index of a subframe-specific parameter */
-#define AMR_OF(frame_num, variable)     AMR_BIT(subframe[frame_num].variable)
-
-//As defined in 3GPP TS 26.201 V9.0.0
-//Tables for bit parsing in Core Frame speech frames
-//The reordered bits are in order of decreasing importance and
-//may be contiguously separated in Class A, B and C bits.
-
-// Each field in AMRWBFrame is stored as:
-// * one byte for the number of bits in the field
-// * one byte for the field index
-// * then, one byte for each bit of the field (from most-significant to least)
-//         of the position of that bit in the AMR frame.
-static const uint16_t order_MODE_6k60[] = {
-     1,         AMR_BIT(vad),   7,
-     8,   AMR_BIT(isp_id[0]),  24,  33,  39,  12,   6,   5,   4,  13,
-     8,   AMR_BIT(isp_id[1]),  65,  79,  64,  78,  51,  61,  71,  70,
-     7,   AMR_BIT(isp_id[2]),  52,  55,  44,  54,  53,  43,  42,
-     7,   AMR_BIT(isp_id[3]),  60,  59,  58,  57,  56,  75,  74,
-     6,   AMR_BIT(isp_id[4]),  73,  72,  86,  87,  85,  84,
-     8,      AMR_OF(0, adap),  11,  10,   9,   8,  28,  27,  49,  69,
-     6, AMR_OF(0, pul_il[0]),  83,  91,  99, 107, 115, 123,
-     6, AMR_OF(0, pul_il[1]),  82, 103, 111, 119, 127, 135,
-     6,   AMR_OF(0, vq_gain),  38,  23,  34,  19,   3,  15,
-     5,      AMR_OF(1, adap),  32,  41,  63,  67,  77,
-     6, AMR_OF(1, pul_il[0]),  81,  90,  98, 106, 114, 122,
-     6, AMR_OF(1, pul_il[1]),  80, 102, 110, 118, 126, 134,
-     6,   AMR_OF(1, vq_gain),  26,  22,  36,  18,   2,  14,
-     5,      AMR_OF(2, adap),  45,  40,  50,  48,  68,
-     6, AMR_OF(2, pul_il[0]),  95,  89,  97, 105, 113, 121,
-     6, AMR_OF(2, pul_il[1]),  94, 101, 109, 117, 125, 133,
-     6,   AMR_OF(2, vq_gain),  37,  21,  35,  17,   1,  31,
-     5,      AMR_OF(3, adap),  47,  46,  62,  66,  76,
-     6, AMR_OF(3, pul_il[0]),  93,  88,  96, 104, 112, 120,
-     6, AMR_OF(3, pul_il[1]),  92, 100, 108, 116, 124, 132,
-     6,   AMR_OF(3, vq_gain),  25,  20,  29,  16,   0,  30,
-     0
-};
-
-static const uint16_t order_MODE_8k85[] = {
-     1,         AMR_BIT(vad),   7,
-     8,   AMR_BIT(isp_id[0]),  47,  32,   2,   6,   3,   5,   4,  60,
-     8,   AMR_BIT(isp_id[1]),  69,  50,  67,  41,  51,  49,  59,  53,
-     6,   AMR_BIT(isp_id[2]),  40,  55,  43,  54,  42,  62,
-     7,   AMR_BIT(isp_id[3]),  63,  48,  52,  61,  77,  78,  72,
-     7,   AMR_BIT(isp_id[4]),  85,  56,  86,  68,  74,  73,  81,
-     5,   AMR_BIT(isp_id[5]),  82,  95,  80,  94,  91,
-     5,   AMR_BIT(isp_id[6]),  90,  89,  88, 103,  87,
-     8,      AMR_OF(0, adap),   1,   0,  15,  35,  33,  58,  64,  84,
-     5, AMR_OF(0, pul_il[0]), 102, 118, 134, 150, 166,
-     5, AMR_OF(0, pul_il[1]), 101, 114, 130, 146, 162,
-     5, AMR_OF(0, pul_il[2]), 100, 126, 142, 158, 174,
-     5, AMR_OF(0, pul_il[3]),  99, 122, 138, 154, 170,
-     6,   AMR_OF(0, vq_gain),  11,  39,  19,  31,  27,  23,
-     5,      AMR_OF(1, adap),  46,  71,  66,  76,  93,
-     5, AMR_OF(1, pul_il[0]),  98, 117, 133, 149, 165,
-     5, AMR_OF(1, pul_il[1]),  97, 113, 129, 145, 161,
-     5, AMR_OF(1, pul_il[2]),  96, 125, 141, 157, 173,
-     5, AMR_OF(1, pul_il[3]), 111, 121, 137, 153, 169,
-     6,   AMR_OF(1, vq_gain),  10,  38,  18,  30,  26,  22,
-     8,      AMR_OF(2, adap),  14,  13,  12,  34,  45,  57,  79,  83,
-     5, AMR_OF(2, pul_il[0]), 110, 116, 132, 148, 164,
-     5, AMR_OF(2, pul_il[1]), 109, 112, 128, 144, 160,
-     5, AMR_OF(2, pul_il[2]), 108, 124, 140, 156, 172,
-     5, AMR_OF(2, pul_il[3]), 107, 120, 136, 152, 168,
-     6,   AMR_OF(2, vq_gain),   9,  37,  17,  29,  25,  21,
-     5,      AMR_OF(3, adap),  44,  70,  65,  75,  92,
-     5, AMR_OF(3, pul_il[0]), 106, 115, 131, 147, 163,
-     5, AMR_OF(3, pul_il[1]), 105, 127, 143, 159, 175,
-     5, AMR_OF(3, pul_il[2]), 104, 123, 139, 155, 171,
-     5, AMR_OF(3, pul_il[3]), 119, 135, 151, 167, 183,
-     6,   AMR_OF(3, vq_gain),   8,  36,  16,  28,  24,  20,
-     0
-};
-
-static const uint16_t order_MODE_12k65[] = {
-     1,         AMR_BIT(vad),   7,
-     8,   AMR_BIT(isp_id[0]),  55,  40,  14,   6,  15,   5,   0,  68,
-     8,   AMR_BIT(isp_id[1]),  77,  58,  75,  49,  59,  57,  67,  61,
-     6,   AMR_BIT(isp_id[2]),  48,  63,  51,  62,  50,  70,
-     7,   AMR_BIT(isp_id[3]),  71,  56,  60,  69,  85,  86,  80,
-     7,   AMR_BIT(isp_id[4]),  93,  64,  94,  76,  82,  81,  89,
-     5,   AMR_BIT(isp_id[5]),  90, 103,  88, 102,  99,
-     5,   AMR_BIT(isp_id[6]),  98,  97,  96, 111,  95,
-     9,      AMR_OF(0, adap),  13,  12,  11,  10,   9,  41,  66,  72,
-                               92,
-     1,       AMR_OF(0, ltp), 110,
-     9, AMR_OF(0, pul_il[0]), 106, 122, 154, 186, 218, 134, 166, 198,
-                              230,
-     9, AMR_OF(0, pul_il[1]), 105, 130, 162, 194, 226, 142, 174, 206,
-                              238,
-     9, AMR_OF(0, pul_il[2]), 104, 138, 170, 202, 234, 150, 182, 214,
-                              246,
-     9, AMR_OF(0, pul_il[3]), 119, 146, 178, 210, 242, 158, 190, 222,
-                              254,
-     7,   AMR_OF(0, vq_gain),   4,  19,  45,  27,  39,  33,  31,
-     6,      AMR_OF(1, adap),  35,  54,  79,  74,  84, 101,
-     1,       AMR_OF(1, ltp), 109,
-     9, AMR_OF(1, pul_il[0]), 118, 121, 153, 185, 217, 133, 165, 197,
-                              229,
-     9, AMR_OF(1, pul_il[1]), 117, 129, 161, 193, 225, 141, 173, 205,
-                              237,
-     9, AMR_OF(1, pul_il[2]), 116, 137, 169, 201, 233, 149, 181, 213,
-                              245,
-     9, AMR_OF(1, pul_il[3]), 115, 145, 177, 209, 241, 157, 189, 221,
-                              253,
-     7,   AMR_OF(1, vq_gain),   3,  18,  44,  26,  38,  32,  30,
-     9,      AMR_OF(2, adap),   8,  23,  22,  21,  20,  52,  65,  87,
-                               91,
-     1,       AMR_OF(2, ltp), 108,
-     9, AMR_OF(2, pul_il[0]), 114, 120, 152, 184, 216, 132, 164, 196,
-                              228,
-     9, AMR_OF(2, pul_il[1]), 113, 128, 160, 192, 224, 140, 172, 204,
-                              236,
-     9, AMR_OF(2, pul_il[2]), 112, 136, 168, 200, 232, 148, 180, 212,
-                              244,
-     9, AMR_OF(2, pul_il[3]), 127, 144, 176, 208, 240, 156, 188, 220,
-                              252,
-     7,   AMR_OF(2, vq_gain),   2,  17,  43,  25,  37,  47,  29,
-     6,      AMR_OF(3, adap),  34,  53,  78,  73,  83, 100,
-     1,       AMR_OF(3, ltp), 107,
-     9, AMR_OF(3, pul_il[0]), 126, 135, 167, 199, 231, 131, 163, 195,
-                              227,
-     9, AMR_OF(3, pul_il[1]), 125, 143, 175, 207, 239, 139, 171, 203,
-                              235,
-     9, AMR_OF(3, pul_il[2]), 124, 151, 183, 215, 247, 147, 179, 211,
-                              243,
-     9, AMR_OF(3, pul_il[3]), 123, 159, 191, 223, 255, 155, 187, 219,
-                              251,
-     7,   AMR_OF(3, vq_gain),   1,  16,  42,  24,  36,  46,  28,
-     0
-};
-
-static const uint16_t order_MODE_14k25[] = {
-     1,         AMR_BIT(vad),   7,
-     8,   AMR_BIT(isp_id[0]),  55,  40,  14,   6,  15,   5,   0,  68,
-     8,   AMR_BIT(isp_id[1]),  77,  58,  75,  49,  59,  57,  67,  61,
-     6,   AMR_BIT(isp_id[2]),  48,  63,  51,  62,  50,  70,
-     7,   AMR_BIT(isp_id[3]),  71,  56,  60,  69,  85,  86,  80,
-     7,   AMR_BIT(isp_id[4]),  93,  64,  94,  76,  82,  81,  89,
-     5,   AMR_BIT(isp_id[5]),  90, 103,  88, 102,  99,
-     5,   AMR_BIT(isp_id[6]),  98,  97,  96, 111,  95,
-     9,      AMR_OF(0, adap),  13,  12,  11,  10,   9,  41,  66,  72,
-                               92,
-     1,       AMR_OF(0, ltp), 110,
-    13, AMR_OF(0, pul_il[0]), 114, 186, 210, 234, 258, 106, 126, 162,
-                              170, 198, 222, 246, 270,
-    13, AMR_OF(0, pul_il[1]), 122, 194, 218, 242, 266, 118, 134, 174,
-                              182, 206, 230, 254, 278,
-     9, AMR_OF(0, pul_il[2]), 130, 138, 146, 154, 178, 202, 226, 250,
-                              274,
-     9, AMR_OF(0, pul_il[3]), 142, 150, 158, 166, 190, 214, 238, 262,
-                              286,
-     7,   AMR_OF(0, vq_gain),   4,  19,  45,  27,  39,  33,  31,
-     6,      AMR_OF(1, adap),  35,  54,  79,  74,  84, 101,
-     1,       AMR_OF(1, ltp), 109,
-    13, AMR_OF(1, pul_il[0]), 113, 185, 209, 233, 257, 105, 125, 161,
-                              169, 197, 221, 245, 269,
-    13, AMR_OF(1, pul_il[1]), 121, 193, 217, 241, 265, 117, 133, 173,
-                              181, 205, 229, 253, 277,
-     9, AMR_OF(1, pul_il[2]), 129, 137, 145, 153, 177, 201, 225, 249,
-                              273,
-     9, AMR_OF(1, pul_il[3]), 141, 149, 157, 165, 189, 213, 237, 261,
-                              285,
-     7,   AMR_OF(1, vq_gain),   3,  18,  44,  26,  38,  32,  30,
-     9,      AMR_OF(2, adap),   8,  23,  22,  21,  20,  52,  65,  87,
-                               91,
-     1,       AMR_OF(2, ltp), 108,
-    13, AMR_OF(2, pul_il[0]), 112, 184, 208, 232, 256, 104, 124, 160,
-                              168, 196, 220, 244, 268,
-    13, AMR_OF(2, pul_il[1]), 120, 192, 216, 240, 264, 116, 132, 172,
-                              180, 204, 228, 252, 276,
-     9, AMR_OF(2, pul_il[2]), 128, 136, 144, 152, 176, 200, 224, 248,
-                              272,
-     9, AMR_OF(2, pul_il[3]), 140, 148, 156, 164, 188, 212, 236, 260,
-                              284,
-     7,   AMR_OF(2, vq_gain),   2,  17,  43,  25,  37,  47,  29,
-     6,      AMR_OF(3, adap),  34,  53,  78,  73,  83, 100,
-     1,       AMR_OF(3, ltp), 107,
-    13, AMR_OF(3, pul_il[0]), 127, 199, 223, 247, 271, 119, 123, 175,
-                              183, 195, 219, 243, 267,
-    13, AMR_OF(3, pul_il[1]), 135, 207, 231, 255, 279, 115, 131, 171,
-                              179, 203, 227, 251, 275,
-     9, AMR_OF(3, pul_il[2]), 143, 151, 159, 167, 191, 215, 239, 263,
-                              287,
-     9, AMR_OF(3, pul_il[3]), 139, 147, 155, 163, 187, 211, 235, 259,
-                              283,
-     7,   AMR_OF(3, vq_gain),   1,  16,  42,  24,  36,  46,  28,
-     0
-};
-
-static const uint16_t order_MODE_15k85[] = {
-     1,         AMR_BIT(vad),   7,
-     8,   AMR_BIT(isp_id[0]),  55,  40,  14,   6,  15,   5,   0,  68,
-     8,   AMR_BIT(isp_id[1]),  77,  58,  75,  49,  59,  57,  67,  61,
-     6,   AMR_BIT(isp_id[2]),  48,  63,  51,  62,  50,  70,
-     7,   AMR_BIT(isp_id[3]),  71,  56,  60,  69,  85,  86,  80,
-     7,   AMR_BIT(isp_id[4]),  93,  64,  94,  76,  82,  81,  89,
-     5,   AMR_BIT(isp_id[5]),  90, 103,  88, 102,  99,
-     5,   AMR_BIT(isp_id[6]),  98,  97,  96, 111,  95,
-     9,      AMR_OF(0, adap),  13,  12,  11,  10,   9,  41,  66,  72,
-                               92,
-     1,       AMR_OF(0, ltp), 110,
-    13, AMR_OF(0, pul_il[0]), 122, 154, 170, 218, 266, 138, 106, 182,
-                              230, 278, 178, 226, 274,
-    13, AMR_OF(0, pul_il[1]), 134, 166, 190, 238, 286, 150, 118, 186,
-                              234, 282, 198, 246, 294,
-    13, AMR_OF(0, pul_il[2]), 130, 162, 194, 242, 290, 146, 114, 206,
-                              254, 302, 202, 250, 298,
-    13, AMR_OF(0, pul_il[3]), 142, 174, 214, 262, 310, 158, 126, 210,
-                              258, 306, 222, 270, 318,
-     7,   AMR_OF(0, vq_gain),   4,  19,  45,  27,  39,  33,  31,
-     6,      AMR_OF(1, adap),  35,  54,  79,  74,  84, 101,
-     1,       AMR_OF(1, ltp), 109,
-    13, AMR_OF(1, pul_il[0]), 121, 153, 169, 217, 265, 137, 105, 181,
-                              229, 277, 177, 225, 273,
-    13, AMR_OF(1, pul_il[1]), 133, 165, 189, 237, 285, 149, 117, 185,
-                              233, 281, 197, 245, 293,
-    13, AMR_OF(1, pul_il[2]), 129, 161, 193, 241, 289, 145, 113, 205,
-                              253, 301, 201, 249, 297,
-    13, AMR_OF(1, pul_il[3]), 141, 173, 213, 261, 309, 157, 125, 209,
-                              257, 305, 221, 269, 317,
-     7,   AMR_OF(1, vq_gain),   3,  18,  44,  26,  38,  32,  30,
-     9,      AMR_OF(2, adap),   8,  23,  22,  21,  20,  52,  65,  87,
-                               91,
-     1,       AMR_OF(2, ltp), 108,
-    13, AMR_OF(2, pul_il[0]), 120, 152, 168, 216, 264, 136, 104, 180,
-                              228, 276, 176, 224, 272,
-    13, AMR_OF(2, pul_il[1]), 132, 164, 188, 236, 284, 148, 116, 184,
-                              232, 280, 196, 244, 292,
-    13, AMR_OF(2, pul_il[2]), 128, 160, 192, 240, 288, 144, 112, 204,
-                              252, 300, 200, 248, 296,
-    13, AMR_OF(2, pul_il[3]), 140, 172, 212, 260, 308, 156, 124, 208,
-                              256, 304, 220, 268, 316,
-     7,   AMR_OF(2, vq_gain),   2,  17,  43,  25,  37,  47,  29,
-     6,      AMR_OF(3, adap),  34,  53,  78,  73,  83, 100,
-     1,       AMR_OF(3, ltp), 107,
-    13, AMR_OF(3, pul_il[0]), 135, 167, 183, 231, 279, 151, 119, 179,
-                              227, 275, 191, 239, 287,
-    13, AMR_OF(3, pul_il[1]), 131, 163, 187, 235, 283, 147, 115, 199,
-                              247, 295, 195, 243, 291,
-    13, AMR_OF(3, pul_il[2]), 143, 175, 207, 255, 303, 159, 127, 203,
-                              251, 299, 215, 263, 311,
-    13, AMR_OF(3, pul_il[3]), 139, 171, 211, 259, 307, 155, 123, 223,
-                              271, 319, 219, 267, 315,
-     7,   AMR_OF(3, vq_gain),   1,  16,  42,  24,  36,  46,  28,
-     0
-};
-
-static const uint16_t order_MODE_18k25[] = {
-     1,         AMR_BIT(vad),   7,
-     8,   AMR_BIT(isp_id[0]),  55,  40,  14,   6,  15,   5,   0,  68,
-     8,   AMR_BIT(isp_id[1]),  77,  58,  75,  49,  59,  57,  67,  61,
-     6,   AMR_BIT(isp_id[2]),  48,  63,  51,  62,  50,  70,
-     7,   AMR_BIT(isp_id[3]),  71,  56,  60,  69,  85,  86,  80,
-     7,   AMR_BIT(isp_id[4]),  93,  64,  94,  76,  82,  81,  89,
-     5,   AMR_BIT(isp_id[5]),  90, 103,  88, 102,  99,
-     5,   AMR_BIT(isp_id[6]),  98,  97,  96, 111,  95,
-     9,      AMR_OF(0, adap),  13,  12,  11,  10,   9,  41,  66,  72,
-                               92,
-     1,       AMR_OF(0, ltp), 110,
-     2, AMR_OF(0, pul_ih[0]), 124, 115,
-     2, AMR_OF(0, pul_ih[1]), 150, 117,
-     2, AMR_OF(0, pul_ih[2]), 129, 114,
-     2, AMR_OF(0, pul_ih[3]), 121, 131,
-    14, AMR_OF(0, pul_il[0]), 161, 257, 343, 199, 177, 303, 204, 173,
-                              168, 260, 277, 307, 338, 128,
-    14, AMR_OF(0, pul_il[1]), 194, 286, 347, 222, 214, 316, 236, 152,
-                              166, 242, 284, 308, 344, 142,
-    14, AMR_OF(0, pul_il[2]), 169, 273, 353, 202, 189, 311, 240, 200,
-                              171, 261, 309, 296, 345, 130,
-    14, AMR_OF(0, pul_il[3]), 198, 275, 349, 187, 163, 282, 193, 195,
-                              175, 234, 265, 289, 328, 119,
-     7,   AMR_OF(0, vq_gain),   4,  19,  45,  27,  39,  33,  31,
-     6,      AMR_OF(1, adap),  35,  54,  79,  74,  84, 101,
-     1,       AMR_OF(1, ltp), 109,
-     2, AMR_OF(1, pul_ih[0]), 139, 104,
-     2, AMR_OF(1, pul_ih[1]), 135, 118,
-     2, AMR_OF(1, pul_ih[2]), 112, 127,
-     2, AMR_OF(1, pul_ih[3]), 140, 141,
-    14, AMR_OF(1, pul_il[0]), 179, 276, 340, 225, 223, 321, 235, 190,
-                              182, 271, 310, 315, 352, 125,
-    14, AMR_OF(1, pul_il[1]), 153, 264, 329, 232, 209, 323, 231, 165,
-                              191, 279, 290, 312, 367, 134,
-    14, AMR_OF(1, pul_il[2]), 167, 269, 341, 205, 197, 298, 224, 160,
-                              170, 259, 280, 317, 357, 148,
-    14, AMR_OF(1, pul_il[3]), 203, 272, 342, 227, 192, 299, 233, 172,
-                              183, 256, 283, 326, 355, 106,
-     7,   AMR_OF(1, vq_gain),   3,  18,  44,  26,  38,  32,  30,
-     9,      AMR_OF(2, adap),   8,  23,  22,  21,  20,  52,  65,  87,
-                               91,
-     1,       AMR_OF(2, ltp), 108,
-     2, AMR_OF(2, pul_ih[0]), 144, 120,
-     2, AMR_OF(2, pul_ih[1]), 157, 123,
-     2, AMR_OF(2, pul_ih[2]), 145, 138,
-     2, AMR_OF(2, pul_ih[3]), 132, 154,
-    14, AMR_OF(2, pul_il[0]), 241, 319, 365, 252, 253, 331, 254, 230,
-                              220, 263, 285, 314, 364, 156,
-    14, AMR_OF(2, pul_il[1]), 247, 291, 339, 249, 250, 332, 267, 196,
-                              207, 268, 304, 324, 356, 158,
-    14, AMR_OF(2, pul_il[2]), 210, 300, 348, 243, 237, 333, 246, 206,
-                              219, 266, 318, 335, 363, 159,
-    14, AMR_OF(2, pul_il[3]), 239, 306, 366, 221, 226, 297, 251, 184,
-                              178, 258, 292, 305, 346, 116,
-     7,   AMR_OF(2, vq_gain),   2,  17,  43,  25,  37,  47,  29,
-     6,      AMR_OF(3, adap),  34,  53,  78,  73,  83, 100,
-     1,       AMR_OF(3, ltp), 107,
-     2, AMR_OF(3, pul_ih[0]), 143, 126,
-     2, AMR_OF(3, pul_ih[1]), 137, 122,
-     2, AMR_OF(3, pul_ih[2]), 149, 105,
-     2, AMR_OF(3, pul_ih[3]), 133, 136,
-    14, AMR_OF(3, pul_il[0]), 162, 287, 337, 244, 229, 322, 218, 180,
-                              186, 262, 274, 288, 351, 146,
-    14, AMR_OF(3, pul_il[1]), 212, 294, 358, 248, 228, 334, 215, 174,
-                              176, 270, 293, 301, 354, 147,
-    14, AMR_OF(3, pul_il[2]), 185, 327, 336, 211, 213, 313, 245, 181,
-                              188, 255, 281, 325, 350, 151,
-    14, AMR_OF(3, pul_il[3]), 201, 295, 359, 216, 208, 320, 238, 164,
-                              155, 217, 278, 302, 330, 113,
-     7,   AMR_OF(3, vq_gain),   1,  16,  42,  24,  36,  46,  28,
-     0
-};
-
-static const uint16_t order_MODE_19k85[] = {
-     1,         AMR_BIT(vad),   7,
-     8,   AMR_BIT(isp_id[0]),  55,  40,  14,   6,  15,   5,   0,  68,
-     8,   AMR_BIT(isp_id[1]),  77,  58,  75,  49,  59,  57,  67,  61,
-     6,   AMR_BIT(isp_id[2]),  48,  63,  51,  62,  50,  70,
-     7,   AMR_BIT(isp_id[3]),  71,  56,  60,  69,  85,  86,  80,
-     7,   AMR_BIT(isp_id[4]),  93,  64,  94,  76,  82,  81,  89,
-     5,   AMR_BIT(isp_id[5]),  90, 103,  88, 102,  99,
-     5,   AMR_BIT(isp_id[6]),  98,  97,  96, 111,  95,
-     9,      AMR_OF(0, adap),  13,  12,  11,  10,   9,  41,  66,  72,
-                               92,
-     1,       AMR_OF(0, ltp), 110,
-    10, AMR_OF(0, pul_ih[0]), 134, 153, 263, 342, 399, 154, 106, 177,
-                              317, 265,
-    10, AMR_OF(0, pul_ih[1]), 128, 167, 270, 351, 385, 160, 105, 213,
-                              329, 259,
-     2, AMR_OF(0, pul_ih[2]), 123, 147,
-     2, AMR_OF(0, pul_ih[3]), 131, 143,
-    10, AMR_OF(0, pul_il[0]), 346, 118, 170, 201, 296, 368, 250, 284,
-                              341, 391,
-    10, AMR_OF(0, pul_il[1]), 345, 104, 166, 196, 281, 374, 242, 269,
-                              327, 390,
-    14, AMR_OF(0, pul_il[2]), 141, 171, 291, 364, 229, 210, 308, 228,
-                              206, 200, 258, 295, 313, 361,
-    14, AMR_OF(0, pul_il[3]), 144, 188, 282, 366, 217, 216, 309, 218,
-                              193, 182, 245, 287, 300, 367,
-     7,   AMR_OF(0, vq_gain),   4,  19,  45,  27,  39,  33,  31,
-     6,      AMR_OF(1, adap),  35,  54,  79,  74,  84, 101,
-     1,       AMR_OF(1, ltp), 109,
-    10, AMR_OF(1, pul_ih[0]), 139, 169, 267, 348, 389, 163, 116, 189,
-                              343, 268,
-    10, AMR_OF(1, pul_ih[1]), 120, 161, 249, 339, 397, 152, 114, 230,
-                              334, 303,
-     2, AMR_OF(1, pul_ih[2]), 125, 138,
-     2, AMR_OF(1, pul_ih[3]), 112, 129,
-    10, AMR_OF(1, pul_il[0]), 349, 122, 162, 203, 288, 372, 278, 274,
-                              312, 377,
-    10, AMR_OF(1, pul_il[1]), 357, 126, 165, 214, 298, 362, 252, 260,
-                              321, 378,
-    14, AMR_OF(1, pul_il[2]), 150, 199, 266, 355, 211, 180, 285, 241,
-                              195, 198, 243, 275, 323, 375,
-    14, AMR_OF(1, pul_il[3]), 142, 191, 256, 353, 208, 220, 314, 237,
-                              190, 212, 255, 304, 318, 371,
-     7,   AMR_OF(1, vq_gain),   3,  18,  44,  26,  38,  32,  30,
-     9,      AMR_OF(2, adap),   8,  23,  22,  21,  20,  52,  65,  87,
-                               91,
-     1,       AMR_OF(2, ltp), 108,
-    10, AMR_OF(2, pul_ih[0]), 159, 168, 302, 356, 395, 178, 132, 185,
-                              330, 286,
-    10, AMR_OF(2, pul_ih[1]), 158, 181, 292, 358, 396, 176, 133, 235,
-                              331, 276,
-     2, AMR_OF(2, pul_ih[2]), 130, 157,
-     2, AMR_OF(2, pul_ih[3]), 124, 136,
-    10, AMR_OF(2, pul_il[0]), 354, 121, 194, 246, 322, 379, 272, 273,
-                              332, 398,
-    10, AMR_OF(2, pul_il[1]), 359, 140, 186, 236, 333, 376, 290, 301,
-                              338, 387,
-    14, AMR_OF(2, pul_il[2]), 155, 227, 319, 369, 253, 254, 350, 248,
-                              224, 239, 240, 293, 315, 383,
-    14, AMR_OF(2, pul_il[3]), 156, 209, 297, 373, 225, 215, 326, 247,
-                              197, 184, 232, 289, 310, 365,
-     7,   AMR_OF(2, vq_gain),   2,  17,  43,  25,  37,  47,  29,
-     6,      AMR_OF(3, adap),  34,  53,  78,  73,  83, 100,
-     1,       AMR_OF(3, ltp), 107,
-    10, AMR_OF(3, pul_ih[0]), 148, 164, 264, 340, 388, 183, 117, 205,
-                              336, 261,
-    10, AMR_OF(3, pul_ih[1]), 146, 174, 257, 335, 384, 173, 113, 187,
-                              320, 279,
-     2, AMR_OF(3, pul_ih[2]), 127, 151,
-     2, AMR_OF(3, pul_ih[3]), 119, 137,
-    10, AMR_OF(3, pul_il[0]), 352, 135, 172, 238, 306, 381, 262, 271,
-                              328, 382,
-    10, AMR_OF(3, pul_il[1]), 347, 115, 179, 219, 305, 380, 277, 294,
-                              337, 386,
-    14, AMR_OF(3, pul_il[2]), 145, 192, 307, 370, 234, 223, 324, 244,
-                              202, 204, 251, 299, 325, 360,
-    14, AMR_OF(3, pul_il[3]), 149, 221, 311, 363, 226, 222, 316, 231,
-                              207, 175, 233, 280, 283, 344,
-     7,   AMR_OF(3, vq_gain),   1,  16,  42,  24,  36,  46,  28,
-     0
-};
-
-static const uint16_t order_MODE_23k05[] = {
-     1,         AMR_BIT(vad),   7,
-     8,   AMR_BIT(isp_id[0]),  55,  40,  14,   6,  15,   5,   0,  68,
-     8,   AMR_BIT(isp_id[1]),  77,  58,  75,  49,  59,  57,  67,  61,
-     6,   AMR_BIT(isp_id[2]),  48,  63,  51,  62,  50,  70,
-     7,   AMR_BIT(isp_id[3]),  71,  56,  60,  69,  85,  86,  80,
-     7,   AMR_BIT(isp_id[4]),  93,  64,  94,  76,  82,  81,  89,
-     5,   AMR_BIT(isp_id[5]),  90, 103,  88, 102,  99,
-     5,   AMR_BIT(isp_id[6]),  98,  97,  96, 111,  95,
-     9,      AMR_OF(0, adap),  13,  12,  11,  10,   9,  41,  66,  72,
-                               92,
-     1,       AMR_OF(0, ltp), 110,
-    11, AMR_OF(0, pul_ih[0]), 118, 129, 131, 153, 170, 282, 298, 210,
-                              191, 357, 317,
-    11, AMR_OF(0, pul_ih[1]), 126, 146, 135, 165, 187, 273, 345, 295,
-                              172, 338, 340,
-    11, AMR_OF(0, pul_ih[2]), 119, 137, 141, 167, 208, 304, 366, 256,
-                              177, 339, 328,
-    11, AMR_OF(0, pul_ih[3]), 116, 130, 120, 166, 190, 252, 311, 239,
-                              173, 343, 318,
-    11, AMR_OF(0, pul_il[0]), 245, 180, 342, 424, 259, 277, 266, 380,
-                              398, 423, 440,
-    11, AMR_OF(0, pul_il[1]), 218, 207, 367, 434, 201, 240, 275, 363,
-                              399, 419, 452,
-    11, AMR_OF(0, pul_il[2]), 274, 188, 348, 425, 242, 204, 262, 365,
-                              402, 431, 463,
-    11, AMR_OF(0, pul_il[3]), 221, 183, 337, 439, 243, 216, 251, 354,
-                              390, 411, 462,
-     7,   AMR_OF(0, vq_gain),   4,  19,  45,  27,  39,  33,  31,
-     6,      AMR_OF(1, adap),  35,  54,  79,  74,  84, 101,
-     1,       AMR_OF(1, ltp), 109,
-    11, AMR_OF(1, pul_ih[0]), 115, 140, 142, 161, 230, 291, 351, 235,
-                              181, 293, 310,
-    11, AMR_OF(1, pul_ih[1]), 104, 138, 132, 162, 211, 315, 347, 233,
-                              176, 320, 329,
-    11, AMR_OF(1, pul_ih[2]), 106, 134, 125, 154, 205, 267, 306, 220,
-                              185, 330, 297,
-    11, AMR_OF(1, pul_ih[3]), 105, 148, 122, 152, 215, 302, 350, 254,
-                              178, 319, 313,
-    11, AMR_OF(1, pul_il[0]), 269, 189, 382, 432, 272, 228, 263, 383,
-                              406, 422, 453,
-    11, AMR_OF(1, pul_il[1]), 286, 206, 377, 446, 226, 222, 265, 368,
-                              404, 416, 454,
-    11, AMR_OF(1, pul_il[2]), 247, 195, 358, 445, 224, 236, 309, 341,
-                              375, 408, 449,
-    11, AMR_OF(1, pul_il[3]), 225, 192, 359, 436, 250, 258, 290, 389,
-                              400, 420, 448,
-     7,   AMR_OF(1, vq_gain),   3,  18,  44,  26,  38,  32,  30,
-     9,      AMR_OF(2, adap),   8,  23,  22,  21,  20,  52,  65,  87,
-                               91,
-     1,       AMR_OF(2, ltp), 108,
-    11, AMR_OF(2, pul_ih[0]), 139, 144, 145, 169, 234, 327, 395, 299,
-                              244, 356, 379,
-    11, AMR_OF(2, pul_ih[1]), 127, 156, 158, 171, 231, 308, 397, 355,
-                              261, 371, 335,
-    11, AMR_OF(2, pul_ih[2]), 123, 155, 157, 193, 241, 362, 384, 323,
-                              238, 392, 361,
-    11, AMR_OF(2, pul_ih[3]), 114, 147, 121, 175, 196, 333, 373, 303,
-                              184, 353, 322,
-    11, AMR_OF(2, pul_il[0]), 271, 203, 385, 442, 307, 276, 334, 405,
-                              412, 427, 459,
-    11, AMR_OF(2, pul_il[1]), 278, 200, 388, 447, 292, 288, 296, 403,
-                              415, 429, 460,
-    11, AMR_OF(2, pul_il[2]), 312, 214, 393, 433, 279, 301, 314, 391,
-                              410, 426, 450,
-    11, AMR_OF(2, pul_il[3]), 280, 186, 376, 437, 268, 260, 255, 364,
-                              414, 417, 441,
-     7,   AMR_OF(2, vq_gain),   2,  17,  43,  25,  37,  47,  29,
-     6,      AMR_OF(3, adap),  34,  53,  78,  73,  83, 100,
-     1,       AMR_OF(3, ltp), 107,
-    11, AMR_OF(3, pul_ih[0]), 112, 159, 143, 164, 213, 281, 332, 284,
-                              168, 344, 325,
-    11, AMR_OF(3, pul_ih[1]), 113, 150, 149, 179, 199, 316, 324, 285,
-                              237, 360, 336,
-    11, AMR_OF(3, pul_ih[2]), 124, 136, 151, 174, 209, 326, 349, 248,
-                              198, 374, 331,
-    11, AMR_OF(3, pul_ih[3]), 117, 128, 133, 163, 202, 300, 372, 305,
-                              194, 387, 321,
-    11, AMR_OF(3, pul_il[0]), 249, 182, 352, 428, 253, 264, 289, 413,
-                              407, 418, 461,
-    11, AMR_OF(3, pul_il[1]), 287, 212, 369, 444, 223, 246, 217, 346,
-                              394, 401, 451,
-    11, AMR_OF(3, pul_il[2]), 219, 197, 378, 435, 229, 257, 283, 396,
-                              409, 430, 455,
-    11, AMR_OF(3, pul_il[3]), 232, 160, 370, 438, 227, 270, 294, 381,
-                              386, 421, 443,
-     7,   AMR_OF(3, vq_gain),   1,  16,  42,  24,  36,  46,  28,
-     0
-};
-
-static const uint16_t order_MODE_23k85[] = {
-     1,         AMR_BIT(vad),   7,
-     8,   AMR_BIT(isp_id[0]),  55,  40,  14,   6,  15,   5,   0,  68,
-     8,   AMR_BIT(isp_id[1]),  93,  58,  91,  49,  59,  57,  67,  61,
-     6,   AMR_BIT(isp_id[2]),  48,  63,  51,  62,  50,  70,
-     7,   AMR_BIT(isp_id[3]),  71,  56,  60,  69, 101, 102,  96,
-     7,   AMR_BIT(isp_id[4]), 109,  64, 110,  92,  98,  97, 105,
-     5,   AMR_BIT(isp_id[5]), 106, 119, 104, 118, 115,
-     5,   AMR_BIT(isp_id[6]), 114, 113, 112, 127, 111,
-     9,      AMR_OF(0, adap),  13,  12,  11,  10,   9,  41,  66,  88,
-                              108,
-     1,       AMR_OF(0, ltp), 126,
-    11, AMR_OF(0, pul_ih[0]), 134, 145, 147, 169, 186, 298, 314, 226,
-                              207, 373, 333,
-    11, AMR_OF(0, pul_ih[1]), 142, 162, 151, 181, 203, 289, 361, 311,
-                              188, 354, 356,
-    11, AMR_OF(0, pul_ih[2]), 135, 153, 157, 183, 224, 320, 382, 272,
-                              193, 355, 344,
-    11, AMR_OF(0, pul_ih[3]), 132, 146, 136, 182, 206, 268, 327, 255,
-                              189, 359, 334,
-    11, AMR_OF(0, pul_il[0]), 261, 196, 358, 440, 275, 293, 282, 396,
-                              414, 439, 456,
-    11, AMR_OF(0, pul_il[1]), 234, 223, 383, 450, 217, 256, 291, 379,
-                              415, 435, 468,
-    11, AMR_OF(0, pul_il[2]), 290, 204, 364, 441, 258, 220, 278, 381,
-                              418, 447, 479,
-    11, AMR_OF(0, pul_il[3]), 237, 199, 353, 455, 259, 232, 267, 370,
-                              406, 427, 478,
-     7,   AMR_OF(0, vq_gain),   4,  19,  45,  27,  39,  33,  31,
-     4,   AMR_OF(0, hb_gain),  79,  78,  77,  76,
-     6,      AMR_OF(1, adap),  35,  54,  95,  90, 100, 117,
-     1,       AMR_OF(1, ltp), 125,
-    11, AMR_OF(1, pul_ih[0]), 131, 156, 158, 177, 246, 307, 367, 251,
-                              197, 309, 326,
-    11, AMR_OF(1, pul_ih[1]), 120, 154, 148, 178, 227, 331, 363, 249,
-                              192, 336, 345,
-    11, AMR_OF(1, pul_ih[2]), 122, 150, 141, 170, 221, 283, 322, 236,
-                              201, 346, 313,
-    11, AMR_OF(1, pul_ih[3]), 121, 164, 138, 168, 231, 318, 366, 270,
-                              194, 335, 329,
-    11, AMR_OF(1, pul_il[0]), 285, 205, 398, 448, 288, 244, 279, 399,
-                              422, 438, 469,
-    11, AMR_OF(1, pul_il[1]), 302, 222, 393, 462, 242, 238, 281, 384,
-                              420, 432, 470,
-    11, AMR_OF(1, pul_il[2]), 263, 211, 374, 461, 240, 252, 325, 357,
-                              391, 424, 465,
-    11, AMR_OF(1, pul_il[3]), 241, 208, 375, 452, 266, 274, 306, 405,
-                              416, 436, 464,
-     7,   AMR_OF(1, vq_gain),   3,  18,  44,  26,  38,  32,  30,
-     4,   AMR_OF(1, hb_gain),  75,  74,  73,  72,
-     9,      AMR_OF(2, adap),   8,  23,  22,  21,  20,  52,  65, 103,
-                              107,
-     1,       AMR_OF(2, ltp), 124,
-    11, AMR_OF(2, pul_ih[0]), 155, 160, 161, 185, 250, 343, 411, 315,
-                              260, 372, 395,
-    11, AMR_OF(2, pul_ih[1]), 143, 172, 174, 187, 247, 324, 413, 371,
-                              277, 387, 351,
-    11, AMR_OF(2, pul_ih[2]), 139, 171, 173, 209, 257, 378, 400, 339,
-                              254, 408, 377,
-    11, AMR_OF(2, pul_ih[3]), 130, 163, 137, 191, 212, 349, 389, 319,
-                              200, 369, 338,
-    11, AMR_OF(2, pul_il[0]), 287, 219, 401, 458, 323, 292, 350, 421,
-                              428, 443, 475,
-    11, AMR_OF(2, pul_il[1]), 294, 216, 404, 463, 308, 304, 312, 419,
-                              431, 445, 476,
-    11, AMR_OF(2, pul_il[2]), 328, 230, 409, 449, 295, 317, 330, 407,
-                              426, 442, 466,
-    11, AMR_OF(2, pul_il[3]), 296, 202, 392, 453, 284, 276, 271, 380,
-                              430, 433, 457,
-     7,   AMR_OF(2, vq_gain),   2,  17,  43,  25,  37,  47,  29,
-     4,   AMR_OF(2, hb_gain),  87,  86,  85,  84,
-     6,      AMR_OF(3, adap),  34,  53,  94,  89,  99, 116,
-     1,       AMR_OF(3, ltp), 123,
-    11, AMR_OF(3, pul_ih[0]), 128, 175, 159, 180, 229, 297, 348, 300,
-                              184, 360, 341,
-    11, AMR_OF(3, pul_ih[1]), 129, 166, 165, 195, 215, 332, 340, 301,
-                              253, 376, 352,
-    11, AMR_OF(3, pul_ih[2]), 140, 152, 167, 190, 225, 342, 365, 264,
-                              214, 390, 347,
-    11, AMR_OF(3, pul_ih[3]), 133, 144, 149, 179, 218, 316, 388, 321,
-                              210, 403, 337,
-    11, AMR_OF(3, pul_il[0]), 265, 198, 368, 444, 269, 280, 305, 429,
-                              423, 434, 477,
-    11, AMR_OF(3, pul_il[1]), 303, 228, 385, 460, 239, 262, 233, 362,
-                              410, 417, 467,
-    11, AMR_OF(3, pul_il[2]), 235, 213, 394, 451, 245, 273, 299, 412,
-                              425, 446, 471,
-    11, AMR_OF(3, pul_il[3]), 248, 176, 386, 454, 243, 286, 310, 397,
-                              402, 437, 459,
-     7,   AMR_OF(3, vq_gain),   1,  16,  42,  24,  36,  46,  28,
-     4,   AMR_OF(3, hb_gain),  83,  82,  81,  80,
-     0
-};
-
-/** Reordering array addresses for each mode */
-static const uint16_t* amr_bit_orderings_by_mode[] = {
-    order_MODE_6k60,
-    order_MODE_8k85,
-    order_MODE_12k65,
-    order_MODE_14k25,
-    order_MODE_15k85,
-    order_MODE_18k25,
-    order_MODE_19k85,
-    order_MODE_23k05,
-    order_MODE_23k85
-};
-
-// Extracted from 3GPP TS 26.173 V9.0.0 (qpisf_2s.tab)
-// The *_36b tables are used in 6k60 mode
-// Stored in fixed-point to save some space
-/** Indexed tables for retrieval of quantized ISF vectors in Q15 */
-static const int16_t dico1_isf[256][9] = {
- {  579,  1081,  1035,   390,     3,  -263,  -198,   -82,    38},
- {   18,   -68,   -12,   313,   761,   405,   249,   111,   -76},
- {  740,  1263,  1292,  1006,   997,  1019,  1017,   976,   923},
- {  -91,   827,   948,   648,   613,   535,   522,   490,   421},
- {   41,   -44,  -281,  -472,   652,   534,   193,   135,   -90},
- {   41,  -121,  -356,   -60,   663,   307,    61,   -48,  -344},
- {  557,   946,  1049,   867,   846,   990,  1112,  1262,  1241},
- { -118,  -204,   328,   512,   870,   793,   610,   402,   186},
- {  156,   293,    74,  -338,  -475,  -897,  -594,  -161,  -497},
- {  226,   131,  -138,   307,   169,  -271,  -164,  -387,  -624},
- {   62,   -32,   -61,  -252,  -541,  -828, -1027,  -523,  -662},
- {  102,   -61,   141,   112,  -270,  -251,  -541,    25,  -150},
- {    6,  -132,  -356,  -686,   -96,  -322,  -522,   -31,  -326},
- {  -36,  -209,  -521,  -229,   307,  -132,    -5,   -99,  -384},
- {   60,   -51,  -237,  -668,  -973,  -407,  -708,   -75,  -172},
- {   26,  -138,  -266,   111,  -302,    43,  -278,  -356,  -359},
- {  570,   822,   496,  -154,  -312,   -92,   137,   279,   371},
- { -146,   368,   409,    68,     6,    77,   167,   202,   162},
- {  633,   898,   996,   756,   662,   683,   783,   909,   996},
- { -103,   294,   607,   415,   483,   462,   480,   431,   408},
- { -120,  -338,  -612,  -524,   584,   331,    92,   433,   276},
- { -178,  -293,  -154,   -41,   269,   100,    -9,   213,   160},
- {  830,   736,   278,   820,  1254,   686,   712,  1039,   473},
- { -218,  -304,   463,   454,   397,   273,   202,   286,   273},
- { -232,     7,     6,  -388,  -472,  -427,  -378,  -167,  -100},
- { -294,  -183,   134,   -47,   101,   -88,   -84,  -117,    -3},
- {   57,    17,  -202,  -634,  -989, -1119,  -533,   176,   -36},
- {  120,   -28,    23,   111,  -319,   318,   -22,   -77,   266},
- { -271,  -464,  -434,  -658,  -640,  -385,  -385,   -99,   -69},
- { -198,  -259,  -266,   -44,   -39,  -139,  -137,   171,    66},
- {    9,  -145,  -377,  -846, -1000,  -111,  -325,   342,   135},
- {  -81,  -286,  -380,   192,   -57,   307,    76,   -24,  -140},
- {  677,   702,   247,    56,   249,   141,  -105,  -236,   -99},
- {   36,   -39,   -69,   348,   198,   -93,   322,    91,   -72},
- {  503,   885,  1508,  1307,  1282,  1172,  1119,  1209,  1061},
- {  416,   719,   989,  1227,  1001,  1052,   954,   741,  1044},
- { -127,  -376,  -657,   139,   623,   223,   501,   306,   220},
- { -113,  -384,  -796,   504,   438,    85,   213,   -83,  -194},
- {  585,  1132,  1233,  1091,  1247,  1433,  1512,  1448,  1314},
- { -174,  -422,     7,  1155,  1089,  1182,  1003,   945,   806},
- {    8,  -126,  -317,  -103,  -351,  -695,   -98,  -268,  -537},
- {   33,  -103,  -290,   167,   -39,  -407,    44,  -208,  -375},
- {  104,   -23,   -64,  -291,  -637,  -851, -1084,   -61,  -112},
- {  -75,  -306,  -434,   218,  -148,  -354,  -680,  -133,  -216},
- { -121,  -377,  -718,   -97,  -130,  -361,  -156,  -379,  -599},
- {  -56,  -254,  -586,   235,   157,  -214,    11,  -260,  -149},
- { -124,  -267,  -397,  -580,  -593,  -527,  -805,  -385,   346},
- { -193,  -440,  -708,  -351,  -141,  -255,  -499,  -147,  -185},
- {  448,   660,   494,   208,   509,   461,   338,   291,   149},
- { -223,    88,   335,   159,   212,   191,   286,   308,   205},
- {  -31,   469,   803,   659,   619,   658,   843,   987,  1113},
- { -171,  -242,   514,   362,   295,   524,   552,   694,   585},
- {  -64,  -308,  -448,   -21,   284,   786,   446,   289,    92},
- { -218,  -390,    -7,   169,   206,   330,   352,   408,   358},
- {  -36,   702,   959,   859,   861,  1115,  1269,  1357,  1305},
- { -133,  -341,   -65,   678,   417,   440,   486,   518,   780},
- {   33,   -44,  -191,  -344,  -461,  -755,  -201,   217,   -31},
- { -353,  -547,   -44,   123,   -61,   -68,   -79,    29,    60},
- {   73,   -57,  -406,  -766, -1243, -1203,   240,   400,   165},
- {  -73,  -282,  -601,  -213,  -171,  -375,   332,    35,  -103},
- {  -29,  -207,  -553,  -476,  -638,  -908,   172,   -22,  -135},
- { -192,  -239,  -164,  -103,  -111,   -47,   153,   125,   110},
- {   -1,  -203,  -570, -1030, -1424,  -535,   155,     1,   147},
- { -333,  -653,  -865,  -197,  -158,   -21,   -44,    95,   108},
- {  389,   588,   490,    33,  -237,  -524,  -628,  -136,  -260},
- {   40,  -177,  -462,   453,   862,   380,   131,  -130,  -405},
- {  842,  1678,  1841,  1549,  1474,  1256,  1082,   905,   742},
- {  370,  1216,  1768,  1633,  1212,   636,    22,  -330,    71},
- {  -76,  -281,  -741,  -742,   898,   619,   277,    71,  -222},
- {  -32,  -265,  -556,   -25,   994,   682,   305,   126,  -165},
- {   73,   738,   893,   968,   993,  1768,  2273,  1840,  1391},
- {  -69,  -349,  -585,   234,  1158,   903,   626,   510,   251},
- {   -1,   -99,  -272,  -210,  -603,  -351,  -540,  -811,  -383},
- {  -16,  -230,  -504,   410,   149,  -205,  -343,  -651,  -639},
- {  103,    -9,  -227,  -205,  -562,  -781, -1079, -1208,  -156},
- {  143,    63,  -135,   -67,  -317,  -602,  -784, -1154,  -640},
- { -144,  -391,  -674,  -622,  -200,  -254,  -660,  -947,  -395},
- {  -40,  -250,  -625,    27,   543,    94,  -131,  -386,  -673},
- { -123,  -371,  -757,  -451,  -564,  -614,  -415,  -711,   -35},
- { -116,  -309,  -593,  -268,   239,   -33,  -338,  -650,  -135},
- {   94,   251,   554,    57,  -312,  -423,  -154,   -57,   235},
- { -268,   -71,   381,   114,   -44,   -87,   125,   173,   133},
- { 1513,  1714,  1238,   534,   276,   315,   461,   459,   508},
- { -131,   -19,  1149,   670,   486,   356,   309,   369,   296},
- { -223,  -501,  -899,  -722,   -70,     6,   131,   310,   394},
- {  -99,  -303,  -517,   249,    64,   -53,   135,   -11,   453},
- { -147,  -399,  -730,  -401,   817,   738,   802,   749,   575},
- { -154,  -435,  -739,   800,   593,   366,   529,   318,   326},
- { -224,    45,   -39,  -387,  -515,  -518,  -608,  -384,  -321},
- { -315,  -377,   143,  -101,  -113,  -377,  -177,  -144,   -12},
- {  117,    40,  -239,  -651, -1051,  -581,  -737,  -990,  -328},
- {   26,   -50,  -157,   -23,  -453,  -283,  -531,  -546,   192},
- { -252,  -501,  -743,  -589,  -627,  -499,  -328,  -118,   -72},
- { -324,  -494,  -244,  -306,  -144,  -177,  -262,  -135,   -78},
- {  -36,  -234,  -519,  -961, -1290,  -314,  -479,  -371,   -45},
- {  -95,  -292,  -535,    -8,  -300,   112,  -164,  -277,   198},
- {  -99,  -128,   880,   836,   579,   351,    23,   -95,  -217},
- {  -27,  -258,   124,  1011,   597,   425,   144,     7,   -73},
- {  421,  1293,  1640,  1623,  1742,  1617,  1499,  1284,  1006},
- {  -95,   752,  1680,  1569,  1618,  1436,  1200,   980,   712},
- {  -69,  -300,  -683,  -435,  1132,   899,   504,   332,   109},
- {  -74,  -323,  -637,   563,  1074,   608,   371,   105,   -49},
- {  -78,   831,  1194,  1110,  1378,  1481,  1492,  1365,  1217},
- { -259,  -121,  1440,  1334,  1628,  1490,  1438,  1223,   933},
- {  -82,  -306,  -613,  -222,  -378,  -675,  -545,  -671,  -845},
- {   53,  -124,  -347,   422,    52,  -125,  -270,  -529,     9},
- {   79,   -89,  -320,  -662,  -999, -1199, -1243,  -676,  -297},
- {  -68,  -273,  -611,   137,  -146,  -397,  -627,  -845,  -220},
- { -112,  -346,  -797,  -826,   234,  -132,  -188,  -278,  -522},
- { -159,  -405,  -734,  -419,   293,    74,  -167,  -167,   184},
- { -153,  -437,  -833, -1080,  -336,  -472,  -561,  -340,  -253},
- { -169,  -423,  -820,  -904,  -131,   -19,  -346,  -604,    31},
- {   33,   -31,   312,    62,  -148,    49,   -59,   564,   486},
- { -306,  -333,   194,   -44,    67,    72,   147,   205,   243},
- { -207,   -49,  1360,   983,   969,   991,  1014,  1110,   973},
- { -211,  -172,   883,   627,   711,   674,   705,   798,   746},
- {  -88,  -325,  -763,  -974,   687,   908,   514,   382,   172},
- { -292,  -612,  -805,    63,   131,   270,   259,   352,   348},
- { -235,   -84,   955,   818,  1120,  1289,  1559,  1480,  1285},
- { -180,  -461,  -614,   657,   691,   745,   854,   783,   713},
- {  -97,  -309,  -477,  -614,  -777,  -734,  -768,  -526,  -472},
- { -344,  -476,   -35,  -169,    49,   -77,  -150,  -240,  -141},
- {  -52,  -268,  -639,  -919, -1278, -1113,  -342,  -333,  -151},
- {  -68,  -242,  -585,   -73,  -209,  -478,  -159,  -429,   133},
- { -197,  -499, -1005, -1268,  -272,  -224,  -105,   -67,    17},
- { -363,  -618,  -414,  -116,   -62,    20,    10,   116,   108},
- { -195,  -475,  -906, -1260,  -891,  -441,  -277,  -142,   -28},
- { -226,  -519,  -950,  -700,  -275,  -266,  -116,  -105,    82},
- {  404,   511,   520,   327,    17,  -194,  -333,  -536,  -586},
- { -114,  -130,   276,   237,   204,   342,   135,   -16,  -111},
- {  670,  1208,  1168,   860,   742,   601,   528,   403,   309},
- {  397,   621,   966,   752,   579,   398,   400,   329,   252},
- {  191,   180,  -137,  -467,   272,   106,   -95,    17,  -192},
- {  -80,  -290,  -626,   194,   598,   196,    21,  -281,    77},
- {  510,   864,  1108,   807,   939,   902,   925,   717,   481},
- {  137,   367,   534,   764,   670,   382,   296,   153,    84},
- {  303,   497,   144,   -85,  -125,  -539,  -482,  -464,  -764},
- {  233,   347,    68,  -147,   169,  -210,  -242,  -226,  -482},
- {  307,   422,   154,  -175,  -386,  -722,  -724,  -904, -1015},
- {  309,   308,   160,   -60,  -470,  -420,  -598,  -791,  -219},
- {   68,   121,  -137,  -560,  -146,  -446,  -515,  -494,  -729},
- {  130,    53,  -227,    46,   474,    32,  -161,  -192,  -490},
- {  213,   164,   -71,  -465,  -876,  -161,  -456,  -587,   -48},
- {  218,   117,    39,   177,  -194,   -88,  -226,  -418,    50},
- {  210,   547,   569,   279,   121,   -44,   -50,    10,   -84},
- {   58,   140,   182,    -5,   267,   117,   106,   211,   198},
- {  539,   835,   913,   719,   617,   544,   591,   565,   642},
- {  153,   559,   872,   460,   222,   108,   188,   180,   183},
- {  158,   119,   284,  -153,  -271,   229,    87,   110,   -57},
- { -183,    82,   118,    21,    13,    40,   118,   191,   185},
- {  162,   889,   654,   108,   -34,   244,   488,   561,   532},
- {  163,    56,   609,   341,    50,   329,    68,   266,   218},
- {  100,   206,    18,  -304,  -107,  -436,  -487,   -65,  -306},
- {  -86,   154,   134,   -30,   -45,   -73,  -104,   -80,   -96},
- {  245,   330,    10,  -440,  -849, -1082,    79,    40,  -265},
- {  196,   372,   272,  -181,  -493,  -389,   275,    80,   -59},
- {    2,   -12,  -246,  -505,  -100,  -436,    21,  -187,  -431},
- { -221,   -48,    36,  -271,  -186,  -147,  -109,    26,    71},
- {  213,   140,    72,  -351,  -620,   -84,  -363,    69,    46},
- {   91,   167,    -3,   -95,   -99,  -105,   -48,   114,   147},
- {  259,   249,   172,   607,   406,    52,    59,  -189,  -320},
- {  115,   -85,   -54,   574,   128,   226,   -59,  -253,   130},
- {  -62,  1033,  1308,  1035,  1127,  1098,  1029,   961,   823},
- {   39,   364,   757,   940,   728,   660,   659,   583,   770},
- { -115,  -338,  -760,  -471,   394,    37,   441,   178,     6},
- {  -57,  -305,  -525,   796,   453,   188,    -4,  -114,   248},
- {   71,   444,   797,   731,  1096,  1157,  1222,  1029,   811},
- {  135,   359,   551,   425,   749,   815,   874,   704,   502},
- {  132,   247,     0,  -206,  -449,  -750,  -258,  -514,  -633},
- {  248,   249,    91,   121,  -195,  -499,   -90,  -282,  -435},
- {   78,    20,  -277,  -623,  -983, -1224,  -415,  -458,  -639},
- {  347,   509,   208,  -179,  -464,  -728,   -76,  -237,  -486},
- { -103,  -343,  -756,  -713,  -265,  -609,  -191,  -398,  -636},
- { -121,  -383,  -749,   567,   252,   -36,  -354,  -417,   -50},
- {  204,   100,  -149,  -650, -1081,   -47,    -7,  -263,   111},
- {  -46,  -180,  -267,  -324,  -562,  -394,  -692,   398,   292},
- {  482,   670,   683,   624,   442,   165,   116,    36,  -149},
- {  108,   247,   291,   247,   355,   122,   109,   224,   296},
- {  -14,   945,   990,   801,   755,   815,   847,   913,   892},
- {  292,   349,   725,   482,   388,   329,   429,   620,   667},
- {  -34,   197,   213,  -127,    84,   494,   620,   575,   375},
- {  126,   207,   172,   167,   362,   202,   296,   395,   455},
- {   -6,   250,   539,   467,   636,   801,  1149,  1287,  1118},
- {   27,   240,   369,   280,   440,   411,   634,   892,   953},
- {  159,   170,   -58,  -395,  -797,  -690,    77,  -211,  -334},
- {   -5,   -28,   -13,   -74,  -335,  -603,   300,    88,  -205},
- {   82,   -33,  -364,  -698, -1203, -1153,   110,  -146,  -289},
- {  113,     1,  -243,  -588,  -994,  -496,   414,   160,    42},
- {  -56,  -247,  -440,  -693,  -996,  -479,    11,  -178,  -357},
- { -151,  -353,  -327,  -211,  -340,   141,    65,   425,   453},
- {   34,  -169,  -455,  -932, -1215,   138,   499,   256,   324},
- {   68,   139,   -15,  -547,  -478,    17,   306,   502,   481},
- {  -32,  -134,   445,   129,  -143,  -244,  -503,  -507,  -599},
- {   61,  -140,  -345,   496,   458,    -2,    20,  -227,  -514},
- {  394,  1765,  1666,  1339,  1117,   806,   642,   479,   380},
- {  215,   519,   920,  1053,  1090,   791,   528,   290,   155},
- {  -54,  -233,  -647,  -602,   639,   294,    -2,  -167,  -442},
- {  -78,  -315,  -791,  -113,   820,   403,   158,  -116,  -356},
- {  529,  1851,  2003,  1228,   622,   -41,  -416,   344,   819},
- { -105,  -379,  -236,  1224,   893,   749,   568,   356,   214},
- {  -17,  -199,  -144,    50,  -283,  -247,  -578,  -846, -1087},
- {   69,   -11,  -381,  -206,   209,  -284,  -387,  -416,  -716},
- {   39,    -5,  -145,  -374,  -682,  -909, -1074, -1169, -1066},
- {  287,   226,    67,  -221,  -662,  -171,  -421,  -642,  -707},
- { -132,  -348,  -538,  -448,   -20,    -4,  -354,  -748,  -933},
- {    4,   -75,  -289,  -598,   317,    52,  -208,  -297,  -559},
- {  -88,  -264,  -358,  -589,  -631,  -248,  -523,  -822, -1071},
- {   70,    -8,    54,  -314,  -515,    92,  -146,  -274,  -493},
- {  199,    62,   391,   158,  -141,    71,  -219,  -203,  -207},
- {  152,    40,   329,   162,   -29,    48,  -149,   108,   127},
- {  635,  1058,   883,   492,   372,   312,   317,   274,   241},
- {  267,   722,  1256,   882,   625,   248,     8,   -81,   -60},
- {  -58,  -138,  -291,  -600,   -12,    -2,   -39,   147,   117},
- { -107,  -345,  -513,   459,    76,    92,  -272,   388,   262},
- {  362,   516,   203,  -409,  -716,  -831,  -331,   185,   209},
- { -117,  -391,  -298,   671,   292,   538,   257,   166,   -38},
- { -102,  -319,  -194,  -283,  -573,  -262,  -579,  -219,  -444},
- { -235,    78,    11,  -168,  -101,  -229,  -263,  -321,  -123},
- {   70,    50,  -170,  -599,  -996,  -588,  -263,  -516,  -455},
- {  394,   363,   229,  -136,  -538,    21,  -183,  -348,  -201},
- { -124,  -368,  -640,  -879,  -847,  -209,  -409,  -494,  -515},
- { -127,  -341,  -541,  -425,  -510,   -10,  -252,  -473,  -291},
- {   84,   -69,  -201,  -676,  -868,   103,  -311,  -132,  -320},
- {    5,  -173,  -188,  -297,  -628,   197,   -57,     7,   -11},
- {   49,  -160,    56,   558,   111,    33,  -311,  -440,  -463},
- {   -1,  -246,  -307,   862,   453,   139,  -170,  -355,  -232},
- {  279,   966,  1642,  1478,  1463,  1123,   795,   525,   339},
- { -197,   -38,  1702,  1331,  1252,   950,   692,   504,   426},
- { -108,  -344,  -861, -1172,   444,   354,    88,   -46,  -220},
- {  -53,  -321,  -494,  1113,   744,   364,   198,   -34,   -75},
- {  457,   955,  1177,  1214,  1427,  1457,  1345,   917,   539},
- {  -69,   199,   897,  1140,  1343,  1183,   977,   742,   522},
- {  122,    44,  -269,    27,  -155,  -562,  -307,  -590,  -773},
- {  154,    42,  -160,   252,  -129,  -305,  -471,  -733,  -371},
- {  135,   185,   -82,  -416,  -722,  -913,  -504,  -743,  -880},
- {  149,   214,   -84,  -329,  -680,  -835,  -426,  -661,   -81},
- { -128,  -380,  -735,  -998,  -337,    17,  -182,  -467,  -697},
- {  -84,  -290,  -510,  -592,    13,   440,   154,   -38,  -279},
- {   70,   -61,  -246,  -727, -1047,   -80,  -381,  -535,  -704},
- {  178,    -2,  -146,  -670,  -938,   482,   138,    63,    65},
- {  -11,    15,   772,   443,   142,   -20,  -209,  -126,  -161},
- {  -32,  -249,    95,   552,   124,    30,  -343,    82,   -86},
- {  148,   751,  1515,  1105,   867,   606,   474,   448,   399},
- { -163,  -257,   899,  1097,   906,   751,   502,   390,   294},
- {  -51,  -258,  -447,  -806,  -368,   763,   464,   364,   183},
- { -166,  -374,  -367,    87,    35,   399,   418,   856,   833},
- { -205,  -310,   588,   778,   785,  1065,  1118,  1245,  1157},
- { -173,  -312,   107,   345,   400,   790,   870,  1113,  1001},
- {   -7,  -120,  -387,  -410,  -614,  -943,  -226,  -384,  -491},
- { -203,  -288,   -51,  -331,   -90,  -178,  -408,  -573,  -338},
- {   56,   -29,  -273,  -627, -1041,  -798,  -247,  -467,   148},
- {   66,    -2,  -205,  -205,  -575,  -349,   -57,  -352,   -58},
- {  -45,  -225,  -471,  -924,  -497,    77,   -32,    44,  -135},
- { -277,  -491,  -497,  -502,  -424,  -202,  -137,    77,    96},
- {   26,  -179,  -469, -1008, -1260,   262,   -35,  -132,  -259},
- {  -66,  -232,  -447,  -533,  -789,  -191,  -100,  -267,   364}
-};
-
-static const int16_t dico2_isf[256][7] = {
- {  1357,  1313,  1136,   784,   438,   181,   145},
- {   636,   648,   667,   568,   442,   217,   362},
- {   427,   440,   674,   524,   332,   117,  -417},
- {   121,   295,   468,   465,   230,    44,  -221},
- {  -147,  -240,   149,    80,   390,   278,   106},
- {  -418,  -556,   552,   511,   235,   144,   -95},
- {    43,   193,   274,   150,    67,    34,  -273},
- {   -43,  -126,   171,   416,   282,    63,  -354},
- {  -372,   -86,  -344,  -108,   -94,  -182,   -89},
- {  -600,  -840,  -200,   465,   258,   -11,  -253},
- {   -48,   329,    97,  -290,  -543,  -795,  -354},
- {  -570,  -117,   187,    10,  -133,  -416,   -76},
- {  -618,  -129,  -247,  -371,    45,   -76,   277},
- { -1022, -1079,   126,   474,   254,   127,    52},
- {  -281,    76,  -167,  -361,  -283,  -551,  -283},
- {  -119,   -52,    -1,   134,   -32,  -204,  -415},
- {  1064,   827,   637,   684,   464,   209,    12},
- {   482,   416,   449,   371,   335,   294,   194},
- {   719,   576,   365,   135,   113,    91,  -199},
- {   298,   176,   493,   366,   194,   163,    36},
- {   -35,  -236,  -259,   -36,    -4,    99,   152},
- {   -98,  -306,   -27,   228,    90,   111,   -86},
- {    91,    13,  -211,  -258,  -106,    86,   -64},
- {    73,   -35,   -57,   -31,   162,    35,  -192},
- {  -109,  -335,  -629,   -66,   -61,  -128,   322},
- {  -495,  -669,  -728,   193,    31,  -220,   122},
- {   324,    95,   -89,   -91,  -409,  -710,  -154},
- {     0,  -234,    92,    33,  -343,  -609,  -220},
- {  -343,  -408,  -476,  -655,  -153,    82,   222},
- {  -490,  -745,  -255,    49,   -48,   135,  -127},
- {   119,   -67,  -328,  -390,  -272,  -545,   -56},
- {   -57,  -130,   -10,    -7,  -164,   -47,   -22},
- {   984,  1064,   961,   568,   210,   -27,    16},
- {   811,   691,   754,   514,   224,   -35,   166},
- {   662,   704,   618,   386,    57,  -211,  -257},
- {   510,   359,   418,   393,    91,  -144,   -18},
- {  -193,   -31,   -27,   223,    89,  -143,    24},
- {  -112,   -98,   471,   319,   185,     3,   175},
- {   252,   146,   -47,   272,    48,  -211,  -234},
- {   146,    69,   203,   364,    68,   -52,    51},
- {  -259,  -478,  -697,  -349,  -758,  -501,    63},
- {  -501,  -769,  -289,    79,  -311,  -497,  -106},
- {   251,    53,  -235,  -469,  -895,  -884,   145},
- {  -416,  -551,   140,  -133,  -523,  -775,    44},
- {  -326,  -423,  -713,  -497,   -86,  -431,    99},
- {  -757,  -772,  -160,   -76,   -46,   -32,   379},
- {    85,   -35,  -200,  -401,  -663, -1040,  -247},
- {  -180,  -330,   -92,  -376,    27,  -183,  -110},
- {  1279,  1086,   781,   502,   324,   164,   157},
- {   682,   466,   449,   277,   146,    28,   409},
- {   635,   472,   390,   107,  -232,  -538,  -139},
- {   196,   396,   332,   213,   209,   -29,   -81},
- {   150,   -95,  -312,    76,   -77,  -320,   -50},
- {    46,     9,    47,   175,   139,    30,   384},
- {   218,   206,   -24,  -250,   -96,  -276,  -183},
- {    26,   119,    38,    14,    -4,  -133,   -52},
- {  -477,  -614,  -987,  -715,  -631,  -813,   200},
- {  -744, -1009, -1065,  -745,  -631,  -171,    18},
- {  -137,  -251,  -483,  -613,  -980, -1203,    12},
- {  -605,  -767,  -562,  -686, -1088,  -515,    58},
- {  -202,  -428,  -782, -1072,   -96,  -234,  -179},
- {  -480,  -709, -1070,  -897,  -131,   -92,   321},
- {  -145,  -193,  -512,  -729,  -572,  -765,  -210},
- {  -331,  -585,  -525,  -631,  -281,  -208,  -303},
- {  1165,  1104,   939,   828,   716,   426,   155},
- {     6,  -109,   820,   778,   415,   113,   -27},
- {   381,   339,   314,   265,   121,    -9,  -474},
- {  -373,    47,   584,   442,    99,  -231,  -113},
- {  -496,   -38,  -285,   262,   305,   170,     4},
- {  -587,  -556,    69,    66,   471,   354,    13},
- {  -138,    70,   -18,   106,    67,   167,  -302},
- {  -445,  -141,   185,   191,   151,    83,  -133},
- {  -257,  -521,  -720,  -198,   134,   -46,  -182},
- {  -819, -1168,  -777,   512,   359,    95,  -113},
- {   137,    -2,   -74,  -138,  -401,  -114,  -371},
- {  -242,  -466,   204,   223,   -31,  -212,  -192},
- {  -532,  -637,  -466,  -686,   256,   277,  -139},
- { -1141, -1244,  -381,   -75,   -54,    14,    88},
- {  -311,   115,  -143,  -499,  -343,   124,  -416},
- {  -616,  -147,  -135,    43,    -4,   121,  -369},
- {   835,   783,   641,   390,   355,   350,    64},
- {    72,   194,   443,   467,   436,   219,   372},
- {   464,   369,   192,     4,  -156,   -72,  -226},
- {    57,   206,   303,   205,   188,   101,   265},
- {   -40,  -205,  -488,  -184,   276,    64,   -26},
- {  -217,  -433,  -297,   137,   328,   308,  -289},
- {   378,    81,  -308,  -465,    57,   -37,   227},
- {  -100,    24,   -36,  -151,   199,     8,   143},
- {  -426,  -697, -1059,  -133,   388,   161,   321},
- {  -644, -1023, -1271,    39,    66,  -123,    70},
- {   372,   177,  -173,  -556,  -553,  -304,  -189},
- {  -117,  -369,  -425,  -122,  -462,  -152,   -73},
- {  -649,  -850, -1189,  -767,   497,   360,   222},
- {  -798, -1139, -1455,  -190,   430,   234,   179},
- {    42,   -94,  -405,  -692,    38,  -202,  -246},
- {  -169,  -366,  -290,   -88,   -64,    32,  -292},
- {  1010,   923,   938,   710,   465,   230,   342},
- {   217,   300,  1054,   675,    68,  -458,  -179},
- {    78,   453,   316,    18,  -237,  -496,  -243},
- {   167,    21,   424,   215,   -91,  -303,  -170},
- {  -290,   -81,   -70,   -67,    40,    54,   -59},
- {  -353,  -427,   -90,    53,    94,     9,    54},
- {   -28,   318,   283,    15,  -240,   -58,    79},
- {   -75,  -121,   229,    35,    58,     6,  -133},
- {  -351,  -514,  -744,  -834,  -705,  -137,   164},
- { -1124, -1388, -1055,  -230,   -73,    40,    36},
- {  -163,  -233,  -532,  -785, -1170,  -697,    96},
- {  -788,  -959,  -246,  -430,  -624,  -165,    -8},
- {  -856,  -540,  -630,  -907,  -337,   -70,    76},
- {  -937, -1042,  -659,  -733,  -208,   199,   -26},
- {  -523,    78,   -98,  -501,  -869,  -890,   -81},
- {  -624,  -703,   -45,  -348,   -25,    87,  -186},
- {  1005,   823,   546,   249,    90,   -22,   207},
- {   298,   397,   381,   319,   200,    62,   303},
- {   473,   379,   133,  -247,  -632,  -441,    75},
- {   284,   208,   391,   115,   -25,    44,    95},
- {   -72,    79,   -95,   -63,  -129,  -293,   203},
- {  -164,  -349,   115,   122,    69,    -1,   378},
- {   348,   170,    99,    58,  -179,  -302,   188},
- {  -190,    -2,   150,    23,   -51,   -11,   216},
- {  -615,  -863, -1090, -1427,  -802,   -48,    -6},
- {  -961, -1276, -1548,  -727,   -58,    56,   223},
- {  -124,  -255,  -561,  -988, -1277,  -148,   -82},
- {  -480,  -660,  -891, -1191, -1339,  -325,    20},
- {  -621,  -917, -1296, -1350,   264,   289,    50},
- {  -844, -1022, -1345, -1329,  -293,    46,   278},
- {  -260,  -468,  -829, -1176,  -533,  -560,   -78},
- {  -215,  -484,  -822, -1233,  -791,    15,  -138},
- {  1301,  1317,  1262,  1048,   716,   357,   -64},
- {   578,   824,   925,   802,   630,   362,   102},
- {   470,   925,   767,   514,   327,   190,  -112},
- {   225,   492,   495,   437,   598,   384,   -45},
- {    43,    82,   -42,   175,   519,   342,   -64},
- {  -304,  -154,   159,   576,   403,   221,   327},
- {   214,   244,   122,   -62,   312,    92,  -160},
- {   218,   208,   310,   268,   306,   323,  -199},
- {  -285,  -269,   -79,  -124,  -143,  -153,   236},
- {  -205,  -384,  -426,   344,    59,  -185,  -184},
- {  -272,   247,   126,  -210,  -518,  -468,    78},
- {   -99,  -120,   502,   160,  -280,  -557,   304},
- {  -423,   -17,  -283,  -443,   215,   212,  -140},
- {  -564,  -684,  -228,   510,   361,   130,   323},
- {  -428,   335,    98,   -65,    36,  -215,  -246},
- {  -362,    51,   364,   -16,  -234,   150,  -165},
- {   914,   883,   751,   653,   676,   464,  -153},
- {   631,   545,   535,   720,   596,   360,   -81},
- {   783,   712,   512,   439,   341,   251,  -391},
- {   497,   417,   249,   372,   295,   173,  -193},
- {   128,  -110,  -385,    93,    39,   173,  -231},
- {   216,   -59,  -253,   462,   389,   154,    69},
- {   455,   270,    -4,  -337,   -49,   233,  -322},
- {   307,   143,    53,   218,   128,   236,  -156},
- {   -37,  -186,  -240,  -411,  -110,     9,   399},
- {  -140,  -365,  -628,   258,   380,   214,   277},
- {   131,   454,   177,  -285,  -520,   108,  -214},
- {    77,  -141,   201,  -123,  -490,  -131,    60},
- {   -14,  -194,  -521,  -741,   273,   362,   -33},
- {  -362,  -566,  -287,  -228,   161,   237,   317},
- {  -269,   195,   -75,  -375,  -204,    11,    77},
- {  -128,  -264,  -156,  -223,  -475,   265,    27},
- {  1238,  1147,   916,   689,   432,   210,  -280},
- {   800,   664,   879,   726,   411,   160,  -164},
- {   454,   686,   536,   275,   147,    46,   111},
- {   303,   486,   512,   355,   241,   181,   -69},
- {    79,    92,    29,   147,   233,    52,    17},
- {  -171,   289,   131,   439,   271,     3,   -10},
- {   413,   241,   144,   174,   155,    -2,    14},
- {    58,   217,   247,   219,   149,   175,   -18},
- {   228,    -8,  -240,  -206,  -513,  -191,   202},
- {   -96,  -272,  -454,    33,  -300,  -575,    46},
- {   -10,  -108,  -246,  -347,  -770,  -535,     9},
- {  -326,  -430,   -61,  -321,  -704,  -299,   201},
- {    -1,  -280,  -603,  -419,  -185,    18,   -36},
- {  -516,  -522,  -379,  -291,  -181,   -97,    27},
- {  -159,  -313,  -525,  -224,  -510,  -831,  -197},
- {  -292,  -459,   -59,  -310,  -562,  -143,  -351},
- {  1066,   912,   631,   389,   207,    86,  -224},
- {   596,   512,   596,   505,   314,   122,   -48},
- {   787,   861,   441,   -93,  -303,    33,  -190},
- {   257,   469,   337,    51,    15,   298,   -93},
- {   295,    73,  -119,    25,    36,    23,   108},
- {   -28,    -3,   -32,   114,    21,   185,   107},
- {   482,   305,    15,  -279,  -319,    52,    96},
- {   226,    46,   115,    72,  -136,   133,  -125},
- {    18,  -207,  -559,  -590,  -503,  -482,   321},
- {  -571,  -789,  -951,  -172,  -441,  -538,   113},
- {   181,    14,  -310,  -641, -1001,  -202,   159},
- {  -136,  -393,  -433,  -513,  -911,  -144,   -22},
- {    72,  -265,  -706,  -954,  -159,    53,   332},
- {  -338,  -591,  -852,  -383,  -395,    56,    44},
- {    43,  -158,  -464,  -897,  -631,  -157,  -294},
- {  -161,  -128,  -328,  -573,  -483,  -125,    11},
- {  1017,   906,  1051,  1005,   679,   341,  -102},
- {   359,   334,  1567,  1314,   723,   105,    10},
- {   -65,   726,   529,   301,   220,    43,  -273},
- {  -510,   436,   719,   566,   358,   179,   114},
- {  -560,   298,   133,  -120,   342,   225,    14},
- {  -899,  -101,   217,   617,   400,   146,   -58},
- {   -41,   352,    82,  -196,    39,   121,  -167},
- {  -212,    59,   447,   284,   423,   250,  -169},
- {  -371,  -484,  -596,    30,   -41,   249,    22},
- {  -372,  -650,  -794,   477,   445,   216,   -79},
- {  -352,   275,    17,  -443,  -929,    92,    19},
- {  -699,  -696,   431,   264,   -49,  -310,   182},
- {  -978,  -217,  -430,  -400,   101,   261,    72},
- {  -929,  -889,  -357,   -13,   463,   378,   236},
- {  -826,    56,    30,  -299,  -360,  -128,   -51},
- {  -878,  -299,  -111,    75,    65,    36,     3},
- {   817,   368,   -25,   354,   697,   591,  -173},
- {   309,   212,   222,   751,   484,   140,   -56},
- {   593,   379,    70,    -8,   258,   180,   110},
- {   165,   -46,   255,   297,   219,   273,   105},
- {   160,   -70,  -358,  -181,   379,   330,   319},
- {  -238,  -369,  -198,   740,   580,   319,  -143},
- {   201,   109,  -202,  -456,   328,   276,  -141},
- {   203,   170,   111,    42,   207,   360,   188},
- {  -345,  -399,  -513,  -233,   650,   422,    81},
- {  -635,  -961, -1220,   463,   539,   204,   209},
- {   202,   -25,  -194,  -498,  -787,   193,  -143},
- {  -449,  -538,   195,  -106,  -331,    68,    62},
- {  -228,  -477,  -840,  -576,   317,   128,   283},
- {  -671,  -937,  -807,  -114,   391,   335,   -62},
- {   246,     2,  -314,  -679,  -303,   180,   -88},
- {  -107,  -272,    90,  -198,   -28,   290,  -112},
- {   885,  1149,  1021,   712,   496,   281,   -83},
- {   269,   492,   787,   643,   347,    70,   124},
- {   336,   636,   499,    92,  -229,  -179,   191},
- {    26,   402,   564,   340,   149,   -11,   135},
- {  -440,   561,   470,   204,   -72,  -186,   140},
- {  -720,    14,   355,   229,    68,  -133,   465},
- {   110,   310,   103,    12,   106,    29,   158},
- {  -178,   113,   161,   142,   121,   115,    27},
- {  -651,  -414,  -645,  -152,  -164,   -13,  -429},
- {  -639,  -944,  -681,  -104,   -81,    52,  -189},
- {  -663,  -164,  -316,  -683,  -954,  -205,   -83},
- {  -609,  -669,  -172,  -517,  -694,   283,   -80},
- {  -646,  -152,  -383,  -678,  -246,   -40,  -143},
- {  -747,  -796,  -745,  -390,   -98,    43,   275},
- {  -599,  -199,  -398,  -433,  -436,  -538,    31},
- { -1107,  -568,  -376,  -265,  -126,   -21,     1},
- {   847,   573,   308,   392,   305,   101,    55},
- {   273,   293,   201,   267,   346,   201,   123},
- {   727,   480,   226,     2,   -65,  -138,   164},
- {   273,   208,   173,   292,    12,   253,   174},
- {   340,   207,   180,    88,   116,    46,   475},
- {  -460,  -166,   -30,    13,   110,   173,   396},
- {   137,    88,    43,  -137,   -94,    34,   284},
- {    96,   -14,   226,    40,    63,    70,   130},
- {  -467,  -735, -1012, -1174,  -307,   305,   -67},
- {  -612,  -920, -1146,  -567,    -8,    92,   -25},
- {  -182,  -271,  -492,  -754,  -857,   287,   -75},
- {  -494,  -787,  -689,  -683,  -709,   137,  -326},
- {  -288,  -550,  -903, -1105,   334,   321,   -62},
- {  -354,  -653,  -834,  -445,     1,   377,  -152},
- {  -162,  -306,  -608,  -937,  -297,   247,  -192},
- {  -234,  -477,  -244,  -488,  -266,   342,  -332}
-};
-
-static const int16_t dico21_isf[64][3] = {
- {   329,   409,   249}, {   -33,   505,   160},
- {   -29,   -14,   582}, {  -262,   127,   354},
- {   145,   237,   175}, {  -152,   245,   122},
- {    27,    42,   340}, {   -84,   -93,   311},
- {   285,   222,  -156}, {    47,   -43,  -504},
- {   234,   121,   385}, {   104,  -317,    45},
- {   176,   195,     8}, {   104,   -59,   -94},
- {   177,    53,   192}, {   -34,  -127,   152},
- {   570,   277,   -34}, {   -67,  -329,  -639},
- {  -157,  -272,   462}, {  -177,  -462,   198},
- {   322,   179,   115}, {  -386,   171,    19},
- {    19,   -12,   195}, {  -120,  -252,   201},
- {   304,    36,  -336}, {  -128,  -221,  -380},
- {   171,  -185,   296}, {  -242,  -312,    23},
- {   198,    39,    16}, {    -3,  -177,  -111},
- {   111,   -93,    76}, {   -92,  -223,     4},
- {   177,   406,   -44}, {  -168,   380,  -149},
- {    -4,   273,   331}, {  -420,   513,   277},
- {    21,   247,    47}, {   -58,   131,    -2},
- {    -3,   134,   180}, {  -145,    40,   175},
- {   189,    74,  -145}, {   -27,   -45,  -325},
- {   370,  -114,   -21}, {   -83,  -415,  -173},
- {    77,    95,   -51}, {   -40,   -30,   -67},
- {    71,    88,    86}, {   -35,   -98,    14},
- {    69,   197,  -334}, {  -196,    79,  -231},
- {  -348,  -137,   218}, {  -352,   -89,   -85},
- {    47,   201,  -130}, {  -165,    37,   -15},
- {   -43,     3,    86}, {  -161,  -108,    79},
- {    83,    21,  -237}, {   -81,  -149,  -238},
- {   150,  -186,  -251}, {  -186,  -249,  -162},
- {   -19,    66,  -139}, {   -26,   -50,  -181},
- {    24,    11,     0}, {  -130,  -105,   -98}
-};
-
-static const int16_t dico22_isf[128][3] = {
- {  -127,   310,    42}, {  -242,   197,     5},
- {  -151,    84,   -17}, {  -214,   127,  -149},
- {  -247,  -131,   159}, {  -268,  -267,   -95},
- {  -217,     1,   -79}, {  -271,   -80,  -185},
- {   -45,   436,   159}, {   165,   199,   391},
- {   -33,    81,   187}, {   -66,   -42,   355},
- {  -298,   -57,   343}, {  -108,  -537,   226},
- {  -144,   -23,   193}, {   176,  -402,    87},
- {    53,   296,    25}, {   -84,   253,  -104},
- {   -58,   105,  -126}, {  -169,   174,  -314},
- {   -48,    44,  -294}, {  -164,  -417,  -242},
- {  -139,     3,  -194}, {  -155,  -207,  -211},
- {   119,   322,   213}, {   333,    50,   380},
- {   237,   247,    -2}, {   466,   -16,   201},
- {   238,  -255,  -107}, {    67,  -440,  -149},
- {   122,   -88,  -139}, {    88,  -247,   -73},
- {   -41,   231,   167}, {   -62,   155,    16},
- {   -65,    16,    77}, {   -68,    -2,   -63},
- {  -151,  -300,   160}, {   -18,  -333,    54},
- {   -56,   -94,     5}, {     2,  -190,    14},
- {    92,   148,   209}, {   108,     9,   272},
- {   108,    35,   110}, {   142,   -85,   145},
- {    47,  -157,   279}, {     3,  -320,   246},
- {    43,   -72,    68}, {    86,  -217,   135},
- {    36,   140,    79}, {    56,   175,   -49},
- {    26,    45,     3}, {    73,    55,  -101},
- {   109,  -183,  -242}, {    -4,  -283,  -242},
- {    48,   -68,   -48}, {    -6,  -153,  -122},
- {   161,   196,    96}, {   232,    80,   190},
- {   165,    97,    11}, {   258,   -31,    71},
- {   267,   -77,   -91}, {   311,  -209,    87},
- {   152,   -14,   -22}, {   150,  -149,     9},
- {  -324,   557,   187}, {  -384,   307,    46},
- {  -251,    27,    77}, {  -365,    77,   -52},
- {  -482,   -84,   160}, {  -424,  -515,   -64},
- {  -294,  -120,    -4}, {  -476,  -116,  -109},
- {   -97,   318,   365}, {   106,   627,   445},
- {  -190,   120,   287}, {  -146,    65,   619},
- {  -427,   242,   363}, {  -361,  -371,   432},
- {  -347,   102,   168}, {  -629,   195,   -14},
- {   -65,   476,   -47}, {  -297,   320,  -168},
- {   -55,   356,  -264}, {  -391,    82,  -286},
- {   -51,   -31,  -556}, {  -178,  -399,  -586},
- {  -205,   -49,  -360}, {  -343,  -238,  -337},
- {   220,   457,    58}, {   561,   467,   259},
- {   340,   270,  -168}, {   450,    77,  -280},
- {    60,   167,  -413}, {   133,  -252,  -492},
- {   216,   157,  -290}, {   282,     0,  -495},
- {  -226,   293,   183}, {  -157,   135,   122},
- {  -158,   -59,    39}, {  -133,  -118,   -97},
- {  -332,  -309,   113}, {  -160,  -425,    -6},
- {  -149,  -211,    24}, {   -80,  -277,   -90},
- {   -11,   125,   338}, {   130,   -71,   465},
- {     5,   -45,   184}, {   237,   -95,   253},
- {  -139,  -197,   297}, {   -19,  -300,   511},
- {   -63,  -152,   139}, {   250,  -289,   336},
- {   124,   339,  -150}, {    34,   176,  -208},
- {   171,   166,  -116}, {    94,    38,  -229},
- {    75,   -65,  -339}, {   -78,  -205,  -385},
- {     0,   -30,  -163}, {   -56,  -110,  -242},
- {   321,   244,   194}, {   505,   238,    -1},
- {   317,   116,    65}, {   309,    88,   -74},
- {   452,   -51,   -50}, {   334,  -217,  -290},
- {   211,    41,  -152}, {   238,   -55,  -260}
-};
-
-static const int16_t dico23_isf[128][3] = {
- {   -10,   151,   359}, {   136,   298,   223},
- {   255,  -104,   290}, {   423,     6,   183},
- {  -270,  -269,   -98}, {   -52,   -82,    13},
- {   -82,  -274,   -97}, {    90,  -246,   -72},
- {  -299,   -70,   421}, {   -88,   365,   430},
- {   187,  -318,   381}, {   380,    37,   488},
- {  -373,  -316,    79}, {  -308,  -101,     5},
- {  -135,  -451,     8}, {    72,  -421,  -154},
- {   180,   170,  -121}, {    62,   177,   -40},
- {   326,    80,  -105}, {   248,   263,    -5},
- {  -168,  -181,  -221}, {    -2,   -23,  -158},
- {   -14,  -149,  -121}, {   119,   -91,  -147},
- {   119,   332,  -153}, {    49,   303,    34},
- {   442,   -55,   -69}, {   217,   454,    58},
- {  -359,  -187,  -375}, {   -42,    50,  -274},
- {    -8,  -267,  -249}, {    85,   -86,  -346},
- {   -77,   -40,   345}, {    89,   134,   219},
- {   156,   -80,   160}, {   108,    40,   116},
- {  -158,  -206,    29}, {     5,   -32,   175},
- {   -65,  -158,   146}, {    55,   -78,    73},
- {  -114,  -222,   353}, {   -47,    81,   211},
- {    49,  -151,   268}, {   105,     4,   302},
- {  -263,  -132,   183}, {  -151,   -28,   201},
- {  -177,  -307,   166}, {   101,  -221,   130},
- {    74,    58,   -98}, {    32,    44,    13},
- {   194,    30,  -142}, {   170,    96,     8},
- {  -136,  -119,   -91}, {   -65,     8,   -55},
- {     3,  -188,    12}, {    45,   -63,   -49},
- {   149,   -21,   -19}, {    24,   144,    95},
- {   254,   -22,    60}, {   161,   196,    96},
- {  -158,   -61,    48}, {   -70,    33,    82},
- {   -23,  -321,    58}, {   155,  -147,     5},
- {  -364,   328,    77}, {   -21,   453,   173},
- {  -108,    82,   630}, {   367,   263,   208},
- {  -300,   -62,  -176}, {  -205,   143,  -158},
- {  -169,  -410,  -264}, {   257,  -269,  -100},
- {  -636,   289,    -2}, {  -292,   627,   173},
- {  -382,  -363,   387}, {   248,   524,   447},
- {  -521,  -111,  -107}, {  -395,   118,  -274},
- {  -343,  -680,  -125}, {  -172,  -447,  -663},
- {    75,   148,  -367}, {   -79,   263,   -94},
- {   249,   148,  -286}, {   380,   271,  -162},
- {  -142,    -4,  -186}, {   -57,   111,  -125},
- {   -35,  -108,  -254}, {   100,    29,  -242},
- {   -80,   303,  -264}, {   -78,   464,   -57},
- {   248,   -22,  -494}, {   661,   662,    44},
- {  -193,   -40,  -330}, {  -178,   145,  -337},
- {   -90,  -199,  -400}, {   -40,   -23,  -498},
- {  -192,   114,   315}, {   -41,   244,   190},
- {    88,   -97,   485}, {   241,    80,   212},
- {  -246,    40,    87}, {  -156,   147,   134},
- {    -2,  -334,   239}, {   308,  -203,   110},
- {  -459,   251,   422}, {  -218,   310,   228},
- {   -86,  -346,   654}, {   184,   175,   425},
- {  -481,   -63,   169}, {  -349,   117,   188},
- {  -125,  -560,   310}, {   158,  -416,    94},
- {    46,   171,  -192}, {   -63,   157,    14},
- {   256,   -35,  -271}, {   322,   123,    53},
- {  -214,     4,   -76}, {  -156,    86,   -18},
- {   128,  -197,  -232}, {   265,   -90,   -98},
- {  -308,   332,  -145}, {  -131,   308,    58},
- {   509,    59,  -339}, {   562,   196,   -14},
- {  -378,   100,   -47}, {  -234,   202,     1},
- {   104,  -270,  -493}, {   319,  -210,  -325}
-};
-
-static const int16_t dico24_isf[32][3] = {
- {   -79,   -89,    -4}, {  -171,    77,  -211},
- {   160,  -193,    98}, {   120,  -103,   323},
- {    32,   -22,  -129}, {    72,    78,  -268},
- {   182,   -76,   -66}, {   309,    99,  -145},
- {  -229,  -157,   -84}, {  -383,    98,   -71},
- {   -90,  -352,    12}, {  -284,  -178,   178},
- {   -65,  -125,  -166}, {   -87,  -175,  -351},
- {    42,  -198,   -48}, {   154,  -140,  -243},
- {   -77,    18,   108}, {   -39,   355,    91},
- {    87,     8,   155}, {    -4,   158,   239},
- {   128,    95,   -54}, {     7,   246,  -124},
- {   258,    15,    89}, {   206,   216,    98},
- {  -201,     9,    18}, {  -312,   233,   204},
- {   -39,  -174,   155}, {  -144,    -9,   284},
- {   -57,    70,   -69}, {  -157,   187,    18},
- {    54,   -30,    23}, {    24,   135,    55}
-};
-
-static const int16_t dico25_isf[32][4] = {
- {   169,   142,  -119,   115}, {   206,   -20,    94,   226},
- {  -106,   313,   -21,    16}, {   -62,   161,    71,   255},
- {   -89,   101,  -185,   125}, {    72,   -30,  -201,   344},
- {  -258,    33,    -8,    81}, {  -104,  -154,    72,   296},
- {   144,   -68,  -268,   -25}, {    81,   -78,   -87,   106},
- {    22,   155,  -186,  -119}, {   -46,   -28,    27,    91},
- {  -114,   -37,  -175,   -33}, {   -94,  -222,  -189,   122},
- {  -132,  -119,  -191,  -270}, {  -172,  -173,    18,   -43},
- {   279,   135,   -42,  -128}, {   187,   -86,   229,  -138},
- {   159,   240,   140,    46}, {    69,    25,   227,    77},
- {    21,   115,    13,     8}, {    68,  -248,   126,    81},
- {  -150,   137,   207,    -9}, {  -154,  -133,   289,    67},
- {   143,   -37,   -86,  -326}, {   180,   -32,    19,   -23},
- {    26,   168,   116,  -233}, {   -32,   -26,   118,   -78},
- {     3,    -8,   -45,  -115}, {    57,  -215,   -54,   -83},
- {  -209,   112,   -22,  -167}, {   -91,  -151,   168,  -262}
-};
-
-static const int16_t dico21_isf_36b[128][5] = {
- {   -52,   -96,   212,   315,   -73}, {    82,  -204,   363,   136,  -197},
- {  -126,  -331,   183,   218,   143}, {   -49,   -41,   557,   230,    72},
- {     2,   -73,   163,   377,   221}, {   133,   111,   278,   215,  -110},
- {  -102,   -20,   284,   113,   273}, {    84,   319,   290,    18,    85},
- {   -25,    -5,   125,   132,  -204}, {   -38,    -5,   286,    -9,  -356},
- {  -140,  -256,    92,   117,  -189}, {  -144,   191,   313,    51,   -98},
- {   167,   -10,    44,   247,    36}, {   381,   197,   238,    74,     6},
- {    38,  -408,    29,    -3,   -85}, {    92,   266,   157,   -25,  -200},
- {   161,  -121,    70,    84,  -140}, {   -16,   -86,   112,   -94,  -189},
- {  -269,  -270,   351,   107,   -24}, {   -68,   -67,   492,  -103,  -155},
- {   -53,  -131,    62,   122,    10}, {   135,    84,   283,   -55,  -120},
- {   -12,  -219,   331,   -81,   167}, {   220,  -136,   147,  -172,   -42},
- {   140,   -95,  -109,   -88,  -194}, {     0,    -2,    -4,   -33,  -381},
- {   -66,  -217,   152,  -186,  -402}, {   244,   108,   156,  -140,  -395},
- {   113,  -136,  -196,   110,   -24}, {   214,   118,    11,   -64,  -131},
- {  -110,  -286,    -6,  -332,    16}, {    94,    97,    79,  -291,  -205},
- {    -5,   -39,   -20,   252,   -96}, {    76,   174,   101,   163,    61},
- {   -69,  -239,   -55,   399,     6}, {  -115,   319,   164,   275,   196},
- {   -15,    36,   -47,   331,   121}, {   226,   209,   271,   325,   184},
- {    13,   -80,  -218,   471,   353}, {   288,   378,    16,   -51,   251},
- {   174,   116,    52,   149,  -279}, {   235,   276,    39,   120,   -48},
- {     0,  -108,  -108,   241,  -339}, {   -93,   534,    45,    33,   -87},
- {   194,   149,   -71,   405,   -44}, {   409,   370,    81,  -186,  -154},
- {    25,  -102,  -448,   124,  -173}, {    22,   408,  -110,  -310,  -214},
- {   -26,    23,   -83,   114,    14}, {  -110,   164,    52,   223,   -82},
- {    37,   -25,  -263,   306,   -15}, {  -466,   415,   292,   165,   -18},
- {    29,   -19,  -171,   155,   182}, {   179,   144,   -27,   231,   258},
- {  -103,  -247,  -396,   238,   113}, {   375,  -154,  -109,    -4,   156},
- {    98,    85,  -292,    -5,  -124}, {   116,   139,  -116,   -98,  -294},
- {   -14,   -83,  -278,  -117,  -378}, {   106,    33,  -106,  -344,  -484},
- {   119,    17,  -412,   138,   166}, {   384,   101,  -204,    88,  -156},
- {  -121,  -284,  -300,    -1,  -166}, {   280,    33,  -152,  -313,   -81},
- {   -37,    22,   229,   153,    37}, {   -60,   -83,   236,    -8,   -41},
- {  -169,  -228,   126,   -20,   363}, {  -235,    17,   364,  -156,   156},
- {   -25,   -30,    72,   144,   156}, {   153,   -26,   256,    97,   144},
- {   -21,   -37,    48,   -65,   250}, {    63,    77,   273,  -128,   124},
- {  -129,   -26,    40,     9,  -115}, {    -6,    82,    38,   -90,  -182},
- {  -336,   -13,    28,   158,    91}, {   -30,   241,   137,  -170,   -17},
- {   146,    14,   -11,    33,    61}, {   192,   197,    54,   -84,    85},
- {    23,  -200,   -78,   -29,   140}, {   122,   237,   106,  -341,   136},
- {   -57,  -142,   -85,   -16,   -74}, {   -59,   -90,    -8,  -187,   -20},
- {  -211,  -267,   216,  -179,  -110}, {   -50,    -7,   220,  -267,   -70},
- {   -57,   -42,   -17,   -15,    71}, {    32,    21,    63,  -137,    33},
- {  -137,  -175,   104,   -68,    97}, {   -67,   -43,   133,  -301,   221},
- {  -116,  -200,   -81,   -92,  -272}, {   -64,   -41,   -54,  -244,  -220},
- {  -287,  -242,   -50,   -87,   -89}, {  -245,   236,   102,  -166,  -295},
- {    66,    24,  -162,   -71,    95}, {    66,   136,   -90,  -220,   -36},
- {   -98,  -161,  -222,  -188,    29}, {   -18,    18,   -19,  -415,     9},
- {    49,    61,   100,    39,   -56}, {  -111,    82,   135,   -31,    52},
- {   -90,  -153,   -93,   189,   182}, {  -214,   295,   119,   -74,   284},
- {     2,   137,    37,    47,   182}, {    92,   117,   184,   -53,   373},
- {   -21,   -14,   -35,   136,   391}, {   146,   129,  -164,   -28,   333},
- {    92,    80,   -84,   100,  -134}, {    -8,   217,   -32,     3,   -47},
- {  -151,   251,  -215,   142,    92}, {  -224,   310,  -172,  -275,    98},
- {   159,   155,  -177,   112,    53}, {   205,    27,     8,  -240,   192},
- {   169,   120,  -319,  -201,   106}, {    11,    36,   -86,  -237,   455},
- {  -109,  -154,  -163,   174,   -55}, {   -38,    32,  -101,   -78,   -59},
- {  -205,  -321,   -97,    69,    79}, {  -310,    44,    18,  -185,    34},
- {  -115,   -20,  -148,   -39,   203}, {   -29,   154,   -30,  -158,   166},
- {   -45,  -131,  -317,   -24,   363}, {  -165,  -205,  -112,  -222,   265},
- {   -32,   -44,  -150,    54,  -193}, {    -6,   -38,  -255,  -169,  -115},
- {  -266,    87,  -189,   -36,  -169}, {   -60,   -87,  -266,  -436,  -170},
- {   -68,   -81,  -278,    24,    38}, {   -23,   -19,  -155,  -256,   141},
- {   -61,  -226,  -565,  -175,    71}, {     9,   -29,  -237,  -515,   263}
-};
-
-static const int16_t dico22_isf_36b[128][4] = {
- {  -298,    -6,    95,    31}, {  -213,   -87,  -122,   261},
- {     4,   -49,   208,    14}, {  -129,  -110,    30,   118},
- {  -214,   258,   110,  -235}, {   -41,   -18,  -126,   120},
- {   103,    65,   127,   -37}, {   126,   -36,   -24,    25},
- {  -138,   -67,  -278,  -186}, {  -164,  -194,  -201,    78},
- {  -211,   -87,   -51,  -221}, {  -174,   -79,   -94,   -39},
- {    23,    -6,  -157,  -240}, {    22,  -110,  -153,   -68},
- {   148,    -5,    -2,  -149}, {    -1,  -135,   -39,  -179},
- {    68,   360,  -117,   -15}, {   137,    47,  -278,   146},
- {   136,   260,   135,    65}, {    61,   116,   -45,    97},
- {   231,   379,    87,  -120}, {   338,   177,  -272,     3},
- {   266,   156,    28,   -69}, {   260,    84,   -85,    86},
- {  -266,   154,  -256,  -182}, {   -17,   -65,  -304,    -6},
- {   -40,   175,  -151,  -180}, {   -27,    27,   -87,   -63},
- {   121,   114,  -166,  -469}, {   159,   -66,  -323,  -231},
- {   214,   152,  -141,  -212}, {   137,    36,  -184,   -51},
- {  -282,  -237,    40,    10}, {   -48,  -235,   -37,   251},
- {   -54,  -323,   136,    29}, {   -88,  -174,   213,   198},
- {  -390,    99,   -63,  -375}, {   107,  -169,  -164,   424},
- {    69,  -111,   141,  -167}, {    74,  -129,    65,   144},
- {  -353,  -207,  -205,  -109}, {  -160,  -386,  -355,    98},
- {  -176,  -493,   -20,  -143}, {  -252,  -432,    -2,   216},
- {   -90,  -174,  -168,  -411}, {    13,  -284,  -229,  -160},
- {   -87,  -279,    34,  -251}, {   -75,  -263,   -58,   -42},
- {   420,    53,  -211,  -358}, {   384,   -35,  -374,   396},
- {    68,  -228,   323,    -2}, {   167,  -307,   192,   194},
- {   459,   329,    -5,  -332}, {   375,    79,    -7,   313},
- {   282,  -124,   200,   -92}, {   271,  -162,   -70,   180},
- {  -157,  -298,  -514,  -309}, {    58,  -163,  -546,    18},
- {   124,  -364,   167,  -238}, {    83,  -411,  -117,    96},
- {   140,  -112,  -388,  -624}, {   259,  -133,  -317,    41},
- {   163,  -130,   -64,  -334}, {   226,  -165,  -124,  -110},
- {  -466,   -61,     6,   229}, {  -153,   205,  -145,   242},
- {  -159,    48,   195,   148}, {   -58,    28,    31,   279},
- {  -303,   185,   279,    -4}, {   -61,   197,    59,    86},
- {  -114,   123,   168,   -52}, {    35,    36,   100,   126},
- {  -407,   102,   -77,   -40}, {  -338,    -1,  -342,   156},
- {  -179,   105,   -34,   -97}, {  -185,    84,   -35,   108},
- {  -133,   107,   -91,  -357}, {  -180,    54,  -229,    24},
- {   -44,    47,    47,  -182}, {   -66,    13,    45,     4},
- {  -339,   251,    64,   226}, {   -42,   101,  -350,   275},
- {   -99,   398,   142,   121}, {   111,    12,  -102,   260},
- {     0,   505,   260,   -94}, {   161,   285,   -96,   224},
- {    -4,   206,   314,    33}, {   167,   139,    88,   204},
- {  -235,   316,   -60,   -25}, {    -8,  -150,  -312,   201},
- {   -36,   292,    61,  -104}, {   -40,   174,  -162,    42},
- {   -21,   402,   -29,  -351}, {    21,   152,  -360,   -93},
- {    57,   191,   212,  -196}, {    76,   158,   -21,   -69},
- {  -328,  -185,   331,   119}, {   -53,   285,    56,   337},
- {  -107,   -24,   405,    29}, {   -18,   137,   272,   277},
- {  -255,    22,   173,  -191}, {   295,   322,   325,   302},
- {    21,   -27,   332,  -178}, {   119,    13,   271,   129},
- {  -455,  -180,   116,  -191}, {  -227,    62,  -148,   524},
- {  -176,  -287,   282,  -157}, {  -243,    13,   199,   430},
- {   -59,   -49,   115,  -365}, {    72,  -172,  -137,    93},
- {  -138,  -126,   141,   -84}, {     5,  -124,    38,   -20},
- {  -258,   311,   601,   213}, {    94,   130,   -61,   502},
- {    -1,  -157,   485,   313}, {   146,   -74,   158,   345},
- {   276,   135,   280,   -57}, {   490,   252,    99,    43},
- {   267,   -74,   429,   105}, {   278,   -23,   119,    94},
- {  -542,   488,   257,  -115}, {   -84,  -244,  -438,   478},
- {  -113,  -545,   387,   101}, {   -95,  -306,   111,   498},
- {    95,   166,    22,  -301}, {   420,   -15,   -58,   -78},
- {   270,    29,   122,  -282}, {   160,  -240,    50,   -38}
-};
-
-static const int16_t dico23_isf_36b[64][7] = {
- {    81,   -18,    68,   -27,  -122,  -280,    -4},
- {    45,  -177,   209,   -30,  -136,   -74,   131},
- {   -44,   101,   -75,   -88,   -48,  -137,   -54},
- {  -245,   -28,    63,   -18,  -112,  -103,    58},
- {   -79,    -6,   220,   -65,   114,   -35,   -50},
- {   109,   -65,   143,  -114,   129,    76,   125},
- {   166,    90,   -61,  -242,   186,   -74,   -43},
- {   -46,   -92,    49,  -227,    24,  -155,    39},
- {    67,    85,    99,   -42,    53,  -184,  -281},
- {   142,  -122,     0,    21,  -142,   -15,   -17},
- {   223,    92,   -21,   -48,   -82,   -14,  -167},
- {    51,   -37,  -243,   -30,   -90,    18,   -56},
- {    54,   105,    74,    86,    69,    13,  -101},
- {   196,    72,   -89,    43,    65,    19,    39},
- {   121,    34,   131,   -82,    25,   213,  -156},
- {   101,  -102,  -136,   -21,    57,   214,    22},
- {    36,  -124,   205,   204,    58,  -156,   -83},
- {    83,  -117,   137,   137,    85,   116,    44},
- {   -92,  -148,   -68,    11,  -102,  -197,  -220},
- {   -76,  -185,   -58,   132,   -26,  -183,    85},
- {    -7,   -31,    -2,    23,   205,  -151,    10},
- {   -27,   -37,    -5,   -18,   292,   131,     1},
- {   117,  -168,     9,   -93,    80,   -59,  -125},
- {  -182,  -244,    98,   -24,   135,   -22,    94},
- {   221,    97,   106,    42,    43,  -160,    83},
- {    25,   -64,   -21,     6,    14,   -15,   154},
- {   126,    15,  -140,   150,   -10,  -207,  -114},
- {    79,   -63,  -211,   -70,   -28,  -217,   165},
- {    46,    38,   -22,   281,   132,   -62,   109},
- {   112,    54,  -112,   -93,   208,    27,   296},
- {   115,    10,  -147,    41,   216,    42,  -276},
- {    50,  -115,  -254,   167,   117,    -2,    61},
- {    17,   144,    34,   -72,  -186,  -150,   272},
- {   -29,   -66,   -89,   -95,  -149,   129,   251},
- {   122,     0,   -50,  -234,   -91,    36,    26},
- {  -105,  -102,   -88,  -121,  -236,    -7,   -11},
- {  -204,   109,     5,  -191,   105,   -15,   163},
- {   -80,    32,   -24,  -209,    41,   294,    70},
- {  -106,   -94,  -204,  -118,   120,   -50,   -37},
- {   -82,  -241,    46,  -131,   -29,   150,   -55},
- {    33,   155,   120,   -89,    -8,     7,    62},
- {   213,    82,    61,    18,  -161,   144,   152},
- {    30,   131,    65,   -87,  -255,   -17,  -107},
- {    -8,    85,   -64,    51,  -162,   223,   -53},
- {  -134,   261,    69,   -56,   218,    72,  -111},
- {     2,   155,  -113,   -87,    49,    85,   -28},
- {  -163,    42,    -1,  -196,     7,    39,  -245},
- {    14,  -137,   -79,    11,  -160,   202,  -293},
- {   -94,    33,   208,   100,    56,   -44,   326},
- {   -78,   -41,   232,    13,  -142,   227,    80},
- {   -16,   -87,   201,    33,  -133,    15,  -183},
- {   -58,  -192,   -47,   184,  -128,   133,    99},
- {  -205,    11,  -155,    78,    52,    72,   141},
- {  -246,    26,    99,   151,    59,   115,   -64},
- {   -79,   -47,   -16,   -14,     6,    47,   -43},
- {   -72,  -178,   -27,   162,   112,    43,  -174},
- {  -175,   238,   186,    71,   -54,  -188,   -76},
- {  -225,   233,    39,   -39,  -158,   122,    44},
- {   -26,    43,    84,   130,   -93,   -51,    22},
- {     3,    92,  -150,   136,  -182,   -57,    97},
- {  -131,   179,   -78,    80,    91,  -165,    90},
- {    -2,   148,    15,   130,    65,   175,   117},
- {  -138,   114,  -137,   132,     3,   -10,  -186},
- {   140,    -4,   -37,   254,   -62,    92,  -109}
-};
-
-/** Means of ISF vectors in Q15 */
-static const int16_t isf_mean[LP_ORDER] = {
-   738,  1326,  2336,  3578,  4596,  5662,  6711,  7730,
-  8750,  9753, 10705, 11728, 12833, 13971, 15043,  4037
-};
-
-/** Initialization tables for the processed ISF vector in Q15 */
-static const int16_t isf_init[LP_ORDER] = {
-  1024,  2048,  3072,  4096,  5120,  6144,  7168, 8192,
-  9216, 10240, 11264, 12288, 13312, 14336, 15360, 3840
-};
-
-/** ISF/ISP interpolation coefficients for each subframe */
-static const float isfp_inter[4] = { 0.45, 0.8, 0.96, 1.0 };
-
-/** Coefficients for FIR interpolation of excitation vector
- * at pitch lag resulting the adaptive codebook vector */
-static const float ac_inter[65] = {
-     9.400024e-01,
-     8.563843e-01,  6.322632e-01,  3.375854e-01,  5.908203e-02,
-    -1.310425e-01, -1.994019e-01, -1.585693e-01, -5.633545e-02,
-     4.760742e-02,  1.067505e-01,  1.036987e-01,  5.206299e-02,
-    -1.519775e-02, -6.372070e-02, -7.366943e-02, -4.650879e-02,
-    -9.765625e-04,  3.820801e-02,  5.316162e-02,  4.003906e-02,
-     9.338379e-03, -2.166748e-02, -3.778076e-02, -3.320312e-02,
-    -1.300049e-02,  1.068115e-02,  2.587891e-02,  2.630615e-02,
-     1.379395e-02, -3.662109e-03, -1.678467e-02, -1.983643e-02,
-    -1.275635e-02, -5.493164e-04,  1.007080e-02,  1.409912e-02,
-     1.068115e-02,  2.624512e-03, -5.371094e-03, -9.338379e-03,
-    -8.117676e-03, -3.173828e-03,  2.319336e-03,  5.615234e-03,
-     5.554199e-03,  2.868652e-03, -6.103516e-04, -2.990723e-03,
-    -3.356934e-03, -2.014160e-03, -1.220703e-04,  1.342773e-03,
-     1.708984e-03,  1.159668e-03,  2.441406e-04, -4.272461e-04,
-    -6.103516e-04, -4.272461e-04, -1.220703e-04,  6.103516e-05,
-     1.220703e-04,  6.103516e-05,  0.000000e+00,  0.000000e+00
-};
-
-/** [i][j] is the number of pulses present in track j at mode i */
-static const uint8_t pulses_nb_per_mode_tr[][4] = {
-    {1, 1, 0, 0}, {1, 1, 1, 1}, {2, 2, 2, 2},
-    {3, 3, 2, 2}, {3, 3, 3, 3}, {4, 4, 4, 4},
-    {5, 5, 4, 4}, {6, 6, 6, 6}, {6, 6, 6, 6}
-};
-
-/** Tables for decoding quantized gains { pitch (Q14), fixed factor (Q11) } */
-static const int16_t qua_gain_6b[64][2] = {
-    {  1566,  1332},    {  1577,  3557},
-    {  3071,  6490},    {  4193, 10163},
-    {  4496,  2534},    {  5019,  4488},
-    {  5586, 15614},    {  5725,  1422},
-    {  6453,   580},    {  6724,  6831},
-    {  7657,  3527},    {  8072,  2099},
-    {  8232,  5319},    {  8827,  8775},
-    {  9740,  2868},    {  9856,  1465},
-    { 10087, 12488},    { 10241,  4453},
-    { 10859,  6618},    { 11321,  3587},
-    { 11417,  1800},    { 11643,  2428},
-    { 11718,   988},    { 12312,  5093},
-    { 12523,  8413},    { 12574, 26214},
-    { 12601,  3396},    { 13172,  1623},
-    { 13285,  2423},    { 13418,  6087},
-    { 13459, 12810},    { 13656,  3607},
-    { 14111,  4521},    { 14144,  1229},
-    { 14425,  1871},    { 14431,  7234},
-    { 14445,  2834},    { 14628, 10036},
-    { 14860, 17496},    { 15161,  3629},
-    { 15209,  5819},    { 15299,  2256},
-    { 15518,  4722},    { 15663,  1060},
-    { 15759,  7972},    { 15939, 11964},
-    { 16020,  2996},    { 16086,  1707},
-    { 16521,  4254},    { 16576,  6224},
-    { 16894,  2380},    { 16906,   681},
-    { 17213,  8406},    { 17610,  3418},
-    { 17895,  5269},    { 18168, 11748},
-    { 18230,  1575},    { 18607, 32767},
-    { 18728, 21684},    { 19137,  2543},
-    { 19422,  6577},    { 19446,  4097},
-    { 19450,  9056},    { 20371, 14885}
-};
-
-static const int16_t qua_gain_7b[128][2] = {
-    {   204,   441},    {   464,  1977},
-    {   869,  1077},    {  1072,  3062},
-    {  1281,  4759},    {  1647,  1539},
-    {  1845,  7020},    {  1853,   634},
-    {  1995,  2336},    {  2351, 15400},
-    {  2661,  1165},    {  2702,  3900},
-    {  2710, 10133},    {  3195,  1752},
-    {  3498,  2624},    {  3663,   849},
-    {  3984,  5697},    {  4214,  3399},
-    {  4415,  1304},    {  4695,  2056},
-    {  5376,  4558},    {  5386,   676},
-    {  5518, 23554},    {  5567,  7794},
-    {  5644,  3061},    {  5672,  1513},
-    {  5957,  2338},    {  6533,  1060},
-    {  6804,  5998},    {  6820,  1767},
-    {  6937,  3837},    {  7277,   414},
-    {  7305,  2665},    {  7466, 11304},
-    {  7942,   794},    {  8007,  1982},
-    {  8007,  1366},    {  8326,  3105},
-    {  8336,  4810},    {  8708,  7954},
-    {  8989,  2279},    {  9031,  1055},
-    {  9247,  3568},    {  9283,  1631},
-    {  9654,  6311},    {  9811,  2605},
-    { 10120,   683},    { 10143,  4179},
-    { 10245,  1946},    { 10335,  1218},
-    { 10468,  9960},    { 10651,  3000},
-    { 10951,  1530},    { 10969,  5290},
-    { 11203,  2305},    { 11325,  3562},
-    { 11771,  6754},    { 11839,  1849},
-    { 11941,  4495},    { 11954,  1298},
-    { 11975, 15223},    { 11977,   883},
-    { 11986,  2842},    { 12438,  2141},
-    { 12593,  3665},    { 12636,  8367},
-    { 12658,  1594},    { 12886,  2628},
-    { 12984,  4942},    { 13146,  1115},
-    { 13224,   524},    { 13341,  3163},
-    { 13399,  1923},    { 13549,  5961},
-    { 13606,  1401},    { 13655,  2399},
-    { 13782,  3909},    { 13868, 10923},
-    { 14226,  1723},    { 14232,  2939},
-    { 14278,  7528},    { 14439,  4598},
-    { 14451,   984},    { 14458,  2265},
-    { 14792,  1403},    { 14818,  3445},
-    { 14899,  5709},    { 15017, 15362},
-    { 15048,  1946},    { 15069,  2655},
-    { 15405,  9591},    { 15405,  4079},
-    { 15570,  7183},    { 15687,  2286},
-    { 15691,  1624},    { 15699,  3068},
-    { 15772,  5149},    { 15868,  1205},
-    { 15970,   696},    { 16249,  3584},
-    { 16338,  1917},    { 16424,  2560},
-    { 16483,  4438},    { 16529,  6410},
-    { 16620, 11966},    { 16839,  8780},
-    { 17030,  3050},    { 17033, 18325},
-    { 17092,  1568},    { 17123,  5197},
-    { 17351,  2113},    { 17374,   980},
-    { 17566, 26214},    { 17609,  3912},
-    { 17639, 32767},    { 18151,  7871},
-    { 18197,  2516},    { 18202,  5649},
-    { 18679,  3283},    { 18930,  1370},
-    { 19271, 13757},    { 19317,  4120},
-    { 19460,  1973},    { 19654, 10018},
-    { 19764,  6792},    { 19912,  5135},
-    { 20040,  2841},    { 21234, 19833}
-};
-
-/** 4-tap moving average prediction coefficients in reverse order */
-static const float energy_pred_fac[4] = { 0.2, 0.3, 0.4, 0.5 };
-
-/** impulse response filter tables converted to float from Q15
- * used for anti-sparseness processing */
-static const float ir_filter_str[64] = {
-     6.159058e-01,  2.958069e-01,  9.979248e-02, -1.048889e-01,
-     8.740234e-02, -1.599121e-01,  4.849243e-02, -4.141235e-02,
-     1.831055e-02,  1.188049e-01, -4.568481e-02, -2.130127e-02,
-     3.671265e-02, -1.601868e-01,  3.659058e-02,  1.639099e-01,
-    -4.541016e-02, -2.151489e-02, -8.810425e-02,  6.030273e-02,
-     2.740479e-02,  2.200317e-02, -1.182861e-01,  1.289978e-01,
-    -1.560059e-01,  1.953125e-01, -3.149414e-02, -1.441956e-01,
-     1.249084e-01, -1.328125e-01,  9.780884e-02,  6.500244e-02,
-    -6.091309e-02, -5.599976e-02,  8.081055e-02, -5.450439e-02,
-    -1.239014e-02,  1.748657e-02,  7.580566e-02, -1.101074e-01,
-     9.579468e-02, -4.159546e-02, -7.830811e-02,  1.162109e-01,
-    -1.950073e-02, -6.259155e-02, -1.651001e-02,  7.250977e-02,
-     1.199951e-01, -1.911011e-01,  4.370117e-02, -1.098938e-01,
-     1.492004e-01,  1.129150e-02,  1.730347e-02, -3.549194e-02,
-    -8.709717e-02,  5.841064e-02,  1.190186e-03, -7.379150e-02,
-     1.054077e-01,  9.078979e-02, -1.227112e-01,  1.047058e-01
-};
-
-static const float ir_filter_mid[64] = {
-     7.354126e-01,  3.192139e-01, -1.606140e-01, -2.328491e-02,
-     6.250000e-02, -2.828979e-02,  5.349731e-02, -1.014099e-01,
-     6.750488e-02,  1.989746e-02, -6.549072e-02,  7.589722e-02,
-    -1.080017e-01,  1.253967e-01, -6.430054e-02, -1.141357e-02,
-    -1.910400e-02,  1.303101e-01, -1.673889e-01,  6.820679e-02,
-     5.670166e-02, -8.450317e-02,  2.270508e-02,  3.479004e-02,
-    -2.328491e-02, -4.928589e-02,  1.239014e-01, -1.395874e-01,
-     9.100342e-02, -3.549194e-02,  2.230835e-02, -3.350830e-02,
-     2.450562e-02,  5.096436e-03, -2.178955e-02,  1.849365e-02,
-    -1.708984e-02,  1.950073e-02,  1.312256e-03, -5.389404e-02,
-     9.851074e-02, -8.489990e-02,  2.029419e-02,  2.328491e-02,
-     7.110596e-03, -6.109619e-02,  3.939819e-02,  5.709839e-02,
-    -1.058960e-01,  3.149414e-02,  8.270264e-02, -1.232910e-01,
-     1.105957e-01, -1.286011e-01,  1.614990e-01, -1.303101e-01,
-     4.769897e-02,  3.295898e-03, -1.770020e-02,  5.010986e-02,
-    -7.501221e-02,  2.920532e-02,  1.660156e-02,  7.751465e-02
-};
-
-static const float *ir_filters_lookup[2] = {
-    ir_filter_str, ir_filter_mid
-};
-
-/** High-pass filters coefficients for 31 Hz and 400 Hz cutoff */
-static const float hpf_zeros[2]     = { -2.0, 1.0 };
-static const float hpf_31_poles[2]  = { -1.978881836, 0.979125977 };
-static const float hpf_31_gain      = 0.989501953;
-
-static const float hpf_400_poles[2] = { -1.787109375, 0.864257812 };
-static const float hpf_400_gain     = 0.893554687;
-
-/** Interpolation coefficients for 5/4 signal upsampling
- * Table from the reference source was reordered for efficiency */
-static const float upsample_fir[4][24] = {
-    { -6.103516e-05,  7.324219e-04, -2.014160e-03,  4.150391e-03,
-      -7.263184e-03,  1.165771e-02, -1.776123e-02,  2.624512e-02,
-      -3.869629e-02,  5.877686e-02, -9.863281e-02,  2.314453e-01,
-       9.348755e-01, -1.523438e-01,  7.861328e-02, -4.937744e-02,
-       3.308105e-02, -2.252197e-02,  1.507568e-02, -9.765625e-03,
-       5.859375e-03, -3.173828e-03,  1.403809e-03, -3.662109e-04  },
-    { -2.441406e-04,  1.464844e-03, -3.784180e-03,  7.568359e-03,
-      -1.300049e-02,  2.062988e-02, -3.112793e-02,  4.589844e-02,
-      -6.781006e-02,  1.042480e-01, -1.815186e-01,  5.016479e-01,
-       7.548828e-01, -2.094727e-01,  1.148071e-01, -7.348633e-02,
-       4.956055e-02, -3.369141e-02,  2.246094e-02, -1.434326e-02,
-       8.483887e-03, -4.455566e-03,  1.831055e-03, -4.272461e-04  },
-    { -4.272461e-04,  1.831055e-03, -4.455566e-03,  8.483887e-03,
-      -1.434326e-02,  2.246094e-02, -3.369141e-02,  4.956055e-02,
-      -7.348633e-02,  1.148071e-01, -2.094727e-01,  7.548828e-01,
-       5.016479e-01, -1.815186e-01,  1.042480e-01, -6.781006e-02,
-       4.589844e-02, -3.112793e-02,  2.062988e-02, -1.300049e-02,
-       7.568359e-03, -3.784180e-03,  1.464844e-03, -2.441406e-04  },
-    { -3.662109e-04,  1.403809e-03, -3.173828e-03,  5.859375e-03,
-      -9.765625e-03,  1.507568e-02, -2.252197e-02,  3.308105e-02,
-      -4.937744e-02,  7.861328e-02, -1.523438e-01,  9.348755e-01,
-       2.314453e-01, -9.863281e-02,  5.877686e-02, -3.869629e-02,
-       2.624512e-02, -1.776123e-02,  1.165771e-02, -7.263184e-03,
-       4.150391e-03, -2.014160e-03,  7.324219e-04, -6.103516e-05  }
-};
-
-/** High band quantized gains for 23k85 in Q14 */
-static const uint16_t qua_hb_gain[16] = {
-   3624, 4673, 5597, 6479, 7425, 8378, 9324, 10264,
-   11210, 12206, 13391, 14844, 16770, 19655, 24289, 32728
-};
-
-/** High-band post-processing FIR filters coefficients from Q15 */
-static const float bpf_6_7_coef[31] = { // band pass, 6kHz and 7kHz cutoffs
-    -2.441406e-04,  3.585815e-04,  2.441406e-04,
-    -2.059937e-04, -2.815248e-03,  8.560180e-03,
-    -1.084137e-02,  0.000000e+00,  2.897645e-02,
-    -6.774902e-02,  9.421540e-02, -8.380128e-02,
-     2.706910e-02,  5.924987e-02, -1.373367e-01,
-     1.687469e-01,
-    -1.373367e-01,  5.924987e-02,  2.706910e-02,
-    -8.380128e-02,  9.421540e-02, -6.774902e-02,
-     2.897645e-02,  0.000000e+00, -1.084137e-02,
-     8.560180e-03, -2.815248e-03, -2.059937e-04,
-     2.441406e-04,  3.585815e-04, -2.441406e-04
-};
-
-static const float lpf_7_coef[31] = { // low pass, 7kHz cutoff
-    -6.408691e-04,  1.434326e-03, -2.716064e-03,
-     4.455566e-03, -6.195068e-03,  6.988525e-03,
-    -5.401611e-03,  0.000000e+00,  1.022339e-02,
-    -2.560425e-02,  4.531860e-02, -6.747437e-02,
-     8.944702e-02, -1.080933e-01,  1.206360e-01,
-     8.753052e-01,
-     1.206360e-01, -1.080933e-01,  8.944702e-02,
-    -6.747437e-02,  4.531860e-02, -2.560425e-02,
-     1.022339e-02,  0.000000e+00, -5.401611e-03,
-     6.988525e-03, -6.195068e-03,  4.455566e-03,
-    -2.716064e-03,  1.434326e-03, -6.408691e-04
-};
-
-/** Core frame sizes in each mode */
-static const uint16_t cf_sizes_wb[] = {
-    132, 177, 253, 285, 317, 365, 397, 461, 477,
-    40 /// SID/comfort noise frame
-};
-
-#endif /* AVCODEC_AMRWBDATA_H */
diff --git a/deps/libav/libavcodec/amrwbdec.c b/deps/libav/libavcodec/amrwbdec.c
deleted file mode 100644
index 668c84d..0000000
--- a/deps/libav/libavcodec/amrwbdec.c
+++ /dev/null
@@ -1,1260 +0,0 @@
-/*
- * AMR wideband decoder
- * Copyright (c) 2010 Marcelo Galvao Povoa
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AMR wideband decoder
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/lfg.h"
-
-#include "avcodec.h"
-#include "lsp.h"
-#include "celp_filters.h"
-#include "acelp_filters.h"
-#include "acelp_vectors.h"
-#include "acelp_pitch_delay.h"
-#include "internal.h"
-
-#define AMR_USE_16BIT_TABLES
-#include "amr.h"
-
-#include "amrwbdata.h"
-
-typedef struct {
-    AMRWBFrame                             frame; ///< AMRWB parameters decoded from bitstream
-    enum Mode                        fr_cur_mode; ///< mode index of current frame
-    uint8_t                           fr_quality; ///< frame quality index (FQI)
-    float                      isf_cur[LP_ORDER]; ///< working ISF vector from current frame
-    float                   isf_q_past[LP_ORDER]; ///< quantized ISF vector of the previous frame
-    float               isf_past_final[LP_ORDER]; ///< final processed ISF vector of the previous frame
-    double                      isp[4][LP_ORDER]; ///< ISP vectors from current frame
-    double               isp_sub4_past[LP_ORDER]; ///< ISP vector for the 4th subframe of the previous frame
-
-    float                   lp_coef[4][LP_ORDER]; ///< Linear Prediction Coefficients from ISP vector
-
-    uint8_t                       base_pitch_lag; ///< integer part of pitch lag for the next relative subframe
-    uint8_t                        pitch_lag_int; ///< integer part of pitch lag of the previous subframe
-
-    float excitation_buf[AMRWB_P_DELAY_MAX + LP_ORDER + 2 + AMRWB_SFR_SIZE]; ///< current excitation and all necessary excitation history
-    float                            *excitation; ///< points to current excitation in excitation_buf[]
-
-    float           pitch_vector[AMRWB_SFR_SIZE]; ///< adaptive codebook (pitch) vector for current subframe
-    float           fixed_vector[AMRWB_SFR_SIZE]; ///< algebraic codebook (fixed) vector for current subframe
-
-    float                    prediction_error[4]; ///< quantified prediction errors {20log10(^gamma_gc)} for previous four subframes
-    float                          pitch_gain[6]; ///< quantified pitch gains for the current and previous five subframes
-    float                          fixed_gain[2]; ///< quantified fixed gains for the current and previous subframes
-
-    float                              tilt_coef; ///< {beta_1} related to the voicing of the previous subframe
-
-    float                 prev_sparse_fixed_gain; ///< previous fixed gain; used by anti-sparseness to determine "onset"
-    uint8_t                    prev_ir_filter_nr; ///< previous impulse response filter "impNr": 0 - strong, 1 - medium, 2 - none
-    float                           prev_tr_gain; ///< previous initial gain used by noise enhancer for threshold
-
-    float samples_az[LP_ORDER + AMRWB_SFR_SIZE];         ///< low-band samples and memory from synthesis at 12.8kHz
-    float samples_up[UPS_MEM_SIZE + AMRWB_SFR_SIZE];     ///< low-band samples and memory processed for upsampling
-    float samples_hb[LP_ORDER_16k + AMRWB_SFR_SIZE_16k]; ///< high-band samples and memory from synthesis at 16kHz
-
-    float          hpf_31_mem[2], hpf_400_mem[2]; ///< previous values in the high pass filters
-    float                           demph_mem[1]; ///< previous value in the de-emphasis filter
-    float               bpf_6_7_mem[HB_FIR_SIZE]; ///< previous values in the high-band band pass filter
-    float                 lpf_7_mem[HB_FIR_SIZE]; ///< previous values in the high-band low pass filter
-
-    AVLFG                                   prng; ///< random number generator for white noise excitation
-    uint8_t                          first_frame; ///< flag active during decoding of the first frame
-} AMRWBContext;
-
-static av_cold int amrwb_decode_init(AVCodecContext *avctx)
-{
-    AMRWBContext *ctx = avctx->priv_data;
-    int i;
-
-    if (avctx->channels > 1) {
-        avpriv_report_missing_feature(avctx, "multi-channel AMR");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_rate    = 16000;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_FLT;
-
-    av_lfg_init(&ctx->prng, 1);
-
-    ctx->excitation  = &ctx->excitation_buf[AMRWB_P_DELAY_MAX + LP_ORDER + 1];
-    ctx->first_frame = 1;
-
-    for (i = 0; i < LP_ORDER; i++)
-        ctx->isf_past_final[i] = isf_init[i] * (1.0f / (1 << 15));
-
-    for (i = 0; i < 4; i++)
-        ctx->prediction_error[i] = MIN_ENERGY;
-
-    return 0;
-}
-
-/**
- * Decode the frame header in the "MIME/storage" format. This format
- * is simpler and does not carry the auxiliary frame information.
- *
- * @param[in] ctx                  The Context
- * @param[in] buf                  Pointer to the input buffer
- *
- * @return The decoded header length in bytes
- */
-static int decode_mime_header(AMRWBContext *ctx, const uint8_t *buf)
-{
-    /* Decode frame header (1st octet) */
-    ctx->fr_cur_mode  = buf[0] >> 3 & 0x0F;
-    ctx->fr_quality   = (buf[0] & 0x4) == 0x4;
-
-    return 1;
-}
-
-/**
- * Decode quantized ISF vectors using 36-bit indexes (6K60 mode only).
- *
- * @param[in]  ind                 Array of 5 indexes
- * @param[out] isf_q               Buffer for isf_q[LP_ORDER]
- *
- */
-static void decode_isf_indices_36b(uint16_t *ind, float *isf_q)
-{
-    int i;
-
-    for (i = 0; i < 9; i++)
-        isf_q[i]      = dico1_isf[ind[0]][i]      * (1.0f / (1 << 15));
-
-    for (i = 0; i < 7; i++)
-        isf_q[i + 9]  = dico2_isf[ind[1]][i]      * (1.0f / (1 << 15));
-
-    for (i = 0; i < 5; i++)
-        isf_q[i]     += dico21_isf_36b[ind[2]][i] * (1.0f / (1 << 15));
-
-    for (i = 0; i < 4; i++)
-        isf_q[i + 5] += dico22_isf_36b[ind[3]][i] * (1.0f / (1 << 15));
-
-    for (i = 0; i < 7; i++)
-        isf_q[i + 9] += dico23_isf_36b[ind[4]][i] * (1.0f / (1 << 15));
-}
-
-/**
- * Decode quantized ISF vectors using 46-bit indexes (except 6K60 mode).
- *
- * @param[in]  ind                 Array of 7 indexes
- * @param[out] isf_q               Buffer for isf_q[LP_ORDER]
- *
- */
-static void decode_isf_indices_46b(uint16_t *ind, float *isf_q)
-{
-    int i;
-
-    for (i = 0; i < 9; i++)
-        isf_q[i]       = dico1_isf[ind[0]][i]  * (1.0f / (1 << 15));
-
-    for (i = 0; i < 7; i++)
-        isf_q[i + 9]   = dico2_isf[ind[1]][i]  * (1.0f / (1 << 15));
-
-    for (i = 0; i < 3; i++)
-        isf_q[i]      += dico21_isf[ind[2]][i] * (1.0f / (1 << 15));
-
-    for (i = 0; i < 3; i++)
-        isf_q[i + 3]  += dico22_isf[ind[3]][i] * (1.0f / (1 << 15));
-
-    for (i = 0; i < 3; i++)
-        isf_q[i + 6]  += dico23_isf[ind[4]][i] * (1.0f / (1 << 15));
-
-    for (i = 0; i < 3; i++)
-        isf_q[i + 9]  += dico24_isf[ind[5]][i] * (1.0f / (1 << 15));
-
-    for (i = 0; i < 4; i++)
-        isf_q[i + 12] += dico25_isf[ind[6]][i] * (1.0f / (1 << 15));
-}
-
-/**
- * Apply mean and past ISF values using the prediction factor.
- * Updates past ISF vector.
- *
- * @param[in,out] isf_q            Current quantized ISF
- * @param[in,out] isf_past         Past quantized ISF
- *
- */
-static void isf_add_mean_and_past(float *isf_q, float *isf_past)
-{
-    int i;
-    float tmp;
-
-    for (i = 0; i < LP_ORDER; i++) {
-        tmp = isf_q[i];
-        isf_q[i] += isf_mean[i] * (1.0f / (1 << 15));
-        isf_q[i] += PRED_FACTOR * isf_past[i];
-        isf_past[i] = tmp;
-    }
-}
-
-/**
- * Interpolate the fourth ISP vector from current and past frames
- * to obtain an ISP vector for each subframe.
- *
- * @param[in,out] isp_q            ISPs for each subframe
- * @param[in]     isp4_past        Past ISP for subframe 4
- */
-static void interpolate_isp(double isp_q[4][LP_ORDER], const double *isp4_past)
-{
-    int i, k;
-
-    for (k = 0; k < 3; k++) {
-        float c = isfp_inter[k];
-        for (i = 0; i < LP_ORDER; i++)
-            isp_q[k][i] = (1.0 - c) * isp4_past[i] + c * isp_q[3][i];
-    }
-}
-
-/**
- * Decode an adaptive codebook index into pitch lag (except 6k60, 8k85 modes).
- * Calculate integer lag and fractional lag always using 1/4 resolution.
- * In 1st and 3rd subframes the index is relative to last subframe integer lag.
- *
- * @param[out]    lag_int          Decoded integer pitch lag
- * @param[out]    lag_frac         Decoded fractional pitch lag
- * @param[in]     pitch_index      Adaptive codebook pitch index
- * @param[in,out] base_lag_int     Base integer lag used in relative subframes
- * @param[in]     subframe         Current subframe index (0 to 3)
- */
-static void decode_pitch_lag_high(int *lag_int, int *lag_frac, int pitch_index,
-                                  uint8_t *base_lag_int, int subframe)
-{
-    if (subframe == 0 || subframe == 2) {
-        if (pitch_index < 376) {
-            *lag_int  = (pitch_index + 137) >> 2;
-            *lag_frac = pitch_index - (*lag_int << 2) + 136;
-        } else if (pitch_index < 440) {
-            *lag_int  = (pitch_index + 257 - 376) >> 1;
-            *lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) << 1;
-            /* the actual resolution is 1/2 but expressed as 1/4 */
-        } else {
-            *lag_int  = pitch_index - 280;
-            *lag_frac = 0;
-        }
-        /* minimum lag for next subframe */
-        *base_lag_int = av_clip(*lag_int - 8 - (*lag_frac < 0),
-                                AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);
-        // XXX: the spec states clearly that *base_lag_int should be
-        // the nearest integer to *lag_int (minus 8), but the ref code
-        // actually always uses its floor, I'm following the latter
-    } else {
-        *lag_int  = (pitch_index + 1) >> 2;
-        *lag_frac = pitch_index - (*lag_int << 2);
-        *lag_int += *base_lag_int;
-    }
-}
-
-/**
- * Decode an adaptive codebook index into pitch lag for 8k85 and 6k60 modes.
- * The description is analogous to decode_pitch_lag_high, but in 6k60 the
- * relative index is used for all subframes except the first.
- */
-static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
-                                 uint8_t *base_lag_int, int subframe, enum Mode mode)
-{
-    if (subframe == 0 || (subframe == 2 && mode != MODE_6k60)) {
-        if (pitch_index < 116) {
-            *lag_int  = (pitch_index + 69) >> 1;
-            *lag_frac = (pitch_index - (*lag_int << 1) + 68) << 1;
-        } else {
-            *lag_int  = pitch_index - 24;
-            *lag_frac = 0;
-        }
-        // XXX: same problem as before
-        *base_lag_int = av_clip(*lag_int - 8 - (*lag_frac < 0),
-                                AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);
-    } else {
-        *lag_int  = (pitch_index + 1) >> 1;
-        *lag_frac = (pitch_index - (*lag_int << 1)) << 1;
-        *lag_int += *base_lag_int;
-    }
-}
-
-/**
- * Find the pitch vector by interpolating the past excitation at the
- * pitch delay, which is obtained in this function.
- *
- * @param[in,out] ctx              The context
- * @param[in]     amr_subframe     Current subframe data
- * @param[in]     subframe         Current subframe index (0 to 3)
- */
-static void decode_pitch_vector(AMRWBContext *ctx,
-                                const AMRWBSubFrame *amr_subframe,
-                                const int subframe)
-{
-    int pitch_lag_int, pitch_lag_frac;
-    int i;
-    float *exc     = ctx->excitation;
-    enum Mode mode = ctx->fr_cur_mode;
-
-    if (mode <= MODE_8k85) {
-        decode_pitch_lag_low(&pitch_lag_int, &pitch_lag_frac, amr_subframe->adap,
-                              &ctx->base_pitch_lag, subframe, mode);
-    } else
-        decode_pitch_lag_high(&pitch_lag_int, &pitch_lag_frac, amr_subframe->adap,
-                              &ctx->base_pitch_lag, subframe);
-
-    ctx->pitch_lag_int = pitch_lag_int;
-    pitch_lag_int += pitch_lag_frac > 0;
-
-    /* Calculate the pitch vector by interpolating the past excitation at the
-       pitch lag using a hamming windowed sinc function */
-    ff_acelp_interpolatef(exc, exc + 1 - pitch_lag_int,
-                          ac_inter, 4,
-                          pitch_lag_frac + (pitch_lag_frac > 0 ? 0 : 4),
-                          LP_ORDER, AMRWB_SFR_SIZE + 1);
-
-    /* Check which pitch signal path should be used
-     * 6k60 and 8k85 modes have the ltp flag set to 0 */
-    if (amr_subframe->ltp) {
-        memcpy(ctx->pitch_vector, exc, AMRWB_SFR_SIZE * sizeof(float));
-    } else {
-        for (i = 0; i < AMRWB_SFR_SIZE; i++)
-            ctx->pitch_vector[i] = 0.18 * exc[i - 1] + 0.64 * exc[i] +
-                                   0.18 * exc[i + 1];
-        memcpy(exc, ctx->pitch_vector, AMRWB_SFR_SIZE * sizeof(float));
-    }
-}
-
-/** Get x bits in the index interval [lsb,lsb+len-1] inclusive */
-#define BIT_STR(x,lsb,len) (((x) >> (lsb)) & ((1 << (len)) - 1))
-
-/** Get the bit at specified position */
-#define BIT_POS(x, p) (((x) >> (p)) & 1)
-
-/**
- * The next six functions decode_[i]p_track decode exactly i pulses
- * positions and amplitudes (-1 or 1) in a subframe track using
- * an encoded pulse indexing (TS 26.190 section 5.8.2).
- *
- * The results are given in out[], in which a negative number means
- * amplitude -1 and vice versa (i.e., ampl(x) = x / abs(x) ).
- *
- * @param[out] out                 Output buffer (writes i elements)
- * @param[in]  code                Pulse index (no. of bits varies, see below)
- * @param[in]  m                   (log2) Number of potential positions
- * @param[in]  off                 Offset for decoded positions
- */
-static inline void decode_1p_track(int *out, int code, int m, int off)
-{
-    int pos = BIT_STR(code, 0, m) + off; ///code: m+1 bits
-
-    out[0] = BIT_POS(code, m) ? -pos : pos;
-}
-
-static inline void decode_2p_track(int *out, int code, int m, int off) ///code: 2m+1 bits
-{
-    int pos0 = BIT_STR(code, m, m) + off;
-    int pos1 = BIT_STR(code, 0, m) + off;
-
-    out[0] = BIT_POS(code, 2*m) ? -pos0 : pos0;
-    out[1] = BIT_POS(code, 2*m) ? -pos1 : pos1;
-    out[1] = pos0 > pos1 ? -out[1] : out[1];
-}
-
-static void decode_3p_track(int *out, int code, int m, int off) ///code: 3m+1 bits
-{
-    int half_2p = BIT_POS(code, 2*m - 1) << (m - 1);
-
-    decode_2p_track(out, BIT_STR(code, 0, 2*m - 1),
-                    m - 1, off + half_2p);
-    decode_1p_track(out + 2, BIT_STR(code, 2*m, m + 1), m, off);
-}
-
-static void decode_4p_track(int *out, int code, int m, int off) ///code: 4m bits
-{
-    int half_4p, subhalf_2p;
-    int b_offset = 1 << (m - 1);
-
-    switch (BIT_STR(code, 4*m - 2, 2)) { /* case ID (2 bits) */
-    case 0: /* 0 pulses in A, 4 pulses in B or vice versa */
-        half_4p = BIT_POS(code, 4*m - 3) << (m - 1); // which has 4 pulses
-        subhalf_2p = BIT_POS(code, 2*m - 3) << (m - 2);
-
-        decode_2p_track(out, BIT_STR(code, 0, 2*m - 3),
-                        m - 2, off + half_4p + subhalf_2p);
-        decode_2p_track(out + 2, BIT_STR(code, 2*m - 2, 2*m - 1),
-                        m - 1, off + half_4p);
-        break;
-    case 1: /* 1 pulse in A, 3 pulses in B */
-        decode_1p_track(out, BIT_STR(code,  3*m - 2, m),
-                        m - 1, off);
-        decode_3p_track(out + 1, BIT_STR(code, 0, 3*m - 2),
-                        m - 1, off + b_offset);
-        break;
-    case 2: /* 2 pulses in each half */
-        decode_2p_track(out, BIT_STR(code, 2*m - 1, 2*m - 1),
-                        m - 1, off);
-        decode_2p_track(out + 2, BIT_STR(code, 0, 2*m - 1),
-                        m - 1, off + b_offset);
-        break;
-    case 3: /* 3 pulses in A, 1 pulse in B */
-        decode_3p_track(out, BIT_STR(code, m, 3*m - 2),
-                        m - 1, off);
-        decode_1p_track(out + 3, BIT_STR(code, 0, m),
-                        m - 1, off + b_offset);
-        break;
-    }
-}
-
-static void decode_5p_track(int *out, int code, int m, int off) ///code: 5m bits
-{
-    int half_3p = BIT_POS(code, 5*m - 1) << (m - 1);
-
-    decode_3p_track(out, BIT_STR(code, 2*m + 1, 3*m - 2),
-                    m - 1, off + half_3p);
-
-    decode_2p_track(out + 3, BIT_STR(code, 0, 2*m + 1), m, off);
-}
-
-static void decode_6p_track(int *out, int code, int m, int off) ///code: 6m-2 bits
-{
-    int b_offset = 1 << (m - 1);
-    /* which half has more pulses in cases 0 to 2 */
-    int half_more  = BIT_POS(code, 6*m - 5) << (m - 1);
-    int half_other = b_offset - half_more;
-
-    switch (BIT_STR(code, 6*m - 4, 2)) { /* case ID (2 bits) */
-    case 0: /* 0 pulses in A, 6 pulses in B or vice versa */
-        decode_1p_track(out, BIT_STR(code, 0, m),
-                        m - 1, off + half_more);
-        decode_5p_track(out + 1, BIT_STR(code, m, 5*m - 5),
-                        m - 1, off + half_more);
-        break;
-    case 1: /* 1 pulse in A, 5 pulses in B or vice versa */
-        decode_1p_track(out, BIT_STR(code, 0, m),
-                        m - 1, off + half_other);
-        decode_5p_track(out + 1, BIT_STR(code, m, 5*m - 5),
-                        m - 1, off + half_more);
-        break;
-    case 2: /* 2 pulses in A, 4 pulses in B or vice versa */
-        decode_2p_track(out, BIT_STR(code, 0, 2*m - 1),
-                        m - 1, off + half_other);
-        decode_4p_track(out + 2, BIT_STR(code, 2*m - 1, 4*m - 4),
-                        m - 1, off + half_more);
-        break;
-    case 3: /* 3 pulses in A, 3 pulses in B */
-        decode_3p_track(out, BIT_STR(code, 3*m - 2, 3*m - 2),
-                        m - 1, off);
-        decode_3p_track(out + 3, BIT_STR(code, 0, 3*m - 2),
-                        m - 1, off + b_offset);
-        break;
-    }
-}
-
-/**
- * Decode the algebraic codebook index to pulse positions and signs,
- * then construct the algebraic codebook vector.
- *
- * @param[out] fixed_vector        Buffer for the fixed codebook excitation
- * @param[in]  pulse_hi            MSBs part of the pulse index array (higher modes only)
- * @param[in]  pulse_lo            LSBs part of the pulse index array
- * @param[in]  mode                Mode of the current frame
- */
-static void decode_fixed_vector(float *fixed_vector, const uint16_t *pulse_hi,
-                                const uint16_t *pulse_lo, const enum Mode mode)
-{
-    /* sig_pos stores for each track the decoded pulse position indexes
-     * (1-based) multiplied by its corresponding amplitude (+1 or -1) */
-    int sig_pos[4][6];
-    int spacing = (mode == MODE_6k60) ? 2 : 4;
-    int i, j;
-
-    switch (mode) {
-    case MODE_6k60:
-        for (i = 0; i < 2; i++)
-            decode_1p_track(sig_pos[i], pulse_lo[i], 5, 1);
-        break;
-    case MODE_8k85:
-        for (i = 0; i < 4; i++)
-            decode_1p_track(sig_pos[i], pulse_lo[i], 4, 1);
-        break;
-    case MODE_12k65:
-        for (i = 0; i < 4; i++)
-            decode_2p_track(sig_pos[i], pulse_lo[i], 4, 1);
-        break;
-    case MODE_14k25:
-        for (i = 0; i < 2; i++)
-            decode_3p_track(sig_pos[i], pulse_lo[i], 4, 1);
-        for (i = 2; i < 4; i++)
-            decode_2p_track(sig_pos[i], pulse_lo[i], 4, 1);
-        break;
-    case MODE_15k85:
-        for (i = 0; i < 4; i++)
-            decode_3p_track(sig_pos[i], pulse_lo[i], 4, 1);
-        break;
-    case MODE_18k25:
-        for (i = 0; i < 4; i++)
-            decode_4p_track(sig_pos[i], (int) pulse_lo[i] +
-                           ((int) pulse_hi[i] << 14), 4, 1);
-        break;
-    case MODE_19k85:
-        for (i = 0; i < 2; i++)
-            decode_5p_track(sig_pos[i], (int) pulse_lo[i] +
-                           ((int) pulse_hi[i] << 10), 4, 1);
-        for (i = 2; i < 4; i++)
-            decode_4p_track(sig_pos[i], (int) pulse_lo[i] +
-                           ((int) pulse_hi[i] << 14), 4, 1);
-        break;
-    case MODE_23k05:
-    case MODE_23k85:
-        for (i = 0; i < 4; i++)
-            decode_6p_track(sig_pos[i], (int) pulse_lo[i] +
-                           ((int) pulse_hi[i] << 11), 4, 1);
-        break;
-    }
-
-    memset(fixed_vector, 0, sizeof(float) * AMRWB_SFR_SIZE);
-
-    for (i = 0; i < 4; i++)
-        for (j = 0; j < pulses_nb_per_mode_tr[mode][i]; j++) {
-            int pos = (FFABS(sig_pos[i][j]) - 1) * spacing + i;
-
-            fixed_vector[pos] += sig_pos[i][j] < 0 ? -1.0 : 1.0;
-        }
-}
-
-/**
- * Decode pitch gain and fixed gain correction factor.
- *
- * @param[in]  vq_gain             Vector-quantized index for gains
- * @param[in]  mode                Mode of the current frame
- * @param[out] fixed_gain_factor   Decoded fixed gain correction factor
- * @param[out] pitch_gain          Decoded pitch gain
- */
-static void decode_gains(const uint8_t vq_gain, const enum Mode mode,
-                         float *fixed_gain_factor, float *pitch_gain)
-{
-    const int16_t *gains = (mode <= MODE_8k85 ? qua_gain_6b[vq_gain] :
-                                                qua_gain_7b[vq_gain]);
-
-    *pitch_gain        = gains[0] * (1.0f / (1 << 14));
-    *fixed_gain_factor = gains[1] * (1.0f / (1 << 11));
-}
-
-/**
- * Apply pitch sharpening filters to the fixed codebook vector.
- *
- * @param[in]     ctx              The context
- * @param[in,out] fixed_vector     Fixed codebook excitation
- */
-// XXX: Spec states this procedure should be applied when the pitch
-// lag is less than 64, but this checking seems absent in reference and AMR-NB
-static void pitch_sharpening(AMRWBContext *ctx, float *fixed_vector)
-{
-    int i;
-
-    /* Tilt part */
-    for (i = AMRWB_SFR_SIZE - 1; i != 0; i--)
-        fixed_vector[i] -= fixed_vector[i - 1] * ctx->tilt_coef;
-
-    /* Periodicity enhancement part */
-    for (i = ctx->pitch_lag_int; i < AMRWB_SFR_SIZE; i++)
-        fixed_vector[i] += fixed_vector[i - ctx->pitch_lag_int] * 0.85;
-}
-
-/**
- * Calculate the voicing factor (-1.0 = unvoiced to 1.0 = voiced).
- *
- * @param[in] p_vector, f_vector   Pitch and fixed excitation vectors
- * @param[in] p_gain, f_gain       Pitch and fixed gains
- */
-// XXX: There is something wrong with the precision here! The magnitudes
-// of the energies are not correct. Please check the reference code carefully
-static float voice_factor(float *p_vector, float p_gain,
-                          float *f_vector, float f_gain)
-{
-    double p_ener = (double) avpriv_scalarproduct_float_c(p_vector, p_vector,
-                                                          AMRWB_SFR_SIZE) *
-                    p_gain * p_gain;
-    double f_ener = (double) avpriv_scalarproduct_float_c(f_vector, f_vector,
-                                                          AMRWB_SFR_SIZE) *
-                    f_gain * f_gain;
-
-    return (p_ener - f_ener) / (p_ener + f_ener);
-}
-
-/**
- * Reduce fixed vector sparseness by smoothing with one of three IR filters,
- * also known as "adaptive phase dispersion".
- *
- * @param[in]     ctx              The context
- * @param[in,out] fixed_vector     Unfiltered fixed vector
- * @param[out]    buf              Space for modified vector if necessary
- *
- * @return The potentially overwritten filtered fixed vector address
- */
-static float *anti_sparseness(AMRWBContext *ctx,
-                              float *fixed_vector, float *buf)
-{
-    int ir_filter_nr;
-
-    if (ctx->fr_cur_mode > MODE_8k85) // no filtering in higher modes
-        return fixed_vector;
-
-    if (ctx->pitch_gain[0] < 0.6) {
-        ir_filter_nr = 0;      // strong filtering
-    } else if (ctx->pitch_gain[0] < 0.9) {
-        ir_filter_nr = 1;      // medium filtering
-    } else
-        ir_filter_nr = 2;      // no filtering
-
-    /* detect 'onset' */
-    if (ctx->fixed_gain[0] > 3.0 * ctx->fixed_gain[1]) {
-        if (ir_filter_nr < 2)
-            ir_filter_nr++;
-    } else {
-        int i, count = 0;
-
-        for (i = 0; i < 6; i++)
-            if (ctx->pitch_gain[i] < 0.6)
-                count++;
-
-        if (count > 2)
-            ir_filter_nr = 0;
-
-        if (ir_filter_nr > ctx->prev_ir_filter_nr + 1)
-            ir_filter_nr--;
-    }
-
-    /* update ir filter strength history */
-    ctx->prev_ir_filter_nr = ir_filter_nr;
-
-    ir_filter_nr += (ctx->fr_cur_mode == MODE_8k85);
-
-    if (ir_filter_nr < 2) {
-        int i;
-        const float *coef = ir_filters_lookup[ir_filter_nr];
-
-        /* Circular convolution code in the reference
-         * decoder was modified to avoid using one
-         * extra array. The filtered vector is given by:
-         *
-         * c2(n) = sum(i,0,len-1){ c(i) * coef( (n - i + len) % len ) }
-         */
-
-        memset(buf, 0, sizeof(float) * AMRWB_SFR_SIZE);
-        for (i = 0; i < AMRWB_SFR_SIZE; i++)
-            if (fixed_vector[i])
-                ff_celp_circ_addf(buf, buf, coef, i, fixed_vector[i],
-                                  AMRWB_SFR_SIZE);
-        fixed_vector = buf;
-    }
-
-    return fixed_vector;
-}
-
-/**
- * Calculate a stability factor {teta} based on distance between
- * current and past isf. A value of 1 shows maximum signal stability.
- */
-static float stability_factor(const float *isf, const float *isf_past)
-{
-    int i;
-    float acc = 0.0;
-
-    for (i = 0; i < LP_ORDER - 1; i++)
-        acc += (isf[i] - isf_past[i]) * (isf[i] - isf_past[i]);
-
-    // XXX: This part is not so clear from the reference code
-    // the result is more accurate changing the "/ 256" to "* 512"
-    return FFMAX(0.0, 1.25 - acc * 0.8 * 512);
-}
-
-/**
- * Apply a non-linear fixed gain smoothing in order to reduce
- * fluctuation in the energy of excitation.
- *
- * @param[in]     fixed_gain       Unsmoothed fixed gain
- * @param[in,out] prev_tr_gain     Previous threshold gain (updated)
- * @param[in]     voice_fac        Frame voicing factor
- * @param[in]     stab_fac         Frame stability factor
- *
- * @return The smoothed gain
- */
-static float noise_enhancer(float fixed_gain, float *prev_tr_gain,
-                            float voice_fac,  float stab_fac)
-{
-    float sm_fac = 0.5 * (1 - voice_fac) * stab_fac;
-    float g0;
-
-    // XXX: the following fixed-point constants used to in(de)crement
-    // gain by 1.5dB were taken from the reference code, maybe it could
-    // be simpler
-    if (fixed_gain < *prev_tr_gain) {
-        g0 = FFMIN(*prev_tr_gain, fixed_gain + fixed_gain *
-                     (6226 * (1.0f / (1 << 15)))); // +1.5 dB
-    } else
-        g0 = FFMAX(*prev_tr_gain, fixed_gain *
-                    (27536 * (1.0f / (1 << 15)))); // -1.5 dB
-
-    *prev_tr_gain = g0; // update next frame threshold
-
-    return sm_fac * g0 + (1 - sm_fac) * fixed_gain;
-}
-
-/**
- * Filter the fixed_vector to emphasize the higher frequencies.
- *
- * @param[in,out] fixed_vector     Fixed codebook vector
- * @param[in]     voice_fac        Frame voicing factor
- */
-static void pitch_enhancer(float *fixed_vector, float voice_fac)
-{
-    int i;
-    float cpe  = 0.125 * (1 + voice_fac);
-    float last = fixed_vector[0]; // holds c(i - 1)
-
-    fixed_vector[0] -= cpe * fixed_vector[1];
-
-    for (i = 1; i < AMRWB_SFR_SIZE - 1; i++) {
-        float cur = fixed_vector[i];
-
-        fixed_vector[i] -= cpe * (last + fixed_vector[i + 1]);
-        last = cur;
-    }
-
-    fixed_vector[AMRWB_SFR_SIZE - 1] -= cpe * last;
-}
-
-/**
- * Conduct 16th order linear predictive coding synthesis from excitation.
- *
- * @param[in]     ctx              Pointer to the AMRWBContext
- * @param[in]     lpc              Pointer to the LPC coefficients
- * @param[out]    excitation       Buffer for synthesis final excitation
- * @param[in]     fixed_gain       Fixed codebook gain for synthesis
- * @param[in]     fixed_vector     Algebraic codebook vector
- * @param[in,out] samples          Pointer to the output samples and memory
- */
-static void synthesis(AMRWBContext *ctx, float *lpc, float *excitation,
-                      float fixed_gain, const float *fixed_vector,
-                      float *samples)
-{
-    ff_weighted_vector_sumf(excitation, ctx->pitch_vector, fixed_vector,
-                            ctx->pitch_gain[0], fixed_gain, AMRWB_SFR_SIZE);
-
-    /* emphasize pitch vector contribution in low bitrate modes */
-    if (ctx->pitch_gain[0] > 0.5 && ctx->fr_cur_mode <= MODE_8k85) {
-        int i;
-        float energy = avpriv_scalarproduct_float_c(excitation, excitation,
-                                                    AMRWB_SFR_SIZE);
-
-        // XXX: Weird part in both ref code and spec. A unknown parameter
-        // {beta} seems to be identical to the current pitch gain
-        float pitch_factor = 0.25 * ctx->pitch_gain[0] * ctx->pitch_gain[0];
-
-        for (i = 0; i < AMRWB_SFR_SIZE; i++)
-            excitation[i] += pitch_factor * ctx->pitch_vector[i];
-
-        ff_scale_vector_to_given_sum_of_squares(excitation, excitation,
-                                                energy, AMRWB_SFR_SIZE);
-    }
-
-    ff_celp_lp_synthesis_filterf(samples, lpc, excitation,
-                                 AMRWB_SFR_SIZE, LP_ORDER);
-}
-
-/**
- * Apply to synthesis a de-emphasis filter of the form:
- * H(z) = 1 / (1 - m * z^-1)
- *
- * @param[out]    out              Output buffer
- * @param[in]     in               Input samples array with in[-1]
- * @param[in]     m                Filter coefficient
- * @param[in,out] mem              State from last filtering
- */
-static void de_emphasis(float *out, float *in, float m, float mem[1])
-{
-    int i;
-
-    out[0] = in[0] + m * mem[0];
-
-    for (i = 1; i < AMRWB_SFR_SIZE; i++)
-         out[i] = in[i] + out[i - 1] * m;
-
-    mem[0] = out[AMRWB_SFR_SIZE - 1];
-}
-
-/**
- * Upsample a signal by 5/4 ratio (from 12.8kHz to 16kHz) using
- * a FIR interpolation filter. Uses past data from before *in address.
- *
- * @param[out] out                 Buffer for interpolated signal
- * @param[in]  in                  Current signal data (length 0.8*o_size)
- * @param[in]  o_size              Output signal length
- */
-static void upsample_5_4(float *out, const float *in, int o_size)
-{
-    const float *in0 = in - UPS_FIR_SIZE + 1;
-    int i, j, k;
-    int int_part = 0, frac_part;
-
-    i = 0;
-    for (j = 0; j < o_size / 5; j++) {
-        out[i] = in[int_part];
-        frac_part = 4;
-        i++;
-
-        for (k = 1; k < 5; k++) {
-            out[i] = avpriv_scalarproduct_float_c(in0 + int_part,
-                                                  upsample_fir[4 - frac_part],
-                                                  UPS_MEM_SIZE);
-            int_part++;
-            frac_part--;
-            i++;
-        }
-    }
-}
-
-/**
- * Calculate the high-band gain based on encoded index (23k85 mode) or
- * on the low-band speech signal and the Voice Activity Detection flag.
- *
- * @param[in] ctx                  The context
- * @param[in] synth                LB speech synthesis at 12.8k
- * @param[in] hb_idx               Gain index for mode 23k85 only
- * @param[in] vad                  VAD flag for the frame
- */
-static float find_hb_gain(AMRWBContext *ctx, const float *synth,
-                          uint16_t hb_idx, uint8_t vad)
-{
-    int wsp = (vad > 0);
-    float tilt;
-
-    if (ctx->fr_cur_mode == MODE_23k85)
-        return qua_hb_gain[hb_idx] * (1.0f / (1 << 14));
-
-    tilt = avpriv_scalarproduct_float_c(synth, synth + 1, AMRWB_SFR_SIZE - 1) /
-           avpriv_scalarproduct_float_c(synth, synth, AMRWB_SFR_SIZE);
-
-    /* return gain bounded by [0.1, 1.0] */
-    return av_clipf((1.0 - FFMAX(0.0, tilt)) * (1.25 - 0.25 * wsp), 0.1, 1.0);
-}
-
-/**
- * Generate the high-band excitation with the same energy from the lower
- * one and scaled by the given gain.
- *
- * @param[in]  ctx                 The context
- * @param[out] hb_exc              Buffer for the excitation
- * @param[in]  synth_exc           Low-band excitation used for synthesis
- * @param[in]  hb_gain             Wanted excitation gain
- */
-static void scaled_hb_excitation(AMRWBContext *ctx, float *hb_exc,
-                                 const float *synth_exc, float hb_gain)
-{
-    int i;
-    float energy = avpriv_scalarproduct_float_c(synth_exc, synth_exc,
-                                                AMRWB_SFR_SIZE);
-
-    /* Generate a white-noise excitation */
-    for (i = 0; i < AMRWB_SFR_SIZE_16k; i++)
-        hb_exc[i] = 32768.0 - (uint16_t) av_lfg_get(&ctx->prng);
-
-    ff_scale_vector_to_given_sum_of_squares(hb_exc, hb_exc,
-                                            energy * hb_gain * hb_gain,
-                                            AMRWB_SFR_SIZE_16k);
-}
-
-/**
- * Calculate the auto-correlation for the ISF difference vector.
- */
-static float auto_correlation(float *diff_isf, float mean, int lag)
-{
-    int i;
-    float sum = 0.0;
-
-    for (i = 7; i < LP_ORDER - 2; i++) {
-        float prod = (diff_isf[i] - mean) * (diff_isf[i - lag] - mean);
-        sum += prod * prod;
-    }
-    return sum;
-}
-
-/**
- * Extrapolate a ISF vector to the 16kHz range (20th order LP)
- * used at mode 6k60 LP filter for the high frequency band.
- *
- * @param[out] isf Buffer for extrapolated isf; contains LP_ORDER
- *                 values on input
- */
-static void extrapolate_isf(float isf[LP_ORDER_16k])
-{
-    float diff_isf[LP_ORDER - 2], diff_mean;
-    float corr_lag[3];
-    float est, scale;
-    int i, j, i_max_corr;
-
-    isf[LP_ORDER_16k - 1] = isf[LP_ORDER - 1];
-
-    /* Calculate the difference vector */
-    for (i = 0; i < LP_ORDER - 2; i++)
-        diff_isf[i] = isf[i + 1] - isf[i];
-
-    diff_mean = 0.0;
-    for (i = 2; i < LP_ORDER - 2; i++)
-        diff_mean += diff_isf[i] * (1.0f / (LP_ORDER - 4));
-
-    /* Find which is the maximum autocorrelation */
-    i_max_corr = 0;
-    for (i = 0; i < 3; i++) {
-        corr_lag[i] = auto_correlation(diff_isf, diff_mean, i + 2);
-
-        if (corr_lag[i] > corr_lag[i_max_corr])
-            i_max_corr = i;
-    }
-    i_max_corr++;
-
-    for (i = LP_ORDER - 1; i < LP_ORDER_16k - 1; i++)
-        isf[i] = isf[i - 1] + isf[i - 1 - i_max_corr]
-                            - isf[i - 2 - i_max_corr];
-
-    /* Calculate an estimate for ISF(18) and scale ISF based on the error */
-    est   = 7965 + (isf[2] - isf[3] - isf[4]) / 6.0;
-    scale = 0.5 * (FFMIN(est, 7600) - isf[LP_ORDER - 2]) /
-            (isf[LP_ORDER_16k - 2] - isf[LP_ORDER - 2]);
-
-    for (i = LP_ORDER - 1, j = 0; i < LP_ORDER_16k - 1; i++, j++)
-        diff_isf[j] = scale * (isf[i] - isf[i - 1]);
-
-    /* Stability insurance */
-    for (i = 1; i < LP_ORDER_16k - LP_ORDER; i++)
-        if (diff_isf[i] + diff_isf[i - 1] < 5.0) {
-            if (diff_isf[i] > diff_isf[i - 1]) {
-                diff_isf[i - 1] = 5.0 - diff_isf[i];
-            } else
-                diff_isf[i] = 5.0 - diff_isf[i - 1];
-        }
-
-    for (i = LP_ORDER - 1, j = 0; i < LP_ORDER_16k - 1; i++, j++)
-        isf[i] = isf[i - 1] + diff_isf[j] * (1.0f / (1 << 15));
-
-    /* Scale the ISF vector for 16000 Hz */
-    for (i = 0; i < LP_ORDER_16k - 1; i++)
-        isf[i] *= 0.8;
-}
-
-/**
- * Spectral expand the LP coefficients using the equation:
- *   y[i] = x[i] * (gamma ** i)
- *
- * @param[out] out                 Output buffer (may use input array)
- * @param[in]  lpc                 LP coefficients array
- * @param[in]  gamma               Weighting factor
- * @param[in]  size                LP array size
- */
-static void lpc_weighting(float *out, const float *lpc, float gamma, int size)
-{
-    int i;
-    float fac = gamma;
-
-    for (i = 0; i < size; i++) {
-        out[i] = lpc[i] * fac;
-        fac   *= gamma;
-    }
-}
-
-/**
- * Conduct 20th order linear predictive coding synthesis for the high
- * frequency band excitation at 16kHz.
- *
- * @param[in]     ctx              The context
- * @param[in]     subframe         Current subframe index (0 to 3)
- * @param[in,out] samples          Pointer to the output speech samples
- * @param[in]     exc              Generated white-noise scaled excitation
- * @param[in]     isf              Current frame isf vector
- * @param[in]     isf_past         Past frame final isf vector
- */
-static void hb_synthesis(AMRWBContext *ctx, int subframe, float *samples,
-                         const float *exc, const float *isf, const float *isf_past)
-{
-    float hb_lpc[LP_ORDER_16k];
-    enum Mode mode = ctx->fr_cur_mode;
-
-    if (mode == MODE_6k60) {
-        float e_isf[LP_ORDER_16k]; // ISF vector for extrapolation
-        double e_isp[LP_ORDER_16k];
-
-        ff_weighted_vector_sumf(e_isf, isf_past, isf, isfp_inter[subframe],
-                                1.0 - isfp_inter[subframe], LP_ORDER);
-
-        extrapolate_isf(e_isf);
-
-        e_isf[LP_ORDER_16k - 1] *= 2.0;
-        ff_acelp_lsf2lspd(e_isp, e_isf, LP_ORDER_16k);
-        ff_amrwb_lsp2lpc(e_isp, hb_lpc, LP_ORDER_16k);
-
-        lpc_weighting(hb_lpc, hb_lpc, 0.9, LP_ORDER_16k);
-    } else {
-        lpc_weighting(hb_lpc, ctx->lp_coef[subframe], 0.6, LP_ORDER);
-    }
-
-    ff_celp_lp_synthesis_filterf(samples, hb_lpc, exc, AMRWB_SFR_SIZE_16k,
-                                 (mode == MODE_6k60) ? LP_ORDER_16k : LP_ORDER);
-}
-
-/**
- * Apply a 15th order filter to high-band samples.
- * The filter characteristic depends on the given coefficients.
- *
- * @param[out]    out              Buffer for filtered output
- * @param[in]     fir_coef         Filter coefficients
- * @param[in,out] mem              State from last filtering (updated)
- * @param[in]     in               Input speech data (high-band)
- *
- * @remark It is safe to pass the same array in in and out parameters
- */
-static void hb_fir_filter(float *out, const float fir_coef[HB_FIR_SIZE + 1],
-                          float mem[HB_FIR_SIZE], const float *in)
-{
-    int i, j;
-    float data[AMRWB_SFR_SIZE_16k + HB_FIR_SIZE]; // past and current samples
-
-    memcpy(data, mem, HB_FIR_SIZE * sizeof(float));
-    memcpy(data + HB_FIR_SIZE, in, AMRWB_SFR_SIZE_16k * sizeof(float));
-
-    for (i = 0; i < AMRWB_SFR_SIZE_16k; i++) {
-        out[i] = 0.0;
-        for (j = 0; j <= HB_FIR_SIZE; j++)
-            out[i] += data[i + j] * fir_coef[j];
-    }
-
-    memcpy(mem, data + AMRWB_SFR_SIZE_16k, HB_FIR_SIZE * sizeof(float));
-}
-
-/**
- * Update context state before the next subframe.
- */
-static void update_sub_state(AMRWBContext *ctx)
-{
-    memmove(&ctx->excitation_buf[0], &ctx->excitation_buf[AMRWB_SFR_SIZE],
-            (AMRWB_P_DELAY_MAX + LP_ORDER + 1) * sizeof(float));
-
-    memmove(&ctx->pitch_gain[1], &ctx->pitch_gain[0], 5 * sizeof(float));
-    memmove(&ctx->fixed_gain[1], &ctx->fixed_gain[0], 1 * sizeof(float));
-
-    memmove(&ctx->samples_az[0], &ctx->samples_az[AMRWB_SFR_SIZE],
-            LP_ORDER * sizeof(float));
-    memmove(&ctx->samples_up[0], &ctx->samples_up[AMRWB_SFR_SIZE],
-            UPS_MEM_SIZE * sizeof(float));
-    memmove(&ctx->samples_hb[0], &ctx->samples_hb[AMRWB_SFR_SIZE_16k],
-            LP_ORDER_16k * sizeof(float));
-}
-
-static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
-                              int *got_frame_ptr, AVPacket *avpkt)
-{
-    AMRWBContext *ctx  = avctx->priv_data;
-    AVFrame *frame     = data;
-    AMRWBFrame   *cf   = &ctx->frame;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    int expected_fr_size, header_size;
-    float *buf_out;
-    float spare_vector[AMRWB_SFR_SIZE];      // extra stack space to hold result from anti-sparseness processing
-    float fixed_gain_factor;                 // fixed gain correction factor (gamma)
-    float *synth_fixed_vector;               // pointer to the fixed vector that synthesis should use
-    float synth_fixed_gain;                  // the fixed gain that synthesis should use
-    float voice_fac, stab_fac;               // parameters used for gain smoothing
-    float synth_exc[AMRWB_SFR_SIZE];         // post-processed excitation for synthesis
-    float hb_exc[AMRWB_SFR_SIZE_16k];        // excitation for the high frequency band
-    float hb_samples[AMRWB_SFR_SIZE_16k];    // filtered high-band samples from synthesis
-    float hb_gain;
-    int sub, i, ret;
-
-    /* get output buffer */
-    frame->nb_samples = 4 * AMRWB_SFR_SIZE_16k;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    buf_out = (float *)frame->data[0];
-
-    header_size      = decode_mime_header(ctx, buf);
-    if (ctx->fr_cur_mode > MODE_SID) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Invalid mode %d\n", ctx->fr_cur_mode);
-        return AVERROR_INVALIDDATA;
-    }
-    expected_fr_size = ((cf_sizes_wb[ctx->fr_cur_mode] + 7) >> 3) + 1;
-
-    if (buf_size < expected_fr_size) {
-        av_log(avctx, AV_LOG_ERROR,
-            "Frame too small (%d bytes). Truncated file?\n", buf_size);
-        *got_frame_ptr = 0;
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!ctx->fr_quality || ctx->fr_cur_mode > MODE_SID)
-        av_log(avctx, AV_LOG_ERROR, "Encountered a bad or corrupted frame\n");
-
-    if (ctx->fr_cur_mode == MODE_SID) { /* Comfort noise frame */
-        avpriv_request_sample(avctx, "SID mode");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    ff_amr_bit_reorder((uint16_t *) &ctx->frame, sizeof(AMRWBFrame),
-        buf + header_size, amr_bit_orderings_by_mode[ctx->fr_cur_mode]);
-
-    /* Decode the quantized ISF vector */
-    if (ctx->fr_cur_mode == MODE_6k60) {
-        decode_isf_indices_36b(cf->isp_id, ctx->isf_cur);
-    } else {
-        decode_isf_indices_46b(cf->isp_id, ctx->isf_cur);
-    }
-
-    isf_add_mean_and_past(ctx->isf_cur, ctx->isf_q_past);
-    ff_set_min_dist_lsf(ctx->isf_cur, MIN_ISF_SPACING, LP_ORDER - 1);
-
-    stab_fac = stability_factor(ctx->isf_cur, ctx->isf_past_final);
-
-    ctx->isf_cur[LP_ORDER - 1] *= 2.0;
-    ff_acelp_lsf2lspd(ctx->isp[3], ctx->isf_cur, LP_ORDER);
-
-    /* Generate a ISP vector for each subframe */
-    if (ctx->first_frame) {
-        ctx->first_frame = 0;
-        memcpy(ctx->isp_sub4_past, ctx->isp[3], LP_ORDER * sizeof(double));
-    }
-    interpolate_isp(ctx->isp, ctx->isp_sub4_past);
-
-    for (sub = 0; sub < 4; sub++)
-        ff_amrwb_lsp2lpc(ctx->isp[sub], ctx->lp_coef[sub], LP_ORDER);
-
-    for (sub = 0; sub < 4; sub++) {
-        const AMRWBSubFrame *cur_subframe = &cf->subframe[sub];
-        float *sub_buf = buf_out + sub * AMRWB_SFR_SIZE_16k;
-
-        /* Decode adaptive codebook (pitch vector) */
-        decode_pitch_vector(ctx, cur_subframe, sub);
-        /* Decode innovative codebook (fixed vector) */
-        decode_fixed_vector(ctx->fixed_vector, cur_subframe->pul_ih,
-                            cur_subframe->pul_il, ctx->fr_cur_mode);
-
-        pitch_sharpening(ctx, ctx->fixed_vector);
-
-        decode_gains(cur_subframe->vq_gain, ctx->fr_cur_mode,
-                     &fixed_gain_factor, &ctx->pitch_gain[0]);
-
-        ctx->fixed_gain[0] =
-            ff_amr_set_fixed_gain(fixed_gain_factor,
-                                  avpriv_scalarproduct_float_c(ctx->fixed_vector,
-                                                               ctx->fixed_vector,
-                                                               AMRWB_SFR_SIZE) /
-                                  AMRWB_SFR_SIZE,
-                       ctx->prediction_error,
-                       ENERGY_MEAN, energy_pred_fac);
-
-        /* Calculate voice factor and store tilt for next subframe */
-        voice_fac      = voice_factor(ctx->pitch_vector, ctx->pitch_gain[0],
-                                      ctx->fixed_vector, ctx->fixed_gain[0]);
-        ctx->tilt_coef = voice_fac * 0.25 + 0.25;
-
-        /* Construct current excitation */
-        for (i = 0; i < AMRWB_SFR_SIZE; i++) {
-            ctx->excitation[i] *= ctx->pitch_gain[0];
-            ctx->excitation[i] += ctx->fixed_gain[0] * ctx->fixed_vector[i];
-            ctx->excitation[i] = truncf(ctx->excitation[i]);
-        }
-
-        /* Post-processing of excitation elements */
-        synth_fixed_gain = noise_enhancer(ctx->fixed_gain[0], &ctx->prev_tr_gain,
-                                          voice_fac, stab_fac);
-
-        synth_fixed_vector = anti_sparseness(ctx, ctx->fixed_vector,
-                                             spare_vector);
-
-        pitch_enhancer(synth_fixed_vector, voice_fac);
-
-        synthesis(ctx, ctx->lp_coef[sub], synth_exc, synth_fixed_gain,
-                  synth_fixed_vector, &ctx->samples_az[LP_ORDER]);
-
-        /* Synthesis speech post-processing */
-        de_emphasis(&ctx->samples_up[UPS_MEM_SIZE],
-                    &ctx->samples_az[LP_ORDER], PREEMPH_FAC, ctx->demph_mem);
-
-        ff_acelp_apply_order_2_transfer_function(&ctx->samples_up[UPS_MEM_SIZE],
-            &ctx->samples_up[UPS_MEM_SIZE], hpf_zeros, hpf_31_poles,
-            hpf_31_gain, ctx->hpf_31_mem, AMRWB_SFR_SIZE);
-
-        upsample_5_4(sub_buf, &ctx->samples_up[UPS_FIR_SIZE],
-                     AMRWB_SFR_SIZE_16k);
-
-        /* High frequency band (6.4 - 7.0 kHz) generation part */
-        ff_acelp_apply_order_2_transfer_function(hb_samples,
-            &ctx->samples_up[UPS_MEM_SIZE], hpf_zeros, hpf_400_poles,
-            hpf_400_gain, ctx->hpf_400_mem, AMRWB_SFR_SIZE);
-
-        hb_gain = find_hb_gain(ctx, hb_samples,
-                               cur_subframe->hb_gain, cf->vad);
-
-        scaled_hb_excitation(ctx, hb_exc, synth_exc, hb_gain);
-
-        hb_synthesis(ctx, sub, &ctx->samples_hb[LP_ORDER_16k],
-                     hb_exc, ctx->isf_cur, ctx->isf_past_final);
-
-        /* High-band post-processing filters */
-        hb_fir_filter(hb_samples, bpf_6_7_coef, ctx->bpf_6_7_mem,
-                      &ctx->samples_hb[LP_ORDER_16k]);
-
-        if (ctx->fr_cur_mode == MODE_23k85)
-            hb_fir_filter(hb_samples, lpf_7_coef, ctx->lpf_7_mem,
-                          hb_samples);
-
-        /* Add the low and high frequency bands */
-        for (i = 0; i < AMRWB_SFR_SIZE_16k; i++)
-            sub_buf[i] = (sub_buf[i] + hb_samples[i]) * (1.0f / (1 << 15));
-
-        /* Update buffers and history */
-        update_sub_state(ctx);
-    }
-
-    /* update state for next frame */
-    memcpy(ctx->isp_sub4_past, ctx->isp[3], LP_ORDER * sizeof(ctx->isp[3][0]));
-    memcpy(ctx->isf_past_final, ctx->isf_cur, LP_ORDER * sizeof(float));
-
-    *got_frame_ptr = 1;
-
-    return expected_fr_size;
-}
-
-AVCodec ff_amrwb_decoder = {
-    .name           = "amrwb",
-    .long_name      = NULL_IF_CONFIG_SMALL("AMR-WB (Adaptive Multi-Rate WideBand)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AMR_WB,
-    .priv_data_size = sizeof(AMRWBContext),
-    .init           = amrwb_decode_init,
-    .decode         = amrwb_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/anm.c b/deps/libav/libavcodec/anm.c
deleted file mode 100644
index 3d5affb..0000000
--- a/deps/libav/libavcodec/anm.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Deluxe Paint Animation decoder
- * Copyright (c) 2009 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Deluxe Paint Animation decoder
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-typedef struct AnmContext {
-    AVFrame *frame;
-    int palette[AVPALETTE_COUNT];
-    GetByteContext gb;
-    int x;  ///< x coordinate position
-} AnmContext;
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    AnmContext *s = avctx->priv_data;
-    int i;
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);
-    if (bytestream2_get_bytes_left(&s->gb) < 16 * 8 + 4 * 256)
-        return AVERROR_INVALIDDATA;
-
-    bytestream2_skipu(&s->gb, 16 * 8);
-    for (i = 0; i < 256; i++)
-        s->palette[i] = bytestream2_get_le32u(&s->gb);
-
-    return 0;
-}
-
-/**
- * Perform decode operation
- * @param dst     pointer to destination image buffer
- * @param dst_end pointer to end of destination image buffer
- * @param gb GetByteContext (optional, see below)
- * @param pixel Fill color (optional, see below)
- * @param count Pixel count
- * @param x Pointer to x-axis counter
- * @param width Image width
- * @param linesize Destination image buffer linesize
- * @return non-zero if destination buffer is exhausted
- *
- * a copy operation is achieved when 'gb' is set
- * a fill operation is achieved when 'gb' is null and pixel is >= 0
- * a skip operation is achieved when 'gb' is null and pixel is < 0
- */
-static inline int op(uint8_t **dst, const uint8_t *dst_end,
-                     GetByteContext *gb,
-                     int pixel, int count,
-                     int *x, int width, int linesize)
-{
-    int remaining = width - *x;
-    while(count > 0) {
-        int striplen = FFMIN(count, remaining);
-        if (gb) {
-            if (bytestream2_get_bytes_left(gb) < striplen)
-                goto exhausted;
-            bytestream2_get_bufferu(gb, *dst, striplen);
-        } else if (pixel >= 0)
-            memset(*dst, pixel, striplen);
-        *dst      += striplen;
-        remaining -= striplen;
-        count     -= striplen;
-        if (remaining <= 0) {
-            *dst      += linesize - width;
-            remaining  = width;
-        }
-        if (linesize > 0) {
-            if (*dst >= dst_end) goto exhausted;
-        } else {
-            if (*dst <= dst_end) goto exhausted;
-        }
-    }
-    *x = width - remaining;
-    return 0;
-
-exhausted:
-    *x = width - remaining;
-    return 1;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    AnmContext *s = avctx->priv_data;
-    const int buf_size = avpkt->size;
-    uint8_t *dst, *dst_end;
-    int count, ret;
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0){
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    dst     = s->frame->data[0];
-    dst_end = s->frame->data[0] + s->frame->linesize[0]*avctx->height;
-
-    bytestream2_init(&s->gb, avpkt->data, buf_size);
-
-    if (bytestream2_get_byte(&s->gb) != 0x42) {
-        avpriv_request_sample(avctx, "Unknown record type");
-        return buf_size;
-    }
-    if (bytestream2_get_byte(&s->gb)) {
-        avpriv_request_sample(avctx, "Padding bytes");
-        return buf_size;
-    }
-    bytestream2_skip(&s->gb, 2);
-
-    s->x = 0;
-    do {
-        /* if statements are ordered by probability */
-#define OP(gb, pixel, count) \
-    op(&dst, dst_end, (gb), (pixel), (count), &s->x, avctx->width, s->frame->linesize[0])
-
-        int type = bytestream2_get_byte(&s->gb);
-        count = type & 0x7F;
-        type >>= 7;
-        if (count) {
-            if (OP(type ? NULL : &s->gb, -1, count)) break;
-        } else if (!type) {
-            int pixel;
-            count = bytestream2_get_byte(&s->gb);  /* count==0 gives nop */
-            pixel = bytestream2_get_byte(&s->gb);
-            if (OP(NULL, pixel, count)) break;
-        } else {
-            int pixel;
-            type = bytestream2_get_le16(&s->gb);
-            count = type & 0x3FFF;
-            type >>= 14;
-            if (!count) {
-                if (type == 0)
-                    break; // stop
-                if (type == 2) {
-                    avpriv_request_sample(avctx, "Unknown opcode");
-                    return AVERROR_PATCHWELCOME;
-                }
-                continue;
-            }
-            pixel = type == 3 ? bytestream2_get_byte(&s->gb) : -1;
-            if (type == 1) count += 0x4000;
-            if (OP(type == 2 ? &s->gb : NULL, pixel, count)) break;
-        }
-    } while (bytestream2_get_bytes_left(&s->gb) > 0);
-
-    memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
-
-    *got_frame = 1;
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    return buf_size;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    AnmContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-    return 0;
-}
-
-AVCodec ff_anm_decoder = {
-    .name           = "anm",
-    .long_name      = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ANM,
-    .priv_data_size = sizeof(AnmContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/ansi.c b/deps/libav/libavcodec/ansi.c
deleted file mode 100644
index 95b5be4..0000000
--- a/deps/libav/libavcodec/ansi.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * ASCII/ANSI art decoder
- * Copyright (c) 2010 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ASCII/ANSI art decoder
- */
-
-#include "libavutil/common.h"
-#include "libavutil/frame.h"
-#include "libavutil/lfg.h"
-#include "avcodec.h"
-#include "cga_data.h"
-#include "internal.h"
-
-#define ATTR_BOLD         0x01  /**< Bold/Bright-foreground (mode 1) */
-#define ATTR_FAINT        0x02  /**< Faint (mode 2) */
-#define ATTR_UNDERLINE    0x08  /**< Underline (mode 4) */
-#define ATTR_BLINK        0x10  /**< Blink/Bright-background (mode 5) */
-#define ATTR_REVERSE      0x40  /**< Reverse (mode 7) */
-#define ATTR_CONCEALED    0x80  /**< Concealed (mode 8) */
-
-#define DEFAULT_FG_COLOR     7  /**< CGA color index */
-#define DEFAULT_BG_COLOR     0
-#define DEFAULT_SCREEN_MODE  3  /**< 80x25 */
-
-#define FONT_WIDTH           8  /**< Font width */
-
-/** map ansi color index to cga palette index */
-static const uint8_t ansi_to_cga[16] = {
-    0,  4,  2,  6,  1,  5,  3, 7, 8, 12, 10, 14,  9, 13, 11, 15
-};
-
-typedef struct {
-    AVFrame *frame;
-    int x;                /**< x cursor position (pixels) */
-    int y;                /**< y cursor position (pixels) */
-    int sx;               /**< saved x cursor position (pixels) */
-    int sy;               /**< saved y cursor position (pixels) */
-    const uint8_t* font;  /**< font */
-    int font_height;      /**< font height */
-    int attributes;       /**< attribute flags */
-    int fg;               /**< foreground color */
-    int bg;               /**< background color */
-
-    /* ansi parser state machine */
-    enum {
-        STATE_NORMAL = 0,
-        STATE_ESCAPE,
-        STATE_CODE,
-        STATE_MUSIC_PREAMBLE
-    } state;
-#define MAX_NB_ARGS 4
-    int args[MAX_NB_ARGS];
-    int nb_args;          /**< number of arguments (may exceed MAX_NB_ARGS) */
-} AnsiContext;
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    AnsiContext *s = avctx->priv_data;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    /* defaults */
-    s->font        = ff_vga16_font;
-    s->font_height = 16;
-    s->fg          = DEFAULT_FG_COLOR;
-    s->bg          = DEFAULT_BG_COLOR;
-
-    if (!avctx->width || !avctx->height)
-        ff_set_dimensions(avctx, 80 << 3, 25 << 4);
-
-    return 0;
-}
-
-static void hscroll(AVCodecContext *avctx)
-{
-    AnsiContext *s = avctx->priv_data;
-    int i;
-
-    if (s->y < avctx->height - s->font_height) {
-        s->y += s->font_height;
-        return;
-    }
-
-    i = 0;
-    for (; i < avctx->height - s->font_height; i++)
-        memcpy(s->frame->data[0] + i * s->frame->linesize[0],
-               s->frame->data[0] + (i + s->font_height) * s->frame->linesize[0],
-               avctx->width);
-    for (; i < avctx->height; i++)
-        memset(s->frame->data[0] + i * s->frame->linesize[0],
-            DEFAULT_BG_COLOR, avctx->width);
-}
-
-static void erase_line(AVCodecContext * avctx, int xoffset, int xlength)
-{
-    AnsiContext *s = avctx->priv_data;
-    int i;
-    for (i = 0; i < s->font_height; i++)
-        memset(s->frame->data[0] + (s->y + i)*s->frame->linesize[0] + xoffset,
-            DEFAULT_BG_COLOR, xlength);
-}
-
-static void erase_screen(AVCodecContext *avctx)
-{
-    AnsiContext *s = avctx->priv_data;
-    int i;
-    for (i = 0; i < avctx->height; i++)
-        memset(s->frame->data[0] + i * s->frame->linesize[0], DEFAULT_BG_COLOR, avctx->width);
-    s->x = s->y = 0;
-}
-
-/**
- * Draw character to screen
- */
-static void draw_char(AVCodecContext *avctx, int c)
-{
-    AnsiContext *s = avctx->priv_data;
-    int fg = s->fg;
-    int bg = s->bg;
-
-    if ((s->attributes & ATTR_BOLD))
-        fg += 8;
-    if ((s->attributes & ATTR_BLINK))
-        bg += 8;
-    if ((s->attributes & ATTR_REVERSE))
-        FFSWAP(int, fg, bg);
-    if ((s->attributes & ATTR_CONCEALED))
-        fg = bg;
-    ff_draw_pc_font(s->frame->data[0] + s->y * s->frame->linesize[0] + s->x,
-                    s->frame->linesize[0], s->font, s->font_height, c, fg, bg);
-    s->x += FONT_WIDTH;
-    if (s->x >= avctx->width) {
-        s->x = 0;
-        hscroll(avctx);
-    }
-}
-
-/**
- * Execute ANSI escape code
- * @return 0 on success, negative on error
- */
-static int execute_code(AVCodecContext * avctx, int c)
-{
-    AnsiContext *s = avctx->priv_data;
-    int ret, i;
-    int width = 0;
-    int height = 0;
-
-    switch(c) {
-    case 'A': //Cursor Up
-        s->y = FFMAX(s->y - (s->nb_args > 0 ? s->args[0]*s->font_height : s->font_height), 0);
-        break;
-    case 'B': //Cursor Down
-        s->y = FFMIN(s->y + (s->nb_args > 0 ? s->args[0]*s->font_height : s->font_height), avctx->height - s->font_height);
-        break;
-    case 'C': //Cursor Right
-        s->x = FFMIN(s->x + (s->nb_args > 0 ? s->args[0]*FONT_WIDTH : FONT_WIDTH), avctx->width  - FONT_WIDTH);
-        break;
-    case 'D': //Cursor Left
-        s->x = FFMAX(s->x - (s->nb_args > 0 ? s->args[0]*FONT_WIDTH : FONT_WIDTH), 0);
-        break;
-    case 'H': //Cursor Position
-    case 'f': //Horizontal and Vertical Position
-        s->y = s->nb_args > 0 ? av_clip((s->args[0] - 1)*s->font_height, 0, avctx->height - s->font_height) : 0;
-        s->x = s->nb_args > 1 ? av_clip((s->args[1] - 1)*FONT_WIDTH,     0, avctx->width  - FONT_WIDTH) : 0;
-        break;
-    case 'h': //set creen mode
-    case 'l': //reset screen mode
-        if (s->nb_args < 2)
-            s->args[0] = DEFAULT_SCREEN_MODE;
-        switch(s->args[0]) {
-        case 0: case 1: case 4: case 5: case 13: case 19: //320x200 (25 rows)
-            s->font = ff_cga_font;
-            s->font_height = 8;
-            width  = 40<<3;
-            height = 25<<3;
-            break;
-        case 2: case 3: //640x400 (25 rows)
-            s->font = ff_vga16_font;
-            s->font_height = 16;
-            width  = 80<<3;
-            height = 25<<4;
-            break;
-        case 6: case 14: //640x200 (25 rows)
-            s->font = ff_cga_font;
-            s->font_height = 8;
-            width  = 80<<3;
-            height = 25<<3;
-            break;
-        case 7: //set line wrapping
-            break;
-        case 15: case 16: //640x350 (43 rows)
-            s->font = ff_cga_font;
-            s->font_height = 8;
-            width  = 80<<3;
-            height = 43<<3;
-            break;
-        case 17: case 18: //640x480 (60 rows)
-            s->font = ff_cga_font;
-            s->font_height = 8;
-            width  = 80<<3;
-            height = 60<<4;
-            break;
-        default:
-            avpriv_request_sample(avctx, "Unsupported screen mode");
-        }
-        if (width != 0 && height != 0 &&
-            (width != avctx->width || height != avctx->height)) {
-            av_frame_unref(s->frame);
-            ret = ff_set_dimensions(avctx, width, height);
-            if (ret < 0)
-                return ret;
-            ret = ff_get_buffer(avctx, s->frame, AV_GET_BUFFER_FLAG_REF);
-            if (ret < 0) {
-                av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                return ret;
-            }
-            s->frame->pict_type           = AV_PICTURE_TYPE_I;
-            s->frame->palette_has_changed = 1;
-            memcpy(s->frame->data[1], ff_cga_palette, 16 * 4);
-            erase_screen(avctx);
-        } else if (c == 'l') {
-            erase_screen(avctx);
-        }
-        break;
-    case 'J': //Erase in Page
-        switch (s->args[0]) {
-        case 0:
-            erase_line(avctx, s->x, avctx->width - s->x);
-            if (s->y < avctx->height - s->font_height)
-                memset(s->frame->data[0] + (s->y + s->font_height)*s->frame->linesize[0],
-                    DEFAULT_BG_COLOR, (avctx->height - s->y - s->font_height)*s->frame->linesize[0]);
-            break;
-        case 1:
-            erase_line(avctx, 0, s->x);
-            if (s->y > 0)
-                memset(s->frame->data[0], DEFAULT_BG_COLOR, s->y * s->frame->linesize[0]);
-            break;
-        case 2:
-            erase_screen(avctx);
-        }
-        break;
-    case 'K': //Erase in Line
-        switch(s->args[0]) {
-        case 0:
-            erase_line(avctx, s->x, avctx->width - s->x);
-            break;
-        case 1:
-            erase_line(avctx, 0, s->x);
-            break;
-        case 2:
-            erase_line(avctx, 0, avctx->width);
-        }
-        break;
-    case 'm': //Select Graphics Rendition
-        if (s->nb_args == 0) {
-            s->nb_args = 1;
-            s->args[0] = 0;
-        }
-        for (i = 0; i < FFMIN(s->nb_args, MAX_NB_ARGS); i++) {
-            int m = s->args[i];
-            if (m == 0) {
-                s->attributes = 0;
-                s->fg = DEFAULT_FG_COLOR;
-                s->bg = DEFAULT_BG_COLOR;
-            } else if (m == 1 || m == 2 || m == 4 || m == 5 || m == 7 || m == 8) {
-                s->attributes |= 1 << (m - 1);
-            } else if (m >= 30 && m <= 38) {
-                s->fg = ansi_to_cga[m - 30];
-            } else if (m == 39) {
-                s->fg = ansi_to_cga[DEFAULT_FG_COLOR];
-            } else if (m >= 40 && m <= 47) {
-                s->bg = ansi_to_cga[m - 40];
-            } else if (m == 49) {
-                s->fg = ansi_to_cga[DEFAULT_BG_COLOR];
-            } else {
-                avpriv_request_sample(avctx, "Unsupported rendition parameter");
-            }
-        }
-        break;
-    case 'n': //Device Status Report
-    case 'R': //report current line and column
-        /* ignore */
-        break;
-    case 's': //Save Cursor Position
-        s->sx = s->x;
-        s->sy = s->y;
-        break;
-    case 'u': //Restore Cursor Position
-        s->x = av_clip(s->sx, 0, avctx->width  - FONT_WIDTH);
-        s->y = av_clip(s->sy, 0, avctx->height - s->font_height);
-        break;
-    default:
-        avpriv_request_sample(avctx, "Unknown escape code");
-        break;
-    }
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    AnsiContext *s = avctx->priv_data;
-    uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    const uint8_t *buf_end   = buf+buf_size;
-    int ret, i, count;
-
-    ret = ff_reget_buffer(avctx, s->frame);
-    if (ret < 0){
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    if (!avctx->frame_number) {
-        memset(s->frame->data[0], 0, avctx->height * FFABS(s->frame->linesize[0]));
-        memset(s->frame->data[1], 0, AVPALETTE_SIZE);
-    }
-
-    s->frame->pict_type           = AV_PICTURE_TYPE_I;
-    s->frame->palette_has_changed = 1;
-    memcpy(s->frame->data[1], ff_cga_palette, 16 * 4);
-
-    while(buf < buf_end) {
-        switch(s->state) {
-        case STATE_NORMAL:
-            switch (buf[0]) {
-            case 0x00: //NUL
-            case 0x07: //BEL
-            case 0x1A: //SUB
-                /* ignore */
-                break;
-            case 0x08: //BS
-                s->x = FFMAX(s->x - 1, 0);
-                break;
-            case 0x09: //HT
-                i = s->x / FONT_WIDTH;
-                count = ((i + 8) & ~7) - i;
-                for (i = 0; i < count; i++)
-                    draw_char(avctx, ' ');
-                break;
-            case 0x0A: //LF
-                hscroll(avctx);
-            case 0x0D: //CR
-                s->x = 0;
-                break;
-            case 0x0C: //FF
-                erase_screen(avctx);
-                break;
-            case 0x1B: //ESC
-                s->state = STATE_ESCAPE;
-                break;
-            default:
-                draw_char(avctx, buf[0]);
-            }
-            break;
-        case STATE_ESCAPE:
-            if (buf[0] == '[') {
-                s->state   = STATE_CODE;
-                s->nb_args = 0;
-                s->args[0] = 0;
-            } else {
-                s->state = STATE_NORMAL;
-                draw_char(avctx, 0x1B);
-                continue;
-            }
-            break;
-        case STATE_CODE:
-            switch(buf[0]) {
-            case '0': case '1': case '2': case '3': case '4':
-            case '5': case '6': case '7': case '8': case '9':
-                if (s->nb_args < MAX_NB_ARGS)
-                    s->args[s->nb_args] = s->args[s->nb_args] * 10 + buf[0] - '0';
-                break;
-            case ';':
-                s->nb_args++;
-                if (s->nb_args < MAX_NB_ARGS)
-                    s->args[s->nb_args] = 0;
-                break;
-            case 'M':
-                s->state = STATE_MUSIC_PREAMBLE;
-                break;
-            case '=': case '?':
-                /* ignore */
-                break;
-            default:
-                if (s->nb_args > MAX_NB_ARGS)
-                    av_log(avctx, AV_LOG_WARNING, "args overflow (%i)\n", s->nb_args);
-                if (s->nb_args < MAX_NB_ARGS && s->args[s->nb_args])
-                    s->nb_args++;
-                if ((ret = execute_code(avctx, buf[0])) < 0)
-                    return ret;
-                s->state = STATE_NORMAL;
-            }
-            break;
-        case STATE_MUSIC_PREAMBLE:
-            if (buf[0] == 0x0E || buf[0] == 0x1B)
-                s->state = STATE_NORMAL;
-            /* ignore music data */
-            break;
-        }
-        buf++;
-    }
-
-    *got_frame = 1;
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-    return buf_size;
-}
-
-static av_cold int decode_close(AVCodecContext *avctx)
-{
-    AnsiContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-    return 0;
-}
-
-AVCodec ff_ansi_decoder = {
-    .name           = "ansi",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ANSI,
-    .priv_data_size = sizeof(AnsiContext),
-    .init           = decode_init,
-    .close          = decode_close,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/apedec.c b/deps/libav/libavcodec/apedec.c
deleted file mode 100644
index 8669db8..0000000
--- a/deps/libav/libavcodec/apedec.c
+++ /dev/null
@@ -1,1581 +0,0 @@
-/*
- * Monkey's Audio lossless audio decoder
- * Copyright (c) 2007 Benjamin Zores <ben at geexbox.org>
- *  based upon libdemac from Dave Chapman.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "unary.h"
-
-/**
- * @file
- * Monkey's Audio lossless audio decoder
- */
-
-#define MAX_CHANNELS        2
-#define MAX_BYTESPERSAMPLE  3
-
-#define APE_FRAMECODE_MONO_SILENCE    1
-#define APE_FRAMECODE_STEREO_SILENCE  3
-#define APE_FRAMECODE_PSEUDO_STEREO   4
-
-#define HISTORY_SIZE 512
-#define PREDICTOR_ORDER 8
-/** Total size of all predictor histories */
-#define PREDICTOR_SIZE 50
-
-#define YDELAYA (18 + PREDICTOR_ORDER*4)
-#define YDELAYB (18 + PREDICTOR_ORDER*3)
-#define XDELAYA (18 + PREDICTOR_ORDER*2)
-#define XDELAYB (18 + PREDICTOR_ORDER)
-
-#define YADAPTCOEFFSA 18
-#define XADAPTCOEFFSA 14
-#define YADAPTCOEFFSB 10
-#define XADAPTCOEFFSB 5
-
-/**
- * Possible compression levels
- * @{
- */
-enum APECompressionLevel {
-    COMPRESSION_LEVEL_FAST       = 1000,
-    COMPRESSION_LEVEL_NORMAL     = 2000,
-    COMPRESSION_LEVEL_HIGH       = 3000,
-    COMPRESSION_LEVEL_EXTRA_HIGH = 4000,
-    COMPRESSION_LEVEL_INSANE     = 5000
-};
-/** @} */
-
-#define APE_FILTER_LEVELS 3
-
-/** Filter orders depending on compression level */
-static const uint16_t ape_filter_orders[5][APE_FILTER_LEVELS] = {
-    {  0,   0,    0 },
-    { 16,   0,    0 },
-    { 64,   0,    0 },
-    { 32, 256,    0 },
-    { 16, 256, 1280 }
-};
-
-/** Filter fraction bits depending on compression level */
-static const uint8_t ape_filter_fracbits[5][APE_FILTER_LEVELS] = {
-    {  0,  0,  0 },
-    { 11,  0,  0 },
-    { 11,  0,  0 },
-    { 10, 13,  0 },
-    { 11, 13, 15 }
-};
-
-
-/** Filters applied to the decoded data */
-typedef struct APEFilter {
-    int16_t *coeffs;        ///< actual coefficients used in filtering
-    int16_t *adaptcoeffs;   ///< adaptive filter coefficients used for correcting of actual filter coefficients
-    int16_t *historybuffer; ///< filter memory
-    int16_t *delay;         ///< filtered values
-
-    int avg;
-} APEFilter;
-
-typedef struct APERice {
-    uint32_t k;
-    uint32_t ksum;
-} APERice;
-
-typedef struct APERangecoder {
-    uint32_t low;           ///< low end of interval
-    uint32_t range;         ///< length of interval
-    uint32_t help;          ///< bytes_to_follow resp. intermediate value
-    unsigned int buffer;    ///< buffer for input/output
-} APERangecoder;
-
-/** Filter histories */
-typedef struct APEPredictor {
-    int32_t *buf;
-
-    int32_t lastA[2];
-
-    int32_t filterA[2];
-    int32_t filterB[2];
-
-    int32_t coeffsA[2][4];  ///< adaption coefficients
-    int32_t coeffsB[2][5];  ///< adaption coefficients
-    int32_t historybuffer[HISTORY_SIZE + PREDICTOR_SIZE];
-
-    unsigned int sample_pos;
-} APEPredictor;
-
-/** Decoder context */
-typedef struct APEContext {
-    AVClass *class;                          ///< class for AVOptions
-    AVCodecContext *avctx;
-    DSPContext dsp;
-    int channels;
-    int samples;                             ///< samples left to decode in current frame
-    int bps;
-
-    int fileversion;                         ///< codec version, very important in decoding process
-    int compression_level;                   ///< compression levels
-    int fset;                                ///< which filter set to use (calculated from compression level)
-    int flags;                               ///< global decoder flags
-
-    uint32_t CRC;                            ///< frame CRC
-    int frameflags;                          ///< frame flags
-    APEPredictor predictor;                  ///< predictor used for final reconstruction
-
-    int32_t *decoded_buffer;
-    int decoded_size;
-    int32_t *decoded[MAX_CHANNELS];          ///< decoded data for each channel
-    int blocks_per_loop;                     ///< maximum number of samples to decode for each call
-
-    int16_t* filterbuf[APE_FILTER_LEVELS];   ///< filter memory
-
-    APERangecoder rc;                        ///< rangecoder used to decode actual values
-    APERice riceX;                           ///< rice code parameters for the second channel
-    APERice riceY;                           ///< rice code parameters for the first channel
-    APEFilter filters[APE_FILTER_LEVELS][2]; ///< filters used for reconstruction
-    GetBitContext gb;
-
-    uint8_t *data;                           ///< current frame data
-    uint8_t *data_end;                       ///< frame data end
-    int data_size;                           ///< frame data allocated size
-    const uint8_t *ptr;                      ///< current position in frame data
-
-    int error;
-
-    void (*entropy_decode_mono)(struct APEContext *ctx, int blockstodecode);
-    void (*entropy_decode_stereo)(struct APEContext *ctx, int blockstodecode);
-    void (*predictor_decode_mono)(struct APEContext *ctx, int count);
-    void (*predictor_decode_stereo)(struct APEContext *ctx, int count);
-} APEContext;
-
-static void ape_apply_filters(APEContext *ctx, int32_t *decoded0,
-                              int32_t *decoded1, int count);
-
-static void entropy_decode_mono_0000(APEContext *ctx, int blockstodecode);
-static void entropy_decode_stereo_0000(APEContext *ctx, int blockstodecode);
-static void entropy_decode_mono_3860(APEContext *ctx, int blockstodecode);
-static void entropy_decode_stereo_3860(APEContext *ctx, int blockstodecode);
-static void entropy_decode_mono_3900(APEContext *ctx, int blockstodecode);
-static void entropy_decode_stereo_3900(APEContext *ctx, int blockstodecode);
-static void entropy_decode_stereo_3930(APEContext *ctx, int blockstodecode);
-static void entropy_decode_mono_3990(APEContext *ctx, int blockstodecode);
-static void entropy_decode_stereo_3990(APEContext *ctx, int blockstodecode);
-
-static void predictor_decode_mono_3800(APEContext *ctx, int count);
-static void predictor_decode_stereo_3800(APEContext *ctx, int count);
-static void predictor_decode_mono_3930(APEContext *ctx, int count);
-static void predictor_decode_stereo_3930(APEContext *ctx, int count);
-static void predictor_decode_mono_3950(APEContext *ctx, int count);
-static void predictor_decode_stereo_3950(APEContext *ctx, int count);
-
-// TODO: dsputilize
-
-static av_cold int ape_decode_close(AVCodecContext *avctx)
-{
-    APEContext *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < APE_FILTER_LEVELS; i++)
-        av_freep(&s->filterbuf[i]);
-
-    av_freep(&s->decoded_buffer);
-    av_freep(&s->data);
-    s->decoded_size = s->data_size = 0;
-
-    return 0;
-}
-
-static av_cold int ape_decode_init(AVCodecContext *avctx)
-{
-    APEContext *s = avctx->priv_data;
-    int i;
-
-    if (avctx->extradata_size != 6) {
-        av_log(avctx, AV_LOG_ERROR, "Incorrect extradata\n");
-        return AVERROR(EINVAL);
-    }
-    if (avctx->channels > 2) {
-        av_log(avctx, AV_LOG_ERROR, "Only mono and stereo is supported\n");
-        return AVERROR(EINVAL);
-    }
-    s->bps = avctx->bits_per_coded_sample;
-    switch (s->bps) {
-    case 8:
-        avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
-        break;
-    case 16:
-        avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-        break;
-    case 24:
-        avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
-        break;
-    default:
-        avpriv_request_sample(avctx,
-                              "%d bits per coded sample", s->bps);
-        return AVERROR_PATCHWELCOME;
-    }
-    s->avctx             = avctx;
-    s->channels          = avctx->channels;
-    s->fileversion       = AV_RL16(avctx->extradata);
-    s->compression_level = AV_RL16(avctx->extradata + 2);
-    s->flags             = AV_RL16(avctx->extradata + 4);
-
-    av_log(avctx, AV_LOG_DEBUG, "Compression Level: %d - Flags: %d\n",
-           s->compression_level, s->flags);
-    if (s->compression_level % 1000 || s->compression_level > COMPRESSION_LEVEL_INSANE ||
-        (s->fileversion < 3930 && s->compression_level == COMPRESSION_LEVEL_INSANE)) {
-        av_log(avctx, AV_LOG_ERROR, "Incorrect compression level %d\n",
-               s->compression_level);
-        return AVERROR_INVALIDDATA;
-    }
-    s->fset = s->compression_level / 1000 - 1;
-    for (i = 0; i < APE_FILTER_LEVELS; i++) {
-        if (!ape_filter_orders[s->fset][i])
-            break;
-        FF_ALLOC_OR_GOTO(avctx, s->filterbuf[i],
-                         (ape_filter_orders[s->fset][i] * 3 + HISTORY_SIZE) * 4,
-                         filter_alloc_fail);
-    }
-
-    if (s->fileversion < 3860) {
-        s->entropy_decode_mono   = entropy_decode_mono_0000;
-        s->entropy_decode_stereo = entropy_decode_stereo_0000;
-    } else if (s->fileversion < 3900) {
-        s->entropy_decode_mono   = entropy_decode_mono_3860;
-        s->entropy_decode_stereo = entropy_decode_stereo_3860;
-    } else if (s->fileversion < 3930) {
-        s->entropy_decode_mono   = entropy_decode_mono_3900;
-        s->entropy_decode_stereo = entropy_decode_stereo_3900;
-    } else if (s->fileversion < 3990) {
-        s->entropy_decode_mono   = entropy_decode_mono_3900;
-        s->entropy_decode_stereo = entropy_decode_stereo_3930;
-    } else {
-        s->entropy_decode_mono   = entropy_decode_mono_3990;
-        s->entropy_decode_stereo = entropy_decode_stereo_3990;
-    }
-
-    if (s->fileversion < 3930) {
-        s->predictor_decode_mono   = predictor_decode_mono_3800;
-        s->predictor_decode_stereo = predictor_decode_stereo_3800;
-    } else if (s->fileversion < 3950) {
-        s->predictor_decode_mono   = predictor_decode_mono_3930;
-        s->predictor_decode_stereo = predictor_decode_stereo_3930;
-    } else {
-        s->predictor_decode_mono   = predictor_decode_mono_3950;
-        s->predictor_decode_stereo = predictor_decode_stereo_3950;
-    }
-
-    ff_dsputil_init(&s->dsp, avctx);
-    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
-
-    return 0;
-filter_alloc_fail:
-    ape_decode_close(avctx);
-    return AVERROR(ENOMEM);
-}
-
-/**
- * @name APE range decoding functions
- * @{
- */
-
-#define CODE_BITS    32
-#define TOP_VALUE    ((unsigned int)1 << (CODE_BITS-1))
-#define SHIFT_BITS   (CODE_BITS - 9)
-#define EXTRA_BITS   ((CODE_BITS-2) % 8 + 1)
-#define BOTTOM_VALUE (TOP_VALUE >> 8)
-
-/** Start the decoder */
-static inline void range_start_decoding(APEContext *ctx)
-{
-    ctx->rc.buffer = bytestream_get_byte(&ctx->ptr);
-    ctx->rc.low    = ctx->rc.buffer >> (8 - EXTRA_BITS);
-    ctx->rc.range  = (uint32_t) 1 << EXTRA_BITS;
-}
-
-/** Perform normalization */
-static inline void range_dec_normalize(APEContext *ctx)
-{
-    while (ctx->rc.range <= BOTTOM_VALUE) {
-        ctx->rc.buffer <<= 8;
-        if(ctx->ptr < ctx->data_end) {
-            ctx->rc.buffer += *ctx->ptr;
-            ctx->ptr++;
-        } else {
-            ctx->error = 1;
-        }
-        ctx->rc.low    = (ctx->rc.low << 8)    | ((ctx->rc.buffer >> 1) & 0xFF);
-        ctx->rc.range  <<= 8;
-    }
-}
-
-/**
- * Calculate culmulative frequency for next symbol. Does NO update!
- * @param ctx decoder context
- * @param tot_f is the total frequency or (code_value)1<<shift
- * @return the culmulative frequency
- */
-static inline int range_decode_culfreq(APEContext *ctx, int tot_f)
-{
-    range_dec_normalize(ctx);
-    ctx->rc.help = ctx->rc.range / tot_f;
-    return ctx->rc.low / ctx->rc.help;
-}
-
-/**
- * Decode value with given size in bits
- * @param ctx decoder context
- * @param shift number of bits to decode
- */
-static inline int range_decode_culshift(APEContext *ctx, int shift)
-{
-    range_dec_normalize(ctx);
-    ctx->rc.help = ctx->rc.range >> shift;
-    return ctx->rc.low / ctx->rc.help;
-}
-
-
-/**
- * Update decoding state
- * @param ctx decoder context
- * @param sy_f the interval length (frequency of the symbol)
- * @param lt_f the lower end (frequency sum of < symbols)
- */
-static inline void range_decode_update(APEContext *ctx, int sy_f, int lt_f)
-{
-    ctx->rc.low  -= ctx->rc.help * lt_f;
-    ctx->rc.range = ctx->rc.help * sy_f;
-}
-
-/** Decode n bits (n <= 16) without modelling */
-static inline int range_decode_bits(APEContext *ctx, int n)
-{
-    int sym = range_decode_culshift(ctx, n);
-    range_decode_update(ctx, 1, sym);
-    return sym;
-}
-
-
-#define MODEL_ELEMENTS 64
-
-/**
- * Fixed probabilities for symbols in Monkey Audio version 3.97
- */
-static const uint16_t counts_3970[22] = {
-        0, 14824, 28224, 39348, 47855, 53994, 58171, 60926,
-    62682, 63786, 64463, 64878, 65126, 65276, 65365, 65419,
-    65450, 65469, 65480, 65487, 65491, 65493,
-};
-
-/**
- * Probability ranges for symbols in Monkey Audio version 3.97
- */
-static const uint16_t counts_diff_3970[21] = {
-    14824, 13400, 11124, 8507, 6139, 4177, 2755, 1756,
-    1104, 677, 415, 248, 150, 89, 54, 31,
-    19, 11, 7, 4, 2,
-};
-
-/**
- * Fixed probabilities for symbols in Monkey Audio version 3.98
- */
-static const uint16_t counts_3980[22] = {
-        0, 19578, 36160, 48417, 56323, 60899, 63265, 64435,
-    64971, 65232, 65351, 65416, 65447, 65466, 65476, 65482,
-    65485, 65488, 65490, 65491, 65492, 65493,
-};
-
-/**
- * Probability ranges for symbols in Monkey Audio version 3.98
- */
-static const uint16_t counts_diff_3980[21] = {
-    19578, 16582, 12257, 7906, 4576, 2366, 1170, 536,
-    261, 119, 65, 31, 19, 10, 6, 3,
-    3, 2, 1, 1, 1,
-};
-
-/**
- * Decode symbol
- * @param ctx decoder context
- * @param counts probability range start position
- * @param counts_diff probability range widths
- */
-static inline int range_get_symbol(APEContext *ctx,
-                                   const uint16_t counts[],
-                                   const uint16_t counts_diff[])
-{
-    int symbol, cf;
-
-    cf = range_decode_culshift(ctx, 16);
-
-    if(cf > 65492){
-        symbol= cf - 65535 + 63;
-        range_decode_update(ctx, 1, cf);
-        if(cf > 65535)
-            ctx->error=1;
-        return symbol;
-    }
-    /* figure out the symbol inefficiently; a binary search would be much better */
-    for (symbol = 0; counts[symbol + 1] <= cf; symbol++);
-
-    range_decode_update(ctx, counts_diff[symbol], counts[symbol]);
-
-    return symbol;
-}
-/** @} */ // group rangecoder
-
-static inline void update_rice(APERice *rice, unsigned int x)
-{
-    int lim = rice->k ? (1 << (rice->k + 4)) : 0;
-    rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
-
-    if (rice->ksum < lim)
-        rice->k--;
-    else if (rice->ksum >= (1 << (rice->k + 5)))
-        rice->k++;
-}
-
-static inline int get_rice_ook(GetBitContext *gb, int k)
-{
-    unsigned int x;
-
-    x = get_unary(gb, 1, get_bits_left(gb));
-
-    if (k)
-        x = (x << k) | get_bits(gb, k);
-
-    return x;
-}
-
-static inline int ape_decode_value_3860(APEContext *ctx, GetBitContext *gb,
-                                        APERice *rice)
-{
-    unsigned int x, overflow;
-
-    overflow = get_unary(gb, 1, get_bits_left(gb));
-
-    if (ctx->fileversion > 3880) {
-        while (overflow >= 16) {
-            overflow -= 16;
-            rice->k  += 4;
-        }
-    }
-
-    if (!rice->k)
-        x = overflow;
-    else
-        x = (overflow << rice->k) + get_bits(gb, rice->k);
-
-    rice->ksum += x - (rice->ksum + 8 >> 4);
-    if (rice->ksum < (rice->k ? 1 << (rice->k + 4) : 0))
-        rice->k--;
-    else if (rice->ksum >= (1 << (rice->k + 5)) && rice->k < 24)
-        rice->k++;
-
-    /* Convert to signed */
-    if (x & 1)
-        return (x >> 1) + 1;
-    else
-        return -(x >> 1);
-}
-
-static inline int ape_decode_value_3900(APEContext *ctx, APERice *rice)
-{
-    unsigned int x, overflow;
-    int tmpk;
-
-    overflow = range_get_symbol(ctx, counts_3970, counts_diff_3970);
-
-    if (overflow == (MODEL_ELEMENTS - 1)) {
-        tmpk = range_decode_bits(ctx, 5);
-        overflow = 0;
-    } else
-        tmpk = (rice->k < 1) ? 0 : rice->k - 1;
-
-    if (tmpk <= 16 || ctx->fileversion < 3910)
-        x = range_decode_bits(ctx, tmpk);
-    else if (tmpk <= 32) {
-        x = range_decode_bits(ctx, 16);
-        x |= (range_decode_bits(ctx, tmpk - 16) << 16);
-    } else {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Too many bits: %d\n", tmpk);
-        return AVERROR_INVALIDDATA;
-    }
-    x += overflow << tmpk;
-
-    update_rice(rice, x);
-
-    /* Convert to signed */
-    if (x & 1)
-        return (x >> 1) + 1;
-    else
-        return -(x >> 1);
-}
-
-static inline int ape_decode_value_3990(APEContext *ctx, APERice *rice)
-{
-    unsigned int x, overflow;
-    int base, pivot;
-
-    pivot = rice->ksum >> 5;
-    if (pivot == 0)
-        pivot = 1;
-
-    overflow = range_get_symbol(ctx, counts_3980, counts_diff_3980);
-
-    if (overflow == (MODEL_ELEMENTS - 1)) {
-        overflow  = range_decode_bits(ctx, 16) << 16;
-        overflow |= range_decode_bits(ctx, 16);
-    }
-
-    if (pivot < 0x10000) {
-        base = range_decode_culfreq(ctx, pivot);
-        range_decode_update(ctx, 1, base);
-    } else {
-        int base_hi = pivot, base_lo;
-        int bbits = 0;
-
-        while (base_hi & ~0xFFFF) {
-            base_hi >>= 1;
-            bbits++;
-        }
-        base_hi = range_decode_culfreq(ctx, base_hi + 1);
-        range_decode_update(ctx, 1, base_hi);
-        base_lo = range_decode_culfreq(ctx, 1 << bbits);
-        range_decode_update(ctx, 1, base_lo);
-
-        base = (base_hi << bbits) + base_lo;
-    }
-
-    x = base + overflow * pivot;
-
-    update_rice(rice, x);
-
-    /* Convert to signed */
-    if (x & 1)
-        return (x >> 1) + 1;
-    else
-        return -(x >> 1);
-}
-
-static void decode_array_0000(APEContext *ctx, GetBitContext *gb,
-                              int32_t *out, APERice *rice, int blockstodecode)
-{
-    int i;
-    int ksummax, ksummin;
-
-    rice->ksum = 0;
-    for (i = 0; i < 5; i++) {
-        out[i] = get_rice_ook(&ctx->gb, 10);
-        rice->ksum += out[i];
-    }
-    rice->k = av_log2(rice->ksum / 10) + 1;
-    for (; i < 64; i++) {
-        out[i] = get_rice_ook(&ctx->gb, rice->k);
-        rice->ksum += out[i];
-        rice->k = av_log2(rice->ksum / ((i + 1) * 2)) + 1;
-    }
-    ksummax = 1 << rice->k + 7;
-    ksummin = rice->k ? (1 << rice->k + 6) : 0;
-    for (; i < blockstodecode; i++) {
-        out[i] = get_rice_ook(&ctx->gb, rice->k);
-        rice->ksum += out[i] - out[i - 64];
-        while (rice->ksum < ksummin) {
-            rice->k--;
-            ksummin = rice->k ? ksummin >> 1 : 0;
-            ksummax >>= 1;
-        }
-        while (rice->ksum >= ksummax) {
-            rice->k++;
-            if (rice->k > 24)
-                return;
-            ksummax <<= 1;
-            ksummin = ksummin ? ksummin << 1 : 128;
-        }
-    }
-
-    for (i = 0; i < blockstodecode; i++) {
-        if (out[i] & 1)
-            out[i] = (out[i] >> 1) + 1;
-        else
-            out[i] = -(out[i] >> 1);
-    }
-}
-
-static void entropy_decode_mono_0000(APEContext *ctx, int blockstodecode)
-{
-    decode_array_0000(ctx, &ctx->gb, ctx->decoded[0], &ctx->riceY,
-                      blockstodecode);
-}
-
-static void entropy_decode_stereo_0000(APEContext *ctx, int blockstodecode)
-{
-    decode_array_0000(ctx, &ctx->gb, ctx->decoded[0], &ctx->riceY,
-                      blockstodecode);
-    decode_array_0000(ctx, &ctx->gb, ctx->decoded[1], &ctx->riceX,
-                      blockstodecode);
-}
-
-static void entropy_decode_mono_3860(APEContext *ctx, int blockstodecode)
-{
-    int32_t *decoded0 = ctx->decoded[0];
-
-    while (blockstodecode--)
-        *decoded0++ = ape_decode_value_3860(ctx, &ctx->gb, &ctx->riceY);
-}
-
-static void entropy_decode_stereo_3860(APEContext *ctx, int blockstodecode)
-{
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t *decoded1 = ctx->decoded[1];
-    int blocks = blockstodecode;
-
-    while (blockstodecode--)
-        *decoded0++ = ape_decode_value_3860(ctx, &ctx->gb, &ctx->riceY);
-    while (blocks--)
-        *decoded1++ = ape_decode_value_3860(ctx, &ctx->gb, &ctx->riceX);
-}
-
-static void entropy_decode_mono_3900(APEContext *ctx, int blockstodecode)
-{
-    int32_t *decoded0 = ctx->decoded[0];
-
-    while (blockstodecode--)
-        *decoded0++ = ape_decode_value_3900(ctx, &ctx->riceY);
-}
-
-static void entropy_decode_stereo_3900(APEContext *ctx, int blockstodecode)
-{
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t *decoded1 = ctx->decoded[1];
-    int blocks = blockstodecode;
-
-    while (blockstodecode--)
-        *decoded0++ = ape_decode_value_3900(ctx, &ctx->riceY);
-    range_dec_normalize(ctx);
-    // because of some implementation peculiarities we need to backpedal here
-    ctx->ptr -= 1;
-    range_start_decoding(ctx);
-    while (blocks--)
-        *decoded1++ = ape_decode_value_3900(ctx, &ctx->riceX);
-}
-
-static void entropy_decode_stereo_3930(APEContext *ctx, int blockstodecode)
-{
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t *decoded1 = ctx->decoded[1];
-
-    while (blockstodecode--) {
-        *decoded0++ = ape_decode_value_3900(ctx, &ctx->riceY);
-        *decoded1++ = ape_decode_value_3900(ctx, &ctx->riceX);
-    }
-}
-
-static void entropy_decode_mono_3990(APEContext *ctx, int blockstodecode)
-{
-    int32_t *decoded0 = ctx->decoded[0];
-
-    while (blockstodecode--)
-        *decoded0++ = ape_decode_value_3990(ctx, &ctx->riceY);
-}
-
-static void entropy_decode_stereo_3990(APEContext *ctx, int blockstodecode)
-{
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t *decoded1 = ctx->decoded[1];
-
-    while (blockstodecode--) {
-        *decoded0++ = ape_decode_value_3990(ctx, &ctx->riceY);
-        *decoded1++ = ape_decode_value_3990(ctx, &ctx->riceX);
-    }
-}
-
-static int init_entropy_decoder(APEContext *ctx)
-{
-    /* Read the CRC */
-    if (ctx->fileversion >= 3900) {
-        if (ctx->data_end - ctx->ptr < 6)
-            return AVERROR_INVALIDDATA;
-        ctx->CRC = bytestream_get_be32(&ctx->ptr);
-    } else {
-        ctx->CRC = get_bits_long(&ctx->gb, 32);
-    }
-
-    /* Read the frame flags if they exist */
-    ctx->frameflags = 0;
-    if ((ctx->fileversion > 3820) && (ctx->CRC & 0x80000000)) {
-        ctx->CRC &= ~0x80000000;
-
-        if (ctx->data_end - ctx->ptr < 6)
-            return AVERROR_INVALIDDATA;
-        ctx->frameflags = bytestream_get_be32(&ctx->ptr);
-    }
-
-    /* Initialize the rice structs */
-    ctx->riceX.k = 10;
-    ctx->riceX.ksum = (1 << ctx->riceX.k) * 16;
-    ctx->riceY.k = 10;
-    ctx->riceY.ksum = (1 << ctx->riceY.k) * 16;
-
-    if (ctx->fileversion >= 3900) {
-        /* The first 8 bits of input are ignored. */
-        ctx->ptr++;
-
-        range_start_decoding(ctx);
-    }
-
-    return 0;
-}
-
-static const int32_t initial_coeffs_fast_3320[1] = {
-    375,
-};
-
-static const int32_t initial_coeffs_a_3800[3] = {
-    64, 115, 64,
-};
-
-static const int32_t initial_coeffs_b_3800[2] = {
-    740, 0
-};
-
-static const int32_t initial_coeffs_3930[4] = {
-    360, 317, -109, 98
-};
-
-static void init_predictor_decoder(APEContext *ctx)
-{
-    APEPredictor *p = &ctx->predictor;
-
-    /* Zero the history buffers */
-    memset(p->historybuffer, 0, PREDICTOR_SIZE * sizeof(*p->historybuffer));
-    p->buf = p->historybuffer;
-
-    /* Initialize and zero the coefficients */
-    if (ctx->fileversion < 3930) {
-        if (ctx->compression_level == COMPRESSION_LEVEL_FAST) {
-            memcpy(p->coeffsA[0], initial_coeffs_fast_3320,
-                   sizeof(initial_coeffs_fast_3320));
-            memcpy(p->coeffsA[1], initial_coeffs_fast_3320,
-                   sizeof(initial_coeffs_fast_3320));
-        } else {
-            memcpy(p->coeffsA[0], initial_coeffs_a_3800,
-                   sizeof(initial_coeffs_a_3800));
-            memcpy(p->coeffsA[1], initial_coeffs_a_3800,
-                   sizeof(initial_coeffs_a_3800));
-        }
-    } else {
-        memcpy(p->coeffsA[0], initial_coeffs_3930, sizeof(initial_coeffs_3930));
-        memcpy(p->coeffsA[1], initial_coeffs_3930, sizeof(initial_coeffs_3930));
-    }
-    memset(p->coeffsB, 0, sizeof(p->coeffsB));
-    if (ctx->fileversion < 3930) {
-        memcpy(p->coeffsB[0], initial_coeffs_b_3800,
-               sizeof(initial_coeffs_b_3800));
-        memcpy(p->coeffsB[1], initial_coeffs_b_3800,
-               sizeof(initial_coeffs_b_3800));
-    }
-
-    p->filterA[0] = p->filterA[1] = 0;
-    p->filterB[0] = p->filterB[1] = 0;
-    p->lastA[0]   = p->lastA[1]   = 0;
-
-    p->sample_pos = 0;
-}
-
-/** Get inverse sign of integer (-1 for positive, 1 for negative and 0 for zero) */
-static inline int APESIGN(int32_t x) {
-    return (x < 0) - (x > 0);
-}
-
-static av_always_inline int filter_fast_3320(APEPredictor *p,
-                                             const int decoded, const int filter,
-                                             const int delayA)
-{
-    int32_t predictionA;
-
-    p->buf[delayA] = p->lastA[filter];
-    if (p->sample_pos < 3) {
-        p->lastA[filter]   = decoded;
-        p->filterA[filter] = decoded;
-        return decoded;
-    }
-
-    predictionA = p->buf[delayA] * 2 - p->buf[delayA - 1];
-    p->lastA[filter] = decoded + (predictionA  * p->coeffsA[filter][0] >> 9);
-
-    if ((decoded ^ predictionA) > 0)
-        p->coeffsA[filter][0]++;
-    else
-        p->coeffsA[filter][0]--;
-
-    p->filterA[filter] += p->lastA[filter];
-
-    return p->filterA[filter];
-}
-
-static av_always_inline int filter_3800(APEPredictor *p,
-                                        const int decoded, const int filter,
-                                        const int delayA,  const int delayB,
-                                        const int start,   const int shift)
-{
-    int32_t predictionA, predictionB, sign;
-    int32_t d0, d1, d2, d3, d4;
-
-    p->buf[delayA] = p->lastA[filter];
-    p->buf[delayB] = p->filterB[filter];
-    if (p->sample_pos < start) {
-        predictionA = decoded + p->filterA[filter];
-        p->lastA[filter]   = decoded;
-        p->filterB[filter] = decoded;
-        p->filterA[filter] = predictionA;
-        return predictionA;
-    }
-    d2 =  p->buf[delayA];
-    d1 = (p->buf[delayA] - p->buf[delayA - 1]) << 1;
-    d0 =  p->buf[delayA] + ((p->buf[delayA - 2] - p->buf[delayA - 1]) << 3);
-    d3 =  p->buf[delayB] * 2 - p->buf[delayB - 1];
-    d4 =  p->buf[delayB];
-
-    predictionA = d0 * p->coeffsA[filter][0] +
-                  d1 * p->coeffsA[filter][1] +
-                  d2 * p->coeffsA[filter][2];
-
-    sign = APESIGN(decoded);
-    p->coeffsA[filter][0] += (((d0 >> 30) & 2) - 1) * sign;
-    p->coeffsA[filter][1] += (((d1 >> 28) & 8) - 4) * sign;
-    p->coeffsA[filter][2] += (((d2 >> 28) & 8) - 4) * sign;
-
-    predictionB = d3 * p->coeffsB[filter][0] -
-                  d4 * p->coeffsB[filter][1];
-    p->lastA[filter] = decoded + (predictionA >> 11);
-    sign = APESIGN(p->lastA[filter]);
-    p->coeffsB[filter][0] += (((d3 >> 29) & 4) - 2) * sign;
-    p->coeffsB[filter][1] -= (((d4 >> 30) & 2) - 1) * sign;
-
-    p->filterB[filter] = p->lastA[filter] + (predictionB >> shift);
-    p->filterA[filter] = p->filterB[filter] + ((p->filterA[filter] * 31) >> 5);
-
-    return p->filterA[filter];
-}
-
-static void long_filter_high_3800(int32_t *buffer, int order, int shift,
-                                  int32_t *coeffs, int32_t *delay, int length)
-{
-    int i, j;
-    int32_t dotprod, sign;
-
-    memset(coeffs, 0, order * sizeof(*coeffs));
-    for (i = 0; i < order; i++)
-        delay[i] = buffer[i];
-    for (i = order; i < length; i++) {
-        dotprod = 0;
-        sign = APESIGN(buffer[i]);
-        for (j = 0; j < order; j++) {
-            dotprod += delay[j] * coeffs[j];
-            coeffs[j] -= (((delay[j] >> 30) & 2) - 1) * sign;
-        }
-        buffer[i] -= dotprod >> shift;
-        for (j = 0; j < order - 1; j++)
-            delay[j] = delay[j + 1];
-        delay[order - 1] = buffer[i];
-    }
-}
-
-static void long_filter_ehigh_3830(int32_t *buffer, int length)
-{
-    int i, j;
-    int32_t dotprod, sign;
-    int32_t coeffs[8], delay[8];
-
-    memset(coeffs, 0, sizeof(coeffs));
-    memset(delay,  0, sizeof(delay));
-    for (i = 0; i < length; i++) {
-        dotprod = 0;
-        sign = APESIGN(buffer[i]);
-        for (j = 7; j >= 0; j--) {
-            dotprod += delay[j] * coeffs[j];
-            coeffs[j] -= (((delay[j] >> 30) & 2) - 1) * sign;
-        }
-        for (j = 7; j > 0; j--)
-            delay[j] = delay[j - 1];
-        delay[0] = buffer[i];
-        buffer[i] -= dotprod >> 9;
-    }
-}
-
-static void predictor_decode_stereo_3800(APEContext *ctx, int count)
-{
-    APEPredictor *p = &ctx->predictor;
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t *decoded1 = ctx->decoded[1];
-    int32_t coeffs[256], delay[256];
-    int start = 4, shift = 10;
-
-    if (ctx->compression_level == COMPRESSION_LEVEL_HIGH) {
-        start = 16;
-        long_filter_high_3800(decoded0, 16, 9, coeffs, delay, count);
-        long_filter_high_3800(decoded1, 16, 9, coeffs, delay, count);
-    } else if (ctx->compression_level == COMPRESSION_LEVEL_EXTRA_HIGH) {
-        int order = 128, shift2 = 11;
-
-        if (ctx->fileversion >= 3830) {
-            order <<= 1;
-            shift++;
-            shift2++;
-            long_filter_ehigh_3830(decoded0 + order, count - order);
-            long_filter_ehigh_3830(decoded1 + order, count - order);
-        }
-        start = order;
-        long_filter_high_3800(decoded0, order, shift2, coeffs, delay, count);
-        long_filter_high_3800(decoded1, order, shift2, coeffs, delay, count);
-    }
-
-    while (count--) {
-        int X = *decoded0, Y = *decoded1;
-        if (ctx->compression_level == COMPRESSION_LEVEL_FAST) {
-            *decoded0 = filter_fast_3320(p, Y, 0, YDELAYA);
-            decoded0++;
-            *decoded1 = filter_fast_3320(p, X, 1, XDELAYA);
-            decoded1++;
-        } else {
-            *decoded0 = filter_3800(p, Y, 0, YDELAYA, YDELAYB,
-                                    start, shift);
-            decoded0++;
-            *decoded1 = filter_3800(p, X, 1, XDELAYA, XDELAYB,
-                                    start, shift);
-            decoded1++;
-        }
-
-        /* Combined */
-        p->buf++;
-        p->sample_pos++;
-
-        /* Have we filled the history buffer? */
-        if (p->buf == p->historybuffer + HISTORY_SIZE) {
-            memmove(p->historybuffer, p->buf,
-                    PREDICTOR_SIZE * sizeof(*p->historybuffer));
-            p->buf = p->historybuffer;
-        }
-    }
-}
-
-static void predictor_decode_mono_3800(APEContext *ctx, int count)
-{
-    APEPredictor *p = &ctx->predictor;
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t coeffs[256], delay[256];
-    int start = 4, shift = 10;
-
-    if (ctx->compression_level == COMPRESSION_LEVEL_HIGH) {
-        start = 16;
-        long_filter_high_3800(decoded0, 16, 9, coeffs, delay, count);
-    } else if (ctx->compression_level == COMPRESSION_LEVEL_EXTRA_HIGH) {
-        int order = 128, shift2 = 11;
-
-        if (ctx->fileversion >= 3830) {
-            order <<= 1;
-            shift++;
-            shift2++;
-            long_filter_ehigh_3830(decoded0 + order, count - order);
-        }
-        start = order;
-        long_filter_high_3800(decoded0, order, shift2, coeffs, delay, count);
-    }
-
-    while (count--) {
-        if (ctx->compression_level == COMPRESSION_LEVEL_FAST) {
-            *decoded0 = filter_fast_3320(p, *decoded0, 0, YDELAYA);
-            decoded0++;
-        } else {
-            *decoded0 = filter_3800(p, *decoded0, 0, YDELAYA, YDELAYB,
-                                    start, shift);
-            decoded0++;
-        }
-
-        /* Combined */
-        p->buf++;
-        p->sample_pos++;
-
-        /* Have we filled the history buffer? */
-        if (p->buf == p->historybuffer + HISTORY_SIZE) {
-            memmove(p->historybuffer, p->buf,
-                    PREDICTOR_SIZE * sizeof(*p->historybuffer));
-            p->buf = p->historybuffer;
-        }
-    }
-}
-
-static av_always_inline int predictor_update_3930(APEPredictor *p,
-                                                  const int decoded, const int filter,
-                                                  const int delayA)
-{
-    int32_t predictionA, sign;
-    int32_t d0, d1, d2, d3;
-
-    p->buf[delayA]     = p->lastA[filter];
-    d0 = p->buf[delayA    ];
-    d1 = p->buf[delayA    ] - p->buf[delayA - 1];
-    d2 = p->buf[delayA - 1] - p->buf[delayA - 2];
-    d3 = p->buf[delayA - 2] - p->buf[delayA - 3];
-
-    predictionA = d0 * p->coeffsA[filter][0] +
-                  d1 * p->coeffsA[filter][1] +
-                  d2 * p->coeffsA[filter][2] +
-                  d3 * p->coeffsA[filter][3];
-
-    p->lastA[filter] = decoded + (predictionA >> 9);
-    p->filterA[filter] = p->lastA[filter] + ((p->filterA[filter] * 31) >> 5);
-
-    sign = APESIGN(decoded);
-    p->coeffsA[filter][0] += ((d0 < 0) * 2 - 1) * sign;
-    p->coeffsA[filter][1] += ((d1 < 0) * 2 - 1) * sign;
-    p->coeffsA[filter][2] += ((d2 < 0) * 2 - 1) * sign;
-    p->coeffsA[filter][3] += ((d3 < 0) * 2 - 1) * sign;
-
-    return p->filterA[filter];
-}
-
-static void predictor_decode_stereo_3930(APEContext *ctx, int count)
-{
-    APEPredictor *p = &ctx->predictor;
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t *decoded1 = ctx->decoded[1];
-
-    ape_apply_filters(ctx, ctx->decoded[0], ctx->decoded[1], count);
-
-    while (count--) {
-        /* Predictor Y */
-        int Y = *decoded1, X = *decoded0;
-        *decoded0 = predictor_update_3930(p, Y, 0, YDELAYA);
-        decoded0++;
-        *decoded1 = predictor_update_3930(p, X, 1, XDELAYA);
-        decoded1++;
-
-        /* Combined */
-        p->buf++;
-
-        /* Have we filled the history buffer? */
-        if (p->buf == p->historybuffer + HISTORY_SIZE) {
-            memmove(p->historybuffer, p->buf,
-                    PREDICTOR_SIZE * sizeof(*p->historybuffer));
-            p->buf = p->historybuffer;
-        }
-    }
-}
-
-static void predictor_decode_mono_3930(APEContext *ctx, int count)
-{
-    APEPredictor *p = &ctx->predictor;
-    int32_t *decoded0 = ctx->decoded[0];
-
-    ape_apply_filters(ctx, ctx->decoded[0], NULL, count);
-
-    while (count--) {
-        *decoded0 = predictor_update_3930(p, *decoded0, 0, YDELAYA);
-        decoded0++;
-
-        p->buf++;
-
-        /* Have we filled the history buffer? */
-        if (p->buf == p->historybuffer + HISTORY_SIZE) {
-            memmove(p->historybuffer, p->buf,
-                    PREDICTOR_SIZE * sizeof(*p->historybuffer));
-            p->buf = p->historybuffer;
-        }
-    }
-}
-
-static av_always_inline int predictor_update_filter(APEPredictor *p,
-                                                    const int decoded, const int filter,
-                                                    const int delayA,  const int delayB,
-                                                    const int adaptA,  const int adaptB)
-{
-    int32_t predictionA, predictionB, sign;
-
-    p->buf[delayA]     = p->lastA[filter];
-    p->buf[adaptA]     = APESIGN(p->buf[delayA]);
-    p->buf[delayA - 1] = p->buf[delayA] - p->buf[delayA - 1];
-    p->buf[adaptA - 1] = APESIGN(p->buf[delayA - 1]);
-
-    predictionA = p->buf[delayA    ] * p->coeffsA[filter][0] +
-                  p->buf[delayA - 1] * p->coeffsA[filter][1] +
-                  p->buf[delayA - 2] * p->coeffsA[filter][2] +
-                  p->buf[delayA - 3] * p->coeffsA[filter][3];
-
-    /*  Apply a scaled first-order filter compression */
-    p->buf[delayB]     = p->filterA[filter ^ 1] - ((p->filterB[filter] * 31) >> 5);
-    p->buf[adaptB]     = APESIGN(p->buf[delayB]);
-    p->buf[delayB - 1] = p->buf[delayB] - p->buf[delayB - 1];
-    p->buf[adaptB - 1] = APESIGN(p->buf[delayB - 1]);
-    p->filterB[filter] = p->filterA[filter ^ 1];
-
-    predictionB = p->buf[delayB    ] * p->coeffsB[filter][0] +
-                  p->buf[delayB - 1] * p->coeffsB[filter][1] +
-                  p->buf[delayB - 2] * p->coeffsB[filter][2] +
-                  p->buf[delayB - 3] * p->coeffsB[filter][3] +
-                  p->buf[delayB - 4] * p->coeffsB[filter][4];
-
-    p->lastA[filter] = decoded + ((predictionA + (predictionB >> 1)) >> 10);
-    p->filterA[filter] = p->lastA[filter] + ((p->filterA[filter] * 31) >> 5);
-
-    sign = APESIGN(decoded);
-    p->coeffsA[filter][0] += p->buf[adaptA    ] * sign;
-    p->coeffsA[filter][1] += p->buf[adaptA - 1] * sign;
-    p->coeffsA[filter][2] += p->buf[adaptA - 2] * sign;
-    p->coeffsA[filter][3] += p->buf[adaptA - 3] * sign;
-    p->coeffsB[filter][0] += p->buf[adaptB    ] * sign;
-    p->coeffsB[filter][1] += p->buf[adaptB - 1] * sign;
-    p->coeffsB[filter][2] += p->buf[adaptB - 2] * sign;
-    p->coeffsB[filter][3] += p->buf[adaptB - 3] * sign;
-    p->coeffsB[filter][4] += p->buf[adaptB - 4] * sign;
-
-    return p->filterA[filter];
-}
-
-static void predictor_decode_stereo_3950(APEContext *ctx, int count)
-{
-    APEPredictor *p = &ctx->predictor;
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t *decoded1 = ctx->decoded[1];
-
-    ape_apply_filters(ctx, ctx->decoded[0], ctx->decoded[1], count);
-
-    while (count--) {
-        /* Predictor Y */
-        *decoded0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB,
-                                            YADAPTCOEFFSA, YADAPTCOEFFSB);
-        decoded0++;
-        *decoded1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB,
-                                            XADAPTCOEFFSA, XADAPTCOEFFSB);
-        decoded1++;
-
-        /* Combined */
-        p->buf++;
-
-        /* Have we filled the history buffer? */
-        if (p->buf == p->historybuffer + HISTORY_SIZE) {
-            memmove(p->historybuffer, p->buf,
-                    PREDICTOR_SIZE * sizeof(*p->historybuffer));
-            p->buf = p->historybuffer;
-        }
-    }
-}
-
-static void predictor_decode_mono_3950(APEContext *ctx, int count)
-{
-    APEPredictor *p = &ctx->predictor;
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t predictionA, currentA, A, sign;
-
-    ape_apply_filters(ctx, ctx->decoded[0], NULL, count);
-
-    currentA = p->lastA[0];
-
-    while (count--) {
-        A = *decoded0;
-
-        p->buf[YDELAYA] = currentA;
-        p->buf[YDELAYA - 1] = p->buf[YDELAYA] - p->buf[YDELAYA - 1];
-
-        predictionA = p->buf[YDELAYA    ] * p->coeffsA[0][0] +
-                      p->buf[YDELAYA - 1] * p->coeffsA[0][1] +
-                      p->buf[YDELAYA - 2] * p->coeffsA[0][2] +
-                      p->buf[YDELAYA - 3] * p->coeffsA[0][3];
-
-        currentA = A + (predictionA >> 10);
-
-        p->buf[YADAPTCOEFFSA]     = APESIGN(p->buf[YDELAYA    ]);
-        p->buf[YADAPTCOEFFSA - 1] = APESIGN(p->buf[YDELAYA - 1]);
-
-        sign = APESIGN(A);
-        p->coeffsA[0][0] += p->buf[YADAPTCOEFFSA    ] * sign;
-        p->coeffsA[0][1] += p->buf[YADAPTCOEFFSA - 1] * sign;
-        p->coeffsA[0][2] += p->buf[YADAPTCOEFFSA - 2] * sign;
-        p->coeffsA[0][3] += p->buf[YADAPTCOEFFSA - 3] * sign;
-
-        p->buf++;
-
-        /* Have we filled the history buffer? */
-        if (p->buf == p->historybuffer + HISTORY_SIZE) {
-            memmove(p->historybuffer, p->buf,
-                    PREDICTOR_SIZE * sizeof(*p->historybuffer));
-            p->buf = p->historybuffer;
-        }
-
-        p->filterA[0] = currentA + ((p->filterA[0] * 31) >> 5);
-        *(decoded0++) = p->filterA[0];
-    }
-
-    p->lastA[0] = currentA;
-}
-
-static void do_init_filter(APEFilter *f, int16_t *buf, int order)
-{
-    f->coeffs = buf;
-    f->historybuffer = buf + order;
-    f->delay       = f->historybuffer + order * 2;
-    f->adaptcoeffs = f->historybuffer + order;
-
-    memset(f->historybuffer, 0, (order * 2) * sizeof(*f->historybuffer));
-    memset(f->coeffs, 0, order * sizeof(*f->coeffs));
-    f->avg = 0;
-}
-
-static void init_filter(APEContext *ctx, APEFilter *f, int16_t *buf, int order)
-{
-    do_init_filter(&f[0], buf, order);
-    do_init_filter(&f[1], buf + order * 3 + HISTORY_SIZE, order);
-}
-
-static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
-                            int32_t *data, int count, int order, int fracbits)
-{
-    int res;
-    int absres;
-
-    while (count--) {
-        /* round fixedpoint scalar product */
-        res = ctx->dsp.scalarproduct_and_madd_int16(f->coeffs, f->delay - order,
-                                                    f->adaptcoeffs - order,
-                                                    order, APESIGN(*data));
-        res = (res + (1 << (fracbits - 1))) >> fracbits;
-        res += *data;
-        *data++ = res;
-
-        /* Update the output history */
-        *f->delay++ = av_clip_int16(res);
-
-        if (version < 3980) {
-            /* Version ??? to < 3.98 files (untested) */
-            f->adaptcoeffs[0]  = (res == 0) ? 0 : ((res >> 28) & 8) - 4;
-            f->adaptcoeffs[-4] >>= 1;
-            f->adaptcoeffs[-8] >>= 1;
-        } else {
-            /* Version 3.98 and later files */
-
-            /* Update the adaption coefficients */
-            absres = FFABS(res);
-            if (absres)
-                *f->adaptcoeffs = ((res & (-1<<31)) ^ (-1<<30)) >>
-                                  (25 + (absres <= f->avg*3) + (absres <= f->avg*4/3));
-            else
-                *f->adaptcoeffs = 0;
-
-            f->avg += (absres - f->avg) / 16;
-
-            f->adaptcoeffs[-1] >>= 1;
-            f->adaptcoeffs[-2] >>= 1;
-            f->adaptcoeffs[-8] >>= 1;
-        }
-
-        f->adaptcoeffs++;
-
-        /* Have we filled the history buffer? */
-        if (f->delay == f->historybuffer + HISTORY_SIZE + (order * 2)) {
-            memmove(f->historybuffer, f->delay - (order * 2),
-                    (order * 2) * sizeof(*f->historybuffer));
-            f->delay = f->historybuffer + order * 2;
-            f->adaptcoeffs = f->historybuffer + order;
-        }
-    }
-}
-
-static void apply_filter(APEContext *ctx, APEFilter *f,
-                         int32_t *data0, int32_t *data1,
-                         int count, int order, int fracbits)
-{
-    do_apply_filter(ctx, ctx->fileversion, &f[0], data0, count, order, fracbits);
-    if (data1)
-        do_apply_filter(ctx, ctx->fileversion, &f[1], data1, count, order, fracbits);
-}
-
-static void ape_apply_filters(APEContext *ctx, int32_t *decoded0,
-                              int32_t *decoded1, int count)
-{
-    int i;
-
-    for (i = 0; i < APE_FILTER_LEVELS; i++) {
-        if (!ape_filter_orders[ctx->fset][i])
-            break;
-        apply_filter(ctx, ctx->filters[i], decoded0, decoded1, count,
-                     ape_filter_orders[ctx->fset][i],
-                     ape_filter_fracbits[ctx->fset][i]);
-    }
-}
-
-static int init_frame_decoder(APEContext *ctx)
-{
-    int i, ret;
-    if ((ret = init_entropy_decoder(ctx)) < 0)
-        return ret;
-    init_predictor_decoder(ctx);
-
-    for (i = 0; i < APE_FILTER_LEVELS; i++) {
-        if (!ape_filter_orders[ctx->fset][i])
-            break;
-        init_filter(ctx, ctx->filters[i], ctx->filterbuf[i],
-                    ape_filter_orders[ctx->fset][i]);
-    }
-    return 0;
-}
-
-static void ape_unpack_mono(APEContext *ctx, int count)
-{
-    if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {
-        /* We are pure silence, so we're done. */
-        av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence mono\n");
-        return;
-    }
-
-    ctx->entropy_decode_mono(ctx, count);
-
-    /* Now apply the predictor decoding */
-    ctx->predictor_decode_mono(ctx, count);
-
-    /* Pseudo-stereo - just copy left channel to right channel */
-    if (ctx->channels == 2) {
-        memcpy(ctx->decoded[1], ctx->decoded[0], count * sizeof(*ctx->decoded[1]));
-    }
-}
-
-static void ape_unpack_stereo(APEContext *ctx, int count)
-{
-    int32_t left, right;
-    int32_t *decoded0 = ctx->decoded[0];
-    int32_t *decoded1 = ctx->decoded[1];
-
-    if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {
-        /* We are pure silence, so we're done. */
-        av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence stereo\n");
-        return;
-    }
-
-    ctx->entropy_decode_stereo(ctx, count);
-
-    /* Now apply the predictor decoding */
-    ctx->predictor_decode_stereo(ctx, count);
-
-    /* Decorrelate and scale to output depth */
-    while (count--) {
-        left = *decoded1 - (*decoded0 / 2);
-        right = left + *decoded0;
-
-        *(decoded0++) = left;
-        *(decoded1++) = right;
-    }
-}
-
-static int ape_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    APEContext *s = avctx->priv_data;
-    uint8_t *sample8;
-    int16_t *sample16;
-    int32_t *sample24;
-    int i, ch, ret;
-    int blockstodecode;
-
-    /* this should never be negative, but bad things will happen if it is, so
-       check it just to make sure. */
-    av_assert0(s->samples >= 0);
-
-    if(!s->samples){
-        uint32_t nblocks, offset;
-        int buf_size;
-
-        if (!avpkt->size) {
-            *got_frame_ptr = 0;
-            return 0;
-        }
-        if (avpkt->size < 8) {
-            av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
-            return AVERROR_INVALIDDATA;
-        }
-        buf_size = avpkt->size & ~3;
-        if (buf_size != avpkt->size) {
-            av_log(avctx, AV_LOG_WARNING, "packet size is not a multiple of 4. "
-                   "extra bytes at the end will be skipped.\n");
-        }
-        if (s->fileversion < 3950) // previous versions overread two bytes
-            buf_size += 2;
-        av_fast_malloc(&s->data, &s->data_size, buf_size);
-        if (!s->data)
-            return AVERROR(ENOMEM);
-        s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 2);
-        memset(s->data + (buf_size & ~3), 0, buf_size & 3);
-        s->ptr = s->data;
-        s->data_end = s->data + buf_size;
-
-        nblocks = bytestream_get_be32(&s->ptr);
-        offset  = bytestream_get_be32(&s->ptr);
-        if (s->fileversion >= 3900) {
-            if (offset > 3) {
-                av_log(avctx, AV_LOG_ERROR, "Incorrect offset passed\n");
-                s->data = NULL;
-                return AVERROR_INVALIDDATA;
-            }
-            if (s->data_end - s->ptr < offset) {
-                av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
-                return AVERROR_INVALIDDATA;
-            }
-            s->ptr += offset;
-        } else {
-            init_get_bits(&s->gb, s->ptr, (s->data_end - s->ptr) * 8);
-            if (s->fileversion > 3800)
-                skip_bits_long(&s->gb, offset * 8);
-            else
-                skip_bits_long(&s->gb, offset);
-        }
-
-        if (!nblocks || nblocks > INT_MAX) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid sample count: %u.\n", nblocks);
-            return AVERROR_INVALIDDATA;
-        }
-        s->samples = nblocks;
-
-        /* Initialize the frame decoder */
-        if (init_frame_decoder(s) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Error reading frame header\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-    }
-
-    if (!s->data) {
-        *got_frame_ptr = 0;
-        return avpkt->size;
-    }
-
-    blockstodecode = FFMIN(s->blocks_per_loop, s->samples);
-    // for old files coefficients were not interleaved,
-    // so we need to decode all of them at once
-    if (s->fileversion < 3930)
-        blockstodecode = s->samples;
-
-    /* reallocate decoded sample buffer if needed */
-    av_fast_malloc(&s->decoded_buffer, &s->decoded_size,
-                   2 * FFALIGN(blockstodecode, 8) * sizeof(*s->decoded_buffer));
-    if (!s->decoded_buffer)
-        return AVERROR(ENOMEM);
-    memset(s->decoded_buffer, 0, s->decoded_size);
-    s->decoded[0] = s->decoded_buffer;
-    s->decoded[1] = s->decoded_buffer + FFALIGN(blockstodecode, 8);
-
-    /* get output buffer */
-    frame->nb_samples = blockstodecode;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    s->error=0;
-
-    if ((s->channels == 1) || (s->frameflags & APE_FRAMECODE_PSEUDO_STEREO))
-        ape_unpack_mono(s, blockstodecode);
-    else
-        ape_unpack_stereo(s, blockstodecode);
-    emms_c();
-
-    if (s->error) {
-        s->samples=0;
-        av_log(avctx, AV_LOG_ERROR, "Error decoding frame\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    switch (s->bps) {
-    case 8:
-        for (ch = 0; ch < s->channels; ch++) {
-            sample8 = (uint8_t *)frame->data[ch];
-            for (i = 0; i < blockstodecode; i++)
-                *sample8++ = (s->decoded[ch][i] + 0x80) & 0xff;
-        }
-        break;
-    case 16:
-        for (ch = 0; ch < s->channels; ch++) {
-            sample16 = (int16_t *)frame->data[ch];
-            for (i = 0; i < blockstodecode; i++)
-                *sample16++ = s->decoded[ch][i];
-        }
-        break;
-    case 24:
-        for (ch = 0; ch < s->channels; ch++) {
-            sample24 = (int32_t *)frame->data[ch];
-            for (i = 0; i < blockstodecode; i++)
-                *sample24++ = s->decoded[ch][i] << 8;
-        }
-        break;
-    }
-
-    s->samples -= blockstodecode;
-
-    *got_frame_ptr = 1;
-
-    return (s->samples == 0) ? avpkt->size : 0;
-}
-
-static void ape_flush(AVCodecContext *avctx)
-{
-    APEContext *s = avctx->priv_data;
-    s->samples= 0;
-}
-
-#define OFFSET(x) offsetof(APEContext, x)
-#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
-static const AVOption options[] = {
-    { "max_samples", "maximum number of samples decoded per call",             OFFSET(blocks_per_loop), AV_OPT_TYPE_INT,   { .i64 = 4608 },    1,       INT_MAX, PAR, "max_samples" },
-    { "all",         "no maximum. decode all samples for each packet at once", 0,                       AV_OPT_TYPE_CONST, { .i64 = INT_MAX }, INT_MIN, INT_MAX, PAR, "max_samples" },
-    { NULL},
-};
-
-static const AVClass ape_decoder_class = {
-    .class_name = "APE decoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_ape_decoder = {
-    .name           = "ape",
-    .long_name      = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_APE,
-    .priv_data_size = sizeof(APEContext),
-    .init           = ape_decode_init,
-    .close          = ape_decode_close,
-    .decode         = ape_decode_frame,
-    .capabilities   = CODEC_CAP_SUBFRAMES | CODEC_CAP_DELAY | CODEC_CAP_DR1,
-    .flush          = ape_flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
-                                                      AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_S32P,
-                                                      AV_SAMPLE_FMT_NONE },
-    .priv_class     = &ape_decoder_class,
-};
diff --git a/deps/libav/libavcodec/arm/Makefile b/deps/libav/libavcodec/arm/Makefile
deleted file mode 100644
index 8bdccbd..0000000
--- a/deps/libav/libavcodec/arm/Makefile
+++ /dev/null
@@ -1,99 +0,0 @@
-ARCH_HEADERS = mathops.h
-
-OBJS                                   += arm/fmtconvert_init_arm.o
-
-OBJS-$(CONFIG_AAC_DECODER)             += arm/aacpsdsp_init_arm.o       \
-                                          arm/sbrdsp_init_arm.o
-OBJS-$(CONFIG_AC3DSP)                  += arm/ac3dsp_init_arm.o         \
-                                          arm/ac3dsp_arm.o
-OBJS-$(CONFIG_DCA_DECODER)             += arm/dcadsp_init_arm.o
-OBJS-$(CONFIG_DSPUTIL)                 += arm/dsputil_init_arm.o        \
-                                          arm/dsputil_arm.o             \
-                                          arm/jrevdct_arm.o             \
-                                          arm/simple_idct_arm.o
-OBJS-$(CONFIG_FFT)                     += arm/fft_init_arm.o            \
-                                          arm/fft_fixed_init_arm.o
-OBJS-$(CONFIG_FLAC_DECODER)            += arm/flacdsp_init_arm.o        \
-                                          arm/flacdsp_arm.o
-OBJS-$(CONFIG_H264CHROMA)              += arm/h264chroma_init_arm.o
-OBJS-$(CONFIG_H264DSP)                 += arm/h264dsp_init_arm.o
-OBJS-$(CONFIG_H264PRED)                += arm/h264pred_init_arm.o
-OBJS-$(CONFIG_H264QPEL)                += arm/h264qpel_init_arm.o
-OBJS-$(CONFIG_HPELDSP)                 += arm/hpeldsp_init_arm.o        \
-                                          arm/hpeldsp_arm.o
-OBJS-$(CONFIG_MPEGAUDIODSP)            += arm/mpegaudiodsp_init_arm.o
-OBJS-$(CONFIG_MPEGVIDEO)               += arm/mpegvideo_arm.o
-OBJS-$(CONFIG_NEON_CLOBBER_TEST)       += arm/neontest.o
-OBJS-$(CONFIG_VC1_DECODER)             += arm/vc1dsp_init_arm.o
-OBJS-$(CONFIG_VORBIS_DECODER)          += arm/vorbisdsp_init_arm.o
-OBJS-$(CONFIG_VP3DSP)                  += arm/vp3dsp_init_arm.o
-OBJS-$(CONFIG_VP6_DECODER)             += arm/vp6dsp_init_arm.o
-OBJS-$(CONFIG_VP8_DECODER)             += arm/vp8dsp_init_arm.o
-OBJS-$(CONFIG_RV30_DECODER)            += arm/rv34dsp_init_arm.o
-OBJS-$(CONFIG_RV40_DECODER)            += arm/rv34dsp_init_arm.o        \
-                                          arm/rv40dsp_init_arm.o
-OBJS-$(CONFIG_VIDEODSP)                += arm/videodsp_init_arm.o       \
-
-ARMV5TE-OBJS-$(CONFIG_DSPUTIL)         += arm/dsputil_init_armv5te.o    \
-                                          arm/simple_idct_armv5te.o
-ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO)       += arm/mpegvideo_armv5te.o       \
-                                          arm/mpegvideo_armv5te_s.o
-ARMV5TE-OBJS-$(CONFIG_VIDEODSP)        += arm/videodsp_init_armv5te.o   \
-                                          arm/videodsp_armv5te.o
-
-ARMV6-OBJS-$(CONFIG_DSPUTIL)           += arm/dsputil_init_armv6.o      \
-                                          arm/dsputil_armv6.o           \
-                                          arm/simple_idct_armv6.o       \
-
-ARMV6-OBJS-$(CONFIG_AC3DSP)            += arm/ac3dsp_armv6.o
-ARMV6-OBJS-$(CONFIG_H264DSP)           += arm/h264dsp_armv6.o
-ARMV6-OBJS-$(CONFIG_HPELDSP)           += arm/hpeldsp_init_armv6.o      \
-                                          arm/hpeldsp_armv6.o
-ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP)      += arm/mpegaudiodsp_fixed_armv6.o
-ARMV6-OBJS-$(CONFIG_VP8_DECODER)       += arm/vp8_armv6.o               \
-                                          arm/vp8dsp_init_armv6.o       \
-                                          arm/vp8dsp_armv6.o
-
-VFP-OBJS                               += arm/fmtconvert_vfp.o
-
-VFP-OBJS-$(CONFIG_DCA_DECODER)         += arm/dcadsp_vfp.o              \
-                                          arm/synth_filter_vfp.o
-VFP-OBJS-$(CONFIG_FFT)                 += arm/fft_vfp.o
-VFP-OBJS-$(CONFIG_MDCT)                += arm/mdct_vfp.o
-VFP-OBJS-$(HAVE_ARMV6)                 += arm/fmtconvert_vfp_armv6.o
-
-NEON-OBJS                              += arm/fmtconvert_neon.o
-
-NEON-OBJS-$(CONFIG_AC3DSP)             += arm/ac3dsp_neon.o
-NEON-OBJS-$(CONFIG_AAC_DECODER)        += arm/aacpsdsp_neon.o           \
-                                          arm/sbrdsp_neon.o
-NEON-OBJS-$(CONFIG_DCA_DECODER)        += arm/dcadsp_neon.o             \
-                                          arm/synth_filter_neon.o
-NEON-OBJS-$(CONFIG_DSPUTIL)            += arm/dsputil_init_neon.o       \
-                                          arm/dsputil_neon.o            \
-                                          arm/int_neon.o                \
-                                          arm/simple_idct_neon.o
-NEON-OBJS-$(CONFIG_FFT)                += arm/fft_neon.o                \
-                                          arm/fft_fixed_neon.o
-NEON-OBJS-$(CONFIG_H264CHROMA)         += arm/h264cmc_neon.o
-NEON-OBJS-$(CONFIG_H264DSP)            += arm/h264dsp_neon.o            \
-                                          arm/h264idct_neon.o
-NEON-OBJS-$(CONFIG_H264PRED)           += arm/h264pred_neon.o
-NEON-OBJS-$(CONFIG_H264QPEL)           += arm/h264qpel_neon.o           \
-                                          arm/hpeldsp_neon.o
-NEON-OBJS-$(CONFIG_HPELDSP)            += arm/hpeldsp_init_neon.o       \
-                                          arm/hpeldsp_neon.o
-NEON-OBJS-$(CONFIG_MDCT)               += arm/mdct_neon.o               \
-                                          arm/mdct_fixed_neon.o
-NEON-OBJS-$(CONFIG_MPEGVIDEO)          += arm/mpegvideo_neon.o
-NEON-OBJS-$(CONFIG_RDFT)               += arm/rdft_neon.o
-NEON-OBJS-$(CONFIG_RV30_DECODER)       += arm/rv34dsp_neon.o
-NEON-OBJS-$(CONFIG_RV40_DECODER)       += arm/rv34dsp_neon.o            \
-                                          arm/rv40dsp_neon.o
-NEON-OBJS-$(CONFIG_VC1_DECODER)        += arm/vc1dsp_init_neon.o        \
-                                          arm/vc1dsp_neon.o
-NEON-OBJS-$(CONFIG_VORBIS_DECODER)     += arm/vorbisdsp_neon.o
-NEON-OBJS-$(CONFIG_VP3DSP)             += arm/vp3dsp_neon.o
-NEON-OBJS-$(CONFIG_VP6_DECODER)        += arm/vp6dsp_neon.o
-NEON-OBJS-$(CONFIG_VP8_DECODER)        += arm/vp8dsp_init_neon.o        \
-                                          arm/vp8dsp_neon.o
diff --git a/deps/libav/libavcodec/arm/aac.h b/deps/libav/libavcodec/arm/aac.h
deleted file mode 100644
index 4f143cb..0000000
--- a/deps/libav/libavcodec/arm/aac.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_AAC_H
-#define AVCODEC_ARM_AAC_H
-
-#include "config.h"
-
-#if HAVE_NEON_INLINE
-
-#define VMUL2 VMUL2
-static inline float *VMUL2(float *dst, const float *v, unsigned idx,
-                           const float *scale)
-{
-    unsigned v0, v1;
-    __asm__ ("ubfx     %0,  %6,  #0, #4      \n\t"
-             "ubfx     %1,  %6,  #4, #4      \n\t"
-             "ldr      %0,  [%5, %0, lsl #2] \n\t"
-             "ldr      %1,  [%5, %1, lsl #2] \n\t"
-             "vld1.32  {d1[]},   [%7,:32]    \n\t"
-             "vmov     d0,  %0,  %1          \n\t"
-             "vmul.f32 d0,  d0,  d1          \n\t"
-             "vst1.32  {d0},     [%2,:64]!   \n\t"
-             : "=&r"(v0), "=&r"(v1), "+r"(dst), "=m"(dst[0]), "=m"(dst[1])
-             : "r"(v), "r"(idx), "r"(scale)
-             : "d0", "d1");
-    return dst;
-}
-
-#define VMUL4 VMUL4
-static inline float *VMUL4(float *dst, const float *v, unsigned idx,
-                           const float *scale)
-{
-    unsigned v0, v1, v2, v3;
-    __asm__ ("ubfx     %0,  %10, #0, #2      \n\t"
-             "ubfx     %1,  %10, #2, #2      \n\t"
-             "ldr      %0,  [%9, %0, lsl #2] \n\t"
-             "ubfx     %2,  %10, #4, #2      \n\t"
-             "ldr      %1,  [%9, %1, lsl #2] \n\t"
-             "ubfx     %3,  %10, #6, #2      \n\t"
-             "ldr      %2,  [%9, %2, lsl #2] \n\t"
-             "vmov     d0,  %0,  %1          \n\t"
-             "ldr      %3,  [%9, %3, lsl #2] \n\t"
-             "vld1.32  {d2[],d3[]},[%11,:32] \n\t"
-             "vmov     d1,  %2,  %3          \n\t"
-             "vmul.f32 q0,  q0,  q1          \n\t"
-             "vst1.32  {q0},     [%4,:128]!  \n\t"
-             : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
-               "=m"(dst[0]), "=m"(dst[1]), "=m"(dst[2]), "=m"(dst[3])
-             : "r"(v), "r"(idx), "r"(scale)
-             : "d0", "d1", "d2", "d3");
-    return dst;
-}
-
-#define VMUL2S VMUL2S
-static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
-                            unsigned sign, const float *scale)
-{
-    unsigned v0, v1, v2, v3;
-    __asm__ ("ubfx     %0,  %8,  #0, #4      \n\t"
-             "ubfx     %1,  %8,  #4, #4      \n\t"
-             "ldr      %0,  [%7, %0, lsl #2] \n\t"
-             "lsl      %2,  %10, #30         \n\t"
-             "ldr      %1,  [%7, %1, lsl #2] \n\t"
-             "lsl      %3,  %10, #31         \n\t"
-             "vmov     d0,  %0,  %1          \n\t"
-             "bic      %2,  %2,  #1<<30      \n\t"
-             "vld1.32  {d1[]},   [%9,:32]    \n\t"
-             "vmov     d2,  %2,  %3          \n\t"
-             "veor     d0,  d0,  d2          \n\t"
-             "vmul.f32 d0,  d0,  d1          \n\t"
-             "vst1.32  {d0},     [%4,:64]!   \n\t"
-             : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
-               "=m"(dst[0]), "=m"(dst[1])
-             : "r"(v), "r"(idx), "r"(scale), "r"(sign)
-             : "d0", "d1", "d2");
-    return dst;
-}
-
-#define VMUL4S VMUL4S
-static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
-                            unsigned sign, const float *scale)
-{
-    unsigned v0, v1, v2, v3, nz;
-    __asm__ ("vld1.32  {d2[],d3[]},[%13,:32] \n\t"
-             "ubfx     %0,  %12, #0, #2      \n\t"
-             "ubfx     %1,  %12, #2, #2      \n\t"
-             "ldr      %0,  [%11,%0, lsl #2] \n\t"
-             "ubfx     %2,  %12, #4, #2      \n\t"
-             "ldr      %1,  [%11,%1, lsl #2] \n\t"
-             "ubfx     %3,  %12, #6, #2      \n\t"
-             "ldr      %2,  [%11,%2, lsl #2] \n\t"
-             "vmov     d0,  %0,  %1          \n\t"
-             "ldr      %3,  [%11,%3, lsl #2] \n\t"
-             "lsr      %6,  %12, #12         \n\t"
-             "rbit     %6,  %6               \n\t"
-             "vmov     d1,  %2,  %3          \n\t"
-             "lsls     %6,  %6,  #1          \n\t"
-             "and      %0,  %5,  #1<<31      \n\t"
-             "it       cs                    \n\t"
-             "lslcs    %5,  %5,  #1          \n\t"
-             "lsls     %6,  %6,  #1          \n\t"
-             "and      %1,  %5,  #1<<31      \n\t"
-             "it       cs                    \n\t"
-             "lslcs    %5,  %5,  #1          \n\t"
-             "lsls     %6,  %6,  #1          \n\t"
-             "and      %2,  %5,  #1<<31      \n\t"
-             "it       cs                    \n\t"
-             "lslcs    %5,  %5,  #1          \n\t"
-             "vmov     d4,  %0,  %1          \n\t"
-             "and      %3,  %5,  #1<<31      \n\t"
-             "vmov     d5,  %2,  %3          \n\t"
-             "veor     q0,  q0,  q2          \n\t"
-             "vmul.f32 q0,  q0,  q1          \n\t"
-             "vst1.32  {q0},     [%4,:128]!  \n\t"
-             : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
-               "+r"(sign), "=r"(nz),
-               "=m"(dst[0]), "=m"(dst[1]), "=m"(dst[2]), "=m"(dst[3])
-             : "r"(v), "r"(idx), "r"(scale)
-             : "cc", "d0", "d1", "d2", "d3", "d4", "d5");
-    return dst;
-}
-
-#endif /* HAVE_NEON_INLINE */
-
-#endif /* AVCODEC_ARM_AAC_H */
diff --git a/deps/libav/libavcodec/arm/aacpsdsp_init_arm.c b/deps/libav/libavcodec/arm/aacpsdsp_init_arm.c
deleted file mode 100644
index 6326376..0000000
--- a/deps/libav/libavcodec/arm/aacpsdsp_init_arm.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include "libavutil/arm/cpu.h"
-#include "libavutil/attributes.h"
-#include "libavcodec/aacpsdsp.h"
-
-void ff_ps_add_squares_neon(float *dst, const float (*src)[2], int n);
-void ff_ps_mul_pair_single_neon(float (*dst)[2], float (*src0)[2],
-                                float *src1, int n);
-void ff_ps_hybrid_analysis_neon(float (*out)[2], float (*in)[2],
-                                const float (*filter)[8][2],
-                                int stride, int n);
-void ff_ps_hybrid_analysis_ileave_neon(float (*out)[32][2], float L[2][38][64],
-                                       int i, int len);
-void ff_ps_hybrid_synthesis_deint_neon(float out[2][38][64], float (*in)[32][2],
-                                       int i, int len);
-void ff_ps_decorrelate_neon(float (*out)[2], float (*delay)[2],
-                            float (*ap_delay)[PS_QMF_TIME_SLOTS+PS_MAX_AP_DELAY][2],
-                            const float phi_fract[2], float (*Q_fract)[2],
-                            const float *transient_gain, float g_decay_slope,
-                            int len);
-void ff_ps_stereo_interpolate_neon(float (*l)[2], float (*r)[2],
-                                   float h[2][4], float h_step[2][4],
-                                   int len);
-
-av_cold void ff_psdsp_init_arm(PSDSPContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        s->add_squares            = ff_ps_add_squares_neon;
-        s->mul_pair_single        = ff_ps_mul_pair_single_neon;
-        s->hybrid_synthesis_deint = ff_ps_hybrid_synthesis_deint_neon;
-        s->hybrid_analysis        = ff_ps_hybrid_analysis_neon;
-        s->stereo_interpolate[0]  = ff_ps_stereo_interpolate_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/aacpsdsp_neon.S b/deps/libav/libavcodec/arm/aacpsdsp_neon.S
deleted file mode 100644
index fb00900..0000000
--- a/deps/libav/libavcodec/arm/aacpsdsp_neon.S
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_ps_add_squares_neon, export=1
-        mov             r3,  r0
-        sub             r2,  r2,  #4
-        vld1.32         {q0},     [r1,:128]!
-        vmul.f32        q0,  q0,  q0
-        vld1.32         {q2},     [r1,:128]!
-        vmul.f32        q2,  q2,  q2
-        vld1.32         {q1},     [r0,:128]!
-1:
-        vpadd.f32       d6,  d0,  d1
-        vld1.32         {q0},     [r1,:128]!
-        vpadd.f32       d7,  d4,  d5
-        vmul.f32        q0,  q0,  q0
-        vld1.32         {q2},     [r1,:128]!
-        vadd.f32        q3,  q1,  q3
-        vld1.32         {q1},     [r0,:128]!
-        vmul.f32        q2,  q2,  q2
-        vst1.32         {q3},     [r3,:128]!
-        subs            r2,  r2,  #4
-        bgt             1b
-        vpadd.f32       d6,  d0,  d1
-        vpadd.f32       d7,  d4,  d5
-        vadd.f32        q1,  q1,  q3
-        vst1.32         {q1},     [r3,:128]!
-        bx              lr
-endfunc
-
-function ff_ps_mul_pair_single_neon, export=1
-        sub             r3,  r3,  #4
-        tst             r1,  #8
-        bne             2f
-        vld1.32         {q0},     [r1,:128]!
-1:
-        vld1.32         {q3},     [r2,:128]!
-        vmul.f32        d4,  d0,  d6[0]
-        vmul.f32        d5,  d1,  d6[1]
-        vld1.32         {q1},     [r1,:128]!
-        vmul.f32        d6,  d2,  d7[0]
-        vmul.f32        d7,  d3,  d7[1]
-        vld1.32         {q0},     [r1,:128]!
-        vst1.32         {q2,q3},  [r0,:128]!
-        subs            r3,  r3,  #4
-        bgt             1b
-        vld1.32         {q3},     [r2,:128]!
-        vmul.f32        d4,  d0,  d6[0]
-        vmul.f32        d5,  d1,  d6[1]
-        vld1.32         {q1},     [r1,:128]!
-        vmul.f32        d6,  d2,  d7[0]
-        vmul.f32        d7,  d3,  d7[1]
-        vst1.32         {q2,q3},  [r0,:128]!
-        bx              lr
-2:
-        vld1.32         {d0},     [r1,:64]!
-        vld1.32         {d1,d2},  [r1,:128]!
-1:
-        vld1.32         {q3},     [r2,:128]!
-        vmul.f32        d4,  d0,  d6[0]
-        vmul.f32        d5,  d1,  d6[1]
-        vld1.32         {d0,d1},  [r1,:128]!
-        vmul.f32        d6,  d2,  d7[0]
-        vmul.f32        d7,  d0,  d7[1]
-        vmov            d0,  d1
-        vld1.32         {d1,d2},  [r1,:128]!
-        vst1.32         {q2,q3},  [r0,:128]!
-        subs            r3,  r3,  #4
-        bgt             1b
-        vld1.32         {q3},     [r2,:128]!
-        vmul.f32        d4,  d0,  d6[0]
-        vmul.f32        d5,  d1,  d6[1]
-        vld1.32         {d0},     [r1,:64]!
-        vmul.f32        d6,  d2,  d7[0]
-        vmul.f32        d7,  d0,  d7[1]
-        vst1.32         {q2,q3},  [r0,:128]!
-        bx              lr
-endfunc
-
-function ff_ps_hybrid_synthesis_deint_neon, export=1
-        push            {r4-r8,lr}
-        add             r0,  r0,  r2,  lsl #2
-        add             r1,  r1,  r2,  lsl #5+1+2
-        rsb             r2,  r2,  #64
-        mov             r5,  #64*4
-        mov             lr,  r0
-        add             r4,  r0,  #38*64*4
-        mov             r12, r3
-2:
-        vld1.32         {d0,d1},  [r1,:128]!
-        vst1.32         {d0[0]},  [lr,:32], r5
-        vst1.32         {d0[1]},  [r4,:32], r5
-        vst1.32         {d1[0]},  [lr,:32], r5
-        vst1.32         {d1[1]},  [r4,:32], r5
-        subs            r12, r12, #2
-        bgt             2b
-        add             r0,  r0,  #4
-        sub             r2,  r2,  #1
-        tst             r2,  #2
-        bne             6f
-1:
-        mov             lr,  r0
-        add             r4,  r0,  #38*64*4
-        add             r6,  r1,  #  32*2*4
-        add             r7,  r1,  #2*32*2*4
-        add             r8,  r1,  #3*32*2*4
-        mov             r12, r3
-2:
-        vld1.32         {d0,d1},  [r1,:128]!
-        vld1.32         {d2,d3},  [r6,:128]!
-        vld1.32         {d4,d5},  [r7,:128]!
-        vld1.32         {d6,d7},  [r8,:128]!
-        vst4.32         {d0[0],d2[0],d4[0],d6[0]}, [lr,:128], r5
-        vst4.32         {d0[1],d2[1],d4[1],d6[1]}, [r4,:128], r5
-        vst4.32         {d1[0],d3[0],d5[0],d7[0]}, [lr,:128], r5
-        vst4.32         {d1[1],d3[1],d5[1],d7[1]}, [r4,:128], r5
-        subs            r12, r12, #2
-        bgt             2b
-        add             r0,  r0,  #16
-        add             r1,  r1,  #3*32*2*4
-        subs            r2,  r2,  #4
-        bgt             1b
-        pop             {r4-r8,pc}
-6:
-        mov             lr,  r0
-        add             r4,  r0,  #38*64*4
-        add             r6,  r1,  #32*2*4
-        mov             r12, r3
-2:
-        vld1.32         {d0,d1},  [r1,:128]!
-        vld1.32         {d2,d3},  [r6,:128]!
-        vst2.32         {d0[0],d2[0]}, [lr,:64], r5
-        vst2.32         {d0[1],d2[1]}, [r4,:64], r5
-        vst2.32         {d1[0],d3[0]}, [lr,:64], r5
-        vst2.32         {d1[1],d3[1]}, [r4,:64], r5
-        subs            r12, r12, #2
-        bgt             2b
-        add             r0,  r0,  #8
-        add             r1,  r1,  #32*2*4
-        sub             r2,  r2,  #2
-        b               1b
-endfunc
-
-function ff_ps_hybrid_analysis_neon, export=1
-        vldm            r1,  {d19-d31}
-        ldr             r12, [sp]
-        lsl             r3,  r3,  #3
-        vadd.f32        d16, d19, d31
-        vadd.f32        d17, d20, d30
-        vsub.f32        d18, d19, d31
-        vsub.f32        d19, d20, d30
-        vsub.f32        d0,  d21, d29
-        vsub.f32        d1,  d22, d28
-        vadd.f32        d2,  d21, d29
-        vadd.f32        d3,  d22, d28
-        vadd.f32        d20, d23, d27
-        vadd.f32        d21, d24, d26
-        vsub.f32        d22, d23, d27
-        vsub.f32        d23, d24, d26
-        vmov.i32        d6,  #1<<31
-        vmov.i32        d7,  #0
-        vmov.f32        q14, #0.0
-        vmov.f32        q15, #0.0
-        vtrn.32         d6,  d7
-        vrev64.32       q9,  q9
-        vrev64.32       q0,  q0
-        vrev64.32       q11, q11
-        veor            q9,  q9,  q3
-        veor            q0,  q0,  q3
-        veor            q11, q11, q3
-        vld1.32         {q13},    [r2,:128]!
-        vtrn.32         q8,  q9
-        vtrn.32         q1,  q0
-        vtrn.32         q10, q11
-        sub             r12, r12, #1
-        vmla.f32        q14, q8,  q13
-        vld1.32         {q2},     [r2,:128]!
-        vmla.f32        q15, q9,  q13
-1:
-        vmla.f32        q14, q1,  q2
-        vld1.32         {q13},    [r2,:128]!
-        vmla.f32        q15, q0,  q2
-        vmla.f32        q14, q10, q13
-        vld1.32         {q2},     [r2,:128]!
-        vmla.f32        q15, q11, q13
-        vld1.32         {q13},    [r2,:128]!
-        vadd.f32        d6,  d28, d29
-        vadd.f32        d7,  d30, d31
-        vmov.f32        q14, #0.0
-        vmov.f32        q15, #0.0
-        vmla.f32        q14, q8,  q13
-        vpadd.f32       d6,  d6,  d7
-        vmla.f32        q15, q9,  q13
-        vmla.f32        d6,  d25, d4[0]
-        vld1.32         {q2},     [r2,:128]!
-        vst1.32         {d6},     [r0,:64], r3
-        subs            r12, r12, #1
-        bgt             1b
-        vmla.f32        q14, q1,  q2
-        vld1.32         {q13},    [r2,:128]!
-        vmla.f32        q15, q0,  q2
-        vmla.f32        q14, q10, q13
-        vld1.32         {q2},     [r2,:128]!
-        vmla.f32        q15, q11, q13
-        vadd.f32        d6,  d28, d29
-        vadd.f32        d7,  d30, d31
-        vpadd.f32       d6,  d6,  d7
-        vmla.f32        d6,  d25, d4[0]
-        vst1.32         {d6},     [r0,:64], r3
-        bx              lr
-endfunc
-
-function ff_ps_stereo_interpolate_neon, export=1
-        vld1.32         {q0},     [r2]
-        vld1.32         {q14},    [r3]
-        vadd.f32        q15, q14, q14
-        mov             r2,  r0
-        mov             r3,  r1
-        ldr             r12, [sp]
-        vadd.f32        q1,  q0,  q14
-        vadd.f32        q0,  q0,  q15
-        vld1.32         {q2},     [r0,:64]!
-        vld1.32         {q3},     [r1,:64]!
-        subs            r12, r12, #1
-        beq             2f
-1:
-        vmul.f32        d16, d4,  d2[0]
-        vmul.f32        d17, d5,  d0[0]
-        vmul.f32        d18, d4,  d2[1]
-        vmul.f32        d19, d5,  d0[1]
-        vmla.f32        d16, d6,  d3[0]
-        vmla.f32        d17, d7,  d1[0]
-        vmla.f32        d18, d6,  d3[1]
-        vmla.f32        d19, d7,  d1[1]
-        vadd.f32        q1,  q1,  q15
-        vadd.f32        q0,  q0,  q15
-        vld1.32         {q2},     [r0,:64]!
-        vld1.32         {q3},     [r1,:64]!
-        vst1.32         {q8},     [r2,:64]!
-        vst1.32         {q9},     [r3,:64]!
-        subs            r12, r12, #2
-        bgt             1b
-        it              lt
-        bxlt            lr
-2:
-        vmul.f32        d16, d4,  d2[0]
-        vmul.f32        d18, d4,  d2[1]
-        vmla.f32        d16, d6,  d3[0]
-        vmla.f32        d18, d6,  d3[1]
-        vst1.32         {d16},    [r2,:64]!
-        vst1.32         {d18},    [r3,:64]!
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/ac3dsp_arm.S b/deps/libav/libavcodec/arm/ac3dsp_arm.S
deleted file mode 100644
index ed8eb37..0000000
--- a/deps/libav/libavcodec/arm/ac3dsp_arm.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_ac3_update_bap_counts_arm, export=1
-        push            {lr}
-        ldrb            lr,  [r1], #1
-1:
-        lsl             r3,  lr,  #1
-        ldrh            r12, [r0, r3]
-        subs            r2,  r2,  #1
-        it              gt
-        ldrbgt          lr,  [r1], #1
-        add             r12, r12, #1
-        strh            r12, [r0, r3]
-        bgt             1b
-        pop             {pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/ac3dsp_armv6.S b/deps/libav/libavcodec/arm/ac3dsp_armv6.S
deleted file mode 100644
index 2028d0b..0000000
--- a/deps/libav/libavcodec/arm/ac3dsp_armv6.S
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_ac3_bit_alloc_calc_bap_armv6, export=1
-        ldr             r12, [sp]
-        cmp             r12, #-960
-        beq             4f
-        push            {r4-r11,lr}
-        add             r5,  sp,  #40
-        movrelx         r4,  X(ff_ac3_bin_to_band_tab), r11
-        movrelx         lr,  X(ff_ac3_band_start_tab)
-        ldm             r5,  {r5-r7}
-        ldrb            r4,  [r4, r2]
-        add             r1,  r1,  r2,  lsl #1           @ psd + start
-        add             r0,  r0,  r4,  lsl #1           @ mask + band
-        add             r4,  r4,  lr
-        add             r7,  r7,  r2                    @ bap + start
-1:
-        ldrsh           r9,  [r0], #2                   @ mask[band]
-        mov             r8,  #0xff0
-        sub             r9,  r9,  r12                   @   - snr_offset
-        ldrb            r10, [r4, #1]!                  @ band_start_tab[++band]
-        subs            r9,  r9,  r5                    @   - floor
-        it              lt
-        movlt           r9,  #0
-        cmp             r10, r3                         @   - end
-        and             r9,  r9,  r8, lsl #1            @   & 0x1fe0
-        ite             gt
-        subgt           r8,  r3,  r2
-        suble           r8,  r10, r2
-        mov             r2,  r10
-        add             r9,  r9,  r5                    @   + floor => m
-        tst             r8,  #1
-        add             r11, r7,  r8
-        bne             3f
-        b               5f
-2:
-        ldrsh           r8,  [r1], #2
-        ldrsh           lr,  [r1], #2
-        sub             r8,  r8,  r9
-        sub             lr,  lr,  r9
-        usat            r8,  #6,  r8,  asr #5           @ address
-        usat            lr,  #6,  lr,  asr #5
-        ldrb            r8,  [r6, r8]                   @ bap_tab[address]
-        ldrb            lr,  [r6, lr]
-        strb            r8,  [r7], #1                   @ bap[bin]
-        strb            lr,  [r7], #1
-5:      cmp             r7,  r11
-        blo             2b
-        cmp             r3,  r10
-        bgt             1b
-        pop             {r4-r11,pc}
-3:
-        ldrsh           r8,  [r1], #2                   @ psd[bin]
-        sub             r8,  r8,  r9                    @   - m
-        usat            r8,  #6,  r8,  asr #5           @ address
-        ldrb            r8,  [r6, r8]                   @ bap_tab[address]
-        strb            r8,  [r7], #1                   @ bap[bin]
-        b               5b
-4:
-        ldr             r0,  [sp, #12]
-        mov             r1,  #0
-        mov             r2,  #256
-        b               X(memset)
-endfunc
diff --git a/deps/libav/libavcodec/arm/ac3dsp_init_arm.c b/deps/libav/libavcodec/arm/ac3dsp_init_arm.c
deleted file mode 100644
index a48353a..0000000
--- a/deps/libav/libavcodec/arm/ac3dsp_init_arm.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/arm/cpu.h"
-#include "libavutil/attributes.h"
-#include "libavcodec/ac3dsp.h"
-#include "config.h"
-
-void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-int ff_ac3_max_msb_abs_int16_neon(const int16_t *src, int len);
-void ff_ac3_lshift_int16_neon(int16_t *src, unsigned len, unsigned shift);
-void ff_ac3_rshift_int32_neon(int32_t *src, unsigned len, unsigned shift);
-void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len);
-void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs);
-void ff_apply_window_int16_neon(int16_t *dst, const int16_t *src,
-                                const int16_t *window, unsigned n);
-
-void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd,
-                                     int start, int end,
-                                     int snr_offset, int floor,
-                                     const uint8_t *bap_tab, uint8_t *bap);
-
-void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len);
-
-av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    c->update_bap_counts         = ff_ac3_update_bap_counts_arm;
-
-    if (have_armv6(cpu_flags)) {
-        c->bit_alloc_calc_bap    = ff_ac3_bit_alloc_calc_bap_armv6;
-    }
-
-    if (have_neon(cpu_flags)) {
-        c->ac3_exponent_min      = ff_ac3_exponent_min_neon;
-        c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_neon;
-        c->ac3_lshift_int16      = ff_ac3_lshift_int16_neon;
-        c->ac3_rshift_int32      = ff_ac3_rshift_int32_neon;
-        c->float_to_fixed24      = ff_float_to_fixed24_neon;
-        c->extract_exponents     = ff_ac3_extract_exponents_neon;
-        c->apply_window_int16    = ff_apply_window_int16_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/ac3dsp_neon.S b/deps/libav/libavcodec/arm/ac3dsp_neon.S
deleted file mode 100644
index f97b190..0000000
--- a/deps/libav/libavcodec/arm/ac3dsp_neon.S
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_ac3_max_msb_abs_int16_neon, export=1
-        vmov.i16        q0,  #0
-        vmov.i16        q2,  #0
-1:      vld1.16         {q1},     [r0,:128]!
-        vabs.s16        q1,  q1
-        vld1.16         {q3},     [r0,:128]!
-        vabs.s16        q3,  q3
-        vorr            q0,  q0,  q1
-        vorr            q2,  q2,  q3
-        subs            r1,  r1,  #16
-        bgt             1b
-        vorr            q0,  q0,  q2
-        vorr            d0,  d0,  d1
-        vpmax.u16       d0,  d0,  d0
-        vpmax.u16       d0,  d0,  d0
-        vmov.u16        r0,  d0[0]
-        bx              lr
-endfunc
-
-function ff_ac3_exponent_min_neon, export=1
-        cmp             r1,  #0
-        it              eq
-        bxeq            lr
-        push            {lr}
-        mov             r12, #256
-1:
-        vld1.8          {q0},     [r0,:128]
-        mov             lr,  r1
-        add             r3,  r0,  #256
-2:      vld1.8          {q1},     [r3,:128], r12
-        subs            lr,  lr,  #1
-        vmin.u8         q0,  q0,  q1
-        bgt             2b
-        subs            r2,  r2,  #16
-        vst1.8          {q0},     [r0,:128]!
-        bgt             1b
-        pop             {pc}
-endfunc
-
-function ff_ac3_lshift_int16_neon, export=1
-        vdup.16         q0,  r2
-1:      vld1.16         {q1},     [r0,:128]
-        vshl.s16        q1,  q1,  q0
-        vst1.16         {q1},     [r0,:128]!
-        subs            r1,  r1,  #8
-        bgt             1b
-        bx              lr
-endfunc
-
-function ff_ac3_rshift_int32_neon, export=1
-        rsb             r2,  r2,  #0
-        vdup.32         q0,  r2
-1:      vld1.32         {q1},     [r0,:128]
-        vshl.s32        q1,  q1,  q0
-        vst1.32         {q1},     [r0,:128]!
-        subs            r1,  r1,  #4
-        bgt             1b
-        bx              lr
-endfunc
-
-function ff_float_to_fixed24_neon, export=1
-1:      vld1.32         {q0-q1},  [r1,:128]!
-        vcvt.s32.f32    q0,  q0,  #24
-        vld1.32         {q2-q3},  [r1,:128]!
-        vcvt.s32.f32    q1,  q1,  #24
-        vcvt.s32.f32    q2,  q2,  #24
-        vst1.32         {q0-q1},  [r0,:128]!
-        vcvt.s32.f32    q3,  q3,  #24
-        vst1.32         {q2-q3},  [r0,:128]!
-        subs            r2,  r2,  #16
-        bgt             1b
-        bx              lr
-endfunc
-
-function ff_ac3_extract_exponents_neon, export=1
-        vmov.i32        q15, #8
-1:
-        vld1.32         {q0},     [r1,:128]!
-        vabs.s32        q1,  q0
-        vclz.i32        q3,  q1
-        vsub.i32        q3,  q3,  q15
-        vmovn.i32       d6,  q3
-        vmovn.i16       d6,  q3
-        vst1.32         {d6[0]},  [r0,:32]!
-        subs            r2,  r2,  #4
-        bgt             1b
-        bx              lr
-endfunc
-
-function ff_apply_window_int16_neon, export=1
-        push            {r4,lr}
-        add             r4,  r1,  r3,  lsl #1
-        add             lr,  r0,  r3,  lsl #1
-        sub             r4,  r4,  #16
-        sub             lr,  lr,  #16
-        mov             r12, #-16
-1:
-        vld1.16         {q0},     [r1,:128]!
-        vld1.16         {q2},     [r2,:128]!
-        vld1.16         {q1},     [r4,:128], r12
-        vrev64.16       q3,  q2
-        vqrdmulh.s16    q0,  q0,  q2
-        vqrdmulh.s16    d2,  d2,  d7
-        vqrdmulh.s16    d3,  d3,  d6
-        vst1.16         {q0},     [r0,:128]!
-        vst1.16         {q1},     [lr,:128], r12
-        subs            r3,  r3,  #16
-        bgt             1b
-
-        pop             {r4,pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/asm-offsets.h b/deps/libav/libavcodec/arm/asm-offsets.h
deleted file mode 100644
index 8999456..0000000
--- a/deps/libav/libavcodec/arm/asm-offsets.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_ASM_OFFSETS_H
-#define AVCODEC_ARM_ASM_OFFSETS_H
-
-#ifndef __ASSEMBLER__
-#include <stddef.h>
-#define CHK_OFFS(s, m, o) struct check_##o {    \
-        int x_##o[offsetof(s, m) == o? 1: -1];  \
-    }
-#endif
-
-/* MpegEncContext */
-#define Y_DC_SCALE               0xa8
-#define C_DC_SCALE               0xac
-#define AC_PRED                  0xb0
-#define BLOCK_LAST_INDEX         0xb4
-#define H263_AIC                 0xe4
-#define INTER_SCANTAB_RASTER_END 0x12c
-
-#endif /* AVCODEC_ARM_ASM_OFFSETS_H */
diff --git a/deps/libav/libavcodec/arm/dca.h b/deps/libav/libavcodec/arm/dca.h
deleted file mode 100644
index 580bd75..0000000
--- a/deps/libav/libavcodec/arm/dca.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_DCA_H
-#define AVCODEC_ARM_DCA_H
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavcodec/dcadsp.h"
-#include "libavcodec/mathops.h"
-
-#if HAVE_ARMV6_INLINE && AV_GCC_VERSION_AT_LEAST(4,4)
-
-#define decode_blockcodes decode_blockcodes
-static inline int decode_blockcodes(int code1, int code2, int levels,
-                                    int32_t *values)
-{
-    int32_t v0, v1, v2, v3, v4, v5;
-
-    __asm__ ("smmul   %8,  %14, %18           \n"
-             "smmul   %11, %15, %18           \n"
-             "smlabb  %14, %8,  %17, %14      \n"
-             "smlabb  %15, %11, %17, %15      \n"
-             "smmul   %9,  %8,  %18           \n"
-             "smmul   %12, %11, %18           \n"
-             "sub     %14, %14, %16, lsr #1   \n"
-             "sub     %15, %15, %16, lsr #1   \n"
-             "smlabb  %8,  %9,  %17, %8       \n"
-             "smlabb  %11, %12, %17, %11      \n"
-             "smmul   %10, %9,  %18           \n"
-             "smmul   %13, %12, %18           \n"
-             "str     %14, %0                 \n"
-             "str     %15, %4                 \n"
-             "sub     %8,  %8,  %16, lsr #1   \n"
-             "sub     %11, %11, %16, lsr #1   \n"
-             "smlabb  %9,  %10, %17, %9       \n"
-             "smlabb  %12, %13, %17, %12      \n"
-             "smmul   %14, %10, %18           \n"
-             "smmul   %15, %13, %18           \n"
-             "str     %8,  %1                 \n"
-             "str     %11, %5                 \n"
-             "sub     %9,  %9,  %16, lsr #1   \n"
-             "sub     %12, %12, %16, lsr #1   \n"
-             "smlabb  %10, %14, %17, %10      \n"
-             "smlabb  %13, %15, %17, %13      \n"
-             "str     %9,  %2                 \n"
-             "str     %12, %6                 \n"
-             "sub     %10, %10, %16, lsr #1   \n"
-             "sub     %13, %13, %16, lsr #1   \n"
-             "str     %10, %3                 \n"
-             "str     %13, %7                 \n"
-             : "=m"(values[0]), "=m"(values[1]),
-               "=m"(values[2]), "=m"(values[3]),
-               "=m"(values[4]), "=m"(values[5]),
-               "=m"(values[6]), "=m"(values[7]),
-               "=&r"(v0), "=&r"(v1), "=&r"(v2),
-               "=&r"(v3), "=&r"(v4), "=&r"(v5),
-               "+&r"(code1), "+&r"(code2)
-             : "r"(levels - 1), "r"(-levels), "r"(ff_inverse[levels]));
-
-    return code1 | code2;
-}
-
-#endif
-
-#if HAVE_NEON_INLINE && HAVE_ASM_MOD_Y
-
-#define int8x8_fmul_int32 int8x8_fmul_int32
-static inline void int8x8_fmul_int32(av_unused DCADSPContext *dsp,
-                                     float *dst, const int8_t *src, int scale)
-{
-    __asm__ ("vcvt.f32.s32 %2,  %2,  #4         \n"
-             "vld1.8       {d0},     [%1,:64]   \n"
-             "vmovl.s8     q0,  d0              \n"
-             "vmovl.s16    q1,  d1              \n"
-             "vmovl.s16    q0,  d0              \n"
-             "vcvt.f32.s32 q0,  q0              \n"
-             "vcvt.f32.s32 q1,  q1              \n"
-             "vmul.f32     q0,  q0,  %y2        \n"
-             "vmul.f32     q1,  q1,  %y2        \n"
-             "vst1.32      {q0-q1},  [%m0,:128] \n"
-             : "=Um"(*(float (*)[8])dst)
-             : "r"(src), "x"(scale)
-             : "d0", "d1", "d2", "d3");
-}
-
-#endif
-
-#endif /* AVCODEC_ARM_DCA_H */
diff --git a/deps/libav/libavcodec/arm/dcadsp_init_arm.c b/deps/libav/libavcodec/arm/dcadsp_init_arm.c
deleted file mode 100644
index 2ea1289..0000000
--- a/deps/libav/libavcodec/arm/dcadsp_init_arm.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include "libavutil/arm/cpu.h"
-#include "libavutil/attributes.h"
-#include "libavcodec/dcadsp.h"
-
-void ff_dca_lfe_fir0_neon(float *out, const float *in, const float *coefs,
-                          float scale);
-void ff_dca_lfe_fir1_neon(float *out, const float *in, const float *coefs,
-                          float scale);
-
-void ff_dca_lfe_fir32_vfp(float *out, const float *in, const float *coefs,
-                          float scale);
-void ff_dca_lfe_fir64_vfp(float *out, const float *in, const float *coefs,
-                          float scale);
-
-void ff_dca_qmf_32_subbands_vfp(float samples_in[32][8], int sb_act,
-                                SynthFilterContext *synth, FFTContext *imdct,
-                                float synth_buf_ptr[512],
-                                int *synth_buf_offset, float synth_buf2[32],
-                                const float window[512], float *samples_out,
-                                float raXin[32], float scale);
-
-void ff_synth_filter_float_vfp(FFTContext *imdct,
-                               float *synth_buf_ptr, int *synth_buf_offset,
-                               float synth_buf2[32], const float window[512],
-                               float out[32], const float in[32],
-                               float scale);
-
-void ff_synth_filter_float_neon(FFTContext *imdct,
-                                float *synth_buf_ptr, int *synth_buf_offset,
-                                float synth_buf2[32], const float window[512],
-                                float out[32], const float in[32],
-                                float scale);
-
-av_cold void ff_dcadsp_init_arm(DCADSPContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_vfp(cpu_flags) && !have_vfpv3(cpu_flags)) {
-        s->lfe_fir[0]      = ff_dca_lfe_fir32_vfp;
-        s->lfe_fir[1]      = ff_dca_lfe_fir64_vfp;
-        s->qmf_32_subbands = ff_dca_qmf_32_subbands_vfp;
-    }
-    if (have_neon(cpu_flags)) {
-        s->lfe_fir[0] = ff_dca_lfe_fir0_neon;
-        s->lfe_fir[1] = ff_dca_lfe_fir1_neon;
-    }
-}
-
-av_cold void ff_synth_filter_init_arm(SynthFilterContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_vfp(cpu_flags) && !have_vfpv3(cpu_flags))
-        s->synth_filter_float = ff_synth_filter_float_vfp;
-    if (have_neon(cpu_flags))
-        s->synth_filter_float = ff_synth_filter_float_neon;
-}
diff --git a/deps/libav/libavcodec/arm/dcadsp_neon.S b/deps/libav/libavcodec/arm/dcadsp_neon.S
deleted file mode 100644
index c798fea..0000000
--- a/deps/libav/libavcodec/arm/dcadsp_neon.S
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_dca_lfe_fir0_neon, export=1
-        push            {r4-r6,lr}
-NOVFP   vmov            s0,  r3                 @ scale
-        mov             r3,  #32                @ decifactor
-        mov             r6,  #256/32
-        b               dca_lfe_fir
-endfunc
-
-function ff_dca_lfe_fir1_neon, export=1
-        push            {r4-r6,lr}
-NOVFP   vmov            s0,  r3                 @ scale
-        mov             r3,  #64                @ decifactor
-        mov             r6,  #256/64
-dca_lfe_fir:
-        add             r4,  r0,  r3,  lsl #2   @ out2
-        add             r5,  r2,  #256*4-16     @ cf1
-        sub             r1,  r1,  #12
-        mov             lr,  #-16
-1:
-        vmov.f32        q2,  #0.0               @ v0
-        vmov.f32        q3,  #0.0               @ v1
-        mov             r12, r6
-2:
-        vld1.32         {q8},     [r2,:128]!    @ cf0
-        vld1.32         {q9},     [r5,:128], lr @ cf1
-        vld1.32         {q1},     [r1], lr      @ in
-        subs            r12, r12, #4
-        vrev64.32       q10, q8
-        vmla.f32        q3,  q1,  q9
-        vmla.f32        d4,  d2,  d21
-        vmla.f32        d5,  d3,  d20
-        bne             2b
-
-        add             r1,  r1,  r6,  lsl #2
-        subs            r3,  r3,  #1
-        vadd.f32        d4,  d4,  d5
-        vadd.f32        d6,  d6,  d7
-        vpadd.f32       d4,  d4,  d6
-        vmul.f32        d5,  d4,  d0[0]
-        vst1.32         {d5[0]},  [r0,:32]!
-        vst1.32         {d5[1]},  [r4,:32]!
-        bne             1b
-
-        pop             {r4-r6,pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/dcadsp_vfp.S b/deps/libav/libavcodec/arm/dcadsp_vfp.S
deleted file mode 100644
index edabc29..0000000
--- a/deps/libav/libavcodec/arm/dcadsp_vfp.S
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Copyright (c) 2013 RISC OS Open Ltd
- * Author: Ben Avison <bavison at riscosopen.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-POUT          .req    a1
-PIN           .req    a2
-PCOEF         .req    a3
-OLDFPSCR      .req    a4
-COUNTER       .req    ip
-
-SCALE32       .req    s28  @ use vector of 4 in place of 9th scalar when decifactor=32 / JMAX=8
-SCALE64       .req    s0   @ spare register in scalar bank when decifactor=64 / JMAX=4
-IN0           .req    s4
-IN1           .req    s5
-IN2           .req    s6
-IN3           .req    s7
-IN4           .req    s0
-IN5           .req    s1
-IN6           .req    s2
-IN7           .req    s3
-COEF0         .req    s8   @ coefficient elements
-COEF1         .req    s9
-COEF2         .req    s10
-COEF3         .req    s11
-COEF4         .req    s12
-COEF5         .req    s13
-COEF6         .req    s14
-COEF7         .req    s15
-ACCUM0        .req    s16  @ double-buffered multiply-accumulate results
-ACCUM4        .req    s20
-POST0         .req    s24  @ do long-latency post-multiply in this vector in parallel
-POST1         .req    s25
-POST2         .req    s26
-POST3         .req    s27
-
-
-.macro inner_loop  decifactor, dir, tail, head
- .ifc "\dir","up"
-  .set X, 0
-  .set Y, 4
- .else
-  .set X, 4*JMAX*4 - 4
-  .set Y, -4
- .endif
- .ifnc "\head",""
-        vldr    COEF0, [PCOEF, #X + (0*JMAX + 0) * Y]
-        vldr    COEF1, [PCOEF, #X + (1*JMAX + 0) * Y]
-        vldr    COEF2, [PCOEF, #X + (2*JMAX + 0) * Y]
-        vldr    COEF3, [PCOEF, #X + (3*JMAX + 0) * Y]
- .endif
- .ifnc "\tail",""
-        vadd.f  POST0, ACCUM0, ACCUM4   @ vector operation
- .endif
- .ifnc "\head",""
-        vmul.f  ACCUM0, COEF0, IN0      @ vector = vector * scalar
-        vldr    COEF4, [PCOEF, #X + (0*JMAX + 1) * Y]
-        vldr    COEF5, [PCOEF, #X + (1*JMAX + 1) * Y]
-        vldr    COEF6, [PCOEF, #X + (2*JMAX + 1) * Y]
- .endif
- .ifnc "\tail",""
-        vmul.f  POST0, POST0, SCALE\decifactor  @ vector operation (SCALE may be scalar)
- .endif
- .ifnc "\head",""
-        vldr    COEF7, [PCOEF, #X + (3*JMAX + 1) * Y]
-   .ifc "\tail",""
-        vmul.f  ACCUM4, COEF4, IN1      @ vector operation
-   .endif
-        vldr    COEF0, [PCOEF, #X + (0*JMAX + 2) * Y]
-        vldr    COEF1, [PCOEF, #X + (1*JMAX + 2) * Y]
-   .ifnc "\tail",""
-        vmul.f  ACCUM4, COEF4, IN1      @ vector operation
-   .endif
-        vldr    COEF2, [PCOEF, #X + (2*JMAX + 2) * Y]
-        vldr    COEF3, [PCOEF, #X + (3*JMAX + 2) * Y]
- .endif
- .ifnc "\tail",""
-        vstmia  POUT!, {POST0-POST3}
- .endif
- .ifnc "\head",""
-        vmla.f  ACCUM0, COEF0, IN2      @ vector = vector * scalar
-        vldr    COEF4, [PCOEF, #X + (0*JMAX + 3) * Y]
-        vldr    COEF5, [PCOEF, #X + (1*JMAX + 3) * Y]
-        vldr    COEF6, [PCOEF, #X + (2*JMAX + 3) * Y]
-        vldr    COEF7, [PCOEF, #X + (3*JMAX + 3) * Y]
-        vmla.f  ACCUM4, COEF4, IN3      @ vector = vector * scalar
-  .if \decifactor == 32
-        vldr    COEF0, [PCOEF, #X + (0*JMAX + 4) * Y]
-        vldr    COEF1, [PCOEF, #X + (1*JMAX + 4) * Y]
-        vldr    COEF2, [PCOEF, #X + (2*JMAX + 4) * Y]
-        vldr    COEF3, [PCOEF, #X + (3*JMAX + 4) * Y]
-        vmla.f  ACCUM0, COEF0, IN4      @ vector = vector * scalar
-        vldr    COEF4, [PCOEF, #X + (0*JMAX + 5) * Y]
-        vldr    COEF5, [PCOEF, #X + (1*JMAX + 5) * Y]
-        vldr    COEF6, [PCOEF, #X + (2*JMAX + 5) * Y]
-        vldr    COEF7, [PCOEF, #X + (3*JMAX + 5) * Y]
-        vmla.f  ACCUM4, COEF4, IN5      @ vector = vector * scalar
-        vldr    COEF0, [PCOEF, #X + (0*JMAX + 6) * Y]
-        vldr    COEF1, [PCOEF, #X + (1*JMAX + 6) * Y]
-        vldr    COEF2, [PCOEF, #X + (2*JMAX + 6) * Y]
-        vldr    COEF3, [PCOEF, #X + (3*JMAX + 6) * Y]
-        vmla.f  ACCUM0, COEF0, IN6      @ vector = vector * scalar
-        vldr    COEF4, [PCOEF, #X + (0*JMAX + 7) * Y]
-        vldr    COEF5, [PCOEF, #X + (1*JMAX + 7) * Y]
-        vldr    COEF6, [PCOEF, #X + (2*JMAX + 7) * Y]
-        vldr    COEF7, [PCOEF, #X + (3*JMAX + 7) * Y]
-        vmla.f  ACCUM4, COEF4, IN7      @ vector = vector * scalar
-  .endif
- .endif
-.endm
-
-.macro dca_lfe_fir  decifactor
-function ff_dca_lfe_fir\decifactor\()_vfp, export=1
-NOVFP   vmov    s0, r3
-        fmrx    OLDFPSCR, FPSCR
-        ldr     ip, =0x03030000         @ RunFast mode, short vectors of length 4, stride 1
-        fmxr    FPSCR, ip
-        vldr    IN0, [PIN, #-0*4]
-        vldr    IN1, [PIN, #-1*4]
-        vldr    IN2, [PIN, #-2*4]
-        vldr    IN3, [PIN, #-3*4]
- .if \decifactor == 32
-  .set JMAX, 8
-        vpush   {s16-s31}
-        vmov    SCALE32, s0             @ duplicate scalar across vector
-        vldr    IN4, [PIN, #-4*4]
-        vldr    IN5, [PIN, #-5*4]
-        vldr    IN6, [PIN, #-6*4]
-        vldr    IN7, [PIN, #-7*4]
- .else
-  .set JMAX, 4
-        vpush   {s16-s27}
- .endif
-
-        mov     COUNTER, #\decifactor/4 - 1
-        inner_loop  \decifactor, up,, head
-1:      add     PCOEF, PCOEF, #4*JMAX*4
-        subs    COUNTER, COUNTER, #1
-        inner_loop  \decifactor, up, tail, head
-        bne     1b
-        inner_loop  \decifactor, up, tail
-
-        mov     COUNTER, #\decifactor/4 - 1
-        inner_loop  \decifactor, down,, head
-1:      sub     PCOEF, PCOEF, #4*JMAX*4
-        subs    COUNTER, COUNTER, #1
-        inner_loop  \decifactor, down, tail, head
-        bne     1b
-        inner_loop  \decifactor, down, tail
-
- .if \decifactor == 32
-        vpop    {s16-s31}
- .else
-        vpop    {s16-s27}
- .endif
-        fmxr    FPSCR, OLDFPSCR
-        bx      lr
-endfunc
-.endm
-
-        dca_lfe_fir  64
- .ltorg
-        dca_lfe_fir  32
-
-        .unreq  POUT
-        .unreq  PIN
-        .unreq  PCOEF
-        .unreq  OLDFPSCR
-        .unreq  COUNTER
-
-        .unreq  SCALE32
-        .unreq  SCALE64
-        .unreq  IN0
-        .unreq  IN1
-        .unreq  IN2
-        .unreq  IN3
-        .unreq  IN4
-        .unreq  IN5
-        .unreq  IN6
-        .unreq  IN7
-        .unreq  COEF0
-        .unreq  COEF1
-        .unreq  COEF2
-        .unreq  COEF3
-        .unreq  COEF4
-        .unreq  COEF5
-        .unreq  COEF6
-        .unreq  COEF7
-        .unreq  ACCUM0
-        .unreq  ACCUM4
-        .unreq  POST0
-        .unreq  POST1
-        .unreq  POST2
-        .unreq  POST3
-
-
-IN      .req    a1
-SBACT   .req    a2
-OLDFPSCR .req   a3
-IMDCT   .req    a4
-WINDOW  .req    v1
-OUT     .req    v2
-BUF     .req    v3
-SCALEINT .req   v4 @ only used in softfp case
-COUNT   .req    v5
-
-SCALE   .req    s0
-
-/* Stack layout differs in softfp and hardfp cases:
- *
- * hardfp
- *      fp -> 6 arg words saved by caller
- *            a3,a4,v1-v3,v5,fp,lr on entry (a3 just to pad to 8 bytes)
- *            s16-s23 on entry
- *            align 16
- *     buf -> 8*32*4 bytes buffer
- *            s0 on entry
- *      sp -> 3 arg words for callee
- *
- * softfp
- *      fp -> 7 arg words saved by caller
- *            a4,v1-v5,fp,lr on entry
- *            s16-s23 on entry
- *            align 16
- *     buf -> 8*32*4 bytes buffer
- *      sp -> 4 arg words for callee
- */
-
-/* void ff_dca_qmf_32_subbands_vfp(float samples_in[32][8], int sb_act,
- *                                 SynthFilterContext *synth, FFTContext *imdct,
- *                                 float (*synth_buf_ptr)[512],
- *                                 int *synth_buf_offset, float (*synth_buf2)[32],
- *                                 const float (*window)[512], float *samples_out,
- *                                 float (*raXin)[32], float scale);
- */
-function ff_dca_qmf_32_subbands_vfp, export=1
-VFP     push    {a3-a4,v1-v3,v5,fp,lr}
-NOVFP   push    {a4,v1-v5,fp,lr}
-        add     fp, sp, #8*4
-        vpush   {s16-s23}
-        @ The buffer pointed at by raXin isn't big enough for us to do a
-        @ complete matrix transposition as we want to, so allocate an
-        @ alternative buffer from the stack. Align to 4 words for speed.
-        sub     BUF, sp, #8*32*4
-        bic     BUF, BUF, #15
-        mov     sp, BUF
-        ldr     lr, =0x03330000     @ RunFast mode, short vectors of length 4, stride 2
-        fmrx    OLDFPSCR, FPSCR
-        fmxr    FPSCR, lr
-        @ COUNT is used to count down 2 things at once:
-        @ bits 0-4 are the number of word pairs remaining in the output row
-        @ bits 5-31 are the number of words to copy (with possible negation)
-        @   from the source matrix before we start zeroing the remainder
-        mov     COUNT, #(-4 << 5) + 16
-        adds    COUNT, COUNT, SBACT, lsl #5
-        bmi     2f
-1:
-        vldr    s8,  [IN, #(0*8+0)*4]
-        vldr    s10, [IN, #(0*8+1)*4]
-        vldr    s12, [IN, #(0*8+2)*4]
-        vldr    s14, [IN, #(0*8+3)*4]
-        vldr    s16, [IN, #(0*8+4)*4]
-        vldr    s18, [IN, #(0*8+5)*4]
-        vldr    s20, [IN, #(0*8+6)*4]
-        vldr    s22, [IN, #(0*8+7)*4]
-        vneg.f  s8, s8
-        vldr    s9,  [IN, #(1*8+0)*4]
-        vldr    s11, [IN, #(1*8+1)*4]
-        vldr    s13, [IN, #(1*8+2)*4]
-        vldr    s15, [IN, #(1*8+3)*4]
-        vneg.f  s16, s16
-        vldr    s17, [IN, #(1*8+4)*4]
-        vldr    s19, [IN, #(1*8+5)*4]
-        vldr    s21, [IN, #(1*8+6)*4]
-        vldr    s23, [IN, #(1*8+7)*4]
-        vstr    d4,  [BUF, #(0*32+0)*4]
-        vstr    d5,  [BUF, #(1*32+0)*4]
-        vstr    d6,  [BUF, #(2*32+0)*4]
-        vstr    d7,  [BUF, #(3*32+0)*4]
-        vstr    d8,  [BUF, #(4*32+0)*4]
-        vstr    d9,  [BUF, #(5*32+0)*4]
-        vstr    d10, [BUF, #(6*32+0)*4]
-        vstr    d11, [BUF, #(7*32+0)*4]
-        vldr    s9,  [IN, #(3*8+0)*4]
-        vldr    s11, [IN, #(3*8+1)*4]
-        vldr    s13, [IN, #(3*8+2)*4]
-        vldr    s15, [IN, #(3*8+3)*4]
-        vldr    s17, [IN, #(3*8+4)*4]
-        vldr    s19, [IN, #(3*8+5)*4]
-        vldr    s21, [IN, #(3*8+6)*4]
-        vldr    s23, [IN, #(3*8+7)*4]
-        vneg.f  s9, s9
-        vldr    s8,  [IN, #(2*8+0)*4]
-        vldr    s10, [IN, #(2*8+1)*4]
-        vldr    s12, [IN, #(2*8+2)*4]
-        vldr    s14, [IN, #(2*8+3)*4]
-        vneg.f  s17, s17
-        vldr    s16, [IN, #(2*8+4)*4]
-        vldr    s18, [IN, #(2*8+5)*4]
-        vldr    s20, [IN, #(2*8+6)*4]
-        vldr    s22, [IN, #(2*8+7)*4]
-        vstr    d4,  [BUF, #(0*32+2)*4]
-        vstr    d5,  [BUF, #(1*32+2)*4]
-        vstr    d6,  [BUF, #(2*32+2)*4]
-        vstr    d7,  [BUF, #(3*32+2)*4]
-        vstr    d8,  [BUF, #(4*32+2)*4]
-        vstr    d9,  [BUF, #(5*32+2)*4]
-        vstr    d10, [BUF, #(6*32+2)*4]
-        vstr    d11, [BUF, #(7*32+2)*4]
-        add     IN, IN, #4*8*4
-        add     BUF, BUF, #4*4
-        subs    COUNT, COUNT, #(4 << 5) + 2
-        bpl     1b
-2:      @ Now deal with trailing < 4 samples
-        adds    COUNT, COUNT, #3 << 5
-        bmi     4f  @ sb_act was a multiple of 4
-        bics    lr, COUNT, #0x1F
-        bne     3f
-        @ sb_act was n*4+1
-        vldr    s8,  [IN, #(0*8+0)*4]
-        vldr    s10, [IN, #(0*8+1)*4]
-        vldr    s12, [IN, #(0*8+2)*4]
-        vldr    s14, [IN, #(0*8+3)*4]
-        vldr    s16, [IN, #(0*8+4)*4]
-        vldr    s18, [IN, #(0*8+5)*4]
-        vldr    s20, [IN, #(0*8+6)*4]
-        vldr    s22, [IN, #(0*8+7)*4]
-        vneg.f  s8, s8
-        vldr    s9,  zero
-        vldr    s11, zero
-        vldr    s13, zero
-        vldr    s15, zero
-        vneg.f  s16, s16
-        vldr    s17, zero
-        vldr    s19, zero
-        vldr    s21, zero
-        vldr    s23, zero
-        vstr    d4,  [BUF, #(0*32+0)*4]
-        vstr    d5,  [BUF, #(1*32+0)*4]
-        vstr    d6,  [BUF, #(2*32+0)*4]
-        vstr    d7,  [BUF, #(3*32+0)*4]
-        vstr    d8,  [BUF, #(4*32+0)*4]
-        vstr    d9,  [BUF, #(5*32+0)*4]
-        vstr    d10, [BUF, #(6*32+0)*4]
-        vstr    d11, [BUF, #(7*32+0)*4]
-        add     BUF, BUF, #2*4
-        sub     COUNT, COUNT, #1
-        b       4f
-3:      @ sb_act was n*4+2 or n*4+3, so do the first 2
-        vldr    s8,  [IN, #(0*8+0)*4]
-        vldr    s10, [IN, #(0*8+1)*4]
-        vldr    s12, [IN, #(0*8+2)*4]
-        vldr    s14, [IN, #(0*8+3)*4]
-        vldr    s16, [IN, #(0*8+4)*4]
-        vldr    s18, [IN, #(0*8+5)*4]
-        vldr    s20, [IN, #(0*8+6)*4]
-        vldr    s22, [IN, #(0*8+7)*4]
-        vneg.f  s8, s8
-        vldr    s9,  [IN, #(1*8+0)*4]
-        vldr    s11, [IN, #(1*8+1)*4]
-        vldr    s13, [IN, #(1*8+2)*4]
-        vldr    s15, [IN, #(1*8+3)*4]
-        vneg.f  s16, s16
-        vldr    s17, [IN, #(1*8+4)*4]
-        vldr    s19, [IN, #(1*8+5)*4]
-        vldr    s21, [IN, #(1*8+6)*4]
-        vldr    s23, [IN, #(1*8+7)*4]
-        vstr    d4,  [BUF, #(0*32+0)*4]
-        vstr    d5,  [BUF, #(1*32+0)*4]
-        vstr    d6,  [BUF, #(2*32+0)*4]
-        vstr    d7,  [BUF, #(3*32+0)*4]
-        vstr    d8,  [BUF, #(4*32+0)*4]
-        vstr    d9,  [BUF, #(5*32+0)*4]
-        vstr    d10, [BUF, #(6*32+0)*4]
-        vstr    d11, [BUF, #(7*32+0)*4]
-        add     BUF, BUF, #2*4
-        sub     COUNT, COUNT, #(2 << 5) + 1
-        bics    lr, COUNT, #0x1F
-        bne     4f
-        @ sb_act was n*4+3
-        vldr    s8,  [IN, #(2*8+0)*4]
-        vldr    s10, [IN, #(2*8+1)*4]
-        vldr    s12, [IN, #(2*8+2)*4]
-        vldr    s14, [IN, #(2*8+3)*4]
-        vldr    s16, [IN, #(2*8+4)*4]
-        vldr    s18, [IN, #(2*8+5)*4]
-        vldr    s20, [IN, #(2*8+6)*4]
-        vldr    s22, [IN, #(2*8+7)*4]
-        vldr    s9,  zero
-        vldr    s11, zero
-        vldr    s13, zero
-        vldr    s15, zero
-        vldr    s17, zero
-        vldr    s19, zero
-        vldr    s21, zero
-        vldr    s23, zero
-        vstr    d4,  [BUF, #(0*32+0)*4]
-        vstr    d5,  [BUF, #(1*32+0)*4]
-        vstr    d6,  [BUF, #(2*32+0)*4]
-        vstr    d7,  [BUF, #(3*32+0)*4]
-        vstr    d8,  [BUF, #(4*32+0)*4]
-        vstr    d9,  [BUF, #(5*32+0)*4]
-        vstr    d10, [BUF, #(6*32+0)*4]
-        vstr    d11, [BUF, #(7*32+0)*4]
-        add     BUF, BUF, #2*4
-        sub     COUNT, COUNT, #1
-4:      @ Now fill the remainder with 0
-        vldr    s8, zero
-        vldr    s9, zero
-        ands    COUNT, COUNT, #0x1F
-        beq     6f
-5:      vstr    d4, [BUF, #(0*32+0)*4]
-        vstr    d4, [BUF, #(1*32+0)*4]
-        vstr    d4, [BUF, #(2*32+0)*4]
-        vstr    d4, [BUF, #(3*32+0)*4]
-        vstr    d4, [BUF, #(4*32+0)*4]
-        vstr    d4, [BUF, #(5*32+0)*4]
-        vstr    d4, [BUF, #(6*32+0)*4]
-        vstr    d4, [BUF, #(7*32+0)*4]
-        add     BUF, BUF, #2*4
-        subs    COUNT, COUNT, #1
-        bne     5b
-6:
-        fmxr    FPSCR, OLDFPSCR
-        ldr     WINDOW, [fp, #3*4]
-        ldr     OUT, [fp, #4*4]
-        sub     BUF, BUF, #32*4
-NOVFP   ldr     SCALEINT, [fp, #6*4]
-        mov     COUNT, #8
-VFP     vpush   {SCALE}
-VFP     sub     sp, sp, #3*4
-NOVFP   sub     sp, sp, #4*4
-7:
-VFP     ldr     a1, [fp, #-7*4]     @ imdct
-NOVFP   ldr     a1, [fp, #-8*4]
-        ldmia   fp, {a2-a4}
-VFP     stmia   sp, {WINDOW, OUT, BUF}
-NOVFP   stmia   sp, {WINDOW, OUT, BUF, SCALEINT}
-VFP     vldr    SCALE, [sp, #3*4]
-        bl      X(ff_synth_filter_float_vfp)
-        add     OUT, OUT, #32*4
-        add     BUF, BUF, #32*4
-        subs    COUNT, COUNT, #1
-        bne     7b
-
-A       sub     sp, fp, #(8+8)*4
-T       sub     fp, fp, #(8+8)*4
-T       mov     sp, fp
-        vpop    {s16-s23}
-VFP     pop     {a3-a4,v1-v3,v5,fp,pc}
-NOVFP   pop     {a4,v1-v5,fp,pc}
-endfunc
-
-        .unreq  IN
-        .unreq  SBACT
-        .unreq  OLDFPSCR
-        .unreq  IMDCT
-        .unreq  WINDOW
-        .unreq  OUT
-        .unreq  BUF
-        .unreq  SCALEINT
-        .unreq  COUNT
-
-        .unreq  SCALE
-
-        .align 2
-zero:   .word   0
diff --git a/deps/libav/libavcodec/arm/dsputil_arm.S b/deps/libav/libavcodec/arm/dsputil_arm.S
deleted file mode 100644
index 82fcf2a..0000000
--- a/deps/libav/libavcodec/arm/dsputil_arm.S
+++ /dev/null
@@ -1,120 +0,0 @@
-@
-@ ARMv4 optimized DSP utils
-@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
-@
-@ This file is part of Libav.
-@
-@ Libav 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.
-@
-@ Libav 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 Libav; if not, write to the Free Software
-@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-@
-
-#include "config.h"
-#include "libavutil/arm/asm.S"
-
-@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, int stride)
-function ff_add_pixels_clamped_arm, export=1, align=5
-        push            {r4-r10}
-        mov             r10, #8
-1:
-        ldr             r4,  [r1]               /* load dest */
-        /* block[0] and block[1]*/
-        ldrsh           r5,  [r0]
-        ldrsh           r7,  [r0, #2]
-        and             r6,  r4,  #0xFF
-        and             r8,  r4,  #0xFF00
-        add             r6,  r6,  r5
-        add             r8,  r7,  r8,  lsr #8
-        mvn             r5,  r5
-        mvn             r7,  r7
-        tst             r6,  #0x100
-        it              ne
-        movne           r6,  r5,  lsr #24
-        tst             r8,  #0x100
-        it              ne
-        movne           r8,  r7,  lsr #24
-        mov             r9,  r6
-        ldrsh           r5,  [r0, #4]           /* moved form [A] */
-        orr             r9,  r9,  r8,  lsl #8
-        /* block[2] and block[3] */
-        /* [A] */
-        ldrsh           r7,  [r0, #6]
-        and             r6,  r4,  #0xFF0000
-        and             r8,  r4,  #0xFF000000
-        add             r6,  r5,  r6,  lsr #16
-        add             r8,  r7,  r8,  lsr #24
-        mvn             r5,  r5
-        mvn             r7,  r7
-        tst             r6,  #0x100
-        it              ne
-        movne           r6,  r5,  lsr #24
-        tst             r8,  #0x100
-        it              ne
-        movne           r8,  r7,  lsr #24
-        orr             r9,  r9,  r6,  lsl #16
-        ldr             r4,  [r1, #4]           /* moved form [B] */
-        orr             r9,  r9,  r8,  lsl #24
-        /* store dest */
-        ldrsh           r5,  [r0, #8]           /* moved form [C] */
-        str             r9,  [r1]
-
-        /* load dest */
-        /* [B] */
-        /* block[4] and block[5] */
-        /* [C] */
-        ldrsh           r7,  [r0, #10]
-        and             r6,  r4,  #0xFF
-        and             r8,  r4,  #0xFF00
-        add             r6,  r6,  r5
-        add             r8,  r7,  r8,  lsr #8
-        mvn             r5,  r5
-        mvn             r7,  r7
-        tst             r6,  #0x100
-        it              ne
-        movne           r6,  r5,  lsr #24
-        tst             r8,  #0x100
-        it              ne
-        movne           r8,  r7,  lsr #24
-        mov             r9,  r6
-        ldrsh           r5,  [r0, #12]          /* moved from [D] */
-        orr             r9,  r9,  r8,  lsl #8
-        /* block[6] and block[7] */
-        /* [D] */
-        ldrsh           r7,  [r0, #14]
-        and             r6,  r4,  #0xFF0000
-        and             r8,  r4,  #0xFF000000
-        add             r6,  r5,  r6,  lsr #16
-        add             r8,  r7,  r8,  lsr #24
-        mvn             r5,  r5
-        mvn             r7,  r7
-        tst             r6,  #0x100
-        it              ne
-        movne           r6,  r5,  lsr #24
-        tst             r8,  #0x100
-        it              ne
-        movne           r8,  r7,  lsr #24
-        orr             r9,  r9,  r6,  lsl #16
-        add             r0,  r0,  #16           /* moved from [E] */
-        orr             r9,  r9,  r8,  lsl #24
-        subs            r10, r10, #1            /* moved from [F] */
-        /* store dest */
-        str             r9,  [r1, #4]
-
-        /* [E] */
-        /* [F] */
-        add             r1,  r1,  r2
-        bne             1b
-
-        pop             {r4-r10}
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/dsputil_arm.h b/deps/libav/libavcodec/arm/dsputil_arm.h
deleted file mode 100644
index cd074df..0000000
--- a/deps/libav/libavcodec/arm/dsputil_arm.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_DSPUTIL_ARM_H
-#define AVCODEC_ARM_DSPUTIL_ARM_H
-
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-
-void ff_dsputil_init_armv5te(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_vfp(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx);
-
-#endif /* AVCODEC_ARM_DSPUTIL_ARM_H */
diff --git a/deps/libav/libavcodec/arm/dsputil_armv6.S b/deps/libav/libavcodec/arm/dsputil_armv6.S
deleted file mode 100644
index e667a47..0000000
--- a/deps/libav/libavcodec/arm/dsputil_armv6.S
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_add_pixels_clamped_armv6, export=1
-        push            {r4-r8,lr}
-        mov             r3,  #8
-1:
-        ldm             r0!, {r4,r5,r12,lr}
-        ldrd            r6,  r7,  [r1]
-        pkhbt           r8,  r4,  r5,  lsl #16
-        pkhtb           r5,  r5,  r4,  asr #16
-        pkhbt           r4,  r12, lr,  lsl #16
-        pkhtb           lr,  lr,  r12, asr #16
-        pld             [r1, r2]
-        uxtab16         r8,  r8,  r6
-        uxtab16         r5,  r5,  r6,  ror #8
-        uxtab16         r4,  r4,  r7
-        uxtab16         lr,  lr,  r7,  ror #8
-        usat16          r8,  #8,  r8
-        usat16          r5,  #8,  r5
-        usat16          r4,  #8,  r4
-        usat16          lr,  #8,  lr
-        orr             r6,  r8,  r5,  lsl #8
-        orr             r7,  r4,  lr,  lsl #8
-        subs            r3,  r3,  #1
-        strd_post       r6,  r7,  r1,  r2
-        bgt             1b
-        pop             {r4-r8,pc}
-endfunc
-
-function ff_get_pixels_armv6, export=1
-        pld             [r1, r2]
-        push            {r4-r8, lr}
-        mov             lr,  #8
-1:
-        ldrd_post       r4,  r5,  r1,  r2
-        subs            lr,  lr,  #1
-        uxtb16          r6,  r4
-        uxtb16          r4,  r4,  ror #8
-        uxtb16          r12, r5
-        uxtb16          r8,  r5,  ror #8
-        pld             [r1, r2]
-        pkhbt           r5,  r6,  r4,  lsl #16
-        pkhtb           r6,  r4,  r6,  asr #16
-        pkhbt           r7,  r12, r8,  lsl #16
-        pkhtb           r12, r8,  r12, asr #16
-        stm             r0!, {r5,r6,r7,r12}
-        bgt             1b
-
-        pop             {r4-r8, pc}
-endfunc
-
-function ff_diff_pixels_armv6, export=1
-        pld             [r1, r3]
-        pld             [r2, r3]
-        push            {r4-r9, lr}
-        mov             lr,  #8
-1:
-        ldrd_post       r4,  r5,  r1,  r3
-        ldrd_post       r6,  r7,  r2,  r3
-        uxtb16          r8,  r4
-        uxtb16          r4,  r4,  ror #8
-        uxtb16          r9,  r6
-        uxtb16          r6,  r6,  ror #8
-        pld             [r1, r3]
-        ssub16          r9,  r8,  r9
-        ssub16          r6,  r4,  r6
-        uxtb16          r8,  r5
-        uxtb16          r5,  r5,  ror #8
-        pld             [r2, r3]
-        pkhbt           r4,  r9,  r6,  lsl #16
-        pkhtb           r6,  r6,  r9,  asr #16
-        uxtb16          r9,  r7
-        uxtb16          r7,  r7,  ror #8
-        ssub16          r9,  r8,  r9
-        ssub16          r5,  r5,  r7
-        subs            lr,  lr,  #1
-        pkhbt           r8,  r9,  r5,  lsl #16
-        pkhtb           r9,  r5,  r9,  asr #16
-        stm             r0!, {r4,r6,r8,r9}
-        bgt             1b
-
-        pop             {r4-r9, pc}
-endfunc
-
-function ff_pix_abs16_armv6, export=1
-        ldr             r0,  [sp]
-        push            {r4-r9, lr}
-        mov             r12, #0
-        mov             lr,  #0
-        ldm             r1,  {r4-r7}
-        ldr             r8,  [r2]
-1:
-        ldr             r9,  [r2, #4]
-        pld             [r1, r3]
-        usada8          r12, r4,  r8,  r12
-        ldr             r8,  [r2, #8]
-        pld             [r2, r3]
-        usada8          lr,  r5,  r9,  lr
-        ldr             r9,  [r2, #12]
-        usada8          r12, r6,  r8,  r12
-        subs            r0,  r0,  #1
-        usada8          lr,  r7,  r9,  lr
-        beq             2f
-        add             r1,  r1,  r3
-        ldm             r1,  {r4-r7}
-        add             r2,  r2,  r3
-        ldr             r8,  [r2]
-        b               1b
-2:
-        add             r0,  r12, lr
-        pop             {r4-r9, pc}
-endfunc
-
-function ff_pix_abs16_x2_armv6, export=1
-        ldr             r12, [sp]
-        push            {r4-r11, lr}
-        mov             r0,  #0
-        mov             lr,  #1
-        orr             lr,  lr,  lr,  lsl #8
-        orr             lr,  lr,  lr,  lsl #16
-1:
-        ldr             r8,  [r2]
-        ldr             r9,  [r2, #4]
-        lsr             r10, r8,  #8
-        ldr             r4,  [r1]
-        lsr             r6,  r9,  #8
-        orr             r10, r10, r9,  lsl #24
-        ldr             r5,  [r2, #8]
-        eor             r11, r8,  r10
-        uhadd8          r7,  r8,  r10
-        orr             r6,  r6,  r5,  lsl #24
-        and             r11, r11, lr
-        uadd8           r7,  r7,  r11
-        ldr             r8,  [r1, #4]
-        usada8          r0,  r4,  r7,  r0
-        eor             r7,  r9,  r6
-        lsr             r10, r5,  #8
-        and             r7,  r7,  lr
-        uhadd8          r4,  r9,  r6
-        ldr             r6,  [r2, #12]
-        uadd8           r4,  r4,  r7
-        pld             [r1, r3]
-        orr             r10, r10, r6,  lsl #24
-        usada8          r0,  r8,  r4,  r0
-        ldr             r4,  [r1, #8]
-        eor             r11, r5,  r10
-        ldrb            r7,  [r2, #16]
-        and             r11, r11, lr
-        uhadd8          r8,  r5,  r10
-        ldr             r5,  [r1, #12]
-        uadd8           r8,  r8,  r11
-        pld             [r2, r3]
-        lsr             r10, r6,  #8
-        usada8          r0,  r4,  r8,  r0
-        orr             r10, r10, r7,  lsl #24
-        subs            r12,  r12,  #1
-        eor             r11, r6,  r10
-        add             r1,  r1,  r3
-        uhadd8          r9,  r6,  r10
-        and             r11, r11, lr
-        uadd8           r9,  r9,  r11
-        add             r2,  r2,  r3
-        usada8          r0,  r5,  r9,  r0
-        bgt             1b
-
-        pop             {r4-r11, pc}
-endfunc
-
-.macro  usad_y2         p0,  p1,  p2,  p3,  n0,  n1,  n2,  n3
-        ldr             \n0, [r2]
-        eor             \n1, \p0, \n0
-        uhadd8          \p0, \p0, \n0
-        and             \n1, \n1, lr
-        ldr             \n2, [r1]
-        uadd8           \p0, \p0, \n1
-        ldr             \n1, [r2, #4]
-        usada8          r0,  \p0, \n2, r0
-        pld             [r1,  r3]
-        eor             \n3, \p1, \n1
-        uhadd8          \p1, \p1, \n1
-        and             \n3, \n3, lr
-        ldr             \p0, [r1, #4]
-        uadd8           \p1, \p1, \n3
-        ldr             \n2, [r2, #8]
-        usada8          r0,  \p1, \p0, r0
-        pld             [r2,  r3]
-        eor             \p0, \p2, \n2
-        uhadd8          \p2, \p2, \n2
-        and             \p0, \p0, lr
-        ldr             \p1, [r1, #8]
-        uadd8           \p2, \p2, \p0
-        ldr             \n3, [r2, #12]
-        usada8          r0,  \p2, \p1, r0
-        eor             \p1, \p3, \n3
-        uhadd8          \p3, \p3, \n3
-        and             \p1, \p1, lr
-        ldr             \p0,  [r1, #12]
-        uadd8           \p3, \p3, \p1
-        add             r1,  r1,  r3
-        usada8          r0,  \p3, \p0,  r0
-        add             r2,  r2,  r3
-.endm
-
-function ff_pix_abs16_y2_armv6, export=1
-        pld             [r1]
-        pld             [r2]
-        ldr             r12, [sp]
-        push            {r4-r11, lr}
-        mov             r0,  #0
-        mov             lr,  #1
-        orr             lr,  lr,  lr,  lsl #8
-        orr             lr,  lr,  lr,  lsl #16
-        ldr             r4,  [r2]
-        ldr             r5,  [r2, #4]
-        ldr             r6,  [r2, #8]
-        ldr             r7,  [r2, #12]
-        add             r2,  r2,  r3
-1:
-        usad_y2         r4,  r5,  r6,  r7,  r8,  r9,  r10, r11
-        subs            r12, r12, #2
-        usad_y2         r8,  r9,  r10, r11, r4,  r5,  r6,  r7
-        bgt             1b
-
-        pop             {r4-r11, pc}
-endfunc
-
-function ff_pix_abs8_armv6, export=1
-        pld             [r2, r3]
-        ldr             r12, [sp]
-        push            {r4-r9, lr}
-        mov             r0,  #0
-        mov             lr,  #0
-        ldrd_post       r4,  r5,  r1,  r3
-1:
-        subs            r12, r12, #2
-        ldr             r7,  [r2, #4]
-        ldr_post        r6,  r2,  r3
-        ldrd_post       r8,  r9,  r1,  r3
-        usada8          r0,  r4,  r6,  r0
-        pld             [r2, r3]
-        usada8          lr,  r5,  r7,  lr
-        ldr             r7,  [r2, #4]
-        ldr_post        r6,  r2,  r3
-        beq             2f
-        ldrd_post       r4,  r5,  r1,  r3
-        usada8          r0,  r8,  r6,  r0
-        pld             [r2, r3]
-        usada8          lr,  r9,  r7,  lr
-        b               1b
-2:
-        usada8          r0,  r8,  r6,  r0
-        usada8          lr,  r9,  r7,  lr
-        add             r0,  r0,  lr
-        pop             {r4-r9, pc}
-endfunc
-
-function ff_sse16_armv6, export=1
-        ldr             r12, [sp]
-        push            {r4-r9, lr}
-        mov             r0,  #0
-1:
-        ldrd            r4,  r5,  [r1]
-        ldr             r8,  [r2]
-        uxtb16          lr,  r4
-        uxtb16          r4,  r4,  ror #8
-        uxtb16          r9,  r8
-        uxtb16          r8,  r8,  ror #8
-        ldr             r7,  [r2, #4]
-        usub16          lr,  lr,  r9
-        usub16          r4,  r4,  r8
-        smlad           r0,  lr,  lr,  r0
-        uxtb16          r6,  r5
-        uxtb16          lr,  r5,  ror #8
-        uxtb16          r8,  r7
-        uxtb16          r9,  r7,  ror #8
-        smlad           r0,  r4,  r4,  r0
-        ldrd            r4,  r5,  [r1, #8]
-        usub16          r6,  r6,  r8
-        usub16          r8,  lr,  r9
-        ldr             r7,  [r2, #8]
-        smlad           r0,  r6,  r6,  r0
-        uxtb16          lr,  r4
-        uxtb16          r4,  r4,  ror #8
-        uxtb16          r9,  r7
-        uxtb16          r7,  r7, ror #8
-        smlad           r0,  r8,  r8,  r0
-        ldr             r8,  [r2, #12]
-        usub16          lr,  lr,  r9
-        usub16          r4,  r4,  r7
-        smlad           r0,  lr,  lr,  r0
-        uxtb16          r6,  r5
-        uxtb16          r5,  r5,  ror #8
-        uxtb16          r9,  r8
-        uxtb16          r8,  r8,  ror #8
-        smlad           r0,  r4,  r4,  r0
-        usub16          r6,  r6,  r9
-        usub16          r5,  r5,  r8
-        smlad           r0,  r6,  r6,  r0
-        add             r1,  r1,  r3
-        add             r2,  r2,  r3
-        subs            r12, r12, #1
-        smlad           r0,  r5,  r5,  r0
-        bgt             1b
-
-        pop             {r4-r9, pc}
-endfunc
-
-function ff_pix_norm1_armv6, export=1
-        push            {r4-r6, lr}
-        mov             r12, #16
-        mov             lr,  #0
-1:
-        ldm             r0,  {r2-r5}
-        uxtb16          r6,  r2
-        uxtb16          r2,  r2,  ror #8
-        smlad           lr,  r6,  r6,  lr
-        uxtb16          r6,  r3
-        smlad           lr,  r2,  r2,  lr
-        uxtb16          r3,  r3,  ror #8
-        smlad           lr,  r6,  r6,  lr
-        uxtb16          r6,  r4
-        smlad           lr,  r3,  r3,  lr
-        uxtb16          r4,  r4,  ror #8
-        smlad           lr,  r6,  r6,  lr
-        uxtb16          r6,  r5
-        smlad           lr,  r4,  r4,  lr
-        uxtb16          r5,  r5,  ror #8
-        smlad           lr,  r6,  r6,  lr
-        subs            r12, r12, #1
-        add             r0,  r0,  r1
-        smlad           lr,  r5,  r5,  lr
-        bgt             1b
-
-        mov             r0,  lr
-        pop             {r4-r6, pc}
-endfunc
-
-function ff_pix_sum_armv6, export=1
-        push            {r4-r7, lr}
-        mov             r12, #16
-        mov             r2,  #0
-        mov             r3,  #0
-        mov             lr,  #0
-        ldr             r4,  [r0]
-1:
-        subs            r12, r12, #1
-        ldr             r5,  [r0, #4]
-        usada8          r2,  r4,  lr,  r2
-        ldr             r6,  [r0, #8]
-        usada8          r3,  r5,  lr,  r3
-        ldr             r7,  [r0, #12]
-        usada8          r2,  r6,  lr,  r2
-        beq             2f
-        ldr_pre         r4,  r0,  r1
-        usada8          r3,  r7,  lr,  r3
-        bgt             1b
-2:
-        usada8          r3,  r7,  lr,  r3
-        add             r0,  r2,  r3
-        pop             {r4-r7, pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/dsputil_init_arm.c b/deps/libav/libavcodec/arm/dsputil_init_arm.c
deleted file mode 100644
index bb68eb6..0000000
--- a/deps/libav/libavcodec/arm/dsputil_init_arm.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * ARM optimized DSP utils
- * Copyright (c) 2001 Lionel Ulmer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "dsputil_arm.h"
-
-void ff_j_rev_dct_arm(int16_t *data);
-void ff_simple_idct_arm(int16_t *data);
-
-/* XXX: local hack */
-static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
-static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
-
-void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
-                               int line_size);
-
-/* XXX: those functions should be suppressed ASAP when all IDCTs are
-   converted */
-static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_j_rev_dct_arm (block);
-    ff_put_pixels_clamped(block, dest, line_size);
-}
-static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_j_rev_dct_arm (block);
-    ff_add_pixels_clamped(block, dest, line_size);
-}
-static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_simple_idct_arm (block);
-    ff_put_pixels_clamped(block, dest, line_size);
-}
-static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_simple_idct_arm (block);
-    ff_add_pixels_clamped(block, dest, line_size);
-}
-
-av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    ff_put_pixels_clamped = c->put_pixels_clamped;
-    ff_add_pixels_clamped = c->add_pixels_clamped;
-
-    if (avctx->bits_per_raw_sample <= 8) {
-        if(avctx->idct_algo == FF_IDCT_AUTO ||
-           avctx->idct_algo == FF_IDCT_ARM){
-            c->idct_put              = j_rev_dct_arm_put;
-            c->idct_add              = j_rev_dct_arm_add;
-            c->idct                  = ff_j_rev_dct_arm;
-            c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
-        } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM){
-            c->idct_put              = simple_idct_arm_put;
-            c->idct_add              = simple_idct_arm_add;
-            c->idct                  = ff_simple_idct_arm;
-            c->idct_permutation_type = FF_NO_IDCT_PERM;
-        }
-    }
-
-    c->add_pixels_clamped = ff_add_pixels_clamped_arm;
-
-    if (have_armv5te(cpu_flags)) ff_dsputil_init_armv5te(c, avctx);
-    if (have_armv6(cpu_flags))   ff_dsputil_init_armv6(c, avctx);
-    if (have_neon(cpu_flags))    ff_dsputil_init_neon(c, avctx);
-}
diff --git a/deps/libav/libavcodec/arm/dsputil_init_armv5te.c b/deps/libav/libavcodec/arm/dsputil_init_armv5te.c
deleted file mode 100644
index 302a655..0000000
--- a/deps/libav/libavcodec/arm/dsputil_init_armv5te.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "dsputil_arm.h"
-
-void ff_simple_idct_armv5te(int16_t *data);
-void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
-
-av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)
-{
-    if (avctx->bits_per_raw_sample <= 8 &&
-        (avctx->idct_algo == FF_IDCT_AUTO ||
-         avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
-        c->idct_put              = ff_simple_idct_put_armv5te;
-        c->idct_add              = ff_simple_idct_add_armv5te;
-        c->idct                  = ff_simple_idct_armv5te;
-        c->idct_permutation_type = FF_NO_IDCT_PERM;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/dsputil_init_armv6.c b/deps/libav/libavcodec/arm/dsputil_init_armv6.c
deleted file mode 100644
index 4c8ba47..0000000
--- a/deps/libav/libavcodec/arm/dsputil_init_armv6.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavcodec/avcodec.h"
-#include "dsputil_arm.h"
-
-void ff_simple_idct_armv6(int16_t *data);
-void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
-
-void ff_add_pixels_clamped_armv6(const int16_t *block,
-                                 uint8_t *restrict pixels,
-                                 int line_size);
-
-void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride);
-void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1,
-                          const uint8_t *s2, int stride);
-
-int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
-                       int line_size, int h);
-int ff_pix_abs16_x2_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
-                          int line_size, int h);
-int ff_pix_abs16_y2_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
-                          int line_size, int h);
-
-int ff_pix_abs8_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
-                       int line_size, int h);
-
-int ff_sse16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
-                   int line_size, int h);
-
-int ff_pix_norm1_armv6(uint8_t *pix, int line_size);
-int ff_pix_sum_armv6(uint8_t *pix, int line_size);
-
-av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx)
-{
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    if (avctx->bits_per_raw_sample <= 8 &&
-        (avctx->idct_algo == FF_IDCT_AUTO ||
-         avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) {
-        c->idct_put              = ff_simple_idct_put_armv6;
-        c->idct_add              = ff_simple_idct_add_armv6;
-        c->idct                  = ff_simple_idct_armv6;
-        c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
-    }
-
-    if (!high_bit_depth)
-        c->get_pixels = ff_get_pixels_armv6;
-    c->add_pixels_clamped = ff_add_pixels_clamped_armv6;
-    c->diff_pixels = ff_diff_pixels_armv6;
-
-    c->pix_abs[0][0] = ff_pix_abs16_armv6;
-    c->pix_abs[0][1] = ff_pix_abs16_x2_armv6;
-    c->pix_abs[0][2] = ff_pix_abs16_y2_armv6;
-
-    c->pix_abs[1][0] = ff_pix_abs8_armv6;
-
-    c->sad[0] = ff_pix_abs16_armv6;
-    c->sad[1] = ff_pix_abs8_armv6;
-
-    c->sse[0] = ff_sse16_armv6;
-
-    c->pix_norm1 = ff_pix_norm1_armv6;
-    c->pix_sum   = ff_pix_sum_armv6;
-}
diff --git a/deps/libav/libavcodec/arm/dsputil_init_neon.c b/deps/libav/libavcodec/arm/dsputil_init_neon.c
deleted file mode 100644
index 0926c84..0000000
--- a/deps/libav/libavcodec/arm/dsputil_init_neon.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "dsputil_arm.h"
-
-void ff_simple_idct_neon(int16_t *data);
-void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
-
-void ff_clear_block_neon(int16_t *block);
-void ff_clear_blocks_neon(int16_t *blocks);
-
-void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, int);
-void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int);
-void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int);
-
-void ff_vector_clipf_neon(float *dst, const float *src, float min, float max,
-                          int len);
-void ff_vector_clip_int32_neon(int32_t *dst, const int32_t *src, int32_t min,
-                               int32_t max, unsigned int len);
-
-int32_t ff_scalarproduct_int16_neon(const int16_t *v1, const int16_t *v2, int len);
-int32_t ff_scalarproduct_and_madd_int16_neon(int16_t *v1, const int16_t *v2,
-                                             const int16_t *v3, int len, int mul);
-
-av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
-{
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    if (avctx->bits_per_raw_sample <= 8) {
-        if (avctx->idct_algo == FF_IDCT_AUTO ||
-            avctx->idct_algo == FF_IDCT_SIMPLENEON) {
-            c->idct_put              = ff_simple_idct_put_neon;
-            c->idct_add              = ff_simple_idct_add_neon;
-            c->idct                  = ff_simple_idct_neon;
-            c->idct_permutation_type = FF_PARTTRANS_IDCT_PERM;
-        }
-    }
-
-    if (!high_bit_depth) {
-        c->clear_block  = ff_clear_block_neon;
-        c->clear_blocks = ff_clear_blocks_neon;
-    }
-
-    c->add_pixels_clamped = ff_add_pixels_clamped_neon;
-    c->put_pixels_clamped = ff_put_pixels_clamped_neon;
-    c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon;
-
-    c->vector_clipf               = ff_vector_clipf_neon;
-    c->vector_clip_int32          = ff_vector_clip_int32_neon;
-
-    c->scalarproduct_int16 = ff_scalarproduct_int16_neon;
-    c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_neon;
-}
diff --git a/deps/libav/libavcodec/arm/dsputil_neon.S b/deps/libav/libavcodec/arm/dsputil_neon.S
deleted file mode 100644
index e30bd10..0000000
--- a/deps/libav/libavcodec/arm/dsputil_neon.S
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_clear_block_neon, export=1
-        vmov.i16        q0,  #0
-        .rept           8
-        vst1.16         {q0}, [r0,:128]!
-        .endr
-        bx              lr
-endfunc
-
-function ff_clear_blocks_neon, export=1
-        vmov.i16        q0,  #0
-        .rept           8*6
-        vst1.16         {q0}, [r0,:128]!
-        .endr
-        bx              lr
-endfunc
-
-function ff_put_pixels_clamped_neon, export=1
-        vld1.16         {d16-d19}, [r0,:128]!
-        vqmovun.s16     d0, q8
-        vld1.16         {d20-d23}, [r0,:128]!
-        vqmovun.s16     d1, q9
-        vld1.16         {d24-d27}, [r0,:128]!
-        vqmovun.s16     d2, q10
-        vld1.16         {d28-d31}, [r0,:128]!
-        vqmovun.s16     d3, q11
-        vst1.8          {d0},      [r1,:64], r2
-        vqmovun.s16     d4, q12
-        vst1.8          {d1},      [r1,:64], r2
-        vqmovun.s16     d5, q13
-        vst1.8          {d2},      [r1,:64], r2
-        vqmovun.s16     d6, q14
-        vst1.8          {d3},      [r1,:64], r2
-        vqmovun.s16     d7, q15
-        vst1.8          {d4},      [r1,:64], r2
-        vst1.8          {d5},      [r1,:64], r2
-        vst1.8          {d6},      [r1,:64], r2
-        vst1.8          {d7},      [r1,:64], r2
-        bx              lr
-endfunc
-
-function ff_put_signed_pixels_clamped_neon, export=1
-        vmov.u8         d31, #128
-        vld1.16         {d16-d17}, [r0,:128]!
-        vqmovn.s16      d0, q8
-        vld1.16         {d18-d19}, [r0,:128]!
-        vqmovn.s16      d1, q9
-        vld1.16         {d16-d17}, [r0,:128]!
-        vqmovn.s16      d2, q8
-        vld1.16         {d18-d19}, [r0,:128]!
-        vadd.u8         d0, d0, d31
-        vld1.16         {d20-d21}, [r0,:128]!
-        vadd.u8         d1, d1, d31
-        vld1.16         {d22-d23}, [r0,:128]!
-        vadd.u8         d2, d2, d31
-        vst1.8          {d0},      [r1,:64], r2
-        vqmovn.s16      d3, q9
-        vst1.8          {d1},      [r1,:64], r2
-        vqmovn.s16      d4, q10
-        vst1.8          {d2},      [r1,:64], r2
-        vqmovn.s16      d5, q11
-        vld1.16         {d24-d25}, [r0,:128]!
-        vadd.u8         d3, d3, d31
-        vld1.16         {d26-d27}, [r0,:128]!
-        vadd.u8         d4, d4, d31
-        vadd.u8         d5, d5, d31
-        vst1.8          {d3},      [r1,:64], r2
-        vqmovn.s16      d6, q12
-        vst1.8          {d4},      [r1,:64], r2
-        vqmovn.s16      d7, q13
-        vst1.8          {d5},      [r1,:64], r2
-        vadd.u8         d6, d6, d31
-        vadd.u8         d7, d7, d31
-        vst1.8          {d6},      [r1,:64], r2
-        vst1.8          {d7},      [r1,:64], r2
-        bx              lr
-endfunc
-
-function ff_add_pixels_clamped_neon, export=1
-        mov             r3, r1
-        vld1.8          {d16},   [r1,:64], r2
-        vld1.16         {d0-d1}, [r0,:128]!
-        vaddw.u8        q0, q0, d16
-        vld1.8          {d17},   [r1,:64], r2
-        vld1.16         {d2-d3}, [r0,:128]!
-        vqmovun.s16     d0, q0
-        vld1.8          {d18},   [r1,:64], r2
-        vaddw.u8        q1, q1, d17
-        vld1.16         {d4-d5}, [r0,:128]!
-        vaddw.u8        q2, q2, d18
-        vst1.8          {d0},    [r3,:64], r2
-        vqmovun.s16     d2, q1
-        vld1.8          {d19},   [r1,:64], r2
-        vld1.16         {d6-d7}, [r0,:128]!
-        vaddw.u8        q3, q3, d19
-        vqmovun.s16     d4, q2
-        vst1.8          {d2},    [r3,:64], r2
-        vld1.8          {d16},   [r1,:64], r2
-        vqmovun.s16     d6, q3
-        vld1.16         {d0-d1}, [r0,:128]!
-        vaddw.u8        q0, q0, d16
-        vst1.8          {d4},    [r3,:64], r2
-        vld1.8          {d17},   [r1,:64], r2
-        vld1.16         {d2-d3}, [r0,:128]!
-        vaddw.u8        q1, q1, d17
-        vst1.8          {d6},    [r3,:64], r2
-        vqmovun.s16     d0, q0
-        vld1.8          {d18},   [r1,:64], r2
-        vld1.16         {d4-d5}, [r0,:128]!
-        vaddw.u8        q2, q2, d18
-        vst1.8          {d0},    [r3,:64], r2
-        vqmovun.s16     d2, q1
-        vld1.8          {d19},   [r1,:64], r2
-        vqmovun.s16     d4, q2
-        vld1.16         {d6-d7}, [r0,:128]!
-        vaddw.u8        q3, q3, d19
-        vst1.8          {d2},    [r3,:64], r2
-        vqmovun.s16     d6, q3
-        vst1.8          {d4},    [r3,:64], r2
-        vst1.8          {d6},    [r3,:64], r2
-        bx              lr
-endfunc
-
-function ff_vector_clipf_neon, export=1
-VFP     vdup.32         q1,  d0[1]
-VFP     vdup.32         q0,  d0[0]
-NOVFP   vdup.32         q0,  r2
-NOVFP   vdup.32         q1,  r3
-NOVFP   ldr             r2,  [sp]
-        vld1.f32        {q2},[r1,:128]!
-        vmin.f32        q10, q2,  q1
-        vld1.f32        {q3},[r1,:128]!
-        vmin.f32        q11, q3,  q1
-1:      vmax.f32        q8,  q10, q0
-        vmax.f32        q9,  q11, q0
-        subs            r2,  r2,  #8
-        beq             2f
-        vld1.f32        {q2},[r1,:128]!
-        vmin.f32        q10, q2,  q1
-        vld1.f32        {q3},[r1,:128]!
-        vmin.f32        q11, q3,  q1
-        vst1.f32        {q8},[r0,:128]!
-        vst1.f32        {q9},[r0,:128]!
-        b               1b
-2:      vst1.f32        {q8},[r0,:128]!
-        vst1.f32        {q9},[r0,:128]!
-        bx              lr
-endfunc
-
-function ff_vector_clip_int32_neon, export=1
-        vdup.32         q0,  r2
-        vdup.32         q1,  r3
-        ldr             r2,  [sp]
-1:
-        vld1.32         {q2-q3},  [r1,:128]!
-        vmin.s32        q2,  q2,  q1
-        vmin.s32        q3,  q3,  q1
-        vmax.s32        q2,  q2,  q0
-        vmax.s32        q3,  q3,  q0
-        vst1.32         {q2-q3},  [r0,:128]!
-        subs            r2,  r2,  #8
-        bgt             1b
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/fft_fixed_init_arm.c b/deps/libav/libavcodec/arm/fft_fixed_init_arm.c
deleted file mode 100644
index 2f749e4..0000000
--- a/deps/libav/libavcodec/arm/fft_fixed_init_arm.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/cpu.h"
-
-#define FFT_FLOAT 0
-#include "libavcodec/fft.h"
-
-void ff_fft_fixed_calc_neon(FFTContext *s, FFTComplex *z);
-void ff_mdct_fixed_calc_neon(FFTContext *s, FFTSample *o, const FFTSample *i);
-void ff_mdct_fixed_calcw_neon(FFTContext *s, FFTDouble *o, const FFTSample *i);
-
-av_cold void ff_fft_fixed_init_arm(FFTContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
-        s->fft_calc        = ff_fft_fixed_calc_neon;
-
-#if CONFIG_MDCT
-        if (!s->inverse && s->nbits >= 3) {
-            s->mdct_permutation = FF_MDCT_PERM_INTERLEAVE;
-            s->mdct_calc        = ff_mdct_fixed_calc_neon;
-            s->mdct_calcw       = ff_mdct_fixed_calcw_neon;
-        }
-#endif
-    }
-}
diff --git a/deps/libav/libavcodec/arm/fft_fixed_neon.S b/deps/libav/libavcodec/arm/fft_fixed_neon.S
deleted file mode 100644
index faddc00..0000000
--- a/deps/libav/libavcodec/arm/fft_fixed_neon.S
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-.macro  bflies          d0,  d1,  r0,  r1
-        vrev64.32       \r0, \d1                @ t5, t6, t1, t2
-        vhsub.s16       \r1, \d1, \r0           @ t1-t5, t2-t6, t5-t1, t6-t2
-        vhadd.s16       \r0, \d1, \r0           @ t1+t5, t2+t6, t5+t1, t6+t2
-        vext.16         \r1, \r1, \r1, #1       @ t2-t6, t5-t1, t6-t2, t1-t5
-        vtrn.32         \r0, \r1                @ t1+t5, t2+t6, t2-t6, t5-t1
-                                                @ t5,    t6,    t4,    t3
-        vhsub.s16       \d1, \d0, \r0
-        vhadd.s16       \d0, \d0, \r0
-.endm
-
-.macro  transform01     q0,  q1,  d3,  c0,  c1,  r0,  w0,  w1
-        vrev32.16       \r0, \d3
-        vmull.s16       \w0, \d3, \c0
-        vmlal.s16       \w0, \r0, \c1
-        vshrn.s32       \d3, \w0, #15
-        bflies          \q0, \q1, \w0, \w1
-.endm
-
-.macro  transform2      d0,  d1,  d2,  d3,  q0,  q1,  c0,  c1,  c2,  c3, \
-                        r0,  r1,  w0,  w1
-        vrev32.16       \r0, \d1
-        vrev32.16       \r1, \d3
-        vmull.s16       \w0, \d1, \c0
-        vmlal.s16       \w0, \r0, \c1
-        vmull.s16       \w1, \d3, \c2
-        vmlal.s16       \w1, \r1, \c3
-        vshrn.s32       \d1, \w0, #15
-        vshrn.s32       \d3, \w1, #15
-        bflies          \q0, \q1, \w0, \w1
-.endm
-
-.macro  fft4            d0,  d1,  r0,  r1
-        vhsub.s16       \r0, \d0, \d1           @ t3, t4, t8, t7
-        vhsub.s16       \r1, \d1, \d0
-        vhadd.s16       \d0, \d0, \d1           @ t1, t2, t6, t5
-        vmov.i64        \d1, #0xffff00000000
-        vbit            \r0, \r1, \d1
-        vrev64.16       \r1, \r0                @ t7, t8, t4, t3
-        vtrn.32         \r0, \r1                @ t3, t4, t7, t8
-        vtrn.32         \d0, \r0                @ t1, t2, t3, t4, t6, t5, t8, t7
-        vhsub.s16       \d1, \d0, \r0           @ r2, i2, r3, i1
-        vhadd.s16       \d0, \d0, \r0           @ r0, i0, r1, i3
-.endm
-
-.macro  fft8            d0,  d1,  d2,  d3,  q0,  q1,  c0,  c1,  r0,  r1, w0, w1
-        fft4            \d0, \d1, \r0, \r1
-        vtrn.32         \d0, \d1                @ z0, z2, z1, z3
-        vhadd.s16       \r0, \d2, \d3           @ t1, t2, t3, t4
-        vhsub.s16       \d3, \d2, \d3           @ z5, z7
-        vmov            \d2, \r0
-        transform01     \q0, \q1, \d3, \c0, \c1, \r0, \w0, \w1
-.endm
-
-function fft4_neon
-        vld1.16         {d0-d1},  [r0]
-        fft4            d0,  d1,  d2,  d3
-        vst1.16         {d0-d1},  [r0]
-        bx              lr
-endfunc
-
-function fft8_neon
-        vld1.16         {d0-d3},  [r0,:128]
-        movrel          r1,  coefs
-        vld1.16         {d30},    [r1,:64]
-        vdup.16         d31, d30[0]
-        fft8            d0,  d1,  d2,  d3,  q0,  q1,  d31, d30, d20, d21, q8, q9
-        vtrn.32         d0,  d1
-        vtrn.32         d2,  d3
-        vst1.16         {d0-d3},  [r0,:128]
-        bx              lr
-endfunc
-
-function fft16_neon
-        vld1.16         {d0-d3},  [r0,:128]!
-        vld1.16         {d4-d7},  [r0,:128]
-        movrel          r1,  coefs
-        sub             r0,  r0,  #32
-        vld1.16         {d28-d31},[r1,:128]
-        vdup.16         d31, d28[0]
-        fft8            d0,  d1,  d2,  d3,  q0,  q1,  d31, d28, d20, d21, q8, q9
-        vswp            d5,  d6
-        fft4            q2,  q3,  q8,  q9
-        vswp            d5,  d6
-        vtrn.32         q0,  q1             @ z0, z4, z2, z6, z1, z5, z3, z7
-        vtrn.32         q2,  q3             @ z8, z12,z10,z14,z9, z13,z11,z15
-        vswp            d1,  d2
-        vdup.16         d31, d28[0]
-        transform01     q0,  q2,  d5,  d31, d28, d20, q8, q9
-        vdup.16         d26, d29[0]
-        vdup.16         d27, d30[0]
-        transform2      d2,  d6,  d3,  d7,  q1,  q3,  d26, d30, d27, d29, \
-                        d20, d21, q8,  q9
-        vtrn.32         q0,  q1
-        vtrn.32         q2,  q3
-        vst1.16         {d0-d3},  [r0,:128]!
-        vst1.16         {d4-d7},  [r0,:128]
-        bx              lr
-endfunc
-
-function fft_pass_neon
-        push            {r4,lr}
-        movrel          lr,  coefs + 24
-        vld1.16         {d30},    [lr,:64]
-        lsl             r12, r2,  #3
-        vmov            d31, d30
-        add             r3,  r1,  r2,  lsl #2
-        mov             lr,  #-8
-        sub             r3,  r3,  #2
-        mov             r4,  r0
-        vld1.16         {d27[]},  [r3,:16]
-        sub             r3,  r3,  #6
-        vld1.16         {q0},     [r4,:128], r12
-        vld1.16         {q1},     [r4,:128], r12
-        vld1.16         {q2},     [r4,:128], r12
-        vld1.16         {q3},     [r4,:128], r12
-        vld1.16         {d28},    [r1,:64]!
-        vld1.16         {d29},    [r3,:64], lr
-        vswp            d1,  d2
-        vswp            d5,  d6
-        vtrn.32         d0,  d1
-        vtrn.32         d4,  d5
-        vdup.16         d25, d28[1]
-        vmul.s16        d27, d27, d31
-        transform01     q0,  q2,  d5,  d25, d27, d20, q8,  q9
-        b               2f
-1:
-        mov             r4,  r0
-        vdup.16         d26, d29[0]
-        vld1.16         {q0},     [r4,:128], r12
-        vld1.16         {q1},     [r4,:128], r12
-        vld1.16         {q2},     [r4,:128], r12
-        vld1.16         {q3},     [r4,:128], r12
-        vld1.16         {d28},    [r1,:64]!
-        vld1.16         {d29},    [r3,:64], lr
-        vswp            d1,  d2
-        vswp            d5,  d6
-        vtrn.32         d0,  d1
-        vtrn.32         d4,  d5
-        vdup.16         d24, d28[0]
-        vdup.16         d25, d28[1]
-        vdup.16         d27, d29[3]
-        vmul.s16        q13, q13, q15
-        transform2      d0,  d4,  d1,  d5,  q0,  q2,  d24, d26, d25, d27, \
-                        d16, d17, q9,  q10
-2:
-        vtrn.32         d2,  d3
-        vtrn.32         d6,  d7
-        vdup.16         d24, d28[2]
-        vdup.16         d26, d29[2]
-        vdup.16         d25, d28[3]
-        vdup.16         d27, d29[1]
-        vmul.s16        q13, q13, q15
-        transform2      d2,  d6,  d3,  d7,  q1,  q3,  d24, d26, d25, d27, \
-                        d16, d17, q9,  q10
-        vtrn.32         d0,  d1
-        vtrn.32         d2,  d3
-        vtrn.32         d4,  d5
-        vtrn.32         d6,  d7
-        vswp            d1,  d2
-        vswp            d5,  d6
-        mov             r4,  r0
-        vst1.16         {q0},     [r4,:128], r12
-        vst1.16         {q1},     [r4,:128], r12
-        vst1.16         {q2},     [r4,:128], r12
-        vst1.16         {q3},     [r4,:128], r12
-        add             r0,  r0,  #16
-        subs            r2,  r2,  #2
-        bgt             1b
-        pop             {r4,pc}
-endfunc
-
-#define F_SQRT1_2   23170
-#define F_COS_16_1  30274
-#define F_COS_16_3  12540
-
-const   coefs, align=4
-        .short          F_SQRT1_2, -F_SQRT1_2, -F_SQRT1_2,  F_SQRT1_2
-        .short          F_COS_16_1,-F_COS_16_1,-F_COS_16_1, F_COS_16_1
-        .short          F_COS_16_3,-F_COS_16_3,-F_COS_16_3, F_COS_16_3
-        .short          1,         -1,         -1,          1
-endconst
-
-.macro  def_fft n, n2, n4
-function fft\n\()_neon
-        push            {r4, lr}
-        mov             r4,  r0
-        bl              fft\n2\()_neon
-        add             r0,  r4,  #\n4*2*4
-        bl              fft\n4\()_neon
-        add             r0,  r4,  #\n4*3*4
-        bl              fft\n4\()_neon
-        mov             r0,  r4
-        pop             {r4, lr}
-        movrelx         r1,  X(ff_cos_\n\()_fixed)
-        mov             r2,  #\n4/2
-        b               fft_pass_neon
-endfunc
-.endm
-
-        def_fft    32,    16,     8
-        def_fft    64,    32,    16
-        def_fft   128,    64,    32
-        def_fft   256,   128,    64
-        def_fft   512,   256,   128
-        def_fft  1024,   512,   256
-        def_fft  2048,  1024,   512
-        def_fft  4096,  2048,  1024
-        def_fft  8192,  4096,  2048
-        def_fft 16384,  8192,  4096
-        def_fft 32768, 16384,  8192
-        def_fft 65536, 32768, 16384
-
-function ff_fft_fixed_calc_neon, export=1
-        ldr             r2,  [r0]
-        sub             r2,  r2,  #2
-        movrel          r3,  fft_fixed_tab_neon
-        ldr             r3,  [r3, r2, lsl #2]
-        mov             r0,  r1
-        bx              r3
-endfunc
-
-const   fft_fixed_tab_neon
-        .word fft4_neon
-        .word fft8_neon
-        .word fft16_neon
-        .word fft32_neon
-        .word fft64_neon
-        .word fft128_neon
-        .word fft256_neon
-        .word fft512_neon
-        .word fft1024_neon
-        .word fft2048_neon
-        .word fft4096_neon
-        .word fft8192_neon
-        .word fft16384_neon
-        .word fft32768_neon
-        .word fft65536_neon
-endconst
diff --git a/deps/libav/libavcodec/arm/fft_init_arm.c b/deps/libav/libavcodec/arm/fft_init_arm.c
deleted file mode 100644
index 3a3d1a7..0000000
--- a/deps/libav/libavcodec/arm/fft_init_arm.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/fft.h"
-#include "libavcodec/rdft.h"
-#include "libavcodec/synth_filter.h"
-
-void ff_fft_permute_neon(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_neon(FFTContext *s, FFTComplex *z);
-
-void ff_imdct_half_vfp(FFTContext *s, FFTSample *output, const FFTSample *input);
-
-void ff_imdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_mdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
-
-void ff_rdft_calc_neon(struct RDFTContext *s, FFTSample *z);
-
-av_cold void ff_fft_init_arm(FFTContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_vfp(cpu_flags)) {
-#if CONFIG_MDCT
-        if (!have_vfpv3(cpu_flags))
-            s->imdct_half   = ff_imdct_half_vfp;
-#endif
-    }
-
-    if (have_neon(cpu_flags)) {
-        s->fft_permute  = ff_fft_permute_neon;
-        s->fft_calc     = ff_fft_calc_neon;
-#if CONFIG_MDCT
-        s->imdct_calc   = ff_imdct_calc_neon;
-        s->imdct_half   = ff_imdct_half_neon;
-        s->mdct_calc    = ff_mdct_calc_neon;
-        s->mdct_permutation = FF_MDCT_PERM_INTERLEAVE;
-#endif
-    }
-}
-
-#if CONFIG_RDFT
-av_cold void ff_rdft_init_arm(RDFTContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags))
-        s->rdft_calc    = ff_rdft_calc_neon;
-}
-#endif
diff --git a/deps/libav/libavcodec/arm/fft_neon.S b/deps/libav/libavcodec/arm/fft_neon.S
deleted file mode 100644
index c4d8918..0000000
--- a/deps/libav/libavcodec/arm/fft_neon.S
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * ARM NEON optimised FFT
- *
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- * Copyright (c) 2009 Naotoshi Nojiri
- *
- * This algorithm (though not any of the implementation details) is
- * based on libdjbfft by D. J. Bernstein.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-#define M_SQRT1_2 0.70710678118654752440
-
-
-function fft4_neon
-        vld1.32         {d0-d3}, [r0,:128]
-
-        vext.32         q8,  q1,  q1,  #1       @ i2,r3 d3=i3,r2
-        vsub.f32        d6,  d0,  d1            @ r0-r1,i0-i1
-        vsub.f32        d7,  d16, d17           @ r3-r2,i2-i3
-        vadd.f32        d4,  d0,  d1            @ r0+r1,i0+i1
-        vadd.f32        d5,  d2,  d3            @ i2+i3,r2+r3
-        vadd.f32        d1,  d6,  d7
-        vsub.f32        d3,  d6,  d7
-        vadd.f32        d0,  d4,  d5
-        vsub.f32        d2,  d4,  d5
-
-        vst1.32         {d0-d3}, [r0,:128]
-
-        bx              lr
-endfunc
-
-function fft8_neon
-        mov             r1,  r0
-        vld1.32         {d0-d3},   [r1,:128]!
-        vld1.32         {d16-d19}, [r1,:128]
-
-        movw            r2,  #0x04f3            @ sqrt(1/2)
-        movt            r2,  #0x3f35
-        eor             r3,  r2,  #1<<31
-        vdup.32         d31, r2
-
-        vext.32         q11, q1,  q1,  #1       @ i2,r3,i3,r2
-        vadd.f32        d4,  d16, d17           @ r4+r5,i4+i5
-        vmov            d28, r3,  r2
-        vadd.f32        d5,  d18, d19           @ r6+r7,i6+i7
-        vsub.f32        d17, d16, d17           @ r4-r5,i4-i5
-        vsub.f32        d19, d18, d19           @ r6-r7,i6-i7
-        vrev64.32       d29, d28
-        vadd.f32        d20, d0,  d1            @ r0+r1,i0+i1
-        vadd.f32        d21, d2,  d3            @ r2+r3,i2+i3
-        vmul.f32        d26, d17, d28           @ -a2r*w,a2i*w
-        vext.32         q3,  q2,  q2,  #1
-        vmul.f32        d27, d19, d29           @ a3r*w,-a3i*w
-        vsub.f32        d23, d22, d23           @ i2-i3,r3-r2
-        vsub.f32        d22, d0,  d1            @ r0-r1,i0-i1
-        vmul.f32        d24, d17, d31           @ a2r*w,a2i*w
-        vmul.f32        d25, d19, d31           @ a3r*w,a3i*w
-        vadd.f32        d0,  d20, d21
-        vsub.f32        d2,  d20, d21
-        vadd.f32        d1,  d22, d23
-        vrev64.32       q13, q13
-        vsub.f32        d3,  d22, d23
-        vsub.f32        d6,  d6,  d7
-        vadd.f32        d24, d24, d26           @ a2r+a2i,a2i-a2r   t1,t2
-        vadd.f32        d25, d25, d27           @ a3r-a3i,a3i+a3r   t5,t6
-        vadd.f32        d7,  d4,  d5
-        vsub.f32        d18, d2,  d6
-        vext.32         q13, q12, q12, #1
-        vadd.f32        d2,  d2,  d6
-        vsub.f32        d16, d0,  d7
-        vadd.f32        d5,  d25, d24
-        vsub.f32        d4,  d26, d27
-        vadd.f32        d0,  d0,  d7
-        vsub.f32        d17, d1,  d5
-        vsub.f32        d19, d3,  d4
-        vadd.f32        d3,  d3,  d4
-        vadd.f32        d1,  d1,  d5
-
-        vst1.32         {d16-d19}, [r1,:128]
-        vst1.32         {d0-d3},   [r0,:128]
-
-        bx              lr
-endfunc
-
-function fft16_neon
-        movrel          r1, mppm
-        vld1.32         {d16-d19}, [r0,:128]!   @ q8{r0,i0,r1,i1} q9{r2,i2,r3,i3}
-        pld             [r0, #32]
-        vld1.32         {d2-d3}, [r1,:128]
-        vext.32         q13, q9,  q9,  #1
-        vld1.32         {d22-d25}, [r0,:128]!   @ q11{r4,i4,r5,i5} q12{r6,i5,r7,i7}
-        vadd.f32        d4,  d16, d17
-        vsub.f32        d5,  d16, d17
-        vadd.f32        d18, d18, d19
-        vsub.f32        d19, d26, d27
-
-        vadd.f32        d20, d22, d23
-        vsub.f32        d22, d22, d23
-        vsub.f32        d23, d24, d25
-        vadd.f32        q8,  q2,  q9            @ {r0,i0,r1,i1}
-        vadd.f32        d21, d24, d25
-        vmul.f32        d24, d22, d2
-        vsub.f32        q9,  q2,  q9            @ {r2,i2,r3,i3}
-        vmul.f32        d25, d23, d3
-        vuzp.32         d16, d17                @ {r0,r1,i0,i1}
-        vmul.f32        q1,  q11, d2[1]
-        vuzp.32         d18, d19                @ {r2,r3,i2,i3}
-        vrev64.32       q12, q12
-        vadd.f32        q11, q12, q1            @ {t1a,t2a,t5,t6}
-        vld1.32         {d24-d27}, [r0,:128]!   @ q12{r8,i8,r9,i9} q13{r10,i10,r11,i11}
-        vzip.32         q10, q11
-        vld1.32         {d28-d31}, [r0,:128]    @ q14{r12,i12,r13,i13} q15{r14,i14,r15,i15}
-        vadd.f32        d0,  d22, d20
-        vadd.f32        d1,  d21, d23
-        vsub.f32        d2,  d21, d23
-        vsub.f32        d3,  d22, d20
-        sub             r0,  r0,  #96
-        vext.32         q13, q13, q13, #1
-        vsub.f32        q10, q8,  q0            @ {r4,r5,i4,i5}
-        vadd.f32        q8,  q8,  q0            @ {r0,r1,i0,i1}
-        vext.32         q15, q15, q15, #1
-        vsub.f32        q11, q9,  q1            @ {r6,r7,i6,i7}
-        vswp            d25, d26                @ q12{r8,i8,i10,r11} q13{r9,i9,i11,r10}
-        vadd.f32        q9,  q9,  q1            @ {r2,r3,i2,i3}
-        vswp            d29, d30                @ q14{r12,i12,i14,r15} q15{r13,i13,i15,r14}
-        vadd.f32        q0,  q12, q13           @ {t1,t2,t5,t6}
-        vadd.f32        q1,  q14, q15           @ {t1a,t2a,t5a,t6a}
-        movrelx         r2,  X(ff_cos_16)
-        vsub.f32        q13, q12, q13           @ {t3,t4,t7,t8}
-        vrev64.32       d1,  d1
-        vsub.f32        q15, q14, q15           @ {t3a,t4a,t7a,t8a}
-        vrev64.32       d3,  d3
-        movrel          r3,  pmmp
-        vswp            d1,  d26                @ q0{t1,t2,t3,t4} q13{t6,t5,t7,t8}
-        vswp            d3,  d30                @ q1{t1a,t2a,t3a,t4a} q15{t6a,t5a,t7a,t8a}
-        vadd.f32        q12, q0,  q13           @ {r8,i8,r9,i9}
-        vadd.f32        q14, q1,  q15           @ {r12,i12,r13,i13}
-        vld1.32         {d4-d5},  [r2,:64]
-        vsub.f32        q13, q0,  q13           @ {r10,i10,r11,i11}
-        vsub.f32        q15, q1,  q15           @ {r14,i14,r15,i15}
-        vswp            d25, d28                @ q12{r8,i8,r12,i12} q14{r9,i9,r13,i13}
-        vld1.32         {d6-d7},  [r3,:128]
-        vrev64.32       q1,  q14
-        vmul.f32        q14, q14, d4[1]
-        vmul.f32        q1,  q1,  q3
-        vmla.f32        q14, q1,  d5[1]         @ {t1a,t2a,t5a,t6a}
-        vswp            d27, d30                @ q13{r10,i10,r14,i14} q15{r11,i11,r15,i15}
-        vzip.32         q12, q14
-        vadd.f32        d0,  d28, d24
-        vadd.f32        d1,  d25, d29
-        vsub.f32        d2,  d25, d29
-        vsub.f32        d3,  d28, d24
-        vsub.f32        q12, q8,  q0            @ {r8,r9,i8,i9}
-        vadd.f32        q8,  q8,  q0            @ {r0,r1,i0,i1}
-        vsub.f32        q14, q10, q1            @ {r12,r13,i12,i13}
-        mov             r1,  #32
-        vadd.f32        q10, q10, q1            @ {r4,r5,i4,i5}
-        vrev64.32       q0,  q13
-        vmul.f32        q13, q13, d5[0]
-        vrev64.32       q1,  q15
-        vmul.f32        q15, q15, d5[1]
-        vst2.32         {d16-d17},[r0,:128], r1
-        vmul.f32        q0,  q0,  q3
-        vst2.32         {d20-d21},[r0,:128], r1
-        vmul.f32        q1,  q1,  q3
-        vmla.f32        q13, q0,  d5[0]         @ {t1,t2,t5,t6}
-        vmla.f32        q15, q1,  d4[1]         @ {t1a,t2a,t5a,t6a}
-        vst2.32         {d24-d25},[r0,:128], r1
-        vst2.32         {d28-d29},[r0,:128]
-        vzip.32         q13, q15
-        sub             r0, r0, #80
-        vadd.f32        d0,  d30, d26
-        vadd.f32        d1,  d27, d31
-        vsub.f32        d2,  d27, d31
-        vsub.f32        d3,  d30, d26
-        vsub.f32        q13, q9,  q0            @ {r10,r11,i10,i11}
-        vadd.f32        q9,  q9,  q0            @ {r2,r3,i2,i3}
-        vsub.f32        q15, q11, q1            @ {r14,r15,i14,i15}
-        vadd.f32        q11, q11, q1            @ {r6,r7,i6,i7}
-        vst2.32         {d18-d19},[r0,:128], r1
-        vst2.32         {d22-d23},[r0,:128], r1
-        vst2.32         {d26-d27},[r0,:128], r1
-        vst2.32         {d30-d31},[r0,:128]
-        bx              lr
-endfunc
-
-function fft_pass_neon
-        push            {r4-r6,lr}
-        mov             r6,  r2                 @ n
-        lsl             r5,  r2,  #3            @ 2 * n * sizeof FFTSample
-        lsl             r4,  r2,  #4            @ 2 * n * sizeof FFTComplex
-        lsl             r2,  r2,  #5            @ 4 * n * sizeof FFTComplex
-        add             r3,  r2,  r4
-        add             r4,  r4,  r0            @ &z[o1]
-        add             r2,  r2,  r0            @ &z[o2]
-        add             r3,  r3,  r0            @ &z[o3]
-        vld1.32         {d20-d21},[r2,:128]     @ {z[o2],z[o2+1]}
-        movrel          r12, pmmp
-        vld1.32         {d22-d23},[r3,:128]     @ {z[o3],z[o3+1]}
-        add             r5,  r5,  r1            @ wim
-        vld1.32         {d6-d7},  [r12,:128]    @ pmmp
-        vswp            d21, d22
-        vld1.32         {d4},     [r1,:64]!     @ {wre[0],wre[1]}
-        sub             r5,  r5,  #4            @ wim--
-        vrev64.32       q1,  q11
-        vmul.f32        q11, q11, d4[1]
-        vmul.f32        q1,  q1,  q3
-        vld1.32         {d5[0]},  [r5,:32]      @ d5[0] = wim[-1]
-        vmla.f32        q11, q1,  d5[0]         @ {t1a,t2a,t5a,t6a}
-        vld2.32         {d16-d17},[r0,:128]     @ {z[0],z[1]}
-        sub             r6, r6, #1              @ n--
-        vld2.32         {d18-d19},[r4,:128]     @ {z[o1],z[o1+1]}
-        vzip.32         q10, q11
-        vadd.f32        d0,  d22, d20
-        vadd.f32        d1,  d21, d23
-        vsub.f32        d2,  d21, d23
-        vsub.f32        d3,  d22, d20
-        vsub.f32        q10, q8,  q0
-        vadd.f32        q8,  q8,  q0
-        vsub.f32        q11, q9,  q1
-        vadd.f32        q9,  q9,  q1
-        vst2.32         {d20-d21},[r2,:128]!    @ {z[o2],z[o2+1]}
-        vst2.32         {d16-d17},[r0,:128]!    @ {z[0],z[1]}
-        vst2.32         {d22-d23},[r3,:128]!    @ {z[o3],z[o3+1]}
-        vst2.32         {d18-d19},[r4,:128]!    @ {z[o1],z[o1+1]}
-        sub             r5,  r5,  #8            @ wim -= 2
-1:
-        vld1.32         {d20-d21},[r2,:128]     @ {z[o2],z[o2+1]}
-        vld1.32         {d22-d23},[r3,:128]     @ {z[o3],z[o3+1]}
-        vswp            d21, d22
-        vld1.32         {d4}, [r1]!             @ {wre[0],wre[1]}
-        vrev64.32       q0,  q10
-        vmul.f32        q10, q10, d4[0]
-        vrev64.32       q1,  q11
-        vmul.f32        q11, q11, d4[1]
-        vld1.32         {d5}, [r5]              @ {wim[-1],wim[0]}
-        vmul.f32        q0,  q0,  q3
-        sub             r5,  r5,  #8            @ wim -= 2
-        vmul.f32        q1,  q1,  q3
-        vmla.f32        q10, q0,  d5[1]         @ {t1,t2,t5,t6}
-        vmla.f32        q11, q1,  d5[0]         @ {t1a,t2a,t5a,t6a}
-        vld2.32         {d16-d17},[r0,:128]     @ {z[0],z[1]}
-        subs            r6,  r6,  #1            @ n--
-        vld2.32         {d18-d19},[r4,:128]     @ {z[o1],z[o1+1]}
-        vzip.32         q10, q11
-        vadd.f32        d0,  d22, d20
-        vadd.f32        d1,  d21, d23
-        vsub.f32        d2,  d21, d23
-        vsub.f32        d3,  d22, d20
-        vsub.f32        q10, q8,  q0
-        vadd.f32        q8,  q8,  q0
-        vsub.f32        q11, q9,  q1
-        vadd.f32        q9,  q9,  q1
-        vst2.32         {d20-d21}, [r2,:128]!   @ {z[o2],z[o2+1]}
-        vst2.32         {d16-d17}, [r0,:128]!   @ {z[0],z[1]}
-        vst2.32         {d22-d23}, [r3,:128]!   @ {z[o3],z[o3+1]}
-        vst2.32         {d18-d19}, [r4,:128]!   @ {z[o1],z[o1+1]}
-        bne             1b
-
-        pop             {r4-r6,pc}
-endfunc
-
-.macro  def_fft n, n2, n4
-        .align 6
-function fft\n\()_neon
-        push            {r4, lr}
-        mov             r4,  r0
-        bl              fft\n2\()_neon
-        add             r0,  r4,  #\n4*2*8
-        bl              fft\n4\()_neon
-        add             r0,  r4,  #\n4*3*8
-        bl              fft\n4\()_neon
-        mov             r0,  r4
-        pop             {r4, lr}
-        movrelx         r1,  X(ff_cos_\n)
-        mov             r2,  #\n4/2
-        b               fft_pass_neon
-endfunc
-.endm
-
-        def_fft    32,    16,     8
-        def_fft    64,    32,    16
-        def_fft   128,    64,    32
-        def_fft   256,   128,    64
-        def_fft   512,   256,   128
-        def_fft  1024,   512,   256
-        def_fft  2048,  1024,   512
-        def_fft  4096,  2048,  1024
-        def_fft  8192,  4096,  2048
-        def_fft 16384,  8192,  4096
-        def_fft 32768, 16384,  8192
-        def_fft 65536, 32768, 16384
-
-function ff_fft_calc_neon, export=1
-        ldr             r2,  [r0]
-        sub             r2,  r2,  #2
-        movrel          r3,  fft_tab_neon
-        ldr             r3,  [r3, r2, lsl #2]
-        mov             r0,  r1
-        bx              r3
-endfunc
-
-function ff_fft_permute_neon, export=1
-        push            {r4,lr}
-        mov             r12, #1
-        ldr             r2,  [r0]       @ nbits
-        ldr             r3,  [r0, #12]  @ tmp_buf
-        ldr             r0,  [r0, #8]   @ revtab
-        lsl             r12, r12, r2
-        mov             r2,  r12
-1:
-        vld1.32         {d0-d1}, [r1,:128]!
-        ldr             r4,  [r0], #4
-        uxth            lr,  r4
-        uxth            r4,  r4,  ror #16
-        add             lr,  r3,  lr,  lsl #3
-        add             r4,  r3,  r4,  lsl #3
-        vst1.32         {d0}, [lr,:64]
-        vst1.32         {d1}, [r4,:64]
-        subs            r12, r12, #2
-        bgt             1b
-
-        sub             r1,  r1,  r2,  lsl #3
-1:
-        vld1.32         {d0-d3}, [r3,:128]!
-        vst1.32         {d0-d3}, [r1,:128]!
-        subs            r2,  r2,  #4
-        bgt             1b
-
-        pop             {r4,pc}
-endfunc
-
-const   fft_tab_neon
-        .word fft4_neon
-        .word fft8_neon
-        .word fft16_neon
-        .word fft32_neon
-        .word fft64_neon
-        .word fft128_neon
-        .word fft256_neon
-        .word fft512_neon
-        .word fft1024_neon
-        .word fft2048_neon
-        .word fft4096_neon
-        .word fft8192_neon
-        .word fft16384_neon
-        .word fft32768_neon
-        .word fft65536_neon
-endconst
-
-const   pmmp, align=4
-        .float          +1.0, -1.0, -1.0, +1.0
-endconst
-
-const   mppm, align=4
-        .float          -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2
-endconst
diff --git a/deps/libav/libavcodec/arm/fft_vfp.S b/deps/libav/libavcodec/arm/fft_vfp.S
deleted file mode 100644
index 7845ebb..0000000
--- a/deps/libav/libavcodec/arm/fft_vfp.S
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (c) 2013 RISC OS Open Ltd
- * Author: Ben Avison <bavison at riscosopen.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-@ TODO: * FFTs wider than 16
-@       * dispatch code
-
-function fft4_vfp
-        vldr    d0, [a1, #0*2*4]   @ s0,s1   = z[0]
-        vldr    d4, [a1, #1*2*4]   @ s8,s9   = z[1]
-        vldr    d1, [a1, #2*2*4]   @ s2,s3   = z[2]
-        vldr    d5, [a1, #3*2*4]   @ s10,s11 = z[3]
-        @ stall
-        vadd.f  s12, s0, s8        @ i0
-        vadd.f  s13, s1, s9        @ i1
-        vadd.f  s14, s2, s10       @ i2
-        vadd.f  s15, s3, s11       @ i3
-        vsub.f  s8, s0, s8         @ i4
-        vsub.f  s9, s1, s9         @ i5
-        vsub.f  s10, s2, s10       @ i6
-        vsub.f  s11, s3, s11       @ i7
-        @ stall
-        @ stall
-        vadd.f  s0, s12, s14       @ z[0].re
-        vsub.f  s4, s12, s14       @ z[2].re
-        vadd.f  s1, s13, s15       @ z[0].im
-        vsub.f  s5, s13, s15       @ z[2].im
-        vadd.f  s7, s9, s10        @ z[3].im
-        vsub.f  s3, s9, s10        @ z[1].im
-        vadd.f  s2, s8, s11        @ z[1].re
-        vsub.f  s6, s8, s11        @ z[3].re
-        @ stall
-        @ stall
-        vstr    d0, [a1, #0*2*4]
-        vstr    d2, [a1, #2*2*4]
-        @ stall
-        @ stall
-        vstr    d1, [a1, #1*2*4]
-        vstr    d3, [a1, #3*2*4]
-
-        bx      lr
-endfunc
-
-.macro macro_fft8_head
-        @ FFT4
-        vldr    d4, [a1, #0 * 2*4]
-        vldr    d6, [a1, #1 * 2*4]
-        vldr    d5, [a1, #2 * 2*4]
-        vldr    d7, [a1, #3 * 2*4]
-            @ BF
-            vldr    d12, [a1, #4 * 2*4]
-        vadd.f  s16, s8, s12    @ vector op
-            vldr    d14, [a1, #5 * 2*4]
-            vldr    d13, [a1, #6 * 2*4]
-            vldr    d15, [a1, #7 * 2*4]
-        vsub.f  s20, s8, s12    @ vector op
-        vadd.f  s0, s16, s18
-        vsub.f  s2, s16, s18
-        vadd.f  s1, s17, s19
-        vsub.f  s3, s17, s19
-        vadd.f  s7, s21, s22
-        vsub.f  s5, s21, s22
-        vadd.f  s4, s20, s23
-        vsub.f  s6, s20, s23
-            vsub.f  s20, s24, s28   @ vector op
-        vstr    d0, [a1, #0 * 2*4]  @ transfer s0-s7 to s24-s31 via memory
-        vstr    d1, [a1, #1 * 2*4]
-        vldr    s0, cos1pi4
-            vadd.f  s16, s24, s28   @ vector op
-        vstr    d2, [a1, #2 * 2*4]
-        vstr    d3, [a1, #3 * 2*4]
-        vldr    d12, [a1, #0 * 2*4]
-            @ TRANSFORM
-            vmul.f  s20, s20, s0    @ vector x scalar op
-        vldr    d13, [a1, #1 * 2*4]
-        vldr    d14, [a1, #2 * 2*4]
-        vldr    d15, [a1, #3 * 2*4]
-        @ BUTTERFLIES
-        vadd.f  s0, s18, s16
-        vadd.f  s1, s17, s19
-        vsub.f  s2, s17, s19
-        vsub.f  s3, s18, s16
-            vadd.f  s4, s21, s20
-            vsub.f  s5, s21, s20
-            vadd.f  s6, s22, s23
-            vsub.f  s7, s22, s23
-        vadd.f  s8, s0, s24         @ vector op
-        vstr    d0, [a1, #0 * 2*4]  @ transfer s0-s3 to s12-s15 via memory
-        vstr    d1, [a1, #1 * 2*4]
-        vldr    d6, [a1, #0 * 2*4]
-        vldr    d7, [a1, #1 * 2*4]
-            vadd.f  s1, s5, s6
-            vadd.f  s0, s7, s4
-            vsub.f  s2, s5, s6
-            vsub.f  s3, s7, s4
-        vsub.f  s12, s24, s12       @ vector op
-            vsub.f  s5, s29, s1
-            vsub.f  s4, s28, s0
-            vsub.f  s6, s30, s2
-            vsub.f  s7, s31, s3
-            vadd.f  s16, s0, s28    @ vector op
-        vstr    d6, [a1, #4 * 2*4]
-        vstr    d7, [a1, #6 * 2*4]
-        vstr    d4, [a1, #0 * 2*4]
-        vstr    d5, [a1, #2 * 2*4]
-             vstr    d2, [a1, #5 * 2*4]
-             vstr    d3, [a1, #7 * 2*4]
-.endm
-
-.macro macro_fft8_tail
-             vstr    d8, [a1, #1 * 2*4]
-             vstr    d9, [a1, #3 * 2*4]
-.endm
-
-function fft8_vfp
-        ldr     a3, =0x03030000     @ RunFast mode, vector length 4, stride 1
-        fmrx    a2, FPSCR
-        fmxr    FPSCR, a3
-        vpush   {s16-s31}
-
-        macro_fft8_head
-        macro_fft8_tail
-
-        vpop    {s16-s31}
-        fmxr    FPSCR, a2
-        bx      lr
-endfunc
-
-.align 3
-cos1pi4:    @ cos(1*pi/4) = sqrt(2)
-        .float  0.707106769084930419921875
-cos1pi8:    @ cos(1*pi/8) = sqrt(2+sqrt(2))/2
-        .float  0.92387950420379638671875
-cos3pi8:    @ cos(2*pi/8) = sqrt(2-sqrt(2))/2
-        .float  0.3826834261417388916015625
-
-function ff_fft16_vfp, export=1
-        ldr     a3, =0x03030000     @ RunFast mode, vector length 4, stride 1
-        fmrx    a2, FPSCR
-        fmxr    FPSCR, a3
-        vpush   {s16-s31}
-
-        macro_fft8_head
-        @ FFT4(z+8)
-        vldr    d10, [a1, #8 * 2*4]
-        vldr    d12, [a1, #9 * 2*4]
-        vldr    d11, [a1, #10 * 2*4]
-        vldr    d13, [a1, #11 * 2*4]
-        macro_fft8_tail
-        vadd.f  s16, s20, s24   @ vector op
-            @ FFT4(z+12)
-            vldr    d4, [a1, #12 * 2*4]
-            vldr    d6, [a1, #13 * 2*4]
-            vldr    d5, [a1, #14 * 2*4]
-        vsub.f  s20, s20, s24   @ vector op
-            vldr    d7, [a1, #15 * 2*4]
-        vadd.f  s0, s16, s18
-        vsub.f  s4, s16, s18
-        vadd.f  s1, s17, s19
-        vsub.f  s5, s17, s19
-        vadd.f  s7, s21, s22
-        vsub.f  s3, s21, s22
-        vadd.f  s2, s20, s23
-        vsub.f  s6, s20, s23
-            vadd.f  s16, s8, s12    @ vector op
-        vstr    d0, [a1, #8 * 2*4]
-        vstr    d2, [a1, #10 * 2*4]
-        vstr    d1, [a1, #9 * 2*4]
-            vsub.f  s20, s8, s12
-        vstr    d3, [a1, #11 * 2*4]
-        @ TRANSFORM(z[2],z[6],z[10],z[14],cos1pi4,cos1pi4)
-        vldr    d12, [a1, #10 * 2*4]
-            vadd.f  s0, s16, s18
-            vadd.f  s1, s17, s19
-            vsub.f  s6, s16, s18
-            vsub.f  s7, s17, s19
-            vsub.f  s3, s21, s22
-            vadd.f  s2, s20, s23
-            vadd.f  s5, s21, s22
-            vsub.f  s4, s20, s23
-            vstr    d0, [a1, #12 * 2*4]
-        vmov    s0, s6
-          @ TRANSFORM(z[1],z[5],z[9],z[13],cos1pi8,cos3pi8)
-          vldr    d6, [a1, #9 * 2*4]
-            vstr    d1, [a1, #13 * 2*4]
-        vldr    d1, cos1pi4 @ s2 = cos1pi4, s3 = cos1pi8
-            vstr    d2, [a1, #15 * 2*4]
-          vldr    d7, [a1, #13 * 2*4]
-        vadd.f  s4, s25, s24
-        vsub.f  s5, s25, s24
-        vsub.f  s6, s0, s7
-        vadd.f  s7, s0, s7
-          vmul.f  s20, s12, s3  @ vector op
-            @ TRANSFORM(z[3],z[7],z[11],z[15],cos3pi8,cos1pi8)
-            vldr    d4, [a1, #11 * 2*4]
-            vldr    d5, [a1, #15 * 2*4]
-            vldr    s1, cos3pi8
-        vmul.f  s24, s4, s2     @ vector * scalar op
-          vmul.f  s28, s12, s1  @ vector * scalar op
-            vmul.f  s12, s8, s1 @ vector * scalar op
-          vadd.f  s4, s20, s29
-          vsub.f  s5, s21, s28
-          vsub.f  s6, s22, s31
-          vadd.f  s7, s23, s30
-            vmul.f  s8, s8, s3  @ vector * scalar op
-          vldr    d8, [a1, #1 * 2*4]
-          vldr    d9, [a1, #5 * 2*4]
-            vldr    d10, [a1, #3 * 2*4]
-            vldr    d11, [a1, #7 * 2*4]
-        vldr    d14, [a1, #2 * 2*4]
-          vadd.f  s0, s6, s4
-          vadd.f  s1, s5, s7
-          vsub.f  s2, s5, s7
-          vsub.f  s3, s6, s4
-            vadd.f  s4, s12, s9
-            vsub.f  s5, s13, s8
-            vsub.f  s6, s14, s11
-            vadd.f  s7, s15, s10
-          vadd.f  s12, s0, s16  @ vector op
-          vstr    d0, [a1, #1 * 2*4]
-          vstr    d1, [a1, #5 * 2*4]
-          vldr    d4, [a1, #1 * 2*4]
-          vldr    d5, [a1, #5 * 2*4]
-            vadd.f  s0, s6, s4
-            vadd.f  s1, s5, s7
-            vsub.f  s2, s5, s7
-            vsub.f  s3, s6, s4
-          vsub.f  s8, s16, s8   @ vector op
-          vstr    d6, [a1, #1 * 2*4]
-          vstr    d7, [a1, #5 * 2*4]
-        vldr    d15, [a1, #6 * 2*4]
-            vsub.f  s4, s20, s0
-            vsub.f  s5, s21, s1
-            vsub.f  s6, s22, s2
-            vsub.f  s7, s23, s3
-            vadd.f  s20, s0, s20    @ vector op
-          vstr    d4, [a1, #9 * 2*4]
-              @ TRANSFORM_ZERO(z[0],z[4],z[8],z[12])
-              vldr    d6, [a1, #8 * 2*4]
-          vstr    d5, [a1, #13 * 2*4]
-              vldr    d7, [a1, #12 * 2*4]
-          vstr    d2, [a1, #11 * 2*4]
-              vldr    d8, [a1, #0 * 2*4]
-          vstr    d3, [a1, #15 * 2*4]
-              vldr    d9, [a1, #4 * 2*4]
-        vadd.f  s0, s26, s24
-        vadd.f  s1, s25, s27
-        vsub.f  s2, s25, s27
-        vsub.f  s3, s26, s24
-              vadd.f  s4, s14, s12
-              vadd.f  s5, s13, s15
-              vsub.f  s6, s13, s15
-              vsub.f  s7, s14, s12
-        vadd.f  s8, s0, s28 @ vector op
-        vstr    d0, [a1, #3 * 2*4]
-        vstr    d1, [a1, #7 * 2*4]
-        vldr    d6, [a1, #3 * 2*4]
-        vldr    d7, [a1, #7 * 2*4]
-              vsub.f  s0, s16, s4
-              vsub.f  s1, s17, s5
-              vsub.f  s2, s18, s6
-              vsub.f  s3, s19, s7
-        vsub.f  s12, s28, s12       @ vector op
-              vadd.f  s16, s4, s16  @ vector op
-            vstr    d10, [a1, #3 * 2*4]
-            vstr    d11, [a1, #7 * 2*4]
-        vstr    d4, [a1, #2 * 2*4]
-        vstr    d5, [a1, #6 * 2*4]
-              vstr    d0, [a1, #8 * 2*4]
-              vstr    d1, [a1, #12 * 2*4]
-        vstr    d6, [a1, #10 * 2*4]
-        vstr    d7, [a1, #14 * 2*4]
-              vstr    d8, [a1, #0 * 2*4]
-              vstr    d9, [a1, #4 * 2*4]
-
-        vpop    {s16-s31}
-        fmxr    FPSCR, a2
-        bx      lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/flacdsp_arm.S b/deps/libav/libavcodec/arm/flacdsp_arm.S
deleted file mode 100644
index d4441da..0000000
--- a/deps/libav/libavcodec/arm/flacdsp_arm.S
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function flac_lpc_16_1_arm
-        ldr             r12, [sp]
-        push            {r4, lr}
-        ldr             r1,  [r1]
-        subs            r12, r12, #2
-        ldr             lr,  [r0], #4
-        beq             2f
-        it              lt
-        poplt           {r4, pc}
-1:
-        mul             r4,  lr,  r1
-        ldm             r0,  {r2, lr}
-        add_sh          r2,  r2,  r4,  asr r3
-        mul             r4,  r2,  r1
-        subs            r12, r12, #2
-        add_sh          lr,  lr,  r4,  asr r3
-        stm             r0!, {r2, lr}
-        bgt             1b
-        it              lt
-        poplt           {r4, pc}
-2:
-        mul             r4,  lr,  r1
-        ldr             r2,  [r0]
-        add_sh          r2,  r2,  r4,  asr r3
-        str             r2,  [r0]
-        pop             {r4, pc}
-endfunc
-
-function flac_lpc_16_2_arm
-        ldr             r12, [sp]
-        subs            r12, r12, r2
-        it              le
-        bxle            lr
-
-        push            {r4-r9, lr}
-        ldm             r0!, {r6, r7}
-        ldm             r1,  {r8, r9}
-        subs            r12, r12, #1
-        beq             2f
-1:
-        mul             r4,  r6,  r8
-        mul             r5,  r7,  r8
-        mla             r4,  r7,  r9,  r4
-        ldm             r0,  {r6, r7}
-        add_sh          r6,  r6,  r4,  asr r3
-        mla             r5,  r6,  r9,  r5
-        add_sh          r7,  r7,  r5,  asr r3
-        stm             r0!, {r6, r7}
-        subs            r12, r12, #2
-        bgt             1b
-        it              lt
-        poplt           {r4-r9, pc}
-2:
-        mul             r4,  r6,  r8
-        mla             r4,  r7,  r9,  r4
-        ldr             r5,  [r0]
-        add_sh          r5,  r5,  r4,  asr r3
-        str             r5,  [r0]
-        pop             {r4-r9, pc}
-endfunc
-
-function ff_flac_lpc_16_arm, export=1
-        cmp             r2,  #2
-        blt             flac_lpc_16_1_arm
-        beq             flac_lpc_16_2_arm
-
-        ldr             r12, [sp]
-        subs            r12, r12, r2
-        it              le
-        bxle            lr
-
-        push            {r4-r9, lr}
-
-        subs            r12, r12, #1
-        beq             3f
-1:
-        sub             lr,  r2,  #2
-        mov             r4,  #0
-        mov             r5,  #0
-
-        ldr             r7,  [r0], #4
-        ldr             r9,  [r1], #4
-2:
-        mla             r4,  r7,  r9,  r4
-        ldm             r0!, {r6, r7}
-        mla             r5,  r6,  r9,  r5
-        ldm             r1!, {r8, r9}
-        mla             r4,  r6,  r8,  r4
-        subs            lr,  lr,  #2
-        mla             r5,  r7,  r8,  r5
-        bgt             2b
-        blt             6f
-
-        mla             r4,  r7,  r9,  r4
-        ldr             r7,  [r0], #4
-        mla             r5,  r7,  r9,  r5
-        ldr             r9,  [r1], #4
-6:
-        mla             r4,  r7,  r9,  r4
-        ldm             r0,  {r6, r7}
-        add_sh          r6,  r6,  r4,  asr r3
-        mla             r5,  r6,  r9,  r5
-        add_sh          r7,  r7,  r5,  asr r3
-        stm             r0!, {r6, r7}
-        sub             r0,  r0,  r2,  lsl #2
-        sub             r1,  r1,  r2,  lsl #2
-
-        subs            r12, r12, #2
-        bgt             1b
-        it              lt
-        poplt           {r4-r9, pc}
-3:
-        mov             r4,  #0
-4:
-        ldr             r5,  [r1], #4
-        ldr             r6,  [r0], #4
-        mla             r4,  r5,  r6,  r4
-        subs            r2,  r2,  #1
-        bgt             4b
-        ldr             r5,  [r0]
-        add_sh          r5,  r5,  r4,  asr r3
-        str             r5,  [r0]
-        pop             {r4-r9, pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/flacdsp_init_arm.c b/deps/libav/libavcodec/arm/flacdsp_init_arm.c
deleted file mode 100644
index 0530cf7..0000000
--- a/deps/libav/libavcodec/arm/flacdsp_init_arm.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/flacdsp.h"
-#include "config.h"
-
-void ff_flac_lpc_16_arm(int32_t *samples, const int coeffs[32], int order,
-                        int qlevel, int len);
-
-av_cold void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt,
-                                 int bps)
-{
-    if (bps <= 16)
-        c->lpc = ff_flac_lpc_16_arm;
-}
diff --git a/deps/libav/libavcodec/arm/fmtconvert_init_arm.c b/deps/libav/libavcodec/arm/fmtconvert_init_arm.c
deleted file mode 100644
index 7c5bd91..0000000
--- a/deps/libav/libavcodec/arm/fmtconvert_init_arm.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * ARM optimized Format Conversion Utils
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/fmtconvert.h"
-
-void ff_int32_to_float_fmul_scalar_neon(float *dst, const int32_t *src,
-                                        float mul, int len);
-
-void ff_int32_to_float_fmul_scalar_vfp(float *dst, const int32_t *src,
-                                       float mul, int len);
-void ff_int32_to_float_fmul_array8_vfp(FmtConvertContext *c, float *dst,
-                                       const int32_t *src, const float *mul,
-                                       int len);
-
-void ff_float_to_int16_neon(int16_t *dst, const float *src, long len);
-void ff_float_to_int16_interleave_neon(int16_t *, const float **, long, int);
-
-void ff_float_to_int16_vfp(int16_t *dst, const float *src, long len);
-
-av_cold void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_vfp(cpu_flags)) {
-        if (!have_vfpv3(cpu_flags)) {
-            c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_vfp;
-            c->int32_to_float_fmul_array8 = ff_int32_to_float_fmul_array8_vfp;
-        }
-
-        if (have_armv6(cpu_flags)) {
-            c->float_to_int16 = ff_float_to_int16_vfp;
-        }
-    }
-
-    if (have_neon(cpu_flags)) {
-        c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_neon;
-
-        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
-            c->float_to_int16            = ff_float_to_int16_neon;
-            c->float_to_int16_interleave = ff_float_to_int16_interleave_neon;
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/arm/fmtconvert_neon.S b/deps/libav/libavcodec/arm/fmtconvert_neon.S
deleted file mode 100644
index e11e82c..0000000
--- a/deps/libav/libavcodec/arm/fmtconvert_neon.S
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * ARM NEON optimised Format Conversion Utils
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/arm/asm.S"
-
-function ff_float_to_int16_neon, export=1
-        subs            r2,  r2,  #8
-        vld1.64         {d0-d1},  [r1,:128]!
-        vcvt.s32.f32    q8,  q0,  #16
-        vld1.64         {d2-d3},  [r1,:128]!
-        vcvt.s32.f32    q9,  q1,  #16
-        beq             3f
-        bics            ip,  r2,  #15
-        beq             2f
-1:      subs            ip,  ip,  #16
-        vshrn.s32       d4,  q8,  #16
-        vld1.64         {d0-d1},  [r1,:128]!
-        vcvt.s32.f32    q0,  q0,  #16
-        vshrn.s32       d5,  q9,  #16
-        vld1.64         {d2-d3},  [r1,:128]!
-        vcvt.s32.f32    q1,  q1,  #16
-        vshrn.s32       d6,  q0,  #16
-        vst1.64         {d4-d5},  [r0,:128]!
-        vshrn.s32       d7,  q1,  #16
-        vld1.64         {d16-d17},[r1,:128]!
-        vcvt.s32.f32    q8,  q8,  #16
-        vld1.64         {d18-d19},[r1,:128]!
-        vcvt.s32.f32    q9,  q9,  #16
-        vst1.64         {d6-d7},  [r0,:128]!
-        bne             1b
-        ands            r2,  r2,  #15
-        beq             3f
-2:      vld1.64         {d0-d1},  [r1,:128]!
-        vshrn.s32       d4,  q8,  #16
-        vcvt.s32.f32    q0,  q0,  #16
-        vld1.64         {d2-d3},  [r1,:128]!
-        vshrn.s32       d5,  q9,  #16
-        vcvt.s32.f32    q1,  q1,  #16
-        vshrn.s32       d6,  q0,  #16
-        vst1.64         {d4-d5},  [r0,:128]!
-        vshrn.s32       d7,  q1,  #16
-        vst1.64         {d6-d7},  [r0,:128]!
-        bx              lr
-3:      vshrn.s32       d4,  q8,  #16
-        vshrn.s32       d5,  q9,  #16
-        vst1.64         {d4-d5},  [r0,:128]!
-        bx              lr
-endfunc
-
-function ff_float_to_int16_interleave_neon, export=1
-        cmp             r3, #2
-        itt             lt
-        ldrlt           r1, [r1]
-        blt             X(ff_float_to_int16_neon)
-        bne             4f
-
-        ldr             r3, [r1]
-        ldr             r1, [r1, #4]
-
-        subs            r2,  r2,  #8
-        vld1.64         {d0-d1},  [r3,:128]!
-        vcvt.s32.f32    q8,  q0,  #16
-        vld1.64         {d2-d3},  [r3,:128]!
-        vcvt.s32.f32    q9,  q1,  #16
-        vld1.64         {d20-d21},[r1,:128]!
-        vcvt.s32.f32    q10, q10, #16
-        vld1.64         {d22-d23},[r1,:128]!
-        vcvt.s32.f32    q11, q11, #16
-        beq             3f
-        bics            ip,  r2,  #15
-        beq             2f
-1:      subs            ip,  ip,  #16
-        vld1.64         {d0-d1},  [r3,:128]!
-        vcvt.s32.f32    q0,  q0,  #16
-        vsri.32         q10, q8,  #16
-        vld1.64         {d2-d3},  [r3,:128]!
-        vcvt.s32.f32    q1,  q1,  #16
-        vld1.64         {d24-d25},[r1,:128]!
-        vcvt.s32.f32    q12, q12, #16
-        vld1.64         {d26-d27},[r1,:128]!
-        vsri.32         q11, q9,  #16
-        vst1.64         {d20-d21},[r0,:128]!
-        vcvt.s32.f32    q13, q13, #16
-        vst1.64         {d22-d23},[r0,:128]!
-        vsri.32         q12, q0,  #16
-        vld1.64         {d16-d17},[r3,:128]!
-        vsri.32         q13, q1,  #16
-        vst1.64         {d24-d25},[r0,:128]!
-        vcvt.s32.f32    q8,  q8,  #16
-        vld1.64         {d18-d19},[r3,:128]!
-        vcvt.s32.f32    q9,  q9,  #16
-        vld1.64         {d20-d21},[r1,:128]!
-        vcvt.s32.f32    q10, q10, #16
-        vld1.64         {d22-d23},[r1,:128]!
-        vcvt.s32.f32    q11, q11, #16
-        vst1.64         {d26-d27},[r0,:128]!
-        bne             1b
-        ands            r2,  r2,  #15
-        beq             3f
-2:      vsri.32         q10, q8,  #16
-        vld1.64         {d0-d1},  [r3,:128]!
-        vcvt.s32.f32    q0,  q0,  #16
-        vld1.64         {d2-d3},  [r3,:128]!
-        vcvt.s32.f32    q1,  q1,  #16
-        vld1.64         {d24-d25},[r1,:128]!
-        vcvt.s32.f32    q12, q12, #16
-        vsri.32         q11, q9,  #16
-        vld1.64         {d26-d27},[r1,:128]!
-        vcvt.s32.f32    q13, q13, #16
-        vst1.64         {d20-d21},[r0,:128]!
-        vsri.32         q12, q0,  #16
-        vst1.64         {d22-d23},[r0,:128]!
-        vsri.32         q13, q1,  #16
-        vst1.64         {d24-d27},[r0,:128]!
-        bx              lr
-3:      vsri.32         q10, q8,  #16
-        vsri.32         q11, q9,  #16
-        vst1.64         {d20-d23},[r0,:128]!
-        bx              lr
-
-4:      push            {r4-r8,lr}
-        cmp             r3,  #4
-        lsl             ip,  r3,  #1
-        blt             4f
-
-        @ 4 channels
-5:      ldmia           r1!, {r4-r7}
-        mov             lr,  r2
-        mov             r8,  r0
-        vld1.64         {d16-d17},[r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #16
-        vld1.64         {d18-d19},[r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #16
-        vld1.64         {d20-d21},[r6,:128]!
-        vcvt.s32.f32    q10, q10, #16
-        vld1.64         {d22-d23},[r7,:128]!
-        vcvt.s32.f32    q11, q11, #16
-6:      subs            lr,  lr,  #8
-        vld1.64         {d0-d1},  [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #16
-        vsri.32         q9,  q8,  #16
-        vld1.64         {d2-d3},  [r5,:128]!
-        vcvt.s32.f32    q1,  q1,  #16
-        vsri.32         q11, q10, #16
-        vld1.64         {d4-d5},  [r6,:128]!
-        vcvt.s32.f32    q2,  q2,  #16
-        vzip.32         d18, d22
-        vld1.64         {d6-d7},  [r7,:128]!
-        vcvt.s32.f32    q3,  q3,  #16
-        vzip.32         d19, d23
-        vst1.64         {d18},    [r8], ip
-        vsri.32         q1,  q0,  #16
-        vst1.64         {d22},    [r8], ip
-        vsri.32         q3,  q2,  #16
-        vst1.64         {d19},    [r8], ip
-        vzip.32         d2,  d6
-        vst1.64         {d23},    [r8], ip
-        vzip.32         d3,  d7
-        beq             7f
-        vld1.64         {d16-d17},[r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #16
-        vst1.64         {d2},     [r8], ip
-        vld1.64         {d18-d19},[r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #16
-        vst1.64         {d6},     [r8], ip
-        vld1.64         {d20-d21},[r6,:128]!
-        vcvt.s32.f32    q10, q10, #16
-        vst1.64         {d3},     [r8], ip
-        vld1.64         {d22-d23},[r7,:128]!
-        vcvt.s32.f32    q11, q11, #16
-        vst1.64         {d7},     [r8], ip
-        b               6b
-7:      vst1.64         {d2},     [r8], ip
-        vst1.64         {d6},     [r8], ip
-        vst1.64         {d3},     [r8], ip
-        vst1.64         {d7},     [r8], ip
-        subs            r3,  r3,  #4
-        it              eq
-        popeq           {r4-r8,pc}
-        cmp             r3,  #4
-        add             r0,  r0,  #8
-        bge             5b
-
-        @ 2 channels
-4:      cmp             r3,  #2
-        blt             4f
-        ldmia           r1!, {r4-r5}
-        mov             lr,  r2
-        mov             r8,  r0
-        tst             lr,  #8
-        vld1.64         {d16-d17},[r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #16
-        vld1.64         {d18-d19},[r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #16
-        vld1.64         {d20-d21},[r4,:128]!
-        vcvt.s32.f32    q10, q10, #16
-        vld1.64         {d22-d23},[r5,:128]!
-        vcvt.s32.f32    q11, q11, #16
-        beq             6f
-        subs            lr,  lr,  #8
-        beq             7f
-        vsri.32         d18, d16, #16
-        vsri.32         d19, d17, #16
-        vld1.64         {d16-d17},[r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #16
-        vst1.32         {d18[0]}, [r8], ip
-        vsri.32         d22, d20, #16
-        vst1.32         {d18[1]}, [r8], ip
-        vsri.32         d23, d21, #16
-        vst1.32         {d19[0]}, [r8], ip
-        vst1.32         {d19[1]}, [r8], ip
-        vld1.64         {d18-d19},[r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #16
-        vst1.32         {d22[0]}, [r8], ip
-        vst1.32         {d22[1]}, [r8], ip
-        vld1.64         {d20-d21},[r4,:128]!
-        vcvt.s32.f32    q10, q10, #16
-        vst1.32         {d23[0]}, [r8], ip
-        vst1.32         {d23[1]}, [r8], ip
-        vld1.64         {d22-d23},[r5,:128]!
-        vcvt.s32.f32    q11, q11, #16
-6:      subs            lr,  lr,  #16
-        vld1.64         {d0-d1},  [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #16
-        vsri.32         d18, d16, #16
-        vld1.64         {d2-d3},  [r5,:128]!
-        vcvt.s32.f32    q1,  q1,  #16
-        vsri.32         d19, d17, #16
-        vld1.64         {d4-d5},  [r4,:128]!
-        vcvt.s32.f32    q2,  q2,  #16
-        vld1.64         {d6-d7},  [r5,:128]!
-        vcvt.s32.f32    q3,  q3,  #16
-        vst1.32         {d18[0]}, [r8], ip
-        vsri.32         d22, d20, #16
-        vst1.32         {d18[1]}, [r8], ip
-        vsri.32         d23, d21, #16
-        vst1.32         {d19[0]}, [r8], ip
-        vsri.32         d2,  d0,  #16
-        vst1.32         {d19[1]}, [r8], ip
-        vsri.32         d3,  d1,  #16
-        vst1.32         {d22[0]}, [r8], ip
-        vsri.32         d6,  d4,  #16
-        vst1.32         {d22[1]}, [r8], ip
-        vsri.32         d7,  d5,  #16
-        vst1.32         {d23[0]}, [r8], ip
-        vst1.32         {d23[1]}, [r8], ip
-        beq             6f
-        vld1.64         {d16-d17},[r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #16
-        vst1.32         {d2[0]},  [r8], ip
-        vst1.32         {d2[1]},  [r8], ip
-        vld1.64         {d18-d19},[r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #16
-        vst1.32         {d3[0]},  [r8], ip
-        vst1.32         {d3[1]},  [r8], ip
-        vld1.64         {d20-d21},[r4,:128]!
-        vcvt.s32.f32    q10, q10, #16
-        vst1.32         {d6[0]},  [r8], ip
-        vst1.32         {d6[1]},  [r8], ip
-        vld1.64         {d22-d23},[r5,:128]!
-        vcvt.s32.f32    q11, q11, #16
-        vst1.32         {d7[0]},  [r8], ip
-        vst1.32         {d7[1]},  [r8], ip
-        bgt             6b
-6:      vst1.32         {d2[0]},  [r8], ip
-        vst1.32         {d2[1]},  [r8], ip
-        vst1.32         {d3[0]},  [r8], ip
-        vst1.32         {d3[1]},  [r8], ip
-        vst1.32         {d6[0]},  [r8], ip
-        vst1.32         {d6[1]},  [r8], ip
-        vst1.32         {d7[0]},  [r8], ip
-        vst1.32         {d7[1]},  [r8], ip
-        b               8f
-7:      vsri.32         d18, d16, #16
-        vsri.32         d19, d17, #16
-        vst1.32         {d18[0]}, [r8], ip
-        vsri.32         d22, d20, #16
-        vst1.32         {d18[1]}, [r8], ip
-        vsri.32         d23, d21, #16
-        vst1.32         {d19[0]}, [r8], ip
-        vst1.32         {d19[1]}, [r8], ip
-        vst1.32         {d22[0]}, [r8], ip
-        vst1.32         {d22[1]}, [r8], ip
-        vst1.32         {d23[0]}, [r8], ip
-        vst1.32         {d23[1]}, [r8], ip
-8:      subs            r3,  r3,  #2
-        add             r0,  r0,  #4
-        it              eq
-        popeq           {r4-r8,pc}
-
-        @ 1 channel
-4:      ldr             r4,  [r1],#4
-        tst             r2,  #8
-        mov             lr,  r2
-        mov             r5,  r0
-        vld1.64         {d0-d1},  [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #16
-        vld1.64         {d2-d3},  [r4,:128]!
-        vcvt.s32.f32    q1,  q1,  #16
-        bne             8f
-6:      subs            lr,  lr,  #16
-        vld1.64         {d4-d5},  [r4,:128]!
-        vcvt.s32.f32    q2,  q2,  #16
-        vld1.64         {d6-d7},  [r4,:128]!
-        vcvt.s32.f32    q3,  q3,  #16
-        vst1.16         {d0[1]},  [r5,:16], ip
-        vst1.16         {d0[3]},  [r5,:16], ip
-        vst1.16         {d1[1]},  [r5,:16], ip
-        vst1.16         {d1[3]},  [r5,:16], ip
-        vst1.16         {d2[1]},  [r5,:16], ip
-        vst1.16         {d2[3]},  [r5,:16], ip
-        vst1.16         {d3[1]},  [r5,:16], ip
-        vst1.16         {d3[3]},  [r5,:16], ip
-        beq             7f
-        vld1.64         {d0-d1},  [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #16
-        vld1.64         {d2-d3},  [r4,:128]!
-        vcvt.s32.f32    q1,  q1,  #16
-7:      vst1.16         {d4[1]},  [r5,:16], ip
-        vst1.16         {d4[3]},  [r5,:16], ip
-        vst1.16         {d5[1]},  [r5,:16], ip
-        vst1.16         {d5[3]},  [r5,:16], ip
-        vst1.16         {d6[1]},  [r5,:16], ip
-        vst1.16         {d6[3]},  [r5,:16], ip
-        vst1.16         {d7[1]},  [r5,:16], ip
-        vst1.16         {d7[3]},  [r5,:16], ip
-        bgt             6b
-        pop             {r4-r8,pc}
-8:      subs            lr,  lr,  #8
-        vst1.16         {d0[1]},  [r5,:16], ip
-        vst1.16         {d0[3]},  [r5,:16], ip
-        vst1.16         {d1[1]},  [r5,:16], ip
-        vst1.16         {d1[3]},  [r5,:16], ip
-        vst1.16         {d2[1]},  [r5,:16], ip
-        vst1.16         {d2[3]},  [r5,:16], ip
-        vst1.16         {d3[1]},  [r5,:16], ip
-        vst1.16         {d3[3]},  [r5,:16], ip
-        it              eq
-        popeq           {r4-r8,pc}
-        vld1.64         {d0-d1},  [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #16
-        vld1.64         {d2-d3},  [r4,:128]!
-        vcvt.s32.f32    q1,  q1,  #16
-        b               6b
-endfunc
-
-function ff_int32_to_float_fmul_scalar_neon, export=1
-VFP     vdup.32         q0,  d0[0]
-VFP     len     .req    r2
-NOVFP   vdup.32         q0,  r2
-NOVFP   len     .req    r3
-
-        vld1.32         {q1},[r1,:128]!
-        vcvt.f32.s32    q3,  q1
-        vld1.32         {q2},[r1,:128]!
-        vcvt.f32.s32    q8,  q2
-1:      subs            len, len, #8
-        pld             [r1, #16]
-        vmul.f32        q9,  q3,  q0
-        vmul.f32        q10, q8,  q0
-        beq             2f
-        vld1.32         {q1},[r1,:128]!
-        vcvt.f32.s32    q3,  q1
-        vld1.32         {q2},[r1,:128]!
-        vcvt.f32.s32    q8,  q2
-        vst1.32         {q9}, [r0,:128]!
-        vst1.32         {q10},[r0,:128]!
-        b               1b
-2:      vst1.32         {q9}, [r0,:128]!
-        vst1.32         {q10},[r0,:128]!
-        bx              lr
-        .unreq  len
-endfunc
diff --git a/deps/libav/libavcodec/arm/fmtconvert_vfp.S b/deps/libav/libavcodec/arm/fmtconvert_vfp.S
deleted file mode 100644
index 4e43f42..0000000
--- a/deps/libav/libavcodec/arm/fmtconvert_vfp.S
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 2013 RISC OS Open Ltd <bavison at riscosopen.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/arm/asm.S"
-
-/**
- * ARM VFP optimised int32 to float conversion.
- * Assume len is a multiple of 8, destination buffer is at least 4 bytes aligned
- * (16 bytes alignment is best for BCM2835), little-endian.
- */
-@ void ff_int32_to_float_fmul_array8_vfp(FmtConvertContext *c, float *dst, const int32_t *src, const float *mul, int len)
-function ff_int32_to_float_fmul_array8_vfp, export=1
-        push    {lr}
-        ldr     a1, [sp, #4]
-        subs    lr, a1, #3*8
-        bcc     50f                        @ too short to pipeline
-        @ Now need to find (len / 8) % 3. The approximation
-        @ x / 24 = (x * 0xAB) >> 12
-        @ is good for x < 4096, which is true for both AC3 and DCA.
-        mov     a1, #0xAB
-        ldr     ip, =0x03070000            @ RunFast mode, short vectors of length 8, stride 1
-        mul     a1, lr, a1
-        vpush   {s16-s31}
-        mov     a1, a1, lsr #12
-        add     a1, a1, a1, lsl #1
-        rsb     a1, a1, lr, lsr #3
-        cmp     a1, #1
-        fmrx    a1, FPSCR
-        fmxr    FPSCR, ip
-        beq     11f
-        blo     10f
-        @ Array is (2 + multiple of 3) x 8 floats long
-        @ drop through...
-        vldmia          a3!, {s16-s23}
-        vldmia          a4!, {s2,s3}
-        vldmia          a3!, {s24-s31}
-        vcvt.f32.s32    s16, s16
-        vcvt.f32.s32    s17, s17
-        vcvt.f32.s32    s18, s18
-        vcvt.f32.s32    s19, s19
-        vcvt.f32.s32    s20, s20
-        vcvt.f32.s32    s21, s21
-        vcvt.f32.s32    s22, s22
-        vcvt.f32.s32    s23, s23
-        vmul.f32        s16, s16, s2
-        @ drop through...
-3:
-        vldmia          a3!, {s8-s15}
-        vldmia          a4!, {s1}
-        vcvt.f32.s32    s24, s24
-        vcvt.f32.s32    s25, s25
-        vcvt.f32.s32    s26, s26
-        vcvt.f32.s32    s27, s27
-        vcvt.f32.s32    s28, s28
-        vcvt.f32.s32    s29, s29
-        vcvt.f32.s32    s30, s30
-        vcvt.f32.s32    s31, s31
-        vmul.f32        s24, s24, s3
-        vstmia          a2!, {s16-s19}
-        vstmia          a2!, {s20-s23}
-2:
-        vldmia          a3!, {s16-s23}
-        vldmia          a4!, {s2}
-        vcvt.f32.s32    s8, s8
-        vcvt.f32.s32    s9, s9
-        vcvt.f32.s32    s10, s10
-        vcvt.f32.s32    s11, s11
-        vcvt.f32.s32    s12, s12
-        vcvt.f32.s32    s13, s13
-        vcvt.f32.s32    s14, s14
-        vcvt.f32.s32    s15, s15
-        vmul.f32        s8, s8, s1
-        vstmia          a2!, {s24-s27}
-        vstmia          a2!, {s28-s31}
-1:
-        vldmia          a3!, {s24-s31}
-        vldmia          a4!, {s3}
-        vcvt.f32.s32    s16, s16
-        vcvt.f32.s32    s17, s17
-        vcvt.f32.s32    s18, s18
-        vcvt.f32.s32    s19, s19
-        vcvt.f32.s32    s20, s20
-        vcvt.f32.s32    s21, s21
-        vcvt.f32.s32    s22, s22
-        vcvt.f32.s32    s23, s23
-        vmul.f32        s16, s16, s2
-        vstmia          a2!, {s8-s11}
-        vstmia          a2!, {s12-s15}
-
-        subs            lr, lr, #8*3
-        bpl             3b
-
-        vcvt.f32.s32    s24, s24
-        vcvt.f32.s32    s25, s25
-        vcvt.f32.s32    s26, s26
-        vcvt.f32.s32    s27, s27
-        vcvt.f32.s32    s28, s28
-        vcvt.f32.s32    s29, s29
-        vcvt.f32.s32    s30, s30
-        vcvt.f32.s32    s31, s31
-        vmul.f32        s24, s24, s3
-        vstmia          a2!, {s16-s19}
-        vstmia          a2!, {s20-s23}
-        vstmia          a2!, {s24-s27}
-        vstmia          a2!, {s28-s31}
-
-        fmxr    FPSCR, a1
-        vpop    {s16-s31}
-        pop     {pc}
-
-10:     @ Array is (multiple of 3) x 8 floats long
-        vldmia          a3!, {s8-s15}
-        vldmia          a4!, {s1,s2}
-        vldmia          a3!, {s16-s23}
-        vcvt.f32.s32    s8, s8
-        vcvt.f32.s32    s9, s9
-        vcvt.f32.s32    s10, s10
-        vcvt.f32.s32    s11, s11
-        vcvt.f32.s32    s12, s12
-        vcvt.f32.s32    s13, s13
-        vcvt.f32.s32    s14, s14
-        vcvt.f32.s32    s15, s15
-        vmul.f32        s8, s8, s1
-        b               1b
-
-11:     @ Array is (1 + multiple of 3) x 8 floats long
-        vldmia          a3!, {s24-s31}
-        vldmia          a4!, {s3}
-        vldmia          a3!, {s8-s15}
-        vldmia          a4!, {s1}
-        vcvt.f32.s32    s24, s24
-        vcvt.f32.s32    s25, s25
-        vcvt.f32.s32    s26, s26
-        vcvt.f32.s32    s27, s27
-        vcvt.f32.s32    s28, s28
-        vcvt.f32.s32    s29, s29
-        vcvt.f32.s32    s30, s30
-        vcvt.f32.s32    s31, s31
-        vmul.f32        s24, s24, s3
-        b               2b
-
-50:
-        ldr     lr, =0x03070000         @ RunFast mode, short vectors of length 8, stride 1
-        fmrx    ip, FPSCR
-        fmxr    FPSCR, lr
-51:
-        vldmia          a3!, {s8-s15}
-        vldmia          a4!, {s0}
-        vcvt.f32.s32    s8, s8
-        vcvt.f32.s32    s9, s9
-        vcvt.f32.s32    s10, s10
-        vcvt.f32.s32    s11, s11
-        vcvt.f32.s32    s12, s12
-        vcvt.f32.s32    s13, s13
-        vcvt.f32.s32    s14, s14
-        vcvt.f32.s32    s15, s15
-        vmul.f32        s8, s8, s0
-        subs            a1, a1, #8
-        vstmia          a2!, {s8-s11}
-        vstmia          a2!, {s12-s15}
-        bne             51b
-
-        fmxr    FPSCR, ip
-        pop     {pc}
-endfunc
-
-/**
- * ARM VFP optimised int32 to float conversion.
- * Assume len is a multiple of 8, destination buffer is at least 4 bytes aligned
- * (16 bytes alignment is best for BCM2835), little-endian.
- * TODO: could be further optimised by unrolling and interleaving, as above
- */
-@ void ff_int32_to_float_fmul_scalar_vfp(float *dst, const int32_t *src, float mul, int len)
-function ff_int32_to_float_fmul_scalar_vfp, export=1
-VFP     tmp     .req    a4
-VFP     len     .req    a3
-NOVFP   tmp     .req    a3
-NOVFP   len     .req    a4
-NOVFP   vmov    s0, a3
-        ldr     tmp, =0x03070000           @ RunFast mode, short vectors of length 8, stride 1
-        fmrx    ip, FPSCR
-        fmxr    FPSCR, tmp
-1:
-        vldmia          a2!, {s8-s15}
-        vcvt.f32.s32    s8, s8
-        vcvt.f32.s32    s9, s9
-        vcvt.f32.s32    s10, s10
-        vcvt.f32.s32    s11, s11
-        vcvt.f32.s32    s12, s12
-        vcvt.f32.s32    s13, s13
-        vcvt.f32.s32    s14, s14
-        vcvt.f32.s32    s15, s15
-        vmul.f32        s8, s8, s0
-        subs            len, len, #8
-        vstmia          a1!, {s8-s11}
-        vstmia          a1!, {s12-s15}
-        bne             1b
-
-        fmxr    FPSCR, ip
-        bx      lr
-endfunc
-        .unreq  tmp
-        .unreq  len
diff --git a/deps/libav/libavcodec/arm/fmtconvert_vfp_armv6.S b/deps/libav/libavcodec/arm/fmtconvert_vfp_armv6.S
deleted file mode 100644
index fb12de1..0000000
--- a/deps/libav/libavcodec/arm/fmtconvert_vfp_armv6.S
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2008 Siarhei Siamashka <ssvb at users.sourceforge.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/arm/asm.S"
-
-/**
- * ARM VFP optimized float to int16 conversion.
- * Assume that len is a positive number and is multiple of 8, destination
- * buffer is at least 4 bytes aligned (8 bytes alignment is better for
- * performance), little-endian byte sex.
- */
-@ void ff_float_to_int16_vfp(int16_t *dst, const float *src, int len)
-function ff_float_to_int16_vfp, export=1
-        push            {r4-r8,lr}
-        vpush           {d8-d11}
-        vldmia          r1!, {s16-s23}
-        vcvt.s32.f32    s0,  s16
-        vcvt.s32.f32    s1,  s17
-        vcvt.s32.f32    s2,  s18
-        vcvt.s32.f32    s3,  s19
-        vcvt.s32.f32    s4,  s20
-        vcvt.s32.f32    s5,  s21
-        vcvt.s32.f32    s6,  s22
-        vcvt.s32.f32    s7,  s23
-1:
-        subs            r2,  r2,  #8
-        vmov            r3,  r4,  s0, s1
-        vmov            r5,  r6,  s2, s3
-        vmov            r7,  r8,  s4, s5
-        vmov            ip,  lr,  s6, s7
-        it              gt
-        vldmiagt        r1!, {s16-s23}
-        ssat            r4,  #16, r4
-        ssat            r3,  #16, r3
-        ssat            r6,  #16, r6
-        ssat            r5,  #16, r5
-        pkhbt           r3,  r3,  r4, lsl #16
-        pkhbt           r4,  r5,  r6, lsl #16
-        itttt           gt
-        vcvtgt.s32.f32  s0,  s16
-        vcvtgt.s32.f32  s1,  s17
-        vcvtgt.s32.f32  s2,  s18
-        vcvtgt.s32.f32  s3,  s19
-        itttt           gt
-        vcvtgt.s32.f32  s4,  s20
-        vcvtgt.s32.f32  s5,  s21
-        vcvtgt.s32.f32  s6,  s22
-        vcvtgt.s32.f32  s7,  s23
-        ssat            r8,  #16, r8
-        ssat            r7,  #16, r7
-        ssat            lr,  #16, lr
-        ssat            ip,  #16, ip
-        pkhbt           r5,  r7,  r8, lsl #16
-        pkhbt           r6,  ip,  lr, lsl #16
-        stmia           r0!, {r3-r6}
-        bgt             1b
-
-        vpop            {d8-d11}
-        pop             {r4-r8,pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/h264chroma_init_arm.c b/deps/libav/libavcodec/arm/h264chroma_init_arm.c
deleted file mode 100644
index 6f36553..0000000
--- a/deps/libav/libavcodec/arm/h264chroma_init_arm.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * ARM NEON optimised H.264 chroma functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/h264chroma.h"
-
-void ff_put_h264_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
-void ff_put_h264_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
-void ff_put_h264_chroma_mc2_neon(uint8_t *, uint8_t *, int, int, int, int);
-
-void ff_avg_h264_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
-void ff_avg_h264_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
-void ff_avg_h264_chroma_mc2_neon(uint8_t *, uint8_t *, int, int, int, int);
-
-av_cold void ff_h264chroma_init_arm(H264ChromaContext *c, int bit_depth)
-{
-    const int high_bit_depth = bit_depth > 8;
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags) && !high_bit_depth) {
-        c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_neon;
-        c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_neon;
-        c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_neon;
-
-        c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_neon;
-        c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_neon;
-        c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/h264cmc_neon.S b/deps/libav/libavcodec/arm/h264cmc_neon.S
deleted file mode 100644
index 3183dd8..0000000
--- a/deps/libav/libavcodec/arm/h264cmc_neon.S
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-/* chroma_mc8(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y) */
-.macro  h264_chroma_mc8 type, codec=h264
-function ff_\type\()_\codec\()_chroma_mc8_neon, export=1
-        push            {r4-r7, lr}
-        ldrd            r4,  r5,  [sp, #20]
-  .ifc \type,avg
-        mov             lr,  r0
-  .endif
-        pld             [r1]
-        pld             [r1, r2]
-
-  .ifc \codec,rv40
-        movrel          r6,  rv40bias
-        lsr             r7,  r5,  #1
-        add             r6,  r6,  r7,  lsl #3
-        lsr             r7,  r4,  #1
-        add             r6,  r6,  r7,  lsl #1
-        vld1.16         {d22[],d23[]}, [r6,:16]
-  .endif
-  .ifc \codec,vc1
-        vmov.u16        q11, #28
-  .endif
-
-A       muls            r7,  r4,  r5
-T       mul             r7,  r4,  r5
-T       cmp             r7,  #0
-        rsb             r6,  r7,  r5,  lsl #3
-        rsb             r12, r7,  r4,  lsl #3
-        sub             r4,  r7,  r4,  lsl #3
-        sub             r4,  r4,  r5,  lsl #3
-        add             r4,  r4,  #64
-
-        beq             2f
-
-        vdup.8          d0,  r4
-        vdup.8          d1,  r12
-        vld1.8          {d4, d5}, [r1], r2
-        vdup.8          d2,  r6
-        vdup.8          d3,  r7
-        vext.8          d5,  d4,  d5,  #1
-
-1:      vld1.8          {d6, d7}, [r1], r2
-        vmull.u8        q8,  d4,  d0
-        vmlal.u8        q8,  d5,  d1
-        vext.8          d7,  d6,  d7,  #1
-        vld1.8          {d4, d5}, [r1], r2
-        vmlal.u8        q8,  d6,  d2
-        pld             [r1]
-        vext.8          d5,  d4,  d5,  #1
-        vmlal.u8        q8,  d7,  d3
-        vmull.u8        q9,  d6,  d0
-        subs            r3,  r3,  #2
-        vmlal.u8        q9,  d7,  d1
-        vmlal.u8        q9,  d4,  d2
-        vmlal.u8        q9,  d5,  d3
-        pld             [r1, r2]
-  .ifc \codec,h264
-        vrshrn.u16      d16, q8,  #6
-        vrshrn.u16      d17, q9,  #6
-  .else
-        vadd.u16        q8,  q8,  q11
-        vadd.u16        q9,  q9,  q11
-        vshrn.u16       d16, q8,  #6
-        vshrn.u16       d17, q9,  #6
-  .endif
-  .ifc \type,avg
-        vld1.8          {d20}, [lr,:64], r2
-        vld1.8          {d21}, [lr,:64], r2
-        vrhadd.u8       q8,  q8,  q10
-  .endif
-        vst1.8          {d16}, [r0,:64], r2
-        vst1.8          {d17}, [r0,:64], r2
-        bgt             1b
-
-        pop             {r4-r7, pc}
-
-2:      tst             r6,  r6
-        add             r12, r12, r6
-        vdup.8          d0,  r4
-        vdup.8          d1,  r12
-
-        beq             4f
-
-        vld1.8          {d4}, [r1], r2
-
-3:      vld1.8          {d6}, [r1], r2
-        vmull.u8        q8,  d4,  d0
-        vmlal.u8        q8,  d6,  d1
-        vld1.8          {d4}, [r1], r2
-        vmull.u8        q9,  d6,  d0
-        vmlal.u8        q9,  d4,  d1
-        pld             [r1]
-  .ifc \codec,h264
-        vrshrn.u16      d16, q8,  #6
-        vrshrn.u16      d17, q9,  #6
-  .else
-        vadd.u16        q8,  q8,  q11
-        vadd.u16        q9,  q9,  q11
-        vshrn.u16       d16, q8,  #6
-        vshrn.u16       d17, q9,  #6
-  .endif
-        pld             [r1, r2]
-  .ifc \type,avg
-        vld1.8          {d20}, [lr,:64], r2
-        vld1.8          {d21}, [lr,:64], r2
-        vrhadd.u8       q8,  q8,  q10
-  .endif
-        subs            r3,  r3,  #2
-        vst1.8          {d16}, [r0,:64], r2
-        vst1.8          {d17}, [r0,:64], r2
-        bgt             3b
-
-        pop             {r4-r7, pc}
-
-4:      vld1.8          {d4, d5}, [r1], r2
-        vld1.8          {d6, d7}, [r1], r2
-        vext.8          d5,  d4,  d5,  #1
-        vext.8          d7,  d6,  d7,  #1
-        pld             [r1]
-        subs            r3,  r3,  #2
-        vmull.u8        q8,  d4,  d0
-        vmlal.u8        q8,  d5,  d1
-        vmull.u8        q9,  d6,  d0
-        vmlal.u8        q9,  d7,  d1
-        pld             [r1, r2]
-  .ifc \codec,h264
-        vrshrn.u16      d16, q8,  #6
-        vrshrn.u16      d17, q9,  #6
-  .else
-        vadd.u16        q8,  q8,  q11
-        vadd.u16        q9,  q9,  q11
-        vshrn.u16       d16, q8,  #6
-        vshrn.u16       d17, q9,  #6
-  .endif
-  .ifc \type,avg
-        vld1.8          {d20}, [lr,:64], r2
-        vld1.8          {d21}, [lr,:64], r2
-        vrhadd.u8       q8,  q8,  q10
-  .endif
-        vst1.8          {d16}, [r0,:64], r2
-        vst1.8          {d17}, [r0,:64], r2
-        bgt             4b
-
-        pop             {r4-r7, pc}
-endfunc
-.endm
-
-/* chroma_mc4(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y) */
-.macro  h264_chroma_mc4 type, codec=h264
-function ff_\type\()_\codec\()_chroma_mc4_neon, export=1
-        push            {r4-r7, lr}
-        ldrd            r4,  r5,  [sp, #20]
-  .ifc \type,avg
-        mov             lr,  r0
-  .endif
-        pld             [r1]
-        pld             [r1, r2]
-
-  .ifc \codec,rv40
-        movrel          r6,  rv40bias
-        lsr             r7,  r5,  #1
-        add             r6,  r6,  r7,  lsl #3
-        lsr             r7,  r4,  #1
-        add             r6,  r6,  r7,  lsl #1
-        vld1.16         {d22[],d23[]}, [r6,:16]
-  .endif
-  .ifc \codec,vc1
-        vmov.u16        q11, #28
-  .endif
-
-A       muls            r7,  r4,  r5
-T       mul             r7,  r4,  r5
-T       cmp             r7,  #0
-        rsb             r6,  r7,  r5,  lsl #3
-        rsb             r12, r7,  r4,  lsl #3
-        sub             r4,  r7,  r4,  lsl #3
-        sub             r4,  r4,  r5,  lsl #3
-        add             r4,  r4,  #64
-
-        beq             2f
-
-        vdup.8          d0,  r4
-        vdup.8          d1,  r12
-        vld1.8          {d4},     [r1], r2
-        vdup.8          d2,  r6
-        vdup.8          d3,  r7
-
-        vext.8          d5,  d4,  d5,  #1
-        vtrn.32         d4,  d5
-
-        vtrn.32         d0,  d1
-        vtrn.32         d2,  d3
-
-1:      vld1.8          {d6},     [r1], r2
-        vext.8          d7,  d6,  d7,  #1
-        vtrn.32         d6,  d7
-        vmull.u8        q8,  d4,  d0
-        vmlal.u8        q8,  d6,  d2
-        vld1.8          {d4},     [r1], r2
-        vext.8          d5,  d4,  d5,  #1
-        vtrn.32         d4,  d5
-        pld             [r1]
-        vmull.u8        q9,  d6,  d0
-        vmlal.u8        q9,  d4,  d2
-        vadd.i16        d16, d16, d17
-        vadd.i16        d17, d18, d19
-  .ifc \codec,h264
-        vrshrn.u16      d16, q8,  #6
-  .else
-        vadd.u16        q8,  q8,  q11
-        vshrn.u16       d16, q8,  #6
-  .endif
-        subs            r3,  r3,  #2
-        pld             [r1, r2]
-  .ifc \type,avg
-        vld1.32         {d20[0]}, [lr,:32], r2
-        vld1.32         {d20[1]}, [lr,:32], r2
-        vrhadd.u8       d16, d16, d20
-  .endif
-        vst1.32         {d16[0]}, [r0,:32], r2
-        vst1.32         {d16[1]}, [r0,:32], r2
-        bgt             1b
-
-        pop             {r4-r7, pc}
-
-2:      tst             r6,  r6
-        add             r12, r12, r6
-        vdup.8          d0,  r4
-        vdup.8          d1,  r12
-        vtrn.32         d0,  d1
-
-        beq             4f
-
-        vext.32         d1,  d0,  d1,  #1
-        vld1.32         {d4[0]},  [r1], r2
-
-3:      vld1.32         {d4[1]},  [r1], r2
-        vmull.u8        q8,  d4,  d0
-        vld1.32         {d4[0]},  [r1], r2
-        vmull.u8        q9,  d4,  d1
-        vadd.i16        d16, d16, d17
-        vadd.i16        d17, d18, d19
-        pld             [r1]
-  .ifc \codec,h264
-        vrshrn.u16      d16, q8,  #6
-  .else
-        vadd.u16        q8,  q8,  q11
-        vshrn.u16       d16, q8,  #6
-  .endif
-  .ifc \type,avg
-        vld1.32         {d20[0]}, [lr,:32], r2
-        vld1.32         {d20[1]}, [lr,:32], r2
-        vrhadd.u8       d16, d16, d20
-  .endif
-        subs            r3,  r3,  #2
-        pld             [r1, r2]
-        vst1.32         {d16[0]}, [r0,:32], r2
-        vst1.32         {d16[1]}, [r0,:32], r2
-        bgt             3b
-
-        pop             {r4-r7, pc}
-
-4:      vld1.8          {d4},     [r1], r2
-        vld1.8          {d6},     [r1], r2
-        vext.8          d5,  d4,  d5,  #1
-        vext.8          d7,  d6,  d7,  #1
-        vtrn.32         d4,  d5
-        vtrn.32         d6,  d7
-        vmull.u8        q8,  d4,  d0
-        vmull.u8        q9,  d6,  d0
-        subs            r3,  r3,  #2
-        vadd.i16        d16, d16, d17
-        vadd.i16        d17, d18, d19
-        pld             [r1]
-  .ifc \codec,h264
-        vrshrn.u16      d16, q8,  #6
-  .else
-        vadd.u16        q8,  q8,  q11
-        vshrn.u16       d16, q8,  #6
-  .endif
-  .ifc \type,avg
-        vld1.32         {d20[0]}, [lr,:32], r2
-        vld1.32         {d20[1]}, [lr,:32], r2
-        vrhadd.u8       d16, d16, d20
-  .endif
-        pld             [r1]
-        vst1.32         {d16[0]}, [r0,:32], r2
-        vst1.32         {d16[1]}, [r0,:32], r2
-        bgt             4b
-
-        pop             {r4-r7, pc}
-endfunc
-.endm
-
-.macro  h264_chroma_mc2 type
-function ff_\type\()_h264_chroma_mc2_neon, export=1
-        push            {r4-r6, lr}
-        ldr             r4,  [sp, #16]
-        ldr             lr,  [sp, #20]
-        pld             [r1]
-        pld             [r1, r2]
-        orrs            r5,  r4,  lr
-        beq             2f
-
-        mul             r5,  r4,  lr
-        rsb             r6,  r5,  lr,  lsl #3
-        rsb             r12, r5,  r4,  lsl #3
-        sub             r4,  r5,  r4,  lsl #3
-        sub             r4,  r4,  lr,  lsl #3
-        add             r4,  r4,  #64
-        vdup.8          d0,  r4
-        vdup.8          d2,  r12
-        vdup.8          d1,  r6
-        vdup.8          d3,  r5
-        vtrn.16         q0,  q1
-1:
-        vld1.32         {d4[0]},  [r1], r2
-        vld1.32         {d4[1]},  [r1], r2
-        vrev64.32       d5,  d4
-        vld1.32         {d5[1]},  [r1]
-        vext.8          q3,  q2,  q2,  #1
-        vtrn.16         q2,  q3
-        vmull.u8        q8,  d4,  d0
-        vmlal.u8        q8,  d5,  d1
-  .ifc \type,avg
-        vld1.16         {d18[0]}, [r0,:16], r2
-        vld1.16         {d18[1]}, [r0,:16]
-        sub             r0,  r0,  r2
-  .endif
-        vtrn.32         d16, d17
-        vadd.i16        d16, d16, d17
-        vrshrn.u16      d16, q8,  #6
-  .ifc \type,avg
-        vrhadd.u8       d16, d16, d18
-  .endif
-        vst1.16         {d16[0]}, [r0,:16], r2
-        vst1.16         {d16[1]}, [r0,:16], r2
-        subs            r3,  r3,  #2
-        bgt             1b
-        pop             {r4-r6, pc}
-2:
-  .ifc \type,put
-        ldrh_post       r5,  r1,  r2
-        strh_post       r5,  r0,  r2
-        ldrh_post       r6,  r1,  r2
-        strh_post       r6,  r0,  r2
-  .else
-        vld1.16         {d16[0]}, [r1], r2
-        vld1.16         {d16[1]}, [r1], r2
-        vld1.16         {d18[0]}, [r0,:16], r2
-        vld1.16         {d18[1]}, [r0,:16]
-        sub             r0,  r0,  r2
-        vrhadd.u8       d16, d16, d18
-        vst1.16         {d16[0]}, [r0,:16], r2
-        vst1.16         {d16[1]}, [r0,:16], r2
-  .endif
-        subs            r3,  r3,  #2
-        bgt             2b
-        pop             {r4-r6, pc}
-endfunc
-.endm
-
-        h264_chroma_mc8 put
-        h264_chroma_mc8 avg
-        h264_chroma_mc4 put
-        h264_chroma_mc4 avg
-        h264_chroma_mc2 put
-        h264_chroma_mc2 avg
-
-#if CONFIG_RV40_DECODER
-const   rv40bias
-        .short           0, 16, 32, 16
-        .short          32, 28, 32, 28
-        .short           0, 32, 16, 32
-        .short          32, 28, 32, 28
-endconst
-
-        h264_chroma_mc8 put, rv40
-        h264_chroma_mc8 avg, rv40
-        h264_chroma_mc4 put, rv40
-        h264_chroma_mc4 avg, rv40
-#endif
-
-#if CONFIG_VC1_DECODER
-        h264_chroma_mc8 put, vc1
-        h264_chroma_mc8 avg, vc1
-        h264_chroma_mc4 put, vc1
-        h264_chroma_mc4 avg, vc1
-#endif
diff --git a/deps/libav/libavcodec/arm/h264dsp_armv6.S b/deps/libav/libavcodec/arm/h264dsp_armv6.S
deleted file mode 100644
index 384ed86..0000000
--- a/deps/libav/libavcodec/arm/h264dsp_armv6.S
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 2013 RISC OS Open Ltd
- * Author: Ben Avison <bavison at riscosopen.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-RESULT  .req    a1
-BUF     .req    a1
-SIZE    .req    a2
-PATTERN .req    a3
-PTR     .req    a4
-DAT0    .req    v1
-DAT1    .req    v2
-DAT2    .req    v3
-DAT3    .req    v4
-TMP0    .req    v5
-TMP1    .req    v6
-TMP2    .req    ip
-TMP3    .req    lr
-
-#define PRELOAD_DISTANCE 4
-
-.macro innerloop4
-        ldr     DAT0, [PTR], #4
-        subs    SIZE, SIZE, #4 @ C flag survives rest of macro
-        sub     TMP0, DAT0, PATTERN, lsr #14
-        bic     TMP0, TMP0, DAT0
-        ands    TMP0, TMP0, PATTERN
-.endm
-
-.macro innerloop16  decrement, do_preload
-        ldmia   PTR!, {DAT0,DAT1,DAT2,DAT3}
- .ifnc "\do_preload",""
-        pld     [PTR, #PRELOAD_DISTANCE*32]
- .endif
- .ifnc "\decrement",""
-        subs    SIZE, SIZE, #\decrement @ C flag survives rest of macro
- .endif
-        sub     TMP0, DAT0, PATTERN, lsr #14
-        sub     TMP1, DAT1, PATTERN, lsr #14
-        bic     TMP0, TMP0, DAT0
-        bic     TMP1, TMP1, DAT1
-        sub     TMP2, DAT2, PATTERN, lsr #14
-        sub     TMP3, DAT3, PATTERN, lsr #14
-        ands    TMP0, TMP0, PATTERN
-        bic     TMP2, TMP2, DAT2
-        it      eq
-        andseq  TMP1, TMP1, PATTERN
-        bic     TMP3, TMP3, DAT3
-        itt     eq
-        andseq  TMP2, TMP2, PATTERN
-        andseq  TMP3, TMP3, PATTERN
-.endm
-
-/* int ff_h264_find_start_code_candidate_armv6(const uint8_t *buf, int size) */
-function ff_h264_find_start_code_candidate_armv6, export=1
-        push    {v1-v6,lr}
-        mov     PTR, BUF
-        @ Ensure there are at least (PRELOAD_DISTANCE+2) complete cachelines to go
-        @ before using code that does preloads
-        cmp     SIZE, #(PRELOAD_DISTANCE+3)*32 - 1
-        blo     60f
-
-        @ Get to word-alignment, 1 byte at a time
-        tst     PTR, #3
-        beq     2f
-1:      ldrb    DAT0, [PTR], #1
-        sub     SIZE, SIZE, #1
-        teq     DAT0, #0
-        beq     90f
-        tst     PTR, #3
-        bne     1b
-2:      @ Get to 4-word alignment, 1 word at a time
-        ldr     PATTERN, =0x80008000
-        setend  be
-        tst     PTR, #12
-        beq     4f
-3:      innerloop4
-        bne     91f
-        tst     PTR, #12
-        bne     3b
-4:      @ Get to cacheline (8-word) alignment
-        tst     PTR, #16
-        beq     5f
-        innerloop16  16
-        bne     93f
-5:      @ Check complete cachelines, with preloading
-        @ We need to stop when there are still (PRELOAD_DISTANCE+1)
-        @ complete cachelines to go
-        sub     SIZE, SIZE, #(PRELOAD_DISTANCE+2)*32
-6:      innerloop16  , do_preload
-        bne     93f
-        innerloop16  32
-        bne     93f
-        bcs     6b
-        @ Preload trailing part-cacheline, if any
-        tst     SIZE, #31
-        beq     7f
-        pld     [PTR, #(PRELOAD_DISTANCE+1)*32]
-        @ Check remaining data without doing any more preloads. First
-        @ do in chunks of 4 words:
-7:      adds    SIZE, SIZE, #(PRELOAD_DISTANCE+2)*32 - 16
-        bmi     9f
-8:      innerloop16  16
-        bne     93f
-        bcs     8b
-        @ Then in words:
-9:      adds    SIZE, SIZE, #16 - 4
-        bmi     11f
-10:     innerloop4
-        bne     91f
-        bcs     10b
-11:     setend  le
-        @ Check second byte of final halfword
-        ldrb    DAT0, [PTR, #-1]
-        teq     DAT0, #0
-        beq     90f
-        @ Check any remaining bytes
-        tst     SIZE, #3
-        beq     13f
-12:     ldrb    DAT0, [PTR], #1
-        sub     SIZE, SIZE, #1
-        teq     DAT0, #0
-        beq     90f
-        tst     SIZE, #3
-        bne     12b
-        @ No candidate found
-13:     sub     RESULT, PTR, BUF
-        b       99f
-
-60:     @ Small buffer - simply check by looping over bytes
-        subs    SIZE, SIZE, #1
-        bcc     99f
-61:     ldrb    DAT0, [PTR], #1
-        subs    SIZE, SIZE, #1
-        teq     DAT0, #0
-        beq     90f
-        bcs     61b
-        @ No candidate found
-        sub     RESULT, PTR, BUF
-        b       99f
-
-90:     @ Found a candidate at the preceding byte
-        sub     RESULT, PTR, BUF
-        sub     RESULT, RESULT, #1
-        b       99f
-
-91:     @ Found a candidate somewhere in the preceding 4 bytes
-        sub     RESULT, PTR, BUF
-        sub     RESULT, RESULT, #4
-        sub     TMP0, DAT0, #0x20000
-        bics    TMP0, TMP0, DAT0
-        itt     pl
-        ldrbpl  DAT0, [PTR, #-3]
-        addpl   RESULT, RESULT, #2
-        bpl     92f
-        teq     RESULT, #0
-        beq     98f @ don't look back a byte if found at first byte in buffer
-        ldrb    DAT0, [PTR, #-5]
-92:     teq     DAT0, #0
-        it      eq
-        subeq   RESULT, RESULT, #1
-        b       98f
-
-93:     @ Found a candidate somewhere in the preceding 16 bytes
-        sub     RESULT, PTR, BUF
-        sub     RESULT, RESULT, #16
-        teq     TMP0, #0
-        beq     95f @ not in first 4 bytes
-        sub     TMP0, DAT0, #0x20000
-        bics    TMP0, TMP0, DAT0
-        itt     pl
-        ldrbpl  DAT0, [PTR, #-15]
-        addpl   RESULT, RESULT, #2
-        bpl     94f
-        teq     RESULT, #0
-        beq     98f @ don't look back a byte if found at first byte in buffer
-        ldrb    DAT0, [PTR, #-17]
-94:     teq     DAT0, #0
-        it      eq
-        subeq   RESULT, RESULT, #1
-        b       98f
-95:     add     RESULT, RESULT, #4
-        teq     TMP1, #0
-        beq     96f @ not in next 4 bytes
-        sub     TMP1, DAT1, #0x20000
-        bics    TMP1, TMP1, DAT1
-        itee    mi
-        ldrbmi  DAT0, [PTR, #-13]
-        ldrbpl  DAT0, [PTR, #-11]
-        addpl   RESULT, RESULT, #2
-        teq     DAT0, #0
-        it      eq
-        subeq   RESULT, RESULT, #1
-        b       98f
-96:     add     RESULT, RESULT, #4
-        teq     TMP2, #0
-        beq     97f @ not in next 4 bytes
-        sub     TMP2, DAT2, #0x20000
-        bics    TMP2, TMP2, DAT2
-        itee    mi
-        ldrbmi  DAT0, [PTR, #-9]
-        ldrbpl  DAT0, [PTR, #-7]
-        addpl   RESULT, RESULT, #2
-        teq     DAT0, #0
-        it      eq
-        subeq   RESULT, RESULT, #1
-        b       98f
-97:     add     RESULT, RESULT, #4
-        sub     TMP3, DAT3, #0x20000
-        bics    TMP3, TMP3, DAT3
-        itee    mi
-        ldrbmi  DAT0, [PTR, #-5]
-        ldrbpl  DAT0, [PTR, #-3]
-        addpl   RESULT, RESULT, #2
-        teq     DAT0, #0
-        it      eq
-        subeq   RESULT, RESULT, #1
-        @ drop through to 98f
-98:     setend  le
-99:     pop     {v1-v6,pc}
-endfunc
-
-        .unreq  RESULT
-        .unreq  BUF
-        .unreq  SIZE
-        .unreq  PATTERN
-        .unreq  PTR
-        .unreq  DAT0
-        .unreq  DAT1
-        .unreq  DAT2
-        .unreq  DAT3
-        .unreq  TMP0
-        .unreq  TMP1
-        .unreq  TMP2
-        .unreq  TMP3
diff --git a/deps/libav/libavcodec/arm/h264dsp_init_arm.c b/deps/libav/libavcodec/arm/h264dsp_init_arm.c
deleted file mode 100644
index 92658e7..0000000
--- a/deps/libav/libavcodec/arm/h264dsp_init_arm.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/h264dsp.h"
-
-int ff_h264_find_start_code_candidate_armv6(const uint8_t *buf, int size);
-
-void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
-                                     int beta, int8_t *tc0);
-void ff_h264_h_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
-                                     int beta, int8_t *tc0);
-void ff_h264_v_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
-                                       int beta, int8_t *tc0);
-void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
-                                       int beta, int8_t *tc0);
-
-void ff_weight_h264_pixels_16_neon(uint8_t *dst, int stride, int height,
-                                   int log2_den, int weight, int offset);
-void ff_weight_h264_pixels_8_neon(uint8_t *dst, int stride, int height,
-                                  int log2_den, int weight, int offset);
-void ff_weight_h264_pixels_4_neon(uint8_t *dst, int stride, int height,
-                                  int log2_den, int weight, int offset);
-
-void ff_biweight_h264_pixels_16_neon(uint8_t *dst, uint8_t *src, int stride,
-                                     int height, int log2_den, int weightd,
-                                     int weights, int offset);
-void ff_biweight_h264_pixels_8_neon(uint8_t *dst, uint8_t *src, int stride,
-                                    int height, int log2_den, int weightd,
-                                    int weights, int offset);
-void ff_biweight_h264_pixels_4_neon(uint8_t *dst, uint8_t *src, int stride,
-                                    int height, int log2_den, int weightd,
-                                    int weights, int offset);
-
-void ff_h264_idct_add_neon(uint8_t *dst, int16_t *block, int stride);
-void ff_h264_idct_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
-void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset,
-                             int16_t *block, int stride,
-                             const uint8_t nnzc[6*8]);
-void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset,
-                                  int16_t *block, int stride,
-                                  const uint8_t nnzc[6*8]);
-void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset,
-                            int16_t *block, int stride,
-                            const uint8_t nnzc[6*8]);
-
-void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride);
-void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
-void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset,
-                             int16_t *block, int stride,
-                             const uint8_t nnzc[6*8]);
-
-static av_cold void h264dsp_init_neon(H264DSPContext *c, const int bit_depth,
-                                      const int chroma_format_idc)
-{
-    if (bit_depth == 8) {
-        c->h264_v_loop_filter_luma   = ff_h264_v_loop_filter_luma_neon;
-        c->h264_h_loop_filter_luma   = ff_h264_h_loop_filter_luma_neon;
-        c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
-        c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
-
-        c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
-        c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
-        c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
-
-        c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
-        c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
-        c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
-
-        c->h264_idct_add        = ff_h264_idct_add_neon;
-        c->h264_idct_dc_add     = ff_h264_idct_dc_add_neon;
-        c->h264_idct_add16      = ff_h264_idct_add16_neon;
-        c->h264_idct_add16intra = ff_h264_idct_add16intra_neon;
-        if (chroma_format_idc <= 1)
-            c->h264_idct_add8   = ff_h264_idct_add8_neon;
-        c->h264_idct8_add       = ff_h264_idct8_add_neon;
-        c->h264_idct8_dc_add    = ff_h264_idct8_dc_add_neon;
-        c->h264_idct8_add4      = ff_h264_idct8_add4_neon;
-    }
-}
-
-av_cold void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
-                                 const int chroma_format_idc)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_armv6(cpu_flags))
-        c->h264_find_start_code_candidate = ff_h264_find_start_code_candidate_armv6;
-    if (have_neon(cpu_flags))
-        h264dsp_init_neon(c, bit_depth, chroma_format_idc);
-}
diff --git a/deps/libav/libavcodec/arm/h264dsp_neon.S b/deps/libav/libavcodec/arm/h264dsp_neon.S
deleted file mode 100644
index 5e75565..0000000
--- a/deps/libav/libavcodec/arm/h264dsp_neon.S
+++ /dev/null
@@ -1,541 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-#include "neon.S"
-
-        /* H.264 loop filter */
-
-.macro  h264_loop_filter_start
-        ldr             r12, [sp]
-        tst             r2,  r2
-        ldr             r12, [r12]
-        it              ne
-        tstne           r3,  r3
-        vmov.32         d24[0], r12
-        and             r12, r12, r12, lsl #16
-        it              eq
-        bxeq            lr
-        ands            r12, r12, r12, lsl #8
-        it              lt
-        bxlt            lr
-.endm
-
-.macro  h264_loop_filter_luma
-        vdup.8          q11, r2         @ alpha
-        vmovl.u8        q12, d24
-        vabd.u8         q6,  q8,  q0    @ abs(p0 - q0)
-        vmovl.u16       q12, d24
-        vabd.u8         q14, q9,  q8    @ abs(p1 - p0)
-        vsli.16         q12, q12, #8
-        vabd.u8         q15, q1,  q0    @ abs(q1 - q0)
-        vsli.32         q12, q12, #16
-        vclt.u8         q6,  q6,  q11   @ < alpha
-        vdup.8          q11, r3         @ beta
-        vclt.s8         q7,  q12, #0
-        vclt.u8         q14, q14, q11   @ < beta
-        vclt.u8         q15, q15, q11   @ < beta
-        vbic            q6,  q6,  q7
-        vabd.u8         q4,  q10, q8    @ abs(p2 - p0)
-        vand            q6,  q6,  q14
-        vabd.u8         q5,  q2,  q0    @ abs(q2 - q0)
-        vclt.u8         q4,  q4,  q11   @ < beta
-        vand            q6,  q6,  q15
-        vclt.u8         q5,  q5,  q11   @ < beta
-        vand            q4,  q4,  q6
-        vand            q5,  q5,  q6
-        vand            q12, q12, q6
-        vrhadd.u8       q14, q8,  q0
-        vsub.i8         q6,  q12, q4
-        vqadd.u8        q7,  q9,  q12
-        vhadd.u8        q10, q10, q14
-        vsub.i8         q6,  q6,  q5
-        vhadd.u8        q14, q2,  q14
-        vmin.u8         q7,  q7,  q10
-        vqsub.u8        q11, q9,  q12
-        vqadd.u8        q2,  q1,  q12
-        vmax.u8         q7,  q7,  q11
-        vqsub.u8        q11, q1,  q12
-        vmin.u8         q14, q2,  q14
-        vmovl.u8        q2,  d0
-        vmax.u8         q14, q14, q11
-        vmovl.u8        q10, d1
-        vsubw.u8        q2,  q2,  d16
-        vsubw.u8        q10, q10, d17
-        vshl.i16        q2,  q2,  #2
-        vshl.i16        q10, q10, #2
-        vaddw.u8        q2,  q2,  d18
-        vaddw.u8        q10, q10, d19
-        vsubw.u8        q2,  q2,  d2
-        vsubw.u8        q10, q10, d3
-        vrshrn.i16      d4,  q2,  #3
-        vrshrn.i16      d5,  q10, #3
-        vbsl            q4,  q7,  q9
-        vbsl            q5,  q14, q1
-        vneg.s8         q7,  q6
-        vmovl.u8        q14, d16
-        vmin.s8         q2,  q2,  q6
-        vmovl.u8        q6,  d17
-        vmax.s8         q2,  q2,  q7
-        vmovl.u8        q11, d0
-        vmovl.u8        q12, d1
-        vaddw.s8        q14, q14, d4
-        vaddw.s8        q6,  q6,  d5
-        vsubw.s8        q11, q11, d4
-        vsubw.s8        q12, q12, d5
-        vqmovun.s16     d16, q14
-        vqmovun.s16     d17, q6
-        vqmovun.s16     d0,  q11
-        vqmovun.s16     d1,  q12
-.endm
-
-function ff_h264_v_loop_filter_luma_neon, export=1
-        h264_loop_filter_start
-
-        vld1.8          {d0, d1},  [r0,:128], r1
-        vld1.8          {d2, d3},  [r0,:128], r1
-        vld1.8          {d4, d5},  [r0,:128], r1
-        sub             r0,  r0,  r1, lsl #2
-        sub             r0,  r0,  r1, lsl #1
-        vld1.8          {d20,d21}, [r0,:128], r1
-        vld1.8          {d18,d19}, [r0,:128], r1
-        vld1.8          {d16,d17}, [r0,:128], r1
-
-        vpush           {d8-d15}
-
-        h264_loop_filter_luma
-
-        sub             r0,  r0,  r1, lsl #1
-        vst1.8          {d8, d9},  [r0,:128], r1
-        vst1.8          {d16,d17}, [r0,:128], r1
-        vst1.8          {d0, d1},  [r0,:128], r1
-        vst1.8          {d10,d11}, [r0,:128]
-
-        vpop            {d8-d15}
-        bx              lr
-endfunc
-
-function ff_h264_h_loop_filter_luma_neon, export=1
-        h264_loop_filter_start
-
-        sub             r0,  r0,  #4
-        vld1.8          {d6},  [r0], r1
-        vld1.8          {d20}, [r0], r1
-        vld1.8          {d18}, [r0], r1
-        vld1.8          {d16}, [r0], r1
-        vld1.8          {d0},  [r0], r1
-        vld1.8          {d2},  [r0], r1
-        vld1.8          {d4},  [r0], r1
-        vld1.8          {d26}, [r0], r1
-        vld1.8          {d7},  [r0], r1
-        vld1.8          {d21}, [r0], r1
-        vld1.8          {d19}, [r0], r1
-        vld1.8          {d17}, [r0], r1
-        vld1.8          {d1},  [r0], r1
-        vld1.8          {d3},  [r0], r1
-        vld1.8          {d5},  [r0], r1
-        vld1.8          {d27}, [r0], r1
-
-        transpose_8x8   q3, q10, q9, q8, q0, q1, q2, q13
-
-        vpush           {d8-d15}
-
-        h264_loop_filter_luma
-
-        transpose_4x4   q4, q8, q0, q5
-
-        sub             r0,  r0,  r1, lsl #4
-        add             r0,  r0,  #2
-        vst1.32         {d8[0]},  [r0], r1
-        vst1.32         {d16[0]}, [r0], r1
-        vst1.32         {d0[0]},  [r0], r1
-        vst1.32         {d10[0]}, [r0], r1
-        vst1.32         {d8[1]},  [r0], r1
-        vst1.32         {d16[1]}, [r0], r1
-        vst1.32         {d0[1]},  [r0], r1
-        vst1.32         {d10[1]}, [r0], r1
-        vst1.32         {d9[0]},  [r0], r1
-        vst1.32         {d17[0]}, [r0], r1
-        vst1.32         {d1[0]},  [r0], r1
-        vst1.32         {d11[0]}, [r0], r1
-        vst1.32         {d9[1]},  [r0], r1
-        vst1.32         {d17[1]}, [r0], r1
-        vst1.32         {d1[1]},  [r0], r1
-        vst1.32         {d11[1]}, [r0], r1
-
-        vpop            {d8-d15}
-        bx              lr
-endfunc
-
-.macro  h264_loop_filter_chroma
-        vdup.8          d22, r2         @ alpha
-        vmovl.u8        q12, d24
-        vabd.u8         d26, d16, d0    @ abs(p0 - q0)
-        vmovl.u8        q2,  d0
-        vabd.u8         d28, d18, d16   @ abs(p1 - p0)
-        vsubw.u8        q2,  q2,  d16
-        vsli.16         d24, d24, #8
-        vshl.i16        q2,  q2,  #2
-        vabd.u8         d30, d2,  d0    @ abs(q1 - q0)
-        vaddw.u8        q2,  q2,  d18
-        vclt.u8         d26, d26, d22   @ < alpha
-        vsubw.u8        q2,  q2,  d2
-        vdup.8          d22, r3         @ beta
-        vrshrn.i16      d4,  q2,  #3
-        vclt.u8         d28, d28, d22   @ < beta
-        vclt.u8         d30, d30, d22   @ < beta
-        vmin.s8         d4,  d4,  d24
-        vneg.s8         d25, d24
-        vand            d26, d26, d28
-        vmax.s8         d4,  d4,  d25
-        vand            d26, d26, d30
-        vmovl.u8        q11, d0
-        vand            d4,  d4,  d26
-        vmovl.u8        q14, d16
-        vaddw.s8        q14, q14, d4
-        vsubw.s8        q11, q11, d4
-        vqmovun.s16     d16, q14
-        vqmovun.s16     d0,  q11
-.endm
-
-function ff_h264_v_loop_filter_chroma_neon, export=1
-        h264_loop_filter_start
-
-        sub             r0,  r0,  r1, lsl #1
-        vld1.8          {d18}, [r0,:64], r1
-        vld1.8          {d16}, [r0,:64], r1
-        vld1.8          {d0},  [r0,:64], r1
-        vld1.8          {d2},  [r0,:64]
-
-        h264_loop_filter_chroma
-
-        sub             r0,  r0,  r1, lsl #1
-        vst1.8          {d16}, [r0,:64], r1
-        vst1.8          {d0},  [r0,:64], r1
-
-        bx              lr
-endfunc
-
-function ff_h264_h_loop_filter_chroma_neon, export=1
-        h264_loop_filter_start
-
-        sub             r0,  r0,  #2
-        vld1.32         {d18[0]}, [r0], r1
-        vld1.32         {d16[0]}, [r0], r1
-        vld1.32         {d0[0]},  [r0], r1
-        vld1.32         {d2[0]},  [r0], r1
-        vld1.32         {d18[1]}, [r0], r1
-        vld1.32         {d16[1]}, [r0], r1
-        vld1.32         {d0[1]},  [r0], r1
-        vld1.32         {d2[1]},  [r0], r1
-
-        vtrn.16         d18, d0
-        vtrn.16         d16, d2
-        vtrn.8          d18, d16
-        vtrn.8          d0,  d2
-
-        h264_loop_filter_chroma
-
-        vtrn.16         d18, d0
-        vtrn.16         d16, d2
-        vtrn.8          d18, d16
-        vtrn.8          d0,  d2
-
-        sub             r0,  r0,  r1, lsl #3
-        vst1.32         {d18[0]}, [r0], r1
-        vst1.32         {d16[0]}, [r0], r1
-        vst1.32         {d0[0]},  [r0], r1
-        vst1.32         {d2[0]},  [r0], r1
-        vst1.32         {d18[1]}, [r0], r1
-        vst1.32         {d16[1]}, [r0], r1
-        vst1.32         {d0[1]},  [r0], r1
-        vst1.32         {d2[1]},  [r0], r1
-
-        bx              lr
-endfunc
-
-@ Biweighted prediction
-
-.macro  biweight_16     macs, macd
-        vdup.8          d0,  r4
-        vdup.8          d1,  r5
-        vmov            q2,  q8
-        vmov            q3,  q8
-1:      subs            r3,  r3,  #2
-        vld1.8          {d20-d21},[r0,:128], r2
-        \macd           q2,  d0,  d20
-        pld             [r0]
-        \macd           q3,  d0,  d21
-        vld1.8          {d22-d23},[r1,:128], r2
-        \macs           q2,  d1,  d22
-        pld             [r1]
-        \macs           q3,  d1,  d23
-        vmov            q12, q8
-        vld1.8          {d28-d29},[r0,:128], r2
-        vmov            q13, q8
-        \macd           q12, d0,  d28
-        pld             [r0]
-        \macd           q13, d0,  d29
-        vld1.8          {d30-d31},[r1,:128], r2
-        \macs           q12, d1,  d30
-        pld             [r1]
-        \macs           q13, d1,  d31
-        vshl.s16        q2,  q2,  q9
-        vshl.s16        q3,  q3,  q9
-        vqmovun.s16     d4,  q2
-        vqmovun.s16     d5,  q3
-        vshl.s16        q12, q12, q9
-        vshl.s16        q13, q13, q9
-        vqmovun.s16     d24, q12
-        vqmovun.s16     d25, q13
-        vmov            q3,  q8
-        vst1.8          {d4- d5}, [r6,:128], r2
-        vmov            q2,  q8
-        vst1.8          {d24-d25},[r6,:128], r2
-        bne             1b
-        pop             {r4-r6, pc}
-.endm
-
-.macro  biweight_8      macs, macd
-        vdup.8          d0,  r4
-        vdup.8          d1,  r5
-        vmov            q1,  q8
-        vmov            q10, q8
-1:      subs            r3,  r3,  #2
-        vld1.8          {d4},[r0,:64], r2
-        \macd           q1,  d0,  d4
-        pld             [r0]
-        vld1.8          {d5},[r1,:64], r2
-        \macs           q1,  d1,  d5
-        pld             [r1]
-        vld1.8          {d6},[r0,:64], r2
-        \macd           q10, d0,  d6
-        pld             [r0]
-        vld1.8          {d7},[r1,:64], r2
-        \macs           q10, d1,  d7
-        pld             [r1]
-        vshl.s16        q1,  q1,  q9
-        vqmovun.s16     d2,  q1
-        vshl.s16        q10, q10, q9
-        vqmovun.s16     d4,  q10
-        vmov            q10, q8
-        vst1.8          {d2},[r6,:64], r2
-        vmov            q1,  q8
-        vst1.8          {d4},[r6,:64], r2
-        bne             1b
-        pop             {r4-r6, pc}
-.endm
-
-.macro  biweight_4      macs, macd
-        vdup.8          d0,  r4
-        vdup.8          d1,  r5
-        vmov            q1,  q8
-        vmov            q10, q8
-1:      subs            r3,  r3,  #4
-        vld1.32         {d4[0]},[r0,:32], r2
-        vld1.32         {d4[1]},[r0,:32], r2
-        \macd           q1,  d0,  d4
-        pld             [r0]
-        vld1.32         {d5[0]},[r1,:32], r2
-        vld1.32         {d5[1]},[r1,:32], r2
-        \macs           q1,  d1,  d5
-        pld             [r1]
-        blt             2f
-        vld1.32         {d6[0]},[r0,:32], r2
-        vld1.32         {d6[1]},[r0,:32], r2
-        \macd           q10, d0,  d6
-        pld             [r0]
-        vld1.32         {d7[0]},[r1,:32], r2
-        vld1.32         {d7[1]},[r1,:32], r2
-        \macs           q10, d1,  d7
-        pld             [r1]
-        vshl.s16        q1,  q1,  q9
-        vqmovun.s16     d2,  q1
-        vshl.s16        q10, q10, q9
-        vqmovun.s16     d4,  q10
-        vmov            q10, q8
-        vst1.32         {d2[0]},[r6,:32], r2
-        vst1.32         {d2[1]},[r6,:32], r2
-        vmov            q1,  q8
-        vst1.32         {d4[0]},[r6,:32], r2
-        vst1.32         {d4[1]},[r6,:32], r2
-        bne             1b
-        pop             {r4-r6, pc}
-2:      vshl.s16        q1,  q1,  q9
-        vqmovun.s16     d2,  q1
-        vst1.32         {d2[0]},[r6,:32], r2
-        vst1.32         {d2[1]},[r6,:32], r2
-        pop             {r4-r6, pc}
-.endm
-
-.macro  biweight_func   w
-function ff_biweight_h264_pixels_\w\()_neon, export=1
-        push            {r4-r6, lr}
-        ldr             r12, [sp, #16]
-        add             r4,  sp,  #20
-        ldm             r4,  {r4-r6}
-        lsr             lr,  r4,  #31
-        add             r6,  r6,  #1
-        eors            lr,  lr,  r5,  lsr #30
-        orr             r6,  r6,  #1
-        vdup.16         q9,  r12
-        lsl             r6,  r6,  r12
-        vmvn            q9,  q9
-        vdup.16         q8,  r6
-        mov             r6,  r0
-        beq             10f
-        subs            lr,  lr,  #1
-        beq             20f
-        subs            lr,  lr,  #1
-        beq             30f
-        b               40f
-10:     biweight_\w     vmlal.u8, vmlal.u8
-20:     rsb             r4,  r4,  #0
-        biweight_\w     vmlal.u8, vmlsl.u8
-30:     rsb             r4,  r4,  #0
-        rsb             r5,  r5,  #0
-        biweight_\w     vmlsl.u8, vmlsl.u8
-40:     rsb             r5,  r5,  #0
-        biweight_\w     vmlsl.u8, vmlal.u8
-endfunc
-.endm
-
-        biweight_func   16
-        biweight_func   8
-        biweight_func   4
-
-@ Weighted prediction
-
-.macro  weight_16       add
-        vdup.8          d0,  r12
-1:      subs            r2,  r2,  #2
-        vld1.8          {d20-d21},[r0,:128], r1
-        vmull.u8        q2,  d0,  d20
-        pld             [r0]
-        vmull.u8        q3,  d0,  d21
-        vld1.8          {d28-d29},[r0,:128], r1
-        vmull.u8        q12, d0,  d28
-        pld             [r0]
-        vmull.u8        q13, d0,  d29
-        \add            q2,  q8,  q2
-        vrshl.s16       q2,  q2,  q9
-        \add            q3,  q8,  q3
-        vrshl.s16       q3,  q3,  q9
-        vqmovun.s16     d4,  q2
-        vqmovun.s16     d5,  q3
-        \add            q12, q8,  q12
-        vrshl.s16       q12, q12, q9
-        \add            q13, q8,  q13
-        vrshl.s16       q13, q13, q9
-        vqmovun.s16     d24, q12
-        vqmovun.s16     d25, q13
-        vst1.8          {d4- d5}, [r4,:128], r1
-        vst1.8          {d24-d25},[r4,:128], r1
-        bne             1b
-        pop             {r4, pc}
-.endm
-
-.macro  weight_8        add
-        vdup.8          d0,  r12
-1:      subs            r2,  r2,  #2
-        vld1.8          {d4},[r0,:64], r1
-        vmull.u8        q1,  d0,  d4
-        pld             [r0]
-        vld1.8          {d6},[r0,:64], r1
-        vmull.u8        q10, d0,  d6
-        \add            q1,  q8,  q1
-        pld             [r0]
-        vrshl.s16       q1,  q1,  q9
-        vqmovun.s16     d2,  q1
-        \add            q10, q8,  q10
-        vrshl.s16       q10, q10, q9
-        vqmovun.s16     d4,  q10
-        vst1.8          {d2},[r4,:64], r1
-        vst1.8          {d4},[r4,:64], r1
-        bne             1b
-        pop             {r4, pc}
-.endm
-
-.macro  weight_4        add
-        vdup.8          d0,  r12
-        vmov            q1,  q8
-        vmov            q10, q8
-1:      subs            r2,  r2,  #4
-        vld1.32         {d4[0]},[r0,:32], r1
-        vld1.32         {d4[1]},[r0,:32], r1
-        vmull.u8        q1,  d0,  d4
-        pld             [r0]
-        blt             2f
-        vld1.32         {d6[0]},[r0,:32], r1
-        vld1.32         {d6[1]},[r0,:32], r1
-        vmull.u8        q10, d0,  d6
-        pld             [r0]
-        \add            q1,  q8,  q1
-        vrshl.s16       q1,  q1,  q9
-        vqmovun.s16     d2,  q1
-        \add            q10, q8,  q10
-        vrshl.s16       q10, q10, q9
-        vqmovun.s16     d4,  q10
-        vmov            q10, q8
-        vst1.32         {d2[0]},[r4,:32], r1
-        vst1.32         {d2[1]},[r4,:32], r1
-        vmov            q1,  q8
-        vst1.32         {d4[0]},[r4,:32], r1
-        vst1.32         {d4[1]},[r4,:32], r1
-        bne             1b
-        pop             {r4, pc}
-2:      \add            q1,  q8,  q1
-        vrshl.s16       q1,  q1,  q9
-        vqmovun.s16     d2,  q1
-        vst1.32         {d2[0]},[r4,:32], r1
-        vst1.32         {d2[1]},[r4,:32], r1
-        pop             {r4, pc}
-.endm
-
-.macro  weight_func     w
-function ff_weight_h264_pixels_\w\()_neon, export=1
-        push            {r4, lr}
-        ldr             r12, [sp, #8]
-        ldr             r4,  [sp, #12]
-        cmp             r3,  #1
-        lsl             r4,  r4,  r3
-        vdup.16         q8,  r4
-        mov             r4,  r0
-        ble             20f
-        rsb             lr,  r3,  #1
-        vdup.16         q9,  lr
-        cmp             r12, #0
-        blt             10f
-        weight_\w       vhadd.s16
-10:     rsb             r12, r12, #0
-        weight_\w       vhsub.s16
-20:     rsb             lr,  r3,  #0
-        vdup.16         q9,  lr
-        cmp             r12, #0
-        blt             10f
-        weight_\w       vadd.s16
-10:     rsb             r12, r12, #0
-        weight_\w       vsub.s16
-endfunc
-.endm
-
-        weight_func     16
-        weight_func     8
-        weight_func     4
diff --git a/deps/libav/libavcodec/arm/h264idct_neon.S b/deps/libav/libavcodec/arm/h264idct_neon.S
deleted file mode 100644
index f588f3e..0000000
--- a/deps/libav/libavcodec/arm/h264idct_neon.S
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_h264_idct_add_neon, export=1
-        vld1.64         {d0-d3},  [r1,:128]
-        vmov.i16        q15, #0
-
-        vswp            d1,  d2
-        vst1.16         {q15},    [r1,:128]!
-        vadd.i16        d4,  d0,  d1
-        vst1.16         {q15},    [r1,:128]!
-        vshr.s16        q8,  q1,  #1
-        vsub.i16        d5,  d0,  d1
-        vadd.i16        d6,  d2,  d17
-        vsub.i16        d7,  d16, d3
-        vadd.i16        q0,  q2,  q3
-        vsub.i16        q1,  q2,  q3
-
-        vtrn.16         d0,  d1
-        vtrn.16         d3,  d2
-        vtrn.32         d0,  d3
-        vtrn.32         d1,  d2
-
-        vadd.i16        d4,  d0,  d3
-        vld1.32         {d18[0]}, [r0,:32], r2
-        vswp            d1,  d3
-        vshr.s16        q8,  q1,  #1
-        vld1.32         {d19[1]}, [r0,:32], r2
-        vsub.i16        d5,  d0,  d1
-        vld1.32         {d18[1]}, [r0,:32], r2
-        vadd.i16        d6,  d16, d3
-        vld1.32         {d19[0]}, [r0,:32], r2
-        vsub.i16        d7,  d2,  d17
-        sub             r0,  r0,  r2, lsl #2
-        vadd.i16        q0,  q2,  q3
-        vsub.i16        q1,  q2,  q3
-
-        vrshr.s16       q0,  q0,  #6
-        vrshr.s16       q1,  q1,  #6
-
-        vaddw.u8        q0,  q0,  d18
-        vaddw.u8        q1,  q1,  d19
-
-        vqmovun.s16     d0,  q0
-        vqmovun.s16     d1,  q1
-
-        vst1.32         {d0[0]},  [r0,:32], r2
-        vst1.32         {d1[1]},  [r0,:32], r2
-        vst1.32         {d0[1]},  [r0,:32], r2
-        vst1.32         {d1[0]},  [r0,:32], r2
-
-        sub             r1,  r1,  #32
-        bx              lr
-endfunc
-
-function ff_h264_idct_dc_add_neon, export=1
-        mov             r3,       #0
-        vld1.16         {d2[],d3[]}, [r1,:16]
-        strh            r3,       [r1]
-        vrshr.s16       q1,  q1,  #6
-        vld1.32         {d0[0]},  [r0,:32], r2
-        vld1.32         {d0[1]},  [r0,:32], r2
-        vaddw.u8        q2,  q1,  d0
-        vld1.32         {d1[0]},  [r0,:32], r2
-        vld1.32         {d1[1]},  [r0,:32], r2
-        vaddw.u8        q1,  q1,  d1
-        vqmovun.s16     d0,  q2
-        vqmovun.s16     d1,  q1
-        sub             r0,  r0,  r2, lsl #2
-        vst1.32         {d0[0]},  [r0,:32], r2
-        vst1.32         {d0[1]},  [r0,:32], r2
-        vst1.32         {d1[0]},  [r0,:32], r2
-        vst1.32         {d1[1]},  [r0,:32], r2
-        bx              lr
-endfunc
-
-function ff_h264_idct_add16_neon, export=1
-        push            {r4-r8,lr}
-        mov             r4,  r0
-        mov             r5,  r1
-        mov             r1,  r2
-        mov             r2,  r3
-        ldr             r6,  [sp, #24]
-        movrel          r7,  scan8
-        mov             ip,  #16
-1:      ldrb            r8,  [r7], #1
-        ldr             r0,  [r5], #4
-        ldrb            r8,  [r6, r8]
-        subs            r8,  r8,  #1
-        blt             2f
-        ldrsh           lr,  [r1]
-        add             r0,  r0,  r4
-        it              ne
-        movne           lr,  #0
-        cmp             lr,  #0
-        ite             ne
-        adrne           lr,  X(ff_h264_idct_dc_add_neon) + CONFIG_THUMB
-        adreq           lr,  X(ff_h264_idct_add_neon)    + CONFIG_THUMB
-        blx             lr
-2:      subs            ip,  ip,  #1
-        add             r1,  r1,  #32
-        bne             1b
-        pop             {r4-r8,pc}
-endfunc
-
-function ff_h264_idct_add16intra_neon, export=1
-        push            {r4-r8,lr}
-        mov             r4,  r0
-        mov             r5,  r1
-        mov             r1,  r2
-        mov             r2,  r3
-        ldr             r6,  [sp, #24]
-        movrel          r7,  scan8
-        mov             ip,  #16
-1:      ldrb            r8,  [r7], #1
-        ldr             r0,  [r5], #4
-        ldrb            r8,  [r6, r8]
-        add             r0,  r0,  r4
-        cmp             r8,  #0
-        ldrsh           r8,  [r1]
-        iteet           ne
-        adrne           lr,  X(ff_h264_idct_add_neon)    + CONFIG_THUMB
-        adreq           lr,  X(ff_h264_idct_dc_add_neon) + CONFIG_THUMB
-        cmpeq           r8,  #0
-        blxne           lr
-        subs            ip,  ip,  #1
-        add             r1,  r1,  #32
-        bne             1b
-        pop             {r4-r8,pc}
-endfunc
-
-function ff_h264_idct_add8_neon, export=1
-        push            {r4-r10,lr}
-        ldm             r0,  {r4,r9}
-        add             r5,  r1,  #16*4
-        add             r1,  r2,  #16*32
-        mov             r2,  r3
-        mov             r10, r1
-        ldr             r6,  [sp, #32]
-        movrel          r7,  scan8+16
-        mov             r12, #0
-1:      ldrb            r8,  [r7, r12]
-        ldr             r0,  [r5, r12, lsl #2]
-        ldrb            r8,  [r6, r8]
-        add             r0,  r0,  r4
-        add             r1,  r10, r12, lsl #5
-        cmp             r8,  #0
-        ldrsh           r8,  [r1]
-        iteet           ne
-        adrne           lr,  X(ff_h264_idct_add_neon)    + CONFIG_THUMB
-        adreq           lr,  X(ff_h264_idct_dc_add_neon) + CONFIG_THUMB
-        cmpeq           r8,  #0
-        blxne           lr
-        add             r12, r12, #1
-        cmp             r12, #4
-        itt             eq
-        moveq           r12, #16
-        moveq           r4,  r9
-        cmp             r12, #20
-        blt             1b
-        pop             {r4-r10,pc}
-endfunc
-
-.macro  idct8x8_cols    pass
-  .if \pass == 0
-        qa      .req    q2
-        qb      .req    q14
-        vshr.s16        q2,  q10, #1
-        vadd.i16        q0,  q8,  q12
-        vld1.16         {q14-q15},[r1,:128]
-        vst1.16         {q3},     [r1,:128]!
-        vst1.16         {q3},     [r1,:128]!
-        vsub.i16        q1,  q8,  q12
-        vshr.s16        q3,  q14, #1
-        vsub.i16        q2,  q2,  q14
-        vadd.i16        q3,  q3,  q10
-  .else
-        qa      .req    q14
-        qb      .req    q2
-        vtrn.32         q8,  q10
-        vtrn.16         q12, q13
-        vtrn.32         q9,  q11
-        vtrn.32         q12, q2
-        vtrn.32         q13, q15
-        vswp            d21, d4
-        vshr.s16        q14, q10, #1
-        vswp            d17, d24
-        vshr.s16        q3,  q2,  #1
-        vswp            d19, d26
-        vadd.i16        q0,  q8,  q12
-        vswp            d23, d30
-        vsub.i16        q1,  q8,  q12
-        vsub.i16        q14, q14, q2
-        vadd.i16        q3,  q3,  q10
-  .endif
-        vadd.i16        q10, q1,  qa
-        vsub.i16        q12, q1,  qa
-        vadd.i16        q8,  q0,  q3
-        vsub.i16        qb,  q0,  q3
-        vsub.i16        q0,  q13, q11
-        vadd.i16        q1,  q15, q9
-        vsub.i16        qa,  q15, q9
-        vadd.i16        q3,  q13, q11
-        vsub.i16        q0,  q0,  q15
-        vsub.i16        q1,  q1,  q11
-        vadd.i16        qa,  qa,  q13
-        vadd.i16        q3,  q3,  q9
-        vshr.s16        q9,  q9,  #1
-        vshr.s16        q11, q11, #1
-        vshr.s16        q13, q13, #1
-        vshr.s16        q15, q15, #1
-        vsub.i16        q0,  q0,  q15
-        vsub.i16        q1,  q1,  q11
-        vadd.i16        qa,  qa,  q13
-        vadd.i16        q3,  q3,  q9
-        vshr.s16        q9,  q0,  #2
-        vshr.s16        q11, q1,  #2
-        vshr.s16        q13, qa,  #2
-        vshr.s16        q15, q3,  #2
-        vsub.i16        q3,  q3,  q9
-        vsub.i16        qa,  q11, qa
-        vadd.i16        q1,  q1,  q13
-        vadd.i16        q0,  q0,  q15
-  .if \pass == 0
-        vsub.i16        q15, q8,  q3
-        vadd.i16        q8,  q8,  q3
-        vadd.i16        q9,  q10, q2
-        vsub.i16        q2,  q10, q2
-        vtrn.16         q8,  q9
-        vadd.i16        q10, q12, q1
-        vtrn.16         q2,  q15
-        vadd.i16        q11, q14, q0
-        vsub.i16        q13, q12, q1
-        vtrn.16         q10, q11
-        vsub.i16        q12, q14, q0
-  .else
-        vsub.i16        q15, q8,  q3
-        vadd.i16        q8,  q8,  q3
-        vadd.i16        q9,  q10, q14
-        vsub.i16        q14, q10, q14
-        vadd.i16        q10, q12, q1
-        vsub.i16        q13, q12, q1
-        vadd.i16        q11, q2, q0
-        vsub.i16        q12, q2, q0
-  .endif
-        .unreq          qa
-        .unreq          qb
-.endm
-
-function ff_h264_idct8_add_neon, export=1
-        vmov.i16        q3,       #0
-        vld1.16         {q8-q9},  [r1,:128]
-        vst1.16         {q3},     [r1,:128]!
-        vst1.16         {q3},     [r1,:128]!
-        vld1.16         {q10-q11},[r1,:128]
-        vst1.16         {q3},     [r1,:128]!
-        vst1.16         {q3},     [r1,:128]!
-        vld1.16         {q12-q13},[r1,:128]
-        vst1.16         {q3},     [r1,:128]!
-        vst1.16         {q3},     [r1,:128]!
-
-        idct8x8_cols    0
-        idct8x8_cols    1
-
-        mov             r3,  r0
-        vrshr.s16       q8,  q8,  #6
-        vld1.8          {d0},     [r0,:64], r2
-        vrshr.s16       q9,  q9,  #6
-        vld1.8          {d1},     [r0,:64], r2
-        vrshr.s16       q10, q10, #6
-        vld1.8          {d2},     [r0,:64], r2
-        vrshr.s16       q11, q11, #6
-        vld1.8          {d3},     [r0,:64], r2
-        vrshr.s16       q12, q12, #6
-        vld1.8          {d4},     [r0,:64], r2
-        vrshr.s16       q13, q13, #6
-        vld1.8          {d5},     [r0,:64], r2
-        vrshr.s16       q14, q14, #6
-        vld1.8          {d6},     [r0,:64], r2
-        vrshr.s16       q15, q15, #6
-        vld1.8          {d7},     [r0,:64], r2
-        vaddw.u8        q8,  q8,  d0
-        vaddw.u8        q9,  q9,  d1
-        vaddw.u8        q10, q10, d2
-        vqmovun.s16     d0,  q8
-        vaddw.u8        q11, q11, d3
-        vqmovun.s16     d1,  q9
-        vaddw.u8        q12, q12, d4
-        vqmovun.s16     d2,  q10
-        vst1.8          {d0},     [r3,:64], r2
-        vaddw.u8        q13, q13, d5
-        vqmovun.s16     d3,  q11
-        vst1.8          {d1},     [r3,:64], r2
-        vaddw.u8        q14, q14, d6
-        vqmovun.s16     d4,  q12
-        vst1.8          {d2},     [r3,:64], r2
-        vaddw.u8        q15, q15, d7
-        vqmovun.s16     d5,  q13
-        vst1.8          {d3},     [r3,:64], r2
-        vqmovun.s16     d6,  q14
-        vqmovun.s16     d7,  q15
-        vst1.8          {d4},     [r3,:64], r2
-        vst1.8          {d5},     [r3,:64], r2
-        vst1.8          {d6},     [r3,:64], r2
-        vst1.8          {d7},     [r3,:64], r2
-
-        sub             r1,  r1,  #128
-        bx              lr
-endfunc
-
-function ff_h264_idct8_dc_add_neon, export=1
-        mov             r3,       #0
-        vld1.16         {d30[],d31[]},[r1,:16]
-        strh            r3,       [r1]
-        vld1.32         {d0},     [r0,:64], r2
-        vrshr.s16       q15, q15, #6
-        vld1.32         {d1},     [r0,:64], r2
-        vld1.32         {d2},     [r0,:64], r2
-        vaddw.u8        q8,  q15, d0
-        vld1.32         {d3},     [r0,:64], r2
-        vaddw.u8        q9,  q15, d1
-        vld1.32         {d4},     [r0,:64], r2
-        vaddw.u8        q10, q15, d2
-        vld1.32         {d5},     [r0,:64], r2
-        vaddw.u8        q11, q15, d3
-        vld1.32         {d6},     [r0,:64], r2
-        vaddw.u8        q12, q15, d4
-        vld1.32         {d7},     [r0,:64], r2
-        vaddw.u8        q13, q15, d5
-        vaddw.u8        q14, q15, d6
-        vaddw.u8        q15, q15, d7
-        vqmovun.s16     d0,  q8
-        vqmovun.s16     d1,  q9
-        vqmovun.s16     d2,  q10
-        vqmovun.s16     d3,  q11
-        sub             r0,  r0,  r2, lsl #3
-        vst1.32         {d0},     [r0,:64], r2
-        vqmovun.s16     d4,  q12
-        vst1.32         {d1},     [r0,:64], r2
-        vqmovun.s16     d5,  q13
-        vst1.32         {d2},     [r0,:64], r2
-        vqmovun.s16     d6,  q14
-        vst1.32         {d3},     [r0,:64], r2
-        vqmovun.s16     d7,  q15
-        vst1.32         {d4},     [r0,:64], r2
-        vst1.32         {d5},     [r0,:64], r2
-        vst1.32         {d6},     [r0,:64], r2
-        vst1.32         {d7},     [r0,:64], r2
-        bx              lr
-endfunc
-
-function ff_h264_idct8_add4_neon, export=1
-        push            {r4-r8,lr}
-        mov             r4,  r0
-        mov             r5,  r1
-        mov             r1,  r2
-        mov             r2,  r3
-        ldr             r6,  [sp, #24]
-        movrel          r7,  scan8
-        mov             r12, #16
-1:      ldrb            r8,  [r7], #4
-        ldr             r0,  [r5], #16
-        ldrb            r8,  [r6, r8]
-        subs            r8,  r8,  #1
-        blt             2f
-        ldrsh           lr,  [r1]
-        add             r0,  r0,  r4
-        it              ne
-        movne           lr,  #0
-        cmp             lr,  #0
-        ite             ne
-        adrne           lr,  X(ff_h264_idct8_dc_add_neon) + CONFIG_THUMB
-        adreq           lr,  X(ff_h264_idct8_add_neon)    + CONFIG_THUMB
-        blx             lr
-2:      subs            r12, r12, #4
-        add             r1,  r1,  #128
-        bne             1b
-        pop             {r4-r8,pc}
-endfunc
-
-const   scan8
-        .byte           4+ 1*8, 5+ 1*8, 4+ 2*8, 5+ 2*8
-        .byte           6+ 1*8, 7+ 1*8, 6+ 2*8, 7+ 2*8
-        .byte           4+ 3*8, 5+ 3*8, 4+ 4*8, 5+ 4*8
-        .byte           6+ 3*8, 7+ 3*8, 6+ 4*8, 7+ 4*8
-        .byte           4+ 6*8, 5+ 6*8, 4+ 7*8, 5+ 7*8
-        .byte           6+ 6*8, 7+ 6*8, 6+ 7*8, 7+ 7*8
-        .byte           4+ 8*8, 5+ 8*8, 4+ 9*8, 5+ 9*8
-        .byte           6+ 8*8, 7+ 8*8, 6+ 9*8, 7+ 9*8
-        .byte           4+11*8, 5+11*8, 4+12*8, 5+12*8
-        .byte           6+11*8, 7+11*8, 6+12*8, 7+12*8
-        .byte           4+13*8, 5+13*8, 4+14*8, 5+14*8
-        .byte           6+13*8, 7+13*8, 6+14*8, 7+14*8
-endconst
diff --git a/deps/libav/libavcodec/arm/h264pred_init_arm.c b/deps/libav/libavcodec/arm/h264pred_init_arm.c
deleted file mode 100644
index 2e25c2a..0000000
--- a/deps/libav/libavcodec/arm/h264pred_init_arm.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/h264pred.h"
-
-void ff_pred16x16_vert_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred16x16_hor_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred16x16_plane_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred16x16_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred16x16_128_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred16x16_left_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred16x16_top_dc_neon(uint8_t *src, ptrdiff_t stride);
-
-void ff_pred8x8_vert_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_hor_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_plane_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_128_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_left_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_top_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_l0t_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_0lt_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_l00_dc_neon(uint8_t *src, ptrdiff_t stride);
-void ff_pred8x8_0l0_dc_neon(uint8_t *src, ptrdiff_t stride);
-
-static av_cold void h264_pred_init_neon(H264PredContext *h, int codec_id,
-                                        const int bit_depth,
-                                        const int chroma_format_idc)
-{
-    const int high_depth = bit_depth > 8;
-
-    if (high_depth)
-        return;
-
-    h->pred8x8[VERT_PRED8x8     ] = ff_pred8x8_vert_neon;
-    h->pred8x8[HOR_PRED8x8      ] = ff_pred8x8_hor_neon;
-    if (codec_id != AV_CODEC_ID_VP8)
-        h->pred8x8[PLANE_PRED8x8] = ff_pred8x8_plane_neon;
-    h->pred8x8[DC_128_PRED8x8   ] = ff_pred8x8_128_dc_neon;
-    if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8) {
-        h->pred8x8[DC_PRED8x8     ] = ff_pred8x8_dc_neon;
-        h->pred8x8[LEFT_DC_PRED8x8] = ff_pred8x8_left_dc_neon;
-        h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_neon;
-        h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] = ff_pred8x8_l0t_dc_neon;
-        h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] = ff_pred8x8_0lt_dc_neon;
-        h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] = ff_pred8x8_l00_dc_neon;
-        h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] = ff_pred8x8_0l0_dc_neon;
-    }
-
-    h->pred16x16[DC_PRED8x8     ] = ff_pred16x16_dc_neon;
-    h->pred16x16[VERT_PRED8x8   ] = ff_pred16x16_vert_neon;
-    h->pred16x16[HOR_PRED8x8    ] = ff_pred16x16_hor_neon;
-    h->pred16x16[LEFT_DC_PRED8x8] = ff_pred16x16_left_dc_neon;
-    h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_neon;
-    h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_neon;
-    if (codec_id != AV_CODEC_ID_SVQ3 && codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8)
-        h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_neon;
-}
-
-av_cold void ff_h264_pred_init_arm(H264PredContext *h, int codec_id,
-                                   int bit_depth, const int chroma_format_idc)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags))
-        h264_pred_init_neon(h, codec_id, bit_depth, chroma_format_idc);
-}
diff --git a/deps/libav/libavcodec/arm/h264pred_neon.S b/deps/libav/libavcodec/arm/h264pred_neon.S
deleted file mode 100644
index 332f94b..0000000
--- a/deps/libav/libavcodec/arm/h264pred_neon.S
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-        .macro ldcol.8  rd,  rs,  rt,  n=8,  hi=0
-.if \n == 8 || \hi == 0
-        vld1.8          {\rd[0]}, [\rs], \rt
-        vld1.8          {\rd[1]}, [\rs], \rt
-        vld1.8          {\rd[2]}, [\rs], \rt
-        vld1.8          {\rd[3]}, [\rs], \rt
-.endif
-.if \n == 8 || \hi == 1
-        vld1.8          {\rd[4]}, [\rs], \rt
-        vld1.8          {\rd[5]}, [\rs], \rt
-        vld1.8          {\rd[6]}, [\rs], \rt
-        vld1.8          {\rd[7]}, [\rs], \rt
-.endif
-        .endm
-
-        .macro add16x8  dq,  dl,  dh,  rl,  rh
-        vaddl.u8        \dq, \rl, \rh
-        vadd.u16        \dl, \dl, \dh
-        vpadd.u16       \dl, \dl, \dl
-        vpadd.u16       \dl, \dl, \dl
-        .endm
-
-function ff_pred16x16_128_dc_neon, export=1
-        vmov.i8         q0,  #128
-        b               .L_pred16x16_dc_end
-endfunc
-
-function ff_pred16x16_top_dc_neon, export=1
-        sub             r2,  r0,  r1
-        vld1.8          {q0},     [r2,:128]
-        add16x8         q0,  d0,  d1,  d0,  d1
-        vrshrn.u16      d0,  q0,  #4
-        vdup.8          q0,  d0[0]
-        b               .L_pred16x16_dc_end
-endfunc
-
-function ff_pred16x16_left_dc_neon, export=1
-        sub             r2,  r0,  #1
-        ldcol.8         d0,  r2,  r1
-        ldcol.8         d1,  r2,  r1
-        add16x8         q0,  d0,  d1,  d0,  d1
-        vrshrn.u16      d0,  q0,  #4
-        vdup.8          q0,  d0[0]
-        b               .L_pred16x16_dc_end
-endfunc
-
-function ff_pred16x16_dc_neon, export=1
-        sub             r2,  r0,  r1
-        vld1.8          {q0},     [r2,:128]
-        sub             r2,  r0,  #1
-        ldcol.8         d2,  r2,  r1
-        ldcol.8         d3,  r2,  r1
-        vaddl.u8        q0,  d0,  d1
-        vaddl.u8        q1,  d2,  d3
-        vadd.u16        q0,  q0,  q1
-        vadd.u16        d0,  d0,  d1
-        vpadd.u16       d0,  d0,  d0
-        vpadd.u16       d0,  d0,  d0
-        vrshrn.u16      d0,  q0,  #5
-        vdup.8          q0,  d0[0]
-.L_pred16x16_dc_end:
-        mov             r3,  #8
-6:      vst1.8          {q0},     [r0,:128], r1
-        vst1.8          {q0},     [r0,:128], r1
-        subs            r3,  r3,  #1
-        bne             6b
-        bx              lr
-endfunc
-
-function ff_pred16x16_hor_neon, export=1
-        sub             r2,  r0,  #1
-        mov             r3,  #16
-1:      vld1.8          {d0[],d1[]},[r2],      r1
-        vst1.8          {q0},       [r0,:128], r1
-        subs            r3,  r3,  #1
-        bne             1b
-        bx              lr
-endfunc
-
-function ff_pred16x16_vert_neon, export=1
-        sub             r0,  r0,  r1
-        vld1.8          {q0},     [r0,:128], r1
-        mov             r3,  #8
-1:      vst1.8          {q0},     [r0,:128], r1
-        vst1.8          {q0},     [r0,:128], r1
-        subs            r3,  r3,  #1
-        bne             1b
-        bx              lr
-endfunc
-
-function ff_pred16x16_plane_neon, export=1
-        sub             r3,  r0,  r1
-        add             r2,  r3,  #8
-        sub             r3,  r3,  #1
-        vld1.8          {d0},     [r3]
-        vld1.8          {d2},     [r2,:64], r1
-        ldcol.8         d1,  r3,  r1
-        add             r3,  r3,  r1
-        ldcol.8         d3,  r3,  r1
-        vrev64.8        q0,  q0
-        vaddl.u8        q8,  d2,  d3
-        vsubl.u8        q2,  d2,  d0
-        vsubl.u8        q3,  d3,  d1
-        movrel          r3,  p16weight
-        vld1.8          {q0},     [r3,:128]
-        vmul.s16        q2,  q2,  q0
-        vmul.s16        q3,  q3,  q0
-        vadd.i16        d4,  d4,  d5
-        vadd.i16        d5,  d6,  d7
-        vpadd.i16       d4,  d4,  d5
-        vpadd.i16       d4,  d4,  d4
-        vshll.s16       q3,  d4,  #2
-        vaddw.s16       q2,  q3,  d4
-        vrshrn.s32      d4,  q2,  #6
-        mov             r3,  #0
-        vtrn.16         d4,  d5
-        vadd.i16        d2,  d4,  d5
-        vshl.i16        d3,  d2,  #3
-        vrev64.16       d16, d17
-        vsub.i16        d3,  d3,  d2
-        vadd.i16        d16, d16, d0
-        vshl.i16        d2,  d16, #4
-        vsub.i16        d2,  d2,  d3
-        vshl.i16        d3,  d4,  #4
-        vext.16         q0,  q0,  q0,  #7
-        vsub.i16        d6,  d5,  d3
-        vmov.16         d0[0], r3
-        vmul.i16        q0,  q0,  d4[0]
-        vdup.16         q1,  d2[0]
-        vdup.16         q2,  d4[0]
-        vdup.16         q3,  d6[0]
-        vshl.i16        q2,  q2,  #3
-        vadd.i16        q1,  q1,  q0
-        vadd.i16        q3,  q3,  q2
-        mov             r3,  #16
-1:
-        vqshrun.s16     d0,  q1,  #5
-        vadd.i16        q1,  q1,  q2
-        vqshrun.s16     d1,  q1,  #5
-        vadd.i16        q1,  q1,  q3
-        vst1.8          {q0},     [r0,:128], r1
-        subs            r3,  r3,  #1
-        bne             1b
-        bx              lr
-endfunc
-
-const   p16weight, align=4
-        .short          1,2,3,4,5,6,7,8
-endconst
-
-function ff_pred8x8_hor_neon, export=1
-        sub             r2,  r0,  #1
-        mov             r3,  #8
-1:      vld1.8          {d0[]},   [r2],     r1
-        vst1.8          {d0},     [r0,:64], r1
-        subs            r3,  r3,  #1
-        bne             1b
-        bx              lr
-endfunc
-
-function ff_pred8x8_vert_neon, export=1
-        sub             r0,  r0,  r1
-        vld1.8          {d0},     [r0,:64], r1
-        mov             r3,  #4
-1:      vst1.8          {d0},     [r0,:64], r1
-        vst1.8          {d0},     [r0,:64], r1
-        subs            r3,  r3,  #1
-        bne             1b
-        bx              lr
-endfunc
-
-function ff_pred8x8_plane_neon, export=1
-        sub             r3,  r0,  r1
-        add             r2,  r3,  #4
-        sub             r3,  r3,  #1
-        vld1.32         {d0[0]},  [r3]
-        vld1.32         {d2[0]},  [r2,:32], r1
-        ldcol.8         d0,  r3,  r1,  4,  hi=1
-        add             r3,  r3,  r1
-        ldcol.8         d3,  r3,  r1,  4
-        vaddl.u8        q8,  d2,  d3
-        vrev32.8        d0,  d0
-        vtrn.32         d2,  d3
-        vsubl.u8        q2,  d2,  d0
-        movrel          r3,  p16weight
-        vld1.16         {q0},     [r3,:128]
-        vmul.s16        d4,  d4,  d0
-        vmul.s16        d5,  d5,  d0
-        vpadd.i16       d4,  d4,  d5
-        vpaddl.s16      d4,  d4
-        vshl.i32        d5,  d4,  #4
-        vadd.s32        d4,  d4,  d5
-        vrshrn.s32      d4,  q2,  #5
-        mov             r3,  #0
-        vtrn.16         d4,  d5
-        vadd.i16        d2,  d4,  d5
-        vshl.i16        d3,  d2,  #2
-        vrev64.16       d16, d16
-        vsub.i16        d3,  d3,  d2
-        vadd.i16        d16, d16, d0
-        vshl.i16        d2,  d16, #4
-        vsub.i16        d2,  d2,  d3
-        vshl.i16        d3,  d4,  #3
-        vext.16         q0,  q0,  q0,  #7
-        vsub.i16        d6,  d5,  d3
-        vmov.16         d0[0], r3
-        vmul.i16        q0,  q0,  d4[0]
-        vdup.16         q1,  d2[0]
-        vdup.16         q2,  d4[0]
-        vdup.16         q3,  d6[0]
-        vshl.i16        q2,  q2,  #3
-        vadd.i16        q1,  q1,  q0
-        vadd.i16        q3,  q3,  q2
-        mov             r3,  #8
-1:
-        vqshrun.s16     d0,  q1,  #5
-        vadd.i16        q1,  q1,  q3
-        vst1.8          {d0},     [r0,:64], r1
-        subs            r3,  r3,  #1
-        bne             1b
-        bx              lr
-endfunc
-
-function ff_pred8x8_128_dc_neon, export=1
-        vmov.i8         q0,  #128
-        b               .L_pred8x8_dc_end
-endfunc
-
-function ff_pred8x8_top_dc_neon, export=1
-        sub             r2,  r0,  r1
-        vld1.8          {d0},     [r2,:64]
-        vpaddl.u8       d0,  d0
-        vpadd.u16       d0,  d0,  d0
-        vrshrn.u16      d0,  q0,  #2
-        vdup.8          d1,  d0[1]
-        vdup.8          d0,  d0[0]
-        vtrn.32         d0,  d1
-        b               .L_pred8x8_dc_end
-endfunc
-
-function ff_pred8x8_left_dc_neon, export=1
-        sub             r2,  r0,  #1
-        ldcol.8         d0,  r2,  r1
-        vpaddl.u8       d0,  d0
-        vpadd.u16       d0,  d0,  d0
-        vrshrn.u16      d0,  q0,  #2
-        vdup.8          d1,  d0[1]
-        vdup.8          d0,  d0[0]
-        b               .L_pred8x8_dc_end
-endfunc
-
-function ff_pred8x8_dc_neon, export=1
-        sub             r2,  r0,  r1
-        vld1.8          {d0},     [r2,:64]
-        sub             r2,  r0,  #1
-        ldcol.8         d1,  r2,  r1
-        vtrn.32         d0,  d1
-        vpaddl.u8       q0,  q0
-        vpadd.u16       d0,  d0,  d1
-        vpadd.u16       d1,  d0,  d0
-        vrshrn.u16      d2,  q0,  #3
-        vrshrn.u16      d3,  q0,  #2
-        vdup.8          d0,  d2[4]
-        vdup.8          d1,  d3[3]
-        vdup.8          d4,  d3[2]
-        vdup.8          d5,  d2[5]
-        vtrn.32         q0,  q2
-.L_pred8x8_dc_end:
-        mov             r3,  #4
-        add             r2,  r0,  r1,  lsl #2
-6:      vst1.8          {d0},     [r0,:64], r1
-        vst1.8          {d1},     [r2,:64], r1
-        subs            r3,  r3,  #1
-        bne             6b
-        bx              lr
-endfunc
-
-function ff_pred8x8_l0t_dc_neon, export=1
-        sub             r2,  r0,  r1
-        vld1.8          {d0},     [r2,:64]
-        sub             r2,  r0,  #1
-        ldcol.8         d1,  r2,  r1,  4
-        vtrn.32         d0,  d1
-        vpaddl.u8       q0,  q0
-        vpadd.u16       d0,  d0,  d1
-        vpadd.u16       d1,  d0,  d0
-        vrshrn.u16      d2,  q0,  #3
-        vrshrn.u16      d3,  q0,  #2
-        vdup.8          d0,  d2[4]
-        vdup.8          d1,  d3[0]
-        vdup.8          q2,  d3[2]
-        vtrn.32         q0,  q2
-        b               .L_pred8x8_dc_end
-endfunc
-
-function ff_pred8x8_l00_dc_neon, export=1
-        sub             r2,  r0,  #1
-        ldcol.8         d0,  r2,  r1,  4
-        vpaddl.u8       d0,  d0
-        vpadd.u16       d0,  d0,  d0
-        vrshrn.u16      d0,  q0,  #2
-        vmov.i8         d1,  #128
-        vdup.8          d0,  d0[0]
-        b               .L_pred8x8_dc_end
-endfunc
-
-function ff_pred8x8_0lt_dc_neon, export=1
-        sub             r2,  r0,  r1
-        vld1.8          {d0},     [r2,:64]
-        add             r2,  r0,  r1,  lsl #2
-        sub             r2,  r2,  #1
-        ldcol.8         d1,  r2,  r1,  4,  hi=1
-        vtrn.32         d0,  d1
-        vpaddl.u8       q0,  q0
-        vpadd.u16       d0,  d0,  d1
-        vpadd.u16       d1,  d0,  d0
-        vrshrn.u16      d3,  q0,  #2
-        vrshrn.u16      d2,  q0,  #3
-        vdup.8          d0,  d3[0]
-        vdup.8          d1,  d3[3]
-        vdup.8          d4,  d3[2]
-        vdup.8          d5,  d2[5]
-        vtrn.32         q0,  q2
-        b               .L_pred8x8_dc_end
-endfunc
-
-function ff_pred8x8_0l0_dc_neon, export=1
-        add             r2,  r0,  r1,  lsl #2
-        sub             r2,  r2,  #1
-        ldcol.8         d1,  r2,  r1,  4
-        vpaddl.u8       d2,  d1
-        vpadd.u16       d2,  d2,  d2
-        vrshrn.u16      d1,  q1,  #2
-        vmov.i8         d0,  #128
-        vdup.8          d1,  d1[0]
-        b               .L_pred8x8_dc_end
-endfunc
diff --git a/deps/libav/libavcodec/arm/h264qpel_init_arm.c b/deps/libav/libavcodec/arm/h264qpel_init_arm.c
deleted file mode 100644
index a232689..0000000
--- a/deps/libav/libavcodec/arm/h264qpel_init_arm.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/h264qpel.h"
-
-void ff_put_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc20_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc30_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc01_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc11_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc21_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc31_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc02_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc12_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc22_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc32_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc03_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc13_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc23_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel16_mc33_neon(uint8_t *, uint8_t *, ptrdiff_t);
-
-void ff_put_h264_qpel8_mc00_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc10_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc20_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc30_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc01_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc11_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc21_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc31_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc02_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc12_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc22_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc32_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc03_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc13_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc23_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_put_h264_qpel8_mc33_neon(uint8_t *, uint8_t *, ptrdiff_t);
-
-void ff_avg_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc20_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc30_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc01_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc11_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc21_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc31_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc02_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc12_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc22_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc32_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc03_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc13_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc23_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel16_mc33_neon(uint8_t *, uint8_t *, ptrdiff_t);
-
-void ff_avg_h264_qpel8_mc00_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc10_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc20_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc30_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc01_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc11_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc21_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc31_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc02_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc12_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc22_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc32_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc03_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc13_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc23_neon(uint8_t *, uint8_t *, ptrdiff_t);
-void ff_avg_h264_qpel8_mc33_neon(uint8_t *, uint8_t *, ptrdiff_t);
-
-av_cold void ff_h264qpel_init_arm(H264QpelContext *c, int bit_depth)
-{
-    const int high_bit_depth = bit_depth > 8;
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags) && !high_bit_depth) {
-        c->put_h264_qpel_pixels_tab[0][ 0] = ff_put_h264_qpel16_mc00_neon;
-        c->put_h264_qpel_pixels_tab[0][ 1] = ff_put_h264_qpel16_mc10_neon;
-        c->put_h264_qpel_pixels_tab[0][ 2] = ff_put_h264_qpel16_mc20_neon;
-        c->put_h264_qpel_pixels_tab[0][ 3] = ff_put_h264_qpel16_mc30_neon;
-        c->put_h264_qpel_pixels_tab[0][ 4] = ff_put_h264_qpel16_mc01_neon;
-        c->put_h264_qpel_pixels_tab[0][ 5] = ff_put_h264_qpel16_mc11_neon;
-        c->put_h264_qpel_pixels_tab[0][ 6] = ff_put_h264_qpel16_mc21_neon;
-        c->put_h264_qpel_pixels_tab[0][ 7] = ff_put_h264_qpel16_mc31_neon;
-        c->put_h264_qpel_pixels_tab[0][ 8] = ff_put_h264_qpel16_mc02_neon;
-        c->put_h264_qpel_pixels_tab[0][ 9] = ff_put_h264_qpel16_mc12_neon;
-        c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_neon;
-        c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_neon;
-        c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_neon;
-        c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_neon;
-        c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_neon;
-        c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_neon;
-
-        c->put_h264_qpel_pixels_tab[1][ 0] = ff_put_h264_qpel8_mc00_neon;
-        c->put_h264_qpel_pixels_tab[1][ 1] = ff_put_h264_qpel8_mc10_neon;
-        c->put_h264_qpel_pixels_tab[1][ 2] = ff_put_h264_qpel8_mc20_neon;
-        c->put_h264_qpel_pixels_tab[1][ 3] = ff_put_h264_qpel8_mc30_neon;
-        c->put_h264_qpel_pixels_tab[1][ 4] = ff_put_h264_qpel8_mc01_neon;
-        c->put_h264_qpel_pixels_tab[1][ 5] = ff_put_h264_qpel8_mc11_neon;
-        c->put_h264_qpel_pixels_tab[1][ 6] = ff_put_h264_qpel8_mc21_neon;
-        c->put_h264_qpel_pixels_tab[1][ 7] = ff_put_h264_qpel8_mc31_neon;
-        c->put_h264_qpel_pixels_tab[1][ 8] = ff_put_h264_qpel8_mc02_neon;
-        c->put_h264_qpel_pixels_tab[1][ 9] = ff_put_h264_qpel8_mc12_neon;
-        c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_neon;
-        c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_neon;
-        c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_neon;
-        c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_neon;
-        c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_neon;
-        c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_neon;
-
-        c->avg_h264_qpel_pixels_tab[0][ 0] = ff_avg_h264_qpel16_mc00_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 1] = ff_avg_h264_qpel16_mc10_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 2] = ff_avg_h264_qpel16_mc20_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 3] = ff_avg_h264_qpel16_mc30_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 4] = ff_avg_h264_qpel16_mc01_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 5] = ff_avg_h264_qpel16_mc11_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 6] = ff_avg_h264_qpel16_mc21_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 7] = ff_avg_h264_qpel16_mc31_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 8] = ff_avg_h264_qpel16_mc02_neon;
-        c->avg_h264_qpel_pixels_tab[0][ 9] = ff_avg_h264_qpel16_mc12_neon;
-        c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_neon;
-        c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_neon;
-        c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_neon;
-        c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_neon;
-        c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_neon;
-        c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_neon;
-
-        c->avg_h264_qpel_pixels_tab[1][ 0] = ff_avg_h264_qpel8_mc00_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 1] = ff_avg_h264_qpel8_mc10_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 2] = ff_avg_h264_qpel8_mc20_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 3] = ff_avg_h264_qpel8_mc30_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 4] = ff_avg_h264_qpel8_mc01_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 5] = ff_avg_h264_qpel8_mc11_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 6] = ff_avg_h264_qpel8_mc21_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 7] = ff_avg_h264_qpel8_mc31_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 8] = ff_avg_h264_qpel8_mc02_neon;
-        c->avg_h264_qpel_pixels_tab[1][ 9] = ff_avg_h264_qpel8_mc12_neon;
-        c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_neon;
-        c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_neon;
-        c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_neon;
-        c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_neon;
-        c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_neon;
-        c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/h264qpel_neon.S b/deps/libav/libavcodec/arm/h264qpel_neon.S
deleted file mode 100644
index 6c51250..0000000
--- a/deps/libav/libavcodec/arm/h264qpel_neon.S
+++ /dev/null
@@ -1,955 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-#include "neon.S"
-
-        /* H.264 qpel MC */
-
-.macro  lowpass_const   r
-        movw            \r,  #5
-        movt            \r,  #20
-        vmov.32         d6[0], \r
-.endm
-
-.macro  lowpass_8       r0,  r1,  r2,  r3,  d0,  d1,  narrow=1
-  .if \narrow
-        t0 .req q0
-        t1 .req q8
-  .else
-        t0 .req \d0
-        t1 .req \d1
-  .endif
-        vext.8          d2,  \r0, \r1, #2
-        vext.8          d3,  \r0, \r1, #3
-        vaddl.u8        q1,  d2,  d3
-        vext.8          d4,  \r0, \r1, #1
-        vext.8          d5,  \r0, \r1, #4
-        vaddl.u8        q2,  d4,  d5
-        vext.8          d30, \r0, \r1, #5
-        vaddl.u8        t0,  \r0, d30
-        vext.8          d18, \r2, \r3, #2
-        vmla.i16        t0,  q1,  d6[1]
-        vext.8          d19, \r2, \r3, #3
-        vaddl.u8        q9,  d18, d19
-        vext.8          d20, \r2, \r3, #1
-        vmls.i16        t0,  q2,  d6[0]
-        vext.8          d21, \r2, \r3, #4
-        vaddl.u8        q10, d20, d21
-        vext.8          d31, \r2, \r3, #5
-        vaddl.u8        t1,  \r2, d31
-        vmla.i16        t1,  q9,  d6[1]
-        vmls.i16        t1,  q10, d6[0]
-  .if \narrow
-        vqrshrun.s16    \d0, t0,  #5
-        vqrshrun.s16    \d1, t1,  #5
-  .endif
-        .unreq  t0
-        .unreq  t1
-.endm
-
-.macro  lowpass_8_1     r0,  r1,  d0,  narrow=1
-  .if \narrow
-        t0 .req q0
-  .else
-        t0 .req \d0
-  .endif
-        vext.8          d2,  \r0, \r1, #2
-        vext.8          d3,  \r0, \r1, #3
-        vaddl.u8        q1,  d2,  d3
-        vext.8          d4,  \r0, \r1, #1
-        vext.8          d5,  \r0, \r1, #4
-        vaddl.u8        q2,  d4,  d5
-        vext.8          d30, \r0, \r1, #5
-        vaddl.u8        t0,  \r0, d30
-        vmla.i16        t0,  q1,  d6[1]
-        vmls.i16        t0,  q2,  d6[0]
-  .if \narrow
-        vqrshrun.s16    \d0, t0,  #5
-  .endif
-        .unreq  t0
-.endm
-
-.macro  lowpass_8.16    r0,  r1,  l0,  h0,  l1,  h1,  d
-        vext.16         q1,  \r0, \r1, #2
-        vext.16         q0,  \r0, \r1, #3
-        vaddl.s16       q9,  d2,  d0
-        vext.16         q2,  \r0, \r1, #1
-        vaddl.s16       q1,  d3,  d1
-        vext.16         q3,  \r0, \r1, #4
-        vaddl.s16       q10, d4,  d6
-        vext.16         \r1, \r0, \r1, #5
-        vaddl.s16       q2,  d5,  d7
-        vaddl.s16       q0,  \h0, \h1
-        vaddl.s16       q8,  \l0, \l1
-
-        vshl.i32        q3,  q9,  #4
-        vshl.i32        q9,  q9,  #2
-        vshl.i32        q15, q10, #2
-        vadd.i32        q9,  q9,  q3
-        vadd.i32        q10, q10, q15
-
-        vshl.i32        q3,  q1,  #4
-        vshl.i32        q1,  q1,  #2
-        vshl.i32        q15, q2,  #2
-        vadd.i32        q1,  q1,  q3
-        vadd.i32        q2,  q2,  q15
-
-        vadd.i32        q9,  q9,  q8
-        vsub.i32        q9,  q9,  q10
-
-        vadd.i32        q1,  q1,  q0
-        vsub.i32        q1,  q1,  q2
-
-        vrshrn.s32      d18, q9,  #10
-        vrshrn.s32      d19, q1,  #10
-
-        vqmovun.s16     \d,  q9
-.endm
-
-function put_h264_qpel16_h_lowpass_neon_packed
-        mov             r4,  lr
-        mov             r12, #16
-        mov             r3,  #8
-        bl              put_h264_qpel8_h_lowpass_neon
-        sub             r1,  r1,  r2, lsl #4
-        add             r1,  r1,  #8
-        mov             r12, #16
-        mov             lr,  r4
-        b               put_h264_qpel8_h_lowpass_neon
-endfunc
-
-.macro  h264_qpel_h_lowpass type
-function \type\()_h264_qpel16_h_lowpass_neon
-        push            {lr}
-        mov             r12, #16
-        bl              \type\()_h264_qpel8_h_lowpass_neon
-        sub             r0,  r0,  r3, lsl #4
-        sub             r1,  r1,  r2, lsl #4
-        add             r0,  r0,  #8
-        add             r1,  r1,  #8
-        mov             r12, #16
-        pop             {lr}
-endfunc
-
-function \type\()_h264_qpel8_h_lowpass_neon
-1:      vld1.8          {d0, d1},  [r1], r2
-        vld1.8          {d16,d17}, [r1], r2
-        subs            r12, r12, #2
-        lowpass_8       d0,  d1,  d16, d17, d0,  d16
-  .ifc \type,avg
-        vld1.8          {d2},     [r0,:64], r3
-        vrhadd.u8       d0,  d0,  d2
-        vld1.8          {d3},     [r0,:64]
-        vrhadd.u8       d16, d16, d3
-        sub             r0,  r0,  r3
-  .endif
-        vst1.8          {d0},     [r0,:64], r3
-        vst1.8          {d16},    [r0,:64], r3
-        bne             1b
-        bx              lr
-endfunc
-.endm
-
-        h264_qpel_h_lowpass put
-        h264_qpel_h_lowpass avg
-
-.macro  h264_qpel_h_lowpass_l2 type
-function \type\()_h264_qpel16_h_lowpass_l2_neon
-        push            {lr}
-        mov             r12, #16
-        bl              \type\()_h264_qpel8_h_lowpass_l2_neon
-        sub             r0,  r0,  r2, lsl #4
-        sub             r1,  r1,  r2, lsl #4
-        sub             r3,  r3,  r2, lsl #4
-        add             r0,  r0,  #8
-        add             r1,  r1,  #8
-        add             r3,  r3,  #8
-        mov             r12, #16
-        pop             {lr}
-endfunc
-
-function \type\()_h264_qpel8_h_lowpass_l2_neon
-1:      vld1.8          {d0, d1},  [r1], r2
-        vld1.8          {d16,d17}, [r1], r2
-        vld1.8          {d28},     [r3], r2
-        vld1.8          {d29},     [r3], r2
-        subs            r12, r12, #2
-        lowpass_8       d0,  d1,  d16, d17, d0,  d1
-        vrhadd.u8       q0,  q0,  q14
-  .ifc \type,avg
-        vld1.8          {d2},      [r0,:64], r2
-        vrhadd.u8       d0,  d0,  d2
-        vld1.8          {d3},      [r0,:64]
-        vrhadd.u8       d1,  d1,  d3
-        sub             r0,  r0,  r2
-  .endif
-        vst1.8          {d0},      [r0,:64], r2
-        vst1.8          {d1},      [r0,:64], r2
-        bne             1b
-        bx              lr
-endfunc
-.endm
-
-        h264_qpel_h_lowpass_l2 put
-        h264_qpel_h_lowpass_l2 avg
-
-function put_h264_qpel16_v_lowpass_neon_packed
-        mov             r4,  lr
-        mov             r2,  #8
-        bl              put_h264_qpel8_v_lowpass_neon
-        sub             r1,  r1,  r3, lsl #2
-        bl              put_h264_qpel8_v_lowpass_neon
-        sub             r1,  r1,  r3, lsl #4
-        sub             r1,  r1,  r3, lsl #2
-        add             r1,  r1,  #8
-        bl              put_h264_qpel8_v_lowpass_neon
-        sub             r1,  r1,  r3, lsl #2
-        mov             lr,  r4
-        b               put_h264_qpel8_v_lowpass_neon
-endfunc
-
-.macro  h264_qpel_v_lowpass type
-function \type\()_h264_qpel16_v_lowpass_neon
-        mov             r4,  lr
-        bl              \type\()_h264_qpel8_v_lowpass_neon
-        sub             r1,  r1,  r3, lsl #2
-        bl              \type\()_h264_qpel8_v_lowpass_neon
-        sub             r0,  r0,  r2, lsl #4
-        add             r0,  r0,  #8
-        sub             r1,  r1,  r3, lsl #4
-        sub             r1,  r1,  r3, lsl #2
-        add             r1,  r1,  #8
-        bl              \type\()_h264_qpel8_v_lowpass_neon
-        sub             r1,  r1,  r3, lsl #2
-        mov             lr,  r4
-endfunc
-
-function \type\()_h264_qpel8_v_lowpass_neon
-        vld1.8          {d8},  [r1], r3
-        vld1.8          {d10}, [r1], r3
-        vld1.8          {d12}, [r1], r3
-        vld1.8          {d14}, [r1], r3
-        vld1.8          {d22}, [r1], r3
-        vld1.8          {d24}, [r1], r3
-        vld1.8          {d26}, [r1], r3
-        vld1.8          {d28}, [r1], r3
-        vld1.8          {d9},  [r1], r3
-        vld1.8          {d11}, [r1], r3
-        vld1.8          {d13}, [r1], r3
-        vld1.8          {d15}, [r1], r3
-        vld1.8          {d23}, [r1]
-
-        transpose_8x8   q4,  q5,  q6,  q7,  q11, q12, q13, q14
-        lowpass_8       d8,  d9,  d10, d11, d8,  d10
-        lowpass_8       d12, d13, d14, d15, d12, d14
-        lowpass_8       d22, d23, d24, d25, d22, d24
-        lowpass_8       d26, d27, d28, d29, d26, d28
-        transpose_8x8   d8,  d10, d12, d14, d22, d24, d26, d28
-
-  .ifc \type,avg
-        vld1.8          {d9},  [r0,:64], r2
-        vrhadd.u8       d8,  d8,  d9
-        vld1.8          {d11}, [r0,:64], r2
-        vrhadd.u8       d10, d10, d11
-        vld1.8          {d13}, [r0,:64], r2
-        vrhadd.u8       d12, d12, d13
-        vld1.8          {d15}, [r0,:64], r2
-        vrhadd.u8       d14, d14, d15
-        vld1.8          {d23}, [r0,:64], r2
-        vrhadd.u8       d22, d22, d23
-        vld1.8          {d25}, [r0,:64], r2
-        vrhadd.u8       d24, d24, d25
-        vld1.8          {d27}, [r0,:64], r2
-        vrhadd.u8       d26, d26, d27
-        vld1.8          {d29}, [r0,:64], r2
-        vrhadd.u8       d28, d28, d29
-        sub             r0,  r0,  r2,  lsl #3
-  .endif
-
-        vst1.8          {d8},  [r0,:64], r2
-        vst1.8          {d10}, [r0,:64], r2
-        vst1.8          {d12}, [r0,:64], r2
-        vst1.8          {d14}, [r0,:64], r2
-        vst1.8          {d22}, [r0,:64], r2
-        vst1.8          {d24}, [r0,:64], r2
-        vst1.8          {d26}, [r0,:64], r2
-        vst1.8          {d28}, [r0,:64], r2
-
-        bx              lr
-endfunc
-.endm
-
-        h264_qpel_v_lowpass put
-        h264_qpel_v_lowpass avg
-
-.macro  h264_qpel_v_lowpass_l2 type
-function \type\()_h264_qpel16_v_lowpass_l2_neon
-        mov             r4,  lr
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        sub             r1,  r1,  r3, lsl #2
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        sub             r0,  r0,  r3, lsl #4
-        sub             r12, r12, r2, lsl #4
-        add             r0,  r0,  #8
-        add             r12, r12, #8
-        sub             r1,  r1,  r3, lsl #4
-        sub             r1,  r1,  r3, lsl #2
-        add             r1,  r1,  #8
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        sub             r1,  r1,  r3, lsl #2
-        mov             lr,  r4
-endfunc
-
-function \type\()_h264_qpel8_v_lowpass_l2_neon
-        vld1.8          {d8},  [r1], r3
-        vld1.8          {d10}, [r1], r3
-        vld1.8          {d12}, [r1], r3
-        vld1.8          {d14}, [r1], r3
-        vld1.8          {d22}, [r1], r3
-        vld1.8          {d24}, [r1], r3
-        vld1.8          {d26}, [r1], r3
-        vld1.8          {d28}, [r1], r3
-        vld1.8          {d9},  [r1], r3
-        vld1.8          {d11}, [r1], r3
-        vld1.8          {d13}, [r1], r3
-        vld1.8          {d15}, [r1], r3
-        vld1.8          {d23}, [r1]
-
-        transpose_8x8   q4,  q5,  q6,  q7,  q11, q12, q13, q14
-        lowpass_8       d8,  d9,  d10, d11, d8,  d9
-        lowpass_8       d12, d13, d14, d15, d12, d13
-        lowpass_8       d22, d23, d24, d25, d22, d23
-        lowpass_8       d26, d27, d28, d29, d26, d27
-        transpose_8x8   d8,  d9,  d12, d13, d22, d23, d26, d27
-
-        vld1.8          {d0},  [r12], r2
-        vld1.8          {d1},  [r12], r2
-        vld1.8          {d2},  [r12], r2
-        vld1.8          {d3},  [r12], r2
-        vld1.8          {d4},  [r12], r2
-        vrhadd.u8       q0,  q0,  q4
-        vld1.8          {d5},  [r12], r2
-        vrhadd.u8       q1,  q1,  q6
-        vld1.8          {d10}, [r12], r2
-        vrhadd.u8       q2,  q2,  q11
-        vld1.8          {d11}, [r12], r2
-        vrhadd.u8       q5,  q5,  q13
-
-  .ifc \type,avg
-        vld1.8          {d16}, [r0,:64], r3
-        vrhadd.u8       d0,  d0,  d16
-        vld1.8          {d17}, [r0,:64], r3
-        vrhadd.u8       d1,  d1,  d17
-        vld1.8          {d16}, [r0,:64], r3
-        vrhadd.u8       d2,  d2,  d16
-        vld1.8          {d17}, [r0,:64], r3
-        vrhadd.u8       d3,  d3,  d17
-        vld1.8          {d16}, [r0,:64], r3
-        vrhadd.u8       d4,  d4,  d16
-        vld1.8          {d17}, [r0,:64], r3
-        vrhadd.u8       d5,  d5,  d17
-        vld1.8          {d16}, [r0,:64], r3
-        vrhadd.u8       d10, d10, d16
-        vld1.8          {d17}, [r0,:64], r3
-        vrhadd.u8       d11, d11, d17
-        sub             r0,  r0,  r3,  lsl #3
-  .endif
-
-        vst1.8          {d0},  [r0,:64], r3
-        vst1.8          {d1},  [r0,:64], r3
-        vst1.8          {d2},  [r0,:64], r3
-        vst1.8          {d3},  [r0,:64], r3
-        vst1.8          {d4},  [r0,:64], r3
-        vst1.8          {d5},  [r0,:64], r3
-        vst1.8          {d10}, [r0,:64], r3
-        vst1.8          {d11}, [r0,:64], r3
-
-        bx              lr
-endfunc
-.endm
-
-        h264_qpel_v_lowpass_l2 put
-        h264_qpel_v_lowpass_l2 avg
-
-function put_h264_qpel8_hv_lowpass_neon_top
-        lowpass_const   r12
-        mov             r12, #12
-1:      vld1.8          {d0, d1},  [r1], r3
-        vld1.8          {d16,d17}, [r1], r3
-        subs            r12, r12, #2
-        lowpass_8       d0,  d1,  d16, d17, q11, q12, narrow=0
-        vst1.8          {d22-d25}, [r4,:128]!
-        bne             1b
-
-        vld1.8          {d0, d1},  [r1]
-        lowpass_8_1     d0,  d1,  q12, narrow=0
-
-        mov             r12, #-16
-        add             r4,  r4,  r12
-        vld1.8          {d30,d31}, [r4,:128], r12
-        vld1.8          {d20,d21}, [r4,:128], r12
-        vld1.8          {d18,d19}, [r4,:128], r12
-        vld1.8          {d16,d17}, [r4,:128], r12
-        vld1.8          {d14,d15}, [r4,:128], r12
-        vld1.8          {d12,d13}, [r4,:128], r12
-        vld1.8          {d10,d11}, [r4,:128], r12
-        vld1.8          {d8, d9},  [r4,:128], r12
-        vld1.8          {d6, d7},  [r4,:128], r12
-        vld1.8          {d4, d5},  [r4,:128], r12
-        vld1.8          {d2, d3},  [r4,:128], r12
-        vld1.8          {d0, d1},  [r4,:128]
-
-        swap4           d1,  d3,  d5,  d7,  d8,  d10, d12, d14
-        transpose16_4x4 q0,  q1,  q2,  q3,  q4,  q5,  q6,  q7
-
-        swap4           d17, d19, d21, d31, d24, d26, d28, d22
-        transpose16_4x4 q8,  q9,  q10, q15, q12, q13, q14, q11
-
-        vst1.8          {d30,d31}, [r4,:128]!
-        vst1.8          {d6, d7},  [r4,:128]!
-        vst1.8          {d20,d21}, [r4,:128]!
-        vst1.8          {d4, d5},  [r4,:128]!
-        vst1.8          {d18,d19}, [r4,:128]!
-        vst1.8          {d2, d3},  [r4,:128]!
-        vst1.8          {d16,d17}, [r4,:128]!
-        vst1.8          {d0, d1},  [r4,:128]
-
-        lowpass_8.16    q4,  q12, d8,  d9,  d24, d25, d8
-        lowpass_8.16    q5,  q13, d10, d11, d26, d27, d9
-        lowpass_8.16    q6,  q14, d12, d13, d28, d29, d10
-        lowpass_8.16    q7,  q11, d14, d15, d22, d23, d11
-
-        vld1.8          {d16,d17}, [r4,:128], r12
-        vld1.8          {d30,d31}, [r4,:128], r12
-        lowpass_8.16    q8,  q15, d16, d17, d30, d31, d12
-        vld1.8          {d16,d17}, [r4,:128], r12
-        vld1.8          {d30,d31}, [r4,:128], r12
-        lowpass_8.16    q8,  q15, d16, d17, d30, d31, d13
-        vld1.8          {d16,d17}, [r4,:128], r12
-        vld1.8          {d30,d31}, [r4,:128], r12
-        lowpass_8.16    q8,  q15, d16, d17, d30, d31, d14
-        vld1.8          {d16,d17}, [r4,:128], r12
-        vld1.8          {d30,d31}, [r4,:128]
-        lowpass_8.16    q8,  q15, d16, d17, d30, d31, d15
-
-        transpose_8x8   d12, d13, d14, d15, d8,  d9,  d10, d11
-
-        bx              lr
-endfunc
-
-.macro  h264_qpel8_hv_lowpass type
-function \type\()_h264_qpel8_hv_lowpass_neon
-        mov             r10, lr
-        bl              put_h264_qpel8_hv_lowpass_neon_top
-  .ifc \type,avg
-        vld1.8          {d0},      [r0,:64], r2
-        vrhadd.u8       d12, d12, d0
-        vld1.8          {d1},      [r0,:64], r2
-        vrhadd.u8       d13, d13, d1
-        vld1.8          {d2},      [r0,:64], r2
-        vrhadd.u8       d14, d14, d2
-        vld1.8          {d3},      [r0,:64], r2
-        vrhadd.u8       d15, d15, d3
-        vld1.8          {d4},      [r0,:64], r2
-        vrhadd.u8       d8,  d8,  d4
-        vld1.8          {d5},      [r0,:64], r2
-        vrhadd.u8       d9,  d9,  d5
-        vld1.8          {d6},      [r0,:64], r2
-        vrhadd.u8       d10, d10, d6
-        vld1.8          {d7},      [r0,:64], r2
-        vrhadd.u8       d11, d11, d7
-        sub             r0,  r0,  r2,  lsl #3
-  .endif
-
-        vst1.8          {d12},     [r0,:64], r2
-        vst1.8          {d13},     [r0,:64], r2
-        vst1.8          {d14},     [r0,:64], r2
-        vst1.8          {d15},     [r0,:64], r2
-        vst1.8          {d8},      [r0,:64], r2
-        vst1.8          {d9},      [r0,:64], r2
-        vst1.8          {d10},     [r0,:64], r2
-        vst1.8          {d11},     [r0,:64], r2
-
-        mov             lr,  r10
-        bx              lr
-endfunc
-.endm
-
-        h264_qpel8_hv_lowpass put
-        h264_qpel8_hv_lowpass avg
-
-.macro  h264_qpel8_hv_lowpass_l2 type
-function \type\()_h264_qpel8_hv_lowpass_l2_neon
-        mov             r10, lr
-        bl              put_h264_qpel8_hv_lowpass_neon_top
-
-        vld1.8          {d0, d1},  [r2,:128]!
-        vld1.8          {d2, d3},  [r2,:128]!
-        vrhadd.u8       q0,  q0,  q6
-        vld1.8          {d4, d5},  [r2,:128]!
-        vrhadd.u8       q1,  q1,  q7
-        vld1.8          {d6, d7},  [r2,:128]!
-        vrhadd.u8       q2,  q2,  q4
-        vrhadd.u8       q3,  q3,  q5
-  .ifc \type,avg
-        vld1.8          {d16},     [r0,:64], r3
-        vrhadd.u8       d0,  d0,  d16
-        vld1.8          {d17},     [r0,:64], r3
-        vrhadd.u8       d1,  d1,  d17
-        vld1.8          {d18},     [r0,:64], r3
-        vrhadd.u8       d2,  d2,  d18
-        vld1.8          {d19},     [r0,:64], r3
-        vrhadd.u8       d3,  d3,  d19
-        vld1.8          {d20},     [r0,:64], r3
-        vrhadd.u8       d4,  d4,  d20
-        vld1.8          {d21},     [r0,:64], r3
-        vrhadd.u8       d5,  d5,  d21
-        vld1.8          {d22},     [r0,:64], r3
-        vrhadd.u8       d6,  d6,  d22
-        vld1.8          {d23},     [r0,:64], r3
-        vrhadd.u8       d7,  d7,  d23
-        sub             r0,  r0,  r3,  lsl #3
-  .endif
-        vst1.8          {d0},      [r0,:64], r3
-        vst1.8          {d1},      [r0,:64], r3
-        vst1.8          {d2},      [r0,:64], r3
-        vst1.8          {d3},      [r0,:64], r3
-        vst1.8          {d4},      [r0,:64], r3
-        vst1.8          {d5},      [r0,:64], r3
-        vst1.8          {d6},      [r0,:64], r3
-        vst1.8          {d7},      [r0,:64], r3
-
-        mov             lr,  r10
-        bx              lr
-endfunc
-.endm
-
-        h264_qpel8_hv_lowpass_l2 put
-        h264_qpel8_hv_lowpass_l2 avg
-
-.macro  h264_qpel16_hv  type
-function \type\()_h264_qpel16_hv_lowpass_neon
-        mov             r9,  lr
-        bl              \type\()_h264_qpel8_hv_lowpass_neon
-        sub             r1,  r1,  r3, lsl #2
-        bl              \type\()_h264_qpel8_hv_lowpass_neon
-        sub             r1,  r1,  r3, lsl #4
-        sub             r1,  r1,  r3, lsl #2
-        add             r1,  r1,  #8
-        sub             r0,  r0,  r2, lsl #4
-        add             r0,  r0,  #8
-        bl              \type\()_h264_qpel8_hv_lowpass_neon
-        sub             r1,  r1,  r3, lsl #2
-        mov             lr,  r9
-        b               \type\()_h264_qpel8_hv_lowpass_neon
-endfunc
-
-function \type\()_h264_qpel16_hv_lowpass_l2_neon
-        mov             r9,  lr
-        sub             r2,  r4,  #256
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        sub             r1,  r1,  r3, lsl #2
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        sub             r1,  r1,  r3, lsl #4
-        sub             r1,  r1,  r3, lsl #2
-        add             r1,  r1,  #8
-        sub             r0,  r0,  r3, lsl #4
-        add             r0,  r0,  #8
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        sub             r1,  r1,  r3, lsl #2
-        mov             lr,  r9
-        b               \type\()_h264_qpel8_hv_lowpass_l2_neon
-endfunc
-.endm
-
-        h264_qpel16_hv put
-        h264_qpel16_hv avg
-
-.macro  h264_qpel8      type
-function ff_\type\()_h264_qpel8_mc10_neon, export=1
-        lowpass_const   r3
-        mov             r3,  r1
-        sub             r1,  r1,  #2
-        mov             r12, #8
-        b               \type\()_h264_qpel8_h_lowpass_l2_neon
-endfunc
-
-function ff_\type\()_h264_qpel8_mc20_neon, export=1
-        lowpass_const   r3
-        sub             r1,  r1,  #2
-        mov             r3,  r2
-        mov             r12, #8
-        b               \type\()_h264_qpel8_h_lowpass_neon
-endfunc
-
-function ff_\type\()_h264_qpel8_mc30_neon, export=1
-        lowpass_const   r3
-        add             r3,  r1,  #1
-        sub             r1,  r1,  #2
-        mov             r12, #8
-        b               \type\()_h264_qpel8_h_lowpass_l2_neon
-endfunc
-
-function ff_\type\()_h264_qpel8_mc01_neon, export=1
-        push            {lr}
-        mov             r12, r1
-\type\()_h264_qpel8_mc01:
-        lowpass_const   r3
-        mov             r3,  r2
-        sub             r1,  r1,  r2, lsl #1
-        vpush           {d8-d15}
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        vpop            {d8-d15}
-        pop             {pc}
-endfunc
-
-function ff_\type\()_h264_qpel8_mc11_neon, export=1
-        push            {r0, r1, r11, lr}
-\type\()_h264_qpel8_mc11:
-        lowpass_const   r3
-        mov             r11, sp
-A       bic             sp,  sp,  #15
-T       bic             r0,  r11, #15
-T       mov             sp,  r0
-        sub             sp,  sp,  #64
-        mov             r0,  sp
-        sub             r1,  r1,  #2
-        mov             r3,  #8
-        mov             r12, #8
-        vpush           {d8-d15}
-        bl              put_h264_qpel8_h_lowpass_neon
-        ldrd            r0,  r1,  [r11], #8
-        mov             r3,  r2
-        add             r12, sp,  #64
-        sub             r1,  r1,  r2, lsl #1
-        mov             r2,  #8
-        bl              \type\()_h264_qpel8_v_lowpass_l2_neon
-        vpop            {d8-d15}
-        mov             sp,  r11
-        pop             {r11, pc}
-endfunc
-
-function ff_\type\()_h264_qpel8_mc21_neon, export=1
-        push            {r0, r1, r4, r10, r11, lr}
-\type\()_h264_qpel8_mc21:
-        lowpass_const   r3
-        mov             r11, sp
-A       bic             sp,  sp,  #15
-T       bic             r0,  r11, #15
-T       mov             sp,  r0
-        sub             sp,  sp,  #(8*8+16*12)
-        sub             r1,  r1,  #2
-        mov             r3,  #8
-        mov             r0,  sp
-        mov             r12, #8
-        vpush           {d8-d15}
-        bl              put_h264_qpel8_h_lowpass_neon
-        mov             r4,  r0
-        ldrd            r0,  r1,  [r11], #8
-        sub             r1,  r1,  r2, lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  r2
-        sub             r2,  r4,  #64
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        vpop            {d8-d15}
-        mov             sp,  r11
-        pop             {r4, r10, r11, pc}
-endfunc
-
-function ff_\type\()_h264_qpel8_mc31_neon, export=1
-        add             r1,  r1,  #1
-        push            {r0, r1, r11, lr}
-        sub             r1,  r1,  #1
-        b               \type\()_h264_qpel8_mc11
-endfunc
-
-function ff_\type\()_h264_qpel8_mc02_neon, export=1
-        push            {lr}
-        lowpass_const   r3
-        sub             r1,  r1,  r2, lsl #1
-        mov             r3,  r2
-        vpush           {d8-d15}
-        bl              \type\()_h264_qpel8_v_lowpass_neon
-        vpop            {d8-d15}
-        pop             {pc}
-endfunc
-
-function ff_\type\()_h264_qpel8_mc12_neon, export=1
-        push            {r0, r1, r4, r10, r11, lr}
-\type\()_h264_qpel8_mc12:
-        lowpass_const   r3
-        mov             r11, sp
-A       bic             sp,  sp,  #15
-T       bic             r0,  r11, #15
-T       mov             sp,  r0
-        sub             sp,  sp,  #(8*8+16*12)
-        sub             r1,  r1,  r2, lsl #1
-        mov             r3,  r2
-        mov             r2,  #8
-        mov             r0,  sp
-        vpush           {d8-d15}
-        bl              put_h264_qpel8_v_lowpass_neon
-        mov             r4,  r0
-        ldrd            r0,  r1,  [r11], #8
-        sub             r1,  r1,  r3, lsl #1
-        sub             r1,  r1,  #2
-        sub             r2,  r4,  #64
-        bl              \type\()_h264_qpel8_hv_lowpass_l2_neon
-        vpop            {d8-d15}
-        mov             sp,  r11
-        pop             {r4, r10, r11, pc}
-endfunc
-
-function ff_\type\()_h264_qpel8_mc22_neon, export=1
-        push            {r4, r10, r11, lr}
-        mov             r11, sp
-A       bic             sp,  sp,  #15
-T       bic             r4,  r11, #15
-T       mov             sp,  r4
-        sub             r1,  r1,  r2, lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  r2
-        sub             sp,  sp,  #(16*12)
-        mov             r4,  sp
-        vpush           {d8-d15}
-        bl              \type\()_h264_qpel8_hv_lowpass_neon
-        vpop            {d8-d15}
-        mov             sp,  r11
-        pop             {r4, r10, r11, pc}
-endfunc
-
-function ff_\type\()_h264_qpel8_mc32_neon, export=1
-        push            {r0, r1, r4, r10, r11, lr}
-        add             r1,  r1,  #1
-        b               \type\()_h264_qpel8_mc12
-endfunc
-
-function ff_\type\()_h264_qpel8_mc03_neon, export=1
-        push            {lr}
-        add             r12, r1,  r2
-        b               \type\()_h264_qpel8_mc01
-endfunc
-
-function ff_\type\()_h264_qpel8_mc13_neon, export=1
-        push            {r0, r1, r11, lr}
-        add             r1,  r1,  r2
-        b               \type\()_h264_qpel8_mc11
-endfunc
-
-function ff_\type\()_h264_qpel8_mc23_neon, export=1
-        push            {r0, r1, r4, r10, r11, lr}
-        add             r1,  r1,  r2
-        b               \type\()_h264_qpel8_mc21
-endfunc
-
-function ff_\type\()_h264_qpel8_mc33_neon, export=1
-        add             r1,  r1,  #1
-        push            {r0, r1, r11, lr}
-        add             r1,  r1,  r2
-        sub             r1,  r1,  #1
-        b               \type\()_h264_qpel8_mc11
-endfunc
-.endm
-
-        h264_qpel8 put
-        h264_qpel8 avg
-
-.macro  h264_qpel16     type
-function ff_\type\()_h264_qpel16_mc10_neon, export=1
-        lowpass_const   r3
-        mov             r3,  r1
-        sub             r1,  r1,  #2
-        b               \type\()_h264_qpel16_h_lowpass_l2_neon
-endfunc
-
-function ff_\type\()_h264_qpel16_mc20_neon, export=1
-        lowpass_const   r3
-        sub             r1,  r1,  #2
-        mov             r3,  r2
-        b               \type\()_h264_qpel16_h_lowpass_neon
-endfunc
-
-function ff_\type\()_h264_qpel16_mc30_neon, export=1
-        lowpass_const   r3
-        add             r3,  r1,  #1
-        sub             r1,  r1,  #2
-        b               \type\()_h264_qpel16_h_lowpass_l2_neon
-endfunc
-
-function ff_\type\()_h264_qpel16_mc01_neon, export=1
-        push            {r4, lr}
-        mov             r12, r1
-\type\()_h264_qpel16_mc01:
-        lowpass_const   r3
-        mov             r3,  r2
-        sub             r1,  r1,  r2, lsl #1
-        vpush           {d8-d15}
-        bl              \type\()_h264_qpel16_v_lowpass_l2_neon
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_h264_qpel16_mc11_neon, export=1
-        push            {r0, r1, r4, r11, lr}
-\type\()_h264_qpel16_mc11:
-        lowpass_const   r3
-        mov             r11, sp
-A       bic             sp,  sp,  #15
-T       bic             r0,  r11, #15
-T       mov             sp,  r0
-        sub             sp,  sp,  #256
-        mov             r0,  sp
-        sub             r1,  r1,  #2
-        mov             r3,  #16
-        vpush           {d8-d15}
-        bl              put_h264_qpel16_h_lowpass_neon
-        ldrd            r0,  r1,  [r11], #8
-        mov             r3,  r2
-        add             r12, sp,  #64
-        sub             r1,  r1,  r2, lsl #1
-        mov             r2,  #16
-        bl              \type\()_h264_qpel16_v_lowpass_l2_neon
-        vpop            {d8-d15}
-        mov             sp,  r11
-        pop             {r4, r11, pc}
-endfunc
-
-function ff_\type\()_h264_qpel16_mc21_neon, export=1
-        push            {r0, r1, r4-r5, r9-r11, lr}
-\type\()_h264_qpel16_mc21:
-        lowpass_const   r3
-        mov             r11, sp
-A       bic             sp,  sp,  #15
-T       bic             r0,  r11, #15
-T       mov             sp,  r0
-        sub             sp,  sp,  #(16*16+16*12)
-        sub             r1,  r1,  #2
-        mov             r0,  sp
-        vpush           {d8-d15}
-        bl              put_h264_qpel16_h_lowpass_neon_packed
-        mov             r4,  r0
-        ldrd            r0,  r1,  [r11], #8
-        sub             r1,  r1,  r2, lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  r2
-        bl              \type\()_h264_qpel16_hv_lowpass_l2_neon
-        vpop            {d8-d15}
-        mov             sp,  r11
-        pop             {r4-r5, r9-r11, pc}
-endfunc
-
-function ff_\type\()_h264_qpel16_mc31_neon, export=1
-        add             r1,  r1,  #1
-        push            {r0, r1, r4, r11, lr}
-        sub             r1,  r1,  #1
-        b               \type\()_h264_qpel16_mc11
-endfunc
-
-function ff_\type\()_h264_qpel16_mc02_neon, export=1
-        push            {r4, lr}
-        lowpass_const   r3
-        sub             r1,  r1,  r2, lsl #1
-        mov             r3,  r2
-        vpush           {d8-d15}
-        bl              \type\()_h264_qpel16_v_lowpass_neon
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_h264_qpel16_mc12_neon, export=1
-        push            {r0, r1, r4-r5, r9-r11, lr}
-\type\()_h264_qpel16_mc12:
-        lowpass_const   r3
-        mov             r11, sp
-A       bic             sp,  sp,  #15
-T       bic             r0,  r11, #15
-T       mov             sp,  r0
-        sub             sp,  sp,  #(16*16+16*12)
-        sub             r1,  r1,  r2, lsl #1
-        mov             r0,  sp
-        mov             r3,  r2
-        vpush           {d8-d15}
-        bl              put_h264_qpel16_v_lowpass_neon_packed
-        mov             r4,  r0
-        ldrd            r0,  r1,  [r11], #8
-        sub             r1,  r1,  r3, lsl #1
-        sub             r1,  r1,  #2
-        mov             r2,  r3
-        bl              \type\()_h264_qpel16_hv_lowpass_l2_neon
-        vpop            {d8-d15}
-        mov             sp,  r11
-        pop             {r4-r5, r9-r11, pc}
-endfunc
-
-function ff_\type\()_h264_qpel16_mc22_neon, export=1
-        push            {r4, r9-r11, lr}
-        lowpass_const   r3
-        mov             r11, sp
-A       bic             sp,  sp,  #15
-T       bic             r4,  r11, #15
-T       mov             sp,  r4
-        sub             r1,  r1,  r2, lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  r2
-        sub             sp,  sp,  #(16*12)
-        mov             r4,  sp
-        vpush           {d8-d15}
-        bl              \type\()_h264_qpel16_hv_lowpass_neon
-        vpop            {d8-d15}
-        mov             sp,  r11
-        pop             {r4, r9-r11, pc}
-endfunc
-
-function ff_\type\()_h264_qpel16_mc32_neon, export=1
-        push            {r0, r1, r4-r5, r9-r11, lr}
-        add             r1,  r1,  #1
-        b               \type\()_h264_qpel16_mc12
-endfunc
-
-function ff_\type\()_h264_qpel16_mc03_neon, export=1
-        push            {r4, lr}
-        add             r12, r1,  r2
-        b               \type\()_h264_qpel16_mc01
-endfunc
-
-function ff_\type\()_h264_qpel16_mc13_neon, export=1
-        push            {r0, r1, r4, r11, lr}
-        add             r1,  r1,  r2
-        b               \type\()_h264_qpel16_mc11
-endfunc
-
-function ff_\type\()_h264_qpel16_mc23_neon, export=1
-        push            {r0, r1, r4-r5, r9-r11, lr}
-        add             r1,  r1,  r2
-        b               \type\()_h264_qpel16_mc21
-endfunc
-
-function ff_\type\()_h264_qpel16_mc33_neon, export=1
-        add             r1,  r1,  #1
-        push            {r0, r1, r4, r11, lr}
-        add             r1,  r1,  r2
-        sub             r1,  r1,  #1
-        b               \type\()_h264_qpel16_mc11
-endfunc
-.endm
-
-        h264_qpel16 put
-        h264_qpel16 avg
diff --git a/deps/libav/libavcodec/arm/hpeldsp_arm.S b/deps/libav/libavcodec/arm/hpeldsp_arm.S
deleted file mode 100644
index 5bacd8e..0000000
--- a/deps/libav/libavcodec/arm/hpeldsp_arm.S
+++ /dev/null
@@ -1,603 +0,0 @@
-@
-@ ARMv4 optimized DSP utils
-@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
-@
-@ This file is part of Libav.
-@
-@ Libav 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.
-@
-@ Libav 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 Libav; if not, write to the Free Software
-@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-@
-
-#include "config.h"
-#include "libavutil/arm/asm.S"
-
-#if !HAVE_ARMV5TE_EXTERNAL
-#define pld @
-#endif
-
-.macro  ALIGN_QWORD_D shift, Rd0, Rd1, Rd2, Rd3, Rn0, Rn1, Rn2, Rn3, Rn4
-        mov             \Rd0, \Rn0, lsr #(\shift * 8)
-        mov             \Rd1, \Rn1, lsr #(\shift * 8)
-        mov             \Rd2, \Rn2, lsr #(\shift * 8)
-        mov             \Rd3, \Rn3, lsr #(\shift * 8)
-        orr             \Rd0, \Rd0, \Rn1, lsl #(32 - \shift * 8)
-        orr             \Rd1, \Rd1, \Rn2, lsl #(32 - \shift * 8)
-        orr             \Rd2, \Rd2, \Rn3, lsl #(32 - \shift * 8)
-        orr             \Rd3, \Rd3, \Rn4, lsl #(32 - \shift * 8)
-.endm
-.macro  ALIGN_DWORD shift, R0, R1, R2
-        mov             \R0, \R0, lsr #(\shift * 8)
-        orr             \R0, \R0, \R1, lsl #(32 - \shift * 8)
-        mov             \R1, \R1, lsr #(\shift * 8)
-        orr             \R1, \R1, \R2, lsl #(32 - \shift * 8)
-.endm
-.macro  ALIGN_DWORD_D shift, Rdst0, Rdst1, Rsrc0, Rsrc1, Rsrc2
-        mov             \Rdst0, \Rsrc0, lsr #(\shift * 8)
-        mov             \Rdst1, \Rsrc1, lsr #(\shift * 8)
-        orr             \Rdst0, \Rdst0, \Rsrc1, lsl #(32 - (\shift * 8))
-        orr             \Rdst1, \Rdst1, \Rsrc2, lsl #(32 - (\shift * 8))
-.endm
-
-.macro  RND_AVG32 Rd0, Rd1, Rn0, Rn1, Rm0, Rm1, Rmask
-        @ Rd = (Rn | Rm) - (((Rn ^ Rm) & ~0x01010101) >> 1)
-        @ Rmask = 0xFEFEFEFE
-        @ Rn = destroy
-        eor             \Rd0, \Rn0, \Rm0
-        eor             \Rd1, \Rn1, \Rm1
-        orr             \Rn0, \Rn0, \Rm0
-        orr             \Rn1, \Rn1, \Rm1
-        and             \Rd0, \Rd0, \Rmask
-        and             \Rd1, \Rd1, \Rmask
-        sub             \Rd0, \Rn0, \Rd0, lsr #1
-        sub             \Rd1, \Rn1, \Rd1, lsr #1
-.endm
-
-.macro  NO_RND_AVG32 Rd0, Rd1, Rn0, Rn1, Rm0, Rm1, Rmask
-        @ Rd = (Rn & Rm) - (((Rn ^ Rm) & ~0x01010101) >> 1)
-        @ Rmask = 0xFEFEFEFE
-        @ Rn = destroy
-        eor             \Rd0, \Rn0, \Rm0
-        eor             \Rd1, \Rn1, \Rm1
-        and             \Rn0, \Rn0, \Rm0
-        and             \Rn1, \Rn1, \Rm1
-        and             \Rd0, \Rd0, \Rmask
-        and             \Rd1, \Rd1, \Rmask
-        add             \Rd0, \Rn0, \Rd0, lsr #1
-        add             \Rd1, \Rn1, \Rd1, lsr #1
-.endm
-
-.macro  JMP_ALIGN tmp, reg
-        ands            \tmp, \reg, #3
-        bic             \reg, \reg, #3
-        beq             1f
-        subs            \tmp, \tmp, #1
-        beq             2f
-        subs            \tmp, \tmp, #1
-        beq             3f
-        b    4f
-.endm
-
-@ ----------------------------------------------------------------
-function ff_put_pixels16_arm, export=1, align=5
-        @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-        @ block = word aligned, pixles = unaligned
-        pld             [r1]
-        push            {r4-r11, lr}
-        JMP_ALIGN       r5,  r1
-1:
-        ldm             r1,  {r4-r7}
-        add             r1,  r1,  r2
-        stm             r0,  {r4-r7}
-        pld             [r1]
-        subs            r3,  r3,  #1
-        add             r0,  r0,  r2
-        bne             1b
-        pop             {r4-r11, pc}
-        .align 5
-2:
-        ldm             r1,  {r4-r8}
-        add             r1,  r1,  r2
-        ALIGN_QWORD_D   1,   r9,  r10, r11, r12, r4,  r5,  r6,  r7,  r8
-        pld             [r1]
-        subs            r3,  r3,  #1
-        stm             r0,  {r9-r12}
-        add             r0,  r0,  r2
-        bne             2b
-        pop             {r4-r11, pc}
-        .align 5
-3:
-        ldm             r1,  {r4-r8}
-        add             r1,  r1,  r2
-        ALIGN_QWORD_D   2,   r9,  r10, r11, r12, r4,  r5,  r6,  r7,  r8
-        pld             [r1]
-        subs            r3,  r3,  #1
-        stm             r0,  {r9-r12}
-        add             r0,  r0,  r2
-        bne             3b
-        pop             {r4-r11, pc}
-        .align 5
-4:
-        ldm             r1,  {r4-r8}
-        add             r1,  r1,  r2
-        ALIGN_QWORD_D   3,   r9,  r10, r11, r12, r4,  r5,  r6,  r7,  r8
-        pld             [r1]
-        subs            r3,  r3,  #1
-        stm             r0,  {r9-r12}
-        add             r0,  r0,  r2
-        bne             4b
-        pop             {r4-r11,pc}
-endfunc
-
-@ ----------------------------------------------------------------
-function ff_put_pixels8_arm, export=1, align=5
-        @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-        @ block = word aligned, pixles = unaligned
-        pld             [r1]
-        push            {r4-r5,lr}
-        JMP_ALIGN       r5,  r1
-1:
-        ldm             r1,  {r4-r5}
-        add             r1,  r1,  r2
-        subs            r3,  r3,  #1
-        pld             [r1]
-        stm             r0,  {r4-r5}
-        add             r0,  r0,  r2
-        bne             1b
-        pop             {r4-r5,pc}
-        .align 5
-2:
-        ldm             r1,  {r4-r5, r12}
-        add             r1,  r1,  r2
-        ALIGN_DWORD     1,   r4,  r5,  r12
-        pld             [r1]
-        subs            r3,  r3,  #1
-        stm             r0,  {r4-r5}
-        add             r0,  r0,  r2
-        bne             2b
-        pop             {r4-r5,pc}
-        .align 5
-3:
-        ldm             r1,  {r4-r5, r12}
-        add             r1,  r1,  r2
-        ALIGN_DWORD     2,   r4,  r5,  r12
-        pld             [r1]
-        subs            r3,  r3,  #1
-        stm             r0,  {r4-r5}
-        add             r0,  r0,  r2
-        bne             3b
-        pop             {r4-r5,pc}
-        .align 5
-4:
-        ldm             r1,  {r4-r5, r12}
-        add             r1,  r1,  r2
-        ALIGN_DWORD     3,   r4,  r5,  r12
-        pld             [r1]
-        subs            r3,  r3,  #1
-        stm             r0,  {r4-r5}
-        add             r0,  r0,  r2
-        bne             4b
-        pop             {r4-r5,pc}
-endfunc
-
-@ ----------------------------------------------------------------
-function ff_put_pixels8_x2_arm, export=1, align=5
-        @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-        @ block = word aligned, pixles = unaligned
-        pld             [r1]
-        push            {r4-r10,lr}
-        ldr             r12, =0xfefefefe
-        JMP_ALIGN       r5,  r1
-1:
-        ldm             r1,  {r4-r5, r10}
-        add             r1,  r1,  r2
-        ALIGN_DWORD_D   1,   r6,  r7,  r4,  r5,  r10
-        pld             [r1]
-        RND_AVG32       r8,  r9,  r4,  r5,  r6,  r7,  r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r8-r9}
-        add             r0,  r0,  r2
-        bne             1b
-        pop             {r4-r10,pc}
-        .align 5
-2:
-        ldm             r1,  {r4-r5, r10}
-        add             r1,  r1,  r2
-        ALIGN_DWORD_D   1,   r6,  r7,  r4,  r5,  r10
-        ALIGN_DWORD_D   2,   r8,  r9,  r4,  r5,  r10
-        pld             [r1]
-        RND_AVG32       r4,  r5,  r6,  r7,  r8,  r9,  r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r4-r5}
-        add             r0,  r0,  r2
-        bne             2b
-        pop             {r4-r10,pc}
-        .align 5
-3:
-        ldm             r1,  {r4-r5, r10}
-        add             r1,  r1,  r2
-        ALIGN_DWORD_D   2,   r6,  r7,  r4,  r5,  r10
-        ALIGN_DWORD_D   3,   r8,  r9,  r4,  r5,  r10
-        pld             [r1]
-        RND_AVG32       r4,  r5,  r6,  r7,  r8,  r9,  r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r4-r5}
-        add             r0,  r0,  r2
-        bne             3b
-        pop             {r4-r10,pc}
-        .align 5
-4:
-        ldm             r1,  {r4-r5, r10}
-        add             r1,  r1,  r2
-        ALIGN_DWORD_D   3,   r6,  r7,  r4,  r5,  r10
-        pld             [r1]
-        RND_AVG32       r8,  r9,  r6,  r7,  r5,  r10, r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r8-r9}
-        add             r0,  r0,  r2
-        bne             4b
-        pop             {r4-r10,pc}
-endfunc
-
-function ff_put_no_rnd_pixels8_x2_arm, export=1, align=5
-        @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-        @ block = word aligned, pixles = unaligned
-        pld             [r1]
-        push            {r4-r10,lr}
-        ldr             r12, =0xfefefefe
-        JMP_ALIGN       r5,  r1
-1:
-        ldm             r1,  {r4-r5, r10}
-        add             r1,  r1,  r2
-        ALIGN_DWORD_D   1,   r6,  r7,  r4,  r5,  r10
-        pld             [r1]
-        NO_RND_AVG32    r8,  r9,  r4,  r5,  r6,  r7,  r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r8-r9}
-        add             r0,  r0,  r2
-        bne             1b
-        pop             {r4-r10,pc}
-        .align 5
-2:
-        ldm             r1,  {r4-r5, r10}
-        add             r1,  r1,  r2
-        ALIGN_DWORD_D   1,   r6,  r7,  r4,  r5,  r10
-        ALIGN_DWORD_D   2,   r8,  r9,  r4,  r5,  r10
-        pld             [r1]
-        NO_RND_AVG32    r4,  r5,  r6,  r7,  r8,  r9,  r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r4-r5}
-        add             r0,  r0,  r2
-        bne             2b
-        pop             {r4-r10,pc}
-        .align 5
-3:
-        ldm             r1,  {r4-r5, r10}
-        add             r1,  r1,  r2
-        ALIGN_DWORD_D   2,   r6,  r7,  r4,  r5,  r10
-        ALIGN_DWORD_D   3,   r8,  r9,  r4,  r5,  r10
-        pld             [r1]
-        NO_RND_AVG32    r4,  r5,  r6,  r7,  r8,  r9,  r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r4-r5}
-        add             r0,  r0,  r2
-        bne             3b
-        pop             {r4-r10,pc}
-        .align 5
-4:
-        ldm             r1,  {r4-r5, r10}
-        add             r1,  r1,  r2
-        ALIGN_DWORD_D   3,   r6,  r7,  r4,  r5,  r10
-        pld             [r1]
-        NO_RND_AVG32    r8,  r9,  r6,  r7,  r5,  r10, r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r8-r9}
-        add             r0,  r0,  r2
-        bne             4b
-        pop             {r4-r10,pc}
-endfunc
-
-
-@ ----------------------------------------------------------------
-function ff_put_pixels8_y2_arm, export=1, align=5
-        @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-        @ block = word aligned, pixles = unaligned
-        pld             [r1]
-        push            {r4-r11,lr}
-        mov             r3,  r3,  lsr #1
-        ldr             r12, =0xfefefefe
-        JMP_ALIGN       r5,  r1
-1:
-        ldm             r1,  {r4-r5}
-        add             r1,  r1,  r2
-6:      ldm             r1,  {r6-r7}
-        add             r1,  r1,  r2
-        pld             [r1]
-        RND_AVG32       r8,  r9,  r4,  r5,  r6,  r7,  r12
-        ldm             r1,  {r4-r5}
-        add             r1,  r1,  r2
-        stm             r0,  {r8-r9}
-        add             r0,  r0,  r2
-        pld             [r1]
-        RND_AVG32       r8,  r9,  r6,  r7,  r4,  r5,  r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r8-r9}
-        add             r0,  r0,  r2
-        bne             6b
-        pop             {r4-r11,pc}
-        .align 5
-2:
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     1,   r4,  r5,  r6
-6:      ldm             r1,  {r7-r9}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     1,   r7,  r8,  r9
-        RND_AVG32       r10, r11, r4,  r5,  r7,  r8,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     1,   r4,  r5,  r6
-        subs            r3,  r3,  #1
-        RND_AVG32       r10, r11, r7,  r8,  r4,  r5,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        bne             6b
-        pop             {r4-r11,pc}
-        .align 5
-3:
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     2,   r4,  r5,  r6
-6:      ldm             r1,  {r7-r9}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     2,   r7,  r8,  r9
-        RND_AVG32       r10, r11, r4,  r5,  r7,  r8,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     2,   r4,  r5,  r6
-        subs            r3,  r3,  #1
-        RND_AVG32       r10, r11, r7,  r8,  r4,  r5,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        bne             6b
-        pop             {r4-r11,pc}
-        .align 5
-4:
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     3,   r4,  r5,  r6
-6:      ldm             r1,  {r7-r9}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     3,   r7,  r8,  r9
-        RND_AVG32       r10, r11, r4,  r5,  r7,  r8,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     3,   r4,  r5,  r6
-        subs            r3,  r3,  #1
-        RND_AVG32       r10, r11, r7,  r8,  r4,  r5,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        bne             6b
-        pop             {r4-r11,pc}
-endfunc
-
-function ff_put_no_rnd_pixels8_y2_arm, export=1, align=5
-        @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-        @ block = word aligned, pixles = unaligned
-        pld             [r1]
-        push            {r4-r11,lr}
-        mov             r3,  r3,  lsr #1
-        ldr             r12, =0xfefefefe
-        JMP_ALIGN       r5,  r1
-1:
-        ldm             r1,  {r4-r5}
-        add             r1,  r1,  r2
-6:      ldm             r1,  {r6-r7}
-        add             r1,  r1,  r2
-        pld             [r1]
-        NO_RND_AVG32    r8,  r9,  r4,  r5,  r6,  r7,  r12
-        ldm             r1,  {r4-r5}
-        add             r1,  r1,  r2
-        stm             r0,  {r8-r9}
-        add             r0,  r0,  r2
-        pld             [r1]
-        NO_RND_AVG32    r8,  r9,  r6,  r7,  r4,  r5,  r12
-        subs            r3,  r3,  #1
-        stm             r0,  {r8-r9}
-        add             r0,  r0,  r2
-        bne             6b
-        pop             {r4-r11,pc}
-        .align 5
-2:
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     1,   r4,  r5,  r6
-6:      ldm             r1,  {r7-r9}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     1,   r7,  r8,  r9
-        NO_RND_AVG32    r10, r11, r4,  r5,  r7,  r8,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     1,   r4,  r5,  r6
-        subs            r3,  r3,  #1
-        NO_RND_AVG32    r10, r11, r7,  r8,  r4,  r5,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        bne             6b
-        pop             {r4-r11,pc}
-        .align 5
-3:
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     2,   r4,  r5,  r6
-6:      ldm             r1,  {r7-r9}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     2,   r7,  r8,  r9
-        NO_RND_AVG32    r10, r11, r4,  r5,  r7,  r8,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     2,   r4,  r5,  r6
-        subs            r3,  r3,  #1
-        NO_RND_AVG32    r10, r11, r7,  r8,  r4,  r5,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        bne             6b
-        pop             {r4-r11,pc}
-        .align 5
-4:
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     3,   r4,  r5,  r6
-6:      ldm             r1,  {r7-r9}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     3,   r7,  r8,  r9
-        NO_RND_AVG32    r10, r11, r4,  r5,  r7,  r8,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        ldm             r1,  {r4-r6}
-        add             r1,  r1,  r2
-        pld             [r1]
-        ALIGN_DWORD     3,   r4,  r5,  r6
-        subs            r3,  r3,  #1
-        NO_RND_AVG32    r10, r11, r7,  r8,  r4,  r5,  r12
-        stm             r0,  {r10-r11}
-        add             r0,  r0,  r2
-        bne             6b
-        pop             {r4-r11,pc}
-endfunc
-
-        .ltorg
-
-@ ----------------------------------------------------------------
-.macro  RND_XY2_IT align, rnd
-        @ l1=  (a & 0x03030303) + (b & 0x03030303) ?(+ 0x02020202)
-        @ h1= ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2)
-.if \align == 0
-        ldm             r1,  {r6-r8}
-.elseif \align == 3
-        ldm             r1,  {r5-r7}
-.else
-        ldm             r1,  {r8-r10}
-.endif
-        add             r1,  r1,  r2
-        pld             [r1]
-.if \align == 0
-        ALIGN_DWORD_D   1,   r4,  r5,  r6,  r7,  r8
-.elseif \align == 1
-        ALIGN_DWORD_D   1,   r4,  r5,  r8,  r9,  r10
-        ALIGN_DWORD_D   2,   r6,  r7,  r8,  r9,  r10
-.elseif \align == 2
-        ALIGN_DWORD_D   2,   r4,  r5,  r8,  r9,  r10
-        ALIGN_DWORD_D   3,   r6,  r7,  r8,  r9,  r10
-.elseif \align == 3
-        ALIGN_DWORD_D   3,   r4,  r5,  r5,  r6,  r7
-.endif
-        ldr             r14, =0x03030303
-        tst             r3,  #1
-        and             r8,  r4,  r14
-        and             r9,  r5,  r14
-        and             r10, r6,  r14
-        and             r11, r7,  r14
-        it              eq
-        andeq           r14, r14, r14, \rnd #1
-        add             r8,  r8,  r10
-        add             r9,  r9,  r11
-        ldr             r12, =0xfcfcfcfc >> 2
-        itt             eq
-        addeq           r8,  r8,  r14
-        addeq           r9,  r9,  r14
-        and             r4,  r12, r4,  lsr #2
-        and             r5,  r12, r5,  lsr #2
-        and             r6,  r12, r6,  lsr #2
-        and             r7,  r12, r7,  lsr #2
-        add             r10, r4,  r6
-        add             r11, r5,  r7
-        subs            r3,  r3,  #1
-.endm
-
-.macro RND_XY2_EXPAND align, rnd
-        RND_XY2_IT      \align, \rnd
-6:      push            {r8-r11}
-        RND_XY2_IT      \align, \rnd
-        pop             {r4-r7}
-        add             r4,  r4,  r8
-        add             r5,  r5,  r9
-        ldr             r14, =0x0f0f0f0f
-        add             r6,  r6,  r10
-        add             r7,  r7,  r11
-        and             r4,  r14, r4,  lsr #2
-        and             r5,  r14, r5,  lsr #2
-        add             r4,  r4,  r6
-        add             r5,  r5,  r7
-        stm             r0,  {r4-r5}
-        add             r0,  r0,  r2
-        bge             6b
-        pop             {r4-r11,pc}
-.endm
-
-function ff_put_pixels8_xy2_arm, export=1, align=5
-        @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-        @ block = word aligned, pixles = unaligned
-        pld             [r1]
-        push            {r4-r11,lr} @ R14 is also called LR
-        JMP_ALIGN       r5,  r1
-1:      RND_XY2_EXPAND  0, lsl
-        .align 5
-2:      RND_XY2_EXPAND  1, lsl
-        .align 5
-3:      RND_XY2_EXPAND  2, lsl
-        .align 5
-4:      RND_XY2_EXPAND  3, lsl
-endfunc
-
-function ff_put_no_rnd_pixels8_xy2_arm, export=1, align=5
-        @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-        @ block = word aligned, pixles = unaligned
-        pld             [r1]
-        push            {r4-r11,lr}
-        JMP_ALIGN       r5,  r1
-1:      RND_XY2_EXPAND  0, lsr
-        .align 5
-2:      RND_XY2_EXPAND  1, lsr
-        .align 5
-3:      RND_XY2_EXPAND  2, lsr
-        .align 5
-4:      RND_XY2_EXPAND  3, lsr
-endfunc
diff --git a/deps/libav/libavcodec/arm/hpeldsp_arm.h b/deps/libav/libavcodec/arm/hpeldsp_arm.h
deleted file mode 100644
index a864152..0000000
--- a/deps/libav/libavcodec/arm/hpeldsp_arm.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_HPELDSP_ARM_H
-#define AVCODEC_ARM_HPELDSP_ARM_H
-
-#include "libavcodec/hpeldsp.h"
-
-void ff_hpeldsp_init_armv6(HpelDSPContext *c, int flags);
-void ff_hpeldsp_init_neon(HpelDSPContext *c, int flags);
-
-#endif /* AVCODEC_ARM_HPELDSP_ARM_H */
diff --git a/deps/libav/libavcodec/arm/hpeldsp_armv6.S b/deps/libav/libavcodec/arm/hpeldsp_armv6.S
deleted file mode 100644
index f1abc32..0000000
--- a/deps/libav/libavcodec/arm/hpeldsp_armv6.S
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-.macro  call_2x_pixels  type, subp
-function ff_\type\()_pixels16\subp\()_armv6, export=1
-        push            {r0-r3, lr}
-        bl              X(ff_\type\()_pixels8\subp\()_armv6)
-        pop             {r0-r3, lr}
-        add             r0,  r0,  #8
-        add             r1,  r1,  #8
-        b               X(ff_\type\()_pixels8\subp\()_armv6)
-endfunc
-.endm
-
-call_2x_pixels          avg
-call_2x_pixels          put, _x2
-call_2x_pixels          put, _y2
-call_2x_pixels          put, _x2_no_rnd
-call_2x_pixels          put, _y2_no_rnd
-
-function ff_put_pixels16_armv6, export=1
-        push            {r4-r11}
-1:
-        ldr             r5,  [r1, #4]
-        ldr             r6,  [r1, #8]
-        ldr             r7,  [r1, #12]
-        ldr_post        r4,  r1,  r2
-        strd            r6,  r7,  [r0, #8]
-        ldr             r9,  [r1, #4]
-        strd_post       r4,  r5,  r0,  r2
-        ldr             r10, [r1, #8]
-        ldr             r11, [r1, #12]
-        ldr_post        r8,  r1,  r2
-        strd            r10, r11, [r0, #8]
-        subs            r3,  r3,  #2
-        strd_post       r8,  r9,  r0,  r2
-        bne             1b
-
-        pop             {r4-r11}
-        bx              lr
-endfunc
-
-function ff_put_pixels8_armv6, export=1
-        push            {r4-r7}
-1:
-        ldr             r5,  [r1, #4]
-        ldr_post        r4,  r1,  r2
-        ldr             r7,  [r1, #4]
-        strd_post       r4,  r5,  r0,  r2
-        ldr_post        r6,  r1,  r2
-        subs            r3,  r3,  #2
-        strd_post       r6,  r7,  r0,  r2
-        bne             1b
-
-        pop             {r4-r7}
-        bx              lr
-endfunc
-
-function ff_put_pixels8_x2_armv6, export=1
-        push            {r4-r11, lr}
-        mov             r12, #1
-        orr             r12, r12, r12, lsl #8
-        orr             r12, r12, r12, lsl #16
-1:
-        ldr             r4,  [r1]
-        subs            r3,  r3,  #2
-        ldr             r5,  [r1, #4]
-        ldr             r7,  [r1, #5]
-        lsr             r6,  r4,  #8
-        ldr_pre         r8,  r1,  r2
-        orr             r6,  r6,  r5,  lsl #24
-        ldr             r9,  [r1, #4]
-        ldr             r11, [r1, #5]
-        lsr             r10, r8,  #8
-        add             r1,  r1,  r2
-        orr             r10, r10, r9,  lsl #24
-        eor             r14, r4,  r6
-        uhadd8          r4,  r4,  r6
-        eor             r6,  r5,  r7
-        uhadd8          r5,  r5,  r7
-        and             r14, r14, r12
-        and             r6,  r6,  r12
-        uadd8           r4,  r4,  r14
-        eor             r14, r8,  r10
-        uadd8           r5,  r5,  r6
-        eor             r6,  r9,  r11
-        uhadd8          r8,  r8,  r10
-        and             r14, r14, r12
-        uhadd8          r9,  r9,  r11
-        and             r6,  r6,  r12
-        uadd8           r8,  r8,  r14
-        strd_post       r4,  r5,  r0,  r2
-        uadd8           r9,  r9,  r6
-        strd_post       r8,  r9,  r0,  r2
-        bne             1b
-
-        pop             {r4-r11, pc}
-endfunc
-
-function ff_put_pixels8_y2_armv6, export=1
-        push            {r4-r11}
-        mov             r12, #1
-        orr             r12, r12, r12, lsl #8
-        orr             r12, r12, r12, lsl #16
-        ldr             r4,  [r1]
-        ldr             r5,  [r1, #4]
-        ldr_pre         r6,  r1,  r2
-        ldr             r7,  [r1, #4]
-1:
-        subs            r3,  r3,  #2
-        uhadd8          r8,  r4,  r6
-        eor             r10, r4,  r6
-        uhadd8          r9,  r5,  r7
-        eor             r11, r5,  r7
-        and             r10, r10, r12
-        ldr_pre         r4,  r1,  r2
-        uadd8           r8,  r8,  r10
-        and             r11, r11, r12
-        uadd8           r9,  r9,  r11
-        ldr             r5,  [r1, #4]
-        uhadd8          r10, r4,  r6
-        eor             r6,  r4,  r6
-        uhadd8          r11, r5,  r7
-        and             r6,  r6,  r12
-        eor             r7,  r5,  r7
-        uadd8           r10, r10, r6
-        and             r7,  r7,  r12
-        ldrc_pre        ne,  r6,  r1,  r2
-        uadd8           r11, r11, r7
-        strd_post       r8,  r9,  r0,  r2
-        it              ne
-        ldrne           r7,  [r1, #4]
-        strd_post       r10, r11, r0,  r2
-        bne             1b
-
-        pop             {r4-r11}
-        bx              lr
-endfunc
-
-function ff_put_pixels8_x2_no_rnd_armv6, export=1
-        push            {r4-r9, lr}
-1:
-        subs            r3,  r3,  #2
-        ldr             r4,  [r1]
-        ldr             r5,  [r1, #4]
-        ldr             r7,  [r1, #5]
-        ldr_pre         r8,  r1,  r2
-        ldr             r9,  [r1, #4]
-        ldr             r14, [r1, #5]
-        add             r1,  r1,  r2
-        lsr             r6,  r4,  #8
-        orr             r6,  r6,  r5,  lsl #24
-        lsr             r12, r8,  #8
-        orr             r12, r12, r9,  lsl #24
-        uhadd8          r4,  r4,  r6
-        uhadd8          r5,  r5,  r7
-        uhadd8          r8,  r8,  r12
-        uhadd8          r9,  r9,  r14
-        stm             r0,  {r4,r5}
-        add             r0,  r0,  r2
-        stm             r0,  {r8,r9}
-        add             r0,  r0,  r2
-        bne             1b
-
-        pop             {r4-r9, pc}
-endfunc
-
-function ff_put_pixels8_y2_no_rnd_armv6, export=1
-        push            {r4-r9, lr}
-        ldr             r4,  [r1]
-        ldr             r5,  [r1, #4]
-        ldr_pre         r6,  r1,  r2
-        ldr             r7,  [r1, #4]
-1:
-        subs            r3,  r3,  #2
-        uhadd8          r8,  r4,  r6
-        ldr_pre         r4,  r1,  r2
-        uhadd8          r9,  r5,  r7
-        ldr             r5,  [r1, #4]
-        uhadd8          r12, r4,  r6
-        ldrc_pre        ne,  r6,  r1,  r2
-        uhadd8          r14, r5,  r7
-        it              ne
-        ldrne           r7,  [r1, #4]
-        stm             r0,  {r8,r9}
-        add             r0,  r0,  r2
-        stm             r0,  {r12,r14}
-        add             r0,  r0,  r2
-        bne             1b
-
-        pop             {r4-r9, pc}
-endfunc
-
-function ff_avg_pixels8_armv6, export=1
-        pld             [r1, r2]
-        push            {r4-r10, lr}
-        mov             lr,  #1
-        orr             lr,  lr,  lr,  lsl #8
-        orr             lr,  lr,  lr,  lsl #16
-        ldrd            r4,  r5,  [r0]
-        ldr             r10, [r1, #4]
-        ldr_post        r9,  r1,  r2
-        subs            r3,  r3,  #2
-1:
-        pld             [r1, r2]
-        eor             r8,  r4,  r9
-        uhadd8          r4,  r4,  r9
-        eor             r12, r5,  r10
-        ldrd_reg        r6,  r7,  r0,  r2
-        uhadd8          r5,  r5,  r10
-        and             r8,  r8,  lr
-        ldr             r10, [r1, #4]
-        and             r12, r12, lr
-        uadd8           r4,  r4,  r8
-        ldr_post        r9,  r1,  r2
-        eor             r8,  r6,  r9
-        uadd8           r5,  r5,  r12
-        pld             [r1, r2,  lsl #1]
-        eor             r12, r7,  r10
-        uhadd8          r6,  r6,  r9
-        strd_post       r4,  r5,  r0,  r2
-        uhadd8          r7,  r7,  r10
-        beq             2f
-        and             r8,  r8,  lr
-        ldrd_reg        r4,  r5,  r0,  r2
-        uadd8           r6,  r6,  r8
-        ldr             r10, [r1, #4]
-        and             r12, r12, lr
-        subs            r3,  r3,  #2
-        uadd8           r7,  r7,  r12
-        ldr_post        r9,  r1,  r2
-        strd_post       r6,  r7,  r0,  r2
-        b               1b
-2:
-        and             r8,  r8,  lr
-        and             r12, r12, lr
-        uadd8           r6,  r6,  r8
-        uadd8           r7,  r7,  r12
-        strd_post       r6,  r7,  r0,  r2
-
-        pop             {r4-r10, pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/hpeldsp_init_arm.c b/deps/libav/libavcodec/arm/hpeldsp_init_arm.c
deleted file mode 100644
index 8176afe..0000000
--- a/deps/libav/libavcodec/arm/hpeldsp_init_arm.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * ARM optimized DSP utils
- * Copyright (c) 2001 Lionel Ulmer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/cpu.h"
-#include "libavutil/attributes.h"
-#include "libavcodec/rnd_avg.h"
-#include "hpeldsp_arm.h"
-
-void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-
-void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-
-void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-
-CALL_2X_PIXELS(ff_put_pixels16_x2_arm,         ff_put_pixels8_x2_arm,        8)
-CALL_2X_PIXELS(ff_put_pixels16_y2_arm,         ff_put_pixels8_y2_arm,        8)
-CALL_2X_PIXELS(ff_put_pixels16_xy2_arm,        ff_put_pixels8_xy2_arm,       8)
-CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm,  ff_put_no_rnd_pixels8_x2_arm, 8)
-CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm,  ff_put_no_rnd_pixels8_y2_arm, 8)
-CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
-
-av_cold void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    c->put_pixels_tab[0][0] = ff_put_pixels16_arm;
-    c->put_pixels_tab[0][1] = ff_put_pixels16_x2_arm;
-    c->put_pixels_tab[0][2] = ff_put_pixels16_y2_arm;
-    c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_arm;
-    c->put_pixels_tab[1][0] = ff_put_pixels8_arm;
-    c->put_pixels_tab[1][1] = ff_put_pixels8_x2_arm;
-    c->put_pixels_tab[1][2] = ff_put_pixels8_y2_arm;
-    c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_arm;
-
-    c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_arm;
-    c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_arm;
-    c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_arm;
-    c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_arm;
-    c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_arm;
-    c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_arm;
-    c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_arm;
-    c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_arm;
-
-    if (have_armv6(cpu_flags))
-        ff_hpeldsp_init_armv6(c, flags);
-    if (have_neon(cpu_flags))
-        ff_hpeldsp_init_neon(c, flags);
-}
diff --git a/deps/libav/libavcodec/arm/hpeldsp_init_armv6.c b/deps/libav/libavcodec/arm/hpeldsp_init_armv6.c
deleted file mode 100644
index 67a500d..0000000
--- a/deps/libav/libavcodec/arm/hpeldsp_init_armv6.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "hpeldsp_arm.h"
-
-void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels16_y2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-
-void ff_put_pixels16_x2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels16_y2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-
-void ff_avg_pixels16_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-
-void ff_put_pixels8_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_x2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_y2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-
-void ff_put_pixels8_x2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_y2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-
-void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
-
-av_cold void ff_hpeldsp_init_armv6(HpelDSPContext *c, int flags)
-{
-    c->put_pixels_tab[0][0] = ff_put_pixels16_armv6;
-    c->put_pixels_tab[0][1] = ff_put_pixels16_x2_armv6;
-    c->put_pixels_tab[0][2] = ff_put_pixels16_y2_armv6;
-/*     c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_armv6; */
-    c->put_pixels_tab[1][0] = ff_put_pixels8_armv6;
-    c->put_pixels_tab[1][1] = ff_put_pixels8_x2_armv6;
-    c->put_pixels_tab[1][2] = ff_put_pixels8_y2_armv6;
-/*     c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_armv6; */
-
-    c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_armv6;
-    c->put_no_rnd_pixels_tab[0][1] = ff_put_pixels16_x2_no_rnd_armv6;
-    c->put_no_rnd_pixels_tab[0][2] = ff_put_pixels16_y2_no_rnd_armv6;
-/*     c->put_no_rnd_pixels_tab[0][3] = ff_put_pixels16_xy2_no_rnd_armv6; */
-    c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_armv6;
-    c->put_no_rnd_pixels_tab[1][1] = ff_put_pixels8_x2_no_rnd_armv6;
-    c->put_no_rnd_pixels_tab[1][2] = ff_put_pixels8_y2_no_rnd_armv6;
-/*     c->put_no_rnd_pixels_tab[1][3] = ff_put_pixels8_xy2_no_rnd_armv6; */
-
-    c->avg_pixels_tab[0][0] = ff_avg_pixels16_armv6;
-    c->avg_pixels_tab[1][0] = ff_avg_pixels8_armv6;
-}
diff --git a/deps/libav/libavcodec/arm/hpeldsp_init_neon.c b/deps/libav/libavcodec/arm/hpeldsp_init_neon.c
deleted file mode 100644
index 76d4eaf..0000000
--- a/deps/libav/libavcodec/arm/hpeldsp_init_neon.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "hpeldsp_arm.h"
-
-void ff_put_pixels16_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels16_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels16_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_put_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-
-void ff_avg_pixels16_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels16_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels16_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels16_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels8_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels8_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels8_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-void ff_avg_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
-
-av_cold void ff_hpeldsp_init_neon(HpelDSPContext *c, int flags)
-{
-    c->put_pixels_tab[0][0] = ff_put_pixels16_neon;
-    c->put_pixels_tab[0][1] = ff_put_pixels16_x2_neon;
-    c->put_pixels_tab[0][2] = ff_put_pixels16_y2_neon;
-    c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_neon;
-    c->put_pixels_tab[1][0] = ff_put_pixels8_neon;
-    c->put_pixels_tab[1][1] = ff_put_pixels8_x2_neon;
-    c->put_pixels_tab[1][2] = ff_put_pixels8_y2_neon;
-    c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_neon;
-
-    c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_neon;
-    c->put_no_rnd_pixels_tab[0][1] = ff_put_pixels16_x2_no_rnd_neon;
-    c->put_no_rnd_pixels_tab[0][2] = ff_put_pixels16_y2_no_rnd_neon;
-    c->put_no_rnd_pixels_tab[0][3] = ff_put_pixels16_xy2_no_rnd_neon;
-    c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_neon;
-    c->put_no_rnd_pixels_tab[1][1] = ff_put_pixels8_x2_no_rnd_neon;
-    c->put_no_rnd_pixels_tab[1][2] = ff_put_pixels8_y2_no_rnd_neon;
-    c->put_no_rnd_pixels_tab[1][3] = ff_put_pixels8_xy2_no_rnd_neon;
-
-    c->avg_pixels_tab[0][0] = ff_avg_pixels16_neon;
-    c->avg_pixels_tab[0][1] = ff_avg_pixels16_x2_neon;
-    c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_neon;
-    c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_neon;
-    c->avg_pixels_tab[1][0] = ff_avg_pixels8_neon;
-    c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_neon;
-    c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_neon;
-    c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_neon;
-
-    c->avg_no_rnd_pixels_tab[0] = ff_avg_pixels16_neon;
-    c->avg_no_rnd_pixels_tab[1] = ff_avg_pixels16_x2_no_rnd_neon;
-    c->avg_no_rnd_pixels_tab[2] = ff_avg_pixels16_y2_no_rnd_neon;
-    c->avg_no_rnd_pixels_tab[3] = ff_avg_pixels16_xy2_no_rnd_neon;
-}
diff --git a/deps/libav/libavcodec/arm/hpeldsp_neon.S b/deps/libav/libavcodec/arm/hpeldsp_neon.S
deleted file mode 100644
index 90bc3cb..0000000
--- a/deps/libav/libavcodec/arm/hpeldsp_neon.S
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-.macro  pixels16        rnd=1, avg=0
-  .if \avg
-        mov             r12, r0
-  .endif
-1:      vld1.8          {q0},     [r1], r2
-        vld1.8          {q1},     [r1], r2
-        vld1.8          {q2},     [r1], r2
-        pld             [r1, r2, lsl #2]
-        vld1.8          {q3},     [r1], r2
-        pld             [r1]
-        pld             [r1, r2]
-        pld             [r1, r2, lsl #1]
-  .if \avg
-        vld1.8          {q8},     [r12,:128], r2
-        vrhadd.u8       q0,  q0,  q8
-        vld1.8          {q9},     [r12,:128], r2
-        vrhadd.u8       q1,  q1,  q9
-        vld1.8          {q10},    [r12,:128], r2
-        vrhadd.u8       q2,  q2,  q10
-        vld1.8          {q11},    [r12,:128], r2
-        vrhadd.u8       q3,  q3,  q11
-  .endif
-        subs            r3,  r3,  #4
-        vst1.64         {q0},     [r0,:128], r2
-        vst1.64         {q1},     [r0,:128], r2
-        vst1.64         {q2},     [r0,:128], r2
-        vst1.64         {q3},     [r0,:128], r2
-        bne             1b
-        bx              lr
-.endm
-
-.macro  pixels16_x2     rnd=1, avg=0
-1:      vld1.8          {d0-d2},  [r1], r2
-        vld1.8          {d4-d6},  [r1], r2
-        pld             [r1]
-        pld             [r1, r2]
-        subs            r3,  r3,  #2
-        vext.8          q1,  q0,  q1,  #1
-        avg             q0,  q0,  q1
-        vext.8          q3,  q2,  q3,  #1
-        avg             q2,  q2,  q3
-  .if \avg
-        vld1.8          {q1},     [r0,:128], r2
-        vld1.8          {q3},     [r0,:128]
-        vrhadd.u8       q0,  q0,  q1
-        vrhadd.u8       q2,  q2,  q3
-        sub             r0,  r0,  r2
-  .endif
-        vst1.8          {q0},     [r0,:128], r2
-        vst1.8          {q2},     [r0,:128], r2
-        bne             1b
-        bx              lr
-.endm
-
-.macro  pixels16_y2     rnd=1, avg=0
-        sub             r3,  r3,  #2
-        vld1.8          {q0},     [r1], r2
-        vld1.8          {q1},     [r1], r2
-1:      subs            r3,  r3,  #2
-        avg             q2,  q0,  q1
-        vld1.8          {q0},     [r1], r2
-        avg             q3,  q0,  q1
-        vld1.8          {q1},     [r1], r2
-        pld             [r1]
-        pld             [r1, r2]
-  .if \avg
-        vld1.8          {q8},     [r0,:128], r2
-        vld1.8          {q9},     [r0,:128]
-        vrhadd.u8       q2,  q2,  q8
-        vrhadd.u8       q3,  q3,  q9
-        sub             r0,  r0,  r2
-  .endif
-        vst1.8          {q2},     [r0,:128], r2
-        vst1.8          {q3},     [r0,:128], r2
-        bne             1b
-
-        avg             q2,  q0,  q1
-        vld1.8          {q0},     [r1], r2
-        avg             q3,  q0,  q1
-  .if \avg
-        vld1.8          {q8},     [r0,:128], r2
-        vld1.8          {q9},     [r0,:128]
-        vrhadd.u8       q2,  q2,  q8
-        vrhadd.u8       q3,  q3,  q9
-        sub             r0,  r0,  r2
-  .endif
-        vst1.8          {q2},     [r0,:128], r2
-        vst1.8          {q3},     [r0,:128], r2
-
-        bx              lr
-.endm
-
-.macro  pixels16_xy2    rnd=1, avg=0
-        sub             r3,  r3,  #2
-        vld1.8          {d0-d2},  [r1], r2
-        vld1.8          {d4-d6},  [r1], r2
-NRND    vmov.i16        q13, #1
-        pld             [r1]
-        pld             [r1, r2]
-        vext.8          q1,  q0,  q1,  #1
-        vext.8          q3,  q2,  q3,  #1
-        vaddl.u8        q8,  d0,  d2
-        vaddl.u8        q10, d1,  d3
-        vaddl.u8        q9,  d4,  d6
-        vaddl.u8        q11, d5,  d7
-1:      subs            r3,  r3,  #2
-        vld1.8          {d0-d2},  [r1], r2
-        vadd.u16        q12, q8,  q9
-        pld             [r1]
-NRND    vadd.u16        q12, q12, q13
-        vext.8          q15, q0,  q1,  #1
-        vadd.u16        q1 , q10, q11
-        shrn            d28, q12, #2
-NRND    vadd.u16        q1,  q1,  q13
-        shrn            d29, q1,  #2
-  .if \avg
-        vld1.8          {q8},     [r0,:128]
-        vrhadd.u8       q14, q14, q8
-  .endif
-        vaddl.u8        q8,  d0,  d30
-        vld1.8          {d2-d4},  [r1], r2
-        vaddl.u8        q10, d1,  d31
-        vst1.8          {q14},    [r0,:128], r2
-        vadd.u16        q12, q8,  q9
-        pld             [r1, r2]
-NRND    vadd.u16        q12, q12, q13
-        vext.8          q2,  q1,  q2,  #1
-        vadd.u16        q0,  q10, q11
-        shrn            d30, q12, #2
-NRND    vadd.u16        q0,  q0,  q13
-        shrn            d31, q0,  #2
-  .if \avg
-        vld1.8          {q9},     [r0,:128]
-        vrhadd.u8       q15, q15, q9
-  .endif
-        vaddl.u8        q9,  d2,  d4
-        vaddl.u8        q11, d3,  d5
-        vst1.8          {q15},    [r0,:128], r2
-        bgt             1b
-
-        vld1.8          {d0-d2},  [r1], r2
-        vadd.u16        q12, q8,  q9
-NRND    vadd.u16        q12, q12, q13
-        vext.8          q15, q0,  q1,  #1
-        vadd.u16        q1 , q10, q11
-        shrn            d28, q12, #2
-NRND    vadd.u16        q1,  q1,  q13
-        shrn            d29, q1,  #2
-  .if \avg
-        vld1.8          {q8},     [r0,:128]
-        vrhadd.u8       q14, q14, q8
-  .endif
-        vaddl.u8        q8,  d0,  d30
-        vaddl.u8        q10, d1,  d31
-        vst1.8          {q14},    [r0,:128], r2
-        vadd.u16        q12, q8,  q9
-NRND    vadd.u16        q12, q12, q13
-        vadd.u16        q0,  q10, q11
-        shrn            d30, q12, #2
-NRND    vadd.u16        q0,  q0,  q13
-        shrn            d31, q0,  #2
-  .if \avg
-        vld1.8          {q9},     [r0,:128]
-        vrhadd.u8       q15, q15, q9
-  .endif
-        vst1.8          {q15},    [r0,:128], r2
-
-        bx              lr
-.endm
-
-.macro  pixels8         rnd=1, avg=0
-1:      vld1.8          {d0},     [r1], r2
-        vld1.8          {d1},     [r1], r2
-        vld1.8          {d2},     [r1], r2
-        pld             [r1, r2, lsl #2]
-        vld1.8          {d3},     [r1], r2
-        pld             [r1]
-        pld             [r1, r2]
-        pld             [r1, r2, lsl #1]
-  .if \avg
-        vld1.8          {d4},     [r0,:64], r2
-        vrhadd.u8       d0,  d0,  d4
-        vld1.8          {d5},     [r0,:64], r2
-        vrhadd.u8       d1,  d1,  d5
-        vld1.8          {d6},     [r0,:64], r2
-        vrhadd.u8       d2,  d2,  d6
-        vld1.8          {d7},     [r0,:64], r2
-        vrhadd.u8       d3,  d3,  d7
-        sub             r0,  r0,  r2,  lsl #2
-  .endif
-        subs            r3,  r3,  #4
-        vst1.8          {d0},     [r0,:64], r2
-        vst1.8          {d1},     [r0,:64], r2
-        vst1.8          {d2},     [r0,:64], r2
-        vst1.8          {d3},     [r0,:64], r2
-        bne             1b
-        bx              lr
-.endm
-
-.macro  pixels8_x2      rnd=1, avg=0
-1:      vld1.8          {q0},     [r1], r2
-        vext.8          d1,  d0,  d1,  #1
-        vld1.8          {q1},     [r1], r2
-        vext.8          d3,  d2,  d3,  #1
-        pld             [r1]
-        pld             [r1, r2]
-        subs            r3,  r3,  #2
-        vswp            d1,  d2
-        avg             q0,  q0,  q1
-  .if \avg
-        vld1.8          {d4},     [r0,:64], r2
-        vld1.8          {d5},     [r0,:64]
-        vrhadd.u8       q0,  q0,  q2
-        sub             r0,  r0,  r2
-  .endif
-        vst1.8          {d0},     [r0,:64], r2
-        vst1.8          {d1},     [r0,:64], r2
-        bne             1b
-        bx              lr
-.endm
-
-.macro  pixels8_y2      rnd=1, avg=0
-        sub             r3,  r3,  #2
-        vld1.8          {d0},     [r1], r2
-        vld1.8          {d1},     [r1], r2
-1:      subs            r3,  r3,  #2
-        avg             d4,  d0,  d1
-        vld1.8          {d0},     [r1], r2
-        avg             d5,  d0,  d1
-        vld1.8          {d1},     [r1], r2
-        pld             [r1]
-        pld             [r1, r2]
-  .if \avg
-        vld1.8          {d2},     [r0,:64], r2
-        vld1.8          {d3},     [r0,:64]
-        vrhadd.u8       q2,  q2,  q1
-        sub             r0,  r0,  r2
-  .endif
-        vst1.8          {d4},     [r0,:64], r2
-        vst1.8          {d5},     [r0,:64], r2
-        bne             1b
-
-        avg             d4,  d0,  d1
-        vld1.8          {d0},     [r1], r2
-        avg             d5,  d0,  d1
-  .if \avg
-        vld1.8          {d2},     [r0,:64], r2
-        vld1.8          {d3},     [r0,:64]
-        vrhadd.u8       q2,  q2,  q1
-        sub             r0,  r0,  r2
-  .endif
-        vst1.8          {d4},     [r0,:64], r2
-        vst1.8          {d5},     [r0,:64], r2
-
-        bx              lr
-.endm
-
-.macro  pixels8_xy2     rnd=1, avg=0
-        sub             r3,  r3,  #2
-        vld1.8          {q0},     [r1], r2
-        vld1.8          {q1},     [r1], r2
-NRND    vmov.i16        q11, #1
-        pld             [r1]
-        pld             [r1, r2]
-        vext.8          d4,  d0,  d1,  #1
-        vext.8          d6,  d2,  d3,  #1
-        vaddl.u8        q8,  d0,  d4
-        vaddl.u8        q9,  d2,  d6
-1:      subs            r3,  r3,  #2
-        vld1.8          {q0},     [r1], r2
-        pld             [r1]
-        vadd.u16        q10, q8,  q9
-        vext.8          d4,  d0,  d1,  #1
-NRND    vadd.u16        q10, q10, q11
-        vaddl.u8        q8,  d0,  d4
-        shrn            d5,  q10, #2
-        vld1.8          {q1},     [r1], r2
-        vadd.u16        q10, q8,  q9
-        pld             [r1, r2]
-  .if \avg
-        vld1.8          {d7},     [r0,:64]
-        vrhadd.u8       d5,  d5,  d7
-  .endif
-NRND    vadd.u16        q10, q10, q11
-        vst1.8          {d5},     [r0,:64], r2
-        shrn            d7,  q10, #2
-  .if \avg
-        vld1.8          {d5},     [r0,:64]
-        vrhadd.u8       d7,  d7,  d5
-  .endif
-        vext.8          d6,  d2,  d3,  #1
-        vaddl.u8        q9,  d2,  d6
-        vst1.8          {d7},     [r0,:64], r2
-        bgt             1b
-
-        vld1.8          {q0},     [r1], r2
-        vadd.u16        q10, q8,  q9
-        vext.8          d4,  d0,  d1,  #1
-NRND    vadd.u16        q10, q10, q11
-        vaddl.u8        q8,  d0,  d4
-        shrn            d5,  q10, #2
-        vadd.u16        q10, q8,  q9
-  .if \avg
-        vld1.8          {d7},     [r0,:64]
-        vrhadd.u8       d5,  d5,  d7
-  .endif
-NRND    vadd.u16        q10, q10, q11
-        vst1.8          {d5},     [r0,:64], r2
-        shrn            d7,  q10, #2
-  .if \avg
-        vld1.8          {d5},     [r0,:64]
-        vrhadd.u8       d7,  d7,  d5
-  .endif
-        vst1.8          {d7},     [r0,:64], r2
-
-        bx              lr
-.endm
-
-.macro  pixfunc         pfx, name, suf, rnd=1, avg=0
-  .if \rnd
-    .macro avg  rd, rn, rm
-        vrhadd.u8       \rd, \rn, \rm
-    .endm
-    .macro shrn rd, rn, rm
-        vrshrn.u16      \rd, \rn, \rm
-    .endm
-    .macro NRND insn:vararg
-    .endm
-  .else
-    .macro avg  rd, rn, rm
-        vhadd.u8        \rd, \rn, \rm
-    .endm
-    .macro shrn rd, rn, rm
-        vshrn.u16       \rd, \rn, \rm
-    .endm
-    .macro NRND insn:vararg
-        \insn
-    .endm
-  .endif
-function ff_\pfx\name\suf\()_neon, export=1
-        \name           \rnd, \avg
-endfunc
-        .purgem         avg
-        .purgem         shrn
-        .purgem         NRND
-.endm
-
-.macro  pixfunc2        pfx, name, avg=0
-        pixfunc         \pfx, \name,          rnd=1, avg=\avg
-        pixfunc         \pfx, \name, _no_rnd, rnd=0, avg=\avg
-.endm
-
-function ff_put_h264_qpel16_mc00_neon, export=1
-        mov             r3,  #16
-endfunc
-
-        pixfunc         put_, pixels16,     avg=0
-        pixfunc2        put_, pixels16_x2,  avg=0
-        pixfunc2        put_, pixels16_y2,  avg=0
-        pixfunc2        put_, pixels16_xy2, avg=0
-
-function ff_avg_h264_qpel16_mc00_neon, export=1
-        mov             r3,  #16
-endfunc
-
-        pixfunc         avg_, pixels16,     avg=1
-        pixfunc2        avg_, pixels16_x2,  avg=1
-        pixfunc2        avg_, pixels16_y2,  avg=1
-        pixfunc2        avg_, pixels16_xy2, avg=1
-
-function ff_put_h264_qpel8_mc00_neon, export=1
-        mov             r3,  #8
-endfunc
-
-        pixfunc         put_, pixels8,     avg=0
-        pixfunc2        put_, pixels8_x2,  avg=0
-        pixfunc2        put_, pixels8_y2,  avg=0
-        pixfunc2        put_, pixels8_xy2, avg=0
-
-function ff_avg_h264_qpel8_mc00_neon, export=1
-        mov             r3,  #8
-endfunc
-
-        pixfunc         avg_, pixels8,     avg=1
-        pixfunc         avg_, pixels8_x2,  avg=1
-        pixfunc         avg_, pixels8_y2,  avg=1
-        pixfunc         avg_, pixels8_xy2, avg=1
diff --git a/deps/libav/libavcodec/arm/int_neon.S b/deps/libav/libavcodec/arm/int_neon.S
deleted file mode 100644
index 3d2faff..0000000
--- a/deps/libav/libavcodec/arm/int_neon.S
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * ARM NEON optimised integer operations
- * Copyright (c) 2009 Kostya Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_scalarproduct_int16_neon, export=1
-        vmov.i16        q0,  #0
-        vmov.i16        q1,  #0
-        vmov.i16        q2,  #0
-        vmov.i16        q3,  #0
-1:      vld1.16         {d16-d17}, [r0]!
-        vld1.16         {d20-d21}, [r1,:128]!
-        vmlal.s16       q0,  d16,  d20
-        vld1.16         {d18-d19}, [r0]!
-        vmlal.s16       q1,  d17,  d21
-        vld1.16         {d22-d23}, [r1,:128]!
-        vmlal.s16       q2,  d18,  d22
-        vmlal.s16       q3,  d19,  d23
-        subs            r2,  r2,   #16
-        bne             1b
-
-        vpadd.s32       d16, d0,   d1
-        vpadd.s32       d17, d2,   d3
-        vpadd.s32       d18, d4,   d5
-        vpadd.s32       d19, d6,   d7
-        vpadd.s32       d0,  d16,  d17
-        vpadd.s32       d1,  d18,  d19
-        vpadd.s32       d2,  d0,   d1
-        vpaddl.s32      d3,  d2
-        vmov.32         r0,  d3[0]
-        bx              lr
-endfunc
-
-@ scalarproduct_and_madd_int16(/*aligned*/v0,v1,v2,order,mul)
-function ff_scalarproduct_and_madd_int16_neon, export=1
-        vld1.16         {d28[],d29[]}, [sp]
-        vmov.i16        q0,  #0
-        vmov.i16        q1,  #0
-        vmov.i16        q2,  #0
-        vmov.i16        q3,  #0
-        mov             r12, r0
-
-1:      vld1.16         {d16-d17}, [r0,:128]!
-        vld1.16         {d18-d19}, [r1]!
-        vld1.16         {d20-d21}, [r2]!
-        vld1.16         {d22-d23}, [r0,:128]!
-        vld1.16         {d24-d25}, [r1]!
-        vld1.16         {d26-d27}, [r2]!
-        vmul.s16        q10, q10,  q14
-        vmul.s16        q13, q13,  q14
-        vmlal.s16       q0,  d16,  d18
-        vmlal.s16       q1,  d17,  d19
-        vadd.s16        q10, q8,   q10
-        vadd.s16        q13, q11,  q13
-        vmlal.s16       q2,  d22,  d24
-        vmlal.s16       q3,  d23,  d25
-        vst1.16         {q10},     [r12,:128]!
-        subs            r3,  r3,   #16
-        vst1.16         {q13},     [r12,:128]!
-        bne             1b
-
-        vpadd.s32       d16, d0,   d1
-        vpadd.s32       d17, d2,   d3
-        vpadd.s32       d18, d4,   d5
-        vpadd.s32       d19, d6,   d7
-        vpadd.s32       d0,  d16,  d17
-        vpadd.s32       d1,  d18,  d19
-        vpadd.s32       d2,  d0,   d1
-        vpaddl.s32      d3,  d2
-        vmov.32         r0,  d3[0]
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/jrevdct_arm.S b/deps/libav/libavcodec/arm/jrevdct_arm.S
deleted file mode 100644
index f951e2a..0000000
--- a/deps/libav/libavcodec/arm/jrevdct_arm.S
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
-   C-like prototype :
-        void j_rev_dct_arm(DCTBLOCK data)
-
-   With DCTBLOCK being a pointer to an array of 64 'signed shorts'
-
-   Copyright (c) 2001 Lionel Ulmer (lionel.ulmer at free.fr / bbrox at bbrox.org)
-
-   Permission is hereby granted, free of charge, to any person obtaining a copy
-   of this software and associated documentation files (the "Software"), to deal
-   in the Software without restriction, including without limitation the rights
-   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-   copies of the Software, and to permit persons to whom the Software is
-   furnished to do so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included in
-   all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-   COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-   IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-*/
-
-#include "libavutil/arm/asm.S"
-
-#define FIX_0_298631336 2446
-#define FIX_0_541196100 4433
-#define FIX_0_765366865 6270
-#define FIX_1_175875602 9633
-#define FIX_1_501321110 12299
-#define FIX_2_053119869 16819
-#define FIX_3_072711026 25172
-#define FIX_M_0_390180644 -3196
-#define FIX_M_0_899976223 -7373
-#define FIX_M_1_847759065 -15137
-#define FIX_M_1_961570560 -16069
-#define FIX_M_2_562915447 -20995
-#define FIX_0xFFFF 0xFFFF
-
-#define FIX_0_298631336_ID      0
-#define FIX_0_541196100_ID      4
-#define FIX_0_765366865_ID      8
-#define FIX_1_175875602_ID     12
-#define FIX_1_501321110_ID     16
-#define FIX_2_053119869_ID     20
-#define FIX_3_072711026_ID     24
-#define FIX_M_0_390180644_ID   28
-#define FIX_M_0_899976223_ID   32
-#define FIX_M_1_847759065_ID   36
-#define FIX_M_1_961570560_ID   40
-#define FIX_M_2_562915447_ID   44
-#define FIX_0xFFFF_ID          48
-
-function ff_j_rev_dct_arm, export=1
-        push {r0, r4 - r11, lr}
-
-        mov lr, r0                      @ lr = pointer to the current row
-        mov r12, #8                     @ r12 = row-counter
-        movrel r11, const_array         @ r11 = base pointer to the constants array
-row_loop:
-        ldrsh r0, [lr, # 0]             @ r0 = 'd0'
-        ldrsh r2, [lr, # 2]             @ r2 = 'd2'
-
-        @ Optimization for row that have all items except the first set to 0
-        @ (this works as the int16_t are always 4-byte aligned)
-        ldr r5, [lr, # 0]
-        ldr r6, [lr, # 4]
-        ldr r3, [lr, # 8]
-        ldr r4, [lr, #12]
-        orr r3, r3, r4
-        orr r3, r3, r6
-        orrs r5, r3, r5
-        beq end_of_row_loop             @ nothing to be done as ALL of them are '0'
-        orrs r3, r3, r2
-        beq empty_row
-
-        ldrsh r1, [lr, # 8]             @ r1 = 'd1'
-        ldrsh r4, [lr, # 4]             @ r4 = 'd4'
-        ldrsh r6, [lr, # 6]             @ r6 = 'd6'
-
-        ldr r3, [r11, #FIX_0_541196100_ID]
-        add r7, r2, r6
-        ldr r5, [r11, #FIX_M_1_847759065_ID]
-        mul r7, r3, r7                      @ r7 = z1
-        ldr r3, [r11, #FIX_0_765366865_ID]
-        mla r6, r5, r6, r7                  @ r6 = tmp2
-        add r5, r0, r4                      @ r5 = tmp0
-        mla r2, r3, r2, r7                  @ r2 = tmp3
-        sub r3, r0, r4                      @ r3 = tmp1
-
-        add r0, r2, r5, lsl #13             @ r0 = tmp10
-        rsb r2, r2, r5, lsl #13             @ r2 = tmp13
-        add r4, r6, r3, lsl #13             @ r4 = tmp11
-        rsb r3, r6, r3, lsl #13             @ r3 = tmp12
-
-        push {r0, r2, r3, r4} @ save on the stack tmp10, tmp13, tmp12, tmp11
-
-        ldrsh r3, [lr, #10]             @ r3 = 'd3'
-        ldrsh r5, [lr, #12]             @ r5 = 'd5'
-        ldrsh r7, [lr, #14]             @ r7 = 'd7'
-
-        add r0, r3, r5                        @ r0 = 'z2'
-        add r2, r1, r7                  @ r2 = 'z1'
-        add r4, r3, r7                  @ r4 = 'z3'
-        add r6, r1, r5                  @ r6 = 'z4'
-        ldr r9, [r11, #FIX_1_175875602_ID]
-        add r8, r4, r6                  @ r8 = z3 + z4
-        ldr r10, [r11, #FIX_M_0_899976223_ID]
-        mul r8, r9, r8                  @ r8 = 'z5'
-        ldr r9, [r11, #FIX_M_2_562915447_ID]
-        mul r2, r10, r2                 @ r2 = 'z1'
-        ldr r10, [r11, #FIX_M_1_961570560_ID]
-        mul r0, r9, r0                  @ r0 = 'z2'
-        ldr r9, [r11, #FIX_M_0_390180644_ID]
-        mla r4, r10, r4, r8             @ r4 = 'z3'
-        ldr r10, [r11, #FIX_0_298631336_ID]
-        mla r6, r9, r6, r8              @ r6 = 'z4'
-        ldr r9, [r11, #FIX_2_053119869_ID]
-        mla r7, r10, r7, r2             @ r7 = tmp0 + z1
-        ldr r10, [r11, #FIX_3_072711026_ID]
-        mla r5, r9, r5, r0              @ r5 = tmp1 + z2
-        ldr r9, [r11, #FIX_1_501321110_ID]
-        mla r3, r10, r3, r0             @ r3 = tmp2 + z2
-        add r7, r7, r4                  @ r7 = tmp0
-        mla r1, r9, r1, r2              @ r1 = tmp3 + z1
-        add r5,        r5, r6                  @ r5 = tmp1
-        add r3, r3, r4                  @ r3 = tmp2
-        add r1, r1, r6                  @ r1 = tmp3
-
-        pop {r0, r2, r4, r6} @ r0 = tmp10 / r2 = tmp13 / r4 = tmp12 / r6 = tmp11
-                             @ r1 = tmp3  / r3 = tmp2  / r5 = tmp1  / r7 = tmp0
-
-        @ Compute DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS)
-        add r8, r0, r1
-        add r8, r8, #(1<<10)
-        mov r8, r8, asr #11
-        strh r8, [lr, # 0]
-
-        @ Compute DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS)
-        sub r8, r0, r1
-        add r8, r8, #(1<<10)
-        mov r8, r8, asr #11
-        strh r8, [lr, #14]
-
-        @ Compute DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS)
-        add r8, r6, r3
-        add r8, r8, #(1<<10)
-        mov r8, r8, asr #11
-        strh r8, [lr, # 2]
-
-        @ Compute DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS)
-        sub r8, r6, r3
-        add r8, r8, #(1<<10)
-        mov r8, r8, asr #11
-        strh r8, [lr, #12]
-
-        @ Compute DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS)
-        add r8, r4, r5
-        add r8, r8, #(1<<10)
-        mov r8, r8, asr #11
-        strh r8, [lr, # 4]
-
-        @ Compute DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS)
-        sub r8, r4, r5
-        add r8, r8, #(1<<10)
-        mov r8, r8, asr #11
-        strh r8, [lr, #10]
-
-        @ Compute DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS)
-        add r8, r2, r7
-        add r8, r8, #(1<<10)
-        mov r8, r8, asr #11
-        strh r8, [lr, # 6]
-
-        @ Compute DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS)
-        sub r8, r2, r7
-        add r8, r8, #(1<<10)
-        mov r8, r8, asr #11
-        strh r8, [lr, # 8]
-
-        @ End of row loop
-        add lr, lr, #16
-        subs r12, r12, #1
-        bne row_loop
-        beq start_column_loop
-
-empty_row:
-        ldr r1, [r11, #FIX_0xFFFF_ID]
-        mov r0, r0, lsl #2
-        and r0, r0, r1
-        add r0, r0, r0, lsl #16
-        str r0, [lr, # 0]
-        str r0, [lr, # 4]
-        str r0, [lr, # 8]
-        str r0, [lr, #12]
-
-end_of_row_loop:
-        @ End of loop
-        add lr, lr, #16
-        subs r12, r12, #1
-        bne row_loop
-
-start_column_loop:
-        @ Start of column loop
-        pop {lr}
-        mov r12, #8
-column_loop:
-        ldrsh r0, [lr, #( 0*8)]             @ r0 = 'd0'
-        ldrsh r2, [lr, #( 4*8)]             @ r2 = 'd2'
-        ldrsh r4, [lr, #( 8*8)]             @ r4 = 'd4'
-        ldrsh r6, [lr, #(12*8)]             @ r6 = 'd6'
-
-        ldr r3, [r11, #FIX_0_541196100_ID]
-        add r1, r2, r6
-        ldr r5, [r11, #FIX_M_1_847759065_ID]
-        mul r1, r3, r1                      @ r1 = z1
-        ldr r3, [r11, #FIX_0_765366865_ID]
-        mla r6, r5, r6, r1                  @ r6 = tmp2
-        add r5, r0, r4                      @ r5 = tmp0
-        mla r2, r3, r2, r1                  @ r2 = tmp3
-        sub r3, r0, r4                      @ r3 = tmp1
-
-        add r0, r2, r5, lsl #13             @ r0 = tmp10
-        rsb r2, r2, r5, lsl #13             @ r2 = tmp13
-        add r4, r6, r3, lsl #13             @ r4 = tmp11
-        rsb r6, r6, r3, lsl #13             @ r6 = tmp12
-
-        ldrsh r1, [lr, #( 2*8)]             @ r1 = 'd1'
-        ldrsh r3, [lr, #( 6*8)]             @ r3 = 'd3'
-        ldrsh r5, [lr, #(10*8)]             @ r5 = 'd5'
-        ldrsh r7, [lr, #(14*8)]             @ r7 = 'd7'
-
-        @ Check for empty odd column (happens about 20 to 25 % of the time according to my stats)
-        orr r9, r1, r3
-        orr r10, r5, r7
-        orrs r10, r9, r10
-        beq empty_odd_column
-
-        push {r0, r2, r4, r6} @ save on the stack tmp10, tmp13, tmp12, tmp11
-
-        add r0, r3, r5                  @ r0 = 'z2'
-        add r2, r1, r7                  @ r2 = 'z1'
-        add r4, r3, r7                  @ r4 = 'z3'
-        add r6, r1, r5                  @ r6 = 'z4'
-        ldr r9, [r11, #FIX_1_175875602_ID]
-        add r8, r4, r6
-        ldr r10, [r11, #FIX_M_0_899976223_ID]
-        mul r8, r9, r8                  @ r8 = 'z5'
-        ldr r9, [r11, #FIX_M_2_562915447_ID]
-        mul r2, r10, r2                 @ r2 = 'z1'
-        ldr r10, [r11, #FIX_M_1_961570560_ID]
-        mul r0, r9, r0                  @ r0 = 'z2'
-        ldr r9, [r11, #FIX_M_0_390180644_ID]
-        mla r4, r10, r4, r8             @ r4 = 'z3'
-        ldr r10, [r11, #FIX_0_298631336_ID]
-        mla r6, r9, r6, r8              @ r6 = 'z4'
-        ldr r9, [r11, #FIX_2_053119869_ID]
-        mla r7, r10, r7, r2             @ r7 = tmp0 + z1
-        ldr r10, [r11, #FIX_3_072711026_ID]
-        mla r5, r9, r5, r0              @ r5 = tmp1 + z2
-        ldr r9, [r11, #FIX_1_501321110_ID]
-        mla r3, r10, r3, r0             @ r3 = tmp2 + z2
-        add r7, r7, r4                  @ r7 = tmp0
-        mla r1, r9, r1, r2              @ r1 = tmp3 + z1
-        add r5,        r5, r6                  @ r5 = tmp1
-        add r3, r3, r4                  @ r3 = tmp2
-        add r1, r1, r6                  @ r1 = tmp3
-
-        pop {r0, r2, r4, r6} @ r0 = tmp10 / r2 = tmp13 / r4 = tmp11 / r6 = tmp12
-                             @ r1 = tmp3  / r3 = tmp2  / r5 = tmp1  / r7 = tmp0
-
-        @ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
-        add r8, r0, r1
-        add r8, r8, #(1<<17)
-        mov r8, r8, asr #18
-        strh r8, [lr, #( 0*8)]
-
-        @ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
-        sub r8, r0, r1
-        add r8, r8, #(1<<17)
-        mov r8, r8, asr #18
-        strh r8, [lr, #(14*8)]
-
-        @ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
-        add r8, r4, r3
-        add r8, r8, #(1<<17)
-        mov r8, r8, asr #18
-        strh r8, [lr, #( 2*8)]
-
-        @ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
-        sub r8, r4, r3
-        add r8, r8, #(1<<17)
-        mov r8, r8, asr #18
-        strh r8, [lr, #(12*8)]
-
-        @ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
-        add r8, r6, r5
-        add r8, r8, #(1<<17)
-        mov r8, r8, asr #18
-        strh r8, [lr, #( 4*8)]
-
-        @ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
-        sub r8, r6, r5
-        add r8, r8, #(1<<17)
-        mov r8, r8, asr #18
-        strh r8, [lr, #(10*8)]
-
-        @ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
-        add r8, r2, r7
-        add r8, r8, #(1<<17)
-        mov r8, r8, asr #18
-        strh r8, [lr, #( 6*8)]
-
-        @ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
-        sub r8, r2, r7
-        add r8, r8, #(1<<17)
-        mov r8, r8, asr #18
-        strh r8, [lr, #( 8*8)]
-
-        @ End of row loop
-        add lr, lr, #2
-        subs r12, r12, #1
-        bne column_loop
-        beq the_end
-
-empty_odd_column:
-        @ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
-        @ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
-        add r0, r0, #(1<<17)
-        mov r0, r0, asr #18
-        strh r0, [lr, #( 0*8)]
-        strh r0, [lr, #(14*8)]
-
-        @ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
-        @ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
-        add r4, r4, #(1<<17)
-        mov r4, r4, asr #18
-        strh r4, [lr, #( 2*8)]
-        strh r4, [lr, #(12*8)]
-
-        @ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
-        @ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
-        add r6, r6, #(1<<17)
-        mov r6, r6, asr #18
-        strh r6, [lr, #( 4*8)]
-        strh r6, [lr, #(10*8)]
-
-        @ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
-        @ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
-        add r2, r2, #(1<<17)
-        mov r2, r2, asr #18
-        strh r2, [lr, #( 6*8)]
-        strh r2, [lr, #( 8*8)]
-
-        @ End of row loop
-        add lr, lr, #2
-        subs r12, r12, #1
-        bne column_loop
-
-the_end:
-        @ The end....
-        pop {r4 - r11, pc}
-endfunc
-
-const const_array
-        .word FIX_0_298631336
-        .word FIX_0_541196100
-        .word FIX_0_765366865
-        .word FIX_1_175875602
-        .word FIX_1_501321110
-        .word FIX_2_053119869
-        .word FIX_3_072711026
-        .word FIX_M_0_390180644
-        .word FIX_M_0_899976223
-        .word FIX_M_1_847759065
-        .word FIX_M_1_961570560
-        .word FIX_M_2_562915447
-        .word FIX_0xFFFF
-endconst
diff --git a/deps/libav/libavcodec/arm/mathops.h b/deps/libav/libavcodec/arm/mathops.h
deleted file mode 100644
index 45ac67d..0000000
--- a/deps/libav/libavcodec/arm/mathops.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * simple math operations
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at> et al
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_MATHOPS_H
-#define AVCODEC_ARM_MATHOPS_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/common.h"
-
-#if HAVE_INLINE_ASM
-
-#if HAVE_ARMV6_INLINE
-#define MULH MULH
-static inline av_const int MULH(int a, int b)
-{
-    int r;
-    __asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
-    return r;
-}
-
-#define FASTDIV FASTDIV
-static av_always_inline av_const int FASTDIV(int a, int b)
-{
-    int r;
-    __asm__ ("cmp     %2, #2               \n\t"
-             "ldr     %0, [%3, %2, lsl #2] \n\t"
-             "ite     le                   \n\t"
-             "lsrle   %0, %1, #1           \n\t"
-             "smmulgt %0, %0, %1           \n\t"
-             : "=&r"(r) : "r"(a), "r"(b), "r"(ff_inverse) : "cc");
-    return r;
-}
-
-#else /* HAVE_ARMV6_INLINE */
-
-#define FASTDIV FASTDIV
-static av_always_inline av_const int FASTDIV(int a, int b)
-{
-    int r, t;
-    __asm__ ("umull %1, %0, %2, %3"
-             : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b]));
-    return r;
-}
-#endif
-
-#define MLS64(d, a, b) MAC64(d, -(a), b)
-
-#if HAVE_ARMV5TE_INLINE
-
-/* signed 16x16 -> 32 multiply add accumulate */
-#   define MAC16(rt, ra, rb)                                            \
-    __asm__ ("smlabb %0, %1, %2, %0" : "+r"(rt) : "r"(ra), "r"(rb));
-
-/* signed 16x16 -> 32 multiply */
-#   define MUL16 MUL16
-static inline av_const int MUL16(int ra, int rb)
-{
-    int rt;
-    __asm__ ("smulbb %0, %1, %2" : "=r"(rt) : "r"(ra), "r"(rb));
-    return rt;
-}
-
-#endif
-
-#define mid_pred mid_pred
-static inline av_const int mid_pred(int a, int b, int c)
-{
-    int m;
-    __asm__ (
-        "mov   %0, %2  \n\t"
-        "cmp   %1, %2  \n\t"
-        "itt   gt      \n\t"
-        "movgt %0, %1  \n\t"
-        "movgt %1, %2  \n\t"
-        "cmp   %1, %3  \n\t"
-        "it    le      \n\t"
-        "movle %1, %3  \n\t"
-        "cmp   %0, %1  \n\t"
-        "it    gt      \n\t"
-        "movgt %0, %1  \n\t"
-        : "=&r"(m), "+r"(a)
-        : "r"(b), "r"(c)
-        : "cc");
-    return m;
-}
-
-#endif /* HAVE_INLINE_ASM */
-
-#endif /* AVCODEC_ARM_MATHOPS_H */
diff --git a/deps/libav/libavcodec/arm/mdct_fixed_neon.S b/deps/libav/libavcodec/arm/mdct_fixed_neon.S
deleted file mode 100644
index c77be59..0000000
--- a/deps/libav/libavcodec/arm/mdct_fixed_neon.S
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-.macro  prerot          dst, rt
-        lsr             r3,  r6,  #2            @ n4
-        add             \rt, r4,  r6,  lsr #1   @ revtab + n4
-        add             r9,  r3,  r3,  lsl #1   @ n3
-        add             r8,  r7,  r6            @ tcos + n4
-        add             r3,  r2,  r6,  lsr #1   @ in + n4
-        add             r9,  r2,  r9,  lsl #1   @ in + n3
-        sub             r8,  r8,  #16
-        sub             r10, r3,  #16
-        sub             r11, r9,  #16
-        mov             r12, #-16
-1:
-        vld2.16         {d0,d1},  [r9, :128]!
-        vld2.16         {d2,d3},  [r11,:128], r12
-        vld2.16         {d4,d5},  [r3, :128]!
-        vld2.16         {d6,d7},  [r10,:128], r12
-        vld2.16         {d16,d17},[r7, :128]!   @ cos, sin
-        vld2.16         {d18,d19},[r8, :128], r12
-        vrev64.16       q1,  q1
-        vrev64.16       q3,  q3
-        vrev64.16       q9,  q9
-        vneg.s16        d0,  d0
-        vneg.s16        d2,  d2
-        vneg.s16        d16, d16
-        vneg.s16        d18, d18
-        vhsub.s16       d0,  d0,  d3            @ re
-        vhsub.s16       d4,  d7,  d4            @ im
-        vhsub.s16       d6,  d6,  d5
-        vhsub.s16       d2,  d2,  d1
-        vmull.s16       q10, d0,  d16
-        vmlsl.s16       q10, d4,  d17
-        vmull.s16       q11, d0,  d17
-        vmlal.s16       q11, d4,  d16
-        vmull.s16       q12, d6,  d18
-        vmlsl.s16       q12, d2,  d19
-        vmull.s16       q13, d6,  d19
-        vmlal.s16       q13, d2,  d18
-        vshrn.s32       d0,  q10, #15
-        vshrn.s32       d1,  q11, #15
-        vshrn.s32       d2,  q12, #15
-        vshrn.s32       d3,  q13, #15
-        vzip.16         d0,  d1
-        vzip.16         d2,  d3
-        ldrh            lr,  [r4], #2
-        ldrh            r2,  [\rt, #-2]!
-        add             lr,  \dst, lr,  lsl #2
-        add             r2,  \dst, r2,  lsl #2
-        vst1.32         {d0[0]},  [lr,:32]
-        vst1.32         {d2[0]},  [r2,:32]
-        ldrh            lr,  [r4], #2
-        ldrh            r2,  [\rt, #-2]!
-        add             lr,  \dst, lr,  lsl #2
-        add             r2,  \dst, r2,  lsl #2
-        vst1.32         {d0[1]},  [lr,:32]
-        vst1.32         {d2[1]},  [r2,:32]
-        ldrh            lr,  [r4], #2
-        ldrh            r2,  [\rt, #-2]!
-        add             lr,  \dst, lr,  lsl #2
-        add             r2,  \dst, r2,  lsl #2
-        vst1.32         {d1[0]},  [lr,:32]
-        vst1.32         {d3[0]},  [r2,:32]
-        ldrh            lr,  [r4], #2
-        ldrh            r2,  [\rt, #-2]!
-        add             lr,  \dst, lr,  lsl #2
-        add             r2,  \dst, r2,  lsl #2
-        vst1.32         {d1[1]},  [lr,:32]
-        vst1.32         {d3[1]},  [r2,:32]
-        subs            r6,  r6,  #32
-        bgt             1b
-.endm
-
-function ff_mdct_fixed_calc_neon, export=1
-        push            {r1,r4-r11,lr}
-
-        ldr             r4,  [r0, #8]           @ revtab
-        ldr             r6,  [r0, #16]          @ mdct_size; n
-        ldr             r7,  [r0, #24]          @ tcos
-
-        prerot          r1,  r5
-
-        mov             r4,  r0
-        bl              X(ff_fft_fixed_calc_neon)
-
-        pop             {r5}
-        mov             r12, #-16
-        ldr             r6,  [r4, #16]          @ mdct_size; n
-        ldr             r7,  [r4, #24]          @ tcos
-        add             r5,  r5,  r6,  lsr #1
-        add             r7,  r7,  r6,  lsr #1
-        sub             r1,  r5,  #16
-        sub             r2,  r7,  #16
-1:
-        vld2.16         {d4,d5},  [r7,:128]!
-        vld2.16         {d6,d7},  [r2,:128], r12
-        vld2.16         {d0,d1},  [r5,:128]
-        vld2.16         {d2,d3},  [r1,:128]
-        vrev64.16       q3,  q3
-        vrev64.16       q1,  q1
-        vneg.s16        q3,  q3
-        vneg.s16        q2,  q2
-        vmull.s16       q11, d2,  d6
-        vmlal.s16       q11, d3,  d7
-        vmull.s16       q8,  d0,  d5
-        vmlsl.s16       q8,  d1,  d4
-        vmull.s16       q9,  d0,  d4
-        vmlal.s16       q9,  d1,  d5
-        vmull.s16       q10, d2,  d7
-        vmlsl.s16       q10, d3,  d6
-        vshrn.s32       d0,  q11, #15
-        vshrn.s32       d1,  q8,  #15
-        vshrn.s32       d2,  q9,  #15
-        vshrn.s32       d3,  q10, #15
-        vrev64.16       q0,  q0
-        vst2.16         {d2,d3},  [r5,:128]!
-        vst2.16         {d0,d1},  [r1,:128], r12
-        subs            r6,  r6,  #32
-        bgt             1b
-
-        pop             {r4-r11,pc}
-endfunc
-
-function ff_mdct_fixed_calcw_neon, export=1
-        push            {r1,r4-r11,lr}
-
-        ldrd            r4,  r5,  [r0, #8]      @ revtab, tmp_buf
-        ldr             r6,  [r0, #16]          @ mdct_size; n
-        ldr             r7,  [r0, #24]          @ tcos
-
-        prerot          r5,  r1
-
-        mov             r4,  r0
-        mov             r1,  r5
-        bl              X(ff_fft_fixed_calc_neon)
-
-        pop             {r7}
-        mov             r12, #-16
-        ldr             r6,  [r4, #16]          @ mdct_size; n
-        ldr             r9,  [r4, #24]          @ tcos
-        add             r5,  r5,  r6,  lsr #1
-        add             r7,  r7,  r6
-        add             r9,  r9,  r6,  lsr #1
-        sub             r3,  r5,  #16
-        sub             r1,  r7,  #16
-        sub             r2,  r9,  #16
-1:
-        vld2.16         {d4,d5},  [r9,:128]!
-        vld2.16         {d6,d7},  [r2,:128], r12
-        vld2.16         {d0,d1},  [r5,:128]!
-        vld2.16         {d2,d3},  [r3,:128], r12
-        vrev64.16       q3,  q3
-        vrev64.16       q1,  q1
-        vneg.s16        q3,  q3
-        vneg.s16        q2,  q2
-        vmull.s16       q8,  d2,  d6
-        vmlal.s16       q8,  d3,  d7
-        vmull.s16       q9,  d0,  d5
-        vmlsl.s16       q9,  d1,  d4
-        vmull.s16       q10, d0,  d4
-        vmlal.s16       q10, d1,  d5
-        vmull.s16       q11, d2,  d7
-        vmlsl.s16       q11, d3,  d6
-        vrev64.32       q8,  q8
-        vrev64.32       q9,  q9
-        vst2.32         {q10,q11},[r7,:128]!
-        vst2.32         {d16,d18},[r1,:128], r12
-        vst2.32         {d17,d19},[r1,:128], r12
-        subs            r6,  r6,  #32
-        bgt             1b
-
-        pop             {r4-r11,pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/mdct_neon.S b/deps/libav/libavcodec/arm/mdct_neon.S
deleted file mode 100644
index bfe259c..0000000
--- a/deps/libav/libavcodec/arm/mdct_neon.S
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * ARM NEON optimised MDCT
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-#define ff_fft_calc_neon X(ff_fft_calc_neon)
-
-function ff_imdct_half_neon, export=1
-        push            {r4-r8,lr}
-
-        mov             r12, #1
-        ldr             lr,  [r0, #20]          @ mdct_bits
-        ldr             r4,  [r0, #24]          @ tcos
-        ldr             r3,  [r0, #8]           @ revtab
-        lsl             r12, r12, lr            @ n  = 1 << nbits
-        lsr             lr,  r12, #2            @ n4 = n >> 2
-        add             r7,  r2,  r12,  lsl #1
-        mov             r12, #-16
-        sub             r7,  r7,  #16
-
-        vld2.32         {d16-d17},[r7,:128],r12 @ d16=x,n1 d17=x,n0
-        vld2.32         {d0-d1},  [r2,:128]!    @ d0 =m0,x d1 =m1,x
-        vrev64.32       d17, d17
-        vld2.32         {d2,d3},  [r4,:128]!    @ d2=c0,c1 d3=s0,s2
-        vmul.f32        d6,  d17, d2
-        vmul.f32        d7,  d0,  d2
-1:
-        subs            lr,  lr,  #2
-        ldr             r6,  [r3], #4
-        vmul.f32        d4,  d0,  d3
-        vmul.f32        d5,  d17, d3
-        vsub.f32        d4,  d6,  d4
-        vadd.f32        d5,  d5,  d7
-        uxth            r8,  r6,  ror #16
-        uxth            r6,  r6
-        add             r8,  r1,  r8,  lsl #3
-        add             r6,  r1,  r6,  lsl #3
-        beq             1f
-        vld2.32         {d16-d17},[r7,:128],r12
-        vld2.32         {d0-d1},  [r2,:128]!
-        vrev64.32       d17, d17
-        vld2.32         {d2,d3},  [r4,:128]!    @ d2=c0,c1 d3=s0,s2
-        vmul.f32        d6,  d17, d2
-        vmul.f32        d7,  d0,  d2
-        vst2.32         {d4[0],d5[0]}, [r6,:64]
-        vst2.32         {d4[1],d5[1]}, [r8,:64]
-        b               1b
-1:
-        vst2.32         {d4[0],d5[0]}, [r6,:64]
-        vst2.32         {d4[1],d5[1]}, [r8,:64]
-
-        mov             r4,  r0
-        mov             r6,  r1
-        bl              ff_fft_calc_neon
-
-        mov             r12, #1
-        ldr             lr,  [r4, #20]          @ mdct_bits
-        ldr             r4,  [r4, #24]          @ tcos
-        lsl             r12, r12, lr            @ n  = 1 << nbits
-        lsr             lr,  r12, #3            @ n8 = n >> 3
-
-        add             r4,  r4,  lr,  lsl #3
-        add             r6,  r6,  lr,  lsl #3
-        sub             r1,  r4,  #16
-        sub             r3,  r6,  #16
-
-        mov             r7,  #-16
-        mov             r8,  r6
-        mov             r0,  r3
-
-        vld2.32         {d0-d1},  [r3,:128], r7 @ d0 =i1,r1 d1 =i0,r0
-        vld2.32         {d20-d21},[r6,:128]!    @ d20=i2,r2 d21=i3,r3
-        vld2.32         {d16,d18},[r1,:128], r7 @ d16=c1,c0 d18=s1,s0
-1:
-        subs            lr,  lr,  #2
-        vmul.f32        d7,  d0,  d18
-        vld2.32         {d17,d19},[r4,:128]!    @ d17=c2,c3 d19=s2,s3
-        vmul.f32        d4,  d1,  d18
-        vmul.f32        d5,  d21, d19
-        vmul.f32        d6,  d20, d19
-        vmul.f32        d22, d1,  d16
-        vmul.f32        d23, d21, d17
-        vmul.f32        d24, d0,  d16
-        vmul.f32        d25, d20, d17
-        vadd.f32        d7,  d7,  d22
-        vadd.f32        d6,  d6,  d23
-        vsub.f32        d4,  d4,  d24
-        vsub.f32        d5,  d5,  d25
-        beq             1f
-        vld2.32         {d0-d1},  [r3,:128], r7
-        vld2.32         {d20-d21},[r6,:128]!
-        vld2.32         {d16,d18},[r1,:128], r7 @ d16=c1,c0 d18=s1,s0
-        vrev64.32       q3,  q3
-        vst2.32         {d4,d6},  [r0,:128], r7
-        vst2.32         {d5,d7},  [r8,:128]!
-        b               1b
-1:
-        vrev64.32       q3,  q3
-        vst2.32         {d4,d6},  [r0,:128]
-        vst2.32         {d5,d7},  [r8,:128]
-
-        pop             {r4-r8,pc}
-endfunc
-
-function ff_imdct_calc_neon, export=1
-        push            {r4-r6,lr}
-
-        ldr             r3,  [r0, #20]
-        mov             r4,  #1
-        mov             r5,  r1
-        lsl             r4,  r4,  r3
-        add             r1,  r1,  r4
-
-        bl              X(ff_imdct_half_neon)
-
-        add             r0,  r5,  r4,  lsl #2
-        add             r1,  r5,  r4,  lsl #1
-        sub             r0,  r0,  #8
-        sub             r2,  r1,  #16
-        mov             r3,  #-16
-        mov             r6,  #-8
-        vmov.i32        d30, #1<<31
-1:
-        vld1.32         {d0-d1},  [r2,:128], r3
-        pld             [r0, #-16]
-        vrev64.32       q0,  q0
-        vld1.32         {d2-d3},  [r1,:128]!
-        veor            d4,  d1,  d30
-        pld             [r2, #-16]
-        vrev64.32       q1,  q1
-        veor            d5,  d0,  d30
-        vst1.32         {d2},     [r0,:64], r6
-        vst1.32         {d3},     [r0,:64], r6
-        vst1.32         {d4-d5},  [r5,:128]!
-        subs            r4,  r4,  #16
-        bgt             1b
-
-        pop             {r4-r6,pc}
-endfunc
-
-function ff_mdct_calc_neon, export=1
-        push            {r4-r10,lr}
-
-        mov             r12, #1
-        ldr             lr,  [r0, #20]          @ mdct_bits
-        ldr             r4,  [r0, #24]          @ tcos
-        ldr             r3,  [r0, #8]           @ revtab
-        lsl             lr,  r12, lr            @ n  = 1 << nbits
-        add             r7,  r2,  lr            @ in4u
-        sub             r9,  r7,  #16           @ in4d
-        add             r2,  r7,  lr,  lsl #1   @ in3u
-        add             r8,  r9,  lr,  lsl #1   @ in3d
-        add             r5,  r4,  lr,  lsl #1
-        sub             r5,  r5,  #16
-        sub             r3,  r3,  #4
-        mov             r12, #-16
-
-        vld2.32         {d16,d18},[r9,:128],r12 @ in0u0,in0u1 in4d1,in4d0
-        vld2.32         {d17,d19},[r8,:128],r12 @ in2u0,in2u1 in3d1,in3d0
-        vld2.32         {d0, d2}, [r7,:128]!    @ in4u0,in4u1 in2d1,in2d0
-        vrev64.32       q9,  q9                 @ in4d0,in4d1 in3d0,in3d1
-        vld2.32         {d1, d3}, [r2,:128]!    @ in3u0,in3u1 in1d1,in1d0
-        vsub.f32        d0,  d18, d0            @ in4d-in4u      I
-        vld2.32         {d20,d21},[r4,:128]!    @ c0,c1 s0,s1
-        vrev64.32       q1,  q1                 @ in2d0,in2d1 in1d0,in1d1
-        vld2.32         {d30,d31},[r5,:128],r12 @ c2,c3 s2,s3
-        vadd.f32        d1,  d1,  d19           @ in3u+in3d     -R
-        vsub.f32        d16, d16, d2            @ in0u-in2d      R
-        vadd.f32        d17, d17, d3            @ in2u+in1d     -I
-1:
-        vmul.f32        d7,  d0,  d21           @  I*s
-A       ldr             r10, [r3, lr, lsr #1]
-T       lsr             r10, lr,  #1
-T       ldr             r10, [r3, r10]
-        vmul.f32        d6,  d1,  d20           @ -R*c
-        ldr             r6,  [r3, #4]!
-        vmul.f32        d4,  d1,  d21           @ -R*s
-        vmul.f32        d5,  d0,  d20           @  I*c
-        vmul.f32        d24, d16, d30           @  R*c
-        vmul.f32        d25, d17, d31           @ -I*s
-        vmul.f32        d22, d16, d31           @  R*s
-        vmul.f32        d23, d17, d30           @  I*c
-        subs            lr,  lr,  #16
-        vsub.f32        d6,  d6,  d7            @ -R*c-I*s
-        vadd.f32        d7,  d4,  d5            @ -R*s+I*c
-        vsub.f32        d24, d25, d24           @ I*s-R*c
-        vadd.f32        d25, d22, d23           @ R*s-I*c
-        beq             1f
-        mov             r12, #-16
-        vld2.32         {d16,d18},[r9,:128],r12 @ in0u0,in0u1 in4d1,in4d0
-        vld2.32         {d17,d19},[r8,:128],r12 @ in2u0,in2u1 in3d1,in3d0
-        vneg.f32        d7,  d7                 @  R*s-I*c
-        vld2.32         {d0, d2}, [r7,:128]!    @ in4u0,in4u1 in2d1,in2d0
-        vrev64.32       q9,  q9                 @ in4d0,in4d1 in3d0,in3d1
-        vld2.32         {d1, d3}, [r2,:128]!    @ in3u0,in3u1 in1d1,in1d0
-        vsub.f32        d0,  d18, d0            @ in4d-in4u      I
-        vld2.32         {d20,d21},[r4,:128]!    @ c0,c1 s0,s1
-        vrev64.32       q1,  q1                 @ in2d0,in2d1 in1d0,in1d1
-        vld2.32         {d30,d31},[r5,:128],r12 @ c2,c3 s2,s3
-        vadd.f32        d1,  d1,  d19           @ in3u+in3d     -R
-        vsub.f32        d16, d16, d2            @ in0u-in2d      R
-        vadd.f32        d17, d17, d3            @ in2u+in1d     -I
-        uxth            r12, r6,  ror #16
-        uxth            r6,  r6
-        add             r12, r1,  r12, lsl #3
-        add             r6,  r1,  r6,  lsl #3
-        vst2.32         {d6[0],d7[0]}, [r6,:64]
-        vst2.32         {d6[1],d7[1]}, [r12,:64]
-        uxth            r6,  r10, ror #16
-        uxth            r10, r10
-        add             r6 , r1,  r6,  lsl #3
-        add             r10, r1,  r10, lsl #3
-        vst2.32         {d24[0],d25[0]},[r10,:64]
-        vst2.32         {d24[1],d25[1]},[r6,:64]
-        b               1b
-1:
-        vneg.f32        d7,  d7                 @  R*s-I*c
-        uxth            r12, r6,  ror #16
-        uxth            r6,  r6
-        add             r12, r1,  r12, lsl #3
-        add             r6,  r1,  r6,  lsl #3
-        vst2.32         {d6[0],d7[0]}, [r6,:64]
-        vst2.32         {d6[1],d7[1]}, [r12,:64]
-        uxth            r6,  r10, ror #16
-        uxth            r10, r10
-        add             r6 , r1,  r6,  lsl #3
-        add             r10, r1,  r10, lsl #3
-        vst2.32         {d24[0],d25[0]},[r10,:64]
-        vst2.32         {d24[1],d25[1]},[r6,:64]
-
-        mov             r4,  r0
-        mov             r6,  r1
-        bl              ff_fft_calc_neon
-
-        mov             r12, #1
-        ldr             lr,  [r4, #20]          @ mdct_bits
-        ldr             r4,  [r4, #24]          @ tcos
-        lsl             r12, r12, lr            @ n  = 1 << nbits
-        lsr             lr,  r12, #3            @ n8 = n >> 3
-
-        add             r4,  r4,  lr,  lsl #3
-        add             r6,  r6,  lr,  lsl #3
-        sub             r1,  r4,  #16
-        sub             r3,  r6,  #16
-
-        mov             r7,  #-16
-        mov             r8,  r6
-        mov             r0,  r3
-
-        vld2.32         {d0-d1},  [r3,:128], r7 @ d0 =r1,i1 d1 =r0,i0
-        vld2.32         {d20-d21},[r6,:128]!    @ d20=r2,i2 d21=r3,i3
-        vld2.32         {d16,d18},[r1,:128], r7 @ c1,c0 s1,s0
-1:
-        subs            lr,  lr,  #2
-        vmul.f32        d7,  d0,  d18           @ r1*s1,r0*s0
-        vld2.32         {d17,d19},[r4,:128]!    @ c2,c3 s2,s3
-        vmul.f32        d4,  d1,  d18           @ i1*s1,i0*s0
-        vmul.f32        d5,  d21, d19           @ i2*s2,i3*s3
-        vmul.f32        d6,  d20, d19           @ r2*s2,r3*s3
-        vmul.f32        d24, d0,  d16           @ r1*c1,r0*c0
-        vmul.f32        d25, d20, d17           @ r2*c2,r3*c3
-        vmul.f32        d22, d21, d17           @ i2*c2,i3*c3
-        vmul.f32        d23, d1,  d16           @ i1*c1,i0*c0
-        vadd.f32        d4,  d4,  d24           @ i1*s1+r1*c1,i0*s0+r0*c0
-        vadd.f32        d5,  d5,  d25           @ i2*s2+r2*c2,i3*s3+r3*c3
-        vsub.f32        d6,  d22, d6            @ i2*c2-r2*s2,i3*c3-r3*s3
-        vsub.f32        d7,  d23, d7            @ i1*c1-r1*s1,i0*c0-r0*s0
-        vneg.f32        q2,  q2
-        beq             1f
-        vld2.32         {d0-d1},  [r3,:128], r7
-        vld2.32         {d20-d21},[r6,:128]!
-        vld2.32         {d16,d18},[r1,:128], r7 @ c1,c0 s1,s0
-        vrev64.32       q3,  q3
-        vst2.32         {d4,d6},  [r0,:128], r7
-        vst2.32         {d5,d7},  [r8,:128]!
-        b               1b
-1:
-        vrev64.32       q3,  q3
-        vst2.32         {d4,d6},  [r0,:128]
-        vst2.32         {d5,d7},  [r8,:128]
-
-        pop             {r4-r10,pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/mdct_vfp.S b/deps/libav/libavcodec/arm/mdct_vfp.S
deleted file mode 100644
index 94db24f..0000000
--- a/deps/libav/libavcodec/arm/mdct_vfp.S
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (c) 2013 RISC OS Open Ltd
- * Author: Ben Avison <bavison at riscosopen.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-CONTEXT .req    a1
-ORIGOUT .req    a2
-IN      .req    a3
-OUT     .req    v1
-REVTAB  .req    v2
-TCOS    .req    v3
-TSIN    .req    v4
-OLDFPSCR .req   v5
-J0      .req    a2
-J1      .req    a4
-J2      .req    ip
-J3      .req    lr
-
-.macro prerotation_innerloop
- .set trig_lo, k
- .set trig_hi, n4 - k - 2
- .set in_lo, trig_lo * 2
- .set in_hi, trig_hi * 2
-        vldr    d8, [TCOS, #trig_lo*4]          @ s16,s17
-        vldr    d9, [TCOS, #trig_hi*4]          @ s18,s19
-        vldr    s0, [IN, #in_hi*4 + 12]
-        vldr    s1, [IN, #in_hi*4 + 4]
-        vldr    s2, [IN, #in_lo*4 + 12]
-        vldr    s3, [IN, #in_lo*4 + 4]
-        vmul.f  s8, s0, s16                     @ vector operation
-        vldr    d10, [TSIN, #trig_lo*4]         @ s20,s21
-        vldr    d11, [TSIN, #trig_hi*4]         @ s22,s23
-        vldr    s4, [IN, #in_lo*4]
-        vldr    s5, [IN, #in_lo*4 + 8]
-        vldr    s6, [IN, #in_hi*4]
-        vldr    s7, [IN, #in_hi*4 + 8]
-        ldr     J0, [REVTAB, #trig_lo*2]
-        vmul.f  s12, s0, s20                    @ vector operation
-        ldr     J2, [REVTAB, #trig_hi*2]
-        mov     J1, J0, lsr #16
-        and     J0, J0, #255                    @ halfword value will be < n4
-        vmls.f  s8, s4, s20                     @ vector operation
-        mov     J3, J2, lsr #16
-        and     J2, J2, #255                    @ halfword value will be < n4
-        add     J0, OUT, J0, lsl #3
-        vmla.f  s12, s4, s16                    @ vector operation
-        add     J1, OUT, J1, lsl #3
-        add     J2, OUT, J2, lsl #3
-        add     J3, OUT, J3, lsl #3
-        vstr    s8, [J0]
-        vstr    s9, [J1]
-        vstr    s10, [J2]
-        vstr    s11, [J3]
-        vstr    s12, [J0, #4]
-        vstr    s13, [J1, #4]
-        vstr    s14, [J2, #4]
-        vstr    s15, [J3, #4]
- .set k, k + 2
-.endm
-
-.macro postrotation_innerloop tail, head
- .set trig_lo_head, n8 - k - 2
- .set trig_hi_head, n8 + k
- .set out_lo_head, trig_lo_head * 2
- .set out_hi_head, trig_hi_head * 2
- .set trig_lo_tail, n8 - (k - 2) - 2
- .set trig_hi_tail, n8 + (k - 2)
- .set out_lo_tail, trig_lo_tail * 2
- .set out_hi_tail, trig_hi_tail * 2
- .if (k & 2) == 0
-  TCOS_D0_HEAD .req d10 @ s20,s21
-  TCOS_D1_HEAD .req d11 @ s22,s23
-  TCOS_S0_TAIL .req s24
- .else
-  TCOS_D0_HEAD .req d12 @ s24,s25
-  TCOS_D1_HEAD .req d13 @ s26,s27
-  TCOS_S0_TAIL .req s20
- .endif
- .ifnc "\tail",""
-        vmls.f  s8, s0, TCOS_S0_TAIL        @ vector operation
- .endif
- .ifnc "\head",""
-        vldr    d8, [TSIN, #trig_lo_head*4] @ s16,s17
-        vldr    d9, [TSIN, #trig_hi_head*4] @ s18,s19
-        vldr    TCOS_D0_HEAD, [TCOS, #trig_lo_head*4]
- .endif
- .ifnc "\tail",""
-        vmla.f  s12, s4, TCOS_S0_TAIL       @ vector operation
- .endif
- .ifnc "\head",""
-        vldr    s0, [OUT, #out_lo_head*4]
-        vldr    s1, [OUT, #out_lo_head*4 + 8]
-        vldr    s2, [OUT, #out_hi_head*4]
-        vldr    s3, [OUT, #out_hi_head*4 + 8]
-        vldr    s4, [OUT, #out_lo_head*4 + 4]
-        vldr    s5, [OUT, #out_lo_head*4 + 12]
-        vldr    s6, [OUT, #out_hi_head*4 + 4]
-        vldr    s7, [OUT, #out_hi_head*4 + 12]
- .endif
- .ifnc "\tail",""
-        vstr    s8, [OUT, #out_lo_tail*4]
-        vstr    s9, [OUT, #out_lo_tail*4 + 8]
-        vstr    s10, [OUT, #out_hi_tail*4]
-        vstr    s11, [OUT, #out_hi_tail*4 + 8]
- .endif
- .ifnc "\head",""
-        vmul.f  s8, s4, s16                 @ vector operation
- .endif
- .ifnc "\tail",""
-        vstr    s12, [OUT, #out_hi_tail*4 + 12]
-        vstr    s13, [OUT, #out_hi_tail*4 + 4]
-        vstr    s14, [OUT, #out_lo_tail*4 + 12]
-        vstr    s15, [OUT, #out_lo_tail*4 + 4]
- .endif
- .ifnc "\head",""
-        vmul.f  s12, s0, s16                @ vector operation
-        vldr    TCOS_D1_HEAD, [TCOS, #trig_hi_head*4]
- .endif
- .unreq TCOS_D0_HEAD
- .unreq TCOS_D1_HEAD
- .unreq TCOS_S0_TAIL
- .ifnc "\head",""
-  .set k, k + 2
- .endif
-.endm
-
-
-/* void ff_imdct_half_vfp(FFTContext *s,
- *                        FFTSample *output,
- *                        const FFTSample *input)
- */
-function ff_imdct_half_vfp, export=1
-        ldr     ip, [CONTEXT, #5*4]         @ mdct_bits
-        teq     ip, #6
-        it      ne
-        bne     X(ff_imdct_half_c)          @ only case currently accelerated is the one used by DCA
-
- .set n, 1<<6
- .set n2, n/2
- .set n4, n/4
- .set n8, n/8
-
-        push    {v1-v5,lr}
-        vpush   {s16-s27}
-        fmrx    OLDFPSCR, FPSCR
-        ldr     lr, =0x03030000             @ RunFast mode, short vectors of length 4, stride 1
-        fmxr    FPSCR, lr
-        mov     OUT, ORIGOUT
-        ldr     REVTAB, [CONTEXT, #2*4]
-        ldr     TCOS, [CONTEXT, #6*4]
-        ldr     TSIN, [CONTEXT, #7*4]
-
- .set k, 0
- .rept n8/2
-        prerotation_innerloop
- .endr
-
-        fmxr    FPSCR, OLDFPSCR
-        mov     a1, OUT
-        bl      X(ff_fft16_vfp)
-        ldr     lr, =0x03030000             @ RunFast mode, short vectors of length 4, stride 1
-        fmxr    FPSCR, lr
-
- .set k, 0
-        postrotation_innerloop , head
- .rept n8/2 - 1
-        postrotation_innerloop tail, head
- .endr
-        postrotation_innerloop tail
-
-        fmxr    FPSCR, OLDFPSCR
-        vpop    {s16-s27}
-        pop     {v1-v5,pc}
-endfunc
-
-        .unreq  CONTEXT
-        .unreq  ORIGOUT
-        .unreq  IN
-        .unreq  OUT
-        .unreq  REVTAB
-        .unreq  TCOS
-        .unreq  TSIN
-        .unreq  OLDFPSCR
-        .unreq  J0
-        .unreq  J1
-        .unreq  J2
-        .unreq  J3
diff --git a/deps/libav/libavcodec/arm/mpegaudiodsp_fixed_armv6.S b/deps/libav/libavcodec/arm/mpegaudiodsp_fixed_armv6.S
deleted file mode 100644
index 49bd0bc..0000000
--- a/deps/libav/libavcodec/arm/mpegaudiodsp_fixed_armv6.S
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-.macro  skip            args:vararg
-.endm
-
-.macro  sum8            lo,  hi,  w, p, t1, t2, t3, t4, rsb=skip, offs=0
-        ldr             \t1, [\w, #4*\offs]
-        ldr             \t2, [\p, #4]!
-        \rsb            \t1, \t1, #0
-  .irpc i, 135
-        ldr             \t3, [\w, #4*64*\i+4*\offs]
-        ldr             \t4, [\p, #4*64*\i]
-        smlal           \lo, \hi, \t1, \t2
-        \rsb            \t3, \t3, #0
-        ldr             \t1, [\w, #4*64*(\i+1)+4*\offs]
-        ldr             \t2, [\p, #4*64*(\i+1)]
-        smlal           \lo, \hi, \t3, \t4
-        \rsb            \t1, \t1, #0
-  .endr
-        ldr             \t3, [\w, #4*64*7+4*\offs]
-        ldr             \t4, [\p, #4*64*7]
-        smlal           \lo, \hi, \t1, \t2
-        \rsb            \t3, \t3, #0
-        smlal           \lo, \hi, \t3, \t4
-.endm
-
-.macro  round           rd,  lo,  hi
-        lsr             \rd, \lo, #24
-        bic             \lo, \lo, #0xff000000
-        orr             \rd, \rd, \hi, lsl #8
-        mov             \hi, #0
-        ssat            \rd, #16, \rd
-.endm
-
-function ff_mpadsp_apply_window_fixed_armv6, export=1
-        push            {r2,r4-r11,lr}
-
-        add             r4,  r0,  #4*512        @ synth_buf + 512
-    .rept 4
-        ldm             r0!, {r5-r12}
-        stm             r4!, {r5-r12}
-    .endr
-
-        ldr             r4,  [sp, #40]          @ incr
-        sub             r0,  r0,  #4*17         @ synth_buf + 16
-        ldr             r8,  [r2]               @ sum:low
-        add             r2,  r0,  #4*32         @ synth_buf + 48
-        rsb             r5,  r4,  r4,  lsl #5   @ 31 * incr
-        lsl             r4,  r4,  #1
-        asr             r9,  r8,  #31           @ sum:high
-        add             r5,  r3,  r5,  lsl #1   @ samples2
-        add             r6,  r1,  #4*32         @ w2
-        str             r4,  [sp, #40]
-
-        sum8            r8,  r9,  r1,  r0,  r10, r11, r12, lr
-        sum8            r8,  r9,  r1,  r2,  r10, r11, r12, lr, rsb, 32
-        round           r10, r8,  r9
-        strh_post       r10, r3,  r4
-
-        mov             lr,  #15
-1:
-        ldr             r12, [r0, #4]!
-        ldr             r11, [r6, #-4]!
-        ldr             r10, [r1, #4]!
-  .irpc i, 0246
-    .if \i
-        ldr             r11, [r6, #4*64*\i]
-        ldr             r10, [r1, #4*64*\i]
-    .endif
-        rsb             r11, r11, #0
-        smlal           r8,  r9,  r10, r12
-        ldr             r10, [r0, #4*64*(\i+1)]
-    .ifeq \i
-        smull           r4, r7, r11, r12
-    .else
-        smlal           r4, r7, r11, r12
-    .endif
-        ldr             r11, [r6, #4*64*(\i+1)]
-        ldr             r12, [r1, #4*64*(\i+1)]
-        rsb             r11, r11, #0
-        smlal           r8,  r9,  r12, r10
-    .iflt \i-6
-        ldr             r12, [r0, #4*64*(\i+2)]
-    .else
-        ldr             r12, [r2, #-4]!
-    .endif
-        smlal           r4,  r7,  r11, r10
-  .endr
-  .irpc i, 0246
-        ldr             r10, [r1, #4*64*\i+4*32]
-        rsb             r12, r12, #0
-        ldr             r11, [r6, #4*64*\i+4*32]
-        smlal           r8,  r9,  r10, r12
-        ldr             r10, [r2, #4*64*(\i+1)]
-        smlal           r4,  r7,  r11, r12
-        ldr             r12, [r1, #4*64*(\i+1)+4*32]
-        rsb             r10, r10, #0
-        ldr             r11, [r6, #4*64*(\i+1)+4*32]
-        smlal           r8,  r9,  r12, r10
-    .iflt \i-6
-        ldr             r12, [r2, #4*64*(\i+2)]
-    .else
-        ldr             r12, [sp, #40]
-    .endif
-        smlal           r4,  r7,  r11, r10
-  .endr
-        round           r10, r8,  r9
-        adds            r8,  r8,  r4
-        adc             r9,  r9,  r7
-        strh_post       r10, r3,  r12
-        round           r11, r8,  r9
-        subs            lr,  lr,  #1
-        strh_dpost      r11, r5, r12
-        bgt             1b
-
-        sum8            r8,  r9,  r1,  r0,  r10, r11, r12, lr, rsb, 33
-        pop             {r4}
-        round           r10, r8,  r9
-        str             r8,  [r4]
-        strh            r10, [r3]
-
-        pop             {r4-r11,pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/mpegaudiodsp_init_arm.c b/deps/libav/libavcodec/arm/mpegaudiodsp_init_arm.c
deleted file mode 100644
index e73aee6..0000000
--- a/deps/libav/libavcodec/arm/mpegaudiodsp_init_arm.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/mpegaudiodsp.h"
-#include "config.h"
-
-void ff_mpadsp_apply_window_fixed_armv6(int32_t *synth_buf, int32_t *window,
-                                        int *dither, int16_t *out, int incr);
-
-av_cold void ff_mpadsp_init_arm(MPADSPContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_armv6(cpu_flags)) {
-        s->apply_window_fixed = ff_mpadsp_apply_window_fixed_armv6;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/mpegvideo_arm.c b/deps/libav/libavcodec/arm/mpegvideo_arm.c
deleted file mode 100644
index 0c04688..0000000
--- a/deps/libav/libavcodec/arm/mpegvideo_arm.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2002 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/mpegvideo.h"
-#include "mpegvideo_arm.h"
-#include "asm-offsets.h"
-
-#if HAVE_NEON
-CHK_OFFS(MpegEncContext, y_dc_scale,       Y_DC_SCALE);
-CHK_OFFS(MpegEncContext, c_dc_scale,       C_DC_SCALE);
-CHK_OFFS(MpegEncContext, ac_pred,          AC_PRED);
-CHK_OFFS(MpegEncContext, block_last_index, BLOCK_LAST_INDEX);
-CHK_OFFS(MpegEncContext, inter_scantable.raster_end, INTER_SCANTAB_RASTER_END);
-CHK_OFFS(MpegEncContext, h263_aic,         H263_AIC);
-#endif
-
-void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, int16_t *block,
-                                       int n, int qscale);
-void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, int16_t *block,
-                                       int n, int qscale);
-
-av_cold void ff_MPV_common_init_arm(MpegEncContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_armv5te(cpu_flags))
-        ff_MPV_common_init_armv5te(s);
-
-    if (have_neon(cpu_flags)) {
-        s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_neon;
-        s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/mpegvideo_arm.h b/deps/libav/libavcodec/arm/mpegvideo_arm.h
deleted file mode 100644
index 226ba69..0000000
--- a/deps/libav/libavcodec/arm/mpegvideo_arm.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_MPEGVIDEO_ARM_H
-#define AVCODEC_ARM_MPEGVIDEO_ARM_H
-
-#include "libavcodec/mpegvideo.h"
-
-void ff_MPV_common_init_armv5te(MpegEncContext *s);
-
-#endif /* AVCODEC_ARM_MPEGVIDEO_ARM_H */
diff --git a/deps/libav/libavcodec/arm/mpegvideo_armv5te.c b/deps/libav/libavcodec/arm/mpegvideo_armv5te.c
deleted file mode 100644
index 2066cbc..0000000
--- a/deps/libav/libavcodec/arm/mpegvideo_armv5te.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Optimization of some functions from mpegvideo.c for armv5te
- * Copyright (c) 2007 Siarhei Siamashka <ssvb at users.sourceforge.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/mpegvideo.h"
-#include "mpegvideo_arm.h"
-
-void ff_dct_unquantize_h263_armv5te(int16_t *block, int qmul, int qadd, int count);
-
-#ifdef ENABLE_ARM_TESTS
-/**
- * h263 dequantizer supplementary function, it is performance critical and needs to
- * have optimized implementations for each architecture. Is also used as a reference
- * implementation in regression tests
- */
-static inline void dct_unquantize_h263_helper_c(int16_t *block, int qmul, int qadd, int count)
-{
-    int i, level;
-    for (i = 0; i < count; i++) {
-        level = block[i];
-        if (level) {
-            if (level < 0) {
-                level = level * qmul - qadd;
-            } else {
-                level = level * qmul + qadd;
-            }
-            block[i] = level;
-        }
-    }
-}
-#endif
-
-static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,
-                                  int16_t *block, int n, int qscale)
-{
-    int level, qmul, qadd;
-    int nCoeffs;
-
-    assert(s->block_last_index[n]>=0);
-
-    qmul = qscale << 1;
-
-    if (!s->h263_aic) {
-        if (n < 4)
-            level = block[0] * s->y_dc_scale;
-        else
-            level = block[0] * s->c_dc_scale;
-        qadd = (qscale - 1) | 1;
-    }else{
-        qadd = 0;
-        level = block[0];
-    }
-    if(s->ac_pred)
-        nCoeffs=63;
-    else
-        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
-    ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
-    block[0] = level;
-}
-
-static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,
-                                  int16_t *block, int n, int qscale)
-{
-    int qmul, qadd;
-    int nCoeffs;
-
-    assert(s->block_last_index[n]>=0);
-
-    qadd = (qscale - 1) | 1;
-    qmul = qscale << 1;
-
-    nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
-    ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
-}
-
-av_cold void ff_MPV_common_init_armv5te(MpegEncContext *s)
-{
-    s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_armv5te;
-    s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_armv5te;
-}
diff --git a/deps/libav/libavcodec/arm/mpegvideo_armv5te_s.S b/deps/libav/libavcodec/arm/mpegvideo_armv5te_s.S
deleted file mode 100644
index 4426e15..0000000
--- a/deps/libav/libavcodec/arm/mpegvideo_armv5te_s.S
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Optimization of some functions from mpegvideo.c for armv5te
- * Copyright (c) 2007 Siarhei Siamashka <ssvb at users.sourceforge.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/arm/asm.S"
-
-/*
- * Special optimized version of dct_unquantize_h263_helper_c, it
- * requires the block to be at least 8 bytes aligned, and may process
- * more elements than requested.  But it is guaranteed to never
- * process more than 64 elements provided that count argument is <= 64,
- * so it is safe. This function is optimized for a common distribution
- * of values for nCoeffs (they are mostly multiple of 8 plus one or
- * two extra elements). So this function processes data as 8 elements
- * per loop iteration and contains optional 2 elements processing in
- * the end.
- *
- * Inner loop should take 6 cycles per element on arm926ej-s (Nokia 770)
- */
-
-.macro  dequant_t       dst, src, mul, add, tmp
-        rsbs            \tmp, ip, \src, asr #16
-        it              gt
-        addgt           \tmp, \add, #0
-        it              lt
-        rsblt           \tmp, \add, #0
-        it              ne
-        smlatbne        \dst, \src, \mul, \tmp
-.endm
-
-.macro  dequant_b       dst, src, mul, add, tmp
-        rsbs            \tmp, ip, \src, lsl #16
-        it              gt
-        addgt           \tmp, \add, #0
-        it              lt
-        rsblt           \tmp, \add, #0
-        it              ne
-        smlabbne        \dst, \src, \mul, \tmp
-.endm
-
-function ff_dct_unquantize_h263_armv5te, export=1
-        push            {r4-r9,lr}
-        mov             ip, #0
-        subs            r3, r3, #2
-        ble             2f
-        ldrd            r4, r5, [r0, #0]
-1:
-        ldrd            r6, r7, [r0, #8]
-
-        dequant_t       r9, r4, r1, r2, r9
-        dequant_t       lr, r5, r1, r2, lr
-        dequant_b       r4, r4, r1, r2, r8
-        dequant_b       r5, r5, r1, r2, r8
-
-        strh            r4, [r0], #2
-        strh            r9, [r0], #2
-        strh            r5, [r0], #2
-        strh            lr, [r0], #2
-
-        dequant_t       r9, r6, r1, r2, r9
-        dequant_t       lr, r7, r1, r2, lr
-        dequant_b       r6, r6, r1, r2, r8
-        dequant_b       r7, r7, r1, r2, r8
-
-        strh            r6, [r0], #2
-        strh            r9, [r0], #2
-        strh            r7, [r0], #2
-        strh            lr, [r0], #2
-
-        subs            r3, r3, #8
-        it              gt
-        ldrdgt          r4, r5, [r0, #0] /* load data early to avoid load/use pipeline stall */
-        bgt             1b
-
-        adds            r3, r3, #2
-        it              le
-        pople           {r4-r9,pc}
-2:
-        ldrsh           r9, [r0, #0]
-        ldrsh           lr, [r0, #2]
-        mov             r8, r2
-        cmp             r9, #0
-        it              lt
-        rsblt           r8, r2, #0
-        it              ne
-        smlabbne        r9, r9, r1, r8
-        mov             r8, r2
-        cmp             lr, #0
-        it              lt
-        rsblt           r8, r2, #0
-        it              ne
-        smlabbne        lr, lr, r1, r8
-        strh            r9, [r0], #2
-        strh            lr, [r0], #2
-        pop             {r4-r9,pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/mpegvideo_neon.S b/deps/libav/libavcodec/arm/mpegvideo_neon.S
deleted file mode 100644
index 3e1f7b5..0000000
--- a/deps/libav/libavcodec/arm/mpegvideo_neon.S
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-#include "asm-offsets.h"
-
-function ff_dct_unquantize_h263_inter_neon, export=1
-        add             r12, r0,  #BLOCK_LAST_INDEX
-        ldr             r12, [r12, r2, lsl #2]
-        add             r0,  r0,  #INTER_SCANTAB_RASTER_END
-        ldrb            r12, [r0, r12]
-        sub             r2,  r3,  #1
-        lsl             r0,  r3,  #1
-        orr             r2,  r2,  #1
-        add             r3,  r12, #1
-endfunc
-
-function ff_dct_unquantize_h263_neon, export=1
-        vdup.16         q15, r0                 @ qmul
-        vdup.16         q14, r2                 @ qadd
-        vneg.s16        q13, q14
-        cmp             r3,  #4
-        mov             r0,  r1
-        ble             2f
-1:
-        vld1.16         {q0},     [r0,:128]!
-        vclt.s16        q3,  q0,  #0
-        vld1.16         {q8},     [r0,:128]!
-        vceq.s16        q1,  q0,  #0
-        vmul.s16        q2,  q0,  q15
-        vclt.s16        q11, q8,  #0
-        vmul.s16        q10, q8,  q15
-        vbsl            q3,  q13, q14
-        vbsl            q11, q13, q14
-        vadd.s16        q2,  q2,  q3
-        vceq.s16        q9,  q8,  #0
-        vadd.s16        q10, q10, q11
-        vbif            q0,  q2,  q1
-        vbif            q8,  q10, q9
-        subs            r3,  r3,  #16
-        vst1.16         {q0},     [r1,:128]!
-        vst1.16         {q8},     [r1,:128]!
-        it              le
-        bxle            lr
-        cmp             r3,  #8
-        bgt             1b
-2:
-        vld1.16         {d0},     [r0,:64]
-        vclt.s16        d3,  d0,  #0
-        vceq.s16        d1,  d0,  #0
-        vmul.s16        d2,  d0,  d30
-        vbsl            d3,  d26, d28
-        vadd.s16        d2,  d2,  d3
-        vbif            d0,  d2,  d1
-        vst1.16         {d0},     [r1,:64]
-        bx              lr
-endfunc
-
-function ff_dct_unquantize_h263_intra_neon, export=1
-        push            {r4-r6,lr}
-        add             r12, r0,  #BLOCK_LAST_INDEX
-        ldr             r6,  [r0, #AC_PRED]
-        add             lr,  r0,  #INTER_SCANTAB_RASTER_END
-        cmp             r6,  #0
-        it              ne
-        movne           r12, #63
-        bne             1f
-        ldr             r12, [r12, r2, lsl #2]
-        ldrb            r12, [lr, r12]
-1:      ldr             r5,  [r0, #H263_AIC]
-        ldrsh           r4,  [r1]
-        cmp             r5,  #0
-        mov             r5,  r1
-        it              ne
-        movne           r2,  #0
-        bne             2f
-        cmp             r2,  #4
-        it              ge
-        addge           r0,  r0,  #4
-        sub             r2,  r3,  #1
-        ldr             r6,  [r0, #Y_DC_SCALE]
-        orr             r2,  r2,  #1
-        smulbb          r4,  r4,  r6
-2:      lsl             r0,  r3,  #1
-        add             r3,  r12, #1
-        bl              X(ff_dct_unquantize_h263_neon)
-        vmov.16         d0[0], r4
-        vst1.16         {d0[0]},  [r5]
-        pop             {r4-r6,pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/neon.S b/deps/libav/libavcodec/arm/neon.S
deleted file mode 100644
index 716a607..0000000
--- a/deps/libav/libavcodec/arm/neon.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-.macro  transpose_8x8   r0, r1, r2, r3, r4, r5, r6, r7
-        vtrn.32         \r0, \r4
-        vtrn.32         \r1, \r5
-        vtrn.32         \r2, \r6
-        vtrn.32         \r3, \r7
-        vtrn.16         \r0, \r2
-        vtrn.16         \r1, \r3
-        vtrn.16         \r4, \r6
-        vtrn.16         \r5, \r7
-        vtrn.8          \r0, \r1
-        vtrn.8          \r2, \r3
-        vtrn.8          \r4, \r5
-        vtrn.8          \r6, \r7
-.endm
-
-.macro  transpose_4x4   r0, r1, r2, r3
-        vtrn.16         \r0, \r2
-        vtrn.16         \r1, \r3
-        vtrn.8          \r0, \r1
-        vtrn.8          \r2, \r3
-.endm
-
-.macro  swap4           r0, r1, r2, r3, r4, r5, r6, r7
-        vswp            \r0, \r4
-        vswp            \r1, \r5
-        vswp            \r2, \r6
-        vswp            \r3, \r7
-.endm
-
-.macro  transpose16_4x4 r0, r1, r2, r3, r4, r5, r6, r7
-        vtrn.32         \r0, \r2
-        vtrn.32         \r1, \r3
-        vtrn.32         \r4, \r6
-        vtrn.32         \r5, \r7
-        vtrn.16         \r0, \r1
-        vtrn.16         \r2, \r3
-        vtrn.16         \r4, \r5
-        vtrn.16         \r6, \r7
-.endm
diff --git a/deps/libav/libavcodec/arm/neontest.c b/deps/libav/libavcodec/arm/neontest.c
deleted file mode 100644
index b77bcd7..0000000
--- a/deps/libav/libavcodec/arm/neontest.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * check NEON registers for clobbers
- * Copyright (c) 2013 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/avcodec.h"
-#include "libavutil/arm/neontest.h"
-
-wrap(avcodec_open2(AVCodecContext *avctx,
-                   AVCodec *codec,
-                   AVDictionary **options))
-{
-    testneonclobbers(avcodec_open2, avctx, codec, options);
-}
-
-wrap(avcodec_decode_audio4(AVCodecContext *avctx,
-                           AVFrame *frame,
-                           int *got_frame_ptr,
-                           AVPacket *avpkt))
-{
-    testneonclobbers(avcodec_decode_audio4, avctx, frame,
-                     got_frame_ptr, avpkt);
-}
-
-wrap(avcodec_decode_video2(AVCodecContext *avctx,
-                           AVFrame *picture,
-                           int *got_picture_ptr,
-                           AVPacket *avpkt))
-{
-    testneonclobbers(avcodec_decode_video2, avctx, picture,
-                     got_picture_ptr, avpkt);
-}
-
-wrap(avcodec_decode_subtitle2(AVCodecContext *avctx,
-                              AVSubtitle *sub,
-                              int *got_sub_ptr,
-                              AVPacket *avpkt))
-{
-    testneonclobbers(avcodec_decode_subtitle2, avctx, sub,
-                     got_sub_ptr, avpkt);
-}
-
-wrap(avcodec_encode_audio2(AVCodecContext *avctx,
-                           AVPacket *avpkt,
-                           const AVFrame *frame,
-                           int *got_packet_ptr))
-{
-    testneonclobbers(avcodec_encode_audio2, avctx, avpkt, frame,
-                     got_packet_ptr);
-}
-
-wrap(avcodec_encode_subtitle(AVCodecContext *avctx,
-                             uint8_t *buf, int buf_size,
-                             const AVSubtitle *sub))
-{
-    testneonclobbers(avcodec_encode_subtitle, avctx, buf, buf_size, sub);
-}
-
-wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
-                           const AVFrame *frame, int *got_packet_ptr))
-{
-    testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, got_packet_ptr);
-}
diff --git a/deps/libav/libavcodec/arm/rdft_neon.S b/deps/libav/libavcodec/arm/rdft_neon.S
deleted file mode 100644
index 7d01d53..0000000
--- a/deps/libav/libavcodec/arm/rdft_neon.S
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * ARM NEON optimised RDFT
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_rdft_calc_neon, export=1
-        push            {r4-r8,lr}
-
-        ldr             r6,  [r0, #4]           @ inverse
-        mov             r4,  r0
-        mov             r5,  r1
-
-        lsls            r6,  r6,  #31
-        bne             1f
-        add             r0,  r4,  #20
-        bl              X(ff_fft_permute_neon)
-        add             r0,  r4,  #20
-        mov             r1,  r5
-        bl              X(ff_fft_calc_neon)
-1:
-        ldr             r12, [r4, #0]           @ nbits
-        mov             r2,  #1
-        lsl             r12, r2,  r12
-        add             r0,  r5,  #8
-        add             r1,  r5,  r12, lsl #2
-        lsr             r12, r12, #2
-        ldr             r2,  [r4, #12]          @ tcos
-        sub             r12, r12, #2
-        ldr             r3,  [r4, #16]          @ tsin
-        mov             r7,  r0
-        sub             r1,  r1,  #8
-        mov             lr,  r1
-        mov             r8,  #-8
-        vld1.32         {d0},     [r0,:64]!     @ d1[0,1]
-        vld1.32         {d1},     [r1,:64], r8  @ d2[0,1]
-        vld1.32         {d4},     [r2,:64]!     @ tcos[i]
-        vld1.32         {d5},     [r3,:64]!     @ tsin[i]
-        vmov.f32        d18, #0.5               @ k1
-        vdup.32         d19, r6
-        pld             [r0, #32]
-        veor            d19, d18, d19           @ k2
-        vmov.i32        d16, #0
-        vmov.i32        d17, #1<<31
-        pld             [r1, #-32]
-        vtrn.32         d16, d17
-        pld             [r2, #32]
-        vrev64.32       d16, d16                @ d16=1,0 d17=0,1
-        pld             [r3, #32]
-2:
-        veor            q1,  q0,  q8            @ -d1[0],d1[1], d2[0],-d2[1]
-        vld1.32         {d24},    [r0,:64]!     @  d1[0,1]
-        vadd.f32        d0,  d0,  d3            @  d1[0]+d2[0], d1[1]-d2[1]
-        vld1.32         {d25},    [r1,:64], r8  @  d2[0,1]
-        vadd.f32        d1,  d2,  d1            @ -d1[0]+d2[0], d1[1]+d2[1]
-        veor            q3,  q12, q8            @ -d1[0],d1[1], d2[0],-d2[1]
-        pld             [r0, #32]
-        vmul.f32        q10, q0,  q9            @  ev.re, ev.im, od.im, od.re
-        pld             [r1, #-32]
-        vadd.f32        d0,  d24, d7            @  d1[0]+d2[0], d1[1]-d2[1]
-        vadd.f32        d1,  d6,  d25           @ -d1[0]+d2[0], d1[1]+d2[1]
-        vmul.f32        q11, q0,  q9            @  ev.re, ev.im, od.im, od.re
-        veor            d7,  d21, d16           @ -od.im, od.re
-        vrev64.32       d3,  d21                @  od.re, od.im
-        veor            d6,  d20, d17           @  ev.re,-ev.im
-        veor            d2,  d3,  d16           @ -od.re, od.im
-        vmla.f32        d20, d3,  d4[1]
-        vmla.f32        d20, d7,  d5[1]
-        vmla.f32        d6,  d2,  d4[1]
-        vmla.f32        d6,  d21, d5[1]
-        vld1.32         {d4},     [r2,:64]!     @  tcos[i]
-        veor            d7,  d23, d16           @ -od.im, od.re
-        vld1.32         {d5},     [r3,:64]!     @  tsin[i]
-        veor            d24, d22, d17           @  ev.re,-ev.im
-        vrev64.32       d3,  d23                @  od.re, od.im
-        pld             [r2, #32]
-        veor            d2,  d3,  d16           @ -od.re, od.im
-        pld             [r3, #32]
-        vmla.f32        d22, d3,  d4[0]
-        vmla.f32        d22, d7,  d5[0]
-        vmla.f32        d24, d2,  d4[0]
-        vmla.f32        d24, d23, d5[0]
-        vld1.32         {d0},     [r0,:64]!     @  d1[0,1]
-        vld1.32         {d1},     [r1,:64], r8  @  d2[0,1]
-        vst1.32         {d20},    [r7,:64]!
-        vst1.32         {d6},     [lr,:64], r8
-        vst1.32         {d22},    [r7,:64]!
-        vst1.32         {d24},    [lr,:64], r8
-        subs            r12, r12, #2
-        bgt             2b
-
-        veor            q1,  q0,  q8            @ -d1[0],d1[1], d2[0],-d2[1]
-        vadd.f32        d0,  d0,  d3            @  d1[0]+d2[0], d1[1]-d2[1]
-        vadd.f32        d1,  d2,  d1            @ -d1[0]+d2[0], d1[1]+d2[1]
-        ldr             r2,  [r4, #8]           @  sign_convention
-        vmul.f32        q10, q0,  q9            @  ev.re, ev.im, od.im, od.re
-        add             r0,  r0,  #4
-        bfc             r2,  #0,  #31
-        vld1.32         {d0[0]},  [r0,:32]
-        veor            d7,  d21, d16           @ -od.im, od.re
-        vrev64.32       d3,  d21                @  od.re, od.im
-        veor            d6,  d20, d17           @  ev.re,-ev.im
-        vld1.32         {d22},    [r5,:64]
-        vdup.32         d1,  r2
-        vmov            d23, d22
-        veor            d2,  d3,  d16           @ -od.re, od.im
-        vtrn.32         d22, d23
-        veor            d0,  d0,  d1
-        veor            d23, d23, d17
-        vmla.f32        d20, d3,  d4[1]
-        vmla.f32        d20, d7,  d5[1]
-        vmla.f32        d6,  d2,  d4[1]
-        vmla.f32        d6,  d21, d5[1]
-        vadd.f32        d22, d22, d23
-        vst1.32         {d20},    [r7,:64]
-        vst1.32         {d6},     [lr,:64]
-        vst1.32         {d0[0]},  [r0,:32]
-        vst1.32         {d22},    [r5,:64]
-
-        cmp             r6,  #0
-        it              eq
-        popeq           {r4-r8,pc}
-
-        vmul.f32        d22, d22, d18
-        vst1.32         {d22},    [r5,:64]
-        add             r0,  r4,  #20
-        mov             r1,  r5
-        bl              X(ff_fft_permute_neon)
-        add             r0,  r4,  #20
-        mov             r1,  r5
-        pop             {r4-r8,lr}
-        b               X(ff_fft_calc_neon)
-endfunc
diff --git a/deps/libav/libavcodec/arm/rv34dsp_init_arm.c b/deps/libav/libavcodec/arm/rv34dsp_init_arm.c
deleted file mode 100644
index 5ce787b..0000000
--- a/deps/libav/libavcodec/arm/rv34dsp_init_arm.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2011 Janne Grunau <janne-libav at jannau.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/rv34dsp.h"
-#include "libavutil/arm/cpu.h"
-
-void ff_rv34_inv_transform_noround_neon(int16_t *block);
-
-void ff_rv34_inv_transform_noround_dc_neon(int16_t *block);
-
-void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, int16_t *block);
-void ff_rv34_idct_dc_add_neon(uint8_t *dst, ptrdiff_t stride, int dc);
-
-av_cold void ff_rv34dsp_init_arm(RV34DSPContext *c)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        c->rv34_inv_transform    = ff_rv34_inv_transform_noround_neon;
-        c->rv34_inv_transform_dc = ff_rv34_inv_transform_noround_dc_neon;
-
-        c->rv34_idct_add    = ff_rv34_idct_add_neon;
-        c->rv34_idct_dc_add = ff_rv34_idct_dc_add_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/rv34dsp_neon.S b/deps/libav/libavcodec/arm/rv34dsp_neon.S
deleted file mode 100644
index a29123f..0000000
--- a/deps/libav/libavcodec/arm/rv34dsp_neon.S
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2011 Janne Grunau <janne-libav at jannau.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-#include "neon.S"
-
-.macro rv34_inv_transform    r0
-        vld1.16         {q14-q15}, [\r0,:128]
-        vmov.s16        d0,  #13
-        vshll.s16       q12, d29, #3
-        vshll.s16       q13, d29, #4
-        vshll.s16       q9,  d31, #3
-        vshll.s16       q1,  d31, #4
-        vmull.s16       q10, d28, d0
-        vmlal.s16       q10, d30, d0
-        vmull.s16       q11, d28, d0
-        vmlsl.s16       q11, d30, d0
-        vsubw.s16       q12, q12, d29   @ z2 = block[i+4*1]*7
-        vaddw.s16       q13, q13, d29   @ z3 = block[i+4*1]*17
-        vsubw.s16       q9,  q9,  d31
-        vaddw.s16       q1,  q1,  d31
-        vadd.s32        q13, q13, q9    @ z3 = 17*block[i+4*1] +  7*block[i+4*3]
-        vsub.s32        q12, q12, q1    @ z2 = 7*block[i+4*1]  - 17*block[i+4*3]
-        vadd.s32        q1,  q10, q13   @ z0 + z3
-        vadd.s32        q2,  q11, q12   @ z1 + z2
-        vsub.s32        q8,  q10, q13   @ z0 - z3
-        vsub.s32        q3,  q11, q12   @ z1 - z2
-        vtrn.32         q1,  q2
-        vtrn.32         q3,  q8
-        vswp            d3,  d6
-        vswp            d5,  d16
-        vmov.s32        d0,  #13
-        vadd.s32        q10, q1,  q3
-        vsub.s32        q11, q1,  q3
-        vshl.s32        q12, q2,  #3
-        vshl.s32        q9,  q2,  #4
-        vmul.s32        q13, q11, d0[0]
-        vshl.s32        q11, q8,  #4
-        vadd.s32        q9,  q9,  q2
-        vshl.s32        q15, q8,  #3
-        vsub.s32        q12, q12, q2
-        vadd.s32        q11, q11, q8
-        vmul.s32        q14, q10, d0[0]
-        vsub.s32        q8,  q15, q8
-        vsub.s32        q12, q12, q11
-        vadd.s32        q9,  q9,  q8
-        vadd.s32        q2,  q13, q12   @ z1 + z2
-        vadd.s32        q1,  q14, q9    @ z0 + z3
-        vsub.s32        q3,  q13, q12   @ z1 - z2
-        vsub.s32        q15, q14, q9    @ z0 - z3
-.endm
-
-/* void rv34_idct_add_c(uint8_t *dst, int stride, int16_t *block) */
-function ff_rv34_idct_add_neon, export=1
-        mov             r3,  r0
-        rv34_inv_transform   r2
-        vmov.i16        q12, #0
-        vrshrn.s32      d16, q1,  #10   @ (z0 + z3) >> 10
-        vrshrn.s32      d17, q2,  #10   @ (z1 + z2) >> 10
-        vrshrn.s32      d18, q3,  #10   @ (z1 - z2) >> 10
-        vrshrn.s32      d19, q15, #10   @ (z0 - z3) >> 10
-        vld1.32         {d28[]},  [r0,:32], r1
-        vld1.32         {d29[]},  [r0,:32], r1
-        vtrn.32         q8,  q9
-        vld1.32         {d28[1]}, [r0,:32], r1
-        vld1.32         {d29[1]}, [r0,:32], r1
-        vst1.16         {q12}, [r2,:128]!       @ memset(block,    0, 16)
-        vst1.16         {q12}, [r2,:128]        @ memset(block+16, 0, 16)
-        vtrn.16         d16, d17
-        vtrn.32         d28, d29
-        vtrn.16         d18, d19
-        vaddw.u8        q0,   q8,  d28
-        vaddw.u8        q1,   q9,  d29
-        vqmovun.s16     d28,  q0
-        vqmovun.s16     d29,  q1
-        vst1.32         {d28[0]}, [r3,:32], r1
-        vst1.32         {d28[1]}, [r3,:32], r1
-        vst1.32         {d29[0]}, [r3,:32], r1
-        vst1.32         {d29[1]}, [r3,:32], r1
-        bx              lr
-endfunc
-
-/* void rv34_inv_transform_noround_neon(int16_t *block); */
-function ff_rv34_inv_transform_noround_neon, export=1
-        rv34_inv_transform   r0
-        vshl.s32        q11, q2,  #1
-        vshl.s32        q10, q1,  #1
-        vshl.s32        q12, q3,  #1
-        vshl.s32        q13, q15, #1
-        vadd.s32        q11, q11, q2
-        vadd.s32        q10, q10, q1
-        vadd.s32        q12, q12, q3
-        vadd.s32        q13, q13, q15
-        vshrn.s32       d0,  q10, #11   @ (z0 + z3)*3 >> 11
-        vshrn.s32       d1,  q11, #11   @ (z1 + z2)*3 >> 11
-        vshrn.s32       d2,  q12, #11   @ (z1 - z2)*3 >> 11
-        vshrn.s32       d3,  q13, #11   @ (z0 - z3)*3 >> 11
-        vst4.16         {d0[0], d1[0], d2[0], d3[0]}, [r0,:64]!
-        vst4.16         {d0[1], d1[1], d2[1], d3[1]}, [r0,:64]!
-        vst4.16         {d0[2], d1[2], d2[2], d3[2]}, [r0,:64]!
-        vst4.16         {d0[3], d1[3], d2[3], d3[3]}, [r0,:64]!
-        bx              lr
-endfunc
-
-/* void ff_rv34_idct_dc_add_neon(uint8_t *dst, int stride, int dc) */
-function ff_rv34_idct_dc_add_neon, export=1
-        mov             r3,  r0
-        vld1.32         {d28[]},  [r0,:32], r1
-        vld1.32         {d29[]},  [r0,:32], r1
-        vdup.16         d0,  r2
-        vmov.s16        d1,  #169
-        vld1.32         {d28[1]}, [r0,:32], r1
-        vmull.s16       q1,  d0,  d1    @ dc * 13 * 13
-        vld1.32         {d29[1]}, [r0,:32], r1
-        vrshrn.s32      d0,  q1,  #10   @ (dc * 13 * 13 + 0x200) >> 10
-        vmov            d1,  d0
-        vaddw.u8        q2,  q0,  d28
-        vaddw.u8        q3,  q0,  d29
-        vqmovun.s16     d28, q2
-        vqmovun.s16     d29, q3
-        vst1.32         {d28[0]}, [r3,:32], r1
-        vst1.32         {d29[0]}, [r3,:32], r1
-        vst1.32         {d28[1]}, [r3,:32], r1
-        vst1.32         {d29[1]}, [r3,:32], r1
-        bx              lr
-endfunc
-
-/* void rv34_inv_transform_dc_noround_c(int16_t *block) */
-function ff_rv34_inv_transform_noround_dc_neon, export=1
-        vld1.16         {d28[]}, [r0,:16]       @ block[0]
-        vmov.i16        d4,  #251
-        vorr.s16        d4,  #256               @ 13^2 * 3
-        vmull.s16       q3,  d28, d4
-        vshrn.s32       d0,  q3,  #11
-        vmov.i16        d1,  d0
-        vst1.64         {q0}, [r0,:128]!
-        vst1.64         {q0}, [r0,:128]!
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/rv40dsp_init_arm.c b/deps/libav/libavcodec/arm/rv40dsp_init_arm.c
deleted file mode 100644
index 6ad60fa..0000000
--- a/deps/libav/libavcodec/arm/rv40dsp_init_arm.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2011 Janne Grunau <janne-libav at jannau.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/rv34dsp.h"
-#include "libavutil/arm/cpu.h"
-
-#define DECL_QPEL3(type, w, pos) \
-    void ff_##type##_rv40_qpel##w##_mc##pos##_neon(uint8_t *dst, uint8_t *src,\
-                                                   ptrdiff_t stride)
-#define DECL_QPEL2(w, pos)                      \
-    DECL_QPEL3(put, w, pos);                    \
-    DECL_QPEL3(avg, w, pos)
-
-#define DECL_QPEL_XY(x, y)                      \
-    DECL_QPEL2(16, x ## y);                     \
-    DECL_QPEL2(8,  x ## y)
-
-#define DECL_QPEL_Y(y)                          \
-    DECL_QPEL_XY(0, y);                         \
-    DECL_QPEL_XY(1, y);                         \
-    DECL_QPEL_XY(2, y);                         \
-    DECL_QPEL_XY(3, y);                         \
-
-DECL_QPEL_Y(0);
-DECL_QPEL_Y(1);
-DECL_QPEL_Y(2);
-DECL_QPEL_Y(3);
-
-void ff_put_rv40_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
-void ff_put_rv40_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
-
-void ff_avg_rv40_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
-void ff_avg_rv40_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
-
-void ff_rv40_weight_func_16_neon(uint8_t *, uint8_t *, uint8_t *, int, int, ptrdiff_t);
-void ff_rv40_weight_func_8_neon(uint8_t *, uint8_t *, uint8_t *, int, int, ptrdiff_t);
-
-int ff_rv40_h_loop_filter_strength_neon(uint8_t *src, ptrdiff_t stride,
-                                        int beta, int beta2, int edge,
-                                        int *p1, int *q1);
-int ff_rv40_v_loop_filter_strength_neon(uint8_t *src, ptrdiff_t stride,
-                                        int beta, int beta2, int edge,
-                                        int *p1, int *q1);
-
-void ff_rv40_h_weak_loop_filter_neon(uint8_t *src, ptrdiff_t stride, int filter_p1,
-                                     int filter_q1, int alpha, int beta,
-                                     int lim_p0q0, int lim_q1, int lim_p1);
-void ff_rv40_v_weak_loop_filter_neon(uint8_t *src, ptrdiff_t stride, int filter_p1,
-                                     int filter_q1, int alpha, int beta,
-                                     int lim_p0q0, int lim_q1, int lim_p1);
-
-static av_cold void rv40dsp_init_neon(RV34DSPContext *c)
-{
-    c->put_pixels_tab[0][ 1] = ff_put_rv40_qpel16_mc10_neon;
-    c->put_pixels_tab[0][ 3] = ff_put_rv40_qpel16_mc30_neon;
-    c->put_pixels_tab[0][ 4] = ff_put_rv40_qpel16_mc01_neon;
-    c->put_pixels_tab[0][ 5] = ff_put_rv40_qpel16_mc11_neon;
-    c->put_pixels_tab[0][ 6] = ff_put_rv40_qpel16_mc21_neon;
-    c->put_pixels_tab[0][ 7] = ff_put_rv40_qpel16_mc31_neon;
-    c->put_pixels_tab[0][ 9] = ff_put_rv40_qpel16_mc12_neon;
-    c->put_pixels_tab[0][10] = ff_put_rv40_qpel16_mc22_neon;
-    c->put_pixels_tab[0][11] = ff_put_rv40_qpel16_mc32_neon;
-    c->put_pixels_tab[0][12] = ff_put_rv40_qpel16_mc03_neon;
-    c->put_pixels_tab[0][13] = ff_put_rv40_qpel16_mc13_neon;
-    c->put_pixels_tab[0][14] = ff_put_rv40_qpel16_mc23_neon;
-    c->put_pixels_tab[0][15] = ff_put_rv40_qpel16_mc33_neon;
-    c->avg_pixels_tab[0][ 1] = ff_avg_rv40_qpel16_mc10_neon;
-    c->avg_pixels_tab[0][ 3] = ff_avg_rv40_qpel16_mc30_neon;
-    c->avg_pixels_tab[0][ 4] = ff_avg_rv40_qpel16_mc01_neon;
-    c->avg_pixels_tab[0][ 5] = ff_avg_rv40_qpel16_mc11_neon;
-    c->avg_pixels_tab[0][ 6] = ff_avg_rv40_qpel16_mc21_neon;
-    c->avg_pixels_tab[0][ 7] = ff_avg_rv40_qpel16_mc31_neon;
-    c->avg_pixels_tab[0][ 9] = ff_avg_rv40_qpel16_mc12_neon;
-    c->avg_pixels_tab[0][10] = ff_avg_rv40_qpel16_mc22_neon;
-    c->avg_pixels_tab[0][11] = ff_avg_rv40_qpel16_mc32_neon;
-    c->avg_pixels_tab[0][12] = ff_avg_rv40_qpel16_mc03_neon;
-    c->avg_pixels_tab[0][13] = ff_avg_rv40_qpel16_mc13_neon;
-    c->avg_pixels_tab[0][14] = ff_avg_rv40_qpel16_mc23_neon;
-    c->avg_pixels_tab[0][15] = ff_avg_rv40_qpel16_mc33_neon;
-    c->put_pixels_tab[1][ 1] = ff_put_rv40_qpel8_mc10_neon;
-    c->put_pixels_tab[1][ 3] = ff_put_rv40_qpel8_mc30_neon;
-    c->put_pixels_tab[1][ 4] = ff_put_rv40_qpel8_mc01_neon;
-    c->put_pixels_tab[1][ 5] = ff_put_rv40_qpel8_mc11_neon;
-    c->put_pixels_tab[1][ 6] = ff_put_rv40_qpel8_mc21_neon;
-    c->put_pixels_tab[1][ 7] = ff_put_rv40_qpel8_mc31_neon;
-    c->put_pixels_tab[1][ 9] = ff_put_rv40_qpel8_mc12_neon;
-    c->put_pixels_tab[1][10] = ff_put_rv40_qpel8_mc22_neon;
-    c->put_pixels_tab[1][11] = ff_put_rv40_qpel8_mc32_neon;
-    c->put_pixels_tab[1][12] = ff_put_rv40_qpel8_mc03_neon;
-    c->put_pixels_tab[1][13] = ff_put_rv40_qpel8_mc13_neon;
-    c->put_pixels_tab[1][14] = ff_put_rv40_qpel8_mc23_neon;
-    c->put_pixels_tab[1][15] = ff_put_rv40_qpel8_mc33_neon;
-    c->avg_pixels_tab[1][ 1] = ff_avg_rv40_qpel8_mc10_neon;
-    c->avg_pixels_tab[1][ 3] = ff_avg_rv40_qpel8_mc30_neon;
-    c->avg_pixels_tab[1][ 4] = ff_avg_rv40_qpel8_mc01_neon;
-    c->avg_pixels_tab[1][ 5] = ff_avg_rv40_qpel8_mc11_neon;
-    c->avg_pixels_tab[1][ 6] = ff_avg_rv40_qpel8_mc21_neon;
-    c->avg_pixels_tab[1][ 7] = ff_avg_rv40_qpel8_mc31_neon;
-    c->avg_pixels_tab[1][ 9] = ff_avg_rv40_qpel8_mc12_neon;
-    c->avg_pixels_tab[1][10] = ff_avg_rv40_qpel8_mc22_neon;
-    c->avg_pixels_tab[1][11] = ff_avg_rv40_qpel8_mc32_neon;
-    c->avg_pixels_tab[1][12] = ff_avg_rv40_qpel8_mc03_neon;
-    c->avg_pixels_tab[1][13] = ff_avg_rv40_qpel8_mc13_neon;
-    c->avg_pixels_tab[1][14] = ff_avg_rv40_qpel8_mc23_neon;
-    c->avg_pixels_tab[1][15] = ff_avg_rv40_qpel8_mc33_neon;
-
-    c->put_chroma_pixels_tab[0] = ff_put_rv40_chroma_mc8_neon;
-    c->put_chroma_pixels_tab[1] = ff_put_rv40_chroma_mc4_neon;
-    c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_neon;
-    c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_neon;
-
-    c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_16_neon;
-    c->rv40_weight_pixels_tab[0][1] = ff_rv40_weight_func_8_neon;
-
-    c->rv40_loop_filter_strength[0] = ff_rv40_h_loop_filter_strength_neon;
-    c->rv40_loop_filter_strength[1] = ff_rv40_v_loop_filter_strength_neon;
-    c->rv40_weak_loop_filter[0]     = ff_rv40_h_weak_loop_filter_neon;
-    c->rv40_weak_loop_filter[1]     = ff_rv40_v_weak_loop_filter_neon;
-}
-
-av_cold void ff_rv40dsp_init_arm(RV34DSPContext *c)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags))
-        rv40dsp_init_neon(c);
-}
diff --git a/deps/libav/libavcodec/arm/rv40dsp_neon.S b/deps/libav/libavcodec/arm/rv40dsp_neon.S
deleted file mode 100644
index 6bd45eb..0000000
--- a/deps/libav/libavcodec/arm/rv40dsp_neon.S
+++ /dev/null
@@ -1,920 +0,0 @@
-/*
- * Copyright (c) 2011 Janne Grunau <janne-libav at jannau.net>
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-#include "neon.S"
-
-.macro  qpel_lowpass    r0,  r1,  rc1, rc2, shift
-        vext.8          d25, \r0, \r1, #1       @ src[-1]
-        vext.8          d26, \r0, \r1, #4       @ src[ 2]
-        vext.8          d24, \r0, \r1, #5       @ src[ 3]
-        vaddl.u8        q9,  d25, d26
-        vaddl.u8        q8,  \r0, d24
-        vext.8          d27, \r0, \r1, #2       @ src[ 0]
-        vshl.s16        q12, q9,  #2
-        vsub.s16        q8,  q8,  q9
-        vext.8          d28, \r0, \r1, #3       @ src[ 1]
-        vsub.s16        q8,  q8,  q12
-        vmlal.u8        q8,  d27, \rc1
-        vmlal.u8        q8,  d28, \rc2
-        vqrshrun.s16    \r0, q8,  #\shift
-.endm
-
-.macro  qpel_lowpass_x2 r0,  r1,  r2,  r3,  rc1, rc2, shift
-        vext.8          d25, \r0, \r1, #1       @ src[-1]
-        vext.8          d26, \r0, \r1, #4       @ src[ 2]
-        vext.8          d24, \r0, \r1, #5       @ src[ 3]
-        vaddl.u8        q9,  d25, d26
-        vaddl.u8        q8,  \r0, d24
-        vext.8          d29, \r0, \r1, #2       @ src[ 0]
-        vext.8          d28, \r0, \r1, #3       @ src[ 1]
-        vshl.s16        q10, q9,  #2
-        vext.8          \r1, \r2, \r3, #1       @ src[-1]
-        vsub.s16        q8,  q8,  q9
-        vext.8          d22, \r2, \r3, #4       @ src[ 2]
-        vext.8          \r0, \r2, \r3, #5       @ src[ 3]
-        vaddl.u8        q13, \r1, d22
-        vaddl.u8        q12, \r2, \r0
-        vsub.s16        q8,  q8,  q10
-        vshl.s16        q9,  q13, #2
-        vsub.s16        q12, q12, q13
-        vmlal.u8        q8,  d29, \rc1
-        vmlal.u8        q8,  d28, \rc2
-        vsub.s16        q12, q12, q9
-        vext.8          d26, \r2, \r3, #2       @ src[ 0]
-        vext.8          d27, \r2, \r3, #3       @ src[ 1]
-        vmlal.u8        q12, d26, \rc1
-        vmlal.u8        q12, d27, \rc2
-        vqrshrun.s16    \r0, q8,  #\shift
-        vqrshrun.s16    \r2, q12, #\shift
-.endm
-
-.macro  rv40_qpel8_h    shift
-function put_rv40_qpel8_h_lp_packed_s\shift\()_neon
-1:
-        vld1.8          {q2},     [r1], r2
-        vld1.8          {q3},     [r1], r2
-        qpel_lowpass_x2 d4,  d5,  d6,  d7,  d0,  d1,  \shift
-        vst1.8          {d4},     [r12,:64]!
-        vst1.8          {d6},     [r12,:64]!
-        subs            r3,  r3,  #2
-        bgt             1b
-        vld1.8          {q2},     [r1]
-        qpel_lowpass    d4,  d5,  d0,  d1,  \shift
-        vst1.8          {d4},     [r12,:64]!
-        bx              lr
-endfunc
-.endm
-
-.macro  rv40_qpel8_v    shift, type
-function \type\()_rv40_qpel8_v_lp_packed_s\shift\()_neon
-        vld1.64         {d2},     [r1,:64]!
-        vld1.64         {d3},     [r1,:64]!
-        vld1.64         {d4},     [r1,:64]!
-        vld1.64         {d5},     [r1,:64]!
-        vld1.64         {d6},     [r1,:64]!
-        vld1.64         {d7},     [r1,:64]!
-        vld1.64         {d8},     [r1,:64]!
-        vld1.64         {d9},     [r1,:64]!
-        vld1.64         {d10},    [r1,:64]!
-        vld1.64         {d11},    [r1,:64]!
-        vld1.64         {d12},    [r1,:64]!
-        vld1.64         {d13},    [r1,:64]!
-        vld1.64         {d14},    [r1,:64]!
-        transpose_8x8   d2,  d3,  d4,  d5,  d6,  d7,  d8,  d9
-        transpose_8x8   d10, d11, d12, d13, d14, d15, d30, d31
-        qpel_lowpass_x2 d2,  d10, d3,  d11, d0,  d1,  \shift
-        qpel_lowpass_x2 d4,  d12, d5,  d13, d0,  d1,  \shift
-        qpel_lowpass_x2 d6,  d14, d7,  d15, d0,  d1,  \shift
-        qpel_lowpass_x2 d8,  d30, d9,  d31, d0,  d1,  \shift
-        transpose_8x8   d2,  d3,  d4,  d5,  d6,  d7,  d8,  d9
-  .ifc \type,avg
-        vld1.64         d12,      [r0,:64], r2
-        vld1.64         d13,      [r0,:64], r2
-        vld1.64         d14,      [r0,:64], r2
-        vld1.64         d15,      [r0,:64], r2
-        vld1.64         d16,      [r0,:64], r2
-        vld1.64         d17,      [r0,:64], r2
-        vld1.64         d18,      [r0,:64], r2
-        vld1.64         d19,      [r0,:64], r2
-        sub             r0,  r0,  r2,  lsl #3
-        vrhadd.u8       q1,  q1,  q6
-        vrhadd.u8       q2,  q2,  q7
-        vrhadd.u8       q3,  q3,  q8
-        vrhadd.u8       q4,  q4,  q9
-  .endif
-        vst1.64         d2,       [r0,:64], r2
-        vst1.64         d3,       [r0,:64], r2
-        vst1.64         d4,       [r0,:64], r2
-        vst1.64         d5,       [r0,:64], r2
-        vst1.64         d6,       [r0,:64], r2
-        vst1.64         d7,       [r0,:64], r2
-        vst1.64         d8,       [r0,:64], r2
-        vst1.64         d9,       [r0,:64], r2
-        bx              lr
-endfunc
-.endm
-
-        rv40_qpel8_h    5
-        rv40_qpel8_h    6
-
-.macro  rv40_qpel       type
-function \type\()_rv40_qpel8_h_lowpass_neon
-  .ifc \type,avg
-        mov             r12, r0
-  .endif
-1:
-        vld1.8          {q2},     [r1], r2
-        vld1.8          {q3},     [r1], r2
-        qpel_lowpass_x2 d4,  d5,  d6,  d7,  d0,  d1,  6
-  .ifc \type,avg
-        vld1.8          {d3},     [r12,:64], r2
-        vld1.8          {d16},    [r12,:64], r2
-        vrhadd.u8       d4,  d4,  d3
-        vrhadd.u8       d6,  d6,  d16
-  .endif
-        vst1.8          {d4},     [r0,:64], r2
-        vst1.8          {d6},     [r0,:64], r2
-        subs            r3,  r3,  #2
-        bgt             1b
-        bx              lr
-endfunc
-
-function \type\()_rv40_qpel8_v_lowpass_neon
-        vld1.64         {d2},     [r1], r2
-        vld1.64         {d3},     [r1], r2
-        vld1.64         {d4},     [r1], r2
-        vld1.64         {d5},     [r1], r2
-        vld1.64         {d6},     [r1], r2
-        vld1.64         {d7},     [r1], r2
-        vld1.64         {d8},     [r1], r2
-        vld1.64         {d9},     [r1], r2
-        vld1.64         {d10},    [r1], r2
-        vld1.64         {d11},    [r1], r2
-        vld1.64         {d12},    [r1], r2
-        vld1.64         {d13},    [r1], r2
-        vld1.64         {d14},    [r1]
-        transpose_8x8   d2,  d3,  d4,  d5,  d6,  d7,  d8,  d9
-        transpose_8x8   d10, d11, d12, d13, d14, d15, d30, d31
-        qpel_lowpass_x2 d2,  d10, d3,  d11, d0,  d1,  6
-        qpel_lowpass_x2 d4,  d12, d5,  d13, d0,  d1,  6
-        qpel_lowpass_x2 d6,  d14, d7,  d15, d0,  d1,  6
-        qpel_lowpass_x2 d8,  d30, d9,  d31, d0,  d1,  6
-        transpose_8x8   d2,  d3,  d4,  d5,  d6,  d7,  d8,  d9
-  .ifc \type,avg
-        vld1.64         d12,      [r0,:64], r2
-        vld1.64         d13,      [r0,:64], r2
-        vld1.64         d14,      [r0,:64], r2
-        vld1.64         d15,      [r0,:64], r2
-        vld1.64         d16,      [r0,:64], r2
-        vld1.64         d17,      [r0,:64], r2
-        vld1.64         d18,      [r0,:64], r2
-        vld1.64         d19,      [r0,:64], r2
-        sub             r0,  r0,  r2,  lsl #3
-        vrhadd.u8       q1,  q1,  q6
-        vrhadd.u8       q2,  q2,  q7
-        vrhadd.u8       q3,  q3,  q8
-        vrhadd.u8       q4,  q4,  q9
-  .endif
-        vst1.64         d2,       [r0,:64], r2
-        vst1.64         d3,       [r0,:64], r2
-        vst1.64         d4,       [r0,:64], r2
-        vst1.64         d5,       [r0,:64], r2
-        vst1.64         d6,       [r0,:64], r2
-        vst1.64         d7,       [r0,:64], r2
-        vst1.64         d8,       [r0,:64], r2
-        vst1.64         d9,       [r0,:64], r2
-        bx              lr
-endfunc
-
-        rv40_qpel8_v    5, \type
-        rv40_qpel8_v    6, \type
-
-function ff_\type\()_rv40_qpel8_mc10_neon, export=1
-        sub             r1,  r1,  #2
-        mov             r3,  #8
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-        b               \type\()_rv40_qpel8_h_lowpass_neon
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc30_neon, export=1
-        sub             r1,  r1,  #2
-        mov             r3,  #8
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #52
-        b               \type\()_rv40_qpel8_h_lowpass_neon
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc01_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             r1,  r1,  r2,  lsl #1
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-        bl              \type\()_rv40_qpel8_v_lowpass_neon
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc11_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #14*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  #12
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        bl              \type\()_rv40_qpel8_v_lp_packed_s6_neon
-        add             sp,  sp,  #14*8
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc21_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #14*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  #12
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s5_neon
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        vmov.i8         d0,  #52
-        bl              \type\()_rv40_qpel8_v_lp_packed_s6_neon
-        add             sp,  sp,  #14*8
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc31_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #14*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  #12
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #52
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        vswp            d0,  d1
-        bl              \type\()_rv40_qpel8_v_lp_packed_s6_neon
-        add             sp,  sp,  #14*8
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc12_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #14*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  #12
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        vmov.i8         d0,  #20
-        bl              \type\()_rv40_qpel8_v_lp_packed_s5_neon
-        add             sp,  sp,  #14*8
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc22_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #14*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  #12
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s5_neon
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        bl              \type\()_rv40_qpel8_v_lp_packed_s5_neon
-        add             sp,  sp,  #14*8
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc32_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #14*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  #12
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #52
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        vmov.i8         d1,  #20
-        bl              \type\()_rv40_qpel8_v_lp_packed_s5_neon
-        add             sp,  sp,  #14*8
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc03_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             r1,  r1,  r2,  lsl #1
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #52
-        bl              \type\()_rv40_qpel8_v_lowpass_neon
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc33_neon, export=1
-        mov             r3,  #8
-        b               X(ff_\type\()_pixels8_xy2_neon)
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc13_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #14*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  #12
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        vswp            d0,  d1
-        bl              \type\()_rv40_qpel8_v_lp_packed_s6_neon
-        add             sp,  sp,  #14*8
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel8_mc23_neon, export=1
-        push            {r4, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #14*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        mov             r3,  #12
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s5_neon
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        vmov.i8         d1,  #52
-        bl              \type\()_rv40_qpel8_v_lp_packed_s6_neon
-        add             sp,  sp,  #14*8
-        vpop            {d8-d15}
-        pop             {r4, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc10_neon, export=1
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-.L\type\()_rv40_qpel16_h:
-        push            {r1, lr}
-        sub             r1,  r1,  #2
-        mov             r3,  #16
-        bl              \type\()_rv40_qpel8_h_lowpass_neon
-        pop             {r1, lr}
-        sub             r0,  r0,  r2,  lsl #4
-        add             r0,  r0,  #8
-        add             r1,  r1,  #6
-        mov             r3,  #16
-        b               \type\()_rv40_qpel8_h_lowpass_neon
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc30_neon, export=1
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #52
-        b               .L\type\()_rv40_qpel16_h
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc01_neon, export=1
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-.L\type\()_rv40_qpel16_v:
-        sub             r1,  r1,  r2,  lsl #1
-        push            {r1, lr}
-        vpush           {d8-d15}
-        bl              \type\()_rv40_qpel8_v_lowpass_neon
-        sub             r1,  r1,  r2,  lsl #2
-        bl              \type\()_rv40_qpel8_v_lowpass_neon
-        ldr             r1,  [sp, #64]
-        sub             r0,  r0,  r2,  lsl #4
-        add             r0,  r0,  #8
-        add             r1,  r1,  #8
-        bl              \type\()_rv40_qpel8_v_lowpass_neon
-        sub             r1,  r1,  r2,  lsl #2
-        bl              \type\()_rv40_qpel8_v_lowpass_neon
-        vpop            {d8-d15}
-        pop             {r1, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc11_neon, export=1
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        push            {r1, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #44*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        mov             r3,  #20
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        ldr             r1,  [sp, #416]
-        add             r1,  r1,  #8
-        mov             r3,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-.L\type\()_rv40_qpel16_v_s6:
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        bl              \type\()_rv40_qpel8_v_lp_packed_s6_neon
-        sub             r1,  r1,  #40
-        bl              \type\()_rv40_qpel8_v_lp_packed_s6_neon
-        sub             r0,  r0,  r2,  lsl #4
-        add             r0,  r0,  #8
-        bl              \type\()_rv40_qpel8_v_lp_packed_s6_neon
-        sub             r1,  r1,  #40
-        bl              \type\()_rv40_qpel8_v_lp_packed_s6_neon
-        add             sp,  sp,  #44*8
-        vpop            {d8-d15}
-        pop             {r1, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc21_neon, export=1
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        push            {r1, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #44*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        mov             r3,  #20
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s5_neon
-        ldr             r1,  [sp, #416]
-        add             r1,  r1,  #8
-        mov             r3,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s5_neon
-        vmov.i8         d0,  #52
-        b               .L\type\()_rv40_qpel16_v_s6
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc31_neon, export=1
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        push            {r1, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #44*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        mov             r3,  #20
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #52
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        ldr             r1,  [sp, #416]
-        add             r1,  r1,  #8
-        mov             r3,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        vswp            d0,  d1
-        b               .L\type\()_rv40_qpel16_v_s6
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc12_neon, export=1
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        push            {r1, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #44*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        mov             r3,  #20
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        ldr             r1,  [sp, #416]
-        add             r1,  r1,  #8
-        mov             r3,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        vmov.i8         d0,  #20
-.L\type\()_rv40_qpel16_v_s5:
-        add             r1,  sp,  #7
-        bic             r1,  r1,  #7
-        bl              \type\()_rv40_qpel8_v_lp_packed_s5_neon
-        sub             r1,  r1,  #40
-        bl              \type\()_rv40_qpel8_v_lp_packed_s5_neon
-        sub             r0,  r0,  r2,  lsl #4
-        add             r0,  r0,  #8
-        bl              \type\()_rv40_qpel8_v_lp_packed_s5_neon
-        sub             r1,  r1,  #40
-        bl              \type\()_rv40_qpel8_v_lp_packed_s5_neon
-        add             sp,  sp,  #44*8
-        vpop            {d8-d15}
-        pop             {r1, pc}
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc22_neon, export=1
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        push            {r1, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #44*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        mov             r3,  #20
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s5_neon
-        ldr             r1,  [sp, #416]
-        add             r1,  r1,  #8
-        mov             r3,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s5_neon
-        b               .L\type\()_rv40_qpel16_v_s5
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc32_neon, export=1
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        push            {r1, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #44*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        mov             r3,  #20
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #52
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        ldr             r1,  [sp, #416]
-        add             r1,  r1,  #8
-        mov             r3,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        vmov.i8         d1,  #20
-        b               .L\type\()_rv40_qpel16_v_s5
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc03_neon, export=1
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #52
-        b               .L\type\()_rv40_qpel16_v
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc13_neon, export=1
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        push            {r1, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #44*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        mov             r3,  #20
-        vmov.i8         d0,  #52
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        ldr             r1,  [sp, #416]
-        add             r1,  r1,  #8
-        mov             r3,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s6_neon
-        vswp            d0,  d1
-        b               .L\type\()_rv40_qpel16_v_s6
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc23_neon, export=1
-        sub             r1,  r1,  r2,  lsl #1
-        sub             r1,  r1,  #2
-        push            {r1, lr}
-        vpush           {d8-d15}
-        sub             sp,  sp,  #44*8
-        add             r12, sp,  #7
-        bic             r12, r12, #7
-        mov             r3,  #20
-        vmov.i8         d0,  #20
-        vmov.i8         d1,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s5_neon
-        ldr             r1,  [sp, #416]
-        add             r1,  r1,  #8
-        mov             r3,  #20
-        bl              put_rv40_qpel8_h_lp_packed_s5_neon
-        vmov.i8         d1,  #52
-        b               .L\type\()_rv40_qpel16_v_s6
-endfunc
-
-function ff_\type\()_rv40_qpel16_mc33_neon, export=1
-        mov             r3,  #16
-        b               X(ff_\type\()_pixels16_xy2_neon)
-endfunc
-.endm
-
-        rv40_qpel       put
-        rv40_qpel       avg
-
-.macro  rv40_weight
-        vmovl.u8        q8,  d2
-        vmovl.u8        q9,  d3
-        vmovl.u8        q10, d4
-        vmovl.u8        q11, d5
-        vmull.u16       q2,  d16, d0[2]
-        vmull.u16       q3,  d17, d0[2]
-        vmull.u16       q8,  d18, d0[2]
-        vmull.u16       q9,  d19, d0[2]
-        vmull.u16       q12, d20, d0[0]
-        vmull.u16       q13, d21, d0[0]
-        vmull.u16       q14, d22, d0[0]
-        vmull.u16       q15, d23, d0[0]
-        vshrn.i32       d4,  q2,  #9
-        vshrn.i32       d5,  q3,  #9
-        vshrn.i32       d6,  q8,  #9
-        vshrn.i32       d7,  q9,  #9
-        vshrn.i32       d16, q12, #9
-        vshrn.i32       d17, q13, #9
-        vshrn.i32       d18, q14, #9
-        vshrn.i32       d19, q15, #9
-        vadd.u16        q2,  q2,  q8
-        vadd.u16        q3,  q3,  q9
-        vrshrn.i16      d2,  q2,  #5
-        vrshrn.i16      d3,  q3,  #5
-.endm
-
-/* void ff_rv40_weight_func_16_neon(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                                    int w1, int w2, int stride) */
-function ff_rv40_weight_func_16_neon, export=1
-        ldr             r12, [sp]
-        vmov            d0,  r3,  r12
-        ldr             r12, [sp, #4]
-        mov             r3,  #16
-1:
-        vld1.8          {q1},     [r1,:128], r12
-        vld1.8          {q2},     [r2,:128], r12
-        rv40_weight
-        vst1.8          {q1},     [r0,:128], r12
-        subs            r3,  r3,  #1
-        bne             1b
-        bx              lr
-endfunc
-
-/* void ff_rv40_weight_func_8_neon(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                                   int w1, int w2, int stride) */
-function ff_rv40_weight_func_8_neon, export=1
-        ldr             r12, [sp]
-        vmov            d0,  r3,  r12
-        ldr             r12, [sp, #4]
-        mov             r3,  #8
-1:
-        vld1.8          {d2},     [r1,:64], r12
-        vld1.8          {d3},     [r1,:64], r12
-        vld1.8          {d4},     [r2,:64], r12
-        vld1.8          {d5},     [r2,:64], r12
-        rv40_weight
-        vst1.8          {d2},     [r0,:64], r12
-        vst1.8          {d3},     [r0,:64], r12
-        subs            r3,  r3,  #2
-        bne             1b
-        bx              lr
-endfunc
-
-function ff_rv40_h_loop_filter_strength_neon, export=1
-        pkhbt           r2,  r3,  r2,  lsl #18
-
-        ldr             r3,  [r0]
-        ldr_dpre        r12, r0,  r1
-        teq             r3,  r12
-        beq             1f
-
-        sub             r0,  r0,  r1,  lsl #1
-
-        vld1.32         {d4[]},   [r0,:32], r1  @ -3
-        vld1.32         {d0[]},   [r0,:32], r1  @ -2
-        vld1.32         {d4[1]},  [r0,:32], r1  @ -1
-        vld1.32         {d5[]},   [r0,:32], r1  @  0
-        vld1.32         {d1[]},   [r0,:32], r1  @  1
-        vld1.32         {d5[0]},  [r0,:32], r1  @  2
-
-        vpaddl.u8       q8,  q0                 @ -2, -2, -2, -2,  1,  1,  1,  1
-        vpaddl.u8       q9,  q2                 @ -3, -3, -1, -1,  2,  2,  0,  0
-        vdup.32         d30, r2                 @ beta2, beta << 2
-        vpadd.u16       d16, d16, d17           @ -2, -2,  1,  1
-        vpadd.u16       d18, d18, d19           @ -3, -1,  2,  0
-        vabd.u16        d16, d18, d16
-        vclt.u16        d16, d16, d30
-
-        ldrd            r2,  r3,  [sp, #4]
-        vmovl.u16       q12, d16
-        vtrn.16         d16, d17
-        vshr.u32        q12, q12, #15
-        ldr             r0,  [sp]
-        vst1.32         {d24[1]}, [r2,:32]
-        vst1.32         {d25[1]}, [r3,:32]
-
-        cmp             r0,  #0
-        it              eq
-        bxeq            lr
-
-        vand            d18, d16, d17
-        vtrn.32         d18, d19
-        vand            d18, d18, d19
-        vmov.u16        r0,  d18[0]
-        bx              lr
-1:
-        ldrd            r2,  r3,  [sp, #4]
-        mov             r0,  #0
-        str             r0,  [r2]
-        str             r0,  [r3]
-        bx              lr
-endfunc
-
-function ff_rv40_v_loop_filter_strength_neon, export=1
-        sub             r0,  r0,  #3
-        pkhbt           r2,  r3,  r2,  lsl #18
-
-        vld1.8          {d0},     [r0], r1
-        vld1.8          {d1},     [r0], r1
-        vld1.8          {d2},     [r0], r1
-        vld1.8          {d3},     [r0], r1
-
-        vaddl.u8        q0,  d0,  d1
-        vaddl.u8        q1,  d2,  d3
-        vdup.32         q15, r2
-        vadd.u16        q0,  q0,  q1            @ -3, -2, -1,  0,  1,  2
-        vext.16         q1,  q0,  q0,  #1       @ -2, -1,  0,  1,  2
-        vabd.u16        q0,  q1,  q0
-        vclt.u16        q0,  q0,  q15
-
-        ldrd            r2,  r3,  [sp, #4]
-        vmovl.u16       q1,  d0
-        vext.16         d1,  d0,  d1,  #3
-        vshr.u32        q1,  q1,  #15
-        ldr             r0,  [sp]
-        vst1.32         {d2[1]},  [r2,:32]
-        vst1.32         {d3[1]},  [r3,:32]
-
-        cmp             r0,  #0
-        it              eq
-        bxeq            lr
-
-        vand            d0,  d0,  d1
-        vtrn.16         d0,  d1
-        vand            d0,  d0,  d1
-        vmov.u16        r0,  d0[0]
-        bx              lr
-endfunc
-
-.macro  rv40_weak_loop_filter
-        vdup.16         d30, r2                 @ filter_p1
-        vdup.16         d31, r3                 @ filter_q1
-        ldrd            r2,  r3,  [sp]
-        vdup.16         d28, r2                 @ alpha
-        vdup.16         d29, r3                 @ beta
-        ldr             r12, [sp, #8]
-        vdup.16         d25, r12                @ lim_p0q0
-        ldrd            r2,  r3,  [sp, #12]
-        vsubl.u8        q9,  d5,  d4            @ x, t
-        vabdl.u8        q8,  d5,  d4            @ x, abs(t)
-        vneg.s16        q15, q15
-        vceq.i16        d16, d19, #0            @ !t
-        vshl.s16        d19, d19, #2            @ t << 2
-        vmul.u16        d18, d17, d28           @ alpha * abs(t)
-        vand            d24, d30, d31           @ filter_p1 & filter_q1
-        vsubl.u8        q1,  d0,  d4            @ p1p2, p1p0
-        vsubl.u8        q3,  d1,  d5            @ q1q2, q1q0
-        vmov.i16        d22, #3
-        vshr.u16        d18, d18, #7
-        vadd.i16        d22, d22, d24           @ 3 - (filter_p1 & filter_q1)
-        vsubl.u8        q10, d0,  d1            @ src[-2] - src[1]
-        vcle.u16        d18, d18, d22
-        vand            d20, d20, d24
-        vneg.s16        d23, d25                @ -lim_p0q0
-        vadd.s16        d19, d19, d20
-        vbic            d16, d18, d16           @ t && u <= 3 - (fp1 & fq1)
-        vtrn.32         d4,  d5                 @ -3,  2, -1,  0
-        vrshr.s16       d19, d19, #3
-        vmov            d28, d29                @ beta
-        vswp            d3,  d6                 @ q1q2, p1p0
-        vmin.s16        d19, d19, d25
-        vand            d30, d30, d16
-        vand            d31, d31, d16
-        vadd.s16        q10, q1,  q3            @ p1p2 + p1p0, q1q2 + q1q0
-        vmax.s16        d19, d19, d23           @ diff
-        vabs.s16        q1,  q1                 @ abs(p1p2), abs(q1q2)
-        vand            d18, d19, d16           @ diff
-        vcle.u16        q1,  q1,  q14
-        vneg.s16        d19, d18                @ -diff
-        vdup.16         d26, r3                 @ lim_p1
-        vaddw.u8        q2,  q9,  d5            @ src[-1]+diff, src[0]-diff
-        vhsub.s16       q11, q10, q9
-        vand            q1,  q1,  q15
-        vqmovun.s16     d4,  q2                 @ -1,  0
-        vand            q9,  q11, q1
-        vdup.16         d27, r2                 @ lim_q1
-        vneg.s16        q9,  q9
-        vneg.s16        q14, q13
-        vmin.s16        q9,  q9,  q13
-        vtrn.32         d0,  d1                 @ -2,  1,  -2,  1
-        vmax.s16        q9,  q9,  q14
-        vaddw.u8        q3,  q9,  d0
-        vqmovun.s16     d5,  q3                 @ -2,  1
-.endm
-
-function ff_rv40_h_weak_loop_filter_neon, export=1
-        sub             r0,  r0,  r1,  lsl #1
-        sub             r0,  r0,  r1
-
-        vld1.32         {d4[]},   [r0,:32], r1
-        vld1.32         {d0[]},   [r0,:32], r1
-        vld1.32         {d4[1]},  [r0,:32], r1
-        vld1.32         {d5[]},   [r0,:32], r1
-        vld1.32         {d1[]},   [r0,:32], r1
-        vld1.32         {d5[0]},  [r0,:32]
-
-        sub             r0,  r0,  r1,  lsl #2
-
-        rv40_weak_loop_filter
-
-        vst1.32         {d5[0]},  [r0,:32], r1
-        vst1.32         {d4[0]},  [r0,:32], r1
-        vst1.32         {d4[1]},  [r0,:32], r1
-        vst1.32         {d5[1]},  [r0,:32], r1
-
-        bx              lr
-endfunc
-
-function ff_rv40_v_weak_loop_filter_neon, export=1
-        sub             r12, r0,  #3
-        sub             r0,  r0,  #2
-
-        vld1.8          {d4},     [r12], r1
-        vld1.8          {d5},     [r12], r1
-        vld1.8          {d2},     [r12], r1
-        vld1.8          {d3},     [r12], r1
-
-        vtrn.16         q2,  q1
-        vtrn.8          d4,  d5
-        vtrn.8          d2,  d3
-
-        vrev64.32       d5,  d5
-        vtrn.32         q2,  q1
-        vdup.32         d0,  d3[0]
-        vdup.32         d1,  d2[0]
-
-        rv40_weak_loop_filter
-
-        vtrn.32         q2,  q3
-        vswp            d4,  d5
-
-        vst4.8          {d4[0],d5[0],d6[0],d7[0]}, [r0], r1
-        vst4.8          {d4[1],d5[1],d6[1],d7[1]}, [r0], r1
-        vst4.8          {d4[2],d5[2],d6[2],d7[2]}, [r0], r1
-        vst4.8          {d4[3],d5[3],d6[3],d7[3]}, [r0], r1
-
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/sbrdsp_init_arm.c b/deps/libav/libavcodec/arm/sbrdsp_init_arm.c
deleted file mode 100644
index 4da7967..0000000
--- a/deps/libav/libavcodec/arm/sbrdsp_init_arm.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/arm/cpu.h"
-#include "libavutil/attributes.h"
-#include "libavcodec/sbrdsp.h"
-
-void ff_sbr_sum64x5_neon(float *z);
-float ff_sbr_sum_square_neon(float (*x)[2], int n);
-void ff_sbr_neg_odd_64_neon(float *x);
-void ff_sbr_qmf_pre_shuffle_neon(float *z);
-void ff_sbr_qmf_post_shuffle_neon(float W[32][2], const float *z);
-void ff_sbr_qmf_deint_neg_neon(float *v, const float *src);
-void ff_sbr_qmf_deint_bfly_neon(float *v, const float *src0, const float *src1);
-void ff_sbr_hf_g_filt_neon(float (*Y)[2], const float (*X_high)[40][2],
-                           const float *g_filt, int m_max, intptr_t ixh);
-void ff_sbr_hf_gen_neon(float (*X_high)[2], const float (*X_low)[2],
-                        const float alpha0[2], const float alpha1[2],
-                        float bw, int start, int end);
-void ff_sbr_autocorrelate_neon(const float x[40][2], float phi[3][2][2]);
-
-void ff_sbr_hf_apply_noise_0_neon(float Y[64][2], const float *s_m,
-                                  const float *q_filt, int noise,
-                                  int kx, int m_max);
-void ff_sbr_hf_apply_noise_1_neon(float Y[64][2], const float *s_m,
-                                  const float *q_filt, int noise,
-                                  int kx, int m_max);
-void ff_sbr_hf_apply_noise_2_neon(float Y[64][2], const float *s_m,
-                                  const float *q_filt, int noise,
-                                  int kx, int m_max);
-void ff_sbr_hf_apply_noise_3_neon(float Y[64][2], const float *s_m,
-                                  const float *q_filt, int noise,
-                                  int kx, int m_max);
-
-av_cold void ff_sbrdsp_init_arm(SBRDSPContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        s->sum64x5 = ff_sbr_sum64x5_neon;
-        s->sum_square = ff_sbr_sum_square_neon;
-        s->neg_odd_64 = ff_sbr_neg_odd_64_neon;
-        s->qmf_pre_shuffle = ff_sbr_qmf_pre_shuffle_neon;
-        s->qmf_post_shuffle = ff_sbr_qmf_post_shuffle_neon;
-        s->qmf_deint_neg = ff_sbr_qmf_deint_neg_neon;
-        s->qmf_deint_bfly = ff_sbr_qmf_deint_bfly_neon;
-        s->hf_g_filt = ff_sbr_hf_g_filt_neon;
-        s->hf_gen = ff_sbr_hf_gen_neon;
-        s->autocorrelate = ff_sbr_autocorrelate_neon;
-        s->hf_apply_noise[0] = ff_sbr_hf_apply_noise_0_neon;
-        s->hf_apply_noise[1] = ff_sbr_hf_apply_noise_1_neon;
-        s->hf_apply_noise[2] = ff_sbr_hf_apply_noise_2_neon;
-        s->hf_apply_noise[3] = ff_sbr_hf_apply_noise_3_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/sbrdsp_neon.S b/deps/libav/libavcodec/arm/sbrdsp_neon.S
deleted file mode 100644
index 610397f..0000000
--- a/deps/libav/libavcodec/arm/sbrdsp_neon.S
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_sbr_sum64x5_neon, export=1
-        push            {lr}
-        add             r1,  r0,  # 64*4
-        add             r2,  r0,  #128*4
-        add             r3,  r0,  #192*4
-        add             lr,  r0,  #256*4
-        mov             r12, #64
-1:
-        vld1.32         {q0},     [r0,:128]
-        vld1.32         {q1},     [r1,:128]!
-        vadd.f32        q0,  q0,  q1
-        vld1.32         {q2},     [r2,:128]!
-        vadd.f32        q0,  q0,  q2
-        vld1.32         {q3},     [r3,:128]!
-        vadd.f32        q0,  q0,  q3
-        vld1.32         {q8},     [lr,:128]!
-        vadd.f32        q0,  q0,  q8
-        vst1.32         {q0},     [r0,:128]!
-        subs            r12, #4
-        bgt             1b
-        pop             {pc}
-endfunc
-
-function ff_sbr_sum_square_neon, export=1
-        vmov.f32        q0,  #0.0
-1:
-        vld1.32         {q1},     [r0,:128]!
-        vmla.f32        q0,  q1,  q1
-        subs            r1,  r1,  #2
-        bgt             1b
-        vadd.f32        d0,  d0,  d1
-        vpadd.f32       d0,  d0,  d0
-NOVFP   vmov.32         r0,  d0[0]
-        bx              lr
-endfunc
-
-function ff_sbr_neg_odd_64_neon, export=1
-        mov             r1,  r0
-        vmov.i32        q8,  #1<<31
-        vld2.32         {q0,q1},  [r0,:128]!
-        veor            q1,  q1,  q8
-        vld2.32         {q2,q3},  [r0,:128]!
-    .rept 3
-        vst2.32         {q0,q1},  [r1,:128]!
-        veor            q3,  q3,  q8
-        vld2.32         {q0,q1},  [r0,:128]!
-        vst2.32         {q2,q3},  [r1,:128]!
-        veor            q1,  q1,  q8
-        vld2.32         {q2,q3},  [r0,:128]!
-    .endr
-        veor            q3,  q3,  q8
-        vst2.32         {q0,q1},  [r1,:128]!
-        vst2.32         {q2,q3},  [r1,:128]!
-        bx              lr
-endfunc
-
-function ff_sbr_qmf_pre_shuffle_neon, export=1
-        add             r1,  r0,  #60*4
-        add             r2,  r0,  #64*4
-        vld1.32         {d0},     [r0,:64]!
-        vst1.32         {d0},     [r2,:64]!
-        mov             r3,  #-16
-        mov             r12, #24
-        vmov.i32        q8,  #1<<31
-        vld1.32         {q0},     [r1,:128], r3
-        vld1.32         {d2},     [r0,:64]!
-1:
-        vld1.32         {d3,d4},  [r0,:128]!
-        vrev64.32       q0,  q0
-        vld1.32         {q9},     [r1,:128], r3
-        veor            q0,  q0,  q8
-        vld1.32         {d5,d6},  [r0,:128]!
-        vswp            d0,  d1
-        vrev64.32       q9,  q9
-        vst2.32         {q0,q1},  [r2,:64]!
-        vmov            q10, q2
-        veor            q9,  q9,  q8
-        vmov            d2,  d6
-        vswp            d18, d19
-        vld1.32         {q0},     [r1,:128], r3
-        vst2.32         {q9,q10}, [r2,:64]!
-        subs            r12, r12, #8
-        bgt             1b
-        vld1.32         {d3,d4},  [r0,:128]!
-        vrev64.32       q0,  q0
-        vld1.32         {q9},     [r1,:128], r3
-        veor            q0,  q0,  q8
-        vld1.32         {d5},     [r0,:64]!
-        vswp            d0,  d1
-        vrev64.32       q9,  q9
-        vst2.32         {q0,q1},  [r2,:64]!
-        vswp            d4,  d5
-        veor            q1,  q9,  q8
-        vst2.32         {d3,d5},  [r2,:64]!
-        vst2.32         {d2[0],d4[0]}, [r2,:64]!
-        bx              lr
-endfunc
-
-function ff_sbr_qmf_post_shuffle_neon, export=1
-        add             r2,  r1,  #60*4
-        mov             r3,  #-16
-        mov             r12, #32
-        vmov.i32        q8,  #1<<31
-        vld1.32         {q0},     [r2,:128], r3
-        vld1.32         {q1},     [r1,:128]!
-1:
-        pld             [r2, #-32]
-        vrev64.32       q0,  q0
-        vswp            d2,  d3
-        veor            q0,  q0,  q8
-        vld1.32         {q2},     [r2,:128], r3
-        vld1.32         {q3},     [r1,:128]!
-        vst2.32         {d1,d3},  [r0,:128]!
-        vst2.32         {d0,d2},  [r0,:128]!
-        pld             [r2, #-32]
-        vrev64.32       q2,  q2
-        vswp            d6,  d7
-        veor            q2,  q2,  q8
-        vld1.32         {q0},     [r2,:128], r3
-        vld1.32         {q1},     [r1,:128]!
-        vst2.32         {d5,d7},  [r0,:128]!
-        vst2.32         {d4,d6},  [r0,:128]!
-        subs            r12, r12, #8
-        bgt             1b
-        bx              lr
-endfunc
-
-function ff_sbr_qmf_deint_neg_neon, export=1
-        add             r1,  r1,  #60*4
-        add             r2,  r0,  #62*4
-        mov             r3,  #-16
-        mov             r12, #32
-        vmov.i32        d2,  #1<<31
-1:
-        vld2.32         {d0,d1},  [r1,:128], r3
-        veor            d0,  d0,  d2
-        vrev64.32       d1,  d1
-        vst1.32         {d0},     [r2,:64]
-        vst1.32         {d1},     [r0,:64]!
-        sub             r2,  r2,  #8
-        subs            r12, r12, #2
-        bgt             1b
-        bx              lr
-endfunc
-
-function ff_sbr_qmf_deint_bfly_neon, export=1
-        push            {lr}
-        add             r2,  r2,  #60*4
-        add             r3,  r0,  #124*4
-        mov             r12, #64
-        mov             lr,  #-16
-1:
-        vld1.32         {q0},     [r1,:128]!
-        vld1.32         {q1},     [r2,:128], lr
-        vrev64.32       q2,  q0
-        vrev64.32       q3,  q1
-        vadd.f32        d3,  d4,  d3
-        vadd.f32        d2,  d5,  d2
-        vsub.f32        d0,  d0,  d7
-        vsub.f32        d1,  d1,  d6
-        vst1.32         {q1},     [r3,:128], lr
-        vst1.32         {q0},     [r0,:128]!
-        subs            r12, r12, #4
-        bgt             1b
-        pop             {pc}
-endfunc
-
-function ff_sbr_hf_g_filt_neon, export=1
-        ldr             r12, [sp]
-        add             r1,  r1,  r12, lsl #3
-        mov             r12, #40*2*4
-        sub             r3,  r3,  #1
-        vld2.32         {d2[],d3[]},[r2,:64]!
-        vld1.32         {d0},     [r1,:64], r12
-1:
-        vld1.32         {d1},     [r1,:64], r12
-        vmul.f32        q3,  q0,  q1
-        vld2.32         {d2[],d3[]},[r2,:64]!
-        vld1.32         {d0},     [r1,:64], r12
-        vst1.32         {q3},     [r0,:64]!
-        subs            r3,  r3,  #2
-        bgt             1b
-        it              lt
-        bxlt            lr
-        vmul.f32        d0,  d0,  d2
-        vst1.32         {d0},     [r0,:64]!
-        bx              lr
-endfunc
-
-function ff_sbr_hf_gen_neon, export=1
-NOVFP   vld1.32         {d1[]},   [sp,:32]
-VFP     vdup.32         d1,  d0[0]
-        vmul.f32        d0,  d1,  d1
-        vld1.32         {d3},     [r2,:64]
-        vld1.32         {d2},     [r3,:64]
-        vmul.f32        q0,  q0,  q1
-        ldrd            r2,  r3,  [sp, #4*!HAVE_VFP_ARGS]
-        vtrn.32         d0,  d1
-        vneg.f32        d18, d1
-        vtrn.32         d18, d1
-        add             r0,  r0,  r2,  lsl #3
-        add             r1,  r1,  r2,  lsl #3
-        sub             r1,  r1,  #2*8
-        sub             r3,  r3,  r2
-        vld1.32         {q1},     [r1,:128]!
-1:
-        vld1.32         {q3},     [r1,:128]!
-        vrev64.32       q2,  q1
-        vmov            q8,  q3
-        vrev64.32       d20, d3
-        vrev64.32       d21, d6
-        vmla.f32        q3,  q1,  d0[0]
-        vmla.f32        d6,  d4,  d18
-        vmla.f32        d7,  d20, d18
-        vmla.f32        d6,  d3,  d0[1]
-        vmla.f32        d7,  d16, d0[1]
-        vmla.f32        d6,  d5,  d1
-        vmla.f32        d7,  d21, d1
-        vmov            q1,  q8
-        vst1.32         {q3},     [r0,:128]!
-        subs            r3,  r3,  #2
-        bgt             1b
-        bx              lr
-endfunc
-
-function ff_sbr_autocorrelate_neon, export=1
-        vld1.32         {q0},     [r0,:128]!
-        vmov.f32        q1,  #0.0
-        vmov.f32        q3,  #0.0
-        vmov.f32        d20, #0.0
-        vmul.f32        d21, d1,  d1
-        vmov            q8,  q0
-        vmov            q11, q0
-        mov             r12, #36
-1:
-        vld1.32         {q2},     [r0,:128]!
-        vrev64.32       q12, q2
-        vmla.f32        q10, q2,  q2
-        vmla.f32        d2,  d1,  d4
-        vmla.f32        d3,  d1,  d24
-        vmla.f32        d6,  d0,  d4
-        vmla.f32        d7,  d0,  d24
-        vmla.f32        d2,  d4,  d5
-        vmla.f32        d3,  d4,  d25
-        vmla.f32        d6,  d1,  d5
-        vmla.f32        d7,  d1,  d25
-        vmov            q0,  q2
-        subs            r12, r12, #2
-        bgt             1b
-        vld1.32         {q2},     [r0,:128]!
-        vrev64.32       q12, q2
-        vmla.f32        d2,  d1,  d4
-        vmla.f32        d3,  d1,  d24
-        vmla.f32        d6,  d0,  d4
-        vmla.f32        d7,  d0,  d24
-        vadd.f32        d20, d20, d21
-        vrev64.32       d18, d17
-        vmla.f32        d6,  d1,  d5
-        vmla.f32        d7,  d1,  d25
-        vmov            q0,  q1
-        vmla.f32        d0,  d16, d17
-        vmla.f32        d1,  d16, d18
-        vmla.f32        d2,  d4,  d5
-        vmla.f32        d3,  d4,  d25
-        vneg.f32        s15, s15
-        vmov            d21, d20
-        vpadd.f32       d0,  d0,  d2
-        vpadd.f32       d7,  d6,  d7
-        vtrn.32         d1,  d3
-        vsub.f32        d6,  d1,  d3
-        vmla.f32        d20, d22, d22
-        vmla.f32        d21, d4,  d4
-        vtrn.32         d0,  d6
-        vpadd.f32       d20, d20, d21
-        vst1.32         {q3},     [r1,:128]!
-        vst1.32         {d20[1]}, [r1,:32]
-        add             r1,  r1,  #2*4
-        vst1.32         {d0},     [r1,:64]
-        add             r1,  r1,  #4*4
-        vst1.32         {d20[0]}, [r1,:32]
-        bx              lr
-endfunc
-
-function ff_sbr_hf_apply_noise_0_neon, export=1
-        vmov.i32        d3,  #0
-.Lhf_apply_noise_0:
-        push            {r4,lr}
-        movrelx         r4,  X(ff_sbr_noise_table)
-        ldr             r12, [sp, #12]
-        add             r3,  r3,  #1
-        bfc             r3,  #9,  #23
-        sub             r12, r12, #1
-1:
-        add             lr,  r4,  r3,  lsl #3
-        vld2.32         {q0},     [r0,:64]
-        vld2.32         {q3},     [lr,:64]
-        vld1.32         {d2},     [r1,:64]!
-        vld1.32         {d18},    [r2,:64]!
-        vceq.f32        d16, d2,  #0
-        veor            d2,  d2,  d3
-        vmov            q2,  q0
-        vmla.f32        d0,  d6,  d18
-        vmla.f32        d1,  d7,  d18
-        vadd.f32        d4,  d4,  d2
-        add             r3,  r3,  #2
-        bfc             r3,  #9,  #23
-        vbif            d0,  d4,  d16
-        vbif            d1,  d5,  d16
-        vst2.32         {q0},     [r0,:64]!
-        subs            r12, r12, #2
-        bgt             1b
-        blt             2f
-        add             lr,  r4,  r3,  lsl #3
-        vld1.32         {d0},     [r0,:64]
-        vld1.32         {d6},     [lr,:64]
-        vld1.32         {d2[]},   [r1,:32]!
-        vld1.32         {d3[]},   [r2,:32]!
-        vceq.f32        d4,  d2,  #0
-        veor            d2,  d2,  d3
-        vmov            d1,  d0
-        vmla.f32        d0,  d6,  d3
-        vadd.f32        s2,  s2,  s4
-        vbif            d0,  d1,  d4
-        vst1.32         {d0},     [r0,:64]!
-2:
-        pop             {r4,pc}
-endfunc
-
-function ff_sbr_hf_apply_noise_1_neon, export=1
-        ldr             r12, [sp]
-        push            {r4,lr}
-        lsl             r12, r12, #31
-        eor             lr,  r12, #1<<31
-        vmov            d3,  r12, lr
-.Lhf_apply_noise_1:
-        movrelx         r4,  X(ff_sbr_noise_table)
-        ldr             r12, [sp, #12]
-        add             r3,  r3,  #1
-        bfc             r3,  #9,  #23
-        sub             r12, r12, #1
-1:
-        add             lr,  r4,  r3,  lsl #3
-        vld2.32         {q0},     [r0,:64]
-        vld2.32         {q3},     [lr,:64]
-        vld1.32         {d2},     [r1,:64]!
-        vld1.32         {d18},    [r2,:64]!
-        vceq.f32        d16, d2,  #0
-        veor            d2,  d2,  d3
-        vmov            q2,  q0
-        vmla.f32        d0,  d6,  d18
-        vmla.f32        d1,  d7,  d18
-        vadd.f32        d5,  d5,  d2
-        add             r3,  r3,  #2
-        bfc             r3,  #9,  #23
-        vbif            d0,  d4,  d16
-        vbif            d1,  d5,  d16
-        vst2.32         {q0},     [r0,:64]!
-        subs            r12, r12, #2
-        bgt             1b
-        blt             2f
-        add             lr,  r4,  r3,  lsl #3
-        vld1.32         {d0},     [r0,:64]
-        vld1.32         {d6},     [lr,:64]
-        vld1.32         {d2[]},   [r1,:32]!
-        vld1.32         {d18[]},  [r2,:32]!
-        vceq.f32        d4,  d2,  #0
-        veor            d2,  d2,  d3
-        vmov            d1,  d0
-        vmla.f32        d0,  d6,  d18
-        vadd.f32        s3,  s3,  s5
-        vbif            d0,  d1,  d4
-        vst1.32         {d0},     [r0,:64]!
-2:
-        pop             {r4,pc}
-endfunc
-
-function ff_sbr_hf_apply_noise_2_neon, export=1
-        vmov.i32        d3,  #1<<31
-        b               .Lhf_apply_noise_0
-endfunc
-
-function ff_sbr_hf_apply_noise_3_neon, export=1
-        ldr             r12, [sp]
-        push            {r4,lr}
-        lsl             r12, r12, #31
-        eor             lr,  r12, #1<<31
-        vmov            d3,  lr, r12
-        b               .Lhf_apply_noise_1
-endfunc
diff --git a/deps/libav/libavcodec/arm/simple_idct_arm.S b/deps/libav/libavcodec/arm/simple_idct_arm.S
deleted file mode 100644
index bf9ee3d..0000000
--- a/deps/libav/libavcodec/arm/simple_idct_arm.S
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * Copyright (C) 2002 Frederic 'dilb' Boulay
- *
- * Author: Frederic Boulay <dilb at handhelds.org>
- *
- * The function defined in this file is derived from the simple_idct function
- * from the libavcodec library part of the Libav project.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-/* useful constants for the algorithm */
-#define W1  22725
-#define W2  21407
-#define W3  19266
-#define W4  16383
-#define W5  12873
-#define W6  8867
-#define W7  4520
-#define MASK_MSHW 0xFFFF0000
-
-#define ROW_SHIFT 11
-#define ROW_SHIFT2MSHW (16-11)
-#define COL_SHIFT 20
-#define ROW_SHIFTED_1 1024 /* 1<< (ROW_SHIFT-1) */
-#define COL_SHIFTED_1 524288 /* 1<< (COL_SHIFT-1) */
-
-
-function ff_simple_idct_arm, export=1
-        @@ void simple_idct_arm(int16_t *block)
-        @@ save stack for reg needed (take all of them),
-        @@ R0-R3 are scratch regs, so no need to save them, but R0 contains the pointer to block
-        @@ so it must not be overwritten, if it is not saved!!
-        @@ R12 is another scratch register, so it should not be saved too
-        @@ save all registers
-        stmfd sp!, {r4-r11, r14} @ R14 is also called LR
-        @@ at this point, R0=block, other registers are free.
-        add r14, r0, #112        @ R14=&block[8*7], better start from the last row, and decrease the value until row=0, i.e. R12=block.
-        @@ add 2 temporary variables in the stack: R0 and R14
-        sub sp, sp, #8          @ allow 2 local variables
-        str r0, [sp, #0]        @ save block in sp[0]
-        @@ stack status
-        @@ sp+4   free
-        @@ sp+0   R0  (block)
-
-
-        @@ at this point, R0=block, R14=&block[56], R12=__const_ptr_, R1-R11 free
-
-
-__row_loop:
-        @@ read the row and check if it is null, almost null, or not, according to strongarm specs, it is not necessary to optimize ldr accesses (i.e. split 32bits in 2 16bits words), at least it gives more usable registers :)
-        ldr r1, [r14, #0]        @ R1=(int32)(R12)[0]=ROWr32[0] (relative row cast to a 32b pointer)
-        ldr r2, [r14, #4]        @ R2=(int32)(R12)[1]=ROWr32[1]
-        ldr r3, [r14, #8]        @ R3=ROWr32[2]
-        ldr r4, [r14, #12]       @ R4=ROWr32[3]
-        @@ check if the words are null, if all of them are null, then proceed with next row (branch __end_row_loop),
-        @@ if ROWr16[0] is the only one not null, then proceed with this special case (branch __almost_empty_row)
-        @@ else follow the complete algorithm.
-        @@ at this point, R0=block, R14=&block[n], R12=__const_ptr_, R1=ROWr32[0], R2=ROWr32[1],
-        @@                R3=ROWr32[2], R4=ROWr32[3], R5-R11 free
-        orr r5, r4, r3           @ R5=R4 | R3
-        orr r5, r5, r2           @ R5=R4 | R3 | R2
-        orrs r6, r5, r1          @ Test R5 | R1 (the aim is to check if everything is null)
-        beq __end_row_loop
-        mov r7, r1, asr #16      @ R7=R1>>16=ROWr16[1] (evaluate it now, as it could be useful later)
-        ldrsh r6, [r14, #0]      @ R6=ROWr16[0]
-        orrs r5, r5, r7          @ R5=R4 | R3 | R2 | R7
-        beq __almost_empty_row
-
-@@ __b_evaluation:
-        @@ at this point, R0=block (temp),  R1(free), R2=ROWr32[1], R3=ROWr32[2], R4=ROWr32[3],
-        @@     R5=(temp), R6=ROWr16[0], R7=ROWr16[1], R8-R11 free,
-        @@     R12=__const_ptr_, R14=&block[n]
-        @@ to save some registers/calls, proceed with b0-b3 first, followed by a0-a3
-
-        @@ MUL16(b0, W1, row[1]);
-        @@ MUL16(b1, W3, row[1]);
-        @@ MUL16(b2, W5, row[1]);
-        @@ MUL16(b3, W7, row[1]);
-        @@ MAC16(b0, W3, row[3]);
-        @@ MAC16(b1, -W7, row[3]);
-        @@ MAC16(b2, -W1, row[3]);
-        @@ MAC16(b3, -W5, row[3]);
-        ldr r8, =W1              @ R8=W1
-        mov r2, r2, asr #16      @ R2=ROWr16[3]
-        mul r0, r8, r7           @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
-        ldr r9, =W3              @ R9=W3
-        ldr r10, =W5             @ R10=W5
-        mul r1, r9, r7           @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
-        ldr r11, =W7             @ R11=W7
-        mul r5, r10, r7          @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
-        mul r7, r11, r7          @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
-        teq r2, #0               @ if null avoid muls
-        itttt ne
-        mlane r0, r9, r2, r0     @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-        rsbne r2, r2, #0         @ R2=-ROWr16[3]
-        mlane r1, r11, r2, r1    @ R1-=W7*ROWr16[3]=b1 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-        mlane r5, r8, r2, r5     @ R5-=W1*ROWr16[3]=b2 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-        it    ne
-        mlane r7, r10, r2, r7    @ R7-=W5*ROWr16[3]=b3 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-
-        @@ at this point, R0=b0,  R1=b1, R2 (free), R3=ROWr32[2], R4=ROWr32[3],
-        @@     R5=b2, R6=ROWr16[0], R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
-        @@     R12=__const_ptr_, R14=&block[n]
-        @@ temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3];
-        @@ if (temp != 0) {}
-        orrs r2, r3, r4          @ R2=ROWr32[2] | ROWr32[3]
-        beq __end_b_evaluation
-
-        @@ at this point, R0=b0,  R1=b1, R2 (free), R3=ROWr32[2], R4=ROWr32[3],
-        @@     R5=b2, R6=ROWr16[0], R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
-        @@     R12=__const_ptr_, R14=&block[n]
-        @@ MAC16(b0, W5, row[5]);
-        @@ MAC16(b2, W7, row[5]);
-        @@ MAC16(b3, W3, row[5]);
-        @@ MAC16(b1, -W1, row[5]);
-        @@ MAC16(b0, W7, row[7]);
-        @@ MAC16(b2, W3, row[7]);
-        @@ MAC16(b3, -W1, row[7]);
-        @@ MAC16(b1, -W5, row[7]);
-        mov r3, r3, asr #16      @ R3=ROWr16[5]
-        teq r3, #0               @ if null avoid muls
-        it    ne
-        mlane r0, r10, r3, r0    @ R0+=W5*ROWr16[5]=b0
-        mov r4, r4, asr #16      @ R4=ROWr16[7]
-        itttt ne
-        mlane r5, r11, r3, r5    @ R5+=W7*ROWr16[5]=b2
-        mlane r7, r9, r3, r7     @ R7+=W3*ROWr16[5]=b3
-        rsbne r3, r3, #0         @ R3=-ROWr16[5]
-        mlane r1, r8, r3, r1     @ R7-=W1*ROWr16[5]=b1
-        @@ R3 is free now
-        teq r4, #0               @ if null avoid muls
-        itttt ne
-        mlane r0, r11, r4, r0    @ R0+=W7*ROWr16[7]=b0
-        mlane r5, r9, r4, r5     @ R5+=W3*ROWr16[7]=b2
-        rsbne r4, r4, #0         @ R4=-ROWr16[7]
-        mlane r7, r8, r4, r7     @ R7-=W1*ROWr16[7]=b3
-        it    ne
-        mlane r1, r10, r4, r1    @ R1-=W5*ROWr16[7]=b1
-        @@ R4 is free now
-__end_b_evaluation:
-        @@ at this point, R0=b0,  R1=b1, R2=ROWr32[2] | ROWr32[3] (tmp), R3 (free), R4 (free),
-        @@     R5=b2, R6=ROWr16[0], R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
-        @@     R12=__const_ptr_, R14=&block[n]
-
-@@ __a_evaluation:
-        @@ a0 = (W4 * row[0]) + (1 << (ROW_SHIFT - 1));
-        @@ a1 = a0 + W6 * row[2];
-        @@ a2 = a0 - W6 * row[2];
-        @@ a3 = a0 - W2 * row[2];
-        @@ a0 = a0 + W2 * row[2];
-        ldr r9, =W4              @ R9=W4
-        mul r6, r9, r6           @ R6=W4*ROWr16[0]
-        ldr r10, =W6             @ R10=W6
-        ldrsh r4, [r14, #4]      @ R4=ROWr16[2] (a3 not defined yet)
-        add r6, r6, #ROW_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(ROW_SHIFT-1) (a0)
-
-        mul r11, r10, r4         @ R11=W6*ROWr16[2]
-        ldr r8, =W2              @ R8=W2
-        sub r3, r6, r11          @ R3=a0-W6*ROWr16[2] (a2)
-        @@ temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3];
-        @@ if (temp != 0) {}
-        teq r2, #0
-        beq __end_bef_a_evaluation
-
-        add r2, r6, r11          @ R2=a0+W6*ROWr16[2] (a1)
-        mul r11, r8, r4          @ R11=W2*ROWr16[2]
-        sub r4, r6, r11          @ R4=a0-W2*ROWr16[2] (a3)
-        add r6, r6, r11          @ R6=a0+W2*ROWr16[2] (a0)
-
-
-        @@ at this point, R0=b0,  R1=b1, R2=a1, R3=a2, R4=a3,
-        @@     R5=b2, R6=a0, R7=b3, R8=W2, R9=W4, R10=W6, R11 (free),
-        @@     R12=__const_ptr_, R14=&block[n]
-
-
-        @@ a0 += W4*row[4]
-        @@ a1 -= W4*row[4]
-        @@ a2 -= W4*row[4]
-        @@ a3 += W4*row[4]
-        ldrsh r11, [r14, #8]     @ R11=ROWr16[4]
-        teq r11, #0              @ if null avoid muls
-        it    ne
-        mulne r11, r9, r11       @ R11=W4*ROWr16[4]
-        @@ R9 is free now
-        ldrsh r9, [r14, #12]     @ R9=ROWr16[6]
-        itttt ne
-        addne r6, r6, r11        @ R6+=W4*ROWr16[4] (a0)
-        subne r2, r2, r11        @ R2-=W4*ROWr16[4] (a1)
-        subne r3, r3, r11        @ R3-=W4*ROWr16[4] (a2)
-        addne r4, r4, r11        @ R4+=W4*ROWr16[4] (a3)
-        @@ W6 alone is no more useful, save W2*ROWr16[6] in it instead
-        teq r9, #0               @ if null avoid muls
-        itttt ne
-        mulne r11, r10, r9       @ R11=W6*ROWr16[6]
-        addne r6, r6, r11        @ R6+=W6*ROWr16[6] (a0)
-        mulne r10, r8, r9        @ R10=W2*ROWr16[6]
-        @@ a0 += W6*row[6];
-        @@ a3 -= W6*row[6];
-        @@ a1 -= W2*row[6];
-        @@ a2 += W2*row[6];
-        subne r4, r4, r11        @ R4-=W6*ROWr16[6] (a3)
-        itt   ne
-        subne r2, r2, r10        @ R2-=W2*ROWr16[6] (a1)
-        addne r3, r3, r10        @ R3+=W2*ROWr16[6] (a2)
-
-__end_a_evaluation:
-        @@ at this point, R0=b0,  R1=b1, R2=a1, R3=a2, R4=a3,
-        @@     R5=b2, R6=a0, R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
-        @@     R12=__const_ptr_, R14=&block[n]
-        @@ row[0] = (a0 + b0) >> ROW_SHIFT;
-        @@ row[1] = (a1 + b1) >> ROW_SHIFT;
-        @@ row[2] = (a2 + b2) >> ROW_SHIFT;
-        @@ row[3] = (a3 + b3) >> ROW_SHIFT;
-        @@ row[4] = (a3 - b3) >> ROW_SHIFT;
-        @@ row[5] = (a2 - b2) >> ROW_SHIFT;
-        @@ row[6] = (a1 - b1) >> ROW_SHIFT;
-        @@ row[7] = (a0 - b0) >> ROW_SHIFT;
-        add r8, r6, r0           @ R8=a0+b0
-        add r9, r2, r1           @ R9=a1+b1
-        @@ put 2 16 bits half-words in a 32bits word
-        @@ ROWr32[0]=ROWr16[0] | (ROWr16[1]<<16) (only Little Endian compliant then!!!)
-        ldr r10, =MASK_MSHW      @ R10=0xFFFF0000
-        and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a1+b1)<<5)
-        mvn r11, r10             @ R11= NOT R10= 0x0000FFFF
-        and r8, r11, r8, asr #ROW_SHIFT @ R8=0x0000FFFF & ((a0+b0)>>11)
-        orr r8, r8, r9
-        str r8, [r14, #0]
-
-        add r8, r3, r5           @ R8=a2+b2
-        add r9, r4, r7           @ R9=a3+b3
-        and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a3+b3)<<5)
-        and r8, r11, r8, asr #ROW_SHIFT @ R8=0x0000FFFF & ((a2+b2)>>11)
-        orr r8, r8, r9
-        str r8, [r14, #4]
-
-        sub r8, r4, r7           @ R8=a3-b3
-        sub r9, r3, r5           @ R9=a2-b2
-        and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a2-b2)<<5)
-        and r8, r11, r8, asr #ROW_SHIFT @ R8=0x0000FFFF & ((a3-b3)>>11)
-        orr r8, r8, r9
-        str r8, [r14, #8]
-
-        sub r8, r2, r1           @ R8=a1-b1
-        sub r9, r6, r0           @ R9=a0-b0
-        and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a0-b0)<<5)
-        and r8, r11, r8, asr #ROW_SHIFT @ R8=0x0000FFFF & ((a1-b1)>>11)
-        orr r8, r8, r9
-        str r8, [r14, #12]
-
-        bal __end_row_loop
-
-__almost_empty_row:
-        @@ the row was empty, except ROWr16[0], now, management of this special case
-        @@ at this point, R0=block, R14=&block[n], R12=__const_ptr_, R1=ROWr32[0], R2=ROWr32[1],
-        @@                R3=ROWr32[2], R4=ROWr32[3], R5=(temp), R6=ROWr16[0], R7=ROWr16[1],
-        @@                R8=0xFFFF (temp), R9-R11 free
-        mov r8, #0x10000         @ R8=0xFFFF (2 steps needed!) it saves a ldr call (because of delay run).
-        sub r8, r8, #1           @ R8 is now ready.
-        and r5, r8, r6, lsl #3   @ R5=R8 & (R6<<3)= (ROWr16[0]<<3) & 0xFFFF
-        orr r5, r5, r5, lsl #16  @ R5=R5 | (R5<<16)
-        str r5, [r14, #0]        @ R14[0]=ROWr32[0]=R5
-        str r5, [r14, #4]        @ R14[4]=ROWr32[1]=R5
-        str r5, [r14, #8]        @ R14[8]=ROWr32[2]=R5
-        str r5, [r14, #12]       @ R14[12]=ROWr32[3]=R5
-
-__end_row_loop:
-        @@ at this point, R0-R11 (free)
-        @@     R12=__const_ptr_, R14=&block[n]
-        ldr r0, [sp, #0]         @ R0=block
-        teq r0, r14              @ compare current &block[8*n] to block, when block is reached, the loop is finished.
-        sub r14, r14, #16
-        bne __row_loop
-
-
-
-        @@ at this point, R0=block, R1-R11 (free)
-        @@     R12=__const_ptr_, R14=&block[n]
-        add r14, r0, #14        @ R14=&block[7], better start from the last col, and decrease the value until col=0, i.e. R14=block.
-__col_loop:
-
-@@ __b_evaluation2:
-        @@ at this point, R0=block (temp),  R1-R11 (free)
-        @@     R12=__const_ptr_, R14=&block[n]
-        @@ proceed with b0-b3 first, followed by a0-a3
-        @@ MUL16(b0, W1, col[8x1]);
-        @@ MUL16(b1, W3, col[8x1]);
-        @@ MUL16(b2, W5, col[8x1]);
-        @@ MUL16(b3, W7, col[8x1]);
-        @@ MAC16(b0, W3, col[8x3]);
-        @@ MAC16(b1, -W7, col[8x3]);
-        @@ MAC16(b2, -W1, col[8x3]);
-        @@ MAC16(b3, -W5, col[8x3]);
-        ldr r8, =W1              @ R8=W1
-        ldrsh r7, [r14, #16]
-        mul r0, r8, r7           @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
-        ldr r9, =W3              @ R9=W3
-        ldr r10, =W5             @ R10=W5
-        mul r1, r9, r7           @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
-        ldr r11, =W7             @ R11=W7
-        mul r5, r10, r7          @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
-        ldrsh r2, [r14, #48]
-        mul r7, r11, r7          @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
-        teq r2, #0               @ if 0, then avoid muls
-        itttt ne
-        mlane r0, r9, r2, r0     @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-        rsbne r2, r2, #0         @ R2=-ROWr16[3]
-        mlane r1, r11, r2, r1    @ R1-=W7*ROWr16[3]=b1 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-        mlane r5, r8, r2, r5     @ R5-=W1*ROWr16[3]=b2 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-        it    ne
-        mlane r7, r10, r2, r7    @ R7-=W5*ROWr16[3]=b3 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-
-        @@ at this point, R0=b0,  R1=b1, R2 (free), R3 (free), R4 (free),
-        @@     R5=b2, R6 (free), R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
-        @@     R12=__const_ptr_, R14=&block[n]
-        @@ MAC16(b0, W5, col[5x8]);
-        @@ MAC16(b2, W7, col[5x8]);
-        @@ MAC16(b3, W3, col[5x8]);
-        @@ MAC16(b1, -W1, col[5x8]);
-        @@ MAC16(b0, W7, col[7x8]);
-        @@ MAC16(b2, W3, col[7x8]);
-        @@ MAC16(b3, -W1, col[7x8]);
-        @@ MAC16(b1, -W5, col[7x8]);
-        ldrsh r3, [r14, #80]     @ R3=COLr16[5x8]
-        teq r3, #0               @ if 0 then avoid muls
-        itttt ne
-        mlane r0, r10, r3, r0    @ R0+=W5*ROWr16[5x8]=b0
-        mlane r5, r11, r3, r5    @ R5+=W7*ROWr16[5x8]=b2
-        mlane r7, r9, r3, r7     @ R7+=W3*ROWr16[5x8]=b3
-        rsbne r3, r3, #0         @ R3=-ROWr16[5x8]
-        ldrsh r4, [r14, #112]    @ R4=COLr16[7x8]
-        it    ne
-        mlane r1, r8, r3, r1     @ R7-=W1*ROWr16[5x8]=b1
-        @@ R3 is free now
-        teq r4, #0               @ if 0 then avoid muls
-        itttt ne
-        mlane r0, r11, r4, r0    @ R0+=W7*ROWr16[7x8]=b0
-        mlane r5, r9, r4, r5     @ R5+=W3*ROWr16[7x8]=b2
-        rsbne r4, r4, #0         @ R4=-ROWr16[7x8]
-        mlane r7, r8, r4, r7     @ R7-=W1*ROWr16[7x8]=b3
-        it    ne
-        mlane r1, r10, r4, r1    @ R1-=W5*ROWr16[7x8]=b1
-        @@ R4 is free now
-@@ __end_b_evaluation2:
-        @@ at this point, R0=b0,  R1=b1, R2 (free), R3 (free), R4 (free),
-        @@     R5=b2, R6 (free), R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
-        @@     R12=__const_ptr_, R14=&block[n]
-
-@@ __a_evaluation2:
-        @@ a0 = (W4 * col[8x0]) + (1 << (COL_SHIFT - 1));
-        @@ a1 = a0 + W6 * row[2];
-        @@ a2 = a0 - W6 * row[2];
-        @@ a3 = a0 - W2 * row[2];
-        @@ a0 = a0 + W2 * row[2];
-        ldrsh r6, [r14, #0]
-        ldr r9, =W4              @ R9=W4
-        mul r6, r9, r6           @ R6=W4*ROWr16[0]
-        ldr r10, =W6             @ R10=W6
-        ldrsh r4, [r14, #32]     @ R4=ROWr16[2] (a3 not defined yet)
-        add r6, r6, #COL_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(COL_SHIFT-1) (a0)
-        mul r11, r10, r4         @ R11=W6*ROWr16[2]
-        ldr r8, =W2              @ R8=W2
-        add r2, r6, r11          @ R2=a0+W6*ROWr16[2] (a1)
-        sub r3, r6, r11          @ R3=a0-W6*ROWr16[2] (a2)
-        mul r11, r8, r4          @ R11=W2*ROWr16[2]
-        sub r4, r6, r11          @ R4=a0-W2*ROWr16[2] (a3)
-        add r6, r6, r11          @ R6=a0+W2*ROWr16[2] (a0)
-
-        @@ at this point, R0=b0,  R1=b1, R2=a1, R3=a2, R4=a3,
-        @@     R5=b2, R6=a0, R7=b3, R8=W2, R9=W4, R10=W6, R11 (free),
-        @@     R12=__const_ptr_, R14=&block[n]
-        @@ a0 += W4*row[4]
-        @@ a1 -= W4*row[4]
-        @@ a2 -= W4*row[4]
-        @@ a3 += W4*row[4]
-        ldrsh r11, [r14, #64]    @ R11=ROWr16[4]
-        teq r11, #0              @ if null avoid muls
-        itttt ne
-        mulne r11, r9, r11       @ R11=W4*ROWr16[4]
-        @@ R9 is free now
-        addne r6, r6, r11        @ R6+=W4*ROWr16[4] (a0)
-        subne r2, r2, r11        @ R2-=W4*ROWr16[4] (a1)
-        subne r3, r3, r11        @ R3-=W4*ROWr16[4] (a2)
-        ldrsh r9, [r14, #96]     @ R9=ROWr16[6]
-        it    ne
-        addne r4, r4, r11        @ R4+=W4*ROWr16[4] (a3)
-        @@ W6 alone is no more useful, save W2*ROWr16[6] in it instead
-        teq r9, #0               @ if null avoid muls
-        itttt ne
-        mulne r11, r10, r9       @ R11=W6*ROWr16[6]
-        addne r6, r6, r11        @ R6+=W6*ROWr16[6] (a0)
-        mulne r10, r8, r9        @ R10=W2*ROWr16[6]
-        @@ a0 += W6*row[6];
-        @@ a3 -= W6*row[6];
-        @@ a1 -= W2*row[6];
-        @@ a2 += W2*row[6];
-        subne r4, r4, r11        @ R4-=W6*ROWr16[6] (a3)
-        itt   ne
-        subne r2, r2, r10        @ R2-=W2*ROWr16[6] (a1)
-        addne r3, r3, r10        @ R3+=W2*ROWr16[6] (a2)
-@@ __end_a_evaluation2:
-        @@ at this point, R0=b0,  R1=b1, R2=a1, R3=a2, R4=a3,
-        @@     R5=b2, R6=a0, R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
-        @@     R12=__const_ptr_, R14=&block[n]
-        @@ col[0 ] = ((a0 + b0) >> COL_SHIFT);
-        @@ col[8 ] = ((a1 + b1) >> COL_SHIFT);
-        @@ col[16] = ((a2 + b2) >> COL_SHIFT);
-        @@ col[24] = ((a3 + b3) >> COL_SHIFT);
-        @@ col[32] = ((a3 - b3) >> COL_SHIFT);
-        @@ col[40] = ((a2 - b2) >> COL_SHIFT);
-        @@ col[48] = ((a1 - b1) >> COL_SHIFT);
-        @@ col[56] = ((a0 - b0) >> COL_SHIFT);
-        @@@@@ no optimization here @@@@@
-        add r8, r6, r0           @ R8=a0+b0
-        add r9, r2, r1           @ R9=a1+b1
-        mov r8, r8, asr #COL_SHIFT
-        mov r9, r9, asr #COL_SHIFT
-        strh r8, [r14, #0]
-        strh r9, [r14, #16]
-        add r8, r3, r5           @ R8=a2+b2
-        add r9, r4, r7           @ R9=a3+b3
-        mov r8, r8, asr #COL_SHIFT
-        mov r9, r9, asr #COL_SHIFT
-        strh r8, [r14, #32]
-        strh r9, [r14, #48]
-        sub r8, r4, r7           @ R8=a3-b3
-        sub r9, r3, r5           @ R9=a2-b2
-        mov r8, r8, asr #COL_SHIFT
-        mov r9, r9, asr #COL_SHIFT
-        strh r8, [r14, #64]
-        strh r9, [r14, #80]
-        sub r8, r2, r1           @ R8=a1-b1
-        sub r9, r6, r0           @ R9=a0-b0
-        mov r8, r8, asr #COL_SHIFT
-        mov r9, r9, asr #COL_SHIFT
-        strh r8, [r14, #96]
-        strh r9, [r14, #112]
-
-@@ __end_col_loop:
-        @@ at this point, R0-R11 (free)
-        @@     R12=__const_ptr_, R14=&block[n]
-        ldr r0, [sp, #0]         @ R0=block
-        teq r0, r14              @ compare current &block[n] to block, when block is reached, the loop is finished.
-        sub r14, r14, #2
-        bne __col_loop
-
-
-
-
-@@ __end_simple_idct_arm:
-        @@ restore registers to previous status!
-        add sp, sp, #8 @@ the local variables!
-        ldmfd sp!, {r4-r11, r15} @@ update PC with LR content.
-
-
-
-@@ kind of sub-function, here not to overload the common case.
-__end_bef_a_evaluation:
-        add r2, r6, r11          @ R2=a0+W6*ROWr16[2] (a1)
-        mul r11, r8, r4          @ R11=W2*ROWr16[2]
-        sub r4, r6, r11          @ R4=a0-W2*ROWr16[2] (a3)
-        add r6, r6, r11          @ R6=a0+W2*ROWr16[2] (a0)
-        bal __end_a_evaluation
-endfunc
diff --git a/deps/libav/libavcodec/arm/simple_idct_armv5te.S b/deps/libav/libavcodec/arm/simple_idct_armv5te.S
deleted file mode 100644
index bf509ee..0000000
--- a/deps/libav/libavcodec/arm/simple_idct_armv5te.S
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- * Simple IDCT
- *
- * Copyright (c) 2001 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2006 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-#define W1  22725   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W2  21407   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W3  19266   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W4  16383   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W5  12873   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W6  8867    /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W7  4520    /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define ROW_SHIFT 11
-#define COL_SHIFT 20
-
-#define W13 (W1 | (W3 << 16))
-#define W26 (W2 | (W6 << 16))
-#define W57 (W5 | (W7 << 16))
-
-function idct_row_armv5te
-        str    lr, [sp, #-4]!
-
-        ldrd   v1, v2, [a1, #8]
-        ldrd   a3, a4, [a1]          /* a3 = row[1:0], a4 = row[3:2] */
-        orrs   v1, v1, v2
-        itt    eq
-        cmpeq  v1, a4
-        cmpeq  v1, a3, lsr #16
-        beq    row_dc_only
-
-        mov    v1, #(1<<(ROW_SHIFT-1))
-        mov    ip, #16384
-        sub    ip, ip, #1            /* ip = W4 */
-        smlabb v1, ip, a3, v1        /* v1 = W4*row[0]+(1<<(RS-1)) */
-        ldr    ip, =W26              /* ip = W2 | (W6 << 16) */
-        smultb a2, ip, a4
-        smulbb lr, ip, a4
-        add    v2, v1, a2
-        sub    v3, v1, a2
-        sub    v4, v1, lr
-        add    v1, v1, lr
-
-        ldr    ip, =W13              /* ip = W1 | (W3 << 16) */
-        ldr    lr, =W57              /* lr = W5 | (W7 << 16) */
-        smulbt v5, ip, a3
-        smultt v6, lr, a4
-        smlatt v5, ip, a4, v5
-        smultt a2, ip, a3
-        smulbt v7, lr, a3
-        sub    v6, v6, a2
-        smulbt a2, ip, a4
-        smultt fp, lr, a3
-        sub    v7, v7, a2
-        smulbt a2, lr, a4
-        ldrd   a3, a4, [a1, #8]     /* a3=row[5:4] a4=row[7:6] */
-        sub    fp, fp, a2
-
-        orrs   a2, a3, a4
-        beq    1f
-
-        smlabt v5, lr, a3, v5
-        smlabt v6, ip, a3, v6
-        smlatt v5, lr, a4, v5
-        smlabt v6, lr, a4, v6
-        smlatt v7, lr, a3, v7
-        smlatt fp, ip, a3, fp
-        smulbt a2, ip, a4
-        smlatt v7, ip, a4, v7
-        sub    fp, fp, a2
-
-        ldr    ip, =W26              /* ip = W2 | (W6 << 16) */
-        mov    a2, #16384
-        sub    a2, a2, #1            /* a2 =  W4 */
-        smulbb a2, a2, a3            /* a2 =  W4*row[4] */
-        smultb lr, ip, a4            /* lr =  W6*row[6] */
-        add    v1, v1, a2            /* v1 += W4*row[4] */
-        add    v1, v1, lr            /* v1 += W6*row[6] */
-        add    v4, v4, a2            /* v4 += W4*row[4] */
-        sub    v4, v4, lr            /* v4 -= W6*row[6] */
-        smulbb lr, ip, a4            /* lr =  W2*row[6] */
-        sub    v2, v2, a2            /* v2 -= W4*row[4] */
-        sub    v2, v2, lr            /* v2 -= W2*row[6] */
-        sub    v3, v3, a2            /* v3 -= W4*row[4] */
-        add    v3, v3, lr            /* v3 += W2*row[6] */
-
-1:      add    a2, v1, v5
-        mov    a3, a2, lsr #11
-        bic    a3, a3, #0x1f0000
-        sub    a2, v2, v6
-        mov    a2, a2, lsr #11
-        add    a3, a3, a2, lsl #16
-        add    a2, v3, v7
-        mov    a4, a2, lsr #11
-        bic    a4, a4, #0x1f0000
-        add    a2, v4, fp
-        mov    a2, a2, lsr #11
-        add    a4, a4, a2, lsl #16
-        strd   a3, a4, [a1]
-
-        sub    a2, v4, fp
-        mov    a3, a2, lsr #11
-        bic    a3, a3, #0x1f0000
-        sub    a2, v3, v7
-        mov    a2, a2, lsr #11
-        add    a3, a3, a2, lsl #16
-        add    a2, v2, v6
-        mov    a4, a2, lsr #11
-        bic    a4, a4, #0x1f0000
-        sub    a2, v1, v5
-        mov    a2, a2, lsr #11
-        add    a4, a4, a2, lsl #16
-        strd   a3, a4, [a1, #8]
-
-        ldr    pc, [sp], #4
-
-row_dc_only:
-        orr    a3, a3, a3, lsl #16
-        bic    a3, a3, #0xe000
-        mov    a3, a3, lsl #3
-        mov    a4, a3
-        strd   a3, a4, [a1]
-        strd   a3, a4, [a1, #8]
-
-        ldr    pc, [sp], #4
-endfunc
-
-        .macro idct_col
-        ldr    a4, [a1]              /* a4 = col[1:0] */
-        mov    ip, #16384
-        sub    ip, ip, #1            /* ip = W4 */
-#if 0
-        mov    v1, #(1<<(COL_SHIFT-1))
-        smlabt v2, ip, a4, v1        /* v2 = W4*col[1] + (1<<(COL_SHIFT-1)) */
-        smlabb v1, ip, a4, v1        /* v1 = W4*col[0] + (1<<(COL_SHIFT-1)) */
-        ldr    a4, [a1, #(16*4)]
-#else
-        mov    v1, #((1<<(COL_SHIFT-1))/W4) /* this matches the C version */
-        add    v2, v1, a4, asr #16
-        rsb    v2, v2, v2, lsl #14
-        mov    a4, a4, lsl #16
-        add    v1, v1, a4, asr #16
-        ldr    a4, [a1, #(16*4)]
-        rsb    v1, v1, v1, lsl #14
-#endif
-
-        smulbb lr, ip, a4
-        smulbt a3, ip, a4
-        sub    v3, v1, lr
-        sub    v5, v1, lr
-        add    v7, v1, lr
-        add    v1, v1, lr
-        sub    v4, v2, a3
-        sub    v6, v2, a3
-        add    fp, v2, a3
-        ldr    ip, =W26
-        ldr    a4, [a1, #(16*2)]
-        add    v2, v2, a3
-
-        smulbb lr, ip, a4
-        smultb a3, ip, a4
-        add    v1, v1, lr
-        sub    v7, v7, lr
-        add    v3, v3, a3
-        sub    v5, v5, a3
-        smulbt lr, ip, a4
-        smultt a3, ip, a4
-        add    v2, v2, lr
-        sub    fp, fp, lr
-        add    v4, v4, a3
-        ldr    a4, [a1, #(16*6)]
-        sub    v6, v6, a3
-
-        smultb lr, ip, a4
-        smulbb a3, ip, a4
-        add    v1, v1, lr
-        sub    v7, v7, lr
-        sub    v3, v3, a3
-        add    v5, v5, a3
-        smultt lr, ip, a4
-        smulbt a3, ip, a4
-        add    v2, v2, lr
-        sub    fp, fp, lr
-        sub    v4, v4, a3
-        add    v6, v6, a3
-
-        stmfd  sp!, {v1, v2, v3, v4, v5, v6, v7, fp}
-
-        ldr    ip, =W13
-        ldr    a4, [a1, #(16*1)]
-        ldr    lr, =W57
-        smulbb v1, ip, a4
-        smultb v3, ip, a4
-        smulbb v5, lr, a4
-        smultb v7, lr, a4
-        smulbt v2, ip, a4
-        smultt v4, ip, a4
-        smulbt v6, lr, a4
-        smultt fp, lr, a4
-        rsb    v4, v4, #0
-        ldr    a4, [a1, #(16*3)]
-        rsb    v3, v3, #0
-
-        smlatb v1, ip, a4, v1
-        smlatb v3, lr, a4, v3
-        smulbb a3, ip, a4
-        smulbb a2, lr, a4
-        sub    v5, v5, a3
-        sub    v7, v7, a2
-        smlatt v2, ip, a4, v2
-        smlatt v4, lr, a4, v4
-        smulbt a3, ip, a4
-        smulbt a2, lr, a4
-        sub    v6, v6, a3
-        ldr    a4, [a1, #(16*5)]
-        sub    fp, fp, a2
-
-        smlabb v1, lr, a4, v1
-        smlabb v3, ip, a4, v3
-        smlatb v5, lr, a4, v5
-        smlatb v7, ip, a4, v7
-        smlabt v2, lr, a4, v2
-        smlabt v4, ip, a4, v4
-        smlatt v6, lr, a4, v6
-        ldr    a3, [a1, #(16*7)]
-        smlatt fp, ip, a4, fp
-
-        smlatb v1, lr, a3, v1
-        smlabb v3, lr, a3, v3
-        smlatb v5, ip, a3, v5
-        smulbb a4, ip, a3
-        smlatt v2, lr, a3, v2
-        sub    v7, v7, a4
-        smlabt v4, lr, a3, v4
-        smulbt a4, ip, a3
-        smlatt v6, ip, a3, v6
-        sub    fp, fp, a4
-        .endm
-
-function idct_col_armv5te
-        str    lr, [sp, #-4]!
-
-        idct_col
-
-        ldmfd  sp!, {a3, a4}
-        adds   a2, a3, v1
-        mov    a2, a2, lsr #20
-        it     mi
-        orrmi  a2, a2, #0xf000
-        add    ip, a4, v2
-        mov    ip, ip, asr #20
-        orr    a2, a2, ip, lsl #16
-        str    a2, [a1]
-        subs   a3, a3, v1
-        mov    a2, a3, lsr #20
-        it     mi
-        orrmi  a2, a2, #0xf000
-        sub    a4, a4, v2
-        mov    a4, a4, asr #20
-        orr    a2, a2, a4, lsl #16
-        ldmfd  sp!, {a3, a4}
-        str    a2, [a1, #(16*7)]
-
-        subs   a2, a3, v3
-        mov    a2, a2, lsr #20
-        it     mi
-        orrmi  a2, a2, #0xf000
-        sub    ip, a4, v4
-        mov    ip, ip, asr #20
-        orr    a2, a2, ip, lsl #16
-        str    a2, [a1, #(16*1)]
-        adds   a3, a3, v3
-        mov    a2, a3, lsr #20
-        it     mi
-        orrmi  a2, a2, #0xf000
-        add    a4, a4, v4
-        mov    a4, a4, asr #20
-        orr    a2, a2, a4, lsl #16
-        ldmfd  sp!, {a3, a4}
-        str    a2, [a1, #(16*6)]
-
-        adds   a2, a3, v5
-        mov    a2, a2, lsr #20
-        it     mi
-        orrmi  a2, a2, #0xf000
-        add    ip, a4, v6
-        mov    ip, ip, asr #20
-        orr    a2, a2, ip, lsl #16
-        str    a2, [a1, #(16*2)]
-        subs   a3, a3, v5
-        mov    a2, a3, lsr #20
-        it     mi
-        orrmi  a2, a2, #0xf000
-        sub    a4, a4, v6
-        mov    a4, a4, asr #20
-        orr    a2, a2, a4, lsl #16
-        ldmfd  sp!, {a3, a4}
-        str    a2, [a1, #(16*5)]
-
-        adds   a2, a3, v7
-        mov    a2, a2, lsr #20
-        it     mi
-        orrmi  a2, a2, #0xf000
-        add    ip, a4, fp
-        mov    ip, ip, asr #20
-        orr    a2, a2, ip, lsl #16
-        str    a2, [a1, #(16*3)]
-        subs   a3, a3, v7
-        mov    a2, a3, lsr #20
-        it     mi
-        orrmi  a2, a2, #0xf000
-        sub    a4, a4, fp
-        mov    a4, a4, asr #20
-        orr    a2, a2, a4, lsl #16
-        str    a2, [a1, #(16*4)]
-
-        ldr    pc, [sp], #4
-endfunc
-
-.macro  clip   dst, src:vararg
-        movs   \dst, \src
-        it     mi
-        movmi  \dst, #0
-        cmp    \dst, #255
-        it     gt
-        movgt  \dst, #255
-.endm
-
-.macro  aclip  dst, src:vararg
-        adds   \dst, \src
-        it     mi
-        movmi  \dst, #0
-        cmp    \dst, #255
-        it     gt
-        movgt  \dst, #255
-.endm
-
-function idct_col_put_armv5te
-        str    lr, [sp, #-4]!
-
-        idct_col
-
-        ldmfd  sp!, {a3, a4}
-        ldr    lr, [sp, #32]
-        add    a2, a3, v1
-        clip   a2, a2, asr #20
-        add    ip, a4, v2
-        clip   ip, ip, asr #20
-        orr    a2, a2, ip, lsl #8
-        sub    a3, a3, v1
-        clip   a3, a3, asr #20
-        sub    a4, a4, v2
-        clip   a4, a4, asr #20
-        ldr    v1, [sp, #28]
-        strh   a2, [v1]
-        add    a2, v1, #2
-        str    a2, [sp, #28]
-        orr    a2, a3, a4, lsl #8
-        rsb    v2, lr, lr, lsl #3
-        ldmfd  sp!, {a3, a4}
-        strh_pre a2, v2, v1
-
-        sub    a2, a3, v3
-        clip   a2, a2, asr #20
-        sub    ip, a4, v4
-        clip   ip, ip, asr #20
-        orr    a2, a2, ip, lsl #8
-        strh_pre a2, v1, lr
-        add    a3, a3, v3
-        clip   a2, a3, asr #20
-        add    a4, a4, v4
-        clip   a4, a4, asr #20
-        orr    a2, a2, a4, lsl #8
-        ldmfd  sp!, {a3, a4}
-        strh_dpre a2, v2, lr
-
-        add    a2, a3, v5
-        clip   a2, a2, asr #20
-        add    ip, a4, v6
-        clip   ip, ip, asr #20
-        orr    a2, a2, ip, lsl #8
-        strh_pre a2, v1, lr
-        sub    a3, a3, v5
-        clip   a2, a3, asr #20
-        sub    a4, a4, v6
-        clip   a4, a4, asr #20
-        orr    a2, a2, a4, lsl #8
-        ldmfd  sp!, {a3, a4}
-        strh_dpre a2, v2, lr
-
-        add    a2, a3, v7
-        clip   a2, a2, asr #20
-        add    ip, a4, fp
-        clip   ip, ip, asr #20
-        orr    a2, a2, ip, lsl #8
-        strh   a2, [v1, lr]
-        sub    a3, a3, v7
-        clip   a2, a3, asr #20
-        sub    a4, a4, fp
-        clip   a4, a4, asr #20
-        orr    a2, a2, a4, lsl #8
-        strh_dpre a2, v2, lr
-
-        ldr    pc, [sp], #4
-endfunc
-
-function idct_col_add_armv5te
-        str    lr, [sp, #-4]!
-
-        idct_col
-
-        ldr    lr, [sp, #36]
-
-        ldmfd  sp!, {a3, a4}
-        ldrh   ip, [lr]
-        add    a2, a3, v1
-        sub    a3, a3, v1
-        and    v1, ip, #255
-        aclip  a2, v1, a2, asr #20
-        add    v1, a4, v2
-        mov    v1, v1, asr #20
-        aclip  v1, v1, ip, lsr #8
-        orr    a2, a2, v1, lsl #8
-        ldr    v1, [sp, #32]
-        sub    a4, a4, v2
-        rsb    v2, v1, v1, lsl #3
-        ldrh_pre ip, v2, lr
-        strh   a2, [lr]
-        and    a2, ip, #255
-        aclip  a3, a2, a3, asr #20
-        mov    a4, a4, asr #20
-        aclip  a4, a4, ip, lsr #8
-        add    a2, lr, #2
-        str    a2, [sp, #28]
-        orr    a2, a3, a4, lsl #8
-        strh   a2, [v2]
-
-        ldmfd  sp!, {a3, a4}
-        ldrh_pre ip, lr, v1
-        sub    a2, a3, v3
-        add    a3, a3, v3
-        and    v3, ip, #255
-        aclip  a2, v3, a2, asr #20
-        sub    v3, a4, v4
-        mov    v3, v3, asr #20
-        aclip  v3, v3, ip, lsr #8
-        orr    a2, a2, v3, lsl #8
-        add    a4, a4, v4
-        ldrh_dpre ip, v2, v1
-        strh   a2, [lr]
-        and    a2, ip, #255
-        aclip  a3, a2, a3, asr #20
-        mov    a4, a4, asr #20
-        aclip  a4, a4, ip, lsr #8
-        orr    a2, a3, a4, lsl #8
-        strh   a2, [v2]
-
-        ldmfd  sp!, {a3, a4}
-        ldrh_pre ip, lr, v1
-        add    a2, a3, v5
-        sub    a3, a3, v5
-        and    v3, ip, #255
-        aclip  a2, v3, a2, asr #20
-        add    v3, a4, v6
-        mov    v3, v3, asr #20
-        aclip  v3, v3, ip, lsr #8
-        orr    a2, a2, v3, lsl #8
-        sub    a4, a4, v6
-        ldrh_dpre ip, v2, v1
-        strh   a2, [lr]
-        and    a2, ip, #255
-        aclip  a3, a2, a3, asr #20
-        mov    a4, a4, asr #20
-        aclip  a4, a4, ip, lsr #8
-        orr    a2, a3, a4, lsl #8
-        strh   a2, [v2]
-
-        ldmfd  sp!, {a3, a4}
-        ldrh_pre ip, lr, v1
-        add    a2, a3, v7
-        sub    a3, a3, v7
-        and    v3, ip, #255
-        aclip  a2, v3, a2, asr #20
-        add    v3, a4, fp
-        mov    v3, v3, asr #20
-        aclip  v3, v3, ip, lsr #8
-        orr    a2, a2, v3, lsl #8
-        sub    a4, a4, fp
-        ldrh_dpre ip, v2, v1
-        strh   a2, [lr]
-        and    a2, ip, #255
-        aclip  a3, a2, a3, asr #20
-        mov    a4, a4, asr #20
-        aclip  a4, a4, ip, lsr #8
-        orr    a2, a3, a4, lsl #8
-        strh   a2, [v2]
-
-        ldr    pc, [sp], #4
-endfunc
-
-function ff_simple_idct_armv5te, export=1
-        stmfd  sp!, {v1, v2, v3, v4, v5, v6, v7, fp, lr}
-
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-
-        sub    a1, a1, #(16*7)
-
-        bl     idct_col_armv5te
-        add    a1, a1, #4
-        bl     idct_col_armv5te
-        add    a1, a1, #4
-        bl     idct_col_armv5te
-        add    a1, a1, #4
-        bl     idct_col_armv5te
-
-        ldmfd  sp!, {v1, v2, v3, v4, v5, v6, v7, fp, pc}
-endfunc
-
-function ff_simple_idct_add_armv5te, export=1
-        stmfd  sp!, {a1, a2, v1, v2, v3, v4, v5, v6, v7, fp, lr}
-
-        mov    a1, a3
-
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-
-        sub    a1, a1, #(16*7)
-
-        bl     idct_col_add_armv5te
-        add    a1, a1, #4
-        bl     idct_col_add_armv5te
-        add    a1, a1, #4
-        bl     idct_col_add_armv5te
-        add    a1, a1, #4
-        bl     idct_col_add_armv5te
-
-        add    sp, sp, #8
-        ldmfd  sp!, {v1, v2, v3, v4, v5, v6, v7, fp, pc}
-endfunc
-
-function ff_simple_idct_put_armv5te, export=1
-        stmfd  sp!, {a1, a2, v1, v2, v3, v4, v5, v6, v7, fp, lr}
-
-        mov    a1, a3
-
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-        add    a1, a1, #16
-        bl     idct_row_armv5te
-
-        sub    a1, a1, #(16*7)
-
-        bl     idct_col_put_armv5te
-        add    a1, a1, #4
-        bl     idct_col_put_armv5te
-        add    a1, a1, #4
-        bl     idct_col_put_armv5te
-        add    a1, a1, #4
-        bl     idct_col_put_armv5te
-
-        add    sp, sp, #8
-        ldmfd  sp!, {v1, v2, v3, v4, v5, v6, v7, fp, pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/simple_idct_armv6.S b/deps/libav/libavcodec/arm/simple_idct_armv6.S
deleted file mode 100644
index 6072346..0000000
--- a/deps/libav/libavcodec/arm/simple_idct_armv6.S
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * Simple IDCT
- *
- * Copyright (c) 2001 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2007 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-#define W1  22725   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W2  21407   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W3  19266   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W4  16383   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W5  12873   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W6  8867    /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W7  4520    /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define ROW_SHIFT 11
-#define COL_SHIFT 20
-
-#define W13 (W1 | (W3 << 16))
-#define W26 (W2 | (W6 << 16))
-#define W42 (W4 | (W2 << 16))
-#define W42n (-W4&0xffff | (-W2 << 16))
-#define W46 (W4 | (W6 << 16))
-#define W57 (W5 | (W7 << 16))
-
-/*
-  Compute partial IDCT of single row.
-  shift = left-shift amount
-  r0 = source address
-  r2 = row[2,0] <= 2 cycles
-  r3 = row[3,1]
-  ip = w42      <= 2 cycles
-
-  Output in registers r4--r11
-*/
-        .macro idct_row shift
-        ldr    lr, =W46              /* lr  = W4 | (W6 << 16) */
-        mov    r1, #(1<<(\shift-1))
-        smlad  r4, r2, ip, r1
-        smlsd  r7, r2, ip, r1
-        ldr    ip, =W13              /* ip  = W1 | (W3 << 16) */
-        ldr    r10,=W57              /* r10 = W5 | (W7 << 16) */
-        smlad  r5, r2, lr, r1
-        smlsd  r6, r2, lr, r1
-
-        smuad  r8, r3, ip            /* r8  =  B0 = W1*row[1] + W3*row[3] */
-        smusdx r11,r3, r10           /* r11 =  B3 = W7*row[1] - W5*row[3] */
-        ldr    lr, [r0, #12]         /* lr  =  row[7,5] */
-        pkhtb  r2, ip, r10,asr #16   /* r3  =  W7 | (W3 << 16) */
-        pkhbt  r1, ip, r10,lsl #16   /* r1  =  W1 | (W5 << 16) */
-        smusdx r9, r2, r3            /* r9  = -B1 = W7*row[3] - W3*row[1] */
-        smlad  r8, lr, r10,r8        /* B0  +=      W5*row[5] + W7*row[7] */
-        smusdx r10,r3, r1            /* r10 =  B2 = W5*row[1] - W1*row[3] */
-
-        ldr    r3, =W42n             /* r3 =  -W4 | (-W2 << 16) */
-        smlad  r10,lr, r2, r10       /* B2 +=  W7*row[5] + W3*row[7] */
-        ldr    r2, [r0, #4]          /* r2 =   row[6,4] */
-        smlsdx r11,lr, ip, r11       /* B3 +=  W3*row[5] - W1*row[7] */
-        ldr    ip, =W46              /* ip =   W4 | (W6 << 16) */
-        smlad  r9, lr, r1, r9        /* B1 -=  W1*row[5] + W5*row[7] */
-
-        smlad  r5, r2, r3, r5        /* A1 += -W4*row[4] - W2*row[6] */
-        smlsd  r6, r2, r3, r6        /* A2 += -W4*row[4] + W2*row[6] */
-        smlad  r4, r2, ip, r4        /* A0 +=  W4*row[4] + W6*row[6] */
-        smlsd  r7, r2, ip, r7        /* A3 +=  W4*row[4] - W6*row[6] */
-        .endm
-
-/*
-  Compute partial IDCT of half row.
-  shift = left-shift amount
-  r2 = row[2,0]
-  r3 = row[3,1]
-  ip = w42
-
-  Output in registers r4--r11
-*/
-        .macro idct_row4 shift
-        ldr    lr, =W46              /* lr =  W4 | (W6 << 16) */
-        ldr    r10,=W57              /* r10 = W5 | (W7 << 16) */
-        mov    r1, #(1<<(\shift-1))
-        smlad  r4, r2, ip, r1
-        smlsd  r7, r2, ip, r1
-        ldr    ip, =W13              /* ip =  W1 | (W3 << 16) */
-        smlad  r5, r2, lr, r1
-        smlsd  r6, r2, lr, r1
-        smusdx r11,r3, r10           /* r11 =  B3 = W7*row[1] - W5*row[3] */
-        smuad  r8, r3, ip            /* r8  =  B0 = W1*row[1] + W3*row[3] */
-        pkhtb  r2, ip, r10,asr #16   /* r3  =  W7 | (W3 << 16) */
-        pkhbt  r1, ip, r10,lsl #16   /* r1  =  W1 | (W5 << 16) */
-        smusdx r9, r2, r3            /* r9  = -B1 = W7*row[3] - W3*row[1] */
-        smusdx r10,r3, r1            /* r10 =  B2 = W5*row[1] - W1*row[3] */
-        .endm
-
-/*
-  Compute final part of IDCT single row without shift.
-  Input in registers r4--r11
-  Output in registers ip, r4--r6, lr, r8--r10
-*/
-        .macro idct_finish
-        add    ip, r4, r8            /* r1 = A0 + B0 */
-        sub    lr, r4, r8            /* r2 = A0 - B0 */
-        sub    r4, r5, r9            /* r2 = A1 + B1 */
-        add    r8, r5, r9            /* r2 = A1 - B1 */
-        add    r5, r6, r10           /* r1 = A2 + B2 */
-        sub    r9, r6, r10           /* r1 = A2 - B2 */
-        add    r6, r7, r11           /* r2 = A3 + B3 */
-        sub    r10,r7, r11           /* r2 = A3 - B3 */
-        .endm
-
-/*
-  Compute final part of IDCT single row.
-  shift = right-shift amount
-  Input/output in registers r4--r11
-*/
-        .macro idct_finish_shift shift
-        add    r3, r4, r8            /* r3 = A0 + B0 */
-        sub    r2, r4, r8            /* r2 = A0 - B0 */
-        mov    r4, r3, asr #\shift
-        mov    r8, r2, asr #\shift
-
-        sub    r3, r5, r9            /* r3 = A1 + B1 */
-        add    r2, r5, r9            /* r2 = A1 - B1 */
-        mov    r5, r3, asr #\shift
-        mov    r9, r2, asr #\shift
-
-        add    r3, r6, r10           /* r3 = A2 + B2 */
-        sub    r2, r6, r10           /* r2 = A2 - B2 */
-        mov    r6, r3, asr #\shift
-        mov    r10,r2, asr #\shift
-
-        add    r3, r7, r11           /* r3 = A3 + B3 */
-        sub    r2, r7, r11           /* r2 = A3 - B3 */
-        mov    r7, r3, asr #\shift
-        mov    r11,r2, asr #\shift
-        .endm
-
-/*
-  Compute final part of IDCT single row, saturating results at 8 bits.
-  shift = right-shift amount
-  Input/output in registers r4--r11
-*/
-        .macro idct_finish_shift_sat shift
-        add    r3, r4, r8            /* r3 = A0 + B0 */
-        sub    ip, r4, r8            /* ip = A0 - B0 */
-        usat   r4, #8, r3, asr #\shift
-        usat   r8, #8, ip, asr #\shift
-
-        sub    r3, r5, r9            /* r3 = A1 + B1 */
-        add    ip, r5, r9            /* ip = A1 - B1 */
-        usat   r5, #8, r3, asr #\shift
-        usat   r9, #8, ip, asr #\shift
-
-        add    r3, r6, r10           /* r3 = A2 + B2 */
-        sub    ip, r6, r10           /* ip = A2 - B2 */
-        usat   r6, #8, r3, asr #\shift
-        usat   r10,#8, ip, asr #\shift
-
-        add    r3, r7, r11           /* r3 = A3 + B3 */
-        sub    ip, r7, r11           /* ip = A3 - B3 */
-        usat   r7, #8, r3, asr #\shift
-        usat   r11,#8, ip, asr #\shift
-        .endm
-
-/*
-  Compute IDCT of single row, storing as column.
-  r0 = source
-  r1 = dest
-*/
-function idct_row_armv6
-        push   {lr}
-
-        ldr    lr, [r0, #12]         /* lr = row[7,5] */
-        ldr    ip, [r0, #4]          /* ip = row[6,4] */
-        ldr    r3, [r0, #8]          /* r3 = row[3,1] */
-        ldr    r2, [r0]              /* r2 = row[2,0] */
-        orrs   lr, lr, ip
-        itt    eq
-        cmpeq  lr, r3
-        cmpeq  lr, r2, lsr #16
-        beq    1f
-        push   {r1}
-        ldr    ip, =W42              /* ip = W4 | (W2 << 16) */
-        cmp    lr, #0
-        beq    2f
-
-        idct_row   ROW_SHIFT
-        b      3f
-
-2:      idct_row4  ROW_SHIFT
-
-3:      pop    {r1}
-        idct_finish_shift ROW_SHIFT
-
-        strh   r4, [r1]
-        strh   r5, [r1, #(16*2)]
-        strh   r6, [r1, #(16*4)]
-        strh   r7, [r1, #(16*6)]
-        strh   r11,[r1, #(16*1)]
-        strh   r10,[r1, #(16*3)]
-        strh   r9, [r1, #(16*5)]
-        strh   r8, [r1, #(16*7)]
-
-        pop    {pc}
-
-1:      mov    r2, r2, lsl #3
-        strh   r2, [r1]
-        strh   r2, [r1, #(16*2)]
-        strh   r2, [r1, #(16*4)]
-        strh   r2, [r1, #(16*6)]
-        strh   r2, [r1, #(16*1)]
-        strh   r2, [r1, #(16*3)]
-        strh   r2, [r1, #(16*5)]
-        strh   r2, [r1, #(16*7)]
-        pop    {pc}
-endfunc
-
-/*
-  Compute IDCT of single column, read as row.
-  r0 = source
-  r1 = dest
-*/
-function idct_col_armv6
-        push   {r1, lr}
-
-        ldr    r2, [r0]              /* r2 = row[2,0] */
-        ldr    ip, =W42              /* ip = W4 | (W2 << 16) */
-        ldr    r3, [r0, #8]          /* r3 = row[3,1] */
-        idct_row COL_SHIFT
-        pop    {r1}
-        idct_finish_shift COL_SHIFT
-
-        strh   r4, [r1]
-        strh   r5, [r1, #(16*1)]
-        strh   r6, [r1, #(16*2)]
-        strh   r7, [r1, #(16*3)]
-        strh   r11,[r1, #(16*4)]
-        strh   r10,[r1, #(16*5)]
-        strh   r9, [r1, #(16*6)]
-        strh   r8, [r1, #(16*7)]
-
-        pop    {pc}
-endfunc
-
-/*
-  Compute IDCT of single column, read as row, store saturated 8-bit.
-  r0 = source
-  r1 = dest
-  r2 = line size
-*/
-function idct_col_put_armv6
-        push   {r1, r2, lr}
-
-        ldr    r2, [r0]              /* r2 = row[2,0] */
-        ldr    ip, =W42              /* ip = W4 | (W2 << 16) */
-        ldr    r3, [r0, #8]          /* r3 = row[3,1] */
-        idct_row COL_SHIFT
-        pop    {r1, r2}
-        idct_finish_shift_sat COL_SHIFT
-
-        strb_post r4, r1, r2
-        strb_post r5, r1, r2
-        strb_post r6, r1, r2
-        strb_post r7, r1, r2
-        strb_post r11,r1, r2
-        strb_post r10,r1, r2
-        strb_post r9, r1, r2
-        strb_post r8, r1, r2
-
-        sub    r1, r1, r2, lsl #3
-
-        pop    {pc}
-endfunc
-
-/*
-  Compute IDCT of single column, read as row, add/store saturated 8-bit.
-  r0 = source
-  r1 = dest
-  r2 = line size
-*/
-function idct_col_add_armv6
-        push   {r1, r2, lr}
-
-        ldr    r2, [r0]              /* r2 = row[2,0] */
-        ldr    ip, =W42              /* ip = W4 | (W2 << 16) */
-        ldr    r3, [r0, #8]          /* r3 = row[3,1] */
-        idct_row COL_SHIFT
-        pop    {r1, r2}
-        idct_finish
-
-        ldrb   r3, [r1]
-        ldrb   r7, [r1, r2]
-        ldrb   r11,[r1, r2, lsl #2]
-        add    ip, r3, ip, asr #COL_SHIFT
-        usat   ip, #8, ip
-        add    r4, r7, r4, asr #COL_SHIFT
-        strb_post ip, r1, r2
-        ldrb   ip, [r1, r2]
-        usat   r4, #8, r4
-        ldrb   r11,[r1, r2, lsl #2]
-        add    r5, ip, r5, asr #COL_SHIFT
-        usat   r5, #8, r5
-        strb_post r4, r1, r2
-        ldrb   r3, [r1, r2]
-        ldrb   ip, [r1, r2, lsl #2]
-        strb_post r5, r1, r2
-        ldrb   r7, [r1, r2]
-        ldrb   r4, [r1, r2, lsl #2]
-        add    r6, r3, r6, asr #COL_SHIFT
-        usat   r6, #8, r6
-        add    r10,r7, r10,asr #COL_SHIFT
-        usat   r10,#8, r10
-        add    r9, r11,r9, asr #COL_SHIFT
-        usat   r9, #8, r9
-        add    r8, ip, r8, asr #COL_SHIFT
-        usat   r8, #8, r8
-        add    lr, r4, lr, asr #COL_SHIFT
-        usat   lr, #8, lr
-        strb_post r6, r1, r2
-        strb_post r10,r1, r2
-        strb_post r9, r1, r2
-        strb_post r8, r1, r2
-        strb_post lr, r1, r2
-
-        sub    r1, r1, r2, lsl #3
-
-        pop    {pc}
-endfunc
-
-/*
-  Compute 8 IDCT row transforms.
-  func = IDCT row->col function
-  width = width of columns in bytes
-*/
-        .macro idct_rows func width
-        bl     \func
-        add    r0, r0, #(16*2)
-        add    r1, r1, #\width
-        bl     \func
-        add    r0, r0, #(16*2)
-        add    r1, r1, #\width
-        bl     \func
-        add    r0, r0, #(16*2)
-        add    r1, r1, #\width
-        bl     \func
-        sub    r0, r0, #(16*5)
-        add    r1, r1, #\width
-        bl     \func
-        add    r0, r0, #(16*2)
-        add    r1, r1, #\width
-        bl     \func
-        add    r0, r0, #(16*2)
-        add    r1, r1, #\width
-        bl     \func
-        add    r0, r0, #(16*2)
-        add    r1, r1, #\width
-        bl     \func
-
-        sub    r0, r0, #(16*7)
-        .endm
-
-/* void ff_simple_idct_armv6(int16_t *data); */
-function ff_simple_idct_armv6, export=1
-        push   {r4-r11, lr}
-        sub    sp, sp, #128
-
-        mov    r1, sp
-        idct_rows idct_row_armv6, 2
-        mov    r1, r0
-        mov    r0, sp
-        idct_rows idct_col_armv6, 2
-
-        add    sp, sp, #128
-        pop    {r4-r11, pc}
-endfunc
-
-/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); */
-function ff_simple_idct_add_armv6, export=1
-        push   {r0, r1, r4-r11, lr}
-        sub    sp, sp, #128
-
-        mov    r0, r2
-        mov    r1, sp
-        idct_rows idct_row_armv6, 2
-        mov    r0, sp
-        ldr    r1, [sp, #128]
-        ldr    r2, [sp, #(128+4)]
-        idct_rows idct_col_add_armv6, 1
-
-        add    sp, sp, #(128+8)
-        pop    {r4-r11, pc}
-endfunc
-
-/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); */
-function ff_simple_idct_put_armv6, export=1
-        push   {r0, r1, r4-r11, lr}
-        sub    sp, sp, #128
-
-        mov    r0, r2
-        mov    r1, sp
-        idct_rows idct_row_armv6, 2
-        mov    r0, sp
-        ldr    r1, [sp, #128]
-        ldr    r2, [sp, #(128+4)]
-        idct_rows idct_col_put_armv6, 1
-
-        add    sp, sp, #(128+8)
-        pop    {r4-r11, pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/simple_idct_neon.S b/deps/libav/libavcodec/arm/simple_idct_neon.S
deleted file mode 100644
index a1cde8d..0000000
--- a/deps/libav/libavcodec/arm/simple_idct_neon.S
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * ARM NEON IDCT
- *
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * Based on Simple IDCT
- * Copyright (c) 2001 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-#define W1  22725  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W2  21407  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W3  19266  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W4  16383  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W5  12873  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W6  8867   //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W7  4520   //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W4c ((1<<(COL_SHIFT-1))/W4)
-#define ROW_SHIFT 11
-#define COL_SHIFT 20
-
-#define w1 d0[0]
-#define w2 d0[1]
-#define w3 d0[2]
-#define w4 d0[3]
-#define w5 d1[0]
-#define w6 d1[1]
-#define w7 d1[2]
-#define w4c d1[3]
-
-        .macro idct_col4_top
-        vmull.s16       q7,  d6,  w2    /* q9   = W2 * col[2] */
-        vmull.s16       q8,  d6,  w6    /* q10  = W6 * col[2] */
-        vmull.s16       q9,  d4,  w1    /* q9   = W1 * col[1] */
-        vadd.i32        q11, q15, q7
-        vmull.s16       q10, d4,  w3    /* q10  = W3 * col[1] */
-        vadd.i32        q12, q15, q8
-        vmull.s16       q5,  d4,  w5    /* q5   = W5 * col[1] */
-        vsub.i32        q13, q15, q8
-        vmull.s16       q6,  d4,  w7    /* q6   = W7 * col[1] */
-        vsub.i32        q14, q15, q7
-
-        vmlal.s16       q9,  d8,  w3    /* q9  += W3 * col[3] */
-        vmlsl.s16       q10, d8,  w7    /* q10 -= W7 * col[3] */
-        vmlsl.s16       q5,  d8,  w1    /* q5  -= W1 * col[3] */
-        vmlsl.s16       q6,  d8,  w5    /* q6  -= W5 * col[3] */
-        .endm
-
-        .text
-        .align 6
-
-function idct_row4_pld_neon
-        pld             [r0]
-        add             r3,  r0,  r1,  lsl #2
-        pld             [r0, r1]
-        pld             [r0, r1, lsl #1]
-A       pld             [r3, -r1]
-        pld             [r3]
-        pld             [r3, r1]
-        add             r3,  r3,  r1,  lsl #1
-        pld             [r3]
-        pld             [r3, r1]
-endfunc
-
-function idct_row4_neon
-        vmov.i32        q15, #(1<<(ROW_SHIFT-1))
-        vld1.64         {d2-d5},  [r2,:128]!
-        vmlal.s16       q15, d2,  w4    /* q15  += W4 * col[0] */
-        vld1.64         {d6,d7},  [r2,:128]!
-        vorr            d10, d3,  d5
-        vld1.64         {d8,d9},  [r2,:128]!
-        add             r2,  r2,  #-64
-
-        vorr            d11, d7,  d9
-        vorr            d10, d10, d11
-        vmov            r3,  r4,  d10
-
-        idct_col4_top
-
-        orrs            r3,  r3,  r4
-        beq             1f
-
-        vmull.s16       q7,  d3,  w4    /* q7   = W4 * col[4] */
-        vmlal.s16       q9,  d5,  w5    /* q9  += W5 * col[5] */
-        vmlsl.s16       q10, d5,  w1    /* q10 -= W1 * col[5] */
-        vmull.s16       q8,  d7,  w2    /* q8   = W2 * col[6] */
-        vmlal.s16       q5,  d5,  w7    /* q5  += W7 * col[5] */
-        vadd.i32        q11, q11, q7
-        vsub.i32        q12, q12, q7
-        vsub.i32        q13, q13, q7
-        vadd.i32        q14, q14, q7
-        vmlal.s16       q6,  d5,  w3    /* q6  += W3 * col[5] */
-        vmull.s16       q7,  d7,  w6    /* q7   = W6 * col[6] */
-        vmlal.s16       q9,  d9,  w7
-        vmlsl.s16       q10, d9,  w5
-        vmlal.s16       q5,  d9,  w3
-        vmlsl.s16       q6,  d9,  w1
-        vadd.i32        q11, q11, q7
-        vsub.i32        q12, q12, q8
-        vadd.i32        q13, q13, q8
-        vsub.i32        q14, q14, q7
-
-1:      vadd.i32        q3,  q11, q9
-        vadd.i32        q4,  q12, q10
-        vshrn.i32       d2,  q3,  #ROW_SHIFT
-        vshrn.i32       d4,  q4,  #ROW_SHIFT
-        vadd.i32        q7,  q13, q5
-        vadd.i32        q8,  q14, q6
-        vtrn.16         d2,  d4
-        vshrn.i32       d6,  q7,  #ROW_SHIFT
-        vshrn.i32       d8,  q8,  #ROW_SHIFT
-        vsub.i32        q14, q14, q6
-        vsub.i32        q11, q11, q9
-        vtrn.16         d6,  d8
-        vsub.i32        q13, q13, q5
-        vshrn.i32       d3,  q14, #ROW_SHIFT
-        vtrn.32         d2,  d6
-        vsub.i32        q12, q12, q10
-        vtrn.32         d4,  d8
-        vshrn.i32       d5,  q13, #ROW_SHIFT
-        vshrn.i32       d7,  q12, #ROW_SHIFT
-        vshrn.i32       d9,  q11, #ROW_SHIFT
-
-        vtrn.16         d3,  d5
-        vtrn.16         d7,  d9
-        vtrn.32         d3,  d7
-        vtrn.32         d5,  d9
-
-        vst1.64         {d2-d5},  [r2,:128]!
-        vst1.64         {d6-d9},  [r2,:128]!
-
-        bx              lr
-endfunc
-
-function idct_col4_neon
-        mov             ip,  #16
-        vld1.64         {d2}, [r2,:64], ip /* d2 = col[0] */
-        vdup.16         d30, w4c
-        vld1.64         {d4}, [r2,:64], ip /* d3 = col[1] */
-        vadd.i16        d30, d30, d2
-        vld1.64         {d6}, [r2,:64], ip /* d4 = col[2] */
-        vmull.s16       q15, d30, w4 /* q15 = W4*(col[0]+(1<<COL_SHIFT-1)/W4)*/
-        vld1.64         {d8}, [r2,:64], ip /* d5 = col[3] */
-
-        ldrd            r4,  r5,  [r2]
-        ldrd            r6,  r7,  [r2, #16]
-        orrs            r4,  r4,  r5
-
-        idct_col4_top
-        it              eq
-        addeq           r2,  r2,  #16
-        beq             1f
-
-        vld1.64         {d3}, [r2,:64], ip /* d6 = col[4] */
-        vmull.s16       q7,  d3,  w4    /* q7   = W4 * col[4] */
-        vadd.i32        q11, q11, q7
-        vsub.i32        q12, q12, q7
-        vsub.i32        q13, q13, q7
-        vadd.i32        q14, q14, q7
-
-1:      orrs            r6,  r6,  r7
-        ldrd            r4,  r5,  [r2, #16]
-        it              eq
-        addeq           r2,  r2,  #16
-        beq             2f
-
-        vld1.64         {d5}, [r2,:64], ip /* d7 = col[5] */
-        vmlal.s16       q9,  d5,  w5    /* q9  += W5 * col[5] */
-        vmlsl.s16       q10, d5,  w1    /* q10 -= W1 * col[5] */
-        vmlal.s16       q5,  d5,  w7    /* q5  += W7 * col[5] */
-        vmlal.s16       q6,  d5,  w3    /* q6  += W3 * col[5] */
-
-2:      orrs            r4,  r4,  r5
-        ldrd            r4,  r5,  [r2, #16]
-        it              eq
-        addeq           r2,  r2,  #16
-        beq             3f
-
-        vld1.64         {d7}, [r2,:64], ip /* d8 = col[6] */
-        vmull.s16       q7,  d7,  w6    /* q7   = W6 * col[6] */
-        vmull.s16       q8,  d7,  w2    /* q8   = W2 * col[6] */
-        vadd.i32        q11, q11, q7
-        vsub.i32        q14, q14, q7
-        vsub.i32        q12, q12, q8
-        vadd.i32        q13, q13, q8
-
-3:      orrs            r4,  r4,  r5
-        it              eq
-        addeq           r2,  r2,  #16
-        beq             4f
-
-        vld1.64         {d9}, [r2,:64], ip /* d9 = col[7] */
-        vmlal.s16       q9,  d9,  w7
-        vmlsl.s16       q10, d9,  w5
-        vmlal.s16       q5,  d9,  w3
-        vmlsl.s16       q6,  d9,  w1
-
-4:      vaddhn.i32      d2,  q11, q9
-        vaddhn.i32      d3,  q12, q10
-        vaddhn.i32      d4,  q13, q5
-        vaddhn.i32      d5,  q14, q6
-        vsubhn.i32      d9,  q11, q9
-        vsubhn.i32      d8,  q12, q10
-        vsubhn.i32      d7,  q13, q5
-        vsubhn.i32      d6,  q14, q6
-
-        bx              lr
-endfunc
-
-        .align 6
-
-function idct_col4_st8_neon
-        vqshrun.s16     d2,  q1,  #COL_SHIFT-16
-        vqshrun.s16     d3,  q2,  #COL_SHIFT-16
-        vqshrun.s16     d4,  q3,  #COL_SHIFT-16
-        vqshrun.s16     d5,  q4,  #COL_SHIFT-16
-        vst1.32         {d2[0]}, [r0,:32], r1
-        vst1.32         {d2[1]}, [r0,:32], r1
-        vst1.32         {d3[0]}, [r0,:32], r1
-        vst1.32         {d3[1]}, [r0,:32], r1
-        vst1.32         {d4[0]}, [r0,:32], r1
-        vst1.32         {d4[1]}, [r0,:32], r1
-        vst1.32         {d5[0]}, [r0,:32], r1
-        vst1.32         {d5[1]}, [r0,:32], r1
-
-        bx              lr
-endfunc
-
-const   idct_coeff_neon, align=4
-        .short W1, W2, W3, W4, W5, W6, W7, W4c
-endconst
-
-        .macro idct_start data
-        push            {r4-r7, lr}
-        pld             [\data]
-        pld             [\data, #64]
-        vpush           {d8-d15}
-        movrel          r3,  idct_coeff_neon
-        vld1.64         {d0,d1}, [r3,:128]
-        .endm
-
-        .macro idct_end
-        vpop            {d8-d15}
-        pop             {r4-r7, pc}
-        .endm
-
-/* void ff_simple_idct_put_neon(uint8_t *dst, int line_size, int16_t *data); */
-function ff_simple_idct_put_neon, export=1
-        idct_start      r2
-
-        bl              idct_row4_pld_neon
-        bl              idct_row4_neon
-        add             r2,  r2,  #-128
-        bl              idct_col4_neon
-        bl              idct_col4_st8_neon
-        sub             r0,  r0,  r1, lsl #3
-        add             r0,  r0,  #4
-        add             r2,  r2,  #-120
-        bl              idct_col4_neon
-        bl              idct_col4_st8_neon
-
-        idct_end
-endfunc
-
-        .align 6
-
-function idct_col4_add8_neon
-        mov             ip,  r0
-
-        vld1.32         {d10[0]}, [r0,:32], r1
-        vshr.s16        q1,  q1,  #COL_SHIFT-16
-        vld1.32         {d10[1]}, [r0,:32], r1
-        vshr.s16        q2,  q2,  #COL_SHIFT-16
-        vld1.32         {d11[0]}, [r0,:32], r1
-        vshr.s16        q3,  q3,  #COL_SHIFT-16
-        vld1.32         {d11[1]}, [r0,:32], r1
-        vshr.s16        q4,  q4,  #COL_SHIFT-16
-        vld1.32         {d12[0]}, [r0,:32], r1
-        vaddw.u8        q1,  q1,  d10
-        vld1.32         {d12[1]}, [r0,:32], r1
-        vaddw.u8        q2,  q2,  d11
-        vld1.32         {d13[0]}, [r0,:32], r1
-        vqmovun.s16     d2,  q1
-        vld1.32         {d13[1]}, [r0,:32], r1
-        vaddw.u8        q3,  q3,  d12
-        vst1.32         {d2[0]},  [ip,:32], r1
-        vqmovun.s16     d3,  q2
-        vst1.32         {d2[1]},  [ip,:32], r1
-        vaddw.u8        q4,  q4,  d13
-        vst1.32         {d3[0]},  [ip,:32], r1
-        vqmovun.s16     d4,  q3
-        vst1.32         {d3[1]},  [ip,:32], r1
-        vqmovun.s16     d5,  q4
-        vst1.32         {d4[0]},  [ip,:32], r1
-        vst1.32         {d4[1]},  [ip,:32], r1
-        vst1.32         {d5[0]},  [ip,:32], r1
-        vst1.32         {d5[1]},  [ip,:32], r1
-
-        bx              lr
-endfunc
-
-/* void ff_simple_idct_add_neon(uint8_t *dst, int line_size, int16_t *data); */
-function ff_simple_idct_add_neon, export=1
-        idct_start      r2
-
-        bl              idct_row4_pld_neon
-        bl              idct_row4_neon
-        add             r2,  r2,  #-128
-        bl              idct_col4_neon
-        bl              idct_col4_add8_neon
-        sub             r0,  r0,  r1, lsl #3
-        add             r0,  r0,  #4
-        add             r2,  r2,  #-120
-        bl              idct_col4_neon
-        bl              idct_col4_add8_neon
-
-        idct_end
-endfunc
-
-        .align 6
-
-function idct_col4_st16_neon
-        mov             ip,  #16
-
-        vshr.s16        q1,  q1,  #COL_SHIFT-16
-        vshr.s16        q2,  q2,  #COL_SHIFT-16
-        vst1.64         {d2}, [r2,:64], ip
-        vshr.s16        q3,  q3,  #COL_SHIFT-16
-        vst1.64         {d3}, [r2,:64], ip
-        vshr.s16        q4,  q4,  #COL_SHIFT-16
-        vst1.64         {d4}, [r2,:64], ip
-        vst1.64         {d5}, [r2,:64], ip
-        vst1.64         {d6}, [r2,:64], ip
-        vst1.64         {d7}, [r2,:64], ip
-        vst1.64         {d8}, [r2,:64], ip
-        vst1.64         {d9}, [r2,:64], ip
-
-        bx              lr
-endfunc
-
-/* void ff_simple_idct_neon(int16_t *data); */
-function ff_simple_idct_neon, export=1
-        idct_start      r0
-
-        mov             r2,  r0
-        bl              idct_row4_neon
-        bl              idct_row4_neon
-        add             r2,  r2,  #-128
-        bl              idct_col4_neon
-        add             r2,  r2,  #-128
-        bl              idct_col4_st16_neon
-        add             r2,  r2,  #-120
-        bl              idct_col4_neon
-        add             r2,  r2,  #-128
-        bl              idct_col4_st16_neon
-
-        idct_end
-endfunc
diff --git a/deps/libav/libavcodec/arm/synth_filter_neon.S b/deps/libav/libavcodec/arm/synth_filter_neon.S
deleted file mode 100644
index 62bb667..0000000
--- a/deps/libav/libavcodec/arm/synth_filter_neon.S
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_synth_filter_float_neon, export=1
-        push            {r3-r11,lr}
-
-        ldr             r4,  [r2]               @ synth_buf_offset
-        add             r1,  r1,  r4,  lsl #2   @ synth_buf
-        sub             r12, r4,  #32
-        bfc             r12, #9,  #23
-        bic             r4,  r4,  #63
-        str             r12, [r2]
-
-        ldr             r2,  [sp, #12*4]        @ in
-        mov             r9,  r1                 @ synth_buf
-
-VFP     vpush           {d0}
-        bl              X(ff_imdct_half_neon)
-VFP     vpop            {d0}
-        pop             {r3}
-
-        ldr             r5,  [sp, #9*4]         @ window
-        ldr             r2,  [sp, #10*4]        @ out
-NOVFP   vldr            s0,  [sp, #12*4]        @ scale
-        add             r8,  r9,  #12*4
-
-        mov             lr,  #64*4
-        mov             r1,  #4
-1:
-        add             r10, r9,  #16*4         @ synth_buf
-        add             r11, r8,  #16*4
-        add             r0,  r5,  #16*4         @ window
-        add             r6,  r5,  #32*4
-        add             r7,  r5,  #48*4
-
-        vld1.32         {q10},    [r3,:128]     @ a
-        add             r3,  r3,  #16*4
-        vld1.32         {q1},     [r3,:128]     @ b
-        vmov.f32        q2,  #0.0               @ c
-        vmov.f32        q3,  #0.0               @ d
-
-        mov             r12, #512
-2:
-        vld1.32         {q9},     [r8, :128], lr
-        vrev64.32       q9,  q9
-        vld1.32         {q8},     [r5, :128], lr
-        vmls.f32        d20, d16, d19
-        vld1.32         {q11},    [r0, :128], lr
-        vmls.f32        d21, d17, d18
-        vld1.32         {q12},    [r9, :128], lr
-        vmla.f32        d2,  d22, d24
-        vld1.32         {q8},     [r6, :128], lr
-        vmla.f32        d3,  d23, d25
-        vld1.32         {q9},     [r10,:128], lr
-        vmla.f32        d4,  d16, d18
-        vld1.32         {q12},    [r11,:128], lr
-        vmla.f32        d5,  d17, d19
-        vrev64.32       q12, q12
-        vld1.32         {q11},    [r7, :128], lr
-        vmla.f32        d6,  d22, d25
-        vmla.f32        d7,  d23, d24
-        subs            r12, r12, #64
-        beq             3f
-        cmp             r12, r4
-        bne             2b
-        sub             r8,  r8,  #512*4
-        sub             r9,  r9,  #512*4
-        sub             r10, r10, #512*4
-        sub             r11, r11, #512*4
-        b               2b
-3:
-        vmul.f32        q8,  q10, d0[0]
-        vmul.f32        q9,  q1,  d0[0]
-        vst1.32         {q3},     [r3,:128]
-        sub             r3,  r3,  #16*4
-        vst1.32         {q2},     [r3,:128]
-        vst1.32         {q8},     [r2,:128]
-        add             r2,  r2,  #16*4
-        vst1.32         {q9},     [r2,:128]
-
-        subs            r1,  r1,  #1
-        it              eq
-        popeq           {r4-r11,pc}
-
-        cmp             r4,  #0
-        itt             eq
-        subeq           r8,  r8,  #512*4
-        subeq           r9,  r9,  #512*4
-        sub             r5,  r5,  #512*4
-        sub             r2,  r2,  #12*4         @ out
-        add             r3,  r3,  #4*4          @ synth_buf2
-        add             r5,  r5,  #4*4          @ window
-        add             r9,  r9,  #4*4          @ synth_buf
-        sub             r8,  r8,  #4*4          @ synth_buf
-        b               1b
-endfunc
diff --git a/deps/libav/libavcodec/arm/synth_filter_vfp.S b/deps/libav/libavcodec/arm/synth_filter_vfp.S
deleted file mode 100644
index e6e6408..0000000
--- a/deps/libav/libavcodec/arm/synth_filter_vfp.S
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (c) 2013 RISC OS Open Ltd
- * Author: Ben Avison <bavison at riscosopen.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-IMDCT         .req    r0
-ORIG_P_SB     .req    r1
-P_SB_OFF      .req    r2
-I             .req    r0
-P_SB2_UP      .req    r1
-OLDFPSCR      .req    r2
-P_SB2_DN      .req    r3
-P_WIN_DN      .req    r4
-P_OUT_DN      .req    r5
-P_SB          .req    r6
-J_WRAP        .req    r7
-P_WIN_UP      .req    r12
-P_OUT_UP      .req    r14
-
-SCALE         .req    s0
-SBUF_DAT_REV0 .req    s4
-SBUF_DAT_REV1 .req    s5
-SBUF_DAT_REV2 .req    s6
-SBUF_DAT_REV3 .req    s7
-VA0           .req    s8
-VA3           .req    s11
-VB0           .req    s12
-VB3           .req    s15
-VC0           .req    s8
-VC3           .req    s11
-VD0           .req    s12
-VD3           .req    s15
-SBUF_DAT0     .req    s16
-SBUF_DAT1     .req    s17
-SBUF_DAT2     .req    s18
-SBUF_DAT3     .req    s19
-SBUF_DAT_ALT0 .req    s20
-SBUF_DAT_ALT1 .req    s21
-SBUF_DAT_ALT2 .req    s22
-SBUF_DAT_ALT3 .req    s23
-WIN_DN_DAT0   .req    s24
-WIN_UP_DAT0   .req    s28
-
-
-.macro inner_loop  half, tail, head
- .if (OFFSET & (64*4)) == 0                @ even numbered call
-        SBUF_DAT_THIS0 .req SBUF_DAT0
-        SBUF_DAT_THIS1 .req SBUF_DAT1
-        SBUF_DAT_THIS2 .req SBUF_DAT2
-        SBUF_DAT_THIS3 .req SBUF_DAT3
-  .ifnc "\head",""
-        vldr    d8, [P_SB, #OFFSET]        @ d8 = SBUF_DAT
-        vldr    d9, [P_SB, #OFFSET+8]
-  .endif
- .else
-        SBUF_DAT_THIS0 .req SBUF_DAT_ALT0
-        SBUF_DAT_THIS1 .req SBUF_DAT_ALT1
-        SBUF_DAT_THIS2 .req SBUF_DAT_ALT2
-        SBUF_DAT_THIS3 .req SBUF_DAT_ALT3
-  .ifnc "\head",""
-        vldr    d10, [P_SB, #OFFSET]       @ d10 = SBUF_DAT_ALT
-        vldr    d11, [P_SB, #OFFSET+8]
-  .endif
- .endif
- .ifnc "\tail",""
-  .ifc "\half","ab"
-        vmls.f  VA0, SBUF_DAT_REV0, WIN_DN_DAT0  @ all operands treated as vectors
-  .else
-        vmla.f  VD0, SBUF_DAT_REV0, WIN_DN_DAT0  @ all operands treated as vectors
-  .endif
- .endif
- .ifnc "\head",""
-        vldr    d14, [P_WIN_UP, #OFFSET]   @ d14 = WIN_UP_DAT
-        vldr    d15, [P_WIN_UP, #OFFSET+8]
-        vldr    d12, [P_WIN_DN, #OFFSET]   @ d12 = WIN_DN_DAT
-        vldr    d13, [P_WIN_DN, #OFFSET+8]
-        vmov    SBUF_DAT_REV3, SBUF_DAT_THIS0
-        vmov    SBUF_DAT_REV2, SBUF_DAT_THIS1
-        vmov    SBUF_DAT_REV1, SBUF_DAT_THIS2
-        vmov    SBUF_DAT_REV0, SBUF_DAT_THIS3
-  .ifc "\half","ab"
-        vmla.f  VB0, SBUF_DAT_THIS0, WIN_UP_DAT0
-  .else
-        vmla.f  VC0, SBUF_DAT_THIS0, WIN_UP_DAT0
-  .endif
-        teq     J_WRAP, #J
-        bne     2f             @ strongly predictable, so better than cond exec in this case
-        sub     P_SB, P_SB, #512*4
-2:
-  .set J, J - 64
-  .set OFFSET, OFFSET + 64*4
- .endif
-        .unreq  SBUF_DAT_THIS0
-        .unreq  SBUF_DAT_THIS1
-        .unreq  SBUF_DAT_THIS2
-        .unreq  SBUF_DAT_THIS3
-.endm
-
-
-/* void ff_synth_filter_float_vfp(FFTContext *imdct,
- *                                float *synth_buf_ptr, int *synth_buf_offset,
- *                                float synth_buf2[32], const float window[512],
- *                                float out[32], const float in[32], float scale)
- */
-function ff_synth_filter_float_vfp, export=1
-        push    {r3-r7,lr}
-        vpush   {s16-s31}
-        ldr     lr, [P_SB_OFF]
-        add     a2, ORIG_P_SB, lr, LSL #2 @ calculate synth_buf to pass to imdct_half
-        mov     P_SB, a2                  @ and keep a copy for ourselves
-        bic     J_WRAP, lr, #63           @ mangled to make testing for wrap easier in inner loop
-        sub     lr, lr, #32
-        and     lr, lr, #512-32
-        str     lr, [P_SB_OFF]            @ rotate offset, modulo buffer size, ready for next call
-        ldr     a3, [sp, #(16+6+2)*4]     @ fetch in from stack, to pass to imdct_half
-VFP     vmov    s16, SCALE                @ imdct_half is free to corrupt s0, but it contains one of our arguments in hardfp case
-        bl      X(ff_imdct_half_vfp)
-VFP     vmov    SCALE, s16
-
-        fmrx    OLDFPSCR, FPSCR
-        ldr     lr, =0x03030000           @ RunFast mode, short vectors of length 4, stride 1
-        fmxr    FPSCR, lr
-        ldr     P_SB2_DN, [sp, #16*4]
-        ldr     P_WIN_DN, [sp, #(16+6+0)*4]
-        ldr     P_OUT_DN, [sp, #(16+6+1)*4]
-NOVFP   vldr    SCALE, [sp, #(16+6+3)*4]
-
-#define IMM_OFF_SKEW 956                   /* also valid immediate constant when you add 16*4 */
-        add     P_SB, P_SB, #IMM_OFF_SKEW  @ so we can use -ve offsets to use full immediate offset range
-        add     P_SB2_UP, P_SB2_DN, #16*4
-        add     P_WIN_UP, P_WIN_DN, #16*4+IMM_OFF_SKEW
-        add     P_OUT_UP, P_OUT_DN, #16*4
-        add     P_SB2_DN, P_SB2_DN, #16*4
-        add     P_WIN_DN, P_WIN_DN, #12*4+IMM_OFF_SKEW
-        add     P_OUT_DN, P_OUT_DN, #16*4
-        mov     I, #4
-1:
-        vldmia  P_SB2_UP!, {VB0-VB3}
-        vldmdb  P_SB2_DN!, {VA0-VA3}
- .set J, 512 - 64
- .set OFFSET, -IMM_OFF_SKEW
-        inner_loop  ab,, head
- .rept 7
-        inner_loop  ab, tail, head
- .endr
-        inner_loop  ab, tail
-        add     P_WIN_UP, P_WIN_UP, #4*4
-        sub     P_WIN_DN, P_WIN_DN, #4*4
-        vmul.f  VB0, VB0, SCALE      @ SCALE treated as scalar
-        add     P_SB, P_SB, #(512+4)*4
-        subs    I, I, #1
-        vmul.f  VA0, VA0, SCALE
-        vstmia  P_OUT_UP!, {VB0-VB3}
-        vstmdb  P_OUT_DN!, {VA0-VA3}
-        bne     1b
-
-        add     P_SB2_DN, P_SB2_DN, #(16+28-12)*4
-        sub     P_SB2_UP, P_SB2_UP, #(16+16)*4
-        add     P_WIN_DN, P_WIN_DN, #(32+16+28-12)*4
-        mov     I, #4
-1:
-        vldr.d  d4, zero             @ d4 = VC0
-        vldr.d  d5, zero
-        vldr.d  d6, zero             @ d6 = VD0
-        vldr.d  d7, zero
- .set J, 512 - 64
- .set OFFSET, -IMM_OFF_SKEW
-        inner_loop  cd,, head
- .rept 7
-        inner_loop  cd, tail, head
- .endr
-        inner_loop  cd, tail
-        add     P_WIN_UP, P_WIN_UP, #4*4
-        sub     P_WIN_DN, P_WIN_DN, #4*4
-        add     P_SB, P_SB, #(512+4)*4
-        subs    I, I, #1
-        vstmia  P_SB2_UP!, {VC0-VC3}
-        vstmdb  P_SB2_DN!, {VD0-VD3}
-        bne     1b
-
-        fmxr    FPSCR, OLDFPSCR
-        vpop    {s16-s31}
-        pop     {r3-r7,pc}
-endfunc
-
-        .unreq  IMDCT
-        .unreq  ORIG_P_SB
-        .unreq  P_SB_OFF
-        .unreq  I
-        .unreq  P_SB2_UP
-        .unreq  OLDFPSCR
-        .unreq  P_SB2_DN
-        .unreq  P_WIN_DN
-        .unreq  P_OUT_DN
-        .unreq  P_SB
-        .unreq  J_WRAP
-        .unreq  P_WIN_UP
-        .unreq  P_OUT_UP
-
-        .unreq  SCALE
-        .unreq  SBUF_DAT_REV0
-        .unreq  SBUF_DAT_REV1
-        .unreq  SBUF_DAT_REV2
-        .unreq  SBUF_DAT_REV3
-        .unreq  VA0
-        .unreq  VA3
-        .unreq  VB0
-        .unreq  VB3
-        .unreq  VC0
-        .unreq  VC3
-        .unreq  VD0
-        .unreq  VD3
-        .unreq  SBUF_DAT0
-        .unreq  SBUF_DAT1
-        .unreq  SBUF_DAT2
-        .unreq  SBUF_DAT3
-        .unreq  SBUF_DAT_ALT0
-        .unreq  SBUF_DAT_ALT1
-        .unreq  SBUF_DAT_ALT2
-        .unreq  SBUF_DAT_ALT3
-        .unreq  WIN_DN_DAT0
-        .unreq  WIN_UP_DAT0
-
-        .align  3
-zero:   .word   0, 0
diff --git a/deps/libav/libavcodec/arm/vc1dsp.h b/deps/libav/libavcodec/arm/vc1dsp.h
deleted file mode 100644
index 30f059f..0000000
--- a/deps/libav/libavcodec/arm/vc1dsp.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_VC1DSP_H
-#define AVCODEC_ARM_VC1DSP_H
-
-#include "libavcodec/vc1dsp.h"
-
-void ff_vc1dsp_init_neon(VC1DSPContext *dsp);
-
-#endif /* AVCODEC_ARM_VC1DSP_H */
diff --git a/deps/libav/libavcodec/arm/vc1dsp_init_arm.c b/deps/libav/libavcodec/arm/vc1dsp_init_arm.c
deleted file mode 100644
index 6d4eb79..0000000
--- a/deps/libav/libavcodec/arm/vc1dsp_init_arm.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/vc1dsp.h"
-#include "vc1dsp.h"
-
-av_cold void ff_vc1dsp_init_arm(VC1DSPContext *dsp)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags))
-        ff_vc1dsp_init_neon(dsp);
-}
diff --git a/deps/libav/libavcodec/arm/vc1dsp_init_neon.c b/deps/libav/libavcodec/arm/vc1dsp_init_neon.c
deleted file mode 100644
index 912e33c..0000000
--- a/deps/libav/libavcodec/arm/vc1dsp_init_neon.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavcodec/vc1dsp.h"
-#include "vc1dsp.h"
-
-void ff_vc1_inv_trans_8x8_neon(int16_t *block);
-void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, int linesize, int16_t *block);
-void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, int linesize, int16_t *block);
-void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, int linesize, int16_t *block);
-
-void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, int linesize, int16_t *block);
-void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, int linesize, int16_t *block);
-void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, int linesize, int16_t *block);
-void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, int linesize, int16_t *block);
-
-void ff_put_pixels8x8_neon(uint8_t *block, const uint8_t *pixels,
-                           ptrdiff_t line_size, int rnd);
-
-void ff_put_vc1_mspel_mc10_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc20_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc30_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-
-void ff_put_vc1_mspel_mc01_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc02_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc03_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-
-void ff_put_vc1_mspel_mc11_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc12_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc13_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-
-void ff_put_vc1_mspel_mc21_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc22_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc23_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-
-void ff_put_vc1_mspel_mc31_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc32_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-void ff_put_vc1_mspel_mc33_neon(uint8_t *dst, const uint8_t *src,
-                                ptrdiff_t stride, int rnd);
-
-void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                int x, int y);
-void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                int x, int y);
-void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                int x, int y);
-void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
-                                int x, int y);
-
-av_cold void ff_vc1dsp_init_neon(VC1DSPContext *dsp)
-{
-    dsp->vc1_inv_trans_8x8 = ff_vc1_inv_trans_8x8_neon;
-    dsp->vc1_inv_trans_4x8 = ff_vc1_inv_trans_4x8_neon;
-    dsp->vc1_inv_trans_8x4 = ff_vc1_inv_trans_8x4_neon;
-    dsp->vc1_inv_trans_4x4 = ff_vc1_inv_trans_4x4_neon;
-    dsp->vc1_inv_trans_8x8_dc = ff_vc1_inv_trans_8x8_dc_neon;
-    dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_neon;
-    dsp->vc1_inv_trans_8x4_dc = ff_vc1_inv_trans_8x4_dc_neon;
-    dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_neon;
-
-    dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_pixels8x8_neon;
-    dsp->put_vc1_mspel_pixels_tab[ 1] = ff_put_vc1_mspel_mc10_neon;
-    dsp->put_vc1_mspel_pixels_tab[ 2] = ff_put_vc1_mspel_mc20_neon;
-    dsp->put_vc1_mspel_pixels_tab[ 3] = ff_put_vc1_mspel_mc30_neon;
-    dsp->put_vc1_mspel_pixels_tab[ 4] = ff_put_vc1_mspel_mc01_neon;
-    dsp->put_vc1_mspel_pixels_tab[ 5] = ff_put_vc1_mspel_mc11_neon;
-    dsp->put_vc1_mspel_pixels_tab[ 6] = ff_put_vc1_mspel_mc21_neon;
-    dsp->put_vc1_mspel_pixels_tab[ 7] = ff_put_vc1_mspel_mc31_neon;
-    dsp->put_vc1_mspel_pixels_tab[ 8] = ff_put_vc1_mspel_mc02_neon;
-    dsp->put_vc1_mspel_pixels_tab[ 9] = ff_put_vc1_mspel_mc12_neon;
-    dsp->put_vc1_mspel_pixels_tab[10] = ff_put_vc1_mspel_mc22_neon;
-    dsp->put_vc1_mspel_pixels_tab[11] = ff_put_vc1_mspel_mc32_neon;
-    dsp->put_vc1_mspel_pixels_tab[12] = ff_put_vc1_mspel_mc03_neon;
-    dsp->put_vc1_mspel_pixels_tab[13] = ff_put_vc1_mspel_mc13_neon;
-    dsp->put_vc1_mspel_pixels_tab[14] = ff_put_vc1_mspel_mc23_neon;
-    dsp->put_vc1_mspel_pixels_tab[15] = ff_put_vc1_mspel_mc33_neon;
-
-    dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_neon;
-    dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_neon;
-    dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = ff_put_vc1_chroma_mc4_neon;
-    dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = ff_avg_vc1_chroma_mc4_neon;
-}
diff --git a/deps/libav/libavcodec/arm/vc1dsp_neon.S b/deps/libav/libavcodec/arm/vc1dsp_neon.S
deleted file mode 100644
index d1b24cf..0000000
--- a/deps/libav/libavcodec/arm/vc1dsp_neon.S
+++ /dev/null
@@ -1,1170 +0,0 @@
-/*
- * VC1 NEON optimisations
- *
- * Copyright (c) 2010 Rob Clark <rob at ti.com>
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-#include "neon.S"
-
-@ Transpose rows into columns of a matrix of 16-bit elements. For 4x4, pass
-@ double-word registers, for 8x4, pass quad-word registers.
-.macro transpose16 r0, r1, r2, r3
-        @ At this point:
-        @   row[0]  r0
-        @   row[1]  r1
-        @   row[2]  r2
-        @   row[3]  r3
-
-        vtrn.16         \r0,  \r1         @ first and second row
-        vtrn.16         \r2,  \r3         @ third and fourth row
-        vtrn.32         \r0,  \r2         @ first and third row
-        vtrn.32         \r1,  \r3         @ second and fourth row
-
-        @ At this point, if registers are quad-word:
-        @   column[0]   d0
-        @   column[1]   d2
-        @   column[2]   d4
-        @   column[3]   d6
-        @   column[4]   d1
-        @   column[5]   d3
-        @   column[6]   d5
-        @   column[7]   d7
-
-        @ At this point, if registers are double-word:
-        @   column[0]   d0
-        @   column[1]   d1
-        @   column[2]   d2
-        @   column[3]   d3
-.endm
-
-@ ff_vc1_inv_trans_{4,8}x{4,8}_neon and overflow: The input values in the file
-@ are supposed to be in a specific range as to allow for 16-bit math without
-@ causing overflows, but sometimes the input values are just big enough to
-@ barely cause overflow in vadd instructions like:
-@
-@   vadd.i16  q0, q8, q10
-@   vshr.s16  q0, q0, #\rshift
-@
-@ To prevent these borderline cases from overflowing, we just need one more
-@ bit of precision, which is accomplished by replacing the sequence above with:
-@
-@   vhadd.s16 q0, q8, q10
-@   vshr.s16  q0, q0, #(\rshift -1)
-@
-@ This works because vhadd is a single instruction that adds, then shifts to
-@ the right once, all before writing the result to the destination register.
-@
-@ Even with this workaround, there were still some files that caused overflows
-@ in ff_vc1_inv_trans_8x8_neon. See the comments in ff_vc1_inv_trans_8x8_neon
-@ for the additional workaround.
-
-@ Takes 4 columns of 8 values each and operates on it. Modeled after the first
-@ for loop in vc1_inv_trans_4x8_c.
-@ Input columns: q0 q1 q2 q3
-@ Output columns: q0 q1 q2 q3
-@ Trashes: r12 q8 q9 q10 q11 q12 q13
-.macro vc1_inv_trans_4x8_helper add rshift
-        @ Compute temp1, temp2 and setup scalar #17, #22, #10
-        vadd.i16        q12,   q0,  q2              @ temp1 = src[0] + src[2]
-        movw            r12,   #17
-        vsub.i16        q13,   q0,  q2              @ temp2 = src[0] - src[2]
-        movt            r12,   #22
-        vmov.32         d0[0], r12
-        movw            r12,   #10
-        vmov.16         d1[0], r12
-
-        vmov.i16        q8,  #\add                  @ t1 will accumulate here
-        vmov.i16        q9,  #\add                  @ t2 will accumulate here
-
-        vmul.i16        q10, q1,  d0[1]             @ t3 = 22 * (src[1])
-        vmul.i16        q11, q3,  d0[1]             @ t4 = 22 * (src[3])
-
-        vmla.i16        q8,  q12, d0[0]             @ t1 = 17 * (temp1) + 4
-        vmla.i16        q9,  q13, d0[0]             @ t2 = 17 * (temp2) + 4
-
-        vmla.i16        q10, q3,  d1[0]             @ t3 += 10 * src[3]
-        vmls.i16        q11, q1,  d1[0]             @ t4 -= 10 * src[1]
-
-        vhadd.s16       q0,  q8,  q10               @ dst[0] = (t1 + t3) >> 1
-        vhsub.s16       q3,  q8,  q10               @ dst[3] = (t1 - t3) >> 1
-        vhsub.s16       q1,  q9,  q11               @ dst[1] = (t2 - t4) >> 1
-        vhadd.s16       q2,  q9,  q11               @ dst[2] = (t2 + t4) >> 1
-
-        @ Halving add/sub above already did one shift
-        vshr.s16        q0,  q0,  #(\rshift - 1)    @ dst[0] >>= (rshift - 1)
-        vshr.s16        q3,  q3,  #(\rshift - 1)    @ dst[3] >>= (rshift - 1)
-        vshr.s16        q1,  q1,  #(\rshift - 1)    @ dst[1] >>= (rshift - 1)
-        vshr.s16        q2,  q2,  #(\rshift - 1)    @ dst[2] >>= (rshift - 1)
-.endm
-
-@ Takes 8 columns of 4 values each and operates on it. Modeled after the second
-@ for loop in vc1_inv_trans_4x8_c.
-@ Input columns: d0 d2 d4 d6 d1 d3 d5 d7
-@ Output columns: d16 d17 d18 d19 d21 d20 d23 d22
-@ Trashes all NEON registers (and r12) except for: q4 q5 q6 q7
-.macro vc1_inv_trans_8x4_helper add add1beforeshift rshift
-        @ At this point:
-        @   src[0]      d0 overwritten later
-        @   src[8]      d2
-        @   src[16]     d4 overwritten later
-        @   src[24]     d6
-        @   src[32]     d1 overwritten later
-        @   src[40]     d3
-        @   src[48]     d5 overwritten later
-        @   src[56]     d7
-
-        movw            r12,   #12
-        vmov.i16        q14,   #\add            @ t1|t2 will accumulate here
-        movt            r12,   #6
-
-        vadd.i16        d20,   d0,  d1          @ temp1 = src[0] + src[32]
-        vsub.i16        d21,   d0,  d1          @ temp2 = src[0] - src[32]
-        vmov.i32        d0[0], r12              @ 16-bit: d0[0] = #12, d0[1] = #6
-
-        vshl.i16        q15,   q2,  #4          @ t3|t4 = 16 * (src[16]|src[48])
-        vswp            d4,    d5               @ q2 = src[48]|src[16]
-        vmla.i16        q14,   q10, d0[0]       @ t1|t2 = 12 * (temp1|temp2) + 64
-        movw            r12,   #15
-        movt            r12,   #9
-        vmov.i32        d0[1], r12              @ 16-bit: d0[2] = #15, d0[3] = #9
-        vneg.s16        d31,   d31              @ t4 = -t4
-        vmla.i16        q15,   q2,  d0[1]       @ t3|t4 += 6 * (src[48]|src[16])
-
-        @ At this point:
-        @   d0[2]   #15
-        @   d0[3]   #9
-        @   q1      src[8]|src[40]
-        @   q3      src[24]|src[56]
-        @   q14     old t1|t2
-        @   q15     old t3|t4
-
-        vshl.i16        q8,  q1,  #4            @ t1|t2 = 16 * (src[8]|src[40])
-        vswp            d2,  d3                 @ q1 = src[40]|src[8]
-        vshl.i16        q12, q3,  #4            @ temp3a|temp4a = 16 * src[24]|src[56]
-        vswp            d6,  d7                 @ q3 = src[56]|src[24]
-        vshl.i16        q13, q1,  #2            @ temp3b|temp4b = 4 * (src[40]|src[8])
-        vshl.i16        q2,  q3,  #2            @ temp1|temp2 = 4 * (src[56]|src[24])
-        vswp            d3,  d6                 @ q1 = src[40]|src[56], q3 = src[8]|src[24]
-        vsub.i16        q9,  q13, q12           @ t3|t4 = - (temp3a|temp4a) + (temp3b|temp4b)
-        vadd.i16        q8,  q8,  q2            @ t1|t2 += temp1|temp2
-        vmul.i16        q12, q3,  d0[3]         @ temp3|temp4 = 9 * src[8]|src[24]
-        vmla.i16        q8,  q1,  d0[3]         @ t1|t2 += 9 * (src[40]|src[56])
-        vswp            d6,  d7                 @ q3 = src[24]|src[8]
-        vswp            d2,  d3                 @ q1 = src[56]|src[40]
-
-        vsub.i16        q11, q14, q15           @ t8|t7 = old t1|t2 - old t3|t4
-        vadd.i16        q10, q14, q15           @ t5|t6 = old t1|t2 + old t3|t4
-  .if \add1beforeshift
-        vmov.i16        q15, #1
-  .endif
-
-        vadd.i16        d18, d18, d24           @ t3 += temp3
-        vsub.i16        d19, d19, d25           @ t4 -= temp4
-
-        vswp            d22, d23                @ q11 = t7|t8
-
-        vneg.s16        d17, d17                @ t2 = -t2
-        vmla.i16        q9,  q1,  d0[2]         @ t3|t4 += 15 * src[56]|src[40]
-        vmla.i16        q8,  q3,  d0[2]         @ t1|t2 += 15 * src[24]|src[8]
-
-        @ At this point:
-        @   t1  d16
-        @   t2  d17
-        @   t3  d18
-        @   t4  d19
-        @   t5  d20
-        @   t6  d21
-        @   t7  d22
-        @   t8  d23
-        @   #1  q15
-
-  .if \add1beforeshift
-        vadd.i16        q3,  q15, q10           @ line[7,6] = t5|t6 + 1
-        vadd.i16        q2,  q15, q11           @ line[5,4] = t7|t8 + 1
-  .endif
-
-        @ Sometimes this overflows, so to get one additional bit of precision, use
-        @ a single instruction that both adds and shifts right (halving).
-        vhadd.s16       q1,  q9,  q11           @ line[2,3] = (t3|t4 + t7|t8) >> 1
-        vhadd.s16       q0,  q8,  q10           @ line[0,1] = (t1|t2 + t5|t6) >> 1
-  .if \add1beforeshift
-        vhsub.s16       q2,  q2,  q9            @ line[5,4] = (t7|t8 - t3|t4 + 1) >> 1
-        vhsub.s16       q3,  q3,  q8            @ line[7,6] = (t5|t6 - t1|t2 + 1) >> 1
-  .else
-        vhsub.s16       q2,  q11, q9            @ line[5,4] = (t7|t8 - t3|t4) >> 1
-        vhsub.s16       q3,  q10, q8            @ line[7,6] = (t5|t6 - t1|t2) >> 1
-  .endif
-
-        vshr.s16        q9,  q1,  #(\rshift - 1)    @ one shift is already done by vhadd/vhsub above
-        vshr.s16        q8,  q0,  #(\rshift - 1)
-        vshr.s16        q10, q2,  #(\rshift - 1)
-        vshr.s16        q11, q3,  #(\rshift - 1)
-
-        @ At this point:
-        @   dst[0]   d16
-        @   dst[1]   d17
-        @   dst[2]   d18
-        @   dst[3]   d19
-        @   dst[4]   d21
-        @   dst[5]   d20
-        @   dst[6]   d23
-        @   dst[7]   d22
-.endm
-
-@ This is modeled after the first and second for loop in vc1_inv_trans_8x8_c.
-@ Input columns:  q8, q9, q10, q11, q12, q13, q14, q15
-@ Output columns: q8, q9, q10, q11, q12, q13, q14, q15
-@ Trashes all NEON registers (and r12) except for: q4 q5 q6 q7
-.macro vc1_inv_trans_8x8_helper add add1beforeshift rshift
-        @ This actually computes half of t1, t2, t3, t4, as explained below
-        @ near `tNhalf`.
-        vmov.i16        q0,    #(6 / 2)         @ q0 = #6/2
-        vshl.i16        q1,    q10, #3          @ t3 = 16/2 * src[16]
-        vshl.i16        q3,    q14, #3          @ temp4 = 16/2 * src[48]
-        vmul.i16        q2,    q10, q0          @ t4 = 6/2 * src[16]
-        vmla.i16        q1,    q14, q0          @ t3 += 6/2 * src[48]
-        @ unused: q0, q10, q14
-        vmov.i16        q0,    #(12 / 2)        @ q0 = #12/2
-        vadd.i16        q10,   q8,  q12         @ temp1 = src[0] + src[32]
-        vsub.i16        q14,   q8,  q12         @ temp2 = src[0] - src[32]
-        @ unused: q8, q12
-        vmov.i16        q8,    #(\add / 2)      @ t1 will accumulate here
-        vmov.i16        q12,   #(\add / 2)      @ t2 will accumulate here
-        movw            r12,   #15
-        vsub.i16        q2,    q2,  q3          @ t4 = 6/2 * src[16] - 16/2 * src[48]
-        movt            r12,   #9
-        @ unused: q3
-        vmla.i16        q8,    q10, q0          @ t1 = 12/2 * temp1 + add
-        vmla.i16        q12,   q14, q0          @ t2 = 12/2 * temp2 + add
-        vmov.i32        d0[0], r12
-        @ unused: q3, q10, q14
-
-        @ At this point:
-        @   q0          d0=#15|#9
-        @   q1  old t3
-        @   q2  old t4
-        @   q3
-        @   q8  old t1
-        @   q9          src[8]
-        @   q10
-        @   q11         src[24]
-        @   q12 old t2
-        @   q13         src[40]
-        @   q14
-        @   q15         src[56]
-
-        @ unused: q3, q10, q14
-        movw            r12,   #16
-        vshl.i16        q3,    q9,  #4          @ t1 = 16 * src[8]
-        movt            r12,   #4
-        vshl.i16        q10,   q9,  #2          @ t4 = 4 * src[8]
-        vmov.i32        d1[0], r12
-        vmul.i16        q14,   q9,  d0[0]       @ t2 = 15 * src[8]
-        vmul.i16        q9,    q9,  d0[1]       @ t3 = 9 * src[8]
-        @ unused: none
-        vmla.i16        q3,    q11, d0[0]       @ t1 += 15 * src[24]
-        vmls.i16        q10,   q11, d0[1]       @ t4 -= 9 * src[24]
-        vmls.i16        q14,   q11, d1[1]       @ t2 -= 4 * src[24]
-        vmls.i16        q9,    q11, d1[0]       @ t3 -= 16 * src[24]
-        @ unused: q11
-        vmla.i16        q3,    q13, d0[1]       @ t1 += 9 * src[40]
-        vmla.i16        q10,   q13, d0[0]       @ t4 += 15 * src[40]
-        vmls.i16        q14,   q13, d1[0]       @ t2 -= 16 * src[40]
-        vmla.i16        q9,    q13, d1[1]       @ t3 += 4 * src[40]
-        @ unused: q11, q13
-
-        @ Compute t5, t6, t7, t8 from old t1, t2, t3, t4. Actually, it computes
-        @ half of t5, t6, t7, t8 since t1, t2, t3, t4 are halved.
-        vadd.i16        q11,   q8,  q1          @ t5 = t1 + t3
-        vsub.i16        q1,    q8,  q1          @ t8 = t1 - t3
-        vadd.i16        q13,   q12, q2          @ t6 = t2 + t4
-        vsub.i16        q2,    q12, q2          @ t7 = t2 - t4
-        @ unused: q8, q12
-
-  .if \add1beforeshift
-        vmov.i16        q12,   #1
-  .endif
-
-        @ unused: q8
-        vmla.i16        q3,    q15, d1[1]       @ t1 += 4 * src[56]
-        vmls.i16        q14,   q15, d0[1]       @ t2 -= 9 * src[56]
-        vmla.i16        q9,    q15, d0[0]       @ t3 += 15 * src[56]
-        vmls.i16        q10,   q15, d1[0]       @ t4 -= 16 * src[56]
-        @ unused: q0, q8, q15
-
-        @ At this point:
-        @   t1      q3
-        @   t2      q14
-        @   t3      q9
-        @   t4      q10
-        @   t5half  q11
-        @   t6half  q13
-        @   t7half  q2
-        @   t8half  q1
-        @   #1      q12
-        @
-        @ tNhalf is half of the value of tN (as described in vc1_inv_trans_8x8_c).
-        @ This is done because sometimes files have input that causes tN + tM to
-        @ overflow. To avoid this overflow, we compute tNhalf, then compute
-        @ tNhalf + tM (which doesn't overflow), and then we use vhadd to compute
-        @ (tNhalf + (tNhalf + tM)) >> 1 which does not overflow because it is
-        @ one instruction.
-
-        @ For each pair of tN and tM, do:
-        @   lineA = t5half + t1
-        @   if add1beforeshift:  t1 -= 1
-        @   lineA = (t5half + lineA) >> 1
-        @   lineB = t5half - t1
-        @   lineB = (t5half + lineB) >> 1
-        @   lineA >>= rshift - 1
-        @   lineB >>= rshift - 1
-
-        vadd.i16        q8,  q11, q3                @ q8 = t5half + t1
-  .if \add1beforeshift
-        vsub.i16        q3,  q3,  q12               @ q3 = t1 - 1
-  .endif
-
-        vadd.i16        q0,  q13, q14               @ q0  = t6half + t2
-  .if \add1beforeshift
-        vsub.i16        q14, q14, q12               @ q14 = t2 - 1
-  .endif
-
-        vadd.i16        q15, q2,  q9                @ q15 = t7half + t3
-  .if \add1beforeshift
-        vsub.i16        q9,  q9,  q12               @ q9  = t3 - 1
-  .endif
-        @ unused: none
-
-        vhadd.s16       q8,  q11, q8                @ q8  = (t5half + t5half + t1) >> 1
-        vsub.i16        q3,  q11, q3                @ q3  = t5half - t1 + 1
-
-        vhadd.s16       q0,  q13, q0                @ q0  = (t6half + t6half + t2) >> 1
-        vsub.i16        q14, q13, q14               @ q14 = t6half - t2 + 1
-
-        vhadd.s16       q15, q2,  q15               @ q15 = (t7half + t7half + t3) >> 1
-        vsub.i16        q9,  q2,  q9                @ q9  = t7half - t3 + 1
-
-        vhadd.s16       q3,  q11, q3                @ q3  = (t5half + t5half - t1 + 1) >> 1
-        @ unused: q11
-
-        vadd.i16        q11, q1,  q10               @ q11 = t8half + t4
-  .if \add1beforeshift
-        vsub.i16        q10, q10, q12               @ q10 = t4 - 1
-  .endif
-        @ unused: q12
-
-        vhadd.s16       q14, q13, q14               @ q14 = (t6half + t6half - t2 + 1) >> 1
-        @ unused: q12, q13
-        vhadd.s16       q13, q2,  q9                @ q9  = (t7half + t7half - t3 + 1) >> 1
-        @ unused: q12, q2, q9
-
-        vsub.i16        q10, q1,  q10               @ q10 = t8half - t4 + 1
-        vhadd.s16       q11, q1,  q11               @ q11 = (t8half + t8half + t4) >> 1
-
-        vshr.s16        q8,  q8,  #(\rshift - 1)    @ q8  = line[0]
-        vhadd.s16       q12, q1,  q10               @ q12 = (t8half + t8half - t4 + 1) >> 1
-        vshr.s16        q9,  q0,  #(\rshift - 1)    @ q9  = line[1]
-        vshr.s16        q10, q15, #(\rshift - 1)    @ q10 = line[2]
-        vshr.s16        q11, q11, #(\rshift - 1)    @ q11 = line[3]
-        vshr.s16        q12, q12, #(\rshift - 1)    @ q12 = line[4]
-        vshr.s16        q13, q13, #(\rshift - 1)    @ q13 = line[5]
-        vshr.s16        q14, q14, #(\rshift - 1)    @ q14 = line[6]
-        vshr.s16        q15, q3,  #(\rshift - 1)    @ q15 = line[7]
-.endm
-
-@ (int16_t *block [r0])
-function ff_vc1_inv_trans_8x8_neon, export=1
-        vld1.64         {q8-q9},   [r0,:128]!
-        vld1.64         {q10-q11}, [r0,:128]!
-        vld1.64         {q12-q13}, [r0,:128]!
-        vld1.64         {q14-q15}, [r0,:128]
-        sub             r0, r0, #(16 * 2 * 3)   @ restore r0
-
-        @ At this point:
-        @   src[0]  q8
-        @   src[8]  q9
-        @   src[16] q10
-        @   src[24] q11
-        @   src[32] q12
-        @   src[40] q13
-        @   src[48] q14
-        @   src[56] q15
-
-        vc1_inv_trans_8x8_helper add=4 add1beforeshift=0 rshift=3
-
-        @ Transpose result matrix of 8x8
-        swap4           d17, d19, d21, d23, d24, d26, d28, d30
-        transpose16_4x4 q8,  q9,  q10, q11, q12, q13, q14, q15
-
-        vc1_inv_trans_8x8_helper add=64 add1beforeshift=1 rshift=7
-
-        vst1.64         {q8-q9},   [r0,:128]!
-        vst1.64         {q10-q11}, [r0,:128]!
-        vst1.64         {q12-q13}, [r0,:128]!
-        vst1.64         {q14-q15}, [r0,:128]
-
-        bx              lr
-endfunc
-
-@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2])
-function ff_vc1_inv_trans_8x4_neon, export=1
-        vld1.64         {q0-q1}, [r2,:128]!     @ load 8 * 4 * 2 = 64 bytes / 16 bytes per quad = 4 quad registers
-        vld1.64         {q2-q3}, [r2,:128]
-
-        transpose16     q0 q1 q2 q3             @ transpose rows to columns
-
-        @ At this point:
-        @   src[0]   d0
-        @   src[1]   d2
-        @   src[2]   d4
-        @   src[3]   d6
-        @   src[4]   d1
-        @   src[5]   d3
-        @   src[6]   d5
-        @   src[7]   d7
-
-        vc1_inv_trans_8x4_helper    add=4 add1beforeshift=0 rshift=3
-
-        @ Move output to more standardized registers
-        vmov        d0, d16
-        vmov        d2, d17
-        vmov        d4, d18
-        vmov        d6, d19
-        vmov        d1, d21
-        vmov        d3, d20
-        vmov        d5, d23
-        vmov        d7, d22
-
-        @ At this point:
-        @   dst[0]   d0
-        @   dst[1]   d2
-        @   dst[2]   d4
-        @   dst[3]   d6
-        @   dst[4]   d1
-        @   dst[5]   d3
-        @   dst[6]   d5
-        @   dst[7]   d7
-
-        transpose16     q0 q1 q2 q3   @ turn columns into rows
-
-        @ At this point:
-        @   row[0] q0
-        @   row[1] q1
-        @   row[2] q2
-        @   row[3] q3
-
-        vc1_inv_trans_4x8_helper    add=64 rshift=7
-
-        @ At this point:
-        @   line[0].l   d0
-        @   line[0].h   d1
-        @   line[1].l   d2
-        @   line[1].h   d3
-        @   line[2].l   d4
-        @   line[2].h   d5
-        @   line[3].l   d6
-        @   line[3].h   d7
-
-        @ unused registers: q12, q13, q14, q15
-
-        vld1.64         {d28}, [r0,:64], r1     @ read dest
-        vld1.64         {d29}, [r0,:64], r1
-        vld1.64         {d30}, [r0,:64], r1
-        vld1.64         {d31}, [r0,:64], r1
-        sub             r0,  r0,  r1, lsl #2    @ restore original r0 value
-
-        vaddw.u8        q0,  q0,  d28           @ line[0] += dest[0]
-        vaddw.u8        q1,  q1,  d29           @ line[1] += dest[1]
-        vaddw.u8        q2,  q2,  d30           @ line[2] += dest[2]
-        vaddw.u8        q3,  q3,  d31           @ line[3] += dest[3]
-
-        vqmovun.s16     d0,  q0                 @ line[0]
-        vqmovun.s16     d1,  q1                 @ line[1]
-        vqmovun.s16     d2,  q2                 @ line[2]
-        vqmovun.s16     d3,  q3                 @ line[3]
-
-        vst1.64         {d0},  [r0,:64], r1     @ write dest
-        vst1.64         {d1},  [r0,:64], r1
-        vst1.64         {d2},  [r0,:64], r1
-        vst1.64         {d3},  [r0,:64]
-
-        bx              lr
-endfunc
-
-@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2])
-function ff_vc1_inv_trans_4x8_neon, export=1
-        mov             r12, #(8 * 2)  @ 8 elements per line, each element 2 bytes
-        vld4.16         {d0[],  d2[],  d4[],  d6[]},  [r2,:64], r12     @ read each column into a q register
-        vld4.16         {d0[1], d2[1], d4[1], d6[1]}, [r2,:64], r12
-        vld4.16         {d0[2], d2[2], d4[2], d6[2]}, [r2,:64], r12
-        vld4.16         {d0[3], d2[3], d4[3], d6[3]}, [r2,:64], r12
-        vld4.16         {d1[],  d3[],  d5[],  d7[]},  [r2,:64], r12
-        vld4.16         {d1[1], d3[1], d5[1], d7[1]}, [r2,:64], r12
-        vld4.16         {d1[2], d3[2], d5[2], d7[2]}, [r2,:64], r12
-        vld4.16         {d1[3], d3[3], d5[3], d7[3]}, [r2,:64]
-
-        vc1_inv_trans_4x8_helper    add=4 rshift=3
-
-        @ At this point:
-        @   dst[0] = q0
-        @   dst[1] = q1
-        @   dst[2] = q2
-        @   dst[3] = q3
-
-        transpose16     q0 q1 q2 q3     @ Transpose rows (registers) into columns
-
-        vc1_inv_trans_8x4_helper    add=64 add1beforeshift=1 rshift=7
-
-        vld1.32         {d28[]},  [r0,:32], r1  @ read dest
-        vld1.32         {d28[1]}, [r0,:32], r1
-        vld1.32         {d29[]},  [r0,:32], r1
-        vld1.32         {d29[1]}, [r0,:32], r1
-
-        vld1.32         {d30[]},  [r0,:32], r1
-        vld1.32         {d30[0]}, [r0,:32], r1
-        vld1.32         {d31[]},  [r0,:32], r1
-        vld1.32         {d31[0]}, [r0,:32], r1
-        sub             r0,  r0,  r1, lsl #3    @ restore original r0 value
-
-        vaddw.u8        q8,  q8,  d28           @ line[0,1] += dest[0,1]
-        vaddw.u8        q9,  q9,  d29           @ line[2,3] += dest[2,3]
-        vaddw.u8        q10, q10, d30           @ line[5,4] += dest[5,4]
-        vaddw.u8        q11, q11, d31           @ line[7,6] += dest[7,6]
-
-        vqmovun.s16     d16, q8                 @ clip(line[0,1])
-        vqmovun.s16     d18, q9                 @ clip(line[2,3])
-        vqmovun.s16     d20, q10                @ clip(line[5,4])
-        vqmovun.s16     d22, q11                @ clip(line[7,6])
-
-        vst1.32         {d16[0]}, [r0,:32], r1  @ write dest
-        vst1.32         {d16[1]}, [r0,:32], r1
-        vst1.32         {d18[0]}, [r0,:32], r1
-        vst1.32         {d18[1]}, [r0,:32], r1
-
-        vst1.32         {d20[1]}, [r0,:32], r1
-        vst1.32         {d20[0]}, [r0,:32], r1
-        vst1.32         {d22[1]}, [r0,:32], r1
-        vst1.32         {d22[0]}, [r0,:32]
-
-        bx              lr
-endfunc
-
-@ Setup constants in registers which are used by vc1_inv_trans_4x4_helper
-.macro vc1_inv_trans_4x4_helper_setup
-        vmov.i16        q13, #17
-        vmov.i16        q14, #22
-        vmov.i16        d30, #10                @ only need double-word, not quad-word
-.endm
-
-@ This is modeled after the first for loop in vc1_inv_trans_4x4_c.
-.macro vc1_inv_trans_4x4_helper add rshift
-        vmov.i16        q2,  #\add              @ t1|t2 will accumulate here
-
-        vadd.i16        d16, d0,  d1            @ temp1 = src[0] + src[2]
-        vsub.i16        d17, d0,  d1            @ temp2 = src[0] - src[2]
-        vmul.i16        q3,  q14, q1            @ t3|t4 = 22 * (src[1]|src[3])
-        vmla.i16        q2,  q13, q8            @ t1|t2 = 17 * (temp1|temp2) + add
-        vmla.i16        d6,  d30, d3            @ t3 += 10 * src[3]
-        vmls.i16        d7,  d30, d2            @ t4 -= 10 * src[1]
-
-        vadd.i16        q0,  q2,  q3            @ dst[0,2] = (t1|t2 + t3|t4)
-        vsub.i16        q1,  q2,  q3            @ dst[3,1] = (t1|t2 - t3|t4)
-        vshr.s16        q0,  q0,  #\rshift      @ dst[0,2] >>= rshift
-        vshr.s16        q1,  q1,  #\rshift      @ dst[3,1] >>= rshift
-.endm
-
-@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2])
-function ff_vc1_inv_trans_4x4_neon, export=1
-        mov             r12, #(8 * 2)  @ 8 elements per line, each element 2 bytes
-        vld4.16         {d0[],  d1[],  d2[],  d3[]},  [r2,:64], r12     @ read each column into a register
-        vld4.16         {d0[1], d1[1], d2[1], d3[1]}, [r2,:64], r12
-        vld4.16         {d0[2], d1[2], d2[2], d3[2]}, [r2,:64], r12
-        vld4.16         {d0[3], d1[3], d2[3], d3[3]}, [r2,:64]
-
-        vswp            d1,  d2         @ so that we can later access column 1 and column 3 as a single q1 register
-
-        vc1_inv_trans_4x4_helper_setup
-
-        @ At this point:
-        @   src[0] = d0
-        @   src[1] = d2
-        @   src[2] = d1
-        @   src[3] = d3
-
-        vc1_inv_trans_4x4_helper add=4 rshift=3      @ compute t1, t2, t3, t4 and combine them into dst[0-3]
-
-        @ At this point:
-        @   dst[0] = d0
-        @   dst[1] = d3
-        @   dst[2] = d1
-        @   dst[3] = d2
-
-        transpose16     d0 d3 d1 d2     @ Transpose rows (registers) into columns
-
-        @ At this point:
-        @   src[0]  = d0
-        @   src[8]  = d3
-        @   src[16] = d1
-        @   src[24] = d2
-
-        vswp            d2,  d3         @ so that we can later access column 1 and column 3 in order as a single q1 register
-
-        @ At this point:
-        @   src[0]  = d0
-        @   src[8]  = d2
-        @   src[16] = d1
-        @   src[24] = d3
-
-        vc1_inv_trans_4x4_helper add=64 rshift=7              @ compute t1, t2, t3, t4 and combine them into dst[0-3]
-
-        @ At this point:
-        @   line[0] = d0
-        @   line[1] = d3
-        @   line[2] = d1
-        @   line[3] = d2
-
-        vld1.32         {d18[]},  [r0,:32], r1  @ read dest
-        vld1.32         {d19[]},  [r0,:32], r1
-        vld1.32         {d18[1]}, [r0,:32], r1
-        vld1.32         {d19[0]}, [r0,:32], r1
-        sub             r0,  r0,  r1, lsl #2    @ restore original r0 value
-
-        vaddw.u8        q0,  q0,  d18           @ line[0,2] += dest[0,2]
-        vaddw.u8        q1,  q1,  d19           @ line[3,1] += dest[3,1]
-
-        vqmovun.s16     d0,  q0                 @ clip(line[0,2])
-        vqmovun.s16     d1,  q1                 @ clip(line[3,1])
-
-        vst1.32         {d0[0]},  [r0,:32], r1  @ write dest
-        vst1.32         {d1[1]},  [r0,:32], r1
-        vst1.32         {d0[1]},  [r0,:32], r1
-        vst1.32         {d1[0]},  [r0,:32]
-
-        bx              lr
-endfunc
-
-@ The absolute value of multiplication constants from vc1_mspel_filter and vc1_mspel_{ver,hor}_filter_16bits.
-@ The sign is embedded in the code below that carries out the multiplication (mspel_filter{,.16}).
-#define MSPEL_MODE_1_MUL_CONSTANTS  4 53 18 3
-#define MSPEL_MODE_2_MUL_CONSTANTS  1 9  9  1
-#define MSPEL_MODE_3_MUL_CONSTANTS  3 18 53 4
-
-@ These constants are from reading the source code of vc1_mspel_mc and determining the value that
-@ is added to `rnd` to result in the variable `r`, and the value of the variable `shift`.
-#define MSPEL_MODES_11_ADDSHIFT_CONSTANTS   15 5
-#define MSPEL_MODES_12_ADDSHIFT_CONSTANTS   3  3
-#define MSPEL_MODES_13_ADDSHIFT_CONSTANTS   15 5
-#define MSPEL_MODES_21_ADDSHIFT_CONSTANTS   MSPEL_MODES_12_ADDSHIFT_CONSTANTS
-#define MSPEL_MODES_22_ADDSHIFT_CONSTANTS   0  1
-#define MSPEL_MODES_23_ADDSHIFT_CONSTANTS   3  3
-#define MSPEL_MODES_31_ADDSHIFT_CONSTANTS   MSPEL_MODES_13_ADDSHIFT_CONSTANTS
-#define MSPEL_MODES_32_ADDSHIFT_CONSTANTS   MSPEL_MODES_23_ADDSHIFT_CONSTANTS
-#define MSPEL_MODES_33_ADDSHIFT_CONSTANTS   15 5
-
-@ The addition and shift constants from vc1_mspel_filter.
-#define MSPEL_MODE_1_ADDSHIFT_CONSTANTS     32 6
-#define MSPEL_MODE_2_ADDSHIFT_CONSTANTS     8  4
-#define MSPEL_MODE_3_ADDSHIFT_CONSTANTS     32 6
-
-@ Setup constants in registers for a subsequent use of mspel_filter{,.16}.
-.macro mspel_constants typesize reg_a reg_b reg_c reg_d filter_a filter_b filter_c filter_d reg_add filter_add_register
-  @ Define double-word register aliases. Typesize should be i8 or i16.
-  ra .dn \reg_a\().\typesize
-  rb .dn \reg_b\().\typesize
-  rc .dn \reg_c\().\typesize
-  rd .dn \reg_d\().\typesize
-
-  @ Only set the register if the value is not 1 and unique
-  .if \filter_a != 1
-        vmov            ra,  #\filter_a              @ ra = filter_a
-  .endif
-        vmov            rb,  #\filter_b              @ rb = filter_b
-  .if \filter_b != \filter_c
-        vmov            rc,  #\filter_c              @ rc = filter_c
-  .endif
-  .if \filter_d != 1
-        vmov            rd,  #\filter_d              @ rd = filter_d
-  .endif
-  @ vdup to double the size of typesize
-  .ifc \typesize,i8
-        vdup.16         \reg_add,  \filter_add_register     @ reg_add = filter_add_register
-  .else
-        vdup.32         \reg_add,  \filter_add_register     @ reg_add = filter_add_register
-  .endif
-
-  .unreq ra
-  .unreq rb
-  .unreq rc
-  .unreq rd
-.endm
-
-@ After mspel_constants has been used, do the filtering.
-.macro mspel_filter acc dest src0 src1 src2 src3 filter_a filter_b filter_c filter_d reg_a reg_b reg_c reg_d reg_add filter_shift narrow=1
-  .if \filter_a != 1
-        @ If filter_a != 1, then we need a move and subtract instruction
-        vmov            \acc,  \reg_add                     @ acc = reg_add
-        vmlsl.u8        \acc,  \reg_a,  \src0               @ acc -= filter_a * src[-stride]
-  .else
-        @ If filter_a is 1, then just subtract without an extra move
-        vsubw.u8        \acc,  \reg_add,  \src0             @ acc = reg_add - src[-stride]      @ since filter_a == 1
-  .endif
-        vmlal.u8        \acc,  \reg_b,  \src1               @ acc += filter_b * src[0]
-  .if \filter_b != \filter_c
-        vmlal.u8        \acc,  \reg_c,  \src2               @ acc += filter_c * src[stride]
-  .else
-        @ If filter_b is the same as filter_c, use the same reg_b register
-        vmlal.u8        \acc,  \reg_b,  \src2               @ acc += filter_c * src[stride]     @ where filter_c == filter_b
-  .endif
-  .if \filter_d != 1
-        @ If filter_d != 1, then do a multiply accumulate
-        vmlsl.u8        \acc,  \reg_d,  \src3               @ acc -= filter_d * src[stride * 2]
-  .else
-        @ If filter_d is 1, then just do a subtract
-        vsubw.u8        \acc,  \acc,    \src3               @ acc -= src[stride * 2]            @ since filter_d == 1
-  .endif
-  .if \narrow
-        vqshrun.s16     \dest, \acc,    #\filter_shift      @ dest = clip_uint8(acc >> filter_shift)
-  .else
-        vshr.s16        \dest, \acc,    #\filter_shift      @ dest = acc >> filter_shift
-  .endif
-.endm
-
-@ This is similar to mspel_filter, but the input is 16-bit instead of 8-bit and narrow=0 is not supported.
-.macro mspel_filter.16 acc0 acc1 acc0_0 acc0_1 dest src0 src1 src2 src3 src4 src5 src6 src7 filter_a filter_b filter_c filter_d reg_a reg_b reg_c reg_d reg_add filter_shift
-  .if \filter_a != 1
-        vmov            \acc0,  \reg_add
-        vmov            \acc1,  \reg_add
-        vmlsl.s16       \acc0,  \reg_a,  \src0
-        vmlsl.s16       \acc1,  \reg_a,  \src1
-  .else
-        vsubw.s16       \acc0,  \reg_add,  \src0
-        vsubw.s16       \acc1,  \reg_add,  \src1
-  .endif
-        vmlal.s16       \acc0,  \reg_b,  \src2
-        vmlal.s16       \acc1,  \reg_b,  \src3
-  .if \filter_b != \filter_c
-        vmlal.s16       \acc0,  \reg_c,  \src4
-        vmlal.s16       \acc1,  \reg_c,  \src5
-  .else
-        vmlal.s16       \acc0,  \reg_b,  \src4
-        vmlal.s16       \acc1,  \reg_b,  \src5
-  .endif
-  .if \filter_d != 1
-        vmlsl.s16       \acc0,  \reg_d,  \src6
-        vmlsl.s16       \acc1,  \reg_d,  \src7
-  .else
-        vsubw.s16       \acc0,  \acc0,   \src6
-        vsubw.s16       \acc1,  \acc1,   \src7
-  .endif
-        @ Use acc0_0 and acc0_1 as temp space
-        vqshrun.s32     \acc0_0, \acc0,  #\filter_shift     @ Shift and narrow with saturation from s32 to u16
-        vqshrun.s32     \acc0_1, \acc1,  #\filter_shift
-        vqmovn.u16      \dest,  \acc0                       @ Narrow with saturation from u16 to u8
-.endm
-
-@ Register usage for put_vc1_mspel_mc functions. Registers marked 'hv' are only used in put_vc1_mspel_mc_hv.
-@
-@   r0        adjusted dst
-@   r1        adjusted src
-@   r2        stride
-@   r3        adjusted rnd
-@   r4 [hv]   tmp
-@   r11 [hv]  sp saved
-@   r12       loop counter
-@   d0        src[-stride]
-@   d1        src[0]
-@   d2        src[stride]
-@   d3        src[stride * 2]
-@   q0 [hv]   src[-stride]
-@   q1 [hv]   src[0]
-@   q2 [hv]   src[stride]
-@   q3 [hv]   src[stride * 2]
-@   d21       often result from mspel_filter
-@   q11       accumulator 0
-@   q12 [hv]  accumulator 1
-@   q13       accumulator initial value
-@   d28       filter_a
-@   d29       filter_b
-@   d30       filter_c
-@   d31       filter_d
-
-@ (uint8_t *dst [r0], const uint8_t *src [r1], ptrdiff_t stride [r2], int rnd [r3])
-.macro put_vc1_mspel_mc_hv hmode vmode filter_h_a filter_h_b filter_h_c filter_h_d filter_v_a filter_v_b filter_v_c filter_v_d filter_add filter_shift
-function ff_put_vc1_mspel_mc\hmode\()\vmode\()_neon, export=1
-        push            {r4, r11, lr}
-        mov             r11, sp                 @ r11 = stack pointer before realignmnet
-A       bic             sp,  sp,  #15           @ sp = round down to multiple of 16 bytes
-T       bic             r4,  r11, #15
-T       mov             sp,  r4
-        sub             sp,  sp,  #(8*2*16)     @ make space for 8 rows * 2 byte per element * 16 elements per row (to fit 11 actual elements per row)
-        mov             r4,  sp                 @ r4 = int16_t tmp[8 * 16]
-
-        sub             r1,  r1,  #1            @ src -= 1
-  .if \filter_add != 0
-        add             r3,  r3,  #\filter_add  @ r3 = filter_add + rnd
-  .endif
-        mov             r12, #8                 @ loop counter
-        sub             r1,  r1,  r2            @ r1 = &src[-stride]      @ slide back
-
-        @ Do vertical filtering from src into tmp
-        mspel_constants i8 d28 d29 d30 d31 \filter_v_a \filter_v_b \filter_v_c \filter_v_d q13 r3
-
-        vld1.64         {d0,d1}, [r1], r2
-        vld1.64         {d2,d3}, [r1], r2
-        vld1.64         {d4,d5}, [r1], r2
-
-1:
-        subs            r12,  r12,  #4
-
-        vld1.64         {d6,d7}, [r1], r2
-        mspel_filter    q11 q11 d0 d2 d4 d6 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
-        mspel_filter    q12 q12 d1 d3 d5 d7 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
-        vst1.64         {q11,q12}, [r4,:128]!   @ store and increment
-
-        vld1.64         {d0,d1}, [r1], r2
-        mspel_filter    q11 q11 d2 d4 d6 d0 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
-        mspel_filter    q12 q12 d3 d5 d7 d1 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
-        vst1.64         {q11,q12}, [r4,:128]!   @ store and increment
-
-        vld1.64         {d2,d3}, [r1], r2
-        mspel_filter    q11 q11 d4 d6 d0 d2 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
-        mspel_filter    q12 q12 d5 d7 d1 d3 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
-        vst1.64         {q11,q12}, [r4,:128]!   @ store and increment
-
-        vld1.64         {d4,d5}, [r1], r2
-        mspel_filter    q11 q11 d6 d0 d2 d4 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
-        mspel_filter    q12 q12 d7 d1 d3 d5 \filter_v_a \filter_v_b \filter_v_c \filter_v_d d28 d29 d30 d31 q13 \filter_shift narrow=0
-        vst1.64         {q11,q12}, [r4,:128]!   @ store and increment
-
-        bne             1b
-
-        rsb             r3,   r3,  #(64 + \filter_add)      @ r3 = (64 + filter_add) - r3
-        mov             r12,  #8                @ loop counter
-        mov             r4,   sp                @ r4 = tmp
-
-        @ Do horizontal filtering from temp to dst
-        mspel_constants i16 d28 d29 d30 d31 \filter_h_a \filter_h_b \filter_h_c \filter_h_d q13 r3
-
-2:
-        subs            r12,  r12,  #1
-
-        vld1.64         {q0,q1}, [r4,:128]!     @ read one line of tmp
-        vext.16         q2,   q0,   q1,  #2
-        vext.16         q3,   q0,   q1,  #3
-        vext.16         q1,   q0,   q1,  #1     @ do last because it writes to q1 which is read by the other vext instructions
-
-        mspel_filter.16 q11 q12 d22 d23 d21 d0 d1 d2 d3 d4 d5 d6 d7 \filter_h_a \filter_h_b \filter_h_c \filter_h_d d28 d29 d30 d31 q13 7
-
-        vst1.64         {d21}, [r0,:64], r2     @ store and increment dst
-
-        bne             2b
-
-        mov             sp,  r11
-        pop             {r4, r11, pc}
-endfunc
-.endm
-
-@ Use C preprocessor and assembler macros to expand to functions for horizontal and vertical filtering.
-#define PUT_VC1_MSPEL_MC_HV(hmode, vmode)   \
-    put_vc1_mspel_mc_hv hmode vmode \
-        MSPEL_MODE_ ## hmode ## _MUL_CONSTANTS \
-        MSPEL_MODE_ ## vmode ## _MUL_CONSTANTS \
-        MSPEL_MODES_ ## hmode ## vmode ## _ADDSHIFT_CONSTANTS
-
-PUT_VC1_MSPEL_MC_HV(1, 1)
-PUT_VC1_MSPEL_MC_HV(1, 2)
-PUT_VC1_MSPEL_MC_HV(1, 3)
-PUT_VC1_MSPEL_MC_HV(2, 1)
-PUT_VC1_MSPEL_MC_HV(2, 2)
-PUT_VC1_MSPEL_MC_HV(2, 3)
-PUT_VC1_MSPEL_MC_HV(3, 1)
-PUT_VC1_MSPEL_MC_HV(3, 2)
-PUT_VC1_MSPEL_MC_HV(3, 3)
-
-#undef PUT_VC1_MSPEL_MC_HV
-
-.macro  put_vc1_mspel_mc_h_only hmode filter_a filter_b filter_c filter_d filter_add filter_shift
-function ff_put_vc1_mspel_mc\hmode\()0_neon, export=1
-        rsb             r3,   r3,   #\filter_add        @ r3 = filter_add - r = filter_add - rnd
-        mov             r12,  #8                        @ loop counter
-        sub             r1,   r1,   #1                  @ slide back, using immediate
-
-        mspel_constants i8 d28 d29 d30 d31 \filter_a \filter_b \filter_c \filter_d q13 r3
-
-1:
-        subs            r12,  r12,  #1
-
-        vld1.64         {d0,d1}, [r1], r2               @ read 16 bytes even though we only need 11, also src += stride
-        vext.8          d2,   d0,   d1,  #2
-        vext.8          d3,   d0,   d1,  #3
-        vext.8          d1,   d0,   d1,  #1             @ do last because it writes to d1 which is read by the other vext instructions
-
-        mspel_filter    q11 d21 d0 d1 d2 d3 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
-
-        vst1.64         {d21}, [r0,:64], r2             @ store and increment dst
-
-        bne             1b
-
-        bx              lr
-endfunc
-.endm
-
-@ Use C preprocessor and assembler macros to expand to functions for horizontal only filtering.
-#define PUT_VC1_MSPEL_MC_H_ONLY(hmode) \
-        put_vc1_mspel_mc_h_only hmode MSPEL_MODE_ ## hmode ## _MUL_CONSTANTS MSPEL_MODE_ ## hmode ## _ADDSHIFT_CONSTANTS
-
-PUT_VC1_MSPEL_MC_H_ONLY(1)
-PUT_VC1_MSPEL_MC_H_ONLY(2)
-PUT_VC1_MSPEL_MC_H_ONLY(3)
-
-#undef PUT_VC1_MSPEL_MC_H_ONLY
-
-@ (uint8_t *dst [r0], const uint8_t *src [r1], ptrdiff_t stride [r2], int rnd [r3])
-.macro put_vc1_mspel_mc_v_only vmode filter_a filter_b filter_c filter_d filter_add filter_shift
-function ff_put_vc1_mspel_mc0\vmode\()_neon, export=1
-        add             r3,   r3,   #\filter_add - 1    @ r3 = filter_add - r = filter_add - (1 - rnd) = filter_add - 1 + rnd
-        mov             r12,  #8                        @ loop counter
-        sub             r1,   r1,   r2                  @ r1 = &src[-stride]      @ slide back
-
-        mspel_constants i8 d28 d29 d30 d31 \filter_a \filter_b \filter_c \filter_d q13 r3
-
-        vld1.64         {d0},  [r1], r2                 @ d0 = src[-stride]
-        vld1.64         {d1},  [r1], r2                 @ d1 = src[0]
-        vld1.64         {d2},  [r1], r2                 @ d2 = src[stride]
-
-1:
-        subs            r12,  r12,  #4
-
-        vld1.64         {d3},  [r1], r2                 @ d3 = src[stride * 2]
-        mspel_filter    q11 d21 d0 d1 d2 d3 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
-        vst1.64         {d21}, [r0,:64], r2             @ store and increment dst
-
-        vld1.64         {d0},  [r1], r2                 @ d0 = next line
-        mspel_filter    q11 d21 d1 d2 d3 d0 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
-        vst1.64         {d21}, [r0,:64], r2             @ store and increment dst
-
-        vld1.64         {d1},  [r1], r2                 @ d1 = next line
-        mspel_filter    q11 d21 d2 d3 d0 d1 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
-        vst1.64         {d21}, [r0,:64], r2             @ store and increment dst
-
-        vld1.64         {d2},  [r1], r2                 @ d2 = next line
-        mspel_filter    q11 d21 d3 d0 d1 d2 \filter_a \filter_b \filter_c \filter_d d28 d29 d30 d31 q13 \filter_shift
-        vst1.64         {d21}, [r0,:64], r2             @ store and increment dst
-
-        bne             1b
-
-        bx              lr
-endfunc
-.endm
-
-@ Use C preprocessor and assembler macros to expand to functions for vertical only filtering.
-#define PUT_VC1_MSPEL_MC_V_ONLY(vmode) \
-        put_vc1_mspel_mc_v_only vmode MSPEL_MODE_ ## vmode ## _MUL_CONSTANTS MSPEL_MODE_ ## vmode ## _ADDSHIFT_CONSTANTS
-
-PUT_VC1_MSPEL_MC_V_ONLY(1)
-PUT_VC1_MSPEL_MC_V_ONLY(2)
-PUT_VC1_MSPEL_MC_V_ONLY(3)
-
-#undef PUT_VC1_MSPEL_MC_V_ONLY
-
-function ff_put_pixels8x8_neon, export=1
-        vld1.64         {d0}, [r1], r2
-        vld1.64         {d1}, [r1], r2
-        vld1.64         {d2}, [r1], r2
-        vld1.64         {d3}, [r1], r2
-        vld1.64         {d4}, [r1], r2
-        vld1.64         {d5}, [r1], r2
-        vld1.64         {d6}, [r1], r2
-        vld1.64         {d7}, [r1]
-        vst1.64         {d0}, [r0,:64], r2
-        vst1.64         {d1}, [r0,:64], r2
-        vst1.64         {d2}, [r0,:64], r2
-        vst1.64         {d3}, [r0,:64], r2
-        vst1.64         {d4}, [r0,:64], r2
-        vst1.64         {d5}, [r0,:64], r2
-        vst1.64         {d6}, [r0,:64], r2
-        vst1.64         {d7}, [r0,:64]
-        bx              lr
-endfunc
-
-function ff_vc1_inv_trans_8x8_dc_neon, export=1
-        ldrsh           r2, [r2]              @ int dc = block[0];
-
-        vld1.64         {d0},  [r0,:64], r1
-        vld1.64         {d1},  [r0,:64], r1
-        vld1.64         {d4},  [r0,:64], r1
-        vld1.64         {d5},  [r0,:64], r1
-
-        add             r2, r2, r2, lsl #1    @ dc = (3 * dc +  1) >> 1;
-        vld1.64         {d6},  [r0,:64], r1
-        add             r2, r2, #1
-        vld1.64         {d7},  [r0,:64], r1
-        vld1.64         {d16}, [r0,:64], r1
-        vld1.64         {d17}, [r0,:64], r1
-        asr             r2, r2, #1
-
-        sub             r0,  r0,  r1, lsl #3  @ restore r0 to original value
-
-        add             r2, r2, r2, lsl #1    @ dc = (3 * dc + 16) >> 5;
-        add             r2, r2, #16
-        asr             r2, r2, #5
-
-        vdup.16         q1,  r2               @ dc
-
-        vaddw.u8        q9,   q1,  d0
-        vaddw.u8        q10,  q1,  d1
-        vaddw.u8        q11,  q1,  d4
-        vaddw.u8        q12,  q1,  d5
-        vqmovun.s16     d0,  q9
-        vqmovun.s16     d1,  q10
-        vqmovun.s16     d4,  q11
-        vst1.64         {d0},  [r0,:64], r1
-        vqmovun.s16     d5,  q12
-        vst1.64         {d1},  [r0,:64], r1
-        vaddw.u8        q13,  q1,  d6
-        vst1.64         {d4},  [r0,:64], r1
-        vaddw.u8        q14,  q1,  d7
-        vst1.64         {d5},  [r0,:64], r1
-        vaddw.u8        q15,  q1,  d16
-        vaddw.u8        q1,   q1,  d17        @ this destroys q1
-        vqmovun.s16     d6,  q13
-        vqmovun.s16     d7,  q14
-        vqmovun.s16     d16, q15
-        vqmovun.s16     d17, q1
-        vst1.64         {d6},  [r0,:64], r1
-        vst1.64         {d7},  [r0,:64], r1
-        vst1.64         {d16}, [r0,:64], r1
-        vst1.64         {d17}, [r0,:64]
-        bx              lr
-endfunc
-
-function ff_vc1_inv_trans_8x4_dc_neon, export=1
-        ldrsh           r2, [r2]              @ int dc = block[0];
-
-        vld1.64         {d0},  [r0,:64], r1
-        vld1.64         {d1},  [r0,:64], r1
-        vld1.64         {d4},  [r0,:64], r1
-        vld1.64         {d5},  [r0,:64], r1
-
-        add             r2, r2, r2, lsl #1    @ dc = ( 3 * dc +  1) >> 1;
-
-        sub             r0,  r0,  r1, lsl #2  @ restore r0 to original value
-
-        add             r2, r2, #1
-        asr             r2, r2, #1
-
-        add             r2, r2, r2, lsl #4    @ dc = (17 * dc + 64) >> 7;
-        add             r2, r2, #64
-        asr             r2, r2, #7
-
-        vdup.16         q1,  r2               @ dc
-
-        vaddw.u8        q3,  q1,  d0
-        vaddw.u8        q8,  q1,  d1
-        vaddw.u8        q9,  q1,  d4
-        vaddw.u8        q10, q1,  d5
-        vqmovun.s16     d0,  q3
-        vqmovun.s16     d1,  q8
-        vqmovun.s16     d4,  q9
-        vst1.64         {d0},  [r0,:64], r1
-        vqmovun.s16     d5,  q10
-        vst1.64         {d1},  [r0,:64], r1
-        vst1.64         {d4},  [r0,:64], r1
-        vst1.64         {d5},  [r0,:64]
-        bx              lr
-endfunc
-
-function ff_vc1_inv_trans_4x8_dc_neon, export=1
-        ldrsh           r2, [r2]              @ int dc = block[0];
-
-        vld1.32         {d0[]},   [r0,:32], r1
-        vld1.32         {d1[]},   [r0,:32], r1
-        vld1.32         {d0[1]},  [r0,:32], r1
-        vld1.32         {d1[1]},  [r0,:32], r1
-
-        add             r2, r2, r2, lsl #4    @ dc = (17 * dc +  4) >> 3;
-        vld1.32         {d4[]},   [r0,:32], r1
-        add             r2, r2, #4
-        vld1.32         {d5[]},   [r0,:32], r1
-        vld1.32         {d4[1]},  [r0,:32], r1
-        asr             r2, r2, #3
-        vld1.32         {d5[1]},  [r0,:32], r1
-
-        add             r2, r2, r2, lsl #1    @ dc = (12 * dc + 64) >> 7;
-
-        sub             r0,  r0,  r1, lsl #3  @ restore r0 to original value
-
-        lsl             r2, r2, #2
-        add             r2, r2, #64
-        asr             r2, r2, #7
-
-        vdup.16         q1,  r2               @ dc
-
-        vaddw.u8        q3,  q1,  d0
-        vaddw.u8        q8,  q1,  d1
-        vaddw.u8        q9,  q1,  d4
-        vaddw.u8        q10, q1,  d5
-        vqmovun.s16     d0,  q3
-        vst1.32         {d0[0]},  [r0,:32], r1
-        vqmovun.s16     d1,  q8
-        vst1.32         {d1[0]},  [r0,:32], r1
-        vqmovun.s16     d4,  q9
-        vst1.32         {d0[1]},  [r0,:32], r1
-        vqmovun.s16     d5,  q10
-        vst1.32         {d1[1]},  [r0,:32], r1
-        vst1.32         {d4[0]},  [r0,:32], r1
-        vst1.32         {d5[0]},  [r0,:32], r1
-        vst1.32         {d4[1]},  [r0,:32], r1
-        vst1.32         {d5[1]},  [r0,:32]
-        bx              lr
-endfunc
-
-function ff_vc1_inv_trans_4x4_dc_neon, export=1
-        ldrsh           r2, [r2]              @ int dc = block[0];
-
-        vld1.32         {d0[]},   [r0,:32], r1
-        vld1.32         {d1[]},   [r0,:32], r1
-        vld1.32         {d0[1]},  [r0,:32], r1
-        vld1.32         {d1[1]},  [r0,:32], r1
-
-        add             r2, r2, r2, lsl #4    @ dc = (17 * dc +  4) >> 3;
-
-        sub             r0,  r0,  r1, lsl #2  @ restore r0 to original value
-
-        add             r2, r2, #4
-        asr             r2, r2, #3
-
-        add             r2, r2, r2, lsl #4    @ dc = (17 * dc + 64) >> 7;
-        add             r2, r2, #64
-        asr             r2, r2, #7
-
-        vdup.16         q1,  r2               @ dc
-
-        vaddw.u8        q2,  q1,  d0
-        vaddw.u8        q3,  q1,  d1
-        vqmovun.s16     d0,  q2
-        vst1.32         {d0[0]},  [r0,:32], r1
-        vqmovun.s16     d1,  q3
-        vst1.32         {d1[0]},  [r0,:32], r1
-        vst1.32         {d0[1]},  [r0,:32], r1
-        vst1.32         {d1[1]},  [r0,:32]
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/videodsp_arm.h b/deps/libav/libavcodec/arm/videodsp_arm.h
deleted file mode 100644
index a708759..0000000
--- a/deps/libav/libavcodec/arm/videodsp_arm.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_VIDEODSP_ARM_H
-#define AVCODEC_ARM_VIDEODSP_ARM_H
-
-#include "libavcodec/avcodec.h"
-#include "libavcodec/videodsp.h"
-
-void ff_videodsp_init_armv5te(VideoDSPContext* ctx, int bpc);
-
-#endif /* AVCODEC_ARM_VIDEODSP_ARM_H */
diff --git a/deps/libav/libavcodec/arm/videodsp_armv5te.S b/deps/libav/libavcodec/arm/videodsp_armv5te.S
deleted file mode 100644
index 055736d..0000000
--- a/deps/libav/libavcodec/arm/videodsp_armv5te.S
+++ /dev/null
@@ -1,31 +0,0 @@
-@
-@ ARMv5te optimized DSP utils
-@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
-@
-@ This file is part of Libav.
-@
-@ Libav 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.
-@
-@ Libav 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 Libav; if not, write to the Free Software
-@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-@
-
-#include "config.h"
-#include "libavutil/arm/asm.S"
-
-function ff_prefetch_arm, export=1
-        subs            r2,  r2,  #1
-        pld             [r0]
-        add             r0,  r0,  r1
-        bne             X(ff_prefetch_arm)
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/videodsp_init_arm.c b/deps/libav/libavcodec/arm/videodsp_init_arm.c
deleted file mode 100644
index 20c6e4a..0000000
--- a/deps/libav/libavcodec/arm/videodsp_init_arm.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2012 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/videodsp.h"
-#include "videodsp_arm.h"
-
-av_cold void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc)
-{
-    int cpu_flags = av_get_cpu_flags();
-    if (have_armv5te(cpu_flags)) ff_videodsp_init_armv5te(ctx, bpc);
-}
diff --git a/deps/libav/libavcodec/arm/videodsp_init_armv5te.c b/deps/libav/libavcodec/arm/videodsp_init_armv5te.c
deleted file mode 100644
index 832191f..0000000
--- a/deps/libav/libavcodec/arm/videodsp_init_armv5te.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2012 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/videodsp.h"
-#include "videodsp_arm.h"
-
-void ff_prefetch_arm(uint8_t *mem, ptrdiff_t stride, int h);
-
-av_cold void ff_videodsp_init_armv5te(VideoDSPContext *ctx, int bpc)
-{
-    ctx->prefetch = ff_prefetch_arm;
-}
diff --git a/deps/libav/libavcodec/arm/vorbisdsp_init_arm.c b/deps/libav/libavcodec/arm/vorbisdsp_init_arm.c
deleted file mode 100644
index 853ba2d..0000000
--- a/deps/libav/libavcodec/arm/vorbisdsp_init_arm.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/vorbisdsp.h"
-
-void ff_vorbis_inverse_coupling_neon(float *mag, float *ang,
-                                     intptr_t blocksize);
-
-av_cold void ff_vorbisdsp_init_arm(VorbisDSPContext *c)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        c->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/vorbisdsp_neon.S b/deps/libav/libavcodec/arm/vorbisdsp_neon.S
deleted file mode 100644
index 7df876c..0000000
--- a/deps/libav/libavcodec/arm/vorbisdsp_neon.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * ARM NEON optimised DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-function ff_vorbis_inverse_coupling_neon, export=1
-        vmov.i32        q10, #1<<31
-        subs            r2,  r2,  #4
-        mov             r3,  r0
-        mov             r12, r1
-        beq             3f
-
-        vld1.32         {d24-d25},[r1,:128]!
-        vld1.32         {d22-d23},[r0,:128]!
-        vcle.s32        q8,  q12, #0
-        vand            q9,  q11, q10
-        veor            q12, q12, q9
-        vand            q2,  q12, q8
-        vbic            q3,  q12, q8
-        vadd.f32        q12, q11, q2
-        vsub.f32        q11, q11, q3
-1:      vld1.32         {d2-d3},  [r1,:128]!
-        vld1.32         {d0-d1},  [r0,:128]!
-        vcle.s32        q8,  q1,  #0
-        vand            q9,  q0,  q10
-        veor            q1,  q1,  q9
-        vst1.32         {d24-d25},[r3, :128]!
-        vst1.32         {d22-d23},[r12,:128]!
-        vand            q2,  q1,  q8
-        vbic            q3,  q1,  q8
-        vadd.f32        q1,  q0,  q2
-        vsub.f32        q0,  q0,  q3
-        subs            r2,  r2,  #8
-        ble             2f
-        vld1.32         {d24-d25},[r1,:128]!
-        vld1.32         {d22-d23},[r0,:128]!
-        vcle.s32        q8,  q12, #0
-        vand            q9,  q11, q10
-        veor            q12, q12, q9
-        vst1.32         {d2-d3},  [r3, :128]!
-        vst1.32         {d0-d1},  [r12,:128]!
-        vand            q2,  q12, q8
-        vbic            q3,  q12, q8
-        vadd.f32        q12, q11, q2
-        vsub.f32        q11, q11, q3
-        b               1b
-
-2:      vst1.32         {d2-d3},  [r3, :128]!
-        vst1.32         {d0-d1},  [r12,:128]!
-        it              lt
-        bxlt            lr
-
-3:      vld1.32         {d2-d3},  [r1,:128]
-        vld1.32         {d0-d1},  [r0,:128]
-        vcle.s32        q8,  q1,  #0
-        vand            q9,  q0,  q10
-        veor            q1,  q1,  q9
-        vand            q2,  q1,  q8
-        vbic            q3,  q1,  q8
-        vadd.f32        q1,  q0,  q2
-        vsub.f32        q0,  q0,  q3
-        vst1.32         {d2-d3},  [r0,:128]!
-        vst1.32         {d0-d1},  [r1,:128]!
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/vp3dsp_init_arm.c b/deps/libav/libavcodec/arm/vp3dsp_init_arm.c
deleted file mode 100644
index 1ab0852..0000000
--- a/deps/libav/libavcodec/arm/vp3dsp_init_arm.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/dsputil.h"
-#include "libavcodec/vp3dsp.h"
-
-void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
-void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
-void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, int16_t *data);
-
-void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
-void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);
-
-av_cold void ff_vp3dsp_init_arm(VP3DSPContext *c, int flags)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        c->idct_put      = ff_vp3_idct_put_neon;
-        c->idct_add      = ff_vp3_idct_add_neon;
-        c->idct_dc_add   = ff_vp3_idct_dc_add_neon;
-        c->v_loop_filter = ff_vp3_v_loop_filter_neon;
-        c->h_loop_filter = ff_vp3_h_loop_filter_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/vp3dsp_neon.S b/deps/libav/libavcodec/arm/vp3dsp_neon.S
deleted file mode 100644
index 58bd97d..0000000
--- a/deps/libav/libavcodec/arm/vp3dsp_neon.S
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) 2009 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-const   vp3_idct_constants, align=4
-.short 64277, 60547, 54491, 46341, 36410, 25080, 12785
-endconst
-
-#define xC1S7 d0[0]
-#define xC2S6 d0[1]
-#define xC3S5 d0[2]
-#define xC4S4 d0[3]
-#define xC5S3 d1[0]
-#define xC6S2 d1[1]
-#define xC7S1 d1[2]
-
-.macro vp3_loop_filter
-    vsubl.u8        q3,  d18, d17
-    vsubl.u8        q2,  d16, d19
-    vadd.i16        q1,  q3,  q3
-    vadd.i16        q2,  q2,  q3
-    vadd.i16        q0,  q1,  q2
-    vrshr.s16       q0,  q0,  #3
-    vmovl.u8        q9,  d18
-    vdup.u16        q15, r2
-
-    vabs.s16        q1,  q0
-    vshr.s16        q0,  q0,  #15
-    vqsub.u16       q2,  q15, q1
-    vqsub.u16       q3,  q2,  q1
-    vsub.i16        q1,  q2,  q3
-    veor            q1,  q1,  q0
-    vsub.i16        q0,  q1,  q0
-
-    vaddw.u8        q2,  q0,  d17
-    vsub.i16        q3,  q9,  q0
-    vqmovun.s16     d0,  q2
-    vqmovun.s16     d1,  q3
-.endm
-
-function ff_vp3_v_loop_filter_neon, export=1
-    sub             ip,  r0,  r1
-    sub             r0,  r0,  r1,  lsl #1
-    vld1.64         {d16}, [r0,:64], r1
-    vld1.64         {d17}, [r0,:64], r1
-    vld1.64         {d18}, [r0,:64], r1
-    vld1.64         {d19}, [r0,:64], r1
-    ldrb            r2,    [r2, #129*4]
-
-    vp3_loop_filter
-
-    vst1.64         {d0},  [ip,:64], r1
-    vst1.64         {d1},  [ip,:64], r1
-    bx              lr
-endfunc
-
-function ff_vp3_h_loop_filter_neon, export=1
-    sub             ip,  r0,  #1
-    sub             r0,  r0,  #2
-    vld1.32         {d16[]},  [r0], r1
-    vld1.32         {d17[]},  [r0], r1
-    vld1.32         {d18[]},  [r0], r1
-    vld1.32         {d19[]},  [r0], r1
-    vld1.32         {d16[1]}, [r0], r1
-    vld1.32         {d17[1]}, [r0], r1
-    vld1.32         {d18[1]}, [r0], r1
-    vld1.32         {d19[1]}, [r0], r1
-    ldrb            r2,  [r2, #129*4]
-
-    vtrn.8          d16, d17
-    vtrn.8          d18, d19
-    vtrn.16         d16, d18
-    vtrn.16         d17, d19
-
-    vp3_loop_filter
-
-    vtrn.8          d0,  d1
-
-    vst1.16         {d0[0]}, [ip], r1
-    vst1.16         {d1[0]}, [ip], r1
-    vst1.16         {d0[1]}, [ip], r1
-    vst1.16         {d1[1]}, [ip], r1
-    vst1.16         {d0[2]}, [ip], r1
-    vst1.16         {d1[2]}, [ip], r1
-    vst1.16         {d0[3]}, [ip], r1
-    vst1.16         {d1[3]}, [ip], r1
-    bx              lr
-endfunc
-
-
-function vp3_idct_start_neon
-    vpush           {d8-d15}
-    vmov.i16        q4,  #0
-    vmov.i16        q5,  #0
-    movrel          r3,  vp3_idct_constants
-    vld1.64         {d0-d1},   [r3,:128]
-    vld1.64         {d16-d19}, [r2,:128]
-    vst1.64         {q4-q5},   [r2,:128]!
-    vld1.64         {d20-d23}, [r2,:128]
-    vst1.64         {q4-q5},   [r2,:128]!
-    vld1.64         {d24-d27}, [r2,:128]
-    vst1.64         {q4-q5},   [r2,:128]!
-    vadd.s16        q1,  q8,  q12
-    vsub.s16        q8,  q8,  q12
-    vld1.64         {d28-d31}, [r2,:128]
-    vst1.64         {q4-q5},   [r2,:128]!
-
-vp3_idct_core_neon:
-    vmull.s16       q2,  d18, xC1S7     // (ip[1] * C1) << 16
-    vmull.s16       q3,  d19, xC1S7
-    vmull.s16       q4,  d2,  xC4S4     // ((ip[0] + ip[4]) * C4) << 16
-    vmull.s16       q5,  d3,  xC4S4
-    vmull.s16       q6,  d16, xC4S4     // ((ip[0] - ip[4]) * C4) << 16
-    vmull.s16       q7,  d17, xC4S4
-    vshrn.s32       d4,  q2,  #16
-    vshrn.s32       d5,  q3,  #16
-    vshrn.s32       d6,  q4,  #16
-    vshrn.s32       d7,  q5,  #16
-    vshrn.s32       d8,  q6,  #16
-    vshrn.s32       d9,  q7,  #16
-    vadd.s16        q12, q1,  q3        // E = (ip[0] + ip[4]) * C4
-    vadd.s16        q8,  q8,  q4        // F = (ip[0] - ip[4]) * C4
-    vadd.s16        q1,  q2,  q9        // ip[1] * C1
-
-    vmull.s16       q2,  d30, xC1S7     // (ip[7] * C1) << 16
-    vmull.s16       q3,  d31, xC1S7
-    vmull.s16       q4,  d30, xC7S1     // (ip[7] * C7) << 16
-    vmull.s16       q5,  d31, xC7S1
-    vmull.s16       q6,  d18, xC7S1     // (ip[1] * C7) << 16
-    vmull.s16       q7,  d19, xC7S1
-    vshrn.s32       d4,  q2,  #16
-    vshrn.s32       d5,  q3,  #16
-    vshrn.s32       d6,  q4,  #16       // ip[7] * C7
-    vshrn.s32       d7,  q5,  #16
-    vshrn.s32       d8,  q6,  #16       // ip[1] * C7
-    vshrn.s32       d9,  q7,  #16
-    vadd.s16        q2,  q2,  q15       // ip[7] * C1
-    vadd.s16        q9,  q1,  q3        // A = ip[1] * C1 + ip[7] * C7
-    vsub.s16        q15, q4,  q2        // B = ip[1] * C7 - ip[7] * C1
-
-    vmull.s16       q2,  d22, xC5S3     // (ip[3] * C5) << 16
-    vmull.s16       q3,  d23, xC5S3
-    vmull.s16       q4,  d22, xC3S5     // (ip[3] * C3) << 16
-    vmull.s16       q5,  d23, xC3S5
-    vmull.s16       q6,  d26, xC5S3     // (ip[5] * C5) << 16
-    vmull.s16       q7,  d27, xC5S3
-    vshrn.s32       d4,  q2,  #16
-    vshrn.s32       d5,  q3,  #16
-    vshrn.s32       d6,  q4,  #16
-    vshrn.s32       d7,  q5,  #16
-    vshrn.s32       d8,  q6,  #16
-    vshrn.s32       d9,  q7,  #16
-    vadd.s16        q3,  q3,  q11       // ip[3] * C3
-    vadd.s16        q4,  q4,  q13       // ip[5] * C5
-    vadd.s16        q1,  q2,  q11       // ip[3] * C5
-    vadd.s16        q11, q3,  q4        // C = ip[3] * C3 + ip[5] * C5
-
-    vmull.s16       q2,  d26, xC3S5     // (ip[5] * C3) << 16
-    vmull.s16       q3,  d27, xC3S5
-    vmull.s16       q4,  d20, xC2S6     // (ip[2] * C2) << 16
-    vmull.s16       q5,  d21, xC2S6
-    vmull.s16       q6,  d28, xC6S2     // (ip[6] * C6) << 16
-    vmull.s16       q7,  d29, xC6S2
-    vshrn.s32       d4,  q2,  #16
-    vshrn.s32       d5,  q3,  #16
-    vshrn.s32       d6,  q4,  #16
-    vshrn.s32       d7,  q5,  #16
-    vshrn.s32       d8,  q6,  #16       // ip[6] * C6
-    vshrn.s32       d9,  q7,  #16
-    vadd.s16        q2,  q2,  q13       // ip[5] * C3
-    vadd.s16        q3,  q3,  q10       // ip[2] * C2
-    vsub.s16        q13, q2,  q1        // D = ip[5] * C3 - ip[3] * C5
-    vsub.s16        q1,  q9,  q11       // (A - C)
-    vadd.s16        q11, q9,  q11       // Cd = A + C
-    vsub.s16        q9,  q15, q13       // (B - D)
-    vadd.s16        q13, q15, q13       // Dd = B + D
-    vadd.s16        q15, q3,  q4        // G = ip[2] * C2 + ip[6] * C6
-
-    vmull.s16       q2,  d2,  xC4S4     // ((A - C) * C4) << 16
-    vmull.s16       q3,  d3,  xC4S4
-    vmull.s16       q4,  d28, xC2S6     // (ip[6] * C2) << 16
-    vmull.s16       q5,  d29, xC2S6
-    vmull.s16       q6,  d20, xC6S2     // (ip[2] * C6) << 16
-    vmull.s16       q7,  d21, xC6S2
-    vshrn.s32       d4,  q2,  #16
-    vshrn.s32       d5,  q3,  #16
-    vshrn.s32       d6,  q4,  #16
-    vshrn.s32       d7,  q5,  #16
-    vshrn.s32       d8,  q6,  #16       // ip[2] * C6
-    vmull.s16       q5,  d18, xC4S4     // ((B - D) * C4) << 16
-    vmull.s16       q6,  d19, xC4S4
-    vshrn.s32       d9,  q7,  #16
-    vadd.s16        q3,  q3,  q14       // ip[6] * C2
-    vadd.s16        q10, q1,  q2        // Ad = (A - C) * C4
-    vsub.s16        q14, q4,  q3        // H = ip[2] * C6 - ip[6] * C2
-    bx              lr
-endfunc
-
-.macro VP3_IDCT_END type
-function vp3_idct_end_\type\()_neon
-.ifc \type, col
-    vdup.16         q0,  r3
-    vadd.s16        q12, q12, q0
-    vadd.s16        q8,  q8,  q0
-.endif
-
-    vshrn.s32       d2,  q5,  #16
-    vshrn.s32       d3,  q6,  #16
-    vadd.s16        q2,  q12, q15       // Gd  = E + G
-    vadd.s16        q9,  q1,  q9        // (B - D) * C4
-    vsub.s16        q12, q12, q15       // Ed  = E - G
-    vsub.s16        q3,  q8,  q10       // Fd  = F - Ad
-    vadd.s16        q10, q8,  q10       // Add = F + Ad
-    vadd.s16        q4,  q9,  q14       // Hd  = Bd + H
-    vsub.s16        q14, q9,  q14       // Bdd = Bd - H
-    vadd.s16        q8,  q2,  q11       // [0] = Gd + Cd
-    vsub.s16        q15, q2,  q11       // [7] = Gd - Cd
-    vadd.s16        q9,  q10, q4        // [1] = Add + Hd
-    vsub.s16        q10, q10, q4        // [2] = Add - Hd
-    vadd.s16        q11, q12, q13       // [3] = Ed + Dd
-    vsub.s16        q12, q12, q13       // [4] = Ed - Dd
-.ifc \type, row
-    vtrn.16         q8,  q9
-.endif
-    vadd.s16        q13, q3,  q14       // [5] = Fd + Bdd
-    vsub.s16        q14, q3,  q14       // [6] = Fd - Bdd
-
-.ifc \type, row
-    // 8x8 transpose
-    vtrn.16         q10, q11
-    vtrn.16         q12, q13
-    vtrn.16         q14, q15
-    vtrn.32         q8,  q10
-    vtrn.32         q9,  q11
-    vtrn.32         q12, q14
-    vtrn.32         q13, q15
-    vswp            d17, d24
-    vswp            d19, d26
-    vadd.s16        q1,  q8,  q12
-    vswp            d21, d28
-    vsub.s16        q8,  q8,  q12
-    vswp            d23, d30
-.endif
-    bx              lr
-endfunc
-.endm
-
-VP3_IDCT_END row
-VP3_IDCT_END col
-
-function ff_vp3_idct_put_neon, export=1
-    mov             ip,  lr
-    bl              vp3_idct_start_neon
-    bl              vp3_idct_end_row_neon
-    mov             r3,  #8
-    add             r3,  r3,  #2048         // convert signed pixel to unsigned
-    bl              vp3_idct_core_neon
-    bl              vp3_idct_end_col_neon
-    mov             lr,  ip
-    vpop            {d8-d15}
-
-    vqshrun.s16     d0,  q8,  #4
-    vqshrun.s16     d1,  q9,  #4
-    vqshrun.s16     d2,  q10, #4
-    vqshrun.s16     d3,  q11, #4
-    vst1.64         {d0}, [r0,:64], r1
-    vqshrun.s16     d4,  q12, #4
-    vst1.64         {d1}, [r0,:64], r1
-    vqshrun.s16     d5,  q13, #4
-    vst1.64         {d2}, [r0,:64], r1
-    vqshrun.s16     d6,  q14, #4
-    vst1.64         {d3}, [r0,:64], r1
-    vqshrun.s16     d7,  q15, #4
-    vst1.64         {d4}, [r0,:64], r1
-    vst1.64         {d5}, [r0,:64], r1
-    vst1.64         {d6}, [r0,:64], r1
-    vst1.64         {d7}, [r0,:64], r1
-    bx              lr
-endfunc
-
-function ff_vp3_idct_add_neon, export=1
-    mov             ip,  lr
-    bl              vp3_idct_start_neon
-    bl              vp3_idct_end_row_neon
-    mov             r3,  #8
-    bl              vp3_idct_core_neon
-    bl              vp3_idct_end_col_neon
-    mov             lr,  ip
-    vpop            {d8-d15}
-    mov             r2,  r0
-
-    vld1.64         {d0}, [r0,:64], r1
-    vshr.s16        q8,  q8,  #4
-    vld1.64         {d1}, [r0,:64], r1
-    vshr.s16        q9,  q9,  #4
-    vld1.64         {d2}, [r0,:64], r1
-    vaddw.u8        q8,  q8,  d0
-    vld1.64         {d3}, [r0,:64], r1
-    vaddw.u8        q9,  q9,  d1
-    vld1.64         {d4}, [r0,:64], r1
-    vshr.s16        q10, q10, #4
-    vld1.64         {d5}, [r0,:64], r1
-    vshr.s16        q11, q11, #4
-    vld1.64         {d6}, [r0,:64], r1
-    vqmovun.s16     d0,  q8
-    vld1.64         {d7}, [r0,:64], r1
-    vqmovun.s16     d1,  q9
-    vaddw.u8        q10, q10, d2
-    vaddw.u8        q11, q11, d3
-    vshr.s16        q12, q12, #4
-    vshr.s16        q13, q13, #4
-    vqmovun.s16     d2,  q10
-    vqmovun.s16     d3,  q11
-    vaddw.u8        q12, q12, d4
-    vaddw.u8        q13, q13, d5
-    vshr.s16        q14, q14, #4
-    vshr.s16        q15, q15, #4
-    vst1.64         {d0}, [r2,:64], r1
-    vqmovun.s16     d4,  q12
-    vst1.64         {d1}, [r2,:64], r1
-    vqmovun.s16     d5,  q13
-    vst1.64         {d2}, [r2,:64], r1
-    vaddw.u8        q14, q14, d6
-    vst1.64         {d3}, [r2,:64], r1
-    vaddw.u8        q15, q15, d7
-    vst1.64         {d4}, [r2,:64], r1
-    vqmovun.s16     d6,  q14
-    vst1.64         {d5}, [r2,:64], r1
-    vqmovun.s16     d7,  q15
-    vst1.64         {d6}, [r2,:64], r1
-    vst1.64         {d7}, [r2,:64], r1
-    bx              lr
-endfunc
-
-function ff_vp3_idct_dc_add_neon, export=1
-    ldrsh           r12, [r2]
-    mov             r3,  r0
-    add             r12, r12,  #15
-    vdup.16         q15, r12
-    mov             r12, #0
-    strh            r12, [r2]
-    vshr.s16        q15, q15, #5
-
-    vld1.8          {d0}, [r0,:64], r1
-    vld1.8          {d1}, [r0,:64], r1
-    vld1.8          {d2}, [r0,:64], r1
-    vaddw.u8        q8,  q15, d0
-    vld1.8          {d3}, [r0,:64], r1
-    vaddw.u8        q9,  q15, d1
-    vld1.8          {d4}, [r0,:64], r1
-    vaddw.u8        q10, q15, d2
-    vld1.8          {d5}, [r0,:64], r1
-    vaddw.u8        q11, q15, d3
-    vld1.8          {d6}, [r0,:64], r1
-    vaddw.u8        q12, q15, d4
-    vld1.8          {d7}, [r0,:64], r1
-    vaddw.u8        q13, q15, d5
-    vqmovun.s16     d0,  q8
-    vaddw.u8        q14, q15, d6
-    vqmovun.s16     d1,  q9
-    vaddw.u8        q15, q15, d7
-    vqmovun.s16     d2,  q10
-    vst1.8          {d0}, [r3,:64], r1
-    vqmovun.s16     d3,  q11
-    vst1.8          {d1}, [r3,:64], r1
-    vqmovun.s16     d4,  q12
-    vst1.8          {d2}, [r3,:64], r1
-    vqmovun.s16     d5,  q13
-    vst1.8          {d3}, [r3,:64], r1
-    vqmovun.s16     d6,  q14
-    vst1.8          {d4}, [r3,:64], r1
-    vqmovun.s16     d7,  q15
-    vst1.8          {d5}, [r3,:64], r1
-    vst1.8          {d6}, [r3,:64], r1
-    vst1.8          {d7}, [r3,:64], r1
-    bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/vp56_arith.h b/deps/libav/libavcodec/arm/vp56_arith.h
deleted file mode 100644
index 6bc9456..0000000
--- a/deps/libav/libavcodec/arm/vp56_arith.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_VP56_ARITH_H
-#define AVCODEC_ARM_VP56_ARITH_H
-
-#if CONFIG_THUMB
-#   define A(x)
-#   define T(x) x
-#else
-#   define A(x) x
-#   define T(x)
-#endif
-
-#if CONFIG_THUMB || defined __clang__
-#   define L(x)
-#   define U(x) x
-#else
-#   define L(x) x
-#   define U(x)
-#endif
-
-#if HAVE_ARMV6_INLINE
-
-#define vp56_rac_get_prob vp56_rac_get_prob_armv6
-static inline int vp56_rac_get_prob_armv6(VP56RangeCoder *c, int pr)
-{
-    unsigned shift     = ff_vp56_norm_shift[c->high];
-    unsigned code_word = c->code_word << shift;
-    unsigned high      = c->high << shift;
-    unsigned bit;
-
-    __asm__ ("adds    %3,  %3,  %0           \n"
-             "itt     cs                     \n"
-             "cmpcs   %7,  %4                \n"
-           L("ldrcsh  %2,  [%4], #2          \n")
-           U("ldrhcs  %2,  [%4], #2          \n")
-             "rsb     %0,  %6,  #256         \n"
-             "smlabb  %0,  %5,  %6,  %0      \n"
-           T("itttt   cs                     \n")
-             "rev16cs %2,  %2                \n"
-           T("lslcs   %2,  %2,  %3           \n")
-           T("orrcs   %1,  %1,  %2           \n")
-           A("orrcs   %1,  %1,  %2,  lsl %3  \n")
-             "subcs   %3,  %3,  #16          \n"
-             "lsr     %0,  %0,  #8           \n"
-             "cmp     %1,  %0,  lsl #16      \n"
-             "ittte   ge                     \n"
-             "subge   %1,  %1,  %0,  lsl #16 \n"
-             "subge   %0,  %5,  %0           \n"
-             "movge   %2,  #1                \n"
-             "movlt   %2,  #0                \n"
-             : "=&r"(c->high), "=&r"(c->code_word), "=&r"(bit),
-               "+&r"(c->bits), "+&r"(c->buffer)
-             : "r"(high), "r"(pr), "r"(c->end - 1),
-               "0"(shift), "1"(code_word)
-             : "cc");
-
-    return bit;
-}
-
-#define vp56_rac_get_prob_branchy vp56_rac_get_prob_branchy_armv6
-static inline int vp56_rac_get_prob_branchy_armv6(VP56RangeCoder *c, int pr)
-{
-    unsigned shift     = ff_vp56_norm_shift[c->high];
-    unsigned code_word = c->code_word << shift;
-    unsigned high      = c->high << shift;
-    unsigned low;
-    unsigned tmp;
-
-    __asm__ ("adds    %3,  %3,  %0           \n"
-             "itt     cs                     \n"
-             "cmpcs   %7,  %4                \n"
-           L("ldrcsh  %2,  [%4], #2          \n")
-           U("ldrhcs  %2,  [%4], #2          \n")
-             "rsb     %0,  %6,  #256         \n"
-             "smlabb  %0,  %5,  %6,  %0      \n"
-           T("itttt   cs                     \n")
-             "rev16cs %2,  %2                \n"
-           T("lslcs   %2,  %2,  %3           \n")
-           T("orrcs   %1,  %1,  %2           \n")
-           A("orrcs   %1,  %1,  %2,  lsl %3  \n")
-             "subcs   %3,  %3,  #16          \n"
-             "lsr     %0,  %0,  #8           \n"
-             "lsl     %2,  %0,  #16          \n"
-             : "=&r"(low), "+&r"(code_word), "=&r"(tmp),
-               "+&r"(c->bits), "+&r"(c->buffer)
-             : "r"(high), "r"(pr), "r"(c->end - 1), "0"(shift)
-             : "cc");
-
-    if (code_word >= tmp) {
-        c->high      = high - low;
-        c->code_word = code_word - tmp;
-        return 1;
-    }
-
-    c->high      = low;
-    c->code_word = code_word;
-    return 0;
-}
-
-#endif
-
-#endif /* AVCODEC_ARM_VP56_ARITH_H */
diff --git a/deps/libav/libavcodec/arm/vp6dsp_init_arm.c b/deps/libav/libavcodec/arm/vp6dsp_init_arm.c
deleted file mode 100644
index 4ec41ed..0000000
--- a/deps/libav/libavcodec/arm/vp6dsp_init_arm.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/vp56dsp.h"
-
-void ff_vp6_edge_filter_hor_neon(uint8_t *yuv, int stride, int t);
-void ff_vp6_edge_filter_ver_neon(uint8_t *yuv, int stride, int t);
-
-av_cold void ff_vp6dsp_init_arm(VP56DSPContext *s, enum AVCodecID codec)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        s->edge_filter_hor = ff_vp6_edge_filter_hor_neon;
-        s->edge_filter_ver = ff_vp6_edge_filter_ver_neon;
-    }
-}
diff --git a/deps/libav/libavcodec/arm/vp6dsp_neon.S b/deps/libav/libavcodec/arm/vp6dsp_neon.S
deleted file mode 100644
index 10b4d0f..0000000
--- a/deps/libav/libavcodec/arm/vp6dsp_neon.S
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-.macro  vp6_edge_filter
-        vdup.16         q3,  r2                 @ t
-        vmov.i16        q13, #1
-        vsubl.u8        q0,  d20, d18           @ p[   0] - p[-s]
-        vsubl.u8        q1,  d16, d22           @ p[-2*s] - p[ s]
-        vsubl.u8        q14, d21, d19
-        vsubl.u8        q15, d17, d23
-        vadd.i16        q2,  q0,  q0            @ 2*(p[0]-p[-s])
-        vadd.i16        d29, d28, d28
-        vadd.i16        q0,  q0,  q1            @    p[0]-p[-s]  + p[-2*s]-p[s]
-        vadd.i16        d28, d28, d30
-        vadd.i16        q0,  q0,  q2            @ 3*(p[0]-p[-s]) + p[-2*s]-p[s]
-        vadd.i16        d28, d28, d29
-        vrshr.s16       q0,  q0,  #3            @ v
-        vrshr.s16       d28, d28, #3
-        vsub.i16        q8,  q3,  q13           @ t-1
-        vabs.s16        q1,  q0                 @ V
-        vshr.s16        q2,  q0,  #15           @ s
-        vabs.s16        d30, d28
-        vshr.s16        d29, d28, #15
-        vsub.i16        q12, q1,  q3            @ V-t
-        vsub.i16        d31, d30, d6
-        vsub.i16        q12, q12, q13           @ V-t-1
-        vsub.i16        d31, d31, d26
-        vcge.u16        q12, q12, q8            @ V-t-1 >= t-1
-        vcge.u16        d31, d31, d16
-        vadd.i16        q13, q3,  q3            @ 2*t
-        vadd.i16        d16, d6,  d6
-        vsub.i16        q13, q13, q1            @ 2*t - V
-        vsub.i16        d16, d16, d30
-        vadd.i16        q13, q13, q2            @ += s
-        vadd.i16        d16, d16, d29
-        veor            q13, q13, q2            @ ^= s
-        veor            d16, d16, d29
-        vbif            q0,  q13, q12
-        vbif            d28, d16, d31
-        vmovl.u8        q1,  d20
-        vmovl.u8        q15, d21
-        vaddw.u8        q2,  q0,  d18
-        vaddw.u8        q3,  q14, d19
-        vsub.i16        q1,  q1,  q0
-        vsub.i16        d30, d30, d28
-        vqmovun.s16     d18, q2
-        vqmovun.s16     d19, q3
-        vqmovun.s16     d20, q1
-        vqmovun.s16     d21, q15
-.endm
-
-function ff_vp6_edge_filter_ver_neon, export=1
-        sub             r0,  r0,  r1,  lsl #1
-        vld1.8          {q8},     [r0], r1      @ p[-2*s]
-        vld1.8          {q9},     [r0], r1      @ p[-s]
-        vld1.8          {q10},    [r0], r1      @ p[0]
-        vld1.8          {q11},    [r0]          @ p[s]
-        vp6_edge_filter
-        sub             r0,  r0,  r1,  lsl #1
-        sub             r1,  r1,  #8
-        vst1.8          {d18},    [r0]!
-        vst1.32         {d19[0]}, [r0], r1
-        vst1.8          {d20},    [r0]!
-        vst1.32         {d21[0]}, [r0]
-        bx              lr
-endfunc
-
-function ff_vp6_edge_filter_hor_neon, export=1
-        sub             r3,  r0,  #1
-        sub             r0,  r0,  #2
-        vld1.32         {d16[0]}, [r0], r1
-        vld1.32         {d18[0]}, [r0], r1
-        vld1.32         {d20[0]}, [r0], r1
-        vld1.32         {d22[0]}, [r0], r1
-        vld1.32         {d16[1]}, [r0], r1
-        vld1.32         {d18[1]}, [r0], r1
-        vld1.32         {d20[1]}, [r0], r1
-        vld1.32         {d22[1]}, [r0], r1
-        vld1.32         {d17[0]}, [r0], r1
-        vld1.32         {d19[0]}, [r0], r1
-        vld1.32         {d21[0]}, [r0], r1
-        vld1.32         {d23[0]}, [r0], r1
-        vtrn.8          q8,  q9
-        vtrn.8          q10, q11
-        vtrn.16         q8,  q10
-        vtrn.16         q9,  q11
-        vp6_edge_filter
-        vtrn.8          q9,  q10
-        vst1.16         {d18[0]}, [r3], r1
-        vst1.16         {d20[0]}, [r3], r1
-        vst1.16         {d18[1]}, [r3], r1
-        vst1.16         {d20[1]}, [r3], r1
-        vst1.16         {d18[2]}, [r3], r1
-        vst1.16         {d20[2]}, [r3], r1
-        vst1.16         {d18[3]}, [r3], r1
-        vst1.16         {d20[3]}, [r3], r1
-        vst1.16         {d19[0]}, [r3], r1
-        vst1.16         {d21[0]}, [r3], r1
-        vst1.16         {d19[1]}, [r3], r1
-        vst1.16         {d21[1]}, [r3], r1
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/arm/vp8.h b/deps/libav/libavcodec/arm/vp8.h
deleted file mode 100644
index cd3428b..0000000
--- a/deps/libav/libavcodec/arm/vp8.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_VP8_H
-#define AVCODEC_ARM_VP8_H
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavcodec/vp56.h"
-#include "libavcodec/vp8.h"
-
-#if HAVE_ARMV6_EXTERNAL
-#define decode_block_coeffs_internal ff_decode_block_coeffs_armv6
-int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, int16_t block[16],
-                                 uint8_t probs[8][3][NUM_DCT_TOKENS-1],
-                                 int i, uint8_t *token_prob, int16_t qmul[2]);
-#endif
-
-#endif /* AVCODEC_ARM_VP8_H */
diff --git a/deps/libav/libavcodec/arm/vp8_armv6.S b/deps/libav/libavcodec/arm/vp8_armv6.S
deleted file mode 100644
index 3863dc3..0000000
--- a/deps/libav/libavcodec/arm/vp8_armv6.S
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (C) 2010 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-
-.macro rac_get_prob     h, bs, buf, cw, pr, t0, t1
-        adds            \bs, \bs, \t0
-        lsl             \cw, \cw, \t0
-        lsl             \t0, \h,  \t0
-        rsb             \h,  \pr, #256
-        it              cs
-        ldrhcs          \t1, [\buf], #2
-        smlabb          \h,  \t0, \pr, \h
-T       itttt           cs
-        rev16cs         \t1, \t1
-A       orrcs           \cw, \cw, \t1, lsl \bs
-T       lslcs           \t1, \t1, \bs
-T       orrcs           \cw, \cw, \t1
-        subcs           \bs, \bs, #16
-        lsr             \h,  \h,  #8
-        cmp             \cw, \h,  lsl #16
-        itt             ge
-        subge           \cw, \cw, \h,  lsl #16
-        subge           \h,  \t0, \h
-.endm
-
-.macro rac_get_128      h, bs, buf, cw, t0, t1
-        adds            \bs, \bs, \t0
-        lsl             \cw, \cw, \t0
-        lsl             \t0, \h,  \t0
-        it              cs
-        ldrhcs          \t1, [\buf], #2
-        mov             \h,  #128
-        it              cs
-        rev16cs         \t1, \t1
-        add             \h,  \h,  \t0, lsl #7
-A       orrcs           \cw, \cw, \t1, lsl \bs
-T       ittt            cs
-T       lslcs           \t1, \t1, \bs
-T       orrcs           \cw, \cw, \t1
-        subcs           \bs, \bs, #16
-        lsr             \h,  \h,  #8
-        cmp             \cw, \h,  lsl #16
-        itt             ge
-        subge           \cw, \cw, \h,  lsl #16
-        subge           \h,  \t0, \h
-.endm
-
-function ff_decode_block_coeffs_armv6, export=1
-        push            {r0,r1,r4-r11,lr}
-        movrelx         lr,  X(ff_vp56_norm_shift)
-        ldrd            r4,  r5,  [sp, #44]             @ token_prob, qmul
-        cmp             r3,  #0
-        ldr             r11, [r5]
-        ldm             r0,  {r5-r7}                    @ high, bits, buf
-        it              ne
-        pkhtbne         r11, r11, r11, asr #16
-        ldr             r8,  [r0, #16]                  @ code_word
-0:
-        ldrb            r9,  [lr, r5]
-        add             r3,  r3,  #1
-        ldrb            r0,  [r4, #1]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        blt             2f
-
-        ldrb            r9,  [lr, r5]
-        ldrb            r0,  [r4, #2]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        ldrb            r9,  [lr, r5]
-        bge             3f
-
-        add             r4,  r3,  r3,  lsl #5
-        sxth            r12, r11
-        add             r4,  r4,  r2
-        adds            r6,  r6,  r9
-        add             r4,  r4,  #11
-        lsl             r8,  r8,  r9
-        it              cs
-        ldrhcs          r10, [r7], #2
-        lsl             r9,  r5,  r9
-        mov             r5,  #128
-        it              cs
-        rev16cs         r10, r10
-        add             r5,  r5,  r9,  lsl #7
-T       ittt            cs
-T       lslcs           r10, r10, r6
-T       orrcs           r8,  r8,  r10
-A       orrcs           r8,  r8,  r10, lsl r6
-        subcs           r6,  r6,  #16
-        lsr             r5,  r5,  #8
-        cmp             r8,  r5,  lsl #16
-        movrel          r10, zigzag_scan-1
-        itt             ge
-        subge           r8,  r8,  r5,  lsl #16
-        subge           r5,  r9,  r5
-        ldrb            r10, [r10, r3]
-        it              ge
-        rsbge           r12, r12, #0
-        cmp             r3,  #16
-        strh            r12, [r1, r10]
-        bge             6f
-5:
-        ldrb            r9,  [lr, r5]
-        ldrb            r0,  [r4]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        pkhtb           r11, r11, r11, asr #16
-        bge             0b
-
-6:
-        ldr             r0,  [sp]
-        ldr             r9,  [r0, #12]
-        cmp             r7,  r9
-        it              hi
-        movhi           r7,  r9
-        stm             r0,  {r5-r7}                    @ high, bits, buf
-        str             r8,  [r0, #16]                  @ code_word
-
-        add             sp,  sp,  #8
-        mov             r0,  r3
-        pop             {r4-r11,pc}
-2:
-        add             r4,  r3,  r3,  lsl #5
-        cmp             r3,  #16
-        add             r4,  r4,  r2
-        pkhtb           r11, r11, r11, asr #16
-        bne             0b
-        b               6b
-3:
-        ldrb            r0,  [r4, #3]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        ldrb            r9,  [lr, r5]
-        bge             1f
-
-        mov             r12, #2
-        ldrb            r0,  [r4, #4]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        it              ge
-        addge           r12, #1
-        ldrb            r9,  [lr, r5]
-        blt             4f
-        ldrb            r0,  [r4, #5]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        it              ge
-        addge           r12, #1
-        ldrb            r9,  [lr, r5]
-        b               4f
-1:
-        ldrb            r0,  [r4, #6]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        ldrb            r9,  [lr, r5]
-        bge             3f
-
-        ldrb            r0,  [r4, #7]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        ldrb            r9,  [lr, r5]
-        bge             2f
-
-        mov             r12, #5
-        mov             r0,  #159
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        it              ge
-        addge           r12, r12, #1
-        ldrb            r9,  [lr, r5]
-        b               4f
-2:
-        mov             r12, #7
-        mov             r0,  #165
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        it              ge
-        addge           r12, r12, #2
-        ldrb            r9,  [lr, r5]
-        mov             r0,  #145
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        it              ge
-        addge           r12, r12, #1
-        ldrb            r9,  [lr, r5]
-        b               4f
-3:
-        ldrb            r0,  [r4, #8]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        it              ge
-        addge           r4,  r4,  #1
-        ldrb            r9,  [lr, r5]
-        ite             ge
-        movge           r12, #2
-        movlt           r12, #0
-        ldrb            r0,  [r4, #9]
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        mov             r9,  #8
-        it              ge
-        addge           r12, r12, #1
-        movrelx         r4,  X(ff_vp8_dct_cat_prob), r1
-        lsl             r9,  r9,  r12
-        ldr             r4,  [r4, r12, lsl #2]
-        add             r12, r9,  #3
-        mov             r1,  #0
-        ldrb            r0,  [r4], #1
-1:
-        ldrb            r9,  [lr, r5]
-        lsl             r1,  r1,  #1
-        rac_get_prob    r5,  r6,  r7,  r8,  r0,  r9,  r10
-        ldrb            r0,  [r4], #1
-        it              ge
-        addge           r1,  r1,  #1
-        cmp             r0,  #0
-        bne             1b
-        ldrb            r9,  [lr, r5]
-        add             r12, r12, r1
-        ldr             r1,  [sp, #4]
-4:
-        add             r4,  r3,  r3,  lsl #5
-        add             r4,  r4,  r2
-        add             r4,  r4,  #22
-        rac_get_128     r5,  r6,  r7,  r8,  r9,  r10
-        it              ge
-        rsbge           r12, r12, #0
-        smulbb          r12, r12, r11
-        movrel          r9,  zigzag_scan-1
-        ldrb            r9,  [r9, r3]
-        cmp             r3,  #16
-        strh            r12, [r1, r9]
-        bge             6b
-        b               5b
-endfunc
-
-const zigzag_scan
-        .byte            0,  2,  8, 16
-        .byte           10,  4,  6, 12
-        .byte           18, 24, 26, 20
-        .byte           14, 22, 28, 30
-endconst
diff --git a/deps/libav/libavcodec/arm/vp8dsp.h b/deps/libav/libavcodec/arm/vp8dsp.h
deleted file mode 100644
index ce00e4a..0000000
--- a/deps/libav/libavcodec/arm/vp8dsp.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ARM_VP8DSP_H
-#define AVCODEC_ARM_VP8DSP_H
-
-#include "libavcodec/vp8dsp.h"
-
-void ff_vp8dsp_init_armv6(VP8DSPContext *dsp);
-void ff_vp8dsp_init_neon(VP8DSPContext *dsp);
-
-#define VP8_LF_Y(hv, inner, opt)                                             \
-    void ff_vp8_##hv##_loop_filter16##inner##_##opt(uint8_t *dst,            \
-                                                    ptrdiff_t stride,        \
-                                                    int flim_E, int flim_I,  \
-                                                    int hev_thresh)
-
-#define VP8_LF_UV(hv, inner, opt)                                            \
-    void ff_vp8_##hv##_loop_filter8uv##inner##_##opt(uint8_t *dstU,          \
-                                                     uint8_t *dstV,          \
-                                                     ptrdiff_t stride,       \
-                                                     int flim_E, int flim_I, \
-                                                     int hev_thresh)
-
-#define VP8_LF_SIMPLE(hv, opt)                                          \
-    void ff_vp8_##hv##_loop_filter16_simple_##opt(uint8_t *dst,         \
-                                                  ptrdiff_t stride,     \
-                                                  int flim)
-
-#define VP8_LF_HV(inner, opt)                   \
-    VP8_LF_Y(h,  inner, opt);                   \
-    VP8_LF_Y(v,  inner, opt);                   \
-    VP8_LF_UV(h, inner, opt);                   \
-    VP8_LF_UV(v, inner, opt)
-
-#define VP8_LF(opt)                             \
-    VP8_LF_HV(,       opt);                     \
-    VP8_LF_HV(_inner, opt);                     \
-    VP8_LF_SIMPLE(h, opt);                      \
-    VP8_LF_SIMPLE(v, opt)
-
-#define VP8_MC(n, opt)                                                  \
-    void ff_put_vp8_##n##_##opt(uint8_t *dst, ptrdiff_t dststride,      \
-                                uint8_t *src, ptrdiff_t srcstride,      \
-                                int h, int x, int y)
-
-#define VP8_EPEL(w, opt)                        \
-    VP8_MC(pixels ## w, opt);                   \
-    VP8_MC(epel ## w ## _h4, opt);              \
-    VP8_MC(epel ## w ## _h6, opt);              \
-    VP8_MC(epel ## w ## _v4, opt);              \
-    VP8_MC(epel ## w ## _h4v4, opt);            \
-    VP8_MC(epel ## w ## _h6v4, opt);            \
-    VP8_MC(epel ## w ## _v6, opt);              \
-    VP8_MC(epel ## w ## _h4v6, opt);            \
-    VP8_MC(epel ## w ## _h6v6, opt)
-
-#define VP8_BILIN(w, opt)                       \
-    VP8_MC(bilin ## w ## _h, opt);              \
-    VP8_MC(bilin ## w ## _v, opt);              \
-    VP8_MC(bilin ## w ## _hv, opt)
-
-#endif /* AVCODEC_ARM_VP8DSP_H */
diff --git a/deps/libav/libavcodec/arm/vp8dsp_armv6.S b/deps/libav/libavcodec/arm/vp8dsp_armv6.S
deleted file mode 100644
index 03100cd..0000000
--- a/deps/libav/libavcodec/arm/vp8dsp_armv6.S
+++ /dev/null
@@ -1,1640 +0,0 @@
-/*
- * VP8 ARMv6 optimisations
- *
- * Copyright (c) 2010 Google Inc.
- * Copyright (c) 2010 Rob Clark <rob at ti.com>
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * This code was partially ported from libvpx, which uses this license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *   * Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *
- *   * Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in
- *     the documentation and/or other materials provided with the
- *     distribution.
- *
- *   * Neither the name of Google nor the names of its contributors may
- *     be used to endorse or promote products derived from this software
- *     without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "libavutil/arm/asm.S"
-
-@ idct
-
-@ void vp8_luma_dc_wht(int16_t block[4][4][16], int16_t dc[16])
-function ff_vp8_luma_dc_wht_armv6, export=1
-        push            {r4-r10, lr}
-
-        ldm             r1,  {r2-r9}
-        mov             r10, #0
-        mov             lr,  #0
-        uadd16          r12, r2,  r8            @ t0[0,1]
-        usub16          r2,  r2,  r8            @ t3[0,1]
-        stm             r1!, {r10, lr}
-        uadd16          r8,  r4,  r6            @ t1[0,1]
-        usub16          r4,  r4,  r6            @ t2[0,1]
-        stm             r1!, {r10, lr}
-        uadd16          r6,  r12, r8            @ dc0[0,1]
-        usub16          r12, r12, r8            @ dc2[0,1]
-        stm             r1!, {r10, lr}
-        uadd16          r8,  r2,  r4            @ dc1[0,1]
-        usub16          r2,  r2,  r4            @ dc3[0,1]
-        stm             r1!, {r10, lr}
-
-        uadd16          lr,  r3,  r9            @ t0[2,3]
-        usub16          r3,  r3,  r9            @ t3[2,3]
-        uadd16          r9,  r5,  r7            @ t1[2,3]
-        usub16          r5,  r5,  r7            @ t2[2,3]
-
-        uadd16          r7,  lr,  r9            @ dc0[2,3]
-        usub16          lr,  lr,  r9            @ dc2[2,3]
-        uadd16          r9,  r3,  r5            @ dc1[2,3]
-        usub16          r3,  r3,  r5            @ dc3[2,3]
-
-        mov             r1,  #3
-        orr             r1,  r1,  #0x30000      @ 3 | 3 (round)
-
-        pkhbt           r4,  r6,  r8,  lsl #16  @ dc{0,1}[0]
-        pkhtb           r6,  r8,  r6,  asr #16  @ dc{0,1}[1]
-        pkhbt           r5,  r12, r2,  lsl #16  @ dc{2,3}[0]
-        pkhtb           r12, r2,  r12, asr #16  @ dc{2,3}[1]
-        pkhbt           r8,  r7,  r9,  lsl #16  @ dc{0,1}[2]
-        uadd16          r4,  r4,  r1
-        uadd16          r5,  r5,  r1
-        pkhtb           r7,  r9,  r7,  asr #16  @ dc{0,1}[3]
-        pkhbt           r2,  lr,  r3,  lsl #16  @ dc{2,3}[2]
-        pkhtb           lr,  r3,  lr,  asr #16  @ dc{2,3}[3]
-
-        uadd16          r9,  r4,  r7            @ t0[0,1]
-        uadd16          r3,  r5,  lr            @ t0[2,3]
-        usub16          r4,  r4,  r7            @ t3[0,1]
-        usub16          r5,  r5,  lr            @ t3[2,3]
-        uadd16          r7,  r6,  r8            @ t1[0,1]
-        uadd16          lr,  r12, r2            @ t1[2,3]
-        usub16          r6,  r6,  r8            @ t2[0,1]
-        usub16          r12, r12, r2            @ t2[2,3]
-
-        uadd16          r8,  r9,  r7            @ block[0,1][0]
-        uadd16          r2,  r3,  lr            @ block[2,3][0]
-        usub16          r9,  r9,  r7            @ block[0,1][2]
-        usub16          r3,  r3,  lr            @ block[2,3][2]
-        uadd16          r7,  r4,  r6            @ block[0,1][1]
-        uadd16          lr,  r5,  r12           @ block[2,3][1]
-        usub16          r4,  r4,  r6            @ block[0,1][3]
-        usub16          r5,  r5,  r12           @ block[2,3][3]
-
-#if HAVE_ARMV6T2_EXTERNAL
-        sbfx            r6,  r8,  #3,  #13
-        sbfx            r12, r7,  #3,  #13
-        sbfx            r1,  r9,  #3,  #13
-        sbfx            r10, r4,  #3,  #13
-#else
-        sxth            r6,  r8
-        sxth            r12, r7
-        sxth            r1,  r9
-        sxth            r10, r4
-        asr             r6,  #3                 @ block[0][0]
-        asr             r12, #3                 @ block[0][1]
-        asr             r1,  #3                 @ block[0][2]
-        asr             r10, #3                 @ block[0][3]
-#endif
-
-        strh            r6,  [r0], #32
-        asr             r8,  r8,  #19           @ block[1][0]
-        strh            r12, [r0], #32
-        asr             r7,  r7,  #19           @ block[1][1]
-        strh            r1,  [r0], #32
-        asr             r9,  r9,  #19           @ block[1][2]
-        strh            r10, [r0], #32
-        asr             r4,  r4,  #19           @ block[1][3]
-        strh            r8,  [r0], #32
-        asr             r6,  r2,  #19           @ block[3][0]
-        strh            r7,  [r0], #32
-        asr             r12, lr,  #19           @ block[3][1]
-        strh            r9,  [r0], #32
-        asr             r1,  r3,  #19           @ block[3][2]
-        strh            r4,  [r0], #32
-        asr             r10, r5,  #19           @ block[3][3]
-
-#if HAVE_ARMV6T2_EXTERNAL
-        sbfx            r2,  r2,  #3,  #13
-        sbfx            lr,  lr,  #3,  #13
-        sbfx            r3,  r3,  #3,  #13
-        sbfx            r5,  r5,  #3,  #13
-#else
-        sxth            r2,  r2
-        sxth            lr,  lr
-        sxth            r3,  r3
-        sxth            r5,  r5
-        asr             r2,  #3                 @ block[2][0]
-        asr             lr,  #3                 @ block[2][1]
-        asr             r3,  #3                 @ block[2][2]
-        asr             r5,  #3                 @ block[2][3]
-#endif
-
-        strh            r2,  [r0], #32
-        strh            lr,  [r0], #32
-        strh            r3,  [r0], #32
-        strh            r5,  [r0], #32
-        strh            r6,  [r0], #32
-        strh            r12, [r0], #32
-        strh            r1,  [r0], #32
-        strh            r10, [r0], #32
-
-        pop             {r4-r10, pc}
-endfunc
-
-@ void vp8_luma_dc_wht_dc(int16_t block[4][4][16], int16_t dc[16])
-function ff_vp8_luma_dc_wht_dc_armv6, export=1
-        ldrsh           r2,  [r1]
-        mov             r3,  #0
-        add             r2,  r2,  #3
-        strh            r3,  [r1]
-        asr             r2,  r2,  #3
-    .rept 16
-        strh            r2,  [r0], #32
-    .endr
-        bx              lr
-endfunc
-
-@ void vp8_idct_add(uint8_t *dst, int16_t block[16], int stride)
-function ff_vp8_idct_add_armv6, export=1
-        push            {r4-r12, lr}
-        sub             sp,  sp,  #32
-
-        movw            r3,  #20091             @ cospi8sqrt2minus1
-        movw            r4,  #35468             @ sinpi8sqrt2
-        mov             r5,  sp
-1:
-        ldr             r6,  [r1, #8]       @  i5 | i4  = block1[1] | block1[0]
-        ldr             lr,  [r1, #16]      @  i9 | i8  = block2[1] | block2[0]
-        ldr             r12, [r1, #24]      @ i13 | i12 = block3[1] | block3[0]
-
-        smulwt          r9,  r3,  r6            @ ip[5] * cospi8sqrt2minus1
-        smulwb          r7,  r3,  r6            @ ip[4] * cospi8sqrt2minus1
-        smulwt          r10, r4,  r6            @ ip[5] * sinpi8sqrt2
-        smulwb          r8,  r4,  r6            @ ip[4] * sinpi8sqrt2
-        pkhbt           r7,  r7,  r9,  lsl #16  @ 5c | 4c
-        smulwt          r11, r3,  r12           @ ip[13] * cospi8sqrt2minus1
-        pkhbt           r8,  r8,  r10, lsl #16  @ 5s   | 4s   = t2 first half
-        uadd16          r6,  r6,  r7            @ 5c+5 | 4c+4 = t3 first half
-        smulwb          r9,  r3,  r12           @ ip[12] * cospi8sqrt2minus1
-        smulwt          r7,  r4,  r12           @ ip[13] * sinpi8sqrt2
-        smulwb          r10, r4,  r12           @ ip[12] * sinpi8sqrt2
-
-        pkhbt           r9,  r9,  r11, lsl #16  @ 13c | 12c
-        ldr             r11, [r1]               @  i1 | i0
-        pkhbt           r10, r10,  r7, lsl #16  @ 13s | 12s    = t3 second half
-        uadd16          r7,  r12, r9            @ 13c+13  | 12c+12 = t2 2nd half
-        uadd16          r6,  r6,  r10           @ d = t3
-        uadd16          r10, r11, lr            @ a = t0
-        usub16          r7,  r8,  r7            @ c = t2
-        usub16          r8,  r11, lr            @ b = t1
-        uadd16          r9,  r10, r6            @ a+d = tmp{0,1}[0]
-        usub16          r10, r10, r6            @ a-d = tmp{0,1}[3]
-        uadd16          r6,  r8,  r7            @ b+c = tmp{0,1}[1]
-        usub16          r7,  r8,  r7            @ b-c = tmp{0,1}[2]
-        mov             r8,  #0
-        cmp             sp,  r5
-        str             r6,  [r5, #8]           @  o5 | o4
-        str             r7,  [r5, #16]          @  o9 | o8
-        str             r10, [r5, #24]          @ o13 | o12
-        str             r9,  [r5], #4           @  o1 | o0
-        str             r8,  [r1, #8]
-        str             r8,  [r1, #16]
-        str             r8,  [r1, #24]
-        str             r8,  [r1], #4
-        beq             1b
-
-        mov             r5,  #2
-2:
-        pop             {r1, r6, r12, lr}
-        smulwt          r9,  r3,  r12           @ ip[5] * cospi8sqrt2minus1
-        smulwt          r7,  r3,  r1            @ ip[1] * cospi8sqrt2minus1
-        smulwt          r10, r4,  r12           @ ip[5] * sinpi8sqrt2
-        smulwt          r8,  r4,  r1            @ ip[1] * sinpi8sqrt2
-        pkhbt           r11, r1,  r12, lsl #16  @ i4 | i0 = t0/t1 first half
-        pkhtb           r1,  r12, r1,  asr #16  @ i5 | i1
-        pkhbt           r7,  r7,  r9,  lsl #16  @ 5c | 1c
-        pkhbt           r8,  r8,  r10, lsl #16  @ 5s | 1s = t2 first half
-        pkhbt           r9,  r6,  lr,  lsl #16  @ i6 | i2 = t0/t1 second half
-        pkhtb           r12, lr,  r6,  asr #16  @ i7 | i3
-        uadd16          r1,  r7,  r1            @ 5c+5 | 1c+1 = t3 first half
-        uadd16          r10, r11, r9            @ a = t0
-        usub16          r9,  r11, r9            @ b = t1
-        smulwt          r7,  r3,  r12           @ ip[7] * cospi8sqrt2minus1
-        smulwb          lr,  r3,  r12           @ ip[3] * cospi8sqrt2minus1
-        smulwt          r11, r4,  r12           @ ip[7] * sinpi8sqrt2
-        smulwb          r6,  r4,  r12           @ ip[3] * sinpi8sqrt2
-        subs            r5,  r5,  #1
-        pkhbt           r7,  lr,  r7,  lsl #16  @ 7c | 3c
-        pkhbt           r11, r6,  r11, lsl #16  @ 7s | 3s = t3 second half
-        mov             r6,  #0x4
-        orr             r6,  r6,  #0x40000
-        uadd16          r12, r7,  r12           @ 7c+7 | 3c+3 = t2 second half
-        uadd16          r10, r10, r6            @ t0 + 4
-        uadd16          r9,  r9,  r6            @ t1 + 4
-        usub16          lr,  r8,  r12           @ c (o5 | o1) = t2
-        uadd16          r12, r11, r1            @ d (o7 | o3) = t3
-        usub16          r1,  r9,  lr            @ b-c = dst{0,1}[2]
-        uadd16          r7,  r10, r12           @ a+d = dst{0,1}[0]
-        usub16          r12, r10, r12           @ a-d = dst{0,1}[3]
-        uadd16          r10, r9,  lr            @ b+c = dst{0,1}[1]
-
-        asr             lr,  r1,  #3            @ o[1][2]
-        asr             r9,  r12, #3            @ o[1][3]
-        pkhtb           r8,  lr,  r7,  asr #19  @ o[1][0,2]
-        pkhtb           r11, r9,  r10, asr #19  @ o[1][1,3]
-        ldr             lr,  [r0]
-        sxth            r12, r12
-        ldr             r9,  [r0, r2]
-        sxth            r1,  r1
-#if HAVE_ARMV6T2_EXTERNAL
-        sbfx            r7,  r7,  #3,  #13
-        sbfx            r10, r10, #3,  #13
-#else
-        sxth            r7,  r7
-        sxth            r10, r10
-        asr             r7,  #3                 @ o[0][0]
-        asr             r10, #3                 @ o[0][1]
-#endif
-        pkhbt           r7,  r7,  r1,  lsl #13  @ o[0][0,2]
-        pkhbt           r10, r10, r12, lsl #13  @ o[0][1,3]
-
-        uxtab16         r7,  r7,  lr
-        uxtab16         r10, r10, lr,  ror #8
-        uxtab16         r8,  r8,  r9
-        uxtab16         r11, r11, r9,  ror #8
-        usat16          r7,  #8,  r7
-        usat16          r10, #8,  r10
-        usat16          r8,  #8,  r8
-        usat16          r11, #8,  r11
-        orr             r7,  r7,  r10, lsl #8
-        orr             r8,  r8,  r11, lsl #8
-        str             r8,  [r0, r2]
-        str_post        r7,  r0,  r2,  lsl #1
-
-        bne             2b
-
-        pop             {r4-r12, pc}
-endfunc
-
-@ void vp8_idct_dc_add(uint8_t *dst, int16_t block[16], int stride)
-function ff_vp8_idct_dc_add_armv6, export=1
-        push            {r4-r6, lr}
-        add             r6,  r0,  r2,  lsl #1
-        ldrsh           r3,  [r1]
-        mov             r4,  #0
-        add             r3,  r3,  #4
-        strh            r4,  [r1], #32
-        asr             r3,  #3
-        ldr             r5,  [r0]
-        ldr             r4,  [r0, r2]
-        pkhbt           r3,  r3,  r3,  lsl #16
-        uxtab16         lr,  r3,  r5            @ a1+2 | a1+0
-        uxtab16         r5,  r3,  r5,  ror #8   @ a1+3 | a1+1
-        uxtab16         r12, r3,  r4
-        uxtab16         r4,  r3,  r4,  ror #8
-        usat16          lr,  #8,  lr
-        usat16          r5,  #8,  r5
-        usat16          r12, #8,  r12
-        usat16          r4,  #8,  r4
-        orr             lr,  lr,  r5,  lsl #8
-        ldr             r5,  [r6]
-        orr             r12, r12, r4,  lsl #8
-        ldr             r4,  [r6, r2]
-        str             lr,  [r0]
-        uxtab16         lr,  r3,  r5
-        str             r12, [r0, r2]
-        uxtab16         r5,  r3,  r5,  ror #8
-        uxtab16         r12, r3,  r4
-        uxtab16         r4,  r3,  r4,  ror #8
-        usat16          lr,  #8,  lr
-        usat16          r5,  #8,  r5
-        usat16          r12, #8,  r12
-        usat16          r4,  #8,  r4
-        orr             lr,  lr,  r5,  lsl #8
-        orr             r12, r12, r4,  lsl #8
-        str             lr,  [r6]
-        str             r12, [r6, r2]
-        pop             {r4-r6, pc}
-endfunc
-
-@ void vp8_idct_dc_add4uv(uint8_t *dst, int16_t block[4][16], int stride)
-function ff_vp8_idct_dc_add4uv_armv6, export=1
-        push            {r4, lr}
-
-        bl              X(ff_vp8_idct_dc_add_armv6)
-        add             r0,  r0,  #4
-        bl              X(ff_vp8_idct_dc_add_armv6)
-        add             r0,  r0,  r2,  lsl #2
-        sub             r0,  r0,  #4
-        bl              X(ff_vp8_idct_dc_add_armv6)
-        add             r0,  r0,  #4
-        bl              X(ff_vp8_idct_dc_add_armv6)
-
-        pop             {r4, pc}
-endfunc
-
-@ void vp8_idct_dc_add4y(uint8_t *dst, int16_t block[4][16], int stride)
-function ff_vp8_idct_dc_add4y_armv6, export=1
-        push            {r4, lr}
-
-        bl              X(ff_vp8_idct_dc_add_armv6)
-        add             r0,  r0,  #4
-        bl              X(ff_vp8_idct_dc_add_armv6)
-        add             r0,  r0,  #4
-        bl              X(ff_vp8_idct_dc_add_armv6)
-        add             r0,  r0,  #4
-        bl              X(ff_vp8_idct_dc_add_armv6)
-
-        pop             {r4, pc}
-endfunc
-
-@ loopfilter
-
-.macro  transpose       o3,  o2,  o1,  o0,  i0,  i1,  i2,  i3
-        uxtb16          \o1, \i1                @ xx 12 xx 10
-        uxtb16          \o0, \i0                @ xx 02 xx 00
-        uxtb16          \o3, \i3                @ xx 32 xx 30
-        uxtb16          \o2, \i2                @ xx 22 xx 20
-        orr             \o1, \o0, \o1, lsl #8   @ 12 02 10 00
-        orr             \o3, \o2, \o3, lsl #8   @ 32 22 30 20
-
-        uxtb16          \i1, \i1, ror #8        @ xx 13 xx 11
-        uxtb16          \i3, \i3, ror #8        @ xx 33 xx 31
-        uxtb16          \i0, \i0, ror #8        @ xx 03 xx 01
-        uxtb16          \i2, \i2, ror #8        @ xx 23 xx 21
-        orr             \i0, \i0, \i1, lsl #8   @ 13 03 11 01
-        orr             \i2, \i2, \i3, lsl #8   @ 33 23 31 21
-
-        pkhtb           \o2, \o3, \o1, asr #16  @ 32 22 12 02
-        pkhbt           \o0, \o1, \o3, lsl #16  @ 30 20 10 00
-        pkhtb           \o3, \i2, \i0, asr #16  @ 33 23 13 03
-        pkhbt           \o1, \i0, \i2, lsl #16  @ 31 21 11 01
-.endm
-
-.macro  simple_filter
-        uqsub8          r7,  r3,  r6            @ p1 - q1
-        uqsub8          r8,  r6,  r3            @ q1 - p1
-        uqsub8          r10, r4,  r5            @ p0 - q0
-        uqsub8          r9,  r5,  r4            @ q0 - p0
-        orr             r7,  r7,  r8            @ abs(p1 - q1)
-        orr             r9,  r9,  r10           @ abs(p0 - q0)
-        uhadd8          r7,  r7,  lr            @ abs(p1 - q2) >> 1
-        uqadd8          r9,  r9,  r9            @ abs(p0 - q0) * 2
-        uqadd8          r7,  r7,  r9            @ abs(p0 - q0)*2 + abs(p1-q1)/2
-        mvn             r8,  #0
-        usub8           r10, r12, r7            @ compare to flimit
-        sel             r10, r8,  lr            @ filter mask: F or 0
-        cmp             r10, #0
-        beq             2f
-
-        eor             r3,  r3,  r2            @ ps1
-        eor             r6,  r6,  r2            @ qs1
-        eor             r4,  r4,  r2            @ ps0
-        eor             r5,  r5,  r2            @ qs0
-
-        qsub8           r3,  r3,  r6            @ vp8_filter = p1 - q1
-        qsub8           r6,  r5,  r4            @ q0 - p0
-        qadd8           r3,  r3,  r6            @ += q0 - p0
-        lsr             r7,  r2,  #5            @ 0x04040404
-        qadd8           r3,  r3,  r6            @ += q0 - p0
-        sub             r9,  r7,  r2,  lsr #7   @ 0x03030303
-        qadd8           r3,  r3,  r6            @ vp8_filter = p1-q1 + 3*(q0-p0)
-        and             r3,  r3,  r10           @ vp8_filter &= mask
-
-        qadd8           r9,  r3,  r9            @ Filter2 = vp8_filter + 3
-        qadd8           r3,  r3,  r7            @ Filter1 = vp8_filter + 4
-
-        shadd8          r9,  r9,  lr
-        shadd8          r3,  r3,  lr
-        shadd8          r9,  r9,  lr
-        shadd8          r3,  r3,  lr
-        shadd8          r9,  r9,  lr            @ Filter2 >>= 3
-        shadd8          r3,  r3,  lr            @ Filter1 >>= 3
-
-        qadd8           r4,  r4,  r9            @ u = p0 + Filter2
-        qsub8           r5,  r5,  r3            @ u = q0 - Filter1
-        eor             r4,  r4,  r2            @ *op0 = u ^ 0x80
-        eor             r5,  r5,  r2            @ *oq0 = u ^ 0x80
-.endm
-
-@ void vp8_v_loop_filter16_simple(uint8_t *dst, int stride, int flim)
-function ff_vp8_v_loop_filter16_simple_armv6, export=1
-        push            {r4-r11, lr}
-
-        orr             r2,  r2,  r2,  lsl #16
-        mov             r11, #4
-        mov             lr,  #0
-        orr             r12, r2,  r2,  lsl #8
-        mov32           r2,  0x80808080
-1:
-        ldr_nreg        r3,  r0,  r1,  lsl #1   @ p1
-        ldr_nreg        r4,  r0,  r1            @ p0
-        ldr             r5,  [r0]               @ q0
-        ldr             r6,  [r0, r1]           @ q1
-        simple_filter
-T       sub             r7,  r0,  r1
-        str             r5,  [r0]               @ oq0
-A       str             r4,  [r0, -r1]          @ op0
-T       str             r4,  [r7]
-2:
-        subs            r11, r11, #1
-        add             r0,  r0,  #4
-        bne             1b
-
-        pop             {r4-r11, pc}
-endfunc
-
-.macro  filter_mask_p
-        uqsub8          r6,  r9,  r10           @ p3 - p2
-        uqsub8          r7,  r10, r9            @ p2 - p3
-        uqsub8          r8,  r10, r11           @ p2 - p1
-        uqsub8          r10, r11, r10           @ p1 - p2
-        orr             r6,  r6,  r7            @ abs(p3-p2)
-        orr             r8,  r8,  r10           @ abs(p2-p1)
-        uqsub8          lr,  r6,  r2            @ compare to limit
-        uqsub8          r8,  r8,  r2            @ compare to limit
-        uqsub8          r6,  r11, r12           @ p1 - p0
-        orr             lr,  lr,  r8
-        uqsub8          r7,  r12, r11           @ p0 - p1
-        orr             r6,  r6,  r7            @ abs(p1-p0)
-        uqsub8          r7,  r6,  r2            @ compare to limit
-        uqsub8          r8,  r6,  r3            @ compare to thresh
-        orr             lr,  lr,  r7
-.endm
-
-.macro filter_mask_pq
-        uqsub8          r6,  r11, r10           @ p1 - q1
-        uqsub8          r7,  r10, r11           @ q1 - p1
-        uqsub8          r11, r12, r9            @ p0 - q0
-        uqsub8          r12, r9,  r12           @ q0 - p0
-        orr             r6,  r6,  r7            @ abs(p1-q1)
-        orr             r12, r11, r12           @ abs(p0-q0)
-        mov32           r7,  0x7f7f7f7f
-        uqadd8          r12, r12, r12           @ abs(p0-q0) * 2
-        and             r6,  r7,  r6,  lsr #1   @ abs(p1-q1) / 2
-        uqadd8          r12, r12, r6            @ abs(p0-q0) * 2 + abs(p1-q1)/2
-.endm
-
-.macro  filter_mask_v
-        filter_mask_p
-
-        ldr             r10, [r0, r1]           @ q1
-        ldr_post        r9,  r0,  r1,  lsl #1   @ q0
-
-        filter_mask_pq
-
-        ldr             r11, [r0]               @ q2
-
-        uqsub8          r7,  r9,  r10           @ q0 - q1
-        uqsub8          r6,  r10, r9            @ q1 - q0
-        uqsub8          r12, r12, r4            @ compare to flimit
-        uqsub8          r9,  r11, r10           @ q2 - q1
-        uqsub8          r10, r10, r11           @ q1 - q2
-        orr             lr,  lr,  r12
-        ldr             r12, [r0, r1]           @ q3
-        orr             r6,  r7,  r6            @ abs(q1-q0)
-        orr             r10, r9,  r10           @ abs(q2-q1)
-        uqsub8          r9,  r12, r11           @ q3 - q2
-        uqsub8          r11, r11, r12           @ q2 - q3
-        uqsub8          r7,  r6,  r2            @ compare to limit
-        uqsub8          r10, r10, r2            @ compare to limit
-        uqsub8          r6,  r6,  r3            @ compare to thresh
-        orr             r9,  r9,  r11           @ abs(q3-q2)
-        orr             lr,  lr,  r7
-        orr             lr,  lr,  r10
-        uqsub8          r9,  r9,  r2            @ compare to limit
-        orr             lr,  lr,  r9
-
-        mov             r12, #0
-        usub8           lr,  r12, lr
-        mvn             r11, #0
-        sel             lr,  r11, r12           @ filter mask
-        sub             r0,  r0,  r1,  lsl #1
-.endm
-
-.macro  filter_mask_h
-        transpose       r12, r11, r10, r9,  r6,  r7,  r8,  lr
-
-        filter_mask_p
-
-        stm             sp,  {r8, r11, r12, lr}
-        sub             r0,  r0,  r1,  lsl #2
-        add             r0,  r0,  #4
-
-        ldr             r7,  [r0, r1]
-        ldr_post        r6,  r0,  r1,  lsl #1
-        ldr             lr,  [r0, r1]
-        ldr             r8,  [r0]
-
-        transpose       r12, r11, r10, r9,  r6,  r7,  r8,  lr
-
-        uqsub8          r8,  r12, r11           @ q3 - q2
-        uqsub8          lr,  r11, r12           @ q2 - q3
-        uqsub8          r7,  r9,  r10           @ q0 - q1
-        uqsub8          r6,  r10, r9            @ q1 - q0
-        uqsub8          r12, r11, r10           @ q2 - q1
-        uqsub8          r11, r10, r11           @ q1 - q2
-        orr             r8,  r8,  lr            @ abs(q3-q2)
-        orr             r6,  r7,  r6            @ abs(q1-q0)
-        orr             r11, r12, r11           @ abs(q2-q1)
-        ldr             lr,  [sp, #12]          @ load back (f)limit accumulator
-        uqsub8          r8,  r8,  r2            @ compare to limit
-        uqsub8          r7,  r6,  r2            @ compare to limit
-        uqsub8          r11, r11, r2            @ compare to limit
-        orr             lr,  lr,  r8
-        uqsub8          r8,  r6,  r3            @ compare to thresh
-        orr             lr,  lr,  r7
-        ldr             r12, [sp, #8]           @ p1
-        orr             lr,  lr,  r11
-
-        ldr             r11, [sp, #4]           @ p0
-
-        filter_mask_pq
-
-        mov             r10, #0
-        uqsub8          r12, r12, r4            @ compare to flimit
-        mvn             r11, #0
-        orr             lr,  lr,  r12
-        usub8           lr,  r10, lr
-        sel             lr,  r11, r10           @ filter mask
-.endm
-
-.macro  filter          inner
-        mov32           r12, 0x80808080
-        eor             r11, r7,  r12           @ ps1
-        eor             r8,  r8,  r12           @ ps0
-        eor             r9,  r9,  r12           @ qs0
-        eor             r10, r10, r12           @ qs1
-
-        stm             sp,  {r8-r11}
-
-        qsub8           r7,  r11, r10           @ vp8_signed_char_clamp(ps1-qs1)
-        qsub8           r8,  r9,  r8            @ vp8_signed_char_clamp(vp8_filter + 3 * ( qs0 - ps0))
-    .if \inner
-        and             r7,  r7,  r6            @ vp8_filter &= hev
-    .endif
-        qadd8           r7,  r7,  r8
-        lsr             r10, r12, #5            @ 0x04040404
-        qadd8           r7,  r7,  r8
-        sub             r9,  r10, r12, lsr #7   @ 0x03030303
-        qadd8           r7,  r7,  r8
-
-        and             r7,  r7,  lr            @ vp8_filter &= mask
-    .if !\inner
-        mov             r12, r7                 @ Filter2
-        and             r7,  r7,  r6            @ Filter2 &= hev
-    .endif
-        qadd8           lr,  r7,  r9            @ Filter2 = vp8_signed_char_clamp(vp8_filter+3)
-        qadd8           r7,  r7,  r10           @ Filter1 = vp8_signed_char_clamp(vp8_filter+4)
-
-        mov             r9,  #0
-        shadd8          lr,  lr,  r9            @ Filter2 >>= 3
-        shadd8          r7,  r7,  r9            @ Filter1 >>= 3
-        shadd8          lr,  lr,  r9
-        shadd8          r7,  r7,  r9
-        shadd8          lr,  lr,  r9            @ Filter2
-        shadd8          r7,  r7,  r9            @ Filter1
-.endm
-
-.macro  filter_v        inner
-        orr             r10, r6,  r8            @ calculate vp8_hevmask
-        ldr_nreg        r7,  r0,  r1,  lsl #1   @ p1
-        usub8           r10, r12, r10
-        ldr_nreg        r8,  r0,  r1            @ p0
-        sel             r6,  r12, r11           @ obtain vp8_hevmask
-        ldr             r9,  [r0]               @ q0
-        ldr             r10, [r0, r1]           @ q1
-        filter          \inner
-.endm
-
-.macro  filter_h        inner
-        orr             r9,  r6,  r8
-        usub8           r9,  r12, r9
-        sel             r6,  r12, r11           @ hev mask
-
-        stm             sp,  {r6, lr}
-
-        ldr_nreg        r12, r0,  r1,  lsl #1
-        ldr_nreg        r11, r0,  r1
-        ldr             r6,  [r0]
-        ldr             lr,  [r0, r1]
-
-        transpose       r10, r9,  r8,  r7,  r12, r11, r6,  lr
-
-        ldm             sp,  {r6, lr}
-        filter          \inner
-.endm
-
-.macro  filter_inner
-        ldm             sp,  {r8, r9}
-        lsr             r10, r10, #2            @ 0x01010101
-        qadd8           r8,  r8,  lr            @ u = vp8_signed_char_clamp(ps0 + Filter2)
-        mov             lr,  #0
-        qsub8           r9,  r9,  r7            @ u = vp8_signed_char_clamp(qs0 - Filter1)
-        sadd8           r7,  r7,  r10           @ vp8_filter += 1
-        ldr             r10, [sp, #8]           @ qs1
-        shadd8          r7,  r7,  lr            @ vp8_filter >>= 1
-        eor             r8,  r8,  r12           @ *op0 = u ^ 0x80
-        bic             r7,  r7,  r6            @ vp8_filter &= ~hev
-        qadd8           r11, r11, r7            @ u = vp8_signed_char_clamp(ps1 + vp8_filter)
-        eor             r9,  r9,  r12           @ *oq0 = u ^ 0x80
-        qsub8           r10, r10, r7            @ u = vp8_signed_char_clamp(qs1 - vp8_filter)
-        eor             r11, r11, r12           @ *op1 = u ^ 0x80
-        eor             r10, r10, r12           @ *oq1 = u ^ 0x80
-.endm
-
-.macro  filter_x        c0
-        mov             lr,  \c0
-        mov             r7,  #63
-
-        sxtb16          r6,  r12
-        sxtb16          r10, r12, ror #8
-        smlabb          r8,  r6,  lr,  r7
-        smlatb          r6,  r6,  lr,  r7
-        smlabb          r7,  r10, lr,  r7
-        smultb          r10, r10, lr
-        ssat            r8,  #8,  r8,  asr #7
-        ssat            r6,  #8,  r6,  asr #7
-        add             r10, r10, #63
-        ssat            r7,  #8,  r7,  asr #7
-        ssat            r10, #8,  r10, asr #7
-
-        pkhbt           r6,  r8,  r6,  lsl #16
-        pkhbt           r10, r7,  r10, lsl #16
-        uxtb16          r6,  r6
-        uxtb16          r10, r10
-
-        mov32           lr,  0x80808080
-
-        orr             r10, r6,  r10, lsl #8   @ u = vp8_signed_char_clamp((63 + Filter2 * 27)>>7)
-        qsub8           r8,  r9,  r10           @ s = vp8_signed_char_clamp(qs0 - u)
-        qadd8           r10, r11, r10           @ s = vp8_signed_char_clamp(ps0 + u)
-        eor             r8,  r8,  lr            @ *oq0 = s ^ 0x80
-        eor             r10, r10, lr            @ *op0 = s ^ 0x80
-.endm
-
-.macro  filter_1
-        ldm             sp,  {r8, r9}
-        qadd8           r11, r8,  lr
-        qsub8           r9,  r9,  r7
-        bic             r12, r12, r6            @ vp8_filter &= ~hev
-        filter_x        #27
-.endm
-
-.macro  filter_2
-        ldr             r9,   [sp, #8]          @ qs1
-        ldr             r11,  [sp, #12]         @ ps1
-        filter_x        #18
-.endm
-
-.macro  filter_3
-        eor             r9,  r9,  lr
-        eor             r11, r11, lr
-        filter_x        #9
-.endm
-
-function vp8_v_loop_filter_inner_armv6
-        mov             r5,  #4
-        sub             sp,  sp,  #16
-
-        orr             r2,  r2,  r2,  lsl #16
-        orr             r3,  r3,  r3,  lsl #16
-        orr             r6,  r6,  r6,  lsl #16
-        orr             r4,  r2,  r2,  lsl #8   @ flimE
-        orr             r2,  r3,  r3,  lsl #8   @ flimI
-        orr             r3,  r6,  r6,  lsl #8   @ thresh
-1:
-        sub             r0,  r0,  r1,  lsl #2
-        ldr             r10, [r0, r1]           @ p2
-        ldr_post        r9,  r0,  r1,  lsl #1   @ p3
-        ldr             r12, [r0, r1]           @ p0
-        ldr_post        r11, r0,  r1,  lsl #1   @ p1
-
-        filter_mask_v
-        cmp             lr,  #0
-        beq             2f
-        filter_v        inner=1
-        filter_inner
-
-A       str             r11, [r0, -r1, lsl #1]  @ op1
-A       str             r8,  [r0, -r1]          @ op0
-T       sub             r0,  r0,  r1,  lsl #1
-T       str             r8,  [r0, r1]
-T       str_post        r11, r0,  r1,  lsl #1
-        str             r9,  [r0]               @ oq0
-        str             r10, [r0, r1]           @ oq1
-2:
-        add             r0,  r0,  #4
-        cmp             r5,  #3
-        it              eq
-        ldreq           r0,  [sp, #16]
-        subs            r5,  r5,  #1
-        bne             1b
-
-        add             sp,  sp,  #16
-        pop             {r0, r4-r11, pc}
-endfunc
-
-function ff_vp8_v_loop_filter16_inner_armv6, export=1
-        push            {r4-r11, lr}
-        add             r12, r0,  #8
-        push            {r12}
-        ldr             r6,  [sp, #40]
-        orr             r2,  r2,  r2,  lsl #16
-        b               vp8_v_loop_filter_inner_armv6
-endfunc
-
-function ff_vp8_v_loop_filter8uv_inner_armv6, export=1
-        push            {r1, r4-r11, lr}
-        mov             r1,  r2
-        orr             r2,  r3,  r3,  lsl #16
-        ldr             r3,  [sp, #40]
-        ldr             r6,  [sp, #44]
-        b               vp8_v_loop_filter_inner_armv6
-endfunc
-
-function vp8_v_loop_filter_armv6
-        mov             r5,  #4
-        sub             sp,  sp,  #16
-
-        orr             r3,  r3,  r3,  lsl #16
-        orr             r6,  r6,  r6,  lsl #16
-        orr             r4,  r2,  r2,  lsl #8   @ flimE
-        orr             r2,  r3,  r3,  lsl #8   @ flimI
-        orr             r3,  r6,  r6,  lsl #8   @ thresh
-1:
-        sub             r0,  r0,  r1,  lsl #2
-        ldr             r10, [r0, r1]           @ p2
-        ldr_post        r9,  r0,  r1,  lsl #1   @ p3
-        ldr             r12, [r0, r1]           @ p0
-        ldr_post        r11, r0,  r1,  lsl #1   @ p1
-
-        filter_mask_v
-        cmp             lr,  #0
-        beq             2f
-
-        filter_v        inner=0
-        filter_1
-
-        str             r8,  [r0]               @ *oq0
-A       str             r10, [r0, -r1]          @ *op0
-T       sub             r0,  r0,  r1,  lsl #1
-T       str             r10, [r0, r1]
-
-        filter_2
-
-A       str             r10, [r0, -r1, lsl #1]  @ *op1
-T       str_post        r10, r0,  r1,  lsl #1
-        str             r8,  [r0, r1]           @ *oq1
-
-        ldr             r9,  [r0, r1,  lsl #1]  @ q2
-        add             r0,  r0,  r1
-A       ldr             r11, [r0, -r1, lsl #2]  @ p2
-T       ldr_dpre        r11, r0,  r1,  lsl #2
-
-        filter_3
-
-A       str             r10, [r0, -r1, lsl #2]  @ *op2
-T       str_post        r10, r0,  r1,  lsl #2
-        str             r8,  [r0, r1]           @ *oq2
-        sub             r0,  r0,  r1
-2:
-        add             r0,  r0,  #4
-        cmp             r5,  #3
-        it              eq
-        ldreq           r0,  [sp, #16]
-        subs            r5,  r5,  #1
-        bne             1b
-
-        add             sp,  sp,  #16
-        pop             {r0, r4-r11, pc}
-endfunc
-
-function ff_vp8_v_loop_filter16_armv6, export=1
-        push            {r4-r11, lr}
-        add             r12, r0,  #8
-        push            {r12}
-        ldr             r6,  [sp, #40]
-        orr             r2,  r2,  r2,  lsl #16
-        b               vp8_v_loop_filter_armv6
-endfunc
-
-function ff_vp8_v_loop_filter8uv_armv6, export=1
-        push            {r1, r4-r11, lr}
-        mov             r1,  r2
-        orr             r2,  r3,  r3,  lsl #16
-        ldr             r3,  [sp, #40]
-        ldr             r6,  [sp, #44]
-        b               vp8_v_loop_filter_armv6
-endfunc
-
-@ void vp8_h_loop_filter16_simple(uint8_t *dst, int stride, int flim)
-function ff_vp8_h_loop_filter16_simple_armv6, export=1
-        push            {r4-r11, lr}
-        orr             r12, r2,  r2,  lsl #16
-        mov32           r2,  0x80808080
-        orr             r12, r12, r12, lsl #8
-
-        mov             lr,  #0
-        mov             r11, #4
-1:
-        sub             r0,  r0,  #2
-        ldr             r8,  [r0, r1]
-        ldr_post        r7,  r0,  r1,  lsl #1
-        ldr             r10, [r0, r1]
-        ldr_post        r9,  r0,  r1,  lsl #1
-        add             r0,  r0,  #2
-        transpose       r6,  r5,  r4,  r3,  r7,  r8,  r9,  r10
-        simple_filter
-        sub             r0,  r0,  r1,  lsl #2
-        sub             r0,  r0,  #1
-
-        uxtb16          r6,  r4
-        uxtb16          r8,  r5
-        uxtb16          r7,  r4,  ror #8
-        uxtb16          r9,  r5,  ror #8
-        orr             r6,  r6,  r8,  lsl #8
-        orr             r7,  r7,  r9,  lsl #8
-        lsr             r4,  r6,  #16
-        lsr             r5,  r7,  #16
-
-        strh_post       r6,  r0,  r1
-        strh_post       r7,  r0,  r1
-        strh_post       r4,  r0,  r1
-        strh_post       r5,  r0,  r1
-        add             r0,  r0,  #1
-2:
-        subs            r11, r11, #1
-        bne             1b
-
-        pop             {r4-r11, pc}
-endfunc
-
-function vp8_h_loop_filter_inner_armv6
-        mov             r5,  #4
-        sub             sp,  sp,  #16
-
-        orr             r3,  r3,  r3,  lsl #16
-        orr             r9,  r9,  r9,  lsl #16
-        orr             r4,  r2,  r2,  lsl #8   @ flimE
-        orr             r2,  r3,  r3,  lsl #8   @ flimI
-        orr             r3,  r9,  r9,  lsl #8   @ thresh
-        sub             r0,  r0,  #4
-1:
-        ldr             r7,  [r0, r1]
-        ldr_post        r6,  r0,  r1,  lsl #1
-        ldr             lr,  [r0, r1]
-        ldr_post        r8,  r0,  r1,  lsl #1
-
-        filter_mask_h
-
-        cmp             lr,  #0
-        sub             r0,  r0,  #2
-        beq             2f
-
-        ldr             r6,  [sp]
-
-        filter_h        inner=1
-        filter_inner
-
-        transpose       lr,  r12, r7,  r6,  r11, r8,  r9,  r10
-
-A       str             r6,  [r0, -r1, lsl #1]
-A       str             r7,  [r0, -r1]
-T       sub             r0,  r0,  r1,  lsl #1
-T       str             r7,  [r0, r1]
-T       str_post        r6,  r0,  r1,  lsl #1
-        str             r12, [r0]
-        str             lr,  [r0, r1]
-2:
-        sub             r0,  r0,  #2
-        add             r0,  r0,  r1,  lsl #1
-        cmp             r5,  #3
-        it              eq
-        ldreq           r0,  [sp, #16]
-        subs            r5,  r5,  #1
-        bne             1b
-
-        add             sp, sp, #16
-        pop             {r0, r4-r11, pc}
-endfunc
-
-function ff_vp8_h_loop_filter16_inner_armv6, export=1
-        push            {r4-r11, lr}
-        add             r12, r0,  r1,  lsl #3
-        sub             r12, r12, #4
-        push            {r12}
-        ldr             r9,  [sp, #40]
-        orr             r2,  r2,  r2,  lsl #16
-        b               vp8_h_loop_filter_inner_armv6
-endfunc
-
-function ff_vp8_h_loop_filter8uv_inner_armv6, export=1
-        sub             r1,  r1,  #4
-        push            {r1, r4-r11, lr}
-        mov             r1,  r2
-        orr             r2,  r3,  r3,  lsl #16
-        ldr             r3,  [sp, #40]
-        ldr             r9,  [sp, #44]
-        b               vp8_h_loop_filter_inner_armv6
-endfunc
-
-function vp8_h_loop_filter_armv6
-        mov             r5,  #4
-        sub             sp,  sp,  #16
-
-        orr             r3,  r3,  r3,  lsl #16
-        orr             r9,  r9,  r9,  lsl #16
-        orr             r4,  r2,  r2,  lsl #8   @ flimE
-        orr             r2,  r3,  r3,  lsl #8   @ flimI
-        orr             r3,  r9,  r9,  lsl #8   @ thresh
-1:
-        sub             r0,  r0,  #4
-        ldr             r7,  [r0, r1]
-        ldr_post        r6,  r0,  r1,  lsl #1
-        ldr             lr,  [r0, r1]
-        ldr_post        r8,  r0,  r1,  lsl #1
-
-        filter_mask_h
-        cmp             lr,  #0
-        it              eq
-        addeq           r0,  r0,  r1,  lsl #1
-        beq             2f
-
-        ldr             r6,  [sp]
-        sub             r0,  r0,  #2
-
-        filter_h        inner=0
-        filter_1
-
-        sub             r0,  r0,  r1,  lsl #1
-        uxtb16          r6,  r10
-        uxtb16          r7,  r8
-        uxtb16          r10, r10, ror #8
-        uxtb16          r8,  r8,  ror #8
-        orr             r6,  r6,  r7,  lsl #8
-        orr             r10, r10, r8,  lsl #8
-        lsr             r7,  r6,  #16
-        lsr             r8,  r10, #16
-
-        add             r0,  r0,  #1
-        strh_post       r6,  r0,  r1
-        strh_post       r10, r0,  r1
-        strh_post       r7,  r0,  r1
-        strh_post       r8,  r0,  r1
-
-        filter_2
-
-        sub             r0,  r0,  r1,  lsl #2
-        add             r0,  r0,  #3
-
-        ldrb            r11, [r0, #-5]          @ p2 for 1/7th difference
-        strb            r10, [r0, #-4]          @ op1
-        strb            r8,  [r0, #-1]          @ oq1
-        ldrb_post       r9,  r0,  r1            @ q2 for 1/7th difference
-
-        lsr             r10, r10, #8
-        lsr             r8,  r8,  #8
-
-        ldrb            r6,  [r0, #-5]
-        strb            r10, [r0, #-4]
-        strb            r8,  [r0, #-1]
-        ldrb_post       r7,  r0,  r1
-
-        lsr             r10, r10, #8
-        lsr             r8,  r8,  #8
-        orr             r11, r11, r6,  lsl #8
-        orr             r9,  r9,  r7,  lsl #8
-
-        ldrb            r6,  [r0, #-5]
-        strb            r10, [r0, #-4]
-        strb            r8,  [r0, #-1]
-        ldrb_post       r7,  r0,  r1
-
-        lsr             r10, r10, #8
-        lsr             r8,  r8,  #8
-        orr             r11, r11, r6,  lsl #16
-        orr             r9,  r9,  r7,  lsl #16
-
-        ldrb            r6,  [r0, #-5]
-        strb            r10, [r0, #-4]
-        strb            r8,  [r0, #-1]
-        ldrb_post       r7,  r0,  r1
-        orr             r11, r11, r6,  lsl #24
-        orr             r9,  r9,  r7,  lsl #24
-
-        filter_3
-
-        sub             r0,  r0,  r1,  lsl #2
-        strb            r10, [r0, #-5]
-        strb_post       r8,  r0,  r1
-        lsr             r10, r10, #8
-        lsr             r8,  r8,  #8
-        strb            r10, [r0, #-5]
-        strb_post       r8,  r0,  r1
-        lsr             r10, r10, #8
-        lsr             r8,  r8,  #8
-        strb            r10, [r0, #-5]
-        strb_post       r8,  r0,  r1
-        lsr             r10, r10, #8
-        lsr             r8,  r8,  #8
-        strb            r10, [r0, #-5]
-        strb_post       r8,  r0,  r1
-
-        sub             r0,  r0,  #2
-2:
-        cmp             r5,  #3
-        it              eq
-        ldreq           r0,  [sp, #16]
-        subs            r5,  r5,  #1
-        bne             1b
-
-        add             sp,  sp,  #16
-        pop             {r0, r4-r11, pc}
-endfunc
-
-function ff_vp8_h_loop_filter16_armv6, export=1
-        push            {r4-r11, lr}
-        add             r12, r0,  r1,  lsl #3
-        push            {r12}
-        ldr             r9,  [sp, #40]
-        orr             r2,  r2,  r2,  lsl #16
-        b               vp8_h_loop_filter_armv6
-endfunc
-
-function ff_vp8_h_loop_filter8uv_armv6, export=1
-        push            {r1, r4-r11, lr}
-        mov             r1,  r2
-        orr             r2,  r3,  r3,  lsl #16
-        ldr             r3,  [sp, #40]
-        ldr             r9,  [sp, #44]
-        b               vp8_h_loop_filter_armv6
-endfunc
-
-.ltorg
-
-@ MC
-
-@ void put_vp8_pixels16(uint8_t *dst, int dststride, uint8_t *src,
-@                       int srcstride, int h, int mx, int my)
-function ff_put_vp8_pixels16_armv6, export=1
-        push            {r4-r11}
-        ldr             r12, [sp, #32]          @ h
-1:
-        subs            r12, r12, #2
-        ldr             r5,  [r2, #4]
-        ldr             r6,  [r2, #8]
-        ldr             r7,  [r2, #12]
-        ldr_post        r4,  r2,  r3
-        ldr             r9,  [r2, #4]
-        ldr             r10, [r2, #8]
-        ldr             r11, [r2, #12]
-        ldr_post        r8,  r2,  r3
-        strd            r6,  r7,  [r0, #8]
-        strd_post       r4,  r5,  r0,  r1
-        strd            r10, r11, [r0, #8]
-        strd_post       r8,  r9,  r0,  r1
-        bgt             1b
-        pop             {r4-r11}
-        bx              lr
-endfunc
-
-@ void put_vp8_pixels8(uint8_t *dst, int dststride, uint8_t *src,
-@                      int srcstride, int h, int mx, int my)
-function ff_put_vp8_pixels8_armv6, export=1
-        push            {r4-r11}
-        ldr             r12, [sp, #32]          @ h
-1:
-        subs            r12, r12, #4
-        ldr             r5,  [r2, #4]
-        ldr_post        r4,  r2,  r3
-        ldr             r7,  [r2, #4]
-        ldr_post        r6,  r2,  r3
-        ldr             r9,  [r2, #4]
-        ldr_post        r8,  r2,  r3
-        ldr             r11, [r2, #4]
-        ldr_post        r10, r2,  r3
-        strd_post       r4,  r5,  r0,  r1
-        strd_post       r6,  r7,  r0,  r1
-        strd_post       r8,  r9,  r0,  r1
-        strd_post       r10, r11, r0,  r1
-        bgt             1b
-        pop             {r4-r11}
-        bx              lr
-endfunc
-
-@ void put_vp8_pixels4(uint8_t *dst, int dststride, uint8_t *src,
-@                      int srcstride, int h, int mx, int my)
-function ff_put_vp8_pixels4_armv6, export=1
-        ldr             r12, [sp, #0]           @ h
-        push            {r4-r6,lr}
-1:
-        subs            r12, r12, #4
-        ldr_post        r4,  r2,  r3
-        ldr_post        r5,  r2,  r3
-        ldr_post        r6,  r2,  r3
-        ldr_post        lr,  r2,  r3
-        str_post        r4,  r0,  r1
-        str_post        r5,  r0,  r1
-        str_post        r6,  r0,  r1
-        str_post        lr,  r0,  r1
-        bgt             1b
-        pop             {r4-r6,pc}
-endfunc
-
-@ note: worst case sum of all 6-tap filter values * 255 is 0x7f80 so 16 bit
-@ arithmatic can be used to apply filters
-const   sixtap_filters_13245600, align=4
-        .short     2, 108, -11,  36,  -8, 1, 0, 0
-        .short     3,  77, -16,  77, -16, 3, 0, 0
-        .short     1,  36,  -8, 108, -11, 2, 0, 0
-endconst
-
-const   fourtap_filters_1324, align=4
-        .short     -6,  12, 123, -1
-        .short     -9,  50,  93, -6
-        .short     -6,  93,  50, -9
-        .short     -1, 123,  12, -6
-endconst
-
-.macro  vp8_mc_1        name, size, hv
-function ff_put_vp8_\name\size\()_\hv\()_armv6, export=1
-        sub             r1,  r1,  #\size
-        mov             r12, sp
-        push            {r1, r4-r11, lr}
-        ldm             r12, {r5-r7}
-        mov             r4,  #\size
-        stm             r12, {r4, r5}
-        orr             r12, r6,  r7
-        b               bl_put_\name\()_\hv\()_armv6
-endfunc
-.endm
-
-vp8_mc_1                epel,  16, h6
-vp8_mc_1                epel,  16, v6
-vp8_mc_1                epel,   8, h6
-vp8_mc_1                epel,   8, v6
-vp8_mc_1                epel,   8, h4
-vp8_mc_1                epel,   8, v4
-vp8_mc_1                epel,   4, h6
-vp8_mc_1                epel,   4, v6
-vp8_mc_1                epel,   4, h4
-vp8_mc_1                epel,   4, v4
-
-vp8_mc_1                bilin, 16, h
-vp8_mc_1                bilin, 16, v
-vp8_mc_1                bilin,  8, h
-vp8_mc_1                bilin,  8, v
-vp8_mc_1                bilin,  4, h
-vp8_mc_1                bilin,  4, v
-
-/* True relational expressions have the value -1 in the GNU assembler,
-   +1 in Apple's. */
-#ifdef __APPLE__
-#   define TMPSIZE \size * (8 + 8*(\size > 4) + \ytaps - 1)
-#else
-#   define TMPSIZE \size * (8 - 8*(\size > 4) + \ytaps - 1)
-#endif
-
-.macro  vp8_mc_hv       name, size, h, v, ytaps
-function ff_put_vp8_\name\size\()_\h\v\()_armv6, export=1
-        push            {r0, r1, r4, lr}
-        add             r0,  sp,  #16
-        sub             sp,  sp,  #TMPSIZE+16
-        ldm             r0,  {r0, r12}
-        mov             r4,  #\size
-        add             lr,  r0,  #\ytaps-1
-    .if \ytaps > 2
-        sub             r2,  r2,  r3,  lsl #\ytaps >> 1 & 1
-    .endif
-        stm             sp,  {r4, lr}
-        add             r0,  sp,  #16
-        mov             r1,  #0
-        bl              vp8_put_\name\()_\h\()_armv6
-        add             r0,  sp,  #TMPSIZE+16
-        ldr             lr,  [sp, #TMPSIZE+16+16]
-        ldm             r0,  {r0, r1}
-        mov             r3,  #\size
-        ldr             r12, [sp, #TMPSIZE+16+16+8]
-        str             lr,  [sp, #4]
-        add             r2,  sp,  #16 + \size * (\ytaps / 2 - 1)
-        sub             r1,  r1,  #\size
-        bl              vp8_put_\name\()_\v\()_armv6
-        add             sp,  sp,  #TMPSIZE+16+8
-        pop             {r4, pc}
-endfunc
-.endm
-
-vp8_mc_hv               epel,  16, h6, v6, 6
-vp8_mc_hv               epel,   8, h6, v6, 6
-vp8_mc_hv               epel,   8, h4, v6, 6
-vp8_mc_hv               epel,   8, h6, v4, 4
-vp8_mc_hv               epel,   8, h4, v4, 4
-vp8_mc_hv               epel,   4, h6, v6, 6
-vp8_mc_hv               epel,   4, h4, v6, 6
-vp8_mc_hv               epel,   4, h6, v4, 4
-vp8_mc_hv               epel,   4, h4, v4, 4
-
-vp8_mc_hv               bilin, 16, h,  v,  2
-vp8_mc_hv               bilin,  8, h,  v,  2
-vp8_mc_hv               bilin,  4, h,  v,  2
-
-.macro  sat4            r0,  r1,  r2,  r3
-        asr             \r0, \r0, #7
-        asr             \r1, \r1, #7
-        pkhbt           \r0, \r0, \r2, lsl #9
-        pkhbt           \r1, \r1, \r3, lsl #9
-        usat16          \r0, #8,  \r0
-        usat16          \r1, #8,  \r1
-        orr             \r0, \r0, \r1, lsl #8
-.endm
-
-@ Calling convention for the inner MC functions:
-@       r0      dst
-@       r1      dst_stride - block_width
-@       r2      src
-@       r3      src_stride
-@       r4      block_width
-@       r12     filter_index
-@       [sp]    block_width
-@       [sp+4]  height
-@       [sp+8]  scratch
-
-function vp8_put_epel_h6_armv6
-        push            {r1, r4-r11, lr}
-bl_put_epel_h6_armv6:
-        sub             r2,  r2,  #2
-        movrel          lr,  sixtap_filters_13245600 - 16
-        add             lr,  lr,  r12, lsl #3
-        sub             r3,  r3,  r4
-        str             r3,  [sp, #48]
-        ldm             lr,  {r1, r3, lr}
-1:
-        ldr             r7,  [r2, #5]           @ src[5-8]
-        ldr             r6,  [r2, #2]           @ src[2-5]
-        ldr             r5,  [r2], #4           @ src[0-3]
-
-        pkhtb           r7,  r7,  r7,  asr #8   @ src[8,7,7,6]
-        uxtb16          r9,  r6,  ror #8        @ src[5] | src[3]
-        uxtb16          r6,  r6                 @ src[4] | src[2]
-        uxtb16          r8,  r5,  ror #8        @ src[3] | src[1]
-        uxtb16          r11, r7,  ror #8        @ src[8] | src[7]
-        uxtb16          r7,  r7                 @ src[7] | src[6]
-        uxtb16          r5,  r5                 @ src[2] | src[0]
-
-        mov             r10, #0x40
-        smlad           r5,  r5,  r1,  r10      @ filter[0][0]
-        smlad           r11, r11, lr,  r10      @ filter[3][2]
-        smlad           r12, r7,  lr,  r10      @ filter[2][2]
-        smlad           r10, r8,  r1,  r10      @ filter[1][0]
-        smlad           r5,  r8,  r3,  r5       @ filter[0][1]
-        smlad           r11, r9,  r1,  r11      @ filter[3][0]
-        smlad           r12, r9,  r3,  r12      @ filter[2][1]
-        pkhtb           r9,  r9,  r6,  asr #16  @ src[5] | src[4]
-        smlad           r10, r6,  r3,  r10      @ filter[1][1]
-        pkhbt           r7,  r9,  r7,  lsl #16  @ src[6] | src[4]
-        smlad           r5,  r9,  lr,  r5       @ filter[0][2]
-        pkhtb           r8,  r7,  r9,  asr #16  @ src[6] | src[5]
-        smlad           r11, r7,  r3,  r11      @ filter[3][1]
-        smlad           r9,  r8,  lr,  r10      @ filter[1][2]
-        smlad           r7,  r6,  r1,  r12      @ filter[2][0]
-
-        subs            r4,  r4,  #4
-
-        sat4            r5,  r9,  r7,  r11
-        str             r5,  [r0], #4
-
-        bne             1b
-
-        add             r4,  sp,  #40
-        ldm             r4,  {r4, r5, r12}
-        ldr             r6,  [sp]
-        subs            r5,  r5,  #1
-        add             r2,  r2,  r12
-        str             r5,  [sp, #44]
-        add             r0,  r0,  r6
-
-        bne             1b
-
-        pop             {r1, r4-r11, pc}
-endfunc
-
-function vp8_put_epel_v6_armv6
-        push            {r1, r4-r11, lr}
-bl_put_epel_v6_armv6:
-        movrel          lr,  sixtap_filters_13245600 - 16
-        add             lr,  lr,  r12, lsl #3
-        str             r3,  [sp, #48]
-1:
-        add             r1,  r3,  r3,  lsl #1   @ stride * 3
-        ldr_nreg        r5,  r2,  r3            @ src[0,1,2,3 + stride * 1]
-        ldr             r6,  [r2, r3]           @ src[0,1,2,3 + stride * 3]
-        ldr             r7,  [r2, r3,  lsl #1]  @ src[0,1,2,3 + stride * 4]
-        ldr             r8,  [r2, r1]           @ src[0,1,2,3 + stride * 5]
-
-        uxtb16          r9,  r5,  ror #8        @ src[3 + s*1] | src[1 + s*1]
-        uxtb16          r10, r6,  ror #8        @ src[3 + s*3] | src[1 + s*3]
-        uxtb16          r11, r7,  ror #8        @ src[3 + s*4] | src[1 + s*4]
-        uxtb16          r12, r8,  ror #8        @ src[3 + s*5] | src[1 + s*5]
-        uxtb16          r5,  r5                 @ src[2 + s*1] | src[0 + s*1]
-        uxtb16          r6,  r6                 @ src[2 + s*3] | src[0 + s*3]
-        uxtb16          r7,  r7                 @ src[2 + s*4] | src[0 + s*4]
-        uxtb16          r8,  r8                 @ src[2 + s*5] | src[0 + s*5]
-        pkhbt           r1,  r9,  r10, lsl #16  @ src[1 + s*3] | src[1 + s*1]
-        pkhtb           r9,  r10, r9,  asr #16  @ src[3 + s*3] | src[3 + s*1]
-        pkhbt           r10, r11, r12, lsl #16  @ src[1 + s*5] | src[1 + s*4]
-        pkhtb           r11, r12, r11, asr #16  @ src[3 + s*5] | src[3 + s*4]
-        pkhbt           r12, r5,  r6,  lsl #16  @ src[0 + s*3] | src[0 + s*1]
-        pkhtb           r5,  r6,  r5,  asr #16  @ src[2 + s*3] | src[2 + s*1]
-        pkhbt           r6,  r7,  r8,  lsl #16  @ src[0 + s*5] | src[0 + s*4]
-        pkhtb           r7,  r8,  r7,  asr #16  @ src[2 + s*5] | src[2 + s*4]
-
-        ldr             r8,  [lr, #4]
-        mov             r3,  #0x40
-        smlad           r12, r12, r8,  r3       @ filter[0][1]
-        smlad           r1,  r1,  r8,  r3       @ filter[1][1]
-        smlad           r5,  r5,  r8,  r3       @ filter[2][1]
-        smlad           r9,  r9,  r8,  r3       @ filter[3][1]
-        ldr             r8,  [lr, #8]
-        ldr             r3,  [sp, #48]
-        smlad           r12, r6,  r8,  r12      @ filter[0][2]
-        smlad           r1,  r10, r8,  r1       @ filter[1][2]
-        ldr_nreg        r6,  r2,  r3,  lsl #1   @ src[0,1,2,3 + stride * 0]
-        ldr             r10, [r2], #4           @ src[0,1,2,3 + stride * 2]
-        smlad           r5,  r7,  r8,  r5       @ filter[2][2]
-        smlad           r9,  r11, r8,  r9       @ filter[3][2]
-
-        uxtb16          r7,  r6,  ror #8        @ src[3 + s*0] | src[1 + s*0]
-        uxtb16          r11, r10, ror #8        @ src[3 + s*2] | src[1 + s*2]
-        uxtb16          r6,  r6                 @ src[2 + s*0] | src[0 + s*0]
-        uxtb16          r10, r10                @ src[2 + s*2] | src[0 + s*2]
-
-        pkhbt           r8,  r7,  r11, lsl #16  @ src[1 + s*2] | src[1 + s*0]
-        pkhtb           r7,  r11, r7,  asr #16  @ src[3 + s*2] | src[3 + s*0]
-        pkhbt           r11, r6,  r10, lsl #16  @ src[0 + s*2] | src[0 + s*0]
-        pkhtb           r6,  r10, r6,  asr #16  @ src[2 + s*2] | src[2 + s*0]
-
-        ldr             r10, [lr]
-        subs            r4,  r4,  #4
-        smlad           r12, r11, r10, r12      @ filter[0][0]
-        smlad           r1,  r8,  r10, r1       @ filter[1][0]
-        smlad           r5,  r6,  r10, r5       @ filter[2][0]
-        smlad           r9,  r7,  r10, r9       @ filter[3][0]
-
-        sat4            r12, r1,  r5,  r9
-        str             r12, [r0], #4
-
-        bne             1b
-
-        ldrd            r4,  r5,  [sp, #40]
-        ldr             r6,  [sp]
-        subs            r5,  r5,  #1
-        sub             r2,  r2,  r4
-        str             r5,  [sp, #44]
-        add             r0,  r0,  r6
-        add             r2,  r2,  r3
-
-        bne             1b
-
-        pop             {r1, r4-r11, pc}
-endfunc
-
-function vp8_put_epel_h4_armv6
-        push            {r1, r4-r11, lr}
-bl_put_epel_h4_armv6:
-        subs            r2,  r2,  #1
-        movrel          lr,  fourtap_filters_1324 - 4
-        add             lr,  lr,  r12, lsl #2
-        sub             r3,  r3,  r4
-        ldm             lr,  {r5, r6}
-        ldr             lr,  [sp, #44]
-1:
-        ldr             r9,  [r2, #3]
-        ldr             r8,  [r2, #2]
-        ldr             r7,  [r2], #4
-
-        uxtb16          r9,  r9,  ror #8        @ src[6] | src[4]
-        uxtb16          r10, r8,  ror #8        @ src[5] | src[3]
-        uxtb16          r8,  r8                 @ src[4] | src[2]
-        uxtb16          r11, r7,  ror #8        @ src[3] | src[1]
-        uxtb16          r7,  r7                 @ src[2] | src[0]
-
-        mov             r12, #0x40
-        smlad           r9,  r9,  r6,  r12      @ filter[3][1]
-        smlad           r7,  r7,  r5,  r12      @ filter[0][0]
-        smlad           r9,  r10, r5,  r9       @ filter[3][0]
-        smlad           r10, r10, r6,  r12      @ filter[2][1]
-        smlad           r12, r11, r5,  r12      @ filter[1][0]
-        smlad           r7,  r11, r6,  r7       @ filter[0][1]
-        smlad           r10, r8,  r5,  r10      @ filter[2][0]
-        smlad           r12, r8,  r6,  r12      @ filter[1][1]
-
-        subs            r4,  r4,  #4
-
-        sat4            r7,  r12, r10, r9
-        str             r7,  [r0], #4
-
-        bne             1b
-
-        subs            lr,  lr,  #1
-        ldr             r4,  [sp, #40]
-        add             r2,  r2,  r3
-        add             r0,  r0,  r1
-
-        bne             1b
-
-        pop             {r1, r4-r11, pc}
-endfunc
-
-function vp8_put_epel_v4_armv6
-        push            {r1, r4-r11, lr}
-bl_put_epel_v4_armv6:
-        movrel          lr,  fourtap_filters_1324 - 4
-        add             lr,  lr,  r12, lsl #2
-        ldm             lr,  {r5, r6}
-        str             r3,  [sp, #48]
-1:
-        ldr             lr,  [r2, r3, lsl #1]
-        ldr             r12, [r2, r3]
-        ldr_nreg        r7,  r2,  r3
-        ldr             r11, [r2], #4
-
-        uxtb16          r8,  lr,  ror #8        @ src[3 + s*3] | src[1 + s*3]
-        uxtb16          r9,  r12, ror #8        @ src[3 + s*2] | src[1 + s*2]
-        uxtb16          r3,  r7,  ror #8        @ src[3 + s*0] | src[1 + s*0]
-        uxtb16          r1,  r11, ror #8        @ src[3 + s*1] | src[1 + s*1]
-        uxtb16          lr,  lr                 @ src[2 + s*3] | src[0 + s*3]
-        uxtb16          r12, r12                @ src[2 + s*2] | src[0 + s*2]
-        uxtb16          r7,  r7                 @ src[2 + s*0] | src[0 + s*0]
-        uxtb16          r11, r11                @ src[2 + s*1] | src[0 + s*1]
-        pkhbt           r10, r1,  r8,  lsl #16  @ src[1 + s*3] | src[1 + s*1]
-        pkhtb           r1,  r8,  r1,  asr #16  @ src[3 + s*3] | src[3 + s*1]
-        pkhbt           r8,  r3,  r9,  lsl #16  @ src[1 + s*2] | src[1 + s*0]
-        pkhtb           r3,  r9,  r3,  asr #16  @ src[3 + s*2] | src[3 + s*0]
-        pkhbt           r9,  r11, lr,  lsl #16  @ src[0 + s*3] | src[0 + s*1]
-        pkhtb           r11, lr,  r11, asr #16  @ src[2 + s*3] | src[2 + s*1]
-        pkhbt           lr,  r7,  r12, lsl #16  @ src[0 + s*2] | src[0 + s*0]
-        pkhtb           r7,  r12, r7,  asr #16  @ src[2 + s*2] | src[2 + s*0]
-
-        mov             r12, #0x40
-        smlad           r9,  r9,  r6,  r12      @ filter[0][1]
-        smlad           r10, r10, r6,  r12      @ filter[1][1]
-        smlad           r11, r11, r6,  r12      @ filter[2][1]
-        smlad           r1,  r1,  r6,  r12      @ filter[3][1]
-        smlad           r9,  lr,  r5,  r9       @ filter[0][0]
-        smlad           r10, r8,  r5,  r10      @ filter[1][0]
-        smlad           r11, r7,  r5,  r11      @ filter[2][0]
-        smlad           r1,  r3,  r5,  r1       @ filter[3][0]
-
-        subs            r4,  r4,  #4
-        ldr             r3,  [sp, #48]
-
-        sat4            r9,  r10, r11, r1
-        str             r9,  [r0], #4
-
-        bne             1b
-
-        ldr             r4,  [sp, #40]
-        ldr             r12, [sp, #44]
-        add             r2,  r2,  r3
-        ldr             r9,  [sp, #0]
-        subs            r12, r12, #1
-        sub             r2,  r2,  r4
-        str             r12, [sp, #44]
-        add             r0,  r0,  r9
-
-        bne             1b
-
-        pop             {r1, r4-r11, pc}
-endfunc
-
-function vp8_put_bilin_h_armv6
-        push            {r1, r4-r11, lr}
-bl_put_bilin_h_armv6:
-        rsb             r5,  r12, r12, lsl #16
-        ldr             r12, [sp, #44]
-        sub             r3,  r3,  r4
-        add             r5,  r5,  #8
-1:
-        ldrb            r6,  [r2], #1
-        ldrb            r7,  [r2], #1
-        ldrb            r8,  [r2], #1
-        ldrb            r9,  [r2], #1
-        ldrb            lr,  [r2]
-
-        pkhbt           r6,  r6,  r7,  lsl #16  @ src[1] | src[0]
-        pkhbt           r7,  r7,  r8,  lsl #16  @ src[2] | src[1]
-        pkhbt           r8,  r8,  r9,  lsl #16  @ src[3] | src[2]
-        pkhbt           r9,  r9,  lr,  lsl #16  @ src[4] | src[3]
-
-        mov             r10, #4
-        smlad           r6,  r6,  r5,  r10
-        smlad           r7,  r7,  r5,  r10
-        smlad           r8,  r8,  r5,  r10
-        smlad           r9,  r9,  r5,  r10
-
-        subs            r4,  r4,  #4
-
-        asr             r6,  #3
-        asr             r7,  #3
-        pkhbt           r6,  r6,  r8,  lsl #13
-        pkhbt           r7,  r7,  r9,  lsl #13
-        orr             r6,  r6,  r7,  lsl #8
-        str             r6,  [r0], #4
-
-        bne             1b
-
-        ldr             r4,  [sp, #40]
-        subs            r12, r12, #1
-        add             r2,  r2,  r3
-        add             r0,  r0,  r1
-
-        bne             1b
-
-        pop             {r1, r4-r11, pc}
-endfunc
-
-function vp8_put_bilin_v_armv6
-        push            {r1, r4-r11, lr}
-bl_put_bilin_v_armv6:
-        rsb             r5,  r12, r12, lsl #16
-        ldr             r12, [sp, #44]
-        add             r5,  r5,  #8
-1:
-        ldrb            r10, [r2, r3]
-        ldrb            r6,  [r2], #1
-        ldrb            r11, [r2, r3]
-        ldrb            r7,  [r2], #1
-        ldrb            lr,  [r2, r3]
-        ldrb            r8,  [r2], #1
-        ldrb            r9,  [r2, r3]
-        pkhbt           r6,  r6,  r10, lsl #16
-        ldrb            r10, [r2], #1
-        pkhbt           r7,  r7,  r11, lsl #16
-        pkhbt           r8,  r8,  lr,  lsl #16
-        pkhbt           r9,  r10, r9,  lsl #16
-
-        mov             r10, #4
-        smlad           r6,  r6,  r5,  r10
-        smlad           r7,  r7,  r5,  r10
-        smlad           r8,  r8,  r5,  r10
-        smlad           r9,  r9,  r5,  r10
-
-        subs            r4,  r4,  #4
-
-        asr             r6,  #3
-        asr             r7,  #3
-        pkhbt           r6,  r6,  r8,  lsl #13
-        pkhbt           r7,  r7,  r9,  lsl #13
-        orr             r6,  r6,  r7,  lsl #8
-        str             r6,  [r0], #4
-
-        bne             1b
-
-        ldr             r4,  [sp, #40]
-        subs            r12, r12, #1
-        add             r2,  r2,  r3
-        add             r0,  r0,  r1
-        sub             r2,  r2,  r4
-
-        bne             1b
-        pop             {r1, r4-r11, pc}
-endfunc
diff --git a/deps/libav/libavcodec/arm/vp8dsp_init_arm.c b/deps/libav/libavcodec/arm/vp8dsp_init_arm.c
deleted file mode 100644
index b7897cd..0000000
--- a/deps/libav/libavcodec/arm/vp8dsp_init_arm.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/arm/cpu.h"
-#include "libavcodec/vp8dsp.h"
-#include "vp8dsp.h"
-
-av_cold void ff_vp8dsp_init_arm(VP8DSPContext *dsp)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_armv6(cpu_flags))
-        ff_vp8dsp_init_armv6(dsp);
-    if (have_neon(cpu_flags))
-        ff_vp8dsp_init_neon(dsp);
-}
diff --git a/deps/libav/libavcodec/arm/vp8dsp_init_armv6.c b/deps/libav/libavcodec/arm/vp8dsp_init_armv6.c
deleted file mode 100644
index e15e191..0000000
--- a/deps/libav/libavcodec/arm/vp8dsp_init_armv6.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavcodec/vp8dsp.h"
-#include "vp8dsp.h"
-
-void ff_vp8_luma_dc_wht_armv6(int16_t block[4][4][16], int16_t dc[16]);
-void ff_vp8_luma_dc_wht_dc_armv6(int16_t block[4][4][16], int16_t dc[16]);
-
-void ff_vp8_idct_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
-void ff_vp8_idct_dc_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
-void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
-void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
-
-VP8_LF(armv6);
-
-VP8_EPEL(16, armv6);
-VP8_EPEL(8,  armv6);
-VP8_EPEL(4,  armv6);
-
-VP8_BILIN(16, armv6);
-VP8_BILIN(8,  armv6);
-VP8_BILIN(4,  armv6);
-
-av_cold void ff_vp8dsp_init_armv6(VP8DSPContext *dsp)
-{
-    dsp->vp8_luma_dc_wht    = ff_vp8_luma_dc_wht_armv6;
-    dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_armv6;
-
-    dsp->vp8_idct_add       = ff_vp8_idct_add_armv6;
-    dsp->vp8_idct_dc_add    = ff_vp8_idct_dc_add_armv6;
-    dsp->vp8_idct_dc_add4y  = ff_vp8_idct_dc_add4y_armv6;
-    dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_armv6;
-
-    dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_armv6;
-    dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_armv6;
-    dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_armv6;
-    dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_armv6;
-
-    dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_armv6;
-    dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_armv6;
-    dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_armv6;
-    dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_armv6;
-
-    dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_armv6;
-    dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_armv6;
-
-    dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_armv6;
-    dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_armv6;
-    dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_armv6;
-    dsp->put_vp8_epel_pixels_tab[0][2][2] = ff_put_vp8_epel16_h6v6_armv6;
-
-    dsp->put_vp8_epel_pixels_tab[1][0][0] = ff_put_vp8_pixels8_armv6;
-    dsp->put_vp8_epel_pixels_tab[1][0][1] = ff_put_vp8_epel8_h4_armv6;
-    dsp->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_armv6;
-    dsp->put_vp8_epel_pixels_tab[1][1][0] = ff_put_vp8_epel8_v4_armv6;
-    dsp->put_vp8_epel_pixels_tab[1][1][1] = ff_put_vp8_epel8_h4v4_armv6;
-    dsp->put_vp8_epel_pixels_tab[1][1][2] = ff_put_vp8_epel8_h6v4_armv6;
-    dsp->put_vp8_epel_pixels_tab[1][2][0] = ff_put_vp8_epel8_v6_armv6;
-    dsp->put_vp8_epel_pixels_tab[1][2][1] = ff_put_vp8_epel8_h4v6_armv6;
-    dsp->put_vp8_epel_pixels_tab[1][2][2] = ff_put_vp8_epel8_h6v6_armv6;
-
-    dsp->put_vp8_epel_pixels_tab[2][0][0] = ff_put_vp8_pixels4_armv6;
-    dsp->put_vp8_epel_pixels_tab[2][0][1] = ff_put_vp8_epel4_h4_armv6;
-    dsp->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_armv6;
-    dsp->put_vp8_epel_pixels_tab[2][1][0] = ff_put_vp8_epel4_v4_armv6;
-    dsp->put_vp8_epel_pixels_tab[2][1][1] = ff_put_vp8_epel4_h4v4_armv6;
-    dsp->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_armv6;
-    dsp->put_vp8_epel_pixels_tab[2][2][0] = ff_put_vp8_epel4_v6_armv6;
-    dsp->put_vp8_epel_pixels_tab[2][2][1] = ff_put_vp8_epel4_h4v6_armv6;
-    dsp->put_vp8_epel_pixels_tab[2][2][2] = ff_put_vp8_epel4_h6v6_armv6;
-
-    dsp->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[0][0][1] = ff_put_vp8_bilin16_h_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[0][0][2] = ff_put_vp8_bilin16_h_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[0][1][0] = ff_put_vp8_bilin16_v_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[0][1][1] = ff_put_vp8_bilin16_hv_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[0][1][2] = ff_put_vp8_bilin16_hv_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[0][2][0] = ff_put_vp8_bilin16_v_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[0][2][1] = ff_put_vp8_bilin16_hv_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[0][2][2] = ff_put_vp8_bilin16_hv_armv6;
-
-    dsp->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[1][0][1] = ff_put_vp8_bilin8_h_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilin8_h_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[1][1][0] = ff_put_vp8_bilin8_v_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[1][1][1] = ff_put_vp8_bilin8_hv_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[1][1][2] = ff_put_vp8_bilin8_hv_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilin8_v_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[1][2][1] = ff_put_vp8_bilin8_hv_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[1][2][2] = ff_put_vp8_bilin8_hv_armv6;
-
-    dsp->put_vp8_bilinear_pixels_tab[2][0][0] = ff_put_vp8_pixels4_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilin4_h_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilin4_h_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilin4_v_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[2][1][1] = ff_put_vp8_bilin4_hv_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[2][1][2] = ff_put_vp8_bilin4_hv_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_armv6;
-    dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_armv6;
-}
diff --git a/deps/libav/libavcodec/arm/vp8dsp_init_neon.c b/deps/libav/libavcodec/arm/vp8dsp_init_neon.c
deleted file mode 100644
index 0468181..0000000
--- a/deps/libav/libavcodec/arm/vp8dsp_init_neon.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavcodec/vp8dsp.h"
-#include "vp8dsp.h"
-
-void ff_vp8_luma_dc_wht_neon(int16_t block[4][4][16], int16_t dc[16]);
-
-void ff_vp8_idct_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
-void ff_vp8_idct_dc_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
-void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
-void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
-
-VP8_LF(neon);
-
-VP8_EPEL(16, neon);
-VP8_EPEL(8,  neon);
-VP8_EPEL(4,  neon);
-
-VP8_BILIN(16, neon);
-VP8_BILIN(8,  neon);
-VP8_BILIN(4,  neon);
-
-av_cold void ff_vp8dsp_init_neon(VP8DSPContext *dsp)
-{
-    dsp->vp8_luma_dc_wht    = ff_vp8_luma_dc_wht_neon;
-
-    dsp->vp8_idct_add       = ff_vp8_idct_add_neon;
-    dsp->vp8_idct_dc_add    = ff_vp8_idct_dc_add_neon;
-    dsp->vp8_idct_dc_add4y  = ff_vp8_idct_dc_add4y_neon;
-    dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_neon;
-
-    dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_neon;
-    dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_neon;
-    dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_neon;
-    dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_neon;
-
-    dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_neon;
-    dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_neon;
-    dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_neon;
-    dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_neon;
-
-    dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_neon;
-    dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_neon;
-
-    dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon;
-    dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_neon;
-    dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_neon;
-    dsp->put_vp8_epel_pixels_tab[0][2][2] = ff_put_vp8_epel16_h6v6_neon;
-
-    dsp->put_vp8_epel_pixels_tab[1][0][0] = ff_put_vp8_pixels8_neon;
-    dsp->put_vp8_epel_pixels_tab[1][0][1] = ff_put_vp8_epel8_h4_neon;
-    dsp->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_neon;
-    dsp->put_vp8_epel_pixels_tab[1][1][0] = ff_put_vp8_epel8_v4_neon;
-    dsp->put_vp8_epel_pixels_tab[1][1][1] = ff_put_vp8_epel8_h4v4_neon;
-    dsp->put_vp8_epel_pixels_tab[1][1][2] = ff_put_vp8_epel8_h6v4_neon;
-    dsp->put_vp8_epel_pixels_tab[1][2][0] = ff_put_vp8_epel8_v6_neon;
-    dsp->put_vp8_epel_pixels_tab[1][2][1] = ff_put_vp8_epel8_h4v6_neon;
-    dsp->put_vp8_epel_pixels_tab[1][2][2] = ff_put_vp8_epel8_h6v6_neon;
-
-    dsp->put_vp8_epel_pixels_tab[2][0][1] = ff_put_vp8_epel4_h4_neon;
-    dsp->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_neon;
-    dsp->put_vp8_epel_pixels_tab[2][1][0] = ff_put_vp8_epel4_v4_neon;
-    dsp->put_vp8_epel_pixels_tab[2][1][1] = ff_put_vp8_epel4_h4v4_neon;
-    dsp->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_neon;
-    dsp->put_vp8_epel_pixels_tab[2][2][0] = ff_put_vp8_epel4_v6_neon;
-    dsp->put_vp8_epel_pixels_tab[2][2][1] = ff_put_vp8_epel4_h4v6_neon;
-    dsp->put_vp8_epel_pixels_tab[2][2][2] = ff_put_vp8_epel4_h6v6_neon;
-
-    dsp->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon;
-    dsp->put_vp8_bilinear_pixels_tab[0][0][1] = ff_put_vp8_bilin16_h_neon;
-    dsp->put_vp8_bilinear_pixels_tab[0][0][2] = ff_put_vp8_bilin16_h_neon;
-    dsp->put_vp8_bilinear_pixels_tab[0][1][0] = ff_put_vp8_bilin16_v_neon;
-    dsp->put_vp8_bilinear_pixels_tab[0][1][1] = ff_put_vp8_bilin16_hv_neon;
-    dsp->put_vp8_bilinear_pixels_tab[0][1][2] = ff_put_vp8_bilin16_hv_neon;
-    dsp->put_vp8_bilinear_pixels_tab[0][2][0] = ff_put_vp8_bilin16_v_neon;
-    dsp->put_vp8_bilinear_pixels_tab[0][2][1] = ff_put_vp8_bilin16_hv_neon;
-    dsp->put_vp8_bilinear_pixels_tab[0][2][2] = ff_put_vp8_bilin16_hv_neon;
-
-    dsp->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_neon;
-    dsp->put_vp8_bilinear_pixels_tab[1][0][1] = ff_put_vp8_bilin8_h_neon;
-    dsp->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilin8_h_neon;
-    dsp->put_vp8_bilinear_pixels_tab[1][1][0] = ff_put_vp8_bilin8_v_neon;
-    dsp->put_vp8_bilinear_pixels_tab[1][1][1] = ff_put_vp8_bilin8_hv_neon;
-    dsp->put_vp8_bilinear_pixels_tab[1][1][2] = ff_put_vp8_bilin8_hv_neon;
-    dsp->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilin8_v_neon;
-    dsp->put_vp8_bilinear_pixels_tab[1][2][1] = ff_put_vp8_bilin8_hv_neon;
-    dsp->put_vp8_bilinear_pixels_tab[1][2][2] = ff_put_vp8_bilin8_hv_neon;
-
-    dsp->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilin4_h_neon;
-    dsp->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilin4_h_neon;
-    dsp->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilin4_v_neon;
-    dsp->put_vp8_bilinear_pixels_tab[2][1][1] = ff_put_vp8_bilin4_hv_neon;
-    dsp->put_vp8_bilinear_pixels_tab[2][1][2] = ff_put_vp8_bilin4_hv_neon;
-    dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_neon;
-    dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_neon;
-    dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_neon;
-}
diff --git a/deps/libav/libavcodec/arm/vp8dsp_neon.S b/deps/libav/libavcodec/arm/vp8dsp_neon.S
deleted file mode 100644
index 544332c..0000000
--- a/deps/libav/libavcodec/arm/vp8dsp_neon.S
+++ /dev/null
@@ -1,1867 +0,0 @@
-/*
- * VP8 NEON optimisations
- *
- * Copyright (c) 2010 Rob Clark <rob at ti.com>
- * Copyright (c) 2011 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/arm/asm.S"
-#include "neon.S"
-
-function ff_vp8_luma_dc_wht_neon, export=1
-        vld1.16         {q0-q1},  [r1,:128]
-        vmov.i16        q15, #0
-
-        vadd.i16        d4,  d0,  d3
-        vadd.i16        d6,  d1,  d2
-        vst1.16         {q15},    [r1,:128]!
-        vsub.i16        d7,  d1,  d2
-        vsub.i16        d5,  d0,  d3
-        vst1.16         {q15},    [r1,:128]
-        vadd.i16        q0,  q2,  q3
-        vsub.i16        q1,  q2,  q3
-
-        vmov.i16        q8, #3
-
-        vtrn.32         d0,  d2
-        vtrn.32         d1,  d3
-        vtrn.16         d0,  d1
-        vtrn.16         d2,  d3
-
-        vadd.i16        d0,  d0,  d16
-
-        vadd.i16        d4,  d0,  d3
-        vadd.i16        d6,  d1,  d2
-        vsub.i16        d7,  d1,  d2
-        vsub.i16        d5,  d0,  d3
-        vadd.i16        q0,  q2,  q3
-        vsub.i16        q1,  q2,  q3
-
-        vshr.s16        q0,  q0,  #3
-        vshr.s16        q1,  q1,  #3
-
-        mov             r3,  #32
-        vst1.16         {d0[0]},  [r0,:16], r3
-        vst1.16         {d1[0]},  [r0,:16], r3
-        vst1.16         {d2[0]},  [r0,:16], r3
-        vst1.16         {d3[0]},  [r0,:16], r3
-        vst1.16         {d0[1]},  [r0,:16], r3
-        vst1.16         {d1[1]},  [r0,:16], r3
-        vst1.16         {d2[1]},  [r0,:16], r3
-        vst1.16         {d3[1]},  [r0,:16], r3
-        vst1.16         {d0[2]},  [r0,:16], r3
-        vst1.16         {d1[2]},  [r0,:16], r3
-        vst1.16         {d2[2]},  [r0,:16], r3
-        vst1.16         {d3[2]},  [r0,:16], r3
-        vst1.16         {d0[3]},  [r0,:16], r3
-        vst1.16         {d1[3]},  [r0,:16], r3
-        vst1.16         {d2[3]},  [r0,:16], r3
-        vst1.16         {d3[3]},  [r0,:16], r3
-
-        bx              lr
-endfunc
-
-function ff_vp8_idct_add_neon, export=1
-        vld1.16         {q0-q1},  [r1,:128]
-        movw            r3,  #20091
-        movt            r3,  #35468/2
-        vdup.32         d4,  r3
-
-        vmull.s16       q12, d1,  d4[0]
-        vmull.s16       q13, d3,  d4[0]
-        vqdmulh.s16     d20, d1,  d4[1]
-        vqdmulh.s16     d23, d3,  d4[1]
-        vshrn.s32       d21, q12, #16
-        vshrn.s32       d22, q13, #16
-        vadd.s16        d21, d21, d1
-        vadd.s16        d22, d22, d3
-
-        vadd.s16        d16, d0,  d2
-        vsub.s16        d17, d0,  d2
-        vadd.s16        d18, d21, d23
-        vsub.s16        d19, d20, d22
-        vadd.s16        q0,  q8,  q9
-        vsub.s16        q1,  q8,  q9
-
-        vtrn.32         d0,  d3
-        vtrn.32         d1,  d2
-        vtrn.16         d0,  d1
-        vtrn.16         d3,  d2
-
-        vmov.i16        q15, #0
-        vmull.s16       q12, d1,  d4[0]
-        vst1.16         {q15},    [r1,:128]!
-        vmull.s16       q13, d2,  d4[0]
-        vst1.16         {q15},    [r1,:128]
-        vqdmulh.s16     d21, d1,  d4[1]
-        vqdmulh.s16     d23, d2,  d4[1]
-        vshrn.s32       d20, q12, #16
-        vshrn.s32       d22, q13, #16
-        vadd.i16        d20, d20, d1
-        vadd.i16        d22, d22, d2
-
-        vadd.i16        d16, d0,  d3
-        vsub.i16        d17, d0,  d3
-        vadd.i16        d18, d20, d23
-        vld1.32         {d20[]},  [r0,:32], r2
-        vsub.i16        d19, d21, d22
-        vld1.32         {d22[]},  [r0,:32], r2
-        vadd.s16        q0,  q8,  q9
-        vld1.32         {d23[]},  [r0,:32], r2
-        vsub.s16        q1,  q8,  q9
-        vld1.32         {d21[]},  [r0,:32], r2
-        vrshr.s16       q0,  q0,  #3
-        vtrn.32         q10, q11
-        vrshr.s16       q1,  q1,  #3
-
-        sub             r0,  r0,  r2,  lsl #2
-
-        vtrn.32         d0,  d3
-        vtrn.32         d1,  d2
-        vtrn.16         d0,  d1
-        vtrn.16         d3,  d2
-
-        vaddw.u8        q0,  q0,  d20
-        vaddw.u8        q1,  q1,  d21
-        vqmovun.s16     d0,  q0
-        vqmovun.s16     d1,  q1
-
-        vst1.32         {d0[0]},  [r0,:32], r2
-        vst1.32         {d0[1]},  [r0,:32], r2
-        vst1.32         {d1[1]},  [r0,:32], r2
-        vst1.32         {d1[0]},  [r0,:32], r2
-
-        bx              lr
-endfunc
-
-function ff_vp8_idct_dc_add_neon, export=1
-        mov             r3,  #0
-        ldrsh           r12, [r1]
-        strh            r3,  [r1]
-        vdup.16         q1,  r12
-        vrshr.s16       q1,  q1,  #3
-        vld1.32         {d0[]},   [r0,:32], r2
-        vld1.32         {d1[]},   [r0,:32], r2
-        vld1.32         {d0[1]},  [r0,:32], r2
-        vld1.32         {d1[1]},  [r0,:32], r2
-        vaddw.u8        q2,  q1,  d0
-        vaddw.u8        q3,  q1,  d1
-        sub             r0,  r0,  r2, lsl #2
-        vqmovun.s16     d0,  q2
-        vqmovun.s16     d1,  q3
-        vst1.32         {d0[0]},  [r0,:32], r2
-        vst1.32         {d1[0]},  [r0,:32], r2
-        vst1.32         {d0[1]},  [r0,:32], r2
-        vst1.32         {d1[1]},  [r0,:32], r2
-        bx              lr
-endfunc
-
-function ff_vp8_idct_dc_add4uv_neon, export=1
-        vmov.i16        d0,  #0
-        mov             r3,  #32
-        vld1.16         {d16[]},  [r1,:16]
-        vst1.16         {d0[0]},  [r1,:16], r3
-        vld1.16         {d17[]},  [r1,:16]
-        vst1.16         {d0[0]},  [r1,:16], r3
-        vld1.16         {d18[]},  [r1,:16]
-        vst1.16         {d0[0]},  [r1,:16], r3
-        vld1.16         {d19[]},  [r1,:16]
-        vst1.16         {d0[0]},  [r1,:16], r3
-        mov             r3,  r0
-        vrshr.s16       q8,  q8,  #3            @ dc >>= 3
-        vld1.8          {d0},     [r0,:64], r2
-        vrshr.s16       q9,  q9,  #3
-        vld1.8          {d1},     [r0,:64], r2
-        vaddw.u8        q10, q8,  d0
-        vld1.8          {d2},     [r0,:64], r2
-        vaddw.u8        q0,  q8,  d1
-        vld1.8          {d3},     [r0,:64], r2
-        vaddw.u8        q11, q8,  d2
-        vld1.8          {d4},     [r0,:64], r2
-        vaddw.u8        q1,  q8,  d3
-        vld1.8          {d5},     [r0,:64], r2
-        vaddw.u8        q12, q9,  d4
-        vld1.8          {d6},     [r0,:64], r2
-        vaddw.u8        q2,  q9,  d5
-        vld1.8          {d7},     [r0,:64], r2
-        vaddw.u8        q13, q9,  d6
-        vqmovun.s16     d20, q10
-        vaddw.u8        q3,  q9,  d7
-        vqmovun.s16     d21, q0
-        vqmovun.s16     d22, q11
-        vst1.8          {d20},    [r3,:64], r2
-        vqmovun.s16     d23, q1
-        vst1.8          {d21},    [r3,:64], r2
-        vqmovun.s16     d24, q12
-        vst1.8          {d22},    [r3,:64], r2
-        vqmovun.s16     d25, q2
-        vst1.8          {d23},    [r3,:64], r2
-        vqmovun.s16     d26, q13
-        vst1.8          {d24},    [r3,:64], r2
-        vqmovun.s16     d27, q3
-        vst1.8          {d25},    [r3,:64], r2
-        vst1.8          {d26},    [r3,:64], r2
-        vst1.8          {d27},    [r3,:64], r2
-
-        bx              lr
-endfunc
-
-function ff_vp8_idct_dc_add4y_neon, export=1
-        vmov.i16        d0,  #0
-        mov             r3,  #32
-        vld1.16         {d16[]},  [r1,:16]
-        vst1.16         {d0[0]},  [r1,:16], r3
-        vld1.16         {d17[]},  [r1,:16]
-        vst1.16         {d0[0]},  [r1,:16], r3
-        vld1.16         {d18[]},  [r1,:16]
-        vst1.16         {d0[0]},  [r1,:16], r3
-        vld1.16         {d19[]},  [r1,:16]
-        vst1.16         {d0[0]},  [r1,:16], r3
-        vrshr.s16       q8,  q8,  #3            @ dc >>= 3
-        vld1.8          {q0},     [r0,:128], r2
-        vrshr.s16       q9,  q9,  #3
-        vld1.8          {q1},     [r0,:128], r2
-        vaddw.u8        q10, q8,  d0
-        vld1.8          {q2},     [r0,:128], r2
-        vaddw.u8        q0,  q9,  d1
-        vld1.8          {q3},     [r0,:128], r2
-        vaddw.u8        q11, q8,  d2
-        vaddw.u8        q1,  q9,  d3
-        vaddw.u8        q12, q8,  d4
-        vaddw.u8        q2,  q9,  d5
-        vaddw.u8        q13, q8,  d6
-        vaddw.u8        q3,  q9,  d7
-        sub             r0,  r0,  r2,  lsl #2
-        vqmovun.s16     d20, q10
-        vqmovun.s16     d21, q0
-        vqmovun.s16     d22, q11
-        vqmovun.s16     d23, q1
-        vqmovun.s16     d24, q12
-        vst1.8          {q10},    [r0,:128], r2
-        vqmovun.s16     d25, q2
-        vst1.8          {q11},    [r0,:128], r2
-        vqmovun.s16     d26, q13
-        vst1.8          {q12},    [r0,:128], r2
-        vqmovun.s16     d27, q3
-        vst1.8          {q13},    [r0,:128], r2
-
-        bx              lr
-endfunc
-
-@ Register layout:
-@   P3..Q3 -> q0..q7
-@   flim_E -> q14
-@   flim_I -> q15
-@   hev_thresh -> r12
-@
-.macro  vp8_loop_filter, inner=0, simple=0
-    .if \simple
-        vabd.u8         q9,  q3,  q4            @ abs(P0-Q0)
-        vabd.u8         q15, q2,  q5            @ abs(P1-Q1)
-        vqadd.u8        q9,  q9,  q9            @ abs(P0-Q0) * 2
-        vshr.u8         q10, q15, #1            @ abs(P1-Q1) / 2
-        vqadd.u8        q11, q9,  q10           @ (abs(P0-Q0)*2) + (abs(P1-Q1)/2)
-        vmov.i8         q13, #0x80
-        vcle.u8         q8,  q11, q14           @ (abs(P0-Q0)*2) + (abs(P1-Q1)/2) <= flim
-    .else
-        @ calculate hev and normal_limit:
-        vabd.u8         q12, q2,  q3            @ abs(P1-P0)
-        vabd.u8         q13, q5,  q4            @ abs(Q1-Q0)
-        vabd.u8         q10, q0,  q1            @ abs(P3-P2)
-        vabd.u8         q11, q1,  q2            @ abs(P2-P1)
-        vcle.u8         q8,  q12, q15           @ abs(P1-P0) <= flim_I
-        vcle.u8         q9,  q13, q15           @ abs(Q1-Q0) <= flim_I
-        vcle.u8         q10, q10, q15           @ abs(P3-P2) <= flim_I
-        vcle.u8         q11, q11, q15           @ abs(P2-P1) <= flim_I
-        vand            q8,  q8,  q9
-        vabd.u8         q9,  q7,  q6            @ abs(Q3-Q2)
-        vand            q8,  q8,  q11
-        vabd.u8         q11, q6,  q5            @ abs(Q2-Q1)
-        vand            q8,  q8,  q10
-        vcle.u8         q10, q9,  q15           @ abs(Q3-Q2) <= flim_I
-        vcle.u8         q11, q11, q15           @ abs(Q2-Q1) <= flim_I
-        vabd.u8         q9,  q3,  q4            @ abs(P0-Q0)
-        vabd.u8         q15, q2,  q5            @ abs(P1-Q1)
-        vand            q8,  q8,  q10
-        vqadd.u8        q9,  q9,  q9            @ abs(P0-Q0) * 2
-        vand            q8,  q8,  q11
-        vshr.u8         q10, q15, #1            @ abs(P1-Q1) / 2
-        vdup.8          q15, r12                @ hev_thresh
-        vqadd.u8        q11, q9,  q10           @ (abs(P0-Q0)*2) + (abs(P1-Q1)/2)
-        vcgt.u8         q12, q12, q15           @ abs(P1-P0) > hev_thresh
-        vcle.u8         q11, q11, q14           @ (abs(P0-Q0)*2) + (abs(P1-Q1)/2) <= flim_E
-        vcgt.u8         q14, q13, q15           @ abs(Q1-Q0) > hev_thresh
-        vand            q8,  q8,  q11
-        vmov.i8         q13, #0x80
-        vorr            q9,  q12, q14
-    .endif
-
-        @ at this point:
-        @   q8: normal_limit
-        @   q9: hev
-
-        @ convert to signed value:
-        veor            q3,  q3,  q13           @ PS0 = P0 ^ 0x80
-        veor            q4,  q4,  q13           @ QS0 = Q0 ^ 0x80
-
-        vmov.i16        q12, #3
-        vsubl.s8        q10, d8,  d6            @ QS0 - PS0
-        vsubl.s8        q11, d9,  d7            @   (widened to 16bit)
-        veor            q2,  q2,  q13           @ PS1 = P1 ^ 0x80
-        veor            q5,  q5,  q13           @ QS1 = Q1 ^ 0x80
-        vmul.i16        q10, q10, q12           @ w = 3 * (QS0 - PS0)
-        vmul.i16        q11, q11, q12
-
-        vqsub.s8        q12, q2,  q5            @ clamp(PS1-QS1)
-        vmov.i8         q14, #4
-        vmov.i8         q15, #3
-    .if \inner
-        vand            q12, q12, q9            @ if(hev) w += clamp(PS1-QS1)
-    .endif
-        vaddw.s8        q10, q10, d24           @ w += clamp(PS1-QS1)
-        vaddw.s8        q11, q11, d25
-        vqmovn.s16      d20, q10                @ narrow result back into q10
-        vqmovn.s16      d21, q11
-    .if !\inner && !\simple
-        veor            q1,  q1,  q13           @ PS2 = P2 ^ 0x80
-        veor            q6,  q6,  q13           @ QS2 = Q2 ^ 0x80
-    .endif
-        vand            q10, q10, q8            @ w &= normal_limit
-
-        @ registers used at this point..
-        @   q0 -> P3  (don't corrupt)
-        @   q1-q6 -> PS2-QS2
-        @   q7 -> Q3  (don't corrupt)
-        @   q9 -> hev
-        @   q10 -> w
-        @   q13 -> #0x80
-        @   q14 -> #4
-        @   q15 -> #3
-        @   q8, q11, q12 -> unused
-
-        @ filter_common:   is4tap==1
-        @   c1 = clamp(w + 4) >> 3;
-        @   c2 = clamp(w + 3) >> 3;
-        @   Q0 = s2u(QS0 - c1);
-        @   P0 = s2u(PS0 + c2);
-
-    .if \simple
-        vqadd.s8        q11, q10, q14           @ c1 = clamp((w&hev)+4)
-        vqadd.s8        q12, q10, q15           @ c2 = clamp((w&hev)+3)
-        vshr.s8         q11, q11, #3            @ c1 >>= 3
-        vshr.s8         q12, q12, #3            @ c2 >>= 3
-        vqsub.s8        q4,  q4,  q11           @ QS0 = clamp(QS0-c1)
-        vqadd.s8        q3,  q3,  q12           @ PS0 = clamp(PS0+c2)
-        veor            q4,  q4,  q13           @ Q0 = QS0 ^ 0x80
-        veor            q3,  q3,  q13           @ P0 = PS0 ^ 0x80
-        veor            q5,  q5,  q13           @ Q1 = QS1 ^ 0x80
-        veor            q2,  q2,  q13           @ P1 = PS1 ^ 0x80
-    .elseif \inner
-        @ the !is4tap case of filter_common, only used for inner blocks
-        @   c3 = ((c1&~hev) + 1) >> 1;
-        @   Q1 = s2u(QS1 - c3);
-        @   P1 = s2u(PS1 + c3);
-        vqadd.s8        q11, q10, q14           @ c1 = clamp((w&hev)+4)
-        vqadd.s8        q12, q10, q15           @ c2 = clamp((w&hev)+3)
-        vshr.s8         q11, q11, #3            @ c1 >>= 3
-        vshr.s8         q12, q12, #3            @ c2 >>= 3
-        vqsub.s8        q4,  q4,  q11           @ QS0 = clamp(QS0-c1)
-        vqadd.s8        q3,  q3,  q12           @ PS0 = clamp(PS0+c2)
-        vbic            q11, q11, q9            @ c1 & ~hev
-        veor            q4,  q4,  q13           @ Q0 = QS0 ^ 0x80
-        vrshr.s8        q11, q11, #1            @ c3 >>= 1
-        veor            q3,  q3,  q13           @ P0 = PS0 ^ 0x80
-        vqsub.s8        q5,  q5,  q11           @ QS1 = clamp(QS1-c3)
-        vqadd.s8        q2,  q2,  q11           @ PS1 = clamp(PS1+c3)
-        veor            q5,  q5,  q13           @ Q1 = QS1 ^ 0x80
-        veor            q2,  q2,  q13           @ P1 = PS1 ^ 0x80
-    .else
-        vand            q12, q10, q9            @ w & hev
-        vqadd.s8        q11, q12, q14           @ c1 = clamp((w&hev)+4)
-        vqadd.s8        q12, q12, q15           @ c2 = clamp((w&hev)+3)
-        vshr.s8         q11, q11, #3            @ c1 >>= 3
-        vshr.s8         q12, q12, #3            @ c2 >>= 3
-        vbic            q10, q10, q9            @ w &= ~hev
-        vqsub.s8        q4,  q4,  q11           @ QS0 = clamp(QS0-c1)
-        vqadd.s8        q3,  q3,  q12           @ PS0 = clamp(PS0+c2)
-
-        @ filter_mbedge:
-        @   a = clamp((27*w + 63) >> 7);
-        @   Q0 = s2u(QS0 - a);
-        @   P0 = s2u(PS0 + a);
-        @   a = clamp((18*w + 63) >> 7);
-        @   Q1 = s2u(QS1 - a);
-        @   P1 = s2u(PS1 + a);
-        @   a = clamp((9*w + 63) >> 7);
-        @   Q2 = s2u(QS2 - a);
-        @   P2 = s2u(PS2 + a);
-        vmov.i16        q9,  #63
-        vshll.s8        q14, d20, #3
-        vshll.s8        q15, d21, #3
-        vaddw.s8        q14, q14, d20
-        vaddw.s8        q15, q15, d21
-        vadd.s16        q8,  q9,  q14
-        vadd.s16        q9,  q9,  q15           @  9*w + 63
-        vadd.s16        q11, q8,  q14
-        vadd.s16        q12, q9,  q15           @ 18*w + 63
-        vadd.s16        q14, q11, q14
-        vadd.s16        q15, q12, q15           @ 27*w + 63
-        vqshrn.s16      d16, q8,  #7
-        vqshrn.s16      d17, q9,  #7            @ clamp(( 9*w + 63)>>7)
-        vqshrn.s16      d22, q11, #7
-        vqshrn.s16      d23, q12, #7            @ clamp((18*w + 63)>>7)
-        vqshrn.s16      d28, q14, #7
-        vqshrn.s16      d29, q15, #7            @ clamp((27*w + 63)>>7)
-        vqadd.s8        q1,  q1,  q8            @ PS2 = clamp(PS2+a)
-        vqsub.s8        q6,  q6,  q8            @ QS2 = clamp(QS2-a)
-        vqadd.s8        q2,  q2,  q11           @ PS1 = clamp(PS1+a)
-        vqsub.s8        q5,  q5,  q11           @ QS1 = clamp(QS1-a)
-        vqadd.s8        q3,  q3,  q14           @ PS0 = clamp(PS0+a)
-        vqsub.s8        q4,  q4,  q14           @ QS0 = clamp(QS0-a)
-        veor            q3,  q3,  q13           @ P0 = PS0 ^ 0x80
-        veor            q4,  q4,  q13           @ Q0 = QS0 ^ 0x80
-        veor            q2,  q2,  q13           @ P1 = PS1 ^ 0x80
-        veor            q5,  q5,  q13           @ Q1 = QS1 ^ 0x80
-        veor            q1,  q1,  q13           @ P2 = PS2 ^ 0x80
-        veor            q6,  q6,  q13           @ Q2 = QS2 ^ 0x80
-    .endif
-.endm
-
-.macro  vp8_v_loop_filter16 name, inner=0, simple=0
-function ff_vp8_v_loop_filter16\name\()_neon, export=1
-        vpush           {q4-q7}
-        sub             r0,  r0,  r1,  lsl #1+!\simple
-
-        @ Load pixels:
-    .if !\simple
-        ldr             r12, [sp, #64]          @ hev_thresh
-        vld1.8          {q0},     [r0,:128], r1 @ P3
-        vld1.8          {q1},     [r0,:128], r1 @ P2
-    .endif
-        vld1.8          {q2},     [r0,:128], r1 @ P1
-        vld1.8          {q3},     [r0,:128], r1 @ P0
-        vld1.8          {q4},     [r0,:128], r1 @ Q0
-        vld1.8          {q5},     [r0,:128], r1 @ Q1
-    .if !\simple
-        vld1.8          {q6},     [r0,:128], r1 @ Q2
-        vld1.8          {q7},     [r0,:128]     @ Q3
-        vdup.8          q15, r3                 @ flim_I
-    .endif
-        vdup.8          q14, r2                 @ flim_E
-
-        vp8_loop_filter inner=\inner, simple=\simple
-
-        @ back up to P2:  dst -= stride * 6
-        sub             r0,  r0,  r1,  lsl #2
-    .if !\simple
-        sub             r0,  r0,  r1,  lsl #1
-
-        @ Store pixels:
-        vst1.8          {q1},     [r0,:128], r1 @ P2
-    .endif
-        vst1.8          {q2},     [r0,:128], r1 @ P1
-        vst1.8          {q3},     [r0,:128], r1 @ P0
-        vst1.8          {q4},     [r0,:128], r1 @ Q0
-        vst1.8          {q5},     [r0,:128], r1 @ Q1
-    .if !\simple
-        vst1.8          {q6},     [r0,:128]     @ Q2
-    .endif
-
-        vpop            {q4-q7}
-        bx              lr
-endfunc
-.endm
-
-vp8_v_loop_filter16
-vp8_v_loop_filter16 _inner,  inner=1
-vp8_v_loop_filter16 _simple, simple=1
-
-.macro  vp8_v_loop_filter8uv name, inner=0
-function ff_vp8_v_loop_filter8uv\name\()_neon, export=1
-        vpush           {q4-q7}
-        sub             r0,  r0,  r2,  lsl #2
-        sub             r1,  r1,  r2,  lsl #2
-        ldr             r12, [sp, #64]          @ flim_I
-
-        @ Load pixels:
-        vld1.8          {d0},     [r0,:64], r2  @ P3
-        vld1.8          {d1},     [r1,:64], r2  @ P3
-        vld1.8          {d2},     [r0,:64], r2  @ P2
-        vld1.8          {d3},     [r1,:64], r2  @ P2
-        vld1.8          {d4},     [r0,:64], r2  @ P1
-        vld1.8          {d5},     [r1,:64], r2  @ P1
-        vld1.8          {d6},     [r0,:64], r2  @ P0
-        vld1.8          {d7},     [r1,:64], r2  @ P0
-        vld1.8          {d8},     [r0,:64], r2  @ Q0
-        vld1.8          {d9},     [r1,:64], r2  @ Q0
-        vld1.8          {d10},    [r0,:64], r2  @ Q1
-        vld1.8          {d11},    [r1,:64], r2  @ Q1
-        vld1.8          {d12},    [r0,:64], r2  @ Q2
-        vld1.8          {d13},    [r1,:64], r2  @ Q2
-        vld1.8          {d14},    [r0,:64]      @ Q3
-        vld1.8          {d15},    [r1,:64]      @ Q3
-
-        vdup.8          q14, r3                 @ flim_E
-        vdup.8          q15, r12                @ flim_I
-        ldr             r12, [sp, #68]          @ hev_thresh
-
-        vp8_loop_filter inner=\inner
-
-        @ back up to P2:  u,v -= stride * 6
-        sub             r0,  r0,  r2,  lsl #2
-        sub             r1,  r1,  r2,  lsl #2
-        sub             r0,  r0,  r2,  lsl #1
-        sub             r1,  r1,  r2,  lsl #1
-
-        @ Store pixels:
-        vst1.8          {d2},     [r0,:64], r2  @ P2
-        vst1.8          {d3},     [r1,:64], r2  @ P2
-        vst1.8          {d4},     [r0,:64], r2  @ P1
-        vst1.8          {d5},     [r1,:64], r2  @ P1
-        vst1.8          {d6},     [r0,:64], r2  @ P0
-        vst1.8          {d7},     [r1,:64], r2  @ P0
-        vst1.8          {d8},     [r0,:64], r2  @ Q0
-        vst1.8          {d9},     [r1,:64], r2  @ Q0
-        vst1.8          {d10},    [r0,:64], r2  @ Q1
-        vst1.8          {d11},    [r1,:64], r2  @ Q1
-        vst1.8          {d12},    [r0,:64]      @ Q2
-        vst1.8          {d13},    [r1,:64]      @ Q2
-
-        vpop            {q4-q7}
-        bx              lr
-endfunc
-.endm
-
-vp8_v_loop_filter8uv
-vp8_v_loop_filter8uv _inner, inner=1
-
-.macro  vp8_h_loop_filter16 name, inner=0, simple=0
-function ff_vp8_h_loop_filter16\name\()_neon, export=1
-        vpush           {q4-q7}
-        sub             r0,  r0,  #4
-    .if !\simple
-        ldr             r12, [sp, #64]          @ hev_thresh
-    .endif
-
-        @ Load pixels:
-        vld1.8          {d0},     [r0], r1      @ load first 8-line src data
-        vld1.8          {d2},     [r0], r1
-        vld1.8          {d4},     [r0], r1
-        vld1.8          {d6},     [r0], r1
-        vld1.8          {d8},     [r0], r1
-        vld1.8          {d10},    [r0], r1
-        vld1.8          {d12},    [r0], r1
-        vld1.8          {d14},    [r0], r1
-        vld1.8          {d1},     [r0], r1      @ load second 8-line src data
-        vld1.8          {d3},     [r0], r1
-        vld1.8          {d5},     [r0], r1
-        vld1.8          {d7},     [r0], r1
-        vld1.8          {d9},     [r0], r1
-        vld1.8          {d11},    [r0], r1
-        vld1.8          {d13},    [r0], r1
-        vld1.8          {d15},    [r0], r1
-
-        transpose_8x8   q0,  q1,  q2,  q3,  q4,  q5,  q6,  q7
-
-        vdup.8          q14, r2                 @ flim_E
-    .if !\simple
-        vdup.8          q15, r3                 @ flim_I
-    .endif
-
-        vp8_loop_filter inner=\inner, simple=\simple
-
-        sub             r0,  r0,  r1, lsl #4    @ backup 16 rows
-
-        transpose_8x8   q0,  q1,  q2,  q3,  q4,  q5,  q6,  q7
-
-        @ Store pixels:
-        vst1.8          {d0},     [r0],     r1
-        vst1.8          {d2},     [r0],     r1
-        vst1.8          {d4},     [r0],     r1
-        vst1.8          {d6},     [r0],     r1
-        vst1.8          {d8},     [r0],     r1
-        vst1.8          {d10},    [r0],     r1
-        vst1.8          {d12},    [r0],     r1
-        vst1.8          {d14},    [r0],     r1
-        vst1.8          {d1},     [r0],     r1
-        vst1.8          {d3},     [r0],     r1
-        vst1.8          {d5},     [r0],     r1
-        vst1.8          {d7},     [r0],     r1
-        vst1.8          {d9},     [r0],     r1
-        vst1.8          {d11},    [r0],     r1
-        vst1.8          {d13},    [r0],     r1
-        vst1.8          {d15},    [r0]
-
-        vpop            {q4-q7}
-        bx              lr
-endfunc
-.endm
-
-vp8_h_loop_filter16
-vp8_h_loop_filter16 _inner,  inner=1
-vp8_h_loop_filter16 _simple, simple=1
-
-.macro  vp8_h_loop_filter8uv name, inner=0
-function ff_vp8_h_loop_filter8uv\name\()_neon, export=1
-        vpush           {q4-q7}
-        sub             r0,  r0,  #4
-        sub             r1,  r1,  #4
-        ldr             r12, [sp, #64]          @ flim_I
-
-        @ Load pixels:
-        vld1.8          {d0},     [r0], r2      @ load u
-        vld1.8          {d1},     [r1], r2      @ load v
-        vld1.8          {d2},     [r0], r2
-        vld1.8          {d3},     [r1], r2
-        vld1.8          {d4},     [r0], r2
-        vld1.8          {d5},     [r1], r2
-        vld1.8          {d6},     [r0], r2
-        vld1.8          {d7},     [r1], r2
-        vld1.8          {d8},     [r0], r2
-        vld1.8          {d9},     [r1], r2
-        vld1.8          {d10},    [r0], r2
-        vld1.8          {d11},    [r1], r2
-        vld1.8          {d12},    [r0], r2
-        vld1.8          {d13},    [r1], r2
-        vld1.8          {d14},    [r0], r2
-        vld1.8          {d15},    [r1], r2
-
-        transpose_8x8   q0,  q1,  q2,  q3,  q4,  q5,  q6,  q7
-
-        vdup.8          q14, r3                 @ flim_E
-        vdup.8          q15, r12                @ flim_I
-        ldr             r12, [sp, #68]          @ hev_thresh
-
-        vp8_loop_filter inner=\inner
-
-        sub             r0,  r0,  r2, lsl #3    @ backup u 8 rows
-        sub             r1,  r1,  r2, lsl #3    @ backup v 8 rows
-
-        transpose_8x8   q0,  q1,  q2,  q3,  q4,  q5,  q6,  q7
-
-        @ Store pixels:
-        vst1.8          {d0},     [r0], r2
-        vst1.8          {d1},     [r1], r2
-        vst1.8          {d2},     [r0], r2
-        vst1.8          {d3},     [r1], r2
-        vst1.8          {d4},     [r0], r2
-        vst1.8          {d5},     [r1], r2
-        vst1.8          {d6},     [r0], r2
-        vst1.8          {d7},     [r1], r2
-        vst1.8          {d8},     [r0], r2
-        vst1.8          {d9},     [r1], r2
-        vst1.8          {d10},    [r0], r2
-        vst1.8          {d11},    [r1], r2
-        vst1.8          {d12},    [r0], r2
-        vst1.8          {d13},    [r1], r2
-        vst1.8          {d14},    [r0]
-        vst1.8          {d15},    [r1]
-
-        vpop            {q4-q7}
-        bx              lr
-endfunc
-.endm
-
-vp8_h_loop_filter8uv
-vp8_h_loop_filter8uv _inner, inner=1
-
-function ff_put_vp8_pixels16_neon, export=1
-        ldr             r12, [sp, #0]           @ h
-1:
-        subs            r12, r12, #4
-        vld1.8          {q0},     [r2], r3
-        vld1.8          {q1},     [r2], r3
-        vld1.8          {q2},     [r2], r3
-        vld1.8          {q3},     [r2], r3
-        vst1.8          {q0},     [r0,:128], r1
-        vst1.8          {q1},     [r0,:128], r1
-        vst1.8          {q2},     [r0,:128], r1
-        vst1.8          {q3},     [r0,:128], r1
-        bgt             1b
-        bx              lr
-endfunc
-
-function ff_put_vp8_pixels8_neon, export=1
-        ldr             r12, [sp, #0]           @ h
-1:
-        subs            r12, r12, #4
-        vld1.8          {d0},     [r2], r3
-        vld1.8          {d1},     [r2], r3
-        vld1.8          {d2},     [r2], r3
-        vld1.8          {d3},     [r2], r3
-        vst1.8          {d0},     [r0,:64], r1
-        vst1.8          {d1},     [r0,:64], r1
-        vst1.8          {d2},     [r0,:64], r1
-        vst1.8          {d3},     [r0,:64], r1
-        bgt             1b
-        bx              lr
-endfunc
-
-/* 4/6-tap 8th-pel MC */
-
-.macro  vp8_epel8_h6    d,   a,   b
-        vext.8          d27, \a,  \b,  #1
-        vmovl.u8        q8,  \a
-        vext.8          d28, \a,  \b,  #2
-        vmovl.u8        q9,  d27
-        vext.8          d29, \a,  \b,  #3
-        vmovl.u8        q10, d28
-        vext.8          d30, \a,  \b,  #4
-        vmovl.u8        q11, d29
-        vext.8          d31, \a,  \b,  #5
-        vmovl.u8        q12, d30
-        vmul.u16        q10, q10, d0[2]
-        vmovl.u8        q13, d31
-        vmul.u16        q11, q11, d0[3]
-        vmls.u16        q10, q9,  d0[1]
-        vmls.u16        q11, q12, d1[0]
-        vmla.u16        q10, q8,  d0[0]
-        vmla.u16        q11, q13, d1[1]
-        vqadd.s16       q11, q10, q11
-        vqrshrun.s16    \d,  q11, #7
-.endm
-
-.macro  vp8_epel16_h6   d0,  d1,  s0,  s1,  s2,  q0,  q1
-        vext.8          q14, \q0, \q1, #3
-        vext.8          q15, \q0, \q1, #4
-        vmovl.u8        q11, d28
-        vmovl.u8        q14, d29
-        vext.8          q3,  \q0, \q1, #2
-        vmovl.u8        q12, d30
-        vmovl.u8        q15, d31
-        vext.8          q8,  \q0, \q1, #1
-        vmovl.u8        q10, d6
-        vmovl.u8        q3,  d7
-        vext.8          q2,  \q0, \q1, #5
-        vmovl.u8        q13, d4
-        vmovl.u8        q2,  d5
-        vmovl.u8        q9,  d16
-        vmovl.u8        q8,  d17
-        vmul.u16        q11, q11, d0[3]
-        vmul.u16        q10, q10, d0[2]
-        vmul.u16        q3,  q3,  d0[2]
-        vmul.u16        q14, q14, d0[3]
-        vmls.u16        q11, q12, d1[0]
-        vmovl.u8        q12, \s0
-        vmovl.u8        q1,  \s1
-        vmls.u16        q10, q9,  d0[1]
-        vmls.u16        q3,  q8,  d0[1]
-        vmls.u16        q14, q15, d1[0]
-        vmla.u16        q10, q12, d0[0]
-        vmla.u16        q11, q13, d1[1]
-        vmla.u16        q3,  q1,  d0[0]
-        vmla.u16        q14, q2,  d1[1]
-        vqadd.s16       q11, q10, q11
-        vqadd.s16       q14, q3,  q14
-        vqrshrun.s16    \d0, q11, #7
-        vqrshrun.s16    \d1, q14, #7
-.endm
-
-.macro  vp8_epel8_v6    d0,  s0,  s1,  s2,  s3,  s4,  s5
-        vmovl.u8        q10, \s2
-        vmovl.u8        q11, \s3
-        vmovl.u8        q9,  \s1
-        vmovl.u8        q12, \s4
-        vmovl.u8        q8,  \s0
-        vmovl.u8        q13, \s5
-        vmul.u16        q10, q10, d0[2]
-        vmul.u16        q11, q11, d0[3]
-        vmls.u16        q10, q9,  d0[1]
-        vmls.u16        q11, q12, d1[0]
-        vmla.u16        q10, q8,  d0[0]
-        vmla.u16        q11, q13, d1[1]
-        vqadd.s16       q11, q10, q11
-        vqrshrun.s16    \d0, q11, #7
-.endm
-
-.macro  vp8_epel8_v6_y2 d0, d1, s0, s1, s2, s3, s4, s5, s6
-        vmovl.u8        q10, \s0
-        vmovl.u8        q11, \s3
-        vmovl.u8        q14, \s6
-        vmovl.u8        q9,  \s1
-        vmovl.u8        q12, \s4
-        vmovl.u8        q8,  \s2
-        vmovl.u8        q13, \s5
-        vmul.u16        q10, q10, d0[0]
-        vmul.u16        q15, q11, d0[3]
-        vmul.u16        q11, q11, d0[2]
-        vmul.u16        q14, q14, d1[1]
-        vmls.u16        q10, q9,  d0[1]
-        vmls.u16        q15, q12, d1[0]
-        vmls.u16        q11, q8,  d0[1]
-        vmls.u16        q14, q13, d1[0]
-        vmla.u16        q10, q8,  d0[2]
-        vmla.u16        q15, q13, d1[1]
-        vmla.u16        q11, q9,  d0[0]
-        vmla.u16        q14, q12, d0[3]
-        vqadd.s16       q15, q10, q15
-        vqadd.s16       q14, q11, q14
-        vqrshrun.s16    \d0, q15, #7
-        vqrshrun.s16    \d1, q14, #7
-.endm
-
-.macro  vp8_epel8_h4    d,   a,   b
-        vext.8          d28, \a,  \b,  #1
-        vmovl.u8        q9,  \a
-        vext.8          d29, \a,  \b,  #2
-        vmovl.u8        q10, d28
-        vext.8          d30, \a,  \b,  #3
-        vmovl.u8        q11, d29
-        vmovl.u8        q12, d30
-        vmul.u16        q10, q10, d0[2]
-        vmul.u16        q11, q11, d0[3]
-        vmls.u16        q10, q9,  d0[1]
-        vmls.u16        q11, q12, d1[0]
-        vqadd.s16       q11, q10, q11
-        vqrshrun.s16    \d,  q11, #7
-.endm
-
-.macro  vp8_epel8_v4_y2 d0,  d1,  s0,  s1,  s2,  s3,  s4
-        vmovl.u8        q9,  \s0
-        vmovl.u8        q10, \s1
-        vmovl.u8        q11, \s2
-        vmovl.u8        q12, \s3
-        vmovl.u8        q13, \s4
-        vmul.u16        q8,  q10, d0[2]
-        vmul.u16        q14, q11, d0[3]
-        vmul.u16        q11, q11, d0[2]
-        vmul.u16        q15, q12, d0[3]
-        vmls.u16        q8,  q9,  d0[1]
-        vmls.u16        q14, q12, d1[0]
-        vmls.u16        q11, q10, d0[1]
-        vmls.u16        q15, q13, d1[0]
-        vqadd.s16       q8,  q8,  q14
-        vqadd.s16       q11, q11, q15
-        vqrshrun.s16    \d0, q8,  #7
-        vqrshrun.s16    \d1, q11, #7
-.endm
-
-function ff_put_vp8_epel16_v6_neon, export=1
-        sub             r2,  r2,  r3,  lsl #1
-        push            {r4,lr}
-        vpush           {d8-d15}
-
-        ldr             r4,  [sp, #80]          @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #72]          @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.8          {d2-d3},  [r2], r3
-        vld1.8          {d4-d5},  [r2], r3
-        vld1.8          {d6-d7},  [r2], r3
-        vld1.8          {d8-d9},  [r2], r3
-        vld1.8          {d10-d11},[r2], r3
-        vld1.8          {d12-d13},[r2], r3
-        vld1.8          {d14-d15},[r2]
-        sub             r2,  r2,  r3,  lsl #2
-
-        vp8_epel8_v6_y2 d2,  d4,  d2,  d4,  d6,  d8,  d10, d12, d14
-        vp8_epel8_v6_y2 d3,  d5,  d3,  d5,  d7,  d9,  d11, d13, d15
-
-        vst1.8          {d2-d3},  [r0,:128], r1
-        vst1.8          {d4-d5},  [r0,:128], r1
-        subs            r12, r12, #2
-        bne             1b
-
-        vpop            {d8-d15}
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel16_h6_neon, export=1
-        sub             r2,  r2,  #2
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.8          {d2-d4},  [r2], r3
-
-        vp8_epel16_h6   d2,  d3,  d2,  d3,  d4,  q1,  q2
-
-        vst1.8          {d2-d3}, [r0,:128], r1
-        subs            r12, r12, #1
-        bne             1b
-
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel16_h6v6_neon, export=1
-        sub             r2,  r2,  r3,  lsl #1
-        sub             r2,  r2,  #2
-        push            {r4,lr}
-        vpush           {d8-d9}
-
-        @ first pass (horizontal):
-        ldr             r4,  [sp, #28]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #24]          @ h
-        add             r4,  lr,  r4, lsl #4
-        sub             sp,  sp,  #336+16
-        vld1.16         {q0},     [r4,:128]
-        add             lr,  sp,  #15
-        add             r12, r12, #5
-        bic             lr,  lr,  #15
-1:
-        vld1.8          {d2,d3,d4}, [r2], r3
-
-        vp8_epel16_h6   d2,  d3,  d2,  d3,  d4,  q1,  q2
-
-        vst1.8          {d2-d3}, [lr,:128]!
-        subs            r12, r12, #1
-        bne             1b
-
-        @ second pass (vertical):
-        ldr             r4,  [sp, #336+16+32]   @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #336+16+24]   @ h
-        add             r4,  lr,  r4, lsl #4
-        add             lr,  sp,  #15
-        vld1.16         {q0},     [r4,:128]
-        bic             lr,  lr,  #15
-2:
-        vld1.8          {d2-d5},  [lr,:128]!
-        vld1.8          {d6-d9},  [lr,:128]!
-        vld1.8          {d28-d31},[lr,:128]
-        sub             lr,  lr,  #48
-
-        vp8_epel8_v6    d2, d2, d4, d6, d8, d28, d30
-        vp8_epel8_v6    d3, d3, d5, d7, d9, d29, d31
-
-        vst1.8          {d2-d3}, [r0,:128], r1
-        subs            r12, r12, #1
-        bne             2b
-
-        add             sp,  sp,  #336+16
-        vpop            {d8-d9}
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel8_v6_neon, export=1
-        sub             r2,  r2,  r3,  lsl #1
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #16]          @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.8          {d2},  [r2], r3
-        vld1.8          {d3},  [r2], r3
-        vld1.8          {d4},  [r2], r3
-        vld1.8          {d5},  [r2], r3
-        vld1.8          {d6},  [r2], r3
-        vld1.8          {d7},  [r2], r3
-        vld1.8          {d28}, [r2]
-
-        sub             r2,  r2,  r3,  lsl #2
-
-        vp8_epel8_v6_y2 d2,  d3,  d2,  d3,  d4,  d5,  d6,  d7,  d28
-
-        vst1.8          {d2}, [r0,:64], r1
-        vst1.8          {d3}, [r0,:64], r1
-        subs            r12, r12, #2
-        bne             1b
-
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel8_h6_neon, export=1
-        sub             r2,  r2,  #2
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.8          {d2,d3}, [r2], r3
-
-        vp8_epel8_h6    d2,  d2,  d3
-
-        vst1.8          {d2}, [r0,:64], r1
-        subs            r12, r12, #1
-        bne             1b
-
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel8_h6v6_neon, export=1
-        sub             r2,  r2,  r3,  lsl #1
-        sub             r2,  r2,  #2
-        push            {r4,lr}
-
-        @ first pass (horizontal):
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        sub             sp,  sp,  #168+16
-        vld1.16         {q0},     [r4,:128]
-        add             lr,  sp,  #15
-        add             r12, r12, #5
-        bic             lr,  lr,  #15
-1:
-        vld1.8          {d2,d3}, [r2], r3
-
-        vp8_epel8_h6    d2,  d2,  d3
-
-        vst1.8          {d2}, [lr,:64]!
-        subs            r12, r12, #1
-        bne             1b
-
-        @ second pass (vertical):
-        ldr             r4,  [sp, #168+16+16]   @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #168+16+8]    @ h
-        add             r4,  lr,  r4, lsl #4
-        add             lr,  sp,  #15
-        vld1.16         {q0},     [r4,:128]
-        bic             lr,  lr,  #15
-2:
-        vld1.8          {d2-d5},  [lr,:128]!
-        vld1.8          {d6-d7},  [lr,:128]!
-        vld1.8          {d30},    [lr,:64]
-        sub             lr,  lr,  #32
-
-        vp8_epel8_v6_y2 d2,  d3,  d2,  d3,  d4,  d5,  d6,  d7,  d30
-
-        vst1.8          {d2}, [r0,:64], r1
-        vst1.8          {d3}, [r0,:64], r1
-        subs            r12, r12, #2
-        bne             2b
-
-        add             sp,  sp,  #168+16
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel8_v4_neon, export=1
-        sub             r2,  r2,  r3
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #16]          @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.8          {d2},     [r2], r3
-        vld1.8          {d3},     [r2], r3
-        vld1.8          {d4},     [r2], r3
-        vld1.8          {d5},     [r2], r3
-        vld1.8          {d6},     [r2]
-        sub             r2,  r2,  r3,  lsl #1
-
-        vp8_epel8_v4_y2 d2,  d3,  d2,  d3,  d4,  d5,  d6
-
-        vst1.8          {d2}, [r0,:64], r1
-        vst1.8          {d3}, [r0,:64], r1
-        subs            r12, r12, #2
-        bne             1b
-
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel8_h4_neon, export=1
-        sub             r2,  r2,  #1
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.8          {d2,d3}, [r2], r3
-
-        vp8_epel8_h4    d2,  d2,  d3
-
-        vst1.8          {d2}, [r0,:64], r1
-        subs            r12, r12, #1
-        bne             1b
-
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel8_h4v4_neon, export=1
-        sub             r2,  r2,  r3
-        sub             r2,  r2,  #1
-        push            {r4,lr}
-
-        @ first pass (horizontal):
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        sub             sp,  sp,  #168+16
-        vld1.16         {q0},     [r4,:128]
-        add             lr,  sp,  #15
-        add             r12, r12, #3
-        bic             lr,  lr,  #15
-1:
-        vld1.8          {d2,d3}, [r2], r3
-
-        vp8_epel8_h4    d2,  d2,  d3
-
-        vst1.8          {d2}, [lr,:64]!
-        subs            r12, r12, #1
-        bne             1b
-
-        @ second pass (vertical):
-        ldr             r4,  [sp, #168+16+16]   @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #168+16+8]    @ h
-        add             r4,  lr,  r4, lsl #4
-        add             lr,  sp,  #15
-        vld1.16         {q0},     [r4,:128]
-        bic             lr,  lr,  #15
-2:
-        vld1.8          {d2-d5},  [lr,:128]!
-        vld1.8          {d6},     [lr,:64]
-        sub             lr,  lr,  #16
-
-        vp8_epel8_v4_y2 d2,  d3,  d2,  d3,  d4,  d5,  d6
-
-        vst1.8          {d2},     [r0,:64], r1
-        vst1.8          {d3},     [r0,:64], r1
-        subs            r12, r12, #2
-        bne             2b
-
-        add             sp,  sp,  #168+16
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel8_h6v4_neon, export=1
-        sub             r2,  r2,  r3
-        sub             r2,  r2,  #2
-        push            {r4,lr}
-
-        @ first pass (horizontal):
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        sub             sp,  sp,  #168+16
-        vld1.16         {q0},     [r4,:128]
-        add             lr,  sp,  #15
-        add             r12, r12, #3
-        bic             lr,  lr,  #15
-1:
-        vld1.8          {d2,d3}, [r2], r3
-
-        vp8_epel8_h6    d2,  d2,  d3
-
-        vst1.8          {d2}, [lr,:64]!
-        subs            r12, r12, #1
-        bne             1b
-
-        @ second pass (vertical):
-        ldr             r4,  [sp, #168+16+16]   @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #168+16+8]    @ h
-        add             r4,  lr,  r4, lsl #4
-        add             lr,  sp,  #15
-        vld1.16         {q0},     [r4,:128]
-        bic             lr,  lr,  #15
-2:
-        vld1.8          {d2-d5},  [lr,:128]!
-        vld1.8          {d6},     [lr,:64]
-        sub             lr,  lr,  #16
-
-        vp8_epel8_v4_y2 d2,  d3,  d2,  d3,  d4,  d5,  d6
-
-        vst1.8          {d2},     [r0,:64], r1
-        vst1.8          {d3},     [r0,:64], r1
-        subs            r12, r12, #2
-        bne             2b
-
-        add             sp,  sp,  #168+16
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel8_h4v6_neon, export=1
-        sub             r2,  r2,  r3,  lsl #1
-        sub             r2,  r2,  #1
-        push            {r4,lr}
-
-        @ first pass (horizontal):
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        sub             sp,  sp,  #168+16
-        vld1.16         {q0},     [r4,:128]
-        add             lr,  sp,  #15
-        add             r12, r12, #5
-        bic             lr,  lr,  #15
-1:
-        vld1.8          {d2,d3}, [r2], r3
-
-        vp8_epel8_h4    d2,  d2,  d3
-
-        vst1.8          {d2}, [lr,:64]!
-        subs            r12, r12, #1
-        bne             1b
-
-        @ second pass (vertical):
-        ldr             r4,  [sp, #168+16+16]   @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #168+16+8]    @ h
-        add             r4,  lr,  r4, lsl #4
-        add             lr,  sp,  #15
-        vld1.16         {q0},     [r4,:128]
-        bic             lr,  lr,  #15
-2:
-        vld1.8          {d2-d5},  [lr,:128]!
-        vld1.8          {d6-d7},  [lr,:128]!
-        vld1.8          {d30},    [lr,:64]
-        sub             lr,  lr,  #32
-
-        vp8_epel8_v6_y2 d2,  d3,  d2,  d3,  d4,  d5,  d6,  d7,  d30
-
-        vst1.8          {d2}, [r0,:64], r1
-        vst1.8          {d3}, [r0,:64], r1
-        subs            r12, r12, #2
-        bne             2b
-
-        add             sp,  sp,  #168+16
-        pop             {r4,pc}
-endfunc
-
-.ltorg
-
-function ff_put_vp8_epel4_v6_neon, export=1
-        sub             r2,  r2,  r3,  lsl #1
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #16]          @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.32         {d2[]},   [r2], r3
-        vld1.32         {d3[]},   [r2], r3
-        vld1.32         {d4[]},   [r2], r3
-        vld1.32         {d5[]},   [r2], r3
-        vld1.32         {d6[]},   [r2], r3
-        vld1.32         {d7[]},   [r2], r3
-        vld1.32         {d28[]},  [r2]
-        sub             r2,  r2,  r3,  lsl #2
-        vld1.32         {d2[1]},  [r2], r3
-        vld1.32         {d3[1]},  [r2], r3
-        vld1.32         {d4[1]},  [r2], r3
-        vld1.32         {d5[1]},  [r2], r3
-        vld1.32         {d6[1]},  [r2], r3
-        vld1.32         {d7[1]},  [r2], r3
-        vld1.32         {d28[1]}, [r2]
-        sub             r2,  r2,  r3,  lsl #2
-
-        vp8_epel8_v6_y2 d2,  d3,  d2,  d3,  d4,  d5,  d6,  d7,  d28
-
-        vst1.32         {d2[0]},  [r0,:32], r1
-        vst1.32         {d3[0]},  [r0,:32], r1
-        vst1.32         {d2[1]},  [r0,:32], r1
-        vst1.32         {d3[1]},  [r0,:32], r1
-        subs            r12, r12, #4
-        bne             1b
-
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel4_h6_neon, export=1
-        sub             r2,  r2,  #2
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.8          {q1},     [r2], r3
-        vp8_epel8_h6    d2,  d2,  d3
-        vst1.32         {d2[0]},  [r0,:32], r1
-        subs            r12, r12, #1
-        bne             1b
-
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel4_h6v6_neon, export=1
-        sub             r2,  r2,  r3,  lsl #1
-        sub             r2,  r2,  #2
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        sub             sp,  sp,  #52+16
-        vld1.16         {q0},     [r4,:128]
-        add             lr,  sp,  #15
-        add             r12, r12, #5
-        bic             lr,  lr,  #15
-1:
-        vld1.8          {q1},     [r2], r3
-        vp8_epel8_h6    d2,  d2,  d3
-        vst1.32         {d2[0]},  [lr,:32]!
-        subs            r12, r12, #1
-        bne             1b
-
-        ldr             r4,  [sp, #52+16+16]    @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #52+16+8]     @ h
-        add             r4,  lr,  r4, lsl #4
-        add             lr,  sp,  #15
-        vld1.16         {q0},     [r4,:128]
-        bic             lr,  lr,  #15
-2:
-        vld1.8          {d2-d3},  [lr,:128]!
-        vld1.8          {d6},     [lr,:64]!
-        vld1.32         {d28[]},  [lr,:32]
-        sub             lr,  lr,  #16
-        vld1.8          {d4-d5},  [lr]!
-        vld1.8          {d7},     [lr,:64]!
-        vld1.32         {d28[1]}, [lr,:32]
-        sub             lr,  lr,  #16
-        vtrn.32         q1,  q2
-        vtrn.32         d6,  d7
-        vp8_epel8_v6_y2 d2,  d3,  d2,  d4,  d3,  d5,  d6,  d7,  d28
-        vst1.32         {d2[0]},  [r0,:32], r1
-        vst1.32         {d3[0]},  [r0,:32], r1
-        vst1.32         {d2[1]},  [r0,:32], r1
-        vst1.32         {d3[1]},  [r0,:32], r1
-        subs            r12, r12, #4
-        bne             2b
-
-        add             sp,  sp,  #52+16
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel4_h4v6_neon, export=1
-        sub             r2,  r2,  r3,  lsl #1
-        sub             r2,  r2,  #1
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        sub             sp,  sp,  #52+16
-        vld1.16         {q0},     [r4,:128]
-        add             lr,  sp,  #15
-        add             r12, r12, #5
-        bic             lr,  lr,  #15
-1:
-        vld1.8          {d2},     [r2], r3
-        vp8_epel8_h4    d2,  d2,  d2
-        vst1.32         {d2[0]},  [lr,:32]!
-        subs            r12, r12, #1
-        bne             1b
-
-        ldr             r4,  [sp, #52+16+16]    @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #52+16+8]     @ h
-        add             r4,  lr,  r4, lsl #4
-        add             lr,  sp,  #15
-        vld1.16         {q0},     [r4,:128]
-        bic             lr,  lr,  #15
-2:
-        vld1.8          {d2-d3},  [lr,:128]!
-        vld1.8          {d6},     [lr,:64]!
-        vld1.32         {d28[]},  [lr,:32]
-        sub             lr,  lr,  #16
-        vld1.8          {d4-d5},  [lr]!
-        vld1.8          {d7},     [lr,:64]!
-        vld1.32         {d28[1]}, [lr,:32]
-        sub             lr,  lr,  #16
-        vtrn.32         q1,  q2
-        vtrn.32         d6,  d7
-        vp8_epel8_v6_y2 d2,  d3,  d2,  d4,  d3,  d5,  d6,  d7,  d28
-        vst1.32         {d2[0]},  [r0,:32], r1
-        vst1.32         {d3[0]},  [r0,:32], r1
-        vst1.32         {d2[1]},  [r0,:32], r1
-        vst1.32         {d3[1]},  [r0,:32], r1
-        subs            r12, r12, #4
-        bne             2b
-
-        add             sp,  sp,  #52+16
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel4_h6v4_neon, export=1
-        sub             r2,  r2,  r3
-        sub             r2,  r2,  #2
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        sub             sp,  sp,  #44+16
-        vld1.16         {q0},     [r4,:128]
-        add             lr,  sp,  #15
-        add             r12, r12, #3
-        bic             lr,  lr,  #15
-1:
-        vld1.8          {q1},     [r2], r3
-        vp8_epel8_h6    d2,  d2,  d3
-        vst1.32         {d2[0]},  [lr,:32]!
-        subs            r12, r12, #1
-        bne             1b
-
-        ldr             r4,  [sp, #44+16+16]    @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #44+16+8]     @ h
-        add             r4,  lr,  r4, lsl #4
-        add             lr,  sp,  #15
-        vld1.16         {q0},     [r4,:128]
-        bic             lr,  lr,  #15
-2:
-        vld1.8          {d2-d3},  [lr,:128]!
-        vld1.32         {d6[]},   [lr,:32]
-        sub             lr,  lr,  #8
-        vld1.8          {d4-d5},  [lr]!
-        vld1.32         {d6[1]},  [lr,:32]
-        sub             lr,  lr,  #8
-        vtrn.32         q1,  q2
-        vp8_epel8_v4_y2 d2,  d3,  d2,  d4,  d3,  d5,  d6
-        vst1.32         {d2[0]},  [r0,:32], r1
-        vst1.32         {d3[0]},  [r0,:32], r1
-        vst1.32         {d2[1]},  [r0,:32], r1
-        vst1.32         {d3[1]},  [r0,:32], r1
-        subs            r12, r12, #4
-        bne             2b
-
-        add             sp,  sp,  #44+16
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel4_h4_neon, export=1
-        sub             r2,  r2,  #1
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.8          {d2},     [r2], r3
-        vp8_epel8_h4    d2,  d2,  d2
-        vst1.32         {d2[0]},  [r0,:32], r1
-        subs            r12, r12, #1
-        bne             1b
-
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel4_v4_neon, export=1
-        sub             r2,  r2,  r3
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #16]          @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        vld1.16         {q0},     [r4,:128]
-1:
-        vld1.32         {d2[]},   [r2], r3
-        vld1.32         {d3[]},   [r2], r3
-        vld1.32         {d4[]},   [r2], r3
-        vld1.32         {d5[]},   [r2], r3
-        vld1.32         {d6[]},   [r2]
-        sub             r2,  r2,  r3,  lsl #1
-        vld1.32         {d2[1]},  [r2], r3
-        vld1.32         {d3[1]},  [r2], r3
-        vld1.32         {d4[1]},  [r2], r3
-        vld1.32         {d5[1]},  [r2], r3
-        vld1.32         {d6[1]},  [r2]
-        sub             r2,  r2,  r3,  lsl #1
-
-        vp8_epel8_v4_y2 d2,  d3,  d2,  d3,  d4,  d5,  d6
-
-        vst1.32         {d2[0]},  [r0,:32], r1
-        vst1.32         {d3[0]},  [r0,:32], r1
-        vst1.32         {d2[1]},  [r0,:32], r1
-        vst1.32         {d3[1]},  [r0,:32], r1
-        subs            r12, r12, #4
-        bne             1b
-
-        pop             {r4,pc}
-endfunc
-
-function ff_put_vp8_epel4_h4v4_neon, export=1
-        sub             r2,  r2,  r3
-        sub             r2,  r2,  #1
-        push            {r4,lr}
-
-        ldr             r4,  [sp, #12]          @ mx
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #8]           @ h
-        add             r4,  lr,  r4, lsl #4
-        sub             sp,  sp,  #44+16
-        vld1.16         {q0},     [r4,:128]
-        add             lr,  sp,  #15
-        add             r12, r12, #3
-        bic             lr,  lr,  #15
-1:
-        vld1.8          {d2},     [r2], r3
-        vp8_epel8_h4    d2,  d2,  d3
-        vst1.32         {d2[0]},  [lr,:32]!
-        subs            r12, r12, #1
-        bne             1b
-
-        ldr             r4,  [sp, #44+16+16]    @ my
-        movrel          lr,  subpel_filters-16
-        ldr             r12, [sp, #44+16+8]     @ h
-        add             r4,  lr,  r4, lsl #4
-        add             lr,  sp,  #15
-        vld1.16         {q0},     [r4,:128]
-        bic             lr,  lr,  #15
-2:
-        vld1.8          {d2-d3},  [lr,:128]!
-        vld1.32         {d6[]},   [lr,:32]
-        sub             lr,  lr,  #8
-        vld1.8          {d4-d5},  [lr]!
-        vld1.32         {d6[1]},  [lr,:32]
-        sub             lr,  lr,  #8
-        vtrn.32         q1,  q2
-        vp8_epel8_v4_y2 d2,  d3,  d2,  d4,  d3,  d5,  d6
-        vst1.32         {d2[0]},  [r0,:32], r1
-        vst1.32         {d3[0]},  [r0,:32], r1
-        vst1.32         {d2[1]},  [r0,:32], r1
-        vst1.32         {d3[1]},  [r0,:32], r1
-        subs            r12, r12, #4
-        bne             2b
-
-        add             sp,  sp,  #44+16
-        pop             {r4,pc}
-endfunc
-
-@ note: worst case sum of all 6-tap filter values * 255 is 0x7f80 so 16 bit
-@ arithmatic can be used to apply filters
-const   subpel_filters, align=4
-        .short     0,   6, 123,  12,   1,   0,   0,   0
-        .short     2,  11, 108,  36,   8,   1,   0,   0
-        .short     0,   9,  93,  50,   6,   0,   0,   0
-        .short     3,  16,  77,  77,  16,   3,   0,   0
-        .short     0,   6,  50,  93,   9,   0,   0,   0
-        .short     1,   8,  36, 108,  11,   2,   0,   0
-        .short     0,   1,  12, 123,   6,   0,   0,   0
-endconst
-
-/* Bilinear MC */
-
-function ff_put_vp8_bilin16_h_neon, export=1
-        ldr             r12, [sp, #4]           @ mx
-        vdup.8          d0,  r12
-        rsb             r12, r12, #8
-        vdup.8          d1,  r12
-        ldr             r12, [sp]               @ h
-1:
-        subs            r12, r12, #2
-        vld1.8          {d2-d4},  [r2], r3
-        vext.8          q2,  q1,  q2,  #1
-        vmull.u8        q8,  d2,  d1
-        vmlal.u8        q8,  d4,  d0
-        vld1.8          {d18-d20},[r2], r3
-        vmull.u8        q3,  d3,  d1
-        vmlal.u8        q3,  d5,  d0
-        vext.8          q10, q9,  q10, #1
-        vmull.u8        q11, d18, d1
-        vmlal.u8        q11, d20, d0
-        vmull.u8        q12, d19, d1
-        vmlal.u8        q12, d21, d0
-        vrshrn.u16      d4,  q8,  #3
-        vrshrn.u16      d5,  q3,  #3
-        vrshrn.u16      d6,  q11, #3
-        vrshrn.u16      d7,  q12, #3
-        vst1.8          {q2},     [r0,:128], r1
-        vst1.8          {q3},     [r0,:128], r1
-        bgt             1b
-
-        bx              lr
-endfunc
-
-function ff_put_vp8_bilin16_v_neon, export=1
-        ldr             r12, [sp, #8]           @ my
-        vdup.8          d0,  r12
-        rsb             r12, r12, #8
-        vdup.8          d1,  r12
-        ldr             r12, [sp]               @ h
-        vld1.8          {q1},     [r2], r3
-1:
-        subs            r12, r12, #2
-        vld1.8          {q2},     [r2], r3
-        vmull.u8        q3,  d2,  d1
-        vmlal.u8        q3,  d4,  d0
-        vmull.u8        q8,  d3,  d1
-        vmlal.u8        q8,  d5,  d0
-        vld1.8          {q1},     [r2], r3
-        vmull.u8        q9,  d4,  d1
-        vmlal.u8        q9,  d2,  d0
-        vmull.u8        q10, d5,  d1
-        vmlal.u8        q10, d3,  d0
-        vrshrn.u16      d4,  q3,  #3
-        vrshrn.u16      d5,  q8,  #3
-        vrshrn.u16      d6,  q9,  #3
-        vrshrn.u16      d7,  q10, #3
-        vst1.8          {q2},     [r0,:128], r1
-        vst1.8          {q3},     [r0,:128], r1
-        bgt             1b
-
-        bx              lr
-endfunc
-
-function ff_put_vp8_bilin16_hv_neon, export=1
-        ldr             r12, [sp, #4]           @ mx
-        vdup.8          d0,  r12
-        rsb             r12, r12, #8
-        vdup.8          d1,  r12
-        ldr             r12, [sp, #8]           @ my
-        vdup.8          d2,  r12
-        rsb             r12, r12, #8
-        vdup.8          d3,  r12
-        ldr             r12, [sp]               @ h
-
-        vld1.8          {d4-d6},  [r2], r3
-        vext.8          q3,  q2,  q3,  #1
-        vmull.u8        q8,  d4,  d1
-        vmlal.u8        q8,  d6,  d0
-        vmull.u8        q9,  d5,  d1
-        vmlal.u8        q9,  d7,  d0
-        vrshrn.u16      d4,  q8,  #3
-        vrshrn.u16      d5,  q9,  #3
-1:
-        subs            r12, r12, #2
-        vld1.8          {d18-d20},[r2], r3
-        vext.8          q10, q9,  q10, #1
-        vmull.u8        q11, d18, d1
-        vmlal.u8        q11, d20, d0
-        vld1.8          {d26-d28},[r2], r3
-        vmull.u8        q12, d19, d1
-        vmlal.u8        q12, d21, d0
-        vext.8          q14, q13, q14, #1
-        vmull.u8        q8,  d26, d1
-        vmlal.u8        q8,  d28, d0
-        vmull.u8        q9,  d27, d1
-        vmlal.u8        q9,  d29, d0
-        vrshrn.u16      d6,  q11, #3
-        vrshrn.u16      d7,  q12, #3
-        vmull.u8        q12, d4,  d3
-        vmlal.u8        q12, d6,  d2
-        vmull.u8        q15, d5,  d3
-        vmlal.u8        q15, d7,  d2
-        vrshrn.u16      d4,  q8,  #3
-        vrshrn.u16      d5,  q9,  #3
-        vmull.u8        q10, d6,  d3
-        vmlal.u8        q10, d4,  d2
-        vmull.u8        q11, d7,  d3
-        vmlal.u8        q11, d5,  d2
-        vrshrn.u16      d24, q12, #3
-        vrshrn.u16      d25, q15, #3
-        vst1.8          {q12},    [r0,:128], r1
-        vrshrn.u16      d20, q10, #3
-        vrshrn.u16      d21, q11, #3
-        vst1.8          {q10},    [r0,:128], r1
-        bgt             1b
-
-        bx              lr
-endfunc
-
-function ff_put_vp8_bilin8_h_neon, export=1
-        ldr             r12, [sp, #4]           @ mx
-        vdup.8          d0,  r12
-        rsb             r12, r12, #8
-        vdup.8          d1,  r12
-        ldr             r12, [sp]               @ h
-1:
-        subs            r12, r12, #2
-        vld1.8          {q1},     [r2], r3
-        vext.8          d3,  d2,  d3,  #1
-        vmull.u8        q2,  d2,  d1
-        vmlal.u8        q2,  d3,  d0
-        vld1.8          {q3},     [r2], r3
-        vext.8          d7,  d6,  d7,  #1
-        vmull.u8        q8,  d6,  d1
-        vmlal.u8        q8,  d7,  d0
-        vrshrn.u16      d4,  q2,  #3
-        vrshrn.u16      d16, q8,  #3
-        vst1.8          {d4},     [r0,:64], r1
-        vst1.8          {d16},    [r0,:64], r1
-        bgt             1b
-
-        bx              lr
-endfunc
-
-function ff_put_vp8_bilin8_v_neon, export=1
-        ldr             r12, [sp, #8]           @ my
-        vdup.8          d0,  r12
-        rsb             r12, r12,  #8
-        vdup.8          d1,  r12
-        ldr             r12, [sp]               @ h
-        vld1.8          {d2},     [r2], r3
-1:
-        subs            r12, r12, #2
-        vld1.8          {d3},     [r2], r3
-        vmull.u8        q2,  d2,  d1
-        vmlal.u8        q2,  d3,  d0
-        vld1.8          {d2},     [r2], r3
-        vmull.u8        q3,  d3,  d1
-        vmlal.u8        q3,  d2,  d0
-        vrshrn.u16      d4,  q2,  #3
-        vrshrn.u16      d6,  q3,  #3
-        vst1.8          {d4},     [r0,:64], r1
-        vst1.8          {d6},     [r0,:64], r1
-        bgt             1b
-
-        bx              lr
-endfunc
-
-function ff_put_vp8_bilin8_hv_neon, export=1
-        ldr             r12, [sp, #4]           @ mx
-        vdup.8          d0,  r12
-        rsb             r12, r12, #8
-        vdup.8          d1,  r12
-        ldr             r12, [sp, #8]           @ my
-        vdup.8          d2,  r12
-        rsb             r12, r12, #8
-        vdup.8          d3,  r12
-        ldr             r12, [sp]               @ h
-
-        vld1.8          {q2},     [r2], r3
-        vext.8          d5,  d4,  d5,  #1
-        vmull.u8        q9,  d4,  d1
-        vmlal.u8        q9,  d5,  d0
-        vrshrn.u16      d22, q9,  #3
-1:
-        subs            r12, r12, #2
-        vld1.8          {q3},     [r2], r3
-        vext.8          d7,  d6,  d7,  #1
-        vmull.u8        q8,  d6,  d1
-        vmlal.u8        q8,  d7,  d0
-        vld1.8          {q2},     [r2], r3
-        vext.8          d5,  d4,  d5,  #1
-        vmull.u8        q9,  d4,  d1
-        vmlal.u8        q9,  d5,  d0
-        vrshrn.u16      d16, q8,  #3
-        vmull.u8        q10, d22, d3
-        vmlal.u8        q10, d16, d2
-        vrshrn.u16      d22, q9,  #3
-        vmull.u8        q12, d16, d3
-        vmlal.u8        q12, d22, d2
-        vrshrn.u16      d20, q10, #3
-        vst1.8          {d20},    [r0,:64], r1
-        vrshrn.u16      d23, q12, #3
-        vst1.8          {d23},    [r0,:64], r1
-        bgt             1b
-
-        bx              lr
-endfunc
-
-function ff_put_vp8_bilin4_h_neon, export=1
-        ldr             r12, [sp, #4]           @ mx
-        vdup.8          d0,  r12
-        rsb             r12, r12, #8
-        vdup.8          d1,  r12
-        ldr             r12, [sp]               @ h
-1:
-        subs            r12, r12, #2
-        vld1.8          {d2},     [r2], r3
-        vext.8          d3,  d2,  d3,  #1
-        vld1.8          {d6},     [r2], r3
-        vext.8          d7,  d6,  d7,  #1
-        vtrn.32         q1,  q3
-        vmull.u8        q2,  d2,  d1
-        vmlal.u8        q2,  d3,  d0
-        vrshrn.u16      d4,  q2,  #3
-        vst1.32         {d4[0]},  [r0,:32], r1
-        vst1.32         {d4[1]}, [r0,:32], r1
-        bgt             1b
-
-        bx              lr
-endfunc
-
-function ff_put_vp8_bilin4_v_neon, export=1
-        ldr             r12, [sp, #8]           @ my
-        vdup.8          d0,  r12
-        rsb             r12, r12, #8
-        vdup.8          d1,  r12
-        ldr             r12, [sp]               @ h
-        vld1.32         {d2[]},   [r2], r3
-1:
-        vld1.32         {d3[]},   [r2]
-        vld1.32         {d2[1]},  [r2], r3
-        vld1.32         {d3[1]},  [r2], r3
-        vmull.u8        q2,  d2,  d1
-        vmlal.u8        q2,  d3,  d0
-        vtrn.32         d3,  d2
-        vrshrn.u16      d4,  q2,  #3
-        vst1.32         {d4[0]},  [r0,:32], r1
-        vst1.32         {d4[1]},  [r0,:32], r1
-        subs            r12, r12, #2
-        bgt             1b
-
-        bx              lr
-endfunc
-
-function ff_put_vp8_bilin4_hv_neon, export=1
-        ldr             r12, [sp, #4]           @ mx
-        vdup.8          d0,  r12
-        rsb             r12, r12, #8
-        vdup.8          d1,  r12
-        ldr             r12, [sp, #8]           @ my
-        vdup.8          d2,  r12
-        rsb             r12, r12, #8
-        vdup.8          d3,  r12
-        ldr             r12, [sp]               @ h
-
-        vld1.8          {d4},     [r2], r3
-        vext.8          d5,  d4,  d4,  #1
-        vmull.u8        q9,  d4,  d1
-        vmlal.u8        q9,  d5,  d0
-        vrshrn.u16      d22, q9,  #3
-1:
-        subs            r12, r12, #2
-        vld1.8          {d6},     [r2], r3
-        vext.8          d7,  d6,  d6,  #1
-        vld1.8          {d4},     [r2], r3
-        vext.8          d5,  d4,  d4,  #1
-        vtrn.32         q3,  q2
-        vmull.u8        q8,  d6,  d1
-        vmlal.u8        q8,  d7,  d0
-        vrshrn.u16      d16, q8,  #3
-        vmull.u8        q10, d16, d2
-        vtrn.32         d22, d16
-        vmlal.u8        q10, d22, d3
-        vrev64.32       d22, d16
-        vrshrn.u16      d20, q10, #3
-        vst1.32         {d20[0]}, [r0,:32], r1
-        vst1.32         {d20[1]}, [r0,:32], r1
-        bgt             1b
-
-        bx              lr
-endfunc
diff --git a/deps/libav/libavcodec/ass.c b/deps/libav/libavcodec/ass.c
deleted file mode 100644
index 098050a..0000000
--- a/deps/libav/libavcodec/ass.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * SSA/ASS common funtions
- * Copyright (c) 2010  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "ass.h"
-#include "libavutil/avstring.h"
-#include "libavutil/common.h"
-
-/**
- * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS.
- *
- * @param avctx pointer to the AVCodecContext
- * @param font name of the default font face to use
- * @param font_size default font size to use
- * @param color default text color to use (ABGR)
- * @param back_color default background color to use (ABGR)
- * @param bold 1 for bold text, 0 for normal text
- * @param italic 1 for italic text, 0 for normal text
- * @param underline 1 for underline text, 0 for normal text
- * @param alignment position of the text (left, center, top...), defined after
- *                  the layout of the numpad (1-3 sub, 4-6 mid, 7-9 top)
- * @return >= 0 on success otherwise an error code <0
- */
-static int ass_subtitle_header(AVCodecContext *avctx,
-                               const char *font, int font_size,
-                               int color, int back_color,
-                               int bold, int italic, int underline,
-                               int alignment)
-{
-    char header[512];
-
-    snprintf(header, sizeof(header),
-             "[Script Info]\r\n"
-             "ScriptType: v4.00+\r\n"
-             "\r\n"
-             "[V4+ Styles]\r\n"
-             "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding\r\n"
-             "Style: Default,%s,%d,&H%x,&H%x,&H%x,&H%x,%d,%d,%d,1,1,0,%d,10,10,10,0,0\r\n"
-             "\r\n"
-             "[Events]\r\n"
-             "Format: Layer, Start, End, Text\r\n",
-             font, font_size, color, color, back_color, back_color,
-             -bold, -italic, -underline, alignment);
-
-    avctx->subtitle_header = av_strdup(header);
-    if (!avctx->subtitle_header)
-        return AVERROR(ENOMEM);
-    avctx->subtitle_header_size = strlen(avctx->subtitle_header);
-    return 0;
-}
-
-int ff_ass_subtitle_header_default(AVCodecContext *avctx)
-{
-    return ass_subtitle_header(avctx, ASS_DEFAULT_FONT,
-                               ASS_DEFAULT_FONT_SIZE,
-                               ASS_DEFAULT_COLOR,
-                               ASS_DEFAULT_BACK_COLOR,
-                               ASS_DEFAULT_BOLD,
-                               ASS_DEFAULT_ITALIC,
-                               ASS_DEFAULT_UNDERLINE,
-                               ASS_DEFAULT_ALIGNMENT);
-}
-
-void ff_ass_init(AVSubtitle *sub)
-{
-    memset(sub, 0, sizeof(*sub));
-}
-
-static int ts_to_string(char *str, int strlen, int ts)
-{
-    int h, m, s;
-    h = ts/360000;  ts -= 360000*h;
-    m = ts/  6000;  ts -=   6000*m;
-    s = ts/   100;  ts -=    100*s;
-    return snprintf(str, strlen, "%d:%02d:%02d.%02d", h, m, s, ts);
-}
-
-int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
-                    int ts_start, int ts_end, int raw)
-{
-    int len = 0, dlen, duration = ts_end - ts_start;
-    char s_start[16], s_end[16], header[48] = {0};
-    AVSubtitleRect **rects;
-
-    if (!raw) {
-        ts_to_string(s_start, sizeof(s_start), ts_start);
-        ts_to_string(s_end,   sizeof(s_end),   ts_end  );
-        len = snprintf(header, sizeof(header), "Dialogue: 0,%s,%s,",
-                       s_start, s_end);
-    }
-
-    dlen = strcspn(dialog, "\n");
-    dlen += dialog[dlen] == '\n';
-
-    rects = av_realloc(sub->rects, (sub->num_rects+1) * sizeof(*sub->rects));
-    if (!rects)
-        return AVERROR(ENOMEM);
-    sub->rects = rects;
-    sub->end_display_time = FFMAX(sub->end_display_time, 10 * duration);
-    rects[sub->num_rects]       = av_mallocz(sizeof(*rects[0]));
-    rects[sub->num_rects]->type = SUBTITLE_ASS;
-    rects[sub->num_rects]->ass  = av_malloc(len + dlen + 1);
-    strcpy (rects[sub->num_rects]->ass      , header);
-    av_strlcpy(rects[sub->num_rects]->ass + len, dialog, dlen + 1);
-    sub->num_rects++;
-    return dlen;
-}
diff --git a/deps/libav/libavcodec/ass.h b/deps/libav/libavcodec/ass.h
deleted file mode 100644
index 594b5f3..0000000
--- a/deps/libav/libavcodec/ass.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * SSA/ASS common funtions
- * Copyright (c) 2010  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ASS_H
-#define AVCODEC_ASS_H
-
-#include "avcodec.h"
-
-/**
- * @name Default values for ASS style
- * @{
- */
-#define ASS_DEFAULT_FONT        "Arial"
-#define ASS_DEFAULT_FONT_SIZE   16
-#define ASS_DEFAULT_COLOR       0xffffff
-#define ASS_DEFAULT_BACK_COLOR  0
-#define ASS_DEFAULT_BOLD        0
-#define ASS_DEFAULT_ITALIC      0
-#define ASS_DEFAULT_UNDERLINE   0
-#define ASS_DEFAULT_ALIGNMENT   2
-/** @} */
-
-/**
- * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS
- * with default style.
- *
- * @param avctx pointer to the AVCodecContext
- * @return >= 0 on success otherwise an error code <0
- */
-int ff_ass_subtitle_header_default(AVCodecContext *avctx);
-
-/**
- * Initialize an AVSubtitle structure for use with ff_ass_add_rect().
- *
- * @param sub pointer to the AVSubtitle
- */
-void ff_ass_init(AVSubtitle *sub);
-
-/**
- * Add an ASS dialog line to an AVSubtitle as a new AVSubtitleRect.
- *
- * @param sub pointer to the AVSubtitle
- * @param dialog ASS dialog to add to sub
- * @param ts_start start timestamp for this dialog (in 1/100 second unit)
- * @param ts_end end timestamp for this dialog (in 1/100 second unit)
- * @param raw when set to 1, it indicates that dialog contains a whole ASS
- *                           dialog line which should be copied as is.
- *            when set to 0, it indicates that dialog contains only the Text
- *                           part of the ASS dialog line, the rest of the line
- *                           will be generated.
- * @return number of characters read from dialog. It can be less than the whole
- *         length of dialog, if dialog contains several lines of text.
- *         A negative value indicates an error.
- */
-int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
-                    int ts_start, int ts_end, int raw);
-
-#endif /* AVCODEC_ASS_H */
diff --git a/deps/libav/libavcodec/assdec.c b/deps/libav/libavcodec/assdec.c
deleted file mode 100644
index 7a69582..0000000
--- a/deps/libav/libavcodec/assdec.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * SSA/ASS decoder
- * Copyright (c) 2010  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "avcodec.h"
-#include "ass.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-
-static av_cold int ass_decode_init(AVCodecContext *avctx)
-{
-    avctx->subtitle_header = av_malloc(avctx->extradata_size);
-    if (!avctx->extradata)
-        return AVERROR(ENOMEM);
-    memcpy(avctx->subtitle_header, avctx->extradata, avctx->extradata_size);
-    avctx->subtitle_header_size = avctx->extradata_size;
-    return 0;
-}
-
-static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr,
-                            AVPacket *avpkt)
-{
-    const char *ptr = avpkt->data;
-    int len, size = avpkt->size;
-
-    ff_ass_init(data);
-
-    while (size > 0) {
-        len = ff_ass_add_rect(data, ptr, 0, 0/* FIXME: duration */, 1);
-        if (len < 0)
-            return len;
-        ptr  += len;
-        size -= len;
-    }
-
-    *got_sub_ptr = avpkt->size > 0;
-    return avpkt->size;
-}
-
-AVCodec ff_ass_decoder = {
-    .name         = "ass",
-    .long_name    = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
-    .type         = AVMEDIA_TYPE_SUBTITLE,
-    .id           = AV_CODEC_ID_SSA,
-    .init         = ass_decode_init,
-    .decode       = ass_decode_frame,
-};
diff --git a/deps/libav/libavcodec/assenc.c b/deps/libav/libavcodec/assenc.c
deleted file mode 100644
index caf266e..0000000
--- a/deps/libav/libavcodec/assenc.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * SSA/ASS encoder
- * Copyright (c) 2010  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "avcodec.h"
-#include "libavutil/avstring.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-
-static av_cold int ass_encode_init(AVCodecContext *avctx)
-{
-    avctx->extradata = av_malloc(avctx->subtitle_header_size);
-    if (!avctx->extradata)
-        return AVERROR(ENOMEM);
-    memcpy(avctx->extradata, avctx->subtitle_header, avctx->subtitle_header_size);
-    avctx->extradata_size = avctx->subtitle_header_size;
-    return 0;
-}
-
-static int ass_encode_frame(AVCodecContext *avctx,
-                            unsigned char *buf, int bufsize,
-                            const AVSubtitle *sub)
-{
-    int i, len, total_len = 0;
-
-    for (i=0; i<sub->num_rects; i++) {
-        if (sub->rects[i]->type != SUBTITLE_ASS) {
-            av_log(avctx, AV_LOG_ERROR, "Only SUBTITLE_ASS type supported.\n");
-            return -1;
-        }
-
-        len = av_strlcpy(buf+total_len, sub->rects[i]->ass, bufsize-total_len);
-
-        if (len > bufsize-total_len-1) {
-            av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n");
-            return -1;
-        }
-
-        total_len += len;
-    }
-
-    return total_len;
-}
-
-AVCodec ff_ass_encoder = {
-    .name         = "ass",
-    .long_name    = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
-    .type         = AVMEDIA_TYPE_SUBTITLE,
-    .id           = AV_CODEC_ID_SSA,
-    .init         = ass_encode_init,
-    .encode_sub   = ass_encode_frame,
-};
diff --git a/deps/libav/libavcodec/asv.c b/deps/libav/libavcodec/asv.c
deleted file mode 100644
index 9e3a023..0000000
--- a/deps/libav/libavcodec/asv.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ASUS V1/V2 encoder/decoder common data
- */
-
-#include <stdint.h>
-
-#include "asv.h"
-#include "avcodec.h"
-
-const uint8_t ff_asv_scantab[64] = {
-    0x00,0x08,0x01,0x09,0x10,0x18,0x11,0x19,
-    0x02,0x0A,0x03,0x0B,0x12,0x1A,0x13,0x1B,
-    0x04,0x0C,0x05,0x0D,0x20,0x28,0x21,0x29,
-    0x06,0x0E,0x07,0x0F,0x14,0x1C,0x15,0x1D,
-    0x22,0x2A,0x23,0x2B,0x30,0x38,0x31,0x39,
-    0x16,0x1E,0x17,0x1F,0x24,0x2C,0x25,0x2D,
-    0x32,0x3A,0x33,0x3B,0x26,0x2E,0x27,0x2F,
-    0x34,0x3C,0x35,0x3D,0x36,0x3E,0x37,0x3F,
-};
-
-const uint8_t ff_asv_ccp_tab[17][2] = {
-    {0x2,2}, {0x7,5}, {0xB,5}, {0x3,5},
-    {0xD,5}, {0x5,5}, {0x9,5}, {0x1,5},
-    {0xE,5}, {0x6,5}, {0xA,5}, {0x2,5},
-    {0xC,5}, {0x4,5}, {0x8,5}, {0x3,2},
-    {0xF,5}, //EOB
-};
-
-const uint8_t ff_asv_level_tab[7][2] = {
-    {3,4}, {3,3}, {3,2}, {0,3}, {2,2}, {2,3}, {2,4}
-};
-
-const uint8_t ff_asv_dc_ccp_tab[8][2] = {
-    {0x1,2}, {0xD,4}, {0xF,4}, {0xC,4},
-    {0x5,3}, {0xE,4}, {0x4,3}, {0x0,2},
-};
-
-const uint8_t ff_asv_ac_ccp_tab[16][2] = {
-    {0x00,2}, {0x3B,6}, {0x0A,4}, {0x3A,6},
-    {0x02,3}, {0x39,6}, {0x3C,6}, {0x38,6},
-    {0x03,3}, {0x3D,6}, {0x08,4}, {0x1F,5},
-    {0x09,4}, {0x0B,4}, {0x0D,4}, {0x0C,4},
-};
-
-const uint8_t ff_asv2_level_tab[63][2] = {
-    {0x3F,10},{0x2F,10},{0x37,10},{0x27,10},{0x3B,10},{0x2B,10},{0x33,10},{0x23,10},
-    {0x3D,10},{0x2D,10},{0x35,10},{0x25,10},{0x39,10},{0x29,10},{0x31,10},{0x21,10},
-    {0x1F, 8},{0x17, 8},{0x1B, 8},{0x13, 8},{0x1D, 8},{0x15, 8},{0x19, 8},{0x11, 8},
-    {0x0F, 6},{0x0B, 6},{0x0D, 6},{0x09, 6},
-    {0x07, 4},{0x05, 4},
-    {0x03, 2},
-    {0x00, 5},
-    {0x02, 2},
-    {0x04, 4},{0x06, 4},
-    {0x08, 6},{0x0C, 6},{0x0A, 6},{0x0E, 6},
-    {0x10, 8},{0x18, 8},{0x14, 8},{0x1C, 8},{0x12, 8},{0x1A, 8},{0x16, 8},{0x1E, 8},
-    {0x20,10},{0x30,10},{0x28,10},{0x38,10},{0x24,10},{0x34,10},{0x2C,10},{0x3C,10},
-    {0x22,10},{0x32,10},{0x2A,10},{0x3A,10},{0x26,10},{0x36,10},{0x2E,10},{0x3E,10},
-};
-
-av_cold void ff_asv_common_init(AVCodecContext *avctx) {
-    ASV1Context * const a = avctx->priv_data;
-
-    ff_dsputil_init(&a->dsp, avctx);
-
-    a->mb_width   = (avctx->width  + 15) / 16;
-    a->mb_height  = (avctx->height + 15) / 16;
-    a->mb_width2  = (avctx->width  + 0) / 16;
-    a->mb_height2 = (avctx->height + 0) / 16;
-
-    a->avctx= avctx;
-}
diff --git a/deps/libav/libavcodec/asv.h b/deps/libav/libavcodec/asv.h
deleted file mode 100644
index 3e56857..0000000
--- a/deps/libav/libavcodec/asv.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ASUS V1/V2 encoder/decoder common data.
- */
-
-#ifndef AVCODEC_ASV_H
-#define AVCODEC_ASV_H
-
-#include <stdint.h>
-
-#include "libavutil/mem.h"
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "put_bits.h"
-
-typedef struct ASV1Context{
-    AVCodecContext *avctx;
-    DSPContext dsp;
-    PutBitContext pb;
-    GetBitContext gb;
-    ScanTable scantable;
-    int inv_qscale;
-    int mb_width;
-    int mb_height;
-    int mb_width2;
-    int mb_height2;
-    DECLARE_ALIGNED(16, int16_t, block)[6][64];
-    uint16_t intra_matrix[64];
-    int q_intra_matrix[64];
-    uint8_t *bitstream_buffer;
-    unsigned int bitstream_buffer_size;
-} ASV1Context;
-
-extern const uint8_t ff_asv_scantab[64];
-extern const uint8_t ff_asv_ccp_tab[17][2];
-extern const uint8_t ff_asv_level_tab[7][2];
-extern const uint8_t ff_asv_dc_ccp_tab[8][2];
-extern const uint8_t ff_asv_ac_ccp_tab[16][2];
-extern const uint8_t ff_asv2_level_tab[63][2];
-
-void ff_asv_common_init(AVCodecContext *avctx);
-
-#endif /* AVCODEC_ASV_H */
diff --git a/deps/libav/libavcodec/asvdec.c b/deps/libav/libavcodec/asvdec.c
deleted file mode 100644
index f160434..0000000
--- a/deps/libav/libavcodec/asvdec.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ASUS V1/V2 decoder.
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-
-#include "asv.h"
-#include "avcodec.h"
-#include "put_bits.h"
-#include "internal.h"
-#include "mathops.h"
-#include "mpeg12data.h"
-
-#define VLC_BITS 6
-#define ASV2_LEVEL_VLC_BITS 10
-
-static VLC ccp_vlc;
-static VLC level_vlc;
-static VLC dc_ccp_vlc;
-static VLC ac_ccp_vlc;
-static VLC asv2_level_vlc;
-
-static av_cold void init_vlcs(ASV1Context *a)
-{
-    static int done = 0;
-
-    if (!done) {
-        done = 1;
-
-        INIT_VLC_STATIC(&ccp_vlc, VLC_BITS, 17,
-                        &ff_asv_ccp_tab[0][1], 2, 1,
-                        &ff_asv_ccp_tab[0][0], 2, 1, 64);
-        INIT_VLC_STATIC(&dc_ccp_vlc, VLC_BITS, 8,
-                        &ff_asv_dc_ccp_tab[0][1], 2, 1,
-                        &ff_asv_dc_ccp_tab[0][0], 2, 1, 64);
-        INIT_VLC_STATIC(&ac_ccp_vlc, VLC_BITS, 16,
-                        &ff_asv_ac_ccp_tab[0][1], 2, 1,
-                        &ff_asv_ac_ccp_tab[0][0], 2, 1, 64);
-        INIT_VLC_STATIC(&level_vlc,  VLC_BITS, 7,
-                        &ff_asv_level_tab[0][1], 2, 1,
-                        &ff_asv_level_tab[0][0], 2, 1, 64);
-        INIT_VLC_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63,
-                        &ff_asv2_level_tab[0][1], 2, 1,
-                        &ff_asv2_level_tab[0][0], 2, 1, 1024);
-    }
-}
-
-//FIXME write a reversed bitstream reader to avoid the double reverse
-static inline int asv2_get_bits(GetBitContext *gb, int n)
-{
-    return ff_reverse[get_bits(gb, n) << (8-n)];
-}
-
-static inline int asv1_get_level(GetBitContext *gb)
-{
-    int code = get_vlc2(gb, level_vlc.table, VLC_BITS, 1);
-
-    if (code == 3)
-        return get_sbits(gb, 8);
-    else
-        return code - 3;
-}
-
-static inline int asv2_get_level(GetBitContext *gb)
-{
-    int code = get_vlc2(gb, asv2_level_vlc.table, ASV2_LEVEL_VLC_BITS, 1);
-
-    if (code == 31)
-        return (int8_t)asv2_get_bits(gb, 8);
-    else
-        return code - 31;
-}
-
-static inline int asv1_decode_block(ASV1Context *a, int16_t block[64])
-{
-    int i;
-
-    block[0] = 8 * get_bits(&a->gb, 8);
-
-    for (i = 0; i < 11; i++) {
-        const int ccp = get_vlc2(&a->gb, ccp_vlc.table, VLC_BITS, 1);
-
-        if (ccp) {
-            if (ccp == 16)
-                break;
-            if (ccp < 0 || i >= 10) {
-                av_log(a->avctx, AV_LOG_ERROR, "coded coeff pattern damaged\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            if (ccp & 8)
-                block[a->scantable.permutated[4 * i + 0]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 0]) >> 4;
-            if (ccp & 4)
-                block[a->scantable.permutated[4 * i + 1]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 1]) >> 4;
-            if (ccp & 2)
-                block[a->scantable.permutated[4 * i + 2]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 2]) >> 4;
-            if (ccp & 1)
-                block[a->scantable.permutated[4 * i + 3]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 3]) >> 4;
-        }
-    }
-
-    return 0;
-}
-
-static inline int asv2_decode_block(ASV1Context *a, int16_t block[64])
-{
-    int i, count, ccp;
-
-    count = asv2_get_bits(&a->gb, 4);
-
-    block[0] = 8 * asv2_get_bits(&a->gb, 8);
-
-    ccp = get_vlc2(&a->gb, dc_ccp_vlc.table, VLC_BITS, 1);
-    if (ccp) {
-        if (ccp & 4)
-            block[a->scantable.permutated[1]] = (asv2_get_level(&a->gb) * a->intra_matrix[1]) >> 4;
-        if (ccp & 2)
-            block[a->scantable.permutated[2]] = (asv2_get_level(&a->gb) * a->intra_matrix[2]) >> 4;
-        if (ccp & 1)
-            block[a->scantable.permutated[3]] = (asv2_get_level(&a->gb) * a->intra_matrix[3]) >> 4;
-    }
-
-    for (i = 1; i < count + 1; i++) {
-        const int ccp = get_vlc2(&a->gb, ac_ccp_vlc.table, VLC_BITS, 1);
-
-        if (ccp) {
-            if (ccp & 8)
-                block[a->scantable.permutated[4*i + 0]] = (asv2_get_level(&a->gb) * a->intra_matrix[4*i + 0]) >> 4;
-            if (ccp & 4)
-                block[a->scantable.permutated[4*i + 1]] = (asv2_get_level(&a->gb) * a->intra_matrix[4*i + 1]) >> 4;
-            if (ccp & 2)
-                block[a->scantable.permutated[4*i + 2]] = (asv2_get_level(&a->gb) * a->intra_matrix[4*i + 2]) >> 4;
-            if (ccp & 1)
-                block[a->scantable.permutated[4*i + 3]] = (asv2_get_level(&a->gb) * a->intra_matrix[4*i + 3]) >> 4;
-        }
-    }
-
-    return 0;
-}
-
-static inline int decode_mb(ASV1Context *a, int16_t block[6][64])
-{
-    int i;
-
-    a->dsp.clear_blocks(block[0]);
-
-    if (a->avctx->codec_id == AV_CODEC_ID_ASV1) {
-        for (i = 0; i < 6; i++) {
-            if (asv1_decode_block(a, block[i]) < 0)
-                return -1;
-        }
-    } else {
-        for (i = 0; i < 6; i++) {
-            if (asv2_decode_block(a, block[i]) < 0)
-                return -1;
-        }
-    }
-    return 0;
-}
-
-static inline void idct_put(ASV1Context *a, AVFrame *frame, int mb_x, int mb_y)
-{
-    int16_t (*block)[64] = a->block;
-    int linesize         = frame->linesize[0];
-
-    uint8_t *dest_y  = frame->data[0] + (mb_y * 16* linesize              ) + mb_x * 16;
-    uint8_t *dest_cb = frame->data[1] + (mb_y * 8 * frame->linesize[1]) + mb_x * 8;
-    uint8_t *dest_cr = frame->data[2] + (mb_y * 8 * frame->linesize[2]) + mb_x * 8;
-
-    a->dsp.idct_put(dest_y                 , linesize, block[0]);
-    a->dsp.idct_put(dest_y              + 8, linesize, block[1]);
-    a->dsp.idct_put(dest_y + 8*linesize    , linesize, block[2]);
-    a->dsp.idct_put(dest_y + 8*linesize + 8, linesize, block[3]);
-
-    if (!(a->avctx->flags&CODEC_FLAG_GRAY)) {
-        a->dsp.idct_put(dest_cb, frame->linesize[1], block[4]);
-        a->dsp.idct_put(dest_cr, frame->linesize[2], block[5]);
-    }
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    ASV1Context * const a = avctx->priv_data;
-    const uint8_t *buf    = avpkt->data;
-    int buf_size          = avpkt->size;
-    AVFrame * const p     = data;
-    int mb_x, mb_y, ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->key_frame = 1;
-
-    av_fast_padded_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size,
-                          buf_size);
-    if (!a->bitstream_buffer)
-        return AVERROR(ENOMEM);
-
-    if (avctx->codec_id == AV_CODEC_ID_ASV1)
-        a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (const uint32_t*)buf, buf_size/4);
-    else {
-        int i;
-        for (i = 0; i < buf_size; i++)
-            a->bitstream_buffer[i] = ff_reverse[buf[i]];
-    }
-
-    init_get_bits(&a->gb, a->bitstream_buffer, buf_size*8);
-
-    for (mb_y = 0; mb_y < a->mb_height2; mb_y++) {
-        for (mb_x = 0; mb_x < a->mb_width2; mb_x++) {
-            if ((ret = decode_mb(a, a->block)) < 0)
-                return ret;
-
-            idct_put(a, p, mb_x, mb_y);
-        }
-    }
-
-    if (a->mb_width2 != a->mb_width) {
-        mb_x = a->mb_width2;
-        for (mb_y = 0; mb_y < a->mb_height2; mb_y++) {
-            if ((ret = decode_mb(a, a->block)) < 0)
-                return ret;
-
-            idct_put(a, p, mb_x, mb_y);
-        }
-    }
-
-    if (a->mb_height2 != a->mb_height) {
-        mb_y = a->mb_height2;
-        for (mb_x = 0; mb_x < a->mb_width; mb_x++) {
-            if ((ret = decode_mb(a, a->block)) < 0)
-                return ret;
-
-            idct_put(a, p, mb_x, mb_y);
-        }
-    }
-
-    *got_frame = 1;
-
-    emms_c();
-
-    return (get_bits_count(&a->gb) + 31) / 32 * 4;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    ASV1Context * const a = avctx->priv_data;
-    const int scale       = avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2;
-    int i;
-
-    if (avctx->extradata_size < 1) {
-        av_log(avctx, AV_LOG_ERROR, "No extradata provided\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ff_asv_common_init(avctx);
-    init_vlcs(a);
-    ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_asv_scantab);
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    a->inv_qscale = avctx->extradata[0];
-    if (a->inv_qscale == 0) {
-        av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n");
-        if (avctx->codec_id == AV_CODEC_ID_ASV1)
-            a->inv_qscale = 6;
-        else
-            a->inv_qscale = 10;
-    }
-
-    for (i = 0; i < 64; i++) {
-        int index = ff_asv_scantab[i];
-
-        a->intra_matrix[i] = 64 * scale * ff_mpeg1_default_intra_matrix[index] / a->inv_qscale;
-    }
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    ASV1Context * const a = avctx->priv_data;
-
-    av_freep(&a->bitstream_buffer);
-    a->bitstream_buffer_size = 0;
-
-    return 0;
-}
-
-AVCodec ff_asv1_decoder = {
-    .name           = "asv1",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASUS V1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ASV1,
-    .priv_data_size = sizeof(ASV1Context),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-AVCodec ff_asv2_decoder = {
-    .name           = "asv2",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASUS V2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ASV2,
-    .priv_data_size = sizeof(ASV1Context),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
diff --git a/deps/libav/libavcodec/asvenc.c b/deps/libav/libavcodec/asvenc.c
deleted file mode 100644
index 6c83c92..0000000
--- a/deps/libav/libavcodec/asvenc.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ASUS V1/V2 encoder.
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-
-#include "asv.h"
-#include "avcodec.h"
-#include "mathops.h"
-#include "mpeg12data.h"
-
-static inline void asv2_put_bits(PutBitContext *pb, int n, int v){
-    put_bits(pb, n, ff_reverse[ v << (8-n) ]);
-}
-
-static inline void asv1_put_level(PutBitContext *pb, int level){
-    unsigned int index= level + 3;
-
-    if(index <= 6) put_bits(pb, ff_asv_level_tab[index][1], ff_asv_level_tab[index][0]);
-    else{
-        put_bits(pb, ff_asv_level_tab[3][1], ff_asv_level_tab[3][0]);
-        put_sbits(pb, 8, level);
-    }
-}
-
-static inline void asv2_put_level(PutBitContext *pb, int level){
-    unsigned int index= level + 31;
-
-    if(index <= 62) put_bits(pb, ff_asv2_level_tab[index][1], ff_asv2_level_tab[index][0]);
-    else{
-        put_bits(pb, ff_asv2_level_tab[31][1], ff_asv2_level_tab[31][0]);
-        asv2_put_bits(pb, 8, level&0xFF);
-    }
-}
-
-static inline void asv1_encode_block(ASV1Context *a, int16_t block[64]){
-    int i;
-    int nc_count=0;
-
-    put_bits(&a->pb, 8, (block[0] + 32)>>6);
-    block[0]= 0;
-
-    for(i=0; i<10; i++){
-        const int index = ff_asv_scantab[4*i];
-        int ccp=0;
-
-        if( (block[index + 0] = (block[index + 0]*a->q_intra_matrix[index + 0] + (1<<15))>>16) ) ccp |= 8;
-        if( (block[index + 8] = (block[index + 8]*a->q_intra_matrix[index + 8] + (1<<15))>>16) ) ccp |= 4;
-        if( (block[index + 1] = (block[index + 1]*a->q_intra_matrix[index + 1] + (1<<15))>>16) ) ccp |= 2;
-        if( (block[index + 9] = (block[index + 9]*a->q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
-
-        if(ccp){
-            for(;nc_count; nc_count--)
-                put_bits(&a->pb, ff_asv_ccp_tab[0][1], ff_asv_ccp_tab[0][0]);
-
-            put_bits(&a->pb, ff_asv_ccp_tab[ccp][1], ff_asv_ccp_tab[ccp][0]);
-
-            if(ccp&8) asv1_put_level(&a->pb, block[index + 0]);
-            if(ccp&4) asv1_put_level(&a->pb, block[index + 8]);
-            if(ccp&2) asv1_put_level(&a->pb, block[index + 1]);
-            if(ccp&1) asv1_put_level(&a->pb, block[index + 9]);
-        }else{
-            nc_count++;
-        }
-    }
-    put_bits(&a->pb, ff_asv_ccp_tab[16][1], ff_asv_ccp_tab[16][0]);
-}
-
-static inline void asv2_encode_block(ASV1Context *a, int16_t block[64]){
-    int i;
-    int count=0;
-
-    for(count=63; count>3; count--){
-        const int index = ff_asv_scantab[count];
-
-        if( (block[index]*a->q_intra_matrix[index] + (1<<15))>>16 )
-            break;
-    }
-
-    count >>= 2;
-
-    asv2_put_bits(&a->pb, 4, count);
-    asv2_put_bits(&a->pb, 8, (block[0] + 32)>>6);
-    block[0]= 0;
-
-    for(i=0; i<=count; i++){
-        const int index = ff_asv_scantab[4*i];
-        int ccp=0;
-
-        if( (block[index + 0] = (block[index + 0]*a->q_intra_matrix[index + 0] + (1<<15))>>16) ) ccp |= 8;
-        if( (block[index + 8] = (block[index + 8]*a->q_intra_matrix[index + 8] + (1<<15))>>16) ) ccp |= 4;
-        if( (block[index + 1] = (block[index + 1]*a->q_intra_matrix[index + 1] + (1<<15))>>16) ) ccp |= 2;
-        if( (block[index + 9] = (block[index + 9]*a->q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
-
-        assert(i || ccp<8);
-        if(i) put_bits(&a->pb, ff_asv_ac_ccp_tab[ccp][1], ff_asv_ac_ccp_tab[ccp][0]);
-        else  put_bits(&a->pb, ff_asv_dc_ccp_tab[ccp][1], ff_asv_dc_ccp_tab[ccp][0]);
-
-        if(ccp){
-            if(ccp&8) asv2_put_level(&a->pb, block[index + 0]);
-            if(ccp&4) asv2_put_level(&a->pb, block[index + 8]);
-            if(ccp&2) asv2_put_level(&a->pb, block[index + 1]);
-            if(ccp&1) asv2_put_level(&a->pb, block[index + 9]);
-        }
-    }
-}
-
-#define MAX_MB_SIZE (30*16*16*3/2/8)
-
-static inline int encode_mb(ASV1Context *a, int16_t block[6][64]){
-    int i;
-
-    if (a->pb.buf_end - a->pb.buf - (put_bits_count(&a->pb)>>3) < MAX_MB_SIZE) {
-        av_log(a->avctx, AV_LOG_ERROR, "encoded frame too large\n");
-        return -1;
-    }
-
-    if(a->avctx->codec_id == AV_CODEC_ID_ASV1){
-        for(i=0; i<6; i++)
-            asv1_encode_block(a, block[i]);
-    }else{
-        for(i=0; i<6; i++)
-            asv2_encode_block(a, block[i]);
-    }
-    return 0;
-}
-
-static inline void dct_get(ASV1Context *a, const AVFrame *frame,
-                           int mb_x, int mb_y)
-{
-    int16_t (*block)[64]= a->block;
-    int linesize = frame->linesize[0];
-    int i;
-
-    uint8_t *ptr_y  = frame->data[0] + (mb_y * 16* linesize              ) + mb_x * 16;
-    uint8_t *ptr_cb = frame->data[1] + (mb_y * 8 * frame->linesize[1]) + mb_x * 8;
-    uint8_t *ptr_cr = frame->data[2] + (mb_y * 8 * frame->linesize[2]) + mb_x * 8;
-
-    a->dsp.get_pixels(block[0], ptr_y                 , linesize);
-    a->dsp.get_pixels(block[1], ptr_y              + 8, linesize);
-    a->dsp.get_pixels(block[2], ptr_y + 8*linesize    , linesize);
-    a->dsp.get_pixels(block[3], ptr_y + 8*linesize + 8, linesize);
-    for(i=0; i<4; i++)
-        a->dsp.fdct(block[i]);
-
-    if(!(a->avctx->flags&CODEC_FLAG_GRAY)){
-        a->dsp.get_pixels(block[4], ptr_cb, frame->linesize[1]);
-        a->dsp.get_pixels(block[5], ptr_cr, frame->linesize[2]);
-        for(i=4; i<6; i++)
-            a->dsp.fdct(block[i]);
-    }
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *pict, int *got_packet)
-{
-    ASV1Context * const a = avctx->priv_data;
-    int size, ret;
-    int mb_x, mb_y;
-
-    if (!pkt->data &&
-        (ret = av_new_packet(pkt, a->mb_height*a->mb_width*MAX_MB_SIZE +
-                                  FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    init_put_bits(&a->pb, pkt->data, pkt->size);
-
-    for(mb_y=0; mb_y<a->mb_height2; mb_y++){
-        for(mb_x=0; mb_x<a->mb_width2; mb_x++){
-            dct_get(a, pict, mb_x, mb_y);
-            encode_mb(a, a->block);
-        }
-    }
-
-    if(a->mb_width2 != a->mb_width){
-        mb_x= a->mb_width2;
-        for(mb_y=0; mb_y<a->mb_height2; mb_y++){
-            dct_get(a, pict, mb_x, mb_y);
-            encode_mb(a, a->block);
-        }
-    }
-
-    if(a->mb_height2 != a->mb_height){
-        mb_y= a->mb_height2;
-        for(mb_x=0; mb_x<a->mb_width; mb_x++){
-            dct_get(a, pict, mb_x, mb_y);
-            encode_mb(a, a->block);
-        }
-    }
-    emms_c();
-
-    avpriv_align_put_bits(&a->pb);
-    while(put_bits_count(&a->pb)&31)
-        put_bits(&a->pb, 8, 0);
-
-    size= put_bits_count(&a->pb)/32;
-
-    if(avctx->codec_id == AV_CODEC_ID_ASV1)
-        a->dsp.bswap_buf((uint32_t*)pkt->data, (uint32_t*)pkt->data, size);
-    else{
-        int i;
-        for(i=0; i<4*size; i++)
-            pkt->data[i] = ff_reverse[pkt->data[i]];
-    }
-
-    pkt->size   = size*4;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int encode_init(AVCodecContext *avctx){
-    ASV1Context * const a = avctx->priv_data;
-    int i;
-    const int scale= avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2;
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    ff_asv_common_init(avctx);
-
-    if(avctx->global_quality == 0) avctx->global_quality= 4*FF_QUALITY_SCALE;
-
-    a->inv_qscale= (32*scale*FF_QUALITY_SCALE +  avctx->global_quality/2) / avctx->global_quality;
-
-    avctx->extradata= av_mallocz(8);
-    avctx->extradata_size=8;
-    ((uint32_t*)avctx->extradata)[0]= av_le2ne32(a->inv_qscale);
-    ((uint32_t*)avctx->extradata)[1]= av_le2ne32(AV_RL32("ASUS"));
-
-    for(i=0; i<64; i++){
-        int q= 32*scale*ff_mpeg1_default_intra_matrix[i];
-        a->q_intra_matrix[i]= ((a->inv_qscale<<16) + q/2) / q;
-    }
-
-    return 0;
-}
-static av_cold int asv_encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-#if CONFIG_ASV1_ENCODER
-AVCodec ff_asv1_encoder = {
-    .name           = "asv1",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASUS V1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ASV1,
-    .priv_data_size = sizeof(ASV1Context),
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = asv_encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
-                                                    AV_PIX_FMT_NONE },
-};
-#endif
-
-#if CONFIG_ASV2_ENCODER
-AVCodec ff_asv2_encoder = {
-    .name           = "asv2",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASUS V2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ASV2,
-    .priv_data_size = sizeof(ASV1Context),
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = asv_encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
-                                                    AV_PIX_FMT_NONE },
-};
-#endif
diff --git a/deps/libav/libavcodec/atrac.c b/deps/libav/libavcodec/atrac.c
deleted file mode 100644
index f36db9e..0000000
--- a/deps/libav/libavcodec/atrac.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * common functions for the ATRAC family of decoders
- *
- * Copyright (c) 2006-2013 Maxim Poliakovski
- * Copyright (c) 2006-2008 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- */
-
-#include <math.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "atrac.h"
-
-float ff_atrac_sf_table[64];
-static float qmf_window[48];
-
-static const float qmf_48tap_half[24] = {
-   -0.00001461907, -0.00009205479,-0.000056157569,0.00030117269,
-    0.0002422519,  -0.00085293897,-0.0005205574,  0.0020340169,
-    0.00078333891, -0.0042153862, -0.00075614988, 0.0078402944,
-   -0.000061169922,-0.01344162,    0.0024626821,  0.021736089,
-   -0.007801671,   -0.034090221,   0.01880949,    0.054326009,
-   -0.043596379,   -0.099384367,   0.13207909,    0.46424159
-};
-
-av_cold void ff_atrac_generate_tables(void)
-{
-    int i;
-    float s;
-
-    /* Generate scale factors */
-    if (!ff_atrac_sf_table[63])
-        for (i=0 ; i<64 ; i++)
-            ff_atrac_sf_table[i] = pow(2.0, (i - 15) / 3.0);
-
-    /* Generate the QMF window. */
-    if (!qmf_window[47])
-        for (i=0 ; i<24; i++) {
-            s = qmf_48tap_half[i] * 2.0;
-            qmf_window[i] = qmf_window[47 - i] = s;
-        }
-}
-
-av_cold void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int id2exp_offset,
-                                             int loc_scale)
-{
-    int i;
-
-    gctx->loc_scale     = loc_scale;
-    gctx->loc_size      = 1 << loc_scale;
-    gctx->id2exp_offset = id2exp_offset;
-
-    /* Generate gain level table. */
-    for (i = 0; i < 16; i++)
-        gctx->gain_tab1[i] = powf(2.0, id2exp_offset - i);
-
-    /* Generate gain interpolation table. */
-    for (i = -15; i < 16; i++)
-        gctx->gain_tab2[i + 15] = powf(2.0, -1.0f / gctx->loc_size * i);
-}
-
-void ff_atrac_gain_compensation(AtracGCContext *gctx, float *in, float *prev,
-                                AtracGainInfo *gc_now, AtracGainInfo *gc_next,
-                                int num_samples, float *out)
-{
-    float lev, gc_scale, gain_inc;
-    int i, pos, lastpos;
-
-    gc_scale = gc_next->num_points ? gctx->gain_tab1[gc_next->lev_code[0]]
-                                   : 1.0f;
-
-    if (!gc_now->num_points) {
-        for (pos = 0; pos < num_samples; pos++)
-            out[pos] = in[pos] * gc_scale + prev[pos];
-    } else {
-        pos = 0;
-
-        for (i = 0; i < gc_now->num_points; i++) {
-            lastpos = gc_now->loc_code[i] << gctx->loc_scale;
-
-            lev = gctx->gain_tab1[gc_now->lev_code[i]];
-            gain_inc = gctx->gain_tab2[(i + 1 < gc_now->num_points ? gc_now->lev_code[i + 1]
-                                                                   : gctx->id2exp_offset) -
-                                       gc_now->lev_code[i] + 15];
-
-            /* apply constant gain level and overlap */
-            for (; pos < lastpos; pos++)
-                out[pos] = (in[pos] * gc_scale + prev[pos]) * lev;
-
-            /* interpolate between two different gain levels */
-            for (; pos < lastpos + gctx->loc_size; pos++) {
-                out[pos] = (in[pos] * gc_scale + prev[pos]) * lev;
-                lev *= gain_inc;
-            }
-        }
-
-        for (; pos < num_samples; pos++)
-            out[pos] = in[pos] * gc_scale + prev[pos];
-    }
-
-    /* copy the overlapping part into the delay buffer */
-    memcpy(prev, &in[num_samples], num_samples * sizeof(float));
-}
-
-void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp)
-{
-    int   i, j;
-    float   *p1, *p3;
-
-    memcpy(temp, delayBuf, 46*sizeof(float));
-
-    p3 = temp + 46;
-
-    /* loop1 */
-    for(i=0; i<nIn; i+=2){
-        p3[2*i+0] = inlo[i  ] + inhi[i  ];
-        p3[2*i+1] = inlo[i  ] - inhi[i  ];
-        p3[2*i+2] = inlo[i+1] + inhi[i+1];
-        p3[2*i+3] = inlo[i+1] - inhi[i+1];
-    }
-
-    /* loop2 */
-    p1 = temp;
-    for (j = nIn; j != 0; j--) {
-        float s1 = 0.0;
-        float s2 = 0.0;
-
-        for (i = 0; i < 48; i += 2) {
-            s1 += p1[i] * qmf_window[i];
-            s2 += p1[i+1] * qmf_window[i+1];
-        }
-
-        pOut[0] = s2;
-        pOut[1] = s1;
-
-        p1 += 2;
-        pOut += 2;
-    }
-
-    /* Update the delay buffer. */
-    memcpy(delayBuf, temp + nIn*2, 46*sizeof(float));
-}
diff --git a/deps/libav/libavcodec/atrac.h b/deps/libav/libavcodec/atrac.h
deleted file mode 100644
index 8909323..0000000
--- a/deps/libav/libavcodec/atrac.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * common functions for the ATRAC family of decoders
- *
- * Copyright (c) 2009-2013 Maxim Poliakovski
- * Copyright (c) 2009 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ATRAC common header
- */
-
-#ifndef AVCODEC_ATRAC_H
-#define AVCODEC_ATRAC_H
-
-/**
- *  Gain control parameters for one subband.
- */
-typedef struct AtracGainInfo {
-    int   num_points;   ///< number of gain control points
-    int   lev_code[7];  ///< level at corresponding control point
-    int   loc_code[7];  ///< location of gain control points
-} AtracGainInfo;
-
-/**
- *  Gain compensation context structure.
- */
-typedef struct AtracGCContext {
-    float   gain_tab1[16];  ///< gain compensation level table
-    float   gain_tab2[31];  ///< gain compensation interpolation table
-    int     id2exp_offset;  ///< offset for converting level index into level exponent
-    int     loc_scale;      ///< scale of location code = 2^loc_scale samples
-    int     loc_size;       ///< size of location code in samples
-} AtracGCContext;
-
-extern float ff_atrac_sf_table[64];
-
-/**
- * Generate common tables.
- */
-void ff_atrac_generate_tables(void);
-
-/**
- *  Initialize gain compensation context.
- *
- * @param gctx            pointer to gain compensation context to initialize
- * @param id2exp_offset   offset for converting level index into level exponent
- * @param loc_scale       location size factor
- */
-void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int id2exp_offset,
-                                     int loc_scale);
-
-/**
- * Apply gain compensation and perform the MDCT overlapping part.
- *
- * @param gctx         pointer to gain compensation context
- * @param in           input buffer
- * @param prev         previous buffer to perform overlap against
- * @param gc_now       gain control information for current frame
- * @param gc_next      gain control information for next frame
- * @param num_samples  number of samples to process
- * @param out          output data goes here
- */
-void ff_atrac_gain_compensation(AtracGCContext *gctx, float *in, float *prev,
-                                AtracGainInfo *gc_now, AtracGainInfo *gc_next,
-                                int num_samples, float *out);
-
-/**
- * Quadrature mirror synthesis filter.
- *
- * @param inlo      lower part of spectrum
- * @param inhi      higher part of spectrum
- * @param nIn       size of spectrum buffer
- * @param pOut      out buffer
- * @param delayBuf  delayBuf buffer
- * @param temp      temp buffer
- */
-void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp);
-
-#endif /* AVCODEC_ATRAC_H */
diff --git a/deps/libav/libavcodec/atrac1.c b/deps/libav/libavcodec/atrac1.c
deleted file mode 100644
index 9a89785..0000000
--- a/deps/libav/libavcodec/atrac1.c
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * ATRAC1 compatible decoder
- * Copyright (c) 2009 Maxim Poliakovski
- * Copyright (c) 2009 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ATRAC1 compatible decoder.
- * This decoder handles raw ATRAC1 data and probably SDDS data.
- */
-
-/* Many thanks to Tim Craig for all the help! */
-
-#include <math.h>
-#include <stddef.h>
-#include <stdio.h>
-
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "fft.h"
-#include "internal.h"
-#include "sinewin.h"
-
-#include "atrac.h"
-#include "atrac1data.h"
-
-#define AT1_MAX_BFU      52                 ///< max number of block floating units in a sound unit
-#define AT1_SU_SIZE      212                ///< number of bytes in a sound unit
-#define AT1_SU_SAMPLES   512                ///< number of samples in a sound unit
-#define AT1_FRAME_SIZE   AT1_SU_SIZE * 2
-#define AT1_SU_MAX_BITS  AT1_SU_SIZE * 8
-#define AT1_MAX_CHANNELS 2
-
-#define AT1_QMF_BANDS    3
-#define IDX_LOW_BAND     0
-#define IDX_MID_BAND     1
-#define IDX_HIGH_BAND    2
-
-/**
- * Sound unit struct, one unit is used per channel
- */
-typedef struct {
-    int                 log2_block_count[AT1_QMF_BANDS];    ///< log2 number of blocks in a band
-    int                 num_bfus;                           ///< number of Block Floating Units
-    float*              spectrum[2];
-    DECLARE_ALIGNED(32, float, spec1)[AT1_SU_SAMPLES];     ///< mdct buffer
-    DECLARE_ALIGNED(32, float, spec2)[AT1_SU_SAMPLES];     ///< mdct buffer
-    DECLARE_ALIGNED(32, float, fst_qmf_delay)[46];         ///< delay line for the 1st stacked QMF filter
-    DECLARE_ALIGNED(32, float, snd_qmf_delay)[46];         ///< delay line for the 2nd stacked QMF filter
-    DECLARE_ALIGNED(32, float, last_qmf_delay)[256+23];    ///< delay line for the last stacked QMF filter
-} AT1SUCtx;
-
-/**
- * The atrac1 context, holds all needed parameters for decoding
- */
-typedef struct {
-    AT1SUCtx            SUs[AT1_MAX_CHANNELS];              ///< channel sound unit
-    DECLARE_ALIGNED(32, float, spec)[AT1_SU_SAMPLES];      ///< the mdct spectrum buffer
-
-    DECLARE_ALIGNED(32, float,  low)[256];
-    DECLARE_ALIGNED(32, float,  mid)[256];
-    DECLARE_ALIGNED(32, float, high)[512];
-    float*              bands[3];
-    FFTContext          mdct_ctx[3];
-    AVFloatDSPContext   fdsp;
-} AT1Ctx;
-
-/** size of the transform in samples in the long mode for each QMF band */
-static const uint16_t samples_per_band[3] = {128, 128, 256};
-static const uint8_t   mdct_long_nbits[3] = {7, 7, 8};
-
-
-static void at1_imdct(AT1Ctx *q, float *spec, float *out, int nbits,
-                      int rev_spec)
-{
-    FFTContext* mdct_context = &q->mdct_ctx[nbits - 5 - (nbits > 6)];
-    int transf_size = 1 << nbits;
-
-    if (rev_spec) {
-        int i;
-        for (i = 0; i < transf_size / 2; i++)
-            FFSWAP(float, spec[i], spec[transf_size - 1 - i]);
-    }
-    mdct_context->imdct_half(mdct_context, out, spec);
-}
-
-
-static int at1_imdct_block(AT1SUCtx* su, AT1Ctx *q)
-{
-    int          band_num, band_samples, log2_block_count, nbits, num_blocks, block_size;
-    unsigned int start_pos, ref_pos = 0, pos = 0;
-
-    for (band_num = 0; band_num < AT1_QMF_BANDS; band_num++) {
-        float *prev_buf;
-        int j;
-
-        band_samples = samples_per_band[band_num];
-        log2_block_count = su->log2_block_count[band_num];
-
-        /* number of mdct blocks in the current QMF band: 1 - for long mode */
-        /* 4 for short mode(low/middle bands) and 8 for short mode(high band)*/
-        num_blocks = 1 << log2_block_count;
-
-        if (num_blocks == 1) {
-            /* mdct block size in samples: 128 (long mode, low & mid bands), */
-            /* 256 (long mode, high band) and 32 (short mode, all bands) */
-            block_size = band_samples >> log2_block_count;
-
-            /* calc transform size in bits according to the block_size_mode */
-            nbits = mdct_long_nbits[band_num] - log2_block_count;
-
-            if (nbits != 5 && nbits != 7 && nbits != 8)
-                return AVERROR_INVALIDDATA;
-        } else {
-            block_size = 32;
-            nbits = 5;
-        }
-
-        start_pos = 0;
-        prev_buf = &su->spectrum[1][ref_pos + band_samples - 16];
-        for (j=0; j < num_blocks; j++) {
-            at1_imdct(q, &q->spec[pos], &su->spectrum[0][ref_pos + start_pos], nbits, band_num);
-
-            /* overlap and window */
-            q->fdsp.vector_fmul_window(&q->bands[band_num][start_pos], prev_buf,
-                                       &su->spectrum[0][ref_pos + start_pos], ff_sine_32, 16);
-
-            prev_buf = &su->spectrum[0][ref_pos+start_pos + 16];
-            start_pos += block_size;
-            pos += block_size;
-        }
-
-        if (num_blocks == 1)
-            memcpy(q->bands[band_num] + 32, &su->spectrum[0][ref_pos + 16], 240 * sizeof(float));
-
-        ref_pos += band_samples;
-    }
-
-    /* Swap buffers so the mdct overlap works */
-    FFSWAP(float*, su->spectrum[0], su->spectrum[1]);
-
-    return 0;
-}
-
-/**
- * Parse the block size mode byte
- */
-
-static int at1_parse_bsm(GetBitContext* gb, int log2_block_cnt[AT1_QMF_BANDS])
-{
-    int log2_block_count_tmp, i;
-
-    for (i = 0; i < 2; i++) {
-        /* low and mid band */
-        log2_block_count_tmp = get_bits(gb, 2);
-        if (log2_block_count_tmp & 1)
-            return AVERROR_INVALIDDATA;
-        log2_block_cnt[i] = 2 - log2_block_count_tmp;
-    }
-
-    /* high band */
-    log2_block_count_tmp = get_bits(gb, 2);
-    if (log2_block_count_tmp != 0 && log2_block_count_tmp != 3)
-        return AVERROR_INVALIDDATA;
-    log2_block_cnt[IDX_HIGH_BAND] = 3 - log2_block_count_tmp;
-
-    skip_bits(gb, 2);
-    return 0;
-}
-
-
-static int at1_unpack_dequant(GetBitContext* gb, AT1SUCtx* su,
-                              float spec[AT1_SU_SAMPLES])
-{
-    int bits_used, band_num, bfu_num, i;
-    uint8_t idwls[AT1_MAX_BFU];                 ///< the word length indexes for each BFU
-    uint8_t idsfs[AT1_MAX_BFU];                 ///< the scalefactor indexes for each BFU
-
-    /* parse the info byte (2nd byte) telling how much BFUs were coded */
-    su->num_bfus = bfu_amount_tab1[get_bits(gb, 3)];
-
-    /* calc number of consumed bits:
-        num_BFUs * (idwl(4bits) + idsf(6bits)) + log2_block_count(8bits) + info_byte(8bits)
-        + info_byte_copy(8bits) + log2_block_count_copy(8bits) */
-    bits_used = su->num_bfus * 10 + 32 +
-                bfu_amount_tab2[get_bits(gb, 2)] +
-                (bfu_amount_tab3[get_bits(gb, 3)] << 1);
-
-    /* get word length index (idwl) for each BFU */
-    for (i = 0; i < su->num_bfus; i++)
-        idwls[i] = get_bits(gb, 4);
-
-    /* get scalefactor index (idsf) for each BFU */
-    for (i = 0; i < su->num_bfus; i++)
-        idsfs[i] = get_bits(gb, 6);
-
-    /* zero idwl/idsf for empty BFUs */
-    for (i = su->num_bfus; i < AT1_MAX_BFU; i++)
-        idwls[i] = idsfs[i] = 0;
-
-    /* read in the spectral data and reconstruct MDCT spectrum of this channel */
-    for (band_num = 0; band_num < AT1_QMF_BANDS; band_num++) {
-        for (bfu_num = bfu_bands_t[band_num]; bfu_num < bfu_bands_t[band_num+1]; bfu_num++) {
-            int pos;
-
-            int num_specs = specs_per_bfu[bfu_num];
-            int word_len  = !!idwls[bfu_num] + idwls[bfu_num];
-            float scale_factor = ff_atrac_sf_table[idsfs[bfu_num]];
-            bits_used += word_len * num_specs; /* add number of bits consumed by current BFU */
-
-            /* check for bitstream overflow */
-            if (bits_used > AT1_SU_MAX_BITS)
-                return AVERROR_INVALIDDATA;
-
-            /* get the position of the 1st spec according to the block size mode */
-            pos = su->log2_block_count[band_num] ? bfu_start_short[bfu_num] : bfu_start_long[bfu_num];
-
-            if (word_len) {
-                float   max_quant = 1.0 / (float)((1 << (word_len - 1)) - 1);
-
-                for (i = 0; i < num_specs; i++) {
-                    /* read in a quantized spec and convert it to
-                     * signed int and then inverse quantization
-                     */
-                    spec[pos+i] = get_sbits(gb, word_len) * scale_factor * max_quant;
-                }
-            } else { /* word_len = 0 -> empty BFU, zero all specs in the emty BFU */
-                memset(&spec[pos], 0, num_specs * sizeof(float));
-            }
-        }
-    }
-
-    return 0;
-}
-
-
-static void at1_subband_synthesis(AT1Ctx *q, AT1SUCtx* su, float *pOut)
-{
-    float temp[256];
-    float iqmf_temp[512 + 46];
-
-    /* combine low and middle bands */
-    ff_atrac_iqmf(q->bands[0], q->bands[1], 128, temp, su->fst_qmf_delay, iqmf_temp);
-
-    /* delay the signal of the high band by 23 samples */
-    memcpy( su->last_qmf_delay,    &su->last_qmf_delay[256], sizeof(float) *  23);
-    memcpy(&su->last_qmf_delay[23], q->bands[2],             sizeof(float) * 256);
-
-    /* combine (low + middle) and high bands */
-    ff_atrac_iqmf(temp, su->last_qmf_delay, 256, pOut, su->snd_qmf_delay, iqmf_temp);
-}
-
-
-static int atrac1_decode_frame(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    AT1Ctx *q          = avctx->priv_data;
-    int ch, ret;
-    GetBitContext gb;
-
-
-    if (buf_size < 212 * avctx->channels) {
-        av_log(avctx, AV_LOG_ERROR, "Not enough data to decode!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = AT1_SU_SAMPLES;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    for (ch = 0; ch < avctx->channels; ch++) {
-        AT1SUCtx* su = &q->SUs[ch];
-
-        init_get_bits(&gb, &buf[212 * ch], 212 * 8);
-
-        /* parse block_size_mode, 1st byte */
-        ret = at1_parse_bsm(&gb, su->log2_block_count);
-        if (ret < 0)
-            return ret;
-
-        ret = at1_unpack_dequant(&gb, su, q->spec);
-        if (ret < 0)
-            return ret;
-
-        ret = at1_imdct_block(su, q);
-        if (ret < 0)
-            return ret;
-        at1_subband_synthesis(q, su, (float *)frame->extended_data[ch]);
-    }
-
-    *got_frame_ptr = 1;
-
-    return avctx->block_align;
-}
-
-
-static av_cold int atrac1_decode_end(AVCodecContext * avctx)
-{
-    AT1Ctx *q = avctx->priv_data;
-
-    ff_mdct_end(&q->mdct_ctx[0]);
-    ff_mdct_end(&q->mdct_ctx[1]);
-    ff_mdct_end(&q->mdct_ctx[2]);
-
-    return 0;
-}
-
-
-static av_cold int atrac1_decode_init(AVCodecContext *avctx)
-{
-    AT1Ctx *q = avctx->priv_data;
-    int ret;
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    if (avctx->channels < 1 || avctx->channels > AT1_MAX_CHANNELS) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n",
-               avctx->channels);
-        return AVERROR(EINVAL);
-    }
-
-    /* Init the mdct transforms */
-    if ((ret = ff_mdct_init(&q->mdct_ctx[0], 6, 1, -1.0/ (1 << 15))) ||
-        (ret = ff_mdct_init(&q->mdct_ctx[1], 8, 1, -1.0/ (1 << 15))) ||
-        (ret = ff_mdct_init(&q->mdct_ctx[2], 9, 1, -1.0/ (1 << 15)))) {
-        av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n");
-        atrac1_decode_end(avctx);
-        return ret;
-    }
-
-    ff_init_ff_sine_windows(5);
-
-    ff_atrac_generate_tables();
-
-    avpriv_float_dsp_init(&q->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    q->bands[0] = q->low;
-    q->bands[1] = q->mid;
-    q->bands[2] = q->high;
-
-    /* Prepare the mdct overlap buffers */
-    q->SUs[0].spectrum[0] = q->SUs[0].spec1;
-    q->SUs[0].spectrum[1] = q->SUs[0].spec2;
-    q->SUs[1].spectrum[0] = q->SUs[1].spec1;
-    q->SUs[1].spectrum[1] = q->SUs[1].spec2;
-
-    return 0;
-}
-
-
-AVCodec ff_atrac1_decoder = {
-    .name           = "atrac1",
-    .long_name      = NULL_IF_CONFIG_SMALL("ATRAC1 (Adaptive TRansform Acoustic Coding)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ATRAC1,
-    .priv_data_size = sizeof(AT1Ctx),
-    .init           = atrac1_decode_init,
-    .close          = atrac1_decode_end,
-    .decode         = atrac1_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/atrac1data.h b/deps/libav/libavcodec/atrac1data.h
deleted file mode 100644
index d4b8cd0..0000000
--- a/deps/libav/libavcodec/atrac1data.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * ATRAC 1 compatible decoder data
- * Copyright (c) 2009 Maxim Poliakovski
- * Copyright (c) 2009 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ATRAC1 compatible decoder data
- */
-
-#ifndef AVCODEC_ATRAC1DATA_H
-#define AVCODEC_ATRAC1DATA_H
-
-#include <stdint.h>
-
-static const uint8_t bfu_amount_tab1[8] = {20,  28,  32,  36, 40, 44, 48, 52};
-static const uint8_t bfu_amount_tab2[4] = { 0, 112, 176, 208};
-static const uint8_t bfu_amount_tab3[8] = { 0,  24,  36,  48, 72, 108, 132, 156};
-
-/** number of BFUs in each QMF band */
-static const uint8_t bfu_bands_t[4]  = {0, 20, 36, 52};
-
-/** number of spectral lines in each BFU
- *  block floating unit = group of spectral frequencies having the
- *  same quantization parameters like word length and scale factor
- */
-static const uint8_t specs_per_bfu[52] = {
-     8,  8,  8,  8,  4,  4,  4,  4,  8,  8,  8,  8,  6,  6,  6,  6, 6, 6, 6, 6, // low band
-     6,  6,  6,  6,  7,  7,  7,  7,  9,  9,  9,  9, 10, 10, 10, 10,             // midle band
-    12, 12, 12, 12, 12, 12, 12, 12, 20, 20, 20, 20, 20, 20, 20, 20              // high band
-};
-
-/** start position of each BFU in the MDCT spectrum for the long mode */
-static const uint16_t bfu_start_long[52] = {
-      0,   8,  16,  24,  32,  36,  40,  44,  48,  56,  64,  72,  80,  86,  92,  98, 104, 110, 116, 122,
-    128, 134, 140, 146, 152, 159, 166, 173, 180, 189, 198, 207, 216, 226, 236, 246,
-    256, 268, 280, 292, 304, 316, 328, 340, 352, 372, 392, 412, 432, 452, 472, 492,
-};
-
-/** start position of each BFU in the MDCT spectrum for the short mode */
-static const uint16_t bfu_start_short[52] = {
-      0,  32,  64,  96,   8,  40,  72, 104,  12,  44,  76, 108,  20,  52,  84, 116, 26, 58, 90, 122,
-    128, 160, 192, 224, 134, 166, 198, 230, 141, 173, 205, 237, 150, 182, 214, 246,
-    256, 288, 320, 352, 384, 416, 448, 480, 268, 300, 332, 364, 396, 428, 460, 492
-};
-
-#endif /* AVCODEC_ATRAC1DATA_H */
diff --git a/deps/libav/libavcodec/atrac3.c b/deps/libav/libavcodec/atrac3.c
deleted file mode 100644
index 76fd0d1..0000000
--- a/deps/libav/libavcodec/atrac3.c
+++ /dev/null
@@ -1,937 +0,0 @@
-/*
- * ATRAC3 compatible decoder
- * Copyright (c) 2006-2008 Maxim Poliakovski
- * Copyright (c) 2006-2008 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ATRAC3 compatible decoder.
- * This decoder handles Sony's ATRAC3 data.
- *
- * Container formats used to store ATRAC3 data:
- * RealMedia (.rm), RIFF WAV (.wav, .at3), Sony OpenMG (.oma, .aa3).
- *
- * To use this decoder, a calling application must supply the extradata
- * bytes provided in the containers above.
- */
-
-#include <math.h>
-#include <stddef.h>
-#include <stdio.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "fft.h"
-#include "fmtconvert.h"
-#include "get_bits.h"
-#include "internal.h"
-
-#include "atrac.h"
-#include "atrac3data.h"
-
-#define JOINT_STEREO    0x12
-#define STEREO          0x2
-
-#define SAMPLES_PER_FRAME 1024
-#define MDCT_SIZE          512
-
-typedef struct GainBlock {
-    AtracGainInfo g_block[4];
-} GainBlock;
-
-typedef struct TonalComponent {
-    int pos;
-    int num_coefs;
-    float coef[8];
-} TonalComponent;
-
-typedef struct ChannelUnit {
-    int            bands_coded;
-    int            num_components;
-    float          prev_frame[SAMPLES_PER_FRAME];
-    int            gc_blk_switch;
-    TonalComponent components[64];
-    GainBlock      gain_block[2];
-
-    DECLARE_ALIGNED(32, float, spectrum)[SAMPLES_PER_FRAME];
-    DECLARE_ALIGNED(32, float, imdct_buf)[SAMPLES_PER_FRAME];
-
-    float          delay_buf1[46]; ///<qmf delay buffers
-    float          delay_buf2[46];
-    float          delay_buf3[46];
-} ChannelUnit;
-
-typedef struct ATRAC3Context {
-    GetBitContext gb;
-    //@{
-    /** stream data */
-    int coding_mode;
-
-    ChannelUnit *units;
-    //@}
-    //@{
-    /** joint-stereo related variables */
-    int matrix_coeff_index_prev[4];
-    int matrix_coeff_index_now[4];
-    int matrix_coeff_index_next[4];
-    int weighting_delay[6];
-    //@}
-    //@{
-    /** data buffers */
-    uint8_t *decoded_bytes_buffer;
-    float temp_buf[1070];
-    //@}
-    //@{
-    /** extradata */
-    int scrambled_stream;
-    //@}
-
-    AtracGCContext  gainc_ctx;
-    FFTContext mdct_ctx;
-    FmtConvertContext fmt_conv;
-    AVFloatDSPContext fdsp;
-} ATRAC3Context;
-
-static DECLARE_ALIGNED(32, float, mdct_window)[MDCT_SIZE];
-static VLC_TYPE atrac3_vlc_table[4096][2];
-static VLC   spectral_coeff_tab[7];
-
-/**
- * Regular 512 points IMDCT without overlapping, with the exception of the
- * swapping of odd bands caused by the reverse spectra of the QMF.
- *
- * @param odd_band  1 if the band is an odd band
- */
-static void imlt(ATRAC3Context *q, float *input, float *output, int odd_band)
-{
-    int i;
-
-    if (odd_band) {
-        /**
-         * Reverse the odd bands before IMDCT, this is an effect of the QMF
-         * transform or it gives better compression to do it this way.
-         * FIXME: It should be possible to handle this in imdct_calc
-         * for that to happen a modification of the prerotation step of
-         * all SIMD code and C code is needed.
-         * Or fix the functions before so they generate a pre reversed spectrum.
-         */
-        for (i = 0; i < 128; i++)
-            FFSWAP(float, input[i], input[255 - i]);
-    }
-
-    q->mdct_ctx.imdct_calc(&q->mdct_ctx, output, input);
-
-    /* Perform windowing on the output. */
-    q->fdsp.vector_fmul(output, output, mdct_window, MDCT_SIZE);
-}
-
-/*
- * indata descrambling, only used for data coming from the rm container
- */
-static int decode_bytes(const uint8_t *input, uint8_t *out, int bytes)
-{
-    int i, off;
-    uint32_t c;
-    const uint32_t *buf;
-    uint32_t *output = (uint32_t *)out;
-
-    off = (intptr_t)input & 3;
-    buf = (const uint32_t *)(input - off);
-    if (off)
-        c = av_be2ne32((0x537F6103U >> (off * 8)) | (0x537F6103U << (32 - (off * 8))));
-    else
-        c = av_be2ne32(0x537F6103U);
-    bytes += 3 + off;
-    for (i = 0; i < bytes / 4; i++)
-        output[i] = c ^ buf[i];
-
-    if (off)
-        avpriv_request_sample(NULL, "Offset of %d", off);
-
-    return off;
-}
-
-static av_cold void init_imdct_window(void)
-{
-    int i, j;
-
-    /* generate the mdct window, for details see
-     * http://wiki.multimedia.cx/index.php?title=RealAudio_atrc#Windows */
-    for (i = 0, j = 255; i < 128; i++, j--) {
-        float wi = sin(((i + 0.5) / 256.0 - 0.5) * M_PI) + 1.0;
-        float wj = sin(((j + 0.5) / 256.0 - 0.5) * M_PI) + 1.0;
-        float w  = 0.5 * (wi * wi + wj * wj);
-        mdct_window[i] = mdct_window[511 - i] = wi / w;
-        mdct_window[j] = mdct_window[511 - j] = wj / w;
-    }
-}
-
-static av_cold int atrac3_decode_close(AVCodecContext *avctx)
-{
-    ATRAC3Context *q = avctx->priv_data;
-
-    av_free(q->units);
-    av_free(q->decoded_bytes_buffer);
-
-    ff_mdct_end(&q->mdct_ctx);
-
-    return 0;
-}
-
-/**
- * Mantissa decoding
- *
- * @param selector     which table the output values are coded with
- * @param coding_flag  constant length coding or variable length coding
- * @param mantissas    mantissa output table
- * @param num_codes    number of values to get
- */
-static void read_quant_spectral_coeffs(GetBitContext *gb, int selector,
-                                       int coding_flag, int *mantissas,
-                                       int num_codes)
-{
-    int i, code, huff_symb;
-
-    if (selector == 1)
-        num_codes /= 2;
-
-    if (coding_flag != 0) {
-        /* constant length coding (CLC) */
-        int num_bits = clc_length_tab[selector];
-
-        if (selector > 1) {
-            for (i = 0; i < num_codes; i++) {
-                if (num_bits)
-                    code = get_sbits(gb, num_bits);
-                else
-                    code = 0;
-                mantissas[i] = code;
-            }
-        } else {
-            for (i = 0; i < num_codes; i++) {
-                if (num_bits)
-                    code = get_bits(gb, num_bits); // num_bits is always 4 in this case
-                else
-                    code = 0;
-                mantissas[i * 2    ] = mantissa_clc_tab[code >> 2];
-                mantissas[i * 2 + 1] = mantissa_clc_tab[code &  3];
-            }
-        }
-    } else {
-        /* variable length coding (VLC) */
-        if (selector != 1) {
-            for (i = 0; i < num_codes; i++) {
-                huff_symb = get_vlc2(gb, spectral_coeff_tab[selector-1].table,
-                                     spectral_coeff_tab[selector-1].bits, 3);
-                huff_symb += 1;
-                code = huff_symb >> 1;
-                if (huff_symb & 1)
-                    code = -code;
-                mantissas[i] = code;
-            }
-        } else {
-            for (i = 0; i < num_codes; i++) {
-                huff_symb = get_vlc2(gb, spectral_coeff_tab[selector - 1].table,
-                                     spectral_coeff_tab[selector - 1].bits, 3);
-                mantissas[i * 2    ] = mantissa_vlc_tab[huff_symb * 2    ];
-                mantissas[i * 2 + 1] = mantissa_vlc_tab[huff_symb * 2 + 1];
-            }
-        }
-    }
-}
-
-/**
- * Restore the quantized band spectrum coefficients
- *
- * @return subband count, fix for broken specification/files
- */
-static int decode_spectrum(GetBitContext *gb, float *output)
-{
-    int num_subbands, coding_mode, i, j, first, last, subband_size;
-    int subband_vlc_index[32], sf_index[32];
-    int mantissas[128];
-    float scale_factor;
-
-    num_subbands = get_bits(gb, 5);  // number of coded subbands
-    coding_mode  = get_bits1(gb);    // coding Mode: 0 - VLC/ 1-CLC
-
-    /* get the VLC selector table for the subbands, 0 means not coded */
-    for (i = 0; i <= num_subbands; i++)
-        subband_vlc_index[i] = get_bits(gb, 3);
-
-    /* read the scale factor indexes from the stream */
-    for (i = 0; i <= num_subbands; i++) {
-        if (subband_vlc_index[i] != 0)
-            sf_index[i] = get_bits(gb, 6);
-    }
-
-    for (i = 0; i <= num_subbands; i++) {
-        first = subband_tab[i    ];
-        last  = subband_tab[i + 1];
-
-        subband_size = last - first;
-
-        if (subband_vlc_index[i] != 0) {
-            /* decode spectral coefficients for this subband */
-            /* TODO: This can be done faster is several blocks share the
-             * same VLC selector (subband_vlc_index) */
-            read_quant_spectral_coeffs(gb, subband_vlc_index[i], coding_mode,
-                                       mantissas, subband_size);
-
-            /* decode the scale factor for this subband */
-            scale_factor = ff_atrac_sf_table[sf_index[i]] *
-                           inv_max_quant[subband_vlc_index[i]];
-
-            /* inverse quantize the coefficients */
-            for (j = 0; first < last; first++, j++)
-                output[first] = mantissas[j] * scale_factor;
-        } else {
-            /* this subband was not coded, so zero the entire subband */
-            memset(output + first, 0, subband_size * sizeof(*output));
-        }
-    }
-
-    /* clear the subbands that were not coded */
-    first = subband_tab[i];
-    memset(output + first, 0, (SAMPLES_PER_FRAME - first) * sizeof(*output));
-    return num_subbands;
-}
-
-/**
- * Restore the quantized tonal components
- *
- * @param components tonal components
- * @param num_bands  number of coded bands
- */
-static int decode_tonal_components(GetBitContext *gb,
-                                   TonalComponent *components, int num_bands)
-{
-    int i, b, c, m;
-    int nb_components, coding_mode_selector, coding_mode;
-    int band_flags[4], mantissa[8];
-    int component_count = 0;
-
-    nb_components = get_bits(gb, 5);
-
-    /* no tonal components */
-    if (nb_components == 0)
-        return 0;
-
-    coding_mode_selector = get_bits(gb, 2);
-    if (coding_mode_selector == 2)
-        return AVERROR_INVALIDDATA;
-
-    coding_mode = coding_mode_selector & 1;
-
-    for (i = 0; i < nb_components; i++) {
-        int coded_values_per_component, quant_step_index;
-
-        for (b = 0; b <= num_bands; b++)
-            band_flags[b] = get_bits1(gb);
-
-        coded_values_per_component = get_bits(gb, 3);
-
-        quant_step_index = get_bits(gb, 3);
-        if (quant_step_index <= 1)
-            return AVERROR_INVALIDDATA;
-
-        if (coding_mode_selector == 3)
-            coding_mode = get_bits1(gb);
-
-        for (b = 0; b < (num_bands + 1) * 4; b++) {
-            int coded_components;
-
-            if (band_flags[b >> 2] == 0)
-                continue;
-
-            coded_components = get_bits(gb, 3);
-
-            for (c = 0; c < coded_components; c++) {
-                TonalComponent *cmp = &components[component_count];
-                int sf_index, coded_values, max_coded_values;
-                float scale_factor;
-
-                sf_index = get_bits(gb, 6);
-                if (component_count >= 64)
-                    return AVERROR_INVALIDDATA;
-
-                cmp->pos = b * 64 + get_bits(gb, 6);
-
-                max_coded_values = SAMPLES_PER_FRAME - cmp->pos;
-                coded_values     = coded_values_per_component + 1;
-                coded_values     = FFMIN(max_coded_values, coded_values);
-
-                scale_factor = ff_atrac_sf_table[sf_index] *
-                               inv_max_quant[quant_step_index];
-
-                read_quant_spectral_coeffs(gb, quant_step_index, coding_mode,
-                                           mantissa, coded_values);
-
-                cmp->num_coefs = coded_values;
-
-                /* inverse quant */
-                for (m = 0; m < coded_values; m++)
-                    cmp->coef[m] = mantissa[m] * scale_factor;
-
-                component_count++;
-            }
-        }
-    }
-
-    return component_count;
-}
-
-/**
- * Decode gain parameters for the coded bands
- *
- * @param block      the gainblock for the current band
- * @param num_bands  amount of coded bands
- */
-static int decode_gain_control(GetBitContext *gb, GainBlock *block,
-                               int num_bands)
-{
-    int i, j;
-    int *level, *loc;
-
-    AtracGainInfo *gain = block->g_block;
-
-    for (i = 0; i <= num_bands; i++) {
-        gain[i].num_points    = get_bits(gb, 3);
-        level                 = gain[i].lev_code;
-        loc                   = gain[i].loc_code;
-
-        for (j = 0; j < gain[i].num_points; j++) {
-            level[j] = get_bits(gb, 4);
-            loc[j]   = get_bits(gb, 5);
-            if (j && loc[j] <= loc[j - 1])
-                return AVERROR_INVALIDDATA;
-        }
-    }
-
-    /* Clear the unused blocks. */
-    for (; i < 4 ; i++)
-        gain[i].num_points = 0;
-
-    return 0;
-}
-
-/**
- * Combine the tonal band spectrum and regular band spectrum
- *
- * @param spectrum        output spectrum buffer
- * @param num_components  number of tonal components
- * @param components      tonal components for this band
- * @return                position of the last tonal coefficient
- */
-static int add_tonal_components(float *spectrum, int num_components,
-                                TonalComponent *components)
-{
-    int i, j, last_pos = -1;
-    float *input, *output;
-
-    for (i = 0; i < num_components; i++) {
-        last_pos = FFMAX(components[i].pos + components[i].num_coefs, last_pos);
-        input    = components[i].coef;
-        output   = &spectrum[components[i].pos];
-
-        for (j = 0; j < components[i].num_coefs; j++)
-            output[j] += input[j];
-    }
-
-    return last_pos;
-}
-
-#define INTERPOLATE(old, new, nsample) \
-    ((old) + (nsample) * 0.125 * ((new) - (old)))
-
-static void reverse_matrixing(float *su1, float *su2, int *prev_code,
-                              int *curr_code)
-{
-    int i, nsample, band;
-    float mc1_l, mc1_r, mc2_l, mc2_r;
-
-    for (i = 0, band = 0; band < 4 * 256; band += 256, i++) {
-        int s1 = prev_code[i];
-        int s2 = curr_code[i];
-        nsample = band;
-
-        if (s1 != s2) {
-            /* Selector value changed, interpolation needed. */
-            mc1_l = matrix_coeffs[s1 * 2    ];
-            mc1_r = matrix_coeffs[s1 * 2 + 1];
-            mc2_l = matrix_coeffs[s2 * 2    ];
-            mc2_r = matrix_coeffs[s2 * 2 + 1];
-
-            /* Interpolation is done over the first eight samples. */
-            for (; nsample < band + 8; nsample++) {
-                float c1 = su1[nsample];
-                float c2 = su2[nsample];
-                c2 = c1 * INTERPOLATE(mc1_l, mc2_l, nsample - band) +
-                     c2 * INTERPOLATE(mc1_r, mc2_r, nsample - band);
-                su1[nsample] = c2;
-                su2[nsample] = c1 * 2.0 - c2;
-            }
-        }
-
-        /* Apply the matrix without interpolation. */
-        switch (s2) {
-        case 0:     /* M/S decoding */
-            for (; nsample < band + 256; nsample++) {
-                float c1 = su1[nsample];
-                float c2 = su2[nsample];
-                su1[nsample] =  c2       * 2.0;
-                su2[nsample] = (c1 - c2) * 2.0;
-            }
-            break;
-        case 1:
-            for (; nsample < band + 256; nsample++) {
-                float c1 = su1[nsample];
-                float c2 = su2[nsample];
-                su1[nsample] = (c1 + c2) *  2.0;
-                su2[nsample] =  c2       * -2.0;
-            }
-            break;
-        case 2:
-        case 3:
-            for (; nsample < band + 256; nsample++) {
-                float c1 = su1[nsample];
-                float c2 = su2[nsample];
-                su1[nsample] = c1 + c2;
-                su2[nsample] = c1 - c2;
-            }
-            break;
-        default:
-            assert(0);
-        }
-    }
-}
-
-static void get_channel_weights(int index, int flag, float ch[2])
-{
-    if (index == 7) {
-        ch[0] = 1.0;
-        ch[1] = 1.0;
-    } else {
-        ch[0] = (index & 7) / 7.0;
-        ch[1] = sqrt(2 - ch[0] * ch[0]);
-        if (flag)
-            FFSWAP(float, ch[0], ch[1]);
-    }
-}
-
-static void channel_weighting(float *su1, float *su2, int *p3)
-{
-    int band, nsample;
-    /* w[x][y] y=0 is left y=1 is right */
-    float w[2][2];
-
-    if (p3[1] != 7 || p3[3] != 7) {
-        get_channel_weights(p3[1], p3[0], w[0]);
-        get_channel_weights(p3[3], p3[2], w[1]);
-
-        for (band = 256; band < 4 * 256; band += 256) {
-            for (nsample = band; nsample < band + 8; nsample++) {
-                su1[nsample] *= INTERPOLATE(w[0][0], w[0][1], nsample - band);
-                su2[nsample] *= INTERPOLATE(w[1][0], w[1][1], nsample - band);
-            }
-            for(; nsample < band + 256; nsample++) {
-                su1[nsample] *= w[1][0];
-                su2[nsample] *= w[1][1];
-            }
-        }
-    }
-}
-
-/**
- * Decode a Sound Unit
- *
- * @param snd           the channel unit to be used
- * @param output        the decoded samples before IQMF in float representation
- * @param channel_num   channel number
- * @param coding_mode   the coding mode (JOINT_STEREO or regular stereo/mono)
- */
-static int decode_channel_sound_unit(ATRAC3Context *q, GetBitContext *gb,
-                                     ChannelUnit *snd, float *output,
-                                     int channel_num, int coding_mode)
-{
-    int band, ret, num_subbands, last_tonal, num_bands;
-    GainBlock *gain1 = &snd->gain_block[    snd->gc_blk_switch];
-    GainBlock *gain2 = &snd->gain_block[1 - snd->gc_blk_switch];
-
-    if (coding_mode == JOINT_STEREO && channel_num == 1) {
-        if (get_bits(gb, 2) != 3) {
-            av_log(NULL,AV_LOG_ERROR,"JS mono Sound Unit id != 3.\n");
-            return AVERROR_INVALIDDATA;
-        }
-    } else {
-        if (get_bits(gb, 6) != 0x28) {
-            av_log(NULL,AV_LOG_ERROR,"Sound Unit id != 0x28.\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    /* number of coded QMF bands */
-    snd->bands_coded = get_bits(gb, 2);
-
-    ret = decode_gain_control(gb, gain2, snd->bands_coded);
-    if (ret)
-        return ret;
-
-    snd->num_components = decode_tonal_components(gb, snd->components,
-                                                  snd->bands_coded);
-    if (snd->num_components < 0)
-        return snd->num_components;
-
-    num_subbands = decode_spectrum(gb, snd->spectrum);
-
-    /* Merge the decoded spectrum and tonal components. */
-    last_tonal = add_tonal_components(snd->spectrum, snd->num_components,
-                                      snd->components);
-
-
-    /* calculate number of used MLT/QMF bands according to the amount of coded
-       spectral lines */
-    num_bands = (subband_tab[num_subbands] - 1) >> 8;
-    if (last_tonal >= 0)
-        num_bands = FFMAX((last_tonal + 256) >> 8, num_bands);
-
-
-    /* Reconstruct time domain samples. */
-    for (band = 0; band < 4; band++) {
-        /* Perform the IMDCT step without overlapping. */
-        if (band <= num_bands)
-            imlt(q, &snd->spectrum[band * 256], snd->imdct_buf, band & 1);
-        else
-            memset(snd->imdct_buf, 0, 512 * sizeof(*snd->imdct_buf));
-
-        /* gain compensation and overlapping */
-        ff_atrac_gain_compensation(&q->gainc_ctx, snd->imdct_buf,
-                                   &snd->prev_frame[band * 256],
-                                   &gain1->g_block[band], &gain2->g_block[band],
-                                   256, &output[band * 256]);
-    }
-
-    /* Swap the gain control buffers for the next frame. */
-    snd->gc_blk_switch ^= 1;
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, const uint8_t *databuf,
-                        float **out_samples)
-{
-    ATRAC3Context *q = avctx->priv_data;
-    int ret, i;
-    uint8_t *ptr1;
-
-    if (q->coding_mode == JOINT_STEREO) {
-        /* channel coupling mode */
-        /* decode Sound Unit 1 */
-        init_get_bits(&q->gb, databuf, avctx->block_align * 8);
-
-        ret = decode_channel_sound_unit(q, &q->gb, q->units, out_samples[0], 0,
-                                        JOINT_STEREO);
-        if (ret != 0)
-            return ret;
-
-        /* Framedata of the su2 in the joint-stereo mode is encoded in
-         * reverse byte order so we need to swap it first. */
-        if (databuf == q->decoded_bytes_buffer) {
-            uint8_t *ptr2 = q->decoded_bytes_buffer + avctx->block_align - 1;
-            ptr1          = q->decoded_bytes_buffer;
-            for (i = 0; i < avctx->block_align / 2; i++, ptr1++, ptr2--)
-                FFSWAP(uint8_t, *ptr1, *ptr2);
-        } else {
-            const uint8_t *ptr2 = databuf + avctx->block_align - 1;
-            for (i = 0; i < avctx->block_align; i++)
-                q->decoded_bytes_buffer[i] = *ptr2--;
-        }
-
-        /* Skip the sync codes (0xF8). */
-        ptr1 = q->decoded_bytes_buffer;
-        for (i = 4; *ptr1 == 0xF8; i++, ptr1++) {
-            if (i >= avctx->block_align)
-                return AVERROR_INVALIDDATA;
-        }
-
-
-        /* set the bitstream reader at the start of the second Sound Unit*/
-        init_get_bits(&q->gb, ptr1, (avctx->block_align - i) * 8);
-
-        /* Fill the Weighting coeffs delay buffer */
-        memmove(q->weighting_delay, &q->weighting_delay[2],
-                4 * sizeof(*q->weighting_delay));
-        q->weighting_delay[4] = get_bits1(&q->gb);
-        q->weighting_delay[5] = get_bits(&q->gb, 3);
-
-        for (i = 0; i < 4; i++) {
-            q->matrix_coeff_index_prev[i] = q->matrix_coeff_index_now[i];
-            q->matrix_coeff_index_now[i]  = q->matrix_coeff_index_next[i];
-            q->matrix_coeff_index_next[i] = get_bits(&q->gb, 2);
-        }
-
-        /* Decode Sound Unit 2. */
-        ret = decode_channel_sound_unit(q, &q->gb, &q->units[1],
-                                        out_samples[1], 1, JOINT_STEREO);
-        if (ret != 0)
-            return ret;
-
-        /* Reconstruct the channel coefficients. */
-        reverse_matrixing(out_samples[0], out_samples[1],
-                          q->matrix_coeff_index_prev,
-                          q->matrix_coeff_index_now);
-
-        channel_weighting(out_samples[0], out_samples[1], q->weighting_delay);
-    } else {
-        /* normal stereo mode or mono */
-        /* Decode the channel sound units. */
-        for (i = 0; i < avctx->channels; i++) {
-            /* Set the bitstream reader at the start of a channel sound unit. */
-            init_get_bits(&q->gb,
-                          databuf + i * avctx->block_align / avctx->channels,
-                          avctx->block_align * 8 / avctx->channels);
-
-            ret = decode_channel_sound_unit(q, &q->gb, &q->units[i],
-                                            out_samples[i], i, q->coding_mode);
-            if (ret != 0)
-                return ret;
-        }
-    }
-
-    /* Apply the iQMF synthesis filter. */
-    for (i = 0; i < avctx->channels; i++) {
-        float *p1 = out_samples[i];
-        float *p2 = p1 + 256;
-        float *p3 = p2 + 256;
-        float *p4 = p3 + 256;
-        ff_atrac_iqmf(p1, p2, 256, p1, q->units[i].delay_buf1, q->temp_buf);
-        ff_atrac_iqmf(p4, p3, 256, p3, q->units[i].delay_buf2, q->temp_buf);
-        ff_atrac_iqmf(p1, p3, 512, p1, q->units[i].delay_buf3, q->temp_buf);
-    }
-
-    return 0;
-}
-
-static int atrac3_decode_frame(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    ATRAC3Context *q = avctx->priv_data;
-    int ret;
-    const uint8_t *databuf;
-
-    if (buf_size < avctx->block_align) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Frame too small (%d bytes). Truncated file?\n", buf_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = SAMPLES_PER_FRAME;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    /* Check if we need to descramble and what buffer to pass on. */
-    if (q->scrambled_stream) {
-        decode_bytes(buf, q->decoded_bytes_buffer, avctx->block_align);
-        databuf = q->decoded_bytes_buffer;
-    } else {
-        databuf = buf;
-    }
-
-    ret = decode_frame(avctx, databuf, (float **)frame->extended_data);
-    if (ret) {
-        av_log(NULL, AV_LOG_ERROR, "Frame decoding error!\n");
-        return ret;
-    }
-
-    *got_frame_ptr = 1;
-
-    return avctx->block_align;
-}
-
-static av_cold void atrac3_init_static_data(AVCodec *codec)
-{
-    int i;
-
-    init_imdct_window();
-    ff_atrac_generate_tables();
-
-    /* Initialize the VLC tables. */
-    for (i = 0; i < 7; i++) {
-        spectral_coeff_tab[i].table = &atrac3_vlc_table[atrac3_vlc_offs[i]];
-        spectral_coeff_tab[i].table_allocated = atrac3_vlc_offs[i + 1] -
-                                                atrac3_vlc_offs[i    ];
-        init_vlc(&spectral_coeff_tab[i], 9, huff_tab_sizes[i],
-                 huff_bits[i],  1, 1,
-                 huff_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-    }
-}
-
-static av_cold int atrac3_decode_init(AVCodecContext *avctx)
-{
-    int i, ret;
-    int version, delay, samples_per_frame, frame_factor;
-    const uint8_t *edata_ptr = avctx->extradata;
-    ATRAC3Context *q = avctx->priv_data;
-
-    if (avctx->channels <= 0 || avctx->channels > 2) {
-        av_log(avctx, AV_LOG_ERROR, "Channel configuration error!\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* Take care of the codec-specific extradata. */
-    if (avctx->extradata_size == 14) {
-        /* Parse the extradata, WAV format */
-        av_log(avctx, AV_LOG_DEBUG, "[0-1] %d\n",
-               bytestream_get_le16(&edata_ptr));  // Unknown value always 1
-        edata_ptr += 4;                             // samples per channel
-        q->coding_mode = bytestream_get_le16(&edata_ptr);
-        av_log(avctx, AV_LOG_DEBUG,"[8-9] %d\n",
-               bytestream_get_le16(&edata_ptr));  //Dupe of coding mode
-        frame_factor = bytestream_get_le16(&edata_ptr);  // Unknown always 1
-        av_log(avctx, AV_LOG_DEBUG,"[12-13] %d\n",
-               bytestream_get_le16(&edata_ptr));  // Unknown always 0
-
-        /* setup */
-        samples_per_frame    = SAMPLES_PER_FRAME * avctx->channels;
-        version              = 4;
-        delay                = 0x88E;
-        q->coding_mode       = q->coding_mode ? JOINT_STEREO : STEREO;
-        q->scrambled_stream  = 0;
-
-        if (avctx->block_align !=  96 * avctx->channels * frame_factor &&
-            avctx->block_align != 152 * avctx->channels * frame_factor &&
-            avctx->block_align != 192 * avctx->channels * frame_factor) {
-            av_log(avctx, AV_LOG_ERROR, "Unknown frame/channel/frame_factor "
-                   "configuration %d/%d/%d\n", avctx->block_align,
-                   avctx->channels, frame_factor);
-            return AVERROR_INVALIDDATA;
-        }
-    } else if (avctx->extradata_size == 10) {
-        /* Parse the extradata, RM format. */
-        version                = bytestream_get_be32(&edata_ptr);
-        samples_per_frame      = bytestream_get_be16(&edata_ptr);
-        delay                  = bytestream_get_be16(&edata_ptr);
-        q->coding_mode         = bytestream_get_be16(&edata_ptr);
-        q->scrambled_stream    = 1;
-
-    } else {
-        av_log(NULL, AV_LOG_ERROR, "Unknown extradata size %d.\n",
-               avctx->extradata_size);
-        return AVERROR(EINVAL);
-    }
-
-    /* Check the extradata */
-
-    if (version != 4) {
-        av_log(avctx, AV_LOG_ERROR, "Version %d != 4.\n", version);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (samples_per_frame != SAMPLES_PER_FRAME &&
-        samples_per_frame != SAMPLES_PER_FRAME * 2) {
-        av_log(avctx, AV_LOG_ERROR, "Unknown amount of samples per frame %d.\n",
-               samples_per_frame);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (delay != 0x88E) {
-        av_log(avctx, AV_LOG_ERROR, "Unknown amount of delay %x != 0x88E.\n",
-               delay);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (q->coding_mode == STEREO)
-        av_log(avctx, AV_LOG_DEBUG, "Normal stereo detected.\n");
-    else if (q->coding_mode == JOINT_STEREO) {
-        if (avctx->channels != 2)
-            return AVERROR_INVALIDDATA;
-        av_log(avctx, AV_LOG_DEBUG, "Joint stereo detected.\n");
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "Unknown channel coding mode %x!\n",
-               q->coding_mode);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avctx->block_align >= UINT_MAX / 2)
-        return AVERROR(EINVAL);
-
-    q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +
-                                         FF_INPUT_BUFFER_PADDING_SIZE);
-    if (q->decoded_bytes_buffer == NULL)
-        return AVERROR(ENOMEM);
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    /* initialize the MDCT transform */
-    if ((ret = ff_mdct_init(&q->mdct_ctx, 9, 1, 1.0 / 32768)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n");
-        av_freep(&q->decoded_bytes_buffer);
-        return ret;
-    }
-
-    /* init the joint-stereo decoding data */
-    q->weighting_delay[0] = 0;
-    q->weighting_delay[1] = 7;
-    q->weighting_delay[2] = 0;
-    q->weighting_delay[3] = 7;
-    q->weighting_delay[4] = 0;
-    q->weighting_delay[5] = 7;
-
-    for (i = 0; i < 4; i++) {
-        q->matrix_coeff_index_prev[i] = 3;
-        q->matrix_coeff_index_now[i]  = 3;
-        q->matrix_coeff_index_next[i] = 3;
-    }
-
-    ff_atrac_init_gain_compensation(&q->gainc_ctx, 4, 3);
-    avpriv_float_dsp_init(&q->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-    ff_fmt_convert_init(&q->fmt_conv, avctx);
-
-    q->units = av_mallocz(sizeof(*q->units) * avctx->channels);
-    if (!q->units) {
-        atrac3_decode_close(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-AVCodec ff_atrac3_decoder = {
-    .name             = "atrac3",
-    .long_name        = NULL_IF_CONFIG_SMALL("ATRAC3 (Adaptive TRansform Acoustic Coding 3)"),
-    .type             = AVMEDIA_TYPE_AUDIO,
-    .id               = AV_CODEC_ID_ATRAC3,
-    .priv_data_size   = sizeof(ATRAC3Context),
-    .init             = atrac3_decode_init,
-    .init_static_data = atrac3_init_static_data,
-    .close            = atrac3_decode_close,
-    .decode           = atrac3_decode_frame,
-    .capabilities     = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
-    .sample_fmts      = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                        AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/atrac3data.h b/deps/libav/libavcodec/atrac3data.h
deleted file mode 100644
index 4f5c122..0000000
--- a/deps/libav/libavcodec/atrac3data.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * ATRAC3 compatible decoder data
- * Copyright (c) 2006-2007 Maxim Poliakovski
- * Copyright (c) 2006-2007 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ATRAC3 AKA RealAudio 8 compatible decoder data
- */
-
-#ifndef AVCODEC_ATRAC3DATA_H
-#define AVCODEC_ATRAC3DATA_H
-
-#include <stdint.h>
-
-/* VLC tables */
-
-static const uint8_t huffcode1[9] = {
-    0x0, 0x4, 0x5, 0xC, 0xD, 0x1C, 0x1D, 0x1E, 0x1F
-};
-
-static const uint8_t huffbits1[9] = { 1, 3, 3, 4, 4, 5, 5, 5, 5 };
-
-static const uint8_t huffcode2[5] = { 0x0, 0x4, 0x5, 0x6, 0x7 };
-
-static const uint8_t huffbits2[5] = { 1, 3, 3, 3, 3 };
-
-static const uint8_t huffcode3[7] = { 0x0, 0x4, 0x5, 0xC, 0xD, 0xE, 0xF };
-
-static const uint8_t huffbits3[7] = { 1, 3, 3, 4, 4, 4, 4 };
-
-static const uint8_t huffcode4[9] = {
-    0x0, 0x4, 0x5, 0xC, 0xD, 0x1C, 0x1D, 0x1E, 0x1F
-};
-
-static const uint8_t huffbits4[9] = { 1, 3, 3, 4, 4, 5, 5, 5, 5 };
-
-static const uint8_t huffcode5[15] = {
-    0x00, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B, 0x1C,
-    0x1D, 0x3C, 0x3D, 0x3E, 0x3F, 0x0C, 0x0D
-};
-
-static const uint8_t huffbits5[15] = {
-    2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 4, 4
-};
-
-static const uint8_t huffcode6[31] = {
-    0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x14,
-    0x15, 0x16, 0x17, 0x18, 0x19, 0x34, 0x35, 0x36,
-    0x37, 0x38, 0x39, 0x3A, 0x3B, 0x78, 0x79, 0x7A,
-    0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x08, 0x09
-};
-
-static const uint8_t huffbits6[31] = {
-    3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6,
-    6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 4, 4
-};
-
-static const uint8_t huffcode7[63] = {
-    0x00, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
-    0x0F, 0x10, 0x11, 0x24, 0x25, 0x26, 0x27, 0x28,
-    0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,
-    0x31, 0x32, 0x33, 0x68, 0x69, 0x6A, 0x6B, 0x6C,
-    0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74,
-    0x75, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2,
-    0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA,
-    0xFB, 0xFC, 0xFD, 0xFE, 0xFF, 0x02, 0x03
-};
-
-static const uint8_t huffbits7[63] = {
-    3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6,
-    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7,
-    7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4
-};
-
-static const uint8_t huff_tab_sizes[7] = {
-    9, 5, 7, 9, 15, 31, 63,
-};
-
-static const uint8_t* const huff_codes[7] = {
-    huffcode1, huffcode2, huffcode3, huffcode4, huffcode5, huffcode6, huffcode7
-};
-
-static const uint8_t* const huff_bits[7] = {
-    huffbits1, huffbits2, huffbits3, huffbits4, huffbits5, huffbits6, huffbits7,
-};
-
-static const uint16_t atrac3_vlc_offs[9] = {
-    0, 512, 1024, 1536, 2048, 2560, 3072, 3584, 4096
-};
-
-/* selector tables */
-
-static const uint8_t clc_length_tab[8] = { 0, 4, 3, 3, 4, 4, 5, 6 };
-
-static const int8_t mantissa_clc_tab[4] = { 0, 1, -2, -1 };
-
-static const int8_t mantissa_vlc_tab[18] = {
-    0, 0,  0, 1,  0, -1,  1, 0,  -1, 0,  1, 1,  1, -1,  -1, 1,  -1, -1
-};
-
-
-/* tables for the scalefactor decoding */
-
-static const float inv_max_quant[8] = {
-      0.0,       1.0 / 1.5, 1.0 /  2.5, 1.0 /  3.5,
-      1.0 / 4.5, 1.0 / 7.5, 1.0 / 15.5, 1.0 / 31.5
-};
-
-static const uint16_t subband_tab[33] = {
-      0,   8,  16,  24,  32,  40,  48,  56,
-     64,  80,  96, 112, 128, 144, 160, 176,
-    192, 224, 256, 288, 320, 352, 384, 416,
-    448, 480, 512, 576, 640, 704, 768, 896,
-    1024
-};
-
-/* joint stereo related tables */
-static const float matrix_coeffs[8] = {
-    0.0, 2.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0
-};
-
-#endif /* AVCODEC_ATRAC3DATA_H */
diff --git a/deps/libav/libavcodec/atrac3plus.c b/deps/libav/libavcodec/atrac3plus.c
deleted file mode 100644
index f337fab..0000000
--- a/deps/libav/libavcodec/atrac3plus.c
+++ /dev/null
@@ -1,1818 +0,0 @@
-/*
- * ATRAC3+ compatible decoder
- *
- * Copyright (c) 2010-2013 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Bitstream parser for ATRAC3+ decoder.
- */
-
-#include "libavutil/avassert.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "atrac3plus.h"
-#include "atrac3plus_data.h"
-
-static VLC_TYPE tables_data[154276][2];
-static VLC wl_vlc_tabs[4];
-static VLC sf_vlc_tabs[8];
-static VLC ct_vlc_tabs[4];
-static VLC spec_vlc_tabs[112];
-static VLC gain_vlc_tabs[11];
-static VLC tone_vlc_tabs[7];
-
-#define GET_DELTA(gb, delta_bits) \
-    ((delta_bits) ? get_bits((gb), (delta_bits)) : 0)
-
-/**
- * Generate canonical VLC table from given descriptor.
- *
- * @param[in]     cb          ptr to codebook descriptor
- * @param[in]     xlat        ptr to translation table or NULL
- * @param[in,out] tab_offset  starting offset to the generated vlc table
- * @param[out]    out_vlc     ptr to vlc table to be generated
- */
-static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t *xlat,
-                                         int *tab_offset, VLC *out_vlc)
-{
-    int i, b;
-    uint16_t codes[256];
-    uint8_t bits[256];
-    unsigned code = 0;
-    int index = 0;
-    int min_len = *cb++; // get shortest codeword length
-    int max_len = *cb++; // get longest  codeword length
-
-    for (b = min_len; b <= max_len; b++) {
-        for (i = *cb++; i > 0; i--) {
-            av_assert0(index < 256);
-            bits[index]  = b;
-            codes[index] = code++;
-            index++;
-        }
-        code <<= 1;
-    }
-
-    out_vlc->table = &tables_data[*tab_offset];
-    out_vlc->table_allocated = 1 << max_len;
-
-    ff_init_vlc_sparse(out_vlc, max_len, index, bits, 1, 1, codes, 2, 2,
-                       xlat, 1, 1, INIT_VLC_USE_NEW_STATIC);
-
-    *tab_offset += 1 << max_len;
-}
-
-av_cold void ff_atrac3p_init_vlcs(AVCodec *codec)
-{
-    int i, wl_vlc_offs, ct_vlc_offs, sf_vlc_offs, tab_offset;
-
-    static int wl_nb_bits[4]  = { 2, 3, 5, 5 };
-    static int wl_nb_codes[4] = { 3, 5, 8, 8 };
-    static const uint8_t *wl_bits[4] = {
-        atrac3p_wl_huff_bits1, atrac3p_wl_huff_bits2,
-        atrac3p_wl_huff_bits3, atrac3p_wl_huff_bits4
-    };
-    static const uint8_t *wl_codes[4] = {
-        atrac3p_wl_huff_code1, atrac3p_wl_huff_code2,
-        atrac3p_wl_huff_code3, atrac3p_wl_huff_code4
-    };
-    static const uint8_t *wl_xlats[4] = {
-        atrac3p_wl_huff_xlat1, atrac3p_wl_huff_xlat2, NULL, NULL
-    };
-
-    static int ct_nb_bits[4]  = { 3, 4, 4, 4 };
-    static int ct_nb_codes[4] = { 4, 8, 8, 8 };
-    static const uint8_t *ct_bits[4]  = {
-        atrac3p_ct_huff_bits1, atrac3p_ct_huff_bits2,
-        atrac3p_ct_huff_bits2, atrac3p_ct_huff_bits3
-    };
-    static const uint8_t *ct_codes[4] = {
-        atrac3p_ct_huff_code1, atrac3p_ct_huff_code2,
-        atrac3p_ct_huff_code2, atrac3p_ct_huff_code3
-    };
-    static const uint8_t *ct_xlats[4] = {
-        NULL, NULL, atrac3p_ct_huff_xlat1, NULL
-    };
-
-    static int sf_nb_bits[8]  = {  9,  9,  9,  9,  6,  6,  7,  7 };
-    static int sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 };
-    static const uint8_t  *sf_bits[8]  = {
-        atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits2,
-        atrac3p_sf_huff_bits3, atrac3p_sf_huff_bits4, atrac3p_sf_huff_bits4,
-        atrac3p_sf_huff_bits5, atrac3p_sf_huff_bits6
-    };
-    static const uint16_t *sf_codes[8] = {
-        atrac3p_sf_huff_code1, atrac3p_sf_huff_code1, atrac3p_sf_huff_code2,
-        atrac3p_sf_huff_code3, atrac3p_sf_huff_code4, atrac3p_sf_huff_code4,
-        atrac3p_sf_huff_code5, atrac3p_sf_huff_code6
-    };
-    static const uint8_t  *sf_xlats[8] = {
-        atrac3p_sf_huff_xlat1, atrac3p_sf_huff_xlat2, NULL, NULL,
-        atrac3p_sf_huff_xlat4, atrac3p_sf_huff_xlat5, NULL, NULL
-    };
-
-    static const uint8_t *gain_cbs[11] = {
-        atrac3p_huff_gain_npoints1_cb, atrac3p_huff_gain_npoints1_cb,
-        atrac3p_huff_gain_lev1_cb, atrac3p_huff_gain_lev2_cb,
-        atrac3p_huff_gain_lev3_cb, atrac3p_huff_gain_lev4_cb,
-        atrac3p_huff_gain_loc3_cb, atrac3p_huff_gain_loc1_cb,
-        atrac3p_huff_gain_loc4_cb, atrac3p_huff_gain_loc2_cb,
-        atrac3p_huff_gain_loc5_cb
-    };
-    static const uint8_t *gain_xlats[11] = {
-        NULL, atrac3p_huff_gain_npoints2_xlat, atrac3p_huff_gain_lev1_xlat,
-        atrac3p_huff_gain_lev2_xlat, atrac3p_huff_gain_lev3_xlat,
-        atrac3p_huff_gain_lev4_xlat, atrac3p_huff_gain_loc3_xlat,
-        atrac3p_huff_gain_loc1_xlat, atrac3p_huff_gain_loc4_xlat,
-        atrac3p_huff_gain_loc2_xlat, atrac3p_huff_gain_loc5_xlat
-    };
-
-    static const uint8_t *tone_cbs[7] = {
-        atrac3p_huff_tonebands_cb,  atrac3p_huff_numwavs1_cb,
-        atrac3p_huff_numwavs2_cb,   atrac3p_huff_wav_ampsf1_cb,
-        atrac3p_huff_wav_ampsf2_cb, atrac3p_huff_wav_ampsf3_cb,
-        atrac3p_huff_freq_cb
-    };
-    static const uint8_t *tone_xlats[7] = {
-        NULL, NULL, atrac3p_huff_numwavs2_xlat, atrac3p_huff_wav_ampsf1_xlat,
-        atrac3p_huff_wav_ampsf2_xlat, atrac3p_huff_wav_ampsf3_xlat,
-        atrac3p_huff_freq_xlat
-    };
-
-    for (i = 0, wl_vlc_offs = 0, ct_vlc_offs = 2508; i < 4; i++) {
-        wl_vlc_tabs[i].table = &tables_data[wl_vlc_offs];
-        wl_vlc_tabs[i].table_allocated = 1 << wl_nb_bits[i];
-        ct_vlc_tabs[i].table = &tables_data[ct_vlc_offs];
-        ct_vlc_tabs[i].table_allocated = 1 << ct_nb_bits[i];
-
-        ff_init_vlc_sparse(&wl_vlc_tabs[i], wl_nb_bits[i], wl_nb_codes[i],
-                           wl_bits[i],  1, 1,
-                           wl_codes[i], 1, 1,
-                           wl_xlats[i], 1, 1,
-                           INIT_VLC_USE_NEW_STATIC);
-
-        ff_init_vlc_sparse(&ct_vlc_tabs[i], ct_nb_bits[i], ct_nb_codes[i],
-                           ct_bits[i],  1, 1,
-                           ct_codes[i], 1, 1,
-                           ct_xlats[i], 1, 1,
-                           INIT_VLC_USE_NEW_STATIC);
-
-        wl_vlc_offs += wl_vlc_tabs[i].table_allocated;
-        ct_vlc_offs += ct_vlc_tabs[i].table_allocated;
-    }
-
-    for (i = 0, sf_vlc_offs = 76; i < 8; i++) {
-        sf_vlc_tabs[i].table = &tables_data[sf_vlc_offs];
-        sf_vlc_tabs[i].table_allocated = 1 << sf_nb_bits[i];
-
-        ff_init_vlc_sparse(&sf_vlc_tabs[i], sf_nb_bits[i], sf_nb_codes[i],
-                           sf_bits[i],  1, 1,
-                           sf_codes[i], 2, 2,
-                           sf_xlats[i], 1, 1,
-                           INIT_VLC_USE_NEW_STATIC);
-        sf_vlc_offs += sf_vlc_tabs[i].table_allocated;
-    }
-
-    tab_offset = 2564;
-
-    /* build huffman tables for spectrum decoding */
-    for (i = 0; i < 112; i++) {
-        if (atrac3p_spectra_tabs[i].cb)
-            build_canonical_huff(atrac3p_spectra_tabs[i].cb,
-                                 atrac3p_spectra_tabs[i].xlat,
-                                 &tab_offset, &spec_vlc_tabs[i]);
-        else
-            spec_vlc_tabs[i].table = 0;
-    }
-
-    /* build huffman tables for gain data decoding */
-    for (i = 0; i < 11; i++)
-        build_canonical_huff(gain_cbs[i], gain_xlats[i], &tab_offset, &gain_vlc_tabs[i]);
-
-    /* build huffman tables for tone decoding */
-    for (i = 0; i < 7; i++)
-        build_canonical_huff(tone_cbs[i], tone_xlats[i], &tab_offset, &tone_vlc_tabs[i]);
-}
-
-/**
- * Decode number of coded quantization units.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] chan          ptr to the channel parameters
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int num_coded_units(GetBitContext *gb, Atrac3pChanParams *chan,
-                           Atrac3pChanUnitCtx *ctx, AVCodecContext *avctx)
-{
-    chan->fill_mode = get_bits(gb, 2);
-    if (!chan->fill_mode) {
-        chan->num_coded_vals = ctx->num_quant_units;
-    } else {
-        chan->num_coded_vals = get_bits(gb, 5);
-        if (chan->num_coded_vals > ctx->num_quant_units) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid number of transmitted units!\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (chan->fill_mode == 3)
-            chan->split_point = get_bits(gb, 2) + (chan->ch_num << 1) + 1;
-    }
-
-    return 0;
-}
-
-/**
- * Add weighting coefficients to the decoded word-length information.
- *
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in,out] chan          ptr to the channel parameters
- * @param[in]     wtab_idx      index of the table of weights
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int add_wordlen_weights(Atrac3pChanUnitCtx *ctx,
-                               Atrac3pChanParams *chan, int wtab_idx,
-                               AVCodecContext *avctx)
-{
-    int i;
-    const int8_t *weights_tab =
-        &atrac3p_wl_weights[chan->ch_num * 3 + wtab_idx - 1][0];
-
-    for (i = 0; i < ctx->num_quant_units; i++) {
-        chan->qu_wordlen[i] += weights_tab[i];
-        if (chan->qu_wordlen[i] < 0 || chan->qu_wordlen[i] > 7) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "WL index out of range: pos=%d, val=%d!\n",
-                   i, chan->qu_wordlen[i]);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Subtract weighting coefficients from decoded scalefactors.
- *
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in,out] chan          ptr to the channel parameters
- * @param[in]     wtab_idx      index of table of weights
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int subtract_sf_weights(Atrac3pChanUnitCtx *ctx,
-                               Atrac3pChanParams *chan, int wtab_idx,
-                               AVCodecContext *avctx)
-{
-    int i;
-    const int8_t *weights_tab = &atrac3p_sf_weights[wtab_idx - 1][0];
-
-    for (i = 0; i < ctx->used_quant_units; i++) {
-        chan->qu_sf_idx[i] -= weights_tab[i];
-        if (chan->qu_sf_idx[i] < 0 || chan->qu_sf_idx[i] > 63) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "SF index out of range: pos=%d, val=%d!\n",
-                   i, chan->qu_sf_idx[i]);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Unpack vector quantization tables.
- *
- * @param[in]    start_val    start value for the unpacked table
- * @param[in]    shape_vec    ptr to table to unpack
- * @param[out]   dst          ptr to output array
- * @param[in]    num_values   number of values to unpack
- */
-static inline void unpack_vq_shape(int start_val, const int8_t *shape_vec,
-                                   int *dst, int num_values)
-{
-    int i;
-
-    if (num_values) {
-        dst[0] = dst[1] = dst[2] = start_val;
-        for (i = 3; i < num_values; i++)
-            dst[i] = start_val - shape_vec[atrac3p_qu_num_to_seg[i] - 1];
-    }
-}
-
-#define UNPACK_SF_VQ_SHAPE(gb, dst, num_vals)                            \
-    start_val = get_bits((gb), 6);                                       \
-    unpack_vq_shape(start_val, &atrac3p_sf_shapes[get_bits((gb), 6)][0], \
-                    (dst), (num_vals))
-
-/**
- * Decode word length for each quantization unit of a channel.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     ch_num        channel to process
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_channel_wordlen(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                  int ch_num, AVCodecContext *avctx)
-{
-    int i, weight_idx = 0, delta, diff, pos, delta_bits, min_val, flag,
-        ret, start_val;
-    VLC *vlc_tab;
-    Atrac3pChanParams *chan     = &ctx->channels[ch_num];
-    Atrac3pChanParams *ref_chan = &ctx->channels[0];
-
-    chan->fill_mode = 0;
-
-    switch (get_bits(gb, 2)) { /* switch according to coding mode */
-    case 0: /* coded using constant number of bits */
-        for (i = 0; i < ctx->num_quant_units; i++)
-            chan->qu_wordlen[i] = get_bits(gb, 3);
-        break;
-    case 1:
-        if (ch_num) {
-            if ((ret = num_coded_units(gb, chan, ctx, avctx)) < 0)
-                return ret;
-
-            if (chan->num_coded_vals) {
-                vlc_tab = &wl_vlc_tabs[get_bits(gb, 2)];
-
-                for (i = 0; i < chan->num_coded_vals; i++) {
-                    delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-                    chan->qu_wordlen[i] = (ref_chan->qu_wordlen[i] + delta) & 7;
-                }
-            }
-        } else {
-            weight_idx = get_bits(gb, 2);
-            if ((ret = num_coded_units(gb, chan, ctx, avctx)) < 0)
-                return ret;
-
-            if (chan->num_coded_vals) {
-                pos = get_bits(gb, 5);
-                if (pos > chan->num_coded_vals) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "WL mode 1: invalid position!\n");
-                    return AVERROR_INVALIDDATA;
-                }
-
-                delta_bits = get_bits(gb, 2);
-                min_val    = get_bits(gb, 3);
-
-                for (i = 0; i < pos; i++)
-                    chan->qu_wordlen[i] = get_bits(gb, 3);
-
-                for (i = pos; i < chan->num_coded_vals; i++)
-                    chan->qu_wordlen[i] = (min_val + GET_DELTA(gb, delta_bits)) & 7;
-            }
-        }
-        break;
-    case 2:
-        if ((ret = num_coded_units(gb, chan, ctx, avctx)) < 0)
-            return ret;
-
-        if (ch_num && chan->num_coded_vals) {
-            vlc_tab = &wl_vlc_tabs[get_bits(gb, 2)];
-            delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-            chan->qu_wordlen[0] = (ref_chan->qu_wordlen[0] + delta) & 7;
-
-            for (i = 1; i < chan->num_coded_vals; i++) {
-                diff = ref_chan->qu_wordlen[i] - ref_chan->qu_wordlen[i - 1];
-                delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-                chan->qu_wordlen[i] = (chan->qu_wordlen[i - 1] + diff + delta) & 7;
-            }
-        } else if (chan->num_coded_vals) {
-            flag    = get_bits(gb, 1);
-            vlc_tab = &wl_vlc_tabs[get_bits(gb, 1)];
-
-            start_val = get_bits(gb, 3);
-            unpack_vq_shape(start_val,
-                            &atrac3p_wl_shapes[start_val][get_bits(gb, 4)][0],
-                            chan->qu_wordlen, chan->num_coded_vals);
-
-            if (!flag) {
-                for (i = 0; i < chan->num_coded_vals; i++) {
-                    delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-                    chan->qu_wordlen[i] = (chan->qu_wordlen[i] + delta) & 7;
-                }
-            } else {
-                for (i = 0; i < (chan->num_coded_vals & - 2); i += 2)
-                    if (!get_bits1(gb)) {
-                        chan->qu_wordlen[i]     = (chan->qu_wordlen[i] +
-                                                   get_vlc2(gb, vlc_tab->table,
-                                                            vlc_tab->bits, 1)) & 7;
-                        chan->qu_wordlen[i + 1] = (chan->qu_wordlen[i + 1] +
-                                                   get_vlc2(gb, vlc_tab->table,
-                                                            vlc_tab->bits, 1)) & 7;
-                    }
-
-                if (chan->num_coded_vals & 1)
-                    chan->qu_wordlen[i] = (chan->qu_wordlen[i] +
-                                           get_vlc2(gb, vlc_tab->table,
-                                                    vlc_tab->bits, 1)) & 7;
-            }
-        }
-        break;
-    case 3:
-        weight_idx = get_bits(gb, 2);
-        if ((ret = num_coded_units(gb, chan, ctx, avctx)) < 0)
-            return ret;
-
-        if (chan->num_coded_vals) {
-            vlc_tab = &wl_vlc_tabs[get_bits(gb, 2)];
-
-            /* first coefficient is coded directly */
-            chan->qu_wordlen[0] = get_bits(gb, 3);
-
-            for (i = 1; i < chan->num_coded_vals; i++) {
-                delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-                chan->qu_wordlen[i] = (chan->qu_wordlen[i - 1] + delta) & 7;
-            }
-        }
-        break;
-    }
-
-    if (chan->fill_mode == 2) {
-        for (i = chan->num_coded_vals; i < ctx->num_quant_units; i++)
-            chan->qu_wordlen[i] = ch_num ? get_bits1(gb) : 1;
-    } else if (chan->fill_mode == 3) {
-        pos = ch_num ? chan->num_coded_vals + chan->split_point
-                     : ctx->num_quant_units - chan->split_point;
-        for (i = chan->num_coded_vals; i < pos; i++)
-            chan->qu_wordlen[i] = 1;
-    }
-
-    if (weight_idx)
-        return add_wordlen_weights(ctx, chan, weight_idx, avctx);
-
-    return 0;
-}
-
-/**
- * Decode scale factor indexes for each quant unit of a channel.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     ch_num        channel to process
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_channel_sf_idx(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                 int ch_num, AVCodecContext *avctx)
-{
-    int i, weight_idx = 0, delta, diff, num_long_vals,
-        delta_bits, min_val, vlc_sel, start_val;
-    VLC *vlc_tab;
-    Atrac3pChanParams *chan     = &ctx->channels[ch_num];
-    Atrac3pChanParams *ref_chan = &ctx->channels[0];
-
-    switch (get_bits(gb, 2)) { /* switch according to coding mode */
-    case 0: /* coded using constant number of bits */
-        for (i = 0; i < ctx->used_quant_units; i++)
-            chan->qu_sf_idx[i] = get_bits(gb, 6);
-        break;
-    case 1:
-        if (ch_num) {
-            vlc_tab = &sf_vlc_tabs[get_bits(gb, 2)];
-
-            for (i = 0; i < ctx->used_quant_units; i++) {
-                delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-                chan->qu_sf_idx[i] = (ref_chan->qu_sf_idx[i] + delta) & 0x3F;
-            }
-        } else {
-            weight_idx = get_bits(gb, 2);
-            if (weight_idx == 3) {
-                UNPACK_SF_VQ_SHAPE(gb, chan->qu_sf_idx, ctx->used_quant_units);
-
-                num_long_vals = get_bits(gb, 5);
-                delta_bits    = get_bits(gb, 2);
-                min_val       = get_bits(gb, 4) - 7;
-
-                for (i = 0; i < num_long_vals; i++)
-                    chan->qu_sf_idx[i] = (chan->qu_sf_idx[i] +
-                                          get_bits(gb, 4) - 7) & 0x3F;
-
-                /* all others are: min_val + delta */
-                for (i = num_long_vals; i < ctx->used_quant_units; i++)
-                    chan->qu_sf_idx[i] = (chan->qu_sf_idx[i] + min_val +
-                                          GET_DELTA(gb, delta_bits)) & 0x3F;
-            } else {
-                num_long_vals = get_bits(gb, 5);
-                delta_bits    = get_bits(gb, 3);
-                min_val       = get_bits(gb, 6);
-                if (num_long_vals > ctx->used_quant_units || delta_bits == 7) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "SF mode 1: invalid parameters!\n");
-                    return AVERROR_INVALIDDATA;
-                }
-
-                /* read full-precision SF indexes */
-                for (i = 0; i < num_long_vals; i++)
-                    chan->qu_sf_idx[i] = get_bits(gb, 6);
-
-                /* all others are: min_val + delta */
-                for (i = num_long_vals; i < ctx->used_quant_units; i++)
-                    chan->qu_sf_idx[i] = (min_val +
-                                          GET_DELTA(gb, delta_bits)) & 0x3F;
-            }
-        }
-        break;
-    case 2:
-        if (ch_num) {
-            vlc_tab = &sf_vlc_tabs[get_bits(gb, 2)];
-
-            delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-            chan->qu_sf_idx[0] = (ref_chan->qu_sf_idx[0] + delta) & 0x3F;
-
-            for (i = 1; i < ctx->used_quant_units; i++) {
-                diff  = ref_chan->qu_sf_idx[i] - ref_chan->qu_sf_idx[i - 1];
-                delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-                chan->qu_sf_idx[i] = (chan->qu_sf_idx[i - 1] + diff + delta) & 0x3F;
-            }
-        } else {
-            vlc_tab = &sf_vlc_tabs[get_bits(gb, 2) + 4];
-
-            UNPACK_SF_VQ_SHAPE(gb, chan->qu_sf_idx, ctx->used_quant_units);
-
-            for (i = 0; i < ctx->used_quant_units; i++) {
-                delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-                chan->qu_sf_idx[i] = (chan->qu_sf_idx[i] +
-                                      sign_extend(delta, 4)) & 0x3F;
-            }
-        }
-        break;
-    case 3:
-        if (ch_num) {
-            /* copy coefficients from reference channel */
-            for (i = 0; i < ctx->used_quant_units; i++)
-                chan->qu_sf_idx[i] = ref_chan->qu_sf_idx[i];
-        } else {
-            weight_idx = get_bits(gb, 2);
-            vlc_sel    = get_bits(gb, 2);
-            vlc_tab    = &sf_vlc_tabs[vlc_sel];
-
-            if (weight_idx == 3) {
-                vlc_tab = &sf_vlc_tabs[vlc_sel + 4];
-
-                UNPACK_SF_VQ_SHAPE(gb, chan->qu_sf_idx, ctx->used_quant_units);
-
-                diff               = (get_bits(gb, 4)    + 56)   & 0x3F;
-                chan->qu_sf_idx[0] = (chan->qu_sf_idx[0] + diff) & 0x3F;
-
-                for (i = 1; i < ctx->used_quant_units; i++) {
-                    delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-                    diff               = (diff + sign_extend(delta, 4)) & 0x3F;
-                    chan->qu_sf_idx[i] = (diff + chan->qu_sf_idx[i])    & 0x3F;
-                }
-            } else {
-                /* 1st coefficient is coded directly */
-                chan->qu_sf_idx[0] = get_bits(gb, 6);
-
-                for (i = 1; i < ctx->used_quant_units; i++) {
-                    delta = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-                    chan->qu_sf_idx[i] = (chan->qu_sf_idx[i - 1] + delta) & 0x3F;
-                }
-            }
-        }
-        break;
-    }
-
-    if (weight_idx && weight_idx < 3)
-        return subtract_sf_weights(ctx, chan, weight_idx, avctx);
-
-    return 0;
-}
-
-/**
- * Decode word length information for each channel.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     num_channels  number of channels to process
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_quant_wordlen(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                int num_channels, AVCodecContext *avctx)
-{
-    int ch_num, i, ret;
-
-    for (ch_num = 0; ch_num < num_channels; ch_num++) {
-        memset(ctx->channels[ch_num].qu_wordlen, 0,
-               sizeof(ctx->channels[ch_num].qu_wordlen));
-
-        if ((ret = decode_channel_wordlen(gb, ctx, ch_num, avctx)) < 0)
-            return ret;
-    }
-
-    /* scan for last non-zero coeff in both channels and
-     * set number of quant units having coded spectrum */
-    for (i = ctx->num_quant_units - 1; i >= 0; i--)
-        if (ctx->channels[0].qu_wordlen[i] ||
-            (num_channels == 2 && ctx->channels[1].qu_wordlen[i]))
-            break;
-    ctx->used_quant_units = i + 1;
-
-    return 0;
-}
-
-/**
- * Decode scale factor indexes for each channel.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     num_channels  number of channels to process
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_scale_factors(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                int num_channels, AVCodecContext *avctx)
-{
-    int ch_num, ret;
-
-    if (!ctx->used_quant_units)
-        return 0;
-
-    for (ch_num = 0; ch_num < num_channels; ch_num++) {
-        memset(ctx->channels[ch_num].qu_sf_idx, 0,
-               sizeof(ctx->channels[ch_num].qu_sf_idx));
-
-        if ((ret = decode_channel_sf_idx(gb, ctx, ch_num, avctx)) < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-/**
- * Decode number of code table values.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int get_num_ct_values(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                             AVCodecContext *avctx)
-{
-    int num_coded_vals;
-
-    if (get_bits1(gb)) {
-        num_coded_vals = get_bits(gb, 5);
-        if (num_coded_vals > ctx->used_quant_units) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid number of code table indexes: %d!\n", num_coded_vals);
-            return AVERROR_INVALIDDATA;
-        }
-        return num_coded_vals;
-    } else
-        return ctx->used_quant_units;
-}
-
-#define DEC_CT_IDX_COMMON(OP)                                           \
-    num_vals = get_num_ct_values(gb, ctx, avctx);                       \
-    if (num_vals < 0)                                                   \
-        return num_vals;                                                \
-                                                                        \
-    for (i = 0; i < num_vals; i++) {                                    \
-        if (chan->qu_wordlen[i]) {                                      \
-            chan->qu_tab_idx[i] = OP;                                   \
-        } else if (ch_num && ref_chan->qu_wordlen[i])                   \
-            /* get clone master flag */                                 \
-            chan->qu_tab_idx[i] = get_bits1(gb);                        \
-    }
-
-#define CODING_DIRECT get_bits(gb, num_bits)
-
-#define CODING_VLC get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1)
-
-#define CODING_VLC_DELTA                                                \
-    (!i) ? CODING_VLC                                                   \
-         : (pred + get_vlc2(gb, delta_vlc->table,                       \
-                            delta_vlc->bits, 1)) & mask;                \
-    pred = chan->qu_tab_idx[i]
-
-#define CODING_VLC_DIFF                                                 \
-    (ref_chan->qu_tab_idx[i] +                                          \
-     get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1)) & mask
-
-/**
- * Decode code table indexes for each quant unit of a channel.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     ch_num        channel to process
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_channel_code_tab(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                   int ch_num, AVCodecContext *avctx)
-{
-    int i, num_vals, num_bits, pred;
-    int mask = ctx->use_full_table ? 7 : 3; /* mask for modular arithmetic */
-    VLC *vlc_tab, *delta_vlc;
-    Atrac3pChanParams *chan     = &ctx->channels[ch_num];
-    Atrac3pChanParams *ref_chan = &ctx->channels[0];
-
-    chan->table_type = get_bits1(gb);
-
-    switch (get_bits(gb, 2)) { /* switch according to coding mode */
-    case 0: /* directly coded */
-        num_bits = ctx->use_full_table + 2;
-        DEC_CT_IDX_COMMON(CODING_DIRECT);
-        break;
-    case 1: /* entropy-coded */
-        vlc_tab = ctx->use_full_table ? &ct_vlc_tabs[1]
-                                      : ct_vlc_tabs;
-        DEC_CT_IDX_COMMON(CODING_VLC);
-        break;
-    case 2: /* entropy-coded delta */
-        if (ctx->use_full_table) {
-            vlc_tab   = &ct_vlc_tabs[1];
-            delta_vlc = &ct_vlc_tabs[2];
-        } else {
-            vlc_tab   = ct_vlc_tabs;
-            delta_vlc = ct_vlc_tabs;
-        }
-        pred = 0;
-        DEC_CT_IDX_COMMON(CODING_VLC_DELTA);
-        break;
-    case 3: /* entropy-coded difference to master */
-        if (ch_num) {
-            vlc_tab = ctx->use_full_table ? &ct_vlc_tabs[3]
-                                          : ct_vlc_tabs;
-            DEC_CT_IDX_COMMON(CODING_VLC_DIFF);
-        }
-        break;
-    }
-
-    return 0;
-}
-
-/**
- * Decode code table indexes for each channel.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     num_channels  number of channels to process
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_code_table_indexes(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                     int num_channels, AVCodecContext *avctx)
-{
-    int ch_num, ret;
-
-    if (!ctx->used_quant_units)
-        return 0;
-
-    ctx->use_full_table = get_bits1(gb);
-
-    for (ch_num = 0; ch_num < num_channels; ch_num++) {
-        memset(ctx->channels[ch_num].qu_tab_idx, 0,
-               sizeof(ctx->channels[ch_num].qu_tab_idx));
-
-        if ((ret = decode_channel_code_tab(gb, ctx, ch_num, avctx)) < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-/**
- * Decode huffman-coded spectral lines for a given quant unit.
- *
- * This is a generalized version for all known coding modes.
- * Its speed can be improved by creating separate functions for each mode.
- *
- * @param[in]   gb          the GetBit context
- * @param[in]   tab         code table telling how to decode spectral lines
- * @param[in]   vlc_tab     ptr to the huffman table associated with the code table
- * @param[out]  out         pointer to buffer where decoded data should be stored
- * @param[in]   num_specs   number of spectral lines to decode
- */
-static void decode_qu_spectra(GetBitContext *gb, const Atrac3pSpecCodeTab *tab,
-                              VLC *vlc_tab, int16_t *out, const int num_specs)
-{
-    int i, j, pos, cf;
-    int group_size = tab->group_size;
-    int num_coeffs = tab->num_coeffs;
-    int bits       = tab->bits;
-    int is_signed  = tab->is_signed;
-    unsigned val, mask = (1 << bits) - 1;
-
-    for (pos = 0; pos < num_specs;) {
-        if (group_size == 1 || get_bits1(gb)) {
-            for (j = 0; j < group_size; j++) {
-                val = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
-
-                for (i = 0; i < num_coeffs; i++) {
-                    cf = val & mask;
-                    if (is_signed)
-                        cf = sign_extend(cf, bits);
-                    else if (cf && get_bits1(gb))
-                        cf = -cf;
-
-                    out[pos++] = cf;
-                    val      >>= bits;
-                }
-            }
-        } else /* group skipped */
-            pos += group_size * num_coeffs;
-    }
-}
-
-/**
- * Decode huffman-coded IMDCT spectrum for all channels.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     num_channels  number of channels to process
- * @param[in]     avctx         ptr to the AVCodecContext
- */
-static void decode_spectrum(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                            int num_channels, AVCodecContext *avctx)
-{
-    int i, ch_num, qu, wordlen, codetab, tab_index, num_specs;
-    const Atrac3pSpecCodeTab *tab;
-    Atrac3pChanParams *chan;
-
-    for (ch_num = 0; ch_num < num_channels; ch_num++) {
-        chan = &ctx->channels[ch_num];
-
-        memset(chan->spectrum, 0, sizeof(chan->spectrum));
-
-        /* set power compensation level to disabled */
-        memset(chan->power_levs, ATRAC3P_POWER_COMP_OFF, sizeof(chan->power_levs));
-
-        for (qu = 0; qu < ctx->used_quant_units; qu++) {
-            num_specs = ff_atrac3p_qu_to_spec_pos[qu + 1] -
-                        ff_atrac3p_qu_to_spec_pos[qu];
-
-            wordlen = chan->qu_wordlen[qu];
-            codetab = chan->qu_tab_idx[qu];
-            if (wordlen) {
-                if (!ctx->use_full_table)
-                    codetab = atrac3p_ct_restricted_to_full[chan->table_type][wordlen - 1][codetab];
-
-                tab_index = (chan->table_type * 8 + codetab) * 7 + wordlen - 1;
-                tab       = &atrac3p_spectra_tabs[tab_index];
-
-                /* this allows reusing VLC tables */
-                if (tab->redirect >= 0)
-                    tab_index = tab->redirect;
-
-                decode_qu_spectra(gb, tab, &spec_vlc_tabs[tab_index],
-                                  &chan->spectrum[ff_atrac3p_qu_to_spec_pos[qu]],
-                                  num_specs);
-            } else if (ch_num && ctx->channels[0].qu_wordlen[qu] && !codetab) {
-                /* copy coefficients from master */
-                memcpy(&chan->spectrum[ff_atrac3p_qu_to_spec_pos[qu]],
-                       &ctx->channels[0].spectrum[ff_atrac3p_qu_to_spec_pos[qu]],
-                       num_specs *
-                       sizeof(chan->spectrum[ff_atrac3p_qu_to_spec_pos[qu]]));
-                chan->qu_wordlen[qu] = ctx->channels[0].qu_wordlen[qu];
-            }
-        }
-
-        /* Power compensation levels only present in the bitstream
-         * if there are more than 2 quant units. The lowest two units
-         * correspond to the frequencies 0...351 Hz, whose shouldn't
-         * be affected by the power compensation. */
-        if (ctx->used_quant_units > 2) {
-            num_specs = atrac3p_subband_to_num_powgrps[ctx->num_coded_subbands - 1];
-            for (i = 0; i < num_specs; i++)
-                chan->power_levs[i] = get_bits(gb, 4);
-        }
-    }
-}
-
-/**
- * Retrieve specified amount of flag bits from the input bitstream.
- * The data can be shortened in the case of the following two common conditions:
- * if all bits are zero then only one signal bit = 0 will be stored,
- * if all bits are ones then two signal bits = 1,0 will be stored.
- * Otherwise, all necessary bits will be directly stored
- * prefixed by two signal bits = 1,1.
- *
- * @param[in]   gb              ptr to the GetBitContext
- * @param[out]  out             where to place decoded flags
- * @param[in]   num_flags       number of flags to process
- * @return: 0 = all flag bits are zero, 1 = there is at least one non-zero flag bit
- */
-static int get_subband_flags(GetBitContext *gb, uint8_t *out, int num_flags)
-{
-    int i, result;
-
-    memset(out, 0, num_flags);
-
-    result = get_bits1(gb);
-    if (result) {
-        if (get_bits1(gb))
-            for (i = 0; i < num_flags; i++)
-                out[i] = get_bits1(gb);
-        else
-            memset(out, 1, num_flags);
-    }
-
-    return result;
-}
-
-/**
- * Decode mdct window shape flags for all channels.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     num_channels  number of channels to process
- */
-static void decode_window_shape(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                int num_channels)
-{
-    int ch_num;
-
-    for (ch_num = 0; ch_num < num_channels; ch_num++)
-        get_subband_flags(gb, ctx->channels[ch_num].wnd_shape,
-                          ctx->num_subbands);
-}
-
-/**
- * Decode number of gain control points.
- *
- * @param[in]     gb              the GetBit context
- * @param[in,out] ctx             ptr to the channel unit context
- * @param[in]     ch_num          channel to process
- * @param[in]     coded_subbands  number of subbands to process
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_gainc_npoints(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                int ch_num, int coded_subbands)
-{
-    int i, delta, delta_bits, min_val;
-    Atrac3pChanParams *chan     = &ctx->channels[ch_num];
-    Atrac3pChanParams *ref_chan = &ctx->channels[0];
-
-    switch (get_bits(gb, 2)) { /* switch according to coding mode */
-    case 0: /* fixed-length coding */
-        for (i = 0; i < coded_subbands; i++)
-            chan->gain_data[i].num_points = get_bits(gb, 3);
-        break;
-    case 1: /* variable-length coding */
-        for (i = 0; i < coded_subbands; i++)
-            chan->gain_data[i].num_points =
-                get_vlc2(gb, gain_vlc_tabs[0].table,
-                         gain_vlc_tabs[0].bits, 1);
-        break;
-    case 2:
-        if (ch_num) { /* VLC modulo delta to master channel */
-            for (i = 0; i < coded_subbands; i++) {
-                delta = get_vlc2(gb, gain_vlc_tabs[1].table,
-                                 gain_vlc_tabs[1].bits, 1);
-                chan->gain_data[i].num_points =
-                    (ref_chan->gain_data[i].num_points + delta) & 7;
-            }
-        } else { /* VLC modulo delta to previous */
-            chan->gain_data[0].num_points =
-                get_vlc2(gb, gain_vlc_tabs[0].table,
-                         gain_vlc_tabs[0].bits, 1);
-
-            for (i = 1; i < coded_subbands; i++) {
-                delta = get_vlc2(gb, gain_vlc_tabs[1].table,
-                                 gain_vlc_tabs[1].bits, 1);
-                chan->gain_data[i].num_points =
-                    (chan->gain_data[i - 1].num_points + delta) & 7;
-            }
-        }
-        break;
-    case 3:
-        if (ch_num) { /* copy data from master channel */
-            for (i = 0; i < coded_subbands; i++)
-                chan->gain_data[i].num_points =
-                    ref_chan->gain_data[i].num_points;
-        } else { /* shorter delta to min */
-            delta_bits = get_bits(gb, 2);
-            min_val    = get_bits(gb, 3);
-
-            for (i = 0; i < coded_subbands; i++) {
-                chan->gain_data[i].num_points = min_val + GET_DELTA(gb, delta_bits);
-                if (chan->gain_data[i].num_points > 7)
-                    return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Implements coding mode 3 (slave) for gain compensation levels.
- *
- * @param[out]   dst   ptr to the output array
- * @param[in]    ref   ptr to the reference channel
- */
-static inline void gainc_level_mode3s(AtracGainInfo *dst, AtracGainInfo *ref)
-{
-    int i;
-
-    for (i = 0; i < dst->num_points; i++)
-        dst->lev_code[i] = (i >= ref->num_points) ? 7 : ref->lev_code[i];
-}
-
-/**
- * Implements coding mode 1 (master) for gain compensation levels.
- *
- * @param[in]     gb     the GetBit context
- * @param[in]     ctx    ptr to the channel unit context
- * @param[out]    dst    ptr to the output array
- */
-static inline void gainc_level_mode1m(GetBitContext *gb,
-                                      Atrac3pChanUnitCtx *ctx,
-                                      AtracGainInfo *dst)
-{
-    int i, delta;
-
-    if (dst->num_points > 0)
-        dst->lev_code[0] = get_vlc2(gb, gain_vlc_tabs[2].table,
-                                    gain_vlc_tabs[2].bits, 1);
-
-    for (i = 1; i < dst->num_points; i++) {
-        delta = get_vlc2(gb, gain_vlc_tabs[3].table,
-                         gain_vlc_tabs[3].bits, 1);
-        dst->lev_code[i] = (dst->lev_code[i - 1] + delta) & 0xF;
-    }
-}
-
-/**
- * Decode level code for each gain control point.
- *
- * @param[in]     gb              the GetBit context
- * @param[in,out] ctx             ptr to the channel unit context
- * @param[in]     ch_num          channel to process
- * @param[in]     coded_subbands  number of subbands to process
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_gainc_levels(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                               int ch_num, int coded_subbands)
-{
-    int sb, i, delta, delta_bits, min_val, pred;
-    Atrac3pChanParams *chan     = &ctx->channels[ch_num];
-    Atrac3pChanParams *ref_chan = &ctx->channels[0];
-
-    switch (get_bits(gb, 2)) { /* switch according to coding mode */
-    case 0: /* fixed-length coding */
-        for (sb = 0; sb < coded_subbands; sb++)
-            for (i = 0; i < chan->gain_data[sb].num_points; i++)
-                chan->gain_data[sb].lev_code[i] = get_bits(gb, 4);
-        break;
-    case 1:
-        if (ch_num) { /* VLC modulo delta to master channel */
-            for (sb = 0; sb < coded_subbands; sb++)
-                for (i = 0; i < chan->gain_data[sb].num_points; i++) {
-                    delta = get_vlc2(gb, gain_vlc_tabs[5].table,
-                                     gain_vlc_tabs[5].bits, 1);
-                    pred = (i >= ref_chan->gain_data[sb].num_points)
-                           ? 7 : ref_chan->gain_data[sb].lev_code[i];
-                    chan->gain_data[sb].lev_code[i] = (pred + delta) & 0xF;
-                }
-        } else { /* VLC modulo delta to previous */
-            for (sb = 0; sb < coded_subbands; sb++)
-                gainc_level_mode1m(gb, ctx, &chan->gain_data[sb]);
-        }
-        break;
-    case 2:
-        if (ch_num) { /* VLC modulo delta to previous or clone master */
-            for (sb = 0; sb < coded_subbands; sb++)
-                if (chan->gain_data[sb].num_points > 0) {
-                    if (get_bits1(gb))
-                        gainc_level_mode1m(gb, ctx, &chan->gain_data[sb]);
-                    else
-                        gainc_level_mode3s(&chan->gain_data[sb],
-                                           &ref_chan->gain_data[sb]);
-                }
-        } else { /* VLC modulo delta to lev_codes of previous subband */
-            if (chan->gain_data[0].num_points > 0)
-                gainc_level_mode1m(gb, ctx, &chan->gain_data[0]);
-
-            for (sb = 1; sb < coded_subbands; sb++)
-                for (i = 0; i < chan->gain_data[sb].num_points; i++) {
-                    delta = get_vlc2(gb, gain_vlc_tabs[4].table,
-                                     gain_vlc_tabs[4].bits, 1);
-                    pred = (i >= chan->gain_data[sb - 1].num_points)
-                           ? 7 : chan->gain_data[sb - 1].lev_code[i];
-                    chan->gain_data[sb].lev_code[i] = (pred + delta) & 0xF;
-                }
-        }
-        break;
-    case 3:
-        if (ch_num) { /* clone master */
-            for (sb = 0; sb < coded_subbands; sb++)
-                gainc_level_mode3s(&chan->gain_data[sb],
-                                   &ref_chan->gain_data[sb]);
-        } else { /* shorter delta to min */
-            delta_bits = get_bits(gb, 2);
-            min_val    = get_bits(gb, 4);
-
-            for (sb = 0; sb < coded_subbands; sb++)
-                for (i = 0; i < chan->gain_data[sb].num_points; i++) {
-                    chan->gain_data[sb].lev_code[i] = min_val + GET_DELTA(gb, delta_bits);
-                    if (chan->gain_data[sb].lev_code[i] > 15)
-                        return AVERROR_INVALIDDATA;
-                }
-        }
-        break;
-    }
-
-    return 0;
-}
-
-/**
- * Implements coding mode 0 for gain compensation locations.
- *
- * @param[in]     gb     the GetBit context
- * @param[in]     ctx    ptr to the channel unit context
- * @param[out]    dst    ptr to the output array
- * @param[in]     pos    position of the value to be processed
- */
-static inline void gainc_loc_mode0(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                   AtracGainInfo *dst, int pos)
-{
-    int delta_bits;
-
-    if (!pos || dst->loc_code[pos - 1] < 15)
-        dst->loc_code[pos] = get_bits(gb, 5);
-    else if (dst->loc_code[pos - 1] >= 30)
-        dst->loc_code[pos] = 31;
-    else {
-        delta_bits         = av_log2(30 - dst->loc_code[pos - 1]) + 1;
-        dst->loc_code[pos] = dst->loc_code[pos - 1] +
-                             get_bits(gb, delta_bits) + 1;
-    }
-}
-
-/**
- * Implements coding mode 1 for gain compensation locations.
- *
- * @param[in]     gb     the GetBit context
- * @param[in]     ctx    ptr to the channel unit context
- * @param[out]    dst    ptr to the output array
- */
-static inline void gainc_loc_mode1(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                   AtracGainInfo *dst)
-{
-    int i;
-    VLC *tab;
-
-    if (dst->num_points > 0) {
-        /* 1st coefficient is stored directly */
-        dst->loc_code[0] = get_bits(gb, 5);
-
-        for (i = 1; i < dst->num_points; i++) {
-            /* switch VLC according to the curve direction
-             * (ascending/descending) */
-            tab              = (dst->lev_code[i] <= dst->lev_code[i - 1])
-                               ? &gain_vlc_tabs[7]
-                               : &gain_vlc_tabs[9];
-            dst->loc_code[i] = dst->loc_code[i - 1] +
-                               get_vlc2(gb, tab->table, tab->bits, 1);
-        }
-    }
-}
-
-/**
- * Decode location code for each gain control point.
- *
- * @param[in]     gb              the GetBit context
- * @param[in,out] ctx             ptr to the channel unit context
- * @param[in]     ch_num          channel to process
- * @param[in]     coded_subbands  number of subbands to process
- * @param[in]     avctx           ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_gainc_loc_codes(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                  int ch_num, int coded_subbands,
-                                  AVCodecContext *avctx)
-{
-    int sb, i, delta, delta_bits, min_val, pred, more_than_ref;
-    AtracGainInfo *dst, *ref;
-    VLC *tab;
-    Atrac3pChanParams *chan     = &ctx->channels[ch_num];
-    Atrac3pChanParams *ref_chan = &ctx->channels[0];
-
-    switch (get_bits(gb, 2)) { /* switch according to coding mode */
-    case 0: /* sequence of numbers in ascending order */
-        for (sb = 0; sb < coded_subbands; sb++)
-            for (i = 0; i < chan->gain_data[sb].num_points; i++)
-                gainc_loc_mode0(gb, ctx, &chan->gain_data[sb], i);
-        break;
-    case 1:
-        if (ch_num) {
-            for (sb = 0; sb < coded_subbands; sb++) {
-                if (chan->gain_data[sb].num_points <= 0)
-                    continue;
-                dst = &chan->gain_data[sb];
-                ref = &ref_chan->gain_data[sb];
-
-                /* 1st value is vlc-coded modulo delta to master */
-                delta = get_vlc2(gb, gain_vlc_tabs[10].table,
-                                 gain_vlc_tabs[10].bits, 1);
-                pred = ref->num_points > 0 ? ref->loc_code[0] : 0;
-                dst->loc_code[0] = (pred + delta) & 0x1F;
-
-                for (i = 1; i < dst->num_points; i++) {
-                    more_than_ref = i >= ref->num_points;
-                    if (dst->lev_code[i] > dst->lev_code[i - 1]) {
-                        /* ascending curve */
-                        if (more_than_ref) {
-                            delta =
-                                get_vlc2(gb, gain_vlc_tabs[9].table,
-                                         gain_vlc_tabs[9].bits, 1);
-                            dst->loc_code[i] = dst->loc_code[i - 1] + delta;
-                        } else {
-                            if (get_bits1(gb))
-                                gainc_loc_mode0(gb, ctx, dst, i);  // direct coding
-                            else
-                                dst->loc_code[i] = ref->loc_code[i];  // clone master
-                        }
-                    } else { /* descending curve */
-                        tab   = more_than_ref ? &gain_vlc_tabs[7]
-                                              : &gain_vlc_tabs[10];
-                        delta = get_vlc2(gb, tab->table, tab->bits, 1);
-                        if (more_than_ref)
-                            dst->loc_code[i] = dst->loc_code[i - 1] + delta;
-                        else
-                            dst->loc_code[i] = (ref->loc_code[i] + delta) & 0x1F;
-                    }
-                }
-            }
-        } else /* VLC delta to previous */
-            for (sb = 0; sb < coded_subbands; sb++)
-                gainc_loc_mode1(gb, ctx, &chan->gain_data[sb]);
-        break;
-    case 2:
-        if (ch_num) {
-            for (sb = 0; sb < coded_subbands; sb++) {
-                if (chan->gain_data[sb].num_points <= 0)
-                    continue;
-                dst = &chan->gain_data[sb];
-                ref = &ref_chan->gain_data[sb];
-                if (dst->num_points > ref->num_points || get_bits1(gb))
-                    gainc_loc_mode1(gb, ctx, dst);
-                else /* clone master for the whole subband */
-                    for (i = 0; i < chan->gain_data[sb].num_points; i++)
-                        dst->loc_code[i] = ref->loc_code[i];
-            }
-        } else {
-            /* data for the first subband is coded directly */
-            for (i = 0; i < chan->gain_data[0].num_points; i++)
-                gainc_loc_mode0(gb, ctx, &chan->gain_data[0], i);
-
-            for (sb = 1; sb < coded_subbands; sb++) {
-                if (chan->gain_data[sb].num_points <= 0)
-                    continue;
-                dst = &chan->gain_data[sb];
-
-                /* 1st value is vlc-coded modulo delta to the corresponding
-                 * value of the previous subband if any or zero */
-                delta = get_vlc2(gb, gain_vlc_tabs[6].table,
-                                 gain_vlc_tabs[6].bits, 1);
-                pred             = dst[-1].num_points > 0
-                                   ? dst[-1].loc_code[0] : 0;
-                dst->loc_code[0] = (pred + delta) & 0x1F;
-
-                for (i = 1; i < dst->num_points; i++) {
-                    more_than_ref = i >= dst[-1].num_points;
-                    /* Select VLC table according to curve direction and
-                     * presence of prediction. */
-                    tab = &gain_vlc_tabs[(dst->lev_code[i] > dst->lev_code[i - 1]) *
-                                                   2 + more_than_ref + 6];
-                    delta = get_vlc2(gb, tab->table, tab->bits, 1);
-                    if (more_than_ref)
-                        dst->loc_code[i] = dst->loc_code[i - 1] + delta;
-                    else
-                        dst->loc_code[i] = (dst[-1].loc_code[i] + delta) & 0x1F;
-                }
-            }
-        }
-        break;
-    case 3:
-        if (ch_num) { /* clone master or direct or direct coding */
-            for (sb = 0; sb < coded_subbands; sb++)
-                for (i = 0; i < chan->gain_data[sb].num_points; i++) {
-                    if (i >= ref_chan->gain_data[sb].num_points)
-                        gainc_loc_mode0(gb, ctx, &chan->gain_data[sb], i);
-                    else
-                        chan->gain_data[sb].loc_code[i] =
-                            ref_chan->gain_data[sb].loc_code[i];
-                }
-        } else { /* shorter delta to min */
-            delta_bits = get_bits(gb, 2) + 1;
-            min_val    = get_bits(gb, 5);
-
-            for (sb = 0; sb < coded_subbands; sb++)
-                for (i = 0; i < chan->gain_data[sb].num_points; i++)
-                    chan->gain_data[sb].loc_code[i] = min_val + i +
-                                                      get_bits(gb, delta_bits);
-        }
-        break;
-    }
-
-    /* Validate decoded information */
-    for (sb = 0; sb < coded_subbands; sb++) {
-        dst = &chan->gain_data[sb];
-        for (i = 0; i < chan->gain_data[sb].num_points; i++) {
-            if (dst->loc_code[i] < 0 || dst->loc_code[i] > 31 ||
-                (i && dst->loc_code[i] <= dst->loc_code[i - 1])) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Invalid gain location: ch=%d, sb=%d, pos=%d, val=%d\n",
-                       ch_num, sb, i, dst->loc_code[i]);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Decode gain control data for all channels.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     num_channels  number of channels to process
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_gainc_data(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                             int num_channels, AVCodecContext *avctx)
-{
-    int ch_num, coded_subbands, sb, ret;
-
-    for (ch_num = 0; ch_num < num_channels; ch_num++) {
-        memset(ctx->channels[ch_num].gain_data, 0,
-               sizeof(*ctx->channels[ch_num].gain_data) * ATRAC3P_SUBBANDS);
-
-        if (get_bits1(gb)) { /* gain control data present? */
-            coded_subbands = get_bits(gb, 4) + 1;
-            if (get_bits1(gb)) /* is high band gain data replication on? */
-                ctx->channels[ch_num].num_gain_subbands = get_bits(gb, 4) + 1;
-            else
-                ctx->channels[ch_num].num_gain_subbands = coded_subbands;
-
-            if ((ret = decode_gainc_npoints(gb, ctx, ch_num, coded_subbands)) < 0 ||
-                (ret = decode_gainc_levels(gb, ctx, ch_num, coded_subbands))  < 0 ||
-                (ret = decode_gainc_loc_codes(gb, ctx, ch_num, coded_subbands, avctx)) < 0)
-                return ret;
-
-            if (coded_subbands > 0) { /* propagate gain data if requested */
-                for (sb = coded_subbands; sb < ctx->channels[ch_num].num_gain_subbands; sb++)
-                    ctx->channels[ch_num].gain_data[sb] =
-                        ctx->channels[ch_num].gain_data[sb - 1];
-            }
-        } else {
-            ctx->channels[ch_num].num_gain_subbands = 0;
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Decode envelope for all tones of a channel.
- *
- * @param[in]     gb                the GetBit context
- * @param[in,out] ctx               ptr to the channel unit context
- * @param[in]     ch_num            channel to process
- * @param[in]     band_has_tones    ptr to an array of per-band-flags:
- *                                  1 - tone data present
- */
-static void decode_tones_envelope(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                  int ch_num, int band_has_tones[])
-{
-    int sb;
-    Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
-    Atrac3pWavesData *ref = ctx->channels[0].tones_info;
-
-    if (!ch_num || !get_bits1(gb)) { /* mode 0: fixed-length coding */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-            if (!band_has_tones[sb])
-                continue;
-            dst[sb].pend_env.has_start_point = get_bits1(gb);
-            dst[sb].pend_env.start_pos       = dst[sb].pend_env.has_start_point
-                                               ? get_bits(gb, 5) : -1;
-            dst[sb].pend_env.has_stop_point  = get_bits1(gb);
-            dst[sb].pend_env.stop_pos        = dst[sb].pend_env.has_stop_point
-                                               ? get_bits(gb, 5) : 32;
-        }
-    } else { /* mode 1(slave only): copy master */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-            if (!band_has_tones[sb])
-                continue;
-            dst[sb].pend_env.has_start_point = ref[sb].pend_env.has_start_point;
-            dst[sb].pend_env.has_stop_point  = ref[sb].pend_env.has_stop_point;
-            dst[sb].pend_env.start_pos       = ref[sb].pend_env.start_pos;
-            dst[sb].pend_env.stop_pos        = ref[sb].pend_env.stop_pos;
-        }
-    }
-}
-
-/**
- * Decode number of tones for each subband of a channel.
- *
- * @param[in]     gb                the GetBit context
- * @param[in,out] ctx               ptr to the channel unit context
- * @param[in]     ch_num            channel to process
- * @param[in]     band_has_tones    ptr to an array of per-band-flags:
- *                                  1 - tone data present
- * @param[in]     avctx             ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_band_numwavs(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                               int ch_num, int band_has_tones[],
-                               AVCodecContext *avctx)
-{
-    int mode, sb, delta;
-    Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
-    Atrac3pWavesData *ref = ctx->channels[0].tones_info;
-
-    mode = get_bits(gb, ch_num + 1);
-    switch (mode) {
-    case 0: /** fixed-length coding */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
-            if (band_has_tones[sb])
-                dst[sb].num_wavs = get_bits(gb, 4);
-        break;
-    case 1: /** variable-length coding */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
-            if (band_has_tones[sb])
-                dst[sb].num_wavs =
-                    get_vlc2(gb, tone_vlc_tabs[1].table,
-                             tone_vlc_tabs[1].bits, 1);
-        break;
-    case 2: /** VLC modulo delta to master (slave only) */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
-            if (band_has_tones[sb]) {
-                delta = get_vlc2(gb, tone_vlc_tabs[2].table,
-                                 tone_vlc_tabs[2].bits, 1);
-                delta = sign_extend(delta, 3);
-                dst[sb].num_wavs = (ref[sb].num_wavs + delta) & 0xF;
-            }
-        break;
-    case 3: /** copy master (slave only) */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
-            if (band_has_tones[sb])
-                dst[sb].num_wavs = ref[sb].num_wavs;
-        break;
-    }
-
-    /** initialize start tone index for each subband */
-    for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++)
-        if (band_has_tones[sb]) {
-            if (ctx->waves_info->tones_index + dst[sb].num_wavs > 48) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Too many tones: %d (max. 48), frame: %d!\n",
-                       ctx->waves_info->tones_index + dst[sb].num_wavs,
-                       avctx->frame_number);
-                return AVERROR_INVALIDDATA;
-            }
-            dst[sb].start_index           = ctx->waves_info->tones_index;
-            ctx->waves_info->tones_index += dst[sb].num_wavs;
-        }
-
-    return 0;
-}
-
-/**
- * Decode frequency information for each subband of a channel.
- *
- * @param[in]     gb                the GetBit context
- * @param[in,out] ctx               ptr to the channel unit context
- * @param[in]     ch_num            channel to process
- * @param[in]     band_has_tones    ptr to an array of per-band-flags:
- *                                  1 - tone data present
- */
-static void decode_tones_frequency(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                   int ch_num, int band_has_tones[])
-{
-    int sb, i, direction, nbits, pred, delta;
-    Atrac3pWaveParam *iwav, *owav;
-    Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
-    Atrac3pWavesData *ref = ctx->channels[0].tones_info;
-
-    if (!ch_num || !get_bits1(gb)) { /* mode 0: fixed-length coding */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-            if (!band_has_tones[sb] || !dst[sb].num_wavs)
-                continue;
-            iwav      = &ctx->waves_info->waves[dst[sb].start_index];
-            direction = (dst[sb].num_wavs > 1) ? get_bits1(gb) : 0;
-            if (direction) { /** packed numbers in descending order */
-                if (dst[sb].num_wavs)
-                    iwav[dst[sb].num_wavs - 1].freq_index = get_bits(gb, 10);
-                for (i = dst[sb].num_wavs - 2; i >= 0 ; i--) {
-                    nbits = av_log2(iwav[i+1].freq_index) + 1;
-                    iwav[i].freq_index = get_bits(gb, nbits);
-                }
-            } else { /** packed numbers in ascending order */
-                for (i = 0; i < dst[sb].num_wavs; i++) {
-                    if (!i || iwav[i - 1].freq_index < 512)
-                        iwav[i].freq_index = get_bits(gb, 10);
-                    else {
-                        nbits = av_log2(1023 - iwav[i - 1].freq_index) + 1;
-                        iwav[i].freq_index = get_bits(gb, nbits) +
-                                             1024 - (1 << nbits);
-                    }
-                }
-            }
-        }
-    } else { /* mode 1: VLC modulo delta to master (slave only) */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-            if (!band_has_tones[sb] || !dst[sb].num_wavs)
-                continue;
-            iwav = &ctx->waves_info->waves[ref[sb].start_index];
-            owav = &ctx->waves_info->waves[dst[sb].start_index];
-            for (i = 0; i < dst[sb].num_wavs; i++) {
-                delta = get_vlc2(gb, tone_vlc_tabs[6].table,
-                                 tone_vlc_tabs[6].bits, 1);
-                delta = sign_extend(delta, 8);
-                pred  = (i < ref[sb].num_wavs) ? iwav[i].freq_index :
-                        (ref[sb].num_wavs ? iwav[ref[sb].num_wavs - 1].freq_index : 0);
-                owav[i].freq_index = (pred + delta) & 0x3FF;
-            }
-        }
-    }
-}
-
-/**
- * Decode amplitude information for each subband of a channel.
- *
- * @param[in]     gb                the GetBit context
- * @param[in,out] ctx               ptr to the channel unit context
- * @param[in]     ch_num            channel to process
- * @param[in]     band_has_tones    ptr to an array of per-band-flags:
- *                                  1 - tone data present
- */
-static void decode_tones_amplitude(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                   int ch_num, int band_has_tones[])
-{
-    int mode, sb, j, i, diff, maxdiff, fi, delta, pred;
-    Atrac3pWaveParam *wsrc, *wref;
-    int refwaves[48];
-    Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
-    Atrac3pWavesData *ref = ctx->channels[0].tones_info;
-
-    if (ch_num) {
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-            if (!band_has_tones[sb] || !dst[sb].num_wavs)
-                continue;
-            wsrc = &ctx->waves_info->waves[dst[sb].start_index];
-            wref = &ctx->waves_info->waves[ref[sb].start_index];
-            for (j = 0; j < dst[sb].num_wavs; j++) {
-                for (i = 0, fi = 0, maxdiff = 1024; i < ref[sb].num_wavs; i++) {
-                    diff = FFABS(wsrc[j].freq_index - wref[i].freq_index);
-                    if (diff < maxdiff) {
-                        maxdiff = diff;
-                        fi      = i;
-                    }
-                }
-
-                if (maxdiff < 8)
-                    refwaves[dst[sb].start_index + j] = fi + ref[sb].start_index;
-                else if (j < ref[sb].num_wavs)
-                    refwaves[dst[sb].start_index + j] = j + ref[sb].start_index;
-                else
-                    refwaves[dst[sb].start_index + j] = -1;
-            }
-        }
-    }
-
-    mode = get_bits(gb, ch_num + 1);
-
-    switch (mode) {
-    case 0: /** fixed-length coding */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-            if (!band_has_tones[sb] || !dst[sb].num_wavs)
-                continue;
-            if (ctx->waves_info->amplitude_mode)
-                for (i = 0; i < dst[sb].num_wavs; i++)
-                    ctx->waves_info->waves[dst[sb].start_index + i].amp_sf = get_bits(gb, 6);
-            else
-                ctx->waves_info->waves[dst[sb].start_index].amp_sf = get_bits(gb, 6);
-        }
-        break;
-    case 1: /** min + VLC delta */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-            if (!band_has_tones[sb] || !dst[sb].num_wavs)
-                continue;
-            if (ctx->waves_info->amplitude_mode)
-                for (i = 0; i < dst[sb].num_wavs; i++)
-                    ctx->waves_info->waves[dst[sb].start_index + i].amp_sf =
-                        get_vlc2(gb, tone_vlc_tabs[3].table,
-                                 tone_vlc_tabs[3].bits, 1) + 20;
-            else
-                ctx->waves_info->waves[dst[sb].start_index].amp_sf =
-                    get_vlc2(gb, tone_vlc_tabs[4].table,
-                             tone_vlc_tabs[4].bits, 1) + 24;
-        }
-        break;
-    case 2: /** VLC modulo delta to master (slave only) */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-            if (!band_has_tones[sb] || !dst[sb].num_wavs)
-                continue;
-            for (i = 0; i < dst[sb].num_wavs; i++) {
-                delta = get_vlc2(gb, tone_vlc_tabs[5].table,
-                                 tone_vlc_tabs[5].bits, 1);
-                delta = sign_extend(delta, 5);
-                pred  = refwaves[dst[sb].start_index + i] >= 0 ?
-                        ctx->waves_info->waves[refwaves[dst[sb].start_index + i]].amp_sf : 34;
-                ctx->waves_info->waves[dst[sb].start_index + i].amp_sf = (pred + delta) & 0x3F;
-            }
-        }
-        break;
-    case 3: /** clone master (slave only) */
-        for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-            if (!band_has_tones[sb])
-                continue;
-            for (i = 0; i < dst[sb].num_wavs; i++)
-                ctx->waves_info->waves[dst[sb].start_index + i].amp_sf =
-                    refwaves[dst[sb].start_index + i] >= 0
-                    ? ctx->waves_info->waves[refwaves[dst[sb].start_index + i]].amp_sf
-                    : 32;
-        }
-        break;
-    }
-}
-
-/**
- * Decode phase information for each subband of a channel.
- *
- * @param[in]     gb                the GetBit context
- * @param[in,out] ctx               ptr to the channel unit context
- * @param[in]     ch_num            channel to process
- * @param[in]     band_has_tones    ptr to an array of per-band-flags:
- *                                  1 - tone data present
- */
-static void decode_tones_phase(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                               int ch_num, int band_has_tones[])
-{
-    int sb, i;
-    Atrac3pWaveParam *wparam;
-    Atrac3pWavesData *dst = ctx->channels[ch_num].tones_info;
-
-    for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
-        if (!band_has_tones[sb])
-            continue;
-        wparam = &ctx->waves_info->waves[dst[sb].start_index];
-        for (i = 0; i < dst[sb].num_wavs; i++)
-            wparam[i].phase_index = get_bits(gb, 5);
-    }
-}
-
-/**
- * Decode tones info for all channels.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     num_channels  number of channels to process
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-static int decode_tones_info(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                             int num_channels, AVCodecContext *avctx)
-{
-    int ch_num, i, ret;
-    int band_has_tones[16];
-
-    for (ch_num = 0; ch_num < num_channels; ch_num++)
-        memset(ctx->channels[ch_num].tones_info, 0,
-               sizeof(*ctx->channels[ch_num].tones_info) * ATRAC3P_SUBBANDS);
-
-    ctx->waves_info->tones_present = get_bits1(gb);
-    if (!ctx->waves_info->tones_present)
-        return 0;
-
-    memset(ctx->waves_info->waves, 0, sizeof(ctx->waves_info->waves));
-
-    ctx->waves_info->amplitude_mode = get_bits1(gb);
-    if (!ctx->waves_info->amplitude_mode) {
-        avpriv_report_missing_feature(avctx, "GHA amplitude mode 0");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    ctx->waves_info->num_tone_bands =
-        get_vlc2(gb, tone_vlc_tabs[0].table,
-                 tone_vlc_tabs[0].bits, 1) + 1;
-
-    if (num_channels == 2) {
-        get_subband_flags(gb, ctx->waves_info->tone_sharing, ctx->waves_info->num_tone_bands);
-        get_subband_flags(gb, ctx->waves_info->tone_master,  ctx->waves_info->num_tone_bands);
-        if (get_subband_flags(gb, ctx->waves_info->phase_shift,
-                              ctx->waves_info->num_tone_bands)) {
-            avpriv_report_missing_feature(avctx, "GHA Phase shifting");
-            return AVERROR_PATCHWELCOME;
-        }
-    }
-
-    ctx->waves_info->tones_index = 0;
-
-    for (ch_num = 0; ch_num < num_channels; ch_num++) {
-        for (i = 0; i < ctx->waves_info->num_tone_bands; i++)
-            band_has_tones[i] = !ch_num ? 1 : !ctx->waves_info->tone_sharing[i];
-
-        decode_tones_envelope(gb, ctx, ch_num, band_has_tones);
-        if ((ret = decode_band_numwavs(gb, ctx, ch_num, band_has_tones,
-                                       avctx)) < 0)
-            return ret;
-
-        decode_tones_frequency(gb, ctx, ch_num, band_has_tones);
-        decode_tones_amplitude(gb, ctx, ch_num, band_has_tones);
-        decode_tones_phase(gb, ctx, ch_num, band_has_tones);
-    }
-
-    if (num_channels == 2) {
-        for (i = 0; i < ctx->waves_info->num_tone_bands; i++) {
-            if (ctx->waves_info->tone_sharing[i])
-                ctx->channels[1].tones_info[i] = ctx->channels[0].tones_info[i];
-
-            if (ctx->waves_info->tone_master[i])
-                FFSWAP(Atrac3pWavesData, ctx->channels[0].tones_info[i],
-                       ctx->channels[1].tones_info[i]);
-        }
-    }
-
-    return 0;
-}
-
-int ff_atrac3p_decode_channel_unit(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                   int num_channels, AVCodecContext *avctx)
-{
-    int ret;
-
-    /* parse sound header */
-    ctx->num_quant_units = get_bits(gb, 5) + 1;
-    if (ctx->num_quant_units > 28 && ctx->num_quant_units < 32) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Invalid number of quantization units: %d!\n",
-               ctx->num_quant_units);
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->mute_flag = get_bits1(gb);
-
-    /* decode various sound parameters */
-    if ((ret = decode_quant_wordlen(gb, ctx, num_channels, avctx)) < 0)
-        return ret;
-
-    ctx->num_subbands       = atrac3p_qu_to_subband[ctx->num_quant_units - 1] + 1;
-    ctx->num_coded_subbands = ctx->used_quant_units
-                              ? atrac3p_qu_to_subband[ctx->used_quant_units - 1] + 1
-                              : 0;
-
-    if ((ret = decode_scale_factors(gb, ctx, num_channels, avctx)) < 0)
-        return ret;
-
-    if ((ret = decode_code_table_indexes(gb, ctx, num_channels, avctx)) < 0)
-        return ret;
-
-    decode_spectrum(gb, ctx, num_channels, avctx);
-
-    if (num_channels == 2) {
-        get_subband_flags(gb, ctx->swap_channels, ctx->num_coded_subbands);
-        get_subband_flags(gb, ctx->negate_coeffs, ctx->num_coded_subbands);
-    }
-
-    decode_window_shape(gb, ctx, num_channels);
-
-    if ((ret = decode_gainc_data(gb, ctx, num_channels, avctx)) < 0)
-        return ret;
-
-    if ((ret = decode_tones_info(gb, ctx, num_channels, avctx)) < 0)
-        return ret;
-
-    /* decode global noise info */
-    ctx->noise_present = get_bits1(gb);
-    if (ctx->noise_present) {
-        ctx->noise_level_index = get_bits(gb, 4);
-        ctx->noise_table_index = get_bits(gb, 4);
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/atrac3plus.h b/deps/libav/libavcodec/atrac3plus.h
deleted file mode 100644
index e56c444..0000000
--- a/deps/libav/libavcodec/atrac3plus.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * ATRAC3+ compatible decoder
- *
- * Copyright (c) 2010-2013 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Global structures, constants and data for ATRAC3+ decoder.
- */
-
-#ifndef AVCODEC_ATRAC3PLUS_H
-#define AVCODEC_ATRAC3PLUS_H
-
-#include <stdint.h>
-
-#include "libavutil/float_dsp.h"
-#include "atrac.h"
-#include "avcodec.h"
-#include "fft.h"
-#include "get_bits.h"
-
-/** Global unit sizes */
-#define ATRAC3P_SUBBANDS        16  ///< number of PQF subbands
-#define ATRAC3P_SUBBAND_SAMPLES 128 ///< number of samples per subband
-#define ATRAC3P_FRAME_SAMPLES   (ATRAC3P_SUBBAND_SAMPLES * ATRAC3P_SUBBANDS)
-
-#define ATRAC3P_PQF_FIR_LEN     12  ///< length of the prototype FIR of the PQF
-
-/** Global constants */
-#define ATRAC3P_POWER_COMP_OFF  15  ///< disable power compensation
-
-/** ATRAC3+ channel unit types */
-enum Atrac3pChannelUnitTypes {
-    CH_UNIT_MONO       = 0, ///< unit containing one coded channel
-    CH_UNIT_STEREO     = 1, ///< unit containing two jointly-coded channels
-    CH_UNIT_EXTENSION  = 2, ///< unit containing extension information
-    CH_UNIT_TERMINATOR = 3  ///< unit sequence terminator
-};
-
-/** Per-channel IPQF history */
-typedef struct Atrac3pIPQFChannelCtx {
-    DECLARE_ALIGNED(32, float, buf1)[ATRAC3P_PQF_FIR_LEN * 2][8];
-    DECLARE_ALIGNED(32, float, buf2)[ATRAC3P_PQF_FIR_LEN * 2][8];
-    int pos;
-} Atrac3pIPQFChannelCtx;
-
-/** Amplitude envelope of a group of sine waves */
-typedef struct Atrac3pWaveEnvelope {
-    int has_start_point;    ///< indicates start point within the GHA window
-    int has_stop_point;     ///< indicates stop point within the GHA window
-    int start_pos;          ///< start position expressed in n*4 samples
-    int stop_pos;           ///< stop  position expressed in n*4 samples
-} Atrac3pWaveEnvelope;
-
-/** Parameters of a group of sine waves */
-typedef struct Atrac3pWavesData {
-    Atrac3pWaveEnvelope pend_env;   ///< pending envelope from the previous frame
-    Atrac3pWaveEnvelope curr_env;   ///< group envelope from the current frame
-    int num_wavs;           ///< number of sine waves in the group
-    int start_index;        ///< start index into global tones table for that subband
-} Atrac3pWavesData;
-
-/** Parameters of a single sine wave */
-typedef struct Atrac3pWaveParam {
-    int   freq_index;   ///< wave frequency index
-    int   amp_sf;       ///< quantized amplitude scale factor
-    int   amp_index;    ///< quantized amplitude index
-    int   phase_index;  ///< quantized phase index
-} Atrac3pWaveParam;
-
-/** Sound channel parameters */
-typedef struct Atrac3pChanParams {
-    int ch_num;
-    int num_coded_vals;         ///< number of transmitted quant unit values
-    int fill_mode;
-    int split_point;
-    int table_type;             ///< table type: 0 - tone?, 1- noise?
-    int qu_wordlen[32];         ///< array of word lengths for each quant unit
-    int qu_sf_idx[32];          ///< array of scale factor indexes for each quant unit
-    int qu_tab_idx[32];         ///< array of code table indexes for each quant unit
-    int16_t spectrum[2048];     ///< decoded IMDCT spectrum
-    uint8_t power_levs[5];      ///< power compensation levels
-
-    /* imdct window shape history (2 frames) for overlapping. */
-    uint8_t wnd_shape_hist[2][ATRAC3P_SUBBANDS];    ///< IMDCT window shape, 0=sine/1=steep
-    uint8_t *wnd_shape;         ///< IMDCT window shape for current frame
-    uint8_t *wnd_shape_prev;    ///< IMDCT window shape for previous frame
-
-    /* gain control data history (2 frames) for overlapping. */
-    AtracGainInfo gain_data_hist[2][ATRAC3P_SUBBANDS];  ///< gain control data for all subbands
-    AtracGainInfo *gain_data;       ///< gain control data for next frame
-    AtracGainInfo *gain_data_prev;  ///< gain control data for previous frame
-    int num_gain_subbands;      ///< number of subbands with gain control data
-
-    /* tones data history (2 frames) for overlapping. */
-    Atrac3pWavesData tones_info_hist[2][ATRAC3P_SUBBANDS];
-    Atrac3pWavesData *tones_info;
-    Atrac3pWavesData *tones_info_prev;
-} Atrac3pChanParams;
-
-/* Per-unit sine wave parameters */
-typedef struct Atrac3pWaveSynthParams {
-    int tones_present;                      ///< 1 - tones info present
-    int amplitude_mode;                     ///< 1 - low range, 0 - high range
-    int num_tone_bands;                     ///< number of PQF bands with tones
-    uint8_t tone_sharing[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise tone sharing flags
-    uint8_t tone_master[ATRAC3P_SUBBANDS];  ///< 1 - subband-wise tone channel swapping
-    uint8_t phase_shift[ATRAC3P_SUBBANDS];  ///< 1 - subband-wise 180° phase shifting
-    int tones_index;                        ///< total sum of tones in this unit
-    Atrac3pWaveParam waves[48];
-} Atrac3pWaveSynthParams;
-
-/** Channel unit parameters */
-typedef struct Atrac3pChanUnitCtx {
-    /* channel unit variables */
-    int unit_type;                          ///< unit type (mono/stereo)
-    int num_quant_units;
-    int num_subbands;
-    int used_quant_units;                   ///< number of quant units with coded spectrum
-    int num_coded_subbands;                 ///< number of subbands with coded spectrum
-    int mute_flag;                          ///< mute flag
-    int use_full_table;                     ///< 1 - full table list, 0 - restricted one
-    int noise_present;                      ///< 1 - global noise info present
-    int noise_level_index;                  ///< global noise level index
-    int noise_table_index;                  ///< global noise RNG table index
-    uint8_t swap_channels[ATRAC3P_SUBBANDS];    ///< 1 - perform subband-wise channel swapping
-    uint8_t negate_coeffs[ATRAC3P_SUBBANDS];    ///< 1 - subband-wise IMDCT coefficients negation
-    Atrac3pChanParams channels[2];
-
-    /* Variables related to GHA tones */
-    Atrac3pWaveSynthParams wave_synth_hist[2];     ///< waves synth history for two frames
-    Atrac3pWaveSynthParams *waves_info;
-    Atrac3pWaveSynthParams *waves_info_prev;
-
-    Atrac3pIPQFChannelCtx ipqf_ctx[2];
-    DECLARE_ALIGNED(32, float, prev_buf)[2][ATRAC3P_FRAME_SAMPLES]; ///< overlapping buffer
-} Atrac3pChanUnitCtx;
-
-/**
- * Initialize VLC tables for bitstream parsing.
- *
- * @param[in]   codec    ptr to the AVCodec
- */
-void ff_atrac3p_init_vlcs(AVCodec *codec);
-
-/**
- * Decode bitstream data of a channel unit.
- *
- * @param[in]     gb            the GetBit context
- * @param[in,out] ctx           ptr to the channel unit context
- * @param[in]     num_channels  number of channels to process
- * @param[in]     avctx         ptr to the AVCodecContext
- * @return result code: 0 = OK, otherwise - error code
- */
-int  ff_atrac3p_decode_channel_unit(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
-                                    int num_channels, AVCodecContext *avctx);
-
-/**
- * Initialize IMDCT transform.
- *
- * @param[in]   avctx      ptr to the AVCodecContext
- * @param[in]   mdct_ctx   pointer to MDCT transform context
- */
-void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx);
-
-/**
- * Initialize sine waves synthesizer.
- */
-void ff_atrac3p_init_wave_synth(void);
-
-/**
- * Synthesize sine waves for a particular subband.
- *
- * @param[in]   ch_unit   pointer to the channel unit context
- * @param[in]   fdsp      pointer to float DSP context
- * @param[in]   ch_num    which channel to process
- * @param[in]   sb        which subband to process
- * @param[out]  out       receives processed data
- */
-void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *fdsp,
-                               int ch_num, int sb, float *out);
-
-/**
- * Perform power compensation aka noise dithering.
- *
- * @param[in]      ctx         ptr to the channel context
- * @param[in]      ch_index    which channel to process
- * @param[in,out]  sp          ptr to channel spectrum to process
- * @param[in]      rng_index   indicates which RNG table to use
- * @param[in]      sb_num      which subband to process
- */
-void ff_atrac3p_power_compensation(Atrac3pChanUnitCtx *ctx, int ch_index,
-                                   float *sp, int rng_index, int sb_num);
-
-/**
- * Regular IMDCT and windowing without overlapping,
- * with spectrum reversal in the odd subbands.
- *
- * @param[in]   fdsp       pointer to float DSP context
- * @param[in]   mdct_ctx   pointer to MDCT transform context
- * @param[in]   pIn        float input
- * @param[out]  pOut       float output
- * @param[in]   wind_id    which MDCT window to apply
- * @param[in]   sb         subband number
- */
-void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, FFTContext *mdct_ctx, float *pIn,
-                      float *pOut, int wind_id, int sb);
-
-/**
- * Subband synthesis filter based on the polyphase quadrature (pseudo-QMF)
- * filter bank.
- *
- * @param[in]      dct_ctx   ptr to the pre-initialized IDCT context
- * @param[in,out]  hist      ptr to the filter history
- * @param[in]      in        input data to process
- * @param[out]     out       receives processed data
- */
-void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist,
-                     const float *in, float *out);
-
-extern const uint16_t ff_atrac3p_qu_to_spec_pos[33];
-extern const float ff_atrac3p_sf_tab[64];
-extern const float ff_atrac3p_mant_tab[8];
-
-#endif /* AVCODEC_ATRAC3PLUS_H */
diff --git a/deps/libav/libavcodec/atrac3plus_data.h b/deps/libav/libavcodec/atrac3plus_data.h
deleted file mode 100644
index 5026a59..0000000
--- a/deps/libav/libavcodec/atrac3plus_data.h
+++ /dev/null
@@ -1,1914 +0,0 @@
-/*
- * ATRAC3+ compatible decoder
- *
- * Copyright (c) 2010-2013 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ATRAC3PLUS_DATA_H
-#define AVCODEC_ATRAC3PLUS_DATA_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-/** VLC tables for wordlen */
-static const uint8_t atrac3p_wl_huff_code1[3] = { 0, 2, 3 };
-
-static const uint8_t atrac3p_wl_huff_bits1[3] = { 1, 2, 2 };
-
-static const uint8_t atrac3p_wl_huff_xlat1[3] = { 0, 1, 7 };
-
-static const uint8_t atrac3p_wl_huff_code2[5] = { 0, 4, 5, 6, 7 };
-
-static const uint8_t atrac3p_wl_huff_bits2[5] = { 1, 3, 3, 3, 3 };
-
-static const uint8_t atrac3p_wl_huff_xlat2[5] = { 0, 1, 2, 6, 7 };
-
-static const uint8_t atrac3p_wl_huff_code3[8] = {
-    0, 4, 0xC, 0x1E, 0x1F, 0xD, 0xE, 5
-};
-
-static const uint8_t atrac3p_wl_huff_bits3[8] = { 1, 3, 4, 5, 5, 4, 4, 3 };
-
-static const uint8_t atrac3p_wl_huff_code4[8] = {
-    0, 4, 0xC, 0xD, 0x1E, 0x1F, 0xE, 5
-};
-
-static const uint8_t atrac3p_wl_huff_bits4[8] = { 1, 3, 4, 4, 5, 5, 4, 3 };
-
-/** VLC tables for scale factor indexes */
-static const uint16_t atrac3p_sf_huff_code1[64] = {
-        0,     2,     3,     4,     5,   0xC,   0xD,  0xE0,
-     0xE1,  0xE2,  0xE3,  0xE4,  0xE5,  0xE6, 0x1CE, 0x1CF,
-    0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x1D4, 0x1D5, 0x1D6, 0x1D7,
-    0x1D8, 0x1D9, 0x1DA, 0x1DB, 0x1DC, 0x1DD, 0x1DE, 0x1DF,
-    0x1E0, 0x1E1, 0x1E2, 0x1E3, 0x1E4, 0x1E5, 0x1E6, 0x1E7,
-    0x1E8, 0x1E9, 0x1EA, 0x1EB, 0x1EC, 0x1ED, 0x1EE, 0x1EF,
-    0x1F0, 0x1F1, 0x1F2, 0x1F3, 0x1F4, 0x1F5, 0x1F6, 0x1F7,
-    0x1F8, 0x1F9, 0x1FA, 0x1FB, 0x1FC, 0x1FD, 0x1FE, 0x1FF
-};
-
-static const uint8_t atrac3p_sf_huff_bits1[64] = {
-    2, 3, 3, 3, 3, 4, 4, 8, 8, 8, 8, 8, 8, 8, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
-};
-
-static const uint8_t atrac3p_sf_huff_xlat1[64] = {
-     0,  1, 61, 62, 63,  2, 60,  3,  4,  5,  6, 57, 58, 59,  7,  8,
-     9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
-    25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
-    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56
-};
-
-static const uint8_t atrac3p_sf_huff_xlat2[64] = {
-    0,   1,  2, 62, 63,  3, 61,  4,  5,  6, 57, 58, 59, 60,  7,  8,
-    9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
-    25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
-    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56
-};
-
-static const uint16_t atrac3p_sf_huff_code2[64] = {
-        0,     4,  0x18,  0x19,  0x70, 0x1CA, 0x1CB, 0x1CC,
-    0x1CD, 0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x1D4,
-    0x1D5, 0x1D6, 0x1D7, 0x1D8, 0x1D9, 0x1DA, 0x1DB, 0x1DC,
-    0x1DD, 0x1DE, 0x1DF, 0x1E0, 0x1E1, 0x1E2, 0x1E3, 0x1E4,
-    0x1E5, 0x1E6, 0x1E7, 0x1E8, 0x1E9, 0x1EA, 0x1EB, 0x1EC,
-    0x1ED, 0x1EE, 0x1EF, 0x1F0, 0x1F1, 0x1F2, 0x1F3, 0x1F4,
-    0x1F5, 0x1F6, 0x1F7, 0x1F8, 0x1F9, 0x1FA, 0x1FB, 0x1FC,
-    0x1FD, 0x1FE, 0x1FF,  0xE4,  0x71,  0x1A,  0x1B,     5
-};
-
-static const uint8_t atrac3p_sf_huff_bits2[64] = {
-    1, 3, 5, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 7, 5, 5, 3
-};
-
-static const uint16_t atrac3p_sf_huff_code3[64] = {
-        0,     2,     3,  0x18,  0x19,  0x70, 0x1CC, 0x1CD,
-    0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x1D4, 0x1D5,
-    0x1D6, 0x1D7, 0x1D8, 0x1D9, 0x1DA, 0x1DB, 0x1DC, 0x1DD,
-    0x1DE, 0x1DF, 0x1E0, 0x1E1, 0x1E2, 0x1E3, 0x1E4, 0x1E5,
-    0x1E6, 0x1E7, 0x1E8, 0x1E9, 0x1EA, 0x1EB, 0x1EC, 0x1ED,
-    0x1EE, 0x1EF, 0x1F0, 0x1F1, 0x1F2, 0x1F3, 0x1F4, 0x1F5,
-    0x1F6, 0x1F7, 0x1F8, 0x1F9, 0x1FA, 0x1FB, 0x1FC, 0x1FD,
-    0x1FE, 0x1FF,  0x71,  0x72,  0x1A,  0x1B,     4,     5
-};
-
-static const uint8_t atrac3p_sf_huff_bits3[64] = {
-    2, 3, 3, 5, 5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 5, 5, 3, 3
-};
-
-static const uint16_t atrac3p_sf_huff_code4[16] = {
-    0, 2, 3, 4, 5, 0xC, 0xD, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0, 0x3D, 0x3E, 0x3F
-};
-
-static const uint8_t atrac3p_sf_huff_bits4[16] = {
-    2, 3, 3, 3, 3, 4, 4, 6, 6, 6, 6, 6, 0, 6, 6, 6
-};
-
-static const uint8_t atrac3p_sf_huff_xlat4[16] = {
-    0, 1, 13, 14, 15, 2, 12, 3, 4, 5, 6, 7, 8, 9, 10, 11
-};
-
-static const uint8_t atrac3p_sf_huff_xlat5[16] = {
-    0, 1, 2, 14, 15, 3, 13, 4, 5, 6, 7, 9, 8, 10, 11, 12
-};
-
-static const uint16_t atrac3p_sf_huff_code5[16] = {
-    0,    4,  0xC, 0x1C, 0x78, 0x79, 0x7A, 0x7B,
-    0, 0x7C, 0x7D, 0x7E, 0x7F, 0x1D, 0xD,     5
-};
-
-static const uint8_t atrac3p_sf_huff_bits5[16] = {
-    1, 3, 4, 5, 7, 7, 7, 7, 0, 7, 7, 7, 7, 5, 4, 3
-};
-
-static const uint16_t atrac3p_sf_huff_code6[16] = {
-    0, 2, 3, 0xC, 0x1C, 0x3C, 0x7C, 0x7D, 0, 0x7E, 0x7F, 0x3D, 0x1D, 0xD, 4, 5
-};
-
-static const uint8_t atrac3p_sf_huff_bits6[16] = {
-    2, 3, 3, 4, 5, 6, 7, 7, 0, 7, 7, 6, 5, 4, 3, 3
-};
-
-/** VLC tables for code table indexes */
-static const uint8_t atrac3p_ct_huff_code1[4] = { 0, 2, 6, 7 };
-
-static const uint8_t atrac3p_ct_huff_bits1[4] = { 1, 2, 3, 3 };
-
-static const uint8_t atrac3p_ct_huff_code2[8] = { 0, 2, 3, 4, 5, 6, 0xE, 0xF };
-
-static const uint8_t atrac3p_ct_huff_bits2[8] = { 2, 3, 3, 3, 3, 3, 4, 4 };
-
-static const uint8_t atrac3p_ct_huff_xlat1[8] = { 0, 1, 2, 3, 6, 7, 4, 5 };
-
-static const uint8_t atrac3p_ct_huff_code3[8] = {
-    0, 4, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF
-};
-
-static const uint8_t atrac3p_ct_huff_bits3[8] = { 1, 3, 4, 4, 4, 4, 4, 4 };
-
-/* weights for quantized word lengths */
-static const int8_t atrac3p_wl_weights[6][32] = {
-    { 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 1, 1,
-      1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 },
-    { 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 6, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 2, 2, 1, 1,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-/* weights for quantized scale factors
- * sf_weights[i] = i / (tab_idx + 1)
- * where tab_idx = [1,2] */
-static const int8_t atrac3p_sf_weights[2][32] = {
-    { 0, 0, 1, 1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7,  7,
-      8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15 },
-    { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4,  4,  5,
-      5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10 }
-};
-
-/** Ungroup table for word length segments.
- *  Numbers in this table tell which coeff belongs to which segment. */
-static const uint8_t atrac3p_qu_num_to_seg[32] = {
-    0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5,
-    5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9
-};
-
-/** Map quant unit number to subband number */
-static const uint8_t atrac3p_qu_to_subband[32] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 1, 1,  1,  1,  2,  2,  2, 2,
-    3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
-};
-
-/** Map subband number to number of power compensation groups */
-static const int atrac3p_subband_to_num_powgrps[16] = {
-    1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5
-};
-
-/** 3D base shape tables. The values are grouped together as follows:
- *  [num_start_values = 8][num_shape_tables = 16][num_seg_coeffs = 9]
- *  For each of the 8 start values there are 16 different shapes each
- *  9 coefficients long. */
-static const int8_t atrac3p_wl_shapes[8][16][9] = {
-    { {  0,  0,  0,  0,  0,  0,  0, -2, -1 },
-      {  0,  0,  0,  0,  0,  0,  0, -5, -1 },
-      {  0,  0,  0, -7,  0,  0,  0,  0,  0 },
-      {  0,  0,  0,  0,  0, -7,  0,  0,  0 },
-      {  0,  0,  0,  0,  0,  0, -5,  0,  0 },
-      {  0,  0,  0,  0, -5,  0,  0,  0,  0 },
-      { -7, -7,  0,  0,  0,  0,  0,  0,  0 },
-      {  0, -7,  0,  0,  0,  0,  0,  0,  0 },
-      { -2, -2, -5,  0,  0,  0,  0,  0,  0 },
-      {  0,  0,  0, -2, -5,  0,  0,  0,  0 },
-      {  0,  0,  0,  0,  0, -2, -5,  0,  0 },
-      {  0,  0,  0, -5,  0,  0,  0,  0,  0 },
-      {  0, -2, -7, -2,  0,  0,  0,  0,  0 },
-      {  0,  0,  0,  0, -2, -5,  0,  0,  0 },
-      {  0,  0,  0, -5, -5,  0,  0,  0,  0 },
-      {  0,  0,  0, -5, -2,  0,  0,  0,  0 } },
-    { { -1, -5, -3, -2, -1, -1,  0,  0,  0 },
-      { -2, -5, -3, -3, -2, -1, -1,  0,  0 },
-      {  0, -1, -1, -1,  0,  0,  0,  0,  0 },
-      { -1, -3,  0,  0,  0,  0,  0,  0,  0 },
-      { -1, -2,  0,  0,  0,  0,  0,  0,  0 },
-      { -1, -3, -1,  0,  0,  0,  0,  1,  1 },
-      { -1, -5, -3, -3, -2, -1,  0,  0,  0 },
-      { -1, -1, -4, -2, -2, -1, -1,  0,  0 },
-      { -1, -1, -3, -2, -3, -1, -1, -1,  0 },
-      { -1, -4, -2, -3, -1,  0,  0,  0,  0 },
-      {  0, -1, -2, -2, -1, -1,  0,  0,  0 },
-      {  0, -2, -1,  0,  0,  0,  0,  0,  0 },
-      { -1, -1,  0,  0,  0,  0,  0,  0,  0 },
-      { -1, -1, -3, -2, -2, -1, -1, -1,  0 },
-      {  0,  0,  0,  0,  0,  0,  0,  0,  0 },
-      {  0, -1, -3, -2, -2, -1, -1, -1,  0 }, },
-    { { -1, -2,  0,  1,  1,  1,  1,  1,  1 },
-      {  0, -1,  1,  1,  1,  1,  1,  1,  1 },
-      {  0, -2,  1,  1,  1,  1,  1,  1,  1 },
-      {  0, -2,  0,  1,  1,  1,  1,  1,  1 },
-      { -1, -1,  0,  1,  1,  1,  1,  1,  1 },
-      {  0,  0, -1,  0,  1,  1,  1,  1,  1 },
-      { -1, -1,  1,  1,  1,  1,  1,  1,  1 },
-      {  0,  0, -1,  1,  1,  1,  1,  1,  1 },
-      {  0, -1,  0,  1,  1,  1,  1,  1,  1 },
-      { -1, -1, -1,  1,  1,  1,  1,  1,  1 },
-      {  0,  0,  0,  0,  1,  1,  1,  1,  1 },
-      {  0,  0,  0,  1,  1,  1,  1,  1,  1 },
-      {  0, -1, -1,  1,  1,  1,  1,  1,  1 },
-      {  0,  1,  0,  1,  1,  1,  1,  1,  1 },
-      {  0, -3, -2,  1,  1,  1,  1,  2,  2 },
-      { -3, -5, -3,  2,  2,  2,  2,  2,  2 }, },
-    { { -1, -2,  0,  2,  2,  2,  2,  2,  2 },
-      { -1, -2,  0,  1,  2,  2,  2,  2,  2 },
-      {  0, -2,  0,  2,  2,  2,  2,  2,  2 },
-      { -1,  0,  1,  2,  2,  2,  2,  2,  2 },
-      {  0,  0,  1,  2,  2,  2,  2,  2,  2 },
-      {  0, -2,  0,  1,  2,  2,  2,  2,  2 },
-      {  0, -1,  1,  2,  2,  2,  2,  2,  2 },
-      { -1, -1,  0,  2,  2,  2,  2,  2,  2 },
-      { -1, -1,  0,  1,  2,  2,  2,  2,  2 },
-      { -1, -2, -1,  2,  2,  2,  2,  2,  2 },
-      {  0, -1,  0,  2,  2,  2,  2,  2,  2 },
-      {  1,  1,  0,  1,  2,  2,  2,  2,  2 },
-      {  0,  1,  2,  2,  2,  2,  2,  2,  2 },
-      {  1,  0,  0,  1,  2,  2,  2,  2,  2 },
-      {  0,  0,  0,  1,  2,  2,  2,  2,  2 },
-      { -1, -1, -1,  1,  2,  2,  2,  2,  2 }, },
-    { {  0,  1,  2,  3,  3,  3,  3,  3,  3 },
-      {  1,  1,  2,  3,  3,  3,  3,  3,  3 },
-      { -1,  0,  1,  2,  3,  3,  3,  3,  3 },
-      {  0,  0,  2,  3,  3,  3,  3,  3,  3 },
-      { -1,  0,  1,  3,  3,  3,  3,  3,  3 },
-      {  0,  0,  1,  3,  3,  3,  3,  3,  3 },
-      {  1,  2,  3,  3,  3,  3,  3,  3,  3 },
-      {  1,  2,  2,  3,  3,  3,  3,  3,  3 },
-      {  0,  1,  1,  3,  3,  3,  3,  3,  3 },
-      {  0,  0,  1,  2,  3,  3,  3,  3,  3 },
-      { -1,  1,  2,  3,  3,  3,  3,  3,  3 },
-      { -1,  0,  2,  3,  3,  3,  3,  3,  3 },
-      {  2,  2,  3,  3,  3,  3,  3,  3,  3 },
-      {  1,  1,  3,  3,  3,  3,  3,  3,  3 },
-      {  0,  2,  3,  3,  3,  3,  3,  3,  3 },
-      {  0,  1,  1,  2,  3,  3,  3,  3,  3 }, },
-    { {  0,  1,  2,  3,  4,  4,  4,  4,  4 },
-      {  1,  2,  3,  4,  4,  4,  4,  4,  4 },
-      {  0,  0,  2,  3,  4,  4,  4,  4,  4 },
-      {  1,  1,  2,  4,  4,  4,  4,  4,  4 },
-      {  0,  1,  2,  4,  4,  4,  4,  4,  4 },
-      { -1,  0,  1,  3,  4,  4,  4,  4,  4 },
-      {  0,  0,  1,  3,  4,  4,  4,  4,  4 },
-      {  1,  1,  2,  3,  4,  4,  4,  4,  4 },
-      {  0,  1,  1,  3,  4,  4,  4,  4,  4 },
-      {  2,  2,  3,  4,  4,  4,  4,  4,  4 },
-      {  1,  1,  3,  4,  4,  4,  4,  4,  4 },
-      {  1,  2,  2,  4,  4,  4,  4,  4,  4 },
-      { -1,  0,  2,  3,  4,  4,  4,  4,  4 },
-      {  0,  1,  3,  4,  4,  4,  4,  4,  4 },
-      {  1,  2,  2,  3,  4,  4,  4,  4,  4 },
-      {  0,  2,  3,  4,  4,  4,  4,  4,  4 }, },
-    { {  1,  2,  3,  4,  5,  5,  5,  5,  5 },
-      {  0,  1,  2,  3,  4,  5,  5,  5,  5 },
-      {  0,  1,  2,  3,  5,  5,  5,  5,  5 },
-      {  1,  1,  3,  4,  5,  5,  5,  5,  5 },
-      {  1,  1,  2,  4,  5,  5,  5,  5,  5 },
-      {  1,  2,  2,  4,  5,  5,  5,  5,  5 },
-      {  1,  1,  2,  3,  5,  5,  5,  5,  5 },
-      {  2,  2,  3,  4,  5,  5,  5,  5,  5 },
-      {  0,  1,  2,  4,  5,  5,  5,  5,  5 },
-      {  2,  2,  3,  5,  5,  5,  5,  5,  5 },
-      {  1,  2,  3,  5,  5,  5,  5,  5,  5 },
-      {  0,  1,  3,  4,  5,  5,  5,  5,  5 },
-      {  1,  2,  2,  3,  5,  5,  5,  5,  5 },
-      {  2,  3,  4,  5,  5,  5,  5,  5,  5 },
-      {  0,  2,  3,  4,  5,  5,  5,  5,  5 },
-      {  1,  1,  1,  3,  4,  5,  5,  5,  5 }, },
-    { {  1,  2,  3,  4,  5,  5,  5,  6,  6 },
-      {  1,  2,  3,  4,  5,  6,  6,  6,  6 },
-      {  2,  3,  4,  5,  6,  6,  6,  6,  6 },
-      {  1,  2,  3,  4,  6,  6,  6,  6,  6 },
-      {  2,  2,  3,  4,  5,  5,  5,  6,  6 },
-      {  1,  2,  3,  4,  5,  5,  6,  6,  6 },
-      {  2,  2,  3,  4,  6,  6,  6,  6,  6 },
-      {  2,  2,  3,  4,  5,  6,  6,  6,  6 },
-      {  2,  2,  4,  5,  6,  6,  6,  6,  6 },
-      {  2,  2,  3,  5,  6,  6,  6,  6,  6 },
-      {  1,  2,  3,  5,  6,  6,  6,  6,  6 },
-      {  2,  3,  3,  5,  6,  6,  6,  6,  6 },
-      {  1,  2,  4,  5,  6,  6,  6,  6,  6 },
-      {  2,  2,  3,  4,  5,  5,  6,  6,  6 },
-      {  2,  3,  3,  4,  6,  6,  6,  6,  6 },
-      {  1,  3,  4,  5,  6,  6,  6,  6,  6 } }
-};
-
-/** 2D base shape tables for scale factor coding.
- *  The values are grouped together as follows:
- *  [num_shape_tables = 64][num_seg_coeffs = 9] */
-static const int8_t atrac3p_sf_shapes[64][9] = {
-    { -3, -2, -1,  0,  3,  5,  6,  8, 40 },
-    { -3, -2,  0,  1,  7,  9, 11, 13, 20 },
-    { -1,  0,  0,  1,  6,  8, 10, 13, 41 },
-    {  0,  0,  0,  2,  5,  5,  6,  8, 14 },
-    {  0,  0,  0,  2,  6,  7,  8, 11, 47 },
-    {  0,  0,  1,  2,  5,  7,  8, 10, 32 },
-    {  0,  0,  1,  3,  8, 10, 12, 14, 47 },
-    {  0,  0,  2,  4,  9, 10, 12, 14, 40 },
-    {  0,  0,  3,  5,  9, 10, 12, 14, 22 },
-    {  0,  1,  3,  5, 10, 14, 18, 22, 31 },
-    {  0,  2,  5,  6, 10, 10, 10, 12, 46 },
-    {  0,  2,  5,  7, 12, 14, 15, 18, 44 },
-    {  1,  1,  4,  5,  7,  7,  8,  9, 15 },
-    {  1,  2,  2,  2,  4,  5,  7,  9, 26 },
-    {  1,  2,  2,  3,  6,  7,  7,  8, 47 },
-    {  1,  2,  2,  3,  6,  8, 10, 13, 22 },
-    {  1,  3,  4,  7, 13, 17, 21, 24, 41 },
-    {  1,  4,  0,  4, 10, 12, 13, 14, 17 },
-    {  2,  3,  3,  3,  6,  8, 10, 13, 48 },
-    {  2,  3,  3,  4,  9, 12, 14, 17, 47 },
-    {  2,  3,  3,  5, 10, 12, 14, 17, 25 },
-    {  2,  3,  5,  7,  8,  9,  9,  9, 13 },
-    {  2,  3,  5,  9, 16, 21, 25, 28, 33 },
-    {  2,  4,  5,  8, 12, 14, 17, 19, 26 },
-    {  2,  4,  6,  8, 12, 13, 13, 15, 20 },
-    {  2,  4,  7, 12, 20, 26, 30, 32, 35 },
-    {  3,  3,  5,  6, 12, 14, 16, 19, 34 },
-    {  3,  4,  4,  5,  7,  9, 10, 11, 48 },
-    {  3,  4,  5,  6,  8,  9, 10, 11, 16 },
-    {  3,  5,  5,  5,  7,  9, 10, 13, 35 },
-    {  3,  5,  5,  7, 10, 12, 13, 15, 49 },
-    {  3,  5,  7,  7,  8,  7,  9, 12, 21 },
-    {  3,  5,  7,  8, 12, 14, 15, 15, 24 },
-    {  3,  5,  7, 10, 16, 21, 24, 27, 44 },
-    {  3,  5,  8, 14, 21, 26, 28, 29, 42 },
-    {  3,  6, 10, 13, 18, 19, 20, 22, 27 },
-    {  3,  6, 11, 16, 24, 27, 28, 29, 31 },
-    {  4,  5,  4,  3,  4,  6,  8, 11, 18 },
-    {  4,  6,  5,  6,  9, 10, 12, 14, 20 },
-    {  4,  6,  7,  6,  6,  6,  7,  8, 46 },
-    {  4,  6,  7,  9, 13, 16, 18, 20, 48 },
-    {  4,  6,  7,  9, 14, 17, 20, 23, 31 },
-    {  4,  6,  9, 11, 14, 15, 15, 17, 21 },
-    {  4,  8, 13, 20, 27, 32, 35, 36, 38 },
-    {  5,  6,  6,  4,  5,  6,  7,  6,  6 },
-    {  5,  7,  7,  8,  9,  9, 10, 12, 49 },
-    {  5,  8,  9,  9, 10, 11, 12, 13, 42 },
-    {  5,  8, 10, 12, 15, 16, 17, 19, 42 },
-    {  5,  8, 12, 17, 26, 31, 32, 33, 44 },
-    {  5,  9, 13, 16, 20, 22, 23, 23, 35 },
-    {  6,  8,  8,  7,  6,  5,  6,  8, 15 },
-    {  6,  8,  8,  8,  9, 10, 12, 16, 24 },
-    {  6,  8,  8,  9, 10, 10, 11, 11, 13 },
-    {  6,  8, 10, 13, 19, 21, 24, 26, 32 },
-    {  6,  9, 10, 11, 13, 13, 14, 16, 49 },
-    {  7,  9,  9, 10, 13, 14, 16, 19, 27 },
-    {  7, 10, 12, 13, 16, 16, 17, 17, 27 },
-    {  7, 10, 12, 14, 17, 19, 20, 22, 48 },
-    {  8,  9, 10,  9, 10, 11, 11, 11, 19 },
-    {  8, 11, 12, 12, 13, 13, 13, 13, 17 },
-    {  8, 11, 13, 14, 16, 17, 19, 20, 27 },
-    {  8, 12, 17, 22, 26, 28, 29, 30, 33 },
-    { 10, 14, 16, 19, 21, 22, 22, 24, 28 },
-    { 10, 15, 17, 18, 21, 22, 23, 25, 43 }
-};
-
-static const uint8_t atrac3p_ct_restricted_to_full[2][7][4] = {
-    { { 0, 5, 4, 1 },
-      { 0, 1, 2, 3 },
-      { 3, 0, 4, 2 },
-      { 4, 0, 1, 2 },
-      { 1, 0, 4, 3 },
-      { 3, 0, 2, 1 },
-      { 0, 3, 1, 2 } },
-    { { 4, 0, 1, 2 },
-      { 0, 3, 2, 1 },
-      { 0, 1, 2, 3 },
-      { 0, 1, 2, 4 },
-      { 0, 1, 2, 3 },
-      { 1, 4, 2, 0 },
-      { 0, 1, 2, 3 } }
-};
-
-/** Tables for spectrum coding */
-static const uint8_t huff_a01_cb[14] = {
-    1, 12, 1, 0, 0, 1, 7, 0, 19, 5, 13, 21, 6, 8
-};
-
-static const uint8_t huff_a01_xlat[81] = {
-    0x00, 0x03, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x50, 0xD0, 0x70,
-    0xF0, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0x41, 0xC1, 0x31, 0x05, 0x0D,
-    0xC3, 0x13, 0x07, 0x0F, 0x44, 0xCC, 0x11, 0x43, 0x33, 0x54, 0x74, 0xDC,
-    0xFC, 0x71, 0x15, 0x4D, 0xCD, 0x1D, 0xD3, 0xC7, 0x37, 0x3F, 0xD4, 0xF4,
-    0x5C, 0x7C, 0x51, 0xD1, 0xF1, 0x45, 0xC5, 0x35, 0xDD, 0x3D, 0x53, 0x73,
-    0xF3, 0x47, 0x17, 0x77, 0x4F, 0xCF, 0x1F, 0x55, 0xF5, 0x7D, 0xD7, 0x5F,
-    0xFF, 0xD5, 0x75, 0x5D, 0xFD, 0x57, 0xF7, 0xDF, 0x7F
-};
-
-static const uint8_t huff_a02_cb[13] = {
-    2, 12, 1, 0, 4, 11, 0, 1, 29, 6, 20, 7, 2
-};
-
-static const uint8_t huff_a02_xlat[81] = {
-    0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51,
-    0x05, 0x45, 0x15, 0x55, 0x90, 0x80, 0x20, 0x60, 0x84, 0x94, 0x24, 0x64,
-    0x08, 0x48, 0x18, 0x58, 0x81, 0x91, 0x21, 0x85, 0x95, 0x65, 0x09, 0x49,
-    0x19, 0x59, 0x02, 0x42, 0x12, 0x52, 0x06, 0x46, 0x16, 0x56, 0x88, 0x61,
-    0x25, 0x29, 0x69, 0x5A, 0xA0, 0xA4, 0x98, 0x28, 0x68, 0xA1, 0xA5, 0x89,
-    0x99, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x96, 0x26, 0x66, 0x0A, 0x4A, 0x1A,
-    0xA8, 0x86, 0xA6, 0x8A, 0x9A, 0x2A, 0x6A, 0xA2, 0xAA
-};
-
-static const uint8_t huff_a03_cb[9] = { 3, 9, 1, 8, 0, 13, 18, 7, 2 };
-
-static const uint8_t huff_a03_xlat[49] = {
-    0x00, 0x08, 0x38, 0x01, 0x09, 0x39, 0x07, 0x0F, 0x3F, 0x10, 0x30, 0x11,
-    0x31, 0x02, 0x0A, 0x3A, 0x05, 0x06, 0x0E, 0x3E, 0x17, 0x37, 0x18, 0x28,
-    0x19, 0x29, 0x2A, 0x32, 0x03, 0x0B, 0x33, 0x3B, 0x0D, 0x15, 0x3D, 0x16,
-    0x1E, 0x36, 0x1F, 0x2F, 0x12, 0x1A, 0x13, 0x2B, 0x1D, 0x35, 0x2E, 0x1B,
-    0x2D
-};
-
-static const uint8_t huff_a04_cb[4]   = { 2, 3, 2, 4 };
-static const uint8_t huff_a04_xlat[6] = { 1, 2, 0, 3, 4, 5 };
-
-static const uint8_t huff_a05_cb[12] = {
-    3, 12, 1, 3, 5, 8, 12, 23, 72, 68, 31, 2
-};
-
-static const uint8_t huff_a05_xlat[225] = {
-    0x00, 0x10, 0xF0, 0x01, 0x11, 0xF1, 0x0F, 0x1F, 0xFF, 0x20, 0xE0, 0xE1,
-    0x02, 0xF2, 0x0E, 0x1E, 0x2F, 0x30, 0xD0, 0x21, 0x12, 0x22, 0xE2, 0x03,
-    0x0D, 0x2E, 0xEE, 0xFE, 0xEF, 0x40, 0xC0, 0x31, 0xC1, 0xD1, 0x32, 0xD2,
-    0x13, 0x23, 0xE3, 0xF3, 0x04, 0xF4, 0x0C, 0x1C, 0x1D, 0x2D, 0xED, 0xFD,
-    0x3E, 0xDE, 0x3F, 0xDF, 0x50, 0x60, 0x70, 0x90, 0xA0, 0xB0, 0x41, 0x51,
-    0x61, 0x71, 0x91, 0xA1, 0xB1, 0x42, 0x62, 0x92, 0xA2, 0xC2, 0x33, 0xC3,
-    0xD3, 0x14, 0x24, 0x34, 0xD4, 0xE4, 0x05, 0x15, 0xF5, 0x06, 0x16, 0x26,
-    0xE6, 0xF6, 0x07, 0x17, 0xE7, 0xF7, 0x09, 0x19, 0x29, 0xF9, 0x0A, 0x1A,
-    0x2A, 0xEA, 0xFA, 0x0B, 0x1B, 0xFB, 0x2C, 0x3C, 0xDC, 0xEC, 0xFC, 0x3D,
-    0x4D, 0xCD, 0xDD, 0x4E, 0x6E, 0x7E, 0xAE, 0xCE, 0x4F, 0x5F, 0x6F, 0x7F,
-    0x9F, 0xAF, 0xBF, 0xCF, 0x52, 0x72, 0xB2, 0x43, 0x53, 0x63, 0x73, 0x93,
-    0xA3, 0xB3, 0x44, 0x64, 0x74, 0x94, 0xA4, 0xB4, 0xC4, 0x25, 0x35, 0xA5,
-    0xC5, 0xD5, 0xE5, 0x36, 0x46, 0xB6, 0xC6, 0xD6, 0x27, 0x37, 0x47, 0xB7,
-    0xC7, 0xD7, 0x39, 0x49, 0x59, 0xC9, 0xD9, 0xE9, 0x3A, 0x4A, 0x5A, 0xCA,
-    0xDA, 0x2B, 0x3B, 0x4B, 0x6B, 0x7B, 0xDB, 0xEB, 0x4C, 0x5C, 0x6C, 0x7C,
-    0x9C, 0xAC, 0xCC, 0x5D, 0x6D, 0x7D, 0x9D, 0xAD, 0xBD, 0x5E, 0x9E, 0xBE,
-    0x54, 0x45, 0x55, 0x65, 0x75, 0x95, 0xB5, 0x56, 0x66, 0x76, 0x96, 0xA6,
-    0x57, 0x67, 0x97, 0xA7, 0x69, 0x79, 0xA9, 0xB9, 0x6A, 0x7A, 0x9A, 0xAA,
-    0xBA, 0x5B, 0x9B, 0xAB, 0xBB, 0xCB, 0xBC, 0x77, 0x99
-};
-
-static const uint8_t huff_a06_cb[7] = {
-    2, 6, 1, 3, 2, 6, 4
-};
-
-static const uint8_t huff_a06_xlat[16] = {
-    1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 10, 11, 12, 15
-};
-
-static const uint8_t huff_a07_cb[11] = {
-    2, 10, 1, 2, 2, 2, 6, 14, 21, 13, 2
-};
-
-static const uint8_t huff_a07_xlat[63] = {
-    0,   1, 63,  2, 62,  3, 61,  4,  5,  6, 58, 59, 60,  7,  8,  9,
-    10, 26, 27, 28, 36, 37, 38, 54, 55, 56, 57, 11, 12, 13, 14, 15,
-    16, 25, 29, 30, 31, 33, 34, 35, 39, 47, 48, 49, 50, 51, 52, 53,
-    17, 18, 19, 20, 21, 22, 23, 41, 42, 43, 44, 45, 46, 24, 40
-};
-
-static const uint8_t huff_a11_cb[13] = {
-    1, 11, 1, 0, 0, 0, 8, 1, 18, 9, 22, 10, 12
-};
-
-static const uint8_t huff_a11_xlat[81] = {
-    0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0xD0, 0x50, 0x70,
-    0xF0, 0xC4, 0x34, 0x4C, 0xCC, 0x1C, 0x41, 0xC1, 0x31, 0x05, 0x0D, 0x43,
-    0xC3, 0x13, 0x07, 0x0F, 0x44, 0x14, 0x74, 0xDC, 0x3C, 0x11, 0x1D, 0x33,
-    0x37, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0xFC, 0xD1, 0x71, 0xF1, 0x15, 0x35,
-    0x4D, 0xCD, 0xDD, 0x3D, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77, 0x3F, 0x51,
-    0x45, 0xC5, 0x55, 0x53, 0xF3, 0x4F, 0xCF, 0x1F, 0xFF, 0xD5, 0x75, 0xF5,
-    0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F
-};
-
-static const uint8_t huff_a12_cb[8] = { 5, 10, 16, 11, 32, 19, 1, 2 };
-
-static const uint8_t huff_a12_xlat[81] = {
-    0x00, 0x40, 0x10, 0x50, 0x04, 0x44, 0x14, 0x54, 0x01, 0x41, 0x11, 0x51,
-    0x05, 0x45, 0x15, 0x55, 0x90, 0x94, 0x58, 0x91, 0x95, 0x19, 0x59, 0x06,
-    0x46, 0x16, 0x56, 0x80, 0x60, 0x84, 0x24, 0x64, 0xA4, 0x08, 0x48, 0x18,
-    0x68, 0x81, 0x21, 0x61, 0xA1, 0x85, 0x25, 0x65, 0xA5, 0x09, 0x49, 0x99,
-    0x69, 0xA9, 0x02, 0x42, 0x12, 0x52, 0x96, 0x26, 0x66, 0x1A, 0x5A, 0x20,
-    0xA0, 0x88, 0x98, 0x28, 0xA8, 0x89, 0x29, 0x82, 0x92, 0x22, 0x62, 0x86,
-    0xA6, 0x0A, 0x4A, 0x9A, 0x6A, 0xAA, 0xA2, 0x8A, 0x2A
-};
-
-static const uint8_t huff_a13_cb[12] = {
-    1, 10, 1, 0, 0, 4, 2, 2, 9, 15, 12, 4
-};
-
-static const uint8_t huff_a13_xlat[49] = {
-    0x00, 0x08, 0x38, 0x01, 0x07, 0x39, 0x0F, 0x09, 0x3F, 0x10, 0x30, 0x31,
-    0x02, 0x3A, 0x06, 0x0E, 0x3E, 0x17, 0x18, 0x28, 0x11, 0x29, 0x0A, 0x32,
-    0x03, 0x0B, 0x3B, 0x05, 0x0D, 0x3D, 0x16, 0x1F, 0x37, 0x19, 0x12, 0x1A,
-    0x2A, 0x13, 0x33, 0x15, 0x35, 0x1E, 0x2E, 0x36, 0x2F, 0x1B, 0x2B, 0x1D,
-    0x2D
-};
-
-static const uint8_t huff_a14_cb[12] = {
-    2, 11, 1, 0, 4, 3, 5, 16, 28, 34, 26, 4
-};
-
-static const uint8_t huff_a14_xlat[121] = {
-    0x00, 0x10, 0xF0, 0x01, 0x0F, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x11, 0x02,
-    0x0E, 0x30, 0x50, 0xB0, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x05, 0x0B,
-    0x0D, 0x1E, 0xFE, 0x2F, 0xEF, 0x40, 0xC0, 0x31, 0x51, 0xB1, 0xC1, 0xD1,
-    0x22, 0x52, 0xE2, 0x13, 0xF3, 0x04, 0x15, 0xF5, 0x1B, 0xEB, 0xFB, 0x0C,
-    0x1D, 0xFD, 0x2E, 0x5E, 0xEE, 0x3F, 0x5F, 0xBF, 0xDF, 0x41, 0x32, 0x42,
-    0xB2, 0xD2, 0x23, 0x53, 0xB3, 0xE3, 0x14, 0x24, 0xE4, 0xF4, 0x25, 0x35,
-    0xD5, 0xE5, 0x2B, 0x3B, 0xDB, 0x1C, 0x2C, 0xBC, 0xEC, 0xFC, 0x2D, 0xBD,
-    0xED, 0x3E, 0x4E, 0xBE, 0xDE, 0x4F, 0xCF, 0xC2, 0x33, 0x43, 0xC3, 0xD3,
-    0x34, 0x44, 0x54, 0xB4, 0xD4, 0x45, 0x55, 0xC5, 0x4B, 0xCB, 0x3C, 0x4C,
-    0x5C, 0xCC, 0xDC, 0x3D, 0x4D, 0x5D, 0xCD, 0xDD, 0xCE, 0xC4, 0xB5, 0x5B,
-    0xBB
-};
-
-static const uint8_t huff_a15_cb[9] = { 5, 11, 9, 12, 16, 44, 98, 42, 4 };
-
-static const uint8_t huff_a15_xlat[225] = {
-    0x00, 0x10, 0xF0, 0x01, 0x11, 0xF1, 0x0F, 0x1F, 0xFF, 0x20, 0xE0, 0x21,
-    0xE1, 0x02, 0x12, 0xF2, 0x0E, 0x1E, 0xFE, 0x2F, 0xEF, 0x30, 0xD0, 0x31,
-    0xD1, 0x22, 0xE2, 0x03, 0x13, 0xF3, 0x0D, 0x1D, 0xFD, 0x2E, 0xEE, 0x3F,
-    0xDF, 0x40, 0x60, 0x70, 0x90, 0xA0, 0xC0, 0x41, 0xC1, 0x32, 0x42, 0xC2,
-    0xD2, 0x23, 0x33, 0xD3, 0xE3, 0x04, 0x14, 0x24, 0xE4, 0xF4, 0x06, 0x16,
-    0xF6, 0x07, 0x09, 0x0A, 0x1A, 0xFA, 0x0C, 0x1C, 0x2C, 0xEC, 0xFC, 0x2D,
-    0x3D, 0xDD, 0xED, 0x3E, 0x4E, 0xCE, 0xDE, 0x4F, 0xCF, 0x50, 0xB0, 0x51,
-    0x61, 0x71, 0x91, 0xA1, 0xB1, 0x52, 0x62, 0x72, 0x92, 0xA2, 0xB2, 0x43,
-    0x53, 0x63, 0x73, 0x93, 0xA3, 0xC3, 0x34, 0x44, 0x64, 0xA4, 0xC4, 0xD4,
-    0x05, 0x15, 0x25, 0x35, 0xD5, 0xE5, 0xF5, 0x26, 0x36, 0x46, 0xC6, 0xD6,
-    0xE6, 0x17, 0x27, 0x37, 0xC7, 0xD7, 0xE7, 0xF7, 0x19, 0x29, 0x39, 0xC9,
-    0xD9, 0xE9, 0xF9, 0x2A, 0x3A, 0x4A, 0x5A, 0xCA, 0xDA, 0xEA, 0x0B, 0x1B,
-    0x2B, 0x3B, 0xCB, 0xDB, 0xEB, 0xFB, 0x3C, 0x4C, 0x6C, 0x7C, 0x9C, 0xAC,
-    0xBC, 0xCC, 0xDC, 0x4D, 0x5D, 0x6D, 0x7D, 0x9D, 0xAD, 0xBD, 0xCD, 0x5E,
-    0x6E, 0x7E, 0x9E, 0xAE, 0xBE, 0x5F, 0x6F, 0x7F, 0x9F, 0xAF, 0xBF, 0xB3,
-    0x54, 0x74, 0x94, 0xB4, 0x45, 0x55, 0x65, 0x75, 0x95, 0xA5, 0xB5, 0xC5,
-    0x56, 0x66, 0x76, 0x96, 0xA6, 0xB6, 0x47, 0x57, 0x67, 0xA7, 0xB7, 0x49,
-    0x59, 0x69, 0xA9, 0xB9, 0x6A, 0x7A, 0x9A, 0xAA, 0xBA, 0x4B, 0x5B, 0x6B,
-    0x7B, 0x9B, 0xAB, 0xBB, 0x5C, 0x77, 0x97, 0x79, 0x99
-};
-
-static const uint8_t huff_a16_cb[13] = {
-    2, 12, 1, 1, 2, 2, 5, 7, 21, 54, 85, 62, 16
-};
-
-static const uint8_t huff_a16_xlat[256] = {
-    0x00, 0x01, 0x10, 0x11, 0x21, 0x12, 0x20, 0x31, 0x02, 0x22, 0x13, 0x30,
-    0x41, 0x32, 0x03, 0x23, 0x14, 0x24, 0x40, 0x51, 0x61, 0xD1, 0xE1, 0x42,
-    0x52, 0xD2, 0x33, 0x43, 0xD3, 0x04, 0x34, 0x05, 0x15, 0x25, 0x16, 0x1D,
-    0x2D, 0x1E, 0x2E, 0x50, 0x60, 0xD0, 0xE0, 0xF0, 0x71, 0x81, 0xF1, 0x62,
-    0x72, 0xE2, 0xF2, 0x53, 0x63, 0xE3, 0xF3, 0x44, 0x54, 0xD4, 0xE4, 0xF4,
-    0x35, 0x45, 0x55, 0xD5, 0xE5, 0xF5, 0x06, 0x26, 0x36, 0xD6, 0x07, 0x17,
-    0x27, 0x37, 0xD7, 0x18, 0x28, 0x1C, 0x0D, 0x3D, 0x4D, 0x5D, 0x6D, 0x8D,
-    0x0E, 0x3E, 0x4E, 0x5E, 0x0F, 0x1F, 0x2F, 0x3F, 0x5F, 0x70, 0x80, 0x90,
-    0xC0, 0x91, 0xA1, 0xB1, 0xC1, 0x82, 0x92, 0xA2, 0xC2, 0x73, 0x83, 0x93,
-    0xA3, 0xC3, 0x64, 0x74, 0x84, 0x94, 0xA4, 0xC4, 0x65, 0x75, 0x85, 0x46,
-    0x56, 0x66, 0xC6, 0xE6, 0xF6, 0x47, 0x57, 0xE7, 0xF7, 0x08, 0x38, 0x48,
-    0x58, 0x68, 0xD8, 0xE8, 0xF8, 0x09, 0x19, 0x29, 0x39, 0x59, 0xD9, 0xE9,
-    0xF9, 0x1A, 0x2A, 0x3A, 0xDA, 0xEA, 0xFA, 0x1B, 0x2B, 0xDB, 0xEB, 0xFB,
-    0x0C, 0x2C, 0x3C, 0xDC, 0xEC, 0x7D, 0x9D, 0xAD, 0xBD, 0xCD, 0x6E, 0x7E,
-    0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0x4F, 0x6F, 0x7F, 0x8F, 0xAF, 0xA0, 0xB2,
-    0xB3, 0xB4, 0x95, 0xA5, 0xB5, 0xC5, 0x76, 0x86, 0x96, 0xA6, 0xB6, 0x67,
-    0x77, 0x87, 0x97, 0xC7, 0x78, 0x88, 0x98, 0xC8, 0x49, 0x69, 0x79, 0x89,
-    0x99, 0xC9, 0x0A, 0x4A, 0x5A, 0x6A, 0x7A, 0xCA, 0x0B, 0x3B, 0x4B, 0x5B,
-    0x6B, 0xCB, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xFC,
-    0xDD, 0xED, 0xFD, 0xDE, 0xEE, 0xFE, 0x9F, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF,
-    0xB0, 0xA7, 0xB7, 0xA8, 0xB8, 0xA9, 0xB9, 0x8A, 0x9A, 0xAA, 0xBA, 0x7B,
-    0x8B, 0x9B, 0xAB, 0xBB
-};
-
-static const uint8_t huff_a17_cb[9] = { 3, 9, 3, 2, 5, 7, 17, 23, 6 };
-
-static const uint8_t huff_a17_xlat[63] = {
-    0,   1, 63,  2, 62,  3,  4, 59, 60, 61,  5,  6,  7,  8, 56, 57,
-    58,  9, 10, 11, 12, 13, 14, 26, 27, 36, 37, 38, 50, 51, 52, 53,
-    54, 55, 15, 16, 17, 18, 19, 20, 21, 25, 28, 29, 30, 31, 33, 34,
-    35, 39, 43, 44, 45, 46, 47, 48, 49, 22, 23, 24, 40, 41, 42
-};
-
-static const uint8_t huff_a21_cb[14] = {
-    1, 12, 1, 0, 0, 2, 6, 0, 7, 21, 15, 17, 8, 4
-};
-
-static const uint8_t huff_a21_xlat[81] = {
-    0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0xD0, 0x70, 0x34,
-    0x1C, 0x0D, 0x13, 0x07, 0x50, 0xF0, 0x44, 0xC4, 0x14, 0x74, 0x4C, 0xCC,
-    0xDC, 0x3C, 0x41, 0xC1, 0x11, 0x31, 0x05, 0x1D, 0x43, 0xC3, 0x33, 0x37,
-    0x0F, 0x54, 0xF4, 0xFC, 0xD1, 0x71, 0x15, 0x4D, 0xCD, 0xDD, 0xD3, 0x73,
-    0x47, 0xC7, 0x77, 0x3F, 0xD4, 0x5C, 0x7C, 0x51, 0xF1, 0x45, 0xC5, 0x55,
-    0x35, 0x3D, 0x53, 0xF3, 0x17, 0x4F, 0xCF, 0x1F, 0xFF, 0x75, 0xF5, 0x5D,
-    0x7D, 0xD7, 0xF7, 0x5F, 0xDF, 0xD5, 0xFD, 0x57, 0x7F
-};
-
-static const uint8_t huff_a22_cb[10] = { 2, 9, 1, 4, 0, 4, 3, 8, 3, 2 };
-
-static const uint8_t huff_a22_xlat[25] = {
-    0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x02, 0x06,
-    0x30, 0x11, 0x31, 0x0A, 0x3A, 0x0E, 0x17, 0x37, 0x32, 0x16, 0x3E, 0x12,
-    0x36
-};
-
-static const uint8_t huff_a23_cb[9] = { 3, 9, 5, 0, 4, 6, 10, 16, 8 };
-
-static const uint8_t huff_a23_xlat[49] = {
-    0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x30, 0x02,
-    0x3A, 0x06, 0x0E, 0x18, 0x28, 0x11, 0x31, 0x0A, 0x03, 0x05, 0x3E, 0x17,
-    0x37, 0x19, 0x29, 0x12, 0x2A, 0x32, 0x0B, 0x33, 0x3B, 0x0D, 0x15, 0x3D,
-    0x16, 0x1E, 0x36, 0x1F, 0x2F, 0x1A, 0x13, 0x1B, 0x2B, 0x1D, 0x2D, 0x35,
-    0x2E
-};
-
-static const uint8_t huff_a24_cb[5] = { 2, 4, 3, 1, 2 };
-
-static const uint8_t huff_a25_cb[5] = { 2, 4, 1, 5, 2 };
-
-static const uint8_t huff_a25_xlat[8] = { 1, 0, 2, 3, 4, 5, 6, 7 };
-
-static const uint8_t huff_a26_cb[10] = { 4, 11, 3, 4, 12, 15, 34, 83, 75, 30 };
-
-static const uint8_t huff_a26_xlat[256] = {
-    0x00, 0x01, 0x11, 0x10, 0x21, 0x12, 0x22, 0x20, 0x30, 0x31, 0x41, 0x02,
-    0x32, 0x03, 0x13, 0x23, 0x33, 0x14, 0x24, 0x40, 0x51, 0x61, 0x42, 0x52,
-    0x43, 0x53, 0x04, 0x34, 0x44, 0x15, 0x25, 0x35, 0x16, 0x26, 0x50, 0x60,
-    0x71, 0x81, 0xD1, 0x62, 0x72, 0x82, 0xD2, 0x63, 0x73, 0xD3, 0x54, 0x64,
-    0x05, 0x45, 0x55, 0x65, 0x06, 0x36, 0x46, 0x56, 0x17, 0x27, 0x37, 0x47,
-    0x18, 0x28, 0x38, 0x19, 0x1D, 0x2D, 0x3D, 0x1E, 0x70, 0x80, 0x90, 0xD0,
-    0xE0, 0x91, 0xA1, 0xB1, 0xC1, 0xE1, 0xF1, 0x92, 0xA2, 0xC2, 0xE2, 0xF2,
-    0x83, 0x93, 0xA3, 0xC3, 0xE3, 0xF3, 0x74, 0x84, 0x94, 0xA4, 0xC4, 0xD4,
-    0xE4, 0xF4, 0x75, 0x85, 0x95, 0xD5, 0xE5, 0x66, 0x76, 0x86, 0xD6, 0xE6,
-    0x07, 0x57, 0x67, 0x77, 0xD7, 0x08, 0x48, 0x58, 0x68, 0xD8, 0x09, 0x29,
-    0x39, 0x49, 0x59, 0x69, 0x1A, 0x2A, 0x3A, 0x4A, 0x1B, 0x2B, 0x1C, 0x2C,
-    0x3C, 0x4C, 0x0D, 0x4D, 0x5D, 0x6D, 0x7D, 0x8D, 0x0E, 0x2E, 0x3E, 0x4E,
-    0x5E, 0x6E, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0xA0, 0xB0, 0xC0, 0xF0, 0xB2,
-    0xB3, 0xB4, 0xA5, 0xB5, 0xC5, 0xF5, 0x96, 0xA6, 0xB6, 0xC6, 0xF6, 0x87,
-    0x97, 0xA7, 0xB7, 0xC7, 0xE7, 0xF7, 0x78, 0x88, 0x98, 0xA8, 0xC8, 0xE8,
-    0xF8, 0x79, 0x89, 0x99, 0xC9, 0xD9, 0xE9, 0xF9, 0x0A, 0x5A, 0x6A, 0x7A,
-    0x8A, 0xDA, 0xEA, 0xFA, 0x0B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x8B, 0xDB,
-    0x0C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xDC, 0x9D, 0xAD, 0xBD, 0xCD, 0x7E,
-    0x8E, 0x9E, 0xAE, 0xBE, 0x0F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xB8, 0xA9,
-    0xB9, 0x9A, 0xAA, 0xBA, 0xCA, 0x9B, 0xAB, 0xBB, 0xCB, 0xEB, 0xFB, 0xAC,
-    0xBC, 0xCC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xBF,
-    0xCF, 0xDF, 0xEF, 0xFF
-};
-
-static const uint8_t huff_a27_cb[7] = { 4, 8, 3, 14, 10, 20, 16 };
-
-static const uint8_t huff_a27_xlat[63] = {
-     0,  2,  3,  1,  5,  6,  7,  9, 54, 55, 56, 58, 59, 60, 61, 62,
-    63,  4,  8, 10, 11, 12, 14, 49, 52, 53, 57, 13, 15, 16, 17, 18,
-    19, 22, 23, 25, 26, 30, 39, 43, 44, 45, 46, 47, 48, 50, 51, 20,
-    21, 24, 27, 28, 29, 31, 33, 34, 35, 36, 37, 38, 40, 41, 42
-};
-
-static const uint8_t huff_a31_cb[8] = { 1, 6, 1, 0, 3, 1, 0, 4 };
-
-static const uint8_t huff_a31_xlat[9] = {
-    0x00, 0x04, 0x0C, 0x01, 0x03, 0x05, 0x0D, 0x07, 0x0F
-};
-
-static const uint8_t huff_a32_cb[13] = {
-    1, 11, 1, 0, 0, 2, 2, 6, 12, 18, 19, 15, 6
-};
-
-static const uint8_t huff_a32_xlat[81] = {
-    0x00, 0x40, 0x01, 0x10, 0x04, 0x80, 0x50, 0x20, 0x14, 0x05, 0x02, 0x90,
-    0x60, 0x44, 0x54, 0x24, 0x08, 0x18, 0x41, 0x11, 0x15, 0x09, 0x06, 0xA0,
-    0x84, 0x94, 0x64, 0xA4, 0x48, 0x58, 0x28, 0x51, 0x21, 0x45, 0x55, 0x25,
-    0x19, 0x12, 0x16, 0x0A, 0x1A, 0x68, 0xA8, 0x81, 0x91, 0x61, 0xA1, 0x85,
-    0x95, 0x65, 0xA5, 0x49, 0x59, 0x29, 0x69, 0x42, 0x52, 0x46, 0x56, 0x2A,
-    0x88, 0x98, 0x89, 0x99, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x86, 0x26, 0x66,
-    0x4A, 0x5A, 0x6A, 0xA2, 0x96, 0xA6, 0x8A, 0x9A, 0xAA
-};
-
-static const uint8_t huff_a33_cb[12] = {
-    3, 12, 1, 1, 13, 1, 14, 28, 33, 81, 32, 52
-};
-
-static const uint8_t huff_a33_xlat[256] = {
-    0x00, 0x10, 0x40, 0x50, 0x04, 0x44, 0x14, 0x54, 0x01, 0x41, 0x11, 0x51,
-    0x05, 0x45, 0x15, 0x55, 0x90, 0x20, 0x94, 0x64, 0x18, 0x21, 0x95, 0x19,
-    0x69, 0x02, 0x52, 0x06, 0x46, 0x16, 0x80, 0x60, 0x84, 0xD4, 0x24, 0x08,
-    0x48, 0x58, 0x68, 0x81, 0x91, 0x61, 0x85, 0x25, 0x65, 0xA5, 0x09, 0x49,
-    0x59, 0x29, 0x42, 0x12, 0x56, 0x96, 0xA6, 0x0A, 0x17, 0x1B, 0xD0, 0xC4,
-    0x74, 0xF4, 0x88, 0xC8, 0x28, 0xA1, 0x71, 0xC5, 0xD5, 0x75, 0x99, 0xB9,
-    0x4D, 0x1D, 0x2D, 0x6D, 0x22, 0x62, 0x66, 0x4A, 0x1A, 0x9A, 0x6A, 0x8E,
-    0x5E, 0x43, 0x23, 0x07, 0x47, 0x57, 0x6B, 0xC0, 0xA0, 0xE0, 0x70, 0xB0,
-    0xA4, 0xE4, 0x34, 0xB4, 0x98, 0xD8, 0xA8, 0x38, 0x78, 0x0C, 0x4C, 0x1C,
-    0x5C, 0x9C, 0x6C, 0x7C, 0xC1, 0xD1, 0xE1, 0x31, 0xE5, 0x35, 0xB5, 0xF5,
-    0x89, 0xA9, 0x79, 0xF9, 0x0D, 0xCD, 0x9D, 0xDD, 0xAD, 0x3D, 0x7D, 0x82,
-    0xC2, 0x92, 0xD2, 0xE2, 0x72, 0xF2, 0x86, 0xD6, 0xE6, 0x76, 0xB6, 0x8A,
-    0x5A, 0xDA, 0xEA, 0xFA, 0x4E, 0x1E, 0x9E, 0xEE, 0x03, 0x13, 0x53, 0x97,
-    0xB7, 0x0B, 0x4B, 0x8B, 0x5B, 0x9B, 0xEB, 0x7B, 0x0F, 0x4F, 0x1F, 0x5F,
-    0x9F, 0x2F, 0x3F, 0xBF, 0xE8, 0xB8, 0xF8, 0x8C, 0x2C, 0x3C, 0xFC, 0xB1,
-    0xC9, 0xD9, 0xE9, 0x39, 0x5D, 0xED, 0xBD, 0xA2, 0x32, 0x26, 0x36, 0x2A,
-    0xAA, 0xBA, 0x0E, 0x2E, 0x6E, 0x83, 0xC3, 0x93, 0x63, 0xB3, 0xA7, 0x37,
-    0x30, 0xF0, 0xCC, 0xDC, 0xAC, 0xEC, 0xBC, 0xF1, 0x8D, 0xFD, 0xB2, 0xC6,
-    0xF6, 0xCA, 0x3A, 0x7A, 0xCE, 0xDE, 0xAE, 0x3E, 0x7E, 0xBE, 0xFE, 0xD3,
-    0xA3, 0xE3, 0x33, 0x73, 0xF3, 0x87, 0xC7, 0xD7, 0x27, 0x67, 0xE7, 0x77,
-    0xF7, 0xCB, 0xDB, 0x2B, 0xAB, 0x3B, 0xBB, 0xFB, 0x8F, 0xCF, 0xDF, 0x6F,
-    0xAF, 0xEF, 0x7F, 0xFF
-};
-
-static const uint8_t huff_a34_cb[7] = { 1, 5, 1, 1, 1, 1, 2 };
-
-static const uint8_t huff_a34_xlat[6] = { 1, 0, 2, 3, 4, 5 };
-
-static const uint8_t huff_a35_cb[11] = { 2, 10, 1, 0, 2, 3, 6, 19, 9, 75, 110 };
-
-static const uint8_t huff_a35_xlat[225] = {
-    0x00, 0xF0, 0x0F, 0x10, 0x01, 0xFF, 0x20, 0xE0, 0x11, 0xF1, 0x0E, 0x1F,
-    0x30, 0x40, 0xD0, 0x21, 0xE1, 0x02, 0x12, 0x22, 0xE2, 0xF2, 0x03, 0x13,
-    0x1E, 0x2E, 0x3E, 0xEE, 0xFE, 0x2F, 0xEF, 0xD2, 0x43, 0xF3, 0x04, 0x0D,
-    0x2D, 0x3D, 0x3F, 0xDF, 0x50, 0x60, 0x70, 0x90, 0xB0, 0x31, 0x41, 0x91,
-    0xA1, 0xC1, 0xD1, 0x42, 0xA2, 0xC2, 0x23, 0x33, 0xE3, 0x24, 0x34, 0xB4,
-    0xD4, 0xF4, 0x05, 0x15, 0x45, 0xE5, 0x16, 0x36, 0x56, 0xA6, 0xC6, 0xD6,
-    0xF6, 0x57, 0xC7, 0xF7, 0x09, 0x29, 0x49, 0x59, 0x69, 0xF9, 0x0A, 0x2A,
-    0x3A, 0x4A, 0xDA, 0xEA, 0xFA, 0x0B, 0x2B, 0xAB, 0xEB, 0xFB, 0x0C, 0x1C,
-    0x2C, 0x3C, 0x4C, 0x5C, 0xCC, 0xDC, 0xFC, 0x1D, 0x4D, 0x6D, 0xBD, 0xCD,
-    0xED, 0xFD, 0x4E, 0x6E, 0xCE, 0xDE, 0x7F, 0xA0, 0xC0, 0x51, 0x61, 0x71,
-    0xB1, 0x32, 0x52, 0x62, 0x72, 0x92, 0xB2, 0x53, 0x63, 0x73, 0x93, 0xA3,
-    0xB3, 0xC3, 0xD3, 0x14, 0x44, 0x54, 0x64, 0x74, 0x94, 0xA4, 0xC4, 0xE4,
-    0x25, 0x35, 0x55, 0x65, 0x75, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xF5, 0x06,
-    0x26, 0x46, 0x66, 0x76, 0x96, 0xB6, 0xE6, 0x07, 0x17, 0x27, 0x37, 0x47,
-    0x67, 0x77, 0x97, 0xA7, 0xB7, 0xD7, 0xE7, 0x19, 0x39, 0x79, 0x99, 0xA9,
-    0xB9, 0xC9, 0xD9, 0xE9, 0x1A, 0x5A, 0x6A, 0x7A, 0x9A, 0xAA, 0xBA, 0xCA,
-    0x1B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x9B, 0xBB, 0xCB, 0xDB, 0x6C, 0x7C,
-    0x9C, 0xAC, 0xBC, 0xEC, 0x5D, 0x7D, 0x9D, 0xAD, 0xDD, 0x5E, 0x7E, 0x9E,
-    0xAE, 0xBE, 0x4F, 0x5F, 0x6F, 0x9F, 0xAF, 0xBF, 0xCF
-};
-
-static const uint8_t huff_a36_cb[12] = {
-    3, 12, 1, 3, 5, 5, 13, 27, 69, 96, 35, 2
-};
-
-static const uint8_t huff_a36_xlat[256] = {
-    0x00, 0x10, 0x01, 0x11, 0x20, 0x21, 0x02, 0x12, 0x22, 0x31, 0x41, 0x32,
-    0x13, 0x23, 0x30, 0x40, 0x51, 0x42, 0x03, 0x33, 0x43, 0x04, 0x14, 0x24,
-    0x34, 0x15, 0x25, 0x50, 0x61, 0x71, 0xD1, 0x52, 0x62, 0x72, 0xD2, 0x53,
-    0x63, 0xD3, 0x44, 0x54, 0x64, 0x05, 0x35, 0x45, 0x55, 0x16, 0x26, 0x36,
-    0x46, 0x17, 0x27, 0x1D, 0x2D, 0x3D, 0x60, 0x70, 0xD0, 0x81, 0x91, 0xA1,
-    0xC1, 0xE1, 0xF1, 0x82, 0x92, 0xC2, 0xE2, 0xF2, 0x73, 0x83, 0xE3, 0xF3,
-    0x74, 0x84, 0xC4, 0xD4, 0xE4, 0xF4, 0x65, 0x75, 0x85, 0xD5, 0xE5, 0x06,
-    0x56, 0x66, 0xD6, 0xE6, 0x07, 0x37, 0x47, 0x57, 0x67, 0xD7, 0xE7, 0x18,
-    0x28, 0x38, 0x48, 0x58, 0xD8, 0x19, 0x29, 0x2A, 0x1C, 0x2C, 0x0D, 0x4D,
-    0x5D, 0x6D, 0x7D, 0x8D, 0x9D, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E,
-    0x1F, 0x2F, 0x3F, 0x80, 0x90, 0xA0, 0xC0, 0xE0, 0xF0, 0xB1, 0xA2, 0xB2,
-    0x93, 0xA3, 0xB3, 0xC3, 0x94, 0xA4, 0xB4, 0x95, 0xA5, 0xB5, 0xC5, 0xF5,
-    0x76, 0x86, 0x96, 0xA6, 0xC6, 0xF6, 0x77, 0x87, 0x97, 0xA7, 0xC7, 0xF7,
-    0x08, 0x68, 0x78, 0x88, 0x98, 0xC8, 0xE8, 0xF8, 0x09, 0x39, 0x49, 0x59,
-    0x69, 0x79, 0x89, 0xD9, 0xE9, 0xF9, 0x0A, 0x1A, 0x3A, 0x4A, 0x5A, 0x6A,
-    0xDA, 0xEA, 0xFA, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0xDB, 0xEB, 0xFB, 0x0C,
-    0x3C, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xDC, 0xEC, 0xAD, 0xBD, 0xCD,
-    0xDD, 0xED, 0x0E, 0x8E, 0x9E, 0xAE, 0xBE, 0x0F, 0x4F, 0x5F, 0x6F, 0x7F,
-    0x8F, 0x9F, 0xAF, 0xB0, 0xB6, 0xB7, 0xA8, 0xB8, 0x99, 0xA9, 0xB9, 0xC9,
-    0x7A, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0x0B, 0x6B, 0x7B, 0x8B, 0x9B, 0xCB,
-    0xAC, 0xBC, 0xCC, 0xFC, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xBF, 0xCF, 0xDF,
-    0xEF, 0xFF, 0xAB, 0xBB
-};
-
-static const uint8_t huff_a37_cb[7] = { 4, 8, 7, 6, 8, 22, 20 };
-
-static const uint8_t huff_a37_xlat[63] = {
-     0,  1,  2,  3, 61, 62, 63,  4,  5,  6, 58, 59, 60,  7,  8,  9,
-    10, 54, 55, 56, 57, 11, 12, 13, 14, 15, 16, 25, 26, 27, 28, 29,
-    30, 35, 36, 37, 38, 48, 49, 50, 51, 52, 53, 17, 18, 19, 20, 21,
-    22, 23, 24, 31, 33, 34, 39, 40, 41, 42, 43, 44, 45, 46, 47
-};
-
-static const uint8_t huff_a41_cb[14] = {
-    1, 12, 1, 0, 0, 6, 2, 0, 0, 0, 19, 9, 24, 20
-};
-
-static const uint8_t huff_a41_xlat[81] = {
-    0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0x50, 0xD0, 0x70,
-    0xF0, 0xC4, 0x34, 0x4C, 0xCC, 0x1C, 0x41, 0xC1, 0x31, 0x05, 0x0D, 0x43,
-    0xC3, 0x13, 0x07, 0x0F, 0x44, 0x14, 0x74, 0xDC, 0x3C, 0x11, 0x1D, 0x33,
-    0x37, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0xFC, 0xD1, 0x71, 0xF1, 0xC5, 0x15,
-    0x35, 0x4D, 0xCD, 0xDD, 0x3D, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77, 0x1F,
-    0x3F, 0x51, 0x45, 0x55, 0xD5, 0x75, 0xF5, 0x5D, 0x7D, 0xFD, 0x53, 0xF3,
-    0x57, 0xD7, 0xF7, 0x4F, 0xCF, 0x5F, 0xDF, 0x7F, 0xFF
-};
-
-static const uint8_t huff_a42_cb[10] = { 3, 10, 1, 2, 13, 1, 31, 13, 16, 4 };
-
-static const uint8_t huff_a42_xlat[81] = {
-    0x00, 0x40, 0x01, 0x10, 0x50, 0x04, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51,
-    0x05, 0x45, 0x15, 0x55, 0x59, 0x80, 0x90, 0x20, 0x60, 0x84, 0x94, 0x24,
-    0x64, 0x08, 0x48, 0x18, 0x58, 0x81, 0x91, 0x21, 0x61, 0x85, 0x95, 0x25,
-    0x65, 0x09, 0x49, 0x19, 0x02, 0x42, 0x12, 0x52, 0x06, 0x46, 0x16, 0x56,
-    0xA0, 0xA4, 0x68, 0xA1, 0xA5, 0x99, 0x29, 0x69, 0x96, 0x66, 0x4A, 0x1A,
-    0x5A, 0x88, 0x98, 0x28, 0x89, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x86, 0x26,
-    0xA6, 0x0A, 0x9A, 0x2A, 0x6A, 0xA8, 0xA2, 0x8A, 0xAA
-};
-
-static const uint8_t huff_a43_cb[5] = { 2, 4, 2, 3, 2 };
-
-static const uint8_t huff_a43_xlat[7] = { 0, 7, 1, 2, 6, 3, 5 };
-
-static const uint8_t huff_a44_cb[9] = { 4, 10, 5, 4, 12, 17, 47, 24, 12 };
-
-static const uint8_t huff_a44_xlat[121] = {
-    0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x21,
-    0xE1, 0x02, 0x12, 0xF2, 0x0E, 0x1E, 0xFE, 0x2F, 0xEF, 0x30, 0x50, 0xD0,
-    0xD1, 0x22, 0xE2, 0x03, 0x13, 0xF3, 0x0D, 0x1D, 0x2D, 0xFD, 0x2E, 0xEE,
-    0x3F, 0xDF, 0x40, 0xB0, 0xC0, 0x31, 0x41, 0x51, 0xB1, 0xC1, 0x32, 0xB2,
-    0xC2, 0xD2, 0x23, 0xB3, 0xD3, 0xE3, 0x04, 0x14, 0xE4, 0xF4, 0x05, 0x15,
-    0xD5, 0xE5, 0xF5, 0x0B, 0x1B, 0x2B, 0x3B, 0xEB, 0xFB, 0x0C, 0x1C, 0x2C,
-    0xFC, 0x3D, 0x5D, 0xED, 0x3E, 0x4E, 0x5E, 0xBE, 0xDE, 0x4F, 0x5F, 0xBF,
-    0xCF, 0x42, 0x52, 0x33, 0x53, 0xC3, 0x24, 0xB4, 0xD4, 0x25, 0x35, 0xC5,
-    0x4B, 0xCB, 0xDB, 0x3C, 0x4C, 0x5C, 0xDC, 0xEC, 0x4D, 0xBD, 0xCD, 0xDD,
-    0xCE, 0x43, 0x34, 0x44, 0x54, 0xC4, 0x45, 0x55, 0xB5, 0x5B, 0xBB, 0xBC,
-    0xCC
-};
-
-static const uint8_t huff_a45_cb[5] = { 2, 4, 2, 2, 4 };
-
-static const uint8_t huff_a45_xlat[8] = { 1, 2, 0, 3, 4, 5, 6, 7 };
-
-static const uint8_t huff_a46_cb[7] = { 5, 9, 1, 16, 31, 36, 172 };
-
-static const uint8_t huff_a46_xlat[256] = {
-    0x02, 0x00, 0x30, 0x21, 0x31, 0x41, 0x61, 0x12, 0x22, 0x42, 0x62, 0x43,
-    0x53, 0x24, 0x45, 0x26, 0x27, 0x10, 0x40, 0xB0, 0x01, 0x11, 0x81, 0x32,
-    0x52, 0x72, 0x92, 0x03, 0x13, 0x33, 0x63, 0x14, 0x34, 0x54, 0x64, 0x74,
-    0x05, 0x15, 0x25, 0x35, 0x55, 0x65, 0x06, 0x46, 0x56, 0x57, 0x67, 0x88,
-    0x20, 0x51, 0x91, 0xD1, 0xF2, 0x23, 0x83, 0x93, 0x04, 0x44, 0x84, 0x94,
-    0x75, 0x85, 0xC5, 0x36, 0x66, 0x96, 0xB6, 0x07, 0x37, 0x97, 0x08, 0x28,
-    0x38, 0x48, 0x68, 0x09, 0x69, 0x79, 0x0A, 0x2A, 0x1B, 0x9B, 0x2C, 0x4D,
-    0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xC0, 0xD0, 0xE0, 0xF0, 0x71, 0xA1,
-    0xB1, 0xC1, 0xE1, 0xF1, 0x82, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0x73, 0xA3,
-    0xB3, 0xC3, 0xD3, 0xE3, 0xF3, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4, 0x95,
-    0xA5, 0xB5, 0xD5, 0xE5, 0xF5, 0x16, 0x76, 0x86, 0xA6, 0xC6, 0xD6, 0xE6,
-    0xF6, 0x17, 0x47, 0x77, 0x87, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7, 0x18,
-    0x58, 0x78, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8, 0x19, 0x29, 0x39,
-    0x49, 0x59, 0x89, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9, 0x1A, 0x3A,
-    0x4A, 0x5A, 0x6A, 0x7A, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA,
-    0x0B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x8B, 0xAB, 0xBB, 0xCB, 0xDB,
-    0xEB, 0xFB, 0x0C, 0x1C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xAC,
-    0xBC, 0xCC, 0xDC, 0xEC, 0xFC, 0x0D, 0x1D, 0x2D, 0x3D, 0x5D, 0x6D, 0x7D,
-    0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0xDD, 0xED, 0xFD, 0x0E, 0x1E, 0x2E, 0x3E,
-    0x4E, 0x5E, 0x6E, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE,
-    0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xBF,
-    0xCF, 0xDF, 0xEF, 0xFF
-};
-
-static const uint8_t huff_a47_cb[8] = { 4, 9, 5, 12, 9, 12, 15, 10 };
-
-static const uint8_t huff_a47_xlat[63] = {
-     0,  1,  2, 62, 63,  3,  4,  5,  6,  8, 54, 56, 57, 58, 59, 60,
-    61,  7,  9, 10, 11, 12, 13, 14, 53, 55, 15, 16, 17, 18, 19, 20,
-    21, 36, 37, 39, 42, 52, 22, 25, 28, 35, 38, 40, 41, 43, 45, 46,
-    47, 48, 49, 50, 51, 23, 24, 26, 27, 29, 30, 31, 33, 34, 44
-};
-
-static const uint8_t huff_a51_cb[12] = {
-    2, 11, 1, 0, 6, 2, 6, 18, 4, 26, 6, 12
-};
-
-static const uint8_t huff_a51_xlat[81] = {
-    0x00, 0x40, 0xC0, 0x30, 0x04, 0x01, 0x03, 0x10, 0x0C, 0xD0, 0x70, 0x34,
-    0x1C, 0x0D, 0x07, 0x50, 0xF0, 0x44, 0xC4, 0x14, 0x4C, 0xCC, 0x3C, 0x41,
-    0xC1, 0x11, 0x31, 0x05, 0x43, 0xC3, 0x13, 0x33, 0x0F, 0x74, 0xDC, 0x1D,
-    0x37, 0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0xFC, 0xD1, 0x71, 0xF1, 0xC5, 0x15,
-    0x35, 0x4D, 0xCD, 0xDD, 0x3D, 0x53, 0xD3, 0x73, 0x47, 0xC7, 0x17, 0x77,
-    0x4F, 0x1F, 0x3F, 0x51, 0x45, 0x55, 0xF3, 0xCF, 0xFF, 0xD5, 0x75, 0xF5,
-    0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F
-};
-
-static const uint8_t huff_a52_cb[12] = { 1, 10, 1, 0, 2, 2, 0, 4, 3, 8, 3, 2 };
-
-static const uint8_t huff_a52_xlat[25] = {
-    0x00, 0x08, 0x38, 0x01, 0x07, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x02, 0x06,
-    0x30, 0x11, 0x31, 0x0A, 0x3A, 0x0E, 0x17, 0x37, 0x32, 0x16, 0x3E, 0x12,
-    0x36
-};
-
-static const uint8_t huff_a53_xlat[7] = { 0, 1, 2, 6, 7, 3, 5 };
-
-static const uint8_t huff_a54_cb[8] = { 4, 9, 4, 7, 12, 19, 21, 58 };
-
-static const uint8_t huff_a54_xlat[121] = {
-    0x00, 0x01, 0x0F, 0x1F, 0x10, 0xE0, 0xF0, 0x11, 0xF1, 0x2F, 0xFF, 0x20,
-    0x21, 0xE1, 0x02, 0x12, 0xF2, 0x03, 0xF3, 0x0E, 0x2E, 0xFE, 0x3F, 0x30,
-    0x40, 0xD0, 0xC1, 0xD1, 0x22, 0xC2, 0x33, 0xE3, 0x0C, 0xCC, 0x0D, 0x1D,
-    0x2D, 0xFD, 0x1E, 0x3E, 0x5E, 0xEF, 0xC0, 0x52, 0xB2, 0xD2, 0x43, 0xC3,
-    0xD3, 0x24, 0x45, 0xF5, 0x4B, 0x5B, 0xFB, 0x1C, 0x3D, 0xBD, 0xDD, 0xEE,
-    0xBF, 0xCF, 0xDF, 0x50, 0xB0, 0x31, 0x41, 0x51, 0xB1, 0x32, 0x42, 0xE2,
-    0x13, 0x23, 0x53, 0xB3, 0x04, 0x14, 0x34, 0x44, 0x54, 0xB4, 0xC4, 0xD4,
-    0xE4, 0xF4, 0x05, 0x15, 0x25, 0x35, 0x55, 0xB5, 0xC5, 0xD5, 0xE5, 0x0B,
-    0x1B, 0x2B, 0x3B, 0xBB, 0xCB, 0xDB, 0xEB, 0x2C, 0x3C, 0x4C, 0x5C, 0xBC,
-    0xDC, 0xEC, 0xFC, 0x4D, 0x5D, 0xCD, 0xED, 0x4E, 0xBE, 0xCE, 0xDE, 0x4F,
-    0x5F
-};
-
-static const uint8_t huff_a55_cb[8] = { 1, 6, 1, 1, 1, 0, 3, 2 };
-
-static const uint8_t huff_a55_xlat[8] = { 0, 1, 2, 3, 6, 7, 4, 5 };
-
-static const uint8_t huff_a56_cb[7] = { 3, 7, 1, 8, 6, 8, 8 };
-
-static const uint8_t huff_a56_xlat[31] = {
-    4,  0,  1,  2,  3, 28, 29, 30, 31,  5,  6,  7, 24, 25, 27, 8,
-    9, 14, 19, 21, 22, 23, 26, 10, 11, 12, 13, 15, 17, 18, 20
-};
-
-static const uint8_t huff_a57_cb[9] = { 3, 9, 1, 5, 7, 8, 16, 22, 4 };
-
-static const uint8_t huff_a57_xlat[63] = {
-     0,  1,  2, 61, 62, 63,  3,  4,  5,  6, 58, 59,
-    60,  7,  8,  9, 10, 54, 55, 56, 57, 11, 12, 13,
-    14, 15, 26, 27, 28, 36, 37, 38, 49, 50, 51, 52,
-    53, 16, 17, 18, 19, 20, 21, 23, 24, 25, 29, 30,
-    31, 33, 34, 35, 39, 43, 44, 45, 46, 47, 48, 22,
-    40, 41, 42
-};
-
-static const uint8_t huff_a61_cb[12] = {
-    2, 11, 1, 0, 8, 0, 1, 16, 10, 29, 12, 4
-};
-
-static const uint8_t huff_a61_xlat[81] = {
-    0x00, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x03, 0x70, 0x50, 0xD0,
-    0xF0, 0x44, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0x31, 0x05, 0x0D, 0x13,
-    0x07, 0x0F, 0x74, 0xCC, 0xDC, 0xFC, 0x41, 0xC1, 0x11, 0x43, 0xC3, 0x33,
-    0x54, 0xD4, 0xF4, 0x5C, 0x7C, 0x51, 0xD1, 0x71, 0xF1, 0x45, 0xC5, 0x15,
-    0x35, 0x4D, 0xCD, 0x1D, 0x3D, 0x53, 0xD3, 0x73, 0xF3, 0x47, 0xC7, 0x17,
-    0x37, 0x4F, 0xCF, 0x1F, 0x3F, 0x55, 0xD5, 0x75, 0xF5, 0x5D, 0xDD, 0xFD,
-    0x57, 0xD7, 0x77, 0xF7, 0xFF, 0x7D, 0x5F, 0xDF, 0x7F
-};
-
-static const uint8_t huff_a62_cb[8] = { 3, 8, 5, 2, 2, 9, 5, 2 };
-
-static const uint8_t huff_a62_xlat[25] = {
-    0x00, 0x08, 0x38, 0x01, 0x07, 0x39, 0x0F, 0x09, 0x3F, 0x10, 0x30, 0x31,
-    0x02, 0x3A, 0x06, 0x0E, 0x17, 0x37, 0x11, 0x0A, 0x32, 0x16, 0x3E, 0x12,
-    0x36
-};
-
-static const uint8_t huff_a63_cb[11] = {
-    3, 11, 1, 1, 10, 4, 16, 29, 46, 75, 74
-};
-
-static const uint8_t huff_a63_xlat[256] = {
-    0x00, 0x40, 0x10, 0x50, 0x04, 0x44, 0x14, 0x01, 0x41, 0x05, 0x45, 0x55,
-    0x54, 0x11, 0x51, 0x15, 0x80, 0x90, 0x60, 0x24, 0x64, 0xA4, 0x48, 0x61,
-    0x95, 0x25, 0xA5, 0x02, 0x42, 0x52, 0x16, 0x56, 0x20, 0x84, 0x94, 0x18,
-    0x58, 0x81, 0x91, 0x85, 0x65, 0x09, 0x49, 0x19, 0x59, 0x99, 0x29, 0x69,
-    0x79, 0x5D, 0x12, 0x62, 0x06, 0x46, 0x86, 0x66, 0x1A, 0x5A, 0x6A, 0x47,
-    0x17, 0xC0, 0xA0, 0xE0, 0xC4, 0xD4, 0x74, 0x08, 0x78, 0x0C, 0x4C, 0x1C,
-    0x5C, 0xD1, 0x21, 0xE1, 0x71, 0xC5, 0xE5, 0x75, 0xB5, 0x89, 0xBD, 0x92,
-    0x22, 0x96, 0xA6, 0x36, 0x0A, 0x4A, 0x8A, 0x9A, 0x2A, 0x7A, 0xDE, 0x6E,
-    0x43, 0x13, 0x53, 0x23, 0x07, 0x77, 0x4B, 0x1B, 0x9B, 0x6B, 0x2F, 0xD0,
-    0x30, 0x70, 0xE4, 0x34, 0xF4, 0xC8, 0x98, 0x28, 0x68, 0xA8, 0xE8, 0x38,
-    0xB8, 0xF8, 0x9C, 0x2C, 0x6C, 0x7C, 0xA1, 0xB1, 0xD5, 0x35, 0xC9, 0xD9,
-    0xA9, 0xE9, 0x39, 0xB9, 0xF9, 0xCD, 0x1D, 0x2D, 0xAD, 0x7D, 0xC2, 0xD2,
-    0xA2, 0xB2, 0xF2, 0xC6, 0x26, 0x76, 0xB6, 0xDA, 0xAA, 0xEA, 0x3A, 0xFA,
-    0x0E, 0x4E, 0x2E, 0x7E, 0xBE, 0xFE, 0x03, 0x83, 0x63, 0xA3, 0xB3, 0x87,
-    0x57, 0x97, 0xD7, 0x27, 0x0B, 0x8B, 0x5B, 0x2B, 0xAB, 0xCF, 0x1F, 0x9F,
-    0x7F, 0xBF, 0xB0, 0xF0, 0xB4, 0x88, 0xD8, 0x8C, 0xCC, 0xDC, 0xAC, 0xEC,
-    0x3C, 0xBC, 0xFC, 0xC1, 0x31, 0xF1, 0xF5, 0x0D, 0x4D, 0x8D, 0x9D, 0xDD,
-    0x6D, 0xED, 0x3D, 0xFD, 0x82, 0xE2, 0x32, 0x72, 0xD6, 0xE6, 0xF6, 0xCA,
-    0xBA, 0x8E, 0xCE, 0x1E, 0x5E, 0x9E, 0xAE, 0xEE, 0x3E, 0xC3, 0x93, 0xD3,
-    0xE3, 0x33, 0x73, 0xF3, 0xC7, 0x67, 0xA7, 0xE7, 0x37, 0xB7, 0xF7, 0xCB,
-    0xDB, 0xEB, 0x3B, 0x7B, 0xBB, 0xFB, 0x0F, 0x4F, 0x8F, 0x5F, 0xDF, 0x6F,
-    0xAF, 0xEF, 0x3F, 0xFF
-};
-
-static const uint8_t huff_a64_cb[8] = { 4, 9, 1, 7, 12, 36, 63, 2 };
-
-static const uint8_t huff_a64_xlat[121] = {
-    0x00, 0x10, 0x20, 0xE0, 0xF0, 0x02, 0x0E, 0xEF, 0x30, 0x01, 0x11, 0x21,
-    0x31, 0xF1, 0x12, 0xF2, 0x1E, 0xEE, 0xDF, 0xFF, 0x40, 0xC0, 0xD0, 0xD1,
-    0xE1, 0x22, 0x32, 0x42, 0xD2, 0xE2, 0x03, 0x13, 0x23, 0xB3, 0xC3, 0xE3,
-    0xF3, 0xE4, 0x05, 0xF5, 0x2B, 0x0C, 0xFC, 0x1D, 0x2D, 0xBD, 0xDD, 0xFD,
-    0x2E, 0x4E, 0xDE, 0xFE, 0x0F, 0x1F, 0x2F, 0x3F, 0x50, 0xB0, 0x41, 0x51,
-    0xB1, 0xC1, 0x52, 0xB2, 0xC2, 0x33, 0x43, 0x53, 0xD3, 0x04, 0x14, 0x24,
-    0x34, 0x44, 0x54, 0xB4, 0xC4, 0xD4, 0xF4, 0x15, 0x25, 0x35, 0x45, 0x55,
-    0xB5, 0xC5, 0xD5, 0xE5, 0x0B, 0x1B, 0x3B, 0x4B, 0x5B, 0xBB, 0xCB, 0xDB,
-    0xEB, 0xFB, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0xBC, 0xCC, 0xDC, 0xEC, 0x0D,
-    0x3D, 0x4D, 0x5D, 0xCD, 0xED, 0x3E, 0x5E, 0xBE, 0xCE, 0x4F, 0xCF, 0x5F,
-    0xBF
-};
-
-static const uint8_t huff_a65_cb[8] = { 2, 7, 3, 0, 1, 3, 4, 4 };
-
-static const uint8_t huff_a65_xlat[15] = {
-    0, 1, 15, 14, 2, 3, 13, 4, 6, 10, 12, 5, 7, 9, 11
-};
-
-static const uint8_t huff_a66_cb[11] = { 2, 10, 1, 2, 2, 6, 8, 6, 3, 1, 2 };
-
-static const uint8_t huff_a66_xlat[31] = {
-     0,  1, 31, 2, 30,  3,  4, 15, 17, 28, 29,  5,  6,  7,  8, 24,
-    25, 26, 27, 9, 10, 11, 21, 22, 23, 12, 19, 20, 13, 14, 18
-};
-
-static const uint8_t huff_a67_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 13, 25, 10 };
-
-static const uint8_t huff_a67_xlat[63] = {
-     0,  1,  2, 62, 63,  3,  4, 60, 61,  5,  6,  7, 57, 58, 59,  8,
-     9, 10, 11, 12, 13, 26, 38, 52, 53, 54, 55, 56, 14, 15, 16, 17,
-    18, 19, 25, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 39, 45, 46,
-    47, 48, 49, 50, 51, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44
-};
-
-static const uint8_t huff_a71_cb[5] = { 1, 3, 1, 1, 2 };
-
-static const uint8_t huff_a72_cb[12] = {
-    2, 11, 1, 0, 4, 8, 3, 8, 24, 17, 12, 4
-};
-
-static const uint8_t huff_a72_xlat[81] = {
-    0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x05,
-    0x15, 0x51, 0x45, 0x55, 0x80, 0x90, 0x20, 0x64, 0x08, 0x19, 0x02, 0x06,
-    0x60, 0x84, 0x94, 0x24, 0x48, 0x18, 0x58, 0x81, 0x91, 0x21, 0x61, 0x85,
-    0x95, 0x25, 0x65, 0x09, 0x49, 0x59, 0x42, 0x12, 0x52, 0x46, 0x16, 0x56,
-    0xA0, 0xA4, 0x98, 0x28, 0x68, 0xA1, 0xA5, 0x99, 0x29, 0x69, 0x96, 0x26,
-    0x66, 0x0A, 0x4A, 0x1A, 0x5A, 0x88, 0xA8, 0x89, 0xA9, 0x82, 0x92, 0x22,
-    0x62, 0x86, 0xA6, 0x2A, 0x6A, 0xA2, 0x8A, 0x9A, 0xAA
-};
-
-static const uint8_t huff_a73_cb[11] = { 2, 10, 1, 1, 5, 2, 8, 7, 13, 8, 4 };
-
-static const uint8_t huff_a73_xlat[49] = {
-    0x00, 0x08, 0x38, 0x01, 0x39, 0x07, 0x0F, 0x09, 0x3F, 0x10, 0x30, 0x31,
-    0x02, 0x3A, 0x06, 0x0E, 0x17, 0x11, 0x0A, 0x32, 0x0D, 0x16, 0x3E, 0x37,
-    0x18, 0x28, 0x19, 0x29, 0x12, 0x2A, 0x03, 0x3B, 0x05, 0x15, 0x1E, 0x1F,
-    0x2F, 0x1A, 0x0B, 0x2B, 0x33, 0x35, 0x3D, 0x2E, 0x36, 0x13, 0x1B, 0x1D,
-    0x2D
-};
-
-static const uint8_t huff_a74_cb[14] = {
-    1, 12, 1, 0, 0, 4, 0, 4, 5, 9, 30, 45, 21, 2
-};
-
-static const uint8_t huff_a74_xlat[121] = {
-    0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x02,
-    0xF2, 0x0E, 0x21, 0xE1, 0x12, 0xE2, 0x1E, 0x2E, 0xFE, 0x2F, 0xEF, 0x30,
-    0x50, 0xB0, 0xC0, 0xD0, 0x31, 0xB1, 0xD1, 0x22, 0xD2, 0x03, 0x13, 0xE3,
-    0xF3, 0xF4, 0x05, 0xE5, 0xF5, 0x0B, 0x1B, 0x0C, 0x0D, 0x1D, 0x2D, 0xFD,
-    0x3E, 0xEE, 0x3F, 0x5F, 0xDF, 0x40, 0x41, 0x51, 0xC1, 0x32, 0x42, 0x52,
-    0xB2, 0xC2, 0x23, 0x33, 0xB3, 0xC3, 0xD3, 0x04, 0x14, 0x24, 0xD4, 0xE4,
-    0x15, 0x25, 0xC5, 0xD5, 0x2B, 0x3B, 0xEB, 0xFB, 0x1C, 0x2C, 0x3C, 0x5C,
-    0xEC, 0xFC, 0x3D, 0x5D, 0xDD, 0xED, 0x4E, 0x5E, 0xBE, 0xCE, 0xDE, 0x4F,
-    0xBF, 0xCF, 0x43, 0x53, 0x34, 0x54, 0xB4, 0xC4, 0x35, 0x45, 0x55, 0xB5,
-    0x4B, 0x5B, 0xCB, 0xDB, 0x4C, 0xBC, 0xCC, 0xDC, 0x4D, 0xBD, 0xCD, 0x44,
-    0xBB
-};
-
-static const uint8_t huff_a75_cb[7] = { 2, 6, 1, 3, 3, 4, 4 };
-
-static const uint8_t huff_a75_xlat[15] = {
-    0, 1, 14, 15, 2, 3, 13, 4, 6, 10, 12, 5, 7, 9, 11
-};
-
-static const uint8_t huff_a76_cb[12] = {
-    3, 12, 1, 3, 4, 8, 10, 36, 60, 78, 48, 8
-};
-
-static const uint8_t huff_a76_xlat[256] = {
-    0x00, 0x10, 0x01, 0x11, 0x20, 0x21, 0x02, 0x12, 0x30, 0x31, 0x41, 0x22,
-    0x03, 0x13, 0x23, 0x14, 0x40, 0x51, 0x61, 0x32, 0x42, 0x33, 0x04, 0x24,
-    0x15, 0x16, 0x50, 0x60, 0xD0, 0x71, 0x81, 0xD1, 0xE1, 0xF1, 0x52, 0x62,
-    0x72, 0xD2, 0x43, 0x53, 0x63, 0xD3, 0x34, 0x44, 0x54, 0x05, 0x25, 0x35,
-    0x45, 0x06, 0x26, 0x36, 0x17, 0x27, 0x18, 0x0D, 0x1D, 0x2D, 0x3D, 0x1E,
-    0x2E, 0x1F, 0x70, 0x80, 0xE0, 0xF0, 0x91, 0xA1, 0xC1, 0x82, 0x92, 0xC2,
-    0xE2, 0xF2, 0x73, 0x83, 0x93, 0xE3, 0xF3, 0x64, 0x74, 0x84, 0xD4, 0xE4,
-    0xF4, 0x55, 0x65, 0xD5, 0xE5, 0xF5, 0x46, 0x56, 0x66, 0xD6, 0x07, 0x37,
-    0x47, 0x57, 0x08, 0x28, 0x38, 0x48, 0x19, 0x29, 0x39, 0x1A, 0x2A, 0x1B,
-    0x1C, 0x2C, 0x3C, 0x4D, 0x5D, 0x6D, 0x0E, 0x3E, 0x4E, 0x5E, 0x0F, 0x2F,
-    0x3F, 0x4F, 0x90, 0xA0, 0xB0, 0xC0, 0xB1, 0xA2, 0xB2, 0xA3, 0xB3, 0xC3,
-    0x94, 0xA4, 0xB4, 0xC4, 0x75, 0x85, 0x95, 0xA5, 0xC5, 0x76, 0x86, 0x96,
-    0xE6, 0xF6, 0x67, 0x77, 0x87, 0xD7, 0xE7, 0xF7, 0x58, 0x68, 0x78, 0x88,
-    0xD8, 0xE8, 0xF8, 0x09, 0x49, 0x59, 0x69, 0xD9, 0xE9, 0xF9, 0x0A, 0x3A,
-    0x4A, 0x5A, 0xDA, 0xEA, 0x0B, 0x2B, 0x3B, 0x4B, 0xDB, 0x0C, 0x4C, 0x5C,
-    0x6C, 0xDC, 0x7D, 0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0x6E, 0x7E, 0x8E, 0x9E,
-    0xAE, 0xBE, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xB5, 0xA6, 0xB6, 0xC6,
-    0x97, 0xA7, 0xC7, 0x98, 0xA8, 0xB8, 0xC8, 0x79, 0x89, 0x99, 0xA9, 0xB9,
-    0xC9, 0x6A, 0x7A, 0x8A, 0x9A, 0xAA, 0xCA, 0xFA, 0x5B, 0x6B, 0x7B, 0x8B,
-    0xCB, 0xEB, 0xFB, 0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xEC, 0xFC, 0xDD, 0xED,
-    0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xBF, 0xCF, 0xDF, 0xB7, 0xBA, 0x9B, 0xAB,
-    0xBB, 0xCC, 0xEF, 0xFF
-};
-
-static const uint8_t huff_b01_cb[14] = {
-    1, 12, 1, 0, 0, 2, 6, 0, 11, 13, 12, 24, 4, 8
-};
-
-static const uint8_t huff_b01_xlat[81] = {
-    0x00, 0x01, 0x03, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x50, 0xD0, 0x70,
-    0xF0, 0x34, 0x1C, 0x05, 0x0D, 0x13, 0x07, 0x0F, 0x44, 0xC4, 0x14, 0x4C,
-    0xCC, 0x3C, 0x41, 0xC1, 0x11, 0x31, 0x43, 0xC3, 0x33, 0x54, 0x74, 0xDC,
-    0xFC, 0x71, 0x15, 0x4D, 0x1D, 0xD3, 0xC7, 0x37, 0x3F, 0xD4, 0xF4, 0x5C,
-    0x7C, 0x51, 0xD1, 0xF1, 0x45, 0xC5, 0x55, 0x35, 0xCD, 0xDD, 0x3D, 0x53,
-    0x73, 0xF3, 0x47, 0x17, 0x77, 0x4F, 0xCF, 0x1F, 0xFF, 0xF5, 0x7D, 0xD7,
-    0x5F, 0xD5, 0x75, 0x5D, 0xFD, 0x57, 0xF7, 0xDF, 0x7F
-};
-
-static const uint8_t huff_b02_cb[14] = {
-    1, 12, 1, 0, 0, 4, 0, 8, 4, 9, 19, 13, 13, 10
-};
-
-static const uint8_t huff_b02_xlat[81] = {
-    0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x05,
-    0x15, 0x80, 0x51, 0x45, 0x55, 0x90, 0x20, 0x60, 0x24, 0x08, 0x18, 0x09,
-    0x02, 0x06, 0x84, 0x94, 0x64, 0x48, 0x58, 0x81, 0x91, 0x21, 0x61, 0x95,
-    0x25, 0x65, 0x19, 0x59, 0x42, 0x12, 0x46, 0x16, 0x56, 0xA0, 0xA4, 0x28,
-    0x68, 0x85, 0xA5, 0x49, 0x29, 0x69, 0x52, 0x0A, 0x1A, 0x5A, 0x88, 0x98,
-    0xA1, 0x89, 0x99, 0xA9, 0x22, 0x62, 0x96, 0x26, 0x66, 0x4A, 0x6A, 0xA8,
-    0x82, 0x92, 0xA2, 0x86, 0xA6, 0x8A, 0x9A, 0x2A, 0xAA
-};
-
-static const uint8_t huff_b03_cb[11] = { 1, 9, 1, 0, 0, 4, 0, 5, 12, 13, 14 };
-
-static const uint8_t huff_b03_xlat[49] = {
-    0x00, 0x08, 0x38, 0x01, 0x07, 0x30, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x18,
-    0x28, 0x31, 0x02, 0x3A, 0x03, 0x05, 0x06, 0x0E, 0x17, 0x37, 0x11, 0x19,
-    0x29, 0x0A, 0x32, 0x0B, 0x3B, 0x0D, 0x15, 0x3D, 0x3E, 0x1F, 0x2F, 0x12,
-    0x1A, 0x2A, 0x13, 0x1B, 0x2B, 0x33, 0x1D, 0x2D, 0x35, 0x16, 0x1E, 0x2E,
-    0x36
-};
-
-static const uint8_t huff_b04_cb[12] = {
-    2, 11, 1, 0, 4, 4, 5, 9, 30, 45, 21, 2
-};
-
-static const uint8_t huff_b04_xlat[121] = {
-    0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x02,
-    0xF2, 0x0E, 0x21, 0xE1, 0x12, 0xE2, 0x1E, 0x2E, 0xFE, 0x2F, 0xEF, 0x30,
-    0x50, 0xB0, 0xC0, 0xD0, 0x31, 0xB1, 0xD1, 0x22, 0xD2, 0x03, 0x13, 0xE3,
-    0xF3, 0xF4, 0x05, 0xE5, 0xF5, 0x0B, 0x1B, 0x0C, 0x0D, 0x1D, 0x2D, 0xFD,
-    0x3E, 0xEE, 0x3F, 0x5F, 0xDF, 0x40, 0x41, 0x51, 0xC1, 0x32, 0x42, 0x52,
-    0xB2, 0xC2, 0x23, 0x33, 0xB3, 0xC3, 0xD3, 0x04, 0x14, 0x24, 0xD4, 0xE4,
-    0x15, 0x25, 0xC5, 0xD5, 0x2B, 0x3B, 0xEB, 0xFB, 0x1C, 0x2C, 0x3C, 0x5C,
-    0xEC, 0xFC, 0x3D, 0x5D, 0xDD, 0xED, 0x4E, 0x5E, 0xBE, 0xCE, 0xDE, 0x4F,
-    0xBF, 0xCF, 0x43, 0x53, 0x34, 0x54, 0xB4, 0xC4, 0x35, 0x45, 0x55, 0xB5,
-    0x4B, 0x5B, 0xCB, 0xDB, 0x4C, 0xBC, 0xCC, 0xDC, 0x4D, 0xBD, 0xCD, 0x44,
-    0xBB
-};
-
-static const uint8_t huff_b05_cb[11] = {
-    3, 11, 1, 4, 4, 4, 12, 30, 73, 75, 22
-};
-
-static const uint8_t huff_b05_xlat[225] = {
-    0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x02,
-    0x0E, 0x30, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x0D, 0x1E, 0xFE, 0x2F,
-    0xEF, 0x40, 0x60, 0x70, 0x90, 0xA0, 0xC0, 0x31, 0xD1, 0x22, 0x32, 0xD2,
-    0xE2, 0x13, 0x23, 0xE3, 0xF3, 0x04, 0x06, 0x07, 0x09, 0x0A, 0x0C, 0x1D,
-    0x2D, 0xFD, 0x2E, 0x3E, 0xEE, 0x3F, 0xDF, 0x50, 0xB0, 0x41, 0x51, 0x61,
-    0x71, 0x91, 0xA1, 0xB1, 0xC1, 0x42, 0x62, 0x72, 0x92, 0xA2, 0xC2, 0x33,
-    0x93, 0xA3, 0xD3, 0x14, 0x24, 0xE4, 0xF4, 0x05, 0x15, 0xF5, 0x16, 0x26,
-    0xD6, 0xE6, 0xF6, 0x17, 0x27, 0xD7, 0xE7, 0xF7, 0x19, 0x29, 0x39, 0xE9,
-    0xF9, 0x1A, 0x2A, 0xEA, 0xFA, 0x0B, 0x1B, 0xFB, 0x1C, 0x2C, 0xEC, 0xFC,
-    0x3D, 0x7D, 0x9D, 0xDD, 0xED, 0x4E, 0x6E, 0x7E, 0x9E, 0xAE, 0xCE, 0xDE,
-    0x4F, 0x5F, 0x6F, 0x7F, 0x9F, 0xAF, 0xBF, 0xCF, 0x52, 0xB2, 0x43, 0x53,
-    0x63, 0x73, 0xB3, 0xC3, 0x34, 0x44, 0x64, 0x74, 0x94, 0xA4, 0xB4, 0xC4,
-    0xD4, 0x25, 0x35, 0x65, 0x75, 0x95, 0xA5, 0xD5, 0xE5, 0x36, 0x46, 0x56,
-    0x66, 0xA6, 0xB6, 0xC6, 0x37, 0x47, 0x57, 0xB7, 0xC7, 0x49, 0x59, 0x69,
-    0xB9, 0xC9, 0xD9, 0x3A, 0x4A, 0x5A, 0x6A, 0xAA, 0xBA, 0xCA, 0xDA, 0x2B,
-    0x3B, 0x6B, 0x7B, 0x9B, 0xAB, 0xDB, 0xEB, 0x3C, 0x4C, 0x6C, 0x7C, 0x9C,
-    0xAC, 0xCC, 0xDC, 0x4D, 0x5D, 0x6D, 0xAD, 0xBD, 0xCD, 0x5E, 0xBE, 0x54,
-    0x45, 0x55, 0xB5, 0xC5, 0x76, 0x96, 0x67, 0x77, 0x97, 0xA7, 0x79, 0x99,
-    0xA9, 0x7A, 0x9A, 0x4B, 0x5B, 0xBB, 0xCB, 0x5C, 0xBC
-};
-
-static const uint8_t huff_b07_cb[9] = { 3, 9, 3, 2, 4, 8, 23, 13, 10 };
-
-static const uint8_t huff_b07_xlat[63] = {
-     0,  1, 63,  2, 62,  3,  4, 60, 61,  5,  6,  7,  8, 56, 57, 58,
-    59,  9, 10, 11, 12, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36,
-    37, 38, 39, 51, 52, 53, 54, 55, 13, 14, 15, 16, 17, 18, 19, 45,
-    46, 47, 48, 49, 50, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44
-};
-
-static const uint8_t huff_b12_cb[10] = { 3, 10, 1, 3, 12, 0, 30, 9, 18, 8 };
-
-static const uint8_t huff_b12_xlat[81] = {
-    0x00, 0x40, 0x04, 0x01, 0x10, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51,
-    0x05, 0x45, 0x15, 0x55, 0x80, 0x90, 0x20, 0x60, 0x84, 0x94, 0x24, 0x64,
-    0x08, 0x48, 0x18, 0x81, 0x91, 0x61, 0x85, 0x95, 0x25, 0x65, 0x09, 0x49,
-    0x19, 0x59, 0x02, 0x42, 0x12, 0x52, 0x06, 0x46, 0x16, 0x56, 0xA4, 0x58,
-    0x68, 0x21, 0xA5, 0x29, 0x69, 0x1A, 0x5A, 0xA0, 0x88, 0x98, 0x28, 0xA1,
-    0x89, 0x99, 0xA9, 0x92, 0x22, 0x62, 0x86, 0x96, 0x26, 0x66, 0x0A, 0x4A,
-    0x6A, 0xA8, 0x82, 0xA2, 0xA6, 0x8A, 0x9A, 0x2A, 0xAA
-};
-
-static const uint8_t huff_b14_cb[14] = {
-    1, 12, 1, 0, 0, 4, 0, 3, 5, 16, 28, 34, 26, 4
-};
-
-static const uint8_t huff_b14_xlat[121] = {
-    0x00, 0x10, 0xF0, 0x01, 0x0F, 0xF1, 0x1F, 0xFF, 0x20, 0xE0, 0x11, 0x02,
-    0x0E, 0x30, 0x50, 0xB0, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x05, 0x0B,
-    0x0D, 0x1E, 0xFE, 0x2F, 0xEF, 0x40, 0xC0, 0x31, 0x51, 0xB1, 0xC1, 0xD1,
-    0x22, 0x52, 0xE2, 0x13, 0xF3, 0x04, 0x15, 0xF5, 0x1B, 0xEB, 0xFB, 0x0C,
-    0x1D, 0xFD, 0x2E, 0x5E, 0xEE, 0x3F, 0x5F, 0xBF, 0xDF, 0x41, 0x32, 0x42,
-    0xB2, 0xD2, 0x23, 0x53, 0xB3, 0xE3, 0x14, 0x24, 0xE4, 0xF4, 0x25, 0x35,
-    0xD5, 0xE5, 0x2B, 0x3B, 0xDB, 0x1C, 0x2C, 0xBC, 0xEC, 0xFC, 0x2D, 0xBD,
-    0xED, 0x3E, 0x4E, 0xBE, 0xDE, 0x4F, 0xCF, 0xC2, 0x33, 0x43, 0xC3, 0xD3,
-    0x34, 0x44, 0x54, 0xB4, 0xD4, 0x45, 0x55, 0xC5, 0x4B, 0xCB, 0x3C, 0x4C,
-    0x5C, 0xCC, 0xDC, 0x3D, 0x4D, 0x5D, 0xCD, 0xDD, 0xCE, 0xC4, 0xB5, 0x5B,
-    0xBB
-};
-
-static const uint8_t huff_b16_cb[11] = {
-    4, 12, 4, 4, 9, 13, 37, 76, 72, 39, 2
-};
-
-static const uint8_t huff_b16_xlat[256] = {
-    0x00, 0x10, 0x01, 0x11, 0x20, 0x21, 0x02, 0x12, 0x30, 0x31, 0x41, 0x22,
-    0x32, 0x03, 0x13, 0x23, 0x14, 0x40, 0x51, 0x61, 0x42, 0x52, 0x33, 0x43,
-    0x04, 0x24, 0x34, 0x15, 0x25, 0x16, 0x50, 0x60, 0x70, 0x71, 0x81, 0xD1,
-    0xE1, 0x62, 0x72, 0x82, 0xD2, 0x53, 0x63, 0x73, 0xD3, 0x44, 0x54, 0x05,
-    0x35, 0x45, 0x55, 0x06, 0x26, 0x36, 0x07, 0x17, 0x27, 0x37, 0x18, 0x28,
-    0x19, 0x1D, 0x2D, 0x3D, 0x1E, 0x2E, 0x1F, 0x80, 0x90, 0xD0, 0xE0, 0xF0,
-    0x91, 0xA1, 0xB1, 0xC1, 0xF1, 0x92, 0xA2, 0xB2, 0xC2, 0xE2, 0xF2, 0x83,
-    0x93, 0xA3, 0xC3, 0xE3, 0xF3, 0x64, 0x74, 0x84, 0x94, 0xD4, 0xE4, 0xF4,
-    0x65, 0x75, 0x85, 0xD5, 0xE5, 0x46, 0x56, 0x66, 0x76, 0xD6, 0xE6, 0x47,
-    0x57, 0x67, 0xD7, 0x08, 0x38, 0x48, 0x58, 0x09, 0x29, 0x39, 0x49, 0x0A,
-    0x1A, 0x2A, 0x3A, 0x1B, 0x2B, 0x0C, 0x1C, 0x2C, 0x3C, 0x0D, 0x4D, 0x5D,
-    0x6D, 0x7D, 0x0E, 0x3E, 0x4E, 0x5E, 0x6E, 0x0F, 0x2F, 0x3F, 0x4F, 0xA0,
-    0xB0, 0xC0, 0xB3, 0xA4, 0xB4, 0xC4, 0x95, 0xA5, 0xB5, 0xC5, 0xF5, 0x86,
-    0x96, 0xA6, 0xB6, 0xC6, 0xF6, 0x77, 0x87, 0x97, 0xA7, 0xC7, 0xE7, 0xF7,
-    0x68, 0x78, 0x88, 0x98, 0xD8, 0xE8, 0xF8, 0x59, 0x69, 0x79, 0x89, 0xD9,
-    0xE9, 0xF9, 0x4A, 0x5A, 0x6A, 0x7A, 0xDA, 0xEA, 0x0B, 0x3B, 0x4B, 0x5B,
-    0xDB, 0xEB, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0xDC, 0x8D, 0x9D, 0xAD, 0xBD,
-    0xCD, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xB7,
-    0xA8, 0xB8, 0xC8, 0x99, 0xA9, 0xB9, 0xC9, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA,
-    0xFA, 0x6B, 0x7B, 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xFB, 0x9C, 0xAC, 0xBC,
-    0xCC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xCE, 0xDE, 0xEE, 0xFE, 0xAF, 0xBF,
-    0xCF, 0xDF, 0xEF, 0xFF
-};
-
-static const uint8_t huff_b26_cb[12] = {
-    3, 12, 2, 2, 4, 5, 11, 26, 67, 78, 51, 10
-};
-
-static const uint8_t huff_b26_xlat[256] = {
-    0x00, 0x01, 0x10, 0x11, 0x20, 0x21, 0x02, 0x12, 0x30, 0x31, 0x22, 0x03,
-    0x13, 0x40, 0x41, 0x51, 0x32, 0x42, 0x23, 0x33, 0x04, 0x14, 0x24, 0x15,
-    0x50, 0x61, 0x71, 0xD1, 0xE1, 0x52, 0x62, 0xD2, 0x43, 0x53, 0xD3, 0x34,
-    0x44, 0x05, 0x25, 0x35, 0x06, 0x16, 0x26, 0x17, 0x18, 0x1D, 0x2D, 0x3D,
-    0x1E, 0x2E, 0x60, 0x70, 0x80, 0xD0, 0xE0, 0xF0, 0x81, 0x91, 0xA1, 0xC1,
-    0xF1, 0x72, 0x82, 0x92, 0xC2, 0xE2, 0xF2, 0x63, 0x73, 0xE3, 0xF3, 0x54,
-    0x64, 0x74, 0xD4, 0xE4, 0xF4, 0x45, 0x55, 0x65, 0xD5, 0xE5, 0xF5, 0x36,
-    0x46, 0x56, 0xD6, 0xE6, 0x07, 0x27, 0x37, 0x47, 0xD7, 0x08, 0x28, 0x38,
-    0x19, 0x29, 0x1A, 0x1B, 0x1C, 0x2C, 0x0D, 0x4D, 0x5D, 0x6D, 0x7D, 0x0E,
-    0x3E, 0x4E, 0x5E, 0x6E, 0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x90, 0xA0, 0xC0,
-    0xB1, 0xA2, 0xB2, 0x83, 0x93, 0xA3, 0xB3, 0xC3, 0x84, 0x94, 0xA4, 0xC4,
-    0x75, 0x85, 0x95, 0xC5, 0x66, 0x76, 0x86, 0x96, 0xC6, 0xF6, 0x57, 0x67,
-    0x77, 0xE7, 0xF7, 0x48, 0x58, 0x68, 0x78, 0xD8, 0xE8, 0xF8, 0x09, 0x39,
-    0x49, 0x59, 0xD9, 0xE9, 0xF9, 0x0A, 0x2A, 0x3A, 0x4A, 0xDA, 0xEA, 0x0B,
-    0x2B, 0x3B, 0xDB, 0xEB, 0x0C, 0x3C, 0x4C, 0x5C, 0x6C, 0xDC, 0x8D, 0x9D,
-    0xAD, 0xBD, 0xCD, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0x5F, 0x6F, 0x7F,
-    0x8F, 0x9F, 0xAF, 0xB0, 0xB4, 0xA5, 0xB5, 0xA6, 0xB6, 0x87, 0x97, 0xA7,
-    0xB7, 0xC7, 0x88, 0x98, 0xA8, 0xC8, 0x69, 0x79, 0x89, 0x99, 0xA9, 0xC9,
-    0x5A, 0x6A, 0x7A, 0x9A, 0xCA, 0xFA, 0x4B, 0x5B, 0x6B, 0x7B, 0xCB, 0xFB,
-    0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xEC, 0xFC, 0xDD, 0xED, 0xFD, 0xDE,
-    0xEE, 0xFE, 0xBF, 0xCF, 0xDF, 0xEF, 0xB8, 0xB9, 0x8A, 0xAA, 0xBA, 0x8B,
-    0x9B, 0xAB, 0xBB, 0xFF
-};
-
-static const uint8_t huff_b32_cb[12] = {
-    2, 11, 1, 0, 4, 6, 7, 10, 22, 11, 16, 4
-};
-
-static const uint8_t huff_b32_xlat[81] = {
-    0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x41, 0x11, 0x05, 0x80,
-    0x54, 0x51, 0x45, 0x15, 0x55, 0x02, 0x90, 0x20, 0x60, 0x84, 0x24, 0x08,
-    0x18, 0x09, 0x12, 0x06, 0xA0, 0x94, 0x64, 0x48, 0x58, 0x81, 0x91, 0x21,
-    0x61, 0x85, 0x95, 0x25, 0x65, 0x49, 0x19, 0x59, 0x42, 0x52, 0x46, 0x16,
-    0x56, 0x0A, 0xA4, 0x28, 0x68, 0xA1, 0xA5, 0x29, 0x69, 0x26, 0x4A, 0x1A,
-    0x5A, 0x88, 0x98, 0xA8, 0x89, 0x99, 0xA9, 0x82, 0x92, 0x22, 0x62, 0x86,
-    0x96, 0x66, 0x9A, 0x2A, 0x6A, 0xA2, 0xA6, 0x8A, 0xAA
-};
-
-static const uint8_t huff_b33_cb[13] = {
-    2, 12, 1, 0, 0, 4, 11, 8, 28, 92, 97, 13, 2
-};
-
-static const uint8_t huff_b33_xlat[256] = {
-    0x00, 0x40, 0x10, 0x04, 0x01, 0x50, 0x44, 0x14, 0x54, 0x41, 0x11, 0x51,
-    0x05, 0x45, 0x15, 0x55, 0x20, 0x95, 0x65, 0x49, 0x59, 0x52, 0x46, 0x16,
-    0x80, 0x90, 0x60, 0x84, 0x94, 0x24, 0x64, 0xA4, 0x08, 0x48, 0x18, 0x58,
-    0x81, 0x91, 0x21, 0x61, 0x85, 0x25, 0x09, 0x19, 0x69, 0x02, 0x42, 0x12,
-    0x06, 0x56, 0x5A, 0x57, 0xD0, 0x74, 0x68, 0x5C, 0xC1, 0xD5, 0xA5, 0xE5,
-    0x75, 0xB5, 0xF5, 0x99, 0xD9, 0xA9, 0xE9, 0x79, 0xB9, 0xF9, 0x1D, 0x5D,
-    0x9D, 0xDD, 0x6D, 0xAD, 0xED, 0x7D, 0xBD, 0xFD, 0x82, 0x92, 0xD2, 0x62,
-    0x96, 0xD6, 0x26, 0x66, 0xA6, 0xE6, 0x76, 0xB6, 0xF6, 0x0A, 0x4A, 0x1A,
-    0x9A, 0xDA, 0x2A, 0x6A, 0xAA, 0xEA, 0x7A, 0xBA, 0xFA, 0x5E, 0x9E, 0xDE,
-    0x6E, 0xAE, 0xEE, 0x7E, 0xBE, 0xFE, 0x03, 0x13, 0x53, 0x17, 0x97, 0xD7,
-    0x67, 0xA7, 0xE7, 0x77, 0xB7, 0xF7, 0x5B, 0x9B, 0xDB, 0x6B, 0xAB, 0xEB,
-    0x7B, 0xBB, 0xFB, 0x5F, 0x9F, 0xDF, 0x6F, 0xAF, 0xEF, 0x7F, 0xBF, 0xFF,
-    0xC0, 0xA0, 0xE0, 0x30, 0xC4, 0xD4, 0xE4, 0x34, 0xB4, 0xF4, 0x88, 0xC8,
-    0x98, 0xD8, 0x28, 0xA8, 0xE8, 0x38, 0x78, 0xB8, 0xF8, 0x0C, 0x4C, 0x1C,
-    0x9C, 0xDC, 0x6C, 0xAC, 0xEC, 0x7C, 0xBC, 0xFC, 0xD1, 0xA1, 0xE1, 0x31,
-    0x71, 0xB1, 0xF1, 0xC5, 0x35, 0x89, 0xC9, 0x29, 0x39, 0x0D, 0x4D, 0x8D,
-    0xCD, 0x2D, 0x3D, 0x22, 0xA2, 0xE2, 0x72, 0xB2, 0xF2, 0x86, 0xC6, 0x36,
-    0x8A, 0xCA, 0x3A, 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x2E, 0x3E, 0x43, 0x83,
-    0x93, 0xD3, 0x23, 0x63, 0xA3, 0xE3, 0x73, 0xB3, 0xF3, 0x07, 0x47, 0x87,
-    0xC7, 0x27, 0x37, 0x4B, 0x8B, 0xCB, 0x1B, 0x2B, 0x3B, 0x4F, 0x8F, 0xCF,
-    0x1F, 0x70, 0xB0, 0xF0, 0x8C, 0xCC, 0x2C, 0x3C, 0xC2, 0x32, 0xC3, 0x0F,
-    0x2F, 0x3F, 0x33, 0x0B
-};
-
-static const uint8_t huff_b35_cb[14] = {
-    1, 12, 1, 0, 0, 0, 4, 6, 6, 14, 42, 63, 59, 30
-};
-
-static const uint8_t huff_b35_xlat[225] = {
-    0x00, 0x10, 0xF0, 0x01, 0x0F, 0x11, 0xF1, 0x02, 0x0E, 0x1F, 0xFF, 0x20,
-    0xE0, 0x21, 0xF2, 0xFE, 0xEF, 0x30, 0xD0, 0xE1, 0x12, 0x22, 0xE2, 0x03,
-    0x0D, 0x1D, 0x1E, 0x2E, 0xEE, 0x2F, 0xDF, 0x40, 0x60, 0x70, 0x90, 0xA0,
-    0xB0, 0xC0, 0x31, 0x71, 0x91, 0xC1, 0xD1, 0x32, 0xD2, 0x13, 0xE3, 0xF3,
-    0x04, 0x05, 0x06, 0x07, 0x17, 0xF7, 0x09, 0x19, 0x0A, 0x1A, 0xFA, 0x0C,
-    0x1C, 0x2D, 0xED, 0xFD, 0x3E, 0x7E, 0xDE, 0x3F, 0x6F, 0x7F, 0x9F, 0xAF,
-    0xCF, 0x50, 0x41, 0x51, 0x61, 0xA1, 0xB1, 0x62, 0x72, 0x92, 0xA2, 0xC2,
-    0x23, 0x33, 0x63, 0x73, 0x93, 0xA3, 0xD3, 0x14, 0x24, 0x34, 0xD4, 0xE4,
-    0xF4, 0x15, 0xF5, 0x16, 0x26, 0xD6, 0xE6, 0xF6, 0x27, 0x37, 0x47, 0xE7,
-    0x29, 0x39, 0xC9, 0xD9, 0xE9, 0xF9, 0x2A, 0xEA, 0x0B, 0x1B, 0xFB, 0x2C,
-    0x7C, 0xEC, 0xFC, 0x3D, 0x4D, 0x6D, 0x7D, 0xDD, 0x4E, 0x5E, 0x6E, 0x9E,
-    0xAE, 0xCE, 0x4F, 0x5F, 0x42, 0x52, 0xB2, 0x43, 0xB3, 0xC3, 0x44, 0x64,
-    0x74, 0x94, 0xA4, 0x25, 0x35, 0x65, 0x75, 0x95, 0xA5, 0xE5, 0x36, 0x46,
-    0x66, 0x76, 0x96, 0xA6, 0xB6, 0xC6, 0x57, 0xA7, 0xB7, 0xC7, 0xD7, 0x59,
-    0xA9, 0xB9, 0x3A, 0x4A, 0x6A, 0xCA, 0xDA, 0x2B, 0x3B, 0x6B, 0x9B, 0xAB,
-    0xDB, 0xEB, 0x3C, 0x6C, 0x9C, 0xAC, 0xCC, 0xDC, 0x5D, 0x9D, 0xAD, 0xBD,
-    0xCD, 0xBE, 0xBF, 0x53, 0x54, 0xB4, 0xC4, 0x45, 0x55, 0xB5, 0xC5, 0xD5,
-    0x56, 0x67, 0x77, 0x97, 0x49, 0x69, 0x79, 0x99, 0x5A, 0x7A, 0x9A, 0xAA,
-    0xBA, 0x4B, 0x5B, 0x7B, 0xBB, 0xCB, 0x4C, 0x5C, 0xBC
-};
-
-static const uint8_t huff_b37_cb[13] = {
-    1, 11, 1, 0, 2, 0, 2, 2, 6, 17, 14, 13, 6
-};
-
-static const uint8_t huff_b37_xlat[63] = {
-     0,  1, 63,  2, 62,  3, 61,  4,  5,  6, 58, 59, 60,  7,  8,  9,
-    10, 25, 26, 27, 28, 29, 34, 35, 37, 38, 39, 55, 56, 57, 11, 13,
-    14, 15, 30, 31, 33, 36, 49, 50, 51, 52, 53, 54, 12, 16, 17, 18,
-    19, 21, 41, 43, 44, 45, 46, 47, 48, 20, 22, 23, 24, 40, 42
-};
-
-static const uint8_t huff_b41_cb[14] = {
-    1, 12, 1, 0, 0, 1, 7, 0, 20, 4, 10, 24, 2, 12
-};
-
-static const uint8_t huff_b41_xlat[81] = {
-    0x00, 0x01, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x03, 0x50, 0xD0, 0x70,
-    0xF0, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0xC1, 0x11, 0x31, 0x05, 0x0D,
-    0xC3, 0x13, 0x33, 0x07, 0x0F, 0x44, 0xCC, 0x41, 0x43, 0x54, 0x74, 0xDC,
-    0xFC, 0x71, 0x15, 0x4D, 0x1D, 0x37, 0x3F, 0xD4, 0xF4, 0x5C, 0x7C, 0x51,
-    0xD1, 0xF1, 0x45, 0xC5, 0x35, 0xCD, 0xDD, 0x3D, 0x53, 0xD3, 0x73, 0xF3,
-    0x47, 0xC7, 0x17, 0x77, 0x4F, 0xCF, 0x1F, 0x55, 0xFF, 0xD5, 0x75, 0xF5,
-    0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F
-};
-
-static const uint8_t huff_b42_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 };
-
-static const uint8_t huff_b42_xlat[25] = {
-    0x00, 0x07, 0x08, 0x38, 0x01, 0x39, 0x0F, 0x10, 0x09, 0x3F, 0x30, 0x31,
-    0x02, 0x3A, 0x06, 0x0E, 0x17, 0x11, 0x0A, 0x3E, 0x37, 0x12, 0x32, 0x16,
-    0x36
-};
-
-static const uint8_t huff_b43_cb[10] = { 2, 9, 1, 1, 3, 4, 9, 15, 12, 4 };
-
-static const uint8_t huff_b43_xlat[49] = {
-    0x00, 0x07, 0x08, 0x38, 0x01, 0x09, 0x39, 0x0F, 0x3F, 0x10, 0x30, 0x31,
-    0x02, 0x3A, 0x06, 0x0E, 0x17, 0x37, 0x18, 0x28, 0x11, 0x19, 0x29, 0x0A,
-    0x03, 0x0B, 0x3B, 0x05, 0x0D, 0x3D, 0x3E, 0x1F, 0x2F, 0x12, 0x1A, 0x2A,
-    0x32, 0x13, 0x33, 0x15, 0x35, 0x16, 0x1E, 0x2E, 0x36, 0x1B, 0x2B, 0x1D,
-    0x2D
-};
-
-static const uint8_t huff_b47_cb[10] = { 2, 9, 1, 1, 3, 4, 6, 14, 22, 12 };
-
-static const uint8_t huff_b47_xlat[63] = {
-     0,  1,  2, 62, 63,  3,  4, 60, 61,  5,  6,  7, 57, 58, 59,  8,
-     9, 10, 11, 12, 26, 27, 37, 38, 52, 53, 54, 55, 56, 13, 14, 15,
-    16, 17, 18, 25, 28, 29, 30, 31, 33, 34, 35, 36, 39, 46, 47, 48,
-    49, 50, 51, 19, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 45
-};
-
-static const uint8_t huff_b52_cb[11] = { 1, 9, 1, 0, 1, 3, 2, 3, 7, 4, 4 };
-
-static const uint8_t huff_b52_xlat[25] = {
-    0x00, 0x01, 0x08, 0x38, 0x07, 0x39, 0x0F, 0x30, 0x09, 0x3F, 0x10, 0x31,
-    0x02, 0x3A, 0x06, 0x0E, 0x17, 0x11, 0x0A, 0x3E, 0x37, 0x12, 0x32, 0x16,
-    0x36
-};
-
-static const uint8_t huff_b53_cb[7] = { 1, 5, 1, 1, 1, 0, 4 }; // same as b63!!!
-
-static const uint8_t huff_b53_xlat[7] = { 0, 7, 1, 2, 3, 5, 6 };
-
-static const uint8_t huff_b56_cb[11] = { 1, 9, 1, 0, 2, 0, 2, 4, 11, 9, 2 };
-
-static const uint8_t huff_b56_xlat[31] = {
-     0,  1, 31,  2, 30, 3,  4, 13, 29,  5,  6,  7, 14, 15, 17, 18,
-    19, 26, 27, 28,  8, 9, 12, 20, 21, 22, 23, 24, 25, 10, 11
-};
-
-static const uint8_t huff_b62_cb[14] = {
-    1, 12, 1, 0, 0, 2, 3, 5, 12, 14, 18, 15, 9, 2
-};
-
-static const uint8_t huff_b62_xlat[81] = {
-    0x00, 0x40, 0x01, 0x10, 0x04, 0x02, 0x80, 0x50, 0x90, 0x05, 0x06, 0x20,
-    0x60, 0x44, 0x14, 0x54, 0x24, 0x08, 0x18, 0x41, 0x11, 0x15, 0x09, 0xA0,
-    0x84, 0x94, 0x64, 0xA4, 0x28, 0x51, 0x45, 0x55, 0x19, 0x12, 0x16, 0x0A,
-    0x1A, 0x48, 0x58, 0x68, 0x81, 0x91, 0x21, 0x61, 0x85, 0x95, 0x25, 0x65,
-    0x49, 0x59, 0x29, 0x69, 0x42, 0x46, 0x56, 0x88, 0x98, 0xA8, 0xA1, 0xA5,
-    0x99, 0xA9, 0x52, 0x22, 0x26, 0x66, 0x4A, 0x5A, 0x2A, 0x6A, 0x89, 0x82,
-    0x92, 0x62, 0x86, 0x96, 0xA6, 0x8A, 0xAA, 0xA2, 0x9A
-};
-
-static const uint8_t huff_b63_cb[7] = { 1, 5, 1, 1, 1, 0, 4 };
-
-static const uint8_t huff_b63_xlat[7] = { 0, 1, 7, 2, 3, 5, 6 };
-
-static const uint8_t huff_b64_cb[7] = { 1, 5, 1, 1, 1, 1, 2 };
-
-static const uint8_t huff_b64_xlat[6] = { 1, 0, 2, 5, 3, 4 };
-
-static const uint8_t huff_b65_cb[14] = {
-    1, 12, 1, 0, 0, 2, 2, 2, 6, 12, 34, 92, 54, 20
-};
-
-static const uint8_t huff_b65_xlat[225] = {
-    0x00, 0xF0, 0x01, 0x10, 0x0F, 0x11, 0xF1, 0x20, 0xE0, 0x02, 0x0E, 0x1F,
-    0xFF, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x07, 0x0A, 0x0D, 0x1E, 0xFE, 0x2F,
-    0xEF, 0x30, 0x70, 0x90, 0xA0, 0xC0, 0x71, 0x91, 0xC1, 0xD1, 0x32, 0x92,
-    0xE2, 0x03, 0x13, 0x63, 0x04, 0x06, 0xE6, 0xE7, 0xF7, 0x09, 0x19, 0x39,
-    0xFA, 0x0C, 0x1C, 0xDD, 0xED, 0xFD, 0x2E, 0x7E, 0x9E, 0x3F, 0x9F, 0x40,
-    0x50, 0x60, 0xB0, 0x31, 0x41, 0x61, 0xA1, 0xB1, 0x22, 0x42, 0x72, 0xA2,
-    0xB2, 0xC2, 0xD2, 0x23, 0x33, 0x73, 0xA3, 0xC3, 0xD3, 0xE3, 0xF3, 0x14,
-    0x24, 0x34, 0x44, 0x74, 0xD4, 0xE4, 0x05, 0x25, 0x45, 0x65, 0x95, 0xA5,
-    0x16, 0x26, 0x46, 0x76, 0xA6, 0xB6, 0xC6, 0xD6, 0xF6, 0x17, 0x27, 0x37,
-    0x47, 0x67, 0xA7, 0xD7, 0x29, 0x69, 0xB9, 0xD9, 0xE9, 0xF9, 0x1A, 0x2A,
-    0x3A, 0x9A, 0xCA, 0xDA, 0xEA, 0x0B, 0x1B, 0x3B, 0x6B, 0xEB, 0xFB, 0x2C,
-    0x6C, 0xEC, 0xFC, 0x1D, 0x2D, 0x4D, 0x6D, 0x9D, 0xAD, 0x3E, 0x4E, 0x6E,
-    0xAE, 0xCE, 0xEE, 0x4F, 0x5F, 0x6F, 0xDF, 0x51, 0x52, 0x62, 0x43, 0x93,
-    0xB3, 0x54, 0x94, 0xA4, 0xF4, 0x15, 0x75, 0xB5, 0xE5, 0xF5, 0x36, 0x56,
-    0x66, 0x96, 0x57, 0x77, 0x49, 0x59, 0xA9, 0xC9, 0x4A, 0x5A, 0x6A, 0x7A,
-    0xAA, 0xBA, 0x2B, 0x4B, 0x7B, 0x9B, 0xAB, 0xDB, 0x3C, 0x4C, 0x7C, 0x9C,
-    0xAC, 0xBC, 0xCC, 0x3D, 0x5D, 0x7D, 0xBD, 0xCD, 0x5E, 0xBE, 0xDE, 0xBF,
-    0xCF, 0x53, 0x64, 0xB4, 0xC4, 0x35, 0x55, 0xC5, 0xD5, 0x97, 0xB7, 0xC7,
-    0x79, 0x99, 0x5B, 0xBB, 0xCB, 0x5C, 0xDC, 0x7F, 0xAF
-};
-
-static const uint8_t huff_b66_cb[14] = {
-    1, 12, 1, 0, 0, 3, 0, 3, 3, 10, 40, 85, 61, 50
-};
-
-static const uint8_t huff_b66_xlat[256] = {
-    0x00, 0x10, 0x01, 0x11, 0x21, 0x02, 0x12, 0x20, 0x22, 0x13, 0x30, 0x31,
-    0x41, 0xD1, 0xE1, 0x32, 0x52, 0x03, 0x23, 0x2D, 0x40, 0x50, 0x60, 0x80,
-    0xD0, 0xE0, 0x51, 0x61, 0xF1, 0x42, 0x62, 0xD2, 0xE2, 0xF2, 0x33, 0x43,
-    0xC3, 0xD3, 0xE3, 0x04, 0x14, 0xD4, 0xF4, 0x25, 0x35, 0x16, 0x17, 0xF7,
-    0xD8, 0x1C, 0x3C, 0x0D, 0x1D, 0x3D, 0x5D, 0x0E, 0x1E, 0x2E, 0x7E, 0x2F,
-    0xC0, 0xF0, 0x71, 0x81, 0x91, 0xC1, 0x72, 0x82, 0x92, 0xB2, 0xC2, 0x53,
-    0x63, 0x73, 0x93, 0xA3, 0xF3, 0x24, 0x44, 0x64, 0x84, 0xA4, 0xB4, 0x05,
-    0x15, 0x95, 0xD5, 0x06, 0x26, 0x36, 0x46, 0x96, 0xD6, 0xE6, 0xF6, 0x07,
-    0x27, 0x37, 0xD7, 0xE7, 0x08, 0x18, 0x28, 0x38, 0xE8, 0xF8, 0x09, 0x19,
-    0x29, 0xE9, 0xF9, 0x0A, 0x1A, 0xCA, 0xDA, 0xEA, 0x0B, 0x1B, 0xDB, 0xEB,
-    0xFB, 0x2C, 0x4C, 0x5C, 0x7C, 0x8C, 0x4D, 0x6D, 0x8D, 0x9D, 0xFD, 0x3E,
-    0x5E, 0x6E, 0x8E, 0x9E, 0xEE, 0x0F, 0x1F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F,
-    0xCF, 0x70, 0xA1, 0xA2, 0x83, 0xB3, 0x34, 0x74, 0xC4, 0xE4, 0x55, 0x65,
-    0x85, 0xA5, 0xC5, 0xE5, 0xF5, 0x56, 0x66, 0x76, 0x86, 0xA6, 0xC6, 0x57,
-    0x67, 0x77, 0x97, 0xA7, 0x48, 0x88, 0x98, 0x49, 0x59, 0x79, 0x99, 0x3A,
-    0x4A, 0x8A, 0xBA, 0xFA, 0x2B, 0x7B, 0x0C, 0xAC, 0xBC, 0xCC, 0xEC, 0x7D,
-    0xAD, 0xBD, 0xDD, 0x4E, 0xBE, 0xCE, 0xFE, 0x8F, 0x9F, 0xAF, 0xBF, 0xDF,
-    0xEF, 0xFF, 0x90, 0xA0, 0xB0, 0xB1, 0x54, 0x94, 0x45, 0x75, 0xB5, 0xB6,
-    0x47, 0x87, 0xB7, 0xC7, 0x58, 0x68, 0x78, 0xA8, 0xB8, 0xC8, 0x39, 0x69,
-    0x89, 0xA9, 0xB9, 0xC9, 0xD9, 0x2A, 0x5A, 0x6A, 0x7A, 0x9A, 0xAA, 0x3B,
-    0x4B, 0x5B, 0x6B, 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0x6C, 0x9C, 0xDC, 0xFC,
-    0xCD, 0xED, 0xAE, 0xDE
-};
-
-static const uint8_t huff_b67_cb[10] = { 2, 9, 1, 2, 1, 4, 7, 10, 26, 12 };
-
-static const uint8_t huff_b67_xlat[63] = {
-     0,  1, 63, 62,  2,  3, 60, 61,  4,  5,  6,  7, 57, 58, 59,  8,
-     9, 10, 11, 12, 52, 53, 54, 55, 56, 13, 14, 15, 16, 17, 18, 25,
-    26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 46, 47, 48,
-    49, 50, 51, 19, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 45
-};
-
-static const uint8_t huff_b71_cb[14] = {
-    1, 12, 1, 0, 0, 1, 7, 0, 19, 5, 13, 23, 0, 12
-};
-
-static const uint8_t huff_b71_xlat[81] = {
-    0x00, 0x03, 0x40, 0xC0, 0x10, 0x30, 0x04, 0x0C, 0x01, 0x50, 0xD0, 0x70,
-    0xF0, 0xC4, 0x14, 0x34, 0x4C, 0x1C, 0x3C, 0xC1, 0x11, 0x31, 0x05, 0x0D,
-    0x13, 0x33, 0x07, 0x0F, 0x44, 0xCC, 0x41, 0x43, 0xC3, 0x54, 0x74, 0xDC,
-    0xFC, 0xF1, 0xC5, 0x15, 0x1D, 0x53, 0xC7, 0x37, 0x4F, 0x3F, 0xD4, 0xF4,
-    0x5C, 0x7C, 0x51, 0xD1, 0x71, 0x45, 0x55, 0x35, 0x4D, 0xCD, 0xDD, 0x3D,
-    0xD3, 0x73, 0xF3, 0x47, 0x17, 0x77, 0xCF, 0x1F, 0xFF, 0xD5, 0x75, 0xF5,
-    0x5D, 0x7D, 0xFD, 0x57, 0xD7, 0xF7, 0x5F, 0xDF, 0x7F
-};
-
-static const uint8_t huff_b73_cb[13] = {
-    1, 11, 1, 0, 0, 0, 1, 4, 9, 4, 103, 110, 24
-};
-
-static const uint8_t huff_b73_xlat[256] = {
-    0x00, 0x40, 0x10, 0x04, 0x01, 0x05, 0x50, 0x14, 0x54, 0x41, 0x11, 0x51,
-    0x45, 0x15, 0x55, 0x44, 0x95, 0x6A, 0x03, 0x80, 0xC0, 0x90, 0xD0, 0x94,
-    0xD4, 0x24, 0x64, 0x58, 0x91, 0xA1, 0x85, 0xD5, 0x25, 0x65, 0xA5, 0xE5,
-    0x75, 0xB5, 0xF5, 0x19, 0x59, 0x99, 0xD9, 0x69, 0xA9, 0xE9, 0x79, 0xB9,
-    0xF9, 0x4D, 0x5D, 0x9D, 0xDD, 0x6D, 0xAD, 0xED, 0x7D, 0xBD, 0xFD, 0x02,
-    0x42, 0x52, 0x06, 0x46, 0x16, 0x56, 0x96, 0xD6, 0x26, 0x66, 0xA6, 0xE6,
-    0x76, 0xB6, 0xF6, 0x1A, 0x5A, 0x9A, 0xDA, 0xAA, 0xEA, 0x7A, 0xBA, 0xFA,
-    0x5E, 0x9E, 0xDE, 0x6E, 0xAE, 0xEE, 0x7E, 0xBE, 0xFE, 0x07, 0x47, 0x57,
-    0x97, 0xD7, 0x67, 0xA7, 0xE7, 0x77, 0xB7, 0xF7, 0x5B, 0x9B, 0xDB, 0x6B,
-    0xAB, 0xEB, 0x7B, 0xBB, 0xFB, 0x5F, 0x9F, 0xDF, 0x6F, 0xAF, 0xEF, 0x7F,
-    0xBF, 0xFF, 0x20, 0x60, 0x70, 0xB0, 0xF0, 0x84, 0xC4, 0xA4, 0xE4, 0x74,
-    0xB4, 0xF4, 0x08, 0x88, 0x18, 0x98, 0xD8, 0x68, 0xA8, 0xE8, 0x78, 0xB8,
-    0xF8, 0x1C, 0x5C, 0x9C, 0xDC, 0x6C, 0xAC, 0xEC, 0x3C, 0x7C, 0xBC, 0xFC,
-    0x81, 0xD1, 0x21, 0x61, 0xE1, 0x71, 0xB1, 0xF1, 0xC5, 0x35, 0x09, 0x49,
-    0x89, 0xC9, 0x29, 0x39, 0x0D, 0x8D, 0xCD, 0x1D, 0x2D, 0x3D, 0x92, 0xD2,
-    0x22, 0x62, 0xA2, 0xE2, 0x72, 0xB2, 0xF2, 0x86, 0xC6, 0x36, 0x0A, 0x4A,
-    0x8A, 0xCA, 0x2A, 0x3A, 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x2E, 0x3E, 0x13,
-    0x53, 0x93, 0xD3, 0x63, 0xA3, 0xE3, 0x73, 0xB3, 0xF3, 0x87, 0xC7, 0x17,
-    0x27, 0x37, 0x0B, 0x4B, 0x8B, 0xCB, 0x1B, 0x2B, 0x3B, 0x0F, 0x4F, 0x8F,
-    0xCF, 0x1F, 0x2F, 0x3F, 0xA0, 0xE0, 0x30, 0x34, 0x48, 0xC8, 0x28, 0x38,
-    0x0C, 0x4C, 0x8C, 0xCC, 0x2C, 0xC1, 0x31, 0x82, 0xC2, 0x12, 0x32, 0x43,
-    0x83, 0xC3, 0x23, 0x33
-};
-
-static const uint8_t huff_b74_cb[8] = { 1, 6, 1, 0, 2, 2, 2, 4 };
-
-static const uint8_t huff_b74_xlat[11] = {
-    0, 1, 15, 2, 14, 5, 13, 3, 4, 11, 12
-};
-
-static const uint8_t huff_b75_cb[13] = {
-    2, 12, 1, 4, 0, 0, 0, 8, 11, 24, 53, 64, 60
-};
-
-static const uint8_t huff_b75_xlat[225] = {
-    0x00, 0x10, 0xF0, 0x01, 0x0F, 0x20, 0xE0, 0x11, 0xF1, 0x02, 0x0E, 0x1F,
-    0xFF, 0xD0, 0x21, 0xE1, 0x12, 0xF2, 0x03, 0x0D, 0x1E, 0xFE, 0x2F, 0xEF,
-    0x30, 0x40, 0x60, 0x70, 0x90, 0xA0, 0xC0, 0x31, 0xD1, 0x22, 0xE2, 0x13,
-    0xF3, 0x04, 0x06, 0x07, 0x09, 0x0C, 0x1D, 0xFD, 0x2E, 0xEE, 0x3F, 0xDF,
-    0x50, 0xB0, 0x41, 0x61, 0x71, 0x91, 0xA1, 0xC1, 0x32, 0x62, 0x72, 0x92,
-    0xA2, 0xD2, 0x23, 0xD3, 0xE3, 0x14, 0xF4, 0x05, 0x16, 0x26, 0xE6, 0xF6,
-    0x17, 0x27, 0xE7, 0xF7, 0x19, 0x29, 0xF9, 0x0A, 0x1A, 0x2A, 0xFA, 0x0B,
-    0x1C, 0x2C, 0xFC, 0x2D, 0x3D, 0xED, 0x3E, 0x4E, 0x7E, 0x9E, 0xDE, 0x4F,
-    0x6F, 0x7F, 0x9F, 0xAF, 0xCF, 0x51, 0xB1, 0x42, 0x52, 0xB2, 0xC2, 0x33,
-    0x63, 0x73, 0x93, 0xA3, 0xB3, 0xC3, 0x24, 0x34, 0x74, 0xA4, 0xD4, 0xE4,
-    0x15, 0x25, 0x65, 0x95, 0xE5, 0xF5, 0x36, 0xD6, 0x37, 0x47, 0xC7, 0xD7,
-    0x39, 0x59, 0xB9, 0xC9, 0xD9, 0xE9, 0x3A, 0x6A, 0xDA, 0xEA, 0x1B, 0x2B,
-    0x9B, 0xAB, 0xEB, 0xFB, 0x6C, 0x7C, 0x9C, 0xAC, 0xEC, 0x4D, 0x6D, 0x7D,
-    0x9D, 0xAD, 0xBD, 0xDD, 0x5E, 0x6E, 0xAE, 0xCE, 0x5F, 0x43, 0x53, 0x44,
-    0x54, 0x64, 0x94, 0xB4, 0xC4, 0x35, 0x45, 0x55, 0x75, 0xA5, 0xB5, 0xC5,
-    0xD5, 0x46, 0x56, 0x66, 0x76, 0x96, 0xA6, 0xB6, 0xC6, 0x57, 0x67, 0x77,
-    0x97, 0xA7, 0xB7, 0x49, 0x69, 0x79, 0x99, 0xA9, 0x4A, 0x5A, 0x7A, 0x9A,
-    0xAA, 0xBA, 0xCA, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0xBB, 0xCB, 0xDB, 0x3C,
-    0x4C, 0x5C, 0xBC, 0xCC, 0xDC, 0x5D, 0xCD, 0xBE, 0xBF
-};
-
-static const uint8_t huff_b77_cb[12] = {
-    2, 11, 1, 0, 4, 6, 10, 12, 7, 15, 4, 4
-};
-
-static const uint8_t huff_b77_xlat[63] = {
-     0,  1,  2, 62, 63,  3,  4,  5, 59, 60, 61,  6,  7,  8,  9, 10,
-    54, 55, 56, 57, 58, 11, 12, 13, 14, 15, 16, 47, 49, 50, 51, 52,
-    53, 17, 18, 19, 20, 45, 46, 48, 21, 22, 23, 24, 25, 26, 27, 37,
-    38, 39, 40, 41, 42, 43, 44, 28, 29, 30, 35, 31, 33, 34, 36
-};
-
-/** Tables for spectrum coding. */
-typedef struct Atrac3pSpecCodeTab {
-    uint8_t group_size;  ///< number of coefficients grouped together
-    uint8_t num_coeffs;  ///< 1 - map index to a single value, > 1 - map index to a vector of values
-    uint8_t bits;        ///< number of bits a single coefficient occupy
-    uint8_t is_signed;   ///< 1 - values in that table are signed ones, otherwise - absolute ones
-
-    int redirect;        ///< if >= 0: tells which huffman table must be reused
-    const uint8_t *cb;   ///< pointer to the codebook descriptor
-    const uint8_t *xlat; ///< pointer to the translation table or NULL if none
-} Atrac3pSpecCodeTab;
-
-static const Atrac3pSpecCodeTab atrac3p_spectra_tabs[112] = {
-    /* table set = A */
-    /* code table = 0 */
-    { 1, 4, 2, 1, -1, huff_a01_cb, huff_a01_xlat }, // wordlen = 1
-    { 1, 4, 2, 0, -1, huff_a02_cb, huff_a02_xlat }, // wordlen = 2
-    { 1, 2, 3, 1, -1, huff_a03_cb, huff_a03_xlat }, // wordlen = 3
-    { 1, 1, 3, 0, -1, huff_a04_cb, huff_a04_xlat }, // wordlen = 4
-    { 1, 2, 4, 1, -1, huff_a05_cb, huff_a05_xlat }, // wordlen = 5
-    { 1, 1, 4, 0, -1, huff_a06_cb, huff_a06_xlat }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_a07_cb, huff_a07_xlat }, // wordlen = 7
-
-    /* code table = 1 */
-    { 4, 4, 2, 1, -1, huff_a11_cb, huff_a11_xlat }, // wordlen = 1
-    { 1, 4, 2, 0, -1, huff_a12_cb, huff_a12_xlat }, // wordlen = 2
-    { 1, 2, 3, 1, -1, huff_a13_cb, huff_a13_xlat }, // wordlen = 3
-    { 1, 2, 4, 1, -1, huff_a14_cb, huff_a14_xlat }, // wordlen = 4
-    { 1, 2, 4, 1, -1, huff_a15_cb, huff_a15_xlat }, // wordlen = 5
-    { 1, 2, 4, 0, -1, huff_a16_cb, huff_a16_xlat }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_a17_cb, huff_a17_xlat }, // wordlen = 7
-
-    /* code table = 2 */
-    { 1, 4, 2, 1, -1, huff_a21_cb, huff_a21_xlat }, // wordlen = 1
-    { 1, 2, 3, 1, -1, huff_a22_cb, huff_a22_xlat }, // wordlen = 2
-    { 1, 2, 3, 1, -1, huff_a23_cb, huff_a23_xlat }, // wordlen = 3
-    { 1, 1, 3, 0, -1, huff_a24_cb, NULL          }, // wordlen = 4
-    { 1, 1, 3, 0, -1, huff_a25_cb, huff_a25_xlat }, // wordlen = 5
-    { 1, 2, 4, 0, -1, huff_a26_cb, huff_a26_xlat }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_a27_cb, huff_a27_xlat }, // wordlen = 7
-
-    /* code table = 3 */
-    { 1, 2, 2, 1, -1, huff_a31_cb, huff_a31_xlat }, // wordlen = 1
-    { 1, 4, 2, 0, -1, huff_a32_cb, huff_a32_xlat }, // wordlen = 2
-    { 1, 4, 2, 0, -1, huff_a33_cb, huff_a33_xlat }, // wordlen = 3
-    { 1, 1, 3, 0, -1, huff_a34_cb, huff_a34_xlat }, // wordlen = 4
-    { 1, 2, 4, 1, -1, huff_a35_cb, huff_a35_xlat }, // wordlen = 5
-    { 1, 2, 4, 0, -1, huff_a36_cb, huff_a36_xlat }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_a37_cb, huff_a37_xlat }, // wordlen = 7
-
-    /* code table = 4 */
-    { 1, 4, 2, 1, -1, huff_a41_cb, huff_a41_xlat }, // wordlen = 1
-    { 1, 4, 2, 0, -1, huff_a42_cb, huff_a42_xlat }, // wordlen = 2
-    { 1, 1, 3, 1, -1, huff_a43_cb, huff_a43_xlat }, // wordlen = 3
-    { 1, 2, 4, 1, -1, huff_a44_cb, huff_a44_xlat }, // wordlen = 4
-    { 1, 1, 3, 0, -1, huff_a45_cb, huff_a45_xlat }, // wordlen = 5
-    { 1, 2, 4, 0, -1, huff_a46_cb, huff_a46_xlat }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_a47_cb, huff_a47_xlat }, // wordlen = 7
-
-    /* code table = 5 */
-    { 1, 4, 2, 1, -1, huff_a51_cb, huff_a51_xlat }, // wordlen = 1
-    { 1, 2, 3, 1, -1, huff_a52_cb, huff_a52_xlat }, // wordlen = 2
-    { 1, 1, 3, 1, -1, huff_a43_cb, huff_a53_xlat }, // wordlen = 3
-    { 1, 2, 4, 1, -1, huff_a54_cb, huff_a54_xlat }, // wordlen = 4
-    { 1, 1, 3, 0, -1, huff_a55_cb, huff_a55_xlat }, // wordlen = 5
-    { 1, 1, 5, 1, -1, huff_a56_cb, huff_a56_xlat }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_a57_cb, huff_a57_xlat }, // wordlen = 7
-
-    /* code table = 6 */
-    { 2, 4, 2, 1, -1, huff_a61_cb, huff_a61_xlat }, // wordlen = 1
-    { 1, 2, 3, 1, -1, huff_a62_cb, huff_a62_xlat }, // wordlen = 2
-    { 1, 4, 2, 0, -1, huff_a63_cb, huff_a63_xlat }, // wordlen = 3
-    { 1, 2, 4, 1, -1, huff_a64_cb, huff_a64_xlat }, // wordlen = 4
-    { 1, 1, 4, 1, -1, huff_a65_cb, huff_a65_xlat }, // wordlen = 5
-    { 1, 1, 5, 1, -1, huff_a66_cb, huff_a66_xlat }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_a67_cb, huff_a67_xlat }, // wordlen = 7
-
-    /* code table = 7 */
-    { 1, 2, 1, 0, -1, huff_a71_cb, NULL          }, // wordlen = 1
-    { 2, 4, 2, 0, -1, huff_a72_cb, huff_a72_xlat }, // wordlen = 2
-    { 1, 2, 3, 1, -1, huff_a73_cb, huff_a73_xlat }, // wordlen = 3
-    { 1, 2, 4, 1, -1, huff_a74_cb, huff_a74_xlat }, // wordlen = 4
-    { 1, 1, 4, 1, -1, huff_a75_cb, huff_a75_xlat }, // wordlen = 5
-    { 2, 2, 4, 0, -1, huff_a76_cb, huff_a76_xlat }, // wordlen = 6
-    { 4, 1, 6, 1,  6, NULL,        NULL          }, // wordlen = 7
-
-    /* table set = B */
-    /* code table = 0 */
-    { 4, 4, 2, 1, -1, huff_b01_cb, huff_b01_xlat }, // wordlen = 1
-    { 1, 4, 2, 0, -1, huff_b02_cb, huff_b02_xlat }, // wordlen = 2
-    { 4, 2, 3, 1, -1, huff_b03_cb, huff_b03_xlat }, // wordlen = 3
-    { 1, 2, 4, 1, -1, huff_b04_cb, huff_b04_xlat }, // wordlen = 4
-    { 1, 2, 4, 1, -1, huff_b05_cb, huff_b05_xlat }, // wordlen = 5
-    { 1, 1, 4, 0,  5, NULL,        NULL          }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_b07_cb, huff_b07_xlat }, // wordlen = 7
-
-    /* code table = 1 */
-    { 1, 4, 2, 1, 14, NULL,        NULL          }, // wordlen = 1
-    { 1, 4, 2, 0, -1, huff_b12_cb, huff_b12_xlat }, // wordlen = 2
-    { 1, 2, 3, 1,  9, NULL,        NULL          }, // wordlen = 3
-    { 1, 2, 4, 1, -1, huff_b14_cb, huff_b14_xlat }, // wordlen = 4
-    { 1, 2, 4, 1, 11, NULL,        NULL          }, // wordlen = 5
-    { 1, 2, 4, 0, -1, huff_b16_cb, huff_b16_xlat }, // wordlen = 6
-    { 1, 1, 6, 1,  6, NULL,        NULL          }, // wordlen = 7
-
-    /* code table = 2 */
-    { 4, 4, 2, 1, 28, NULL,        NULL          }, // wordlen = 1
-    { 4, 4, 2, 0, 22, NULL,        NULL          }, // wordlen = 2
-    { 1, 2, 3, 1,  2, NULL,        NULL          }, // wordlen = 3
-    { 1, 2, 4, 1, 31, NULL,        NULL          }, // wordlen = 4
-    { 2, 2, 4, 1, 60, NULL,        NULL          }, // wordlen = 5
-    { 2, 2, 4, 0, -1, huff_b26_cb, huff_b26_xlat }, // wordlen = 6
-    { 4, 1, 6, 1,  6, NULL,        NULL          }, // wordlen = 7
-
-    /* code table = 3 */
-    { 1, 4, 2, 1, 35, NULL,        NULL          }, // wordlen = 1
-    { 1, 4, 2, 0, -1, huff_b32_cb, huff_b32_xlat }, // wordlen = 2
-    { 1, 4, 2, 0, -1, huff_b33_cb, huff_b33_xlat }, // wordlen = 3
-    { 2, 2, 4, 1, 59, NULL,        NULL          }, // wordlen = 4
-    { 1, 2, 4, 1, -1, huff_b35_cb, huff_b35_xlat }, // wordlen = 5
-    { 1, 2, 4, 0, 75, NULL,        NULL          }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_b37_cb, huff_b37_xlat }, // wordlen = 7
-
-    /* code table = 4 */
-    { 1, 4, 2, 1, -1, huff_b41_cb, huff_b41_xlat }, // wordlen = 1
-    { 4, 2, 3, 1, -1, huff_b42_cb, huff_b42_xlat }, // wordlen = 2
-    { 1, 2, 3, 1, -1, huff_b43_cb, huff_b43_xlat }, // wordlen = 3
-    { 4, 2, 4, 1, 66, NULL,        NULL          }, // wordlen = 4
-    { 1, 1, 3, 0, 32, NULL,        NULL          }, // wordlen = 5
-    { 1, 2, 4, 0, 12, NULL,        NULL          }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_b47_cb, huff_b47_xlat }, // wordlen = 7
-
-    /* code table = 5 */
-    { 2, 4, 2, 1, 42, NULL,        NULL          }, // wordlen = 1
-    { 1, 2, 3, 1, -1, huff_b52_cb, huff_b52_xlat }, // wordlen = 2
-    { 4, 1, 3, 1, -1, huff_b53_cb, huff_b53_xlat }, // wordlen = 3
-    { 1, 1, 3, 0, 17, NULL,        NULL          }, // wordlen = 4
-    { 1, 1, 3, 0, 39, NULL,        NULL          }, // wordlen = 5
-    { 1, 1, 5, 1, -1, huff_b56_cb, huff_b56_xlat }, // wordlen = 6
-    { 2, 1, 6, 1, 62, NULL,        NULL          }, // wordlen = 7
-
-    /* code table = 6 */
-    { 1, 4, 2, 1, 28, NULL,        NULL          }, // wordlen = 1
-    { 1, 4, 2, 0, -1, huff_b62_cb, huff_b62_xlat }, // wordlen = 2
-    { 1, 1, 3, 1, -1, huff_b63_cb, huff_b63_xlat }, // wordlen = 3
-    { 1, 1, 3, 0, -1, huff_b64_cb, huff_b64_xlat }, // wordlen = 4
-    { 4, 2, 4, 1, -1, huff_b65_cb, huff_b65_xlat }, // wordlen = 5
-    { 1, 2, 4, 0, -1, huff_b66_cb, huff_b66_xlat }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_b67_cb, huff_b67_xlat }, // wordlen = 7
-
-    /* code table = 7 */
-    { 1, 4, 2, 1, -1, huff_b71_cb, huff_b71_xlat }, // wordlen = 1
-    { 4, 4, 2, 0, 78, NULL,        NULL          }, // wordlen = 2
-    { 4, 4, 2, 0, -1, huff_b73_cb, huff_b73_xlat }, // wordlen = 3
-    { 1, 1, 4, 1, -1, huff_b74_cb, huff_b74_xlat }, // wordlen = 4
-    { 1, 2, 4, 1, -1, huff_b75_cb, huff_b75_xlat }, // wordlen = 5
-    { 1, 1, 5, 1, 47, NULL,        NULL          }, // wordlen = 6
-    { 1, 1, 6, 1, -1, huff_b77_cb, huff_b77_xlat }, // wordlen = 7
-};
-
-/* Huffman tables for gain control data. */
-static const uint8_t atrac3p_huff_gain_npoints1_cb[9] = {
-    1, 7, 1, 1, 1, 1, 1, 1, 2
-};
-
-static const uint8_t atrac3p_huff_gain_npoints2_xlat[8] = {
-    0, 1, 7, 2, 6, 3, 4, 5
-};
-
-static const uint8_t atrac3p_huff_gain_lev1_cb[9] = { 1, 7, 1, 0, 2, 2, 1, 2, 8 };
-static const uint8_t atrac3p_huff_gain_lev1_xlat[16] = {
-    7, 5, 8, 6, 9, 4, 10, 11, 0, 1, 2, 3, 12, 13, 14, 15
-};
-
-static const uint8_t atrac3p_huff_gain_lev2_cb[11] = {
-    1, 9, 1, 1, 1, 1, 1, 0, 2, 0, 8
-};
-
-static const uint8_t atrac3p_huff_gain_lev2_xlat[15] = {
-    15, 14, 1, 13, 2, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11
-};
-
-static const uint8_t atrac3p_huff_gain_lev3_cb[11] = {
-    1, 9, 1, 0, 3, 1, 1, 0, 2, 0, 8
-};
-
-static const uint8_t atrac3p_huff_gain_lev3_xlat[16] = {
-    0, 1, 14, 15, 2, 13, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11
-};
-
-static const uint8_t atrac3p_huff_gain_lev4_cb[11] = {
-    1, 9, 1, 1, 1, 1, 1, 0, 1, 2, 8
-};
-
-static const uint8_t atrac3p_huff_gain_lev4_xlat[16] = {
-    0, 1, 15, 14, 2, 13, 3, 12, 4, 5, 6, 7, 8, 9, 10, 11
-};
-
-static const uint8_t atrac3p_huff_gain_loc1_cb[9] = { 2, 8, 1, 2, 4, 4, 4, 0, 16 };
-static const uint8_t atrac3p_huff_gain_loc1_xlat[31] = {
-     1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
-    17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
-};
-
-static const uint8_t atrac3p_huff_gain_loc2_cb[8] = { 3, 8, 5, 3, 2, 3, 2, 16 };
-static const uint8_t atrac3p_huff_gain_loc2_xlat[31] = {
-     2,  3,  4,  5,  6,  1,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
-    17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
-};
-
-static const uint8_t atrac3p_huff_gain_loc3_cb[7] = { 2, 6, 1, 0, 2, 11, 18 };
-static const uint8_t atrac3p_huff_gain_loc3_xlat[32] = {
-    0,   1, 31,  2,  3,  4,  5,  6,  7, 26, 27, 28, 29, 30,  8,  9,
-    10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
-};
-
-static const uint8_t atrac3p_huff_gain_loc4_cb[5] = { 4, 6, 3, 23, 6 };
-static const uint8_t atrac3p_huff_gain_loc4_xlat[32] = {
-    0,  28, 29,  1,  2,  3,  4, 11, 12, 13, 14, 15, 16, 17, 18, 19,
-    20, 21, 22, 23, 24, 25, 26, 27, 30, 31,  5,  6,  7,  8,  9, 10
-};
-
-static const uint8_t atrac3p_huff_gain_loc5_cb[9] = { 1, 7, 1, 0, 0, 3, 2, 6, 20 };
-static const uint8_t atrac3p_huff_gain_loc5_xlat[32] = {
-    0,   1,  2, 31,  3,  4,  5,  6,  7,  8, 29, 30,  9, 10, 11, 12,
-    13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
-};
-
-/* Huffman tables for GHA waves data. */
-static const uint8_t atrac3p_huff_tonebands_cb[8] = { 1, 6, 1, 0, 1, 2, 4, 8 };
-static const uint8_t atrac3p_huff_numwavs1_cb[9] = { 1, 7, 1, 1, 1, 1, 1, 1, 2 };
-static const uint8_t atrac3p_huff_numwavs2_cb[8] = { 1, 6, 1, 1, 1, 1, 0, 4 };
-static const uint8_t atrac3p_huff_numwavs2_xlat[8] = { 0, 1, 7, 2, 3, 4, 5, 6 };
-static const uint8_t atrac3p_huff_wav_ampsf1_cb[7] = { 4, 8, 10, 8, 6, 0, 8 };
-static const uint8_t atrac3p_huff_wav_ampsf1_xlat[32] = {
-     8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 5, 6,  7, 18, 19, 20,
-    21, 22,  4, 23, 24, 25, 26, 27,  0,  1, 2, 3, 28, 29, 30, 31
-};
-
-static const uint8_t atrac3p_huff_wav_ampsf2_cb[7] = { 4, 8, 11, 5, 6, 6, 4 };
-static const uint8_t atrac3p_huff_wav_ampsf2_xlat[32] = {
-    18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 14, 15, 16, 17, 29,
-     9, 10, 11, 12, 13, 30,  4,  5,  6,  7,  8, 31,  0,  1,  2,  3
-};
-
-static const uint8_t atrac3p_huff_wav_ampsf3_cb[9] = { 2, 8, 1, 3, 3, 1, 4, 4, 16 };
-static const uint8_t atrac3p_huff_wav_ampsf3_xlat[32] = {
-    0, 1,  2, 31,  3, 29, 30,  4,  5,  6, 27, 28,  7, 24, 25, 26,
-    8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
-};
-
-static const uint8_t atrac3p_huff_freq_cb[13] = {
-    1, 11, 1, 0, 0, 2, 2, 0, 9, 9, 29, 104, 100
-};
-
-static const uint8_t atrac3p_huff_freq_xlat[256] = {
-      0,   1, 255,   2, 254,   3,   4,   5,   6,   7,   8, 251, 252, 253,   9,  10,
-     11,  12, 246, 247, 248, 249, 250,  13,  14,  15,  16,  17,  18,  19,  20,  21,
-     22,  23,  24,  25,  26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,
-     38, 243, 244, 245,  39,  40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,
-     51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,  64,  65,  66,
-     67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,  81,  82,
-     83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93, 194, 195, 196, 197, 198,
-    199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
-    215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
-    231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242,  94,  95,  96,  97,
-     98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
-    114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
-    130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
-    146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161,
-    162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
-    178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193
-};
-
-#endif /* AVCODEC_ATRAC3PLUS_DATA_H */
diff --git a/deps/libav/libavcodec/atrac3plusdec.c b/deps/libav/libavcodec/atrac3plusdec.c
deleted file mode 100644
index ddbfb53..0000000
--- a/deps/libav/libavcodec/atrac3plusdec.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * ATRAC3+ compatible decoder
- *
- * Copyright (c) 2010-2013 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sony ATRAC3+ compatible decoder.
- *
- * Container formats used to store its data:
- * RIFF WAV (.at3) and Sony OpenMG (.oma, .aa3).
- *
- * Technical description of this codec can be found here:
- * http://wiki.multimedia.cx/index.php?title=ATRAC3plus
- *
- * Kudos to Benjamin Larsson and Michael Karcher
- * for their precious technical help!
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "atrac.h"
-#include "atrac3plus.h"
-
-typedef struct ATRAC3PContext {
-    GetBitContext gb;
-    AVFloatDSPContext fdsp;
-
-    DECLARE_ALIGNED(32, float, samples)[2][ATRAC3P_FRAME_SAMPLES];  ///< quantized MDCT spectrum
-    DECLARE_ALIGNED(32, float, mdct_buf)[2][ATRAC3P_FRAME_SAMPLES]; ///< output of the IMDCT
-    DECLARE_ALIGNED(32, float, time_buf)[2][ATRAC3P_FRAME_SAMPLES]; ///< output of the gain compensation
-    DECLARE_ALIGNED(32, float, outp_buf)[2][ATRAC3P_FRAME_SAMPLES];
-
-    AtracGCContext gainc_ctx;   ///< gain compensation context
-    FFTContext mdct_ctx;
-    FFTContext ipqf_dct_ctx;    ///< IDCT context used by IPQF
-
-    Atrac3pChanUnitCtx *ch_units;   ///< global channel units
-
-    int num_channel_blocks;     ///< number of channel blocks
-    uint8_t channel_blocks[5];  ///< channel configuration descriptor
-    uint64_t my_channel_layout; ///< current channel layout
-} ATRAC3PContext;
-
-static av_cold int atrac3p_decode_close(AVCodecContext *avctx)
-{
-    av_free(((ATRAC3PContext *)(avctx->priv_data))->ch_units);
-
-    return 0;
-}
-
-static av_cold int set_channel_params(ATRAC3PContext *ctx,
-                                      AVCodecContext *avctx)
-{
-    memset(ctx->channel_blocks, 0, sizeof(ctx->channel_blocks));
-
-    switch (avctx->channels) {
-    case 1:
-        if (avctx->channel_layout != AV_CH_FRONT_LEFT)
-            avctx->channel_layout = AV_CH_LAYOUT_MONO;
-
-        ctx->num_channel_blocks = 1;
-        ctx->channel_blocks[0]  = CH_UNIT_MONO;
-        break;
-    case 2:
-        avctx->channel_layout   = AV_CH_LAYOUT_STEREO;
-        ctx->num_channel_blocks = 1;
-        ctx->channel_blocks[0]  = CH_UNIT_STEREO;
-        break;
-    case 3:
-        avctx->channel_layout   = AV_CH_LAYOUT_SURROUND;
-        ctx->num_channel_blocks = 2;
-        ctx->channel_blocks[0]  = CH_UNIT_STEREO;
-        ctx->channel_blocks[1]  = CH_UNIT_MONO;
-        break;
-    case 4:
-        avctx->channel_layout   = AV_CH_LAYOUT_4POINT0;
-        ctx->num_channel_blocks = 3;
-        ctx->channel_blocks[0]  = CH_UNIT_STEREO;
-        ctx->channel_blocks[1]  = CH_UNIT_MONO;
-        ctx->channel_blocks[2]  = CH_UNIT_MONO;
-        break;
-    case 6:
-        avctx->channel_layout   = AV_CH_LAYOUT_5POINT1_BACK;
-        ctx->num_channel_blocks = 4;
-        ctx->channel_blocks[0]  = CH_UNIT_STEREO;
-        ctx->channel_blocks[1]  = CH_UNIT_MONO;
-        ctx->channel_blocks[2]  = CH_UNIT_STEREO;
-        ctx->channel_blocks[3]  = CH_UNIT_MONO;
-        break;
-    case 7:
-        avctx->channel_layout   = AV_CH_LAYOUT_6POINT1_BACK;
-        ctx->num_channel_blocks = 5;
-        ctx->channel_blocks[0]  = CH_UNIT_STEREO;
-        ctx->channel_blocks[1]  = CH_UNIT_MONO;
-        ctx->channel_blocks[2]  = CH_UNIT_STEREO;
-        ctx->channel_blocks[3]  = CH_UNIT_MONO;
-        ctx->channel_blocks[4]  = CH_UNIT_MONO;
-        break;
-    case 8:
-        avctx->channel_layout   = AV_CH_LAYOUT_7POINT1;
-        ctx->num_channel_blocks = 5;
-        ctx->channel_blocks[0]  = CH_UNIT_STEREO;
-        ctx->channel_blocks[1]  = CH_UNIT_MONO;
-        ctx->channel_blocks[2]  = CH_UNIT_STEREO;
-        ctx->channel_blocks[3]  = CH_UNIT_STEREO;
-        ctx->channel_blocks[4]  = CH_UNIT_MONO;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR,
-               "Unsupported channel count: %d!\n", avctx->channels);
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-static av_cold int atrac3p_decode_init(AVCodecContext *avctx)
-{
-    ATRAC3PContext *ctx = avctx->priv_data;
-    int i, ch, ret;
-
-    if (!avctx->block_align) {
-        av_log(avctx, AV_LOG_ERROR, "block_align is not set\n");
-        return AVERROR(EINVAL);
-    }
-
-    avpriv_float_dsp_init(&ctx->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    /* initialize IPQF */
-    ff_mdct_init(&ctx->ipqf_dct_ctx, 5, 1, 32.0 / 32768.0);
-
-    ff_atrac3p_init_imdct(avctx, &ctx->mdct_ctx);
-
-    ff_atrac_init_gain_compensation(&ctx->gainc_ctx, 6, 2);
-
-    ff_atrac3p_init_wave_synth();
-
-    if ((ret = set_channel_params(ctx, avctx)) < 0)
-        return ret;
-
-    ctx->my_channel_layout = avctx->channel_layout;
-
-    ctx->ch_units = av_mallocz(sizeof(*ctx->ch_units) *
-                               ctx->num_channel_blocks);
-    if (!ctx->ch_units) {
-        atrac3p_decode_close(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    for (i = 0; i < ctx->num_channel_blocks; i++) {
-        for (ch = 0; ch < 2; ch++) {
-            ctx->ch_units[i].channels[ch].ch_num          = ch;
-            ctx->ch_units[i].channels[ch].wnd_shape       = &ctx->ch_units[i].channels[ch].wnd_shape_hist[0][0];
-            ctx->ch_units[i].channels[ch].wnd_shape_prev  = &ctx->ch_units[i].channels[ch].wnd_shape_hist[1][0];
-            ctx->ch_units[i].channels[ch].gain_data       = &ctx->ch_units[i].channels[ch].gain_data_hist[0][0];
-            ctx->ch_units[i].channels[ch].gain_data_prev  = &ctx->ch_units[i].channels[ch].gain_data_hist[1][0];
-            ctx->ch_units[i].channels[ch].tones_info      = &ctx->ch_units[i].channels[ch].tones_info_hist[0][0];
-            ctx->ch_units[i].channels[ch].tones_info_prev = &ctx->ch_units[i].channels[ch].tones_info_hist[1][0];
-        }
-
-        ctx->ch_units[i].waves_info      = &ctx->ch_units[i].wave_synth_hist[0];
-        ctx->ch_units[i].waves_info_prev = &ctx->ch_units[i].wave_synth_hist[1];
-    }
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    return 0;
-}
-
-static void decode_residual_spectrum(Atrac3pChanUnitCtx *ctx,
-                                     float out[2][ATRAC3P_FRAME_SAMPLES],
-                                     int num_channels,
-                                     AVCodecContext *avctx)
-{
-    int i, sb, ch, qu, nspeclines, RNG_index;
-    float *dst, q;
-    int16_t *src;
-    /* calculate RNG table index for each subband */
-    int sb_RNG_index[ATRAC3P_SUBBANDS] = { 0 };
-
-    if (ctx->mute_flag) {
-        for (ch = 0; ch < num_channels; ch++)
-            memset(out[ch], 0, ATRAC3P_FRAME_SAMPLES * sizeof(*out[ch]));
-        return;
-    }
-
-    for (qu = 0, RNG_index = 0; qu < ctx->used_quant_units; qu++)
-        RNG_index += ctx->channels[0].qu_sf_idx[qu] +
-                     ctx->channels[1].qu_sf_idx[qu];
-
-    for (sb = 0; sb < ctx->num_coded_subbands; sb++, RNG_index += 128)
-        sb_RNG_index[sb] = RNG_index & 0x3FC;
-
-    /* inverse quant and power compensation */
-    for (ch = 0; ch < num_channels; ch++) {
-        /* clear channel's residual spectrum */
-        memset(out[ch], 0, ATRAC3P_FRAME_SAMPLES * sizeof(*out[ch]));
-
-        for (qu = 0; qu < ctx->used_quant_units; qu++) {
-            src        = &ctx->channels[ch].spectrum[ff_atrac3p_qu_to_spec_pos[qu]];
-            dst        = &out[ch][ff_atrac3p_qu_to_spec_pos[qu]];
-            nspeclines = ff_atrac3p_qu_to_spec_pos[qu + 1] -
-                         ff_atrac3p_qu_to_spec_pos[qu];
-
-            if (ctx->channels[ch].qu_wordlen[qu] > 0) {
-                q = ff_atrac3p_sf_tab[ctx->channels[ch].qu_sf_idx[qu]] *
-                    ff_atrac3p_mant_tab[ctx->channels[ch].qu_wordlen[qu]];
-                for (i = 0; i < nspeclines; i++)
-                    dst[i] = src[i] * q;
-            }
-        }
-
-        for (sb = 0; sb < ctx->num_coded_subbands; sb++)
-            ff_atrac3p_power_compensation(ctx, ch, &out[ch][0],
-                                          sb_RNG_index[sb], sb);
-    }
-
-    if (ctx->unit_type == CH_UNIT_STEREO) {
-        for (sb = 0; sb < ctx->num_coded_subbands; sb++) {
-            if (ctx->swap_channels[sb]) {
-                for (i = 0; i < ATRAC3P_SUBBAND_SAMPLES; i++)
-                    FFSWAP(float, out[0][sb * ATRAC3P_SUBBAND_SAMPLES + i],
-                                  out[1][sb * ATRAC3P_SUBBAND_SAMPLES + i]);
-            }
-
-            /* flip coefficients' sign if requested */
-            if (ctx->negate_coeffs[sb])
-                for (i = 0; i < ATRAC3P_SUBBAND_SAMPLES; i++)
-                    out[1][sb * ATRAC3P_SUBBAND_SAMPLES + i] = -(out[1][sb * ATRAC3P_SUBBAND_SAMPLES + i]);
-        }
-    }
-}
-
-static void reconstruct_frame(ATRAC3PContext *ctx, Atrac3pChanUnitCtx *ch_unit,
-                              int num_channels, AVCodecContext *avctx)
-{
-    int ch, sb;
-
-    for (ch = 0; ch < num_channels; ch++) {
-        for (sb = 0; sb < ch_unit->num_subbands; sb++) {
-            /* inverse transform and windowing */
-            ff_atrac3p_imdct(&ctx->fdsp, &ctx->mdct_ctx,
-                             &ctx->samples[ch][sb * ATRAC3P_SUBBAND_SAMPLES],
-                             &ctx->mdct_buf[ch][sb * ATRAC3P_SUBBAND_SAMPLES],
-                             (ch_unit->channels[ch].wnd_shape_prev[sb] << 1) +
-                             ch_unit->channels[ch].wnd_shape[sb], sb);
-
-            /* gain compensation and overlapping */
-            ff_atrac_gain_compensation(&ctx->gainc_ctx,
-                                       &ctx->mdct_buf[ch][sb * ATRAC3P_SUBBAND_SAMPLES],
-                                       &ch_unit->prev_buf[ch][sb * ATRAC3P_SUBBAND_SAMPLES],
-                                       &ch_unit->channels[ch].gain_data_prev[sb],
-                                       &ch_unit->channels[ch].gain_data[sb],
-                                       ATRAC3P_SUBBAND_SAMPLES,
-                                       &ctx->time_buf[ch][sb * ATRAC3P_SUBBAND_SAMPLES]);
-        }
-
-        /* zero unused subbands in both output and overlapping buffers */
-        memset(&ch_unit->prev_buf[ch][ch_unit->num_subbands * ATRAC3P_SUBBAND_SAMPLES],
-               0,
-               (ATRAC3P_SUBBANDS - ch_unit->num_subbands) *
-               ATRAC3P_SUBBAND_SAMPLES *
-               sizeof(ch_unit->prev_buf[ch][ch_unit->num_subbands * ATRAC3P_SUBBAND_SAMPLES]));
-        memset(&ctx->time_buf[ch][ch_unit->num_subbands * ATRAC3P_SUBBAND_SAMPLES],
-               0,
-               (ATRAC3P_SUBBANDS - ch_unit->num_subbands) *
-               ATRAC3P_SUBBAND_SAMPLES *
-               sizeof(ctx->time_buf[ch][ch_unit->num_subbands * ATRAC3P_SUBBAND_SAMPLES]));
-
-        /* resynthesize and add tonal signal */
-        if (ch_unit->waves_info->tones_present ||
-            ch_unit->waves_info_prev->tones_present) {
-            for (sb = 0; sb < ch_unit->num_subbands; sb++)
-                if (ch_unit->channels[ch].tones_info[sb].num_wavs ||
-                    ch_unit->channels[ch].tones_info_prev[sb].num_wavs) {
-                    ff_atrac3p_generate_tones(ch_unit, &ctx->fdsp, ch, sb,
-                                              &ctx->time_buf[ch][sb * 128]);
-                }
-        }
-
-        /* subband synthesis and acoustic signal output */
-        ff_atrac3p_ipqf(&ctx->ipqf_dct_ctx, &ch_unit->ipqf_ctx[ch],
-                        &ctx->time_buf[ch][0], &ctx->outp_buf[ch][0]);
-    }
-
-    /* swap window shape and gain control buffers. */
-    for (ch = 0; ch < num_channels; ch++) {
-        FFSWAP(uint8_t *, ch_unit->channels[ch].wnd_shape,
-               ch_unit->channels[ch].wnd_shape_prev);
-        FFSWAP(AtracGainInfo *, ch_unit->channels[ch].gain_data,
-               ch_unit->channels[ch].gain_data_prev);
-        FFSWAP(Atrac3pWavesData *, ch_unit->channels[ch].tones_info,
-               ch_unit->channels[ch].tones_info_prev);
-    }
-
-    FFSWAP(Atrac3pWaveSynthParams *, ch_unit->waves_info, ch_unit->waves_info_prev);
-}
-
-static int atrac3p_decode_frame(AVCodecContext *avctx, void *data,
-                                int *got_frame_ptr, AVPacket *avpkt)
-{
-    ATRAC3PContext *ctx = avctx->priv_data;
-    AVFrame *frame      = data;
-    int i, ret, ch_unit_id, ch_block = 0, out_ch_index = 0, channels_to_process;
-    float **samples_p = (float **)frame->extended_data;
-
-    frame->nb_samples = ATRAC3P_FRAME_SAMPLES;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if ((ret = init_get_bits8(&ctx->gb, avpkt->data, avpkt->size)) < 0)
-        return ret;
-
-    if (get_bits1(&ctx->gb)) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid start bit!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    while (get_bits_left(&ctx->gb) >= 2 &&
-           (ch_unit_id = get_bits(&ctx->gb, 2)) != CH_UNIT_TERMINATOR) {
-        if (ch_unit_id == CH_UNIT_EXTENSION) {
-            avpriv_report_missing_feature(avctx, "Channel unit extension");
-            return AVERROR_PATCHWELCOME;
-        }
-        if (ch_block >= ctx->num_channel_blocks ||
-            ctx->channel_blocks[ch_block] != ch_unit_id) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Frame data doesn't match channel configuration!\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        ctx->ch_units[ch_block].unit_type = ch_unit_id;
-        channels_to_process               = ch_unit_id + 1;
-
-        if ((ret = ff_atrac3p_decode_channel_unit(&ctx->gb,
-                                                  &ctx->ch_units[ch_block],
-                                                  channels_to_process,
-                                                  avctx)) < 0)
-            return ret;
-
-        decode_residual_spectrum(&ctx->ch_units[ch_block], ctx->samples,
-                                 channels_to_process, avctx);
-        reconstruct_frame(ctx, &ctx->ch_units[ch_block],
-                          channels_to_process, avctx);
-
-        for (i = 0; i < channels_to_process; i++)
-            memcpy(samples_p[out_ch_index + i], ctx->outp_buf[i],
-                   ATRAC3P_FRAME_SAMPLES * sizeof(**samples_p));
-
-        ch_block++;
-        out_ch_index += channels_to_process;
-    }
-
-    *got_frame_ptr = 1;
-
-    return avctx->block_align;
-}
-
-AVCodec ff_atrac3p_decoder = {
-    .name             = "atrac3plus",
-    .long_name        = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"),
-    .type             = AVMEDIA_TYPE_AUDIO,
-    .id               = AV_CODEC_ID_ATRAC3P,
-    .priv_data_size   = sizeof(ATRAC3PContext),
-    .init             = atrac3p_decode_init,
-    .init_static_data = ff_atrac3p_init_vlcs,
-    .close            = atrac3p_decode_close,
-    .decode           = atrac3p_decode_frame,
-};
diff --git a/deps/libav/libavcodec/atrac3plusdsp.c b/deps/libav/libavcodec/atrac3plusdsp.c
deleted file mode 100644
index 468f098..0000000
--- a/deps/libav/libavcodec/atrac3plusdsp.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * ATRAC3+ compatible decoder
- *
- * Copyright (c) 2010-2013 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- *  @file
- *  DSP functions for ATRAC3+ decoder.
- */
-
-#include <math.h>
-
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "sinewin.h"
-#include "fft.h"
-#include "atrac3plus.h"
-
-/**
- *  Map quant unit number to its position in the spectrum.
- *  To get the number of spectral lines in each quant unit do the following:
- *  num_specs = qu_to_spec_pos[i+1] - qu_to_spec_pos[i]
- */
-const uint16_t ff_atrac3p_qu_to_spec_pos[33] = {
-      0,    16,   32,   48,   64,   80,   96,  112,
-    128,   160,  192,  224,  256,  288,  320,  352,
-    384,   448,  512,  576,  640,  704,  768,  896,
-    1024, 1152, 1280, 1408, 1536, 1664, 1792, 1920,
-    2048
-};
-
-/* Scalefactors table. */
-/* Approx. Equ: pow(2.0, (i - 16.0 + 0.501783948) / 3.0) */
-const float ff_atrac3p_sf_tab[64] = {
-    0.027852058,  0.0350914, 0.044212341, 0.055704117,  0.0701828,
-    0.088424683, 0.11140823,   0.1403656,  0.17684937, 0.22281647, 0.2807312, 0.35369873,
-    0.44563293,   0.5614624,  0.70739746,  0.89126587,  1.1229248, 1.4147949,  1.7825317,
-    2.2458496,    2.8295898,   3.5650635,   4.4916992,  5.6591797,  7.130127,  8.9833984,
-    11.318359,    14.260254,   17.966797,   22.636719,  28.520508, 35.933594,  45.273438,
-    57.041016,    71.867188,   90.546875,   114.08203,  143.73438, 181.09375,  228.16406,
-    287.46875,     362.1875,   456.32812,    574.9375,    724.375, 912.65625,   1149.875,
-    1448.75,      1825.3125,     2299.75,      2897.5,   3650.625,    4599.5,     5795.0,
-    7301.25,         9199.0,     11590.0,     14602.5,    18398.0,   23180.0,    29205.0,
-    36796.0,        46360.0,     58410.0
-};
-
-/* Mantissa table. */
-/* pow(10, x * log10(2) + 0.05) / 2 / ([1,2,3,5,7,15,31] + 0.5) */
-const float ff_atrac3p_mant_tab[8] = {
-    0.0,
-    0.74801636,
-    0.44882202,
-    0.32058716,
-    0.20400238,
-    0.1496048,
-    0.07239151,
-    0.035619736
-};
-
-#define ATRAC3P_MDCT_SIZE (ATRAC3P_SUBBAND_SAMPLES * 2)
-
-av_cold void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx)
-{
-    ff_init_ff_sine_windows(7);
-    ff_init_ff_sine_windows(6);
-
-    /* Initialize the MDCT transform. */
-    ff_mdct_init(mdct_ctx, 8, 1, -1.0);
-}
-
-#define TWOPI (2 * M_PI)
-
-#define DEQUANT_PHASE(ph) (((ph) & 0x1F) << 6)
-
-static DECLARE_ALIGNED(32, float, sine_table)[2048]; ///< wave table
-static DECLARE_ALIGNED(32, float, hann_window)[256]; ///< Hann windowing function
-static float amp_sf_tab[64];   ///< scalefactors for quantized amplitudes
-
-av_cold void ff_atrac3p_init_wave_synth(void)
-{
-    int i;
-
-    /* generate sine wave table */
-    for (i = 0; i < 2048; i++)
-        sine_table[i] = sin(TWOPI * i / 2048);
-
-    /* generate Hann window */
-    for (i = 0; i < 256; i++)
-        hann_window[i] = (1.0f - cos(TWOPI * i / 256.0f)) * 0.5f;
-
-    /* generate amplitude scalefactors table */
-    for (i = 0; i < 64; i++)
-        amp_sf_tab[i] = pow(2.0f, ((double)i - 3) / 4.0f);
-}
-
-/**
- *  Synthesize sine waves according to given parameters.
- *
- *  @param[in]    synth_param   ptr to common synthesis parameters
- *  @param[in]    waves_info    parameters for each sine wave
- *  @param[in]    envelope      envelope data for all waves in a group
- *  @param[in]    phase_shift   flag indicates 180° phase shift
- *  @param[in]    reg_offset    region offset for trimming envelope data
- *  @param[out]   out           receives sythesized data
- */
-static void waves_synth(Atrac3pWaveSynthParams *synth_param,
-                        Atrac3pWavesData *waves_info,
-                        Atrac3pWaveEnvelope *envelope,
-                        int phase_shift, int reg_offset, float *out)
-{
-    int i, wn, inc, pos;
-    double amp;
-    Atrac3pWaveParam *wave_param = &synth_param->waves[waves_info->start_index];
-
-    for (wn = 0; wn < waves_info->num_wavs; wn++, wave_param++) {
-        /* amplitude dequantization */
-        amp = amp_sf_tab[wave_param->amp_sf] *
-              (!synth_param->amplitude_mode
-               ? (wave_param->amp_index + 1) / 15.13f
-               : 1.0f);
-
-        inc = wave_param->freq_index;
-        pos = DEQUANT_PHASE(wave_param->phase_index) - (reg_offset ^ 128) * inc & 2047;
-
-        /* waveform generation */
-        for (i = 0; i < 128; i++) {
-            out[i] += sine_table[pos] * amp;
-            pos     = (pos + inc) & 2047;
-        }
-    }
-
-    /* fade in with steep Hann window if requested */
-    if (envelope->has_start_point) {
-        pos = (envelope->start_pos << 2) - reg_offset;
-        if (pos > 0 && pos <= 128) {
-            memset(out, 0, pos * sizeof(*out));
-            if (!envelope->has_stop_point ||
-                envelope->start_pos != envelope->stop_pos) {
-                out[pos + 0] *= hann_window[0];
-                out[pos + 1] *= hann_window[32];
-                out[pos + 2] *= hann_window[64];
-                out[pos + 3] *= hann_window[96];
-            }
-        }
-    }
-
-    /* fade out with steep Hann window if requested */
-    if (envelope->has_stop_point) {
-        pos = (envelope->stop_pos + 1 << 2) - reg_offset;
-        if (pos > 0 && pos <= 128) {
-            out[pos - 4] *= hann_window[96];
-            out[pos - 3] *= hann_window[64];
-            out[pos - 2] *= hann_window[32];
-            out[pos - 1] *= hann_window[0];
-            memset(&out[pos], 0, (128 - pos) * sizeof(out[pos]));
-        }
-    }
-}
-
-void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *fdsp,
-                               int ch_num, int sb, float *out)
-{
-    DECLARE_ALIGNED(32, float, wavreg1)[128] = { 0 };
-    DECLARE_ALIGNED(32, float, wavreg2)[128] = { 0 };
-    int i, reg1_env_nonzero, reg2_env_nonzero;
-    Atrac3pWavesData *tones_now  = &ch_unit->channels[ch_num].tones_info_prev[sb];
-    Atrac3pWavesData *tones_next = &ch_unit->channels[ch_num].tones_info[sb];
-
-    /* reconstruct full envelopes for both overlapping regions
-     * from truncated bitstream data */
-    if (tones_next->pend_env.has_start_point &&
-        tones_next->pend_env.start_pos < tones_next->pend_env.stop_pos) {
-        tones_next->curr_env.has_start_point = 1;
-        tones_next->curr_env.start_pos       = tones_next->pend_env.start_pos + 32;
-    } else if (tones_now->pend_env.has_start_point) {
-        tones_next->curr_env.has_start_point = 1;
-        tones_next->curr_env.start_pos       = tones_now->pend_env.start_pos;
-    } else {
-        tones_next->curr_env.has_start_point = 0;
-        tones_next->curr_env.start_pos       = 0;
-    }
-
-    if (tones_now->pend_env.has_stop_point &&
-        tones_now->pend_env.stop_pos >= tones_next->curr_env.start_pos) {
-        tones_next->curr_env.has_stop_point = 1;
-        tones_next->curr_env.stop_pos       = tones_now->pend_env.stop_pos;
-    } else if (tones_next->pend_env.has_stop_point) {
-        tones_next->curr_env.has_stop_point = 1;
-        tones_next->curr_env.stop_pos       = tones_next->pend_env.stop_pos + 32;
-    } else {
-        tones_next->curr_env.has_stop_point = 0;
-        tones_next->curr_env.stop_pos       = 64;
-    }
-
-    /* is the visible part of the envelope non-zero? */
-    reg1_env_nonzero = (tones_now->curr_env.stop_pos    < 32) ? 0 : 1;
-    reg2_env_nonzero = (tones_next->curr_env.start_pos >= 32) ? 0 : 1;
-
-    /* synthesize waves for both overlapping regions */
-    if (tones_now->num_wavs && reg1_env_nonzero)
-        waves_synth(ch_unit->waves_info_prev, tones_now, &tones_now->curr_env,
-                    ch_unit->waves_info_prev->phase_shift[sb] & ch_num,
-                    128, wavreg1);
-
-    if (tones_next->num_wavs && reg2_env_nonzero)
-        waves_synth(ch_unit->waves_info, tones_next, &tones_next->curr_env,
-                    ch_unit->waves_info->phase_shift[sb] & ch_num, 0, wavreg2);
-
-    /* Hann windowing for non-faded wave signals */
-    if (tones_now->num_wavs && tones_next->num_wavs &&
-        reg1_env_nonzero && reg2_env_nonzero) {
-        fdsp->vector_fmul(wavreg1, wavreg1, &hann_window[128], 128);
-        fdsp->vector_fmul(wavreg2, wavreg2,  hann_window,      128);
-    } else {
-        if (tones_now->num_wavs && !tones_now->curr_env.has_stop_point)
-            fdsp->vector_fmul(wavreg1, wavreg1, &hann_window[128], 128);
-
-        if (tones_next->num_wavs && !tones_next->curr_env.has_start_point)
-            fdsp->vector_fmul(wavreg2, wavreg2, hann_window, 128);
-    }
-
-    /* Overlap and add to residual */
-    for (i = 0; i < 128; i++)
-        out[i] += wavreg1[i] + wavreg2[i];
-}
-
-static const int subband_to_powgrp[ATRAC3P_SUBBANDS] = {
-    0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4
-};
-
-/* noise table for power compensation */
-static const float noise_tab[1024] = {
-    -0.01358032,  -0.05593872,   0.01696777,  -0.14871216,  -0.26412964,  -0.09893799,   0.25723267,
-     0.02008057,  -0.72235107,  -0.44351196,  -0.22985840,   0.16833496,   0.46902466,   0.05917358,
-    -0.15179443,   0.41299438,  -0.01287842,   0.13360596,   0.43557739,  -0.09530640,  -0.58422852,
-     0.39266968,  -0.08343506,  -0.25604248,   0.22848511,   0.26013184,  -0.65588379,   0.17288208,
-    -0.08673096,  -0.05203247,   0.07299805,  -0.28665161,  -0.35806274,   0.06552124,  -0.09387207,
-     0.21099854,  -0.28347778,  -0.72402954,   0.05050659,  -0.10635376,  -0.18853760,   0.29724121,
-     0.20703125,  -0.29791260,  -0.37634277,   0.47970581,  -0.09976196,   0.32641602,  -0.29248047,
-    -0.28237915,   0.26028442,  -0.36157227,   0.22042847,  -0.03222656,  -0.37268066,  -0.03759766,
-     0.09909058,   0.23284912,   0.19320679,   0.14453125,  -0.02139282,  -0.19702148,   0.31533813,
-    -0.16741943,   0.35031128,  -0.35656738,  -0.66128540,  -0.00701904,   0.20898438,   0.26837158,
-    -0.33706665,  -0.04568481,   0.12600708,   0.10284424,   0.07321167,  -0.18280029,   0.38101196,
-     0.21301270,   0.04541016,   0.01156616,  -0.26391602,  -0.02346802,  -0.22125244,   0.29760742,
-    -0.36233521,  -0.31314087,  -0.13967896,  -0.11276245,  -0.19433594,   0.34490967,   0.02343750,
-     0.21963501,  -0.02777100,  -0.67678833,  -0.08999634,   0.14233398,  -0.27697754,   0.51422119,
-    -0.05047607,   0.48327637,   0.37167358,  -0.60806274,   0.18728638,  -0.15191650,   0.00637817,
-     0.02832031,  -0.15618896,   0.60644531,   0.21826172,   0.06384277,  -0.31863403,   0.08816528,
-     0.15447998,  -0.07015991,  -0.08154297,  -0.40966797,  -0.39785767,  -0.11709595,   0.22052002,
-     0.18466187,  -0.17257690,   0.03759766,  -0.06195068,   0.00433350,   0.12176514,   0.34011841,
-     0.25610352,  -0.05294800,   0.41033936,   0.16854858,  -0.76187134,   0.13845825,  -0.19418335,
-    -0.21524048,  -0.44412231,  -0.08160400,  -0.28195190,  -0.01873779,   0.15524292,  -0.37438965,
-    -0.44860840,   0.43096924,  -0.24746704,   0.49856567,   0.14859009,   0.38159180,   0.20541382,
-    -0.39175415,  -0.65850830,  -0.43716431,   0.13037109,  -0.05111694,   0.39956665,   0.21447754,
-    -0.04861450,   0.33654785,   0.10589600,  -0.88085938,  -0.30822754,   0.38577271,   0.30047607,
-     0.38836670,   0.09118652,  -0.36477661,  -0.01641846,  -0.23031616,   0.26058960,   0.18859863,
-    -0.21868896,  -0.17861938,  -0.29754639,   0.09777832,   0.10806274,  -0.51605225,   0.00076294,
-     0.13259888,   0.11090088,  -0.24084473,   0.24957275,   0.01379395,  -0.04141235,  -0.04937744,
-     0.57394409,   0.27410889,   0.27587891,   0.45013428,  -0.32592773,   0.11160278,  -0.00970459,
-     0.29092407,   0.03356934,  -0.70925903,   0.04882812,   0.43499756,   0.07720947,  -0.27554321,
-    -0.01742554,  -0.08413696,  -0.04028320,  -0.52850342,  -0.07330322,   0.05181885,   0.21362305,
-    -0.18765259,   0.07058716,  -0.03009033,   0.32662964,   0.27023315,  -0.28002930,   0.17568970,
-     0.03338623,   0.30242920,  -0.03921509,   0.32174683,  -0.23733521,   0.08575439,  -0.38269043,
-     0.09194946,  -0.07238770,   0.17941284,  -0.51278687,  -0.25146484,   0.19790649,  -0.19195557,
-     0.16549683,   0.42456055,   0.39129639,  -0.02868652,   0.17980957,   0.24902344,  -0.76583862,
-    -0.20959473,   0.61013794,   0.37011719,   0.36859131,  -0.04486084,   0.10678101,  -0.15994263,
-    -0.05328369,   0.28463745,  -0.06420898,  -0.36987305,  -0.28009033,  -0.11764526,   0.04312134,
-    -0.08038330,   0.04885864,  -0.03067017,  -0.00042725,   0.34289551,  -0.00988770,   0.34838867,
-     0.32516479,  -0.16271973,   0.38269043,   0.03240967,   0.12417603,  -0.14331055,  -0.34902954,
-    -0.18325806,   0.29421997,   0.44284058,   0.75170898,  -0.67245483,  -0.12176514,   0.27914429,
-    -0.29806519,   0.19863892,   0.30087280,   0.22680664,  -0.36633301,  -0.32534790,  -0.57553101,
-    -0.16641235,   0.43811035,   0.08331299,   0.15942383,   0.26516724,  -0.24240112,  -0.11761475,
-    -0.16827393,  -0.14260864,   0.46343994,   0.11804199,  -0.55514526,  -0.02520752,  -0.14309692,
-     0.00448608,   0.02749634,  -0.30545044,   0.70965576,   0.45108032,   0.66439819,  -0.68255615,
-    -0.12496948,   0.09146118,  -0.21109009,  -0.23791504,   0.79943848,  -0.35205078,  -0.24963379,
-     0.18719482,  -0.19079590,   0.07458496,   0.07623291,  -0.28781128,  -0.37121582,  -0.19580078,
-    -0.01773071,  -0.16717529,   0.13040161,   0.14672852,   0.42379761,   0.03582764,   0.11431885,
-     0.05145264,   0.44702148,   0.08963013,   0.01367188,  -0.54519653,  -0.12692261,   0.21176147,
-     0.04925537,   0.30670166,  -0.11029053,   0.19555664,  -0.27740479,   0.23043823,   0.15554810,
-    -0.19299316,  -0.25729370,   0.17800903,  -0.03579712,  -0.05065918,  -0.06933594,  -0.09500122,
-    -0.07821655,   0.23889160,  -0.31900024,   0.03073120,  -0.00415039,   0.61315918,   0.37176514,
-    -0.13442993,  -0.15536499,  -0.19216919,  -0.37899780,   0.19992065,   0.02630615,  -0.12573242,
-     0.25927734,  -0.02447510,   0.29629517,  -0.40731812,  -0.17333984,   0.24310303,  -0.10607910,
-     0.14828491,   0.08792114,  -0.18743896,  -0.05572510,  -0.04833984,   0.10473633,  -0.29028320,
-    -0.67687988,  -0.28170776,  -0.41687012,   0.05413818,  -0.23284912,   0.09555054,  -0.08969116,
-    -0.15112305,   0.12738037,   0.35986328,   0.28948975,   0.30691528,   0.23956299,   0.06973267,
-    -0.31198120,  -0.18450928,   0.22280884,  -0.21600342,   0.23522949,  -0.61840820,  -0.13012695,
-     0.26412964,   0.47320557,  -0.26440430,   0.38757324,   0.17352295,  -0.26104736,  -0.25866699,
-    -0.12274170,  -0.29733276,   0.07687378,   0.18588257,  -0.08880615,   0.31185913,   0.05313110,
-    -0.10885620,  -0.14901733,  -0.22323608,  -0.08538818,   0.19812012,   0.19732666,  -0.18927002,
-     0.29058838,   0.25555420,  -0.48599243,   0.18768311,   0.01345825,   0.34887695,   0.21530151,
-     0.19857788,   0.18661499,  -0.01394653,  -0.09063721,  -0.38781738,   0.27160645,  -0.20379639,
-    -0.32119751,  -0.23889160,   0.27096558,   0.24951172,   0.07922363,   0.07479858,  -0.50946045,
-     0.10220337,   0.58364868,  -0.19503784,  -0.18560791,  -0.01165771,   0.47195435,   0.22430420,
-    -0.38635254,  -0.03732300,  -0.09179688,   0.06991577,   0.15106201,   0.20605469,  -0.05969238,
-    -0.41821289,   0.12231445,  -0.04672241,  -0.05117798,  -0.11523438,  -0.51849365,  -0.04077148,
-     0.44284058,  -0.64086914,   0.17019653,   0.02236938,   0.22848511,  -0.23214722,  -0.32354736,
-    -0.14068604,  -0.29690552,  -0.19891357,   0.02774048,  -0.20965576,  -0.52191162,  -0.19299316,
-    -0.07290649,   0.49053955,  -0.22302246,   0.05642700,   0.13122559,  -0.20819092,  -0.83590698,
-    -0.08181763,   0.26797485,  -0.00091553,  -0.09457397,   0.17089844,  -0.27020264,   0.30270386,
-     0.05496216,   0.09564209,  -0.08590698,   0.02130127,   0.35931396,   0.21728516,  -0.15396118,
-    -0.05053711,   0.02719116,   0.16302490,   0.43212891,   0.10229492,  -0.40820312,   0.21646118,
-     0.08435059,  -0.11145020,  -0.39962769,  -0.05618286,  -0.10223389,  -0.60839844,   0.33724976,
-    -0.06341553,  -0.47369385,  -0.32852173,   0.05242920,   0.19635010,  -0.19137573,  -0.67901611,
-     0.16180420,   0.05133057,  -0.22283936,   0.09646606,   0.24288940,  -0.45007324,   0.08804321,
-     0.14053345,   0.22619629,  -0.01000977,   0.36355591,  -0.19863892,  -0.30364990,  -0.24118042,
-    -0.57461548,   0.26498413,   0.04345703,  -0.09796143,  -0.47714233,  -0.23739624,   0.18737793,
-     0.08926392,  -0.02795410,   0.00305176,  -0.08700562,  -0.38711548,   0.03222656,   0.10940552,
-    -0.41906738,  -0.01620483,  -0.47061157,   0.37985229,  -0.21624756,   0.47976685,  -0.20046997,
-    -0.62533569,  -0.26907349,  -0.02877808,   0.00671387,  -0.29071045,  -0.24685669,  -0.15722656,
-    -0.26055908,   0.29968262,   0.28225708,  -0.08990479,  -0.16748047,  -0.46759033,  -0.25067139,
-    -0.25183105,  -0.45932007,   0.05828857,   0.29006958,   0.23840332,  -0.17974854,   0.26931763,
-     0.10696411,  -0.06848145,  -0.17126465,  -0.10522461,  -0.55386353,  -0.42306519,  -0.07608032,
-     0.24380493,   0.38586426,   0.16882324,   0.26751709,   0.17303467,   0.35809326,  -0.22094727,
-    -0.30703735,  -0.28497314,  -0.04321289,   0.15219116,  -0.17071533,  -0.39334106,   0.03439331,
-    -0.10809326,  -0.30590820,   0.26449585,  -0.07412720,   0.13638306,  -0.01062012,   0.27996826,
-     0.04397583,  -0.05557251,  -0.56933594,   0.03363037,  -0.00949097,   0.52642822,  -0.44329834,
-     0.28308105,  -0.05499268,  -0.23312378,  -0.29870605,  -0.05123901,   0.26831055,  -0.35238647,
-    -0.30993652,   0.34646606,  -0.19775391,   0.44595337,   0.13769531,   0.45358276,   0.19961548,
-     0.42681885,   0.15722656,   0.00128174,   0.23757935,   0.40988159,   0.25164795,  -0.00732422,
-    -0.12405396,  -0.43420410,  -0.00402832,   0.34243774,   0.36264038,   0.18807983,  -0.09301758,
-    -0.10296631,   0.05532837,  -0.31652832,   0.14337158,   0.35040283,   0.32540894,   0.05728149,
-    -0.12030029,  -0.25942993,  -0.20312500,  -0.16491699,  -0.46051025,  -0.08004761,   0.50772095,
-     0.16168213,   0.28439331,   0.08105469,  -0.19104004,   0.38589478,  -0.16400146,  -0.25454712,
-     0.20281982,  -0.20730591,  -0.06311035,   0.32937622,   0.15032959,  -0.05340576,   0.30487061,
-    -0.11648560,   0.38009644,  -0.20062256,   0.43466187,   0.01150513,   0.35754395,  -0.13146973,
-     0.67489624,   0.05212402,   0.27914429,  -0.39431763,   0.75308228,  -0.13366699,   0.24453735,
-     0.42248535,  -0.65905762,  -0.00546265,  -0.03491211,  -0.13659668,  -0.08294678,  -0.45666504,
-     0.27188110,   0.12731934,   0.61148071,   0.10449219,  -0.28836060,   0.00091553,   0.24618530,
-     0.13119507,   0.05685425,   0.17355347,   0.42034912,   0.08514404,   0.24536133,   0.18951416,
-    -0.19107056,  -0.15036011,   0.02334595,   0.54986572,   0.32321167,  -0.16104126,  -0.03054810,
-     0.43594360,   0.17309570,   0.61053467,   0.24731445,   0.33334351,   0.15240479,   0.15588379,
-     0.36425781,  -0.30407715,  -0.13302612,   0.00427246,   0.04171753,  -0.33178711,   0.34216309,
-    -0.12463379,  -0.02764893,   0.05905151,  -0.31436157,   0.16531372,   0.34542847,  -0.03292847,
-     0.12527466,  -0.12313843,  -0.13171387,   0.04757690,  -0.45095825,  -0.19085693,   0.35342407,
-    -0.23239136,  -0.34387207,   0.11264038,  -0.15740967,   0.05273438,   0.74942017,   0.21505737,
-     0.08514404,  -0.42391968,  -0.19531250,   0.35293579,   0.25305176,   0.15731812,  -0.70324707,
-    -0.21591187,   0.35604858,   0.14132690,   0.11724854,   0.15853882,  -0.24597168,   0.07019043,
-     0.02127075,   0.12658691,   0.06390381,  -0.12292480,   0.15441895,  -0.47640991,   0.06195068,
-     0.58981323,  -0.15151978,  -0.03604126,  -0.45059204,  -0.01672363,  -0.46997070,   0.25750732,
-     0.18084717,   0.06661987,   0.13253784,   0.67828369,   0.11370850,   0.11325073,  -0.04611206,
-    -0.07791138,  -0.36544800,  -0.06747437,  -0.31594849,   0.16131592,   0.41983032,   0.11071777,
-    -0.36889648,   0.30963135,  -0.37875366,   0.58508301,   0.00393677,   0.12338257,   0.03424072,
-    -0.21728516,  -0.12838745,  -0.46981812,   0.05868530,  -0.25015259,   0.27407837,   0.65240479,
-    -0.34429932,  -0.15179443,   0.14056396,   0.33505249,   0.28826904,   0.09921265,   0.34390259,
-     0.13656616,  -0.23608398,   0.00863647,   0.02627563,  -0.19119263,   0.19775391,  -0.07214355,
-     0.07809448,   0.03454590,  -0.03417969,   0.00033569,  -0.23095703,   0.18673706,   0.05798340,
-     0.03814697,  -0.04318237,   0.05487061,   0.08633423,   0.55950928,  -0.06347656,   0.10333252,
-     0.25305176,   0.05853271,   0.12246704,  -0.25543213,  -0.34262085,  -0.36437988,  -0.21304321,
-    -0.05093384,   0.02777100,   0.07620239,  -0.21215820,  -0.09326172,   0.19021606,  -0.40579224,
-    -0.01193237,   0.19845581,  -0.35336304,  -0.07397461,   0.20104980,   0.08615112,  -0.44375610,
-     0.11419678,   0.24453735,  -0.16555786,  -0.05081177,  -0.01406860,   0.27893066,  -0.18692017,
-     0.07473755,   0.03451538,  -0.39733887,   0.21548462,  -0.22534180,  -0.39651489,  -0.04989624,
-    -0.57662964,   0.06390381,   0.62020874,  -0.13470459,   0.04345703,  -0.21862793,  -0.02789307,
-     0.51696777,  -0.27587891,   0.39004517,   0.09857178,  -0.00738525,   0.31317139,   0.00048828,
-    -0.46572876,   0.29531860,  -0.10009766,  -0.27856445,   0.03594971,   0.25048828,  -0.74584961,
-    -0.25350952,  -0.03302002,   0.31188965,   0.01571655,   0.46710205,   0.21591187,   0.07260132,
-    -0.42132568,  -0.53900146,  -0.13674927,  -0.16571045,  -0.34454346,   0.12359619,  -0.11184692,
-     0.00967407,   0.34576416,  -0.05761719,   0.34848022,   0.17645264,  -0.39395142,   0.10339355,
-     0.18215942,   0.20697021,   0.59109497,  -0.11560059,  -0.07385254,   0.10397339,   0.35437012,
-    -0.22863770,   0.01794434,   0.17559814,  -0.17495728,   0.12142944,   0.10928345,  -1.00000000,
-    -0.01379395,   0.21237183,  -0.27035522,   0.27319336,  -0.37066650,   0.41354370,  -0.40054321,
-     0.00689697,   0.26321411,   0.39266968,   0.65298462,   0.41625977,  -0.13909912,   0.78375244,
-    -0.30941772,   0.20169067,  -0.39367676,   0.94021606,  -0.24066162,   0.05557251,  -0.24533081,
-    -0.05444336,  -0.76754761,  -0.19375610,  -0.11041260,  -0.17532349,   0.16006470,   0.02188110,
-     0.17465210,  -0.04342651,  -0.56777954,  -0.40988159,   0.26687622,   0.11700439,  -0.00344849,
-    -0.05395508,   0.37426758,  -0.40719604,  -0.15032959,  -0.01660156,   0.04196167,  -0.04559326,
-    -0.12969971,   0.12011719,   0.08419800,  -0.11199951,   0.35174561,   0.10275269,  -0.25686646,
-     0.48446655,   0.03225708,   0.28408813,  -0.18701172,   0.36282349,  -0.03280640,   0.32302856,
-     0.17233276,   0.48269653,   0.31112671,  -0.04946899,   0.12774658,   0.52685547,   0.10211182,
-     0.05953979,   0.05999756,   0.20144653,   0.00744629,   0.27316284,   0.24377441,   0.39672852,
-     0.01702881,  -0.35513306,   0.11364746,  -0.13555908,   0.48880005,  -0.15417480,  -0.09149170,
-    -0.02615356,   0.46246338,  -0.72250366,   0.22332764,   0.23849487,  -0.25686646,  -0.08514404,
-    -0.02062988,  -0.34494019,  -0.02297974,  -0.80386353,  -0.08074951,  -0.12689209,  -0.06896973,
-     0.24099731,  -0.35650635,  -0.09558105,   0.29254150,   0.23132324,  -0.16726685,   0.00000000,
-    -0.24237061,   0.30899048,   0.29504395,  -0.20898438,   0.17059326,  -0.07672119,  -0.14395142,
-     0.05572510,   0.20602417,  -0.51550293,  -0.03167725,  -0.48840332,  -0.20425415,   0.14144897,
-     0.07275391,  -0.76669312,  -0.22488403,   0.20651245,   0.03259277,   0.00085449,   0.03039551,
-     0.47555542,   0.38351440
-};
-
-/** Noise level table for power compensation.
- *  Equ: pow(2.0f, (double)(6 - i) / 3.0f) where i = 0...15 */
-static const float pwc_levs[16] = {
-    3.96875, 3.15625,     2.5,    2.0, 1.59375,   1.25,     1.0, 0.78125,
-    0.625,       0.5, 0.40625, 0.3125,    0.25, 0.1875, 0.15625, 0.0
-};
-
-/** Map subband number to quant unit number. */
-static const int subband_to_qu[17] = {
-    0, 8, 12, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32
-};
-
-void ff_atrac3p_power_compensation(Atrac3pChanUnitCtx *ctx, int ch_index,
-                                   float *sp, int rng_index, int sb)
-{
-    AtracGainInfo *g1, *g2;
-    float pwcsp[ATRAC3P_SUBBAND_SAMPLES], *dst, grp_lev, qu_lev;
-    int i, gain_lev, gcv = 0, qu, nsp;
-    int swap_ch = (ctx->unit_type == CH_UNIT_STEREO && ctx->swap_channels[sb]) ? 1 : 0;
-
-    if (ctx->channels[ch_index ^ swap_ch].power_levs[subband_to_powgrp[sb]] == ATRAC3P_POWER_COMP_OFF)
-        return;
-
-    /* generate initial noise spectrum */
-    for (i = 0; i < ATRAC3P_SUBBAND_SAMPLES; i++, rng_index++)
-        pwcsp[i] = noise_tab[rng_index & 0x3FF];
-
-    /* check gain control information */
-    g1 = &ctx->channels[ch_index ^ swap_ch].gain_data[sb];
-    g2 = &ctx->channels[ch_index ^ swap_ch].gain_data_prev[sb];
-
-    gain_lev = (g1->num_points > 0) ? (6 - g1->lev_code[0]) : 0;
-
-    for (i = 0; i < g2->num_points; i++)
-        gcv = FFMAX(gcv, gain_lev - (g2->lev_code[i] - 6));
-
-    for (i = 0; i < g1->num_points; i++)
-        gcv = FFMAX(gcv, 6 - g1->lev_code[i]);
-
-    grp_lev = pwc_levs[ctx->channels[ch_index ^ swap_ch].power_levs[subband_to_powgrp[sb]]] / (1 << gcv);
-
-    /* skip the lowest two quant units (frequencies 0...351 Hz) for subband 0 */
-    for (qu = subband_to_qu[sb] + (!sb ? 2 : 0); qu < subband_to_qu[sb + 1]; qu++) {
-        if (ctx->channels[ch_index].qu_wordlen[qu] <= 0)
-            continue;
-
-        qu_lev = ff_atrac3p_sf_tab[ctx->channels[ch_index].qu_sf_idx[qu]] *
-                 ff_atrac3p_mant_tab[ctx->channels[ch_index].qu_wordlen[qu]] /
-                 (1 << ctx->channels[ch_index].qu_wordlen[qu]) * grp_lev;
-
-        dst = &sp[ff_atrac3p_qu_to_spec_pos[qu]];
-        nsp = ff_atrac3p_qu_to_spec_pos[qu + 1] - ff_atrac3p_qu_to_spec_pos[qu];
-
-        for (i = 0; i < nsp; i++)
-            dst[i] += pwcsp[i] * qu_lev;
-    }
-}
-
-void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, FFTContext *mdct_ctx, float *pIn,
-                      float *pOut, int wind_id, int sb)
-{
-    int i;
-
-    if (sb & 1)
-        for (i = 0; i < ATRAC3P_SUBBAND_SAMPLES / 2; i++)
-            FFSWAP(float, pIn[i], pIn[ATRAC3P_SUBBAND_SAMPLES - 1 - i]);
-
-    mdct_ctx->imdct_calc(mdct_ctx, pOut, pIn);
-
-    /* Perform windowing on the output.
-     * ATRAC3+ uses two different MDCT windows:
-     * - The first one is just the plain sine window of size 256
-     * - The 2nd one is the plain sine window of size 128
-     *   wrapped into zero (at the start) and one (at the end) regions.
-     *   Both regions are 32 samples long. */
-    if (wind_id & 2) { /* 1st half: steep window */
-        memset(pOut, 0, sizeof(float) * 32);
-        fdsp->vector_fmul(&pOut[32], &pOut[32], ff_sine_64, 64);
-    } else /* 1st half: simple sine window */
-        fdsp->vector_fmul(pOut, pOut, ff_sine_128, ATRAC3P_MDCT_SIZE / 2);
-
-    if (wind_id & 1) { /* 2nd half: steep window */
-        fdsp->vector_fmul_reverse(&pOut[160], &pOut[160], ff_sine_64, 64);
-        memset(&pOut[224], 0, sizeof(float) * 32);
-    } else /* 2nd half: simple sine window */
-        fdsp->vector_fmul_reverse(&pOut[128], &pOut[128], ff_sine_128,
-                                  ATRAC3P_MDCT_SIZE / 2);
-}
-
-/* lookup table for fast modulo 23 op required for cyclic buffers of the IPQF */
-static const int mod23_lut[26] = {
-    23,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11,
-    12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0
-};
-
-/* First half of the 384-tap IPQF filtering coefficients. */
-static const float ipqf_coeffs1[ATRAC3P_PQF_FIR_LEN][16] = {
-    { -5.8336207e-7,    -8.0604229e-7,    -4.2005411e-7,    -4.4400572e-8,
-       3.226247e-8,      3.530856e-8,      1.2660377e-8,     0.000010516783,
-      -0.000011838618,   6.005389e-7,      0.0000014333754,  0.0000023108685,
-       0.0000032569742,  0.0000046192422,  0.0000063894258,  0.0000070302972 },
-    { -0.0000091622824, -0.000010502935,  -0.0000079212787, -0.0000041712024,
-      -0.0000026336629, -0.0000015432918, -5.7168614e-7,     0.0000018111954,
-       0.000023530851,   0.00002780562,    0.000032302323,   0.000036968919,
-       0.000041575615,   0.000045337845,   0.000046043948,   0.000048585582 },
-    { -0.000064464548,  -0.000068306952,  -0.000073081472,  -0.00007612785,
-      -0.000074850752,  -0.000070208509,  -0.000062285151,  -0.000058270442,
-      -0.000056296329,  -0.000049888811,  -0.000035615325,  -0.000018532943,
-       0.0000016657353,  0.00002610587,    0.000053397067,   0.00008079566 },
-    { -0.00054488552,   -0.00052537228,   -0.00049731287,   -0.00045778,
-      -0.00040612387,   -0.00034301577,   -0.00026866337,   -0.00018248901,
-      -0.000084307925,   0.000025081157,   0.00014135583,    0.00026649953,
-       0.00039945057,    0.00053928449,    0.00068422867,    0.00083093712 },
-    { -0.0014771431,    -0.001283227,     -0.0010566821,    -0.00079780724,
-      -0.00050782406,   -0.00018855913,    0.00015771533,    0.00052769453,
-       0.00091862219,    0.001326357,      0.0017469483,     0.0021754825,
-       0.0026067684,     0.0030352892,     0.0034549395,     0.0038591374 },
-    { -0.0022995141,    -0.001443546,     -0.00049266568,    0.00055068987,
-       0.001682895,      0.0028992873,     0.0041943151,     0.0055614738,
-       0.0069935122,     0.0084823566,     0.010018963,      0.011593862,
-       0.013196872,      0.014817309,      0.016444042,      0.018065533 },
-    { -0.034426283,     -0.034281436,     -0.033992987,     -0.033563249,
-      -0.032995768,     -0.032295227,     -0.031467363,     -0.030518902,
-      -0.02945766,      -0.028291954,     -0.027031265,     -0.025685543,
-      -0.024265358,     -0.022781773,     -0.021246184,     -0.019670162 },
-    { -0.0030586775,    -0.0037203205,    -0.0042847847,    -0.0047529764,
-      -0.0051268316,    -0.0054091476,    -0.0056034233,    -0.005714261,
-      -0.0057445862,    -0.0057025906,    -0.0055920109,    -0.0054194843,
-      -0.0051914565,    -0.0049146507,    -0.0045959447,    -0.0042418269 },
-    { -0.0016376863,    -0.0017651899,    -0.0018608454,    -0.0019252141,
-      -0.0019593791,    -0.0019653172,    -0.0019450618,    -0.0018990048,
-      -0.00183808,      -0.0017501717,    -0.0016481078,    -0.0015320742,
-      -0.0014046903,    -0.0012685474,    -0.001125814,     -0.00097943726 },
-    { -0.00055432378,   -0.00055472925,   -0.00054783461,   -0.00053276919,
-      -0.00051135791,   -0.00048466062,   -0.00045358928,   -0.00042499689,
-      -0.00036942671,   -0.0003392619,    -0.00030001783,   -0.00025986304,
-      -0.0002197204,    -0.00018116167,   -0.00014691355,   -0.00011279432 },
-    { -0.000064147389,  -0.00006174868,   -0.000054267788,  -0.000047133824,
-      -0.000042927582,  -0.000039477309,  -0.000036340745,  -0.000029687517,
-      -0.000049787737,  -0.000041577889,  -0.000033864744,  -0.000026534748,
-      -0.000019841305,  -0.000014789486,  -0.000013131184,  -0.0000099198869 },
-    { -0.0000062990207, -0.0000072701259, -0.000011984052,  -0.000017348082,
-      -0.000019907106,  -0.000021348773,  -0.000021961965,  -0.000012203576,
-      -0.000010840992,   4.6299544e-7,     5.2588763e-7,     2.7792686e-7,
-      -2.3649704e-7,    -0.0000010897784, -9.171448e-7,     -5.22682e-7 }
-};
-
-/* Second half of the 384-tap IPQF filtering coefficients. */
-static const float ipqf_coeffs2[ATRAC3P_PQF_FIR_LEN][16] = {
-    {  5.22682e-7,       9.171448e-7,      0.0000010897784,  2.3649704e-7,
-      -2.7792686e-7,    -5.2588763e-7,    -4.6299544e-7,     0.000010840992,
-      -0.000012203576,  -0.000021961965,  -0.000021348773,  -0.000019907106,
-      -0.000017348082,  -0.000011984052,  -0.0000072701259, -0.0000062990207 },
-    {  0.0000099198869,  0.000013131184,   0.000014789486,   0.000019841305,
-       0.000026534748,   0.000033864744,   0.000041577889,   0.000049787737,
-      -0.000029687517,  -0.000036340745,  -0.000039477309,  -0.000042927582,
-      -0.000047133824,  -0.000054267788,  -0.00006174868,   -0.000064147389 },
-    {  0.00011279432,    0.00014691355,    0.00018116167,    0.0002197204,
-       0.00025986304,    0.00030001783,    0.0003392619,     0.00036942671,
-      -0.00042499689,   -0.00045358928,   -0.00048466062,   -0.00051135791,
-      -0.00053276919,   -0.00054783461,   -0.00055472925,   -0.00055432378 },
-    {  0.00097943726,    0.001125814,      0.0012685474,     0.0014046903,
-       0.0015320742,     0.0016481078,     0.0017501717,     0.00183808,
-      -0.0018990048,    -0.0019450618,    -0.0019653172,    -0.0019593791,
-      -0.0019252141,    -0.0018608454,    -0.0017651899,    -0.0016376863 },
-    {  0.0042418269,     0.0045959447,     0.0049146507,     0.0051914565,
-       0.0054194843,     0.0055920109,     0.0057025906,     0.0057445862,
-      -0.005714261,     -0.0056034233,    -0.0054091476,    -0.0051268316,
-      -0.0047529764,    -0.0042847847,    -0.0037203205,    -0.0030586775 },
-    {  0.019670162,      0.021246184,      0.022781773,      0.024265358,
-       0.025685543,      0.027031265,      0.028291954,      0.02945766,
-      -0.030518902,     -0.031467363,     -0.032295227,     -0.032995768,
-      -0.033563249,     -0.033992987,     -0.034281436,     -0.034426283 },
-    { -0.018065533,     -0.016444042,     -0.014817309,     -0.013196872,
-      -0.011593862,     -0.010018963,     -0.0084823566,    -0.0069935122,
-       0.0055614738,     0.0041943151,     0.0028992873,     0.001682895,
-       0.00055068987,   -0.00049266568,   -0.001443546,     -0.0022995141 },
-    { -0.0038591374,    -0.0034549395,    -0.0030352892,    -0.0026067684,
-      -0.0021754825,    -0.0017469483,    -0.001326357,     -0.00091862219,
-       0.00052769453,    0.00015771533,   -0.00018855913,   -0.00050782406,
-      -0.00079780724,   -0.0010566821,    -0.001283227,     -0.0014771431 },
-    { -0.00083093712,   -0.00068422867,   -0.00053928449,   -0.00039945057,
-      -0.00026649953,   -0.00014135583,   -0.000025081157,   0.000084307925,
-      -0.00018248901,   -0.00026866337,   -0.00034301577,   -0.00040612387,
-      -0.00045778,      -0.00049731287,   -0.00052537228,   -0.00054488552 },
-    { -0.00008079566,   -0.000053397067,  -0.00002610587,   -0.0000016657353,
-       0.000018532943,   0.000035615325,   0.000049888811,   0.000056296329,
-      -0.000058270442,  -0.000062285151,  -0.000070208509,  -0.000074850752,
-      -0.00007612785,   -0.000073081472,  -0.000068306952,  -0.000064464548 },
-    { -0.000048585582,  -0.000046043948,  -0.000045337845,  -0.000041575615,
-      -0.000036968919,  -0.000032302323,  -0.00002780562,   -0.000023530851,
-       0.0000018111954, -5.7168614e-7,    -0.0000015432918, -0.0000026336629,
-      -0.0000041712024, -0.0000079212787, -0.000010502935,  -0.0000091622824 },
-    { -0.0000070302972, -0.0000063894258, -0.0000046192422, -0.0000032569742,
-      -0.0000023108685, -0.0000014333754, -6.005389e-7,      0.000011838618,
-       0.000010516783,   1.2660377e-8,     3.530856e-8,      3.226247e-8,
-      -4.4400572e-8,    -4.2005411e-7,    -8.0604229e-7,    -5.8336207e-7 }
-};
-
-void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist,
-                     const float *in, float *out)
-{
-    int i, s, sb, t, pos_now, pos_next;
-    DECLARE_ALIGNED(32, float, idct_in)[ATRAC3P_SUBBANDS];
-    DECLARE_ALIGNED(32, float, idct_out)[ATRAC3P_SUBBANDS];
-
-    memset(out, 0, ATRAC3P_FRAME_SAMPLES * sizeof(*out));
-
-    for (s = 0; s < ATRAC3P_SUBBAND_SAMPLES; s++) {
-        /* pick up one sample from each subband */
-        for (sb = 0; sb < ATRAC3P_SUBBANDS; sb++)
-            idct_in[sb] = in[sb * ATRAC3P_SUBBAND_SAMPLES + s];
-
-        /* Calculate the sine and cosine part of the PQF using IDCT-IV */
-        dct_ctx->imdct_half(dct_ctx, idct_out, idct_in);
-
-        /* append the result to the history */
-        for (i = 0; i < 8; i++) {
-            hist->buf1[hist->pos][i] = idct_out[i + 8];
-            hist->buf2[hist->pos][i] = idct_out[7 - i];
-        }
-
-        pos_now  = hist->pos;
-        pos_next = mod23_lut[pos_now + 2]; // pos_next = (pos_now + 1) % 23;
-
-        for (t = 0; t < ATRAC3P_PQF_FIR_LEN; t++) {
-            for (i = 0; i < 8; i++) {
-                out[s * 16 + i + 0] += hist->buf1[pos_now][i]  * ipqf_coeffs1[t][i] +
-                                       hist->buf2[pos_next][i] * ipqf_coeffs2[t][i];
-                out[s * 16 + i + 8] += hist->buf1[pos_now][7 - i]  * ipqf_coeffs1[t][i + 8] +
-                                       hist->buf2[pos_next][7 - i] * ipqf_coeffs2[t][i + 8];
-            }
-
-            pos_now  = mod23_lut[pos_next + 2]; // pos_now  = (pos_now  + 2) % 23;
-            pos_next = mod23_lut[pos_now + 2];  // pos_next = (pos_next + 2) % 23;
-        }
-
-        hist->pos = mod23_lut[hist->pos]; // hist->pos = (hist->pos - 1) % 23;
-    }
-}
diff --git a/deps/libav/libavcodec/audio_frame_queue.c b/deps/libav/libavcodec/audio_frame_queue.c
deleted file mode 100644
index 0a8b25c..0000000
--- a/deps/libav/libavcodec/audio_frame_queue.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Audio Frame Queue
- * Copyright (c) 2012 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "internal.h"
-#include "audio_frame_queue.h"
-
-av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
-{
-    afq->avctx             = avctx;
-    afq->next_pts          = AV_NOPTS_VALUE;
-    afq->remaining_delay   = avctx->delay;
-    afq->remaining_samples = avctx->delay;
-    afq->frame_queue       = NULL;
-}
-
-static void delete_next_frame(AudioFrameQueue *afq)
-{
-    AudioFrame *f = afq->frame_queue;
-    if (f) {
-        afq->frame_queue = f->next;
-        f->next = NULL;
-        av_freep(&f);
-    }
-}
-
-void ff_af_queue_close(AudioFrameQueue *afq)
-{
-    /* remove/free any remaining frames */
-    while (afq->frame_queue)
-        delete_next_frame(afq);
-    memset(afq, 0, sizeof(*afq));
-}
-
-#ifdef DEBUG
-static void af_queue_log_state(AudioFrameQueue *afq)
-{
-    AudioFrame *f;
-    av_dlog(afq->avctx, "remaining delay   = %d\n", afq->remaining_delay);
-    av_dlog(afq->avctx, "remaining samples = %d\n", afq->remaining_samples);
-    av_dlog(afq->avctx, "frames:\n");
-    f = afq->frame_queue;
-    while (f) {
-        av_dlog(afq->avctx, "  [ pts=%9"PRId64" duration=%d ]\n",
-                f->pts, f->duration);
-        f = f->next;
-    }
-}
-#endif /* DEBUG */
-
-int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
-{
-    AudioFrame *new_frame;
-    AudioFrame *queue_end = afq->frame_queue;
-
-    /* find the end of the queue */
-    while (queue_end && queue_end->next)
-        queue_end = queue_end->next;
-
-    /* allocate new frame queue entry */
-    if (!(new_frame = av_malloc(sizeof(*new_frame))))
-        return AVERROR(ENOMEM);
-
-    /* get frame parameters */
-    new_frame->next = NULL;
-    new_frame->duration = f->nb_samples;
-    if (f->pts != AV_NOPTS_VALUE) {
-        new_frame->pts = av_rescale_q(f->pts,
-                                      afq->avctx->time_base,
-                                      (AVRational){ 1, afq->avctx->sample_rate });
-        afq->next_pts = new_frame->pts + new_frame->duration;
-    } else {
-        new_frame->pts = AV_NOPTS_VALUE;
-        afq->next_pts  = AV_NOPTS_VALUE;
-    }
-
-    /* add new frame to the end of the queue */
-    if (!queue_end)
-        afq->frame_queue = new_frame;
-    else
-        queue_end->next = new_frame;
-
-    /* add frame sample count */
-    afq->remaining_samples += f->nb_samples;
-
-#ifdef DEBUG
-    af_queue_log_state(afq);
-#endif
-
-    return 0;
-}
-
-void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
-                        int *duration)
-{
-    int64_t out_pts = AV_NOPTS_VALUE;
-    int removed_samples = 0;
-
-#ifdef DEBUG
-    af_queue_log_state(afq);
-#endif
-
-    /* get output pts from the next frame or generated pts */
-    if (afq->frame_queue) {
-        if (afq->frame_queue->pts != AV_NOPTS_VALUE)
-            out_pts = afq->frame_queue->pts - afq->remaining_delay;
-    } else {
-        if (afq->next_pts != AV_NOPTS_VALUE)
-            out_pts = afq->next_pts - afq->remaining_delay;
-    }
-    if (pts) {
-        if (out_pts != AV_NOPTS_VALUE)
-            *pts = ff_samples_to_time_base(afq->avctx, out_pts);
-        else
-            *pts = AV_NOPTS_VALUE;
-    }
-
-    /* if the delay is larger than the packet duration, we use up delay samples
-       for the output packet and leave all frames in the queue */
-    if (afq->remaining_delay >= nb_samples) {
-        removed_samples      += nb_samples;
-        afq->remaining_delay -= nb_samples;
-    }
-    /* remove frames from the queue until we have enough to cover the
-       requested number of samples or until the queue is empty */
-    while (removed_samples < nb_samples && afq->frame_queue) {
-        removed_samples += afq->frame_queue->duration;
-        delete_next_frame(afq);
-    }
-    afq->remaining_samples -= removed_samples;
-
-    /* if there are no frames left and we have room for more samples, use
-       any remaining delay samples */
-    if (removed_samples < nb_samples && afq->remaining_samples > 0) {
-        int add_samples = FFMIN(afq->remaining_samples,
-                                nb_samples - removed_samples);
-        removed_samples        += add_samples;
-        afq->remaining_samples -= add_samples;
-    }
-    if (removed_samples > nb_samples)
-        av_log(afq->avctx, AV_LOG_WARNING, "frame_size is too large\n");
-    if (duration)
-        *duration = ff_samples_to_time_base(afq->avctx, removed_samples);
-}
diff --git a/deps/libav/libavcodec/audio_frame_queue.h b/deps/libav/libavcodec/audio_frame_queue.h
deleted file mode 100644
index 4a29770..0000000
--- a/deps/libav/libavcodec/audio_frame_queue.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Audio Frame Queue
- * Copyright (c) 2012 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AUDIO_FRAME_QUEUE_H
-#define AVCODEC_AUDIO_FRAME_QUEUE_H
-
-#include "avcodec.h"
-
-typedef struct AudioFrame {
-    int64_t pts;
-    int duration;
-    struct AudioFrame *next;
-} AudioFrame;
-
-typedef struct AudioFrameQueue {
-    AVCodecContext *avctx;
-    int64_t next_pts;
-    int remaining_delay;
-    int remaining_samples;
-    AudioFrame *frame_queue;
-} AudioFrameQueue;
-
-/**
- * Initialize AudioFrameQueue.
- *
- * @param avctx context to use for time_base and av_log
- * @param afq   queue context
- */
-void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq);
-
-/**
- * Close AudioFrameQueue.
- *
- * Frees memory if needed.
- *
- * @param afq queue context
- */
-void ff_af_queue_close(AudioFrameQueue *afq);
-
-/**
- * Add a frame to the queue.
- *
- * @param afq queue context
- * @param f   frame to add to the queue
- */
-int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f);
-
-/**
- * Remove frame(s) from the queue.
- *
- * Retrieves the pts of the next available frame, or a generated pts based on
- * the last frame duration if there are no frames left in the queue. The number
- * of requested samples should be the full number of samples represented by the
- * packet that will be output by the encoder. If fewer samples are available
- * in the queue, a smaller value will be used for the output duration.
- *
- * @param afq           queue context
- * @param nb_samples    number of samples to remove from the queue
- * @param[out] pts      output packet pts
- * @param[out] duration output packet duration
- */
-void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
-                        int *duration);
-
-#endif /* AVCODEC_AUDIO_FRAME_QUEUE_H */
diff --git a/deps/libav/libavcodec/aura.c b/deps/libav/libavcodec/aura.c
deleted file mode 100644
index a32c18b..0000000
--- a/deps/libav/libavcodec/aura.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Aura 2 decoder
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Aura 2 decoder
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/internal.h"
-
-static av_cold int aura_decode_init(AVCodecContext *avctx)
-{
-    /* width needs to be divisible by 4 for this codec to work */
-    if (avctx->width & 0x3)
-        return AVERROR(EINVAL);
-    avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-
-    return 0;
-}
-
-static int aura_decode_frame(AVCodecContext *avctx,
-                             void *data, int *got_frame,
-                             AVPacket *pkt)
-{
-    AVFrame *frame = data;
-    uint8_t *Y, *U, *V;
-    uint8_t val;
-    int x, y, ret;
-    const uint8_t *buf = pkt->data;
-
-    /* prediction error tables (make it clear that they are signed values) */
-    const int8_t *delta_table = (const int8_t*)buf + 16;
-
-    if (pkt->size != 48 + avctx->height * avctx->width) {
-        av_log(avctx, AV_LOG_ERROR, "got a buffer with %d bytes when %d were expected\n",
-               pkt->size, 48 + avctx->height * avctx->width);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* pixel data starts 48 bytes in, after 3x16-byte tables */
-    buf += 48;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    Y = frame->data[0];
-    U = frame->data[1];
-    V = frame->data[2];
-
-    /* iterate through each line in the height */
-    for (y = 0; y < avctx->height; y++) {
-        /* reset predictors */
-        val  = *buf++;
-        U[0] = val & 0xF0;
-        Y[0] = val << 4;
-        val  = *buf++;
-        V[0] = val & 0xF0;
-        Y[1] = Y[0] + delta_table[val & 0xF];
-        Y   += 2; U++; V++;
-
-        /* iterate through the remaining pixel groups (4 pixels/group) */
-        for (x = 1; x < (avctx->width >> 1); x++) {
-            val  = *buf++;
-            U[0] = U[-1] + delta_table[val >> 4];
-            Y[0] = Y[-1] + delta_table[val & 0xF];
-            val  = *buf++;
-            V[0] = V[-1] + delta_table[val >> 4];
-            Y[1] = Y[ 0] + delta_table[val & 0xF];
-            Y   += 2; U++; V++;
-        }
-        Y += frame->linesize[0] -  avctx->width;
-        U += frame->linesize[1] - (avctx->width >> 1);
-        V += frame->linesize[2] - (avctx->width >> 1);
-    }
-
-    *got_frame = 1;
-
-    return pkt->size;
-}
-
-AVCodec ff_aura2_decoder = {
-    .name           = "aura2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Auravision Aura 2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_AURA2,
-    .init           = aura_decode_init,
-    .decode         = aura_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/avcodec.h b/deps/libav/libavcodec/avcodec.h
deleted file mode 100644
index 244f47b..0000000
--- a/deps/libav/libavcodec/avcodec.h
+++ /dev/null
@@ -1,4356 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AVCODEC_H
-#define AVCODEC_AVCODEC_H
-
-/**
- * @file
- * @ingroup libavc
- * Libavcodec external API header
- */
-
-#include <errno.h>
-#include "libavutil/samplefmt.h"
-#include "libavutil/attributes.h"
-#include "libavutil/avutil.h"
-#include "libavutil/buffer.h"
-#include "libavutil/cpu.h"
-#include "libavutil/dict.h"
-#include "libavutil/frame.h"
-#include "libavutil/log.h"
-#include "libavutil/pixfmt.h"
-#include "libavutil/rational.h"
-
-#include "version.h"
-
-#if FF_API_FAST_MALLOC
-// to provide fast_*alloc
-#include "libavutil/mem.h"
-#endif
-
-/**
- * @defgroup libavc Encoding/Decoding Library
- * @{
- *
- * @defgroup lavc_decoding Decoding
- * @{
- * @}
- *
- * @defgroup lavc_encoding Encoding
- * @{
- * @}
- *
- * @defgroup lavc_codec Codecs
- * @{
- * @defgroup lavc_codec_native Native Codecs
- * @{
- * @}
- * @defgroup lavc_codec_wrappers External library wrappers
- * @{
- * @}
- * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge
- * @{
- * @}
- * @}
- * @defgroup lavc_internal Internal
- * @{
- * @}
- * @}
- *
- */
-
-/**
- * @defgroup lavc_core Core functions/structures.
- * @ingroup libavc
- *
- * Basic definitions, functions for querying libavcodec capabilities,
- * allocating core structures, etc.
- * @{
- */
-
-
-/**
- * Identify the syntax and semantics of the bitstream.
- * The principle is roughly:
- * Two decoders with the same ID can decode the same streams.
- * Two encoders with the same ID can encode compatible streams.
- * There may be slight deviations from the principle due to implementation
- * details.
- *
- * If you add a codec ID to this list, add it so that
- * 1. no value of a existing codec ID changes (that would break ABI),
- * 2. it is as close as possible to similar codecs.
- *
- * After adding new codec IDs, do not forget to add an entry to the codec
- * descriptor list and bump libavcodec minor version.
- */
-enum AVCodecID {
-    AV_CODEC_ID_NONE,
-
-    /* video codecs */
-    AV_CODEC_ID_MPEG1VIDEO,
-    AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
-#if FF_API_XVMC
-    AV_CODEC_ID_MPEG2VIDEO_XVMC,
-#endif /* FF_API_XVMC */
-    AV_CODEC_ID_H261,
-    AV_CODEC_ID_H263,
-    AV_CODEC_ID_RV10,
-    AV_CODEC_ID_RV20,
-    AV_CODEC_ID_MJPEG,
-    AV_CODEC_ID_MJPEGB,
-    AV_CODEC_ID_LJPEG,
-    AV_CODEC_ID_SP5X,
-    AV_CODEC_ID_JPEGLS,
-    AV_CODEC_ID_MPEG4,
-    AV_CODEC_ID_RAWVIDEO,
-    AV_CODEC_ID_MSMPEG4V1,
-    AV_CODEC_ID_MSMPEG4V2,
-    AV_CODEC_ID_MSMPEG4V3,
-    AV_CODEC_ID_WMV1,
-    AV_CODEC_ID_WMV2,
-    AV_CODEC_ID_H263P,
-    AV_CODEC_ID_H263I,
-    AV_CODEC_ID_FLV1,
-    AV_CODEC_ID_SVQ1,
-    AV_CODEC_ID_SVQ3,
-    AV_CODEC_ID_DVVIDEO,
-    AV_CODEC_ID_HUFFYUV,
-    AV_CODEC_ID_CYUV,
-    AV_CODEC_ID_H264,
-    AV_CODEC_ID_INDEO3,
-    AV_CODEC_ID_VP3,
-    AV_CODEC_ID_THEORA,
-    AV_CODEC_ID_ASV1,
-    AV_CODEC_ID_ASV2,
-    AV_CODEC_ID_FFV1,
-    AV_CODEC_ID_4XM,
-    AV_CODEC_ID_VCR1,
-    AV_CODEC_ID_CLJR,
-    AV_CODEC_ID_MDEC,
-    AV_CODEC_ID_ROQ,
-    AV_CODEC_ID_INTERPLAY_VIDEO,
-    AV_CODEC_ID_XAN_WC3,
-    AV_CODEC_ID_XAN_WC4,
-    AV_CODEC_ID_RPZA,
-    AV_CODEC_ID_CINEPAK,
-    AV_CODEC_ID_WS_VQA,
-    AV_CODEC_ID_MSRLE,
-    AV_CODEC_ID_MSVIDEO1,
-    AV_CODEC_ID_IDCIN,
-    AV_CODEC_ID_8BPS,
-    AV_CODEC_ID_SMC,
-    AV_CODEC_ID_FLIC,
-    AV_CODEC_ID_TRUEMOTION1,
-    AV_CODEC_ID_VMDVIDEO,
-    AV_CODEC_ID_MSZH,
-    AV_CODEC_ID_ZLIB,
-    AV_CODEC_ID_QTRLE,
-    AV_CODEC_ID_TSCC,
-    AV_CODEC_ID_ULTI,
-    AV_CODEC_ID_QDRAW,
-    AV_CODEC_ID_VIXL,
-    AV_CODEC_ID_QPEG,
-    AV_CODEC_ID_PNG,
-    AV_CODEC_ID_PPM,
-    AV_CODEC_ID_PBM,
-    AV_CODEC_ID_PGM,
-    AV_CODEC_ID_PGMYUV,
-    AV_CODEC_ID_PAM,
-    AV_CODEC_ID_FFVHUFF,
-    AV_CODEC_ID_RV30,
-    AV_CODEC_ID_RV40,
-    AV_CODEC_ID_VC1,
-    AV_CODEC_ID_WMV3,
-    AV_CODEC_ID_LOCO,
-    AV_CODEC_ID_WNV1,
-    AV_CODEC_ID_AASC,
-    AV_CODEC_ID_INDEO2,
-    AV_CODEC_ID_FRAPS,
-    AV_CODEC_ID_TRUEMOTION2,
-    AV_CODEC_ID_BMP,
-    AV_CODEC_ID_CSCD,
-    AV_CODEC_ID_MMVIDEO,
-    AV_CODEC_ID_ZMBV,
-    AV_CODEC_ID_AVS,
-    AV_CODEC_ID_SMACKVIDEO,
-    AV_CODEC_ID_NUV,
-    AV_CODEC_ID_KMVC,
-    AV_CODEC_ID_FLASHSV,
-    AV_CODEC_ID_CAVS,
-    AV_CODEC_ID_JPEG2000,
-    AV_CODEC_ID_VMNC,
-    AV_CODEC_ID_VP5,
-    AV_CODEC_ID_VP6,
-    AV_CODEC_ID_VP6F,
-    AV_CODEC_ID_TARGA,
-    AV_CODEC_ID_DSICINVIDEO,
-    AV_CODEC_ID_TIERTEXSEQVIDEO,
-    AV_CODEC_ID_TIFF,
-    AV_CODEC_ID_GIF,
-    AV_CODEC_ID_DXA,
-    AV_CODEC_ID_DNXHD,
-    AV_CODEC_ID_THP,
-    AV_CODEC_ID_SGI,
-    AV_CODEC_ID_C93,
-    AV_CODEC_ID_BETHSOFTVID,
-    AV_CODEC_ID_PTX,
-    AV_CODEC_ID_TXD,
-    AV_CODEC_ID_VP6A,
-    AV_CODEC_ID_AMV,
-    AV_CODEC_ID_VB,
-    AV_CODEC_ID_PCX,
-    AV_CODEC_ID_SUNRAST,
-    AV_CODEC_ID_INDEO4,
-    AV_CODEC_ID_INDEO5,
-    AV_CODEC_ID_MIMIC,
-    AV_CODEC_ID_RL2,
-    AV_CODEC_ID_ESCAPE124,
-    AV_CODEC_ID_DIRAC,
-    AV_CODEC_ID_BFI,
-    AV_CODEC_ID_CMV,
-    AV_CODEC_ID_MOTIONPIXELS,
-    AV_CODEC_ID_TGV,
-    AV_CODEC_ID_TGQ,
-    AV_CODEC_ID_TQI,
-    AV_CODEC_ID_AURA,
-    AV_CODEC_ID_AURA2,
-    AV_CODEC_ID_V210X,
-    AV_CODEC_ID_TMV,
-    AV_CODEC_ID_V210,
-    AV_CODEC_ID_DPX,
-    AV_CODEC_ID_MAD,
-    AV_CODEC_ID_FRWU,
-    AV_CODEC_ID_FLASHSV2,
-    AV_CODEC_ID_CDGRAPHICS,
-    AV_CODEC_ID_R210,
-    AV_CODEC_ID_ANM,
-    AV_CODEC_ID_BINKVIDEO,
-    AV_CODEC_ID_IFF_ILBM,
-    AV_CODEC_ID_IFF_BYTERUN1,
-    AV_CODEC_ID_KGV1,
-    AV_CODEC_ID_YOP,
-    AV_CODEC_ID_VP8,
-    AV_CODEC_ID_PICTOR,
-    AV_CODEC_ID_ANSI,
-    AV_CODEC_ID_A64_MULTI,
-    AV_CODEC_ID_A64_MULTI5,
-    AV_CODEC_ID_R10K,
-    AV_CODEC_ID_MXPEG,
-    AV_CODEC_ID_LAGARITH,
-    AV_CODEC_ID_PRORES,
-    AV_CODEC_ID_JV,
-    AV_CODEC_ID_DFA,
-    AV_CODEC_ID_WMV3IMAGE,
-    AV_CODEC_ID_VC1IMAGE,
-    AV_CODEC_ID_UTVIDEO,
-    AV_CODEC_ID_BMV_VIDEO,
-    AV_CODEC_ID_VBLE,
-    AV_CODEC_ID_DXTORY,
-    AV_CODEC_ID_V410,
-    AV_CODEC_ID_XWD,
-    AV_CODEC_ID_CDXL,
-    AV_CODEC_ID_XBM,
-    AV_CODEC_ID_ZEROCODEC,
-    AV_CODEC_ID_MSS1,
-    AV_CODEC_ID_MSA1,
-    AV_CODEC_ID_TSCC2,
-    AV_CODEC_ID_MTS2,
-    AV_CODEC_ID_CLLC,
-    AV_CODEC_ID_MSS2,
-    AV_CODEC_ID_VP9,
-    AV_CODEC_ID_AIC,
-    AV_CODEC_ID_ESCAPE130,
-    AV_CODEC_ID_G2M,
-    AV_CODEC_ID_WEBP,
-    AV_CODEC_ID_HNM4_VIDEO,
-    AV_CODEC_ID_HEVC,
-    AV_CODEC_ID_FIC,
-
-    /* various PCM "codecs" */
-    AV_CODEC_ID_FIRST_AUDIO = 0x10000,     ///< A dummy id pointing at the start of audio codecs
-    AV_CODEC_ID_PCM_S16LE = 0x10000,
-    AV_CODEC_ID_PCM_S16BE,
-    AV_CODEC_ID_PCM_U16LE,
-    AV_CODEC_ID_PCM_U16BE,
-    AV_CODEC_ID_PCM_S8,
-    AV_CODEC_ID_PCM_U8,
-    AV_CODEC_ID_PCM_MULAW,
-    AV_CODEC_ID_PCM_ALAW,
-    AV_CODEC_ID_PCM_S32LE,
-    AV_CODEC_ID_PCM_S32BE,
-    AV_CODEC_ID_PCM_U32LE,
-    AV_CODEC_ID_PCM_U32BE,
-    AV_CODEC_ID_PCM_S24LE,
-    AV_CODEC_ID_PCM_S24BE,
-    AV_CODEC_ID_PCM_U24LE,
-    AV_CODEC_ID_PCM_U24BE,
-    AV_CODEC_ID_PCM_S24DAUD,
-    AV_CODEC_ID_PCM_ZORK,
-    AV_CODEC_ID_PCM_S16LE_PLANAR,
-    AV_CODEC_ID_PCM_DVD,
-    AV_CODEC_ID_PCM_F32BE,
-    AV_CODEC_ID_PCM_F32LE,
-    AV_CODEC_ID_PCM_F64BE,
-    AV_CODEC_ID_PCM_F64LE,
-    AV_CODEC_ID_PCM_BLURAY,
-    AV_CODEC_ID_PCM_LXF,
-    AV_CODEC_ID_S302M,
-    AV_CODEC_ID_PCM_S8_PLANAR,
-    AV_CODEC_ID_PCM_S24LE_PLANAR,
-    AV_CODEC_ID_PCM_S32LE_PLANAR,
-
-    /* various ADPCM codecs */
-    AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
-    AV_CODEC_ID_ADPCM_IMA_WAV,
-    AV_CODEC_ID_ADPCM_IMA_DK3,
-    AV_CODEC_ID_ADPCM_IMA_DK4,
-    AV_CODEC_ID_ADPCM_IMA_WS,
-    AV_CODEC_ID_ADPCM_IMA_SMJPEG,
-    AV_CODEC_ID_ADPCM_MS,
-    AV_CODEC_ID_ADPCM_4XM,
-    AV_CODEC_ID_ADPCM_XA,
-    AV_CODEC_ID_ADPCM_ADX,
-    AV_CODEC_ID_ADPCM_EA,
-    AV_CODEC_ID_ADPCM_G726,
-    AV_CODEC_ID_ADPCM_CT,
-    AV_CODEC_ID_ADPCM_SWF,
-    AV_CODEC_ID_ADPCM_YAMAHA,
-    AV_CODEC_ID_ADPCM_SBPRO_4,
-    AV_CODEC_ID_ADPCM_SBPRO_3,
-    AV_CODEC_ID_ADPCM_SBPRO_2,
-    AV_CODEC_ID_ADPCM_THP,
-    AV_CODEC_ID_ADPCM_IMA_AMV,
-    AV_CODEC_ID_ADPCM_EA_R1,
-    AV_CODEC_ID_ADPCM_EA_R3,
-    AV_CODEC_ID_ADPCM_EA_R2,
-    AV_CODEC_ID_ADPCM_IMA_EA_SEAD,
-    AV_CODEC_ID_ADPCM_IMA_EA_EACS,
-    AV_CODEC_ID_ADPCM_EA_XAS,
-    AV_CODEC_ID_ADPCM_EA_MAXIS_XA,
-    AV_CODEC_ID_ADPCM_IMA_ISS,
-    AV_CODEC_ID_ADPCM_G722,
-    AV_CODEC_ID_ADPCM_IMA_APC,
-
-    /* AMR */
-    AV_CODEC_ID_AMR_NB = 0x12000,
-    AV_CODEC_ID_AMR_WB,
-
-    /* RealAudio codecs*/
-    AV_CODEC_ID_RA_144 = 0x13000,
-    AV_CODEC_ID_RA_288,
-
-    /* various DPCM codecs */
-    AV_CODEC_ID_ROQ_DPCM = 0x14000,
-    AV_CODEC_ID_INTERPLAY_DPCM,
-    AV_CODEC_ID_XAN_DPCM,
-    AV_CODEC_ID_SOL_DPCM,
-
-    /* audio codecs */
-    AV_CODEC_ID_MP2 = 0x15000,
-    AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
-    AV_CODEC_ID_AAC,
-    AV_CODEC_ID_AC3,
-    AV_CODEC_ID_DTS,
-    AV_CODEC_ID_VORBIS,
-    AV_CODEC_ID_DVAUDIO,
-    AV_CODEC_ID_WMAV1,
-    AV_CODEC_ID_WMAV2,
-    AV_CODEC_ID_MACE3,
-    AV_CODEC_ID_MACE6,
-    AV_CODEC_ID_VMDAUDIO,
-    AV_CODEC_ID_FLAC,
-    AV_CODEC_ID_MP3ADU,
-    AV_CODEC_ID_MP3ON4,
-    AV_CODEC_ID_SHORTEN,
-    AV_CODEC_ID_ALAC,
-    AV_CODEC_ID_WESTWOOD_SND1,
-    AV_CODEC_ID_GSM, ///< as in Berlin toast format
-    AV_CODEC_ID_QDM2,
-    AV_CODEC_ID_COOK,
-    AV_CODEC_ID_TRUESPEECH,
-    AV_CODEC_ID_TTA,
-    AV_CODEC_ID_SMACKAUDIO,
-    AV_CODEC_ID_QCELP,
-    AV_CODEC_ID_WAVPACK,
-    AV_CODEC_ID_DSICINAUDIO,
-    AV_CODEC_ID_IMC,
-    AV_CODEC_ID_MUSEPACK7,
-    AV_CODEC_ID_MLP,
-    AV_CODEC_ID_GSM_MS, /* as found in WAV */
-    AV_CODEC_ID_ATRAC3,
-#if FF_API_VOXWARE
-    AV_CODEC_ID_VOXWARE,
-#endif
-    AV_CODEC_ID_APE,
-    AV_CODEC_ID_NELLYMOSER,
-    AV_CODEC_ID_MUSEPACK8,
-    AV_CODEC_ID_SPEEX,
-    AV_CODEC_ID_WMAVOICE,
-    AV_CODEC_ID_WMAPRO,
-    AV_CODEC_ID_WMALOSSLESS,
-    AV_CODEC_ID_ATRAC3P,
-    AV_CODEC_ID_EAC3,
-    AV_CODEC_ID_SIPR,
-    AV_CODEC_ID_MP1,
-    AV_CODEC_ID_TWINVQ,
-    AV_CODEC_ID_TRUEHD,
-    AV_CODEC_ID_MP4ALS,
-    AV_CODEC_ID_ATRAC1,
-    AV_CODEC_ID_BINKAUDIO_RDFT,
-    AV_CODEC_ID_BINKAUDIO_DCT,
-    AV_CODEC_ID_AAC_LATM,
-    AV_CODEC_ID_QDMC,
-    AV_CODEC_ID_CELT,
-    AV_CODEC_ID_G723_1,
-    AV_CODEC_ID_G729,
-    AV_CODEC_ID_8SVX_EXP,
-    AV_CODEC_ID_8SVX_FIB,
-    AV_CODEC_ID_BMV_AUDIO,
-    AV_CODEC_ID_RALF,
-    AV_CODEC_ID_IAC,
-    AV_CODEC_ID_ILBC,
-    AV_CODEC_ID_OPUS,
-    AV_CODEC_ID_COMFORT_NOISE,
-    AV_CODEC_ID_TAK,
-    AV_CODEC_ID_METASOUND,
-
-    /* subtitle codecs */
-    AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,          ///< A dummy ID pointing at the start of subtitle codecs.
-    AV_CODEC_ID_DVD_SUBTITLE = 0x17000,
-    AV_CODEC_ID_DVB_SUBTITLE,
-    AV_CODEC_ID_TEXT,  ///< raw UTF-8 text
-    AV_CODEC_ID_XSUB,
-    AV_CODEC_ID_SSA,
-    AV_CODEC_ID_MOV_TEXT,
-    AV_CODEC_ID_HDMV_PGS_SUBTITLE,
-    AV_CODEC_ID_DVB_TELETEXT,
-    AV_CODEC_ID_SRT,
-
-    /* other specific kind of codecs (generally used for attachments) */
-    AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,           ///< A dummy ID pointing at the start of various fake codecs.
-    AV_CODEC_ID_TTF = 0x18000,
-
-    AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
-
-    AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
-                                * stream (only used by libavformat) */
-    AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
-                                * stream (only used by libavformat) */
-    AV_CODEC_ID_FFMETADATA = 0x21000,   ///< Dummy codec for streams containing only metadata information.
-};
-
-/**
- * This struct describes the properties of a single codec described by an
- * AVCodecID.
- * @see avcodec_get_descriptor()
- */
-typedef struct AVCodecDescriptor {
-    enum AVCodecID     id;
-    enum AVMediaType type;
-    /**
-     * Name of the codec described by this descriptor. It is non-empty and
-     * unique for each codec descriptor. It should contain alphanumeric
-     * characters and '_' only.
-     */
-    const char      *name;
-    /**
-     * A more descriptive name for this codec. May be NULL.
-     */
-    const char *long_name;
-    /**
-     * Codec properties, a combination of AV_CODEC_PROP_* flags.
-     */
-    int             props;
-} AVCodecDescriptor;
-
-/**
- * Codec uses only intra compression.
- * Video codecs only.
- */
-#define AV_CODEC_PROP_INTRA_ONLY    (1 << 0)
-/**
- * Codec supports lossy compression. Audio and video codecs only.
- * @note a codec may support both lossy and lossless
- * compression modes
- */
-#define AV_CODEC_PROP_LOSSY         (1 << 1)
-/**
- * Codec supports lossless compression. Audio and video codecs only.
- */
-#define AV_CODEC_PROP_LOSSLESS      (1 << 2)
-
-/**
- * @ingroup lavc_decoding
- * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
- * This is mainly needed because some optimized bitstream readers read
- * 32 or 64 bit at once and could read over the end.<br>
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged
- * MPEG bitstreams could cause overread and segfault.
- */
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-
-/**
- * @ingroup lavc_encoding
- * minimum encoding buffer size
- * Used to avoid some checks during header writing.
- */
-#define FF_MIN_BUFFER_SIZE 16384
-
-
-/**
- * @ingroup lavc_encoding
- * motion estimation type.
- */
-enum Motion_Est_ID {
-    ME_ZERO = 1,    ///< no search, that is use 0,0 vector whenever one is needed
-    ME_FULL,
-    ME_LOG,
-    ME_PHODS,
-    ME_EPZS,        ///< enhanced predictive zonal search
-    ME_X1,          ///< reserved for experiments
-    ME_HEX,         ///< hexagon based search
-    ME_UMH,         ///< uneven multi-hexagon search
-    ME_TESA,        ///< transformed exhaustive search algorithm
-};
-
-/**
- * @ingroup lavc_decoding
- */
-enum AVDiscard{
-    /* We leave some space between them for extensions (drop some
-     * keyframes for intra-only or drop just some bidir frames). */
-    AVDISCARD_NONE    =-16, ///< discard nothing
-    AVDISCARD_DEFAULT =  0, ///< discard useless packets like 0 size packets in avi
-    AVDISCARD_NONREF  =  8, ///< discard all non reference
-    AVDISCARD_BIDIR   = 16, ///< discard all bidirectional frames
-    AVDISCARD_NONKEY  = 32, ///< discard all frames except keyframes
-    AVDISCARD_ALL     = 48, ///< discard all
-};
-
-enum AVColorPrimaries{
-    AVCOL_PRI_BT709       = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
-    AVCOL_PRI_UNSPECIFIED = 2,
-    AVCOL_PRI_BT470M      = 4,
-    AVCOL_PRI_BT470BG     = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
-    AVCOL_PRI_SMPTE170M   = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
-    AVCOL_PRI_SMPTE240M   = 7, ///< functionally identical to above
-    AVCOL_PRI_FILM        = 8,
-    AVCOL_PRI_BT2020      = 9, ///< ITU-R BT2020
-    AVCOL_PRI_NB             , ///< Not part of ABI
-};
-
-enum AVColorTransferCharacteristic{
-    AVCOL_TRC_BT709        =  1, ///< also ITU-R BT1361
-    AVCOL_TRC_UNSPECIFIED  =  2,
-    AVCOL_TRC_GAMMA22      =  4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
-    AVCOL_TRC_GAMMA28      =  5, ///< also ITU-R BT470BG
-    AVCOL_TRC_SMPTE170M    =  6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
-    AVCOL_TRC_SMPTE240M    =  7,
-    AVCOL_TRC_LINEAR       =  8, ///< "Linear transfer characteristics"
-    AVCOL_TRC_LOG          =  9, ///< "Logarithmic transfer characteristic (100:1 range)"
-    AVCOL_TRC_LOG_SQRT     = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)"
-    AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4
-    AVCOL_TRC_BT1361_ECG   = 12, ///< ITU-R BT1361 Extended Colour Gamut
-    AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC)
-    AVCOL_TRC_BT2020_10    = 14, ///< ITU-R BT2020 for 10 bit system
-    AVCOL_TRC_BT2020_12    = 15, ///< ITU-R BT2020 for 12 bit system
-    AVCOL_TRC_NB               , ///< Not part of ABI
-};
-
-enum AVColorSpace{
-    AVCOL_SPC_RGB         =  0,
-    AVCOL_SPC_BT709       =  1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
-    AVCOL_SPC_UNSPECIFIED =  2,
-    AVCOL_SPC_FCC         =  4,
-    AVCOL_SPC_BT470BG     =  5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
-    AVCOL_SPC_SMPTE170M   =  6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
-    AVCOL_SPC_SMPTE240M   =  7,
-    AVCOL_SPC_YCOCG       =  8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
-    AVCOL_SPC_BT2020_NCL  =  9, ///< ITU-R BT2020 non-constant luminance system
-    AVCOL_SPC_BT2020_CL   = 10, ///< ITU-R BT2020 constant luminance system
-    AVCOL_SPC_NB              , ///< Not part of ABI
-};
-
-enum AVColorRange{
-    AVCOL_RANGE_UNSPECIFIED = 0,
-    AVCOL_RANGE_MPEG        = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
-    AVCOL_RANGE_JPEG        = 2, ///< the normal     2^n-1   "JPEG" YUV ranges
-    AVCOL_RANGE_NB             , ///< Not part of ABI
-};
-
-/**
- *  X   X      3 4 X      X are luma samples,
- *             1 2        1-6 are possible chroma positions
- *  X   X      5 6 X      0 is undefined/unknown position
- */
-enum AVChromaLocation{
-    AVCHROMA_LOC_UNSPECIFIED = 0,
-    AVCHROMA_LOC_LEFT        = 1, ///< mpeg2/4, h264 default
-    AVCHROMA_LOC_CENTER      = 2, ///< mpeg1, jpeg, h263
-    AVCHROMA_LOC_TOPLEFT     = 3, ///< DV
-    AVCHROMA_LOC_TOP         = 4,
-    AVCHROMA_LOC_BOTTOMLEFT  = 5,
-    AVCHROMA_LOC_BOTTOM      = 6,
-    AVCHROMA_LOC_NB             , ///< Not part of ABI
-};
-
-enum AVAudioServiceType {
-    AV_AUDIO_SERVICE_TYPE_MAIN              = 0,
-    AV_AUDIO_SERVICE_TYPE_EFFECTS           = 1,
-    AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
-    AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED  = 3,
-    AV_AUDIO_SERVICE_TYPE_DIALOGUE          = 4,
-    AV_AUDIO_SERVICE_TYPE_COMMENTARY        = 5,
-    AV_AUDIO_SERVICE_TYPE_EMERGENCY         = 6,
-    AV_AUDIO_SERVICE_TYPE_VOICE_OVER        = 7,
-    AV_AUDIO_SERVICE_TYPE_KARAOKE           = 8,
-    AV_AUDIO_SERVICE_TYPE_NB                   , ///< Not part of ABI
-};
-
-/**
- * @ingroup lavc_encoding
- */
-typedef struct RcOverride{
-    int start_frame;
-    int end_frame;
-    int qscale; // If this is 0 then quality_factor will be used instead.
-    float quality_factor;
-} RcOverride;
-
-#if FF_API_MAX_BFRAMES
-/**
- * @deprecated there is no libavcodec-wide limit on the number of B-frames
- */
-#define FF_MAX_B_FRAMES 16
-#endif
-
-/* encoding support
-   These flags can be passed in AVCodecContext.flags before initialization.
-   Note: Not everything is supported yet.
-*/
-
-/**
- * Allow decoders to produce frames with data planes that are not aligned
- * to CPU requirements (e.g. due to cropping).
- */
-#define CODEC_FLAG_UNALIGNED 0x0001
-#define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
-#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
-#define CODEC_FLAG_OUTPUT_CORRUPT 0x0008 ///< Output even those frames that might be corrupted
-#define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
-#define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
-#define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
-/**
- * The parent program guarantees that the input for B-frames containing
- * streams is not written to for at least s->max_b_frames+1 frames, if
- * this is not set the input will be copied.
- */
-#define CODEC_FLAG_INPUT_PRESERVED 0x0100
-#define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
-#define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
-#define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
-#if FF_API_EMU_EDGE
-/**
- * @deprecated edges are not used/required anymore. I.e. this flag is now always
- * set.
- */
-#define CODEC_FLAG_EMU_EDGE        0x4000
-#endif
-#define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
-#define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
-                                                  location instead of only at frame boundaries. */
-#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
-#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
-#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
-#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
-#define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
-/* Fx : Flag for h263+ extra options */
-#define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
-#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
-#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
-#define CODEC_FLAG_CLOSED_GOP     0x80000000
-#define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
-#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
-#define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
-#define CODEC_FLAG2_IGNORE_CROP   0x00010000 ///< Discard cropping information from SPS.
-
-#define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
-
-/* Unsupported options :
- *              Syntax Arithmetic coding (SAC)
- *              Reference Picture Selection
- *              Independent Segment Decoding */
-/* /Fx */
-/* codec capabilities */
-
-#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
-/**
- * Codec uses get_buffer() for allocating buffers and supports custom allocators.
- * If not set, it might not use get_buffer() at all or use operations that
- * assume the buffer was allocated by avcodec_default_get_buffer.
- */
-#define CODEC_CAP_DR1             0x0002
-#define CODEC_CAP_TRUNCATED       0x0008
-#if FF_API_XVMC
-/* Codec can export data for HW decoding (XvMC). */
-#define CODEC_CAP_HWACCEL         0x0010
-#endif /* FF_API_XVMC */
-/**
- * Encoder or decoder requires flushing with NULL input at the end in order to
- * give the complete and correct output.
- *
- * NOTE: If this flag is not set, the codec is guaranteed to never be fed with
- *       with NULL data. The user can still send NULL data to the public encode
- *       or decode function, but libavcodec will not pass it along to the codec
- *       unless this flag is set.
- *
- * Decoders:
- * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
- * avpkt->size=0 at the end to get the delayed data until the decoder no longer
- * returns frames.
- *
- * Encoders:
- * The encoder needs to be fed with NULL data at the end of encoding until the
- * encoder no longer returns data.
- *
- * NOTE: For encoders implementing the AVCodec.encode2() function, setting this
- *       flag also means that the encoder must set the pts and duration for
- *       each output packet. If this flag is not set, the pts and duration will
- *       be determined by libavcodec from the input frame.
- */
-#define CODEC_CAP_DELAY           0x0020
-/**
- * Codec can be fed a final frame with a smaller size.
- * This can be used to prevent truncation of the last audio samples.
- */
-#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
-#if FF_API_CAP_VDPAU
-/**
- * Codec can export data for HW decoding (VDPAU).
- */
-#define CODEC_CAP_HWACCEL_VDPAU    0x0080
-#endif
-/**
- * Codec can output multiple frames per AVPacket
- * Normally demuxers return one frame at a time, demuxers which do not do
- * are connected to a parser to split what they return into proper frames.
- * This flag is reserved to the very rare category of codecs which have a
- * bitstream that cannot be split into frames without timeconsuming
- * operations like full decoding. Demuxers carring such bitstreams thus
- * may return multiple frames in a packet. This has many disadvantages like
- * prohibiting stream copy in many cases thus it should only be considered
- * as a last resort.
- */
-#define CODEC_CAP_SUBFRAMES        0x0100
-/**
- * Codec is experimental and is thus avoided in favor of non experimental
- * encoders
- */
-#define CODEC_CAP_EXPERIMENTAL     0x0200
-/**
- * Codec should fill in channel configuration and samplerate instead of container
- */
-#define CODEC_CAP_CHANNEL_CONF     0x0400
-#if FF_API_NEG_LINESIZES
-/**
- * @deprecated no codecs use this capability
- */
-#define CODEC_CAP_NEG_LINESIZES    0x0800
-#endif
-/**
- * Codec supports frame-level multithreading.
- */
-#define CODEC_CAP_FRAME_THREADS    0x1000
-/**
- * Codec supports slice-based (or partition-based) multithreading.
- */
-#define CODEC_CAP_SLICE_THREADS    0x2000
-/**
- * Codec supports changed parameters at any point.
- */
-#define CODEC_CAP_PARAM_CHANGE     0x4000
-/**
- * Codec supports avctx->thread_count == 0 (auto).
- */
-#define CODEC_CAP_AUTO_THREADS     0x8000
-/**
- * Audio encoder supports receiving a different number of samples in each call.
- */
-#define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
-
-#if FF_API_MB_TYPE
-//The following defines may change, don't expect compatibility if you use them.
-#define MB_TYPE_INTRA4x4   0x0001
-#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
-#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
-#define MB_TYPE_16x16      0x0008
-#define MB_TYPE_16x8       0x0010
-#define MB_TYPE_8x16       0x0020
-#define MB_TYPE_8x8        0x0040
-#define MB_TYPE_INTERLACED 0x0080
-#define MB_TYPE_DIRECT2    0x0100 //FIXME
-#define MB_TYPE_ACPRED     0x0200
-#define MB_TYPE_GMC        0x0400
-#define MB_TYPE_SKIP       0x0800
-#define MB_TYPE_P0L0       0x1000
-#define MB_TYPE_P1L0       0x2000
-#define MB_TYPE_P0L1       0x4000
-#define MB_TYPE_P1L1       0x8000
-#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
-#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
-#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
-#define MB_TYPE_QUANT      0x00010000
-#define MB_TYPE_CBP        0x00020000
-//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
-#endif
-
-/**
- * Pan Scan area.
- * This specifies the area which should be displayed.
- * Note there may be multiple such areas for one frame.
- */
-typedef struct AVPanScan{
-    /**
-     * id
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int id;
-
-    /**
-     * width and height in 1/16 pel
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int width;
-    int height;
-
-    /**
-     * position of the top left corner in 1/16 pel for up to 3 fields/frames
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int16_t position[3][2];
-}AVPanScan;
-
-#if FF_API_QSCALE_TYPE
-#define FF_QSCALE_TYPE_MPEG1 0
-#define FF_QSCALE_TYPE_MPEG2 1
-#define FF_QSCALE_TYPE_H264  2
-#define FF_QSCALE_TYPE_VP56  3
-#endif
-
-#if FF_API_GET_BUFFER
-#define FF_BUFFER_TYPE_INTERNAL 1
-#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
-#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
-#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
-
-#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
-#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
-#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
-#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
-#endif
-
-/**
- * The decoder will keep a reference to the frame and may reuse it later.
- */
-#define AV_GET_BUFFER_FLAG_REF (1 << 0)
-
-/**
- * @defgroup lavc_packet AVPacket
- *
- * Types and functions for working with AVPacket.
- * @{
- */
-enum AVPacketSideDataType {
-    AV_PKT_DATA_PALETTE,
-    AV_PKT_DATA_NEW_EXTRADATA,
-
-    /**
-     * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
-     * @code
-     * u32le param_flags
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
-     *     s32le channel_count
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
-     *     u64le channel_layout
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
-     *     s32le sample_rate
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
-     *     s32le width
-     *     s32le height
-     * @endcode
-     */
-    AV_PKT_DATA_PARAM_CHANGE,
-
-    /**
-     * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of
-     * structures with info about macroblocks relevant to splitting the
-     * packet into smaller packets on macroblock edges (e.g. as for RFC 2190).
-     * That is, it does not necessarily contain info about all macroblocks,
-     * as long as the distance between macroblocks in the info is smaller
-     * than the target payload size.
-     * Each MB info structure is 12 bytes, and is laid out as follows:
-     * @code
-     * u32le bit offset from the start of the packet
-     * u8    current quantizer at the start of the macroblock
-     * u8    GOB number
-     * u16le macroblock address within the GOB
-     * u8    horizontal MV predictor
-     * u8    vertical MV predictor
-     * u8    horizontal MV predictor for block number 3
-     * u8    vertical MV predictor for block number 3
-     * @endcode
-     */
-    AV_PKT_DATA_H263_MB_INFO,
-};
-
-/**
- * This structure stores compressed data. It is typically exported by demuxers
- * and then passed as input to decoders, or received as output from encoders and
- * then passed to muxers.
- *
- * For video, it should typically contain one compressed frame. For audio it may
- * contain several compressed frames.
- *
- * AVPacket is one of the few structs in Libav, whose size is a part of public
- * ABI. Thus it may be allocated on stack and no new fields can be added to it
- * without libavcodec and libavformat major bump.
- *
- * The semantics of data ownership depends on the buf or destruct (deprecated)
- * fields. If either is set, the packet data is dynamically allocated and is
- * valid indefinitely until av_free_packet() is called (which in turn calls
- * av_buffer_unref()/the destruct callback to free the data). If neither is set,
- * the packet data is typically backed by some static buffer somewhere and is
- * only valid for a limited time (e.g. until the next read call when demuxing).
- *
- * The side data is always allocated with av_malloc() and is freed in
- * av_free_packet().
- */
-typedef struct AVPacket {
-    /**
-     * A reference to the reference-counted buffer where the packet data is
-     * stored.
-     * May be NULL, then the packet data is not reference-counted.
-     */
-    AVBufferRef *buf;
-    /**
-     * Presentation timestamp in AVStream->time_base units; the time at which
-     * the decompressed packet will be presented to the user.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     * pts MUST be larger or equal to dts as presentation cannot happen before
-     * decompression, unless one wants to view hex dumps. Some formats misuse
-     * the terms dts and pts/cts to mean something different. Such timestamps
-     * must be converted to true pts/dts before they are stored in AVPacket.
-     */
-    int64_t pts;
-    /**
-     * Decompression timestamp in AVStream->time_base units; the time at which
-     * the packet is decompressed.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     */
-    int64_t dts;
-    uint8_t *data;
-    int   size;
-    int   stream_index;
-    /**
-     * A combination of AV_PKT_FLAG values
-     */
-    int   flags;
-    /**
-     * Additional packet data that can be provided by the container.
-     * Packet can contain several types of side information.
-     */
-    struct {
-        uint8_t *data;
-        int      size;
-        enum AVPacketSideDataType type;
-    } *side_data;
-    int side_data_elems;
-
-    /**
-     * Duration of this packet in AVStream->time_base units, 0 if unknown.
-     * Equals next_pts - this_pts in presentation order.
-     */
-    int   duration;
-#if FF_API_DESTRUCT_PACKET
-    attribute_deprecated
-    void  (*destruct)(struct AVPacket *);
-    attribute_deprecated
-    void  *priv;
-#endif
-    int64_t pos;                            ///< byte position in stream, -1 if unknown
-
-    /**
-     * Time difference in AVStream->time_base units from the pts of this
-     * packet to the point at which the output from the decoder has converged
-     * independent from the availability of previous frames. That is, the
-     * frames are virtually identical no matter if decoding started from
-     * the very first frame or from this keyframe.
-     * Is AV_NOPTS_VALUE if unknown.
-     * This field is not the display duration of the current packet.
-     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
-     * set.
-     *
-     * The purpose of this field is to allow seeking in streams that have no
-     * keyframes in the conventional sense. It corresponds to the
-     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
-     * essential for some types of subtitle streams to ensure that all
-     * subtitles are correctly displayed after seeking.
-     */
-    int64_t convergence_duration;
-} AVPacket;
-#define AV_PKT_FLAG_KEY     0x0001 ///< The packet contains a keyframe
-#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
-
-enum AVSideDataParamChangeFlags {
-    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT  = 0x0001,
-    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002,
-    AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE    = 0x0004,
-    AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS     = 0x0008,
-};
-/**
- * @}
- */
-
-struct AVCodecInternal;
-
-enum AVFieldOrder {
-    AV_FIELD_UNKNOWN,
-    AV_FIELD_PROGRESSIVE,
-    AV_FIELD_TT,          //< Top coded_first, top displayed first
-    AV_FIELD_BB,          //< Bottom coded first, bottom displayed first
-    AV_FIELD_TB,          //< Top coded first, bottom displayed first
-    AV_FIELD_BT,          //< Bottom coded first, top displayed first
-};
-
-/**
- * main external API structure.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVCodecContext) must not be used outside libav*.
- */
-typedef struct AVCodecContext {
-    /**
-     * information on struct for av_log
-     * - set by avcodec_alloc_context3
-     */
-    const AVClass *av_class;
-    int log_level_offset;
-
-    enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
-    const struct AVCodec  *codec;
-    char             codec_name[32];
-    enum AVCodecID     codec_id; /* see AV_CODEC_ID_xxx */
-
-    /**
-     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * A demuxer should set this to what is stored in the field used to identify the codec.
-     * If there are multiple such fields in a container then the demuxer should choose the one
-     * which maximizes the information about the used codec.
-     * If the codec tag field in a container is larger than 32 bits then the demuxer should
-     * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
-     * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
-     * first.
-     * - encoding: Set by user, if not then the default based on codec_id will be used.
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int codec_tag;
-
-    /**
-     * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * - encoding: unused
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int stream_codec_tag;
-
-    void *priv_data;
-
-    /**
-     * Private context used for internal data.
-     *
-     * Unlike priv_data, this is not codec-specific. It is used in general
-     * libavcodec functions.
-     */
-    struct AVCodecInternal *internal;
-
-    /**
-     * Private data of the user, can be used to carry app specific stuff.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    void *opaque;
-
-    /**
-     * the average bitrate
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
-     */
-    int bit_rate;
-
-    /**
-     * number of bits the bitstream is allowed to diverge from the reference.
-     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: unused
-     */
-    int bit_rate_tolerance;
-
-    /**
-     * Global quality for codecs which cannot change it per frame.
-     * This should be proportional to MPEG-1/2/4 qscale.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int global_quality;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int compression_level;
-#define FF_COMPRESSION_DEFAULT -1
-
-    /**
-     * CODEC_FLAG_*.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags;
-
-    /**
-     * CODEC_FLAG2_*
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags2;
-
-    /**
-     * some codecs need / can use extradata like Huffman tables.
-     * mjpeg: Huffman tables
-     * rv10: additional flags
-     * mpeg4: global headers (they can be in the bitstream or here)
-     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
-     * than extradata_size to avoid prolems if it is read with the bitstream reader.
-     * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
-     * - encoding: Set/allocated/freed by libavcodec.
-     * - decoding: Set/allocated/freed by user.
-     */
-    uint8_t *extradata;
-    int extradata_size;
-
-    /**
-     * This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented. For fixed-fps content,
-     * timebase should be 1/framerate and timestamp increments should be
-     * identically 1.
-     * - encoding: MUST be set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational time_base;
-
-    /**
-     * For some codecs, the time base is closer to the field rate than the frame rate.
-     * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
-     * if no telecine is used ...
-     *
-     * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
-     */
-    int ticks_per_frame;
-
-    /**
-     * Codec delay.
-     *
-     * Video:
-     *   Number of frames the decoded output will be delayed relative to the
-     *   encoded input.
-     *
-     * Audio:
-     *   For encoding, this is the number of "priming" samples added to the
-     *   beginning of the stream. The decoded output will be delayed by this
-     *   many samples relative to the input to the encoder. Note that this
-     *   field is purely informational and does not directly affect the pts
-     *   output by the encoder, which should always be based on the actual
-     *   presentation time, including any delay.
-     *   For decoding, this is the number of samples the decoder needs to
-     *   output before the decoder's output is valid. When seeking, you should
-     *   start decoding this many samples prior to your desired seek point.
-     *
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int delay;
-
-
-    /* video only */
-    /**
-     * picture width / height.
-     * - encoding: MUST be set by user.
-     * - decoding: May be set by the user before opening the decoder if known e.g.
-     *             from the container. Some decoders will require the dimensions
-     *             to be set by the caller. During decoding, the decoder may
-     *             overwrite those values as required.
-     */
-    int width, height;
-
-    /**
-     * Bitstream width / height, may be different from width/height e.g. when
-     * the decoded frame is cropped before being output.
-     * - encoding: unused
-     * - decoding: May be set by the user before opening the decoder if known
-     *             e.g. from the container. During decoding, the decoder may
-     *             overwrite those values as required.
-     */
-    int coded_width, coded_height;
-
-#if FF_API_ASPECT_EXTENDED
-#define FF_ASPECT_EXTENDED 15
-#endif
-
-    /**
-     * the number of pictures in a group of pictures, or 0 for intra_only
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int gop_size;
-
-    /**
-     * Pixel format, see AV_PIX_FMT_xxx.
-     * May be set by the demuxer if known from headers.
-     * May be overriden by the decoder if it knows better.
-     * - encoding: Set by user.
-     * - decoding: Set by user if known, overridden by libavcodec if known
-     */
-    enum AVPixelFormat pix_fmt;
-
-    /**
-     * Motion estimation algorithm used for video coding.
-     * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
-     * 8 (umh), 10 (tesa) [7, 8, 10 are x264 specific]
-     * - encoding: MUST be set by user.
-     * - decoding: unused
-     */
-    int me_method;
-
-    /**
-     * If non NULL, 'draw_horiz_band' is called by the libavcodec
-     * decoder to draw a horizontal band. It improves cache usage. Not
-     * all codecs can do that. You must check the codec capabilities
-     * beforehand.
-     * When multithreading is used, it may be called from multiple threads
-     * at the same time; threads might draw different parts of the same AVFrame,
-     * or multiple AVFrames, and there is no guarantee that slices will be drawn
-     * in order.
-     * The function is also used by hardware acceleration APIs.
-     * It is called at least once during frame decoding to pass
-     * the data needed for hardware render.
-     * In that mode instead of pixel data, AVFrame points to
-     * a structure specific to the acceleration API. The application
-     * reads the structure and can change some fields to indicate progress
-     * or mark state.
-     * - encoding: unused
-     * - decoding: Set by user.
-     * @param height the height of the slice
-     * @param y the y position of the slice
-     * @param type 1->top field, 2->bottom field, 3->frame
-     * @param offset offset into the AVFrame.data from which the slice should be read
-     */
-    void (*draw_horiz_band)(struct AVCodecContext *s,
-                            const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
-                            int y, int type, int height);
-
-    /**
-     * callback to negotiate the pixelFormat
-     * @param fmt is the list of formats which are supported by the codec,
-     * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
-     * The first is always the native one.
-     * @return the chosen format
-     * - encoding: unused
-     * - decoding: Set by user, if not set the native format will be chosen.
-     */
-    enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
-
-    /**
-     * maximum number of B-frames between non-B-frames
-     * Note: The output will be delayed by max_b_frames+1 relative to the input.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_b_frames;
-
-    /**
-     * qscale factor between IP and B-frames
-     * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_factor;
-
-    /** obsolete FIXME remove */
-    int rc_strategy;
-#define FF_RC_STRATEGY_XVID 1
-
-    int b_frame_strategy;
-
-    /**
-     * qscale offset between IP and B-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_offset;
-
-    /**
-     * Size of the frame reordering buffer in the decoder.
-     * For MPEG-2 it is 1 IPB or 0 low delay IP.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int has_b_frames;
-
-    /**
-     * 0-> h263 quant 1-> mpeg quant
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mpeg_quant;
-
-    /**
-     * qscale factor between P and I-frames
-     * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_factor;
-
-    /**
-     * qscale offset between P and I-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_offset;
-
-    /**
-     * luminance masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float lumi_masking;
-
-    /**
-     * temporary complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float temporal_cplx_masking;
-
-    /**
-     * spatial complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float spatial_cplx_masking;
-
-    /**
-     * p block masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float p_masking;
-
-    /**
-     * darkness masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float dark_masking;
-
-    /**
-     * slice count
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user (or 0).
-     */
-    int slice_count;
-    /**
-     * prediction method (needed for huffyuv)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int prediction_method;
-#define FF_PRED_LEFT   0
-#define FF_PRED_PLANE  1
-#define FF_PRED_MEDIAN 2
-
-    /**
-     * slice offsets in the frame in bytes
-     * - encoding: Set/allocated by libavcodec.
-     * - decoding: Set/allocated by user (or NULL).
-     */
-    int *slice_offset;
-
-    /**
-     * sample aspect ratio (0 if unknown)
-     * That is the width of a pixel divided by the height of the pixel.
-     * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational sample_aspect_ratio;
-
-    /**
-     * motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_cmp;
-    /**
-     * subpixel motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_sub_cmp;
-    /**
-     * macroblock comparison function (not supported yet)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_cmp;
-    /**
-     * interlaced DCT comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int ildct_cmp;
-#define FF_CMP_SAD    0
-#define FF_CMP_SSE    1
-#define FF_CMP_SATD   2
-#define FF_CMP_DCT    3
-#define FF_CMP_PSNR   4
-#define FF_CMP_BIT    5
-#define FF_CMP_RD     6
-#define FF_CMP_ZERO   7
-#define FF_CMP_VSAD   8
-#define FF_CMP_VSSE   9
-#define FF_CMP_NSSE   10
-#define FF_CMP_DCTMAX 13
-#define FF_CMP_DCT264 14
-#define FF_CMP_CHROMA 256
-
-    /**
-     * ME diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dia_size;
-
-    /**
-     * amount of previous MV predictors (2a+1 x 2a+1 square)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int last_predictor_count;
-
-    /**
-     * prepass for motion estimation
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_me;
-
-    /**
-     * motion estimation prepass comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_pre_cmp;
-
-    /**
-     * ME prepass diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_dia_size;
-
-    /**
-     * subpel ME quality
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_subpel_quality;
-
-    /**
-     * DTG active format information (additional aspect ratio
-     * information only used in DVB MPEG-2 transport streams)
-     * 0 if not set.
-     *
-     * - encoding: unused
-     * - decoding: Set by decoder.
-     */
-    int dtg_active_format;
-#define FF_DTG_AFD_SAME         8
-#define FF_DTG_AFD_4_3          9
-#define FF_DTG_AFD_16_9         10
-#define FF_DTG_AFD_14_9         11
-#define FF_DTG_AFD_4_3_SP_14_9  13
-#define FF_DTG_AFD_16_9_SP_14_9 14
-#define FF_DTG_AFD_SP_4_3       15
-
-    /**
-     * maximum motion estimation search range in subpel units
-     * If 0 then no limit.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_range;
-
-    /**
-     * intra quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int intra_quant_bias;
-#define FF_DEFAULT_QUANT_BIAS 999999
-
-    /**
-     * inter quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int inter_quant_bias;
-
-    /**
-     * slice flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int slice_flags;
-#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
-#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
-#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
-
-#if FF_API_XVMC
-    /**
-     * XVideo Motion Acceleration
-     * - encoding: forbidden
-     * - decoding: set by decoder
-     * @deprecated XvMC support is slated for removal.
-     */
-    attribute_deprecated int xvmc_acceleration;
-#endif /* FF_API_XVMC */
-
-    /**
-     * macroblock decision mode
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_decision;
-#define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
-#define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
-#define FF_MB_DECISION_RD     2        ///< rate distortion
-
-    /**
-     * custom intra quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *intra_matrix;
-
-    /**
-     * custom inter quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *inter_matrix;
-
-    /**
-     * scene change detection threshold
-     * 0 is default, larger means fewer detected scene changes.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_threshold;
-
-    /**
-     * noise reduction strength
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int noise_reduction;
-
-    /**
-     * Motion estimation threshold below which no motion estimation is
-     * performed, but instead the user specified motion vectors are used.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_threshold;
-
-    /**
-     * Macroblock threshold below which the user specified macroblock types will be used.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_threshold;
-
-    /**
-     * precision of the intra DC coefficient - 8
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int intra_dc_precision;
-
-    /**
-     * Number of macroblock rows at the top which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int skip_top;
-
-    /**
-     * Number of macroblock rows at the bottom which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int skip_bottom;
-
-    /**
-     * Border processing masking, raises the quantizer for mbs on the borders
-     * of the picture.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float border_masking;
-
-    /**
-     * minimum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmin;
-
-    /**
-     * maximum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmax;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_penalty_compensation;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int bidir_refine;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int brd_scale;
-
-    /**
-     * minimum GOP size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int keyint_min;
-
-    /**
-     * number of reference frames
-     * - encoding: Set by user.
-     * - decoding: Set by lavc.
-     */
-    int refs;
-
-    /**
-     * chroma qp offset from luma
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int chromaoffset;
-
-    /**
-     * Multiplied by qscale for each frame and added to scene_change_score.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_factor;
-
-    /**
-     *
-     * Note: Value depends upon the compare function used for fullpel ME.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mv0_threshold;
-
-    /**
-     * Adjust sensitivity of b_frame_strategy 1.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int b_sensitivity;
-
-    /**
-     * Chromaticity coordinates of the source primaries.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorPrimaries color_primaries;
-
-    /**
-     * Color Transfer Characteristic.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorTransferCharacteristic color_trc;
-
-    /**
-     * YUV colorspace type.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorSpace colorspace;
-
-    /**
-     * MPEG vs JPEG YUV range.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorRange color_range;
-
-    /**
-     * This defines the location of chroma samples.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVChromaLocation chroma_sample_location;
-
-    /**
-     * Number of slices.
-     * Indicates number of picture subdivisions. Used for parallelized
-     * decoding.
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    int slices;
-
-    /** Field order
-     * - encoding: set by libavcodec
-     * - decoding: Set by libavcodec
-     */
-    enum AVFieldOrder field_order;
-
-    /* audio only */
-    int sample_rate; ///< samples per second
-    int channels;    ///< number of audio channels
-
-    /**
-     * audio sample format
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum AVSampleFormat sample_fmt;  ///< sample format
-
-    /* The following data should not be initialized. */
-    /**
-     * Number of samples per channel in an audio frame.
-     *
-     * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame
-     *   except the last must contain exactly frame_size samples per channel.
-     *   May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the
-     *   frame size is not restricted.
-     * - decoding: may be set by some decoders to indicate constant frame size
-     */
-    int frame_size;
-
-    /**
-     * Frame counter, set by libavcodec.
-     *
-     * - decoding: total number of frames returned from the decoder so far.
-     * - encoding: total number of frames passed to the encoder so far.
-     *
-     *   @note the counter is not incremented if encoding/decoding resulted in
-     *   an error.
-     */
-    int frame_number;
-
-    /**
-     * number of bytes per packet if constant and known or 0
-     * Used by some WAV based audio codecs.
-     */
-    int block_align;
-
-    /**
-     * Audio cutoff bandwidth (0 means "automatic")
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int cutoff;
-
-#if FF_API_REQUEST_CHANNELS
-    /**
-     * Decoder should decode to this many channels if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     * @deprecated Deprecated in favor of request_channel_layout.
-     */
-    attribute_deprecated int request_channels;
-#endif
-
-    /**
-     * Audio channel layout.
-     * - encoding: set by user.
-     * - decoding: set by libavcodec.
-     */
-    uint64_t channel_layout;
-
-    /**
-     * Request decoder to use this channel layout if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    uint64_t request_channel_layout;
-
-    /**
-     * Type of service that the audio stream conveys.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum AVAudioServiceType audio_service_type;
-
-    /**
-     * Used to request a sample format from the decoder.
-     * - encoding: unused.
-     * - decoding: Set by user.
-     */
-    enum AVSampleFormat request_sample_fmt;
-
-#if FF_API_GET_BUFFER
-    /**
-     * Called at the beginning of each frame to get a buffer for it.
-     *
-     * The function will set AVFrame.data[], AVFrame.linesize[].
-     * AVFrame.extended_data[] must also be set, but it should be the same as
-     * AVFrame.data[] except for planar audio with more channels than can fit
-     * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
-     * many data pointers as it can hold.
-     *
-     * if CODEC_CAP_DR1 is not set then get_buffer() must call
-     * avcodec_default_get_buffer() instead of providing buffers allocated by
-     * some other means.
-     *
-     * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
-     * need it. avcodec_default_get_buffer() aligns the output buffer properly,
-     * but if get_buffer() is overridden then alignment considerations should
-     * be taken into account.
-     *
-     * @see avcodec_default_get_buffer()
-     *
-     * Video:
-     *
-     * If pic.reference is set then the frame will be read later by libavcodec.
-     * avcodec_align_dimensions2() should be used to find the required width and
-     * height, as they normally need to be rounded up to the next multiple of 16.
-     *
-     * If frame multithreading is used and thread_safe_callbacks is set,
-     * it may be called from a different thread, but not from more than one at
-     * once. Does not need to be reentrant.
-     *
-     * @see release_buffer(), reget_buffer()
-     * @see avcodec_align_dimensions2()
-     *
-     * Audio:
-     *
-     * Decoders request a buffer of a particular size by setting
-     * AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
-     * however, utilize only part of the buffer by setting AVFrame.nb_samples
-     * to a smaller value in the output frame.
-     *
-     * Decoders cannot use the buffer after returning from
-     * avcodec_decode_audio4(), so they will not call release_buffer(), as it
-     * is assumed to be released immediately upon return. In some rare cases,
-     * a decoder may need to call get_buffer() more than once in a single
-     * call to avcodec_decode_audio4(). In that case, when get_buffer() is
-     * called again after it has already been called once, the previously
-     * acquired buffer is assumed to be released at that time and may not be
-     * reused by the decoder.
-     *
-     * As a convenience, av_samples_get_buffer_size() and
-     * av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
-     * functions to find the required data size and to fill data pointers and
-     * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
-     * since all planes must be the same size.
-     *
-     * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     *
-     * @deprecated use get_buffer2()
-     */
-    attribute_deprecated
-    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Called to release buffers which were allocated with get_buffer.
-     * A released buffer can be reused in get_buffer().
-     * pic.data[*] must be set to NULL.
-     * May be called from a different thread if frame multithreading is used,
-     * but not by more than one thread at once, so does not need to be reentrant.
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     *
-     * @deprecated custom freeing callbacks should be set from get_buffer2()
-     */
-    attribute_deprecated
-    void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Called at the beginning of a frame to get cr buffer for it.
-     * Buffer type (size, hints) must be the same. libavcodec won't check it.
-     * libavcodec will pass previous buffer in pic, function should return
-     * same buffer or new buffer with old frame "painted" into it.
-     * If pic.data[0] == NULL must behave like get_buffer().
-     * if CODEC_CAP_DR1 is not set then reget_buffer() must call
-     * avcodec_default_reget_buffer() instead of providing buffers allocated by
-     * some other means.
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     */
-    attribute_deprecated
-    int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
-#endif
-
-    /**
-     * This callback is called at the beginning of each frame to get data
-     * buffer(s) for it. There may be one contiguous buffer for all the data or
-     * there may be a buffer per each data plane or anything in between. What
-     * this means is, you may set however many entries in buf[] you feel necessary.
-     * Each buffer must be reference-counted using the AVBuffer API (see description
-     * of buf[] below).
-     *
-     * The following fields will be set in the frame before this callback is
-     * called:
-     * - format
-     * - width, height (video only)
-     * - sample_rate, channel_layout, nb_samples (audio only)
-     * Their values may differ from the corresponding values in
-     * AVCodecContext. This callback must use the frame values, not the codec
-     * context values, to calculate the required buffer size.
-     *
-     * This callback must fill the following fields in the frame:
-     * - data[]
-     * - linesize[]
-     * - extended_data:
-     *   * if the data is planar audio with more than 8 channels, then this
-     *     callback must allocate and fill extended_data to contain all pointers
-     *     to all data planes. data[] must hold as many pointers as it can.
-     *     extended_data must be allocated with av_malloc() and will be freed in
-     *     av_frame_unref().
-     *   * otherwise exended_data must point to data
-     * - buf[] must contain one or more pointers to AVBufferRef structures. Each of
-     *   the frame's data and extended_data pointers must be contained in these. That
-     *   is, one AVBufferRef for each allocated chunk of memory, not necessarily one
-     *   AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(),
-     *   and av_buffer_ref().
-     * - extended_buf and nb_extended_buf must be allocated with av_malloc() by
-     *   this callback and filled with the extra buffers if there are more
-     *   buffers than buf[] can hold. extended_buf will be freed in
-     *   av_frame_unref().
-     *
-     * If CODEC_CAP_DR1 is not set then get_buffer2() must call
-     * avcodec_default_get_buffer2() instead of providing buffers allocated by
-     * some other means.
-     *
-     * Each data plane must be aligned to the maximum required by the target
-     * CPU.
-     *
-     * @see avcodec_default_get_buffer2()
-     *
-     * Video:
-     *
-     * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused
-     * (read and/or written to if it is writable) later by libavcodec.
-     *
-     * avcodec_align_dimensions2() should be used to find the required width and
-     * height, as they normally need to be rounded up to the next multiple of 16.
-     *
-     * If frame multithreading is used and thread_safe_callbacks is set,
-     * this callback may be called from a different thread, but not from more
-     * than one at once. Does not need to be reentrant.
-     *
-     * @see avcodec_align_dimensions2()
-     *
-     * Audio:
-     *
-     * Decoders request a buffer of a particular size by setting
-     * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may,
-     * however, utilize only part of the buffer by setting AVFrame.nb_samples
-     * to a smaller value in the output frame.
-     *
-     * As a convenience, av_samples_get_buffer_size() and
-     * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2()
-     * functions to find the required data size and to fill data pointers and
-     * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
-     * since all planes must be the same size.
-     *
-     * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
-
-    /**
-     * If non-zero, the decoded audio and video frames returned from
-     * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted
-     * and are valid indefinitely. The caller must free them with
-     * av_frame_unref() when they are not needed anymore.
-     * Otherwise, the decoded frames must not be freed by the caller and are
-     * only valid until the next decode call.
-     *
-     * - encoding: unused
-     * - decoding: set by the caller before avcodec_open2().
-     */
-    int refcounted_frames;
-
-    /* - encoding parameters */
-    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
-    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
-
-    /**
-     * minimum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmin;
-
-    /**
-     * maximum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmax;
-
-    /**
-     * maximum quantizer difference between frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_qdiff;
-
-    /**
-     * ratecontrol qmin qmax limiting method
-     * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_qsquish;
-
-    float rc_qmod_amp;
-    int rc_qmod_freq;
-
-    /**
-     * decoder bitstream buffer size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_buffer_size;
-
-    /**
-     * ratecontrol override, see RcOverride
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    int rc_override_count;
-    RcOverride *rc_override;
-
-    /**
-     * rate control equation
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    const char *rc_eq;
-
-    /**
-     * maximum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_max_rate;
-
-    /**
-     * minimum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_min_rate;
-
-    float rc_buffer_aggressivity;
-
-    /**
-     * initial complexity for pass1 ratecontrol
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_initial_cplx;
-
-    /**
-     * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     */
-    float rc_max_available_vbv_use;
-
-    /**
-     * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     */
-    float rc_min_vbv_overflow_use;
-
-    /**
-     * Number of bits which should be loaded into the rc buffer before decoding starts.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_initial_buffer_occupancy;
-
-#define FF_CODER_TYPE_VLC       0
-#define FF_CODER_TYPE_AC        1
-#define FF_CODER_TYPE_RAW       2
-#define FF_CODER_TYPE_RLE       3
-#define FF_CODER_TYPE_DEFLATE   4
-    /**
-     * coder type
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int coder_type;
-
-    /**
-     * context model
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int context_model;
-
-    /**
-     * minimum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmin;
-
-    /**
-     * maximum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmax;
-
-    /**
-     * frame skip threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_threshold;
-
-    /**
-     * frame skip factor
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_factor;
-
-    /**
-     * frame skip exponent
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_exp;
-
-    /**
-     * frame skip comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_cmp;
-
-    /**
-     * trellis RD quantization
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int trellis;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int min_prediction_order;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_prediction_order;
-
-    /**
-     * GOP timecode frame start number, in non drop frame format
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int64_t timecode_frame_start;
-
-    /* The RTP callback: This function is called    */
-    /* every time the encoder has a packet to send. */
-    /* It depends on the encoder if the data starts */
-    /* with a Start Code (it should). H.263 does.   */
-    /* mb_nb contains the number of macroblocks     */
-    /* encoded in the RTP payload.                  */
-    void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
-
-    int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
-                            /* do its best to deliver a chunk with size     */
-                            /* below rtp_payload_size, the chunk will start */
-                            /* with a start code on some codecs like H.263. */
-                            /* This doesn't take account of any particular  */
-                            /* headers inside the transmitted RTP payload.  */
-
-    /* statistics, used for 2-pass encoding */
-    int mv_bits;
-    int header_bits;
-    int i_tex_bits;
-    int p_tex_bits;
-    int i_count;
-    int p_count;
-    int skip_count;
-    int misc_bits;
-
-    /**
-     * number of bits used for the previously encoded frame
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    int frame_bits;
-
-    /**
-     * pass1 encoding statistics output buffer
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    char *stats_out;
-
-    /**
-     * pass2 encoding statistics input buffer
-     * Concatenated stuff from stats_out of pass1 should be placed here.
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    char *stats_in;
-
-    /**
-     * Work around bugs in encoders which sometimes cannot be detected automatically.
-     * - encoding: Set by user
-     * - decoding: Set by user
-     */
-    int workaround_bugs;
-#define FF_BUG_AUTODETECT       1  ///< autodetection
-#if FF_API_OLD_MSMPEG4
-#define FF_BUG_OLD_MSMPEG4      2
-#endif
-#define FF_BUG_XVID_ILACE       4
-#define FF_BUG_UMP4             8
-#define FF_BUG_NO_PADDING       16
-#define FF_BUG_AMV              32
-#if FF_API_AC_VLC
-#define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
-#endif
-#define FF_BUG_QPEL_CHROMA      64
-#define FF_BUG_STD_QPEL         128
-#define FF_BUG_QPEL_CHROMA2     256
-#define FF_BUG_DIRECT_BLOCKSIZE 512
-#define FF_BUG_EDGE             1024
-#define FF_BUG_HPEL_CHROMA      2048
-#define FF_BUG_DC_CLIP          4096
-#define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
-#define FF_BUG_TRUNCATED       16384
-
-    /**
-     * strictly follow the standard (MPEG4, ...).
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     * Setting this to STRICT or higher means the encoder and decoder will
-     * generally do stupid things, whereas setting it to unofficial or lower
-     * will mean the encoder might produce output that is not supported by all
-     * spec-compliant decoders. Decoders don't differentiate between normal,
-     * unofficial and experimental (that is, they always try to decode things
-     * when they can) unless they are explicitly asked to behave stupidly
-     * (=strictly conform to the specs)
-     */
-    int strict_std_compliance;
-#define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to an older more strict version of the spec or reference software.
-#define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
-#define FF_COMPLIANCE_NORMAL        0
-#define FF_COMPLIANCE_UNOFFICIAL   -1 ///< Allow unofficial extensions
-#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
-
-    /**
-     * error concealment flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int error_concealment;
-#define FF_EC_GUESS_MVS   1
-#define FF_EC_DEBLOCK     2
-
-    /**
-     * debug
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int debug;
-#define FF_DEBUG_PICT_INFO   1
-#define FF_DEBUG_RC          2
-#define FF_DEBUG_BITSTREAM   4
-#define FF_DEBUG_MB_TYPE     8
-#define FF_DEBUG_QP          16
-#if FF_API_DEBUG_MV
-/**
- * @deprecated this option does nothing
- */
-#define FF_DEBUG_MV          32
-#endif
-#define FF_DEBUG_DCT_COEFF   0x00000040
-#define FF_DEBUG_SKIP        0x00000080
-#define FF_DEBUG_STARTCODE   0x00000100
-#define FF_DEBUG_PTS         0x00000200
-#define FF_DEBUG_ER          0x00000400
-#define FF_DEBUG_MMCO        0x00000800
-#define FF_DEBUG_BUGS        0x00001000
-#if FF_API_DEBUG_MV
-#define FF_DEBUG_VIS_QP      0x00002000
-#define FF_DEBUG_VIS_MB_TYPE 0x00004000
-#endif
-#define FF_DEBUG_BUFFERS     0x00008000
-#define FF_DEBUG_THREADS     0x00010000
-
-#if FF_API_DEBUG_MV
-    /**
-     * @deprecated this option does not have any effect
-     */
-    attribute_deprecated
-    int debug_mv;
-#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
-#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
-#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
-#endif
-
-    /**
-     * Error recognition; may misdetect some more or less valid parts as errors.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int err_recognition;
-
-/**
- * Verify checksums embedded in the bitstream (could be of either encoded or
- * decoded data, depending on the codec) and print an error message on mismatch.
- * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the
- * decoder returning an error.
- */
-#define AV_EF_CRCCHECK  (1<<0)
-#define AV_EF_BITSTREAM (1<<1)
-#define AV_EF_BUFFER    (1<<2)
-#define AV_EF_EXPLODE   (1<<3)
-
-    /**
-     * opaque 64bit number (generally a PTS) that will be reordered and
-     * output in AVFrame.reordered_opaque
-     * @deprecated in favor of pkt_pts
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int64_t reordered_opaque;
-
-    /**
-     * Hardware accelerator in use
-     * - encoding: unused.
-     * - decoding: Set by libavcodec
-     */
-    struct AVHWAccel *hwaccel;
-
-    /**
-     * Hardware accelerator context.
-     * For some hardware accelerators, a global context needs to be
-     * provided by the user. In that case, this holds display-dependent
-     * data Libav cannot instantiate itself. Please refer to the
-     * Libav HW accelerator documentation to know how to fill this
-     * is. e.g. for VA API, this is a struct vaapi_context.
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    void *hwaccel_context;
-
-    /**
-     * error
-     * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
-     * - decoding: unused
-     */
-    uint64_t error[AV_NUM_DATA_POINTERS];
-
-    /**
-     * DCT algorithm, see FF_DCT_* below
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dct_algo;
-#define FF_DCT_AUTO    0
-#define FF_DCT_FASTINT 1
-#define FF_DCT_INT     2
-#define FF_DCT_MMX     3
-#define FF_DCT_ALTIVEC 5
-#define FF_DCT_FAAN    6
-
-    /**
-     * IDCT algorithm, see FF_IDCT_* below.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int idct_algo;
-#define FF_IDCT_AUTO          0
-#define FF_IDCT_INT           1
-#define FF_IDCT_SIMPLE        2
-#define FF_IDCT_SIMPLEMMX     3
-#define FF_IDCT_ARM           7
-#define FF_IDCT_ALTIVEC       8
-#define FF_IDCT_SH4           9
-#define FF_IDCT_SIMPLEARM     10
-#define FF_IDCT_IPP           13
-#define FF_IDCT_XVIDMMX       14
-#define FF_IDCT_SIMPLEARMV5TE 16
-#define FF_IDCT_SIMPLEARMV6   17
-#define FF_IDCT_SIMPLEVIS     18
-#define FF_IDCT_FAAN          20
-#define FF_IDCT_SIMPLENEON    22
-#if FF_API_ARCH_ALPHA
-#define FF_IDCT_SIMPLEALPHA   23
-#endif
-
-    /**
-     * bits per sample/pixel from the demuxer (needed for huffyuv).
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user.
-     */
-     int bits_per_coded_sample;
-
-    /**
-     * Bits per sample/pixel of internal libavcodec pixel/sample format.
-     * - encoding: set by user.
-     * - decoding: set by libavcodec.
-     */
-    int bits_per_raw_sample;
-
-#if FF_API_LOWRES
-    /**
-     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
-     * - encoding: unused
-     * - decoding: Set by user.
-     *
-     * @deprecated use decoder private options instead
-     */
-    attribute_deprecated int lowres;
-#endif
-
-    /**
-     * the picture in the bitstream
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    AVFrame *coded_frame;
-
-    /**
-     * thread count
-     * is used to decide how many independent tasks should be passed to execute()
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int thread_count;
-
-    /**
-     * Which multithreading methods to use.
-     * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread,
-     * so clients which cannot provide future frames should not use it.
-     *
-     * - encoding: Set by user, otherwise the default is used.
-     * - decoding: Set by user, otherwise the default is used.
-     */
-    int thread_type;
-#define FF_THREAD_FRAME   1 ///< Decode more than one frame at once
-#define FF_THREAD_SLICE   2 ///< Decode more than one part of a single frame at once
-
-    /**
-     * Which multithreading methods are in use by the codec.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int active_thread_type;
-
-    /**
-     * Set by the client if its custom get_buffer() callback can be called
-     * synchronously from another thread, which allows faster multithreaded decoding.
-     * draw_horiz_band() will be called from other threads regardless of this setting.
-     * Ignored if the default get_buffer() is used.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int thread_safe_callbacks;
-
-    /**
-     * The codec may call this to execute several independent things.
-     * It will return only after finishing all tasks.
-     * The user may replace this with some multithreaded implementation,
-     * the default implementation will execute the parts serially.
-     * @param count the number of things to execute
-     * - encoding: Set by libavcodec, user can override.
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
-
-    /**
-     * The codec may call this to execute several independent things.
-     * It will return only after finishing all tasks.
-     * The user may replace this with some multithreaded implementation,
-     * the default implementation will execute the parts serially.
-     * Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
-     * @param c context passed also to func
-     * @param count the number of things to execute
-     * @param arg2 argument passed unchanged to func
-     * @param ret return values of executed functions, must have space for "count" values. May be NULL.
-     * @param func function that will be called count times, with jobnr from 0 to count-1.
-     *             threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
-     *             two instances of func executing at the same time will have the same threadnr.
-     * @return always 0 currently, but code should handle a future improvement where when any call to func
-     *         returns < 0 no further calls to func may be done and < 0 is returned.
-     * - encoding: Set by libavcodec, user can override.
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
-
-#if FF_API_THREAD_OPAQUE
-    /**
-     * @deprecated this field should not be used from outside of lavc
-     */
-    attribute_deprecated
-    void *thread_opaque;
-#endif
-
-    /**
-     * noise vs. sse weight for the nsse comparsion function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int nsse_weight;
-
-    /**
-     * profile
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int profile;
-#define FF_PROFILE_UNKNOWN -99
-#define FF_PROFILE_RESERVED -100
-
-#define FF_PROFILE_AAC_MAIN 0
-#define FF_PROFILE_AAC_LOW  1
-#define FF_PROFILE_AAC_SSR  2
-#define FF_PROFILE_AAC_LTP  3
-#define FF_PROFILE_AAC_HE   4
-#define FF_PROFILE_AAC_HE_V2 28
-#define FF_PROFILE_AAC_LD   22
-#define FF_PROFILE_AAC_ELD  38
-#define FF_PROFILE_MPEG2_AAC_LOW 128
-#define FF_PROFILE_MPEG2_AAC_HE  131
-
-#define FF_PROFILE_DTS         20
-#define FF_PROFILE_DTS_ES      30
-#define FF_PROFILE_DTS_96_24   40
-#define FF_PROFILE_DTS_HD_HRA  50
-#define FF_PROFILE_DTS_HD_MA   60
-
-#define FF_PROFILE_MPEG2_422    0
-#define FF_PROFILE_MPEG2_HIGH   1
-#define FF_PROFILE_MPEG2_SS     2
-#define FF_PROFILE_MPEG2_SNR_SCALABLE  3
-#define FF_PROFILE_MPEG2_MAIN   4
-#define FF_PROFILE_MPEG2_SIMPLE 5
-
-#define FF_PROFILE_H264_CONSTRAINED  (1<<9)  // 8+1; constraint_set1_flag
-#define FF_PROFILE_H264_INTRA        (1<<11) // 8+3; constraint_set3_flag
-
-#define FF_PROFILE_H264_BASELINE             66
-#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
-#define FF_PROFILE_H264_MAIN                 77
-#define FF_PROFILE_H264_EXTENDED             88
-#define FF_PROFILE_H264_HIGH                 100
-#define FF_PROFILE_H264_HIGH_10              110
-#define FF_PROFILE_H264_HIGH_10_INTRA        (110|FF_PROFILE_H264_INTRA)
-#define FF_PROFILE_H264_HIGH_422             122
-#define FF_PROFILE_H264_HIGH_422_INTRA       (122|FF_PROFILE_H264_INTRA)
-#define FF_PROFILE_H264_HIGH_444             144
-#define FF_PROFILE_H264_HIGH_444_PREDICTIVE  244
-#define FF_PROFILE_H264_HIGH_444_INTRA       (244|FF_PROFILE_H264_INTRA)
-#define FF_PROFILE_H264_CAVLC_444            44
-
-#define FF_PROFILE_VC1_SIMPLE   0
-#define FF_PROFILE_VC1_MAIN     1
-#define FF_PROFILE_VC1_COMPLEX  2
-#define FF_PROFILE_VC1_ADVANCED 3
-
-#define FF_PROFILE_MPEG4_SIMPLE                     0
-#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE            1
-#define FF_PROFILE_MPEG4_CORE                       2
-#define FF_PROFILE_MPEG4_MAIN                       3
-#define FF_PROFILE_MPEG4_N_BIT                      4
-#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE           5
-#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION      6
-#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE     7
-#define FF_PROFILE_MPEG4_HYBRID                     8
-#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME         9
-#define FF_PROFILE_MPEG4_CORE_SCALABLE             10
-#define FF_PROFILE_MPEG4_ADVANCED_CODING           11
-#define FF_PROFILE_MPEG4_ADVANCED_CORE             12
-#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
-#define FF_PROFILE_MPEG4_SIMPLE_STUDIO             14
-#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE           15
-
-#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0   0
-#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1   1
-#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION  2
-#define FF_PROFILE_JPEG2000_DCINEMA_2K              3
-#define FF_PROFILE_JPEG2000_DCINEMA_4K              4
-
-
-#define FF_PROFILE_HEVC_MAIN                        1
-#define FF_PROFILE_HEVC_MAIN_10                     2
-#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE          3
-
-    /**
-     * level
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int level;
-#define FF_LEVEL_UNKNOWN -99
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_loop_filter;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_idct;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_frame;
-
-    /**
-     * Header containing style information for text subtitles.
-     * For SUBTITLE_ASS subtitle type, it should contain the whole ASS
-     * [Script Info] and [V4+ Styles] section, plus the [Events] line and
-     * the Format line following. It shouldn't include any Dialogue line.
-     * - encoding: Set/allocated/freed by user (before avcodec_open2())
-     * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
-     */
-    uint8_t *subtitle_header;
-    int subtitle_header_size;
-
-#if FF_API_ERROR_RATE
-    /**
-     * @deprecated use the 'error_rate' private AVOption of the mpegvideo
-     * encoders
-     */
-    attribute_deprecated
-    int error_rate;
-#endif
-
-#if FF_API_CODEC_PKT
-    /**
-     * @deprecated this field is not supposed to be accessed from outside lavc
-     */
-    attribute_deprecated
-    AVPacket *pkt;
-#endif
-
-    /**
-     * VBV delay coded in the last frame (in periods of a 27 MHz clock).
-     * Used for compliant TS muxing.
-     * - encoding: Set by libavcodec.
-     * - decoding: unused.
-     */
-    uint64_t vbv_delay;
-} AVCodecContext;
-
-/**
- * AVProfile.
- */
-typedef struct AVProfile {
-    int profile;
-    const char *name; ///< short name for the profile
-} AVProfile;
-
-typedef struct AVCodecDefault AVCodecDefault;
-
-struct AVSubtitle;
-
-/**
- * AVCodec.
- */
-typedef struct AVCodec {
-    /**
-     * Name of the codec implementation.
-     * The name is globally unique among encoders and among decoders (but an
-     * encoder and a decoder can share the same name).
-     * This is the primary way to find a codec from the user perspective.
-     */
-    const char *name;
-    /**
-     * Descriptive name for the codec, meant to be more human readable than name.
-     * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
-     */
-    const char *long_name;
-    enum AVMediaType type;
-    enum AVCodecID id;
-    /**
-     * Codec capabilities.
-     * see CODEC_CAP_*
-     */
-    int capabilities;
-    const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
-    const enum AVPixelFormat *pix_fmts;     ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
-    const int *supported_samplerates;       ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
-    const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
-    const uint64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
-#if FF_API_LOWRES
-    attribute_deprecated uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
-#endif
-    const AVClass *priv_class;              ///< AVClass for the private context
-    const AVProfile *profiles;              ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
-
-    /*****************************************************************
-     * No fields below this line are part of the public API. They
-     * may not be used outside of libavcodec and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-    int priv_data_size;
-    struct AVCodec *next;
-    /**
-     * @name Frame-level threading support functions
-     * @{
-     */
-    /**
-     * If defined, called on thread contexts when they are created.
-     * If the codec allocates writable tables in init(), re-allocate them here.
-     * priv_data will be set to a copy of the original.
-     */
-    int (*init_thread_copy)(AVCodecContext *);
-    /**
-     * Copy necessary context variables from a previous thread context to the current one.
-     * If not defined, the next thread will start automatically; otherwise, the codec
-     * must call ff_thread_finish_setup().
-     *
-     * dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
-     */
-    int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
-    /** @} */
-
-    /**
-     * Private codec-specific defaults.
-     */
-    const AVCodecDefault *defaults;
-
-    /**
-     * Initialize codec static data, called from avcodec_register().
-     */
-    void (*init_static_data)(struct AVCodec *codec);
-
-    int (*init)(AVCodecContext *);
-    int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
-                      const struct AVSubtitle *sub);
-    /**
-     * Encode data to an AVPacket.
-     *
-     * @param      avctx          codec context
-     * @param      avpkt          output AVPacket (may contain a user-provided buffer)
-     * @param[in]  frame          AVFrame containing the raw data to be encoded
-     * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
-     *                            non-empty packet was returned in avpkt.
-     * @return 0 on success, negative error code on failure
-     */
-    int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
-                   int *got_packet_ptr);
-    int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
-    int (*close)(AVCodecContext *);
-    /**
-     * Flush buffers.
-     * Will be called when seeking
-     */
-    void (*flush)(AVCodecContext *);
-} AVCodec;
-
-/**
- * AVHWAccel.
- */
-typedef struct AVHWAccel {
-    /**
-     * Name of the hardware accelerated codec.
-     * The name is globally unique among encoders and among decoders (but an
-     * encoder and a decoder can share the same name).
-     */
-    const char *name;
-
-    /**
-     * Type of codec implemented by the hardware accelerator.
-     *
-     * See AVMEDIA_TYPE_xxx
-     */
-    enum AVMediaType type;
-
-    /**
-     * Codec implemented by the hardware accelerator.
-     *
-     * See AV_CODEC_ID_xxx
-     */
-    enum AVCodecID id;
-
-    /**
-     * Supported pixel format.
-     *
-     * Only hardware accelerated formats are supported here.
-     */
-    enum AVPixelFormat pix_fmt;
-
-    /**
-     * Hardware accelerated codec capabilities.
-     * see FF_HWACCEL_CODEC_CAP_*
-     */
-    int capabilities;
-
-    struct AVHWAccel *next;
-
-    /**
-     * Called at the beginning of each frame or field picture.
-     *
-     * Meaningful frame information (codec specific) is guaranteed to
-     * be parsed at this point. This function is mandatory.
-     *
-     * Note that buf can be NULL along with buf_size set to 0.
-     * Otherwise, this means the whole frame is available at this point.
-     *
-     * @param avctx the codec context
-     * @param buf the frame data buffer base
-     * @param buf_size the size of the frame in bytes
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
-
-    /**
-     * Callback for each slice.
-     *
-     * Meaningful slice information (codec specific) is guaranteed to
-     * be parsed at this point. This function is mandatory.
-     *
-     * @param avctx the codec context
-     * @param buf the slice data buffer base
-     * @param buf_size the size of the slice in bytes
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
-
-    /**
-     * Called at the end of each frame or field picture.
-     *
-     * The whole picture is parsed at this point and can now be sent
-     * to the hardware accelerator. This function is mandatory.
-     *
-     * @param avctx the codec context
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*end_frame)(AVCodecContext *avctx);
-
-    /**
-     * Size of HW accelerator private data.
-     *
-     * Private data is allocated with av_mallocz() before
-     * AVCodecContext.get_buffer() and deallocated after
-     * AVCodecContext.release_buffer().
-     */
-    int priv_data_size;
-} AVHWAccel;
-
-/**
- * @defgroup lavc_picture AVPicture
- *
- * Functions for working with AVPicture
- * @{
- */
-
-/**
- * four components are given, that's all.
- * the last component is alpha
- */
-typedef struct AVPicture {
-    uint8_t *data[AV_NUM_DATA_POINTERS];
-    int linesize[AV_NUM_DATA_POINTERS];     ///< number of bytes per line
-} AVPicture;
-
-/**
- * @}
- */
-
-#define AVPALETTE_SIZE 1024
-#define AVPALETTE_COUNT 256
-
-enum AVSubtitleType {
-    SUBTITLE_NONE,
-
-    SUBTITLE_BITMAP,                ///< A bitmap, pict will be set
-
-    /**
-     * Plain text, the text field must be set by the decoder and is
-     * authoritative. ass and pict fields may contain approximations.
-     */
-    SUBTITLE_TEXT,
-
-    /**
-     * Formatted text, the ass field must be set by the decoder and is
-     * authoritative. pict and text fields may contain approximations.
-     */
-    SUBTITLE_ASS,
-};
-
-#define AV_SUBTITLE_FLAG_FORCED 0x00000001
-
-typedef struct AVSubtitleRect {
-    int x;         ///< top left corner  of pict, undefined when pict is not set
-    int y;         ///< top left corner  of pict, undefined when pict is not set
-    int w;         ///< width            of pict, undefined when pict is not set
-    int h;         ///< height           of pict, undefined when pict is not set
-    int nb_colors; ///< number of colors in pict, undefined when pict is not set
-
-    /**
-     * data+linesize for the bitmap of this subtitle.
-     * can be set for text/ass as well once they where rendered
-     */
-    AVPicture pict;
-    enum AVSubtitleType type;
-
-    char *text;                     ///< 0 terminated plain UTF-8 text
-
-    /**
-     * 0 terminated ASS/SSA compatible event line.
-     * The pressentation of this is unaffected by the other values in this
-     * struct.
-     */
-    char *ass;
-    int flags;
-} AVSubtitleRect;
-
-typedef struct AVSubtitle {
-    uint16_t format; /* 0 = graphics */
-    uint32_t start_display_time; /* relative to packet pts, in ms */
-    uint32_t end_display_time; /* relative to packet pts, in ms */
-    unsigned num_rects;
-    AVSubtitleRect **rects;
-    int64_t pts;    ///< Same as packet pts, in AV_TIME_BASE
-} AVSubtitle;
-
-/**
- * If c is NULL, returns the first registered codec,
- * if c is non-NULL, returns the next registered codec after c,
- * or NULL if c is the last one.
- */
-AVCodec *av_codec_next(const AVCodec *c);
-
-/**
- * Return the LIBAVCODEC_VERSION_INT constant.
- */
-unsigned avcodec_version(void);
-
-/**
- * Return the libavcodec build-time configuration.
- */
-const char *avcodec_configuration(void);
-
-/**
- * Return the libavcodec license.
- */
-const char *avcodec_license(void);
-
-/**
- * Register the codec codec and initialize libavcodec.
- *
- * @warning either this function or avcodec_register_all() must be called
- * before any other libavcodec functions.
- *
- * @see avcodec_register_all()
- */
-void avcodec_register(AVCodec *codec);
-
-/**
- * Register all the codecs, parsers and bitstream filters which were enabled at
- * configuration time. If you do not call this function you can select exactly
- * which formats you want to support, by using the individual registration
- * functions.
- *
- * @see avcodec_register
- * @see av_register_codec_parser
- * @see av_register_bitstream_filter
- */
-void avcodec_register_all(void);
-
-/**
- * Allocate an AVCodecContext and set its fields to default values.  The
- * resulting struct can be deallocated by calling avcodec_close() on it followed
- * by av_free().
- *
- * @param codec if non-NULL, allocate private data and initialize defaults
- *              for the given codec. It is illegal to then call avcodec_open2()
- *              with a different codec.
- *              If NULL, then the codec-specific defaults won't be initialized,
- *              which may result in suboptimal default settings (this is
- *              important mainly for encoders, e.g. libx264).
- *
- * @return An AVCodecContext filled with default values or NULL on failure.
- * @see avcodec_get_context_defaults
- */
-AVCodecContext *avcodec_alloc_context3(const AVCodec *codec);
-
-/**
- * Set the fields of the given AVCodecContext to default values corresponding
- * to the given codec (defaults may be codec-dependent).
- *
- * Do not call this function if a non-NULL codec has been passed
- * to avcodec_alloc_context3() that allocated this AVCodecContext.
- * If codec is non-NULL, it is illegal to call avcodec_open2() with a
- * different codec on this AVCodecContext.
- */
-int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec);
-
-/**
- * Get the AVClass for AVCodecContext. It can be used in combination with
- * AV_OPT_SEARCH_FAKE_OBJ for examining options.
- *
- * @see av_opt_find().
- */
-const AVClass *avcodec_get_class(void);
-
-/**
- * Copy the settings of the source AVCodecContext into the destination
- * AVCodecContext. The resulting destination codec context will be
- * unopened, i.e. you are required to call avcodec_open2() before you
- * can use this AVCodecContext to decode/encode video/audio data.
- *
- * @param dest target codec context, should be initialized with
- *             avcodec_alloc_context3(), but otherwise uninitialized
- * @param src source codec context
- * @return AVERROR() on error (e.g. memory allocation error), 0 on success
- */
-int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
-
-#if FF_API_AVFRAME_LAVC
-/**
- * @deprecated use av_frame_alloc()
- */
-attribute_deprecated
-AVFrame *avcodec_alloc_frame(void);
-
-/**
- * Set the fields of the given AVFrame to default values.
- *
- * @param frame The AVFrame of which the fields should be set to default values.
- *
- * @deprecated use av_frame_unref()
- */
-attribute_deprecated
-void avcodec_get_frame_defaults(AVFrame *frame);
-
-/**
- * Free the frame and any dynamically allocated objects in it,
- * e.g. extended_data.
- *
- * @param frame frame to be freed. The pointer will be set to NULL.
- *
- * @warning this function does NOT free the data buffers themselves
- * (it does not know how, since they might have been allocated with
- *  a custom get_buffer()).
- *
- * @deprecated use av_frame_free()
- */
-attribute_deprecated
-void avcodec_free_frame(AVFrame **frame);
-#endif
-
-/**
- * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
- * function the context has to be allocated with avcodec_alloc_context3().
- *
- * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
- * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
- * retrieving a codec.
- *
- * @warning This function is not thread safe!
- *
- * @code
- * avcodec_register_all();
- * av_dict_set(&opts, "b", "2.5M", 0);
- * codec = avcodec_find_decoder(AV_CODEC_ID_H264);
- * if (!codec)
- *     exit(1);
- *
- * context = avcodec_alloc_context3(codec);
- *
- * if (avcodec_open2(context, codec, opts) < 0)
- *     exit(1);
- * @endcode
- *
- * @param avctx The context to initialize.
- * @param codec The codec to open this context for. If a non-NULL codec has been
- *              previously passed to avcodec_alloc_context3() or
- *              avcodec_get_context_defaults3() for this context, then this
- *              parameter MUST be either NULL or equal to the previously passed
- *              codec.
- * @param options A dictionary filled with AVCodecContext and codec-private options.
- *                On return this object will be filled with options that were not found.
- *
- * @return zero on success, a negative value on error
- * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(),
- *      av_dict_set(), av_opt_find().
- */
-int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
-
-/**
- * Close a given AVCodecContext and free all the data associated with it
- * (but not the AVCodecContext itself).
- *
- * Calling this function on an AVCodecContext that hasn't been opened will free
- * the codec-specific data allocated in avcodec_alloc_context3() /
- * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will
- * do nothing.
- */
-int avcodec_close(AVCodecContext *avctx);
-
-/**
- * Free all allocated data in the given subtitle struct.
- *
- * @param sub AVSubtitle to free.
- */
-void avsubtitle_free(AVSubtitle *sub);
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavc_packet
- * @{
- */
-
-#if FF_API_DESTRUCT_PACKET
-/**
- * Default packet destructor.
- * @deprecated use the AVBuffer API instead
- */
-attribute_deprecated
-void av_destruct_packet(AVPacket *pkt);
-#endif
-
-/**
- * Initialize optional fields of a packet with default values.
- *
- * Note, this does not touch the data and size members, which have to be
- * initialized separately.
- *
- * @param pkt packet
- */
-void av_init_packet(AVPacket *pkt);
-
-/**
- * Allocate the payload of a packet and initialize its fields with
- * default values.
- *
- * @param pkt packet
- * @param size wanted payload size
- * @return 0 if OK, AVERROR_xxx otherwise
- */
-int av_new_packet(AVPacket *pkt, int size);
-
-/**
- * Reduce packet size, correctly zeroing padding
- *
- * @param pkt packet
- * @param size new size
- */
-void av_shrink_packet(AVPacket *pkt, int size);
-
-/**
- * Increase packet size, correctly zeroing padding
- *
- * @param pkt packet
- * @param grow_by number of bytes by which to increase the size of the packet
- */
-int av_grow_packet(AVPacket *pkt, int grow_by);
-
-/**
- * Initialize a reference-counted packet from av_malloc()ed data.
- *
- * @param pkt packet to be initialized. This function will set the data, size,
- *        buf and destruct fields, all others are left untouched.
- * @param data Data allocated by av_malloc() to be used as packet data. If this
- *        function returns successfully, the data is owned by the underlying AVBuffer.
- *        The caller may not access the data through other means.
- * @param size size of data in bytes, without the padding. I.e. the full buffer
- *        size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE.
- *
- * @return 0 on success, a negative AVERROR on error
- */
-int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
-
-/**
- * @warning This is a hack - the packet memory allocation stuff is broken. The
- * packet is allocated if it was not really allocated.
- */
-int av_dup_packet(AVPacket *pkt);
-
-/**
- * Free a packet.
- *
- * @param pkt packet to free
- */
-void av_free_packet(AVPacket *pkt);
-
-/**
- * Allocate new information of a packet.
- *
- * @param pkt packet
- * @param type side information type
- * @param size side information size
- * @return pointer to fresh allocated data or NULL otherwise
- */
-uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                                 int size);
-
-/**
- * Shrink the already allocated side data buffer
- *
- * @param pkt packet
- * @param type side information type
- * @param size new side information size
- * @return 0 on success, < 0 on failure
- */
-int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                               int size);
-
-/**
- * Get side information from packet.
- *
- * @param pkt packet
- * @param type desired side information type
- * @param size pointer for side information size to store (optional)
- * @return pointer to data if present or NULL otherwise
- */
-uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                                 int *size);
-
-/**
- * Convenience function to free all the side data stored.
- * All the other fields stay untouched.
- *
- * @param pkt packet
- */
-void av_packet_free_side_data(AVPacket *pkt);
-
-/**
- * Setup a new reference to the data described by a given packet
- *
- * If src is reference-counted, setup dst as a new reference to the
- * buffer in src. Otherwise allocate a new buffer in dst and copy the
- * data from src into it.
- *
- * All the other fields are copied from src.
- *
- * @see av_packet_unref
- *
- * @param dst Destination packet
- * @param src Source packet
- *
- * @return 0 on success, a negative AVERROR on error.
- */
-int av_packet_ref(AVPacket *dst, AVPacket *src);
-
-/**
- * Wipe the packet.
- *
- * Unreference the buffer referenced by the packet and reset the
- * remaining packet fields to their default values.
- *
- * @param pkt The packet to be unreferenced.
- */
-void av_packet_unref(AVPacket *pkt);
-
-/**
- * Move every field in src to dst and reset src.
- *
- * @see av_packet_unref
- *
- * @param src Source packet, will be reset
- * @param dst Destination packet
- */
-void av_packet_move_ref(AVPacket *dst, AVPacket *src);
-
-/**
- * Copy only "properties" fields from src to dst.
- *
- * Properties for the purpose of this function are all the fields
- * beside those related to the packet data (buf, data, size)
- *
- * @param dst Destination packet
- * @param src Source packet
- *
- * @return 0 on success AVERROR on failure.
- *
- */
-int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavc_decoding
- * @{
- */
-
-/**
- * Find a registered decoder with a matching codec ID.
- *
- * @param id AVCodecID of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder(enum AVCodecID id);
-
-/**
- * Find a registered decoder with the specified name.
- *
- * @param name name of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder_by_name(const char *name);
-
-#if FF_API_GET_BUFFER
-attribute_deprecated int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
-attribute_deprecated void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
-attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
-#endif
-
-/**
- * The default callback for AVCodecContext.get_buffer2(). It is made public so
- * it can be called by custom get_buffer2() implementations for decoders without
- * CODEC_CAP_DR1 set.
- */
-int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
-
-#if FF_API_EMU_EDGE
-/**
- * Return the amount of padding in pixels which the get_buffer callback must
- * provide around the edge of the image for codecs which do not have the
- * CODEC_FLAG_EMU_EDGE flag.
- *
- * @return Required padding in pixels.
- *
- * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer
- * needed
- */
-attribute_deprecated
-unsigned avcodec_get_edge_width(void);
-#endif
-
-/**
- * Modify width and height values so that they will result in a memory
- * buffer that is acceptable for the codec if you do not use any horizontal
- * padding.
- *
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- */
-void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
-
-/**
- * Modify width and height values so that they will result in a memory
- * buffer that is acceptable for the codec if you also ensure that all
- * line sizes are a multiple of the respective linesize_align[i].
- *
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- */
-void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
-                               int linesize_align[AV_NUM_DATA_POINTERS]);
-
-/**
- * Decode the audio frame of size avpkt->size from avpkt->data into frame.
- *
- * Some decoders may support multiple frames in a single AVPacket. Such
- * decoders would then just decode the first frame and the return value would be
- * less than the packet size. In this case, avcodec_decode_audio4 has to be
- * called again with an AVPacket containing the remaining data in order to
- * decode the second frame, etc...  Even if no frames are returned, the packet
- * needs to be fed to the decoder with remaining data until it is completely
- * consumed or an error occurs.
- *
- * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input
- * and output. This means that for some packets they will not immediately
- * produce decoded output and need to be flushed at the end of decoding to get
- * all the decoded data. Flushing is done by calling this function with packets
- * with avpkt->data set to NULL and avpkt->size set to 0 until it stops
- * returning samples. It is safe to flush even those decoders that are not
- * marked with CODEC_CAP_DELAY, then no samples will be returned.
- *
- * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
- *          larger than the actual read bytes because some optimized bitstream
- *          readers read 32 or 64 bits at once and could read over the end.
- *
- * @param      avctx the codec context
- * @param[out] frame The AVFrame in which to store decoded audio samples.
- *                   The decoder will allocate a buffer for the decoded frame by
- *                   calling the AVCodecContext.get_buffer2() callback.
- *                   When AVCodecContext.refcounted_frames is set to 1, the frame is
- *                   reference counted and the returned reference belongs to the
- *                   caller. The caller must release the frame using av_frame_unref()
- *                   when the frame is no longer needed. The caller may safely write
- *                   to the frame if av_frame_is_writable() returns 1.
- *                   When AVCodecContext.refcounted_frames is set to 0, the returned
- *                   reference belongs to the decoder and is valid only until the
- *                   next call to this function or until closing or flushing the
- *                   decoder. The caller may not write to it.
- * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
- *                           non-zero. Note that this field being set to zero
- *                           does not mean that an error has occurred. For
- *                           decoders with CODEC_CAP_DELAY set, no given decode
- *                           call is guaranteed to produce a frame.
- * @param[in]  avpkt The input AVPacket containing the input buffer.
- *                   At least avpkt->data and avpkt->size should be set. Some
- *                   decoders might also require additional fields to be set.
- * @return A negative error code is returned if an error occurred during
- *         decoding, otherwise the number of bytes consumed from the input
- *         AVPacket is returned.
- */
-int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
-                          int *got_frame_ptr, AVPacket *avpkt);
-
-/**
- * Decode the video frame of size avpkt->size from avpkt->data into picture.
- * Some decoders may support multiple frames in a single AVPacket, such
- * decoders would then just decode the first frame.
- *
- * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
- * the actual read bytes because some optimized bitstream readers read 32 or 64
- * bits at once and could read over the end.
- *
- * @warning The end of the input buffer buf should be set to 0 to ensure that
- * no overreading happens for damaged MPEG streams.
- *
- * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
- * between input and output, these need to be fed with avpkt->data=NULL,
- * avpkt->size=0 at the end to return the remaining frames.
- *
- * @param avctx the codec context
- * @param[out] picture The AVFrame in which the decoded video frame will be stored.
- *             Use av_frame_alloc() to get an AVFrame. The codec will
- *             allocate memory for the actual bitmap by calling the
- *             AVCodecContext.get_buffer2() callback.
- *             When AVCodecContext.refcounted_frames is set to 1, the frame is
- *             reference counted and the returned reference belongs to the
- *             caller. The caller must release the frame using av_frame_unref()
- *             when the frame is no longer needed. The caller may safely write
- *             to the frame if av_frame_is_writable() returns 1.
- *             When AVCodecContext.refcounted_frames is set to 0, the returned
- *             reference belongs to the decoder and is valid only until the
- *             next call to this function or until closing or flushing the
- *             decoder. The caller may not write to it.
- *
- * @param[in] avpkt The input AVpacket containing the input buffer.
- *            You can create such packet with av_init_packet() and by then setting
- *            data and size, some decoders might in addition need other fields like
- *            flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
- *            fields possible.
- * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame could be decompressed.
- */
-int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
-                         int *got_picture_ptr,
-                         AVPacket *avpkt);
-
-/**
- * Decode a subtitle message.
- * Return a negative value on error, otherwise return the number of bytes used.
- * If no subtitle could be decompressed, got_sub_ptr is zero.
- * Otherwise, the subtitle is stored in *sub.
- * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
- * simplicity, because the performance difference is expect to be negligible
- * and reusing a get_buffer written for video codecs would probably perform badly
- * due to a potentially very different allocation pattern.
- *
- * @param avctx the codec context
- * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
-                   freed with avsubtitle_free if *got_sub_ptr is set.
- * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
- * @param[in] avpkt The input AVPacket containing the input buffer.
- */
-int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
-                            int *got_sub_ptr,
-                            AVPacket *avpkt);
-
-/**
- * @defgroup lavc_parsing Frame parsing
- * @{
- */
-
-enum AVPictureStructure {
-    AV_PICTURE_STRUCTURE_UNKNOWN,      //< unknown
-    AV_PICTURE_STRUCTURE_TOP_FIELD,    //< coded as top field
-    AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field
-    AV_PICTURE_STRUCTURE_FRAME,        //< coded as frame
-};
-
-typedef struct AVCodecParserContext {
-    void *priv_data;
-    struct AVCodecParser *parser;
-    int64_t frame_offset; /* offset of the current frame */
-    int64_t cur_offset; /* current offset
-                           (incremented by each av_parser_parse()) */
-    int64_t next_frame_offset; /* offset of the next frame */
-    /* video info */
-    int pict_type; /* XXX: Put it back in AVCodecContext. */
-    /**
-     * This field is used for proper frame duration computation in lavf.
-     * It signals, how much longer the frame duration of the current frame
-     * is compared to normal frame duration.
-     *
-     * frame_duration = (1 + repeat_pict) * time_base
-     *
-     * It is used by codecs like H.264 to display telecined material.
-     */
-    int repeat_pict; /* XXX: Put it back in AVCodecContext. */
-    int64_t pts;     /* pts of the current frame */
-    int64_t dts;     /* dts of the current frame */
-
-    /* private data */
-    int64_t last_pts;
-    int64_t last_dts;
-    int fetch_timestamp;
-
-#define AV_PARSER_PTS_NB 4
-    int cur_frame_start_index;
-    int64_t cur_frame_offset[AV_PARSER_PTS_NB];
-    int64_t cur_frame_pts[AV_PARSER_PTS_NB];
-    int64_t cur_frame_dts[AV_PARSER_PTS_NB];
-
-    int flags;
-#define PARSER_FLAG_COMPLETE_FRAMES           0x0001
-#define PARSER_FLAG_ONCE                      0x0002
-/// Set if the parser has a valid file offset
-#define PARSER_FLAG_FETCHED_OFFSET            0x0004
-
-    int64_t offset;      ///< byte offset from starting packet start
-    int64_t cur_frame_end[AV_PARSER_PTS_NB];
-
-    /**
-     * Set by parser to 1 for key frames and 0 for non-key frames.
-     * It is initialized to -1, so if the parser doesn't set this flag,
-     * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
-     * will be used.
-     */
-    int key_frame;
-
-    /**
-     * Time difference in stream time base units from the pts of this
-     * packet to the point at which the output from the decoder has converged
-     * independent from the availability of previous frames. That is, the
-     * frames are virtually identical no matter if decoding started from
-     * the very first frame or from this keyframe.
-     * Is AV_NOPTS_VALUE if unknown.
-     * This field is not the display duration of the current frame.
-     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
-     * set.
-     *
-     * The purpose of this field is to allow seeking in streams that have no
-     * keyframes in the conventional sense. It corresponds to the
-     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
-     * essential for some types of subtitle streams to ensure that all
-     * subtitles are correctly displayed after seeking.
-     */
-    int64_t convergence_duration;
-
-    // Timestamp generation support:
-    /**
-     * Synchronization point for start of timestamp generation.
-     *
-     * Set to >0 for sync point, 0 for no sync point and <0 for undefined
-     * (default).
-     *
-     * For example, this corresponds to presence of H.264 buffering period
-     * SEI message.
-     */
-    int dts_sync_point;
-
-    /**
-     * Offset of the current timestamp against last timestamp sync point in
-     * units of AVCodecContext.time_base.
-     *
-     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
-     * contain a valid timestamp offset.
-     *
-     * Note that the timestamp of sync point has usually a nonzero
-     * dts_ref_dts_delta, which refers to the previous sync point. Offset of
-     * the next frame after timestamp sync point will be usually 1.
-     *
-     * For example, this corresponds to H.264 cpb_removal_delay.
-     */
-    int dts_ref_dts_delta;
-
-    /**
-     * Presentation delay of current frame in units of AVCodecContext.time_base.
-     *
-     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
-     * contain valid non-negative timestamp delta (presentation time of a frame
-     * must not lie in the past).
-     *
-     * This delay represents the difference between decoding and presentation
-     * time of the frame.
-     *
-     * For example, this corresponds to H.264 dpb_output_delay.
-     */
-    int pts_dts_delta;
-
-    /**
-     * Position of the packet in file.
-     *
-     * Analogous to cur_frame_pts/dts
-     */
-    int64_t cur_frame_pos[AV_PARSER_PTS_NB];
-
-    /**
-     * Byte position of currently parsed frame in stream.
-     */
-    int64_t pos;
-
-    /**
-     * Previous frame byte position.
-     */
-    int64_t last_pos;
-
-    /**
-     * Duration of the current frame.
-     * For audio, this is in units of 1 / AVCodecContext.sample_rate.
-     * For all other types, this is in units of AVCodecContext.time_base.
-     */
-    int duration;
-
-    enum AVFieldOrder field_order;
-
-    /**
-     * Indicate whether a picture is coded as a frame, top field or bottom field.
-     *
-     * For example, H.264 field_pic_flag equal to 0 corresponds to
-     * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag
-     * equal to 1 and bottom_field_flag equal to 0 corresponds to
-     * AV_PICTURE_STRUCTURE_TOP_FIELD.
-     */
-    enum AVPictureStructure picture_structure;
-
-    /**
-     * Picture number incremented in presentation or output order.
-     * This field may be reinitialized at the first picture of a new sequence.
-     *
-     * For example, this corresponds to H.264 PicOrderCnt.
-     */
-    int output_picture_number;
-} AVCodecParserContext;
-
-typedef struct AVCodecParser {
-    int codec_ids[5]; /* several codec IDs are permitted */
-    int priv_data_size;
-    int (*parser_init)(AVCodecParserContext *s);
-    int (*parser_parse)(AVCodecParserContext *s,
-                        AVCodecContext *avctx,
-                        const uint8_t **poutbuf, int *poutbuf_size,
-                        const uint8_t *buf, int buf_size);
-    void (*parser_close)(AVCodecParserContext *s);
-    int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
-    struct AVCodecParser *next;
-} AVCodecParser;
-
-AVCodecParser *av_parser_next(AVCodecParser *c);
-
-void av_register_codec_parser(AVCodecParser *parser);
-AVCodecParserContext *av_parser_init(int codec_id);
-
-/**
- * Parse a packet.
- *
- * @param s             parser context.
- * @param avctx         codec context.
- * @param poutbuf       set to pointer to parsed buffer or NULL if not yet finished.
- * @param poutbuf_size  set to size of parsed buffer or zero if not yet finished.
- * @param buf           input buffer.
- * @param buf_size      input length, to signal EOF, this should be 0 (so that the last frame can be output).
- * @param pts           input presentation timestamp.
- * @param dts           input decoding timestamp.
- * @param pos           input byte position in stream.
- * @return the number of bytes of the input bitstream used.
- *
- * Example:
- * @code
- *   while(in_len){
- *       len = av_parser_parse2(myparser, AVCodecContext, &data, &size,
- *                                        in_data, in_len,
- *                                        pts, dts, pos);
- *       in_data += len;
- *       in_len  -= len;
- *
- *       if(size)
- *          decode_frame(data, size);
- *   }
- * @endcode
- */
-int av_parser_parse2(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size,
-                     int64_t pts, int64_t dts,
-                     int64_t pos);
-
-/**
- * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
- * @deprecated use AVBitstreamFilter
- */
-int av_parser_change(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe);
-void av_parser_close(AVCodecParserContext *s);
-
-/**
- * @}
- * @}
- */
-
-/**
- * @addtogroup lavc_encoding
- * @{
- */
-
-/**
- * Find a registered encoder with a matching codec ID.
- *
- * @param id AVCodecID of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder(enum AVCodecID id);
-
-/**
- * Find a registered encoder with the specified name.
- *
- * @param name name of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder_by_name(const char *name);
-
-/**
- * Encode a frame of audio.
- *
- * Takes input samples from frame and writes the next output packet, if
- * available, to avpkt. The output packet does not necessarily contain data for
- * the most recent frame, as encoders can delay, split, and combine input frames
- * internally as needed.
- *
- * @param avctx     codec context
- * @param avpkt     output AVPacket.
- *                  The user can supply an output buffer by setting
- *                  avpkt->data and avpkt->size prior to calling the
- *                  function, but if the size of the user-provided data is not
- *                  large enough, encoding will fail. All other AVPacket fields
- *                  will be reset by the encoder using av_init_packet(). If
- *                  avpkt->data is NULL, the encoder will allocate it.
- *                  The encoder will set avpkt->size to the size of the
- *                  output packet.
- *
- *                  If this function fails or produces no output, avpkt will be
- *                  freed using av_free_packet() (i.e. avpkt->destruct will be
- *                  called to free the user supplied buffer).
- * @param[in] frame AVFrame containing the raw audio data to be encoded.
- *                  May be NULL when flushing an encoder that has the
- *                  CODEC_CAP_DELAY capability set.
- *                  If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
- *                  can have any number of samples.
- *                  If it is not set, frame->nb_samples must be equal to
- *                  avctx->frame_size for all frames except the last.
- *                  The final frame may be smaller than avctx->frame_size.
- * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
- *                            output packet is non-empty, and to 0 if it is
- *                            empty. If the function returns an error, the
- *                            packet can be assumed to be invalid, and the
- *                            value of got_packet_ptr is undefined and should
- *                            not be used.
- * @return          0 on success, negative error code on failure
- */
-int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
-                          const AVFrame *frame, int *got_packet_ptr);
-
-/**
- * Encode a frame of video.
- *
- * Takes input raw video data from frame and writes the next output packet, if
- * available, to avpkt. The output packet does not necessarily contain data for
- * the most recent frame, as encoders can delay and reorder input frames
- * internally as needed.
- *
- * @param avctx     codec context
- * @param avpkt     output AVPacket.
- *                  The user can supply an output buffer by setting
- *                  avpkt->data and avpkt->size prior to calling the
- *                  function, but if the size of the user-provided data is not
- *                  large enough, encoding will fail. All other AVPacket fields
- *                  will be reset by the encoder using av_init_packet(). If
- *                  avpkt->data is NULL, the encoder will allocate it.
- *                  The encoder will set avpkt->size to the size of the
- *                  output packet. The returned data (if any) belongs to the
- *                  caller, he is responsible for freeing it.
- *
- *                  If this function fails or produces no output, avpkt will be
- *                  freed using av_free_packet() (i.e. avpkt->destruct will be
- *                  called to free the user supplied buffer).
- * @param[in] frame AVFrame containing the raw video data to be encoded.
- *                  May be NULL when flushing an encoder that has the
- *                  CODEC_CAP_DELAY capability set.
- * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
- *                            output packet is non-empty, and to 0 if it is
- *                            empty. If the function returns an error, the
- *                            packet can be assumed to be invalid, and the
- *                            value of got_packet_ptr is undefined and should
- *                            not be used.
- * @return          0 on success, negative error code on failure
- */
-int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
-                          const AVFrame *frame, int *got_packet_ptr);
-
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                            const AVSubtitle *sub);
-
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavc_picture
- * @{
- */
-
-/**
- * Allocate memory for a picture.  Call avpicture_free() to free it.
- *
- * @see avpicture_fill()
- *
- * @param picture the picture to be filled in
- * @param pix_fmt the format of the picture
- * @param width the width of the picture
- * @param height the height of the picture
- * @return zero if successful, a negative value if not
- */
-int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * Free a picture previously allocated by avpicture_alloc().
- * The data buffer used by the AVPicture is freed, but the AVPicture structure
- * itself is not.
- *
- * @param picture the AVPicture to be freed
- */
-void avpicture_free(AVPicture *picture);
-
-/**
- * Fill in the AVPicture fields.
- * The fields of the given AVPicture are filled in by using the 'ptr' address
- * which points to the image data buffer. Depending on the specified picture
- * format, one or multiple image data pointers and line sizes will be set.
- * If a planar format is specified, several pointers will be set pointing to
- * the different picture planes and the line sizes of the different planes
- * will be stored in the lines_sizes array.
- * Call with ptr == NULL to get the required size for the ptr buffer.
- *
- * To allocate the buffer and fill in the AVPicture fields in one call,
- * use avpicture_alloc().
- *
- * @param picture AVPicture whose fields are to be filled in
- * @param ptr Buffer which will contain or contains the actual image data
- * @param pix_fmt The format in which the picture data is stored.
- * @param width the width of the image in pixels
- * @param height the height of the image in pixels
- * @return size of the image data in bytes
- */
-int avpicture_fill(AVPicture *picture, uint8_t *ptr,
-                   enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * Copy pixel data from an AVPicture into a buffer.
- * The data is stored compactly, without any gaps for alignment or padding
- * which may be applied by avpicture_fill().
- *
- * @see avpicture_get_size()
- *
- * @param[in] src AVPicture containing image data
- * @param[in] pix_fmt The format in which the picture data is stored.
- * @param[in] width the width of the image in pixels.
- * @param[in] height the height of the image in pixels.
- * @param[out] dest A buffer into which picture data will be copied.
- * @param[in] dest_size The size of 'dest'.
- * @return The number of bytes written to dest, or a negative value (error code) on error.
- */
-int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
-                     int width, int height,
-                     unsigned char *dest, int dest_size);
-
-/**
- * Calculate the size in bytes that a picture of the given width and height
- * would occupy if stored in the given picture format.
- * Note that this returns the size of a compact representation as generated
- * by avpicture_layout(), which can be smaller than the size required for e.g.
- * avpicture_fill().
- *
- * @param pix_fmt the given picture format
- * @param width the width of the image
- * @param height the height of the image
- * @return Image data size in bytes or -1 on error (e.g. too large dimensions).
- */
-int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
-
-#if FF_API_DEINTERLACE
-/**
- *  deinterlace - if not supported return -1
- *
- * @deprecated - use yadif (in libavfilter) instead
- */
-attribute_deprecated
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
-                          enum AVPixelFormat pix_fmt, int width, int height);
-#endif
-/**
- * Copy image src to dst. Wraps av_picture_data_copy() above.
- */
-void av_picture_copy(AVPicture *dst, const AVPicture *src,
-                     enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * Crop image top and left side.
- */
-int av_picture_crop(AVPicture *dst, const AVPicture *src,
-                    enum AVPixelFormat pix_fmt, int top_band, int left_band);
-
-/**
- * Pad image.
- */
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
-            int padtop, int padbottom, int padleft, int padright, int *color);
-
-/**
- * @}
- */
-
-/**
- * @defgroup lavc_misc Utility functions
- * @ingroup libavc
- *
- * Miscellaneous utility functions related to both encoding and decoding
- * (or neither).
- * @{
- */
-
-/**
- * @defgroup lavc_misc_pixfmt Pixel formats
- *
- * Functions for working with pixel formats.
- * @{
- */
-
-/**
- * @deprecated Use av_pix_fmt_get_chroma_sub_sample
- */
-
-void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
-
-/**
- * Return a value representing the fourCC code associated to the
- * pixel format pix_fmt, or 0 if no associated fourCC code can be
- * found.
- */
-unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
-
-#define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
-#define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
-#define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
-#define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
-#define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
-#define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
-
-/**
- * Compute what kind of losses will occur when converting from one specific
- * pixel format to another.
- * When converting from one pixel format to another, information loss may occur.
- * For example, when converting from RGB24 to GRAY, the color information will
- * be lost. Similarly, other losses occur when converting from some formats to
- * other formats. These losses can involve loss of chroma, but also loss of
- * resolution, loss of color depth, loss due to the color space conversion, loss
- * of the alpha bits or loss due to color quantization.
- * avcodec_get_fix_fmt_loss() informs you about the various types of losses
- * which will occur when converting from one pixel format to another.
- *
- * @param[in] dst_pix_fmt destination pixel format
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @return Combination of flags informing you what kind of losses will occur.
- */
-int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
-                             int has_alpha);
-
-/**
- * Find the best pixel format to convert to given a certain source pixel
- * format.  When converting from one pixel format to another, information loss
- * may occur.  For example, when converting from RGB24 to GRAY, the color
- * information will be lost. Similarly, other losses occur when converting from
- * some formats to other formats. avcodec_find_best_pix_fmt2() searches which of
- * the given pixel formats should be used to suffer the least amount of loss.
- * The pixel formats from which it chooses one, are determined by the
- * pix_fmt_list parameter.
- *
- *
- * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
- * @return The best pixel format to convert to or -1 if none was found.
- */
-enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
-                                              enum AVPixelFormat src_pix_fmt,
-                                              int has_alpha, int *loss_ptr);
-
-enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
-
-/**
- * @}
- */
-
-#if FF_API_SET_DIMENSIONS
-/**
- * @deprecated this function is not supposed to be used from outside of lavc
- */
-attribute_deprecated
-void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
-#endif
-
-/**
- * Put a string representing the codec tag codec_tag in buf.
- *
- * @param buf       buffer to place codec tag in
- * @param buf_size size in bytes of buf
- * @param codec_tag codec tag to assign
- * @return the length of the string that would have been generated if
- * enough space had been available, excluding the trailing null
- */
-size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
-
-void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
-
-/**
- * Return a name for the specified profile, if available.
- *
- * @param codec the codec that is searched for the given profile
- * @param profile the profile value for which a name is requested
- * @return A name for the profile if found, NULL otherwise.
- */
-const char *av_get_profile_name(const AVCodec *codec, int profile);
-
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
-int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
-//FIXME func typedef
-
-/**
- * Fill audio frame data and linesize.
- * AVFrame extended_data channel pointers are allocated if necessary for
- * planar audio.
- *
- * @param frame       the AVFrame
- *                    frame->nb_samples must be set prior to calling the
- *                    function. This function fills in frame->data,
- *                    frame->extended_data, frame->linesize[0].
- * @param nb_channels channel count
- * @param sample_fmt  sample format
- * @param buf         buffer to use for frame data
- * @param buf_size    size of buffer
- * @param align       plane size sample alignment (0 = default)
- * @return            0 on success, negative error code on failure
- */
-int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
-                             enum AVSampleFormat sample_fmt, const uint8_t *buf,
-                             int buf_size, int align);
-
-/**
- * Reset the internal decoder state / flush internal buffers. Should be called
- * e.g. when seeking or when switching to a different stream.
- *
- * @note when refcounted frames are not used (i.e. avctx->refcounted_frames is 0),
- * this invalidates the frames previously returned from the decoder. When
- * refcounted frames are used, the decoder just releases any references it might
- * keep internally, but the caller's reference remains valid.
- */
-void avcodec_flush_buffers(AVCodecContext *avctx);
-
-/**
- * Return codec bits per sample.
- *
- * @param[in] codec_id the codec
- * @return Number of bits per sample or zero if unknown for the given codec.
- */
-int av_get_bits_per_sample(enum AVCodecID codec_id);
-
-/**
- * Return codec bits per sample.
- * Only return non-zero if the bits per sample is exactly correct, not an
- * approximation.
- *
- * @param[in] codec_id the codec
- * @return Number of bits per sample or zero if unknown for the given codec.
- */
-int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
-
-/**
- * Return audio frame duration.
- *
- * @param avctx        codec context
- * @param frame_bytes  size of the frame, or 0 if unknown
- * @return             frame duration, in samples, if known. 0 if not able to
- *                     determine.
- */
-int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
-
-
-typedef struct AVBitStreamFilterContext {
-    void *priv_data;
-    struct AVBitStreamFilter *filter;
-    AVCodecParserContext *parser;
-    struct AVBitStreamFilterContext *next;
-} AVBitStreamFilterContext;
-
-
-typedef struct AVBitStreamFilter {
-    const char *name;
-    int priv_data_size;
-    int (*filter)(AVBitStreamFilterContext *bsfc,
-                  AVCodecContext *avctx, const char *args,
-                  uint8_t **poutbuf, int *poutbuf_size,
-                  const uint8_t *buf, int buf_size, int keyframe);
-    void (*close)(AVBitStreamFilterContext *bsfc);
-    struct AVBitStreamFilter *next;
-} AVBitStreamFilter;
-
-void av_register_bitstream_filter(AVBitStreamFilter *bsf);
-AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
-int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
-                               AVCodecContext *avctx, const char *args,
-                               uint8_t **poutbuf, int *poutbuf_size,
-                               const uint8_t *buf, int buf_size, int keyframe);
-void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
-
-AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
-
-/* memory */
-
-/**
- * Allocate a buffer with padding, reusing the given one if large enough.
- *
- * Same behaviour av_fast_malloc but the buffer has additional
- * FF_INPUT_PADDING_SIZE at the end which will always memset to 0.
- *
- */
-void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
-
-/**
- * Encode extradata length to a buffer. Used by xiph codecs.
- *
- * @param s buffer to write to; must be at least (v/255+1) bytes long
- * @param v size of extradata in bytes
- * @return number of bytes written to the buffer.
- */
-unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
-
-#if FF_API_MISSING_SAMPLE
-/**
- * Log a generic warning message about a missing feature. This function is
- * intended to be used internally by Libav (libavcodec, libavformat, etc.)
- * only, and would normally not be used by applications.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] feature string containing the name of the missing feature
- * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
- * If want_sample is non-zero, additional verbage will be added to the log
- * message which tells the user how to report samples to the development
- * mailing list.
- * @deprecated Use avpriv_report_missing_feature() instead.
- */
-attribute_deprecated
-void av_log_missing_feature(void *avc, const char *feature, int want_sample);
-
-/**
- * Log a generic warning message asking for a sample. This function is
- * intended to be used internally by Libav (libavcodec, libavformat, etc.)
- * only, and would normally not be used by applications.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] msg string containing an optional message, or NULL if no message
- * @deprecated Use avpriv_request_sample() instead.
- */
-attribute_deprecated
-void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
-#endif /* FF_API_MISSING_SAMPLE */
-
-/**
- * Register the hardware accelerator hwaccel.
- */
-void av_register_hwaccel(AVHWAccel *hwaccel);
-
-/**
- * If hwaccel is NULL, returns the first registered hardware accelerator,
- * if hwaccel is non-NULL, returns the next registered hardware accelerator
- * after hwaccel, or NULL if hwaccel is the last one.
- */
-AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
-
-
-/**
- * Lock operation used by lockmgr
- */
-enum AVLockOp {
-  AV_LOCK_CREATE,  ///< Create a mutex
-  AV_LOCK_OBTAIN,  ///< Lock the mutex
-  AV_LOCK_RELEASE, ///< Unlock the mutex
-  AV_LOCK_DESTROY, ///< Free mutex resources
-};
-
-/**
- * Register a user provided lock manager supporting the operations
- * specified by AVLockOp. mutex points to a (void *) where the
- * lockmgr should store/get a pointer to a user allocated mutex. It's
- * NULL upon AV_LOCK_CREATE and != NULL for all other ops.
- *
- * @param cb User defined callback. Note: Libav may invoke calls to this
- *           callback during the call to av_lockmgr_register().
- *           Thus, the application must be prepared to handle that.
- *           If cb is set to NULL the lockmgr will be unregistered.
- *           Also note that during unregistration the previously registered
- *           lockmgr callback may also be invoked.
- */
-int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
-
-/**
- * Get the type of the given codec.
- */
-enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
-
-/**
- * @return a positive value if s is open (i.e. avcodec_open2() was called on it
- * with no corresponding avcodec_close()), 0 otherwise.
- */
-int avcodec_is_open(AVCodecContext *s);
-
-/**
- * @return a non-zero number if codec is an encoder, zero otherwise
- */
-int av_codec_is_encoder(const AVCodec *codec);
-
-/**
- * @return a non-zero number if codec is a decoder, zero otherwise
- */
-int av_codec_is_decoder(const AVCodec *codec);
-
-/**
- * @return descriptor for given codec ID or NULL if no descriptor exists.
- */
-const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
-
-/**
- * Iterate over all codec descriptors known to libavcodec.
- *
- * @param prev previous descriptor. NULL to get the first descriptor.
- *
- * @return next descriptor or NULL after the last descriptor
- */
-const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
-
-/**
- * @return codec descriptor with the given name or NULL if no such descriptor
- *         exists.
- */
-const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name);
-
-/**
- * @}
- */
-
-#endif /* AVCODEC_AVCODEC_H */
diff --git a/deps/libav/libavcodec/avfft.c b/deps/libav/libavcodec/avfft.c
deleted file mode 100644
index 513f57e..0000000
--- a/deps/libav/libavcodec/avfft.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-#include "avfft.h"
-#include "fft.h"
-#include "rdft.h"
-#include "dct.h"
-
-/* FFT */
-
-FFTContext *av_fft_init(int nbits, int inverse)
-{
-    FFTContext *s = av_malloc(sizeof(*s));
-
-    if (s && ff_fft_init(s, nbits, inverse))
-        av_freep(&s);
-
-    return s;
-}
-
-void av_fft_permute(FFTContext *s, FFTComplex *z)
-{
-    s->fft_permute(s, z);
-}
-
-void av_fft_calc(FFTContext *s, FFTComplex *z)
-{
-    s->fft_calc(s, z);
-}
-
-av_cold void av_fft_end(FFTContext *s)
-{
-    if (s) {
-        ff_fft_end(s);
-        av_free(s);
-    }
-}
-
-#if CONFIG_MDCT
-
-FFTContext *av_mdct_init(int nbits, int inverse, double scale)
-{
-    FFTContext *s = av_malloc(sizeof(*s));
-
-    if (s && ff_mdct_init(s, nbits, inverse, scale))
-        av_freep(&s);
-
-    return s;
-}
-
-void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    s->imdct_calc(s, output, input);
-}
-
-void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    s->imdct_half(s, output, input);
-}
-
-void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    s->mdct_calc(s, output, input);
-}
-
-av_cold void av_mdct_end(FFTContext *s)
-{
-    if (s) {
-        ff_mdct_end(s);
-        av_free(s);
-    }
-}
-
-#endif /* CONFIG_MDCT */
-
-#if CONFIG_RDFT
-
-RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans)
-{
-    RDFTContext *s = av_malloc(sizeof(*s));
-
-    if (s && ff_rdft_init(s, nbits, trans))
-        av_freep(&s);
-
-    return s;
-}
-
-void av_rdft_calc(RDFTContext *s, FFTSample *data)
-{
-    s->rdft_calc(s, data);
-}
-
-av_cold void av_rdft_end(RDFTContext *s)
-{
-    if (s) {
-        ff_rdft_end(s);
-        av_free(s);
-    }
-}
-
-#endif /* CONFIG_RDFT */
-
-#if CONFIG_DCT
-
-DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
-{
-    DCTContext *s = av_malloc(sizeof(*s));
-
-    if (s && ff_dct_init(s, nbits, inverse))
-        av_freep(&s);
-
-    return s;
-}
-
-void av_dct_calc(DCTContext *s, FFTSample *data)
-{
-    s->dct_calc(s, data);
-}
-
-av_cold void av_dct_end(DCTContext *s)
-{
-    if (s) {
-        ff_dct_end(s);
-        av_free(s);
-    }
-}
-
-#endif /* CONFIG_DCT */
diff --git a/deps/libav/libavcodec/avfft.h b/deps/libav/libavcodec/avfft.h
deleted file mode 100644
index e2e727d..0000000
--- a/deps/libav/libavcodec/avfft.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AVFFT_H
-#define AVCODEC_AVFFT_H
-
-/**
- * @file
- * @ingroup lavc_fft
- * FFT functions
- */
-
-/**
- * @defgroup lavc_fft FFT functions
- * @ingroup lavc_misc
- *
- * @{
- */
-
-typedef float FFTSample;
-
-typedef struct FFTComplex {
-    FFTSample re, im;
-} FFTComplex;
-
-typedef struct FFTContext FFTContext;
-
-/**
- * Set up a complex FFT.
- * @param nbits           log2 of the length of the input array
- * @param inverse         if 0 perform the forward transform, if 1 perform the inverse
- */
-FFTContext *av_fft_init(int nbits, int inverse);
-
-/**
- * Do the permutation needed BEFORE calling ff_fft_calc().
- */
-void av_fft_permute(FFTContext *s, FFTComplex *z);
-
-/**
- * Do a complex FFT with the parameters defined in av_fft_init(). The
- * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
- */
-void av_fft_calc(FFTContext *s, FFTComplex *z);
-
-void av_fft_end(FFTContext *s);
-
-FFTContext *av_mdct_init(int nbits, int inverse, double scale);
-void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_mdct_end(FFTContext *s);
-
-/* Real Discrete Fourier Transform */
-
-enum RDFTransformType {
-    DFT_R2C,
-    IDFT_C2R,
-    IDFT_R2C,
-    DFT_C2R,
-};
-
-typedef struct RDFTContext RDFTContext;
-
-/**
- * Set up a real FFT.
- * @param nbits           log2 of the length of the input array
- * @param trans           the type of transform
- */
-RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
-void av_rdft_calc(RDFTContext *s, FFTSample *data);
-void av_rdft_end(RDFTContext *s);
-
-/* Discrete Cosine Transform */
-
-typedef struct DCTContext DCTContext;
-
-enum DCTTransformType {
-    DCT_II = 0,
-    DCT_III,
-    DCT_I,
-    DST_I,
-};
-
-/**
- * Set up DCT.
- *
- * @param nbits           size of the input array:
- *                        (1 << nbits)     for DCT-II, DCT-III and DST-I
- *                        (1 << nbits) + 1 for DCT-I
- * @param type            the type of transform
- *
- * @note the first element of the input of DST-I is ignored
- */
-DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
-void av_dct_calc(DCTContext *s, FFTSample *data);
-void av_dct_end (DCTContext *s);
-
-/**
- * @}
- */
-
-#endif /* AVCODEC_AVFFT_H */
diff --git a/deps/libav/libavcodec/avpacket.c b/deps/libav/libavcodec/avpacket.c
deleted file mode 100644
index c0a0f8c..0000000
--- a/deps/libav/libavcodec/avpacket.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * AVPacket functions for libavcodec
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/avassert.h"
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-#if FF_API_DESTRUCT_PACKET
-
-void av_destruct_packet(AVPacket *pkt)
-{
-    av_free(pkt->data);
-    pkt->data = NULL;
-    pkt->size = 0;
-}
-
-/* a dummy destruct callback for the callers that assume AVPacket.destruct ==
- * NULL => static data */
-static void dummy_destruct_packet(AVPacket *pkt)
-{
-    av_assert0(0);
-}
-#endif
-
-void av_init_packet(AVPacket *pkt)
-{
-    pkt->pts                  = AV_NOPTS_VALUE;
-    pkt->dts                  = AV_NOPTS_VALUE;
-    pkt->pos                  = -1;
-    pkt->duration             = 0;
-    pkt->convergence_duration = 0;
-    pkt->flags                = 0;
-    pkt->stream_index         = 0;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-    pkt->destruct             = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-    pkt->buf                  = NULL;
-    pkt->side_data            = NULL;
-    pkt->side_data_elems      = 0;
-}
-
-static int packet_alloc(AVBufferRef **buf, int size)
-{
-    int ret;
-    if ((unsigned)size >= (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
-        return AVERROR(EINVAL);
-
-    ret = av_buffer_realloc(buf, size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (ret < 0)
-        return ret;
-
-    memset((*buf)->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-    return 0;
-}
-
-int av_new_packet(AVPacket *pkt, int size)
-{
-    AVBufferRef *buf = NULL;
-    int ret = packet_alloc(&buf, size);
-    if (ret < 0)
-        return ret;
-
-    av_init_packet(pkt);
-    pkt->buf      = buf;
-    pkt->data     = buf->data;
-    pkt->size     = size;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-    pkt->destruct = dummy_destruct_packet;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-    return 0;
-}
-
-void av_shrink_packet(AVPacket *pkt, int size)
-{
-    if (pkt->size <= size)
-        return;
-    pkt->size = size;
-    memset(pkt->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-}
-
-int av_grow_packet(AVPacket *pkt, int grow_by)
-{
-    int new_size;
-    av_assert0((unsigned)pkt->size <= INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!pkt->size)
-        return av_new_packet(pkt, grow_by);
-    if ((unsigned)grow_by >
-        INT_MAX - (pkt->size + FF_INPUT_BUFFER_PADDING_SIZE))
-        return -1;
-
-    new_size = pkt->size + grow_by + FF_INPUT_BUFFER_PADDING_SIZE;
-    if (pkt->buf) {
-        int ret = av_buffer_realloc(&pkt->buf, new_size);
-        if (ret < 0)
-            return ret;
-    } else {
-        pkt->buf = av_buffer_alloc(new_size);
-        if (!pkt->buf)
-            return AVERROR(ENOMEM);
-        memcpy(pkt->buf->data, pkt->data, FFMIN(pkt->size, pkt->size + grow_by));
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-        pkt->destruct = dummy_destruct_packet;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-    }
-    pkt->data  = pkt->buf->data;
-    pkt->size += grow_by;
-    memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-    return 0;
-}
-
-int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
-{
-    if (size >= INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
-        return AVERROR(EINVAL);
-
-    pkt->buf = av_buffer_create(data, size + FF_INPUT_BUFFER_PADDING_SIZE,
-                                av_buffer_default_free, NULL, 0);
-    if (!pkt->buf)
-        return AVERROR(ENOMEM);
-
-    pkt->data = data;
-    pkt->size = size;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-    pkt->destruct = dummy_destruct_packet;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-    return 0;
-}
-
-#define ALLOC_MALLOC(data, size) data = av_malloc(size)
-#define ALLOC_BUF(data, size)                \
-do {                                         \
-    av_buffer_realloc(&pkt->buf, size);      \
-    data = pkt->buf ? pkt->buf->data : NULL; \
-} while (0)
-
-#define DUP_DATA(dst, src, size, padding, ALLOC)                        \
-    do {                                                                \
-        void *data;                                                     \
-        if (padding) {                                                  \
-            if ((unsigned)(size) >                                      \
-                (unsigned)(size) + FF_INPUT_BUFFER_PADDING_SIZE)        \
-                goto failed_alloc;                                      \
-            ALLOC(data, size + FF_INPUT_BUFFER_PADDING_SIZE);           \
-        } else {                                                        \
-            ALLOC(data, size);                                          \
-        }                                                               \
-        if (!data)                                                      \
-            goto failed_alloc;                                          \
-        memcpy(data, src, size);                                        \
-        if (padding)                                                    \
-            memset((uint8_t *)data + size, 0,                           \
-                   FF_INPUT_BUFFER_PADDING_SIZE);                       \
-        dst = data;                                                     \
-    } while (0)
-
-int av_dup_packet(AVPacket *pkt)
-{
-    AVPacket tmp_pkt;
-
-FF_DISABLE_DEPRECATION_WARNINGS
-    if (!pkt->buf && pkt->data
-#if FF_API_DESTRUCT_PACKET
-        && !pkt->destruct
-#endif
-        ) {
-FF_ENABLE_DEPRECATION_WARNINGS
-        tmp_pkt = *pkt;
-
-        pkt->data      = NULL;
-        pkt->side_data = NULL;
-        DUP_DATA(pkt->data, tmp_pkt.data, pkt->size, 1, ALLOC_BUF);
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-        pkt->destruct = dummy_destruct_packet;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-        if (pkt->side_data_elems) {
-            int i;
-
-            DUP_DATA(pkt->side_data, tmp_pkt.side_data,
-                     pkt->side_data_elems * sizeof(*pkt->side_data), 0, ALLOC_MALLOC);
-            memset(pkt->side_data, 0,
-                   pkt->side_data_elems * sizeof(*pkt->side_data));
-            for (i = 0; i < pkt->side_data_elems; i++) {
-                DUP_DATA(pkt->side_data[i].data, tmp_pkt.side_data[i].data,
-                         tmp_pkt.side_data[i].size, 1, ALLOC_MALLOC);
-                pkt->side_data[i].size = tmp_pkt.side_data[i].size;
-                pkt->side_data[i].type = tmp_pkt.side_data[i].type;
-            }
-        }
-    }
-    return 0;
-
-failed_alloc:
-    av_free_packet(pkt);
-    return AVERROR(ENOMEM);
-}
-
-void av_packet_free_side_data(AVPacket *pkt)
-{
-    int i;
-    for (i = 0; i < pkt->side_data_elems; i++)
-        av_free(pkt->side_data[i].data);
-    av_freep(&pkt->side_data);
-    pkt->side_data_elems = 0;
-}
-
-void av_free_packet(AVPacket *pkt)
-{
-    if (pkt) {
-FF_DISABLE_DEPRECATION_WARNINGS
-        if (pkt->buf)
-            av_buffer_unref(&pkt->buf);
-#if FF_API_DESTRUCT_PACKET
-        else if (pkt->destruct)
-            pkt->destruct(pkt);
-        pkt->destruct = NULL;
-#endif
-FF_ENABLE_DEPRECATION_WARNINGS
-        pkt->data            = NULL;
-        pkt->size            = 0;
-
-        av_packet_free_side_data(pkt);
-    }
-}
-
-uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                                 int size)
-{
-    int elems = pkt->side_data_elems;
-
-    if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
-        return NULL;
-    if ((unsigned)size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
-        return NULL;
-
-    pkt->side_data = av_realloc(pkt->side_data,
-                                (elems + 1) * sizeof(*pkt->side_data));
-    if (!pkt->side_data)
-        return NULL;
-
-    pkt->side_data[elems].data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!pkt->side_data[elems].data)
-        return NULL;
-    pkt->side_data[elems].size = size;
-    pkt->side_data[elems].type = type;
-    pkt->side_data_elems++;
-
-    return pkt->side_data[elems].data;
-}
-
-uint8_t *av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                                 int *size)
-{
-    int i;
-
-    for (i = 0; i < pkt->side_data_elems; i++) {
-        if (pkt->side_data[i].type == type) {
-            if (size)
-                *size = pkt->side_data[i].size;
-            return pkt->side_data[i].data;
-        }
-    }
-    return NULL;
-}
-
-int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                               int size)
-{
-    int i;
-
-    for (i = 0; i < pkt->side_data_elems; i++) {
-        if (pkt->side_data[i].type == type) {
-            if (size > pkt->side_data[i].size)
-                return AVERROR(ENOMEM);
-            pkt->side_data[i].size = size;
-            return 0;
-        }
-    }
-    return AVERROR(ENOENT);
-}
-
-int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
-{
-    int i;
-
-    dst->pts                  = src->pts;
-    dst->dts                  = src->dts;
-    dst->pos                  = src->pos;
-    dst->duration             = src->duration;
-    dst->convergence_duration = src->convergence_duration;
-    dst->flags                = src->flags;
-    dst->stream_index         = src->stream_index;
-    dst->side_data_elems      = src->side_data_elems;
-
-    for (i = 0; i < src->side_data_elems; i++) {
-         enum AVPacketSideDataType type = src->side_data[i].type;
-         int size          = src->side_data[i].size;
-         uint8_t *src_data = src->side_data[i].data;
-         uint8_t *dst_data = av_packet_new_side_data(dst, type, size);
-
-        if (!dst_data) {
-            av_packet_free_side_data(dst);
-            return AVERROR(ENOMEM);
-        }
-        memcpy(dst_data, src_data, size);
-    }
-
-    return 0;
-}
-
-void av_packet_unref(AVPacket *pkt)
-{
-    av_packet_free_side_data(pkt);
-    av_buffer_unref(&pkt->buf);
-    av_init_packet(pkt);
-    pkt->data = NULL;
-    pkt->size = 0;
-}
-
-int av_packet_ref(AVPacket *dst, AVPacket *src)
-{
-    int ret;
-
-    ret = av_packet_copy_props(dst, src);
-    if (ret < 0)
-        return ret;
-
-    if (!src->buf) {
-        ret = packet_alloc(&dst->buf, src->size);
-        if (ret < 0)
-            goto fail;
-        memcpy(dst->buf->data, src->data, src->size);
-    } else
-        dst->buf = av_buffer_ref(src->buf);
-
-    dst->size = src->size;
-    dst->data = dst->buf->data;
-    return 0;
-fail:
-    av_packet_free_side_data(dst);
-    return ret;
-}
-
-void av_packet_move_ref(AVPacket *dst, AVPacket *src)
-{
-    *dst = *src;
-    av_init_packet(src);
-}
diff --git a/deps/libav/libavcodec/avpicture.c b/deps/libav/libavcodec/avpicture.c
deleted file mode 100644
index a50bbc4..0000000
--- a/deps/libav/libavcodec/avpicture.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * AVPicture management routines
- * Copyright (c) 2001, 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AVPicture management routines
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/common.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/colorspace.h"
-
-int avpicture_fill(AVPicture *picture, uint8_t *ptr,
-                   enum AVPixelFormat pix_fmt, int width, int height)
-{
-    int ret;
-
-    if ((ret = av_image_check_size(width, height, 0, NULL)) < 0)
-        return ret;
-
-    if ((ret = av_image_fill_linesizes(picture->linesize, pix_fmt, width)) < 0)
-        return ret;
-
-    return av_image_fill_pointers(picture->data, pix_fmt,
-                                  height, ptr, picture->linesize);
-}
-
-int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
-                     int width, int height,
-                     unsigned char *dest, int dest_size)
-{
-    int i, j, nb_planes = 0, linesizes[4];
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    int size = avpicture_get_size(pix_fmt, width, height);
-
-    if (size > dest_size || size < 0)
-        return AVERROR(EINVAL);
-
-    for (i = 0; i < desc->nb_components; i++)
-        nb_planes = FFMAX(desc->comp[i].plane, nb_planes);
-
-    nb_planes++;
-
-    av_image_fill_linesizes(linesizes, pix_fmt, width);
-    for (i = 0; i < nb_planes; i++) {
-        int h, shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
-        const unsigned char *s = src->data[i];
-        h = (height + (1 << shift) - 1) >> shift;
-
-        for (j = 0; j < h; j++) {
-            memcpy(dest, s, linesizes[i]);
-            dest += linesizes[i];
-            s += src->linesize[i];
-        }
-    }
-
-    if (desc->flags & AV_PIX_FMT_FLAG_PAL)
-        memcpy((unsigned char *)(((size_t)dest + 3) & ~3),
-               src->data[1], 256 * 4);
-
-    return size;
-}
-
-int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    AVPicture dummy_pict;
-    int ret;
-
-    if (!desc)
-        return AVERROR(EINVAL);
-    if ((ret = av_image_check_size(width, height, 0, NULL)) < 0)
-        return ret;
-    if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)
-        // do not include palette for these pseudo-paletted formats
-        return width * height;
-    return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height);
-}
-
-int avpicture_alloc(AVPicture *picture,
-                    enum AVPixelFormat pix_fmt, int width, int height)
-{
-    int ret = av_image_alloc(picture->data, picture->linesize,
-                             width, height, pix_fmt, 1);
-    if (ret < 0) {
-        memset(picture, 0, sizeof(AVPicture));
-        return ret;
-    }
-
-    return 0;
-}
-
-void avpicture_free(AVPicture *picture)
-{
-    av_free(picture->data[0]);
-}
-
-void av_picture_copy(AVPicture *dst, const AVPicture *src,
-                     enum AVPixelFormat pix_fmt, int width, int height)
-{
-    av_image_copy(dst->data, dst->linesize, src->data,
-                  src->linesize, pix_fmt, width, height);
-}
-
diff --git a/deps/libav/libavcodec/avr32/mathops.h b/deps/libav/libavcodec/avr32/mathops.h
deleted file mode 100644
index 528b7ad..0000000
--- a/deps/libav/libavcodec/avr32/mathops.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Simple math operations
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AVR32_MATHOPS_H
-#define AVCODEC_AVR32_MATHOPS_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/common.h"
-
-#if HAVE_INLINE_ASM
-
-#define MULL MULL
-static inline av_const int MULL(int a, int b, unsigned shift)
-{
-    union { int64_t x; int hl[2]; } x;
-    __asm__ ("muls.d %0, %1, %2       \n\t"
-             "lsr    %0, %3           \n\t"
-             "or     %0, %0, %m0<<%4  \n\t"
-             : "=r"(x) : "r"(b), "r"(a), "i"(shift), "i"(32-shift));
-    return x.hl[1];
-}
-
-#define MULH MULH
-static inline av_const int MULH(int a, int b)
-{
-    union { int64_t x; int hl[2]; } x;
-    __asm__ ("muls.d %0, %1, %2" : "=r"(x.x) : "r"(a), "r"(b));
-    return x.hl[0];
-}
-
-#define MUL64 MUL64
-static inline av_const int64_t MUL64(int a, int b)
-{
-    int64_t x;
-    __asm__ ("muls.d %0, %1, %2" : "=r"(x) : "r"(a), "r"(b));
-    return x;
-}
-
-static inline av_const int64_t MAC64(int64_t d, int a, int b)
-{
-    __asm__ ("macs.d %0, %1, %2" : "+r"(d) : "r"(a), "r"(b));
-    return d;
-}
-#define MAC64(d, a, b) ((d) = MAC64(d, a, b))
-#define MLS64(d, a, b) MAC64(d, -(a), b)
-
-static inline av_const int MAC16(int d, int a, int b)
-{
-    __asm__ ("machh.w %0, %1:b, %2:b" : "+r"(d) : "r"(a), "r"(b));
-    return d;
-}
-#define MAC16(d, a, b) ((d) = MAC16(d, a, b))
-#define MLS16(d, a, b) MAC16(d, -(a), b)
-
-#define MUL16 MUL16
-static inline av_const int MUL16(int a, int b)
-{
-    int d;
-    __asm__ ("mulhh.w %0, %1:b, %2:b" : "=r"(d) : "r"(a), "r"(b));
-    return d;
-}
-
-#define mid_pred mid_pred
-static inline av_const int mid_pred(int a, int b, int c)
-{
-    int m;
-    __asm__ ("mov   %0, %2  \n\t"
-             "cp.w  %1, %2  \n\t"
-             "movgt %0, %1  \n\t"
-             "movgt %1, %2  \n\t"
-             "cp.w  %1, %3  \n\t"
-             "movle %1, %3  \n\t"
-             "cp.w  %0, %1  \n\t"
-             "movgt %0, %1  \n\t"
-             : "=&r"(m), "+r"(a)
-             : "r"(b), "r"(c));
-    return m;
-}
-
-#endif /* HAVE_INLINE_ASM */
-
-#endif /* AVCODEC_AVR32_MATHOPS_H */
diff --git a/deps/libav/libavcodec/avs.c b/deps/libav/libavcodec/avs.c
deleted file mode 100644
index 53e3320..0000000
--- a/deps/libav/libavcodec/avs.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * AVS video decoder.
- * Copyright (c) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-
-
-typedef struct {
-    AVFrame *frame;
-} AvsContext;
-
-typedef enum {
-    AVS_VIDEO     = 0x01,
-    AVS_AUDIO     = 0x02,
-    AVS_PALETTE   = 0x03,
-    AVS_GAME_DATA = 0x04,
-} AvsBlockType;
-
-typedef enum {
-    AVS_I_FRAME     = 0x00,
-    AVS_P_FRAME_3X3 = 0x01,
-    AVS_P_FRAME_2X2 = 0x02,
-    AVS_P_FRAME_2X3 = 0x03,
-} AvsVideoSubType;
-
-
-static int
-avs_decode_frame(AVCodecContext * avctx,
-                 void *data, int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    const uint8_t *buf_end = avpkt->data + avpkt->size;
-    int buf_size = avpkt->size;
-    AvsContext *const avs = avctx->priv_data;
-    AVFrame *picture = data;
-    AVFrame *const p =  avs->frame;
-    const uint8_t *table, *vect;
-    uint8_t *out;
-    int i, j, x, y, stride, ret, vect_w = 3, vect_h = 3;
-    AvsVideoSubType sub_type;
-    AvsBlockType type;
-    GetBitContext change_map;
-
-    if ((ret = ff_reget_buffer(avctx, p)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-    p->pict_type = AV_PICTURE_TYPE_P;
-    p->key_frame = 0;
-
-    out    = p->data[0];
-    stride = p->linesize[0];
-
-    if (buf_end - buf < 4)
-        return AVERROR_INVALIDDATA;
-    sub_type = buf[0];
-    type = buf[1];
-    buf += 4;
-
-    if (type == AVS_PALETTE) {
-        int first, last;
-        uint32_t *pal = (uint32_t *) p->data[1];
-
-        first = AV_RL16(buf);
-        last = first + AV_RL16(buf + 2);
-        if (first >= 256 || last > 256 || buf_end - buf < 4 + 4 + 3 * (last - first))
-            return AVERROR_INVALIDDATA;
-        buf += 4;
-        for (i=first; i<last; i++, buf+=3)
-            pal[i] = (buf[0] << 18) | (buf[1] << 10) | (buf[2] << 2);
-
-        sub_type = buf[0];
-        type = buf[1];
-        buf += 4;
-    }
-
-    if (type != AVS_VIDEO)
-        return AVERROR_INVALIDDATA;
-
-    switch (sub_type) {
-    case AVS_I_FRAME:
-        p->pict_type = AV_PICTURE_TYPE_I;
-        p->key_frame = 1;
-    case AVS_P_FRAME_3X3:
-        vect_w = 3;
-        vect_h = 3;
-        break;
-
-    case AVS_P_FRAME_2X2:
-        vect_w = 2;
-        vect_h = 2;
-        break;
-
-    case AVS_P_FRAME_2X3:
-        vect_w = 2;
-        vect_h = 3;
-        break;
-
-    default:
-      return AVERROR_INVALIDDATA;
-    }
-
-    if (buf_end - buf < 256 * vect_w * vect_h)
-        return AVERROR_INVALIDDATA;
-    table = buf + (256 * vect_w * vect_h);
-    if (sub_type != AVS_I_FRAME) {
-        int map_size = ((318 / vect_w + 7) / 8) * (198 / vect_h);
-        if (buf_end - table < map_size)
-            return AVERROR_INVALIDDATA;
-        init_get_bits(&change_map, table, map_size * 8);
-        table += map_size;
-    }
-
-    for (y=0; y<198; y+=vect_h) {
-        for (x=0; x<318; x+=vect_w) {
-            if (sub_type == AVS_I_FRAME || get_bits1(&change_map)) {
-                if (buf_end - table < 1)
-                    return AVERROR_INVALIDDATA;
-                vect = &buf[*table++ * (vect_w * vect_h)];
-                for (j=0; j<vect_w; j++) {
-                    out[(y + 0) * stride + x + j] = vect[(0 * vect_w) + j];
-                    out[(y + 1) * stride + x + j] = vect[(1 * vect_w) + j];
-                    if (vect_h == 3)
-                        out[(y + 2) * stride + x + j] =
-                            vect[(2 * vect_w) + j];
-                }
-            }
-        }
-        if (sub_type != AVS_I_FRAME)
-            align_get_bits(&change_map);
-    }
-
-    if ((ret = av_frame_ref(picture, p)) < 0)
-        return ret;
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int avs_decode_init(AVCodecContext * avctx)
-{
-    AvsContext *s = avctx->priv_data;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-    ff_set_dimensions(avctx, 318, 198);
-
-    return 0;
-}
-
-static av_cold int avs_decode_end(AVCodecContext *avctx)
-{
-    AvsContext *s = avctx->priv_data;
-    av_frame_free(&s->frame);
-    return 0;
-}
-
-
-AVCodec ff_avs_decoder = {
-    .name           = "avs",
-    .long_name      = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_AVS,
-    .priv_data_size = sizeof(AvsContext),
-    .init           = avs_decode_init,
-    .decode         = avs_decode_frame,
-    .close          = avs_decode_end,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/bethsoftvideo.c b/deps/libav/libavcodec/bethsoftvideo.c
deleted file mode 100644
index 7e93a27..0000000
--- a/deps/libav/libavcodec/bethsoftvideo.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Bethesda VID video decoder
- * Copyright (C) 2007 Nicholas Tung
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Bethesda Softworks VID Video Decoder
- * @author Nicholas Tung [ntung (at. ntung com] (2007-03)
- * @see http://wiki.multimedia.cx/index.php?title=Bethsoft_VID
- * @see http://www.svatopluk.com/andux/docs/dfvid.html
- */
-
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "bethsoftvideo.h"
-#include "bytestream.h"
-#include "internal.h"
-
-typedef struct BethsoftvidContext {
-    AVFrame *frame;
-    GetByteContext g;
-} BethsoftvidContext;
-
-static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx)
-{
-    BethsoftvidContext *vid = avctx->priv_data;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    vid->frame = av_frame_alloc();
-    if (!vid->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int set_palette(BethsoftvidContext *ctx)
-{
-    uint32_t *palette = (uint32_t *)ctx->frame->data[1];
-    int a;
-
-    if (bytestream2_get_bytes_left(&ctx->g) < 256*3)
-        return AVERROR_INVALIDDATA;
-
-    for(a = 0; a < 256; a++){
-        palette[a] = bytestream2_get_be24u(&ctx->g) * 4;
-    }
-    ctx->frame->palette_has_changed = 1;
-    return 0;
-}
-
-static int bethsoftvid_decode_frame(AVCodecContext *avctx,
-                              void *data, int *got_frame,
-                              AVPacket *avpkt)
-{
-    BethsoftvidContext * vid = avctx->priv_data;
-    char block_type;
-    uint8_t * dst;
-    uint8_t * frame_end;
-    int remaining = avctx->width;          // number of bytes remaining on a line
-    int wrap_to_next_line;
-    int code, ret;
-    int yoffset;
-
-    if ((ret = ff_reget_buffer(avctx, vid->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-    wrap_to_next_line = vid->frame->linesize[0] - avctx->width;
-
-    if (avpkt->side_data_elems > 0 &&
-        avpkt->side_data[0].type == AV_PKT_DATA_PALETTE) {
-        bytestream2_init(&vid->g, avpkt->side_data[0].data,
-                         avpkt->side_data[0].size);
-        if ((ret = set_palette(vid)) < 0)
-            return ret;
-    }
-
-    bytestream2_init(&vid->g, avpkt->data, avpkt->size);
-    dst = vid->frame->data[0];
-    frame_end = vid->frame->data[0] + vid->frame->linesize[0] * avctx->height;
-
-    switch(block_type = bytestream2_get_byte(&vid->g)){
-        case PALETTE_BLOCK: {
-            *got_frame = 0;
-            if ((ret = set_palette(vid)) < 0) {
-                av_log(avctx, AV_LOG_ERROR, "error reading palette\n");
-                return ret;
-            }
-            return bytestream2_tell(&vid->g);
-        }
-        case VIDEO_YOFF_P_FRAME:
-            yoffset = bytestream2_get_le16(&vid->g);
-            if(yoffset >= avctx->height)
-                return AVERROR_INVALIDDATA;
-            dst += vid->frame->linesize[0] * yoffset;
-    }
-
-    // main code
-    while((code = bytestream2_get_byte(&vid->g))){
-        int length = code & 0x7f;
-
-        // copy any bytes starting at the current position, and ending at the frame width
-        while(length > remaining){
-            if(code < 0x80)
-                bytestream2_get_buffer(&vid->g, dst, remaining);
-            else if(block_type == VIDEO_I_FRAME)
-                memset(dst, bytestream2_peek_byte(&vid->g), remaining);
-            length -= remaining;      // decrement the number of bytes to be copied
-            dst += remaining + wrap_to_next_line;    // skip over extra bytes at end of frame
-            remaining = avctx->width;
-            if(dst == frame_end)
-                goto end;
-        }
-
-        // copy any remaining bytes after / if line overflows
-        if(code < 0x80)
-            bytestream2_get_buffer(&vid->g, dst, length);
-        else if(block_type == VIDEO_I_FRAME)
-            memset(dst, bytestream2_get_byte(&vid->g), length);
-        remaining -= length;
-        dst += length;
-    }
-    end:
-
-    if ((ret = av_frame_ref(data, vid->frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int bethsoftvid_decode_end(AVCodecContext *avctx)
-{
-    BethsoftvidContext * vid = avctx->priv_data;
-    av_frame_free(&vid->frame);
-    return 0;
-}
-
-AVCodec ff_bethsoftvid_decoder = {
-    .name           = "bethsoftvid",
-    .long_name      = NULL_IF_CONFIG_SMALL("Bethesda VID video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_BETHSOFTVID,
-    .priv_data_size = sizeof(BethsoftvidContext),
-    .init           = bethsoftvid_decode_init,
-    .close          = bethsoftvid_decode_end,
-    .decode         = bethsoftvid_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/bethsoftvideo.h b/deps/libav/libavcodec/bethsoftvideo.h
deleted file mode 100644
index 5cbbdfd..0000000
--- a/deps/libav/libavcodec/bethsoftvideo.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Bethesda VID video decoder
- * Copyright (C) 2007 Nicholas Tung
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_BETHSOFTVIDEO_H
-#define AVCODEC_BETHSOFTVIDEO_H
-
-enum BethsoftVidBlockType
-{
-    PALETTE_BLOCK       = 0x02,
-    FIRST_AUDIO_BLOCK   = 0x7c,
-    AUDIO_BLOCK         = 0x7d,
-    VIDEO_I_FRAME       = 0x03,
-    VIDEO_P_FRAME       = 0x01,
-    VIDEO_YOFF_P_FRAME  = 0x04,
-    EOF_BLOCK           = 0x14,
-};
-
-#endif /* AVCODEC_BETHSOFTVIDEO_H */
diff --git a/deps/libav/libavcodec/bfi.c b/deps/libav/libavcodec/bfi.c
deleted file mode 100644
index 75b6710..0000000
--- a/deps/libav/libavcodec/bfi.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Brute Force & Ignorance (BFI) video decoder
- * Copyright (c) 2008 Sisir Koppaka
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Brute Force & Ignorance (.bfi) video decoder
- * @author Sisir Koppaka ( sisir.koppaka at gmail dot com )
- * @see http://wiki.multimedia.cx/index.php?title=BFI
- */
-
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-typedef struct BFIContext {
-    AVCodecContext *avctx;
-    uint8_t *dst;
-} BFIContext;
-
-static av_cold int bfi_decode_init(AVCodecContext *avctx)
-{
-    BFIContext *bfi = avctx->priv_data;
-    avctx->pix_fmt  = AV_PIX_FMT_PAL8;
-    bfi->dst        = av_mallocz(avctx->width * avctx->height);
-    return 0;
-}
-
-static int bfi_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame, AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    GetByteContext g;
-    int buf_size    = avpkt->size;
-    BFIContext *bfi = avctx->priv_data;
-    uint8_t *dst    = bfi->dst;
-    uint8_t *src, *dst_offset, colour1, colour2;
-    uint8_t *frame_end = bfi->dst + avctx->width * avctx->height;
-    uint32_t *pal;
-    int i, j, ret, height = avctx->height;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    bytestream2_init(&g, avpkt->data, buf_size);
-
-    /* Set frame parameters and palette, if necessary */
-    if (!avctx->frame_number) {
-        frame->pict_type = AV_PICTURE_TYPE_I;
-        frame->key_frame = 1;
-        /* Setting the palette */
-        if (avctx->extradata_size > 768) {
-            av_log(NULL, AV_LOG_ERROR, "Palette is too large.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        pal = (uint32_t *)frame->data[1];
-        for (i = 0; i < avctx->extradata_size / 3; i++) {
-            int shift = 16;
-            *pal = 0;
-            for (j = 0; j < 3; j++, shift -= 8)
-                *pal += ((avctx->extradata[i * 3 + j] << 2) |
-                         (avctx->extradata[i * 3 + j] >> 4)) << shift;
-            pal++;
-        }
-        frame->palette_has_changed = 1;
-    } else {
-        frame->pict_type = AV_PICTURE_TYPE_P;
-        frame->key_frame = 0;
-    }
-
-    bytestream2_skip(&g, 4); // Unpacked size, not required.
-
-    while (dst != frame_end) {
-        static const uint8_t lentab[4] = { 0, 2, 0, 1 };
-        unsigned int byte   = bytestream2_get_byte(&g), av_uninit(offset);
-        unsigned int code   = byte >> 6;
-        unsigned int length = byte & ~0xC0;
-
-        if (!bytestream2_get_bytes_left(&g)) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Input resolution larger than actual frame.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        /* Get length and offset (if required) */
-        if (length == 0) {
-            if (code == 1) {
-                length = bytestream2_get_byte(&g);
-                offset = bytestream2_get_le16(&g);
-            } else {
-                length = bytestream2_get_le16(&g);
-                if (code == 2 && length == 0)
-                    break;
-            }
-        } else {
-            if (code == 1)
-                offset = bytestream2_get_byte(&g);
-        }
-
-        /* Do boundary check */
-        if (dst + (length << lentab[code]) > frame_end)
-            break;
-
-        switch (code) {
-        case 0:                // normal chain
-            if (length >= bytestream2_get_bytes_left(&g)) {
-                av_log(avctx, AV_LOG_ERROR, "Frame larger than buffer.\n");
-                return AVERROR_INVALIDDATA;
-            }
-            bytestream2_get_buffer(&g, dst, length);
-            dst += length;
-            break;
-        case 1:                // back chain
-            dst_offset = dst - offset;
-            length    *= 4;     // Convert dwords to bytes.
-            if (dst_offset < bfi->dst)
-                break;
-            while (length--)
-                *dst++ = *dst_offset++;
-            break;
-        case 2:                // skip chain
-            dst += length;
-            break;
-        case 3:                // fill chain
-            colour1 = bytestream2_get_byte(&g);
-            colour2 = bytestream2_get_byte(&g);
-            while (length--) {
-                *dst++ = colour1;
-                *dst++ = colour2;
-            }
-            break;
-        }
-    }
-
-    src = bfi->dst;
-    dst = frame->data[0];
-    while (height--) {
-        memcpy(dst, src, avctx->width);
-        src += avctx->width;
-        dst += frame->linesize[0];
-    }
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int bfi_decode_close(AVCodecContext *avctx)
-{
-    BFIContext *bfi = avctx->priv_data;
-    av_free(bfi->dst);
-    return 0;
-}
-
-AVCodec ff_bfi_decoder = {
-    .name           = "bfi",
-    .long_name      = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_BFI,
-    .priv_data_size = sizeof(BFIContext),
-    .init           = bfi_decode_init,
-    .close          = bfi_decode_close,
-    .decode         = bfi_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/bfin/Makefile b/deps/libav/libavcodec/bfin/Makefile
deleted file mode 100644
index fc5f506..0000000
--- a/deps/libav/libavcodec/bfin/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-OBJS += bfin/dsputil_bfin.o                                             \
-        bfin/fdct_bfin.o                                                \
-        bfin/idct_bfin.o                                                \
-        bfin/pixels_bfin.o                                              \
-
-OBJS-$(CONFIG_HPELDSP)                  += bfin/hpeldsp_bfin.o          \
-                                           bfin/hpel_pixels_bfin.o
-OBJS-$(CONFIG_VP3DSP)                   += bfin/vp3_bfin.o              \
-                                           bfin/vp3_idct_bfin.o
diff --git a/deps/libav/libavcodec/bfin/config_bfin.h b/deps/libav/libavcodec/bfin/config_bfin.h
deleted file mode 100644
index e714070..0000000
--- a/deps/libav/libavcodec/bfin/config_bfin.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-/*
-   low level assembler interface wrapper
-
-DEFUN(put_pixels_clamped,mL1,
-        (int16_t *block, uint8_t *dest, int line_size)):
-
-      body
-
-      rts;
-*/
-
-#ifndef AVCODEC_BFIN_CONFIG_BFIN_H
-#define AVCODEC_BFIN_CONFIG_BFIN_H
-
-#include "config.h"
-
-#ifndef DEFUN
-
-#define mL3 .text
-#ifndef mL1
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define mL1 .l1.text
-#else
-#define mL1 mL3
-#endif
-#endif
-
-#define DEFUN(fname,where,interface) \
-        .section where;              \
-        .global _ff_bfin_ ## fname ; \
-        .type _ff_bfin_ ## fname, STT_FUNC; \
-        .align 8;                    \
-        _ff_bfin_ ## fname
-
-#define DEFUN_END(fname) \
-        .size _ff_bfin_ ## fname, . - _ff_bfin_ ## fname
-
-#ifdef __FDPIC__
-#define RELOC(reg,got,obj) reg = [got + obj at GOT17M4]
-#else
-#define RELOC(reg,got,obj) reg.L = obj; reg.H = obj
-#endif
-
-#endif
-
-#endif /* AVCODEC_BFIN_CONFIG_BFIN_H */
diff --git a/deps/libav/libavcodec/bfin/dsputil_bfin.c b/deps/libav/libavcodec/bfin/dsputil_bfin.c
deleted file mode 100644
index 3ce2941..0000000
--- a/deps/libav/libavcodec/bfin/dsputil_bfin.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * BlackFin DSPUTILS
- *
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- * Copyright (c) 2006 Michael Benjamin <michael.benjamin at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_bfin.h"
-
-int off;
-
-static void bfin_idct_add (uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_bfin_idct (block);
-    ff_bfin_add_pixels_clamped (block, dest, line_size);
-}
-
-static void bfin_idct_put (uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_bfin_idct (block);
-    ff_bfin_put_pixels_clamped (block, dest, line_size);
-}
-
-
-static void bfin_clear_blocks (int16_t *blocks)
-{
-    // This is just a simple memset.
-    //
-    __asm__("P0=192; "
-        "I0=%0;  "
-        "R0=0;   "
-        "LSETUP(clear_blocks_blkfn_lab,clear_blocks_blkfn_lab)LC0=P0;"
-        "clear_blocks_blkfn_lab:"
-        "[I0++]=R0;"
-        ::"a" (blocks):"P0","I0","R0");
-}
-
-static int bfin_pix_abs16 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
-    return ff_bfin_z_sad16x16 (blk1,blk2,line_size,line_size,h);
-}
-
-static int bfin_vsad_intra16 (void *c, uint8_t *blk1, uint8_t *dummy, int stride, int h) {
-    return ff_bfin_z_sad16x16 (blk1,blk1+stride,stride<<1,stride<<1,h);
-}
-
-static int bfin_vsad (void *c, uint8_t *blk1, uint8_t *blk2, int stride, int h) {
-    return ff_bfin_z_sad16x16 (blk1,blk1+stride,stride<<1,stride<<1,h)
-        + ff_bfin_z_sad16x16 (blk2,blk2+stride,stride<<1,stride<<1,h);
-}
-
-static uint8_t vtmp_blk[256] attribute_l1_data_b;
-
-static int bfin_pix_abs16_x2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
-    ff_bfin_put_pixels16uc (vtmp_blk, blk2, blk2+1, 16, line_size, h);
-    return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
-}
-
-static int bfin_pix_abs16_y2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
-    ff_bfin_put_pixels16uc (vtmp_blk, blk2, blk2+line_size, 16, line_size, h);
-    return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
-}
-
-static int bfin_pix_abs16_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
-    ff_bfin_z_put_pixels16_xy2 (vtmp_blk, blk2, 16, line_size, h);
-    return ff_bfin_z_sad16x16 (blk1, vtmp_blk, line_size, 16, h);
-}
-
-static int bfin_pix_abs8 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
-    return ff_bfin_z_sad8x8 (blk1,blk2,line_size,line_size, h);
-}
-
-static int bfin_pix_abs8_x2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
-    ff_bfin_put_pixels8uc (vtmp_blk, blk2, blk2+1, 8, line_size, h);
-    return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
-}
-
-static int bfin_pix_abs8_y2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
-    ff_bfin_put_pixels8uc (vtmp_blk, blk2, blk2+line_size, 8, line_size, h);
-    return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
-}
-
-static int bfin_pix_abs8_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
-{
-    ff_bfin_z_put_pixels8_xy2 (vtmp_blk, blk2, 8, line_size, h);
-    return ff_bfin_z_sad8x8 (blk1, vtmp_blk, line_size, 8, h);
-}
-
-
-/*
-  decoder optimization
-  start on 2/11 100 frames of 352x240 at 25 compiled with no optimization -g debugging
-  9.824s ~ 2.44x off
-  6.360s ~ 1.58x off with -O2
-  5.740s ~ 1.43x off with idcts
-
-  2.64s    2/20 same sman.mp4 decode only
-
-*/
-
-av_cold void ff_dsputil_init_bfin(DSPContext *c, AVCodecContext *avctx)
-{
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    c->diff_pixels        = ff_bfin_diff_pixels;
-    c->put_pixels_clamped = ff_bfin_put_pixels_clamped;
-    c->add_pixels_clamped = ff_bfin_add_pixels_clamped;
-
-    if (!high_bit_depth)
-        c->get_pixels     = ff_bfin_get_pixels;
-    c->clear_blocks       = bfin_clear_blocks;
-    c->pix_sum            = ff_bfin_pix_sum;
-    c->pix_norm1          = ff_bfin_pix_norm1;
-
-    c->sad[0]             = bfin_pix_abs16;
-    c->sad[1]             = bfin_pix_abs8;
-
-/*     c->vsad[0]            = bfin_vsad; */
-/*     c->vsad[4]            = bfin_vsad_intra16; */
-
-    /* TODO [0] 16  [1] 8 */
-    c->pix_abs[0][0] = bfin_pix_abs16;
-    c->pix_abs[0][1] = bfin_pix_abs16_x2;
-    c->pix_abs[0][2] = bfin_pix_abs16_y2;
-    c->pix_abs[0][3] = bfin_pix_abs16_xy2;
-
-    c->pix_abs[1][0] = bfin_pix_abs8;
-    c->pix_abs[1][1] = bfin_pix_abs8_x2;
-    c->pix_abs[1][2] = bfin_pix_abs8_y2;
-    c->pix_abs[1][3] = bfin_pix_abs8_xy2;
-
-
-    c->sse[0] = ff_bfin_sse16;
-    c->sse[1] = ff_bfin_sse8;
-    c->sse[2] = ff_bfin_sse4;
-
-    if (avctx->bits_per_raw_sample <= 8) {
-        if (avctx->dct_algo == FF_DCT_AUTO)
-            c->fdct                  = ff_bfin_fdct;
-
-        if (avctx->idct_algo == FF_IDCT_AUTO) {
-            c->idct_permutation_type = FF_NO_IDCT_PERM;
-            c->idct                  = ff_bfin_idct;
-            c->idct_add              = bfin_idct_add;
-            c->idct_put              = bfin_idct_put;
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/bfin/dsputil_bfin.h b/deps/libav/libavcodec/bfin/dsputil_bfin.h
deleted file mode 100644
index a082cd7..0000000
--- a/deps/libav/libavcodec/bfin/dsputil_bfin.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * BlackFin DSPUTILS COMMON OPTIMIZATIONS HEADER
- *
- * Copyright (C) 2007 Marc Hoffman <mmh at pleasantst.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-#ifndef AVCODEC_BFIN_DSPUTIL_BFIN_H
-#define AVCODEC_BFIN_DSPUTIL_BFIN_H
-
-#include <stdint.h>
-
-#include "config.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define attribute_l1_text  __attribute__ ((l1_text))
-#define attribute_l1_data_b __attribute__((l1_data_B))
-#else
-#define attribute_l1_text
-#define attribute_l1_data_b
-#endif
-
-void ff_bfin_idct (int16_t *block) attribute_l1_text;
-void ff_bfin_fdct (int16_t *block) attribute_l1_text;
-void ff_bfin_add_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
-void ff_bfin_put_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
-void ff_bfin_diff_pixels (int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride)  attribute_l1_text;
-void ff_bfin_get_pixels  (int16_t *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text;
-int  ff_bfin_pix_norm1  (uint8_t * pix, int line_size) attribute_l1_text;
-int  ff_bfin_z_sad8x8   (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
-int  ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
-
-int  ff_bfin_pix_sum (uint8_t *p, int stride) attribute_l1_text;
-
-int ff_bfin_sse4  (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
-int ff_bfin_sse8  (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
-int ff_bfin_sse16 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text;
-
-
-#ifdef BFIN_PROFILE
-
-static double Telem[16];
-static char  *TelemNames[16];
-static int    TelemCnt;
-
-#define PROF(lab,e) { int xx_e = e; char*xx_lab = lab; uint64_t xx_t0 = read_time();
-#define EPROF()       xx_t0 = read_time()-xx_t0; Telem[xx_e] = Telem[xx_e] + xx_t0; TelemNames[xx_e] = xx_lab; }
-
-static void prof_report (void)
-{
-    int i;
-    double s = 0;
-    for (i=0;i<16;i++) {
-        double v;
-        if (TelemNames[i]) {
-            v = Telem[i]/TelemCnt;
-            av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n", TelemNames[i],v,v/64);
-            s = s + Telem[i];
-        }
-    }
-    av_log (NULL,AV_LOG_DEBUG,"%-20s: %12.4f\t%12.4f\n%20.4f\t%d\n",
-            "total",s/TelemCnt,s/TelemCnt/64,s,TelemCnt);
-}
-
-static void bfprof (void)
-{
-    static int init;
-    if (!init) atexit (prof_report);
-    init=1;
-    TelemCnt++;
-}
-
-#else
-#define PROF(a,b)
-#define EPROF()
-#define bfprof()
-#endif
-
-#endif /* AVCODEC_BFIN_DSPUTIL_BFIN_H */
diff --git a/deps/libav/libavcodec/bfin/fdct_bfin.S b/deps/libav/libavcodec/bfin/fdct_bfin.S
deleted file mode 100644
index c923d76..0000000
--- a/deps/libav/libavcodec/bfin/fdct_bfin.S
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * fdct BlackFin
- *
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-/*
-  void ff_bfin_fdct (int16_t *buf);
-
-  This implementation works only for 8x8 input. The range of input
-  must be -256 to 255 i.e. 8bit input represented in a 16bit data
-  word. The original data must be sign extended into the 16bit data
-  words.
-
-
-   Chen factorization of
-
-           8
-   X(m) = sum (x(n) * cos ((2n+1)*m*pi/16))
-          n=0
-
-                                             C4
- 0  --*-------------*0+7---*-----*0+3-------*-*-------------------> 0
-       \           /        \   /            X S4,S4
- 1  --*-\---------/-*1+6---*-\-/-*1+2-------*-*-------------------> 4
-         \       /            \              -C4     C3
- 2  --*---\-----/---*2+5---*-/-\-*1-2---------------*-*-----------> 2
-           \   /            /   \                    X S3,-S3
- 3  --*-----\-/-----*3+4---*-----*0-3---------------*-*-----------> 6
-             /                                  C7   C3
- 4  --*-----/-\-----*3-4------------*-*4+5--*-----*---------------> 1
-           /   \            -C4      X       \   /S7    C3
- 5  --*---/-----\---*2-5---*-*------*=*4-5----\-/------*-*--------> 5
-         /       \          X S4,S4            /        X S3,-S3
- 6  --*-/---------\-*1-6---*-*------*=*7-6----/-\------*-*--------> 3
-       /           \        C4       X       /   \-S7   C3
-    --*-------------*0-7------------*-*7+6--*-----*---------------> 7
-                                                C7
-
-Notation
-        Cn = cos(n*pi/8) used throughout the code.
-
-
-  Registers used:
-        R0, R1, R2, R3, R4, R5, R6,R7,  P0, P1, P2, P3, P4, P5, A0, A1.
-  Other registers used:
-        I0, I1, I2, I3, B0, B2, B3, M0, M1, L3 registers and LC0.
-
-  Input - r0 - pointer to start of int16_t *block
-
-  Output - The DCT output coefficients in the int16_t *block
-
-  Register constraint:
-               This code is called from jpeg_encode.
-               R6, R5, R4 if modified should be stored and restored.
-
-
-  Performance: (Timer version 0.6.33)
-               Code Size : 240 Bytes.
-               Memory Required :
-               Input Matrix : 8 * 8 * 2 Bytes.
-               Coefficients : 16 Bytes
-               Temporary matrix: 8 * 8 * 2 Bytes.
-               Cycle Count :26+{18+8*(14+2S)}*2  where S -> Stalls
-                            (7.45 c/pel)
-        -----------------------------------------
-        |  Size  |  Forward DCT  |  Inverse DCT |
-        -----------------------------------------
-        |  8x8   |   284 Cycles  |  311 Cycles  |
-        -----------------------------------------
-
-Ck = int16(cos(k/16*pi)*32767+.5)/2
-#define C4 23170
-#define C3 13623
-#define C6 6270
-#define C7 3196
-
-Sk = int16(sin(k/16*pi)*32767+.5)/2
-#define S4 11585
-#define S3 9102
-#define S6 15137
-#define S7 16069
-
-the coefficients are ordered as follows:
-short dct_coef[]
-  C4,S4,
-  C6,S6,
-  C7,S7,
-  S3,C3,
-
------------------------------------------------------------
-Libav conformance testing results
------------------------------------------------------------
-dct-test: modified with the following
-            dct_error("BFINfdct", 0, ff_bfin_fdct, fdct, test);
-produces the following output:
-
-libavcodec> ./dct-test
-Libav DCT/IDCT test
-
-    2  -131    -6   -48   -36    33   -83    24
-   34    52   -24   -15     5    92    57   143
-  -67   -43    -1    74   -16     5   -71    32
-  -78   106    92   -34   -38    81    20   -18
-    7   -62    40     2   -15    90   -62   -83
-  -83     1  -104   -13    43   -19     7    11
-  -63    31    12   -29    83    72    21    10
-  -17   -63   -15    73    50   -91   159   -14
-DCT BFINfdct: err_inf=2 err2=0.16425938 syserr=0.00795000 maxout=2098 blockSumErr=27
-DCT BFINfdct: 92.1 kdct/s
-*/
-
-#include "config.h"
-#include "config_bfin.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.B,"aw", at progbits
-#else
-.data
-#endif
-.align 4;
-dct_coeff:
-.short 0x5a82, 0x2d41, 0x187e, 0x3b21, 0x0c7c, 0x3ec5, 0x238e, 0x3537;
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.A,"aw", at progbits
-#endif
-.align 4
-vtmp:   .space 128
-
-.text
-DEFUN(fdct,mL1,
-        (int16_t *block)):
-    [--SP] = (R7:4, P5:3);          // Push the registers onto the stack.
-
-    b0 = r0;
-    RELOC(r0, P3, dct_coeff);
-    b3 = r0;
-    RELOC(r0, P3, vtmp);
-    b2 = r0;
-
-    L3 = 16;                        // L3 is set to 16 to make the coefficient
-                                    // array Circular.
-
-
-//----------------------------------------------------------------------------
-
-/*
- * I0, I1, and I2 registers are used to read the input data. I3 register is used
- * to read the coefficients. P0 and P1 registers are used for writing the output
- * data.
- */
-    M0 = 12 (X);                    // All these initializations are used in the
-    M1 = 16 (X);                    // modification of address offsets.
-
-    M2 = 128 (X);
-
-    P2 = 16;
-    P3 = 32 (X);
-    P4 = -110 (X);
-    P5 = -62 (X);
-    P0 = 2(X);
-
-
-    // Prescale the input to get the correct precision.
-    i0=b0;
-    i1=b0;
-
-    lsetup (.0, .1) LC0 = P3;
-    r0=[i0++];
-.0:     r1=r0<<3 (v) || r0=[i0++] ;
-.1:     [i1++]=r1;
-
-        /*
-         * B0 points to the "in" buffer.
-         * B2 points to "temp" buffer in the first iteration.
-         */
-
-    lsetup (.2, .3) LC0 = P0;
-.2:
-        I0 = B0;                        // I0 points to Input Element (0, 0).
-        I1 = B0;                        // Element 1 and 0 is read in R0.
-        I1 += M0  || R0 = [I0++];       // I1 points to Input Element (0, 6).
-        I2 = I1;                        // Element 6 is read into R3.H.
-        I2 -= 4   || R3.H = W[I1++];    // I2 points to Input Element (0, 4).
-
-        I3 = B3;                        // I3 points to Coefficients.
-        P0 = B2;                        // P0 points to temporary array Element
-                                        //   (0, 0).
-        P1 = B2;                        // P1 points to temporary array.
-        R7 = [P1++P2] || R2 = [I2++];   // P1 points to temporary array
-                                        //   Element (1, 0).
-                                        // R7 is a dummy read. X4,X5
-                                        //   are read into R2.
-        R3.L = W[I1--];                 // X7 is read into R3.L.
-        R1.H = W[I0++];                 // X2 is read into R1.H.
-
-
-        /*
-         *  X0 = (X0 + X7) / 2.
-         *  X1 = (X1 + X6) / 2.
-         *  X6 = (X1 - X6) / 2.
-         *  X7 = (X0 - X7) / 2.
-         *  It reads the data 3 in R1.L.
-         */
-
-        R0 = R0 +|+ R3, R3 = R0 -|- R3 || R1.L = W[I0++] || NOP;
-
-        /*
-         *       X2 = (X2 + X5) / 2.
-         *       X3 = (X3 + X4) / 2.
-         *       X4 = (X3 - X4) / 2.
-         *       X5 = (X2 - X5) / 2.
-         *          R7 = C4 = cos(4*pi/16)
-         */
-
-        R1 = R1 +|+ R2, R2 = R1 -|- R2 (CO) || NOP      ||  R7 = [I3++];
-
-        /*
-         * At the end of stage 1 R0 has (1,0), R1 has (2,3), R2 has (4, 5) and
-         * R3 has (6,7).
-         * Where the notation (x, y) represents uper/lower half pairs.
-         */
-
-        /*
-         *       X0 = X0 + X3.
-         *       X1 = X1 + X2.
-         *       X2 = X1 - X2.
-         *       X3 = X0 - X3.
-         */
-        R0 = R0 +|+ R1, R1 = R0 -|- R1;
-
-        lsetup (.row0, .row1) LC1 = P2 >> 1;  // 1d dct, loops 8x
-.row0:
-
-        /*
-         *       This is part 2 computation continued.....
-         *       A1 =      X6 * cos(pi/4)
-         *       A0 =      X6 * cos(pi/4)
-         *       A1 = A1 - X5 * cos(pi/4)
-         *       A0 = A0 + X5 * cos(pi/4).
-         *       The instruction W[I0] = R3.L is used for packing it to R2.L.
-         */
-
-        A1=R3.H*R7.l,         A0=R3.H*R7.l            ||  I1+=M1 || W[I0] = R3.L;
-        R4.H=(A1-=R2.L*R7.l), R4.L=(A0+=R2.L*R7.l)    ||  I2+=M0 || NOP;
-
-        /*       R0 = (X1,X0)      R1 = (X2,X3)       R4 = (X5, X6). */
-
-        /*
-         *       A1 =      X0 * cos(pi/4)
-         *       A0 =      X0 * cos(pi/4)
-         *       A1 = A1 - X1 * cos(pi/4)
-         *       A0 = A0 + X1 * cos(pi/4)
-         *       R7 = (C2,C6)
-         */
-        A1=R0.L*R7.h,        A0=R0.L*R7.h             || NOP       || R3.H=W[I1++];
-        R5.H=(A1-=R0.H*R7.h),R5.L=(A0+=R0.H*R7.h)     || R7=[I3++] || NOP;
-
-        /*
-         *       A1 =      X2 * cos(3pi/8)
-         *       A0 =      X3 * cos(3pi/8)
-         *       A1 = A1 + X3 * cos(pi/8)
-         *       A0 = A0 - X2 * cos(pi/8)
-         *         R3 = cos(pi/4)
-         *         R7 = (cos(7pi/8),cos(pi/8))
-         *       X4 = X4 + X5.
-         *       X5 = X4 - X5.
-         *       X6 = X7 - X6.
-         *       X7 = X7 + X6.
-         */
-        A1=R1.H*R7.L,        A0=R1.L*R7.L             || W[P0++P3]=R5.L || R2.L=W[I0];
-        R2=R2+|+R4,          R4=R2-|-R4               || I0+=4          || R3.L=W[I1--];
-        R6.H=(A1+=R1.L*R7.H),R6.L=(A0 -= R1.H * R7.H) || I0+=4          || R7=[I3++];
-
-        /*         R2 = (X4, X7)        R4 = (X5,X6)      R5 = (X1, X0)       R6 = (X2,X3). */
-
-        /*
-         *       A1 =      X4 * cos(7pi/16)
-         *       A0 =      X7 * cos(7pi/16)
-         *       A1 = A1 + X7 * cos(pi/16)
-         *       A0 = A0 - X4 * cos(pi/16)
-         */
-
-        A1=R2.H*R7.L,        A0=R2.L*R7.L             || W[P0++P3]=R6.H || R0=[I0++];
-        R2.H=(A1+=R2.L*R7.H),R2.L=(A0-=R2.H*R7.H)     || W[P0++P3]=R5.H || R7=[I3++];
-
-        /*
-         *       A1 =      X5 * cos(3pi/16)
-         *       A0 =      X6 * cos(3pi/16)
-         *       A1 = A1 + X6 * cos(5pi/16)
-         *       A0 = A0 - X5 * cos(5pi/16)
-         *       The output values are written.
-         */
-
-        A1=R4.H*R7.H,        A0=R4.L*R7.H             || W[P0++P2]=R6.L || R1.H=W[I0++];
-        R4.H=(A1+=R4.L*R7.L),R4.L=(A0-=R4.H*R7.L)     || W[P0++P4]=R2.L || R1.L=W[I0++];
-
-
-        /* Beginning of next stage, **pipelined** + drain and store the
-           rest of the column store. */
-
-        R0=R0+|+R3,R3=R0-|-R3                         || W[P1++P3]=R2.H || R2=[I2++];
-        R1=R1+|+R2,R2=R1-|-R2 (CO)                    || W[P1++P3]=R4.L || R7=[I3++];
-.row1:  R0=R0+|+R1,R1=R0-|-R1                         || W[P1++P5]=R4.H || NOP;
-
-        // Exchange input with output.
-        B1 = B0;
-        B0 = B2;
-.3:     B2 = B1;
-
-        L3=0;
-        (r7:4,p5:3) = [sp++];
-        RTS;
-DEFUN_END(fdct)
diff --git a/deps/libav/libavcodec/bfin/hpel_pixels_bfin.S b/deps/libav/libavcodec/bfin/hpel_pixels_bfin.S
deleted file mode 100644
index 9b927b0..0000000
--- a/deps/libav/libavcodec/bfin/hpel_pixels_bfin.S
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Blackfin Pixel Operations
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config_bfin.h"
-
-/*
-  motion compensation
-  primitives
-
-     * Halfpel motion compensation with rounding (a+b+1)>>1.
-     * This is an array[4][4] of motion compensation funcions for 4
-     * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
-     * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
-     * @param block destination where the result is stored
-     * @param pixels source
-     * @param line_size number of bytes in a horizontal line of block
-     * @param h height
-
-*/
-
-DEFUN(put_pixels8uc,mL1,
-        (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
-                 int dest_size, int line_size, int h)):
-        i3=r0;        // dest
-        i0=r1;        // src0
-        i1=r2;        // src1
-        r0=[sp+12];   // dest_size
-        r2=[sp+16];   // line_size
-        p0=[sp+20];   // h
-        [--sp] = (r7:6);
-        r0+=-4;
-        m3=r0;
-        r2+=-8;
-        m0=r2;
-        LSETUP(pp8$0,pp8$1) LC0=P0;
-        DISALGNEXCPT                || R0 = [I0++]  || R2  =[I1++];
-
-pp8$0:  DISALGNEXCPT                || R1 = [I0++]  || R3  =[I1++];
-        R6 = BYTEOP1P(R1:0,R3:2)    || R0 = [I0++M0]|| R2  =[I1++M0];
-        R7 = BYTEOP1P(R1:0,R3:2)(R) || R0 = [I0++]  || [I3++] = R6 ;
-pp8$1:  DISALGNEXCPT                || R2 = [I1++]  || [I3++M3] = R7;
-
-        (r7:6) = [sp++];
-        RTS;
-DEFUN_END(put_pixels8uc)
-
-DEFUN(put_pixels16uc,mL1,
-        (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
-                 int dest_size, int line_size, int h)):
-        link 0;
-        [--sp] = (r7:6);
-        i3=r0;        // dest
-        i0=r1;        // src0
-        i1=r2;        // src1
-        r0=[fp+20];   // dest_size
-        r2=[fp+24];   // line_size
-        p0=[fp+28];   // h
-
-
-        r0+=-12;
-        m3=r0;        // line_size
-        r2+=-16;
-        m0=r2;
-
-        LSETUP(pp16$0,pp16$1) LC0=P0;
-         DISALGNEXCPT                || R0 = [I0++]   || R2  =[I1++];
-
-pp16$0:  DISALGNEXCPT                || R1 = [I0++]   || R3  =[I1++];
-         R6 = BYTEOP1P(R1:0,R3:2)    || R0 = [I0++]   || R2  =[I1++];
-         R7 = BYTEOP1P(R1:0,R3:2)(R) || R1 = [I0++]   || R3  =[I1++];
-         [I3++] = R6;
-         R6 = BYTEOP1P(R1:0,R3:2)    || R0 = [I0++M0] || R2  =[I1++M0];
-         R7 = BYTEOP1P(R1:0,R3:2)(R) || R0 = [I0++]   || [I3++] = R7 ;
-         [I3++] = R6;
-pp16$1:  DISALGNEXCPT                || R2 = [I1++]   || [I3++M3] = R7;
-
-        (r7:6) = [sp++];
-        unlink;
-        RTS;
-DEFUN_END(put_pixels16uc)
-
-
-
-
-
-
-DEFUN(put_pixels8uc_nornd,mL1,
-        (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
-                 int line_size, int h)):
-        i3=r0;        // dest
-        i0=r1;        // src0
-        i1=r2;        // src1
-        r2=[sp+12];   // line_size
-        p0=[sp+16];   // h
-        [--sp] = (r7:6);
-        r2+=-4;
-        m3=r2;
-        r2+=-4;
-        m0=r2;
-        LSETUP(pp8$2,pp8$3) LC0=P0;
-        DISALGNEXCPT                || R0 = [I0++]  || R2  =[I1++];
-
-pp8$2:  DISALGNEXCPT                || R1 = [I0++]  || R3  =[I1++];
-        R6 = BYTEOP1P(R1:0,R3:2)(T)  || R0 = [I0++M0]|| R2  =[I1++M0];
-        R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++]  || [I3++] = R6 ;
-pp8$3:  DISALGNEXCPT                || R2 = [I1++]  || [I3++M3] = R7;
-
-        (r7:6) = [sp++];
-        RTS;
-DEFUN_END(put_pixels8uc_nornd)
-
-DEFUN(put_pixels16uc_nornd,mL1,
-        (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
-                 int line_size, int h)):
-        i3=r0;        // dest
-        i0=r1;        // src0
-        i1=r2;        // src1
-        r2=[sp+12];   // line_size
-        p0=[sp+16];   // h
-
-        [--sp] = (r7:6);
-        r2+=-12;
-        m3=r2;        // line_size
-        r2+=-4;
-        m0=r2;
-
-        LSETUP(pp16$2,pp16$3) LC0=P0;
-        DISALGNEXCPT                || R0 = [I0++]   || R2  =[I1++];
-
-pp16$2:
-        DISALGNEXCPT                || R1 = [I0++]   || R3  =[I1++];
-        R6 = BYTEOP1P(R1:0,R3:2)(T)    || R0 = [I0++]   || R2  =[I1++];
-        R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R1 = [I0++]   || R3  =[I1++];
-        [I3++] = R6;
-
-        R6 = BYTEOP1P(R1:0,R3:2)(T)    || R0 = [I0++M0] || R2  =[I1++M0];
-        R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++]   || [I3++] = R7 ;
-        [I3++] = R6;
-pp16$3: DISALGNEXCPT                || R2 = [I1++]   || [I3++M3] = R7;
-
-        (r7:6) = [sp++];
-
-        RTS;
-DEFUN_END(put_pixels16uc_nornd)
-
-DEFUN(z_put_pixels16_xy2,mL1,
-        (uint8_t *block, const uint8_t *s0,
-                 int dest_size, int line_size, int h)):
-        link 0;
-        [--sp] = (r7:4);
-        i3=r0;        // dest
-        i0=r1;        // src0--> pixels
-        i1=r1;        // src1--> pixels + line_size
-        r2+=-12;
-        m2=r2;        // m2=dest_width-4
-        r2=[fp+20];
-        m3=r2;        // line_size
-        p0=[fp+24];   // h
-        r2+=-16;
-        i1+=m3;       /* src1 + line_size */
-        m0=r2;        /* line-size - 20 */
-
-        B0 = I0;
-        B1 = I1;
-        B3 = I3;
-
-        DISALGNEXCPT                       || R0 = [I0++] || R2  =[I1++];
-
-        LSETUP(LS$16E,LE$16E) LC0=P0;
-LS$16E: DISALGNEXCPT                       || R1 = [I0++] || R3  =[I1++];
-        R4 = BYTEOP2P (R3:2,R1:0) (RNDL)   || R0 = [I0++] || R2  =[I1++];
-        R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R1 = [I0++] || [I3++] = R4 ;
-        DISALGNEXCPT                       || R3 = [I1++] || [I3++] = R5;
-        R4 = BYTEOP2P (R3:2,R1:0) (RNDL)   || R0 = [I0++M0]|| R2  = [I1++M0];
-        R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R0 = [I0++] || [I3++] = R4 ;
-LE$16E: DISALGNEXCPT                       || R2 = [I1++] || [I3++M2] = R5;
-
-        M1 = 1;
-        I3 = B3;
-        I1 = B1;
-        I0 = B0;
-
-        I0 += M1;
-        I1 += M1;
-
-        DISALGNEXCPT                       || R0 = [I0++] || R2  =[I1++];
-        LSETUP(LS$16O,LE$16O) LC0=P0;
-LS$16O: DISALGNEXCPT                       || R1 = [I0++] || R3  =[I1++];
-        R4 = BYTEOP2P (R3:2,R1:0) (RNDH)   || R0 = [I0++] || R2  =[I1++];
-        R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R1 = [I0++] || R6  =[I3++];
-        R4 = R4 +|+ R6                       || R7 = [I3--];
-        R5 = R5 +|+ R7                       || [I3++] = R4;
-        DISALGNEXCPT                       || R3  =[I1++] || [I3++] = R5;
-        R4 = BYTEOP2P (R3:2,R1:0) (RNDH)   || R0 = [I0++M0]|| R2  = [I1++M0];
-        R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R0 = [I0++] || R6 = [I3++];
-        R4 = R4 +|+ R6                       || R7 = [I3--];
-        R5 = R5 +|+ R7                       || [I3++] = R4;
-LE$16O: DISALGNEXCPT                       || R2 = [I1++] || [I3++M2] = R5;
-
-        (r7:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(z_put_pixels16_xy2)
-
-DEFUN(put_pixels16_xy2_nornd,mL1,
-        (uint8_t *block, const uint8_t *s0,
-                 int line_size, int h)):
-        link 0;
-        [--sp] = (r7:4);
-        i3=r0;        // dest
-        i0=r1;        // src0--> pixels
-        i1=r1;        // src1--> pixels + line_size
-        m3=r2;
-        r2+=-12;
-        m2=r2;
-        r2+=-4;
-        i1+=m3;       /* src1 + line_size */
-        m0=r2;        /* line-size - 20 */
-        p0=[fp+20];   // h
-
-        B0=I0;
-        B1=I1;
-        B3=I3;
-
-        DISALGNEXCPT                       || R0 = [I0++] || R2  =[I1++];
-
-        LSETUP(LS$16ET,LE$16ET) LC0=P0;
-LS$16ET:DISALGNEXCPT                       || R1 = [I0++] || R3  =[I1++];
-        R4 = BYTEOP2P (R3:2,R1:0) (TL)     || R0 = [I0++] || R2  =[I1++];
-        R5 = BYTEOP2P (R3:2,R1:0) (TL,R)   || R1 = [I0++] || [I3++] = R4 ;
-        DISALGNEXCPT                       || R3 = [I1++] || [I3++] = R5;
-        R4 = BYTEOP2P (R3:2,R1:0) (TL)     || R0 = [I0++M0]|| R2  = [I1++M0];
-        R5 = BYTEOP2P (R3:2,R1:0) (TL,R)   || R0 = [I0++] || [I3++] = R4 ;
-LE$16ET:DISALGNEXCPT                       || R2 = [I1++] || [I3++M2] = R5;
-
-        M1 = 1;
-        I3=B3;
-        I1=B1;
-        I0=B0;
-
-        I0 += M1;
-        I1 += M1;
-
-        DISALGNEXCPT                       || R0 = [I0++] || R2  =[I1++];
-        LSETUP(LS$16OT,LE$16OT) LC0=P0;
-LS$16OT:DISALGNEXCPT                       || R1 = [I0++] || R3  =[I1++];
-        R4 = BYTEOP2P (R3:2,R1:0) (TH)     || R0 = [I0++] || R2  =[I1++];
-        R5 = BYTEOP2P (R3:2,R1:0) (TH,R)   || R1 = [I0++] || R6  =[I3++];
-        R4 = R4 +|+ R6                                    || R7 = [I3--];
-        R5 = R5 +|+ R7                                    || [I3++] = R4;
-        DISALGNEXCPT                       || R3  =[I1++] || [I3++] = R5;
-        R4 = BYTEOP2P (R3:2,R1:0) (TH)     || R0 = [I0++M0]|| R2  = [I1++M0];
-        R5 = BYTEOP2P (R3:2,R1:0) (TH,R)   || R0 = [I0++] || R6 = [I3++];
-        R4 = R4 +|+ R6                                    || R7 = [I3--];
-        R5 = R5 +|+ R7                                    || [I3++] = R4;
-LE$16OT:DISALGNEXCPT                       || R2 = [I1++] || [I3++M2] = R5;
-
-        (r7:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(put_pixels16_xy2_nornd)
-
-DEFUN(z_put_pixels8_xy2,mL1,
-        (uint8_t *block, const uint8_t *s0,
-                 int dest_size, int line_size, int h)):
-        link 0;
-        [--sp] = (r7:4);
-        i3=r0;        // dest
-        i0=r1;        // src0--> pixels
-        i1=r1;        // src1--> pixels + line_size
-        r2+=-4;
-        m2=r2;        // m2=dest_width-4
-        r2=[fp+20];
-        m3=r2;        // line_size
-        p0=[fp+24];   // h
-        r2+=-8;
-        i1+=m3;       /* src1 + line_size */
-        m0=r2;        /* line-size - 20 */
-
-        b0 = I0;
-        b1 = I1;
-        b3 = I3;
-
-        LSETUP(LS$8E,LE$8E) LC0=P0;
-        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
-LS$8E:  DISALGNEXCPT                       || R1 = [I0++]   || R3  =[I1++];
-        R4 = BYTEOP2P (R3:2,R1:0) (RNDL)   || R0 = [I0++M0] || R2  =[I1++M0];
-        R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R0 = [I0++]   || [I3++] = R4 ;
-LE$8E:  DISALGNEXCPT                       || R2 = [I1++]   || [I3++M2] = R5;
-
-        M1 = 1;
-        I3 = b3;
-        I1 = b1;
-        I0 = b0;
-
-        I0 += M1;
-        I1 += M1;
-
-        LSETUP(LS$8O,LE$8O) LC0=P0;
-        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
-LS$8O:  DISALGNEXCPT                       || R1 = [I0++]   || R3  =[I1++];
-        R4 = BYTEOP2P (R3:2,R1:0) (RNDH)   || R0 = [I0++M0] || R2  =[I1++M0];
-        R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R0 = [I0++]   || R6  =[I3++];
-        R4 = R4 +|+ R6                                      || R7 = [I3--];
-        R5 = R5 +|+ R7                                      || [I3++] = R4;
-LE$8O:  DISALGNEXCPT                       || R2  =[I1++]   || [I3++M2] = R5;
-
-        (r7:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(z_put_pixels8_xy2)
-
-DEFUN(put_pixels8_xy2_nornd,mL1,
-        (uint8_t *block, const uint8_t *s0, int line_size, int h)):
-        link 0;
-        [--sp] = (r7:4);
-        i3=r0;        // dest
-        i0=r1;        // src0--> pixels
-        i1=r1;        // src1--> pixels + line_size
-        m3=r2;
-        r2+=-4;
-        m2=r2;
-        r2+=-4;
-        i1+=m3;       /* src1 + line_size */
-        m0=r2;        /* line-size - 20 */
-        p0=[fp+20];   // h
-
-
-        b0 = I0;
-        b1 = I1;
-        b3 = I3;
-
-        LSETUP(LS$8ET,LE$8ET) LC0=P0;
-        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
-
-LS$8ET: DISALGNEXCPT                       || R1 = [I0++]   || R3 = [I1++];
-        R4 = BYTEOP2P (R3:2,R1:0) (TL)     || R0 = [I0++M0] || R2 = [I1++M0];
-        R5 = BYTEOP2P (R3:2,R1:0) (TL,R)   || R0 = [I0++]   || [I3++] = R4 ;
-LE$8ET: DISALGNEXCPT                       || R2 = [I1++]   || [I3++M2] = R5;
-
-        M1 = 1;
-        I3 = b3;
-        I1 = b1;
-        I0 = b0;
-
-        I0 += M1;
-        I1 += M1;
-
-        LSETUP(LS$8OT,LE$8OT) LC0=P0;
-        DISALGNEXCPT                       || R0 = [I0++]   || R2 = [I1++];
-
-LS$8OT: DISALGNEXCPT                       || R1 = [I0++]   || R3 = [I1++];
-        R4 = BYTEOP2P (R3:2,R1:0) (TH)     || R0 = [I0++M0] || R2 = [I1++M0];
-        R5 = BYTEOP2P (R3:2,R1:0) (TH,R)   || R0 = [I0++]   || R6 = [I3++];
-        R4 = R4 +|+ R6                                      || R7 = [I3--];
-        R5 = R5 +|+ R7                                      || [I3++] = R4;
-LE$8OT: DISALGNEXCPT                       || R2  =[I1++]   || [I3++M2] = R5;
-
-        (r7:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(put_pixels8_xy2_nornd)
diff --git a/deps/libav/libavcodec/bfin/hpeldsp_bfin.c b/deps/libav/libavcodec/bfin/hpeldsp_bfin.c
deleted file mode 100644
index cecb1db..0000000
--- a/deps/libav/libavcodec/bfin/hpeldsp_bfin.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * BlackFin DSPUTILS
- *
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- * Copyright (c) 2006 Michael Benjamin <michael.benjamin at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavcodec/hpeldsp.h"
-#include "hpeldsp_bfin.h"
-
-static void bfin_put_pixels8 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels8uc (block, pixels, pixels, line_size, line_size, h);
-}
-
-static void bfin_put_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels8uc (block, pixels, pixels+1, line_size, line_size, h);
-}
-
-static void bfin_put_pixels8_y2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels8uc (block, pixels, pixels+line_size, line_size, line_size, h);
-}
-
-static void bfin_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, ptrdiff_t line_size, int h)
-{
-    ff_bfin_z_put_pixels8_xy2 (block,s0,line_size, line_size, h);
-}
-
-static void bfin_put_pixels16 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels16uc (block, pixels, pixels, line_size, line_size, h);
-}
-
-static void bfin_put_pixels16_x2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels16uc (block, pixels, pixels+1, line_size, line_size, h);
-}
-
-static void bfin_put_pixels16_y2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels16uc (block, pixels, pixels+line_size, line_size, line_size, h);
-}
-
-static void bfin_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, ptrdiff_t line_size, int h)
-{
-    ff_bfin_z_put_pixels16_xy2 (block,s0,line_size, line_size, h);
-}
-
-static void bfin_put_pixels8_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels8uc_nornd (block, pixels, pixels, line_size, h);
-}
-
-static void bfin_put_pixels8_x2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+1, line_size, h);
-}
-
-static void bfin_put_pixels8_y2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+line_size, line_size, h);
-}
-
-
-static void bfin_put_pixels16_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels16uc_nornd (block, pixels, pixels, line_size, h);
-}
-
-static void bfin_put_pixels16_x2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+1, line_size, h);
-}
-
-static void bfin_put_pixels16_y2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+line_size, line_size, h);
-}
-
-av_cold void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags)
-{
-    c->put_pixels_tab[0][0] = bfin_put_pixels16;
-    c->put_pixels_tab[0][1] = bfin_put_pixels16_x2;
-    c->put_pixels_tab[0][2] = bfin_put_pixels16_y2;
-    c->put_pixels_tab[0][3] = bfin_put_pixels16_xy2;
-
-    c->put_pixels_tab[1][0] = bfin_put_pixels8;
-    c->put_pixels_tab[1][1] = bfin_put_pixels8_x2;
-    c->put_pixels_tab[1][2] = bfin_put_pixels8_y2;
-    c->put_pixels_tab[1][3] = bfin_put_pixels8_xy2;
-
-    c->put_no_rnd_pixels_tab[1][0] = bfin_put_pixels8_nornd;
-    c->put_no_rnd_pixels_tab[1][1] = bfin_put_pixels8_x2_nornd;
-    c->put_no_rnd_pixels_tab[1][2] = bfin_put_pixels8_y2_nornd;
-/*     c->put_no_rnd_pixels_tab[1][3] = ff_bfin_put_pixels8_xy2_nornd; */
-
-    c->put_no_rnd_pixels_tab[0][0] = bfin_put_pixels16_nornd;
-    c->put_no_rnd_pixels_tab[0][1] = bfin_put_pixels16_x2_nornd;
-    c->put_no_rnd_pixels_tab[0][2] = bfin_put_pixels16_y2_nornd;
-/*     c->put_no_rnd_pixels_tab[0][3] = ff_bfin_put_pixels16_xy2_nornd; */
-}
diff --git a/deps/libav/libavcodec/bfin/hpeldsp_bfin.h b/deps/libav/libavcodec/bfin/hpeldsp_bfin.h
deleted file mode 100644
index 2de16f7..0000000
--- a/deps/libav/libavcodec/bfin/hpeldsp_bfin.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007 Marc Hoffman <mmh at pleasantst.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_BFIN_HPELDSP_BFIN_H
-#define AVCODEC_BFIN_HPELDSP_BFIN_H
-
-#include <stdint.h>
-
-#include "config.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define attribute_l1_text  __attribute__ ((l1_text))
-#define attribute_l1_data_b __attribute__((l1_data_B))
-#else
-#define attribute_l1_text
-#define attribute_l1_data_b
-#endif
-
-void ff_bfin_z_put_pixels16_xy2     (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) attribute_l1_text;
-void ff_bfin_z_put_pixels8_xy2      (uint8_t *block, const uint8_t *s0, int dest_size, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels16_xy2_nornd (uint8_t *block, const uint8_t *s0, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels8_xy2_nornd  (uint8_t *block, const uint8_t *s0, int line_size, int h) attribute_l1_text;
-
-
-void ff_bfin_put_pixels8uc        (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int dest_size, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels16uc       (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int dest_size, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels8uc_nornd  (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) attribute_l1_text;
-void ff_bfin_put_pixels16uc_nornd (uint8_t *block, const uint8_t *s0, const uint8_t *s1, int line_size, int h) attribute_l1_text;
-
-#endif /* AVCODEC_BFIN_HPELDSP_BFIN_H */
diff --git a/deps/libav/libavcodec/bfin/idct_bfin.S b/deps/libav/libavcodec/bfin/idct_bfin.S
deleted file mode 100644
index 0eeffc2..0000000
--- a/deps/libav/libavcodec/bfin/idct_bfin.S
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * idct BlackFin
- *
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-/*
-   This blackfin DSP code implements an 8x8 inverse type II DCT.
-
-Prototype       : void ff_bfin_idct(int16_t *in)
-
-Registers Used  : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.
-
-Performance     :
-                    Code Size   : 498 Bytes.
-                    Cycle Count : 417 Cycles
-
-
------------------------------------------------------------
-Libav conformance testing results
------------------------------------------------------------
-
-dct-test: modified with the following
-            dct_error("BFINidct", 1, ff_bfin_idct, idct, test);
-produces the following output
-
-libavcodec> ./dct-test -i
-Libav DCT/IDCT test
-
-    8    15    -2    21    24    17     0    10
-    2   -10    -5    -5    -3     7   -14    -3
-    2   -13   -10   -19    18    -6     6    -2
-    9     4    16    -3     9    12    10    15
-   15    -9    -2    10     1    16     0   -15
-  -15     5     7     3    13     0    13    20
-   -6   -15    24     9   -18     1     9   -22
-   -8    25    23     2    -7     0    30    13
-IDCT BFINidct: err_inf=1 err2=0.01002344 syserr=0.00150000 maxout=266 blockSumErr=64
-IDCT BFINidct: 88.3 kdct/s
-
-*/
-
-#include "config.h"
-#include "config_bfin.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.B,"aw", at progbits
-#else
-.data
-#endif
-
-.align 4;
-coefs:
-.short 0x5a82;           //  C4
-.short 0x5a82;           //  C4
-.short 0x30FC;           //cos(3pi/8)  C6
-.short 0x7642;           //cos(pi/8)   C2
-.short 0x18F9;           //cos(7pi/16)
-.short 0x7D8A;           //cos(pi/16)
-.short 0x471D;           //cos(5pi/16)
-.short 0x6A6E;           //cos(3pi/16)
-.short 0x18F9;           //cos(7pi/16)
-.short 0x7D8A;           //cos(pi/16)
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.A,"aw", at progbits
-#endif
-
-vtmp: .space 256
-
-#define TMP0 FP-8
-#define TMP1 FP-12
-#define TMP2 FP-16
-
-
-.text
-DEFUN(idct,mL1,
-        (int16_t *block)):
-
-/********************** Function Prologue *********************************/
-    link 16;
-    [--SP] = (R7:4, P5:3);   // Push the registers onto the stack.
-    B0 = R0;                 // Pointer to Input matrix
-    RELOC(R1, P3, coefs);    // Pointer to Coefficients
-    RELOC(R2, P3, vtmp);     // Pointer to Temporary matrix
-    B3 = R1;
-    B2 = R2;
-    L3 = 20;                // L3 is used for making the coefficient array
-                            // circular.
-                            // MUST BE RESTORED TO ZERO at function exit.
-    M1 = 16 (X);            // All these registers are initialized for
-    M3 = 8(X);              // modifying address offsets.
-
-    I0 = B0;                // I0 points to Input Element (0, 0).
-    I2 = B0;                // I2 points to Input Element (0, 0).
-    I2 += M3 || R0.H = W[I0];
-                            // Element 0 is read into R0.H
-    I1 = I2;                // I1 points to input Element (0, 6).
-    I1 += 4  || R0.L = W[I2++];
-                            // I2 points to input Element (0, 4).
-                            // Element 4 is read into R0.L.
-    P2 = 8 (X);
-    P3 = 32 (X);
-    P4 = -32 (X);
-    P5 = 98 (X);
-    R7 = 0x8000(Z);
-    I3 = B3;                // I3 points to Coefficients
-    P0 = B2;                // P0 points to array Element (0, 0) of temp
-    P1 = B2;
-    R7 = [I3++] || [TMP2]=R7;            // Coefficient C4 is read into R7.H and R7.L.
-    MNOP;
-    NOP;
-
-    /*
-     *   A1 =      Y0 * cos(pi/4)
-     *   A0 =      Y0 * cos(pi/4)
-     *   A1 = A1 + Y4 * cos(pi/4)
-     *   A0 = A0 - Y4 * cos(pi/4)
-     *   load:
-     *     R1=(Y2,Y6)
-     *     R7=(C2,C6)
-     *   res:
-     *     R3=Y0, R2=Y4
-     */
-    A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || I0+= 4       || R1.L=W[I1++];
-    R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || R1.H=W[I0--] || R7=[I3++];
-
-    LSETUP (.0, .1) LC0 = P2; // perform 8 1d idcts
-
-    P2 = 112 (X);
-    P1 = P1 + P2;           // P1 points to element (7, 0) of temp buffer.
-    P2 = -94(X);
-
-.0:
-       /*
-        *   A1 =      Y2 * cos(3pi/8)
-        *   A0 =      Y2 * cos(pi/8)
-        *   A1 = A1 - Y6 * cos(pi/8)
-        *   A0 = A0 + Y6 * cos(3pi/8)
-        *      R5 = (Y1,Y7)
-        *      R7 = (C1,C7)
-        *   res:
-        *      R1=Y2, R0=Y6
-        */
-        A1=R7.L*R1.H,       A0=R7.H*R1.H (IS)        || I0+=4        || R5.H=W[I0];
-        R1=(A1-=R7.H*R1.L), R0=(A0+=R7.L*R1.L) (IS)  || R5.L=W[I1--] || R7=[I3++];
-        /*
-        *   Y0 = Y0 + Y6.
-        *   Y4 = Y4 + Y2.
-        *   Y2 = Y4 - Y2.
-        *   Y6 = Y0 - Y6.
-        *     R3 is saved
-        *     R6.l=Y3
-        * note: R3: Y0, R2: Y4, R1: Y2, R0: Y6
-        */
-        R3=R3+R0, R0=R3-R0;
-        R2=R2+R1, R1=R2-R1 || [TMP0]=R3 || R6.L=W[I0--];
-        /*
-         *  Compute the odd portion (1,3,5,7) even is done.
-         *
-         *  Y1 = C7 * Y1 - C1 * Y7 + C3 * Y5 - C5 * Y3.
-         *  Y7 = C1 * Y1 + C7 * Y7 + C5 * Y5 + C3 * Y3.
-         *  Y5 = C5 * Y1 + C3 * Y7 + C7 * Y5 - C1 * Y3.
-         *  Y3 = C3 * Y1 - C5 * Y7 - C1 * Y5 - C7 * Y3.
-         */
-        //  R5=(Y1,Y7)  R6=(Y5,Y3)                                                   // R7=(C1,C7)
-        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || [TMP1]=R2 || R6.H=W[I2--];
-        A1-=R7.H*R5.L,       A0+=R7.L*R5.L (IS)       || I0-=4     || R7=[I3++];
-        A1+=R7.H*R6.H,       A0+=R7.L*R6.H (IS)       || I0+=M1;                     // R7=(C3,C5)
-        R3 =(A1-=R7.L*R6.L), R2 =(A0+=R7.H*R6.L) (IS);
-        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || R4=[TMP0];
-        A1+=R7.H*R5.L,       A0-=R7.L*R5.L (IS)       || I1+=M1    || R7=[I3++];     // R7=(C1,C7)
-        A1+=R7.L*R6.H,       A0-=R7.H*R6.H (IS);
-        R7 =(A1-=R7.H*R6.L), R6 =(A0-=R7.L*R6.L) (IS) || I2+=M1;
-        // R3=Y1, R2=Y7, R7=Y5, R6=Y3
-
-        /* Transpose write column. */
-        R5.H=R4+R2 (RND12);                                   // Y0=Y0+Y7
-        R5.L=R4-R2 (RND12) || R4 = [TMP1];                    // Y7=Y7-Y0
-        R2.H=R1+R7 (RND12) || W[P0++P3]=R5.H;                 // Y2=Y2+Y5 st Y0
-        R2.L=R1-R7 (RND12) || W[P1++P4]=R5.L || R7=[I3++];    // Y5=Y2-Y5 st Y7
-        R5.H=R0-R3 (RND12) || W[P0++P3]=R2.H || R1.L=W[I1++]; // Y1=Y6-Y1 st Y2
-        R5.L=R0+R3 (RND12) || W[P1++P4]=R2.L || R0.H=W[I0++]; // Y6=Y6+Y1 st Y5
-        R3.H=R4-R6 (RND12) || W[P0++P3]=R5.H || R0.L=W[I2++]; // Y3=Y3-Y4 st Y1
-        R3.L=R4+R6 (RND12) || W[P1++P4]=R5.L || R1.H=W[I0++]; // Y4=Y3+Y4 st Y6
-
-        /* pipeline loop start, + drain Y3, Y4 */
-        A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || W[P0++P2]= R3.H || R1.H = W[I0--];
-.1:     R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || W[P1++P5]= R3.L || R7 = [I3++];
-
-
-
-    I0 = B2;                // I0 points to Input Element (0, 0)
-    I2 = B2;                // I2 points to Input Element (0, 0)
-    I2 += M3 || R0.H = W[I0];
-                            // Y0 is read in R0.H
-    I1 = I2;                // I1 points to input Element (0, 6)
-    I1 += 4  || R0.L = W[I2++];
-                            // I2 points to input Element (0, 4)
-                            // Y4 is read in R0.L
-    P2 = 8 (X);
-    I3 = B3;                // I3 points to Coefficients
-    P0 = B0;                // P0 points to array Element (0, 0) for writing
-                            // output
-    P1 = B0;
-    R7 = [I3++];            // R7.H = C4 and R7.L = C4
-    NOP;
-
-    /*
-     *   A1 =      Y0 * cos(pi/4)
-     *   A0 =      Y0 * cos(pi/4)
-     *   A1 = A1 + Y4 * cos(pi/4)
-     *   A0 = A0 - Y4 * cos(pi/4)
-     *   load:
-     *     R1=(Y2,Y6)
-     *     R7=(C2,C6)
-     *   res:
-     *     R3=Y0, R2=Y4
-     */
-    A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || I0+=4        || R1.L=W[I1++];
-    R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || R1.H=W[I0--] || R7=[I3++];
-
-    LSETUP (.2, .3) LC0 = P2; // peform 8 1d idcts
-    P2 = 112 (X);
-    P1 = P1 + P2;
-    P2 = -94(X);
-
-.2:
-        /*
-         *   A1 =      Y2 * cos(3pi/8)
-         *   A0 =      Y2 * cos(pi/8)
-         *   A1 = A1 - Y6 * cos(pi/8)
-         *   A0 = A0 + Y6 * cos(3pi/8)
-         *      R5 = (Y1,Y7)
-         *      R7 = (C1,C7)
-         *   res:
-         *      R1=Y2, R0=Y6
-         */
-        A1=R7.L*R1.H,       A0=R7.H*R1.H (IS)        || I0+=4        || R5.H=W[I0];
-        R1=(A1-=R7.H*R1.L), R0=(A0+=R7.L*R1.L) (IS)  || R5.L=W[I1--] || R7=[I3++];
-        /*
-        *   Y0 = Y0 + Y6.
-        *   Y4 = Y4 + Y2.
-        *   Y2 = Y4 - Y2.
-        *   Y6 = Y0 - Y6.
-        *     R3 is saved
-        *     R6.l=Y3
-        * note: R3: Y0, R2: Y4, R1: Y2, R0: Y6
-        */
-        R3=R3+R0, R0=R3-R0;
-        R2=R2+R1, R1=R2-R1 || [TMP0]=R3 || R6.L=W[I0--];
-        /*
-         *  Compute the odd portion (1,3,5,7) even is done.
-         *
-         *  Y1 = C7 * Y1 - C1 * Y7 + C3 * Y5 - C5 * Y3.
-         *  Y7 = C1 * Y1 + C7 * Y7 + C5 * Y5 + C3 * Y3.
-         *  Y5 = C5 * Y1 + C3 * Y7 + C7 * Y5 - C1 * Y3.
-         *  Y3 = C3 * Y1 - C5 * Y7 - C1 * Y5 - C7 * Y3.
-         */
-        //  R5=(Y1,Y7)  R6=(Y5,Y3)                                                   // R7=(C1,C7)
-        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || [TMP1]=R2 || R6.H=W[I2--];
-        A1-=R7.H*R5.L,       A0+=R7.L*R5.L (IS)       || I0-=4     || R7=[I3++];
-        A1+=R7.H*R6.H,       A0+=R7.L*R6.H (IS)       || I0+=M1;                     // R7=(C3,C5)
-        R3 =(A1-=R7.L*R6.L), R2 =(A0+=R7.H*R6.L) (IS);
-        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || R4=[TMP0];
-        A1+=R7.H*R5.L,       A0-=R7.L*R5.L (IS)       || I1+=M1    || R7=[I3++];     // R7=(C1,C7)
-        A1+=R7.L*R6.H,       A0-=R7.H*R6.H (IS);
-        R7 =(A1-=R7.H*R6.L), R6 =(A0-=R7.L*R6.L) (IS) || I2+=M1;
-        // R3=Y1, R2=Y7, R7=Y5, R6=Y3
-
-        /* Transpose write column. */
-        R5.H=R4+R2 (RND20);                                   // Y0=Y0+Y7
-        R5.L=R4-R2 (RND20) || R4 = [TMP1];                    // Y7=Y7-Y0
-        R2.H=R1+R7 (RND20) || W[P0++P3]=R5.H;                 // Y2=Y2+Y5 st Y0
-        R2.L=R1-R7 (RND20) || W[P1++P4]=R5.L || R7=[I3++];    // Y5=Y2-Y5 st Y7
-        R5.H=R0-R3 (RND20) || W[P0++P3]=R2.H || R1.L=W[I1++]; // Y1=Y6-Y1 st Y2
-        R5.L=R0+R3 (RND20) || W[P1++P4]=R2.L || R0.H=W[I0++]; // Y6=Y6+Y1 st Y5
-        R3.H=R4-R6 (RND20) || W[P0++P3]=R5.H || R0.L=W[I2++]; // Y3=Y3-Y4 st Y1
-        R3.L=R4+R6 (RND20) || W[P1++P4]=R5.L || R1.H=W[I0++]; // Y4=Y3+Y4 st Y6
-
-        /* pipeline loop start, + drain Y3, Y4 */
-        A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || W[P0++P2]= R3.H || R1.H = W[I0--];
-.3:     R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || W[P1++P5]= R3.L || R7 = [I3++];
-
-    L3 = 0;
-    (R7:4,P5:3)=[SP++];
-    unlink;
-    RTS;
-DEFUN_END(idct)
diff --git a/deps/libav/libavcodec/bfin/mathops.h b/deps/libav/libavcodec/bfin/mathops.h
deleted file mode 100644
index bbee493..0000000
--- a/deps/libav/libavcodec/bfin/mathops.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * simple math operations
- *
- * Copyright (C) 2007 Marc Hoffman <mmhoffm at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVCODEC_BFIN_MATHOPS_H
-#define AVCODEC_BFIN_MATHOPS_H
-
-#include "config.h"
-
-#define MULH(X,Y) ({ int xxo;                           \
-    __asm__ (                                               \
-        "a1 = %2.L * %1.L (FU);\n\t"                    \
-        "a1 = a1 >> 16;\n\t"                            \
-        "a1 += %2.H * %1.L (IS,M);\n\t"                 \
-        "a0 = %1.H * %2.H, a1+= %1.H * %2.L (IS,M);\n\t"\
-        "a1 = a1 >>> 16;\n\t"                           \
-        "%0 = (a0 += a1);\n\t"                          \
-        : "=d" (xxo) : "d" (X), "d" (Y) : "A0","A1"); xxo; })
-
-/* signed 16x16 -> 32 multiply */
-#define MUL16(a, b) ({ int xxo;                         \
-    __asm__ (                                               \
-       "%0 = %1.l*%2.l (is);\n\t"                       \
-       : "=W" (xxo) : "d" (a), "d" (b) : "A1");         \
-    xxo; })
-
-#endif /* AVCODEC_BFIN_MATHOPS_H */
diff --git a/deps/libav/libavcodec/bfin/pixels_bfin.S b/deps/libav/libavcodec/bfin/pixels_bfin.S
deleted file mode 100644
index 70d9de5..0000000
--- a/deps/libav/libavcodec/bfin/pixels_bfin.S
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Blackfin Pixel Operations
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "config_bfin.h"
-
-DEFUN(put_pixels_clamped,mL1,
-        (int16_t *block, uint8_t *dest, int line_size)):
-    [--SP] = (R7:4);
-    R4 = 0;
-    R5.l = 0x00ff;
-    R5.h = 0x00ff;
-    I0 = R0;         // block
-    I1 = R1;         // dest
-    R2 += -4;        // line_size
-    M1 = R2;
-    P0 = 8;
-    R0 = [I0++];
-    R1 = [I0++];
-    R2 = MAX(R0, R4) (V);
-    LSETUP (ppc$0,ppc$1) LC0=P0;
-ppc$0: R2 = MIN(R2, R5) (V);
-       R3 = MAX(R1, R4) (V);
-       R3 = MIN(R3, R5) (V)      || R0 = [I0++];
-       R6 = BYTEPACK (R2,R3)     || R1 = [I0++];
-       R2 = MAX(R0, R4) (V)      || [I1++] = R6;
-       R2 = MIN(R2, R5) (V);
-       R3 = MAX(R1, R4) (V);
-       R3 = MIN(R3, R5) (V)      || R0 = [I0++];
-       R6 = BYTEPACK (R2,R3)     || R1 = [I0++];
-ppc$1: R2 = Max(R0, R4) (V)      || [I1++M1] = R6;
-
-    (R7:4) = [SP++];
-    RTS;
-DEFUN_END(put_pixels_clamped)
-
-DEFUN(add_pixels_clamped,mL1,
-        (int16_t *block, uint8_t *dest, int line_size)):
-    [-- SP] = (R7:4);
-    R4 = 0;
-    I0 = 0;
-    R2 += -4;        // line_size
-    M0 = R2;
-    I1 = R1;         // dest
-    I3 = R0;         // block
-    I2 = R1;         // dest
-    P0 = 8;
-    M3 = 2;
-    R0 = [I3++]  || R2 = [I1];
-    R2 = R2 << 8                      || R0.H = W[I3--]  || R3 = [I1++];
-    R3 = R3 >> 8                      || R1.L = W[I3]    || I3 += 4;
-    R6 = BYTEOP3P(R1:0, R3:2) (LO)    || R1.H = W[I3++]  || R2 = [I1];
-
-    LSETUP(apc$2,apc$3) LC1 = P0;
-apc$2: R7 = BYTEOP3P(R1:0, R3:2) (HI, R) || R0 = [I3++]     || R3 = [I1++M0];
-       R2 = R2 << 8                      || R0.H = W[I3--];
-       R3 = R3 >> 8                      || R1.L = W[I3]    || I3 += 4;
-       R6 = R6 + R7 (S)                  || R1.H = W[I3];
-       R6 = BYTEOP3P(R1:0, R3:2) (LO)    || I3+=M3          || [I2++]=R6;
-       R7 = BYTEOP3P(R1:0, R3:2) (HI, R) || R0 = [I3++]     || R2 = [I1];
-       R2 = R2 << 8                      || R0.H = W[I3--]  || R3 = [I1++];
-       R3 = R3 >> 8                      || R1.L = W[I3]    || I3 += 4;
-       R6 = R6 + R7 (S)                  || R1.H = W[I3++];
-apc$3: R6 = BYTEOP3P(R1:0, R3:2) (LO)    || [I2++M0] = R6   || R2 = [I1];
-
-    (R7:4) = [SP++];
-    RTS;
-DEFUN_END(add_pixels_clamped)
-
-DEFUN(diff_pixels,mL1,
-       (int16_t *block, uint8_t *s1, uint8_t *s2, int stride)):
-        link 0;
-        [--sp] = (r7:4);
-        p0=8;
-        i3=r0;        // block
-        i0=r1;        // s1
-        i1=r2;        // s2
-        r2=[fp+20];   // stride
-        r2+=-8;
-        m0=r2;
-
-
-        LSETUP(.LS0,.LE0) LC0=P0;
-        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
-
-.LS0:   DISALGNEXCPT                       || R1 = [I0++]   || R3 = [I1++];
-        (R5,R4) = BYTEOP16M (R1:0,R3:2)    || R0 = [I0++M0] || R2 = [I1++M0];
-        (R7,R6) = BYTEOP16M (R1:0,R3:2) (R)|| R0 = [I0++]   || [I3++] = R4;
-        DISALGNEXCPT                       || R2 = [I1++]   || [I3++] = R5;
-        [i3++]=r6;
-.LE0:  [i3++]=r7;
-
-        (r7:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(diff_pixels)
-
-/*
-    for (i = 0; i < 16; i++) {
-        for (j = 0; j < 16; j++) {
-          sum += pix[j];
-        }
-        pix += line_size;
-    }
-*/
-DEFUN(pix_sum,mL1,
-        (uint8_t *p, int stride)):
-        link 0;
-        [--sp] = (r7:4);
-        p0=8;
-        i0=r0;        // s1
-        i1=r0;
-        m1=r1;
-        r1=r1+r1;
-        r1+=-16;       // stride
-        m0=r1;
-        i1+=m1;
-
-        r6=0;
-
-        LSETUP(LS$PS,LE$PS) LC0=P0;
-        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
-
-LS$PS:  DISALGNEXCPT                       || R1 = [I0++]   || R3 = [I1++];
-        (R5,R4) = BYTEOP16P (R3:2,R1:0)    || R0 = [I0++]   || R2 = [I1++];
-        r6=r6+|+r5;
-        r6=r6+|+r4;
-        (R5,R4) = BYTEOP16P (R3:2,R1:0) (R)|| R1 = [I0++]   || R3 = [I1++];
-        r6=r6+|+r5;
-        r6=r6+|+r4;
-        (R5,R4) = BYTEOP16P (R3:2,R1:0)    || R0 = [I0++m0] || R2 = [I1++m0];
-        r6=r6+|+r5;
-        r6=r6+|+r4;
-        (R5,R4) = BYTEOP16P (R3:2,R1:0) (R)|| R0 = [I0++]   || R2 = [I1++];
-        r6=r6+|+r5;
-LE$PS:  r6=r6+|+r4;
-        r0.l=r6.l+r6.h;
-        r0.h=0;
-
-        (r7:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(pix_sum)
-
-
-DEFUN(get_pixels,mL1,
-        (int16_t *restrict block, const uint8_t *pixels, int line_size)):
-        [--sp] = (r7:4);
-        i3=r0;        // dest
-        i0=r1;        // src0
-        p0=8;
-        r2+=-8;
-        m0=r2;
-        LSETUP(gp8$0,gp8$1) LC0=P0;
-
-        DISALGNEXCPT                   || R0 = [I0++];
-        DISALGNEXCPT                   || R1 = [I0++];
-
-gp8$0:  (R7,R6) = byteunpack R1:0      || R0 = [I0++M0];
-        (R5,R4) = byteunpack R1:0 (R)  || R0 = [I0++]    || [I3++]=R6;
-        DISALGNEXCPT                   || R1 = [I0++]    || [I3++]=R7;
-        [I3++]=R4;
-gp8$1:  [I3++]=R5
-
-
-        (r7:4) = [sp++];
-        RTS;
-DEFUN_END(get_pixels)
-
-
-/* sad = sad16x16 (ubyte *mb, ubyte *refwin, srcwidth, refwinwidth, h) */
-/* 91 cycles */
-DEFUN(z_sad16x16,mL1,
-        (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h)):
-        link 0;
-        I0 = R0;
-        I1 = R1;
-
-        A1 = A0 = 0;
-        R0 = [sp+20]; // rwidth
-        P2 = [sp+24]; // height
-        R3 = 16;
-        R0 = R0 - R3;
-        R3 = R2 - R3;
-        M1 = R0;
-        M0 = R3;
-
-        DISALGNEXCPT         || R0 = [I0++]    || R2 = [I1++];
-        LSETUP (s$16, e$16) LC0=P2;
-s$16:   DISALGNEXCPT         || R1 = [I0++]    || R3 = [I1++];
-        SAA (R1:0,R3:2)      || R0 = [I0++]    || R2 = [I1++];
-        SAA (R1:0,R3:2) (R)  || R1 = [I0++]    || R3 = [I1++];
-        SAA (R1:0,R3:2)      || R0 = [I0++M0]  || R2 = [I1++M1];
-e$16:   SAA (R1:0,R3:2) (R)  || R0 = [I0++]    || R2 = [I1++];
-
-        R3=A1.L+A1.H,  R2=A0.L+A0.H ;
-        R0 = R2 + R3 ;
-        unlink;
-        RTS;
-DEFUN_END(z_sad16x16)
-
-/* sad = sad8x8 (ubyte *mb, ubyte *refwin, int srcwidth, int refwinwidth, int h) */
-/* 36 cycles */
-DEFUN(z_sad8x8,mL1,
-        (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h)):
-        I0 = R0;
-        I1 = R1;
-
-        A1 = A0 = 0;
-        r0 = [sp+12]; // rwidth
-        P2 = [sp+16]; //height
-        R3 = 8;
-        R0 = R0 - R3;
-        R3 = R2 - R3;
-        M0 = R3;
-        M1 = R0;
-
-        LSETUP (s$8, e$8) LC0=P2;
-        DISALGNEXCPT         || R0 = [I0++]   || R2 = [I1++];
-        DISALGNEXCPT         || R1 = [I0++]   || R3 = [I1++];
-s$8:    SAA (R1:0,R3:2)      || R0 = [I0++M0] || R2 = [I1++M1];
-        SAA (R1:0,R3:2) (R)  || R0 = [I0++]   || R2 = [I1++];
-e$8:    DISALGNEXCPT         || R1 = [I0++]   || R3 = [I1++];
-
-        R3=A1.L+A1.H,  R2=A0.L+A0.H ;
-        R0 = R2 + R3 ;
-        RTS;
-DEFUN_END(z_sad8x8)
-
-DEFUN(pix_norm1,mL1,
-        (uint8_t * pix, int line_size)):
-        [--SP]=(R7:4,P5:3);
-
-        // Fetch the input arguments.
-        P1 = R0;  // pix
-        P0 = R1;  // line_size
-        P5 = 16;  // loop ctr.
-        P0 -= P5;
-        M0 = P0;  // M0 = line_size-16;
-        // Now for the real work.
-        A1 = A0 = 0;
-        lsetup(_pix_norm1_blkfn_loopStart, _pix_norm1_blkfn_loopEnd) LC1 = P5;
-        I0 = P1;
-        DISALGNEXCPT || r0 = [i0++];
-
-_pix_norm1_blkfn_loopStart:
-        // following unpacks pix1[0..15] pix1+line_size[0..15]
-        DISALGNEXCPT || r1 = [i0++];
-
-        (r5, r4) = byteunpack r1:0 || r0 = [i0++];
-        a1 += r5.h * r5.h, a0 += r5.l * r5.l (is);
-        a1 += r4.h * r4.h, a0 += r4.l * r4.l (is);
-        (r5, r4) = byteunpack r1:0(r) || r1 = [i0++];
-        a1 += r5.h * r5.h, a0 += r5.l * r5.l (is);
-        a1 += r4.h * r4.h, a0 += r4.l * r4.l (is);
-        (r5, r4) = byteunpack r1:0 || r0 = [i0++M0];
-        a1 += r5.h * r5.h, a0 += r5.l * r5.l (is);
-        a1 += r4.h * r4.h, a0 += r4.l * r4.l (is);
-        (r5, r4) = byteunpack r1:0(r) || r0 = [i0++];
-        a1 += r5.h * r5.h, a0 += r5.l * r5.l (is);
-_pix_norm1_blkfn_loopEnd:
-        a1 += r4.h * r4.h, a0 += r4.l * r4.l (is);
-
-
-// Clean up at the end:
-        R2 = A0, R3 = A1;
-        R0 = R2 + R3 (S);
-
-        (R7:4,P5:3)=[SP++];
-
-        RTS;
-DEFUN_END(pix_norm1)
-
-DEFUN(sse4,mL1,
-        (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)):
-        link 0;
-        [--sp] = (r7:6);
-        p0=[fp+24];   // h
-        i0=r1;        // pix1
-        i1=r2;        // pix2
-        r2=[fp+20];   // line_size
-        r2+=-4;
-        m0=r2;
-
-        a0=a1=0;
-        LSETUP(.S40,.E40) LC0=P0;
-        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
-
-.S40:   DISALGNEXCPT                       || R1 = [I0++M0] || R3 = [I1++M0];
-        (R7,R6) = BYTEOP16M (R1:0,R3:2);
-        a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
-.E40:   a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
-        a0 += a1;
-        r0 = a0;
-
-        (r7:6) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(sse4)
-
-DEFUN(sse8,mL1,
-        (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)):
-        link 0;
-        [--sp] = (r7:6);
-        p0=[fp+24];   // h
-        i0=r1;        // pix1
-        i1=r2;        // pix2
-        r2=[fp+20];   // line_size
-        r2+=-8;
-        m0=r2;
-
-        a0=a1=0;
-        LSETUP(.S80,.E80) LC0=P0;
-        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
-
-.S80:   DISALGNEXCPT                       || R1 = [I0++]   || R3 = [I1++];
-        (R7,R6) = BYTEOP16M (R1:0,R3:2)    || R0 = [I0++M0] || R2 = [I1++M0];
-        a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
-        a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
-        (R7,R6) = BYTEOP16M (R1:0,R3:2) (R)|| R0 = [I0++]   || R2 = [I1++];
-        a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
-.E80:   a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
-        a0 += a1;
-        r0 = a0;
-
-        (r7:6) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(sse8)
-
-DEFUN(sse16,mL1,
-        (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)):
-        link 0;
-        [--sp] = (r7:6);
-        p0=[fp+24];   // h
-        i0=r1;        // pix1
-        i1=r2;        // pix2
-        r2=[fp+20];   // line_size
-        r2+=-16;
-        m0=r2;
-
-        a0=a1=0;
-        DISALGNEXCPT                       || R0 = [I0++]   || R2  =[I1++];
-        LSETUP(.S160,.E160) LC0=P0;
-
-.S160:  DISALGNEXCPT                       || R1 = [I0++]   || R3 = [I1++];
-        (R7,R6) = BYTEOP16M (R1:0,R3:2)    || R0 = [I0++]   || R2 = [I1++];
-        a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
-        a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
-        (R7,R6) = BYTEOP16M (R1:0,R3:2) (R)|| R1 = [I0++]   || R3 = [I1++];
-        a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
-        a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
-        (R7,R6) = BYTEOP16M (R1:0,R3:2)    || R0 = [I0++M0] || R2 = [I1++M0];
-        a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
-        a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
-        (R7,R6) = BYTEOP16M (R1:0,R3:2) (R)|| R0 = [I0++]   || R2 = [I1++];
-        a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
-.E160:  a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
-        a0 += a1;
-        r0 = a0;
-
-        (r7:6) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(sse16)
diff --git a/deps/libav/libavcodec/bfin/vp3_bfin.c b/deps/libav/libavcodec/bfin/vp3_bfin.c
deleted file mode 100644
index a8cdcb6..0000000
--- a/deps/libav/libavcodec/bfin/vp3_bfin.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/vp3dsp.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_bfin.h"
-#include "vp3_bfin.h"
-
-/* Intra iDCT offset 128 */
-static void bfin_vp3_idct_put(uint8_t *dest, int line_size, int16_t *block)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + 128;
-    int i,j;
-
-    ff_bfin_vp3_idct (block);
-
-    for (i=0;i<8;i++)
-        for (j=0;j<8;j++)
-            dest[line_size*i + j] = cm[block[j*8 + i]];
-
-    memset(block, 0, 128);
-}
-
-/* Inter iDCT */
-static void bfin_vp3_idct_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    int i, j;
-
-    ff_bfin_vp3_idct (block);
-    for (i = 0; i < 8; i++)
-        for (j = 0; j < 8; j++)
-            dest[line_size*i + j] = cm[dest[line_size*i + j] + block[j*8 + i]];
-
-    memset(block, 0, 128);
-}
-
-av_cold void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags)
-{
-    if (!(flags & CODEC_FLAG_BITEXACT)) {
-        c->idct_add = bfin_vp3_idct_add;
-        c->idct_put = bfin_vp3_idct_put;
-    }
-}
diff --git a/deps/libav/libavcodec/bfin/vp3_bfin.h b/deps/libav/libavcodec/bfin/vp3_bfin.h
deleted file mode 100644
index 5a2c5a4..0000000
--- a/deps/libav/libavcodec/bfin/vp3_bfin.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-#ifndef AVCODEC_BFIN_VP3_BFIN_H
-#define AVCODEC_BFIN_VP3_BFIN_H
-
-#include <stdint.h>
-
-void ff_bfin_vp3_idct(int16_t *block);
-
-#endif /* AVCODEC_BFIN_VP3_BFIN_H */
diff --git a/deps/libav/libavcodec/bfin/vp3_idct_bfin.S b/deps/libav/libavcodec/bfin/vp3_idct_bfin.S
deleted file mode 100644
index fec8d78..0000000
--- a/deps/libav/libavcodec/bfin/vp3_idct_bfin.S
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * vp3_idct BlackFin
- *
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-/*
-   This blackfin DSP code implements an 8x8 inverse type II DCT.
-
-Prototype       : void ff_bfin_vp3_idct(int16_t *in)
-
-Registers Used  : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.
-
-*/
-
-#include "config.h"
-#include "config_bfin.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.B,"aw", at progbits
-#else
-.data
-#endif
-
-.align 4;
-coefs:
-.short 0x5a82;           //  C4
-.short 0x5a82;           //  C4
-.short 0x30FC;           //cos(3pi/8)  C6
-.short 0x7642;           //cos(pi/8)   C2
-.short 0x18F9;           //cos(7pi/16)
-.short 0x7D8A;           //cos(pi/16)
-.short 0x471D;           //cos(5pi/16)
-.short 0x6A6E;           //cos(3pi/16)
-.short 0x18F9;           //cos(7pi/16)
-.short 0x7D8A;           //cos(pi/16)
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.A,"aw", at progbits
-#endif
-
-vtmp: .space 256
-
-#define TMP0 FP-8
-#define TMP1 FP-12
-#define TMP2 FP-16
-
-
-.text
-DEFUN(vp3_idct,mL1,
-        (int16_t *block)):
-
-/********************** Function Prologue *********************************/
-    link 16;
-    [--SP] = (R7:4, P5:3);   // Push the registers onto the stack.
-    B0 = R0;                 // Pointer to Input matrix
-    RELOC(R1, P3, coefs);    // Pointer to Coefficients
-    RELOC(R2, P3, vtmp);     // Pointer to Temporary matrix
-    B3 = R1;
-    B2 = R2;
-    L3 = 20;                // L3 is used for making the coefficient array
-                            // circular.
-                            // MUST BE RESTORED TO ZERO at function exit.
-    M1 = 16 (X);            // All these registers are initialized for
-    M3 = 8(X);              // modifying address offsets.
-
-    I0 = B0;                // I0 points to Input Element (0, 0).
-    I2 = B0;                // I2 points to Input Element (0, 0).
-    I2 += M3 || R0.H = W[I0];
-                            // Element 0 is read into R0.H
-    I1 = I2;                // I1 points to input Element (0, 6).
-    I1 += 4  || R0.L = W[I2++];
-                            // I2 points to input Element (0, 4).
-                            // Element 4 is read into R0.L.
-    P2 = 8 (X);
-    P3 = 32 (X);
-    P4 = -32 (X);
-    P5 = 98 (X);
-    R7 = 0x8000(Z);
-    I3 = B3;                // I3 points to Coefficients
-    P0 = B2;                // P0 points to array Element (0, 0) of temp
-    P1 = B2;
-    R7 = [I3++] || [TMP2]=R7;            // Coefficient C4 is read into R7.H and R7.L.
-    MNOP;
-    NOP;
-
-    /*
-     *   A1 =      Y0 * cos(pi/4)
-     *   A0 =      Y0 * cos(pi/4)
-     *   A1 = A1 + Y4 * cos(pi/4)
-     *   A0 = A0 - Y4 * cos(pi/4)
-     *   load:
-     *     R1=(Y2,Y6)
-     *     R7=(C2,C6)
-     *   res:
-     *     R3=Y0, R2=Y4
-     */
-    A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || I0+= 4       || R1.L=W[I1++];
-    R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || R1.H=W[I0--] || R7=[I3++];
-
-    LSETUP (.0, .1) LC0 = P2; // perform 8 1d idcts
-
-    P2 = 112 (X);
-    P1 = P1 + P2;           // P1 points to element (7, 0) of temp buffer.
-    P2 = -94(X);
-
-.0:
-       /*
-        *   A1 =      Y2 * cos(3pi/8)
-        *   A0 =      Y2 * cos(pi/8)
-        *   A1 = A1 - Y6 * cos(pi/8)
-        *   A0 = A0 + Y6 * cos(3pi/8)
-        *      R5 = (Y1,Y7)
-        *      R7 = (C1,C7)
-        *   res:
-        *      R1=Y2, R0=Y6
-        */
-        A1=R7.L*R1.H,       A0=R7.H*R1.H (IS)        || I0+=4        || R5.H=W[I0];
-        R1=(A1-=R7.H*R1.L), R0=(A0+=R7.L*R1.L) (IS)  || R5.L=W[I1--] || R7=[I3++];
-        /*
-        *   Y0 = Y0 + Y6.
-        *   Y4 = Y4 + Y2.
-        *   Y2 = Y4 - Y2.
-        *   Y6 = Y0 - Y6.
-        *     R3 is saved
-        *     R6.l=Y3
-        * note: R3: Y0, R2: Y4, R1: Y2, R0: Y6
-        */
-        R3=R3+R0, R0=R3-R0;
-        R2=R2+R1, R1=R2-R1 || [TMP0]=R3 || R6.L=W[I0--];
-        /*
-         *  Compute the odd portion (1,3,5,7) even is done.
-         *
-         *  Y1 = C7 * Y1 - C1 * Y7 + C3 * Y5 - C5 * Y3.
-         *  Y7 = C1 * Y1 + C7 * Y7 + C5 * Y5 + C3 * Y3.
-         *  Y5 = C5 * Y1 + C3 * Y7 + C7 * Y5 - C1 * Y3.
-         *  Y3 = C3 * Y1 - C5 * Y7 - C1 * Y5 - C7 * Y3.
-         */
-        //  R5=(Y1,Y7)  R6=(Y5,Y3)                                                   // R7=(C1,C7)
-        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || [TMP1]=R2 || R6.H=W[I2--];
-        A1-=R7.H*R5.L,       A0+=R7.L*R5.L (IS)       || I0-=4     || R7=[I3++];
-        A1+=R7.H*R6.H,       A0+=R7.L*R6.H (IS)       || I0+=M1;                     // R7=(C3,C5)
-        R3 =(A1-=R7.L*R6.L), R2 =(A0+=R7.H*R6.L) (IS);
-        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || R4=[TMP0];
-        A1+=R7.H*R5.L,       A0-=R7.L*R5.L (IS)       || I1+=M1    || R7=[I3++];     // R7=(C1,C7)
-        A1+=R7.L*R6.H,       A0-=R7.H*R6.H (IS);
-        R7 =(A1-=R7.H*R6.L), R6 =(A0-=R7.L*R6.L) (IS) || I2+=M1;
-        // R3=Y1, R2=Y7, R7=Y5, R6=Y3
-
-        /* Transpose write column. */
-        R5.H=R4+R2 (RND12);                                   // Y0=Y0+Y7
-        R5.L=R4-R2 (RND12) || R4 = [TMP1];                    // Y7=Y7-Y0
-        R2.H=R1+R7 (RND12) || W[P0++P3]=R5.H;                 // Y2=Y2+Y5 st Y0
-        R2.L=R1-R7 (RND12) || W[P1++P4]=R5.L || R7=[I3++];    // Y5=Y2-Y5 st Y7
-        R5.H=R0-R3 (RND12) || W[P0++P3]=R2.H || R1.L=W[I1++]; // Y1=Y6-Y1 st Y2
-        R5.L=R0+R3 (RND12) || W[P1++P4]=R2.L || R0.H=W[I0++]; // Y6=Y6+Y1 st Y5
-        R3.H=R4-R6 (RND12) || W[P0++P3]=R5.H || R0.L=W[I2++]; // Y3=Y3-Y4 st Y1
-        R3.L=R4+R6 (RND12) || W[P1++P4]=R5.L || R1.H=W[I0++]; // Y4=Y3+Y4 st Y6
-
-        /* pipeline loop start, + drain Y3, Y4 */
-        A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || W[P0++P2]= R3.H || R1.H = W[I0--];
-.1:     R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || W[P1++P5]= R3.L || R7 = [I3++];
-
-
-
-    I0 = B2;                // I0 points to Input Element (0, 0)
-    I2 = B2;                // I2 points to Input Element (0, 0)
-    I2 += M3 || R0.H = W[I0];
-                            // Y0 is read in R0.H
-    I1 = I2;                // I1 points to input Element (0, 6)
-    I1 += 4  || R0.L = W[I2++];
-                            // I2 points to input Element (0, 4)
-                            // Y4 is read in R0.L
-    P2 = 8 (X);
-    I3 = B3;                // I3 points to Coefficients
-    P0 = B0;                // P0 points to array Element (0, 0) for writing
-                            // output
-    P1 = B0;
-    R7 = [I3++];            // R7.H = C4 and R7.L = C4
-    NOP;
-
-    /*
-     *   A1 =      Y0 * cos(pi/4)
-     *   A0 =      Y0 * cos(pi/4)
-     *   A1 = A1 + Y4 * cos(pi/4)
-     *   A0 = A0 - Y4 * cos(pi/4)
-     *   load:
-     *     R1=(Y2,Y6)
-     *     R7=(C2,C6)
-     *   res:
-     *     R3=Y0, R2=Y4
-     */
-    A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || I0+=4        || R1.L=W[I1++];
-    R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || R1.H=W[I0--] || R7=[I3++];
-
-    LSETUP (.2, .3) LC0 = P2; // peform 8 1d idcts
-    P2 = 112 (X);
-    P1 = P1 + P2;
-    P2 = -94(X);
-
-.2:
-        /*
-         *   A1 =      Y2 * cos(3pi/8)
-         *   A0 =      Y2 * cos(pi/8)
-         *   A1 = A1 - Y6 * cos(pi/8)
-         *   A0 = A0 + Y6 * cos(3pi/8)
-         *      R5 = (Y1,Y7)
-         *      R7 = (C1,C7)
-         *   res:
-         *      R1=Y2, R0=Y6
-         */
-        A1=R7.L*R1.H,       A0=R7.H*R1.H (IS)        || I0+=4        || R5.H=W[I0];
-        R1=(A1-=R7.H*R1.L), R0=(A0+=R7.L*R1.L) (IS)  || R5.L=W[I1--] || R7=[I3++];
-        /*
-        *   Y0 = Y0 + Y6.
-        *   Y4 = Y4 + Y2.
-        *   Y2 = Y4 - Y2.
-        *   Y6 = Y0 - Y6.
-        *     R3 is saved
-        *     R6.l=Y3
-        * note: R3: Y0, R2: Y4, R1: Y2, R0: Y6
-        */
-        R3=R3+R0, R0=R3-R0;
-        R2=R2+R1, R1=R2-R1 || [TMP0]=R3 || R6.L=W[I0--];
-        /*
-         *  Compute the odd portion (1,3,5,7) even is done.
-         *
-         *  Y1 = C7 * Y1 - C1 * Y7 + C3 * Y5 - C5 * Y3.
-         *  Y7 = C1 * Y1 + C7 * Y7 + C5 * Y5 + C3 * Y3.
-         *  Y5 = C5 * Y1 + C3 * Y7 + C7 * Y5 - C1 * Y3.
-         *  Y3 = C3 * Y1 - C5 * Y7 - C1 * Y5 - C7 * Y3.
-         */
-        //  R5=(Y1,Y7)  R6=(Y5,Y3)                                                   // R7=(C1,C7)
-        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || [TMP1]=R2 || R6.H=W[I2--];
-        A1-=R7.H*R5.L,       A0+=R7.L*R5.L (IS)       || I0-=4     || R7=[I3++];
-        A1+=R7.H*R6.H,       A0+=R7.L*R6.H (IS)       || I0+=M1;                     // R7=(C3,C5)
-        R3 =(A1-=R7.L*R6.L), R2 =(A0+=R7.H*R6.L) (IS);
-        A1 =R7.L*R5.H,       A0 =R7.H*R5.H (IS)       || R4=[TMP0];
-        A1+=R7.H*R5.L,       A0-=R7.L*R5.L (IS)       || I1+=M1    || R7=[I3++];     // R7=(C1,C7)
-        A1+=R7.L*R6.H,       A0-=R7.H*R6.H (IS);
-        R7 =(A1-=R7.H*R6.L), R6 =(A0-=R7.L*R6.L) (IS) || I2+=M1;
-        // R3=Y1, R2=Y7, R7=Y5, R6=Y3
-
-        /* Transpose write column. */
-        R5.H=R4+R2 (RND20);                                   // Y0=Y0+Y7
-        R5.L=R4-R2 (RND20) || R4 = [TMP1];                    // Y7=Y7-Y0
-        R5=R5>>>2(v);
-        R2.H=R1+R7 (RND20) || W[P0++P3]=R5.H;                 // Y2=Y2+Y5 st Y0
-        R2.L=R1-R7 (RND20) || W[P1++P4]=R5.L || R7=[I3++];    // Y5=Y2-Y5 st Y7
-        R2=R2>>>2(v);
-        R5.H=R0-R3 (RND20) || W[P0++P3]=R2.H || R1.L=W[I1++]; // Y1=Y6-Y1 st Y2
-        R5.L=R0+R3 (RND20) || W[P1++P4]=R2.L || R0.H=W[I0++]; // Y6=Y6+Y1 st Y5
-        R5=R5>>>2(v);
-        R3.H=R4-R6 (RND20) || W[P0++P3]=R5.H || R0.L=W[I2++]; // Y3=Y3-Y4 st Y1
-        R3.L=R4+R6 (RND20) || W[P1++P4]=R5.L || R1.H=W[I0++]; // Y4=Y3+Y4 st Y6
-        R3=R3>>>2(v);
-        /* pipeline loop start, + drain Y3, Y4 */
-        A1=R7.H*R0.H,       A0=R7.H*R0.H (IS)       || W[P0++P2]= R3.H || R1.H = W[I0--];
-.3:     R3=(A1+=R7.H*R0.L), R2=(A0-=R7.H*R0.L) (IS) || W[P1++P5]= R3.L || R7 = [I3++];
-
-    L3 = 0;
-    (R7:4,P5:3)=[SP++];
-    unlink;
-    RTS;
-DEFUN_END(vp3_idct)
diff --git a/deps/libav/libavcodec/bgmc.c b/deps/libav/libavcodec/bgmc.c
deleted file mode 100644
index c7f732e..0000000
--- a/deps/libav/libavcodec/bgmc.c
+++ /dev/null
@@ -1,560 +0,0 @@
-/*
- * Block Gilbert-Moore decoder
- * Copyright (c) 2010 Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Block Gilbert-Moore decoder as used by MPEG-4 ALS
- * @author Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
- */
-
-#include "libavutil/attributes.h"
-#include "bgmc.h"
-
-#define FREQ_BITS  14                      // bits used by frequency counters
-#define VALUE_BITS 18                      // bits used to represent the values
-#define TOP_VALUE  ((1 << VALUE_BITS) - 1) // maximum value
-#define FIRST_QTR  (TOP_VALUE / 4 + 1)     // first quarter of values maximum value
-#define HALF       (2 * FIRST_QTR)         // first half of values maximum value
-#define THIRD_QTR  (3 * FIRST_QTR)         // third quarter of values maximum value
-
-#define LUT_BITS   (FREQ_BITS - 8)         // number of bits used to index lookup tables
-#define LUT_SIZE   (1 << LUT_BITS)         // size of the lookup tables
-#define LUT_BUFF   4                       // number of buffered lookup tables
-
-
-/** Cumulative frequency tables for block Gilbert-Moore coding. */
-static const uint16_t cf_tables_1[3][129] = {
-    {
-        16384, 16066, 15748, 15431, 15114, 14799, 14485, 14173, 13861, 13552,
-        13243, 12939, 12635, 12336, 12038, 11745, 11452, 11161, 10870, 10586,
-        10303, 10027,  9751,  9483,  9215,  8953,  8692,  8440,  8189,  7946,
-         7704,  7472,  7240,  7008,  6776,  6554,  6333,  6122,  5912,  5711,
-         5512,  5320,  5128,  4947,  4766,  4595,  4425,  4264,  4104,  3946,
-         3788,  3640,  3493,  3355,  3218,  3090,  2963,  2842,  2721,  2609,
-         2498,  2395,  2292,  2196,  2100,  2004,  1908,  1820,  1732,  1651,
-         1570,  1497,  1424,  1355,  1287,  1223,  1161,  1100,  1044,   988,
-          938,   888,   839,   790,   746,   702,   662,   623,   588,   553,
-          520,   488,   459,   431,   405,   380,   357,   334,   311,   288,
-          268,   248,   230,   213,   197,   182,   168,   154,   142,   130,
-          119,   108,    99,    90,    81,    72,    64,    56,    49,    42,
-           36,    30,    25,    20,    15,    11,     7,     3,     0
-    },
-    {
-        16384, 16080, 15776, 15473, 15170, 14868, 14567, 14268, 13970, 13674,
-        13378, 13086, 12794, 12505, 12218, 11936, 11654, 11373, 11092, 10818,
-        10544, 10276, 10008,  9749,  9490,  9236,  8982,  8737,  8492,  8256,
-         8020,  7792,  7564,  7336,  7108,  6888,  6669,  6459,  6249,  6050,
-         5852,  5660,  5468,  5286,  5104,  4931,  4760,  4598,  4436,  4275,
-         4115,  3965,  3816,  3674,  3534,  3403,  3272,  3147,  3023,  2907,
-         2792,  2684,  2577,  2476,  2375,  2274,  2173,  2079,  1986,  1897,
-         1810,  1724,  1645,  1567,  1493,  1419,  1351,  1284,  1222,  1161,
-         1105,  1050,   995,   941,   891,   842,   797,   753,   713,   673,
-          636,   599,   566,   533,   503,   473,   446,   419,   392,   365,
-          340,   316,   294,   272,   253,   234,   216,   199,   184,   169,
-          155,   142,   130,   118,   106,    95,    85,    75,    66,    57,
-           49,    41,    34,    27,    21,    15,    10,     5,     0
-    },
-    {
-        16384, 16092, 15801, 15510, 15219, 14930, 14641, 14355, 14069, 13785,
-        13501, 13219, 12938, 12661, 12384, 12112, 11841, 11571, 11301, 11037,
-        10773, 10514, 10256, 10005,  9754,  9508,  9263,  9025,  8787,  8557,
-         8327,  8103,  7879,  7655,  7431,  7215,  7000,  6792,  6585,  6387,
-         6190,  5998,  5807,  5625,  5445,  5272,  5100,  4937,  4774,  4613,
-         4452,  4301,  4150,  4007,  3865,  3731,  3597,  3469,  3341,  3218,
-         3099,  2981,  2869,  2758,  2652,  2546,  2440,  2334,  2234,  2134,
-         2041,  1949,  1864,  1779,  1699,  1620,  1547,  1474,  1407,  1340,
-         1278,  1217,  1157,  1097,  1043,   989,   940,   891,   846,   801,
-          759,   718,   680,   643,   609,   575,   543,   511,   479,   447,
-          418,   389,   363,   337,   314,   291,   270,   249,   230,   212,
-          195,   179,   164,   149,   135,   121,   108,    96,    85,    74,
-          64,     54,    45,    36,    28,    20,    13,     6,     0
-    }
-};
-
-
-static const uint16_t cf_tables_2[8][193] = {
-    {
-        16384, 16104, 15825, 15546, 15268, 14991, 14714, 14439, 14164, 13891,
-        13620, 13350, 13081, 12815, 12549, 12287, 12025, 11765, 11505, 11250,
-        10996, 10746, 10497, 10254, 10011,  9772,  9534,  9303,  9072,  8848,
-         8624,  8406,  8188,  7970,  7752,  7539,  7327,  7123,  6919,  6724,
-         6529,  6339,  6150,  5970,  5790,  5618,  5446,  5282,  5119,  4957,
-         4795,  4642,  4490,  4345,  4201,  4065,  3929,  3798,  3669,  3547,
-         3425,  3310,  3196,  3086,  2976,  2866,  2756,  2650,  2545,  2447,
-         2350,  2260,  2170,  2085,  2000,  1921,  1843,  1770,  1698,  1632,
-         1566,  1501,  1436,  1376,  1316,  1261,  1207,  1157,  1108,  1061,
-         1015,   973,   931,   893,   855,   819,   783,   747,   711,   677,
-          644,   614,   584,   557,   530,   505,   480,   458,   436,   416,
-          396,   378,   360,   343,   326,   310,   295,   281,   267,   255,
-          243,   232,   221,   211,   201,   192,   183,   174,   166,   158,
-          150,   142,   134,   126,   119,   112,   106,   100,    95,    90,
-           85,    80,    76,    72,    69,    66,    63,    60,    57,    54,
-           51,    48,    46,    44,    42,    40,    38,    36,    34,    33,
-           32,    31,    30,    29,    28,    27,    26,    25,    24,    23,
-           22,    21,    20,    19,    18,    17,    16,    15,    14,    13,
-           12,    11,    10,     9,     8,     7,     6,     5,     4,     3,
-            2,     1,     0
-    },
-    {
-        16384, 16116, 15849, 15582, 15316, 15050, 14785, 14521, 14257, 13995,
-        13734, 13476, 13218, 12963, 12708, 12457, 12206, 11956, 11706, 11460,
-        11215, 10975, 10735, 10500, 10265, 10034,  9803,  9579,  9355,  9136,
-         8917,  8703,  8489,  8275,  8061,  7853,  7645,  7444,  7244,  7051,
-         6858,  6671,  6484,  6305,  6127,  5956,  5785,  5622,  5459,  5298,
-         5137,  4983,  4830,  4684,  4539,  4401,  4263,  4131,  3999,  3874,
-         3750,  3632,  3515,  3401,  3287,  3173,  3059,  2949,  2840,  2737,
-         2635,  2539,  2444,  2354,  2264,  2181,  2098,  2020,  1943,  1872,
-         1801,  1731,  1661,  1596,  1532,  1472,  1412,  1357,  1303,  1251,
-         1200,  1153,  1106,  1063,  1020,   979,   938,   897,   856,   818,
-          780,   746,   712,   681,   650,   621,   592,   566,   540,   517,
-          494,   473,   452,   431,   410,   391,   373,   356,   340,   325,
-          310,   296,   282,   270,   258,   247,   236,   225,   214,   203,
-          192,   182,   172,   162,   153,   144,   136,   128,   121,   114,
-          108,   102,    97,    92,    87,    82,    77,    73,    69,    65,
-           62,    59,    56,    53,    50,    47,    45,    43,    41,    39,
-           37,    35,    33,    31,    29,    27,    26,    25,    24,    23,
-           22,    21,    20,    19,    18,    17,    16,    15,    14,    13,
-           12,    11,    10,     9,     8,     7,     6,     5,     4,     3,
-            2,     1,     0
-    },
-    {
-        16384, 16128, 15872, 15617, 15362, 15107, 14853, 14600, 14347, 14096,
-        13846, 13597, 13350, 13105, 12860, 12618, 12376, 12135, 11894, 11657,
-        11421, 11189, 10957, 10730, 10503, 10279, 10056,  9838,  9620,  9407,
-         9195,  8987,  8779,  8571,  8363,  8159,  7955,  7758,  7561,  7371,
-         7182,  6997,  6812,  6635,  6459,  6289,  6120,  5957,  5795,  5634,
-         5473,  5319,  5165,  5018,  4871,  4732,  4593,  4458,  4324,  4197,
-         4071,  3951,  3831,  3714,  3597,  3480,  3363,  3250,  3138,  3032,
-         2927,  2828,  2729,  2635,  2541,  2453,  2366,  2284,  2202,  2126,
-         2050,  1975,  1900,  1830,  1761,  1697,  1633,  1574,  1515,  1459,
-         1403,  1351,  1300,  1252,  1205,  1160,  1115,  1070,  1025,   982,
-          939,   899,   860,   824,   789,   756,   723,   693,   663,   636,
-          609,   584,   559,   535,   511,   489,   467,   447,   427,   409,
-          391,   374,   358,   343,   328,   313,   300,   287,   274,   261,
-          248,   235,   223,   211,   200,   189,   179,   169,   160,   151,
-          143,   135,   128,   121,   115,   109,   103,    97,    92,    87,
-           82,    77,    73,    69,    65,    61,    58,    55,    52,    49,
-           46,    43,    40,    37,    35,    33,    31,    29,    27,    25,
-           23,    21,    20,    19,    18,    17,    16,    15,    14,    13,
-           12,    11,    10,     9,     8,     7,     6,     5,     4,     3,
-            2,     1,     0
-    },
-    {
-        16384, 16139, 15894, 15649, 15405, 15162, 14919, 14677, 14435, 14195,
-        13955, 13717, 13479, 13243, 13008, 12775, 12542, 12310, 12079, 11851,
-        11623, 11399, 11176, 10956, 10737, 10521, 10305, 10094,  9883,  9677,
-         9471,  9268,  9065,  8862,  8659,  8459,  8260,  8067,  7874,  7688,
-         7502,  7321,  7140,  6965,  6790,  6621,  6452,  6290,  6128,  5968,
-         5808,  5655,  5503,  5356,  5209,  5069,  4929,  4794,  4660,  4532,
-         4404,  4282,  4160,  4041,  3922,  3803,  3684,  3568,  3452,  3343,
-         3234,  3131,  3029,  2931,  2833,  2741,  2649,  2563,  2477,  2396,
-         2316,  2236,  2157,  2083,  2009,  1940,  1871,  1807,  1743,  1683,
-         1623,  1567,  1511,  1459,  1407,  1357,  1307,  1257,  1207,  1159,
-         1111,  1067,  1023,   983,   943,   905,   868,   834,   800,   769,
-          738,   709,   681,   653,   625,   600,   575,   552,   529,   508,
-          487,   466,   447,   428,   410,   392,   376,   360,   344,   328,
-          313,   298,   283,   268,   255,   242,   230,   218,   207,   196,
-          186,   176,   167,   158,   150,   142,   135,   128,   121,   114,
-          108,   102,    97,    92,    87,    82,    78,    74,    70,    66,
-           62,    58,    54,    50,    47,    44,    41,    38,    35,    32,
-           30,    28,    26,    24,    22,    20,    18,    16,    14,    13,
-           12,    11,    10,     9,     8,     7,     6,     5,     4,     3,
-            2,     1,     0
-    },
-    {
-        16384, 16149, 15915, 15681, 15447, 15214, 14981, 14749, 14517, 14286,
-        14055, 13827, 13599, 13373, 13147, 12923, 12699, 12476, 12253, 12034,
-        11815, 11599, 11383, 11171, 10959, 10750, 10541, 10337, 10133,  9933,
-         9733,  9536,  9339,  9142,  8945,  8751,  8557,  8369,  8181,  7998,
-         7816,  7638,  7460,  7288,  7116,  6950,  6785,  6625,  6465,  6306,
-         6147,  5995,  5843,  5697,  5551,  5411,  5271,  5135,  5000,  4871,
-         4742,  4618,  4495,  4374,  4253,  4132,  4011,  3893,  3775,  3663,
-         3552,  3446,  3340,  3239,  3138,  3043,  2948,  2858,  2768,  2684,
-         2600,  2516,  2433,  2355,  2278,  2205,  2133,  2065,  1997,  1932,
-         1867,  1807,  1747,  1690,  1634,  1580,  1526,  1472,  1418,  1366,
-         1314,  1266,  1218,  1174,  1130,  1088,  1047,  1009,   971,   936,
-          901,   868,   836,   804,   772,   743,   714,   685,   658,   631,
-          606,   582,   559,   536,   515,   494,   475,   456,   437,   418,
-          399,   380,   362,   344,   328,   312,   297,   283,   270,   257,
-          245,   233,   222,   211,   201,   191,   181,   172,   163,   155,
-          147,   139,   132,   125,   119,   113,   107,   101,    96,    91,
-           86,    81,    76,    71,    66,    62,    58,    54,    50,    46,
-           43,    40,    37,    34,    31,    28,    26,    24,    22,    20,
-           18,    16,    14,    12,    10,     8,     6,     5,     4,     3,
-            2,     1,     0
-    },
-    {
-        16384, 16159, 15934, 15709, 15485, 15261, 15038, 14816, 14594, 14373,
-        14152, 13933, 13714, 13497, 13280, 13065, 12850, 12636, 12422, 12211,
-        12000, 11791, 11583, 11378, 11173, 10971, 10769, 10571, 10373, 10179,
-         9985,  9793,  9601,  9409,  9217,  9029,  8842,  8658,  8475,  8297,
-         8120,  7946,  7773,  7604,  7435,  7271,  7108,  6950,  6792,  6634,
-         6477,  6326,  6175,  6029,  5883,  5742,  5602,  5466,  5330,  5199,
-         5068,  4943,  4818,  4696,  4574,  4452,  4330,  4211,  4093,  3979,
-         3866,  3759,  3652,  3549,  3446,  3348,  3250,  3157,  3065,  2977,
-         2889,  2802,  2716,  2634,  2553,  2476,  2399,  2326,  2254,  2185,
-         2117,  2052,  1987,  1926,  1866,  1808,  1750,  1692,  1634,  1578,
-         1522,  1470,  1418,  1369,  1321,  1275,  1229,  1187,  1145,  1105,
-         1066,  1027,   991,   955,   919,   883,   850,   817,   786,   756,
-          728,   700,   674,   648,   624,   600,   578,   556,   534,   512,
-          490,   468,   447,   426,   407,   388,   371,   354,   338,   322,
-          307,   293,   280,   267,   255,   243,   231,   219,   209,   199,
-          189,   179,   170,   161,   153,   145,   138,   131,   124,   117,
-          111,   105,    99,    93,    87,    81,    76,    71,    66,    61,
-           57,    53,    49,    45,    42,    39,    36,    33,    30,    27,
-           24,    21,    19,    17,    15,    13,    11,     9,     7,     5,
-            3,     1,     0
-    },
-    {
-        16384, 16169, 15954, 15739, 15524, 15310, 15096, 14883, 14670, 14458,
-        14246, 14035, 13824, 13614, 13405, 13198, 12991, 12785, 12579, 12376,
-        12173, 11972, 11772, 11574, 11377, 11182, 10987, 10795, 10603, 10414,
-        10226, 10040,  9854,  9668,  9482,  9299,  9116,  8937,  8759,  8585,
-         8411,  8241,  8071,  7906,  7741,  7580,  7419,  7263,  7107,  6952,
-         6797,  6647,  6497,  6353,  6209,  6070,  5931,  5796,  5661,  5531,
-         5401,  5275,  5150,  5027,  4904,  4781,  4658,  4538,  4419,  4304,
-         4190,  4081,  3972,  3867,  3762,  3662,  3562,  3467,  3372,  3281,
-         3191,  3101,  3012,  2928,  2844,  2764,  2684,  2608,  2533,  2460,
-         2387,  2318,  2250,  2185,  2121,  2059,  1997,  1935,  1873,  1813,
-         1754,  1698,  1642,  1588,  1535,  1483,  1433,  1384,  1338,  1292,
-         1249,  1206,  1165,  1125,  1085,  1045,  1008,   971,   937,   903,
-          871,   840,   810,   780,   752,   724,   698,   672,   647,   622,
-          597,   572,   548,   524,   502,   480,   460,   440,   421,   403,
-          386,   369,   353,   337,   323,   309,   295,   281,   268,   255,
-          243,   231,   220,   209,   199,   189,   180,   171,   163,   155,
-          147,   139,   131,   123,   116,   109,   102,    95,    89,    83,
-           77,    72,    67,    62,    57,    52,    48,    44,    40,    36,
-           32,    28,    25,    22,    19,    16,    13,    10,     8,     6,
-            4,     2,     0
-    },
-    {
-        16384, 16177, 15970, 15764, 15558, 15353, 15148, 14944, 14740, 14537,
-        14334, 14132, 13930, 13729, 13529, 13330, 13131, 12933, 12735, 12539,
-        12343, 12150, 11957, 11766, 11576, 11388, 11200, 11015, 10830, 10647,
-        10465, 10285, 10105,  9925,  9745,  9568,  9391,  9218,  9045,  8876,
-         8707,  8541,  8375,  8213,  8051,  7894,  7737,  7583,  7429,  7277,
-         7125,  6977,  6830,  6687,  6544,  6406,  6268,  6133,  5998,  5868,
-         5738,  5612,  5487,  5364,  5241,  5118,  4995,  4875,  4755,  4640,
-         4525,  4414,  4304,  4198,  4092,  3990,  3888,  3790,  3693,  3600,
-         3507,  3415,  3323,  3235,  3147,  3064,  2981,  2902,  2823,  2746,
-         2670,  2594,  2522,  2450,  2382,  2314,  2248,  2182,  2116,  2050,
-         1987,  1924,  1864,  1804,  1748,  1692,  1638,  1585,  1534,  1484,
-         1437,  1390,  1346,  1302,  1258,  1215,  1174,  1133,  1095,  1057,
-         1021,   986,   952,   918,   887,   856,   827,   798,   770,   742,
-          714,   686,   659,   632,   607,   582,   559,   536,   514,   492,
-          472,   452,   433,   415,   398,   381,   364,   348,   333,   318,
-          304,   290,   277,   264,   252,   240,   229,   218,   208,   198,
-          188,   178,   168,   158,   149,   140,   132,   124,   116,   108,
-          101,    94,    87,    81,    75,    69,    64,    59,    54,    49,
-           44,    39,    35,    31,    27,    23,    19,    15,    12,     9,
-            6,     3,     0
-    }
-};
-
-
-static const uint16_t cf_tables_3[5][257] = {
-    {
-        16384, 16187, 15990, 15793, 15597, 15401, 15205, 15009, 14813, 14618,
-        14423, 14230, 14037, 13845, 13653, 13463, 13273, 13083, 12894, 12706,
-        12518, 12332, 12146, 11962, 11778, 11597, 11416, 11237, 11059, 10882,
-        10706, 10532, 10358, 10184, 10010,  9838,  9666,  9497,  9328,  9163,
-         8999,  8837,  8675,  8517,  8359,  8205,  8051,  7901,  7751,  7602,
-         7453,  7308,  7163,  7022,  6882,  6745,  6609,  6476,  6343,  6214,
-         6085,  5960,  5835,  5712,  5589,  5466,  5343,  5223,  5103,  4987,
-         4872,  4761,  4650,  4542,  4435,  4332,  4229,  4130,  4031,  3936,
-         3841,  3747,  3653,  3563,  3473,  3387,  3302,  3220,  3138,  3059,
-         2980,  2905,  2830,  2759,  2688,  2619,  2550,  2481,  2412,  2345,
-         2278,  2215,  2152,  2092,  2032,  1974,  1917,  1863,  1809,  1758,
-         1707,  1659,  1611,  1564,  1517,  1473,  1429,  1387,  1346,  1307,
-         1268,  1230,  1193,  1158,  1123,  1090,  1058,  1026,   994,   962,
-          930,   899,   869,   841,   813,   786,   760,   735,   710,   687,
-          664,   643,   622,   602,   582,   562,   543,   525,   507,   490,
-          473,   457,   442,   427,   412,   398,   385,   373,   361,   349,
-          337,   325,   313,   301,   290,   279,   269,   259,   249,   240,
-          231,   222,   214,   206,   199,   192,   185,   178,   171,   165,
-          159,   153,   148,   143,   138,   133,   128,   123,   119,   115,
-          111,   107,   103,    99,    95,    91,    87,    83,    80,    77,
-           74,    71,    68,    65,    63,    61,    59,    57,    55,    53,
-           51,    49,    47,    45,    43,    41,    40,    39,    38,    37,
-           36,    35,    34,    33,    32,    31,    30,    29,    28,    27,
-           26,    25,    24,    23,    22,    21,    20,    19,    18,    17,
-           16,    15,    14,    13,    12,    11,    10,     9,     8,     7,
-            6,     5,     4,     3,     2,     1,     0
-    },
-    {
-        16384, 16195, 16006, 15817, 15629, 15441, 15253, 15065, 14878, 14692,
-        14506, 14321, 14136, 13952, 13768, 13585, 13402, 13219, 13037, 12857,
-        12677, 12499, 12321, 12144, 11967, 11792, 11617, 11444, 11271, 11100,
-        10930, 10762, 10594, 10426, 10258, 10091,  9925,  9761,  9598,  9438,
-         9278,  9120,  8963,  8809,  8655,  8504,  8354,  8207,  8060,  7914,
-         7769,  7627,  7485,  7347,  7209,  7074,  6939,  6807,  6676,  6548,
-         6420,  6296,  6172,  6050,  5928,  5806,  5684,  5564,  5444,  5328,
-         5212,  5100,  4988,  4879,  4771,  4667,  4563,  4462,  4362,  4265,
-         4169,  4073,  3978,  3886,  3795,  3707,  3619,  3535,  3451,  3369,
-         3288,  3210,  3133,  3059,  2985,  2913,  2841,  2769,  2697,  2627,
-         2557,  2490,  2424,  2360,  2297,  2237,  2177,  2119,  2062,  2007,
-         1953,  1901,  1849,  1798,  1748,  1700,  1652,  1607,  1562,  1519,
-         1476,  1435,  1394,  1355,  1317,  1281,  1245,  1210,  1175,  1140,
-         1105,  1071,  1037,  1005,   973,   943,   913,   885,   857,   830,
-          804,   779,   754,   731,   708,   685,   663,   642,   621,   601,
-          581,   563,   545,   528,   511,   495,   479,   463,   448,   433,
-          419,   405,   391,   377,   364,   351,   338,   326,   314,   302,
-          291,   280,   270,   260,   251,   242,   234,   226,   218,   210,
-          202,   195,   188,   181,   174,   168,   162,   156,   150,   144,
-          139,   134,   129,   124,   119,   114,   109,   104,   100,    96,
-           92,    88,    84,    80,    77,    74,    71,    68,    65,    62,
-           59,    56,    54,    52,    50,    48,    46,    44,    42,    40,
-           38,    36,    34,    33,    32,    31,    30,    29,    28,    27,
-           26,    25,    24,    23,    22,    21,    20,    19,    18,    17,
-           16,    15,    14,    13,    12,    11,    10,     9,     8,     7,
-            6,     5,     4,     3,     2,     1,     0
-    },
-    {
-        16384, 16203, 16022, 15842, 15662, 15482, 15302, 15122, 14942, 14763,
-        14584, 14406, 14228, 14051, 13874, 13698, 13522, 13347, 13172, 12998,
-        12824, 12652, 12480, 12310, 12140, 11971, 11803, 11637, 11471, 11307,
-        11143, 10980, 10817, 10654, 10491, 10330, 10169, 10011,  9853,  9697,
-         9542,  9389,  9236,  9086,  8936,  8789,  8642,  8498,  8355,  8212,
-         8070,  7931,  7792,  7656,  7520,  7388,  7256,  7126,  6996,  6870,
-         6744,  6621,  6498,  6377,  6256,  6135,  6014,  5895,  5776,  5660,
-         5545,  5433,  5321,  5212,  5104,  4999,  4895,  4793,  4692,  4594,
-         4496,  4400,  4304,  4211,  4118,  4028,  3939,  3853,  3767,  3684,
-         3601,  3521,  3441,  3364,  3287,  3212,  3137,  3062,  2987,  2915,
-         2843,  2773,  2704,  2638,  2572,  2508,  2445,  2384,  2324,  2266,
-         2208,  2153,  2098,  2044,  1990,  1939,  1888,  1839,  1791,  1745,
-         1699,  1655,  1611,  1569,  1527,  1487,  1448,  1409,  1370,  1331,
-         1292,  1255,  1218,  1183,  1148,  1115,  1082,  1051,  1020,   990,
-          960,   932,   904,   878,   852,   826,   801,   777,   753,   731,
-          709,   687,   666,   645,   625,   605,   586,   567,   550,   533,
-          516,   499,   482,   465,   449,   433,   418,   403,   389,   375,
-          362,   349,   337,   325,   314,   303,   293,   283,   273,   263,
-          254,   245,   236,   227,   219,   211,   204,   197,   190,   183,
-          177,   171,   165,   159,   153,   147,   141,   135,   130,   125,
-          120,   115,   110,   105,   101,    97,    93,    89,    85,    81,
-           77,    74,    71,    68,    65,    62,    59,    56,    53,    51,
-           49,    47,    45,    43,    41,    39,    37,    35,    33,    31,
-           29,    27,    25,    23,    22,    21,    20,    19,    18,    17,
-           16,    15,    14,    13,    12,    11,    10,     9,     8,     7,
-            6,     5,     4,     3,     2,     1,     0
-    },
-    {
-        16384, 16210, 16036, 15863, 15690, 15517, 15344, 15172, 15000, 14828,
-        14656, 14485, 14314, 14145, 13976, 13808, 13640, 13472, 13304, 13137,
-        12970, 12804, 12639, 12475, 12312, 12149, 11987, 11827, 11667, 11508,
-        11349, 11192, 11035, 10878, 10721, 10565, 10410, 10257, 10104,  9953,
-         9802,  9654,  9506,  9359,  9213,  9070,  8927,  8787,  8647,  8508,
-         8369,  8233,  8097,  7964,  7831,  7700,  7570,  7442,  7315,  7190,
-         7065,  6943,  6821,  6701,  6581,  6461,  6341,  6223,  6105,  5990,
-         5876,  5764,  5653,  5545,  5437,  5331,  5226,  5124,  5022,  4924,
-         4826,  4729,  4632,  4538,  4444,  4353,  4262,  4174,  4087,  4002,
-         3917,  3835,  3753,  3674,  3595,  3518,  3441,  3364,  3287,  3212,
-         3138,  3066,  2995,  2926,  2858,  2792,  2726,  2662,  2599,  2538,
-         2478,  2420,  2362,  2305,  2249,  2195,  2141,  2089,  2037,  1988,
-         1939,  1891,  1844,  1799,  1754,  1711,  1668,  1626,  1584,  1542,
-         1500,  1459,  1418,  1380,  1342,  1305,  1269,  1234,  1199,  1166,
-         1133,  1102,  1071,  1041,  1012,   983,   954,   926,   899,   872,
-          847,   822,   798,   774,   751,   728,   707,   686,   666,   646,
-          627,   608,   589,   570,   552,   534,   517,   500,   484,   468,
-          453,   438,   424,   410,   397,   384,   372,   360,   348,   336,
-          325,   314,   303,   293,   283,   273,   264,   255,   246,   237,
-          229,   221,   213,   205,   197,   189,   181,   174,   167,   160,
-          154,   148,   142,   136,   131,   126,   121,   116,   111,   106,
-          101,    97,    93,    89,    85,    81,    77,    73,    70,    67,
-           64,    61,    58,    55,    52,    49,    46,    43,    40,    37,
-           35,    33,    31,    29,    27,    25,    23,    21,    19,    17,
-           16,    15,    14,    13,    12,    11,    10,     9,     8,     7,
-            6,     5,     4,     3,     2,     1,     0
-    },
-    {
-        16384, 16218, 16052, 15886, 15720, 15554, 15389, 15224, 15059, 14895,
-        14731, 14567, 14403, 14240, 14077, 13915, 13753, 13591, 13429, 13269,
-        13109, 12950, 12791, 12633, 12476, 12320, 12164, 12009, 11854, 11701,
-        11548, 11396, 11244, 11092, 10940, 10790, 10640, 10492, 10344, 10198,
-        10052,  9908,  9764,  9622,  9481,  9342,  9203,  9066,  8929,  8793,
-         8657,  8524,  8391,  8261,  8131,  8003,  7875,  7749,  7624,  7502,
-         7380,  7260,  7140,  7022,  6904,  6786,  6668,  6551,  6435,  6322,
-         6209,  6099,  5989,  5881,  5773,  5668,  5563,  5461,  5359,  5260,
-         5161,  5063,  4965,  4871,  4777,  4686,  4595,  4506,  4417,  4331,
-         4245,  4162,  4079,  3999,  3919,  3841,  3763,  3685,  3607,  3530,
-         3454,  3380,  3307,  3236,  3166,  3097,  3029,  2963,  2897,  2834,
-         2771,  2710,  2650,  2591,  2532,  2475,  2418,  2363,  2309,  2257,
-         2205,  2155,  2105,  2057,  2009,  1963,  1918,  1873,  1828,  1783,
-         1738,  1694,  1650,  1607,  1565,  1524,  1484,  1445,  1407,  1369,
-         1333,  1297,  1263,  1229,  1197,  1165,  1134,  1103,  1073,  1043,
-         1015,   987,   960,   933,   907,   882,   858,   834,   811,   788,
-          766,   744,   722,   700,   679,   658,   638,   618,   599,   581,
-          563,   545,   528,   511,   495,   480,   465,   451,   437,   423,
-          410,   397,   384,   372,   360,   348,   337,   326,   315,   305,
-          295,   285,   275,   265,   255,   245,   236,   227,   219,   211,
-          203,   195,   188,   181,   174,   167,   161,   155,   149,   143,
-          137,   131,   126,   121,   116,   111,   106,   101,    97,    93,
-           89,    85,    81,    77,    73,    69,    65,    61,    58,    55,
-           52,    49,    46,    43,    40,    37,    34,    32,    30,    28,
-           26,    24,    22,    20,    18,    16,    14,    12,    10,     8,
-            6,     5,     4,     3,     2,     1,     0
-    }
-};
-
-
-static const uint16_t *const cf_table[16] = {
-    cf_tables_1[0], cf_tables_1[1], cf_tables_1[2], cf_tables_2[0],
-    cf_tables_2[1], cf_tables_2[2], cf_tables_2[3], cf_tables_2[4],
-    cf_tables_2[5], cf_tables_2[6], cf_tables_2[7], cf_tables_3[0],
-    cf_tables_3[1], cf_tables_3[2], cf_tables_3[3], cf_tables_3[4]
-};
-
-
-/** Initialize a given lookup table using a given delta */
-static void bgmc_lut_fillp(uint8_t *lut, int *lut_status, int delta)
-{
-    unsigned int sx, i;
-
-    for (sx = 0; sx < 16; sx++)
-        for (i = 0; i < LUT_SIZE; i++) {
-            unsigned int target = (i + 1) << (FREQ_BITS - LUT_BITS);
-            unsigned int symbol = 1 << delta;
-
-            while (cf_table[sx][symbol] > target)
-                symbol += 1 << delta;
-
-            *lut++ = symbol >> delta;
-        }
-
-    *lut_status = delta;
-}
-
-
-/** Retune the index of a suitable lookup table for a given delta */
-static uint8_t *bgmc_lut_getp(uint8_t *lut, int *lut_status, int delta)
-{
-    unsigned int i = av_clip(delta, 0, LUT_BUFF - 1);
-
-    lut += (i * LUT_SIZE) << 4;
-
-    if (lut_status[i] != delta)
-        bgmc_lut_fillp(lut, &lut_status[i], delta);
-
-    return lut;
-}
-
-
-/** Initialize the lookup table arrays */
-av_cold int ff_bgmc_init(AVCodecContext *avctx,
-                         uint8_t **cf_lut, int **cf_lut_status)
-{
-    *cf_lut        = av_malloc(sizeof(*cf_lut)        * LUT_BUFF * 16 * LUT_SIZE);
-    *cf_lut_status = av_malloc(sizeof(*cf_lut_status) * LUT_BUFF);
-
-    if (!*cf_lut || !*cf_lut_status) {
-        ff_bgmc_end(cf_lut, cf_lut_status);
-        av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
-        return AVERROR(ENOMEM);
-    } else {
-        // initialize lut_status buffer to a value never used to compare against
-        memset(*cf_lut_status, -1, sizeof(*cf_lut_status) * LUT_BUFF);
-    }
-
-    return 0;
-}
-
-
-/** Release the lookup table arrays */
-av_cold void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status)
-{
-    av_freep(cf_lut);
-    av_freep(cf_lut_status);
-}
-
-
-/** Initialize decoding and reads the first value */
-void ff_bgmc_decode_init(GetBitContext *gb, unsigned int *h,
-                         unsigned int *l, unsigned int *v)
-{
-    *h = TOP_VALUE;
-    *l = 0;
-    *v = get_bits_long(gb, VALUE_BITS);
-}
-
-
-/** Finish decoding */
-void ff_bgmc_decode_end(GetBitContext *gb)
-{
-    skip_bits_long(gb, -(VALUE_BITS - 2));
-}
-
-
-/** Read and decode a block Gilbert-Moore coded symbol */
-void ff_bgmc_decode(GetBitContext *gb, unsigned int num, int32_t *dst,
-                    int delta, unsigned int sx,
-                    unsigned int *h, unsigned int *l, unsigned int *v,
-                    uint8_t *cf_lut, int *cf_lut_status)
-{
-    unsigned int i;
-    uint8_t *lut = bgmc_lut_getp(cf_lut, cf_lut_status, delta);
-
-    // read current state
-    unsigned int high  = *h;
-    unsigned int low   = *l;
-    unsigned int value = *v;
-
-    lut += sx * LUT_SIZE;
-
-    // decode num samples
-    for (i = 0; i < num; i++) {
-        unsigned int range  = high - low + 1;
-        unsigned int target = (((value - low + 1) << FREQ_BITS) - 1) / range;
-        unsigned int symbol = lut[target >> (FREQ_BITS - LUT_BITS)] << delta;
-
-        while (cf_table[sx][symbol] > target)
-            symbol += 1 << delta;
-
-        symbol = (symbol >> delta) - 1;
-
-        high = low + ((range * cf_table[sx][(symbol)     << delta] - (1 << FREQ_BITS)) >> FREQ_BITS);
-        low  = low + ((range * cf_table[sx][(symbol + 1) << delta])                    >> FREQ_BITS);
-
-        while (1) {
-            if (high >= HALF) {
-                if (low >= HALF) {
-                    value -= HALF;
-                    low   -= HALF;
-                    high  -= HALF;
-                } else if (low >= FIRST_QTR && high < THIRD_QTR) {
-                    value -= FIRST_QTR;
-                    low   -= FIRST_QTR;
-                    high  -= FIRST_QTR;
-                } else
-                    break;
-            }
-
-            low  *= 2;
-            high  = 2 * high + 1;
-            value = 2 * value + get_bits1(gb);
-        }
-
-        *dst++ = symbol;
-    }
-
-    // save current state
-    *h = high;
-    *l = low;
-    *v = value;
-}
diff --git a/deps/libav/libavcodec/bgmc.h b/deps/libav/libavcodec/bgmc.h
deleted file mode 100644
index 3d5b490..0000000
--- a/deps/libav/libavcodec/bgmc.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Block Gilbert-Moore decoder
- * Copyright (c) 2010 Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Block Gilbert-Moore decoder header
- * @author Thilo Borgmann <thilo.borgmann _at_ googlemail.com>
- */
-
-
-#ifndef AVCODEC_BGMC_H
-#define AVCODEC_BGMC_H
-
-
-#include "avcodec.h"
-#include "get_bits.h"
-
-
-int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status);
-
-
-void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status);
-
-
-void ff_bgmc_decode_init(GetBitContext *gb,
-                      unsigned int *h, unsigned int *l, unsigned int *v);
-
-
-void ff_bgmc_decode_end(GetBitContext *gb);
-
-
-void ff_bgmc_decode(GetBitContext *gb, unsigned int num, int32_t *dst,
-                 int delta, unsigned int sx,
-                 unsigned int *h, unsigned int *l, unsigned int *v,
-                 uint8_t *cf_lut, int *cf_lut_status);
-
-
-#endif /* AVCODEC_BGMC_H */
diff --git a/deps/libav/libavcodec/bink.c b/deps/libav/libavcodec/bink.c
deleted file mode 100644
index 0057542..0000000
--- a/deps/libav/libavcodec/bink.c
+++ /dev/null
@@ -1,1349 +0,0 @@
-/*
- * Bink video decoder
- * Copyright (c) 2009 Konstantin Shishkov
- * Copyright (C) 2011 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "binkdata.h"
-#include "binkdsp.h"
-#include "hpeldsp.h"
-#include "internal.h"
-#include "mathops.h"
-
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-
-#define BINK_FLAG_ALPHA 0x00100000
-#define BINK_FLAG_GRAY  0x00020000
-
-static VLC bink_trees[16];
-
-/**
- * IDs for different data types used in old version of Bink video codec
- */
-enum OldSources {
-    BINKB_SRC_BLOCK_TYPES = 0, ///< 8x8 block types
-    BINKB_SRC_COLORS,          ///< pixel values used for different block types
-    BINKB_SRC_PATTERN,         ///< 8-bit values for 2-colour pattern fill
-    BINKB_SRC_X_OFF,           ///< X components of motion value
-    BINKB_SRC_Y_OFF,           ///< Y components of motion value
-    BINKB_SRC_INTRA_DC,        ///< DC values for intrablocks with DCT
-    BINKB_SRC_INTER_DC,        ///< DC values for interblocks with DCT
-    BINKB_SRC_INTRA_Q,         ///< quantizer values for intrablocks with DCT
-    BINKB_SRC_INTER_Q,         ///< quantizer values for interblocks with DCT
-    BINKB_SRC_INTER_COEFS,     ///< number of coefficients for residue blocks
-
-    BINKB_NB_SRC
-};
-
-static const int binkb_bundle_sizes[BINKB_NB_SRC] = {
-    4, 8, 8, 5, 5, 11, 11, 4, 4, 7
-};
-
-static const int binkb_bundle_signed[BINKB_NB_SRC] = {
-    0, 0, 0, 1, 1, 0, 1, 0, 0, 0
-};
-
-static int32_t binkb_intra_quant[16][64];
-static int32_t binkb_inter_quant[16][64];
-
-/**
- * IDs for different data types used in Bink video codec
- */
-enum Sources {
-    BINK_SRC_BLOCK_TYPES = 0, ///< 8x8 block types
-    BINK_SRC_SUB_BLOCK_TYPES, ///< 16x16 block types (a subset of 8x8 block types)
-    BINK_SRC_COLORS,          ///< pixel values used for different block types
-    BINK_SRC_PATTERN,         ///< 8-bit values for 2-colour pattern fill
-    BINK_SRC_X_OFF,           ///< X components of motion value
-    BINK_SRC_Y_OFF,           ///< Y components of motion value
-    BINK_SRC_INTRA_DC,        ///< DC values for intrablocks with DCT
-    BINK_SRC_INTER_DC,        ///< DC values for interblocks with DCT
-    BINK_SRC_RUN,             ///< run lengths for special fill block
-
-    BINK_NB_SRC
-};
-
-/**
- * data needed to decode 4-bit Huffman-coded value
- */
-typedef struct Tree {
-    int     vlc_num;  ///< tree number (in bink_trees[])
-    uint8_t syms[16]; ///< leaf value to symbol mapping
-} Tree;
-
-#define GET_HUFF(gb, tree)  (tree).syms[get_vlc2(gb, bink_trees[(tree).vlc_num].table,\
-                                                 bink_trees[(tree).vlc_num].bits, 1)]
-
-/**
- * data structure used for decoding single Bink data type
- */
-typedef struct Bundle {
-    int     len;       ///< length of number of entries to decode (in bits)
-    Tree    tree;      ///< Huffman tree-related data
-    uint8_t *data;     ///< buffer for decoded symbols
-    uint8_t *data_end; ///< buffer end
-    uint8_t *cur_dec;  ///< pointer to the not yet decoded part of the buffer
-    uint8_t *cur_ptr;  ///< pointer to the data that is not read from buffer yet
-} Bundle;
-
-/*
- * Decoder context
- */
-typedef struct BinkContext {
-    AVCodecContext *avctx;
-    DSPContext     dsp;
-    HpelDSPContext hdsp;
-    BinkDSPContext bdsp;
-    AVFrame        *last;
-    int            version;              ///< internal Bink file version
-    int            has_alpha;
-    int            swap_planes;
-
-    Bundle         bundle[BINKB_NB_SRC]; ///< bundles for decoding all data types
-    Tree           col_high[16];         ///< trees for decoding high nibble in "colours" data type
-    int            col_lastval;          ///< value of last decoded high nibble in "colours" data type
-} BinkContext;
-
-/**
- * Bink video block types
- */
-enum BlockTypes {
-    SKIP_BLOCK = 0, ///< skipped block
-    SCALED_BLOCK,   ///< block has size 16x16
-    MOTION_BLOCK,   ///< block is copied from previous frame with some offset
-    RUN_BLOCK,      ///< block is composed from runs of colours with custom scan order
-    RESIDUE_BLOCK,  ///< motion block with some difference added
-    INTRA_BLOCK,    ///< intra DCT block
-    FILL_BLOCK,     ///< block is filled with single colour
-    INTER_BLOCK,    ///< motion block with DCT applied to the difference
-    PATTERN_BLOCK,  ///< block is filled with two colours following custom pattern
-    RAW_BLOCK,      ///< uncoded 8x8 block
-};
-
-/**
- * Initialize length length in all bundles.
- *
- * @param c     decoder context
- * @param width plane width
- * @param bw    plane width in 8x8 blocks
- */
-static void init_lengths(BinkContext *c, int width, int bw)
-{
-    width = FFALIGN(width, 8);
-
-    c->bundle[BINK_SRC_BLOCK_TYPES].len = av_log2((width >> 3) + 511) + 1;
-
-    c->bundle[BINK_SRC_SUB_BLOCK_TYPES].len = av_log2((width >> 4) + 511) + 1;
-
-    c->bundle[BINK_SRC_COLORS].len = av_log2(bw*64 + 511) + 1;
-
-    c->bundle[BINK_SRC_INTRA_DC].len =
-    c->bundle[BINK_SRC_INTER_DC].len =
-    c->bundle[BINK_SRC_X_OFF].len =
-    c->bundle[BINK_SRC_Y_OFF].len = av_log2((width >> 3) + 511) + 1;
-
-    c->bundle[BINK_SRC_PATTERN].len = av_log2((bw << 3) + 511) + 1;
-
-    c->bundle[BINK_SRC_RUN].len = av_log2(bw*48 + 511) + 1;
-}
-
-/**
- * Allocate memory for bundles.
- *
- * @param c decoder context
- */
-static av_cold void init_bundles(BinkContext *c)
-{
-    int bw, bh, blocks;
-    int i;
-
-    bw = (c->avctx->width  + 7) >> 3;
-    bh = (c->avctx->height + 7) >> 3;
-    blocks = bw * bh;
-
-    for (i = 0; i < BINKB_NB_SRC; i++) {
-        c->bundle[i].data = av_malloc(blocks * 64);
-        c->bundle[i].data_end = c->bundle[i].data + blocks * 64;
-    }
-}
-
-/**
- * Free memory used by bundles.
- *
- * @param c decoder context
- */
-static av_cold void free_bundles(BinkContext *c)
-{
-    int i;
-    for (i = 0; i < BINKB_NB_SRC; i++)
-        av_freep(&c->bundle[i].data);
-}
-
-/**
- * Merge two consequent lists of equal size depending on bits read.
- *
- * @param gb   context for reading bits
- * @param dst  buffer where merged list will be written to
- * @param src  pointer to the head of the first list (the second lists starts at src+size)
- * @param size input lists size
- */
-static void merge(GetBitContext *gb, uint8_t *dst, uint8_t *src, int size)
-{
-    uint8_t *src2 = src + size;
-    int size2 = size;
-
-    do {
-        if (!get_bits1(gb)) {
-            *dst++ = *src++;
-            size--;
-        } else {
-            *dst++ = *src2++;
-            size2--;
-        }
-    } while (size && size2);
-
-    while (size--)
-        *dst++ = *src++;
-    while (size2--)
-        *dst++ = *src2++;
-}
-
-/**
- * Read information about Huffman tree used to decode data.
- *
- * @param gb   context for reading bits
- * @param tree pointer for storing tree data
- */
-static void read_tree(GetBitContext *gb, Tree *tree)
-{
-    uint8_t tmp1[16] = { 0 }, tmp2[16], *in = tmp1, *out = tmp2;
-    int i, t, len;
-
-    tree->vlc_num = get_bits(gb, 4);
-    if (!tree->vlc_num) {
-        for (i = 0; i < 16; i++)
-            tree->syms[i] = i;
-        return;
-    }
-    if (get_bits1(gb)) {
-        len = get_bits(gb, 3);
-        for (i = 0; i <= len; i++) {
-            tree->syms[i] = get_bits(gb, 4);
-            tmp1[tree->syms[i]] = 1;
-        }
-        for (i = 0; i < 16 && len < 16 - 1; i++)
-            if (!tmp1[i])
-                tree->syms[++len] = i;
-    } else {
-        len = get_bits(gb, 2);
-        for (i = 0; i < 16; i++)
-            in[i] = i;
-        for (i = 0; i <= len; i++) {
-            int size = 1 << i;
-            for (t = 0; t < 16; t += size << 1)
-                merge(gb, out + t, in + t, size);
-            FFSWAP(uint8_t*, in, out);
-        }
-        memcpy(tree->syms, in, 16);
-    }
-}
-
-/**
- * Prepare bundle for decoding data.
- *
- * @param gb          context for reading bits
- * @param c           decoder context
- * @param bundle_num  number of the bundle to initialize
- */
-static void read_bundle(GetBitContext *gb, BinkContext *c, int bundle_num)
-{
-    int i;
-
-    if (bundle_num == BINK_SRC_COLORS) {
-        for (i = 0; i < 16; i++)
-            read_tree(gb, &c->col_high[i]);
-        c->col_lastval = 0;
-    }
-    if (bundle_num != BINK_SRC_INTRA_DC && bundle_num != BINK_SRC_INTER_DC)
-        read_tree(gb, &c->bundle[bundle_num].tree);
-    c->bundle[bundle_num].cur_dec =
-    c->bundle[bundle_num].cur_ptr = c->bundle[bundle_num].data;
-}
-
-/**
- * common check before starting decoding bundle data
- *
- * @param gb context for reading bits
- * @param b  bundle
- * @param t  variable where number of elements to decode will be stored
- */
-#define CHECK_READ_VAL(gb, b, t) \
-    if (!b->cur_dec || (b->cur_dec > b->cur_ptr)) \
-        return 0; \
-    t = get_bits(gb, b->len); \
-    if (!t) { \
-        b->cur_dec = NULL; \
-        return 0; \
-    } \
-
-static int read_runs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
-{
-    int t, v;
-    const uint8_t *dec_end;
-
-    CHECK_READ_VAL(gb, b, t);
-    dec_end = b->cur_dec + t;
-    if (dec_end > b->data_end) {
-        av_log(avctx, AV_LOG_ERROR, "Run value went out of bounds\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (get_bits1(gb)) {
-        v = get_bits(gb, 4);
-        memset(b->cur_dec, v, t);
-        b->cur_dec += t;
-    } else {
-        while (b->cur_dec < dec_end)
-            *b->cur_dec++ = GET_HUFF(gb, b->tree);
-    }
-    return 0;
-}
-
-static int read_motion_values(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
-{
-    int t, sign, v;
-    const uint8_t *dec_end;
-
-    CHECK_READ_VAL(gb, b, t);
-    dec_end = b->cur_dec + t;
-    if (dec_end > b->data_end) {
-        av_log(avctx, AV_LOG_ERROR, "Too many motion values\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (get_bits1(gb)) {
-        v = get_bits(gb, 4);
-        if (v) {
-            sign = -get_bits1(gb);
-            v = (v ^ sign) - sign;
-        }
-        memset(b->cur_dec, v, t);
-        b->cur_dec += t;
-    } else {
-        while (b->cur_dec < dec_end) {
-            v = GET_HUFF(gb, b->tree);
-            if (v) {
-                sign = -get_bits1(gb);
-                v = (v ^ sign) - sign;
-            }
-            *b->cur_dec++ = v;
-        }
-    }
-    return 0;
-}
-
-static const uint8_t bink_rlelens[4] = { 4, 8, 12, 32 };
-
-static int read_block_types(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
-{
-    int t, v;
-    int last = 0;
-    const uint8_t *dec_end;
-
-    CHECK_READ_VAL(gb, b, t);
-    dec_end = b->cur_dec + t;
-    if (dec_end > b->data_end) {
-        av_log(avctx, AV_LOG_ERROR, "Too many block type values\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (get_bits1(gb)) {
-        v = get_bits(gb, 4);
-        memset(b->cur_dec, v, t);
-        b->cur_dec += t;
-    } else {
-        while (b->cur_dec < dec_end) {
-            v = GET_HUFF(gb, b->tree);
-            if (v < 12) {
-                last = v;
-                *b->cur_dec++ = v;
-            } else {
-                int run = bink_rlelens[v - 12];
-
-                if (dec_end - b->cur_dec < run)
-                    return AVERROR_INVALIDDATA;
-                memset(b->cur_dec, last, run);
-                b->cur_dec += run;
-            }
-        }
-    }
-    return 0;
-}
-
-static int read_patterns(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
-{
-    int t, v;
-    const uint8_t *dec_end;
-
-    CHECK_READ_VAL(gb, b, t);
-    dec_end = b->cur_dec + t;
-    if (dec_end > b->data_end) {
-        av_log(avctx, AV_LOG_ERROR, "Too many pattern values\n");
-        return AVERROR_INVALIDDATA;
-    }
-    while (b->cur_dec < dec_end) {
-        v  = GET_HUFF(gb, b->tree);
-        v |= GET_HUFF(gb, b->tree) << 4;
-        *b->cur_dec++ = v;
-    }
-
-    return 0;
-}
-
-static int read_colors(GetBitContext *gb, Bundle *b, BinkContext *c)
-{
-    int t, sign, v;
-    const uint8_t *dec_end;
-
-    CHECK_READ_VAL(gb, b, t);
-    dec_end = b->cur_dec + t;
-    if (dec_end > b->data_end) {
-        av_log(c->avctx, AV_LOG_ERROR, "Too many color values\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (get_bits1(gb)) {
-        c->col_lastval = GET_HUFF(gb, c->col_high[c->col_lastval]);
-        v = GET_HUFF(gb, b->tree);
-        v = (c->col_lastval << 4) | v;
-        if (c->version < 'i') {
-            sign = ((int8_t) v) >> 7;
-            v = ((v & 0x7F) ^ sign) - sign;
-            v += 0x80;
-        }
-        memset(b->cur_dec, v, t);
-        b->cur_dec += t;
-    } else {
-        while (b->cur_dec < dec_end) {
-            c->col_lastval = GET_HUFF(gb, c->col_high[c->col_lastval]);
-            v = GET_HUFF(gb, b->tree);
-            v = (c->col_lastval << 4) | v;
-            if (c->version < 'i') {
-                sign = ((int8_t) v) >> 7;
-                v = ((v & 0x7F) ^ sign) - sign;
-                v += 0x80;
-            }
-            *b->cur_dec++ = v;
-        }
-    }
-    return 0;
-}
-
-/** number of bits used to store first DC value in bundle */
-#define DC_START_BITS 11
-
-static int read_dcs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b,
-                    int start_bits, int has_sign)
-{
-    int i, j, len, len2, bsize, sign, v, v2;
-    int16_t *dst     = (int16_t*)b->cur_dec;
-    int16_t *dst_end = (int16_t*)b->data_end;
-
-    CHECK_READ_VAL(gb, b, len);
-    v = get_bits(gb, start_bits - has_sign);
-    if (v && has_sign) {
-        sign = -get_bits1(gb);
-        v = (v ^ sign) - sign;
-    }
-    if (dst_end - dst < 1)
-        return AVERROR_INVALIDDATA;
-    *dst++ = v;
-    len--;
-    for (i = 0; i < len; i += 8) {
-        len2 = FFMIN(len - i, 8);
-        if (dst_end - dst < len2)
-            return AVERROR_INVALIDDATA;
-        bsize = get_bits(gb, 4);
-        if (bsize) {
-            for (j = 0; j < len2; j++) {
-                v2 = get_bits(gb, bsize);
-                if (v2) {
-                    sign = -get_bits1(gb);
-                    v2 = (v2 ^ sign) - sign;
-                }
-                v += v2;
-                *dst++ = v;
-                if (v < -32768 || v > 32767) {
-                    av_log(avctx, AV_LOG_ERROR, "DC value went out of bounds: %d\n", v);
-                    return AVERROR_INVALIDDATA;
-                }
-            }
-        } else {
-            for (j = 0; j < len2; j++)
-                *dst++ = v;
-        }
-    }
-
-    b->cur_dec = (uint8_t*)dst;
-    return 0;
-}
-
-/**
- * Retrieve next value from bundle.
- *
- * @param c      decoder context
- * @param bundle bundle number
- */
-static inline int get_value(BinkContext *c, int bundle)
-{
-    int ret;
-
-    if (bundle < BINK_SRC_X_OFF || bundle == BINK_SRC_RUN)
-        return *c->bundle[bundle].cur_ptr++;
-    if (bundle == BINK_SRC_X_OFF || bundle == BINK_SRC_Y_OFF)
-        return (int8_t)*c->bundle[bundle].cur_ptr++;
-    ret = *(int16_t*)c->bundle[bundle].cur_ptr;
-    c->bundle[bundle].cur_ptr += 2;
-    return ret;
-}
-
-static av_cold void binkb_init_bundle(BinkContext *c, int bundle_num)
-{
-    c->bundle[bundle_num].cur_dec =
-    c->bundle[bundle_num].cur_ptr = c->bundle[bundle_num].data;
-    c->bundle[bundle_num].len = 13;
-}
-
-static av_cold void binkb_init_bundles(BinkContext *c)
-{
-    int i;
-    for (i = 0; i < BINKB_NB_SRC; i++)
-        binkb_init_bundle(c, i);
-}
-
-static int binkb_read_bundle(BinkContext *c, GetBitContext *gb, int bundle_num)
-{
-    const int bits = binkb_bundle_sizes[bundle_num];
-    const int mask = 1 << (bits - 1);
-    const int issigned = binkb_bundle_signed[bundle_num];
-    Bundle *b = &c->bundle[bundle_num];
-    int i, len;
-
-    CHECK_READ_VAL(gb, b, len);
-    if (b->data_end - b->cur_dec < len * (1 + (bits > 8)))
-        return AVERROR_INVALIDDATA;
-    if (bits <= 8) {
-        if (!issigned) {
-            for (i = 0; i < len; i++)
-                *b->cur_dec++ = get_bits(gb, bits);
-        } else {
-            for (i = 0; i < len; i++)
-                *b->cur_dec++ = get_bits(gb, bits) - mask;
-        }
-    } else {
-        int16_t *dst = (int16_t*)b->cur_dec;
-
-        if (!issigned) {
-            for (i = 0; i < len; i++)
-                *dst++ = get_bits(gb, bits);
-        } else {
-            for (i = 0; i < len; i++)
-                *dst++ = get_bits(gb, bits) - mask;
-        }
-        b->cur_dec = (uint8_t*)dst;
-    }
-    return 0;
-}
-
-static inline int binkb_get_value(BinkContext *c, int bundle_num)
-{
-    int16_t ret;
-    const int bits = binkb_bundle_sizes[bundle_num];
-
-    if (bits <= 8) {
-        int val = *c->bundle[bundle_num].cur_ptr++;
-        return binkb_bundle_signed[bundle_num] ? (int8_t)val : val;
-    }
-    ret = *(int16_t*)c->bundle[bundle_num].cur_ptr;
-    c->bundle[bundle_num].cur_ptr += 2;
-    return ret;
-}
-
-/**
- * Read 8x8 block of DCT coefficients.
- *
- * @param gb       context for reading bits
- * @param block    place for storing coefficients
- * @param scan     scan order table
- * @param quant_matrices quantization matrices
- * @return 0 for success, negative value in other cases
- */
-static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *scan,
-                           const int32_t quant_matrices[16][64], int q)
-{
-    int coef_list[128];
-    int mode_list[128];
-    int i, t, bits, ccoef, mode, sign;
-    int list_start = 64, list_end = 64, list_pos;
-    int coef_count = 0;
-    int coef_idx[64];
-    int quant_idx;
-    const int32_t *quant;
-
-    coef_list[list_end] = 4;  mode_list[list_end++] = 0;
-    coef_list[list_end] = 24; mode_list[list_end++] = 0;
-    coef_list[list_end] = 44; mode_list[list_end++] = 0;
-    coef_list[list_end] = 1;  mode_list[list_end++] = 3;
-    coef_list[list_end] = 2;  mode_list[list_end++] = 3;
-    coef_list[list_end] = 3;  mode_list[list_end++] = 3;
-
-    for (bits = get_bits(gb, 4) - 1; bits >= 0; bits--) {
-        list_pos = list_start;
-        while (list_pos < list_end) {
-            if (!(mode_list[list_pos] | coef_list[list_pos]) || !get_bits1(gb)) {
-                list_pos++;
-                continue;
-            }
-            ccoef = coef_list[list_pos];
-            mode  = mode_list[list_pos];
-            switch (mode) {
-            case 0:
-                coef_list[list_pos] = ccoef + 4;
-                mode_list[list_pos] = 1;
-            case 2:
-                if (mode == 2) {
-                    coef_list[list_pos]   = 0;
-                    mode_list[list_pos++] = 0;
-                }
-                for (i = 0; i < 4; i++, ccoef++) {
-                    if (get_bits1(gb)) {
-                        coef_list[--list_start] = ccoef;
-                        mode_list[  list_start] = 3;
-                    } else {
-                        if (!bits) {
-                            t = 1 - (get_bits1(gb) << 1);
-                        } else {
-                            t = get_bits(gb, bits) | 1 << bits;
-                            sign = -get_bits1(gb);
-                            t = (t ^ sign) - sign;
-                        }
-                        block[scan[ccoef]] = t;
-                        coef_idx[coef_count++] = ccoef;
-                    }
-                }
-                break;
-            case 1:
-                mode_list[list_pos] = 2;
-                for (i = 0; i < 3; i++) {
-                    ccoef += 4;
-                    coef_list[list_end]   = ccoef;
-                    mode_list[list_end++] = 2;
-                }
-                break;
-            case 3:
-                if (!bits) {
-                    t = 1 - (get_bits1(gb) << 1);
-                } else {
-                    t = get_bits(gb, bits) | 1 << bits;
-                    sign = -get_bits1(gb);
-                    t = (t ^ sign) - sign;
-                }
-                block[scan[ccoef]] = t;
-                coef_idx[coef_count++] = ccoef;
-                coef_list[list_pos]   = 0;
-                mode_list[list_pos++] = 0;
-                break;
-            }
-        }
-    }
-
-    if (q == -1) {
-        quant_idx = get_bits(gb, 4);
-    } else {
-        quant_idx = q;
-    }
-
-    if (quant_idx >= 16)
-        return AVERROR_INVALIDDATA;
-
-    quant = quant_matrices[quant_idx];
-
-    block[0] = (block[0] * quant[0]) >> 11;
-    for (i = 0; i < coef_count; i++) {
-        int idx = coef_idx[i];
-        block[scan[idx]] = (block[scan[idx]] * quant[idx]) >> 11;
-    }
-
-    return 0;
-}
-
-/**
- * Read 8x8 block with residue after motion compensation.
- *
- * @param gb          context for reading bits
- * @param block       place to store read data
- * @param masks_count number of masks to decode
- * @return 0 on success, negative value in other cases
- */
-static int read_residue(GetBitContext *gb, int16_t block[64], int masks_count)
-{
-    int coef_list[128];
-    int mode_list[128];
-    int i, sign, mask, ccoef, mode;
-    int list_start = 64, list_end = 64, list_pos;
-    int nz_coeff[64];
-    int nz_coeff_count = 0;
-
-    coef_list[list_end] =  4; mode_list[list_end++] = 0;
-    coef_list[list_end] = 24; mode_list[list_end++] = 0;
-    coef_list[list_end] = 44; mode_list[list_end++] = 0;
-    coef_list[list_end] =  0; mode_list[list_end++] = 2;
-
-    for (mask = 1 << get_bits(gb, 3); mask; mask >>= 1) {
-        for (i = 0; i < nz_coeff_count; i++) {
-            if (!get_bits1(gb))
-                continue;
-            if (block[nz_coeff[i]] < 0)
-                block[nz_coeff[i]] -= mask;
-            else
-                block[nz_coeff[i]] += mask;
-            masks_count--;
-            if (masks_count < 0)
-                return 0;
-        }
-        list_pos = list_start;
-        while (list_pos < list_end) {
-            if (!(coef_list[list_pos] | mode_list[list_pos]) || !get_bits1(gb)) {
-                list_pos++;
-                continue;
-            }
-            ccoef = coef_list[list_pos];
-            mode  = mode_list[list_pos];
-            switch (mode) {
-            case 0:
-                coef_list[list_pos] = ccoef + 4;
-                mode_list[list_pos] = 1;
-            case 2:
-                if (mode == 2) {
-                    coef_list[list_pos]   = 0;
-                    mode_list[list_pos++] = 0;
-                }
-                for (i = 0; i < 4; i++, ccoef++) {
-                    if (get_bits1(gb)) {
-                        coef_list[--list_start] = ccoef;
-                        mode_list[  list_start] = 3;
-                    } else {
-                        nz_coeff[nz_coeff_count++] = bink_scan[ccoef];
-                        sign = -get_bits1(gb);
-                        block[bink_scan[ccoef]] = (mask ^ sign) - sign;
-                        masks_count--;
-                        if (masks_count < 0)
-                            return 0;
-                    }
-                }
-                break;
-            case 1:
-                mode_list[list_pos] = 2;
-                for (i = 0; i < 3; i++) {
-                    ccoef += 4;
-                    coef_list[list_end]   = ccoef;
-                    mode_list[list_end++] = 2;
-                }
-                break;
-            case 3:
-                nz_coeff[nz_coeff_count++] = bink_scan[ccoef];
-                sign = -get_bits1(gb);
-                block[bink_scan[ccoef]] = (mask ^ sign) - sign;
-                coef_list[list_pos]   = 0;
-                mode_list[list_pos++] = 0;
-                masks_count--;
-                if (masks_count < 0)
-                    return 0;
-                break;
-            }
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Copy 8x8 block from source to destination, where src and dst may be overlapped
- */
-static inline void put_pixels8x8_overlapped(uint8_t *dst, uint8_t *src, int stride)
-{
-    uint8_t tmp[64];
-    int i;
-    for (i = 0; i < 8; i++)
-        memcpy(tmp + i*8, src + i*stride, 8);
-    for (i = 0; i < 8; i++)
-        memcpy(dst + i*stride, tmp + i*8, 8);
-}
-
-static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
-                              int plane_idx, int is_key, int is_chroma)
-{
-    int blk, ret;
-    int i, j, bx, by;
-    uint8_t *dst, *ref, *ref_start, *ref_end;
-    int v, col[2];
-    const uint8_t *scan;
-    int xoff, yoff;
-    LOCAL_ALIGNED_16(int16_t, block, [64]);
-    LOCAL_ALIGNED_16(int32_t, dctblock, [64]);
-    int coordmap[64];
-    int ybias = is_key ? -15 : 0;
-    int qp;
-
-    const int stride = frame->linesize[plane_idx];
-    int bw = is_chroma ? (c->avctx->width  + 15) >> 4 : (c->avctx->width  + 7) >> 3;
-    int bh = is_chroma ? (c->avctx->height + 15) >> 4 : (c->avctx->height + 7) >> 3;
-
-    binkb_init_bundles(c);
-    ref_start = frame->data[plane_idx];
-    ref_end   = frame->data[plane_idx] + (bh * frame->linesize[plane_idx] + bw) * 8;
-
-    for (i = 0; i < 64; i++)
-        coordmap[i] = (i & 7) + (i >> 3) * stride;
-
-    for (by = 0; by < bh; by++) {
-        for (i = 0; i < BINKB_NB_SRC; i++) {
-            if ((ret = binkb_read_bundle(c, gb, i)) < 0)
-                return ret;
-        }
-
-        dst  = frame->data[plane_idx]  + 8*by*stride;
-        for (bx = 0; bx < bw; bx++, dst += 8) {
-            blk = binkb_get_value(c, BINKB_SRC_BLOCK_TYPES);
-            switch (blk) {
-            case 0:
-                break;
-            case 1:
-                scan = bink_patterns[get_bits(gb, 4)];
-                i = 0;
-                do {
-                    int mode, run;
-
-                    mode = get_bits1(gb);
-                    run = get_bits(gb, binkb_runbits[i]) + 1;
-
-                    i += run;
-                    if (i > 64) {
-                        av_log(c->avctx, AV_LOG_ERROR, "Run went out of bounds\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    if (mode) {
-                        v = binkb_get_value(c, BINKB_SRC_COLORS);
-                        for (j = 0; j < run; j++)
-                            dst[coordmap[*scan++]] = v;
-                    } else {
-                        for (j = 0; j < run; j++)
-                            dst[coordmap[*scan++]] = binkb_get_value(c, BINKB_SRC_COLORS);
-                    }
-                } while (i < 63);
-                if (i == 63)
-                    dst[coordmap[*scan++]] = binkb_get_value(c, BINKB_SRC_COLORS);
-                break;
-            case 2:
-                memset(dctblock, 0, sizeof(*dctblock) * 64);
-                dctblock[0] = binkb_get_value(c, BINKB_SRC_INTRA_DC);
-                qp = binkb_get_value(c, BINKB_SRC_INTRA_Q);
-                read_dct_coeffs(gb, dctblock, bink_scan, binkb_intra_quant, qp);
-                c->bdsp.idct_put(dst, stride, dctblock);
-                break;
-            case 3:
-                xoff = binkb_get_value(c, BINKB_SRC_X_OFF);
-                yoff = binkb_get_value(c, BINKB_SRC_Y_OFF) + ybias;
-                ref = dst + xoff + yoff * stride;
-                if (ref < ref_start || ref + 8*stride > ref_end) {
-                    av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n");
-                } else if (ref + 8*stride < dst || ref >= dst + 8*stride) {
-                    c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
-                } else {
-                    put_pixels8x8_overlapped(dst, ref, stride);
-                }
-                c->dsp.clear_block(block);
-                v = binkb_get_value(c, BINKB_SRC_INTER_COEFS);
-                read_residue(gb, block, v);
-                c->dsp.add_pixels8(dst, block, stride);
-                break;
-            case 4:
-                xoff = binkb_get_value(c, BINKB_SRC_X_OFF);
-                yoff = binkb_get_value(c, BINKB_SRC_Y_OFF) + ybias;
-                ref = dst + xoff + yoff * stride;
-                if (ref < ref_start || ref + 8 * stride > ref_end) {
-                    av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n");
-                } else if (ref + 8*stride < dst || ref >= dst + 8*stride) {
-                    c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
-                } else {
-                    put_pixels8x8_overlapped(dst, ref, stride);
-                }
-                memset(dctblock, 0, sizeof(*dctblock) * 64);
-                dctblock[0] = binkb_get_value(c, BINKB_SRC_INTER_DC);
-                qp = binkb_get_value(c, BINKB_SRC_INTER_Q);
-                read_dct_coeffs(gb, dctblock, bink_scan, binkb_inter_quant, qp);
-                c->bdsp.idct_add(dst, stride, dctblock);
-                break;
-            case 5:
-                v = binkb_get_value(c, BINKB_SRC_COLORS);
-                c->dsp.fill_block_tab[1](dst, v, stride, 8);
-                break;
-            case 6:
-                for (i = 0; i < 2; i++)
-                    col[i] = binkb_get_value(c, BINKB_SRC_COLORS);
-                for (i = 0; i < 8; i++) {
-                    v = binkb_get_value(c, BINKB_SRC_PATTERN);
-                    for (j = 0; j < 8; j++, v >>= 1)
-                        dst[i*stride + j] = col[v & 1];
-                }
-                break;
-            case 7:
-                xoff = binkb_get_value(c, BINKB_SRC_X_OFF);
-                yoff = binkb_get_value(c, BINKB_SRC_Y_OFF) + ybias;
-                ref = dst + xoff + yoff * stride;
-                if (ref < ref_start || ref + 8 * stride > ref_end) {
-                    av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n");
-                } else if (ref + 8*stride < dst || ref >= dst + 8*stride) {
-                    c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
-                } else {
-                    put_pixels8x8_overlapped(dst, ref, stride);
-                }
-                break;
-            case 8:
-                for (i = 0; i < 8; i++)
-                    memcpy(dst + i*stride, c->bundle[BINKB_SRC_COLORS].cur_ptr + i*8, 8);
-                c->bundle[BINKB_SRC_COLORS].cur_ptr += 64;
-                break;
-            default:
-                av_log(c->avctx, AV_LOG_ERROR, "Unknown block type %d\n", blk);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-    if (get_bits_count(gb) & 0x1F) //next plane data starts at 32-bit boundary
-        skip_bits_long(gb, 32 - (get_bits_count(gb) & 0x1F));
-
-    return 0;
-}
-
-static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
-                             int plane_idx, int is_chroma)
-{
-    int blk, ret;
-    int i, j, bx, by;
-    uint8_t *dst, *prev, *ref, *ref_start, *ref_end;
-    int v, col[2];
-    const uint8_t *scan;
-    int xoff, yoff;
-    LOCAL_ALIGNED_16(int16_t, block, [64]);
-    LOCAL_ALIGNED_16(uint8_t, ublock, [64]);
-    LOCAL_ALIGNED_16(int32_t, dctblock, [64]);
-    int coordmap[64];
-
-    const int stride = frame->linesize[plane_idx];
-    int bw = is_chroma ? (c->avctx->width  + 15) >> 4 : (c->avctx->width  + 7) >> 3;
-    int bh = is_chroma ? (c->avctx->height + 15) >> 4 : (c->avctx->height + 7) >> 3;
-    int width = c->avctx->width >> is_chroma;
-
-    init_lengths(c, FFMAX(width, 8), bw);
-    for (i = 0; i < BINK_NB_SRC; i++)
-        read_bundle(gb, c, i);
-
-    ref_start = c->last->data[plane_idx] ? c->last->data[plane_idx]
-                                         : frame->data[plane_idx];
-    ref_end   = ref_start
-                + (bw - 1 + c->last->linesize[plane_idx] * (bh - 1)) * 8;
-
-    for (i = 0; i < 64; i++)
-        coordmap[i] = (i & 7) + (i >> 3) * stride;
-
-    for (by = 0; by < bh; by++) {
-        if ((ret = read_block_types(c->avctx, gb, &c->bundle[BINK_SRC_BLOCK_TYPES])) < 0)
-            return ret;
-        if ((ret = read_block_types(c->avctx, gb, &c->bundle[BINK_SRC_SUB_BLOCK_TYPES])) < 0)
-            return ret;
-        if ((ret = read_colors(gb, &c->bundle[BINK_SRC_COLORS], c)) < 0)
-            return ret;
-        if ((ret = read_patterns(c->avctx, gb, &c->bundle[BINK_SRC_PATTERN])) < 0)
-            return ret;
-        if ((ret = read_motion_values(c->avctx, gb, &c->bundle[BINK_SRC_X_OFF])) < 0)
-            return ret;
-        if ((ret = read_motion_values(c->avctx, gb, &c->bundle[BINK_SRC_Y_OFF])) < 0)
-            return ret;
-        if ((ret = read_dcs(c->avctx, gb, &c->bundle[BINK_SRC_INTRA_DC], DC_START_BITS, 0)) < 0)
-            return ret;
-        if ((ret = read_dcs(c->avctx, gb, &c->bundle[BINK_SRC_INTER_DC], DC_START_BITS, 1)) < 0)
-            return ret;
-        if ((ret = read_runs(c->avctx, gb, &c->bundle[BINK_SRC_RUN])) < 0)
-            return ret;
-
-        if (by == bh)
-            break;
-        dst  = frame->data[plane_idx]  + 8*by*stride;
-        prev = (c->last->data[plane_idx] ? c->last->data[plane_idx]
-                                         : frame->data[plane_idx]) + 8*by*stride;
-        for (bx = 0; bx < bw; bx++, dst += 8, prev += 8) {
-            blk = get_value(c, BINK_SRC_BLOCK_TYPES);
-            // 16x16 block type on odd line means part of the already decoded block, so skip it
-            if ((by & 1) && blk == SCALED_BLOCK) {
-                bx++;
-                dst  += 8;
-                prev += 8;
-                continue;
-            }
-            switch (blk) {
-            case SKIP_BLOCK:
-                c->hdsp.put_pixels_tab[1][0](dst, prev, stride, 8);
-                break;
-            case SCALED_BLOCK:
-                blk = get_value(c, BINK_SRC_SUB_BLOCK_TYPES);
-                switch (blk) {
-                case RUN_BLOCK:
-                    scan = bink_patterns[get_bits(gb, 4)];
-                    i = 0;
-                    do {
-                        int run = get_value(c, BINK_SRC_RUN) + 1;
-
-                        i += run;
-                        if (i > 64) {
-                            av_log(c->avctx, AV_LOG_ERROR, "Run went out of bounds\n");
-                            return AVERROR_INVALIDDATA;
-                        }
-                        if (get_bits1(gb)) {
-                            v = get_value(c, BINK_SRC_COLORS);
-                            for (j = 0; j < run; j++)
-                                ublock[*scan++] = v;
-                        } else {
-                            for (j = 0; j < run; j++)
-                                ublock[*scan++] = get_value(c, BINK_SRC_COLORS);
-                        }
-                    } while (i < 63);
-                    if (i == 63)
-                        ublock[*scan++] = get_value(c, BINK_SRC_COLORS);
-                    break;
-                case INTRA_BLOCK:
-                    memset(dctblock, 0, sizeof(*dctblock) * 64);
-                    dctblock[0] = get_value(c, BINK_SRC_INTRA_DC);
-                    read_dct_coeffs(gb, dctblock, bink_scan, bink_intra_quant, -1);
-                    c->bdsp.idct_put(ublock, 8, dctblock);
-                    break;
-                case FILL_BLOCK:
-                    v = get_value(c, BINK_SRC_COLORS);
-                    c->dsp.fill_block_tab[0](dst, v, stride, 16);
-                    break;
-                case PATTERN_BLOCK:
-                    for (i = 0; i < 2; i++)
-                        col[i] = get_value(c, BINK_SRC_COLORS);
-                    for (j = 0; j < 8; j++) {
-                        v = get_value(c, BINK_SRC_PATTERN);
-                        for (i = 0; i < 8; i++, v >>= 1)
-                            ublock[i + j*8] = col[v & 1];
-                    }
-                    break;
-                case RAW_BLOCK:
-                    for (j = 0; j < 8; j++)
-                        for (i = 0; i < 8; i++)
-                            ublock[i + j*8] = get_value(c, BINK_SRC_COLORS);
-                    break;
-                default:
-                    av_log(c->avctx, AV_LOG_ERROR, "Incorrect 16x16 block type %d\n", blk);
-                    return AVERROR_INVALIDDATA;
-                }
-                if (blk != FILL_BLOCK)
-                c->bdsp.scale_block(ublock, dst, stride);
-                bx++;
-                dst  += 8;
-                prev += 8;
-                break;
-            case MOTION_BLOCK:
-                xoff = get_value(c, BINK_SRC_X_OFF);
-                yoff = get_value(c, BINK_SRC_Y_OFF);
-                ref = prev + xoff + yoff * stride;
-                if (ref < ref_start || ref > ref_end) {
-                    av_log(c->avctx, AV_LOG_ERROR, "Copy out of bounds @%d, %d\n",
-                           bx*8 + xoff, by*8 + yoff);
-                    return AVERROR_INVALIDDATA;
-                }
-                c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
-                break;
-            case RUN_BLOCK:
-                scan = bink_patterns[get_bits(gb, 4)];
-                i = 0;
-                do {
-                    int run = get_value(c, BINK_SRC_RUN) + 1;
-
-                    i += run;
-                    if (i > 64) {
-                        av_log(c->avctx, AV_LOG_ERROR, "Run went out of bounds\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    if (get_bits1(gb)) {
-                        v = get_value(c, BINK_SRC_COLORS);
-                        for (j = 0; j < run; j++)
-                            dst[coordmap[*scan++]] = v;
-                    } else {
-                        for (j = 0; j < run; j++)
-                            dst[coordmap[*scan++]] = get_value(c, BINK_SRC_COLORS);
-                    }
-                } while (i < 63);
-                if (i == 63)
-                    dst[coordmap[*scan++]] = get_value(c, BINK_SRC_COLORS);
-                break;
-            case RESIDUE_BLOCK:
-                xoff = get_value(c, BINK_SRC_X_OFF);
-                yoff = get_value(c, BINK_SRC_Y_OFF);
-                ref = prev + xoff + yoff * stride;
-                if (ref < ref_start || ref > ref_end) {
-                    av_log(c->avctx, AV_LOG_ERROR, "Copy out of bounds @%d, %d\n",
-                           bx*8 + xoff, by*8 + yoff);
-                    return AVERROR_INVALIDDATA;
-                }
-                c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
-                c->dsp.clear_block(block);
-                v = get_bits(gb, 7);
-                read_residue(gb, block, v);
-                c->dsp.add_pixels8(dst, block, stride);
-                break;
-            case INTRA_BLOCK:
-                memset(dctblock, 0, sizeof(*dctblock) * 64);
-                dctblock[0] = get_value(c, BINK_SRC_INTRA_DC);
-                read_dct_coeffs(gb, dctblock, bink_scan, bink_intra_quant, -1);
-                c->bdsp.idct_put(dst, stride, dctblock);
-                break;
-            case FILL_BLOCK:
-                v = get_value(c, BINK_SRC_COLORS);
-                c->dsp.fill_block_tab[1](dst, v, stride, 8);
-                break;
-            case INTER_BLOCK:
-                xoff = get_value(c, BINK_SRC_X_OFF);
-                yoff = get_value(c, BINK_SRC_Y_OFF);
-                ref = prev + xoff + yoff * stride;
-                c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
-                memset(dctblock, 0, sizeof(*dctblock) * 64);
-                dctblock[0] = get_value(c, BINK_SRC_INTER_DC);
-                read_dct_coeffs(gb, dctblock, bink_scan, bink_inter_quant, -1);
-                c->bdsp.idct_add(dst, stride, dctblock);
-                break;
-            case PATTERN_BLOCK:
-                for (i = 0; i < 2; i++)
-                    col[i] = get_value(c, BINK_SRC_COLORS);
-                for (i = 0; i < 8; i++) {
-                    v = get_value(c, BINK_SRC_PATTERN);
-                    for (j = 0; j < 8; j++, v >>= 1)
-                        dst[i*stride + j] = col[v & 1];
-                }
-                break;
-            case RAW_BLOCK:
-                for (i = 0; i < 8; i++)
-                    memcpy(dst + i*stride, c->bundle[BINK_SRC_COLORS].cur_ptr + i*8, 8);
-                c->bundle[BINK_SRC_COLORS].cur_ptr += 64;
-                break;
-            default:
-                av_log(c->avctx, AV_LOG_ERROR, "Unknown block type %d\n", blk);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-    if (get_bits_count(gb) & 0x1F) //next plane data starts at 32-bit boundary
-        skip_bits_long(gb, 32 - (get_bits_count(gb) & 0x1F));
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
-{
-    BinkContext * const c = avctx->priv_data;
-    AVFrame *frame = data;
-    GetBitContext gb;
-    int plane, plane_idx, ret;
-    int bits_count = pkt->size << 3;
-
-    if (c->version > 'b') {
-        if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-    } else {
-        if ((ret = ff_reget_buffer(avctx, c->last)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-            return ret;
-        }
-        if ((ret = av_frame_ref(frame, c->last)) < 0)
-            return ret;
-    }
-
-    init_get_bits(&gb, pkt->data, bits_count);
-    if (c->has_alpha) {
-        if (c->version >= 'i')
-            skip_bits_long(&gb, 32);
-        if ((ret = bink_decode_plane(c, frame, &gb, 3, 0)) < 0)
-            return ret;
-    }
-    if (c->version >= 'i')
-        skip_bits_long(&gb, 32);
-
-    for (plane = 0; plane < 3; plane++) {
-        plane_idx = (!plane || !c->swap_planes) ? plane : (plane ^ 3);
-
-        if (c->version > 'b') {
-            if ((ret = bink_decode_plane(c, frame, &gb, plane_idx, !!plane)) < 0)
-                return ret;
-        } else {
-            if ((ret = binkb_decode_plane(c, frame, &gb, plane_idx,
-                                          !avctx->frame_number, !!plane)) < 0)
-                return ret;
-        }
-        if (get_bits_count(&gb) >= bits_count)
-            break;
-    }
-    emms_c();
-
-    if (c->version > 'b') {
-        av_frame_unref(c->last);
-        if ((ret = av_frame_ref(c->last, frame)) < 0)
-            return ret;
-    }
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return pkt->size;
-}
-
-/**
- * Caclulate quantization tables for version b
- */
-static av_cold void binkb_calc_quant(void)
-{
-    uint8_t inv_bink_scan[64];
-    double s[64];
-    int i, j;
-
-    for (j = 0; j < 8; j++) {
-        for (i = 0; i < 8; i++) {
-            if (j && j != 4)
-               if (i && i != 4)
-                   s[j*8 + i] = cos(j * M_PI/16.0) * cos(i * M_PI/16.0) * 2.0;
-               else
-                   s[j*8 + i] = cos(j * M_PI/16.0) * sqrt(2.0);
-            else
-               if (i && i != 4)
-                   s[j*8 + i] = cos(i * M_PI/16.0) * sqrt(2.0);
-               else
-                   s[j*8 + i] = 1.0;
-        }
-    }
-
-    for (i = 0; i < 64; i++)
-        inv_bink_scan[bink_scan[i]] = i;
-
-    for (j = 0; j < 16; j++) {
-        for (i = 0; i < 64; i++) {
-            int k = inv_bink_scan[i];
-            if (s[i] == 1.0) {
-                binkb_intra_quant[j][k] = (1L << 12) * binkb_intra_seed[i] *
-                                          binkb_num[j]/binkb_den[j];
-                binkb_inter_quant[j][k] = (1L << 12) * binkb_inter_seed[i] *
-                                          binkb_num[j]/binkb_den[j];
-            } else {
-                binkb_intra_quant[j][k] = (1L << 12) * binkb_intra_seed[i] * s[i] *
-                                          binkb_num[j]/(double)binkb_den[j];
-                binkb_inter_quant[j][k] = (1L << 12) * binkb_inter_seed[i] * s[i] *
-                                          binkb_num[j]/(double)binkb_den[j];
-            }
-        }
-    }
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    BinkContext * const c = avctx->priv_data;
-    static VLC_TYPE table[16 * 128][2];
-    static int binkb_initialised = 0;
-    int i, ret;
-    int flags;
-
-    c->version = avctx->codec_tag >> 24;
-    if (avctx->extradata_size < 4) {
-        av_log(avctx, AV_LOG_ERROR, "Extradata missing or too short\n");
-        return AVERROR_INVALIDDATA;
-    }
-    flags = AV_RL32(avctx->extradata);
-    c->has_alpha = flags & BINK_FLAG_ALPHA;
-    c->swap_planes = c->version >= 'h';
-    if (!bink_trees[15].table) {
-        for (i = 0; i < 16; i++) {
-            const int maxbits = bink_tree_lens[i][15];
-            bink_trees[i].table = table + i*128;
-            bink_trees[i].table_allocated = 1 << maxbits;
-            init_vlc(&bink_trees[i], maxbits, 16,
-                     bink_tree_lens[i], 1, 1,
-                     bink_tree_bits[i], 1, 1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-        }
-    }
-    c->avctx = avctx;
-
-    c->last = av_frame_alloc();
-    if (!c->last)
-        return AVERROR(ENOMEM);
-
-    if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
-        return ret;
-
-    avctx->pix_fmt = c->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
-
-    ff_dsputil_init(&c->dsp, avctx);
-    ff_hpeldsp_init(&c->hdsp, avctx->flags);
-    ff_binkdsp_init(&c->bdsp);
-
-    init_bundles(c);
-
-    if (c->version == 'b') {
-        if (!binkb_initialised) {
-            binkb_calc_quant();
-            binkb_initialised = 1;
-        }
-    }
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    BinkContext * const c = avctx->priv_data;
-
-    av_frame_free(&c->last);
-
-    free_bundles(c);
-    return 0;
-}
-
-AVCodec ff_bink_decoder = {
-    .name           = "binkvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("Bink video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_BINKVIDEO,
-    .priv_data_size = sizeof(BinkContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/binkaudio.c b/deps/libav/libavcodec/binkaudio.c
deleted file mode 100644
index ddaa613..0000000
--- a/deps/libav/libavcodec/binkaudio.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * Bink Audio decoder
- * Copyright (c) 2007-2011 Peter Ross (pross at xvid.org)
- * Copyright (c) 2009 Daniel Verkamp (daniel at drv.nu)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Bink Audio decoder
- *
- * Technical details here:
- *  http://wiki.multimedia.cx/index.php?title=Bink_Audio
- */
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "dct.h"
-#include "rdft.h"
-#include "fmtconvert.h"
-#include "internal.h"
-#include "wma.h"
-#include "libavutil/intfloat.h"
-
-static float quant_table[96];
-
-#define MAX_CHANNELS 2
-#define BINK_BLOCK_MAX_SIZE (MAX_CHANNELS << 11)
-
-typedef struct {
-    GetBitContext gb;
-    int version_b;          ///< Bink version 'b'
-    int first;
-    int channels;
-    int frame_len;          ///< transform size (samples)
-    int overlap_len;        ///< overlap size (samples)
-    int block_size;
-    int num_bands;
-    unsigned int *bands;
-    float root;
-    DECLARE_ALIGNED(32, FFTSample, coeffs)[BINK_BLOCK_MAX_SIZE];
-    float previous[MAX_CHANNELS][BINK_BLOCK_MAX_SIZE / 16];  ///< coeffs from previous audio block
-    uint8_t *packet_buffer;
-    union {
-        RDFTContext rdft;
-        DCTContext dct;
-    } trans;
-} BinkAudioContext;
-
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    BinkAudioContext *s = avctx->priv_data;
-    int sample_rate = avctx->sample_rate;
-    int sample_rate_half;
-    int i;
-    int frame_len_bits;
-
-    /* determine frame length */
-    if (avctx->sample_rate < 22050) {
-        frame_len_bits = 9;
-    } else if (avctx->sample_rate < 44100) {
-        frame_len_bits = 10;
-    } else {
-        frame_len_bits = 11;
-    }
-
-    if (avctx->channels > MAX_CHANNELS) {
-        av_log(avctx, AV_LOG_ERROR, "too many channels: %d\n", avctx->channels);
-        return -1;
-    }
-    avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO :
-                                                   AV_CH_LAYOUT_STEREO;
-
-    s->version_b = avctx->extradata && avctx->extradata[3] == 'b';
-
-    if (avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) {
-        // audio is already interleaved for the RDFT format variant
-        avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
-        sample_rate  *= avctx->channels;
-        s->channels = 1;
-        if (!s->version_b)
-            frame_len_bits += av_log2(avctx->channels);
-    } else {
-        s->channels = avctx->channels;
-        avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-    }
-
-    s->frame_len     = 1 << frame_len_bits;
-    s->overlap_len   = s->frame_len / 16;
-    s->block_size    = (s->frame_len - s->overlap_len) * s->channels;
-    sample_rate_half = (sample_rate + 1) / 2;
-    if (avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
-        s->root = 2.0 / (sqrt(s->frame_len) * 32768.0);
-    else
-        s->root = s->frame_len / (sqrt(s->frame_len) * 32768.0);
-    for (i = 0; i < 96; i++) {
-        /* constant is result of 0.066399999/log10(M_E) */
-        quant_table[i] = expf(i * 0.15289164787221953823f) * s->root;
-    }
-
-    /* calculate number of bands */
-    for (s->num_bands = 1; s->num_bands < 25; s->num_bands++)
-        if (sample_rate_half <= ff_wma_critical_freqs[s->num_bands - 1])
-            break;
-
-    s->bands = av_malloc((s->num_bands + 1) * sizeof(*s->bands));
-    if (!s->bands)
-        return AVERROR(ENOMEM);
-
-    /* populate bands data */
-    s->bands[0] = 2;
-    for (i = 1; i < s->num_bands; i++)
-        s->bands[i] = (ff_wma_critical_freqs[i - 1] * s->frame_len / sample_rate_half) & ~1;
-    s->bands[s->num_bands] = s->frame_len;
-
-    s->first = 1;
-
-    if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
-        ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R);
-    else if (CONFIG_BINKAUDIO_DCT_DECODER)
-        ff_dct_init(&s->trans.dct, frame_len_bits, DCT_III);
-    else
-        return -1;
-
-    return 0;
-}
-
-static float get_float(GetBitContext *gb)
-{
-    int power = get_bits(gb, 5);
-    float f = ldexpf(get_bits_long(gb, 23), power - 23);
-    if (get_bits1(gb))
-        f = -f;
-    return f;
-}
-
-static const uint8_t rle_length_tab[16] = {
-    2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 32, 64
-};
-
-/**
- * Decode Bink Audio block
- * @param[out] out Output buffer (must contain s->block_size elements)
- * @return 0 on success, negative error code on failure
- */
-static int decode_block(BinkAudioContext *s, float **out, int use_dct)
-{
-    int ch, i, j, k;
-    float q, quant[25];
-    int width, coeff;
-    GetBitContext *gb = &s->gb;
-
-    if (use_dct)
-        skip_bits(gb, 2);
-
-    for (ch = 0; ch < s->channels; ch++) {
-        FFTSample *coeffs = out[ch];
-
-        if (s->version_b) {
-            if (get_bits_left(gb) < 64)
-                return AVERROR_INVALIDDATA;
-            coeffs[0] = av_int2float(get_bits_long(gb, 32)) * s->root;
-            coeffs[1] = av_int2float(get_bits_long(gb, 32)) * s->root;
-        } else {
-            if (get_bits_left(gb) < 58)
-                return AVERROR_INVALIDDATA;
-            coeffs[0] = get_float(gb) * s->root;
-            coeffs[1] = get_float(gb) * s->root;
-        }
-
-        if (get_bits_left(gb) < s->num_bands * 8)
-            return AVERROR_INVALIDDATA;
-        for (i = 0; i < s->num_bands; i++) {
-            int value = get_bits(gb, 8);
-            quant[i]  = quant_table[FFMIN(value, 95)];
-        }
-
-        k = 0;
-        q = quant[0];
-
-        // parse coefficients
-        i = 2;
-        while (i < s->frame_len) {
-            if (s->version_b) {
-                j = i + 16;
-            } else {
-                int v = get_bits1(gb);
-                if (v) {
-                    v = get_bits(gb, 4);
-                    j = i + rle_length_tab[v] * 8;
-                } else {
-                    j = i + 8;
-                }
-            }
-
-            j = FFMIN(j, s->frame_len);
-
-            width = get_bits(gb, 4);
-            if (width == 0) {
-                memset(coeffs + i, 0, (j - i) * sizeof(*coeffs));
-                i = j;
-                while (s->bands[k] < i)
-                    q = quant[k++];
-            } else {
-                while (i < j) {
-                    if (s->bands[k] == i)
-                        q = quant[k++];
-                    coeff = get_bits(gb, width);
-                    if (coeff) {
-                        int v;
-                        v = get_bits1(gb);
-                        if (v)
-                            coeffs[i] = -q * coeff;
-                        else
-                            coeffs[i] =  q * coeff;
-                    } else {
-                        coeffs[i] = 0.0f;
-                    }
-                    i++;
-                }
-            }
-        }
-
-        if (CONFIG_BINKAUDIO_DCT_DECODER && use_dct) {
-            coeffs[0] /= 0.5;
-            s->trans.dct.dct_calc(&s->trans.dct,  coeffs);
-        }
-        else if (CONFIG_BINKAUDIO_RDFT_DECODER)
-            s->trans.rdft.rdft_calc(&s->trans.rdft, coeffs);
-    }
-
-    for (ch = 0; ch < s->channels; ch++) {
-        int j;
-        int count = s->overlap_len * s->channels;
-        if (!s->first) {
-            j = ch;
-            for (i = 0; i < s->overlap_len; i++, j += s->channels)
-                out[ch][i] = (s->previous[ch][i] * (count - j) +
-                                      out[ch][i] *          j) / count;
-        }
-        memcpy(s->previous[ch], &out[ch][s->frame_len - s->overlap_len],
-               s->overlap_len * sizeof(*s->previous[ch]));
-    }
-
-    s->first = 0;
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    BinkAudioContext * s = avctx->priv_data;
-    av_freep(&s->bands);
-    av_freep(&s->packet_buffer);
-    if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
-        ff_rdft_end(&s->trans.rdft);
-    else if (CONFIG_BINKAUDIO_DCT_DECODER)
-        ff_dct_end(&s->trans.dct);
-
-    return 0;
-}
-
-static void get_bits_align32(GetBitContext *s)
-{
-    int n = (-get_bits_count(s)) & 31;
-    if (n) skip_bits(s, n);
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data,
-                        int *got_frame_ptr, AVPacket *avpkt)
-{
-    BinkAudioContext *s = avctx->priv_data;
-    AVFrame *frame      = data;
-    GetBitContext *gb = &s->gb;
-    int ret, consumed = 0;
-
-    if (!get_bits_left(gb)) {
-        uint8_t *buf;
-        /* handle end-of-stream */
-        if (!avpkt->size) {
-            *got_frame_ptr = 0;
-            return 0;
-        }
-        if (avpkt->size < 4) {
-            av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
-            return AVERROR_INVALIDDATA;
-        }
-        buf = av_realloc(s->packet_buffer, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!buf)
-            return AVERROR(ENOMEM);
-        s->packet_buffer = buf;
-        memcpy(s->packet_buffer, avpkt->data, avpkt->size);
-        init_get_bits(gb, s->packet_buffer, avpkt->size * 8);
-        consumed = avpkt->size;
-
-        /* skip reported size */
-        skip_bits_long(gb, 32);
-    }
-
-    /* get output buffer */
-    frame->nb_samples = s->frame_len;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (decode_block(s, (float **)frame->extended_data,
-                     avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT)) {
-        av_log(avctx, AV_LOG_ERROR, "Incomplete packet\n");
-        return AVERROR_INVALIDDATA;
-    }
-    get_bits_align32(gb);
-
-    frame->nb_samples = s->block_size / avctx->channels;
-    *got_frame_ptr    = 1;
-
-    return consumed;
-}
-
-AVCodec ff_binkaudio_rdft_decoder = {
-    .name           = "binkaudio_rdft",
-    .long_name      = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_BINKAUDIO_RDFT,
-    .priv_data_size = sizeof(BinkAudioContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_DR1,
-};
-
-AVCodec ff_binkaudio_dct_decoder = {
-    .name           = "binkaudio_dct",
-    .long_name      = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_BINKAUDIO_DCT,
-    .priv_data_size = sizeof(BinkAudioContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/binkdata.h b/deps/libav/libavcodec/binkdata.h
deleted file mode 100644
index 3da6b7e..0000000
--- a/deps/libav/libavcodec/binkdata.h
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- * Bink video decoder
- * Copyright (C) 2009 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_BINKDATA_H
-#define AVCODEC_BINKDATA_H
-
-#include <stdint.h>
-
-/** Bink DCT and residue 8x8 block scan order */
-static const uint8_t bink_scan[64] = {
-     0,  1,  8,  9,  2,  3, 10, 11,
-     4,  5, 12, 13,  6,  7, 14, 15,
-    20, 21, 28, 29, 22, 23, 30, 31,
-    16, 17, 24, 25, 32, 33, 40, 41,
-    34, 35, 42, 43, 48, 49, 56, 57,
-    50, 51, 58, 59, 18, 19, 26, 27,
-    36, 37, 44, 45, 38, 39, 46, 47,
-    52, 53, 60, 61, 54, 55, 62, 63
-};
-
-static const uint8_t bink_tree_bits[16][16] = {
-    {
-        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-        0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    },
-    {
-        0x00, 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D,
-        0x0F, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F,
-    },
-    {
-        0x00, 0x02, 0x01, 0x09, 0x05, 0x15, 0x0D, 0x1D,
-        0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F,
-    },
-    {
-        0x00, 0x02, 0x06, 0x01, 0x09, 0x05, 0x0D, 0x1D,
-        0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F,
-    },
-    {
-        0x00, 0x04, 0x02, 0x06, 0x01, 0x09, 0x05, 0x0D,
-        0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F,
-    },
-    {
-        0x00, 0x04, 0x02, 0x0A, 0x06, 0x0E, 0x01, 0x09,
-        0x05, 0x0D, 0x03, 0x0B, 0x07, 0x17, 0x0F, 0x1F,
-    },
-    {
-        0x00, 0x02, 0x0A, 0x06, 0x0E, 0x01, 0x09, 0x05,
-        0x0D, 0x03, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F,
-    },
-    {
-        0x00, 0x01, 0x05, 0x03, 0x13, 0x0B, 0x1B, 0x3B,
-        0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F,
-    },
-    {
-        0x00, 0x01, 0x03, 0x13, 0x0B, 0x2B, 0x1B, 0x3B,
-        0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F,
-    },
-    {
-        0x00, 0x01, 0x05, 0x0D, 0x03, 0x13, 0x0B, 0x1B,
-        0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F,
-    },
-    {
-        0x00, 0x02, 0x01, 0x05, 0x0D, 0x03, 0x13, 0x0B,
-        0x1B, 0x07, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F,
-    },
-    {
-        0x00, 0x01, 0x09, 0x05, 0x0D, 0x03, 0x13, 0x0B,
-        0x1B, 0x07, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F,
-    },
-    {
-        0x00, 0x02, 0x01, 0x03, 0x13, 0x0B, 0x1B, 0x3B,
-        0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F,
-    },
-    {
-        0x00, 0x01, 0x05, 0x03, 0x07, 0x27, 0x17, 0x37,
-        0x0F, 0x4F, 0x2F, 0x6F, 0x1F, 0x5F, 0x3F, 0x7F,
-    },
-    {
-        0x00, 0x01, 0x05, 0x03, 0x07, 0x17, 0x37, 0x77,
-        0x0F, 0x4F, 0x2F, 0x6F, 0x1F, 0x5F, 0x3F, 0x7F,
-    },
-    {
-        0x00, 0x02, 0x01, 0x05, 0x03, 0x07, 0x27, 0x17,
-        0x37, 0x0F, 0x2F, 0x6F, 0x1F, 0x5F, 0x3F, 0x7F,
-    },
-};
-
-static const uint8_t bink_tree_lens[16][16] = {
-    { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 },
-    { 1, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
-    { 2, 2, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
-    { 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
-    { 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5 },
-    { 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 },
-    { 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5 },
-    { 1, 3, 3, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
-    { 1, 2, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
-    { 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6 },
-    { 2, 2, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 },
-    { 1, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 },
-    { 2, 2, 2, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
-    { 1, 3, 3, 3, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7 },
-    { 1, 3, 3, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 },
-    { 2, 2, 3, 3, 3, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7 },
-};
-
-static const uint8_t bink_patterns[16][64] = {
-    {
-        0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38,
-        0x39, 0x31, 0x29, 0x21, 0x19, 0x11, 0x09, 0x01,
-        0x02, 0x0A, 0x12, 0x1A, 0x22, 0x2A, 0x32, 0x3A,
-        0x3B, 0x33, 0x2B, 0x23, 0x1B, 0x13, 0x0B, 0x03,
-        0x04, 0x0C, 0x14, 0x1C, 0x24, 0x2C, 0x34, 0x3C,
-        0x3D, 0x35, 0x2D, 0x25, 0x1D, 0x15, 0x0D, 0x05,
-        0x06, 0x0E, 0x16, 0x1E, 0x26, 0x2E, 0x36, 0x3E,
-        0x3F, 0x37, 0x2F, 0x27, 0x1F, 0x17, 0x0F, 0x07,
-    },
-    {
-        0x3B, 0x3A, 0x39, 0x38, 0x30, 0x31, 0x32, 0x33,
-        0x2B, 0x2A, 0x29, 0x28, 0x20, 0x21, 0x22, 0x23,
-        0x1B, 0x1A, 0x19, 0x18, 0x10, 0x11, 0x12, 0x13,
-        0x0B, 0x0A, 0x09, 0x08, 0x00, 0x01, 0x02, 0x03,
-        0x04, 0x05, 0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x0C,
-        0x14, 0x15, 0x16, 0x17, 0x1F, 0x1E, 0x1D, 0x1C,
-        0x24, 0x25, 0x26, 0x27, 0x2F, 0x2E, 0x2D, 0x2C,
-        0x34, 0x35, 0x36, 0x37, 0x3F, 0x3E, 0x3D, 0x3C,
-    },
-    {
-        0x19, 0x11, 0x12, 0x1A, 0x1B, 0x13, 0x0B, 0x03,
-        0x02, 0x0A, 0x09, 0x01, 0x00, 0x08, 0x10, 0x18,
-        0x20, 0x28, 0x30, 0x38, 0x39, 0x31, 0x29, 0x2A,
-        0x32, 0x3A, 0x3B, 0x33, 0x2B, 0x23, 0x22, 0x21,
-        0x1D, 0x15, 0x16, 0x1E, 0x1F, 0x17, 0x0F, 0x07,
-        0x06, 0x0E, 0x0D, 0x05, 0x04, 0x0C, 0x14, 0x1C,
-        0x24, 0x2C, 0x34, 0x3C, 0x3D, 0x35, 0x2D, 0x2E,
-        0x36, 0x3E, 0x3F, 0x37, 0x2F, 0x27, 0x26, 0x25,
-    },
-    {
-        0x03, 0x0B, 0x02, 0x0A, 0x01, 0x09, 0x00, 0x08,
-        0x10, 0x18, 0x11, 0x19, 0x12, 0x1A, 0x13, 0x1B,
-        0x23, 0x2B, 0x22, 0x2A, 0x21, 0x29, 0x20, 0x28,
-        0x30, 0x38, 0x31, 0x39, 0x32, 0x3A, 0x33, 0x3B,
-        0x3C, 0x34, 0x3D, 0x35, 0x3E, 0x36, 0x3F, 0x37,
-        0x2F, 0x27, 0x2E, 0x26, 0x2D, 0x25, 0x2C, 0x24,
-        0x1C, 0x14, 0x1D, 0x15, 0x1E, 0x16, 0x1F, 0x17,
-        0x0F, 0x07, 0x0E, 0x06, 0x0D, 0x05, 0x0C, 0x04,
-    },
-    {
-        0x18, 0x19, 0x10, 0x11, 0x08, 0x09, 0x00, 0x01,
-        0x02, 0x03, 0x0A, 0x0B, 0x12, 0x13, 0x1A, 0x1B,
-        0x1C, 0x1D, 0x14, 0x15, 0x0C, 0x0D, 0x04, 0x05,
-        0x06, 0x07, 0x0E, 0x0F, 0x16, 0x17, 0x1E, 0x1F,
-        0x27, 0x26, 0x2F, 0x2E, 0x37, 0x36, 0x3F, 0x3E,
-        0x3D, 0x3C, 0x35, 0x34, 0x2D, 0x2C, 0x25, 0x24,
-        0x23, 0x22, 0x2B, 0x2A, 0x33, 0x32, 0x3B, 0x3A,
-        0x39, 0x38, 0x31, 0x30, 0x29, 0x28, 0x21, 0x20,
-    },
-    {
-        0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
-        0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B,
-        0x20, 0x21, 0x22, 0x23, 0x28, 0x29, 0x2A, 0x2B,
-        0x30, 0x31, 0x32, 0x33, 0x38, 0x39, 0x3A, 0x3B,
-        0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
-        0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F,
-        0x24, 0x25, 0x26, 0x27, 0x2C, 0x2D, 0x2E, 0x2F,
-        0x34, 0x35, 0x36, 0x37, 0x3C, 0x3D, 0x3E, 0x3F,
-    },
-    {
-        0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x05, 0x0C, 0x04,
-        0x03, 0x0B, 0x02, 0x0A, 0x09, 0x01, 0x00, 0x08,
-        0x10, 0x18, 0x11, 0x19, 0x12, 0x1A, 0x13, 0x1B,
-        0x14, 0x1C, 0x15, 0x1D, 0x16, 0x1E, 0x17, 0x1F,
-        0x27, 0x2F, 0x26, 0x2E, 0x25, 0x2D, 0x24, 0x2C,
-        0x23, 0x2B, 0x22, 0x2A, 0x21, 0x29, 0x20, 0x28,
-        0x31, 0x30, 0x38, 0x39, 0x3A, 0x32, 0x3B, 0x33,
-        0x3C, 0x34, 0x3D, 0x35, 0x36, 0x37, 0x3F, 0x3E,
-    },
-    {
-        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-        0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08,
-        0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
-        0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18,
-        0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
-        0x2F, 0x2E, 0x2D, 0x2C, 0x2B, 0x2A, 0x29, 0x28,
-        0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
-        0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38,
-    },
-    {
-        0x00, 0x08, 0x09, 0x01, 0x02, 0x03, 0x0B, 0x0A,
-        0x12, 0x13, 0x1B, 0x1A, 0x19, 0x11, 0x10, 0x18,
-        0x20, 0x28, 0x29, 0x21, 0x22, 0x23, 0x2B, 0x2A,
-        0x32, 0x31, 0x30, 0x38, 0x39, 0x3A, 0x3B, 0x33,
-        0x34, 0x3C, 0x3D, 0x3E, 0x3F, 0x37, 0x36, 0x35,
-        0x2D, 0x2C, 0x24, 0x25, 0x26, 0x2E, 0x2F, 0x27,
-        0x1F, 0x17, 0x16, 0x1E, 0x1D, 0x1C, 0x14, 0x15,
-        0x0D, 0x0C, 0x04, 0x05, 0x06, 0x0E, 0x0F, 0x07,
-    },
-    {
-        0x18, 0x19, 0x10, 0x11, 0x08, 0x09, 0x00, 0x01,
-        0x02, 0x03, 0x0A, 0x0B, 0x12, 0x13, 0x1A, 0x1B,
-        0x1C, 0x1D, 0x14, 0x15, 0x0C, 0x0D, 0x04, 0x05,
-        0x06, 0x07, 0x0E, 0x0F, 0x16, 0x17, 0x1E, 0x1F,
-        0x26, 0x27, 0x2E, 0x2F, 0x36, 0x37, 0x3E, 0x3F,
-        0x3C, 0x3D, 0x34, 0x35, 0x2C, 0x2D, 0x24, 0x25,
-        0x22, 0x23, 0x2A, 0x2B, 0x32, 0x33, 0x3A, 0x3B,
-        0x38, 0x39, 0x30, 0x31, 0x28, 0x29, 0x20, 0x21,
-    },
-    {
-        0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B,
-        0x13, 0x1B, 0x12, 0x1A, 0x11, 0x19, 0x10, 0x18,
-        0x20, 0x28, 0x21, 0x29, 0x22, 0x2A, 0x23, 0x2B,
-        0x33, 0x3B, 0x32, 0x3A, 0x31, 0x39, 0x30, 0x38,
-        0x3C, 0x34, 0x3D, 0x35, 0x3E, 0x36, 0x3F, 0x37,
-        0x2F, 0x27, 0x2E, 0x26, 0x2D, 0x25, 0x2C, 0x24,
-        0x1F, 0x17, 0x1E, 0x16, 0x1D, 0x15, 0x1C, 0x14,
-        0x0C, 0x04, 0x0D, 0x05, 0x0E, 0x06, 0x0F, 0x07,
-    },
-    {
-        0x00, 0x08, 0x10, 0x18, 0x19, 0x1A, 0x1B, 0x13,
-        0x0B, 0x03, 0x02, 0x01, 0x09, 0x11, 0x12, 0x0A,
-        0x04, 0x0C, 0x14, 0x1C, 0x1D, 0x1E, 0x1F, 0x17,
-        0x0F, 0x07, 0x06, 0x05, 0x0D, 0x15, 0x16, 0x0E,
-        0x24, 0x2C, 0x34, 0x3C, 0x3D, 0x3E, 0x3F, 0x37,
-        0x2F, 0x27, 0x26, 0x25, 0x2D, 0x35, 0x36, 0x2E,
-        0x20, 0x28, 0x30, 0x38, 0x39, 0x3A, 0x3B, 0x33,
-        0x2B, 0x23, 0x22, 0x21, 0x29, 0x31, 0x32, 0x2A,
-    },
-    {
-        0x00, 0x08, 0x09, 0x01, 0x02, 0x03, 0x0B, 0x0A,
-        0x13, 0x1B, 0x1A, 0x12, 0x11, 0x10, 0x18, 0x19,
-        0x21, 0x20, 0x28, 0x29, 0x2A, 0x22, 0x23, 0x2B,
-        0x33, 0x3B, 0x3A, 0x32, 0x31, 0x39, 0x38, 0x30,
-        0x34, 0x3C, 0x3D, 0x35, 0x36, 0x3E, 0x3F, 0x37,
-        0x2F, 0x27, 0x26, 0x2E, 0x2D, 0x2C, 0x24, 0x25,
-        0x1D, 0x1C, 0x14, 0x15, 0x16, 0x1E, 0x1F, 0x17,
-        0x0E, 0x0F, 0x07, 0x06, 0x05, 0x0D, 0x0C, 0x04,
-    },
-    {
-        0x18, 0x10, 0x08, 0x00, 0x01, 0x02, 0x03, 0x0B,
-        0x13, 0x1B, 0x1A, 0x19, 0x11, 0x0A, 0x09, 0x12,
-        0x1C, 0x14, 0x0C, 0x04, 0x05, 0x06, 0x07, 0x0F,
-        0x17, 0x1F, 0x1E, 0x1D, 0x15, 0x0E, 0x0D, 0x16,
-        0x3C, 0x34, 0x2C, 0x24, 0x25, 0x26, 0x27, 0x2F,
-        0x37, 0x3F, 0x3E, 0x3D, 0x35, 0x2E, 0x2D, 0x36,
-        0x38, 0x30, 0x28, 0x20, 0x21, 0x22, 0x23, 0x2B,
-        0x33, 0x3B, 0x3A, 0x39, 0x31, 0x2A, 0x29, 0x32,
-    },
-    {
-        0x00, 0x08, 0x09, 0x01, 0x02, 0x0A, 0x12, 0x11,
-        0x10, 0x18, 0x19, 0x1A, 0x1B, 0x13, 0x0B, 0x03,
-        0x07, 0x06, 0x0E, 0x0F, 0x17, 0x16, 0x15, 0x0D,
-        0x05, 0x04, 0x0C, 0x14, 0x1C, 0x1D, 0x1E, 0x1F,
-        0x3F, 0x3E, 0x36, 0x37, 0x2F, 0x2E, 0x2D, 0x35,
-        0x3D, 0x3C, 0x34, 0x2C, 0x24, 0x25, 0x26, 0x27,
-        0x38, 0x30, 0x31, 0x39, 0x3A, 0x32, 0x2A, 0x29,
-        0x28, 0x20, 0x21, 0x22, 0x23, 0x2B, 0x33, 0x3B,
-    },
-    {
-        0x00, 0x01, 0x08, 0x09, 0x10, 0x11, 0x18, 0x19,
-        0x20, 0x21, 0x28, 0x29, 0x30, 0x31, 0x38, 0x39,
-        0x3A, 0x3B, 0x32, 0x33, 0x2A, 0x2B, 0x22, 0x23,
-        0x1A, 0x1B, 0x12, 0x13, 0x0A, 0x0B, 0x02, 0x03,
-        0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D,
-        0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x3C, 0x3D,
-        0x3E, 0x3F, 0x36, 0x37, 0x2E, 0x2F, 0x26, 0x27,
-        0x1E, 0x1F, 0x16, 0x17, 0x0E, 0x0F, 0x06, 0x07,
-    }
-};
-
-static const int32_t bink_intra_quant[16][64] = {
-{
- 0x010000, 0x016315, 0x01E83D, 0x02A535, 0x014E7B, 0x016577, 0x02F1E6, 0x02724C,
- 0x010000, 0x00EEDA, 0x024102, 0x017F9B, 0x00BE80, 0x00611E, 0x01083C, 0x00A552,
- 0x021F88, 0x01DC53, 0x027FAD, 0x01F697, 0x014819, 0x00A743, 0x015A31, 0x009688,
- 0x02346F, 0x030EE5, 0x01FBFA, 0x02C096, 0x01D000, 0x028396, 0x019247, 0x01F9AA,
- 0x02346F, 0x01FBFA, 0x01DC53, 0x0231B8, 0x012F12, 0x01E06C, 0x00CB10, 0x0119A8,
- 0x01C48C, 0x019748, 0x014E86, 0x0122AF, 0x02C628, 0x027F20, 0x0297B5, 0x023F32,
- 0x025000, 0x01AB6B, 0x01D122, 0x0159B3, 0x012669, 0x008D43, 0x00EE1F, 0x0075ED,
- 0x01490C, 0x010288, 0x00F735, 0x00EF51, 0x00E0F1, 0x0072AD, 0x00A4D8, 0x006517,
-},
-{
- 0x015555, 0x01D971, 0x028AFC, 0x0386F1, 0x01BDF9, 0x01DC9F, 0x03ED33, 0x034311,
- 0x015555, 0x013E78, 0x030158, 0x01FF7A, 0x00FE00, 0x00817D, 0x01604F, 0x00DC6D,
- 0x02D4B5, 0x027B19, 0x0354E7, 0x029E1F, 0x01B577, 0x00DF04, 0x01CD96, 0x00C8B6,
- 0x02F095, 0x0413DC, 0x02A54E, 0x03AB73, 0x026AAB, 0x035A1E, 0x02185E, 0x02A238,
- 0x02F095, 0x02A54E, 0x027B19, 0x02ECF5, 0x019418, 0x028090, 0x010EC0, 0x01778A,
- 0x025B66, 0x021F0B, 0x01BE09, 0x018394, 0x03B2E0, 0x03542A, 0x0374F1, 0x02FEEE,
- 0x031555, 0x0239E4, 0x026C2D, 0x01CCEE, 0x01888C, 0x00BC59, 0x013D7E, 0x009D3C,
- 0x01B6BB, 0x0158B5, 0x01499C, 0x013F17, 0x012BEC, 0x0098E6, 0x00DBCB, 0x0086C9,
-},
-{
- 0x01AAAB, 0x024FCE, 0x032DBB, 0x0468AD, 0x022D78, 0x0253C7, 0x04E87F, 0x0413D5,
- 0x01AAAB, 0x018E16, 0x03C1AE, 0x027F58, 0x013D80, 0x00A1DC, 0x01B863, 0x011388,
- 0x0389E2, 0x0319DF, 0x042A21, 0x0345A7, 0x0222D4, 0x0116C5, 0x0240FC, 0x00FAE3,
- 0x03ACBA, 0x0518D3, 0x034EA1, 0x04964F, 0x030555, 0x0430A5, 0x029E76, 0x034AC5,
- 0x03ACBA, 0x034EA1, 0x0319DF, 0x03A833, 0x01F91E, 0x0320B4, 0x015270, 0x01D56D,
- 0x02F23F, 0x02A6CE, 0x022D8B, 0x01E479, 0x049F98, 0x042935, 0x04522D, 0x03BEA9,
- 0x03DAAB, 0x02C85D, 0x030738, 0x02402A, 0x01EAAF, 0x00EB6F, 0x018CDE, 0x00C48A,
- 0x022469, 0x01AEE2, 0x019C02, 0x018EDD, 0x0176E7, 0x00BF20, 0x0112BE, 0x00A87B,
-},
-{
- 0x020000, 0x02C62A, 0x03D07A, 0x054A69, 0x029CF6, 0x02CAEF, 0x05E3CC, 0x04E499,
- 0x020000, 0x01DDB4, 0x048204, 0x02FF36, 0x017D01, 0x00C23C, 0x021077, 0x014AA3,
- 0x043F0F, 0x03B8A6, 0x04FF5A, 0x03ED2E, 0x029032, 0x014E86, 0x02B461, 0x012D11,
- 0x0468DF, 0x061DCA, 0x03F7F5, 0x05812C, 0x03A000, 0x05072C, 0x03248D, 0x03F353,
- 0x0468DF, 0x03F7F5, 0x03B8A6, 0x046370, 0x025E24, 0x03C0D8, 0x019620, 0x02334F,
- 0x038919, 0x032E91, 0x029D0D, 0x02455E, 0x058C50, 0x04FE3F, 0x052F69, 0x047E65,
- 0x04A000, 0x0356D6, 0x03A243, 0x02B365, 0x024CD2, 0x011A85, 0x01DC3E, 0x00EBD9,
- 0x029218, 0x020510, 0x01EE69, 0x01DEA2, 0x01C1E2, 0x00E559, 0x0149B0, 0x00CA2D,
-},
-{
- 0x02AAAB, 0x03B2E3, 0x0515F8, 0x070DE2, 0x037BF2, 0x03B93E, 0x07DA65, 0x068621,
- 0x02AAAB, 0x027CF0, 0x0602B1, 0x03FEF3, 0x01FC01, 0x0102FA, 0x02C09F, 0x01B8DA,
- 0x05A96A, 0x04F632, 0x06A9CE, 0x053C3E, 0x036AED, 0x01BE09, 0x039B2D, 0x01916B,
- 0x05E129, 0x0827B8, 0x054A9C, 0x0756E5, 0x04D555, 0x06B43B, 0x0430BC, 0x05446F,
- 0x05E129, 0x054A9C, 0x04F632, 0x05D9EB, 0x032830, 0x050121, 0x021D80, 0x02EF14,
- 0x04B6CC, 0x043E16, 0x037C11, 0x030728, 0x0765C0, 0x06A855, 0x06E9E2, 0x05FDDB,
- 0x062AAB, 0x0473C8, 0x04D85A, 0x0399DC, 0x031118, 0x0178B2, 0x027AFD, 0x013A77,
- 0x036D76, 0x02B16A, 0x029337, 0x027E2E, 0x0257D8, 0x0131CC, 0x01B796, 0x010D91,
-},
-{
- 0x038000, 0x04DACA, 0x06ACD5, 0x094238, 0x0492AE, 0x04E322, 0x0A4EA5, 0x08900C,
- 0x038000, 0x0343FB, 0x07E388, 0x053E9F, 0x029AC1, 0x0153E8, 0x039CD0, 0x02429E,
- 0x076E5B, 0x068322, 0x08BEDE, 0x06DF11, 0x047C57, 0x02496B, 0x04BBAB, 0x020EDD,
- 0x07B786, 0x0AB421, 0x06F1ED, 0x09A20D, 0x065800, 0x08CC8E, 0x057FF7, 0x06E9D2,
- 0x07B786, 0x06F1ED, 0x068322, 0x07AE04, 0x0424BF, 0x06917B, 0x02C6B8, 0x03D9CB,
- 0x062FEB, 0x05917D, 0x0492D7, 0x03F964, 0x09B58C, 0x08BCEF, 0x0912F8, 0x07DD30,
- 0x081800, 0x05D7F7, 0x065BF6, 0x04B9F1, 0x040670, 0x01EE69, 0x03416C, 0x019CBC,
- 0x047FAA, 0x0388DC, 0x036138, 0x03459C, 0x03134C, 0x01915C, 0x0240F5, 0x0161CF,
-},
-{
- 0x040000, 0x058C54, 0x07A0F4, 0x0A94D3, 0x0539EC, 0x0595DD, 0x0BC798, 0x09C932,
- 0x040000, 0x03BB68, 0x090409, 0x05FE6D, 0x02FA01, 0x018477, 0x0420EE, 0x029547,
- 0x087E1F, 0x07714C, 0x09FEB5, 0x07DA5D, 0x052064, 0x029D0D, 0x0568C3, 0x025A21,
- 0x08D1BE, 0x0C3B94, 0x07EFEA, 0x0B0258, 0x074000, 0x0A0E59, 0x06491A, 0x07E6A7,
- 0x08D1BE, 0x07EFEA, 0x07714C, 0x08C6E0, 0x04BC48, 0x0781B1, 0x032C3F, 0x04669F,
- 0x071232, 0x065D22, 0x053A1A, 0x048ABC, 0x0B18A0, 0x09FC7F, 0x0A5ED3, 0x08FCC9,
- 0x094000, 0x06ADAC, 0x074487, 0x0566CA, 0x0499A5, 0x02350B, 0x03B87B, 0x01D7B3,
- 0x052430, 0x040A20, 0x03DCD3, 0x03BD45, 0x0383C5, 0x01CAB3, 0x029361, 0x01945A,
-},
-{
- 0x050000, 0x06EF69, 0x098931, 0x0D3A07, 0x068867, 0x06FB55, 0x0EB97E, 0x0C3B7E,
- 0x050000, 0x04AA42, 0x0B450B, 0x077E08, 0x03B881, 0x01E595, 0x05292A, 0x033A99,
- 0x0A9DA7, 0x094D9F, 0x0C7E62, 0x09D0F4, 0x06687D, 0x034450, 0x06C2F4, 0x02F0AA,
- 0x0B062D, 0x0F4A78, 0x09EBE4, 0x0DC2EE, 0x091000, 0x0C91EF, 0x07DB61, 0x09E050,
- 0x0B062D, 0x09EBE4, 0x094D9F, 0x0AF898, 0x05EB59, 0x09621D, 0x03F74F, 0x058046,
- 0x08D6BE, 0x07F46A, 0x0688A0, 0x05AD6B, 0x0DDEC8, 0x0C7B9F, 0x0CF687, 0x0B3BFB,
- 0x0B9000, 0x085917, 0x0915A8, 0x06C07D, 0x05C00E, 0x02C24D, 0x04A69A, 0x024D9F,
- 0x066D3C, 0x050CA7, 0x04D407, 0x04AC96, 0x0464B6, 0x023D5F, 0x033839, 0x01F971,
-},
-{
- 0x060000, 0x08527E, 0x0B716E, 0x0FDF3C, 0x07D6E1, 0x0860CC, 0x11AB63, 0x0EADCB,
- 0x060000, 0x05991C, 0x0D860D, 0x08FDA3, 0x047702, 0x0246B3, 0x063165, 0x03DFEA,
- 0x0CBD2E, 0x0B29F1, 0x0EFE0F, 0x0BC78B, 0x07B096, 0x03EB93, 0x081D24, 0x038732,
- 0x0D3A9C, 0x12595D, 0x0BE7DF, 0x108384, 0x0AE000, 0x0F1585, 0x096DA8, 0x0BD9FA,
- 0x0D3A9C, 0x0BE7DF, 0x0B29F1, 0x0D2A50, 0x071A6B, 0x0B4289, 0x04C25F, 0x0699EE,
- 0x0A9B4A, 0x098BB2, 0x07D727, 0x06D01A, 0x10A4F0, 0x0EFABE, 0x0F8E3C, 0x0D7B2E,
- 0x0DE000, 0x0A0482, 0x0AE6CA, 0x081A2F, 0x06E677, 0x034F90, 0x0594B9, 0x02C38C,
- 0x07B649, 0x060F2F, 0x05CB3C, 0x059BE7, 0x0545A7, 0x02B00C, 0x03DD11, 0x025E87,
-},
-{
- 0x080000, 0x0B18A8, 0x0F41E8, 0x1529A5, 0x0A73D7, 0x0B2BBB, 0x178F2F, 0x139264,
- 0x080000, 0x0776CF, 0x120812, 0x0BFCD9, 0x05F402, 0x0308EF, 0x0841DC, 0x052A8E,
- 0x10FC3E, 0x0EE297, 0x13FD69, 0x0FB4B9, 0x0A40C8, 0x053A1A, 0x0AD186, 0x04B442,
- 0x11A37B, 0x187727, 0x0FDFD4, 0x1604B0, 0x0E8000, 0x141CB1, 0x0C9235, 0x0FCD4D,
- 0x11A37B, 0x0FDFD4, 0x0EE297, 0x118DC0, 0x09788F, 0x0F0362, 0x06587F, 0x08CD3D,
- 0x0E2463, 0x0CBA43, 0x0A7434, 0x091577, 0x163140, 0x13F8FE, 0x14BDA5, 0x11F992,
- 0x128000, 0x0D5B58, 0x0E890D, 0x0ACD94, 0x093349, 0x046A15, 0x0770F7, 0x03AF65,
- 0x0A4861, 0x08143F, 0x07B9A6, 0x077A89, 0x070789, 0x039565, 0x0526C2, 0x0328B4,
-},
-{
- 0x0C0000, 0x10A4FD, 0x16E2DB, 0x1FBE78, 0x0FADC3, 0x10C198, 0x2356C7, 0x1D5B96,
- 0x0C0000, 0x0B3237, 0x1B0C1A, 0x11FB46, 0x08EE03, 0x048D66, 0x0C62CA, 0x07BFD5,
- 0x197A5D, 0x1653E3, 0x1DFC1E, 0x178F16, 0x0F612C, 0x07D727, 0x103A49, 0x070E64,
- 0x1A7539, 0x24B2BB, 0x17CFBD, 0x210709, 0x15C000, 0x1E2B0A, 0x12DB4F, 0x17B3F4,
- 0x1A7539, 0x17CFBD, 0x1653E3, 0x1A54A0, 0x0E34D7, 0x168513, 0x0984BE, 0x0D33DC,
- 0x153695, 0x131765, 0x0FAE4E, 0x0DA033, 0x2149E1, 0x1DF57D, 0x1F1C78, 0x1AF65B,
- 0x1BC000, 0x140904, 0x15CD94, 0x10345E, 0x0DCCEE, 0x069F20, 0x0B2972, 0x058718,
- 0x0F6C91, 0x0C1E5E, 0x0B9678, 0x0B37CE, 0x0A8B4E, 0x056018, 0x07BA22, 0x04BD0E,
-},
-{
- 0x110000, 0x179466, 0x206C0C, 0x2CF87F, 0x16362A, 0x17BCED, 0x321044, 0x299714,
- 0x110000, 0x0FDC79, 0x265125, 0x19794E, 0x0CA685, 0x0672FB, 0x118BF4, 0x0AFA6D,
- 0x241804, 0x1FA181, 0x2A7A80, 0x21600A, 0x15C9A9, 0x0B1B77, 0x16FD3C, 0x09FF0D,
- 0x257B66, 0x33FD33, 0x21BBA2, 0x2EC9F7, 0x1ED000, 0x2ABCF9, 0x1AB6B0, 0x219444,
- 0x257B66, 0x21BBA2, 0x1FA181, 0x254D38, 0x142030, 0x1FE730, 0x0D7C0E, 0x12B423,
- 0x1E0D52, 0x1B0BCF, 0x1636EE, 0x134D9E, 0x2F28A9, 0x2A711B, 0x2C12FF, 0x263256,
- 0x275000, 0x1C621B, 0x1EE33C, 0x16F4DB, 0x138CFB, 0x09616E, 0x0FD00C, 0x07D4B7,
- 0x15D9CE, 0x112B06, 0x106A80, 0x0FE464, 0x0EF004, 0x079D77, 0x0AF25B, 0x06B67F,
-},
-{
- 0x160000, 0x1E83CF, 0x29F53D, 0x3A3286, 0x1CBE90, 0x1EB842, 0x40C9C2, 0x35D293,
- 0x160000, 0x1486BA, 0x319630, 0x20F756, 0x105F06, 0x085891, 0x16B51E, 0x0E3506,
- 0x2EB5AA, 0x28EF20, 0x36F8E1, 0x2B30FE, 0x1C3225, 0x0E5FC7, 0x1DC030, 0x0CEFB7,
- 0x308193, 0x4347AC, 0x2BA786, 0x3C8CE5, 0x27E000, 0x374EE7, 0x229212, 0x2B7494,
- 0x308193, 0x2BA786, 0x28EF20, 0x3045D0, 0x1A0B89, 0x29494D, 0x11735D, 0x183469,
- 0x26E410, 0x230039, 0x1CBF8F, 0x18FB09, 0x3D0771, 0x36ECBA, 0x390986, 0x316E52,
- 0x32E000, 0x24BB33, 0x27F8E4, 0x1DB557, 0x194D09, 0x0C23BB, 0x1476A6, 0x0A2256,
- 0x1C470A, 0x1637AD, 0x153E87, 0x1490FA, 0x1354B9, 0x09DAD6, 0x0E2A94, 0x08AFF0,
-},
-{
- 0x1C0000, 0x26D64D, 0x3566AA, 0x4A11C2, 0x249572, 0x27190E, 0x527525, 0x44805E,
- 0x1C0000, 0x1A1FD6, 0x3F1C3E, 0x29F4F9, 0x14D607, 0x0A9F44, 0x1CE683, 0x1214F0,
- 0x3B72D9, 0x341911, 0x45F6F0, 0x36F889, 0x23E2BB, 0x124B5B, 0x25DD54, 0x1076E9,
- 0x3DBC30, 0x55A109, 0x378F64, 0x4D1069, 0x32C000, 0x46646C, 0x2BFFB9, 0x374E8E,
- 0x3DBC30, 0x378F64, 0x341911, 0x3D7020, 0x2125F5, 0x348BD6, 0x1635BC, 0x1ECE57,
- 0x317F5B, 0x2C8BEB, 0x2496B6, 0x1FCB22, 0x4DAC61, 0x45E778, 0x4897C2, 0x3EE97F,
- 0x40C000, 0x2EBFB5, 0x32DFAE, 0x25CF86, 0x203380, 0x0F734B, 0x1A0B5F, 0x0CE5E2,
- 0x23FD53, 0x1C46DC, 0x1B09C4, 0x1A2CE1, 0x189A60, 0x0C8AE2, 0x1207A5, 0x0B0E77,
-},
-{
- 0x220000, 0x2F28CC, 0x40D818, 0x59F0FE, 0x2C6C53, 0x2F79DA, 0x642089, 0x532E29,
- 0x220000, 0x1FB8F1, 0x4CA24B, 0x32F29C, 0x194D09, 0x0CE5F7, 0x2317E8, 0x15F4DB,
- 0x483007, 0x3F4303, 0x54F4FF, 0x42C014, 0x2B9351, 0x1636EE, 0x2DFA79, 0x13FE1A,
- 0x4AF6CC, 0x67FA67, 0x437743, 0x5D93EE, 0x3DA000, 0x5579F1, 0x356D61, 0x432888,
- 0x4AF6CC, 0x437743, 0x3F4303, 0x4A9A70, 0x284060, 0x3FCE60, 0x1AF81B, 0x256845,
- 0x3C1AA5, 0x36179D, 0x2C6DDD, 0x269B3C, 0x5E5152, 0x54E237, 0x5825FE, 0x4C64AD,
- 0x4EA000, 0x38C437, 0x3DC678, 0x2DE9B5, 0x2719F7, 0x12C2DB, 0x1FA018, 0x0FA96E,
- 0x2BB39B, 0x22560C, 0x20D500, 0x1FC8C8, 0x1DE007, 0x0F3AEE, 0x15E4B7, 0x0D6CFE,
-},
-{
- 0x2C0000, 0x3D079E, 0x53EA79, 0x74650C, 0x397D20, 0x3D7083, 0x819383, 0x6BA525,
- 0x2C0000, 0x290D75, 0x632C61, 0x41EEAC, 0x20BE0C, 0x10B121, 0x2D6A3B, 0x1C6A0C,
- 0x5D6B54, 0x51DE40, 0x6DF1C2, 0x5661FB, 0x38644B, 0x1CBF8F, 0x3B8060, 0x19DF6D,
- 0x610326, 0x868F57, 0x574F0B, 0x7919CA, 0x4FC000, 0x6E9DCE, 0x452423, 0x56E928,
- 0x610326, 0x574F0B, 0x51DE40, 0x608BA0, 0x341713, 0x52929A, 0x22E6BA, 0x3068D2,
- 0x4DC821, 0x460071, 0x397F1E, 0x31F611, 0x7A0EE2, 0x6DD974, 0x72130C, 0x62DCA3,
- 0x65C000, 0x497665, 0x4FF1C9, 0x3B6AAE, 0x329A12, 0x184776, 0x28ED4D, 0x1444AC,
- 0x388E14, 0x2C6F5A, 0x2A7D0F, 0x2921F4, 0x26A973, 0x13B5AD, 0x1C5528, 0x115FDF,
-},
-};
-
-static const int32_t bink_inter_quant[16][64] = {
-{
- 0x010000, 0x017946, 0x01A5A9, 0x0248DC, 0x016363, 0x0152A7, 0x0243EC, 0x0209EA,
- 0x012000, 0x00E248, 0x01BBDA, 0x015CBC, 0x00A486, 0x0053E0, 0x00F036, 0x008095,
- 0x01B701, 0x016959, 0x01B0B9, 0x0153FD, 0x00F8E7, 0x007EE4, 0x00EA30, 0x007763,
- 0x01B701, 0x0260EB, 0x019DE9, 0x023E1B, 0x017000, 0x01FE6E, 0x012DB5, 0x01A27B,
- 0x01E0D1, 0x01B0B9, 0x018A33, 0x01718D, 0x00D87A, 0x014449, 0x007B9A, 0x00AB71,
- 0x013178, 0x0112EA, 0x00AD08, 0x009BB9, 0x023D97, 0x020437, 0x021CCC, 0x01E6B4,
- 0x018000, 0x012DB5, 0x0146D9, 0x0100CE, 0x00CFD2, 0x006E5C, 0x00B0E4, 0x005A2D,
- 0x00E9CC, 0x00B7B1, 0x00846F, 0x006B85, 0x008337, 0x0042E5, 0x004A10, 0x002831,
-},
-{
- 0x015555, 0x01F708, 0x023237, 0x030BD0, 0x01D9D9, 0x01C389, 0x03053B, 0x02B7E3,
- 0x018000, 0x012DB5, 0x024FCE, 0x01D0FA, 0x00DB5D, 0x006FD5, 0x014048, 0x00AB71,
- 0x024957, 0x01E1CC, 0x0240F7, 0x01C551, 0x014BDE, 0x00A92F, 0x013840, 0x009F2F,
- 0x024957, 0x032BE4, 0x0227E1, 0x02FD7A, 0x01EAAB, 0x02A893, 0x019247, 0x022DF9,
- 0x028116, 0x0240F7, 0x020D99, 0x01ECBC, 0x0120A3, 0x01B061, 0x00A4CE, 0x00E497,
- 0x01974B, 0x016E8E, 0x00E6B5, 0x00CFA2, 0x02FCC9, 0x02B04A, 0x02D110, 0x0288F1,
- 0x020000, 0x019247, 0x01B3CC, 0x015668, 0x011518, 0x009325, 0x00EBDA, 0x00783D,
- 0x0137BB, 0x00F4ED, 0x00B093, 0x008F5C, 0x00AEF4, 0x005931, 0x0062BF, 0x003597,
-},
-{
- 0x01AAAB, 0x0274CB, 0x02BEC4, 0x03CEC4, 0x02504F, 0x02346C, 0x03C689, 0x0365DC,
- 0x01E000, 0x017922, 0x02E3C1, 0x024539, 0x011235, 0x008BCA, 0x01905A, 0x00D64D,
- 0x02DBAD, 0x025A40, 0x02D134, 0x0236A5, 0x019ED6, 0x00D37B, 0x018650, 0x00C6FB,
- 0x02DBAD, 0x03F6DD, 0x02B1D9, 0x03BCD8, 0x026555, 0x0352B8, 0x01F6D8, 0x02B977,
- 0x03215C, 0x02D134, 0x029100, 0x0267EB, 0x0168CC, 0x021C7A, 0x00CE01, 0x011DBD,
- 0x01FD1E, 0x01CA31, 0x012062, 0x01038A, 0x03BBFB, 0x035C5C, 0x038554, 0x032B2D,
- 0x028000, 0x01F6D8, 0x0220C0, 0x01AC02, 0x015A5E, 0x00B7EF, 0x0126D1, 0x00964C,
- 0x0185A9, 0x013228, 0x00DCB8, 0x00B333, 0x00DAB2, 0x006F7D, 0x007B6F, 0x0042FC,
-},
-{
- 0x020000, 0x02F28D, 0x034B52, 0x0491B8, 0x02C6C5, 0x02A54E, 0x0487D8, 0x0413D5,
- 0x024000, 0x01C48F, 0x0377B5, 0x02B977, 0x01490C, 0x00A7BF, 0x01E06C, 0x01012A,
- 0x036E03, 0x02D2B3, 0x036172, 0x02A7FA, 0x01F1CE, 0x00FDC7, 0x01D460, 0x00EEC7,
- 0x036E03, 0x04C1D6, 0x033BD1, 0x047C37, 0x02E000, 0x03FCDD, 0x025B6A, 0x0344F5,
- 0x03C1A1, 0x036172, 0x031466, 0x02E31B, 0x01B0F5, 0x028892, 0x00F735, 0x0156E2,
- 0x0262F1, 0x0225D5, 0x015A10, 0x013772, 0x047B2D, 0x04086E, 0x043998, 0x03CD69,
- 0x030000, 0x025B6A, 0x028DB3, 0x02019B, 0x019FA3, 0x00DCB8, 0x0161C7, 0x00B45B,
- 0x01D398, 0x016F63, 0x0108DD, 0x00D70A, 0x01066F, 0x0085C9, 0x00941F, 0x005062,
-},
-{
- 0x02AAAB, 0x03EE11, 0x04646D, 0x0617A0, 0x03B3B2, 0x038713, 0x060A75, 0x056FC6,
- 0x030000, 0x025B6A, 0x049F9B, 0x03A1F4, 0x01B6BB, 0x00DFAA, 0x028090, 0x0156E2,
- 0x0492AE, 0x03C399, 0x0481ED, 0x038AA2, 0x0297BD, 0x01525F, 0x027080, 0x013E5E,
- 0x0492AE, 0x0657C8, 0x044FC1, 0x05FAF4, 0x03D555, 0x055126, 0x03248D, 0x045BF2,
- 0x05022D, 0x0481ED, 0x041B33, 0x03D979, 0x024147, 0x0360C3, 0x01499C, 0x01C92E,
- 0x032E96, 0x02DD1C, 0x01CD6A, 0x019F43, 0x05F991, 0x056093, 0x05A220, 0x0511E1,
- 0x040000, 0x03248D, 0x036799, 0x02ACCF, 0x022A2F, 0x01264B, 0x01D7B5, 0x00F079,
- 0x026F75, 0x01E9D9, 0x016127, 0x011EB8, 0x015DE9, 0x00B262, 0x00C57F, 0x006B2D,
-},
-{
- 0x038000, 0x052876, 0x05C3CF, 0x07FF02, 0x04DBD9, 0x04A148, 0x07EDBA, 0x0722B4,
- 0x03F000, 0x0317FB, 0x06117C, 0x04C491, 0x023FD5, 0x01258F, 0x0348BD, 0x01C209,
- 0x060085, 0x04F0B9, 0x05EA87, 0x04A5F5, 0x036728, 0x01BC1C, 0x0333A8, 0x01A1DB,
- 0x060085, 0x085336, 0x05A8AE, 0x07D960, 0x050800, 0x06FA82, 0x041FF9, 0x05B8AE,
- 0x0692DA, 0x05EA87, 0x0563B2, 0x050D6E, 0x02F5AD, 0x046F00, 0x01B09C, 0x02580C,
- 0x042D25, 0x03C235, 0x025D9B, 0x022108, 0x07D78F, 0x070EC1, 0x0764CA, 0x06A777,
- 0x054000, 0x041FF9, 0x0477F9, 0x0382D0, 0x02D75E, 0x018242, 0x026B1D, 0x013B9F,
- 0x03324A, 0x0282ED, 0x01CF83, 0x017851, 0x01CB42, 0x00EA21, 0x010336, 0x008CAC,
-},
-{
- 0x040000, 0x05E519, 0x0696A4, 0x092370, 0x058D8A, 0x054A9C, 0x090FB0, 0x0827AA,
- 0x048000, 0x03891F, 0x06EF69, 0x0572EE, 0x029218, 0x014F7E, 0x03C0D8, 0x020254,
- 0x06DC05, 0x05A565, 0x06C2E4, 0x054FF3, 0x03E39B, 0x01FB8E, 0x03A8C0, 0x01DD8D,
- 0x06DC05, 0x0983AC, 0x0677A2, 0x08F86E, 0x05C000, 0x07F9B9, 0x04B6D4, 0x0689EB,
- 0x078343, 0x06C2E4, 0x0628CC, 0x05C635, 0x0361EA, 0x051124, 0x01EE69, 0x02ADC5,
- 0x04C5E1, 0x044BAA, 0x02B41F, 0x026EE5, 0x08F65A, 0x0810DD, 0x087330, 0x079AD1,
- 0x060000, 0x04B6D4, 0x051B65, 0x040337, 0x033F47, 0x01B970, 0x02C38F, 0x0168B6,
- 0x03A730, 0x02DEC6, 0x0211BA, 0x01AE14, 0x020CDD, 0x010B93, 0x01283E, 0x00A0C4,
-},
-{
- 0x050000, 0x075E60, 0x083C4D, 0x0B6C4C, 0x06F0ED, 0x069D43, 0x0B539C, 0x0A3194,
- 0x05A000, 0x046B67, 0x08AB44, 0x06CFAA, 0x03369E, 0x01A35E, 0x04B10F, 0x0282E8,
- 0x089307, 0x070EBF, 0x08739C, 0x06A3F0, 0x04DC82, 0x027A72, 0x0492F0, 0x0254F0,
- 0x089307, 0x0BE497, 0x08158B, 0x0B3689, 0x073000, 0x09F827, 0x05E489, 0x082C66,
- 0x096413, 0x08739C, 0x07B2FF, 0x0737C2, 0x043A64, 0x06556D, 0x026A04, 0x035936,
- 0x05F75A, 0x055E94, 0x036127, 0x030A9E, 0x0B33F1, 0x0A1514, 0x0A8FFC, 0x098186,
- 0x078000, 0x05E489, 0x06623F, 0x050405, 0x040F19, 0x0227CC, 0x037473, 0x01C2E3,
- 0x0490FC, 0x039677, 0x029629, 0x021999, 0x029015, 0x014E78, 0x01724E, 0x00C8F5,
-},
-{
- 0x060000, 0x08D7A6, 0x09E1F6, 0x0DB528, 0x085450, 0x07EFEA, 0x0D9788, 0x0C3B7E,
- 0x06C000, 0x054DAE, 0x0A671E, 0x082C66, 0x03DB24, 0x01F73E, 0x05A145, 0x03037D,
- 0x0A4A08, 0x087818, 0x0A2455, 0x07F7ED, 0x05D569, 0x02F955, 0x057D20, 0x02CC54,
- 0x0A4A08, 0x0E4582, 0x09B373, 0x0D74A5, 0x08A000, 0x0BF696, 0x07123E, 0x09CEE0,
- 0x0B44E4, 0x0A2455, 0x093D32, 0x08A950, 0x0512DF, 0x0799B6, 0x02E59E, 0x0404A7,
- 0x0728D2, 0x06717F, 0x040E2F, 0x03A657, 0x0D7187, 0x0C194B, 0x0CACC8, 0x0B683A,
- 0x090000, 0x07123E, 0x07A918, 0x0604D2, 0x04DEEA, 0x029629, 0x042556, 0x021D11,
- 0x057AC8, 0x044E28, 0x031A97, 0x02851E, 0x03134C, 0x01915C, 0x01BC5D, 0x00F126,
-},
-{
- 0x080000, 0x0BCA33, 0x0D2D48, 0x1246E0, 0x0B1B15, 0x0A9538, 0x121F5F, 0x104F53,
- 0x090000, 0x07123E, 0x0DDED2, 0x0AE5DD, 0x052430, 0x029EFD, 0x0781B1, 0x0404A7,
- 0x0DB80B, 0x0B4ACB, 0x0D85C7, 0x0A9FE7, 0x07C736, 0x03F71D, 0x075180, 0x03BB1A,
- 0x0DB80B, 0x130757, 0x0CEF44, 0x11F0DC, 0x0B8000, 0x0FF372, 0x096DA8, 0x0D13D6,
- 0x0F0686, 0x0D85C7, 0x0C5198, 0x0B8C6A, 0x06C3D4, 0x0A2248, 0x03DCD3, 0x055B8A,
- 0x098BC3, 0x089754, 0x05683E, 0x04DDC9, 0x11ECB4, 0x1021B9, 0x10E661, 0x0F35A3,
- 0x0C0000, 0x096DA8, 0x0A36CB, 0x08066E, 0x067E8E, 0x0372E1, 0x05871E, 0x02D16B,
- 0x074E60, 0x05BD8B, 0x042374, 0x035C28, 0x0419BB, 0x021726, 0x02507C, 0x014188,
-},
-{
- 0x0C0000, 0x11AF4C, 0x13C3EC, 0x1B6A50, 0x10A89F, 0x0FDFD4, 0x1B2F0F, 0x1876FD,
- 0x0D8000, 0x0A9B5D, 0x14CE3C, 0x1058CB, 0x07B649, 0x03EE7B, 0x0B4289, 0x0606FB,
- 0x149410, 0x10F030, 0x1448AB, 0x0FEFDA, 0x0BAAD2, 0x05F2AB, 0x0AFA40, 0x0598A7,
- 0x149410, 0x1C8B03, 0x1366E6, 0x1AE949, 0x114000, 0x17ED2B, 0x0E247C, 0x139DC1,
- 0x1689C8, 0x1448AB, 0x127A63, 0x11529F, 0x0A25BE, 0x0F336D, 0x05CB3C, 0x08094E,
- 0x0E51A4, 0x0CE2FE, 0x081C5D, 0x074CAE, 0x1AE30E, 0x183296, 0x195991, 0x16D074,
- 0x120000, 0x0E247C, 0x0F5230, 0x0C09A5, 0x09BDD5, 0x052C51, 0x084AAC, 0x043A21,
- 0x0AF590, 0x089C51, 0x06352E, 0x050A3B, 0x062698, 0x0322B9, 0x0378BA, 0x01E24D,
-},
-{
- 0x110000, 0x190DAC, 0x1C0039, 0x26D69C, 0x17998C, 0x167D16, 0x2682AB, 0x22A891,
- 0x132000, 0x0F06C3, 0x1D797F, 0x172876, 0x0AECE7, 0x0591D9, 0x0FF398, 0x0889E3,
- 0x1D2717, 0x17FEEF, 0x1CBC47, 0x1693CA, 0x108754, 0x086D1D, 0x0F8D30, 0x07ED98,
- 0x1D2717, 0x286F9A, 0x1B7C71, 0x261FD3, 0x187000, 0x21E552, 0x140904, 0x1BCA27,
- 0x1FEDDC, 0x1CBC47, 0x1A2D62, 0x188A62, 0x0E6022, 0x1588DA, 0x083540, 0x0B6284,
- 0x1448FE, 0x124192, 0x0B7D84, 0x0A574B, 0x2616FF, 0x2247AA, 0x23E98D, 0x2051FA,
- 0x198000, 0x140904, 0x15B46F, 0x110DAA, 0x0DCCEE, 0x07541E, 0x0BBF1F, 0x05FD04,
- 0x0F868B, 0x0C32C8, 0x08CB57, 0x0723D4, 0x08B6AD, 0x047130, 0x04EB08, 0x02AB42,
-},
-{
- 0x160000, 0x206C0C, 0x243C86, 0x3242E8, 0x1E8A79, 0x1D1A59, 0x31D646, 0x2CDA25,
- 0x18C000, 0x13722A, 0x2624C3, 0x1DF820, 0x0E2385, 0x073537, 0x14A4A7, 0x0B0CCC,
- 0x25BA1D, 0x1F0DAE, 0x252FE4, 0x1D37BB, 0x1563D6, 0x0AE78E, 0x142021, 0x0A4288,
- 0x25BA1D, 0x345430, 0x2391FB, 0x31565C, 0x1FA000, 0x2BDD7A, 0x19ED8D, 0x23F68C,
- 0x2951EF, 0x252FE4, 0x21E061, 0x1FC224, 0x129A87, 0x1BDE47, 0x0A9F44, 0x0EBBBA,
- 0x1A4058, 0x17A026, 0x0EDEAB, 0x0D61E9, 0x314AEF, 0x2C5CBE, 0x2E798A, 0x29D380,
- 0x210000, 0x19ED8D, 0x1C16AE, 0x1611AE, 0x11DC06, 0x097BEA, 0x0F3391, 0x07BFE7,
- 0x141787, 0x0FC93E, 0x0B617F, 0x093D6D, 0x0B46C1, 0x05BFA8, 0x065D55, 0x037437,
-},
-{
- 0x1C0000, 0x2943B2, 0x2E1E7C, 0x3FF810, 0x26DEC9, 0x250A43, 0x3F6DCE, 0x3915A3,
- 0x1F8000, 0x18BFD8, 0x308BE1, 0x262485, 0x11FEA9, 0x092C75, 0x1A45EB, 0x0E1049,
- 0x300425, 0x2785C6, 0x2F5439, 0x252FA8, 0x1B393F, 0x0DE0E4, 0x199D41, 0x0D0EDC,
- 0x300425, 0x4299B2, 0x2D456E, 0x3ECB00, 0x284000, 0x37D40F, 0x20FFCB, 0x2DC56D,
- 0x3496D3, 0x2F5439, 0x2B1D93, 0x286B74, 0x17AD66, 0x2377FE, 0x0D84E2, 0x12C062,
- 0x21692A, 0x1E11A5, 0x12ECDA, 0x110840, 0x3EBC76, 0x387608, 0x3B2652, 0x353BBA,
- 0x2A0000, 0x20FFCB, 0x23BFC6, 0x1C1681, 0x16BAF1, 0x0C1213, 0x1358E8, 0x09DCF8,
- 0x19924F, 0x141767, 0x0E7C16, 0x0BC28A, 0x0E5A0D, 0x075104, 0x0819B2, 0x04655D,
-},
-{
- 0x220000, 0x321B58, 0x380072, 0x4DAD38, 0x2F3318, 0x2CFA2D, 0x4D0556, 0x455122,
- 0x264000, 0x1E0D86, 0x3AF2FE, 0x2E50EB, 0x15D9CE, 0x0B23B2, 0x1FE730, 0x1113C7,
- 0x3A4E2D, 0x2FFDDF, 0x39788E, 0x2D2795, 0x210EA8, 0x10DA39, 0x1F1A61, 0x0FDB2F,
- 0x3A4E2D, 0x50DF33, 0x36F8E1, 0x4C3FA5, 0x30E000, 0x43CAA5, 0x281209, 0x37944D,
- 0x3FDBB7, 0x39788E, 0x345AC4, 0x3114C3, 0x1CC044, 0x2B11B4, 0x106A80, 0x16C509,
- 0x2891FC, 0x248324, 0x16FB08, 0x14AE97, 0x4C2DFD, 0x448F54, 0x47D31B, 0x40A3F5,
- 0x330000, 0x281209, 0x2B68DF, 0x221B53, 0x1B99DB, 0x0EA83B, 0x177E3E, 0x0BFA09,
- 0x1F0D17, 0x18658F, 0x1196AE, 0x0E47A8, 0x116D5A, 0x08E260, 0x09D60F, 0x055684,
-},
-{
- 0x2C0000, 0x40D818, 0x48790C, 0x6485D0, 0x3D14F2, 0x3A34B2, 0x63AC8D, 0x59B44A,
- 0x318000, 0x26E454, 0x4C4986, 0x3BF03F, 0x1C470A, 0x0E6A6E, 0x29494D, 0x161998,
- 0x4B743A, 0x3E1B5C, 0x4A5FC7, 0x3A6F75, 0x2AC7AC, 0x15CF1D, 0x284041, 0x148510,
- 0x4B743A, 0x68A861, 0x4723F6, 0x62ACB8, 0x3F4000, 0x57BAF3, 0x33DB1A, 0x47ED19,
- 0x52A3DE, 0x4A5FC7, 0x43C0C2, 0x3F8448, 0x25350D, 0x37BC8E, 0x153E87, 0x1D7775,
- 0x3480B0, 0x2F404C, 0x1DBD56, 0x1AC3D2, 0x6295DE, 0x58B97B, 0x5CF313, 0x53A701,
- 0x420000, 0x33DB1A, 0x382D5C, 0x2C235D, 0x23B80D, 0x12F7D4, 0x1E6723, 0x0F7FCF,
- 0x282F0E, 0x1F927D, 0x16C2FF, 0x127AD9, 0x168D83, 0x0B7F50, 0x0CBAAA, 0x06E86E,
-},
-};
-
-static const uint8_t binkb_runbits[64] = {
-    6, 6, 6, 6, 6, 6, 6, 6,
-    6, 6, 6, 6, 6, 6, 6, 6,
-    6, 6, 6, 6, 6, 6, 6, 6,
-    6, 6, 6, 6, 6, 6, 6, 6,
-    5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5,
-    4, 4, 4, 4, 4, 4, 4, 4,
-    3, 3, 3, 3, 2, 2, 1, 0,
-};
-
-static const uint8_t binkb_intra_seed[64] = {
-    16, 16, 16, 19, 16, 19, 22, 22,
-    22, 22, 26, 24, 26, 22, 22, 27,
-    27, 27, 26, 26, 26, 29, 29, 29,
-    27, 27, 27, 26, 34, 34, 34, 29,
-    29, 29, 27, 27, 37, 34, 34, 32,
-    32, 29, 29, 38, 37, 35, 35, 34,
-    35, 40, 40, 40, 38, 38, 48, 48,
-    46, 46, 58, 56, 56, 69, 69, 83,
-};
-
-static const uint8_t binkb_inter_seed[64] = {
-    16, 17, 17, 18, 18, 18, 19, 19,
-    19, 19, 20, 20, 20, 20, 20, 21,
-    21, 21, 21, 21, 21, 22, 22, 22,
-    22, 22, 22, 22, 23, 23, 23, 23,
-    23, 23, 23, 23, 24, 24, 24, 25,
-    24, 24, 24, 25, 26, 26, 26, 26,
-    25, 27, 27, 27, 27, 27, 28, 28,
-    28, 28, 30, 30, 30, 31, 31, 33,
-};
-
-static const uint8_t binkb_num[16] = {
-    1, 4, 5, 2, 7, 8, 3, 7, 4, 9, 5, 6, 7, 8, 9, 10
-};
-
-static const uint8_t binkb_den[16] = {
-    1, 3, 3, 1, 3, 3, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1
-};
-
-#endif /* AVCODEC_BINKDATA_H */
diff --git a/deps/libav/libavcodec/binkdsp.c b/deps/libav/libavcodec/binkdsp.c
deleted file mode 100644
index a0ac2a8..0000000
--- a/deps/libav/libavcodec/binkdsp.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Bink DSP routines
- * Copyright (c) 2009 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Bink DSP routines
- */
-
-#include "libavutil/attributes.h"
-#include "dsputil.h"
-#include "binkdsp.h"
-
-#define A1  2896 /* (1/sqrt(2))<<12 */
-#define A2  2217
-#define A3  3784
-#define A4 -5352
-
-#define IDCT_TRANSFORM(dest,s0,s1,s2,s3,s4,s5,s6,s7,d0,d1,d2,d3,d4,d5,d6,d7,munge,src) {\
-    const int a0 = (src)[s0] + (src)[s4]; \
-    const int a1 = (src)[s0] - (src)[s4]; \
-    const int a2 = (src)[s2] + (src)[s6]; \
-    const int a3 = (A1*((src)[s2] - (src)[s6])) >> 11; \
-    const int a4 = (src)[s5] + (src)[s3]; \
-    const int a5 = (src)[s5] - (src)[s3]; \
-    const int a6 = (src)[s1] + (src)[s7]; \
-    const int a7 = (src)[s1] - (src)[s7]; \
-    const int b0 = a4 + a6; \
-    const int b1 = (A3*(a5 + a7)) >> 11; \
-    const int b2 = ((A4*a5) >> 11) - b0 + b1; \
-    const int b3 = (A1*(a6 - a4) >> 11) - b2; \
-    const int b4 = ((A2*a7) >> 11) + b3 - b1; \
-    (dest)[d0] = munge(a0+a2   +b0); \
-    (dest)[d1] = munge(a1+a3-a2+b2); \
-    (dest)[d2] = munge(a1-a3+a2+b3); \
-    (dest)[d3] = munge(a0-a2   -b4); \
-    (dest)[d4] = munge(a0-a2   +b4); \
-    (dest)[d5] = munge(a1-a3+a2-b3); \
-    (dest)[d6] = munge(a1+a3-a2-b2); \
-    (dest)[d7] = munge(a0+a2   -b0); \
-}
-/* end IDCT_TRANSFORM macro */
-
-#define MUNGE_NONE(x) (x)
-#define IDCT_COL(dest,src) IDCT_TRANSFORM(dest,0,8,16,24,32,40,48,56,0,8,16,24,32,40,48,56,MUNGE_NONE,src)
-
-#define MUNGE_ROW(x) (((x) + 0x7F)>>8)
-#define IDCT_ROW(dest,src) IDCT_TRANSFORM(dest,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,MUNGE_ROW,src)
-
-static inline void bink_idct_col(int *dest, const int32_t *src)
-{
-    if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) {
-        dest[0]  =
-        dest[8]  =
-        dest[16] =
-        dest[24] =
-        dest[32] =
-        dest[40] =
-        dest[48] =
-        dest[56] = src[0];
-    } else {
-        IDCT_COL(dest, src);
-    }
-}
-
-static void bink_idct_c(int32_t *block)
-{
-    int i;
-    int temp[64];
-
-    for (i = 0; i < 8; i++)
-        bink_idct_col(&temp[i], &block[i]);
-    for (i = 0; i < 8; i++) {
-        IDCT_ROW( (&block[8*i]), (&temp[8*i]) );
-    }
-}
-
-static void bink_idct_add_c(uint8_t *dest, int linesize, int32_t *block)
-{
-    int i, j;
-
-    bink_idct_c(block);
-    for (i = 0; i < 8; i++, dest += linesize, block += 8)
-        for (j = 0; j < 8; j++)
-             dest[j] += block[j];
-}
-
-static void bink_idct_put_c(uint8_t *dest, int linesize, int32_t *block)
-{
-    int i;
-    int temp[64];
-    for (i = 0; i < 8; i++)
-        bink_idct_col(&temp[i], &block[i]);
-    for (i = 0; i < 8; i++) {
-        IDCT_ROW( (&dest[i*linesize]), (&temp[8*i]) );
-    }
-}
-
-static void scale_block_c(const uint8_t src[64]/*align 8*/, uint8_t *dst/*align 8*/, int linesize)
-{
-    int i, j;
-    uint16_t *dst1 = (uint16_t *) dst;
-    uint16_t *dst2 = (uint16_t *)(dst + linesize);
-
-    for (j = 0; j < 8; j++) {
-        for (i = 0; i < 8; i++) {
-            dst1[i] = dst2[i] = src[i] * 0x0101;
-        }
-        src  += 8;
-        dst1 += linesize;
-        dst2 += linesize;
-    }
-}
-
-av_cold void ff_binkdsp_init(BinkDSPContext *c)
-{
-    c->idct_add    = bink_idct_add_c;
-    c->idct_put    = bink_idct_put_c;
-    c->scale_block = scale_block_c;
-}
diff --git a/deps/libav/libavcodec/binkdsp.h b/deps/libav/libavcodec/binkdsp.h
deleted file mode 100644
index 4c1f73f..0000000
--- a/deps/libav/libavcodec/binkdsp.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Bink DSP routines
- * Copyright (c) 2009 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Bink DSP routines
- */
-
-#ifndef AVCODEC_BINKDSP_H
-#define AVCODEC_BINKDSP_H
-
-#include <stdint.h>
-
-typedef struct BinkDSPContext {
-    void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, int32_t *block/*align 16*/);
-    void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int32_t *block/*align 16*/);
-    void (*scale_block)(const uint8_t src[64]/*align 8*/, uint8_t *dst/*align 8*/, int linesize);
-} BinkDSPContext;
-
-void ff_binkdsp_init(BinkDSPContext *c);
-
-#endif /* AVCODEC_BINKDSP_H */
diff --git a/deps/libav/libavcodec/bit_depth_template.c b/deps/libav/libavcodec/bit_depth_template.c
deleted file mode 100644
index 8fc826b..0000000
--- a/deps/libav/libavcodec/bit_depth_template.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "rnd_avg.h"
-
-#ifndef BIT_DEPTH
-#define BIT_DEPTH 8
-#endif
-
-#ifdef AVCODEC_BIT_DEPTH_TEMPLATE_C
-#   undef pixel
-#   undef pixel2
-#   undef pixel4
-#   undef dctcoef
-#   undef INIT_CLIP
-#   undef no_rnd_avg_pixel4
-#   undef rnd_avg_pixel4
-#   undef AV_RN2P
-#   undef AV_RN4P
-#   undef AV_RN4PA
-#   undef AV_WN2P
-#   undef AV_WN4P
-#   undef AV_WN4PA
-#   undef CLIP
-#   undef FUNC
-#   undef FUNCC
-#   undef av_clip_pixel
-#   undef PIXEL_SPLAT_X4
-#else
-#   define AVCODEC_BIT_DEPTH_TEMPLATE_C
-#endif
-
-#if BIT_DEPTH > 8
-#   define pixel  uint16_t
-#   define pixel2 uint32_t
-#   define pixel4 uint64_t
-#   define dctcoef int32_t
-
-#   define INIT_CLIP
-#   define no_rnd_avg_pixel4 no_rnd_avg64
-#   define    rnd_avg_pixel4    rnd_avg64
-#   define AV_RN2P  AV_RN32
-#   define AV_RN4P  AV_RN64
-#   define AV_RN4PA AV_RN64A
-#   define AV_WN2P  AV_WN32
-#   define AV_WN4P  AV_WN64
-#   define AV_WN4PA AV_WN64A
-#   define PIXEL_SPLAT_X4(x) ((x)*0x0001000100010001ULL)
-
-#   define av_clip_pixel(a) av_clip_uintp2(a, BIT_DEPTH)
-#   define CLIP(a)          av_clip_uintp2(a, BIT_DEPTH)
-#else
-#   define pixel  uint8_t
-#   define pixel2 uint16_t
-#   define pixel4 uint32_t
-#   define dctcoef int16_t
-
-#   define INIT_CLIP const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-#   define no_rnd_avg_pixel4 no_rnd_avg32
-#   define    rnd_avg_pixel4    rnd_avg32
-#   define AV_RN2P  AV_RN16
-#   define AV_RN4P  AV_RN32
-#   define AV_RN4PA AV_RN32A
-#   define AV_WN2P  AV_WN16
-#   define AV_WN4P  AV_WN32
-#   define AV_WN4PA AV_WN32A
-#   define PIXEL_SPLAT_X4(x) ((x)*0x01010101U)
-
-#   define av_clip_pixel(a) av_clip_uint8(a)
-#   define CLIP(a) cm[a]
-#endif
-
-#define FUNC3(a, b, c)  a ## _ ## b ## c
-#define FUNC2(a, b, c)  FUNC3(a, b, c)
-#define FUNC(a)  FUNC2(a, BIT_DEPTH,)
-#define FUNCC(a) FUNC2(a, BIT_DEPTH, _c)
diff --git a/deps/libav/libavcodec/bitstream.c b/deps/libav/libavcodec/bitstream.c
deleted file mode 100644
index 8e9f657..0000000
--- a/deps/libav/libavcodec/bitstream.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * Common bit i/o utils
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2010 Loren Merritt
- *
- * alternative bitstream reader & writer by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * bitstream api.
- */
-
-#include "avcodec.h"
-#include "mathops.h"
-#include "get_bits.h"
-#include "put_bits.h"
-
-const uint8_t ff_log2_run[41]={
- 0, 0, 0, 0, 1, 1, 1, 1,
- 2, 2, 2, 2, 3, 3, 3, 3,
- 4, 4, 5, 5, 6, 6, 7, 7,
- 8, 9,10,11,12,13,14,15,
-16,17,18,19,20,21,22,23,
-24,
-};
-
-void avpriv_align_put_bits(PutBitContext *s)
-{
-    put_bits(s, s->bit_left & 7, 0);
-}
-
-void avpriv_put_string(PutBitContext *pb, const char *string,
-                       int terminate_string)
-{
-    while (*string) {
-        put_bits(pb, 8, *string);
-        string++;
-    }
-    if (terminate_string)
-        put_bits(pb, 8, 0);
-}
-
-void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
-{
-    int words = length >> 4;
-    int bits  = length & 15;
-    int i;
-
-    if (length == 0)
-        return;
-
-    if (CONFIG_SMALL || words < 16 || put_bits_count(pb) & 7) {
-        for (i = 0; i < words; i++)
-            put_bits(pb, 16, AV_RB16(src + 2 * i));
-    } else {
-        for (i = 0; put_bits_count(pb) & 31; i++)
-            put_bits(pb, 8, src[i]);
-        flush_put_bits(pb);
-        memcpy(put_bits_ptr(pb), src + i, 2 * words - i);
-        skip_put_bytes(pb, 2 * words - i);
-    }
-
-    put_bits(pb, bits, AV_RB16(src + 2 * words) >> (16 - bits));
-}
-
-/* VLC decoding */
-
-#define GET_DATA(v, table, i, wrap, size)                   \
-{                                                           \
-    const uint8_t *ptr = (const uint8_t *)table + i * wrap; \
-    switch(size) {                                          \
-    case 1:                                                 \
-        v = *(const uint8_t *)ptr;                          \
-        break;                                              \
-    case 2:                                                 \
-        v = *(const uint16_t *)ptr;                         \
-        break;                                              \
-    default:                                                \
-        v = *(const uint32_t *)ptr;                         \
-        break;                                              \
-    }                                                       \
-}
-
-
-static int alloc_table(VLC *vlc, int size, int use_static)
-{
-    int index = vlc->table_size;
-
-    vlc->table_size += size;
-    if (vlc->table_size > vlc->table_allocated) {
-        int err;
-        if (use_static)
-            return AVERROR_BUG;
-        vlc->table_allocated += (1 << vlc->bits);
-        if ((err = av_reallocp(&vlc->table,
-                               sizeof(VLC_TYPE) * 2 *
-                               vlc->table_allocated)) < 0) {
-            vlc->table_allocated = 0;
-            vlc->table_size = 0;
-            return err;
-        }
-    }
-    return index;
-}
-
-static av_always_inline uint32_t bitswap_32(uint32_t x)
-{
-    return (uint32_t)ff_reverse[ x        & 0xFF] << 24 |
-           (uint32_t)ff_reverse[(x >> 8)  & 0xFF] << 16 |
-           (uint32_t)ff_reverse[(x >> 16) & 0xFF] << 8  |
-           (uint32_t)ff_reverse[ x >> 24];
-}
-
-typedef struct {
-    uint8_t bits;
-    uint16_t symbol;
-    /** codeword, with the first bit-to-be-read in the msb
-     * (even if intended for a little-endian bitstream reader) */
-    uint32_t code;
-} VLCcode;
-
-static int compare_vlcspec(const void *a, const void *b)
-{
-    const VLCcode *sa = a, *sb = b;
-    return (sa->code >> 1) - (sb->code >> 1);
-}
-/**
- * Build VLC decoding tables suitable for use with get_vlc().
- *
- * @param vlc            the context to be initted
- *
- * @param table_nb_bits  max length of vlc codes to store directly in this table
- *                       (Longer codes are delegated to subtables.)
- *
- * @param nb_codes       number of elements in codes[]
- *
- * @param codes          descriptions of the vlc codes
- *                       These must be ordered such that codes going into the same subtable are contiguous.
- *                       Sorting by VLCcode.code is sufficient, though not necessary.
- */
-static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
-                       VLCcode *codes, int flags)
-{
-    int table_size, table_index, index, code_prefix, symbol, subtable_bits;
-    int i, j, k, n, nb, inc;
-    uint32_t code;
-    VLC_TYPE (*table)[2];
-
-    table_size = 1 << table_nb_bits;
-    table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC);
-    av_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size);
-    if (table_index < 0)
-        return table_index;
-    table = &vlc->table[table_index];
-
-    for (i = 0; i < table_size; i++) {
-        table[i][1] = 0; //bits
-        table[i][0] = -1; //codes
-    }
-
-    /* first pass: map codes and compute auxiliary table sizes */
-    for (i = 0; i < nb_codes; i++) {
-        n      = codes[i].bits;
-        code   = codes[i].code;
-        symbol = codes[i].symbol;
-        av_dlog(NULL, "i=%d n=%d code=0x%x\n", i, n, code);
-        if (n <= table_nb_bits) {
-            /* no need to add another table */
-            j = code >> (32 - table_nb_bits);
-            nb = 1 << (table_nb_bits - n);
-            inc = 1;
-            if (flags & INIT_VLC_LE) {
-                j = bitswap_32(code);
-                inc = 1 << n;
-            }
-            for (k = 0; k < nb; k++) {
-                av_dlog(NULL, "%4x: code=%d n=%d\n", j, i, n);
-                if (table[j][1] /*bits*/ != 0) {
-                    av_log(NULL, AV_LOG_ERROR, "incorrect codes\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                table[j][1] = n; //bits
-                table[j][0] = symbol;
-                j += inc;
-            }
-        } else {
-            /* fill auxiliary table recursively */
-            n -= table_nb_bits;
-            code_prefix = code >> (32 - table_nb_bits);
-            subtable_bits = n;
-            codes[i].bits = n;
-            codes[i].code = code << table_nb_bits;
-            for (k = i+1; k < nb_codes; k++) {
-                n = codes[k].bits - table_nb_bits;
-                if (n <= 0)
-                    break;
-                code = codes[k].code;
-                if (code >> (32 - table_nb_bits) != code_prefix)
-                    break;
-                codes[k].bits = n;
-                codes[k].code = code << table_nb_bits;
-                subtable_bits = FFMAX(subtable_bits, n);
-            }
-            subtable_bits = FFMIN(subtable_bits, table_nb_bits);
-            j = (flags & INIT_VLC_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix;
-            table[j][1] = -subtable_bits;
-            av_dlog(NULL, "%4x: n=%d (subtable)\n",
-                    j, codes[i].bits + table_nb_bits);
-            index = build_table(vlc, subtable_bits, k-i, codes+i, flags);
-            if (index < 0)
-                return index;
-            /* note: realloc has been done, so reload tables */
-            table = &vlc->table[table_index];
-            table[j][0] = index; //code
-            i = k-1;
-        }
-    }
-    return table_index;
-}
-
-
-/* Build VLC decoding tables suitable for use with get_vlc().
-
-   'nb_bits' set thee decoding table size (2^nb_bits) entries. The
-   bigger it is, the faster is the decoding. But it should not be too
-   big to save memory and L1 cache. '9' is a good compromise.
-
-   'nb_codes' : number of vlcs codes
-
-   'bits' : table which gives the size (in bits) of each vlc code.
-
-   'codes' : table which gives the bit pattern of of each vlc code.
-
-   'symbols' : table which gives the values to be returned from get_vlc().
-
-   'xxx_wrap' : give the number of bytes between each entry of the
-   'bits' or 'codes' tables.
-
-   'xxx_size' : gives the number of bytes of each entry of the 'bits'
-   or 'codes' tables.
-
-   'wrap' and 'size' allows to use any memory configuration and types
-   (byte/word/long) to store the 'bits', 'codes', and 'symbols' tables.
-
-   'use_static' should be set to 1 for tables, which should be freed
-   with av_free_static(), 0 if ff_free_vlc() will be used.
-*/
-int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
-                       const void *bits, int bits_wrap, int bits_size,
-                       const void *codes, int codes_wrap, int codes_size,
-                       const void *symbols, int symbols_wrap, int symbols_size,
-                       int flags)
-{
-    VLCcode *buf;
-    int i, j, ret;
-
-    vlc->bits = nb_bits;
-    if (flags & INIT_VLC_USE_NEW_STATIC) {
-        if (vlc->table_size && vlc->table_size == vlc->table_allocated) {
-            return 0;
-        } else if (vlc->table_size) {
-            return AVERROR_BUG;
-        }
-    } else {
-        vlc->table           = NULL;
-        vlc->table_allocated = 0;
-        vlc->table_size      = 0;
-    }
-
-    av_dlog(NULL, "build table nb_codes=%d\n", nb_codes);
-
-    buf = av_malloc((nb_codes + 1) * sizeof(VLCcode));
-    if (!buf)
-        return AVERROR(ENOMEM);
-
-    assert(symbols_size <= 2 || !symbols);
-    j = 0;
-#define COPY(condition)                                                     \
-    for (i = 0; i < nb_codes; i++) {                                        \
-        GET_DATA(buf[j].bits, bits, i, bits_wrap, bits_size);               \
-        if (!(condition))                                                   \
-            continue;                                                       \
-        GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size);            \
-        if (flags & INIT_VLC_LE)                                            \
-            buf[j].code = bitswap_32(buf[j].code);                          \
-        else                                                                \
-            buf[j].code <<= 32 - buf[j].bits;                               \
-        if (symbols)                                                        \
-            GET_DATA(buf[j].symbol, symbols, i, symbols_wrap, symbols_size) \
-            else                                                            \
-                buf[j].symbol = i;                                          \
-        j++;                                                                \
-    }
-    COPY(buf[j].bits > nb_bits);
-    // qsort is the slowest part of init_vlc, and could probably be improved or avoided
-    qsort(buf, j, sizeof(VLCcode), compare_vlcspec);
-    COPY(buf[j].bits && buf[j].bits <= nb_bits);
-    nb_codes = j;
-
-    ret = build_table(vlc, nb_bits, nb_codes, buf, flags);
-
-    av_free(buf);
-    if (ret < 0) {
-        av_freep(&vlc->table);
-        return ret;
-    }
-    if ((flags & INIT_VLC_USE_NEW_STATIC) &&
-        vlc->table_size != vlc->table_allocated)
-        av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n",
-               vlc->table_size, vlc->table_allocated);
-    return 0;
-}
-
-
-void ff_free_vlc(VLC *vlc)
-{
-    av_freep(&vlc->table);
-}
diff --git a/deps/libav/libavcodec/bitstream_filter.c b/deps/libav/libavcodec/bitstream_filter.c
deleted file mode 100644
index 8960b19..0000000
--- a/deps/libav/libavcodec/bitstream_filter.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "avcodec.h"
-#include "libavutil/mem.h"
-
-static AVBitStreamFilter *first_bitstream_filter = NULL;
-
-AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f)
-{
-    if (f)
-        return f->next;
-    else
-        return first_bitstream_filter;
-}
-
-void av_register_bitstream_filter(AVBitStreamFilter *bsf)
-{
-    bsf->next              = first_bitstream_filter;
-    first_bitstream_filter = bsf;
-}
-
-AVBitStreamFilterContext *av_bitstream_filter_init(const char *name)
-{
-    AVBitStreamFilter *bsf = first_bitstream_filter;
-
-    while (bsf) {
-        if (!strcmp(name, bsf->name)) {
-            AVBitStreamFilterContext *bsfc =
-                av_mallocz(sizeof(AVBitStreamFilterContext));
-            bsfc->filter    = bsf;
-            bsfc->priv_data =
-                bsf->priv_data_size ? av_mallocz(bsf->priv_data_size) : NULL;
-            return bsfc;
-        }
-        bsf = bsf->next;
-    }
-    return NULL;
-}
-
-void av_bitstream_filter_close(AVBitStreamFilterContext *bsfc)
-{
-    if (bsfc->filter->close)
-        bsfc->filter->close(bsfc);
-    av_freep(&bsfc->priv_data);
-    av_parser_close(bsfc->parser);
-    av_free(bsfc);
-}
-
-int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
-                               AVCodecContext *avctx, const char *args,
-                               uint8_t **poutbuf, int *poutbuf_size,
-                               const uint8_t *buf, int buf_size, int keyframe)
-{
-    *poutbuf      = (uint8_t *)buf;
-    *poutbuf_size = buf_size;
-    return bsfc->filter->filter(bsfc, avctx, args, poutbuf, poutbuf_size,
-                                buf, buf_size, keyframe);
-}
diff --git a/deps/libav/libavcodec/bmp.c b/deps/libav/libavcodec/bmp.c
deleted file mode 100644
index e5f7ebb..0000000
--- a/deps/libav/libavcodec/bmp.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * BMP image format decoder
- * Copyright (c) 2005 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "bmp.h"
-#include "internal.h"
-#include "msrledec.h"
-
-static int bmp_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    AVFrame *p         = data;
-    unsigned int fsize, hsize;
-    int width, height;
-    unsigned int depth;
-    BiCompression comp;
-    unsigned int ihsize;
-    int i, j, n, linesize, ret;
-    uint32_t rgb[3];
-    uint8_t *ptr;
-    int dsize;
-    const uint8_t *buf0 = buf;
-    GetByteContext gb;
-
-    if (buf_size < 14) {
-        av_log(avctx, AV_LOG_ERROR, "buf size too small (%d)\n", buf_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (bytestream_get_byte(&buf) != 'B' ||
-        bytestream_get_byte(&buf) != 'M') {
-        av_log(avctx, AV_LOG_ERROR, "bad magic number\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    fsize = bytestream_get_le32(&buf);
-    if (buf_size < fsize) {
-        av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d), trying to decode anyway\n",
-               buf_size, fsize);
-        fsize = buf_size;
-    }
-
-    buf += 2; /* reserved1 */
-    buf += 2; /* reserved2 */
-
-    hsize  = bytestream_get_le32(&buf); /* header size */
-    ihsize = bytestream_get_le32(&buf); /* more header size */
-    if (ihsize + 14 > hsize) {
-        av_log(avctx, AV_LOG_ERROR, "invalid header size %d\n", hsize);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* sometimes file size is set to some headers size, set a real size in that case */
-    if (fsize == 14 || fsize == ihsize + 14)
-        fsize = buf_size - 2;
-
-    if (fsize <= hsize) {
-        av_log(avctx, AV_LOG_ERROR, "declared file size is less than header size (%d < %d)\n",
-               fsize, hsize);
-        return AVERROR_INVALIDDATA;
-    }
-
-    switch (ihsize) {
-    case  40: // windib v3
-    case  64: // OS/2 v2
-    case 108: // windib v4
-    case 124: // windib v5
-        width  = bytestream_get_le32(&buf);
-        height = bytestream_get_le32(&buf);
-        break;
-    case  12: // OS/2 v1
-        width  = bytestream_get_le16(&buf);
-        height = bytestream_get_le16(&buf);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "unsupported BMP file, patch welcome\n");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* planes */
-    if (bytestream_get_le16(&buf) != 1) {
-        av_log(avctx, AV_LOG_ERROR, "invalid BMP header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    depth = bytestream_get_le16(&buf);
-
-    if (ihsize == 40)
-        comp = bytestream_get_le32(&buf);
-    else
-        comp = BMP_RGB;
-
-    if (comp != BMP_RGB && comp != BMP_BITFIELDS && comp != BMP_RLE4 &&
-        comp != BMP_RLE8) {
-        av_log(avctx, AV_LOG_ERROR, "BMP coding %d not supported\n", comp);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (comp == BMP_BITFIELDS) {
-        buf += 20;
-        rgb[0] = bytestream_get_le32(&buf);
-        rgb[1] = bytestream_get_le32(&buf);
-        rgb[2] = bytestream_get_le32(&buf);
-    }
-
-    avctx->width  = width;
-    avctx->height = height > 0 ? height : -height;
-
-    avctx->pix_fmt = AV_PIX_FMT_NONE;
-
-    switch (depth) {
-    case 32:
-        if (comp == BMP_BITFIELDS) {
-            rgb[0] = (rgb[0] >> 15) & 3;
-            rgb[1] = (rgb[1] >> 15) & 3;
-            rgb[2] = (rgb[2] >> 15) & 3;
-
-            if (rgb[0] + rgb[1] + rgb[2] != 3 ||
-                rgb[0] == rgb[1] || rgb[0] == rgb[2] || rgb[1] == rgb[2]) {
-                break;
-            }
-        } else {
-            rgb[0] = 2;
-            rgb[1] = 1;
-            rgb[2] = 0;
-        }
-
-        avctx->pix_fmt = AV_PIX_FMT_BGR24;
-        break;
-    case 24:
-        avctx->pix_fmt = AV_PIX_FMT_BGR24;
-        break;
-    case 16:
-        if (comp == BMP_RGB)
-            avctx->pix_fmt = AV_PIX_FMT_RGB555;
-        else if (comp == BMP_BITFIELDS) {
-            if (rgb[0] == 0xF800 && rgb[1] == 0x07E0 && rgb[2] == 0x001F)
-               avctx->pix_fmt = AV_PIX_FMT_RGB565;
-            else if (rgb[0] == 0x7C00 && rgb[1] == 0x03E0 && rgb[2] == 0x001F)
-               avctx->pix_fmt = AV_PIX_FMT_RGB555;
-            else if (rgb[0] == 0x0F00 && rgb[1] == 0x00F0 && rgb[2] == 0x000F)
-               avctx->pix_fmt = AV_PIX_FMT_RGB444;
-            else {
-               av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]);
-               return AVERROR(EINVAL);
-            }
-        }
-        break;
-    case 8:
-        if (hsize - ihsize - 14 > 0)
-            avctx->pix_fmt = AV_PIX_FMT_PAL8;
-        else
-            avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-        break;
-    case 1:
-    case 4:
-        if (hsize - ihsize - 14 > 0) {
-            avctx->pix_fmt = AV_PIX_FMT_PAL8;
-        } else {
-            av_log(avctx, AV_LOG_ERROR, "Unknown palette for %d-colour BMP\n", 1<<depth);
-            return AVERROR_INVALIDDATA;
-        }
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "depth %d not supported\n", depth);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
-        av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->key_frame = 1;
-
-    buf   = buf0 + hsize;
-    dsize = buf_size - hsize;
-
-    /* Line size in file multiple of 4 */
-    n = ((avctx->width * depth) / 8 + 3) & ~3;
-
-    if (n * avctx->height > dsize && comp != BMP_RLE4 && comp != BMP_RLE8) {
-        av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d)\n",
-               dsize, n * avctx->height);
-        return AVERROR_INVALIDDATA;
-    }
-
-    // RLE may skip decoding some picture areas, so blank picture before decoding
-    if (comp == BMP_RLE4 || comp == BMP_RLE8)
-        memset(p->data[0], 0, avctx->height * p->linesize[0]);
-
-    if (height > 0) {
-        ptr      = p->data[0] + (avctx->height - 1) * p->linesize[0];
-        linesize = -p->linesize[0];
-    } else {
-        ptr      = p->data[0];
-        linesize = p->linesize[0];
-    }
-
-    if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
-        int colors = 1 << depth;
-
-        memset(p->data[1], 0, 1024);
-
-        if (ihsize >= 36) {
-            int t;
-            buf = buf0 + 46;
-            t   = bytestream_get_le32(&buf);
-            if (t < 0 || t > (1 << depth)) {
-                av_log(avctx, AV_LOG_ERROR, "Incorrect number of colors - %X for bitdepth %d\n", t, depth);
-            } else if (t) {
-                colors = t;
-            }
-        }
-        buf = buf0 + 14 + ihsize; //palette location
-        // OS/2 bitmap, 3 bytes per palette entry
-        if ((hsize-ihsize-14) < (colors << 2)) {
-            for (i = 0; i < colors; i++)
-                ((uint32_t*)p->data[1])[i] = bytestream_get_le24(&buf);
-        } else {
-            for (i = 0; i < colors; i++)
-                ((uint32_t*)p->data[1])[i] = bytestream_get_le32(&buf);
-        }
-        buf = buf0 + hsize;
-    }
-    if (comp == BMP_RLE4 || comp == BMP_RLE8) {
-        if (height < 0) {
-            p->data[0]    +=  p->linesize[0] * (avctx->height - 1);
-            p->linesize[0] = -p->linesize[0];
-        }
-        bytestream2_init(&gb, buf, dsize);
-        ff_msrle_decode(avctx, (AVPicture*)p, depth, &gb);
-        if (height < 0) {
-            p->data[0]    +=  p->linesize[0] * (avctx->height - 1);
-            p->linesize[0] = -p->linesize[0];
-        }
-    } else {
-        switch (depth) {
-        case 1:
-            for (i = 0; i < avctx->height; i++) {
-                int j;
-                for (j = 0; j < n; j++) {
-                    ptr[j*8+0] =  buf[j] >> 7;
-                    ptr[j*8+1] = (buf[j] >> 6) & 1;
-                    ptr[j*8+2] = (buf[j] >> 5) & 1;
-                    ptr[j*8+3] = (buf[j] >> 4) & 1;
-                    ptr[j*8+4] = (buf[j] >> 3) & 1;
-                    ptr[j*8+5] = (buf[j] >> 2) & 1;
-                    ptr[j*8+6] = (buf[j] >> 1) & 1;
-                    ptr[j*8+7] =  buf[j]       & 1;
-                }
-                buf += n;
-                ptr += linesize;
-            }
-            break;
-        case 8:
-        case 24:
-            for (i = 0; i < avctx->height; i++) {
-                memcpy(ptr, buf, n);
-                buf += n;
-                ptr += linesize;
-            }
-            break;
-        case 4:
-            for (i = 0; i < avctx->height; i++) {
-                int j;
-                for (j = 0; j < n; j++) {
-                    ptr[j*2+0] = (buf[j] >> 4) & 0xF;
-                    ptr[j*2+1] = buf[j] & 0xF;
-                }
-                buf += n;
-                ptr += linesize;
-            }
-            break;
-        case 16:
-            for (i = 0; i < avctx->height; i++) {
-                const uint16_t *src = (const uint16_t *) buf;
-                uint16_t *dst       = (uint16_t *) ptr;
-
-                for (j = 0; j < avctx->width; j++)
-                    *dst++ = av_le2ne16(*src++);
-
-                buf += n;
-                ptr += linesize;
-            }
-            break;
-        case 32:
-            for (i = 0; i < avctx->height; i++) {
-                const uint8_t *src = buf;
-                uint8_t *dst       = ptr;
-
-                for (j = 0; j < avctx->width; j++) {
-                    dst[0] = src[rgb[2]];
-                    dst[1] = src[rgb[1]];
-                    dst[2] = src[rgb[0]];
-                    dst += 3;
-                    src += 4;
-                }
-
-                buf += n;
-                ptr += linesize;
-            }
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "BMP decoder is broken\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_bmp_decoder = {
-    .name           = "bmp",
-    .long_name      = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_BMP,
-    .decode         = bmp_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/bmp.h b/deps/libav/libavcodec/bmp.h
deleted file mode 100644
index a472f59..0000000
--- a/deps/libav/libavcodec/bmp.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * internals for BMP codecs
- * Copyright (c) 2005 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_BMP_H
-#define AVCODEC_BMP_H
-
-#include "avcodec.h"
-
-typedef enum {
-    BMP_RGB         =0,
-    BMP_RLE8        =1,
-    BMP_RLE4        =2,
-    BMP_BITFIELDS   =3,
-} BiCompression;
-
-#endif /* AVCODEC_BMP_H */
diff --git a/deps/libav/libavcodec/bmpenc.c b/deps/libav/libavcodec/bmpenc.c
deleted file mode 100644
index a14fc61..0000000
--- a/deps/libav/libavcodec/bmpenc.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * BMP image format encoder
- * Copyright (c) 2006, 2007 Michel Bardiaux
- * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "bmp.h"
-#include "internal.h"
-
-static const uint32_t monoblack_pal[] = { 0x000000, 0xFFFFFF };
-static const uint32_t rgb565_masks[]  = { 0xF800, 0x07E0, 0x001F };
-static const uint32_t rgb444_masks[]  = { 0x0F00, 0x00F0, 0x000F };
-
-static av_cold int bmp_encode_init(AVCodecContext *avctx){
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_BGR24:
-        avctx->bits_per_coded_sample = 24;
-        break;
-    case AV_PIX_FMT_RGB555:
-    case AV_PIX_FMT_RGB565:
-    case AV_PIX_FMT_RGB444:
-        avctx->bits_per_coded_sample = 16;
-        break;
-    case AV_PIX_FMT_RGB8:
-    case AV_PIX_FMT_BGR8:
-    case AV_PIX_FMT_RGB4_BYTE:
-    case AV_PIX_FMT_BGR4_BYTE:
-    case AV_PIX_FMT_GRAY8:
-    case AV_PIX_FMT_PAL8:
-        avctx->bits_per_coded_sample = 8;
-        break;
-    case AV_PIX_FMT_MONOBLACK:
-        avctx->bits_per_coded_sample = 1;
-        break;
-    default:
-        av_log(avctx, AV_LOG_INFO, "unsupported pixel format\n");
-        return -1;
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                            const AVFrame *pict, int *got_packet)
-{
-    const AVFrame * const p = pict;
-    int n_bytes_image, n_bytes_per_row, n_bytes, i, n, hsize, ret;
-    const uint32_t *pal = NULL;
-    int pad_bytes_per_row, pal_entries = 0, compression = BMP_RGB;
-    int bit_count = avctx->bits_per_coded_sample;
-    uint8_t *ptr, *buf;
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB444:
-        compression = BMP_BITFIELDS;
-        pal = rgb444_masks; // abuse pal to hold color masks
-        pal_entries = 3;
-        break;
-    case AV_PIX_FMT_RGB565:
-        compression = BMP_BITFIELDS;
-        pal = rgb565_masks; // abuse pal to hold color masks
-        pal_entries = 3;
-        break;
-    case AV_PIX_FMT_RGB8:
-    case AV_PIX_FMT_BGR8:
-    case AV_PIX_FMT_RGB4_BYTE:
-    case AV_PIX_FMT_BGR4_BYTE:
-    case AV_PIX_FMT_GRAY8:
-        avpriv_set_systematic_pal2((uint32_t*)p->data[1], avctx->pix_fmt);
-    case AV_PIX_FMT_PAL8:
-        pal = (uint32_t *)p->data[1];
-        break;
-    case AV_PIX_FMT_MONOBLACK:
-        pal = monoblack_pal;
-        break;
-    }
-    if (pal && !pal_entries) pal_entries = 1 << bit_count;
-    n_bytes_per_row = ((int64_t)avctx->width * (int64_t)bit_count + 7LL) >> 3LL;
-    pad_bytes_per_row = (4 - n_bytes_per_row) & 3;
-    n_bytes_image = avctx->height * (n_bytes_per_row + pad_bytes_per_row);
-
-    // STRUCTURE.field refer to the MSVC documentation for BITMAPFILEHEADER
-    // and related pages.
-#define SIZE_BITMAPFILEHEADER 14
-#define SIZE_BITMAPINFOHEADER 40
-    hsize = SIZE_BITMAPFILEHEADER + SIZE_BITMAPINFOHEADER + (pal_entries << 2);
-    n_bytes = n_bytes_image + hsize;
-    if ((ret = ff_alloc_packet(pkt, n_bytes)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-    buf = pkt->data;
-    bytestream_put_byte(&buf, 'B');                   // BITMAPFILEHEADER.bfType
-    bytestream_put_byte(&buf, 'M');                   // do.
-    bytestream_put_le32(&buf, n_bytes);               // BITMAPFILEHEADER.bfSize
-    bytestream_put_le16(&buf, 0);                     // BITMAPFILEHEADER.bfReserved1
-    bytestream_put_le16(&buf, 0);                     // BITMAPFILEHEADER.bfReserved2
-    bytestream_put_le32(&buf, hsize);                 // BITMAPFILEHEADER.bfOffBits
-    bytestream_put_le32(&buf, SIZE_BITMAPINFOHEADER); // BITMAPINFOHEADER.biSize
-    bytestream_put_le32(&buf, avctx->width);          // BITMAPINFOHEADER.biWidth
-    bytestream_put_le32(&buf, avctx->height);         // BITMAPINFOHEADER.biHeight
-    bytestream_put_le16(&buf, 1);                     // BITMAPINFOHEADER.biPlanes
-    bytestream_put_le16(&buf, bit_count);             // BITMAPINFOHEADER.biBitCount
-    bytestream_put_le32(&buf, compression);           // BITMAPINFOHEADER.biCompression
-    bytestream_put_le32(&buf, n_bytes_image);         // BITMAPINFOHEADER.biSizeImage
-    bytestream_put_le32(&buf, 0);                     // BITMAPINFOHEADER.biXPelsPerMeter
-    bytestream_put_le32(&buf, 0);                     // BITMAPINFOHEADER.biYPelsPerMeter
-    bytestream_put_le32(&buf, 0);                     // BITMAPINFOHEADER.biClrUsed
-    bytestream_put_le32(&buf, 0);                     // BITMAPINFOHEADER.biClrImportant
-    for (i = 0; i < pal_entries; i++)
-        bytestream_put_le32(&buf, pal[i] & 0xFFFFFF);
-    // BMP files are bottom-to-top so we start from the end...
-    ptr = p->data[0] + (avctx->height - 1) * p->linesize[0];
-    buf = pkt->data + hsize;
-    for(i = 0; i < avctx->height; i++) {
-        if (bit_count == 16) {
-            const uint16_t *src = (const uint16_t *) ptr;
-            uint16_t *dst = (uint16_t *) buf;
-            for(n = 0; n < avctx->width; n++)
-                AV_WL16(dst + n, src[n]);
-        } else {
-            memcpy(buf, ptr, n_bytes_per_row);
-        }
-        buf += n_bytes_per_row;
-        memset(buf, 0, pad_bytes_per_row);
-        buf += pad_bytes_per_row;
-        ptr -= p->linesize[0]; // ... and go back
-    }
-
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-static av_cold int bmp_encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-AVCodec ff_bmp_encoder = {
-    .name           = "bmp",
-    .long_name      = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_BMP,
-    .init           = bmp_encode_init,
-    .encode2        = bmp_encode_frame,
-    .close          = bmp_encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_BGR24,
-        AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444, AV_PIX_FMT_RGB565,
-        AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8,
-        AV_PIX_FMT_MONOBLACK,
-        AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/bmv.c b/deps/libav/libavcodec/bmv.c
deleted file mode 100644
index 3c017d0..0000000
--- a/deps/libav/libavcodec/bmv.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Discworld II BMV video and audio decoder
- * Copyright (c) 2011 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-enum BMVFlags{
-    BMV_NOP = 0,
-    BMV_END,
-    BMV_DELTA,
-    BMV_INTRA,
-
-    BMV_SCROLL  = 0x04,
-    BMV_PALETTE = 0x08,
-    BMV_COMMAND = 0x10,
-    BMV_AUDIO   = 0x20,
-    BMV_EXT     = 0x40,
-    BMV_PRINT   = 0x80
-};
-
-#define SCREEN_WIDE 640
-#define SCREEN_HIGH 429
-
-typedef struct BMVDecContext {
-    AVCodecContext *avctx;
-
-    uint8_t *frame, frame_base[SCREEN_WIDE * (SCREEN_HIGH + 1)];
-    uint32_t pal[256];
-    const uint8_t *stream;
-} BMVDecContext;
-
-#define NEXT_BYTE(v) v = forward ? v + 1 : v - 1;
-
-static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame, int frame_off)
-{
-    unsigned val, saved_val = 0;
-    int tmplen = src_len;
-    const uint8_t *src, *source_end = source + src_len;
-    uint8_t *frame_end = frame + SCREEN_WIDE * SCREEN_HIGH;
-    uint8_t *dst, *dst_end;
-    int len, mask;
-    int forward = (frame_off <= -SCREEN_WIDE) || (frame_off >= 0);
-    int read_two_nibbles, flag;
-    int advance_mode;
-    int mode = 0;
-    int i;
-
-    if (src_len <= 0)
-        return AVERROR_INVALIDDATA;
-
-    if (forward) {
-        src = source;
-        dst = frame;
-        dst_end = frame_end;
-    } else {
-        src = source + src_len - 1;
-        dst = frame_end - 1;
-        dst_end = frame - 1;
-    }
-    for (;;) {
-        int shift = 0;
-        flag = 0;
-
-        /* The mode/len decoding is a bit strange:
-         * values are coded as variable-length codes with nibble units,
-         * code end is signalled by two top bits in the nibble being nonzero.
-         * And since data is bytepacked and we read two nibbles at a time,
-         * we may get a nibble belonging to the next code.
-         * Hence this convoluted loop.
-         */
-        if (!mode || (tmplen == 4)) {
-            if (src < source || src >= source_end)
-                return AVERROR_INVALIDDATA;
-            val = *src;
-            read_two_nibbles = 1;
-        } else {
-            val = saved_val;
-            read_two_nibbles = 0;
-        }
-        if (!(val & 0xC)) {
-            for (;;) {
-                if (!read_two_nibbles) {
-                    if (src < source || src >= source_end)
-                        return AVERROR_INVALIDDATA;
-                    shift += 2;
-                    val |= *src << shift;
-                    if (*src & 0xC)
-                        break;
-                }
-                // two upper bits of the nibble is zero,
-                // so shift top nibble value down into their place
-                read_two_nibbles = 0;
-                shift += 2;
-                mask = (1 << shift) - 1;
-                val = ((val >> 2) & ~mask) | (val & mask);
-                NEXT_BYTE(src);
-                if ((val & (0xC << shift))) {
-                    flag = 1;
-                    break;
-                }
-            }
-        } else if (mode) {
-            flag = tmplen != 4;
-        }
-        if (flag) {
-            tmplen = 4;
-        } else {
-            saved_val = val >> (4 + shift);
-            tmplen = 0;
-            val &= (1 << (shift + 4)) - 1;
-            NEXT_BYTE(src);
-        }
-        advance_mode = val & 1;
-        len = (val >> 1) - 1;
-        mode += 1 + advance_mode;
-        if (mode >= 4)
-            mode -= 3;
-        if (len <= 0 || FFABS(dst_end - dst) < len)
-            return AVERROR_INVALIDDATA;
-        switch (mode) {
-        case 1:
-            if (forward) {
-                if (dst - frame + SCREEN_WIDE < frame_off ||
-                        dst - frame + SCREEN_WIDE + frame_off < 0 ||
-                        frame_end - dst < frame_off + len ||
-                        frame_end - dst < len)
-                    return AVERROR_INVALIDDATA;
-                for (i = 0; i < len; i++)
-                    dst[i] = dst[frame_off + i];
-                dst += len;
-            } else {
-                dst -= len;
-                if (dst - frame + SCREEN_WIDE < frame_off ||
-                        dst - frame + SCREEN_WIDE + frame_off < 0 ||
-                        frame_end - dst < frame_off + len ||
-                        frame_end - dst < len)
-                    return AVERROR_INVALIDDATA;
-                for (i = len - 1; i >= 0; i--)
-                    dst[i] = dst[frame_off + i];
-            }
-            break;
-        case 2:
-            if (forward) {
-                if (source + src_len - src < len)
-                    return AVERROR_INVALIDDATA;
-                memcpy(dst, src, len);
-                dst += len;
-                src += len;
-            } else {
-                if (src - source < len)
-                    return AVERROR_INVALIDDATA;
-                dst -= len;
-                src -= len;
-                memcpy(dst, src, len);
-            }
-            break;
-        case 3:
-            val = forward ? dst[-1] : dst[1];
-            if (forward) {
-                memset(dst, val, len);
-                dst += len;
-            } else {
-                dst -= len;
-                memset(dst, val, len);
-            }
-            break;
-        default:
-            break;
-        }
-        if (dst == dst_end)
-            return 0;
-    }
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *pkt)
-{
-    BMVDecContext * const c = avctx->priv_data;
-    AVFrame *frame = data;
-    int type, scr_off;
-    int i, ret;
-    uint8_t *srcptr, *outptr;
-
-    c->stream = pkt->data;
-    type = bytestream_get_byte(&c->stream);
-    if (type & BMV_AUDIO) {
-        int blobs = bytestream_get_byte(&c->stream);
-        if (pkt->size < blobs * 65 + 2) {
-            av_log(avctx, AV_LOG_ERROR, "Audio data doesn't fit in frame\n");
-            return AVERROR_INVALIDDATA;
-        }
-        c->stream += blobs * 65;
-    }
-    if (type & BMV_COMMAND) {
-        int command_size = (type & BMV_PRINT) ? 8 : 10;
-        if (c->stream - pkt->data + command_size > pkt->size) {
-            av_log(avctx, AV_LOG_ERROR, "Command data doesn't fit in frame\n");
-            return AVERROR_INVALIDDATA;
-        }
-        c->stream += command_size;
-    }
-    if (type & BMV_PALETTE) {
-        if (c->stream - pkt->data > pkt->size - 768) {
-            av_log(avctx, AV_LOG_ERROR, "Palette data doesn't fit in frame\n");
-            return AVERROR_INVALIDDATA;
-        }
-        for (i = 0; i < 256; i++)
-            c->pal[i] = bytestream_get_be24(&c->stream);
-    }
-    if (type & BMV_SCROLL) {
-        if (c->stream - pkt->data > pkt->size - 2) {
-            av_log(avctx, AV_LOG_ERROR, "Screen offset data doesn't fit in frame\n");
-            return AVERROR_INVALIDDATA;
-        }
-        scr_off = (int16_t)bytestream_get_le16(&c->stream);
-    } else if ((type & BMV_INTRA) == BMV_INTRA) {
-        scr_off = -640;
-    } else {
-        scr_off = 0;
-    }
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (decode_bmv_frame(c->stream, pkt->size - (c->stream - pkt->data), c->frame, scr_off)) {
-        av_log(avctx, AV_LOG_ERROR, "Error decoding frame data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
-    frame->palette_has_changed = type & BMV_PALETTE;
-
-    outptr = frame->data[0];
-    srcptr = c->frame;
-
-    for (i = 0; i < avctx->height; i++) {
-        memcpy(outptr, srcptr, avctx->width);
-        srcptr += avctx->width;
-        outptr += frame->linesize[0];
-    }
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return pkt->size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    BMVDecContext * const c = avctx->priv_data;
-
-    c->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    c->frame = c->frame_base + 640;
-
-    return 0;
-}
-
-static const int bmv_aud_mults[16] = {
-    16512, 8256, 4128, 2064, 1032, 516, 258, 192, 129, 88, 64, 56, 48, 40, 36, 32
-};
-
-static av_cold int bmv_aud_decode_init(AVCodecContext *avctx)
-{
-    avctx->channels       = 2;
-    avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
-
-    return 0;
-}
-
-static int bmv_aud_decode_frame(AVCodecContext *avctx, void *data,
-                                int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    int blocks = 0, total_blocks, i;
-    int ret;
-    int16_t *output_samples;
-    int scale[2];
-
-    total_blocks = *buf++;
-    if (buf_size < total_blocks * 65 + 1) {
-        av_log(avctx, AV_LOG_ERROR, "expected %d bytes, got %d\n",
-               total_blocks * 65 + 1, buf_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = total_blocks * 32;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    output_samples = (int16_t *)frame->data[0];
-
-    for (blocks = 0; blocks < total_blocks; blocks++) {
-        uint8_t code = *buf++;
-        code = (code >> 1) | (code << 7);
-        scale[0] = bmv_aud_mults[code & 0xF];
-        scale[1] = bmv_aud_mults[code >> 4];
-        for (i = 0; i < 32; i++) {
-            *output_samples++ = av_clip_int16((scale[0] * (int8_t)*buf++) >> 5);
-            *output_samples++ = av_clip_int16((scale[1] * (int8_t)*buf++) >> 5);
-        }
-    }
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_bmv_video_decoder = {
-    .name           = "bmv_video",
-    .long_name      = NULL_IF_CONFIG_SMALL("Discworld II BMV video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_BMV_VIDEO,
-    .priv_data_size = sizeof(BMVDecContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-AVCodec ff_bmv_audio_decoder = {
-    .name           = "bmv_audio",
-    .long_name      = NULL_IF_CONFIG_SMALL("Discworld II BMV audio"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_BMV_AUDIO,
-    .init           = bmv_aud_decode_init,
-    .decode         = bmv_aud_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/bytestream.h b/deps/libav/libavcodec/bytestream.h
deleted file mode 100644
index 0f89558..0000000
--- a/deps/libav/libavcodec/bytestream.h
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Bytestream functions
- * copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier at free.fr>
- * Copyright (c) 2012 Aneesh Dogra (lionaneesh) <lionaneesh at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_BYTESTREAM_H
-#define AVCODEC_BYTESTREAM_H
-
-#include <stdint.h>
-#include <string.h>
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-
-typedef struct GetByteContext {
-    const uint8_t *buffer, *buffer_end, *buffer_start;
-} GetByteContext;
-
-typedef struct PutByteContext {
-    uint8_t *buffer, *buffer_end, *buffer_start;
-    int eof;
-} PutByteContext;
-
-#define DEF(type, name, bytes, read, write)                                  \
-static av_always_inline type bytestream_get_ ## name(const uint8_t **b)        \
-{                                                                              \
-    (*b) += bytes;                                                             \
-    return read(*b - bytes);                                                   \
-}                                                                              \
-static av_always_inline void bytestream_put_ ## name(uint8_t **b,              \
-                                                     const type value)         \
-{                                                                              \
-    write(*b, value);                                                          \
-    (*b) += bytes;                                                             \
-}                                                                              \
-static av_always_inline void bytestream2_put_ ## name ## u(PutByteContext *p,  \
-                                                           const type value)   \
-{                                                                              \
-    bytestream_put_ ## name(&p->buffer, value);                                \
-}                                                                              \
-static av_always_inline void bytestream2_put_ ## name(PutByteContext *p,       \
-                                                      const type value)        \
-{                                                                              \
-    if (!p->eof && (p->buffer_end - p->buffer >= bytes)) {                     \
-        write(p->buffer, value);                                               \
-        p->buffer += bytes;                                                    \
-    } else                                                                     \
-        p->eof = 1;                                                            \
-}                                                                              \
-static av_always_inline type bytestream2_get_ ## name ## u(GetByteContext *g)  \
-{                                                                              \
-    return bytestream_get_ ## name(&g->buffer);                                \
-}                                                                              \
-static av_always_inline type bytestream2_get_ ## name(GetByteContext *g)       \
-{                                                                              \
-    if (g->buffer_end - g->buffer < bytes)                                     \
-        return 0;                                                              \
-    return bytestream2_get_ ## name ## u(g);                                   \
-}                                                                              \
-static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g)      \
-{                                                                              \
-    if (g->buffer_end - g->buffer < bytes)                                     \
-        return 0;                                                              \
-    return read(g->buffer);                                                    \
-}
-
-DEF(uint64_t,     le64, 8, AV_RL64, AV_WL64)
-DEF(unsigned int, le32, 4, AV_RL32, AV_WL32)
-DEF(unsigned int, le24, 3, AV_RL24, AV_WL24)
-DEF(unsigned int, le16, 2, AV_RL16, AV_WL16)
-DEF(uint64_t,     be64, 8, AV_RB64, AV_WB64)
-DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
-DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
-DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)
-DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8)
-
-#if HAVE_BIGENDIAN
-#   define bytestream2_get_ne16  bytestream2_get_be16
-#   define bytestream2_get_ne24  bytestream2_get_be24
-#   define bytestream2_get_ne32  bytestream2_get_be32
-#   define bytestream2_get_ne64  bytestream2_get_be64
-#   define bytestream2_get_ne16u bytestream2_get_be16u
-#   define bytestream2_get_ne24u bytestream2_get_be24u
-#   define bytestream2_get_ne32u bytestream2_get_be32u
-#   define bytestream2_get_ne64u bytestream2_get_be64u
-#   define bytestream2_put_ne16  bytestream2_put_be16
-#   define bytestream2_put_ne24  bytestream2_put_be24
-#   define bytestream2_put_ne32  bytestream2_put_be32
-#   define bytestream2_put_ne64  bytestream2_put_be64
-#   define bytestream2_peek_ne16 bytestream2_peek_be16
-#   define bytestream2_peek_ne24 bytestream2_peek_be24
-#   define bytestream2_peek_ne32 bytestream2_peek_be32
-#   define bytestream2_peek_ne64 bytestream2_peek_be64
-#else
-#   define bytestream2_get_ne16  bytestream2_get_le16
-#   define bytestream2_get_ne24  bytestream2_get_le24
-#   define bytestream2_get_ne32  bytestream2_get_le32
-#   define bytestream2_get_ne64  bytestream2_get_le64
-#   define bytestream2_get_ne16u bytestream2_get_le16u
-#   define bytestream2_get_ne24u bytestream2_get_le24u
-#   define bytestream2_get_ne32u bytestream2_get_le32u
-#   define bytestream2_get_ne64u bytestream2_get_le64u
-#   define bytestream2_put_ne16  bytestream2_put_le16
-#   define bytestream2_put_ne24  bytestream2_put_le24
-#   define bytestream2_put_ne32  bytestream2_put_le32
-#   define bytestream2_put_ne64  bytestream2_put_le64
-#   define bytestream2_peek_ne16 bytestream2_peek_le16
-#   define bytestream2_peek_ne24 bytestream2_peek_le24
-#   define bytestream2_peek_ne32 bytestream2_peek_le32
-#   define bytestream2_peek_ne64 bytestream2_peek_le64
-#endif
-
-static av_always_inline void bytestream2_init(GetByteContext *g,
-                                              const uint8_t *buf,
-                                              int buf_size)
-{
-    g->buffer       = buf;
-    g->buffer_start = buf;
-    g->buffer_end   = buf + buf_size;
-}
-
-static av_always_inline void bytestream2_init_writer(PutByteContext *p,
-                                                     uint8_t *buf,
-                                                     int buf_size)
-{
-    p->buffer       = buf;
-    p->buffer_start = buf;
-    p->buffer_end   = buf + buf_size;
-    p->eof          = 0;
-}
-
-static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
-{
-    return g->buffer_end - g->buffer;
-}
-
-static av_always_inline unsigned int bytestream2_get_bytes_left_p(PutByteContext *p)
-{
-    return p->buffer_end - p->buffer;
-}
-
-static av_always_inline void bytestream2_skip(GetByteContext *g,
-                                              unsigned int size)
-{
-    g->buffer += FFMIN(g->buffer_end - g->buffer, size);
-}
-
-static av_always_inline void bytestream2_skipu(GetByteContext *g,
-                                               unsigned int size)
-{
-    g->buffer += size;
-}
-
-static av_always_inline void bytestream2_skip_p(PutByteContext *p,
-                                                unsigned int size)
-{
-    int size2;
-    if (p->eof)
-        return;
-    size2 = FFMIN(p->buffer_end - p->buffer, size);
-    if (size2 != size)
-        p->eof = 1;
-    p->buffer += size2;
-}
-
-static av_always_inline int bytestream2_tell(GetByteContext *g)
-{
-    return (int)(g->buffer - g->buffer_start);
-}
-
-static av_always_inline int bytestream2_tell_p(PutByteContext *p)
-{
-    return (int)(p->buffer - p->buffer_start);
-}
-
-static av_always_inline int bytestream2_seek(GetByteContext *g,
-                                             int offset,
-                                             int whence)
-{
-    switch (whence) {
-    case SEEK_CUR:
-        offset     = av_clip(offset, -(g->buffer - g->buffer_start),
-                             g->buffer_end - g->buffer);
-        g->buffer += offset;
-        break;
-    case SEEK_END:
-        offset    = av_clip(offset, -(g->buffer_end - g->buffer_start), 0);
-        g->buffer = g->buffer_end + offset;
-        break;
-    case SEEK_SET:
-        offset    = av_clip(offset, 0, g->buffer_end - g->buffer_start);
-        g->buffer = g->buffer_start + offset;
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-    return bytestream2_tell(g);
-}
-
-static av_always_inline int bytestream2_seek_p(PutByteContext *p,
-                                               int offset,
-                                               int whence)
-{
-    p->eof = 0;
-    switch (whence) {
-    case SEEK_CUR:
-        if (p->buffer_end - p->buffer < offset)
-            p->eof = 1;
-        offset     = av_clip(offset, -(p->buffer - p->buffer_start),
-                             p->buffer_end - p->buffer);
-        p->buffer += offset;
-        break;
-    case SEEK_END:
-        if (offset > 0)
-            p->eof = 1;
-        offset    = av_clip(offset, -(p->buffer_end - p->buffer_start), 0);
-        p->buffer = p->buffer_end + offset;
-        break;
-    case SEEK_SET:
-        if (p->buffer_end - p->buffer_start < offset)
-            p->eof = 1;
-        offset    = av_clip(offset, 0, p->buffer_end - p->buffer_start);
-        p->buffer = p->buffer_start + offset;
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-    return bytestream2_tell_p(p);
-}
-
-static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g,
-                                                            uint8_t *dst,
-                                                            unsigned int size)
-{
-    int size2 = FFMIN(g->buffer_end - g->buffer, size);
-    memcpy(dst, g->buffer, size2);
-    g->buffer += size2;
-    return size2;
-}
-
-static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g,
-                                                             uint8_t *dst,
-                                                             unsigned int size)
-{
-    memcpy(dst, g->buffer, size);
-    g->buffer += size;
-    return size;
-}
-
-static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p,
-                                                            const uint8_t *src,
-                                                            unsigned int size)
-{
-    int size2;
-    if (p->eof)
-        return 0;
-    size2 = FFMIN(p->buffer_end - p->buffer, size);
-    if (size2 != size)
-        p->eof = 1;
-    memcpy(p->buffer, src, size2);
-    p->buffer += size2;
-    return size2;
-}
-
-static av_always_inline unsigned int bytestream2_put_bufferu(PutByteContext *p,
-                                                             const uint8_t *src,
-                                                             unsigned int size)
-{
-    memcpy(p->buffer, src, size);
-    p->buffer += size;
-    return size;
-}
-
-static av_always_inline void bytestream2_set_buffer(PutByteContext *p,
-                                                    const uint8_t c,
-                                                    unsigned int size)
-{
-    int size2;
-    if (p->eof)
-        return;
-    size2 = FFMIN(p->buffer_end - p->buffer, size);
-    if (size2 != size)
-        p->eof = 1;
-    memset(p->buffer, c, size2);
-    p->buffer += size2;
-}
-
-static av_always_inline void bytestream2_set_bufferu(PutByteContext *p,
-                                                     const uint8_t c,
-                                                     unsigned int size)
-{
-    memset(p->buffer, c, size);
-    p->buffer += size;
-}
-
-static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p)
-{
-    return p->eof;
-}
-
-static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b,
-                                                           uint8_t *dst,
-                                                           unsigned int size)
-{
-    memcpy(dst, *b, size);
-    (*b) += size;
-    return size;
-}
-
-static av_always_inline void bytestream_put_buffer(uint8_t **b,
-                                                   const uint8_t *src,
-                                                   unsigned int size)
-{
-    memcpy(*b, src, size);
-    (*b) += size;
-}
-
-#endif /* AVCODEC_BYTESTREAM_H */
diff --git a/deps/libav/libavcodec/c93.c b/deps/libav/libavcodec/c93.c
deleted file mode 100644
index c7cc682..0000000
--- a/deps/libav/libavcodec/c93.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Interplay C93 video decoder
- * Copyright (c) 2007 Anssi Hannula <anssi.hannula at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-typedef struct {
-    AVFrame *pictures[2];
-    int currentpic;
-} C93DecoderContext;
-
-typedef enum {
-    C93_8X8_FROM_PREV  = 0x02,
-    C93_4X4_FROM_PREV  = 0x06,
-    C93_4X4_FROM_CURR  = 0x07,
-    C93_8X8_2COLOR     = 0x08,
-    C93_4X4_2COLOR     = 0x0A,
-    C93_4X4_4COLOR_GRP = 0x0B,
-    C93_4X4_4COLOR     = 0x0D,
-    C93_NOOP           = 0x0E,
-    C93_8X8_INTRA      = 0x0F,
-} C93BlockType;
-
-#define WIDTH   320
-#define HEIGHT  192
-
-#define C93_HAS_PALETTE 0x01
-#define C93_FIRST_FRAME 0x02
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    C93DecoderContext * const c93 = avctx->priv_data;
-
-    av_frame_free(&c93->pictures[0]);
-    av_frame_free(&c93->pictures[1]);
-
-    return 0;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    C93DecoderContext *s = avctx->priv_data;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    s->pictures[0] = av_frame_alloc();
-    s->pictures[1] = av_frame_alloc();
-    if (!s->pictures[0] || !s->pictures[1]) {
-        decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static inline int copy_block(AVCodecContext *avctx, uint8_t *to,
-        uint8_t *from, int offset, int height, int stride)
-{
-    int i;
-    int width = height;
-    int from_x = offset % WIDTH;
-    int from_y = offset / WIDTH;
-    int overflow = from_x + width - WIDTH;
-
-    if (!from) {
-        /* silently ignoring predictive blocks in first frame */
-        return 0;
-    }
-
-    if (from_y + height > HEIGHT) {
-        av_log(avctx, AV_LOG_ERROR, "invalid offset %d during C93 decoding\n",
-               offset);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (overflow > 0) {
-        width -= overflow;
-        for (i = 0; i < height; i++) {
-            memcpy(&to[i*stride+width], &from[(from_y+i)*stride], overflow);
-        }
-    }
-
-    for (i = 0; i < height; i++) {
-        memcpy(&to[i*stride], &from[(from_y+i)*stride+from_x], width);
-    }
-
-    return 0;
-}
-
-static inline void draw_n_color(uint8_t *out, int stride, int width,
-         int height, int bpp, uint8_t cols[4], uint8_t grps[4], uint32_t col)
-{
-    int x, y;
-    for (y = 0; y < height; y++) {
-        if (grps)
-            cols[0] = grps[3 * (y >> 1)];
-        for (x = 0; x < width; x++) {
-            if (grps)
-                cols[1]= grps[(x >> 1) + 1];
-            out[x + y*stride] = cols[col & ((1 << bpp) - 1)];
-            col >>= bpp;
-        }
-    }
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data,
-                        int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    C93DecoderContext * const c93 = avctx->priv_data;
-    AVFrame * const newpic = c93->pictures[c93->currentpic];
-    AVFrame * const oldpic = c93->pictures[c93->currentpic^1];
-    GetByteContext gb;
-    uint8_t *out;
-    int stride, ret, i, x, y, b, bt = 0;
-
-    c93->currentpic ^= 1;
-
-    if ((ret = ff_reget_buffer(avctx, newpic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    stride = newpic->linesize[0];
-
-    bytestream2_init(&gb, buf, buf_size);
-    b = bytestream2_get_byte(&gb);
-    if (b & C93_FIRST_FRAME) {
-        newpic->pict_type = AV_PICTURE_TYPE_I;
-        newpic->key_frame = 1;
-    } else {
-        newpic->pict_type = AV_PICTURE_TYPE_P;
-        newpic->key_frame = 0;
-    }
-
-    for (y = 0; y < HEIGHT; y += 8) {
-        out = newpic->data[0] + y * stride;
-        for (x = 0; x < WIDTH; x += 8) {
-            uint8_t *copy_from = oldpic->data[0];
-            unsigned int offset, j;
-            uint8_t cols[4], grps[4];
-            C93BlockType block_type;
-
-            if (!bt)
-                bt = bytestream2_get_byte(&gb);
-
-            block_type= bt & 0x0F;
-            switch (block_type) {
-            case C93_8X8_FROM_PREV:
-                offset = bytestream2_get_le16(&gb);
-                if ((ret = copy_block(avctx, out, copy_from, offset, 8, stride)) < 0)
-                    return ret;
-                break;
-
-            case C93_4X4_FROM_CURR:
-                copy_from = newpic->data[0];
-            case C93_4X4_FROM_PREV:
-                for (j = 0; j < 8; j += 4) {
-                    for (i = 0; i < 8; i += 4) {
-                        offset = bytestream2_get_le16(&gb);
-                        if ((ret = copy_block(avctx, &out[j*stride+i],
-                                              copy_from, offset, 4, stride)) < 0)
-                            return ret;
-                    }
-                }
-                break;
-
-            case C93_8X8_2COLOR:
-                bytestream2_get_buffer(&gb, cols, 2);
-                for (i = 0; i < 8; i++) {
-                    draw_n_color(out + i*stride, stride, 8, 1, 1, cols,
-                                     NULL, bytestream2_get_byte(&gb));
-                }
-
-                break;
-
-            case C93_4X4_2COLOR:
-            case C93_4X4_4COLOR:
-            case C93_4X4_4COLOR_GRP:
-                for (j = 0; j < 8; j += 4) {
-                    for (i = 0; i < 8; i += 4) {
-                        if (block_type == C93_4X4_2COLOR) {
-                            bytestream2_get_buffer(&gb, cols, 2);
-                            draw_n_color(out + i + j*stride, stride, 4, 4,
-                                    1, cols, NULL, bytestream2_get_le16(&gb));
-                        } else if (block_type == C93_4X4_4COLOR) {
-                            bytestream2_get_buffer(&gb, cols, 4);
-                            draw_n_color(out + i + j*stride, stride, 4, 4,
-                                    2, cols, NULL, bytestream2_get_le32(&gb));
-                        } else {
-                            bytestream2_get_buffer(&gb, grps, 4);
-                            draw_n_color(out + i + j*stride, stride, 4, 4,
-                                    1, cols, grps, bytestream2_get_le16(&gb));
-                        }
-                    }
-                }
-                break;
-
-            case C93_NOOP:
-                break;
-
-            case C93_8X8_INTRA:
-                for (j = 0; j < 8; j++)
-                    bytestream2_get_buffer(&gb, out + j*stride, 8);
-                break;
-
-            default:
-                av_log(avctx, AV_LOG_ERROR, "unexpected type %x at %dx%d\n",
-                       block_type, x, y);
-                return AVERROR_INVALIDDATA;
-            }
-            bt >>= 4;
-            out += 8;
-        }
-    }
-
-    if (b & C93_HAS_PALETTE) {
-        uint32_t *palette = (uint32_t *) newpic->data[1];
-        for (i = 0; i < 256; i++) {
-            palette[i] = bytestream2_get_be24(&gb);
-        }
-        newpic->palette_has_changed = 1;
-    } else {
-        if (oldpic->data[1])
-            memcpy(newpic->data[1], oldpic->data[1], 256 * 4);
-    }
-
-    if ((ret = av_frame_ref(data, newpic)) < 0)
-        return ret;
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_c93_decoder = {
-    .name           = "c93",
-    .long_name      = NULL_IF_CONFIG_SMALL("Interplay C93"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_C93,
-    .priv_data_size = sizeof(C93DecoderContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/cabac.c b/deps/libav/libavcodec/cabac.c
deleted file mode 100644
index b6f56f0..0000000
--- a/deps/libav/libavcodec/cabac.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Context Adaptive Binary Arithmetic Coder.
- */
-
-#include <string.h>
-
-#include "libavutil/common.h"
-#include "get_bits.h"
-#include "cabac.h"
-#include "cabac_functions.h"
-
-uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63] = {
- 9,8,7,7,6,6,6,6,5,5,5,5,5,5,5,5,
- 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-
-static const uint8_t lps_range[64][4]= {
-{128,176,208,240}, {128,167,197,227}, {128,158,187,216}, {123,150,178,205},
-{116,142,169,195}, {111,135,160,185}, {105,128,152,175}, {100,122,144,166},
-{ 95,116,137,158}, { 90,110,130,150}, { 85,104,123,142}, { 81, 99,117,135},
-{ 77, 94,111,128}, { 73, 89,105,122}, { 69, 85,100,116}, { 66, 80, 95,110},
-{ 62, 76, 90,104}, { 59, 72, 86, 99}, { 56, 69, 81, 94}, { 53, 65, 77, 89},
-{ 51, 62, 73, 85}, { 48, 59, 69, 80}, { 46, 56, 66, 76}, { 43, 53, 63, 72},
-{ 41, 50, 59, 69}, { 39, 48, 56, 65}, { 37, 45, 54, 62}, { 35, 43, 51, 59},
-{ 33, 41, 48, 56}, { 32, 39, 46, 53}, { 30, 37, 43, 50}, { 29, 35, 41, 48},
-{ 27, 33, 39, 45}, { 26, 31, 37, 43}, { 24, 30, 35, 41}, { 23, 28, 33, 39},
-{ 22, 27, 32, 37}, { 21, 26, 30, 35}, { 20, 24, 29, 33}, { 19, 23, 27, 31},
-{ 18, 22, 26, 30}, { 17, 21, 25, 28}, { 16, 20, 23, 27}, { 15, 19, 22, 25},
-{ 14, 18, 21, 24}, { 14, 17, 20, 23}, { 13, 16, 19, 22}, { 12, 15, 18, 21},
-{ 12, 14, 17, 20}, { 11, 14, 16, 19}, { 11, 13, 15, 18}, { 10, 12, 15, 17},
-{ 10, 12, 14, 16}, {  9, 11, 13, 15}, {  9, 11, 12, 14}, {  8, 10, 12, 14},
-{  8,  9, 11, 13}, {  7,  9, 11, 12}, {  7,  9, 10, 12}, {  7,  8, 10, 11},
-{  6,  8,  9, 11}, {  6,  7,  9, 10}, {  6,  7,  8,  9}, {  2,  2,  2,  2},
-};
-
-static const uint8_t mps_state[64]= {
-  1, 2, 3, 4, 5, 6, 7, 8,
-  9,10,11,12,13,14,15,16,
- 17,18,19,20,21,22,23,24,
- 25,26,27,28,29,30,31,32,
- 33,34,35,36,37,38,39,40,
- 41,42,43,44,45,46,47,48,
- 49,50,51,52,53,54,55,56,
- 57,58,59,60,61,62,62,63,
-};
-
-static const uint8_t lps_state[64]= {
-  0, 0, 1, 2, 2, 4, 4, 5,
-  6, 7, 8, 9, 9,11,11,12,
- 13,13,15,15,16,16,18,18,
- 19,19,21,21,22,22,23,24,
- 24,25,26,26,27,27,28,29,
- 29,30,30,30,31,32,32,33,
- 33,33,34,34,35,35,35,36,
- 36,36,37,37,37,38,38,63,
-};
-
-static const uint8_t last_coeff_flag_offset_8x8[63] = {
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8
-};
-
-/**
- *
- * @param buf_size size of buf in bits
- */
-void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
-    c->bytestream_start=
-    c->bytestream= buf;
-    c->bytestream_end= buf + buf_size;
-
-#if CABAC_BITS == 16
-    c->low =  (*c->bytestream++)<<18;
-    c->low+=  (*c->bytestream++)<<10;
-#else
-    c->low =  (*c->bytestream++)<<10;
-#endif
-    c->low+= ((*c->bytestream++)<<2) + 2;
-    c->range= 0x1FE;
-}
-
-void ff_init_cabac_states(void)
-{
-    int i, j;
-    static int initialized = 0;
-
-    if (initialized)
-        return;
-
-    for(i=0; i<64; i++){
-        for(j=0; j<4; j++){ //FIXME check if this is worth the 1 shift we save
-            ff_h264_lps_range[j*2*64+2*i+0]=
-            ff_h264_lps_range[j*2*64+2*i+1]= lps_range[i][j];
-        }
-
-        ff_h264_mlps_state[128 + 2 * i + 0] = 2 * mps_state[i] + 0;
-        ff_h264_mlps_state[128 + 2 * i + 1] = 2 * mps_state[i] + 1;
-
-        if( i ){
-            ff_h264_mlps_state[128-2*i-1]= 2*lps_state[i]+0;
-            ff_h264_mlps_state[128-2*i-2]= 2*lps_state[i]+1;
-        }else{
-            ff_h264_mlps_state[128-2*i-1]= 1;
-            ff_h264_mlps_state[128-2*i-2]= 0;
-        }
-    }
-    for(i=0; i< 63; i++){
-      ff_h264_last_coeff_flag_offset_8x8[i] = last_coeff_flag_offset_8x8[i];
-    }
-
-    initialized = 1;
-}
diff --git a/deps/libav/libavcodec/cabac.h b/deps/libav/libavcodec/cabac.h
deleted file mode 100644
index 7401bc9..0000000
--- a/deps/libav/libavcodec/cabac.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Context Adaptive Binary Arithmetic Coder.
- */
-
-#ifndef AVCODEC_CABAC_H
-#define AVCODEC_CABAC_H
-
-#include <stdint.h>
-
-#include "put_bits.h"
-
-#define H264_NORM_SHIFT_OFFSET 0
-#define H264_LPS_RANGE_OFFSET 512
-#define H264_MLPS_STATE_OFFSET 1024
-#define H264_LAST_COEFF_FLAG_OFFSET_8x8_OFFSET 1280
-
-#define CABAC_BITS 16
-#define CABAC_MASK ((1<<CABAC_BITS)-1)
-
-typedef struct CABACContext{
-    int low;
-    int range;
-    const uint8_t *bytestream_start;
-    const uint8_t *bytestream;
-    const uint8_t *bytestream_end;
-}CABACContext;
-
-void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
-void ff_init_cabac_states(void);
-
-#endif /* AVCODEC_CABAC_H */
diff --git a/deps/libav/libavcodec/cabac_functions.h b/deps/libav/libavcodec/cabac_functions.h
deleted file mode 100644
index 11c9646..0000000
--- a/deps/libav/libavcodec/cabac_functions.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Context Adaptive Binary Arithmetic Coder inline functions
- */
-
-#ifndef AVCODEC_CABAC_FUNCTIONS_H
-#define AVCODEC_CABAC_FUNCTIONS_H
-
-#include <stdint.h>
-
-#include "cabac.h"
-#include "config.h"
-
-#if ARCH_X86
-#   include "x86/cabac.h"
-#endif
-
-extern uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63];
-static uint8_t * const ff_h264_norm_shift = ff_h264_cabac_tables + H264_NORM_SHIFT_OFFSET;
-static uint8_t * const ff_h264_lps_range = ff_h264_cabac_tables + H264_LPS_RANGE_OFFSET;
-static uint8_t * const ff_h264_mlps_state = ff_h264_cabac_tables + H264_MLPS_STATE_OFFSET;
-static uint8_t * const ff_h264_last_coeff_flag_offset_8x8 = ff_h264_cabac_tables + H264_LAST_COEFF_FLAG_OFFSET_8x8_OFFSET;
-
-static void refill(CABACContext *c){
-#if CABAC_BITS == 16
-        c->low+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1);
-#else
-        c->low+= c->bytestream[0]<<1;
-#endif
-    c->low -= CABAC_MASK;
-    if (c->bytestream < c->bytestream_end)
-        c->bytestream += CABAC_BITS / 8;
-}
-
-static inline void renorm_cabac_decoder_once(CABACContext *c){
-    int shift= (uint32_t)(c->range - 0x100)>>31;
-    c->range<<= shift;
-    c->low  <<= shift;
-    if(!(c->low & CABAC_MASK))
-        refill(c);
-}
-
-#ifndef get_cabac_inline
-static void refill2(CABACContext *c){
-    int i, x;
-
-    x= c->low ^ (c->low-1);
-    i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)];
-
-    x= -CABAC_MASK;
-
-#if CABAC_BITS == 16
-        x+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1);
-#else
-        x+= c->bytestream[0]<<1;
-#endif
-
-    c->low += x<<i;
-    if (c->bytestream < c->bytestream_end)
-        c->bytestream += CABAC_BITS/8;
-}
-
-static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const state){
-    int s = *state;
-    int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s];
-    int bit, lps_mask;
-
-    c->range -= RangeLPS;
-    lps_mask= ((c->range<<(CABAC_BITS+1)) - c->low)>>31;
-
-    c->low -= (c->range<<(CABAC_BITS+1)) & lps_mask;
-    c->range += (RangeLPS - c->range) & lps_mask;
-
-    s^=lps_mask;
-    *state= (ff_h264_mlps_state+128)[s];
-    bit= s&1;
-
-    lps_mask= ff_h264_norm_shift[c->range];
-    c->range<<= lps_mask;
-    c->low  <<= lps_mask;
-    if(!(c->low & CABAC_MASK))
-        refill2(c);
-    return bit;
-}
-#endif
-
-static int av_noinline av_unused get_cabac_noinline(CABACContext *c, uint8_t * const state){
-    return get_cabac_inline(c,state);
-}
-
-static int av_unused get_cabac(CABACContext *c, uint8_t * const state){
-    return get_cabac_inline(c,state);
-}
-
-#ifndef get_cabac_bypass
-static int av_unused get_cabac_bypass(CABACContext *c){
-    int range;
-    c->low += c->low;
-
-    if(!(c->low & CABAC_MASK))
-        refill(c);
-
-    range= c->range<<(CABAC_BITS+1);
-    if(c->low < range){
-        return 0;
-    }else{
-        c->low -= range;
-        return 1;
-    }
-}
-#endif
-
-#ifndef get_cabac_bypass_sign
-static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val){
-    int range, mask;
-    c->low += c->low;
-
-    if(!(c->low & CABAC_MASK))
-        refill(c);
-
-    range= c->range<<(CABAC_BITS+1);
-    c->low -= range;
-    mask= c->low >> 31;
-    range &= mask;
-    c->low += range;
-    return (val^mask)-mask;
-}
-#endif
-
-/**
- *
- * @return the number of bytes read or 0 if no end
- */
-static int av_unused get_cabac_terminate(CABACContext *c){
-    c->range -= 2;
-    if(c->low < c->range<<(CABAC_BITS+1)){
-        renorm_cabac_decoder_once(c);
-        return 0;
-    }else{
-        return c->bytestream - c->bytestream_start;
-    }
-}
-
-/**
- * Skip @p n bytes and reset the decoder.
- * @return the address of the first skipped byte or NULL if there's less than @p n bytes left
- */
-static av_unused const uint8_t* skip_bytes(CABACContext *c, int n) {
-    const uint8_t *ptr = c->bytestream;
-
-    if (c->low & 0x1)
-        ptr--;
-#if CABAC_BITS == 16
-    if (c->low & 0x1FF)
-        ptr--;
-#endif
-    if ((int) (c->bytestream_end - ptr) < n)
-        return NULL;
-    ff_init_cabac_decoder(c, ptr + n, c->bytestream_end - ptr - n);
-
-    return ptr;
-}
-
-#endif /* AVCODEC_CABAC_FUNCTIONS_H */
diff --git a/deps/libav/libavcodec/cavs.c b/deps/libav/libavcodec/cavs.c
deleted file mode 100644
index 5a81089..0000000
--- a/deps/libav/libavcodec/cavs.c
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
- * Copyright (c) 2006  Stefan Gehrer <stefan.gehrer at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder
- * @author Stefan Gehrer <stefan.gehrer at gmx.de>
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "golomb.h"
-#include "h264chroma.h"
-#include "mathops.h"
-#include "cavs.h"
-
-static const uint8_t alpha_tab[64] = {
-     0,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  2,  2,  2,  3,  3,
-     4,  4,  5,  5,  6,  7,  8,  9, 10, 11, 12, 13, 15, 16, 18, 20,
-    22, 24, 26, 28, 30, 33, 33, 35, 35, 36, 37, 37, 39, 39, 42, 44,
-    46, 48, 50, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64
-};
-
-static const uint8_t beta_tab[64] = {
-     0,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,
-     2,  2,  3,  3,  3,  3,  4,  4,  4,  4,  5,  5,  5,  5,  6,  6,
-     6,  7,  7,  7,  8,  8,  8,  9,  9, 10, 10, 11, 11, 12, 13, 14,
-    15, 16, 17, 18, 19, 20, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27
-};
-
-static const uint8_t tc_tab[64] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
-    2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
-    5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9
-};
-
-/** mark block as unavailable, i.e. out of picture
- *  or not yet decoded */
-static const cavs_vector un_mv = { 0, 0, 1, NOT_AVAIL };
-
-static const int8_t left_modifier_l[8] = {  0, -1,  6, -1, -1, 7, 6, 7 };
-static const int8_t top_modifier_l[8]  = { -1,  1,  5, -1, -1, 5, 7, 7 };
-static const int8_t left_modifier_c[7] = {  5, -1,  2, -1,  6, 5, 6 };
-static const int8_t top_modifier_c[7]  = {  4,  1, -1, -1,  4, 6, 6 };
-
-/*****************************************************************************
- *
- * in-loop deblocking filter
- *
- ****************************************************************************/
-
-static inline int get_bs(cavs_vector *mvP, cavs_vector *mvQ, int b)
-{
-    if ((mvP->ref == REF_INTRA) || (mvQ->ref == REF_INTRA))
-        return 2;
-    if ((abs(mvP->x - mvQ->x) >= 4) || (abs(mvP->y - mvQ->y) >= 4))
-        return 1;
-    if (b) {
-        mvP += MV_BWD_OFFS;
-        mvQ += MV_BWD_OFFS;
-        if ((abs(mvP->x - mvQ->x) >= 4) || (abs(mvP->y - mvQ->y) >= 4))
-            return 1;
-    } else {
-        if (mvP->ref != mvQ->ref)
-            return 1;
-    }
-    return 0;
-}
-
-#define SET_PARAMS                                                \
-    alpha = alpha_tab[av_clip(qp_avg + h->alpha_offset, 0, 63)];  \
-    beta  =  beta_tab[av_clip(qp_avg + h->beta_offset,  0, 63)];  \
-    tc    =    tc_tab[av_clip(qp_avg + h->alpha_offset, 0, 63)];
-
-/**
- * in-loop deblocking filter for a single macroblock
- *
- * boundary strength (bs) mapping:
- *
- * --4---5--
- * 0   2   |
- * | 6 | 7 |
- * 1   3   |
- * ---------
- *
- */
-void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type)
-{
-    uint8_t bs[8];
-    int qp_avg, alpha, beta, tc;
-    int i;
-
-    /* save un-deblocked lines */
-    h->topleft_border_y = h->top_border_y[h->mbx * 16 + 15];
-    h->topleft_border_u = h->top_border_u[h->mbx * 10 + 8];
-    h->topleft_border_v = h->top_border_v[h->mbx * 10 + 8];
-    memcpy(&h->top_border_y[h->mbx * 16],     h->cy + 15 * h->l_stride, 16);
-    memcpy(&h->top_border_u[h->mbx * 10 + 1], h->cu +  7 * h->c_stride, 8);
-    memcpy(&h->top_border_v[h->mbx * 10 + 1], h->cv +  7 * h->c_stride, 8);
-    for (i = 0; i < 8; i++) {
-        h->left_border_y[i * 2 + 1] = *(h->cy + 15 + (i * 2 + 0) * h->l_stride);
-        h->left_border_y[i * 2 + 2] = *(h->cy + 15 + (i * 2 + 1) * h->l_stride);
-        h->left_border_u[i + 1]     = *(h->cu + 7  +  i          * h->c_stride);
-        h->left_border_v[i + 1]     = *(h->cv + 7  +  i          * h->c_stride);
-    }
-    if (!h->loop_filter_disable) {
-        /* determine bs */
-        if (mb_type == I_8X8)
-            memset(bs, 2, 8);
-        else {
-            memset(bs, 0, 8);
-            if (ff_cavs_partition_flags[mb_type] & SPLITV) {
-                bs[2] = get_bs(&h->mv[MV_FWD_X0], &h->mv[MV_FWD_X1], mb_type > P_8X8);
-                bs[3] = get_bs(&h->mv[MV_FWD_X2], &h->mv[MV_FWD_X3], mb_type > P_8X8);
-            }
-            if (ff_cavs_partition_flags[mb_type] & SPLITH) {
-                bs[6] = get_bs(&h->mv[MV_FWD_X0], &h->mv[MV_FWD_X2], mb_type > P_8X8);
-                bs[7] = get_bs(&h->mv[MV_FWD_X1], &h->mv[MV_FWD_X3], mb_type > P_8X8);
-            }
-            bs[0] = get_bs(&h->mv[MV_FWD_A1], &h->mv[MV_FWD_X0], mb_type > P_8X8);
-            bs[1] = get_bs(&h->mv[MV_FWD_A3], &h->mv[MV_FWD_X2], mb_type > P_8X8);
-            bs[4] = get_bs(&h->mv[MV_FWD_B2], &h->mv[MV_FWD_X0], mb_type > P_8X8);
-            bs[5] = get_bs(&h->mv[MV_FWD_B3], &h->mv[MV_FWD_X1], mb_type > P_8X8);
-        }
-        if (AV_RN64(bs)) {
-            if (h->flags & A_AVAIL) {
-                qp_avg = (h->qp + h->left_qp + 1) >> 1;
-                SET_PARAMS;
-                h->cdsp.cavs_filter_lv(h->cy, h->l_stride, alpha, beta, tc, bs[0], bs[1]);
-                h->cdsp.cavs_filter_cv(h->cu, h->c_stride, alpha, beta, tc, bs[0], bs[1]);
-                h->cdsp.cavs_filter_cv(h->cv, h->c_stride, alpha, beta, tc, bs[0], bs[1]);
-            }
-            qp_avg = h->qp;
-            SET_PARAMS;
-            h->cdsp.cavs_filter_lv(h->cy + 8,               h->l_stride, alpha, beta, tc, bs[2], bs[3]);
-            h->cdsp.cavs_filter_lh(h->cy + 8 * h->l_stride, h->l_stride, alpha, beta, tc, bs[6], bs[7]);
-
-            if (h->flags & B_AVAIL) {
-                qp_avg = (h->qp + h->top_qp[h->mbx] + 1) >> 1;
-                SET_PARAMS;
-                h->cdsp.cavs_filter_lh(h->cy, h->l_stride, alpha, beta, tc, bs[4], bs[5]);
-                h->cdsp.cavs_filter_ch(h->cu, h->c_stride, alpha, beta, tc, bs[4], bs[5]);
-                h->cdsp.cavs_filter_ch(h->cv, h->c_stride, alpha, beta, tc, bs[4], bs[5]);
-            }
-        }
-    }
-    h->left_qp        = h->qp;
-    h->top_qp[h->mbx] = h->qp;
-}
-
-#undef SET_PARAMS
-
-/*****************************************************************************
- *
- * spatial intra prediction
- *
- ****************************************************************************/
-
-void ff_cavs_load_intra_pred_luma(AVSContext *h, uint8_t *top,
-                                  uint8_t **left, int block)
-{
-    int i;
-
-    switch (block) {
-    case 0:
-        *left               = h->left_border_y;
-        h->left_border_y[0] = h->left_border_y[1];
-        memset(&h->left_border_y[17], h->left_border_y[16], 9);
-        memcpy(&top[1], &h->top_border_y[h->mbx * 16], 16);
-        top[17] = top[16];
-        top[0]  = top[1];
-        if ((h->flags & A_AVAIL) && (h->flags & B_AVAIL))
-            h->left_border_y[0] = top[0] = h->topleft_border_y;
-        break;
-    case 1:
-        *left = h->intern_border_y;
-        for (i = 0; i < 8; i++)
-            h->intern_border_y[i + 1] = *(h->cy + 7 + i * h->l_stride);
-        memset(&h->intern_border_y[9], h->intern_border_y[8], 9);
-        h->intern_border_y[0] = h->intern_border_y[1];
-        memcpy(&top[1], &h->top_border_y[h->mbx * 16 + 8], 8);
-        if (h->flags & C_AVAIL)
-            memcpy(&top[9], &h->top_border_y[(h->mbx + 1) * 16], 8);
-        else
-            memset(&top[9], top[8], 9);
-        top[17] = top[16];
-        top[0]  = top[1];
-        if (h->flags & B_AVAIL)
-            h->intern_border_y[0] = top[0] = h->top_border_y[h->mbx * 16 + 7];
-        break;
-    case 2:
-        *left = &h->left_border_y[8];
-        memcpy(&top[1], h->cy + 7 * h->l_stride, 16);
-        top[17] = top[16];
-        top[0]  = top[1];
-        if (h->flags & A_AVAIL)
-            top[0] = h->left_border_y[8];
-        break;
-    case 3:
-        *left = &h->intern_border_y[8];
-        for (i = 0; i < 8; i++)
-            h->intern_border_y[i + 9] = *(h->cy + 7 + (i + 8) * h->l_stride);
-        memset(&h->intern_border_y[17], h->intern_border_y[16], 9);
-        memcpy(&top[0], h->cy + 7 + 7 * h->l_stride, 9);
-        memset(&top[9], top[8], 9);
-        break;
-    }
-}
-
-void ff_cavs_load_intra_pred_chroma(AVSContext *h)
-{
-    /* extend borders by one pixel */
-    h->left_border_u[9]              = h->left_border_u[8];
-    h->left_border_v[9]              = h->left_border_v[8];
-    h->top_border_u[h->mbx * 10 + 9] = h->top_border_u[h->mbx * 10 + 8];
-    h->top_border_v[h->mbx * 10 + 9] = h->top_border_v[h->mbx * 10 + 8];
-    if (h->mbx && h->mby) {
-        h->top_border_u[h->mbx * 10] = h->left_border_u[0] = h->topleft_border_u;
-        h->top_border_v[h->mbx * 10] = h->left_border_v[0] = h->topleft_border_v;
-    } else {
-        h->left_border_u[0]          = h->left_border_u[1];
-        h->left_border_v[0]          = h->left_border_v[1];
-        h->top_border_u[h->mbx * 10] = h->top_border_u[h->mbx * 10 + 1];
-        h->top_border_v[h->mbx * 10] = h->top_border_v[h->mbx * 10 + 1];
-    }
-}
-
-static void intra_pred_vert(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
-{
-    int y;
-    uint64_t a = AV_RN64(&top[1]);
-    for (y = 0; y < 8; y++)
-        *((uint64_t *)(d + y * stride)) = a;
-}
-
-static void intra_pred_horiz(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
-{
-    int y;
-    uint64_t a;
-    for (y = 0; y < 8; y++) {
-        a = left[y + 1] * 0x0101010101010101ULL;
-        *((uint64_t *)(d + y * stride)) = a;
-    }
-}
-
-static void intra_pred_dc_128(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
-{
-    int y;
-    uint64_t a = 0x8080808080808080ULL;
-    for (y = 0; y < 8; y++)
-        *((uint64_t *)(d + y * stride)) = a;
-}
-
-static void intra_pred_plane(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
-{
-    int x, y, ia;
-    int ih = 0;
-    int iv = 0;
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
-    for (x = 0; x < 4; x++) {
-        ih += (x + 1) *  (top[5 + x] -  top[3 - x]);
-        iv += (x + 1) * (left[5 + x] - left[3 - x]);
-    }
-    ia = (top[8] + left[8]) << 4;
-    ih = (17 * ih + 16) >> 5;
-    iv = (17 * iv + 16) >> 5;
-    for (y = 0; y < 8; y++)
-        for (x = 0; x < 8; x++)
-            d[y * stride + x] = cm[(ia + (x - 3) * ih + (y - 3) * iv + 16) >> 5];
-}
-
-#define LOWPASS(ARRAY, INDEX)                                           \
-    ((ARRAY[(INDEX) - 1] + 2 * ARRAY[(INDEX)] + ARRAY[(INDEX) + 1] + 2) >> 2)
-
-static void intra_pred_lp(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
-{
-    int x, y;
-    for (y = 0; y < 8; y++)
-        for (x = 0; x < 8; x++)
-            d[y * stride + x] = (LOWPASS(top, x + 1) + LOWPASS(left, y + 1)) >> 1;
-}
-
-static void intra_pred_down_left(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
-{
-    int x, y;
-    for (y = 0; y < 8; y++)
-        for (x = 0; x < 8; x++)
-            d[y * stride + x] = (LOWPASS(top, x + y + 2) + LOWPASS(left, x + y + 2)) >> 1;
-}
-
-static void intra_pred_down_right(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
-{
-    int x, y;
-    for (y = 0; y < 8; y++)
-        for (x = 0; x < 8; x++)
-            if (x == y)
-                d[y * stride + x] = (left[1] + 2 * top[0] + top[1] + 2) >> 2;
-            else if (x > y)
-                d[y * stride + x] = LOWPASS(top, x - y);
-            else
-                d[y * stride + x] = LOWPASS(left, y - x);
-}
-
-static void intra_pred_lp_left(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
-{
-    int x, y;
-    for (y = 0; y < 8; y++)
-        for (x = 0; x < 8; x++)
-            d[y * stride + x] = LOWPASS(left, y + 1);
-}
-
-static void intra_pred_lp_top(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
-{
-    int x, y;
-    for (y = 0; y < 8; y++)
-        for (x = 0; x < 8; x++)
-            d[y * stride + x] = LOWPASS(top, x + 1);
-}
-
-#undef LOWPASS
-
-static inline void modify_pred(const int8_t *mod_table, int *mode)
-{
-    *mode = mod_table[*mode];
-    if (*mode < 0) {
-        av_log(NULL, AV_LOG_ERROR, "Illegal intra prediction mode\n");
-        *mode = 0;
-    }
-}
-
-void ff_cavs_modify_mb_i(AVSContext *h, int *pred_mode_uv)
-{
-    /* save pred modes before they get modified */
-    h->pred_mode_Y[3]             = h->pred_mode_Y[5];
-    h->pred_mode_Y[6]             = h->pred_mode_Y[8];
-    h->top_pred_Y[h->mbx * 2 + 0] = h->pred_mode_Y[7];
-    h->top_pred_Y[h->mbx * 2 + 1] = h->pred_mode_Y[8];
-
-    /* modify pred modes according to availability of neighbour samples */
-    if (!(h->flags & A_AVAIL)) {
-        modify_pred(left_modifier_l, &h->pred_mode_Y[4]);
-        modify_pred(left_modifier_l, &h->pred_mode_Y[7]);
-        modify_pred(left_modifier_c, pred_mode_uv);
-    }
-    if (!(h->flags & B_AVAIL)) {
-        modify_pred(top_modifier_l, &h->pred_mode_Y[4]);
-        modify_pred(top_modifier_l, &h->pred_mode_Y[5]);
-        modify_pred(top_modifier_c, pred_mode_uv);
-    }
-}
-
-/*****************************************************************************
- *
- * motion compensation
- *
- ****************************************************************************/
-
-static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height,
-                               int delta, int list, uint8_t *dest_y,
-                               uint8_t *dest_cb, uint8_t *dest_cr,
-                               int src_x_offset, int src_y_offset,
-                               qpel_mc_func *qpix_op,
-                               h264_chroma_mc_func chroma_op, cavs_vector *mv)
-{
-    const int mx         = mv->x + src_x_offset * 8;
-    const int my         = mv->y + src_y_offset * 8;
-    const int luma_xy    = (mx & 3) + ((my & 3) << 2);
-    uint8_t *src_y       = pic->data[0] + (mx >> 2) + (my >> 2) * h->l_stride;
-    uint8_t *src_cb      = pic->data[1] + (mx >> 3) + (my >> 3) * h->c_stride;
-    uint8_t *src_cr      = pic->data[2] + (mx >> 3) + (my >> 3) * h->c_stride;
-    int extra_width      = 0;
-    int extra_height     = extra_width;
-    const int full_mx    = mx >> 2;
-    const int full_my    = my >> 2;
-    const int pic_width  = 16 * h->mb_width;
-    const int pic_height = 16 * h->mb_height;
-    int emu = 0;
-
-    if (!pic->data[0])
-        return;
-    if (mx & 7)
-        extra_width  -= 3;
-    if (my & 7)
-        extra_height -= 3;
-
-    if (full_mx < 0 - extra_width ||
-        full_my < 0 - extra_height ||
-        full_mx + 16 /* FIXME */ > pic_width + extra_width ||
-        full_my + 16 /* FIXME */ > pic_height + extra_height) {
-        h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
-                                 src_y - 2 - 2 * h->l_stride,
-                                 h->l_stride, h->l_stride,
-                                 16 + 5, 16 + 5 /* FIXME */,
-                                 full_mx - 2, full_my - 2,
-                                 pic_width, pic_height);
-        src_y = h->edge_emu_buffer + 2 + 2 * h->l_stride;
-        emu   = 1;
-    }
-
-    // FIXME try variable height perhaps?
-    qpix_op[luma_xy](dest_y, src_y, h->l_stride);
-
-    if (emu) {
-        h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb,
-                                 h->c_stride, h->c_stride,
-                                 9, 9 /* FIXME */,
-                                 mx >> 3, my >> 3,
-                                 pic_width >> 1, pic_height >> 1);
-        src_cb = h->edge_emu_buffer;
-    }
-    chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx & 7, my & 7);
-
-    if (emu) {
-        h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr,
-                                 h->c_stride, h->c_stride,
-                                 9, 9 /* FIXME */,
-                                 mx >> 3, my >> 3,
-                                 pic_width >> 1, pic_height >> 1);
-        src_cr = h->edge_emu_buffer;
-    }
-    chroma_op(dest_cr, src_cr, h->c_stride, chroma_height, mx & 7, my & 7);
-}
-
-static inline void mc_part_std(AVSContext *h, int chroma_height, int delta,
-                               uint8_t *dest_y,
-                               uint8_t *dest_cb,
-                               uint8_t *dest_cr,
-                               int x_offset, int y_offset,
-                               qpel_mc_func *qpix_put,
-                               h264_chroma_mc_func chroma_put,
-                               qpel_mc_func *qpix_avg,
-                               h264_chroma_mc_func chroma_avg,
-                               cavs_vector *mv)
-{
-    qpel_mc_func *qpix_op =  qpix_put;
-    h264_chroma_mc_func chroma_op = chroma_put;
-
-    dest_y   += x_offset * 2 + y_offset * h->l_stride * 2;
-    dest_cb  += x_offset     + y_offset * h->c_stride;
-    dest_cr  += x_offset     + y_offset * h->c_stride;
-    x_offset += 8 * h->mbx;
-    y_offset += 8 * h->mby;
-
-    if (mv->ref >= 0) {
-        AVFrame *ref = h->DPB[mv->ref].f;
-        mc_dir_part(h, ref, chroma_height, delta, 0,
-                    dest_y, dest_cb, dest_cr, x_offset, y_offset,
-                    qpix_op, chroma_op, mv);
-
-        qpix_op   = qpix_avg;
-        chroma_op = chroma_avg;
-    }
-
-    if ((mv + MV_BWD_OFFS)->ref >= 0) {
-        AVFrame *ref = h->DPB[0].f;
-        mc_dir_part(h, ref, chroma_height, delta, 1,
-                    dest_y, dest_cb, dest_cr, x_offset, y_offset,
-                    qpix_op, chroma_op, mv + MV_BWD_OFFS);
-    }
-}
-
-void ff_cavs_inter(AVSContext *h, enum cavs_mb mb_type)
-{
-    if (ff_cavs_partition_flags[mb_type] == 0) { // 16x16
-        mc_part_std(h, 8, 0, h->cy, h->cu, h->cv, 0, 0,
-                    h->cdsp.put_cavs_qpel_pixels_tab[0],
-                    h->h264chroma.put_h264_chroma_pixels_tab[0],
-                    h->cdsp.avg_cavs_qpel_pixels_tab[0],
-                    h->h264chroma.avg_h264_chroma_pixels_tab[0],
-                    &h->mv[MV_FWD_X0]);
-    } else {
-        mc_part_std(h, 4, 0, h->cy, h->cu, h->cv, 0, 0,
-                    h->cdsp.put_cavs_qpel_pixels_tab[1],
-                    h->h264chroma.put_h264_chroma_pixels_tab[1],
-                    h->cdsp.avg_cavs_qpel_pixels_tab[1],
-                    h->h264chroma.avg_h264_chroma_pixels_tab[1],
-                    &h->mv[MV_FWD_X0]);
-        mc_part_std(h, 4, 0, h->cy, h->cu, h->cv, 4, 0,
-                    h->cdsp.put_cavs_qpel_pixels_tab[1],
-                    h->h264chroma.put_h264_chroma_pixels_tab[1],
-                    h->cdsp.avg_cavs_qpel_pixels_tab[1],
-                    h->h264chroma.avg_h264_chroma_pixels_tab[1],
-                    &h->mv[MV_FWD_X1]);
-        mc_part_std(h, 4, 0, h->cy, h->cu, h->cv, 0, 4,
-                    h->cdsp.put_cavs_qpel_pixels_tab[1],
-                    h->h264chroma.put_h264_chroma_pixels_tab[1],
-                    h->cdsp.avg_cavs_qpel_pixels_tab[1],
-                    h->h264chroma.avg_h264_chroma_pixels_tab[1],
-                    &h->mv[MV_FWD_X2]);
-        mc_part_std(h, 4, 0, h->cy, h->cu, h->cv, 4, 4,
-                    h->cdsp.put_cavs_qpel_pixels_tab[1],
-                    h->h264chroma.put_h264_chroma_pixels_tab[1],
-                    h->cdsp.avg_cavs_qpel_pixels_tab[1],
-                    h->h264chroma.avg_h264_chroma_pixels_tab[1],
-                    &h->mv[MV_FWD_X3]);
-    }
-}
-
-/*****************************************************************************
- *
- * motion vector prediction
- *
- ****************************************************************************/
-
-static inline void scale_mv(AVSContext *h, int *d_x, int *d_y,
-                            cavs_vector *src, int distp)
-{
-    int den = h->scale_den[src->ref];
-
-    *d_x = (src->x * distp * den + 256 + (src->x >> 31)) >> 9;
-    *d_y = (src->y * distp * den + 256 + (src->y >> 31)) >> 9;
-}
-
-static inline void mv_pred_median(AVSContext *h,
-                                  cavs_vector *mvP,
-                                  cavs_vector *mvA,
-                                  cavs_vector *mvB,
-                                  cavs_vector *mvC)
-{
-    int ax, ay, bx, by, cx, cy;
-    int len_ab, len_bc, len_ca, len_mid;
-
-    /* scale candidates according to their temporal span */
-    scale_mv(h, &ax, &ay, mvA, mvP->dist);
-    scale_mv(h, &bx, &by, mvB, mvP->dist);
-    scale_mv(h, &cx, &cy, mvC, mvP->dist);
-    /* find the geometrical median of the three candidates */
-    len_ab  = abs(ax - bx) + abs(ay - by);
-    len_bc  = abs(bx - cx) + abs(by - cy);
-    len_ca  = abs(cx - ax) + abs(cy - ay);
-    len_mid = mid_pred(len_ab, len_bc, len_ca);
-    if (len_mid == len_ab) {
-        mvP->x = cx;
-        mvP->y = cy;
-    } else if (len_mid == len_bc) {
-        mvP->x = ax;
-        mvP->y = ay;
-    } else {
-        mvP->x = bx;
-        mvP->y = by;
-    }
-}
-
-void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC,
-                enum cavs_mv_pred mode, enum cavs_block size, int ref)
-{
-    cavs_vector *mvP = &h->mv[nP];
-    cavs_vector *mvA = &h->mv[nP-1];
-    cavs_vector *mvB = &h->mv[nP-4];
-    cavs_vector *mvC = &h->mv[nC];
-    const cavs_vector *mvP2 = NULL;
-
-    mvP->ref  = ref;
-    mvP->dist = h->dist[mvP->ref];
-    if (mvC->ref == NOT_AVAIL)
-        mvC = &h->mv[nP - 5];  // set to top-left (mvD)
-    if (mode == MV_PRED_PSKIP &&
-        (mvA->ref == NOT_AVAIL ||
-         mvB->ref == NOT_AVAIL ||
-         (mvA->x | mvA->y | mvA->ref) == 0 ||
-         (mvB->x | mvB->y | mvB->ref) == 0)) {
-        mvP2 = &un_mv;
-    /* if there is only one suitable candidate, take it */
-    } else if (mvA->ref >= 0 && mvB->ref < 0  && mvC->ref < 0) {
-        mvP2 = mvA;
-    } else if (mvA->ref < 0  && mvB->ref >= 0 && mvC->ref < 0) {
-        mvP2 = mvB;
-    } else if (mvA->ref < 0  && mvB->ref < 0  && mvC->ref >= 0) {
-        mvP2 = mvC;
-    } else if (mode == MV_PRED_LEFT     && mvA->ref == ref) {
-        mvP2 = mvA;
-    } else if (mode == MV_PRED_TOP      && mvB->ref == ref) {
-        mvP2 = mvB;
-    } else if (mode == MV_PRED_TOPRIGHT && mvC->ref == ref) {
-        mvP2 = mvC;
-    }
-    if (mvP2) {
-        mvP->x = mvP2->x;
-        mvP->y = mvP2->y;
-    } else
-        mv_pred_median(h, mvP, mvA, mvB, mvC);
-
-    if (mode < MV_PRED_PSKIP) {
-        mvP->x += get_se_golomb(&h->gb);
-        mvP->y += get_se_golomb(&h->gb);
-    }
-    set_mvs(mvP, size);
-}
-
-/*****************************************************************************
- *
- * macroblock level
- *
- ****************************************************************************/
-
-/**
- * initialise predictors for motion vectors and intra prediction
- */
-void ff_cavs_init_mb(AVSContext *h)
-{
-    int i;
-
-    /* copy predictors from top line (MB B and C) into cache */
-    for (i = 0; i < 3; i++) {
-        h->mv[MV_FWD_B2 + i] = h->top_mv[0][h->mbx * 2 + i];
-        h->mv[MV_BWD_B2 + i] = h->top_mv[1][h->mbx * 2 + i];
-    }
-    h->pred_mode_Y[1] = h->top_pred_Y[h->mbx * 2 + 0];
-    h->pred_mode_Y[2] = h->top_pred_Y[h->mbx * 2 + 1];
-    /* clear top predictors if MB B is not available */
-    if (!(h->flags & B_AVAIL)) {
-        h->mv[MV_FWD_B2]  = un_mv;
-        h->mv[MV_FWD_B3]  = un_mv;
-        h->mv[MV_BWD_B2]  = un_mv;
-        h->mv[MV_BWD_B3]  = un_mv;
-        h->pred_mode_Y[1] = h->pred_mode_Y[2] = NOT_AVAIL;
-        h->flags         &= ~(C_AVAIL | D_AVAIL);
-    } else if (h->mbx) {
-        h->flags |= D_AVAIL;
-    }
-    if (h->mbx == h->mb_width - 1) // MB C not available
-        h->flags &= ~C_AVAIL;
-    /* clear top-right predictors if MB C is not available */
-    if (!(h->flags & C_AVAIL)) {
-        h->mv[MV_FWD_C2] = un_mv;
-        h->mv[MV_BWD_C2] = un_mv;
-    }
-    /* clear top-left predictors if MB D is not available */
-    if (!(h->flags & D_AVAIL)) {
-        h->mv[MV_FWD_D3] = un_mv;
-        h->mv[MV_BWD_D3] = un_mv;
-    }
-}
-
-/**
- * save predictors for later macroblocks and increase
- * macroblock address
- * @return 0 if end of frame is reached, 1 otherwise
- */
-int ff_cavs_next_mb(AVSContext *h)
-{
-    int i;
-
-    h->flags |= A_AVAIL;
-    h->cy    += 16;
-    h->cu    += 8;
-    h->cv    += 8;
-    /* copy mvs as predictors to the left */
-    for (i = 0; i <= 20; i += 4)
-        h->mv[i] = h->mv[i + 2];
-    /* copy bottom mvs from cache to top line */
-    h->top_mv[0][h->mbx * 2 + 0] = h->mv[MV_FWD_X2];
-    h->top_mv[0][h->mbx * 2 + 1] = h->mv[MV_FWD_X3];
-    h->top_mv[1][h->mbx * 2 + 0] = h->mv[MV_BWD_X2];
-    h->top_mv[1][h->mbx * 2 + 1] = h->mv[MV_BWD_X3];
-    /* next MB address */
-    h->mbidx++;
-    h->mbx++;
-    if (h->mbx == h->mb_width) { // New mb line
-        h->flags = B_AVAIL | C_AVAIL;
-        /* clear left pred_modes */
-        h->pred_mode_Y[3] = h->pred_mode_Y[6] = NOT_AVAIL;
-        /* clear left mv predictors */
-        for (i = 0; i <= 20; i += 4)
-            h->mv[i] = un_mv;
-        h->mbx = 0;
-        h->mby++;
-        /* re-calculate sample pointers */
-        h->cy = h->cur.f->data[0] + h->mby * 16 * h->l_stride;
-        h->cu = h->cur.f->data[1] + h->mby * 8 * h->c_stride;
-        h->cv = h->cur.f->data[2] + h->mby * 8 * h->c_stride;
-        if (h->mby == h->mb_height) { // Frame end
-            return 0;
-        }
-    }
-    return 1;
-}
-
-/*****************************************************************************
- *
- * frame level
- *
- ****************************************************************************/
-
-void ff_cavs_init_pic(AVSContext *h)
-{
-    int i;
-
-    /* clear some predictors */
-    for (i = 0; i <= 20; i += 4)
-        h->mv[i] = un_mv;
-    h->mv[MV_BWD_X0] = ff_cavs_dir_mv;
-    set_mvs(&h->mv[MV_BWD_X0], BLK_16X16);
-    h->mv[MV_FWD_X0] = ff_cavs_dir_mv;
-    set_mvs(&h->mv[MV_FWD_X0], BLK_16X16);
-    h->pred_mode_Y[3] = h->pred_mode_Y[6] = NOT_AVAIL;
-    h->cy             = h->cur.f->data[0];
-    h->cu             = h->cur.f->data[1];
-    h->cv             = h->cur.f->data[2];
-    h->l_stride       = h->cur.f->linesize[0];
-    h->c_stride       = h->cur.f->linesize[1];
-    h->luma_scan[2]   = 8 * h->l_stride;
-    h->luma_scan[3]   = 8 * h->l_stride + 8;
-    h->mbx            = h->mby = h->mbidx = 0;
-    h->flags          = 0;
-}
-
-/*****************************************************************************
- *
- * headers and interface
- *
- ****************************************************************************/
-
-/**
- * some predictions require data from the top-neighbouring macroblock.
- * this data has to be stored for one complete row of macroblocks
- * and this storage space is allocated here
- */
-void ff_cavs_init_top_lines(AVSContext *h)
-{
-    /* alloc top line of predictors */
-    h->top_qp       = av_mallocz(h->mb_width);
-    h->top_mv[0]    = av_mallocz((h->mb_width * 2 + 1) * sizeof(cavs_vector));
-    h->top_mv[1]    = av_mallocz((h->mb_width * 2 + 1) * sizeof(cavs_vector));
-    h->top_pred_Y   = av_mallocz(h->mb_width * 2 * sizeof(*h->top_pred_Y));
-    h->top_border_y = av_mallocz((h->mb_width + 1) * 16);
-    h->top_border_u = av_mallocz(h->mb_width * 10);
-    h->top_border_v = av_mallocz(h->mb_width * 10);
-
-    /* alloc space for co-located MVs and types */
-    h->col_mv        = av_mallocz(h->mb_width * h->mb_height * 4 *
-                                  sizeof(cavs_vector));
-    h->col_type_base = av_mallocz(h->mb_width * h->mb_height);
-    h->block         = av_mallocz(64 * sizeof(int16_t));
-}
-
-av_cold int ff_cavs_init(AVCodecContext *avctx)
-{
-    AVSContext *h = avctx->priv_data;
-
-    ff_dsputil_init(&h->dsp, avctx);
-    ff_h264chroma_init(&h->h264chroma, 8);
-    ff_videodsp_init(&h->vdsp, 8);
-    ff_cavsdsp_init(&h->cdsp, avctx);
-    ff_init_scantable_permutation(h->dsp.idct_permutation,
-                                  h->cdsp.idct_perm);
-    ff_init_scantable(h->dsp.idct_permutation, &h->scantable, ff_zigzag_direct);
-
-    h->avctx       = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    h->cur.f    = av_frame_alloc();
-    h->DPB[0].f = av_frame_alloc();
-    h->DPB[1].f = av_frame_alloc();
-    if (!h->cur.f || !h->DPB[0].f || !h->DPB[1].f) {
-        ff_cavs_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    h->luma_scan[0]                     = 0;
-    h->luma_scan[1]                     = 8;
-    h->intra_pred_l[INTRA_L_VERT]       = intra_pred_vert;
-    h->intra_pred_l[INTRA_L_HORIZ]      = intra_pred_horiz;
-    h->intra_pred_l[INTRA_L_LP]         = intra_pred_lp;
-    h->intra_pred_l[INTRA_L_DOWN_LEFT]  = intra_pred_down_left;
-    h->intra_pred_l[INTRA_L_DOWN_RIGHT] = intra_pred_down_right;
-    h->intra_pred_l[INTRA_L_LP_LEFT]    = intra_pred_lp_left;
-    h->intra_pred_l[INTRA_L_LP_TOP]     = intra_pred_lp_top;
-    h->intra_pred_l[INTRA_L_DC_128]     = intra_pred_dc_128;
-    h->intra_pred_c[INTRA_C_LP]         = intra_pred_lp;
-    h->intra_pred_c[INTRA_C_HORIZ]      = intra_pred_horiz;
-    h->intra_pred_c[INTRA_C_VERT]       = intra_pred_vert;
-    h->intra_pred_c[INTRA_C_PLANE]      = intra_pred_plane;
-    h->intra_pred_c[INTRA_C_LP_LEFT]    = intra_pred_lp_left;
-    h->intra_pred_c[INTRA_C_LP_TOP]     = intra_pred_lp_top;
-    h->intra_pred_c[INTRA_C_DC_128]     = intra_pred_dc_128;
-    h->mv[7]                            = un_mv;
-    h->mv[19]                           = un_mv;
-    return 0;
-}
-
-av_cold int ff_cavs_end(AVCodecContext *avctx)
-{
-    AVSContext *h = avctx->priv_data;
-
-    av_frame_free(&h->cur.f);
-    av_frame_free(&h->DPB[0].f);
-    av_frame_free(&h->DPB[1].f);
-
-    av_free(h->top_qp);
-    av_free(h->top_mv[0]);
-    av_free(h->top_mv[1]);
-    av_free(h->top_pred_Y);
-    av_free(h->top_border_y);
-    av_free(h->top_border_u);
-    av_free(h->top_border_v);
-    av_free(h->col_mv);
-    av_free(h->col_type_base);
-    av_free(h->block);
-    av_freep(&h->edge_emu_buffer);
-    return 0;
-}
diff --git a/deps/libav/libavcodec/cavs.h b/deps/libav/libavcodec/cavs.h
deleted file mode 100644
index 7d9b94e..0000000
--- a/deps/libav/libavcodec/cavs.h
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
- * Copyright (c) 2006  Stefan Gehrer <stefan.gehrer at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_CAVS_H
-#define AVCODEC_CAVS_H
-
-#include "cavsdsp.h"
-#include "dsputil.h"
-#include "h264chroma.h"
-#include "get_bits.h"
-#include "videodsp.h"
-
-#define SLICE_MAX_START_CODE    0x000001af
-#define EXT_START_CODE          0x000001b5
-#define USER_START_CODE         0x000001b2
-#define CAVS_START_CODE         0x000001b0
-#define PIC_I_START_CODE        0x000001b3
-#define PIC_PB_START_CODE       0x000001b6
-
-#define A_AVAIL                          1
-#define B_AVAIL                          2
-#define C_AVAIL                          4
-#define D_AVAIL                          8
-#define NOT_AVAIL                       -1
-#define REF_INTRA                       -2
-#define REF_DIR                         -3
-
-#define ESCAPE_CODE                     59
-
-#define FWD0                          0x01
-#define FWD1                          0x02
-#define BWD0                          0x04
-#define BWD1                          0x08
-#define SYM0                          0x10
-#define SYM1                          0x20
-#define SPLITH                        0x40
-#define SPLITV                        0x80
-
-#define MV_BWD_OFFS                     12
-#define MV_STRIDE                        4
-
-enum cavs_mb {
-  I_8X8 = 0,
-  P_SKIP,
-  P_16X16,
-  P_16X8,
-  P_8X16,
-  P_8X8,
-  B_SKIP,
-  B_DIRECT,
-  B_FWD_16X16,
-  B_BWD_16X16,
-  B_SYM_16X16,
-  B_8X8 = 29
-};
-
-enum cavs_sub_mb {
-  B_SUB_DIRECT,
-  B_SUB_FWD,
-  B_SUB_BWD,
-  B_SUB_SYM
-};
-
-enum cavs_intra_luma {
-  INTRA_L_VERT,
-  INTRA_L_HORIZ,
-  INTRA_L_LP,
-  INTRA_L_DOWN_LEFT,
-  INTRA_L_DOWN_RIGHT,
-  INTRA_L_LP_LEFT,
-  INTRA_L_LP_TOP,
-  INTRA_L_DC_128
-};
-
-enum cavs_intra_chroma {
-  INTRA_C_LP,
-  INTRA_C_HORIZ,
-  INTRA_C_VERT,
-  INTRA_C_PLANE,
-  INTRA_C_LP_LEFT,
-  INTRA_C_LP_TOP,
-  INTRA_C_DC_128,
-};
-
-enum cavs_mv_pred {
-  MV_PRED_MEDIAN,
-  MV_PRED_LEFT,
-  MV_PRED_TOP,
-  MV_PRED_TOPRIGHT,
-  MV_PRED_PSKIP,
-  MV_PRED_BSKIP
-};
-
-enum cavs_block {
-  BLK_16X16,
-  BLK_16X8,
-  BLK_8X16,
-  BLK_8X8
-};
-
-enum cavs_mv_loc {
-  MV_FWD_D3 = 0,
-  MV_FWD_B2,
-  MV_FWD_B3,
-  MV_FWD_C2,
-  MV_FWD_A1,
-  MV_FWD_X0,
-  MV_FWD_X1,
-  MV_FWD_A3 = 8,
-  MV_FWD_X2,
-  MV_FWD_X3,
-  MV_BWD_D3 = MV_BWD_OFFS,
-  MV_BWD_B2,
-  MV_BWD_B3,
-  MV_BWD_C2,
-  MV_BWD_A1,
-  MV_BWD_X0,
-  MV_BWD_X1,
-  MV_BWD_A3 = MV_BWD_OFFS+8,
-  MV_BWD_X2,
-  MV_BWD_X3
-};
-
-DECLARE_ALIGNED(8, typedef, struct) {
-    int16_t x;
-    int16_t y;
-    int16_t dist;
-    int16_t ref;
-} cavs_vector;
-
-struct dec_2dvlc {
-  int8_t rltab[59][3];
-  int8_t level_add[27];
-  int8_t golomb_order;
-  int inc_limit;
-  int8_t max_run;
-};
-
-typedef struct AVSFrame {
-    AVFrame *f;
-    int poc;
-} AVSFrame;
-
-typedef struct AVSContext {
-    AVCodecContext *avctx;
-    DSPContext       dsp;
-    H264ChromaContext h264chroma;
-    VideoDSPContext vdsp;
-    CAVSDSPContext  cdsp;
-    GetBitContext gb;
-    AVSFrame cur;     ///< currently decoded frame
-    AVSFrame DPB[2];  ///< reference frames
-    int dist[2];     ///< temporal distances from current frame to ref frames
-    int low_delay;
-    int profile, level;
-    int aspect_ratio;
-    int mb_width, mb_height;
-    int width, height;
-    int stream_revision; ///<0 for samples from 2006, 1 for rm52j encoder
-    int progressive;
-    int pic_structure;
-    int skip_mode_flag; ///< select between skip_count or one skip_flag per MB
-    int loop_filter_disable;
-    int alpha_offset, beta_offset;
-    int ref_flag;
-    int mbx, mby, mbidx; ///< macroblock coordinates
-    int flags;         ///< availability flags of neighbouring macroblocks
-    int stc;           ///< last start code
-    uint8_t *cy, *cu, *cv; ///< current MB sample pointers
-    int left_qp;
-    uint8_t *top_qp;
-
-    /** mv motion vector cache
-       0:    D3  B2  B3  C2
-       4:    A1  X0  X1   -
-       8:    A3  X2  X3   -
-
-       X are the vectors in the current macroblock (5,6,9,10)
-       A is the macroblock to the left (4,8)
-       B is the macroblock to the top (1,2)
-       C is the macroblock to the top-right (3)
-       D is the macroblock to the top-left (0)
-
-       the same is repeated for backward motion vectors */
-    cavs_vector mv[2*4*3];
-    cavs_vector *top_mv[2];
-    cavs_vector *col_mv;
-
-    /** luma pred mode cache
-       0:    --  B2  B3
-       3:    A1  X0  X1
-       6:    A3  X2  X3   */
-    int pred_mode_Y[3*3];
-    int *top_pred_Y;
-    ptrdiff_t l_stride, c_stride;
-    int luma_scan[4];
-    int qp;
-    int qp_fixed;
-    int cbp;
-    ScanTable scantable;
-
-    /** intra prediction is done with un-deblocked samples
-     they are saved here before deblocking the MB  */
-    uint8_t *top_border_y, *top_border_u, *top_border_v;
-    uint8_t left_border_y[26], left_border_u[10], left_border_v[10];
-    uint8_t intern_border_y[26];
-    uint8_t topleft_border_y, topleft_border_u, topleft_border_v;
-
-    void (*intra_pred_l[8])(uint8_t *d,uint8_t *top,uint8_t *left,int stride);
-    void (*intra_pred_c[7])(uint8_t *d,uint8_t *top,uint8_t *left,int stride);
-    uint8_t *col_type_base;
-
-    /* scaling factors for MV prediction */
-    int sym_factor;    ///< for scaling in symmetrical B block
-    int direct_den[2]; ///< for scaling in direct B block
-    int scale_den[2];  ///< for scaling neighbouring MVs
-
-    uint8_t *edge_emu_buffer;
-
-    int got_keyframe;
-    int16_t *block;
-} AVSContext;
-
-extern const uint8_t     ff_cavs_partition_flags[30];
-extern const cavs_vector ff_cavs_intra_mv;
-extern const cavs_vector ff_cavs_dir_mv;
-
-static inline void set_mvs(cavs_vector *mv, enum cavs_block size) {
-    switch(size) {
-    case BLK_16X16:
-        mv[MV_STRIDE  ] = mv[0];
-        mv[MV_STRIDE+1] = mv[0];
-    case BLK_16X8:
-        mv[1] = mv[0];
-        break;
-    case BLK_8X16:
-        mv[MV_STRIDE] = mv[0];
-        break;
-    }
-}
-
-void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type);
-void ff_cavs_load_intra_pred_luma(AVSContext *h, uint8_t *top, uint8_t **left,
-                                  int block);
-void ff_cavs_load_intra_pred_chroma(AVSContext *h);
-void ff_cavs_modify_mb_i(AVSContext *h, int *pred_mode_uv);
-void ff_cavs_inter(AVSContext *h, enum cavs_mb mb_type);
-void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC,
-                enum cavs_mv_pred mode, enum cavs_block size, int ref);
-void ff_cavs_init_mb(AVSContext *h);
-int  ff_cavs_next_mb(AVSContext *h);
-void ff_cavs_init_pic(AVSContext *h);
-void ff_cavs_init_top_lines(AVSContext *h);
-int ff_cavs_init(AVCodecContext *avctx);
-int ff_cavs_end (AVCodecContext *avctx);
-
-#endif /* AVCODEC_CAVS_H */
diff --git a/deps/libav/libavcodec/cavs_parser.c b/deps/libav/libavcodec/cavs_parser.c
deleted file mode 100644
index 84f647c..0000000
--- a/deps/libav/libavcodec/cavs_parser.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) parser.
- * Copyright (c) 2006  Stefan Gehrer <stefan.gehrer at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Chinese AVS video (AVS1-P2, JiZhun profile) parser
- * @author Stefan Gehrer <stefan.gehrer at gmx.de>
- */
-
-#include "parser.h"
-#include "cavs.h"
-
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int cavs_find_frame_end(ParseContext *pc, const uint8_t *buf,
-                               int buf_size) {
-    int pic_found, i;
-    uint32_t state;
-
-    pic_found= pc->frame_start_found;
-    state= pc->state;
-
-    i=0;
-    if(!pic_found){
-        for(i=0; i<buf_size; i++){
-            state= (state<<8) | buf[i];
-            if(state == PIC_I_START_CODE || state == PIC_PB_START_CODE){
-                i++;
-                pic_found=1;
-                break;
-            }
-        }
-    }
-
-    if(pic_found){
-        /* EOF considered as end of frame */
-        if (buf_size == 0)
-            return 0;
-        for(; i<buf_size; i++){
-            state= (state<<8) | buf[i];
-            if((state&0xFFFFFF00) == 0x100){
-                if(state > SLICE_MAX_START_CODE){
-                    pc->frame_start_found=0;
-                    pc->state=-1;
-                    return i-3;
-                }
-            }
-        }
-    }
-    pc->frame_start_found= pic_found;
-    pc->state= state;
-    return END_NOT_FOUND;
-}
-
-static int cavsvideo_parse(AVCodecParserContext *s,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
-{
-    ParseContext *pc = s->priv_data;
-    int next;
-
-    if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
-        next= buf_size;
-    }else{
-        next= cavs_find_frame_end(pc, buf, buf_size);
-
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-    }
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_cavsvideo_parser = {
-    .codec_ids      = { AV_CODEC_ID_CAVS },
-    .priv_data_size = sizeof(ParseContext),
-    .parser_parse   = cavsvideo_parse,
-    .parser_close   = ff_parse_close,
-    .split          = ff_mpeg4video_split,
-};
diff --git a/deps/libav/libavcodec/cavsdata.c b/deps/libav/libavcodec/cavsdata.c
deleted file mode 100644
index 4e4a131..0000000
--- a/deps/libav/libavcodec/cavsdata.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
- * Copyright (c) 2006  Stefan Gehrer <stefan.gehrer at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "cavs.h"
-
-const uint8_t ff_cavs_partition_flags[30] = {
-  0,                                 //I_8X8
-  0,                                 //P_SKIP
-  0,                                 //P_16X16
-                      SPLITH,        //P_16X8
-                             SPLITV, //P_8X16
-                      SPLITH|SPLITV, //P_8X8
-                      SPLITH|SPLITV, //B_SKIP
-                      SPLITH|SPLITV, //B_DIRECT
-  0,                                 //B_FWD_16X16
-  0,                                 //B_BWD_16X16
-  0,                                 //B_SYM_16X16
-  FWD0|FWD1          |SPLITH,
-  FWD0|FWD1                 |SPLITV,
-  BWD0|BWD1          |SPLITH,
-  BWD0|BWD1                 |SPLITV,
-  FWD0|BWD1          |SPLITH,
-  FWD0|BWD1                 |SPLITV,
-  BWD0|FWD1          |SPLITH,
-  BWD0|FWD1                 |SPLITV,
-  FWD0|FWD1     |SYM1|SPLITH,
-  FWD0|FWD1     |SYM1       |SPLITV,
-  BWD0|FWD1     |SYM1|SPLITH,
-  BWD0|FWD1     |SYM1       |SPLITV,
-  FWD0|FWD1|SYM0     |SPLITH,
-  FWD0|FWD1|SYM0            |SPLITV,
-  FWD0|BWD1|SYM0     |SPLITH,
-  FWD0|BWD1|SYM0            |SPLITV,
-  FWD0|FWD1|SYM0|SYM1|SPLITH,
-  FWD0|FWD1|SYM0|SYM1       |SPLITV,
-                      SPLITH|SPLITV, //B_8X8 = 29
-};
-
-/** mark block as "no prediction from this direction"
-    e.g. forward motion vector in BWD partition */
-const cavs_vector ff_cavs_dir_mv   = {0,0,1,REF_DIR};
-
-/** mark block as using intra prediction */
-const cavs_vector ff_cavs_intra_mv = {0,0,1,REF_INTRA};
diff --git a/deps/libav/libavcodec/cavsdec.c b/deps/libav/libavcodec/cavsdec.c
deleted file mode 100644
index a8ed192..0000000
--- a/deps/libav/libavcodec/cavsdec.c
+++ /dev/null
@@ -1,1208 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
- * Copyright (c) 2006  Stefan Gehrer <stefan.gehrer at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder
- * @author Stefan Gehrer <stefan.gehrer at gmx.de>
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "golomb.h"
-#include "cavs.h"
-#include "internal.h"
-#include "mpeg12data.h"
-#include "mpegvideo.h"
-
-static const uint8_t mv_scan[4] = {
-    MV_FWD_X0, MV_FWD_X1,
-    MV_FWD_X2, MV_FWD_X3
-};
-
-static const uint8_t cbp_tab[64][2] = {
-  { 63,  0 }, { 15, 15 }, { 31, 63 }, { 47, 31 }, {  0, 16 }, { 14, 32 }, { 13, 47 }, { 11, 13 },
-  {  7, 14 }, {  5, 11 }, { 10, 12 }, {  8,  5 }, { 12, 10 }, { 61,  7 }, {  4, 48 }, { 55,  3 },
-  {  1,  2 }, {  2,  8 }, { 59,  4 }, {  3,  1 }, { 62, 61 }, {  9, 55 }, {  6, 59 }, { 29, 62 },
-  { 45, 29 }, { 51, 27 }, { 23, 23 }, { 39, 19 }, { 27, 30 }, { 46, 28 }, { 53,  9 }, { 30,  6 },
-  { 43, 60 }, { 37, 21 }, { 60, 44 }, { 16, 26 }, { 21, 51 }, { 28, 35 }, { 19, 18 }, { 35, 20 },
-  { 42, 24 }, { 26, 53 }, { 44, 17 }, { 32, 37 }, { 58, 39 }, { 24, 45 }, { 20, 58 }, { 17, 43 },
-  { 18, 42 }, { 48, 46 }, { 22, 36 }, { 33, 33 }, { 25, 34 }, { 49, 40 }, { 40, 52 }, { 36, 49 },
-  { 34, 50 }, { 50, 56 }, { 52, 25 }, { 54, 22 }, { 41, 54 }, { 56, 57 }, { 38, 41 }, { 57, 38 }
-};
-
-static const uint8_t scan3x3[4] = { 4, 5, 7, 8 };
-
-static const uint8_t cavs_chroma_qp[64] = {
-   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-  32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 42, 43, 43, 44, 44,
-  45, 45, 46, 46, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 51
-};
-
-static const uint8_t dequant_shift[64] = {
-  14, 14, 14, 14, 14, 14, 14, 14,
-  13, 13, 13, 13, 13, 13, 13, 13,
-  13, 12, 12, 12, 12, 12, 12, 12,
-  11, 11, 11, 11, 11, 11, 11, 11,
-  11, 10, 10, 10, 10, 10, 10, 10,
-  10,  9,  9,  9,  9,  9,  9,  9,
-  9,   8,  8,  8,  8,  8,  8,  8,
-  7,   7,  7,  7,  7,  7,  7,  7
-};
-
-static const uint16_t dequant_mul[64] = {
-  32768, 36061, 38968, 42495, 46341, 50535, 55437, 60424,
-  32932, 35734, 38968, 42495, 46177, 50535, 55109, 59933,
-  65535, 35734, 38968, 42577, 46341, 50617, 55027, 60097,
-  32809, 35734, 38968, 42454, 46382, 50576, 55109, 60056,
-  65535, 35734, 38968, 42495, 46320, 50515, 55109, 60076,
-  65535, 35744, 38968, 42495, 46341, 50535, 55099, 60087,
-  65535, 35734, 38973, 42500, 46341, 50535, 55109, 60097,
-  32771, 35734, 38965, 42497, 46341, 50535, 55109, 60099
-};
-
-#define EOB 0, 0, 0
-
-static const struct dec_2dvlc intra_dec[7] = {
-    {
-        { //level / run / table_inc
-            {  1,  1,  1 }, { -1,  1,  1 }, {  1,  2,  1 }, { -1,  2,  1 }, {  1,  3,  1 }, { -1,  3, 1 },
-            {  1,  4,  1 }, { -1,  4,  1 }, {  1,  5,  1 }, { -1,  5,  1 }, {  1,  6,  1 }, { -1,  6, 1 },
-            {  1,  7,  1 }, { -1,  7,  1 }, {  1,  8,  1 }, { -1,  8,  1 }, {  1,  9,  1 }, { -1,  9, 1 },
-            {  1, 10,  1 }, { -1, 10,  1 }, {  1, 11,  1 }, { -1, 11,  1 }, {  2,  1,  2 }, { -2,  1, 2 },
-            {  1, 12,  1 }, { -1, 12,  1 }, {  1, 13,  1 }, { -1, 13,  1 }, {  1, 14,  1 }, { -1, 14, 1 },
-            {  1, 15,  1 }, { -1, 15,  1 }, {  2,  2,  2 }, { -2,  2,  2 }, {  1, 16,  1 }, { -1, 16, 1 },
-            {  1, 17,  1 }, { -1, 17,  1 }, {  3,  1,  3 }, { -3,  1,  3 }, {  1, 18,  1 }, { -1, 18, 1 },
-            {  1, 19,  1 }, { -1, 19,  1 }, {  2,  3,  2 }, { -2,  3,  2 }, {  1, 20,  1 }, { -1, 20, 1 },
-            {  1, 21,  1 }, { -1, 21,  1 }, {  2,  4,  2 }, { -2,  4,  2 }, {  1, 22,  1 }, { -1, 22, 1 },
-            {  2,  5,  2 }, { -2,  5,  2 }, {  1, 23,  1 }, { -1, 23,  1 }, {   EOB    }
-        },
-        //level_add
-        { 0, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1, -1, -1 },
-        2, //golomb_order
-        0, //inc_limit
-        23, //max_run
-    },
-    {
-        { //level / run
-            {  1,  1,  0 }, { -1,  1,  0 }, {  1,  2,  0 }, { -1,  2,  0 }, {  2,  1,  1 }, { -2,  1,  1 },
-            {  1,  3,  0 }, { -1,  3,  0 }, {     EOB    }, {  1,  4,  0 }, { -1,  4,  0 }, {  1,  5,  0 },
-            { -1,  5,  0 }, {  1,  6,  0 }, { -1,  6,  0 }, {  3,  1,  2 }, { -3,  1,  2 }, {  2,  2,  1 },
-            { -2,  2,  1 }, {  1,  7,  0 }, { -1,  7,  0 }, {  1,  8,  0 }, { -1,  8,  0 }, {  1,  9,  0 },
-            { -1,  9,  0 }, {  2,  3,  1 }, { -2,  3,  1 }, {  4,  1,  2 }, { -4,  1,  2 }, {  1, 10,  0 },
-            { -1, 10,  0 }, {  1, 11,  0 }, { -1, 11,  0 }, {  2,  4,  1 }, { -2,  4,  1 }, {  3,  2,  2 },
-            { -3,  2,  2 }, {  1, 12,  0 }, { -1, 12,  0 }, {  2,  5,  1 }, { -2,  5,  1 }, {  5,  1,  3 },
-            { -5,  1,  3 }, {  1, 13,  0 }, { -1, 13,  0 }, {  2,  6,  1 }, { -2,  6,  1 }, {  1, 14,  0 },
-            { -1, 14,  0 }, {  2,  7,  1 }, { -2,  7,  1 }, {  2,  8,  1 }, { -2,  8,  1 }, {  3,  3,  2 },
-            { -3,  3,  2 }, {  6,  1,  3 }, { -6,  1,  3 }, {  1, 15,  0 }, { -1, 15,  0 }
-        },
-        //level_add
-        { 0, 7, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        1, //inc_limit
-        15, //max_run
-    },
-    {
-        { //level / run
-            {  1,  1,  0 }, { -1,  1,  0 }, {  2,  1,  0 }, { -2,  1,  0 }, {  1,  2,  0 }, { -1,  2,  0 },
-            {  3,  1,  1 }, { -3,  1,  1 }, {     EOB    }, {  1,  3,  0 }, { -1,  3,  0 }, {  2,  2,  0 },
-            { -2,  2,  0 }, {  4,  1,  1 }, { -4,  1,  1 }, {  1,  4,  0 }, { -1,  4,  0 }, {  5,  1,  2 },
-            { -5,  1,  2 }, {  1,  5,  0 }, { -1,  5,  0 }, {  3,  2,  1 }, { -3,  2,  1 }, {  2,  3,  0 },
-            { -2,  3,  0 }, {  1,  6,  0 }, { -1,  6,  0 }, {  6,  1,  2 }, { -6,  1,  2 }, {  2,  4,  0 },
-            { -2,  4,  0 }, {  1,  7,  0 }, { -1,  7,  0 }, {  4,  2,  1 }, { -4,  2,  1 }, {  7,  1,  2 },
-            { -7,  1,  2 }, {  3,  3,  1 }, { -3,  3,  1 }, {  2,  5,  0 }, { -2,  5,  0 }, {  1,  8,  0 },
-            { -1,  8,  0 }, {  2,  6,  0 }, { -2,  6,  0 }, {  8,  1,  3 }, { -8,  1,  3 }, {  1,  9,  0 },
-            { -1,  9,  0 }, {  5,  2,  2 }, { -5,  2,  2 }, {  3,  4,  1 }, { -3,  4,  1 }, {  2,  7,  0 },
-            { -2,  7,  0 }, {  9,  1,  3 }, { -9,  1,  3 }, {  1, 10,  0 }, { -1, 10,  0 }
-        },
-        //level_add
-        { 0, 10, 6, 4, 4, 3, 3, 3, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        2, //inc_limit
-        10, //max_run
-    },
-    {
-        { //level / run
-            {  1,  1,  0 }, { -1,  1,  0 }, {  2,  1,  0 }, { -2,  1,  0 }, {  3,  1,  0 }, { -3,  1,  0 },
-            {  1,  2,  0 }, { -1,  2,  0 }, {     EOB    }, {  4,  1,  0 }, { -4,  1,  0 }, {  5,  1,  1 },
-            { -5,  1,  1 }, {  2,  2,  0 }, { -2,  2,  0 }, {  1,  3,  0 }, { -1,  3,  0 }, {  6,  1,  1 },
-            { -6,  1,  1 }, {  3,  2,  0 }, { -3,  2,  0 }, {  7,  1,  1 }, { -7,  1,  1 }, {  1,  4,  0 },
-            { -1,  4,  0 }, {  8,  1,  2 }, { -8,  1,  2 }, {  2,  3,  0 }, { -2,  3,  0 }, {  4,  2,  0 },
-            { -4,  2,  0 }, {  1,  5,  0 }, { -1,  5,  0 }, {  9,  1,  2 }, { -9,  1,  2 }, {  5,  2,  1 },
-            { -5,  2,  1 }, {  2,  4,  0 }, { -2,  4,  0 }, { 10,  1,  2 }, {-10,  1,  2 }, {  3,  3,  0 },
-            { -3,  3,  0 }, {  1,  6,  0 }, { -1,  6,  0 }, { 11,  1,  3 }, {-11,  1,  3 }, {  6,  2,  1 },
-            { -6,  2,  1 }, {  1,  7,  0 }, { -1,  7,  0 }, {  2,  5,  0 }, { -2,  5,  0 }, {  3,  4,  0 },
-            { -3,  4,  0 }, { 12,  1,  3 }, {-12,  1,  3 }, {  4,  3,  0 }, { -4,  3,  0 }
-         },
-        //level_add
-        { 0, 13, 7, 5, 4, 3, 2, 2, -1, -1, -1 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        4, //inc_limit
-        7, //max_run
-    },
-    {
-        { //level / run
-            {  1,  1,  0 }, { -1,  1,  0 }, {  2,  1,  0 }, { -2,  1,  0 }, {  3,  1,  0 }, { -3,  1,  0 },
-            {     EOB    }, {  4,  1,  0 }, { -4,  1,  0 }, {  5,  1,  0 }, { -5,  1,  0 }, {  6,  1,  0 },
-            { -6,  1,  0 }, {  1,  2,  0 }, { -1,  2,  0 }, {  7,  1,  0 }, { -7,  1,  0 }, {  8,  1,  1 },
-            { -8,  1,  1 }, {  2,  2,  0 }, { -2,  2,  0 }, {  9,  1,  1 }, { -9,  1,  1 }, { 10,  1,  1 },
-            {-10,  1,  1 }, {  1,  3,  0 }, { -1,  3,  0 }, {  3,  2,  0 }, { -3,  2,  0 }, { 11,  1,  2 },
-            {-11,  1,  2 }, {  4,  2,  0 }, { -4,  2,  0 }, { 12,  1,  2 }, {-12,  1,  2 }, { 13,  1,  2 },
-            {-13,  1,  2 }, {  5,  2,  0 }, { -5,  2,  0 }, {  1,  4,  0 }, { -1,  4,  0 }, {  2,  3,  0 },
-            { -2,  3,  0 }, { 14,  1,  2 }, {-14,  1,  2 }, {  6,  2,  0 }, { -6,  2,  0 }, { 15,  1,  2 },
-            {-15,  1,  2 }, { 16,  1,  2 }, {-16,  1,  2 }, {  3,  3,  0 }, { -3,  3,  0 }, {  1,  5,  0 },
-            { -1,  5,  0 }, {  7,  2,  0 }, { -7,  2,  0 }, { 17,  1,  2 }, {-17,  1,  2 }
-        },
-        //level_add
-        { 0,18, 8, 4, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        7, //inc_limit
-        5, //max_run
-    },
-    {
-        { //level / run
-            {     EOB    }, {  1,  1,  0 }, { -1,  1,  0 }, {  2,  1,  0 }, { -2,  1,  0 }, {  3,  1,  0 },
-            { -3,  1,  0 }, {  4,  1,  0 }, { -4,  1,  0 }, {  5,  1,  0 }, { -5,  1,  0 }, {  6,  1,  0 },
-            { -6,  1,  0 }, {  7,  1,  0 }, { -7,  1,  0 }, {  8,  1,  0 }, { -8,  1,  0 }, {  9,  1,  0 },
-            { -9,  1,  0 }, { 10,  1,  0 }, {-10,  1,  0 }, {  1,  2,  0 }, { -1,  2,  0 }, { 11,  1,  1 },
-            {-11,  1,  1 }, { 12,  1,  1 }, {-12,  1,  1 }, { 13,  1,  1 }, {-13,  1,  1 }, {  2,  2,  0 },
-            { -2,  2,  0 }, { 14,  1,  1 }, {-14,  1,  1 }, { 15,  1,  1 }, {-15,  1,  1 }, {  3,  2,  0 },
-            { -3,  2,  0 }, { 16,  1,  1 }, {-16,  1,  1 }, {  1,  3,  0 }, { -1,  3,  0 }, { 17,  1,  1 },
-            {-17,  1,  1 }, {  4,  2,  0 }, { -4,  2,  0 }, { 18,  1,  1 }, {-18,  1,  1 }, {  5,  2,  0 },
-            { -5,  2,  0 }, { 19,  1,  1 }, {-19,  1,  1 }, { 20,  1,  1 }, {-20,  1,  1 }, {  6,  2,  0 },
-            { -6,  2,  0 }, { 21,  1,  1 }, {-21,  1,  1 }, {  2,  3,  0 }, { -2,  3,  0 }
-        },
-        //level_add
-        { 0, 22, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        10, //inc_limit
-        3, //max_run
-    },
-    {
-        { //level / run
-            {     EOB    }, {  1,  1,  0 }, { -1,  1,  0 }, {  2,  1,  0 }, { -2,  1,  0 }, {  3,  1,  0 },
-            { -3,  1,  0 }, {  4,  1,  0 }, { -4,  1,  0 }, {  5,  1,  0 }, { -5,  1,  0 }, {  6,  1,  0 },
-            { -6,  1,  0 }, {  7,  1,  0 }, { -7,  1,  0 }, {  8,  1,  0 }, { -8,  1,  0 }, {  9,  1,  0 },
-            { -9,  1,  0 }, { 10,  1,  0 }, {-10,  1,  0 }, { 11,  1,  0 }, {-11,  1,  0 }, { 12,  1,  0 },
-            {-12,  1,  0 }, { 13,  1,  0 }, {-13,  1,  0 }, { 14,  1,  0 }, {-14,  1,  0 }, { 15,  1,  0 },
-            {-15,  1,  0 }, { 16,  1,  0 }, {-16,  1,  0 }, {  1,  2,  0 }, { -1,  2,  0 }, { 17,  1,  0 },
-            {-17,  1,  0 }, { 18,  1,  0 }, {-18,  1,  0 }, { 19,  1,  0 }, {-19,  1,  0 }, { 20,  1,  0 },
-            {-20,  1,  0 }, { 21,  1,  0 }, {-21,  1,  0 }, {  2,  2,  0 }, { -2,  2,  0 }, { 22,  1,  0 },
-            {-22,  1,  0 }, { 23,  1,  0 }, {-23,  1,  0 }, { 24,  1,  0 }, {-24,  1,  0 }, { 25,  1,  0 },
-            {-25,  1,  0 }, {  3,  2,  0 }, { -3,  2,  0 }, { 26,  1,  0 }, {-26,  1,  0 }
-        },
-        //level_add
-        { 0, 27, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        INT_MAX, //inc_limit
-        2, //max_run
-    }
-};
-
-static const struct dec_2dvlc inter_dec[7] = {
-    {
-        { //level / run
-            {  1,  1,  1 }, { -1,  1,  1 }, {  1,  2,  1 }, { -1,  2,  1 }, {  1,  3,  1 }, { -1,  3,  1 },
-            {  1,  4,  1 }, { -1,  4,  1 }, {  1,  5,  1 }, { -1,  5,  1 }, {  1,  6,  1 }, { -1,  6,  1 },
-            {  1,  7,  1 }, { -1,  7,  1 }, {  1,  8,  1 }, { -1,  8,  1 }, {  1,  9,  1 }, { -1,  9,  1 },
-            {  1, 10,  1 }, { -1, 10,  1 }, {  1, 11,  1 }, { -1, 11,  1 }, {  1, 12,  1 }, { -1, 12,  1 },
-            {  1, 13,  1 }, { -1, 13,  1 }, {  2,  1,  2 }, { -2,  1,  2 }, {  1, 14,  1 }, { -1, 14,  1 },
-            {  1, 15,  1 }, { -1, 15,  1 }, {  1, 16,  1 }, { -1, 16,  1 }, {  1, 17,  1 }, { -1, 17,  1 },
-            {  1, 18,  1 }, { -1, 18,  1 }, {  1, 19,  1 }, { -1, 19,  1 }, {  3,  1,  3 }, { -3,  1,  3 },
-            {  1, 20,  1 }, { -1, 20,  1 }, {  1, 21,  1 }, { -1, 21,  1 }, {  2,  2,  2 }, { -2,  2,  2 },
-            {  1, 22,  1 }, { -1, 22,  1 }, {  1, 23,  1 }, { -1, 23,  1 }, {  1, 24,  1 }, { -1, 24,  1 },
-            {  1, 25,  1 }, { -1, 25,  1 }, {  1, 26,  1 }, { -1, 26,  1 }, {   EOB    }
-        },
-        //level_add
-        { 0, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
-        3, //golomb_order
-        0, //inc_limit
-        26 //max_run
-    },
-    {
-        { //level / run
-            {  1,  1,  0 }, { -1,  1,  0 }, {     EOB    }, {  1,  2,  0 }, { -1,  2,  0 }, {  1,  3,  0 },
-            { -1,  3,  0 }, {  1,  4,  0 }, { -1,  4,  0 }, {  1,  5,  0 }, { -1,  5,  0 }, {  1,  6,  0 },
-            { -1,  6,  0 }, {  2,  1,  1 }, { -2,  1,  1 }, {  1,  7,  0 }, { -1,  7,  0 }, {  1,  8,  0 },
-            { -1,  8,  0 }, {  1,  9,  0 }, { -1,  9,  0 }, {  1, 10,  0 }, { -1, 10,  0 }, {  2,  2,  1 },
-            { -2,  2,  1 }, {  1, 11,  0 }, { -1, 11,  0 }, {  1, 12,  0 }, { -1, 12,  0 }, {  3,  1,  2 },
-            { -3,  1,  2 }, {  1, 13,  0 }, { -1, 13,  0 }, {  1, 14,  0 }, { -1, 14,  0 }, {  2,  3,  1 },
-            { -2,  3,  1 }, {  1, 15,  0 }, { -1, 15,  0 }, {  2,  4,  1 }, { -2,  4,  1 }, {  1, 16,  0 },
-            { -1, 16,  0 }, {  2,  5,  1 }, { -2,  5,  1 }, {  1, 17,  0 }, { -1, 17,  0 }, {  4,  1,  3 },
-            { -4,  1,  3 }, {  2,  6,  1 }, { -2,  6,  1 }, {  1, 18,  0 }, { -1, 18,  0 }, {  1, 19,  0 },
-            { -1, 19,  0 }, {  2,  7,  1 }, { -2,  7,  1 }, {  3,  2,  2 }, { -3,  2,  2 }
-        },
-        //level_add
-        { 0, 5, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        1, //inc_limit
-        19 //max_run
-    },
-    {
-        { //level / run
-            {  1,  1,  0 }, { -1,  1,  0 }, {     EOB    }, {  1,  2,  0 }, { -1,  2,  0 }, {  2,  1,  0 },
-            { -2,  1,  0 }, {  1,  3,  0 }, { -1,  3,  0 }, {  1,  4,  0 }, { -1,  4,  0 }, {  3,  1,  1 },
-            { -3,  1,  1 }, {  2,  2,  0 }, { -2,  2,  0 }, {  1,  5,  0 }, { -1,  5,  0 }, {  1,  6,  0 },
-            { -1,  6,  0 }, {  1,  7,  0 }, { -1,  7,  0 }, {  2,  3,  0 }, { -2,  3,  0 }, {  4,  1,  2 },
-            { -4,  1,  2 }, {  1,  8,  0 }, { -1,  8,  0 }, {  3,  2,  1 }, { -3,  2,  1 }, {  2,  4,  0 },
-            { -2,  4,  0 }, {  1,  9,  0 }, { -1,  9,  0 }, {  1, 10,  0 }, { -1, 10,  0 }, {  5,  1,  2 },
-            { -5,  1,  2 }, {  2,  5,  0 }, { -2,  5,  0 }, {  1, 11,  0 }, { -1, 11,  0 }, {  2,  6,  0 },
-            { -2,  6,  0 }, {  1, 12,  0 }, { -1, 12,  0 }, {  3,  3,  1 }, { -3,  3,  1 }, {  6,  1,  2 },
-            { -6,  1,  2 }, {  4,  2,  2 }, { -4,  2,  2 }, {  1, 13,  0 }, { -1, 13,  0 }, {  2,  7,  0 },
-            { -2,  7,  0 }, {  3,  4,  1 }, { -3,  4,  1 }, {  1, 14,  0 }, { -1, 14,  0 }
-        },
-        //level_add
-        { 0, 7, 5, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        2, //inc_limit
-        14 //max_run
-    },
-    {
-        { //level / run
-            {  1,  1,  0 }, { -1,  1,  0 }, {     EOB    }, {  2,  1,  0 }, { -2,  1,  0 }, {  1,  2,  0 },
-            { -1,  2,  0 }, {  3,  1,  0 }, { -3,  1,  0 }, {  1,  3,  0 }, { -1,  3,  0 }, {  2,  2,  0 },
-            { -2,  2,  0 }, {  4,  1,  1 }, { -4,  1,  1 }, {  1,  4,  0 }, { -1,  4,  0 }, {  5,  1,  1 },
-            { -5,  1,  1 }, {  1,  5,  0 }, { -1,  5,  0 }, {  3,  2,  0 }, { -3,  2,  0 }, {  2,  3,  0 },
-            { -2,  3,  0 }, {  1,  6,  0 }, { -1,  6,  0 }, {  6,  1,  1 }, { -6,  1,  1 }, {  2,  4,  0 },
-            { -2,  4,  0 }, {  1,  7,  0 }, { -1,  7,  0 }, {  4,  2,  1 }, { -4,  2,  1 }, {  7,  1,  2 },
-            { -7,  1,  2 }, {  3,  3,  0 }, { -3,  3,  0 }, {  1,  8,  0 }, { -1,  8,  0 }, {  2,  5,  0 },
-            { -2,  5,  0 }, {  8,  1,  2 }, { -8,  1,  2 }, {  1,  9,  0 }, { -1,  9,  0 }, {  3,  4,  0 },
-            { -3,  4,  0 }, {  2,  6,  0 }, { -2,  6,  0 }, {  5,  2,  1 }, { -5,  2,  1 }, {  1, 10,  0 },
-            { -1, 10,  0 }, {  9,  1,  2 }, { -9,  1,  2 }, {  4,  3,  1 }, { -4,  3,  1 }
-        },
-        //level_add
-        { 0,10, 6, 5, 4, 3, 3, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        3, //inc_limit
-        10 //max_run
-    },
-    {
-        { //level / run
-            {  1,  1,  0 }, { -1,  1,  0 }, {     EOB    }, {  2,  1,  0 }, { -2,  1,  0 }, {  3,  1,  0 },
-            { -3,  1,  0 }, {  1,  2,  0 }, { -1,  2,  0 }, {  4,  1,  0 }, { -4,  1,  0 }, {  5,  1,  0 },
-            { -5,  1,  0 }, {  2,  2,  0 }, { -2,  2,  0 }, {  1,  3,  0 }, { -1,  3,  0 }, {  6,  1,  0 },
-            { -6,  1,  0 }, {  3,  2,  0 }, { -3,  2,  0 }, {  7,  1,  1 }, { -7,  1,  1 }, {  1,  4,  0 },
-            { -1,  4,  0 }, {  8,  1,  1 }, { -8,  1,  1 }, {  2,  3,  0 }, { -2,  3,  0 }, {  4,  2,  0 },
-            { -4,  2,  0 }, {  1,  5,  0 }, { -1,  5,  0 }, {  9,  1,  1 }, { -9,  1,  1 }, {  5,  2,  0 },
-            { -5,  2,  0 }, {  2,  4,  0 }, { -2,  4,  0 }, {  1,  6,  0 }, { -1,  6,  0 }, { 10,  1,  2 },
-            {-10,  1,  2 }, {  3,  3,  0 }, { -3,  3,  0 }, { 11,  1,  2 }, {-11,  1,  2 }, {  1,  7,  0 },
-            { -1,  7,  0 }, {  6,  2,  0 }, { -6,  2,  0 }, {  3,  4,  0 }, { -3,  4,  0 }, {  2,  5,  0 },
-            { -2,  5,  0 }, { 12,  1,  2 }, {-12,  1,  2 }, {  4,  3,  0 }, { -4,  3,  0 }
-        },
-        //level_add
-        { 0, 13, 7, 5, 4, 3, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        6, //inc_limit
-        7  //max_run
-    },
-    {
-        { //level / run
-            {      EOB    }, {  1,  1,  0 }, {  -1,  1,  0 }, {  2,  1,  0 }, {  -2,  1,  0 }, {  3,  1,  0 },
-            {  -3,  1,  0 }, {  4,  1,  0 }, {  -4,  1,  0 }, {  5,  1,  0 }, {  -5,  1,  0 }, {  1,  2,  0 },
-            {  -1,  2,  0 }, {  6,  1,  0 }, {  -6,  1,  0 }, {  7,  1,  0 }, {  -7,  1,  0 }, {  8,  1,  0 },
-            {  -8,  1,  0 }, {  2,  2,  0 }, {  -2,  2,  0 }, {  9,  1,  0 }, {  -9,  1,  0 }, {  1,  3,  0 },
-            {  -1,  3,  0 }, { 10,  1,  1 }, { -10,  1,  1 }, {  3,  2,  0 }, {  -3,  2,  0 }, { 11,  1,  1 },
-            { -11,  1,  1 }, {  4,  2,  0 }, {  -4,  2,  0 }, { 12,  1,  1 }, { -12,  1,  1 }, {  1,  4,  0 },
-            {  -1,  4,  0 }, {  2,  3,  0 }, {  -2,  3,  0 }, { 13,  1,  1 }, { -13,  1,  1 }, {  5,  2,  0 },
-            {  -5,  2,  0 }, { 14,  1,  1 }, { -14,  1,  1 }, {  6,  2,  0 }, {  -6,  2,  0 }, {  1,  5,  0 },
-            {  -1,  5,  0 }, { 15,  1,  1 }, { -15,  1,  1 }, {  3,  3,  0 }, {  -3,  3,  0 }, { 16,  1,  1 },
-            { -16,  1,  1 }, {  2,  4,  0 }, {  -2,  4,  0 }, {  7,  2,  0 }, {  -7,  2,  0 }
-        },
-        //level_add
-        { 0, 17, 8, 4, 3, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        9, //inc_limit
-        5  //max_run
-    },
-    {
-        { //level / run
-            {      EOB    }, {  1,  1,  0 }, {  -1,  1,  0 }, {  2,  1,  0 }, {  -2,  1,  0 }, {   3,  1,  0 },
-            {  -3,  1,  0 }, {  4,  1,  0 }, {  -4,  1,  0 }, {  5,  1,  0 }, {  -5,  1,  0 }, {   6,  1,  0 },
-            {  -6,  1,  0 }, {  7,  1,  0 }, {  -7,  1,  0 }, {  1,  2,  0 }, {  -1,  2,  0 }, {   8,  1,  0 },
-            {  -8,  1,  0 }, {  9,  1,  0 }, {  -9,  1,  0 }, { 10,  1,  0 }, { -10,  1,  0 }, {  11,  1,  0 },
-            { -11,  1,  0 }, { 12,  1,  0 }, { -12,  1,  0 }, {  2,  2,  0 }, {  -2,  2,  0 }, {  13,  1,  0 },
-            { -13,  1,  0 }, {  1,  3,  0 }, {  -1,  3,  0 }, { 14,  1,  0 }, { -14,  1,  0 }, {  15,  1,  0 },
-            { -15,  1,  0 }, {  3,  2,  0 }, {  -3,  2,  0 }, { 16,  1,  0 }, { -16,  1,  0 }, {  17,  1,  0 },
-            { -17,  1,  0 }, { 18,  1,  0 }, { -18,  1,  0 }, {  4,  2,  0 }, {  -4,  2,  0 }, {  19,  1,  0 },
-            { -19,  1,  0 }, { 20,  1,  0 }, { -20,  1,  0 }, {  2,  3,  0 }, {  -2,  3,  0 }, {   1,  4,  0 },
-            {  -1,  4,  0 }, {  5,  2,  0 }, {  -5,  2,  0 }, { 21,  1,  0 }, { -21,  1,  0 }
-        },
-        //level_add
-        { 0, 22, 6, 3, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        2, //golomb_order
-        INT_MAX, //inc_limit
-        4 //max_run
-    }
-};
-
-static const struct dec_2dvlc chroma_dec[5] = {
-    {
-        { //level / run
-            {  1,  1,  1 }, { -1,  1,  1 }, {  1,  2,  1 }, { -1,  2,  1 }, {  1,  3,  1 }, { -1,  3,  1 },
-            {  1,  4,  1 }, { -1,  4,  1 }, {  1,  5,  1 }, { -1,  5,  1 }, {  1,  6,  1 }, { -1,  6,  1 },
-            {  1,  7,  1 }, { -1,  7,  1 }, {  2,  1,  2 }, { -2,  1,  2 }, {  1,  8,  1 }, { -1,  8,  1 },
-            {  1,  9,  1 }, { -1,  9,  1 }, {  1, 10,  1 }, { -1, 10,  1 }, {  1, 11,  1 }, { -1, 11,  1 },
-            {  1, 12,  1 }, { -1, 12,  1 }, {  1, 13,  1 }, { -1, 13,  1 }, {  1, 14,  1 }, { -1, 14,  1 },
-            {  1, 15,  1 }, { -1, 15,  1 }, {  3,  1,  3 }, { -3,  1,  3 }, {  1, 16,  1 }, { -1, 16,  1 },
-            {  1, 17,  1 }, { -1, 17,  1 }, {  1, 18,  1 }, { -1, 18,  1 }, {  1, 19,  1 }, { -1, 19,  1 },
-            {  1, 20,  1 }, { -1, 20,  1 }, {  1, 21,  1 }, { -1, 21,  1 }, {  1, 22,  1 }, { -1, 22,  1 },
-            {  2,  2,  2 }, { -2,  2,  2 }, {  1, 23,  1 }, { -1, 23,  1 }, {  1, 24,  1 }, { -1, 24,  1 },
-            {  1, 25,  1 }, { -1, 25,  1 }, {  4,  1,  3 }, { -4,  1,  3 }, {   EOB    }
-        },
-        //level_add
-        { 0, 5, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 },
-        2, //golomb_order
-        0, //inc_limit
-        25 //max_run
-    },
-    {
-        { //level / run
-            {     EOB    }, {  1,  1,  0 }, { -1,  1,  0 }, {  1,  2,  0 }, { -1,  2,  0 }, {  2,  1,  1 },
-            { -2,  1,  1 }, {  1,  3,  0 }, { -1,  3,  0 }, {  1,  4,  0 }, { -1,  4,  0 }, {  1,  5,  0 },
-            { -1,  5,  0 }, {  1,  6,  0 }, { -1,  6,  0 }, {  3,  1,  2 }, { -3,  1,  2 }, {  1,  7,  0 },
-            { -1,  7,  0 }, {  1,  8,  0 }, { -1,  8,  0 }, {  2,  2,  1 }, { -2,  2,  1 }, {  1,  9,  0 },
-            { -1,  9,  0 }, {  1, 10,  0 }, { -1, 10,  0 }, {  1, 11,  0 }, { -1, 11,  0 }, {  4,  1,  2 },
-            { -4,  1,  2 }, {  1, 12,  0 }, { -1, 12,  0 }, {  1, 13,  0 }, { -1, 13,  0 }, {  1, 14,  0 },
-            { -1, 14,  0 }, {  2,  3,  1 }, { -2,  3,  1 }, {  1, 15,  0 }, { -1, 15,  0 }, {  2,  4,  1 },
-            { -2,  4,  1 }, {  5,  1,  3 }, { -5,  1,  3 }, {  3,  2,  2 }, { -3,  2,  2 }, {  1, 16,  0 },
-            { -1, 16,  0 }, {  1, 17,  0 }, { -1, 17,  0 }, {  1, 18,  0 }, { -1, 18,  0 }, {  2,  5,  1 },
-            { -2,  5,  1 }, {  1, 19,  0 }, { -1, 19,  0 }, {  1, 20,  0 }, { -1, 20,  0 }
-        },
-        //level_add
-        { 0, 6, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1 },
-        0, //golomb_order
-        1, //inc_limit
-        20 //max_run
-    },
-    {
-        { //level / run
-            {  1,  1,  0 }, { -1,  1,  0 }, {     EOB    }, {  2,  1,  0 }, { -2,  1,  0 }, {  1,  2,  0 },
-            { -1,  2,  0 }, {  3,  1,  1 }, { -3,  1,  1 }, {  1,  3,  0 }, { -1,  3,  0 }, {  4,  1,  1 },
-            { -4,  1,  1 }, {  2,  2,  0 }, { -2,  2,  0 }, {  1,  4,  0 }, { -1,  4,  0 }, {  5,  1,  2 },
-            { -5,  1,  2 }, {  1,  5,  0 }, { -1,  5,  0 }, {  3,  2,  1 }, { -3,  2,  1 }, {  2,  3,  0 },
-            { -2,  3,  0 }, {  1,  6,  0 }, { -1,  6,  0 }, {  6,  1,  2 }, { -6,  1,  2 }, {  1,  7,  0 },
-            { -1,  7,  0 }, {  2,  4,  0 }, { -2,  4,  0 }, {  7,  1,  2 }, { -7,  1,  2 }, {  1,  8,  0 },
-            { -1,  8,  0 }, {  4,  2,  1 }, { -4,  2,  1 }, {  1,  9,  0 }, { -1,  9,  0 }, {  3,  3,  1 },
-            { -3,  3,  1 }, {  2,  5,  0 }, { -2,  5,  0 }, {  2,  6,  0 }, { -2,  6,  0 }, {  8,  1,  2 },
-            { -8,  1,  2 }, {  1, 10,  0 }, { -1, 10,  0 }, {  1, 11,  0 }, { -1, 11,  0 }, {  9,  1,  2 },
-            { -9,  1,  2 }, {  5,  2,  2 }, { -5,  2,  2 }, {  3,  4,  1 }, { -3,  4,  1 },
-        },
-        //level_add
-        { 0,10, 6, 4, 4, 3, 3, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        1, //golomb_order
-        2, //inc_limit
-        11 //max_run
-    },
-    {
-        { //level / run
-            {     EOB    }, {  1,  1,  0 }, { -1,  1,  0 }, {  2,  1,  0 }, { -2,  1,  0 }, {  3,  1,  0 },
-            { -3,  1,  0 }, {  4,  1,  0 }, { -4,  1,  0 }, {  1,  2,  0 }, { -1,  2,  0 }, {  5,  1,  1 },
-            { -5,  1,  1 }, {  2,  2,  0 }, { -2,  2,  0 }, {  6,  1,  1 }, { -6,  1,  1 }, {  1,  3,  0 },
-            { -1,  3,  0 }, {  7,  1,  1 }, { -7,  1,  1 }, {  3,  2,  0 }, { -3,  2,  0 }, {  8,  1,  1 },
-            { -8,  1,  1 }, {  1,  4,  0 }, { -1,  4,  0 }, {  2,  3,  0 }, { -2,  3,  0 }, {  9,  1,  1 },
-            { -9,  1,  1 }, {  4,  2,  0 }, { -4,  2,  0 }, {  1,  5,  0 }, { -1,  5,  0 }, { 10,  1,  1 },
-            {-10,  1,  1 }, {  3,  3,  0 }, { -3,  3,  0 }, {  5,  2,  1 }, { -5,  2,  1 }, {  2,  4,  0 },
-            { -2,  4,  0 }, { 11,  1,  1 }, {-11,  1,  1 }, {  1,  6,  0 }, { -1,  6,  0 }, { 12,  1,  1 },
-            {-12,  1,  1 }, {  1,  7,  0 }, { -1,  7,  0 }, {  6,  2,  1 }, { -6,  2,  1 }, { 13,  1,  1 },
-            {-13,  1,  1 }, {  2,  5,  0 }, { -2,  5,  0 }, {  1,  8,  0 }, { -1,  8,  0 },
-        },
-        //level_add
-        { 0, 14, 7, 4, 3, 3, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        1, //golomb_order
-        4, //inc_limit
-        8  //max_run
-    },
-    {
-        { //level / run
-            {      EOB    }, {  1,  1,  0 }, {  -1,  1,  0 }, {  2,  1,  0 }, {  -2,  1,  0 }, {  3,  1,  0 },
-            {  -3,  1,  0 }, {  4,  1,  0 }, {  -4,  1,  0 }, {  5,  1,  0 }, {  -5,  1,  0 }, {  6,  1,  0 },
-            {  -6,  1,  0 }, {  7,  1,  0 }, {  -7,  1,  0 }, {  8,  1,  0 }, {  -8,  1,  0 }, {  1,  2,  0 },
-            {  -1,  2,  0 }, {  9,  1,  0 }, {  -9,  1,  0 }, { 10,  1,  0 }, { -10,  1,  0 }, { 11,  1,  0 },
-            { -11,  1,  0 }, {  2,  2,  0 }, {  -2,  2,  0 }, { 12,  1,  0 }, { -12,  1,  0 }, { 13,  1,  0 },
-            { -13,  1,  0 }, {  3,  2,  0 }, {  -3,  2,  0 }, { 14,  1,  0 }, { -14,  1,  0 }, {  1,  3,  0 },
-            {  -1,  3,  0 }, { 15,  1,  0 }, { -15,  1,  0 }, {  4,  2,  0 }, {  -4,  2,  0 }, { 16,  1,  0 },
-            { -16,  1,  0 }, { 17,  1,  0 }, { -17,  1,  0 }, {  5,  2,  0 }, {  -5,  2,  0 }, {  1,  4,  0 },
-            {  -1,  4,  0 }, {  2,  3,  0 }, {  -2,  3,  0 }, { 18,  1,  0 }, { -18,  1,  0 }, {  6,  2,  0 },
-            {  -6,  2,  0 }, { 19,  1,  0 }, { -19,  1,  0 }, {  1,  5,  0 }, {  -1,  5,  0 },
-        },
-        //level_add
-        { 0, 20, 7, 3, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
-        0, //golomb_order
-        INT_MAX, //inc_limit
-        5, //max_run
-    }
-};
-
-#undef EOB
-
-/*****************************************************************************
- *
- * motion vector prediction
- *
- ****************************************************************************/
-
-static inline void store_mvs(AVSContext *h)
-{
-    h->col_mv[h->mbidx * 4 + 0] = h->mv[MV_FWD_X0];
-    h->col_mv[h->mbidx * 4 + 1] = h->mv[MV_FWD_X1];
-    h->col_mv[h->mbidx * 4 + 2] = h->mv[MV_FWD_X2];
-    h->col_mv[h->mbidx * 4 + 3] = h->mv[MV_FWD_X3];
-}
-
-static inline void mv_pred_direct(AVSContext *h, cavs_vector *pmv_fw,
-                                  cavs_vector *col_mv)
-{
-    cavs_vector *pmv_bw = pmv_fw + MV_BWD_OFFS;
-    int den = h->direct_den[col_mv->ref];
-    int m = col_mv->x >> 31;
-
-    pmv_fw->dist = h->dist[1];
-    pmv_bw->dist = h->dist[0];
-    pmv_fw->ref = 1;
-    pmv_bw->ref = 0;
-    /* scale the co-located motion vector according to its temporal span */
-    pmv_fw->x =     (((den + (den * col_mv->x * pmv_fw->dist ^ m) - m - 1) >> 14) ^ m) - m;
-    pmv_bw->x = m - (((den + (den * col_mv->x * pmv_bw->dist ^ m) - m - 1) >> 14) ^ m);
-    m = col_mv->y >> 31;
-    pmv_fw->y =     (((den + (den * col_mv->y * pmv_fw->dist ^ m) - m - 1) >> 14) ^ m) - m;
-    pmv_bw->y = m - (((den + (den * col_mv->y * pmv_bw->dist ^ m) - m - 1) >> 14) ^ m);
-}
-
-static inline void mv_pred_sym(AVSContext *h, cavs_vector *src,
-                               enum cavs_block size)
-{
-    cavs_vector *dst = src + MV_BWD_OFFS;
-
-    /* backward mv is the scaled and negated forward mv */
-    dst->x = -((src->x * h->sym_factor + 256) >> 9);
-    dst->y = -((src->y * h->sym_factor + 256) >> 9);
-    dst->ref = 0;
-    dst->dist = h->dist[0];
-    set_mvs(dst, size);
-}
-
-/*****************************************************************************
- *
- * residual data decoding
- *
- ****************************************************************************/
-
-/** kth-order exponential golomb code */
-static inline int get_ue_code(GetBitContext *gb, int order)
-{
-    if (order) {
-        int ret = get_ue_golomb(gb) << order;
-        return ret + get_bits(gb, order);
-    }
-    return get_ue_golomb(gb);
-}
-
-static inline int dequant(AVSContext *h, int16_t *level_buf, uint8_t *run_buf,
-                          int16_t *dst, int mul, int shift, int coeff_num)
-{
-    int round = 1 << (shift - 1);
-    int pos = -1;
-    const uint8_t *scantab = h->scantable.permutated;
-
-    /* inverse scan and dequantization */
-    while (--coeff_num >= 0) {
-        pos += run_buf[coeff_num];
-        if (pos > 63) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "position out of block bounds at pic %d MB(%d,%d)\n",
-                   h->cur.poc, h->mbx, h->mby);
-            return AVERROR_INVALIDDATA;
-        }
-        dst[scantab[pos]] = (level_buf[coeff_num] * mul + round) >> shift;
-    }
-    return 0;
-}
-
-/**
- * decode coefficients from one 8x8 block, dequantize, inverse transform
- *  and add them to sample block
- * @param r pointer to 2D VLC table
- * @param esc_golomb_order escape codes are k-golomb with this order k
- * @param qp quantizer
- * @param dst location of sample block
- * @param stride line stride in frame buffer
- */
-static int decode_residual_block(AVSContext *h, GetBitContext *gb,
-                                 const struct dec_2dvlc *r, int esc_golomb_order,
-                                 int qp, uint8_t *dst, int stride)
-{
-    int i, level_code, esc_code, level, run, mask, ret;
-    int16_t level_buf[65];
-    uint8_t run_buf[65];
-    int16_t *block = h->block;
-
-    for (i = 0;i < 65; i++) {
-        level_code = get_ue_code(gb, r->golomb_order);
-        if (level_code >= ESCAPE_CODE) {
-            run      = ((level_code - ESCAPE_CODE) >> 1) + 1;
-            esc_code = get_ue_code(gb, esc_golomb_order);
-            level    = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
-            while (level > r->inc_limit)
-                r++;
-            mask  = -(level_code & 1);
-            level = (level ^ mask) - mask;
-        } else if (level_code >= 0) {
-            level = r->rltab[level_code][0];
-            if (!level) //end of block signal
-                break;
-            run = r->rltab[level_code][1];
-            r  += r->rltab[level_code][2];
-        } else {
-            break;
-        }
-        level_buf[i] = level;
-        run_buf[i]   = run;
-    }
-    if ((ret = dequant(h, level_buf, run_buf, block, dequant_mul[qp],
-                      dequant_shift[qp], i)) < 0)
-        return ret;
-    h->cdsp.cavs_idct8_add(dst, block, stride);
-    h->dsp.clear_block(block);
-    return 0;
-}
-
-
-static inline void decode_residual_chroma(AVSContext *h)
-{
-    if (h->cbp & (1 << 4))
-        decode_residual_block(h, &h->gb, chroma_dec, 0,
-                              cavs_chroma_qp[h->qp], h->cu, h->c_stride);
-    if (h->cbp & (1 << 5))
-        decode_residual_block(h, &h->gb, chroma_dec, 0,
-                              cavs_chroma_qp[h->qp], h->cv, h->c_stride);
-}
-
-static inline int decode_residual_inter(AVSContext *h)
-{
-    int block;
-
-    /* get coded block pattern */
-    int cbp = get_ue_golomb(&h->gb);
-    if (cbp > 63 || cbp < 0) {
-        av_log(h->avctx, AV_LOG_ERROR, "illegal inter cbp %d\n", cbp);
-        return AVERROR_INVALIDDATA;
-    }
-    h->cbp = cbp_tab[cbp][1];
-
-    /* get quantizer */
-    if (h->cbp && !h->qp_fixed)
-        h->qp = (h->qp + get_se_golomb(&h->gb)) & 63;
-    for (block = 0; block < 4; block++)
-        if (h->cbp & (1 << block))
-            decode_residual_block(h, &h->gb, inter_dec, 0, h->qp,
-                                  h->cy + h->luma_scan[block], h->l_stride);
-    decode_residual_chroma(h);
-
-    return 0;
-}
-
-/*****************************************************************************
- *
- * macroblock level
- *
- ****************************************************************************/
-
-static inline void set_mv_intra(AVSContext *h)
-{
-    h->mv[MV_FWD_X0] = ff_cavs_intra_mv;
-    set_mvs(&h->mv[MV_FWD_X0], BLK_16X16);
-    h->mv[MV_BWD_X0] = ff_cavs_intra_mv;
-    set_mvs(&h->mv[MV_BWD_X0], BLK_16X16);
-    if (h->cur.f->pict_type != AV_PICTURE_TYPE_B)
-        h->col_type_base[h->mbidx] = I_8X8;
-}
-
-static int decode_mb_i(AVSContext *h, int cbp_code)
-{
-    GetBitContext *gb = &h->gb;
-    unsigned pred_mode_uv;
-    int block;
-    uint8_t top[18];
-    uint8_t *left = NULL;
-    uint8_t *d;
-
-    ff_cavs_init_mb(h);
-
-    /* get intra prediction modes from stream */
-    for (block = 0; block < 4; block++) {
-        int nA, nB, predpred;
-        int pos = scan3x3[block];
-
-        nA = h->pred_mode_Y[pos - 1];
-        nB = h->pred_mode_Y[pos - 3];
-        predpred = FFMIN(nA, nB);
-        if (predpred == NOT_AVAIL) // if either is not available
-            predpred = INTRA_L_LP;
-        if (!get_bits1(gb)) {
-            int rem_mode = get_bits(gb, 2);
-            predpred     = rem_mode + (rem_mode >= predpred);
-        }
-        h->pred_mode_Y[pos] = predpred;
-    }
-    pred_mode_uv = get_ue_golomb(gb);
-    if (pred_mode_uv > 6) {
-        av_log(h->avctx, AV_LOG_ERROR, "illegal intra chroma pred mode\n");
-        return AVERROR_INVALIDDATA;
-    }
-    ff_cavs_modify_mb_i(h, &pred_mode_uv);
-
-    /* get coded block pattern */
-    if (h->cur.f->pict_type == AV_PICTURE_TYPE_I)
-        cbp_code = get_ue_golomb(gb);
-    if (cbp_code > 63 || cbp_code < 0) {
-        av_log(h->avctx, AV_LOG_ERROR, "illegal intra cbp\n");
-        return AVERROR_INVALIDDATA;
-    }
-    h->cbp = cbp_tab[cbp_code][0];
-    if (h->cbp && !h->qp_fixed)
-        h->qp = (h->qp + get_se_golomb(gb)) & 63; //qp_delta
-
-    /* luma intra prediction interleaved with residual decode/transform/add */
-    for (block = 0; block < 4; block++) {
-        d = h->cy + h->luma_scan[block];
-        ff_cavs_load_intra_pred_luma(h, top, &left, block);
-        h->intra_pred_l[h->pred_mode_Y[scan3x3[block]]]
-            (d, top, left, h->l_stride);
-        if (h->cbp & (1<<block))
-            decode_residual_block(h, gb, intra_dec, 1, h->qp, d, h->l_stride);
-    }
-
-    /* chroma intra prediction */
-    ff_cavs_load_intra_pred_chroma(h);
-    h->intra_pred_c[pred_mode_uv](h->cu, &h->top_border_u[h->mbx * 10],
-                                  h->left_border_u, h->c_stride);
-    h->intra_pred_c[pred_mode_uv](h->cv, &h->top_border_v[h->mbx * 10],
-                                  h->left_border_v, h->c_stride);
-
-    decode_residual_chroma(h);
-    ff_cavs_filter(h, I_8X8);
-    set_mv_intra(h);
-    return 0;
-}
-
-static inline void set_intra_mode_default(AVSContext *h)
-{
-    if (h->stream_revision > 0) {
-        h->pred_mode_Y[3] =  h->pred_mode_Y[6] = NOT_AVAIL;
-        h->top_pred_Y[h->mbx * 2 + 0] = h->top_pred_Y[h->mbx * 2 + 1] = NOT_AVAIL;
-    } else {
-        h->pred_mode_Y[3] =  h->pred_mode_Y[6] = INTRA_L_LP;
-        h->top_pred_Y[h->mbx * 2 + 0] = h->top_pred_Y[h->mbx * 2 + 1] = INTRA_L_LP;
-    }
-}
-
-static void decode_mb_p(AVSContext *h, enum cavs_mb mb_type)
-{
-    GetBitContext *gb = &h->gb;
-    int ref[4];
-
-    ff_cavs_init_mb(h);
-    switch (mb_type) {
-    case P_SKIP:
-        ff_cavs_mv(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_PSKIP,  BLK_16X16, 0);
-        break;
-    case P_16X16:
-        ref[0] = h->ref_flag ? 0 : get_bits1(gb);
-        ff_cavs_mv(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, ref[0]);
-        break;
-    case P_16X8:
-        ref[0] = h->ref_flag ? 0 : get_bits1(gb);
-        ref[2] = h->ref_flag ? 0 : get_bits1(gb);
-        ff_cavs_mv(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_TOP,    BLK_16X8, ref[0]);
-        ff_cavs_mv(h, MV_FWD_X2, MV_FWD_A1, MV_PRED_LEFT,   BLK_16X8, ref[2]);
-        break;
-    case P_8X16:
-        ref[0] = h->ref_flag ? 0 : get_bits1(gb);
-        ref[1] = h->ref_flag ? 0 : get_bits1(gb);
-        ff_cavs_mv(h, MV_FWD_X0, MV_FWD_B3, MV_PRED_LEFT,     BLK_8X16, ref[0]);
-        ff_cavs_mv(h, MV_FWD_X1, MV_FWD_C2, MV_PRED_TOPRIGHT, BLK_8X16, ref[1]);
-        break;
-    case P_8X8:
-        ref[0] = h->ref_flag ? 0 : get_bits1(gb);
-        ref[1] = h->ref_flag ? 0 : get_bits1(gb);
-        ref[2] = h->ref_flag ? 0 : get_bits1(gb);
-        ref[3] = h->ref_flag ? 0 : get_bits1(gb);
-        ff_cavs_mv(h, MV_FWD_X0, MV_FWD_B3, MV_PRED_MEDIAN,   BLK_8X8, ref[0]);
-        ff_cavs_mv(h, MV_FWD_X1, MV_FWD_C2, MV_PRED_MEDIAN,   BLK_8X8, ref[1]);
-        ff_cavs_mv(h, MV_FWD_X2, MV_FWD_X1, MV_PRED_MEDIAN,   BLK_8X8, ref[2]);
-        ff_cavs_mv(h, MV_FWD_X3, MV_FWD_X0, MV_PRED_MEDIAN,   BLK_8X8, ref[3]);
-    }
-    ff_cavs_inter(h, mb_type);
-    set_intra_mode_default(h);
-    store_mvs(h);
-    if (mb_type != P_SKIP)
-        decode_residual_inter(h);
-    ff_cavs_filter(h, mb_type);
-    h->col_type_base[h->mbidx] = mb_type;
-}
-
-static void decode_mb_b(AVSContext *h, enum cavs_mb mb_type)
-{
-    int block;
-    enum cavs_sub_mb sub_type[4];
-    int flags;
-
-    ff_cavs_init_mb(h);
-
-    /* reset all MVs */
-    h->mv[MV_FWD_X0] = ff_cavs_dir_mv;
-    set_mvs(&h->mv[MV_FWD_X0], BLK_16X16);
-    h->mv[MV_BWD_X0] = ff_cavs_dir_mv;
-    set_mvs(&h->mv[MV_BWD_X0], BLK_16X16);
-    switch (mb_type) {
-    case B_SKIP:
-    case B_DIRECT:
-        if (!h->col_type_base[h->mbidx]) {
-            /* intra MB at co-location, do in-plane prediction */
-            ff_cavs_mv(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_BSKIP, BLK_16X16, 1);
-            ff_cavs_mv(h, MV_BWD_X0, MV_BWD_C2, MV_PRED_BSKIP, BLK_16X16, 0);
-        } else
-            /* direct prediction from co-located P MB, block-wise */
-            for (block = 0; block < 4; block++)
-                mv_pred_direct(h, &h->mv[mv_scan[block]],
-                               &h->col_mv[h->mbidx * 4 + block]);
-        break;
-    case B_FWD_16X16:
-        ff_cavs_mv(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, 1);
-        break;
-    case B_SYM_16X16:
-        ff_cavs_mv(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, 1);
-        mv_pred_sym(h, &h->mv[MV_FWD_X0], BLK_16X16);
-        break;
-    case B_BWD_16X16:
-        ff_cavs_mv(h, MV_BWD_X0, MV_BWD_C2, MV_PRED_MEDIAN, BLK_16X16, 0);
-        break;
-    case B_8X8:
-        for (block = 0; block < 4; block++)
-            sub_type[block] = get_bits(&h->gb, 2);
-        for (block = 0; block < 4; block++) {
-            switch (sub_type[block]) {
-            case B_SUB_DIRECT:
-                if (!h->col_type_base[h->mbidx]) {
-                    /* intra MB at co-location, do in-plane prediction */
-                    ff_cavs_mv(h, mv_scan[block], mv_scan[block] - 3,
-                               MV_PRED_BSKIP, BLK_8X8, 1);
-                    ff_cavs_mv(h, mv_scan[block] + MV_BWD_OFFS,
-                               mv_scan[block] - 3 + MV_BWD_OFFS,
-                               MV_PRED_BSKIP, BLK_8X8, 0);
-                } else
-                    mv_pred_direct(h, &h->mv[mv_scan[block]],
-                                   &h->col_mv[h->mbidx * 4 + block]);
-                break;
-            case B_SUB_FWD:
-                ff_cavs_mv(h, mv_scan[block], mv_scan[block] - 3,
-                           MV_PRED_MEDIAN, BLK_8X8, 1);
-                break;
-            case B_SUB_SYM:
-                ff_cavs_mv(h, mv_scan[block], mv_scan[block] - 3,
-                           MV_PRED_MEDIAN, BLK_8X8, 1);
-                mv_pred_sym(h, &h->mv[mv_scan[block]], BLK_8X8);
-                break;
-            }
-        }
-        for (block = 0; block < 4; block++) {
-            if (sub_type[block] == B_SUB_BWD)
-                ff_cavs_mv(h, mv_scan[block] + MV_BWD_OFFS,
-                           mv_scan[block] + MV_BWD_OFFS - 3,
-                           MV_PRED_MEDIAN, BLK_8X8, 0);
-        }
-        break;
-    default:
-        assert((mb_type > B_SYM_16X16) && (mb_type < B_8X8));
-        flags = ff_cavs_partition_flags[mb_type];
-        if (mb_type & 1) { /* 16x8 macroblock types */
-            if (flags & FWD0)
-                ff_cavs_mv(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_TOP,  BLK_16X8, 1);
-            if (flags & SYM0)
-                mv_pred_sym(h, &h->mv[MV_FWD_X0], BLK_16X8);
-            if (flags & FWD1)
-                ff_cavs_mv(h, MV_FWD_X2, MV_FWD_A1, MV_PRED_LEFT, BLK_16X8, 1);
-            if (flags & SYM1)
-                mv_pred_sym(h, &h->mv[MV_FWD_X2], BLK_16X8);
-            if (flags & BWD0)
-                ff_cavs_mv(h, MV_BWD_X0, MV_BWD_C2, MV_PRED_TOP,  BLK_16X8, 0);
-            if (flags & BWD1)
-                ff_cavs_mv(h, MV_BWD_X2, MV_BWD_A1, MV_PRED_LEFT, BLK_16X8, 0);
-        } else {          /* 8x16 macroblock types */
-            if (flags & FWD0)
-                ff_cavs_mv(h, MV_FWD_X0, MV_FWD_B3, MV_PRED_LEFT, BLK_8X16, 1);
-            if (flags & SYM0)
-                mv_pred_sym(h, &h->mv[MV_FWD_X0], BLK_8X16);
-            if (flags & FWD1)
-                ff_cavs_mv(h, MV_FWD_X1, MV_FWD_C2, MV_PRED_TOPRIGHT, BLK_8X16, 1);
-            if (flags & SYM1)
-                mv_pred_sym(h, &h->mv[MV_FWD_X1], BLK_8X16);
-            if (flags & BWD0)
-                ff_cavs_mv(h, MV_BWD_X0, MV_BWD_B3, MV_PRED_LEFT, BLK_8X16, 0);
-            if (flags & BWD1)
-                ff_cavs_mv(h, MV_BWD_X1, MV_BWD_C2, MV_PRED_TOPRIGHT, BLK_8X16, 0);
-        }
-    }
-    ff_cavs_inter(h, mb_type);
-    set_intra_mode_default(h);
-    if (mb_type != B_SKIP)
-        decode_residual_inter(h);
-    ff_cavs_filter(h, mb_type);
-}
-
-/*****************************************************************************
- *
- * slice level
- *
- ****************************************************************************/
-
-static inline int decode_slice_header(AVSContext *h, GetBitContext *gb)
-{
-    if (h->stc > 0xAF)
-        av_log(h->avctx, AV_LOG_ERROR, "unexpected start code 0x%02x\n", h->stc);
-    h->mby   = h->stc;
-    h->mbidx = h->mby * h->mb_width;
-
-    /* mark top macroblocks as unavailable */
-    h->flags &= ~(B_AVAIL | C_AVAIL);
-    if ((h->mby == 0) && (!h->qp_fixed)) {
-        h->qp_fixed = get_bits1(gb);
-        h->qp       = get_bits(gb, 6);
-    }
-    /* inter frame or second slice can have weighting params */
-    if ((h->cur.f->pict_type != AV_PICTURE_TYPE_I) ||
-        (!h->pic_structure && h->mby >= h->mb_width / 2))
-        if (get_bits1(gb)) { //slice_weighting_flag
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "weighted prediction not yet supported\n");
-        }
-    return 0;
-}
-
-static inline int check_for_slice(AVSContext *h)
-{
-    GetBitContext *gb = &h->gb;
-    int align;
-
-    if (h->mbx)
-        return 0;
-    align = (-get_bits_count(gb)) & 7;
-    /* check for stuffing byte */
-    if (!align && (show_bits(gb, 8) == 0x80))
-        align = 8;
-    if ((show_bits_long(gb, 24 + align) & 0xFFFFFF) == 0x000001) {
-        skip_bits_long(gb, 24 + align);
-        h->stc = get_bits(gb, 8);
-        if (h->stc >= h->mb_height)
-            return 0;
-        decode_slice_header(h, gb);
-        return 1;
-    }
-    return 0;
-}
-
-/*****************************************************************************
- *
- * frame level
- *
- ****************************************************************************/
-
-static int decode_pic(AVSContext *h)
-{
-    int ret;
-    int skip_count    = -1;
-    enum cavs_mb mb_type;
-
-    if (!h->top_qp) {
-        av_log(h->avctx, AV_LOG_ERROR, "No sequence header decoded yet\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    av_frame_unref(h->cur.f);
-
-    skip_bits(&h->gb, 16);//bbv_dwlay
-    if (h->stc == PIC_PB_START_CODE) {
-        h->cur.f->pict_type = get_bits(&h->gb, 2) + AV_PICTURE_TYPE_I;
-        if (h->cur.f->pict_type > AV_PICTURE_TYPE_B) {
-            av_log(h->avctx, AV_LOG_ERROR, "illegal picture type\n");
-            return AVERROR_INVALIDDATA;
-        }
-        /* make sure we have the reference frames we need */
-        if (!h->DPB[0].f->data[0] ||
-           (!h->DPB[1].f->data[0] && h->cur.f->pict_type == AV_PICTURE_TYPE_B))
-            return AVERROR_INVALIDDATA;
-    } else {
-        h->cur.f->pict_type = AV_PICTURE_TYPE_I;
-        if (get_bits1(&h->gb))
-            skip_bits(&h->gb, 24);//time_code
-        /* old sample clips were all progressive and no low_delay,
-           bump stream revision if detected otherwise */
-        if (h->low_delay || !(show_bits(&h->gb, 9) & 1))
-            h->stream_revision = 1;
-        /* similarly test top_field_first and repeat_first_field */
-        else if (show_bits(&h->gb, 11) & 3)
-            h->stream_revision = 1;
-        if (h->stream_revision > 0)
-            skip_bits(&h->gb, 1); //marker_bit
-    }
-
-    ret = ff_get_buffer(h->avctx, h->cur.f, h->cur.f->pict_type == AV_PICTURE_TYPE_B ?
-                        0 : AV_GET_BUFFER_FLAG_REF);
-    if (ret < 0)
-        return ret;
-
-    if (!h->edge_emu_buffer) {
-        int alloc_size = FFALIGN(FFABS(h->cur.f->linesize[0]) + 32, 32);
-        h->edge_emu_buffer = av_mallocz(alloc_size * 2 * 24);
-        if (!h->edge_emu_buffer)
-            return AVERROR(ENOMEM);
-    }
-
-    ff_cavs_init_pic(h);
-    h->cur.poc = get_bits(&h->gb, 8) * 2;
-
-    /* get temporal distances and MV scaling factors */
-    if (h->cur.f->pict_type != AV_PICTURE_TYPE_B) {
-        h->dist[0] = (h->cur.poc - h->DPB[0].poc  + 512) % 512;
-    } else {
-        h->dist[0] = (h->DPB[0].poc  - h->cur.poc + 512) % 512;
-    }
-    h->dist[1] = (h->cur.poc - h->DPB[1].poc  + 512) % 512;
-    h->scale_den[0] = h->dist[0] ? 512/h->dist[0] : 0;
-    h->scale_den[1] = h->dist[1] ? 512/h->dist[1] : 0;
-    if (h->cur.f->pict_type == AV_PICTURE_TYPE_B) {
-        h->sym_factor = h->dist[0] * h->scale_den[1];
-    } else {
-        h->direct_den[0] = h->dist[0] ? 16384 / h->dist[0] : 0;
-        h->direct_den[1] = h->dist[1] ? 16384 / h->dist[1] : 0;
-    }
-
-    if (h->low_delay)
-        get_ue_golomb(&h->gb); //bbv_check_times
-    h->progressive   = get_bits1(&h->gb);
-    h->pic_structure = 1;
-    if (!h->progressive)
-        h->pic_structure = get_bits1(&h->gb);
-    if (!h->pic_structure && h->stc == PIC_PB_START_CODE)
-        skip_bits1(&h->gb);     //advanced_pred_mode_disable
-    skip_bits1(&h->gb);        //top_field_first
-    skip_bits1(&h->gb);        //repeat_first_field
-    h->qp_fixed = get_bits1(&h->gb);
-    h->qp       = get_bits(&h->gb, 6);
-    if (h->cur.f->pict_type == AV_PICTURE_TYPE_I) {
-        if (!h->progressive && !h->pic_structure)
-            skip_bits1(&h->gb);//what is this?
-        skip_bits(&h->gb, 4);   //reserved bits
-    } else {
-        if (!(h->cur.f->pict_type == AV_PICTURE_TYPE_B && h->pic_structure == 1))
-            h->ref_flag        = get_bits1(&h->gb);
-        skip_bits(&h->gb, 4);   //reserved bits
-        h->skip_mode_flag      = get_bits1(&h->gb);
-    }
-    h->loop_filter_disable     = get_bits1(&h->gb);
-    if (!h->loop_filter_disable && get_bits1(&h->gb)) {
-        h->alpha_offset        = get_se_golomb(&h->gb);
-        h->beta_offset         = get_se_golomb(&h->gb);
-    } else {
-        h->alpha_offset = h->beta_offset  = 0;
-    }
-    if (h->cur.f->pict_type == AV_PICTURE_TYPE_I) {
-        do {
-            check_for_slice(h);
-            decode_mb_i(h, 0);
-        } while (ff_cavs_next_mb(h));
-    } else if (h->cur.f->pict_type == AV_PICTURE_TYPE_P) {
-        do {
-            if (check_for_slice(h))
-                skip_count = -1;
-            if (h->skip_mode_flag && (skip_count < 0))
-                skip_count = get_ue_golomb(&h->gb);
-            if (h->skip_mode_flag && skip_count--) {
-                decode_mb_p(h, P_SKIP);
-            } else {
-                mb_type = get_ue_golomb(&h->gb) + P_SKIP + h->skip_mode_flag;
-                if (mb_type > P_8X8)
-                    decode_mb_i(h, mb_type - P_8X8 - 1);
-                else
-                    decode_mb_p(h, mb_type);
-            }
-        } while (ff_cavs_next_mb(h));
-    } else { /* AV_PICTURE_TYPE_B */
-        do {
-            if (check_for_slice(h))
-                skip_count = -1;
-            if (h->skip_mode_flag && (skip_count < 0))
-                skip_count = get_ue_golomb(&h->gb);
-            if (h->skip_mode_flag && skip_count--) {
-                decode_mb_b(h, B_SKIP);
-            } else {
-                mb_type = get_ue_golomb(&h->gb) + B_SKIP + h->skip_mode_flag;
-                if (mb_type > B_8X8)
-                    decode_mb_i(h, mb_type - B_8X8 - 1);
-                else
-                    decode_mb_b(h, mb_type);
-            }
-        } while (ff_cavs_next_mb(h));
-    }
-    if (h->cur.f->pict_type != AV_PICTURE_TYPE_B) {
-        av_frame_unref(h->DPB[1].f);
-        FFSWAP(AVSFrame, h->cur, h->DPB[1]);
-        FFSWAP(AVSFrame, h->DPB[0], h->DPB[1]);
-    }
-    return 0;
-}
-
-/*****************************************************************************
- *
- * headers and interface
- *
- ****************************************************************************/
-
-static int decode_seq_header(AVSContext *h)
-{
-    int frame_rate_code;
-    int width, height;
-
-    h->profile = get_bits(&h->gb, 8);
-    h->level   = get_bits(&h->gb, 8);
-    skip_bits1(&h->gb); //progressive sequence
-
-    width  = get_bits(&h->gb, 14);
-    height = get_bits(&h->gb, 14);
-    if ((h->width || h->height) && (h->width != width || h->height != height)) {
-        avpriv_report_missing_feature(h->avctx,
-                                      "Width/height changing in CAVS");
-        return AVERROR_PATCHWELCOME;
-    }
-    h->width  = width;
-    h->height = height;
-
-    skip_bits(&h->gb, 2); //chroma format
-    skip_bits(&h->gb, 3); //sample_precision
-    h->aspect_ratio = get_bits(&h->gb, 4);
-    frame_rate_code = get_bits(&h->gb, 4);
-    skip_bits(&h->gb, 18); //bit_rate_lower
-    skip_bits1(&h->gb);    //marker_bit
-    skip_bits(&h->gb, 12); //bit_rate_upper
-    h->low_delay =  get_bits1(&h->gb);
-    h->mb_width  = (h->width  + 15) >> 4;
-    h->mb_height = (h->height + 15) >> 4;
-    h->avctx->time_base.den = ff_mpeg12_frame_rate_tab[frame_rate_code].num;
-    h->avctx->time_base.num = ff_mpeg12_frame_rate_tab[frame_rate_code].den;
-    h->avctx->width  = h->width;
-    h->avctx->height = h->height;
-    if (!h->top_qp)
-        ff_cavs_init_top_lines(h);
-    return 0;
-}
-
-static void cavs_flush(AVCodecContext * avctx)
-{
-    AVSContext *h = avctx->priv_data;
-    h->got_keyframe = 0;
-}
-
-static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    AVSContext *h      = avctx->priv_data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    uint32_t stc       = -1;
-    int input_size, ret;
-    const uint8_t *buf_end;
-    const uint8_t *buf_ptr;
-
-    if (buf_size == 0) {
-        if (!h->low_delay && h->DPB[0].f->data[0]) {
-            *got_frame = 1;
-            av_frame_move_ref(data, h->DPB[0].f);
-        }
-        return 0;
-    }
-
-    buf_ptr = buf;
-    buf_end = buf + buf_size;
-    for(;;) {
-        buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &stc);
-        if ((stc & 0xFFFFFE00) || buf_ptr == buf_end)
-            return FFMAX(0, buf_ptr - buf);
-        input_size = (buf_end - buf_ptr) * 8;
-        switch (stc) {
-        case CAVS_START_CODE:
-            init_get_bits(&h->gb, buf_ptr, input_size);
-            decode_seq_header(h);
-            break;
-        case PIC_I_START_CODE:
-            if (!h->got_keyframe) {
-                av_frame_unref(h->DPB[0].f);
-                av_frame_unref(h->DPB[1].f);
-                h->got_keyframe = 1;
-            }
-        case PIC_PB_START_CODE:
-            *got_frame = 0;
-            if (!h->got_keyframe)
-                break;
-            init_get_bits(&h->gb, buf_ptr, input_size);
-            h->stc = stc;
-            if (decode_pic(h))
-                break;
-            *got_frame = 1;
-            if (h->cur.f->pict_type != AV_PICTURE_TYPE_B) {
-                if (h->DPB[1].f->data[0]) {
-                    if ((ret = av_frame_ref(data, h->DPB[1].f)) < 0)
-                        return ret;
-                } else {
-                    *got_frame = 0;
-                }
-            } else {
-                av_frame_move_ref(data, h->cur.f);
-            }
-            break;
-        case EXT_START_CODE:
-            //mpeg_decode_extension(avctx, buf_ptr, input_size);
-            break;
-        case USER_START_CODE:
-            //mpeg_decode_user_data(avctx, buf_ptr, input_size);
-            break;
-        default:
-            if (stc <= SLICE_MAX_START_CODE) {
-                init_get_bits(&h->gb, buf_ptr, input_size);
-                decode_slice_header(h, &h->gb);
-            }
-            break;
-        }
-    }
-}
-
-AVCodec ff_cavs_decoder = {
-    .name           = "cavs",
-    .long_name      = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CAVS,
-    .priv_data_size = sizeof(AVSContext),
-    .init           = ff_cavs_init,
-    .close          = ff_cavs_end,
-    .decode         = cavs_decode_frame,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
-    .flush          = cavs_flush,
-};
diff --git a/deps/libav/libavcodec/cavsdsp.c b/deps/libav/libavcodec/cavsdsp.c
deleted file mode 100644
index 2716e33..0000000
--- a/deps/libav/libavcodec/cavsdsp.c
+++ /dev/null
@@ -1,566 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
- *
- * DSP functions
- *
- * Copyright (c) 2006  Stefan Gehrer <stefan.gehrer at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include "dsputil.h"
-#include "cavsdsp.h"
-#include "libavutil/common.h"
-
-/*****************************************************************************
- *
- * in-loop deblocking filter
- *
- ****************************************************************************/
-
-#define P2 p0_p[-3*stride]
-#define P1 p0_p[-2*stride]
-#define P0 p0_p[-1*stride]
-#define Q0 p0_p[ 0*stride]
-#define Q1 p0_p[ 1*stride]
-#define Q2 p0_p[ 2*stride]
-
-static inline void loop_filter_l2(uint8_t *p0_p,int stride,int alpha, int beta) {
-    int p0 = P0;
-    int q0 = Q0;
-
-    if(abs(p0-q0)<alpha && abs(P1-p0)<beta && abs(Q1-q0)<beta) {
-        int s = p0 + q0 + 2;
-        alpha = (alpha>>2) + 2;
-        if(abs(P2-p0) < beta && abs(p0-q0) < alpha) {
-            P0 = (P1 + p0 + s) >> 2;
-            P1 = (2*P1 + s) >> 2;
-        } else
-            P0 = (2*P1 + s) >> 2;
-        if(abs(Q2-q0) < beta && abs(q0-p0) < alpha) {
-            Q0 = (Q1 + q0 + s) >> 2;
-            Q1 = (2*Q1 + s) >> 2;
-        } else
-            Q0 = (2*Q1 + s) >> 2;
-    }
-}
-
-static inline void loop_filter_l1(uint8_t *p0_p, int stride, int alpha, int beta, int tc) {
-    int p0 = P0;
-    int q0 = Q0;
-
-    if(abs(p0-q0)<alpha && abs(P1-p0)<beta && abs(Q1-q0)<beta) {
-        int delta = av_clip(((q0-p0)*3+P1-Q1+4)>>3,-tc, tc);
-        P0 = av_clip_uint8(p0+delta);
-        Q0 = av_clip_uint8(q0-delta);
-        if(abs(P2-p0)<beta) {
-            delta = av_clip(((P0-P1)*3+P2-Q0+4)>>3, -tc, tc);
-            P1 = av_clip_uint8(P1+delta);
-        }
-        if(abs(Q2-q0)<beta) {
-            delta = av_clip(((Q1-Q0)*3+P0-Q2+4)>>3, -tc, tc);
-            Q1 = av_clip_uint8(Q1-delta);
-        }
-    }
-}
-
-static inline void loop_filter_c2(uint8_t *p0_p,int stride,int alpha, int beta) {
-    int p0 = P0;
-    int q0 = Q0;
-
-    if(abs(p0-q0)<alpha && abs(P1-p0)<beta && abs(Q1-q0)<beta) {
-        int s = p0 + q0 + 2;
-        alpha = (alpha>>2) + 2;
-        if(abs(P2-p0) < beta && abs(p0-q0) < alpha) {
-            P0 = (P1 + p0 + s) >> 2;
-        } else
-            P0 = (2*P1 + s) >> 2;
-        if(abs(Q2-q0) < beta && abs(q0-p0) < alpha) {
-            Q0 = (Q1 + q0 + s) >> 2;
-        } else
-            Q0 = (2*Q1 + s) >> 2;
-    }
-}
-
-static inline void loop_filter_c1(uint8_t *p0_p,int stride,int alpha, int beta,
-                                  int tc) {
-    if(abs(P0-Q0)<alpha && abs(P1-P0)<beta && abs(Q1-Q0)<beta) {
-        int delta = av_clip(((Q0-P0)*3+P1-Q1+4)>>3, -tc, tc);
-        P0 = av_clip_uint8(P0+delta);
-        Q0 = av_clip_uint8(Q0-delta);
-    }
-}
-
-#undef P0
-#undef P1
-#undef P2
-#undef Q0
-#undef Q1
-#undef Q2
-
-static void cavs_filter_lv_c(uint8_t *d, int stride, int alpha, int beta, int tc,
-                           int bs1, int bs2) {
-    int i;
-    if(bs1==2)
-        for(i=0;i<16;i++)
-            loop_filter_l2(d + i*stride,1,alpha,beta);
-    else {
-        if(bs1)
-            for(i=0;i<8;i++)
-                loop_filter_l1(d + i*stride,1,alpha,beta,tc);
-        if (bs2)
-            for(i=8;i<16;i++)
-                loop_filter_l1(d + i*stride,1,alpha,beta,tc);
-    }
-}
-
-static void cavs_filter_lh_c(uint8_t *d, int stride, int alpha, int beta, int tc,
-                           int bs1, int bs2) {
-    int i;
-    if(bs1==2)
-        for(i=0;i<16;i++)
-            loop_filter_l2(d + i,stride,alpha,beta);
-    else {
-        if(bs1)
-            for(i=0;i<8;i++)
-                loop_filter_l1(d + i,stride,alpha,beta,tc);
-        if (bs2)
-            for(i=8;i<16;i++)
-                loop_filter_l1(d + i,stride,alpha,beta,tc);
-    }
-}
-
-static void cavs_filter_cv_c(uint8_t *d, int stride, int alpha, int beta, int tc,
-                           int bs1, int bs2) {
-    int i;
-    if(bs1==2)
-        for(i=0;i<8;i++)
-            loop_filter_c2(d + i*stride,1,alpha,beta);
-    else {
-        if(bs1)
-            for(i=0;i<4;i++)
-                loop_filter_c1(d + i*stride,1,alpha,beta,tc);
-        if (bs2)
-            for(i=4;i<8;i++)
-                loop_filter_c1(d + i*stride,1,alpha,beta,tc);
-    }
-}
-
-static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc,
-                           int bs1, int bs2) {
-    int i;
-    if(bs1==2)
-        for(i=0;i<8;i++)
-            loop_filter_c2(d + i,stride,alpha,beta);
-    else {
-        if(bs1)
-            for(i=0;i<4;i++)
-                loop_filter_c1(d + i,stride,alpha,beta,tc);
-        if (bs2)
-            for(i=4;i<8;i++)
-                loop_filter_c1(d + i,stride,alpha,beta,tc);
-    }
-}
-
-/*****************************************************************************
- *
- * inverse transform
- *
- ****************************************************************************/
-
-static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
-    int i;
-    int16_t (*src)[8] = (int16_t(*)[8])block;
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
-    src[0][0] += 8;
-
-    for( i = 0; i < 8; i++ ) {
-        const int a0 =  3*src[i][1] - (src[i][7]<<1);
-        const int a1 =  3*src[i][3] + (src[i][5]<<1);
-        const int a2 =  (src[i][3]<<1) - 3*src[i][5];
-        const int a3 =  (src[i][1]<<1) + 3*src[i][7];
-
-        const int b4 = ((a0 + a1 + a3)<<1) + a1;
-        const int b5 = ((a0 - a1 + a2)<<1) + a0;
-        const int b6 = ((a3 - a2 - a1)<<1) + a3;
-        const int b7 = ((a0 - a2 - a3)<<1) - a2;
-
-        const int a7 = (src[i][2]<<2) - 10*src[i][6];
-        const int a6 = (src[i][6]<<2) + 10*src[i][2];
-        const int a5 = ((src[i][0] - src[i][4]) << 3) + 4;
-        const int a4 = ((src[i][0] + src[i][4]) << 3) + 4;
-
-        const int b0 = a4 + a6;
-        const int b1 = a5 + a7;
-        const int b2 = a5 - a7;
-        const int b3 = a4 - a6;
-
-        src[i][0] = (b0 + b4) >> 3;
-        src[i][1] = (b1 + b5) >> 3;
-        src[i][2] = (b2 + b6) >> 3;
-        src[i][3] = (b3 + b7) >> 3;
-        src[i][4] = (b3 - b7) >> 3;
-        src[i][5] = (b2 - b6) >> 3;
-        src[i][6] = (b1 - b5) >> 3;
-        src[i][7] = (b0 - b4) >> 3;
-    }
-    for( i = 0; i < 8; i++ ) {
-        const int a0 =  3*src[1][i] - (src[7][i]<<1);
-        const int a1 =  3*src[3][i] + (src[5][i]<<1);
-        const int a2 =  (src[3][i]<<1) - 3*src[5][i];
-        const int a3 =  (src[1][i]<<1) + 3*src[7][i];
-
-        const int b4 = ((a0 + a1 + a3)<<1) + a1;
-        const int b5 = ((a0 - a1 + a2)<<1) + a0;
-        const int b6 = ((a3 - a2 - a1)<<1) + a3;
-        const int b7 = ((a0 - a2 - a3)<<1) - a2;
-
-        const int a7 = (src[2][i]<<2) - 10*src[6][i];
-        const int a6 = (src[6][i]<<2) + 10*src[2][i];
-        const int a5 = (src[0][i] - src[4][i]) << 3;
-        const int a4 = (src[0][i] + src[4][i]) << 3;
-
-        const int b0 = a4 + a6;
-        const int b1 = a5 + a7;
-        const int b2 = a5 - a7;
-        const int b3 = a4 - a6;
-
-        dst[i + 0*stride] = cm[ dst[i + 0*stride] + ((b0 + b4) >> 7)];
-        dst[i + 1*stride] = cm[ dst[i + 1*stride] + ((b1 + b5) >> 7)];
-        dst[i + 2*stride] = cm[ dst[i + 2*stride] + ((b2 + b6) >> 7)];
-        dst[i + 3*stride] = cm[ dst[i + 3*stride] + ((b3 + b7) >> 7)];
-        dst[i + 4*stride] = cm[ dst[i + 4*stride] + ((b3 - b7) >> 7)];
-        dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b2 - b6) >> 7)];
-        dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b1 - b5) >> 7)];
-        dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b4) >> 7)];
-    }
-}
-
-/*****************************************************************************
- *
- * motion compensation
- *
- ****************************************************************************/
-
-#define CAVS_SUBPIX(OPNAME, OP, NAME, A, B, C, D, E, F) \
-static void OPNAME ## cavs_filt8_h_ ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    const int h=8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    for(i=0; i<h; i++)\
-    {\
-        OP(dst[0], A*src[-2] + B*src[-1] + C*src[0] + D*src[1] + E*src[2] + F*src[3]);\
-        OP(dst[1], A*src[-1] + B*src[ 0] + C*src[1] + D*src[2] + E*src[3] + F*src[4]);\
-        OP(dst[2], A*src[ 0] + B*src[ 1] + C*src[2] + D*src[3] + E*src[4] + F*src[5]);\
-        OP(dst[3], A*src[ 1] + B*src[ 2] + C*src[3] + D*src[4] + E*src[5] + F*src[6]);\
-        OP(dst[4], A*src[ 2] + B*src[ 3] + C*src[4] + D*src[5] + E*src[6] + F*src[7]);\
-        OP(dst[5], A*src[ 3] + B*src[ 4] + C*src[5] + D*src[6] + E*src[7] + F*src[8]);\
-        OP(dst[6], A*src[ 4] + B*src[ 5] + C*src[6] + D*src[7] + E*src[8] + F*src[9]);\
-        OP(dst[7], A*src[ 5] + B*src[ 6] + C*src[7] + D*src[8] + E*src[9] + F*src[10]);\
-        dst+=dstStride;\
-        src+=srcStride;\
-    }\
-}\
-\
-static void OPNAME ## cavs_filt8_v_  ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    const int w=8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    for(i=0; i<w; i++)\
-    {\
-        const int srcB= src[-2*srcStride];\
-        const int srcA= src[-1*srcStride];\
-        const int src0= src[0 *srcStride];\
-        const int src1= src[1 *srcStride];\
-        const int src2= src[2 *srcStride];\
-        const int src3= src[3 *srcStride];\
-        const int src4= src[4 *srcStride];\
-        const int src5= src[5 *srcStride];\
-        const int src6= src[6 *srcStride];\
-        const int src7= src[7 *srcStride];\
-        const int src8= src[8 *srcStride];\
-        const int src9= src[9 *srcStride];\
-        const int src10= src[10 *srcStride];\
-        OP(dst[0*dstStride], A*srcB + B*srcA + C*src0 + D*src1 + E*src2 + F*src3);\
-        OP(dst[1*dstStride], A*srcA + B*src0 + C*src1 + D*src2 + E*src3 + F*src4);\
-        OP(dst[2*dstStride], A*src0 + B*src1 + C*src2 + D*src3 + E*src4 + F*src5);\
-        OP(dst[3*dstStride], A*src1 + B*src2 + C*src3 + D*src4 + E*src5 + F*src6);\
-        OP(dst[4*dstStride], A*src2 + B*src3 + C*src4 + D*src5 + E*src6 + F*src7);\
-        OP(dst[5*dstStride], A*src3 + B*src4 + C*src5 + D*src6 + E*src7 + F*src8);\
-        OP(dst[6*dstStride], A*src4 + B*src5 + C*src6 + D*src7 + E*src8 + F*src9);\
-        OP(dst[7*dstStride], A*src5 + B*src6 + C*src7 + D*src8 + E*src9 + F*src10);\
-        dst++;\
-        src++;\
-    }\
-}\
-\
-static void OPNAME ## cavs_filt16_v_ ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## cavs_filt8_v_ ## NAME(dst  , src  , dstStride, srcStride);\
-    OPNAME ## cavs_filt8_v_ ## NAME(dst+8, src+8, dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## cavs_filt8_v_ ## NAME(dst  , src  , dstStride, srcStride);\
-    OPNAME ## cavs_filt8_v_ ## NAME(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static void OPNAME ## cavs_filt16_h_ ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## cavs_filt8_h_ ## NAME(dst  , src  , dstStride, srcStride);\
-    OPNAME ## cavs_filt8_h_ ## NAME(dst+8, src+8, dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## cavs_filt8_h_ ## NAME(dst  , src  , dstStride, srcStride);\
-    OPNAME ## cavs_filt8_h_ ## NAME(dst+8, src+8, dstStride, srcStride);\
-}\
-
-#define CAVS_SUBPIX_HV(OPNAME, OP, NAME, AH, BH, CH, DH, EH, FH, AV, BV, CV, DV, EV, FV, FULL) \
-static void OPNAME ## cavs_filt8_hv_ ## NAME(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride){\
-    int16_t temp[8*(8+5)];\
-    int16_t *tmp = temp;\
-    const int h=8;\
-    const int w=8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    src1 -= 2*srcStride;\
-    for(i=0; i<h+5; i++)\
-    {\
-        tmp[0]= AH*src1[-2] + BH*src1[-1] + CH*src1[0] + DH*src1[1] + EH*src1[2] + FH*src1[3];\
-        tmp[1]= AH*src1[-1] + BH*src1[ 0] + CH*src1[1] + DH*src1[2] + EH*src1[3] + FH*src1[4];\
-        tmp[2]= AH*src1[ 0] + BH*src1[ 1] + CH*src1[2] + DH*src1[3] + EH*src1[4] + FH*src1[5];\
-        tmp[3]= AH*src1[ 1] + BH*src1[ 2] + CH*src1[3] + DH*src1[4] + EH*src1[5] + FH*src1[6];\
-        tmp[4]= AH*src1[ 2] + BH*src1[ 3] + CH*src1[4] + DH*src1[5] + EH*src1[6] + FH*src1[7];\
-        tmp[5]= AH*src1[ 3] + BH*src1[ 4] + CH*src1[5] + DH*src1[6] + EH*src1[7] + FH*src1[8];\
-        tmp[6]= AH*src1[ 4] + BH*src1[ 5] + CH*src1[6] + DH*src1[7] + EH*src1[8] + FH*src1[9];\
-        tmp[7]= AH*src1[ 5] + BH*src1[ 6] + CH*src1[7] + DH*src1[8] + EH*src1[9] + FH*src1[10];\
-        tmp+=8;\
-        src1+=srcStride;\
-    }\
-    if(FULL) {\
-      tmp = temp+8*2;                           \
-      for(i=0; i<w; i++)                        \
-        {                                       \
-          const int tmpB= tmp[-2*8];    \
-          const int tmpA= tmp[-1*8];    \
-          const int tmp0= tmp[0 *8];    \
-          const int tmp1= tmp[1 *8];    \
-          const int tmp2= tmp[2 *8];    \
-          const int tmp3= tmp[3 *8];    \
-          const int tmp4= tmp[4 *8];    \
-          const int tmp5= tmp[5 *8];    \
-          const int tmp6= tmp[6 *8];    \
-          const int tmp7= tmp[7 *8];    \
-          const int tmp8= tmp[8 *8];    \
-          const int tmp9= tmp[9 *8];    \
-          const int tmp10=tmp[10*8];                            \
-          OP(dst[0*dstStride], AV*tmpB + BV*tmpA + CV*tmp0 + DV*tmp1 + EV*tmp2 + FV*tmp3 + 64*src2[0*srcStride]); \
-          OP(dst[1*dstStride], AV*tmpA + BV*tmp0 + CV*tmp1 + DV*tmp2 + EV*tmp3 + FV*tmp4 + 64*src2[1*srcStride]); \
-          OP(dst[2*dstStride], AV*tmp0 + BV*tmp1 + CV*tmp2 + DV*tmp3 + EV*tmp4 + FV*tmp5 + 64*src2[2*srcStride]); \
-          OP(dst[3*dstStride], AV*tmp1 + BV*tmp2 + CV*tmp3 + DV*tmp4 + EV*tmp5 + FV*tmp6 + 64*src2[3*srcStride]); \
-          OP(dst[4*dstStride], AV*tmp2 + BV*tmp3 + CV*tmp4 + DV*tmp5 + EV*tmp6 + FV*tmp7 + 64*src2[4*srcStride]); \
-          OP(dst[5*dstStride], AV*tmp3 + BV*tmp4 + CV*tmp5 + DV*tmp6 + EV*tmp7 + FV*tmp8 + 64*src2[5*srcStride]); \
-          OP(dst[6*dstStride], AV*tmp4 + BV*tmp5 + CV*tmp6 + DV*tmp7 + EV*tmp8 + FV*tmp9 + 64*src2[6*srcStride]); \
-          OP(dst[7*dstStride], AV*tmp5 + BV*tmp6 + CV*tmp7 + DV*tmp8 + EV*tmp9 + FV*tmp10 + 64*src2[7*srcStride]); \
-          dst++;                                                        \
-          tmp++;                                                        \
-          src2++;                                                       \
-        }                                                               \
-    } else {\
-      tmp = temp+8*2;                           \
-      for(i=0; i<w; i++)                        \
-        {                                       \
-          const int tmpB= tmp[-2*8];    \
-          const int tmpA= tmp[-1*8];    \
-          const int tmp0= tmp[0 *8];    \
-          const int tmp1= tmp[1 *8];    \
-          const int tmp2= tmp[2 *8];    \
-          const int tmp3= tmp[3 *8];    \
-          const int tmp4= tmp[4 *8];    \
-          const int tmp5= tmp[5 *8];    \
-          const int tmp6= tmp[6 *8];    \
-          const int tmp7= tmp[7 *8];    \
-          const int tmp8= tmp[8 *8];    \
-          const int tmp9= tmp[9 *8];    \
-          const int tmp10=tmp[10*8];                            \
-          OP(dst[0*dstStride], AV*tmpB + BV*tmpA + CV*tmp0 + DV*tmp1 + EV*tmp2 + FV*tmp3); \
-          OP(dst[1*dstStride], AV*tmpA + BV*tmp0 + CV*tmp1 + DV*tmp2 + EV*tmp3 + FV*tmp4); \
-          OP(dst[2*dstStride], AV*tmp0 + BV*tmp1 + CV*tmp2 + DV*tmp3 + EV*tmp4 + FV*tmp5); \
-          OP(dst[3*dstStride], AV*tmp1 + BV*tmp2 + CV*tmp3 + DV*tmp4 + EV*tmp5 + FV*tmp6); \
-          OP(dst[4*dstStride], AV*tmp2 + BV*tmp3 + CV*tmp4 + DV*tmp5 + EV*tmp6 + FV*tmp7); \
-          OP(dst[5*dstStride], AV*tmp3 + BV*tmp4 + CV*tmp5 + DV*tmp6 + EV*tmp7 + FV*tmp8); \
-          OP(dst[6*dstStride], AV*tmp4 + BV*tmp5 + CV*tmp6 + DV*tmp7 + EV*tmp8 + FV*tmp9); \
-          OP(dst[7*dstStride], AV*tmp5 + BV*tmp6 + CV*tmp7 + DV*tmp8 + EV*tmp9 + FV*tmp10); \
-          dst++;                                                        \
-          tmp++;                                                        \
-        }                                                               \
-    }\
-}\
-\
-static void OPNAME ## cavs_filt16_hv_ ## NAME(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride){ \
-    OPNAME ## cavs_filt8_hv_ ## NAME(dst  , src1,   src2  , dstStride, srcStride); \
-    OPNAME ## cavs_filt8_hv_ ## NAME(dst+8, src1+8, src2+8, dstStride, srcStride); \
-    src1 += 8*srcStride;\
-    src2 += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## cavs_filt8_hv_ ## NAME(dst  , src1,   src2  , dstStride, srcStride); \
-    OPNAME ## cavs_filt8_hv_ ## NAME(dst+8, src1+8, src2+8, dstStride, srcStride); \
-}\
-
-#define CAVS_MC(OPNAME, SIZE) \
-static void OPNAME ## cavs_qpel ## SIZE ## _mc10_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_filt ## SIZE ## _h_qpel_l(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc20_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_filt ## SIZE ## _h_hpel(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc30_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_filt ## SIZE ## _h_qpel_r(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc01_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_filt ## SIZE ## _v_qpel_l(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc02_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_filt ## SIZE ## _v_hpel(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc03_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_filt ## SIZE ## _v_qpel_r(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-  OPNAME ## cavs_filt ## SIZE ## _hv_jj(dst, src, NULL, stride, stride); \
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc11_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-  OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src, stride, stride); \
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc13_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-  OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src+stride, stride, stride); \
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc31_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-  OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src+1, stride, stride); \
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-  OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src+stride+1,stride, stride); \
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc21_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-  OPNAME ## cavs_filt ## SIZE ## _hv_ff(dst, src, src+stride+1,stride, stride); \
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc12_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-  OPNAME ## cavs_filt ## SIZE ## _hv_ii(dst, src, src+stride+1,stride, stride); \
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc32_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-  OPNAME ## cavs_filt ## SIZE ## _hv_kk(dst, src, src+stride+1,stride, stride); \
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc23_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-  OPNAME ## cavs_filt ## SIZE ## _hv_qq(dst, src, src+stride+1,stride, stride); \
-}\
-
-#define op_put1(a, b)  a = cm[((b)+4)>>3]
-#define op_put2(a, b)  a = cm[((b)+64)>>7]
-#define op_put3(a, b)  a = cm[((b)+32)>>6]
-#define op_put4(a, b)  a = cm[((b)+512)>>10]
-#define op_avg1(a, b)  a = ((a)+cm[((b)+4)>>3]   +1)>>1
-#define op_avg2(a, b)  a = ((a)+cm[((b)+64)>>7]  +1)>>1
-#define op_avg3(a, b)  a = ((a)+cm[((b)+32)>>6]  +1)>>1
-#define op_avg4(a, b)  a = ((a)+cm[((b)+512)>>10]+1)>>1
-CAVS_SUBPIX(put_   , op_put1, hpel,    0, -1,  5,  5, -1,  0)
-CAVS_SUBPIX(put_   , op_put2, qpel_l, -1, -2, 96, 42, -7,  0)
-CAVS_SUBPIX(put_   , op_put2, qpel_r,  0, -7, 42, 96, -2, -1)
-CAVS_SUBPIX_HV(put_, op_put3, jj,      0, -1,  5,  5, -1,  0,  0, -1,  5,  5, -1, 0, 0)
-CAVS_SUBPIX_HV(put_, op_put4, ff,      0, -1,  5,  5, -1,  0, -1, -2, 96, 42, -7, 0, 0)
-CAVS_SUBPIX_HV(put_, op_put4, ii,     -1, -2, 96, 42, -7,  0,  0, -1,  5,  5, -1, 0, 0)
-CAVS_SUBPIX_HV(put_, op_put4, kk,      0, -7, 42, 96, -2, -1,  0, -1,  5,  5, -1, 0, 0)
-CAVS_SUBPIX_HV(put_, op_put4, qq,      0, -1,  5,  5, -1,  0,  0, -7, 42, 96, -2,-1, 0)
-CAVS_SUBPIX_HV(put_, op_put2, egpr,    0, -1,  5,  5, -1,  0,  0, -1,  5,  5, -1, 0, 1)
-CAVS_SUBPIX(avg_   , op_avg1, hpel,    0, -1,  5,  5, -1,  0)
-CAVS_SUBPIX(avg_   , op_avg2, qpel_l, -1, -2, 96, 42, -7,  0)
-CAVS_SUBPIX(avg_   , op_avg2, qpel_r,  0, -7, 42, 96, -2, -1)
-CAVS_SUBPIX_HV(avg_, op_avg3, jj,      0, -1,  5,  5, -1,  0,  0, -1,  5,  5, -1, 0, 0)
-CAVS_SUBPIX_HV(avg_, op_avg4, ff,      0, -1,  5,  5, -1,  0, -1, -2, 96, 42, -7, 0, 0)
-CAVS_SUBPIX_HV(avg_, op_avg4, ii,     -1, -2, 96, 42, -7,  0,  0, -1,  5,  5, -1, 0, 0)
-CAVS_SUBPIX_HV(avg_, op_avg4, kk,      0, -7, 42, 96, -2, -1,  0, -1,  5,  5, -1, 0, 0)
-CAVS_SUBPIX_HV(avg_, op_avg4, qq,      0, -1,  5,  5, -1,  0,  0, -7, 42, 96, -2,-1, 0)
-CAVS_SUBPIX_HV(avg_, op_avg2, egpr,    0, -1,  5,  5, -1,  0,  0, -1,  5,  5, -1, 0, 1)
-CAVS_MC(put_, 8)
-CAVS_MC(put_, 16)
-CAVS_MC(avg_, 8)
-CAVS_MC(avg_, 16)
-
-#define put_cavs_qpel8_mc00_c  ff_put_pixels8x8_c
-#define avg_cavs_qpel8_mc00_c  ff_avg_pixels8x8_c
-#define put_cavs_qpel16_mc00_c ff_put_pixels16x16_c
-#define avg_cavs_qpel16_mc00_c ff_avg_pixels16x16_c
-
-av_cold void ff_cavsdsp_init(CAVSDSPContext* c, AVCodecContext *avctx) {
-#define dspfunc(PFX, IDX, NUM) \
-    c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_c; \
-    c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_c; \
-    c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_c; \
-    c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_c; \
-    c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_c; \
-    c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_c; \
-    c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_c; \
-    c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_c; \
-    c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_c; \
-    c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_c; \
-    c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_c; \
-    c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_c; \
-    c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_c; \
-    c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_c; \
-    c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_c; \
-    c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_c
-    dspfunc(put_cavs_qpel, 0, 16);
-    dspfunc(put_cavs_qpel, 1, 8);
-    dspfunc(avg_cavs_qpel, 0, 16);
-    dspfunc(avg_cavs_qpel, 1, 8);
-    c->cavs_filter_lv = cavs_filter_lv_c;
-    c->cavs_filter_lh = cavs_filter_lh_c;
-    c->cavs_filter_cv = cavs_filter_cv_c;
-    c->cavs_filter_ch = cavs_filter_ch_c;
-    c->cavs_idct8_add = cavs_idct8_add_c;
-    c->idct_perm = FF_NO_IDCT_PERM;
-
-    if (ARCH_X86)
-        ff_cavsdsp_init_x86(c, avctx);
-}
diff --git a/deps/libav/libavcodec/cavsdsp.h b/deps/libav/libavcodec/cavsdsp.h
deleted file mode 100644
index 333bd10..0000000
--- a/deps/libav/libavcodec/cavsdsp.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
- * Copyright (c) 2006  Stefan Gehrer <stefan.gehrer at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_CAVSDSP_H
-#define AVCODEC_CAVSDSP_H
-
-#include <stdint.h>
-#include "dsputil.h"
-
-typedef struct CAVSDSPContext {
-    qpel_mc_func put_cavs_qpel_pixels_tab[2][16];
-    qpel_mc_func avg_cavs_qpel_pixels_tab[2][16];
-    void (*cavs_filter_lv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
-    void (*cavs_filter_lh)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
-    void (*cavs_filter_cv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
-    void (*cavs_filter_ch)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
-    void (*cavs_idct8_add)(uint8_t *dst, int16_t *block, int stride);
-    int idct_perm;
-} CAVSDSPContext;
-
-void ff_cavsdsp_init(CAVSDSPContext* c, AVCodecContext *avctx);
-void ff_cavsdsp_init_x86(CAVSDSPContext* c, AVCodecContext *avctx);
-
-#endif /* AVCODEC_CAVSDSP_H */
diff --git a/deps/libav/libavcodec/cbrt_tablegen.c b/deps/libav/libavcodec/cbrt_tablegen.c
deleted file mode 100644
index e92c0f1..0000000
--- a/deps/libav/libavcodec/cbrt_tablegen.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Generate a header file for hardcoded AAC cube-root table
- *
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#include "cbrt_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
-    cbrt_tableinit();
-
-    write_fileheader();
-
-    WRITE_ARRAY("static const", uint32_t, cbrt_tab);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/cbrt_tablegen.h b/deps/libav/libavcodec/cbrt_tablegen.h
deleted file mode 100644
index 60d900a..0000000
--- a/deps/libav/libavcodec/cbrt_tablegen.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Header file for hardcoded AAC cube-root table
- *
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_CBRT_TABLEGEN_H
-#define AVCODEC_CBRT_TABLEGEN_H
-
-#include <stdint.h>
-#include <math.h>
-
-#if CONFIG_HARDCODED_TABLES
-#define cbrt_tableinit()
-#include "libavcodec/cbrt_tables.h"
-#else
-static uint32_t cbrt_tab[1 << 13];
-
-static void cbrt_tableinit(void)
-{
-    if (!cbrt_tab[(1<<13) - 1]) {
-        int i;
-        /* cbrtf() isn't available on all systems, so we use powf(). */
-        for (i = 0; i < 1<<13; i++) {
-            union {
-                float f;
-                uint32_t i;
-            } f;
-            f.f = powf(i, 1.0 / 3.0) * i;
-            cbrt_tab[i] = f.i;
-        }
-    }
-}
-#endif /* CONFIG_HARDCODED_TABLES */
-
-#endif /* AVCODEC_CBRT_TABLEGEN_H */
diff --git a/deps/libav/libavcodec/cdgraphics.c b/deps/libav/libavcodec/cdgraphics.c
deleted file mode 100644
index b8a6fb8..0000000
--- a/deps/libav/libavcodec/cdgraphics.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * CD Graphics Video Decoder
- * Copyright (c) 2009 Michael Tison
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-/**
- * @file
- * @brief CD Graphics Video Decoder
- * @author Michael Tison
- * @see http://wiki.multimedia.cx/index.php?title=CD_Graphics
- * @see http://www.ccs.neu.edu/home/bchafy/cdb/info/cdg
- */
-
-/// default screen sizes
-#define CDG_FULL_WIDTH           300
-#define CDG_FULL_HEIGHT          216
-#define CDG_DISPLAY_WIDTH        294
-#define CDG_DISPLAY_HEIGHT       204
-#define CDG_BORDER_WIDTH           6
-#define CDG_BORDER_HEIGHT         12
-
-/// masks
-#define CDG_COMMAND             0x09
-#define CDG_MASK                0x3F
-
-/// instruction codes
-#define CDG_INST_MEMORY_PRESET     1
-#define CDG_INST_BORDER_PRESET     2
-#define CDG_INST_TILE_BLOCK        6
-#define CDG_INST_SCROLL_PRESET    20
-#define CDG_INST_SCROLL_COPY      24
-#define CDG_INST_LOAD_PAL_LO      30
-#define CDG_INST_LOAD_PAL_HIGH    31
-#define CDG_INST_TILE_BLOCK_XOR   38
-
-/// data sizes
-#define CDG_PACKET_SIZE           24
-#define CDG_DATA_SIZE             16
-#define CDG_TILE_HEIGHT           12
-#define CDG_TILE_WIDTH             6
-#define CDG_MINIMUM_PKT_SIZE       6
-#define CDG_MINIMUM_SCROLL_SIZE    3
-#define CDG_HEADER_SIZE            8
-#define CDG_PALETTE_SIZE          16
-
-typedef struct CDGraphicsContext {
-    AVFrame *frame;
-    int hscroll;
-    int vscroll;
-} CDGraphicsContext;
-
-static av_cold int cdg_decode_init(AVCodecContext *avctx)
-{
-    CDGraphicsContext *cc = avctx->priv_data;
-
-    cc->frame = av_frame_alloc();
-    if (!cc->frame)
-        return AVERROR(ENOMEM);
-
-    avctx->width   = CDG_FULL_WIDTH;
-    avctx->height  = CDG_FULL_HEIGHT;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    return 0;
-}
-
-static void cdg_border_preset(CDGraphicsContext *cc, uint8_t *data)
-{
-    int y;
-    int lsize    = cc->frame->linesize[0];
-    uint8_t *buf = cc->frame->data[0];
-    int color    = data[0] & 0x0F;
-
-    if (!(data[1] & 0x0F)) {
-        /// fill the top and bottom borders
-        memset(buf, color, CDG_BORDER_HEIGHT * lsize);
-        memset(buf + (CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT) * lsize,
-               color, CDG_BORDER_HEIGHT * lsize);
-
-        /// fill the side borders
-        for (y = CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT; y++) {
-            memset(buf + y * lsize, color, CDG_BORDER_WIDTH);
-            memset(buf + CDG_FULL_WIDTH - CDG_BORDER_WIDTH + y * lsize,
-                   color, CDG_BORDER_WIDTH);
-        }
-    }
-}
-
-static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low)
-{
-    uint8_t r, g, b;
-    uint16_t color;
-    int i;
-    int array_offset  = low ? 0 : 8;
-    uint32_t *palette = (uint32_t *) cc->frame->data[1];
-
-    for (i = 0; i < 8; i++) {
-        color = (data[2 * i] << 6) + (data[2 * i + 1] & 0x3F);
-        r = ((color >> 8) & 0x000F) * 17;
-        g = ((color >> 4) & 0x000F) * 17;
-        b = ((color     ) & 0x000F) * 17;
-        palette[i + array_offset] = r << 16 | g << 8 | b;
-    }
-    cc->frame->palette_has_changed = 1;
-}
-
-static int cdg_tile_block(CDGraphicsContext *cc, uint8_t *data, int b)
-{
-    unsigned ci, ri;
-    int color;
-    int x, y;
-    int ai;
-    int stride   = cc->frame->linesize[0];
-    uint8_t *buf = cc->frame->data[0];
-
-    ri = (data[2] & 0x1F) * CDG_TILE_HEIGHT + cc->vscroll;
-    ci = (data[3] & 0x3F) * CDG_TILE_WIDTH  + cc->hscroll;
-
-    if (ri > (CDG_FULL_HEIGHT - CDG_TILE_HEIGHT))
-        return AVERROR(EINVAL);
-    if (ci > (CDG_FULL_WIDTH - CDG_TILE_WIDTH))
-        return AVERROR(EINVAL);
-
-    for (y = 0; y < CDG_TILE_HEIGHT; y++) {
-        for (x = 0; x < CDG_TILE_WIDTH; x++) {
-            if (!((data[4 + y] >> (5 - x)) & 0x01))
-                color = data[0] & 0x0F;
-            else
-                color = data[1] & 0x0F;
-
-            ai = ci + x + (stride * (ri + y));
-            if (b)
-                color ^= buf[ai];
-            buf[ai] = color;
-        }
-    }
-
-    return 0;
-}
-
-#define UP    2
-#define DOWN  1
-#define LEFT  2
-#define RIGHT 1
-
-static void cdg_copy_rect_buf(int out_tl_x, int out_tl_y, uint8_t *out,
-                              int in_tl_x, int in_tl_y, uint8_t *in,
-                              int w, int h, int stride)
-{
-    int y;
-
-    in  += in_tl_x  + in_tl_y  * stride;
-    out += out_tl_x + out_tl_y * stride;
-    for (y = 0; y < h; y++)
-        memcpy(out + y * stride, in + y * stride, w);
-}
-
-static void cdg_fill_rect_preset(int tl_x, int tl_y, uint8_t *out,
-                                 int color, int w, int h, int stride)
-{
-    int y;
-
-    for (y = tl_y; y < tl_y + h; y++)
-        memset(out + tl_x + y * stride, color, w);
-}
-
-static void cdg_fill_wrapper(int out_tl_x, int out_tl_y, uint8_t *out,
-                             int in_tl_x, int in_tl_y, uint8_t *in,
-                             int color, int w, int h, int stride, int roll)
-{
-    if (roll) {
-        cdg_copy_rect_buf(out_tl_x, out_tl_y, out, in_tl_x, in_tl_y,
-                          in, w, h, stride);
-    } else {
-        cdg_fill_rect_preset(out_tl_x, out_tl_y, out, color, w, h, stride);
-    }
-}
-
-static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
-                       AVFrame *new_frame, int roll_over)
-{
-    int color;
-    int hscmd, h_off, hinc, vscmd, v_off, vinc;
-    int y;
-    int stride   = cc->frame->linesize[0];
-    uint8_t *in  = cc->frame->data[0];
-    uint8_t *out = new_frame->data[0];
-
-    color =  data[0] & 0x0F;
-    hscmd = (data[1] & 0x30) >> 4;
-    vscmd = (data[2] & 0x30) >> 4;
-
-    h_off =  FFMIN(data[1] & 0x07, CDG_BORDER_WIDTH  - 1);
-    v_off =  FFMIN(data[2] & 0x0F, CDG_BORDER_HEIGHT - 1);
-
-    /// find the difference and save the offset for cdg_tile_block usage
-    hinc = h_off - cc->hscroll;
-    vinc = v_off - cc->vscroll;
-    cc->hscroll = h_off;
-    cc->vscroll = v_off;
-
-    if (vscmd == UP)
-        vinc -= 12;
-    if (vscmd == DOWN)
-        vinc += 12;
-    if (hscmd == LEFT)
-        hinc -= 6;
-    if (hscmd == RIGHT)
-        hinc += 6;
-
-    if (!hinc && !vinc)
-        return;
-
-    memcpy(new_frame->data[1], cc->frame->data[1], CDG_PALETTE_SIZE * 4);
-
-    for (y = FFMAX(0, vinc); y < FFMIN(CDG_FULL_HEIGHT + vinc, CDG_FULL_HEIGHT); y++)
-        memcpy(out + FFMAX(0, hinc) + stride * y,
-               in + FFMAX(0, hinc) - hinc + (y - vinc) * stride,
-               FFMIN(stride + hinc, stride));
-
-    if (vinc > 0)
-        cdg_fill_wrapper(0, 0, out,
-                         0, CDG_FULL_HEIGHT - vinc, in, color,
-                         stride, vinc, stride, roll_over);
-    else if (vinc < 0)
-        cdg_fill_wrapper(0, CDG_FULL_HEIGHT + vinc, out,
-                         0, 0, in, color,
-                         stride, -1 * vinc, stride, roll_over);
-
-    if (hinc > 0)
-        cdg_fill_wrapper(0, 0, out,
-                         CDG_FULL_WIDTH - hinc, 0, in, color,
-                         hinc, CDG_FULL_HEIGHT, stride, roll_over);
-    else if (hinc < 0)
-        cdg_fill_wrapper(CDG_FULL_WIDTH + hinc, 0, out,
-                         0, 0, in, color,
-                         -1 * hinc, CDG_FULL_HEIGHT, stride, roll_over);
-
-}
-
-static int cdg_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    int ret;
-    uint8_t command, inst;
-    uint8_t cdg_data[CDG_DATA_SIZE];
-    AVFrame *frame = data;
-    CDGraphicsContext *cc = avctx->priv_data;
-
-    if (buf_size < CDG_MINIMUM_PKT_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "buffer too small for decoder\n");
-        return AVERROR(EINVAL);
-    }
-
-    ret = ff_reget_buffer(avctx, cc->frame);
-    if (ret) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-    if (!avctx->frame_number)
-        memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height);
-
-    command = bytestream_get_byte(&buf);
-    inst    = bytestream_get_byte(&buf);
-    inst    &= CDG_MASK;
-    buf += 2;  /// skipping 2 unneeded bytes
-    bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
-
-    if ((command & CDG_MASK) == CDG_COMMAND) {
-        switch (inst) {
-        case CDG_INST_MEMORY_PRESET:
-            if (!(cdg_data[1] & 0x0F))
-                memset(cc->frame->data[0], cdg_data[0] & 0x0F,
-                       cc->frame->linesize[0] * CDG_FULL_HEIGHT);
-            break;
-        case CDG_INST_LOAD_PAL_LO:
-        case CDG_INST_LOAD_PAL_HIGH:
-            if (buf_size - CDG_HEADER_SIZE < CDG_DATA_SIZE) {
-                av_log(avctx, AV_LOG_ERROR, "buffer too small for loading palette\n");
-                return AVERROR(EINVAL);
-            }
-
-            cdg_load_palette(cc, cdg_data, inst == CDG_INST_LOAD_PAL_LO);
-            break;
-        case CDG_INST_BORDER_PRESET:
-            cdg_border_preset(cc, cdg_data);
-            break;
-        case CDG_INST_TILE_BLOCK_XOR:
-        case CDG_INST_TILE_BLOCK:
-            if (buf_size - CDG_HEADER_SIZE < CDG_DATA_SIZE) {
-                av_log(avctx, AV_LOG_ERROR, "buffer too small for drawing tile\n");
-                return AVERROR(EINVAL);
-            }
-
-            ret = cdg_tile_block(cc, cdg_data, inst == CDG_INST_TILE_BLOCK_XOR);
-            if (ret) {
-                av_log(avctx, AV_LOG_ERROR, "tile is out of range\n");
-                return ret;
-            }
-            break;
-        case CDG_INST_SCROLL_PRESET:
-        case CDG_INST_SCROLL_COPY:
-            if (buf_size - CDG_HEADER_SIZE < CDG_MINIMUM_SCROLL_SIZE) {
-                av_log(avctx, AV_LOG_ERROR, "buffer too small for scrolling\n");
-                return AVERROR(EINVAL);
-            }
-
-            ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);
-            if (ret) {
-                av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                return ret;
-            }
-
-            cdg_scroll(cc, cdg_data, frame, inst == CDG_INST_SCROLL_COPY);
-            av_frame_unref(cc->frame);
-            ret = av_frame_ref(cc->frame, frame);
-            if (ret < 0)
-                return ret;
-            break;
-        default:
-            break;
-        }
-
-        if (!frame->data[0]) {
-            ret = av_frame_ref(frame, cc->frame);
-            if (ret < 0)
-                return ret;
-        }
-        *got_frame = 1;
-    } else {
-        *got_frame = 0;
-        buf_size   = 0;
-    }
-
-    return buf_size;
-}
-
-static av_cold int cdg_decode_end(AVCodecContext *avctx)
-{
-    CDGraphicsContext *cc = avctx->priv_data;
-
-    av_frame_free(&cc->frame);
-
-    return 0;
-}
-
-AVCodec ff_cdgraphics_decoder = {
-    .name           = "cdgraphics",
-    .long_name      = NULL_IF_CONFIG_SMALL("CD Graphics video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CDGRAPHICS,
-    .priv_data_size = sizeof(CDGraphicsContext),
-    .init           = cdg_decode_init,
-    .close          = cdg_decode_end,
-    .decode         = cdg_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/cdxl.c b/deps/libav/libavcodec/cdxl.c
deleted file mode 100644
index 80a3671..0000000
--- a/deps/libav/libavcodec/cdxl.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * CDXL video decoder
- * Copyright (c) 2011-2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-
-#define BIT_PLANAR   0x00
-#define BYTE_PLANAR  0x20
-#define CHUNKY       0x40
-#define BIT_LINE     0x80
-#define BYTE_LINE    0xC0
-
-typedef struct {
-    AVCodecContext *avctx;
-    int            bpp;
-    int            format;
-    int            padded_bits;
-    const uint8_t  *palette;
-    int            palette_size;
-    const uint8_t  *video;
-    int            video_size;
-    uint8_t        *new_video;
-    int            new_video_size;
-} CDXLVideoContext;
-
-static av_cold int cdxl_decode_init(AVCodecContext *avctx)
-{
-    CDXLVideoContext *c = avctx->priv_data;
-
-    c->new_video_size = 0;
-    c->avctx          = avctx;
-
-    return 0;
-}
-
-static void import_palette(CDXLVideoContext *c, uint32_t *new_palette)
-{
-    int i;
-
-    for (i = 0; i < c->palette_size / 2; i++) {
-        unsigned rgb = AV_RB16(&c->palette[i * 2]);
-        unsigned r   = ((rgb >> 8) & 0xF) * 0x11;
-        unsigned g   = ((rgb >> 4) & 0xF) * 0x11;
-        unsigned b   =  (rgb       & 0xF) * 0x11;
-        AV_WN32(&new_palette[i], (r << 16) | (g << 8) | b);
-    }
-}
-
-static void bitplanar2chunky(CDXLVideoContext *c, int linesize, uint8_t *out)
-{
-    GetBitContext gb;
-    int x, y, plane;
-
-    init_get_bits(&gb, c->video, c->video_size * 8);
-    for (plane = 0; plane < c->bpp; plane++) {
-        for (y = 0; y < c->avctx->height; y++) {
-            for (x = 0; x < c->avctx->width; x++)
-                out[linesize * y + x] |= get_bits1(&gb) << plane;
-            skip_bits(&gb, c->padded_bits);
-        }
-    }
-}
-
-static void bitline2chunky(CDXLVideoContext *c, int linesize, uint8_t *out)
-{
-    GetBitContext  gb;
-    int x, y, plane;
-
-    init_get_bits(&gb, c->video, c->video_size * 8);
-    for (y = 0; y < c->avctx->height; y++) {
-        for (plane = 0; plane < c->bpp; plane++) {
-            for (x = 0; x < c->avctx->width; x++)
-                out[linesize * y + x] |= get_bits1(&gb) << plane;
-            skip_bits(&gb, c->padded_bits);
-        }
-    }
-}
-
-static void import_format(CDXLVideoContext *c, int linesize, uint8_t *out)
-{
-    memset(out, 0, linesize * c->avctx->height);
-
-    switch (c->format) {
-    case BIT_PLANAR:
-        bitplanar2chunky(c, linesize, out);
-        break;
-    case BIT_LINE:
-        bitline2chunky(c, linesize, out);
-        break;
-    }
-}
-
-static void cdxl_decode_rgb(CDXLVideoContext *c, AVFrame *frame)
-{
-    uint32_t *new_palette = (uint32_t *)frame->data[1];
-
-    import_palette(c, new_palette);
-    import_format(c, frame->linesize[0], frame->data[0]);
-}
-
-static void cdxl_decode_ham6(CDXLVideoContext *c, AVFrame *frame)
-{
-    AVCodecContext *avctx = c->avctx;
-    uint32_t new_palette[16], r, g, b;
-    uint8_t *ptr, *out, index, op;
-    int x, y;
-
-    ptr = c->new_video;
-    out = frame->data[0];
-
-    import_palette(c, new_palette);
-    import_format(c, avctx->width, c->new_video);
-
-    for (y = 0; y < avctx->height; y++) {
-        r = new_palette[0] & 0xFF0000;
-        g = new_palette[0] & 0xFF00;
-        b = new_palette[0] & 0xFF;
-        for (x = 0; x < avctx->width; x++) {
-            index  = *ptr++;
-            op     = index >> 4;
-            index &= 15;
-            switch (op) {
-            case 0:
-                r = new_palette[index] & 0xFF0000;
-                g = new_palette[index] & 0xFF00;
-                b = new_palette[index] & 0xFF;
-                break;
-            case 1:
-                b = index * 0x11;
-                break;
-            case 2:
-                r = index * 0x11 << 16;
-                break;
-            case 3:
-                g = index * 0x11 << 8;
-                break;
-            }
-            AV_WL24(out + x * 3, r | g | b);
-        }
-        out += frame->linesize[0];
-    }
-}
-
-static void cdxl_decode_ham8(CDXLVideoContext *c, AVFrame *frame)
-{
-    AVCodecContext *avctx = c->avctx;
-    uint32_t new_palette[64], r, g, b;
-    uint8_t *ptr, *out, index, op;
-    int x, y;
-
-    ptr = c->new_video;
-    out = frame->data[0];
-
-    import_palette(c, new_palette);
-    import_format(c, avctx->width, c->new_video);
-
-    for (y = 0; y < avctx->height; y++) {
-        r = new_palette[0] & 0xFF0000;
-        g = new_palette[0] & 0xFF00;
-        b = new_palette[0] & 0xFF;
-        for (x = 0; x < avctx->width; x++) {
-            index  = *ptr++;
-            op     = index >> 6;
-            index &= 63;
-            switch (op) {
-            case 0:
-                r = new_palette[index] & 0xFF0000;
-                g = new_palette[index] & 0xFF00;
-                b = new_palette[index] & 0xFF;
-                break;
-            case 1:
-                b = (index <<  2) | (b & 3);
-                break;
-            case 2:
-                r = (index << 18) | (r & (3 << 16));
-                break;
-            case 3:
-                g = (index << 10) | (g & (3 << 8));
-                break;
-            }
-            AV_WL24(out + x * 3, r | g | b);
-        }
-        out += frame->linesize[0];
-    }
-}
-
-static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame, AVPacket *pkt)
-{
-    CDXLVideoContext *c = avctx->priv_data;
-    AVFrame * const p = data;
-    int ret, w, h, encoding, aligned_width, buf_size = pkt->size;
-    const uint8_t *buf = pkt->data;
-
-    if (buf_size < 32)
-        return AVERROR_INVALIDDATA;
-    encoding        = buf[1] & 7;
-    c->format       = buf[1] & 0xE0;
-    w               = AV_RB16(&buf[14]);
-    h               = AV_RB16(&buf[16]);
-    c->bpp          = buf[19];
-    c->palette_size = AV_RB16(&buf[20]);
-    c->palette      = buf + 32;
-    c->video        = c->palette + c->palette_size;
-    c->video_size   = buf_size - c->palette_size - 32;
-
-    if (c->palette_size > 512)
-        return AVERROR_INVALIDDATA;
-    if (buf_size < c->palette_size + 32)
-        return AVERROR_INVALIDDATA;
-    if (c->bpp < 1)
-        return AVERROR_INVALIDDATA;
-    if (c->format != BIT_PLANAR && c->format != BIT_LINE) {
-        avpriv_request_sample(avctx, "Pixel format 0x%0x", c->format);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
-        return ret;
-
-    aligned_width = FFALIGN(c->avctx->width, 16);
-    c->padded_bits  = aligned_width - c->avctx->width;
-    if (c->video_size < aligned_width * avctx->height * c->bpp / 8)
-        return AVERROR_INVALIDDATA;
-    if (!encoding && c->palette_size && c->bpp <= 8) {
-        avctx->pix_fmt = AV_PIX_FMT_PAL8;
-    } else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8)) {
-        if (c->palette_size != (1 << (c->bpp - 1)))
-            return AVERROR_INVALIDDATA;
-        avctx->pix_fmt = AV_PIX_FMT_BGR24;
-    } else {
-        avpriv_request_sample(avctx, "Encoding %d and bpp %d",
-                              encoding, c->bpp);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    p->pict_type = AV_PICTURE_TYPE_I;
-
-    if (encoding) {
-        av_fast_padded_malloc(&c->new_video, &c->new_video_size,
-                              h * w + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!c->new_video)
-            return AVERROR(ENOMEM);
-        if (c->bpp == 8)
-            cdxl_decode_ham8(c, p);
-        else
-            cdxl_decode_ham6(c, p);
-    } else {
-        cdxl_decode_rgb(c, p);
-    }
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int cdxl_decode_end(AVCodecContext *avctx)
-{
-    CDXLVideoContext *c = avctx->priv_data;
-
-    av_free(c->new_video);
-
-    return 0;
-}
-
-AVCodec ff_cdxl_decoder = {
-    .name           = "cdxl",
-    .long_name      = NULL_IF_CONFIG_SMALL("Commodore CDXL video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CDXL,
-    .priv_data_size = sizeof(CDXLVideoContext),
-    .init           = cdxl_decode_init,
-    .close          = cdxl_decode_end,
-    .decode         = cdxl_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/celp_filters.c b/deps/libav/libavcodec/celp_filters.c
deleted file mode 100644
index 381ffa4..0000000
--- a/deps/libav/libavcodec/celp_filters.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * various filters for ACELP-based codecs
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-
-#include "avcodec.h"
-#include "celp_filters.h"
-#include "libavutil/common.h"
-
-void ff_celp_convolve_circ(int16_t* fc_out, const int16_t* fc_in,
-                           const int16_t* filter, int len)
-{
-    int i, k;
-
-    memset(fc_out, 0, len * sizeof(int16_t));
-
-    /* Since there are few pulses over an entire subframe (i.e. almost
-       all fc_in[i] are zero) it is faster to loop over fc_in first. */
-    for (i = 0; i < len; i++) {
-        if (fc_in[i]) {
-            for (k = 0; k < i; k++)
-                fc_out[k] += (fc_in[i] * filter[len + k - i]) >> 15;
-
-            for (k = i; k < len; k++)
-                fc_out[k] += (fc_in[i] * filter[      k - i]) >> 15;
-        }
-    }
-}
-
-void ff_celp_circ_addf(float *out, const float *in,
-                       const float *lagged, int lag, float fac, int n)
-{
-    int k;
-    for (k = 0; k < lag; k++)
-        out[k] = in[k] + fac * lagged[n + k - lag];
-    for (; k < n; k++)
-        out[k] = in[k] + fac * lagged[    k - lag];
-}
-
-int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs,
-                                const int16_t *in, int buffer_length,
-                                int filter_length, int stop_on_overflow,
-                                int shift, int rounder)
-{
-    int i,n;
-
-    for (n = 0; n < buffer_length; n++) {
-        int sum = -rounder, sum1;
-        for (i = 1; i <= filter_length; i++)
-            sum += filter_coeffs[i-1] * out[n-i];
-
-        sum1 = ((-sum >> 12) + in[n]) >> shift;
-        sum  = av_clip_int16(sum1);
-
-        if (stop_on_overflow && sum != sum1)
-            return 1;
-
-        out[n] = sum;
-    }
-
-    return 0;
-}
-
-void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs,
-                                  const float* in, int buffer_length,
-                                  int filter_length)
-{
-    int i,n;
-
-#if 0 // Unoptimized code path for improved readability
-    for (n = 0; n < buffer_length; n++) {
-        out[n] = in[n];
-        for (i = 1; i <= filter_length; i++)
-            out[n] -= filter_coeffs[i-1] * out[n-i];
-    }
-#else
-    float out0, out1, out2, out3;
-    float old_out0, old_out1, old_out2, old_out3;
-    float a,b,c;
-
-    a = filter_coeffs[0];
-    b = filter_coeffs[1];
-    c = filter_coeffs[2];
-    b -= filter_coeffs[0] * filter_coeffs[0];
-    c -= filter_coeffs[1] * filter_coeffs[0];
-    c -= filter_coeffs[0] * b;
-
-    old_out0 = out[-4];
-    old_out1 = out[-3];
-    old_out2 = out[-2];
-    old_out3 = out[-1];
-    for (n = 0; n <= buffer_length - 4; n+=4) {
-        float tmp0,tmp1,tmp2;
-        float val;
-
-        out0 = in[0];
-        out1 = in[1];
-        out2 = in[2];
-        out3 = in[3];
-
-        out0 -= filter_coeffs[2] * old_out1;
-        out1 -= filter_coeffs[2] * old_out2;
-        out2 -= filter_coeffs[2] * old_out3;
-
-        out0 -= filter_coeffs[1] * old_out2;
-        out1 -= filter_coeffs[1] * old_out3;
-
-        out0 -= filter_coeffs[0] * old_out3;
-
-        val = filter_coeffs[3];
-
-        out0 -= val * old_out0;
-        out1 -= val * old_out1;
-        out2 -= val * old_out2;
-        out3 -= val * old_out3;
-
-        for (i = 5; i <= filter_length; i += 2) {
-            old_out3 = out[-i];
-            val = filter_coeffs[i-1];
-
-            out0 -= val * old_out3;
-            out1 -= val * old_out0;
-            out2 -= val * old_out1;
-            out3 -= val * old_out2;
-
-            old_out2 = out[-i-1];
-
-            val = filter_coeffs[i];
-
-            out0 -= val * old_out2;
-            out1 -= val * old_out3;
-            out2 -= val * old_out0;
-            out3 -= val * old_out1;
-
-            FFSWAP(float, old_out0, old_out2);
-            old_out1 = old_out3;
-        }
-
-        tmp0 = out0;
-        tmp1 = out1;
-        tmp2 = out2;
-
-        out3 -= a * tmp2;
-        out2 -= a * tmp1;
-        out1 -= a * tmp0;
-
-        out3 -= b * tmp1;
-        out2 -= b * tmp0;
-
-        out3 -= c * tmp0;
-
-
-        out[0] = out0;
-        out[1] = out1;
-        out[2] = out2;
-        out[3] = out3;
-
-        old_out0 = out0;
-        old_out1 = out1;
-        old_out2 = out2;
-        old_out3 = out3;
-
-        out += 4;
-        in  += 4;
-    }
-
-    out -= n;
-    in -= n;
-    for (; n < buffer_length; n++) {
-        out[n] = in[n];
-        for (i = 1; i <= filter_length; i++)
-            out[n] -= filter_coeffs[i-1] * out[n-i];
-    }
-#endif
-}
-
-void ff_celp_lp_zero_synthesis_filterf(float *out, const float *filter_coeffs,
-                                       const float *in, int buffer_length,
-                                       int filter_length)
-{
-    int i,n;
-
-    for (n = 0; n < buffer_length; n++) {
-        out[n] = in[n];
-        for (i = 1; i <= filter_length; i++)
-            out[n] += filter_coeffs[i-1] * in[n-i];
-    }
-}
diff --git a/deps/libav/libavcodec/celp_filters.h b/deps/libav/libavcodec/celp_filters.h
deleted file mode 100644
index c328258..0000000
--- a/deps/libav/libavcodec/celp_filters.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * various filters for CELP-based codecs
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_CELP_FILTERS_H
-#define AVCODEC_CELP_FILTERS_H
-
-#include <stdint.h>
-
-/**
- * Circularly convolve fixed vector with a phase dispersion impulse
- *        response filter (D.6.2 of G.729 and 6.1.5 of AMR).
- * @param fc_out vector with filter applied
- * @param fc_in source vector
- * @param filter phase filter coefficients
- *
- *  fc_out[n] = sum(i,0,len-1){ fc_in[i] * filter[(len + n - i)%len] }
- *
- * @note fc_in and fc_out should not overlap!
- */
-void ff_celp_convolve_circ(int16_t *fc_out, const int16_t *fc_in,
-                           const int16_t *filter, int len);
-
-/**
- * Add an array to a rotated array.
- *
- * out[k] = in[k] + fac * lagged[k-lag] with wrap-around
- *
- * @param out result vector
- * @param in samples to be added unfiltered
- * @param lagged samples to be rotated, multiplied and added
- * @param lag lagged vector delay in the range [0, n]
- * @param fac scalefactor for lagged samples
- * @param n number of samples
- */
-void ff_celp_circ_addf(float *out, const float *in,
-                       const float *lagged, int lag, float fac, int n);
-
-/**
- * LP synthesis filter.
- * @param[out] out pointer to output buffer
- * @param filter_coeffs filter coefficients (-0x8000 <= (3.12) < 0x8000)
- * @param in input signal
- * @param buffer_length amount of data to process
- * @param filter_length filter length (10 for 10th order LP filter)
- * @param stop_on_overflow   1 - return immediately if overflow occurs
- *                           0 - ignore overflows
- * @param shift the result is shifted right by this value
- * @param rounder the amount to add for rounding (usually 0x800 or 0xfff)
- *
- * @return 1 if overflow occurred, 0 - otherwise
- *
- * @note Output buffer must contain filter_length samples of past
- *       speech data before pointer.
- *
- * Routine applies 1/A(z) filter to given speech data.
- */
-int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs,
-                                const int16_t *in, int buffer_length,
-                                int filter_length, int stop_on_overflow,
-                                int shift, int rounder);
-
-/**
- * LP synthesis filter.
- * @param[out] out pointer to output buffer
- *        - the array out[-filter_length, -1] must
- *        contain the previous result of this filter
- * @param filter_coeffs filter coefficients.
- * @param in input signal
- * @param buffer_length amount of data to process
- * @param filter_length filter length (10 for 10th order LP filter). Must be
- *                      greater than 4 and even.
- *
- * @note Output buffer must contain filter_length samples of past
- *       speech data before pointer.
- *
- * Routine applies 1/A(z) filter to given speech data.
- */
-void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs,
-                                  const float *in, int buffer_length,
-                                  int filter_length);
-
-/**
- * LP zero synthesis filter.
- * @param[out] out pointer to output buffer
- * @param filter_coeffs filter coefficients.
- * @param in input signal
- *        - the array in[-filter_length, -1] must
- *        contain the previous input of this filter
- * @param buffer_length amount of data to process
- * @param filter_length filter length (10 for 10th order LP filter)
- *
- * @note Output buffer must contain filter_length samples of past
- *       speech data before pointer.
- *
- * Routine applies A(z) filter to given speech data.
- */
-void ff_celp_lp_zero_synthesis_filterf(float *out, const float *filter_coeffs,
-                                       const float *in, int buffer_length,
-                                       int filter_length);
-
-#endif /* AVCODEC_CELP_FILTERS_H */
diff --git a/deps/libav/libavcodec/celp_math.c b/deps/libav/libavcodec/celp_math.c
deleted file mode 100644
index a9ebef6..0000000
--- a/deps/libav/libavcodec/celp_math.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Various fixed-point math operations
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-#include <limits.h>
-#include <assert.h>
-
-#include "avcodec.h"
-#include "celp_math.h"
-#include "libavutil/common.h"
-
-static const uint16_t exp2a[]=
-{
-     0,  1435,  2901,  4400,  5931,  7496,  9096, 10730,
- 12400, 14106, 15850, 17632, 19454, 21315, 23216, 25160,
- 27146, 29175, 31249, 33368, 35534, 37747, 40009, 42320,
- 44682, 47095, 49562, 52082, 54657, 57289, 59979, 62727,
-};
-
-static const uint16_t exp2b[]=
-{
-     3,   712,  1424,  2134,  2845,  3557,  4270,  4982,
-  5696,  6409,  7124,  7839,  8554,  9270,  9986, 10704,
- 11421, 12138, 12857, 13576, 14295, 15014, 15734, 16455,
- 17176, 17898, 18620, 19343, 20066, 20790, 21514, 22238,
-};
-
-int ff_exp2(uint16_t power)
-{
-    unsigned int result= exp2a[power>>10] + 0x10000;
-
-    assert(power <= 0x7fff);
-
-    result= (result<<3) + ((result*exp2b[(power>>5)&31])>>17);
-    return result + ((result*(power&31)*89)>>22);
-}
-
-/**
- * Table used to compute log2(x)
- *
- * tab_log2[i] = (1<<15) * log2(1 + i/32), i=0..32
- */
-static const uint16_t tab_log2[33] =
-{
-      4,   1459,   2870,   4240,   5572,   6867,   8127,   9355,
-  10552,  11719,  12858,  13971,  15057,  16120,  17158,  18175,
-  19170,  20145,  21100,  22036,  22954,  23854,  24738,  25605,
-  26457,  27294,  28116,  28924,  29719,  30500,  31269,  32025,  32769,
-};
-
-int ff_log2_q15(uint32_t value)
-{
-    uint8_t  power_int;
-    uint8_t  frac_x0;
-    uint16_t frac_dx;
-
-    // Stripping zeros from beginning
-    power_int = av_log2(value);
-    value <<= (31 - power_int);
-
-    // b31 is always non-zero now
-    frac_x0 = (value & 0x7c000000) >> 26; // b26-b31 and [32..63] -> [0..31]
-    frac_dx = (value & 0x03fff800) >> 11;
-
-    value = tab_log2[frac_x0];
-    value += (frac_dx * (tab_log2[frac_x0+1] - tab_log2[frac_x0])) >> 15;
-
-    return (power_int << 15) + value;
-}
diff --git a/deps/libav/libavcodec/celp_math.h b/deps/libav/libavcodec/celp_math.h
deleted file mode 100644
index ed3f8c0..0000000
--- a/deps/libav/libavcodec/celp_math.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Various fixed-point math operations
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_CELP_MATH_H
-#define AVCODEC_CELP_MATH_H
-
-#include <stdint.h>
-
-/**
- * fixed-point implementation of exp2(x) in [0; 1] domain.
- * @param power argument to exp2, 0 <= power <= 0x7fff
- *
- * @return value of (1<<20) * exp2(power / (1<<15))
- *         0x8000c <= result <= 0xfffea
- */
-int ff_exp2(uint16_t power);
-
-/**
- * Calculate log2(x).
- * @param value function argument, 0 < value <= 7fff ffff
- *
- * @return value of (1<<15) * log2(value)
- */
-int ff_log2_q15(uint32_t value);
-
-/**
- * Shift value left or right depending on sign of offset parameter.
- * @param value value to shift
- * @param offset shift offset
- *
- * @return value << offset, if offset>=0; value >> -offset - otherwise
- */
-static inline int bidir_sal(int value, int offset)
-{
-    if(offset < 0) return value >> -offset;
-    else           return value <<  offset;
-}
-
-#endif /* AVCODEC_CELP_MATH_H */
diff --git a/deps/libav/libavcodec/cga_data.c b/deps/libav/libavcodec/cga_data.c
deleted file mode 100644
index 2c63ff2..0000000
--- a/deps/libav/libavcodec/cga_data.c
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * CGA/EGA/VGA ROM data
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * CGA/EGA/VGA ROM data
- */
-
-#include <stdint.h>
-#include "cga_data.h"
-
-const uint8_t ff_cga_font[2048] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e,
- 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00,
- 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x38, 0x7c, 0x38, 0xfe, 0xfe, 0x7c, 0x38, 0x7c,
- 0x10, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x7c, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00,
- 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
- 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0x0f, 0x07, 0x0f, 0x7d, 0xcc, 0xcc, 0xcc, 0x78,
- 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x70, 0xf0, 0xe0,
- 0x7f, 0x63, 0x7f, 0x63, 0x63, 0x67, 0xe6, 0xc0, 0x99, 0x5a, 0x3c, 0xe7, 0xe7, 0x3c, 0x5a, 0x99,
- 0x80, 0xe0, 0xf8, 0xfe, 0xf8, 0xe0, 0x80, 0x00, 0x02, 0x0e, 0x3e, 0xfe, 0x3e, 0x0e, 0x02, 0x00,
- 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00,
- 0x7f, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x00, 0x3e, 0x63, 0x38, 0x6c, 0x6c, 0x38, 0xcc, 0x78,
- 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x7e, 0x3c, 0x18, 0xff,
- 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00,
- 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00,
- 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00,
- 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x78, 0x78, 0x30, 0x30, 0x00, 0x30, 0x00,
- 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0xfe, 0x6c, 0x6c, 0x00,
- 0x30, 0x7c, 0xc0, 0x78, 0x0c, 0xf8, 0x30, 0x00, 0x00, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xc6, 0x00,
- 0x38, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0x76, 0x00, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00, 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00,
- 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00,
- 0x7c, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0x7c, 0x00, 0x30, 0x70, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x00,
- 0x78, 0xcc, 0x0c, 0x38, 0x60, 0xcc, 0xfc, 0x00, 0x78, 0xcc, 0x0c, 0x38, 0x0c, 0xcc, 0x78, 0x00,
- 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x1e, 0x00, 0xfc, 0xc0, 0xf8, 0x0c, 0x0c, 0xcc, 0x78, 0x00,
- 0x38, 0x60, 0xc0, 0xf8, 0xcc, 0xcc, 0x78, 0x00, 0xfc, 0xcc, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x00,
- 0x78, 0xcc, 0xcc, 0x78, 0xcc, 0xcc, 0x78, 0x00, 0x78, 0xcc, 0xcc, 0x7c, 0x0c, 0x18, 0x70, 0x00,
- 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x60,
- 0x18, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0xfc, 0x00, 0x00,
- 0x60, 0x30, 0x18, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x78, 0xcc, 0x0c, 0x18, 0x30, 0x00, 0x30, 0x00,
- 0x7c, 0xc6, 0xde, 0xde, 0xde, 0xc0, 0x78, 0x00, 0x30, 0x78, 0xcc, 0xcc, 0xfc, 0xcc, 0xcc, 0x00,
- 0xfc, 0x66, 0x66, 0x7c, 0x66, 0x66, 0xfc, 0x00, 0x3c, 0x66, 0xc0, 0xc0, 0xc0, 0x66, 0x3c, 0x00,
- 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0xfe, 0x62, 0x68, 0x78, 0x68, 0x62, 0xfe, 0x00,
- 0xfe, 0x62, 0x68, 0x78, 0x68, 0x60, 0xf0, 0x00, 0x3c, 0x66, 0xc0, 0xc0, 0xce, 0x66, 0x3e, 0x00,
- 0xcc, 0xcc, 0xcc, 0xfc, 0xcc, 0xcc, 0xcc, 0x00, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00,
- 0x1e, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x78, 0x00, 0xe6, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0xe6, 0x00,
- 0xf0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0x00,
- 0xc6, 0xe6, 0xf6, 0xde, 0xce, 0xc6, 0xc6, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x00,
- 0xfc, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xdc, 0x78, 0x1c, 0x00,
- 0xfc, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0xe6, 0x00, 0x78, 0xcc, 0xe0, 0x70, 0x1c, 0xcc, 0x78, 0x00,
- 0xfc, 0xb4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xfc, 0x00,
- 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xd6, 0xfe, 0xee, 0xc6, 0x00,
- 0xc6, 0xc6, 0x6c, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x30, 0x78, 0x00,
- 0xfe, 0xc6, 0x8c, 0x18, 0x32, 0x66, 0xfe, 0x00, 0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00,
- 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x02, 0x00, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00,
- 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
- 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0x76, 0x00,
- 0xe0, 0x60, 0x60, 0x7c, 0x66, 0x66, 0xdc, 0x00, 0x00, 0x00, 0x78, 0xcc, 0xc0, 0xcc, 0x78, 0x00,
- 0x1c, 0x0c, 0x0c, 0x7c, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x78, 0xcc, 0xfc, 0xc0, 0x78, 0x00,
- 0x38, 0x6c, 0x60, 0xf0, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0x7c, 0x0c, 0xf8,
- 0xe0, 0x60, 0x6c, 0x76, 0x66, 0x66, 0xe6, 0x00, 0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
- 0x0c, 0x00, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x78, 0xe0, 0x60, 0x66, 0x6c, 0x78, 0x6c, 0xe6, 0x00,
- 0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0xcc, 0xfe, 0xfe, 0xd6, 0xc6, 0x00,
- 0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0x78, 0x00,
- 0x00, 0x00, 0xdc, 0x66, 0x66, 0x7c, 0x60, 0xf0, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0x7c, 0x0c, 0x1e,
- 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x7c, 0xc0, 0x78, 0x0c, 0xf8, 0x00,
- 0x10, 0x30, 0x7c, 0x30, 0x30, 0x34, 0x18, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00,
- 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xfe, 0xfe, 0x6c, 0x00,
- 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xf8,
- 0x00, 0x00, 0xfc, 0x98, 0x30, 0x64, 0xfc, 0x00, 0x1c, 0x30, 0x30, 0xe0, 0x30, 0x30, 0x1c, 0x00,
- 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0xe0, 0x30, 0x30, 0x1c, 0x30, 0x30, 0xe0, 0x00,
- 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0x00,
- 0x78, 0xcc, 0xc0, 0xcc, 0x78, 0x18, 0x0c, 0x78, 0x00, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0x7e, 0x00,
- 0x1c, 0x00, 0x78, 0xcc, 0xfc, 0xc0, 0x78, 0x00, 0x7e, 0xc3, 0x3c, 0x06, 0x3e, 0x66, 0x3f, 0x00,
- 0xcc, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0x7e, 0x00, 0xe0, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0x7e, 0x00,
- 0x30, 0x30, 0x78, 0x0c, 0x7c, 0xcc, 0x7e, 0x00, 0x00, 0x00, 0x78, 0xc0, 0xc0, 0x78, 0x0c, 0x38,
- 0x7e, 0xc3, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, 0xcc, 0x00, 0x78, 0xcc, 0xfc, 0xc0, 0x78, 0x00,
- 0xe0, 0x00, 0x78, 0xcc, 0xfc, 0xc0, 0x78, 0x00, 0xcc, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
- 0x7c, 0xc6, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x00, 0xe0, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
- 0xc6, 0x38, 0x6c, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x30, 0x30, 0x00, 0x78, 0xcc, 0xfc, 0xcc, 0x00,
- 0x1c, 0x00, 0xfc, 0x60, 0x78, 0x60, 0xfc, 0x00, 0x00, 0x00, 0x7f, 0x0c, 0x7f, 0xcc, 0x7f, 0x00,
- 0x3e, 0x6c, 0xcc, 0xfe, 0xcc, 0xcc, 0xce, 0x00, 0x78, 0xcc, 0x00, 0x78, 0xcc, 0xcc, 0x78, 0x00,
- 0x00, 0xcc, 0x00, 0x78, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0xe0, 0x00, 0x78, 0xcc, 0xcc, 0x78, 0x00,
- 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0x7e, 0x00, 0x00, 0xe0, 0x00, 0xcc, 0xcc, 0xcc, 0x7e, 0x00,
- 0x00, 0xcc, 0x00, 0xcc, 0xcc, 0x7c, 0x0c, 0xf8, 0xc3, 0x18, 0x3c, 0x66, 0x66, 0x3c, 0x18, 0x00,
- 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x18, 0x18, 0x7e, 0xc0, 0xc0, 0x7e, 0x18, 0x18,
- 0x38, 0x6c, 0x64, 0xf0, 0x60, 0xe6, 0xfc, 0x00, 0xcc, 0xcc, 0x78, 0xfc, 0x30, 0xfc, 0x30, 0x30,
- 0xf8, 0xcc, 0xcc, 0xfa, 0xc6, 0xcf, 0xc6, 0xc7, 0x0e, 0x1b, 0x18, 0x3c, 0x18, 0x18, 0xd8, 0x70,
- 0x1c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0x7e, 0x00, 0x38, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00,
- 0x00, 0x1c, 0x00, 0x78, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x1c, 0x00, 0xcc, 0xcc, 0xcc, 0x7e, 0x00,
- 0x00, 0xf8, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0x00, 0xfc, 0x00, 0xcc, 0xec, 0xfc, 0xdc, 0xcc, 0x00,
- 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x7c, 0x00, 0x00,
- 0x30, 0x00, 0x30, 0x60, 0xc0, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xc0, 0xc0, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xfc, 0x0c, 0x0c, 0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xde, 0x33, 0x66, 0xcc, 0x0f,
- 0xc3, 0xc6, 0xcc, 0xdb, 0x37, 0x6f, 0xcf, 0x03, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00,
- 0x00, 0x33, 0x66, 0xcc, 0x66, 0x33, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x33, 0x66, 0xcc, 0x00, 0x00,
- 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
- 0xdb, 0x77, 0xdb, 0xee, 0xdb, 0x77, 0xdb, 0xee, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18,
- 0x36, 0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36,
- 0x00, 0x00, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x36, 0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0xfe, 0x06, 0xf6, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00,
- 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0xf7, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
- 0x36, 0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
- 0x36, 0x36, 0x36, 0x36, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, 0x00, 0x00, 0x00,
- 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36,
- 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
- 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x76, 0xdc, 0xc8, 0xdc, 0x76, 0x00, 0x00, 0x78, 0xcc, 0xf8, 0xcc, 0xf8, 0xc0, 0xc0,
- 0x00, 0xfc, 0xcc, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00,
- 0xfc, 0xcc, 0x60, 0x30, 0x60, 0xcc, 0xfc, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, 0xd8, 0x70, 0x00,
- 0x00, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0xc0, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x00,
- 0xfc, 0x30, 0x78, 0xcc, 0xcc, 0x78, 0x30, 0xfc, 0x38, 0x6c, 0xc6, 0xfe, 0xc6, 0x6c, 0x38, 0x00,
- 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x6c, 0xee, 0x00, 0x1c, 0x30, 0x18, 0x7c, 0xcc, 0xcc, 0x78, 0x00,
- 0x00, 0x00, 0x7e, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x06, 0x0c, 0x7e, 0xdb, 0xdb, 0x7e, 0x60, 0xc0,
- 0x38, 0x60, 0xc0, 0xf8, 0xc0, 0x60, 0x38, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x00,
- 0x00, 0xfc, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0x00, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x00, 0xfc, 0x00,
- 0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0xfc, 0x00, 0x18, 0x30, 0x60, 0x30, 0x18, 0x00, 0xfc, 0x00,
- 0x0e, 0x1b, 0x1b, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0x70,
- 0x30, 0x30, 0x00, 0xfc, 0x00, 0x30, 0x30, 0x00, 0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00,
- 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x3c, 0x1c,
- 0x78, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x70, 0x18, 0x30, 0x60, 0x78, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-const uint8_t ff_vga16_font[4096] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x18, 0x18, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xdb, 0xdb, 0xc3, 0xc3, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, 0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x0c, 0x0e, 0x00, 0x00,
- 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, 0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
- 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00,
- 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00,
- 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00,
- 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x10, 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x38, 0x6c, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06, 0x3c, 0x00, 0x00, 0x00,
- 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x18, 0x3c, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
- 0x38, 0x6c, 0x38, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b, 0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc6, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00,
- 0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x18, 0x18, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xfc, 0x66, 0x66, 0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, 0x00, 0x00,
- 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x0c, 0x18, 0x30, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x76, 0xdc, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
- 0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06, 0x0c, 0x1f, 0x00, 0x00,
- 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00,
- 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
- 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
- 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
- 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60, 0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
- 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-const uint32_t ff_cga_palette[16] = {
-    0x000000, 0x0000AA, 0x00AA00, 0x00AAAA, 0xAA0000, 0xAA00AA, 0xAA5500, 0xAAAAAA,
-    0x555555, 0x5555FF, 0x55FF55, 0x55FFFF, 0xFF5555, 0xFF55FF, 0xFFFF55, 0xFFFFFF,
-};
-
-const uint32_t ff_ega_palette[64] = {
-    0x000000, 0x0000AA, 0x00AA00, 0x00AAAA, 0xAA0000, 0xAA00AA, 0xAAAA00, 0xAAAAAA,
-    0x000055, 0x0000FF, 0x00AA55, 0x00AAFF, 0xAA0055, 0xAA00FF, 0xAAAA55, 0xAAAAFF,
-    0x005500, 0x0055AA, 0x00FF00, 0x00FFAA, 0xAA5500, 0xAA55AA, 0xAAFF00, 0xAAFFAA,
-    0x005555, 0x0055FF, 0x00FF55, 0x00FFFF, 0xAA5555, 0xAA55FF, 0xAAFF55, 0xAAFFFF,
-    0x550000, 0x5500AA, 0x55AA00, 0x55AAAA, 0xFF0000, 0xFF00AA, 0xFFAA00, 0xFFAAAA,
-    0x550055, 0x5500FF, 0x55AA55, 0x55AAFF, 0xFF0055, 0xFF00FF, 0xFFAA55, 0xFFAAFF,
-    0x555500, 0x5555AA, 0x55FF00, 0x55FFAA, 0xFF5500, 0xFF55AA, 0xFFFF00, 0xFFFFAA,
-    0x555555, 0x5555FF, 0x55FF55, 0x55FFFF, 0xFF5555, 0xFF55FF, 0xFFFF55, 0xFFFFFF
-};
-
-void ff_draw_pc_font(uint8_t *dst, int linesize, const uint8_t *font, int font_height, int ch, int fg, int bg)
-{
-    int char_y, mask;
-    for (char_y = 0; char_y < font_height; char_y++) {
-        for (mask = 0x80; mask; mask >>= 1) {
-            *dst++ = font[ch * font_height + char_y] & mask ? fg : bg;
-        }
-        dst += linesize - 8;
-    }
-}
diff --git a/deps/libav/libavcodec/cga_data.h b/deps/libav/libavcodec/cga_data.h
deleted file mode 100644
index 2149cfd..0000000
--- a/deps/libav/libavcodec/cga_data.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * CGA/EGA/VGA ROM data
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * CGA/EGA/VGA ROM data
- */
-
-#ifndef AVCODEC_CGA_DATA_H
-#define AVCODEC_CGA_DATA_H
-
-#include <stdint.h>
-
-extern const uint8_t ff_cga_font[2048];
-extern const uint8_t ff_vga16_font[4096];
-extern const uint32_t ff_cga_palette[16];
-extern const uint32_t ff_ega_palette[64];
-
-/**
- * Draw CGA/EGA/VGA font to 8-bit pixel buffer
- *
- * @param dst Destination pixel buffer
- * @param linesize Linesize (pixels)
- * @param font Font table. We assume font width is always 8 pixels wide.
- * @param font_height Font height (pixels)
- * @param fg,bg Foreground and background palette index
- * @param ch Character to draw
- */
-void ff_draw_pc_font(uint8_t *dst, int linesize, const uint8_t *font, int font_height, int ch, int fg, int bg);
-
-#endif /* AVCODEC_CGA_DATA_H */
diff --git a/deps/libav/libavcodec/chomp_bsf.c b/deps/libav/libavcodec/chomp_bsf.c
deleted file mode 100644
index 9ed7496..0000000
--- a/deps/libav/libavcodec/chomp_bsf.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Chomp bitstream filter
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "internal.h"
-
-static int chomp_filter(AVBitStreamFilterContext *bsfc,
-                        AVCodecContext *avctx, const char *args,
-                        uint8_t  **poutbuf, int *poutbuf_size,
-                        const uint8_t *buf, int      buf_size,
-                        int keyframe)
-{
-    while (buf_size > 0 && !buf[buf_size-1])
-        buf_size--;
-
-    *poutbuf = (uint8_t*) buf;
-    *poutbuf_size = buf_size;
-
-    return 0;
-}
-
-/**
- * This filter removes a string of NULL bytes from the end of a packet.
- */
-AVBitStreamFilter ff_chomp_bsf = {
-    "chomp",
-    0,
-    chomp_filter,
-};
diff --git a/deps/libav/libavcodec/cinepak.c b/deps/libav/libavcodec/cinepak.c
deleted file mode 100644
index caf14cb..0000000
--- a/deps/libav/libavcodec/cinepak.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Cinepak Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Cinepak video decoder
- * @author Ewald Snel <ewald at rambo.its.tudelft.nl>
- *
- * @see For more information on the Cinepak algorithm, visit:
- *   http://www.csse.monash.edu.au/~timf/
- * @see For more information on the quirky data inside Sega FILM/CPK files, visit:
- *   http://wiki.multimedia.cx/index.php?title=Sega_FILM
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-
-typedef struct {
-    uint8_t  y0, y1, y2, y3;
-    uint8_t  u, v;
-} cvid_codebook;
-
-#define MAX_STRIPS      32
-
-typedef struct {
-    uint16_t          id;
-    uint16_t          x1, y1;
-    uint16_t          x2, y2;
-    cvid_codebook     v4_codebook[256];
-    cvid_codebook     v1_codebook[256];
-} cvid_strip;
-
-typedef struct CinepakContext {
-
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    const unsigned char *data;
-    int size;
-
-    int width, height;
-
-    int palette_video;
-    cvid_strip strips[MAX_STRIPS];
-
-    int sega_film_skip_bytes;
-
-    uint32_t pal[256];
-} CinepakContext;
-
-static void cinepak_decode_codebook (cvid_codebook *codebook,
-                                     int chunk_id, int size, const uint8_t *data)
-{
-    const uint8_t *eod = (data + size);
-    uint32_t flag, mask;
-    int      i, n;
-
-    /* check if this chunk contains 4- or 6-element vectors */
-    n    = (chunk_id & 0x04) ? 4 : 6;
-    flag = 0;
-    mask = 0;
-
-    for (i=0; i < 256; i++) {
-        if ((chunk_id & 0x01) && !(mask >>= 1)) {
-            if ((data + 4) > eod)
-                break;
-
-            flag  = AV_RB32 (data);
-            data += 4;
-            mask  = 0x80000000;
-        }
-
-        if (!(chunk_id & 0x01) || (flag & mask)) {
-            if ((data + n) > eod)
-                break;
-
-            if (n == 6) {
-                codebook[i].y0 = *data++;
-                codebook[i].y1 = *data++;
-                codebook[i].y2 = *data++;
-                codebook[i].y3 = *data++;
-                codebook[i].u  = 128 + *data++;
-                codebook[i].v  = 128 + *data++;
-            } else {
-                /* this codebook type indicates either greyscale or
-                 * palettized video; if palettized, U & V components will
-                 * not be used so it is safe to set them to 128 for the
-                 * benefit of greyscale rendering in YUV420P */
-                codebook[i].y0 = *data++;
-                codebook[i].y1 = *data++;
-                codebook[i].y2 = *data++;
-                codebook[i].y3 = *data++;
-                codebook[i].u  = 128;
-                codebook[i].v  = 128;
-            }
-        }
-    }
-}
-
-static int cinepak_decode_vectors (CinepakContext *s, cvid_strip *strip,
-                                   int chunk_id, int size, const uint8_t *data)
-{
-    const uint8_t   *eod = (data + size);
-    uint32_t         flag, mask;
-    cvid_codebook   *codebook;
-    unsigned int     x, y;
-    uint32_t         iy[4];
-    uint32_t         iu[2];
-    uint32_t         iv[2];
-
-    flag = 0;
-    mask = 0;
-
-    for (y=strip->y1; y < strip->y2; y+=4) {
-
-        iy[0] = strip->x1 + (y * s->frame->linesize[0]);
-        iy[1] = iy[0] + s->frame->linesize[0];
-        iy[2] = iy[1] + s->frame->linesize[0];
-        iy[3] = iy[2] + s->frame->linesize[0];
-        iu[0] = (strip->x1/2) + ((y/2) * s->frame->linesize[1]);
-        iu[1] = iu[0] + s->frame->linesize[1];
-        iv[0] = (strip->x1/2) + ((y/2) * s->frame->linesize[2]);
-        iv[1] = iv[0] + s->frame->linesize[2];
-
-        for (x=strip->x1; x < strip->x2; x+=4) {
-            if ((chunk_id & 0x01) && !(mask >>= 1)) {
-                if ((data + 4) > eod)
-                    return AVERROR_INVALIDDATA;
-
-                flag  = AV_RB32 (data);
-                data += 4;
-                mask  = 0x80000000;
-            }
-
-            if (!(chunk_id & 0x01) || (flag & mask)) {
-                if (!(chunk_id & 0x02) && !(mask >>= 1)) {
-                    if ((data + 4) > eod)
-                        return AVERROR_INVALIDDATA;
-
-                    flag  = AV_RB32 (data);
-                    data += 4;
-                    mask  = 0x80000000;
-                }
-
-                if ((chunk_id & 0x02) || (~flag & mask)) {
-                    if (data >= eod)
-                        return AVERROR_INVALIDDATA;
-
-                    codebook = &strip->v1_codebook[*data++];
-                    s->frame->data[0][iy[0] + 0] = codebook->y0;
-                    s->frame->data[0][iy[0] + 1] = codebook->y0;
-                    s->frame->data[0][iy[1] + 0] = codebook->y0;
-                    s->frame->data[0][iy[1] + 1] = codebook->y0;
-                    if (!s->palette_video) {
-                        s->frame->data[1][iu[0]] = codebook->u;
-                        s->frame->data[2][iv[0]] = codebook->v;
-                    }
-
-                    s->frame->data[0][iy[0] + 2] = codebook->y1;
-                    s->frame->data[0][iy[0] + 3] = codebook->y1;
-                    s->frame->data[0][iy[1] + 2] = codebook->y1;
-                    s->frame->data[0][iy[1] + 3] = codebook->y1;
-                    if (!s->palette_video) {
-                        s->frame->data[1][iu[0] + 1] = codebook->u;
-                        s->frame->data[2][iv[0] + 1] = codebook->v;
-                    }
-
-                    s->frame->data[0][iy[2] + 0] = codebook->y2;
-                    s->frame->data[0][iy[2] + 1] = codebook->y2;
-                    s->frame->data[0][iy[3] + 0] = codebook->y2;
-                    s->frame->data[0][iy[3] + 1] = codebook->y2;
-                    if (!s->palette_video) {
-                        s->frame->data[1][iu[1]] = codebook->u;
-                        s->frame->data[2][iv[1]] = codebook->v;
-                    }
-
-                    s->frame->data[0][iy[2] + 2] = codebook->y3;
-                    s->frame->data[0][iy[2] + 3] = codebook->y3;
-                    s->frame->data[0][iy[3] + 2] = codebook->y3;
-                    s->frame->data[0][iy[3] + 3] = codebook->y3;
-                    if (!s->palette_video) {
-                        s->frame->data[1][iu[1] + 1] = codebook->u;
-                        s->frame->data[2][iv[1] + 1] = codebook->v;
-                    }
-
-                } else if (flag & mask) {
-                    if ((data + 4) > eod)
-                        return AVERROR_INVALIDDATA;
-
-                    codebook = &strip->v4_codebook[*data++];
-                    s->frame->data[0][iy[0] + 0] = codebook->y0;
-                    s->frame->data[0][iy[0] + 1] = codebook->y1;
-                    s->frame->data[0][iy[1] + 0] = codebook->y2;
-                    s->frame->data[0][iy[1] + 1] = codebook->y3;
-                    if (!s->palette_video) {
-                        s->frame->data[1][iu[0]] = codebook->u;
-                        s->frame->data[2][iv[0]] = codebook->v;
-                    }
-
-                    codebook = &strip->v4_codebook[*data++];
-                    s->frame->data[0][iy[0] + 2] = codebook->y0;
-                    s->frame->data[0][iy[0] + 3] = codebook->y1;
-                    s->frame->data[0][iy[1] + 2] = codebook->y2;
-                    s->frame->data[0][iy[1] + 3] = codebook->y3;
-                    if (!s->palette_video) {
-                        s->frame->data[1][iu[0] + 1] = codebook->u;
-                        s->frame->data[2][iv[0] + 1] = codebook->v;
-                    }
-
-                    codebook = &strip->v4_codebook[*data++];
-                    s->frame->data[0][iy[2] + 0] = codebook->y0;
-                    s->frame->data[0][iy[2] + 1] = codebook->y1;
-                    s->frame->data[0][iy[3] + 0] = codebook->y2;
-                    s->frame->data[0][iy[3] + 1] = codebook->y3;
-                    if (!s->palette_video) {
-                        s->frame->data[1][iu[1]] = codebook->u;
-                        s->frame->data[2][iv[1]] = codebook->v;
-                    }
-
-                    codebook = &strip->v4_codebook[*data++];
-                    s->frame->data[0][iy[2] + 2] = codebook->y0;
-                    s->frame->data[0][iy[2] + 3] = codebook->y1;
-                    s->frame->data[0][iy[3] + 2] = codebook->y2;
-                    s->frame->data[0][iy[3] + 3] = codebook->y3;
-                    if (!s->palette_video) {
-                        s->frame->data[1][iu[1] + 1] = codebook->u;
-                        s->frame->data[2][iv[1] + 1] = codebook->v;
-                    }
-
-                }
-            }
-
-            iy[0] += 4;  iy[1] += 4;
-            iy[2] += 4;  iy[3] += 4;
-            iu[0] += 2;  iu[1] += 2;
-            iv[0] += 2;  iv[1] += 2;
-        }
-    }
-
-    return 0;
-}
-
-static int cinepak_decode_strip (CinepakContext *s,
-                                 cvid_strip *strip, const uint8_t *data, int size)
-{
-    const uint8_t *eod = (data + size);
-    int      chunk_id, chunk_size;
-
-    /* coordinate sanity checks */
-    if (strip->x2 > s->width   ||
-        strip->y2 > s->height  ||
-        strip->x1 >= strip->x2 || strip->y1 >= strip->y2)
-        return AVERROR_INVALIDDATA;
-
-    while ((data + 4) <= eod) {
-        chunk_id   = data[0];
-        chunk_size = AV_RB24 (&data[1]) - 4;
-        if(chunk_size < 0)
-            return AVERROR_INVALIDDATA;
-
-        data      += 4;
-        chunk_size = ((data + chunk_size) > eod) ? (eod - data) : chunk_size;
-
-        switch (chunk_id) {
-
-        case 0x20:
-        case 0x21:
-        case 0x24:
-        case 0x25:
-            cinepak_decode_codebook (strip->v4_codebook, chunk_id,
-                chunk_size, data);
-            break;
-
-        case 0x22:
-        case 0x23:
-        case 0x26:
-        case 0x27:
-            cinepak_decode_codebook (strip->v1_codebook, chunk_id,
-                chunk_size, data);
-            break;
-
-        case 0x30:
-        case 0x31:
-        case 0x32:
-            return cinepak_decode_vectors (s, strip, chunk_id,
-                chunk_size, data);
-        }
-
-        data += chunk_size;
-    }
-
-    return AVERROR_INVALIDDATA;
-}
-
-static int cinepak_decode (CinepakContext *s)
-{
-    const uint8_t  *eod = (s->data + s->size);
-    int           i, result, strip_size, frame_flags, num_strips;
-    int           y0 = 0;
-    int           encoded_buf_size;
-
-    if (s->size < 10)
-        return AVERROR_INVALIDDATA;
-
-    frame_flags = s->data[0];
-    num_strips  = AV_RB16 (&s->data[8]);
-    encoded_buf_size = AV_RB24(&s->data[1]);
-
-    /* if this is the first frame, check for deviant Sega FILM data */
-    if (s->sega_film_skip_bytes == -1) {
-        if (!encoded_buf_size) {
-            avpriv_request_sample(s->avctx, "encoded_buf_size 0");
-            return AVERROR_PATCHWELCOME;
-        }
-        if (encoded_buf_size != s->size && (s->size % encoded_buf_size) != 0) {
-            /* If the encoded frame size differs from the frame size as indicated
-             * by the container file, this data likely comes from a Sega FILM/CPK file.
-             * If the frame header is followed by the bytes FE 00 00 06 00 00 then
-             * this is probably one of the two known files that have 6 extra bytes
-             * after the frame header. Else, assume 2 extra bytes. The container
-             * size also cannot be a multiple of the encoded size. */
-            if (s->size >= 16 &&
-                (s->data[10] == 0xFE) &&
-                (s->data[11] == 0x00) &&
-                (s->data[12] == 0x00) &&
-                (s->data[13] == 0x06) &&
-                (s->data[14] == 0x00) &&
-                (s->data[15] == 0x00))
-                s->sega_film_skip_bytes = 6;
-            else
-                s->sega_film_skip_bytes = 2;
-        } else
-            s->sega_film_skip_bytes = 0;
-    }
-
-    s->data += 10 + s->sega_film_skip_bytes;
-
-    num_strips = FFMIN(num_strips, MAX_STRIPS);
-
-    for (i=0; i < num_strips; i++) {
-        if ((s->data + 12) > eod)
-            return AVERROR_INVALIDDATA;
-
-        s->strips[i].id = s->data[0];
-        s->strips[i].y1 = y0;
-        s->strips[i].x1 = 0;
-        s->strips[i].y2 = y0 + AV_RB16 (&s->data[8]);
-        s->strips[i].x2 = s->avctx->width;
-
-        strip_size = AV_RB24 (&s->data[1]) - 12;
-        if (strip_size < 0)
-            return AVERROR_INVALIDDATA;
-        s->data   += 12;
-        strip_size = ((s->data + strip_size) > eod) ? (eod - s->data) : strip_size;
-
-        if ((i > 0) && !(frame_flags & 0x01)) {
-            memcpy (s->strips[i].v4_codebook, s->strips[i-1].v4_codebook,
-                sizeof(s->strips[i].v4_codebook));
-            memcpy (s->strips[i].v1_codebook, s->strips[i-1].v1_codebook,
-                sizeof(s->strips[i].v1_codebook));
-        }
-
-        result = cinepak_decode_strip (s, &s->strips[i], s->data, strip_size);
-
-        if (result != 0)
-            return result;
-
-        s->data += strip_size;
-        y0    = s->strips[i].y2;
-    }
-    return 0;
-}
-
-static av_cold int cinepak_decode_init(AVCodecContext *avctx)
-{
-    CinepakContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    s->width = (avctx->width + 3) & ~3;
-    s->height = (avctx->height + 3) & ~3;
-    s->sega_film_skip_bytes = -1;  /* uninitialized state */
-
-    // check for paletted data
-    if (avctx->bits_per_coded_sample != 8) {
-        s->palette_video = 0;
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    } else {
-        s->palette_video = 1;
-        avctx->pix_fmt = AV_PIX_FMT_PAL8;
-    }
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int cinepak_decode_frame(AVCodecContext *avctx,
-                                void *data, int *got_frame,
-                                AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int ret = 0, buf_size = avpkt->size;
-    CinepakContext *s = avctx->priv_data;
-
-    s->data = buf;
-    s->size = buf_size;
-
-    if ((ret = ff_reget_buffer(avctx, s->frame))) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    if (s->palette_video) {
-        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-        if (pal) {
-            s->frame->palette_has_changed = 1;
-            memcpy(s->pal, pal, AVPALETTE_SIZE);
-        }
-    }
-
-    cinepak_decode(s);
-
-    if (s->palette_video)
-        memcpy (s->frame->data[1], s->pal, AVPALETTE_SIZE);
-
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    /* report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int cinepak_decode_end(AVCodecContext *avctx)
-{
-    CinepakContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_cinepak_decoder = {
-    .name           = "cinepak",
-    .long_name      = NULL_IF_CONFIG_SMALL("Cinepak"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CINEPAK,
-    .priv_data_size = sizeof(CinepakContext),
-    .init           = cinepak_decode_init,
-    .close          = cinepak_decode_end,
-    .decode         = cinepak_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/cljr.c b/deps/libav/libavcodec/cljr.c
deleted file mode 100644
index ad0f729..0000000
--- a/deps/libav/libavcodec/cljr.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Cirrus Logic AccuPak (CLJR) codec
- * Copyright (c) 2003 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Cirrus Logic AccuPak codec.
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "put_bits.h"
-
-#if CONFIG_CLJR_DECODER
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    GetBitContext gb;
-    AVFrame * const p = data;
-    int x, y, ret;
-
-    if (avctx->height <= 0 || avctx->width <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid width or height\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (buf_size < avctx->height * avctx->width) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Resolution larger than buffer size. Invalid header?\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->key_frame = 1;
-
-    init_get_bits(&gb, buf, buf_size * 8);
-
-    for (y = 0; y < avctx->height; y++) {
-        uint8_t *luma = &p->data[0][y * p->linesize[0]];
-        uint8_t *cb   = &p->data[1][y * p->linesize[1]];
-        uint8_t *cr   = &p->data[2][y * p->linesize[2]];
-        for (x = 0; x < avctx->width; x += 4) {
-            luma[3] = get_bits(&gb, 5) << 3;
-            luma[2] = get_bits(&gb, 5) << 3;
-            luma[1] = get_bits(&gb, 5) << 3;
-            luma[0] = get_bits(&gb, 5) << 3;
-            luma += 4;
-            *(cb++) = get_bits(&gb, 6) << 2;
-            *(cr++) = get_bits(&gb, 6) << 2;
-        }
-    }
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    avctx->pix_fmt = AV_PIX_FMT_YUV411P;
-    return 0;
-}
-
-AVCodec ff_cljr_decoder = {
-    .name           = "cljr",
-    .long_name      = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CLJR,
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
-
-#if CONFIG_CLJR_ENCODER
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static av_cold int encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *p, int *got_packet)
-{
-    PutBitContext pb;
-    int x, y, ret;
-
-    if ((ret = ff_alloc_packet(pkt, 32*avctx->height*avctx->width/4)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    init_put_bits(&pb, pkt->data, pkt->size);
-
-    for (y = 0; y < avctx->height; y++) {
-        uint8_t *luma = &p->data[0][y * p->linesize[0]];
-        uint8_t *cb   = &p->data[1][y * p->linesize[1]];
-        uint8_t *cr   = &p->data[2][y * p->linesize[2]];
-        for (x = 0; x < avctx->width; x += 4) {
-            put_bits(&pb, 5, luma[3] >> 3);
-            put_bits(&pb, 5, luma[2] >> 3);
-            put_bits(&pb, 5, luma[1] >> 3);
-            put_bits(&pb, 5, luma[0] >> 3);
-            luma += 4;
-            put_bits(&pb, 6, *(cb++) >> 2);
-            put_bits(&pb, 6, *(cr++) >> 2);
-        }
-    }
-
-    flush_put_bits(&pb);
-
-    pkt->size   = put_bits_count(&pb) / 8;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-AVCodec ff_cljr_encoder = {
-    .name           = "cljr",
-    .long_name      = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CLJR,
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P,
-                                                   AV_PIX_FMT_NONE },
-};
-#endif
diff --git a/deps/libav/libavcodec/cllc.c b/deps/libav/libavcodec/cllc.c
deleted file mode 100644
index 6818f9f..0000000
--- a/deps/libav/libavcodec/cllc.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- * Canopus Lossless Codec decoder
- *
- * Copyright (c) 2012-2013 Derek Buitenhuis
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "avcodec.h"
-#include "internal.h"
-
-typedef struct CLLCContext {
-    DSPContext dsp;
-    AVCodecContext *avctx;
-
-    uint8_t *swapped_buf;
-    int      swapped_buf_size;
-} CLLCContext;
-
-static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
-{
-    uint8_t symbols[256];
-    uint8_t bits[256];
-    uint16_t codes[256];
-    int num_lens, num_codes, num_codes_sum, prefix;
-    int i, j, count;
-
-    prefix        = 0;
-    count         = 0;
-    num_codes_sum = 0;
-
-    num_lens = get_bits(gb, 5);
-
-    for (i = 0; i < num_lens; i++) {
-        num_codes      = get_bits(gb, 9);
-        num_codes_sum += num_codes;
-
-        if (num_codes_sum > 256) {
-            vlc->table = NULL;
-
-            av_log(ctx->avctx, AV_LOG_ERROR,
-                   "Too many VLCs (%d) to be read.\n", num_codes_sum);
-            return AVERROR_INVALIDDATA;
-        }
-
-        for (j = 0; j < num_codes; j++) {
-            symbols[count] = get_bits(gb, 8);
-            bits[count]    = i + 1;
-            codes[count]   = prefix++;
-
-            count++;
-        }
-
-        prefix <<= 1;
-    }
-
-    return ff_init_vlc_sparse(vlc, 7, count, bits, 1, 1,
-                              codes, 2, 2, symbols, 1, 1, 0);
-}
-
-/*
- * Unlike the RGB24 read/restore, which reads in a component at a time,
- * ARGB read/restore reads in ARGB quads.
- */
-static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left,
-                          VLC *vlc, uint8_t *outbuf)
-{
-    uint8_t *dst;
-    int pred[4];
-    int code;
-    int i;
-
-    OPEN_READER(bits, gb);
-
-    dst     = outbuf;
-    pred[0] = top_left[0];
-    pred[1] = top_left[1];
-    pred[2] = top_left[2];
-    pred[3] = top_left[3];
-
-    for (i = 0; i < ctx->avctx->width; i++) {
-        /* Always get the alpha component */
-        UPDATE_CACHE(bits, gb);
-        GET_VLC(code, bits, gb, vlc[0].table, 7, 2);
-
-        pred[0] += code;
-        dst[0]   = pred[0];
-
-        /* Skip the components if they are  entirely transparent */
-        if (dst[0]) {
-            /* Red */
-            UPDATE_CACHE(bits, gb);
-            GET_VLC(code, bits, gb, vlc[1].table, 7, 2);
-
-            pred[1] += code;
-            dst[1]   = pred[1];
-
-            /* Green */
-            UPDATE_CACHE(bits, gb);
-            GET_VLC(code, bits, gb, vlc[2].table, 7, 2);
-
-            pred[2] += code;
-            dst[2]   = pred[2];
-
-            /* Blue */
-            UPDATE_CACHE(bits, gb);
-            GET_VLC(code, bits, gb, vlc[3].table, 7, 2);
-
-            pred[3] += code;
-            dst[3]   = pred[3];
-        } else {
-            dst[1] = 0;
-            dst[2] = 0;
-            dst[3] = 0;
-        }
-
-        dst += 4;
-    }
-
-    CLOSE_READER(bits, gb);
-
-    top_left[0]  = outbuf[0];
-
-    /* Only stash components if they are not transparent */
-    if (top_left[0]) {
-        top_left[1] = outbuf[1];
-        top_left[2] = outbuf[2];
-        top_left[3] = outbuf[3];
-    }
-
-    return 0;
-}
-
-static int read_rgb24_component_line(CLLCContext *ctx, GetBitContext *gb,
-                                     int *top_left, VLC *vlc, uint8_t *outbuf)
-{
-    uint8_t *dst;
-    int pred, code;
-    int i;
-
-    OPEN_READER(bits, gb);
-
-    dst  = outbuf;
-    pred = *top_left;
-
-    /* Simultaneously read and restore the line */
-    for (i = 0; i < ctx->avctx->width; i++) {
-        UPDATE_CACHE(bits, gb);
-        GET_VLC(code, bits, gb, vlc->table, 7, 2);
-
-        pred  += code;
-        dst[0] = pred;
-        dst   += 3;
-    }
-
-    CLOSE_READER(bits, gb);
-
-    /* Stash the first pixel */
-    *top_left = outbuf[0];
-
-    return 0;
-}
-
-static int read_yuv_component_line(CLLCContext *ctx, GetBitContext *gb,
-                                   int *top_left, VLC *vlc, uint8_t *outbuf,
-                                   int is_chroma)
-{
-    int pred, code;
-    int i;
-
-    OPEN_READER(bits, gb);
-
-    pred = *top_left;
-
-    /* Simultaneously read and restore the line */
-    for (i = 0; i < ctx->avctx->width >> is_chroma; i++) {
-        UPDATE_CACHE(bits, gb);
-        GET_VLC(code, bits, gb, vlc->table, 7, 2);
-
-        pred     += code;
-        outbuf[i] = pred;
-    }
-
-    CLOSE_READER(bits, gb);
-
-    /* Stash the first pixel */
-    *top_left = outbuf[0];
-
-    return 0;
-}
-
-static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
-{
-    AVCodecContext *avctx = ctx->avctx;
-    uint8_t *dst;
-    int pred[4];
-    int ret;
-    int i, j;
-    VLC vlc[4];
-
-    pred[0] = 0;
-    pred[1] = 0x80;
-    pred[2] = 0x80;
-    pred[3] = 0x80;
-
-    dst = pic->data[0];
-
-    skip_bits(gb, 16);
-
-    /* Read in code table for each plane */
-    for (i = 0; i < 4; i++) {
-        ret = read_code_table(ctx, gb, &vlc[i]);
-        if (ret < 0) {
-            for (j = 0; j <= i; j++)
-                ff_free_vlc(&vlc[j]);
-
-            av_log(ctx->avctx, AV_LOG_ERROR,
-                   "Could not read code table %d.\n", i);
-            return ret;
-        }
-    }
-
-    /* Read in and restore every line */
-    for (i = 0; i < avctx->height; i++) {
-        read_argb_line(ctx, gb, pred, vlc, dst);
-
-        dst += pic->linesize[0];
-    }
-
-    for (i = 0; i < 4; i++)
-        ff_free_vlc(&vlc[i]);
-
-    return 0;
-}
-
-static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
-{
-    AVCodecContext *avctx = ctx->avctx;
-    uint8_t *dst;
-    int pred[3];
-    int ret;
-    int i, j;
-    VLC vlc[3];
-
-    pred[0] = 0x80;
-    pred[1] = 0x80;
-    pred[2] = 0x80;
-
-    dst = pic->data[0];
-
-    skip_bits(gb, 16);
-
-    /* Read in code table for each plane */
-    for (i = 0; i < 3; i++) {
-        ret = read_code_table(ctx, gb, &vlc[i]);
-        if (ret < 0) {
-            for (j = 0; j <= i; j++)
-                ff_free_vlc(&vlc[j]);
-
-            av_log(ctx->avctx, AV_LOG_ERROR,
-                   "Could not read code table %d.\n", i);
-            return ret;
-        }
-    }
-
-    /* Read in and restore every line */
-    for (i = 0; i < avctx->height; i++) {
-        for (j = 0; j < 3; j++)
-            read_rgb24_component_line(ctx, gb, &pred[j], &vlc[j], &dst[j]);
-
-        dst += pic->linesize[0];
-    }
-
-    for (i = 0; i < 3; i++)
-        ff_free_vlc(&vlc[i]);
-
-    return 0;
-}
-
-static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
-{
-    AVCodecContext *avctx = ctx->avctx;
-    uint8_t block;
-    uint8_t *dst[3];
-    int pred[3];
-    int ret;
-    int i, j;
-    VLC vlc[2];
-
-    pred[0] = 0x80;
-    pred[1] = 0x80;
-    pred[2] = 0x80;
-
-    dst[0] = pic->data[0];
-    dst[1] = pic->data[1];
-    dst[2] = pic->data[2];
-
-    skip_bits(gb, 8);
-
-    block = get_bits(gb, 8);
-    if (block) {
-        avpriv_request_sample(ctx->avctx, "Blocked YUV");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* Read in code table for luma and chroma */
-    for (i = 0; i < 2; i++) {
-        ret = read_code_table(ctx, gb, &vlc[i]);
-        if (ret < 0) {
-            for (j = 0; j <= i; j++)
-                ff_free_vlc(&vlc[j]);
-
-            av_log(ctx->avctx, AV_LOG_ERROR,
-                   "Could not read code table %d.\n", i);
-            return ret;
-        }
-    }
-
-    /* Read in and restore every line */
-    for (i = 0; i < avctx->height; i++) {
-        read_yuv_component_line(ctx, gb, &pred[0], &vlc[0], dst[0], 0); /* Y */
-        read_yuv_component_line(ctx, gb, &pred[1], &vlc[1], dst[1], 1); /* U */
-        read_yuv_component_line(ctx, gb, &pred[2], &vlc[1], dst[2], 1); /* V */
-
-        for (j = 0; j < 3; j++)
-            dst[j] += pic->linesize[j];
-    }
-
-    for (i = 0; i < 2; i++)
-        ff_free_vlc(&vlc[i]);
-
-    return 0;
-}
-
-static int cllc_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_picture_ptr, AVPacket *avpkt)
-{
-    CLLCContext *ctx = avctx->priv_data;
-    AVFrame *pic = data;
-    uint8_t *src = avpkt->data;
-    uint32_t info_tag, info_offset;
-    int data_size;
-    GetBitContext gb;
-    int coding_type, ret;
-
-    /* Skip the INFO header if present */
-    info_offset = 0;
-    info_tag    = AV_RL32(src);
-    if (info_tag == MKTAG('I', 'N', 'F', 'O')) {
-        info_offset = AV_RL32(src + 4);
-        if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->size) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid INFO header offset: 0x%08X is too large.\n",
-                   info_offset);
-            return AVERROR_INVALIDDATA;
-        }
-
-        info_offset += 8;
-        src         += info_offset;
-
-        av_log(avctx, AV_LOG_DEBUG, "Skipping INFO chunk.\n");
-    }
-
-    data_size = (avpkt->size - info_offset) & ~1;
-
-    /* Make sure our bswap16'd buffer is big enough */
-    av_fast_padded_malloc(&ctx->swapped_buf,
-                          &ctx->swapped_buf_size, data_size);
-    if (!ctx->swapped_buf) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate swapped buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    /* bswap16 the buffer since CLLC's bitreader works in 16-bit words */
-    ctx->dsp.bswap16_buf((uint16_t *) ctx->swapped_buf, (uint16_t *) src,
-                         data_size / 2);
-
-    init_get_bits(&gb, ctx->swapped_buf, data_size * 8);
-
-    /*
-     * Read in coding type. The types are as follows:
-     *
-     * 0 - YUY2
-     * 1 - BGR24 (Triples)
-     * 2 - BGR24 (Quads)
-     * 3 - BGRA
-     */
-    coding_type = (AV_RL32(src) >> 8) & 0xFF;
-    av_log(avctx, AV_LOG_DEBUG, "Frame coding type: %d\n", coding_type);
-
-    switch (coding_type) {
-    case 0:
-        avctx->pix_fmt             = AV_PIX_FMT_YUV422P;
-        avctx->bits_per_raw_sample = 8;
-
-        ret = ff_get_buffer(avctx, pic, 0);
-        if (ret < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
-            return ret;
-        }
-
-        ret = decode_yuv_frame(ctx, &gb, pic);
-        if (ret < 0)
-            return ret;
-
-        break;
-    case 1:
-    case 2:
-        avctx->pix_fmt             = AV_PIX_FMT_RGB24;
-        avctx->bits_per_raw_sample = 8;
-
-        ret = ff_get_buffer(avctx, pic, 0);
-        if (ret < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
-            return ret;
-        }
-
-        ret = decode_rgb24_frame(ctx, &gb, pic);
-        if (ret < 0)
-            return ret;
-
-        break;
-    case 3:
-        avctx->pix_fmt             = AV_PIX_FMT_ARGB;
-        avctx->bits_per_raw_sample = 8;
-
-        ret = ff_get_buffer(avctx, pic, 0);
-        if (ret < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
-            return ret;
-        }
-
-        ret = decode_argb_frame(ctx, &gb, pic);
-        if (ret < 0)
-            return ret;
-
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown coding type: %d.\n", coding_type);
-        return AVERROR_INVALIDDATA;
-    }
-
-    pic->key_frame = 1;
-    pic->pict_type = AV_PICTURE_TYPE_I;
-
-    *got_picture_ptr = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int cllc_decode_close(AVCodecContext *avctx)
-{
-    CLLCContext *ctx = avctx->priv_data;
-
-    av_freep(&ctx->swapped_buf);
-
-    return 0;
-}
-
-static av_cold int cllc_decode_init(AVCodecContext *avctx)
-{
-    CLLCContext *ctx = avctx->priv_data;
-
-    /* Initialize various context values */
-    ctx->avctx            = avctx;
-    ctx->swapped_buf      = NULL;
-    ctx->swapped_buf_size = 0;
-
-    ff_dsputil_init(&ctx->dsp, avctx);
-
-    return 0;
-}
-
-AVCodec ff_cllc_decoder = {
-    .name           = "cllc",
-    .long_name      = NULL_IF_CONFIG_SMALL("Canopus Lossless Codec"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CLLC,
-    .priv_data_size = sizeof(CLLCContext),
-    .init           = cllc_decode_init,
-    .decode         = cllc_decode_frame,
-    .close          = cllc_decode_close,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/cngdec.c b/deps/libav/libavcodec/cngdec.c
deleted file mode 100644
index 89f5c81..0000000
--- a/deps/libav/libavcodec/cngdec.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * RFC 3389 comfort noise generator
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <math.h>
-
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "celp_filters.h"
-#include "internal.h"
-#include "libavutil/lfg.h"
-
-typedef struct CNGContext {
-    float *refl_coef, *target_refl_coef;
-    float *lpc_coef;
-    int order;
-    int energy, target_energy;
-    int inited;
-    float *filter_out;
-    float *excitation;
-    AVLFG lfg;
-} CNGContext;
-
-static av_cold int cng_decode_close(AVCodecContext *avctx)
-{
-    CNGContext *p = avctx->priv_data;
-    av_free(p->refl_coef);
-    av_free(p->target_refl_coef);
-    av_free(p->lpc_coef);
-    av_free(p->filter_out);
-    av_free(p->excitation);
-    return 0;
-}
-
-static av_cold int cng_decode_init(AVCodecContext *avctx)
-{
-    CNGContext *p = avctx->priv_data;
-
-    avctx->sample_fmt  = AV_SAMPLE_FMT_S16;
-    avctx->channels    = 1;
-    avctx->sample_rate = 8000;
-
-    p->order            = 12;
-    avctx->frame_size   = 640;
-    p->refl_coef        = av_mallocz(p->order * sizeof(*p->refl_coef));
-    p->target_refl_coef = av_mallocz(p->order * sizeof(*p->target_refl_coef));
-    p->lpc_coef         = av_mallocz(p->order * sizeof(*p->lpc_coef));
-    p->filter_out       = av_mallocz((avctx->frame_size + p->order) *
-                                     sizeof(*p->filter_out));
-    p->excitation       = av_mallocz(avctx->frame_size * sizeof(*p->excitation));
-    if (!p->refl_coef || !p->target_refl_coef || !p->lpc_coef ||
-        !p->filter_out || !p->excitation) {
-        cng_decode_close(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    av_lfg_init(&p->lfg, 0);
-
-    return 0;
-}
-
-static void make_lpc_coefs(float *lpc, const float *refl, int order)
-{
-    float buf[100];
-    float *next, *cur;
-    int m, i;
-    next = buf;
-    cur  = lpc;
-    for (m = 0; m < order; m++) {
-        next[m] = refl[m];
-        for (i = 0; i < m; i++)
-            next[i] = cur[i] + refl[m] * cur[m - i - 1];
-        FFSWAP(float*, next, cur);
-    }
-    if (cur != lpc)
-        memcpy(lpc, cur, sizeof(*lpc) * order);
-}
-
-static void cng_decode_flush(AVCodecContext *avctx)
-{
-    CNGContext *p = avctx->priv_data;
-    p->inited = 0;
-}
-
-static int cng_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    CNGContext *p = avctx->priv_data;
-    int buf_size  = avpkt->size;
-    int ret, i;
-    int16_t *buf_out;
-    float e = 1.0;
-    float scaling;
-
-    if (avpkt->size) {
-        int dbov = -avpkt->data[0];
-        p->target_energy = 1081109975 * pow(10, dbov / 10.0) * 0.75;
-        memset(p->target_refl_coef, 0, p->order * sizeof(*p->target_refl_coef));
-        for (i = 0; i < FFMIN(avpkt->size - 1, p->order); i++) {
-            p->target_refl_coef[i] = (avpkt->data[1 + i] - 127) / 128.0;
-        }
-    }
-
-    if (p->inited) {
-        p->energy = p->energy / 2 + p->target_energy / 2;
-        for (i = 0; i < p->order; i++)
-            p->refl_coef[i] = 0.6 *p->refl_coef[i] + 0.4 * p->target_refl_coef[i];
-    } else {
-        p->energy = p->target_energy;
-        memcpy(p->refl_coef, p->target_refl_coef, p->order * sizeof(*p->refl_coef));
-        p->inited = 1;
-    }
-    make_lpc_coefs(p->lpc_coef, p->refl_coef, p->order);
-
-    for (i = 0; i < p->order; i++)
-        e *= 1.0 - p->refl_coef[i]*p->refl_coef[i];
-
-    scaling = sqrt(e * p->energy / 1081109975);
-    for (i = 0; i < avctx->frame_size; i++) {
-        int r = (av_lfg_get(&p->lfg) & 0xffff) - 0x8000;
-        p->excitation[i] = scaling * r;
-    }
-    ff_celp_lp_synthesis_filterf(p->filter_out + p->order, p->lpc_coef,
-                                 p->excitation, avctx->frame_size, p->order);
-
-    frame->nb_samples = avctx->frame_size;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    buf_out = (int16_t *)frame->data[0];
-    for (i = 0; i < avctx->frame_size; i++)
-        buf_out[i] = p->filter_out[i + p->order];
-    memcpy(p->filter_out, p->filter_out + avctx->frame_size,
-           p->order * sizeof(*p->filter_out));
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_comfortnoise_decoder = {
-    .name           = "comfortnoise",
-    .long_name      = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_COMFORT_NOISE,
-    .priv_data_size = sizeof(CNGContext),
-    .init           = cng_decode_init,
-    .decode         = cng_decode_frame,
-    .flush          = cng_decode_flush,
-    .close          = cng_decode_close,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/cngenc.c b/deps/libav/libavcodec/cngenc.c
deleted file mode 100644
index 98f3c4e..0000000
--- a/deps/libav/libavcodec/cngenc.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * RFC 3389 comfort noise generator
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <math.h>
-
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "lpc.h"
-
-typedef struct CNGContext {
-    LPCContext lpc;
-    int order;
-    int32_t *samples32;
-    double *ref_coef;
-} CNGContext;
-
-static av_cold int cng_encode_close(AVCodecContext *avctx)
-{
-    CNGContext *p = avctx->priv_data;
-    ff_lpc_end(&p->lpc);
-    av_free(p->samples32);
-    av_free(p->ref_coef);
-    return 0;
-}
-
-static av_cold int cng_encode_init(AVCodecContext *avctx)
-{
-    CNGContext *p = avctx->priv_data;
-    int ret;
-
-    if (avctx->channels != 1) {
-        av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
-        return AVERROR(EINVAL);
-    }
-
-    avctx->frame_size = 640;
-    p->order = 10;
-    if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0)
-        return ret;
-    p->samples32 = av_malloc(avctx->frame_size * sizeof(*p->samples32));
-    p->ref_coef = av_malloc(p->order * sizeof(*p->ref_coef));
-    if (!p->samples32 || !p->ref_coef) {
-        cng_encode_close(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                            const AVFrame *frame, int *got_packet_ptr)
-{
-    CNGContext *p = avctx->priv_data;
-    int ret, i;
-    double energy = 0;
-    int qdbov;
-    int16_t *samples = (int16_t*) frame->data[0];
-
-    if ((ret = ff_alloc_packet(avpkt, 1 + p->order))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    for (i = 0; i < frame->nb_samples; i++) {
-        p->samples32[i] = samples[i];
-        energy += samples[i] * samples[i];
-    }
-    energy /= frame->nb_samples;
-    if (energy > 0) {
-        double dbov = 10 * log10(energy / 1081109975);
-        qdbov = av_clip(-floor(dbov), 0, 127);
-    } else {
-        qdbov = 127;
-    }
-    ret = ff_lpc_calc_ref_coefs(&p->lpc, p->samples32, p->order, p->ref_coef);
-    avpkt->data[0] = qdbov;
-    for (i = 0; i < p->order; i++)
-        avpkt->data[1 + i] = p->ref_coef[i] * 127 + 127;
-
-    *got_packet_ptr = 1;
-    avpkt->size = 1 + p->order;
-
-    return 0;
-}
-
-AVCodec ff_comfortnoise_encoder = {
-    .name           = "comfortnoise",
-    .long_name      = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_COMFORT_NOISE,
-    .priv_data_size = sizeof(CNGContext),
-    .init           = cng_encode_init,
-    .encode2        = cng_encode_frame,
-    .close          = cng_encode_close,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/codec_desc.c b/deps/libav/libavcodec/codec_desc.c
deleted file mode 100644
index 1270323..0000000
--- a/deps/libav/libavcodec/codec_desc.c
+++ /dev/null
@@ -1,2290 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-#include "avcodec.h"
-#include "version.h"
-
-static const AVCodecDescriptor codec_descriptors[] = {
-    /* video codecs */
-    {
-        .id        = AV_CODEC_ID_MPEG1VIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mpeg1video",
-        .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MPEG2VIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mpeg2video",
-        .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-#if FF_API_XVMC
-    {
-        .id        = AV_CODEC_ID_MPEG2VIDEO_XVMC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mpegvideo_xvmc",
-        .long_name = NULL_IF_CONFIG_SMALL("MPEG-1/2 video XvMC (X-Video Motion Compensation)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-#endif /* FF_API_XVMC */
-    {
-        .id        = AV_CODEC_ID_H261,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "h261",
-        .long_name = NULL_IF_CONFIG_SMALL("H.261"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_H263,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "h263",
-        .long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_RV10,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "rv10",
-        .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_RV20,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "rv20",
-        .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MJPEG,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mjpeg",
-        .long_name = NULL_IF_CONFIG_SMALL("Motion JPEG"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MJPEGB,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mjpegb",
-        .long_name = NULL_IF_CONFIG_SMALL("Apple MJPEG-B"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_LJPEG,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "ljpeg",
-        .long_name = NULL_IF_CONFIG_SMALL("Lossless JPEG"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_SP5X,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "sp5x",
-        .long_name = NULL_IF_CONFIG_SMALL("Sunplus JPEG (SP5X)"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_JPEGLS,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "jpegls",
-        .long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
-                     AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_MPEG4,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mpeg4",
-        .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_RAWVIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "rawvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("raw video"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_MSMPEG4V1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "msmpeg4v1",
-        .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MSMPEG4V2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "msmpeg4v2",
-        .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MSMPEG4V3,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "msmpeg4v3",
-        .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WMV1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "wmv1",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WMV2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "wmv2",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_H263P,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "h263p",
-        .long_name = NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_H263I,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "h263i",
-        .long_name = NULL_IF_CONFIG_SMALL("Intel H.263"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_FLV1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "flv1",
-        .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_SVQ1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "svq1",
-        .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_SVQ3,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "svq3",
-        .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_DVVIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "dvvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_HUFFYUV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "huffyuv",
-        .long_name = NULL_IF_CONFIG_SMALL("HuffYUV"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_CYUV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "cyuv",
-        .long_name = NULL_IF_CONFIG_SMALL("Creative YUV (CYUV)"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_H264,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "h264",
-        .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
-        .props     = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_INDEO3,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "indeo3",
-        .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VP3,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vp3",
-        .long_name = NULL_IF_CONFIG_SMALL("On2 VP3"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_THEORA,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "theora",
-        .long_name = NULL_IF_CONFIG_SMALL("Theora"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ASV1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "asv1",
-        .long_name = NULL_IF_CONFIG_SMALL("ASUS V1"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ASV2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "asv2",
-        .long_name = NULL_IF_CONFIG_SMALL("ASUS V2"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_FFV1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "ffv1",
-        .long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_4XM,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "4xm",
-        .long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VCR1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vcr1",
-        .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_CLJR,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "cljr",
-        .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MDEC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mdec",
-        .long_name = NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion DECoder)"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ROQ,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "roq",
-        .long_name = NULL_IF_CONFIG_SMALL("id RoQ video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_INTERPLAY_VIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "interplayvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_XAN_WC3,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "xan_wc3",
-        .long_name = NULL_IF_CONFIG_SMALL("Wing Commander III / Xan"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_XAN_WC4,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "xan_wc4",
-        .long_name = NULL_IF_CONFIG_SMALL("Wing Commander IV / Xxan"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_RPZA,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "rpza",
-        .long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_CINEPAK,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "cinepak",
-        .long_name = NULL_IF_CONFIG_SMALL("Cinepak"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WS_VQA,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "ws_vqa",
-        .long_name = NULL_IF_CONFIG_SMALL("Westwood Studios VQA (Vector Quantized Animation) video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MSRLE,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "msrle",
-        .long_name = NULL_IF_CONFIG_SMALL("Microsoft RLE"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_MSVIDEO1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "msvideo1",
-        .long_name = NULL_IF_CONFIG_SMALL("Microsoft Video 1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_IDCIN,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "idcin",
-        .long_name = NULL_IF_CONFIG_SMALL("id Quake II CIN video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_8BPS,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "8bps",
-        .long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_SMC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "smc",
-        .long_name = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_FLIC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "flic",
-        .long_name = NULL_IF_CONFIG_SMALL("Autodesk Animator Flic video"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_TRUEMOTION1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "truemotion1",
-        .long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 1.0"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VMDVIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vmdvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("Sierra VMD video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MSZH,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mszh",
-        .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) MSZH"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_ZLIB,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "zlib",
-        .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_QTRLE,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "qtrle",
-        .long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_TSCC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "tscc",
-        .long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Capture Codec"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_ULTI,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "ulti",
-        .long_name = NULL_IF_CONFIG_SMALL("IBM UltiMotion"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_QDRAW,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "qdraw",
-        .long_name = NULL_IF_CONFIG_SMALL("Apple QuickDraw"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_VIXL,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vixl",
-        .long_name = NULL_IF_CONFIG_SMALL("Miro VideoXL"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_QPEG,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "qpeg",
-        .long_name = NULL_IF_CONFIG_SMALL("Q-team QPEG"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_PNG,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "png",
-        .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PPM,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "ppm",
-        .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PBM,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "pbm",
-        .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PGM,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "pgm",
-        .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PGMYUV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "pgmyuv",
-        .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PAM,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "pam",
-        .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_FFVHUFF,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "ffvhuff",
-        .long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_RV30,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "rv30",
-        .long_name = NULL_IF_CONFIG_SMALL("RealVideo 3.0"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_RV40,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "rv40",
-        .long_name = NULL_IF_CONFIG_SMALL("RealVideo 4.0"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VC1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vc1",
-        .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WMV3,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "wmv3",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_LOCO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "loco",
-        .long_name = NULL_IF_CONFIG_SMALL("LOCO"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_WNV1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "wnv1",
-        .long_name = NULL_IF_CONFIG_SMALL("Winnov WNV1"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_AASC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "aasc",
-        .long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_INDEO2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "indeo2",
-        .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_FRAPS,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "fraps",
-        .long_name = NULL_IF_CONFIG_SMALL("Fraps"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_TRUEMOTION2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "truemotion2",
-        .long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_BMP,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "bmp",
-        .long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_CSCD,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "cscd",
-        .long_name = NULL_IF_CONFIG_SMALL("CamStudio"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_MMVIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mmvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("American Laser Games MM Video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ZMBV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "zmbv",
-        .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_AVS,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "avs",
-        .long_name = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_SMACKVIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "smackvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("Smacker video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_NUV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "nuv",
-        .long_name = NULL_IF_CONFIG_SMALL("NuppelVideo/RTJPEG"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_KMVC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "kmvc",
-        .long_name = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_FLASHSV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "flashsv",
-        .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_CAVS,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "cavs",
-        .long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_JPEG2000,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "jpeg2000",
-        .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
-                     AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_VMNC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vmnc",
-        .long_name = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_VP5,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vp5",
-        .long_name = NULL_IF_CONFIG_SMALL("On2 VP5"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VP6,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vp6",
-        .long_name = NULL_IF_CONFIG_SMALL("On2 VP6"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VP6F,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vp6f",
-        .long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TARGA,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "targa",
-        .long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_DSICINVIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "dsicinvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("Delphine Software International CIN video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TIERTEXSEQVIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "tiertexseqvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("Tiertex Limited SEQ video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TIFF,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "tiff",
-        .long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_GIF,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "gif",
-        .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_DXA,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "dxa",
-        .long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_DNXHD,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "dnxhd",
-        .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_THP,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "thp",
-        .long_name = NULL_IF_CONFIG_SMALL("Nintendo Gamecube THP video"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_SGI,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "sgi",
-        .long_name = NULL_IF_CONFIG_SMALL("SGI image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_C93,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "c93",
-        .long_name = NULL_IF_CONFIG_SMALL("Interplay C93"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_BETHSOFTVID,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "bethsoftvid",
-        .long_name = NULL_IF_CONFIG_SMALL("Bethesda VID video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_PTX,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "ptx",
-        .long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TXD,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "txd",
-        .long_name = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VP6A,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vp6a",
-        .long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version, with alpha channel)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_AMV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "amv",
-        .long_name = NULL_IF_CONFIG_SMALL("AMV Video"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VB,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vb",
-        .long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_PCX,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "pcx",
-        .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_SUNRAST,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "sunrast",
-        .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_INDEO4,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "indeo4",
-        .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 4"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_INDEO5,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "indeo5",
-        .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 5"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MIMIC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mimic",
-        .long_name = NULL_IF_CONFIG_SMALL("Mimic"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_RL2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "rl2",
-        .long_name = NULL_IF_CONFIG_SMALL("RL2 video"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ESCAPE124,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "escape124",
-        .long_name = NULL_IF_CONFIG_SMALL("Escape 124"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_DIRAC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "dirac",
-        .long_name = NULL_IF_CONFIG_SMALL("Dirac"),
-        .props     = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_BFI,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "bfi",
-        .long_name = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_CMV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "cmv",
-        .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MOTIONPIXELS,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "motionpixels",
-        .long_name = NULL_IF_CONFIG_SMALL("Motion Pixels video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TGV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "tgv",
-        .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TGV video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TGQ,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "tgq",
-        .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TGQ video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TQI,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "tqi",
-        .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TQI video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_AURA,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "aura",
-        .long_name = NULL_IF_CONFIG_SMALL("Auravision AURA"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_AURA2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "aura2",
-        .long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_V210X,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "v210x",
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_TMV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "tmv",
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_V210,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "v210",
-        .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_DPX,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "dpx",
-        .long_name = NULL_IF_CONFIG_SMALL("DPX image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MAD,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mad",
-        .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts Madcow Video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_FRWU,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "frwu",
-        .long_name = NULL_IF_CONFIG_SMALL("Forward Uncompressed"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_FLASHSV2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "flashsv2",
-        .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_CDGRAPHICS,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "cdgraphics",
-        .long_name = NULL_IF_CONFIG_SMALL("CD Graphics video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_R210,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "r210",
-        .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_ANM,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "anm",
-        .long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_BINKVIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "binkvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("Bink video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_IFF_ILBM,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "iff_ilbm",
-        .long_name = NULL_IF_CONFIG_SMALL("IFF ILBM"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_IFF_BYTERUN1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "iff_byterun1",
-        .long_name = NULL_IF_CONFIG_SMALL("IFF ByteRun1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_KGV1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "kgv1",
-        .long_name = NULL_IF_CONFIG_SMALL("Kega Game Video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_YOP,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "yop",
-        .long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VP8,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vp8",
-        .long_name = NULL_IF_CONFIG_SMALL("On2 VP8"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VP9,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vp9",
-        .long_name = NULL_IF_CONFIG_SMALL("Google VP9"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_PICTOR,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "pictor",
-        .long_name = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ANSI,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "ansi",
-        .long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_A64_MULTI,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "a64_multi",
-        .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_A64_MULTI5,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "a64_multi5",
-        .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_R10K,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "r10k",
-        .long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_MXPEG,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mxpeg",
-        .long_name = NULL_IF_CONFIG_SMALL("Mobotix MxPEG video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_LAGARITH,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "lagarith",
-        .long_name = NULL_IF_CONFIG_SMALL("Lagarith lossless"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PRORES,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "prores",
-        .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_JV,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "jv",
-        .long_name = NULL_IF_CONFIG_SMALL("Bitmap Brothers JV video"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_DFA,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "dfa",
-        .long_name = NULL_IF_CONFIG_SMALL("Chronomaster DFA"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WMV3IMAGE,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "wmv3image",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VC1IMAGE,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vc1image",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image v2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_UTVIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "utvideo",
-        .long_name = NULL_IF_CONFIG_SMALL("Ut Video"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_BMV_VIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "bmv_video",
-        .long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV video"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_VBLE,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "vble",
-        .long_name = NULL_IF_CONFIG_SMALL("VBLE Lossless Codec"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_DXTORY,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "dxtory",
-        .long_name = NULL_IF_CONFIG_SMALL("Dxtory"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_V410,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "v410",
-        .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_XWD,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "xwd",
-        .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_CDXL,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "cdxl",
-        .long_name = NULL_IF_CONFIG_SMALL("Commodore CDXL video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_XBM,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "xbm",
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_ZEROCODEC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "zerocodec",
-        .long_name = NULL_IF_CONFIG_SMALL("ZeroCodec Lossless Video"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_MSS1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mss1",
-        .long_name = NULL_IF_CONFIG_SMALL("MS Screen 1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MSA1,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "msa1",
-        .long_name = NULL_IF_CONFIG_SMALL("MS ATC Screen"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TSCC2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "tscc2",
-        .long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Codec 2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MTS2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mts2",
-        .long_name = NULL_IF_CONFIG_SMALL("MS Expression Encoder Screen"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_CLLC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "cllc",
-        .long_name = NULL_IF_CONFIG_SMALL("Canopus Lossless Codec"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_MSS2,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "mss2",
-        .long_name = NULL_IF_CONFIG_SMALL("MS Windows Media Video V9 Screen"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_AIC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "aic",
-        .long_name = NULL_IF_CONFIG_SMALL("Apple Intermediate Codec"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ESCAPE130,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "escape130",
-        .long_name = NULL_IF_CONFIG_SMALL("Escape 130"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_G2M,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "g2m",
-        .long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WEBP,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "webp",
-        .long_name = NULL_IF_CONFIG_SMALL("WebP"),
-        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
-                     AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_HNM4_VIDEO,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "hnm4video",
-        .long_name = NULL_IF_CONFIG_SMALL("HNM 4 video"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_HEVC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "hevc",
-        .long_name = NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_FIC,
-        .type      = AVMEDIA_TYPE_VIDEO,
-        .name      = "fic",
-        .long_name = NULL_IF_CONFIG_SMALL("Mirillis FIC"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-
-    /* various PCM "codecs" */
-    {
-        .id        = AV_CODEC_ID_PCM_S16LE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s16le",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16-bit little-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S16BE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s16be",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16-bit big-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_U16LE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_u16le",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM unsigned 16-bit little-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_U16BE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_u16be",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM unsigned 16-bit big-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S8,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s8",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 8-bit"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_U8,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_u8",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM unsigned 8-bit"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_MULAW,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_mulaw",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM mu-law"),
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_ALAW,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_alaw",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM A-law"),
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S32LE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s32le",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 32-bit little-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S32BE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s32be",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 32-bit big-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_U32LE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_u32le",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM unsigned 32-bit little-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_U32BE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_u32be",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM unsigned 32-bit big-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S24LE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s24le",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 24-bit little-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S24BE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s24be",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 24-bit big-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_U24LE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_u24le",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM unsigned 24-bit little-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_U24BE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_u24be",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM unsigned 24-bit big-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S24DAUD,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s24daud",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM D-Cinema audio signed 24-bit"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_ZORK,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_zork",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM Zork"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S16LE_PLANAR,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s16le_planar",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM 16-bit little-endian planar"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S24LE_PLANAR,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s24le_planar",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 24-bit little-endian planar"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S32LE_PLANAR,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s32le_planar",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 32-bit little-endian planar"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_DVD,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_dvd",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 20|24-bit big-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_F32BE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_f32be",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM 32-bit floating point big-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_F32LE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_f32le",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM 32-bit floating point little-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_F64BE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_f64be",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM 64-bit floating point big-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_F64LE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_f64le",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM 64-bit floating point little-endian"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_BLURAY,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_bluray",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_LXF,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_lxf",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 20-bit little-endian planar"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_S302M,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "s302m",
-        .long_name = NULL_IF_CONFIG_SMALL("SMPTE 302M"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_PCM_S8_PLANAR,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "pcm_s8_planar",
-        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 8-bit planar"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-
-    /* various ADPCM codecs */
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_QT,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_qt",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA QuickTime"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_WAV,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_wav",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA WAV"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_DK3,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_dk3",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA Duck DK3"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_DK4,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_dk4",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA Duck DK4"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_WS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_ws",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA Westwood"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_SMJPEG,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_smjpeg",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA Loki SDL MJPEG"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_MS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ms",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Microsoft"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_4XM,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_4xm",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM 4X Movie"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_XA,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_xa",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM CDROM XA"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_ADX,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_adx",
-        .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_EA,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ea",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Electronic Arts"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_G726,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_g726",
-        .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_CT,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ct",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Creative Technology"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_SWF,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_swf",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Shockwave Flash"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_YAMAHA,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_yamaha",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Yamaha"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_SBPRO_4,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_sbpro_4",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Sound Blaster Pro 4-bit"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_SBPRO_3,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_sbpro_3",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Sound Blaster Pro 2.6-bit"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_SBPRO_2,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_sbpro_2",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Sound Blaster Pro 2-bit"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_THP,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_thp",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Nintendo Gamecube THP"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_AMV,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_amv",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA AMV"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_EA_R1,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ea_r1",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Electronic Arts R1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_EA_R3,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ea_r3",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Electronic Arts R3"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_EA_R2,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ea_r2",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Electronic Arts R2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_EA_SEAD,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_ea_sead",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA Electronic Arts SEAD"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_EA_EACS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_ea_eacs",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA Electronic Arts EACS"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_EA_XAS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ea_xas",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Electronic Arts XAS"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_EA_MAXIS_XA,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ea_maxis_xa",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM Electronic Arts Maxis CDROM XA"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_ISS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_iss",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA Funcom ISS"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_G722,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_g722",
-        .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ADPCM_IMA_APC,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "adpcm_ima_apc",
-        .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA CRYO APC"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-
-    /* AMR */
-    {
-        .id        = AV_CODEC_ID_AMR_NB,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "amr_nb",
-        .long_name = NULL_IF_CONFIG_SMALL("AMR-NB (Adaptive Multi-Rate NarrowBand)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_AMR_WB,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "amr_wb",
-        .long_name = NULL_IF_CONFIG_SMALL("AMR-WB (Adaptive Multi-Rate WideBand)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-
-    /* RealAudio codecs*/
-    {
-        .id        = AV_CODEC_ID_RA_144,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "ra_144",
-        .long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_RA_288,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "ra_288",
-        .long_name = NULL_IF_CONFIG_SMALL("RealAudio 2.0 (28.8K)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-
-    /* various DPCM codecs */
-    {
-        .id        = AV_CODEC_ID_ROQ_DPCM,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "roq_dpcm",
-        .long_name = NULL_IF_CONFIG_SMALL("DPCM id RoQ"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_INTERPLAY_DPCM,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "interplay_dpcm",
-        .long_name = NULL_IF_CONFIG_SMALL("DPCM Interplay"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_XAN_DPCM,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "xan_dpcm",
-        .long_name = NULL_IF_CONFIG_SMALL("DPCM Xan"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_SOL_DPCM,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "sol_dpcm",
-        .long_name = NULL_IF_CONFIG_SMALL("DPCM Sol"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-
-    /* audio codecs */
-    {
-        .id        = AV_CODEC_ID_MP2,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "mp2",
-        .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MP3,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "mp3",
-        .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_AAC,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "aac",
-        .long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_AC3,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "ac3",
-        .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_DTS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "dts",
-        .long_name  = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
-        .props     = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_VORBIS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "vorbis",
-        .long_name  = NULL_IF_CONFIG_SMALL("Vorbis"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_DVAUDIO,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "dvaudio",
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WMAV1,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "wmav1",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WMAV2,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "wmav2",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MACE3,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "mace3",
-        .long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 3:1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MACE6,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "mace6",
-        .long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 6:1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_VMDAUDIO,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "vmdaudio",
-        .long_name = NULL_IF_CONFIG_SMALL("Sierra VMD audio"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_FLAC,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "flac",
-        .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_MP3ADU,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "mp3adu",
-        .long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MP3ON4,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "mp3on4",
-        .long_name = NULL_IF_CONFIG_SMALL("MP3onMP4"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_SHORTEN,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "shorten",
-        .long_name = NULL_IF_CONFIG_SMALL("Shorten"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_ALAC,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "alac",
-        .long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_WESTWOOD_SND1,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "westwood_snd1",
-        .long_name = NULL_IF_CONFIG_SMALL("Westwood Audio (SND1)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_GSM,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "gsm",
-        .long_name = NULL_IF_CONFIG_SMALL("GSM"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_QDM2,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "qdm2",
-        .long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 2"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_COOK,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "cook",
-        .long_name = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TRUESPEECH,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "truespeech",
-        .long_name = NULL_IF_CONFIG_SMALL("DSP Group TrueSpeech"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TTA,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "tta",
-        .long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_SMACKAUDIO,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "smackaudio",
-        .long_name = NULL_IF_CONFIG_SMALL("Smacker audio"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_QCELP,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "qcelp",
-        .long_name = NULL_IF_CONFIG_SMALL("QCELP / PureVoice"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WAVPACK,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "wavpack",
-        .long_name = NULL_IF_CONFIG_SMALL("WavPack"),
-        .props     = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_DSICINAUDIO,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "dsicinaudio",
-        .long_name = NULL_IF_CONFIG_SMALL("Delphine Software International CIN audio"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_IMC,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "imc",
-        .long_name = NULL_IF_CONFIG_SMALL("IMC (Intel Music Coder)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MUSEPACK7,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "musepack7",
-        .long_name = NULL_IF_CONFIG_SMALL("Musepack SV7"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MLP,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "mlp",
-        .long_name = NULL_IF_CONFIG_SMALL("MLP (Meridian Lossless Packing)"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_GSM_MS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "gsm_ms",
-        .long_name = NULL_IF_CONFIG_SMALL("GSM Microsoft variant"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ATRAC3,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "atrac3",
-        .long_name = NULL_IF_CONFIG_SMALL("ATRAC3 (Adaptive TRansform Acoustic Coding 3)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-#if FF_API_VOXWARE
-    {
-        .id        = AV_CODEC_ID_VOXWARE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "voxware",
-        .long_name = NULL_IF_CONFIG_SMALL("Voxware RT29 Metasound"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-#endif
-    {
-        .id        = AV_CODEC_ID_APE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "ape",
-        .long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_NELLYMOSER,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "nellymoser",
-        .long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MUSEPACK8,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "musepack8",
-        .long_name = NULL_IF_CONFIG_SMALL("Musepack SV8"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_SPEEX,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "speex",
-        .long_name = NULL_IF_CONFIG_SMALL("Speex"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WMAVOICE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "wmavoice",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Voice"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WMAPRO,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "wmapro",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 9 Professional"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_WMALOSSLESS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "wmalossless",
-        .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Lossless"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_ATRAC3P,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "atrac3p",
-        .long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_EAC3,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "eac3",
-        .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_SIPR,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "sipr",
-        .long_name = NULL_IF_CONFIG_SMALL("RealAudio SIPR / ACELP.NET"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_MP1,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "mp1",
-        .long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TWINVQ,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "twinvq",
-        .long_name = NULL_IF_CONFIG_SMALL("VQF TwinVQ"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TRUEHD,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "truehd",
-        .long_name = NULL_IF_CONFIG_SMALL("TrueHD"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_MP4ALS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "mp4als",
-        .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_ATRAC1,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "atrac1",
-        .long_name = NULL_IF_CONFIG_SMALL("ATRAC1 (Adaptive TRansform Acoustic Coding)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_BINKAUDIO_RDFT,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "binkaudio_rdft",
-        .long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_BINKAUDIO_DCT,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "binkaudio_dct",
-        .long_name = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_AAC_LATM,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "aac_latm",
-        .long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_QDMC,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "qdmc",
-        .long_name = NULL_IF_CONFIG_SMALL("QDesign Music"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_CELT,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "celt",
-        .long_name = NULL_IF_CONFIG_SMALL("Constrained Energy Lapped Transform (CELT)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_G723_1,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "g723_1",
-        .long_name = NULL_IF_CONFIG_SMALL("G.723.1"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_G729,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "g729",
-        .long_name = NULL_IF_CONFIG_SMALL("G.729"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_8SVX_EXP,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "8svx_exp",
-        .long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_8SVX_FIB,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "8svx_fib",
-        .long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_BMV_AUDIO,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "bmv_audio",
-        .long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV audio"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_RALF,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "ralf",
-        .long_name = NULL_IF_CONFIG_SMALL("RealAudio Lossless"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_IAC,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "iac",
-        .long_name = NULL_IF_CONFIG_SMALL("IAC (Indeo Audio Coder)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_ILBC,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "ilbc",
-        .long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_OPUS,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "opus",
-        .long_name = NULL_IF_CONFIG_SMALL("Opus (Opus Interactive Audio Codec)"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_COMFORT_NOISE,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "comfortnoise",
-        .long_name = NULL_IF_CONFIG_SMALL("RFC 3389 Comfort Noise"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-    {
-        .id        = AV_CODEC_ID_TAK,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "tak",
-        .long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor)"),
-        .props     = AV_CODEC_PROP_LOSSLESS,
-    },
-    {
-        .id        = AV_CODEC_ID_METASOUND,
-        .type      = AVMEDIA_TYPE_AUDIO,
-        .name      = "metasound",
-        .long_name = NULL_IF_CONFIG_SMALL("Voxware MetaSound"),
-        .props     = AV_CODEC_PROP_LOSSY,
-    },
-
-    /* subtitle codecs */
-    {
-        .id        = AV_CODEC_ID_DVD_SUBTITLE,
-        .type      = AVMEDIA_TYPE_SUBTITLE,
-        .name      = "dvd_subtitle",
-        .long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"),
-    },
-    {
-        .id        = AV_CODEC_ID_DVB_SUBTITLE,
-        .type      = AVMEDIA_TYPE_SUBTITLE,
-        .name      = "dvb_subtitle",
-        .long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"),
-    },
-    {
-        .id        = AV_CODEC_ID_TEXT,
-        .type      = AVMEDIA_TYPE_SUBTITLE,
-        .name      = "text",
-        .long_name = NULL_IF_CONFIG_SMALL("raw UTF-8 text"),
-    },
-    {
-        .id        = AV_CODEC_ID_XSUB,
-        .type      = AVMEDIA_TYPE_SUBTITLE,
-        .name      = "xsub",
-        .long_name = NULL_IF_CONFIG_SMALL("XSUB"),
-    },
-    {
-        .id        = AV_CODEC_ID_SSA,
-        .type      = AVMEDIA_TYPE_SUBTITLE,
-        .name      = "ssa",
-        .long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) / ASS (Advanced SSA) subtitle"),
-    },
-    {
-        .id        = AV_CODEC_ID_MOV_TEXT,
-        .type      = AVMEDIA_TYPE_SUBTITLE,
-        .name      = "mov_text",
-        .long_name = NULL_IF_CONFIG_SMALL("MOV text"),
-    },
-    {
-        .id        = AV_CODEC_ID_HDMV_PGS_SUBTITLE,
-        .type      = AVMEDIA_TYPE_SUBTITLE,
-        .name      = "hdmv_pgs_subtitle",
-        .long_name = NULL_IF_CONFIG_SMALL("HDMV Presentation Graphic Stream subtitles"),
-    },
-    {
-        .id        = AV_CODEC_ID_DVB_TELETEXT,
-        .type      = AVMEDIA_TYPE_SUBTITLE,
-        .name      = "dvb_teletext",
-        .long_name = NULL_IF_CONFIG_SMALL("DVB teletext"),
-    },
-    {
-        .id        = AV_CODEC_ID_SRT,
-        .type      = AVMEDIA_TYPE_SUBTITLE,
-        .name      = "srt",
-        .long_name = NULL_IF_CONFIG_SMALL("SubRip Text"),
-    },
-};
-
-const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id)
-{
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(codec_descriptors); i++)
-        if (codec_descriptors[i].id == id)
-            return &codec_descriptors[i];
-    return NULL;
-}
-
-const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev)
-{
-    if (!prev)
-        return &codec_descriptors[0];
-    if (prev - codec_descriptors < FF_ARRAY_ELEMS(codec_descriptors) - 1)
-        return prev + 1;
-    return NULL;
-}
-
-const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name)
-{
-    const AVCodecDescriptor *desc = NULL;
-
-    while ((desc = avcodec_descriptor_next(desc))) {
-        if (!strcmp(desc->name, name))
-            return desc;
-    }
-    return NULL;
-}
diff --git a/deps/libav/libavcodec/cook.c b/deps/libav/libavcodec/cook.c
deleted file mode 100644
index 190d28c..0000000
--- a/deps/libav/libavcodec/cook.c
+++ /dev/null
@@ -1,1268 +0,0 @@
-/*
- * COOK compatible decoder
- * Copyright (c) 2003 Sascha Sommer
- * Copyright (c) 2005 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Cook compatible decoder. Bastardization of the G.722.1 standard.
- * This decoder handles RealNetworks, RealAudio G2 data.
- * Cook is identified by the codec name cook in RM files.
- *
- * To use this decoder, a calling application must supply the extradata
- * bytes provided from the RM container; 8+ bytes for mono streams and
- * 16+ for stereo streams (maybe more).
- *
- * Codec technicalities (all this assume a buffer length of 1024):
- * Cook works with several different techniques to achieve its compression.
- * In the timedomain the buffer is divided into 8 pieces and quantized. If
- * two neighboring pieces have different quantization index a smooth
- * quantization curve is used to get a smooth overlap between the different
- * pieces.
- * To get to the transformdomain Cook uses a modulated lapped transform.
- * The transform domain has 50 subbands with 20 elements each. This
- * means only a maximum of 50*20=1000 coefficients are used out of the 1024
- * available.
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/lfg.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "bytestream.h"
-#include "fft.h"
-#include "internal.h"
-#include "sinewin.h"
-
-#include "cookdata.h"
-
-/* the different Cook versions */
-#define MONO            0x1000001
-#define STEREO          0x1000002
-#define JOINT_STEREO    0x1000003
-#define MC_COOK         0x2000000   // multichannel Cook, not supported
-
-#define SUBBAND_SIZE    20
-#define MAX_SUBPACKETS   5
-
-typedef struct {
-    int *now;
-    int *previous;
-} cook_gains;
-
-typedef struct {
-    int                 ch_idx;
-    int                 size;
-    int                 num_channels;
-    int                 cookversion;
-    int                 subbands;
-    int                 js_subband_start;
-    int                 js_vlc_bits;
-    int                 samples_per_channel;
-    int                 log2_numvector_size;
-    unsigned int        channel_mask;
-    VLC                 channel_coupling;
-    int                 joint_stereo;
-    int                 bits_per_subpacket;
-    int                 bits_per_subpdiv;
-    int                 total_subbands;
-    int                 numvector_size;       // 1 << log2_numvector_size;
-
-    float               mono_previous_buffer1[1024];
-    float               mono_previous_buffer2[1024];
-
-    cook_gains          gains1;
-    cook_gains          gains2;
-    int                 gain_1[9];
-    int                 gain_2[9];
-    int                 gain_3[9];
-    int                 gain_4[9];
-} COOKSubpacket;
-
-typedef struct cook {
-    /*
-     * The following 5 functions provide the lowlevel arithmetic on
-     * the internal audio buffers.
-     */
-    void (*scalar_dequant)(struct cook *q, int index, int quant_index,
-                           int *subband_coef_index, int *subband_coef_sign,
-                           float *mlt_p);
-
-    void (*decouple)(struct cook *q,
-                     COOKSubpacket *p,
-                     int subband,
-                     float f1, float f2,
-                     float *decode_buffer,
-                     float *mlt_buffer1, float *mlt_buffer2);
-
-    void (*imlt_window)(struct cook *q, float *buffer1,
-                        cook_gains *gains_ptr, float *previous_buffer);
-
-    void (*interpolate)(struct cook *q, float *buffer,
-                        int gain_index, int gain_index_next);
-
-    void (*saturate_output)(struct cook *q, float *out);
-
-    AVCodecContext*     avctx;
-    DSPContext          dsp;
-    GetBitContext       gb;
-    /* stream data */
-    int                 num_vectors;
-    int                 samples_per_channel;
-    /* states */
-    AVLFG               random_state;
-    int                 discarded_packets;
-
-    /* transform data */
-    FFTContext          mdct_ctx;
-    float*              mlt_window;
-
-    /* VLC data */
-    VLC                 envelope_quant_index[13];
-    VLC                 sqvh[7];          // scalar quantization
-
-    /* generatable tables and related variables */
-    int                 gain_size_factor;
-    float               gain_table[23];
-
-    /* data buffers */
-
-    uint8_t*            decoded_bytes_buffer;
-    DECLARE_ALIGNED(32, float, mono_mdct_output)[2048];
-    float               decode_buffer_1[1024];
-    float               decode_buffer_2[1024];
-    float               decode_buffer_0[1060]; /* static allocation for joint decode */
-
-    const float         *cplscales[5];
-    int                 num_subpackets;
-    COOKSubpacket       subpacket[MAX_SUBPACKETS];
-} COOKContext;
-
-static float     pow2tab[127];
-static float rootpow2tab[127];
-
-/*************** init functions ***************/
-
-/* table generator */
-static av_cold void init_pow2table(void)
-{
-    int i;
-    for (i = -63; i < 64; i++) {
-        pow2tab[63 + i] = pow(2, i);
-        rootpow2tab[63 + i] = sqrt(pow(2, i));
-    }
-}
-
-/* table generator */
-static av_cold void init_gain_table(COOKContext *q)
-{
-    int i;
-    q->gain_size_factor = q->samples_per_channel / 8;
-    for (i = 0; i < 23; i++)
-        q->gain_table[i] = pow(pow2tab[i + 52],
-                               (1.0 / (double) q->gain_size_factor));
-}
-
-
-static av_cold int init_cook_vlc_tables(COOKContext *q)
-{
-    int i, result;
-
-    result = 0;
-    for (i = 0; i < 13; i++) {
-        result |= init_vlc(&q->envelope_quant_index[i], 9, 24,
-                           envelope_quant_index_huffbits[i], 1, 1,
-                           envelope_quant_index_huffcodes[i], 2, 2, 0);
-    }
-    av_log(q->avctx, AV_LOG_DEBUG, "sqvh VLC init\n");
-    for (i = 0; i < 7; i++) {
-        result |= init_vlc(&q->sqvh[i], vhvlcsize_tab[i], vhsize_tab[i],
-                           cvh_huffbits[i], 1, 1,
-                           cvh_huffcodes[i], 2, 2, 0);
-    }
-
-    for (i = 0; i < q->num_subpackets; i++) {
-        if (q->subpacket[i].joint_stereo == 1) {
-            result |= init_vlc(&q->subpacket[i].channel_coupling, 6,
-                               (1 << q->subpacket[i].js_vlc_bits) - 1,
-                               ccpl_huffbits[q->subpacket[i].js_vlc_bits - 2], 1, 1,
-                               ccpl_huffcodes[q->subpacket[i].js_vlc_bits - 2], 2, 2, 0);
-            av_log(q->avctx, AV_LOG_DEBUG, "subpacket %i Joint-stereo VLC used.\n", i);
-        }
-    }
-
-    av_log(q->avctx, AV_LOG_DEBUG, "VLC tables initialized.\n");
-    return result;
-}
-
-static av_cold int init_cook_mlt(COOKContext *q)
-{
-    int j, ret;
-    int mlt_size = q->samples_per_channel;
-
-    if ((q->mlt_window = av_malloc(mlt_size * sizeof(*q->mlt_window))) == 0)
-        return AVERROR(ENOMEM);
-
-    /* Initialize the MLT window: simple sine window. */
-    ff_sine_window_init(q->mlt_window, mlt_size);
-    for (j = 0; j < mlt_size; j++)
-        q->mlt_window[j] *= sqrt(2.0 / q->samples_per_channel);
-
-    /* Initialize the MDCT. */
-    if ((ret = ff_mdct_init(&q->mdct_ctx, av_log2(mlt_size) + 1, 1, 1.0 / 32768.0))) {
-        av_free(q->mlt_window);
-        return ret;
-    }
-    av_log(q->avctx, AV_LOG_DEBUG, "MDCT initialized, order = %d.\n",
-           av_log2(mlt_size) + 1);
-
-    return 0;
-}
-
-static av_cold void init_cplscales_table(COOKContext *q)
-{
-    int i;
-    for (i = 0; i < 5; i++)
-        q->cplscales[i] = cplscales[i];
-}
-
-/*************** init functions end ***********/
-
-#define DECODE_BYTES_PAD1(bytes) (3 - ((bytes) + 3) % 4)
-#define DECODE_BYTES_PAD2(bytes) ((bytes) % 4 + DECODE_BYTES_PAD1(2 * (bytes)))
-
-/**
- * Cook indata decoding, every 32 bits are XORed with 0x37c511f2.
- * Why? No idea, some checksum/error detection method maybe.
- *
- * Out buffer size: extra bytes are needed to cope with
- * padding/misalignment.
- * Subpackets passed to the decoder can contain two, consecutive
- * half-subpackets, of identical but arbitrary size.
- *          1234 1234 1234 1234  extraA extraB
- * Case 1:  AAAA BBBB              0      0
- * Case 2:  AAAA ABBB BB--         3      3
- * Case 3:  AAAA AABB BBBB         2      2
- * Case 4:  AAAA AAAB BBBB BB--    1      5
- *
- * Nice way to waste CPU cycles.
- *
- * @param inbuffer  pointer to byte array of indata
- * @param out       pointer to byte array of outdata
- * @param bytes     number of bytes
- */
-static inline int decode_bytes(const uint8_t *inbuffer, uint8_t *out, int bytes)
-{
-    static const uint32_t tab[4] = {
-        AV_BE2NE32C(0x37c511f2u), AV_BE2NE32C(0xf237c511u),
-        AV_BE2NE32C(0x11f237c5u), AV_BE2NE32C(0xc511f237u),
-    };
-    int i, off;
-    uint32_t c;
-    const uint32_t *buf;
-    uint32_t *obuf = (uint32_t *) out;
-    /* FIXME: 64 bit platforms would be able to do 64 bits at a time.
-     * I'm too lazy though, should be something like
-     * for (i = 0; i < bitamount / 64; i++)
-     *     (int64_t) out[i] = 0x37c511f237c511f2 ^ av_be2ne64(int64_t) in[i]);
-     * Buffer alignment needs to be checked. */
-
-    off = (intptr_t) inbuffer & 3;
-    buf = (const uint32_t *) (inbuffer - off);
-    c = tab[off];
-    bytes += 3 + off;
-    for (i = 0; i < bytes / 4; i++)
-        obuf[i] = c ^ buf[i];
-
-    return off;
-}
-
-static av_cold int cook_decode_close(AVCodecContext *avctx)
-{
-    int i;
-    COOKContext *q = avctx->priv_data;
-    av_log(avctx, AV_LOG_DEBUG, "Deallocating memory.\n");
-
-    /* Free allocated memory buffers. */
-    av_free(q->mlt_window);
-    av_free(q->decoded_bytes_buffer);
-
-    /* Free the transform. */
-    ff_mdct_end(&q->mdct_ctx);
-
-    /* Free the VLC tables. */
-    for (i = 0; i < 13; i++)
-        ff_free_vlc(&q->envelope_quant_index[i]);
-    for (i = 0; i < 7; i++)
-        ff_free_vlc(&q->sqvh[i]);
-    for (i = 0; i < q->num_subpackets; i++)
-        ff_free_vlc(&q->subpacket[i].channel_coupling);
-
-    av_log(avctx, AV_LOG_DEBUG, "Memory deallocated.\n");
-
-    return 0;
-}
-
-/**
- * Fill the gain array for the timedomain quantization.
- *
- * @param gb          pointer to the GetBitContext
- * @param gaininfo    array[9] of gain indexes
- */
-static void decode_gain_info(GetBitContext *gb, int *gaininfo)
-{
-    int i, n;
-
-    while (get_bits1(gb)) {
-        /* NOTHING */
-    }
-
-    n = get_bits_count(gb) - 1;     // amount of elements*2 to update
-
-    i = 0;
-    while (n--) {
-        int index = get_bits(gb, 3);
-        int gain = get_bits1(gb) ? get_bits(gb, 4) - 7 : -1;
-
-        while (i <= index)
-            gaininfo[i++] = gain;
-    }
-    while (i <= 8)
-        gaininfo[i++] = 0;
-}
-
-/**
- * Create the quant index table needed for the envelope.
- *
- * @param q                 pointer to the COOKContext
- * @param quant_index_table pointer to the array
- */
-static int decode_envelope(COOKContext *q, COOKSubpacket *p,
-                           int *quant_index_table)
-{
-    int i, j, vlc_index;
-
-    quant_index_table[0] = get_bits(&q->gb, 6) - 6; // This is used later in categorize
-
-    for (i = 1; i < p->total_subbands; i++) {
-        vlc_index = i;
-        if (i >= p->js_subband_start * 2) {
-            vlc_index -= p->js_subband_start;
-        } else {
-            vlc_index /= 2;
-            if (vlc_index < 1)
-                vlc_index = 1;
-        }
-        if (vlc_index > 13)
-            vlc_index = 13; // the VLC tables >13 are identical to No. 13
-
-        j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index - 1].table,
-                     q->envelope_quant_index[vlc_index - 1].bits, 2);
-        quant_index_table[i] = quant_index_table[i - 1] + j - 12; // differential encoding
-        if (quant_index_table[i] > 63 || quant_index_table[i] < -63) {
-            av_log(q->avctx, AV_LOG_ERROR,
-                   "Invalid quantizer %d at position %d, outside [-63, 63] range\n",
-                   quant_index_table[i], i);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Calculate the category and category_index vector.
- *
- * @param q                     pointer to the COOKContext
- * @param quant_index_table     pointer to the array
- * @param category              pointer to the category array
- * @param category_index        pointer to the category_index array
- */
-static void categorize(COOKContext *q, COOKSubpacket *p, int *quant_index_table,
-                       int *category, int *category_index)
-{
-    int exp_idx, bias, tmpbias1, tmpbias2, bits_left, num_bits, index, v, i, j;
-    int exp_index2[102] = { 0 };
-    int exp_index1[102] = { 0 };
-
-    int tmp_categorize_array[128 * 2] = { 0 };
-    int tmp_categorize_array1_idx = p->numvector_size;
-    int tmp_categorize_array2_idx = p->numvector_size;
-
-    bits_left = p->bits_per_subpacket - get_bits_count(&q->gb);
-
-    if (bits_left > q->samples_per_channel)
-        bits_left = q->samples_per_channel +
-                    ((bits_left - q->samples_per_channel) * 5) / 8;
-
-    bias = -32;
-
-    /* Estimate bias. */
-    for (i = 32; i > 0; i = i / 2) {
-        num_bits = 0;
-        index    = 0;
-        for (j = p->total_subbands; j > 0; j--) {
-            exp_idx = av_clip((i - quant_index_table[index] + bias) / 2, 0, 7);
-            index++;
-            num_bits += expbits_tab[exp_idx];
-        }
-        if (num_bits >= bits_left - 32)
-            bias += i;
-    }
-
-    /* Calculate total number of bits. */
-    num_bits = 0;
-    for (i = 0; i < p->total_subbands; i++) {
-        exp_idx = av_clip((bias - quant_index_table[i]) / 2, 0, 7);
-        num_bits += expbits_tab[exp_idx];
-        exp_index1[i] = exp_idx;
-        exp_index2[i] = exp_idx;
-    }
-    tmpbias1 = tmpbias2 = num_bits;
-
-    for (j = 1; j < p->numvector_size; j++) {
-        if (tmpbias1 + tmpbias2 > 2 * bits_left) {  /* ---> */
-            int max = -999999;
-            index = -1;
-            for (i = 0; i < p->total_subbands; i++) {
-                if (exp_index1[i] < 7) {
-                    v = (-2 * exp_index1[i]) - quant_index_table[i] + bias;
-                    if (v >= max) {
-                        max   = v;
-                        index = i;
-                    }
-                }
-            }
-            if (index == -1)
-                break;
-            tmp_categorize_array[tmp_categorize_array1_idx++] = index;
-            tmpbias1 -= expbits_tab[exp_index1[index]] -
-                        expbits_tab[exp_index1[index] + 1];
-            ++exp_index1[index];
-        } else {  /* <--- */
-            int min = 999999;
-            index = -1;
-            for (i = 0; i < p->total_subbands; i++) {
-                if (exp_index2[i] > 0) {
-                    v = (-2 * exp_index2[i]) - quant_index_table[i] + bias;
-                    if (v < min) {
-                        min   = v;
-                        index = i;
-                    }
-                }
-            }
-            if (index == -1)
-                break;
-            tmp_categorize_array[--tmp_categorize_array2_idx] = index;
-            tmpbias2 -= expbits_tab[exp_index2[index]] -
-                        expbits_tab[exp_index2[index] - 1];
-            --exp_index2[index];
-        }
-    }
-
-    for (i = 0; i < p->total_subbands; i++)
-        category[i] = exp_index2[i];
-
-    for (i = 0; i < p->numvector_size - 1; i++)
-        category_index[i] = tmp_categorize_array[tmp_categorize_array2_idx++];
-}
-
-
-/**
- * Expand the category vector.
- *
- * @param q                     pointer to the COOKContext
- * @param category              pointer to the category array
- * @param category_index        pointer to the category_index array
- */
-static inline void expand_category(COOKContext *q, int *category,
-                                   int *category_index)
-{
-    int i;
-    for (i = 0; i < q->num_vectors; i++)
-    {
-        int idx = category_index[i];
-        if (++category[idx] >= FF_ARRAY_ELEMS(dither_tab))
-            --category[idx];
-    }
-}
-
-/**
- * The real requantization of the mltcoefs
- *
- * @param q                     pointer to the COOKContext
- * @param index                 index
- * @param quant_index           quantisation index
- * @param subband_coef_index    array of indexes to quant_centroid_tab
- * @param subband_coef_sign     signs of coefficients
- * @param mlt_p                 pointer into the mlt buffer
- */
-static void scalar_dequant_float(COOKContext *q, int index, int quant_index,
-                                 int *subband_coef_index, int *subband_coef_sign,
-                                 float *mlt_p)
-{
-    int i;
-    float f1;
-
-    for (i = 0; i < SUBBAND_SIZE; i++) {
-        if (subband_coef_index[i]) {
-            f1 = quant_centroid_tab[index][subband_coef_index[i]];
-            if (subband_coef_sign[i])
-                f1 = -f1;
-        } else {
-            /* noise coding if subband_coef_index[i] == 0 */
-            f1 = dither_tab[index];
-            if (av_lfg_get(&q->random_state) < 0x80000000)
-                f1 = -f1;
-        }
-        mlt_p[i] = f1 * rootpow2tab[quant_index + 63];
-    }
-}
-/**
- * Unpack the subband_coef_index and subband_coef_sign vectors.
- *
- * @param q                     pointer to the COOKContext
- * @param category              pointer to the category array
- * @param subband_coef_index    array of indexes to quant_centroid_tab
- * @param subband_coef_sign     signs of coefficients
- */
-static int unpack_SQVH(COOKContext *q, COOKSubpacket *p, int category,
-                       int *subband_coef_index, int *subband_coef_sign)
-{
-    int i, j;
-    int vlc, vd, tmp, result;
-
-    vd = vd_tab[category];
-    result = 0;
-    for (i = 0; i < vpr_tab[category]; i++) {
-        vlc = get_vlc2(&q->gb, q->sqvh[category].table, q->sqvh[category].bits, 3);
-        if (p->bits_per_subpacket < get_bits_count(&q->gb)) {
-            vlc = 0;
-            result = 1;
-        }
-        for (j = vd - 1; j >= 0; j--) {
-            tmp = (vlc * invradix_tab[category]) / 0x100000;
-            subband_coef_index[vd * i + j] = vlc - tmp * (kmax_tab[category] + 1);
-            vlc = tmp;
-        }
-        for (j = 0; j < vd; j++) {
-            if (subband_coef_index[i * vd + j]) {
-                if (get_bits_count(&q->gb) < p->bits_per_subpacket) {
-                    subband_coef_sign[i * vd + j] = get_bits1(&q->gb);
-                } else {
-                    result = 1;
-                    subband_coef_sign[i * vd + j] = 0;
-                }
-            } else {
-                subband_coef_sign[i * vd + j] = 0;
-            }
-        }
-    }
-    return result;
-}
-
-
-/**
- * Fill the mlt_buffer with mlt coefficients.
- *
- * @param q                 pointer to the COOKContext
- * @param category          pointer to the category array
- * @param quant_index_table pointer to the array
- * @param mlt_buffer        pointer to mlt coefficients
- */
-static void decode_vectors(COOKContext *q, COOKSubpacket *p, int *category,
-                           int *quant_index_table, float *mlt_buffer)
-{
-    /* A zero in this table means that the subband coefficient is
-       random noise coded. */
-    int subband_coef_index[SUBBAND_SIZE];
-    /* A zero in this table means that the subband coefficient is a
-       positive multiplicator. */
-    int subband_coef_sign[SUBBAND_SIZE];
-    int band, j;
-    int index = 0;
-
-    for (band = 0; band < p->total_subbands; band++) {
-        index = category[band];
-        if (category[band] < 7) {
-            if (unpack_SQVH(q, p, category[band], subband_coef_index, subband_coef_sign)) {
-                index = 7;
-                for (j = 0; j < p->total_subbands; j++)
-                    category[band + j] = 7;
-            }
-        }
-        if (index >= 7) {
-            memset(subband_coef_index, 0, sizeof(subband_coef_index));
-            memset(subband_coef_sign,  0, sizeof(subband_coef_sign));
-        }
-        q->scalar_dequant(q, index, quant_index_table[band],
-                          subband_coef_index, subband_coef_sign,
-                          &mlt_buffer[band * SUBBAND_SIZE]);
-    }
-
-    /* FIXME: should this be removed, or moved into loop above? */
-    if (p->total_subbands * SUBBAND_SIZE >= q->samples_per_channel)
-        return;
-}
-
-
-static int mono_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer)
-{
-    int category_index[128] = { 0 };
-    int category[128]       = { 0 };
-    int quant_index_table[102];
-    int res;
-
-    if ((res = decode_envelope(q, p, quant_index_table)) < 0)
-        return res;
-    q->num_vectors = get_bits(&q->gb, p->log2_numvector_size);
-    categorize(q, p, quant_index_table, category, category_index);
-    expand_category(q, category, category_index);
-    decode_vectors(q, p, category, quant_index_table, mlt_buffer);
-
-    return 0;
-}
-
-
-/**
- * the actual requantization of the timedomain samples
- *
- * @param q                 pointer to the COOKContext
- * @param buffer            pointer to the timedomain buffer
- * @param gain_index        index for the block multiplier
- * @param gain_index_next   index for the next block multiplier
- */
-static void interpolate_float(COOKContext *q, float *buffer,
-                              int gain_index, int gain_index_next)
-{
-    int i;
-    float fc1, fc2;
-    fc1 = pow2tab[gain_index + 63];
-
-    if (gain_index == gain_index_next) {             // static gain
-        for (i = 0; i < q->gain_size_factor; i++)
-            buffer[i] *= fc1;
-    } else {                                        // smooth gain
-        fc2 = q->gain_table[11 + (gain_index_next - gain_index)];
-        for (i = 0; i < q->gain_size_factor; i++) {
-            buffer[i] *= fc1;
-            fc1       *= fc2;
-        }
-    }
-}
-
-/**
- * Apply transform window, overlap buffers.
- *
- * @param q                 pointer to the COOKContext
- * @param inbuffer          pointer to the mltcoefficients
- * @param gains_ptr         current and previous gains
- * @param previous_buffer   pointer to the previous buffer to be used for overlapping
- */
-static void imlt_window_float(COOKContext *q, float *inbuffer,
-                              cook_gains *gains_ptr, float *previous_buffer)
-{
-    const float fc = pow2tab[gains_ptr->previous[0] + 63];
-    int i;
-    /* The weird thing here, is that the two halves of the time domain
-     * buffer are swapped. Also, the newest data, that we save away for
-     * next frame, has the wrong sign. Hence the subtraction below.
-     * Almost sounds like a complex conjugate/reverse data/FFT effect.
-     */
-
-    /* Apply window and overlap */
-    for (i = 0; i < q->samples_per_channel; i++)
-        inbuffer[i] = inbuffer[i] * fc * q->mlt_window[i] -
-                      previous_buffer[i] * q->mlt_window[q->samples_per_channel - 1 - i];
-}
-
-/**
- * The modulated lapped transform, this takes transform coefficients
- * and transforms them into timedomain samples.
- * Apply transform window, overlap buffers, apply gain profile
- * and buffer management.
- *
- * @param q                 pointer to the COOKContext
- * @param inbuffer          pointer to the mltcoefficients
- * @param gains_ptr         current and previous gains
- * @param previous_buffer   pointer to the previous buffer to be used for overlapping
- */
-static void imlt_gain(COOKContext *q, float *inbuffer,
-                      cook_gains *gains_ptr, float *previous_buffer)
-{
-    float *buffer0 = q->mono_mdct_output;
-    float *buffer1 = q->mono_mdct_output + q->samples_per_channel;
-    int i;
-
-    /* Inverse modified discrete cosine transform */
-    q->mdct_ctx.imdct_calc(&q->mdct_ctx, q->mono_mdct_output, inbuffer);
-
-    q->imlt_window(q, buffer1, gains_ptr, previous_buffer);
-
-    /* Apply gain profile */
-    for (i = 0; i < 8; i++)
-        if (gains_ptr->now[i] || gains_ptr->now[i + 1])
-            q->interpolate(q, &buffer1[q->gain_size_factor * i],
-                           gains_ptr->now[i], gains_ptr->now[i + 1]);
-
-    /* Save away the current to be previous block. */
-    memcpy(previous_buffer, buffer0,
-           q->samples_per_channel * sizeof(*previous_buffer));
-}
-
-
-/**
- * function for getting the jointstereo coupling information
- *
- * @param q                 pointer to the COOKContext
- * @param decouple_tab      decoupling array
- */
-static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
-{
-    int i;
-    int vlc    = get_bits1(&q->gb);
-    int start  = cplband[p->js_subband_start];
-    int end    = cplband[p->subbands - 1];
-    int length = end - start + 1;
-
-    if (start > end)
-        return;
-
-    if (vlc)
-        for (i = 0; i < length; i++)
-            decouple_tab[start + i] = get_vlc2(&q->gb,
-                                               p->channel_coupling.table,
-                                               p->channel_coupling.bits, 2);
-    else
-        for (i = 0; i < length; i++)
-            decouple_tab[start + i] = get_bits(&q->gb, p->js_vlc_bits);
-}
-
-/*
- * function decouples a pair of signals from a single signal via multiplication.
- *
- * @param q                 pointer to the COOKContext
- * @param subband           index of the current subband
- * @param f1                multiplier for channel 1 extraction
- * @param f2                multiplier for channel 2 extraction
- * @param decode_buffer     input buffer
- * @param mlt_buffer1       pointer to left channel mlt coefficients
- * @param mlt_buffer2       pointer to right channel mlt coefficients
- */
-static void decouple_float(COOKContext *q,
-                           COOKSubpacket *p,
-                           int subband,
-                           float f1, float f2,
-                           float *decode_buffer,
-                           float *mlt_buffer1, float *mlt_buffer2)
-{
-    int j, tmp_idx;
-    for (j = 0; j < SUBBAND_SIZE; j++) {
-        tmp_idx = ((p->js_subband_start + subband) * SUBBAND_SIZE) + j;
-        mlt_buffer1[SUBBAND_SIZE * subband + j] = f1 * decode_buffer[tmp_idx];
-        mlt_buffer2[SUBBAND_SIZE * subband + j] = f2 * decode_buffer[tmp_idx];
-    }
-}
-
-/**
- * function for decoding joint stereo data
- *
- * @param q                 pointer to the COOKContext
- * @param mlt_buffer1       pointer to left channel mlt coefficients
- * @param mlt_buffer2       pointer to right channel mlt coefficients
- */
-static int joint_decode(COOKContext *q, COOKSubpacket *p,
-                        float *mlt_buffer_left, float *mlt_buffer_right)
-{
-    int i, j, res;
-    int decouple_tab[SUBBAND_SIZE] = { 0 };
-    float *decode_buffer = q->decode_buffer_0;
-    int idx, cpl_tmp;
-    float f1, f2;
-    const float *cplscale;
-
-    memset(decode_buffer, 0, sizeof(q->decode_buffer_0));
-
-    /* Make sure the buffers are zeroed out. */
-    memset(mlt_buffer_left,  0, 1024 * sizeof(*mlt_buffer_left));
-    memset(mlt_buffer_right, 0, 1024 * sizeof(*mlt_buffer_right));
-    decouple_info(q, p, decouple_tab);
-    if ((res = mono_decode(q, p, decode_buffer)) < 0)
-        return res;
-
-    /* The two channels are stored interleaved in decode_buffer. */
-    for (i = 0; i < p->js_subband_start; i++) {
-        for (j = 0; j < SUBBAND_SIZE; j++) {
-            mlt_buffer_left[i  * 20 + j] = decode_buffer[i * 40 + j];
-            mlt_buffer_right[i * 20 + j] = decode_buffer[i * 40 + 20 + j];
-        }
-    }
-
-    /* When we reach js_subband_start (the higher frequencies)
-       the coefficients are stored in a coupling scheme. */
-    idx = (1 << p->js_vlc_bits) - 1;
-    for (i = p->js_subband_start; i < p->subbands; i++) {
-        cpl_tmp = cplband[i];
-        idx -= decouple_tab[cpl_tmp];
-        cplscale = q->cplscales[p->js_vlc_bits - 2];  // choose decoupler table
-        f1 = cplscale[decouple_tab[cpl_tmp] + 1];
-        f2 = cplscale[idx];
-        q->decouple(q, p, i, f1, f2, decode_buffer,
-                    mlt_buffer_left, mlt_buffer_right);
-        idx = (1 << p->js_vlc_bits) - 1;
-    }
-
-    return 0;
-}
-
-/**
- * First part of subpacket decoding:
- *  decode raw stream bytes and read gain info.
- *
- * @param q                 pointer to the COOKContext
- * @param inbuffer          pointer to raw stream data
- * @param gains_ptr         array of current/prev gain pointers
- */
-static inline void decode_bytes_and_gain(COOKContext *q, COOKSubpacket *p,
-                                         const uint8_t *inbuffer,
-                                         cook_gains *gains_ptr)
-{
-    int offset;
-
-    offset = decode_bytes(inbuffer, q->decoded_bytes_buffer,
-                          p->bits_per_subpacket / 8);
-    init_get_bits(&q->gb, q->decoded_bytes_buffer + offset,
-                  p->bits_per_subpacket);
-    decode_gain_info(&q->gb, gains_ptr->now);
-
-    /* Swap current and previous gains */
-    FFSWAP(int *, gains_ptr->now, gains_ptr->previous);
-}
-
-/**
- * Saturate the output signal and interleave.
- *
- * @param q                 pointer to the COOKContext
- * @param out               pointer to the output vector
- */
-static void saturate_output_float(COOKContext *q, float *out)
-{
-    q->dsp.vector_clipf(out, q->mono_mdct_output + q->samples_per_channel,
-                        -1.0f, 1.0f, FFALIGN(q->samples_per_channel, 8));
-}
-
-
-/**
- * Final part of subpacket decoding:
- *  Apply modulated lapped transform, gain compensation,
- *  clip and convert to integer.
- *
- * @param q                 pointer to the COOKContext
- * @param decode_buffer     pointer to the mlt coefficients
- * @param gains_ptr         array of current/prev gain pointers
- * @param previous_buffer   pointer to the previous buffer to be used for overlapping
- * @param out               pointer to the output buffer
- */
-static inline void mlt_compensate_output(COOKContext *q, float *decode_buffer,
-                                         cook_gains *gains_ptr, float *previous_buffer,
-                                         float *out)
-{
-    imlt_gain(q, decode_buffer, gains_ptr, previous_buffer);
-    if (out)
-        q->saturate_output(q, out);
-}
-
-
-/**
- * Cook subpacket decoding. This function returns one decoded subpacket,
- * usually 1024 samples per channel.
- *
- * @param q                 pointer to the COOKContext
- * @param inbuffer          pointer to the inbuffer
- * @param outbuffer         pointer to the outbuffer
- */
-static int decode_subpacket(COOKContext *q, COOKSubpacket *p,
-                            const uint8_t *inbuffer, float **outbuffer)
-{
-    int sub_packet_size = p->size;
-    int res;
-
-    memset(q->decode_buffer_1, 0, sizeof(q->decode_buffer_1));
-    decode_bytes_and_gain(q, p, inbuffer, &p->gains1);
-
-    if (p->joint_stereo) {
-        if ((res = joint_decode(q, p, q->decode_buffer_1, q->decode_buffer_2)) < 0)
-            return res;
-    } else {
-        if ((res = mono_decode(q, p, q->decode_buffer_1)) < 0)
-            return res;
-
-        if (p->num_channels == 2) {
-            decode_bytes_and_gain(q, p, inbuffer + sub_packet_size / 2, &p->gains2);
-            if ((res = mono_decode(q, p, q->decode_buffer_2)) < 0)
-                return res;
-        }
-    }
-
-    mlt_compensate_output(q, q->decode_buffer_1, &p->gains1,
-                          p->mono_previous_buffer1,
-                          outbuffer ? outbuffer[p->ch_idx] : NULL);
-
-    if (p->num_channels == 2)
-        if (p->joint_stereo)
-            mlt_compensate_output(q, q->decode_buffer_2, &p->gains1,
-                                  p->mono_previous_buffer2,
-                                  outbuffer ? outbuffer[p->ch_idx + 1] : NULL);
-        else
-            mlt_compensate_output(q, q->decode_buffer_2, &p->gains2,
-                                  p->mono_previous_buffer2,
-                                  outbuffer ? outbuffer[p->ch_idx + 1] : NULL);
-
-    return 0;
-}
-
-
-static int cook_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    COOKContext *q = avctx->priv_data;
-    float **samples = NULL;
-    int i, ret;
-    int offset = 0;
-    int chidx = 0;
-
-    if (buf_size < avctx->block_align)
-        return buf_size;
-
-    /* get output buffer */
-    if (q->discarded_packets >= 2) {
-        frame->nb_samples = q->samples_per_channel;
-        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-        samples = (float **)frame->extended_data;
-    }
-
-    /* estimate subpacket sizes */
-    q->subpacket[0].size = avctx->block_align;
-
-    for (i = 1; i < q->num_subpackets; i++) {
-        q->subpacket[i].size = 2 * buf[avctx->block_align - q->num_subpackets + i];
-        q->subpacket[0].size -= q->subpacket[i].size + 1;
-        if (q->subpacket[0].size < 0) {
-            av_log(avctx, AV_LOG_DEBUG,
-                   "frame subpacket size total > avctx->block_align!\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    /* decode supbackets */
-    for (i = 0; i < q->num_subpackets; i++) {
-        q->subpacket[i].bits_per_subpacket = (q->subpacket[i].size * 8) >>
-                                              q->subpacket[i].bits_per_subpdiv;
-        q->subpacket[i].ch_idx = chidx;
-        av_log(avctx, AV_LOG_DEBUG,
-               "subpacket[%i] size %i js %i %i block_align %i\n",
-               i, q->subpacket[i].size, q->subpacket[i].joint_stereo, offset,
-               avctx->block_align);
-
-        if ((ret = decode_subpacket(q, &q->subpacket[i], buf + offset, samples)) < 0)
-            return ret;
-        offset += q->subpacket[i].size;
-        chidx += q->subpacket[i].num_channels;
-        av_log(avctx, AV_LOG_DEBUG, "subpacket[%i] %i %i\n",
-               i, q->subpacket[i].size * 8, get_bits_count(&q->gb));
-    }
-
-    /* Discard the first two frames: no valid audio. */
-    if (q->discarded_packets < 2) {
-        q->discarded_packets++;
-        *got_frame_ptr = 0;
-        return avctx->block_align;
-    }
-
-    *got_frame_ptr = 1;
-
-    return avctx->block_align;
-}
-
-#ifdef DEBUG
-static void dump_cook_context(COOKContext *q)
-{
-    //int i=0;
-#define PRINT(a, b) av_dlog(q->avctx, " %s = %d\n", a, b);
-    av_dlog(q->avctx, "COOKextradata\n");
-    av_dlog(q->avctx, "cookversion=%x\n", q->subpacket[0].cookversion);
-    if (q->subpacket[0].cookversion > STEREO) {
-        PRINT("js_subband_start", q->subpacket[0].js_subband_start);
-        PRINT("js_vlc_bits", q->subpacket[0].js_vlc_bits);
-    }
-    av_dlog(q->avctx, "COOKContext\n");
-    PRINT("nb_channels", q->avctx->channels);
-    PRINT("bit_rate", q->avctx->bit_rate);
-    PRINT("sample_rate", q->avctx->sample_rate);
-    PRINT("samples_per_channel", q->subpacket[0].samples_per_channel);
-    PRINT("subbands", q->subpacket[0].subbands);
-    PRINT("js_subband_start", q->subpacket[0].js_subband_start);
-    PRINT("log2_numvector_size", q->subpacket[0].log2_numvector_size);
-    PRINT("numvector_size", q->subpacket[0].numvector_size);
-    PRINT("total_subbands", q->subpacket[0].total_subbands);
-}
-#endif
-
-/**
- * Cook initialization
- *
- * @param avctx     pointer to the AVCodecContext
- */
-static av_cold int cook_decode_init(AVCodecContext *avctx)
-{
-    COOKContext *q = avctx->priv_data;
-    const uint8_t *edata_ptr = avctx->extradata;
-    const uint8_t *edata_ptr_end = edata_ptr + avctx->extradata_size;
-    int extradata_size = avctx->extradata_size;
-    int s = 0;
-    unsigned int channel_mask = 0;
-    int samples_per_frame;
-    int ret;
-    q->avctx = avctx;
-
-    /* Take care of the codec specific extradata. */
-    if (extradata_size <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "Necessary extradata missing!\n");
-        return AVERROR_INVALIDDATA;
-    }
-    av_log(avctx, AV_LOG_DEBUG, "codecdata_length=%d\n", avctx->extradata_size);
-
-    /* Take data from the AVCodecContext (RM container). */
-    if (!avctx->channels) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Initialize RNG. */
-    av_lfg_init(&q->random_state, 0);
-
-    ff_dsputil_init(&q->dsp, avctx);
-
-    while (edata_ptr < edata_ptr_end) {
-        /* 8 for mono, 16 for stereo, ? for multichannel
-           Swap to right endianness so we don't need to care later on. */
-        if (extradata_size >= 8) {
-            q->subpacket[s].cookversion = bytestream_get_be32(&edata_ptr);
-            samples_per_frame           = bytestream_get_be16(&edata_ptr);
-            q->subpacket[s].subbands = bytestream_get_be16(&edata_ptr);
-            extradata_size -= 8;
-        }
-        if (extradata_size >= 8) {
-            bytestream_get_be32(&edata_ptr);    // Unknown unused
-            q->subpacket[s].js_subband_start = bytestream_get_be16(&edata_ptr);
-            q->subpacket[s].js_vlc_bits = bytestream_get_be16(&edata_ptr);
-            extradata_size -= 8;
-        }
-
-        /* Initialize extradata related variables. */
-        q->subpacket[s].samples_per_channel = samples_per_frame / avctx->channels;
-        q->subpacket[s].bits_per_subpacket = avctx->block_align * 8;
-
-        /* Initialize default data states. */
-        q->subpacket[s].log2_numvector_size = 5;
-        q->subpacket[s].total_subbands = q->subpacket[s].subbands;
-        q->subpacket[s].num_channels = 1;
-
-        /* Initialize version-dependent variables */
-
-        av_log(avctx, AV_LOG_DEBUG, "subpacket[%i].cookversion=%x\n", s,
-               q->subpacket[s].cookversion);
-        q->subpacket[s].joint_stereo = 0;
-        switch (q->subpacket[s].cookversion) {
-        case MONO:
-            if (avctx->channels != 1) {
-                avpriv_request_sample(avctx, "Container channels != 1");
-                return AVERROR_PATCHWELCOME;
-            }
-            av_log(avctx, AV_LOG_DEBUG, "MONO\n");
-            break;
-        case STEREO:
-            if (avctx->channels != 1) {
-                q->subpacket[s].bits_per_subpdiv = 1;
-                q->subpacket[s].num_channels = 2;
-            }
-            av_log(avctx, AV_LOG_DEBUG, "STEREO\n");
-            break;
-        case JOINT_STEREO:
-            if (avctx->channels != 2) {
-                avpriv_request_sample(avctx, "Container channels != 2");
-                return AVERROR_PATCHWELCOME;
-            }
-            av_log(avctx, AV_LOG_DEBUG, "JOINT_STEREO\n");
-            if (avctx->extradata_size >= 16) {
-                q->subpacket[s].total_subbands = q->subpacket[s].subbands +
-                                                 q->subpacket[s].js_subband_start;
-                q->subpacket[s].joint_stereo = 1;
-                q->subpacket[s].num_channels = 2;
-            }
-            if (q->subpacket[s].samples_per_channel > 256) {
-                q->subpacket[s].log2_numvector_size = 6;
-            }
-            if (q->subpacket[s].samples_per_channel > 512) {
-                q->subpacket[s].log2_numvector_size = 7;
-            }
-            break;
-        case MC_COOK:
-            av_log(avctx, AV_LOG_DEBUG, "MULTI_CHANNEL\n");
-            if (extradata_size >= 4)
-                channel_mask |= q->subpacket[s].channel_mask = bytestream_get_be32(&edata_ptr);
-
-            if (av_get_channel_layout_nb_channels(q->subpacket[s].channel_mask) > 1) {
-                q->subpacket[s].total_subbands = q->subpacket[s].subbands +
-                                                 q->subpacket[s].js_subband_start;
-                q->subpacket[s].joint_stereo = 1;
-                q->subpacket[s].num_channels = 2;
-                q->subpacket[s].samples_per_channel = samples_per_frame >> 1;
-
-                if (q->subpacket[s].samples_per_channel > 256) {
-                    q->subpacket[s].log2_numvector_size = 6;
-                }
-                if (q->subpacket[s].samples_per_channel > 512) {
-                    q->subpacket[s].log2_numvector_size = 7;
-                }
-            } else
-                q->subpacket[s].samples_per_channel = samples_per_frame;
-
-            break;
-        default:
-            avpriv_request_sample(avctx, "Cook version %d",
-                                  q->subpacket[s].cookversion);
-            return AVERROR_PATCHWELCOME;
-        }
-
-        if (s > 1 && q->subpacket[s].samples_per_channel != q->samples_per_channel) {
-            av_log(avctx, AV_LOG_ERROR, "different number of samples per channel!\n");
-            return AVERROR_INVALIDDATA;
-        } else
-            q->samples_per_channel = q->subpacket[0].samples_per_channel;
-
-
-        /* Initialize variable relations */
-        q->subpacket[s].numvector_size = (1 << q->subpacket[s].log2_numvector_size);
-
-        /* Try to catch some obviously faulty streams, othervise it might be exploitable */
-        if (q->subpacket[s].total_subbands > 53) {
-            avpriv_request_sample(avctx, "total_subbands > 53");
-            return AVERROR_PATCHWELCOME;
-        }
-
-        if ((q->subpacket[s].js_vlc_bits > 6) ||
-            (q->subpacket[s].js_vlc_bits < 2 * q->subpacket[s].joint_stereo)) {
-            av_log(avctx, AV_LOG_ERROR, "js_vlc_bits = %d, only >= %d and <= 6 allowed!\n",
-                   q->subpacket[s].js_vlc_bits, 2 * q->subpacket[s].joint_stereo);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (q->subpacket[s].subbands > 50) {
-            avpriv_request_sample(avctx, "subbands > 50");
-            return AVERROR_PATCHWELCOME;
-        }
-        q->subpacket[s].gains1.now      = q->subpacket[s].gain_1;
-        q->subpacket[s].gains1.previous = q->subpacket[s].gain_2;
-        q->subpacket[s].gains2.now      = q->subpacket[s].gain_3;
-        q->subpacket[s].gains2.previous = q->subpacket[s].gain_4;
-
-        q->num_subpackets++;
-        s++;
-        if (s > MAX_SUBPACKETS) {
-            avpriv_request_sample(avctx, "subpackets > %d", MAX_SUBPACKETS);
-            return AVERROR_PATCHWELCOME;
-        }
-    }
-    /* Generate tables */
-    init_pow2table();
-    init_gain_table(q);
-    init_cplscales_table(q);
-
-    if ((ret = init_cook_vlc_tables(q)))
-        return ret;
-
-
-    if (avctx->block_align >= UINT_MAX / 2)
-        return AVERROR(EINVAL);
-
-    /* Pad the databuffer with:
-       DECODE_BYTES_PAD1 or DECODE_BYTES_PAD2 for decode_bytes(),
-       FF_INPUT_BUFFER_PADDING_SIZE, for the bitstreamreader. */
-    q->decoded_bytes_buffer =
-        av_mallocz(avctx->block_align
-                   + DECODE_BYTES_PAD1(avctx->block_align)
-                   + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (q->decoded_bytes_buffer == NULL)
-        return AVERROR(ENOMEM);
-
-    /* Initialize transform. */
-    if ((ret = init_cook_mlt(q)))
-        return ret;
-
-    /* Initialize COOK signal arithmetic handling */
-    if (1) {
-        q->scalar_dequant  = scalar_dequant_float;
-        q->decouple        = decouple_float;
-        q->imlt_window     = imlt_window_float;
-        q->interpolate     = interpolate_float;
-        q->saturate_output = saturate_output_float;
-    }
-
-    /* Try to catch some obviously faulty streams, othervise it might be exploitable */
-    if (q->samples_per_channel != 256 && q->samples_per_channel != 512 &&
-        q->samples_per_channel != 1024) {
-        avpriv_request_sample(avctx, "samples_per_channel = %d",
-                              q->samples_per_channel);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-    if (channel_mask)
-        avctx->channel_layout = channel_mask;
-    else
-        avctx->channel_layout = (avctx->channels == 2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
-
-#ifdef DEBUG
-    dump_cook_context(q);
-#endif
-    return 0;
-}
-
-AVCodec ff_cook_decoder = {
-    .name           = "cook",
-    .long_name      = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_COOK,
-    .priv_data_size = sizeof(COOKContext),
-    .init           = cook_decode_init,
-    .close          = cook_decode_close,
-    .decode         = cook_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/cook_parser.c b/deps/libav/libavcodec/cook_parser.c
deleted file mode 100644
index f140e90..0000000
--- a/deps/libav/libavcodec/cook_parser.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Cook audio parser
- *
- * Determines subpacket duration from extradata.
- */
-
-#include <stdint.h>
-
-#include "libavutil/intreadwrite.h"
-#include "parser.h"
-
-typedef struct CookParseContext {
-    int duration;
-} CookParseContext;
-
-static int cook_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
-                      const uint8_t **poutbuf, int *poutbuf_size,
-                      const uint8_t *buf, int buf_size)
-{
-    CookParseContext *s = s1->priv_data;
-
-    if (s->duration)
-        s1->duration = s->duration;
-    else if (avctx->extradata && avctx->extradata_size >= 8 && avctx->channels)
-        s->duration = AV_RB16(avctx->extradata + 4) / avctx->channels;
-
-    /* always return the full packet. this parser isn't doing any splitting or
-       combining, only setting packet duration */
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return buf_size;
-}
-
-AVCodecParser ff_cook_parser = {
-    .codec_ids      = { AV_CODEC_ID_COOK },
-    .priv_data_size = sizeof(CookParseContext),
-    .parser_parse   = cook_parse,
-};
diff --git a/deps/libav/libavcodec/cookdata.h b/deps/libav/libavcodec/cookdata.h
deleted file mode 100644
index c4c26fa..0000000
--- a/deps/libav/libavcodec/cookdata.h
+++ /dev/null
@@ -1,580 +0,0 @@
-/*
- * COOK compatible decoder data
- * Copyright (c) 2003 Sascha Sommer
- * Copyright (c) 2005 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Cook AKA RealAudio G2 compatible decoderdata
- */
-
-#ifndef AVCODEC_COOKDATA_H
-#define AVCODEC_COOKDATA_H
-
-#include <stdint.h>
-
-/* various data tables */
-
-static const int expbits_tab[8] = {
-    52,47,43,37,29,22,16,0,
-};
-
-static const float dither_tab[9] = {
-  0.0, 0.0, 0.0, 0.0, 0.0, 0.176777, 0.25, 0.707107, 1.0
-};
-
-static const float quant_centroid_tab[7][14] = {
-  { 0.000, 0.392, 0.761, 1.120, 1.477, 1.832, 2.183, 2.541, 2.893, 3.245, 3.598, 3.942, 4.288, 4.724 },
-  { 0.000, 0.544, 1.060, 1.563, 2.068, 2.571, 3.072, 3.562, 4.070, 4.620, 0.000, 0.000, 0.000, 0.000 },
-  { 0.000, 0.746, 1.464, 2.180, 2.882, 3.584, 4.316, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 },
-  { 0.000, 1.006, 2.000, 2.993, 3.985, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 },
-  { 0.000, 1.321, 2.703, 3.983, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 },
-  { 0.000, 1.657, 3.491, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 },
-  { 0.000, 1.964, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }
-};
-
-static const int invradix_tab[7] = {
-    74899, 104858, 149797, 209716, 262144, 349526, 524288,
-};
-
-static const int kmax_tab[7] = {
-    13, 9, 6, 4, 3, 2, 1,
-};
-
-static const int vd_tab[7] = {
-    2, 2, 2, 4, 4, 5, 5,
-};
-
-static const int vpr_tab[7] = {
-    10, 10, 10, 5, 5, 4, 4,
-};
-
-
-
-/* VLC data */
-
-static const int vhsize_tab[7] = {
-    191, 97, 48, 607, 246, 230, 32,
-};
-
-static const int vhvlcsize_tab[7] = {
-    8, 7, 7, 10, 9, 9, 6,
-};
-
-static const uint8_t envelope_quant_index_huffbits[13][24] = {
-    {  4,  6,  5,  5,  4, 4, 4, 4, 4, 4, 3, 3, 3, 4, 5, 7,  8,  9, 11, 11, 12, 12, 12, 12 },
-    { 10,  8,  6,  5,  5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 7, 9, 11, 12, 13, 15, 15, 15, 16, 16 },
-    { 12, 10,  8,  6,  5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 4, 4,  5,  5,  7,  9, 11, 13, 14, 14 },
-    { 13, 10,  9,  9,  7, 7, 5, 5, 4, 3, 3, 3, 3, 3, 4, 4,  4,  5,  7,  9, 11, 13, 13, 13 },
-    { 12, 13, 10,  8,  6, 6, 5, 5, 4, 4, 3, 3, 3, 3, 3, 4,  5,  5,  6,  7,  9, 11, 14, 14 },
-    { 12, 11,  9,  8,  8, 7, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4,  5,  5,  7,  8, 10, 13, 14, 14 },
-    { 15, 16, 15, 12, 10, 8, 6, 5, 4, 3, 3, 3, 2, 3, 4, 5,  5,  7,  9, 11, 13, 16, 16, 16 },
-    { 14, 14, 11, 10,  9, 7, 7, 5, 5, 4, 3, 3, 2, 3, 3, 4,  5,  7,  9,  9, 12, 14, 15, 15 },
-    {  9,  9,  9,  8,  7, 6, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5,  6,  7,  8, 10, 11, 12, 13, 13 },
-    { 14, 12, 10,  8,  6, 6, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5,  6,  8,  8,  9, 11, 14, 14, 14 },
-    { 13, 10,  9,  8,  6, 6, 5, 4, 4, 4, 3, 3, 2, 3, 4, 5,  6,  8,  9,  9, 11, 12, 14, 14 },
-    { 16, 13, 12, 11,  9, 6, 5, 5, 4, 4, 4, 3, 2, 3, 3, 4,  5,  7,  8, 10, 14, 16, 16, 16 },
-    { 13, 14, 14, 14, 10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4,  5,  5,  7,  9, 11, 14, 14, 14 },
-};
-
-static const uint16_t envelope_quant_index_huffcodes[13][24] = {
-    {0x0006, 0x003e, 0x001c, 0x001d, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x0000, 0x0001,
-     0x0002, 0x000d, 0x001e, 0x007e, 0x00fe, 0x01fe, 0x07fc, 0x07fd, 0x0ffc, 0x0ffd, 0x0ffe, 0x0fff},
-    {0x03fe, 0x00fe, 0x003e, 0x001c, 0x001d, 0x000c, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
-     0x000d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x0ffe, 0x1ffe, 0x7ffc, 0x7ffd, 0x7ffe, 0xfffe, 0xffff},
-    {0x0ffe, 0x03fe, 0x00fe, 0x003e, 0x001c, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x0000,
-     0x0001, 0x0002, 0x000c, 0x000d, 0x001d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x1ffe, 0x3ffe, 0x3fff},
-    {0x1ffc, 0x03fe, 0x01fc, 0x01fd, 0x007c, 0x007d, 0x001c, 0x001d, 0x000a, 0x0000, 0x0001, 0x0002,
-     0x0003, 0x0004, 0x000b, 0x000c, 0x000d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x1ffd, 0x1ffe, 0x1fff},
-    {0x0ffe, 0x1ffe, 0x03fe, 0x00fe, 0x003c, 0x003d, 0x001a, 0x001b, 0x000a, 0x000b, 0x0000, 0x0001,
-     0x0002, 0x0003, 0x0004, 0x000c, 0x001c, 0x001d, 0x003e, 0x007e, 0x01fe, 0x07fe, 0x3ffe, 0x3fff},
-    {0x0ffe, 0x07fe, 0x01fe, 0x00fc, 0x00fd, 0x007c, 0x001c, 0x000a, 0x000b, 0x0000, 0x0001, 0x0002,
-     0x0003, 0x0004, 0x000c, 0x000d, 0x001d, 0x001e, 0x007d, 0x00fe, 0x03fe, 0x1ffe, 0x3ffe, 0x3fff},
-    {0x7ffc, 0xfffc, 0x7ffd, 0x0ffe, 0x03fe, 0x00fe, 0x003e, 0x001c, 0x000c, 0x0002, 0x0003, 0x0004,
-     0x0000, 0x0005, 0x000d, 0x001d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x1ffe, 0xfffd, 0xfffe, 0xffff},
-    {0x3ffc, 0x3ffd, 0x07fe, 0x03fe, 0x01fc, 0x007c, 0x007d, 0x001c, 0x001d, 0x000c, 0x0002, 0x0003,
-     0x0000, 0x0004, 0x0005, 0x000d, 0x001e, 0x007e, 0x01fd, 0x01fe, 0x0ffe, 0x3ffe, 0x7ffe, 0x7fff},
-    {0x01fc, 0x01fd, 0x01fe, 0x00fc, 0x007c, 0x003c, 0x001c, 0x000c, 0x0000, 0x0001, 0x0002, 0x0003,
-     0x0004, 0x0005, 0x000d, 0x001d, 0x003d, 0x007d, 0x00fd, 0x03fe, 0x07fe, 0x0ffe, 0x1ffe, 0x1fff},
-    {0x3ffc, 0x0ffe, 0x03fe, 0x00fc, 0x003c, 0x003d, 0x001c, 0x000c, 0x0000, 0x0001, 0x0002, 0x0003,
-     0x0004, 0x0005, 0x000d, 0x001d, 0x003e, 0x00fd, 0x00fe, 0x01fe, 0x07fe, 0x3ffd, 0x3ffe, 0x3fff},
-    {0x1ffe, 0x03fe, 0x01fc, 0x00fc, 0x003c, 0x003d, 0x001c, 0x000a, 0x000b, 0x000c, 0x0002, 0x0003,
-     0x0000, 0x0004, 0x000d, 0x001d, 0x003e, 0x00fd, 0x01fd, 0x01fe, 0x07fe, 0x0ffe, 0x3ffe, 0x3fff},
-    {0xfffc, 0x1ffe, 0x0ffe, 0x07fe, 0x01fe, 0x003e, 0x001c, 0x001d, 0x000a, 0x000b, 0x000c, 0x0002,
-     0x0000, 0x0003, 0x0004, 0x000d, 0x001e, 0x007e, 0x00fe, 0x03fe, 0x3ffe, 0xfffd, 0xfffe, 0xffff},
-    {0x1ffc, 0x3ffa, 0x3ffb, 0x3ffc, 0x03fe, 0x00fe, 0x007c, 0x007d, 0x001c, 0x000c, 0x0002, 0x0003,
-     0x0000, 0x0004, 0x0005, 0x000d, 0x001d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x3ffd, 0x3ffe, 0x3fff},
-};
-
-
-static const uint8_t cvh_huffbits0[191] = {
-    1, 4, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10,
-    11, 11, 4, 5, 6, 7, 7, 8, 8, 9, 9, 9,
-    9, 10, 11, 11, 5, 6, 7, 8, 8, 9, 9, 9,
-    9, 10, 10, 10, 11, 12, 6, 7, 8, 9, 9, 9,
-    9, 10, 10, 10, 10, 11, 12, 13, 7, 7, 8, 9,
-    9, 9, 10, 10, 10, 10, 11, 11, 12, 13, 8, 8,
-    9, 9, 9, 10, 10, 10, 10, 11, 11, 12, 13, 14,
-    8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13,
-    13, 15, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12,
-    12, 13, 14, 15, 9, 9, 9, 10, 10, 10, 11, 11,
-    12, 13, 12, 14, 15, 16, 9, 9, 10, 10, 10, 10,
-    11, 12, 12, 14, 14, 16, 16, 0, 9, 9, 10, 10,
-    11, 11, 12, 13, 13, 14, 14, 15, 0, 0, 10, 10,
-    10, 11, 11, 12, 12, 13, 15, 15, 16, 0, 0, 0,
-    11, 11, 11, 12, 13, 13, 13, 15, 16, 16, 0, 0,
-    0, 0, 11, 11, 12, 13, 13, 14, 15, 16, 16,
-};
-
-static const uint16_t cvh_huffcodes0[191] = {
-    0x0000,0x0008,0x002c,0x002d,0x0062,0x0063,0x00d4,0x00d5,0x00d6,0x01c6,0x01c7,0x03ca,
-    0x07d6,0x07d7,0x0009,0x0014,0x002e,0x0064,0x0065,0x00d7,0x00d8,0x01c8,0x01c9,0x01ca,
-    0x01cb,0x03cb,0x07d8,0x07d9,0x0015,0x002f,0x0066,0x00d9,0x00da,0x01cc,0x01cd,0x01ce,
-    0x01cf,0x03cc,0x03cd,0x03ce,0x07da,0x0fe4,0x0030,0x0067,0x00db,0x01d0,0x01d1,0x01d2,
-    0x01d3,0x03cf,0x03d0,0x03d1,0x03d2,0x07db,0x0fe5,0x1fea,0x0068,0x0069,0x00dc,0x01d4,
-    0x01d5,0x01d6,0x03d3,0x03d4,0x03d5,0x03d6,0x07dc,0x07dd,0x0fe6,0x1feb,0x00dd,0x00de,
-    0x01d7,0x01d8,0x01d9,0x03d7,0x03d8,0x03d9,0x03da,0x07de,0x07df,0x0fe7,0x1fec,0x3ff2,
-    0x00df,0x00e0,0x01da,0x01db,0x03db,0x03dc,0x07e0,0x07e1,0x07e2,0x0fe8,0x0fe9,0x1fed,
-    0x1fee,0x7ff4,0x00e1,0x00e2,0x01dc,0x01dd,0x03dd,0x03de,0x07e3,0x07e4,0x07e5,0x0fea,
-    0x0feb,0x1fef,0x3ff3,0x7ff5,0x01de,0x01df,0x01e0,0x03df,0x03e0,0x03e1,0x07e6,0x07e7,
-    0x0fec,0x1ff0,0x0fed,0x3ff4,0x7ff6,0xfff8,0x01e1,0x01e2,0x03e2,0x03e3,0x03e4,0x03e5,
-    0x07e8,0x0fee,0x0fef,0x3ff5,0x3ff6,0xfff9,0xfffa,0xfffa,0x01e3,0x01e4,0x03e6,0x03e7,
-    0x07e9,0x07ea,0x0ff0,0x1ff1,0x1ff2,0x3ff7,0x3ff8,0x7ff7,0x7ff7,0xfffa,0x03e8,0x03e9,
-    0x03ea,0x07eb,0x07ec,0x0ff1,0x0ff2,0x1ff3,0x7ff8,0x7ff9,0xfffb,0x3ff8,0x7ff7,0x7ff7,
-    0x07ed,0x07ee,0x07ef,0x0ff3,0x1ff4,0x1ff5,0x1ff6,0x7ffa,0xfffc,0xfffd,0xfffb,0xfffb,
-    0x3ff8,0x7ff7,0x07f0,0x07f1,0x0ff4,0x1ff7,0x1ff8,0x3ff9,0x7ffb,0xfffe,0xffff,
-};
-
-
-static const uint8_t cvh_huffbits1[97] = {
-    1, 4, 5, 6, 7, 8, 8, 9, 10, 10, 4, 5,
-    6, 7, 7, 8, 8, 9, 9, 11, 5, 5, 6, 7,
-    8, 8, 9, 9, 10, 11, 6, 6, 7, 8, 8, 9,
-    9, 10, 11, 12, 7, 7, 8, 8, 9, 9, 10, 11,
-    11, 13, 8, 8, 8, 9, 9, 10, 10, 11, 12, 14,
-    8, 8, 8, 9, 10, 11, 11, 12, 13, 15, 9, 9,
-    9, 10, 11, 12, 12, 14, 14, 0, 9, 9, 9, 10,
-    11, 12, 14, 16, 0, 0, 10, 10, 11, 12, 13, 14,
-    16,
-};
-
-
-static const uint16_t cvh_huffcodes1[97] = {
-    0x0000,0x0008,0x0014,0x0030,0x006a,0x00e2,0x00e3,0x01e4,0x03ec,0x03ed,0x0009,0x0015,
-    0x0031,0x006b,0x006c,0x00e4,0x00e5,0x01e5,0x01e6,0x07f0,0x0016,0x0017,0x0032,0x006d,
-    0x00e6,0x00e7,0x01e7,0x01e8,0x03ee,0x07f1,0x0033,0x0034,0x006e,0x00e8,0x00e9,0x01e9,
-    0x01ea,0x03ef,0x07f2,0x0ff6,0x006f,0x0070,0x00ea,0x00eb,0x01eb,0x01ec,0x03f0,0x07f3,
-    0x07f4,0x1ffa,0x00ec,0x00ed,0x00ee,0x01ed,0x01ee,0x03f1,0x03f2,0x07f5,0x0ff7,0x3ffa,
-    0x00ef,0x00f0,0x00f1,0x01ef,0x03f3,0x07f6,0x07f7,0x0ff8,0x1ffb,0x7ffe,0x01f0,0x01f1,
-    0x01f2,0x03f4,0x07f8,0x0ff9,0x0ffa,0x3ffb,0x3ffc,0x0000,0x01f3,0x01f4,0x01f5,0x03f5,
-    0x07f9,0x0ffb,0x3ffd,0xfffe,0x0000,0x0000,0x03f6,0x03f7,0x07fa,0x0ffc,0x1ffc,0x3ffe,
-    0xffff,
-};
-
-static const uint8_t cvh_huffbits2[48] = {
-    1, 4, 5, 7, 8, 9, 10, 3, 4, 5, 7, 8,
-    9, 10, 5, 5, 6, 7, 8, 10, 10, 7, 6, 7,
-    8, 9, 10, 12, 8, 8, 8, 9, 10, 12, 14, 8,
-    9, 9, 10, 11, 15, 16, 9, 10, 11, 12, 13, 16,
-};
-
-static const uint16_t cvh_huffcodes2[48] = {
-    0x0000,0x000a,0x0018,0x0074,0x00f2,0x01f4,0x03f6,0x0004,0x000b,0x0019,0x0075,0x00f3,
-    0x01f5,0x03f7,0x001a,0x001b,0x0038,0x0076,0x00f4,0x03f8,0x03f9,0x0077,0x0039,0x0078,
-    0x00f5,0x01f6,0x03fa,0x0ffc,0x00f6,0x00f7,0x00f8,0x01f7,0x03fb,0x0ffd,0x3ffe,0x00f9,
-    0x01f8,0x01f9,0x03fc,0x07fc,0x7ffe,0xfffe,0x01fa,0x03fd,0x07fd,0x0ffe,0x1ffe,0xffff,
-};
-
-static const uint8_t cvh_huffbits3[607] = {
-    2, 4, 6, 8, 10, 5, 5, 6, 8, 10, 7, 8,
-    8, 10, 12, 9, 9, 10, 12, 15, 10, 11, 13, 16,
-    16, 5, 6, 8, 10, 11, 5, 6, 8, 10, 12, 7,
-    7, 8, 10, 13, 9, 9, 10, 12, 15, 12, 11, 13,
-    16, 16, 7, 9, 10, 12, 15, 7, 8, 10, 12, 13,
-    9, 9, 11, 13, 16, 11, 11, 12, 14, 16, 12, 12,
-    14, 16, 0, 9, 11, 12, 16, 16, 9, 10, 13, 15,
-    16, 10, 11, 12, 16, 16, 13, 13, 16, 16, 16, 16,
-    16, 15, 16, 0, 11, 13, 16, 16, 15, 11, 13, 15,
-    16, 16, 13, 13, 16, 16, 0, 14, 16, 16, 16, 0,
-    16, 16, 0, 0, 0, 4, 6, 8, 10, 13, 6, 6,
-    8, 10, 13, 9, 8, 10, 12, 16, 10, 10, 11, 15,
-    16, 13, 12, 14, 16, 16, 5, 6, 8, 11, 13, 6,
-    6, 8, 10, 13, 8, 8, 9, 11, 14, 10, 10, 12,
-    12, 16, 13, 12, 13, 15, 16, 7, 8, 9, 12, 16,
-    7, 8, 10, 12, 14, 9, 9, 10, 13, 16, 11, 10,
-    12, 15, 16, 13, 13, 16, 16, 0, 9, 11, 13, 16,
-    16, 9, 10, 12, 15, 16, 10, 11, 13, 16, 16, 13,
-    12, 16, 16, 16, 16, 16, 16, 16, 0, 11, 13, 16,
-    16, 16, 11, 13, 16, 16, 16, 12, 13, 15, 16, 0,
-    16, 16, 16, 16, 0, 16, 16, 0, 0, 0, 6, 8,
-    11, 13, 16, 8, 8, 10, 12, 16, 11, 10, 11, 13,
-    16, 12, 13, 13, 15, 16, 16, 16, 14, 16, 0, 6,
-    8, 10, 13, 16, 8, 8, 10, 12, 16, 10, 10, 11,
-    13, 16, 13, 12, 13, 16, 16, 14, 14, 14, 16, 0,
-    8, 9, 11, 13, 16, 8, 9, 11, 16, 14, 10, 10,
-    12, 15, 16, 12, 12, 13, 16, 16, 15, 16, 16, 16,
-    0, 10, 12, 15, 16, 16, 10, 12, 12, 14, 16, 12,
-    12, 13, 16, 16, 14, 15, 16, 16, 0, 16, 16, 16,
-    0, 0, 12, 15, 15, 16, 0, 13, 13, 16, 16, 0,
-    14, 16, 16, 16, 0, 16, 16, 16, 0, 0, 0, 0,
-    0, 0, 0, 8, 10, 13, 15, 16, 10, 11, 13, 16,
-    16, 13, 13, 14, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 0, 8, 10, 11, 15, 16, 9, 10, 12,
-    16, 16, 12, 12, 15, 16, 16, 16, 14, 16, 16, 16,
-    16, 16, 16, 16, 0, 9, 11, 14, 16, 16, 10, 11,
-    13, 16, 16, 14, 13, 14, 16, 16, 16, 15, 15, 16,
-    0, 16, 16, 16, 0, 0, 11, 13, 16, 16, 16, 11,
-    13, 15, 16, 16, 13, 16, 16, 16, 0, 16, 16, 16,
-    16, 0, 16, 16, 0, 0, 0, 15, 16, 16, 16, 0,
-    14, 16, 16, 16, 0, 16, 16, 16, 0, 0, 16, 16,
-    0, 0, 0, 0, 0, 0, 0, 0, 9, 13, 16, 16,
-    16, 11, 13, 16, 16, 16, 14, 15, 16, 16, 0, 15,
-    16, 16, 16, 0, 16, 16, 0, 0, 0, 9, 13, 15,
-    15, 16, 12, 13, 14, 16, 16, 16, 15, 16, 16, 0,
-    16, 16, 16, 16, 0, 16, 16, 0, 0, 0, 11, 13,
-    15, 16, 0, 12, 14, 16, 16, 0, 16, 16, 16, 16,
-    0, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 16,
-    16, 16, 16, 0, 16, 16, 16, 16, 0, 16, 16, 16,
-    0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0,
-    16, 16, 0, 0, 0, 16, 16,
-};
-
-
-static const uint16_t cvh_huffcodes3[607] = {
-    0x0000,0x0004,0x0022,0x00c6,0x03b0,0x000c,0x000d,0x0023,0x00c7,0x03b1,0x005c,0x00c8,
-    0x00c9,0x03b2,0x0fa4,0x01c2,0x01c3,0x03b3,0x0fa5,0x7f72,0x03b4,0x07b2,0x1f9a,0xff24,
-    0xff25,0x000e,0x0024,0x00ca,0x03b5,0x07b3,0x000f,0x0025,0x00cb,0x03b6,0x0fa6,0x005d,
-    0x005e,0x00cc,0x03b7,0x1f9b,0x01c4,0x01c5,0x03b8,0x0fa7,0x7f73,0x0fa8,0x07b4,0x1f9c,
-    0xff26,0xff27,0x005f,0x01c6,0x03b9,0x0fa9,0x7f74,0x0060,0x00cd,0x03ba,0x0faa,0x1f9d,
-    0x01c7,0x01c8,0x07b5,0x1f9e,0xff28,0x07b6,0x07b7,0x0fab,0x3fa2,0xff29,0x0fac,0x0fad,
-    0x3fa3,0xff2a,0x3fa2,0x01c9,0x07b8,0x0fae,0xff2b,0xff2c,0x01ca,0x03bb,0x1f9f,0x7f75,
-    0xff2d,0x03bc,0x07b9,0x0faf,0xff2e,0xff2f,0x1fa0,0x1fa1,0xff30,0xff31,0xff32,0xff33,
-    0xff34,0x7f76,0xff35,0xff31,0x07ba,0x1fa2,0xff36,0xff37,0x7f77,0x07bb,0x1fa3,0x7f78,
-    0xff38,0xff39,0x1fa4,0x1fa5,0xff3a,0xff3b,0xff2e,0x3fa4,0xff3c,0xff3d,0xff3e,0xff31,
-    0xff3f,0xff40,0xff30,0xff31,0xff31,0x0005,0x0026,0x00ce,0x03bd,0x1fa6,0x0027,0x0028,
-    0x00cf,0x03be,0x1fa7,0x01cb,0x00d0,0x03bf,0x0fb0,0xff41,0x03c0,0x03c1,0x07bc,0x7f79,
-    0xff42,0x1fa8,0x0fb1,0x3fa5,0xff43,0xff44,0x0010,0x0029,0x00d1,0x07bd,0x1fa9,0x002a,
-    0x002b,0x00d2,0x03c2,0x1faa,0x00d3,0x00d4,0x01cc,0x07be,0x3fa6,0x03c3,0x03c4,0x0fb2,
-    0x0fb3,0xff45,0x1fab,0x0fb4,0x1fac,0x7f7a,0xff46,0x0061,0x00d5,0x01cd,0x0fb5,0xff47,
-    0x0062,0x00d6,0x03c5,0x0fb6,0x3fa7,0x01ce,0x01cf,0x03c6,0x1fad,0xff48,0x07bf,0x03c7,
-    0x0fb7,0x7f7b,0xff49,0x1fae,0x1faf,0xff4a,0xff4b,0x7f7b,0x01d0,0x07c0,0x1fb0,0xff4c,
-    0xff4d,0x01d1,0x03c8,0x0fb8,0x7f7c,0xff4e,0x03c9,0x07c1,0x1fb1,0xff4f,0xff50,0x1fb2,
-    0x0fb9,0xff51,0xff52,0xff53,0xff54,0xff55,0xff56,0xff57,0xff52,0x07c2,0x1fb3,0xff58,
-    0xff59,0xff5a,0x07c3,0x1fb4,0xff5b,0xff5c,0xff5d,0x0fba,0x1fb5,0x7f7d,0xff5e,0xff4f,
-    0xff5f,0xff60,0xff61,0xff62,0xff52,0xff63,0xff64,0xff51,0xff52,0xff52,0x002c,0x00d7,
-    0x07c4,0x1fb6,0xff65,0x00d8,0x00d9,0x03ca,0x0fbb,0xff66,0x07c5,0x03cb,0x07c6,0x1fb7,
-    0xff67,0x0fbc,0x1fb8,0x1fb9,0x7f7e,0xff68,0xff69,0xff6a,0x3fa8,0xff6b,0x7f7e,0x002d,
-    0x00da,0x03cc,0x1fba,0xff6c,0x00db,0x00dc,0x03cd,0x0fbd,0xff6d,0x03ce,0x03cf,0x07c7,
-    0x1fbb,0xff6e,0x1fbc,0x0fbe,0x1fbd,0xff6f,0xff70,0x3fa9,0x3faa,0x3fab,0xff71,0xff6f,
-    0x00dd,0x01d2,0x07c8,0x1fbe,0xff72,0x00de,0x01d3,0x07c9,0xff73,0x3fac,0x03d0,0x03d1,
-    0x0fbf,0x7f7f,0xff74,0x0fc0,0x0fc1,0x1fbf,0xff75,0xff76,0x7f80,0xff77,0xff78,0xff79,
-    0xff75,0x03d2,0x0fc2,0x7f81,0xff7a,0xff7b,0x03d3,0x0fc3,0x0fc4,0x3fad,0xff7c,0x0fc5,
-    0x0fc6,0x1fc0,0xff7d,0xff7e,0x3fae,0x7f82,0xff7f,0xff80,0xff80,0xff81,0xff82,0xff83,
-    0xff80,0xff80,0x0fc7,0x7f83,0x7f84,0xff84,0xff7a,0x1fc1,0x1fc2,0xff85,0xff86,0x3fad,
-    0x3faf,0xff87,0xff88,0xff89,0xff7d,0xff8a,0xff8b,0xff8c,0xff80,0xff80,0x3fae,0x7f82,
-    0xff7f,0xff80,0xff80,0x00df,0x03d4,0x1fc3,0x7f85,0xff8d,0x03d5,0x07ca,0x1fc4,0xff8e,
-    0xff8f,0x1fc5,0x1fc6,0x3fb0,0xff90,0xff91,0xff92,0xff93,0xff94,0xff95,0xff96,0xff97,
-    0xff98,0xff99,0xff9a,0xff95,0x00e0,0x03d6,0x07cb,0x7f86,0xff9b,0x01d4,0x03d7,0x0fc8,
-    0xff9c,0xff9d,0x0fc9,0x0fca,0x7f87,0xff9e,0xff9f,0xffa0,0x3fb1,0xffa1,0xffa2,0xffa3,
-    0xffa4,0xffa5,0xffa6,0xffa7,0xffa2,0x01d5,0x07cc,0x3fb2,0xffa8,0xffa9,0x03d8,0x07cd,
-    0x1fc7,0xffaa,0xffab,0x3fb3,0x1fc8,0x3fb4,0xffac,0xffad,0xffae,0x7f88,0x7f89,0xffaf,
-    0xffaf,0xffb0,0xffb1,0xffb2,0xffaf,0xffaf,0x07ce,0x1fc9,0xffb3,0xffb4,0xffb5,0x07cf,
-    0x1fca,0x7f8a,0xffb6,0xffb7,0x1fcb,0xffb8,0xffb9,0xffba,0xffba,0xffbb,0xffbc,0xffbd,
-    0xffbe,0xffbe,0xffbf,0xffc0,0xffbd,0xffbe,0xffbe,0x7f8b,0xffc1,0xffc2,0xffc3,0xffb4,
-    0x3fb5,0xffc4,0xffc5,0xffc6,0xffb6,0xffc7,0xffc8,0xffc9,0xffba,0xffba,0xffca,0xffcb,
-    0xffbd,0xffbe,0xffbe,0xffbb,0xffbc,0xffbd,0xffbe,0xffbe,0x01d6,0x1fcc,0xffcc,0xffcd,
-    0xffce,0x07d0,0x1fcd,0xffcf,0xffd0,0xffd1,0x3fb6,0x7f8c,0xffd2,0xffd3,0xff90,0x7f8d,
-    0xffd4,0xffd5,0xffd6,0xff95,0xffd7,0xffd8,0xff94,0xff95,0xff95,0x01d7,0x1fce,0x7f8e,
-    0x7f8f,0xffd9,0x0fcb,0x1fcf,0x3fb7,0xffda,0xffdb,0xffdc,0x7f90,0xffdd,0xffde,0xff9e,
-    0xffdf,0xffe0,0xffe1,0xffe2,0xffa2,0xffe3,0xffe4,0xffa1,0xffa2,0xffa2,0x07d1,0x1fd0,
-    0x7f91,0xffe5,0xffa8,0x0fcc,0x3fb8,0xffe6,0xffe7,0xffaa,0xffe8,0xffe9,0xffea,0xffeb,
-    0xffac,0xffec,0xffed,0xffee,0xffaf,0xffaf,0xffae,0x7f88,0x7f89,0xffaf,0xffaf,0xffef,
-    0xfff0,0xfff1,0xfff2,0xffb4,0xfff3,0xfff4,0xfff5,0xfff6,0xffb6,0xfff7,0xfff8,0xfff9,
-    0xffba,0xffba,0xfffa,0xfffb,0xffbd,0xffbe,0xffbe,0xffbb,0xffbc,0xffbd,0xffbe,0xffbe,
-    0xfffc,0xfffd,0xffb3,0xffb4,0xffb4,0xfffe,0xffff,
-};
-
-static const uint8_t cvh_huffbits4[246] = {
-    2, 4, 7, 10, 4, 5, 7, 10, 7, 8, 10, 14,
-    11, 11, 15, 15, 4, 5, 9, 12, 5, 5, 8, 12,
-    8, 7, 10, 15, 11, 11, 15, 15, 7, 9, 12, 15,
-    8, 8, 12, 15, 10, 10, 13, 15, 14, 14, 15, 0,
-    11, 13, 15, 15, 11, 13, 15, 15, 14, 15, 15, 0,
-    15, 15, 0, 0, 4, 5, 9, 13, 5, 6, 9, 13,
-    9, 9, 11, 15, 14, 13, 15, 15, 4, 6, 9, 12,
-    5, 6, 9, 13, 9, 8, 11, 15, 13, 12, 15, 15,
-    7, 9, 12, 15, 7, 8, 11, 15, 10, 10, 14, 15,
-    14, 15, 15, 0, 10, 12, 15, 15, 11, 13, 15, 15,
-    15, 15, 15, 0, 15, 15, 0, 0, 6, 9, 13, 14,
-    8, 9, 12, 15, 12, 12, 15, 15, 15, 15, 15, 0,
-    7, 9, 13, 15, 8, 9, 12, 15, 11, 12, 15, 15,
-    15, 15, 15, 0, 9, 11, 15, 15, 9, 11, 15, 15,
-    14, 14, 15, 0, 15, 15, 0, 0, 14, 15, 15, 0,
-    14, 15, 15, 0, 15, 15, 0, 0, 0, 0, 0, 0,
-    9, 12, 15, 15, 12, 13, 15, 15, 15, 15, 15, 0,
-    15, 15, 0, 0, 10, 12, 15, 15, 12, 14, 15, 15,
-    15, 15, 15, 0, 15, 15, 0, 0, 14, 15, 15, 0,
-    15, 15, 15, 0, 15, 15, 0, 0, 0, 0, 0, 0,
-    15, 15, 0, 0, 15, 15,
-};
-
-
-static const uint16_t cvh_huffcodes4[246] = {
-    0x0000,0x0004,0x006c,0x03e6,0x0005,0x0012,0x006d,0x03e7,0x006e,0x00e8,0x03e8,0x3fc4,
-    0x07e0,0x07e1,0x7fa4,0x7fa5,0x0006,0x0013,0x01e2,0x0fda,0x0014,0x0015,0x00e9,0x0fdb,
-    0x00ea,0x006f,0x03e9,0x7fa6,0x07e2,0x07e3,0x7fa7,0x7fa8,0x0070,0x01e3,0x0fdc,0x7fa9,
-    0x00eb,0x00ec,0x0fdd,0x7faa,0x03ea,0x03eb,0x1fd6,0x7fab,0x3fc5,0x3fc6,0x7fac,0x1fd6,
-    0x07e4,0x1fd7,0x7fad,0x7fae,0x07e5,0x1fd8,0x7faf,0x7fb0,0x3fc7,0x7fb1,0x7fb2,0x1fd6,
-    0x7fb3,0x7fb4,0x1fd6,0x1fd6,0x0007,0x0016,0x01e4,0x1fd9,0x0017,0x0032,0x01e5,0x1fda,
-    0x01e6,0x01e7,0x07e6,0x7fb5,0x3fc8,0x1fdb,0x7fb6,0x7fb7,0x0008,0x0033,0x01e8,0x0fde,
-    0x0018,0x0034,0x01e9,0x1fdc,0x01ea,0x00ed,0x07e7,0x7fb8,0x1fdd,0x0fdf,0x7fb9,0x7fba,
-    0x0071,0x01eb,0x0fe0,0x7fbb,0x0072,0x00ee,0x07e8,0x7fbc,0x03ec,0x03ed,0x3fc9,0x7fbd,
-    0x3fca,0x7fbe,0x7fbf,0x3fc9,0x03ee,0x0fe1,0x7fc0,0x7fc1,0x07e9,0x1fde,0x7fc2,0x7fc3,
-    0x7fc4,0x7fc5,0x7fc6,0x3fc9,0x7fc7,0x7fc8,0x3fc9,0x3fc9,0x0035,0x01ec,0x1fdf,0x3fcb,
-    0x00ef,0x01ed,0x0fe2,0x7fc9,0x0fe3,0x0fe4,0x7fca,0x7fcb,0x7fcc,0x7fcd,0x7fce,0x7fca,
-    0x0073,0x01ee,0x1fe0,0x7fcf,0x00f0,0x01ef,0x0fe5,0x7fd0,0x07ea,0x0fe6,0x7fd1,0x7fd2,
-    0x7fd3,0x7fd4,0x7fd5,0x7fd1,0x01f0,0x07eb,0x7fd6,0x7fd7,0x01f1,0x07ec,0x7fd8,0x7fd9,
-    0x3fcc,0x3fcd,0x7fda,0x7fda,0x7fdb,0x7fdc,0x7fda,0x7fda,0x3fce,0x7fdd,0x7fde,0x7fd6,
-    0x3fcf,0x7fdf,0x7fe0,0x7fd8,0x7fe1,0x7fe2,0x7fda,0x7fda,0x3fcc,0x3fcd,0x7fda,0x7fda,
-    0x01f2,0x0fe7,0x7fe3,0x7fe4,0x0fe8,0x1fe1,0x7fe5,0x7fe6,0x7fe7,0x7fe8,0x7fe9,0x7fca,
-    0x7fea,0x7feb,0x7fca,0x7fca,0x03ef,0x0fe9,0x7fec,0x7fed,0x0fea,0x3fd0,0x7fee,0x7fef,
-    0x7ff0,0x7ff1,0x7ff2,0x7fd1,0x7ff3,0x7ff4,0x7fd1,0x7fd1,0x3fd1,0x7ff5,0x7ff6,0x7fd6,
-    0x7ff7,0x7ff8,0x7ff9,0x7fd8,0x7ffa,0x7ffb,0x7fda,0x7fda,0x3fcc,0x3fcd,0x7fda,0x7fda,
-    0x7ffc,0x7ffd,0x7fd6,0x7fd6,0x7ffe,0x7fff,
-};
-
-
-static const uint8_t cvh_huffbits5[230] = {
-    2, 4, 8, 4, 5, 9, 9, 10, 14, 4, 6, 11,
-    5, 6, 12, 10, 11, 15, 9, 11, 15, 10, 13, 15,
-    14, 15, 0, 4, 6, 12, 6, 7, 12, 12, 12, 15,
-    5, 7, 13, 6, 7, 13, 12, 13, 15, 10, 12, 15,
-    11, 13, 15, 15, 15, 0, 8, 13, 15, 11, 12, 15,
-    15, 15, 0, 10, 13, 15, 12, 15, 15, 15, 15, 0,
-    15, 15, 0, 15, 15, 0, 0, 0, 0, 4, 5, 11,
-    5, 7, 12, 11, 12, 15, 6, 7, 13, 7, 8, 14,
-    12, 14, 15, 11, 13, 15, 12, 13, 15, 15, 15, 0,
-    5, 6, 13, 7, 8, 15, 12, 14, 15, 6, 8, 14,
-    7, 8, 15, 14, 15, 15, 12, 12, 15, 12, 13, 15,
-    15, 15, 0, 9, 13, 15, 12, 13, 15, 15, 15, 0,
-    11, 13, 15, 13, 13, 15, 15, 15, 0, 14, 15, 0,
-    15, 15, 0, 0, 0, 0, 8, 10, 15, 11, 12, 15,
-    15, 15, 0, 10, 12, 15, 12, 13, 15, 15, 15, 0,
-    14, 15, 0, 15, 15, 0, 0, 0, 0, 8, 12, 15,
-    12, 13, 15, 15, 15, 0, 11, 13, 15, 13, 15, 15,
-    15, 15, 0, 15, 15, 0, 15, 15, 0, 0, 0, 0,
-    14, 15, 0, 15, 15, 0, 0, 0, 0, 15, 15, 0,
-    15, 15,
-};
-
-
-
-static const uint16_t cvh_huffcodes5[230] = {
-    0x0000,0x0004,0x00f0,0x0005,0x0012,0x01f0,0x01f1,0x03e8,0x3fce,0x0006,0x0030,0x07de,
-    0x0013,0x0031,0x0fd2,0x03e9,0x07df,0x7fb0,0x01f2,0x07e0,0x7fb1,0x03ea,0x1fd2,0x7fb2,
-    0x3fcf,0x7fb3,0x0031,0x0007,0x0032,0x0fd3,0x0033,0x0070,0x0fd4,0x0fd5,0x0fd6,0x7fb4,
-    0x0014,0x0071,0x1fd3,0x0034,0x0072,0x1fd4,0x0fd7,0x1fd5,0x7fb5,0x03eb,0x0fd8,0x7fb6,
-    0x07e1,0x1fd6,0x7fb7,0x7fb8,0x7fb9,0x0072,0x00f1,0x1fd7,0x7fba,0x07e2,0x0fd9,0x7fbb,
-    0x7fbc,0x7fbd,0x0070,0x03ec,0x1fd8,0x7fbe,0x0fda,0x7fbf,0x7fc0,0x7fc1,0x7fc2,0x0072,
-    0x7fc3,0x7fc4,0x0071,0x7fc5,0x7fc6,0x0072,0x0034,0x0072,0x0072,0x0008,0x0015,0x07e3,
-    0x0016,0x0073,0x0fdb,0x07e4,0x0fdc,0x7fc7,0x0035,0x0074,0x1fd9,0x0075,0x00f2,0x3fd0,
-    0x0fdd,0x3fd1,0x7fc8,0x07e5,0x1fda,0x7fc9,0x0fde,0x1fdb,0x7fca,0x7fcb,0x7fcc,0x00f2,
-    0x0017,0x0036,0x1fdc,0x0076,0x00f3,0x7fcd,0x0fdf,0x3fd2,0x7fce,0x0037,0x00f4,0x3fd3,
-    0x0077,0x00f5,0x7fcf,0x3fd4,0x7fd0,0x7fd1,0x0fe0,0x0fe1,0x7fd2,0x0fe2,0x1fdd,0x7fd3,
-    0x7fd4,0x7fd5,0x00f5,0x01f3,0x1fde,0x7fd6,0x0fe3,0x1fdf,0x7fd7,0x7fd8,0x7fd9,0x00f3,
-    0x07e6,0x1fe0,0x7fda,0x1fe1,0x1fe2,0x7fdb,0x7fdc,0x7fdd,0x00f5,0x3fd5,0x7fde,0x00f4,
-    0x7fdf,0x7fe0,0x00f5,0x0077,0x00f5,0x00f5,0x00f6,0x03ed,0x7fe1,0x07e7,0x0fe4,0x7fe2,
-    0x7fe3,0x7fe4,0x0073,0x03ee,0x0fe5,0x7fe5,0x0fe6,0x1fe3,0x7fe6,0x7fe7,0x7fe8,0x00f2,
-    0x3fd6,0x7fe9,0x0074,0x7fea,0x7feb,0x00f2,0x0075,0x00f2,0x00f2,0x00f7,0x0fe7,0x7fec,
-    0x0fe8,0x1fe4,0x7fed,0x7fee,0x7fef,0x00f3,0x07e8,0x1fe5,0x7ff0,0x1fe6,0x7ff1,0x7ff2,
-    0x7ff3,0x7ff4,0x00f5,0x7ff5,0x7ff6,0x00f4,0x7ff7,0x7ff8,0x00f5,0x0077,0x00f5,0x00f5,
-    0x3fd7,0x7ff9,0x0036,0x7ffa,0x7ffb,0x00f3,0x0076,0x00f3,0x00f3,0x7ffc,0x7ffd,0x0000,
-    0x7ffe,0x7fff,
-};
-
-
-static const uint8_t cvh_huffbits6[32] = {
-     1,  4,  4,  6,  4,  6,  6,  8,  4,  6,  6,  8,
-     6,  9,  8, 10,  4,  6,  7,  8,  6,  9,  8, 11,
-     6,  9,  8, 10,  8, 10,  9,  11,
-};
-
-static const uint16_t cvh_huffcodes6[32] = {
-    0x0000,0x0008,0x0009,0x0034,0x000a,0x0035,0x0036,0x00f6,0x000b,0x0037,0x0038,0x00f7,
-    0x0039,0x01fa,0x00f8,0x03fc,0x000c,0x003a,0x007a,0x00f9,0x003b,0x01fb,0x00fa,0x07fe,
-    0x003c,0x01fc,0x00fb,0x03fd,0x00fc,0x03fe,0x01fd,0x07ff,
-};
-
-static const uint16_t* const cvh_huffcodes[7] = {
-    cvh_huffcodes0, cvh_huffcodes1, cvh_huffcodes2, cvh_huffcodes3,
-    cvh_huffcodes4, cvh_huffcodes5, cvh_huffcodes6,
-};
-
-static const uint8_t* const cvh_huffbits[7] = {
-    cvh_huffbits0, cvh_huffbits1, cvh_huffbits2, cvh_huffbits3,
-    cvh_huffbits4, cvh_huffbits5, cvh_huffbits6,
-};
-
-
-static const uint16_t ccpl_huffcodes2[3] = {
-    0x02,0x00,0x03,
-};
-
-static const uint16_t ccpl_huffcodes3[7] = {
-    0x3e,0x1e,0x02,0x00,0x06,0x0e,0x3f,
-};
-
-static const uint16_t ccpl_huffcodes4[15] = {
-    0xfc,0xfd,0x7c,0x3c,0x1c,0x0c,0x04,0x00,0x05,0x0d,0x1d,0x3d,
-    0x7d,0xfe,0xff,
-};
-
-static const uint16_t ccpl_huffcodes5[31] = {
-    0x03f8,0x03f9,0x03fa,0x03fb,0x01f8,0x01f9,0x00f8,0x00f9,0x0078,0x0079,0x0038,0x0039,
-    0x0018,0x0019,0x0004,0x0000,0x0005,0x001a,0x001b,0x003a,0x003b,0x007a,0x007b,0x00fa,
-    0x00fb,0x01fa,0x01fb,0x03fc,0x03fd,0x03fe,0x03ff,
-};
-
-static const uint16_t ccpl_huffcodes6[63] = {
-    0x0004,0x0005,0x0005,0x0006,0x0006,0x0007,0x0007,0x0007,0x0007,0x0008,0x0008,0x0008,
-    0x0008,0x0009,0x0009,0x0009,0x0009,0x000a,0x000a,0x000a,0x000a,0x000a,0x000b,0x000b,
-    0x000b,0x000b,0x000c,0x000d,0x000e,0x000e,0x0010,0x0000,0x000a,0x0018,0x0019,0x0036,
-    0x0037,0x0074,0x0075,0x0076,0x0077,0x00f4,0x00f5,0x00f6,0x00f7,0x01f5,0x01f6,0x01f7,
-    0x01f8,0x03f6,0x03f7,0x03f8,0x03f9,0x03fa,0x07fa,0x07fb,0x07fc,0x07fd,0x0ffd,0x1ffd,
-    0x3ffd,0x3ffe,0xffff,
-};
-
-static const uint8_t ccpl_huffbits2[3] = {
-    2,1,2,
-};
-
-static const uint8_t ccpl_huffbits3[7] = {
-    6,5,2,1,3,4,6,
-};
-
-static const uint8_t ccpl_huffbits4[15] = {
-    8,8,7,6,5,4,3,1,3,4,5,6,7,8,8,
-};
-
-static const uint8_t ccpl_huffbits5[31] = {
-    10,10,10,10,9,9,8,8,7,7,6,6,
-    5,5,3,1,3,5,5,6,6,7,7,8,
-    8,9,9,10,10,10,10,
-};
-
-static const uint8_t ccpl_huffbits6[63] = {
-    16,15,14,13,12,11,11,11,11,10,10,10,
-    10,9,9,9,9,9,8,8,8,8,7,7,
-    7,7,6,6,5,5,3,1,4,5,5,6,
-    6,7,7,7,7,8,8,8,8,9,9,9,
-    9,10,10,10,10,10,11,11,11,11,12,13,
-    14,14,16,
-};
-
-static const uint16_t* const ccpl_huffcodes[5] = {
-    ccpl_huffcodes2,ccpl_huffcodes3,
-    ccpl_huffcodes4,ccpl_huffcodes5,ccpl_huffcodes6
-};
-
-static const uint8_t* const ccpl_huffbits[5] = {
-    ccpl_huffbits2,ccpl_huffbits3,
-    ccpl_huffbits4,ccpl_huffbits5,ccpl_huffbits6
-};
-
-
-//Coupling tables
-
-static const int cplband[51] = {
-    0,1,2,3,4,5,6,7,8,9,
-    10,11,11,12,12,13,13,14,14,14,
-    15,15,15,15,16,16,16,16,16,17,
-    17,17,17,17,17,18,18,18,18,18,
-    18,18,19,19,19,19,19,19,19,19,
-    19,
-};
-
-// The 1 and 0 at the beginning/end are to prevent overflows with
-// bitstream-read indexes. E.g. if n_bits=5, we can access any
-// index from [1, (1<<n_bits)] for the first decoupling coeff,
-// and (1<<n_bits)-coeff1 as index for coeff2, i.e.:
-// coeff1_idx = [1, 32], and coeff2_idx = [0, 31].
-// These values aren't part of the tables in the original binary.
-
-static const float cplscale2[5] = {
-1,
-0.953020632266998,0.70710676908493,0.302905440330505,
-0,
-};
-
-static const float cplscale3[9] = {
-1,
-0.981279790401459,0.936997592449188,0.875934481620789,0.70710676908493,
-0.482430040836334,0.349335819482803,0.192587479948997,
-0,
-};
-
-static const float cplscale4[17] = {
-1,
-0.991486728191376,0.973249018192291,0.953020632266998,0.930133521556854,
-0.903453230857849,0.870746195316315,0.826180458068848,0.70710676908493,
-0.563405573368073,0.491732746362686,0.428686618804932,0.367221474647522,
-0.302905440330505,0.229752898216248,0.130207896232605,
-0,
-};
-
-static const float cplscale5[33] = {
-1,
-0.995926380157471,0.987517595291138,0.978726446628571,0.969505727291107,
-0.95979779958725,0.949531257152557,0.938616216182709,0.926936149597168,
-0.914336204528809,0.900602877140045,0.885426938533783,0.868331849575043,
-0.84851086139679,0.824381768703461,0.791833400726318,0.70710676908493,
-0.610737144947052,0.566034197807312,0.529177963733673,0.495983630418777,
-0.464778542518616,0.434642940759659,0.404955863952637,0.375219136476517,
-0.344963222742081,0.313672333955765,0.280692428350449,0.245068684220314,
-0.205169528722763,0.157508864998817,0.0901700109243393,
-0,
-};
-
-static const float cplscale6[65] = {
-1,
-0.998005926609039,0.993956744670868,0.989822506904602,0.985598564147949,
-0.981279790401459,0.976860702037811,0.972335040569305,0.967696130275726,
-0.962936460971832,0.958047747612000,0.953020632266998,0.947844684123993,
-0.942508161067963,0.936997592449188,0.931297719478607,0.925390899181366,
-0.919256627559662,0.912870943546295,0.906205296516418,0.899225592613220,
-0.891890347003937,0.884148240089417,0.875934481620789,0.867165684700012,
-0.857730865478516,0.847477376461029,0.836184680461884,0.823513329029083,
-0.808890223503113,0.791194140911102,0.767520070075989,0.707106769084930,
-0.641024887561798,0.611565053462982,0.587959706783295,0.567296981811523,
-0.548448026180267,0.530831515789032,0.514098942279816,0.498019754886627,
-0.482430040836334,0.467206478118896,0.452251672744751,0.437485188245773,
-0.422837972640991,0.408248275518417,0.393658757209778,0.379014074802399,
-0.364258885383606,0.349335819482803,0.334183186292648,0.318732559680939,
-0.302905440330505,0.286608695983887,0.269728302955627,0.252119421958923,
-0.233590632677078,0.213876649737358,0.192587479948997,0.169101938605309,
-0.142307326197624,0.109772264957428,0.0631198287010193,
-0,
-};
-
-static const float* const cplscales[5] = {
-    cplscale2, cplscale3, cplscale4, cplscale5, cplscale6,
-};
-
-#endif /* AVCODEC_COOKDATA_H */
diff --git a/deps/libav/libavcodec/copy_block.h b/deps/libav/libavcodec/copy_block.h
deleted file mode 100644
index ec465db..0000000
--- a/deps/libav/libavcodec/copy_block.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_COPY_BLOCK_H
-#define AVCODEC_COPY_BLOCK_H
-
-#include <stdint.h>
-
-#include "libavutil/intreadwrite.h"
-
-static inline void copy_block8(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
-{
-    int i;
-    for(i=0; i<h; i++)
-    {
-        AV_COPY64U(dst, src);
-        dst+=dstStride;
-        src+=srcStride;
-    }
-}
-
-static inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
-{
-    int i;
-    for(i=0; i<h; i++)
-    {
-        AV_COPY64U(dst, src);
-        dst[8]= src[8];
-        dst+=dstStride;
-        src+=srcStride;
-    }
-}
-
-static inline void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
-{
-    int i;
-    for(i=0; i<h; i++)
-    {
-        AV_COPY128U(dst, src);
-        dst[16]= src[16];
-        dst+=dstStride;
-        src+=srcStride;
-    }
-}
-
-#endif /* AVCODEC_COPY_BLOCK_H */
diff --git a/deps/libav/libavcodec/cos_tablegen.c b/deps/libav/libavcodec/cos_tablegen.c
deleted file mode 100644
index 92b8295..0000000
--- a/deps/libav/libavcodec/cos_tablegen.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Generate a header file for hardcoded ff_cos_* tables
- *
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#define BITS 16
-#define FLOATFMT "%.18e"
-#define FIXEDFMT "%6d"
-
-static int clip_f15(int v)
-{
-    return v < -32767 ? -32767 :
-           v >  32767 ?  32767 :
-           v;
-}
-
-static void printval(double val, int fixed)
-{
-    if (fixed) {
-        /* lrint() isn't always available, so round and cast manually. */
-        double new_val = val * (double) (1 << 15);
-
-        new_val = new_val >= 0 ? floor(new_val + 0.5) : ceil(new_val - 0.5);
-
-        printf(" "FIXEDFMT",", clip_f15((long int) new_val));
-    } else {
-        printf(" "FLOATFMT",", val);
-    }
-}
-
-int main(int argc, char *argv[])
-{
-    int i, j;
-    int do_sin = argc > 1 && !strcmp(argv[1], "sin");
-    int fixed  = argc > 1 &&  strstr(argv[1], "fixed");
-    double (*func)(double) = do_sin ? sin : cos;
-
-    printf("/* This file was automatically generated. */\n");
-    printf("#define FFT_FLOAT %d\n", !fixed);
-    printf("#include \"libavcodec/%s\"\n", do_sin ? "rdft.h" : "fft.h");
-    for (i = 4; i <= BITS; i++) {
-        int m = 1 << i;
-        double freq = 2*M_PI/m;
-        printf("%s(%i) = {\n   ", do_sin ? "SINTABLE" : "COSTABLE", m);
-        for (j = 0; j < m/2 - 1; j++) {
-            int idx = j > m/4 ? m/2 - j : j;
-            if (do_sin && j >= m/4)
-                idx = m/4 - j;
-            printval(func(idx*freq), fixed);
-            if ((j & 3) == 3)
-                printf("\n   ");
-        }
-        printval(func(do_sin ? -(m/4 - 1)*freq : freq), fixed);
-        printf("\n};\n");
-    }
-    return 0;
-}
diff --git a/deps/libav/libavcodec/cscd.c b/deps/libav/libavcodec/cscd.c
deleted file mode 100644
index 9ae7e33..0000000
--- a/deps/libav/libavcodec/cscd.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * CamStudio decoder
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/common.h"
-
-#if CONFIG_ZLIB
-#include <zlib.h>
-#endif
-#include "libavutil/lzo.h"
-
-typedef struct {
-    int linelen, height, bpp;
-    unsigned int decomp_size;
-    unsigned char* decomp_buf;
-} CamStudioContext;
-
-static void copy_frame_default(AVFrame *f, const uint8_t *src, int src_stride,
-                               int linelen, int height) {
-    int i;
-    uint8_t *dst = f->data[0];
-    dst += (height - 1) * f->linesize[0];
-    for (i = height; i; i--) {
-        memcpy(dst, src, linelen);
-        src += src_stride;
-        dst -= f->linesize[0];
-    }
-}
-
-static void add_frame_default(AVFrame *f, const uint8_t *src, int src_stride,
-                              int linelen, int height) {
-    int i, j;
-    uint8_t *dst = f->data[0];
-    dst += (height - 1) * f->linesize[0];
-    for (i = height; i; i--) {
-        for (j = linelen; j; j--)
-            *dst++ += *src++;
-        src += src_stride - linelen;
-        dst -= f->linesize[0] + linelen;
-    }
-}
-
-#if !HAVE_BIGENDIAN
-#define copy_frame_16(f, s, l, h) copy_frame_default(f, s, l, l, h)
-#define copy_frame_32(f, s, l, h) copy_frame_default(f, s, l, l, h)
-#define add_frame_16(f, s, l, h) add_frame_default(f, s, l, l, h)
-#define add_frame_32(f, s, l, h) add_frame_default(f, s, l, l, h)
-#else
-static void copy_frame_16(AVFrame *f, const uint8_t *src,
-                          int linelen, int height) {
-    int i, j;
-    uint8_t *dst = f->data[0];
-    dst += (height - 1) * f->linesize[0];
-    for (i = height; i; i--) {
-        for (j = linelen / 2; j; j--) {
-          dst[0] = src[1];
-          dst[1] = src[0];
-          src += 2;
-          dst += 2;
-        }
-        dst -= f->linesize[0] + linelen;
-    }
-}
-
-static void copy_frame_32(AVFrame *f, const uint8_t *src,
-                          int linelen, int height) {
-    int i, j;
-    uint8_t *dst = f->data[0];
-    dst += (height - 1) * f->linesize[0];
-    for (i = height; i; i--) {
-        for (j = linelen / 4; j; j--) {
-          dst[0] = src[3];
-          dst[1] = src[2];
-          dst[2] = src[1];
-          dst[3] = src[0];
-          src += 4;
-          dst += 4;
-        }
-        dst -= f->linesize[0] + linelen;
-    }
-}
-
-static void add_frame_16(AVFrame *f, const uint8_t *src,
-                         int linelen, int height) {
-    int i, j;
-    uint8_t *dst = f->data[0];
-    dst += (height - 1) * f->linesize[0];
-    for (i = height; i; i--) {
-        for (j = linelen / 2; j; j--) {
-          dst[0] += src[1];
-          dst[1] += src[0];
-          src += 2;
-          dst += 2;
-        }
-        dst -= f->linesize[0] + linelen;
-    }
-}
-
-static void add_frame_32(AVFrame *f, const uint8_t *src,
-                         int linelen, int height) {
-    int i, j;
-    uint8_t *dst = f->data[0];
-    dst += (height - 1) * f->linesize[0];
-    for (i = height; i; i--) {
-        for (j = linelen / 4; j; j--) {
-          dst[0] += src[3];
-          dst[1] += src[2];
-          dst[2] += src[1];
-          dst[3] += src[0];
-          src += 4;
-          dst += 4;
-        }
-        dst -= f->linesize[0] + linelen;
-    }
-}
-#endif
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt) {
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    CamStudioContext *c = avctx->priv_data;
-    AVFrame *picture = data;
-    int ret;
-
-    if (buf_size < 2) {
-        av_log(avctx, AV_LOG_ERROR, "coded frame too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    // decompress data
-    switch ((buf[0] >> 1) & 7) {
-        case 0: { // lzo compression
-            int outlen = c->decomp_size, inlen = buf_size - 2;
-            if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen))
-                av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
-            break;
-        }
-        case 1: { // zlib compression
-#if CONFIG_ZLIB
-            unsigned long dlen = c->decomp_size;
-            if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK)
-                av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n");
-            break;
-#else
-            av_log(avctx, AV_LOG_ERROR, "compiled without zlib support\n");
-            return AVERROR(ENOSYS);
-#endif
-        }
-        default:
-            av_log(avctx, AV_LOG_ERROR, "unknown compression\n");
-            return AVERROR_INVALIDDATA;
-    }
-
-    // flip upside down, add difference frame
-    if (buf[0] & 1) { // keyframe
-        picture->pict_type = AV_PICTURE_TYPE_I;
-        picture->key_frame = 1;
-        switch (c->bpp) {
-          case 16:
-              copy_frame_16(picture, c->decomp_buf, c->linelen, c->height);
-              break;
-          case 32:
-              copy_frame_32(picture, c->decomp_buf, c->linelen, c->height);
-              break;
-          default:
-              copy_frame_default(picture, c->decomp_buf, FFALIGN(c->linelen, 4),
-                                 c->linelen, c->height);
-        }
-    } else {
-        picture->pict_type = AV_PICTURE_TYPE_P;
-        picture->key_frame = 0;
-        switch (c->bpp) {
-          case 16:
-              add_frame_16(picture, c->decomp_buf, c->linelen, c->height);
-              break;
-          case 32:
-              add_frame_32(picture, c->decomp_buf, c->linelen, c->height);
-              break;
-          default:
-              add_frame_default(picture, c->decomp_buf, FFALIGN(c->linelen, 4),
-                                c->linelen, c->height);
-        }
-    }
-
-    *got_frame = 1;
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx) {
-    CamStudioContext *c = avctx->priv_data;
-    int stride;
-    switch (avctx->bits_per_coded_sample) {
-        case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
-        case 24: avctx->pix_fmt = AV_PIX_FMT_BGR24; break;
-        case 32: avctx->pix_fmt = AV_PIX_FMT_RGB32; break;
-        default:
-            av_log(avctx, AV_LOG_ERROR,
-                   "CamStudio codec error: invalid depth %i bpp\n",
-                   avctx->bits_per_coded_sample);
-            return AVERROR_INVALIDDATA;
-    }
-    c->bpp = avctx->bits_per_coded_sample;
-    c->linelen = avctx->width * avctx->bits_per_coded_sample / 8;
-    c->height = avctx->height;
-    stride = c->linelen;
-    if (avctx->bits_per_coded_sample == 24)
-        stride = FFALIGN(stride, 4);
-    c->decomp_size = c->height * stride;
-    c->decomp_buf = av_malloc(c->decomp_size + AV_LZO_OUTPUT_PADDING);
-    if (!c->decomp_buf) {
-        av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx) {
-    CamStudioContext *c = avctx->priv_data;
-    av_freep(&c->decomp_buf);
-    return 0;
-}
-
-AVCodec ff_cscd_decoder = {
-    .name           = "camstudio",
-    .long_name      = NULL_IF_CONFIG_SMALL("CamStudio"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CSCD,
-    .priv_data_size = sizeof(CamStudioContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/cyuv.c b/deps/libav/libavcodec/cyuv.c
deleted file mode 100644
index f628ba1..0000000
--- a/deps/libav/libavcodec/cyuv.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Creative YUV (CYUV) Video Decoder
- *   by Mike Melanson (melanson at pcisys.net)
- * based on "Creative YUV (CYUV) stream format for AVI":
- *   http://www.csse.monash.edu.au/~timf/videocodec/cyuv.txt
- *
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Creative YUV (CYUV) Video Decoder.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/internal.h"
-
-
-typedef struct CyuvDecodeContext {
-    AVCodecContext *avctx;
-    int width, height;
-} CyuvDecodeContext;
-
-static av_cold int cyuv_decode_init(AVCodecContext *avctx)
-{
-    CyuvDecodeContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    s->width = avctx->width;
-    /* width needs to be divisible by 4 for this codec to work */
-    if (s->width & 0x3)
-        return AVERROR_INVALIDDATA;
-    s->height = avctx->height;
-    avctx->pix_fmt = AV_PIX_FMT_YUV411P;
-
-    return 0;
-}
-
-static int cyuv_decode_frame(AVCodecContext *avctx,
-                             void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    CyuvDecodeContext *s=avctx->priv_data;
-    AVFrame *frame = data;
-
-    unsigned char *y_plane;
-    unsigned char *u_plane;
-    unsigned char *v_plane;
-    int y_ptr;
-    int u_ptr;
-    int v_ptr;
-
-    /* prediction error tables (make it clear that they are signed values) */
-    const signed char *y_table = (const signed char*)buf +  0;
-    const signed char *u_table = (const signed char*)buf + 16;
-    const signed char *v_table = (const signed char*)buf + 32;
-
-    unsigned char y_pred, u_pred, v_pred;
-    int stream_ptr;
-    unsigned char cur_byte;
-    int pixel_groups;
-    int ret;
-
-    if (avctx->codec_id == AV_CODEC_ID_AURA) {
-        y_table = u_table;
-        u_table = v_table;
-    }
-    /* sanity check the buffer size: A buffer has 3x16-bytes tables
-     * followed by (height) lines each with 3 bytes to represent groups
-     * of 4 pixels. Thus, the total size of the buffer ought to be:
-     *    (3 * 16) + height * (width * 3 / 4) */
-    if (buf_size != 48 + s->height * (s->width * 3 / 4)) {
-        av_log(avctx, AV_LOG_ERROR, "got a buffer with %d bytes when %d were expected\n",
-               buf_size, 48 + s->height * (s->width * 3 / 4));
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* pixel data starts 48 bytes in, after 3x16-byte tables */
-    stream_ptr = 48;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    y_plane = frame->data[0];
-    u_plane = frame->data[1];
-    v_plane = frame->data[2];
-
-    /* iterate through each line in the height */
-    for (y_ptr = 0, u_ptr = 0, v_ptr = 0;
-         y_ptr < (s->height * frame->linesize[0]);
-         y_ptr += frame->linesize[0] - s->width,
-         u_ptr += frame->linesize[1] - s->width / 4,
-         v_ptr += frame->linesize[2] - s->width / 4) {
-
-        /* reset predictors */
-        cur_byte = buf[stream_ptr++];
-        u_plane[u_ptr++] = u_pred = cur_byte & 0xF0;
-        y_plane[y_ptr++] = y_pred = (cur_byte & 0x0F) << 4;
-
-        cur_byte = buf[stream_ptr++];
-        v_plane[v_ptr++] = v_pred = cur_byte & 0xF0;
-        y_pred += y_table[cur_byte & 0x0F];
-        y_plane[y_ptr++] = y_pred;
-
-        cur_byte = buf[stream_ptr++];
-        y_pred += y_table[cur_byte & 0x0F];
-        y_plane[y_ptr++] = y_pred;
-        y_pred += y_table[(cur_byte & 0xF0) >> 4];
-        y_plane[y_ptr++] = y_pred;
-
-        /* iterate through the remaining pixel groups (4 pixels/group) */
-        pixel_groups = s->width / 4 - 1;
-        while (pixel_groups--) {
-
-            cur_byte = buf[stream_ptr++];
-            u_pred += u_table[(cur_byte & 0xF0) >> 4];
-            u_plane[u_ptr++] = u_pred;
-            y_pred += y_table[cur_byte & 0x0F];
-            y_plane[y_ptr++] = y_pred;
-
-            cur_byte = buf[stream_ptr++];
-            v_pred += v_table[(cur_byte & 0xF0) >> 4];
-            v_plane[v_ptr++] = v_pred;
-            y_pred += y_table[cur_byte & 0x0F];
-            y_plane[y_ptr++] = y_pred;
-
-            cur_byte = buf[stream_ptr++];
-            y_pred += y_table[cur_byte & 0x0F];
-            y_plane[y_ptr++] = y_pred;
-            y_pred += y_table[(cur_byte & 0xF0) >> 4];
-            y_plane[y_ptr++] = y_pred;
-
-        }
-    }
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-#if CONFIG_AURA_DECODER
-AVCodec ff_aura_decoder = {
-    .name           = "aura",
-    .long_name      = NULL_IF_CONFIG_SMALL("Auravision AURA"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_AURA,
-    .priv_data_size = sizeof(CyuvDecodeContext),
-    .init           = cyuv_decode_init,
-    .decode         = cyuv_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
-
-#if CONFIG_CYUV_DECODER
-AVCodec ff_cyuv_decoder = {
-    .name           = "cyuv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Creative YUV (CYUV)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CYUV,
-    .priv_data_size = sizeof(CyuvDecodeContext),
-    .init           = cyuv_decode_init,
-    .decode         = cyuv_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
diff --git a/deps/libav/libavcodec/dca.c b/deps/libav/libavcodec/dca.c
deleted file mode 100644
index 308211f..0000000
--- a/deps/libav/libavcodec/dca.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DCA compatible decoder data
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include "put_bits.h"
-#include "dca.h"
-
-const uint32_t avpriv_dca_sample_rates[16] =
-{
-    0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0,
-    12000, 24000, 48000, 96000, 192000
-};
-
-int ff_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
-                             int max_size)
-{
-    uint32_t mrk;
-    int i, tmp;
-    const uint16_t *ssrc = (const uint16_t *) src;
-    uint16_t *sdst = (uint16_t *) dst;
-    PutBitContext pb;
-
-    if ((unsigned) src_size > (unsigned) max_size)
-        src_size = max_size;
-
-    mrk = AV_RB32(src);
-    switch (mrk) {
-    case DCA_MARKER_RAW_BE:
-        memcpy(dst, src, src_size);
-        return src_size;
-    case DCA_MARKER_RAW_LE:
-        for (i = 0; i < (src_size + 1) >> 1; i++)
-            *sdst++ = av_bswap16(*ssrc++);
-        return src_size;
-    case DCA_MARKER_14B_BE:
-    case DCA_MARKER_14B_LE:
-        init_put_bits(&pb, dst, max_size);
-        for (i = 0; i < (src_size + 1) >> 1; i++, src += 2) {
-            tmp = ((mrk == DCA_MARKER_14B_BE) ? AV_RB16(src) : AV_RL16(src)) & 0x3FFF;
-            put_bits(&pb, 14, tmp);
-        }
-        flush_put_bits(&pb);
-        return (put_bits_count(&pb) + 7) >> 3;
-    default:
-        return AVERROR_INVALIDDATA;
-    }
-}
diff --git a/deps/libav/libavcodec/dca.h b/deps/libav/libavcodec/dca.h
deleted file mode 100644
index 0037de2..0000000
--- a/deps/libav/libavcodec/dca.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * DCA compatible decoder
- * Copyright (C) 2004 Gildas Bazin
- * Copyright (C) 2004 Benjamin Zores
- * Copyright (C) 2006 Benjamin Larsson
- * Copyright (C) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DCA_H
-#define AVCODEC_DCA_H
-
-#include <stdint.h>
-#include "libavutil/internal.h"
-
-/** DCA syncwords, also used for bitstream type detection */
-#define DCA_MARKER_RAW_BE 0x7FFE8001
-#define DCA_MARKER_RAW_LE 0xFE7F0180
-#define DCA_MARKER_14B_BE 0x1FFFE800
-#define DCA_MARKER_14B_LE 0xFF1F00E8
-
-/** DCA-HD specific block starts with this marker. */
-#define DCA_HD_MARKER     0x64582025
-
-extern av_export const uint32_t avpriv_dca_sample_rates[16];
-
-/**
- * Convert bitstream to one representation based on sync marker
- */
-int ff_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
-                             int max_size);
-
-#endif /* AVCODEC_DCA_H */
diff --git a/deps/libav/libavcodec/dca_parser.c b/deps/libav/libavcodec/dca_parser.c
deleted file mode 100644
index e233f50..0000000
--- a/deps/libav/libavcodec/dca_parser.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * DCA parser
- * Copyright (C) 2004 Gildas Bazin
- * Copyright (C) 2004 Benjamin Zores
- * Copyright (C) 2006 Benjamin Larsson
- * Copyright (C) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "parser.h"
-#include "dca.h"
-#include "get_bits.h"
-
-typedef struct DCAParseContext {
-    ParseContext pc;
-    uint32_t lastmarker;
-    int size;
-    int framesize;
-    int hd_pos;
-} DCAParseContext;
-
-#define IS_MARKER(state, i, buf, buf_size) \
- ((state == DCA_MARKER_14B_LE && (i < buf_size-2) && (buf[i+1] & 0xF0) == 0xF0 && buf[i+2] == 0x07) \
- || (state == DCA_MARKER_14B_BE && (i < buf_size-2) && buf[i+1] == 0x07 && (buf[i+2] & 0xF0) == 0xF0) \
- || state == DCA_MARKER_RAW_LE || state == DCA_MARKER_RAW_BE)
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int dca_find_frame_end(DCAParseContext * pc1, const uint8_t * buf,
-                              int buf_size)
-{
-    int start_found, i;
-    uint32_t state;
-    ParseContext *pc = &pc1->pc;
-
-    start_found = pc->frame_start_found;
-    state = pc->state;
-
-    i = 0;
-    if (!start_found) {
-        for (i = 0; i < buf_size; i++) {
-            state = (state << 8) | buf[i];
-            if (IS_MARKER(state, i, buf, buf_size)) {
-                if (pc1->lastmarker && state == pc1->lastmarker) {
-                    start_found = 1;
-                    i++;
-                    break;
-                } else if (!pc1->lastmarker) {
-                    start_found = 1;
-                    pc1->lastmarker = state;
-                    i++;
-                    break;
-                }
-            }
-        }
-    }
-    if (start_found) {
-        for (; i < buf_size; i++) {
-            pc1->size++;
-            state = (state << 8) | buf[i];
-            if (state == DCA_HD_MARKER && !pc1->hd_pos)
-                pc1->hd_pos = pc1->size;
-            if (state == pc1->lastmarker && IS_MARKER(state, i, buf, buf_size)) {
-                if(pc1->framesize > pc1->size)
-                    continue;
-                pc->frame_start_found = 0;
-                pc->state = -1;
-                pc1->size = 0;
-                return i - 3;
-            }
-        }
-    }
-    pc->frame_start_found = start_found;
-    pc->state = state;
-    return END_NOT_FOUND;
-}
-
-static av_cold int dca_parse_init(AVCodecParserContext * s)
-{
-    DCAParseContext *pc1 = s->priv_data;
-
-    pc1->lastmarker = 0;
-    return 0;
-}
-
-static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration,
-                            int *sample_rate, int *framesize)
-{
-    GetBitContext gb;
-    uint8_t hdr[12 + FF_INPUT_BUFFER_PADDING_SIZE] = { 0 };
-    int ret, sample_blocks, sr_code;
-
-    if (buf_size < 12)
-        return AVERROR_INVALIDDATA;
-
-    if ((ret = ff_dca_convert_bitstream(buf, 12, hdr, 12)) < 0)
-        return ret;
-
-    init_get_bits(&gb, hdr, 96);
-
-    skip_bits_long(&gb, 39);
-    sample_blocks = get_bits(&gb, 7) + 1;
-    if (sample_blocks < 8)
-        return AVERROR_INVALIDDATA;
-    *duration = 256 * (sample_blocks / 8);
-
-    *framesize = get_bits(&gb, 14) + 1;
-    if (*framesize < 95)
-        return AVERROR_INVALIDDATA;
-
-    skip_bits(&gb, 6);
-    sr_code = get_bits(&gb, 4);
-    *sample_rate = avpriv_dca_sample_rates[sr_code];
-    if (*sample_rate == 0)
-        return AVERROR_INVALIDDATA;
-
-    return 0;
-}
-
-static int dca_parse(AVCodecParserContext * s,
-                     AVCodecContext * avctx,
-                     const uint8_t ** poutbuf, int *poutbuf_size,
-                     const uint8_t * buf, int buf_size)
-{
-    DCAParseContext *pc1 = s->priv_data;
-    ParseContext *pc = &pc1->pc;
-    int next, duration, sample_rate;
-
-    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
-        next = buf_size;
-    } else {
-        next = dca_find_frame_end(pc1, buf, buf_size);
-
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-    }
-
-    /* read the duration and sample rate from the frame header */
-    if (!dca_parse_params(buf, buf_size, &duration, &sample_rate, &pc1->framesize)) {
-        s->duration = duration;
-        avctx->sample_rate = sample_rate;
-    } else
-        s->duration = 0;
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_dca_parser = {
-    .codec_ids      = { AV_CODEC_ID_DTS },
-    .priv_data_size = sizeof(DCAParseContext),
-    .parser_init    = dca_parse_init,
-    .parser_parse   = dca_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/dcadata.h b/deps/libav/libavcodec/dcadata.h
deleted file mode 100644
index dc4e8b9..0000000
--- a/deps/libav/libavcodec/dcadata.h
+++ /dev/null
@@ -1,7659 +0,0 @@
-/*
- * DCA compatible decoder data
- * Copyright (C) 2004 Gildas Bazin
- * Copyright (c) 2006 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DCADATA_H
-#define AVCODEC_DCADATA_H
-
-#include <stdint.h>
-#include "libavutil/mem.h"
-
-/* Generic tables */
-
-static const uint32_t dca_bit_rates[32] =
-{
-    32000, 56000, 64000, 96000, 112000, 128000,
-    192000, 224000, 256000, 320000, 384000,
-    448000, 512000, 576000, 640000, 768000,
-    896000, 1024000, 1152000, 1280000, 1344000,
-    1408000, 1411200, 1472000, 1536000, 1920000,
-    2048000, 3072000, 3840000, 1/*open*/, 2/*variable*/, 3/*lossless*/
-};
-
-static const uint8_t dca_channels[16] =
-{
-    1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 8, 8
-};
-
-static const uint8_t dca_bits_per_sample[7] =
-{
-    16, 16, 20, 20, 0, 24, 24
-};
-
-
-/* Adpcm data */
-
-/* 16bits signed fractional Q13 binary codes */
-static const int16_t adpcm_vb[4096][4] =
-{
-  {   9928,  -2618,  -1093,  -1263 },
-  {  11077,  -2876,  -1747,   -308 },
-  {  10503,  -1082,  -1426,  -1167 },
-  {   9337,  -2403,  -1495,    274 },
-  {  10698,  -2529,   -532,  -1122 },
-  {  10368,  -3974,  -1264,   -750 },
-  {  10070,  -3667,    346,    863 },
-  {  10278,  -3093,    311,   -576 },
-  {   9894,  -1330,  -1428,   -860 },
-  {  10544,  -1923,  -1058,   -971 },
-  {  10996,  -1632,   -841,  -1404 },
-  {  11832,  -3465,   1658,  -1990 },
-  {  10852,   -688,  -2658,   -499 },
-  {  10546,  -1749,   -147,  -1733 },
-  {  10801,  -1004,   -708,  -1453 },
-  {  10588,   -441,  -2113,   -952 },
-  {  10141,  -3331,   -582,  -1432 },
-  {   9608,  -2590,    383,    258 },
-  {  11422,  -3265,    229,  -1544 },
-  {  10460,  -1338,   -713,  -1568 },
-  {  10306,  -1721,  -1660,   -603 },
-  {   9580,  -1812,  -1235,  -1061 },
-  {  11471,  -2285,  -1617,   -607 },
-  {  10081,  -2225,  -1408,   -868 },
-  {  10715,  -2624,  -1367,   -704 },
-  {  10616,  -1871,  -2770,    -35 },
-  {   9352,  -2340,  -1024,  -1566 },
-  {  11065,  -1458,  -1926,   -735 },
-  {  11334,  -2056,  -1041,  -1144 },
-  {   9825,  -2048,   -794,  -1536 },
-  {  11850,  -2695,  -1123,   -867 },
-  {  10654,  -2226,  -1891,   -373 },
-  {  10024,  -1557,   -808,  -1069 },
-  {  11142,  -1266,  -3238,    128 },
-  {  11729,  -3282,   -514,  -1011 },
-  {  11402,  -2094,  -2335,   -189 },
-  {  10195,  -3658,    181,  -1875 },
-  {  11431,  -2626,   -404,  -1377 },
-  {  11001,  -3868,   -619,  -1077 },
-  {  10894,  -2559,    274,  -1758 },
-  {   9633,  -1482,  -2253,   -773 },
-  {  11245,  -3321,    830,  -1972 },
-  {   9768,  -2701,   -199,  -1859 },
-  {  10500,  -2042,    525,  -2043 },
-  {  11669,  -4069,    293,  -1468 },
-  {   9192,  -1991,   -583,    -61 },
-  {  10057,  -3220,  -2015,   -473 },
-  {   9497,  -2315,  -2490,   -467 },
-  {  10455,  -3069,  -1194,  -1007 },
-  {   9994,  -1936,    -60,  -1225 },
-  {   9295,  -2156,  -1761,  -1134 },
-  {  10085,  -3748,  -1026,    197 },
-  {   9334,  -2360,    804,   -351 },
-  {  11561,  -2553,   1352,  -2313 },
-  {  12837,  -3998,   1195,  -1958 },
-  {  10114,  -1100,  -2414,   -394 },
-  {   9341,  -2530,    315,    755 },
-  {  10131,  -3164,   1411,   -674 },
-  {   9535,   -905,  -1551,    579 },
-  {  11717,  -1519,  -3051,     91 },
-  {   9824,  -2911,  -2775,    192 },
-  {   9662,  -2934,   -561,   1450 },
-  {  11085,  -3392,  -1298,   -659 },
-  {   8955,  -2102,  -1899,    703 },
-  {   8607,  -1742,  -4348,    814 },
-  {   7640,  -2063,  -3617,     52 },
-  {   7074,   -826,  -4325,   4375 },
-  {   7714,    584,  -4238,   1927 },
-  {   6355,   -952,  -4912,   3127 },
-  {   7069,   -660,  -6413,   4087 },
-  {   8313,   -132,  -2964,   -876 },
-  {   6952,  -1422,  -3962,    -24 },
-  {   9299,   -734,  -3088,   -263 },
-  {   9484,   -574,  -4513,    466 },
-  {   7246,    -91,  -3735,   -704 },
-  {   8325,  -1417,  -3090,   -530 },
-  {   6469,  -1226,  -4757,    829 },
-  {   6652,   -368,  -5682,   1393 },
-  {   7971,  -1278,  -2284,   1205 },
-  {   7229,   -699,  -3556,   1840 },
-  {   7994,   1284,  -2729,    732 },
-  {   9005,   -698,  -4522,   2189 },
-  {   6963,    197,  -2727,    380 },
-  {   8527,    135,  -3991,   -213 },
-  {   8840,    934,  -3014,   -567 },
-  {  10125,    418,  -3284,   -371 },
-  {   6367,    361,  -2318,   2554 },
-  {   7892,    172,  -5247,   4673 },
-  {   6674,    387,  -5424,   4398 },
-  {   6240,    684,  -4047,   1219 },
-  {  11170,   -794,  -5081,   1195 },
-  {  11765,   -648,  -6265,   2052 },
-  {  10845,   -775,  -3837,    366 },
-  {  12496,   -689,  -8260,   3562 },
-  {   7893,  -1166,  -4972,    988 },
-  {   8592,   1052,  -5986,   3087 },
-  {   7277,   1874,  -5685,   3579 },
-  {   6900,   2016,  -4809,   3491 },
-  {   8530,  -2405,  -3250,   1986 },
-  {   9426,    494,  -7067,   5038 },
-  {  10285,    564,  -8210,   5370 },
-  {   8749,  -2207,  -3980,   2852 },
-  {   9653,  -2686,  -4300,   1400 },
-  {   9770,  -2286,  -5663,   4233 },
-  {   8490,     -4,  -7048,   4496 },
-  {   7697,  -1209,  -5328,   3183 },
-  {   6451,    801,  -4324,   -554 },
-  {   7387,   1806,  -5265,    545 },
-  {   7450,  -2302,  -4445,   1418 },
-  {   8817,  -1370,  -5827,   2168 },
-  {  10324,  -2406,  -5629,   2579 },
-  {   8863,  -2578,  -3537,    467 },
-  {   6901,  -1624,  -3169,   3392 },
-  {   7846,    156,  -6948,   3381 },
-  {   7928,  -1115,  -5972,   4816 },
-  {   6089,   -599,  -4368,   -320 },
-  {   7833,   1246,  -3960,   -621 },
-  {   8931,   2521,  -6768,   2052 },
-  {   8900,   1944,  -4126,     40 },
-  {   7661,    -34,  -2855,   2480 },
-  {   5873,    474,  -3262,   3712 },
-  {   7535,   -234,  -4699,    216 },
-  {   5856,    143,  -5142,     73 },
-  {   8944,   -106,  -5874,   3663 },
-  {   7134,    426,  -5879,   2895 },
-  {  10199,   1011,  -4762,    369 },
-  {   8454,    264,  -5971,   1291 },
-  {   7822,  -2449,  -4333,   4540 },
-  {   6200,  -2758,  -2632,   1497 },
-  {   6070,  -4315,  -2699,    414 },
-  {   7047,  -3739,  -3210,   1060 },
-  {   5675,  -3801,  -2717,   -407 },
-  {   4789,  -4063,  -2628,   -744 },
-  {   4023,  -3366,  -3133,   -726 },
-  {   4296,  -2407,  -3381,   -513 },
-  {   4388,  -2931,  -2820,   1512 },
-  {   4559,  -4233,  -1941,   1976 },
-  {   6702,  -3208,  -1755,   1680 },
-  {   4416,  -3521,  -1052,   2984 },
-  {   7154,  -4266,  -1203,   3732 },
-  {   3625,  -4242,  -3244,   1395 },
-  {   6518,  -2856,  -1304,   2887 },
-  {   6170,  -1949,  -3014,   3973 },
-  {   5189,  -2451,  -4020,   3477 },
-  {   6218,  -2988,  -1921,   3844 },
-  {   4827,  -3688,  -1928,   3343 },
-  {   6668,  -3991,  -2805,   3095 },
-  {   5297,  -3115,  -3684,   2390 },
-  {   5354,  -4614,  -2662,   1504 },
-  {   4196,  -3091,  -4147,   1135 },
-  {   3540,  -2893,  -4007,    100 },
-  {   5569,  -1602,  -4007,   1909 },
-  {   4341,  -2091,  -4272,    252 },
-  {   5559,  -2878,  -3832,    498 },
-  {   4548,  -4479,  -2898,    -27 },
-  {   5176,  -2494,  -4635,   1476 },
-  {   3294,  -3485,  -3738,    716 },
-  {   4920,  -1229,  -4195,   -365 },
-  {   3257,  -3518,  -3349,   2862 },
-  {   5286,  -1948,  -3485,   -778 },
-  {   6502,  -3051,   -152,   2854 },
-  {   5864,  -4192,  -1076,   3451 },
-  {   4656,  -3122,  -3448,    179 },
-  {   5907,   -754,  -1596,   3116 },
-  {   7229,  -3680,  -1590,   2892 },
-  {   5107,  -3888,  -3364,    806 },
-  {   6764,  -2635,  -3450,    134 },
-  {   5258,  -2827,  -2844,  -1052 },
-  {   5798,  -1725,  -4305,    205 },
-  {   5404,  -1213,  -3362,    449 },
-  {   6224,  -2738,  -3046,   -581 },
-  {   4223,  -2438,  -2725,   3745 },
-  {   4751,  -3411,  -2123,    116 },
-  {   3868,  -3000,  -3954,   2297 },
-  {   6819,  -2899,  -4277,   2825 },
-  {   4207,  -4754,  -2808,    865 },
-  {   4804,  -1494,  -1997,   4688 },
-  {   5282,  -2213,   -548,   3559 },
-  {   5580,  -1912,   -566,   4370 },
-  {   6168,  -2857,   -672,   4053 },
-  {   6583,  -4515,  -2850,   1670 },
-  {   6511,  -3093,  -3988,   1421 },
-  {   4646,  -1790,  -1443,   3650 },
-  {   5915,   -924,  -2020,    896 },
-  {   7814,  -4181,  -3152,   2007 },
-  {   6190,  -2238,  -4817,   2279 },
-  {   4737,  -4034,  -3288,   1835 },
-  {   8161,  -3633,  -3423,   3137 },
-  {   7415,  -2351,  -2088,   4290 },
-  {   4106,  -2517,    -62,   2905 },
-  {   4909,  -3145,   -614,   4112 },
-  {   4938,  -3281,   -397,   1100 },
-  {   -173,    919,   1589,  -5363 },
-  {    -13,    796,   -295,  -6655 },
-  {  -1860,   -829,   1141,  -4555 },
-  {   2298,   -838,   -664,  -5005 },
-  {   -884,  -1097,   2074,  -4613 },
-  {   -101,    281,   2846,  -4535 },
-  {   1166,    453,   2429,  -5910 },
-  {    879,   -664,   2370,  -5452 },
-  {   1415,   -370,  -1699,  -4727 },
-  {  -1413,   1277,   -669,  -6649 },
-  {   2133,    304,   -968,  -4624 },
-  {    380,    586,  -2087,  -4892 },
-  {   1336,    275,    -82,  -5789 },
-  {  -2459,   1057,    -34,  -5416 },
-  {   2278,  -1758,    866,  -5653 },
-  {   1945,  -2295,   -149,  -5302 },
-  {   1287,  -3525,    996,  -5255 },
-  {   2297,    803,   1177,  -6067 },
-  {    187,   -180,   -619,  -6202 },
-  {   -793,  -2537,   1554,  -5057 },
-  {  -2703,   -204,   -629,  -5853 },
-  {  -1007,   -146,    313,  -5582 },
-  {    830,    357,    869,  -6363 },
-  {   -228,   -575,  -3177,  -4433 },
-  {  -1001,  -1553,   -142,  -5708 },
-  {  -1644,   1683,   1721,  -4533 },
-  {    893,   1924,    -15,  -5791 },
-  {   2195,   2061,   -262,  -5471 },
-  {   3031,    270,    311,  -5096 },
-  {   1912,   1638,  -1523,  -4677 },
-  {  -3142,    -55,    253,  -4914 },
-  {    356,  -1680,    343,  -6123 },
-  {  -2241,  -1734,   -976,  -5939 },
-  {  -2196,  -2893,    547,  -4938 },
-  {  -1245,    126,  -1916,  -5419 },
-  {   -249,  -3755,  -1422,  -5594 },
-  {    575,  -2683,  -1926,  -4566 },
-  {   -762,   1885,    192,  -5880 },
-  {   -811,  -2562,  -1068,  -6013 },
-  {  -2264,  -3086,   -976,  -4775 },
-  {     70,  -1215,   2880,  -4410 },
-  {    714,  -3760,   2916,  -4691 },
-  {   -244,  -3404,   1740,  -4493 },
-  {    684,  -5137,   -328,  -5608 },
-  {   -529,  -3825,  -1786,  -4535 },
-  {   -713,  -4743,  -1118,  -5546 },
-  {   2718,  -3788,   1798,  -5708 },
-  {  -1639,  -3679,  -1564,  -6095 },
-  {   1693,  -2642,  -1389,  -4539 },
-  {    505,  -1573,  -1651,  -4878 },
-  {   -835,  -2256,  -1941,  -5352 },
-  {   1464,   -411,   1993,  -6441 },
-  {    493,  -3184,   -145,  -6148 },
-  {  -1413,    499,  -1617,  -6479 },
-  {   -294,   1722,  -1419,  -5725 },
-  {  -2937,  -1528,   -175,  -4624 },
-  {   -594,  -5911,    -56,  -6146 },
-  {   -300,  -4275,   1156,  -5947 },
-  {    552,  -2643,   2669,  -3959 },
-  {    905,  -4158,   1789,  -5809 },
-  {   1336,  -2009,   2108,  -5903 },
-  {   1555,  -3600,   1110,  -6759 },
-  {  -1294,  -3464,     77,  -6084 },
-  {  -1139,  -4006,  -1270,  -4181 },
-  {  -5094,  -3296,   1092,  -2847 },
-  {  -5503,  -2883,   1984,  -2067 },
-  {  -4671,  -4218,  -1417,  -4132 },
-  {  -3763,  -3818,   1262,  -3082 },
-  {  -5132,  -3430,   2928,   -728 },
-  {  -5957,  -2877,   1251,  -2446 },
-  {  -4425,  -2319,   -212,  -4276 },
-  {  -6201,  -1993,   1774,  -2182 },
-  {  -5500,  -3836,   2201,  -1396 },
-  {  -6934,  -2334,   2366,  -1293 },
-  {  -6124,  -4140,   1337,  -1977 },
-  {  -6553,  -4186,   1756,  -1325 },
-  {  -5126,  -1258,    744,  -3656 },
-  {  -5167,  -1390,   1581,  -2895 },
-  {  -4525,  -3398,   2429,  -1865 },
-  {  -4076,  -3183,   2027,  -2510 },
-  {  -6191,  -3274,   1838,  -1814 },
-  {  -4454,  -2753,   2723,  -1185 },
-  {  -6655,  -4797,    251,  -2595 },
-  {  -6332,  -2232,   1832,    217 },
-  {  -5869,  -1698,    134,    340 },
-  {  -6614,  -1045,   2126,  -1932 },
-  {  -4859,  -2107,   2010,  -2435 },
-  {  -6274,  -1622,   2808,  -1374 },
-  {  -3119,  -3209,    521,  -3988 },
-  {  -5676,  -2082,   -420,  -2711 },
-  {  -7073,  -3623,    696,  -2343 },
-  {  -5986,  -4224,    572,  -2454 },
-  {  -4340,  -4521,    882,  -2771 },
-  {  -6178,  -1933,    535,  -1444 },
-  {  -4923,  -4163,   1744,  -2066 },
-  {  -6410,  -1519,   1058,  -2683 },
-  {  -5077,  -1185,    856,  -2216 },
-  {  -7091,  -2444,    687,  -2597 },
-  {  -5284,  -2165,   3239,   -993 },
-  {  -4763,  -1497,    197,  -3179 },
-  {  -4128,  -4958,   -396,  -3578 },
-  {  -5054,  -3878,   -647,  -2672 },
-  {  -7005,  -3348,   1679,  -1579 },
-  {  -5767,  -1017,   2582,  -1915 },
-  {  -7069,  -2787,   1331,  -2070 },
-  {  -5532,  -2296,    706,  -2950 },
-  {  -5059,  -3543,   -821,  -3637 },
-  {  -6639,  -1835,   1016,   -696 },
-  {  -5611,  -5220,   -694,  -3371 },
-  {  -5994,  -2803,   2933,   -729 },
-  {  -5948,   -619,   1596,  -2676 },
-  {  -5486,  -4419,    153,  -3265 },
-  {  -4329,  -3440,   1646,  -1439 },
-  {  -4083,  -3978,    177,  -3569 },
-  {  -4289,  -2599,   1224,  -3075 },
-  {  -5707,  -3253,   1912,   -759 },
-  {  -6606,  -3437,   2562,   -571 },
-  {  -5254,  -2444,    769,   -352 },
-  {  -6545,  -3154,    582,  -1103 },
-  {  -5328,  -2241,   2566,  -1775 },
-  {  -7216,  -1936,   1538,  -1983 },
-  {  -3730,  -2451,    426,  -3869 },
-  {  -5110,  -1385,   2031,  -1169 },
-  {  -6470,  -2715,    269,  -3123 },
-  {  -5806,  -2480,    -97,  -3832 },
-  {  -3683,  -4916,   -490,  -4330 },
-  {  -6341,  -2083,   -669,   -115 },
-  {  -4913,  -4079,   -837,  -4673 },
-  {  -3274,  -2497,   2334,  -2652 },
-  {  -1286,  -1731,   2550,  -3756 },
-  {  -3375,   -877,    926,  -3977 },
-  {  -2525,  -2079,   2879,  -2625 },
-  {  -5308,   -504,   3111,  -1607 },
-  {  -4904,    460,   4093,  -1232 },
-  {  -1993,   1616,   4656,  -1913 },
-  {  -3481,  -1176,   3119,  -2236 },
-  {  -4132,  -1502,   2339,  -2545 },
-  {  -2542,   1151,   3569,  -2550 },
-  {  -4381,    430,   3147,  -2082 },
-  {  -3888,    867,   3899,  -1657 },
-  {  -2861,   1290,   4202,  -1979 },
-  {  -3893,   -253,   2363,  -2764 },
-  {  -1705,    688,   3827,  -2923 },
-  {  -2223,   2312,   3700,  -3148 },
-  {  -1986,   -720,   5021,   -795 },
-  {  -3177,    242,   1952,  -3352 },
-  {  -1854,   1509,   2528,  -3815 },
-  {  -3173,     97,   5019,   -706 },
-  {  -2689,   -145,   1375,  -3915 },
-  {  -4838,   -385,   2488,  -2427 },
-  {  -4557,   -355,   1603,  -3060 },
-  {  -3522,   1832,   3292,  -2674 },
-  {  -3769,    780,   2378,  -2704 },
-  {  -4323,  -1932,   3414,  -1169 },
-  {  -2740,   1158,   2729,  -3273 },
-  {  -3647,    210,   1464,  -2892 },
-  {  -2342,  -2097,   1513,  -3727 },
-  {  -4422,  -1242,   3130,  -1833 },
-  {  -1308,  -1039,   4290,  -1875 },
-  {  -1754,  -2535,   3298,  -2314 },
-  {  -4102,   -186,   4037,  -1094 },
-  {  -1008,   1570,   3290,    171 },
-  {  -3322,  -2621,   2791,  -1536 },
-  {  -2539,  -2597,   3442,  -1672 },
-  {  -3411,  -2015,   3670,  -1174 },
-  {  -2097,    730,   5581,  -1399 },
-  {  -1510,    -74,   4820,  -2004 },
-  {  -4086,   -868,   4425,   -771 },
-  {   -956,   -986,   3640,  -2925 },
-  {  -2087,  -1250,   3464,  -2458 },
-  {  -3308,  -2411,   1334,  -3667 },
-  {  -2264,   -389,   4004,  -1854 },
-  {   -680,    239,   4058,  -3388 },
-  {  -1357,     30,   2993,  -3658 },
-  {  -3601,   -552,   1177,  -1136 },
-  {  -2641,    442,   4374,  -1625 },
-  {  -2525,    770,   1640,  -3895 },
-  {  -3172,   -891,   3893,  -1608 },
-  {  -2996,     13,   3277,  -2414 },
-  {   -899,   1055,   4470,  -2501 },
-  {   -422,   -584,   3475,  -3787 },
-  {  -1978,   -593,   2566,  -3415 },
-  {  -3150,  -1280,   2362,  -3047 },
-  {  -3592,    224,   1026,  -3932 },
-  {  -4840,  -1189,   3633,   -879 },
-  {  -3952,  -2255,   2916,  -1826 },
-  {  -1695,     28,   1810,   -349 },
-  {   -745,  -2484,   3308,  -3293 },
-  {  -1016,   1563,   5365,  -1823 },
-  {  -2172,  -1787,   4266,  -1287 },
-  {  -1241,  -1951,   3982,  -2413 },
-  {  -2009,  -2639,   2330,  -3480 },
-  {   5105,  -1618,  -2588,  -2015 },
-  {   6497,  -1523,  -3218,   -910 },
-  {   6526,  -2305,  -2029,  -1790 },
-  {   5289,    -99,  -3436,   -400 },
-  {   5781,  -1623,  -1577,  -2617 },
-  {   5259,   -670,  -3125,  -1700 },
-  {   6343,  -1256,   -331,  -3222 },
-  {   7967,   -678,  -2195,  -1462 },
-  {   6119,   -695,  -2988,  -1538 },
-  {   6108,    494,  -3359,  -1548 },
-  {   5067,    969,  -2328,  -2707 },
-  {   7595,   -435,  -1497,  -2056 },
-  {   6929,   -719,  -2420,  -1665 },
-  {   5190,    584,  -2982,  -2103 },
-  {   6106,   -444,  -1411,  -2739 },
-  {   5584,    289,  -1804,  -2803 },
-  {   5276,    227,  -1180,  -3361 },
-  {   7544,  -1525,  -1834,  -1725 },
-  {   5986,  -1470,  -2606,  -1701 },
-  {   5096,   -765,  -1712,  -3006 },
-  {   5423,   -149,  -3933,  -1157 },
-  {   7651,     26,  -2445,  -1507 },
-  {   4745,   -464,  -1735,  -2362 },
-  {   5352,  -1011,  -1094,  -1999 },
-  {   6300,   -672,   -542,  -1950 },
-  {   6675,  -1020,  -1318,  -1059 },
-  {   7218,  -2036,   -603,  -2462 },
-  {   7755,  -1514,  -2430,  -1229 },
-  {   5041,    449,  -1056,  -2405 },
-  {   6710,  -2277,  -1344,  -2284 },
-  {   6824,  -1347,  -2254,    251 },
-  {   6068,  -1857,   -983,  -1316 },
-  {   5603,  -2177,  -2730,  -1477 },
-  {   5838,  -1059,  -3604,   -970 },
-  {   5076,   -789,   -335,  -2413 },
-  {   6191,  -1634,  -2000,  -2129 },
-  {   5092,  -1292,  -2543,  -1034 },
-  {   5305,    435,  -1710,  -1850 },
-  {   6140,    561,  -2176,  -2380 },
-  {   6752,    348,  -2496,  -1890 },
-  {   6405,    273,  -1098,  -2778 },
-  {   6942,  -1340,   -496,  -1381 },
-  {   5238,   -687,  -2454,  -2349 },
-  {   6959,   -882,  -1833,  -2061 },
-  {   6292,   -253,  -2125,  -2199 },
-  {   5838,   -574,   -759,  -3215 },
-  {   6954,  -1484,   -640,  -2771 },
-  {   7498,  -1706,  -1210,  -2154 },
-  {   6772,  -1003,  -1235,  -2532 },
-  {   6014,    228,  -2154,  -1108 },
-  {   6943,  -2178,  -2644,  -1122 },
-  {   7262,   -763,  -3056,  -1090 },
-  {   6273,  -1478,  -1072,    177 },
-  {   4734,    425,  -2912,    357 },
-  {   7129,    168,  -1537,  -2327 },
-  {   7204,   -434,   -746,  -2660 },
-  {   6879,     57,  -3087,  -1310 },
-  {   4623,   -610,   -718,  -3459 },
-  {   6565,   -543,  -1998,   -339 },
-  {   4752,   -277,  -2066,  -1405 },
-  {   7435,  -1416,  -1904,   -505 },
-  {   4076,    150,  -1222,  -3556 },
-  {   7082,    -28,  -1456,  -1174 },
-  {   5941,   -446,  -1326,  -1158 },
-  {   3870,  -1648,  -2474,  -2589 },
-  {    858,     37,  -3387,  -3721 },
-  {   3557,  -1503,  -1664,  -3383 },
-  {   3336,  -1972,  -3079,  -2216 },
-  {   3186,     60,  -4185,   -863 },
-  {   3456,   -773,  -3066,  -2457 },
-  {   4131,   -913,  -2060,  -2601 },
-  {   4431,   -691,  -4114,   -972 },
-  {   3461,   -334,  -3680,  -1751 },
-  {   2006,   -459,  -2214,  -3827 },
-  {   1322,     32,  -2816,  -3203 },
-  {   4425,  -1897,  -2791,  -1946 },
-  {   4504,     23,  -3421,  -1909 },
-  {   3090,   -885,  -2366,  -3264 },
-  {   3209,  -2363,  -3730,   -834 },
-  {   3312,  -1471,  -3641,  -1579 },
-  {   4184,  -1669,  -3323,  -1248 },
-  {   2190,   -931,  -3302,  -2944 },
-  {   2947,   -229,  -4791,  -1195 },
-  {   2020,  -1626,  -2700,  -3125 },
-  {   2214,   -326,  -4352,  -1683 },
-  {   3286,  -2619,  -2412,  -2458 },
-  {   1000,  -2571,  -4129,  -2158 },
-  {   2496,  -2627,  -3611,  -1433 },
-  {   2043,  -2191,  -2167,  -3827 },
-  {   2571,  -2544,  -1915,  -3222 },
-  {   2022,  -1501,  -3856,  -2165 },
-  {   2685,  -1180,  -1461,  -4038 },
-  {   1610,  -2313,  -4391,  -1173 },
-  {   2340,  -2490,  -4215,   -516 },
-  {   1742,  -2615,  -3632,  -2146 },
-  {    523,  -1293,  -4246,  -2442 },
-  {   3725,  -2723,  -3014,  -1576 },
-  {   3554,  -1381,  -4200,   -824 },
-  {   1291,  -1594,  -4777,  -1430 },
-  {   1452,    515,  -2960,  -3830 },
-  {   4264,   -894,  -3305,  -1826 },
-  {   2606,  -1452,  -4522,   -966 },
-  {   1196,   -830,  -4807,  -1816 },
-  {   1054,   -775,  -2616,  -4071 },
-  {   4206,    415,  -4344,  -1132 },
-  {   3044,    491,  -4126,  -1934 },
-  {    988,   -901,  -3353,  -3443 },
-  {   1729,  -3063,  -2267,  -3370 },
-  {   3915,    912,  -2989,  -2387 },
-  {   3781,    300,  -2457,  -3050 },
-  {   2712,    924,  -1350,  -1206 },
-  {   4230,    405,  -2343,    665 },
-  {   1878,   -873,   -225,    -29 },
-  {   3510,     56,  -1334,  -3420 },
-  {   2850,   1447,  -2651,  -3150 },
-  {   1510,   -706,  -4125,  -2483 },
-  {   3115,    793,  -1692,  -3894 },
-  {   2667,    213,  -2973,  -2786 },
-  {   1184,  -2384,  -3051,  -3173 },
-  {   2139,    796,  -2079,  -3697 },
-  {   1464,  -1483,  -3726,  -2754 },
-  {   2407,  -1148,  -3915,  -1569 },
-  {   2612,  -1779,  -3217,  -2271 },
-  {   2406,  -2870,  -2937,  -2496 },
-  {   2140,    126,  -3646,  -2758 },
-  {   2952,  -1036,    268,  -1423 },
-  {     93,  -1931,  -3841,  -3535 },
-  {    389,  -2953,  -3383,  -3343 },
-  {   8652,  -5511,  -1662,    565 },
-  {   7427,  -2791,  -2535,   -842 },
-  {   8541,  -4253,  -1407,   -988 },
-  {   8018,  -3203,  -2998,    105 },
-  {   7231,  -3926,   -958,   1308 },
-  {   7331,  -3690,   -363,   2586 },
-  {   6803,  -3646,  -2226,   -903 },
-  {   8163,  -2811,   -477,  -2235 },
-  {   9356,  -3818,  -1685,   -684 },
-  {   8466,  -2854,   -302,   -698 },
-  {   8458,  -3224,    517,    279 },
-  {   8074,  -2619,  -1326,   2596 },
-  {   8779,  -2761,  -2527,   -441 },
-  {   6533,  -2887,   -899,   -696 },
-  {   7394,  -2305,  -1642,   -120 },
-  {   8281,  -3780,    -22,   1305 },
-  {   9158,  -4413,   -779,    901 },
-  {   9031,  -5240,  -1109,   1678 },
-  {   8717,  -3650,    410,  -1075 },
-  {   7317,  -3197,   -818,  -2264 },
-  {   7934,  -2385,  -1214,  -1886 },
-  {   8256,  -4441,   -291,   -587 },
-  {   7358,  -3395,   1090,   -270 },
-  {   9446,  -4910,  -1343,   -473 },
-  {   8187,  -4726,   -808,   1166 },
-  {   7504,  -3845,    -47,    267 },
-  {   8029,  -2146,  -1283,   -383 },
-  {   7461,  -2705,   -853,    783 },
-  {   9367,  -3636,   -645,   -354 },
-  {   8955,  -3473,   -308,  -1947 },
-  {   8676,  -2683,  -2099,   1485 },
-  {   7481,  -3003,   -871,   -444 },
-  {   8015,  -2839,  -1673,   1175 },
-  {   6947,  -4643,  -1527,  -1047 },
-  {   7622,  -2575,   -137,   -960 },
-  {   9388,  -4279,   -707,  -1322 },
-  {   8382,  -5259,  -1283,   -565 },
-  {   6856,  -4138,  -1030,    630 },
-  {   8659,  -2571,  -1124,  -1666 },
-  {   8763,  -3807,   -537,   2543 },
-  {   8049,  -3578,  -2186,   -604 },
-  {   8272,  -2351,  -1985,  -1214 },
-  {   6855,  -3796,  -1527,  -1631 },
-  {   7178,  -2896,  -1600,  -1756 },
-  {   7040,  -2888,    -89,  -1586 },
-  {   6261,  -3403,   -264,    998 },
-  {   7756,  -4699,  -1543,   -834 },
-  {   7682,  -4622,   -758,  -1721 },
-  {   8839,  -4232,  -2932,   1959 },
-  {   9363,  -4679,  -1956,     39 },
-  {   7883,  -3616,  -1414,  -1432 },
-  {   8828,  -3188,  -1356,  -1312 },
-  {   7746,  -3987,   -121,  -2424 },
-  {   9262,  -3256,   -693,    818 },
-  {   7670,  -3420,   -148,   3504 },
-  {   7344,  -3183,    608,   1595 },
-  {   8976,  -4139,  -1848,   1304 },
-  {   6708,  -4131,     33,   -852 },
-  {   7840,  -4429,  -2275,     79 },
-  {   8980,  -3858,  -2838,    453 },
-  {   7815,  -4604,  -2563,    944 },
-  {   8372,  -4422,  -1783,   3071 },
-  {   8623,  -5128,  -1754,   2888 },
-  {   7462,  -3281,    889,    920 },
-  {   8416,    -59,  -1320,  -1825 },
-  {   7928,  -1488,   -414,  -2499 },
-  {   8110,   -977,  -1047,  -2042 },
-  {   8278,   -687,  -1597,  -1550 },
-  {   7988,   -174,   -977,  -2106 },
-  {   8609,  -1547,  -1628,  -1527 },
-  {   9000,  -1798,   -946,  -1761 },
-  {   8954,   -872,  -1404,  -1594 },
-  {   8939,    466,   -748,  -1212 },
-  {   9549,   -329,   -177,  -1360 },
-  {   9411,    -18,  -1126,  -1568 },
-  {   8859,   -782,   -488,  -1338 },
-  {   8955,   -218,    -43,  -1209 },
-  {   9131,    -69,   -453,  -1001 },
-  {   9069,  -1519,  -1091,  -1199 },
-  {   9247,  -1309,   -566,  -1146 },
-  {   8528,  -1617,   -287,  -1313 },
-  {   7763,   -745,   -149,  -2040 },
-  {   8294,   -343,    257,  -2633 },
-  {  10149,   -893,   -552,  -1649 },
-  {   9398,   -915,    218,  -2042 },
-  {   9703,  -1194,   -675,  -1592 },
-  {   9586,   -700,   -427,  -1710 },
-  {   8930,    497,  -1445,  -1218 },
-  {   9285,  -1323,   -163,  -1552 },
-  {   8431,  -1289,   -985,  -1404 },
-  {   8965,   -655,    653,  -1483 },
-  {   9542,  -1001,   -951,  -1128 },
-  {   9205,   -647,    -37,   -882 },
-  {   8603,    -56,    514,  -1793 },
-  {   9300,    -12,  -1324,   -567 },
-  {   8773,    238,   -184,  -1456 },
-  {   9941,  -1306,    -69,  -1792 },
-  {   9360,    279,   -376,  -1919 },
-  {   9180,   -285,     95,  -2170 },
-  {   9922,   -501,   -970,  -1570 },
-  {   8341,  -1493,   -856,  -2092 },
-  {   8780,   -981,   -850,  -1014 },
-  {   9721,   -548,  -1504,  -1094 },
-  {   9973,  -1493,    482,  -2105 },
-  {   8707,   -333,  -1027,  -1087 },
-  {   9098,   -469,   -315,  -1723 },
-  {   8879,  -1050,   -661,  -2020 },
-  {   8857,    602,   -866,  -1918 },
-  {   8945,  -1025,  -2154,  -1071 },
-  {   8484,  -1930,   -468,  -2179 },
-  {   9177,  -1903,   -224,  -2112 },
-  {   8652,   -137,  -2097,  -1214 },
-  {   9063,   -973,  -1405,   -772 },
-  {   9328,   -456,    662,  -2469 },
-  {  10101,   -697,    127,  -2113 },
-  {   9685,    811,  -2359,  -1024 },
-  {   8586,    -94,   -460,  -1982 },
-  {   7924,   -141,   -509,  -2513 },
-  {   7773,   -669,   -107,  -2835 },
-  {   8636,  -1064,    -46,  -2409 },
-  {   9748,    596,  -1815,  -1349 },
-  {   8924,    304,    547,  -2614 },
-  {   9442,    746,  -1153,  -1679 },
-  {   9454,   -278,   -529,  -1976 },
-  {   8488,    561,    -32,  -2160 },
-  {  10083,    -63,  -1544,  -1364 },
-  {   9390,  -1278,    568,  -1131 },
-  {   9740,    -49,  -2253,   -910 },
-  {   3636,  -2391,  -1115,  -3614 },
-  {   6014,  -3204,  -1902,  -1808 },
-  {   5787,  -3497,  -1116,  -2590 },
-  {   4365,  -3046,  -1632,  -2668 },
-  {   4733,  -2192,  -2029,  -2468 },
-  {   5412,  -2753,  -1633,  -2464 },
-  {   4455,  -3375,   -767,  -3399 },
-  {   4456,  -1644,   -983,  -2841 },
-  {   4039,  -2523,     38,  -3967 },
-  {   3406,  -2662,     72,  -4757 },
-  {   4279,  -2005,   1055,  -4399 },
-  {   4321,  -1377,   -860,  -3786 },
-  {   3743,  -5739,   -651,  -3047 },
-  {   3528,  -5510,    361,  -4060 },
-  {   6496,  -4886,   -136,  -2689 },
-  {   4513,  -5254,    551,  -4010 },
-  {   6557,  -3413,    -92,  -3063 },
-  {   4186,  -2059,    187,     47 },
-  {   6210,  -4117,  -1256,  -1985 },
-  {   6038,  -4343,    351,  -2124 },
-  {   4305,  -4780,  -2077,  -1897 },
-  {   4480,  -3815,  -2228,  -1533 },
-  {   5582,  -3689,   1221,  -3429 },
-  {   5532,  -4874,   1195,  -2765 },
-  {   6518,  -2853,   -905,  -2568 },
-  {   5467,  -2192,    470,  -4115 },
-  {   4139,  -1577,    240,  -3493 },
-  {   5281,  -1926,   -729,  -3340 },
-  {   5214,  -2870,   1359,  -4289 },
-  {   3046,  -3510,  -1536,  -3214 },
-  {   5433,  -2881,  -1230,  -1184 },
-  {   4861,  -3932,  -1071,  -2791 },
-  {   5693,  -4234,  -1906,  -1502 },
-  {   4004,  -3935,  -1804,  -2383 },
-  {   3728,  -3792,    681,  -4773 },
-  {   3621,  -3030,  -1951,  -2598 },
-  {   5133,  -3903,     44,  -3700 },
-  {   3561,  -3451,   1183,  -5301 },
-  {   5026,  -2762,  -2341,  -1780 },
-  {   5841,  -2492,   -467,  -3210 },
-  {   5591,  -1791,    497,  -2472 },
-  {   5054,  -3898,  -1822,  -2097 },
-  {   5813,  -2792,     83,  -1469 },
-  {   4432,  -4497,   1670,  -5193 },
-  {   5338,  -4653,  -1109,  -2200 },
-  {   3239,  -4401,   -648,  -3655 },
-  {   2147,  -3598,  -1200,  -4242 },
-  {   4417,  -2271,  -1552,  -3210 },
-  {   6494,  -4360,    852,  -3565 },
-  {   2393,  -6358,   -856,  -4524 },
-  {   4959,  -4196,   -847,  -1403 },
-  {   4924,  -5438,   -226,  -3026 },
-  {   4254,  -5303,  -1306,  -2424 },
-  {   4121,  -3126,  -2334,  -1981 },
-  {   3437,  -4443,  -1464,  -2953 },
-  {   3203,  -3459,   -529,  -4339 },
-  {   5896,  -5945,    543,  -3246 },
-  {   1987,  -4733,   -220,  -4863 },
-  {   4358,  -4431,   -514,  -3081 },
-  {   4583,  -2416,   -492,  -2287 },
-  {   2943,  -5035,    419,  -4927 },
-  {   5358,  -5129,    987,  -4309 },
-  {   4460,  -3392,   1752,  -5634 },
-  {   3415,  -4633,   1507,  -5945 },
-  {    811,  -4692,   -445,   2333 },
-  {   1009,  -5613,  -1857,   1360 },
-  {   1338,  -2712,  -2720,   3036 },
-  {   1002,  -3754,  -2582,   2344 },
-  {    750,  -4608,  -2334,    714 },
-  {   2043,  -3207,  -2822,   2173 },
-  {   -140,  -4654,  -2953,    357 },
-  {    -54,  -4026,  -2376,   2695 },
-  {   1858,  -5022,   -717,   2287 },
-  {   2064,  -3894,   -722,   3255 },
-  {   2727,  -4558,   -332,   2603 },
-  {   1810,  -5378,    283,   1826 },
-  {   3935,  -4326,    762,   3383 },
-  {   -767,  -4697,  -2510,   1922 },
-  {   2146,  -4312,  -3090,   1641 },
-  {     54,  -5881,  -2114,    921 },
-  {   1992,  -5766,   -640,   1574 },
-  {   1200,  -5371,  -1114,   1828 },
-  {   2973,  -5337,     34,   2266 },
-  {   1531,  -5018,  -2817,   1192 },
-  {   3078,  -4570,    117,   1990 },
-  {    924,  -4286,  -1388,   2713 },
-  {    142,  -5058,  -2848,   1487 },
-  {   -106,  -6180,   -881,    842 },
-  {    673,  -5433,   -229,   1596 },
-  {    783,  -5710,  -2784,    562 },
-  {   1935,  -5729,  -2009,    856 },
-  {   -410,  -3375,  -3326,   2734 },
-  {    234,  -3000,  -2628,   3260 },
-  {    733,  -3405,  -3806,   1589 },
-  {    771,  -4285,  -3544,   1314 },
-  {   1192,  -3563,  -3960,   2178 },
-  {    206,  -5555,  -1250,   1546 },
-  {   -130,  -3815,  -1210,   3041 },
-  {    646,  -3940,   -393,   2992 },
-  {   -184,  -4931,  -1767,   1925 },
-  {   2746,  -5120,  -2275,   1464 },
-  {   2440,  -3731,  -3352,   2729 },
-  {   -490,  -4942,  -3779,    997 },
-  {     68,  -2636,  -4167,   3778 },
-  {     48,  -3986,  -4118,   2106 },
-  {   -978,  -5486,  -1336,   1390 },
-  {   1126,  -5297,   -855,    640 },
-  {   -472,  -3975,  -3622,   1557 },
-  {   2456,  -5344,  -1523,   1648 },
-  {   -774,  -5652,  -2417,   1147 },
-  {    995,  -6122,   -812,   1132 },
-  {   3282,  -4571,  -1763,   2175 },
-  {   3655,  -3862,   -676,   3568 },
-  {   3038,  -3647,  -1672,   3381 },
-  {   2595,  -2964,  -2772,   3263 },
-  {   4176,  -3353,  -1148,   4354 },
-  {   1603,  -3442,  -1500,   3444 },
-  {    828,  -6226,  -1783,    678 },
-  {   1421,  -3333,  -3080,   3403 },
-  {   1121,  -4727,  -1924,   1984 },
-  {   -186,  -5083,   -682,   1796 },
-  {    819,  -2778,  -3488,    530 },
-  {    421,  -2873,  -3832,   2596 },
-  {   2164,  -4263,  -1605,   2282 },
-  {    585,  -4437,   -682,   -491 },
-  {   -644,  -4452,  -1157,   2325 },
-  {   1991,  -4299,    210,   2834 },
-  {   2135,  -3632,  -2113,    665 },
-  {  -7482,  -2724,  -2662,  -1380 },
-  {  -6983,  -2166,  -3756,  -3509 },
-  {  -7085,  -1439,  -2397,  -3112 },
-  {  -7760,  -3049,  -3319,  -2822 },
-  {  -8413,  -2760,  -4406,  -3298 },
-  {  -5995,  -3943,  -1260,  -3750 },
-  {  -7879,  -1554,  -3464,  -2606 },
-  {  -6314,  -2034,  -3878,  -1681 },
-  {  -8849,  -2084,  -1399,  -1231 },
-  {  -7153,  -2602,  -1384,   -817 },
-  {  -8041,  -2571,   -407,  -2785 },
-  {  -7246,  -2233,  -1578,    260 },
-  {  -7336,  -3883,  -4061,  -1342 },
-  {  -7619,  -3908,  -2342,    382 },
-  {  -8684,  -3724,  -1662,   -727 },
-  {  -7850,  -2922,  -1770,  -3449 },
-  {  -6766,  -2034,  -1293,  -1988 },
-  {  -6895,  -2116,   -968,  -3744 },
-  {  -7136,  -5147,  -2618,  -2809 },
-  {  -8224,  -3724,  -2519,  -1589 },
-  {  -6711,  -2750,  -3021,   -219 },
-  {  -8059,  -1638,  -1102,  -3175 },
-  {  -8710,  -4839,  -3963,  -3143 },
-  {  -9363,  -4965,  -3257,  -1002 },
-  {  -6099,  -1751,  -3157,   -395 },
-  {  -6453,  -3216,  -4597,   -483 },
-  {  -7879,  -5477,   -839,  -2638 },
-  {  -7202,  -4038,   -526,  -2856 },
-  {  -8022,  -1228,  -1910,  -1646 },
-  {  -9117,  -1393,  -1582,  -2535 },
-  {  -9095,  -2693,   -636,  -2605 },
-  {  -9076,  -2580,  -3481,  -2519 },
-  {  -8327,  -4859,  -2422,     83 },
-  {  -8368,  -2129,  -2324,  -2173 },
-  {  -8554,  -4563,  -3842,  -2007 },
-  { -10462,  -4261,  -1934,  -2084 },
-  {  -9717,  -3187,  -2294,  -1896 },
-  {  -9625,  -3889,  -3020,  -3224 },
-  {  -9857,  -4955,  -4239,  -2184 },
-  {  -9752,  -2351,  -2277,  -3129 },
-  {  -7219,  -1302,  -2639,  -1603 },
-  {  -7477,  -4360,  -3718,   -559 },
-  {  -5680,  -2033,  -2326,  -3078 },
-  { -10190,  -5548,  -4643,  -3601 },
-  {  -9431,  -4121,   -879,  -2479 },
-  {  -8365,  -5450,  -2020,  -1439 },
-  {  -6289,  -5178,  -1605,  -3845 },
-  {  -8319,  -3866,   -687,  -2792 },
-  {  -8131,  -1031,  -3608,  -3947 },
-  { -10510,  -2560,  -1199,  -2082 },
-  { -11015,  -3640,  -2748,  -3041 },
-  {  -8762,  -5022,  -5231,  -1162 },
-  { -10153,  -2715,  -4648,  -4859 },
-  {  -7930,  -5205,  -1900,  -3600 },
-  {  -9561,  -3548,  -4812,  -3722 },
-  {  -7663,  -4709,  -1180,  -1475 },
-  {  -9073,  -5707,  -1815,  -2980 },
-  {  -8602,  -2363,  -2675,  -3770 },
-  {  -9967,  -5614,  -3575,  -3838 },
-  {  -8324,  -1005,  -2131,  -3254 },
-  { -10331,  -5737,  -2550,  -2940 },
-  {  -8234,  -3354,  -3361,  -4479 },
-  {  -8140,  -1951,  -4526,  -4545 },
-  {  -6679,  -2662,  -2284,  -4182 },
-  {  -1122,  -1514,  -6427,   -212 },
-  {     54,  -1660,  -5424,  -1404 },
-  {    254,  -2778,  -5222,    846 },
-  {   -267,  -1661,  -6577,    814 },
-  {   -305,  -2021,  -5759,   1484 },
-  {  -1791,  -2446,  -6867,    -86 },
-  {  -2929,  -3158,  -6603,  -1799 },
-  {  -1391,  -3189,  -5557,  -1053 },
-  {  -1602,   -884,  -6767,  -1213 },
-  {   -361,   -318,  -6219,    -44 },
-  {  -4078,  -2635,  -5523,   -433 },
-  {   -956,    478,  -4382,   1470 },
-  {  -3300,  -2462,  -6021,  -2721 },
-  {    708,  -2434,  -5085,   -540 },
-  {  -2435,  -3607,  -5647,  -2110 },
-  {   -491,  -1134,  -4681,  -2886 },
-  {     87,  -3435,  -4641,  -1194 },
-  {   -586,  -2927,  -4784,    366 },
-  {  -1394,  -2326,  -6021,    350 },
-  {     97,  -2519,  -4678,  -2120 },
-  {  -1547,  -1907,  -5069,  -2993 },
-  {    268,  -3724,  -4719,    127 },
-  {   -827,  -1190,  -5912,   1144 },
-  {  -3959,  -2322,  -6898,  -1974 },
-  {  -2728,  -2228,  -6426,   -562 },
-  {   -456,   -666,  -5785,  -1609 },
-  {    531,  -1096,  -5731,   -656 },
-  {  -3569,   -688,  -3915,    110 },
-  {  -4752,  -1725,  -4393,   -377 },
-  {  -3210,  -3315,  -6960,   -840 },
-  {   -688,  -3416,  -4971,   1221 },
-  {  -1833,     77,  -6491,  -2434 },
-  {   -239,   -255,  -6850,   -886 },
-  {  -2112,  -1490,  -6291,  -2689 },
-  {  -1544,  -4579,  -5198,  -1261 },
-  {  -2771,  -4014,  -5520,    683 },
-  {  -1635,  -2829,  -5512,   1214 },
-  {   -958,  -2582,  -4823,   2360 },
-  {  -2077,  -4566,  -4642,    365 },
-  {  -3112,  -4214,  -5960,   -823 },
-  {  -2467,  -2510,  -4858,   1467 },
-  {  -1561,  -3399,  -5822,    211 },
-  {   -775,  -1081,  -4424,   2636 },
-  {  -1263,     25,  -6378,  -1392 },
-  {  -3476,   -366,  -5417,  -1393 },
-  {  -3176,  -1476,  -4149,   1466 },
-  {  -2479,    518,  -4448,   -257 },
-  {  -2992,    158,  -4660,  -1279 },
-  {  -1320,  -3872,  -4479,   1147 },
-  {  -1475,   -312,  -5318,    539 },
-  {  -3527,  -1679,  -5860,  -1681 },
-  {  -3397,  -3438,  -5593,   1866 },
-  {  -4089,  -2439,  -4763,   1275 },
-  {   -748,  -4513,  -4687,    -48 },
-  {  -2166,  -4531,  -4691,  -2856 },
-  {  -2385,   -853,  -6035,   -627 },
-  {  -1194,  -4091,  -4472,  -1963 },
-  {   -682,  -3234,  -4084,  -3033 },
-  {  -3255,  -5015,  -5328,    -12 },
-  {  -2313,  -3436,  -4601,   -155 },
-  {  -2792,  -1038,  -6947,  -2019 },
-  {  -1244,  -1526,  -5771,  -1882 },
-  {  -4679,  -3731,  -5506,    283 },
-  {  -3062,    -66,  -3558,   -758 },
-  {  -4895,  -1187,   4751,   3728 },
-  {  -7600,  -2752,   3320,   4613 },
-  {  -5703,  -2975,   3944,   2659 },
-  {  -4972,  -1257,   -246,   2952 },
-  {  -4221,  -2487,   1702,   4295 },
-  {  -2900,  -1529,   2458,   4935 },
-  {  -5061,    407,   2416,   4050 },
-  {  -6931,  -3478,   2761,   2213 },
-  {  -6037,  -3921,   3192,   1866 },
-  {  -6113,   -811,   2407,   3782 },
-  {  -5878,  -1716,   1207,   3478 },
-  {  -5953,  -2853,   2207,   2712 },
-  {  -6807,  -3223,   2749,   3595 },
-  {  -3272,  -3157,   1389,   3788 },
-  {  -5368,  -1904,   1980,   5077 },
-  {  -7235,  -1398,   3075,   4548 },
-  {  -4765,  -3487,   2755,   2796 },
-  {  -7658,  -4435,   2694,   2582 },
-  {  -6997,  -4282,    456,   3832 },
-  {  -5563,  -3115,    -63,   3713 },
-  {  -4244,  -4220,   1450,   2767 },
-  {  -3801,  -2194,    190,   4303 },
-  {  -5458,  -4119,   1958,   2274 },
-  {  -7300,  -3469,   3514,   3193 },
-  {  -4594,  -2067,    775,   4752 },
-  {  -3389,  -1654,   1464,   5412 },
-  {  -4845,  -3483,    964,   3437 },
-  {  -6007,  -2818,   1666,   4659 },
-  {  -8709,  -5007,   1757,   3287 },
-  {  -5833,  -4389,   1025,   3171 },
-  {  -5788,  -1780,   3944,   3661 },
-  {  -4430,   -920,   1938,   4753 },
-  {  -7066,  -1857,   4591,   4538 },
-  {  -3549,   -513,   1427,   5317 },
-  {  -7517,  -1220,   2883,   3049 },
-  {  -7605,  -2687,   1874,   2735 },
-  {  -8718,  -4035,   2676,   3730 },
-  {  -7990,  -3907,   1185,   2607 },
-  {  -6058,  -1744,   3349,   5157 },
-  {  -5954,    565,   3161,   3250 },
-  {  -6478,   -612,   1930,   2271 },
-  {  -6535,  -1445,     -2,   1618 },
-  {  -8963,  -4151,   1192,   4044 },
-  {  -7227,  -3570,   1600,   4234 },
-  {  -4674,     79,    595,   3015 },
-  {  -3974,    430,   2727,   5137 },
-  {  -5299,      9,   3714,   4779 },
-  {  -6779,  -2699,     -8,   2436 },
-  {  -7016,  -1145,   1293,   2310 },
-  {  -6955,  -3312,   1534,   1801 },
-  {  -4025,    740,   1850,   4054 },
-  {  -9589,  -3460,   4154,   5270 },
-  {  -4404,  -1181,   4298,   5173 },
-  {  -7356,  -4583,    -18,   2644 },
-  {  -6516,  -1235,   4439,   6234 },
-  {  -3453,   -301,   4344,   4464 },
-  {  -4643,   1530,   3315,   4340 },
-  {  -4575,  -2557,   3754,   3682 },
-  {  -3643,  -3501,   2051,   2997 },
-  {  -5412,  -2475,   2301,   1579 },
-  {  -5846,    259,   1360,   2348 },
-  {  -5258,  -1358,   1050,    838 },
-  {  -5542,   -219,   6377,   5750 },
-  {  -5713,  -2952,    922,    899 },
-  {  -2049,  -1135,   5206,   1033 },
-  {  -1693,  -1886,   4835,   -106 },
-  {  -2344,  -3504,   4232,    -13 },
-  {  -2475,  -2334,   5043,   1126 },
-  {   -787,  -2549,   3880,   2138 },
-  {  -3159,  -2341,   4830,   2887 },
-  {  -1780,  -1009,   6240,   2061 },
-  {  -4327,  -3363,   2818,    886 },
-  {  -3376,  -2743,   4104,    207 },
-  {  -3250,  -4640,   2718,   1498 },
-  {   -382,  -1075,   4382,   3460 },
-  {  -2416,  -4168,   3530,    816 },
-  {  -1756,  -2708,   4861,    622 },
-  {  -1879,  -2097,   5156,   2889 },
-  {  -2496,  -2418,   3722,   2671 },
-  {  -2717,  -3252,   3341,   1944 },
-  {  -4063,  -4091,   3306,    267 },
-  {  -3549,  -3808,   3747,    842 },
-  {  -2635,    546,   5794,   1894 },
-  {  -1857,  -1121,   4383,   3964 },
-  {  -2226,  -2166,   3489,   3678 },
-  {  -3492,   -660,   5323,   1063 },
-  {  -3033,  -3130,   4382,   1828 },
-  {  -2703,   -625,   6369,   2851 },
-  {  -1656,  -2842,   4584,   -528 },
-  {  -4781,  -2622,   4390,   2097 },
-  {   -413,  -2045,   5081,   3035 },
-  {  -3810,  -2662,   4532,   1095 },
-  {  -3144,  -1858,   5215,   1880 },
-  {  -3562,  -1795,   4928,    670 },
-  {  -4800,  -1509,   5189,   1859 },
-  {  -1085,  -3832,   4169,    900 },
-  {  -1969,  -3270,   2857,   2878 },
-  {  -4267,  -4140,   3176,   1805 },
-  {  -5145,  -3727,   3524,   1168 },
-  {  -1346,  -1876,   5501,   1748 },
-  {  -4998,  -2945,   3699,    338 },
-  {  -3458,  -3096,   3406,   -635 },
-  {  -1751,  -3209,   3508,    395 },
-  {  -2507,    170,   5987,    705 },
-  {  -3756,  -1072,   5647,   3536 },
-  {  -2870,  -1439,   5026,   3212 },
-  {  -3913,  -3225,   3669,   2144 },
-  {  -3739,    226,   5747,    764 },
-  {  -2052,   -820,   5266,   3093 },
-  {  -3214,  -3820,   2409,   2391 },
-  {  -4398,  -2588,   3501,   -218 },
-  {  -4484,  -1763,   4180,   -198 },
-  {  -3368,  -1525,   4362,   -134 },
-  {  -2407,    224,   4905,   3533 },
-  {  -1369,  -2937,   4728,   1788 },
-  {  -4848,  -1707,   4159,    851 },
-  {  -3454,  -1749,   4281,   3230 },
-  {  -1990,  -3853,   3487,   1735 },
-  {  -3117,     92,   6155,   4075 },
-  {  -2676,  -2472,   4078,   -589 },
-  {  -1547,  -2012,   2626,   1835 },
-  {  -4275,   -588,   4824,    725 },
-  {   -601,  -2249,   3736,   3548 },
-  {  -4060,    -61,   5333,   3097 },
-  {  -4303,      7,   6551,   3054 },
-  {  -5003,  -1029,   5786,   3319 },
-  {  -2810,   -728,   5392,    199 },
-  {  -1232,   -200,   5228,   3121 },
-  {   2621,    165,  -6255,    298 },
-  {   3669,    537,  -6844,   1564 },
-  {   1598,  -1190,  -6235,   2523 },
-  {   2164,    -32,  -6894,   1383 },
-  {    853,  -1597,  -6069,   1449 },
-  {   1377,  -1661,  -5266,    108 },
-  {   2660,     48,  -5172,   -517 },
-  {   1903,   -391,  -5677,   1010 },
-  {   3792,    206,  -5274,    -11 },
-  {   1239,   2776,  -2929,   2721 },
-  {   4071,    149,  -7259,   3125 },
-  {   1436,   -480,  -6156,   -196 },
-  {   1373,  -1960,  -5005,   3122 },
-  {   3413,  -1271,  -5176,   3283 },
-  {   3060,    -68,  -6495,   2238 },
-  {   2700,  -2075,  -4681,     91 },
-  {   2928,  -1728,  -5168,   1858 },
-  {   4424,    828,  -4471,     88 },
-  {   2672,  -2604,  -4038,   2753 },
-  {   5223,   -123,  -6749,   2295 },
-  {   4237,   -420,  -5538,   1353 },
-  {   4744,  -1281,  -4097,   4708 },
-  {   1103,  -2764,  -4751,   2024 },
-  {   3747,  -1913,  -3911,   3960 },
-  {   2470,  -1416,  -5542,    615 },
-  {   4847,  -1354,  -5334,   1733 },
-  {   5336,     88,  -7593,   4007 },
-  {   2388,  -2880,  -4807,   1037 },
-  {   4495,   1391,  -5685,   -139 },
-  {   5253,   1637,  -6450,   1533 },
-  {   1199,    795,  -5515,   1261 },
-  {   1397,  -1259,  -4252,   3838 },
-  {    746,     70,  -6640,    604 },
-  {   1584,    166,  -4972,   3072 },
-  {    380,   -999,  -5397,   2267 },
-  {   2974,   1707,  -3242,   5360 },
-  {   5202,   -403,  -5453,   2832 },
-  {   3718,  -1731,  -4760,    714 },
-  {   4150,   -975,  -4792,     61 },
-  {   2925,   -818,  -4841,     15 },
-  {   5301,    577,  -4006,   3259 },
-  {   5265,   1986,  -5679,   3028 },
-  {   3752,   1928,  -4509,   3729 },
-  {   3278,   1925,  -6370,   1247 },
-  {   5107,   1721,  -4853,   3127 },
-  {   3279,   2982,  -2515,   4005 },
-  {   4622,    668,  -6204,    759 },
-  {   6034,    317,  -5763,   4818 },
-  {   -558,     57,  -3785,   2817 },
-  {   4476,   1616,  -3965,   4536 },
-  {   5953,   2056,  -8215,   2715 },
-  {   4387,   2613,  -7463,    868 },
-  {   5834,   1088,  -4736,   4924 },
-  {   6473,   -856,  -6991,   4172 },
-  {   4959,   -293,  -5162,     76 },
-  {   2731,   -843,  -6119,   3847 },
-  {   3245,   1202,  -6833,    616 },
-  {   2553,   1383,  -3829,   3859 },
-  {   4332,   2099,  -3480,   3622 },
-  {   2110,   2683,  -2728,   3990 },
-  {    876,   1167,  -3290,   3466 },
-  {   3991,   1709,  -2410,   4077 },
-  {   5105,    939,  -2584,   3256 },
-  {   4719,    688,  -1566,   3040 },
-  {  -3632,   4335,   1266,  -3303 },
-  {  -4956,   3207,   1312,  -2806 },
-  {  -4669,   2627,   2663,  -2435 },
-  {  -4282,   3708,   2303,  -3038 },
-  {  -4536,   2297,   -175,  -3350 },
-  {  -5234,   2503,   -139,   -880 },
-  {  -3978,   1512,   1092,  -3619 },
-  {  -4519,   4649,   1363,  -2455 },
-  {  -5118,   3132,   1961,  -1577 },
-  {  -5196,   3379,   -182,  -1378 },
-  {  -6420,   4486,   2397,  -1993 },
-  {  -5030,   5046,   1292,  -1118 },
-  {  -4559,   2573,   -927,  -1406 },
-  {  -3501,   3730,    691,  -4930 },
-  {  -4364,   2758,   1007,  -3909 },
-  {  -4026,   2839,  -1559,  -2340 },
-  {  -5037,   4053,    836,  -1571 },
-  {  -4727,   5136,   1110,  -3588 },
-  {  -5245,   2799,   -999,  -2164 },
-  {  -4954,   1501,    422,  -3963 },
-  {  -5994,   2726,   1462,  -2833 },
-  {  -5621,   5159,   2038,  -2512 },
-  {  -4991,   2291,   1917,  -3151 },
-  {  -5469,   4382,   -148,  -2978 },
-  {  -5858,   1983,    807,  -2720 },
-  {  -4709,   3556,    952,   -467 },
-  {  -2489,   2362,   1714,  -4230 },
-  {  -4717,   5004,  -1180,  -3672 },
-  {  -5914,   3653,   1359,  -1317 },
-  {  -5506,   2995,    780,  -1059 },
-  {  -5287,   3945,   2480,  -2293 },
-  {  -3849,   4358,    322,  -1770 },
-  {  -3911,   3570,    252,  -3185 },
-  {  -3660,   5128,    158,  -3719 },
-  {  -4599,   3277,   -503,  -2727 },
-  {  -3673,   3760,  -1252,  -3339 },
-  {  -5161,   2337,    388,  -1943 },
-  {  -3529,   2216,   2156,  -3080 },
-  {  -4309,   4331,   1808,  -1460 },
-  {  -4782,   3820,    480,  -2504 },
-  {  -4166,   3544,   -378,  -1567 },
-  {  -5572,   2466,   -418,  -2909 },
-  {  -6096,   2930,    119,  -1878 },
-  {  -5963,   3554,   1011,  -2233 },
-  {  -6433,   4335,    935,  -2930 },
-  {  -5004,   3314,  -1352,  -3430 },
-  {  -6042,   3463,  -1008,  -3940 },
-  {  -4671,   2214,   -640,  -5040 },
-  {  -2795,   3759,   1412,  -3803 },
-  {  -3647,   4436,    729,   -515 },
-  {  -3594,   1033,     56,  -4148 },
-  {  -2908,   3027,   2889,  -3485 },
-  {  -3338,   2234,    313,  -4285 },
-  {  -3825,   4497,   -561,  -2634 },
-  {  -6167,   3012,    -48,  -3149 },
-  {  -4828,   3515,   -969,  -4475 },
-  {  -5789,   2757,   -539,  -4173 },
-  {  -2452,   3067,    564,  -4249 },
-  {  -4921,   1358,   1331,  -2889 },
-  {  -3127,   4239,  -1045,  -1523 },
-  {  -4780,   2326,  -1118,  -3446 },
-  {  -3908,   5546,    152,  -2622 },
-  {  -6972,   2976,    337,  -2809 },
-  {  -4839,   4613,    -35,  -4077 },
-  {  -1408,   4822,  -1149,  -4997 },
-  {   -981,   4979,   -912,  -6304 },
-  {  -2098,   5689,   -888,  -2878 },
-  {  -3343,   4814,   -657,  -4434 },
-  {  -2461,   3601,   -967,  -4869 },
-  {  -2652,   3944,     87,  -5520 },
-  {  -1104,   6076,    174,  -6407 },
-  {    355,   5370,  -1721,  -5869 },
-  {   1242,   4497,  -1107,  -5091 },
-  {    -89,   4002,  -1491,  -5182 },
-  {   1059,   5693,  -1591,  -4905 },
-  {   1323,   4682,  -2078,  -4768 },
-  {    818,   3996,   -549,  -5468 },
-  {   -287,   4529,    929,  -5543 },
-  {   -919,   5519,  -2791,  -2844 },
-  {  -1407,   5679,  -3289,  -3974 },
-  {   -189,   6530,  -3547,  -4002 },
-  {   -900,   7039,  -3371,  -4855 },
-  {  -2983,   7211,   -363,  -4835 },
-  {   -814,   6503,   -104,  -5106 },
-  {  -2386,   6896,    809,  -4919 },
-  {    845,   4492,    352,  -6621 },
-  {  -1998,   7237,  -1646,  -4231 },
-  {  -3380,   6251,    471,  -4577 },
-  {  -1908,   7059,     84,  -5726 },
-  {   -340,   6346,   -803,  -6265 },
-  {  -2279,   5834,    -47,  -4633 },
-  {  -1532,   5286,  -1748,  -1901 },
-  {  -2757,   6188,   -453,  -3415 },
-  {  -1255,   6405,  -2043,  -6357 },
-  {    918,   5581,   -121,  -5667 },
-  {   1840,   5336,   -821,  -5034 },
-  {  -2475,   4992,  -1825,  -3104 },
-  {  -2413,   5606,  -1789,  -4298 },
-  {    132,   5128,  -2389,  -4442 },
-  {    223,   6400,  -2653,  -4742 },
-  {   -673,   5012,    680,  -4582 },
-  {  -1657,   6624,   -349,  -3596 },
-  {   -755,   6289,  -1860,  -3978 },
-  {   -572,   6894,  -1946,  -5207 },
-  {  -1141,   4756,  -2665,  -5586 },
-  {  -1073,   4269,   -431,  -4030 },
-  {    186,   5761,    916,  -5868 },
-  {  -1907,   4836,   1017,  -5106 },
-  {   -963,   3363,  -1248,  -6348 },
-  {  -3262,   4774,  -1818,  -5858 },
-  {    847,   3812,  -2538,  -4302 },
-  {  -1223,   5903,   1360,  -5479 },
-  {  -1094,   6923,  -1244,  -2381 },
-  {    267,   6276,   -709,  -2846 },
-  {   -157,   5840,   1124,  -4266 },
-  {    889,   3206,   -910,  -5305 },
-  {  -1736,   3344,    582,  -4838 },
-  {  -2357,   5676,  -2695,  -6277 },
-  {  -1916,   6901,   -986,  -5397 },
-  {  -3062,   6028,   -695,  -5687 },
-  {   1836,   3566,  -1357,  -5226 },
-  {  -2176,   4938,    646,  -3872 },
-  {  -2199,   3055,   -208,  -6124 },
-  {   -236,   3032,   -821,  -5325 },
-  {  -3989,   7277,   -565,  -3899 },
-  {   -595,   4362,     74,  -5975 },
-  {    684,   5874,   -841,  -4424 },
-  {  -2731,   6305,  -2389,  -5465 },
-  {  -5775,   1325,    -56,  -2528 },
-  {  -7029,   -534,  -1890,  -3278 },
-  {  -5798,    -15,  -2734,  -2210 },
-  {  -5504,  -1198,   -353,  -3659 },
-  {  -5079,    960,   -894,  -4336 },
-  {  -6073,    -36,   -133,  -3014 },
-  {  -5782,   -259,  -1025,  -3986 },
-  {  -6843,   1262,   -807,  -1639 },
-  {  -5263,   -918,  -3290,   -579 },
-  {  -4840,    461,  -2158,   -533 },
-  {  -6014,    -50,   -620,    504 },
-  {  -5843,    241,  -1359,   -282 },
-  {  -5898,    577,    769,  -3271 },
-  {  -6833,   -946,   -466,  -3347 },
-  {  -6026,   1459,   -512,   -729 },
-  {  -7361,    747,   -388,  -1110 },
-  {  -6391,   2142,  -1160,  -2513 },
-  {  -6995,    304,    498,  -2673 },
-  {  -6757,    679,   -386,   -433 },
-  {  -5222,   1688,  -1093,  -1032 },
-  {  -5019,    575,    184,  -3627 },
-  {  -4237,    628,  -3507,  -1243 },
-  {  -7479,   -456,  -1722,  -1486 },
-  {  -6464,    713,  -1273,  -1153 },
-  {  -6255,   1682,   -606,  -3607 },
-  {  -7033,   1497,    -71,  -1955 },
-  {  -6694,   1556,  -1721,  -3214 },
-  {  -6114,   -356,    813,  -2575 },
-  {  -5308,    632,  -1851,  -1636 },
-  {  -5742,   -911,  -1733,    383 },
-  {  -6083,   -387,  -2313,   -879 },
-  {  -6535,   -530,  -1505,  -2083 },
-  {  -4896,   1223,  -2750,  -1816 },
-  {  -6392,   -463,  -3247,  -2093 },
-  {  -5373,   1264,  -2706,  -3042 },
-  {  -3894,  -1390,  -1020,   -891 },
-  {  -6179,   1168,  -1966,  -1922 },
-  {  -5162,   1668,  -1617,  -1916 },
-  {  -6453,    920,  -1169,  -2432 },
-  {  -6130,   2005,   -536,  -1519 },
-  {  -6552,    -98,   -518,  -1938 },
-  {  -7528,    355,  -1101,  -1772 },
-  {  -5745,    610,   -247,  -1360 },
-  {  -7003,    177,  -2064,  -1958 },
-  {  -6956,   -570,  -2220,  -4225 },
-  {  -7830,    791,  -1394,  -2774 },
-  {  -7634,    480,  -3171,  -4224 },
-  {  -7913,   1154,   -350,  -2381 },
-  {  -5063,   1704,  -1804,  -2977 },
-  {  -4887,   -524,  -2703,    188 },
-  {  -5551,    406,  -1620,  -3063 },
-  {  -7109,   1342,    381,  -3021 },
-  {  -6846,    631,   -458,  -3398 },
-  {  -4606,   -605,     11,  -3930 },
-  {  -8134,   -225,  -1738,  -2648 },
-  {  -7043,    402,  -2734,  -3059 },
-  {  -7417,   1825,  -2545,  -4389 },
-  {  -6971,   -236,  -1031,   -665 },
-  {  -5752,   2111,  -1632,  -3808 },
-  {  -7660,    -78,   -624,  -3135 },
-  {  -6358,    619,  -1951,  -3911 },
-  {  -8134,    408,  -1935,  -3695 },
-  {  -6335,   1911,  -2368,  -4505 },
-  {  -7116,   2163,   -344,  -2753 },
-  {   2357,   4488,   2220,  -5682 },
-  {   1385,   3206,   2300,  -5305 },
-  {   1419,   2557,   5203,  -3516 },
-  {    262,   4315,   3920,  -1847 },
-  {   3316,   3187,   1612,  -5609 },
-  {   1729,   2350,   1673,  -6068 },
-  {   1603,   6126,   1467,  -2839 },
-  {  -1339,   3316,   3691,  -3530 },
-  {   -563,   4618,   3180,  -4548 },
-  {    463,   4624,   3111,  -5614 },
-  {   1246,   5455,   3356,  -5720 },
-  {    480,   2149,   5422,  -2893 },
-  {   1768,   4827,    913,  -5579 },
-  {   -149,   5381,   4366,  -3297 },
-  {    985,   3672,   2644,    -92 },
-  {   -258,   2911,   5817,  -2213 },
-  {   3428,   3289,   3351,  -3541 },
-  {   -666,   3295,   4727,  -2869 },
-  {     35,   6641,   4160,  -4052 },
-  {    623,   6787,   3156,  -4560 },
-  {   2654,   4360,   4676,  -4632 },
-  {   1386,   5246,   4834,  -4497 },
-  {   3488,   4574,   3856,  -5946 },
-  {    383,   4481,   4168,  -4110 },
-  {   1753,   3652,   4288,  -3326 },
-  {   1344,   4905,   2508,  -4660 },
-  {   1580,   4106,   3104,  -2224 },
-  {   2027,   5038,   1683,  -1554 },
-  {    446,   3699,   5872,  -3013 },
-  {   4637,   4087,   3578,  -5018 },
-  {   2629,   3560,   5331,  -4900 },
-  {   1527,   6674,   2523,  -4131 },
-  {  -1437,   2804,   2528,  -4464 },
-  {   -229,   3355,   2016,  -5537 },
-  {   3666,   3418,   4374,  -4581 },
-  {   1192,   3799,    923,  -6596 },
-  {   2040,   2956,    448,  -5322 },
-  {   2468,   5768,   4029,  -5869 },
-  {   3438,   6516,   3529,  -6667 },
-  {   2737,   5495,    680,  -5535 },
-  {   3896,   5727,   1801,  -4958 },
-  {   4988,   4957,   3592,  -6518 },
-  {   -542,   4416,   5794,  -2787 },
-  {   4136,   4354,   2064,  -4696 },
-  {   3067,   5936,   1207,  -3396 },
-  {   2789,   4966,   2405,  -3854 },
-  {   1731,   3270,   3251,  -1063 },
-  {   1767,   5537,   2084,  -2349 },
-  {    465,   3116,   4532,   -837 },
-  {   1499,   2627,   4610,  -2212 },
-  {    122,   3095,   3642,  -3552 },
-  {   2542,   2866,   2705,  -6402 },
-  {   3134,   4323,    698,  -4785 },
-  {    731,   1859,   3112,  -5242 },
-  {   2553,   2980,   3241,  -4846 },
-  {   1329,   5310,   1607,  -6624 },
-  {   2468,   1858,   3476,  -1034 },
-  {   -172,   4996,   2000,  -5562 },
-  {   2621,   4220,   1574,  -3386 },
-  {   -333,   1832,   3362,  -4117 },
-  {   2169,   6762,   3065,  -6225 },
-  {   2844,   5528,   3223,  -4765 },
-  {    526,   5175,   1644,  -4267 },
-  {   2922,   4426,   2414,  -2610 },
-  {    452,   1399,  -4516,  -2636 },
-  {   2872,   1720,  -4667,  -1435 },
-  {   1279,    702,  -5424,  -1984 },
-  {   2187,    870,  -5021,  -1341 },
-  {    583,   -144,  -4628,  -2464 },
-  {      3,   2237,  -5284,  -2827 },
-  {    -19,   1005,  -5460,  -1819 },
-  {   2897,   2084,  -5885,   -515 },
-  {   -400,   3370,  -5527,  -2947 },
-  {   1505,   2593,  -5518,  -1802 },
-  {   1341,   4534,  -5094,  -1899 },
-  {   3241,   3670,  -5493,  -1252 },
-  {  -1287,    921,  -5994,  -1675 },
-  {    627,    408,  -6652,   -364 },
-  {   -260,   1127,  -4849,  -3247 },
-  {    371,   3400,  -5976,  -2285 },
-  {   1533,   1566,  -6373,   -610 },
-  {   2462,   4274,  -6184,  -1254 },
-  {   1782,   3363,  -6222,  -1381 },
-  {    572,   4650,  -5673,  -2754 },
-  {   2674,   3414,  -4460,  -2154 },
-  {   3614,   3820,  -6883,   -398 },
-  {   1136,     -1,  -5511,  -1112 },
-  {  -1773,   1137,  -5647,  -2377 },
-  {   -753,   2104,  -6085,  -2565 },
-  {   -204,   3025,  -4731,  -1418 },
-  {  -1486,   1438,  -4380,   -216 },
-  {    302,    858,  -5786,   -264 },
-  {   3486,   1495,  -5234,   -783 },
-  {    888,   2327,  -3423,  -3720 },
-  {   -259,    772,  -6596,  -1311 },
-  {  -1197,   2073,  -5174,  -1826 },
-  {   1500,   3470,  -4462,  -2645 },
-  {   3072,   1960,  -3277,  -2264 },
-  {   1841,    952,  -4324,  -2340 },
-  {   1994,   2200,  -3940,  -2923 },
-  {  -1782,   1699,  -4667,  -1075 },
-  {  -1464,   2906,  -3468,   -375 },
-  {    366,   2380,  -3747,   1467 },
-  {   -545,   1645,  -4619,    376 },
-  {   1724,   2350,  -2374,  -3512 },
-  {   3184,   2628,  -2996,  -3275 },
-  {    734,   2010,  -6239,  -1479 },
-  {    524,   3756,  -4496,  -3263 },
-  {   1492,   3570,  -3494,  -3600 },
-  {   -932,    618,  -5389,  -2894 },
-  {   -133,   2161,  -4083,  -3267 },
-  {    786,    774,  -3279,  -3731 },
-  {   1078,    803,  -3843,  -3007 },
-  {   -332,   3405,  -3347,     40 },
-  {    -17,      6,  -4005,  -3690 },
-  {   -189,   4372,  -4488,  -2561 },
-  {   -450,   3846,  -3790,  -1370 },
-  {    362,   2212,  -5272,    -15 },
-  {  -1529,    791,  -6802,  -2296 },
-  {   2145,   4241,  -4474,    376 },
-  {   1813,   2426,  -2932,  -2726 },
-  {   -542,   4557,  -3140,  -1080 },
-  {   1192,   3784,  -4371,    -20 },
-  {   2784,   5188,  -6399,  -1394 },
-  {    431,   4561,  -3673,  -1398 },
-  {   1382,   3096,  -4083,   1253 },
-  {   1209,   4224,  -2930,   1500 },
-  {   2798,   2684,  -6676,   -606 },
-  {  -2396,   1510,  -5381,  -2713 },
-  {  -2625,   2542,  -4032,  -2880 },
-  {  -1231,   3967,  -4098,  -2886 },
-  {  -1393,   2374,  -3862,  -4525 },
-  {  -2495,   1665,  -1637,  -5445 },
-  {  -3854,   1759,  -1750,  -4944 },
-  {  -2373,   1668,  -2856,  -6251 },
-  {  -2668,   1981,   -886,  -4557 },
-  {  -2927,   4427,  -3451,  -6172 },
-  {  -1925,   2596,  -4696,  -2527 },
-  {  -3202,   2847,  -3928,  -5896 },
-  {  -3332,   1665,  -5025,  -3412 },
-  {  -3212,   3115,  -4155,  -4062 },
-  {  -1013,   3205,  -5133,  -3751 },
-  {  -2022,   4595,  -3947,  -5611 },
-  {  -3556,   1755,  -3715,  -2300 },
-  {  -1784,   4114,  -2723,  -1773 },
-  {  -3586,   4081,  -2733,  -4942 },
-  {  -1608,   3685,  -4154,  -4573 },
-  {  -3368,   4042,  -4452,  -6227 },
-  {  -1407,   3881,  -5729,  -3719 },
-  {  -2751,   3281,  -5077,  -4999 },
-  {  -3791,   2410,  -4906,  -5288 },
-  {   -730,   2303,  -4217,  -3755 },
-  {  -1812,   2311,  -5492,  -3709 },
-  {   -610,   4336,  -3915,  -3783 },
-  {  -2841,   4337,  -4278,  -4430 },
-  {  -1662,   4666,  -4661,  -3964 },
-  {   -589,   5209,  -4923,  -3682 },
-  {  -4155,   2234,  -4076,  -4218 },
-  {  -3951,   2770,  -2665,  -2805 },
-  {  -2302,   3228,  -3717,  -1908 },
-  {  -3129,   4373,  -2264,  -2851 },
-  {   -447,   1363,  -3578,  -4323 },
-  {  -2648,   4237,  -3159,  -3071 },
-  {  -4072,   3241,  -3541,  -4605 },
-  {  -4507,   3458,  -2339,  -3838 },
-  {  -1646,    997,  -4926,  -3970 },
-  {  -3025,   1614,  -3940,  -1242 },
-  {  -1337,   1756,  -3163,  -5529 },
-  {  -3203,   1865,  -3282,  -4354 },
-  {  -1646,   2118,  -2203,  -6018 },
-  {    174,   1871,  -2707,  -4639 },
-  {  -2607,   1485,  -4778,  -4750 },
-  {  -2199,   3991,  -3134,  -4879 },
-  {  -2962,   3323,  -2816,  -2419 },
-  {  -5286,   2495,  -4548,  -5395 },
-  {  -2810,   3710,  -2274,  -4211 },
-  {   -330,   3006,  -2993,  -4678 },
-  {  -1187,   2411,  -2743,  -5196 },
-  {   -664,   4033,  -3101,  -5641 },
-  {  -1458,   3602,  -2816,  -5371 },
-  {  -4116,   4923,  -3321,  -5630 },
-  {  -4165,   2528,  -2592,  -4798 },
-  {  -2759,   3080,  -2333,  -5719 },
-  {  -5157,   3011,  -5526,  -6348 },
-  {  -3095,   2126,  -5881,  -4234 },
-  {  -4377,   3849,  -3600,  -6099 },
-  {  -1994,   4947,  -5235,  -4753 },
-  {  -1067,    600,  -3258,  -5133 },
-  {  -4992,   3302,  -2208,  -5051 },
-  {  -3377,   2981,  -1655,  -4815 },
-  {  -3325,   2446,  -1787,  -6116 },
-  {  -2341,   2737,  -3240,  -6347 },
-  {  -2258,  -3732,   3710,  -1235 },
-  {  -1558,  -3849,   2694,  -3012 },
-  {   -599,  -4837,   3050,  -2951 },
-  {  -2246,  -5433,   2798,  -1910 },
-  {  -2255,  -4989,   3260,    270 },
-  {  -3026,  -5353,   2693,  -1036 },
-  {  -1151,  -6097,   1097,  -3782 },
-  {  -3391,  -6012,   2130,  -1303 },
-  {  -2850,  -4422,   3375,   -480 },
-  {  -1138,  -3779,   1491,  -4162 },
-  {   -551,  -3892,   3787,  -2082 },
-  {  -3221,  -3676,   3144,  -1202 },
-  {  -3023,  -5196,   2650,    605 },
-  {  -1756,  -5729,   2646,    321 },
-  {  -2693,  -4409,    494,  -4797 },
-  {  -1913,  -4573,   3372,  -1730 },
-  {  -1277,  -3604,   4061,   -993 },
-  {   -420,  -4993,   1351,  -4796 },
-  {  -3052,  -5333,   1435,  -1242 },
-  {   -602,  -5034,   3869,  -1141 },
-  {  -2436,  -4680,   1665,  -3019 },
-  {  -2657,  -3658,   1459,  -3391 },
-  {  -1220,  -6246,   2749,   -525 },
-  {  -3838,  -4844,   2265,  -1735 },
-  {  -1247,  -5679,   3356,  -1417 },
-  {   -917,  -5448,   3342,    105 },
-  {  -1756,  -6839,   2276,  -2350 },
-  {   -412,  -5206,   1764,  -3539 },
-  {  -1439,  -6915,   1442,  -3750 },
-  {  -1381,  -4439,   3863,   -282 },
-  {  -3482,  -4953,   2726,   -336 },
-  {  -1376,  -5931,   1714,  -1987 },
-  {  -1716,  -4405,   2608,    105 },
-  {  -1590,  -5191,   2652,  -2704 },
-  {  -2149,  -6442,   2453,  -1263 },
-  {  -3426,  -3832,   2334,  -1829 },
-  {  -2747,  -5948,   2362,   -173 },
-  {  -2435,  -3267,   2966,  -1710 },
-  {  -3979,  -4282,   2705,   -775 },
-  {   -356,  -4238,   2544,  -4343 },
-  {  -1363,  -6471,   2817,  -1836 },
-  {  -2878,  -5117,    218,  -3149 },
-  {  -3539,  -5196,   1710,  -2356 },
-  {  -2888,  -4537,   2746,  -1701 },
-  {  -1870,  -4439,   1496,  -4121 },
-  {  -1486,  -3388,   3349,  -2145 },
-  {  -3333,  -4138,   1467,  -2876 },
-  {   -345,  -5340,   1012,  -1190 },
-  {  -1672,  -4992,   2289,  -1029 },
-  {  -2146,  -5528,   3038,   -635 },
-  {   -316,  -3656,   3426,  -3152 },
-  {  -2695,  -5812,   2336,  -2050 },
-  {  -2067,  -6052,    737,  -3258 },
-  {  -2664,  -4205,   -350,  -1266 },
-  {   -617,  -5406,     80,  -4853 },
-  {  -2418,  -3825,   1853,  -1326 },
-  {  -1961,  -4339,    583,  -4315 },
-  {  -1495,  -5141,   -133,  -5205 },
-  {  -3208,  -6440,   1691,  -2069 },
-  {  -2632,  -3633,   2325,  -2761 },
-  {  -2624,  -5670,   1252,  -3676 },
-  {  -3687,  -5608,    687,  -2833 },
-  {  -3320,  -5707,     16,  -3877 },
-  {  -2738,  -6112,     84,  -5135 },
-  {   2277,  -5661,   3076,    843 },
-  {   1555,  -5769,   2821,  -5236 },
-  {    536,  -6381,    603,  -4910 },
-  {    734,  -4609,   3314,  -4092 },
-  {   1836,  -4547,   3267,  -4322 },
-  {    -13,  -5976,   3752,  -1607 },
-  {   1423,  -6318,   2336,    398 },
-  {    365,  -7779,   1498,   -534 },
-  {   2104,  -8366,   2946,  -1345 },
-  {    143,  -5545,   1898,  -3756 },
-  {    655,  -6852,   1430,    148 },
-  {      4,  -6653,   2397,    -59 },
-  {   2346,  -5996,   4562,   -934 },
-  {   1229,  -7104,   2963,   -598 },
-  {   -528,  -7048,   2887,  -1790 },
-  {   1451,  -6857,   3900,  -1637 },
-  {    554,  -6018,   3336,      9 },
-  {   3278,  -5758,   4034,    129 },
-  {   3541,  -7145,   4905,  -1575 },
-  {   2339,  -6907,   3464,   -301 },
-  {   2775,  -7301,   1667,  -3894 },
-  {    539,  -7887,    991,  -4156 },
-  {   2115,  -7421,   3131,  -3075 },
-  {   2803,  -8546,   2564,  -5836 },
-  {   2869,  -5833,   1620,  -4561 },
-  {   2591,  -7281,   3215,  -4719 },
-  {  -1228,  -8477,    706,  -4782 },
-  {   1967,  -5243,   4813,  -1940 },
-  {    701,  -7010,   2273,  -3893 },
-  {    915,  -8470,   1918,  -5620 },
-  {    -94,  -6715,    156,  -3873 },
-  {   1074,  -5607,   4389,  -1017 },
-  {   2739,  -6551,   1227,  -3521 },
-  {    725,  -7835,   2701,  -1291 },
-  {   -493,  -7475,   2263,  -1075 },
-  {   -412,  -6508,   2984,   -744 },
-  {    665,  -5451,   3725,  -2692 },
-  {   1499,  -8129,   3564,  -2072 },
-  {   2870,  -6333,   4487,  -2108 },
-  {    706,  -5007,   3911,   -152 },
-  {   -482,  -8660,   1483,  -2900 },
-  {   2481,  -6596,   2518,  -1715 },
-  {   1403,  -6414,   1398,  -5387 },
-  {    652,  -6267,    583,  -5942 },
-  {    694,  -7540,    646,  -6272 },
-  {   2275,  -7614,    256,  -5015 },
-  {   1416,  -9727,   1900,  -3153 },
-  {   2760,  -6433,   3875,  -3771 },
-  {   2325, -11196,   2182,  -5155 },
-  {   1223, -11061,   1377,  -5097 },
-  {    108, -10603,    307,  -4952 },
-  {   -118,  -8268,   1650,  -1572 },
-  {   1839,  -7943,   1755,   -612 },
-  {   2501,  -9056,    981,  -2969 },
-  {   2902,  -8476,   1491,  -5780 },
-  {   1995, -11175,   1585,  -3643 },
-  {    696,  -8212,    828,  -2474 },
-  {   1526,  -8649,   1380,  -1210 },
-  {    461,  -7253,   3222,  -2229 },
-  {   2966,  -8641,   4121,  -3271 },
-  {    833,  -6039,   2361,  -1086 },
-  {   3565,  -7312,   1980,  -5427 },
-  {   2850,  -8671,   3760,  -1846 },
-  {   2643,  -7281,   2163,   -173 },
-  {   3463,  -3706,  -3132,   -923 },
-  {   1315,  -3825,  -3443,      2 },
-  {   2594,  -4083,  -3815,    670 },
-  {   1826,  -4291,  -2741,   -155 },
-  {    868,  -3749,  -4175,   -298 },
-  {   2008,  -4237,  -3897,   -517 },
-  {   1242,  -3493,  -4335,  -1335 },
-  {    -88,  -4142,  -3390,  -1529 },
-  {   2176,  -3488,  -3822,   -975 },
-  {   1706,  -5188,  -3415,   -637 },
-  {   2717,  -6159,  -2333,   -882 },
-  {   1276,  -3978,  -4361,    537 },
-  {   2471,  -5556,  -2866,   -208 },
-  {    799,  -4673,  -4086,     56 },
-  {   1901,  -4786,  -3533,    270 },
-  {   3036,  -3902,  -3606,   -333 },
-  {   2249,  -3317,  -4319,   -144 },
-  {   2594,  -4207,  -2105,  -2930 },
-  {   4008,  -4774,  -2626,   -902 },
-  {   1038,  -3659,  -3496,  -2454 },
-  {   2725,  -3597,  -3298,  -1535 },
-  {   1662,  -5803,  -2813,    175 },
-  {    705,  -3757,  -3441,  -1484 },
-  {   1860,  -5987,  -2821,   -886 },
-  {   3786,  -4918,  -2199,  -1929 },
-  {   3683,  -4235,  -2547,  -1287 },
-  {   2531,  -4896,  -2956,  -1593 },
-  {   1005,  -5585,  -3324,   -180 },
-  {   1625,  -5229,  -1756,  -3642 },
-  {   1494,  -5041,  -2989,  -2685 },
-  {   2718,  -4655,  -3224,   -867 },
-  {   2374,  -6640,  -1745,  -2975 },
-  {   2133,  -6436,  -2477,  -1499 },
-  {   1833,  -4418,  -3523,  -1512 },
-  {   1128,  -4910,  -2658,  -1106 },
-  {    689,  -4777,  -2831,  -2085 },
-  {   3593,  -5280,  -2627,   -315 },
-  {   3264,  -3771,  -2673,  -1861 },
-  {   3202,  -5602,  -2409,    402 },
-  {    552,  -4618,  -2221,  -3002 },
-  {   3095,  -5356,  -2666,  -1083 },
-  {   3401,  -4609,  -3146,     45 },
-  {   3051,  -4662,  -2192,  -2232 },
-  {   2798,  -5552,  -2462,  -1941 },
-  {   2354,  -5815,  -2223,  -2619 },
-  {    192,  -3708,  -2807,  -2658 },
-  {   1886,  -4226,  -1862,  -3529 },
-  {   2526,  -3976,  -2819,  -2332 },
-  {   1577,  -3870,  -2711,  -2806 },
-  {   1288,  -5588,  -3382,  -1403 },
-  {   2711,  -5399,  -1564,  -3253 },
-  {   1459,  -5492,  -2222,   -322 },
-  {   2823,  -5091,  -2886,    776 },
-  {   3559,  -5821,  -2109,  -1360 },
-  {   1587,  -6331,  -2760,  -1909 },
-  {   2139,  -5213,  -2874,  -2120 },
-  {   1318,  -4337,  -3695,  -2098 },
-  {    821,  -4471,  -1849,   -565 },
-  {   3329,  -4782,  -1725,    -89 },
-  {    582,  -4914,  -4105,  -1119 },
-  {    417,  -4144,  -4072,  -2529 },
-  {   -199,  -3803,  -2765,  -4042 },
-  {   2731,  -4283,  -2143,      1 },
-  {   2911,  -6187,  -1951,  -2116 },
-  {   1573,  -6094,   -493,  -2838 },
-  {   2081,  -6927,   -864,  -3211 },
-  {   1058,  -7826,     79,   -364 },
-  {   3147,  -5570,   -684,   -978 },
-  {   3572,  -5856,   1060,   1824 },
-  {   1143,  -6702,  -1478,    338 },
-  {   2341,  -7220,    -88,    260 },
-  {   3639,  -6861,    668,    815 },
-  {   2227,  -6268,  -1706,    446 },
-  {   3390,  -6082,   -353,   1302 },
-  {   1123,  -7556,  -1237,   -430 },
-  {   1729,  -7742,    729,   -218 },
-  {   1457,  -6774,    587,    579 },
-  {    505,  -6919,   -569,    371 },
-  {   1106,  -7245,     78,    158 },
-  {   2755,  -6745,  -1122,    338 },
-  {   3069,  -6040,  -1415,    986 },
-  {   2174,  -7064,  -1430,   -283 },
-  {   1390,  -8626,   -446,  -3031 },
-  {   3534,  -6890,   -431,    547 },
-  {   2267,  -9618,    475,  -2994 },
-  {   3672,  -7673,     75,   -115 },
-  {   2131,  -7560,  -1206,   -750 },
-  {   2972,  -7477,   -685,   -262 },
-  {   1604,  -6637,   -672,    699 },
-  {   1666,  -7577,   -577,   -240 },
-  {   1591,  -6554,  -2158,    -94 },
-  {   2348,  -6286,   -353,   1123 },
-  {   2017,  -8810,   -412,  -1805 },
-  {   2892,  -6713,  -1765,   -554 },
-  {   2500,  -6828,  -1995,  -1197 },
-  {   3877,  -6639,   -224,  -1655 },
-  {   2392,  -7872,    -91,   -333 },
-  {   3562,  -7370,   -532,  -2836 },
-  {   2552,  -7614,    164,  -1805 },
-  {    990,  -6104,    218,    438 },
-  {    910,  -7861,    312,  -1195 },
-  {   1472,  -6327,    372,   -640 },
-  {   1576,  -7143,  -1983,   -843 },
-  {    422,  -7625,   -457,   -278 },
-  {   1797,  -8532,    405,  -1011 },
-  {   1088,  -7396,   -238,  -2277 },
-  {   3209,  -6753,  -1431,  -2072 },
-  {   2617,  -6839,    100,  -2573 },
-  {   2575,  -8573,   -387,  -3188 },
-  {   3618,  -6971,  -1190,   -321 },
-  {   2205,  -7361,  -1695,  -2008 },
-  {   2985,  -6297,   1464,   1179 },
-  {   2804,  -7310,   1053,    338 },
-  {   1362,  -6074,  -1163,   -840 },
-  {   3336,  -6325,  -1794,     21 },
-  {   2836,  -8109,    818,   -329 },
-  {   2791,  -5879,    560,   1546 },
-  {   2392,  -6064,    135,    100 },
-  {   1838,  -6194,    596,   1085 },
-  {   1926,  -7515,   -414,  -4901 },
-  {   3225,  -7298,  -1202,  -1189 },
-  {   3960,  -7558,   -659,   -719 },
-  {   3442,  -6647,  -1692,  -1095 },
-  {   3381,  -6441,    262,   -886 },
-  {   1431,  -8150,  -1186,  -1406 },
-  {    340,  -8498,   -150,   -899 },
-  {   3004,  -8149,   -260,   -953 },
-  {   2749,  -6611,    563,    873 },
-  {  -6647,  -1325,  -4517,  -4691 },
-  {  -6005,  -1657,  -4089,  -3797 },
-  {  -3157,    588,  -5213,  -3068 },
-  {  -3311,  -1425,  -6329,  -3726 },
-  {  -5866,   -819,  -3857,  -2744 },
-  {  -5001,  -1799,  -1075,  -4621 },
-  {  -5330,  -2650,  -2672,  -4664 },
-  {  -4930,   -539,  -2363,  -4010 },
-  {  -2984,     10,  -3863,  -5749 },
-  {  -1055,  -2106,  -3713,  -4267 },
-  {  -5476,   -502,  -4279,  -6504 },
-  {  -5231,  -1543,  -5018,  -6425 },
-  {  -5134,   -363,  -3165,  -5109 },
-  {  -3953,   -771,  -4107,  -6393 },
-  {  -2159,   -563,  -3652,  -5342 },
-  {  -3888,  -2321,   -919,  -5057 },
-  {  -1236,   -597,  -4235,  -4193 },
-  {  -4053,    675,  -3083,  -6174 },
-  {  -2793,  -1089,  -5396,  -3460 },
-  {  -3000,    -44,  -2209,  -6575 },
-  {  -3336,  -1531,  -4313,  -5160 },
-  {  -2127,    128,  -4851,  -3692 },
-  {  -3321,    136,  -2067,  -5660 },
-  {  -5215,   1404,  -4374,  -4356 },
-  {  -2747,    400,  -6340,  -3691 },
-  {  -3926,   -599,  -5361,  -5006 },
-  {  -2875,  -2592,  -5143,  -4092 },
-  {  -4991,  -1958,  -5322,  -4891 },
-  {  -4965,  -1318,  -6652,  -5333 },
-  {  -4920,  -1691,  -3388,  -5561 },
-  {  -3644,  -3354,  -2688,  -5982 },
-  {  -5076,   -919,  -4563,  -2984 },
-  {  -6114,    250,  -3884,  -3915 },
-  {  -4014,    744,  -3973,  -1924 },
-  {  -5543,  -1041,  -5557,  -3847 },
-  {  -4711,  -1352,  -5649,  -2603 },
-  {  -3362,    775,  -5305,  -4879 },
-  {  -5001,    107,  -3554,  -2888 },
-  {  -6258,  -1651,  -6356,  -6566 },
-  {  -4529,    407,  -5003,  -3865 },
-  {  -5154,    550,  -5278,  -5465 },
-  {  -4195,   -467,  -1894,  -3129 },
-  {  -5022,   1127,  -3349,  -3314 },
-  {  -6075,   1250,  -4313,  -5641 },
-  {  -2677,  -2283,  -2312,  -5903 },
-  {  -4113,    193,  -1195,  -4833 },
-  {  -3940,  -1048,  -1389,  -5079 },
-  {  -3703,    917,  -4043,  -4451 },
-  {  -3366,  -4231,  -1534,  -5488 },
-  {  -3326,  -3583,  -2091,  -4903 },
-  {  -5144,   1254,  -2532,  -4949 },
-  {  -5982,   -870,  -2545,  -4555 },
-  {  -3925,   -157,  -5367,  -2281 },
-  {  -6419,   -746,  -5668,  -4371 },
-  {  -5787,    518,  -7096,  -5805 },
-  {  -4258,    954,  -6453,  -4321 },
-  {  -4771,   -695,  -4158,  -1639 },
-  {  -7078,   -760,  -5195,  -5877 },
-  {  -7348,     83,  -4101,  -4586 },
-  {  -2430,    184,  -2874,  -1679 },
-  {  -2284,  -3943,  -2924,  -5034 },
-  {  -1804,  -1785,  -3002,  -4710 },
-  {  -4399,  -2772,  -1815,  -4637 },
-  {  -6340,  -2626,  -2824,  -5191 },
-  {  -4998,  -5168,  -3480,   1905 },
-  {  -3958,  -5492,  -1599,   1579 },
-  {  -2471,  -3755,   -276,   3182 },
-  {  -3033,  -5779,  -1063,   1554 },
-  {  -2936,  -4829,  -1290,   2386 },
-  {  -1835,  -5073,  -3051,   1299 },
-  {  -1724,  -3771,  -3935,   2324 },
-  {  -5070,  -2550,  -3692,    768 },
-  {  -4326,  -5333,   -297,   1878 },
-  {  -3472,  -5619,  -3094,    992 },
-  {  -3027,  -4384,  -3038,   2265 },
-  {  -3201,  -5332,     67,   2200 },
-  {  -1681,  -4373,  -1947,   2461 },
-  {  -3221,  -3329,  -4238,   2564 },
-  {  -1262,  -2968,  -2915,   3227 },
-  {  -3419,  -1878,  -3373,   2110 },
-  {  -2244,  -5583,  -2012,   1288 },
-  {  -1971,  -5266,   -990,   1812 },
-  {  -2975,  -2778,   -452,   4063 },
-  {  -2198,  -1165,  -3298,   2965 },
-  {  -4782,  -4894,  -4767,    664 },
-  {  -6002,  -3950,  -2806,   2025 },
-  {  -3142,  -3162,  -2859,   3295 },
-  {  -3262,  -3340,  -4123,   1596 },
-  {  -4014,  -3918,  -1955,   3361 },
-  {  -1700,  -3463,  -1346,   3449 },
-  {  -4245,  -4445,  -4743,   1644 },
-  {  -4180,  -3969,   -401,   3281 },
-  {  -2782,  -5240,  -4117,   1156 },
-  {  -5744,  -4040,  -1439,   3470 },
-  {  -5063,  -4663,   -323,   3172 },
-  {  -4531,  -3319,   -844,   3988 },
-  {  -6226,  -5125,  -2064,   2976 },
-  {  -3115,  -3267,  -1531,   3898 },
-  {  -4628,  -4421,  -2864,   2808 },
-  {  -4559,  -2989,  -3442,   2024 },
-  {  -1775,  -4487,   -656,   2477 },
-  {  -2664,  -1865,  -1884,   4081 },
-  {  -1828,  -2575,  -3894,   3378 },
-  {  -6441,  -3677,  -2025,   1677 },
-  {  -4141,  -2156,  -1191,   3474 },
-  {  -4802,  -1623,  -1727,   2160 },
-  {  -5474,  -2745,  -1475,   2498 },
-  {  -3664,  -1056,  -1975,   2491 },
-  {  -4672,  -3062,  -2235,   2933 },
-  {  -4205,  -5960,  -2849,   1517 },
-  {  -4995,  -5708,  -1739,   1805 },
-  {  -4892,  -6080,  -4793,    872 },
-  {  -4270,  -4172,  -4263,   2185 },
-  {  -4687,  -1470,  -2905,   1023 },
-  {  -6446,  -5017,  -3919,   1000 },
-  {  -6046,  -5538,  -3943,   2006 },
-  {  -6028,  -3750,  -3953,    771 },
-  {  -5959,  -4582,  -5024,    824 },
-  {  -5818,  -2576,  -2249,   1326 },
-  {  -5659,  -5345,  -1119,   2500 },
-  {  -3346,  -4155,    606,   2749 },
-  {  -5680,  -4827,  -2501,   1838 },
-  {  -6193,  -2543,  -1295,    840 },
-  {  -6871,  -4925,  -3512,   1801 },
-  {  -5605,  -1788,  -1895,    779 },
-  {  -3922,  -5712,  -4644,    510 },
-  {  -4745,  -3869,  -4533,     99 },
-  {  -2984,  -4907,   -399,   1497 },
-  {   1847,   -478,   3061,  -5812 },
-  {   4450,  -1116,   3609,  -6570 },
-  {   3139,     99,   3007,  -5532 },
-  {   2590,  -3782,   3138,  -4770 },
-  {   1881,   1204,   5778,  -3404 },
-  {   3631,   2060,   5566,  -5038 },
-  {   3461,   1961,   5167,  -3800 },
-  {   2947,    273,   4536,  -4389 },
-  {   4453,  -1730,   5788,  -4370 },
-  {   4032,   1805,   2666,  -4534 },
-  {   3487,   -944,   2313,  -6028 },
-  {   1313,     34,   4210,  -4067 },
-  {   5632,  -1502,   5825,  -5855 },
-  {   7736,   -547,   4879,  -5476 },
-  {   4906,  -1512,   4760,  -5760 },
-  {   3843,    447,   1091,  -4958 },
-  {   2982,  -1135,   5442,  -4386 },
-  {   3579,    271,   3031,  -6770 },
-  {   3932,   -211,   4688,  -5507 },
-  {   4411,   1720,   2387,  -5584 },
-  {   5379,   -479,   4575,  -6280 },
-  {   3613,   -362,   2012,  -4885 },
-  {   3744,  -2013,   4493,  -5073 },
-  {   5693,    109,   4379,  -3362 },
-  {   5475,   -621,   5317,  -3985 },
-  {   6411,   -673,   5708,  -4752 },
-  {   4933,   -796,   7262,  -4290 },
-  {   2804,    444,   6276,  -3655 },
-  {   4120,   -517,   6078,  -4531 },
-  {   5119,    841,   3486,  -3910 },
-  {   4738,   1539,   3525,  -2970 },
-  {   5086,    370,   5895,  -5640 },
-  {   4235,   2716,   4589,  -5044 },
-  {   3691,    682,   6199,  -4700 },
-  {   6111,   -570,   6271,  -6528 },
-  {   2611,   1277,   3756,  -4802 },
-  {   4395,    970,   3807,  -5879 },
-  {   5225,   2299,   3242,  -4333 },
-  {   5144,   1778,   4946,  -5545 },
-  {   2989,  -3016,   3247,  -5495 },
-  {   2983,    920,   2071,  -6059 },
-  {   5270,   -903,   4434,  -2350 },
-  {   6415,   -585,   3970,  -3554 },
-  {   3866,   -197,   5216,  -2884 },
-  {   3767,  -1298,   6702,  -3315 },
-  {   6299,   2620,   5284,  -6824 },
-  {   6654,    646,   3653,  -4927 },
-  {   4770,   3047,   5160,  -6287 },
-  {   5364,    434,   2919,  -5207 },
-  {   2998,   1344,   4801,  -2456 },
-  {   3896,   1013,   3773,  -1864 },
-  {   2115,    655,   2999,  -6344 },
-  {   5170,   -981,   2849,  -4464 },
-  {   2735,  -2159,   2717,  -5776 },
-  {   2430,  -1952,   4392,  -4559 },
-  {   6143,  -1180,   3659,  -4746 },
-  {   4978,  -1483,   1726,  -4875 },
-  {   3486,  -2383,   3306,  -4301 },
-  {   1434,  -1372,   4171,  -4770 },
-  {   3354,  -2627,   1525,  -5093 },
-  {   6790,   2386,   3995,  -5909 },
-  {   1475,  -2674,   3451,  -4204 },
-  {   1999,  -3494,   3693,  -5556 },
-  {   4764,  -2848,   2856,  -5589 },
-  {  -3677,   5131,   2827,  -2934 },
-  {  -2844,   7078,   2852,  -3580 },
-  {  -3902,   6434,   4118,  -1911 },
-  {  -1769,   7530,   3492,  -3541 },
-  {  -1937,   5679,   -447,  -1127 },
-  {  -2456,   4680,   4196,  -2407 },
-  {  -2778,   8241,   1698,  -4288 },
-  {  -2876,   6104,   5182,  -2387 },
-  {  -2802,   7341,   4463,  -2938 },
-  {  -1025,   6267,   4752,  -3201 },
-  {  -2349,   5413,   2041,  -3794 },
-  {  -2252,   8225,   2856,  -4269 },
-  {  -1465,   4967,   4976,  -2500 },
-  {   -636,   7565,   3517,  -4233 },
-  {  -1905,   5618,   3904,  -2942 },
-  {   -302,   6816,   3343,  -3316 },
-  {  -2210,   4156,   2817,  -3511 },
-  {   -717,   6568,   1863,  -2951 },
-  {  -3873,   5682,   2164,   -575 },
-  {  -2878,   5835,    440,  -2597 },
-  {  -3228,   7701,   2610,  -2514 },
-  {  -3608,   8888,   3377,  -2468 },
-  {  -2582,   9717,   2519,  -3126 },
-  {  -5238,   6202,   2866,  -2831 },
-  {  -3428,   7370,   3056,   -335 },
-  {  -1681,   8836,   1210,  -2010 },
-  {  -3276,   6724,   1156,  -3930 },
-  {   -894,   8149,    827,  -1258 },
-  {  -2965,   8631,   2549,  -1320 },
-  {  -3961,   6902,   3581,     55 },
-  {  -1894,   7745,   1750,   -841 },
-  {   -821,   6844,    850,   -676 },
-  {   -608,   6948,     -4,  -1376 },
-  {    615,   6524,   1089,  -1147 },
-  {  -2972,   5668,   1091,   -489 },
-  {   -157,   4649,   2904,   -413 },
-  {    673,   5121,   1498,    -66 },
-  {   -390,   5902,   1611,   -245 },
-  {  -2349,   5478,   4772,  -1320 },
-  {     88,   6798,   1972,  -1859 },
-  {  -1213,   5120,   2991,    200 },
-  {  -2347,   6040,   2839,    376 },
-  {   -578,   5976,   3364,  -1796 },
-  {  -1391,   5872,   3002,   -965 },
-  {   -564,   4496,   3946,  -1186 },
-  {  -2299,   6386,   3135,  -2176 },
-  {  -2131,   5641,   2011,   1223 },
-  {   -772,   5807,   1124,    895 },
-  {  -2837,   6758,   2297,   -740 },
-  {  -3091,   6298,   1415,  -2126 },
-  {  -4197,   6036,   1843,  -3022 },
-  {    -41,   6459,     92,    344 },
-  {  -2241,   6860,   2095,  -4396 },
-  {  -1931,   7088,   2117,  -2135 },
-  {  -2375,   4422,   1688,  -3169 },
-  {  -1742,   6674,   1538,   -119 },
-  {  -4818,   7749,   4192,  -1577 },
-  {  -2004,   5672,    193,   -430 },
-  {  -3825,   6042,   2128,  -1898 },
-  {  -1108,   8033,   2119,  -3013 },
-  {  -2370,   5453,   1721,    266 },
-  {  -1570,   7134,    614,  -2638 },
-  {  -1519,   8752,   3503,  -4330 },
-  {  -2050,   3845,   2907,  -1126 },
-  {   5085,   4412,   -335,  -1923 },
-  {   3618,   1423,   -613,  -4012 },
-  {   4481,   3729,    589,  -4631 },
-  {   4270,   3216,  -1763,  -3168 },
-  {   4241,   1796,  -1701,  -2796 },
-  {   4787,   2338,   -487,  -3639 },
-  {   2915,   3429,   -621,  -4753 },
-  {   5175,   1660,  -1265,  -3223 },
-  {   4280,   4057,   -684,  -4079 },
-  {   4980,   4419,  -1455,  -2719 },
-  {   5436,   2464,    387,  -4197 },
-  {   4507,   4018,   1121,  -3314 },
-  {   6020,   2401,   -413,  -3201 },
-  {   4200,   3789,   -333,  -2813 },
-  {   5229,   2493,  -1194,  -1878 },
-  {   5851,   2695,   -492,  -2292 },
-  {   5743,   3288,   -697,  -1221 },
-  {   5692,   2612,    979,  -2227 },
-  {   5085,   2067,   1046,  -1214 },
-  {   3163,   2240,  -2098,  -3435 },
-  {   5228,   1898,    145,  -2397 },
-  {   5860,   3976,   -418,  -2872 },
-  {   6008,   3399,   1027,  -3506 },
-  {   4126,   2035,   1865,   -893 },
-  {   5375,   3596,    511,  -2362 },
-  {   1937,   1493,   -852,   -122 },
-  {   3473,   4849,    547,  -2603 },
-  {   4631,   2977,   1141,  -1768 },
-  {   6149,   3050,    -71,  -1886 },
-  {   4069,   4353,   -289,  -1429 },
-  {   2884,   1225,  -1388,    365 },
-  {   5485,   2518,   -235,   -571 },
-  {   1216,   4375,   1443,    398 },
-  {   4988,   3106,    107,  -1435 },
-  {   4511,   2801,    307,   -444 },
-  {   3235,   4386,    327,   -676 },
-  {   2055,   3708,   1657,   -305 },
-  {   5839,   2374,    290,  -1385 },
-  {   5110,   3305,   1936,  -4206 },
-  {   6416,   2920,    338,  -2736 },
-  {   3350,   2824,  -1269,  -3881 },
-  {   4840,   1815,    464,    186 },
-  {   2399,   3332,    238,   1238 },
-  {   3516,   1363,   1582,    688 },
-  {   3582,   1874,    154,  -4770 },
-  {   3261,   2878,    886,    283 },
-  {   3877,   2658,   -327,    884 },
-  {   4151,   3436,   2173,  -2923 },
-  {   3592,   3674,   1281,  -1295 },
-  {   4561,   3730,  -1114,  -1747 },
-  {   4595,   3625,   -558,   -575 },
-  {   2577,   2348,   2267,    120 },
-  {   5242,   3299,     32,  -3412 },
-  {   4264,   3637,    709,  -2320 },
-  {   6556,   3570,   -838,  -2472 },
-  {   5745,   4014,   -940,  -1973 },
-  {   5629,   4475,    477,  -3328 },
-  {   5269,   3199,   1682,  -3085 },
-  {   4432,   2416,   1145,  -3299 },
-  {   4465,   2505,   2162,  -2186 },
-  {   4643,   4941,    -88,  -2885 },
-  {   4568,   5231,    552,  -3915 },
-  {   5667,   3075,  -1406,  -2963 },
-  {   5418,   5259,   -771,  -2818 },
-  {   -256,  -7875,    511,   -471 },
-  {  -1813,  -7971,   -424,   -396 },
-  {   -306,  -7006,    862,    282 },
-  {  -2306,  -6422,  -1440,    508 },
-  {   -245,  -6787,    375,   -100 },
-  {  -1309,  -6065,    -20,    779 },
-  {  -1656,  -6047,   -641,   1307 },
-  {  -1496,  -6522,    964,    726 },
-  {  -2291,  -6588,   -202,    795 },
-  {   -762,  -7522,   1454,   -558 },
-  {  -2270,  -7004,   -834,   -580 },
-  {  -1139,  -7078,    259,    362 },
-  {  -2535,  -7568,  -1040,     49 },
-  {  -3786,  -7280,    934,   -476 },
-  {  -3336,  -6368,    606,   1056 },
-  {  -3602,  -6924,     52,    714 },
-  {  -2278,  -6550,   1674,    204 },
-  {  -2855,  -5765,    930,   1530 },
-  {  -2889,  -7325,   -215,    305 },
-  {  -2749,  -6080,   -237,   1452 },
-  {   -985,  -6667,   1577,    400 },
-  {  -2036,  -6083,    380,   1267 },
-  {  -2077,  -7460,    380,    -30 },
-  {  -1775,  -7175,   1540,   -386 },
-  {  -3065,  -6927,    989,    168 },
-  {  -2836,  -7602,    117,  -3392 },
-  {  -1058,  -6396,    593,  -3078 },
-  {   -844,  -6062,    999,   -236 },
-  {  -3261,  -6951,   1491,   -720 },
-  {  -2186,  -8484,     75,  -1287 },
-  {  -2882,  -7756,    456,   -510 },
-  {  -1800,  -6879,    960,  -1183 },
-  {  -2554,  -7241,   1614,  -1474 },
-  {  -2608,  -5305,    392,    851 },
-  {  -2973,  -6562,   -859,    858 },
-  {  -2640,  -5989,   1031,   -416 },
-  {   -977,  -8366,    705,  -1434 },
-  {  -1213,  -7409,    -77,  -1390 },
-  {  -1335,  -6657,   2125,   -123 },
-  {  -2544,  -6862,   1852,   -737 },
-  {  -3235,  -6422,   1752,   -103 },
-  {  -1300,  -7557,    939,   -348 },
-  {  -3476,  -7579,    202,   -109 },
-  {  -2482,  -6572,    753,    619 },
-  {  -2554,  -8136,   -648,   -429 },
-  {  -1012,  -7870,     -3,   -421 },
-  {  -3604,  -6247,     32,  -3102 },
-  {  -1486,  -7271,   2013,  -1021 },
-  {   -578,  -6799,   -523,    405 },
-  {  -2841,  -5948,   1644,    911 },
-  {  -2411,  -7473,   1084,   -484 },
-  {  -2238,  -6033,    294,  -1059 },
-  {  -3459,  -6470,   -201,   -790 },
-  {  -2027,  -6009,   1833,    805 },
-  {  -1433,  -8047,   1531,  -1754 },
-  {  -3258,  -7884,    763,  -1422 },
-  {  -1544,  -6928,   -729,    478 },
-  {  -2314,  -8415,     74,  -3757 },
-  {  -3201,  -5684,     95,  -2214 },
-  {  -2423,  -8694,    725,  -3631 },
-  {  -3545,  -7071,   1162,  -1798 },
-  {   -294,  -9662,    403,  -2274 },
-  {  -2290,  -5460,   1196,    402 },
-  {  -1603,  -6713,    903,  -2363 },
-  {   4121,   2491,  -3142,  -2482 },
-  {   4500,   3305,  -3671,  -1567 },
-  {   5973,   3172,  -1348,   -534 },
-  {   4830,   3379,  -1549,    643 },
-  {   5214,   3938,  -2641,  -2302 },
-  {   4639,   4826,  -5532,   -847 },
-  {   5639,   2731,  -2170,   -963 },
-  {   6084,   3487,  -3525,  -1346 },
-  {   5971,   3154,  -2190,  -2316 },
-  {   5618,   4865,  -6927,    116 },
-  {   5345,   3568,  -7391,    709 },
-  {   5429,   5078,  -3811,  -1524 },
-  {   6960,   2037,  -3515,  -1096 },
-  {   7092,   2531,  -4557,   -588 },
-  {   6061,   4247,  -5651,   -478 },
-  {   4595,   3684,  -4907,   -827 },
-  {   7497,   3213,  -3048,   -424 },
-  {   5996,   2137,  -3098,  -1745 },
-  {   6198,   5199,  -2223,  -2274 },
-  {   6888,   2851,  -2768,  -1675 },
-  {   6114,   4210,  -2316,   -954 },
-  {   7127,   4242,  -3041,  -1408 },
-  {   6126,   3668,  -1517,  -1427 },
-  {   6245,   6129,  -4225,  -1186 },
-  {   6816,   3213,  -2101,   -964 },
-  {   5345,   5276,  -2643,   -847 },
-  {   6592,   4665,  -4338,    484 },
-  {   6746,   3751,  -3443,    124 },
-  {   5453,   1980,  -2738,   2606 },
-  {   4662,   2179,  -4226,  -1059 },
-  {   5571,   3208,  -3554,    174 },
-  {   5256,   4447,  -1815,  -1481 },
-  {   5400,   2570,  -1210,    235 },
-  {   7056,   2549,  -2674,    318 },
-  {   4574,   4340,  -2892,   -130 },
-  {   6203,   4587,  -3273,   -305 },
-  {   5103,   1925,  -2715,  -2137 },
-  {   3905,   4296,  -1700,    247 },
-  {   4421,   4605,  -3299,    811 },
-  {   5671,   1273,  -3870,   -924 },
-  {   5486,   1805,  -4901,    133 },
-  {   6437,   2578,  -1828,   -106 },
-  {   5530,   5253,  -5058,   1223 },
-  {   4816,   2025,  -1215,   1443 },
-  {   3457,   3525,  -2456,   3217 },
-  {   3316,   2595,  -1108,   2459 },
-  {   3068,   3810,  -2207,   1926 },
-  {   6351,   5436,  -6470,    600 },
-  {   6324,   4240,  -5365,   2416 },
-  {   4851,   4774,  -4075,   1878 },
-  {   4900,   3679,  -5198,   1078 },
-  {   8347,   3633,  -4565,   -171 },
-  {   5244,   5718,  -3853,    173 },
-  {   3960,   3492,  -2939,   2105 },
-  {   6070,   3473,  -2351,    161 },
-  {   8228,   3034,  -3360,   -901 },
-  {   7006,   3985,  -1940,  -1926 },
-  {   7123,   4681,  -4301,   -878 },
-  {   5122,   4097,  -1851,   -449 },
-  {   6200,   2060,  -2251,   1049 },
-  {   7106,   3844,  -7209,   2625 },
-  {   7108,   3370,  -6734,    533 },
-  {   6859,   2849,  -3992,   1360 },
-  {   5458,   2278,  -3253,   1131 },
-  {  -1072,  -2109,   4783,  -1073 },
-  {   -319,  -2604,   4257,  -2418 },
-  {   2466,   1300,   3476,   -314 },
-  {   2847,  -1502,   5296,   -141 },
-  {   1667,  -1273,   5559,  -2725 },
-  {   2877,  -3402,   6434,    204 },
-  {     53,  -2637,   5275,  -1181 },
-  {   1091,  -2215,   5803,  -1549 },
-  {   2397,   -922,   4327,   1182 },
-  {    219,  -3747,   4647,  -1564 },
-  {    -29,  -2705,   4812,   1277 },
-  {   1499,  -2608,   5648,   1407 },
-  {   2139,  -2399,   4202,   2791 },
-  {   -426,  -2064,   5528,    151 },
-  {   2560,  -2803,   6179,  -2806 },
-  {   4537,  -2479,   3797,   1095 },
-  {    888,  -3357,   5341,   -415 },
-  {   4460,  -1814,   5388,  -1227 },
-  {   3920,  -3268,   6364,   -703 },
-  {   3343,  -4698,   4410,    784 },
-  {    309,  -1897,   6306,   1223 },
-  {    958,  -3318,   4254,  -3167 },
-  {    -99,   1596,   6018,  -1983 },
-  {   -429,   -853,   6407,    878 },
-  {   1170,  -1322,   6290,   -417 },
-  {   2288,   -505,   6303,  -1999 },
-  {   3312,  -1674,   6749,  -2494 },
-  {   -415,  -3401,   4721,   -371 },
-  {   -189,  -1210,   4844,  -2002 },
-  {    888,  -4142,   4377,    130 },
-  {   2469,  -4381,   5398,  -2492 },
-  {   2879,  -2912,   5094,  -2598 },
-  {   -717,   -617,   5650,   -685 },
-  {   1470,  -3863,   5352,  -1684 },
-  {   3935,    -96,   3823,   -730 },
-  {   3769,   -430,   3168,    694 },
-  {   2556,    385,   3539,    512 },
-  {     77,  -1415,   5111,   2655 },
-  {   2724,  -2158,   6715,   -822 },
-  {   1832,   1001,   5385,  -1900 },
-  {    900,   2198,   4464,   -559 },
-  {    441,     69,   5921,  -1743 },
-  {  -1161,    738,   6732,   -308 },
-  {    257,   2035,   4091,    736 },
-  {   1607,   1288,   4355,    -23 },
-  {    -13,   1316,   4180,   1672 },
-  {   1511,   1336,   3057,   1435 },
-  {   2189,  -3813,   4530,    939 },
-  {   3632,   -706,   2646,   1375 },
-  {   4266,  -3761,   4241,   1077 },
-  {   3101,   -427,   5273,  -1202 },
-  {   2293,    276,   4810,   -313 },
-  {   3430,  -1851,   3101,   2045 },
-  {   3453,  -2979,   5142,    942 },
-  {   1683,  -3281,   4802,   2002 },
-  {   3954,  -4715,   5611,    578 },
-  {   1272,   -155,   5085,    454 },
-  {    128,   -194,   5095,   1409 },
-  {    820,    880,   5797,  -2658 },
-  {  -1095,    656,   5774,   1095 },
-  {    813,  -1669,   4320,  -3251 },
-  {   -119,    518,   6372,   -651 },
-  {   2922,  -4299,   6115,   -877 },
-  {   4205,  -4273,   4004,   2642 },
-  {  -1211,  -3892,    224,   3127 },
-  {    -34,  -4371,   1321,   2318 },
-  {     77,  -6326,   1201,    828 },
-  {   3995,  -3775,   1958,   3233 },
-  {    178,  -3301,   1985,   3318 },
-  {   2330,  -3801,   1033,   3195 },
-  {   1413,  -5536,    826,   1709 },
-  {   2468,  -3499,   3653,   3631 },
-  {    741,  -4617,   1723,   2008 },
-  {   1246,  -3043,   2978,   3949 },
-  {   -343,  -4308,   2258,   2189 },
-  {   -682,  -4640,    454,   2272 },
-  {   1236,  -4829,   2491,   1642 },
-  {   -512,  -3766,   1182,   3052 },
-  {    119,  -3939,   3712,    971 },
-  {  -1145,  -4624,   1360,   2281 },
-  {    101,  -4746,   2866,   1255 },
-  {  -1500,  -5455,    539,   1637 },
-  {   -969,  -5909,   1414,   1128 },
-  {  -1261,  -4939,   -231,   2022 },
-  {   -226,  -5345,   1207,    705 },
-  {   2712,  -5109,   3205,   1866 },
-  {   -476,  -5913,    273,   1208 },
-  {  -2039,  -4464,    624,   2545 },
-  {  -2351,  -3930,   2019,   2673 },
-  {  -2675,  -4849,   1522,   1990 },
-  {  -1524,  -3461,   1446,   3204 },
-  {    477,  -5314,   1710,   1577 },
-  {    656,  -3729,   2346,   2511 },
-  {    550,  -5917,   1975,   1040 },
-  {   1728,  -4704,   3067,   1058 },
-  {     -9,  -5247,    506,   1760 },
-  {   -574,  -5135,   1675,   1672 },
-  {   2129,  -3781,   3444,   2313 },
-  {   1144,  -4439,   2214,   2529 },
-  {   1292,  -4160,   3185,   1833 },
-  {   2445,  -3262,   2534,   3227 },
-  {   2266,  -4401,   2023,   2400 },
-  {   -587,  -3602,   3408,   2067 },
-  {   -885,  -4951,   3228,   1174 },
-  {   -728,  -2711,   2807,   3552 },
-  {   1019,  -3043,   3195,   2954 },
-  {   1888,  -4615,   1140,   2454 },
-  {    660,  -5616,    754,    800 },
-  {  -1975,  -5371,   1649,   1585 },
-  {  -1544,  -5436,   2422,   1081 },
-  {   -422,  -5882,   2390,    750 },
-  {   1336,  -5557,   2441,   1230 },
-  {    136,  -4001,    267,   2854 },
-  {   -522,  -3289,   2226,   2728 },
-  {   -971,  -4580,   2471,    708 },
-  {    704,  -5306,   3300,   1001 },
-  {    325,  -3464,   3555,   2398 },
-  {    794,  -3686,    848,   3169 },
-  {    660,  -3017,   4584,   3242 },
-  {  -1486,  -3978,   2170,   1644 },
-  {  -1615,  -4650,   2688,   1844 },
-  {    750,  -4578,    538,   2239 },
-  {   1668,  -5849,   1455,   1031 },
-  {   3486,  -4681,   2030,   2183 },
-  {   2642,  -5429,   1696,   1761 },
-  {   4491,  -4502,   3538,   2767 },
-  {   3545,  -4528,   3514,   2982 },
-  {   3269,  -3676,   2758,   3966 },
-  {   5572,   1146,    209,  -3379 },
-  {   7459,   1053,    593,  -1896 },
-  {   4480,    200,   -310,  -4259 },
-  {   5577,   -939,    242,  -3992 },
-  {   8142,    442,   1257,  -3083 },
-  {   5442,   1261,   1424,  -3236 },
-  {   6260,   -183,   3125,  -2532 },
-  {   7179,    889,   1618,  -2548 },
-  {   6416,    932,   2379,  -2487 },
-  {   7094,   2560,    961,  -3392 },
-  {   7322,    463,   2732,  -3735 },
-  {   6632,   1577,   1912,  -3272 },
-  {   6312,   1349,   3028,  -3460 },
-  {   6105,    386,   1213,   -977 },
-  {   5478,   1158,   1114,   -486 },
-  {   6493,    410,   1686,  -2180 },
-  {   6378,   1881,   1333,  -2240 },
-  {   5711,    812,   1958,  -1300 },
-  {   6844,    877,    730,  -1189 },
-  {   6824,   -245,   2249,  -2000 },
-  {   7515,   1521,   1251,  -3058 },
-  {   6697,   1051,   1300,  -1749 },
-  {   6476,   1425,    811,  -2773 },
-  {   7350,    465,    -76,  -2849 },
-  {   6975,   2095,    567,  -2492 },
-  {   4691,   1736,   2660,  -2289 },
-  {   7837,   1456,    340,  -2767 },
-  {   7930,    507,    838,  -2074 },
-  {   6106,   1502,    766,  -1110 },
-  {   4891,   -659,    835,  -3954 },
-  {   7250,    141,   1369,  -1523 },
-  {   7651,     67,   1651,  -2298 },
-  {   7364,   -305,    601,  -3132 },
-  {   7179,    193,   2491,  -2871 },
-  {   6504,   -272,   2167,  -1322 },
-  {   4456,    983,   2300,   -421 },
-  {   4817,    457,   1695,    371 },
-  {   6914,    555,    850,  -3159 },
-  {   5904,   1030,    202,  -1959 },
-  {   6258,    880,   2233,  -4503 },
-  {   6029,     10,   2130,  -3600 },
-  {   6449,    985,   1129,  -3963 },
-  {   6616,    -18,   -111,  -3285 },
-  {   4496,    775,    817,  -4276 },
-  {   6134,   2338,   1470,  -2973 },
-  {   6911,    152,    430,  -1946 },
-  {   4053,    991,   3218,  -1193 },
-  {   5435,   1285,   3124,  -2412 },
-  {   5507,   1836,   1935,  -1988 },
-  {   5240,    689,   2189,  -2670 },
-  {   6638,   1719,    606,  -1799 },
-  {   5556,   -180,    129,  -2595 },
-  {   5644,   1918,   1281,  -4316 },
-  {   6410,   1088,   -282,  -3117 },
-  {   6503,   1841,    312,  -3514 },
-  {   6947,     20,   1358,  -3886 },
-  {   5464,   2109,   2398,  -3194 },
-  {   5616,   -407,   2140,   -498 },
-  {   6121,   2707,   2379,  -4096 },
-  {   7303,   1846,   2266,  -4095 },
-  {   5444,    470,   2718,  -1553 },
-  {   5817,   -645,   3285,  -1349 },
-  {   5625,   1427,   1103,  -1991 },
-  {   6041,   -806,   1196,  -2943 },
-  {   3050,  -5722,   4070,  -5460 },
-  {   3420,  -4386,   4078,  -5155 },
-  {   6020,  -3982,   7268,  -2689 },
-  {   7502,  -4317,   7894,  -3973 },
-  {   4156,  -3558,   5247,  -4316 },
-  {   4725,  -4401,   7290,  -1540 },
-  {   6688,  -5122,   8216,  -3210 },
-  {   9176,  -6576,   9276,  -4963 },
-  {   8706,  -5708,   7987,  -4621 },
-  {   7060,  -3535,   6532,  -3308 },
-  {   5600,  -2719,   5363,  -1568 },
-  {   4661,  -2803,   6263,  -4716 },
-  {   3673,  -3636,   6147,  -3433 },
-  {   5305,  -2585,   6073,  -2638 },
-  {   7614,  -1962,   6079,  -5266 },
-  {   6760,  -3366,   7382,  -4322 },
-  {   6385,  -3883,   4797,  -1353 },
-  {   8182,  -5120,   4298,  -4641 },
-  {   9130,  -6198,   4975,  -3063 },
-  {   7421,  -5436,   5576,  -3713 },
-  {   3483,  -4898,   5443,  -2745 },
-  {   4907,  -5643,   6390,  -4105 },
-  {   8119,  -7008,   7992,  -6764 },
-  {   6528,  -6122,   6967,  -5590 },
-  {   5890,  -4190,   6624,  -5688 },
-  {   6815,  -7934,   7275,  -5456 },
-  {   5434,  -4306,   5169,  -5378 },
-  {   4364,  -6436,   5376,  -2604 },
-  {   8152,  -3404,   5913,  -5048 },
-  {   7983,  -4863,   4262,  -2461 },
-  {   8023,  -6188,   6238,  -5062 },
-  {   6753,  -3692,   3935,  -3723 },
-  {   6826,  -4760,   3284,  -4051 },
-  {   7224,  -7423,   4492,  -3875 },
-  {   6904,  -2590,   6587,  -6248 },
-  {   6106,  -1944,   7345,  -5506 },
-  {   4956,  -2990,   7808,  -3146 },
-  {   6908,  -6885,   5949,  -1288 },
-  {   7162,  -6058,   3419,  -3401 },
-  {   7015,  -7080,   6907,  -3018 },
-  {   6971,  -6832,   5646,  -3273 },
-  {   8014,  -5546,   5471,  -1544 },
-  {   6792,  -2220,   5105,  -2879 },
-  {   8494,  -3974,   4408,  -3999 },
-  {   9591,  -4866,   6027,  -4558 },
-  {   5264,  -5161,   6101,   -738 },
-  {   5803,  -6141,   5197,  -5231 },
-  {   4657,  -6822,   3232,  -5189 },
-  {   4791,  -5135,   3809,  -4665 },
-  {   6108,  -5103,   2379,  -3873 },
-  {   4680,  -3909,   3234,  -5093 },
-  {   5802,  -3853,   3795,  -4984 },
-  {   4360,  -7483,   4802,  -3877 },
-  {   5429,  -7517,   5911,  -3717 },
-  {   6866,  -2280,   4880,  -4634 },
-  {  10131,  -4628,   4414,  -4092 },
-  {  10811,  -5189,   7746,  -5337 },
-  {   5663,  -8941,   5287,  -5680 },
-  {   8023,  -5991,   7403,  -2796 },
-  {   9669,  -6919,   6525,  -4932 },
-  {   7275,  -3796,   4962,  -2547 },
-  {   8848,  -4806,   5677,  -3080 },
-  {   8128,  -4308,   7749,  -6569 },
-  {   4032,  -5196,   2282,  -6239 },
-  {   6593,    700,   -229,    304 },
-  {   8260,    539,    -66,  -1259 },
-  {   6605,    176,   -814,   -109 },
-  {   8057,      0,     -1,   -136 },
-  {   7382,    -38,   -484,  -1129 },
-  {   8373,   -929,    682,   -454 },
-  {   7674,    690,  -1278,    546 },
-  {   7326,   -517,    406,  -1283 },
-  {   7612,  -1715,  -1167,   1175 },
-  {   8590,    441,   -782,   -710 },
-  {   8572,  -1202,   -291,    260 },
-  {   7308,   -147,  -1785,    414 },
-  {   6787,   -353,   -672,    934 },
-  {   5177,   -133,    179,     82 },
-  {   4161,    -34,    447,   1497 },
-  {   5997,   -902,   1533,   -121 },
-  {   5727,   -871,  -1370,    945 },
-  {   8386,   -252,    293,   -823 },
-  {   6573,  -1354,    682,    616 },
-  {   7650,  -2096,    725,    457 },
-  {   8122,     78,    636,  -1400 },
-  {   8421,    428,  -1620,    131 },
-  {   7341,  -1292,   -717,    186 },
-  {   7998,    -49,   -720,    266 },
-  {   5987,   -351,    669,    844 },
-  {   7314,  -1620,    250,   -603 },
-  {   7219,  -1562,   -572,   1994 },
-  {   8682,   -358,   -290,   -388 },
-  {   5810,    155,   -178,   1199 },
-  {   7246,    -12,   1042,   -786 },
-  {   7357,   -923,   1468,   -475 },
-  {   7801,    621,   -212,   -724 },
-  {   5346,   -514,   1210,   1356 },
-  {   8459,     36,   -127,   -779 },
-  {   6878,  -2429,    854,   1750 },
-  {   7280,  -1401,  -1353,   2845 },
-  {   7579,  -2148,  -1463,   2087 },
-  {   6637,    946,   -872,    750 },
-  {   4807,  -1100,   1289,   2602 },
-  {   4495,    219,   1551,   1128 },
-  {   7639,    506,    446,  -1107 },
-  {   6359,    188,   1009,   -115 },
-  {   6641,  -1820,   1655,    723 },
-  {   5394,  -2382,   1604,   2542 },
-  {   6021,  -2644,   2396,   1407 },
-  {   4698,    882,    245,   1525 },
-  {   8103,    573,   -798,   -349 },
-  {   8045,   -519,    997,  -1092 },
-  {   7571,   -122,    227,   -338 },
-  {   5347,  -1200,    630,   1718 },
-  {   7070,    790,    218,   -544 },
-  {   7440,    728,   -527,    -20 },
-  {   6402,   -355,    197,   -736 },
-  {   4031,    771,    866,   1895 },
-  {   6009,    896,    445,    -31 },
-  {   5160,   1098,   -856,   1784 },
-  {   7980,   -886,  -1293,   1396 },
-  {   6318,  -1361,   2423,    252 },
-  {   7547,   -699,    133,    506 },
-  {   8562,  -2344,    940,    264 },
-  {   5890,   1187,  -1425,   2194 },
-  {   6558,   -645,  -1311,   2621 },
-  {   4634,  -1671,   2075,   1623 },
-  {   5614,    105,   -816,   2376 },
-  {   6646,   1558,  -1365,    630 },
-  {   6998,   1150,  -2117,   -990 },
-  {   6555,   2311,  -1093,  -1783 },
-  {   6682,   1430,  -2391,  -1940 },
-  {   7861,   1555,  -2977,  -1188 },
-  {   6745,   1723,   -459,  -2085 },
-  {   7504,   1229,  -1666,  -2060 },
-  {   7937,    671,  -2128,  -1529 },
-  {   7139,    991,   -735,  -2632 },
-  {   6867,   1592,  -1303,  -2324 },
-  {   6401,   2230,  -1732,  -2508 },
-  {   7201,   2184,  -2169,  -1988 },
-  {   6636,   2190,   -995,  -2840 },
-  {   7620,   2306,  -2089,   -651 },
-  {   7584,   1875,  -1438,   -631 },
-  {   9214,   1561,  -2464,  -1139 },
-  {   6154,   1318,  -1237,  -2917 },
-  {   7917,   2847,  -1797,  -1599 },
-  {   8309,   2029,  -2555,   -465 },
-  {   8204,   1282,   -584,  -2405 },
-  {   8440,   1035,  -1147,  -1137 },
-  {   7107,   1858,    -60,  -1568 },
-  {   6781,   2912,   -873,  -1463 },
-  {   7603,   1316,   -319,  -1249 },
-  {   7833,   1335,    -78,  -1849 },
-  {   7930,   1141,  -1016,   -695 },
-  {   7883,   1610,  -1017,  -1314 },
-  {   8069,   1409,  -1811,   -196 },
-  {   8319,   1031,   -582,  -1590 },
-  {   5948,   1537,  -2153,  -2373 },
-  {   8684,   1171,  -1871,   -850 },
-  {   8357,   2484,  -2411,  -1292 },
-  {   6516,   2092,   -193,  -1167 },
-  {   6112,   1697,     22,   -525 },
-  {   7161,    703,   -602,  -1879 },
-  {   6047,   2351,   -807,   -219 },
-  {   8072,   1854,  -1817,  -1553 },
-  {   6956,   1304,     76,  -1011 },
-  {   6607,   1481,   -544,   -162 },
-  {   6958,   2541,   -265,  -1938 },
-  {   6416,   2514,   -777,   -850 },
-  {   7272,   2110,   -899,  -1171 },
-  {   7741,   2153,   -283,  -2614 },
-  {   6482,   2041,  -1758,  -1221 },
-  {   6762,    940,  -1862,  -2281 },
-  {   5610,   1194,  -1691,  -1561 },
-  {   7833,   2164,   -823,  -1952 },
-  {   5460,   1438,   -848,   1189 },
-  {   6011,   1377,   -771,  -1557 },
-  {   7679,    544,  -1134,  -2214 },
-  {   7209,   1292,  -2714,  -1564 },
-  {   5567,   1200,   -404,   -169 },
-  {   5853,   1461,  -1465,   -518 },
-  {   6782,    689,   -844,   -860 },
-  {   7330,   1337,  -1152,    -71 },
-  {   7189,   1506,   -653,   -685 },
-  {   6860,   2116,  -1403,   -240 },
-  {   8804,   1516,  -1391,  -1760 },
-  {   7210,   2689,  -1498,   -989 },
-  {   7030,   3022,  -1441,  -2083 },
-  {   5649,   1836,   -407,    525 },
-  {   7451,   3099,   -717,  -2464 },
-  {   7384,   1656,  -2007,    398 },
-  {   6504,    707,  -1919,   -134 },
-  {  -1851,   3639,  -2279,   -695 },
-  {  -4037,   1644,    -77,   1329 },
-  {  -4025,   1960,  -1565,   -567 },
-  {  -3430,   2495,   -795,    368 },
-  {  -4771,   2480,    993,    756 },
-  {  -3431,   2058,  -2539,   -971 },
-  {  -3802,   3418,    380,    217 },
-  {  -3074,   3350,  -1652,  -1056 },
-  {  -3705,    326,  -1650,   1535 },
-  {  -3122,   1281,  -1192,   1607 },
-  {  -4601,   1367,   -968,     53 },
-  {  -3808,    958,     44,   2560 },
-  {  -2079,   2530,  -1485,   1166 },
-  {  -3707,    343,  -2889,    180 },
-  {  -5249,   1431,    -31,    688 },
-  {  -4990,    125,   -704,   1270 },
-  {  -2771,   1334,  -2446,    746 },
-  {  -2292,    994,  -1527,   2630 },
-  {  -1261,   3070,  -2519,    268 },
-  {  -2544,   3890,  -1057,   -552 },
-  {  -4421,    255,  -1980,    530 },
-  {  -2951,    454,    -13,   3643 },
-  {  -2262,   1815,   -370,   2880 },
-  {  -2383,   3657,   -649,    576 },
-  {  -3541,   -161,  -1389,   2550 },
-  {  -4241,   1575,   1325,   2561 },
-  {  -2767,   4037,   1221,   1578 },
-  {  -3748,   2697,   1148,   1801 },
-  {  -4686,   2385,   -220,      0 },
-  {  -1531,   1645,  -2751,   1327 },
-  {    -45,   4032,   -799,   2298 },
-  {  -2915,   2280,    709,   2495 },
-  {  -1199,   3278,   -406,   2346 },
-  {  -2471,    116,  -2706,   2060 },
-  {  -2440,   2173,  -2894,   -344 },
-  {  -3375,   2287,   1781,   3226 },
-  {  -2153,   3568,   1827,   2918 },
-  {   -862,   2267,  -1626,   2527 },
-  {  -2698,   1135,    301,   4239 },
-  {  -2364,   2123,   1010,   3710 },
-  {  -2447,   3281,    -81,   1408 },
-  {  -2660,   4735,    472,    258 },
-  {  -1053,   3097,   2682,   2398 },
-  {  -3366,  -1037,  -1152,   -868 },
-  {   -643,   4242,   2212,   1259 },
-  {    971,   3991,    934,    643 },
-  {  -1617,   2002,   2139,   2195 },
-  {  -4897,    972,    784,   1719 },
-  {  -1275,   2992,   1039,   3821 },
-  {   -392,   4973,   -209,   1821 },
-  {  -1028,   4718,  -1479,   -137 },
-  {     50,   3914,    553,   2210 },
-  {    678,   4364,    359,   1303 },
-  {   -582,   4911,    514,   1671 },
-  {   1276,   3914,  -1252,   2934 },
-  {  -1496,   3984,    857,   2330 },
-  {    772,   4744,   -655,   2332 },
-  {   -799,   5283,   -439,    624 },
-  {   1341,   2937,    650,   2027 },
-  {  -1739,   4892,   1275,   1702 },
-  {   -892,   2596,   -151,   3951 },
-  {  -3532,   1090,   1292,     32 },
-  {    321,   3146,   2647,   1475 },
-  {    264,   4199,  -1591,   1317 },
-  {   -452,  -2357,   2266,   4192 },
-  {   3022,  -1033,  -2389,   5678 },
-  {  -1162,  -1342,   3543,   4990 },
-  {   -474,  -1477,  -1223,   5016 },
-  {   -699,  -2857,    900,   3835 },
-  {   -461,  -2255,   -117,   4626 },
-  {   1204,  -2062,  -1211,   4403 },
-  {   2192,  -3035,   -337,   3966 },
-  {    108,   -831,    279,   5643 },
-  {   1457,   -620,  -2908,   5276 },
-  {  -2527,    -78,   1085,   5460 },
-  {  -1978,  -1918,   -949,   4733 },
-  {     32,    367,  -1904,   5166 },
-  {   1890,  -1665,    440,   4752 },
-  {   -518,   -348,   2816,   4891 },
-  {   3695,  -2490,  -1374,   4603 },
-  {    246,  -1965,   3549,   3969 },
-  {   1100,  -3111,    656,   3737 },
-  {  -1379,    870,   -414,   4575 },
-  {    628,   -357,  -1227,   6179 },
-  {  -1129,  -1318,  -2457,   4576 },
-  {   -425,    -98,    -73,   6336 },
-  {    367,   -887,   2990,   4207 },
-  {   2091,  -1251,   2444,   3557 },
-  {  -1759,  -1610,   2046,   5273 },
-  {   3210,   1414,    -20,   2616 },
-  {   3303,  -2636,   1005,   4237 },
-  {   -327,  -3107,   -640,   3687 },
-  {   -197,    764,    572,   5486 },
-  {    646,   -767,   1388,   5464 },
-  {    104,   2742,   -228,   3907 },
-  {   -236,   1829,   -579,   4585 },
-  {  -2150,   -474,  -1525,   4006 },
-  {    -23,  -2632,  -2400,   3892 },
-  {    -12,  -1739,  -2910,   4867 },
-  {  -2310,   -368,   -102,   4583 },
-  {  -1991,  -2061,    533,   4531 },
-  {   3884,  -1446,   -153,   4393 },
-  {   1568,     14,   -289,   5268 },
-  {  -1376,   -253,  -2797,   3417 },
-  {   3193,  -2577,   2475,   3566 },
-  {   3418,    617,   1350,   1857 },
-  {   3792,    -24,   -272,   3370 },
-  {    153,   1159,   2906,   2877 },
-  {    511,   2162,   1548,   2741 },
-  {    262,    819,  -2791,   3734 },
-  {   4232,  -2015,   1486,   3477 },
-  {   2943,  -1110,  -1014,   5480 },
-  {   2842,    369,    703,   3476 },
-  {   3011,   1634,   -933,   3553 },
-  {   4412,  -1548,   -942,   5021 },
-  {  -1405,    593,   2372,   5267 },
-  {   2093,   2129,    896,   2365 },
-  {   4845,  -1980,      0,   3823 },
-  {  -2140,     81,   3278,   5637 },
-  {   1484,   2665,   -324,   3653 },
-  {     10,    192,   1620,   5291 },
-  {   2152,    738,  -2269,   5000 },
-  {   2102,   2748,  -1652,   4707 },
-  {   2855,  -2131,   -387,   5188 },
-  {   1173,    676,   1338,   3277 },
-  {   2340,  -2329,  -2064,   4095 },
-  {    861,  -2024,   1296,   5055 },
-  {   2189,   3225,   -695,   2626 },
-  {   6196,  -7079,   1943,   -822 },
-  {   4547,  -4813,   3261,   1856 },
-  {   4243,  -6904,   3443,    448 },
-  {   4581,  -7503,    946,    506 },
-  {   6626,  -7754,   3427,    470 },
-  {   3407,  -9088,   3269,  -1496 },
-  {   4079,  -6464,   2304,    777 },
-  {   5621,  -9336,   2684,   -768 },
-  {   5351,  -6464,   5238,   -214 },
-  {   5961,  -8007,   1724,  -3091 },
-  {   4213,  -8067,    603,   -246 },
-  {   7208,  -7403,   3168,  -1738 },
-  {   6098,  -7700,    329,  -1379 },
-  {   6525,  -6735,   4248,  -1072 },
-  {   6073,  -6241,   2167,  -2378 },
-  {   4609,  -9218,   3051,  -1033 },
-  {   6813,  -7283,   1581,  -1897 },
-  {   6126,  -6275,   2789,    681 },
-  {   4423,  -6538,   1621,  -1692 },
-  {   6272,  -8298,   3167,  -1855 },
-  {   6172,  -8558,   4498,  -1169 },
-  {   4844,  -8588,   1647,   -366 },
-  {   6209,  -8807,   1581,   -369 },
-  {   5389,  -8059,    550,   -192 },
-  {   6654,  -9775,   2504,  -1063 },
-  {   7103,  -7998,    806,    530 },
-  {   5662,  -6736,   1565,  -3620 },
-  {   4165,  -9564,   4191,  -2131 },
-  {   4526,  -7181,    576,  -2875 },
-  {   4633,  -8623,   2807,  -4742 },
-  {   3709,  -7794,   1815,     34 },
-  {   3634,  -8622,   2313,   -826 },
-  {   6991,  -8447,   2063,  -3198 },
-  {   7757,  -9486,   2255,   -558 },
-  {   4149,  -7778,   4728,  -1696 },
-  {   5767,  -7427,   1113,    707 },
-  {   4592,  -6261,   2329,   1864 },
-  {   3159, -10498,   1677,  -4273 },
-  {   3534,  -9010,   2437,  -3565 },
-  {   4479, -10821,   2715,  -4942 },
-  {   3207,  -9805,   3054,  -3886 },
-  {   4627,  -8189,   3018,  -2354 },
-  {   5527, -10566,   3244,  -2749 },
-  {   4346, -10127,   3335,  -3084 },
-  {   6132, -10085,   3316,  -1308 },
-  {   5629,  -9704,   2178,  -3058 },
-  {   3603,  -8538,   1246,   -624 },
-  {   3737,  -8488,    395,  -3167 },
-  {   5465, -11414,   2810,  -4640 },
-  {   5306,  -7745,   2721,  -3988 },
-  {   7000,  -9111,   1695,  -1409 },
-  {   6663,  -7741,   2466,  -4079 },
-  {   4083,  -7175,   1836,  -4831 },
-  {   3613,  -9926,   1342,  -3455 },
-  {   6588,  -8033,    457,   -258 },
-  {   4720,  -8102,     17,  -1209 },
-  {   7414,  -8709,   1294,   -344 },
-  {   5437, -10030,   4043,  -1704 },
-  {   4862,  -9281,   1558,  -1431 },
-  {   6800,  -6403,   5113,    862 },
-  {   4623,  -8242,   2667,   -228 },
-  {   5919,  -5083,   3348,   2135 },
-  {   5985,  -8889,   2733,  -5105 },
-  {   5029,  -5767,   4407,    719 },
-  {    354,  -6158,   -838,  -3001 },
-  {    351,  -5943,  -2104,  -1534 },
-  {   -633,  -7190,    -25,  -4798 },
-  {  -1595,  -7235,  -3812,  -1400 },
-  {    103,  -6197,  -2933,    -78 },
-  {  -1722,  -5020,  -3441,  -4333 },
-  {  -1963,  -5644,  -4365,   -270 },
-  {   -846,  -5743,  -3477,    196 },
-  {   -191,  -5348,  -4054,   -469 },
-  {  -2515,  -7754,  -3495,   -818 },
-  {  -2090,  -6710,  -2701,    117 },
-  {   -546,  -7036,  -1398,    163 },
-  {   -278,  -7091,  -2662,   -536 },
-  {   -622,  -7962,  -2731,  -1464 },
-  {  -1555,  -8118,  -3612,  -2057 },
-  {  -1094,  -6280,  -2314,    505 },
-  {  -2556,  -8538,  -4024,  -2247 },
-  {    109,  -7134,  -3107,  -1823 },
-  {   -900,  -6954,  -3340,   -717 },
-  {   -605,  -7113,  -3656,  -2154 },
-  {    837,  -6263,  -3211,  -2177 },
-  {   -417,  -5810,  -3871,  -1469 },
-  {  -1318,  -5649,  -4207,  -3198 },
-  {    413,  -6765,  -2082,    -33 },
-  {  -3101,  -6450,  -4362,   -766 },
-  {    755,  -6489,  -2967,   -846 },
-  {   1117,  -7106,  -2452,  -1352 },
-  {  -1202,  -8387,  -3072,  -2897 },
-  {   -365,  -4894,  -3561,  -2937 },
-  {  -2372,  -8776,   -265,  -4441 },
-  {  -1224,  -8678,   -896,  -5074 },
-  {   -755, -10096,   -600,  -6623 },
-  {    300,  -8206,   -225,  -4568 },
-  {  -1176,  -6824,  -2633,  -3527 },
-  {  -2006,  -5443,  -1526,  -5849 },
-  {  -1115,  -5540,  -2363,  -4785 },
-  {   1059,  -6812,  -2543,  -2654 },
-  {  -1976,  -6861,  -3062,  -5508 },
-  {   -379,  -5328,  -2321,  -3624 },
-  {  -2108,  -5860,  -4518,  -1915 },
-  {   -379,  -7885,  -1329,   -594 },
-  {    774,  -5389,   -581,  -5213 },
-  {  -2601,  -5083,  -1849,  -4921 },
-  {   -176,  -5580,     74,  -5075 },
-  {   -204,  -6780,   -190,  -6232 },
-  {    418,  -7594,  -1987,   -820 },
-  {  -1873,  -8529,  -2926,  -1609 },
-  {   1340,  -6362,   -919,  -4975 },
-  {    577,  -7990,  -2044,  -1873 },
-  {  -2572,  -7413,  -1745,  -2224 },
-  {  -2037,  -7030,  -1461,  -7138 },
-  {  -2559,  -8756,  -2039,  -5836 },
-  {  -2079,  -6764,  -1209,  -5669 },
-  {  -1613,  -7801,  -2006,   -685 },
-  {  -1865,  -6583,   -722,  -3529 },
-  {   -589,  -6358,  -1377,  -1003 },
-  {   -540,  -7514,  -1331,  -3542 },
-  {    419,  -6192,  -1677,  -4927 },
-  {  -2786,  -8763,  -2966,  -5065 },
-  {  -2172,  -8411,  -1726,  -4675 },
-  {  -3382,  -9833,  -3497,  -5722 },
-  {  -2433, -10169,  -2077,  -5775 },
-  {   -424,  -9451,  -1096,  -3658 },
-  {   -537,  -8522,   -910,  -1897 },
-  {  -5550,   2807,   1683,   -693 },
-  {  -6395,    635,   3573,  -1246 },
-  {  -7544,   2280,   2140,     44 },
-  {  -8751,   1136,   2951,   -794 },
-  {  -5605,   2709,   2052,    916 },
-  {  -7650,    654,    869,    135 },
-  {  -6939,    967,   1409,    870 },
-  {  -7834,   2123,   3310,    974 },
-  {  -6935,   2818,   1274,  -1678 },
-  {  -5605,   2233,   1013,    471 },
-  {  -7095,   1849,   1648,    198 },
-  {  -6636,   1634,    712,    -37 },
-  {  -7279,    978,    296,   -315 },
-  {  -7664,   3504,   3292,   -216 },
-  {  -7836,   1209,   1221,   -257 },
-  {  -7913,   2201,   1765,  -1529 },
-  {  -7077,   3783,   2632,  -1407 },
-  {  -5565,   1645,   1410,   -622 },
-  {  -6494,   2879,   1181,   -759 },
-  {  -7073,   3137,   3010,    550 },
-  {  -7249,   1839,    847,   -805 },
-  {  -6630,   2197,    282,  -1096 },
-  {  -8836,   1573,   1988,  -1090 },
-  {  -7809,   1274,    836,  -1198 },
-  {  -7895,   2970,   3511,  -1097 },
-  {  -6960,   1664,   1356,  -2442 },
-  {  -6582,   2866,   2273,    307 },
-  {  -7221,    821,   2851,  -1435 },
-  {  -6015,   1703,   2001,  -2367 },
-  {  -8082,   1034,   2103,    239 },
-  {  -5952,   1912,    301,   -465 },
-  {  -6099,    841,    379,    567 },
-  {  -6343,     50,    494,    658 },
-  {  -6586,    983,    591,   -893 },
-  {  -5500,    869,   2187,  -2479 },
-  {  -6482,     60,   1545,   -979 },
-  {  -6705,    515,   1974,    -53 },
-  {  -6460,   1755,   1325,  -1275 },
-  {  -6093,   2617,   2465,   -623 },
-  {  -7330,   2161,    594,  -2115 },
-  {  -7324,    762,   1593,  -2004 },
-  {  -6385,    679,   1510,  -2514 },
-  {  -6159,    241,   2976,  -1631 },
-  {  -8583,   3030,   4045,   -162 },
-  {  -6299,     66,   2209,  -2103 },
-  {  -5428,   1279,   3267,  -1846 },
-  {  -6438,   1335,   2728,  -1631 },
-  {  -8012,   1070,   2428,  -1151 },
-  {  -6201,   2781,   2349,  -1918 },
-  {  -5918,   1139,   3121,   -148 },
-  {  -6314,   2481,   3137,  -1808 },
-  {  -7180,   1722,   2435,  -1602 },
-  {  -6750,   1829,   3763,  -1145 },
-  {  -6713,   1777,   2221,   1212 },
-  {  -7479,   1835,   3627,   -479 },
-  {  -7299,     10,   2406,  -1593 },
-  {  -8249,   3129,    996,  -2870 },
-  {  -8374,   1534,   1333,  -1882 },
-  {  -7507,   3353,   1598,  -2299 },
-  {  -7379,   2701,   2326,  -1167 },
-  {  -8440,   2276,   2796,   -542 },
-  { -10348,   1527,   2649,  -1165 },
-  {  -8184,   3614,   2574,  -1738 },
-  {  -5539,   1574,   1733,   1138 },
-  {   9404,  -7652,     67,     79 },
-  {   8654,  -3972,   1358,    -60 },
-  {   8617,  -4794,    117,   2318 },
-  {   7886,  -4505,   1784,   1200 },
-  {   8636,  -6125,   3879,  -1003 },
-  {   9654,  -6836,   1816,    205 },
-  {   9374,  -6553,    913,   1875 },
-  {   8020,  -6150,   1134,   2390 },
-  {   7786,  -4970,   2078,  -1857 },
-  {   8691,  -6119,    711,    708 },
-  {   9039,  -5568,   2944,  -1902 },
-  {   9955,  -5048,   1433,   -601 },
-  {   8089,  -6927,   3093,  -2846 },
-  {   8487,  -7024,   2415,     19 },
-  {   9388,  -5287,   3577,  -2655 },
-  {   8591,  -7371,   2300,   -996 },
-  {   9104,  -4763,   1453,  -2558 },
-  {   7615,  -5457,    596,    164 },
-  {   9860,  -7047,   3433,   -614 },
-  {   8756,  -4404,   2235,   -964 },
-  {   9462,  -4660,    299,  -1822 },
-  {  10119,  -5550,   2689,  -1273 },
-  {  10915,  -7471,   2705,  -1007 },
-  {  11433,  -7090,   1410,  -1198 },
-  {   9882,  -7431,   2965,  -1895 },
-  {   7628,  -5219,    769,  -2661 },
-  {   8169,  -5318,   2262,     70 },
-  {   8846,  -6320,   1939,   -754 },
-  {   7147,  -5593,   1248,   -971 },
-  {  10652,  -5485,    935,    137 },
-  {   7778,  -6533,   2564,  -1932 },
-  {   8878,  -5173,   1214,   -361 },
-  {   9828,  -4943,    282,    510 },
-  {  10042,  -6134,   3895,  -1914 },
-  {   7965,  -6630,   3566,   -433 },
-  {   8573,  -4502,   3574,  -1209 },
-  {   8398,  -4801,   1031,  -1347 },
-  {  10136,  -7772,   2612,   1547 },
-  {   9890,  -7280,   1768,  -1083 },
-  {   8407,  -6585,   -706,    -58 },
-  {   7976,  -7582,    229,   -131 },
-  {  10481,  -8866,   1166,   -147 },
-  {  10914,  -4342,   3189,  -2412 },
-  {  10440,  -5198,   -104,  -1109 },
-  {  11227,  -6530,   2381,  -2449 },
-  {   8487,  -8064,   1086,    230 },
-  {   9975,  -6123,   -857,   -134 },
-  {   8339,  -6498,   1232,  -2337 },
-  {  11042,  -4506,   1119,  -2098 },
-  {  12563,  -5592,   1837,  -2062 },
-  {  11801,  -5590,    632,  -1296 },
-  {  10152,  -5617,   1511,  -1917 },
-  {   7800,  -6473,     51,  -1337 },
-  {   7941,  -5560,   2438,  -3270 },
-  {   6554,  -3834,   2100,   1476 },
-  {   9065,  -5520,   -226,  -1120 },
-  {  10794,  -7120,   -243,    122 },
-  {  10429,  -6968,    272,   -806 },
-  {   8942,  -8914,   1442,   -392 },
-  {   9969,  -5051,   2033,  -2953 },
-  {   7275,  -4152,   3058,    -64 },
-  {  11127,  -5488,   4589,  -3227 },
-  {   9626,  -6666,   2739,  -2958 },
-  {   6943,  -5362,   4470,   1008 },
-  {  -7456,   -967,   2936,  -1002 },
-  {  -8622,   -333,   6962,   2606 },
-  {  -7486,  -3392,   3668,   1287 },
-  {  -8053,   -827,   5148,   1097 },
-  {  -6610,    454,   4952,     96 },
-  {  -7701,  -1982,   3161,   -468 },
-  {  -7307,  -1132,   4071,    -36 },
-  {  -8125,   -271,   5199,   3862 },
-  {  -9182,  -1950,   2813,   1878 },
-  {  -9855,   -952,   4794,   3010 },
-  {  -7241,   1431,   4202,   2468 },
-  {  -9646,    157,   4766,   1046 },
-  {  -9371,   1230,   6009,   2958 },
-  { -11514,    -64,   8630,   5248 },
-  {  -6766,    565,   2766,   2140 },
-  {  -8426,     -9,   2852,   1271 },
-  { -11291,  -1113,   5087,   2937 },
-  {  -8297,   2092,   4495,   1264 },
-  {  -9983,    735,   3809,    -51 },
-  {  -9048,  -1000,   3191,   -308 },
-  {  -7331,  -1987,   2655,   1391 },
-  {  -7144,    -21,   4333,   2161 },
-  {  -6032,  -1540,   3543,    896 },
-  {  -7987,  -1036,   1985,   1529 },
-  {  -9264,   2004,   5194,    290 },
-  { -11308,   -840,   5754,   1654 },
-  {  -9130,  -2398,   4292,   2973 },
-  {  -6248,    838,   3563,   1223 },
-  {  -6819,  -2760,   3511,    119 },
-  {  -7213,  -2006,   4364,    762 },
-  {  -5431,  -1047,   4533,    166 },
-  {  -7098,   -641,   2021,    639 },
-  {  -8628,  -2249,   3588,    399 },
-  {  -6352,  -1498,   3560,   -648 },
-  {  -7033,  -2190,   4870,   2562 },
-  {  -7405,    -46,   3772,   -581 },
-  {  -6104,    796,   5143,   1965 },
-  {  -5787,    943,   5784,   3030 },
-  {  -8367,   1465,   7192,   4097 },
-  {  -8259,    789,   5694,   1963 },
-  { -10614,  -1899,   5748,   2645 },
-  {  -8258,   -805,   3698,   2275 },
-  {  -6877,   -972,   6431,   3160 },
-  {  -6483,    363,   7018,   3129 },
-  {  -6283,  -1358,   5191,   1524 },
-  {  -8853,  -3157,   4119,   1741 },
-  {  -6086,   -267,   3883,   -835 },
-  {  -7254,   1032,   6613,   4017 },
-  { -11470,  -3350,   4649,   3426 },
-  {  -6743,    481,   6148,   1239 },
-  {  -5394,   -166,   5309,   3165 },
-  {  -7958,   1068,   4268,   -240 },
-  { -10520,   2256,   7916,   2828 },
-  {  -5132,     -4,   5739,   1176 },
-  {  -8643,    120,   3255,   -629 },
-  {  -9631,   1974,   8870,   4362 },
-  { -10663,  -1221,   3733,    589 },
-  {  -8224,  -1843,   5806,   2655 },
-  {  -8282,   1255,   8647,   3478 },
-  { -12311,  -1505,   9043,   6256 },
-  { -11312,   -856,   7136,   4681 },
-  { -11944,   -722,   7941,   3309 },
-  {  -7868,   -463,   6846,   4196 },
-  {  -8679,   -241,   7410,   5347 },
-  {   6759,  -4680,   -508,   1220 },
-  {   5176,  -6111,    944,    121 },
-  {   6843,  -5667,  -1368,   -533 },
-  {   5616,  -5884,  -1471,   -695 },
-  {   6030,  -5089,  -1808,   -940 },
-  {   7444,  -5463,    -52,   1881 },
-  {   4207,  -6079,   -506,   1571 },
-  {   6785,  -4410,   -649,   3084 },
-  {   4838,  -5214,   2026,   2998 },
-  {   4201,  -5790,    645,   1811 },
-  {   6930,  -5129,  -1940,   1698 },
-  {   6332,  -4627,    692,   3027 },
-  {   6285,  -4314,   -106,   3644 },
-  {   6255,  -5450,  -1975,    742 },
-  {   4199,  -4676,   -459,   1796 },
-  {   5592,  -5500,   1345,   1300 },
-  {   4358,  -5556,  -2236,    114 },
-  {   4620,  -5875,  -1563,    888 },
-  {   4892,  -7550,   -327,   -419 },
-  {   4734,  -7085,      7,    613 },
-  {   3883,  -5562,  -1969,   1080 },
-  {   5610,  -4990,   -204,    834 },
-  {   4117,  -6482,  -1271,    341 },
-  {   6585,  -5107,    892,   1169 },
-  {   6632,  -3683,    302,   3002 },
-  {   6326,  -5351,   -983,  -1250 },
-  {   4382,  -7192,   -730,   -158 },
-  {   5227,  -6540,   -451,   1123 },
-  {   5468,  -6472,   -870,  -1471 },
-  {   5191,  -6402,  -1365,   -127 },
-  {   7407,  -6317,   -973,   -336 },
-  {   4611,  -6530,   -820,  -1980 },
-  {   4963,  -5159,  -2050,   -966 },
-  {   4414,  -5691,   -211,   -998 },
-  {   5954,  -5873,    750,  -1749 },
-  {   4394,  -4796,  -1268,    254 },
-  {   7161,  -6214,  -1010,    689 },
-  {   4965,  -3598,   2372,   1711 },
-  {   6248,  -6180,    981,    864 },
-  {   6473,  -5336,    525,   -600 },
-  {   4591,  -6864,  -1131,   -900 },
-  {   6314,  -6440,  -1021,   -375 },
-  {   5838,  -6209,  -1199,    944 },
-  {   5308,  -5283,  -2100,   1267 },
-  {   4342,  -5860,  -1637,  -1356 },
-  {   5680,  -4388,  -1227,   -104 },
-  {   4900,  -4098,   1449,   4046 },
-  {   4677,  -4284,   -106,   3190 },
-  {   7574,  -6173,   -848,   1859 },
-  {   6493,  -7207,   -131,    726 },
-  {   5513,  -5261,  -2117,      4 },
-  {   6191,  -7352,   -193,   -505 },
-  {   5885,  -4333,    324,   -134 },
-  {   6162,  -6081,   -312,  -2044 },
-  {   4216,  -6200,  -1810,   -572 },
-  {   5652,  -7035,   -696,   -197 },
-  {   7131,  -7189,   -366,    -60 },
-  {   5032,  -4803,  -1514,   2832 },
-  {   7386,  -4610,   -606,   3489 },
-  {   4211,  -5031,   1221,   3047 },
-  {   4050,  -4653,   1584,   1469 },
-  {   6852,  -5302,  -1861,    206 },
-  {   7736,  -4816,  -1794,   3359 },
-  {   6290,  -3439,   1522,   2454 },
-  {   1768,   5990,  -5560,  -2594 },
-  {   3903,   5326,  -1530,  -1501 },
-  {   2472,   3738,  -2117,  -4240 },
-  {   3260,   5448,   -904,  -4733 },
-  {   1435,   7297,  -3676,  -4102 },
-  {   4096,   5951,   -656,  -3312 },
-  {   2178,   6009,  -3146,  -3724 },
-  {   3787,   5493,  -5473,  -1633 },
-  {   2998,   7286,  -3334,  -3571 },
-  {   2894,   6576,  -4708,  -2804 },
-  {    830,   6163,  -4286,  -3348 },
-  {   4755,   5569,  -1730,  -2739 },
-  {   4604,   6065,  -3562,  -2605 },
-  {   2749,   5141,  -3986,  -2775 },
-  {   3942,   4875,  -2143,  -3340 },
-  {   2819,   8517,  -2004,  -2724 },
-  {   2146,   6298,   -689,  -3093 },
-  {   5196,   6504,  -3393,  -1475 },
-  {   1851,   8386,  -1748,  -1420 },
-  {   3474,   8572,  -3534,  -2688 },
-  {   4503,   7560,  -3561,  -2245 },
-  {   4433,   6219,  -2393,  -1575 },
-  {   3506,   7248,  -2275,  -1977 },
-  {   3490,   7409,  -3147,   -604 },
-  {   4214,   6447,  -3520,    516 },
-  {    619,   7034,   -829,  -1705 },
-  {   1732,   7395,   -356,  -2208 },
-  {   1226,   5204,  -3294,  -3732 },
-  {   2027,   5619,  -1813,  -4146 },
-  {   3078,   5877,     47,  -2651 },
-  {   1654,   5458,    424,   -682 },
-  {   3163,   5464,  -2026,   -270 },
-  {   2884,   5375,   -685,   -530 },
-  {   2950,   7286,    -35,  -2967 },
-  {   1986,   5066,   -597,    482 },
-  {   3459,   4308,  -3845,  -2333 },
-  {   3155,   7037,  -1346,  -4345 },
-  {   2193,   6696,   -717,  -1319 },
-  {   3677,   5089,  -3892,   -487 },
-  {   2186,   5136,  -4186,  -1492 },
-  {    773,   5796,   -917,    817 },
-  {   2489,   6546,  -3570,  -2117 },
-  {   1223,   6469,  -1362,    -33 },
-  {    271,   6061,  -1466,  -1725 },
-  {   2540,   5171,  -1847,   1032 },
-  {   2548,   5251,  -2697,   1677 },
-  {    771,   7600,   -768,   -632 },
-  {   4710,   6647,  -4736,  -1275 },
-  {   1369,   5917,  -2971,  -1056 },
-  {    163,   5239,  -3499,  -2275 },
-  {   2104,   4285,  -3211,  -3286 },
-  {   1107,   7411,  -1972,  -1671 },
-  {   2196,   7262,  -2310,  -1926 },
-  {   -244,   6439,  -1745,   -839 },
-  {   3293,   3832,  -2890,  -3000 },
-  {    419,   6443,   -379,   -407 },
-  {   3077,   4930,  -1156,  -2869 },
-  {   2131,   5874,  -2330,    224 },
-  {    690,   6538,  -2212,  -2841 },
-  {   1602,   4421,  -2515,   1542 },
-  {   3318,   9373,  -3032,  -3477 },
-  {   5646,   7462,  -5153,  -1463 },
-  {   4139,   7137,  -1539,  -3321 },
-  {   3481,   9077,  -1645,  -3653 },
-  {  -7747,    375,   -106,   -543 },
-  {  -8587,  -1379,   -586,   -461 },
-  { -10146,   -892,   2094,    694 },
-  {  -8103,    382,    504,   -325 },
-  {  -8548,    -92,     94,   -656 },
-  {  -7460,     38,    152,    388 },
-  {  -8266,   -271,   -459,   -883 },
-  {  -7935,   -664,  -1026,   -802 },
-  {  -8341,   -109,    853,    161 },
-  {  -8802,  -1355,   1099,    630 },
-  {  -8957,     -6,   1108,   -669 },
-  {  -7260,  -1520,    -43,   -407 },
-  {  -7555,   -174,    668,  -2562 },
-  {  -9014,   -126,    227,  -1191 },
-  {  -8184,    769,    290,  -1375 },
-  {  -9476,     55,    962,  -1528 },
-  {  -8679,    541,    755,  -1030 },
-  {  -9842,  -1626,    838,  -1588 },
-  {  -8513,   -702,    788,  -1998 },
-  { -10101,  -1558,   -366,  -1841 },
-  {  -8135,     78,   1479,  -1813 },
-  {  -9128,   -454,    313,  -1786 },
-  {  -7554,  -1084,    831,  -2442 },
-  {  -7576,   -701,   2068,  -1665 },
-  {  -7791,  -1481,   1587,  -1808 },
-  {  -6701,   -596,    -97,    802 },
-  {  -7418,    -15,    684,   -963 },
-  {  -7127,   -477,   -139,   -426 },
-  {  -8097,   -110,    -36,   -264 },
-  {  -7620,  -1922,   -590,   -101 },
-  {  -7647,  -1201,    279,    660 },
-  {  -7856,  -1974,    758,  -2271 },
-  {  -8496,   -167,   2232,  -1143 },
-  {  -8506,  -1359,    624,   -740 },
-  {  -7274,  -1052,   1062,   -139 },
-  {  -7800,   -217,     91,  -1794 },
-  {  -7030,  -1694,   -955,    615 },
-  {  -9020,  -1864,    101,  -2182 },
-  {  -9400,   -740,    598,   -667 },
-  {  -8448,  -1184,   2024,  -1272 },
-  {  -8812,   -570,   -897,  -2384 },
-  { -10559,  -1286,    538,  -1536 },
-  {  -8728,   -888,  -1089,  -1397 },
-  {  -7080,  -1185,    636,  -1252 },
-  {  -9880,    233,   2344,   -782 },
-  {  -7952,  -1326,   -378,  -1947 },
-  {  -7207,   -378,   1408,  -2237 },
-  {  -8467,  -1545,    902,  -1987 },
-  {  -9163,  -1474,    924,  -1739 },
-  {  -8159,   -992,    -77,  -2744 },
-  {  -8343,    148,   -423,  -1573 },
-  {  -9105,   -649,   -254,  -1214 },
-  {  -8939,    456,    281,  -1905 },
-  {  -8837,    179,   -394,  -2634 },
-  {  -9145,    757,   1547,  -1319 },
-  {  -9775,   -723,    441,  -1680 },
-  {  -8910,   -686,   1529,  -1525 },
-  {  -9492,  -1134,   2064,   -938 },
-  {  -6111,   -943,    677,    -31 },
-  {  -7411,   -613,   -814,     46 },
-  {  -9479,   -922,   -430,  -2061 },
-  { -11298,  -1268,   1318,  -1117 },
-  {  -8190,    832,    671,  -2214 },
-  { -10453,   -550,   1672,   -886 },
-  {   1044,   9353,  -1651,  -5423 },
-  {   1034,   8149,   -455,  -6166 },
-  {    761,   8293,  -3214,  -4838 },
-  {    938,   8077,    164,  -5130 },
-  {   1295,   8673,   2582,  -5490 },
-  {   -314,   7973,  -2395,  -5231 },
-  {   -507,   9012,  -2497,  -5775 },
-  {   2396,   8314,  -1022,  -4673 },
-  {  -1516,   8501,   1950,  -4969 },
-  {   -308,   7401,   1549,  -4866 },
-  {   -112,   8340,   3003,  -4920 },
-  {    -50,   9315,   1371,  -5666 },
-  {   -659,   9449,   2496,  -5547 },
-  {   2573,   9148,  -2270,  -4783 },
-  {    830,   7104,   -438,  -3907 },
-  {    522,  10672,   -677,  -6483 },
-  {  -1190,  10108,   -510,  -6518 },
-  {   -427,   8271,   -579,  -6315 },
-  {   1602,   8113,  -1927,  -4418 },
-  {  -2266,   8180,    448,  -5190 },
-  {  -1633,   8816,   -226,  -5771 },
-  {    759,   9481,   -105,  -5813 },
-  {   2254,   6679,   -466,  -5662 },
-  {    -88,   6946,    895,  -5958 },
-  {  -1705,  10009,   1394,  -5574 },
-  {    748,   7943,    540,  -6692 },
-  {   1411,   7009,    232,  -6145 },
-  {    697,   7290,  -1221,  -5342 },
-  {  -1764,  10580,   1944,  -3981 },
-  {  -1334,   9124,   1195,  -3903 },
-  {   -905,  10067,    635,  -5039 },
-  {    664,  10680,     49,  -4625 },
-  {   1374,   9536,   -777,  -3591 },
-  {    252,   9698,   -597,  -2931 },
-  {    824,   9164,  -1014,  -2144 },
-  {   2438,  10569,  -2289,  -4424 },
-  {   2101,   7102,    507,  -3614 },
-  {    294,   8051,   -432,  -1518 },
-  {   -665,  10337,    547,  -2852 },
-  {   1168,  11989,   -492,  -5427 },
-  {   1344,   6416,    302,  -5061 },
-  {  -1727,  12264,   1507,  -4543 },
-  {    674,  10889,   -902,  -3605 },
-  {   -582,   9504,    300,  -3618 },
-  {    641,   7654,    689,  -2109 },
-  {   2065,   9243,    508,  -4367 },
-  {   1055,   8373,    688,  -3144 },
-  {   -641,   8185,    986,  -3307 },
-  {   1120,   7426,   1785,  -3757 },
-  {   1660,   8070,   -593,  -3104 },
-  {   2002,   9467,  -1722,  -3475 },
-  {   2361,   8368,    100,  -3709 },
-  {   -772,   7845,   -613,  -4988 },
-  {   1485,   7430,   1896,  -6127 },
-  {   -432,   7823,   -947,  -2882 },
-  {    313,  11122,   -760,  -4871 },
-  {    412,   8412,   -283,  -4231 },
-  {   1585,  10402,  -1884,  -3267 },
-  {    321,   6952,    773,  -3016 },
-  {   -105,   9014,    121,  -2249 },
-  {   1585,  10313,   -977,  -4812 },
-  {   1619,  11869,   1306,  -6876 },
-  {  -1168,   8886,    -81,  -2500 },
-  {   -395,  10886,    733,  -6490 },
-  {  -4949,   4274,   3992,  -1054 },
-  {  -4241,   5299,   4262,  -1584 },
-  {  -2710,   3862,   4552,  -1673 },
-  {  -4608,   2472,   3672,  -1715 },
-  {  -2843,   2816,   4003,  -2326 },
-  {  -5229,   2964,   5636,     90 },
-  {  -4924,   3442,   5015,  -1096 },
-  {  -1281,   3313,   5537,  -2066 },
-  {  -3808,   1939,   4351,   -919 },
-  {  -1915,   2585,   4939,  -1614 },
-  {  -3470,   1843,   5562,   -682 },
-  {  -3800,    870,   5827,    144 },
-  {  -4985,   1452,   4728,   -709 },
-  {  -3745,   2750,   7220,    259 },
-  {  -1875,   1900,   6514,   -826 },
-  {  -4329,   1574,   7192,   1304 },
-  {  -5408,   1444,   6208,    631 },
-  {  -3327,   5312,   5707,  -1541 },
-  {  -6966,   3334,   4034,   1028 },
-  {  -7484,   4245,   4218,   -212 },
-  {  -6567,   5839,   4539,   -512 },
-  {  -5715,   5935,   3747,  -1186 },
-  {  -6410,   4881,   3356,  -1610 },
-  {  -5146,   2590,   2850,   2172 },
-  {  -5196,   4095,   2569,   -373 },
-  {  -5043,   6025,   4318,    692 },
-  {  -5525,   4884,   3513,    370 },
-  {  -6804,   7533,   5812,   -488 },
-  {  -5657,   2480,   4061,   1234 },
-  {  -3155,   1472,   6071,   1188 },
-  {  -3427,   5217,   3442,    858 },
-  {  -4698,   3013,   5517,   2586 },
-  {  -4449,   2226,   5418,   3580 },
-  {  -6395,   3547,   5487,   2028 },
-  {  -3500,   5019,   4787,      1 },
-  {  -4038,   2578,   3073,   3151 },
-  {  -2750,   1955,   4469,   3856 },
-  {  -5696,   1659,   6118,   2469 },
-  {  -4350,   1241,   6840,   3126 },
-  {  -5565,   5058,   5196,   1314 },
-  {  -1642,   4190,   3948,    607 },
-  {  -1233,   4108,   4850,   -640 },
-  {   -997,   3428,   3239,   1378 },
-  {  -6488,   2741,   6926,   2792 },
-  {  -4188,   3763,   4235,   2018 },
-  {  -3210,   3224,   5646,   1427 },
-  {  -5526,   6909,   5070,   -627 },
-  {  -2815,   3994,   3425,   1903 },
-  {  -2163,   2734,   5423,    145 },
-  {  -4149,   4247,   2355,    734 },
-  {   -410,   2521,   4138,    -16 },
-  {  -2411,   2385,   4927,   2105 },
-  {  -6077,   3591,   3114,    594 },
-  {  -4186,   4834,   5926,  -1004 },
-  {  -7315,   3369,   5966,    448 },
-  {  -7042,   5721,   5771,    238 },
-  {  -4466,   3907,   3535,  -1751 },
-  {  -2116,   3970,   6163,  -1392 },
-  {  -7239,   2143,   8407,   3630 },
-  {  -5431,   4486,   6486,    -42 },
-  {  -1874,   1617,   6333,    519 },
-  {  -6478,   2629,   4634,   -505 },
-  {  -7784,   2342,   7216,   1365 },
-  {  -1154,   1432,   4831,   1544 },
-  {  -4964,  -5801,   1797,    506 },
-  {  -4436,  -6905,   1059,  -1237 },
-  {  -5400,  -6886,    884,   -290 },
-  {  -6259,  -7103,    523,   -227 },
-  {  -4819,  -6450,   1412,   -450 },
-  {  -4056,  -6213,   1725,   -943 },
-  {  -5642,  -6091,   1357,    605 },
-  {  -4196,  -5678,   2187,   -173 },
-  {  -4726,  -5126,   2470,    321 },
-  {  -6642,  -5091,   1507,  -1005 },
-  {  -5304,  -5250,   1944,   1579 },
-  {  -7179,  -5520,   1468,   -425 },
-  {  -6033,  -4895,   1876,   -955 },
-  {  -6595,  -5143,   2207,   1291 },
-  {  -4224,  -4943,   1846,   1792 },
-  {  -7128,  -6950,    539,    724 },
-  {  -4369,  -4901,   2590,   1103 },
-  {  -7413,  -5696,   1712,   1440 },
-  {  -5885,  -6821,    418,    871 },
-  {  -6828,  -5599,    710,  -1563 },
-  {  -6123,  -5817,   1358,   1631 },
-  {  -5291,  -5622,    578,   2138 },
-  {  -7171,  -6004,    347,   2208 },
-  {  -6083,  -5251,   2132,    425 },
-  {  -4329,  -5721,    407,  -2993 },
-  {  -5326,  -5056,   1119,  -1837 },
-  {  -5485,  -5856,    185,  -2389 },
-  {  -6529,  -5178,    403,   -697 },
-  {  -6719,  -4412,   2726,    871 },
-  {  -5126,  -5629,   1835,   -771 },
-  {  -5622,  -4361,   2973,    858 },
-  {  -5282,  -5895,     45,   -335 },
-  {  -4357,  -5656,   1696,  -1558 },
-  {  -7139,  -6659,    627,   -409 },
-  {  -4415,  -6328,     35,   1306 },
-  {  -7639,  -6110,   1134,    197 },
-  {  -3626,  -5592,   2019,    901 },
-  {  -3547,  -5064,   1176,   1738 },
-  {  -5075,  -3899,   2087,    266 },
-  {  -4086,  -6311,   1479,    360 },
-  {  -6210,  -5220,   -199,  -1477 },
-  {  -3910,  -5063,   1356,    -15 },
-  {  -7616,  -4977,    461,   2401 },
-  {  -6118,  -6131,   1258,   -563 },
-  {  -6127,  -4968,   1286,    -27 },
-  {  -4121,  -5852,   1113,   1476 },
-  {  -5157,  -4881,   1162,   -662 },
-  {  -4637,  -5031,   1179,    709 },
-  {  -5509,  -5452,   -397,   1224 },
-  {  -4597,  -6861,    646,    467 },
-  {  -6247,  -4043,    468,    278 },
-  {  -5336,  -6465,    874,  -1472 },
-  {  -6998,  -6346,     78,  -1798 },
-  {  -4915,  -4530,   2756,   -203 },
-  {  -6048,  -4373,   1468,   1052 },
-  {  -4273,  -7100,    942,   -323 },
-  {  -6552,  -4287,   2351,     69 },
-  {  -6954,  -4613,    722,   1521 },
-  {  -4201,  -5361,    763,  -1562 },
-  {  -6881,  -5596,   -748,    669 },
-  {  -6695,  -3547,    -34,   1299 },
-  {  -3981,  -5728,     84,    111 },
-  {  -4663,  -4809,   2173,  -1031 },
-  {  -6599,  -6077,   1303,    256 },
-  {  -7596,  -4265,  -5791,  -4140 },
-  {  -6610,  -2758,  -5288,  -3936 },
-  {  -5880,  -3865,  -6563,  -3088 },
-  {  -7228,  -5510,  -7677,  -3912 },
-  {  -8854,  -6553,  -8318,  -5361 },
-  {  -9362,  -5249,  -6413,  -4319 },
-  {  -4418,  -3110,  -6368,  -4358 },
-  {  -5544,  -4203,  -6863,  -5013 },
-  {  -3056,  -4316,  -5567,  -3181 },
-  {  -3078,  -5999,  -5051,  -2657 },
-  {  -5884,  -6292,  -5756,  -4013 },
-  {  -4825,  -4549,  -5535,  -4053 },
-  {  -4443,  -6126,  -5316,  -1368 },
-  {  -3972,  -6341,  -6098,  -2686 },
-  {  -5751,  -2781,  -5398,  -6230 },
-  {  -4466,  -6135,  -5570,  -3679 },
-  {  -4291,  -5992,  -3564,  -5189 },
-  {  -7189,  -4429,  -7279,  -6082 },
-  {  -5076,  -4433,  -2748,  -5366 },
-  {  -6225,  -2825,  -6833,  -5663 },
-  {  -2989,  -4792,  -3960,  -4492 },
-  {  -7836,  -7773,  -7722,  -5741 },
-  {  -6559,  -5703,  -5844,  -5589 },
-  {  -7612,  -5438,  -4136,  -3774 },
-  {  -4218,  -4176,  -6591,  -2333 },
-  {  -4837,  -5063,  -6581,    322 },
-  {  -6590,  -5990,  -2980,  -3847 },
-  {  -5558,  -2971,  -5489,  -1932 },
-  {  -7001,  -5323,  -4975,  -1697 },
-  {  -4694,  -2688,  -6904,  -3044 },
-  {  -8511,  -5379,  -5767,  -2549 },
-  {  -7548,  -5412,  -6522,  -2572 },
-  {  -6597,  -4973,  -6423,  -1274 },
-  {  -6415,  -4022,  -5168,  -1072 },
-  {  -5528,  -5530,  -7218,  -2345 },
-  {  -4845,  -4805,  -5943,  -1227 },
-  {  -6049,  -7150,  -6744,  -2161 },
-  {  -9061,  -7299,  -8542,  -4375 },
-  {  -5010,  -5546,  -5416,    -82 },
-  {  -4135,  -4205,  -5109,  -3373 },
-  {  -3311,  -5869,  -4007,  -5061 },
-  {  -5993,  -6472,  -3962,  -4718 },
-  {  -2966,  -5832,  -2821,  -6305 },
-  {  -4851,  -5152,  -2067,  -3930 },
-  {  -3620,  -4441,  -3362,  -5836 },
-  {  -4469,  -5221,  -4534,  -5592 },
-  {  -4022,  -6335,  -4321,  -6107 },
-  {  -4899,  -4503,  -3084,  -3725 },
-  {  -4490,  -8276,  -4620,  -6236 },
-  {  -6591,  -4342,  -7365,  -4063 },
-  {  -6498,  -5057,  -5553,    485 },
-  {  -6060,  -2714,  -7093,  -4144 },
-  {  -6199,  -7774,  -7094,  -4057 },
-  {  -7536,  -6424,  -6415,  -4265 },
-  {  -7439,  -2454,  -6348,  -4827 },
-  {  -5333,  -7565,  -4417,  -4639 },
-  {  -4353,  -7103,  -4197,  -2689 },
-  {  -5229,  -6549,  -5129,  -6804 },
-  {  -6129,  -7701,  -5236,  -4836 },
-  {  -6797,  -3983,  -3884,  -4406 },
-  {  -6624,  -4467,  -4745,  -5052 },
-  {  -3324,  -7596,  -2720,  -6553 },
-  {  -5473,  -6284,  -1704,  -4511 },
-  {  -4131,  -7263,  -3180,  -5196 },
-  {  -7116,  -5565,  -3469,    685 },
-  {  -6002,  -6021,  -3858,    576 },
-  {  -3144,  -8203,  -1291,   -434 },
-  {  -6096,  -7027,  -4004,   1353 },
-  {  -3943,  -7709,  -2344,    -36 },
-  {  -4510,  -6767,  -2642,    631 },
-  {  -3657, -11541,  -2570,  -3984 },
-  {  -5959,  -8854,  -1333,   -867 },
-  {  -6699,  -8866,  -1606,   -344 },
-  {  -3836,  -7961,  -2334,  -2028 },
-  {  -3430,  -8045,  -3037,   -672 },
-  {  -3868,  -9184,  -3635,  -1819 },
-  {  -4258,  -9060,  -2621,  -1008 },
-  {  -3595,  -8693,  -2022,   -752 },
-  {  -4573,  -8048,  -3166,  -2622 },
-  {  -4852,  -7903,  -1405,    256 },
-  {  -4591,  -7057,  -1560,    965 },
-  {  -6963,  -7655,   -980,    808 },
-  {  -5179,  -6641,  -3356,   1196 },
-  {  -7102,  -6941,  -2798,   2123 },
-  {  -6867,  -5834,  -3320,   -770 },
-  {  -5977,  -7369,  -2500,   -778 },
-  {  -6160,  -6400,   -934,  -2543 },
-  {  -6741,  -7608,   -355,  -1289 },
-  {  -6856,  -6466,  -1433,  -1643 },
-  {  -4786,  -6292,  -4970,    376 },
-  {  -5407,  -8866,  -2255,   -400 },
-  {  -3814,  -6506,  -1387,  -3620 },
-  {  -4998,  -6137,  -1200,  -4092 },
-  {  -5123,  -9557,  -2849,  -1306 },
-  {  -4259,  -6444,  -4395,   -338 },
-  {  -5221,  -6810,   -883,   1225 },
-  {  -6137,  -6215,  -2165,    554 },
-  {  -3895,  -6557,  -3176,  -1829 },
-  {  -3886,  -8188,    -87,   -954 },
-  {  -7243,  -6707,  -2216,   -316 },
-  {  -5592,  -7606,     85,   -432 },
-  {  -3957,  -7945,   -504,   -144 },
-  {  -4617,  -7624,    218,   -312 },
-  {  -4797,  -8737,   -844,  -1051 },
-  {  -4478,  -8516,  -1401,   -454 },
-  {  -4557,  -7058,   -302,  -2332 },
-  {  -6623,  -7736,   -271,    -50 },
-  {  -3157,  -7532,  -1111,  -2207 },
-  {  -3590,  -7300,  -1271,    517 },
-  {  -4442,  -7306,   -507,    590 },
-  {  -6458,  -7524,  -2807,    666 },
-  {  -4991,  -8466,  -3363,   -785 },
-  {  -7474,  -7541,  -1056,  -1839 },
-  {  -7501,  -8316,   -938,   -180 },
-  {  -5329,  -7739,   -579,  -2341 },
-  {  -4549,  -7063,   -176,  -3539 },
-  {  -5191,  -8612,  -1504,  -4250 },
-  {  -3083,  -7058,  -2251,     32 },
-  {  -4003,  -7043,  -1093,   -791 },
-  {  -5523,  -8093,   -678,   -114 },
-  {  -3022, -10265,  -2070,  -3109 },
-  {  -3905,  -6274,   -182,  -3652 },
-  {  -3269,  -9217,   -551,  -2650 },
-  {  -3138,  -9314,  -1726,  -1704 },
-  {  -4420, -10339,  -1744,  -3459 },
-  {  -4163,  -8609,  -2298,  -4113 },
-  {  -5566,  -6505,  -1241,   -463 },
-  {  -3130,  -9746,  -2352,  -4884 },
-  {  -7825,  -3439,   1451,  -1468 },
-  {  -8451,  -3318,   2360,   -435 },
-  {  -8462,  -4130,   1438,  -1024 },
-  {  -9425,  -4564,   1328,   -689 },
-  { -11014,  -3202,   2278,   2080 },
-  {  -8269,  -2761,   -146,   -440 },
-  {  -7497,  -2618,   -166,    413 },
-  {  -8250,  -3060,    522,  -2133 },
-  {  -8365,  -5366,   1347,   -451 },
-  {  -8589,  -3979,   2943,    714 },
-  {  -8111,  -2572,   1272,  -1748 },
-  {  -7830,  -5193,    605,  -1484 },
-  {  -8119,  -4736,   2141,    256 },
-  {  -7724,  -4769,   1463,   -812 },
-  {  -7363,  -3911,   2540,      4 },
-  {  -7974,  -3397,   2363,   1366 },
-  {  -7359,  -4204,   1752,   -958 },
-  {  -7622,  -3505,    660,    916 },
-  {  -9934,  -3665,   3165,    828 },
-  {  -8721,  -4162,     62,   1718 },
-  {  -9433,  -4768,   2722,   1234 },
-  {  -7960,  -4496,    138,   1528 },
-  {  -8198,  -3454,   -443,    631 },
-  {  -7756,  -2246,    655,   1137 },
-  {  -8841,  -3145,   1113,    829 },
-  {  -7817,  -3298,   1251,    230 },
-  {  -9413,  -2733,    323,  -1862 },
-  {  -9408,  -4168,   1270,   1549 },
-  {  -9037,  -3892,   -942,    283 },
-  {  -8255,  -3849,   1301,   1762 },
-  {  -9057,  -3987,    -41,   -682 },
-  {  -9441,  -4187,   2019,   -111 },
-  {  -9740,  -3178,   1602,   -871 },
-  {  -8344,  -2474,   1461,   1506 },
-  {  -9752,  -2925,   1996,   1243 },
-  {  -9199,  -3796,    180,    537 },
-  {  -9060,  -2405,   1140,  -1562 },
-  {  -9348,  -2376,    309,   -162 },
-  { -10786,  -3182,     -5,  -1500 },
-  {  -8142,  -4540,   -434,   -826 },
-  {  -7528,  -2341,   1104,    -73 },
-  {  -9360,  -2658,   3062,     56 },
-  {  -8267,  -2335,   2000,  -1193 },
-  { -12169,  -3154,   1287,   -640 },
-  { -11398,  -2120,    946,  -1163 },
-  {  -8940,  -4559,    328,  -1696 },
-  { -11025,  -4213,   2813,    840 },
-  {  -9224,  -3581,   2224,   2039 },
-  {  -8943,  -3337,   1248,  -1298 },
-  {  -7900,  -4042,    485,  -2080 },
-  {  -9221,  -1947,   2191,   -880 },
-  { -10762,  -1800,   2516,   -324 },
-  { -10095,  -2238,    981,  -1335 },
-  { -11908,  -2808,   3255,    645 },
-  { -10640,  -4105,   1283,   -595 },
-  {  -7663,  -2863,   2467,   -797 },
-  { -10712,  -3854,   3710,   1538 },
-  { -10823,  -2893,   1408,   -801 },
-  {  -9874,  -3832,    256,  -1638 },
-  { -10394,  -3391,   2315,    -94 },
-  { -11525,  -4079,   4153,   2122 },
-  {  -9546,  -2088,   1541,    481 },
-  {  -8731,  -2433,   1042,   2160 },
-  {  -7852,  -3977,  -1370,   1677 },
-  {   7072,  -3420,   1398,  -1741 },
-  {   6180,  -1976,   1280,  -3557 },
-  {   7692,  -1793,   2844,  -1700 },
-  {   8363,  -1773,   3104,  -2679 },
-  {   9213,  -3266,   3756,  -3542 },
-  {   9650,  -2644,   1426,  -1318 },
-  {   7712,  -2796,   3686,  -1975 },
-  {   7316,  -3517,   2821,   -622 },
-  {   7434,  -2594,   2305,  -2264 },
-  {   7237,  -1797,    255,  -3114 },
-  {   8663,  -1983,   1338,  -3056 },
-  {   6616,   -952,   4059,  -2652 },
-  {   8823,  -1327,   1362,  -1356 },
-  {   9938,  -1722,   1287,  -2362 },
-  {   7207,  -1057,   1913,  -1315 },
-  {   7508,  -1585,    870,  -1982 },
-  {   8217,  -3680,   1417,  -3170 },
-  {   8329,  -2541,   1684,   -585 },
-  {   8062,  -2335,    252,  -2800 },
-  {   8204,  -4108,   3097,  -2569 },
-  {   7701,  -3367,    576,  -3008 },
-  {   7350,   -786,   2414,  -2129 },
-  {   6948,  -2568,   1607,   -225 },
-  {   7684,  -2387,   1308,  -3449 },
-  {   8306,  -3458,   2394,  -1454 },
-  {   8438,  -2781,   1043,  -1362 },
-  {   9175,  -2076,   2144,  -1987 },
-  {   8347,  -2709,   3489,  -4301 },
-  {   5696,  -2377,   2870,    851 },
-  {   8825,  -1243,   2219,  -2603 },
-  {   8801,  -1614,    584,  -2513 },
-  {   8413,   -384,   1421,  -2244 },
-  {   9228,  -3050,   3279,  -2164 },
-  {   6342,  -2698,   3547,   -107 },
-  {  10053,  -2476,   2837,  -3168 },
-  {   7439,   -604,   3177,  -3991 },
-  {   7749,  -1064,   4329,  -4855 },
-  {   8655,  -2177,   2252,  -3519 },
-  {   8490,   -228,   1958,  -3233 },
-  {  10513,  -2968,   1911,  -2340 },
-  {   8146,   -862,   1884,  -1723 },
-  {   7788,   -666,   3004,  -2891 },
-  {   7785,  -1620,   4133,  -3417 },
-  {  10262,  -3731,   3455,  -2971 },
-  {   8570,   -905,   4519,  -4649 },
-  {   9129,  -2562,    463,  -2465 },
-  {   9451,  -3587,   1904,  -3056 },
-  {   6549,  -2236,   3010,  -4523 },
-  {   7175,  -2684,   2967,  -3458 },
-  {   9872,  -3278,   1054,  -2472 },
-  {   9153,   -931,   1217,  -2565 },
-  {   8789,  -3469,    753,  -2568 },
-  {   6683,  -3791,   1797,  -3968 },
-  {   6801,  -1977,   2311,   -452 },
-  {   6336,  -1572,   2612,  -3264 },
-  {   7996,  -1008,    730,  -2964 },
-  {   7521,  -1059,   1573,  -3694 },
-  {   8148,  -3973,   2600,  -3572 },
-  {   7765,  -1532,   2528,  -3856 },
-  {   7404,  -3918,   4472,   -143 },
-  {   8894,  -1398,   3299,  -3685 },
-  {   5768,  -2041,   1487,   -637 },
-  {   5131,  -2865,   2463,   -811 },
-  {   6439,  -1568,   3500,  -1550 },
-  {  -8878,  -6798,  -5319,  -1452 },
-  {  -6332,  -9713,  -3112,   -990 },
-  {  -8444,  -6316,  -3694,   -687 },
-  {  -6123, -10840,  -3637,  -4358 },
-  {  -4784,  -9580,  -4577,  -2581 },
-  {  -6108, -10515,  -4859,  -2524 },
-  {  -7605,  -7518,  -2327,  -2797 },
-  {  -9662,  -8775,  -2467,  -2010 },
-  {  -6494,  -7523,  -4715,   -118 },
-  {  -8290,  -8982,  -1672,   -317 },
-  {  -8798, -11051,  -3888,  -1426 },
-  {  -6273,  -6623,  -6791,   -142 },
-  {  -8313,  -7668,  -2141,  -1275 },
-  {  -6453,  -8412,  -3589,  -4102 },
-  {  -6747,  -7750,  -5690,  -2498 },
-  {  -7814,  -6693,  -3174,  -2446 },
-  { -10383, -10130,  -3931,  -2364 },
-  { -10606,  -8467,  -5539,  -2772 },
-  {  -9475,  -6671,  -3305,  -2271 },
-  {  -8982,  -9457,  -5635,  -4005 },
-  { -10111,  -7965,  -6515,  -4180 },
-  {  -7301,  -6479,  -5364,    720 },
-  {  -9543,  -8999,  -7921,   -912 },
-  {  -9534,  -8562,  -3469,   -384 },
-  {  -7601, -10344,  -3205,  -1127 },
-  {  -8088,  -8620,  -4954,  -2888 },
-  {  -8202,  -8406,  -7038,  -3775 },
-  {  -7312,  -8324,  -3334,  -1775 },
-  {  -8566,  -9262,  -8071,  -4174 },
-  {  -7068, -11300,  -5573,  -2907 },
-  {  -8295,  -8952,  -4366,  -1544 },
-  { -11104, -10210,  -2285,   -384 },
-  {  -5213,  -7520,  -5008,  -1339 },
-  {  -5889,  -7940,  -5987,  -1385 },
-  { -10816,  -8201,  -4153,  -1485 },
-  { -10277,  -8919,  -6315,  -1652 },
-  {  -5888, -10320,  -3821,  -1733 },
-  { -10497,  -7181,  -6083,  -3032 },
-  {  -7721,  -9724,  -6591,  -5336 },
-  {  -5688,  -7894,  -3486,  -2552 },
-  { -10014, -10500,  -3247,   -820 },
-  {  -6301,  -8765,  -4506,  -2923 },
-  {  -8261,  -7847,  -6213,  -1552 },
-  { -10212,  -7481,  -8113,  -3954 },
-  {  -6938, -10874,  -6074,  -4703 },
-  {  -7183, -10968,  -4446,  -1773 },
-  {  -7120,  -9193,  -1966,  -2509 },
-  {  -6234,  -9263,  -2313,  -4284 },
-  {  -8503,  -9857,  -2429,   -608 },
-  {  -9372,  -7844,  -8391,  -2120 },
-  {  -7951,  -7157,  -6535,    -11 },
-  {  -7256,  -9473,  -2172,   -660 },
-  { -10063,  -9612,  -2515,    -15 },
-  {  -6684,  -9134,  -6109,  -4206 },
-  {  -8204, -11932,  -5220,  -2306 },
-  {  -9710,  -6706,  -4115,  -3275 },
-  {  -6855,  -7078,  -2409,  -4447 },
-  {  -7344,  -7673,  -4479,  -4116 },
-  {  -8851,  -6842,  -4927,  -2948 },
-  {  -8927, -10452,  -5633,  -2194 },
-  {  -8627,  -9002,  -7176,  -1575 },
-  {  -8209,  -9722,  -7021,  -3324 },
-  {  -3770, -10249,  -3623,  -4816 },
-  {  -8183,  -7465,  -4090,    646 },
-  {  -8163,  -7149,    200,    498 },
-  {  -8289,  -6266,    686,   -206 },
-  { -10030,  -6241,  -1032,  -1864 },
-  {  -8793,  -8327,   -773,   -169 },
-  {  -9149,  -6215,    969,    -15 },
-  {  -8303,  -5859,     -7,   2006 },
-  {  -9682,  -7283,    255,   1322 },
-  {  -9293,  -7227,     71,   -231 },
-  {  -8525,  -6215,    287,   -837 },
-  { -10477,  -5379,   1159,   1449 },
-  { -10726,  -7856,   -130,    102 },
-  {  -8694,  -7461,  -1210,    690 },
-  {  -9367,  -5324,   1103,   3170 },
-  { -10686,  -8055,   -831,   1633 },
-  {  -9201,  -6873,  -2704,   2258 },
-  {  -8421,  -5358,  -1405,    226 },
-  {  -9066,  -5830,   -307,  -1571 },
-  { -11150,  -7381,  -2746,   -900 },
-  {  -9978,  -5925,  -2006,   -437 },
-  {  -9464,  -4741,   -273,   1061 },
-  { -10543,  -6684,  -1113,   1660 },
-  { -10073,  -5576,   1083,   -269 },
-  {  -8826,  -5763,   1600,   1486 },
-  { -10445,  -9071,  -1253,    -64 },
-  { -12085,  -5799,      2,    769 },
-  { -12939,  -6663,   1650,   1437 },
-  { -10932,  -6434,  -1252,   -649 },
-  { -11650,  -7826,  -2053,    710 },
-  { -12122,  -6733,  -1889,   -731 },
-  {  -9093,  -6095,  -2463,   -842 },
-  { -10977,  -4364,    469,    420 },
-  { -11488,  -6908,   -521,    893 },
-  {  -9669,  -5478,   -842,    337 },
-  { -10606,  -5203,   -632,  -1361 },
-  { -10198,  -6284,   1662,   1277 },
-  { -10135,  -5292,   2435,   3493 },
-  { -11027,  -6561,    655,     56 },
-  { -10977,  -5030,   1127,   -358 },
-  { -12766,  -3986,   1348,   -335 },
-  { -14244,  -7731,    264,    317 },
-  { -15124, -10309,   -508,   1447 },
-  { -12821,  -8638,   -608,    137 },
-  { -13076,  -8693,  -2852,   -431 },
-  { -11156,  -5546,  -2252,  -1600 },
-  {  -8692,  -7366,   -819,  -1223 },
-  { -12507,  -9816,  -1714,   -121 },
-  { -10712,  -6666,    544,   3349 },
-  { -12462,  -5890,  -2491,  -2318 },
-  { -12468,  -7226,    437,    232 },
-  { -11300,  -5226,   2068,    687 },
-  { -11994,  -8320,   -626,   2728 },
-  { -12222,  -5476,   1142,     18 },
-  { -10277,  -8122,  -2418,   2003 },
-  { -13418,  -6115,  -3563,  -2802 },
-  { -14759,  -9834,  -1243,     21 },
-  { -13699,  -5665,   1525,    507 },
-  { -16269,  -9476,   -701,    163 },
-  { -12677,  -5437,   -247,  -1019 },
-  { -11827,  -4295,   -181,  -1243 },
-  { -12847,  -4496,   2984,   1123 },
-  { -13860,  -7915,  -1166,   -547 },
-  { -12276,  -8145,  -2290,  -1527 },
-  { -11417,  -4830,   2983,   1854 },
-  { -11793,  -6002,   1163,   1940 },
-  {  11443,  -4920,  -3235,   3151 },
-  {  11300,  -6616,  -1506,   1175 },
-  {   9198,  -4628,  -2060,   2390 },
-  {  10532,  -4027,   -643,    912 },
-  {   9902,  -3573,  -1606,   1327 },
-  {   9653,  -3536,  -2240,   1869 },
-  {   9948,  -5171,   -423,   2662 },
-  {  12316,  -4004,  -1989,    281 },
-  {  12125,  -4800,  -1265,   -163 },
-  {  10650,  -2617,  -2337,   1462 },
-  {   9909,  -4968,  -2376,    916 },
-  {  12944,  -4647,  -1958,    460 },
-  {  12988,  -5283,  -1141,     41 },
-  {  12321,  -2915,  -3621,   1025 },
-  {  11449,  -2894,  -2728,    351 },
-  {  12087,  -3041,  -2002,    -32 },
-  {  11558,  -4031,  -1343,   -399 },
-  {  12983,  -3740,  -3516,   1245 },
-  {  12099,  -2515,  -2752,    225 },
-  {  12515,  -3465,  -2701,    550 },
-  {  14683,  -5022,  -5272,   2996 },
-  {  12260,  -3383,  -1215,   -528 },
-  {  13810,  -5422,  -2443,   1166 },
-  {  13421,  -5378,  -1886,    721 },
-  {  12961,  -4259,  -2594,    796 },
-  {  12266,  -2104,  -4768,   1591 },
-  {  13523,  -4710,  -3045,   1342 },
-  {  12437,  -2099,  -5610,   2117 },
-  {  11850,  -2183,  -3497,    661 },
-  {  12275,  -3936,   -597,   -697 },
-  {  12459,  -5253,   -517,   -544 },
-  {  12835,  -4094,  -1322,   -168 },
-  {  14360,  -5677,  -3305,   1859 },
-  {  13905,  -4552,  -4309,   2117 },
-  {  11559,  -3412,  -1847,    -81 },
-  {  13379,  -3167,  -5764,   2746 },
-  {  11910,  -1634,  -4342,   1052 },
-  {  12662,  -4742,     71,   -974 },
-  {  13057,  -3254,  -4424,   1705 },
-  {  15046,  -5706,  -4851,   3019 },
-  {  14162,  -4142,  -5514,   2843 },
-  {  12764,  -1845,  -6684,   2888 },
-  {  13714,  -2374,  -7838,   3857 },
-  {  13295,  -1663,  -8293,   4073 },
-  {  10032,  -4152,  -3403,   1421 },
-  {  10942,  -5386,  -2222,    950 },
-  {  10532,  -6385,  -1750,   1925 },
-  {  10273,  -5972,  -1534,    643 },
-  {  10605,  -4782,  -1695,     27 },
-  {  10988,  -5153,  -1123,   -341 },
-  {  11629,  -5884,  -1060,     48 },
-  {  10441,  -4045,  -2431,    311 },
-  {  10788,  -3595,  -4171,   1807 },
-  {  12110,  -5686,  -2127,    976 },
-  {  11746,  -4773,  -2639,    891 },
-  {  11541,  -5299,  -3031,   1732 },
-  {  11416,  -2559,  -5359,   2198 },
-  {  11583,  -5376,   -704,    677 },
-  {  10416,  -3214,  -3516,    872 },
-  {   9651,  -5435,  -1618,   3255 },
-  {   9973,  -5133,   -996,   3923 },
-  {  11707,  -4643,   -430,   -796 },
-  {  10994,  -2709,  -3587,   2302 },
-  {  10716,  -5118,   -645,    270 },
-  {  14100, -10314,   1095,   1531 },
-  {  12944,  -8049,   1105,   -741 },
-  {  13276,  -7035,   -511,    274 },
-  {  14008,  -7254,   -283,    139 },
-  {  11594,  -6536,    -91,   1671 },
-  {  11732,  -8645,    746,     15 },
-  {  14613,  -7085,  -1578,   1183 },
-  {  13083,  -6224,   -750,     -4 },
-  {  13988,  -6256,  -1592,    820 },
-  {  14678,  -8683,    441,    126 },
-  {  15571,  -8872,   -521,   1139 },
-  {  15642,  -9533,    341,    697 },
-  {  15960,  -9586,   -168,   1121 },
-  {  15464, -10239,   1433,     -1 },
-  {  14934,  -7887,  -1046,   1080 },
-  {  15252,  -7630,  -1899,   1628 },
-  {  15485,  -8384,  -1234,   1484 },
-  {  15962,  -8638,  -1815,   1931 },
-  {  16501, -10664,    398,   1167 },
-  {  16146, -10145,    411,    918 },
-  {  14573,  -7475,   -697,    601 },
-  {  14302,  -7996,     28,    257 },
-  {  14769,  -6792,  -2286,   1574 },
-  {  14144,  -6137,  -2169,   1257 },
-  {  14770,  -6271,  -3111,   1933 },
-  {  14110,  -8312,   1083,   -531 },
-  {  15235,  -6991,  -2993,   2174 },
-  {  13222,  -5805,    547,   -891 },
-  {  14796,  -8762,   1254,   -246 },
-  {  16040,  -9181,  -1005,   1551 },
-  {  16487, -10086,   -373,   1420 },
-  {  15077,  -9479,    966,     51 },
-  {  13026,  -6468,    932,  -1080 },
-  {  12703,  -6152,    -33,   -573 },
-  {  15641,  -6810,  -4128,   2874 },
-  {  13282,  -7673,   1583,  -1283 },
-  {  12373,  -7150,   1512,   -917 },
-  {  12992,  -7751,   -678,    783 },
-  {  10907,  -6858,   -313,   2597 },
-  {  13026,  -8963,    125,   2152 },
-  {  12770,  -9946,   1957,   -505 },
-  {  12482,  -6849,  -1268,    833 },
-  {  13790,  -6181,   -138,   -279 },
-  {  12709,  -8382,   2044,    227 },
-  {  12244,  -6630,    203,   -457 },
-  {  14209,  -6816,  -1032,    632 },
-  {  15134,  -8267,   -288,    640 },
-  {  13619,  -6157,  -1090,    356 },
-  {  14044,  -7413,    725,   -484 },
-  {  12958,  -7753,   2585,  -1980 },
-  {  13188,  -8396,   2306,  -1558 },
-  {  14379,  -9980,   2132,   -688 },
-  {  14275,  -9857,   1162,    179 },
-  {  13690,  -8648,   1621,   -889 },
-  {  11770,  -6829,   -746,    278 },
-  {  12732,  -8202,    286,     90 },
-  {  13630, -10146,   1867,   -207 },
-  {  12072,  -8740,   1299,   -645 },
-  {  12852,  -9492,   1226,     62 },
-  {  11792,  -7382,    -54,   -116 },
-  {  13779,  -9014,    487,    351 },
-  {  11951,  -7729,    121,    834 },
-  {  11970,  -9781,   2276,     -4 },
-  {  12680,  -7984,   2787,   -787 },
-  {  13300, -14488,   6408,  -1927 },
-  {  13635, -15355,   9153,  -3073 },
-  {  12804, -13566,   5517,  -1625 },
-  {  16624, -10854,   1690,     28 },
-  {  20387, -18532,   6162,   -261 },
-  {  16515, -12642,   3392,   -519 },
-  {  15800, -11095,   2151,   -202 },
-  {  16824, -11790,   1651,    599 },
-  {  17604, -13213,   2563,    538 },
-  {  17892, -14177,   3562,    147 },
-  {  16987, -11399,    869,   1052 },
-  {  17003, -12456,   2442,    265 },
-  {  21657, -21806,   9198,  -1250 },
-  {  16825, -13341,   3980,   -686 },
-  {  17525, -12714,   1887,    805 },
-  {  16419, -11034,   1216,    617 },
-  {  20931, -19939,   7469,   -684 },
-  {  18452, -15390,   4573,   -191 },
-  {  14778, -10077,   2841,  -1209 },
-  {  17402, -13319,   3042,    160 },
-  {  19365, -17922,   7087,  -1061 },
-  {  16298, -11941,   2810,   -351 },
-  {  19087, -16176,   4775,    -84 },
-  {  17666, -12289,    938,   1224 },
-  {  18581, -15894,   5132,   -430 },
-  {  19823, -16717,   4142,    545 },
-  {  19960, -19423,   8400,  -1492 },
-  {  18973, -16817,   5906,   -594 },
-  {  19079, -15431,   3528,    503 },
-  {  16667, -12485,   4467,  -1302 },
-  {  19791, -17797,   6196,   -529 },
-  {  20005, -17606,   5354,    -20 },
-  {  20123, -18599,   6886,   -728 },
-  {  19068, -14805,   2394,   1105 },
-  {  14443, -13723,   5631,  -2029 },
-  {  14730, -14231,   5631,  -1450 },
-  {  16089, -15959,   7271,  -2029 },
-  {  13473, -11200,   3236,   -924 },
-  {  14413, -10902,   2347,   -267 },
-  {  17666, -18662,  11381,  -3496 },
-  {  14749, -11042,   3305,   -275 },
-  {  15304, -10486,   1869,   -240 },
-  {  14809, -12126,   3369,   -616 },
-  {  16896, -16561,   7307,  -1845 },
-  {  15782, -14336,   5380,  -1264 },
-  {  16395, -15520,   6415,  -1588 },
-  {  13681, -11114,   2584,   -320 },
-  {  14244, -12326,   4480,  -1632 },
-  {  15247, -13119,   4265,   -898 },
-  {  13987, -12091,   3469,   -597 },
-  {  13941, -12770,   4240,   -839 },
-  {  13771, -13627,   5252,  -1384 },
-  {  15010, -16074,   7592,  -2249 },
-  {  15852, -17226,   8619,  -2655 },
-  {  18921, -16916,   6875,  -1501 },
-  {  14909, -11678,   2768,   -295 },
-  {  18988, -18353,   8424,  -2070 },
-  {  15457, -15080,   6218,  -1513 },
-  {  14916, -15512,   6949,  -1883 },
-  {  18108, -14702,   4681,   -701 },
-  {  17600, -15733,   5616,   -775 },
-  {  14070, -13683,   6472,  -2626 },
-  {  13832, -11914,   5201,  -2232 },
-  {  18846, -19009,   9192,  -1961 },
-  { -11981, -10994,  -6324,  -2264 },
-  { -10976,  -9047,  -6546,  -3828 },
-  { -11288, -10532,  -7014,  -4191 },
-  { -10139, -10189,  -7799,  -2688 },
-  { -10555,  -9988,  -9181,  -2040 },
-  { -11596, -11339, -10022,  -2707 },
-  { -13400, -13395, -11306,  -4206 },
-  {  -9774, -12281,  -7466,  -4133 },
-  { -10842, -13125,  -8777,  -4956 },
-  { -11964, -15082,  -9779,  -5095 },
-  {  -9382, -10188,  -9053,  -4927 },
-  { -11562, -11296,  -3651,   -985 },
-  {  -9287, -10083,  -7918,  -4069 },
-  { -12821, -16556, -11410,  -6195 },
-  { -12628,  -8959,  -4521,  -1113 },
-  { -13845, -11581,  -3649,   -681 },
-  { -12685, -10269,  -5483,  -1275 },
-  { -14988, -12874,  -5107,  -1189 },
-  { -13761, -11367,  -6202,  -1804 },
-  { -13225, -11249,  -7820,  -3354 },
-  { -14809, -11992,  -3202,   -312 },
-  { -15620, -15519, -10210,  -3433 },
-  { -12954, -10200,  -3139,   -611 },
-  { -11536,  -9981,  -5284,   -923 },
-  { -13034, -12417,  -4612,  -1098 },
-  { -16911, -15505,  -6123,  -1352 },
-  { -17396, -17685,  -8330,  -2171 },
-  { -14120, -10764,  -2265,    -99 },
-  { -12598,  -7367,  -5406,  -3530 },
-  { -14143, -12793, -10909,  -5226 },
-  { -14692, -16871, -11626,  -5554 },
-  { -12581, -11197,  -9194,  -3837 },
-  { -16752, -16726,  -9746,  -2808 },
-  { -10600, -10358,  -6560,  -1227 },
-  { -14573, -13312,  -8957,  -3393 },
-  { -10172,  -8463,  -8579,  -3387 },
-  { -11418, -12421,  -5522,  -1842 },
-  { -11855, -14204,  -6669,  -2625 },
-  { -13308,  -8191,  -3941,  -2194 },
-  { -10007, -12266,  -5022,  -1811 },
-  { -13532, -15771,  -9497,  -3175 },
-  { -11760, -11148, -10339,  -5529 },
-  { -12149, -12763, -11198,  -3697 },
-  { -12029, -12119,  -8555,  -1792 },
-  { -16995, -19957, -11447,  -3471 },
-  { -13144, -14504,  -9988,  -3191 },
-  {  -9938, -11064,  -6139,  -3162 },
-  {  -8873, -11550,  -8294,  -6550 },
-  {  -9303, -13010,  -6150,  -2711 },
-  { -15463, -10469,  -1766,   -170 },
-  { -15985, -11693,  -3007,   -650 },
-  { -17142, -10671,  -1434,     47 },
-  { -16063, -13858,  -4817,  -1058 },
-  { -19446, -19599,  -9594,  -2464 },
-  { -20076, -18744,  -8313,  -1889 },
-  { -15047, -16085,  -7590,  -2250 },
-  { -13481, -16195,  -8552,  -2998 },
-  { -13829, -14869,  -6704,  -1932 },
-  { -16357, -18484,  -9802,  -2959 },
-  { -10551,  -8393,  -9303,  -5070 },
-  { -11345,  -9156,  -5641,  -3107 },
-  { -13217, -13449,  -9270,  -4541 },
-  { -11988, -13732,  -9995,  -6374 },
-  { -11007,  -9519,  -5168,  -4107 },
-  {   9930,  -7858,   8061,  -4375 },
-  {   8274,  -7867,   5992,  -2096 },
-  {   9692,  -9675,   7621,  -3670 },
-  {   9589,  -8110,   6509,  -3010 },
-  {  12617, -11976,  10122,  -5360 },
-  {  11867,  -8895,   7948,  -5323 },
-  {  10388, -10482,   9234,  -4324 },
-  {   8188,  -8220,   7810,  -2737 },
-  {  10407,  -8787,   4806,  -1930 },
-  {  10348,  -8845,   9233,  -6614 },
-  {   9422,  -7091,   4820,  -2878 },
-  {   9758,  -9796,   5584,  -2256 },
-  {  10188,  -7994,   5347,  -3343 },
-  {  11133,  -7455,   4015,  -2306 },
-  {  10676, -10744,   6093,  -2629 },
-  {  11522, -12184,   7848,  -3375 },
-  {   8805,  -9883,   5317,  -3071 },
-  {   9498,  -9654,   6555,  -3592 },
-  {  10488,  -8008,   4066,  -1252 },
-  {  11261,  -8930,   6068,  -2738 },
-  {  12180, -10397,   5027,  -1531 },
-  {   9138,  -8531,   3601,  -1959 },
-  {   8107,  -8380,   4970,  -2061 },
-  {   9737, -13248,   6438,  -2617 },
-  {  11178, -10423,   2622,   -522 },
-  {   9572, -12372,   5199,  -2019 },
-  {  12057, -12144,   4147,  -1099 },
-  {   9047,  -9925,   2516,   -665 },
-  {  10790,  -8030,   5882,  -4386 },
-  {   7199,  -8426,   6337,  -2841 },
-  {   7778,  -8285,   3529,  -3442 },
-  {   7559, -10569,   3484,  -1332 },
-  {   9404,  -8115,   7484,  -5541 },
-  {   7792, -11976,   5546,  -2573 },
-  {   9313, -10264,   7661,  -5195 },
-  {   6701, -10725,   4370,  -1784 },
-  {   4918, -11361,   4507,  -4527 },
-  {   5147, -12305,   3978,  -5556 },
-  {   6525,  -9899,   4481,  -3129 },
-  {   7538, -12855,   6060,  -4826 },
-  {   8659, -12111,   7159,  -4430 },
-  {   8440, -11304,   4547,  -1747 },
-  {   9216, -10918,   3507,  -1195 },
-  {   6165,  -9254,   4771,  -4677 },
-  {   9163, -11019,   5637,  -4935 },
-  {  13441, -11509,   6676,  -2434 },
-  {   7912,  -9398,   6663,  -4048 },
-  {  11723, -13745,   8131,  -4148 },
-  {   6065, -10257,   5005,  -6327 },
-  {  11618, -12417,   5336,  -1894 },
-  {   8891, -13924,   8407,  -6131 },
-  {   9622, -12563,   7908,  -5109 },
-  {  11479, -10315,   8349,  -3991 },
-  {  11676, -14103,   6611,  -2330 },
-  {  11951,  -8953,   3829,  -1550 },
-  {  10486,  -8044,  10493,  -5920 },
-  {  11801, -10769,   9763,  -5305 },
-  {   6109,  -8676,   5827,  -1346 },
-  {   7030,  -9611,   5624,  -5761 },
-  {  12808, -12886,   8683,  -4148 },
-  {  13213, -10464,   6381,  -3189 },
-  {  11796, -13681,  10703,  -6075 },
-  {   9639,  -7949,   9625,  -3944 },
-  {   8538,  -6997,   5309,    453 }
-};
-
-/* quantization tables */
-
-static const uint32_t scale_factor_quant6[64] = {
-        1,       2,       2,       3,       3,       4,       6,       7,
-       10,      12,      16,      20,      26,      34,      44,      56,
-       72,      93,     120,     155,     200,     257,     331,     427,
-      550,     708,     912,    1175,    1514,    1950,    2512,    3236,
-     4169,    5370,    6918,    8913,   11482,   14791,   19055,   24547,
-    31623,   40738,   52481,   67608,   87096,  112202,  144544,  186209,
-   239883,  309030,  398107,  512861,  660693,  851138, 1096478, 1412538,
-  1819701, 2344229, 3019952, 3890451, 5011872, 6456542, 8317638,       0
-};
-
-static const uint32_t scale_factor_quant7[128] = {
-        1,       1,       2,       2,       2,       2,       3,       3,
-        3,       4,       4,       5,       6,       7,       7,       8,
-       10,      11,      12,      14,      16,      18,      20,      23,
-       26,      30,      34,      38,      44,      50,      56,      64,
-       72,      82,      93,     106,     120,     136,     155,     176,
-      200,     226,     257,     292,     331,     376,     427,     484,
-      550,     624,     708,     804,     912,    1035,    1175,    1334,
-     1514,    1718,    1950,    2213,    2512,    2851,    3236,    3673,
-     4169,    4732,    5370,    6095,    6918,    7852,    8913,   10116,
-    11482,   13032,   14791,   16788,   19055,   21627,   24547,   27861,
-    31623,   35892,   40738,   46238,   52481,   59566,   67608,   76736,
-    87096,   98855,  112202,  127350,  144544,  164059,  186209,  211349,
-   239883,  272270,  309030,  350752,  398107,  451856,  512861,  582103,
-   660693,  749894,  851138,  966051, 1096478, 1244515, 1412538, 1603245,
-  1819701, 2065380, 2344229, 2660725, 3019952, 3427678, 3890451, 4415704,
-  5011872, 5688529, 6456542, 7328245, 8317638,       0,       0,       0
-};
-
-/* 20bits unsigned fractional binary codes */
-static const uint32_t lossy_quant[32] = {
-        0, 6710886, 4194304, 3355443, 2474639, 2097152, 1761608, 1426063,
-   796918,  461373,  251658,  146801,   79692,   46137,   27263,   16777,
-    10486,    5872,    3355,    1887,    1258,     713,     336,     168,
-       84,      42,      21,       0,       0,       0,       0,       0
-};
-
-static const float lossy_quant_d[32] = {
-          0,     1.6,      1.0,     0.8,    0.59,    0.50,    0.42,    0.34,
-       0.19,    0.11,     0.06,   0.035,   0.019,   0.011,  0.0065,  0.0040,
-     0.0025,  0.0014,   0.0008, 0.00045, 0.00030, 0.00017, 0.00008, 0.00004,
-    0.00002, 0.00001, 0.000005,       0,       0,       0,       0,       0
-};
-
-/* 20bits unsigned fractional binary codes */
-static const uint32_t lossless_quant[32] = {
-        0, 4194304, 2097152, 1384120, 1048576,  696254,  524288,  348127,
-   262144,  131072,   65431,   33026,   16450,    8208,    4100,    2049,
-     1024,     512,     256,     128,      64,      32,      16,       8,
-        4,       2,       1,       0,       0,       0,       0,       0
-};
-
-static const float lossless_quant_d[32] = {
-    0,             1.0,      0.5,     0.33,     0.25,    0.166,    0.125,
-    0.083,      0.0625,  0.03125,   0.0156, 7.874E-3, 3.922E-3, 1.957E-3,
-    9.775E-4, 4.885E-4, 2.442E-4, 1.221E-4, 6.104E-5, 3.052E-5, 1.526E-5,
-    7.629E-6, 3.815E-6, 1.907E-6, 9.537E-7, 4.768E-7, 2.384E-7,        0,
-           0,        0,        0,        0
-};
-
-
-/* Vector quantization tables */
-
-DECLARE_ALIGNED(8, static const int8_t, high_freq_vq)[1024][32] =
-{
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 },
-  { -4, -2,  2,  1,-16,-10,  1,  3,  1,  0,  6,  1, -3,  7,  1,-22,
-     2, -4, -3, 11, 14,  6, -1,  1,-13, 29,-28, 10, 10, -8,  0, -9 },
-  { -8,  8, -7, 10, -3,-12, -5, -8,  1, -2,  9, -2, -5,-18,  1,  9,
-    -8, -8,  3, 41,  7, -9, -9, 22,-42,-29, 14,-18,-14,-32,  1,-15 },
-  {-16,  8, 15, 16,-16,  5,  2,  7, -6,-16, -7,  1,  1, -3, -2,  0,
-     8, 20,-26,-11,  2,-17,  0, -3,-34,-37, 10, 44, -2, 22,  2, -4 },
-  {  7, 14,  5,  6, 15, -1,  3, -3, -9,-23, -5,-14,  8, -1,-14, -6,
-    -5, -8, 54, 31, -6, 18,  2,-19, -2,-11,-30, -6,-19,  2, -2,-14 },
-  {  1,  2, -2, -1, -3, -3,  1, -5,  1, -3, -4, -8,  5, -4,  0,  1,
-     3,  7, -5, -4, -3,-12,  3, -2, -3, 12,-53,-51,  6, -1,  6,  8 },
-  {  0, -1,  5,  1, -6, -8,  7,  5,-18, -4, -1,  1,  0, -3, -3,-14,
-    -1, -6,  0,-14, -1, -1,  5, -3,-11,  1,-20, 10,  2, 19, -2, -2 },
-  {  2,  4,  3,  0,  5,  0,  3,  1, -2,  0, -6, -3, -4, -5, -3, -3,
-    -7,  0,-34,  4,-43, 17,  0,-53,-13, -7, 24, 14,  5,-18,  9,-20 },
-  {  1,  0, -3,  2,  3, -5, -2,  7,-21,  5,-25, 23, 11,-28,  2,  1,
-   -11,  9, 13, -6,-12,  5,  7,  2,  4,-11, -6, -1,  8,  0,  1, -2 },
-  {  2, -4, -6, -4,  0, -5,-29, 13, -6,-22, -3,-43, 12,-41,  5, 24,
-    18, -9,-36, -6,  4, -7, -4, 13,  4,-15, -1, -5,  1,  2, -5,  4 },
-  {  0, -1, 13, -6, -5,  1,  0, -3,  1, -5, 19,-22, 31,-27,  4,-15,
-    -6, 15,  9,-13,  1, -9, 10,-17,  4, -1, -1,  4,  2,  0, -3, -5 },
-  { -7,  3, -8, 13, 19,-12,  8,-19, -3, -2,-24, 31, 14,  0,  7,-13,
-   -18,  0,  3,  6, 13, -2,  1,-12,-21,  9, -2, 30, 21,-14,  2,-14 },
-  { -3, -7,  8, -1, -2, -9,  6,  1, -7,  7, 13,  3, -1,-10, 30,  4,
-   -10, 12,  5,  6,-13, -7, -4, -2, -2,  7, -3, -6,  3,  4,  1,  2 },
-  { -8,  9,  2, -3, -5,  2,  0,  9,  3,  7, -4,-16,-13,  3, 23,-27,
-    18, 46,-38,  6,  4, 43, -1,  0,  8, -7, -4, -1, 11, -7,  6, -3 },
-  {  1,  1, 18, -8, -6,  0,  3,  4, 22, -3, -4, -2, -4,-11, 40, -7,
-    -3,-13,-14, -7,-10, 14,  7,  5,-14, 11, -5,  7, 21, -2,  9, -3 },
-  {  0,  0, -2,  4, -2,  0,  2,  0, -1,  2, -1,  0,  0,  2,  2,  2,
-    -1,  1, -3, -1,-15, -2,-63,-27,-21,-47,-14,  1,-14, 10,  0,  2 },
-  {  1,  0, -4,  0, -3, -9,  4,  2,  6, -6,  0, -5, 11, -7,-15,  6,
-    -7, -6,  3,  7,-15, -5, 23,-13, -6, 12, -8,  9,  2, -3,  3,  4 },
-  {  6,  0,  3,  0, -2, -4,  2,  1,  1, -1,  1, -2, -1, -4,-22,-15,
-   -46,-66, 10, 20,  2,-17, 12, -6,  1, -2, -2,  0,  1, -5,  1,  2 },
-  { -1,  0,  0,  1,  0, -4,  0,  1,-10, -3, -8,  5,  7,-11,  2,-11,
-    29,-25, 11, 10,  0, -1,  5, -7, -2, -5, -2,  4,  4, -3,  5, -2 },
-  {  1, -1, -1, -3, -2,  1, -8, -3,  2, -2,  4, -5, -1, -7, -2,  1,
-   -14, -7,  3,-30,-15,-14,  3, -4, -1,  3,-13, -1, -3,  1,  2,  3 },
-  { -1, -2, -3,  2,  2, -3,  3,  1, -3,  2,  0, -4,  6,  5, -5, 10,
-   -57,  3, 22,-50,  1, -2, -5, -6, -1,  5,  1,  2,  2,  1, -2,  2 },
-  {  2,  0, -1, -7,  2,  1,  3,  2,  0,  4,  3, -2,  3, -3,  4, -4,
-    24,-35, -3, 38, -6, -5, 15, 20,  3, 16, -7, -5,  0, -4, -5,  0 },
-  {  0,  1,  0,  0,  0, -1, -1,  1,  1, -1,  1, -2,  0,  0,  0,  0,
-     0, -1, -2, -1, -5, -2,-43, -3, 46,-52,-10,  7, -8, 11, -2, -1 },
-  {  0,  0, -1,  0, -1,  2,-41, 33,-44,-48,-15,-26, -9,  6,  3,  3,
-    -3,  2,  2,  2,  2, -1, -1, -2,  1,  3,  0,  0,  5,  2,  3,  1 },
-  { -4,  1,  6,  1, -6, -1, -2,  1,-14, -4,  0, -5, -2,  2, -2,  0,
-    -6,  1,  0,  8,-21, 32, -3,-36, -6, -2, -1, -7,  3,  0,  1, -6 },
-  { -3, -2,  3,  0,  2,  2,  8, -4, -4,  6,  2,  1,  3, -6,  4,  3,
-    13,  0,-12, -1, 25,-20, -2,-23,-15,  7, -3,-11, -3,  6, -1,  0 },
-  {  0,  0, -3, -1,  0,  0, -2, -1, -2, -2,  1, -1,  0,  0, 10,  3,
-    -2,  3,  3, -7, -6, -5,  0, -4,-60,-16, -6, 38,  5,  6, -5,  0 },
-  {  0,  1,  0,  0,  0,  0,  0,  0,  1, -1, -1,  0,  1,  0,  0,  1,
-     0,  0, -1,  0, -8,  2, -9, 10, 40, 31,-56,-21,  4, 20, -4,  7 },
-  { -2, -2,  0,  4, -3, -1,  7,  3,  1,  3, -8,  0,  3,  1,  2,  5,
-     1, -2, 14,  5,  4,  5,  5,  5, -5,  9,-66,  0,-20, -2, -8,  4 },
-  { -2, -1,  4, -1, -8, -2, -4, -1, -3, -3,  2, -7, -3,  5,  7, -2,
-    45, 31,-17,-16, -2, -2, -1,-22,  1, -1, -3,  3,  5, -3,  5, -1 },
-  { -4,  0,  7,  5,  8,  7,  2,  9, -9, -9, -7,-11, -3, -8, 17, -4,
-    34, 32, 18, 22,  1,  2,  1, -7, -5,  6, -1,  6,  4, 10, -2, -7 },
-  {  6,  0, 14,  9,  6, -1, -2, -3,  4, -6, -8,  4,  7, -1, 28, 38,
-    15, -1, 16,-11,  5,  8,  4,-10,  3,-10,-17,  5,  3,  3,  3,  1 },
-  {  1,  1,  2, -1,  2,  1,  0,  0, -1,  0,  0, -2,  1, -3,  0,  1,
-     2, -2, -4, -2,  0, -1,  1, -3,  1,  1,  1, -1,  8,  8, 66, 33 },
-  { -5,  2, -3, -7,  2, -8, -4, 10, 17,-18, -7,  4, -4, -7, -6, -6,
-    -5,  5,-12,  2,  0,  6,  8, -2,  1,  4,-11,  2,  1,  8, 31, 19 },
-  {  6,  9, 16, -6, -6, -1, -2, -3,-11, -2,  7,  7, 17,  3,  4, 10,
-     2,  5,-13,  8,  7,  1,  4,  5,  7,  6,  7, -8,  9, -8, 33,  6 },
-  {  3, -1,  1,  0, -7, -5,  0, 14, -7,  1, -7,  1,  2, -4,  7, 10,
-   -16, 12,  1, -6,  3,  8, -1, 10,-13, -6,-12,-23, 12, -3, 30, 14 },
-  { -2,-15,  0,  8,  3,-19,  5, -3,  2,  3, 13,  7, 14, -3,-10,  0,
-     8,  5, -6,-16, -8, -8, 14,  2, -1,  1, -9,-11, 11, -5, 27,  9 },
-  { -8,  6, -4,  4, -4, -1,  5,  4,  1, -7, -5, -4,-15,  1,  9,  0,
-     8,  4,  1,-17, 11, -2,-19, -1, -6, -8,  3,-12,  3,-17, 33,-10 },
-  { -3, -1,  2,  7,  7, -2,  9,  8,-18, -1,-13,-10, -3, -3, 11,  8,
-    -2,-12, -8,  1,  4,  9, 14, 10, -3,  0,  2,  1, -2,  3, 31, 10 },
-  { -3,-10,  8, -1, -5,-11,  7, -5,  3,  6,  1,  4,-16, 10,  5, -4,
-    -2,-10, -1, 13,  6, -5, -7, 12,  7, -3,-17,  1, 12, -4, 29,  8 },
-  {  1,  2,  5,  2, -6, -7,  0, -1,  6, -1, 10,  6, -4,  5,  2,  2,
-    -2, -8, -6,-11, 14,-13, 27,  3, -2,-12,  5,-16,  2,-26, 20, 15 },
-  { -1, -3, -5, -3, -3,  6, -1,  3, -5,  1,  7,  2,  1,  0, -1, -1,
-     0, -1,  9,  7, -6, -3,  4, -5, -4,  8, -8,-25, -8, -4, 34, 23 },
-  { -1, -2,  1,  1, -1, -2, -1,  1, -1,  0,  0,  0,  0, -2, -1,  1,
-     0,  2,  1, -1,  4,  0,  0,  1, -1,  0,  5,  3, 12, -9, 68,-16 },
-  { 10,  0, -8, 14, -6,  1,-12,  0,  0, -3, -5,-11, -6, 12,  9,-10,
-    -3,  5,  0,  7, 11,  2,  4, -3, -8, -3,  7,  4,  3, -3, 34,  4 },
-  {-12, 13, -5,  7,-11, -2, -1,  1, -4,-14,-21,  3, -3, -3, -4, -7,
-    -9, -4,  3,-17, -2,-13, 10, -2, 12, -4,  0, -9,  1, -5, 31, 10 },
-  {-10,  6,  5,  6,  4, -7, 10,  0,-28, -3,  0,-11, -1, -5, 16,-10,
-   -16,  7, 20,  2, -4,  2, -5,  0, 15,  6,  5,-10,  7, -9, 20,  4 },
-  {  1, -7, -2, -7,  4, -3, -2, -7, -1,-14,  6,-16,  4, -5, -4, -6,
-    -5,  0, -2,  2, -6,  9, -5,  4,-18,  8,-10,  8, 15,  0, 32,  1 },
-  { -5,  7, -3,  7, 15, -4,  0,-16,  9,  5, -5,  5,  4, -3,-12, -9,
-   -18, 10,  2,  2, -3,  7,  3, -1,  6, -9,-10,  3, 15, -4, 35, -7 },
-  { -1,-10,  2,  2, -4, -2, 10,  2, -1,  2, -2,  1, -1,-14,-11,  3,
-    -8,  5, -8, -2,  6, -1, -7,  1,  7,  5,  7,  8, 30, -4, 30, 14 },
-  {  2, -2,  1,  2,  3, -8,  3,  0, -2,  0, -9,  2,  1,  4, -6, -1,
-    -2,  5,  0,  1, -2, 12,  6, -3,  9, -3,  4,-12, 21,-39, 24, -2 },
-  {  3,  5,  1, -2, -2, -2, -3,  6, -8, -2,-11, -8, -1,  4,  2,  2,
-    -4,-10, 12, -5,-11,  1,-15,-34,-11, -7,-11, -1,  7,-14, 38, -1 },
-  { -4,  4,  8,  9,  8,  1, -5, -9,  4, -2, 15, -4, 11,-15, 20, -1,
-    -1, -3,  4, -9, -2, -2, -2,  8,  6, 12, -5,  0, 11,-12, 27, -4 },
-  {  0,  8, -4,  3,-11,  6,-11,  2,  3,  0,  5, -8, -7, -6, -9,-21,
-     4,-11, -1,-16, -7, 16, -3,  7, -7,  4, -5,  0, 11, -7, 31,  3 },
-  {  1,  3,  4, 11,-11, -2, -3, -6,  6,  5,  0,  3, -9, -6,  4, -4,
-     0,  4, -8, 13, -6,-13, -1, -5, -1,  4,  0,  0,  9,-22, 24, 18 },
-  { -7,  3, 10,-13, -6,  6, -6,  6, 22,  1,  0,-14,  2,  3,  7, -1,
-     8, 20, -1,  5, -4, 13,  9, -9, -9,  6,  0, -4,  0, -8, 31, -4 },
-  { -3, -4,  0,  1,  7,  3, -7,  0,  5, -2,  1,  3,  3,  1, -5, -2,
-     5,  2,-11,  4,  0, -1, 12,  0, -3,-13, 15,  8, -6,-27, 34,  0 },
-  { -3, -3, 10, -4,  2, -1, -3,  0, -1, -1, -4,  2,  6, -2, 12,  1,
-     3, -6, -7, -6, -5,  4,-19, -6, -8,-34, -4, -8, 10, -7, 23, 10 },
-  { -7,  0, -1, -6,  8,  4, -4,  2, -5, -8, -7, -9, -8,  5,  9,  7,
-    -6,  1,-12,-12, -1,-16,  5,  0, 16,  3, -7, -8, 27, -4, 23, 15 },
-  { -8,  4,  8,  5,  6, 11, -3,  5,  3, -1,-11,  6, -5,  0,  2, -6,
-    -3, -6,  4, -1,  5, -5,-12, -6,  7, -5,  9,  3,  6, -7, 29,  1 },
-  {  1,  3, -2, -2, -6, -2,  1,  6, -6, -3,  1,  2,  3,  4,  1,  5,
-    -1,  0,  4,  2, 11,  6,  2, -3, 13, -9,-19, 18,-15,-10, 36, 21 },
-  { -3, -3,  2, -1, -7,  6, -4,  1, -3, -1, -2,  2,  3, -7, -3,  0,
-    -2,  0, -2,  6,-19,  3, -8,  2, -6,  7, -1,  0, 29, -6, 28,-10 },
-  { -5,  1, -3, -7,-12, -4,  1,  1, -1, 13,-10, -1, -9, -5,-13,  6,
-    13,  3, -4,  2,  3, 11,  2,  6,-25,-16, -6,  0, 14, -1, 27, 16 },
-  { -6, -1, -7, -5, -2, -5, -5, -1,  9,  1,  0,  3, -8,-12, -6,  5,
-    -6,  5,  3, -9,  1,  4, -7,-10, -9, -7,-17, -5,-15,-23, 25,  3 },
-  { -8, -2,  9, -3, -4,  3, -1,  8, -7, -7, -5, -4, -2,  9,  4, -1,
-    -7, -4, -5,-16,  3, -6, 18,-13, -9, 16,-15,  8, 15,-10, 24,  5 },
-  {  1,-38,  2, 34,  9, 10, 11,  2,  2, -6,  3,  2, -2,  5,  4, -7,
-    -1,  1,  4,  0,  3,  1, -8, -1, -6,  5,  4,  2, -4,  5,  2, -1 },
-  {  1,-22, 15, 18, -2, 10,-16, -9, -8,-11,  8,  4,  0,  7,-14, -5,
-    -1, -7, 12, 17,  9,  5, -7, -4,-12, -6,  7,  0,  7,  2, -2,  1 },
-  {-11,-29,  7, 10, 19, -1, -8, -9,  7,  1,  9,  6,  8, -7,-14,  8,
-    -3,-11,-13,  0, -7,-23, -2, -8, 12,  9,  2, 14, 19,  1, -1,  5 },
-  {-24,-27,-11, 36,  2,  6, -3,  4, -6,  8,  0, 12, -1, -4, -6,  3,
-     4, -1,  2, -3, -2,  3,  2, -1, -2, -4,  0, -1, -2,  7,  2,  3 },
-  { -9,-24, 11, 13,-10,-12, 12, -2,  7,  4,  8, 13, -3, -3,  2,  9,
-    -3, -4,  4, 13,  5, 13, -6, -3,  1, 15,  7, -3,  0, 19, -2, -9 },
-  { -8,-15,  7, 14, -4, -5,  2,-18,-19, -2,  2, 17, 16,  6,-10, 10,
-    -9, 14, -1, -5, -1, -6, -7,  2,  9, 11, 13,  6, -5,-12,  3,  2 },
-  {-10,-37, 13,  1,  3,-14,  0,-20,  4, -3,  8,  2, -2, -3, -9, -5,
-    -3,-17, -1, 13,-11,  2, -6,  4,  4,  0,  3,  1, -9, -4, -5, -4 },
-  { -2,-22, -5, 46, -8,  5,  9,-11,  8,  7,  7, -1, -1, -2, -7,  2,
-    -3,  3, -1, -2,  7,  0,  2, -1,  1, -2, -2, -3,  6,  0, -4, -6 },
-  {-16,-27, 15, 16, -4, 14, -7,-26,  2, -2,  6,  5, -3, 11,  0,  2,
-     3,  9, -7, -1,  2, -4, -4, -1,  6, 10,  1,  1, -3, -2,  3,  0 },
-  { -3,-22, 10, 26,  1,  2, -3,  3, 17, -3, -7,  9,  1,-21, -4,  5,
-     3,  0, -7, -6,  3,  3, -8, -7, -9,  3,  7,  1, -8, 12,  6, -7 },
-  { -9,-25,  3, 18,  9, -6,-11,  0, -5,-12,  9, -8, -7, -6, -6, 22,
-     2, -6, -3, 15,  3,  2, -2,  9, 14,-10, -7, 15, 13,  6, -2, 11 },
-  {  5,-20, -5, 28, 11, 10, -4, -4,  0, -7,  3,  5,  2, -5, -8,  2,
-     6, 10,  9, -9,-18,  3, 14,  1,  3, -3, -1, -6,  7,  7,  2, -1 },
-  { -8,-30,  7, 12, 10,  8,  7,-13,-16,  0,  1, -1, -6,-11,-15,  4,
-     1, -2, 10,-15,  1, 11, -2,  8,  9, -7, -7,  9, -5,  2,  7,-18 },
-  {-10,-32, 10, 11,  3, -1,  3, -5,  5,  2, 14, -6,  3,  1,  5,-15,
-   -11,  6, 20,  4,  0,-12, -7,  3,  1, -1, 10,  6, -1, -9, -4, -1 },
-  {  1,-25,-14, 12,-11,  9,  9,-16,-24,-17, 22, -9, 11,-30, -3, -4,
-     6, -7,  9,  2, -1, -5, -6,  2, -1, -1, 10,  1, -3,  3,  4,  8 },
-  {-14,-26, -6,  9,  8, 17,-11,-24, -7, -4, -8, -2, 10,  2,  2, -1,
-     2, 13, 12, -7,  4, -6,-10,  6,  6,-13,-11, -7,-16,  0, -2,  5 },
-  { -4,-30,-13, 12, 16, -6, 12,-16,-13,  5, 15, -2, -2,-10, -7,  7,
-    11, -1, -4, -2, -4,  7,  4, -8,  1,  3,  0, 11,  3, -2, -5,  4 },
-  { -4,-21, 20, 22,  2, 20, -8,  1,-12, -5, -9,  4,-10,-17, -3, -8,
-    -3,  3,-12,  1, -3,  0,  7,  4,  7,  7, -3,  7,  5,  3,  1, -5 },
-  {-12,-20,  2, 29, 11, -6,  9, -7, -6, -4,  0,  6, 17,-13, -2,-10,
-   -17, -1,-18,  2,  0, 14, -6,  1,  0,  3,  2,-10,  1, -5, -2,  5 },
-  { 16,-37, -1, 26, -2,-14,  1, -5,-14,  2,  2,  3,  6,  1,  1,  4,
-     0, -1,  0, -2, -2,  4,  9, -6,  0, -2, 10, -7, -2,  4,  1,  0 },
-  { -9,-24,-12,  5,  5,  3,-17,-14,  4,  3,  2, -4, 10,-22, -8, -3,
-     6,  1, 12, -8,  4,  1,  9, -1, 18, -3,  6,  5,  3, -5,  9, -5 },
-  {-14,-33, -2, 20,-13,-10,  2, -7, -1, 11, -9, -8, 18, -3,  1,  8,
-     0, -2, 10,  7, -2,-13,  9, -3, -4,  5, -2, -2, -1, -5,  1, -7 },
-  {-10,-23,  8, 14,  1,  7,  1, -3, -7,  4,  1,  1,  8, -7, 15,-14,
-    13, 14,  2,  5,-13, -5, -8, -1,  6,  3,  6,  9,  6, 15, 14,  5 },
-  {-13,-25,-10, 13,-17,-24, -7,-13, -6,-10, -8,  2,  0,-13,-10, -4,
-    -8,  4, -9,  9, -4,  4, -3, -3,  3,  3, -5, -9,  1, -2, 11,  2 },
-  {-12,-23,  1, 18,-11, -2,  5,  9, -5,  5, 14, -9, -3, -2, -6,  2,
-    -2, 11,-13,  1, -3, 11, -9, -4, -2, -6,  8, 10,  1,  4,  2,  1 },
-  { -5,-18, 16, 22,  2,  0,  8, -6, -9, -7, 10,-16, 23, 10,-11, -1,
-     7,  2,  7,  2,  1, -5,  6,  1,  0, -4,  9,  2, -3,  1,  0, -4 },
-  { -3,-26, 14, 11,  2, -9, 17, -2, -1, -5,-16, -9, -5, 10,-13,  1,
-     6, 12, 10, 11,  0,  0, -3,-14,  6, -2,  0,  4, -5, -1, -7, -1 },
-  {-10,-33,  1,  8, 11, -5,  1, -6,  7,  4,  5,  6,  1, -2,-10, -5,
-    -6, 12,-11,  5,-10,  4, 12, -1, -1, -3,  4, -1,  9,  0, 16,-17 },
-  {-14,-37,  7,  7, -2,  5, -8,-11,  2,-13,  4,-19,  1,  8,  8,  4,
-    -9,  2, -4,  3, 12,  2,  4, -4, -8,  8,  1,  4,  8, -1,  6, -2 },
-  { -6,-30, 18, 17,  1,-22, -3,  4, -7,-10,  7,  0, -8,  8, -1,  4,
-     2,  8,  6, -2,  2,  7,  4,  4,  3, -6,  2,  1, -3,  1, -1, -5 },
-  {-17,-18, -3, 22, -8,  1,  9, -2,-17, 20, -5, -5,-12, -5,  4, -5,
-    -9,  8, -2, 16, -3,  0, 19, -8,  8,  1,  2, -4,  0, 11,  0, -3 },
-  { -9,-23,  3, 10,  4,  4, -3, -2, -2, -2,  1,-22, 11,  0, -2,  5,
-    -2, 14, -9,-11, -4,  7,  5, 32,  1, -3, -7,  0, 21, -9,  7, -6 },
-  {  0,  0,  0,  2, -1,  1,  0,  1,  3,  0,  0,  1,  0,  1,  0,  1,
-    -3,  0, -1, -2,  0, -1, -1, -3, -1,  1, -4,  1, -1, -5,-69,-19 },
-  { -3, -5, -8,-12,  4, -3,-19,-11, -5,  0,-14,  7, 18, -6,  7, 22,
-     8, 14, 15, 10,  3, -1, -3,  5, -1,  7, -7,  1, -6,  3,-26,-11 },
-  { -1, -6,  4, -4, -5,-16,  0, -6, -3, 11,  1,  0,  9,  5, 16,  3,
-    -4,-33, -4,  4, -7,  0,  1,  6,-11, -2,-13, -2,-18, 20,-25,-16 },
-  {  4,  0, -1,  0, -5,  1,  0,  2,  0, 11,-10,  4,-10,  7, 16,  2,
-    16, 15,  2, -1,  2,  9,  2,  8, -3, -5, -2,  0, -3,  0,-33, -2 },
-  { -3,-15, 10, 10, -9, -1,  7,  3,  5, -5, -8, -8, -3, 15, -9,  4,
-    12, 13,-13,-14, 10, -6,  9, 22,-27, 23, -1,  5,-24,  2,-30,  5 },
-  {  0, -2,  7, -5, -5,  3,  5,  3, -3, -5,  2,  1, -4,  3, -3, -1,
-     1, -2, 10, 22, -3, -4, -2, -2, -7,  3,  8,  1, 14,  4,-37,  9 },
-  { -3, -4, -1,  1, -4,  0,  6,  2,  6, -7,-10,-10, -1, -4, 11, -3,
-     7, -6,  4,-12, -1,  5,  1, -7, 10, -6, 17, -4,  8,  3,-40, 13 },
-  {  2, 12,  4, -7, 14, -3, 16, -2, 18,  2, 13,  5,  5,  1, 11, -1,
-     0,  9,  2, -6, -1,  2, -6,  2, -5,  3,  5,  1, -1,  1,-32, -7 },
-  {-16, 11,  7, -4,  2, -5, -9,  9, 11, 11, 15,-13,-11, 11,  9,  4,
-     3, -8,-10, 12, 12,  0,  0,-16, -9, 13,  2,  9,  4,-13,-33,  3 },
-  {  6,  4,  5,  4,  3, -1,  5,  6,  4,  2,-11, -1,-15,-11, -1,  1,
-    11, -3, -2, 24, -4, -6,-25,-10,-15, -8,  0,  0, -5,  4,-30,  2 },
-  { 10, -3, -6,  1, -9, -5,  6,  9,-10, -3,  8, -1,  4, -1, 11,-11,
-     3,  9, 11, -3,  6,-17,  5, -8,-33,  9,-13, 19, -2,  9,-25,  2 },
-  {  0,  0, -1, -3,  0, -2,  1,  0,  0,  2,  1,  0, -2,  0, -1,  2,
-     0, -1,  4, -1,  2, -3,  4, -2,  3,  3,  1,  0,-15, 12,-63, 27 },
-  { -2, 14,  9, -1,  3,  0,  1,  1,-19, 15,  3,  4,  0,-10,  1, -5,
-     3,  0, -5,-10,  2,-16, -4,  8,-12, -6,  7, -5,-10, -1,-33, -4 },
-  {  0,  3,  1,  3,  1,  2,  4,  4,  9, -6, -8, -5,  1,-12,  3,  8,
-   -10,  6, -1,  1, 13, -5, -5,  2, -4, 13,-18,-10, -7, -9,-33, 10 },
-  { -6, -3,-12,  5, -1, 11, -6,  0, -2,  1,  2, -7,  3,  1,  3, -2,
-     1,  8,-10,  7, -1, -3,  3,  0, 13,  1,  6,  7,-16, -7,-39,  8 },
-  { -6, -1, 11,  6, -3,  8,  3, -5,  3,  0, -5, -2, -6, -3, -4,  2,
-    -3, 13,-11,  1,  7,  5, 19, -5, -3,-15, -1,  7, -1,  6,-33,  8 },
-  { -7,  3, -4, -3, -4,  1,  6, -5, -5,  6, -8, -1, -7,  4, -1, -6,
-    -2,  1,  7,  0,  1,  1, -5,  2, -2,  0,-13, -2,-31,-14,-39,-12 },
-  {-10,  9,  0, -3,  1, -1, -1,  0,  1, -5, -1, -4, -2,  5,  2, -7,
-    18, -8, -2,-19, -7, -7,-12,-14,-11, -1, -9,-13, -7,-12,-31, -9 },
-  { -3,-16, 10,  9,  1,-10,-12,  2, -2,  2,  7, -3, -3,  1, -4, -5,
-    -9,  5,  7,  3, -1,  4,-11, -8,  4, 13,-10, 13, 10, -4,-36,  1 },
-  { -7,-12,  4,-20, -7, -7,  2, 11, -1, -2,  3,-12,  1,  0, -6, -7,
-     6,  4, 13,  3, -3,  4,  3, -6,-12,  5, -5,-22,-13, -8,-37, -6 },
-  { -7,  5,  3,  5,  7,  9,-14, -3, 10, 17, -1,  1,-12,  5, -6,  0,
-    -4, -9,  0,-11,-14,  3, 13,  6,-25, -8,-12,  4,-10, 18,-30, -1 },
-  {-10,  6,-10,  6,  6,  1,-10,  0, -7,  5, -2, 17,-18, -4,  0, -3,
-   -16, -6, -3, -8,  5,  1, -4,  6, -7, 16,  6, 10, -1,  0,-32,-11 },
-  { -1,  9,  9, -5,  4,  9,  6,  9, -4, -2,  7, 11,  4,  2, -5, -4,
-    -6,  0,  2, -3, -1,  5, 10,  0, 12,-10,-18, -3, -1, 14,-33,  2 },
-  {  4, -8,-18, -4, -5,-11,  4,-10, -4,  9, 13,-12,  1, -6,  1,  2,
-     4, -9,  8,  3, -6, 21, 13, -1, -2,  1, -2,  6, -7,  0,-30,  1 },
-  {  6, -1,  2, -3, -1, -4,  6, -4,  0,  4,  2,  2, -9,  2,  6,  3,
-    -2,  4, -1,  9, -6,  0,  7, -8,  5, 19, -2,  9, -5,  2,-33, -8 },
-  {  2,  1, 12, -5, -8,  8,  3, -2, -4,  1, -2,  5, -4, -9, -8, -8,
-     7,-11, -4,  6,-10,  7, -1, -1, -2, -1, 16, 32, -7, 20,-33, -6 },
-  {-18,  2,  6, 13,  9,  9, -1,  3,-17, 24, -2, -6, 28,  8, -2,  6,
-     3,-10,-34,-16,-13, -4,-15,-11,-12, -3,-10,  4, -8,  4,-31, -4 },
-  {-11,  0, 18,  2,-16, -9,-13, -2, -2,-12, -3,-22, 30,  0,  8,  3,
-     9, -4,-16,  1,  0,-11, 15, -2, -4,  6, -5,  6,  1,  2,-25,-12 },
-  { 14, -1,  5,  7,  3,-15, -8,  1,  5, -2, 12, 13, 11,-25,  3,  1,
-     0, -2, -4,-16,-23,  0, -5,-17,  7,  5, -9,  6, -5,  2,-32, -7 },
-  {  3, -1,  6, 14,  2,-12, -9, -9,  4,  7,  4,  6,  5, -8,  4,  2,
-     4,  5, -2,  8,  8, -6,  0, 10,-20, -1,  3, -1,  8, 23,-33, -5 },
-  { -3, 11, -6,  3, -4,  5,  7,  3,  4,  5, -2,  3, -1, 30,  6,  1,
-     8, -6,  0,  0, -9,  6, -9,  4,  2,  9, -6,  1,-12,  0,-34, 18 },
-  {-17, 13,  0,  1,  9, -4,-11,  0,  7,  0,-10, -4, -1,  6, -6,  4,
-     1,  6, -9,  3, -5, -6,-11,  2, -4, 14, 23, -3,  2,  5,-30, 12 },
-  {-14,  5,-27,  2,  0,  7,  1,  4, 30,  8,  7,  5,  1, -1,  0,  5,
-     8,-10, 48,-11, 12, 33,  6,  8,-15, 20, -2, -5, 32,  5,-19, 10 },
-  {-16, -4,-12, -7, -2,  0,  8, -6,-20,-18, 16, -3,  0, 31, -2, 11,
-     2, -9, 49,-19,-12,-23, 10, 26, 16, -2,  4,-21,-14, 13,-11, -9 },
-  { -5, -9, -1,  3, -5,-21,  2, 10,  0,  0, 10,-21, -7,  7,-26, -9,
-    22, 32, 58, 11, -3, 11, -5, -8,-13,  6, -5, -9,  1, 10, 14, -8 },
-  {  7,  7, 10,  3, -2, -1,-11,-11, -6,-43, -3, 14,-19,-18, 19, 18,
-   -32, 10, 45, -6,  6, 21,-20,-12,  2,  4,  6,  6, -4,  3,  3,  1 },
-  { 21, 22, -3, -2,-11, -6, -1, -2,  8,  8, 32,-21,  7, 28, -4, -6,
-    -3, -2, 50,  2,  2, 27, -5, -8, 12,  7, -5, -1, -4,-17, 27,  6 },
-  { 13,  7,  2, -6,-12,  2,-10, -5,-17, 11,  4, 17,-12, -2,  5,-17,
-    37,-16, 48,-14,-18, 29,  8, 24, 11, -5, -9, 11, -1,  1,-13, -3 },
-  {  1,  1, -1,  2,  0,  0,  0, -1,  1, -1,  7,  2, -3,  3,  0,  6,
-     2, 10, 54,-25,  7, 54, -5, -6, -1,-15,  9, 13,-24,-15,-12,  3 },
-  { 21,  5,  8,  3, -3, -4, -2, -4,  3,-11, -5, -8,  9, 16,  8, -9,
-   -10, -3, 46,-46,  2,  1,-10, 10, 17, 11,-20,-36, 10, 14,  0, -5 },
-  {  7,-13, -6, -9,-24, 45,  2,  8,  8,  0, 17, 20, 12,-24,  1, -7,
-   -15, -3, 46,-13, -2, 20,  1,-13,-11,-13,  2, 15,  1, 10, -1,  3 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,  0, -2, -1,
-   -16, -9, 31,-69,-34, 26,  7, 17, -1, -6, -1,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -4,
-    -5,-20, 18,-82, 22,  3, -7,  9,  4,  6,  2, -4, -1,  0, -2,  2 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  4, -1,
-    15, -5, 62,-36,  4, 52, -7,  5,  0,  6,  1,  2,  1,  1, -1,  0 },
-  {  3,-19, 19,-20, 13, -4,-11,  8,  8,-16, 10,  1,-14, 30,  1,-33,
-    10,-11, 45,-30,  3, -4, -3,-13,  7, 12,  3,-22,  3, -2, -4, -2 },
-  { -1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2,  1,
-    11,  8, 70, 48,-10, 21,  4,  9, -9, -9, -4, -6,  0, -1,  0,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,
-     2, -1, 80,  2,-15,-36,-10, -5, -2,  8, -2,  2,  0,  0,  0,  0 },
-  { 10,  8, -8, -8,-24, 12, -1,  0, 20,  9, -1, -2,  2, -2, 12,-10,
-    -2,-13, 35,-43, 44, 15,-10,-25,  4, 10, -3, -5, -5,  7, -1,  3 },
-  {  1,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0, -2, -1,
-   -18,  9, 49,-72,  7, -8,  7, -5,  2,  3,  2, -2,  1, -2, -3,  1 },
-  { -1,  4, -3, 10, 19,  4,  3, 20,  6,-24,  6,  9,  8, 15, 18, 18,
-   -36, 19, 57,-11,  4, -3,  8,  7,  2, -3, -2, -9,-15, -2, 12, -4 },
-  { 20,  3, 11, -9, -4, 22, 42,-25,  1,  5,-10,-19,  0,  9,-16,  5,
-     2, 10, 44,-29, 17, -3, -9, -2, -1,  8, 14, -7, -1, 16, -5,  1 },
-  { -7, 16,-11, 12,  6, 33,-15, 14,-23,  2,-26,  8,  2, 10,  0, -5,
-     8, -8, 38,-38, -4,  5,  5,  5,  1, 22,-15,  7,  6,  0,  4, 28 },
-  { -1,-12,  2, 10, -2,  0,  7, 17, 12, 22, -4, 10, 25, 29,  5, 18,
-     4,  1, 27,-39, 31, 17,  2,  2, 22,-23, 13, 16,  1, -7, -4, -5 },
-  {  0,  1,  0,  0,  0,  0,  0,  0,  0,  0, -1,  0, -2,  0,-14,  0,
-    -7,-11, 49,-22, -4, 19, 17,-39,  4,-29, 10,  2, 36, -4, 23, -1 },
-  { -2, -2, -2, -2,  1, 15, -5, -7,-16, -8,-19, 16, -3,-20, 36, -9,
-    -3, 20, 39,-20,  0,  2, 27,-16, 10, 10,-14,-22,-16, -3, 13, -8 },
-  {  5, -9,  6,-25,  7, 37, 13,-10, -5,  3, -5,  7, 18,-22, -7,  9,
-    -5, -4, 50,-11, -4, -5, -5,  8, -4, -2, -4,-27, 14, 20,  7, -9 },
-  {  0,-14,-10,-27,-14,-17, -6, 26, 10,  2, 14,-12, -5,  0,  8,  9,
-     0,-28, 55, -7,-12, -7,  4,-10, 10,  7,-12, 11,  3,  5,  9, -8 },
-  {  2, 23,  4, -2, -1,-20, -2, 14, 10, -9, -9,-24, 10,  0, 11,-12,
-    12, 11, 49,-25, -2, 29,  7,-13, 21,-10, 11,-17,  3,  1, -8,  5 },
-  {  3,  0,-14, -6, 18, -2, 17, -9,-19,  9, -5,  9, 14,  6, 19, -3,
-    27,  1, 41,-21, 20,-15, 33,  0, 26, 14,  7, 10,  3, 20, -3,-12 },
-  { -1, 16, 15, -8,  3, -8, -8, 21, -5,-16,-29,  4,  1, -6, -4,-28,
-     2, 31, 37,-26, -2, 13, 24,  8, -9, -6,-29, 10,  7,  2,  7,  8 },
-  {-10,-10, 11, 13,-32,  2, 16,  9, 14, 23,-15,-13, 24, 13,  4,-27,
-    14, 12, 31,-18, 17, 23, -2, -7,-14,  9,-17, -6,-10, 20,  9,  6 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,
-     5,  1, 89,  8, 10, -6,  2, -1,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -1,
-     4, -7, 64,-50,  7, 37,  2,  5,  0,  0,  0,  0,  0,  0,  0,  0 },
-  { -2,  5,  3, -4, -4, -3,  2, -3,  3, -3,  5,  4,  1, -6, -1,  1,
-     6, -2, 50,-35, -7, 43,  7, -7, -5,-26, 24, 21,  3,-15,  5,  6 },
-  { -8, 21,-19, 33, -8, 22,-11, 17,  3,  0,  0, -2,  1, -3,  6, -1,
-    10, -8,  4,-11, -4, -5,  0,  8, -4,  3,  1, -4,  4,  2,  8,  4 },
-  { -7,  5,-20,  9,-22,  3,-14,  1,  6, 13, 23, -2, -4, -7,  2,  0,
-    11,  4,  6,  3, -7,-11, -7,  4,  5,  5,-12,  8,  2,  4,  7, -3 },
-  { -7,  6, -4, 20,-20, 16, -2,  7,  6, 16, 11, 12, -7, -7,  5,  3,
-    -9, -4,  1,  2,  5,  2,  1, -9, -2,-17, -4,  6,-10,  7, -7, -6 },
-  { -9, 18,-17, 12,-24,  1, -1,  4, 14,  9,  4,  3,  2,  8,-12,-14,
-     4, -8, -4,  7,  7,  6, -1, 13, -9, -4, -1,  1,  0, -4, 15,  8 },
-  {-25,  2,-11,  6, -5, 24,-28, -5,  8, 12, -2,  6,  8, -3,  8, -9,
-    -1, -5, -1, -5,  6, -1, -1, -1, -4,  8,-12, -2,-13,  7,  2,  1 },
-  {-14, 14,-18, 20,-10, 12, -2,  9,  1,  0, 12, -2, 15,-10, 26,-17,
-    16,-11, 10,-10,  9, -2,  4, -8,  2, -3,  4,  4,  2, -3, -5,  1 },
-  {-18, 12,-18, 21, -6, 12, -6, 13,-25, 18,  1, 11, -9, -5,  0, 10,
-    -5,  3, -3,  8, -9,  7,  4,  2, -9,  0,  5,  0,  2, -3,  9, -8 },
-  { -4, 16,  1, 18,-30,  9,  1,  6, -8, 13, 13,-12, -6, -1, 13,  7,
-     6,  2,-15, -3,  5,  5,  1, -6,  1, -5,  0,  2,-16,  0,  3, -4 },
-  {-21,  1, -2,  6,-43, 18, -1,  5, -1,  4,  6, -2, -1, -3, -1, -3,
-     0,  1,  2, -9,  0, -1,  0, -2,  0, -1, -1, -2,  6,  0,  1, -2 },
-  {-23, 10,  4,  7,-32,-11,-18,  2, -2, -7, -6, -3, -3,-12, 19,  3,
-    -5, -6, 16, -6, 16,  2, 16, 16,  8, -2, 13,  8,-15,-11,  2, 10 },
-  { -8,  2,-13,  2,-29, 24,-20, 19,  1, 10, -4, 10,  1,  2, -9, 11,
-    -1, -2,  9, -5, 19, -7, 16, -9, -2,-18, 11,  1,  1,  0,  7, -3 },
-  { -6,  3,  4, 13,-26, 10,-10, 28, -7, 28,  1,  7,  0,-14,  5,  7,
-     4, -4,  3, -2,  3,  3,-11,  7,  6,  4,  0, -1,  2, -1, -3,  2 },
-  { -6, 16,-31, 13,-10, 17, -6,  4,-14,  4,  4, -1,-10, 12, -5,  1,
-   -14, 15,  0, -8,  1, -5,  3,  3,  9, -5,  7,-20,  7,  4, 11, -5 },
-  {-19,  3,-17, 14,-12, 16,-22, 18, 14,  8, -2,  4, 10, 12,-14,  4,
-    -3,  2,  3,  7, -7,  7, -6,  2, -2, -4, -5,  0, -5, -2,  2,  1 },
-  { -9, -7,-11, 24,-36, -9,-11,  5,  7,-12,-13, 18, -2, 20,  1, -4,
-    -1,-10, 15, -6, 14,  1,  0,  2,  1,  2, -9,-16,-11,  7, 13,  0 },
-  {-24, 24,-18, 18,-22, 14,-11, 13,-12, 11,-10, 11, -7, 11, -5, -4,
-    -1,  1,  5,  2,  3, -1,  1, -5,  7, -4,  5, -6,  8, -7,  8, -6 },
-  { -6, 18,-22, 22,  5, 11, -1,  6, 19, 22,  8,  4, -8, 20, -2, 15,
-    -6,-18,  0,-33, -9,-12, -1,  6,  5,  2,  5,  5, -5,-17, -3, -3 },
-  {  1, 11,-16,  9,-18, 11, -4, 18, 20, 26,-10,  8,  1,-11,  8, -4,
-     0,  7,  3,  5,  2,  2, 10, -2, -4,  4, -4, -2,  1, -4, -5, -1 },
-  {-10,  6, -1, 18,-17, 27, -3, 10, -2, 12, -7, -9,  1,  1, -1,  7,
-   -12, -1, -7, -6, -1,  8,  3,-15,  8,  9,  3, -7,  4, -1,  1, -1 },
-  {-14,  6,-16, 22,  2,  5,  0,  5,-18, 11,  6, -3, 22,-20, -9, -3,
-     6, -6, -7,-15,  1, 15, -8, 11,  8, -3, -8,  1, -8,  2,  6, -2 },
-  {-21,  5,-19, 19, -7,  4, -7,  0, -8,  6, 12,  5, -3,-22,-13, -6,
-    -1, -3, -2,-14,  6, -3,  1, -8, -7, -5, -6, 11, -3,-10, -5,  2 },
-  { -1,  9,-12, 15, -6,  6,-19, 14, -9, 11,  3, 12,-17, -3,  8, -4,
-    -3, -4,  1, -5,  4,  5, -7,-15, -7, 15, -6, -5,  1, -5, -3,  1 },
-  {-12, 20,-15, 20,-14,  3,-14,  9, -6, 33,-13,  6, -2,  8, -6,  7,
-    -5, -6, -3, -3,  0,  8, -3, -3,  1, -2,  2,  2,  6, -5, -5, -2 },
-  { -7, 12,-18, 12,-18, 10, -4,  8,  2,  4,  8,  9,  0,  3, -8,  3,
-     6,-12, -4,  1, 25, -5, -9,  6, -7,  0, -9, -7,  3, -5, -4, -4 },
-  {-18, 12,-10, 11,-22,  0,-15,  5, -2,  2, -3,  6, -4, -4, -3,-15,
-    -2, -3, 21,  6,-12,-11, 19,  3,  3,-14,  7,  0,-11,-22,-10,  0 },
-  {-15,  2,-30, 15,-17, 13,-16,  8, -7, 10, -8,  2, 11,  3, 10, -7,
-     7,-22, 12,-10,  3,-12,  6,-10, 12,-10,  7, -8,  5,  2,  9,  1 },
-  { -9, 11,-14,  6,-10, 21,  5, 12, -5,  5,  7, 21,  6,  2, -2, -1,
-    -1,  4,  2,-20,-18, -1,-14,  3, -1,  4, -7, 10,  1, 11,  4, -4 },
-  {-22,  8,-30, 13,-21, -4,  4, -1, 12,  9, -2, -3,  2, -6,  4,-13,
-    -2,  8,  8,  1, -7,  3, -4, -5, -1, -7, -2,  8,  8,  7,  8,  0 },
-  { -6, -4,-35, 16,-13, 15,-11, 14, -7,  9, -1, 11,  7,  0, 13, 10,
-    -1,  8,  1,  1, -2,  8, -1,  2,  2,  3,-10, -1,  7,-13, -3, -7 },
-  {-15,  7,-16, 14,-18, 17, -6, 14,  3,  4,  7, -3, 10,-22,  5,-15,
-     4, -4,-11, 15,-15, 11,-11, 20,  1,  0,  2,  1, 11, -3, 11, -7 },
-  {-12,  3,  5, 16,-37, -1, 15, 15,-15, 10,  3,-10,  1, 15,  7,-15,
-   -13,  8,  9, -3,  2, 12, -8,  2, -5,  0, -3,  4,  5, -9, -4,  5 },
-  {-16, 26, -4, 14,-22, 26,  6, -3, -8,  4, 21,  6, 16, -4,-11,  7,
-   -10,  3,  3,  7, -4,  2, -9,  8, -2,  2,  5, -2, -4, -2,  7, -1 },
-  { -7,-10,  4,  3,  2, -4,-12,-10, -4, -5, 16, 19,-16,  1,  2, -9,
-   -10,  0,  9,  7, -8,  3, 12,  8, -6,-11,-13, -1, -3,-20,  6, -5 },
-  {-14,-17,  3, -5, 14,-12,-12,  8, -6,-25, 21, 21, 10, -8,-12,  4,
-    10, -4,  3, -9, 11,  9,  0,  4,  2,-15,  1,-14,  4,  1,  0, -4 },
-  { -4, -9, -3, -1,  6,  3, -6,  6,-10, -4, 14,  8,  2, -3,-12,-19,
-     0, 11,-20,  1,  6, -2,-27, -6, 10,-17,-14,-17, -9,  8, -8,  3 },
-  {-12,-13, 16, -4, -2, 12, -7,-11,  2,-13,  3,  7,-16,-18, -1,-12,
-    -2,  1,-12, -9, -2, -6,  2,  9,-22, -3, -4,-14, -7,  7, -1,  2 },
-  { -7, -8, -8, 15, 15, 18, 15, 16, -4,-37, 11, 15,-12, -1, -3,  3,
-     6,  6,  0, -5, -3, -5,  9,  1,  1,-11, -1, -8, -6,  2,  3,  0 },
-  { -6,  7, -5,-12, 13, 10,-18, -4, -3,-21,  6, 16,-15, -7,-12, -9,
-     1,-12, -1, 10, -2, -1, -3,  4, -4,  1,-16, -1, 12, -9,  5,  9 },
-  {-14, -5,  9,  3,  4, 26,-28,  3, -6,-24,  4,  5,  3, 13,  5, -1,
-     3, -1,  3,  1,  1, -5,  3,  0, -7, -8, -7, -3,  3, -5,  4,  0 },
-  { -4,  2,-10, -6, 25, 26, -6, 10, -6, -8, 15, 11, -6, -3,  2, -7,
-     5, 14,  9, -1,  0,-12,  4, -4,-10,  1, -3,  3, -2, -2, -6, -1 },
-  {-10,  8,-15,-10, 19, 17, -8,  0, -3, -7,  7,  5,-13, -1,  7, -7,
-     1, 13,-12,-13, 17,-12,  1, 26,-18, -3, -5, -6,  4,  5,  8,  1 },
-  {  2, -5,  3,  0,  0,  0,  2, -3, -2, -5,  7, 13, -4,  9,  0, -5,
-     4, -1,-11, -8, -4,  0,-13,  2,-47,-23, -8,-11, -4,  4, -2, -3 },
-  {-18, -4,  4,  5, -1, 17,-12, -8,  1,-12,  7, 20,-12,  3, -2,-11,
-    16, 12, -6,  1,-13,-16, -6, -3, -3, -5,  4,-12, -5, -9, 10,  1 },
-  {-11,  0,  4,  7,  7,  8,  3, -1,  3,-19, 32,  8,-19, -8,  2,  4,
-   -12, 15,-16,  3,  1,  9, -2,  1, -2,  8,  5,  6, -4, -1, 11, -8 },
-  {  3, -1,  4, -2, 14, 32, -9,-23,-10,-12, 22, 15, -1, -2, 10,  0,
-     4,  6, -8,  4,-15, -2, -1, -4,  0, -8,  4,  1, -8,  3,  4,  1 },
-  {-17,-12,  6, -8, 16, 13,-20, -8, -1,-16, 10, 21,-19, 11, -9, -5,
-     7, 18, -6,  7, -7,-18, 13,  2, -2,  8,-12, -9,  2,  4, -5, 16 },
-  {  4,  0, 17,-11, 12,  7,-12,  5, -1,-25, 30, -8, -7, -6, -4, -7,
-     9,  8,  7,  3,  3,-16,  8,  0, -2, -2,-18, -3, -4, -5,  1,  4 },
-  { -3, -6,  6,-16, 17,  6, -3,  2, -9,-17, 12, 11, 11,  2,-20,  8,
-     1,  1,  0,  2, -2, -6,-21,-13, -9,-15, -1, -8, -6, -8,  0, -2 },
-  {-11, -7,  6, -9,  3,  6,  8, 16,  4, -5, 23, 26,-10, -3,  4,  0,
-     2,  2, -4,  4, -2,-12, 12, 10,-11,  0,-10,-16,  3,  0,  0,-10 },
-  { -5,-16, 10, -6, 27, 13, -3,  4, -2,-13, 15,  5,  2,  5,  3, -4,
-    13, 12,-11, -7,  0,  1, 11, 12,  2, 13,-15, -8,  9, -2,  3,  8 },
-  { -5, -8,  4,  3,  9,  3,-11, 10, 14,-25, 14,  8, -2,  5,-12,-21,
-     2, 10, -7,  2, -3,  2,  0,  2, -1, -3, -5, -6, -1,-16,  2,  8 },
-  { -1,  5,  1,-11,  5,  9, -7,  8,-13,-12,  4, 12, -4,  1, -1, -1,
-    27, 29, 10, 15,  2, -6, -3,  4,-21, 10, -9,-11, -6, -1, -9, -3 },
-  { -6, -3, -1, -6, 11, -5,  0, -2, -5,-31, 11,  3, -1,  5, -3,  4,
-     5,  7,-10,  5,-10,-13,  4, 12,-15, -2,  2, -7,  1, -9, -3,-10 },
-  { -3, -7, 17, -8, -5, 36,  8, -7, -8,-20, 12,  8,  1, -1,  3,  0,
-     1,  4,-10,  3,  1,  4, -2, -3, -2, -3,-10,  4, -1, -7,  3,  2 },
-  {-13, -3, -5,  9, 22,  6,-23,  3,-10, -7, 17, 17, 18,-14, -8, -8,
-     2,  4, -8,  2, -3, -8,  6,  4, -1,  7,  0,  0, -3,  0,-12, -3 },
-  { -3,-10,-15, -3,  9,  3,-23, -9,-13,-18, 12, 13, -2,  0,  1,  8,
-    -1,  2, -7,-12, -5, 14,  2,  1,-22,  6,-10, -8, -9, 28, -7,-14 },
-  { -3,  1,  2, -1, 13,  7, -2, -7,  1, -3,  6,  9, -3, -2,  4, -2,
-     2,  1,-10, -2, -2,-22, -2, -7,-10, -5,-11,-27,-12,-16,  4, -7 },
-  {  2, -6, -3,  1,  8,  0, -2, 12, -3, -4, 58, 15,-10, -4, -2,  2,
-    -2,  0, -2, -6,  2,  4, -1,  1, -4,  1, -1, -5, -4, -3,  3,  1 },
-  { 10, -1,  0,  5, 21,  7,-14,  6, -3,-16, 15, 17,-16, 13,  3, -6,
-    -4,  6,-12, -5,  1, -4, -7, -8,  2,  3, -6,  6, -1, -8,  5,  4 },
-  { -6, -2, -8,-11, 15, 10,  0,  8, -6,-15, 33,  8, -2, 18,-15,-11,
-     5, -1,  0, 15,-15, -4, -4, -1, 10,  7,-13,  4, -4,  0,  8,  3 },
-  { -7, -2,  0, -2,  0, -2, -4, -5,-14,-16, 12, 38,  7, 12,  6, -4,
-     0, -1,  0,  3, -2, -6,  0,  2, -9,  1,  0, -1,  0, -2,  4,  1 },
-  { -8, -4, 18,  1, 14,  5,-12, -3, 20,-17,  5, 19,-11, -8, 11, -3,
-     3,  9, -7, -8,  9,-17,  2, 15,-10,-11,  5, -5,  7, 15, -6, -2 },
-  { -7,  2, 38,  5, 19, 16, -5,  4,-13,-20,  0,  4, -4,  6,  4,  2,
-    -7,  6, -8, -2, -5, -7,  6,  3, -4, -3, -2, -3,  7, -6, -4,  0 },
-  {-11,-12,  8,-15, -3, 14, -7,-22,-11,  2, 22, 14,-19,  2,-19, -6,
-     1,  3,-18, 14,  2, -6, -2, -8, -3, -6,  5, -7, -8, -4,  1,  1 },
-  {  8,  7, 25,-21, 12, -6, -5, -4,-10,  6,  0, 10,  1,-12, 18, -5,
-   -15,  4,  1, 14, -1,  5,  8, -7,  1, -7, -3,  9, 10,  1, -1,  0 },
-  {  9, 10, 32,-15,  8,  2, 11, -7,-18, -8,  2, -6, -9,-16, -3,  3,
-    -1,  3,  1, -5,  4, -2,  1, -8,  0, -6, -3,-11,  1,  5,  0,  0 },
-  { 14,  0, 23,-25, 22,  3,  7, 10,  0, -2,  7,  8,  0, 10,  0,  0,
-     3,  2,  3,-10,  0, 10,  0, -7,  0, 10, -1, -5, -7,  1, -1,  2 },
-  { 12,  0, 25,-18, -5, -4, 13,-10,  3, -6,  7, 21,  0,-16,  3,-10,
-    -6,  5, -7, -3,  2,  5,  3, -6,  4,  9, -8, 12, -2,  3,  2,  4 },
-  { 31, 15, 27,-20, 10, -7, 15,-10,  9, -8,  4, -5,  3, -3,  5,  6,
-    11, -2,-12, -2,  6, -2,  1,  2, -1, -1,  1,  1,  3,  1,  1,  2 },
-  { 12, -4, 13,-23, 12, -6,  2,  4, -3, 13,  6, -7,  5,-19, -7, 18,
-     1, -7,  7,  1, 16, -7,  3,  0,  3,  0,-12,  8,-11,  9,  4,  7 },
-  { 29,  1,  3,-22, -5,  6,  0, 12,-14, 11,  1,  6, -3,  4,  6, -2,
-     4,-13, 12,  1,  1,  3,-11,  9,-10, -1, -7, 16,-11, -1,  3,  9 },
-  {  4,  4, 36,-23, -5, -8,-15,  1, -6,  3, 13, -1, -5, -7,  4,  9,
-     2,-11, -3,  5,  1,  3, -6, -1, -4, -4, -2,  2,  3, -1, -5, -2 },
-  { 19, 10,  6,-17,  2, -4, -2, -4, -3, 13,  2,  2,-13, -7, -3,-11,
-     9, -6,  1, -9, -5,  4, -5, -9,-18, -7,-11,  9,  4,-11,  8,  4 },
-  { 16, -3,  9,-16, 18, -2,-12,-16,-11, 11,-18, 16,-13,  6,  2,  8,
-     3,  8, -4,-16, 10,-11, -1, -3, -8,  5, -9, -4,  9, -4,  0, -3 },
-  { 14, 15,  3,-23, -5,  7, -8, -6,  2, 17,  2, 12, -8,-12, 13, -1,
-    -9,  3,  1,  1, 19, 15,  4, -1,  1,  2, -3,  2, -3,  1,  5,  3 },
-  { 32,  5,-10,-47, -5, -1,  4, 11, -7,  0,  2, -2,  1, -7,  6, -4,
-     6,  2, -4, -2,  2, -2,  0, -4,  1, -6, -5,  2, -2, -1, -3, -4 },
-  { 20,  8, 10,-21, -7, -9,-16, 12,  1,  4,  6, -5,  9,-11, -7,  4,
-   -11, 28, -3,  2,  4, -6, 10, -8, -5, -5, -9,  9, -2, -1,  6, -5 },
-  { 38,  3, 23,-25, -6,-18,  3,-10, -8,  6,-10,  1,-10,  2,  2,  0,
-    -7,  2, -4,  5, -1,  8, -3,  0,  3,  3, -1,  1,  0, -4, -4,  0 },
-  { 20,  5, 16,-22, 24,-18,  2,-12,-14, -7, -3, 10,  2,  7,-10,  2,
-    -8,  1,  8, -1,  4,  1,  4, -2,  5, -9,-18, -8,-13,  5,-11, 10 },
-  { 14,  8,-12,-16,  9,-11, -3, -6,-25, -7,  6,  5, -7,-16, 10,  2,
-    -7, -1, -9, -3, 16,  4,  3,  3, -3, -3,-15, 13, -3,  4, 13, -7 },
-  { 16, -9, 19,-23,  7,-19, -3, -5,-15, 11,-21, 21,-16, 18, -1,  6,
-    10,-10, 18,-14, 16,-15,  6, -5, -9,  5,-17, 13,-10, 13,  0, 10 },
-  {  8, -4,  4,-24,  8,-21,-18,  9,-11,  4, -6, 17,  5, -9, -2, -2,
-     2, 15, -2, -3, -2,  1,  7,-13, 15,-10, -8,-11,  3,  3, -1, -1 },
-  { 14, 17,  6,-32,  5,-17, -2,  0, 15, -1, -5, 16,  1, -5, -2,  9,
-    -3,  8,  4, -2, -2, -4, -3,  1,  0,  7, -3,  4, -5,  0, -7,  2 },
-  { 24,  6, 22,-12,  8,  3,-14,  4, -7,  8,  6,  5,  6,  1,  6,-12,
-    15, 10,  4, 11,  9,  6, -7, -4, 10, -9,  2, -1, -5, 11, 15,  3 },
-  { 17, 12,  3,-23,  5, -1, -2,  1, -9, -1, -3,  1,  8,  1, -5, 17,
-    11,  0, -2,-11,  7,  4,  0,-27, -7,  1,  2, -8,  9,  7,  5,  3 },
-  { 12, 10, 12,-10, -4,  5, -1,  2,-24,  5, -8,  2,  6,-17, 19,  5,
-    12, -2, 16, -7, -6,-14,  4,  1, -3, 13,-16,  5, -1,  4,  1,  1 },
-  { 31,  9, 11,-17, 10, -3, -7,  7,  1,  2,  2,  4, -3, -1, 11,  4,
-    -5, -8,  1,  4, 15, -6,-28,  1,  8,  3, -6,  5, 17, -2,  2, -4 },
-  { 11, 19, 16,-26,  0, -7, -7,  2,-13,-15,-12,  9, -3, 27,  8,  4,
-    -6,  1,  4, -6, 11, -1, -6, -7, -3,  0, -6,  4, -6, -7, -3, -1 },
-  { 10, 18, 16,-32, 19, -9, -4, -3, -7,  8,  8, -3,-11, -2, -6,-16,
-    13, 13, -6, -1, 10, -2, -2, -9,  0, -3,  9,  4, 11, -2, -6,  6 },
-  {  9,  4, 19,-33,  4,  7,-12, 36, -3, -1,  8, -2,  2, -8, -9, -4,
-    -8,  0,  1, -1,  0, -4, -4,  3,  0,  3,  6,  0, -6,  2,  0, -2 },
-  { 25,  7, 15,-12,  2,-24, -1, 24, -4,  4,  9,  0, -2, -9,  4,  6,
-     3, 13, -3,  1,  5, -1, -3, -5, -1,  7, -2,  3,  4,  4,  1,  0 },
-  { 19,  6,  8,-20,  9, -9,  5, -4,-13,  7, 11, -3,  5,-13, -9,  6,
-   -11, -1,  0,  4, 11, 26,  3,  6, -7, 12,  6, -3,  1, -9,  7,  1 },
-  { 15,  6, 19,-23, -3, -9,  3, 16, -6, -4,  6, -5,-10,  1, 16,-14,
-     2,  0,  2,-13, -3,  8, -6,  3,  1,  1,  2, -5, 12, -4, -8, -3 },
-  { 14,  4, 16,-20,  1, 12,  0,  6, -3,  9,  4, 16, 10,-16,  5,  7,
-     5, -4, -4,-18, -3,-11, -4,  4, -7,  3, 13,  7,  3,  3,  2, -7 },
-  { 22,  3, -1,-30, 18, -3, -9,  9, -2, 11,-16, -2,-14, 12,  0,  4,
-    -5,  4, -1,  3,-20, 12,  4,-10, -2, -2,-12,-12, 10,  6, 11, -3 },
-  { 15,  7,  2,-21,  5,  4,  9, -9,-33,  7,  7,  3, -6,-14, -8, 10,
-    12,  0,  2, -1,  5,  4, -2,  0, -7,  0,  2,  4,  0,  1, -3,  8 },
-  { -7,  0, 12,  3,  0, -6,  8, -4,  0,  2, 14,-15,  2, -7,-31, -3,
-    14,  0, 14,-15, -1, -4,-15, 10,  1, -3,  1,  2,  5,  2, -8,  1 },
-  { -2,  5,  1,  0, -3,  3,  3, -6, -1,  2, -4,  1,-19,  0,-11, 18,
-    11, 10, 21,  5,  6,  2, 10,  3, -6,  0, -2, 13,  5, -1, -2,  9 },
-  { -9,  1, -5,  0,  0,-15,  8,  4,  8,  3,  8, 12,-13, -2,-39, -2,
-     4, -4,  5, -3, -4,  3, -3,  3, 10,  5,  3,  2, -3,  5, -2,  8 },
-  { -9,  6,  6, -8, 12,-12, 23,-18,  4,-15, -5,  2,-20, 13, -7,  7,
-     7,-12, 14,-12,  6,  1,  1, -3, -8,  9,  0,  1, -7,  3,  7, -6 },
-  {-18, 13,  4,  3,-10,-30,-10, -6,-14,  1, -7, -4,-35,  5,-25, 11,
-     9,  8, 19, -4, -7, -3,-18, -8,  1,  5, 10, -4,-14, -9,  3, -4 },
-  { -6, -1,  4, -9, -9,  4, 20,  0,  0,  3, 11,  7,-16,-17,-20, 11,
-    -6,-14,  1,  4, 19,  2, -8,  6,-15,  3,  6, -5,-14,  3,  7,  2 },
-  {  1,  6, -2, -8, -5, -3,  3, -8, 21,  1,  3, 16,-14, -2, -9, -4,
-    13, -2, 18, 14, 14, 19,-13,  5,-10,  2, -3,  3,  5,  5,  1, -1 },
-  { -1, -5, -6, -2,-11, -7,  5, -4,  5, -1,  0,  3, -3,  2,-19, 18,
-    16,  4, 14,-22, -2,-11,-22,  1, -1, 11,  1,  2, 11,-10,  7,-12 },
-  {  1,  4,  5, -1, -9, -5,  1, 12,  5,  6, 12,  9,-24, 23,  1, 20,
-    14,-11, 13,  5, -2, -2,  5,  6,  2,  1, -9,  6, 10,  5, -4, 11 },
-  { -1, -1,  1,  7, -3, -4,  8,-16, 15, -1, -7,  9,-22,-11,-11, 10,
-    16,  9, -2,  4, 13, 10,  6, 16,  4,  7,  1, -8, -7,-14, -7,  4 },
-  {  1,  3, -6,  0, 15, -9, -4,  0,  4,  6, 12,  9, -6, -5,-22, 17,
-     7,-11, 15, -5,  1,  3,-19,  0,-15, -3, 16,  5,  5, -7,-11, 12 },
-  { -2, -1, 13,  2,  4,-24, 37, -5, -2, -6, 12,  7, -2,-23, -4,  9,
-     2, -3,  3,  2,  3,  3,-14, 11,  0, -4, -2, -2,  3, 10,-10,  4 },
-  {  2,  9,  8, -6,-28, 14, 28,-11, 18,-11,  0,  2, -2,  4,-12,  3,
-     6,  0,  7, -7, -6,  2,  5, -1, -1, -1,  5,  2,  3,  0, -3,  9 },
-  { -7, 14,  5,-10, -3,  7,  4, -5,  7, -8, -7,  4,-12, 14,-16, 25,
-     3,  0,  1, -5, 12,-10,  0,-10,  0, 12, 12, 17, 12, 10, -1,  0 },
-  { -4, -2,  5, -2,-17, -3,  5, -5,  7,-17,  1,  5, -4,  4,-20,  0,
-    11,-15, 13, -8, 10,  1,  1,  5,-12,  9, -8,  0,  6, -1,-11,  4 },
-  { -3, 12, 13,-15, -7, -7,  0,  5, 33,  3,  3, -6,-13, -7,-15, 10,
-     3,  3,  3, -5,  2,  7, -1,  0,-12,  2, 11, -6, -9,  0,  5, 11 },
-  { -8,  5, 10, -7,-14, -4, 13,  0, 18, -3, -6,  7,  1, -6,  0, 21,
-     8, -7, 10, -8, -3, 17, -9,  0, -5,  1,  4,  8, -3, 11, -5,  0 },
-  { -8,  8, -3, -8,  8,-11, 16,-16, 17,  0,  8, 16,-17, 10,-16, 10,
-    -8,  6, 11,  0, 10,  7,  4,  5,  7, -5, -5, -6, -7, -5, -1, 16 },
-  { -6,  0,  6,  1, -8, -8,  8, -7, -5,-10,-11,  8,-19,  6, -7, 13,
-     5, -3,  4, -8,  7, -1,-18,  9,  0, -5,  6, 26,  3,  8,  2,  4 },
-  { -2, -2, 23, -2,-20,  2,  7, -7, -6,-15,  3,  9,-19, -2,-10,  7,
-    -2,  7,  9, 11,  0,  4, -4,  6,  9, -2,  4, -3,  4,  3,  2,  8 },
-  { -6, 12, 10,-10, -7,  4, 17, 11, -6,  1, 12, 11,-18,  8,-12,  4,
-     1, 13,  6,-13, 23,  9, -5,  8, -2, -5,  1,  3,  0, -2, -4,  4 },
-  {  7,  1,  7,-17, -8,  8, -1, -7,  5, -6,  4, -3,-16,  9,-24, 18,
-    -3, 10, 13,-11, -6,-11, -4, 10,  0, 11,  8,  2,  6, -5,-11,  4 },
-  { -4,  1, -5,-10,  0, -3,  9, -2,  4, -1,  1,  5,-41,-10, -7,  4,
-    -3,  3,  1,  0,-12,  4, -3,  0,  2, -1, -2, -5,  3,  2, -7,  5 },
-  { -2,  1,  4,  4, -3, -6,  1,  0, 12, -5, 11,  0,-17, -3, -1, 11,
-     4,  1, 27,-12,  0,-14,  2,-15, -3, -9,  0, -7, -3, 15, -8,  6 },
-  { -6,  4,  9,  2,  4,  3,  7,-10, 28,  1, -2, 48,  7,  0,-10, 10,
-     1, -9,  2, -1,  0,  3, -5,  5, -4, -2,  7,  7,  1,  3,  2,  5 },
-  { -3,  3, -1,  3, -9,  0, -1,  3,  2, -6, 39,-14,-12,  5,-19, 21,
-     7, -6,  4, -1, -4,  0, -4,  1,  0, -9,  1, 10,  0, -2,  0,  7 },
-  {  4,  2,-29, 12,  5, -3, 16, -6, 15,-13, -4, -1,-13, 22,-16, 17,
-    16,  4,  9, -4,  4, -6, -4, 11, -8,  7,  8,  4,  3, -3, -7,-13 },
-  {  0,  3,  3, -6, -4,  0,  9,  0,  5,  0, 10, 10,  4,-13,-12, 16,
-    23, -4,-12, -6, -4, 20,  2,  0, -4, 23,  1,  8, 11, -4, -5, 15 },
-  { -6,  4,-15, -9, -1,-19, 12,-30,-17, -4,  1,-13,-13,  4, -3, 26,
-     5,-25, 11,-14, -6,-13,  0, -7,  9,  2,  8, -1, -8,  1, -8, 13 },
-  {  1,  6,  1, -4, -4,  1,  2,  0, -3,  2, 10,  6, -6, -2,-11,  4,
-    32, 15, 15,-47, -8,  3,-12,  4, -5,  4, -1,  0, -5,  5,  1, -7 },
-  {  2, -1,  0,  0, -1, -6,  0, -6,  4, -4,  5,  9, -5,  1, -3, 51,
-     4, -5,  4,-14, -1, -4, -3,  1, -4, -1,  0,  2, -8,  0,  1,  2 },
-  {  0,  4, -2, -7, -2, -9,  6, -8, 11, -3, -6,  3,-11, -8,-12,  8,
-    11,  5, 19,  3,-24, 19,-14, 11, -5,-18, -8,-12, -5, -4, -1,  4 },
-  { 16,  9, 10, 14,-18, -2,-18,-27, 10, -5, 12, 14,  4,  0, -2, -6,
-   -12, -7, -1,  3,  4,  7, 11, 10,  5, -5, -7,-16, -3, -6,  6,  9 },
-  {  7, 15, -9, 10,-19,  4, -5,-37, -2, -4,  8,  2,  4, -1,  1,  9,
-    -5, -5,-12,  1, -1, -8,  3, -3,  4,  6,  9,  3,  3, -1,  2,  4 },
-  { 13, 17,  3,  9, -7, -7,-15,-17, -8,-13, -4, -8, 19,  2, 16, 25,
-     7, 15,  2, 16, -5, -6,-10, -9, -7, -6, -2, -7,  7,  2,  4,  5 },
-  { 24,  7,  9,  8,-13, -2,  0, -4,  1,-13,  3,  6,  7, 10, -4, 15,
-     5,  7, -4,  5, -5,  3, 13, -7,  5, 15,-11, -2,  7,  5,  8,  6 },
-  { 17,  6,-15, 23, -2, -1, -6, -2,  0, -4, 11, -3, 12, 15,  6, -8,
-   -15, 10, -9,  7, -1,-11,  2, -8, -4,  3,  4,-10,  4,  4, 11,  1 },
-  { 21, 12, -3,  6, -8,  8,-11, -8, -5, -5,  3,  7, -1, -5, 12, 15,
-   -10,-11,  3, 15,  8,  4,  2,-15,  0, 14,  1, -8, -1,  3, 10, -7 },
-  { 16, 12,  5, 13, -6, 15,-23,  0,-17, -9,  0,  4, -9, 13,  6, 18,
-     0,  0, -4, -1,  0, 14,  5, -1,  8, -4, -8, -6,  5, -2, -2,  0 },
-  { 14, 16, -1, 12,-15, -9, -6,-20,  4,  6,  8,  9,  3,  1, -9, -4,
-    -1,-11,  9, 11,-12,  1,-14, -7,  2, -8, 11,  9, -4, 10,  4,-16 },
-  { 13, 10,  3,  7,  0, -8,-33, -6,  4, -4, 19, -2, 14,  6,  5,  7,
-     6, -3, -1,-10,-10, -9,  4, -3,  5,  9,  2,  2, 10,  9, -2, -3 },
-  { 11, 10, 25, 18, -1, -6,-21,-21,-11,-16,  6,  5, 14,  4,  8,  7,
-     0,-10, -7, -9, -5, -4,  3, -1,  1,  6, -1,  6, -2,  2, -3, -9 },
-  { 15,  9,  5, 22,-17, 15, -9,  7,  7, -9, 13,  9, 10, -1,  8, -3,
-    -2,  6,  1, 17,  8,-14,  7, -3, 12,  9,  1,  0,  1, -5, 17,-18 },
-  { 25, 19,-17, 12, -4,-10,  1,-13,-19, -7, -3,  9,  6, -2,  3,  1,
-     4, -2,-11,-14, -1, -7, -5, -9,  7, -1, -3,  4, -5,  1,  0, -1 },
-  { 20,  8, -3,-10,-24,  3, -6, -2,  0,-12, 14,  6,  7, 11,  4,  7,
-   -12, -5, -8,-10,  5, -1, -4,  4, 16,  7,-14,  6, -1, -2, -7,-11 },
-  { 16, 18, 17,  1,-15, -6, -5, -3, -1,-19,  8, -2,  2,  8, 12,-19,
-   -12,  8,  0, -3, -1, -1,  4,-14,  9, -1,-12, -1, -7, 10, -3,  5 },
-  { 18, 12, -7,  7,  0, -3,-13,  0, -1, -4,  9, -2,  6, -1,  0,  1,
-    15,-21,  1, -8, 25,-19, 13, -9,  2, 12,  5, -7, -3, -1, -3,  1 },
-  { 13, 16, -4,  9, -2,  2, -1,-19, -7, -4, 18, -6, 14, 18, -5,  4,
-    -6, -3,-19,-14, -1,-12, 10,  6,  7, 17,-12,-13,-10, -4,  5,  4 },
-  { 27, 17,  4, 14, -9, -2, -4, -8,  0, -6, 14,-11, -7,  2, -3, -3,
-    -2, -3,-13, 12, 16,  1, -5, -9,-10,-11, -2,  3, -7,  5, 11, -7 },
-  {  7, 17,-16, -2,-14,-28, -7, -8, 15,-10,  7, 15,  8, 17, 13, -1,
-     4, -7,-12,-11,  0,  0,  2,  3, -3,  7, -6,  6,  1,-16,  1, -2 },
-  { 23, 11, -9, 15,-23, -4, -6, -4,  2, -9, -7,  9, -8,  3,-13, -4,
-     8, 18, -6, -2,  1, -5,  6,-14, -5, -2, -6, -5, -3, -2,  4, -5 },
-  { 12, 13, 18, 18,-35,  2,  7,-17,  3,-11,  6,  9, -3, -2, 10, -4,
-     3,  3, -2, -7,  0,  2, -4,  0, -4,  0, -6,  5, 10,  4, -3, -1 },
-  { 19, 11,  1, 20,-14,  4, -9,-13, -2, 11,  0, 17, -1, -1, -1, -1,
-    -5, -8,  0,  5, -1, -8,  5, -1,  3,  2,-12, 21, -2,-24,  5,  7 },
-  { 15, 15,-15, 17,-14,-22,  3, -4,-11, -3, -7,  1, 18, 10,  1, 10,
-    -6, -3,  8,  2, -7,  0, -2,  1,  1,  2, -9, -2,  1,  2, -3,  4 },
-  { 45, 13,  8, 17, -5,  2,-16,  2,  8, -2,  8,-15,  4,  5, -1,  7,
-    -6, -2, -6,  2, -3,  0,  0, -9, -1,  7,  2,  3, -3, -3, -1,  5 },
-  {  1, 18, -8, 18,-12,-10,  3,  4,-22,-12, 20,  8, -3,  9,  2, 10,
-   -10, -3,  9,  3,  6, -3, 10, -1, -3,  2, -2,  4,  2,  3, -3,-18 },
-  {  9, 10, -5,  9,-35,-21,-18,-16, -1,-12, -6, -7,-15,-19, 12,  4,
-     4,  9, -7,  2, 14,  1,  4,  0, -1,  6, -7,  2,  1,  1, -4,  4 },
-  { 31,  8,-17, 35, -8,  1, -5, -6, -7, -6, 10, -2, -3,  6,  9,  3,
-    -6, -2,  3,  3,  5, -3,  0,  6,  0,  1, -5, -3, -2, -4, -1,  0 },
-  { 18,  4, -8,  7, -8,-15, -1,-16, 12, 18,  3, 19,  2,  4,  8,  8,
-     0, -5, -8,-12, 10, -5,  0,  1,  0,  4, -3, 16, 11, 11, -2, -6 },
-  { 27, 15,-17,-10,-23,-22, -1,-14, -4, -7, 20, -2, -7,  6, 15, -5,
-    32,  4,  9,-11, -3, -8, 11, -4, -1, -4, -8, -6, -4, -5, -2, -7 },
-  { 22,  4, -7,  2,-15,-11,-17,-10,  2,  0, 15, 11,  7, 12, -8,  6,
-   -10,-18, -6,-12,  7,  3, 22,  3, -7, 14, -5, -2,-13, -7, -1, -7 },
-  { 18, 13,  9, 24, -4,-19, -9,-11, 13,  8,  2,  4, -1,  8, 14, 10,
-   -12,  0,  0,  5, 10,  5,  4, -1,  5,  1, -1, 11,  2, -4,  0, -9 },
-  { 15, 19, -5,  1, -4,-10, -8,-27,  6,  8,  5, 10,  4, 11,  5, -5,
-   -11,  0,-11,-14, -4, -9, -8, -8,  6, -9,  4, -5, -1,  1,  5, -4 },
-  { 18,  1,-13, 14,-14,  9,-15, -7, 12,  1, 13, -4,-20, 12, 10, 12,
-   -12,  7,  1,-13, 10, -6,  5, -3,  4,  8, 10,-13, -3, -6,  9, -3 },
-  { 19,-14,  5, -8, -6,  2, -5,  5, -3, -1,-28, 11, 18, -6, -4, -2,
-    11, 14,-43,-42,  9,  2, 20,-23,  6, 32,  0,  5,  0,  6,  9,  5 },
-  {  8, 11,-14, -1,  7, 12, -7,  2,-16,  2, 10, -3, -1, -7, -7, -1,
-     1,-10,-60,-23,-18, 42,-13,  9, 18,-11,  0,  1,  0,  2, -5,  1 },
-  { -5, -1,  2,  0,  3, -3,  3, -2, -6,  0, -3, -3,  7,  2,  0, -2,
-    -2,  3,-34,-15, 37, 47, 10, 20,  9,  1,  3,-21,-25,-33,-14,  8 },
-  {  5,  6,  2, -2, -2, -2,  6,  5, -5,  7, -3,  1, -5,-13,  9,  3,
-   -17,-19, -2,-79,-12, -7, -8, -6, -2, -2, -1, -1, -7,-13,  6, -1 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1, -1,
-     0,  3,  4,-87,  6,-11, 16, -9, -1,  8,  0,  5,  0,  1,  2,  1 },
-  { -5,  6,  2,-24,  5, -9, -7,  0,  7,  3, -3, 16,-14,-16,  0, 18,
-    15, -9,-14,-28,-17, 53, 14, -6,-28, -1, -3,-10, -7,-14, 19,-15 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -3,  0,
-   -13,  0,-53,  3,-22, 63, 19, 16,  1,-11,  0, -3,  0, -3,  0,  1 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1, -1,
-    -1, -6,-43,-43, -2, 65,-13, -4,  9,  1,  1,  2,  1,  0,  0,  1 },
-  {  0,  1,  0,  0, -1,  0,  1,  1,  0,  0,  1,  2, -1, -1, -3, -1,
-   -23,  1,-61,-55,  3,-28, -6, -4, -4,  8,  2,  1,  1, -1,  0,  0 },
-  {  0,  1, -1,  1, -1,  0, -1,  0,  1, -1,  0,  1, -1,  0, -9, -4,
-   -48,-19,-52,-46, 11,-12,  5,-14,  0,-10,  0,  0, -1, -2, -1,  0 },
-  {  0, -3, -1, -4,  2, -1, -7,  3,  1,  3, -1,  1, -3,  0, -7,  0,
-     3, -7,-61,-51, -4,-21,-16,-21,-11, 14, -7,  8,  3, -5,  1,  2 },
-  {  0,  0,  0,  1,  0,  0, -1,  0,  0,  0,  0,  0,  1, -1,  9, -3,
-    56,-11, -6,-67, -1, 13,  0,  7,  1, -9, -1, -1,  0,  0,  1,  0 },
-  { 14,  9, -2, 14,-10,-10,  9, -5,  1, -8,-23, 30,  8, -7, 23,  8,
-     2, 10, -1,-27,-17, 57, 22,  4, -5,  2,-12, -6,  2, -7, -4, -9 },
-  {  1,  5, 12, -2, -2, -3,  2, -3,  6,  0,  4, -2, -8, -6,  0, 16,
-   -15, 29,-55,-29,-24, 29,  3, 10,  6, 13, 10, -5, 21, 11,-14,  5 },
-  {  4,  2, 26, -6, 10, 11,-23,-10,-27,-20,  3,-24,-11,-10,-13, 25,
-   -10,  5, -9,-36, -7, 43,  3,-13,  6, 13, -2,  0,  1,  3, -3, -4 },
-  { -1,  0, -1,  0,  0,  0,  0, -1,  1,  0, -1,  0,  0,  0, -1,  1,
-   -12, 12,-26,-64,-15, 29, 37, -7, -3,-12, -5, 14,  8, -8,-10, -2 },
-  { 19, -4,-11,-16,  8, 14,  5, 19,  3, 22,-11,-21, -1, -6,-11, 11,
-    10,-24,-23,-40, -8, 20, 17,  5, 13, -6,  3, 14,-20, -8,  3, 28 },
-  {  2,-12, 10,-14,-18, 26,-22,  4, -2,  5,-21,  8,  3,  1, 19,  0,
-   -12, 24,-14,-40, 15, 29,-15,  6, 15,  1,-19,  2,  4,  7,-12, -3 },
-  {  0, 17, 13,  7, -5,-11,  2,-19,  3, 38,-21, -3, -6, -4,  7,  1,
-     1, -5,-40,-10, -2, 35,  8,  8,-10, -8, -9, 33,  4,  4,  0, -2 },
-  { -2,-12,  7, 29,-24,  2, 16, -1, -7, 16, 10, -2, -2, -2, 13, -2,
-   -37, 15,-22,-40,-11, 33, 10, -1,  8, 10,  6,  8,  9,  0,-12,  2 },
-  { 15, -8, -9, -2,  7,-17,  7, 19, 14,  4, 12, 27, 11, 10,  4, 11,
-   -15, 14,-13,-48,  5, 18,  0, -9,-36,-11,  2,  4,  5,  5,-15,-12 },
-  {-12,  0,  3,  4,  7, -5,  5,-14,-24,-18, -6,-15, -8,-20,  1, -7,
-   -33,-28,-40,-38,-18,-10, -5, 17,-12,  4,  3, -5,  5,-13,  4, -7 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1, -1,
-    -3, -9,-49,-60, -5, 45, -1,  6,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1, -1,
-    -3, -9,-49,-60, -5, 45, -1,  6,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0, -1,  0,  0,  0,
-     3, -2,  9,-29,-11, 55,  8, 32,-36,-13, -7, 37,  4, 11,  0,  3 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     4, -1,-39, -4,-30, 63, 28,-17, -6, 10,  7,-14, -9, 11,  9,  7 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,
-    13, -2,-50,-32, 22, 51,  4,  7,  6, 11,-20,-13,  9, -5, 21, -4 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1, -1,
-    -3, -9,-49,-60, -5, 45, -1,  6,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1, -1,
-    -3, -9,-49,-60, -5, 45, -1,  6,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0, -1,  0,  0,  0,
-     3, -2,  9,-29,-11, 55,  8, 32,-36,-13, -7, 37,  4, 11,  0,  3 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     4, -1,-39, -4,-30, 63, 28,-17, -6, 10,  7,-14, -9, 11,  9,  7 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,
-    13, -2,-50,-32, 22, 51,  4,  7,  6, 11,-20,-13,  9, -5, 21, -4 },
-  { -8,  2,  1, 22,-31, -6,-25, -3, -3,  1,-15,-11, -2, -3,  4,-13,
-    -9, 15,-18, 37, -7,-37, 12,-13,-11,-25,-10,-11,-22,  7, 16,  7 },
-  { 14, 10,  4,-10, -1, -5, -7, -3, 16, 13, -5,-15,  5, 11, -1,  8,
-   -27,  7,-12, 49, 17,-22,  9, -2, -9, -1,  2,-15, -1, 41,-18,-17 },
-  { -4, -9,-15, -3,  3,  4,  4,  2,  7, -3, -7, -8, -5, 17,-19, -7,
-    36, -9,-38, 17,  1,-48, 11,-18,-13, -2, -8,  4,-10, -5, 21, 11 },
-  { 15,-13,  4,  2,  1, -5, -2,  1,-10,  7, -1,  3, -6,  0, 11,-11,
-     8, 20,-17, 51,-17,-41,  2, 15,  4,  8, -2, 16,-32, -1, 17,  6 },
-  { -8,  8,-18, -5,  4,  6, -3,  8,  0, -4,  2,  0, -1, -4,  5,  8,
-    30, 30, -8, 70,  2,  8,  2,  0,  7,  1, 13, -1, -6, -7,-11,  2 },
-  { -8, -7,  9,-10,-13,  6,-11,-14, 13, 25,-26,  5,  2, -5, -5,  5,
-    -8,  4,  0, 33, 12,-38, -4,  6, 13,  6, 25, 34, -1, 25,-19, -5 },
-  { 18,  3,-17,  4, -8,  7, 20,  1, -1,  5, -5, -2, -8,  8,-35, 15,
-    24, 43, -5, 51,  5,-12, -3,  1, -2,  3, -3, -3, -9,  8, -9,  2 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,
-     2, 10, 24, 76, -2,-22, 11, -1,  4, 33,  4,  1, -1,  1,  2,  0 },
-  {  0, -1,  0,  1,  0,  1,  0,  1,  0,  0,  0,  0,  0,  1,  2,  0,
-    24, 13, 32, 70, 26,  5,-21, -9, -6,-15,  2, -2,  2,  4,  1,  1 },
-  {  5, -4,-11,  4, -4, 22, 10, -2, 13,-11, -4,-21,-17,  0, -7,  4,
-    10,-34, 11, 52,  2,-46, -5,  0,  0, -1,  2,  4, -9,  1,  1, -7 },
-  {  0,  1,  1,  0, -1,  0,  1,  0,  1,  1,  0,  1,  0,  0, -3,  1,
-    -8,  9, -1, 64,-13,-61, -3,  3, -5, 10,  1,  3, -1, -1, -1, -1 },
-  {  0,  1,  0, -1,  0, -1,  0,  0,  1,  0,  0,  0,  1,  1,  2,  1,
-    10, -2,-31, 79,-10, 27,  0, -1,  3,  8,  1,  1,  0, -1,  0, -1 },
-  {  3, 12, 10, 26,-19, 10, -9,  6, -4,-15, 10,  3,-16,  6, 11,-19,
-     3, 10, 18, 44,  5,-30,  5, -9, 21,  4, 20, 10, 14,-25,  8,-17 },
-  {  0,  0,  0,  1, -1,  0, -1,  0,  1,  0,  1,  1,  0,  0, -6, -2,
-     8, -8, 13, 69, 26,-19,-25,-17, 16,  6,-12, 22,  2, -6,  9,  5 },
-  {  0, -1,  0,  1,  0, -1, -1,  0,  0,  1, -2,  1,  0,  0, -4, -1,
-   -34,-15,-33, 56,  9,-42,  9, 10,  6,  9, -8,-11,  0, -6, 15,  5 },
-  { 10,  2,-14, -3,-15,-35, -1,  7,-18, 14,  8, -1,-15,-26,  6,-15,
-   -18, 22,  9, 33,  0,-32, -9,  3,-11,  7,  4, -1,  5, 30,  9,  1 },
-  {  4, 15,  0,  6, -5,-11,  9,  6,  6,  6, 14,  2, -1, 10,-24,-25,
-    -2, -4, -1, 37,  2,-29, 14, -9, 22, 17, -2, 33, 10,-25, 11,-11 },
-  {  0,  5,  2, 18,-12, 21, 22, 33, -7, 21, -9, -7,  7,-15, -7, 16,
-     7,  0,-14, 44, 10,-25,  5, -4, 15, -8, 10, -4,  5,  9, -1, 16 },
-  {  3, 13, 12, 12,  8, 25,-23,  8,-22, -3,-18, -8, 15, 12,  9, 19,
-     0,  0, -9, 49,-27,-15, -9,-15, 12, -8,-16, -7, 13,  5, 13,  2 },
-  { 12, -6,  7, -2, 20, -9,-14, 12, 13, -5,-17, 22, -8, -4,  2,  7,
-   -13, -2,-15, 43, -5,-30, 27,  4, 10,-27,  5, 27,-10,-10,-18,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,
-    -1, 10,-18, 70, -2,-52, -1, -7,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,
-    -1, 10,-18, 70, -2,-52, -1, -7,  0,  0,  0,  0,  0,  0,  0,  0 },
-  { 15,-13,-20, 16,  2, 13,  5,-11, -8, -5, -3,  2, 24,-23, 30, -7,
-    11, 30,-15, 43,  5,-15, 15, -3,-14,  1,-23,  8,  3,  9,  4,-11 },
-  {  0, -1,  0,  1,  0, -1, -1,  0,  0,  1, -2,  1,  0,  0, -4, -1,
-   -34,-15,-33, 56,  9,-42,  9, 10,  6,  9, -8,-11,  0, -6, 15,  5 },
-  { 10,  2,-14, -3,-15,-35, -1,  7,-18, 14,  8, -1,-15,-26,  6,-15,
-   -18, 22,  9, 33,  0,-32, -9,  3,-11,  7,  4, -1,  5, 30,  9,  1 },
-  {  4, 15,  0,  6, -5,-11,  9,  6,  6,  6, 14,  2, -1, 10,-24,-25,
-    -2, -4, -1, 37,  2,-29, 14, -9, 22, 17, -2, 33, 10,-25, 11,-11 },
-  {  0,  5,  2, 18,-12, 21, 22, 33, -7, 21, -9, -7,  7,-15, -7, 16,
-     7,  0,-14, 44, 10,-25,  5, -4, 15, -8, 10, -4,  5,  9, -1, 16 },
-  {  3, 13, 12, 12,  8, 25,-23,  8,-22, -3,-18, -8, 15, 12,  9, 19,
-     0,  0, -9, 49,-27,-15, -9,-15, 12, -8,-16, -7, 13,  5, 13,  2 },
-  { 12, -6,  7, -2, 20, -9,-14, 12, 13, -5,-17, 22, -8, -4,  2,  7,
-   -13, -2,-15, 43, -5,-30, 27,  4, 10,-27,  5, 27,-10,-10,-18,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,
-    -1, 10,-18, 70, -2,-52, -1, -7,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,
-    -1, 10,-18, 70, -2,-52, -1, -7,  0,  0,  0,  0,  0,  0,  0,  0 },
-  { 15,-13,-20, 16,  2, 13,  5,-11, -8, -5, -3,  2, 24,-23, 30, -7,
-    11, 30,-15, 43,  5,-15, 15, -3,-14,  1,-23,  8,  3,  9,  4,-11 },
-  { 16,-18,  7, -4, 31,-15, -9,-13, 20,-12, -6,  0, 12, -6, -2,  4,
-     3, -3, -1,  0,  1,  3,  3, -2,  1,  6,  4,  0, -3,  2, -5,  1 },
-  { 38, -5,-13, -4,  8,-15, 11,  1,  2, -4, -1,  9, 13,  4,-12, -7,
-     0, -2,  7,  2, -6, -2, -3, -2,  3, -4,  6, 15,  1,  1,-11, -2 },
-  { 47,-22,  9,-26,  3, -5,  2, -7,  4, -2,  2, -2,  3,  0,  3, -4,
-     3, -3,  2, -3,  7, -3, -1,  1,  1, -5,  5,  0,  2, -5, -3, -2 },
-  { 14,-16,  2, -6,  7, -2, -7, -4, -4, -7, 14, -3,  7,-19,-14,-17,
-   -29,  6, 26, 16, -5, 13, -4, -1, 21, 14,  1,  3, -6,  0, -7, -1 },
-  { 29,-11,  5, -3,  4, 11,  4,-10,  1,-22, -3,-10,  5,  4,  2,  8,
-    -2, -7,-12,-12, -8, -3,-18, -2, -9, -5, -1, -3,  2,-14,-14,  7 },
-  { 28,-12,  5,  3,  9, -7,  0, -2,  2,  1,  4,  0, -7, -3, -2,  4,
-     4, 14,  8, -1, -4, 14, -7, 17, -2, -2, -9,  2, 19, -7,  9, -8 },
-  { 31,-18,-22,  8, 15, -5,-10,-15,  1, 10,  6,  7,  6, -8,  2, -1,
-    12, -3,  3, -1,  1,  5, -6, -4,  0,  1,  7,-10, -2,  4, -3, -4 },
-  { 53,-30, -4, 12,  2,  3, -3, -3,  0,  1,  6,  5, -5, -4, -7,  1,
-     0,  2,  1,  3,  1,  5,  0,  2,  2, -1,  0,  4,  2,  0, -2,  0 },
-  { 27,-18, -3, -2,  4, -8,  3, -2,-11,  2, 10, -8, -8, -4,  0, -2,
-     8,  0,  9,  0,-16, 11,  1, -6, 13, -3,-10,-13,-15, 25,  1,  0 },
-  { 35, -5, -1, -8, 23, 11,-14, -3,  2, -2,  8, -6, 17, -2,  7,  0,
-    -2, 10,-17, 13, -2, -2, 11, 11,-14,  2, -2, -3, -8, -1,-12, -5 },
-  { 29, -9,  7,  3,  2,-10,  0,  3,  9,  0, -3,  5,  1,-10, 10, -5,
-     3,  6,-20, -9, -6, -4,  1,  0, 12, 17, -8,  9,  3, -1, -9,  0 },
-  { 15,-16, 18,-19, 16,-15, 17,-18, 13,-16, 17,-14, 15, -9, 13,-17,
-     9, -7,  4, -5,  3, -4, -3,  0, -6,  7, -9,  7, -2,  7, -9,  9 },
-  { 21,-10,  7, -2, 12, -7, 13,-17, 11, -2, 20,  3,  5,-11, -6, -6,
-   -15,  0, -9,  5,-11,  7, -1,  7,  8,-10, -9,  3, -5,  9, -8, -2 },
-  { 23,-22, 15, -5, 16, -4, -3,-12,  9,  3, -1, -2, -8,  2, -2,-16,
-     3,  4, -2, -6, -7, 12, -8,  2,-14,  2, -7, 11, -2,  6, -4, -1 },
-  { 34,-17, -4,  8,  4, -6,  1,  8,  4, 16,  3,  6, 12, -1, -1,-15,
-     6,  4, -7, -6,  6,  0,  2,  1, -2,  2,  3,  3, -3, -2,  8, -6 },
-  { 18,-18,  2, -2, 10,  1, 18,-23, -3,-10,  0,  4, 20,-19, -3, -4,
-     2,  8,  6,  1, -3,  1,  1,  3,  5, -1,-11,  3, -7,  5, -1,  1 },
-  { 15,-14,  2,  3, 10, -8, 12,-13, 13,-15,  6, -8, -4,-10, 14, -9,
-    24,  2, -7,-18, 13,-11,  8, 14, -6, -2,  3, -1, -4,  7, -7, -4 },
-  { 20,-12, 13,  5, -1,-10, 15, -6,  8, -1, -3,-10, 17,  0, -6,-19,
-     2, -1,  8, -3,-16,  0, -3,  2, -2,  0,  8, -9,  0,  1,-10, -9 },
-  { 32,  0, -9, -5, -1,  5, 13,-11,  8,  3, 11,-11,  0, -8, -2,-14,
-     7, 10,  6, -5,  1, 10,  2, 12,-10,  4,  4,  6,  4,  0, -7,-10 },
-  { 16,-14, 10, -7, 11,-11, 11,-11, 18,-13,  8,-15, 16,-11, 13, -9,
-     8, -7, 12,-11,  7, -6,  3, -5,  9, -5,  4, -1,  7, -4,  8, -3 },
-  { 24,-27, -1,  5,  8, -5, 12,  7,  4, -3,  3, -1, -9,-11,-13, -5,
-    10,  0,-13,  7,  1, -5,  4, -9,  7, -3, 13,  2, -5, -3,-17, -2 },
-  { 23,-19, 15,  1,-10,-18,-12, -6,  8, -3, 12,  0,-12,-10, -4, -4,
-     8,-10,  4,  2, -2, -8, 13, -3, -2, -6,  2, -3,  5, -2,  2, 11 },
-  { 25,-12,  4,  2, 24, -3,  3, -6, 14, 11,  0,-21, -3, -3,  1, -8,
-     7,  0,  0,  3,  3, -6, -7,  6,  2,  1, -4,  5, -1, 10, -2,  9 },
-  { 24, -8, -6,  7, 16,-12, 13, -1, 11,-21,  2, -6,  3,-12,  0,  9,
-     4, 11, -7,  1,  4,  1, -8,  3,  3, -6,  3,  3,  0, -8,  8,  4 },
-  { 25,-21, 13, 14, 13,-18,  4, -3,  0, -5, -4,  5, -3,  0,  4, 12,
-     7,  3,  5, -5,  2, -2,  3,-10,  2, -9,-15,  6,  1,  7, -5,  1 },
-  { 23,-16, -2, 10,  4, -1,  3,  1, 32,  3, -5, -2,  9, 10, -1, -4,
-    -6,  2,  9, -1, 14, 12, -6, -1,-17, -2, -4, -9, -7, -6, -8,  3 },
-  { 50, -8,  5,  2,-11, 10,  0,  0,  6, -3,  7,  0, -3, -2, -3,  0,
-     6, -4,  2, -5, -9,  0,  3, 10,  1, -7, -2, -3, -6, -9,  1, -2 },
-  { 28,-17,  0, -2,  2, -9,  1,  5, -4, -1,  0,  0, 19,-27,  5,-12,
-     7,-14, -3, -6, 10, -2, -4, -2,  4, -5, -2, -7,  1,  7, -9,  4 },
-  { 22,-19, -6, -6,  3,-22,  3,  5, 20, -8,-14, -5,  1,  1, 20,  2,
-    16,  6,  3, 14,  4,  3,  5,  1,  5, -7,-10, -6,  3, -6,  1,-14 },
-  { 29,-14, -8, 13,  8,-10, -6,  4,  4, -6,  5, -7,  1, 12, 14, 11,
-    -7,  1,  2, -9,-11, -9,  0,  4, -1,  7, 10,  4,  4, 20, -1,-11 },
-  { 18, -9,  4,  1,  7,-29, 12,  1, -1, -9, -2, -1, -2,  2,  9, -8,
-   -13,  5,  4,-13, -4,  2, -5, -7, -6, 14,-10,-34, -3,  1, -3,-13 },
-  { 38, -9, 24,  8, 11,  4, -6,-11, -2,-12,  1,  1,-11, -8, -5, -2,
-   -15, -8,  8,  0,  1, -7,  5,  4, -1,  8, -2, 11, -3, -1, -5, -5 },
-  {-20, 11, -4, 24,-11,  1, 15,  4,  0,-28,-10, -1, 10, 10, -6,  5,
-    -6,  2,  7, -2,  1, -2, -6, -3, -7,  1,  2, 12, -1,  7,  0, -2 },
-  { -9, 10,-23, 27, -4,-17, 20, -6, 14,-17,  5, -1,  5, -9, -7,  5,
-    -6,  4, -2,  9,  0,  8,  0,  1, -3, -3, -5, -8,  5, -2, -2, 12 },
-  {-10, 19,  4,  9,  1,-16, 17, -2,  9,-29,-16,-11, -4,  7, -5,  4,
-    -1, -3,  3,  2,  3, -4,  5,-12, -2,  6,  5, -4,  4,  1,  4, 10 },
-  {-20, 10,-24, 14, -5, 11,  9,  0, 16,-20, 10, -5, -6, -6, -1,  2,
-    -4,  5,-16,  8, -2,  5,  5,-11,  9,-11,  4,-11, -1, -1,  4,  3 },
-  { -9, 11,  3, 19, 24,  4,  5,-14, 30,-17, -4, -2,-17,  7,  2,  3,
-     1,  3, -7, -4,  2, -3,  1,  4, -1, -1,  3,-12, -2,  3, -3, 10 },
-  {-19, 18, 11, 19, 19, 19, 10,  4, 13,  6,  5,  4,  8,  3, -2, 12,
-    -6, -2,  7, -6, 15, 12, 16, 16, 18, -3, -4,-20,  0, 10, -9, -3 },
-  {-21,  9, 20, 12,  0, -3,  5, -9, 15,-13,  5, -5, -6, 24,  2,  9,
-    -5,  2, -7,  2,  5,  7, -5,  2, 15,  3,  1, -1, -4, -2,  7,  0 },
-  {-18, 16, 13, 15,  2,-10, 14,-11,  4,-11,  5, 12, 12, 20,  8, 30,
-     2, 11, -9,  7,  0, -3,-16, -5, -6,  5, -4,-21,  0,  5,  6,  1 },
-  {-26,  8,-13,  9,  6,-10,  2,-11,  7, -4,  6,-19,-11, -6,-12, 16,
-     0,  5, -7,  8,  5,  6, 17, -9, 10,-10,  5, -3,-11,  2,  4, 10 },
-  {-11, 17, -3, 22, -5, 18,  3,  1,  4, -5, 14,-27,  5, -7, -4, -5,
-   -10, 11,  1, 15,  1,  1, -6, -5, 10,-22, -7, -7,-15, 13, -4,  5 },
-  {-17, 14, -7, 13,  3,  0, 13, -6,  9,-14,-22, -1,  1, 19, 14, -3,
-     4,-13,-13,  2, -4,  8, -2, -2, 13,-12, 13,-12, -7, -5, -3,  6 },
-  {-17, 17, -1, 33,  6,  3,  9,-16,  3,-14, -8,  6,-17,  8,  3, 13,
-     8, -6,  3,  1, -2,  0, -2,  8,  4,  9, 13,-10,  4,-17,  0, -6 },
-  {-20,  7,  7, 21,  1, -3,  7, -3, -2,-12,  9, -7,  2, -3, 14,  1,
-    -1, -7, 12,-10,  5,-20, 11, -2,  0,-24,-17,  6,  6, -4,  3, -1 },
-  { -8, 10,  6,  7, -1, -6, 28, -6, 10,-33,  1,-20,  0,-12, 10,  1,
-    -6,  8, -3, -1,-10,  8,  5,  0, 10, -2,  8, 16, -5, -3, -7,  4 },
-  {-17, 13,  3, 15,  1, -5, 27, -5,  6, -6, 12,  2, -4,  8, -1, -3,
-    -2, 12,-15,  3,  4,  1,  2, -9,  0,-16,-21,  2, -4, 16, -7,  4 },
-  {-15, 20,  8, 17,  5,-14, 15,-11, 21,-11, 13,-13,  2,-15,-13,  1,
-    -5,  5,  2, 10, -9,  4, -1,  3,  2, -4, 13, -5,  1, -4,  5, -3 },
-  {-21,  8,  2, 16, -1,  2, 15,-16, 13,-12,-12, -7, -8,  2, -7, 11,
-    -8,  5,  2, -7, 16, -4,  1, -7,  3,-15,  6, -5, -8,  2, -8,  5 },
-  {-15, 17, -6,  3, -3,  3,  9, -7, 14,-23, 11,  1, -1,  4,  7,  6,
-    -1,-14,  7,  6, -8,  5,  1,-15, 10, -9,  2, -3, -1,  4,-10, -4 },
-  {-10, 18,  3, 11,  1,  4, 14,-14,  7, -4, 15,-10, 10,-11, 10, -4,
-     5,-14, 10,  4, 15,-12, 15,-13, 20,-15, 14,-15,  8,-11,  4, -6 },
-  { -7, 23,  2, 20,  7,  8, 19, -5,  9,-16, -8,-17, -5,  1,  5, -6,
-    -8,  1, -6, -4, 10,  6,  6,  2,-11, -4,  0,  2,  4,  7,  9, -4 },
-  {-15, 20, -5, 22, 11, -8,  9, -5, 10,-13, -8,  8,  2, -2, -3,  7,
-     6, 10,  1,  2, -5, -9,  1, 10, 16,-22, -7,  0,  7,  7,  6,  1 },
-  {-26, 19, -5,  3,  5, 25, 18, -5,  9,-14, -8, -6, -2, -6,  2,  3,
-    -8, -2, -7,  7, -3,  7,  3,  4, -8,  0,  1, -8, -4, -2, -2,  1 },
-  {-20, 14,-10,  6, -3,  7,  8,-32, -2, -7, -2,-10, 16,-12, -9, 15,
-    -2, -5, -6,  2, -7,  5,  9,  1,  6, -7, -1,  0, -2, -4, -7,  3 },
-  {-14, 16,  4, 11, -8,  1, 23, -4, 17,-13,-10,  1, 12,  9, 12, -4,
-     7, -1, -1,  5, -8, -6,  3,  3, -6, -3,-18,  0, 18, 20,  4, -2 },
-  {-33, 19,-10, 30, 15,  2, -3, -1, -4,-14,  7, -7, -1,  7, -8,  9,
-    -1, -3, -5,  2,  2,  4,  0,  5,  0,  0,  2,  3,  3, -3, -3,  4 },
-  { -6, 20,  0,  5, 17,-10, 18,-17,  9,-16,  4,-13, -6,  2,-14, 14,
-   -28,  9,-12, 25, -4,  7,  7, -8,  6, -6, -2,-10,  2,-11, -1,  2 },
-  {-12, 14, 12, 52, -3,  5, -5,  4,  8,-13,  2, -5, -4,  2, -2, -1,
-    -2,  3,  3,  5,  2,  3,  0,  1, -5,  2, -4, -3,  1, -5, -2,  0 },
-  {-13,  6,  9, 24,  0,  8, 14,-15, 18, -9,-11, -8,  3, 15, -2, -4,
-    -9,  4, -3, 12, 14,-13, 11, -4,  2, -4,  0, -6, -6, -6,-14, -1 },
-  {-10, 28,  3, 12,  9,  3, 11,-28,  6,-11, -7,  4,  0,  7,  8, -9,
-     0, -6,  0,-16,  4,  7,  4,  4,  7,  3,  4, -7,  0, -3,-10,  6 },
-  {-11, 14, -2, 19, -1, -1,  7,  9, -2,-27, 10,-14, 15, -4, 12, -4,
-     2, -2, -6, 12, -6,  0, -5, -4, -5,  1,  3,-11,  5, -9,  3, -8 },
-  {-18,  7, 13, 16, -4,  3,  9,-10, 10,-10, -3,-22, -4,-12,  3,-16,
-     0, -3,-16,  8,-11,  1, 10, -7, 15,  3,  0, -1,-13,  8,  1,  6 },
-  {-20, 10,-10, 10,  8, -1,  6,  0, 16,-12,  9,-10, -1, -5, -4,-13,
-    13, 16, -8, 12, -2, 14, 18, 13,  0,-16,  2, -5, -5, -5, -4,  3 },
-  {-14,  5, -7,-17,  5,-13, 23, 20, -4, -1,  1, -6, 13,  5, -1,  4,
-   -14, -2, -7,  8,  3,  2,  2, -7,  2, -1,  4,  7,  3, -9, -1, -5 },
-  {-19,  3,-24,-28, -9, -7, 19,  3,  2, 19,  7,  5,-13,  8,-15,-17,
-     3,-11,  4, 13,  3,  2, -1, -3, -4, -4,  2,  0, -5, -6,  6,  2 },
-  {-17, 18,-30,-20, -2, -3,  1, 15, -1,-11,  6, -4, 11, 11, -4, -5,
-   -10,  0,  0,  1,  3, -7,  8,  2,  5,  1,  5, -5,  1,  6,  4,  1 },
-  { -6,  1,-30,-25, -1, -8, -2, -9,-17, 16,  3, -1, -2, -9, -6, -7,
-    -3, 12,  6, -4,-10,  0, 10, -8, -6, -5, -3,-11, -4,  0, -1, -3 },
-  { -1, -1,-34,-28,  1,-10,  2,  9,  4, 16,  2,  6, 14, 17,  0,  7,
-    -4,  4,  4,  4,  0,  1, -1, -5,  8,  1, -4,  1, -9, -2,  5,  6 },
-  {-11, 14,  1,-31, -7,-24,  9,  7,  6,  5,-13,  1, -1,  3,  4, -1,
-    -2, -8, -6,  3,  5, -4, -6,  7, -2,  5,  3,  3,  0,  0, -5,  2 },
-  {-25,  8,-11,-18,  1, -4,  8, -3, -4, 15,  6, -5,  8,  2,  3,  4,
-    -4,  5,  6,  8, -7,  6,  1,-11,-15,-13,  9, -4,-14, 10, 12,  7 },
-  {-20, 11,-15,-25,  3,  4, 18, 13, -4, -5, -9, -1, -5, -2, -2, -7,
-    16,  5, -4, -5, -7, -2, -3, -9, 11, -2,  0, -7,-17, -6,-11,  6 },
-  {-11, 18, -5,-20,-15, -3,  9, 11,-20, 12,  5,  5, 11, -3,  7,  1,
-    10, -6, -3, -3,  3,  3, 14, -7, 10,-17,  9,-11, -2, -6,  7,-12 },
-  {-20,  8,-14,-17, -9,-13, -3,  0,-27,-14, -3,-14,  4,  3,  6, -6,
-     7,  4, 23,  9, 11,  9,  3, -4,  9,  2,  4, -1, -6,  1, -8,-11 },
-  { -9, 14,  2,-37, -7, 13,  6,-11, -6,  9, 18,-11, -6,  2, 12,  4,
-    -1,  3,  1, -2, -2,  1, -9, -4, -2, -3,  3,  5, -6,  0, -2, -8 },
-  {-29,  8, -1,-13, -2,  8, 23,  2,-10,  7, 13, -6, -5, 11, 13,  0,
-   -10,-13, 11,-12,-10,  6,  4,  6,  4,  3,  6, -5, -9, -2, -1,  3 },
-  {-18,  6,-10,-55, -4,-11, -2,  0,  1, -3, -9, -6,  3, -2, -1,  6,
-     3, -1,  3,  1, -4, -7, -2,  6,  3, -2, -1, -3, -2,  0,  4,  1 },
-  {-14,  5,  3,-21, -8,-16, -4, -2,-11, 27, 15,-20,  3,  0,  1,  1,
-     2, -5, -5,  4,  1, -9,  5, -3,  3,  0, -4, -2,-11, -4, -3,  7 },
-  {-17, -1, -9,-17, -8,-18, 12,-13, -9, 13, -3,  3,  3, -3,  1, -2,
-     0, 16, -9,  6, 12,  9,  5, 11,  2,-15,  1, -4,-16,  7, -4,-12 },
-  {-18,  8, -6,-11, -8, -7, 13,  7,  1,  6,  8, -1, 21, -4, 14, 15,
-    18, -4, -3, 15,  0,  9,  4,  7,  3, -1,  9, -2,  0,  7, -8,  2 },
-  {-10,  7,-18,-29,  3, 12, 12,  9, 11,  4, -1,-15,  1, -1,  8, -2,
-    -2, 10,-15, -1,  0,  6, 12, -6, -1, 10, -6, -3,-11, -4,  9, -6 },
-  {-14, 14, -9,-21,-12, -2, -1, -7, -5,-10,  5, -8,  0,  6,  9,-11,
-    11, -3, -5,  3,  8, 15, -2, -4,-22,  4, -6, 12,  2, 13,  6, -7 },
-  {-12, 11, -5,-29,-25,  4, 12,-13,-11, -7,  4,  2,  2, -5,  5,  8,
-     7, -5, -5,  6,  3,-10,  1, -6,  6, -6, -5, -1, -2, -4,  7,  6 },
-  {-15, 11, -5,-16,  0,-13, 26,-23, -6, -3,  5, -2, -2, 21, -6, -3,
-    -5, -1,  6, -1,  0,-13,  2, -3, -9, -1, -4, -3,  5, -4, 12,-16 },
-  { -9,  9, -1,-17, -3, -6, 12,  6,-18, -2, 11,-14, -6,  3, 14,-12,
-   -11, -5, 14,  2,  5, -8, -4,-11,  2, -5, 16,  6, -7, -4,  8, 13 },
-  {-13,  5,  3,-28,-14,  0,  6, 23,  5,  4, -1,-17,  1, -3,  0,  0,
-     5,  4,  0,-18, 14, 10,  4,  2,  5, -2,  4, -3,  2,  0,  2,  0 },
-  {-15,  4,-13,-16, -3,-12, -2,  2,  7, 10,  9,  3, 11,  4, 23, 14,
-     9, 16,  4,  1,-12, -3,  4, -7,-15, -7,-10,-14, -6, -8, -1, -6 },
-  { -7, 10, -5,-10, -3,-13, 16, -1,-12,  7, -3,-12,  2, 13, 13,  2,
-    17, 15,-13,  1, -5, -2,  3, -1,  1, -3,  6, -3,-12,-16,  7, -7 },
-  {-11, -5,-12,-30, -6,-22,  1,  4, -6, -3, 12,  6,  7,  0, 16,  6,
-    -2,  0,-22, -2, -9,  2,-13,  8,  6, -8,  4, -7, -1, -6,  4,  6 },
-  {-14,  5,  1,-27, -4,  2,  1, 14,-11, -7, -8, -4,  1,  8,  0, -6,
-   -13, 11,-12, -7, -5,  1, 10,  7,  3, -2,  0,  6, -8,  2, 10, -1 },
-  {-10, 10,-25,-13,-20, -4, 19,  3, 13,  5,  5,  7, -8,  2,  4,  2,
-     3, -1, -1, -9, 14, 10,  9, 14,  3,  3, -6,  0, -5,  4,  1, -1 },
-  { -9, 15,-18,-17,  4,-11,  6,  7,-12,  8, -1,-11,  2,  3,  7, 16,
-    -3, -9,  7,-12, 23,  0,  6,  7,-14, -9,  8,  1, -2,  6, -2, -1 },
-  { -6,  9,-16,-26,-14,-11,  9, -6,  5, -2, 13, 17, 21,  7, 18,-19,
-     6,-23, -2,-15, -2,  2,-10, -8,  2,  1, -2,  4, -3, -4, -5, -4 },
-  {  0,  6, -5,-28,-17,-32,  2,-10, 11,  3, -5,  9, 10,  3, 11, 11,
-    -3, 12, -2,  2,  4, -6,  9, -4, -4, -4, -4, -9,  2,  0,  2,  4 },
-  {  0, -8,-18,-34, -9, -7, -4,-11, 10, 15, 11, -1, -8, 15,  6,-13,
-     9,  2, -4,-12,  0, -1, 19, 12,  6,  5,  0, -3,-10,-12,  3, -5 },
-  {-10,  6, -9,-17,-12,-11,  9, -6, 11, 11, 18, -7,  0, 16,  4,  2,
-    -6,  3,-12, -1,  0,  1, -5,-22, -2,-12,  0,  6, 17,  5,  5,  6 },
-  { 12, -5,  7,  1, -5, -2, -1,  2,  2, -4, -3, -3, -3, -2,-29, 11,
-     5,-13,-73, 24, 12,  4,-14,-10,  5,  1,  0,-11, -7, -7,  7,  3 },
-  { 10, -3, -1, -3,  4,-11, -5, -2, -8,  7,  9,  2, -8, -6,  6,  7,
-    21, 17,-54, 47,-14,-10, 14, 19, 13, 21, -4,  3,  1,  2, -4,  2 },
-  {-12,  4,-16,-12,  5, -9, -4, 19, -7,-22,-22,-17,  3,  0, -6,  8,
-    23, -4,-55,-28,  2,-26,  2,  1,  4,  0,-13,  6,  0, 10, -7,-11 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3, -1,
-    35, -1,-67,-35,-24,-24, -6,  2,  2, -2,  1,  3,  2,  0, -1,  1 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  5,  0,
-    41, -4,-73,-15, 18,  4, 17,  8, -1,-16, -1, -2,  1,  0,  0,  0 },
-  { -4, -4,  4,  6, -1,  2,-16,-10,-15,-10, 21, -2, -6, -2, 14, -7,
-    10, -5,-55, 34,-12, 11,-13, -2,  2, 28,-26,  0,  7,  4, 21, -7 },
-  {  2,  1, 15,-22, 10, -3, 14, -6, -2, 15, -2, -7, 20,  6,-15, -7,
-    23, 10,-60,  8, -4, 29,-22,  2,-13,  9,-10, 12, -1, -3,  4,  7 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,  0, -1, -2, 11, -5,
-   -21,-11,-60,-27,-17,-39,  6, 36,  0, -8,  2,  2,  0,  0, -2,  3 },
-  {  2, -5,  9,-17, -1,  2, -3, -6,  8, 12,  7, -6,-33,-11,-14,-40,
-    10, 36,-46,  0,-19,  5,  0,-10,  3, 12, -6, -8,  6,-12, -7,  1 },
-  {  1,  1,  0,  0,  0,  0,  1,  0,  0,  0, -1,  0,  1,  0, -2,  0,
-     4, -2,-87, -3, -2,  2, -2, 20,  2,  6, -1,  6,  0,  0,  2, -1 },
-  {  1,  0,  0,  0,  0, -1,  0,  0,  0,  0,  0,  0, -1,  0,  0,  1,
-     1,  7,-76, 41, -7,-24,  0, -6,  3,  6,  0, -2, -1,  1,  0,  0 },
-  {  0, -3,  4,  2,  3,  2,  2,  0,  3, -1,  4,  0, -1,  4, -2, -4,
-   -32,-11,-64,-29, -9,-43,  2,-11, -1, -7,  0, -4, -2, -2, -2,  2 },
-  { 10,-20,  3, -3, 13, 13,  0, -4,  2,  7, -8,  7, -2,  2,-20,-20,
-   -19,  3,-47,-18,-16, -6,-15,-42,-17, 14, -6,  8, 12,-10, 11,-12 },
-  { -3, -2, -2, -1, -1,  4, -3, -1, -6, -2,  3,  2, -3,  6, -1, -9,
-    10, 13,-68, -9, 26,  3,  5,  3,-21, 10,-15, 21,-22, 19, 11,-14 },
-  {  1,  5, 18,-19,-29,-13, -2, 18,-10, 20,  2, 10,-10, 11,  1,  8,
-   -16,-17,-41, 10,-14,-25,  0,-14,-19, 17,  7,-12, 14,-11, 14,  5 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3, -1,-43,  5,
-     6,-12,-48, 19,  8,-38, -8, -3, 22,-21,-10, 15, 20, -9, -5,  8 },
-  {  0,  0,  0,  0, -1,  1, -1,  0,  0,  0,  0,  0,  0,  0,  6, -3,
-    22,-14,-71,-24, -2,-33, 23,  7, -8,  7, -3,  2, -4,  1, -8, -2 },
-  {  1,  0, -1,  2,  0, -2,  0,  0, -1,  0,  4,  0, 26, -1, 10,-11,
-   -17,-32,-58, 14,-14,-11, -2, 15,  2, -8, 12, 10, -9, 13,-33,-14 },
-  { 15,-17,-19,  7, -8,-15,-32,-22,  7, 12, 18,  0,  0,-15, -4, 16,
-    37, -2,-46, 11,  2, -8,-10, -8, 14,  9, -4,  5,  7,-17,  4,  3 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -2,  0,
-    -5,  3,-85, 23, -9,-17, -2, -2,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -2,  0,
-    -5,  3,-85, 23, -9,-17, -2, -2,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  1,  0,  0,  0,  0, -1,  0,  0,  0,  0,  0,  0, -1,  0,  0,  1,
-     1,  7,-76, 41, -7,-24,  0, -6,  3,  6,  0, -2, -1,  1,  0,  0 },
-  {  0, -3,  4,  2,  3,  2,  2,  0,  3, -1,  4,  0, -1,  4, -2, -4,
-   -32,-11,-64,-29, -9,-43,  2,-11, -1, -7,  0, -4, -2, -2, -2,  2 },
-  { 10,-20,  3, -3, 13, 13,  0, -4,  2,  7, -8,  7, -2,  2,-20,-20,
-   -19,  3,-47,-18,-16, -6,-15,-42,-17, 14, -6,  8, 12,-10, 11,-12 },
-  { -3, -2, -2, -1, -1,  4, -3, -1, -6, -2,  3,  2, -3,  6, -1, -9,
-    10, 13,-68, -9, 26,  3,  5,  3,-21, 10,-15, 21,-22, 19, 11,-14 },
-  {  1,  5, 18,-19,-29,-13, -2, 18,-10, 20,  2, 10,-10, 11,  1,  8,
-   -16,-17,-41, 10,-14,-25,  0,-14,-19, 17,  7,-12, 14,-11, 14,  5 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3, -1,-43,  5,
-     6,-12,-48, 19,  8,-38, -8, -3, 22,-21,-10, 15, 20, -9, -5,  8 },
-  {  0,  0,  0,  0, -1,  1, -1,  0,  0,  0,  0,  0,  0,  0,  6, -3,
-    22,-14,-71,-24, -2,-33, 23,  7, -8,  7, -3,  2, -4,  1, -8, -2 },
-  {  1,  0, -1,  2,  0, -2,  0,  0, -1,  0,  4,  0, 26, -1, 10,-11,
-   -17,-32,-58, 14,-14,-11, -2, 15,  2, -8, 12, 10, -9, 13,-33,-14 },
-  { 15,-17,-19,  7, -8,-15,-32,-22,  7, 12, 18,  0,  0,-15, -4, 16,
-    37, -2,-46, 11,  2, -8,-10, -8, 14,  9, -4,  5,  7,-17,  4,  3 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -2,  0,
-    -5,  3,-85, 23, -9,-17, -2, -2,  0,  0,  0,  0,  0,  0,  0,  0 },
-  {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -2,  0,
-    -5,  3,-85, 23, -9,-17, -2, -2,  0,  0,  0,  0,  0,  0,  0,  0 },
-  { 16, 65, -2, -2,  4,  3,  0, -7,  3,  1,  3,  1,  0,  5,  1, -5,
-     0,  2, -1,  3,  0,  0, -1, -2,  6,  0, -2,  0,  0, -1,  1,  1 },
-  {  5, 37, -4,  8, -4, -1,  9, 17,  6, -7,  5, -1, 11,  6, -4,  7,
-    -2,  4,  1, -3, 11,  3,  3, -9,  6,  0, -2, -4, -5,  4,-12,-11 },
-  { 15, 24,-14,  2,  6, 17, 26,  5,  8, 11, -9, -7, -6, -8,  3, -5,
-     9, 10, -3, 10,  0,  1,  4, -9,  4,  9,  3,  0,  4,  0, -5,  3 },
-  {  9, 36, -9, -8,  7,  7,  4,  3, -1,-16, -2,  7, -5, -6,  6, 12,
-   -11,-12,  9, -1, -3, -9, 12,  6, -6,  2,  2,  5,  0,  5,  6, -6 },
-  { 25, 39, -5, 24,  3, 10,  3, -6, 13, -8,  3, -7,  2,-10, -5,  2,
-    -2,  3,  5, -2,  1,  5, -2,  3, -4,  1, -5, -4,  0,  1, -2,  0 },
-  { 16, 27, -1,  0,-14,  6,  4, -5,  7, -2, -6,  0, -3, -5,  2, -1,
-    -1,-19,  5, -8,  0, 11, 12,  5,  0,  3, 10,  6,-14, 14,-13,-15 },
-  { 12, 23,-14,  2,  1,  4, -3, 16,  7, -8,  2, -8,  8,  6, -8, -7,
-    -3,  0,  2,  8,-13,  7, 13, -6, -4,  6,-13,-16, 14, 11, -7,  5 },
-  { 16, 28, -7, -1,  6, -3,  9,  0, -7,  3,  0,  3,-12, 20,  8,  9,
-     8, 23,  8,-13, -2,  4,  9,  3, -5, 13,  5, -2, 12, 14,  5, -1 },
-  { 19, 37, 19,  5,  7,  5, 10,  5, 19, 10, 14,  0,  2,  5,  1, -4,
-    -4,  2,  2, -5, -2, -1,  2, -6, -4, -4, -5, -3,  2, -2, -2, -2 },
-  { 24, 21,  1,-11,-10, 17,-14, 14,  6, -1, -6, -1,  0,-13, -1,-12,
-    -2, -5,  6, -4,-12, 14,  5, -2, -8, -8, 15, -7,-30,-12,  4,  0 },
-  { 11, 26, -3,  3,  5, -1, -2,  3, -2, 10, 15, -4, 10,-28, 10,-17,
-    -8,  1,  2, -7, -1, -6,-15, -1,  4,  5, -7,  9,  0, -5, -4,  4 },
-  { 18, 32,  1,  2, -7,  4, 15,  2, -9, -2, 12,-11,  7, 11, 13,  2,
-     0,  5,  9,-10, 16,  3, -3,  5, -9,-23,  2, -2, -1,  5,  2, 11 },
-  { 35, 24,-20,  2,  4, -1,  5, 14,-10, -9,  8, -7,  0,  5, -7, -7,
-    11,  1,  5,  3,  2,  0, -2,  3,  0,  1,  4,  0, -2, -8,  0, -4 },
-  {  9, 35, -1,  2, -1,-19, -3, 12, -1,  8,  8,-13, -1, -2,  2,  5,
-    -8, -1, 13, -2, 11,  1,  0,-10,  0, -3, -7,  2,  1,-12,  3, 12 },
-  { 20, 27,-12,-12,  7,  4, -1,-13, -1, -9,  2, 13,-11,  5,  7, -9,
-     9,  1,  1,  8, -9,  0, -6,  7,  4,  2, -2,  7,  3, -2,  1, -9 },
-  {  8, 37,-20, -5,  0,-21, 10, -8,  3, 19, -9,  7, -3, -8, 10, -2,
-     0,  5,  6, -4, -2, -1,  0, -7,  6,  1,  0,  4, -5,  6, -8,  2 },
-  {  8, 27,  1, -3, -5,  1,  6,  0, 15,  2, 17, -1,  3,-17, 10,  5,
-     5, -6, -6,  6,-10, 18, -5,  0,  0, 13,  7, 10, -5, -6, -2, -4 },
-  { 14, 29,-20, -4, -3,  1, -5, -1,  2, 12,-10, -3,  4,-18,  4, 14,
-    -4, -1, -9, 15, -2,  2, -5, -3,  2,  9, -2,-14, -3,  4, -4, -7 },
-  { 23, 23,-23,-11, 27,  4,  4, -1,  7,  0, -5,  9,  2,-11,  3,  7,
-    -2, -5,  2, -7, -7, 13, -3, -6,  2,  3,  3, -4, -1, -8,  5, -2 },
-  { 16, 26, -6,  8, -9, -1, -2, -1, -8,  4, -2,  0,-12,  9, -1,  0,
-   -17, -9, 30, -5,-15,-16,-13,  0, 10,-11, -7, -3, -1,  0,-11, -2 },
-  { 12, 32, -4, -5, 10, 19,-10,  4,-12,  5, -6,  9,-12, -6, -6, -8,
-     4,  1,  3,  0,  8,  0, -3, -4, -7, -4, 10,  8,  6,  5, -1,  4 },
-  { 46, 42, -3,-14, -2, -6,  6, -2, -5, -1, -3, -3,  1, -1,  3,  1,
-     1,  4, -1,  2,  3,  1, -2,  6,  0, -1, -2,  4, -2, -1,  2,  2 },
-  {  9, 33,-13,  4,-11,  3, -8, 22, 12, -2,  4,  0,-16,  5,  4, -1,
-     7, -6, -9,  1,  7,  5,  0, -5,  5, -1, 10,  3, -2, -1,  3, -2 },
-  {  9, 30,  6, -3,  6,  1, -7,  5, 11, 14,  7,  1,  0,  2,  2, -1,
-     8,  7, -6,-13,-10, -2,  1, -6, 10,  7,  6,  5, -2, -5, -1,-16 },
-  {  9, 28,-11,-10,  9,-10, 15,  8,  4,  9, -4, -7,  0, -5,  9,  8,
-    -7,  2,-15,-23,  4, -4,  4, 16, -8, -3,  0, -8, 14,  5, -3, 15 },
-  { 17, 26, -5, -5, -1, -8, 20, 18, -7, -2,  4, -7, -8, -5, -4, 16,
-     0,  0, -7, -2,-13, -5, -2,  3, 12,  1,  3, -5,  2,  2,  0, -1 },
-  { 11, 37,  7,-23,  6, -1, 15, 13,  4, -9,  7,  5,  3, -3, -5, -8,
-    -2,  3, -5, -1, -8,  7,  2, 13,  1,  3,  0, -3, -1,  2,  0, -2 },
-  { 21, 33,  7, 20, 21,-10,  6, -5, -5, -6, -9,  2, 10,  0,  8, -4,
-    10,  2, -2, -2,  0,-10, -6, -2,  0, -5,  3,-11,  3, -9, -3,  1 },
-  {  6, 30,-15, -8, 16,  1,  4,  6,  4,  5,  8, -3,  8, -9, -1, -6,
-     8,  2, -2,  4, -2,  5, 11,-21,  3,-10, 16,-11, 24, 10, 14, -6 },
-  { 15, 36, -3, -9,-20, 12,  0, -7,-18, -4, -8, -9,  9, -7, -3, -1,
-     2,  7, -5, -8,  6,  2,  2, -1,  7,  1,  1, -3,  3, -4, -8,  1 },
-  { 16, 34, 21,  3, -9, 10,  7,  9, -7,  1, -4, -9, -4, -5, -5,  3,
-     3,-19,  1,  5,  4, -2, -6, -5,-10,-11, -8, -2,  2, -5, -8, -7 },
-  { 28, 29, -3, 18, -2,  0, -6, 12, -2, 10,-11, -4,-13,-12, -6, -4,
-     0,  4, -1, -8,  6,  4, 12, 11, 10, 10, -3, -6,  1,  2,  1,  7 },
-  {  3,  8, 22, -8,  3, 36, -8, -1,  9,  6,-13,-14,  8, -1,  1,  2,
-    -2, -8,  0,  3,  1,  2, -1,  5, -1, -8,  0, -2,  2,  2, -1,  1 },
-  {  0,  6,  0,  0,  4, 13, -7,-16, -6, 15,-14,-21, -9,-10,-10, -6,
-   -21,  5,  4,  2, 12,  4, 12, 11, -4, -6, -6,-10, -7,-18,  1,  4 },
-  { -1,  3, 10,  1, -1, 15,  4, -7,-16,  3,  0,-22, 10,  2, -3, -2,
-    13,  5, -8, 16, -5,  4,  0,-11,-10,-22,  0, -4,-17,  5,  2,  1 },
-  { 12,  8, -4, -9, 14, 40,-21,  0,  1,-15,-10,-12, 12,  6,-10,  2,
-     8,  6,-12,-10,-11,  1,  0,-11,  2,  1, 13,  0,  6,  3,  8,  4 },
-  {-10,  3,  5, -4, -3,  3,  0, -9,  2,  8,-22,-23, 17,  8,-17, -3,
-    14, -8, -4,  1, -8,  3,  0,  5, -1, -3, -2, -4,  1,-10,  0, -2 },
-  {  0, -1,  5, -7,  4, 12, -2,  0, -7,  2,-16,-15, 12, 21, -7, -4,
-     7, -7,-11,-15, -7, -9, -5, -8,  0, -6,  8, -3, -8, 22, -7, -9 },
-  {  7, 19,  4, -9, 24, 22,  2, -6,  8, 13,-14,-20, -4, 11,  8, -4,
-    -1,  2,  0, -7,  5,-17, -3,  3, -6,  5,  3,  4, -5, -7, -3, 14 },
-  { -2,  6,  2,  8, -2,  5, -4, -2,-10,  3,-45,-30, -3, -3,-12, -4,
-    -3, -3, -1,  9, -6, -6,  5, -4,  0,  5, -1, -2, -1,  0, -6, -1 },
-  { -3, 14,-16,-10, 10,  0, -2,-40, -9, 12,  2,-19, 15, -4,  4,  3,
-     3, -4,  7,  1, -4, -5,  0,  4, -1,  0, -9, -2, -4, -1, -2,  0 },
-  {  7, 16,  2, -7,  8,  2,  0,  1,  5, 21,-10,-26,  7,  2, -9, -7,
-    -3,-16,  8,  5,  5, -6, 10,  4,-14, -6,  5,  3, -2, -2, -4,  1 },
-  { -9, 14, -1,  3,  3, 11,  1, -5, -3, 13,-16,-18, 20,  6, -5,  0,
-    -3,  2,  8,  4,-19, -9, 12,  0, -8,  2,  2,  1,  6, 13, -7,-11 },
-  {  2,  5, 16, -4, 19, 15,  4,  0,-11,  7,-10,-10,-16, 18,-11,-12,
-    -9, -4,  7, -4, -4,-17,  1,  1, -8, -3, -3,  5, -2, -6,-11, -5 },
-  {  2, 12,  0, -9,-10, 14,  6,  2, -3,  2,-12,-28, 12,  1, -1,  2,
-     0, -3, -4,  7, 16,  5, -7,  8, -4, -3, -1,  3,-12,  4,-17, -5 },
-  { -4,  7, 11,  6,  1, 14, -4, -6,  5,  5, -6,-24, 23, -9,-15, 13,
-    -7, -9,-15, 10, -1,  8, -5,  1, 12,  6,  2,  0,  4, -2,  9,-10 },
-  {  1,  5, 11,  3,  6, 12, -3,  8,-21,  5, -7,-20, 12, -2, -9, -3,
-    17, -7, -8, -9,-14,  3,-13, 18, -8,  9,  2, -8,  4, -8, -5, -2 },
-  { -3, -3, -1,  5, -2, 15,  3,  2,  1, -8,  1,-39, -6, 13,-13,  0,
-    -2, -5, -6, -3,  0, -5, -2, 15, -9,  5, -3, -6, -2,  7,  0,-13 },
-  {  2,  8,  5,-12,-13, 22,  8,-16, 11,  5, -2,-32, -2, -4, 11,  5,
-     5, -6,  1,  3,  1,  5,  3,  6, -5,  4,  4, -8,  8,  4,  1,  3 },
-  { 13,  9,  5, -4,  9, 18,-11,  2, -1, 15,-10,-19, -2, 14,  0,-10,
-     1,  1,-18,  3,  2, -6, -8, 20,  7, -8, 16,  9,  9,-13, -3, -2 },
-  {-13, 11, 11, -9,-10, 13, -3,-18,  2, 10,  5,-21,  6, 15,-11,-21,
-     3, 14,  0,-12,  9, -1, -2, -4,  3, -3, -9, -8, -5, -2, -8,  2 },
-  {  3,  3, 11,  4,  0, 13,  1, -8, 10, 13, -6,-26,  2, 12, -3, -5,
-    12, -2,  1,  8, -7,-17,-19,  5, 10,  7, -3,  2, -3,  0,  5,  0 },
-  {  5,  0,  3, -3, -9,  5,-15, -5, -5, 17, -5,-31,  0, 13, 13,  5,
-    -1, -6,-14,  7, -8,  9,-14, -2,-16, -4, -4, -6,  6, -6,-10,  6 },
-  { 13,  3,  1,  7, -3,  4, -1, -2, -1,  4, -8,-32, -1, -4,  0,  3,
-   -10,  7, 10,-10,  4, -1,  6,  2,-16, -9,  4,  3, 13,-23, -3, -4 },
-  {  4, 11, -4, -9,  4, 11,-12,-12,-12,  6,  1,-28, -3, 14, 18, -2,
-   -12,  7, 15, -3, -5, -7, -3,  2, -6,  4,  4, -2, -5, -3,  2,-13 },
-  {  8,  7, -7,  0, 13,  7, -8, -7,  8, 36,-10,-22,  3, 23, -3,-10,
-    -3, 11,  1, -7,  3,  3, -1, -7, -4,  2,  3,  2,  5,  3, -4, -1 },
-  { -1,  1, 13,  1, -6, -1, -6, -9,-18, 17, -5,-37, -1, -1, -6, -4,
-     1, -6,-15,  2, 17, -9,  0, -3,  0,  4,  0, -5,  0,  4,  1, -5 },
-  {  0, 14,  5,  0, -7,  2, -6, 17, -6, -9,  7,-16, -5, 23,-14,-13,
-     8,-15, 11, 10,-11,-13,-33, -5, -2,  1,  6,  8,  0,-13, -9,  5 },
-  { 11,  7, -2, -8,  9, 11, 25,-14,  7,  3, -1,-33, 14,  8, -6,-19,
-     3,  3,  2, -1, -3, -1, -2,-10, -3,  1,  2,  1,  4,  2, -3,  4 },
-  { -2,  8,  4, -2,  9, 13, -4, -2,-15, -3, 19,-37,  9, 25, -9,  2,
-    -5, -2, -2, -4,  4,  2,  2,  0,  3,  3,  3,  5, -2, -3, -4, -3 },
-  { 10, 13, -1,-15,  4,  6,-18, -4, 25,  1,-23,-17, 15, 13, -8, -8,
-     7,  4, -5,  3,  6,  9, -7,  6,  0, -5,  8,  0, -6, -1, -2, -2 },
-  {  1,  3,  9, -5, 27, 15, -9,-31, -1, 23, -2, -9,  1,  8, -1, -7,
-    -2, -8, -4, -4, -2, -1,  3,  5,  0,  0, -1,  1, -7,  7, -3, -3 },
-  { -8,  7,  3, -6,  8,  3,-11, -2, 36, 14,  1,-30,  6, 10,-12, -6,
-    -6, -2, -4, -3, -5,  0,  9,  4, -5, -5, -8, 12,  4, -3,  1, -8 },
-  { -2,  9, 33,  0, 12, -3, -7, -4, -4, -1,  6,-25, 11, -6, -9,-11,
-    -2, -4, -2,  6, -1, -3, -6, 15, -6,  3, 10, -4,  1,  0,  5,  8 },
-  {-22,-21, -9,-19, -5, -7,-12,-15, -8,  9,-19, 14, -7, -4,  5, -8,
-    -2,  7,  1, -3,  4, -4,  6, 11,  2,  6, -3, -5,  2, -2,  0, -3 },
-  {-32,-13,  3,-24,  3, -8,  4,  1,-10, 14,-15,  0,  4,  6, -1,  6,
-     7, -1,  6,  4, -3,-17,  1,  4, -6, -1,  1,  0,  3,  3, -7, -4 },
-  {-32,-11,  7, -8,-12, 13, -5,-22, -4, 12,-16,  2,  0,  4,  0,  1,
-     0,  6, -5, -8,  2,  6,  5,  0, -3, -6,  5,  6,  5,  5, 13, -4 },
-  {-44,-33,  6, -4,  2,  0, -9, 10,  3,  4,  7,  0, -1,  7,  5,  1,
-     1, -3,  1,  6, -1,  0,  2,  3, -4,  0,  0,  1,  0, -1, -2, -1 },
-  {-30,-18,-24, -8,  5,  0, -2, 14,  7,  0,  1, 12,  6,  4, -9,  7,
-     5,  7,-11, -5,  1, -8, -1,  2,  2, -9,  7, -1,  7,  5,  6,  6 },
-  {-22,-20,-13, -9, 20, -3, 10, -8,  6, -4,  2, -7, 10,  8,  0, -1,
-     2, -3,  6,-19,  2,  4,  3,  3, -7,  2, -1, -6,  1,  1,  6, -2 },
-  {-27, -8, -1,  3, -1,-11, 24,  4, -1,  1, -8,  8,  5,-11, 15, -3,
-   -15, -1, -1,-13, -1,  1, -5,  5,  2,  3, -9,  0,  4,  3, -7,  6 },
-  {-33,-16, -1, -8, 10,-23,  6, 13, -1, -3, -9,  0,  5, -7, -5,-12,
-    -2,  3,  3,  6, -2, -3,  2, -3,  9, -6, -3, -2,  0,  5, -3, -4 },
-  {-22,-17, 11, -3,  3,  1, -1, -5, 17,  2,-15, -2, 10, -9,  6, 14,
-   -16,-12, 20, -1, -7,  6, -3,-12,  1, 10,-10, -1,  7, -3, -1, 10 },
-  {-28,-13,  1, -3, -1, -1,  0,  3,  3,  5,  1, 10,-10, -3,  7,  2,
-     4, 19, -1, -1, 10,  5, -8,  1, 11,-15, -4, -3, -5,  4,-13,  3 },
-  {-22,-13, 42,-20,  5,-13,  7,-11,  1,  1, -1,  1,  6,  3,  6,-11,
-     3,  3, -2,  0, -4,  4, -3, -1, -5,  2,  0,  0, -9, -1,  4,  4 },
-  {-26,-15, -2, -6, -4, -2, 16,  8, 21,  8,  1, -3,-10,  7, -8,-12,
-    -5, 12, -9,  3, -2, -3, 18,  1,-12,-15, -4,  5, -3,  0, 12,  7 },
-  {-26,-16,  5,  6, 14, -3, 15,  6,  1, -7,-13, 16,-15,  5, 11, -2,
-     9, -7, -4, -2,  0,  0, -2,  7, -8, -6, -5,  2,  7, -3,  2, 12 },
-  {-31,-17, -8,-30,  4, 14,  6, -6,  6,-11,  0,  3, -4,  0,  0, -4,
-     0, -4,  1,  4,  3,  4,  0, -5,  3,  2,  2,  0,  2,  1,  3,  5 },
-  {-61,-10,  4, 10,  4,  7,  0, -3,  0,  1,  0, -3,  0,  1,  0, -2,
-    -1,  1,  2, -2,  4, -3,  1,  1, -1,  1, -2, -4, -4,  4,  0,  0 },
-  {-28,-13, -8, -4,  3, -3,  2,  1, 11, 14,  3,  9,  1, 13,  3,  5,
-    -3, -2, -2,-12,-14, -9,-11,-15,-12, -5, -4,-12,  3, -3,  0, -5 },
-  {-41,  0, 12,-24, 13,  4,  5, 16, -5, -4,  0,  0, 13, -4,  1, -9,
-     9, -6, -1,  6, -2,  5,  2,  9,  6, -9, -8,  8, -2, -3, -6, -4 },
-  {-26,-19, -2,-15,  4,-14,  6,  0, 26, 20,  8,  9,  9,  3, -4, -5,
-    -8,  1,  0, -1,  5,  9,  3,  4,  4,  7,  1,  3, -2, -2,-10,  0 },
-  {-29,-18,  9, -4,  1, -5,-14,-12,  5,-10, -5,  4, -5,  0, -1, -1,
-     4, -5,  7,-16,-11,  2,  7,-15,  2, -4,  6, -4, -6,  7, -3,  7 },
-  {-27,-16,  9,-14,  3, -8,  9,  0,  7, -4, -3, -7,  0,-10, -1,  2,
-     1, -2, 15,-10, 14,  7,  6, 17,  3, -4,  3,-10,  8, -8,  3, 11 },
-  {-21,-20, -8, -8,  4,  5, -3, -2,  0, -5, 14,-10, 11, -4, 13,  0,
-     5,-11, 19,-18, 18,  3, -5, -3, -4, -8, 11,-10, 10,  3,  4, -9 },
-  {-35,-15, 13,-12,  4,  0, -2, -4,-12, -3, -8,-24, -7,  1,  7,  8,
-    -3,  0, -2, -1,  3, -2, -2, -6,  8,  1,  0,  1, -6, -1,  2, -6 },
-  {-19,-14, 13,-10,  9, -1,  1,  3,-12,  5,-16,  7, 13,  9,  4, -4,
-     6, -5,  4,  9, -3, 17, -4, 12,-11, -6, -5, -6, 13,  2,  7, -9 },
-  {-34, -8, -4,  1,  2, -1,  3,  6,-20,-11,  8, -1,  4,  2, -9,  4,
-    -4, -5, 16, 10, -4, 14,-13,  1, -6,  0,  2,-10,  0, -3, -3,  7 },
-  {-36,-10, -8, -3,  2, -2, 14, -4, -1, -7, -4, 10, -1, -3, 15,-11,
-     0,  2,  3, -1,  4,  0,  8, -1,  0, 18,-11, -5, 15, -5, 13,-12 },
-  {-22,-13, 14,-20, 15, 25, 16, 10,  8, -2,-10, -5, -1, -8, 11,  8,
-    -1, -2, -4,  1,  2, -1, -7,  0,  0,  0, -3,  0,  2, -1,  0,  2 },
-  {-31,-22,  7,  6, -2,  5,-20, 14, -6,  7,  0, 14,  3, -7,  3, -6,
-    -2,  1, -3, -5,  1,-10,  1,-24,  6, -2,  3, -7,  1, -7,  8,  7 },
-  {-25,-20, -3, -9, 10,  6, 12,  7,  5,  4, -3,  6, -1, -5, -6, -8,
-     3,  5,  6,  5,-10, 10, -4,-15,-15, -2, -9,  2, 18,  1,  8, 12 },
-  {-24,-19, -2, -4, -7, 11,  6,  9, 16,  2, -7, 18,  6, -7,  6,  6,
-    -2, -9,  3, 12, -2,  3, -1,  6,  7,  8,  0,  8,-11,  8,  4,  2 },
-  {-26,-20,-12,-12, -2, -3,  1, -5, -1, -2,  0,  3,  7,  9, -2,  2,
-     9, 22, 13,  4, -4, -1, -2,-14,  5, 15, -8, -5, -7,-11,-14, -6 },
-  {-21,-18, -1, -4,  0,  3,  7, -2, 10,  8, -8, -1, 15,  1, -9,  3,
-     1,  3, -5, -2,  2,  4,  0, -1, 10,  2,-19, -8,  8, 30, -7,  8 },
-  {-25, -6, 26,  4, -8,  4, -2, 21,  5, -4,-16,  5, 13,  4,-10, -1,
-    -6, -2,  2,-10,-13,  1,  3, -3, -6, -8,  2, 11,  1, -7,  0,  5 },
-  {  0, -1, -2, 19,-12,-48, -6, 11,  8, -2, -4, -2, -7,  5, -3,  2,
-    -2, -1, -1, -7,  0, -3, -3, -4, -4,  4,  1,  3, -3, -1, -2, -5 },
-  {-11, -8,-28, 18, 16,-24, -8, 19,  4,  8,-12,  9, -4, -2,  4, -7,
-     6,  2,  3,  3, -4,  0,  1, -6, -4, -2,  2,  6,  0, -3,  1,-16 },
-  { -9, -5,-26,  7, -3,-37,-16, -2,  2, -7,  4,-13,  0, -4, -6, -5,
-    -6, -4,  0,  3,  4, -3, -4, -4,  4, -3,  9, -4, -2,  2,  7, -4 },
-  {  2,  9,-18,  7, 29,-24, -1,  7, 14, 10,  3, -3, -2, -5,  6,-10,
-    -6, -3, -8,  0,  5,  1,  4,  3,-12,  2,  6,  1,  3,  4,  1, -3 },
-  {-20,  2,  8, 20, -9,-24, -4, 18,  3, 11, -1,-11,  6,  9, -1, -3,
-     1, -1,-15,  3, 15,  9,  3,  2,-13,  2, -8,  8,  1, -1,  1, -8 },
-  {-12,  5,-11,  6, 19,-26,-17, -6,  4, 14,  6, -8,  9,  5, -6, -5,
-     2, -1, 20,  1,-11,-10,-18, 20, -7,  0, -3,  4,  2,  0, 10,  4 },
-  {-15,  1, -2, 13, -8,-21,-22,  4,  4,  3,  3, -7,-31,  4,-10,-14,
-     0,  8,  4,  5,  8, 11,  2, -8,  6,  7,  0, -2,  6,  8,  8,  7 },
-  {-13,-10, -9, 12, 19,-16, -3, -2,  9,  2, 11,-29, -1,  9,  4, -3,
-     1,-10,-10, 16,  1,  7, -7, -6, -4, -1, -5,  3,  6,  0,  3,  1 },
-  {-17, -1, -5, 19, 12, -9,-21, -5,  2, 12, -7, -7, -3,  8,  7, -2,
-     6, -9, -9,  1, -4,  1,  1,  3,-14,  2, -8,  0, 10,  1,-12, -6 },
-  {-13, -5,  8, 15,  0,-20, -2, 20,  8, -8,  8,-19, 12, 10,  2,-11,
-     0, 12,  1,-11,  0,-11,-15,  5,-11,  2,  4, -4,-11,  5, -4, -5 },
-  {  3,-11, -7,  8,  0,-17,-26, 15, 19, -7, 10, -9, -5, -5, 14,-25,
-     0, -8,  2, -9, -3,  9,  1, -6,  4, -4,  3, -9, -1,  6,  2,  2 },
-  {-12,  5,  5,  9, 14,-18,-19,  4,  2, 16, 14,-21,-15, -9, -1, 16,
-    12,-11,-10, -5, -7,  4, 15, -8, -5, -1,  1, 14, 13, -7, -1, -4 },
-  {-10, -5, -1,  8,  7,-23,-10, 14,  6, 11, 10,-16, -3, 16,  6,  0,
-     0,  9,  6, -2, -7,  1, 22,  5,  3, -8,  0,  3, -2,-10,  3,  0 },
-  { -2,-14,  2, 16, 15,-17,-17,  6, 19,  4,-10,-15, -1, 15, 11,-14,
-    -8,  5,  8,  8, -2, -8,-11, 10, 10, -8,-14,  2, 13,  4, -2,-12 },
-  {-10,  3,  6,  4, 19,-23,-19,  1,  4, -9,-30,  3, -6, 18,  0,  2,
-     0,-11,  0,  3,  7, -2,  8,  5,  2, -3,  6, -9,  1, -4,  7, -6 },
-  {  9,  5, -2, 21, 20,-33,-13,  7,-10,  8,  8,-15, -6, -4,  1,  5,
-     3,  7, -2, -9, -1,  4, -6,  1,  0,  9, -1, -5,  2,  1, -3,  3 },
-  { -9, -3,  3, 15, -3,-30, -7, -7,-25,  6,  2, -6,  1, 19,  1,-12,
-     1, -8,-13,  9, 13,  1,  8,  2,  5, 15, -2,  3, -9,  0, -4,  4 },
-  { -6,-12,-17, 25, 22,-13,-10,  9,  2, 11, -7,-16,  4,  6,  1,  0,
-     0, 18, -4, -5,  4, -2, -1, -5,  0, -4,  6,  1,  6, -1,  7,  0 },
-  { -1,  0,-10,  8,  8,-27,  0, -2, 29, 16, -2, -4,  9, -1,  2,  0,
-     6, 10,  6,  4,  2, -7,  9,-18,  3,  3,  3,-10, 17, 10,  9, -6 },
-  { -3,-12, -6, 11, 20,-32,  5, 21,  3, -4, -9,  2,-10,  1,  7, -4,
-     5,  0,  0, -1, -8, -9, -7,  4,-10,  5,  0,  2, -5,  4,  9,  1 },
-  { -5, -1, -5,  1,  2,-19,-13,  1,  6, 12,  2,-16,-17, 11, 10, 13,
-    16,-12,-11,  3, -6,  0,  6,  4, -3,  1,  8,  2,  5,-11,  3,-14 },
-  {-19,  5, 10, 11,  2,-23, -9, 16, -2,  7,  0,-11, -7, 10,  6, -7,
-    26,-15, -4,  8,  6, -4,  7, -9,-15,  1,  8, -4,  4,  2,-12, 16 },
-  {-11,  1, 11, -4,  1,-31,-13, -1,  8,  5,  4, -2,  0, 13,  7,-17,
-     7,-10, -6,  1,  4, -1,  2, -9, -4,  9,  3,  3, -4, -5,  3,  4 },
-  { -3,  1, 10, -1,  0,-15,-22,  4, 40,-11, -4, -3,-14,  9, 11, -1,
-     9, -1, -6,  6,  3, -6,  0,  0,-12,  7, -2,  0,  9,  3,  1,  3 },
-  { -1, -1, -1, 14,  8,-24,-14, -8,  5,  8,  5,-12,-17,  8,  2,  7,
-    10, -8,  0,  4, -6, -6,-10,  8,  4,-12,  3, -9,-12,  5,  4, -3 },
-  { -5,  1,-11,  8,  9,-24,  0,  2,  2, 14,-12,-13,  1,  6,  7,  0,
-     7, -6,  9, 26, 11,-14,  8, 10,  1,  9,  0, 11, -2,  6,  2,-10 },
-  {-13,  1,  4, 34, 19,-17,-15,  0,  3, -2, -7, -1,  0, -3, -3, -1,
-     1, -1,-10,  8,  5,  0, -8,  4,-17,  9, -2,  0,  0,  6,  2, -3 },
-  { -6, -4,  1,  2,  2,-14,-29,  0,  9, 34, -3, -5,-14,  6,-10, -9,
-    -5, -1,  0,  3,  3,  0,  1, -1, -2, -1, -1, -3, -3, -4,  3, -3 },
-  { -4,  6,  3, 14, 14, -8,-29, 31, 11, 14, -4, -5, -6, 10,  6, -9,
-    -1,-11, -7,  1,  7,  4,  1, -6,  4,  0, 10, -7, -5, -1,  2,  4 },
-  { -4, -4, -2, 14,  6,-32, -6,-14, 14, -5,-11, 10,-18, -4,  6, -8,
-     9,  5, -4,  1, -4,  5, -2, -9,  3,  5,  2,-10, -6,-17,  3, 17 },
-  {-16,  9, 21, 19,  4,-20,-17, 14,  9, 15, -6,-17, -1,  1,  6, -3,
-     1,  1,  8, -3, -6,  6,  9,  4,  9, -9, -5,  1, -1,  0, -1,  2 },
-  { -7, -5,  3, 19,  1,-20, -9, 14, 21, -7,-18, -9, 26, -7,-17, -7,
-    12,  6,  0, -9, -6, 14,  9, -9, -8,  4, 15, -7, -9, -1,  9,  1 },
-  {-20, 30, -6, 11, 24, -4,  0, -6, -2,  8, -4, 12, -8,-17,  0,  5,
-    -4,  1, -1,  3, -3,  5,  3,  3,  7, -2, -3, -2,  4,  0,  0, -1 },
-  {-35, 17,  6,  1, -9, -1,-16,  3,-20,-13,  8,  7, -4, -7, -4,-20,
-     7, 12, -5,  5, -5,-11, 12, -1, 15, -9, -6, 16, -4, -9,-13,  4 },
-  {-21, 36,-19,  9,  0, -7, -8,  9, -4, -3,  3,  0,  7, -8, -2, -2,
-   -11, 13, -1,  5, -3,  7,  2,  3, -1, -2, -5,  1, -1, -2, -5, -3 },
-  {-12, 33, -4,  1,-12, -9,  0,-13, -1,  2, -8,  4,-10,  6,-16, -7,
-    -1, -4,-10, 15, -1,  0, -5, -8,  5,  5, -3,  0,  2, -7,  1, -7 },
-  {-14, 32,  5, -7,-15,  3, -5,  8, 14,  5,  9, 13,  3, 18, -3,  7,
-     4,-10,-10, 10, -1,  2,  0, -2,-11,  5, -3, -4,  2,  2,  7,  4 },
-  {-14, 34,  1, 20, -1,-12,  0, -3, -7, -4,  7, 18,  9, -3, 14, -7,
-    -9,-20, -7, -4,-13, 12,  1, 12,  5, -6,  2, -4,  0,-15,  1,  3 },
-  {-21, 23,  7, -8,  3,-13, -3,  0, -6, -2, -7,  6,-12,  9, -6, -2,
-    -2, -4, -1,  6,  9,  5, -9, 15,  0,  8, -8,  7,  6,-15,  3, -5 },
-  {-27, 32, -1, -4, -2,  4,-10, 12, -3,  8, 13,  7,  0,-15,  4, -2,
-     3,  5,  7, -4,  9,-12, -1, -2, -1, -4,  0, -4,  2, -5,  6, -6 },
-  {-17, 29, 15,  0, -1, -4,-10, 13, 12, -1, -8,-10,-10,  4,  7, -2,
-     6, -5,-13, 19,  6,  1, -7,  2, -9, -2, 12, -4, -8, -3,  2,  4 },
-  {-38, 27, 16,-15, -6,  3, -7, -4,  0, -1,  6, -2, -3, -6,  6, -6,
-    -3,  0,  2,  0, -4,  6,  1, -1,  0,  4, -1,  3,  4,  1, -2,  5 },
-  {-33, 40, -4,  2,  1,  0,  0,-10,-14,  0, -7,  4, -1,  3, -2,  5,
-     7,  6, -1,  4,  1,  3,  1, -7,  1, -4,  5,  7,  0,  4,  3, -4 },
-  {-20, 25, 12, -4, 16, -4,  2,  2,-14, -2, -3, 29, -1,  1,  3,  1,
-     9, -5,  2, -8, -3,  1, -7, -2, -7,  1,  0,  4, 16, -2, -1, -1 },
-  {-10, 30, 17,  3, -5, -2,  0, -5,-22,  4,  5,  5, -3,-18, -6, 10,
-    -5, -7,  2,  8,  7, -7,-11, -2,  0, -3,  3,  2, 11, -4,  4, -4 },
-  {-11, 30, 11,  4, -3, -8,  1, -2,  4, 18,  3,  1, -1,  0, -8, -4,
-    -3, 10, 13, 14,  5, -5,  1,  1,-10,  2, 15,  4,  9, -1, -5, -3 },
-  {-17, 32, 18,-18, -3, -5,  6, 10,  1,-15, -5,  9,  8,-12,-10, -6,
-    11,  9, -5, -8, -7, 10,  5,-10,-14, -4, -3,  1,  9,-11,  2,  1 },
-  {-13, 28,-11, -1,  2,-16, -2,  7,-24,  0,  3,  6,  3, -1, -8, -7,
-   -12,  2,  2,-20, 10,  4,  0,-13, -2, -2,  1,  8,-14,  0,  4,  1 },
-  {-14, 23, 12,  8,  8,-26,  2, -4,-14, 13,-14, 15,  3, -9, -1,-13,
-   -10, -2,-10,  6,-16, 12,  8,  0,  9,-10, -7, -4, -4,  7, -8,  8 },
-  {-20, 45, 10,-14,  4, 16,  8, -9,  1, -8, 10,  5, -7, -2,  2, -5,
-    -1,  0, -5,  4, -6, -2,  4,  1,  3,  4, -4,  2, -2, -2,  5,  1 },
-  {-20, 26, -4,  1,  7,  4, -8,  1, -5,-13,  2, 13, -7, -3,  6, -6,
-    22,  0,  5, 11, -4,-11,  8, -9,  2, -2, -4, -2,  2,-13, -4, -8 },
-  {-28, 18, 17,  3, -8,-23,-16, -6,  5,-10, 14, 10,  5, -1, -8,  4,
-    -2, 13, -3, -2,  3,  4,  3, -2, -3, -4,  0,  1,  3,  4,  0,  4 },
-  {-12, 32, -6,-16, 18, 12,-16,  0,  7, 13, -4,  5, -8, -1, -3,  4,
-     6, -2, -1,-13,  4, -1,  3, 12, -3,-10,  1,  6,  8,-11, -2,  4 },
-  {-18, 26,  2,  5,  0, -9,-17, 14,  5,  1,  7, -3, -8, -3, 11,  7,
-    -5,-12, -8,  7,  0, -7,  2,-12, -9, 13,-11,  9,  6,-11, -5, 11 },
-  {-24, 22,-15, -9,  8,  1, -7,-12, -9,  3, 11, 15, 14,-11, 12,-15,
-    -5,  7, -2,  0, -8,  3,  3, -1,  2, 11,-11, 14, -6, 13,  1, -6 },
-  {-20, 28, 18, -4, -6, -5, 12, 14,  2, 10,-13, -6, -8, -6,-13, -1,
-   -26, 22, -3,-14,  6,  0, 10,-15,-13, -9,  6, -7,  1, -5, -4, -1 },
-  {-19, 26, -8, -3,-14, -6, -9, -4, -8, 15, -8,  3,-12, -4, -2, -7,
-    -5,  3, 13, -3, -4,-25,  4, -1,  5,-12, -1,-13,  5,  2,  0,  6 },
-  {-18, 43, 14, -8,  1,-23, -2, -2,  1,  3, -7,  0,  0,  8, -1, -3,
-    -5,  1,  5,  2,  0, -2, -2, -2,  1, -1, -1, -7,  0,  3, -3,  9 },
-  {-11, 30, 10,-14,  3,  1, 10,-11,  1, -7, -4, 14,  2,  1, -9,  1,
-   -11, -2, -7,  5,-11,  1,  3, 14,  1,-16, -8,  3, -5,  7, -4,  4 },
-  {-18, 24,  6,  3,  8,  7,-22, -7, -7,  3, -8,  4, 23,  9,  3, -1,
-     3,  6,  7, -1, -7,  6,  4,  1, -3,  1, -6, -1,  2, -7,  3,  3 },
-  {-15, 38, -7, -1,-11,  2,-17,-24, 24,  8,  7, -4, -5,  2,  2, -7,
-     1,  4,  0, -9,  5,  0, -1,  1, -1, -5, -6,  3,  0,  7,  8, -3 },
-  {-14, 22,  1, -5,  9,-12, -9, -5, -6,  5,  7,  8, -1, -4, -9, -3,
-   -33,-16, -9, -1, 12,-11, 17, -7, -3, -1, -7,  3,  2, -3, 16, -4 },
-  {-14, 20,  6,  4,-10, -4, -4, -4,  1, -7,  2,  6,  8,-12,  4,  1,
-    -1, 12, 10,  3,-14,-10, -3, 18, -2, 33, -5,-17, 17, -5,  9,  7 },
-  {-12, 23, 13,  0,-11, -8,-11, 12, -5, -9,-16, 11,  6,  4, 12, -5,
-     5,-13,  7,-12, -3,  1,  2, 12,  1, -4, -1,  5,  4, 11,-12, -3 },
-  { 15,  2, 14,  7,  1,  2,  1, 12, 10, 23,  4,  6,-20,-10,  4, 26,
-    -6, 13,  4,  3,  2,-11,  5, -7,-10,  4,  9,  1, 10, -4, 11,  4 },
-  { 17, 15, 31, 17, 18, 16, 11, 24,  2,  4,  2,  3, -8, -3,  7, -3,
-    -5, -7, -2, -6, -4, -5, -4, -1, -4, -2, -5, -6,  2, -1,  4, -2 },
-  { 16,  8, 15, 14,  3,  7, 21,  9,  8, 15, 21,  6,  8, 12,  5, -5,
-     7, -3, 10,  2, -3,  8,  6,  0,  5,  5,  6, -3,  2,  4,  0, -5 },
-  {  5, -4,  6, 12,  6, 13, 24, 17, -5, 17, -1, -6, -7,-10, -8,-18,
-     3, -2,  2,  7,-15,-11, 12, -3, -2, -2, -4, -7,  2,  0,  5,  5 },
-  { 10, -6,  8, 11, 12, 20, 22,-11, -3, 15, -3, 15, -2, -2,  0,  2,
-     5, -8,  4, -5, -9, -4, -1,  2, -1, -3,  1,  3, 13, -1,  9,  7 },
-  { -5,  8,  5, 11, 14, -5, 14, -9,  2, 35,  8, 15,  1, -2,  2, -2,
-     4, -9, -3,-14,-12, -2, -2, -4, -2, -8, -3,  1, -6,  3, 10,  0 },
-  { 16,  0, -6, 15, -3,  4,  4,  3,  3, 20,  5, -4, 10,  9, -9, -3,
-   -10, -2, -7, 11,-11,-10, 17, -1,  3,-15,  2,  9,-15,-10, 16, 10 },
-  { 14,  4, -7, 19,  3,  0, 19,  8, 16, 34, -9,  6,-13, -1,  6,  5,
-    -1, -2,  4,  3,  2,  1,  1, -1,  0, -7,  2, -1,  1,  0,  6, -1 },
-  {  1,  6,  9, 13,  9, 10, 15, 16, 10, 18, 13, 17,  3, -1, -7,  2,
-   -15,-11,-10, -4,-13, -6,-17,-13, -6,-14,  1,-10,  6,  4, -1, -1 },
-  { 13,  1,  7, 10, 14, 13, -7,  5,  5, 28, 14, 14, -2,  2,  3, -3,
-   -13, -4, 10, -9, 19, -4, -3,  4, -5, -5,  0,  5, -5,  0,  3, -4 },
-  {  1,  0,  6, 22,  9, 18, 18, -3,  5, 10, 12, -2,  1, -3, -8,-12,
-     9,-10, -7,  1, -1, 19,  0,  2, -8,-11,-10,  9,  6, 11,  0,  3 },
-  { 10, 11, 19, 44,  0, 14,  1, -7,  6, 22,  2, -1,  9,  2,  0, -4,
-     4,  0, -6, -6,  3,  0,  0, -2,  2, -5,  1, -2,  0,  1,  1,  1 },
-  {  5,  7,  0, 32, 30, 26,  5,  4, -7, -3, 15, -6,  3,-10,  7,  6,
-    -8, -7,  2,-13, -5, -1, -3,  7,  3, -2, -8,  0,  6,  4,  5,  0 },
-  {  9,  8, -2,  4,  2, 11,  4, 29, -5, 14,  8, -5,-14,  8,  0,  9,
-     8,-10,  5,-15, -6, -9,  9, -1, 18,-16,  9,-21, -3,-13, -2,  8 },
-  { 25,  7, -9, 23, 20, 18,  6, 16, -9,  8,  8, -5, 11, 13, -8,  7,
-     4, 10, -2, -1, -7, -9, -7, -9, -4,  1,  1, -5,-10,  8,  4, -5 },
-  {  9,  2, 16, 14, -5, 14,  1,  0,-21, 17, -1,  9, 12, -3, -3,  4,
-    -4, 14, 10,  3,  0,-10,  7,  4,  4,-11,  2,  4, -1, -3,  9, -1 },
-  { 17,  8, 11, 26, 15, -3, 14, -1, 12,  9, 10, -8,  8,-18,-11, -3,
-   -14, -7,  7, -3, -3, -4,  1, -7, -3,  2, -3, 16, 10,  0,  9,  6 },
-  {  9,  8,  3,  8, 18, 14, 11,  1, 10,  6,  1, -4,-16, -2, 14, -2,
-     1,  8, 12, 14,  3, -3,  8,  8, 12,-15,  3, -3,  3, -2, 14, 10 },
-  { 22, -3,-11, 13, -7, 11,  4, 11,  3, 14,  0, -6, -2, -9,  4,  2,
-    -2,  0, -5,-27,-10,  3, -1,  5,  8,-24, -3,-11, -3,  2, 11, -1 },
-  { 19,  2,  8, 36,  5, -6,  3, 15, -3, -4, -5, 14,-10,  1,-12,-10,
-    -3, -4,  3, -2,  1, -8,  4,  3,  5, -3,  0,  4,  8, -2,  8,  4 },
-  {  8, 14, 15,  9, -4, 10,  5, 11,  9, 10,  8,  9,-15, 15,  6, -8,
-   -10,-13,  5, -8,-20,-13, -6,-11, -1, -3, -6, -4, -1,  0, 13, 15 },
-  { -2, -1,  9, 12,  2,  2, 13,  3,-23, 33, 15,  2, -4, -1,  3,  8,
-     8,  6,  6, -7,  8,  6,  9, -1,  3, -8,  0, -4,  1, -8, 11, -1 },
-  {  6,  5, -6, 16,  2, -3, 31, 21, -9, 12,  0, -1, -4,  1,-12,  3,
-   -13,-18,  2,-11, -9,  2, -8, -6, 11, -3, -1,  0, -1,  0, 13,  5 },
-  {  5, -1,  2,  0, 25,  5, 10, 16, -5, 21, 14, 12, 13,  2, -5,  5,
-     5, -3, -2,-14,  0,-12,  7, 11, -1, -7, 19, -1, -1, -1,  8, -1 },
-  { 10,  7,  3, 11,  0,  8, 22,  3,  3, 19, -4, 12, 15,  9,  5, 15,
-     2,  1,  2,-10,-10,  0,  2, -1,  0,  1,-12, -1, 21, 16,  9, -7 },
-  { 11, -4, -5, 24, -7, 11, 20, 11,-15, 18,  5,-13,-15,  0, -5,  9,
-     1,  0, -1, -9,  4, -8,  6, -8,  1, -2, -7, 20,  9,  3,  9,  3 },
-  { 20,  0,-12, -6,  9, 31,  9, 12,  8, 27, 15,  7,-16,  5, -3, -7,
-    -1, -9, -2, -7, -3,  4, -8, -3,  3, -6, -2, -2, -3, -6, -1,  2 },
-  {  6, -6, 48,  8, -3, 19, 12, 11, -7,  2,  3,  0, -1,  1,  8, -4,
-     4, -6,  0, -4, -4, -3,  3,  6,  3,-13, -8,  5, -3, -7,  8,  5 },
-  {  7, -2,  6, 11, 12,  2, 14,  4, -5, 12,  2,  9,  4,  2,  0, -1,
-     2,  0,-15, -9,-16, -2,  8,-17, -5,-22,-19, -5, -1,-10,  1, -2 },
-  { 11, -9,  3, 12,  6,  6,  1, 17, -6, 19, 14,  7, -7, -1, -1, -9,
-     9,-11,-17,  0, -6, 16,  0,  1,  9,-24,  3,  3, -9, -3,  3, -2 },
-  {  9,  0,  1,  8,  1,  7,  2, -5, -3,  8, -1,  7,  2,  6, -3, -6,
-     5, -2,  6, -2, -4, -3,  0, -3, 13,-50,  1, -2,  2,  4,  4,  3 },
-  {  7,  0, 26, 21, -4,  2, 17,  8,  7, 11, -7,  1, -1,-15, -1,-15,
-   -11, -4,-17, -4,  1, -7,  3,  6,  3, -9,  2,  3,  6, 10,  6, 12 },
-  {  1, -2,  2, -1,-10, -4,  6, -3, -5, -2, -8,  2,  2,  2,  8,  0,
-     1,  1,  6,  0, 11, 13,  3,  4,  0,-12, 11, -5, 19, 20,  2,  5 },
-  {  5,  3,-13, -2,  1,-12, 11, -7,-12,  7, 10,  0,  7,  0, -2,  4,
-    -6, -9,-11,-12,-23, 12, 10, -3,  0,  6, 19, -1, 24, 18,  9, 12 },
-  {  6, -3,  2,  5,  2,  2, -2, -5, -8,-11, -4,  3, -8, -4,  5, -3,
-   -16, -4,  3,-12, -4,  3, 32,  7,  2,  8, 32,-18, -1, 12,  1,  7 },
-  {  0, -8, -1,  0, -8,  7, -8, -1, -1,  4,-12, -1,  3,  0,  1,-18,
-     8,  8,-14,-10,-11, 19,  9,  5, -7,  6,  8, -4, 26, 12, -1,  6 },
-  {  3,  5,-14,  7, 14,  8, 20,-13,-16,-10, -2, 17, -7,  4, -8, -9,
-    14, -5,  3, -4,-12,  7, 14,-10,-19,-20, 35,  8, 13, 14, -2,  9 },
-  { -2, -4, -1,  1, -3,  0, -1,  1,  2,  2,  6,  0,  0,  4,  5, -2,
-     3,  3,  3, -2, -7, -3, -3, -1,  6, -2, 29, 22, 13, 34,  0, 14 },
-  { -3, -9,  3,  1,  5, -4,  2,  0,  7, -9,  0,  2, -5, -3,  0,  6,
-    -1, -1, -1,  2,  2,  4,  8,  7, 20, -6,  7, 16, 33, 20,  6, -1 },
-  {-11,  1, -3, -3,-11,  3, -9,-25, -1,-16,  4, -8, 15,  1, -2,  7,
-     8, 23,  2, 18,-13, 16,  3, -7,  6,  3, 16, -8, 12, 16,  3,  4 },
-  {  0,  5,  5, -5,  1, -1,  2, -3, -2,  1,-13,  2,  2, 10,  6,  7,
-    18, 18,  7,  9,  8,  9, 21, 14,  7, 12, 15, 14, 15, 12, 11,  5 },
-  {  1, -5, 11, -2, 17,  8,  3,  0, -1,  6, 11, -7,  6,  6,  7,  5,
-   -15, 14,  1, 11,  4, 10, 12,  1,  2,  4, 30,  1, 11,  1,  6, 13 },
-  {  2,  4,  3, -7,  5,  8,-11,  7, -5,  9,-10,  6,  8,-10, -3, 10,
-     1,-29, -4,-26,  5, -8, 13,  4,  3,  6, 35,  1,  3,  6,  3,  0 },
-  { -2,  1,  0,  0, -1, -3, -7, -3, -9, -3, -1, -6,  3,  4,  4,  0,
-     5, -1, -2, -2, -1, -4,-10,  8,  0, -6, 10, -4, 46, 12,  2, 28 },
-  {  4, -1,  4,  1,  0,  4, -2, -2, -2, -1,  2, -4,  1,  5,  0, -3,
-     1,  1, -2,  0,  1, -2, -1, -1,  3, -6, 35,-11, 13, 53, -3, -1 },
-  { -5, -2,  0,-13,-16,  5,-12,-11,  1,-30,  3,-18,-24, -8, -5,-19,
-     1, -3, -8,  7, -7, -8, 15,-19,  4, 10, 30, 24,  6,  1, -9, 10 },
-  { -4,  8, -7, -4, -6, 12, -1, -9, -4,  2, -9,  3,  2, -2,  4,  2,
-    22,  9,  4, -5,  0,  5, -2, -9, -3,  1, 18,-12, 18, 16,  4, 16 },
-  { -5, -8, -3, -5, -3,  6, -7, -3, -2, -5, -3,  1,  2,  2,  4, -6,
-    10,  3, 12, -3, 20,  0, 27, -4, 16,  5, 18, -3, 23,  4, 12, 11 },
-  {  0,  1,  0,  1, -2,  1,  2,  1, -1,  0, -2,  2, -2, -4,  1, -2,
-    -2, -1, -5, -2,  0,  0, -2,  2,  9,  7, 63,  5, 12, -1,  1,  0 },
-  {  4, -3, -7, -5,-11, -5,-12,-10,-10,-12,-15,-12,-14,-14,  1,  1,
-    10,-10, 16,  6,  2,  9, 11,  9,  9,  8, 12, -1, 13, 12,  6,  3 },
-  {  7, -3, -2,  4,  6, -8,  2, -3,-12, -5, -9, -8,-10, 15, -2, -4,
-     8,  9,  7,-13,-18, 34, -5,  7, 12, 22, 16,-11, 13, 25,-15,-11 },
-  { -3, -2,  0, -4,  1,  0, -3,-13, -7, 13, 12, -7,-10, 13, 19,  6,
-    16, 15,-12,-15, -3, 34,  1,  5,  1, -9, 11, 21,  8, 17, -5, -6 },
-  {  3, -5,  0, -4,  0,  4,-11,  4, -7, -3, -1, -8,  3, -2,  2,  1,
-    11,  5,  6, 14, -3,  2, -4, -7,  0, 31, 15, -2, 24, 11,  5,  4 },
-  { -1, -4, -9,  5, -8,-18, -4, -9,-20,-18,  7,-14,-16,  3,  8, -3,
-    29, 11,-13,-13,  7,  1, 17,  6,  6, 21, 11,  1, 14, -8,  2,  5 },
-  { -3,  8,-10, -6, 12,  2,  1,  3,  3,  3,  3, -6, -8,-14, 15, -5,
-    16,  4, 16,  0,  7, -1,  0, 16,  2,  1, 22,  4, 19, 13,-11,  1 },
-  {  2, -3, 10, 20, -4, -1, -8,  5, -8, -9, -6, -2, -4, -7,  8,-10,
-     0,  8, -6,  1, -8, 14, 13,  5, 17, -6, 26, -1,  7, -1,  0, 12 },
-  { -4, -7,-31, -2, -7, -1,  5, -5, -5,-12,  4, -7, -6,  3, 15, -2,
-     5, -2,  7, -1, 10,  7,  8, -1, 14, 20, 14,  9, 16, 16,  8, 24 },
-  { -7,  0, -3, -6,  1,  3,-13, -6, -4, -4, -5, -9, -1,-10, -4, -8,
-     2,  0, -1,  1, 24, 24, 21, 31,  5,  2, 11, 12,  7,  4,  3,  6 },
-  { -3, -5,  6, -4, -3, -1,  2, -1, -2,  1,  0, -8, -1,  2,  0, -4,
-     6, 22, -1, -5,  8, 12, -1, -2, 28, 27, 20,-27, 14,  1,  2, -3 },
-  {  1, -5, -2, -2,  6, -2,  9,  1, -2, -5,  3,  4, 11,  5,  2,  8,
-    -3, -1,  1, -2, -3, -5,  5,  8, 49, 12,  8, -3,  9, 20, 12, 17 },
-  { -6,  0,  1,  7,  0,  9, -2, -4,  8,  0, -2,-10,  0,  7, 21, -1,
-     0,  1, 17, -7, -5,  2,  4, 16, -2, 17, 14,-20, 15, 14,  4, 15 },
-  {  0,  3, -4,  9, -4,  0,  6,  4, -6, -6, -5, -7,  2, -9,-10, -2,
-    -5,  0, -3,-21,  9, 14,-11, 13, 29,  2, 25,  4, 22, -1,  2, -3 },
-  {  2, 12,-11,  2, 16,  9, -4,  7,  1,-10,-15, 11, -4,  3, -2,  4,
-     4, -5,-10,  1,  4, 19,-15,  6, -4, -2, 30, -7, 11, 21,-12,  5 },
-  { -2, -3, -2,  4, -1, -5, -3, -7, -5,  1,  0, -6,  1, -6,  7,  0,
-     8, -7, -3, -2,  2, 14,  2, -3,-26, -1, 26, 22, 32,  1, -2,  6 },
-  {  1,-38, -1,-20, -2, -3, -6, -4,  2,  2,  7,  0,  3,  5,  3, 10,
-     6,  1, -3, -5,  7,  5, -5, -4,  8,  3,  1,-14, -1, -9, -5, -4 },
-  { -5,-26, -7,-19,-10, -5,-11,  5,-11,-25, -8,-14, -9,-16, -8, -6,
-   -17,-14, -1, -1,  6,  2,  2,  2,  3,  0,  2,  8, -8,  3,  0, -3 },
-  { 17,-49, -3,-23, -1, 11,  7,  3,  4, -4,  0,  0, -1,  4,  2,  4,
-    -2, -4,  2, -2, -1, -2,  2,  0,  0, -1,  0,  0,  1,  2,  0,  0 },
-  {  4,-34, -6, -9,  1, 21, -7,  3, -2, -1, -3, 18,  2,-16,  7, -3,
-     8,  7, -5,  7,  2,  4,  8, -6, -7, -2, -5, -1,  4,  1,  2, -4 },
-  {  5,-29, 13, -2,-14,  3,  1, 18,-15,  4, -8,  8,-10,  8,  2,  1,
-    -8, 15,  3,-10, -4, -4, -2,  0, -3, -4,  2, -3, -4, -3, 12, -6 },
-  { 13,-20,  3,-18,-17,  4,-14, 13, 28, 11, -8, -6, 16,  6,  0, 10,
-     3,  4, -9, 13,  5, -7, 12, -5,  0, -7,  5,  1,  3,  3,  2,  1 },
-  {  3,-27, -5,-11,-21,-11,-12,  0, -5,  7,-22,  1,  3,  5,  0, -5,
-     8,  7,  1, -5, -7,  2, -5,  4,  1,  3, -8, -2,  0,  4, -2,  6 },
-  { 31,-45,  0, -1,-12,  1,  2, -6,  4,  3, -1,  3,  3,  0,  5,  3,
-    -5, 12,  4,  6,  2,  1, -2,  1,  3,  2,  5,  2,  2,  2,  3, -1 },
-  {  9,-45,  6,  5, -1,-17, -2, 18, -3,  2,  0,  1,  0, -1, 10,  8,
-    -7, -2, -5, -8,  6, -1,  0,  4,  6, -3, 12, -1, -2,  0,  5, -7 },
-  {  3,-26, -2,-12,-12,  2,-10, 16, -3, 12,  4,  5, 11,  8,-16,-17,
-    -2, -3, -3,  2,  5, -9, 13,  1, 10, 11,  3,  5, -2,  2,  2, -7 },
-  {  8,-26, 32, -7, -5, 22,  2, 14,-10, -8, -7,  3,  3,  7,  0, -5,
-     0, -1, -3,  0,  8,  4, -5, -7,  6, -1,  4,  8,  1,  1,  7, -6 },
-  {  4,-31,  2,-14,  2,  0,  1,  8, -6, -1, 17, -3, 13, -6,  5,-10,
-    -2,-10, -2,-10, -3,  7,  1,  5, -8,  8,-14, -3,-15,  7,-10, -6 },
-  { 16,-27, 13, -4,-23,  7, -9,  6, -7,  5,  4,  2, -1, -3, 23,-18,
-     7,  0, -3,  4, -3,  9, -6, -2, -1,  8, -6,  2,  6, -3,  2, -2 },
-  { -1,-35, -2, -8, 11, -1, -7, -3, -2, 11,  7,  6, -6,-10,  9,  6,
-    -3, -5, -6, -3,  9, 16,-16, -9,-20, 12,  3,  5, -3,  1, -9,  4 },
-  {  2,-24,  1,-12,-16,  5, -4,  3, -4, -1,-11,-11, -8,-14, 14, 10,
-    -8, 20,  8, -3,-11,  1,  1, -4, -4, -7, -3, 15,  2, -6, -2,  7 },
-  {  9,-21,  2,-19, -7, -5, -8, 25,  3, 17,  5, -3,  9,-12,  8,  2,
-    -4,  3,  3,  1, 11, -9, -4, -3,  4,  3,-22,  6,  4,  6, 11, -5 },
-  { 16,-23, 13,-17,-21,-12,  5,  9,-20,  7,  6, -6,  0,  2, -9,  6,
-    -6,-13, -7, -1,  5, -3,  5, -7,-10,  1,  0,  8, -9, 11,  0, -8 },
-  { 10,-26, -9, -7,-19, -4,  6, 16, -7,  5, -4,  4,  8,  0,  4, -1,
-     6, -7,  1, -8,-11, 10,-14,  0,-16,  6, -3,  5, -1, 14, 12,  1 },
-  {  8,-27, 12,-14, -1, -1,-19, 10,-11, 21,-14,  9, -8, -3,  8, -1,
-    12,-13,  3, -4, -2,  0, -9,  0, -7,  2, -3, 12,  1, -3,  3,  1 },
-  { 18,-20,-14,-14,-16, -3,-24,  6,-17,  2, -3,-11,  2, -3, 12, 10,
-    10,  1, 10,  7,  8,  5,  5,  4, -1,  7,  2,  2,  0,  4,  7,  0 },
-  {  0,-30,  9,-16,-18, 15, 12, -3,  4, -4, -5,-11, -4,-12,-10,  0,
-     2, -2, -4, -1,  2,  0, -1, -6,  2, -3,  4, -5,  7,  3,  5,  7 },
-  { 25,-24, -1, -6, -9,  6,-13, -2,  3, 15, -3, 11,  4, -8,-11,  2,
-     0, -9, -2,  7,  4,  8,  5, -8,  5,  6, -1,-11,-15, -5,  0, 11 },
-  {  0,-34, -7,-11, -7,  9, -3, 19,  4, -8,  3,-11, 11, -3, -9, 12,
-     9,  9,  2,  1, -7,  1, -3,  0, -6, -2, -1,  3,  0, -7, -2, -5 },
-  {  6,-34, -4, -5, -3, -9,  2,  9, -1,  9, -5, -3,-26,-12,  8, -6,
-    -7, 11, -8,  4,  4,  1, -1,  0,  8,  9, -4,  7, -1,  1, -3, -1 },
-  {  3,-30,  5,  6,-10,  3, -7,  6,  3,  3,-26,-19, -3,  1,  7,  5,
-    -4, -5,  6, 10, 13,-10,  4, -7, -4,  5, -3,  9, -6,  3,  9,  5 },
-  {  4,-24,  9,-19,  2, -4, -5,  8, -3,  2,  0,-15, -1,  9, -4, 22,
-     6,  9,  3,  7, 11, -9,  0, -3,  4,  5, -5, 10, -8,  5, -7, -3 },
-  {  8,-27,  7, -3, -1,  2, -9, 13,  7, 12, -4, -6, -6,  5,  0,  7,
-     5,  1, 15, -3, -4,  0, -5, -2,  7, -5, -7,  1, -2, 13, -8, 13 },
-  { 17,-22,-15,-11, -8, 16,-14, 18,  2, -1, 14, -7, 14, -6, -6, -7,
-    -8, 17,  6,  4,  4, -7, -5, -9,-14, -6, -1,  9, -3,  1,  6, -5 },
-  { 25,-30,  2,-12,-13, 18,-18, 16,  8, -3, 10, -8, -3, -1, -6,  3,
-    -5, -7,  4,  6,  7,  1,  1,-11, -5,  6,  2, -4,  9, -1, -5, -2 },
-  {  7,-23,  7,-15, -1, -3, -1,  0,-10, 12,  2,  5, -4,  0,  4,  6,
-    -1,  5, -9, -1, -1, -7,  1, 17,  9,-17,-16,  8,  4,-14, 11, 14 },
-  {  0,-31,  7,-13,  3,-11, -7,  6,  1,-11,  8, -7, 15, -3, 16,-11,
-    -1,-15, 16, -3,  5,  0, -2, -2, -6, 11,  5,  6,  5, -5,  6,  3 },
-  { 13,-24, -2,-20,-10,  7, -3, -1, 15,  2,  6, -5, -7,-10,-20,  1,
-    -4, 14,  8, -2,  3,-13, -3,  1, -4,  1, -3,  2,  8, -7, 16, -4 },
-  {  1, -2, -2, -3, -4, -7,  0,  3,  6,  7,  3,  2,  1, -2, -1,  0,
-    -6,  4,  2, -4, -3, -4,  5,  9,  5,  0, -3, -3, -4, -7,-31,-50 },
-  { -1, -3,  7,  2, -1,  2,  4,  6,  0, 10, -2,  0,-20, -6, -3,  9,
-   -20,-22, -1, -1, 15,  9,-12, 10,-13,-20, 12,  3,  5,  6, -7,-26 },
-  {  0,  4, -2,-14,-12,  6,-13, 11,-10,  3, 22,  6, 16, -2, -5,  1,
-    -3,-11,  0, -7,  5, -5,  0,  1, -1, -6,  8,  8, 10,  9, -5,-27 },
-  { -5, 10, -2,  7,  9, -9,  5, -9,  5,  4,-15, 14,  1,  3,-10,  5,
-     0, -2,  7,  3,-13,  6,  9, -6,  5,-14,-17, -1, 11, 14, -2,-26 },
-  {  0,  6, -3,  0, -8,  6,  0,  1,  4, -8,  2, -5,  4,  7, 15, 11,
-     9, 19, -2, 14, -8,  7, -1,  3, -3, -3,-10, -2, 12, -2,-12,-29 },
-  {-12, -5,  0, -3, -2,  6,  3, -3,  2, -2,  1, 11,  2, -7,  5,  1,
-     2, -2,-14,  0, -1, -5,  3,  8,-28,-26,  6, -6,  3,  8,-10,-27 },
-  { -1, -3,  6,  2,  4, 15,  1,  0,  2, -2, -2, 13,  3,  6,  0,  6,
-    -1, -4, -1, -5,  8, -1,  5, -5,-15, 11, -8, -5, 14, -6,-14,-29 },
-  { -5, -6,  0,  1,  0,  6, -3,  2, -5, -1,  5, -3,  2,-10,  3,  4,
-     3,  0, 13, -3, -1,  4, -4, -6,  2,  9,  8,  2, -3, 28,-11,-31 },
-  {  1, -4,-10, -9, -4, -3,-15, -6,  1,  5, -3, -6,  5, -6,-22, 27,
-   -13,  5,  3, -7, -4, 20, -7,-12, -1,-24, -4,-13, -8,-11,-15,-21 },
-  { -6, -4, 19, -6,  2, 11, -6,  1, -3,-10,  9, -9, 12,-10,  2,  1,
-    -9,  1, 15,  7, -5,  5,-29,-35,  4,-30,  9,  9, 19, 17,  2,-17 },
-  { -3,  3, -3,  1,  2,  5, -1,  5, -2, -3,  1, -3, -8,  3, -4, -2,
-    -4, -1, 12,  0,  2, -8, -6, -4, 16, -1,-14, -2, 25, -6,-15,-36 },
-  {  0, -1,  3, -4, -4, -1,  7, -4,  8,  0, 10,  9, -4,  1, 10, -1,
-    -3,-13, -5, -4, -1, -4,  8, 11, 14, -7, -5, 16, 12, 13, -1,-28 },
-  {  1, -2,  2, -3, -8, 10,  4,  9, 12,  3,  5,  0,  8, -3, -6,  2,
-    16,-11, 11,  0,  1,  6,  1, 18,-10,-16, -1, -4,  5,-14,-15,-20 },
-  {  1,-12,  5,  4, -7,  8, -1,-17, -2, -9,-14,-11,  6, -9,  5, -4,
-     3, -2,  7, 18, -5,  5,  6, -1,-11, -2,-10, -3,  8, -3, -2,-32 },
-  {-12,  5, 20, -5, -6,-11, -6, -6,-13,  4, -6, 19, -8,  2,  3, -9,
-    -4, -4, -1,  9, -1, 21, -1,  7, 15,-10, -1, -3,  9, -3,  2,-24 },
-  {  0, -3,  2, -6,  4, -1, -9, -2, -1, -3,  6, -1, -5, -6, -5, -8,
-     0, -2, -6,  9, -4,  3,  2,-13,  1, -7, 23,-13,  4, -3,-15,-33 },
-  { -7,  2,-15, 11,-10, 14,  0,-11,  3, -1, 12, -4, -4,  9, 11,-13,
-   -13, -3,-14,  1,  3,  6, -5,  8,  0,  5,  5,-10,  4,  5, -6,-30 },
-  { -6,  4,  0, -5,  4,  1, -1, -1,  3,  6,  5, -2, -5,  0, -2,  5,
-    -4, -2, -4, -2,  4,  7, -7, -1,  1, -4, -3,-19, 37, 12, 10,-40 },
-  { -7,  2, -7,-12, 17, 11, -7,  2,  2,  3,  1, -1,  3,  4, -2, -5,
-     9, -9,  6,  4,  9, 12, 11, -5,  2, -1,  0,  9,  5, -7, -2,-24 },
-  { -7,  6,  1,  3,  1,  0,  6,  0,  4,-12, -2, -2,  1, -9, 10, -2,
-    11, -1, 21,-12, 15, -5, 10, -5,  5, -5, 14, -6,  5, -7, -3,-29 },
-  { -2,  0, -5, -2, -3,  1, -3,  0,  4,  2,  3,  0,  2, -2,  7, -2,
-     3, -5,  2, -1,  6, -4,  0, -3,  8,-11, 19, -8, 22,-34, 13,-35 },
-  { -1, -3, -1,  9, 11, -3, -3, -1,  7, 18, 11, -5,  2,-12,-11, 18,
-     9, -5,  1, -6, -9, 12,  1, -3, -3, -9,-14,  9,  9,  8, -6,-26 },
-  {  0,  5, -5, -1, -1, -2,  4,  6,  8,  2, -1, -2,  5,  1, -5, -4,
-     1,  1, 18,  1,  7,-10,  3, -2, 12, -1,-15,  9, 12,-14, 13,-38 },
-  {  3,  0, -8, -1,  0,  8, -9, -3, -8, 16,  3, 16, -5, -9,  0, -1,
-    -7, -1, -4, 13,  7,  0,  1,  2, -1,-16,  0, -2,  1,  8, -8,-28 },
-  {  7,  9, -5, -3, -2,  2,  0,  3, 11, -6, -4, -2, -2, -5, 28,-18,
-    -6,  2, 15,-10,-15,-10, -2,  0, -2, -2,  4, -3,  7, 11,  5,-30 },
-  {  9,  0, -7, -1, -4, -7,  2,  2,  9, -2,  2,  3, -8, -6, -6,  3,
-   -10,  4, 10,  5, 21, -4, 14,-18,  1,  3,-10, -2,  6, 14, -8,-26 },
-  {-14, -1,  2,  3, -3,  7,  1,-22, -1, -1,  0,  1, 12,-14,  3, -5,
-     0, 10, -3,  1, -5, 12, -3, 10, -8,-22,-11,-13, -7,-10,-13,-25 },
-  { -2, -5, -4, -4, -9,-18,  9, -3, -5, 17, 13,  5,  6, 11,  3,  8,
-    20,  4,  2,  9,  8,  5,  6,  1,  7, -7, -6, -2, -7,  0,-17,-23 },
-  { -5, -5,  2,  0,  6,  2, -2,  2, -3,  4,  4,  0, -5, -2, -4,  6,
-     8, 10, -1,  1, -5,  5,-14, -2,-11,  8,  6, 25,  7, -1,  0,-43 },
-  { -4,  0,  4, -2,  7,  0,  3, 17,  5,  2, -5,  1, 21,  3, -2,-10,
-   -16, -9,  7,-12,  9, -8,  2,  5, -5,-10, -2,-11, -5, -1, -9,-30 },
-  { -2,  3,  1, -4, -1,  0,  8,  1, 12,  4, -1, -1,  3,-17, 13,  9,
-     0,  7, -6, -5,  9,  1,  5,  4,-10,-18,  0, 14, 11, -4,-16,-28 },
-  { -1,  0,  2, -1,  4,  1, -1,  1, -1, -2, -1, -2,  3,  0,  0, -1,
-    -1,  1,  2, -2,  3,  3, -2,  4, -2, -1, -6,  1, -1, -1,  6,-70 },
-  {  7,  3,-11, -1, 12, -4,-14,  4,  4, -4,  4, -2,  2,-12, -4, 15,
-   -17, -4, -3,  6,  8, -5, 22,-22,  5,-11, 15, -4,  4, -1,-21, -1 },
-  { 10, -2,-13, 11,  4, 14,  4,  9,  8,  8, 19, 15, 14, 15,  5, 10,
-     8, 15, -5,  4, 14, -8,  1,  1,  2,  1, -1, -3, 21,  8,-29, 13 },
-  { -6,  0, -6,  6, -1,  2,  8, -4, -5,  4, -4, -5,  0, -2, -4,  0,
-     9, -2,  1, -2, 26,-19, 21,-10,  4,  1, -8,  5, 22,-10,-13, 15 },
-  { 11, -5,  1,  0,  6,  3,  7, -2, -2, -3, -5, -1, -2, -6,  1,  1,
-    -8, -5,-13, 13, -2, -3, -1, -9,-28,  4,  2,-11, 18,-20,-24,  9 },
-  {  7,  4, -3,  6,  6, -6, -7, -5, -7, -4, -4,  0, -7, -5, -6, -5,
-     2,-13,-12,  2,  0,  5, 18, 15,-13, -7, 13,-20, 16,-10,-19,  6 },
-  {  5, -8, -1,  5, 10,  2, -1,-10,-11, 23,  8, -5, -8,  4, -5, -4,
-    -5, -5,-11, -8,  5,  1,  7, -9, -9, -6, 12, 14, 17,-12,-22,  3 },
-  { -5, -8, -3,  3, 12, -1,  0, -4, -5,  1,  1,  6,  1,  5, -5,  7,
-    -2,  7,  1,  6,  6,  2,  0, -5, 17, -4, -5,-24, 13,-20,-27, 14 },
-  { -1,  2, -3,  1, -3,  1, -3,  0, -2,  3, -2,  1,  2, -1, -2, -1,
-    -2, -5,  5, -2,  0, -7,  1, -6,  8,  8, 11, -5, 24,-43,-13,  2 },
-  { -2,  4,  7, -3, -4,  4, 13, -4,  0,  0, -2,  9,  0, -3, -6,  1,
-    -7,  1, -1, 10,  0,  5, -1,-24, 25,-15,  7,  2, 22,-10,-21,  0 },
-  { -5,  2,  6, -2, 13,  3,  5,-12,-11, 16,  6, 10, -5,  0, -3,  6,
-     5, -5, -5, 10, 12, 10, 11, -7,  8,-14,  2,-15, 13,-14, -8, -3 },
-  {  5,  6, -7, -5,  5,  2,  9,  5,  0, -1, -4,  2,  8,  0,  3,  5,
-   -12,  3, -3, -6,  2, -1, -5, 14, 11,-20,-21,-25, 24, -1,-10,  6 },
-  { -5,  5, -2,  9,  4, -4, -1, -6, 11, -6,  5,  0,  2, -3,  6, -1,
-   -17,-18, -4,-13,  9, -1,  9, -7, -4, -8,  2, -3, 12,-31,-18,  5 },
-  { -7,-11,  6, -8,  4, -3,-12,  0, -1, -6, -3,  0,  5,  9,  7,  2,
-     1, -8, -6,  8,  2, -5,  7, -1, 16,-10, 16,-12, 18, -1,-25,-12 },
-  {  3,-12,  1,  2, -2,-18, -8,-15,-10, -9,  2, -7, 11,-11,  2, -1,
-    -1, -1, -9, -6,  3,-14, -2, -1,  2,-13, -7, -9, 19, -5,-17,  2 },
-  {  7,  1, -8,  7, 17,-13,-10,  5,  7,  1, -6,  4,  9, -4,  0,  3,
-     8,  1,-14, -9,  4,  7, -9,  0,  6, -5,-12, -2, 25, -2,-19,  1 },
-  {  7, -3,  6, -3,  1,  6, -7,  0, 10,  0,  4, -5,-17, -4,  4, -1,
-     0, -3, -7, 19, 24, -1, 21,  8, 10,  9,  8, -1, 23, -2,-18, -2 },
-  {  3, -3,  0,  5,  8, -2, -9,  2,  9,  6, 19,  8,  2,  6, -9, -2,
-    -4, -3, -8,  7, -7, -8,  5,  4, 26, -6,  7, 18, 24,  0,-13,  4 },
-  {  0,-13,-11, -1,  3, -9,  5,  4, -7,  3,  0,  2, -1,  4, -5,  2,
-     9, -2,-11, 15,  1,-21,  1, -1,  0,  4,-14, -4, 24,-16,-13,  1 },
-  {  1, -9, -8,  0,  0, -4, 11, -1, 14, 16,  0, 17, -2, -9,-12,  0,
-    -1,-14, -9,-14,  0, -2, 19,  4,  6,  4,  4,-11,  8,-17,-19, -5 },
-  { -3,  1,  2, 12, -4,-18, -1, -4, -7, 14, -3,  2,  0, -7, -8, 12,
-    -5, -9, 14, 12, -9, -2,  4, -6,  4, 18, -1,-25, 22,  2,-23, -5 },
-  { -2,  0,  0,  0,  1,  3,  5, -1,  5, -2, -2,  2, -3,  0,  1,  2,
-     0, -1,  2, -1, -9, -6, -7, -4, -2,  4, -7, -5, 64, -3,-25,  4 },
-  { 12, -2, -3,  0,  8, -9, 13, -7,  6, -3,-12, 12, 15, -9, -4,  2,
-     9, -4,-12,  3, 14,  1,  7,-15, 15,  0, -6,-12,  0, -3,-20,  6 },
-  {  2, -1, -4,  5,  9,  6, -7,  2, -2, -7, -2,  0, -1,-18, -4, -6,
-   -15, -5, 11,  5,-10, -1,  2,  7, 12,-19, -7,  8, 21, -4,-15,  4 },
-  {  4,  2,  5,  5, -5,  1,  3,  2, -8, 13,  0, -5, -2,-14,-11,  6,
-     2, 17,  8,-13, 26, -2,  5,-15, -4,-14, 12, -9, 13,-21,-23, -4 },
-  {  2, -3, -2, -3,  3, -2,  6,  9, -9, 13,  4,  2, 12, -3, -3,  1,
-   -17,-22, -3,  4,  3, -2,  1, -9,  1, -6, 11,-13, 14,  0,-15,  6 },
-  {-16, -4, 17, -2,-20,-11, 11, 10,  5, -8, 16,  2,-17,-14, 11, 11,
-    -6,-11, -7, 12, 12,-10, -6,  5,  8, -4, -2, -5, 28,  3,-13,  4 },
-  {  0, -3,  3, -7,  6,  8,-12, 20,-19, 18,-11, 10, -5,  0, -9, 11,
-     3,  0, -2,  9, -7, -5, 18,  3, -2,-16,  1,  6, 12, -7,-16,  1 },
-  {  4,  1,  5, -5, 15,  2, -8,  3,  5,-11, 15, -3,  8, -8, -1,  7,
-     4,  7, -2,  6, -9,  5, 12,  2, 33, -2, -6,-18,  4,  0,-18, 11 },
-  {  3, -1,  1, -1,  0,  1,  4, -1, -5,  0,  1,  0,  4,  2, -1,  4,
-    -3,  2,  0, -2,  4,  6, -1,  6, 42, 19, -4,-37, 19,  1,-15, -4 },
-  {  2,  0, -5,  0, 10,  0,  0, -5,  3,  0,  0, -3, -3,  0,  2, -4,
-   -10,  2, -6,  4,  4,  1, 27, -7, 17,-34,  5, -9, 15,-16, -7, -5 },
-  { -2,  7,  7, -2,  9, -2,-15, 11, 11,  7,  5,  1, 15,  1, -9, 31,
-     2,-15,  2,  4,  3,  4, -1, -8,  2, -7,  6,-17, 11,-14,-11,  2 },
-  {  1,  1,-11,  9,  9, -6,-14,-11,-10,  8, -3, 11, 16, -9, -8,-13,
-    -8,  9,  0,  6,  6, -2, 13, -8, -2,  3, 13, -3, 10, -6,-17,  4 },
-  { 14,  5,  4, -6,-12, 10, -7,  8, 21, -8,-30, 15, -2,  1, 11, -9,
-    -5,  1,  0, -1, -1, -6, -2,  3, -5,  7,  9,  5, -5,  2,  0,  1 },
-  { -1,  2, 20,-17,-15,  3,  3,  7, 11,-17,-13, -6, -3, 18, 17,-15,
-    -4, -4, -5, 22, 14,-14, -2,-10, -7, 11,  8, -7, -3,  0, -7, 11 },
-  {  7,-11, -7, -8,-14, 22,  5,  2,  6, 13,-12, -2, 10,  3,  0,-21,
-    -4, 20,  3, 10, 21,-10,-12,  8, 11,  2, -5,  2,  1,  3, -1, 15 },
-  { -1, -2, -1, -2,-13,  8, -4,  0,  7, -2,-17,  8, 18,  5,  3,  8,
-    -8, -2,  3, -4, 14,-18,-13, 14, 15,-13, -1, -2,  4, 11,  1, 12 },
-  { 13, -6, -4,-16,-17, 16, 21, -2,  5,-11, -9, 19, 21,-17, -3,-17,
-     3, 12,  8,-12, -6,  1, -7,  9,  9, -7, -5, -1, -3,  5, -6, -4 },
-  { 11,  5, 12,-20, -6, 10,  4, 12,  8, -5,-10, 15, 13, 14, 10,-15,
-   -13,  1,  6, 14, 15,-17,-13,  4, -5, 10,  7, -6, -8, -3, -4, 12 },
-  { 25, -1,  7, -5, -7, 11,  1, 17, 13,-15,-14, -4,  5,  3,  8, -3,
-    -2,  2,  0,  6, 16,-12, -6, -4,  4, -3,  7,-10, -3, -7,-13,  7 },
-  { -8, 10, -3,-13,  5,  2,  4,  9,  9,-17,-13,  2, 11,  1,  6, -4,
-     8,-10,  4,  1, 19,-15, -4, 12, 31,  7, -5,-17, -4,  9, -2,  7 },
-  { 14, -6, -6, -6,-14, 13, 17, -5,  4,-14, -9,  7,  7, -9,  3,-16,
-   -15, 11, 11,  6,  4,-11,-19,  3,  5,  8, 13,-14,-14,  3, -4, 12 },
-  { -2, -4, 10, -4, -7, -1, 27,  5,  2,-16,-18,  4, 12, -2, -3, -2,
-    -1,  1, -8,-12,  3, -4,  8, 15,  2,  4,  9,-13,-14,  9, -7,  5 },
-  {  4,  2,-10, -5, -7,  2,  1,  4, -1, -6,-15,  6,  1, 10,  5,-10,
-    -9, -1, 13, -3,  5,-21,-11,  8,  8,  5, 27,-21,-18, -5, -1, 15 },
-  { 11,  1,-16, -8,-11,  0,  5, -8,-12,-13,-17, 22,  4, -6, -1,-18,
-   -10,  0, 19,  2, -2, -8, -7, -3,  2, -2, -9,-17, -5,  4,  4, 10 },
-  {  8, -6,-19, -5, -4, 12, 14, 15, 10, -9, -1, -9, 19, 12,  0, -1,
-     2,  4,  7,  9, 16,-16,-14,  9, -4,  3,  1,  0, -2, 10, -1, -1 },
-  { 12, -8, 12, -9,  0, 25,  7,  9,  2,-31, -9, -4, 15,  4, -5,  1,
-   -10, 11,  8, 10,  0, -6,  5, 11, -1, -6,  4,-10, -9,  6,  4,  5 },
-  { 14,  6,-17, -2, 17, 12, -9,  2,  0,-25,-14,  5, 20, 14,  8,-20,
-     5,  2, -2, -3,  9,-13, -3, -1, -6,  3,  7, -6,  0,  2,  3,  1 },
-  {  8,  4,-15, -3, 10, 18, -4, 13,  8,-22,-10,  9, 19,-15,  7, -5,
-   -13, 12, -4,  9,  2, -9, -6,  0,  2,  1, -9, -6,  6,  1, -1, 11 },
-  {  4,  1,  4, -5,-10, 18,  7,  2, -4, -9,-11,  0, 32, -7,  4,-16,
-    -1,  0,  6,  3,  6, -3,-14, 16,  9, -2,  7, -1,  0, -5,  5, -3 },
-  { -3,  2,  3, -8, -6,  4,  6,  2,  4,-12,-15,  2,  8,  8,  9, -3,
-   -18,  6, 34, 11, 12,-15, -1,  2,  9,  2, -4, -4,  2,  4,  2, -3 },
-  { 18, -6,-12, -8, -1, 15, 20, -4, -1,-11, -5,  6,  6,-11,-15, -7,
-     3,  7, 10,  2,  8,-10, -5,  8, 15, -5,  5,-17,-13, 13, 11,  7 },
-  {  8, -4, -6, -1,-14, -3,  6, -2,  1, -5, -1, 10, 10,-15,  5,  0,
-   -10, -4, -3,  7, -4,-19,-15, 27, 11, 18,  3,-19, -2,  6,  0, 12 },
-  { 12,  0, -5,  0,  4, -5,  1,  5, 10, -7,-11, 21, 29,  1, -2,  1,
-    -4,-11, -1, 13, 11,-20, -1,  4,  4,  4, -5,  6,-13, -2, 11,  9 },
-  {  2, -7, -7, -3,-10, -1, 20, 12,  1,-19,-19, -1,  5,  4, -7,-25,
-    14,  1, -3,  2, 12, -4, -3, -3, -2,  6,  1,  0,  3,  2,  5, -1 },
-  { 12, -8,  3,-12,-10, 10, 13,  0, 23,-14,-18, 10,  0, 15,  3,-12,
-    -3, -5,  5, -4,  2,-14,-10,  8,  2,  9, -1,-11, -3,  5, 13,  2 },
-  {  9, -6,  7, -7,-30, 17,  6, 13,  1,-14,  0, -1,  6, -9,  8,  3,
-    -4,  0, -1, -7, -5,-13,-19, -3, -4,  4, -6, -2,-13,  1, -2,  3 },
-  { 10,  1,  3,-18,-26, 17,  4,-16,  4, -3,-13, -4, -6,-11, -4,-21,
-     7,  8,  2,  5, 13, -6,  1,  5,  8,  7,  9, -6, -6,  1, -1,  2 },
-  { -3, -1,  0, -2, -2,  0, -1,  3,  4,-14, -8, -9, 13,  2, 50,-23,
-    -8,  8,  7, 11, 16,  3, -7,  0, -2,  6,  5, -1,  1, -2,  4,  3 },
-  {  1,  3,  1,  1, -6,  3,  6,  6,  2, -2, -3, 10,  2, -8, -5, -5,
-     5,  4,  4, -2, 10, -8,-40, -1, 21,  8,  3, -4, -1, 13,  4,  7 },
-  {  2,  0, -4, -8,  5,  2,  7, -5,  5, -8, -4, -1, 12,  2, 12,-13,
-    -9,  0,  1,-12,  9,-43,  1, -5, 12,  1,  3,  6,  1, -1,  3, -2 },
-  {  6, -2, -1,  1,  0,  4,  8, 14,  4, -7,-23, -5, 23,-17, -6,-15,
-    -8,  7, 10, -1,  7,-16,  4, -6,  2,  3, -3, -3, -1,  8, -1,  4 },
-  { 10,  4, -4,  1,  7, -3,  2, 11,  4, -6, -3,  8,  5,  4,  1,-45,
-    -6, -4,  4,  2,  1,-14,-10,  1,  1,  6,  2, -8, -1, -3,  3,  3 },
-  {  1, -1,  2, -3, -8,  9,  3,  3, -2, -5, -8,  8,  7, -7, -4, -6,
-     5, -9, 11, -2, 46, -5, -1,  9, -2,  0,  3, -5, -3, -5,  7,  0 },
-  { -4,  1, -2, -1,-11, 11,  8, -3, -2,-10,  0,  4,  9,  9,-17,-17,
-   -34, -4, -5, -7, -3,-12, -3, 11, 18,  3, -2, -5,-18, -5, -3,  6 },
-  {  7, -5, -3,  1, -4, -3, -5, -1,  2,  5, -2,  3,-10, 12,-18, -5,
-   -10, 12, -9,  4, -6,  2,  0, 16,-17, 15, 14,-12,-10, -2, -9, -1 },
-  {  4, -5, -3, -5, -3, -1,  7, 18, -7, 12,  3,  5, -8, -4,-20,  1,
-   -25,  1, -8, 13,-10,  8,-19, -1, -8, 10,  6, -9, -1,  0, 12,  4 },
-  { -4,  5,  0, -1,  2,  5, -8, -2, -6,  4, -8,  9,  3,  2, -7,  4,
-   -25, 13,-23, 10, 14, 15,-11,  3,-18,  4, 16, -4,  1,-10,-10,  3 },
-  {  5, -3, -1, -3,  4,  1, -3, -4, -5,  1,-12, 14, -7, 11,-15,  6,
-    -6, 24, -4, 13, -1, 15,-13,  8,  3,  7, -5,  2,  2,  0,  3, -7 },
-  { -3,  1,  0,  8,  6, -1,  6,  5, -5, -2,-12,  4,  0, -2, -3,  5,
-    -6,  0, -8,  9,-10,  4,-28, 12,-20, 11,-13,  7,-18,  1,-11,  1 },
-  {  1, -4,-15,  5,  0,-13, -5, 13,-11,  4, -4, -5,  5,-14,-16,  0,
-   -14,  5,-20, 12, 10, -7, -5,  6,  6, 22,  6, -4, -2,  3,  8, 11 },
-  { 13,-11, -2, 16, 16, -7,  0, 20, -7, -1,  0,  5, -9, 12, -2, -5,
-   -22,  5,-10, 12, -6, 11,  9, 21, -8, 15,  4,  0, -8, -4, -4, 10 },
-  { 18, -4,-13,  0,  1,-15, -1, -3,  2, 10, -1,  6,  1, -4,-20, -5,
-    -8,  6, -8, 17, -5,  5,-10,  8,-22,  6, -5, -2,  8,-17,  8,  2 },
-  {  1, -2, -9,  6,-31, -8, -8,  8,  0,  5, -9, -4,  2,  3,-12, 11,
-   -18, 10, -5,  3,-11, 13, -6, 11, -3, 12, -7,  3, -9, -1,  2, 11 },
-  { -9, -6, 21, -8,-15,  4,-11, 12,-11, 17, -1,  2, -6,  0,-15, 13,
-   -12, 19,  0,  2, -6, -3, -9, 10,  3, 17, -2,  5,-10, -3,  0,  1 },
-  {  4, -6,  5,-10,  1, -5,  1,  0,  0,  0,  2,  7, -2,  2, -2,  0,
-    -4,  3, -4,  1,-12,  6,-49, 16,-10, 13,  0, -2,  8,  6,  1,  8 },
-  {  5, -8, -7,  9, 13, -5,  7,  0, 10, 11, -4, -3, -1, 13,-14,  6,
-   -15, -6,-14, 16, 15,  1,-18, -4,-20, 20, -7, -1, -9, -2,-10, 10 },
-  {-12,  4,  0, 10,  0,  3,  8,  4,-27, -1, -2, 19, -4,  2,-13,  3,
-     1,  9,-12,  1,-22, 19, -5,  4, -9, 12,  2, -9, -8, 11, -3,  7 },
-  {  4, -5, 11, -6, 17,-17,  5, -4, -2, -6,  1, -5,  2,  4,-14,  6,
-   -20, 19,-20, 12,-21,  5,-14, 13, -2, 11,  4, -3,  0,-10, -4, -2 },
-  { -2, -1, -3,  8, -9, -7,-22, -3,-24, 13, -2, 10,-15,  5, -9,  4,
-    -7,  0, -5, 15, -8, 11,-13,  6, -4, 19, -8, 12, -4,  6,  9,  7 },
-  {  2, -3,  2, -1,  0,  3,  1,  2,  1, -4, -2, -3,  1,  5,-12,  6,
-   -16, 14,-23, 10,-14, 17,-15, 16, -2,  9,-25,  9,-10, 16,  4,  9 },
-  { -3,  7, -8, -3,  2,  2, -4, -8, -9, 10,  3,-11, 25,-10,-28, 27,
-    -9,  7,-13,  9, -2,  4,-12, -8,-14,  6,  7,-10,  3,  3, -3,  5 },
-  { -8, -3,  1,-10,  8, -3, -9, -4, 13,  7,  2,  4,-10,  4,  3,  7,
-   -18,  2,-22, 15,  4, 20, -7,  5, -6, 13, -1,  4, -7, -6,  6, 13 },
-  { -2,  3,  0,  2, -4, -2,  0,  0,  1,  2, -2, -5,  0,  1, -4,  0,
-    -2, -3,  1,  2, -1,  2, -8, -1,-24, 68, -3,  8,  3,  3, -1, -1 },
-  {-15, -2, -9, -7, -1,  8,-14,  8,  3,  6,  0, -1, -8,  8,-23,  2,
-   -14, 17,-15,  8, -4,  7,-18,  0, -8, -3, -1, -4,-10,  4, -1,  4 },
-  {  8,  0,  2, -7,  0,  5,  1,  3,-11,  4, -8, 14,  3, 20,  1, 26,
-   -11, 13,-13, 20, -2,  0, -8,  2, -6,  6, -1,  9,  3, -6, -3, 10 },
-  {  5,  0, -1, -7, 10,  1, -3,  5,  4,  7, -5, -1, -3, -1, 12, -3,
-   -15,  7, -9, 22,-19,  8, -9,  4,-23, 13,-14,  6, -6,-14, -4,  7 },
-  { 14, -5, -8,-10, 25,  3,-23, -7,-28,  0, -1, -9,  4,  1,-13, 20,
-    -8, 10,-16,  8, 12,-13,-21,  5,-13, 11, -2,  1, 12, -7,  2,-10 },
-  { -5, -4,  9,  5, -6, 35, -7,  8, 15,  2, -1, -9, -6,  2,-18,  7,
-   -15,  6, -3,  2,  8, 12,-30,  7, -4, 20,  2,  6, 13, -6, -4,  0 },
-  {  1,  8, -9,  9, -5, 12, -9, 16, -9, 16,-17, 14,-13, 15,-18, 14,
-   -15, 17,-12, 14,-13,  7,-16, 13, -9,  5,-11, 10, -9,  6,-12, 13 },
-  {-10, -4,  5,  3,  1,  6,  8,-14, -5, 15,  7,  4,  8,  7,-22,  8,
-    -7, -8,-15, 26,  1, 13, -3, 17, -5,  9, -2,  4, -6,  3, -8,  9 },
-  {  8, -3,  2,  3,  3,  1, -2, -1,-11,  8, -4,  0, -6, -5, -1, 13,
-   -37,  9,  1, -6,-10, -2,-10, 11,  8, 13, -3, -2, -6,  8, -4, 13 },
-  {  3,  2, -3, -4, -4,  7, -8,  9, -8,  9,-20, 12,-19, 15,-18, 17,
-   -15,  7, -1, 20,-11,  6, -6,  3,  1,  9,  2,-14, -2, -2,  2,  1 },
-  { -7,  1, -1, -3, -6,  4,  4, -3,  3, -1,  5, -4,  3,  2, -1,  9,
-   -59,  5, -4, 30,  3,  3, -2, -3, -1,  2,  2,  1, -1, -1, -2,  1 },
-  {  0, -3,  2,  0, -1, -8,  0,  2, -3,  4, -4,  1, 10,  6, -6,  8,
-    -7,  4, 10, 11,-41, 27,-20,  3, -3,  8,  1, 11, -5, -8,  0,  4 },
-  {  5,  1,  4, -2,  1,  2, -1,  6, -7,  2, 11,  4,  0,  0, -8,  7,
-   -10,  0,  0,  8,  2, 10, -1,  1, -2, 44, -2,-21,-12, -3, -1,  2 },
-  { -4,  4, -2, -2,  6, -8,  2,  1,-10, 14,  8,  6,  5,  1, -2,  4,
-   -13,  4,  2,  5, 10, -2,-21, 32, -3, 18,  9, -6, -9, -9, 10,  2 },
-  {  9,-16, -6, -2,  1,  4, 22,  2, -2,  1, -3, -2, -9,  3, 16, 19,
-   -24, -6, -6, -5, -8, -7,  8, -7, -1,-12,  5, -3,  0,  4,  2, -3 },
-  { 10,  3,-16, -4, -1, 13,  4,  4,  1, -3,  1, -6,-14, 18,  3,  8,
-    -8,-28,-16,  4,  4,  2, 12,  7,  9, -4, -4,  5, -1, -1,  2,  2 },
-  { -5,-13,-22, -3, -8, 21, -2, -9, 21, -4, -9,  5, -8, 15,  5,  1,
-    -5, -9, -7, -2, -5, -5, -1, -5, -5, -5,  3, 10, -4,  0, -7, -2 },
-  {  5,-10,-18,  2, 20,  4, 13,-10,  8,-15,-11, -3, -1, 16, 10,  9,
-    -8,  6,  7, -5,  6, 11,  5, 17, -4,  7,-11,  5, -3, -6,  2,  1 },
-  {  3, -5,-19,  1,  1, -3, -2,-25,-11,-17,  0,-13, -4, 10, 10,  2,
-    -5,  4,  0,  3, -3, -5,-10, -2, 13,-22,  0,  3,-11, -5,  7, -1 },
-  { 12,-14,-29,  6, -1, 10,  7,-17,-12, 14,  3,  9, -9,  9,  7,  6,
-    -3,-13,  0,  5,  3, -1, -6, -1,  0,  2,  4,-12, -5, -1,  2, 11 },
-  { 12,-15, -7, -2,-12, 17, 20,-16, -2,-12, -6, 15, -6, 12, 11,  9,
-     7, -6,  7, -4,-19,  6,  2,  2,  3,-11,-10, -4, -5, -3,  3,  2 },
-  { 11,-22, -6,  0,  8, 18,  3,-11, -4, -7,-15,-17,-12,  6, 16,  4,
-    -9,  4, -5,  3,  6,-16, 10, -7, -7, -3,  5,  0,  1,-15, -4,  5 },
-  { 12,-22,-16,  5, -6,  8, 12, -4, -9,-17,-11,  3,  5,  8,-17,  0,
-    11, -4,-13, -6,  2, -1, -1,  3,  3,-11,-12, -1,  1,  1, 12, -2 },
-  {  8,-10,-33, -5, -3, -6,  1, -7, -8, -4, -6, -1,  5, -4, -6,-12,
-   -16, -8, 11,  8,-14,  7, 12, 11,  4,-14, -3,  6, -7, -5, -3,  3 },
-  {  0, -8, -7,  2, -4, 24,  2, -9,-11, -3, -7, 11,-12, 17,  1, -1,
-     3, -5, -7, 12,  4, 11,  0,  3,  2,-18, -3,  4,  7, -6,  3, 15 },
-  { 10,-15,-16, -2, -4, -9,  7,-15, -6,  2,-16, 13, -8,  7, 19,-21,
-    -4,-12, -9, -3, -3,  6, 11, -3, -1,-19,  3, -7, -9, -4,  3, -6 },
-  { -5,-10,-21,  0, -3, -7, 18,-21, 15, -5,-12, -4,-13,  2,  6, -9,
-    -9,-11, -4, 13, -3,  6,  4, -1,  7, -9, -4,  9,  5,  2,  6,  3 },
-  { 15, -1,-27, -2, 10,  3,  7, -8,  9, -2,  7,  1, -2, -5, 18,  9,
-   -11,-17, -2,  7, -9, 11, 10,  0, -8,  6,-16, -3,  2, -7,  3, 11 },
-  {  4, -9,-39, 19,  6,-13, 13, -5, -5,-15, -2,  9,  0,  4, 14,  6,
-   -10, -4, -5,  2, -4, -2,  5,-11,  3,  3, -2, -2, -7,  9,  7,-10 },
-  {  5,-11, -8, 10, -2, 12, 16,  0, 12, -2, -6,  8, 14,  8,  7,  1,
-    18,-30,  4, 10, -4, -6,  2,-11,  9,-10, -8,  5,  0,  0, -7,  6 },
-  { -1,-16,-10, 11,  0, 13, 12, -4, -4, -5,-21, 12,  4, 13, 14, -7,
-     6,-16,-13,  8,  2,  9, 15,-12,  1, -9,-22, 10, -9,  9,  9, -7 },
-  {  4,-12,-27,  1, -2, 11, 15,  3, 14,-14, -9,  0, -9, 16, 22, 10,
-    16,-10,  5, -5, -9,  1,  1,  6,  6, -4,  2,-17, -5, -6,-15, -1 },
-  {  7,-12,-17,  1, -9,  5, 20, -7,  3, 23, -8, -8, -8, -1, 13, 17,
-    -7,-13,  4, -4,  7, 14,  8, 11, -3, -3,  4,  0,  4,  6, -1, -9 },
-  {  7,-15,-15, -4, 10, 12,  3,-13,  6, 14,  9, -8,-15, 14, 23, -5,
-   -10, -5,  1, 15,-10, -7,  1,  9,  4,-13,-10, 10,  7, -3,  2,  3 },
-  {  4,-10,-14,  0,  3,  4,  0, -9, -3, -4,-11,  2,-17,  8,  2, 15,
-     6,-12,-12, 15, -5, 17, 18,  3, -3, -3, -4, -6, -8, 13,  4, 10 },
-  { -2,-18,-26, 10, -4, 10, 13,  4, -4,-16, -7,-17, -3,  5, -4,  2,
-   -15,-10, -1, -8, -7, -3,  2,  2,  8,-10, -7,  2,  2, -4,  4, -1 },
-  {  4,-19, -5, -1, -1, -6,  2, -8, 10,-16,-28, -6,  8, -1, 11, 28,
-     2,-10, -4,  6, -6,  6, 11, 15, -4, -2,  7,  3,  7, -7,  4,  1 },
-  { -3, -6,-10, -5, 13, 18, 10,-15, -5, -3,-13,  5,  1,  2, 18, -5,
-   -10,-10, -7,  4,  2,  1,  5,  4,  2,  5,  4,  8, -9,-17,  7,  7 },
-  { 20,-12, -2, -4,  5, 14,  7,-11, -1,-16, -6, -4,-11, 17, 14,  0,
-    -8,-10, -8, 10,  3,  5, 10,-16,  3, -8,-14, 10,  3,  9,  0,  3 },
-  { 12,-10,-36,  0,  7, 15,  2,-16,  2, -1,  0, -1,  5,  4,  5, -3,
-     1,-10,  5, -1,-15, -3,-12, 12,  2,  5, -1,  5,  6, -3, -2,  2 },
-  { 17,-15,-31, 23, -4, 15, -2, -3,  6, -7, -5,  1,-12,  4,  6,  8,
-   -10,  8,  3,  5, -4,  1,  5,  3, -1, -4, -3,  1, 10, -4, -2, -2 },
-  {  6,-18, -5, 12, 10, 12, 14,-11, 15,  2, -9, -6, -5, -2, -9,  4,
-    -5,-28, -4, 14,  0,-16,  9, 14, -1,  3, -4, -4,  2,  1,  0,  4 },
-  { -5,-14,-31,  8, 16,  7, 13,-13,  5,  6,-16, 10, -5,  2, -2,  2,
-    14, -5,  8, -5,  7,-16,  6,-13, -5,  0, -5,  8, -3, -1,  4,  3 },
-  {  1, -2, -1,  0,  6,  5,  2, -4, -3, -1,  0,  1,  4,  2, 43, 28,
-   -12,-35, -2, -2, -7, -1,  0,  2, -1, -2, -2,  1, -4,  0, -2,  3 },
-  {  2, -9,-22, 12,  3,  3, -7, -4,-19,-22,-14, -4, -1, 21,  9, -3,
-   -15,-16,-13,  1,-11,  4, -9,  1, -7, -1, -1,  0, -2,  9,-13, -3 },
-  { -1, -3,-23,  0,  2, 12,  3, -9, -4,  7,  3,  9,-10,  1, 27, 28,
-     0,  9,-15, -2, -2,  1,  6,  8, -8,  7, -3, 20,  0,  0, -1, -6 },
-  { -1, 11,  8, -2,  1,  5, -6, -1,  4,  2, -4,  0, -1, -5,  4, -6,
-   -10,-12, 19,  1, -7,  9, -8, -9,-16,-11, -2, 12, 14,  4,  4, 34 },
-  { 17,  7, -6,  1,  4,-10, -5,  4,-11,  3,-18,  4, 14,-13, -3,  1,
-     0,  0,-11,  0,  7,-17, -4,  4,-11, -6, -8, 18,  0,  0,  0, 26 },
-  { -6, -7, -1, -1, 11, -8,  1,  3,  2, 11, -6, -6, 10, -3,  1, -3,
-     7,  4,-12, -8,  0, -9,  8,-22, -5,  0, -6, 22, -2, 11,-13, 24 },
-  { -3,  4,  0,  3,  9, 10, -1,  3, -9,-12,  1, -5, 18,  0, -3,  8,
-    25, 15, -8,  2,  2, -2,  4,  8,  9, -1, -5, 10, -3,  1, -1, 23 },
-  { -5,  2, -9, -1, -3,  0,  3, -1,-10, -4,  0,-13, 16,  9, -1,-14,
-     2,  6, -2, -6, -5, -2, -7,  7,  5,  3, 11, -2,-14,  0, -9, 30 },
-  {  4,  6,  6,  5, -3, -1,  4,  5, 10,  0,  5, -4,  7,-11, 14, 14,
-     7, 34, -9,  0,-10, 22, -7, -1,  7, -9,  2, -8,  0, -7, -5, 29 },
-  { -4,  3, -1, -4, -3,  5,  1, -4,  0,  2,  4,  2,  1, -1,-10,  1,
-     6, -6, -4,  1,  4, -3, -3, -5,  0,  3,  7,-12,  0, -2,-10, 55 },
-  {  5,  9, -1,  0,  4,  9,-21, -9,  4,  2,  6, -7, 11, -7,  1, -5,
-     0, -4,  2, -3,-13, -8,  0, -9, -4,  2, 16, -2,-15, -7,-11, 31 },
-  {  8,  2, -1,  0,  3, -5, -5,  5,  1, -1, -9,  1,  0, -6, -2, -1,
-     5,  2,  0,  0, 12, 20,-19,  1,  8,-12,-11,  0,  6, -5,  2, 31 },
-  { -1, -1, -2,  1, -1,  3, -9, -5,  8, -2,  5, -1,  0, -2,  4, -2,
-    -3,-12,  0, -2,  3,  0,  9,  4, -1, 21, -8,  3, -4,  9, -6, 30 },
-  { -4,  0, -7, 17, 10,-12, -2,-10,-12, -3, 10,  0, 11, -4,-13, -3,
-     5,  6, 10,  7, -8,  0, -7,-13,  1,  0, -2,  7,-12,  4, -3, 24 },
-  {-13,  9,  4, -2,  2, -4,-14, -1, -3, -5,-10,  4, 13, -2,  5, 13,
-     8,  3, -2,  1,  5, -6,  7,-18,-10,  1, -1,  5,  4,  1,  0, 25 },
-  { -5, -1, 18, 12,  8,  8,-16, -1,  1,  1,  1, -4, -5,  3,  3,  4,
-     4,-11,-12,-16, -6,  2, 12,-13,  0,  9,  7,  9, -9,  0,-10, 24 },
-  { -4,  1, -3,  0,  2, -4,  4,  1,  5,  0, -3,  2, -3, -2,  2, -1,
-     1,  4, -1, -2, -2,  1, -1, -1, -4, -1, -4, -2, -6,  6, 12, 69 },
-  {  8,  5, 11,  0,-15, -4, 13,  6,  0, -4,  9,  1, -5, -3, 15,  0,
-     1,  6, -5,  0,  1,  6,  5,  8,  0,  7,  1, -1, -4,-11, -9, 41 },
-  { -4, -9, 32, -6,  0,  7, -4,  6, -6,  1, -6, -2,  4, -8, -5, -3,
-   -16, -1, -2, -6,  1, 15,  0, 21,  3, -3, -4,  3,-12, 16,  2, 27 },
-  { -6, -5,  1, -9, -5,  3,  7, -3,  5,  5, 14, 13, 20, -7, -1, 12,
-    -1, 10,-11,-11, -7, -4,-14,  7,-14, 13, 22, 18, -1,  0, 14, 28 },
-  { -8,  3, -2,  0,  5,  6, -1, -4,  1,  3, -7,  3,  1,-15,  4, -9,
-    22,-10, -9, -4,  1,  8, -4,  9,-15,  2, -6, -4,-16, 12,-10, 23 },
-  {  0,  0,  2,  0, -1,  3, -3, -1,  3, -5,  7,  1,  5, -5, -8,  1,
-    13,-15, -5, -7, 12, -6, -2,  3, 10, -5, -8, 17, -5,-11,-14, 23 },
-  { -7, -4,  6, -4,  5, -6, -5,  2, -4, 11,  9, -4,  2, -2, -4,  6,
-    15,  3, -3, 18,-15, -2, -6,  3,  3,-20, 17, 11, -4,  2,  3, 29 },
-  {  6,  1, -6,  2,  3,  0,  0, -3,  3,  3, -1,  3, -4, -6, -6, -7,
-    -3, -2, -7, -2, -4,  5,  3, -5,-20,-13, -4, 10,-14,-29, 14, 37 },
-  {  3,  4,  3, -6, -4,  5,  0,  3,  2,  3,  0, -2,  4,  0, -3, -5,
-    -4,  4, -4,  4,  4,  3,  1, -4, -4, -9,-14, 20,-30,  3,-18, 33 },
-  {  0,  2,  5, -2, -4, -2, -1,  2, -6, -3, -2, -2,  2, -5, -1,  4,
-     3,  2, -3,  0, -1, -1,-10, -7,  2, -4,-18,  2,-37, -1, 12, 40 },
-  { -7,  2, -1,  0, -2,  4, -8,  1, -4, 12,  7,  4, 15, -7,  1, -9,
-    18,  0, 12,-17, -3, -1,  0,  0,  0,  2, -6,  0, -4, -3, -1, 26 },
-  { -6,  4,  8, -5, -6, -2,  2, -1,  1, -1,-15,  8,  7, -1,-17, -4,
-     1,  5,  6,-11, -6, 14, 17, -5,-15, 11,  8,  0, -3,-15, -6, 28 },
-  { -1,  0,  0,  0,  1,  0, -1,  0,  1,  3,  2, -2,  3, -1, -1,  2,
-     2, -1, -1, -7,  1,  2, -9,  0, -1, -4,-18,  7,-10, 49,-13, 32 },
-  { -1, -3,  4,  1,  2, -5,  1, -7, -1,  5, -9,  4,  4, 25,  1, -1,
-     2, -5,  2, -7, 17, -2, 10, -5,  0,  2,-15,  3, -9,  7, -9, 30 },
-  { -5, -1,  0,  2,  1, -1,  2,  5,-33,  3, -5, 14, 11,  7,  5, -3,
-     2, -8, -4, -2, -7, -6,  4, -8, -1, -8,  2, -2, -8, -1, -4, 27 },
-  { -1,  0, -1, -2,  1, -1, -2, -1,  2,  0,  1,  2,  2,  4,  1,  3,
-     4,  2,  1, -7, -4,  1, -3, -4,-35,-25, 17, 10, -3,-26, -7, 32 },
-  { -5,  1,  6, -2,  6,  6, -9,  3, -1, -4,  5, -4, -2, -2, -9,  2,
-    -5,  2,  2,  4,  3,  5, -5,-16,-31,-12,-11,  2,-19, 20, -2, 21 },
-  { -5,  2,  7, -7, -7,  5, -7,  2,  0,  0, -4,  3, -1,  0, -1, -2,
-     0, -3,  5,-11, -8, -3, -7, -7, 28,-11, -7,  0,-16,-11, -4, 29 },
-  {  2,  1, -3, -2, -1,  3,  4,  0,  1,  0, -1, -5,  4, -5,-12,  2,
-    -2, -5,-22, -2, -1, 11,  8, -7,-12,  0,-34,  6, -5, 11, -8, 19 },
-  { -1, -3,  5, 11, 18, -2, -2, -5, -2,  4, -1,  8,  5, -6,  1, -1,
-     2,  8,  4, -5, -8, -2,  5,-18,  7, 12,  7, 19,-18,  2, -6,-13 },
-  {  9,  0,  0,  5,  4,  3, -6,  4,  1, -4,  5, -1, -4,  8,  8,  6,
-    -8, -6,  0,  6, -3,  3,  5, -3, 17, 31, 16, 10,-13,  0, -9,-19 },
-  { 12,-10,  2, -2, -2, -1, -3,  6,-12, -5, -2, 14,-16,  4, 12, 12,
-    17,  4,  7,-16,  7, -6, 11,  7,  7,  2,-25, 23,-24,  5, -7, -9 },
-  { 10,  4, 13, 10, 10,  3, -6,  3,  3,  2, -1, -6,  8,  4, 10,  0,
-     1,  2, -4,  2, -3, -8,  0, -1,  9,  9,-10, -3,-29,  1, -1,-27 },
-  {  2,  2,  0,  7,  9, -2,-10, -1, -1,  1, -9, -5,  8,  4,  1,  2,
-   -10,  1, 13, 12, -3, 15, -9,  2, -7,  1,-10, 23,-20,-18, -9,-15 },
-  { -3, -5, -1,  8,  0, -5, -1,  4,  7, -1, -7,  2, -8, -5, 11,  7,
-    -6,  3, -3, -9,  7,  9,-22,  1,  6, -4, 14, 27,-25,-14,  3, -5 },
-  {  1,  3,  8,  4,  7,  6, 12,-17,-15,  1, -8,-10,  7,-14, -8,  6,
-    -2, -2,-11,-11, -7, 13, -2, -2,  4,  5, -5, 13,-23, -6,-17, -8 },
-  { -5,  4,-14, -5, -4, -5,  6,  5, -8, -5, -2,-11, -7,-12,  3,-11,
-     2, -6,  4,-10, -5, -7, 14,  5, 23, 11,  7, 12,-16, -6, -4,-16 },
-  {  5,  6,  2,  5, -2, -5, -5, -6, -5,-19,-13, -1, -3,-13,  5,  0,
-     6, -2, -2, -6, -7, -7, -1, -9,  4, 14, 17,-12,-27,  3,  0, -1 },
-  {  7, -1,  9,-10,  8,  2, -7, -2,  5,  2, -3, -7,  3,  0,  6,  4,
-    12,  5, 11, 14,-13, -1,  8,  1, 13,  9, 12, 12,-18,-14,-11,-16 },
-  { -7, -5, -6, -5,  0, -1, -3,  2,  2,  1,  4,  9,  2,  3,  5, -2,
-     2,  1,  8,  0,  3,  0, -2,  2,  1,  7, 29,  0,-36, -5, -9,-21 },
-  { 14, -6, -9,  0, -1, -8, -8,-11,  2,  2, -9,-12, 12, -4,  5,  3,
-    -5, -9, 11, -1, -3, 12,-21, -3, 12,  5,  3, 11,-18,-15,  1, -2 },
-  { -1,  3, -9, -3,  7, -7,-18,  2,  4, 12,-10,  2,  8, -3,-14, 13,
-    17, -5,  5, -9, 13, -3, -7,-18, 17, -2,  5,  7,-20, -3, -6,-11 },
-  { -3,  3,  3, -1,  1, -6, -5,  1,  5, -3,-14, -6, -5, -8, 14, -6,
-     7, -1,  5,  1, 15, -1, -7, -4,  6,-11,  9, -2,-37, 16, -7, -3 },
-  { -1,  0,  6,  1, -3, -9,  0, 11, -8,  2, -2,  0,  5,  2, 12,-10,
-    10, 13,  2,  7, -6,  2,-10,-10, 21, -5,  5,  5,-12,-23,  3,-14 },
-  {  6,  0, -2,  1,  0,  1,  0, -4,  1,  1,  8, -2,  2, -5, -2,  1,
-     8, -4, -1, -1,  4, -1,  2,  6, 32,  1, -5,-20,-40, -4,-18,-14 },
-  {  2,  2, -7, -2,  4,  4, -1,  2,  0, -2, -4, -7,  3,  5,  0, -5,
-     1,  2, -6,  4, -1, -2, -1,-15,  8,  3,  9, 46, -7,-18,  6,-11 },
-  {  5,  5, 16, 21,  3,-11, -4, 11,-12,  2,  4,-12, -1, 11,  8,  1,
-    -4, 11,-11,-21,  1,  1,-11,  3, 13,  1,  5, 12,-25,  1, -3, -2 },
-  {  1,  6, -7,  4,  2,  3,  1, -5,  8,  9,-15,  3, -3,-14, 17,  4,
-    -8, 14, -2, -8, -4,  5,  8, -7,  8,  9,  7,  6,-29,-17,  8,  4 },
-  { -7, -7,  4,  0, 13,  1,  0,  4,  4,-16,-10, -7,  5,  9,-15,-10,
-   -10,  8, -4, -1,-11, -1,-10,-15,  3,  3, 14, 10,-19,  2,-18,-12 },
-  { -4,  0,  2,  0,  5, -2, -9,  0,  4, -4,  2, -1, -2,  2, -4,  9,
-     2, -6, -4, -2, -1, -3, -3, -1,  2,  5, -1, 11,-24,-44, -9,-15 },
-  { -1,-10,  6, 21, 11, 15, -7, 10,-14, -9, -8, -8,  4,  6, 19,  1,
-    -6,  1, -5,-17, -8,-10,  9,  5, 11, 18, -1, 10,-16, -7, -9, -8 },
-  {  3, -5,  0,  0, -2, -2, -6,  4, -4,  1, -1,  0,  7, -3,  4, -4,
-    -7,  7, 17,-20,  6,  4,  1, -6,-12, 31, 13, 19,-14,-10, -7, -2 },
-  { -2,  6,-10,  3,  9,  6,-14, 15,  2, -5,  2,-11,  9, -8,  4,  6,
-    20,-15, -3, -3, -1, 32,-21,  6,  1,  9, 11, 17,-19,  6, -1, -3 },
-  {  8, 10, -2,  0, -8,-16,  7,  7,  6, 10,  4,-14,  7, -6, 21, -7,
-    10,  5,  5,  0, -7,  2, -6,  0, -7, 11, -9, 15,-20, -7,-11,  2 },
-  {  0, -7,  5,  2,  0, -3, -6, -4, -2, -1, -4, -5,-13, -1, 27, -9,
-    -6,-11, -7,  1, 11, -4, -4,-14, -2, 11,  6, 10,-19, -6,-15,  2 },
-  {  0,  7, -1,  2, -7,-15, -2, -3, 13, -5, -5, 12,  3,  0,  5, -5,
-   -22,  2,  7, 22, 13,  0, -1,  2,  3,  2, -7,  7,-27, -4, -4,-12 },
-  { 11,  1,-16,  6,-15,  1,  3,  2,  0,  2, -3,  2,  5, -2, -5,  9,
-     5, -3,  3, -2,-11,  3,  9,  6,  9,  3, -1, 12,-41,  8, -6,  9 },
-  {  3, -7,  3,  2,  5,  5,  0, -1,  1,  3, -5, -2,-13,  7, -1, -2,
-    -2, -6,  4, -6,  0,  2, -2,  2,  4,  1, -4,  1,-47,-21,  7, -6 },
-  {  3, 16, -7, 13, -4, -2, 10, -3, -1, 18,-13,  7,-13, -4,  8,  4,
-     8,  9, -5, 13,  8, -5,  3, -6,  7, 18, -8, 10,-25, -3,-12,-12 },
-  {  1, -1, -1,  0,  2,  5, -5, -3,  0, -5, -1,  0, -4, -8, -2,  3,
-     2, -2,-17, -6, -4,  1, 33, -6,-20, -6,  8, 31,-26, -8, -1, -4 },
-  {  3, -3, -3,  5, -3, -2,  1,  7,  0,  3,  6,  3,  6, -2,  9, 15,
-   -10, -3,-15, -5, -3, -4, -6,-30, 17, -8, -2,  2,-20,  0, -8, -2 },
-  { -2, -1, -1, -1,  3, -5, -2, -3,  4, -2,  0,  5,  8, -3,  1, -4,
-     1,  1, -3,  4,  4,-14,  3, 11, -5,  3, -3,  7, -3, 13, 23,-16 },
-  {  2, -6,  1, -3,  5,  0, -6,-11, -7, -4, -1,  2, -7, -1, -1,  7,
-     1, -2,  6, 12, -6,  8,-13, 17, 25,-23,-19, -7,-12,  9, 16,-17 },
-  {  9,  4,  4,  4, -3, -1,  6, -2, -3,  0, 13, -4, -7, 14,  1, -7,
-     0, -5,  3,-19, -3,  5,  3,  9, -1,  9,-13, 13,-17,  4, 21,-26 },
-  {  0, -5,  0,  0, -4, -5,  2, -6, -4,  5, -7, 10,  0,  2,  0, -2,
-    -2,  0,  4, -6,  7, -2,  6,  5, -5,  2,-12,  1,-29, 29, 27, 12 },
-  {  9,-10,-22,  6, -1, -1,  9,-14,-12, -2,  1, -1, 10,-11,-16,  0,
-     3, 11, 13,-14, -9, -2, -1,  6,  4,-14,  0,-10, -2, 16, 17,-11 },
-  {  2,  0, -1, -2,  4,  3, -6, -2,  1, -1,  1,  3, -4,  1,  3, -4,
-    -1, -1,  4, -1,  1,  0,  1,  6, -5, -7,  2,  1,-47, -3, 50,-17 },
-  {  8, -4,-11, -7, 11, 11, 14, -7, 12, -7,  6,  2, 13, -6, -3, -2,
-   -14,  6,  6,  6,  0,  2, -1,  5,-20,  2, -1,  4, -5,  6, 21,-11 },
-  { -2, -9,  3,  0, -6,  7,  8, -8,  1, -3,  4,  1,  5, -2, -3, -7,
-     4,  7,-12, -9, -2, 10, -6, 13,  6,  5, 20,  2,-15,  9, 28, -7 },
-  {  0, -5, -6, -6, -6,  1, -6,  6, -2,  4,  8, -3, 12, -1, -4, -2,
-     6, 16,-14,  9,-14, -2, -8,-27, -3, 18, -1, -7, -3,  8, 23,-23 },
-  {  1,  4, -9, -1, -5, 10, -2,  1,-11,  1, -9,  4,  7, 14, -9, -2,
-    -3,  2, -5, -1, -6,-10, -7, 11, 20,  2,  3,-19,  3, 15, 30, -9 },
-  {  7,  2,-14, -4,  0, -2,  5,  2,  5, -2,  8, -3, -7,  6,  6,-11,
-   -14,  1, 10, -1, -7, -8,  1, 10,  3, -6,-15,-12,-17,  4, 30, -6 },
-  {  4,  2,  1, -2,  3,  0,  1,  0,  2,  0,  1,  6, -7,  0,  3,  4,
-     4, -4, -2, -5, -2,  2, -1, -2,  0, -2,-11, -7, -3, 42, 24,-14 },
-  {  4,  1,  3,  2,  0, -2, -3, -2,  2, -1,  4, 11, -2,  2,  3, -4,
-    -5,  9,  2, -4, -9,  5,  8, -1, -7,  1, 24,-13,-28, 20, 15,-22 },
-  { -3,  7,  6,  3, -2, -5,-10, -2, -2, -1, -6, -6, -2,-14,-16, -6,
-    -5,  0, 18,  0,  9,  1,  7,-13, -5, -6, -9, 11,-15,  9, 22,-11 },
-  {  9, -2,  6,  5,  2,  9,-10,  1,  1,  5, -4, 12,  2,  2,-10, -7,
-    -4, -6,  7,  9,  6, 15,  6,  6,-10, 10,  5,-13, -5,  6, 24,-12 },
-  {  1,  3, -3, -3,  8,  1, -6,  2, -5, -3,  7,  2, 14,  6,  9, -6,
-    -5, -4, 27,  7, -3,  8, -6,  3, -8,  8, 22, -5, -6, -2, 22,-17 },
-  { -2, -2,  3, 10,  9,  9, 12,-15, -1,-11,-13,  3, -2,  1, -3,-11,
-     7,  9, 16, -3,-10, -5, -5,  1,  8, -3,  9,  9, -5,  3, 31,-12 },
-  {  7, -5, 10, -4, -8,  2, 16, -2, 10, 10, -3, -2,  3, -8, -3,  3,
-   -13, -6, 15, 20, -9, -3,-12,  1, -2,-16,  8,  8, -1, 16, 22, -5 },
-  {  5, -3,-15, -2, 12, -8,  8, -5,  2, -8, 20,-18, 14, -4,  3,  3,
-     7,-13,-16,  1,-10,  7, 16,  7,  4,-14, -4, -5, -9,  8, 23, -6 },
-  {  5, -4, -5, -4,  1,  8,  4, -7, -5,  8, 10,  6, -6,-10, -2,  6,
-     9,-17,-14, 11, 12, -3,-13, -7,  2, 18,  3,-25,-16, 18, 22, -5 },
-  {  5,  6, -7,-20, -4,  2,  8,  4,-24, -4,  1,  4, -5, -2,  1,-10,
-    -2,  9,  3, -4, -3, -4, -4, -4, 10, 10,  3,  0, -6, 25, 21,-11 },
-  {  0,  7, -1, 14, -6, -4,-10,  5,  4,  4,  4, -5,  3,  4, -1, -7,
-     8,-19,  0,  6,  2,  3,-18, -3, -6,  2,  8, 14,-26, 22, 27,-13 },
-  { -2, -6,  7, -5, 12, -7,  8, -1,  3, -2,  4,  1,  8, -2,  0, 14,
-     6, -5,  6, -4, -7,  7,-21,  8,  1,  8, -9, -4, -3, 11, 25,-13 },
-  {  4,  4, -1, -6,  4,  9, -8,  1, -3,-10, -2,  0, 15, -9,-16, 11,
-     1,  1,  6,  3, -9, -5, 16, 26,  1,-14,  1, -3,-14,  7, 15, -9 },
-  {-12, -2, -9,-13,  2,  6, 14,  0,  1,  0, -1,-13,  0, 10, -1,  6,
-     9, -7,  8,  8, 19,  6, -1,  9, 10, -4,  1, -7,-22, -2, 29, -7 },
-  {  2,  4, 13,-12, -8, -4, -5, 13, 12, -5, -3, -3, -4,  1, -1, 10,
-    15, -6, -1,-11,-30,  4, 15, -1,  9, -7,  0, -2, -7, 10, 25,-16 },
-  {  7,-15, -7, -7, -1, -5, -5,-11,-20, 10,  3,-10, -3,  5, 20, -4,
-     0, -2, -2, 17,  2,  0, -3,  3,  6,  5, -1,-12, -3, 15, 22,-16 },
-  {  4, -1,  3,  4, -5,  0, -1, -5,-24,-29,  4, -9,  1, -3,  0,  0,
-     0, -4,  7, -4, -4, -4,  3,  1, -6,  5, -3, -5,-10,  3, 25,-10 },
-  { -2, -1, -1,  4,  4, -1,  2,  0, -4, -4,  2, -1, -3, -1, -2, -2,
-     1, -3, -5, -1,  2, -3, -4, -4, -3,  5, -9,  1,-11,  7, 46,-46 },
-  {  0, -9,  3,  4,  4,  3, -5, -6,  5, -4,  4, -2,  1,  7, -4,-10,
-    13,  1,  3, -6,  4, -4,  7,  2,-19,-25, -3,-16,-12, 16, 20, -1 },
-  { 18,  6,  4,-12,  0,-14,  9, -6, -1, -4, -5,  2,  1, 12,  4,  2,
-     7,  0,  2,  5,-11, -5, -2,  2, -4, 10,  0, -9, -7,  9, 25, -8 },
-  {  5,  0, -6,  5,  6,  3,  3,-10, -5,  1, -1,  4,  3,-11, -8,  5,
-     4, -5,  5, -5, -7, -5, 11,  5, 20, -8,-16, 21, -4, 27, 23, -5 }
-};
-
-
-/* FIR filter coefficients, they can be cut on half and maybe use float instead of double*/
-
-DECLARE_ALIGNED(16, static const float, fir_32bands_perfect)[] =
-{
-+1.135985195E-010,
-+7.018770981E-011,
--1.608403011E-008,
--5.083275667E-008,
--1.543309907E-007,
--3.961981463E-007,
--7.342250683E-007,
--3.970030775E-007,
--4.741137047E-007,
--6.022448247E-007,
--6.628192182E-007,
--6.982898526E-007,
--7.020648809E-007,
--6.767839409E-007,
--6.262345096E-007,
--5.564140224E-007,
-+7.003467317E-007,
-+8.419976893E-007,
-+9.742954035E-007,
-+1.085227950E-006,
-+1.162929266E-006,
-+1.194632091E-006,
-+1.179182050E-006,
-+1.033426656E-006,
-+9.451737242E-007,
-+1.975324267E-006,
-+1.190443072E-006,
-+5.234479659E-007,
-+2.014677420E-007,
-+7.834767501E-008,
--6.702406963E-010,
--1.613285505E-009,
--2.682709610E-009,
--3.399493131E-009,
-+1.314406006E-008,
-+7.506701927E-009,
-+2.788728892E-008,
-+1.444918922E-007,
-+3.132386439E-007,
-+1.399798180E-006,
-+2.032118118E-006,
-+2.715013807E-006,
-+3.453840463E-006,
-+4.195037945E-006,
-+4.896494374E-006,
-+5.516381407E-006,
-+6.015239251E-006,
-+6.361419310E-006,
-+8.006985809E-006,
-+8.087732567E-006,
-+7.941360309E-006,
-+7.568834008E-006,
-+6.986399967E-006,
-+6.225028756E-006,
-+5.315936960E-006,
-+4.429412002E-006,
-+3.332600045E-006,
-+8.427224429E-007,
-+4.341498823E-007,
-+9.458596395E-008,
-+2.975164826E-008,
-+6.402664354E-008,
--3.246264413E-008,
--3.809887872E-008,
-+8.434094667E-008,
-+6.437721822E-008,
-+1.189317118E-006,
-+2.497214155E-006,
-+3.617151151E-006,
-+3.157242645E-006,
-+2.319611212E-006,
-+7.869333785E-006,
-+9.826449968E-006,
-+1.177108606E-005,
-+1.379448349E-005,
-+1.571428584E-005,
-+1.743183020E-005,
-+1.884208177E-005,
-+1.987093310E-005,
-+2.042970118E-005,
--3.144468428E-005,
--3.334947178E-005,
--3.460439257E-005,
--3.515914432E-005,
--3.495384954E-005,
--3.397853652E-005,
--3.225446198E-005,
--2.978993689E-005,
--2.677291741E-005,
--1.806914770E-005,
--1.776598037E-005,
--1.661818715E-005,
--1.207003334E-005,
--6.993315310E-006,
--5.633860383E-007,
--9.984935332E-007,
--1.470520488E-006,
--1.853591357E-006,
-+7.198007665E-007,
-+3.086857760E-006,
-+6.084746474E-006,
-+9.561075785E-006,
-+1.309637537E-005,
-+2.263354872E-005,
-+2.847247197E-005,
-+3.415624451E-005,
-+3.946387005E-005,
-+4.425736552E-005,
-+4.839275425E-005,
-+5.176846025E-005,
-+5.429694284E-005,
-+5.595519906E-005,
-+4.916387297E-006,
-+9.299508747E-006,
-+1.356193479E-005,
-+1.751866148E-005,
-+2.093936746E-005,
-+2.362549276E-005,
-+2.537086584E-005,
-+2.618136386E-005,
-+2.554462844E-005,
-+3.018750249E-005,
-+2.570833203E-005,
-+1.985177369E-005,
-+1.191342653E-005,
-+2.525620175E-006,
--1.521241393E-005,
--1.617751332E-005,
-+1.992636317E-005,
-+1.774702469E-005,
-+4.624524081E-005,
-+5.610509834E-005,
-+6.568001118E-005,
-+7.513730816E-005,
-+8.413690375E-005,
-+8.757545584E-005,
-+9.517164290E-005,
-+1.020687996E-004,
-+1.084438481E-004,
-+1.140582463E-004,
-+1.187910311E-004,
-+1.224978914E-004,
-+1.250260248E-004,
-+1.262027217E-004,
-+1.226499153E-004,
-+1.213575742E-004,
-+1.180980107E-004,
-+1.126275165E-004,
-+1.047207043E-004,
-+9.417100227E-005,
-+8.078388782E-005,
-+6.447290798E-005,
-+4.491530854E-005,
-+2.470704203E-005,
--1.714242217E-006,
--3.193307566E-005,
--6.541742187E-005,
--1.024175072E-004,
--1.312203676E-004,
--1.774113771E-004,
--2.233728592E-004,
--2.682086197E-004,
--3.347633174E-004,
--3.906481725E-004,
--4.490280990E-004,
--5.099929986E-004,
--5.729619297E-004,
--6.358824321E-004,
--7.021900383E-004,
--7.698345580E-004,
--8.385353722E-004,
--9.078957955E-004,
--9.775133803E-004,
--1.046945457E-003,
--1.115717343E-003,
--1.183370827E-003,
--1.252829796E-003,
--1.316190348E-003,
--1.376571832E-003,
--1.433344092E-003,
--1.485876855E-003,
--1.533520175E-003,
--1.575609902E-003,
--1.611457788E-003,
--1.640390139E-003,
--1.661288203E-003,
--1.674512983E-003,
--1.678415807E-003,
--1.672798418E-003,
--1.656501088E-003,
--1.633993932E-003,
--1.593449386E-003,
-+1.542080659E-003,
-+1.479332102E-003,
-+1.395521569E-003,
-+1.303116791E-003,
-+1.196175464E-003,
-+1.073757303E-003,
-+9.358961834E-004,
-+7.817269652E-004,
-+6.114174030E-004,
-+4.244441516E-004,
-+2.206075296E-004,
--2.719412748E-007,
--2.382978710E-004,
--4.935106263E-004,
--7.658848190E-004,
--1.055365428E-003,
--1.361547387E-003,
--1.684492454E-003,
--2.023874084E-003,
--2.379294252E-003,
--2.750317100E-003,
--3.136433195E-003,
--3.537061159E-003,
--3.951539751E-003,
--4.379155114E-003,
--4.819062538E-003,
--5.270531867E-003,
--5.732392892E-003,
--6.203945260E-003,
--6.683901884E-003,
--7.170005701E-003,
--7.664063945E-003,
--8.162760176E-003,
--8.665001951E-003,
--9.170533158E-003,
--9.676489048E-003,
--1.018219907E-002,
--1.068630442E-002,
--1.118756086E-002,
--1.168460958E-002,
--1.217562053E-002,
--1.265939046E-002,
--1.313448418E-002,
--1.359948888E-002,
--1.405300573E-002,
--1.449365262E-002,
--1.492007636E-002,
--1.533095632E-002,
--1.572482102E-002,
--1.610082202E-002,
--1.645756140E-002,
--1.679391414E-002,
--1.710879989E-002,
--1.740120351E-002,
--1.767017506E-002,
--1.791484281E-002,
--1.813439466E-002,
--1.832821220E-002,
--1.849545911E-002,
--1.863567345E-002,
--1.874836907E-002,
--1.883326657E-002,
--1.889026538E-002,
--1.891860925E-002,
-+1.891860925E-002,
-+1.889026538E-002,
-+1.883326657E-002,
-+1.874836907E-002,
-+1.863567345E-002,
-+1.849545911E-002,
-+1.832821220E-002,
-+1.813439466E-002,
-+1.791484281E-002,
-+1.767017506E-002,
-+1.740120351E-002,
-+1.710879989E-002,
-+1.679391414E-002,
-+1.645756140E-002,
-+1.610082202E-002,
-+1.572482102E-002,
-+1.533095632E-002,
-+1.492007636E-002,
-+1.449365262E-002,
-+1.405300573E-002,
-+1.359948888E-002,
-+1.313448418E-002,
-+1.265939046E-002,
-+1.217562053E-002,
-+1.168460958E-002,
-+1.118756086E-002,
-+1.068630442E-002,
-+1.018219907E-002,
-+9.676489048E-003,
-+9.170533158E-003,
-+8.665001951E-003,
-+8.162760176E-003,
-+7.664063945E-003,
-+7.170005701E-003,
-+6.683901884E-003,
-+6.203945260E-003,
-+5.732392892E-003,
-+5.270531867E-003,
-+4.819062538E-003,
-+4.379155114E-003,
-+3.951539751E-003,
-+3.537061159E-003,
-+3.136433195E-003,
-+2.750317100E-003,
-+2.379294252E-003,
-+2.023874084E-003,
-+1.684492454E-003,
-+1.361547387E-003,
-+1.055365428E-003,
-+7.658848190E-004,
-+4.935106263E-004,
-+2.382978710E-004,
-+2.719412748E-007,
--2.206075296E-004,
--4.244441516E-004,
--6.114174030E-004,
--7.817269652E-004,
--9.358961834E-004,
--1.073757303E-003,
--1.196175464E-003,
--1.303116791E-003,
--1.395521569E-003,
--1.479332102E-003,
--1.542080659E-003,
-+1.593449386E-003,
-+1.633993932E-003,
-+1.656501088E-003,
-+1.672798418E-003,
-+1.678415807E-003,
-+1.674512983E-003,
-+1.661288203E-003,
-+1.640390139E-003,
-+1.611457788E-003,
-+1.575609902E-003,
-+1.533520175E-003,
-+1.485876855E-003,
-+1.433344092E-003,
-+1.376571832E-003,
-+1.316190348E-003,
-+1.252829796E-003,
-+1.183370827E-003,
-+1.115717343E-003,
-+1.046945457E-003,
-+9.775133803E-004,
-+9.078957955E-004,
-+8.385353722E-004,
-+7.698345580E-004,
-+7.021900383E-004,
-+6.358824321E-004,
-+5.729619297E-004,
-+5.099929986E-004,
-+4.490280990E-004,
-+3.906481725E-004,
-+3.347633174E-004,
-+2.682086197E-004,
-+2.233728592E-004,
-+1.774113771E-004,
-+1.312203676E-004,
-+1.024175072E-004,
-+6.541742187E-005,
-+3.193307566E-005,
-+1.714242217E-006,
--2.470704203E-005,
--4.491530854E-005,
--6.447290798E-005,
--8.078388782E-005,
--9.417100227E-005,
--1.047207043E-004,
--1.126275165E-004,
--1.180980107E-004,
--1.213575742E-004,
--1.226499153E-004,
--1.262027217E-004,
--1.250260248E-004,
--1.224978914E-004,
--1.187910311E-004,
--1.140582463E-004,
--1.084438481E-004,
--1.020687996E-004,
--9.517164290E-005,
--8.757545584E-005,
--8.413690375E-005,
--7.513730816E-005,
--6.568001118E-005,
--5.610509834E-005,
--4.624524081E-005,
--1.774702469E-005,
--1.992636317E-005,
-+1.617751332E-005,
-+1.521241393E-005,
--2.525620175E-006,
--1.191342653E-005,
--1.985177369E-005,
--2.570833203E-005,
--3.018750249E-005,
--2.554462844E-005,
--2.618136386E-005,
--2.537086584E-005,
--2.362549276E-005,
--2.093936746E-005,
--1.751866148E-005,
--1.356193479E-005,
--9.299508747E-006,
--4.916387297E-006,
--5.595519906E-005,
--5.429694284E-005,
--5.176846025E-005,
--4.839275425E-005,
--4.425736552E-005,
--3.946387005E-005,
--3.415624451E-005,
--2.847247197E-005,
--2.263354872E-005,
--1.309637537E-005,
--9.561075785E-006,
--6.084746474E-006,
--3.086857760E-006,
--7.198007665E-007,
-+1.853591357E-006,
-+1.470520488E-006,
-+9.984935332E-007,
-+5.633860383E-007,
-+6.993315310E-006,
-+1.207003334E-005,
-+1.661818715E-005,
-+1.776598037E-005,
-+1.806914770E-005,
-+2.677291741E-005,
-+2.978993689E-005,
-+3.225446198E-005,
-+3.397853652E-005,
-+3.495384954E-005,
-+3.515914432E-005,
-+3.460439257E-005,
-+3.334947178E-005,
-+3.144468428E-005,
--2.042970118E-005,
--1.987093310E-005,
--1.884208177E-005,
--1.743183020E-005,
--1.571428584E-005,
--1.379448349E-005,
--1.177108606E-005,
--9.826449968E-006,
--7.869333785E-006,
--2.319611212E-006,
--3.157242645E-006,
--3.617151151E-006,
--2.497214155E-006,
--1.189317118E-006,
--6.437721822E-008,
--8.434094667E-008,
-+3.809887872E-008,
-+3.246264413E-008,
--6.402664354E-008,
--2.975164826E-008,
--9.458596395E-008,
--4.341498823E-007,
--8.427224429E-007,
--3.332600045E-006,
--4.429412002E-006,
--5.315936960E-006,
--6.225028756E-006,
--6.986399967E-006,
--7.568834008E-006,
--7.941360309E-006,
--8.087732567E-006,
--8.006985809E-006,
--6.361419310E-006,
--6.015239251E-006,
--5.516381407E-006,
--4.896494374E-006,
--4.195037945E-006,
--3.453840463E-006,
--2.715013807E-006,
--2.032118118E-006,
--1.399798180E-006,
--3.132386439E-007,
--1.444918922E-007,
--2.788728892E-008,
--7.506701927E-009,
--1.314406006E-008,
-+3.399493131E-009,
-+2.682709610E-009,
-+1.613285505E-009,
-+6.702406963E-010,
--7.834767501E-008,
--2.014677420E-007,
--5.234479659E-007,
--1.190443072E-006,
--1.975324267E-006,
--9.451737242E-007,
--1.033426656E-006,
--1.179182050E-006,
--1.194632091E-006,
--1.162929266E-006,
--1.085227950E-006,
--9.742954035E-007,
--8.419976893E-007,
--7.003467317E-007,
-+5.564140224E-007,
-+6.262345096E-007,
-+6.767839409E-007,
-+7.020648809E-007,
-+6.982898526E-007,
-+6.628192182E-007,
-+6.022448247E-007,
-+4.741137047E-007,
-+3.970030775E-007,
-+7.342250683E-007,
-+3.961981463E-007,
-+1.543309907E-007,
-+5.083275667E-008,
-+1.608403011E-008,
--7.018770981E-011,
--1.135985195E-010
-};
-
-DECLARE_ALIGNED(16, static const float, fir_32bands_nonperfect)[] =
-{
--1.390191784E-007,
--1.693738625E-007,
--2.030677564E-007,
--2.404238444E-007,
--2.818143514E-007,
--3.276689142E-007,
--3.784752209E-007,
--4.347855338E-007,
--4.972276315E-007,
--5.665120852E-007,
--6.434325428E-007,
--7.288739425E-007,
--8.238164355E-007,
--9.293416952E-007,
--1.046637067E-006,
--1.176999604E-006,
--1.321840614E-006,
--1.482681114E-006,
--1.661159786E-006,
--1.859034001E-006,
--2.078171747E-006,
--2.320550948E-006,
--2.588257530E-006,
--2.883470643E-006,
--3.208459020E-006,
--3.565570978E-006,
--3.957220997E-006,
--4.385879038E-006,
--4.854050530E-006,
--5.364252502E-006,
--5.918994248E-006,
--6.520755960E-006,
--7.171964626E-006,
--7.874960829E-006,
--8.631964192E-006,
--9.445050637E-006,
--1.031611009E-005,
--1.124680875E-005,
--1.223855270E-005,
--1.329243969E-005,
--1.440921824E-005,
--1.558924305E-005,
--1.683242772E-005,
--1.813820381E-005,
--1.950545993E-005,
--2.093250441E-005,
--2.241701623E-005,
--2.395598858E-005,
--2.554569073E-005,
--2.718161704E-005,
--2.885844333E-005,
--3.056998685E-005,
--3.230916263E-005,
--3.406793985E-005,
--3.583733633E-005,
--3.760734762E-005,
--3.936696885E-005,
--4.110412556E-005,
--4.280570283E-005,
--4.445751256E-005,
--4.604430433E-005,
--4.754976908E-005,
--4.895655002E-005,
--5.024627535E-005,
-+5.139957648E-005,
-+5.239612074E-005,
-+5.321469871E-005,
-+5.383323878E-005,
-+5.422891263E-005,
-+5.437819709E-005,
-+5.425697600E-005,
-+5.384063843E-005,
-+5.310418419E-005,
-+5.202236207E-005,
-+5.056979353E-005,
-+4.872112549E-005,
-+4.645117951E-005,
-+4.373511547E-005,
-+4.054862075E-005,
-+3.686808850E-005,
-+3.267079956E-005,
-+2.793515523E-005,
-+2.264085742E-005,
-+1.676913780E-005,
-+1.030297699E-005,
-+3.227306706E-006,
--4.470633485E-006,
--1.280130618E-005,
--2.177240640E-005,
--3.138873581E-005,
--4.165195787E-005,
--5.256036457E-005,
--6.410864444E-005,
--7.628766616E-005,
--8.908427117E-005,
--1.024810626E-004,
--1.164562127E-004,
--1.309833024E-004,
--1.460311323E-004,
--1.615635992E-004,
--1.775395358E-004,
--1.939126523E-004,
--2.106313768E-004,
--2.276388550E-004,
--2.448728774E-004,
--2.622658503E-004,
--2.797449124E-004,
--2.972317743E-004,
--3.146430245E-004,
--3.318900708E-004,
--3.488793736E-004,
--3.655125911E-004,
--3.816867538E-004,
--3.972945851E-004,
--4.122247046E-004,
--4.263620067E-004,
--4.395879805E-004,
--4.517810594E-004,
--4.628172028E-004,
--4.725702747E-004,
--4.809123348E-004,
--4.877146275E-004,
--4.928477574E-004,
--4.961824161E-004,
--4.975944757E-004,
--4.969481961E-004,
--4.941228544E-004,
--4.889960401E-004,
-+4.814492422E-004,
-+4.713678791E-004,
-+4.586426076E-004,
-+4.431701091E-004,
-+4.248536134E-004,
-+4.036037717E-004,
-+3.793396754E-004,
-+3.519894381E-004,
-+3.214911267E-004,
-+2.877934603E-004,
-+2.508567995E-004,
-+2.106537577E-004,
-+1.671699720E-004,
-+1.204049113E-004,
-+7.037253090E-005,
-+1.710198012E-005,
--3.936182839E-005,
--9.895755647E-005,
--1.616069785E-004,
--2.272142592E-004,
--2.956659591E-004,
--3.668301215E-004,
--4.405563814E-004,
--5.166754709E-004,
--5.949990009E-004,
--6.753197522E-004,
--7.574109477E-004,
--8.410271257E-004,
--9.259034996E-004,
--1.011756598E-003,
--1.098284614E-003,
--1.185167348E-003,
--1.272067428E-003,
--1.358630019E-003,
--1.444484224E-003,
--1.529243193E-003,
--1.612505526E-003,
--1.693855622E-003,
--1.772865304E-003,
--1.849094522E-003,
--1.922092517E-003,
--1.991399564E-003,
--2.056547208E-003,
--2.117061289E-003,
--2.172462177E-003,
--2.222266514E-003,
--2.265989315E-003,
--2.303145360E-003,
--2.333251061E-003,
--2.355825622E-003,
--2.370394068E-003,
--2.376487479E-003,
--2.373647178E-003,
--2.361423569E-003,
--2.339380793E-003,
--2.307097195E-003,
--2.264167881E-003,
--2.210205887E-003,
--2.144844970E-003,
--2.067740774E-003,
--1.978572691E-003,
--1.877046190E-003,
--1.762894331E-003,
--1.635878929E-003,
-+1.495792647E-003,
-+1.342460280E-003,
-+1.175740734E-003,
-+9.955273708E-004,
-+8.017504588E-004,
-+5.943773431E-004,
-+3.734139318E-004,
-+1.389056415E-004,
--1.090620208E-004,
--3.703625989E-004,
--6.448282511E-004,
--9.322494152E-004,
--1.232374110E-003,
--1.544908970E-003,
--1.869517611E-003,
--2.205822384E-003,
--2.553403843E-003,
--2.911801683E-003,
--3.280514618E-003,
--3.659002949E-003,
--4.046686925E-003,
--4.442950245E-003,
--4.847140983E-003,
--5.258570891E-003,
--5.676518660E-003,
--6.100233644E-003,
--6.528933067E-003,
--6.961807609E-003,
--7.398022339E-003,
--7.836719044E-003,
--8.277016692E-003,
--8.718019351E-003,
--9.158811532E-003,
--9.598465636E-003,
--1.003604382E-002,
--1.047059800E-002,
--1.090117730E-002,
--1.132682897E-002,
--1.174659748E-002,
--1.215953380E-002,
--1.256469358E-002,
--1.296114177E-002,
--1.334795821E-002,
--1.372423489E-002,
--1.408908330E-002,
--1.444163360E-002,
--1.478104480E-002,
--1.510649733E-002,
--1.541720331E-002,
--1.571240649E-002,
--1.599138230E-002,
--1.625344716E-002,
--1.649795473E-002,
--1.672429405E-002,
--1.693190821E-002,
--1.712027565E-002,
--1.728892699E-002,
--1.743743755E-002,
--1.756543480E-002,
--1.767260395E-002,
--1.775865816E-002,
--1.782339066E-002,
--1.786663756E-002,
--1.788828894E-002,
-+1.788828894E-002,
-+1.786663756E-002,
-+1.782339066E-002,
-+1.775865816E-002,
-+1.767260395E-002,
-+1.756543480E-002,
-+1.743743755E-002,
-+1.728892699E-002,
-+1.712027565E-002,
-+1.693190821E-002,
-+1.672429405E-002,
-+1.649795473E-002,
-+1.625344716E-002,
-+1.599138230E-002,
-+1.571240649E-002,
-+1.541720331E-002,
-+1.510649733E-002,
-+1.478104480E-002,
-+1.444163360E-002,
-+1.408908330E-002,
-+1.372423489E-002,
-+1.334795821E-002,
-+1.296114177E-002,
-+1.256469358E-002,
-+1.215953380E-002,
-+1.174659748E-002,
-+1.132682897E-002,
-+1.090117730E-002,
-+1.047059800E-002,
-+1.003604382E-002,
-+9.598465636E-003,
-+9.158811532E-003,
-+8.718019351E-003,
-+8.277016692E-003,
-+7.836719044E-003,
-+7.398022339E-003,
-+6.961807609E-003,
-+6.528933067E-003,
-+6.100233644E-003,
-+5.676518660E-003,
-+5.258570891E-003,
-+4.847140983E-003,
-+4.442950245E-003,
-+4.046686925E-003,
-+3.659002949E-003,
-+3.280514618E-003,
-+2.911801683E-003,
-+2.553403843E-003,
-+2.205822384E-003,
-+1.869517611E-003,
-+1.544908970E-003,
-+1.232374110E-003,
-+9.322494152E-004,
-+6.448282511E-004,
-+3.703625989E-004,
-+1.090620208E-004,
--1.389056415E-004,
--3.734139318E-004,
--5.943773431E-004,
--8.017504588E-004,
--9.955273708E-004,
--1.175740734E-003,
--1.342460280E-003,
--1.495792647E-003,
-+1.635878929E-003,
-+1.762894331E-003,
-+1.877046190E-003,
-+1.978572691E-003,
-+2.067740774E-003,
-+2.144844970E-003,
-+2.210205887E-003,
-+2.264167881E-003,
-+2.307097195E-003,
-+2.339380793E-003,
-+2.361423569E-003,
-+2.373647178E-003,
-+2.376487479E-003,
-+2.370394068E-003,
-+2.355825622E-003,
-+2.333251061E-003,
-+2.303145360E-003,
-+2.265989315E-003,
-+2.222266514E-003,
-+2.172462177E-003,
-+2.117061289E-003,
-+2.056547208E-003,
-+1.991399564E-003,
-+1.922092517E-003,
-+1.849094522E-003,
-+1.772865304E-003,
-+1.693855622E-003,
-+1.612505526E-003,
-+1.529243193E-003,
-+1.444484224E-003,
-+1.358630019E-003,
-+1.272067428E-003,
-+1.185167348E-003,
-+1.098284614E-003,
-+1.011756598E-003,
-+9.259034996E-004,
-+8.410271257E-004,
-+7.574109477E-004,
-+6.753197522E-004,
-+5.949990009E-004,
-+5.166754709E-004,
-+4.405563814E-004,
-+3.668301215E-004,
-+2.956659591E-004,
-+2.272142592E-004,
-+1.616069785E-004,
-+9.895755647E-005,
-+3.936182839E-005,
--1.710198012E-005,
--7.037253090E-005,
--1.204049113E-004,
--1.671699720E-004,
--2.106537577E-004,
--2.508567995E-004,
--2.877934603E-004,
--3.214911267E-004,
--3.519894381E-004,
--3.793396754E-004,
--4.036037717E-004,
--4.248536134E-004,
--4.431701091E-004,
--4.586426076E-004,
--4.713678791E-004,
--4.814492422E-004,
-+4.889960401E-004,
-+4.941228544E-004,
-+4.969481961E-004,
-+4.975944757E-004,
-+4.961824161E-004,
-+4.928477574E-004,
-+4.877146275E-004,
-+4.809123348E-004,
-+4.725702747E-004,
-+4.628172028E-004,
-+4.517810594E-004,
-+4.395879805E-004,
-+4.263620067E-004,
-+4.122247046E-004,
-+3.972945851E-004,
-+3.816867538E-004,
-+3.655125911E-004,
-+3.488793736E-004,
-+3.318900708E-004,
-+3.146430245E-004,
-+2.972317743E-004,
-+2.797449124E-004,
-+2.622658503E-004,
-+2.448728774E-004,
-+2.276388550E-004,
-+2.106313768E-004,
-+1.939126523E-004,
-+1.775395358E-004,
-+1.615635992E-004,
-+1.460311323E-004,
-+1.309833024E-004,
-+1.164562127E-004,
-+1.024810626E-004,
-+8.908427117E-005,
-+7.628766616E-005,
-+6.410864444E-005,
-+5.256036457E-005,
-+4.165195787E-005,
-+3.138873581E-005,
-+2.177240640E-005,
-+1.280130618E-005,
-+4.470633485E-006,
--3.227306706E-006,
--1.030297699E-005,
--1.676913780E-005,
--2.264085742E-005,
--2.793515523E-005,
--3.267079956E-005,
--3.686808850E-005,
--4.054862075E-005,
--4.373511547E-005,
--4.645117951E-005,
--4.872112549E-005,
--5.056979353E-005,
--5.202236207E-005,
--5.310418419E-005,
--5.384063843E-005,
--5.425697600E-005,
--5.437819709E-005,
--5.422891263E-005,
--5.383323878E-005,
--5.321469871E-005,
--5.239612074E-005,
--5.139957648E-005,
-+5.024627535E-005,
-+4.895655002E-005,
-+4.754976908E-005,
-+4.604430433E-005,
-+4.445751256E-005,
-+4.280570283E-005,
-+4.110412556E-005,
-+3.936696885E-005,
-+3.760734762E-005,
-+3.583733633E-005,
-+3.406793985E-005,
-+3.230916263E-005,
-+3.056998685E-005,
-+2.885844333E-005,
-+2.718161704E-005,
-+2.554569073E-005,
-+2.395598858E-005,
-+2.241701623E-005,
-+2.093250441E-005,
-+1.950545993E-005,
-+1.813820381E-005,
-+1.683242772E-005,
-+1.558924305E-005,
-+1.440921824E-005,
-+1.329243969E-005,
-+1.223855270E-005,
-+1.124680875E-005,
-+1.031611009E-005,
-+9.445050637E-006,
-+8.631964192E-006,
-+7.874960829E-006,
-+7.171964626E-006,
-+6.520755960E-006,
-+5.918994248E-006,
-+5.364252502E-006,
-+4.854050530E-006,
-+4.385879038E-006,
-+3.957220997E-006,
-+3.565570978E-006,
-+3.208459020E-006,
-+2.883470643E-006,
-+2.588257530E-006,
-+2.320550948E-006,
-+2.078171747E-006,
-+1.859034001E-006,
-+1.661159786E-006,
-+1.482681114E-006,
-+1.321840614E-006,
-+1.176999604E-006,
-+1.046637067E-006,
-+9.293416952E-007,
-+8.238164355E-007,
-+7.288739425E-007,
-+6.434325428E-007,
-+5.665120852E-007,
-+4.972276315E-007,
-+4.347855338E-007,
-+3.784752209E-007,
-+3.276689142E-007,
-+2.818143514E-007,
-+2.404238444E-007,
-+2.030677564E-007,
-+1.693738625E-007,
-+1.390191784E-007
-};
-
-DECLARE_ALIGNED(16, static const float, lfe_fir_64)[] =
-{
-    2.658434386830777e-4, 9.029330685734748e-3,
-    7.939263433218002e-2, 2.425158768892288e-1,
-    3.430179357528686e-1, 2.398228943347931e-1,
-    7.746443897485733e-2, 8.622321300208569e-3,
-    8.179365249816328e-5, 9.450953453779220e-3,
-    8.134882897138596e-2, 2.451938837766648e-1,
-    3.429597318172455e-1, 2.371159791946411e-1,
-    7.556436210870743e-2, 8.229630999267101e-3,
-    9.439323912374676e-5, 9.887560270726680e-3,
-    8.333285897970200e-2, 2.478559017181396e-1,
-    3.428434133529663e-1, 2.343961596488952e-1,
-    7.369252294301987e-2, 7.850865833461285e-3,
-    1.082170274457894e-4, 1.033949479460716e-2,
-    8.534456789493561e-2, 2.505008876323700e-1,
-    3.426689505577088e-1, 2.316644787788391e-1,
-    7.184901088476181e-2, 7.485736627131701e-3,
-    1.233371440321207e-4, 1.080708485096693e-2,
-    8.738376945257187e-2, 2.531278133392334e-1,
-    3.424364924430847e-1, 2.289219647645950e-1,
-    7.003392279148102e-2, 7.133882027119398e-3,
-    1.397485757479444e-4, 1.129068247973919e-2,
-    8.945026248693466e-2, 2.557355761528015e-1,
-    3.421461284160614e-1, 2.261696159839630e-1,
-    6.824731826782227e-2, 6.794991903007030e-3,
-    1.575958012836054e-4, 1.179065089672804e-2,
-    9.154383838176728e-2, 2.583232223987580e-1,
-    3.417979776859284e-1, 2.234084606170654e-1,
-    6.648923456668854e-2, 6.468691397458315e-3,
-    1.769922382663936e-4, 1.230732165277004e-2,
-    9.366425126791000e-2, 2.608896791934967e-1,
-    3.413922190666198e-1, 2.206395119428635e-1,
-    6.475970894098282e-2, 6.154712289571762e-3,
-    1.981738605536520e-4, 1.284105982631445e-2,
-    9.581124037504196e-2, 2.634339034557342e-1,
-    3.409290313720703e-1, 2.178637981414795e-1,
-    6.305878609418869e-2, 5.852684378623962e-3,
-    2.211847313446924e-4, 1.339218579232693e-2,
-    9.798453748226166e-2, 2.659549415111542e-1,
-    3.404086530208588e-1, 2.150822728872299e-1,
-    6.138643622398376e-2, 5.562345497310162e-3,
-    2.460231189616024e-4, 1.396108977496624e-2,
-    1.001838669180870e-1, 2.684516608715058e-1,
-    3.398312926292420e-1, 2.122959494590759e-1,
-    5.974265560507774e-2, 5.283284001052380e-3,
-    2.726115926634520e-4, 1.454808749258518e-2,
-    1.024089083075523e-1, 2.709231376647949e-1,
-    3.391972482204438e-1, 2.095058411359787e-1,
-    5.812742188572884e-2, 5.015311297029257e-3,
-    3.013863170053810e-4, 1.515355054289102e-2,
-    1.046593263745308e-1, 2.733682692050934e-1,
-    3.385068178176880e-1, 2.067128717899322e-1,
-    5.654069408774376e-2, 4.758012015372515e-3,
-    3.328395541757345e-4, 1.577781140804291e-2,
-    1.069347932934761e-1, 2.757860720157624e-1,
-    3.377602994441986e-1, 2.039180546998978e-1,
-    5.498242005705833e-2, 4.511159844696522e-3,
-    3.658991190604866e-4, 1.642123050987720e-2,
-    1.092349365353584e-1, 2.781755328178406e-1,
-    3.369580209255218e-1, 2.011223286390304e-1,
-    5.345252528786659e-2, 4.274417180567980e-3,
-    4.018281470052898e-4, 1.708412915468216e-2,
-    1.115593686699867e-1, 2.805356979370117e-1,
-    3.361004292964936e-1, 1.983266174793244e-1,
-    5.195093154907227e-2, 4.047499038279056e-3,
-    4.401875485200435e-4, 1.776690222322941e-2,
-    1.139076948165894e-1, 2.828655838966370e-1,
-    3.351879119873047e-1, 1.955319195985794e-1,
-    5.047753453254700e-2, 3.830091329291463e-3,
-    4.812776169274002e-4, 1.846982724964619e-2,
-    1.162794977426529e-1, 2.851640880107880e-1,
-    3.342207968235016e-1, 1.927391141653061e-1,
-    4.903224110603333e-2, 3.621967276558280e-3,
-    5.252459668554366e-4, 1.919330470263958e-2,
-    1.186743453145027e-1, 2.874303460121155e-1,
-    3.331996202468872e-1, 1.899491697549820e-1,
-    4.761491715908051e-2, 3.422776935622096e-3,
-    5.721592460758984e-4, 1.993762329220772e-2,
-    1.210917681455612e-1, 2.896633744239807e-1,
-    3.321248590946198e-1, 1.871629506349564e-1,
-    4.622544348239899e-2, 3.232272574678064e-3,
-    6.222130032256246e-4, 2.070316113531590e-2,
-    1.235313042998314e-1, 2.918621897697448e-1,
-    3.309969604015350e-1, 1.843813359737396e-1,
-    4.486365616321564e-2, 3.050152910873294e-3,
-    6.755515350960195e-4, 2.149021252989769e-2,
-    1.259924471378326e-1, 2.940258979797364e-1,
-    3.298164308071136e-1, 1.816052496433258e-1,
-    4.352942481637001e-2, 2.876190468668938e-3,
-    7.324148900806904e-4, 2.229913882911205e-2,
-    1.284746825695038e-1, 2.961534857749939e-1,
-    3.285838961601258e-1, 1.788355410099030e-1,
-    4.222255200147629e-2, 2.710093278437853e-3,
-    7.928516715764999e-4, 2.313023805618286e-2,
-    1.309774816036224e-1, 2.982441186904907e-1,
-    3.272998929023742e-1, 1.760730892419815e-1,
-    4.094288870692253e-2, 2.551567042246461e-3,
-    8.570110658183694e-4, 2.398385666310787e-2,
-    1.335003077983856e-1, 3.002967536449432e-1,
-    3.259649574756622e-1, 1.733186990022659e-1,
-    3.969023004174232e-2, 2.400433411821723e-3,
-    9.251192095689476e-4, 2.486028522253036e-2,
-    1.360425949096680e-1, 3.023106753826142e-1,
-    3.245797157287598e-1, 1.705732345581055e-1,
-    3.846437484025955e-2, 2.256359672173858e-3,
-    9.974770946428180e-4, 2.575986087322235e-2,
-    1.386037617921829e-1, 3.042849004268646e-1,
-    3.231448531150818e-1, 1.678375005722046e-1,
-    3.726511076092720e-2, 2.119151875376701e-3,
-    1.073930296115577e-3, 2.668286114931106e-2,
-    1.411831974983215e-1, 3.062185347080230e-1,
-    3.216609656810760e-1, 1.651122719049454e-1,
-    3.609224036335945e-2, 1.988604199141264e-3,
-    1.155023579485714e-3, 2.762960828840732e-2,
-    1.437802612781525e-1, 3.081108033657074e-1,
-    3.201287388801574e-1, 1.623983532190323e-1,
-    3.494550660252571e-2, 1.864377525635064e-3,
-    1.240676851011813e-3, 2.860039286315441e-2,
-    1.463943719863892e-1, 3.099608123302460e-1,
-    3.185488879680634e-1, 1.596965193748474e-1,
-    3.382468968629837e-2, 1.746327499859035e-3,
-    1.331258914433420e-3, 2.959549613296986e-2,
-    1.490248143672943e-1, 3.117676973342896e-1,
-    3.169221282005310e-1, 1.570075154304504e-1,
-    3.272953629493714e-2, 1.634211512282491e-3,
-    1.426893868483603e-3, 3.061520494520664e-2,
-    1.516709625720978e-1, 3.135308027267456e-1,
-    3.152491748332978e-1, 1.543320864439010e-1,
-    3.165979683399200e-2, 1.527829794213176e-3,
-};
-
-DECLARE_ALIGNED(16, static const float, lfe_fir_128)[] =
-{
-    0.00053168571, 0.15878495574, 0.68603444099, 0.15492856503,
-    0.00016358691, 0.16269733012, 0.68591803312, 0.15112841129,
-    0.00018878609, 0.16666537523, 0.68568539619, 0.14738474786,
-    0.00021643363, 0.17068879306, 0.68533653021, 0.14369773865,
-    0.00024667382, 0.17476719618, 0.68487155437, 0.14006754756,
-    0.00027949660, 0.17890018225, 0.68429082632, 0.13649433851,
-    0.00031519096, 0.18308731914, 0.68359452486, 0.13297818601,
-    0.00035398375, 0.18732811511, 0.68278300762, 0.12951917946,
-    0.00039634691, 0.19162209332, 0.68185669184, 0.12611730397,
-    0.00044236859, 0.19596865773, 0.68081587553, 0.12277261168,
-    0.00049204525, 0.20036731660, 0.67966115475, 0.11948505789,
-    0.00054522208, 0.20481738448, 0.67839306593, 0.11625462025,
-    0.00060277141, 0.20931822062, 0.67701220512, 0.11308115721,
-    0.00066567765, 0.21386915445, 0.67551922798, 0.10996460915,
-    0.00073179678, 0.21846942604, 0.67391467094, 0.10690483451,
-    0.00080365466, 0.22311829031, 0.67219948769, 0.10390164703,
-    0.00088037323, 0.22781492770, 0.67037439346, 0.10095486045,
-    0.00096255314, 0.23255851865, 0.66844022274, 0.09806428105,
-    0.00105048984, 0.23734821379, 0.66639786959, 0.09522963315,
-    0.00114431616, 0.24218304455, 0.66424828768, 0.09245070815,
-    0.00124442333, 0.24706205726, 0.66199249029, 0.08972713351,
-    0.00135110028, 0.25198432803, 0.65963155031, 0.08705867827,
-    0.00146482687, 0.25694879889, 0.65716648102, 0.08444493264,
-    0.00158570008, 0.26195442677, 0.65459835529, 0.08188561350,
-    0.00171401864, 0.26700007915, 0.65192854404, 0.07938029617,
-    0.00185023469, 0.27208462358, 0.64915806055, 0.07692859322,
-    0.00199495023, 0.27720692754, 0.64628833532, 0.07453006506,
-    0.00214785640, 0.28236576915, 0.64332056046, 0.07218432426,
-    0.00231004250, 0.28755992651, 0.64025616646, 0.06989086419,
-    0.00248134881, 0.29278811812, 0.63709646463, 0.06764923781,
-    0.00266251224, 0.29804900289, 0.63384294510, 0.06545893103,
-    0.00285378192, 0.30334126949, 0.63049703836, 0.06331945211,
-    0.00305565330, 0.30866351724, 0.62706029415, 0.06123027951,
-    0.00326841651, 0.31401440501, 0.62353414297, 0.05919086933,
-    0.00349264755, 0.31939238310, 0.61992025375, 0.05720067024,
-    0.00372874714, 0.32479602098, 0.61622029543, 0.05525910854,
-    0.00397720048, 0.33022382855, 0.61243581772, 0.05336561054,
-    0.00423829490, 0.33567428589, 0.60856848955, 0.05151961371,
-    0.00451271003, 0.34114575386, 0.60462015867, 0.04972046614,
-    0.00480085658, 0.34663668275, 0.60059231520, 0.04796761274,
-    0.00510312291, 0.35214546323, 0.59648692608, 0.04626038298,
-    0.00542017492, 0.35767036676, 0.59230577946, 0.04459818453,
-    0.00575236930, 0.36320972443, 0.58805054426, 0.04298033938,
-    0.00610029325, 0.36876192689, 0.58372318745, 0.04140623659,
-    0.00646453211, 0.37432509661, 0.57932555676, 0.03987516090,
-    0.00684553990, 0.37989753485, 0.57485944033, 0.03838652745,
-    0.00724391919, 0.38547745347, 0.57032698393, 0.03693958372,
-    0.00766016589, 0.39106300473, 0.56572991610, 0.03553372994,
-    0.00809498038, 0.39665243030, 0.56107026339, 0.03416819125,
-    0.00854881573, 0.40224379301, 0.55634999275, 0.03284239396,
-    0.00902230106, 0.40783521533, 0.55157101154, 0.03155555204,
-    0.00951600447, 0.41342487931, 0.54673534632, 0.03030703776,
-    0.01003060210, 0.41901078820, 0.54184508324, 0.02909611352,
-    0.01056654565, 0.42459106445, 0.53690224886, 0.02792212367,
-    0.01112466771, 0.43016362190, 0.53190881014, 0.02678431384,
-    0.01170534454, 0.43572667241, 0.52686679363, 0.02568206564,
-    0.01230939943, 0.44127810001, 0.52177828550, 0.02461459488,
-    0.01293735672, 0.44681602716, 0.51664537191, 0.02358125709,
-    0.01358995494, 0.45233830810, 0.51147013903, 0.02258131653,
-    0.01426773332, 0.45784294605, 0.50625455379, 0.02161412500,
-    0.01497144438, 0.46332800388, 0.50100076199, 0.02067894675,
-    0.01570170000, 0.46879136562, 0.49571081996, 0.01977507770,
-    0.01645922661, 0.47423094511, 0.49038675427, 0.01890186779,
-    0.01724460535, 0.47964480519, 0.48503074050, 0.01805862412,
-};
-
-/*
- * D.11 Look-up Table for Downmix Scale Factors
- *
- * Note that the range of the entries in DmixTable[] is between -60 dB and 0 dB
- * with addition of -inf (|DMixCoeff| = 0), which is coded with a DmixCode = 0.
- * Furthermore, the range [-60 to 0] is subdivided into 3 regions, each with a
- * different grid resolution:
- *
- * 1) [-60.000 to -30] with resolution of 0.500 dB
- * 2) [-29.750 to -15] with resolution of 0.250 dB
- * 3) [-14.875 to   0] with resolution of 0.125 dB
- */
-static const float dca_dmixtable[241] = {
-    0.001000, 0.001059, 0.001122, 0.001189, 0.001259, 0.001334, 0.001413, 0.001496,
-    0.001585, 0.001679, 0.001778, 0.001884, 0.001995, 0.002113, 0.002239, 0.002371,
-    0.002512, 0.002661, 0.002818, 0.002985, 0.003162, 0.003350, 0.003548, 0.003758,
-    0.003981, 0.004217, 0.004467, 0.004732, 0.005012, 0.005309, 0.005623, 0.005957,
-    0.006310, 0.006683, 0.007079, 0.007499, 0.007943, 0.008414, 0.008913, 0.009441,
-    0.010000, 0.010593, 0.011220, 0.011885, 0.012589, 0.013335, 0.014125, 0.014962,
-    0.015849, 0.016788, 0.017783, 0.018836, 0.019953, 0.021135, 0.022387, 0.023714,
-    0.025119, 0.026607, 0.028184, 0.029854, 0.031623, 0.032546, 0.033497, 0.034475,
-    0.035481, 0.036517, 0.037584, 0.038681, 0.039811, 0.040973, 0.042170, 0.043401,
-    0.044668, 0.045973, 0.047315, 0.048697, 0.050119, 0.051582, 0.053088, 0.054639,
-    0.056234, 0.057876, 0.059566, 0.061306, 0.063096, 0.064938, 0.066834, 0.068786,
-    0.070795, 0.072862, 0.074989, 0.077179, 0.079433, 0.081752, 0.084140, 0.086596,
-    0.089125, 0.091728, 0.094406, 0.097163, 0.100000, 0.102920, 0.105925, 0.109018,
-    0.112202, 0.115478, 0.118850, 0.122321, 0.125893, 0.129569, 0.133352, 0.137246,
-    0.141254, 0.145378, 0.149624, 0.153993, 0.158489, 0.163117, 0.167880, 0.172783,
-    0.177828, 0.180406, 0.183021, 0.185674, 0.188365, 0.191095, 0.193865, 0.196675,
-    0.199526, 0.202418, 0.205353, 0.208329, 0.211349, 0.214412, 0.217520, 0.220673,
-    0.223872, 0.227117, 0.230409, 0.233749, 0.237137, 0.240575, 0.244062, 0.247600,
-    0.251189, 0.254830, 0.258523, 0.262271, 0.266073, 0.269929, 0.273842, 0.277811,
-    0.281838, 0.285924, 0.290068, 0.294273, 0.298538, 0.302866, 0.307256, 0.311709,
-    0.316228, 0.320812, 0.325462, 0.330179, 0.334965, 0.339821, 0.344747, 0.349744,
-    0.354813, 0.359956, 0.365174, 0.370467, 0.375837, 0.381285, 0.386812, 0.392419,
-    0.398107, 0.403878, 0.409732, 0.415671, 0.421697, 0.427809, 0.434010, 0.440301,
-    0.446684, 0.453158, 0.459727, 0.466391, 0.473151, 0.480010, 0.486968, 0.494026,
-    0.501187, 0.508452, 0.515822, 0.523299, 0.530884, 0.538580, 0.546387, 0.554307,
-    0.562341, 0.570493, 0.578762, 0.587151, 0.595662, 0.604296, 0.613056, 0.621942,
-    0.630957, 0.640103, 0.649382, 0.658795, 0.668344, 0.678032, 0.687860, 0.697831,
-    0.707107, 0.718208, 0.728618, 0.739180, 0.749894, 0.760764, 0.771792, 0.782979,
-    0.794328, 0.805842, 0.817523, 0.829373, 0.841395, 0.853591, 0.865964, 0.878517,
-    0.891251, 0.904170, 0.917276, 0.930572, 0.944061, 0.957745, 0.971628, 0.985712,
-    1.000000,
-};
-
-static const float dca_default_coeffs[10][6][2] = {
-    { { 0.707107, 0.707107 }, { 0.000000, 0.000000 },                                                                                                 }, // A [LFE]
-    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 },                                                                         }, // A + B (dual mono) [LFE]
-    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 },                                                                         }, // L + R (stereo) [LFE]
-    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 },                                                                         }, // (L+R) + (L-R) (sum-difference) [LFE]
-    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 },                                                                         }, // LT + RT (left and right total) [LFE]
-    { { 0.501187, 0.501187 }, { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.000000, 0.000000 },                                                 }, // C + L + R [LFE]
-    { { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.501187 }, { 0.000000, 0.000000 },                                                 }, // L + R + S [LFE]
-    { { 0.501187, 0.501187 }, { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.501187 }, { 0.000000, 0.000000 },                         }, // C + L + R + S [LFE]
-    { { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.000000 }, { 0.000000, 0.501187 }, { 0.000000, 0.000000 },                         }, // L + R + SL + SR [LFE]
-    { { 0.501187, 0.501187 }, { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.000000 }, { 0.000000, 0.501187 }, { 0.000000, 0.000000 }, }, // C + L + R + SL + SR [LFE]
-};
-
-/* downmix coeffs
-
- TABLE 9
-______________________________________
-Down-mix coefficients for 8-channel source
-audio (5 + 3 format)
- lt
- cen- rt lt ctr rt
-lt ter ctr center
- rt srd srd srd
-______________________________________
-1 0.71 0.74 1.0 0.71 0.71 0.58 0.58 0.58
-2 left 1.0 0.89 0.71 0.46 0.71 0.50
-  rt 0.45 0.71 0.89 1.0 0.50 0.71
-3 lt 1.0 0.89 0.71 0.45
- rt 0.45 0.71 0.89 1.0
- srd 0.71 0.71 0.71
-4 lt 1.0 0.89 0.71 0.45
- rt 0.45 0.71 0.89 1.0
- lt srd 1.0 0.71
- rt srd 0.71 0.71
-4 lt 1.0 0.5
- ctr 0.87 1.0 0.87
- rt 0.5 1.0
- srd 0.71 0.71 0.71
-5 lt 1.0 0.5
- ctr 0.87 1.0 0.87
- rt 0.5 1.0
- lt srd 1.0 0.71
- rt srd 0.71 1.0
-6 lt 1.0 0.5
- lt ctr 0.87 0.71
- rt ctr 0.71 0.87
- rt 0.5 1.0
- lt srd 1.0 0.71
- rt srd 0.71 1.0
-6 lt 1.0 0.5
- ctr 0.86 1.0 0.86
- rt 0.5 1.0
- lt srd 1.0
- ctr srd 1.0
- rt srd 1.0
-7 lt 1.0
- lt ctr 1.0
- ctr 1.0
- rt ctr 1.0
- rt 1.0
- lt srd 1.0 0.71
- rt srd 0.71 1.0
-7 lt 1.0 0.5
- lt ctr 0.87 0.71
- rt ctr 0.71 0.87
- rt 0.5 1.0
- lt srd 1.0
- ctr srd 1.0
- rt srd 1.0
-8 lt 1.0 0.5
- lt ctr 0.87 0.71
- rt ctr 0.71 0.87
- rt 0.5 1.0
- lt 1 srd 0.87 0.35
- lt 2 srd 0.5 0.61
- rt 2 srd 0.61 0.50
- rt 2 srd 0.35 0.87
-
- Generation of Lt Rt
-
-In the case when the playback system has analog or digital surround multi-channel capability, a down matrix from 5, 4, or 3 channel to Lt Rt may be desirable. In the case when the number of decoded audio channels exceeds 5, 4 or 3 respectively a first stage down mix to 5, 4 or 3 chs should be used as described above.
-
-The down matrixing equations for 5-channel source audio to a two-channel Lt Rt playback system are given by:
-
-Left left+0.7*center-0.7*(lt surround+rt surround)
-
-Right=right+0.7*center+0.7*(lt surround+rt surround)
-
-Embedded mixing to 2-channel
-
-One concern arising from the proliferation of multi-channel audio systems is that most home systems presently have only two channel playback capability. To accommodate this a fixed 2-channel down matrix processes is commonly used following the multi-channel decoding stage. However, for music only applications the image quality etc. of the down matrixed signal may not match that of an equivalent stereo recording found on CD.
-
-The concept of embedded mixing is to allow the producer to dynamically specify the matrixing coefficients within the audio frame itself. In this way the stereo down mix at the decoder may be better matched to a 2-channel playback environment.
-
-CHS*2, 7-bit down mix indexes (MCOEFFS) are transmitted along with the multi-channel audio once in every frame. The indexes are converted to attenuation factors using a 7 bit LUT. The 2-ch down mix equations are as follows,
-
-Left Ch=sum (MCOEFF[n]*Ch[n]) for n=1, CHS
-
-Right Ch sum (MCOEFF[n+CHS]*Ch[n]) for n=1, CHS
-
-where Ch(n) represents the subband samples in the (n)th audio channel.
-
-
-*/
-
-#endif /* AVCODEC_DCADATA_H */
diff --git a/deps/libav/libavcodec/dcadec.c b/deps/libav/libavcodec/dcadec.c
deleted file mode 100644
index ce8660d..0000000
--- a/deps/libav/libavcodec/dcadec.c
+++ /dev/null
@@ -1,2107 +0,0 @@
-/*
- * DCA compatible decoder
- * Copyright (C) 2004 Gildas Bazin
- * Copyright (C) 2004 Benjamin Zores
- * Copyright (C) 2006 Benjamin Larsson
- * Copyright (C) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <math.h>
-#include <stddef.h>
-#include <stdio.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-#include "avcodec.h"
-#include "fft.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "dcadata.h"
-#include "dcahuff.h"
-#include "dca.h"
-#include "mathops.h"
-#include "synth_filter.h"
-#include "dcadsp.h"
-#include "fmtconvert.h"
-#include "internal.h"
-
-#if ARCH_ARM
-#   include "arm/dca.h"
-#endif
-#if ARCH_X86
-#   include "x86/dca.h"
-#endif
-
-//#define TRACE
-
-#define DCA_PRIM_CHANNELS_MAX  (7)
-#define DCA_SUBBANDS          (32)
-#define DCA_ABITS_MAX         (32)      /* Should be 28 */
-#define DCA_SUBSUBFRAMES_MAX   (4)
-#define DCA_SUBFRAMES_MAX     (16)
-#define DCA_BLOCKS_MAX        (16)
-#define DCA_LFE_MAX            (3)
-
-enum DCAMode {
-    DCA_MONO = 0,
-    DCA_CHANNEL,
-    DCA_STEREO,
-    DCA_STEREO_SUMDIFF,
-    DCA_STEREO_TOTAL,
-    DCA_3F,
-    DCA_2F1R,
-    DCA_3F1R,
-    DCA_2F2R,
-    DCA_3F2R,
-    DCA_4F2R
-};
-
-/* these are unconfirmed but should be mostly correct */
-enum DCAExSSSpeakerMask {
-    DCA_EXSS_FRONT_CENTER          = 0x0001,
-    DCA_EXSS_FRONT_LEFT_RIGHT      = 0x0002,
-    DCA_EXSS_SIDE_REAR_LEFT_RIGHT  = 0x0004,
-    DCA_EXSS_LFE                   = 0x0008,
-    DCA_EXSS_REAR_CENTER           = 0x0010,
-    DCA_EXSS_FRONT_HIGH_LEFT_RIGHT = 0x0020,
-    DCA_EXSS_REAR_LEFT_RIGHT       = 0x0040,
-    DCA_EXSS_FRONT_HIGH_CENTER     = 0x0080,
-    DCA_EXSS_OVERHEAD              = 0x0100,
-    DCA_EXSS_CENTER_LEFT_RIGHT     = 0x0200,
-    DCA_EXSS_WIDE_LEFT_RIGHT       = 0x0400,
-    DCA_EXSS_SIDE_LEFT_RIGHT       = 0x0800,
-    DCA_EXSS_LFE2                  = 0x1000,
-    DCA_EXSS_SIDE_HIGH_LEFT_RIGHT  = 0x2000,
-    DCA_EXSS_REAR_HIGH_CENTER      = 0x4000,
-    DCA_EXSS_REAR_HIGH_LEFT_RIGHT  = 0x8000,
-};
-
-enum DCAExtensionMask {
-    DCA_EXT_CORE       = 0x001, ///< core in core substream
-    DCA_EXT_XXCH       = 0x002, ///< XXCh channels extension in core substream
-    DCA_EXT_X96        = 0x004, ///< 96/24 extension in core substream
-    DCA_EXT_XCH        = 0x008, ///< XCh channel extension in core substream
-    DCA_EXT_EXSS_CORE  = 0x010, ///< core in ExSS (extension substream)
-    DCA_EXT_EXSS_XBR   = 0x020, ///< extended bitrate extension in ExSS
-    DCA_EXT_EXSS_XXCH  = 0x040, ///< XXCh channels extension in ExSS
-    DCA_EXT_EXSS_X96   = 0x080, ///< 96/24 extension in ExSS
-    DCA_EXT_EXSS_LBR   = 0x100, ///< low bitrate component in ExSS
-    DCA_EXT_EXSS_XLL   = 0x200, ///< lossless extension in ExSS
-};
-
-/* -1 are reserved or unknown */
-static const int dca_ext_audio_descr_mask[] = {
-    DCA_EXT_XCH,
-    -1,
-    DCA_EXT_X96,
-    DCA_EXT_XCH | DCA_EXT_X96,
-    -1,
-    -1,
-    DCA_EXT_XXCH,
-    -1,
-};
-
-/* extensions that reside in core substream */
-#define DCA_CORE_EXTS (DCA_EXT_XCH | DCA_EXT_XXCH | DCA_EXT_X96)
-
-/* Tables for mapping dts channel configurations to libavcodec multichannel api.
- * Some compromises have been made for special configurations. Most configurations
- * are never used so complete accuracy is not needed.
- *
- * L = left, R = right, C = center, S = surround, F = front, R = rear, T = total, OV = overhead.
- * S  -> side, when both rear and back are configured move one of them to the side channel
- * OV -> center back
- * All 2 channel configurations -> AV_CH_LAYOUT_STEREO
- */
-static const uint64_t dca_core_channel_layout[] = {
-    AV_CH_FRONT_CENTER,                                                     ///< 1, A
-    AV_CH_LAYOUT_STEREO,                                                    ///< 2, A + B (dual mono)
-    AV_CH_LAYOUT_STEREO,                                                    ///< 2, L + R (stereo)
-    AV_CH_LAYOUT_STEREO,                                                    ///< 2, (L + R) + (L - R) (sum-difference)
-    AV_CH_LAYOUT_STEREO,                                                    ///< 2, LT + RT (left and right total)
-    AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER,                               ///< 3, C + L + R
-    AV_CH_LAYOUT_STEREO | AV_CH_BACK_CENTER,                                ///< 3, L + R + S
-    AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER | AV_CH_BACK_CENTER,           ///< 4, C + L + R + S
-    AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT,               ///< 4, L + R + SL + SR
-
-    AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER | AV_CH_SIDE_LEFT |
-    AV_CH_SIDE_RIGHT,                                                       ///< 5, C + L + R + SL + SR
-
-    AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT |
-    AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER,               ///< 6, CL + CR + L + R + SL + SR
-
-    AV_CH_LAYOUT_STEREO | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT |
-    AV_CH_FRONT_CENTER  | AV_CH_BACK_CENTER,                                ///< 6, C + L + R + LR + RR + OV
-
-    AV_CH_FRONT_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER |
-    AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_BACK_CENTER   |
-    AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT,                                     ///< 6, CF + CR + LF + RF + LR + RR
-
-    AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_CENTER   |
-    AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_LAYOUT_STEREO |
-    AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT,                                     ///< 7, CL + C + CR + L + R + SL + SR
-
-    AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER |
-    AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT |
-    AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT,                                     ///< 8, CL + CR + L + R + SL1 + SL2 + SR1 + SR2
-
-    AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_CENTER   |
-    AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_LAYOUT_STEREO |
-    AV_CH_SIDE_LEFT | AV_CH_BACK_CENTER | AV_CH_SIDE_RIGHT,                 ///< 8, CL + C + CR + L + R + SL + S + SR
-};
-
-static const int8_t dca_lfe_index[] = {
-    1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3
-};
-
-static const int8_t dca_channel_reorder_lfe[][9] = {
-    { 0, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
-    { 2,  0,  1, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
-    { 2,  0,  1,  4, -1, -1, -1, -1, -1},
-    { 0,  1,  3,  4, -1, -1, -1, -1, -1},
-    { 2,  0,  1,  4,  5, -1, -1, -1, -1},
-    { 3,  4,  0,  1,  5,  6, -1, -1, -1},
-    { 2,  0,  1,  4,  5,  6, -1, -1, -1},
-    { 0,  6,  4,  5,  2,  3, -1, -1, -1},
-    { 4,  2,  5,  0,  1,  6,  7, -1, -1},
-    { 5,  6,  0,  1,  7,  3,  8,  4, -1},
-    { 4,  2,  5,  0,  1,  6,  8,  7, -1},
-};
-
-static const int8_t dca_channel_reorder_lfe_xch[][9] = {
-    { 0,  2, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
-    { 2,  0,  1,  4, -1, -1, -1, -1, -1},
-    { 0,  1,  3,  4, -1, -1, -1, -1, -1},
-    { 2,  0,  1,  4,  5, -1, -1, -1, -1},
-    { 0,  1,  4,  5,  3, -1, -1, -1, -1},
-    { 2,  0,  1,  5,  6,  4, -1, -1, -1},
-    { 3,  4,  0,  1,  6,  7,  5, -1, -1},
-    { 2,  0,  1,  4,  5,  6,  7, -1, -1},
-    { 0,  6,  4,  5,  2,  3,  7, -1, -1},
-    { 4,  2,  5,  0,  1,  7,  8,  6, -1},
-    { 5,  6,  0,  1,  8,  3,  9,  4,  7},
-    { 4,  2,  5,  0,  1,  6,  9,  8,  7},
-};
-
-static const int8_t dca_channel_reorder_nolfe[][9] = {
-    { 0, -1, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
-    { 2,  0,  1, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
-    { 2,  0,  1,  3, -1, -1, -1, -1, -1},
-    { 0,  1,  2,  3, -1, -1, -1, -1, -1},
-    { 2,  0,  1,  3,  4, -1, -1, -1, -1},
-    { 2,  3,  0,  1,  4,  5, -1, -1, -1},
-    { 2,  0,  1,  3,  4,  5, -1, -1, -1},
-    { 0,  5,  3,  4,  1,  2, -1, -1, -1},
-    { 3,  2,  4,  0,  1,  5,  6, -1, -1},
-    { 4,  5,  0,  1,  6,  2,  7,  3, -1},
-    { 3,  2,  4,  0,  1,  5,  7,  6, -1},
-};
-
-static const int8_t dca_channel_reorder_nolfe_xch[][9] = {
-    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
-    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
-    { 2,  0,  1,  3, -1, -1, -1, -1, -1},
-    { 0,  1,  2,  3, -1, -1, -1, -1, -1},
-    { 2,  0,  1,  3,  4, -1, -1, -1, -1},
-    { 0,  1,  3,  4,  2, -1, -1, -1, -1},
-    { 2,  0,  1,  4,  5,  3, -1, -1, -1},
-    { 2,  3,  0,  1,  5,  6,  4, -1, -1},
-    { 2,  0,  1,  3,  4,  5,  6, -1, -1},
-    { 0,  5,  3,  4,  1,  2,  6, -1, -1},
-    { 3,  2,  4,  0,  1,  6,  7,  5, -1},
-    { 4,  5,  0,  1,  7,  2,  8,  3,  6},
-    { 3,  2,  4,  0,  1,  5,  8,  7,  6},
-};
-
-#define DCA_DOLBY                  101           /* FIXME */
-
-#define DCA_CHANNEL_BITS             6
-#define DCA_CHANNEL_MASK          0x3F
-
-#define DCA_LFE                   0x80
-
-#define HEADER_SIZE                 14
-
-#define DCA_MAX_FRAME_SIZE       16384
-#define DCA_MAX_EXSS_HEADER_SIZE  4096
-
-#define DCA_BUFFER_PADDING_SIZE   1024
-
-#define DCA_NSYNCAUX        0x9A1105A0
-
-/** Bit allocation */
-typedef struct {
-    int offset;                 ///< code values offset
-    int maxbits[8];             ///< max bits in VLC
-    int wrap;                   ///< wrap for get_vlc2()
-    VLC vlc[8];                 ///< actual codes
-} BitAlloc;
-
-static BitAlloc dca_bitalloc_index;    ///< indexes for samples VLC select
-static BitAlloc dca_tmode;             ///< transition mode VLCs
-static BitAlloc dca_scalefactor;       ///< scalefactor VLCs
-static BitAlloc dca_smpl_bitalloc[11]; ///< samples VLCs
-
-static av_always_inline int get_bitalloc(GetBitContext *gb, BitAlloc *ba,
-                                         int idx)
-{
-    return get_vlc2(gb, ba->vlc[idx].table, ba->vlc[idx].bits, ba->wrap) +
-           ba->offset;
-}
-
-typedef struct {
-    AVClass *class;             ///< class for AVOptions
-    AVCodecContext *avctx;
-    /* Frame header */
-    int frame_type;             ///< type of the current frame
-    int samples_deficit;        ///< deficit sample count
-    int crc_present;            ///< crc is present in the bitstream
-    int sample_blocks;          ///< number of PCM sample blocks
-    int frame_size;             ///< primary frame byte size
-    int amode;                  ///< audio channels arrangement
-    int sample_rate;            ///< audio sampling rate
-    int bit_rate;               ///< transmission bit rate
-    int bit_rate_index;         ///< transmission bit rate index
-
-    int dynrange;               ///< embedded dynamic range flag
-    int timestamp;              ///< embedded time stamp flag
-    int aux_data;               ///< auxiliary data flag
-    int hdcd;                   ///< source material is mastered in HDCD
-    int ext_descr;              ///< extension audio descriptor flag
-    int ext_coding;             ///< extended coding flag
-    int aspf;                   ///< audio sync word insertion flag
-    int lfe;                    ///< low frequency effects flag
-    int predictor_history;      ///< predictor history flag
-    int header_crc;             ///< header crc check bytes
-    int multirate_inter;        ///< multirate interpolator switch
-    int version;                ///< encoder software revision
-    int copy_history;           ///< copy history
-    int source_pcm_res;         ///< source pcm resolution
-    int front_sum;              ///< front sum/difference flag
-    int surround_sum;           ///< surround sum/difference flag
-    int dialog_norm;            ///< dialog normalisation parameter
-
-    /* Primary audio coding header */
-    int subframes;              ///< number of subframes
-    int total_channels;         ///< number of channels including extensions
-    int prim_channels;          ///< number of primary audio channels
-    int subband_activity[DCA_PRIM_CHANNELS_MAX];    ///< subband activity count
-    int vq_start_subband[DCA_PRIM_CHANNELS_MAX];    ///< high frequency vq start subband
-    int joint_intensity[DCA_PRIM_CHANNELS_MAX];     ///< joint intensity coding index
-    int transient_huffman[DCA_PRIM_CHANNELS_MAX];   ///< transient mode code book
-    int scalefactor_huffman[DCA_PRIM_CHANNELS_MAX]; ///< scale factor code book
-    int bitalloc_huffman[DCA_PRIM_CHANNELS_MAX];    ///< bit allocation quantizer select
-    int quant_index_huffman[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX]; ///< quantization index codebook select
-    float scalefactor_adj[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX];   ///< scale factor adjustment
-
-    /* Primary audio coding side information */
-    int subsubframes[DCA_SUBFRAMES_MAX];                         ///< number of subsubframes
-    int partial_samples[DCA_SUBFRAMES_MAX];                      ///< partial subsubframe samples count
-    int prediction_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];    ///< prediction mode (ADPCM used or not)
-    int prediction_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];      ///< prediction VQ coefs
-    int bitalloc[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];           ///< bit allocation index
-    int transition_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];    ///< transition mode (transients)
-    int scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2];    ///< scale factors (2 if transient)
-    int joint_huff[DCA_PRIM_CHANNELS_MAX];                       ///< joint subband scale factors codebook
-    int joint_scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS]; ///< joint subband scale factors
-    float downmix_coef[DCA_PRIM_CHANNELS_MAX + 1][2];            ///< stereo downmix coefficients
-    int dynrange_coef;                                           ///< dynamic range coefficient
-
-    /* Core substream's embedded downmix coefficients (cf. ETSI TS 102 114 V1.4.1)
-     * Input:  primary audio channels (incl. LFE if present)
-     * Output: downmix audio channels (up to 4, no LFE) */
-    uint8_t  core_downmix;                                       ///< embedded downmix coefficients available
-    uint8_t  core_downmix_amode;                                 ///< audio channel arrangement of embedded downmix
-    uint16_t core_downmix_codes[DCA_PRIM_CHANNELS_MAX + 1][4];   ///< embedded downmix coefficients (9-bit codes)
-
-    int high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];       ///< VQ encoded high frequency subbands
-
-    float lfe_data[2 * DCA_LFE_MAX * (DCA_BLOCKS_MAX + 4)];      ///< Low frequency effect data
-    int lfe_scale_factor;
-
-    /* Subband samples history (for ADPCM) */
-    DECLARE_ALIGNED(16, float, subband_samples_hist)[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4];
-    DECLARE_ALIGNED(32, float, subband_fir_hist)[DCA_PRIM_CHANNELS_MAX][512];
-    DECLARE_ALIGNED(32, float, subband_fir_noidea)[DCA_PRIM_CHANNELS_MAX][32];
-    int hist_index[DCA_PRIM_CHANNELS_MAX];
-    DECLARE_ALIGNED(32, float, raXin)[32];
-
-    int output;                 ///< type of output
-
-    DECLARE_ALIGNED(32, float, subband_samples)[DCA_BLOCKS_MAX][DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][8];
-    float *samples_chanptr[DCA_PRIM_CHANNELS_MAX + 1];
-    float *extra_channels[DCA_PRIM_CHANNELS_MAX + 1];
-    uint8_t *extra_channels_buffer;
-    unsigned int extra_channels_buffer_size;
-
-    uint8_t dca_buffer[DCA_MAX_FRAME_SIZE + DCA_MAX_EXSS_HEADER_SIZE + DCA_BUFFER_PADDING_SIZE];
-    int dca_buffer_size;        ///< how much data is in the dca_buffer
-
-    const int8_t *channel_order_tab;  ///< channel reordering table, lfe and non lfe
-    GetBitContext gb;
-    /* Current position in DCA frame */
-    int current_subframe;
-    int current_subsubframe;
-
-    int core_ext_mask;          ///< present extensions in the core substream
-
-    /* XCh extension information */
-    int xch_present;            ///< XCh extension present and valid
-    int xch_base_channel;       ///< index of first (only) channel containing XCH data
-    int xch_disable;            ///< whether the XCh extension should be decoded or not
-
-    /* ExSS header parser */
-    int static_fields;          ///< static fields present
-    int mix_metadata;           ///< mixing metadata present
-    int num_mix_configs;        ///< number of mix out configurations
-    int mix_config_num_ch[4];   ///< number of channels in each mix out configuration
-
-    int profile;
-
-    int debug_flag;             ///< used for suppressing repeated error messages output
-    AVFloatDSPContext fdsp;
-    FFTContext imdct;
-    SynthFilterContext synth;
-    DCADSPContext dcadsp;
-    FmtConvertContext fmt_conv;
-} DCAContext;
-
-static const uint16_t dca_vlc_offs[] = {
-        0,   512,   640,   768,  1282,  1794,  2436,  3080,  3770,  4454,  5364,
-     5372,  5380,  5388,  5392,  5396,  5412,  5420,  5428,  5460,  5492,  5508,
-     5572,  5604,  5668,  5796,  5860,  5892,  6412,  6668,  6796,  7308,  7564,
-     7820,  8076,  8620,  9132,  9388,  9910, 10166, 10680, 11196, 11726, 12240,
-    12752, 13298, 13810, 14326, 14840, 15500, 16022, 16540, 17158, 17678, 18264,
-    18796, 19352, 19926, 20468, 21472, 22398, 23014, 23622,
-};
-
-static av_cold void dca_init_vlcs(void)
-{
-    static int vlcs_initialized = 0;
-    int i, j, c = 14;
-    static VLC_TYPE dca_table[23622][2];
-
-    if (vlcs_initialized)
-        return;
-
-    dca_bitalloc_index.offset = 1;
-    dca_bitalloc_index.wrap = 2;
-    for (i = 0; i < 5; i++) {
-        dca_bitalloc_index.vlc[i].table = &dca_table[dca_vlc_offs[i]];
-        dca_bitalloc_index.vlc[i].table_allocated = dca_vlc_offs[i + 1] - dca_vlc_offs[i];
-        init_vlc(&dca_bitalloc_index.vlc[i], bitalloc_12_vlc_bits[i], 12,
-                 bitalloc_12_bits[i], 1, 1,
-                 bitalloc_12_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
-    }
-    dca_scalefactor.offset = -64;
-    dca_scalefactor.wrap = 2;
-    for (i = 0; i < 5; i++) {
-        dca_scalefactor.vlc[i].table = &dca_table[dca_vlc_offs[i + 5]];
-        dca_scalefactor.vlc[i].table_allocated = dca_vlc_offs[i + 6] - dca_vlc_offs[i + 5];
-        init_vlc(&dca_scalefactor.vlc[i], SCALES_VLC_BITS, 129,
-                 scales_bits[i], 1, 1,
-                 scales_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
-    }
-    dca_tmode.offset = 0;
-    dca_tmode.wrap = 1;
-    for (i = 0; i < 4; i++) {
-        dca_tmode.vlc[i].table = &dca_table[dca_vlc_offs[i + 10]];
-        dca_tmode.vlc[i].table_allocated = dca_vlc_offs[i + 11] - dca_vlc_offs[i + 10];
-        init_vlc(&dca_tmode.vlc[i], tmode_vlc_bits[i], 4,
-                 tmode_bits[i], 1, 1,
-                 tmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
-    }
-
-    for (i = 0; i < 10; i++)
-        for (j = 0; j < 7; j++) {
-            if (!bitalloc_codes[i][j])
-                break;
-            dca_smpl_bitalloc[i + 1].offset                 = bitalloc_offsets[i];
-            dca_smpl_bitalloc[i + 1].wrap                   = 1 + (j > 4);
-            dca_smpl_bitalloc[i + 1].vlc[j].table           = &dca_table[dca_vlc_offs[c]];
-            dca_smpl_bitalloc[i + 1].vlc[j].table_allocated = dca_vlc_offs[c + 1] - dca_vlc_offs[c];
-
-            init_vlc(&dca_smpl_bitalloc[i + 1].vlc[j], bitalloc_maxbits[i][j],
-                     bitalloc_sizes[i],
-                     bitalloc_bits[i][j], 1, 1,
-                     bitalloc_codes[i][j], 2, 2, INIT_VLC_USE_NEW_STATIC);
-            c++;
-        }
-    vlcs_initialized = 1;
-}
-
-static inline void get_array(GetBitContext *gb, int *dst, int len, int bits)
-{
-    while (len--)
-        *dst++ = get_bits(gb, bits);
-}
-
-static int dca_parse_audio_coding_header(DCAContext *s, int base_channel)
-{
-    int i, j;
-    static const float adj_table[4] = { 1.0, 1.1250, 1.2500, 1.4375 };
-    static const int bitlen[11] = { 0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3 };
-    static const int thr[11]    = { 0, 1, 3, 3, 3, 3, 7, 7, 7, 7, 7 };
-
-    s->total_channels = get_bits(&s->gb, 3) + 1 + base_channel;
-    s->prim_channels  = s->total_channels;
-
-    if (s->prim_channels > DCA_PRIM_CHANNELS_MAX)
-        s->prim_channels = DCA_PRIM_CHANNELS_MAX;
-
-
-    for (i = base_channel; i < s->prim_channels; i++) {
-        s->subband_activity[i] = get_bits(&s->gb, 5) + 2;
-        if (s->subband_activity[i] > DCA_SUBBANDS)
-            s->subband_activity[i] = DCA_SUBBANDS;
-    }
-    for (i = base_channel; i < s->prim_channels; i++) {
-        s->vq_start_subband[i] = get_bits(&s->gb, 5) + 1;
-        if (s->vq_start_subband[i] > DCA_SUBBANDS)
-            s->vq_start_subband[i] = DCA_SUBBANDS;
-    }
-    get_array(&s->gb, s->joint_intensity + base_channel,     s->prim_channels - base_channel, 3);
-    get_array(&s->gb, s->transient_huffman + base_channel,   s->prim_channels - base_channel, 2);
-    get_array(&s->gb, s->scalefactor_huffman + base_channel, s->prim_channels - base_channel, 3);
-    get_array(&s->gb, s->bitalloc_huffman + base_channel,    s->prim_channels - base_channel, 3);
-
-    /* Get codebooks quantization indexes */
-    if (!base_channel)
-        memset(s->quant_index_huffman, 0, sizeof(s->quant_index_huffman));
-    for (j = 1; j < 11; j++)
-        for (i = base_channel; i < s->prim_channels; i++)
-            s->quant_index_huffman[i][j] = get_bits(&s->gb, bitlen[j]);
-
-    /* Get scale factor adjustment */
-    for (j = 0; j < 11; j++)
-        for (i = base_channel; i < s->prim_channels; i++)
-            s->scalefactor_adj[i][j] = 1;
-
-    for (j = 1; j < 11; j++)
-        for (i = base_channel; i < s->prim_channels; i++)
-            if (s->quant_index_huffman[i][j] < thr[j])
-                s->scalefactor_adj[i][j] = adj_table[get_bits(&s->gb, 2)];
-
-    if (s->crc_present) {
-        /* Audio header CRC check */
-        get_bits(&s->gb, 16);
-    }
-
-    s->current_subframe    = 0;
-    s->current_subsubframe = 0;
-
-#ifdef TRACE
-    av_log(s->avctx, AV_LOG_DEBUG, "subframes: %i\n", s->subframes);
-    av_log(s->avctx, AV_LOG_DEBUG, "prim channels: %i\n", s->prim_channels);
-    for (i = base_channel; i < s->prim_channels; i++) {
-        av_log(s->avctx, AV_LOG_DEBUG, "subband activity: %i\n",
-               s->subband_activity[i]);
-        av_log(s->avctx, AV_LOG_DEBUG, "vq start subband: %i\n",
-               s->vq_start_subband[i]);
-        av_log(s->avctx, AV_LOG_DEBUG, "joint intensity: %i\n",
-               s->joint_intensity[i]);
-        av_log(s->avctx, AV_LOG_DEBUG, "transient mode codebook: %i\n",
-               s->transient_huffman[i]);
-        av_log(s->avctx, AV_LOG_DEBUG, "scale factor codebook: %i\n",
-               s->scalefactor_huffman[i]);
-        av_log(s->avctx, AV_LOG_DEBUG, "bit allocation quantizer: %i\n",
-               s->bitalloc_huffman[i]);
-        av_log(s->avctx, AV_LOG_DEBUG, "quant index huff:");
-        for (j = 0; j < 11; j++)
-            av_log(s->avctx, AV_LOG_DEBUG, " %i", s->quant_index_huffman[i][j]);
-        av_log(s->avctx, AV_LOG_DEBUG, "\n");
-        av_log(s->avctx, AV_LOG_DEBUG, "scalefac adj:");
-        for (j = 0; j < 11; j++)
-            av_log(s->avctx, AV_LOG_DEBUG, " %1.3f", s->scalefactor_adj[i][j]);
-        av_log(s->avctx, AV_LOG_DEBUG, "\n");
-    }
-#endif
-
-    return 0;
-}
-
-static int dca_parse_frame_header(DCAContext *s)
-{
-    init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8);
-
-    /* Sync code */
-    skip_bits_long(&s->gb, 32);
-
-    /* Frame header */
-    s->frame_type        = get_bits(&s->gb, 1);
-    s->samples_deficit   = get_bits(&s->gb, 5) + 1;
-    s->crc_present       = get_bits(&s->gb, 1);
-    s->sample_blocks     = get_bits(&s->gb, 7) + 1;
-    s->frame_size        = get_bits(&s->gb, 14) + 1;
-    if (s->frame_size < 95)
-        return AVERROR_INVALIDDATA;
-    s->amode             = get_bits(&s->gb, 6);
-    s->sample_rate       = avpriv_dca_sample_rates[get_bits(&s->gb, 4)];
-    if (!s->sample_rate)
-        return AVERROR_INVALIDDATA;
-    s->bit_rate_index    = get_bits(&s->gb, 5);
-    s->bit_rate          = dca_bit_rates[s->bit_rate_index];
-    if (!s->bit_rate)
-        return AVERROR_INVALIDDATA;
-
-    skip_bits1(&s->gb); // always 0 (reserved, cf. ETSI TS 102 114 V1.4.1)
-    s->dynrange          = get_bits(&s->gb, 1);
-    s->timestamp         = get_bits(&s->gb, 1);
-    s->aux_data          = get_bits(&s->gb, 1);
-    s->hdcd              = get_bits(&s->gb, 1);
-    s->ext_descr         = get_bits(&s->gb, 3);
-    s->ext_coding        = get_bits(&s->gb, 1);
-    s->aspf              = get_bits(&s->gb, 1);
-    s->lfe               = get_bits(&s->gb, 2);
-    s->predictor_history = get_bits(&s->gb, 1);
-
-    if (s->lfe > 2) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid LFE value: %d\n", s->lfe);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* TODO: check CRC */
-    if (s->crc_present)
-        s->header_crc    = get_bits(&s->gb, 16);
-
-    s->multirate_inter   = get_bits(&s->gb, 1);
-    s->version           = get_bits(&s->gb, 4);
-    s->copy_history      = get_bits(&s->gb, 2);
-    s->source_pcm_res    = get_bits(&s->gb, 3);
-    s->front_sum         = get_bits(&s->gb, 1);
-    s->surround_sum      = get_bits(&s->gb, 1);
-    s->dialog_norm       = get_bits(&s->gb, 4);
-
-    /* FIXME: channels mixing levels */
-    s->output = s->amode;
-    if (s->lfe)
-        s->output |= DCA_LFE;
-
-#ifdef TRACE
-    av_log(s->avctx, AV_LOG_DEBUG, "frame type: %i\n", s->frame_type);
-    av_log(s->avctx, AV_LOG_DEBUG, "samples deficit: %i\n", s->samples_deficit);
-    av_log(s->avctx, AV_LOG_DEBUG, "crc present: %i\n", s->crc_present);
-    av_log(s->avctx, AV_LOG_DEBUG, "sample blocks: %i (%i samples)\n",
-           s->sample_blocks, s->sample_blocks * 32);
-    av_log(s->avctx, AV_LOG_DEBUG, "frame size: %i bytes\n", s->frame_size);
-    av_log(s->avctx, AV_LOG_DEBUG, "amode: %i (%i channels)\n",
-           s->amode, dca_channels[s->amode]);
-    av_log(s->avctx, AV_LOG_DEBUG, "sample rate: %i Hz\n",
-           s->sample_rate);
-    av_log(s->avctx, AV_LOG_DEBUG, "bit rate: %i bits/s\n",
-           s->bit_rate);
-    av_log(s->avctx, AV_LOG_DEBUG, "dynrange: %i\n", s->dynrange);
-    av_log(s->avctx, AV_LOG_DEBUG, "timestamp: %i\n", s->timestamp);
-    av_log(s->avctx, AV_LOG_DEBUG, "aux_data: %i\n", s->aux_data);
-    av_log(s->avctx, AV_LOG_DEBUG, "hdcd: %i\n", s->hdcd);
-    av_log(s->avctx, AV_LOG_DEBUG, "ext descr: %i\n", s->ext_descr);
-    av_log(s->avctx, AV_LOG_DEBUG, "ext coding: %i\n", s->ext_coding);
-    av_log(s->avctx, AV_LOG_DEBUG, "aspf: %i\n", s->aspf);
-    av_log(s->avctx, AV_LOG_DEBUG, "lfe: %i\n", s->lfe);
-    av_log(s->avctx, AV_LOG_DEBUG, "predictor history: %i\n",
-           s->predictor_history);
-    av_log(s->avctx, AV_LOG_DEBUG, "header crc: %i\n", s->header_crc);
-    av_log(s->avctx, AV_LOG_DEBUG, "multirate inter: %i\n",
-           s->multirate_inter);
-    av_log(s->avctx, AV_LOG_DEBUG, "version number: %i\n", s->version);
-    av_log(s->avctx, AV_LOG_DEBUG, "copy history: %i\n", s->copy_history);
-    av_log(s->avctx, AV_LOG_DEBUG,
-           "source pcm resolution: %i (%i bits/sample)\n",
-           s->source_pcm_res, dca_bits_per_sample[s->source_pcm_res]);
-    av_log(s->avctx, AV_LOG_DEBUG, "front sum: %i\n", s->front_sum);
-    av_log(s->avctx, AV_LOG_DEBUG, "surround sum: %i\n", s->surround_sum);
-    av_log(s->avctx, AV_LOG_DEBUG, "dialog norm: %i\n", s->dialog_norm);
-    av_log(s->avctx, AV_LOG_DEBUG, "\n");
-#endif
-
-    /* Primary audio coding header */
-    s->subframes         = get_bits(&s->gb, 4) + 1;
-
-    return dca_parse_audio_coding_header(s, 0);
-}
-
-
-static inline int get_scale(GetBitContext *gb, int level, int value, int log2range)
-{
-    if (level < 5) {
-        /* huffman encoded */
-        value += get_bitalloc(gb, &dca_scalefactor, level);
-        value = av_clip(value, 0, (1 << log2range) - 1);
-    } else if (level < 8) {
-        if (level + 1 > log2range) {
-            skip_bits(gb, level + 1 - log2range);
-            value = get_bits(gb, log2range);
-        } else {
-            value = get_bits(gb, level + 1);
-        }
-    }
-    return value;
-}
-
-static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
-{
-    /* Primary audio coding side information */
-    int j, k;
-
-    if (get_bits_left(&s->gb) < 0)
-        return AVERROR_INVALIDDATA;
-
-    if (!base_channel) {
-        s->subsubframes[s->current_subframe]    = get_bits(&s->gb, 2) + 1;
-        s->partial_samples[s->current_subframe] = get_bits(&s->gb, 3);
-    }
-
-    for (j = base_channel; j < s->prim_channels; j++) {
-        for (k = 0; k < s->subband_activity[j]; k++)
-            s->prediction_mode[j][k] = get_bits(&s->gb, 1);
-    }
-
-    /* Get prediction codebook */
-    for (j = base_channel; j < s->prim_channels; j++) {
-        for (k = 0; k < s->subband_activity[j]; k++) {
-            if (s->prediction_mode[j][k] > 0) {
-                /* (Prediction coefficient VQ address) */
-                s->prediction_vq[j][k] = get_bits(&s->gb, 12);
-            }
-        }
-    }
-
-    /* Bit allocation index */
-    for (j = base_channel; j < s->prim_channels; j++) {
-        for (k = 0; k < s->vq_start_subband[j]; k++) {
-            if (s->bitalloc_huffman[j] == 6)
-                s->bitalloc[j][k] = get_bits(&s->gb, 5);
-            else if (s->bitalloc_huffman[j] == 5)
-                s->bitalloc[j][k] = get_bits(&s->gb, 4);
-            else if (s->bitalloc_huffman[j] == 7) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "Invalid bit allocation index\n");
-                return AVERROR_INVALIDDATA;
-            } else {
-                s->bitalloc[j][k] =
-                    get_bitalloc(&s->gb, &dca_bitalloc_index, s->bitalloc_huffman[j]);
-            }
-
-            if (s->bitalloc[j][k] > 26) {
-                av_dlog(s->avctx, "bitalloc index [%i][%i] too big (%i)\n",
-                        j, k, s->bitalloc[j][k]);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-
-    /* Transition mode */
-    for (j = base_channel; j < s->prim_channels; j++) {
-        for (k = 0; k < s->subband_activity[j]; k++) {
-            s->transition_mode[j][k] = 0;
-            if (s->subsubframes[s->current_subframe] > 1 &&
-                k < s->vq_start_subband[j] && s->bitalloc[j][k] > 0) {
-                s->transition_mode[j][k] =
-                    get_bitalloc(&s->gb, &dca_tmode, s->transient_huffman[j]);
-            }
-        }
-    }
-
-    if (get_bits_left(&s->gb) < 0)
-        return AVERROR_INVALIDDATA;
-
-    for (j = base_channel; j < s->prim_channels; j++) {
-        const uint32_t *scale_table;
-        int scale_sum, log_size;
-
-        memset(s->scale_factor[j], 0,
-               s->subband_activity[j] * sizeof(s->scale_factor[0][0][0]) * 2);
-
-        if (s->scalefactor_huffman[j] == 6) {
-            scale_table = scale_factor_quant7;
-            log_size = 7;
-        } else {
-            scale_table = scale_factor_quant6;
-            log_size = 6;
-        }
-
-        /* When huffman coded, only the difference is encoded */
-        scale_sum = 0;
-
-        for (k = 0; k < s->subband_activity[j]; k++) {
-            if (k >= s->vq_start_subband[j] || s->bitalloc[j][k] > 0) {
-                scale_sum = get_scale(&s->gb, s->scalefactor_huffman[j], scale_sum, log_size);
-                s->scale_factor[j][k][0] = scale_table[scale_sum];
-            }
-
-            if (k < s->vq_start_subband[j] && s->transition_mode[j][k]) {
-                /* Get second scale factor */
-                scale_sum = get_scale(&s->gb, s->scalefactor_huffman[j], scale_sum, log_size);
-                s->scale_factor[j][k][1] = scale_table[scale_sum];
-            }
-        }
-    }
-
-    /* Joint subband scale factor codebook select */
-    for (j = base_channel; j < s->prim_channels; j++) {
-        /* Transmitted only if joint subband coding enabled */
-        if (s->joint_intensity[j] > 0)
-            s->joint_huff[j] = get_bits(&s->gb, 3);
-    }
-
-    if (get_bits_left(&s->gb) < 0)
-        return AVERROR_INVALIDDATA;
-
-    /* Scale factors for joint subband coding */
-    for (j = base_channel; j < s->prim_channels; j++) {
-        int source_channel;
-
-        /* Transmitted only if joint subband coding enabled */
-        if (s->joint_intensity[j] > 0) {
-            int scale = 0;
-            source_channel = s->joint_intensity[j] - 1;
-
-            /* When huffman coded, only the difference is encoded
-             * (is this valid as well for joint scales ???) */
-
-            for (k = s->subband_activity[j]; k < s->subband_activity[source_channel]; k++) {
-                scale = get_scale(&s->gb, s->joint_huff[j], 64 /* bias */, 7);
-                s->joint_scale_factor[j][k] = scale;    /*joint_scale_table[scale]; */
-            }
-
-            if (!(s->debug_flag & 0x02)) {
-                av_log(s->avctx, AV_LOG_DEBUG,
-                       "Joint stereo coding not supported\n");
-                s->debug_flag |= 0x02;
-            }
-        }
-    }
-
-    /* Dynamic range coefficient */
-    if (!base_channel && s->dynrange)
-        s->dynrange_coef = get_bits(&s->gb, 8);
-
-    /* Side information CRC check word */
-    if (s->crc_present) {
-        get_bits(&s->gb, 16);
-    }
-
-    /*
-     * Primary audio data arrays
-     */
-
-    /* VQ encoded high frequency subbands */
-    for (j = base_channel; j < s->prim_channels; j++)
-        for (k = s->vq_start_subband[j]; k < s->subband_activity[j]; k++)
-            /* 1 vector -> 32 samples */
-            s->high_freq_vq[j][k] = get_bits(&s->gb, 10);
-
-    /* Low frequency effect data */
-    if (!base_channel && s->lfe) {
-        /* LFE samples */
-        int lfe_samples = 2 * s->lfe * (4 + block_index);
-        int lfe_end_sample = 2 * s->lfe * (4 + block_index + s->subsubframes[s->current_subframe]);
-        float lfe_scale;
-
-        for (j = lfe_samples; j < lfe_end_sample; j++) {
-            /* Signed 8 bits int */
-            s->lfe_data[j] = get_sbits(&s->gb, 8);
-        }
-
-        /* Scale factor index */
-        skip_bits(&s->gb, 1);
-        s->lfe_scale_factor = scale_factor_quant7[get_bits(&s->gb, 7)];
-
-        /* Quantization step size * scale factor */
-        lfe_scale = 0.035 * s->lfe_scale_factor;
-
-        for (j = lfe_samples; j < lfe_end_sample; j++)
-            s->lfe_data[j] *= lfe_scale;
-    }
-
-#ifdef TRACE
-    av_log(s->avctx, AV_LOG_DEBUG, "subsubframes: %i\n",
-           s->subsubframes[s->current_subframe]);
-    av_log(s->avctx, AV_LOG_DEBUG, "partial samples: %i\n",
-           s->partial_samples[s->current_subframe]);
-
-    for (j = base_channel; j < s->prim_channels; j++) {
-        av_log(s->avctx, AV_LOG_DEBUG, "prediction mode:");
-        for (k = 0; k < s->subband_activity[j]; k++)
-            av_log(s->avctx, AV_LOG_DEBUG, " %i", s->prediction_mode[j][k]);
-        av_log(s->avctx, AV_LOG_DEBUG, "\n");
-    }
-    for (j = base_channel; j < s->prim_channels; j++) {
-        for (k = 0; k < s->subband_activity[j]; k++)
-            av_log(s->avctx, AV_LOG_DEBUG,
-                   "prediction coefs: %f, %f, %f, %f\n",
-                   (float) adpcm_vb[s->prediction_vq[j][k]][0] / 8192,
-                   (float) adpcm_vb[s->prediction_vq[j][k]][1] / 8192,
-                   (float) adpcm_vb[s->prediction_vq[j][k]][2] / 8192,
-                   (float) adpcm_vb[s->prediction_vq[j][k]][3] / 8192);
-    }
-    for (j = base_channel; j < s->prim_channels; j++) {
-        av_log(s->avctx, AV_LOG_DEBUG, "bitalloc index: ");
-        for (k = 0; k < s->vq_start_subband[j]; k++)
-            av_log(s->avctx, AV_LOG_DEBUG, "%2.2i ", s->bitalloc[j][k]);
-        av_log(s->avctx, AV_LOG_DEBUG, "\n");
-    }
-    for (j = base_channel; j < s->prim_channels; j++) {
-        av_log(s->avctx, AV_LOG_DEBUG, "Transition mode:");
-        for (k = 0; k < s->subband_activity[j]; k++)
-            av_log(s->avctx, AV_LOG_DEBUG, " %i", s->transition_mode[j][k]);
-        av_log(s->avctx, AV_LOG_DEBUG, "\n");
-    }
-    for (j = base_channel; j < s->prim_channels; j++) {
-        av_log(s->avctx, AV_LOG_DEBUG, "Scale factor:");
-        for (k = 0; k < s->subband_activity[j]; k++) {
-            if (k >= s->vq_start_subband[j] || s->bitalloc[j][k] > 0)
-                av_log(s->avctx, AV_LOG_DEBUG, " %i", s->scale_factor[j][k][0]);
-            if (k < s->vq_start_subband[j] && s->transition_mode[j][k])
-                av_log(s->avctx, AV_LOG_DEBUG, " %i(t)", s->scale_factor[j][k][1]);
-        }
-        av_log(s->avctx, AV_LOG_DEBUG, "\n");
-    }
-    for (j = base_channel; j < s->prim_channels; j++) {
-        if (s->joint_intensity[j] > 0) {
-            int source_channel = s->joint_intensity[j] - 1;
-            av_log(s->avctx, AV_LOG_DEBUG, "Joint scale factor index:\n");
-            for (k = s->subband_activity[j]; k < s->subband_activity[source_channel]; k++)
-                av_log(s->avctx, AV_LOG_DEBUG, " %i", s->joint_scale_factor[j][k]);
-            av_log(s->avctx, AV_LOG_DEBUG, "\n");
-        }
-    }
-    for (j = base_channel; j < s->prim_channels; j++)
-        for (k = s->vq_start_subband[j]; k < s->subband_activity[j]; k++)
-            av_log(s->avctx, AV_LOG_DEBUG, "VQ index: %i\n", s->high_freq_vq[j][k]);
-    if (!base_channel && s->lfe) {
-        int lfe_samples = 2 * s->lfe * (4 + block_index);
-        int lfe_end_sample = 2 * s->lfe * (4 + block_index + s->subsubframes[s->current_subframe]);
-
-        av_log(s->avctx, AV_LOG_DEBUG, "LFE samples:\n");
-        for (j = lfe_samples; j < lfe_end_sample; j++)
-            av_log(s->avctx, AV_LOG_DEBUG, " %f", s->lfe_data[j]);
-        av_log(s->avctx, AV_LOG_DEBUG, "\n");
-    }
-#endif
-
-    return 0;
-}
-
-static void qmf_32_subbands(DCAContext *s, int chans,
-                            float samples_in[32][8], float *samples_out,
-                            float scale)
-{
-    const float *prCoeff;
-
-    int sb_act = s->subband_activity[chans];
-
-    scale *= sqrt(1 / 8.0);
-
-    /* Select filter */
-    if (!s->multirate_inter)    /* Non-perfect reconstruction */
-        prCoeff = fir_32bands_nonperfect;
-    else                        /* Perfect reconstruction */
-        prCoeff = fir_32bands_perfect;
-
-    s->dcadsp.qmf_32_subbands(samples_in, sb_act, &s->synth, &s->imdct,
-                              s->subband_fir_hist[chans],
-                              &s->hist_index[chans],
-                              s->subband_fir_noidea[chans], prCoeff,
-                              samples_out, s->raXin, scale);
-}
-
-static void lfe_interpolation_fir(DCAContext *s, int decimation_select,
-                                  int num_deci_sample, float *samples_in,
-                                  float *samples_out, float scale)
-{
-    /* samples_in: An array holding decimated samples.
-     *   Samples in current subframe starts from samples_in[0],
-     *   while samples_in[-1], samples_in[-2], ..., stores samples
-     *   from last subframe as history.
-     *
-     * samples_out: An array holding interpolated samples
-     */
-
-    int idx;
-    const float *prCoeff;
-    int deciindex;
-
-    /* Select decimation filter */
-    if (decimation_select == 1) {
-        idx = 1;
-        prCoeff = lfe_fir_128;
-    } else {
-        idx = 0;
-        prCoeff = lfe_fir_64;
-    }
-    /* Interpolation */
-    for (deciindex = 0; deciindex < num_deci_sample; deciindex++) {
-        s->dcadsp.lfe_fir[idx](samples_out, samples_in, prCoeff, scale);
-        samples_in++;
-        samples_out += 2 * 32 * (1 + idx);
-    }
-}
-
-/* downmixing routines */
-#define MIX_REAR1(samples, s1, rs, coef)            \
-    samples[0][i] += samples[s1][i] * coef[rs][0];  \
-    samples[1][i] += samples[s1][i] * coef[rs][1];
-
-#define MIX_REAR2(samples, s1, s2, rs, coef)                                          \
-    samples[0][i] += samples[s1][i] * coef[rs][0] + samples[s2][i] * coef[rs + 1][0]; \
-    samples[1][i] += samples[s1][i] * coef[rs][1] + samples[s2][i] * coef[rs + 1][1];
-
-#define MIX_FRONT3(samples, coef)                                      \
-    t = samples[c][i];                                                 \
-    u = samples[l][i];                                                 \
-    v = samples[r][i];                                                 \
-    samples[0][i] = t * coef[0][0] + u * coef[1][0] + v * coef[2][0];  \
-    samples[1][i] = t * coef[0][1] + u * coef[1][1] + v * coef[2][1];
-
-#define DOWNMIX_TO_STEREO(op1, op2)             \
-    for (i = 0; i < 256; i++) {                 \
-        op1                                     \
-        op2                                     \
-    }
-
-static void dca_downmix(float **samples, int srcfmt, int lfe_present,
-                        float coef[DCA_PRIM_CHANNELS_MAX + 1][2],
-                        const int8_t *channel_mapping)
-{
-    int c, l, r, sl, sr, s;
-    int i;
-    float t, u, v;
-
-    switch (srcfmt) {
-    case DCA_MONO:
-    case DCA_4F2R:
-        av_log(NULL, 0, "Not implemented!\n");
-        break;
-    case DCA_CHANNEL:
-    case DCA_STEREO:
-    case DCA_STEREO_TOTAL:
-    case DCA_STEREO_SUMDIFF:
-        break;
-    case DCA_3F:
-        c = channel_mapping[0];
-        l = channel_mapping[1];
-        r = channel_mapping[2];
-        DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef), );
-        break;
-    case DCA_2F1R:
-        s = channel_mapping[2];
-        DOWNMIX_TO_STEREO(MIX_REAR1(samples, s, 2, coef), );
-        break;
-    case DCA_3F1R:
-        c = channel_mapping[0];
-        l = channel_mapping[1];
-        r = channel_mapping[2];
-        s = channel_mapping[3];
-        DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef),
-                          MIX_REAR1(samples, s, 3, coef));
-        break;
-    case DCA_2F2R:
-        sl = channel_mapping[2];
-        sr = channel_mapping[3];
-        DOWNMIX_TO_STEREO(MIX_REAR2(samples, sl, sr, 2, coef), );
-        break;
-    case DCA_3F2R:
-        c  = channel_mapping[0];
-        l  = channel_mapping[1];
-        r  = channel_mapping[2];
-        sl = channel_mapping[3];
-        sr = channel_mapping[4];
-        DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef),
-                          MIX_REAR2(samples, sl, sr, 3, coef));
-        break;
-    }
-    if (lfe_present) {
-        int lf_buf = dca_lfe_index[srcfmt];
-        int lf_idx = dca_channels [srcfmt];
-        for (i = 0; i < 256; i++) {
-            samples[0][i] += samples[lf_buf][i] * coef[lf_idx][0];
-            samples[1][i] += samples[lf_buf][i] * coef[lf_idx][1];
-        }
-    }
-}
-
-
-#ifndef decode_blockcodes
-/* Very compact version of the block code decoder that does not use table
- * look-up but is slightly slower */
-static int decode_blockcode(int code, int levels, int32_t *values)
-{
-    int i;
-    int offset = (levels - 1) >> 1;
-
-    for (i = 0; i < 4; i++) {
-        int div = FASTDIV(code, levels);
-        values[i] = code - offset - div * levels;
-        code = div;
-    }
-
-    return code;
-}
-
-static int decode_blockcodes(int code1, int code2, int levels, int32_t *values)
-{
-    return decode_blockcode(code1, levels, values) |
-           decode_blockcode(code2, levels, values + 4);
-}
-#endif
-
-static const uint8_t abits_sizes[7]  = { 7, 10, 12, 13, 15, 17, 19 };
-static const uint8_t abits_levels[7] = { 3,  5,  7,  9, 13, 17, 25 };
-
-#ifndef int8x8_fmul_int32
-static inline void int8x8_fmul_int32(DCADSPContext *dsp, float *dst,
-                                     const int8_t *src, int scale)
-{
-    dsp->int8x8_fmul_int32(dst, src, scale);
-}
-#endif
-
-static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
-{
-    int k, l;
-    int subsubframe = s->current_subsubframe;
-
-    const float *quant_step_table;
-
-    /* FIXME */
-    float (*subband_samples)[DCA_SUBBANDS][8] = s->subband_samples[block_index];
-    LOCAL_ALIGNED_16(int32_t, block, [8 * DCA_SUBBANDS]);
-
-    /*
-     * Audio data
-     */
-
-    /* Select quantization step size table */
-    if (s->bit_rate_index == 0x1f)
-        quant_step_table = lossless_quant_d;
-    else
-        quant_step_table = lossy_quant_d;
-
-    for (k = base_channel; k < s->prim_channels; k++) {
-        float rscale[DCA_SUBBANDS];
-
-        if (get_bits_left(&s->gb) < 0)
-            return AVERROR_INVALIDDATA;
-
-        for (l = 0; l < s->vq_start_subband[k]; l++) {
-            int m;
-
-            /* Select the mid-tread linear quantizer */
-            int abits = s->bitalloc[k][l];
-
-            float quant_step_size = quant_step_table[abits];
-
-            /*
-             * Determine quantization index code book and its type
-             */
-
-            /* Select quantization index code book */
-            int sel = s->quant_index_huffman[k][abits];
-
-            /*
-             * Extract bits from the bit stream
-             */
-            if (!abits) {
-                rscale[l] = 0;
-                memset(block + 8 * l, 0, 8 * sizeof(block[0]));
-            } else {
-                /* Deal with transients */
-                int sfi = s->transition_mode[k][l] && subsubframe >= s->transition_mode[k][l];
-                rscale[l] = quant_step_size * s->scale_factor[k][l][sfi] *
-                               s->scalefactor_adj[k][sel];
-
-                if (abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table) {
-                    if (abits <= 7) {
-                        /* Block code */
-                        int block_code1, block_code2, size, levels, err;
-
-                        size   = abits_sizes[abits - 1];
-                        levels = abits_levels[abits - 1];
-
-                        block_code1 = get_bits(&s->gb, size);
-                        block_code2 = get_bits(&s->gb, size);
-                        err = decode_blockcodes(block_code1, block_code2,
-                                                levels, block + 8 * l);
-                        if (err) {
-                            av_log(s->avctx, AV_LOG_ERROR,
-                                   "ERROR: block code look-up failed\n");
-                            return AVERROR_INVALIDDATA;
-                        }
-                    } else {
-                        /* no coding */
-                        for (m = 0; m < 8; m++)
-                            block[8 * l + m] = get_sbits(&s->gb, abits - 3);
-                    }
-                } else {
-                    /* Huffman coded */
-                    for (m = 0; m < 8; m++)
-                        block[8 * l + m] = get_bitalloc(&s->gb,
-                                                &dca_smpl_bitalloc[abits], sel);
-                }
-
-            }
-        }
-
-        s->fmt_conv.int32_to_float_fmul_array8(&s->fmt_conv, subband_samples[k][0],
-                                               block, rscale, 8 * s->vq_start_subband[k]);
-
-        for (l = 0; l < s->vq_start_subband[k]; l++) {
-            int m;
-            /*
-             * Inverse ADPCM if in prediction mode
-             */
-            if (s->prediction_mode[k][l]) {
-                int n;
-                for (m = 0; m < 8; m++) {
-                    for (n = 1; n <= 4; n++)
-                        if (m >= n)
-                            subband_samples[k][l][m] +=
-                                (adpcm_vb[s->prediction_vq[k][l]][n - 1] *
-                                 subband_samples[k][l][m - n] / 8192);
-                        else if (s->predictor_history)
-                            subband_samples[k][l][m] +=
-                                (adpcm_vb[s->prediction_vq[k][l]][n - 1] *
-                                 s->subband_samples_hist[k][l][m - n + 4] / 8192);
-                }
-            }
-        }
-
-        /*
-         * Decode VQ encoded high frequencies
-         */
-        for (l = s->vq_start_subband[k]; l < s->subband_activity[k]; l++) {
-            /* 1 vector -> 32 samples but we only need the 8 samples
-             * for this subsubframe. */
-            int hfvq = s->high_freq_vq[k][l];
-
-            if (!s->debug_flag & 0x01) {
-                av_log(s->avctx, AV_LOG_DEBUG,
-                       "Stream with high frequencies VQ coding\n");
-                s->debug_flag |= 0x01;
-            }
-
-            int8x8_fmul_int32(&s->dcadsp, subband_samples[k][l],
-                              &high_freq_vq[hfvq][subsubframe * 8],
-                              s->scale_factor[k][l][0]);
-        }
-    }
-
-    /* Check for DSYNC after subsubframe */
-    if (s->aspf || subsubframe == s->subsubframes[s->current_subframe] - 1) {
-        if (0xFFFF == get_bits(&s->gb, 16)) {   /* 0xFFFF */
-#ifdef TRACE
-            av_log(s->avctx, AV_LOG_DEBUG, "Got subframe DSYNC\n");
-#endif
-        } else {
-            av_log(s->avctx, AV_LOG_ERROR, "Didn't get subframe DSYNC\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    /* Backup predictor history for adpcm */
-    for (k = base_channel; k < s->prim_channels; k++)
-        for (l = 0; l < s->vq_start_subband[k]; l++)
-            AV_COPY128(s->subband_samples_hist[k][l], &subband_samples[k][l][4]);
-
-    return 0;
-}
-
-static int dca_filter_channels(DCAContext *s, int block_index)
-{
-    float (*subband_samples)[DCA_SUBBANDS][8] = s->subband_samples[block_index];
-    int k;
-
-    /* 32 subbands QMF */
-    for (k = 0; k < s->prim_channels; k++) {
-/*        static float pcm_to_double[8] = { 32768.0, 32768.0, 524288.0, 524288.0,
-                                            0, 8388608.0, 8388608.0 };*/
-        if (s->channel_order_tab[k] >= 0)
-            qmf_32_subbands(s, k, subband_samples[k],
-                            s->samples_chanptr[s->channel_order_tab[k]],
-                            M_SQRT1_2 / 32768.0 /* pcm_to_double[s->source_pcm_res] */);
-    }
-
-    /* Generate LFE samples for this subsubframe FIXME!!! */
-    if (s->lfe) {
-        lfe_interpolation_fir(s, s->lfe, 2 * s->lfe,
-                              s->lfe_data + 2 * s->lfe * (block_index + 4),
-                              s->samples_chanptr[dca_lfe_index[s->amode]],
-                              1.0 / (256.0 * 32768.0));
-        /* Outputs 20bits pcm samples */
-    }
-
-    /* Downmixing to Stereo */
-    if (s->prim_channels + !!s->lfe > 2 &&
-        s->avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
-        dca_downmix(s->samples_chanptr, s->amode, !!s->lfe, s->downmix_coef,
-                    s->channel_order_tab);
-    }
-
-    return 0;
-}
-
-
-static int dca_subframe_footer(DCAContext *s, int base_channel)
-{
-    int in, out, aux_data_count, aux_data_end, reserved;
-    uint32_t nsyncaux;
-
-    /*
-     * Unpack optional information
-     */
-
-    /* presumably optional information only appears in the core? */
-    if (!base_channel) {
-        if (s->timestamp)
-            skip_bits_long(&s->gb, 32);
-
-        if (s->aux_data) {
-            aux_data_count = get_bits(&s->gb, 6);
-
-            // align (32-bit)
-            skip_bits_long(&s->gb, (-get_bits_count(&s->gb)) & 31);
-
-            aux_data_end = 8 * aux_data_count + get_bits_count(&s->gb);
-
-            if ((nsyncaux = get_bits_long(&s->gb, 32)) != DCA_NSYNCAUX) {
-                av_log(s->avctx, AV_LOG_ERROR, "nSYNCAUX mismatch %#"PRIx32"\n",
-                       nsyncaux);
-                return AVERROR_INVALIDDATA;
-            }
-
-            if (get_bits1(&s->gb)) { // bAUXTimeStampFlag
-                avpriv_request_sample(s->avctx,
-                                      "Auxiliary Decode Time Stamp Flag");
-                // align (4-bit)
-                skip_bits(&s->gb, (-get_bits_count(&s->gb)) & 4);
-                // 44 bits: nMSByte (8), nMarker (4), nLSByte (28), nMarker (4)
-                skip_bits_long(&s->gb, 44);
-            }
-
-            if ((s->core_downmix = get_bits1(&s->gb))) {
-                int am = get_bits(&s->gb, 3);
-                switch (am) {
-                case 0:
-                    s->core_downmix_amode = DCA_MONO;
-                    break;
-                case 1:
-                    s->core_downmix_amode = DCA_STEREO;
-                    break;
-                case 2:
-                    s->core_downmix_amode = DCA_STEREO_TOTAL;
-                    break;
-                case 3:
-                    s->core_downmix_amode = DCA_3F;
-                    break;
-                case 4:
-                    s->core_downmix_amode = DCA_2F1R;
-                    break;
-                case 5:
-                    s->core_downmix_amode = DCA_2F2R;
-                    break;
-                case 6:
-                    s->core_downmix_amode = DCA_3F1R;
-                    break;
-                default:
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "Invalid mode %d for embedded downmix coefficients\n",
-                           am);
-                    return AVERROR_INVALIDDATA;
-                }
-                for (out = 0; out < dca_channels[s->core_downmix_amode]; out++) {
-                    for (in = 0; in < s->prim_channels + !!s->lfe; in++) {
-                        uint16_t tmp = get_bits(&s->gb, 9);
-                        if ((tmp & 0xFF) > 241) {
-                            av_log(s->avctx, AV_LOG_ERROR,
-                                   "Invalid downmix coefficient code %"PRIu16"\n",
-                                   tmp);
-                            return AVERROR_INVALIDDATA;
-                        }
-                        s->core_downmix_codes[in][out] = tmp;
-                    }
-                }
-            }
-
-            align_get_bits(&s->gb); // byte align
-            skip_bits(&s->gb, 16);  // nAUXCRC16
-
-            // additional data (reserved, cf. ETSI TS 102 114 V1.4.1)
-            if ((reserved = (aux_data_end - get_bits_count(&s->gb))) < 0) {
-                 av_log(s->avctx, AV_LOG_ERROR,
-                        "Overread auxiliary data by %d bits\n", -reserved);
-                return AVERROR_INVALIDDATA;
-            } else if (reserved) {
-                avpriv_request_sample(s->avctx,
-                                      "Core auxiliary data reserved content");
-                skip_bits_long(&s->gb, reserved);
-            }
-        }
-
-        if (s->crc_present && s->dynrange)
-            get_bits(&s->gb, 16);
-    }
-
-    return 0;
-}
-
-/**
- * Decode a dca frame block
- *
- * @param s     pointer to the DCAContext
- */
-
-static int dca_decode_block(DCAContext *s, int base_channel, int block_index)
-{
-    int ret;
-
-    /* Sanity check */
-    if (s->current_subframe >= s->subframes) {
-        av_log(s->avctx, AV_LOG_DEBUG, "check failed: %i>%i",
-               s->current_subframe, s->subframes);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!s->current_subsubframe) {
-#ifdef TRACE
-        av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_header\n");
-#endif
-        /* Read subframe header */
-        if ((ret = dca_subframe_header(s, base_channel, block_index)))
-            return ret;
-    }
-
-    /* Read subsubframe */
-#ifdef TRACE
-    av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subsubframe\n");
-#endif
-    if ((ret = dca_subsubframe(s, base_channel, block_index)))
-        return ret;
-
-    /* Update state */
-    s->current_subsubframe++;
-    if (s->current_subsubframe >= s->subsubframes[s->current_subframe]) {
-        s->current_subsubframe = 0;
-        s->current_subframe++;
-    }
-    if (s->current_subframe >= s->subframes) {
-#ifdef TRACE
-        av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_footer\n");
-#endif
-        /* Read subframe footer */
-        if ((ret = dca_subframe_footer(s, base_channel)))
-            return ret;
-    }
-
-    return 0;
-}
-
-/**
- * Return the number of channels in an ExSS speaker mask (HD)
- */
-static int dca_exss_mask2count(int mask)
-{
-    /* count bits that mean speaker pairs twice */
-    return av_popcount(mask) +
-           av_popcount(mask & (DCA_EXSS_CENTER_LEFT_RIGHT      |
-                               DCA_EXSS_FRONT_LEFT_RIGHT       |
-                               DCA_EXSS_FRONT_HIGH_LEFT_RIGHT  |
-                               DCA_EXSS_WIDE_LEFT_RIGHT        |
-                               DCA_EXSS_SIDE_LEFT_RIGHT        |
-                               DCA_EXSS_SIDE_HIGH_LEFT_RIGHT   |
-                               DCA_EXSS_SIDE_REAR_LEFT_RIGHT   |
-                               DCA_EXSS_REAR_LEFT_RIGHT        |
-                               DCA_EXSS_REAR_HIGH_LEFT_RIGHT));
-}
-
-/**
- * Skip mixing coefficients of a single mix out configuration (HD)
- */
-static void dca_exss_skip_mix_coeffs(GetBitContext *gb, int channels, int out_ch)
-{
-    int i;
-
-    for (i = 0; i < channels; i++) {
-        int mix_map_mask = get_bits(gb, out_ch);
-        int num_coeffs = av_popcount(mix_map_mask);
-        skip_bits_long(gb, num_coeffs * 6);
-    }
-}
-
-/**
- * Parse extension substream asset header (HD)
- */
-static int dca_exss_parse_asset_header(DCAContext *s)
-{
-    int header_pos = get_bits_count(&s->gb);
-    int header_size;
-    int channels;
-    int embedded_stereo = 0;
-    int embedded_6ch    = 0;
-    int drc_code_present;
-    int extensions_mask;
-    int i, j;
-
-    if (get_bits_left(&s->gb) < 16)
-        return -1;
-
-    /* We will parse just enough to get to the extensions bitmask with which
-     * we can set the profile value. */
-
-    header_size = get_bits(&s->gb, 9) + 1;
-    skip_bits(&s->gb, 3); // asset index
-
-    if (s->static_fields) {
-        if (get_bits1(&s->gb))
-            skip_bits(&s->gb, 4); // asset type descriptor
-        if (get_bits1(&s->gb))
-            skip_bits_long(&s->gb, 24); // language descriptor
-
-        if (get_bits1(&s->gb)) {
-            /* How can one fit 1024 bytes of text here if the maximum value
-             * for the asset header size field above was 512 bytes? */
-            int text_length = get_bits(&s->gb, 10) + 1;
-            if (get_bits_left(&s->gb) < text_length * 8)
-                return -1;
-            skip_bits_long(&s->gb, text_length * 8); // info text
-        }
-
-        skip_bits(&s->gb, 5); // bit resolution - 1
-        skip_bits(&s->gb, 4); // max sample rate code
-        channels = get_bits(&s->gb, 8) + 1;
-
-        if (get_bits1(&s->gb)) { // 1-to-1 channels to speakers
-            int spkr_remap_sets;
-            int spkr_mask_size = 16;
-            int num_spkrs[7];
-
-            if (channels > 2)
-                embedded_stereo = get_bits1(&s->gb);
-            if (channels > 6)
-                embedded_6ch = get_bits1(&s->gb);
-
-            if (get_bits1(&s->gb)) {
-                spkr_mask_size = (get_bits(&s->gb, 2) + 1) << 2;
-                skip_bits(&s->gb, spkr_mask_size); // spkr activity mask
-            }
-
-            spkr_remap_sets = get_bits(&s->gb, 3);
-
-            for (i = 0; i < spkr_remap_sets; i++) {
-                /* std layout mask for each remap set */
-                num_spkrs[i] = dca_exss_mask2count(get_bits(&s->gb, spkr_mask_size));
-            }
-
-            for (i = 0; i < spkr_remap_sets; i++) {
-                int num_dec_ch_remaps = get_bits(&s->gb, 5) + 1;
-                if (get_bits_left(&s->gb) < 0)
-                    return -1;
-
-                for (j = 0; j < num_spkrs[i]; j++) {
-                    int remap_dec_ch_mask = get_bits_long(&s->gb, num_dec_ch_remaps);
-                    int num_dec_ch = av_popcount(remap_dec_ch_mask);
-                    skip_bits_long(&s->gb, num_dec_ch * 5); // remap codes
-                }
-            }
-
-        } else {
-            skip_bits(&s->gb, 3); // representation type
-        }
-    }
-
-    drc_code_present = get_bits1(&s->gb);
-    if (drc_code_present)
-        get_bits(&s->gb, 8); // drc code
-
-    if (get_bits1(&s->gb))
-        skip_bits(&s->gb, 5); // dialog normalization code
-
-    if (drc_code_present && embedded_stereo)
-        get_bits(&s->gb, 8); // drc stereo code
-
-    if (s->mix_metadata && get_bits1(&s->gb)) {
-        skip_bits(&s->gb, 1); // external mix
-        skip_bits(&s->gb, 6); // post mix gain code
-
-        if (get_bits(&s->gb, 2) != 3) // mixer drc code
-            skip_bits(&s->gb, 3); // drc limit
-        else
-            skip_bits(&s->gb, 8); // custom drc code
-
-        if (get_bits1(&s->gb)) // channel specific scaling
-            for (i = 0; i < s->num_mix_configs; i++)
-                skip_bits_long(&s->gb, s->mix_config_num_ch[i] * 6); // scale codes
-        else
-            skip_bits_long(&s->gb, s->num_mix_configs * 6); // scale codes
-
-        for (i = 0; i < s->num_mix_configs; i++) {
-            if (get_bits_left(&s->gb) < 0)
-                return -1;
-            dca_exss_skip_mix_coeffs(&s->gb, channels, s->mix_config_num_ch[i]);
-            if (embedded_6ch)
-                dca_exss_skip_mix_coeffs(&s->gb, 6, s->mix_config_num_ch[i]);
-            if (embedded_stereo)
-                dca_exss_skip_mix_coeffs(&s->gb, 2, s->mix_config_num_ch[i]);
-        }
-    }
-
-    switch (get_bits(&s->gb, 2)) {
-    case 0: extensions_mask = get_bits(&s->gb, 12); break;
-    case 1: extensions_mask = DCA_EXT_EXSS_XLL;     break;
-    case 2: extensions_mask = DCA_EXT_EXSS_LBR;     break;
-    case 3: extensions_mask = 0; /* aux coding */   break;
-    }
-
-    /* not parsed further, we were only interested in the extensions mask */
-
-    if (get_bits_left(&s->gb) < 0)
-        return -1;
-
-    if (get_bits_count(&s->gb) - header_pos > header_size * 8) {
-        av_log(s->avctx, AV_LOG_WARNING, "Asset header size mismatch.\n");
-        return -1;
-    }
-    skip_bits_long(&s->gb, header_pos + header_size * 8 - get_bits_count(&s->gb));
-
-    if (extensions_mask & DCA_EXT_EXSS_XLL)
-        s->profile = FF_PROFILE_DTS_HD_MA;
-    else if (extensions_mask & (DCA_EXT_EXSS_XBR | DCA_EXT_EXSS_X96 |
-                                DCA_EXT_EXSS_XXCH))
-        s->profile = FF_PROFILE_DTS_HD_HRA;
-
-    if (!(extensions_mask & DCA_EXT_CORE))
-        av_log(s->avctx, AV_LOG_WARNING, "DTS core detection mismatch.\n");
-    if ((extensions_mask & DCA_CORE_EXTS) != s->core_ext_mask)
-        av_log(s->avctx, AV_LOG_WARNING,
-               "DTS extensions detection mismatch (%d, %d)\n",
-               extensions_mask & DCA_CORE_EXTS, s->core_ext_mask);
-
-    return 0;
-}
-
-/**
- * Parse extension substream header (HD)
- */
-static void dca_exss_parse_header(DCAContext *s)
-{
-    int ss_index;
-    int blownup;
-    int num_audiop = 1;
-    int num_assets = 1;
-    int active_ss_mask[8];
-    int i, j;
-
-    if (get_bits_left(&s->gb) < 52)
-        return;
-
-    skip_bits(&s->gb, 8); // user data
-    ss_index = get_bits(&s->gb, 2);
-
-    blownup = get_bits1(&s->gb);
-    skip_bits(&s->gb,  8 + 4 * blownup); // header_size
-    skip_bits(&s->gb, 16 + 4 * blownup); // hd_size
-
-    s->static_fields = get_bits1(&s->gb);
-    if (s->static_fields) {
-        skip_bits(&s->gb, 2); // reference clock code
-        skip_bits(&s->gb, 3); // frame duration code
-
-        if (get_bits1(&s->gb))
-            skip_bits_long(&s->gb, 36); // timestamp
-
-        /* a single stream can contain multiple audio assets that can be
-         * combined to form multiple audio presentations */
-
-        num_audiop = get_bits(&s->gb, 3) + 1;
-        if (num_audiop > 1) {
-            avpriv_request_sample(s->avctx,
-                                  "Multiple DTS-HD audio presentations");
-            /* ignore such streams for now */
-            return;
-        }
-
-        num_assets = get_bits(&s->gb, 3) + 1;
-        if (num_assets > 1) {
-            avpriv_request_sample(s->avctx, "Multiple DTS-HD audio assets");
-            /* ignore such streams for now */
-            return;
-        }
-
-        for (i = 0; i < num_audiop; i++)
-            active_ss_mask[i] = get_bits(&s->gb, ss_index + 1);
-
-        for (i = 0; i < num_audiop; i++)
-            for (j = 0; j <= ss_index; j++)
-                if (active_ss_mask[i] & (1 << j))
-                    skip_bits(&s->gb, 8); // active asset mask
-
-        s->mix_metadata = get_bits1(&s->gb);
-        if (s->mix_metadata) {
-            int mix_out_mask_size;
-
-            skip_bits(&s->gb, 2); // adjustment level
-            mix_out_mask_size  = (get_bits(&s->gb, 2) + 1) << 2;
-            s->num_mix_configs =  get_bits(&s->gb, 2) + 1;
-
-            for (i = 0; i < s->num_mix_configs; i++) {
-                int mix_out_mask        = get_bits(&s->gb, mix_out_mask_size);
-                s->mix_config_num_ch[i] = dca_exss_mask2count(mix_out_mask);
-            }
-        }
-    }
-
-    for (i = 0; i < num_assets; i++)
-        skip_bits_long(&s->gb, 16 + 4 * blownup);  // asset size
-
-    for (i = 0; i < num_assets; i++) {
-        if (dca_exss_parse_asset_header(s))
-            return;
-    }
-
-    /* not parsed further, we were only interested in the extensions mask
-     * from the asset header */
-}
-
-/**
- * Main frame decoding function
- * FIXME add arguments
- */
-static int dca_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-
-    int lfe_samples;
-    int num_core_channels = 0;
-    int i, ret;
-    float  **samples_flt;
-    DCAContext *s = avctx->priv_data;
-    int channels, full_channels;
-    int core_ss_end;
-
-
-    s->xch_present = 0;
-
-    s->dca_buffer_size = ff_dca_convert_bitstream(buf, buf_size, s->dca_buffer,
-                                                  DCA_MAX_FRAME_SIZE + DCA_MAX_EXSS_HEADER_SIZE);
-    if (s->dca_buffer_size == AVERROR_INVALIDDATA) {
-        av_log(avctx, AV_LOG_ERROR, "Not a valid DCA frame\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8);
-    if ((ret = dca_parse_frame_header(s)) < 0) {
-        //seems like the frame is corrupt, try with the next one
-        return ret;
-    }
-    //set AVCodec values with parsed data
-    avctx->sample_rate = s->sample_rate;
-    avctx->bit_rate    = s->bit_rate;
-
-    s->profile = FF_PROFILE_DTS;
-
-    for (i = 0; i < (s->sample_blocks / 8); i++) {
-        if ((ret = dca_decode_block(s, 0, i))) {
-            av_log(avctx, AV_LOG_ERROR, "error decoding block\n");
-            return ret;
-        }
-    }
-
-    /* record number of core channels incase less than max channels are requested */
-    num_core_channels = s->prim_channels;
-
-    if (s->ext_coding)
-        s->core_ext_mask = dca_ext_audio_descr_mask[s->ext_descr];
-    else
-        s->core_ext_mask = 0;
-
-    core_ss_end = FFMIN(s->frame_size, s->dca_buffer_size) * 8;
-
-    /* only scan for extensions if ext_descr was unknown or indicated a
-     * supported XCh extension */
-    if (s->core_ext_mask < 0 || s->core_ext_mask & DCA_EXT_XCH) {
-
-        /* if ext_descr was unknown, clear s->core_ext_mask so that the
-         * extensions scan can fill it up */
-        s->core_ext_mask = FFMAX(s->core_ext_mask, 0);
-
-        /* extensions start at 32-bit boundaries into bitstream */
-        skip_bits_long(&s->gb, (-get_bits_count(&s->gb)) & 31);
-
-        while (core_ss_end - get_bits_count(&s->gb) >= 32) {
-            uint32_t bits = get_bits_long(&s->gb, 32);
-
-            switch (bits) {
-            case 0x5a5a5a5a: {
-                int ext_amode, xch_fsize;
-
-                s->xch_base_channel = s->prim_channels;
-
-                /* validate sync word using XCHFSIZE field */
-                xch_fsize = show_bits(&s->gb, 10);
-                if ((s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize) &&
-                    (s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize + 1))
-                    continue;
-
-                /* skip length-to-end-of-frame field for the moment */
-                skip_bits(&s->gb, 10);
-
-                s->core_ext_mask |= DCA_EXT_XCH;
-
-                /* extension amode(number of channels in extension) should be 1 */
-                /* AFAIK XCh is not used for more channels */
-                if ((ext_amode = get_bits(&s->gb, 4)) != 1) {
-                    av_log(avctx, AV_LOG_ERROR, "XCh extension amode %d not"
-                           " supported!\n", ext_amode);
-                    continue;
-                }
-
-                /* much like core primary audio coding header */
-                dca_parse_audio_coding_header(s, s->xch_base_channel);
-
-                for (i = 0; i < (s->sample_blocks / 8); i++)
-                    if ((ret = dca_decode_block(s, s->xch_base_channel, i))) {
-                        av_log(avctx, AV_LOG_ERROR, "error decoding XCh extension\n");
-                        continue;
-                    }
-
-                s->xch_present = 1;
-                break;
-            }
-            case 0x47004a03:
-                /* XXCh: extended channels */
-                /* usually found either in core or HD part in DTS-HD HRA streams,
-                 * but not in DTS-ES which contains XCh extensions instead */
-                s->core_ext_mask |= DCA_EXT_XXCH;
-                break;
-
-            case 0x1d95f262: {
-                int fsize96 = show_bits(&s->gb, 12) + 1;
-                if (s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + fsize96)
-                    continue;
-
-                av_log(avctx, AV_LOG_DEBUG, "X96 extension found at %d bits\n",
-                       get_bits_count(&s->gb));
-                skip_bits(&s->gb, 12);
-                av_log(avctx, AV_LOG_DEBUG, "FSIZE96 = %d bytes\n", fsize96);
-                av_log(avctx, AV_LOG_DEBUG, "REVNO = %d\n", get_bits(&s->gb, 4));
-
-                s->core_ext_mask |= DCA_EXT_X96;
-                break;
-            }
-            }
-
-            skip_bits_long(&s->gb, (-get_bits_count(&s->gb)) & 31);
-        }
-    } else {
-        /* no supported extensions, skip the rest of the core substream */
-        skip_bits_long(&s->gb, core_ss_end - get_bits_count(&s->gb));
-    }
-
-    if (s->core_ext_mask & DCA_EXT_X96)
-        s->profile = FF_PROFILE_DTS_96_24;
-    else if (s->core_ext_mask & (DCA_EXT_XCH | DCA_EXT_XXCH))
-        s->profile = FF_PROFILE_DTS_ES;
-
-    /* check for ExSS (HD part) */
-    if (s->dca_buffer_size - s->frame_size > 32 &&
-        get_bits_long(&s->gb, 32) == DCA_HD_MARKER)
-        dca_exss_parse_header(s);
-
-    avctx->profile = s->profile;
-
-    full_channels = channels = s->prim_channels + !!s->lfe;
-
-    if (s->amode < 16) {
-        avctx->channel_layout = dca_core_channel_layout[s->amode];
-
-        if (s->prim_channels + !!s->lfe > 2 &&
-            avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
-            /*
-             * Neither the core's auxiliary data nor our default tables contain
-             * downmix coefficients for the additional channel coded in the XCh
-             * extension, so when we're doing a Stereo downmix, don't decode it.
-             */
-            s->xch_disable = 1;
-        }
-
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
-        if (s->xch_present && !s->xch_disable &&
-            (!avctx->request_channels ||
-             avctx->request_channels > num_core_channels + !!s->lfe)) {
-FF_ENABLE_DEPRECATION_WARNINGS
-#else
-        if (s->xch_present && !s->xch_disable) {
-#endif
-            avctx->channel_layout |= AV_CH_BACK_CENTER;
-            if (s->lfe) {
-                avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
-                s->channel_order_tab = dca_channel_reorder_lfe_xch[s->amode];
-            } else {
-                s->channel_order_tab = dca_channel_reorder_nolfe_xch[s->amode];
-            }
-        } else {
-            channels = num_core_channels + !!s->lfe;
-            s->xch_present = 0; /* disable further xch processing */
-            if (s->lfe) {
-                avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
-                s->channel_order_tab = dca_channel_reorder_lfe[s->amode];
-            } else
-                s->channel_order_tab = dca_channel_reorder_nolfe[s->amode];
-        }
-
-        if (channels > !!s->lfe &&
-            s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
-            return AVERROR_INVALIDDATA;
-
-        if (num_core_channels + !!s->lfe > 2 &&
-            avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
-            channels = 2;
-            s->output = s->prim_channels == 2 ? s->amode : DCA_STEREO;
-            avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-
-            /* Stereo downmix coefficients
-             *
-             * The decoder can only downmix to 2-channel, so we need to ensure
-             * embedded downmix coefficients are actually targeting 2-channel.
-             */
-            if (s->core_downmix && (s->core_downmix_amode == DCA_STEREO ||
-                                    s->core_downmix_amode == DCA_STEREO_TOTAL)) {
-                int sign, code;
-                for (i = 0; i < num_core_channels + !!s->lfe; i++) {
-                    sign = s->core_downmix_codes[i][0] & 0x100 ? 1 : -1;
-                    code = s->core_downmix_codes[i][0] & 0x0FF;
-                    s->downmix_coef[i][0] = (!code ? 0.0f :
-                                             sign * dca_dmixtable[code - 1]);
-                    sign = s->core_downmix_codes[i][1] & 0x100 ? 1 : -1;
-                    code = s->core_downmix_codes[i][1] & 0x0FF;
-                    s->downmix_coef[i][1] = (!code ? 0.0f :
-                                             sign * dca_dmixtable[code - 1]);
-                }
-                s->output = s->core_downmix_amode;
-            } else {
-                int am = s->amode & DCA_CHANNEL_MASK;
-                if (am >= FF_ARRAY_ELEMS(dca_default_coeffs)) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "Invalid channel mode %d\n", am);
-                    return AVERROR_INVALIDDATA;
-                }
-                if (num_core_channels + !!s->lfe >
-                    FF_ARRAY_ELEMS(dca_default_coeffs[0])) {
-                    avpriv_request_sample(s->avctx, "Downmixing %d channels",
-                                          s->prim_channels + !!s->lfe);
-                    return AVERROR_PATCHWELCOME;
-                }
-                for (i = 0; i < num_core_channels + !!s->lfe; i++) {
-                    s->downmix_coef[i][0] = dca_default_coeffs[am][i][0];
-                    s->downmix_coef[i][1] = dca_default_coeffs[am][i][1];
-                }
-            }
-            av_dlog(s->avctx, "Stereo downmix coeffs:\n");
-            for (i = 0; i < num_core_channels + !!s->lfe; i++) {
-                av_dlog(s->avctx, "L, input channel %d = %f\n", i,
-                        s->downmix_coef[i][0]);
-                av_dlog(s->avctx, "R, input channel %d = %f\n", i,
-                        s->downmix_coef[i][1]);
-            }
-            av_dlog(s->avctx, "\n");
-        }
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "Non standard configuration %d !\n", s->amode);
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->channels = channels;
-
-    /* get output buffer */
-    frame->nb_samples = 256 * (s->sample_blocks / 8);
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples_flt = (float **)frame->extended_data;
-
-    /* allocate buffer for extra channels if downmixing */
-    if (avctx->channels < full_channels) {
-        ret = av_samples_get_buffer_size(NULL, full_channels - channels,
-                                         frame->nb_samples,
-                                         avctx->sample_fmt, 0);
-        if (ret < 0)
-            return ret;
-
-        av_fast_malloc(&s->extra_channels_buffer,
-                       &s->extra_channels_buffer_size, ret);
-        if (!s->extra_channels_buffer)
-            return AVERROR(ENOMEM);
-
-        ret = av_samples_fill_arrays((uint8_t **)s->extra_channels, NULL,
-                                     s->extra_channels_buffer,
-                                     full_channels - channels,
-                                     frame->nb_samples, avctx->sample_fmt, 0);
-        if (ret < 0)
-            return ret;
-    }
-
-    /* filter to get final output */
-    for (i = 0; i < (s->sample_blocks / 8); i++) {
-        int ch;
-
-        for (ch = 0; ch < channels; ch++)
-            s->samples_chanptr[ch] = samples_flt[ch] + i * 256;
-        for (; ch < full_channels; ch++)
-            s->samples_chanptr[ch] = s->extra_channels[ch - channels] + i * 256;
-
-        dca_filter_channels(s, i);
-
-        /* If this was marked as a DTS-ES stream we need to subtract back- */
-        /* channel from SL & SR to remove matrixed back-channel signal */
-        if ((s->source_pcm_res & 1) && s->xch_present) {
-            float *back_chan = s->samples_chanptr[s->channel_order_tab[s->xch_base_channel]];
-            float *lt_chan   = s->samples_chanptr[s->channel_order_tab[s->xch_base_channel - 2]];
-            float *rt_chan   = s->samples_chanptr[s->channel_order_tab[s->xch_base_channel - 1]];
-            s->fdsp.vector_fmac_scalar(lt_chan, back_chan, -M_SQRT1_2, 256);
-            s->fdsp.vector_fmac_scalar(rt_chan, back_chan, -M_SQRT1_2, 256);
-        }
-    }
-
-    /* update lfe history */
-    lfe_samples = 2 * s->lfe * (s->sample_blocks / 8);
-    for (i = 0; i < 2 * s->lfe * 4; i++)
-        s->lfe_data[i] = s->lfe_data[i + lfe_samples];
-
-    /* AVMatrixEncoding
-     *
-     * DCA_STEREO_TOTAL (Lt/Rt) is equivalent to Dolby Surround */
-    ret = ff_side_data_update_matrix_encoding(frame,
-                                              (s->output & ~DCA_LFE) == DCA_STEREO_TOTAL ?
-                                              AV_MATRIX_ENCODING_DOLBY : AV_MATRIX_ENCODING_NONE);
-    if (ret < 0)
-        return ret;
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-
-
-
-/**
- * DCA initialization
- *
- * @param avctx     pointer to the AVCodecContext
- */
-
-static av_cold int dca_decode_init(AVCodecContext *avctx)
-{
-    DCAContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    dca_init_vlcs();
-
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-    ff_mdct_init(&s->imdct, 6, 1, 1.0);
-    ff_synth_filter_init(&s->synth);
-    ff_dcadsp_init(&s->dcadsp);
-    ff_fmt_convert_init(&s->fmt_conv, avctx);
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    /* allow downmixing to stereo */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
-    if (avctx->request_channels == 2)
-        avctx->request_channel_layout = AV_CH_LAYOUT_STEREO;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-    if (avctx->channels > 2 &&
-        avctx->request_channel_layout == AV_CH_LAYOUT_STEREO)
-        avctx->channels = 2;
-
-    return 0;
-}
-
-static av_cold int dca_decode_end(AVCodecContext *avctx)
-{
-    DCAContext *s = avctx->priv_data;
-    ff_mdct_end(&s->imdct);
-    av_freep(&s->extra_channels_buffer);
-    return 0;
-}
-
-static const AVProfile profiles[] = {
-    { FF_PROFILE_DTS,        "DTS"        },
-    { FF_PROFILE_DTS_ES,     "DTS-ES"     },
-    { FF_PROFILE_DTS_96_24,  "DTS 96/24"  },
-    { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
-    { FF_PROFILE_DTS_HD_MA,  "DTS-HD MA"  },
-    { FF_PROFILE_UNKNOWN },
-};
-
-static const AVOption options[] = {
-    { "disable_xch", "disable decoding of the XCh extension", offsetof(DCAContext, xch_disable), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_AUDIO_PARAM },
-    { NULL },
-};
-
-static const AVClass dca_decoder_class = {
-    .class_name = "DCA decoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_dca_decoder = {
-    .name            = "dca",
-    .long_name       = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
-    .type            = AVMEDIA_TYPE_AUDIO,
-    .id              = AV_CODEC_ID_DTS,
-    .priv_data_size  = sizeof(DCAContext),
-    .init            = dca_decode_init,
-    .decode          = dca_decode_frame,
-    .close           = dca_decode_end,
-    .capabilities    = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
-    .sample_fmts     = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                       AV_SAMPLE_FMT_NONE },
-    .profiles        = NULL_IF_CONFIG_SMALL(profiles),
-    .priv_class      = &dca_decoder_class,
-};
diff --git a/deps/libav/libavcodec/dcadsp.c b/deps/libav/libavcodec/dcadsp.c
deleted file mode 100644
index 8d242c5..0000000
--- a/deps/libav/libavcodec/dcadsp.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2004 Gildas Bazin
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/intreadwrite.h"
-#include "dcadsp.h"
-
-static void int8x8_fmul_int32_c(float *dst, const int8_t *src, int scale)
-{
-    float fscale = scale / 16.0;
-    int i;
-    for (i = 0; i < 8; i++)
-        dst[i] = src[i] * fscale;
-}
-
-static inline void
-dca_lfe_fir(float *out, const float *in, const float *coefs,
-            int decifactor, float scale)
-{
-    float *out2 = out + decifactor;
-    const float *cf0 = coefs;
-    const float *cf1 = coefs + 256;
-    int j, k;
-
-    /* One decimated sample generates 2*decifactor interpolated ones */
-    for (k = 0; k < decifactor; k++) {
-        float v0 = 0.0;
-        float v1 = 0.0;
-        for (j = 0; j < 256 / decifactor; j++) {
-            float s = in[-j];
-            v0 += s * *cf0++;
-            v1 += s * *--cf1;
-        }
-        *out++  = v0 * scale;
-        *out2++ = v1 * scale;
-    }
-}
-
-static void dca_qmf_32_subbands(float samples_in[32][8], int sb_act,
-                                SynthFilterContext *synth, FFTContext *imdct,
-                                float synth_buf_ptr[512],
-                                int *synth_buf_offset, float synth_buf2[32],
-                                const float window[512], float *samples_out,
-                                float raXin[32], float scale)
-{
-    int i;
-    int subindex;
-
-    for (i = sb_act; i < 32; i++)
-        raXin[i] = 0.0;
-
-    /* Reconstructed channel sample index */
-    for (subindex = 0; subindex < 8; subindex++) {
-        /* Load in one sample from each subband and clear inactive subbands */
-        for (i = 0; i < sb_act; i++) {
-            unsigned sign = (i - 1) & 2;
-            uint32_t v    = AV_RN32A(&samples_in[i][subindex]) ^ sign << 30;
-            AV_WN32A(&raXin[i], v);
-        }
-
-        synth->synth_filter_float(imdct, synth_buf_ptr, synth_buf_offset,
-                                  synth_buf2, window, samples_out, raXin, scale);
-        samples_out += 32;
-    }
-}
-
-static void dca_lfe_fir0_c(float *out, const float *in, const float *coefs,
-                           float scale)
-{
-    dca_lfe_fir(out, in, coefs, 32, scale);
-}
-
-static void dca_lfe_fir1_c(float *out, const float *in, const float *coefs,
-                           float scale)
-{
-    dca_lfe_fir(out, in, coefs, 64, scale);
-}
-
-av_cold void ff_dcadsp_init(DCADSPContext *s)
-{
-    s->lfe_fir[0] = dca_lfe_fir0_c;
-    s->lfe_fir[1] = dca_lfe_fir1_c;
-    s->qmf_32_subbands = dca_qmf_32_subbands;
-    s->int8x8_fmul_int32 = int8x8_fmul_int32_c;
-    if (ARCH_ARM) ff_dcadsp_init_arm(s);
-    if (ARCH_X86) ff_dcadsp_init_x86(s);
-}
diff --git a/deps/libav/libavcodec/dcadsp.h b/deps/libav/libavcodec/dcadsp.h
deleted file mode 100644
index 3e04426..0000000
--- a/deps/libav/libavcodec/dcadsp.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DCADSP_H
-#define AVCODEC_DCADSP_H
-
-#include "avfft.h"
-#include "synth_filter.h"
-
-typedef struct DCADSPContext {
-    void (*lfe_fir[2])(float *out, const float *in, const float *coefs,
-                       float scale);
-    void (*qmf_32_subbands)(float samples_in[32][8], int sb_act,
-                            SynthFilterContext *synth, FFTContext *imdct,
-                            float synth_buf_ptr[512],
-                            int *synth_buf_offset, float synth_buf2[32],
-                            const float window[512], float *samples_out,
-                            float raXin[32], float scale);
-    void (*int8x8_fmul_int32)(float *dst, const int8_t *src, int scale);
-} DCADSPContext;
-
-void ff_dcadsp_init(DCADSPContext *s);
-void ff_dcadsp_init_arm(DCADSPContext *s);
-void ff_dcadsp_init_x86(DCADSPContext *s);
-
-#endif /* AVCODEC_DCADSP_H */
diff --git a/deps/libav/libavcodec/dcahuff.h b/deps/libav/libavcodec/dcahuff.h
deleted file mode 100644
index 254fc76..0000000
--- a/deps/libav/libavcodec/dcahuff.h
+++ /dev/null
@@ -1,1076 +0,0 @@
-/*
- * DCA compatible decoder - huffman tables
- * Copyright (C) 2004 Gildas Bazin
- * Copyright (C) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DCAHUFF_H
-#define AVCODEC_DCAHUFF_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#define TMODE_COUNT 4
-static const uint8_t tmode_vlc_bits[TMODE_COUNT] = { 3, 3, 3, 2 };
-static const uint16_t tmode_codes[TMODE_COUNT][4] = {
-  { 0x0000, 0x0002, 0x0006, 0x0007 },
-  { 0x0002, 0x0006, 0x0007, 0x0000 },
-  { 0x0006, 0x0007, 0x0000, 0x0002 },
-  { 0x0000, 0x0001, 0x0002, 0x0003 }
-};
-static const uint8_t tmode_bits[TMODE_COUNT][4] = {
-  {  1,  2,  3,  3 },
-  {  2,  3,  3,  1 },
-  {  3,  3,  1,  2 },
-  {  2,  2,  2,  2 }
-};
-
-
-#define BITALLOC_12_COUNT 5
-#define BITALLOC_12_VLC_BITS 9
-static const uint8_t bitalloc_12_vlc_bits[BITALLOC_12_COUNT] = {
-  9, 7, 7, 9, 9
-};
-static const uint16_t bitalloc_12_codes[BITALLOC_12_COUNT][12] = {
-  {
-    0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, 0x00FF, 0x00FE,
-    0x01FB, 0x01FA, 0x01F9, 0x01F8,
-  },
-  {
-    0x0001, 0x0000, 0x0002, 0x000F, 0x000C, 0x001D, 0x0039, 0x0038,
-    0x0037, 0x0036, 0x0035, 0x0034,
-  },
-  {
-    0x0000, 0x0007, 0x0005, 0x0004, 0x0002, 0x000D, 0x000C, 0x0006,
-    0x000F, 0x001D, 0x0039, 0x0038,
-  },
-  {
-    0x0003, 0x0002, 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E,
-    0x007E, 0x00FE, 0x01FF, 0x01FE,
-  },
-  {
-    0x0001, 0x0000, 0x0002, 0x0006, 0x000E, 0x003F, 0x003D, 0x007C,
-    0x0079, 0x0078, 0x00FB, 0x00FA,
-  }
-};
-static const uint8_t bitalloc_12_bits[BITALLOC_12_COUNT][12] = {
-  { 1,  2,  3,  4,  5,  6,  8,  8,  9,  9,  9,  9 },
-  { 1,  2,  3,  5,  5,  6,  7,  7,  7,  7,  7,  7 },
-  { 2,  3,  3,  3,  3,  4,  4,  4,  5,  6,  7,  7 },
-  { 2,  2,  2,  3,  4,  5,  6,  7,  8,  9, 10, 10 },
-  { 1,  2,  3,  4,  5,  7,  7,  8,  8,  8,  9,  9 }
-};
-
-
-#define SCALES_COUNT 5
-#define SCALES_VLC_BITS 9
-static const uint16_t scales_codes[SCALES_COUNT][129] = {
-  {
-    0x3AB0, 0x3AB2, 0x3AB4, 0x3AB6, 0x3AB8, 0x3ABA, 0x3ABC, 0x3ABE,
-    0x3AC0, 0x3AC2, 0x3AC4, 0x3AC6, 0x3AC8, 0x3ACA, 0x3ACC, 0x3ACE,
-    0x3AD0, 0x3AD2, 0x3AD4, 0x3AD6, 0x3AD8, 0x3ADA, 0x3ADC, 0x3ADE,
-    0x3AE0, 0x3AE2, 0x3AE4, 0x3AE6, 0x3AE8, 0x3AEA, 0x3AEC, 0x3AEE,
-    0x3AF0, 0x3AF2, 0x3AF4, 0x3AF6, 0x3AF8, 0x3AFA, 0x3AFC, 0x3AFE,
-    0x0540, 0x0542, 0x0544, 0x0546, 0x0548, 0x054A, 0x054C, 0x054E,
-    0x0558, 0x055E, 0x02AD, 0x0154, 0x0754, 0x03A8, 0x0056, 0x0028,
-    0x00E8, 0x004A, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005,
-    0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x004B,
-    0x00E9, 0x0029, 0x0057, 0x03A9, 0x0755, 0x0155, 0x02AE, 0x055F,
-    0x0559, 0x054F, 0x054D, 0x054B, 0x0549, 0x0547, 0x0545, 0x0543,
-    0x0541, 0x3AFF, 0x3AFD, 0x3AFB, 0x3AF9, 0x3AF7, 0x3AF5, 0x3AF3,
-    0x3AF1, 0x3AEF, 0x3AED, 0x3AEB, 0x3AE9, 0x3AE7, 0x3AE5, 0x3AE3,
-    0x3AE1, 0x3ADF, 0x3ADD, 0x3ADB, 0x3AD9, 0x3AD7, 0x3AD5, 0x3AD3,
-    0x3AD1, 0x3ACF, 0x3ACD, 0x3ACB, 0x3AC9, 0x3AC7, 0x3AC5, 0x3AC3,
-    0x3AC1, 0x3ABF, 0x3ABD, 0x3ABB, 0x3AB9, 0x3AB7, 0x3AB5, 0x3AB3,
-    0x3AB1,
-  },
-  {
-    0x0F60, 0x0F62, 0x0F64, 0x0F66, 0x0F68, 0x0F6A, 0x0F6C, 0x0F6E,
-    0x0F70, 0x0F72, 0x0F74, 0x0F76, 0x0F78, 0x0F7A, 0x0F7C, 0x0F7E,
-    0x0F80, 0x0F82, 0x0F84, 0x0F86, 0x0F88, 0x0F8A, 0x0F8C, 0x0F8E,
-    0x0F90, 0x0F92, 0x0F94, 0x0F96, 0x0F98, 0x0F9A, 0x0F9C, 0x0F9E,
-    0x0FA0, 0x0FA2, 0x0FA4, 0x0FA6, 0x0FA8, 0x0FAA, 0x0FAC, 0x0FAE,
-    0x0FB0, 0x0FB2, 0x0FB4, 0x0FB6, 0x0FB8, 0x0FBA, 0x0FBC, 0x0FBE,
-    0x07A0, 0x07A2, 0x03D2, 0x01EA, 0x00FC, 0x007F, 0x001C, 0x000C,
-    0x0004, 0x0034, 0x0010, 0x001B, 0x0009, 0x000B, 0x000E, 0x0001,
-    0x0003, 0x0002, 0x000F, 0x000C, 0x000A, 0x0000, 0x0011, 0x0035,
-    0x0005, 0x000D, 0x001D, 0x003C, 0x00FD, 0x01EB, 0x03D3, 0x07A3,
-    0x07A1, 0x0FBF, 0x0FBD, 0x0FBB, 0x0FB9, 0x0FB7, 0x0FB5, 0x0FB3,
-    0x0FB1, 0x0FAF, 0x0FAD, 0x0FAB, 0x0FA9, 0x0FA7, 0x0FA5, 0x0FA3,
-    0x0FA1, 0x0F9F, 0x0F9D, 0x0F9B, 0x0F99, 0x0F97, 0x0F95, 0x0F93,
-    0x0F91, 0x0F8F, 0x0F8D, 0x0F8B, 0x0F89, 0x0F87, 0x0F85, 0x0F83,
-    0x0F81, 0x0F7F, 0x0F7D, 0x0F7B, 0x0F79, 0x0F77, 0x0F75, 0x0F73,
-    0x0F71, 0x0F6F, 0x0F6D, 0x0F6B, 0x0F69, 0x0F67, 0x0F65, 0x0F63,
-    0x0F61,
-  },
-  {
-    0x51D0, 0x51D2, 0x51D4, 0x51D6, 0x51D8, 0x51DA, 0x51DC, 0x51DE,
-    0x51E0, 0x51E2, 0x51E4, 0x51E6, 0x51E8, 0x51EA, 0x51EC, 0x51EE,
-    0x51F0, 0x51F2, 0x51F4, 0x51F6, 0x51F8, 0x51FA, 0x51FC, 0x51FE,
-    0x70C0, 0x70C2, 0x70C4, 0x70C6, 0x70C8, 0x70CA, 0x70CC, 0x70CE,
-    0x70EC, 0x10EA, 0x3868, 0x3877, 0x0876, 0x1C35, 0x0434, 0x0A34,
-    0x0E1B, 0x021B, 0x051B, 0x070F, 0x010F, 0x0380, 0x0080, 0x0140,
-    0x01C1, 0x0041, 0x00A1, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012,
-    0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000,
-    0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B,
-    0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A2, 0x0042,
-    0x01C2, 0x0141, 0x0081, 0x0381, 0x028C, 0x010C, 0x051C, 0x021C,
-    0x0E1C, 0x0A35, 0x0435, 0x1C3A, 0x0877, 0x0874, 0x3869, 0x10EB,
-    0x70ED, 0x70CF, 0x70CD, 0x70CB, 0x70C9, 0x70C7, 0x70C5, 0x70C3,
-    0x70C1, 0x51FF, 0x51FD, 0x51FB, 0x51F9, 0x51F7, 0x51F5, 0x51F3,
-    0x51F1, 0x51EF, 0x51ED, 0x51EB, 0x51E9, 0x51E7, 0x51E5, 0x51E3,
-    0x51E1, 0x51DF, 0x51DD, 0x51DB, 0x51D9, 0x51D7, 0x51D5, 0x51D3,
-    0x51D1,
-  },
-  {
-    0x6F64, 0x6F66, 0x6F68, 0x6F6A, 0x6F6C, 0x6F6E, 0x6F70, 0x6F72,
-    0x6F74, 0x6F76, 0x6F78, 0x6F7A, 0x6F7C, 0x6F7E, 0x6F80, 0x6F82,
-    0x6F84, 0x6F86, 0x6F88, 0x6F8A, 0x6F8C, 0x6F8E, 0x6F90, 0x6F92,
-    0x6F94, 0x6F96, 0x6F98, 0x6F9A, 0x6F9C, 0x6F9E, 0x6FA0, 0x6FA2,
-    0x6FA4, 0x6FA6, 0x6FA8, 0x6FAA, 0x6FAC, 0x6FAE, 0x6FB0, 0x6FB2,
-    0x6FB4, 0x6FB6, 0x17B4, 0x37DC, 0x0BDB, 0x1BEF, 0x05EE, 0x0DF8,
-    0x02F8, 0x06FD, 0x017D, 0x037F, 0x00BF, 0x0040, 0x00C0, 0x0021,
-    0x0061, 0x0011, 0x0031, 0x0009, 0x0019, 0x0006, 0x000E, 0x0004,
-    0x0000, 0x0005, 0x000F, 0x0007, 0x001A, 0x000A, 0x0036, 0x0016,
-    0x006E, 0x002E, 0x00C1, 0x0041, 0x01BC, 0x00BC, 0x037A, 0x017A,
-    0x02F9, 0x0DF9, 0x05EF, 0x05EC, 0x1BD8, 0x37DD, 0x17B5, 0x6FB7,
-    0x6FB5, 0x6FB3, 0x6FB1, 0x6FAF, 0x6FAD, 0x6FAB, 0x6FA9, 0x6FA7,
-    0x6FA5, 0x6FA3, 0x6FA1, 0x6F9F, 0x6F9D, 0x6F9B, 0x6F99, 0x6F97,
-    0x6F95, 0x6F93, 0x6F91, 0x6F8F, 0x6F8D, 0x6F8B, 0x6F89, 0x6F87,
-    0x6F85, 0x6F83, 0x6F81, 0x6F7F, 0x6F7D, 0x6F7B, 0x6F79, 0x6F77,
-    0x6F75, 0x6F73, 0x6F71, 0x6F6F, 0x6F6D, 0x6F6B, 0x6F69, 0x6F67,
-    0x6F65,
-  },
-  {
-    0xDF54, 0xDF56, 0xDFC8, 0xDFCA, 0xDFCC, 0xDFCE, 0xDFD0, 0xDFD2,
-    0xDFD4, 0xDFD6, 0xDFD8, 0xDFDA, 0xDFDC, 0xDFDE, 0xDFE0, 0xDFE2,
-    0x0FE8, 0x2FEA, 0x6FA8, 0x6FF6, 0x07F5, 0x07F7, 0x37D2, 0x37F9,
-    0x03F8, 0x0BF8, 0x0BFB, 0x1BEB, 0x01FA, 0x05FA, 0x09FA, 0x0DFA,
-    0x0DFF, 0x00FF, 0x02FF, 0x06FB, 0x007C, 0x017C, 0x027C, 0x027F,
-    0x003C, 0x00BC, 0x013C, 0x01BC, 0x001C, 0x005C, 0x009C, 0x00DC,
-    0x000C, 0x002C, 0x004C, 0x006C, 0x0004, 0x0014, 0x0024, 0x0034,
-    0x0000, 0x0008, 0x0010, 0x0018, 0x001E, 0x0002, 0x0006, 0x000A,
-    0x000E, 0x000B, 0x0007, 0x0003, 0x001F, 0x0019, 0x0011, 0x0009,
-    0x0001, 0x0035, 0x0025, 0x0015, 0x0005, 0x006D, 0x004D, 0x002D,
-    0x000D, 0x00DD, 0x009D, 0x005D, 0x001D, 0x01BD, 0x013D, 0x00BD,
-    0x003D, 0x037C, 0x027D, 0x017D, 0x007D, 0x06FC, 0x04FC, 0x02FC,
-    0x00FC, 0x0DFB, 0x09FB, 0x05FB, 0x01FB, 0x1BF8, 0x1BE8, 0x0BF9,
-    0x03F9, 0x37FA, 0x37D3, 0x17F4, 0x07F6, 0x6FF7, 0x6FA9, 0x2FEB,
-    0x0FE9, 0xDFE3, 0xDFE1, 0xDFDF, 0xDFDD, 0xDFDB, 0xDFD9, 0xDFD7,
-    0xDFD5, 0xDFD3, 0xDFD1, 0xDFCF, 0xDFCD, 0xDFCB, 0xDFC9, 0xDF57,
-    0xDF55,
-  }
-};
-
-static const uint8_t scales_bits[SCALES_COUNT][129] = {
-  {
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 12, 11, 11, 10,  9,  8,
-     8,  7,  6,  6,  5,  4,  4,  3,
-     2,  3,  3,  4,  5,  5,  6,  7,
-     8,  8,  9, 10, 11, 11, 12, 13,
-    13, 13, 13, 13, 13, 13, 13, 13,
-    13, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14,
-  },
-  {
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    14, 14, 13, 12, 11, 10,  8,  7,
-     6,  6,  5,  5,  4,  4,  4,  3,
-     3,  3,  4,  4,  4,  4,  5,  6,
-     6,  7,  8,  9, 11, 12, 13, 14,
-    14, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15,
-  },
-  {
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 14, 14, 14, 13, 13, 12, 12,
-    12, 11, 11, 11, 10, 10,  9,  9,
-     9,  8,  8,  8,  7,  7,  7,  6,
-     6,  6,  5,  5,  5,  4,  4,  3,
-     3,  3,  4,  4,  5,  5,  5,  6,
-     6,  6,  7,  7,  7,  8,  8,  8,
-     9,  9,  9, 10, 10, 10, 11, 11,
-    12, 12, 12, 13, 13, 13, 14, 14,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15,
-  },
-  {
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 14, 14, 13, 13, 12, 12,
-    11, 11, 10, 10,  9,  8,  8,  7,
-     7,  6,  6,  5,  5,  4,  4,  3,
-     2,  3,  4,  4,  5,  5,  6,  6,
-     7,  7,  8,  8,  9,  9, 10, 10,
-    11, 12, 12, 12, 13, 14, 14, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15,
-  },
-  {
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    15, 15, 15, 15, 14, 14, 14, 14,
-    13, 13, 13, 13, 12, 12, 12, 12,
-    12, 11, 11, 11, 10, 10, 10, 10,
-     9,  9,  9,  9,  8,  8,  8,  8,
-     7,  7,  7,  7,  6,  6,  6,  6,
-     5,  5,  5,  5,  5,  4,  4,  4,
-     4,  4,  4,  4,  5,  5,  5,  5,
-     5,  6,  6,  6,  6,  7,  7,  7,
-     7,  8,  8,  8,  8,  9,  9,  9,
-     9, 10, 10, 10, 10, 11, 11, 11,
-    11, 12, 12, 12, 12, 13, 13, 13,
-    13, 14, 14, 14, 14, 15, 15, 15,
-    15, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16,
-  }
-};
-
-static const uint16_t bitalloc_3_codes[3] =
-{
-    0x0003, 0x0000, 0x0002,
-};
-static const uint8_t bitalloc_3_bits[3] =
-{
-     2,  1,  2,
-};
-
-static const uint16_t bitalloc_5_codes_a[5] =
-{
-    0x000F, 0x0006, 0x0000, 0x0002, 0x000E,
-};
-static const uint16_t bitalloc_5_codes_b[5] =
-{
-    0x0007, 0x0001, 0x0002, 0x0000, 0x0006,
-};
-static const uint16_t bitalloc_5_codes_c[5] =
-{
-    0x0007, 0x0005, 0x0000, 0x0004, 0x0006,
-};
-static const uint8_t bitalloc_5_bits_a[5] =
-{
-     4,  3,  1,  2,  4,
-};
-static const uint8_t bitalloc_5_bits_b[5] =
-{
-     3,  2,  2,  2,  3,
-};
-static const uint8_t bitalloc_5_bits_c[5] =
-{
-     3,  3,  1,  3,  3,
-};
-
-static const uint16_t bitalloc_7_codes_a[7] =
-{
-    0x001E, 0x000E, 0x0005, 0x0000, 0x0006, 0x0004, 0x001F,
-};
-static const uint16_t bitalloc_7_codes_b[7] =
-{
-    0x0014, 0x000B, 0x0000, 0x0003, 0x0001, 0x0004, 0x0015,
-};
-static const uint16_t bitalloc_7_codes_c[7] =
-{
-    0x0000, 0x0002, 0x0001, 0x0003, 0x0002, 0x0003, 0x0001,
-};
-static const uint8_t bitalloc_7_bits_a[7] =
-{
-     5,  4,  3,  1,  3,  3,  5,
-};
-static const uint8_t bitalloc_7_bits_b[7] =
-{
-     5,  4,  2,  2,  2,  3,  5,
-};
-static const uint8_t bitalloc_7_bits_c[7] =
-{
-     4,  4,  2,  2,  2,  4,  4,
-};
-
-static const uint16_t bitalloc_9_codes_a[9] =
-{
-    0x0030, 0x0019, 0x0009, 0x0005, 0x0000, 0x0007, 0x000D, 0x0008,
-    0x0031,
-};
-static const uint16_t bitalloc_9_codes_b[9] =
-{
-    0x0018, 0x001A, 0x0002, 0x0007, 0x0002, 0x0000, 0x0003, 0x001B,
-    0x0019,
-};
-static const uint16_t bitalloc_9_codes_c[9] =
-{
-    0x001C, 0x000F, 0x0002, 0x0007, 0x0002, 0x0000, 0x0006, 0x0006,
-    0x001D,
-};
-static const uint8_t bitalloc_9_bits_a[9] =
-{
-     6,  5,  4,  3,  1,  3,  4,  4,  6,
-};
-static const uint8_t bitalloc_9_bits_b[9] =
-{
-     5,  5,  3,  3,  2,  2,  3,  5,  5,
-};
-static const uint8_t bitalloc_9_bits_c[9] =
-{
-     6,  5,  3,  3,  2,  2,  3,  4,  6,
-};
-
-static const uint16_t bitalloc_13_codes_a[13] =
-{
-    0x0070, 0x002E, 0x0039, 0x001D, 0x000C, 0x000F, 0x0000, 0x0004,
-    0x000D, 0x000A, 0x0016, 0x002F, 0x0071,
-};
-static const uint16_t bitalloc_13_codes_b[13] =
-{
-    0x0038, 0x0010, 0x001D, 0x0007, 0x000F, 0x0005, 0x0000, 0x0006,
-    0x0002, 0x0009, 0x0006, 0x0011, 0x0039,
-};
-static const uint16_t bitalloc_13_codes_c[13] =
-{
-    0x0004, 0x001A, 0x0003, 0x000E, 0x0000, 0x0003, 0x0005, 0x0004,
-    0x0002, 0x000F, 0x000C, 0x001B, 0x0005,
-};
-static const uint8_t bitalloc_13_bits_a[13] =
-{
-     7,  6,  6,  5,  4,  4,  1,  3,  4,  4,  5,  6,  7,
-};
-static const uint8_t bitalloc_13_bits_b[13] =
-{
-     6,  5,  5,  4,  4,  3,  2,  3,  3,  4,  4,  5,  6,
-};
-static const uint8_t bitalloc_13_bits_c[13] =
-{
-     5,  5,  4,  4,  3,  3,  3,  3,  3,  4,  4,  5,  5,
-};
-
-static const uint16_t bitalloc_17_codes_a[17] =
-{
-    0x0154, 0x00AB, 0x002B, 0x000B, 0x0003, 0x000A, 0x0001, 0x0006,
-    0x0001, 0x0007, 0x0004, 0x000B, 0x0000, 0x0004, 0x0014, 0x0054,
-    0x0155,
-};
-static const uint16_t bitalloc_17_codes_b[17] =
-{
-    0x007C, 0x003F, 0x0019, 0x000D, 0x001C, 0x0008, 0x000F, 0x0005,
-    0x0000, 0x0006, 0x0002, 0x0009, 0x001D, 0x000E, 0x001E, 0x0018,
-    0x007D,
-};
-static const uint16_t bitalloc_17_codes_c[17] =
-{
-    0x002C, 0x0017, 0x0005, 0x001C, 0x0003, 0x000A, 0x000F, 0x0003,
-    0x0006, 0x0004, 0x0000, 0x000B, 0x0004, 0x001D, 0x000A, 0x0004,
-    0x002D,
-};
-static const uint16_t bitalloc_17_codes_d[17] =
-{
-    0x0100, 0x0102, 0x0082, 0x0042, 0x0022, 0x0012, 0x000A, 0x0006,
-    0x0000, 0x0007, 0x000B, 0x0013, 0x0023, 0x0043, 0x0083, 0x0103,
-    0x0101,
-};
-static const uint16_t bitalloc_17_codes_e[17] =
-{
-    0x00E8, 0x00F6, 0x0075, 0x0034, 0x003B, 0x001B, 0x001F, 0x0004,
-    0x0000, 0x0005, 0x000C, 0x001C, 0x003C, 0x0035, 0x007A, 0x00F7,
-    0x00E9,
-};
-static const uint16_t bitalloc_17_codes_f[17] =
-{
-    0x0004, 0x0003, 0x001E, 0x0001, 0x0001, 0x000E, 0x0001, 0x0004,
-    0x0006, 0x0005, 0x0002, 0x000F, 0x0006, 0x000E, 0x001F, 0x0000,
-    0x0005,
-};
-static const uint16_t bitalloc_17_codes_g[17] =
-{
-    0x0060, 0x007E, 0x0031, 0x0019, 0x000D, 0x0004, 0x0000, 0x0006,
-    0x0002, 0x0007, 0x0001, 0x0005, 0x000E, 0x001E, 0x003E, 0x007F,
-    0x0061,
-};
-static const uint8_t bitalloc_17_bits_a[17] =
-{
-    12, 11,  9,  7,  5,  4,  3,  3,  2,  3,  3,  4,  4,  6,  8, 10,
-    12,
-};
-static const uint8_t bitalloc_17_bits_b[17] =
-{
-     8,  7,  6,  5,  5,  4,  4,  3,  2,  3,  3,  4,  5,  5,  6,  6,
-     8,
-};
-static const uint8_t bitalloc_17_bits_c[17] =
-{
-     7,  6,  5,  5,  4,  4,  4,  3,  3,  3,  3,  4,  4,  5,  5,  5,
-     7,
-};
-static const uint8_t bitalloc_17_bits_d[17] =
-{
-     9,  9,  8,  7,  6,  5,  4,  3,  1,  3,  4,  5,  6,  7,  8,  9,
-     9,
-};
-static const uint8_t bitalloc_17_bits_e[17] =
-{
-     8,  8,  7,  6,  6,  5,  5,  3,  1,  3,  4,  5,  6,  6,  7,  8,
-     8,
-};
-static const uint8_t bitalloc_17_bits_f[17] =
-{
-     8,  7,  6,  5,  4,  4,  3,  3,  3,  3,  3,  4,  4,  5,  6,  6,
-     8,
-};
-static const uint8_t bitalloc_17_bits_g[17] =
-{
-     8,  8,  7,  6,  5,  4,  3,  3,  2,  3,  3,  4,  5,  6,  7,  8,
-     8,
-};
-
-static const uint16_t bitalloc_25_codes_a[25] =
-{
-    0x2854, 0x142B, 0x050B, 0x0143, 0x00A2, 0x0052, 0x002E, 0x0015,
-    0x0004, 0x000E, 0x0000, 0x0003, 0x0006, 0x0004, 0x0001, 0x000F,
-    0x0005, 0x0016, 0x002F, 0x0053, 0x00A3, 0x00A0, 0x0284, 0x0A14,
-    0x2855,
-};
-static const uint16_t bitalloc_25_codes_b[25] =
-{
-    0x001C, 0x000F, 0x0005, 0x0000, 0x0030, 0x0036, 0x000E, 0x0019,
-    0x0001, 0x0008, 0x000E, 0x0001, 0x0005, 0x0002, 0x000F, 0x0009,
-    0x0006, 0x001A, 0x000F, 0x0037, 0x0031, 0x0001, 0x0006, 0x0004,
-    0x001D,
-};
-static const uint16_t bitalloc_25_codes_c[25] =
-{
-    0x004C, 0x0027, 0x006D, 0x0028, 0x0037, 0x000E, 0x0015, 0x0000,
-    0x0005, 0x0008, 0x000B, 0x000E, 0x0001, 0x000F, 0x000C, 0x0009,
-    0x0006, 0x0001, 0x001A, 0x000F, 0x0008, 0x0029, 0x0012, 0x006C,
-    0x004D,
-};
-static const uint16_t bitalloc_25_codes_d[25] =
-{
-    0x0780, 0x0782, 0x03C2, 0x01E2, 0x00FE, 0x0079, 0x003D, 0x001C,
-    0x000C, 0x0004, 0x0000, 0x0006, 0x0002, 0x0007, 0x0001, 0x0005,
-    0x000D, 0x001D, 0x003E, 0x007E, 0x00FF, 0x01E3, 0x03C3, 0x0783,
-    0x0781,
-};
-static const uint16_t bitalloc_25_codes_e[25] =
-{
-    0x003C, 0x0092, 0x0018, 0x001F, 0x004E, 0x000D, 0x0025, 0x0004,
-    0x0010, 0x0000, 0x000A, 0x0002, 0x0003, 0x0003, 0x000B, 0x0001,
-    0x0011, 0x0005, 0x0026, 0x000E, 0x004F, 0x0048, 0x0019, 0x0093,
-    0x003D,
-};
-static const uint16_t bitalloc_25_codes_f[25] =
-{
-    0x0324, 0x0193, 0x00CE, 0x0065, 0x0024, 0x000C, 0x0013, 0x0004,
-    0x0007, 0x000A, 0x000D, 0x000F, 0x0001, 0x0000, 0x000E, 0x000B,
-    0x0008, 0x0005, 0x0018, 0x000D, 0x0025, 0x0066, 0x00CF, 0x00C8,
-    0x0325,
-};
-static const uint16_t bitalloc_25_codes_g[25] =
-{
-    0x03A8, 0x03AE, 0x01D5, 0x0094, 0x0014, 0x004B, 0x000B, 0x003B,
-    0x0013, 0x0003, 0x000F, 0x0005, 0x0001, 0x0006, 0x0000, 0x0008,
-    0x001C, 0x0004, 0x0024, 0x0074, 0x0015, 0x0095, 0x01D6, 0x03AF,
-    0x03A9,
-};
-static const uint8_t bitalloc_25_bits_a[25] =
-{
-    14, 13, 11,  9,  8,  7,  6,  5,  4,  4,  3,  3,  3,  3,  3,  4,
-     4,  5,  6,  7,  8,  8, 10, 12, 14,
-};
-static const uint8_t bitalloc_25_bits_b[25] =
-{
-     9,  8,  7,  6,  6,  6,  5,  5,  4,  4,  4,  3,  3,  3,  4,  4,
-     4,  5,  5,  6,  6,  6,  7,  7,  9,
-};
-static const uint8_t bitalloc_25_bits_c[25] =
-{
-     8,  7,  7,  6,  6,  5,  5,  4,  4,  4,  4,  4,  3,  4,  4,  4,
-     4,  4,  5,  5,  5,  6,  6,  7,  8,
-};
-static const uint8_t bitalloc_25_bits_d[25] =
-{
-    12, 12, 11, 10,  9,  8,  7,  6,  5,  4,  3,  3,  2,  3,  3,  4,
-     5,  6,  7,  8,  9, 10, 11, 12, 12,
-};
-static const uint8_t bitalloc_25_bits_e[25] =
-{
-     8,  8,  7,  7,  7,  6,  6,  5,  5,  4,  4,  3,  2,  3,  4,  4,
-     5,  5,  6,  6,  7,  7,  7,  8,  8,
-};
-static const uint8_t bitalloc_25_bits_f[25] =
-{
-    10,  9,  8,  7,  6,  5,  5,  4,  4,  4,  4,  4,  3,  3,  4,  4,
-     4,  4,  5,  5,  6,  7,  8,  8, 10,
-};
-static const uint8_t bitalloc_25_bits_g[25] =
-{
-    10, 10,  9,  8,  7,  7,  6,  6,  5,  4,  4,  3,  2,  3,  3,  4,
-     5,  5,  6,  7,  7,  8,  9, 10, 10,
-};
-
-static const uint16_t bitalloc_33_codes_a[33] =
-{
-    0x1580, 0x1582, 0x0AC2, 0x0562, 0x02B2, 0x015E, 0x00AD, 0x0054,
-    0x001C, 0x003C, 0x000F, 0x001F, 0x0008, 0x000B, 0x000D, 0x0000,
-    0x0002, 0x0001, 0x000E, 0x000C, 0x0009, 0x0006, 0x0014, 0x003D,
-    0x001D, 0x0055, 0x00AE, 0x015F, 0x02B3, 0x0563, 0x0AC3, 0x1583,
-    0x1581,
-};
-static const uint16_t bitalloc_33_codes_b[33] =
-{
-    0x030C, 0x0187, 0x006D, 0x0028, 0x0037, 0x0066, 0x0015, 0x0031,
-    0x0000, 0x000B, 0x0012, 0x001A, 0x0001, 0x0007, 0x000A, 0x000E,
-    0x0001, 0x000F, 0x000B, 0x0008, 0x0004, 0x001B, 0x0013, 0x000C,
-    0x0001, 0x0032, 0x001A, 0x0067, 0x0060, 0x0029, 0x00C2, 0x006C,
-    0x030D,
-};
-static const uint16_t bitalloc_33_codes_c[33] =
-{
-    0x00CC, 0x0067, 0x0005, 0x0070, 0x0003, 0x001A, 0x0039, 0x003F,
-    0x000A, 0x0012, 0x0018, 0x001D, 0x0001, 0x0003, 0x0007, 0x000A,
-    0x000D, 0x000B, 0x0008, 0x0004, 0x0002, 0x001E, 0x0019, 0x0013,
-    0x000B, 0x0000, 0x003E, 0x001B, 0x0018, 0x0071, 0x0032, 0x0004,
-    0x00CD,
-};
-static const uint16_t bitalloc_33_codes_d[33] =
-{
-    0x3AF8, 0x3AFA, 0x1D7E, 0x0EBC, 0x075C, 0x03AC, 0x01D4, 0x0094,
-    0x0014, 0x004B, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005,
-    0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x0074,
-    0x0015, 0x0095, 0x01D5, 0x03AD, 0x075D, 0x0EBD, 0x1D7F, 0x3AFB,
-    0x3AF9,
-};
-static const uint16_t bitalloc_33_codes_e[33] =
-{
-    0x01C8, 0x01E6, 0x0064, 0x00E2, 0x00E5, 0x0030, 0x0033, 0x0073,
-    0x007A, 0x001A, 0x003A, 0x0002, 0x001A, 0x001F, 0x0007, 0x0001,
-    0x0002, 0x0002, 0x000C, 0x0000, 0x001B, 0x0003, 0x003B, 0x001B,
-    0x007B, 0x0078, 0x0070, 0x0031, 0x00F2, 0x00E3, 0x0065, 0x01E7,
-    0x01C9,
-};
-static const uint16_t bitalloc_33_codes_f[33] =
-{
-    0x0724, 0x0393, 0x01CE, 0x00E5, 0x002C, 0x0008, 0x0017, 0x003E,
-    0x0005, 0x0014, 0x001D, 0x0000, 0x0003, 0x0006, 0x0008, 0x000B,
-    0x000D, 0x000C, 0x0009, 0x0007, 0x0004, 0x0001, 0x001E, 0x0015,
-    0x000A, 0x003F, 0x0038, 0x0009, 0x002D, 0x00E6, 0x01CF, 0x01C8,
-    0x0725,
-};
-static const uint16_t bitalloc_33_codes_g[33] =
-{
-    0x0284, 0x0042, 0x0140, 0x0143, 0x003E, 0x00BE, 0x0011, 0x0051,
-    0x0009, 0x0029, 0x0005, 0x0015, 0x0000, 0x0008, 0x000E, 0x0002,
-    0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0016, 0x0006, 0x002E,
-    0x000E, 0x005E, 0x001E, 0x00BF, 0x003F, 0x0020, 0x0141, 0x0043,
-    0x0285,
-};
-static const uint8_t bitalloc_33_bits_a[33] =
-{
-    13, 13, 12, 11, 10,  9,  8,  7,  6,  6,  5,  5,  4,  4,  4,  3,
-     3,  3,  4,  4,  4,  4,  5,  6,  6,  7,  8,  9, 10, 11, 12, 13,
-    13,
-};
-static const uint8_t bitalloc_33_bits_b[33] =
-{
-    10,  9,  8,  7,  7,  7,  6,  6,  5,  5,  5,  5,  4,  4,  4,  4,
-     3,  4,  4,  4,  4,  5,  5,  5,  5,  6,  6,  7,  7,  7,  8,  8,
-    10,
-};
-static const uint8_t bitalloc_33_bits_c[33] =
-{
-     9,  8,  7,  7,  6,  6,  6,  6,  5,  5,  5,  5,  4,  4,  4,  4,
-     4,  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  7,  7,  7,
-     9,
-};
-static const uint8_t bitalloc_33_bits_d[33] =
-{
-    14, 14, 13, 12, 11, 10,  9,  8,  7,  7,  6,  6,  5,  4,  4,  3,
-     2,  3,  3,  4,  5,  5,  6,  7,  7,  8,  9, 10, 11, 12, 13, 14,
-    14,
-};
-static const uint8_t bitalloc_33_bits_e[33] =
-{
-     9,  9,  8,  8,  8,  7,  7,  7,  7,  6,  6,  5,  5,  5,  4,  3,
-     2,  3,  4,  4,  5,  5,  6,  6,  7,  7,  7,  7,  8,  8,  8,  9,
-     9,
-};
-static const uint8_t bitalloc_33_bits_f[33] =
-{
-    11, 10,  9,  8,  7,  6,  6,  6,  5,  5,  5,  4,  4,  4,  4,  4,
-     4,  4,  4,  4,  4,  4,  5,  5,  5,  6,  6,  6,  7,  8,  9,  9,
-    11,
-};
-static const uint8_t bitalloc_33_bits_g[33] =
-{
-    10,  9,  9,  9,  8,  8,  7,  7,  6,  6,  5,  5,  4,  4,  4,  3,
-     3,  3,  4,  4,  4,  5,  5,  6,  6,  7,  7,  8,  8,  8,  9,  9,
-    10,
-};
-
-static const uint16_t bitalloc_65_codes_a[65] =
-{
-    0x9E5C, 0x9E5E, 0x4F2C, 0x2794, 0x13C4, 0x1E44, 0x09E3, 0x0F23,
-    0x04F3, 0x0792, 0x027E, 0x03CE, 0x013D, 0x01E5, 0x009C, 0x00CC,
-    0x0040, 0x0058, 0x0067, 0x001E, 0x0021, 0x002D, 0x003D, 0x0007,
-    0x0011, 0x0014, 0x0017, 0x001A, 0x001C, 0x001F, 0x0001, 0x0004,
-    0x0006, 0x0005, 0x0002, 0x0000, 0x001D, 0x001B, 0x0018, 0x0015,
-    0x0012, 0x000E, 0x0006, 0x0032, 0x0026, 0x001F, 0x0078, 0x0059,
-    0x0041, 0x00CD, 0x009D, 0x01E6, 0x013E, 0x03CF, 0x027F, 0x0793,
-    0x0790, 0x04F0, 0x09E4, 0x1E45, 0x13C5, 0x2795, 0x4F2D, 0x9E5F,
-    0x9E5D,
-};
-static const uint16_t bitalloc_65_codes_b[65] =
-{
-    0x0A8C, 0x0547, 0x01B5, 0x0008, 0x00DB, 0x0152, 0x0005, 0x000B,
-    0x008E, 0x00AE, 0x00E4, 0x0003, 0x0037, 0x0039, 0x0055, 0x006C,
-    0x0073, 0x0003, 0x0015, 0x001D, 0x0028, 0x0030, 0x0037, 0x003E,
-    0x0006, 0x000B, 0x000F, 0x0012, 0x0016, 0x0019, 0x001D, 0x0001,
-    0x0004, 0x0002, 0x001E, 0x001A, 0x0017, 0x0013, 0x0010, 0x000C,
-    0x0007, 0x003F, 0x0038, 0x0031, 0x0029, 0x0022, 0x001A, 0x0014,
-    0x0000, 0x006D, 0x0056, 0x0046, 0x0038, 0x0004, 0x00E5, 0x00AF,
-    0x008F, 0x006C, 0x000A, 0x0153, 0x0150, 0x0009, 0x02A2, 0x01B4,
-    0x0A8D,
-};
-static const uint16_t bitalloc_65_codes_c[65] =
-{
-    0x045C, 0x022F, 0x03F5, 0x01BC, 0x01FB, 0x0059, 0x00D0, 0x00DF,
-    0x000A, 0x002D, 0x002F, 0x0052, 0x0069, 0x0078, 0x007F, 0x000A,
-    0x0010, 0x001C, 0x0023, 0x002A, 0x0035, 0x003A, 0x003D, 0x0000,
-    0x0003, 0x0006, 0x0009, 0x000C, 0x000F, 0x0012, 0x0016, 0x0018,
-    0x001C, 0x0019, 0x0017, 0x0013, 0x0010, 0x000D, 0x000A, 0x0007,
-    0x0004, 0x0001, 0x003E, 0x003B, 0x0036, 0x002B, 0x0028, 0x001D,
-    0x0011, 0x000B, 0x0004, 0x0079, 0x006E, 0x0053, 0x0044, 0x002E,
-    0x000B, 0x00FC, 0x00D1, 0x008A, 0x0058, 0x01BD, 0x0116, 0x03F4,
-    0x045D,
-};
-static const uint16_t bitalloc_65_codes_d[65] =
-{
-    0x70B0, 0x70B2, 0x70B4, 0x2852, 0x385B, 0x142E, 0x1C2E, 0x0A15,
-    0x0E14, 0x0214, 0x0704, 0x0104, 0x010B, 0x0383, 0x0083, 0x0143,
-    0x01C3, 0x0043, 0x00A2, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012,
-    0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000,
-    0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B,
-    0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A3, 0x00A0,
-    0x0040, 0x01C0, 0x0084, 0x0384, 0x0284, 0x0105, 0x0705, 0x0215,
-    0x0E15, 0x0A16, 0x1C2F, 0x142F, 0x1428, 0x2853, 0x70B5, 0x70B3,
-    0x70B1,
-};
-static const uint16_t bitalloc_65_codes_e[65] =
-{
-    0x032C, 0x0332, 0x0378, 0x037E, 0x008C, 0x014A, 0x0188, 0x0197,
-    0x019E, 0x01BD, 0x0044, 0x0047, 0x00AA, 0x00C5, 0x00CD, 0x00DC,
-    0x001C, 0x002C, 0x0053, 0x0063, 0x0068, 0x0008, 0x000F, 0x0017,
-    0x002B, 0x0035, 0x0005, 0x0009, 0x0016, 0x001C, 0x0006, 0x000F,
-    0x0004, 0x0000, 0x0007, 0x001D, 0x0017, 0x000A, 0x0006, 0x0036,
-    0x0030, 0x0028, 0x0010, 0x0009, 0x0069, 0x0064, 0x0054, 0x002D,
-    0x001D, 0x00DD, 0x00CE, 0x00CA, 0x00AB, 0x00A4, 0x0045, 0x01BE,
-    0x019F, 0x0198, 0x0189, 0x014B, 0x008D, 0x037F, 0x0379, 0x0333,
-    0x032D,
-};
-static const uint16_t bitalloc_65_codes_f[65] =
-{
-    0x0FE0, 0x0FE2, 0x0FE8, 0x0FEA, 0x0FEC, 0x0FEE, 0x0FF0, 0x0FF2,
-    0x0FF4, 0x2FF2, 0x07F2, 0x07FB, 0x03F6, 0x0BFA, 0x0BFD, 0x01FF,
-    0x05FF, 0x02FC, 0x007C, 0x017C, 0x003C, 0x00BC, 0x001C, 0x005C,
-    0x000C, 0x002C, 0x0004, 0x0014, 0x0000, 0x0008, 0x000E, 0x0002,
-    0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0015, 0x0005, 0x002D,
-    0x000D, 0x005D, 0x001D, 0x00BD, 0x003D, 0x017D, 0x007D, 0x02FD,
-    0x00FC, 0x05FC, 0x01FA, 0x0BFB, 0x03F7, 0x17F8, 0x07F3, 0x2FF3,
-    0x0FF5, 0x0FF3, 0x0FF1, 0x0FEF, 0x0FED, 0x0FEB, 0x0FE9, 0x0FE3,
-    0x0FE1,
-};
-static const uint16_t bitalloc_65_codes_g[65] =
-{
-    0x010C, 0x038A, 0x0608, 0x0786, 0x0084, 0x0087, 0x0302, 0x0305,
-    0x0040, 0x00E0, 0x00E3, 0x0183, 0x001E, 0x005E, 0x009E, 0x00DE,
-    0x00F1, 0x0011, 0x0039, 0x0061, 0x0079, 0x0009, 0x001D, 0x0031,
-    0x003D, 0x0005, 0x000F, 0x0019, 0x001F, 0x0003, 0x0006, 0x000A,
-    0x000E, 0x000B, 0x0008, 0x0004, 0x0000, 0x001A, 0x0012, 0x000A,
-    0x0002, 0x0036, 0x0026, 0x0016, 0x0006, 0x006E, 0x004E, 0x002E,
-    0x000E, 0x00DF, 0x009F, 0x005F, 0x001F, 0x01E0, 0x0180, 0x00E1,
-    0x0041, 0x03C2, 0x0303, 0x01C4, 0x0085, 0x0787, 0x0609, 0x038B,
-    0x010D,
-};
-static const uint8_t bitalloc_65_bits_a[65] =
-{
-    16, 16, 15, 14, 13, 13, 12, 12, 11, 11, 10, 10,  9,  9,  8,  8,
-     7,  7,  7,  6,  6,  6,  6,  5,  5,  5,  5,  5,  5,  5,  4,  4,
-     4,  4,  4,  4,  5,  5,  5,  5,  5,  5,  5,  6,  6,  6,  7,  7,
-     7,  8,  8,  9,  9, 10, 10, 11, 11, 11, 12, 13, 13, 14, 15, 16,
-    16,
-};
-static const uint8_t bitalloc_65_bits_b[65] =
-{
-    12, 11, 10,  9,  9,  9,  8,  8,  8,  8,  8,  7,  7,  7,  7,  7,
-     7,  6,  6,  6,  6,  6,  6,  6,  5,  5,  5,  5,  5,  5,  5,  4,
-     4,  4,  5,  5,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  6,  6,
-     6,  7,  7,  7,  7,  7,  8,  8,  8,  8,  8,  9,  9,  9, 10, 10,
-    12,
-};
-static const uint8_t bitalloc_65_bits_c[65] =
-{
-    11, 10, 10,  9,  9,  8,  8,  8,  7,  7,  7,  7,  7,  7,  7,  6,
-     6,  6,  6,  6,  6,  6,  6,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  6,
-     6,  6,  6,  7,  7,  7,  7,  7,  7,  8,  8,  8,  8,  9,  9, 10,
-    11,
-};
-static const uint8_t bitalloc_65_bits_d[65] =
-{
-    15, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 10,  9,  9,
-     9,  8,  8,  8,  7,  7,  7,  6,  6,  6,  5,  5,  5,  4,  4,  3,
-     3,  3,  4,  4,  5,  5,  5,  6,  6,  6,  7,  7,  7,  8,  8,  8,
-     8,  9,  9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 15, 15,
-    15,
-};
-static const uint8_t bitalloc_65_bits_e[65] =
-{
-    10, 10, 10, 10,  9,  9,  9,  9,  9,  9,  8,  8,  8,  8,  8,  8,
-     7,  7,  7,  7,  7,  6,  6,  6,  6,  6,  5,  5,  5,  5,  4,  4,
-     3,  3,  4,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,  7,  7,
-     7,  8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9, 10, 10, 10,
-    10,
-};
-static const uint8_t bitalloc_65_bits_f[65] =
-{
-    14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 12, 12, 12, 11,
-    11, 10,  9,  9,  8,  8,  7,  7,  6,  6,  5,  5,  4,  4,  4,  3,
-     3,  3,  4,  4,  4,  5,  5,  6,  6,  7,  7,  8,  8,  9,  9, 10,
-    10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-    14,
-};
-static const uint8_t bitalloc_65_bits_g[65] =
-{
-    11, 11, 11, 11, 10, 10, 10, 10,  9,  9,  9,  9,  8,  8,  8,  8,
-     8,  7,  7,  7,  7,  6,  6,  6,  6,  5,  5,  5,  5,  4,  4,  4,
-     4,  4,  4,  4,  4,  5,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,
-     7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11, 11, 11,
-    11,
-};
-
-static const uint16_t bitalloc_129_codes_a[129] =
-{
-    0x0660, 0x0666, 0x06EC, 0x0722, 0x0760, 0x076E, 0x004C, 0x004E,
-    0x00F4, 0x010A, 0x0148, 0x0156, 0x01D4, 0x01F2, 0x0331, 0x0370,
-    0x0377, 0x0396, 0x03B1, 0x0024, 0x0064, 0x007B, 0x008A, 0x00A5,
-    0x00D4, 0x00EB, 0x00FA, 0x019A, 0x01B9, 0x01C9, 0x01D9, 0x0010,
-    0x0030, 0x0033, 0x0043, 0x0053, 0x006B, 0x007A, 0x00CA, 0x00D2,
-    0x00DE, 0x00E6, 0x00F6, 0x000E, 0x001F, 0x0023, 0x002B, 0x003B,
-    0x003F, 0x0067, 0x0070, 0x0077, 0x0005, 0x000D, 0x0012, 0x001B,
-    0x002C, 0x0035, 0x003A, 0x0004, 0x000B, 0x0017, 0x001F, 0x0009,
-    0x0008, 0x000A, 0x0000, 0x0018, 0x000C, 0x0005, 0x003C, 0x0036,
-    0x002D, 0x001C, 0x0013, 0x000E, 0x0006, 0x007A, 0x0071, 0x0068,
-    0x0064, 0x003C, 0x0034, 0x0028, 0x0020, 0x000F, 0x00F7, 0x00E7,
-    0x00DF, 0x00D3, 0x00CB, 0x007B, 0x0074, 0x0054, 0x0044, 0x003C,
-    0x0031, 0x0011, 0x01DA, 0x01CA, 0x01BA, 0x019B, 0x00FB, 0x00F8,
-    0x00D5, 0x00AA, 0x008B, 0x0084, 0x0065, 0x0025, 0x03B6, 0x0397,
-    0x0390, 0x0371, 0x0332, 0x01F3, 0x01D5, 0x0157, 0x0149, 0x010B,
-    0x00F5, 0x004F, 0x004D, 0x076F, 0x0761, 0x0723, 0x06ED, 0x0667,
-    0x0661,
-};
-static const uint16_t bitalloc_129_codes_b[129] =
-{
-    0x29DC, 0x14EF, 0x0455, 0x0E9C, 0x022B, 0x0489, 0x0740, 0x074F,
-    0x0172, 0x0245, 0x0247, 0x030A, 0x03A1, 0x001C, 0x008B, 0x00D6,
-    0x010C, 0x0148, 0x014F, 0x0186, 0x01D1, 0x0008, 0x000F, 0x0046,
-    0x005D, 0x0078, 0x0087, 0x0096, 0x00A5, 0x00BC, 0x00D8, 0x00DE,
-    0x00F6, 0x0005, 0x0014, 0x0024, 0x002F, 0x003A, 0x003D, 0x0049,
-    0x0050, 0x0058, 0x005F, 0x0066, 0x006D, 0x0075, 0x007C, 0x0004,
-    0x000B, 0x0013, 0x0018, 0x001B, 0x001F, 0x0022, 0x0026, 0x002A,
-    0x002D, 0x0031, 0x0034, 0x0038, 0x003B, 0x003F, 0x0003, 0x0006,
-    0x000A, 0x0007, 0x0004, 0x0000, 0x003C, 0x0039, 0x0035, 0x0032,
-    0x002E, 0x002B, 0x0027, 0x0023, 0x0020, 0x001C, 0x0019, 0x0016,
-    0x0010, 0x0005, 0x007D, 0x007A, 0x006E, 0x0067, 0x0060, 0x0059,
-    0x0051, 0x004A, 0x0042, 0x003B, 0x0034, 0x0025, 0x0015, 0x0006,
-    0x00F7, 0x00DF, 0x00D9, 0x00BD, 0x00A6, 0x0097, 0x0090, 0x0079,
-    0x006A, 0x0047, 0x0044, 0x0009, 0x01D2, 0x0187, 0x0184, 0x0149,
-    0x010D, 0x00D7, 0x00B8, 0x001D, 0x03A6, 0x030B, 0x029C, 0x0246,
-    0x0173, 0x0114, 0x0741, 0x053A, 0x0488, 0x0E9D, 0x0A76, 0x0454,
-    0x29DD,
-};
-static const uint16_t bitalloc_129_codes_c[129] =
-{
-    0x0E5C, 0x072F, 0x001D, 0x0724, 0x000F, 0x010D, 0x0324, 0x0393,
-    0x03E9, 0x0080, 0x0087, 0x00FA, 0x0164, 0x0193, 0x01DE, 0x01F5,
-    0x0010, 0x002A, 0x0041, 0x0064, 0x0073, 0x008E, 0x00A4, 0x00B3,
-    0x00D6, 0x00E5, 0x00F4, 0x00FB, 0x0002, 0x0009, 0x0013, 0x001E,
-    0x0026, 0x002C, 0x0033, 0x003F, 0x0041, 0x004C, 0x0053, 0x005E,
-    0x0065, 0x0070, 0x0073, 0x0078, 0x007B, 0x007E, 0x0002, 0x0005,
-    0x0007, 0x000B, 0x000D, 0x0011, 0x0014, 0x0017, 0x001A, 0x001D,
-    0x0021, 0x0024, 0x0027, 0x002A, 0x002D, 0x0030, 0x0033, 0x0036,
-    0x003A, 0x0037, 0x0034, 0x0031, 0x002E, 0x002B, 0x0028, 0x0025,
-    0x0022, 0x001E, 0x001B, 0x0018, 0x0015, 0x0012, 0x000E, 0x000C,
-    0x0008, 0x0006, 0x0003, 0x007F, 0x007C, 0x0079, 0x0076, 0x0071,
-    0x006A, 0x005F, 0x0058, 0x004D, 0x0046, 0x0040, 0x0038, 0x002D,
-    0x0027, 0x001F, 0x0014, 0x0012, 0x0003, 0x0000, 0x00F5, 0x00EE,
-    0x00D7, 0x00C8, 0x00A5, 0x008F, 0x007C, 0x0065, 0x0042, 0x002B,
-    0x0011, 0x0002, 0x01DF, 0x01C8, 0x0165, 0x00FB, 0x00E4, 0x0081,
-    0x0006, 0x03E8, 0x0325, 0x01CA, 0x010C, 0x0725, 0x0396, 0x001C,
-    0x0E5D,
-};
-static const uint16_t bitalloc_129_codes_d[129] =
-{
-    0xA598, 0xA59A, 0xA59C, 0xA59E, 0xC598, 0xE586, 0x3ACC, 0x52CA,
-    0x62CD, 0x0D48, 0x1D67, 0x2978, 0x3167, 0x3966, 0x06A5, 0x0EBC,
-    0x14BD, 0x1CB1, 0x0350, 0x0353, 0x075F, 0x0A5F, 0x0C5E, 0x0E5E,
-    0x01AE, 0x03AD, 0x052D, 0x062D, 0x072D, 0x00D5, 0x01D4, 0x0294,
-    0x0314, 0x0394, 0x0014, 0x0094, 0x0114, 0x0174, 0x01B4, 0x01F4,
-    0x000B, 0x004B, 0x008B, 0x00BB, 0x00DB, 0x00FB, 0x001B, 0x003B,
-    0x0053, 0x0063, 0x0073, 0x0003, 0x0013, 0x0023, 0x002F, 0x0037,
-    0x003F, 0x0007, 0x000F, 0x0015, 0x0019, 0x001D, 0x0001, 0x0005,
-    0x0009, 0x0006, 0x0002, 0x001E, 0x001A, 0x0016, 0x0010, 0x0008,
-    0x0000, 0x0038, 0x0030, 0x0028, 0x001C, 0x000C, 0x007C, 0x006C,
-    0x005C, 0x0044, 0x0024, 0x0004, 0x00E4, 0x00C4, 0x00A4, 0x0074,
-    0x0034, 0x01F5, 0x01B5, 0x0175, 0x0115, 0x0095, 0x0015, 0x0395,
-    0x0315, 0x0295, 0x01D5, 0x00D6, 0x072E, 0x062E, 0x052E, 0x03AE,
-    0x01AF, 0x0E5F, 0x0C5F, 0x0C58, 0x0A58, 0x0758, 0x0351, 0x1CB2,
-    0x18B2, 0x0EBD, 0x0EB2, 0x3967, 0x3960, 0x2979, 0x2964, 0x0D49,
-    0x72C2, 0x52CB, 0x3ACD, 0xE587, 0xC599, 0xA59F, 0xA59D, 0xA59B,
-    0xA599,
-};
-static const uint16_t bitalloc_129_codes_e[129] =
-{
-    0xA13C, 0xC720, 0xA13F, 0xA13E, 0xA13D, 0xE722, 0x5090, 0x6393,
-    0x7392, 0x2849, 0x31CE, 0x39CE, 0x1425, 0x18E5, 0x1CE5, 0x0844,
-    0x0A1C, 0x0C7C, 0x036C, 0x0423, 0x050F, 0x063F, 0x01B7, 0x0216,
-    0x0285, 0x031D, 0x039D, 0x0109, 0x0140, 0x0180, 0x01C8, 0x01CF,
-    0x007A, 0x008A, 0x00A2, 0x00C1, 0x00E5, 0x0014, 0x0037, 0x0043,
-    0x004E, 0x0056, 0x0061, 0x006C, 0x007C, 0x000B, 0x001C, 0x001F,
-    0x0023, 0x0025, 0x0029, 0x002C, 0x002E, 0x0032, 0x0034, 0x0037,
-    0x003A, 0x003C, 0x003F, 0x0001, 0x0003, 0x0006, 0x0008, 0x000A,
-    0x000C, 0x000B, 0x0009, 0x0007, 0x0004, 0x0002, 0x0000, 0x003D,
-    0x003B, 0x0038, 0x0035, 0x0033, 0x002F, 0x002D, 0x002A, 0x0026,
-    0x0024, 0x0020, 0x001D, 0x001A, 0x007D, 0x006D, 0x0062, 0x0057,
-    0x004F, 0x0044, 0x003C, 0x0015, 0x00E6, 0x00C6, 0x00A3, 0x008B,
-    0x007B, 0x006C, 0x01C9, 0x0181, 0x0141, 0x010A, 0x00DA, 0x031E,
-    0x0286, 0x0217, 0x0210, 0x0738, 0x0638, 0x0508, 0x036D, 0x0C7D,
-    0x0A1D, 0x0845, 0x1CE6, 0x18E6, 0x1426, 0x39CF, 0x31CF, 0x284E,
-    0x7393, 0x7390, 0x5091, 0xE723, 0xC724, 0xC725, 0xC722, 0xC723,
-    0xC721,
-};
-static const uint16_t bitalloc_129_codes_f[129] =
-{
-    0x762C, 0x3B17, 0x1555, 0x0608, 0x0AAB, 0x0FF2, 0x0305, 0x0307,
-    0x0763, 0x0046, 0x010C, 0x01BC, 0x02AB, 0x03B6, 0x03FD, 0x0080,
-    0x0087, 0x00DF, 0x0156, 0x01D9, 0x01F8, 0x01FF, 0x002A, 0x0041,
-    0x0061, 0x0094, 0x00D4, 0x00EA, 0x00F2, 0x00FD, 0x0009, 0x000B,
-    0x001A, 0x0026, 0x0031, 0x0040, 0x004B, 0x006B, 0x0073, 0x0077,
-    0x007A, 0x007C, 0x0000, 0x0002, 0x0006, 0x0008, 0x000B, 0x000E,
-    0x0011, 0x0014, 0x0016, 0x0019, 0x001C, 0x001E, 0x0021, 0x0023,
-    0x0026, 0x0028, 0x002B, 0x002D, 0x002F, 0x0031, 0x0033, 0x0036,
-    0x0038, 0x0037, 0x0034, 0x0032, 0x0030, 0x002E, 0x002C, 0x0029,
-    0x0027, 0x0024, 0x0022, 0x001F, 0x001D, 0x001A, 0x0017, 0x0015,
-    0x0012, 0x000F, 0x000C, 0x0009, 0x0007, 0x0003, 0x0001, 0x007D,
-    0x007B, 0x0078, 0x0074, 0x0072, 0x0054, 0x0041, 0x0036, 0x0027,
-    0x001B, 0x0014, 0x000A, 0x00FE, 0x00F3, 0x00EB, 0x00D5, 0x0095,
-    0x006E, 0x0042, 0x002B, 0x0010, 0x01F9, 0x01DA, 0x0157, 0x0154,
-    0x00C0, 0x0081, 0x0022, 0x03B7, 0x03B0, 0x01BD, 0x010D, 0x0047,
-    0x07F8, 0x0554, 0x0306, 0x0FF3, 0x0EC4, 0x0609, 0x1D8A, 0x1554,
-    0x762D,
-};
-static const uint16_t bitalloc_129_codes_g[129] =
-{
-    0x1E20, 0x1E5E, 0x031C, 0x051A, 0x0718, 0x0916, 0x0B14, 0x0D12,
-    0x0F11, 0x0090, 0x018F, 0x028E, 0x038D, 0x048C, 0x058B, 0x068A,
-    0x0789, 0x0049, 0x00C8, 0x0148, 0x01C7, 0x0247, 0x02C6, 0x0346,
-    0x03C5, 0x0025, 0x0065, 0x00A5, 0x00E4, 0x0124, 0x0164, 0x01A4,
-    0x01E3, 0x0013, 0x0033, 0x0053, 0x0073, 0x0093, 0x00B3, 0x00D3,
-    0x00F3, 0x000A, 0x001A, 0x002A, 0x003A, 0x004A, 0x005A, 0x006A,
-    0x007A, 0x0006, 0x000E, 0x0016, 0x001E, 0x0026, 0x002E, 0x0036,
-    0x003E, 0x0004, 0x0008, 0x000C, 0x0010, 0x0014, 0x0018, 0x001C,
-    0x0000, 0x001D, 0x0019, 0x0015, 0x0011, 0x000D, 0x0009, 0x0005,
-    0x003F, 0x0037, 0x002F, 0x0027, 0x001F, 0x0017, 0x000F, 0x0007,
-    0x007B, 0x006B, 0x005B, 0x004B, 0x003B, 0x002B, 0x001B, 0x000B,
-    0x0008, 0x00F0, 0x00D0, 0x00B0, 0x0090, 0x0070, 0x0050, 0x0030,
-    0x01E4, 0x01A5, 0x0165, 0x0125, 0x00E5, 0x00E2, 0x00A2, 0x0062,
-    0x03CA, 0x0347, 0x02C7, 0x02C4, 0x0244, 0x0149, 0x00C9, 0x00C6,
-    0x0796, 0x068B, 0x0688, 0x048D, 0x048A, 0x028F, 0x028C, 0x0091,
-    0x0F2E, 0x0D13, 0x0B15, 0x0917, 0x0719, 0x051B, 0x031D, 0x1E5F,
-    0x1E21,
-};
-static const uint8_t bitalloc_129_bits_a[129] =
-{
-    11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  8,
-     8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  7,  7,  7,  7,  7,
-     7,  7,  7,  7,  6,  6,  6,  6,  6,  6,  6,  5,  5,  5,  5,  4,
-     4,  4,  4,  5,  5,  5,  6,  6,  6,  6,  6,  6,  6,  7,  7,  7,
-     7,  7,  7,  7,  7,  7,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11,
-    11,
-};
-static const uint8_t bitalloc_129_bits_b[129] =
-{
-    14, 13, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10,  9,  9,  9,
-     9,  9,  9,  9,  9,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-     8,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  6,
-     6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  5,  5,
-     5,  5,  5,  5,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,
-     6,  6,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,
-     8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  9,  9,  9,  9,
-     9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12,
-    14,
-};
-static const uint8_t bitalloc_129_bits_c[129] =
-{
-    13, 12, 11, 11, 10, 10, 10, 10, 10,  9,  9,  9,  9,  9,  9,  9,
-     8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  7,  7,  7,  7,
-     7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  6,  6,
-     6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,
-     6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,
-     6,  6,  6,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,
-     7,  7,  7,  7,  7,  7,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 11, 11, 11,
-    13,
-};
-static const uint8_t bitalloc_129_bits_d[129] =
-{
-    16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13,
-    13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 10, 10, 10,
-    10, 10,  9,  9,  9,  9,  9,  9,  8,  8,  8,  8,  8,  8,  7,  7,
-     7,  7,  7,  6,  6,  6,  6,  6,  6,  5,  5,  5,  5,  5,  4,  4,
-     4,  4,  4,  5,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
-     7,  7,  7,  7,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9, 10,
-    10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13,
-    13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16,
-    16,
-};
-static const uint8_t bitalloc_129_bits_e[129] =
-{
-    16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 13, 13, 13, 12,
-    12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10,  9,  9,  9,  9,  9,
-     8,  8,  8,  8,  8,  7,  7,  7,  7,  7,  7,  7,  7,  6,  6,  6,
-     6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  5,  5,  5,  5,  5,
-     5,  5,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  6,  6,  6,  6,
-     6,  6,  6,  6,  7,  7,  7,  7,  7,  7,  7,  7,  8,  8,  8,  8,
-     8,  8,  9,  9,  9,  9,  9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
-    12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16,
-    16,
-};
-static const uint8_t bitalloc_129_bits_f[129] =
-{
-    15, 14, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 10, 10, 10,  9,
-     9,  9,  9,  9,  9,  9,  8,  8,  8,  8,  8,  8,  8,  8,  7,  7,
-     7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  6,  6,  6,  6,  6,  6,
-     6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,
-     6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,
-     6,  6,  6,  6,  6,  6,  6,  7,  7,  7,  7,  7,  7,  7,  7,  7,
-     7,  7,  7,  8,  8,  8,  8,  8,  8,  8,  8,  8,  9,  9,  9,  9,
-     9,  9,  9, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
-    15,
-};
-static const uint8_t bitalloc_129_bits_g[129] =
-{
-    13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11,
-    11, 10, 10, 10, 10, 10, 10, 10, 10,  9,  9,  9,  9,  9,  9,  9,
-     9,  8,  8,  8,  8,  8,  8,  8,  8,  7,  7,  7,  7,  7,  7,  7,
-     7,  6,  6,  6,  6,  6,  6,  6,  6,  5,  5,  5,  5,  5,  5,  5,
-     4,  5,  5,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  6,  6,  6,
-     7,  7,  7,  7,  7,  7,  7,  7,  7,  8,  8,  8,  8,  8,  8,  8,
-     9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10, 10,
-    11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13,
-    13,
-};
-
-static const uint8_t bitalloc_sizes[10] = { 3, 5, 7, 9, 13, 17, 25, 33, 65, 129 };
-
-static const int8_t bitalloc_offsets[10] =
-    { -1, -2, -3, -4, -6, -8, -12, -16, -32, -64 };
-
-static const uint8_t bitalloc_maxbits[10][7] = {
-    { 2 },
-    { 4, 3, 3 },
-    { 5, 5, 4 },
-    { 6, 5, 6 },
-    { 7, 6, 5 },
-    { 9, 8, 7, 9, 8, 8, 8 },
-    { 9, 9, 8, 9, 8, 9, 9 },
-    { 9, 9, 9, 9, 9, 9, 9 },
-    { 9, 9, 9, 9, 9, 9, 9 },
-    { 9, 9, 9, 9, 9, 9, 9 }
-};
-
-static const uint16_t* const bitalloc_codes[10][8] = {
-  { bitalloc_3_codes, NULL },
-  { bitalloc_5_codes_a,  bitalloc_5_codes_b,  bitalloc_5_codes_c,  NULL },
-  { bitalloc_7_codes_a,  bitalloc_7_codes_b,  bitalloc_7_codes_c,  NULL },
-  { bitalloc_9_codes_a,  bitalloc_9_codes_b,  bitalloc_9_codes_c,  NULL },
-  { bitalloc_13_codes_a, bitalloc_13_codes_b, bitalloc_13_codes_c, NULL },
-  { bitalloc_17_codes_a, bitalloc_17_codes_b, bitalloc_17_codes_c, bitalloc_17_codes_d,
-    bitalloc_17_codes_e, bitalloc_17_codes_f, bitalloc_17_codes_g, NULL },
-  { bitalloc_25_codes_a, bitalloc_25_codes_b, bitalloc_25_codes_c, bitalloc_25_codes_d,
-    bitalloc_25_codes_e, bitalloc_25_codes_f, bitalloc_25_codes_g, NULL },
-  { bitalloc_33_codes_a, bitalloc_33_codes_b, bitalloc_33_codes_c, bitalloc_33_codes_d,
-    bitalloc_33_codes_e, bitalloc_33_codes_f, bitalloc_33_codes_g, NULL },
-  { bitalloc_65_codes_a, bitalloc_65_codes_b, bitalloc_65_codes_c, bitalloc_65_codes_d,
-    bitalloc_65_codes_e, bitalloc_65_codes_f, bitalloc_65_codes_g, NULL },
-  { bitalloc_129_codes_a, bitalloc_129_codes_b, bitalloc_129_codes_c, bitalloc_129_codes_d,
-    bitalloc_129_codes_e, bitalloc_129_codes_f, bitalloc_129_codes_g, NULL }
-};
-
-static const uint8_t* const bitalloc_bits[10][8] = {
-  { bitalloc_3_bits, NULL },
-  { bitalloc_5_bits_a,  bitalloc_5_bits_b,  bitalloc_5_bits_c,  NULL },
-  { bitalloc_7_bits_a,  bitalloc_7_bits_b,  bitalloc_7_bits_c,  NULL },
-  { bitalloc_9_bits_a,  bitalloc_9_bits_b,  bitalloc_9_bits_c,  NULL },
-  { bitalloc_13_bits_a, bitalloc_13_bits_b, bitalloc_13_bits_c, NULL },
-  { bitalloc_17_bits_a, bitalloc_17_bits_b, bitalloc_17_bits_c, bitalloc_17_bits_d,
-    bitalloc_17_bits_e, bitalloc_17_bits_f, bitalloc_17_bits_g, NULL },
-  { bitalloc_25_bits_a, bitalloc_25_bits_b, bitalloc_25_bits_c, bitalloc_25_bits_d,
-    bitalloc_25_bits_e, bitalloc_25_bits_f, bitalloc_25_bits_g, NULL },
-  { bitalloc_33_bits_a, bitalloc_33_bits_b, bitalloc_33_bits_c, bitalloc_33_bits_d,
-    bitalloc_33_bits_e, bitalloc_33_bits_f, bitalloc_33_bits_g, NULL },
-  { bitalloc_65_bits_a, bitalloc_65_bits_b, bitalloc_65_bits_c, bitalloc_65_bits_d,
-    bitalloc_65_bits_e, bitalloc_65_bits_f, bitalloc_65_bits_g, NULL },
-  { bitalloc_129_bits_a, bitalloc_129_bits_b, bitalloc_129_bits_c, bitalloc_129_bits_d,
-    bitalloc_129_bits_e, bitalloc_129_bits_f, bitalloc_129_bits_g, NULL }
-};
-
-#endif /* AVCODEC_DCAHUFF_H */
diff --git a/deps/libav/libavcodec/dct-test.c b/deps/libav/libavcodec/dct-test.c
deleted file mode 100644
index 74a4206..0000000
--- a/deps/libav/libavcodec/dct-test.c
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * (c) 2001 Fabrice Bellard
- *     2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DCT test (c) 2001 Fabrice Bellard
- * Started from sample code by Juan J. Sierralta P.
- */
-
-#include "config.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <math.h>
-
-#include "libavutil/cpu.h"
-#include "libavutil/common.h"
-#include "libavutil/lfg.h"
-#include "libavutil/time.h"
-
-#include "dct.h"
-#include "simple_idct.h"
-#include "aandcttab.h"
-#include "faandct.h"
-#include "faanidct.h"
-#include "x86/idct_xvid.h"
-#include "dctref.h"
-
-// BFIN
-void ff_bfin_idct(int16_t *block);
-void ff_bfin_fdct(int16_t *block);
-
-// ALTIVEC
-void ff_fdct_altivec(int16_t *block);
-
-// ARM
-void ff_j_rev_dct_arm(int16_t *data);
-void ff_simple_idct_arm(int16_t *data);
-void ff_simple_idct_armv5te(int16_t *data);
-void ff_simple_idct_armv6(int16_t *data);
-void ff_simple_idct_neon(int16_t *data);
-
-struct algo {
-    const char *name;
-    void (*func)(int16_t *block);
-    enum formattag { NO_PERM, MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM,
-                     SSE2_PERM, PARTTRANS_PERM } format;
-    int mm_support;
-    int nonspec;
-};
-
-static int cpu_flags;
-
-static const struct algo fdct_tab[] = {
-    { "REF-DBL",        ff_ref_fdct,           NO_PERM    },
-    { "FAAN",           ff_faandct,            NO_PERM    },
-    { "IJG-AAN-INT",    ff_fdct_ifast,         SCALE_PERM },
-    { "IJG-LLM-INT",    ff_jpeg_fdct_islow_8,  NO_PERM    },
-
-#if HAVE_MMX_INLINE
-    { "MMX",            ff_fdct_mmx,           NO_PERM,   AV_CPU_FLAG_MMX     },
-#endif
-#if HAVE_MMXEXT_INLINE
-    { "MMXEXT",         ff_fdct_mmxext,        NO_PERM,   AV_CPU_FLAG_MMXEXT  },
-#endif
-#if HAVE_SSE2_INLINE
-    { "SSE2",           ff_fdct_sse2,          NO_PERM,   AV_CPU_FLAG_SSE2    },
-#endif
-
-#if HAVE_ALTIVEC
-    { "altivecfdct",    ff_fdct_altivec,       NO_PERM,   AV_CPU_FLAG_ALTIVEC },
-#endif
-
-#if ARCH_BFIN
-    { "BFINfdct",       ff_bfin_fdct,          NO_PERM  },
-#endif
-
-    { 0 }
-};
-
-static const struct algo idct_tab[] = {
-    { "FAANI",          ff_faanidct,           NO_PERM  },
-    { "REF-DBL",        ff_ref_idct,           NO_PERM  },
-    { "INT",            ff_j_rev_dct,          MMX_PERM },
-    { "SIMPLE-C",       ff_simple_idct_8,      NO_PERM  },
-
-#if HAVE_MMX_INLINE
-    { "SIMPLE-MMX",     ff_simple_idct_mmx,  MMX_SIMPLE_PERM, AV_CPU_FLAG_MMX },
-    { "XVID-MMX",       ff_idct_xvid_mmx,      NO_PERM,   AV_CPU_FLAG_MMX,  1 },
-#endif
-#if HAVE_MMXEXT_INLINE
-    { "XVID-MMXEXT",    ff_idct_xvid_mmxext,   NO_PERM,   AV_CPU_FLAG_MMXEXT, 1 },
-#endif
-#if HAVE_SSE2_INLINE
-    { "XVID-SSE2",      ff_idct_xvid_sse2,     SSE2_PERM, AV_CPU_FLAG_SSE2, 1 },
-#endif
-
-#if ARCH_BFIN
-    { "BFINidct",       ff_bfin_idct,          NO_PERM  },
-#endif
-
-#if ARCH_ARM
-    { "SIMPLE-ARM",     ff_simple_idct_arm,    NO_PERM  },
-    { "INT-ARM",        ff_j_rev_dct_arm,      MMX_PERM },
-#endif
-#if HAVE_ARMV5TE
-    { "SIMPLE-ARMV5TE", ff_simple_idct_armv5te,NO_PERM,   AV_CPU_FLAG_ARMV5TE },
-#endif
-#if HAVE_ARMV6
-    { "SIMPLE-ARMV6",   ff_simple_idct_armv6,  MMX_PERM,  AV_CPU_FLAG_ARMV6   },
-#endif
-#if HAVE_NEON && ARCH_ARM
-    { "SIMPLE-NEON",    ff_simple_idct_neon, PARTTRANS_PERM, AV_CPU_FLAG_NEON },
-#endif
-
-    { 0 }
-};
-
-#define AANSCALE_BITS 12
-
-#define NB_ITS 20000
-#define NB_ITS_SPEED 50000
-
-static short idct_mmx_perm[64];
-
-static short idct_simple_mmx_perm[64] = {
-    0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
-    0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
-    0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
-    0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
-    0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
-    0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
-    0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
-    0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
-};
-
-static const uint8_t idct_sse2_row_perm[8] = { 0, 4, 1, 5, 2, 6, 3, 7 };
-
-static void idct_mmx_init(void)
-{
-    int i;
-
-    /* the mmx/mmxext idct uses a reordered input, so we patch scan tables */
-    for (i = 0; i < 64; i++) {
-        idct_mmx_perm[i] = (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
-    }
-}
-
-DECLARE_ALIGNED(16, static int16_t, block)[64];
-DECLARE_ALIGNED(8,  static int16_t, block1)[64];
-
-static void init_block(int16_t block[64], int test, int is_idct, AVLFG *prng)
-{
-    int i, j;
-
-    memset(block, 0, 64 * sizeof(*block));
-
-    switch (test) {
-    case 0:
-        for (i = 0; i < 64; i++)
-            block[i] = (av_lfg_get(prng) % 512) - 256;
-        if (is_idct) {
-            ff_ref_fdct(block);
-            for (i = 0; i < 64; i++)
-                block[i] >>= 3;
-        }
-        break;
-    case 1:
-        j = av_lfg_get(prng) % 10 + 1;
-        for (i = 0; i < j; i++)
-            block[av_lfg_get(prng) % 64] = av_lfg_get(prng) % 512 - 256;
-        break;
-    case 2:
-        block[ 0] = av_lfg_get(prng) % 4096 - 2048;
-        block[63] = (block[0] & 1) ^ 1;
-        break;
-    }
-}
-
-static void permute(int16_t dst[64], const int16_t src[64], int perm)
-{
-    int i;
-
-    if (perm == MMX_PERM) {
-        for (i = 0; i < 64; i++)
-            dst[idct_mmx_perm[i]] = src[i];
-    } else if (perm == MMX_SIMPLE_PERM) {
-        for (i = 0; i < 64; i++)
-            dst[idct_simple_mmx_perm[i]] = src[i];
-    } else if (perm == SSE2_PERM) {
-        for (i = 0; i < 64; i++)
-            dst[(i & 0x38) | idct_sse2_row_perm[i & 7]] = src[i];
-    } else if (perm == PARTTRANS_PERM) {
-        for (i = 0; i < 64; i++)
-            dst[(i & 0x24) | ((i & 3) << 3) | ((i >> 3) & 3)] = src[i];
-    } else {
-        for (i = 0; i < 64; i++)
-            dst[i] = src[i];
-    }
-}
-
-static int dct_error(const struct algo *dct, int test, int is_idct, int speed)
-{
-    void (*ref)(int16_t *block) = is_idct ? ff_ref_idct : ff_ref_fdct;
-    int it, i, scale;
-    int err_inf, v;
-    int64_t err2, ti, ti1, it1, err_sum = 0;
-    int64_t sysErr[64], sysErrMax = 0;
-    int maxout = 0;
-    int blockSumErrMax = 0, blockSumErr;
-    AVLFG prng;
-    double omse, ome;
-    int spec_err;
-
-    av_lfg_init(&prng, 1);
-
-    err_inf = 0;
-    err2 = 0;
-    for (i = 0; i < 64; i++)
-        sysErr[i] = 0;
-    for (it = 0; it < NB_ITS; it++) {
-        init_block(block1, test, is_idct, &prng);
-        permute(block, block1, dct->format);
-
-        dct->func(block);
-        emms_c();
-
-        if (dct->format == SCALE_PERM) {
-            for (i = 0; i < 64; i++) {
-                scale = 8 * (1 << (AANSCALE_BITS + 11)) / ff_aanscales[i];
-                block[i] = (block[i] * scale) >> AANSCALE_BITS;
-            }
-        }
-
-        ref(block1);
-
-        blockSumErr = 0;
-        for (i = 0; i < 64; i++) {
-            int err = block[i] - block1[i];
-            err_sum += err;
-            v = abs(err);
-            if (v > err_inf)
-                err_inf = v;
-            err2 += v * v;
-            sysErr[i] += block[i] - block1[i];
-            blockSumErr += v;
-            if (abs(block[i]) > maxout)
-                maxout = abs(block[i]);
-        }
-        if (blockSumErrMax < blockSumErr)
-            blockSumErrMax = blockSumErr;
-    }
-    for (i = 0; i < 64; i++)
-        sysErrMax = FFMAX(sysErrMax, FFABS(sysErr[i]));
-
-    for (i = 0; i < 64; i++) {
-        if (i % 8 == 0)
-            printf("\n");
-        printf("%7d ", (int) sysErr[i]);
-    }
-    printf("\n");
-
-    omse = (double) err2 / NB_ITS / 64;
-    ome  = (double) err_sum / NB_ITS / 64;
-
-    spec_err = is_idct && (err_inf > 1 || omse > 0.02 || fabs(ome) > 0.0015);
-
-    printf("%s %s: ppe=%d omse=%0.8f ome=%0.8f syserr=%0.8f maxout=%d blockSumErr=%d\n",
-           is_idct ? "IDCT" : "DCT", dct->name, err_inf,
-           omse, ome, (double) sysErrMax / NB_ITS,
-           maxout, blockSumErrMax);
-
-    if (spec_err && !dct->nonspec)
-        return 1;
-
-    if (!speed)
-        return 0;
-
-    /* speed test */
-    init_block(block, test, is_idct, &prng);
-    permute(block1, block, dct->format);
-
-    ti = av_gettime();
-    it1 = 0;
-    do {
-        for (it = 0; it < NB_ITS_SPEED; it++) {
-            memcpy(block, block1, sizeof(block));
-            dct->func(block);
-        }
-        it1 += NB_ITS_SPEED;
-        ti1 = av_gettime() - ti;
-    } while (ti1 < 1000000);
-    emms_c();
-
-    printf("%s %s: %0.1f kdct/s\n", is_idct ? "IDCT" : "DCT", dct->name,
-           (double) it1 * 1000.0 / (double) ti1);
-
-    return 0;
-}
-
-DECLARE_ALIGNED(8, static uint8_t, img_dest)[64];
-DECLARE_ALIGNED(8, static uint8_t, img_dest1)[64];
-
-static void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
-{
-    static int init;
-    static double c8[8][8];
-    static double c4[4][4];
-    double block1[64], block2[64], block3[64];
-    double s, sum, v;
-    int i, j, k;
-
-    if (!init) {
-        init = 1;
-
-        for (i = 0; i < 8; i++) {
-            sum = 0;
-            for (j = 0; j < 8; j++) {
-                s = (i == 0) ? sqrt(1.0 / 8.0) : sqrt(1.0 / 4.0);
-                c8[i][j] = s * cos(M_PI * i * (j + 0.5) / 8.0);
-                sum += c8[i][j] * c8[i][j];
-            }
-        }
-
-        for (i = 0; i < 4; i++) {
-            sum = 0;
-            for (j = 0; j < 4; j++) {
-                s = (i == 0) ? sqrt(1.0 / 4.0) : sqrt(1.0 / 2.0);
-                c4[i][j] = s * cos(M_PI * i * (j + 0.5) / 4.0);
-                sum += c4[i][j] * c4[i][j];
-            }
-        }
-    }
-
-    /* butterfly */
-    s = 0.5 * sqrt(2.0);
-    for (i = 0; i < 4; i++) {
-        for (j = 0; j < 8; j++) {
-            block1[8 * (2 * i) + j] =
-                (block[8 * (2 * i) + j] + block[8 * (2 * i + 1) + j]) * s;
-            block1[8 * (2 * i + 1) + j] =
-                (block[8 * (2 * i) + j] - block[8 * (2 * i + 1) + j]) * s;
-        }
-    }
-
-    /* idct8 on lines */
-    for (i = 0; i < 8; i++) {
-        for (j = 0; j < 8; j++) {
-            sum = 0;
-            for (k = 0; k < 8; k++)
-                sum += c8[k][j] * block1[8 * i + k];
-            block2[8 * i + j] = sum;
-        }
-    }
-
-    /* idct4 */
-    for (i = 0; i < 8; i++) {
-        for (j = 0; j < 4; j++) {
-            /* top */
-            sum = 0;
-            for (k = 0; k < 4; k++)
-                sum += c4[k][j] * block2[8 * (2 * k) + i];
-            block3[8 * (2 * j) + i] = sum;
-
-            /* bottom */
-            sum = 0;
-            for (k = 0; k < 4; k++)
-                sum += c4[k][j] * block2[8 * (2 * k + 1) + i];
-            block3[8 * (2 * j + 1) + i] = sum;
-        }
-    }
-
-    /* clamp and store the result */
-    for (i = 0; i < 8; i++) {
-        for (j = 0; j < 8; j++) {
-            v = block3[8 * i + j];
-            if      (v < 0)   v = 0;
-            else if (v > 255) v = 255;
-            dest[i * linesize + j] = (int) rint(v);
-        }
-    }
-}
-
-static void idct248_error(const char *name,
-                          void (*idct248_put)(uint8_t *dest, int line_size,
-                                              int16_t *block),
-                          int speed)
-{
-    int it, i, it1, ti, ti1, err_max, v;
-    AVLFG prng;
-
-    av_lfg_init(&prng, 1);
-
-    /* just one test to see if code is correct (precision is less
-       important here) */
-    err_max = 0;
-    for (it = 0; it < NB_ITS; it++) {
-        /* XXX: use forward transform to generate values */
-        for (i = 0; i < 64; i++)
-            block1[i] = av_lfg_get(&prng) % 256 - 128;
-        block1[0] += 1024;
-
-        for (i = 0; i < 64; i++)
-            block[i] = block1[i];
-        idct248_ref(img_dest1, 8, block);
-
-        for (i = 0; i < 64; i++)
-            block[i] = block1[i];
-        idct248_put(img_dest, 8, block);
-
-        for (i = 0; i < 64; i++) {
-            v = abs((int) img_dest[i] - (int) img_dest1[i]);
-            if (v == 255)
-                printf("%d %d\n", img_dest[i], img_dest1[i]);
-            if (v > err_max)
-                err_max = v;
-        }
-    }
-    printf("%s %s: err_inf=%d\n", 1 ? "IDCT248" : "DCT248", name, err_max);
-
-    if (!speed)
-        return;
-
-    ti = av_gettime();
-    it1 = 0;
-    do {
-        for (it = 0; it < NB_ITS_SPEED; it++) {
-            for (i = 0; i < 64; i++)
-                block[i] = block1[i];
-            idct248_put(img_dest, 8, block);
-        }
-        it1 += NB_ITS_SPEED;
-        ti1 = av_gettime() - ti;
-    } while (ti1 < 1000000);
-    emms_c();
-
-    printf("%s %s: %0.1f kdct/s\n", 1 ? "IDCT248" : "DCT248", name,
-           (double) it1 * 1000.0 / (double) ti1);
-}
-
-static void help(void)
-{
-    printf("dct-test [-i] [<test-number>]\n"
-           "test-number 0 -> test with random matrixes\n"
-           "            1 -> test with random sparse matrixes\n"
-           "            2 -> do 3. test from mpeg4 std\n"
-           "-i          test IDCT implementations\n"
-           "-4          test IDCT248 implementations\n"
-           "-t          speed test\n");
-}
-
-#if !HAVE_GETOPT
-#include "compat/getopt.c"
-#endif
-
-int main(int argc, char **argv)
-{
-    int test_idct = 0, test_248_dct = 0;
-    int c, i;
-    int test = 1;
-    int speed = 0;
-    int err = 0;
-
-    cpu_flags = av_get_cpu_flags();
-
-    ff_ref_dct_init();
-    idct_mmx_init();
-
-    for (;;) {
-        c = getopt(argc, argv, "ih4t");
-        if (c == -1)
-            break;
-        switch (c) {
-        case 'i':
-            test_idct = 1;
-            break;
-        case '4':
-            test_248_dct = 1;
-            break;
-        case 't':
-            speed = 1;
-            break;
-        default:
-        case 'h':
-            help();
-            return 0;
-        }
-    }
-
-    if (optind < argc)
-        test = atoi(argv[optind]);
-
-    printf("Libav DCT/IDCT test\n");
-
-    if (test_248_dct) {
-        idct248_error("SIMPLE-C", ff_simple_idct248_put, speed);
-    } else {
-        const struct algo *algos = test_idct ? idct_tab : fdct_tab;
-        for (i = 0; algos[i].name; i++)
-            if (!(~cpu_flags & algos[i].mm_support)) {
-                err |= dct_error(&algos[i], test, test_idct, speed);
-            }
-    }
-
-    if (err)
-        printf("Error: %d.\n", err);
-
-    return !!err;
-}
diff --git a/deps/libav/libavcodec/dct.c b/deps/libav/libavcodec/dct.c
deleted file mode 100644
index 4dbbff8..0000000
--- a/deps/libav/libavcodec/dct.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * (I)DCT Transforms
- * Copyright (c) 2009 Peter Ross <pross at xvid.org>
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- * Copyright (c) 2010 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-/**
- * @file
- * (Inverse) Discrete Cosine Transforms. These are also known as the
- * type II and type III DCTs respectively.
- */
-
-#include <math.h>
-#include <string.h>
-
-#include "libavutil/mathematics.h"
-#include "dct.h"
-#include "dct32.h"
-
-/* sin((M_PI * x / (2 * n)) */
-#define SIN(s, n, x) (s->costab[(n) - (x)])
-
-/* cos((M_PI * x / (2 * n)) */
-#define COS(s, n, x) (s->costab[x])
-
-static void dst_calc_I_c(DCTContext *ctx, FFTSample *data)
-{
-    int n = 1 << ctx->nbits;
-    int i;
-
-    data[0] = 0;
-    for (i = 1; i < n / 2; i++) {
-        float tmp1   = data[i    ];
-        float tmp2   = data[n - i];
-        float s      = SIN(ctx, n, 2 * i);
-
-        s           *= tmp1 + tmp2;
-        tmp1         = (tmp1 - tmp2) * 0.5f;
-        data[i]      = s + tmp1;
-        data[n - i]  = s - tmp1;
-    }
-
-    data[n / 2] *= 2;
-    ctx->rdft.rdft_calc(&ctx->rdft, data);
-
-    data[0] *= 0.5f;
-
-    for (i = 1; i < n - 2; i += 2) {
-        data[i + 1] +=  data[i - 1];
-        data[i]      = -data[i + 2];
-    }
-
-    data[n - 1] = 0;
-}
-
-static void dct_calc_I_c(DCTContext *ctx, FFTSample *data)
-{
-    int n = 1 << ctx->nbits;
-    int i;
-    float next = -0.5f * (data[0] - data[n]);
-
-    for (i = 0; i < n / 2; i++) {
-        float tmp1 = data[i];
-        float tmp2 = data[n - i];
-        float s    = SIN(ctx, n, 2 * i);
-        float c    = COS(ctx, n, 2 * i);
-
-        c *= tmp1 - tmp2;
-        s *= tmp1 - tmp2;
-
-        next += c;
-
-        tmp1        = (tmp1 + tmp2) * 0.5f;
-        data[i]     = tmp1 - s;
-        data[n - i] = tmp1 + s;
-    }
-
-    ctx->rdft.rdft_calc(&ctx->rdft, data);
-    data[n] = data[1];
-    data[1] = next;
-
-    for (i = 3; i <= n; i += 2)
-        data[i] = data[i - 2] - data[i];
-}
-
-static void dct_calc_III_c(DCTContext *ctx, FFTSample *data)
-{
-    int n = 1 << ctx->nbits;
-    int i;
-
-    float next  = data[n - 1];
-    float inv_n = 1.0f / n;
-
-    for (i = n - 2; i >= 2; i -= 2) {
-        float val1 = data[i];
-        float val2 = data[i - 1] - data[i + 1];
-        float c    = COS(ctx, n, i);
-        float s    = SIN(ctx, n, i);
-
-        data[i]     = c * val1 + s * val2;
-        data[i + 1] = s * val1 - c * val2;
-    }
-
-    data[1] = 2 * next;
-
-    ctx->rdft.rdft_calc(&ctx->rdft, data);
-
-    for (i = 0; i < n / 2; i++) {
-        float tmp1 = data[i]         * inv_n;
-        float tmp2 = data[n - i - 1] * inv_n;
-        float csc  = ctx->csc2[i] * (tmp1 - tmp2);
-
-        tmp1            += tmp2;
-        data[i]          = tmp1 + csc;
-        data[n - i - 1]  = tmp1 - csc;
-    }
-}
-
-static void dct_calc_II_c(DCTContext *ctx, FFTSample *data)
-{
-    int n = 1 << ctx->nbits;
-    int i;
-    float next;
-
-    for (i = 0; i < n / 2; i++) {
-        float tmp1 = data[i];
-        float tmp2 = data[n - i - 1];
-        float s    = SIN(ctx, n, 2 * i + 1);
-
-        s    *= tmp1 - tmp2;
-        tmp1  = (tmp1 + tmp2) * 0.5f;
-
-        data[i]     = tmp1 + s;
-        data[n-i-1] = tmp1 - s;
-    }
-
-    ctx->rdft.rdft_calc(&ctx->rdft, data);
-
-    next     = data[1] * 0.5;
-    data[1] *= -1;
-
-    for (i = n - 2; i >= 0; i -= 2) {
-        float inr = data[i    ];
-        float ini = data[i + 1];
-        float c   = COS(ctx, n, i);
-        float s   = SIN(ctx, n, i);
-
-        data[i]     = c * inr + s * ini;
-        data[i + 1] = next;
-
-        next += s * inr - c * ini;
-    }
-}
-
-static void dct32_func(DCTContext *ctx, FFTSample *data)
-{
-    ctx->dct32(data, data);
-}
-
-av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
-{
-    int n = 1 << nbits;
-    int i;
-
-    memset(s, 0, sizeof(*s));
-
-    s->nbits   = nbits;
-    s->inverse = inverse;
-
-    if (inverse == DCT_II && nbits == 5) {
-        s->dct_calc = dct32_func;
-    } else {
-        ff_init_ff_cos_tabs(nbits + 2);
-
-        s->costab = ff_cos_tabs[nbits + 2];
-        s->csc2   = av_malloc(n / 2 * sizeof(FFTSample));
-
-        if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
-            av_free(s->csc2);
-            return -1;
-        }
-
-        for (i = 0; i < n / 2; i++)
-            s->csc2[i] = 0.5 / sin((M_PI / (2 * n) * (2 * i + 1)));
-
-        switch (inverse) {
-        case DCT_I  : s->dct_calc = dct_calc_I_c;   break;
-        case DCT_II : s->dct_calc = dct_calc_II_c;  break;
-        case DCT_III: s->dct_calc = dct_calc_III_c; break;
-        case DST_I  : s->dct_calc = dst_calc_I_c;   break;
-        }
-    }
-
-    s->dct32 = ff_dct32_float;
-    if (ARCH_X86)
-        ff_dct_init_x86(s);
-
-    return 0;
-}
-
-av_cold void ff_dct_end(DCTContext *s)
-{
-    ff_rdft_end(&s->rdft);
-    av_free(s->csc2);
-}
diff --git a/deps/libav/libavcodec/dct.h b/deps/libav/libavcodec/dct.h
deleted file mode 100644
index 3de10b9..0000000
--- a/deps/libav/libavcodec/dct.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * (I)DCT Transforms
- * Copyright (c) 2009 Peter Ross <pross at xvid.org>
- * Copyright (c) 2010 Alex Converse <alex.converse at gmail.com>
- * Copyright (c) 2010 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef AVCODEC_DCT_H
-#define AVCODEC_DCT_H
-
-#include <stdint.h>
-
-#include "rdft.h"
-
-struct DCTContext {
-    int nbits;
-    int inverse;
-    RDFTContext rdft;
-    const float *costab;
-    FFTSample *csc2;
-    void (*dct_calc)(struct DCTContext *s, FFTSample *data);
-    void (*dct32)(FFTSample *out, const FFTSample *in);
-};
-
-/**
- * Set up DCT.
- * @param nbits           size of the input array:
- *                        (1 << nbits)     for DCT-II, DCT-III and DST-I
- *                        (1 << nbits) + 1 for DCT-I
- *
- * @note the first element of the input of DST-I is ignored
- */
-int  ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type);
-void ff_dct_end (DCTContext *s);
-
-void ff_dct_init_x86(DCTContext *s);
-
-void ff_fdct_ifast(int16_t *data);
-void ff_fdct_ifast248(int16_t *data);
-void ff_jpeg_fdct_islow_8(int16_t *data);
-void ff_jpeg_fdct_islow_10(int16_t *data);
-void ff_fdct248_islow_8(int16_t *data);
-void ff_fdct248_islow_10(int16_t *data);
-
-void ff_j_rev_dct(int16_t *data);
-
-void ff_fdct_mmx(int16_t *block);
-void ff_fdct_mmxext(int16_t *block);
-void ff_fdct_sse2(int16_t *block);
-
-#endif /* AVCODEC_DCT_H */
diff --git a/deps/libav/libavcodec/dct32.h b/deps/libav/libavcodec/dct32.h
deleted file mode 100644
index 110338d..0000000
--- a/deps/libav/libavcodec/dct32.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DCT32_H
-#define AVCODEC_DCT32_H
-
-void ff_dct32_float(float *dst, const float *src);
-void ff_dct32_fixed(int *dst, const int *src);
-
-#endif
diff --git a/deps/libav/libavcodec/dct32_fixed.c b/deps/libav/libavcodec/dct32_fixed.c
deleted file mode 100644
index 64efe8b..0000000
--- a/deps/libav/libavcodec/dct32_fixed.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define DCT32_FLOAT 0
-#include "dct32_template.c"
diff --git a/deps/libav/libavcodec/dct32_float.c b/deps/libav/libavcodec/dct32_float.c
deleted file mode 100644
index ef37ce9..0000000
--- a/deps/libav/libavcodec/dct32_float.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define DCT32_FLOAT 1
-#include "dct32_template.c"
diff --git a/deps/libav/libavcodec/dct32_template.c b/deps/libav/libavcodec/dct32_template.c
deleted file mode 100644
index 272e0db..0000000
--- a/deps/libav/libavcodec/dct32_template.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Template for the Discrete Cosine Transform for 32 samples
- * Copyright (c) 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "dct32.h"
-#include "mathops.h"
-
-#if DCT32_FLOAT
-#   define dct32 ff_dct32_float
-#   define FIXHR(x)       ((float)(x))
-#   define MULH3(x, y, s) ((s)*(y)*(x))
-#   define INTFLOAT float
-#else
-#   define dct32 ff_dct32_fixed
-#   define FIXHR(a)       ((int)((a) * (1LL<<32) + 0.5))
-#   define MULH3(x, y, s) MULH((s)*(x), y)
-#   define INTFLOAT int
-#endif
-
-
-/* tab[i][j] = 1.0 / (2.0 * cos(pi*(2*k+1) / 2^(6 - j))) */
-
-/* cos(i*pi/64) */
-
-#define COS0_0  FIXHR(0.50060299823519630134/2)
-#define COS0_1  FIXHR(0.50547095989754365998/2)
-#define COS0_2  FIXHR(0.51544730992262454697/2)
-#define COS0_3  FIXHR(0.53104259108978417447/2)
-#define COS0_4  FIXHR(0.55310389603444452782/2)
-#define COS0_5  FIXHR(0.58293496820613387367/2)
-#define COS0_6  FIXHR(0.62250412303566481615/2)
-#define COS0_7  FIXHR(0.67480834145500574602/2)
-#define COS0_8  FIXHR(0.74453627100229844977/2)
-#define COS0_9  FIXHR(0.83934964541552703873/2)
-#define COS0_10 FIXHR(0.97256823786196069369/2)
-#define COS0_11 FIXHR(1.16943993343288495515/4)
-#define COS0_12 FIXHR(1.48416461631416627724/4)
-#define COS0_13 FIXHR(2.05778100995341155085/8)
-#define COS0_14 FIXHR(3.40760841846871878570/8)
-#define COS0_15 FIXHR(10.19000812354805681150/32)
-
-#define COS1_0 FIXHR(0.50241928618815570551/2)
-#define COS1_1 FIXHR(0.52249861493968888062/2)
-#define COS1_2 FIXHR(0.56694403481635770368/2)
-#define COS1_3 FIXHR(0.64682178335999012954/2)
-#define COS1_4 FIXHR(0.78815462345125022473/2)
-#define COS1_5 FIXHR(1.06067768599034747134/4)
-#define COS1_6 FIXHR(1.72244709823833392782/4)
-#define COS1_7 FIXHR(5.10114861868916385802/16)
-
-#define COS2_0 FIXHR(0.50979557910415916894/2)
-#define COS2_1 FIXHR(0.60134488693504528054/2)
-#define COS2_2 FIXHR(0.89997622313641570463/2)
-#define COS2_3 FIXHR(2.56291544774150617881/8)
-
-#define COS3_0 FIXHR(0.54119610014619698439/2)
-#define COS3_1 FIXHR(1.30656296487637652785/4)
-
-#define COS4_0 FIXHR(0.70710678118654752439/2)
-
-/* butterfly operator */
-#define BF(a, b, c, s)\
-{\
-    tmp0 = val##a + val##b;\
-    tmp1 = val##a - val##b;\
-    val##a = tmp0;\
-    val##b = MULH3(tmp1, c, 1<<(s));\
-}
-
-#define BF0(a, b, c, s)\
-{\
-    tmp0 = tab[a] + tab[b];\
-    tmp1 = tab[a] - tab[b];\
-    val##a = tmp0;\
-    val##b = MULH3(tmp1, c, 1<<(s));\
-}
-
-#define BF1(a, b, c, d)\
-{\
-    BF(a, b, COS4_0, 1);\
-    BF(c, d,-COS4_0, 1);\
-    val##c += val##d;\
-}
-
-#define BF2(a, b, c, d)\
-{\
-    BF(a, b, COS4_0, 1);\
-    BF(c, d,-COS4_0, 1);\
-    val##c += val##d;\
-    val##a += val##c;\
-    val##c += val##b;\
-    val##b += val##d;\
-}
-
-#define ADD(a, b) val##a += val##b
-
-/* DCT32 without 1/sqrt(2) coef zero scaling. */
-void dct32(INTFLOAT *out, const INTFLOAT *tab)
-{
-    INTFLOAT tmp0, tmp1;
-
-    INTFLOAT val0 , val1 , val2 , val3 , val4 , val5 , val6 , val7 ,
-             val8 , val9 , val10, val11, val12, val13, val14, val15,
-             val16, val17, val18, val19, val20, val21, val22, val23,
-             val24, val25, val26, val27, val28, val29, val30, val31;
-
-    /* pass 1 */
-    BF0( 0, 31, COS0_0 , 1);
-    BF0(15, 16, COS0_15, 5);
-    /* pass 2 */
-    BF( 0, 15, COS1_0 , 1);
-    BF(16, 31,-COS1_0 , 1);
-    /* pass 1 */
-    BF0( 7, 24, COS0_7 , 1);
-    BF0( 8, 23, COS0_8 , 1);
-    /* pass 2 */
-    BF( 7,  8, COS1_7 , 4);
-    BF(23, 24,-COS1_7 , 4);
-    /* pass 3 */
-    BF( 0,  7, COS2_0 , 1);
-    BF( 8, 15,-COS2_0 , 1);
-    BF(16, 23, COS2_0 , 1);
-    BF(24, 31,-COS2_0 , 1);
-    /* pass 1 */
-    BF0( 3, 28, COS0_3 , 1);
-    BF0(12, 19, COS0_12, 2);
-    /* pass 2 */
-    BF( 3, 12, COS1_3 , 1);
-    BF(19, 28,-COS1_3 , 1);
-    /* pass 1 */
-    BF0( 4, 27, COS0_4 , 1);
-    BF0(11, 20, COS0_11, 2);
-    /* pass 2 */
-    BF( 4, 11, COS1_4 , 1);
-    BF(20, 27,-COS1_4 , 1);
-    /* pass 3 */
-    BF( 3,  4, COS2_3 , 3);
-    BF(11, 12,-COS2_3 , 3);
-    BF(19, 20, COS2_3 , 3);
-    BF(27, 28,-COS2_3 , 3);
-    /* pass 4 */
-    BF( 0,  3, COS3_0 , 1);
-    BF( 4,  7,-COS3_0 , 1);
-    BF( 8, 11, COS3_0 , 1);
-    BF(12, 15,-COS3_0 , 1);
-    BF(16, 19, COS3_0 , 1);
-    BF(20, 23,-COS3_0 , 1);
-    BF(24, 27, COS3_0 , 1);
-    BF(28, 31,-COS3_0 , 1);
-
-
-
-    /* pass 1 */
-    BF0( 1, 30, COS0_1 , 1);
-    BF0(14, 17, COS0_14, 3);
-    /* pass 2 */
-    BF( 1, 14, COS1_1 , 1);
-    BF(17, 30,-COS1_1 , 1);
-    /* pass 1 */
-    BF0( 6, 25, COS0_6 , 1);
-    BF0( 9, 22, COS0_9 , 1);
-    /* pass 2 */
-    BF( 6,  9, COS1_6 , 2);
-    BF(22, 25,-COS1_6 , 2);
-    /* pass 3 */
-    BF( 1,  6, COS2_1 , 1);
-    BF( 9, 14,-COS2_1 , 1);
-    BF(17, 22, COS2_1 , 1);
-    BF(25, 30,-COS2_1 , 1);
-
-    /* pass 1 */
-    BF0( 2, 29, COS0_2 , 1);
-    BF0(13, 18, COS0_13, 3);
-    /* pass 2 */
-    BF( 2, 13, COS1_2 , 1);
-    BF(18, 29,-COS1_2 , 1);
-    /* pass 1 */
-    BF0( 5, 26, COS0_5 , 1);
-    BF0(10, 21, COS0_10, 1);
-    /* pass 2 */
-    BF( 5, 10, COS1_5 , 2);
-    BF(21, 26,-COS1_5 , 2);
-    /* pass 3 */
-    BF( 2,  5, COS2_2 , 1);
-    BF(10, 13,-COS2_2 , 1);
-    BF(18, 21, COS2_2 , 1);
-    BF(26, 29,-COS2_2 , 1);
-    /* pass 4 */
-    BF( 1,  2, COS3_1 , 2);
-    BF( 5,  6,-COS3_1 , 2);
-    BF( 9, 10, COS3_1 , 2);
-    BF(13, 14,-COS3_1 , 2);
-    BF(17, 18, COS3_1 , 2);
-    BF(21, 22,-COS3_1 , 2);
-    BF(25, 26, COS3_1 , 2);
-    BF(29, 30,-COS3_1 , 2);
-
-    /* pass 5 */
-    BF1( 0,  1,  2,  3);
-    BF2( 4,  5,  6,  7);
-    BF1( 8,  9, 10, 11);
-    BF2(12, 13, 14, 15);
-    BF1(16, 17, 18, 19);
-    BF2(20, 21, 22, 23);
-    BF1(24, 25, 26, 27);
-    BF2(28, 29, 30, 31);
-
-    /* pass 6 */
-
-    ADD( 8, 12);
-    ADD(12, 10);
-    ADD(10, 14);
-    ADD(14,  9);
-    ADD( 9, 13);
-    ADD(13, 11);
-    ADD(11, 15);
-
-    out[ 0] = val0;
-    out[16] = val1;
-    out[ 8] = val2;
-    out[24] = val3;
-    out[ 4] = val4;
-    out[20] = val5;
-    out[12] = val6;
-    out[28] = val7;
-    out[ 2] = val8;
-    out[18] = val9;
-    out[10] = val10;
-    out[26] = val11;
-    out[ 6] = val12;
-    out[22] = val13;
-    out[14] = val14;
-    out[30] = val15;
-
-    ADD(24, 28);
-    ADD(28, 26);
-    ADD(26, 30);
-    ADD(30, 25);
-    ADD(25, 29);
-    ADD(29, 27);
-    ADD(27, 31);
-
-    out[ 1] = val16 + val24;
-    out[17] = val17 + val25;
-    out[ 9] = val18 + val26;
-    out[25] = val19 + val27;
-    out[ 5] = val20 + val28;
-    out[21] = val21 + val29;
-    out[13] = val22 + val30;
-    out[29] = val23 + val31;
-    out[ 3] = val24 + val20;
-    out[19] = val25 + val21;
-    out[11] = val26 + val22;
-    out[27] = val27 + val23;
-    out[ 7] = val28 + val18;
-    out[23] = val29 + val19;
-    out[15] = val30 + val17;
-    out[31] = val31;
-}
diff --git a/deps/libav/libavcodec/dctref.c b/deps/libav/libavcodec/dctref.c
deleted file mode 100644
index ae3dec5..0000000
--- a/deps/libav/libavcodec/dctref.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * reference discrete cosine transform (double precision)
- * Copyright (C) 2009 Dylan Yudaken
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * reference discrete cosine transform (double precision)
- *
- * @author Dylan Yudaken (dyudaken at gmail)
- *
- * @note This file could be optimized a lot, but is for
- * reference and so readability is better.
- */
-
-#include "libavutil/mathematics.h"
-#include "dctref.h"
-
-static double coefficients[8 * 8];
-
-/**
- * Initialize the double precision discrete cosine transform
- * functions fdct & idct.
- */
-av_cold void ff_ref_dct_init(void)
-{
-    unsigned int i, j;
-
-    for (j = 0; j < 8; ++j) {
-        coefficients[j] = sqrt(0.125);
-        for (i = 8; i < 64; i += 8) {
-            coefficients[i + j] = 0.5 * cos(i * (j + 0.5) * M_PI / 64.0);
-        }
-    }
-}
-
-/**
- * Transform 8x8 block of data with a double precision forward DCT <br>
- * This is a reference implementation.
- *
- * @param block pointer to 8x8 block of data to transform
- */
-void ff_ref_fdct(short *block)
-{
-    /* implement the equation: block = coefficients * block * coefficients' */
-
-    unsigned int i, j, k;
-    double out[8 * 8];
-
-    /* out = coefficients * block */
-    for (i = 0; i < 64; i += 8) {
-        for (j = 0; j < 8; ++j) {
-            double tmp = 0;
-            for (k = 0; k < 8; ++k) {
-                tmp += coefficients[i + k] * block[k * 8 + j];
-            }
-            out[i + j] = tmp * 8;
-        }
-    }
-
-    /* block = out * (coefficients') */
-    for (j = 0; j < 8; ++j) {
-        for (i = 0; i < 64; i += 8) {
-            double tmp = 0;
-            for (k = 0; k < 8; ++k) {
-                tmp += out[i + k] * coefficients[j * 8 + k];
-            }
-            block[i + j] = floor(tmp + 0.499999999999);
-        }
-    }
-}
-
-/**
- * Transform 8x8 block of data with a double precision inverse DCT <br>
- * This is a reference implementation.
- *
- * @param block pointer to 8x8 block of data to transform
- */
-void ff_ref_idct(short *block)
-{
-    /* implement the equation: block = (coefficients') * block * coefficients */
-
-    unsigned int i, j, k;
-    double out[8 * 8];
-
-    /* out = block * coefficients */
-    for (i = 0; i < 64; i += 8) {
-        for (j = 0; j < 8; ++j) {
-            double tmp = 0;
-            for (k = 0; k < 8; ++k) {
-                tmp += block[i + k] * coefficients[k * 8 + j];
-            }
-            out[i + j] = tmp;
-        }
-    }
-
-    /* block = (coefficients') * out */
-    for (i = 0; i < 8; ++i) {
-        for (j = 0; j < 8; ++j) {
-            double tmp = 0;
-            for (k = 0; k < 64; k += 8) {
-                tmp += coefficients[k + i] * out[k + j];
-            }
-            block[i * 8 + j] = floor(tmp + 0.5);
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/dctref.h b/deps/libav/libavcodec/dctref.h
deleted file mode 100644
index a93b70d..0000000
--- a/deps/libav/libavcodec/dctref.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * reference discrete cosine transform (double precision)
- * Copyright (C) 2009 Dylan Yudaken
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DCTREF_H
-#define AVCODEC_DCTREF_H
-
-void ff_ref_fdct(short *block);
-void ff_ref_idct(short *block);
-void ff_ref_dct_init(void);
-
-#endif /* AVCODEC_DCTREF_H */
diff --git a/deps/libav/libavcodec/dfa.c b/deps/libav/libavcodec/dfa.c
deleted file mode 100644
index ab65fdc..0000000
--- a/deps/libav/libavcodec/dfa.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Chronomaster DFA Video Decoder
- * Copyright (c) 2011 Konstantin Shishkov
- * based on work by Vladimir "VAG" Gneushev
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-#include "libavutil/imgutils.h"
-#include "libavutil/mem.h"
-
-typedef struct DfaContext {
-    uint32_t pal[256];
-    uint8_t *frame_buf;
-} DfaContext;
-
-static av_cold int dfa_decode_init(AVCodecContext *avctx)
-{
-    DfaContext *s = avctx->priv_data;
-    int ret;
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
-        return ret;
-
-    s->frame_buf = av_mallocz(avctx->width * avctx->height);
-    if (!s->frame_buf)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int decode_copy(GetByteContext *gb, uint8_t *frame, int width, int height)
-{
-    const int size = width * height;
-
-    if (bytestream2_get_buffer(gb, frame, size) != size)
-        return AVERROR_INVALIDDATA;
-    return 0;
-}
-
-static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height)
-{
-    const uint8_t *frame_start = frame;
-    const uint8_t *frame_end   = frame + width * height;
-    int mask = 0x10000, bitbuf = 0;
-    int v, count, segments;
-    unsigned offset;
-
-    segments = bytestream2_get_le32(gb);
-    offset   = bytestream2_get_le32(gb);
-    if (frame_end - frame <= offset)
-        return AVERROR_INVALIDDATA;
-    frame += offset;
-    while (segments--) {
-        if (bytestream2_get_bytes_left(gb) < 2)
-            return AVERROR_INVALIDDATA;
-        if (mask == 0x10000) {
-            bitbuf = bytestream2_get_le16u(gb);
-            mask = 1;
-        }
-        if (frame_end - frame < 2)
-            return AVERROR_INVALIDDATA;
-        if (bitbuf & mask) {
-            v = bytestream2_get_le16(gb);
-            offset = (v & 0x1FFF) << 1;
-            count = ((v >> 13) + 2) << 1;
-            if (frame - frame_start < offset || frame_end - frame < count)
-                return AVERROR_INVALIDDATA;
-            av_memcpy_backptr(frame, offset, count);
-            frame += count;
-        } else {
-            *frame++ = bytestream2_get_byte(gb);
-            *frame++ = bytestream2_get_byte(gb);
-        }
-        mask <<= 1;
-    }
-
-    return 0;
-}
-
-static int decode_dsw1(GetByteContext *gb, uint8_t *frame, int width, int height)
-{
-    const uint8_t *frame_start = frame;
-    const uint8_t *frame_end   = frame + width * height;
-    int mask = 0x10000, bitbuf = 0;
-    int v, offset, count, segments;
-
-    segments = bytestream2_get_le16(gb);
-    while (segments--) {
-        if (bytestream2_get_bytes_left(gb) < 2)
-            return AVERROR_INVALIDDATA;
-        if (mask == 0x10000) {
-            bitbuf = bytestream2_get_le16u(gb);
-            mask = 1;
-        }
-        if (frame_end - frame < 2)
-            return AVERROR_INVALIDDATA;
-        if (bitbuf & mask) {
-            v = bytestream2_get_le16(gb);
-            offset = (v & 0x1FFF) << 1;
-            count = ((v >> 13) + 2) << 1;
-            if (frame - frame_start < offset || frame_end - frame < count)
-                return AVERROR_INVALIDDATA;
-            av_memcpy_backptr(frame, offset, count);
-            frame += count;
-        } else if (bitbuf & (mask << 1)) {
-            frame += bytestream2_get_le16(gb);
-        } else {
-            *frame++ = bytestream2_get_byte(gb);
-            *frame++ = bytestream2_get_byte(gb);
-        }
-        mask <<= 2;
-    }
-
-    return 0;
-}
-
-static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height)
-{
-    const uint8_t *frame_start = frame;
-    const uint8_t *frame_end   = frame + width * height;
-    int mask = 0x10000, bitbuf = 0;
-    int i, v, offset, count, segments;
-
-    segments = bytestream2_get_le16(gb);
-    while (segments--) {
-        if (bytestream2_get_bytes_left(gb) < 2)
-            return AVERROR_INVALIDDATA;
-        if (mask == 0x10000) {
-            bitbuf = bytestream2_get_le16u(gb);
-            mask = 1;
-        }
-
-        if (bitbuf & mask) {
-            v = bytestream2_get_le16(gb);
-            offset = (v & 0x1FFF) << 2;
-            count = ((v >> 13) + 2) << 1;
-            if (frame - frame_start < offset || frame_end - frame < count*2 + width)
-                return AVERROR_INVALIDDATA;
-            for (i = 0; i < count; i++) {
-                frame[0] = frame[1] =
-                frame[width] = frame[width + 1] = frame[-offset];
-
-                frame += 2;
-            }
-        } else if (bitbuf & (mask << 1)) {
-            v = bytestream2_get_le16(gb)*2;
-            if (frame - frame_end < v)
-                return AVERROR_INVALIDDATA;
-            frame += v;
-        } else {
-            if (frame_end - frame < width + 3)
-                return AVERROR_INVALIDDATA;
-            frame[0] = frame[1] =
-            frame[width] = frame[width + 1] =  bytestream2_get_byte(gb);
-            frame += 2;
-            frame[0] = frame[1] =
-            frame[width] = frame[width + 1] =  bytestream2_get_byte(gb);
-            frame += 2;
-        }
-        mask <<= 2;
-    }
-
-    return 0;
-}
-
-static int decode_bdlt(GetByteContext *gb, uint8_t *frame, int width, int height)
-{
-    uint8_t *line_ptr;
-    int count, lines, segments;
-
-    count = bytestream2_get_le16(gb);
-    if (count >= height)
-        return AVERROR_INVALIDDATA;
-    frame += width * count;
-    lines = bytestream2_get_le16(gb);
-    if (count + lines > height)
-        return AVERROR_INVALIDDATA;
-
-    while (lines--) {
-        if (bytestream2_get_bytes_left(gb) < 1)
-            return AVERROR_INVALIDDATA;
-        line_ptr = frame;
-        frame += width;
-        segments = bytestream2_get_byteu(gb);
-        while (segments--) {
-            if (frame - line_ptr <= bytestream2_peek_byte(gb))
-                return AVERROR_INVALIDDATA;
-            line_ptr += bytestream2_get_byte(gb);
-            count = (int8_t)bytestream2_get_byte(gb);
-            if (count >= 0) {
-                if (frame - line_ptr < count)
-                    return AVERROR_INVALIDDATA;
-                if (bytestream2_get_buffer(gb, line_ptr, count) != count)
-                    return AVERROR_INVALIDDATA;
-            } else {
-                count = -count;
-                if (frame - line_ptr < count)
-                    return AVERROR_INVALIDDATA;
-                memset(line_ptr, bytestream2_get_byte(gb), count);
-            }
-            line_ptr += count;
-        }
-    }
-
-    return 0;
-}
-
-static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height)
-{
-    const uint8_t *frame_end   = frame + width * height;
-    uint8_t *line_ptr;
-    int count, i, v, lines, segments;
-    int y = 0;
-
-    lines = bytestream2_get_le16(gb);
-    if (lines > height)
-        return AVERROR_INVALIDDATA;
-
-    while (lines--) {
-        if (bytestream2_get_bytes_left(gb) < 2)
-            return AVERROR_INVALIDDATA;
-        segments = bytestream2_get_le16u(gb);
-        while ((segments & 0xC000) == 0xC000) {
-            unsigned skip_lines = -(int16_t)segments;
-            unsigned delta = -((int16_t)segments * width);
-            if (frame_end - frame <= delta || y + lines + skip_lines > height)
-                return AVERROR_INVALIDDATA;
-            frame    += delta;
-            y        += skip_lines;
-            segments = bytestream2_get_le16(gb);
-        }
-        if (segments & 0x8000) {
-            frame[width - 1] = segments & 0xFF;
-            segments = bytestream2_get_le16(gb);
-        }
-        line_ptr = frame;
-        if (frame_end - frame < width)
-            return AVERROR_INVALIDDATA;
-        frame += width;
-        y++;
-        while (segments--) {
-            if (frame - line_ptr <= bytestream2_peek_byte(gb))
-                return AVERROR_INVALIDDATA;
-            line_ptr += bytestream2_get_byte(gb);
-            count = (int8_t)bytestream2_get_byte(gb);
-            if (count >= 0) {
-                if (frame - line_ptr < count * 2)
-                    return AVERROR_INVALIDDATA;
-                if (bytestream2_get_buffer(gb, line_ptr, count * 2) != count * 2)
-                    return AVERROR_INVALIDDATA;
-                line_ptr += count * 2;
-            } else {
-                count = -count;
-                if (frame - line_ptr < count * 2)
-                    return AVERROR_INVALIDDATA;
-                v = bytestream2_get_le16(gb);
-                for (i = 0; i < count; i++)
-                    bytestream_put_le16(&line_ptr, v);
-            }
-        }
-    }
-
-    return 0;
-}
-
-static int decode_tdlt(GetByteContext *gb, uint8_t *frame, int width, int height)
-{
-    const uint8_t *frame_end = frame + width * height;
-    int segments = bytestream2_get_le32(gb);
-    int skip, copy;
-
-    while (segments--) {
-        if (bytestream2_get_bytes_left(gb) < 2)
-            return AVERROR_INVALIDDATA;
-        copy = bytestream2_get_byteu(gb) * 2;
-        skip = bytestream2_get_byteu(gb) * 2;
-        if (frame_end - frame < copy + skip ||
-            bytestream2_get_bytes_left(gb) < copy)
-            return AVERROR_INVALIDDATA;
-        frame += skip;
-        bytestream2_get_buffer(gb, frame, copy);
-        frame += copy;
-    }
-
-    return 0;
-}
-
-static int decode_blck(GetByteContext *gb, uint8_t *frame, int width, int height)
-{
-    memset(frame, 0, width * height);
-    return 0;
-}
-
-
-typedef int (*chunk_decoder)(GetByteContext *gb, uint8_t *frame, int width, int height);
-
-static const chunk_decoder decoder[8] = {
-    decode_copy, decode_tsw1, decode_bdlt, decode_wdlt,
-    decode_tdlt, decode_dsw1, decode_blck, decode_dds1,
-};
-
-static const char* chunk_name[8] = {
-    "COPY", "TSW1", "BDLT", "WDLT", "TDLT", "DSW1", "BLCK", "DDS1"
-};
-
-static int dfa_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    DfaContext *s = avctx->priv_data;
-    GetByteContext gb;
-    const uint8_t *buf = avpkt->data;
-    uint32_t chunk_type, chunk_size;
-    uint8_t *dst;
-    int ret;
-    int i, pal_elems;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0))) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    bytestream2_init(&gb, avpkt->data, avpkt->size);
-    while (bytestream2_get_bytes_left(&gb) > 0) {
-        bytestream2_skip(&gb, 4);
-        chunk_size = bytestream2_get_le32(&gb);
-        chunk_type = bytestream2_get_le32(&gb);
-        if (!chunk_type)
-            break;
-        if (chunk_type == 1) {
-            pal_elems = FFMIN(chunk_size / 3, 256);
-            for (i = 0; i < pal_elems; i++) {
-                s->pal[i] = bytestream2_get_be24(&gb) << 2;
-                s->pal[i] |= (s->pal[i] >> 6) & 0x333;
-            }
-            frame->palette_has_changed = 1;
-        } else if (chunk_type <= 9) {
-            if (decoder[chunk_type - 2](&gb, s->frame_buf, avctx->width, avctx->height)) {
-                av_log(avctx, AV_LOG_ERROR, "Error decoding %s chunk\n",
-                       chunk_name[chunk_type - 2]);
-                return AVERROR_INVALIDDATA;
-            }
-        } else {
-            av_log(avctx, AV_LOG_WARNING, "Ignoring unknown chunk type %d\n",
-                   chunk_type);
-        }
-        buf += chunk_size;
-    }
-
-    buf = s->frame_buf;
-    dst = frame->data[0];
-    for (i = 0; i < avctx->height; i++) {
-        memcpy(dst, buf, avctx->width);
-        dst += frame->linesize[0];
-        buf += avctx->width;
-    }
-    memcpy(frame->data[1], s->pal, sizeof(s->pal));
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int dfa_decode_end(AVCodecContext *avctx)
-{
-    DfaContext *s = avctx->priv_data;
-
-    av_freep(&s->frame_buf);
-
-    return 0;
-}
-
-AVCodec ff_dfa_decoder = {
-    .name           = "dfa",
-    .long_name      = NULL_IF_CONFIG_SMALL("Chronomaster DFA"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DFA,
-    .priv_data_size = sizeof(DfaContext),
-    .init           = dfa_decode_init,
-    .close          = dfa_decode_end,
-    .decode         = dfa_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/dirac.c b/deps/libav/libavcodec/dirac.c
deleted file mode 100644
index f0fb85d..0000000
--- a/deps/libav/libavcodec/dirac.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (C) 2007 Marco Gerards <marco at gnu.org>
- * Copyright (C) 2009 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Dirac Decoder
- * @author Marco Gerards <marco at gnu.org>
- */
-
-#include "libavutil/imgutils.h"
-#include "dirac.h"
-#include "avcodec.h"
-#include "golomb.h"
-#include "internal.h"
-#include "mpeg12data.h"
-
-// defaults for source parameters
-static const dirac_source_params dirac_source_parameters_defaults[] = {
-    { 640,  480,  2, 0, 0, 1,  1, 640,  480,  0, 0, 1, 0 },
-    { 176,  120,  2, 0, 0, 9,  2, 176,  120,  0, 0, 1, 1 },
-    { 176,  144,  2, 0, 1, 10, 3, 176,  144,  0, 0, 1, 2 },
-    { 352,  240,  2, 0, 0, 9,  2, 352,  240,  0, 0, 1, 1 },
-    { 352,  288,  2, 0, 1, 10, 3, 352,  288,  0, 0, 1, 2 },
-    { 704,  480,  2, 0, 0, 9,  2, 704,  480,  0, 0, 1, 1 },
-    { 704,  576,  2, 0, 1, 10, 3, 704,  576,  0, 0, 1, 2 },
-    { 720,  480,  1, 1, 0, 4,  2, 704,  480,  8, 0, 3, 1 },
-    { 720,  576,  1, 1, 1, 3,  3, 704,  576,  8, 0, 3, 2 },
-
-    { 1280, 720,  1, 0, 1, 7,  1, 1280, 720,  0, 0, 3, 3 },
-    { 1280, 720,  1, 0, 1, 6,  1, 1280, 720,  0, 0, 3, 3 },
-    { 1920, 1080, 1, 1, 1, 4,  1, 1920, 1080, 0, 0, 3, 3 },
-    { 1920, 1080, 1, 1, 1, 3,  1, 1920, 1080, 0, 0, 3, 3 },
-    { 1920, 1080, 1, 0, 1, 7,  1, 1920, 1080, 0, 0, 3, 3 },
-    { 1920, 1080, 1, 0, 1, 6,  1, 1920, 1080, 0, 0, 3, 3 },
-    { 2048, 1080, 0, 0, 1, 2,  1, 2048, 1080, 0, 0, 4, 4 },
-    { 4096, 2160, 0, 0, 1, 2,  1, 4096, 2160, 0, 0, 4, 4 },
-
-    { 3840, 2160, 1, 0, 1, 7,  1, 3840, 2160, 0, 0, 3, 3 },
-    { 3840, 2160, 1, 0, 1, 6,  1, 3840, 2160, 0, 0, 3, 3 },
-    { 7680, 4320, 1, 0, 1, 7,  1, 3840, 2160, 0, 0, 3, 3 },
-    { 7680, 4320, 1, 0, 1, 6,  1, 3840, 2160, 0, 0, 3, 3 },
-};
-
-/* [DIRAC_STD] Table 10.4 - Available preset pixel aspect ratio values */
-static const AVRational dirac_preset_aspect_ratios[] = {
-    {1, 1},
-    {10, 11},
-    {12, 11},
-    {40, 33},
-    {16, 11},
-    {4, 3},
-};
-
-/* [DIRAC_STD] Values 9,10 of 10.3.5 Frame Rate.
- * Table 10.3 Available preset frame rate values
- */
-static const AVRational dirac_frame_rate[] = {
-    {15000, 1001},
-    {25, 2},
-};
-
-/* [DIRAC_STD] This should be equivalent to Table 10.5 Available signal
- * range presets */
-static const struct {
-    uint8_t             bitdepth;
-    enum AVColorRange   color_range;
-} pixel_range_presets[] = {
-    {8,  AVCOL_RANGE_JPEG},
-    {8,  AVCOL_RANGE_MPEG},
-    {10, AVCOL_RANGE_MPEG},
-    {12, AVCOL_RANGE_MPEG},
-};
-
-static const enum AVColorPrimaries dirac_primaries[] = {
-    AVCOL_PRI_BT709,
-    AVCOL_PRI_SMPTE170M,
-    AVCOL_PRI_BT470BG,
-};
-
-static const struct {
-    enum AVColorPrimaries color_primaries;
-    enum AVColorSpace colorspace;
-    enum AVColorTransferCharacteristic color_trc;
-} dirac_color_presets[] = {
-    { AVCOL_PRI_BT709,     AVCOL_SPC_BT709,   AVCOL_TRC_BT709 },
-    { AVCOL_PRI_SMPTE170M, AVCOL_SPC_BT470BG, AVCOL_TRC_BT709 },
-    { AVCOL_PRI_BT470BG,   AVCOL_SPC_BT470BG, AVCOL_TRC_BT709 },
-    { AVCOL_PRI_BT709,     AVCOL_SPC_BT709,   AVCOL_TRC_BT709 },
-    { AVCOL_PRI_BT709,     AVCOL_SPC_BT709,   AVCOL_TRC_UNSPECIFIED /* DCinema */ },
-};
-
-/* [DIRAC_STD] Table 10.2 Supported chroma sampling formats + luma Offset */
-static const enum AVPixelFormat dirac_pix_fmt[2][3] = {
-    { AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV420P  },
-    { AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P },
-};
-
-/* [DIRAC_STD] 10.3 Parse Source Parameters.
- * source_parameters(base_video_format) */
-static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
-                                   dirac_source_params *source)
-{
-    AVRational frame_rate = {0,0};
-    unsigned luma_depth = 8, luma_offset = 16;
-    int idx;
-
-    /* [DIRAC_STD] 10.3.2 Frame size. frame_size(video_params) */
-    /* [DIRAC_STD] custom_dimensions_flag */
-    if (get_bits1(gb)) {
-        source->width  = svq3_get_ue_golomb(gb); /* [DIRAC_STD] FRAME_WIDTH  */
-        source->height = svq3_get_ue_golomb(gb); /* [DIRAC_STD] FRAME_HEIGHT */
-    }
-
-    /* [DIRAC_STD] 10.3.3 Chroma Sampling Format.
-     *  chroma_sampling_format(video_params) */
-    /* [DIRAC_STD] custom_chroma_format_flag */
-    if (get_bits1(gb))
-        /* [DIRAC_STD] CHROMA_FORMAT_INDEX */
-        source->chroma_format = svq3_get_ue_golomb(gb);
-    if (source->chroma_format > 2) {
-        av_log(avctx, AV_LOG_ERROR, "Unknown chroma format %d\n",
-               source->chroma_format);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* [DIRAC_STD] 10.3.4 Scan Format. scan_format(video_params) */
-    /* [DIRAC_STD] custom_scan_format_flag */
-    if (get_bits1(gb))
-        /* [DIRAC_STD] SOURCE_SAMPLING */
-        source->interlaced = svq3_get_ue_golomb(gb);
-    if (source->interlaced > 1)
-        return AVERROR_INVALIDDATA;
-
-    /* [DIRAC_STD] 10.3.5 Frame Rate. frame_rate(video_params) */
-    if (get_bits1(gb)) { /* [DIRAC_STD] custom_frame_rate_flag */
-        source->frame_rate_index = svq3_get_ue_golomb(gb);
-
-        if (source->frame_rate_index > 10)
-            return AVERROR_INVALIDDATA;
-
-        if (!source->frame_rate_index) {
-            /* [DIRAC_STD] FRAME_RATE_NUMER */
-            frame_rate.num = svq3_get_ue_golomb(gb);
-            /* [DIRAC_STD] FRAME_RATE_DENOM */
-            frame_rate.den = svq3_get_ue_golomb(gb);
-        }
-    }
-    /* [DIRAC_STD] preset_frame_rate(video_params, index) */
-    if (source->frame_rate_index > 0) {
-        if (source->frame_rate_index <= 8)
-            frame_rate = ff_mpeg12_frame_rate_tab[source->frame_rate_index];
-        else
-             /* [DIRAC_STD] Table 10.3 values 9-10 */
-            frame_rate = dirac_frame_rate[source->frame_rate_index-9];
-    }
-    av_reduce(&avctx->time_base.num, &avctx->time_base.den,
-              frame_rate.den, frame_rate.num, 1<<30);
-
-    /* [DIRAC_STD] 10.3.6 Pixel Aspect Ratio.
-     * pixel_aspect_ratio(video_params) */
-    if (get_bits1(gb)) { /* [DIRAC_STD] custom_pixel_aspect_ratio_flag */
-         /* [DIRAC_STD] index */
-        source->aspect_ratio_index = svq3_get_ue_golomb(gb);
-
-        if (source->aspect_ratio_index > 6)
-            return AVERROR_INVALIDDATA;
-
-        if (!source->aspect_ratio_index) {
-            avctx->sample_aspect_ratio.num = svq3_get_ue_golomb(gb);
-            avctx->sample_aspect_ratio.den = svq3_get_ue_golomb(gb);
-        }
-    }
-    /* [DIRAC_STD] Take value from Table 10.4 Available preset pixel
-     *  aspect ratio values */
-    if (source->aspect_ratio_index > 0)
-        avctx->sample_aspect_ratio =
-                dirac_preset_aspect_ratios[source->aspect_ratio_index-1];
-
-    /* [DIRAC_STD] 10.3.7 Clean area. clean_area(video_params) */
-    if (get_bits1(gb)) { /* [DIRAC_STD] custom_clean_area_flag */
-        /* [DIRAC_STD] CLEAN_WIDTH */
-        source->clean_width        = svq3_get_ue_golomb(gb);
-         /* [DIRAC_STD] CLEAN_HEIGHT */
-        source->clean_height       = svq3_get_ue_golomb(gb);
-         /* [DIRAC_STD] CLEAN_LEFT_OFFSET */
-        source->clean_left_offset  = svq3_get_ue_golomb(gb);
-        /* [DIRAC_STD] CLEAN_RIGHT_OFFSET */
-        source->clean_right_offset = svq3_get_ue_golomb(gb);
-    }
-
-    /* [DIRAC_STD] 10.3.8 Signal range. signal_range(video_params)
-     * WARNING: Some adaptation seems to be done using the
-     * AVCOL_RANGE_MPEG/JPEG values */
-    if (get_bits1(gb)) { /* [DIRAC_STD] custom_signal_range_flag */
-        /* [DIRAC_STD] index */
-        source->pixel_range_index = svq3_get_ue_golomb(gb);
-
-        if (source->pixel_range_index > 4)
-            return AVERROR_INVALIDDATA;
-
-        // This assumes either fullrange or MPEG levels only
-        if (!source->pixel_range_index) {
-            luma_offset = svq3_get_ue_golomb(gb);
-            luma_depth  = av_log2(svq3_get_ue_golomb(gb))+1;
-            svq3_get_ue_golomb(gb); /* chroma offset    */
-            svq3_get_ue_golomb(gb); /* chroma excursion */
-            avctx->color_range = luma_offset ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
-        }
-    }
-    /* [DIRAC_STD] Table 10.5
-     * Available signal range presets <--> pixel_range_presets */
-    if (source->pixel_range_index > 0) {
-        idx                = source->pixel_range_index-1;
-        luma_depth         = pixel_range_presets[idx].bitdepth;
-        avctx->color_range = pixel_range_presets[idx].color_range;
-    }
-
-    if (luma_depth > 8)
-        av_log(avctx, AV_LOG_WARNING, "Bitdepth greater than 8");
-
-    avctx->pix_fmt = dirac_pix_fmt[!luma_offset][source->chroma_format];
-
-    /* [DIRAC_STD] 10.3.9 Colour specification. colour_spec(video_params) */
-    if (get_bits1(gb)) { /* [DIRAC_STD] custom_colour_spec_flag */
-         /* [DIRAC_STD] index */
-        idx = source->color_spec_index = svq3_get_ue_golomb(gb);
-
-        if (source->color_spec_index > 4)
-            return AVERROR_INVALIDDATA;
-
-        avctx->color_primaries = dirac_color_presets[idx].color_primaries;
-        avctx->colorspace      = dirac_color_presets[idx].colorspace;
-        avctx->color_trc       = dirac_color_presets[idx].color_trc;
-
-        if (!source->color_spec_index) {
-            /* [DIRAC_STD] 10.3.9.1 Colour primaries */
-            if (get_bits1(gb)) {
-                idx = svq3_get_ue_golomb(gb);
-                if (idx < 3)
-                    avctx->color_primaries = dirac_primaries[idx];
-            }
-            /* [DIRAC_STD] 10.3.9.2 Colour matrix */
-            if (get_bits1(gb)) {
-                idx = svq3_get_ue_golomb(gb);
-                if (!idx)
-                    avctx->colorspace = AVCOL_SPC_BT709;
-                else if (idx == 1)
-                    avctx->colorspace = AVCOL_SPC_BT470BG;
-            }
-            /* [DIRAC_STD] 10.3.9.3 Transfer function */
-            if (get_bits1(gb) && !svq3_get_ue_golomb(gb))
-                avctx->color_trc = AVCOL_TRC_BT709;
-        }
-    } else {
-        idx = source->color_spec_index;
-        avctx->color_primaries = dirac_color_presets[idx].color_primaries;
-        avctx->colorspace      = dirac_color_presets[idx].colorspace;
-        avctx->color_trc       = dirac_color_presets[idx].color_trc;
-    }
-
-    return 0;
-}
-
-/* [DIRAC_STD] 10. Sequence Header. sequence_header() */
-int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
-                                   dirac_source_params *source)
-{
-    unsigned version_major;
-    unsigned video_format, picture_coding_mode;
-    int ret;
-
-    /* [DIRAC_SPEC] 10.1 Parse Parameters. parse_parameters() */
-    version_major  = svq3_get_ue_golomb(gb);
-    svq3_get_ue_golomb(gb); /* version_minor */
-    avctx->profile = svq3_get_ue_golomb(gb);
-    avctx->level   = svq3_get_ue_golomb(gb);
-    /* [DIRAC_SPEC] sequence_header() -> base_video_format as defined in
-     * 10.2 Base Video Format, table 10.1 Dirac predefined video formats */
-    video_format   = svq3_get_ue_golomb(gb);
-
-    if (version_major < 2)
-        av_log(avctx, AV_LOG_WARNING, "Stream is old and may not work\n");
-    else if (version_major > 2)
-        av_log(avctx, AV_LOG_WARNING, "Stream may have unhandled features\n");
-
-    if (video_format > 20)
-        return AVERROR_INVALIDDATA;
-
-    // Fill in defaults for the source parameters.
-    *source = dirac_source_parameters_defaults[video_format];
-
-    /* [DIRAC_STD] 10.3 Source Parameters
-     * Override the defaults. */
-    if (ret = parse_source_parameters(avctx, gb, source))
-        return ret;
-
-    ret = ff_set_dimensions(avctx, source->width, source->height);
-    if (ret < 0)
-        return ret;
-
-    /* [DIRAC_STD] picture_coding_mode shall be 0 for fields and 1 for frames
-     * currently only used to signal field coding */
-    picture_coding_mode = svq3_get_ue_golomb(gb);
-    if (picture_coding_mode != 0) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported picture coding mode %d",
-               picture_coding_mode);
-        return AVERROR_INVALIDDATA;
-    }
-    return 0;
-}
diff --git a/deps/libav/libavcodec/dirac.h b/deps/libav/libavcodec/dirac.h
deleted file mode 100644
index e5b79b0..0000000
--- a/deps/libav/libavcodec/dirac.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2007 Marco Gerards <marco at gnu.org>
- * Copyright (C) 2009 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DIRAC_H
-#define AVCODEC_DIRAC_H
-
-/**
- * @file
- * Interface to Dirac Decoder/Encoder
- * @author Marco Gerards <marco at gnu.org>
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-
-typedef struct dirac_source_params {
-    unsigned width;
-    unsigned height;
-    uint8_t chroma_format;          ///< 0: 444  1: 422  2: 420
-
-    uint8_t interlaced;
-    uint8_t top_field_first;
-
-    uint8_t frame_rate_index;       ///< index into dirac_frame_rate[]
-    uint8_t aspect_ratio_index;     ///< index into dirac_aspect_ratio[]
-
-    uint16_t clean_width;
-    uint16_t clean_height;
-    uint16_t clean_left_offset;
-    uint16_t clean_right_offset;
-
-    uint8_t pixel_range_index;      ///< index into dirac_pixel_range_presets[]
-    uint8_t color_spec_index;       ///< index into dirac_color_spec_presets[]
-} dirac_source_params;
-
-int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
-                                       dirac_source_params *source);
-
-#endif /* AVCODEC_DIRAC_H */
diff --git a/deps/libav/libavcodec/dirac_parser.c b/deps/libav/libavcodec/dirac_parser.c
deleted file mode 100644
index 46f5430..0000000
--- a/deps/libav/libavcodec/dirac_parser.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Dirac parser
- *
- * Copyright (c) 2007-2008 Marco Gerards <marco at gnu.org>
- * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Dirac Parser
- * @author Marco Gerards <marco at gnu.org>
- */
-
-#include <string.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mem.h"
-#include "parser.h"
-
-#define DIRAC_PARSE_INFO_PREFIX 0x42424344
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame or -1
- */
-typedef struct DiracParseContext {
-    int state;
-    int is_synced;
-    int sync_offset;
-    int header_bytes_needed;
-    int overread_index;
-    int buffer_size;
-    int index;
-    uint8_t *buffer;
-    int dirac_unit_size;
-    uint8_t *dirac_unit;
-} DiracParseContext;
-
-static int find_frame_end(DiracParseContext *pc,
-                          const uint8_t *buf, int buf_size)
-{
-    uint32_t state = pc->state;
-    int i = 0;
-
-    if (!pc->is_synced) {
-        for (i = 0; i < buf_size; i++) {
-            state = (state << 8) | buf[i];
-            if (state == DIRAC_PARSE_INFO_PREFIX) {
-                state                   = -1;
-                pc->is_synced           = 1;
-                pc->header_bytes_needed = 9;
-                pc->sync_offset         = i;
-                break;
-            }
-        }
-    }
-
-    if (pc->is_synced) {
-        pc->sync_offset = 0;
-        for (; i < buf_size; i++) {
-            if (state == DIRAC_PARSE_INFO_PREFIX) {
-                if ((buf_size-i) >= pc->header_bytes_needed) {
-                    pc->state = -1;
-                    return i + pc->header_bytes_needed;
-                } else {
-                    pc->header_bytes_needed = 9-(buf_size-i);
-                    break;
-                }
-            } else
-              state = (state << 8) | buf[i];
-        }
-    }
-    pc->state = state;
-    return -1;
-}
-
-typedef struct DiracParseUnit
-{
-    int next_pu_offset;
-    int prev_pu_offset;
-    uint8_t pu_type;
-} DiracParseUnit;
-
-static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
-                             int offset)
-{
-    uint8_t *start = pc->buffer + offset;
-    uint8_t *end   = pc->buffer + pc->index;
-    if (start < pc->buffer || (start+13 > end))
-        return 0;
-    pu->pu_type = start[4];
-
-    pu->next_pu_offset = AV_RB32(start+5);
-    pu->prev_pu_offset = AV_RB32(start+9);
-
-    if (pu->pu_type == 0x10 && pu->next_pu_offset == 0)
-        pu->next_pu_offset = 13;
-
-    return 1;
-}
-
-static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
-                               int next, const uint8_t **buf, int *buf_size)
-{
-    int parse_timing_info = (s->pts == AV_NOPTS_VALUE &&
-                             s->dts == AV_NOPTS_VALUE);
-    DiracParseContext *pc = s->priv_data;
-
-    if (pc->overread_index) {
-        memcpy(pc->buffer, pc->buffer + pc->overread_index,
-               pc->index - pc->overread_index);
-        pc->index -= pc->overread_index;
-        pc->overread_index = 0;
-        if (*buf_size == 0 && pc->buffer[4] == 0x10) {
-            *buf      = pc->buffer;
-            *buf_size = pc->index;
-            return 0;
-        }
-    }
-
-    if ( next == -1) {
-        /* Found a possible frame start but not a frame end */
-        void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
-                                           pc->index + (*buf_size -
-                                                        pc->sync_offset));
-        pc->buffer = new_buffer;
-        memcpy(pc->buffer+pc->index, (*buf + pc->sync_offset),
-               *buf_size - pc->sync_offset);
-        pc->index += *buf_size - pc->sync_offset;
-        return -1;
-    } else {
-        /* Found a possible frame start and a  possible frame end */
-        DiracParseUnit pu1, pu;
-        void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
-                                           pc->index + next);
-        pc->buffer = new_buffer;
-        memcpy(pc->buffer + pc->index, *buf, next);
-        pc->index += next;
-
-        /* Need to check if we have a valid Parse Unit. We can't go by the
-         * sync pattern 'BBCD' alone because arithmetic coding of the residual
-         * and motion data can cause the pattern triggering a false start of
-         * frame. So check if the previous parse offset of the next parse unit
-         * is equal to the next parse offset of the current parse unit then
-         * we can be pretty sure that we have a valid parse unit */
-        if (!unpack_parse_unit(&pu1, pc, pc->index - 13)                     ||
-            !unpack_parse_unit(&pu, pc, pc->index - 13 - pu1.prev_pu_offset) ||
-            pu.next_pu_offset != pu1.prev_pu_offset) {
-            pc->index -= 9;
-            *buf_size = next-9;
-            pc->header_bytes_needed = 9;
-            return -1;
-        }
-
-        /* All non-frame data must be accompanied by frame data. This is to
-         * ensure that pts is set correctly. So if the current parse unit is
-         * not frame data, wait for frame data to come along */
-
-        pc->dirac_unit = pc->buffer + pc->index - 13 -
-                         pu1.prev_pu_offset - pc->dirac_unit_size;
-
-        pc->dirac_unit_size += pu.next_pu_offset;
-
-        if ((pu.pu_type&0x08) != 0x08) {
-            pc->header_bytes_needed = 9;
-            *buf_size = next;
-            return -1;
-        }
-
-        /* Get the picture number to set the pts and dts*/
-        if (parse_timing_info) {
-            uint8_t *cur_pu = pc->buffer +
-                              pc->index - 13 - pu1.prev_pu_offset;
-            int pts =  AV_RB32(cur_pu + 13);
-            if (s->last_pts == 0 && s->last_dts == 0)
-                s->dts = pts - 1;
-            else
-                s->dts = s->last_dts+1;
-            s->pts = pts;
-            if (!avctx->has_b_frames && (cur_pu[4] & 0x03))
-                avctx->has_b_frames = 1;
-        }
-        if (avctx->has_b_frames && s->pts == s->dts)
-             s->pict_type = AV_PICTURE_TYPE_B;
-
-        /* Finally have a complete Dirac data unit */
-        *buf      = pc->dirac_unit;
-        *buf_size = pc->dirac_unit_size;
-
-        pc->dirac_unit_size     = 0;
-        pc->overread_index      = pc->index-13;
-        pc->header_bytes_needed = 9;
-    }
-    return next;
-}
-
-static int dirac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
-                       const uint8_t **poutbuf, int *poutbuf_size,
-                       const uint8_t *buf, int buf_size)
-{
-    DiracParseContext *pc = s->priv_data;
-    int next;
-
-    *poutbuf = NULL;
-    *poutbuf_size = 0;
-
-    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
-        next = buf_size;
-        *poutbuf = buf;
-        *poutbuf_size = buf_size;
-        /* Assume that data has been packetized into an encapsulation unit. */
-    } else {
-        next = find_frame_end(pc, buf, buf_size);
-        if (!pc->is_synced && next == -1) {
-            /* No frame start found yet. So throw away the entire buffer. */
-            return buf_size;
-        }
-
-        if (dirac_combine_frame(s, avctx, next, &buf, &buf_size) < 0) {
-            return buf_size;
-        }
-    }
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-static void dirac_parse_close(AVCodecParserContext *s)
-{
-    DiracParseContext *pc = s->priv_data;
-
-    if (pc->buffer_size > 0)
-        av_free(pc->buffer);
-}
-
-AVCodecParser ff_dirac_parser = {
-    .codec_ids      = { AV_CODEC_ID_DIRAC },
-    .priv_data_size = sizeof(DiracParseContext),
-    .parser_parse   = dirac_parse,
-    .parser_close   = dirac_parse_close,
-};
diff --git a/deps/libav/libavcodec/dnxhd_parser.c b/deps/libav/libavcodec/dnxhd_parser.c
deleted file mode 100644
index d981079..0000000
--- a/deps/libav/libavcodec/dnxhd_parser.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * DNxHD/VC-3 parser
- * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier at free.fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DNxHD/VC-3 parser
- */
-
-#include "parser.h"
-
-#define DNXHD_HEADER_PREFIX 0x0000028001
-
-static int dnxhd_find_frame_end(ParseContext *pc,
-                                const uint8_t *buf, int buf_size)
-{
-    uint64_t state = pc->state64;
-    int pic_found = pc->frame_start_found;
-    int i = 0;
-
-    if (!pic_found) {
-        for (i = 0; i < buf_size; i++) {
-            state = (state<<8) | buf[i];
-            if ((state & 0xffffffffffLL) == DNXHD_HEADER_PREFIX) {
-                i++;
-                pic_found = 1;
-                break;
-            }
-        }
-    }
-
-    if (pic_found) {
-        if (!buf_size) /* EOF considered as end of frame */
-            return 0;
-        for (; i < buf_size; i++) {
-            state = (state<<8) | buf[i];
-            if ((state & 0xffffffffffLL) == DNXHD_HEADER_PREFIX) {
-                pc->frame_start_found = 0;
-                pc->state64 = -1;
-                return i-4;
-            }
-        }
-    }
-    pc->frame_start_found = pic_found;
-    pc->state64 = state;
-    return END_NOT_FOUND;
-}
-
-static int dnxhd_parse(AVCodecParserContext *s,
-                       AVCodecContext *avctx,
-                       const uint8_t **poutbuf, int *poutbuf_size,
-                       const uint8_t *buf, int buf_size)
-{
-    ParseContext *pc = s->priv_data;
-    int next;
-
-    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
-        next = buf_size;
-    } else {
-        next = dnxhd_find_frame_end(pc, buf, buf_size);
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-    }
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_dnxhd_parser = {
-    .codec_ids      = { AV_CODEC_ID_DNXHD },
-    .priv_data_size = sizeof(ParseContext),
-    .parser_parse   = dnxhd_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/dnxhddata.c b/deps/libav/libavcodec/dnxhddata.c
deleted file mode 100644
index a8d713b..0000000
--- a/deps/libav/libavcodec/dnxhddata.c
+++ /dev/null
@@ -1,1183 +0,0 @@
-/*
- * VC3/DNxHD data.
- * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "dnxhddata.h"
-#include "libavutil/common.h"
-
-static const uint8_t dnxhd_1235_luma_weight[] = {
-     0, 32, 32, 32, 33, 35, 38, 39,
-    32, 33, 32, 33, 36, 36, 39, 42,
-    32, 32, 33, 36, 35, 37, 41, 43,
-    31, 33, 34, 36, 36, 40, 42, 48,
-    32, 34, 36, 37, 39, 42, 46, 51,
-    36, 37, 37, 39, 41, 46, 51, 55,
-    37, 39, 41, 41, 47, 50, 55, 56,
-    41, 42, 41, 44, 50, 53, 60, 60
-};
-
-static const uint8_t dnxhd_1235_chroma_weight[] = {
-     0, 32, 33, 34, 39, 41, 54, 59,
-    33, 34, 35, 38, 43, 49, 58, 84,
-    34, 37, 39, 44, 46, 55, 74, 87,
-    40, 42, 47, 48, 58, 70, 87, 86,
-    43, 50, 56, 63, 72, 94, 91, 82,
-    55, 63, 65, 75, 93, 89, 85, 73,
-    61, 67, 82, 81, 83, 90, 79, 73,
-    74, 84, 75, 78, 90, 85, 73, 73
-};
-
-static const uint8_t dnxhd_1237_luma_weight[] = {
-     0,  32,  33,  34, 34, 36, 37, 36,
-    36,  37,  38,  38, 38, 39, 41, 44,
-    43,  41,  40,  41, 46, 49, 47, 46,
-    47,  49,  51,  54, 60, 62, 59, 55,
-    54,  56,  58,  61, 65, 66, 64, 63,
-    66,  73,  78,  79, 80, 79, 78, 78,
-    82,  87,  89,  90, 93, 95, 96, 97,
-    97, 100, 104, 102, 98, 98, 99, 99,
-};
-
-static const uint8_t dnxhd_1237_chroma_weight[] = {
-     0,  32,  36,  39, 39, 38, 39,  41,
-    45,  51,  57,  58, 53, 48, 47,  51,
-    55,  58,  66,  75, 81, 83, 82,  78,
-    73,  72,  74,  77, 83, 85, 83,  82,
-    89,  99,  96,  90, 94, 97, 99, 105,
-   109, 105,  95,  89, 92, 95, 94,  93,
-    92,  88,  89,  90, 93, 95, 96,  97,
-    97, 100, 104, 102, 98, 98, 99,  99,
-};
-
-static const uint8_t dnxhd_1238_luma_weight[] = {
-     0, 32, 32, 33, 34, 33, 33, 33,
-    33, 33, 33, 33, 33, 35, 37, 37,
-    36, 36, 35, 36, 38, 38, 36, 35,
-    36, 37, 38, 41, 42, 41, 39, 38,
-    38, 38, 39, 41, 42, 41, 39, 39,
-    40, 41, 43, 44, 44, 44, 44, 44,
-    45, 47, 47, 47, 49, 50, 51, 51,
-    51, 53, 55, 57, 58, 59, 57, 57,
-};
-
-static const uint8_t dnxhd_1238_chroma_weight[] = {
-     0, 32, 35, 35, 35, 34, 34, 35,
-    39, 43, 45, 45, 41, 39, 40, 41,
-    42, 44, 48, 55, 59, 63, 65, 59,
-    53, 52, 52, 55, 61, 62, 58, 58,
-    63, 66, 66, 65, 70, 74, 70, 66,
-    65, 68, 75, 77, 74, 74, 77, 76,
-    73, 73, 73, 73, 76, 80, 89, 90,
-    82, 77, 80, 86, 84, 82, 82, 82,
-};
-
-static const uint8_t dnxhd_1241_luma_weight[] = {
-     0, 32, 33, 34, 34, 35, 36, 37,
-    36, 37, 38, 38, 38, 39, 39, 40,
-    40, 38, 38, 39, 38, 37, 39, 41,
-    41, 42, 43, 45, 45, 46, 47, 46,
-    45, 43, 39, 37, 37, 40, 44, 45,
-    45, 46, 46, 46, 47, 47, 46, 44,
-    42, 43, 45, 47, 48, 49, 50, 49,
-    48, 46, 47, 48, 48, 49, 49, 49,
-};
-
-static const uint8_t dnxhd_1241_chroma_weight[] = {
-     0, 32, 36, 38, 37, 37, 40, 41,
-    40, 40, 42, 42, 41, 41, 41, 41,
-    42, 43, 44, 44, 45, 46, 46, 45,
-    44, 45, 45, 45, 45, 46, 47, 46,
-    45, 44, 42, 41, 43, 45, 45, 47,
-    48, 48, 48, 46, 47, 47, 46, 47,
-    46, 45, 45, 47, 48, 49, 50, 49,
-    48, 46, 48, 49, 48, 49, 49, 49,
-};
-
-static const uint8_t dnxhd_1242_luma_weight[] = {
-     0, 32, 33, 33, 34, 35, 36, 35,
-    33, 33, 35, 36, 37, 37, 38, 37,
-    37, 37, 36, 37, 37, 37, 38, 39,
-    37, 36, 37, 40, 42, 45, 46, 44,
-    41, 42, 44, 45, 47, 49, 50, 48,
-    46, 48, 49, 50, 52, 52, 50, 49,
-    47, 48, 50, 50, 51, 51, 50, 49,
-    49, 51, 52, 51, 49, 47, 47, 47,
-};
-
-static const uint8_t dnxhd_1242_chroma_weight[] = {
-     0, 32, 37, 42, 45, 45, 45, 44,
-    38, 37, 40, 42, 44, 49, 51, 47,
-    41, 40, 43, 44, 46, 48, 51, 54,
-    51, 47, 47, 45, 47, 50, 51, 49,
-    46, 47, 49, 47, 50, 55, 55, 51,
-    48, 49, 51, 51, 52, 52, 54, 54,
-    49, 49, 52, 53, 54, 54, 53, 53,
-    55, 59, 63, 62, 60, 60, 60, 60,
-};
-
-static const uint8_t dnxhd_1243_luma_weight[] = {
-     0, 32, 32, 33, 33, 35, 35, 35,
-    35, 35, 35, 35, 34, 35, 38, 40,
-    39, 37, 37, 37, 36, 35, 36, 38,
-    40, 41, 42, 44, 45, 44, 42, 41,
-    40, 38, 36, 36, 37, 38, 40, 43,
-    44, 45, 45, 45, 45, 45, 45, 41,
-    39, 41, 45, 47, 47, 48, 48, 48,
-    46, 44, 45, 47, 47, 48, 47, 47,
-};
-
-static const uint8_t dnxhd_1243_chroma_weight[] = {
-     0, 32, 36, 37, 36, 37, 39, 39,
-    41, 43, 43, 42, 41, 41, 41, 42,
-    43, 43, 43, 44, 44, 44, 46, 47,
-    46, 45, 45, 45, 45, 46, 44, 44,
-    45, 44, 42, 41, 43, 46, 45, 44,
-    45, 45, 45, 46, 46, 46, 45, 44,
-    45, 44, 45, 47, 47, 48, 49, 48,
-    46, 45, 46, 47, 47, 48, 47, 47,
-};
-
-static const uint8_t dnxhd_1250_luma_weight[] = {
-     0, 32, 35, 35, 36, 36, 41, 43,
-    32, 34, 35, 36, 37, 39, 43, 47,
-    33, 34, 36, 38, 38, 42, 42, 50,
-    34, 36, 38, 38, 41, 40, 47, 54,
-    35, 38, 39, 40, 39, 45, 49, 58,
-    38, 39, 40, 39, 46, 47, 54, 60,
-    38, 39, 41, 46, 46, 48, 57, 62,
-    40, 41, 44, 45, 49, 54, 63, 63
-};
-
-static const uint8_t dnxhd_1250_chroma_weight[] = {
-     0, 32, 35, 36, 40, 42, 51, 51,
-    35, 36, 39, 39, 43, 51, 52, 55,
-    36, 41, 41, 43, 51, 53, 54, 56,
-    43, 44, 45, 50, 54, 54, 55, 57,
-    45, 48, 50, 51, 55, 58, 59, 58,
-    49, 52, 49, 57, 58, 62, 58, 60,
-    51, 51, 56, 58, 62, 61, 59, 62,
-    52, 52, 60, 61, 59, 59, 63, 63
-};
-
-static const uint8_t dnxhd_1251_luma_weight[] = {
-     0, 32, 32, 34, 34, 34, 34, 35,
-    35, 35, 36, 37, 36, 36, 35, 36,
-    38, 38, 38, 38, 38, 38, 38, 38,
-    38, 38, 39, 41, 44, 43, 41, 40,
-    40, 40, 40, 39, 40, 41, 40, 39,
-    40, 43, 46, 46, 44, 44, 44, 42,
-    41, 43, 46, 48, 50, 55, 58, 53,
-    48, 50, 55, 58, 61, 62, 62, 62,
-};
-
-static const uint8_t dnxhd_1251_chroma_weight[] = {
-     0, 32, 35, 36, 36, 35, 36, 39,
-    41, 43, 45, 44, 41, 39, 40, 42,
-    43, 43, 45, 48, 48, 48, 50, 50,
-    50, 51, 51, 51, 51, 52, 53, 54,
-    51, 49, 51, 52, 52, 56, 57, 55,
-    54, 54, 55, 56, 55, 58, 58, 58,
-    60, 61, 62, 62, 59, 57, 58, 58,
-    61, 59, 59, 59, 61, 62, 62, 62,
-};
-
-static const uint8_t dnxhd_1252_luma_weight[] = {
-      0,  32,  34, 35, 36, 36, 36, 37,
-     36,  37,  39, 40, 41, 40, 40, 40,
-     41,  41,  42, 41, 41, 43, 44, 44,
-     45,  46,  48, 55, 60, 57, 52, 50,
-     49,  49,  52, 52, 53, 55, 58, 62,
-     65,  73,  82, 82, 80, 78, 73, 68,
-     71,  82,  90, 90, 88, 87, 90, 95,
-    100, 107, 103, 97, 95, 93, 99, 99,
-};
-static const uint8_t dnxhd_1252_chroma_weight[] = {
-      0,  32,  35,  36,  37,  37,  38,  40,
-     42,  46,  49,  50,  50,  49,  49,  53,
-     56,  56,  57,  58,  60,  62,  64,  65,
-     63,  64,  64,  65,  66,  65,  67,  71,
-     72,  74,  74,  74,  74,  77,  81,  78,
-     72,  73,  82,  85,  89,  88,  84,  80,
-     90, 100,  90,  90,  88,  87,  90,  95,
-    114, 128, 125, 129, 134, 125, 116, 116,
-};
-
-static const uint8_t dnxhd_1256_chroma_weight[] = {
-     0, 32, 32, 32, 32, 32, 32, 33,
-    32, 32, 32, 32, 32, 32, 32, 34,
-    32, 32, 32, 32, 32, 32, 33, 37,
-    32, 32, 32, 32, 32, 32, 36, 39,
-    32, 32, 32, 32, 32, 34, 39, 44,
-    32, 37, 32, 32, 35, 40, 43, 49,
-    32, 33, 36, 36, 40, 43, 50, 60,
-    34, 37, 39, 44, 51, 56, 61, 70,
-};
-
-static const uint8_t dnxhd_1237_dc_codes[12] = {
-    0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
-};
-
-static const uint8_t dnxhd_1237_dc_bits[12] = {
-    3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
-};
-
-static const uint16_t dnxhd_1237_ac_codes[257] = {
-        0,     1,     4,     5,    12,    26,    27,    56,
-       57,    58,    59,   120,   121,   244,   245,   246,
-      247,   248,   498,   499,   500,   501,   502,  1006,
-     1007,  1008,  1009,  1010,  1011,  2024,  2025,  2026,
-     2027,  2028,  2029,  2030,  2031,  4064,  4065,  4066,
-     4067,  4068,  4069,  4070,  4071,  4072,  4073,  8148,
-     8149,  8150,  8151,  8152,  8153,  8154,  8155,  8156,
-     8157,  8158, 16318, 16319, 16320, 16321, 16322, 16323,
-    16324, 16325, 16326, 16327, 16328, 16329, 16330, 16331,
-    16332, 16333, 32668, 32669, 32670, 32671, 32672, 32673,
-    32674, 32675, 32676, 32677, 32678, 32679, 32680, 32681,
-    32682, 32683, 32684, 65370, 65371, 65372, 65373, 65374,
-    65375, 65376, 65377, 65378, 65379, 65380, 65381, 65382,
-    65383, 65384, 65385, 65386, 65387, 65388, 65389, 65390,
-    65391, 65392, 65393, 65394, 65395, 65396, 65397, 65398,
-    65399, 65400, 65401, 65402, 65403, 65404, 65405, 65406,
-    65407, 65408, 65409, 65410, 65411, 65412, 65413, 65414,
-    65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422,
-    65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430,
-    65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
-    65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
-    65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
-    65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
-    65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
-    65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
-    65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
-    65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
-    65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
-    65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
-    65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
-    65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
-    65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
-    65535,
-};
-
-static const uint8_t dnxhd_1237_ac_bits[257] = {
-     2,  2,  3,  3,  4,  5,  5,  6,  6,  6,  6,  7,  7,  8,  8,  8,
-     8,  8,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 11, 11, 11,
-    11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13,
-    13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16,
-};
-
-static const uint8_t dnxhd_1237_ac_level[257] = {
-     1,  1,  2,  0,  3,  4,  2,  5,  6,  7,  3,  8,  9, 10, 11, 12,
-     4,  5, 13, 14, 15, 16,  6, 17, 18, 19, 20, 21,  7, 22, 23, 24,
-    25, 26, 27,  8,  9, 28, 29, 30, 31, 32, 33, 34, 10, 11, 12, 35,
-    36, 37, 38, 39, 40, 41, 13, 14, 15, 16, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 17, 18, 19, 20, 21, 53, 54, 55, 56, 57, 58,
-    59, 60, 61, 64,  1, 22, 23, 24, 25, 26, 27, 62, 63,  2,  3,  4,
-     5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
-    21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
-    37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
-    53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,
-};
-
-static const uint8_t dnxhd_1237_ac_run_flag[257] = {
-    0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-    1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
-    0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0,
-    0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-static const uint8_t dnxhd_1237_ac_index_flag[257] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-static const uint16_t dnxhd_1237_run_codes[62] = {
-       0,    4,   10,   11,   24,   25,   26,   54,
-      55,   56,   57,   58,  118,  119,  240,  482,
-     483,  484,  485,  486,  487,  488,  489,  490,
-     491,  492,  493,  494,  990,  991,  992,  993,
-     994,  995,  996,  997,  998,  999, 1000, 1001,
-    1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
-    1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
-    1018, 1019, 1020, 1021, 1022, 1023,
-};
-
-static const uint8_t dnxhd_1237_run_bits[62] = {
-     1,  3,  4,  4,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,  8,  9,
-     9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-};
-
-static const uint8_t dnxhd_1237_run[62] = {
-     1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
-    17, 18, 19, 20, 21, 53, 57, 58, 59, 60, 61, 62, 22, 23, 24, 25,
-    26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
-    42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56,
-};
-
-static const uint8_t dnxhd_1238_dc_codes[12] = {
-    0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
-};
-
-static const uint8_t dnxhd_1238_dc_bits[12] = {
-    3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
-};
-
-static const uint16_t dnxhd_1238_ac_codes[257] = {
-        0,     1,     4,    10,    11,    24,    25,    26,
-       54,    55,    56,    57,   116,   117,   118,   119,
-      240,   241,   242,   243,   244,   245,   492,   493,
-      494,   495,   496,   497,   498,   499,  1000,  1001,
-     1002,  1003,  1004,  1005,  1006,  1007,  1008,  2018,
-     2019,  2020,  2021,  2022,  2023,  2024,  2025,  2026,
-     2027,  4056,  4057,  4058,  4059,  4060,  4061,  4062,
-     4063,  4064,  4065,  4066,  4067,  4068,  4069,  8140,
-     8141,  8142,  8143,  8144,  8145,  8146,  8147,  8148,
-     8149,  8150,  8151,  8152,  8153,  8154,  8155,  8156,
-    16314, 16315, 16316, 16317, 16318, 16319, 16320, 16321,
-    16322, 16323, 16324, 16325, 16326, 16327, 16328, 16329,
-    16330, 16331, 16332, 16333, 16334, 16335, 16336, 16337,
-    16338, 32678, 32679, 32680, 32681, 32682, 32683, 32684,
-    32685, 32686, 32687, 32688, 32689, 32690, 32691, 32692,
-    32693, 32694, 32695, 32696, 32697, 32698, 32699, 32700,
-    32701, 32702, 32703, 32704, 32705, 65412, 65413, 65414,
-    65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422,
-    65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430,
-    65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
-    65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
-    65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
-    65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
-    65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
-    65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
-    65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
-    65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
-    65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
-    65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
-    65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
-    65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
-    65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
-    65535,
-};
-
-static const uint8_t dnxhd_1238_ac_bits[257] = {
-     2,  2,  3,  4,  4,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,
-     8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13,
-    13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-    14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16,
-};
-
-static const uint8_t dnxhd_1238_ac_level[257] = {
-     1,  1,  2,  3,  0,  4,  5,  2,  6,  7,  8,  3,  9, 10, 11,  4,
-    12, 13, 14, 15, 16,  5, 17, 18, 19, 20, 21, 22,  6,  7, 23, 24,
-    25, 26, 27, 28, 29,  8,  9, 30, 31, 32, 33, 34, 35, 36, 37, 10,
-    11, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 12, 13, 14, 49,
-    50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 15, 16, 17, 18,
-    62, 63, 64,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,
-    14, 15, 16, 19, 20, 21, 22, 23, 24, 17, 18, 19, 20, 21, 22, 23,
-    24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 40, 25,
-    26, 27, 28, 29, 30, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49,
-    50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,
-}; /* 0 is EOB */
-
-static const uint8_t dnxhd_1238_ac_run_flag[257] = {
-    0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
-    0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0,
-    0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-    1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-    1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-static const uint8_t dnxhd_1238_ac_index_flag[257] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
-    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-static const uint16_t dnxhd_1235_1238_1241_run_codes[62] = {
-       0,    4,   10,   11,   24,   25,   26,   27,
-      56,   57,   58,   59,  120,  242,  486,  487,
-     488,  489,  980,  981,  982,  983,  984,  985,
-     986,  987,  988,  989,  990,  991,  992,  993,
-     994,  995,  996,  997,  998,  999, 1000, 1001,
-    1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
-    1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
-    1018, 1019, 1020, 1021, 1022, 1023,
-};
-
-static const uint8_t dnxhd_1235_1238_1241_run_bits[62] = {
-     1,  3,  4,  4,  5,  5,  5,  5,  6,  6,  6,  6,  7,  8,  9,  9,
-     9,  9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-};
-
-static const uint8_t dnxhd_1238_run[62] = {
-     1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
-    20, 21, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
-    33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
-    49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
-};
-
-static const uint8_t dnxhd_1235_1241_dc_codes[14] = {
-    10, 62, 11, 12, 13, 0, 1, 2, 3, 4, 14, 30, 126, 127,
-};
-
-static const uint8_t dnxhd_1235_1241_dc_bits[14] = {
-    4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7,
-};
-
-static const uint16_t dnxhd_1235_1241_ac_codes[257] = {
-        0,     1,     4,    10,    11,    24,    25,    26,
-       54,    55,    56,    57,   116,   117,   118,   119,
-      240,   241,   242,   243,   244,   245,   492,   493,
-      494,   495,   496,   497,   498,   998,   999,  1000,
-     1001,  1002,  1003,  1004,  1005,  1006,  1007,  2016,
-     2017,  2018,  2019,  2020,  2021,  2022,  2023,  2024,
-     2025,  2026,  4054,  4055,  4056,  4057,  4058,  4059,
-     4060,  4061,  4062,  4063,  4064,  4065,  4066,  4067,
-     4068,  4069,  8140,  8141,  8142,  8143,  8144,  8145,
-     8146,  8147,  8148,  8149,  8150,  8151,  8152,  8153,
-     8154,  8155,  8156,  8157, 16316, 16317, 16318, 16319,
-    16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327,
-    16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335,
-    16336, 16337, 32676, 32677, 32678, 32679, 32680, 32681,
-    32682, 32683, 32684, 32685, 32686, 32687, 32688, 32689,
-    32690, 32691, 32692, 32693, 32694, 32695, 32696, 32697,
-    32698, 32699, 32700, 32701, 32702, 32703, 32704, 32705,
-    32706, 32707, 32708, 65418, 65419, 65420, 65421, 65422,
-    65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430,
-    65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
-    65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
-    65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
-    65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
-    65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
-    65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
-    65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
-    65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
-    65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
-    65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
-    65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
-    65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
-    65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
-    65535,
-};
-
-static const uint8_t dnxhd_1235_1241_ac_bits[257] = {
-     2,  2,  3,  4,  4,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,
-     8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16,
-};
-
-static const uint8_t dnxhd_1235_1241_ac_level[257] = {
-     1,  1,  2,  3,  0,  4,  5,  2,  6,  7,  8,  3,  9, 10, 11,  4,
-    12, 13, 14, 15, 16,  5, 17, 18, 19, 20, 21,  6,  7, 22, 23, 24,
-    25, 26, 27, 28, 29,  8,  9, 30, 31, 32, 33, 34, 35, 36, 37, 38,
-    10, 11, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 12, 13,
-    14, 15, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,  1,
-    16, 17, 18, 19, 64,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12,
-    13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 18, 19, 20, 21, 22, 23,
-    24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
-    40, 41, 42, 25, 26, 27, 28, 29, 30, 31, 32, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,
-};
-
-static const uint8_t dnxhd_1235_1241_ac_run_flag[257] = {
-    0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
-    0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
-    0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
-    1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-static const uint8_t dnxhd_1235_1241_ac_index_flag[257] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-static const uint8_t dnxhd_1235_1241_run[62] = {
-     1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
-    18, 20, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
-    33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
-    49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
-};
-
-static const uint8_t dnxhd_1250_dc_codes[14] = {
-    10, 62, 11, 12, 13, 0, 1, 2, 3, 4, 14, 30, 126, 127
-};
-static const uint8_t dnxhd_1250_dc_bits[14] = {
-    4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7
-};
-static const uint16_t dnxhd_1250_ac_codes[257] = {
-        0,     1,     4,    10,    11,    24,    25,    26,
-       54,    55,    56,    57,   116,   117,   118,   119,
-      240,   241,   242,   243,   244,   245,   492,   493,
-      494,   495,   496,   497,   498,   998,   999,  1000,
-     1001,  1002,  1003,  1004,  1005,  1006,  2014,  2015,
-     2016,  2017,  2018,  2019,  2020,  2021,  2022,  2023,
-     2024,  2025,  4052,  4053,  4054,  4055,  4056,  4057,
-     4058,  4059,  4060,  4061,  4062,  4063,  4064,  4065,
-     4066,  4067,  8136,  8137,  8138,  8139,  8140,  8141,
-     8142,  8143,  8144,  8145,  8146,  8147,  8148,  8149,
-     8150,  8151,  8152,  8153,  8154,  8155,  8156, 16314,
-    16315, 16316, 16317, 16318, 16319, 16320, 16321, 16322,
-    16323, 16324, 16325, 16326, 16327, 16328, 16329, 16330,
-    16331, 16332, 16333, 16334, 16335, 16336, 16337, 16338,
-    32678, 32679, 32680, 32681, 32682, 32683, 32684, 32685,
-    32686, 32687, 32688, 32689, 32690, 32691, 32692, 32693,
-    32694, 32695, 32696, 32697, 32698, 32699, 32700, 32701,
-    32702, 32703, 32704, 32705, 32706, 32707, 32708, 32709,
-    32710, 32711, 32712, 65426, 65427, 65428, 65429, 65430,
-    65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
-    65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
-    65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
-    65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
-    65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
-    65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
-    65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
-    65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
-    65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
-    65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
-    65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
-    65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
-    65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
-    65535
-};
-static const uint8_t dnxhd_1250_ac_bits[257] = {
-     2,  2,  3,  4,  4,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,
-     8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16
-};
-static const uint8_t dnxhd_1250_ac_level[257] = {
-     1,  1,  2,  3,  0,  4,  5,  2,  6,  7,  8,  3,  9, 10, 11,  4,
-    12, 13, 14, 15, 16,  5, 17, 18, 19, 20, 21, 22,  6, 23, 24, 25,
-    26, 27, 28, 29,  7,  8, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
-     9, 10, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 11,
-    12, 13, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,  1,  2,
-     3,  4,  5, 14, 15, 16, 17,  6,  7,  8,  9, 10, 11, 12, 13, 14,
-    15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 18, 19, 20, 21,
-    27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
-    43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 22, 23, 24,
-    25, 26, 27, 54, 57, 58, 59, 60, 61, 62, 63, 64, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64
-};
-static const uint8_t dnxhd_1250_ac_run_flag[257] = {
-    0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
-    0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
-    0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-    1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
-    1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1
-};
-static const uint8_t dnxhd_1250_ac_index_flag[257] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
-    1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,
-    0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1
-};
-static const uint16_t dnxhd_1250_run_codes[62] = {
-       0,    4,    5,   12,   26,   27,   28,   58,
-     118,  119,  120,  242,  486,  487,  976,  977,
-     978,  979,  980,  981,  982,  983,  984,  985,
-     986,  987,  988,  989,  990,  991,  992,  993,
-     994,  995,  996,  997,  998,  999, 1000, 1001,
-    1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
-    1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
-    1018, 1019, 1020, 1021, 1022, 1023
-};
-static const uint8_t dnxhd_1250_run_bits[62] = {
-     1,  3,  3,  4,  5,  5,  5,  6,  7,  7,  7,  8,  9,  9, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
-};
-static const uint8_t dnxhd_1250_run[62] = {
-     1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
-    17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
-    33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
-    49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62
-};
-
-static const uint8_t dnxhd_1251_dc_codes[12] = {
-    0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
-};
-
-static const uint8_t dnxhd_1251_dc_bits[12] = {
-    3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
-};
-
-static const uint16_t dnxhd_1251_ac_codes[257] = {
-        0,     1,     4,    10,    11,    24,    25,    26,
-       54,    55,    56,    57,   116,   117,   118,   119,
-      240,   241,   242,   243,   244,   245,   492,   493,
-      494,   495,   496,   497,   996,   997,   998,   999,
-     1000,  1001,  1002,  1003,  1004,  1005,  2012,  2013,
-     2014,  2015,  2016,  2017,  2018,  2019,  2020,  2021,
-     2022,  2023,  2024,  2025,  4052,  4053,  4054,  4055,
-     4056,  4057,  4058,  4059,  4060,  4061,  4062,  4063,
-     4064,  4065,  4066,  8134,  8135,  8136,  8137,  8138,
-     8139,  8140,  8141,  8142,  8143,  8144,  8145,  8146,
-     8147,  8148,  8149,  8150,  8151,  8152,  8153,  8154,
-     8155,  8156, 16314, 16315, 16316, 16317, 16318, 16319,
-    16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327,
-    16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335,
-    16336, 16337, 16338, 16339, 32680, 32681, 32682, 32683,
-    32684, 32685, 32686, 32687, 32688, 32689, 32690, 32691,
-    32692, 32693, 32694, 32695, 32696, 32697, 32698, 32699,
-    32700, 32701, 32702, 32703, 32704, 32705, 32706, 32707,
-    32708, 32709, 32710, 32711, 32712, 32713, 32714, 65430,
-    65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
-    65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
-    65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
-    65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
-    65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
-    65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
-    65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
-    65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
-    65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
-    65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
-    65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
-    65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
-    65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
-    65535,
-};
-
-static const uint8_t dnxhd_1251_ac_bits[257] = {
-     2,  2,  3,  4,  4,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,
-     8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16,
-};
-
-static const uint8_t dnxhd_1251_ac_level[257] = {
-     1,  1,  2,  3,  0,  4,  5,  2,  6,  7,  8,  3,  9, 10, 11,  4,
-    12, 13, 14, 15, 16,  5, 17, 18, 19, 20, 21,  6, 22, 23, 24, 25,
-    26, 27, 28, 29,  7,  8, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
-    40,  9, 10, 11, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
-    12, 13, 14, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,  1,
-     2,  3,  4,  5,  6,  7,  8, 15, 16, 17,  9, 10, 11, 12, 13, 14,
-    15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 18,
-    19, 20, 21, 22, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
-    42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
-    58, 23, 24, 25, 26, 27, 28, 59, 60, 61, 62, 63, 64, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,
-};
-
-static const uint8_t dnxhd_1251_ac_run_flag[257] = {
-    0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
-    0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
-    0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-    1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-static const uint8_t dnxhd_1251_ac_index_flag[257] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-    1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
-    0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-static const uint16_t dnxhd_1251_run_codes[62] = {
-       0,    4,    5,   12,   26,   27,   28,   58,
-     118,  119,  120,  242,  486,  487,  976,  977,
-     978,  979,  980,  981,  982,  983,  984,  985,
-     986,  987,  988,  989,  990,  991,  992,  993,
-     994,  995,  996,  997,  998,  999, 1000, 1001,
-    1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009,
-    1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
-    1018, 1019, 1020, 1021, 1022, 1023,
-};
-
-static const uint8_t dnxhd_1251_run_bits[62] = {
-     1,  3,  3,  4,  5,  5,  5,  6,  7,  7,  7,  8,  9,  9, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-};
-
-static const uint8_t dnxhd_1251_run[62] = {
-     1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
-    17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
-    33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
-    49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
-};
-
-static const uint8_t dnxhd_1252_dc_codes[12] = {
-    0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
-};
-
-static const uint8_t dnxhd_1252_dc_bits[12] = {
-    3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
-};
-
-static const uint16_t dnxhd_1252_ac_codes[257] = {
-        0,     1,     4,    10,    11,    12,    26,    27,
-       56,    57,    58,   118,   119,   120,   242,   243,
-      244,   245,   246,   247,   496,   497,   498,   499,
-      500,  1002,  1003,  1004,  1005,  1006,  1007,  1008,
-     1009,  2020,  2021,  2022,  2023,  2024,  2025,  2026,
-     2027,  2028,  2029,  4060,  4061,  4062,  4063,  4064,
-     4065,  4066,  4067,  4068,  4069,  4070,  4071,  8144,
-     8145,  8146,  8147,  8148,  8149,  8150,  8151,  8152,
-     8153,  8154,  8155,  8156,  8157,  8158, 16318, 16319,
-    16320, 16321, 16322, 16323, 16324, 16325, 16326, 16327,
-    16328, 16329, 16330, 16331, 16332, 16333, 16334, 16335,
-    32672, 32673, 32674, 32675, 32676, 32677, 32678, 32679,
-    32680, 32681, 32682, 32683, 32684, 32685, 32686, 32687,
-    32688, 32689, 32690, 32691, 32692, 32693, 32694, 65390,
-    65391, 65392, 65393, 65394, 65395, 65396, 65397, 65398,
-    65399, 65400, 65401, 65402, 65403, 65404, 65405, 65406,
-    65407, 65408, 65409, 65410, 65411, 65412, 65413, 65414,
-    65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422,
-    65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430,
-    65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438,
-    65439, 65440, 65441, 65442, 65443, 65444, 65445, 65446,
-    65447, 65448, 65449, 65450, 65451, 65452, 65453, 65454,
-    65455, 65456, 65457, 65458, 65459, 65460, 65461, 65462,
-    65463, 65464, 65465, 65466, 65467, 65468, 65469, 65470,
-    65471, 65472, 65473, 65474, 65475, 65476, 65477, 65478,
-    65479, 65480, 65481, 65482, 65483, 65484, 65485, 65486,
-    65487, 65488, 65489, 65490, 65491, 65492, 65493, 65494,
-    65495, 65496, 65497, 65498, 65499, 65500, 65501, 65502,
-    65503, 65504, 65505, 65506, 65507, 65508, 65509, 65510,
-    65511, 65512, 65513, 65514, 65515, 65516, 65517, 65518,
-    65519, 65520, 65521, 65522, 65523, 65524, 65525, 65526,
-    65527, 65528, 65529, 65530, 65531, 65532, 65533, 65534,
-    65535,
-};
-
-static const uint8_t dnxhd_1252_ac_bits[257] = {
-     2,  2,  3,  4,  4,  4,  5,  5,  6,  6,  6,  7,  7,  7,  8,  8,
-     8,  8,  8,  8,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10,
-    10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16,
-};
-
-static const uint8_t dnxhd_1252_ac_level[257] = {
-     1,  1,  2,  3,  2,  0,  4,  5,  6,  7,  3,  8,  9, 10, 11, 12,
-    13, 14,  4,  5, 15, 16, 17, 18,  6, 19, 20, 21, 22, 23, 24,  7,
-     8, 25, 26, 27, 28, 29, 30, 31, 32,  9, 10, 33, 34, 35, 36, 37,
-    38, 39, 40, 41, 11, 12, 13, 42, 43, 44, 45, 46, 47, 48, 49, 50,
-    51, 52, 53, 14, 15, 16, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,  1,  2,  3, 17, 18, 19, 20,  4,  5,  6,  7,  8,  9, 10, 11,
-    12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 22,
-    23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
-    39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
-    55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 26, 27, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-    64,
-};
-
-static const uint8_t dnxhd_1252_ac_run_flag[257] = {
-    0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-    0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,
-    1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-static const uint8_t dnxhd_1252_ac_index_flag[257] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1,
-};
-
-const CIDEntry ff_dnxhd_cid_table[] = {
-    { 1235, 1920, 1080, 0, 917504, 917504, 6, 10,
-      dnxhd_1235_luma_weight, dnxhd_1235_chroma_weight,
-      dnxhd_1235_1241_dc_codes, dnxhd_1235_1241_dc_bits,
-      dnxhd_1235_1241_ac_codes, dnxhd_1235_1241_ac_bits, dnxhd_1235_1241_ac_level,
-      dnxhd_1235_1241_ac_run_flag, dnxhd_1235_1241_ac_index_flag,
-      dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1235_1241_run,
-      { 175, 185, 365, 440 } },
-    { 1237, 1920, 1080, 0, 606208, 606208, 4, 8,
-      dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
-      dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
-      dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
-      dnxhd_1237_ac_run_flag, dnxhd_1237_ac_index_flag,
-      dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
-      { 115, 120, 145, 240, 290 } },
-    { 1238, 1920, 1080, 0, 917504, 917504, 4, 8,
-      dnxhd_1238_luma_weight, dnxhd_1238_chroma_weight,
-      dnxhd_1238_dc_codes, dnxhd_1238_dc_bits,
-      dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
-      dnxhd_1238_ac_run_flag, dnxhd_1238_ac_index_flag,
-      dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1238_run,
-      { 175, 185, 220, 365, 440 } },
-    { 1241, 1920, 1080, 1, 917504, 458752, 6, 10,
-      dnxhd_1241_luma_weight, dnxhd_1241_chroma_weight,
-      dnxhd_1235_1241_dc_codes, dnxhd_1235_1241_dc_bits,
-      dnxhd_1235_1241_ac_codes, dnxhd_1235_1241_ac_bits, dnxhd_1235_1241_ac_level,
-      dnxhd_1235_1241_ac_run_flag, dnxhd_1235_1241_ac_index_flag,
-      dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1235_1241_run,
-      { 185, 220 } },
-    { 1242, 1920, 1080, 1, 606208, 303104, 4, 8,
-      dnxhd_1242_luma_weight, dnxhd_1242_chroma_weight,
-      dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
-      dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
-      dnxhd_1237_ac_run_flag, dnxhd_1237_ac_index_flag,
-      dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
-      { 120, 145 } },
-    { 1243, 1920, 1080, 1, 917504, 458752, 4, 8,
-      dnxhd_1243_luma_weight, dnxhd_1243_chroma_weight,
-      dnxhd_1238_dc_codes, dnxhd_1238_dc_bits,
-      dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
-      dnxhd_1238_ac_run_flag, dnxhd_1238_ac_index_flag,
-      dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1238_run,
-      { 185, 220 } },
-    { 1250, 1280,  720, 0, 458752, 458752, 6, 10,
-      dnxhd_1250_luma_weight, dnxhd_1250_chroma_weight,
-      dnxhd_1250_dc_codes, dnxhd_1250_dc_bits,
-      dnxhd_1250_ac_codes, dnxhd_1250_ac_bits, dnxhd_1250_ac_level,
-      dnxhd_1250_ac_run_flag, dnxhd_1250_ac_index_flag,
-      dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
-      { 90, 180, 220 } },
-    { 1251, 1280,  720, 0, 458752, 458752, 4, 8,
-      dnxhd_1251_luma_weight, dnxhd_1251_chroma_weight,
-      dnxhd_1251_dc_codes, dnxhd_1251_dc_bits,
-      dnxhd_1251_ac_codes, dnxhd_1251_ac_bits, dnxhd_1251_ac_level,
-      dnxhd_1251_ac_run_flag, dnxhd_1251_ac_index_flag,
-      dnxhd_1251_run_codes, dnxhd_1251_run_bits, dnxhd_1251_run,
-      { 90, 110, 175, 220 } },
-    { 1252, 1280,  720, 0, 303104, 303104, 4, 8,
-      dnxhd_1252_luma_weight, dnxhd_1252_chroma_weight,
-      dnxhd_1252_dc_codes, dnxhd_1252_dc_bits,
-      dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level,
-      dnxhd_1252_ac_run_flag, dnxhd_1252_ac_index_flag,
-      dnxhd_1251_run_codes, dnxhd_1251_run_bits, dnxhd_1251_run,
-      { 60, 75, 115, 145 } },
-    { 1253, 1920, 1080, 0, 188416, 188416, 4, 8,
-      dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
-      dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
-      dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
-      dnxhd_1237_ac_run_flag, dnxhd_1237_ac_index_flag,
-      dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
-      { 36, 45, 75, 90 } },
-    { 1256, 1920, 1080, 0, 1835008, 1835008, 6, 10,
-      dnxhd_1235_luma_weight, dnxhd_1256_chroma_weight,
-      dnxhd_1235_1241_dc_codes, dnxhd_1235_1241_dc_bits,
-      dnxhd_1235_1241_ac_codes, dnxhd_1235_1241_ac_bits, dnxhd_1235_1241_ac_level,
-      dnxhd_1235_1241_ac_run_flag, dnxhd_1235_1241_ac_index_flag,
-      dnxhd_1235_1238_1241_run_codes, dnxhd_1235_1238_1241_run_bits, dnxhd_1235_1241_run,
-      { 350, 390, 440, 730, 880 } },
-};
-
-int ff_dnxhd_get_cid_table(int cid)
-{
-    int i;
-    for (i = 0; i < FF_ARRAY_ELEMS(ff_dnxhd_cid_table); i++)
-        if (ff_dnxhd_cid_table[i].cid == cid)
-            return i;
-    return -1;
-}
-
-int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth)
-{
-    int i, j;
-    int mbs = avctx->bit_rate/1000000;
-    if (!mbs)
-        return 0;
-    for (i = 0; i < FF_ARRAY_ELEMS(ff_dnxhd_cid_table); i++) {
-        const CIDEntry *cid = &ff_dnxhd_cid_table[i];
-        if (cid->width == avctx->width && cid->height == avctx->height &&
-            cid->interlaced == !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT) &&
-            cid->bit_depth == bit_depth) {
-            for (j = 0; j < sizeof(cid->bit_rates); j++) {
-                if (cid->bit_rates[j] == mbs)
-                    return cid->cid;
-            }
-        }
-    }
-    return 0;
-}
diff --git a/deps/libav/libavcodec/dnxhddata.h b/deps/libav/libavcodec/dnxhddata.h
deleted file mode 100644
index 66b0349..0000000
--- a/deps/libav/libavcodec/dnxhddata.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * VC3/DNxHD decoder.
- * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DNXHDDATA_H
-#define AVCODEC_DNXHDDATA_H
-
-#include <stdint.h>
-#include "avcodec.h"
-
-typedef struct CIDEntry {
-    int cid;
-    unsigned int width, height;
-    int interlaced;
-    unsigned int frame_size;
-    unsigned int coding_unit_size;
-    int index_bits;
-    int bit_depth;
-    const uint8_t *luma_weight, *chroma_weight;
-    const uint8_t *dc_codes, *dc_bits;
-    const uint16_t *ac_codes;
-    const uint8_t *ac_bits, *ac_level;
-    const uint8_t *ac_run_flag, *ac_index_flag;
-    const uint16_t *run_codes;
-    const uint8_t *run_bits, *run;
-    int bit_rates[5]; ///< Helpher to choose variants, rounded to nearest 5Mb/s
-} CIDEntry;
-
-extern const CIDEntry ff_dnxhd_cid_table[];
-
-int ff_dnxhd_get_cid_table(int cid);
-int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth);
-
-#endif /* AVCODEC_DNXHDDATA_H */
diff --git a/deps/libav/libavcodec/dnxhddec.c b/deps/libav/libavcodec/dnxhddec.c
deleted file mode 100644
index 021f87d..0000000
--- a/deps/libav/libavcodec/dnxhddec.c
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * VC3/DNxHD decoder.
- * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- * Copyright (c) 2011 MirriAd Ltd
- *
- * 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph at mirriad.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/imgutils.h"
-#include "libavutil/timer.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dnxhddata.h"
-#include "dsputil.h"
-#include "internal.h"
-
-typedef struct DNXHDContext {
-    AVCodecContext *avctx;
-    GetBitContext gb;
-    int cid;                            ///< compression id
-    unsigned int width, height;
-    unsigned int mb_width, mb_height;
-    uint32_t mb_scan_index[68];         /* max for 1080p */
-    int cur_field;                      ///< current interlaced field
-    VLC ac_vlc, dc_vlc, run_vlc;
-    int last_dc[3];
-    DSPContext dsp;
-    DECLARE_ALIGNED(16, int16_t, blocks)[12][64];
-    ScanTable scantable;
-    const CIDEntry *cid_table;
-    int bit_depth; // 8, 10 or 0 if not initialized at all.
-    int is_444;
-    void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block,
-                             int n, int qscale);
-} DNXHDContext;
-
-#define DNXHD_VLC_BITS 9
-#define DNXHD_DC_VLC_BITS 7
-
-static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block, int n, int qscale);
-static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block, int n, int qscale);
-static void dnxhd_decode_dct_block_10_444(DNXHDContext *ctx, int16_t *block, int n, int qscale);
-
-static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
-{
-    DNXHDContext *ctx = avctx->priv_data;
-
-    ctx->avctx = avctx;
-    return 0;
-}
-
-static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
-{
-    if (cid != ctx->cid) {
-        int index;
-
-        if ((index = ff_dnxhd_get_cid_table(cid)) < 0) {
-            av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
-            return AVERROR(ENOSYS);
-        }
-        ctx->cid_table = &ff_dnxhd_cid_table[index];
-
-        ff_free_vlc(&ctx->ac_vlc);
-        ff_free_vlc(&ctx->dc_vlc);
-        ff_free_vlc(&ctx->run_vlc);
-
-        init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257,
-                 ctx->cid_table->ac_bits, 1, 1,
-                 ctx->cid_table->ac_codes, 2, 2, 0);
-        init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, ctx->bit_depth + 4,
-                 ctx->cid_table->dc_bits, 1, 1,
-                 ctx->cid_table->dc_codes, 1, 1, 0);
-        init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62,
-                 ctx->cid_table->run_bits, 1, 1,
-                 ctx->cid_table->run_codes, 2, 2, 0);
-
-        ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, ff_zigzag_direct);
-        ctx->cid = cid;
-    }
-    return 0;
-}
-
-static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
-                               const uint8_t *buf, int buf_size, int first_field)
-{
-    static const uint8_t header_prefix[]    = { 0x00, 0x00, 0x02, 0x80, 0x01 };
-    static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
-    int i, cid, ret;
-
-    if (buf_size < 0x280)
-        return AVERROR_INVALIDDATA;
-
-    if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "error in header\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (buf[5] & 2) { /* interlaced */
-        ctx->cur_field = buf[5] & 1;
-        frame->interlaced_frame = 1;
-        frame->top_field_first  = first_field ^ ctx->cur_field;
-        av_log(ctx->avctx, AV_LOG_DEBUG, "interlaced %d, cur field %d\n", buf[5] & 3, ctx->cur_field);
-    }
-
-    ctx->height = AV_RB16(buf + 0x18);
-    ctx->width  = AV_RB16(buf + 0x1a);
-
-    av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
-
-    ctx->is_444 = 0;
-    if (buf[0x4] == 0x2) {
-        ctx->avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
-        ctx->avctx->bits_per_raw_sample = 10;
-        if (ctx->bit_depth != 10) {
-            ff_dsputil_init(&ctx->dsp, ctx->avctx);
-            ctx->bit_depth = 10;
-            ctx->decode_dct_block = dnxhd_decode_dct_block_10_444;
-        }
-        ctx->is_444 = 1;
-    } else if (buf[0x21] & 0x40) {
-        ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
-        ctx->avctx->bits_per_raw_sample = 10;
-        if (ctx->bit_depth != 10) {
-            ff_dsputil_init(&ctx->dsp, ctx->avctx);
-            ctx->bit_depth = 10;
-            ctx->decode_dct_block = dnxhd_decode_dct_block_10;
-        }
-    } else {
-        ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-        ctx->avctx->bits_per_raw_sample = 8;
-        if (ctx->bit_depth != 8) {
-            ff_dsputil_init(&ctx->dsp, ctx->avctx);
-            ctx->bit_depth = 8;
-            ctx->decode_dct_block = dnxhd_decode_dct_block_8;
-        }
-    }
-
-    cid = AV_RB32(buf + 0x28);
-    av_dlog(ctx->avctx, "compression id %d\n", cid);
-
-    if ((ret = dnxhd_init_vlc(ctx, cid)) < 0)
-        return ret;
-
-    if (buf_size < ctx->cid_table->coding_unit_size) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "incorrect frame size\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->mb_width = ctx->width>>4;
-    ctx->mb_height = buf[0x16d];
-
-    av_dlog(ctx->avctx, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
-
-    if ((ctx->height+15)>>4 == ctx->mb_height && frame->interlaced_frame)
-        ctx->height <<= 1;
-
-    if (ctx->mb_height > 68 ||
-        (ctx->mb_height << frame->interlaced_frame) > (ctx->height+15)>>4) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "mb height too big: %d\n", ctx->mb_height);
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (i = 0; i < ctx->mb_height; i++) {
-        ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i<<2));
-        av_dlog(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
-        if (buf_size < ctx->mb_scan_index[i] + 0x280) {
-            av_log(ctx->avctx, AV_LOG_ERROR, "invalid mb scan index\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    return 0;
-}
-
-static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx,
-                                                    int16_t *block, int n,
-                                                    int qscale,
-                                                    int index_bits,
-                                                    int level_bias,
-                                                    int level_shift)
-{
-    int i, j, index1, index2, len;
-    int level, component, sign;
-    const uint8_t *weight_matrix;
-    OPEN_READER(bs, &ctx->gb);
-
-    if (!ctx->is_444) {
-        if (n&2) {
-            component = 1 + (n&1);
-            weight_matrix = ctx->cid_table->chroma_weight;
-        } else {
-            component = 0;
-            weight_matrix = ctx->cid_table->luma_weight;
-        }
-    } else {
-        component = (n >> 1) % 3;
-        if (component) {
-            weight_matrix = ctx->cid_table->chroma_weight;
-        } else {
-            weight_matrix = ctx->cid_table->luma_weight;
-        }
-    }
-
-    UPDATE_CACHE(bs, &ctx->gb);
-    GET_VLC(len, bs, &ctx->gb, ctx->dc_vlc.table, DNXHD_DC_VLC_BITS, 1);
-    if (len) {
-        level = GET_CACHE(bs, &ctx->gb);
-        LAST_SKIP_BITS(bs, &ctx->gb, len);
-        sign  = ~level >> 31;
-        level = (NEG_USR32(sign ^ level, len) ^ sign) - sign;
-        ctx->last_dc[component] += level;
-    }
-    block[0] = ctx->last_dc[component];
-
-    for (i = 1; ; i++) {
-        UPDATE_CACHE(bs, &ctx->gb);
-        GET_VLC(index1, bs, &ctx->gb, ctx->ac_vlc.table,
-                DNXHD_VLC_BITS, 2);
-        level = ctx->cid_table->ac_level[index1];
-        if (!level) /* EOB */
-            break;
-
-        sign = SHOW_SBITS(bs, &ctx->gb, 1);
-        SKIP_BITS(bs, &ctx->gb, 1);
-
-        if (ctx->cid_table->ac_index_flag[index1]) {
-            level += SHOW_UBITS(bs, &ctx->gb, index_bits) << 6;
-            SKIP_BITS(bs, &ctx->gb, index_bits);
-        }
-
-        if (ctx->cid_table->ac_run_flag[index1]) {
-            UPDATE_CACHE(bs, &ctx->gb);
-            GET_VLC(index2, bs, &ctx->gb, ctx->run_vlc.table,
-                    DNXHD_VLC_BITS, 2);
-            i += ctx->cid_table->run[index2];
-        }
-
-        if (i > 63) {
-            av_log(ctx->avctx, AV_LOG_ERROR, "ac tex damaged %d, %d\n", n, i);
-            break;
-        }
-
-        j = ctx->scantable.permutated[i];
-        level = (2*level+1) * qscale * weight_matrix[i];
-        if (level_bias < 32 || weight_matrix[i] != level_bias)
-            level += level_bias;
-        level >>= level_shift;
-
-        block[j] = (level^sign) - sign;
-    }
-
-    CLOSE_READER(bs, &ctx->gb);
-}
-
-static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block,
-                                     int n, int qscale)
-{
-    dnxhd_decode_dct_block(ctx, block, n, qscale, 4, 32, 6);
-}
-
-static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block,
-                                      int n, int qscale)
-{
-    dnxhd_decode_dct_block(ctx, block, n, qscale, 6, 8, 4);
-}
-
-static void dnxhd_decode_dct_block_10_444(DNXHDContext *ctx, int16_t *block,
-                                          int n, int qscale)
-{
-    dnxhd_decode_dct_block(ctx, block, n, qscale, 6, 32, 6);
-}
-
-static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int x, int y)
-{
-    int shift1 = ctx->bit_depth == 10;
-    int dct_linesize_luma   = frame->linesize[0];
-    int dct_linesize_chroma = frame->linesize[1];
-    uint8_t *dest_y, *dest_u, *dest_v;
-    int dct_y_offset, dct_x_offset;
-    int qscale, i;
-
-    qscale = get_bits(&ctx->gb, 11);
-    skip_bits1(&ctx->gb);
-
-    for (i = 0; i < 8; i++) {
-        ctx->dsp.clear_block(ctx->blocks[i]);
-        ctx->decode_dct_block(ctx, ctx->blocks[i], i, qscale);
-    }
-    if (ctx->is_444) {
-        for (; i < 12; i++) {
-            ctx->dsp.clear_block(ctx->blocks[i]);
-            ctx->decode_dct_block(ctx, ctx->blocks[i], i, qscale);
-        }
-    }
-
-    if (frame->interlaced_frame) {
-        dct_linesize_luma   <<= 1;
-        dct_linesize_chroma <<= 1;
-    }
-
-    dest_y = frame->data[0] + ((y * dct_linesize_luma)   << 4) + (x << (4 + shift1));
-    dest_u = frame->data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
-    dest_v = frame->data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
-
-    if (ctx->cur_field) {
-        dest_y += frame->linesize[0];
-        dest_u += frame->linesize[1];
-        dest_v += frame->linesize[2];
-    }
-
-    dct_y_offset = dct_linesize_luma << 3;
-    dct_x_offset = 8 << shift1;
-    if (!ctx->is_444) {
-        ctx->dsp.idct_put(dest_y,                               dct_linesize_luma, ctx->blocks[0]);
-        ctx->dsp.idct_put(dest_y + dct_x_offset,                dct_linesize_luma, ctx->blocks[1]);
-        ctx->dsp.idct_put(dest_y + dct_y_offset,                dct_linesize_luma, ctx->blocks[4]);
-        ctx->dsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[5]);
-
-        if (!(ctx->avctx->flags & CODEC_FLAG_GRAY)) {
-            dct_y_offset = dct_linesize_chroma << 3;
-            ctx->dsp.idct_put(dest_u,                dct_linesize_chroma, ctx->blocks[2]);
-            ctx->dsp.idct_put(dest_v,                dct_linesize_chroma, ctx->blocks[3]);
-            ctx->dsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[6]);
-            ctx->dsp.idct_put(dest_v + dct_y_offset, dct_linesize_chroma, ctx->blocks[7]);
-        }
-    } else {
-        ctx->dsp.idct_put(dest_y,                               dct_linesize_luma, ctx->blocks[0]);
-        ctx->dsp.idct_put(dest_y + dct_x_offset,                dct_linesize_luma, ctx->blocks[1]);
-        ctx->dsp.idct_put(dest_y + dct_y_offset,                dct_linesize_luma, ctx->blocks[6]);
-        ctx->dsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[7]);
-
-        if (!(ctx->avctx->flags & CODEC_FLAG_GRAY)) {
-            dct_y_offset = dct_linesize_chroma << 3;
-            ctx->dsp.idct_put(dest_u,                               dct_linesize_chroma, ctx->blocks[2]);
-            ctx->dsp.idct_put(dest_u + dct_x_offset,                dct_linesize_chroma, ctx->blocks[3]);
-            ctx->dsp.idct_put(dest_u + dct_y_offset,                dct_linesize_chroma, ctx->blocks[8]);
-            ctx->dsp.idct_put(dest_u + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->blocks[9]);
-            ctx->dsp.idct_put(dest_v,                               dct_linesize_chroma, ctx->blocks[4]);
-            ctx->dsp.idct_put(dest_v + dct_x_offset,                dct_linesize_chroma, ctx->blocks[5]);
-            ctx->dsp.idct_put(dest_v + dct_y_offset,                dct_linesize_chroma, ctx->blocks[10]);
-            ctx->dsp.idct_put(dest_v + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->blocks[11]);
-        }
-    }
-
-    return 0;
-}
-
-static int dnxhd_decode_macroblocks(DNXHDContext *ctx, AVFrame *frame,
-                                    const uint8_t *buf, int buf_size)
-{
-    int x, y;
-    for (y = 0; y < ctx->mb_height; y++) {
-        ctx->last_dc[0] =
-        ctx->last_dc[1] =
-        ctx->last_dc[2] = 1 << (ctx->bit_depth + 2); // for levels +2^(bitdepth-1)
-        init_get_bits(&ctx->gb, buf + ctx->mb_scan_index[y], (buf_size - ctx->mb_scan_index[y]) << 3);
-        for (x = 0; x < ctx->mb_width; x++) {
-            //START_TIMER;
-            dnxhd_decode_macroblock(ctx, frame, x, y);
-            //STOP_TIMER("decode macroblock");
-        }
-    }
-    return 0;
-}
-
-static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                              AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    DNXHDContext *ctx = avctx->priv_data;
-    AVFrame *picture = data;
-    int first_field = 1;
-    int ret;
-
-    av_dlog(avctx, "frame size %d\n", buf_size);
-
- decode_coding_unit:
-    if ((ret = dnxhd_decode_header(ctx, picture, buf, buf_size, first_field)) < 0)
-        return ret;
-
-    if ((avctx->width || avctx->height) &&
-        (ctx->width != avctx->width || ctx->height != avctx->height)) {
-        av_log(avctx, AV_LOG_WARNING, "frame size changed: %dx%d -> %dx%d\n",
-               avctx->width, avctx->height, ctx->width, ctx->height);
-        first_field = 1;
-    }
-
-    ret = ff_set_dimensions(avctx, ctx->width, ctx->height);
-    if (ret < 0)
-        return ret;
-
-    if (first_field) {
-        if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-        picture->pict_type = AV_PICTURE_TYPE_I;
-        picture->key_frame = 1;
-    }
-
-    dnxhd_decode_macroblocks(ctx, picture, buf + 0x280, buf_size - 0x280);
-
-    if (first_field && picture->interlaced_frame) {
-        buf      += ctx->cid_table->coding_unit_size;
-        buf_size -= ctx->cid_table->coding_unit_size;
-        first_field = 0;
-        goto decode_coding_unit;
-    }
-
-    *got_frame = 1;
-    return buf_size;
-}
-
-static av_cold int dnxhd_decode_close(AVCodecContext *avctx)
-{
-    DNXHDContext *ctx = avctx->priv_data;
-
-    ff_free_vlc(&ctx->ac_vlc);
-    ff_free_vlc(&ctx->dc_vlc);
-    ff_free_vlc(&ctx->run_vlc);
-    return 0;
-}
-
-AVCodec ff_dnxhd_decoder = {
-    .name           = "dnxhd",
-    .long_name      = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DNXHD,
-    .priv_data_size = sizeof(DNXHDContext),
-    .init           = dnxhd_decode_init,
-    .close          = dnxhd_decode_close,
-    .decode         = dnxhd_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/dnxhdenc.c b/deps/libav/libavcodec/dnxhdenc.c
deleted file mode 100644
index 990c3b2..0000000
--- a/deps/libav/libavcodec/dnxhdenc.c
+++ /dev/null
@@ -1,1036 +0,0 @@
-/*
- * VC3/DNxHD encoder
- * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- * Copyright (c) 2011 MirriAd Ltd
- *
- * VC-3 encoder funded by the British Broadcasting Corporation
- * 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph at mirriad.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define RC_VARIANCE 1 // use variance or ssd for fast rc
-
-#include "libavutil/attributes.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-#include "libavutil/timer.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "mpegvideo.h"
-#include "dnxhdenc.h"
-
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-#define DNX10BIT_QMAT_SHIFT 18 // The largest value that will not lead to overflow for 10bit samples.
-
-static const AVOption options[]={
-    {"nitris_compat", "encode with Avid Nitris compatibility", offsetof(DNXHDEncContext, nitris_compat), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, VE},
-{NULL}
-};
-static const AVClass class = { "dnxhd", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
-
-#define LAMBDA_FRAC_BITS 10
-
-static void dnxhd_8bit_get_pixels_8x4_sym(int16_t *restrict block, const uint8_t *pixels, int line_size)
-{
-    int i;
-    for (i = 0; i < 4; i++) {
-        block[0] = pixels[0]; block[1] = pixels[1];
-        block[2] = pixels[2]; block[3] = pixels[3];
-        block[4] = pixels[4]; block[5] = pixels[5];
-        block[6] = pixels[6]; block[7] = pixels[7];
-        pixels += line_size;
-        block += 8;
-    }
-    memcpy(block,      block -  8, sizeof(*block) * 8);
-    memcpy(block +  8, block - 16, sizeof(*block) * 8);
-    memcpy(block + 16, block - 24, sizeof(*block) * 8);
-    memcpy(block + 24, block - 32, sizeof(*block) * 8);
-}
-
-static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(int16_t *restrict block, const uint8_t *pixels, int line_size)
-{
-    int i;
-
-    block += 32;
-
-    for (i = 0; i < 4; i++) {
-        memcpy(block + i     * 8, pixels + i * line_size, 8 * sizeof(*block));
-        memcpy(block - (i+1) * 8, pixels + i * line_size, 8 * sizeof(*block));
-    }
-}
-
-static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, int16_t *block,
-                                    int n, int qscale, int *overflow)
-{
-    const uint8_t *scantable= ctx->intra_scantable.scantable;
-    const int *qmat = ctx->q_intra_matrix[qscale];
-    int last_non_zero = 0;
-    int i;
-
-    ctx->dsp.fdct(block);
-
-    // Divide by 4 with rounding, to compensate scaling of DCT coefficients
-    block[0] = (block[0] + 2) >> 2;
-
-    for (i = 1; i < 64; ++i) {
-        int j = scantable[i];
-        int sign = block[j] >> 31;
-        int level = (block[j] ^ sign) - sign;
-        level = level * qmat[j] >> DNX10BIT_QMAT_SHIFT;
-        block[j] = (level ^ sign) - sign;
-        if (level)
-            last_non_zero = i;
-    }
-
-    return last_non_zero;
-}
-
-static av_cold int dnxhd_init_vlc(DNXHDEncContext *ctx)
-{
-    int i, j, level, run;
-    int max_level = 1<<(ctx->cid_table->bit_depth+2);
-
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->vlc_codes, max_level*4*sizeof(*ctx->vlc_codes), fail);
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->vlc_bits,  max_level*4*sizeof(*ctx->vlc_bits) , fail);
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->run_codes, 63*2,                                fail);
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->run_bits,  63,                                  fail);
-
-    ctx->vlc_codes += max_level*2;
-    ctx->vlc_bits  += max_level*2;
-    for (level = -max_level; level < max_level; level++) {
-        for (run = 0; run < 2; run++) {
-            int index = (level<<1)|run;
-            int sign, offset = 0, alevel = level;
-
-            MASK_ABS(sign, alevel);
-            if (alevel > 64) {
-                offset = (alevel-1)>>6;
-                alevel -= offset<<6;
-            }
-            for (j = 0; j < 257; j++) {
-                if (ctx->cid_table->ac_level[j] == alevel &&
-                    (!offset || (ctx->cid_table->ac_index_flag[j] && offset)) &&
-                    (!run    || (ctx->cid_table->ac_run_flag  [j] && run))) {
-                    assert(!ctx->vlc_codes[index]);
-                    if (alevel) {
-                        ctx->vlc_codes[index] = (ctx->cid_table->ac_codes[j]<<1)|(sign&1);
-                        ctx->vlc_bits [index] = ctx->cid_table->ac_bits[j]+1;
-                    } else {
-                        ctx->vlc_codes[index] = ctx->cid_table->ac_codes[j];
-                        ctx->vlc_bits [index] = ctx->cid_table->ac_bits [j];
-                    }
-                    break;
-                }
-            }
-            assert(!alevel || j < 257);
-            if (offset) {
-                ctx->vlc_codes[index] = (ctx->vlc_codes[index]<<ctx->cid_table->index_bits)|offset;
-                ctx->vlc_bits [index]+= ctx->cid_table->index_bits;
-            }
-        }
-    }
-    for (i = 0; i < 62; i++) {
-        int run = ctx->cid_table->run[i];
-        assert(run < 63);
-        ctx->run_codes[run] = ctx->cid_table->run_codes[i];
-        ctx->run_bits [run] = ctx->cid_table->run_bits[i];
-    }
-    return 0;
- fail:
-    return -1;
-}
-
-static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias)
-{
-    // init first elem to 1 to avoid div by 0 in convert_matrix
-    uint16_t weight_matrix[64] = {1,}; // convert_matrix needs uint16_t*
-    int qscale, i;
-    const uint8_t *luma_weight_table   = ctx->cid_table->luma_weight;
-    const uint8_t *chroma_weight_table = ctx->cid_table->chroma_weight;
-
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_l,   (ctx->m.avctx->qmax+1) * 64 *     sizeof(int),      fail);
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_c,   (ctx->m.avctx->qmax+1) * 64 *     sizeof(int),      fail);
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_l16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t), fail);
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->qmatrix_c16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t), fail);
-
-    if (ctx->cid_table->bit_depth == 8) {
-        for (i = 1; i < 64; i++) {
-            int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]];
-            weight_matrix[j] = ctx->cid_table->luma_weight[i];
-        }
-        ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_l, ctx->qmatrix_l16, weight_matrix,
-                          ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1);
-        for (i = 1; i < 64; i++) {
-            int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]];
-            weight_matrix[j] = ctx->cid_table->chroma_weight[i];
-        }
-        ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_c, ctx->qmatrix_c16, weight_matrix,
-                          ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1);
-
-        for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) {
-            for (i = 0; i < 64; i++) {
-                ctx->qmatrix_l  [qscale]   [i] <<= 2; ctx->qmatrix_c  [qscale]   [i] <<= 2;
-                ctx->qmatrix_l16[qscale][0][i] <<= 2; ctx->qmatrix_l16[qscale][1][i] <<= 2;
-                ctx->qmatrix_c16[qscale][0][i] <<= 2; ctx->qmatrix_c16[qscale][1][i] <<= 2;
-            }
-        }
-    } else {
-        // 10-bit
-        for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) {
-            for (i = 1; i < 64; i++) {
-                int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]];
-
-                // The quantization formula from the VC-3 standard is:
-                // quantized = sign(block[i]) * floor(abs(block[i]/s) * p / (qscale * weight_table[i]))
-                // Where p is 32 for 8-bit samples and 8 for 10-bit ones.
-                // The s factor compensates scaling of DCT coefficients done by the DCT routines,
-                // and therefore is not present in standard.  It's 8 for 8-bit samples and 4 for 10-bit ones.
-                // We want values of ctx->qtmatrix_l and ctx->qtmatrix_r to be:
-                // ((1 << DNX10BIT_QMAT_SHIFT) * (p / s)) / (qscale * weight_table[i])
-                // For 10-bit samples, p / s == 2
-                ctx->qmatrix_l[qscale][j] = (1 << (DNX10BIT_QMAT_SHIFT + 1)) / (qscale * luma_weight_table[i]);
-                ctx->qmatrix_c[qscale][j] = (1 << (DNX10BIT_QMAT_SHIFT + 1)) / (qscale * chroma_weight_table[i]);
-            }
-        }
-    }
-
-    return 0;
- fail:
-    return -1;
-}
-
-static av_cold int dnxhd_init_rc(DNXHDEncContext *ctx)
-{
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*ctx->m.avctx->qmax*sizeof(RCEntry), fail);
-    if (ctx->m.avctx->mb_decision != FF_MB_DECISION_RD)
-        FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_cmp, ctx->m.mb_num*sizeof(RCCMPEntry), fail);
-
-    ctx->frame_bits = (ctx->cid_table->coding_unit_size - 640 - 4 - ctx->min_padding) * 8;
-    ctx->qscale = 1;
-    ctx->lambda = 2<<LAMBDA_FRAC_BITS; // qscale 2
-    return 0;
- fail:
-    return -1;
-}
-
-static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
-{
-    DNXHDEncContext *ctx = avctx->priv_data;
-    int i, index, bit_depth;
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_YUV422P:
-        bit_depth = 8;
-        break;
-    case AV_PIX_FMT_YUV422P10:
-        bit_depth = 10;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHD\n");
-        return -1;
-    }
-
-    ctx->cid = ff_dnxhd_find_cid(avctx, bit_depth);
-    if (!ctx->cid) {
-        av_log(avctx, AV_LOG_ERROR, "video parameters incompatible with DNxHD\n");
-        return -1;
-    }
-    av_log(avctx, AV_LOG_DEBUG, "cid %d\n", ctx->cid);
-
-    index = ff_dnxhd_get_cid_table(ctx->cid);
-    ctx->cid_table = &ff_dnxhd_cid_table[index];
-
-    ctx->m.avctx = avctx;
-    ctx->m.mb_intra = 1;
-    ctx->m.h263_aic = 1;
-
-    avctx->bits_per_raw_sample = ctx->cid_table->bit_depth;
-
-    ff_dsputil_init(&ctx->m.dsp, avctx);
-    ff_dct_common_init(&ctx->m);
-    if (!ctx->m.dct_quantize)
-        ctx->m.dct_quantize = ff_dct_quantize_c;
-
-    if (ctx->cid_table->bit_depth == 10) {
-       ctx->m.dct_quantize = dnxhd_10bit_dct_quantize;
-       ctx->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym;
-       ctx->block_width_l2 = 4;
-    } else {
-       ctx->get_pixels_8x4_sym = dnxhd_8bit_get_pixels_8x4_sym;
-       ctx->block_width_l2 = 3;
-    }
-
-    if (ARCH_X86)
-        ff_dnxhdenc_init_x86(ctx);
-
-    ctx->m.mb_height = (avctx->height + 15) / 16;
-    ctx->m.mb_width  = (avctx->width  + 15) / 16;
-
-    if (avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
-        ctx->interlaced = 1;
-        ctx->m.mb_height /= 2;
-    }
-
-    ctx->m.mb_num = ctx->m.mb_height * ctx->m.mb_width;
-
-    if (avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
-        ctx->m.intra_quant_bias = avctx->intra_quant_bias;
-    if (dnxhd_init_qmat(ctx, ctx->m.intra_quant_bias, 0) < 0) // XXX tune lbias/cbias
-        return -1;
-
-    // Avid Nitris hardware decoder requires a minimum amount of padding in the coding unit payload
-    if (ctx->nitris_compat)
-        ctx->min_padding = 1600;
-
-    if (dnxhd_init_vlc(ctx) < 0)
-        return -1;
-    if (dnxhd_init_rc(ctx) < 0)
-        return -1;
-
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->slice_size, ctx->m.mb_height*sizeof(uint32_t), fail);
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->slice_offs, ctx->m.mb_height*sizeof(uint32_t), fail);
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_bits,    ctx->m.mb_num   *sizeof(uint16_t), fail);
-    FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_qscale,  ctx->m.mb_num   *sizeof(uint8_t),  fail);
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->key_frame = 1;
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
-    if (avctx->thread_count > MAX_THREADS) {
-        av_log(avctx, AV_LOG_ERROR, "too many threads\n");
-        return -1;
-    }
-
-    ctx->thread[0] = ctx;
-    for (i = 1; i < avctx->thread_count; i++) {
-        ctx->thread[i] =  av_malloc(sizeof(DNXHDEncContext));
-        memcpy(ctx->thread[i], ctx, sizeof(DNXHDEncContext));
-    }
-
-    return 0;
- fail: //for FF_ALLOCZ_OR_GOTO
-    return -1;
-}
-
-static int dnxhd_write_header(AVCodecContext *avctx, uint8_t *buf)
-{
-    DNXHDEncContext *ctx = avctx->priv_data;
-    const uint8_t header_prefix[5] = { 0x00,0x00,0x02,0x80,0x01 };
-
-    memset(buf, 0, 640);
-
-    memcpy(buf, header_prefix, 5);
-    buf[5] = ctx->interlaced ? ctx->cur_field+2 : 0x01;
-    buf[6] = 0x80; // crc flag off
-    buf[7] = 0xa0; // reserved
-    AV_WB16(buf + 0x18, avctx->height>>ctx->interlaced); // ALPF
-    AV_WB16(buf + 0x1a, avctx->width);  // SPL
-    AV_WB16(buf + 0x1d, avctx->height>>ctx->interlaced); // NAL
-
-    buf[0x21] = ctx->cid_table->bit_depth == 10 ? 0x58 : 0x38;
-    buf[0x22] = 0x88 + (ctx->interlaced<<2);
-    AV_WB32(buf + 0x28, ctx->cid); // CID
-    buf[0x2c] = ctx->interlaced ? 0 : 0x80;
-
-    buf[0x5f] = 0x01; // UDL
-
-    buf[0x167] = 0x02; // reserved
-    AV_WB16(buf + 0x16a, ctx->m.mb_height * 4 + 4); // MSIPS
-    buf[0x16d] = ctx->m.mb_height; // Ns
-    buf[0x16f] = 0x10; // reserved
-
-    ctx->msip = buf + 0x170;
-    return 0;
-}
-
-static av_always_inline void dnxhd_encode_dc(DNXHDEncContext *ctx, int diff)
-{
-    int nbits;
-    if (diff < 0) {
-        nbits = av_log2_16bit(-2*diff);
-        diff--;
-    } else {
-        nbits = av_log2_16bit(2*diff);
-    }
-    put_bits(&ctx->m.pb, ctx->cid_table->dc_bits[nbits] + nbits,
-             (ctx->cid_table->dc_codes[nbits]<<nbits) + (diff & ((1 << nbits) - 1)));
-}
-
-static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t *block, int last_index, int n)
-{
-    int last_non_zero = 0;
-    int slevel, i, j;
-
-    dnxhd_encode_dc(ctx, block[0] - ctx->m.last_dc[n]);
-    ctx->m.last_dc[n] = block[0];
-
-    for (i = 1; i <= last_index; i++) {
-        j = ctx->m.intra_scantable.permutated[i];
-        slevel = block[j];
-        if (slevel) {
-            int run_level = i - last_non_zero - 1;
-            int rlevel = (slevel<<1)|!!run_level;
-            put_bits(&ctx->m.pb, ctx->vlc_bits[rlevel], ctx->vlc_codes[rlevel]);
-            if (run_level)
-                put_bits(&ctx->m.pb, ctx->run_bits[run_level], ctx->run_codes[run_level]);
-            last_non_zero = i;
-        }
-    }
-    put_bits(&ctx->m.pb, ctx->vlc_bits[0], ctx->vlc_codes[0]); // EOB
-}
-
-static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, int16_t *block, int n, int qscale, int last_index)
-{
-    const uint8_t *weight_matrix;
-    int level;
-    int i;
-
-    weight_matrix = (n&2) ? ctx->cid_table->chroma_weight : ctx->cid_table->luma_weight;
-
-    for (i = 1; i <= last_index; i++) {
-        int j = ctx->m.intra_scantable.permutated[i];
-        level = block[j];
-        if (level) {
-            if (level < 0) {
-                level = (1-2*level) * qscale * weight_matrix[i];
-                if (ctx->cid_table->bit_depth == 10) {
-                    if (weight_matrix[i] != 8)
-                        level += 8;
-                    level >>= 4;
-                } else {
-                    if (weight_matrix[i] != 32)
-                        level += 32;
-                    level >>= 6;
-                }
-                level = -level;
-            } else {
-                level = (2*level+1) * qscale * weight_matrix[i];
-                if (ctx->cid_table->bit_depth == 10) {
-                    if (weight_matrix[i] != 8)
-                        level += 8;
-                    level >>= 4;
-                } else {
-                    if (weight_matrix[i] != 32)
-                        level += 32;
-                    level >>= 6;
-                }
-            }
-            block[j] = level;
-        }
-    }
-}
-
-static av_always_inline int dnxhd_ssd_block(int16_t *qblock, int16_t *block)
-{
-    int score = 0;
-    int i;
-    for (i = 0; i < 64; i++)
-        score += (block[i] - qblock[i]) * (block[i] - qblock[i]);
-    return score;
-}
-
-static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t *block, int last_index)
-{
-    int last_non_zero = 0;
-    int bits = 0;
-    int i, j, level;
-    for (i = 1; i <= last_index; i++) {
-        j = ctx->m.intra_scantable.permutated[i];
-        level = block[j];
-        if (level) {
-            int run_level = i - last_non_zero - 1;
-            bits += ctx->vlc_bits[(level<<1)|!!run_level]+ctx->run_bits[run_level];
-            last_non_zero = i;
-        }
-    }
-    return bits;
-}
-
-static av_always_inline void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, int mb_y)
-{
-    const int bs = ctx->block_width_l2;
-    const int bw = 1 << bs;
-    const uint8_t *ptr_y = ctx->thread[0]->src[0] + ((mb_y << 4) * ctx->m.linesize)   + (mb_x << bs+1);
-    const uint8_t *ptr_u = ctx->thread[0]->src[1] + ((mb_y << 4) * ctx->m.uvlinesize) + (mb_x << bs);
-    const uint8_t *ptr_v = ctx->thread[0]->src[2] + ((mb_y << 4) * ctx->m.uvlinesize) + (mb_x << bs);
-    DSPContext *dsp = &ctx->m.dsp;
-
-    dsp->get_pixels(ctx->blocks[0], ptr_y,      ctx->m.linesize);
-    dsp->get_pixels(ctx->blocks[1], ptr_y + bw, ctx->m.linesize);
-    dsp->get_pixels(ctx->blocks[2], ptr_u,      ctx->m.uvlinesize);
-    dsp->get_pixels(ctx->blocks[3], ptr_v,      ctx->m.uvlinesize);
-
-    if (mb_y+1 == ctx->m.mb_height && ctx->m.avctx->height == 1080) {
-        if (ctx->interlaced) {
-            ctx->get_pixels_8x4_sym(ctx->blocks[4], ptr_y + ctx->dct_y_offset,      ctx->m.linesize);
-            ctx->get_pixels_8x4_sym(ctx->blocks[5], ptr_y + ctx->dct_y_offset + bw, ctx->m.linesize);
-            ctx->get_pixels_8x4_sym(ctx->blocks[6], ptr_u + ctx->dct_uv_offset,     ctx->m.uvlinesize);
-            ctx->get_pixels_8x4_sym(ctx->blocks[7], ptr_v + ctx->dct_uv_offset,     ctx->m.uvlinesize);
-        } else {
-            dsp->clear_block(ctx->blocks[4]);
-            dsp->clear_block(ctx->blocks[5]);
-            dsp->clear_block(ctx->blocks[6]);
-            dsp->clear_block(ctx->blocks[7]);
-        }
-    } else {
-        dsp->get_pixels(ctx->blocks[4], ptr_y + ctx->dct_y_offset,      ctx->m.linesize);
-        dsp->get_pixels(ctx->blocks[5], ptr_y + ctx->dct_y_offset + bw, ctx->m.linesize);
-        dsp->get_pixels(ctx->blocks[6], ptr_u + ctx->dct_uv_offset,     ctx->m.uvlinesize);
-        dsp->get_pixels(ctx->blocks[7], ptr_v + ctx->dct_uv_offset,     ctx->m.uvlinesize);
-    }
-}
-
-static av_always_inline int dnxhd_switch_matrix(DNXHDEncContext *ctx, int i)
-{
-    if (i&2) {
-        ctx->m.q_intra_matrix16 = ctx->qmatrix_c16;
-        ctx->m.q_intra_matrix   = ctx->qmatrix_c;
-        return 1 + (i&1);
-    } else {
-        ctx->m.q_intra_matrix16 = ctx->qmatrix_l16;
-        ctx->m.q_intra_matrix   = ctx->qmatrix_l;
-        return 0;
-    }
-}
-
-static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
-{
-    DNXHDEncContext *ctx = avctx->priv_data;
-    int mb_y = jobnr, mb_x;
-    int qscale = ctx->qscale;
-    LOCAL_ALIGNED_16(int16_t, block, [64]);
-    ctx = ctx->thread[threadnr];
-
-    ctx->m.last_dc[0] =
-    ctx->m.last_dc[1] =
-    ctx->m.last_dc[2] = 1 << (ctx->cid_table->bit_depth + 2);
-
-    for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
-        unsigned mb = mb_y * ctx->m.mb_width + mb_x;
-        int ssd     = 0;
-        int ac_bits = 0;
-        int dc_bits = 0;
-        int i;
-
-        dnxhd_get_blocks(ctx, mb_x, mb_y);
-
-        for (i = 0; i < 8; i++) {
-            int16_t *src_block = ctx->blocks[i];
-            int overflow, nbits, diff, last_index;
-            int n = dnxhd_switch_matrix(ctx, i);
-
-            memcpy(block, src_block, 64*sizeof(*block));
-            last_index = ctx->m.dct_quantize(&ctx->m, block, i, qscale, &overflow);
-            ac_bits += dnxhd_calc_ac_bits(ctx, block, last_index);
-
-            diff = block[0] - ctx->m.last_dc[n];
-            if (diff < 0) nbits = av_log2_16bit(-2*diff);
-            else          nbits = av_log2_16bit( 2*diff);
-
-            assert(nbits < ctx->cid_table->bit_depth + 4);
-            dc_bits += ctx->cid_table->dc_bits[nbits] + nbits;
-
-            ctx->m.last_dc[n] = block[0];
-
-            if (avctx->mb_decision == FF_MB_DECISION_RD || !RC_VARIANCE) {
-                dnxhd_unquantize_c(ctx, block, i, qscale, last_index);
-                ctx->m.dsp.idct(block);
-                ssd += dnxhd_ssd_block(block, src_block);
-            }
-        }
-        ctx->mb_rc[qscale][mb].ssd = ssd;
-        ctx->mb_rc[qscale][mb].bits = ac_bits+dc_bits+12+8*ctx->vlc_bits[0];
-    }
-    return 0;
-}
-
-static int dnxhd_encode_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
-{
-    DNXHDEncContext *ctx = avctx->priv_data;
-    int mb_y = jobnr, mb_x;
-    ctx = ctx->thread[threadnr];
-    init_put_bits(&ctx->m.pb, (uint8_t *)arg + 640 + ctx->slice_offs[jobnr], ctx->slice_size[jobnr]);
-
-    ctx->m.last_dc[0] =
-    ctx->m.last_dc[1] =
-    ctx->m.last_dc[2] = 1 << (ctx->cid_table->bit_depth + 2);
-    for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
-        unsigned mb = mb_y * ctx->m.mb_width + mb_x;
-        int qscale = ctx->mb_qscale[mb];
-        int i;
-
-        put_bits(&ctx->m.pb, 12, qscale<<1);
-
-        dnxhd_get_blocks(ctx, mb_x, mb_y);
-
-        for (i = 0; i < 8; i++) {
-            int16_t *block = ctx->blocks[i];
-            int overflow, n = dnxhd_switch_matrix(ctx, i);
-            int last_index = ctx->m.dct_quantize(&ctx->m, block, i,
-                                                 qscale, &overflow);
-            //START_TIMER;
-            dnxhd_encode_block(ctx, block, last_index, n);
-            //STOP_TIMER("encode_block");
-        }
-    }
-    if (put_bits_count(&ctx->m.pb)&31)
-        put_bits(&ctx->m.pb, 32-(put_bits_count(&ctx->m.pb)&31), 0);
-    flush_put_bits(&ctx->m.pb);
-    return 0;
-}
-
-static void dnxhd_setup_threads_slices(DNXHDEncContext *ctx)
-{
-    int mb_y, mb_x;
-    int offset = 0;
-    for (mb_y = 0; mb_y < ctx->m.mb_height; mb_y++) {
-        int thread_size;
-        ctx->slice_offs[mb_y] = offset;
-        ctx->slice_size[mb_y] = 0;
-        for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
-            unsigned mb = mb_y * ctx->m.mb_width + mb_x;
-            ctx->slice_size[mb_y] += ctx->mb_bits[mb];
-        }
-        ctx->slice_size[mb_y] = (ctx->slice_size[mb_y]+31)&~31;
-        ctx->slice_size[mb_y] >>= 3;
-        thread_size = ctx->slice_size[mb_y];
-        offset += thread_size;
-    }
-}
-
-static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
-{
-    DNXHDEncContext *ctx = avctx->priv_data;
-    int mb_y = jobnr, mb_x, x, y;
-    int partial_last_row = (mb_y == ctx->m.mb_height - 1) &&
-                           ((avctx->height >> ctx->interlaced) & 0xF);
-
-    ctx = ctx->thread[threadnr];
-    if (ctx->cid_table->bit_depth == 8) {
-        uint8_t *pix = ctx->thread[0]->src[0] + ((mb_y<<4) * ctx->m.linesize);
-        for (mb_x = 0; mb_x < ctx->m.mb_width; ++mb_x, pix += 16) {
-            unsigned mb  = mb_y * ctx->m.mb_width + mb_x;
-            int sum;
-            int varc;
-
-            if (!partial_last_row && mb_x * 16 <= avctx->width - 16) {
-                sum  = ctx->m.dsp.pix_sum(pix, ctx->m.linesize);
-                varc = ctx->m.dsp.pix_norm1(pix, ctx->m.linesize);
-            } else {
-                int bw = FFMIN(avctx->width - 16 * mb_x, 16);
-                int bh = FFMIN((avctx->height >> ctx->interlaced) - 16 * mb_y, 16);
-                sum = varc = 0;
-                for (y = 0; y < bh; y++) {
-                    for (x = 0; x < bw; x++) {
-                        uint8_t val = pix[x + y * ctx->m.linesize];
-                        sum  += val;
-                        varc += val * val;
-                    }
-                }
-            }
-            varc = (varc - (((unsigned)sum * sum) >> 8) + 128) >> 8;
-
-            ctx->mb_cmp[mb].value = varc;
-            ctx->mb_cmp[mb].mb = mb;
-        }
-    } else { // 10-bit
-        int const linesize = ctx->m.linesize >> 1;
-        for (mb_x = 0; mb_x < ctx->m.mb_width; ++mb_x) {
-            uint16_t *pix = (uint16_t*)ctx->thread[0]->src[0] + ((mb_y << 4) * linesize) + (mb_x << 4);
-            unsigned mb  = mb_y * ctx->m.mb_width + mb_x;
-            int sum = 0;
-            int sqsum = 0;
-            int mean, sqmean;
-            int i, j;
-            // Macroblocks are 16x16 pixels, unlike DCT blocks which are 8x8.
-            for (i = 0; i < 16; ++i) {
-                for (j = 0; j < 16; ++j) {
-                    // Turn 16-bit pixels into 10-bit ones.
-                    int const sample = (unsigned)pix[j] >> 6;
-                    sum += sample;
-                    sqsum += sample * sample;
-                    // 2^10 * 2^10 * 16 * 16 = 2^28, which is less than INT_MAX
-                }
-                pix += linesize;
-            }
-            mean = sum >> 8; // 16*16 == 2^8
-            sqmean = sqsum >> 8;
-            ctx->mb_cmp[mb].value = sqmean - mean * mean;
-            ctx->mb_cmp[mb].mb = mb;
-        }
-    }
-    return 0;
-}
-
-static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
-{
-    int lambda, up_step, down_step;
-    int last_lower = INT_MAX, last_higher = 0;
-    int x, y, q;
-
-    for (q = 1; q < avctx->qmax; q++) {
-        ctx->qscale = q;
-        avctx->execute2(avctx, dnxhd_calc_bits_thread, NULL, NULL, ctx->m.mb_height);
-    }
-    up_step = down_step = 2<<LAMBDA_FRAC_BITS;
-    lambda = ctx->lambda;
-
-    for (;;) {
-        int bits = 0;
-        int end = 0;
-        if (lambda == last_higher) {
-            lambda++;
-            end = 1; // need to set final qscales/bits
-        }
-        for (y = 0; y < ctx->m.mb_height; y++) {
-            for (x = 0; x < ctx->m.mb_width; x++) {
-                unsigned min = UINT_MAX;
-                int qscale = 1;
-                int mb = y*ctx->m.mb_width+x;
-                for (q = 1; q < avctx->qmax; q++) {
-                    unsigned score = ctx->mb_rc[q][mb].bits*lambda+
-                        ((unsigned)ctx->mb_rc[q][mb].ssd<<LAMBDA_FRAC_BITS);
-                    if (score < min) {
-                        min = score;
-                        qscale = q;
-                    }
-                }
-                bits += ctx->mb_rc[qscale][mb].bits;
-                ctx->mb_qscale[mb] = qscale;
-                ctx->mb_bits[mb] = ctx->mb_rc[qscale][mb].bits;
-            }
-            bits = (bits+31)&~31; // padding
-            if (bits > ctx->frame_bits)
-                break;
-        }
-        //av_dlog(ctx->m.avctx, "lambda %d, up %u, down %u, bits %d, frame %d\n",
-        //        lambda, last_higher, last_lower, bits, ctx->frame_bits);
-        if (end) {
-            if (bits > ctx->frame_bits)
-                return -1;
-            break;
-        }
-        if (bits < ctx->frame_bits) {
-            last_lower = FFMIN(lambda, last_lower);
-            if (last_higher != 0)
-                lambda = (lambda+last_higher)>>1;
-            else
-                lambda -= down_step;
-            down_step = FFMIN((int64_t)down_step*5, INT_MAX);
-            up_step = 1<<LAMBDA_FRAC_BITS;
-            lambda = FFMAX(1, lambda);
-            if (lambda == last_lower)
-                break;
-        } else {
-            last_higher = FFMAX(lambda, last_higher);
-            if (last_lower != INT_MAX)
-                lambda = (lambda+last_lower)>>1;
-            else if ((int64_t)lambda + up_step > INT_MAX)
-                return -1;
-            else
-                lambda += up_step;
-            up_step = FFMIN((int64_t)up_step*5, INT_MAX);
-            down_step = 1<<LAMBDA_FRAC_BITS;
-        }
-    }
-    //av_dlog(ctx->m.avctx, "out lambda %d\n", lambda);
-    ctx->lambda = lambda;
-    return 0;
-}
-
-static int dnxhd_find_qscale(DNXHDEncContext *ctx)
-{
-    int bits = 0;
-    int up_step = 1;
-    int down_step = 1;
-    int last_higher = 0;
-    int last_lower = INT_MAX;
-    int qscale;
-    int x, y;
-
-    qscale = ctx->qscale;
-    for (;;) {
-        bits = 0;
-        ctx->qscale = qscale;
-        // XXX avoid recalculating bits
-        ctx->m.avctx->execute2(ctx->m.avctx, dnxhd_calc_bits_thread, NULL, NULL, ctx->m.mb_height);
-        for (y = 0; y < ctx->m.mb_height; y++) {
-            for (x = 0; x < ctx->m.mb_width; x++)
-                bits += ctx->mb_rc[qscale][y*ctx->m.mb_width+x].bits;
-            bits = (bits+31)&~31; // padding
-            if (bits > ctx->frame_bits)
-                break;
-        }
-        //av_dlog(ctx->m.avctx, "%d, qscale %d, bits %d, frame %d, higher %d, lower %d\n",
-        //        ctx->m.avctx->frame_number, qscale, bits, ctx->frame_bits, last_higher, last_lower);
-        if (bits < ctx->frame_bits) {
-            if (qscale == 1)
-                return 1;
-            if (last_higher == qscale - 1) {
-                qscale = last_higher;
-                break;
-            }
-            last_lower = FFMIN(qscale, last_lower);
-            if (last_higher != 0)
-                qscale = (qscale+last_higher)>>1;
-            else
-                qscale -= down_step++;
-            if (qscale < 1)
-                qscale = 1;
-            up_step = 1;
-        } else {
-            if (last_lower == qscale + 1)
-                break;
-            last_higher = FFMAX(qscale, last_higher);
-            if (last_lower != INT_MAX)
-                qscale = (qscale+last_lower)>>1;
-            else
-                qscale += up_step++;
-            down_step = 1;
-            if (qscale >= ctx->m.avctx->qmax)
-                return -1;
-        }
-    }
-    //av_dlog(ctx->m.avctx, "out qscale %d\n", qscale);
-    ctx->qscale = qscale;
-    return 0;
-}
-
-#define BUCKET_BITS 8
-#define RADIX_PASSES 4
-#define NBUCKETS (1 << BUCKET_BITS)
-
-static inline int get_bucket(int value, int shift)
-{
-    value >>= shift;
-    value &= NBUCKETS - 1;
-    return NBUCKETS - 1 - value;
-}
-
-static void radix_count(const RCCMPEntry *data, int size, int buckets[RADIX_PASSES][NBUCKETS])
-{
-    int i, j;
-    memset(buckets, 0, sizeof(buckets[0][0]) * RADIX_PASSES * NBUCKETS);
-    for (i = 0; i < size; i++) {
-        int v = data[i].value;
-        for (j = 0; j < RADIX_PASSES; j++) {
-            buckets[j][get_bucket(v, 0)]++;
-            v >>= BUCKET_BITS;
-        }
-        assert(!v);
-    }
-    for (j = 0; j < RADIX_PASSES; j++) {
-        int offset = size;
-        for (i = NBUCKETS - 1; i >= 0; i--)
-            buckets[j][i] = offset -= buckets[j][i];
-        assert(!buckets[j][0]);
-    }
-}
-
-static void radix_sort_pass(RCCMPEntry *dst, const RCCMPEntry *data, int size, int buckets[NBUCKETS], int pass)
-{
-    int shift = pass * BUCKET_BITS;
-    int i;
-    for (i = 0; i < size; i++) {
-        int v = get_bucket(data[i].value, shift);
-        int pos = buckets[v]++;
-        dst[pos] = data[i];
-    }
-}
-
-static void radix_sort(RCCMPEntry *data, int size)
-{
-    int buckets[RADIX_PASSES][NBUCKETS];
-    RCCMPEntry *tmp = av_malloc(sizeof(*tmp) * size);
-    radix_count(data, size, buckets);
-    radix_sort_pass(tmp, data, size, buckets[0], 0);
-    radix_sort_pass(data, tmp, size, buckets[1], 1);
-    if (buckets[2][NBUCKETS - 1] || buckets[3][NBUCKETS - 1]) {
-        radix_sort_pass(tmp, data, size, buckets[2], 2);
-        radix_sort_pass(data, tmp, size, buckets[3], 3);
-    }
-    av_free(tmp);
-}
-
-static int dnxhd_encode_fast(AVCodecContext *avctx, DNXHDEncContext *ctx)
-{
-    int max_bits = 0;
-    int ret, x, y;
-    if ((ret = dnxhd_find_qscale(ctx)) < 0)
-        return -1;
-    for (y = 0; y < ctx->m.mb_height; y++) {
-        for (x = 0; x < ctx->m.mb_width; x++) {
-            int mb = y*ctx->m.mb_width+x;
-            int delta_bits;
-            ctx->mb_qscale[mb] = ctx->qscale;
-            ctx->mb_bits[mb] = ctx->mb_rc[ctx->qscale][mb].bits;
-            max_bits += ctx->mb_rc[ctx->qscale][mb].bits;
-            if (!RC_VARIANCE) {
-                delta_bits = ctx->mb_rc[ctx->qscale][mb].bits-ctx->mb_rc[ctx->qscale+1][mb].bits;
-                ctx->mb_cmp[mb].mb = mb;
-                ctx->mb_cmp[mb].value = delta_bits ?
-                    ((ctx->mb_rc[ctx->qscale][mb].ssd-ctx->mb_rc[ctx->qscale+1][mb].ssd)*100)/delta_bits
-                    : INT_MIN; //avoid increasing qscale
-            }
-        }
-        max_bits += 31; //worst padding
-    }
-    if (!ret) {
-        if (RC_VARIANCE)
-            avctx->execute2(avctx, dnxhd_mb_var_thread, NULL, NULL, ctx->m.mb_height);
-        radix_sort(ctx->mb_cmp, ctx->m.mb_num);
-        for (x = 0; x < ctx->m.mb_num && max_bits > ctx->frame_bits; x++) {
-            int mb = ctx->mb_cmp[x].mb;
-            max_bits -= ctx->mb_rc[ctx->qscale][mb].bits - ctx->mb_rc[ctx->qscale+1][mb].bits;
-            ctx->mb_qscale[mb] = ctx->qscale+1;
-            ctx->mb_bits[mb] = ctx->mb_rc[ctx->qscale+1][mb].bits;
-        }
-    }
-    return 0;
-}
-
-static void dnxhd_load_picture(DNXHDEncContext *ctx, const AVFrame *frame)
-{
-    int i;
-
-    for (i = 0; i < ctx->m.avctx->thread_count; i++) {
-        ctx->thread[i]->m.linesize    = frame->linesize[0] << ctx->interlaced;
-        ctx->thread[i]->m.uvlinesize  = frame->linesize[1] << ctx->interlaced;
-        ctx->thread[i]->dct_y_offset  = ctx->m.linesize  *8;
-        ctx->thread[i]->dct_uv_offset = ctx->m.uvlinesize*8;
-    }
-
-    ctx->m.avctx->coded_frame->interlaced_frame = frame->interlaced_frame;
-    ctx->cur_field = frame->interlaced_frame && !frame->top_field_first;
-}
-
-static int dnxhd_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
-                                const AVFrame *frame, int *got_packet)
-{
-    DNXHDEncContext *ctx = avctx->priv_data;
-    int first_field = 1;
-    int offset, i, ret;
-    uint8_t *buf;
-
-    if ((ret = ff_alloc_packet(pkt, ctx->cid_table->frame_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "output buffer is too small to compress picture\n");
-        return ret;
-    }
-    buf = pkt->data;
-
-    dnxhd_load_picture(ctx, frame);
-
- encode_coding_unit:
-    for (i = 0; i < 3; i++) {
-        ctx->src[i] = frame->data[i];
-        if (ctx->interlaced && ctx->cur_field)
-            ctx->src[i] += frame->linesize[i];
-    }
-
-    dnxhd_write_header(avctx, buf);
-
-    if (avctx->mb_decision == FF_MB_DECISION_RD)
-        ret = dnxhd_encode_rdo(avctx, ctx);
-    else
-        ret = dnxhd_encode_fast(avctx, ctx);
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR,
-               "picture could not fit ratecontrol constraints, increase qmax\n");
-        return -1;
-    }
-
-    dnxhd_setup_threads_slices(ctx);
-
-    offset = 0;
-    for (i = 0; i < ctx->m.mb_height; i++) {
-        AV_WB32(ctx->msip + i * 4, offset);
-        offset += ctx->slice_size[i];
-        assert(!(ctx->slice_size[i] & 3));
-    }
-
-    avctx->execute2(avctx, dnxhd_encode_thread, buf, NULL, ctx->m.mb_height);
-
-    assert(640 + offset + 4 <= ctx->cid_table->coding_unit_size);
-    memset(buf + 640 + offset, 0, ctx->cid_table->coding_unit_size - 4 - offset - 640);
-
-    AV_WB32(buf + ctx->cid_table->coding_unit_size - 4, 0x600DC0DE); // EOF
-
-    if (ctx->interlaced && first_field) {
-        first_field     = 0;
-        ctx->cur_field ^= 1;
-        buf      += ctx->cid_table->coding_unit_size;
-        goto encode_coding_unit;
-    }
-
-    avctx->coded_frame->quality = ctx->qscale * FF_QP2LAMBDA;
-
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-static av_cold int dnxhd_encode_end(AVCodecContext *avctx)
-{
-    DNXHDEncContext *ctx = avctx->priv_data;
-    int max_level = 1<<(ctx->cid_table->bit_depth+2);
-    int i;
-
-    av_free(ctx->vlc_codes-max_level*2);
-    av_free(ctx->vlc_bits -max_level*2);
-    av_freep(&ctx->run_codes);
-    av_freep(&ctx->run_bits);
-
-    av_freep(&ctx->mb_bits);
-    av_freep(&ctx->mb_qscale);
-    av_freep(&ctx->mb_rc);
-    av_freep(&ctx->mb_cmp);
-    av_freep(&ctx->slice_size);
-    av_freep(&ctx->slice_offs);
-
-    av_freep(&ctx->qmatrix_c);
-    av_freep(&ctx->qmatrix_l);
-    av_freep(&ctx->qmatrix_c16);
-    av_freep(&ctx->qmatrix_l16);
-
-    for (i = 1; i < avctx->thread_count; i++)
-        av_freep(&ctx->thread[i]);
-
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-AVCodec ff_dnxhd_encoder = {
-    .name           = "dnxhd",
-    .long_name      = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DNXHD,
-    .priv_data_size = sizeof(DNXHDEncContext),
-    .init           = dnxhd_encode_init,
-    .encode2        = dnxhd_encode_picture,
-    .close          = dnxhd_encode_end,
-    .capabilities   = CODEC_CAP_SLICE_THREADS,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P,
-                                                  AV_PIX_FMT_YUV422P10,
-                                                  AV_PIX_FMT_NONE },
-    .priv_class     = &class,
-};
diff --git a/deps/libav/libavcodec/dnxhdenc.h b/deps/libav/libavcodec/dnxhdenc.h
deleted file mode 100644
index 232e334..0000000
--- a/deps/libav/libavcodec/dnxhdenc.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * VC3/DNxHD encoder structure definitions and prototypes
- * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- *
- * VC-3 encoder funded by the British Broadcasting Corporation
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DNXHDENC_H
-#define AVCODEC_DNXHDENC_H
-
-#include <stdint.h>
-
-#include "mpegvideo.h"
-#include "dnxhddata.h"
-
-typedef struct RCCMPEntry {
-    uint16_t mb;
-    int value;
-} RCCMPEntry;
-
-typedef struct RCEntry {
-    int ssd;
-    int bits;
-} RCEntry;
-
-typedef struct DNXHDEncContext {
-    AVClass *class;
-    MpegEncContext m; ///< Used for quantization dsp functions
-
-    int cid;
-    const CIDEntry *cid_table;
-    uint8_t *msip; ///< Macroblock Scan Indexes Payload
-    uint32_t *slice_size;
-    uint32_t *slice_offs;
-
-    struct DNXHDEncContext *thread[MAX_THREADS];
-
-    // Because our samples are either 8 or 16 bits for 8-bit and 10-bit
-    // encoding respectively, these refer either to bytes or to two-byte words.
-    unsigned dct_y_offset;
-    unsigned dct_uv_offset;
-    unsigned block_width_l2;
-
-    int interlaced;
-    int cur_field;
-
-    int nitris_compat;
-    unsigned min_padding;
-
-    DECLARE_ALIGNED(16, int16_t, blocks)[8][64];
-
-    int      (*qmatrix_c)     [64];
-    int      (*qmatrix_l)     [64];
-    uint16_t (*qmatrix_l16)[2][64];
-    uint16_t (*qmatrix_c16)[2][64];
-
-    unsigned frame_bits;
-    uint8_t *src[3];
-
-    uint32_t *vlc_codes;
-    uint8_t  *vlc_bits;
-    uint16_t *run_codes;
-    uint8_t  *run_bits;
-
-    /** Rate control */
-    unsigned slice_bits;
-    unsigned qscale;
-    unsigned lambda;
-
-    unsigned thread_size;
-
-    uint16_t *mb_bits;
-    uint8_t  *mb_qscale;
-
-    RCCMPEntry *mb_cmp;
-    RCEntry   (*mb_rc)[8160];
-
-    void (*get_pixels_8x4_sym)(int16_t * /*align 16*/, const uint8_t *, int);
-} DNXHDEncContext;
-
-void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);
-
-#endif /* AVCODEC_DNXHDENC_H */
diff --git a/deps/libav/libavcodec/dpcm.c b/deps/libav/libavcodec/dpcm.c
deleted file mode 100644
index 5ab2331..0000000
--- a/deps/libav/libavcodec/dpcm.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Assorted DPCM codecs
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Assorted DPCM (differential pulse code modulation) audio codecs
- * by Mike Melanson (melanson at pcisys.net)
- * Xan DPCM decoder by Mario Brito (mbrito at student.dei.uc.pt)
- * for more information on the specific data formats, visit:
- *   http://www.pcisys.net/~melanson/codecs/simpleaudio.html
- * SOL DPCMs implemented by Konstantin Shishkov
- *
- * Note about using the Xan DPCM decoder: Xan DPCM is used in AVI files
- * found in the Wing Commander IV computer game. These AVI files contain
- * WAVEFORMAT headers which report the audio format as 0x01: raw PCM.
- * Clearly incorrect. To detect Xan DPCM, you will probably have to
- * special-case your AVI demuxer to use Xan DPCM if the file uses 'Xxan'
- * (Xan video) for its video codec. Alternately, such AVI files also contain
- * the fourcc 'Axan' in the 'auds' chunk of the AVI header.
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "mathops.h"
-
-typedef struct DPCMContext {
-    int16_t roq_square_array[256];
-    int sample[2];                  ///< previous sample (for SOL_DPCM)
-    const int8_t *sol_table;        ///< delta table for SOL_DPCM
-} DPCMContext;
-
-static const int16_t interplay_delta_table[] = {
-         0,      1,      2,      3,      4,      5,      6,      7,
-         8,      9,     10,     11,     12,     13,     14,     15,
-        16,     17,     18,     19,     20,     21,     22,     23,
-        24,     25,     26,     27,     28,     29,     30,     31,
-        32,     33,     34,     35,     36,     37,     38,     39,
-        40,     41,     42,     43,     47,     51,     56,     61,
-        66,     72,     79,     86,     94,    102,    112,    122,
-       133,    145,    158,    173,    189,    206,    225,    245,
-       267,    292,    318,    348,    379,    414,    452,    493,
-       538,    587,    640,    699,    763,    832,    908,    991,
-      1081,   1180,   1288,   1405,   1534,   1673,   1826,   1993,
-      2175,   2373,   2590,   2826,   3084,   3365,   3672,   4008,
-      4373,   4772,   5208,   5683,   6202,   6767,   7385,   8059,
-      8794,   9597,  10472,  11428,  12471,  13609,  14851,  16206,
-     17685,  19298,  21060,  22981,  25078,  27367,  29864,  32589,
-    -29973, -26728, -23186, -19322, -15105, -10503,  -5481,     -1,
-         1,      1,   5481,  10503,  15105,  19322,  23186,  26728,
-     29973, -32589, -29864, -27367, -25078, -22981, -21060, -19298,
-    -17685, -16206, -14851, -13609, -12471, -11428, -10472,  -9597,
-     -8794,  -8059,  -7385,  -6767,  -6202,  -5683,  -5208,  -4772,
-     -4373,  -4008,  -3672,  -3365,  -3084,  -2826,  -2590,  -2373,
-     -2175,  -1993,  -1826,  -1673,  -1534,  -1405,  -1288,  -1180,
-     -1081,   -991,   -908,   -832,   -763,   -699,   -640,   -587,
-      -538,   -493,   -452,   -414,   -379,   -348,   -318,   -292,
-      -267,   -245,   -225,   -206,   -189,   -173,   -158,   -145,
-      -133,   -122,   -112,   -102,    -94,    -86,    -79,    -72,
-       -66,    -61,    -56,    -51,    -47,    -43,    -42,    -41,
-       -40,    -39,    -38,    -37,    -36,    -35,    -34,    -33,
-       -32,    -31,    -30,    -29,    -28,    -27,    -26,    -25,
-       -24,    -23,    -22,    -21,    -20,    -19,    -18,    -17,
-       -16,    -15,    -14,    -13,    -12,    -11,    -10,     -9,
-        -8,     -7,     -6,     -5,     -4,     -3,     -2,     -1
-
-};
-
-static const int8_t sol_table_old[16] = {
-      0x0,  0x1,  0x2,  0x3,  0x6,  0xA,  0xF, 0x15,
-    -0x15, -0xF, -0xA, -0x6, -0x3, -0x2, -0x1,  0x0
-};
-
-static const int8_t sol_table_new[16] = {
-    0x0,  0x1,  0x2,  0x3,  0x6,  0xA,  0xF,  0x15,
-    0x0, -0x1, -0x2, -0x3, -0x6, -0xA, -0xF, -0x15
-};
-
-static const int16_t sol_table_16[128] = {
-    0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080,
-    0x090, 0x0A0, 0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120,
-    0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0,
-    0x1D0, 0x1E0, 0x1F0, 0x200, 0x208, 0x210, 0x218, 0x220, 0x228, 0x230,
-    0x238, 0x240, 0x248, 0x250, 0x258, 0x260, 0x268, 0x270, 0x278, 0x280,
-    0x288, 0x290, 0x298, 0x2A0, 0x2A8, 0x2B0, 0x2B8, 0x2C0, 0x2C8, 0x2D0,
-    0x2D8, 0x2E0, 0x2E8, 0x2F0, 0x2F8, 0x300, 0x308, 0x310, 0x318, 0x320,
-    0x328, 0x330, 0x338, 0x340, 0x348, 0x350, 0x358, 0x360, 0x368, 0x370,
-    0x378, 0x380, 0x388, 0x390, 0x398, 0x3A0, 0x3A8, 0x3B0, 0x3B8, 0x3C0,
-    0x3C8, 0x3D0, 0x3D8, 0x3E0, 0x3E8, 0x3F0, 0x3F8, 0x400, 0x440, 0x480,
-    0x4C0, 0x500, 0x540, 0x580, 0x5C0, 0x600, 0x640, 0x680, 0x6C0, 0x700,
-    0x740, 0x780, 0x7C0, 0x800, 0x900, 0xA00, 0xB00, 0xC00, 0xD00, 0xE00,
-    0xF00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x3000, 0x4000
-};
-
-
-static av_cold int dpcm_decode_init(AVCodecContext *avctx)
-{
-    DPCMContext *s = avctx->priv_data;
-    int i;
-
-    if (avctx->channels < 1 || avctx->channels > 2) {
-        av_log(avctx, AV_LOG_INFO, "invalid number of channels\n");
-        return AVERROR(EINVAL);
-    }
-
-    s->sample[0] = s->sample[1] = 0;
-
-    switch(avctx->codec->id) {
-
-    case AV_CODEC_ID_ROQ_DPCM:
-        /* initialize square table */
-        for (i = 0; i < 128; i++) {
-            int16_t square = i * i;
-            s->roq_square_array[i      ] =  square;
-            s->roq_square_array[i + 128] = -square;
-        }
-        break;
-
-    case AV_CODEC_ID_SOL_DPCM:
-        switch(avctx->codec_tag){
-        case 1:
-            s->sol_table = sol_table_old;
-            s->sample[0] = s->sample[1] = 0x80;
-            break;
-        case 2:
-            s->sol_table = sol_table_new;
-            s->sample[0] = s->sample[1] = 0x80;
-            break;
-        case 3:
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unknown SOL subcodec\n");
-            return -1;
-        }
-        break;
-
-    default:
-        break;
-    }
-
-    if (avctx->codec->id == AV_CODEC_ID_SOL_DPCM && avctx->codec_tag != 3)
-        avctx->sample_fmt = AV_SAMPLE_FMT_U8;
-    else
-        avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-
-    return 0;
-}
-
-
-static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    int buf_size = avpkt->size;
-    DPCMContext *s = avctx->priv_data;
-    AVFrame *frame = data;
-    int out = 0, ret;
-    int predictor[2];
-    int ch = 0;
-    int stereo = avctx->channels - 1;
-    int16_t *output_samples, *samples_end;
-    GetByteContext gb;
-
-    if (stereo && (buf_size & 1))
-        buf_size--;
-    bytestream2_init(&gb, avpkt->data, buf_size);
-
-    /* calculate output size */
-    switch(avctx->codec->id) {
-    case AV_CODEC_ID_ROQ_DPCM:
-        out = buf_size - 8;
-        break;
-    case AV_CODEC_ID_INTERPLAY_DPCM:
-        out = buf_size - 6 - avctx->channels;
-        break;
-    case AV_CODEC_ID_XAN_DPCM:
-        out = buf_size - 2 * avctx->channels;
-        break;
-    case AV_CODEC_ID_SOL_DPCM:
-        if (avctx->codec_tag != 3)
-            out = buf_size * 2;
-        else
-            out = buf_size;
-        break;
-    }
-    if (out <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* get output buffer */
-    frame->nb_samples = out / avctx->channels;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    output_samples = (int16_t *)frame->data[0];
-    samples_end = output_samples + out;
-
-    switch(avctx->codec->id) {
-
-    case AV_CODEC_ID_ROQ_DPCM:
-        bytestream2_skipu(&gb, 6);
-
-        if (stereo) {
-            predictor[1] = sign_extend(bytestream2_get_byteu(&gb) << 8, 16);
-            predictor[0] = sign_extend(bytestream2_get_byteu(&gb) << 8, 16);
-        } else {
-            predictor[0] = sign_extend(bytestream2_get_le16u(&gb), 16);
-        }
-
-        /* decode the samples */
-        while (output_samples < samples_end) {
-            predictor[ch] += s->roq_square_array[bytestream2_get_byteu(&gb)];
-            predictor[ch]  = av_clip_int16(predictor[ch]);
-            *output_samples++ = predictor[ch];
-
-            /* toggle channel */
-            ch ^= stereo;
-        }
-        break;
-
-    case AV_CODEC_ID_INTERPLAY_DPCM:
-        bytestream2_skipu(&gb, 6);  /* skip over the stream mask and stream length */
-
-        for (ch = 0; ch < avctx->channels; ch++) {
-            predictor[ch] = sign_extend(bytestream2_get_le16u(&gb), 16);
-            *output_samples++ = predictor[ch];
-        }
-
-        ch = 0;
-        while (output_samples < samples_end) {
-            predictor[ch] += interplay_delta_table[bytestream2_get_byteu(&gb)];
-            predictor[ch]  = av_clip_int16(predictor[ch]);
-            *output_samples++ = predictor[ch];
-
-            /* toggle channel */
-            ch ^= stereo;
-        }
-        break;
-
-    case AV_CODEC_ID_XAN_DPCM:
-    {
-        int shift[2] = { 4, 4 };
-
-        for (ch = 0; ch < avctx->channels; ch++)
-            predictor[ch] = sign_extend(bytestream2_get_le16u(&gb), 16);
-
-        ch = 0;
-        while (output_samples < samples_end) {
-            int diff = bytestream2_get_byteu(&gb);
-            int n    = diff & 3;
-
-            if (n == 3)
-                shift[ch]++;
-            else
-                shift[ch] -= (2 * n);
-            diff = sign_extend((diff &~ 3) << 8, 16);
-
-            /* saturate the shifter to a lower limit of 0 */
-            if (shift[ch] < 0)
-                shift[ch] = 0;
-
-            diff >>= shift[ch];
-            predictor[ch] += diff;
-
-            predictor[ch] = av_clip_int16(predictor[ch]);
-            *output_samples++ = predictor[ch];
-
-            /* toggle channel */
-            ch ^= stereo;
-        }
-        break;
-    }
-    case AV_CODEC_ID_SOL_DPCM:
-        if (avctx->codec_tag != 3) {
-            uint8_t *output_samples_u8 = frame->data[0],
-                    *samples_end_u8 = output_samples_u8 + out;
-            while (output_samples_u8 < samples_end_u8) {
-                int n = bytestream2_get_byteu(&gb);
-
-                s->sample[0] += s->sol_table[n >> 4];
-                s->sample[0]  = av_clip_uint8(s->sample[0]);
-                *output_samples_u8++ = s->sample[0];
-
-                s->sample[stereo] += s->sol_table[n & 0x0F];
-                s->sample[stereo]  = av_clip_uint8(s->sample[stereo]);
-                *output_samples_u8++ = s->sample[stereo];
-            }
-        } else {
-            while (output_samples < samples_end) {
-                int n = bytestream2_get_byteu(&gb);
-                if (n & 0x80) s->sample[ch] -= sol_table_16[n & 0x7F];
-                else          s->sample[ch] += sol_table_16[n & 0x7F];
-                s->sample[ch] = av_clip_int16(s->sample[ch]);
-                *output_samples++ = s->sample[ch];
-                /* toggle channel */
-                ch ^= stereo;
-            }
-        }
-        break;
-    }
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-#define DPCM_DECODER(id_, name_, long_name_)                \
-AVCodec ff_ ## name_ ## _decoder = {                        \
-    .name           = #name_,                               \
-    .long_name      = NULL_IF_CONFIG_SMALL(long_name_),     \
-    .type           = AVMEDIA_TYPE_AUDIO,                   \
-    .id             = id_,                                  \
-    .priv_data_size = sizeof(DPCMContext),                  \
-    .init           = dpcm_decode_init,                     \
-    .decode         = dpcm_decode_frame,                    \
-    .capabilities   = CODEC_CAP_DR1,                        \
-}
-
-DPCM_DECODER(AV_CODEC_ID_INTERPLAY_DPCM, interplay_dpcm, "DPCM Interplay");
-DPCM_DECODER(AV_CODEC_ID_ROQ_DPCM,       roq_dpcm,       "DPCM id RoQ");
-DPCM_DECODER(AV_CODEC_ID_SOL_DPCM,       sol_dpcm,       "DPCM Sol");
-DPCM_DECODER(AV_CODEC_ID_XAN_DPCM,       xan_dpcm,       "DPCM Xan");
diff --git a/deps/libav/libavcodec/dpx.c b/deps/libav/libavcodec/dpx.c
deleted file mode 100644
index 0dfa538..0000000
--- a/deps/libav/libavcodec/dpx.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * DPX (.dpx) image decoder
- * Copyright (c) 2009 Jimmy Christensen
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "bytestream.h"
-#include "avcodec.h"
-#include "internal.h"
-
-static unsigned int read32(const uint8_t **ptr, int is_big)
-{
-    unsigned int temp;
-    if (is_big) {
-        temp = AV_RB32(*ptr);
-    } else {
-        temp = AV_RL32(*ptr);
-    }
-    *ptr += 4;
-    return temp;
-}
-
-static inline unsigned make_16bit(unsigned value)
-{
-    // mask away invalid bits
-    value &= 0xFFC0;
-    // correctly expand to 16 bits
-    return value + (value >> 10);
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data,
-                        int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    const uint8_t *buf_end = avpkt->data + avpkt->size;
-    int buf_size       = avpkt->size;
-    AVFrame *const p = data;
-    uint8_t *ptr;
-
-    unsigned int offset;
-    int magic_num, endian;
-    int x, y, ret;
-    int w, h, stride, bits_per_color, descriptor, elements, target_packet_size, source_packet_size;
-
-    unsigned int rgbBuffer;
-
-    if (avpkt->size <= 1634) {
-        av_log(avctx, AV_LOG_ERROR, "Packet too small for DPX header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    magic_num = AV_RB32(buf);
-    buf += 4;
-
-    /* Check if the files "magic number" is "SDPX" which means it uses
-     * big-endian or XPDS which is for little-endian files */
-    if (magic_num == AV_RL32("SDPX")) {
-        endian = 0;
-    } else if (magic_num == AV_RB32("SDPX")) {
-        endian = 1;
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "DPX marker not found\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    offset = read32(&buf, endian);
-    if (avpkt->size <= offset) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid data start offset\n");
-        return AVERROR_INVALIDDATA;
-    }
-    // Need to end in 0x304 offset from start of file
-    buf = avpkt->data + 0x304;
-    w = read32(&buf, endian);
-    h = read32(&buf, endian);
-
-    // Need to end in 0x320 to read the descriptor
-    buf += 20;
-    descriptor = buf[0];
-
-    // Need to end in 0x323 to read the bits per color
-    buf += 3;
-    avctx->bits_per_raw_sample =
-    bits_per_color = buf[0];
-
-    buf += 825;
-    avctx->sample_aspect_ratio.num = read32(&buf, endian);
-    avctx->sample_aspect_ratio.den = read32(&buf, endian);
-
-    switch (descriptor) {
-        case 51: // RGBA
-            elements = 4;
-            break;
-        case 50: // RGB
-            elements = 3;
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unsupported descriptor %d\n", descriptor);
-            return AVERROR_INVALIDDATA;
-    }
-
-    switch (bits_per_color) {
-        case 8:
-            if (elements == 4) {
-                avctx->pix_fmt = AV_PIX_FMT_RGBA;
-            } else {
-                avctx->pix_fmt = AV_PIX_FMT_RGB24;
-            }
-            source_packet_size = elements;
-            target_packet_size = elements;
-            break;
-        case 10:
-            avctx->pix_fmt = AV_PIX_FMT_RGB48;
-            target_packet_size = 6;
-            source_packet_size = 4;
-            break;
-        case 12:
-        case 16:
-            if (endian) {
-                avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
-            } else {
-                avctx->pix_fmt = AV_PIX_FMT_RGB48LE;
-            }
-            target_packet_size = 6;
-            source_packet_size = elements * 2;
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unsupported color depth : %d\n", bits_per_color);
-            return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    // Move pointer to offset from start of file
-    buf =  avpkt->data + offset;
-
-    ptr    = p->data[0];
-    stride = p->linesize[0];
-
-    if (source_packet_size*avctx->width*avctx->height > buf_end - buf) {
-        av_log(avctx, AV_LOG_ERROR, "Overread buffer. Invalid header?\n");
-        return AVERROR_INVALIDDATA;
-    }
-    switch (bits_per_color) {
-        case 10:
-            for (x = 0; x < avctx->height; x++) {
-               uint16_t *dst = (uint16_t*)ptr;
-               for (y = 0; y < avctx->width; y++) {
-                   rgbBuffer = read32(&buf, endian);
-                   // Read out the 10-bit colors and convert to 16-bit
-                   *dst++ = make_16bit(rgbBuffer >> 16);
-                   *dst++ = make_16bit(rgbBuffer >>  6);
-                   *dst++ = make_16bit(rgbBuffer <<  4);
-               }
-               ptr += stride;
-            }
-            break;
-        case 8:
-        case 12: // Treat 12-bit as 16-bit
-        case 16:
-            if (source_packet_size == target_packet_size) {
-                for (x = 0; x < avctx->height; x++) {
-                    memcpy(ptr, buf, target_packet_size*avctx->width);
-                    ptr += stride;
-                    buf += source_packet_size*avctx->width;
-                }
-            } else {
-                for (x = 0; x < avctx->height; x++) {
-                    uint8_t *dst = ptr;
-                    for (y = 0; y < avctx->width; y++) {
-                        memcpy(dst, buf, target_packet_size);
-                        dst += target_packet_size;
-                        buf += source_packet_size;
-                    }
-                    ptr += stride;
-                }
-            }
-            break;
-    }
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_dpx_decoder = {
-    .name           = "dpx",
-    .long_name      = NULL_IF_CONFIG_SMALL("DPX image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DPX,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/dpxenc.c b/deps/libav/libavcodec/dpxenc.c
deleted file mode 100644
index 2232933..0000000
--- a/deps/libav/libavcodec/dpxenc.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * DPX (.dpx) image encoder
- * Copyright (c) 2011 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-
-typedef struct DPXContext {
-    int big_endian;
-    int bits_per_component;
-    int descriptor;
-} DPXContext;
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    DPXContext *s = avctx->priv_data;
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    s->big_endian         = 1;
-    s->bits_per_component = 8;
-    s->descriptor         = 50; /* RGB */
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB24:
-        break;
-    case AV_PIX_FMT_RGBA:
-        s->descriptor = 51; /* RGBA */
-        break;
-    case AV_PIX_FMT_RGB48LE:
-        s->big_endian = 0;
-    case AV_PIX_FMT_RGB48BE:
-        s->bits_per_component = avctx->bits_per_raw_sample ? avctx->bits_per_raw_sample : 16;
-        break;
-    default:
-        av_log(avctx, AV_LOG_INFO, "unsupported pixel format\n");
-        return -1;
-    }
-
-    return 0;
-}
-
-#define write16(p, value) \
-do { \
-    if (s->big_endian) AV_WB16(p, value); \
-    else               AV_WL16(p, value); \
-} while(0)
-
-#define write32(p, value) \
-do { \
-    if (s->big_endian) AV_WB32(p, value); \
-    else               AV_WL32(p, value); \
-} while(0)
-
-static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic,
-                               uint8_t *dst)
-{
-    DPXContext *s = avctx->priv_data;
-    const uint8_t *src = pic->data[0];
-    int x, y;
-
-    for (y = 0; y < avctx->height; y++) {
-        for (x = 0; x < avctx->width; x++) {
-            int value;
-            if ((avctx->pix_fmt & 1)) {
-                value = ((AV_RB16(src + 6*x + 4) & 0xFFC0) >> 4)
-                      | ((AV_RB16(src + 6*x + 2) & 0xFFC0) << 6)
-                      | ((AV_RB16(src + 6*x + 0) & 0xFFC0) << 16);
-            } else {
-                value = ((AV_RL16(src + 6*x + 4) & 0xFFC0) >> 4)
-                      | ((AV_RL16(src + 6*x + 2) & 0xFFC0) << 6)
-                      | ((AV_RL16(src + 6*x + 0) & 0xFFC0) << 16);
-            }
-            write32(dst, value);
-            dst += 4;
-        }
-        src += pic->linesize[0];
-    }
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *frame, int *got_packet)
-{
-    DPXContext *s = avctx->priv_data;
-    int size, ret;
-    uint8_t *buf;
-
-#define HEADER_SIZE 1664  /* DPX Generic header */
-    if (s->bits_per_component == 10)
-        size = avctx->height * avctx->width * 4;
-    else
-        size = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
-    if ((ret = ff_alloc_packet(pkt, size + HEADER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-    buf = pkt->data;
-
-    memset(buf, 0, HEADER_SIZE);
-
-    /* File information header */
-    write32(buf,       MKBETAG('S','D','P','X'));
-    write32(buf +   4, HEADER_SIZE);
-    memcpy (buf +   8, "V1.0", 4);
-    write32(buf +  20, 1); /* new image */
-    write32(buf +  24, HEADER_SIZE);
-    if (!(avctx->flags & CODEC_FLAG_BITEXACT))
-        memcpy (buf + 160, LIBAVCODEC_IDENT, FFMIN(sizeof(LIBAVCODEC_IDENT), 100));
-    write32(buf + 660, 0xFFFFFFFF); /* unencrypted */
-
-    /* Image information header */
-    write16(buf + 768, 0); /* orientation; left to right, top to bottom */
-    write16(buf + 770, 1); /* number of elements */
-    write32(buf + 772, avctx->width);
-    write32(buf + 776, avctx->height);
-    buf[800] = s->descriptor;
-    buf[801] = 2; /* linear transfer */
-    buf[802] = 2; /* linear colorimetric */
-    buf[803] = s->bits_per_component;
-    write16(buf + 804, s->bits_per_component == 10 ? 1 : 0); /* packing method */
-
-    /* Image source information header */
-    write32(buf + 1628, avctx->sample_aspect_ratio.num);
-    write32(buf + 1632, avctx->sample_aspect_ratio.den);
-
-    switch (s->bits_per_component) {
-    case 8:
-    case 16:
-        size = avpicture_layout((const AVPicture*)frame, avctx->pix_fmt,
-                                avctx->width, avctx->height,
-                                buf + HEADER_SIZE, pkt->size - HEADER_SIZE);
-        if (size < 0)
-            return size;
-        break;
-    case 10:
-        encode_rgb48_10bit(avctx, (const AVPicture*)frame, buf + HEADER_SIZE);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n", s->bits_per_component);
-        return -1;
-    }
-
-    size += HEADER_SIZE;
-
-    write32(buf + 16, size); /* file size */
-
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-AVCodec ff_dpx_encoder = {
-    .name = "dpx",
-    .long_name = NULL_IF_CONFIG_SMALL("DPX image"),
-    .type = AVMEDIA_TYPE_VIDEO,
-    .id   = AV_CODEC_ID_DPX,
-    .priv_data_size = sizeof(DPXContext),
-    .init   = encode_init,
-    .encode2 = encode_frame,
-    .close   = encode_close,
-    .pix_fmts = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_RGB24,
-        AV_PIX_FMT_RGBA,
-        AV_PIX_FMT_RGB48LE,
-        AV_PIX_FMT_RGB48BE,
-        AV_PIX_FMT_NONE},
-};
diff --git a/deps/libav/libavcodec/dsicinav.c b/deps/libav/libavcodec/dsicinav.c
deleted file mode 100644
index 6e26c74..0000000
--- a/deps/libav/libavcodec/dsicinav.c
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * Delphine Software International CIN Audio/Video Decoders
- * Copyright (c) 2006 Gregory Montoir (cyx at users.sourceforge.net)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Delphine Software International CIN audio/video decoders
- */
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "mathops.h"
-
-
-typedef enum CinVideoBitmapIndex {
-    CIN_CUR_BMP = 0, /* current */
-    CIN_PRE_BMP = 1, /* previous */
-    CIN_INT_BMP = 2  /* intermediate */
-} CinVideoBitmapIndex;
-
-typedef struct CinVideoContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-    unsigned int bitmap_size;
-    uint32_t palette[256];
-    uint8_t *bitmap_table[3];
-} CinVideoContext;
-
-typedef struct CinAudioContext {
-    int initial_decode_frame;
-    int delta;
-} CinAudioContext;
-
-
-/* table defining a geometric sequence with multiplier = 32767 ^ (1 / 128) */
-static const int16_t cinaudio_delta16_table[256] = {
-         0,      0,      0,      0,      0,      0,      0,      0,
-         0,      0,      0,      0,      0,      0,      0,      0,
-         0,      0,      0, -30210, -27853, -25680, -23677, -21829,
-    -20126, -18556, -17108, -15774, -14543, -13408, -12362, -11398,
-    -10508,  -9689,  -8933,  -8236,  -7593,  -7001,  -6455,  -5951,
-     -5487,  -5059,  -4664,  -4300,  -3964,  -3655,  -3370,  -3107,
-     -2865,  -2641,  -2435,  -2245,  -2070,  -1908,  -1759,  -1622,
-     -1495,  -1379,  -1271,  -1172,  -1080,   -996,   -918,   -847,
-      -781,   -720,   -663,   -612,   -564,   -520,   -479,   -442,
-      -407,   -376,   -346,   -319,   -294,   -271,   -250,   -230,
-      -212,   -196,   -181,   -166,   -153,   -141,   -130,   -120,
-      -111,   -102,    -94,    -87,    -80,    -74,    -68,    -62,
-       -58,    -53,    -49,    -45,    -41,    -38,    -35,    -32,
-       -30,    -27,    -25,    -23,    -21,    -20,    -18,    -17,
-       -15,    -14,    -13,    -12,    -11,    -10,     -9,     -8,
-        -7,     -6,     -5,     -4,     -3,     -2,     -1,      0,
-         0,      1,      2,      3,      4,      5,      6,      7,
-         8,      9,     10,     11,     12,     13,     14,     15,
-        17,     18,     20,     21,     23,     25,     27,     30,
-        32,     35,     38,     41,     45,     49,     53,     58,
-        62,     68,     74,     80,     87,     94,    102,    111,
-       120,    130,    141,    153,    166,    181,    196,    212,
-       230,    250,    271,    294,    319,    346,    376,    407,
-       442,    479,    520,    564,    612,    663,    720,    781,
-       847,    918,    996,   1080,   1172,   1271,   1379,   1495,
-      1622,   1759,   1908,   2070,   2245,   2435,   2641,   2865,
-      3107,   3370,   3655,   3964,   4300,   4664,   5059,   5487,
-      5951,   6455,   7001,   7593,   8236,   8933,   9689,  10508,
-     11398,  12362,  13408,  14543,  15774,  17108,  18556,  20126,
-     21829,  23677,  25680,  27853,  30210,      0,      0,      0,
-         0,      0,      0,      0,      0,      0,      0,      0,
-         0,      0,      0,      0,      0,      0,      0,      0
-};
-
-
-static av_cold int cinvideo_decode_init(AVCodecContext *avctx)
-{
-    CinVideoContext *cin = avctx->priv_data;
-    unsigned int i;
-
-    cin->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    cin->frame = av_frame_alloc();
-    if (!cin->frame)
-        return AVERROR(ENOMEM);
-
-    cin->bitmap_size = avctx->width * avctx->height;
-    for (i = 0; i < 3; ++i) {
-        cin->bitmap_table[i] = av_mallocz(cin->bitmap_size);
-        if (!cin->bitmap_table[i])
-            av_log(avctx, AV_LOG_ERROR, "Can't allocate bitmap buffers.\n");
-    }
-
-    return 0;
-}
-
-static void cin_apply_delta_data(const unsigned char *src, unsigned char *dst,
-                                 int size)
-{
-    while (size--)
-        *dst++ += *src++;
-}
-
-static int cin_decode_huffman(const unsigned char *src, int src_size,
-                              unsigned char *dst, int dst_size)
-{
-    int b, huff_code = 0;
-    unsigned char huff_code_table[15];
-    unsigned char *dst_cur       = dst;
-    unsigned char *dst_end       = dst + dst_size;
-    const unsigned char *src_end = src + src_size;
-
-    memcpy(huff_code_table, src, 15);
-    src += 15;
-
-    while (src < src_end) {
-        huff_code = *src++;
-        if ((huff_code >> 4) == 15) {
-            b          = huff_code << 4;
-            huff_code  = *src++;
-            *dst_cur++ = b | (huff_code >> 4);
-        } else
-            *dst_cur++ = huff_code_table[huff_code >> 4];
-        if (dst_cur >= dst_end)
-            break;
-
-        huff_code &= 15;
-        if (huff_code == 15) {
-            *dst_cur++ = *src++;
-        } else
-            *dst_cur++ = huff_code_table[huff_code];
-        if (dst_cur >= dst_end)
-            break;
-    }
-
-    return dst_cur - dst;
-}
-
-static int cin_decode_lzss(const unsigned char *src, int src_size,
-                           unsigned char *dst, int dst_size)
-{
-    uint16_t cmd;
-    int i, sz, offset, code;
-    unsigned char *dst_end       = dst + dst_size, *dst_start = dst;
-    const unsigned char *src_end = src + src_size;
-
-    while (src < src_end && dst < dst_end) {
-        code = *src++;
-        for (i = 0; i < 8 && src < src_end && dst < dst_end; ++i) {
-            if (code & (1 << i)) {
-                *dst++ = *src++;
-            } else {
-                cmd    = AV_RL16(src);
-                src   += 2;
-                offset = cmd >> 4;
-                if ((int)(dst - dst_start) < offset + 1)
-                    return AVERROR_INVALIDDATA;
-                sz = (cmd & 0xF) + 2;
-                /* don't use memcpy/memmove here as the decoding routine
-                 * (ab)uses buffer overlappings to repeat bytes in the
-                 * destination */
-                sz = FFMIN(sz, dst_end - dst);
-                while (sz--) {
-                    *dst = *(dst - offset - 1);
-                    ++dst;
-                }
-            }
-        }
-    }
-
-    return 0;
-}
-
-static void cin_decode_rle(const unsigned char *src, int src_size,
-                           unsigned char *dst, int dst_size)
-{
-    int len, code;
-    unsigned char *dst_end       = dst + dst_size;
-    const unsigned char *src_end = src + src_size;
-
-    while (src < src_end && dst < dst_end) {
-        code = *src++;
-        if (code & 0x80) {
-            if (src >= src_end)
-                break;
-            len = code - 0x7F;
-            memset(dst, *src++, FFMIN(len, dst_end - dst));
-        } else {
-            len = code + 1;
-            memcpy(dst, src, FFMIN3(len, dst_end - dst, src_end - src));
-            src += len;
-        }
-        dst += len;
-    }
-}
-
-static int cinvideo_decode_frame(AVCodecContext *avctx,
-                                 void *data, int *got_frame,
-                                 AVPacket *avpkt)
-{
-    const uint8_t *buf   = avpkt->data;
-    int buf_size         = avpkt->size;
-    CinVideoContext *cin = avctx->priv_data;
-    int i, y, palette_type, palette_colors_count,
-        bitmap_frame_type, bitmap_frame_size, res = 0;
-
-    palette_type         = buf[0];
-    palette_colors_count = AV_RL16(buf + 1);
-    bitmap_frame_type    = buf[3];
-    buf                 += 4;
-
-    bitmap_frame_size = buf_size - 4;
-
-    /* handle palette */
-    if (bitmap_frame_size < palette_colors_count * (3 + (palette_type != 0)))
-        return AVERROR_INVALIDDATA;
-    if (palette_type == 0) {
-        if (palette_colors_count > 256)
-            return AVERROR_INVALIDDATA;
-        for (i = 0; i < palette_colors_count; ++i) {
-            cin->palette[i]    = bytestream_get_le24(&buf);
-            bitmap_frame_size -= 3;
-        }
-    } else {
-        for (i = 0; i < palette_colors_count; ++i) {
-            cin->palette[buf[0]] = AV_RL24(buf + 1);
-            buf                 += 4;
-            bitmap_frame_size   -= 4;
-        }
-    }
-
-    bitmap_frame_size = FFMIN(cin->bitmap_size, bitmap_frame_size);
-
-    /* note: the decoding routines below assumes that
-     * surface.width = surface.pitch */
-    switch (bitmap_frame_type) {
-    case 9:
-        cin_decode_rle(buf, bitmap_frame_size,
-                       cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
-        break;
-    case 34:
-        cin_decode_rle(buf, bitmap_frame_size,
-                       cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
-        cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
-                             cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
-        break;
-    case 35:
-        cin_decode_huffman(buf, bitmap_frame_size,
-                           cin->bitmap_table[CIN_INT_BMP], cin->bitmap_size);
-        cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
-                       cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
-        break;
-    case 36:
-        bitmap_frame_size = cin_decode_huffman(buf, bitmap_frame_size,
-                                               cin->bitmap_table[CIN_INT_BMP],
-                                               cin->bitmap_size);
-        cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
-                       cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
-        cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
-                             cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
-        break;
-    case 37:
-        cin_decode_huffman(buf, bitmap_frame_size,
-                           cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
-        break;
-    case 38:
-        res = cin_decode_lzss(buf, bitmap_frame_size,
-                              cin->bitmap_table[CIN_CUR_BMP],
-                              cin->bitmap_size);
-        if (res < 0)
-            return res;
-        break;
-    case 39:
-        res = cin_decode_lzss(buf, bitmap_frame_size,
-                              cin->bitmap_table[CIN_CUR_BMP],
-                              cin->bitmap_size);
-        if (res < 0)
-            return res;
-        cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
-                             cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
-        break;
-    }
-
-    if ((res = ff_reget_buffer(avctx, cin->frame)) < 0) {
-        av_log(cin->avctx, AV_LOG_ERROR,
-               "delphinecinvideo: reget_buffer() failed to allocate a frame\n");
-        return res;
-    }
-
-    memcpy(cin->frame->data[1], cin->palette, sizeof(cin->palette));
-    cin->frame->palette_has_changed = 1;
-    for (y = 0; y < cin->avctx->height; ++y)
-        memcpy(cin->frame->data[0] + (cin->avctx->height - 1 - y) * cin->frame->linesize[0],
-               cin->bitmap_table[CIN_CUR_BMP] + y * cin->avctx->width,
-               cin->avctx->width);
-
-    FFSWAP(uint8_t *, cin->bitmap_table[CIN_CUR_BMP],
-                      cin->bitmap_table[CIN_PRE_BMP]);
-
-    if ((res = av_frame_ref(data, cin->frame)) < 0)
-        return res;
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int cinvideo_decode_end(AVCodecContext *avctx)
-{
-    CinVideoContext *cin = avctx->priv_data;
-    int i;
-
-    av_frame_free(&cin->frame);
-
-    for (i = 0; i < 3; ++i)
-        av_free(cin->bitmap_table[i]);
-
-    return 0;
-}
-
-static av_cold int cinaudio_decode_init(AVCodecContext *avctx)
-{
-    CinAudioContext *cin = avctx->priv_data;
-
-    cin->initial_decode_frame = 1;
-    cin->delta                = 0;
-    avctx->sample_fmt         = AV_SAMPLE_FMT_S16;
-    avctx->channels           = 1;
-    avctx->channel_layout     = AV_CH_LAYOUT_MONO;
-
-    return 0;
-}
-
-static int cinaudio_decode_frame(AVCodecContext *avctx, void *data,
-                                 int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame         = data;
-    const uint8_t *buf     = avpkt->data;
-    CinAudioContext *cin   = avctx->priv_data;
-    const uint8_t *buf_end = buf + avpkt->size;
-    int16_t *samples;
-    int delta, ret;
-
-    /* get output buffer */
-    frame->nb_samples = avpkt->size - cin->initial_decode_frame;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (int16_t *)frame->data[0];
-
-    delta = cin->delta;
-    if (cin->initial_decode_frame) {
-        cin->initial_decode_frame = 0;
-        delta                     = sign_extend(AV_RL16(buf), 16);
-        buf                      += 2;
-        *samples++                = delta;
-    }
-    while (buf < buf_end) {
-        delta     += cinaudio_delta16_table[*buf++];
-        delta      = av_clip_int16(delta);
-        *samples++ = delta;
-    }
-    cin->delta = delta;
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_dsicinvideo_decoder = {
-    .name           = "dsicinvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("Delphine Software International CIN video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DSICINVIDEO,
-    .priv_data_size = sizeof(CinVideoContext),
-    .init           = cinvideo_decode_init,
-    .close          = cinvideo_decode_end,
-    .decode         = cinvideo_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-AVCodec ff_dsicinaudio_decoder = {
-    .name           = "dsicinaudio",
-    .long_name      = NULL_IF_CONFIG_SMALL("Delphine Software International CIN audio"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_DSICINAUDIO,
-    .priv_data_size = sizeof(CinAudioContext),
-    .init           = cinaudio_decode_init,
-    .decode         = cinaudio_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/dsputil.c b/deps/libav/libavcodec/dsputil.c
deleted file mode 100644
index 56207e8..0000000
--- a/deps/libav/libavcodec/dsputil.c
+++ /dev/null
@@ -1,2665 +0,0 @@
-/*
- * DSP utils
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * gmc & q-pel & 32/64 bit based MC by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DSP utils
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "avcodec.h"
-#include "copy_block.h"
-#include "dct.h"
-#include "dsputil.h"
-#include "simple_idct.h"
-#include "faandct.h"
-#include "faanidct.h"
-#include "imgconvert.h"
-#include "mathops.h"
-#include "mpegvideo.h"
-#include "config.h"
-
-uint32_t ff_squareTbl[512] = {0, };
-
-#define BIT_DEPTH 16
-#include "dsputil_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 8
-#include "dsputil_template.c"
-
-// 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size
-#define pb_7f (~0UL/255 * 0x7f)
-#define pb_80 (~0UL/255 * 0x80)
-
-/* Specific zigzag scan for 248 idct. NOTE that unlike the
-   specification, we interleave the fields */
-const uint8_t ff_zigzag248_direct[64] = {
-     0,  8,  1,  9, 16, 24,  2, 10,
-    17, 25, 32, 40, 48, 56, 33, 41,
-    18, 26,  3, 11,  4, 12, 19, 27,
-    34, 42, 49, 57, 50, 58, 35, 43,
-    20, 28,  5, 13,  6, 14, 21, 29,
-    36, 44, 51, 59, 52, 60, 37, 45,
-    22, 30,  7, 15, 23, 31, 38, 46,
-    53, 61, 54, 62, 39, 47, 55, 63,
-};
-
-const uint8_t ff_alternate_horizontal_scan[64] = {
-    0,  1,   2,  3,  8,  9, 16, 17,
-    10, 11,  4,  5,  6,  7, 15, 14,
-    13, 12, 19, 18, 24, 25, 32, 33,
-    26, 27, 20, 21, 22, 23, 28, 29,
-    30, 31, 34, 35, 40, 41, 48, 49,
-    42, 43, 36, 37, 38, 39, 44, 45,
-    46, 47, 50, 51, 56, 57, 58, 59,
-    52, 53, 54, 55, 60, 61, 62, 63,
-};
-
-const uint8_t ff_alternate_vertical_scan[64] = {
-    0,  8,  16, 24,  1,  9,  2, 10,
-    17, 25, 32, 40, 48, 56, 57, 49,
-    41, 33, 26, 18,  3, 11,  4, 12,
-    19, 27, 34, 42, 50, 58, 35, 43,
-    51, 59, 20, 28,  5, 13,  6, 14,
-    21, 29, 36, 44, 52, 60, 37, 45,
-    53, 61, 22, 30,  7, 15, 23, 31,
-    38, 46, 54, 62, 39, 47, 55, 63,
-};
-
-/* Input permutation for the simple_idct_mmx */
-static const uint8_t simple_mmx_permutation[64]={
-        0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
-        0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
-        0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
-        0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
-        0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
-        0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
-        0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
-        0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
-};
-
-static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7};
-
-av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st,
-                               const uint8_t *src_scantable)
-{
-    int i;
-    int end;
-
-    st->scantable= src_scantable;
-
-    for(i=0; i<64; i++){
-        int j;
-        j = src_scantable[i];
-        st->permutated[i] = permutation[j];
-    }
-
-    end=-1;
-    for(i=0; i<64; i++){
-        int j;
-        j = st->permutated[i];
-        if(j>end) end=j;
-        st->raster_end[i]= end;
-    }
-}
-
-av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation,
-                                           int idct_permutation_type)
-{
-    int i;
-
-    switch(idct_permutation_type){
-    case FF_NO_IDCT_PERM:
-        for(i=0; i<64; i++)
-            idct_permutation[i]= i;
-        break;
-    case FF_LIBMPEG2_IDCT_PERM:
-        for(i=0; i<64; i++)
-            idct_permutation[i]= (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
-        break;
-    case FF_SIMPLE_IDCT_PERM:
-        for(i=0; i<64; i++)
-            idct_permutation[i]= simple_mmx_permutation[i];
-        break;
-    case FF_TRANSPOSE_IDCT_PERM:
-        for(i=0; i<64; i++)
-            idct_permutation[i]= ((i&7)<<3) | (i>>3);
-        break;
-    case FF_PARTTRANS_IDCT_PERM:
-        for(i=0; i<64; i++)
-            idct_permutation[i]= (i&0x24) | ((i&3)<<3) | ((i>>3)&3);
-        break;
-    case FF_SSE2_IDCT_PERM:
-        for(i=0; i<64; i++)
-            idct_permutation[i]= (i&0x38) | idct_sse2_row_perm[i&7];
-        break;
-    default:
-        av_log(NULL, AV_LOG_ERROR, "Internal error, IDCT permutation not set\n");
-    }
-}
-
-static int pix_sum_c(uint8_t * pix, int line_size)
-{
-    int s, i, j;
-
-    s = 0;
-    for (i = 0; i < 16; i++) {
-        for (j = 0; j < 16; j += 8) {
-            s += pix[0];
-            s += pix[1];
-            s += pix[2];
-            s += pix[3];
-            s += pix[4];
-            s += pix[5];
-            s += pix[6];
-            s += pix[7];
-            pix += 8;
-        }
-        pix += line_size - 16;
-    }
-    return s;
-}
-
-static int pix_norm1_c(uint8_t * pix, int line_size)
-{
-    int s, i, j;
-    uint32_t *sq = ff_squareTbl + 256;
-
-    s = 0;
-    for (i = 0; i < 16; i++) {
-        for (j = 0; j < 16; j += 8) {
-#if 0
-            s += sq[pix[0]];
-            s += sq[pix[1]];
-            s += sq[pix[2]];
-            s += sq[pix[3]];
-            s += sq[pix[4]];
-            s += sq[pix[5]];
-            s += sq[pix[6]];
-            s += sq[pix[7]];
-#else
-#if HAVE_FAST_64BIT
-            register uint64_t x=*(uint64_t*)pix;
-            s += sq[x&0xff];
-            s += sq[(x>>8)&0xff];
-            s += sq[(x>>16)&0xff];
-            s += sq[(x>>24)&0xff];
-            s += sq[(x>>32)&0xff];
-            s += sq[(x>>40)&0xff];
-            s += sq[(x>>48)&0xff];
-            s += sq[(x>>56)&0xff];
-#else
-            register uint32_t x=*(uint32_t*)pix;
-            s += sq[x&0xff];
-            s += sq[(x>>8)&0xff];
-            s += sq[(x>>16)&0xff];
-            s += sq[(x>>24)&0xff];
-            x=*(uint32_t*)(pix+4);
-            s += sq[x&0xff];
-            s += sq[(x>>8)&0xff];
-            s += sq[(x>>16)&0xff];
-            s += sq[(x>>24)&0xff];
-#endif
-#endif
-            pix += 8;
-        }
-        pix += line_size - 16;
-    }
-    return s;
-}
-
-static void bswap_buf(uint32_t *dst, const uint32_t *src, int w){
-    int i;
-
-    for(i=0; i+8<=w; i+=8){
-        dst[i+0]= av_bswap32(src[i+0]);
-        dst[i+1]= av_bswap32(src[i+1]);
-        dst[i+2]= av_bswap32(src[i+2]);
-        dst[i+3]= av_bswap32(src[i+3]);
-        dst[i+4]= av_bswap32(src[i+4]);
-        dst[i+5]= av_bswap32(src[i+5]);
-        dst[i+6]= av_bswap32(src[i+6]);
-        dst[i+7]= av_bswap32(src[i+7]);
-    }
-    for(;i<w; i++){
-        dst[i+0]= av_bswap32(src[i+0]);
-    }
-}
-
-static void bswap16_buf(uint16_t *dst, const uint16_t *src, int len)
-{
-    while (len--)
-        *dst++ = av_bswap16(*src++);
-}
-
-static int sse4_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h)
-{
-    int s, i;
-    uint32_t *sq = ff_squareTbl + 256;
-
-    s = 0;
-    for (i = 0; i < h; i++) {
-        s += sq[pix1[0] - pix2[0]];
-        s += sq[pix1[1] - pix2[1]];
-        s += sq[pix1[2] - pix2[2]];
-        s += sq[pix1[3] - pix2[3]];
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-    return s;
-}
-
-static int sse8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h)
-{
-    int s, i;
-    uint32_t *sq = ff_squareTbl + 256;
-
-    s = 0;
-    for (i = 0; i < h; i++) {
-        s += sq[pix1[0] - pix2[0]];
-        s += sq[pix1[1] - pix2[1]];
-        s += sq[pix1[2] - pix2[2]];
-        s += sq[pix1[3] - pix2[3]];
-        s += sq[pix1[4] - pix2[4]];
-        s += sq[pix1[5] - pix2[5]];
-        s += sq[pix1[6] - pix2[6]];
-        s += sq[pix1[7] - pix2[7]];
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-    return s;
-}
-
-static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int s, i;
-    uint32_t *sq = ff_squareTbl + 256;
-
-    s = 0;
-    for (i = 0; i < h; i++) {
-        s += sq[pix1[ 0] - pix2[ 0]];
-        s += sq[pix1[ 1] - pix2[ 1]];
-        s += sq[pix1[ 2] - pix2[ 2]];
-        s += sq[pix1[ 3] - pix2[ 3]];
-        s += sq[pix1[ 4] - pix2[ 4]];
-        s += sq[pix1[ 5] - pix2[ 5]];
-        s += sq[pix1[ 6] - pix2[ 6]];
-        s += sq[pix1[ 7] - pix2[ 7]];
-        s += sq[pix1[ 8] - pix2[ 8]];
-        s += sq[pix1[ 9] - pix2[ 9]];
-        s += sq[pix1[10] - pix2[10]];
-        s += sq[pix1[11] - pix2[11]];
-        s += sq[pix1[12] - pix2[12]];
-        s += sq[pix1[13] - pix2[13]];
-        s += sq[pix1[14] - pix2[14]];
-        s += sq[pix1[15] - pix2[15]];
-
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-    return s;
-}
-
-static void diff_pixels_c(int16_t *restrict block, const uint8_t *s1,
-                          const uint8_t *s2, int stride){
-    int i;
-
-    /* read the pixels */
-    for(i=0;i<8;i++) {
-        block[0] = s1[0] - s2[0];
-        block[1] = s1[1] - s2[1];
-        block[2] = s1[2] - s2[2];
-        block[3] = s1[3] - s2[3];
-        block[4] = s1[4] - s2[4];
-        block[5] = s1[5] - s2[5];
-        block[6] = s1[6] - s2[6];
-        block[7] = s1[7] - s2[7];
-        s1 += stride;
-        s2 += stride;
-        block += 8;
-    }
-}
-
-
-static void put_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels,
-                                 int line_size)
-{
-    int i;
-
-    /* read the pixels */
-    for(i=0;i<8;i++) {
-        pixels[0] = av_clip_uint8(block[0]);
-        pixels[1] = av_clip_uint8(block[1]);
-        pixels[2] = av_clip_uint8(block[2]);
-        pixels[3] = av_clip_uint8(block[3]);
-        pixels[4] = av_clip_uint8(block[4]);
-        pixels[5] = av_clip_uint8(block[5]);
-        pixels[6] = av_clip_uint8(block[6]);
-        pixels[7] = av_clip_uint8(block[7]);
-
-        pixels += line_size;
-        block += 8;
-    }
-}
-
-static void put_signed_pixels_clamped_c(const int16_t *block,
-                                        uint8_t *restrict pixels,
-                                        int line_size)
-{
-    int i, j;
-
-    for (i = 0; i < 8; i++) {
-        for (j = 0; j < 8; j++) {
-            if (*block < -128)
-                *pixels = 0;
-            else if (*block > 127)
-                *pixels = 255;
-            else
-                *pixels = (uint8_t)(*block + 128);
-            block++;
-            pixels++;
-        }
-        pixels += (line_size - 8);
-    }
-}
-
-static void add_pixels8_c(uint8_t *restrict pixels,
-                          int16_t *block,
-                          int line_size)
-{
-    int i;
-
-    for(i=0;i<8;i++) {
-        pixels[0] += block[0];
-        pixels[1] += block[1];
-        pixels[2] += block[2];
-        pixels[3] += block[3];
-        pixels[4] += block[4];
-        pixels[5] += block[5];
-        pixels[6] += block[6];
-        pixels[7] += block[7];
-        pixels += line_size;
-        block += 8;
-    }
-}
-
-static void add_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels,
-                                 int line_size)
-{
-    int i;
-
-    /* read the pixels */
-    for(i=0;i<8;i++) {
-        pixels[0] = av_clip_uint8(pixels[0] + block[0]);
-        pixels[1] = av_clip_uint8(pixels[1] + block[1]);
-        pixels[2] = av_clip_uint8(pixels[2] + block[2]);
-        pixels[3] = av_clip_uint8(pixels[3] + block[3]);
-        pixels[4] = av_clip_uint8(pixels[4] + block[4]);
-        pixels[5] = av_clip_uint8(pixels[5] + block[5]);
-        pixels[6] = av_clip_uint8(pixels[6] + block[6]);
-        pixels[7] = av_clip_uint8(pixels[7] + block[7]);
-        pixels += line_size;
-        block += 8;
-    }
-}
-
-static int sum_abs_dctelem_c(int16_t *block)
-{
-    int sum=0, i;
-    for(i=0; i<64; i++)
-        sum+= FFABS(block[i]);
-    return sum;
-}
-
-static void fill_block16_c(uint8_t *block, uint8_t value, int line_size, int h)
-{
-    int i;
-
-    for (i = 0; i < h; i++) {
-        memset(block, value, 16);
-        block += line_size;
-    }
-}
-
-static void fill_block8_c(uint8_t *block, uint8_t value, int line_size, int h)
-{
-    int i;
-
-    for (i = 0; i < h; i++) {
-        memset(block, value, 8);
-        block += line_size;
-    }
-}
-
-#define avg2(a,b) ((a+b+1)>>1)
-#define avg4(a,b,c,d) ((a+b+c+d+2)>>2)
-
-static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h, int x16, int y16, int rounder)
-{
-    const int A=(16-x16)*(16-y16);
-    const int B=(   x16)*(16-y16);
-    const int C=(16-x16)*(   y16);
-    const int D=(   x16)*(   y16);
-    int i;
-
-    for(i=0; i<h; i++)
-    {
-        dst[0]= (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + rounder)>>8;
-        dst[1]= (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + rounder)>>8;
-        dst[2]= (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + rounder)>>8;
-        dst[3]= (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + rounder)>>8;
-        dst[4]= (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + rounder)>>8;
-        dst[5]= (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + rounder)>>8;
-        dst[6]= (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + rounder)>>8;
-        dst[7]= (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + rounder)>>8;
-        dst+= stride;
-        src+= stride;
-    }
-}
-
-void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
-                  int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height)
-{
-    int y, vx, vy;
-    const int s= 1<<shift;
-
-    width--;
-    height--;
-
-    for(y=0; y<h; y++){
-        int x;
-
-        vx= ox;
-        vy= oy;
-        for(x=0; x<8; x++){ //XXX FIXME optimize
-            int src_x, src_y, frac_x, frac_y, index;
-
-            src_x= vx>>16;
-            src_y= vy>>16;
-            frac_x= src_x&(s-1);
-            frac_y= src_y&(s-1);
-            src_x>>=shift;
-            src_y>>=shift;
-
-            if((unsigned)src_x < width){
-                if((unsigned)src_y < height){
-                    index= src_x + src_y*stride;
-                    dst[y*stride + x]= (  (  src[index         ]*(s-frac_x)
-                                           + src[index       +1]*   frac_x )*(s-frac_y)
-                                        + (  src[index+stride  ]*(s-frac_x)
-                                           + src[index+stride+1]*   frac_x )*   frac_y
-                                        + r)>>(shift*2);
-                }else{
-                    index= src_x + av_clip(src_y, 0, height)*stride;
-                    dst[y*stride + x]= ( (  src[index         ]*(s-frac_x)
-                                          + src[index       +1]*   frac_x )*s
-                                        + r)>>(shift*2);
-                }
-            }else{
-                if((unsigned)src_y < height){
-                    index= av_clip(src_x, 0, width) + src_y*stride;
-                    dst[y*stride + x]= (  (  src[index         ]*(s-frac_y)
-                                           + src[index+stride  ]*   frac_y )*s
-                                        + r)>>(shift*2);
-                }else{
-                    index= av_clip(src_x, 0, width) + av_clip(src_y, 0, height)*stride;
-                    dst[y*stride + x]=    src[index         ];
-                }
-            }
-
-            vx+= dxx;
-            vy+= dyx;
-        }
-        ox += dxy;
-        oy += dyy;
-    }
-}
-
-static inline void put_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    switch(width){
-    case 2: put_pixels2_8_c (dst, src, stride, height); break;
-    case 4: put_pixels4_8_c (dst, src, stride, height); break;
-    case 8: put_pixels8_8_c (dst, src, stride, height); break;
-    case 16:put_pixels16_8_c(dst, src, stride, height); break;
-    }
-}
-
-static inline void put_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (683*(2*src[j] + src[j+1] + 1)) >> 11;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void put_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (683*(src[j] + 2*src[j+1] + 1)) >> 11;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void put_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (683*(2*src[j] + src[j+stride] + 1)) >> 11;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void put_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (2731*(4*src[j] + 3*src[j+1] + 3*src[j+stride] + 2*src[j+stride+1] + 6)) >> 15;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void put_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void put_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (683*(src[j] + 2*src[j+stride] + 1)) >> 11;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void put_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void put_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (2731*(2*src[j] + 3*src[j+1] + 3*src[j+stride] + 4*src[j+stride+1] + 6)) >> 15;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void avg_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    switch(width){
-    case 2: avg_pixels2_8_c (dst, src, stride, height); break;
-    case 4: avg_pixels4_8_c (dst, src, stride, height); break;
-    case 8: avg_pixels8_8_c (dst, src, stride, height); break;
-    case 16:avg_pixels16_8_c(dst, src, stride, height); break;
-    }
-}
-
-static inline void avg_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (dst[j] + ((683*(2*src[j] + src[j+1] + 1)) >> 11) + 1) >> 1;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void avg_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (dst[j] + ((683*(src[j] + 2*src[j+1] + 1)) >> 11) + 1) >> 1;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void avg_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (dst[j] + ((683*(2*src[j] + src[j+stride] + 1)) >> 11) + 1) >> 1;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void avg_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (dst[j] + ((2731*(4*src[j] + 3*src[j+1] + 3*src[j+stride] + 2*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void avg_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (dst[j] + ((2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void avg_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (dst[j] + ((683*(src[j] + 2*src[j+stride] + 1)) >> 11) + 1) >> 1;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void avg_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (dst[j] + ((2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-static inline void avg_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
-    int i,j;
-    for (i=0; i < height; i++) {
-      for (j=0; j < width; j++) {
-        dst[j] = (dst[j] + ((2731*(2*src[j] + 3*src[j+1] + 3*src[j+stride] + 4*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
-      }
-      src += stride;
-      dst += stride;
-    }
-}
-
-#define QPEL_MC(r, OPNAME, RND, OP) \
-static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    for(i=0; i<h; i++)\
-    {\
-        OP(dst[0], (src[0]+src[1])*20 - (src[0]+src[2])*6 + (src[1]+src[3])*3 - (src[2]+src[4]));\
-        OP(dst[1], (src[1]+src[2])*20 - (src[0]+src[3])*6 + (src[0]+src[4])*3 - (src[1]+src[5]));\
-        OP(dst[2], (src[2]+src[3])*20 - (src[1]+src[4])*6 + (src[0]+src[5])*3 - (src[0]+src[6]));\
-        OP(dst[3], (src[3]+src[4])*20 - (src[2]+src[5])*6 + (src[1]+src[6])*3 - (src[0]+src[7]));\
-        OP(dst[4], (src[4]+src[5])*20 - (src[3]+src[6])*6 + (src[2]+src[7])*3 - (src[1]+src[8]));\
-        OP(dst[5], (src[5]+src[6])*20 - (src[4]+src[7])*6 + (src[3]+src[8])*3 - (src[2]+src[8]));\
-        OP(dst[6], (src[6]+src[7])*20 - (src[5]+src[8])*6 + (src[4]+src[8])*3 - (src[3]+src[7]));\
-        OP(dst[7], (src[7]+src[8])*20 - (src[6]+src[8])*6 + (src[5]+src[7])*3 - (src[4]+src[6]));\
-        dst+=dstStride;\
-        src+=srcStride;\
-    }\
-}\
-\
-static void OPNAME ## mpeg4_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    const int w=8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    for(i=0; i<w; i++)\
-    {\
-        const int src0= src[0*srcStride];\
-        const int src1= src[1*srcStride];\
-        const int src2= src[2*srcStride];\
-        const int src3= src[3*srcStride];\
-        const int src4= src[4*srcStride];\
-        const int src5= src[5*srcStride];\
-        const int src6= src[6*srcStride];\
-        const int src7= src[7*srcStride];\
-        const int src8= src[8*srcStride];\
-        OP(dst[0*dstStride], (src0+src1)*20 - (src0+src2)*6 + (src1+src3)*3 - (src2+src4));\
-        OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*6 + (src0+src4)*3 - (src1+src5));\
-        OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*6 + (src0+src5)*3 - (src0+src6));\
-        OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*6 + (src1+src6)*3 - (src0+src7));\
-        OP(dst[4*dstStride], (src4+src5)*20 - (src3+src6)*6 + (src2+src7)*3 - (src1+src8));\
-        OP(dst[5*dstStride], (src5+src6)*20 - (src4+src7)*6 + (src3+src8)*3 - (src2+src8));\
-        OP(dst[6*dstStride], (src6+src7)*20 - (src5+src8)*6 + (src4+src8)*3 - (src3+src7));\
-        OP(dst[7*dstStride], (src7+src8)*20 - (src6+src8)*6 + (src5+src7)*3 - (src4+src6));\
-        dst++;\
-        src++;\
-    }\
-}\
-\
-static void OPNAME ## mpeg4_qpel16_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    \
-    for(i=0; i<h; i++)\
-    {\
-        OP(dst[ 0], (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]));\
-        OP(dst[ 1], (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]));\
-        OP(dst[ 2], (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]));\
-        OP(dst[ 3], (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]));\
-        OP(dst[ 4], (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]));\
-        OP(dst[ 5], (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 9]));\
-        OP(dst[ 6], (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 9])*3 - (src[ 3]+src[10]));\
-        OP(dst[ 7], (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 9])*6 + (src[ 5]+src[10])*3 - (src[ 4]+src[11]));\
-        OP(dst[ 8], (src[ 8]+src[ 9])*20 - (src[ 7]+src[10])*6 + (src[ 6]+src[11])*3 - (src[ 5]+src[12]));\
-        OP(dst[ 9], (src[ 9]+src[10])*20 - (src[ 8]+src[11])*6 + (src[ 7]+src[12])*3 - (src[ 6]+src[13]));\
-        OP(dst[10], (src[10]+src[11])*20 - (src[ 9]+src[12])*6 + (src[ 8]+src[13])*3 - (src[ 7]+src[14]));\
-        OP(dst[11], (src[11]+src[12])*20 - (src[10]+src[13])*6 + (src[ 9]+src[14])*3 - (src[ 8]+src[15]));\
-        OP(dst[12], (src[12]+src[13])*20 - (src[11]+src[14])*6 + (src[10]+src[15])*3 - (src[ 9]+src[16]));\
-        OP(dst[13], (src[13]+src[14])*20 - (src[12]+src[15])*6 + (src[11]+src[16])*3 - (src[10]+src[16]));\
-        OP(dst[14], (src[14]+src[15])*20 - (src[13]+src[16])*6 + (src[12]+src[16])*3 - (src[11]+src[15]));\
-        OP(dst[15], (src[15]+src[16])*20 - (src[14]+src[16])*6 + (src[13]+src[15])*3 - (src[12]+src[14]));\
-        dst+=dstStride;\
-        src+=srcStride;\
-    }\
-}\
-\
-static void OPNAME ## mpeg4_qpel16_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    const int w=16;\
-    for(i=0; i<w; i++)\
-    {\
-        const int src0= src[0*srcStride];\
-        const int src1= src[1*srcStride];\
-        const int src2= src[2*srcStride];\
-        const int src3= src[3*srcStride];\
-        const int src4= src[4*srcStride];\
-        const int src5= src[5*srcStride];\
-        const int src6= src[6*srcStride];\
-        const int src7= src[7*srcStride];\
-        const int src8= src[8*srcStride];\
-        const int src9= src[9*srcStride];\
-        const int src10= src[10*srcStride];\
-        const int src11= src[11*srcStride];\
-        const int src12= src[12*srcStride];\
-        const int src13= src[13*srcStride];\
-        const int src14= src[14*srcStride];\
-        const int src15= src[15*srcStride];\
-        const int src16= src[16*srcStride];\
-        OP(dst[ 0*dstStride], (src0 +src1 )*20 - (src0 +src2 )*6 + (src1 +src3 )*3 - (src2 +src4 ));\
-        OP(dst[ 1*dstStride], (src1 +src2 )*20 - (src0 +src3 )*6 + (src0 +src4 )*3 - (src1 +src5 ));\
-        OP(dst[ 2*dstStride], (src2 +src3 )*20 - (src1 +src4 )*6 + (src0 +src5 )*3 - (src0 +src6 ));\
-        OP(dst[ 3*dstStride], (src3 +src4 )*20 - (src2 +src5 )*6 + (src1 +src6 )*3 - (src0 +src7 ));\
-        OP(dst[ 4*dstStride], (src4 +src5 )*20 - (src3 +src6 )*6 + (src2 +src7 )*3 - (src1 +src8 ));\
-        OP(dst[ 5*dstStride], (src5 +src6 )*20 - (src4 +src7 )*6 + (src3 +src8 )*3 - (src2 +src9 ));\
-        OP(dst[ 6*dstStride], (src6 +src7 )*20 - (src5 +src8 )*6 + (src4 +src9 )*3 - (src3 +src10));\
-        OP(dst[ 7*dstStride], (src7 +src8 )*20 - (src6 +src9 )*6 + (src5 +src10)*3 - (src4 +src11));\
-        OP(dst[ 8*dstStride], (src8 +src9 )*20 - (src7 +src10)*6 + (src6 +src11)*3 - (src5 +src12));\
-        OP(dst[ 9*dstStride], (src9 +src10)*20 - (src8 +src11)*6 + (src7 +src12)*3 - (src6 +src13));\
-        OP(dst[10*dstStride], (src10+src11)*20 - (src9 +src12)*6 + (src8 +src13)*3 - (src7 +src14));\
-        OP(dst[11*dstStride], (src11+src12)*20 - (src10+src13)*6 + (src9 +src14)*3 - (src8 +src15));\
-        OP(dst[12*dstStride], (src12+src13)*20 - (src11+src14)*6 + (src10+src15)*3 - (src9 +src16));\
-        OP(dst[13*dstStride], (src13+src14)*20 - (src12+src15)*6 + (src11+src16)*3 - (src10+src16));\
-        OP(dst[14*dstStride], (src14+src15)*20 - (src13+src16)*6 + (src12+src16)*3 - (src11+src15));\
-        OP(dst[15*dstStride], (src15+src16)*20 - (src14+src16)*6 + (src13+src15)*3 - (src12+src14));\
-        dst++;\
-        src++;\
-    }\
-}\
-\
-static void OPNAME ## qpel8_mc10_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t half[64];\
-    put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
-    OPNAME ## pixels8_l2_8(dst, src, half, stride, stride, 8, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc20_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc30_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t half[64];\
-    put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
-    OPNAME ## pixels8_l2_8(dst, src+1, half, stride, stride, 8, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc01_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t half[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
-    OPNAME ## pixels8_l2_8(dst, full, half, stride, 16, 8, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc02_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    copy_block9(full, src, 16, stride, 9);\
-    OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16);\
-}\
-\
-static void OPNAME ## qpel8_mc03_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t half[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
-    OPNAME ## pixels8_l2_8(dst, full+16, half, stride, 16, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfV[64];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l4_8(dst, full, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc11_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfV[64];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l4_8(dst, full+1, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc31_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## pixels8_l2_8(halfH, halfH, full+1, 8, 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfV[64];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l4_8(dst, full+16, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc13_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l2_8(dst, halfH+8, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfV[64];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full  , 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l4_8(dst, full+17, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## pixels8_l2_8(halfH, halfH, full+1, 8, 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l2_8(dst, halfH+8, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc21_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t halfH[72];\
-    uint8_t halfHV[64];\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l2_8(dst, halfH, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc23_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t halfH[72];\
-    uint8_t halfHV[64];\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l2_8(dst, halfH+8, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfV[64];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc12_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## pixels8_l2_8(halfH, halfH, full, 8, 8, 16, 9);\
-    OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    uint8_t halfV[64];\
-    uint8_t halfHV[64];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
-    put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
-    OPNAME ## pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc32_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[16*9];\
-    uint8_t halfH[72];\
-    copy_block9(full, src, 16, stride, 9);\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
-    put ## RND ## pixels8_l2_8(halfH, halfH, full+1, 8, 8, 16, 9);\
-    OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
-}\
-static void OPNAME ## qpel8_mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t halfH[72];\
-    put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
-    OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
-}\
-\
-static void OPNAME ## qpel16_mc10_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t half[256];\
-    put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
-    OPNAME ## pixels16_l2_8(dst, src, half, stride, stride, 16, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc20_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc30_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t half[256];\
-    put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
-    OPNAME ## pixels16_l2_8(dst, src+1, half, stride, stride, 16, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc01_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t half[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
-    OPNAME ## pixels16_l2_8(dst, full, half, stride, 24, 16, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc02_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    copy_block17(full, src, 24, stride, 17);\
-    OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24);\
-}\
-\
-static void OPNAME ## qpel16_mc03_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t half[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
-    OPNAME ## pixels16_l2_8(dst, full+24, half, stride, 24, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfV[256];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l4_8(dst, full, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc11_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfV[256];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l4_8(dst, full+1, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc31_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## pixels16_l2_8(halfH, halfH, full+1, 16, 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfV[256];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l4_8(dst, full+24, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc13_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l2_8(dst, halfH+16, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfV[256];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full  , 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l4_8(dst, full+25, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## pixels16_l2_8(halfH, halfH, full+1, 16, 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l2_8(dst, halfH+16, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc21_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t halfH[272];\
-    uint8_t halfHV[256];\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l2_8(dst, halfH, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc23_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t halfH[272];\
-    uint8_t halfHV[256];\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l2_8(dst, halfH+16, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfV[256];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc12_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## pixels16_l2_8(halfH, halfH, full, 16, 16, 24, 17);\
-    OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    uint8_t halfV[256];\
-    uint8_t halfHV[256];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
-    put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
-    OPNAME ## pixels16_l2_8(dst, halfV, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc32_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[24*17];\
-    uint8_t halfH[272];\
-    copy_block17(full, src, 24, stride, 17);\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
-    put ## RND ## pixels16_l2_8(halfH, halfH, full+1, 16, 16, 24, 17);\
-    OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
-}\
-static void OPNAME ## qpel16_mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t halfH[272];\
-    put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
-    OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
-}
-
-#define op_avg(a, b) a = (((a)+cm[((b) + 16)>>5]+1)>>1)
-#define op_avg_no_rnd(a, b) a = (((a)+cm[((b) + 15)>>5])>>1)
-#define op_put(a, b) a = cm[((b) + 16)>>5]
-#define op_put_no_rnd(a, b) a = cm[((b) + 15)>>5]
-
-QPEL_MC(0, put_       , _       , op_put)
-QPEL_MC(1, put_no_rnd_, _no_rnd_, op_put_no_rnd)
-QPEL_MC(0, avg_       , _       , op_avg)
-//QPEL_MC(1, avg_no_rnd , _       , op_avg)
-#undef op_avg
-#undef op_avg_no_rnd
-#undef op_put
-#undef op_put_no_rnd
-
-void ff_put_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    put_pixels8_8_c(dst, src, stride, 8);
-}
-void ff_avg_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    avg_pixels8_8_c(dst, src, stride, 8);
-}
-void ff_put_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    put_pixels16_8_c(dst, src, stride, 16);
-}
-void ff_avg_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    avg_pixels16_8_c(dst, src, stride, 16);
-}
-
-#define put_qpel8_mc00_c  ff_put_pixels8x8_c
-#define avg_qpel8_mc00_c  ff_avg_pixels8x8_c
-#define put_qpel16_mc00_c ff_put_pixels16x16_c
-#define avg_qpel16_mc00_c ff_avg_pixels16x16_c
-#define put_no_rnd_qpel8_mc00_c  ff_put_pixels8x8_c
-#define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_c
-
-static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    int i;
-
-    for(i=0; i<h; i++){
-        dst[0]= cm[(9*(src[0] + src[1]) - (src[-1] + src[2]) + 8)>>4];
-        dst[1]= cm[(9*(src[1] + src[2]) - (src[ 0] + src[3]) + 8)>>4];
-        dst[2]= cm[(9*(src[2] + src[3]) - (src[ 1] + src[4]) + 8)>>4];
-        dst[3]= cm[(9*(src[3] + src[4]) - (src[ 2] + src[5]) + 8)>>4];
-        dst[4]= cm[(9*(src[4] + src[5]) - (src[ 3] + src[6]) + 8)>>4];
-        dst[5]= cm[(9*(src[5] + src[6]) - (src[ 4] + src[7]) + 8)>>4];
-        dst[6]= cm[(9*(src[6] + src[7]) - (src[ 5] + src[8]) + 8)>>4];
-        dst[7]= cm[(9*(src[7] + src[8]) - (src[ 6] + src[9]) + 8)>>4];
-        dst+=dstStride;
-        src+=srcStride;
-    }
-}
-
-#if CONFIG_RV40_DECODER
-void ff_put_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    put_pixels16_xy2_8_c(dst, src, stride, 16);
-}
-void ff_avg_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    avg_pixels16_xy2_8_c(dst, src, stride, 16);
-}
-void ff_put_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    put_pixels8_xy2_8_c(dst, src, stride, 8);
-}
-void ff_avg_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    avg_pixels8_xy2_8_c(dst, src, stride, 8);
-}
-#endif /* CONFIG_RV40_DECODER */
-
-static void wmv2_mspel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int w){
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    int i;
-
-    for(i=0; i<w; i++){
-        const int src_1= src[ -srcStride];
-        const int src0 = src[0          ];
-        const int src1 = src[  srcStride];
-        const int src2 = src[2*srcStride];
-        const int src3 = src[3*srcStride];
-        const int src4 = src[4*srcStride];
-        const int src5 = src[5*srcStride];
-        const int src6 = src[6*srcStride];
-        const int src7 = src[7*srcStride];
-        const int src8 = src[8*srcStride];
-        const int src9 = src[9*srcStride];
-        dst[0*dstStride]= cm[(9*(src0 + src1) - (src_1 + src2) + 8)>>4];
-        dst[1*dstStride]= cm[(9*(src1 + src2) - (src0  + src3) + 8)>>4];
-        dst[2*dstStride]= cm[(9*(src2 + src3) - (src1  + src4) + 8)>>4];
-        dst[3*dstStride]= cm[(9*(src3 + src4) - (src2  + src5) + 8)>>4];
-        dst[4*dstStride]= cm[(9*(src4 + src5) - (src3  + src6) + 8)>>4];
-        dst[5*dstStride]= cm[(9*(src5 + src6) - (src4  + src7) + 8)>>4];
-        dst[6*dstStride]= cm[(9*(src6 + src7) - (src5  + src8) + 8)>>4];
-        dst[7*dstStride]= cm[(9*(src7 + src8) - (src6  + src9) + 8)>>4];
-        src++;
-        dst++;
-    }
-}
-
-static void put_mspel8_mc10_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    uint8_t half[64];
-    wmv2_mspel8_h_lowpass(half, src, 8, stride, 8);
-    put_pixels8_l2_8(dst, src, half, stride, stride, 8, 8);
-}
-
-static void put_mspel8_mc20_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    wmv2_mspel8_h_lowpass(dst, src, stride, stride, 8);
-}
-
-static void put_mspel8_mc30_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    uint8_t half[64];
-    wmv2_mspel8_h_lowpass(half, src, 8, stride, 8);
-    put_pixels8_l2_8(dst, src+1, half, stride, stride, 8, 8);
-}
-
-static void put_mspel8_mc02_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    wmv2_mspel8_v_lowpass(dst, src, stride, stride, 8);
-}
-
-static void put_mspel8_mc12_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    uint8_t halfH[88];
-    uint8_t halfV[64];
-    uint8_t halfHV[64];
-    wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
-    wmv2_mspel8_v_lowpass(halfV, src, 8, stride, 8);
-    wmv2_mspel8_v_lowpass(halfHV, halfH+8, 8, 8, 8);
-    put_pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8);
-}
-static void put_mspel8_mc32_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    uint8_t halfH[88];
-    uint8_t halfV[64];
-    uint8_t halfHV[64];
-    wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
-    wmv2_mspel8_v_lowpass(halfV, src+1, 8, stride, 8);
-    wmv2_mspel8_v_lowpass(halfHV, halfH+8, 8, 8, 8);
-    put_pixels8_l2_8(dst, halfV, halfHV, stride, 8, 8, 8);
-}
-static void put_mspel8_mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
-{
-    uint8_t halfH[88];
-    wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
-    wmv2_mspel8_v_lowpass(dst, halfH+8, stride, 8, 8);
-}
-
-static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int s, i;
-
-    s = 0;
-    for(i=0;i<h;i++) {
-        s += abs(pix1[0] - pix2[0]);
-        s += abs(pix1[1] - pix2[1]);
-        s += abs(pix1[2] - pix2[2]);
-        s += abs(pix1[3] - pix2[3]);
-        s += abs(pix1[4] - pix2[4]);
-        s += abs(pix1[5] - pix2[5]);
-        s += abs(pix1[6] - pix2[6]);
-        s += abs(pix1[7] - pix2[7]);
-        s += abs(pix1[8] - pix2[8]);
-        s += abs(pix1[9] - pix2[9]);
-        s += abs(pix1[10] - pix2[10]);
-        s += abs(pix1[11] - pix2[11]);
-        s += abs(pix1[12] - pix2[12]);
-        s += abs(pix1[13] - pix2[13]);
-        s += abs(pix1[14] - pix2[14]);
-        s += abs(pix1[15] - pix2[15]);
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-    return s;
-}
-
-static int pix_abs16_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int s, i;
-
-    s = 0;
-    for(i=0;i<h;i++) {
-        s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
-        s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
-        s += abs(pix1[2] - avg2(pix2[2], pix2[3]));
-        s += abs(pix1[3] - avg2(pix2[3], pix2[4]));
-        s += abs(pix1[4] - avg2(pix2[4], pix2[5]));
-        s += abs(pix1[5] - avg2(pix2[5], pix2[6]));
-        s += abs(pix1[6] - avg2(pix2[6], pix2[7]));
-        s += abs(pix1[7] - avg2(pix2[7], pix2[8]));
-        s += abs(pix1[8] - avg2(pix2[8], pix2[9]));
-        s += abs(pix1[9] - avg2(pix2[9], pix2[10]));
-        s += abs(pix1[10] - avg2(pix2[10], pix2[11]));
-        s += abs(pix1[11] - avg2(pix2[11], pix2[12]));
-        s += abs(pix1[12] - avg2(pix2[12], pix2[13]));
-        s += abs(pix1[13] - avg2(pix2[13], pix2[14]));
-        s += abs(pix1[14] - avg2(pix2[14], pix2[15]));
-        s += abs(pix1[15] - avg2(pix2[15], pix2[16]));
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-    return s;
-}
-
-static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int s, i;
-    uint8_t *pix3 = pix2 + line_size;
-
-    s = 0;
-    for(i=0;i<h;i++) {
-        s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
-        s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
-        s += abs(pix1[2] - avg2(pix2[2], pix3[2]));
-        s += abs(pix1[3] - avg2(pix2[3], pix3[3]));
-        s += abs(pix1[4] - avg2(pix2[4], pix3[4]));
-        s += abs(pix1[5] - avg2(pix2[5], pix3[5]));
-        s += abs(pix1[6] - avg2(pix2[6], pix3[6]));
-        s += abs(pix1[7] - avg2(pix2[7], pix3[7]));
-        s += abs(pix1[8] - avg2(pix2[8], pix3[8]));
-        s += abs(pix1[9] - avg2(pix2[9], pix3[9]));
-        s += abs(pix1[10] - avg2(pix2[10], pix3[10]));
-        s += abs(pix1[11] - avg2(pix2[11], pix3[11]));
-        s += abs(pix1[12] - avg2(pix2[12], pix3[12]));
-        s += abs(pix1[13] - avg2(pix2[13], pix3[13]));
-        s += abs(pix1[14] - avg2(pix2[14], pix3[14]));
-        s += abs(pix1[15] - avg2(pix2[15], pix3[15]));
-        pix1 += line_size;
-        pix2 += line_size;
-        pix3 += line_size;
-    }
-    return s;
-}
-
-static int pix_abs16_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int s, i;
-    uint8_t *pix3 = pix2 + line_size;
-
-    s = 0;
-    for(i=0;i<h;i++) {
-        s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
-        s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
-        s += abs(pix1[2] - avg4(pix2[2], pix2[3], pix3[2], pix3[3]));
-        s += abs(pix1[3] - avg4(pix2[3], pix2[4], pix3[3], pix3[4]));
-        s += abs(pix1[4] - avg4(pix2[4], pix2[5], pix3[4], pix3[5]));
-        s += abs(pix1[5] - avg4(pix2[5], pix2[6], pix3[5], pix3[6]));
-        s += abs(pix1[6] - avg4(pix2[6], pix2[7], pix3[6], pix3[7]));
-        s += abs(pix1[7] - avg4(pix2[7], pix2[8], pix3[7], pix3[8]));
-        s += abs(pix1[8] - avg4(pix2[8], pix2[9], pix3[8], pix3[9]));
-        s += abs(pix1[9] - avg4(pix2[9], pix2[10], pix3[9], pix3[10]));
-        s += abs(pix1[10] - avg4(pix2[10], pix2[11], pix3[10], pix3[11]));
-        s += abs(pix1[11] - avg4(pix2[11], pix2[12], pix3[11], pix3[12]));
-        s += abs(pix1[12] - avg4(pix2[12], pix2[13], pix3[12], pix3[13]));
-        s += abs(pix1[13] - avg4(pix2[13], pix2[14], pix3[13], pix3[14]));
-        s += abs(pix1[14] - avg4(pix2[14], pix2[15], pix3[14], pix3[15]));
-        s += abs(pix1[15] - avg4(pix2[15], pix2[16], pix3[15], pix3[16]));
-        pix1 += line_size;
-        pix2 += line_size;
-        pix3 += line_size;
-    }
-    return s;
-}
-
-static inline int pix_abs8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int s, i;
-
-    s = 0;
-    for(i=0;i<h;i++) {
-        s += abs(pix1[0] - pix2[0]);
-        s += abs(pix1[1] - pix2[1]);
-        s += abs(pix1[2] - pix2[2]);
-        s += abs(pix1[3] - pix2[3]);
-        s += abs(pix1[4] - pix2[4]);
-        s += abs(pix1[5] - pix2[5]);
-        s += abs(pix1[6] - pix2[6]);
-        s += abs(pix1[7] - pix2[7]);
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-    return s;
-}
-
-static int pix_abs8_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int s, i;
-
-    s = 0;
-    for(i=0;i<h;i++) {
-        s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
-        s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
-        s += abs(pix1[2] - avg2(pix2[2], pix2[3]));
-        s += abs(pix1[3] - avg2(pix2[3], pix2[4]));
-        s += abs(pix1[4] - avg2(pix2[4], pix2[5]));
-        s += abs(pix1[5] - avg2(pix2[5], pix2[6]));
-        s += abs(pix1[6] - avg2(pix2[6], pix2[7]));
-        s += abs(pix1[7] - avg2(pix2[7], pix2[8]));
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-    return s;
-}
-
-static int pix_abs8_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int s, i;
-    uint8_t *pix3 = pix2 + line_size;
-
-    s = 0;
-    for(i=0;i<h;i++) {
-        s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
-        s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
-        s += abs(pix1[2] - avg2(pix2[2], pix3[2]));
-        s += abs(pix1[3] - avg2(pix2[3], pix3[3]));
-        s += abs(pix1[4] - avg2(pix2[4], pix3[4]));
-        s += abs(pix1[5] - avg2(pix2[5], pix3[5]));
-        s += abs(pix1[6] - avg2(pix2[6], pix3[6]));
-        s += abs(pix1[7] - avg2(pix2[7], pix3[7]));
-        pix1 += line_size;
-        pix2 += line_size;
-        pix3 += line_size;
-    }
-    return s;
-}
-
-static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int s, i;
-    uint8_t *pix3 = pix2 + line_size;
-
-    s = 0;
-    for(i=0;i<h;i++) {
-        s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
-        s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
-        s += abs(pix1[2] - avg4(pix2[2], pix2[3], pix3[2], pix3[3]));
-        s += abs(pix1[3] - avg4(pix2[3], pix2[4], pix3[3], pix3[4]));
-        s += abs(pix1[4] - avg4(pix2[4], pix2[5], pix3[4], pix3[5]));
-        s += abs(pix1[5] - avg4(pix2[5], pix2[6], pix3[5], pix3[6]));
-        s += abs(pix1[6] - avg4(pix2[6], pix2[7], pix3[6], pix3[7]));
-        s += abs(pix1[7] - avg4(pix2[7], pix2[8], pix3[7], pix3[8]));
-        pix1 += line_size;
-        pix2 += line_size;
-        pix3 += line_size;
-    }
-    return s;
-}
-
-static int nsse16_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h){
-    MpegEncContext *c = v;
-    int score1=0;
-    int score2=0;
-    int x,y;
-
-    for(y=0; y<h; y++){
-        for(x=0; x<16; x++){
-            score1+= (s1[x  ] - s2[x ])*(s1[x  ] - s2[x ]);
-        }
-        if(y+1<h){
-            for(x=0; x<15; x++){
-                score2+= FFABS(  s1[x  ] - s1[x  +stride]
-                             - s1[x+1] + s1[x+1+stride])
-                        -FFABS(  s2[x  ] - s2[x  +stride]
-                             - s2[x+1] + s2[x+1+stride]);
-            }
-        }
-        s1+= stride;
-        s2+= stride;
-    }
-
-    if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
-    else  return score1 + FFABS(score2)*8;
-}
-
-static int nsse8_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h){
-    MpegEncContext *c = v;
-    int score1=0;
-    int score2=0;
-    int x,y;
-
-    for(y=0; y<h; y++){
-        for(x=0; x<8; x++){
-            score1+= (s1[x  ] - s2[x ])*(s1[x  ] - s2[x ]);
-        }
-        if(y+1<h){
-            for(x=0; x<7; x++){
-                score2+= FFABS(  s1[x  ] - s1[x  +stride]
-                             - s1[x+1] + s1[x+1+stride])
-                        -FFABS(  s2[x  ] - s2[x  +stride]
-                             - s2[x+1] + s2[x+1+stride]);
-            }
-        }
-        s1+= stride;
-        s2+= stride;
-    }
-
-    if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
-    else  return score1 + FFABS(score2)*8;
-}
-
-static int try_8x8basis_c(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale){
-    int i;
-    unsigned int sum=0;
-
-    for(i=0; i<8*8; i++){
-        int b= rem[i] + ((basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT));
-        int w= weight[i];
-        b>>= RECON_SHIFT;
-        assert(-512<b && b<512);
-
-        sum += (w*b)*(w*b)>>4;
-    }
-    return sum>>2;
-}
-
-static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale){
-    int i;
-
-    for(i=0; i<8*8; i++){
-        rem[i] += (basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT);
-    }
-}
-
-static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h){
-    return 0;
-}
-
-void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type){
-    int i;
-
-    memset(cmp, 0, sizeof(void*)*6);
-
-    for(i=0; i<6; i++){
-        switch(type&0xFF){
-        case FF_CMP_SAD:
-            cmp[i]= c->sad[i];
-            break;
-        case FF_CMP_SATD:
-            cmp[i]= c->hadamard8_diff[i];
-            break;
-        case FF_CMP_SSE:
-            cmp[i]= c->sse[i];
-            break;
-        case FF_CMP_DCT:
-            cmp[i]= c->dct_sad[i];
-            break;
-        case FF_CMP_DCT264:
-            cmp[i]= c->dct264_sad[i];
-            break;
-        case FF_CMP_DCTMAX:
-            cmp[i]= c->dct_max[i];
-            break;
-        case FF_CMP_PSNR:
-            cmp[i]= c->quant_psnr[i];
-            break;
-        case FF_CMP_BIT:
-            cmp[i]= c->bit[i];
-            break;
-        case FF_CMP_RD:
-            cmp[i]= c->rd[i];
-            break;
-        case FF_CMP_VSAD:
-            cmp[i]= c->vsad[i];
-            break;
-        case FF_CMP_VSSE:
-            cmp[i]= c->vsse[i];
-            break;
-        case FF_CMP_ZERO:
-            cmp[i]= zero_cmp;
-            break;
-        case FF_CMP_NSSE:
-            cmp[i]= c->nsse[i];
-            break;
-        default:
-            av_log(NULL, AV_LOG_ERROR,"internal error in cmp function selection\n");
-        }
-    }
-}
-
-static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
-    long i;
-    for (i = 0; i <= w - (int) sizeof(long); i += sizeof(long)) {
-        long a = *(long*)(src+i);
-        long b = *(long*)(dst+i);
-        *(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80);
-    }
-    for(; i<w; i++)
-        dst[i+0] += src[i+0];
-}
-
-static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
-    long i;
-#if !HAVE_FAST_UNALIGNED
-    if((long)src2 & (sizeof(long)-1)){
-        for(i=0; i+7<w; i+=8){
-            dst[i+0] = src1[i+0]-src2[i+0];
-            dst[i+1] = src1[i+1]-src2[i+1];
-            dst[i+2] = src1[i+2]-src2[i+2];
-            dst[i+3] = src1[i+3]-src2[i+3];
-            dst[i+4] = src1[i+4]-src2[i+4];
-            dst[i+5] = src1[i+5]-src2[i+5];
-            dst[i+6] = src1[i+6]-src2[i+6];
-            dst[i+7] = src1[i+7]-src2[i+7];
-        }
-    }else
-#endif
-    for (i = 0; i <= w - (int) sizeof(long); i += sizeof(long)) {
-        long a = *(long*)(src1+i);
-        long b = *(long*)(src2+i);
-        *(long*)(dst+i) = ((a|pb_80) - (b&pb_7f)) ^ ((a^b^pb_80)&pb_80);
-    }
-    for(; i<w; i++)
-        dst[i+0] = src1[i+0]-src2[i+0];
-}
-
-static void add_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, const uint8_t *diff, int w, int *left, int *left_top){
-    int i;
-    uint8_t l, lt;
-
-    l= *left;
-    lt= *left_top;
-
-    for(i=0; i<w; i++){
-        l= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF) + diff[i];
-        lt= src1[i];
-        dst[i]= l;
-    }
-
-    *left= l;
-    *left_top= lt;
-}
-
-static void sub_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top){
-    int i;
-    uint8_t l, lt;
-
-    l= *left;
-    lt= *left_top;
-
-    for(i=0; i<w; i++){
-        const int pred= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF);
-        lt= src1[i];
-        l= src2[i];
-        dst[i]= l - pred;
-    }
-
-    *left= l;
-    *left_top= lt;
-}
-
-static int add_hfyu_left_prediction_c(uint8_t *dst, const uint8_t *src, int w, int acc){
-    int i;
-
-    for(i=0; i<w-1; i++){
-        acc+= src[i];
-        dst[i]= acc;
-        i++;
-        acc+= src[i];
-        dst[i]= acc;
-    }
-
-    for(; i<w; i++){
-        acc+= src[i];
-        dst[i]= acc;
-    }
-
-    return acc;
-}
-
-#if HAVE_BIGENDIAN
-#define B 3
-#define G 2
-#define R 1
-#define A 0
-#else
-#define B 0
-#define G 1
-#define R 2
-#define A 3
-#endif
-static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue, int *alpha){
-    int i;
-    int r,g,b,a;
-    r= *red;
-    g= *green;
-    b= *blue;
-    a= *alpha;
-
-    for(i=0; i<w; i++){
-        b+= src[4*i+B];
-        g+= src[4*i+G];
-        r+= src[4*i+R];
-        a+= src[4*i+A];
-
-        dst[4*i+B]= b;
-        dst[4*i+G]= g;
-        dst[4*i+R]= r;
-        dst[4*i+A]= a;
-    }
-
-    *red= r;
-    *green= g;
-    *blue= b;
-    *alpha= a;
-}
-#undef B
-#undef G
-#undef R
-#undef A
-
-#define BUTTERFLY2(o1,o2,i1,i2) \
-o1= (i1)+(i2);\
-o2= (i1)-(i2);
-
-#define BUTTERFLY1(x,y) \
-{\
-    int a,b;\
-    a= x;\
-    b= y;\
-    x= a+b;\
-    y= a-b;\
-}
-
-#define BUTTERFLYA(x,y) (FFABS((x)+(y)) + FFABS((x)-(y)))
-
-static int hadamard8_diff8x8_c(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
-    int i;
-    int temp[64];
-    int sum=0;
-
-    assert(h==8);
-
-    for(i=0; i<8; i++){
-        //FIXME try pointer walks
-        BUTTERFLY2(temp[8*i+0], temp[8*i+1], src[stride*i+0]-dst[stride*i+0],src[stride*i+1]-dst[stride*i+1]);
-        BUTTERFLY2(temp[8*i+2], temp[8*i+3], src[stride*i+2]-dst[stride*i+2],src[stride*i+3]-dst[stride*i+3]);
-        BUTTERFLY2(temp[8*i+4], temp[8*i+5], src[stride*i+4]-dst[stride*i+4],src[stride*i+5]-dst[stride*i+5]);
-        BUTTERFLY2(temp[8*i+6], temp[8*i+7], src[stride*i+6]-dst[stride*i+6],src[stride*i+7]-dst[stride*i+7]);
-
-        BUTTERFLY1(temp[8*i+0], temp[8*i+2]);
-        BUTTERFLY1(temp[8*i+1], temp[8*i+3]);
-        BUTTERFLY1(temp[8*i+4], temp[8*i+6]);
-        BUTTERFLY1(temp[8*i+5], temp[8*i+7]);
-
-        BUTTERFLY1(temp[8*i+0], temp[8*i+4]);
-        BUTTERFLY1(temp[8*i+1], temp[8*i+5]);
-        BUTTERFLY1(temp[8*i+2], temp[8*i+6]);
-        BUTTERFLY1(temp[8*i+3], temp[8*i+7]);
-    }
-
-    for(i=0; i<8; i++){
-        BUTTERFLY1(temp[8*0+i], temp[8*1+i]);
-        BUTTERFLY1(temp[8*2+i], temp[8*3+i]);
-        BUTTERFLY1(temp[8*4+i], temp[8*5+i]);
-        BUTTERFLY1(temp[8*6+i], temp[8*7+i]);
-
-        BUTTERFLY1(temp[8*0+i], temp[8*2+i]);
-        BUTTERFLY1(temp[8*1+i], temp[8*3+i]);
-        BUTTERFLY1(temp[8*4+i], temp[8*6+i]);
-        BUTTERFLY1(temp[8*5+i], temp[8*7+i]);
-
-        sum +=
-             BUTTERFLYA(temp[8*0+i], temp[8*4+i])
-            +BUTTERFLYA(temp[8*1+i], temp[8*5+i])
-            +BUTTERFLYA(temp[8*2+i], temp[8*6+i])
-            +BUTTERFLYA(temp[8*3+i], temp[8*7+i]);
-    }
-    return sum;
-}
-
-static int hadamard8_intra8x8_c(/*MpegEncContext*/ void *s, uint8_t *src, uint8_t *dummy, int stride, int h){
-    int i;
-    int temp[64];
-    int sum=0;
-
-    assert(h==8);
-
-    for(i=0; i<8; i++){
-        //FIXME try pointer walks
-        BUTTERFLY2(temp[8*i+0], temp[8*i+1], src[stride*i+0],src[stride*i+1]);
-        BUTTERFLY2(temp[8*i+2], temp[8*i+3], src[stride*i+2],src[stride*i+3]);
-        BUTTERFLY2(temp[8*i+4], temp[8*i+5], src[stride*i+4],src[stride*i+5]);
-        BUTTERFLY2(temp[8*i+6], temp[8*i+7], src[stride*i+6],src[stride*i+7]);
-
-        BUTTERFLY1(temp[8*i+0], temp[8*i+2]);
-        BUTTERFLY1(temp[8*i+1], temp[8*i+3]);
-        BUTTERFLY1(temp[8*i+4], temp[8*i+6]);
-        BUTTERFLY1(temp[8*i+5], temp[8*i+7]);
-
-        BUTTERFLY1(temp[8*i+0], temp[8*i+4]);
-        BUTTERFLY1(temp[8*i+1], temp[8*i+5]);
-        BUTTERFLY1(temp[8*i+2], temp[8*i+6]);
-        BUTTERFLY1(temp[8*i+3], temp[8*i+7]);
-    }
-
-    for(i=0; i<8; i++){
-        BUTTERFLY1(temp[8*0+i], temp[8*1+i]);
-        BUTTERFLY1(temp[8*2+i], temp[8*3+i]);
-        BUTTERFLY1(temp[8*4+i], temp[8*5+i]);
-        BUTTERFLY1(temp[8*6+i], temp[8*7+i]);
-
-        BUTTERFLY1(temp[8*0+i], temp[8*2+i]);
-        BUTTERFLY1(temp[8*1+i], temp[8*3+i]);
-        BUTTERFLY1(temp[8*4+i], temp[8*6+i]);
-        BUTTERFLY1(temp[8*5+i], temp[8*7+i]);
-
-        sum +=
-             BUTTERFLYA(temp[8*0+i], temp[8*4+i])
-            +BUTTERFLYA(temp[8*1+i], temp[8*5+i])
-            +BUTTERFLYA(temp[8*2+i], temp[8*6+i])
-            +BUTTERFLYA(temp[8*3+i], temp[8*7+i]);
-    }
-
-    sum -= FFABS(temp[8*0] + temp[8*4]); // -mean
-
-    return sum;
-}
-
-static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
-    MpegEncContext * const s= (MpegEncContext *)c;
-    LOCAL_ALIGNED_16(int16_t, temp, [64]);
-
-    assert(h==8);
-
-    s->dsp.diff_pixels(temp, src1, src2, stride);
-    s->dsp.fdct(temp);
-    return s->dsp.sum_abs_dctelem(temp);
-}
-
-#if CONFIG_GPL
-#define DCT8_1D {\
-    const int s07 = SRC(0) + SRC(7);\
-    const int s16 = SRC(1) + SRC(6);\
-    const int s25 = SRC(2) + SRC(5);\
-    const int s34 = SRC(3) + SRC(4);\
-    const int a0 = s07 + s34;\
-    const int a1 = s16 + s25;\
-    const int a2 = s07 - s34;\
-    const int a3 = s16 - s25;\
-    const int d07 = SRC(0) - SRC(7);\
-    const int d16 = SRC(1) - SRC(6);\
-    const int d25 = SRC(2) - SRC(5);\
-    const int d34 = SRC(3) - SRC(4);\
-    const int a4 = d16 + d25 + (d07 + (d07>>1));\
-    const int a5 = d07 - d34 - (d25 + (d25>>1));\
-    const int a6 = d07 + d34 - (d16 + (d16>>1));\
-    const int a7 = d16 - d25 + (d34 + (d34>>1));\
-    DST(0,  a0 + a1     ) ;\
-    DST(1,  a4 + (a7>>2)) ;\
-    DST(2,  a2 + (a3>>1)) ;\
-    DST(3,  a5 + (a6>>2)) ;\
-    DST(4,  a0 - a1     ) ;\
-    DST(5,  a6 - (a5>>2)) ;\
-    DST(6, (a2>>1) - a3 ) ;\
-    DST(7, (a4>>2) - a7 ) ;\
-}
-
-static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
-    MpegEncContext * const s= (MpegEncContext *)c;
-    int16_t dct[8][8];
-    int i;
-    int sum=0;
-
-    s->dsp.diff_pixels(dct[0], src1, src2, stride);
-
-#define SRC(x) dct[i][x]
-#define DST(x,v) dct[i][x]= v
-    for( i = 0; i < 8; i++ )
-        DCT8_1D
-#undef SRC
-#undef DST
-
-#define SRC(x) dct[x][i]
-#define DST(x,v) sum += FFABS(v)
-    for( i = 0; i < 8; i++ )
-        DCT8_1D
-#undef SRC
-#undef DST
-    return sum;
-}
-#endif
-
-static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
-    MpegEncContext * const s= (MpegEncContext *)c;
-    LOCAL_ALIGNED_16(int16_t, temp, [64]);
-    int sum=0, i;
-
-    assert(h==8);
-
-    s->dsp.diff_pixels(temp, src1, src2, stride);
-    s->dsp.fdct(temp);
-
-    for(i=0; i<64; i++)
-        sum= FFMAX(sum, FFABS(temp[i]));
-
-    return sum;
-}
-
-static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
-    MpegEncContext * const s= (MpegEncContext *)c;
-    LOCAL_ALIGNED_16(int16_t, temp, [64*2]);
-    int16_t * const bak = temp+64;
-    int sum=0, i;
-
-    assert(h==8);
-    s->mb_intra=0;
-
-    s->dsp.diff_pixels(temp, src1, src2, stride);
-
-    memcpy(bak, temp, 64*sizeof(int16_t));
-
-    s->block_last_index[0/*FIXME*/]= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
-    s->dct_unquantize_inter(s, temp, 0, s->qscale);
-    ff_simple_idct_8(temp); //FIXME
-
-    for(i=0; i<64; i++)
-        sum+= (temp[i]-bak[i])*(temp[i]-bak[i]);
-
-    return sum;
-}
-
-static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
-    MpegEncContext * const s= (MpegEncContext *)c;
-    const uint8_t *scantable= s->intra_scantable.permutated;
-    LOCAL_ALIGNED_16(int16_t, temp, [64]);
-    LOCAL_ALIGNED_16(uint8_t, lsrc1, [64]);
-    LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]);
-    int i, last, run, bits, level, distortion, start_i;
-    const int esc_length= s->ac_esc_length;
-    uint8_t * length;
-    uint8_t * last_length;
-
-    assert(h==8);
-
-    copy_block8(lsrc1, src1, 8, stride, 8);
-    copy_block8(lsrc2, src2, 8, stride, 8);
-
-    s->dsp.diff_pixels(temp, lsrc1, lsrc2, 8);
-
-    s->block_last_index[0/*FIXME*/]= last= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
-
-    bits=0;
-
-    if (s->mb_intra) {
-        start_i = 1;
-        length     = s->intra_ac_vlc_length;
-        last_length= s->intra_ac_vlc_last_length;
-        bits+= s->luma_dc_vlc_length[temp[0] + 256]; //FIXME chroma
-    } else {
-        start_i = 0;
-        length     = s->inter_ac_vlc_length;
-        last_length= s->inter_ac_vlc_last_length;
-    }
-
-    if(last>=start_i){
-        run=0;
-        for(i=start_i; i<last; i++){
-            int j= scantable[i];
-            level= temp[j];
-
-            if(level){
-                level+=64;
-                if((level&(~127)) == 0){
-                    bits+= length[UNI_AC_ENC_INDEX(run, level)];
-                }else
-                    bits+= esc_length;
-                run=0;
-            }else
-                run++;
-        }
-        i= scantable[last];
-
-        level= temp[i] + 64;
-
-        assert(level - 64);
-
-        if((level&(~127)) == 0){
-            bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
-        }else
-            bits+= esc_length;
-
-    }
-
-    if(last>=0){
-        if(s->mb_intra)
-            s->dct_unquantize_intra(s, temp, 0, s->qscale);
-        else
-            s->dct_unquantize_inter(s, temp, 0, s->qscale);
-    }
-
-    s->dsp.idct_add(lsrc2, 8, temp);
-
-    distortion= s->dsp.sse[1](NULL, lsrc2, lsrc1, 8, 8);
-
-    return distortion + ((bits*s->qscale*s->qscale*109 + 64)>>7);
-}
-
-static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
-    MpegEncContext * const s= (MpegEncContext *)c;
-    const uint8_t *scantable= s->intra_scantable.permutated;
-    LOCAL_ALIGNED_16(int16_t, temp, [64]);
-    int i, last, run, bits, level, start_i;
-    const int esc_length= s->ac_esc_length;
-    uint8_t * length;
-    uint8_t * last_length;
-
-    assert(h==8);
-
-    s->dsp.diff_pixels(temp, src1, src2, stride);
-
-    s->block_last_index[0/*FIXME*/]= last= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
-
-    bits=0;
-
-    if (s->mb_intra) {
-        start_i = 1;
-        length     = s->intra_ac_vlc_length;
-        last_length= s->intra_ac_vlc_last_length;
-        bits+= s->luma_dc_vlc_length[temp[0] + 256]; //FIXME chroma
-    } else {
-        start_i = 0;
-        length     = s->inter_ac_vlc_length;
-        last_length= s->inter_ac_vlc_last_length;
-    }
-
-    if(last>=start_i){
-        run=0;
-        for(i=start_i; i<last; i++){
-            int j= scantable[i];
-            level= temp[j];
-
-            if(level){
-                level+=64;
-                if((level&(~127)) == 0){
-                    bits+= length[UNI_AC_ENC_INDEX(run, level)];
-                }else
-                    bits+= esc_length;
-                run=0;
-            }else
-                run++;
-        }
-        i= scantable[last];
-
-        level= temp[i] + 64;
-
-        assert(level - 64);
-
-        if((level&(~127)) == 0){
-            bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
-        }else
-            bits+= esc_length;
-    }
-
-    return bits;
-}
-
-#define VSAD_INTRA(size) \
-static int vsad_intra##size##_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){ \
-    int score=0;                                                                                            \
-    int x,y;                                                                                                \
-                                                                                                            \
-    for(y=1; y<h; y++){                                                                                     \
-        for(x=0; x<size; x+=4){                                                                             \
-            score+= FFABS(s[x  ] - s[x  +stride]) + FFABS(s[x+1] - s[x+1+stride])                           \
-                   +FFABS(s[x+2] - s[x+2+stride]) + FFABS(s[x+3] - s[x+3+stride]);                          \
-        }                                                                                                   \
-        s+= stride;                                                                                         \
-    }                                                                                                       \
-                                                                                                            \
-    return score;                                                                                           \
-}
-VSAD_INTRA(8)
-VSAD_INTRA(16)
-
-static int vsad16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
-    int score=0;
-    int x,y;
-
-    for(y=1; y<h; y++){
-        for(x=0; x<16; x++){
-            score+= FFABS(s1[x  ] - s2[x ] - s1[x  +stride] + s2[x +stride]);
-        }
-        s1+= stride;
-        s2+= stride;
-    }
-
-    return score;
-}
-
-#define SQ(a) ((a)*(a))
-#define VSSE_INTRA(size) \
-static int vsse_intra##size##_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){ \
-    int score=0;                                                                                            \
-    int x,y;                                                                                                \
-                                                                                                            \
-    for(y=1; y<h; y++){                                                                                     \
-        for(x=0; x<size; x+=4){                                                                               \
-            score+= SQ(s[x  ] - s[x  +stride]) + SQ(s[x+1] - s[x+1+stride])                                 \
-                   +SQ(s[x+2] - s[x+2+stride]) + SQ(s[x+3] - s[x+3+stride]);                                \
-        }                                                                                                   \
-        s+= stride;                                                                                         \
-    }                                                                                                       \
-                                                                                                            \
-    return score;                                                                                           \
-}
-VSSE_INTRA(8)
-VSSE_INTRA(16)
-
-static int vsse16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
-    int score=0;
-    int x,y;
-
-    for(y=1; y<h; y++){
-        for(x=0; x<16; x++){
-            score+= SQ(s1[x  ] - s2[x ] - s1[x  +stride] + s2[x +stride]);
-        }
-        s1+= stride;
-        s2+= stride;
-    }
-
-    return score;
-}
-
-static int ssd_int8_vs_int16_c(const int8_t *pix1, const int16_t *pix2,
-                               int size){
-    int score=0;
-    int i;
-    for(i=0; i<size; i++)
-        score += (pix1[i]-pix2[i])*(pix1[i]-pix2[i]);
-    return score;
-}
-
-#define WRAPPER8_16_SQ(name8, name16)\
-static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
-    int score=0;\
-    score +=name8(s, dst           , src           , stride, 8);\
-    score +=name8(s, dst+8         , src+8         , stride, 8);\
-    if(h==16){\
-        dst += 8*stride;\
-        src += 8*stride;\
-        score +=name8(s, dst           , src           , stride, 8);\
-        score +=name8(s, dst+8         , src+8         , stride, 8);\
-    }\
-    return score;\
-}
-
-WRAPPER8_16_SQ(hadamard8_diff8x8_c, hadamard8_diff16_c)
-WRAPPER8_16_SQ(hadamard8_intra8x8_c, hadamard8_intra16_c)
-WRAPPER8_16_SQ(dct_sad8x8_c, dct_sad16_c)
-#if CONFIG_GPL
-WRAPPER8_16_SQ(dct264_sad8x8_c, dct264_sad16_c)
-#endif
-WRAPPER8_16_SQ(dct_max8x8_c, dct_max16_c)
-WRAPPER8_16_SQ(quant_psnr8x8_c, quant_psnr16_c)
-WRAPPER8_16_SQ(rd8x8_c, rd16_c)
-WRAPPER8_16_SQ(bit8x8_c, bit16_c)
-
-static inline uint32_t clipf_c_one(uint32_t a, uint32_t mini,
-                   uint32_t maxi, uint32_t maxisign)
-{
-
-    if(a > mini) return mini;
-    else if((a^(1U<<31)) > maxisign) return maxi;
-    else return a;
-}
-
-static void vector_clipf_c_opposite_sign(float *dst, const float *src, float *min, float *max, int len){
-    int i;
-    uint32_t mini = *(uint32_t*)min;
-    uint32_t maxi = *(uint32_t*)max;
-    uint32_t maxisign = maxi ^ (1U<<31);
-    uint32_t *dsti = (uint32_t*)dst;
-    const uint32_t *srci = (const uint32_t*)src;
-    for(i=0; i<len; i+=8) {
-        dsti[i + 0] = clipf_c_one(srci[i + 0], mini, maxi, maxisign);
-        dsti[i + 1] = clipf_c_one(srci[i + 1], mini, maxi, maxisign);
-        dsti[i + 2] = clipf_c_one(srci[i + 2], mini, maxi, maxisign);
-        dsti[i + 3] = clipf_c_one(srci[i + 3], mini, maxi, maxisign);
-        dsti[i + 4] = clipf_c_one(srci[i + 4], mini, maxi, maxisign);
-        dsti[i + 5] = clipf_c_one(srci[i + 5], mini, maxi, maxisign);
-        dsti[i + 6] = clipf_c_one(srci[i + 6], mini, maxi, maxisign);
-        dsti[i + 7] = clipf_c_one(srci[i + 7], mini, maxi, maxisign);
-    }
-}
-static void vector_clipf_c(float *dst, const float *src, float min, float max, int len){
-    int i;
-    if(min < 0 && max > 0) {
-        vector_clipf_c_opposite_sign(dst, src, &min, &max, len);
-    } else {
-        for(i=0; i < len; i+=8) {
-            dst[i    ] = av_clipf(src[i    ], min, max);
-            dst[i + 1] = av_clipf(src[i + 1], min, max);
-            dst[i + 2] = av_clipf(src[i + 2], min, max);
-            dst[i + 3] = av_clipf(src[i + 3], min, max);
-            dst[i + 4] = av_clipf(src[i + 4], min, max);
-            dst[i + 5] = av_clipf(src[i + 5], min, max);
-            dst[i + 6] = av_clipf(src[i + 6], min, max);
-            dst[i + 7] = av_clipf(src[i + 7], min, max);
-        }
-    }
-}
-
-static int32_t scalarproduct_int16_c(const int16_t * v1, const int16_t * v2, int order)
-{
-    int res = 0;
-
-    while (order--)
-        res += *v1++ * *v2++;
-
-    return res;
-}
-
-static int32_t scalarproduct_and_madd_int16_c(int16_t *v1, const int16_t *v2, const int16_t *v3, int order, int mul)
-{
-    int res = 0;
-    while (order--) {
-        res   += *v1 * *v2++;
-        *v1++ += mul * *v3++;
-    }
-    return res;
-}
-
-static void vector_clip_int32_c(int32_t *dst, const int32_t *src, int32_t min,
-                                int32_t max, unsigned int len)
-{
-    do {
-        *dst++ = av_clip(*src++, min, max);
-        *dst++ = av_clip(*src++, min, max);
-        *dst++ = av_clip(*src++, min, max);
-        *dst++ = av_clip(*src++, min, max);
-        *dst++ = av_clip(*src++, min, max);
-        *dst++ = av_clip(*src++, min, max);
-        *dst++ = av_clip(*src++, min, max);
-        *dst++ = av_clip(*src++, min, max);
-        len -= 8;
-    } while (len > 0);
-}
-
-static void jref_idct_put(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_j_rev_dct (block);
-    put_pixels_clamped_c(block, dest, line_size);
-}
-static void jref_idct_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_j_rev_dct (block);
-    add_pixels_clamped_c(block, dest, line_size);
-}
-
-/* init static data */
-av_cold void ff_dsputil_static_init(void)
-{
-    int i;
-
-    for(i=0;i<512;i++) {
-        ff_squareTbl[i] = (i - 256) * (i - 256);
-    }
-}
-
-int ff_check_alignment(void){
-    static int did_fail=0;
-    LOCAL_ALIGNED_16(int, aligned, [4]);
-
-    if((intptr_t)aligned & 15){
-        if(!did_fail){
-#if HAVE_MMX || HAVE_ALTIVEC
-            av_log(NULL, AV_LOG_ERROR,
-                "Compiler did not align stack variables. Libavcodec has been miscompiled\n"
-                "and may be very slow or crash. This is not a bug in libavcodec,\n"
-                "but in the compiler. You may try recompiling using gcc >= 4.2.\n"
-                "Do not report crashes to Libav developers.\n");
-#endif
-            did_fail=1;
-        }
-        return -1;
-    }
-    return 0;
-}
-
-av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
-{
-    ff_check_alignment();
-
-#if CONFIG_ENCODERS
-    if (avctx->bits_per_raw_sample == 10) {
-        c->fdct    = ff_jpeg_fdct_islow_10;
-        c->fdct248 = ff_fdct248_islow_10;
-    } else {
-        if(avctx->dct_algo==FF_DCT_FASTINT) {
-            c->fdct    = ff_fdct_ifast;
-            c->fdct248 = ff_fdct_ifast248;
-        }
-        else if(avctx->dct_algo==FF_DCT_FAAN) {
-            c->fdct    = ff_faandct;
-            c->fdct248 = ff_faandct248;
-        }
-        else {
-            c->fdct    = ff_jpeg_fdct_islow_8; //slow/accurate/default
-            c->fdct248 = ff_fdct248_islow_8;
-        }
-    }
-#endif //CONFIG_ENCODERS
-
-    if (avctx->bits_per_raw_sample == 10) {
-        c->idct_put              = ff_simple_idct_put_10;
-        c->idct_add              = ff_simple_idct_add_10;
-        c->idct                  = ff_simple_idct_10;
-        c->idct_permutation_type = FF_NO_IDCT_PERM;
-    } else {
-        if(avctx->idct_algo==FF_IDCT_INT){
-            c->idct_put= jref_idct_put;
-            c->idct_add= jref_idct_add;
-            c->idct    = ff_j_rev_dct;
-            c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
-        }else if(avctx->idct_algo==FF_IDCT_FAAN){
-            c->idct_put= ff_faanidct_put;
-            c->idct_add= ff_faanidct_add;
-            c->idct    = ff_faanidct;
-            c->idct_permutation_type= FF_NO_IDCT_PERM;
-        }else{ //accurate/default
-            c->idct_put = ff_simple_idct_put_8;
-            c->idct_add = ff_simple_idct_add_8;
-            c->idct     = ff_simple_idct_8;
-            c->idct_permutation_type= FF_NO_IDCT_PERM;
-        }
-    }
-
-    c->diff_pixels = diff_pixels_c;
-    c->put_pixels_clamped = put_pixels_clamped_c;
-    c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
-    c->add_pixels_clamped = add_pixels_clamped_c;
-    c->sum_abs_dctelem = sum_abs_dctelem_c;
-    c->gmc1 = gmc1_c;
-    c->gmc = ff_gmc_c;
-    c->pix_sum = pix_sum_c;
-    c->pix_norm1 = pix_norm1_c;
-
-    c->fill_block_tab[0] = fill_block16_c;
-    c->fill_block_tab[1] = fill_block8_c;
-
-    /* TODO [0] 16  [1] 8 */
-    c->pix_abs[0][0] = pix_abs16_c;
-    c->pix_abs[0][1] = pix_abs16_x2_c;
-    c->pix_abs[0][2] = pix_abs16_y2_c;
-    c->pix_abs[0][3] = pix_abs16_xy2_c;
-    c->pix_abs[1][0] = pix_abs8_c;
-    c->pix_abs[1][1] = pix_abs8_x2_c;
-    c->pix_abs[1][2] = pix_abs8_y2_c;
-    c->pix_abs[1][3] = pix_abs8_xy2_c;
-
-    c->put_tpel_pixels_tab[ 0] = put_tpel_pixels_mc00_c;
-    c->put_tpel_pixels_tab[ 1] = put_tpel_pixels_mc10_c;
-    c->put_tpel_pixels_tab[ 2] = put_tpel_pixels_mc20_c;
-    c->put_tpel_pixels_tab[ 4] = put_tpel_pixels_mc01_c;
-    c->put_tpel_pixels_tab[ 5] = put_tpel_pixels_mc11_c;
-    c->put_tpel_pixels_tab[ 6] = put_tpel_pixels_mc21_c;
-    c->put_tpel_pixels_tab[ 8] = put_tpel_pixels_mc02_c;
-    c->put_tpel_pixels_tab[ 9] = put_tpel_pixels_mc12_c;
-    c->put_tpel_pixels_tab[10] = put_tpel_pixels_mc22_c;
-
-    c->avg_tpel_pixels_tab[ 0] = avg_tpel_pixels_mc00_c;
-    c->avg_tpel_pixels_tab[ 1] = avg_tpel_pixels_mc10_c;
-    c->avg_tpel_pixels_tab[ 2] = avg_tpel_pixels_mc20_c;
-    c->avg_tpel_pixels_tab[ 4] = avg_tpel_pixels_mc01_c;
-    c->avg_tpel_pixels_tab[ 5] = avg_tpel_pixels_mc11_c;
-    c->avg_tpel_pixels_tab[ 6] = avg_tpel_pixels_mc21_c;
-    c->avg_tpel_pixels_tab[ 8] = avg_tpel_pixels_mc02_c;
-    c->avg_tpel_pixels_tab[ 9] = avg_tpel_pixels_mc12_c;
-    c->avg_tpel_pixels_tab[10] = avg_tpel_pixels_mc22_c;
-
-#define dspfunc(PFX, IDX, NUM) \
-    c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_c; \
-    c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_c; \
-    c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_c; \
-    c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_c; \
-    c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_c; \
-    c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_c; \
-    c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_c; \
-    c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_c; \
-    c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_c; \
-    c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_c; \
-    c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_c; \
-    c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_c; \
-    c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_c; \
-    c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_c; \
-    c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_c; \
-    c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_c
-
-    dspfunc(put_qpel, 0, 16);
-    dspfunc(put_no_rnd_qpel, 0, 16);
-
-    dspfunc(avg_qpel, 0, 16);
-    /* dspfunc(avg_no_rnd_qpel, 0, 16); */
-
-    dspfunc(put_qpel, 1, 8);
-    dspfunc(put_no_rnd_qpel, 1, 8);
-
-    dspfunc(avg_qpel, 1, 8);
-    /* dspfunc(avg_no_rnd_qpel, 1, 8); */
-
-#undef dspfunc
-
-    c->put_mspel_pixels_tab[0]= ff_put_pixels8x8_c;
-    c->put_mspel_pixels_tab[1]= put_mspel8_mc10_c;
-    c->put_mspel_pixels_tab[2]= put_mspel8_mc20_c;
-    c->put_mspel_pixels_tab[3]= put_mspel8_mc30_c;
-    c->put_mspel_pixels_tab[4]= put_mspel8_mc02_c;
-    c->put_mspel_pixels_tab[5]= put_mspel8_mc12_c;
-    c->put_mspel_pixels_tab[6]= put_mspel8_mc22_c;
-    c->put_mspel_pixels_tab[7]= put_mspel8_mc32_c;
-
-#define SET_CMP_FUNC(name) \
-    c->name[0]= name ## 16_c;\
-    c->name[1]= name ## 8x8_c;
-
-    SET_CMP_FUNC(hadamard8_diff)
-    c->hadamard8_diff[4]= hadamard8_intra16_c;
-    c->hadamard8_diff[5]= hadamard8_intra8x8_c;
-    SET_CMP_FUNC(dct_sad)
-    SET_CMP_FUNC(dct_max)
-#if CONFIG_GPL
-    SET_CMP_FUNC(dct264_sad)
-#endif
-    c->sad[0]= pix_abs16_c;
-    c->sad[1]= pix_abs8_c;
-    c->sse[0]= sse16_c;
-    c->sse[1]= sse8_c;
-    c->sse[2]= sse4_c;
-    SET_CMP_FUNC(quant_psnr)
-    SET_CMP_FUNC(rd)
-    SET_CMP_FUNC(bit)
-    c->vsad[0]= vsad16_c;
-    c->vsad[4]= vsad_intra16_c;
-    c->vsad[5]= vsad_intra8_c;
-    c->vsse[0]= vsse16_c;
-    c->vsse[4]= vsse_intra16_c;
-    c->vsse[5]= vsse_intra8_c;
-    c->nsse[0]= nsse16_c;
-    c->nsse[1]= nsse8_c;
-
-    c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
-
-    c->add_bytes= add_bytes_c;
-    c->diff_bytes= diff_bytes_c;
-    c->add_hfyu_median_prediction= add_hfyu_median_prediction_c;
-    c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c;
-    c->add_hfyu_left_prediction  = add_hfyu_left_prediction_c;
-    c->add_hfyu_left_prediction_bgr32 = add_hfyu_left_prediction_bgr32_c;
-    c->bswap_buf= bswap_buf;
-    c->bswap16_buf = bswap16_buf;
-
-    c->try_8x8basis= try_8x8basis_c;
-    c->add_8x8basis= add_8x8basis_c;
-
-    c->vector_clipf = vector_clipf_c;
-    c->scalarproduct_int16 = scalarproduct_int16_c;
-    c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_c;
-    c->vector_clip_int32 = vector_clip_int32_c;
-
-    c->shrink[0]= av_image_copy_plane;
-    c->shrink[1]= ff_shrink22;
-    c->shrink[2]= ff_shrink44;
-    c->shrink[3]= ff_shrink88;
-
-    c->add_pixels8 = add_pixels8_c;
-
-#undef FUNC
-#undef FUNCC
-#define FUNC(f, depth) f ## _ ## depth
-#define FUNCC(f, depth) f ## _ ## depth ## _c
-
-    c->draw_edges                    = FUNCC(draw_edges, 8);
-    c->clear_block                   = FUNCC(clear_block, 8);
-    c->clear_blocks                  = FUNCC(clear_blocks, 8);
-
-#define BIT_DEPTH_FUNCS(depth) \
-    c->get_pixels                    = FUNCC(get_pixels,   depth);
-
-    switch (avctx->bits_per_raw_sample) {
-    case 9:
-    case 10:
-        BIT_DEPTH_FUNCS(16);
-        break;
-    default:
-        BIT_DEPTH_FUNCS(8);
-        break;
-    }
-
-
-    if (ARCH_ARM)
-        ff_dsputil_init_arm(c, avctx);
-    if (ARCH_BFIN)
-        ff_dsputil_init_bfin(c, avctx);
-    if (ARCH_PPC)
-        ff_dsputil_init_ppc(c, avctx);
-    if (ARCH_SH4)
-        ff_dsputil_init_sh4(c, avctx);
-    if (HAVE_VIS)
-        ff_dsputil_init_vis(c, avctx);
-    if (ARCH_X86)
-        ff_dsputil_init_x86(c, avctx);
-
-    ff_init_scantable_permutation(c->idct_permutation,
-                                  c->idct_permutation_type);
-}
diff --git a/deps/libav/libavcodec/dsputil.h b/deps/libav/libavcodec/dsputil.h
deleted file mode 100644
index 7bd92e5..0000000
--- a/deps/libav/libavcodec/dsputil.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * DSP utils
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DSP utils.
- * note, many functions in here may use MMX which trashes the FPU state, it is
- * absolutely necessary to call emms_c() between dsp & float/double code
- */
-
-#ifndef AVCODEC_DSPUTIL_H
-#define AVCODEC_DSPUTIL_H
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "rnd_avg.h"
-
-/* encoding scans */
-extern const uint8_t ff_alternate_horizontal_scan[64];
-extern const uint8_t ff_alternate_vertical_scan[64];
-extern const uint8_t ff_zigzag_direct[64];
-extern const uint8_t ff_zigzag248_direct[64];
-
-/* pixel operations */
-#define MAX_NEG_CROP 1024
-
-/* temporary */
-extern uint32_t ff_squareTbl[512];
-extern const uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP];
-
-void ff_put_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-
-/* RV40 functions */
-void ff_put_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_put_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-void ff_avg_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-
-void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
-              int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
-
-/* minimum alignment rules ;)
-If you notice errors in the align stuff, need more alignment for some ASM code
-for some CPU or need to use a function with less aligned data then send a mail
-to the libav-devel mailing list, ...
-
-!warning These alignments might not match reality, (missing attribute((align))
-stuff somewhere possible).
-I (Michael) did not check them, these are just the alignments which I think
-could be reached easily ...
-
-!future video codecs might need functions with less strict alignment
-*/
-
-/* add and put pixel (decoding) */
-// blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
-//h for op_pixels_func is limited to {width/2, width} but never larger than 16 and never smaller than 4
-typedef void (*tpel_mc_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int w, int h);
-typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);
-
-typedef void (*op_fill_func)(uint8_t *block/*align width (8 or 16)*/, uint8_t value, int line_size, int h);
-
-#define DEF_OLD_QPEL(name)\
-void ff_put_        ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);\
-void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);\
-void ff_avg_        ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);
-
-DEF_OLD_QPEL(qpel16_mc11_old_c)
-DEF_OLD_QPEL(qpel16_mc31_old_c)
-DEF_OLD_QPEL(qpel16_mc12_old_c)
-DEF_OLD_QPEL(qpel16_mc32_old_c)
-DEF_OLD_QPEL(qpel16_mc13_old_c)
-DEF_OLD_QPEL(qpel16_mc33_old_c)
-DEF_OLD_QPEL(qpel8_mc11_old_c)
-DEF_OLD_QPEL(qpel8_mc31_old_c)
-DEF_OLD_QPEL(qpel8_mc12_old_c)
-DEF_OLD_QPEL(qpel8_mc32_old_c)
-DEF_OLD_QPEL(qpel8_mc13_old_c)
-DEF_OLD_QPEL(qpel8_mc33_old_c)
-
-/* motion estimation */
-// h is limited to {width/2, width, 2*width} but never larger than 16 and never smaller than 2
-// although currently h<4 is not used as functions with width <8 are neither used nor implemented
-typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size, int h)/* __attribute__ ((const))*/;
-
-/**
- * Scantable.
- */
-typedef struct ScanTable{
-    const uint8_t *scantable;
-    uint8_t permutated[64];
-    uint8_t raster_end[64];
-} ScanTable;
-
-void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable);
-void ff_init_scantable_permutation(uint8_t *idct_permutation,
-                                   int idct_permutation_type);
-
-/**
- * DSPContext.
- */
-typedef struct DSPContext {
-    /* pixel ops : interface with DCT */
-    void (*get_pixels)(int16_t *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
-    void (*diff_pixels)(int16_t *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
-    void (*put_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
-    void (*put_signed_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
-    void (*add_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
-    void (*add_pixels8)(uint8_t *pixels, int16_t *block, int line_size);
-    int (*sum_abs_dctelem)(int16_t *block/*align 16*/);
-    /**
-     * translational global motion compensation.
-     */
-    void (*gmc1)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
-    /**
-     * global motion compensation.
-     */
-    void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy,
-                    int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
-    void (*clear_block)(int16_t *block/*align 16*/);
-    void (*clear_blocks)(int16_t *blocks/*align 16*/);
-    int (*pix_sum)(uint8_t * pix, int line_size);
-    int (*pix_norm1)(uint8_t * pix, int line_size);
-// 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
-
-    me_cmp_func sad[6]; /* identical to pix_absAxA except additional void * */
-    me_cmp_func sse[6];
-    me_cmp_func hadamard8_diff[6];
-    me_cmp_func dct_sad[6];
-    me_cmp_func quant_psnr[6];
-    me_cmp_func bit[6];
-    me_cmp_func rd[6];
-    me_cmp_func vsad[6];
-    me_cmp_func vsse[6];
-    me_cmp_func nsse[6];
-    me_cmp_func dct_max[6];
-    me_cmp_func dct264_sad[6];
-
-    me_cmp_func me_pre_cmp[6];
-    me_cmp_func me_cmp[6];
-    me_cmp_func me_sub_cmp[6];
-    me_cmp_func mb_cmp[6];
-    me_cmp_func ildct_cmp[6]; //only width 16 used
-    me_cmp_func frame_skip_cmp[6]; //only width 8 used
-
-    int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2,
-                             int size);
-
-    /**
-     * Thirdpel motion compensation with rounding (a+b+1)>>1.
-     * this is an array[12] of motion compensation functions for the 9 thirdpe
-     * positions<br>
-     * *pixels_tab[ xthirdpel + 4*ythirdpel ]
-     * @param block destination where the result is stored
-     * @param pixels source
-     * @param line_size number of bytes in a horizontal line of block
-     * @param h height
-     */
-    tpel_mc_func put_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
-    tpel_mc_func avg_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
-
-    qpel_mc_func put_qpel_pixels_tab[2][16];
-    qpel_mc_func avg_qpel_pixels_tab[2][16];
-    qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
-    qpel_mc_func put_mspel_pixels_tab[8];
-
-    me_cmp_func pix_abs[2][4];
-
-    /* huffyuv specific */
-    void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w);
-    void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 1*/,int w);
-    /**
-     * subtract huffyuv's variant of median prediction
-     * note, this might read from src1[-1], src2[-1]
-     */
-    void (*sub_hfyu_median_prediction)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top);
-    void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top);
-    int  (*add_hfyu_left_prediction)(uint8_t *dst, const uint8_t *src, int w, int left);
-    void (*add_hfyu_left_prediction_bgr32)(uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue, int *alpha);
-    void (*bswap_buf)(uint32_t *dst, const uint32_t *src, int w);
-    void (*bswap16_buf)(uint16_t *dst, const uint16_t *src, int len);
-
-    /* assume len is a multiple of 8, and arrays are 16-byte aligned */
-    void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */);
-
-    /* (I)DCT */
-    void (*fdct)(int16_t *block/* align 16*/);
-    void (*fdct248)(int16_t *block/* align 16*/);
-
-    /* IDCT really*/
-    void (*idct)(int16_t *block/* align 16*/);
-
-    /**
-     * block -> idct -> clip to unsigned 8 bit -> dest.
-     * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
-     * @param line_size size in bytes of a horizontal line of dest
-     */
-    void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/);
-
-    /**
-     * block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
-     * @param line_size size in bytes of a horizontal line of dest
-     */
-    void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/);
-
-    /**
-     * idct input permutation.
-     * several optimized IDCTs need a permutated input (relative to the normal order of the reference
-     * IDCT)
-     * this permutation must be performed before the idct_put/add, note, normally this can be merged
-     * with the zigzag/alternate scan<br>
-     * an example to avoid confusion:
-     * - (->decode coeffs -> zigzag reorder -> dequant -> reference idct ->...)
-     * - (x -> reference dct -> reference idct -> x)
-     * - (x -> reference dct -> simple_mmx_perm = idct_permutation -> simple_idct_mmx -> x)
-     * - (->decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant -> simple_idct_mmx ->...)
-     */
-    uint8_t idct_permutation[64];
-    int idct_permutation_type;
-#define FF_NO_IDCT_PERM 1
-#define FF_LIBMPEG2_IDCT_PERM 2
-#define FF_SIMPLE_IDCT_PERM 3
-#define FF_TRANSPOSE_IDCT_PERM 4
-#define FF_PARTTRANS_IDCT_PERM 5
-#define FF_SSE2_IDCT_PERM 6
-
-    int (*try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale);
-    void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale);
-#define BASIS_SHIFT 16
-#define RECON_SHIFT 6
-
-    void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w, int h, int sides);
-#define EDGE_WIDTH 16
-#define EDGE_TOP    1
-#define EDGE_BOTTOM 2
-
-    void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
-
-    /**
-     * Calculate scalar product of two vectors.
-     * @param len length of vectors, should be multiple of 16
-     */
-    int32_t (*scalarproduct_int16)(const int16_t *v1, const int16_t *v2/*align 16*/, int len);
-    /* ape functions */
-    /**
-     * Calculate scalar product of v1 and v2,
-     * and v1[i] += v3[i] * mul
-     * @param len length of vectors, should be multiple of 16
-     */
-    int32_t (*scalarproduct_and_madd_int16)(int16_t *v1/*align 16*/, const int16_t *v2, const int16_t *v3, int len, int mul);
-
-    /**
-     * Clip each element in an array of int32_t to a given minimum and maximum value.
-     * @param dst  destination array
-     *             constraints: 16-byte aligned
-     * @param src  source array
-     *             constraints: 16-byte aligned
-     * @param min  minimum value
-     *             constraints: must be in the range [-(1 << 24), 1 << 24]
-     * @param max  maximum value
-     *             constraints: must be in the range [-(1 << 24), 1 << 24]
-     * @param len  number of elements in the array
-     *             constraints: multiple of 32 greater than zero
-     */
-    void (*vector_clip_int32)(int32_t *dst, const int32_t *src, int32_t min,
-                              int32_t max, unsigned int len);
-
-    op_fill_func fill_block_tab[2];
-} DSPContext;
-
-void ff_dsputil_static_init(void);
-void ff_dsputil_init(DSPContext* p, AVCodecContext *avctx);
-
-int ff_check_alignment(void);
-
-void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);
-
-void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_x86(DSPContext* c, AVCodecContext *avctx);
-
-#endif /* AVCODEC_DSPUTIL_H */
diff --git a/deps/libav/libavcodec/dsputil_template.c b/deps/libav/libavcodec/dsputil_template.c
deleted file mode 100644
index 3a6d27f..0000000
--- a/deps/libav/libavcodec/dsputil_template.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * DSP utils
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * gmc & q-pel & 32/64 bit based MC by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DSP utils
- */
-
-#include "bit_depth_template.c"
-
-#if BIT_DEPTH == 8
-/* draw the edges of width 'w' of an image of size width, height */
-//FIXME check that this is ok for mpeg4 interlaced
-static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, int w, int h, int sides)
-{
-    pixel *buf = (pixel*)_buf;
-    int wrap = _wrap / sizeof(pixel);
-    pixel *ptr, *last_line;
-    int i;
-
-    /* left and right */
-    ptr = buf;
-    for(i=0;i<height;i++) {
-        memset(ptr - w, ptr[0], w);
-        memset(ptr + width, ptr[width-1], w);
-        ptr += wrap;
-    }
-
-    /* top and bottom + corners */
-    buf -= w;
-    last_line = buf + (height - 1) * wrap;
-    if (sides & EDGE_TOP)
-        for(i = 0; i < h; i++)
-            memcpy(buf - (i + 1) * wrap, buf, (width + w + w) * sizeof(pixel)); // top
-    if (sides & EDGE_BOTTOM)
-        for (i = 0; i < h; i++)
-            memcpy(last_line + (i + 1) * wrap, last_line, (width + w + w) * sizeof(pixel)); // bottom
-}
-#endif
-
-static void FUNCC(get_pixels)(int16_t *restrict block,
-                              const uint8_t *_pixels,
-                              int line_size)
-{
-    const pixel *pixels = (const pixel *) _pixels;
-    int i;
-
-    /* read the pixels */
-    for(i=0;i<8;i++) {
-        block[0] = pixels[0];
-        block[1] = pixels[1];
-        block[2] = pixels[2];
-        block[3] = pixels[3];
-        block[4] = pixels[4];
-        block[5] = pixels[5];
-        block[6] = pixels[6];
-        block[7] = pixels[7];
-        pixels += line_size / sizeof(pixel);
-        block += 8;
-    }
-}
-
-#if BIT_DEPTH == 8
-static void FUNCC(clear_block)(int16_t *block)
-{
-    memset(block, 0, sizeof(int16_t)*64);
-}
-
-static void FUNCC(clear_blocks)(int16_t *blocks)
-{
-    memset(blocks, 0, sizeof(int16_t)*6*64);
-}
-#endif
-
-#if BIT_DEPTH == 8
-#include "hpel_template.c"
-#endif
-
-#define PIXOP2(OPNAME, OP) \
-static inline void FUNC(OPNAME ## _no_rnd_pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
-                                                int src_stride1, int src_stride2, int h){\
-    int i;\
-    for(i=0; i<h; i++){\
-        pixel4 a,b;\
-        a= AV_RN4P(&src1[i*src_stride1  ]);\
-        b= AV_RN4P(&src2[i*src_stride2  ]);\
-        OP(*((pixel4*)&dst[i*dst_stride  ]), no_rnd_avg_pixel4(a, b));\
-        a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
-        b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
-        OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), no_rnd_avg_pixel4(a, b));\
-    }\
-}\
-\
-static inline void FUNC(OPNAME ## _no_rnd_pixels16_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
-                                                int src_stride1, int src_stride2, int h){\
-    FUNC(OPNAME ## _no_rnd_pixels8_l2)(dst  , src1  , src2  , dst_stride, src_stride1, src_stride2, h);\
-    FUNC(OPNAME ## _no_rnd_pixels8_l2)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, h);\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels8_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
-                 int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
-    /* FIXME HIGH BIT DEPTH */\
-    int i;\
-    for(i=0; i<h; i++){\
-        uint32_t a, b, c, d, l0, l1, h0, h1;\
-        a= AV_RN32(&src1[i*src_stride1]);\
-        b= AV_RN32(&src2[i*src_stride2]);\
-        c= AV_RN32(&src3[i*src_stride3]);\
-        d= AV_RN32(&src4[i*src_stride4]);\
-        l0=  (a&0x03030303UL)\
-           + (b&0x03030303UL)\
-           + 0x02020202UL;\
-        h0= ((a&0xFCFCFCFCUL)>>2)\
-          + ((b&0xFCFCFCFCUL)>>2);\
-        l1=  (c&0x03030303UL)\
-           + (d&0x03030303UL);\
-        h1= ((c&0xFCFCFCFCUL)>>2)\
-          + ((d&0xFCFCFCFCUL)>>2);\
-        OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-        a= AV_RN32(&src1[i*src_stride1+4]);\
-        b= AV_RN32(&src2[i*src_stride2+4]);\
-        c= AV_RN32(&src3[i*src_stride3+4]);\
-        d= AV_RN32(&src4[i*src_stride4+4]);\
-        l0=  (a&0x03030303UL)\
-           + (b&0x03030303UL)\
-           + 0x02020202UL;\
-        h0= ((a&0xFCFCFCFCUL)>>2)\
-          + ((b&0xFCFCFCFCUL)>>2);\
-        l1=  (c&0x03030303UL)\
-           + (d&0x03030303UL);\
-        h1= ((c&0xFCFCFCFCUL)>>2)\
-          + ((d&0xFCFCFCFCUL)>>2);\
-        OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-    }\
-}\
-\
-static inline void FUNC(OPNAME ## _no_rnd_pixels8_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
-                 int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
-    /* FIXME HIGH BIT DEPTH*/\
-    int i;\
-    for(i=0; i<h; i++){\
-        uint32_t a, b, c, d, l0, l1, h0, h1;\
-        a= AV_RN32(&src1[i*src_stride1]);\
-        b= AV_RN32(&src2[i*src_stride2]);\
-        c= AV_RN32(&src3[i*src_stride3]);\
-        d= AV_RN32(&src4[i*src_stride4]);\
-        l0=  (a&0x03030303UL)\
-           + (b&0x03030303UL)\
-           + 0x01010101UL;\
-        h0= ((a&0xFCFCFCFCUL)>>2)\
-          + ((b&0xFCFCFCFCUL)>>2);\
-        l1=  (c&0x03030303UL)\
-           + (d&0x03030303UL);\
-        h1= ((c&0xFCFCFCFCUL)>>2)\
-          + ((d&0xFCFCFCFCUL)>>2);\
-        OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-        a= AV_RN32(&src1[i*src_stride1+4]);\
-        b= AV_RN32(&src2[i*src_stride2+4]);\
-        c= AV_RN32(&src3[i*src_stride3+4]);\
-        d= AV_RN32(&src4[i*src_stride4+4]);\
-        l0=  (a&0x03030303UL)\
-           + (b&0x03030303UL)\
-           + 0x01010101UL;\
-        h0= ((a&0xFCFCFCFCUL)>>2)\
-          + ((b&0xFCFCFCFCUL)>>2);\
-        l1=  (c&0x03030303UL)\
-           + (d&0x03030303UL);\
-        h1= ((c&0xFCFCFCFCUL)>>2)\
-          + ((d&0xFCFCFCFCUL)>>2);\
-        OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-    }\
-}\
-static inline void FUNC(OPNAME ## _pixels16_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
-                 int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
-    FUNC(OPNAME ## _pixels8_l4)(dst  , src1  , src2  , src3  , src4  , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
-    FUNC(OPNAME ## _pixels8_l4)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), src3+8*sizeof(pixel), src4+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
-}\
-static inline void FUNC(OPNAME ## _no_rnd_pixels16_l4)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, const uint8_t *src4,\
-                 int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
-    FUNC(OPNAME ## _no_rnd_pixels8_l4)(dst  , src1  , src2  , src3  , src4  , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
-    FUNC(OPNAME ## _no_rnd_pixels8_l4)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), src3+8*sizeof(pixel), src4+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\
-{\
-    /* FIXME HIGH BIT DEPTH */\
-    int j;\
-    for(j=0; j<2; j++){\
-        int i;\
-        const uint32_t a= AV_RN32(pixels  );\
-        const uint32_t b= AV_RN32(pixels+1);\
-        uint32_t l0=  (a&0x03030303UL)\
-                    + (b&0x03030303UL)\
-                    + 0x02020202UL;\
-        uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
-                   + ((b&0xFCFCFCFCUL)>>2);\
-        uint32_t l1,h1;\
-\
-        pixels+=line_size;\
-        for(i=0; i<h; i+=2){\
-            uint32_t a= AV_RN32(pixels  );\
-            uint32_t b= AV_RN32(pixels+1);\
-            l1=  (a&0x03030303UL)\
-               + (b&0x03030303UL);\
-            h1= ((a&0xFCFCFCFCUL)>>2)\
-              + ((b&0xFCFCFCFCUL)>>2);\
-            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-            pixels+=line_size;\
-            block +=line_size;\
-            a= AV_RN32(pixels  );\
-            b= AV_RN32(pixels+1);\
-            l0=  (a&0x03030303UL)\
-               + (b&0x03030303UL)\
-               + 0x02020202UL;\
-            h0= ((a&0xFCFCFCFCUL)>>2)\
-              + ((b&0xFCFCFCFCUL)>>2);\
-            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-            pixels+=line_size;\
-            block +=line_size;\
-        }\
-        pixels+=4-line_size*(h+1);\
-        block +=4-line_size*h;\
-    }\
-}\
-\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_xy2), FUNCC(OPNAME ## _pixels8_xy2), 8*sizeof(pixel))\
-
-#define op_avg(a, b) a = rnd_avg_pixel4(a, b)
-#define op_put(a, b) a = b
-#if BIT_DEPTH == 8
-#define put_no_rnd_pixels8_8_c put_pixels8_8_c
-PIXOP2(avg, op_avg)
-PIXOP2(put, op_put)
-#endif
-#undef op_avg
-#undef op_put
diff --git a/deps/libav/libavcodec/dump_extradata_bsf.c b/deps/libav/libavcodec/dump_extradata_bsf.c
deleted file mode 100644
index 17d9434..0000000
--- a/deps/libav/libavcodec/dump_extradata_bsf.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "avcodec.h"
-#include "libavutil/mem.h"
-
-
-static int dump_extradata(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe){
-    int cmd= args ? *args : 0;
-    /* cast to avoid warning about discarding qualifiers */
-    if(avctx->extradata){
-        if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER) && cmd=='a')
-           ||(keyframe && (cmd=='k' || !cmd))
-           ||(cmd=='e')
-            /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
-            int size= buf_size + avctx->extradata_size;
-            *poutbuf_size= size;
-            *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-
-            memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
-            memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-            return 1;
-        }
-    }
-    return 0;
-}
-
-AVBitStreamFilter ff_dump_extradata_bsf={
-    "dump_extra",
-    0,
-    dump_extradata,
-};
diff --git a/deps/libav/libavcodec/dv.c b/deps/libav/libavcodec/dv.c
deleted file mode 100644
index a6f614a..0000000
--- a/deps/libav/libavcodec/dv.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * DV decoder
- * Copyright (c) 2002 Fabrice Bellard
- * Copyright (c) 2004 Roman Shaposhnik
- *
- * DV encoder
- * Copyright (c) 2003 Roman Shaposhnik
- *
- * 50 Mbps (DVCPRO50) support
- * Copyright (c) 2006 Daniel Maas <dmaas at maasdigital.com>
- *
- * 100 Mbps (DVCPRO HD) support
- * Initial code by Daniel Maas <dmaas at maasdigital.com> (funded by BBC R&D)
- * Final code by Roman Shaposhnik
- *
- * Many thanks to Dan Dennedy <dan at dennedy.org> for providing wealth
- * of DV technical info.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DV codec.
- */
-
-#include "libavutil/internal.h"
-#include "libavutil/pixdesc.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "put_bits.h"
-#include "simple_idct.h"
-#include "dvdata.h"
-#include "dv.h"
-
-/* XXX: also include quantization */
-RL_VLC_ELEM ff_dv_rl_vlc[1184];
-
-static inline void dv_calc_mb_coordinates(const DVprofile *d, int chan, int seq, int slot,
-                                          uint16_t *tbl)
-{
-    static const uint8_t off[] = { 2, 6, 8, 0, 4 };
-    static const uint8_t shuf1[] = { 36, 18, 54, 0, 72 };
-    static const uint8_t shuf2[] = { 24, 12, 36, 0, 48 };
-    static const uint8_t shuf3[] = { 18, 9, 27, 0, 36 };
-
-    static const uint8_t l_start[] = {0, 4, 9, 13, 18, 22, 27, 31, 36, 40};
-    static const uint8_t l_start_shuffled[] = { 9, 4, 13, 0, 18 };
-
-    static const uint8_t serpent1[] = {0, 1, 2, 2, 1, 0,
-                                       0, 1, 2, 2, 1, 0,
-                                       0, 1, 2, 2, 1, 0,
-                                       0, 1, 2, 2, 1, 0,
-                                       0, 1, 2};
-    static const uint8_t serpent2[] = {0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0,
-                                       0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0,
-                                       0, 1, 2, 3, 4, 5};
-
-    static const uint8_t remap[][2] = {{ 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, /* dummy */
-                                       { 0, 0}, { 0, 1}, { 0, 2}, { 0, 3}, {10, 0},
-                                       {10, 1}, {10, 2}, {10, 3}, {20, 0}, {20, 1},
-                                       {20, 2}, {20, 3}, {30, 0}, {30, 1}, {30, 2},
-                                       {30, 3}, {40, 0}, {40, 1}, {40, 2}, {40, 3},
-                                       {50, 0}, {50, 1}, {50, 2}, {50, 3}, {60, 0},
-                                       {60, 1}, {60, 2}, {60, 3}, {70, 0}, {70, 1},
-                                       {70, 2}, {70, 3}, { 0,64}, { 0,65}, { 0,66},
-                                       {10,64}, {10,65}, {10,66}, {20,64}, {20,65},
-                                       {20,66}, {30,64}, {30,65}, {30,66}, {40,64},
-                                       {40,65}, {40,66}, {50,64}, {50,65}, {50,66},
-                                       {60,64}, {60,65}, {60,66}, {70,64}, {70,65},
-                                       {70,66}, { 0,67}, {20,67}, {40,67}, {60,67}};
-
-    int i, k, m;
-    int x, y, blk;
-
-    for (m=0; m<5; m++) {
-         switch (d->width) {
-         case 1440:
-              blk = (chan*11+seq)*27+slot;
-
-              if (chan == 0 && seq == 11) {
-                  x = m*27+slot;
-                  if (x<90) {
-                      y = 0;
-                  } else {
-                      x = (x - 90)*2;
-                      y = 67;
-                  }
-              } else {
-                  i = (4*chan + blk + off[m])%11;
-                  k = (blk/11)%27;
-
-                  x = shuf1[m] + (chan&1)*9 + k%9;
-                  y = (i*3+k/9)*2 + (chan>>1) + 1;
-              }
-              tbl[m] = (x<<1)|(y<<9);
-              break;
-         case 1280:
-              blk = (chan*10+seq)*27+slot;
-
-              i = (4*chan + (seq/5) + 2*blk + off[m])%10;
-              k = (blk/5)%27;
-
-              x = shuf1[m]+(chan&1)*9 + k%9;
-              y = (i*3+k/9)*2 + (chan>>1) + 4;
-
-              if (x >= 80) {
-                  x = remap[y][0]+((x-80)<<(y>59));
-                  y = remap[y][1];
-              }
-              tbl[m] = (x<<1)|(y<<9);
-              break;
-       case 960:
-              blk = (chan*10+seq)*27+slot;
-
-              i = (4*chan + (seq/5) + 2*blk + off[m])%10;
-              k = (blk/5)%27 + (i&1)*3;
-
-              x = shuf2[m] + k%6 + 6*(chan&1);
-              y = l_start[i] + k/6 + 45*(chan>>1);
-              tbl[m] = (x<<1)|(y<<9);
-              break;
-        case 720:
-              switch (d->pix_fmt) {
-              case AV_PIX_FMT_YUV422P:
-                   x = shuf3[m] + slot/3;
-                   y = serpent1[slot] +
-                       ((((seq + off[m]) % d->difseg_size)<<1) + chan)*3;
-                   tbl[m] = (x<<1)|(y<<8);
-                   break;
-              case AV_PIX_FMT_YUV420P:
-                   x = shuf3[m] + slot/3;
-                   y = serpent1[slot] +
-                       ((seq + off[m]) % d->difseg_size)*3;
-                   tbl[m] = (x<<1)|(y<<9);
-                   break;
-              case AV_PIX_FMT_YUV411P:
-                   i = (seq + off[m]) % d->difseg_size;
-                   k = slot + ((m==1||m==2)?3:0);
-
-                   x = l_start_shuffled[m] + k/6;
-                   y = serpent2[k] + i*6;
-                   if (x>21)
-                       y = y*2 - i*6;
-                   tbl[m] = (x<<2)|(y<<8);
-                   break;
-              }
-        default:
-              break;
-        }
-    }
-}
-
-/* quantization quanta by QNO for DV100 */
-static const uint8_t dv100_qstep[16] = {
-    1, /* QNO = 0 and 1 both have no quantization */
-    1,
-    2, 3, 4, 5, 6, 7, 8, 16, 18, 20, 22, 24, 28, 52
-};
-
-static const uint8_t dv_quant_areas[4]  = { 6, 21, 43, 64 };
-
-int ff_dv_init_dynamic_tables(const DVprofile *d)
-{
-    int j,i,c,s,p;
-    uint32_t *factor1, *factor2;
-    const int *iweight1, *iweight2;
-
-    if (!d->work_chunks[dv_work_pool_size(d)-1].buf_offset) {
-        p = i = 0;
-        for (c=0; c<d->n_difchan; c++) {
-            for (s=0; s<d->difseg_size; s++) {
-                p += 6;
-                for (j=0; j<27; j++) {
-                    p += !(j%3);
-                    if (!(DV_PROFILE_IS_1080i50(d) && c != 0 && s == 11) &&
-                        !(DV_PROFILE_IS_720p50(d) && s > 9)) {
-                          dv_calc_mb_coordinates(d, c, s, j, &d->work_chunks[i].mb_coordinates[0]);
-                          d->work_chunks[i++].buf_offset = p;
-                    }
-                    p += 5;
-                }
-            }
-        }
-    }
-
-    if (!d->idct_factor[DV_PROFILE_IS_HD(d)?8191:5631]) {
-        factor1 = &d->idct_factor[0];
-        factor2 = &d->idct_factor[DV_PROFILE_IS_HD(d)?4096:2816];
-        if (d->height == 720) {
-            iweight1 = &ff_dv_iweight_720_y[0];
-            iweight2 = &ff_dv_iweight_720_c[0];
-        } else {
-            iweight1 = &ff_dv_iweight_1080_y[0];
-            iweight2 = &ff_dv_iweight_1080_c[0];
-        }
-        if (DV_PROFILE_IS_HD(d)) {
-            for (c = 0; c < 4; c++) {
-                for (s = 0; s < 16; s++) {
-                    for (i = 0; i < 64; i++) {
-                        *factor1++ = (dv100_qstep[s] << (c + 9)) * iweight1[i];
-                        *factor2++ = (dv100_qstep[s] << (c + 9)) * iweight2[i];
-                    }
-                }
-            }
-        } else {
-            iweight1 = &ff_dv_iweight_88[0];
-            for (j = 0; j < 2; j++, iweight1 = &ff_dv_iweight_248[0]) {
-                for (s = 0; s < 22; s++) {
-                    for (i = c = 0; c < 4; c++) {
-                        for (; i < dv_quant_areas[c]; i++) {
-                            *factor1   = iweight1[i] << (ff_dv_quant_shifts[s][c] + 1);
-                            *factor2++ = (*factor1++) << 1;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    return 0;
-}
-
-av_cold int ff_dvvideo_init(AVCodecContext *avctx)
-{
-    DVVideoContext *s = avctx->priv_data;
-    DSPContext dsp;
-    static int done = 0;
-    int i, j;
-
-    if (!done) {
-        VLC dv_vlc;
-        uint16_t new_dv_vlc_bits[NB_DV_VLC*2];
-        uint8_t  new_dv_vlc_len[NB_DV_VLC*2];
-        uint8_t  new_dv_vlc_run[NB_DV_VLC*2];
-        int16_t  new_dv_vlc_level[NB_DV_VLC*2];
-
-        done = 1;
-
-        /* it's faster to include sign bit in a generic VLC parsing scheme */
-        for (i = 0, j = 0; i < NB_DV_VLC; i++, j++) {
-            new_dv_vlc_bits[j]  = ff_dv_vlc_bits[i];
-            new_dv_vlc_len[j]   = ff_dv_vlc_len[i];
-            new_dv_vlc_run[j]   = ff_dv_vlc_run[i];
-            new_dv_vlc_level[j] = ff_dv_vlc_level[i];
-
-            if (ff_dv_vlc_level[i]) {
-                new_dv_vlc_bits[j] <<= 1;
-                new_dv_vlc_len[j]++;
-
-                j++;
-                new_dv_vlc_bits[j]  = (ff_dv_vlc_bits[i] << 1) | 1;
-                new_dv_vlc_len[j]   =  ff_dv_vlc_len[i] + 1;
-                new_dv_vlc_run[j]   =  ff_dv_vlc_run[i];
-                new_dv_vlc_level[j] = -ff_dv_vlc_level[i];
-            }
-        }
-
-        /* NOTE: as a trick, we use the fact the no codes are unused
-           to accelerate the parsing of partial codes */
-        init_vlc(&dv_vlc, TEX_VLC_BITS, j,
-                 new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2, 0);
-        assert(dv_vlc.table_size == 1184);
-
-        for (i = 0; i < dv_vlc.table_size; i++){
-            int code = dv_vlc.table[i][0];
-            int len  = dv_vlc.table[i][1];
-            int level, run;
-
-            if (len < 0){ //more bits needed
-                run   = 0;
-                level = code;
-            } else {
-                run   = new_dv_vlc_run  [code] + 1;
-                level = new_dv_vlc_level[code];
-            }
-            ff_dv_rl_vlc[i].len   = len;
-            ff_dv_rl_vlc[i].level = level;
-            ff_dv_rl_vlc[i].run   = run;
-        }
-        ff_free_vlc(&dv_vlc);
-    }
-
-    /* Generic DSP setup */
-    ff_dsputil_init(&dsp, avctx);
-    ff_set_cmp(&dsp, dsp.ildct_cmp, avctx->ildct_cmp);
-    s->get_pixels = dsp.get_pixels;
-    s->ildct_cmp = dsp.ildct_cmp[5];
-
-    /* 88DCT setup */
-    s->fdct[0]     = dsp.fdct;
-    s->idct_put[0] = dsp.idct_put;
-    for (i = 0; i < 64; i++)
-       s->dv_zigzag[0][i] = dsp.idct_permutation[ff_zigzag_direct[i]];
-
-    /* 248DCT setup */
-    s->fdct[1]     = dsp.fdct248;
-    s->idct_put[1] = ff_simple_idct248_put;  // FIXME: need to add it to DSP
-    memcpy(s->dv_zigzag[1], ff_zigzag248_direct, 64);
-
-    s->avctx = avctx;
-    avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/dv.h b/deps/libav/libavcodec/dv.h
deleted file mode 100644
index 01a4eec..0000000
--- a/deps/libav/libavcodec/dv.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Constants for DV codec
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Constants for DV codec.
- */
-
-#ifndef AVCODEC_DV_H
-#define AVCODEC_DV_H
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "dv_profile.h"
-
-typedef struct DVVideoContext {
-    const DVprofile *sys;
-    AVFrame         *frame;
-    AVCodecContext  *avctx;
-    uint8_t         *buf;
-
-    uint8_t  dv_zigzag[2][64];
-
-    void (*get_pixels)(int16_t *block, const uint8_t *pixels, int line_size);
-    void (*fdct[2])(int16_t *block);
-    void (*idct_put[2])(uint8_t *dest, int line_size, int16_t *block);
-    me_cmp_func ildct_cmp;
-} DVVideoContext;
-
-enum dv_section_type {
-     dv_sect_header  = 0x1f,
-     dv_sect_subcode = 0x3f,
-     dv_sect_vaux    = 0x56,
-     dv_sect_audio   = 0x76,
-     dv_sect_video   = 0x96,
-};
-
-enum dv_pack_type {
-     dv_header525     = 0x3f, /* see dv_write_pack for important details on */
-     dv_header625     = 0xbf, /* these two packs */
-     dv_timecode      = 0x13,
-     dv_audio_source  = 0x50,
-     dv_audio_control = 0x51,
-     dv_audio_recdate = 0x52,
-     dv_audio_rectime = 0x53,
-     dv_video_source  = 0x60,
-     dv_video_control = 0x61,
-     dv_video_recdate = 0x62,
-     dv_video_rectime = 0x63,
-     dv_unknown_pack  = 0xff,
-};
-
-#define DV_PROFILE_IS_HD(p) ((p)->video_stype & 0x10)
-#define DV_PROFILE_IS_1080i50(p) (((p)->video_stype == 0x14) && ((p)->dsf == 1))
-#define DV_PROFILE_IS_720p50(p)  (((p)->video_stype == 0x18) && ((p)->dsf == 1))
-
-/* minimum number of bytes to read from a DV stream in order to
-   determine the profile */
-#define DV_PROFILE_BYTES (6*80) /* 6 DIF blocks */
-
-/**
- * largest possible DV frame, in bytes (1080i50)
- */
-#define DV_MAX_FRAME_SIZE 576000
-
-/**
- * maximum number of blocks per macroblock in any DV format
- */
-#define DV_MAX_BPM 8
-
-#define TEX_VLC_BITS 9
-
-extern RL_VLC_ELEM ff_dv_rl_vlc[1184];
-
-int ff_dv_init_dynamic_tables(const DVprofile *d);
-int ff_dvvideo_init(AVCodecContext *avctx);
-
-static inline int dv_work_pool_size(const DVprofile *d)
-{
-    int size = d->n_difchan*d->difseg_size*27;
-    if (DV_PROFILE_IS_1080i50(d))
-        size -= 3*27;
-    if (DV_PROFILE_IS_720p50(d))
-        size -= 4*27;
-    return size;
-}
-
-static inline void dv_calculate_mb_xy(DVVideoContext *s, DVwork_chunk *work_chunk, int m, int *mb_x, int *mb_y)
-{
-     *mb_x = work_chunk->mb_coordinates[m] & 0xff;
-     *mb_y = work_chunk->mb_coordinates[m] >> 8;
-
-     /* We work with 720p frames split in half. The odd half-frame (chan==2,3) is displaced :-( */
-     if (s->sys->height == 720 && !(s->buf[1]&0x0C)) {
-         *mb_y -= (*mb_y>17)?18:-72; /* shifting the Y coordinate down by 72/2 macro blocks */
-     }
-}
-
-#endif /* AVCODEC_DV_H */
diff --git a/deps/libav/libavcodec/dv_profile.c b/deps/libav/libavcodec/dv_profile.c
deleted file mode 100644
index be392bb..0000000
--- a/deps/libav/libavcodec/dv_profile.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "libavutil/log.h"
-#include "libavutil/pixdesc.h"
-#include "avcodec.h"
-#include "dv_profile.h"
-
-static DVwork_chunk work_chunks_dv25pal   [1*12*27];
-static DVwork_chunk work_chunks_dv25pal411[1*12*27];
-static DVwork_chunk work_chunks_dv25ntsc  [1*10*27];
-static DVwork_chunk work_chunks_dv50pal   [2*12*27];
-static DVwork_chunk work_chunks_dv50ntsc  [2*10*27];
-static DVwork_chunk work_chunks_dv100palp [2*12*27];
-static DVwork_chunk work_chunks_dv100ntscp[2*10*27];
-static DVwork_chunk work_chunks_dv100pali [4*12*27];
-static DVwork_chunk work_chunks_dv100ntsci[4*10*27];
-
-static uint32_t dv_idct_factor_sd    [2*2*22*64];
-static uint32_t dv_idct_factor_hd1080[2*4*16*64];
-static uint32_t dv_idct_factor_hd720 [2*4*16*64];
-
-static const uint8_t dv_audio_shuffle525[10][9] = {
-  {  0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */
-  {  6, 36, 66, 26, 56, 86, 16, 46, 76 },
-  { 12, 42, 72,  2, 32, 62, 22, 52, 82 },
-  { 18, 48, 78,  8, 38, 68, 28, 58, 88 },
-  { 24, 54, 84, 14, 44, 74,  4, 34, 64 },
-
-  {  1, 31, 61, 21, 51, 81, 11, 41, 71 }, /* 2nd channel */
-  {  7, 37, 67, 27, 57, 87, 17, 47, 77 },
-  { 13, 43, 73,  3, 33, 63, 23, 53, 83 },
-  { 19, 49, 79,  9, 39, 69, 29, 59, 89 },
-  { 25, 55, 85, 15, 45, 75,  5, 35, 65 },
-};
-
-static const uint8_t dv_audio_shuffle625[12][9] = {
-  {   0,  36,  72,  26,  62,  98,  16,  52,  88}, /* 1st channel */
-  {   6,  42,  78,  32,  68, 104,  22,  58,  94},
-  {  12,  48,  84,   2,  38,  74,  28,  64, 100},
-  {  18,  54,  90,   8,  44,  80,  34,  70, 106},
-  {  24,  60,  96,  14,  50,  86,   4,  40,  76},
-  {  30,  66, 102,  20,  56,  92,  10,  46,  82},
-
-  {   1,  37,  73,  27,  63,  99,  17,  53,  89}, /* 2nd channel */
-  {   7,  43,  79,  33,  69, 105,  23,  59,  95},
-  {  13,  49,  85,   3,  39,  75,  29,  65, 101},
-  {  19,  55,  91,   9,  45,  81,  35,  71, 107},
-  {  25,  61,  97,  15,  51,  87,   5,  41,  77},
-  {  31,  67, 103,  21,  57,  93,  11,  47,  83},
-};
-
-/* macroblock bit budgets */
-static const uint8_t block_sizes_dv2550[8] = {
-    112, 112, 112, 112, 80, 80, 0, 0,
-};
-
-static const uint8_t block_sizes_dv100[8] = {
-    80, 80, 80, 80, 80, 80, 64, 64,
-};
-
-static const DVprofile dv_profiles[] = {
-    { .dsf = 0,
-      .video_stype = 0x0,
-      .frame_size = 120000,        /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */
-      .difseg_size = 10,
-      .n_difchan = 1,
-      .time_base = { 1001, 30000 },
-      .ltc_divisor = 30,
-      .height = 480,
-      .width = 720,
-      .sar = {{8, 9}, {32, 27}},
-      .work_chunks = &work_chunks_dv25ntsc[0],
-      .idct_factor = &dv_idct_factor_sd[0],
-      .pix_fmt = AV_PIX_FMT_YUV411P,
-      .bpm = 6,
-      .block_sizes = block_sizes_dv2550,
-      .audio_stride = 90,
-      .audio_min_samples  = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
-      .audio_shuffle = dv_audio_shuffle525,
-    },
-    { .dsf = 1,
-      .video_stype = 0x0,
-      .frame_size = 144000,        /* IEC 61834 - 625/50 (PAL) */
-      .difseg_size = 12,
-      .n_difchan = 1,
-      .time_base = { 1, 25 },
-      .ltc_divisor = 25,
-      .height = 576,
-      .width = 720,
-      .sar = {{16, 15}, {64, 45}},
-      .work_chunks = &work_chunks_dv25pal[0],
-      .idct_factor = &dv_idct_factor_sd[0],
-      .pix_fmt = AV_PIX_FMT_YUV420P,
-      .bpm = 6,
-      .block_sizes = block_sizes_dv2550,
-      .audio_stride = 108,
-      .audio_min_samples  = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
-      .audio_shuffle = dv_audio_shuffle625,
-    },
-    { .dsf = 1,
-      .video_stype = 0x0,
-      .frame_size = 144000,        /* SMPTE-314M - 625/50 (PAL) */
-      .difseg_size = 12,
-      .n_difchan = 1,
-      .time_base = { 1, 25 },
-      .ltc_divisor = 25,
-      .height = 576,
-      .width = 720,
-      .sar = {{16, 15}, {64, 45}},
-      .work_chunks = &work_chunks_dv25pal411[0],
-      .idct_factor = &dv_idct_factor_sd[0],
-      .pix_fmt = AV_PIX_FMT_YUV411P,
-      .bpm = 6,
-      .block_sizes = block_sizes_dv2550,
-      .audio_stride = 108,
-      .audio_min_samples  = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
-      .audio_shuffle = dv_audio_shuffle625,
-    },
-    { .dsf = 0,
-      .video_stype = 0x4,
-      .frame_size = 240000,        /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */
-      .difseg_size = 10,           /* also known as "DVCPRO50" */
-      .n_difchan = 2,
-      .time_base = { 1001, 30000 },
-      .ltc_divisor = 30,
-      .height = 480,
-      .width = 720,
-      .sar = {{8, 9}, {32, 27}},
-      .work_chunks = &work_chunks_dv50ntsc[0],
-      .idct_factor = &dv_idct_factor_sd[0],
-      .pix_fmt = AV_PIX_FMT_YUV422P,
-      .bpm = 6,
-      .block_sizes = block_sizes_dv2550,
-      .audio_stride = 90,
-      .audio_min_samples  = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
-      .audio_shuffle = dv_audio_shuffle525,
-    },
-    { .dsf = 1,
-      .video_stype = 0x4,
-      .frame_size = 288000,        /* SMPTE-314M - 625/50 (PAL) 50 Mbps */
-      .difseg_size = 12,           /* also known as "DVCPRO50" */
-      .n_difchan = 2,
-      .time_base = { 1, 25 },
-      .ltc_divisor = 25,
-      .height = 576,
-      .width = 720,
-      .sar = {{16, 15}, {64, 45}},
-      .work_chunks = &work_chunks_dv50pal[0],
-      .idct_factor = &dv_idct_factor_sd[0],
-      .pix_fmt = AV_PIX_FMT_YUV422P,
-      .bpm = 6,
-      .block_sizes = block_sizes_dv2550,
-      .audio_stride = 108,
-      .audio_min_samples  = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
-      .audio_shuffle = dv_audio_shuffle625,
-    },
-    { .dsf = 0,
-      .video_stype = 0x14,
-      .frame_size = 480000,        /* SMPTE-370M - 1080i60 100 Mbps */
-      .difseg_size = 10,           /* also known as "DVCPRO HD" */
-      .n_difchan = 4,
-      .time_base = { 1001, 30000 },
-      .ltc_divisor = 30,
-      .height = 1080,
-      .width = 1280,
-      .sar = {{1, 1}, {3, 2}},
-      .work_chunks = &work_chunks_dv100ntsci[0],
-      .idct_factor = &dv_idct_factor_hd1080[0],
-      .pix_fmt = AV_PIX_FMT_YUV422P,
-      .bpm = 8,
-      .block_sizes = block_sizes_dv100,
-      .audio_stride = 90,
-      .audio_min_samples  = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
-      .audio_shuffle = dv_audio_shuffle525,
-    },
-    { .dsf = 1,
-      .video_stype = 0x14,
-      .frame_size = 576000,        /* SMPTE-370M - 1080i50 100 Mbps */
-      .difseg_size = 12,           /* also known as "DVCPRO HD" */
-      .n_difchan = 4,
-      .time_base = { 1, 25 },
-      .ltc_divisor = 25,
-      .height = 1080,
-      .width = 1440,
-      .sar = {{1, 1}, {4, 3}},
-      .work_chunks = &work_chunks_dv100pali[0],
-      .idct_factor = &dv_idct_factor_hd1080[0],
-      .pix_fmt = AV_PIX_FMT_YUV422P,
-      .bpm = 8,
-      .block_sizes = block_sizes_dv100,
-      .audio_stride = 108,
-      .audio_min_samples  = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
-      .audio_shuffle = dv_audio_shuffle625,
-    },
-    { .dsf = 0,
-      .video_stype = 0x18,
-      .frame_size = 240000,        /* SMPTE-370M - 720p60 100 Mbps */
-      .difseg_size = 10,           /* also known as "DVCPRO HD" */
-      .n_difchan = 2,
-      .time_base = { 1001, 60000 },
-      .ltc_divisor = 60,
-      .height = 720,
-      .width = 960,
-      .sar = {{1, 1}, {4, 3}},
-      .work_chunks = &work_chunks_dv100ntscp[0],
-      .idct_factor = &dv_idct_factor_hd720[0],
-      .pix_fmt = AV_PIX_FMT_YUV422P,
-      .bpm = 8,
-      .block_sizes = block_sizes_dv100,
-      .audio_stride = 90,
-      .audio_min_samples  = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
-      .audio_shuffle = dv_audio_shuffle525,
-    },
-    { .dsf = 1,
-      .video_stype = 0x18,
-      .frame_size = 288000,        /* SMPTE-370M - 720p50 100 Mbps */
-      .difseg_size = 12,           /* also known as "DVCPRO HD" */
-      .n_difchan = 2,
-      .time_base = { 1, 50 },
-      .ltc_divisor = 50,
-      .height = 720,
-      .width = 960,
-      .sar = {{1, 1}, {4, 3}},
-      .work_chunks = &work_chunks_dv100palp[0],
-      .idct_factor = &dv_idct_factor_hd720[0],
-      .pix_fmt = AV_PIX_FMT_YUV422P,
-      .bpm = 8,
-      .block_sizes = block_sizes_dv100,
-      .audio_stride = 90,
-      .audio_min_samples  = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
-      .audio_shuffle = dv_audio_shuffle625,
-    },
-    { .dsf = 1,
-      .video_stype = 0x1,
-      .frame_size = 144000,        /* IEC 61883-5 - 625/50 (PAL) */
-      .difseg_size = 12,
-      .n_difchan = 1,
-      .time_base = { 1, 25 },
-      .ltc_divisor = 25,
-      .height = 576,
-      .width = 720,
-      .sar = {{16, 15}, {64, 45}},
-      .work_chunks = &work_chunks_dv25pal[0],
-      .idct_factor = &dv_idct_factor_sd[0],
-      .pix_fmt = AV_PIX_FMT_YUV420P,
-      .bpm = 6,
-      .block_sizes = block_sizes_dv2550,
-      .audio_stride = 108,
-      .audio_min_samples  = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
-      .audio_shuffle = dv_audio_shuffle625,
-    }
-};
-
-const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys,
-                                  const uint8_t* frame, unsigned buf_size)
-{
-    int i, dsf, stype;
-
-    if (buf_size < 80 * 5 + 48 + 4)
-        return NULL;
-
-    dsf = (frame[3] & 0x80) >> 7;
-    stype = frame[80 * 5 + 48 + 3] & 0x1f;
-
-    /* 576i50 25Mbps 4:1:1 is a special case */
-    if (dsf == 1 && stype == 0 && frame[4] & 0x07 /* the APT field */) {
-        return &dv_profiles[2];
-    }
-
-    for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++)
-        if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)
-            return &dv_profiles[i];
-
-    /* check if old sys matches and assumes corrupted input */
-    if (sys && buf_size == sys->frame_size)
-        return sys;
-
-    return NULL;
-}
-
-const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec)
-{
-    int i;
-
-    for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
-       if (codec->height  == dv_profiles[i].height  &&
-           codec->pix_fmt == dv_profiles[i].pix_fmt &&
-           codec->width   == dv_profiles[i].width)
-               return &dv_profiles[i];
-
-    return NULL;
-}
-
-void ff_dv_print_profiles(void *logctx, int loglevel)
-{
-    int i;
-    for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++) {
-        const DVprofile *p = &dv_profiles[i];
-        av_log(logctx, loglevel, "Frame size: %dx%d; pixel format: %s, "
-               "framerate: %d/%d\n", p->width, p->height, av_get_pix_fmt_name(p->pix_fmt),
-               p->time_base.den, p->time_base.num);
-    }
-}
diff --git a/deps/libav/libavcodec/dv_profile.h b/deps/libav/libavcodec/dv_profile.h
deleted file mode 100644
index c6d2278..0000000
--- a/deps/libav/libavcodec/dv_profile.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DV_PROFILE_H
-#define AVCODEC_DV_PROFILE_H
-
-#include <stdint.h>
-
-#include "libavutil/pixfmt.h"
-#include "libavutil/rational.h"
-#include "avcodec.h"
-
-typedef struct DVwork_chunk {
-    uint16_t  buf_offset;
-    uint16_t  mb_coordinates[5];
-} DVwork_chunk;
-
-/*
- * DVprofile is used to express the differences between various
- * DV flavors. For now it's primarily used for differentiating
- * 525/60 and 625/50, but the plans are to use it for various
- * DV specs as well (e.g. SMPTE314M vs. IEC 61834).
- */
-typedef struct DVprofile {
-    int              dsf;                   /* value of the dsf in the DV header */
-    int              video_stype;           /* stype for VAUX source pack */
-    int              frame_size;            /* total size of one frame in bytes */
-    int              difseg_size;           /* number of DIF segments per DIF channel */
-    int              n_difchan;             /* number of DIF channels per frame */
-    AVRational       time_base;             /* 1/framerate */
-    int              ltc_divisor;           /* FPS from the LTS standpoint */
-    int              height;                /* picture height in pixels */
-    int              width;                 /* picture width in pixels */
-    AVRational       sar[2];                /* sample aspect ratios for 4:3 and 16:9 */
-    DVwork_chunk    *work_chunks;           /* each thread gets its own chunk of frame to work on */
-    uint32_t        *idct_factor;           /* set of iDCT factor tables */
-    enum AVPixelFormat pix_fmt;             /* picture pixel format */
-    int              bpm;                   /* blocks per macroblock */
-    const uint8_t   *block_sizes;           /* AC block sizes, in bits */
-    int              audio_stride;          /* size of audio_shuffle table */
-    int              audio_min_samples[3];  /* min amount of audio samples */
-                                            /* for 48kHz, 44.1kHz and 32kHz */
-    int              audio_samples_dist[5]; /* how many samples are supposed to be */
-                                            /* in each frame in a 5 frames window */
-    const uint8_t  (*audio_shuffle)[9];     /* PCM shuffling table */
-} DVprofile;
-
-const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys,
-                                         const uint8_t* frame, unsigned buf_size);
-const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec);
-
-/**
- *  Print all allowed DV profiles into logctx at specified logging level.
- */
-void ff_dv_print_profiles(void *logctx, int loglevel);
-
-#endif /* AVCODEC_DV_PROFILE_H */
diff --git a/deps/libav/libavcodec/dv_tablegen.c b/deps/libav/libavcodec/dv_tablegen.c
deleted file mode 100644
index 9b2b954..0000000
--- a/deps/libav/libavcodec/dv_tablegen.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Generate a header file for hardcoded DV tables
- *
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#include "dv_tablegen.h"
-#include "tableprint.h"
-#include <inttypes.h>
-
-WRITE_1D_FUNC_ARGV(dv_vlc_pair, 7,
-                   "{0x%"PRIx32", %"PRId8"}", data[i].vlc, data[i].size)
-WRITE_2D_FUNC(dv_vlc_pair)
-
-int main(void)
-{
-    dv_vlc_map_tableinit();
-
-    write_fileheader();
-
-    printf("static const struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE] = {\n");
-    write_dv_vlc_pair_2d_array(dv_vlc_map, DV_VLC_MAP_RUN_SIZE, DV_VLC_MAP_LEV_SIZE);
-    printf("};\n");
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/dv_tablegen.h b/deps/libav/libavcodec/dv_tablegen.h
deleted file mode 100644
index 2f3fd95..0000000
--- a/deps/libav/libavcodec/dv_tablegen.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Header file for hardcoded DV tables
- *
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DV_TABLEGEN_H
-#define AVCODEC_DV_TABLEGEN_H
-
-#include <stdint.h>
-
-#include "dvdata.h"
-
-#if CONFIG_SMALL
-#define DV_VLC_MAP_RUN_SIZE 15
-#define DV_VLC_MAP_LEV_SIZE 23
-#else
-#define DV_VLC_MAP_RUN_SIZE  64
-#define DV_VLC_MAP_LEV_SIZE 512 //FIXME sign was removed so this should be /2 but needs check
-#endif
-
-/* VLC encoding lookup table */
-typedef struct dv_vlc_pair {
-   uint32_t vlc;
-   uint32_t size;
-} dv_vlc_pair;
-
-#if CONFIG_HARDCODED_TABLES
-#define dv_vlc_map_tableinit()
-#include "libavcodec/dv_tables.h"
-#else
-static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE];
-
-static void dv_vlc_map_tableinit(void)
-{
-    int i, j;
-    for (i = 0; i < NB_DV_VLC - 1; i++) {
-       if (ff_dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE)
-           continue;
-#if CONFIG_SMALL
-       if (ff_dv_vlc_level[i] >= DV_VLC_MAP_LEV_SIZE)
-           continue;
-#endif
-
-       if (dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].size != 0)
-           continue;
-
-       dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].vlc  =
-           ff_dv_vlc_bits[i] << (!!ff_dv_vlc_level[i]);
-       dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].size =
-           ff_dv_vlc_len[i] + (!!ff_dv_vlc_level[i]);
-    }
-    for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) {
-#if CONFIG_SMALL
-       for (j = 1; j < DV_VLC_MAP_LEV_SIZE; j++) {
-          if (dv_vlc_map[i][j].size == 0) {
-              dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
-                        (dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
-              dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
-                                      dv_vlc_map[0][j].size;
-          }
-       }
-#else
-       for (j = 1; j < DV_VLC_MAP_LEV_SIZE/2; j++) {
-          if (dv_vlc_map[i][j].size == 0) {
-              dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
-                        (dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
-              dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
-                                      dv_vlc_map[0][j].size;
-          }
-          dv_vlc_map[i][((uint16_t)(-j))&0x1ff].vlc =
-                                        dv_vlc_map[i][j].vlc | 1;
-          dv_vlc_map[i][((uint16_t)(-j))&0x1ff].size =
-                                        dv_vlc_map[i][j].size;
-       }
-#endif
-    }
-}
-#endif /* CONFIG_HARDCODED_TABLES */
-
-#endif /* AVCODEC_DV_TABLEGEN_H */
diff --git a/deps/libav/libavcodec/dvbsub.c b/deps/libav/libavcodec/dvbsub.c
deleted file mode 100644
index de0808f..0000000
--- a/deps/libav/libavcodec/dvbsub.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * DVB subtitle encoding
- * Copyright (c) 2005 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "bytestream.h"
-#include "libavutil/colorspace.h"
-
-typedef struct DVBSubtitleContext {
-    int hide_state;
-    int object_version;
-} DVBSubtitleContext;
-
-#define PUTBITS2(val)\
-{\
-    bitbuf |= (val) << bitcnt;\
-    bitcnt -= 2;\
-    if (bitcnt < 0) {\
-        bitcnt = 6;\
-        *q++ = bitbuf;\
-        bitbuf = 0;\
-    }\
-}
-
-static void dvb_encode_rle2(uint8_t **pq,
-                            const uint8_t *bitmap, int linesize,
-                            int w, int h)
-{
-    uint8_t *q;
-    unsigned int bitbuf;
-    int bitcnt;
-    int x, y, len, x1, v, color;
-
-    q = *pq;
-
-    for(y = 0; y < h; y++) {
-        *q++ = 0x10;
-        bitbuf = 0;
-        bitcnt = 6;
-
-        x = 0;
-        while (x < w) {
-            x1 = x;
-            color = bitmap[x1++];
-            while (x1 < w && bitmap[x1] == color)
-                x1++;
-            len = x1 - x;
-            if (color == 0 && len == 2) {
-                PUTBITS2(0);
-                PUTBITS2(0);
-                PUTBITS2(1);
-            } else if (len >= 3 && len <= 10) {
-                v = len - 3;
-                PUTBITS2(0);
-                PUTBITS2((v >> 2) | 2);
-                PUTBITS2(v & 3);
-                PUTBITS2(color);
-            } else if (len >= 12 && len <= 27) {
-                v = len - 12;
-                PUTBITS2(0);
-                PUTBITS2(0);
-                PUTBITS2(2);
-                PUTBITS2(v >> 2);
-                PUTBITS2(v & 3);
-                PUTBITS2(color);
-            } else if (len >= 29) {
-                /* length = 29 ... 284 */
-                if (len > 284)
-                    len = 284;
-                v = len - 29;
-                PUTBITS2(0);
-                PUTBITS2(0);
-                PUTBITS2(3);
-                PUTBITS2((v >> 6));
-                PUTBITS2((v >> 4) & 3);
-                PUTBITS2((v >> 2) & 3);
-                PUTBITS2(v & 3);
-                PUTBITS2(color);
-            } else {
-                PUTBITS2(color);
-                if (color == 0) {
-                    PUTBITS2(1);
-                }
-                len = 1;
-            }
-            x += len;
-        }
-        /* end of line */
-        PUTBITS2(0);
-        PUTBITS2(0);
-        PUTBITS2(0);
-        if (bitcnt != 6) {
-            *q++ = bitbuf;
-        }
-        *q++ = 0xf0;
-        bitmap += linesize;
-    }
-    *pq = q;
-}
-
-#define PUTBITS4(val)\
-{\
-    bitbuf |= (val) << bitcnt;\
-    bitcnt -= 4;\
-    if (bitcnt < 0) {\
-        bitcnt = 4;\
-        *q++ = bitbuf;\
-        bitbuf = 0;\
-    }\
-}
-
-/* some DVB decoders only implement 4 bits/pixel */
-static void dvb_encode_rle4(uint8_t **pq,
-                            const uint8_t *bitmap, int linesize,
-                            int w, int h)
-{
-    uint8_t *q;
-    unsigned int bitbuf;
-    int bitcnt;
-    int x, y, len, x1, v, color;
-
-    q = *pq;
-
-    for(y = 0; y < h; y++) {
-        *q++ = 0x11;
-        bitbuf = 0;
-        bitcnt = 4;
-
-        x = 0;
-        while (x < w) {
-            x1 = x;
-            color = bitmap[x1++];
-            while (x1 < w && bitmap[x1] == color)
-                x1++;
-            len = x1 - x;
-            if (color == 0 && len == 2) {
-                PUTBITS4(0);
-                PUTBITS4(0xd);
-            } else if (color == 0 && (len >= 3 && len <= 9)) {
-                PUTBITS4(0);
-                PUTBITS4(len - 2);
-            } else if (len >= 4 && len <= 7) {
-                PUTBITS4(0);
-                PUTBITS4(8 + len - 4);
-                PUTBITS4(color);
-            } else if (len >= 9 && len <= 24) {
-                PUTBITS4(0);
-                PUTBITS4(0xe);
-                PUTBITS4(len - 9);
-                PUTBITS4(color);
-            } else if (len >= 25) {
-                if (len > 280)
-                    len = 280;
-                v = len - 25;
-                PUTBITS4(0);
-                PUTBITS4(0xf);
-                PUTBITS4(v >> 4);
-                PUTBITS4(v & 0xf);
-                PUTBITS4(color);
-            } else {
-                PUTBITS4(color);
-                if (color == 0) {
-                    PUTBITS4(0xc);
-                }
-                len = 1;
-            }
-            x += len;
-        }
-        /* end of line */
-        PUTBITS4(0);
-        PUTBITS4(0);
-        if (bitcnt != 4) {
-            *q++ = bitbuf;
-        }
-        *q++ = 0xf0;
-        bitmap += linesize;
-    }
-    *pq = q;
-}
-
-static int encode_dvb_subtitles(DVBSubtitleContext *s,
-                                uint8_t *outbuf, const AVSubtitle *h)
-{
-    uint8_t *q, *pseg_len;
-    int page_id, region_id, clut_id, object_id, i, bpp_index, page_state;
-
-
-    q = outbuf;
-
-    page_id = 1;
-
-    if (h->num_rects == 0 || h->rects == NULL)
-        return -1;
-
-    *q++ = 0x00; /* subtitle_stream_id */
-
-    /* page composition segment */
-
-    *q++ = 0x0f; /* sync_byte */
-    *q++ = 0x10; /* segment_type */
-    bytestream_put_be16(&q, page_id);
-    pseg_len = q;
-    q += 2; /* segment length */
-    *q++ = 30; /* page_timeout (seconds) */
-    if (s->hide_state)
-        page_state = 0; /* normal case */
-    else
-        page_state = 2; /* mode change */
-    /* page_version = 0 + page_state */
-    *q++ = (s->object_version << 4) | (page_state << 2) | 3;
-
-    for (region_id = 0; region_id < h->num_rects; region_id++) {
-        *q++ = region_id;
-        *q++ = 0xff; /* reserved */
-        bytestream_put_be16(&q, h->rects[region_id]->x); /* left pos */
-        bytestream_put_be16(&q, h->rects[region_id]->y); /* top pos */
-    }
-
-    bytestream_put_be16(&pseg_len, q - pseg_len - 2);
-
-    if (!s->hide_state) {
-        for (clut_id = 0; clut_id < h->num_rects; clut_id++) {
-
-            /* CLUT segment */
-
-            if (h->rects[clut_id]->nb_colors <= 4) {
-                /* 2 bpp, some decoders do not support it correctly */
-                bpp_index = 0;
-            } else if (h->rects[clut_id]->nb_colors <= 16) {
-                /* 4 bpp, standard encoding */
-                bpp_index = 1;
-            } else {
-                return -1;
-            }
-
-            *q++ = 0x0f; /* sync byte */
-            *q++ = 0x12; /* CLUT definition segment */
-            bytestream_put_be16(&q, page_id);
-            pseg_len = q;
-            q += 2; /* segment length */
-            *q++ = clut_id;
-            *q++ = (0 << 4) | 0xf; /* version = 0 */
-
-            for(i = 0; i < h->rects[clut_id]->nb_colors; i++) {
-                *q++ = i; /* clut_entry_id */
-                *q++ = (1 << (7 - bpp_index)) | (0xf << 1) | 1; /* 2 bits/pixel full range */
-                {
-                    int a, r, g, b;
-                    uint32_t x= ((uint32_t*)h->rects[clut_id]->pict.data[1])[i];
-                    a = (x >> 24) & 0xff;
-                    r = (x >> 16) & 0xff;
-                    g = (x >>  8) & 0xff;
-                    b = (x >>  0) & 0xff;
-
-                    *q++ = RGB_TO_Y_CCIR(r, g, b);
-                    *q++ = RGB_TO_V_CCIR(r, g, b, 0);
-                    *q++ = RGB_TO_U_CCIR(r, g, b, 0);
-                    *q++ = 255 - a;
-                }
-            }
-
-            bytestream_put_be16(&pseg_len, q - pseg_len - 2);
-        }
-    }
-
-    for (region_id = 0; region_id < h->num_rects; region_id++) {
-
-        /* region composition segment */
-
-        if (h->rects[region_id]->nb_colors <= 4) {
-            /* 2 bpp, some decoders do not support it correctly */
-            bpp_index = 0;
-        } else if (h->rects[region_id]->nb_colors <= 16) {
-            /* 4 bpp, standard encoding */
-            bpp_index = 1;
-        } else {
-            return -1;
-        }
-
-        *q++ = 0x0f; /* sync_byte */
-        *q++ = 0x11; /* segment_type */
-        bytestream_put_be16(&q, page_id);
-        pseg_len = q;
-        q += 2; /* segment length */
-        *q++ = region_id;
-        *q++ = (s->object_version << 4) | (0 << 3) | 0x07; /* version , no fill */
-        bytestream_put_be16(&q, h->rects[region_id]->w); /* region width */
-        bytestream_put_be16(&q, h->rects[region_id]->h); /* region height */
-        *q++ = ((1 + bpp_index) << 5) | ((1 + bpp_index) << 2) | 0x03;
-        *q++ = region_id; /* clut_id == region_id */
-        *q++ = 0; /* 8 bit fill colors */
-        *q++ = 0x03; /* 4 bit and 2 bit fill colors */
-
-        if (!s->hide_state) {
-            bytestream_put_be16(&q, region_id); /* object_id == region_id */
-            *q++ = (0 << 6) | (0 << 4);
-            *q++ = 0;
-            *q++ = 0xf0;
-            *q++ = 0;
-        }
-
-        bytestream_put_be16(&pseg_len, q - pseg_len - 2);
-    }
-
-    if (!s->hide_state) {
-
-        for (object_id = 0; object_id < h->num_rects; object_id++) {
-            /* Object Data segment */
-
-            if (h->rects[object_id]->nb_colors <= 4) {
-                /* 2 bpp, some decoders do not support it correctly */
-                bpp_index = 0;
-            } else if (h->rects[object_id]->nb_colors <= 16) {
-                /* 4 bpp, standard encoding */
-                bpp_index = 1;
-            } else {
-                return -1;
-            }
-
-            *q++ = 0x0f; /* sync byte */
-            *q++ = 0x13;
-            bytestream_put_be16(&q, page_id);
-            pseg_len = q;
-            q += 2; /* segment length */
-
-            bytestream_put_be16(&q, object_id);
-            *q++ = (s->object_version << 4) | (0 << 2) | (0 << 1) | 1; /* version = 0,
-                                                                       onject_coding_method,
-                                                                       non_modifying_color_flag */
-            {
-                uint8_t *ptop_field_len, *pbottom_field_len, *top_ptr, *bottom_ptr;
-                void (*dvb_encode_rle)(uint8_t **pq,
-                                        const uint8_t *bitmap, int linesize,
-                                        int w, int h);
-                ptop_field_len = q;
-                q += 2;
-                pbottom_field_len = q;
-                q += 2;
-
-                if (bpp_index == 0)
-                    dvb_encode_rle = dvb_encode_rle2;
-                else
-                    dvb_encode_rle = dvb_encode_rle4;
-
-                top_ptr = q;
-                dvb_encode_rle(&q, h->rects[object_id]->pict.data[0], h->rects[object_id]->w * 2,
-                                    h->rects[object_id]->w, h->rects[object_id]->h >> 1);
-                bottom_ptr = q;
-                dvb_encode_rle(&q, h->rects[object_id]->pict.data[0] + h->rects[object_id]->w,
-                                    h->rects[object_id]->w * 2, h->rects[object_id]->w,
-                                    h->rects[object_id]->h >> 1);
-
-                bytestream_put_be16(&ptop_field_len, bottom_ptr - top_ptr);
-                bytestream_put_be16(&pbottom_field_len, q - bottom_ptr);
-            }
-
-            bytestream_put_be16(&pseg_len, q - pseg_len - 2);
-        }
-    }
-
-    /* end of display set segment */
-
-    *q++ = 0x0f; /* sync_byte */
-    *q++ = 0x80; /* segment_type */
-    bytestream_put_be16(&q, page_id);
-    pseg_len = q;
-    q += 2; /* segment length */
-
-    bytestream_put_be16(&pseg_len, q - pseg_len - 2);
-
-    *q++ = 0xff; /* end of PES data */
-
-    s->object_version = (s->object_version + 1) & 0xf;
-    s->hide_state = !s->hide_state;
-    return q - outbuf;
-}
-
-static int dvbsub_encode(AVCodecContext *avctx,
-                         unsigned char *buf, int buf_size,
-                         const AVSubtitle *sub)
-{
-    DVBSubtitleContext *s = avctx->priv_data;
-    int ret;
-
-    ret = encode_dvb_subtitles(s, buf, sub);
-    return ret;
-}
-
-AVCodec ff_dvbsub_encoder = {
-    .name           = "dvbsub",
-    .long_name      = NULL_IF_CONFIG_SMALL("DVB subtitles"),
-    .type           = AVMEDIA_TYPE_SUBTITLE,
-    .id             = AV_CODEC_ID_DVB_SUBTITLE,
-    .priv_data_size = sizeof(DVBSubtitleContext),
-    .encode_sub     = dvbsub_encode,
-};
diff --git a/deps/libav/libavcodec/dvbsub_parser.c b/deps/libav/libavcodec/dvbsub_parser.c
deleted file mode 100644
index 295e03b..0000000
--- a/deps/libav/libavcodec/dvbsub_parser.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * DVB subtitle parser for Libav
- * Copyright (c) 2005 Ian Caulfield
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "get_bits.h"
-
-/* Parser (mostly) copied from dvdsub.c */
-
-#define PARSE_BUF_SIZE  (65536)
-
-
-/* parser definition */
-typedef struct DVBSubParseContext {
-    uint8_t *packet_buf;
-    int packet_start;
-    int packet_index;
-    int in_packet;
-} DVBSubParseContext;
-
-static av_cold int dvbsub_parse_init(AVCodecParserContext *s)
-{
-    DVBSubParseContext *pc = s->priv_data;
-    pc->packet_buf = av_malloc(PARSE_BUF_SIZE);
-
-    return 0;
-}
-
-static int dvbsub_parse(AVCodecParserContext *s,
-                        AVCodecContext *avctx,
-                        const uint8_t **poutbuf, int *poutbuf_size,
-                        const uint8_t *buf, int buf_size)
-{
-    DVBSubParseContext *pc = s->priv_data;
-    uint8_t *p, *p_end;
-    int i, len, buf_pos = 0;
-
-    av_dlog(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
-            s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]);
-
-    for (i=0; i < buf_size; i++)
-    {
-        av_dlog(avctx, "%02x ", buf[i]);
-        if (i % 16 == 15)
-            av_dlog(avctx, "\n");
-    }
-
-    if (i % 16 != 0)
-        av_dlog(avctx, "\n");
-
-    *poutbuf = NULL;
-    *poutbuf_size = 0;
-
-    s->fetch_timestamp = 1;
-
-    if (s->last_pts != s->pts && s->pts != AV_NOPTS_VALUE) /* Start of a new packet */
-    {
-        if (pc->packet_index != pc->packet_start)
-        {
-            av_dlog(avctx, "Discarding %d bytes\n",
-                    pc->packet_index - pc->packet_start);
-        }
-
-        pc->packet_start = 0;
-        pc->packet_index = 0;
-
-        if (buf_size < 2 || buf[0] != 0x20 || buf[1] != 0x00) {
-            av_dlog(avctx, "Bad packet header\n");
-            return -1;
-        }
-
-        buf_pos = 2;
-
-        pc->in_packet = 1;
-    } else {
-        if (pc->packet_start != 0)
-        {
-            if (pc->packet_index != pc->packet_start)
-            {
-                memmove(pc->packet_buf, pc->packet_buf + pc->packet_start,
-                            pc->packet_index - pc->packet_start);
-
-                pc->packet_index -= pc->packet_start;
-                pc->packet_start = 0;
-            } else {
-                pc->packet_start = 0;
-                pc->packet_index = 0;
-            }
-        }
-    }
-
-    if (buf_size - buf_pos + pc->packet_index > PARSE_BUF_SIZE)
-        return -1;
-
-/* if not currently in a packet, discard data */
-    if (pc->in_packet == 0)
-        return buf_size;
-
-    memcpy(pc->packet_buf + pc->packet_index, buf + buf_pos, buf_size - buf_pos);
-    pc->packet_index += buf_size - buf_pos;
-
-    p = pc->packet_buf;
-    p_end = pc->packet_buf + pc->packet_index;
-
-    while (p < p_end)
-    {
-        if (*p == 0x0f)
-        {
-            if (p + 6 <= p_end)
-            {
-                len = AV_RB16(p + 4);
-
-                if (p + len + 6 <= p_end)
-                {
-                    *poutbuf_size += len + 6;
-
-                    p += len + 6;
-                } else
-                    break;
-            } else
-                break;
-        } else if (*p == 0xff) {
-            if (p + 1 < p_end)
-            {
-                av_dlog(avctx, "Junk at end of packet\n");
-            }
-            pc->packet_index = p - pc->packet_buf;
-            pc->in_packet = 0;
-            break;
-        } else {
-            av_log(avctx, AV_LOG_ERROR, "Junk in packet\n");
-
-            pc->packet_index = p - pc->packet_buf;
-            pc->in_packet = 0;
-            break;
-        }
-    }
-
-    if (*poutbuf_size > 0)
-    {
-        *poutbuf = pc->packet_buf;
-        pc->packet_start = *poutbuf_size;
-    }
-
-    if (s->pts == AV_NOPTS_VALUE)
-        s->pts = s->last_pts;
-
-    return buf_size;
-}
-
-static av_cold void dvbsub_parse_close(AVCodecParserContext *s)
-{
-    DVBSubParseContext *pc = s->priv_data;
-    av_freep(&pc->packet_buf);
-}
-
-AVCodecParser ff_dvbsub_parser = {
-    .codec_ids      = { AV_CODEC_ID_DVB_SUBTITLE },
-    .priv_data_size = sizeof(DVBSubParseContext),
-    .parser_init    = dvbsub_parse_init,
-    .parser_parse   = dvbsub_parse,
-    .parser_close   = dvbsub_parse_close,
-};
diff --git a/deps/libav/libavcodec/dvbsubdec.c b/deps/libav/libavcodec/dvbsubdec.c
deleted file mode 100644
index 6ce187f..0000000
--- a/deps/libav/libavcodec/dvbsubdec.c
+++ /dev/null
@@ -1,1473 +0,0 @@
-/*
- * DVB subtitle decoding
- * Copyright (c) 2005 Ian Caulfield
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "bytestream.h"
-#include "libavutil/colorspace.h"
-
-#define DVBSUB_PAGE_SEGMENT     0x10
-#define DVBSUB_REGION_SEGMENT   0x11
-#define DVBSUB_CLUT_SEGMENT     0x12
-#define DVBSUB_OBJECT_SEGMENT   0x13
-#define DVBSUB_DISPLAYDEFINITION_SEGMENT 0x14
-#define DVBSUB_DISPLAY_SEGMENT  0x80
-
-#define cm (ff_cropTbl + MAX_NEG_CROP)
-
-#ifdef DEBUG
-#if 0
-static void png_save(const char *filename, uint8_t *bitmap, int w, int h,
-                     uint32_t *rgba_palette)
-{
-    int x, y, v;
-    FILE *f;
-    char fname[40], fname2[40];
-    char command[1024];
-
-    snprintf(fname, 40, "%s.ppm", filename);
-
-    f = fopen(fname, "w");
-    if (!f) {
-        perror(fname);
-        return;
-    }
-    fprintf(f, "P6\n"
-            "%d %d\n"
-            "%d\n",
-            w, h, 255);
-    for(y = 0; y < h; y++) {
-        for(x = 0; x < w; x++) {
-            v = rgba_palette[bitmap[y * w + x]];
-            putc((v >> 16) & 0xff, f);
-            putc((v >> 8) & 0xff, f);
-            putc((v >> 0) & 0xff, f);
-        }
-    }
-    fclose(f);
-
-
-    snprintf(fname2, 40, "%s-a.pgm", filename);
-
-    f = fopen(fname2, "w");
-    if (!f) {
-        perror(fname2);
-        return;
-    }
-    fprintf(f, "P5\n"
-            "%d %d\n"
-            "%d\n",
-            w, h, 255);
-    for(y = 0; y < h; y++) {
-        for(x = 0; x < w; x++) {
-            v = rgba_palette[bitmap[y * w + x]];
-            putc((v >> 24) & 0xff, f);
-        }
-    }
-    fclose(f);
-
-    snprintf(command, 1024, "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
-    system(command);
-
-    snprintf(command, 1024, "rm %s %s", fname, fname2);
-    system(command);
-}
-#endif
-
-static void png_save2(const char *filename, uint32_t *bitmap, int w, int h)
-{
-    int x, y, v;
-    FILE *f;
-    char fname[40], fname2[40];
-    char command[1024];
-
-    snprintf(fname, sizeof(fname), "%s.ppm", filename);
-
-    f = fopen(fname, "w");
-    if (!f) {
-        perror(fname);
-        return;
-    }
-    fprintf(f, "P6\n"
-            "%d %d\n"
-            "%d\n",
-            w, h, 255);
-    for(y = 0; y < h; y++) {
-        for(x = 0; x < w; x++) {
-            v = bitmap[y * w + x];
-            putc((v >> 16) & 0xff, f);
-            putc((v >> 8) & 0xff, f);
-            putc((v >> 0) & 0xff, f);
-        }
-    }
-    fclose(f);
-
-
-    snprintf(fname2, sizeof(fname2), "%s-a.pgm", filename);
-
-    f = fopen(fname2, "w");
-    if (!f) {
-        perror(fname2);
-        return;
-    }
-    fprintf(f, "P5\n"
-            "%d %d\n"
-            "%d\n",
-            w, h, 255);
-    for(y = 0; y < h; y++) {
-        for(x = 0; x < w; x++) {
-            v = bitmap[y * w + x];
-            putc((v >> 24) & 0xff, f);
-        }
-    }
-    fclose(f);
-
-    snprintf(command, sizeof(command), "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
-    system(command);
-
-    snprintf(command, sizeof(command), "rm %s %s", fname, fname2);
-    system(command);
-}
-#endif
-
-#define RGBA(r,g,b,a) (((unsigned)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-typedef struct DVBSubCLUT {
-    int id;
-
-    uint32_t clut4[4];
-    uint32_t clut16[16];
-    uint32_t clut256[256];
-
-    struct DVBSubCLUT *next;
-} DVBSubCLUT;
-
-static DVBSubCLUT default_clut;
-
-typedef struct DVBSubObjectDisplay {
-    int object_id;
-    int region_id;
-
-    int x_pos;
-    int y_pos;
-
-    int fgcolor;
-    int bgcolor;
-
-    struct DVBSubObjectDisplay *region_list_next;
-    struct DVBSubObjectDisplay *object_list_next;
-} DVBSubObjectDisplay;
-
-typedef struct DVBSubObject {
-    int id;
-
-    int type;
-
-    DVBSubObjectDisplay *display_list;
-
-    struct DVBSubObject *next;
-} DVBSubObject;
-
-typedef struct DVBSubRegionDisplay {
-    int region_id;
-
-    int x_pos;
-    int y_pos;
-
-    struct DVBSubRegionDisplay *next;
-} DVBSubRegionDisplay;
-
-typedef struct DVBSubRegion {
-    int id;
-
-    int width;
-    int height;
-    int depth;
-
-    int clut;
-    int bgcolor;
-
-    uint8_t *pbuf;
-    int buf_size;
-
-    DVBSubObjectDisplay *display_list;
-
-    struct DVBSubRegion *next;
-} DVBSubRegion;
-
-typedef struct DVBSubDisplayDefinition {
-    int version;
-
-    int x;
-    int y;
-    int width;
-    int height;
-} DVBSubDisplayDefinition;
-
-typedef struct DVBSubContext {
-    int composition_id;
-    int ancillary_id;
-
-    int time_out;
-    DVBSubRegion *region_list;
-    DVBSubCLUT   *clut_list;
-    DVBSubObject *object_list;
-
-    int display_list_size;
-    DVBSubRegionDisplay *display_list;
-    DVBSubDisplayDefinition *display_definition;
-} DVBSubContext;
-
-
-static DVBSubObject* get_object(DVBSubContext *ctx, int object_id)
-{
-    DVBSubObject *ptr = ctx->object_list;
-
-    while (ptr && ptr->id != object_id) {
-        ptr = ptr->next;
-    }
-
-    return ptr;
-}
-
-static DVBSubCLUT* get_clut(DVBSubContext *ctx, int clut_id)
-{
-    DVBSubCLUT *ptr = ctx->clut_list;
-
-    while (ptr && ptr->id != clut_id) {
-        ptr = ptr->next;
-    }
-
-    return ptr;
-}
-
-static DVBSubRegion* get_region(DVBSubContext *ctx, int region_id)
-{
-    DVBSubRegion *ptr = ctx->region_list;
-
-    while (ptr && ptr->id != region_id) {
-        ptr = ptr->next;
-    }
-
-    return ptr;
-}
-
-static void delete_region_display_list(DVBSubContext *ctx, DVBSubRegion *region)
-{
-    DVBSubObject *object, *obj2, **obj2_ptr;
-    DVBSubObjectDisplay *display, *obj_disp, **obj_disp_ptr;
-
-    while (region->display_list) {
-        display = region->display_list;
-
-        object = get_object(ctx, display->object_id);
-
-        if (object) {
-            obj_disp_ptr = &object->display_list;
-            obj_disp = *obj_disp_ptr;
-
-            while (obj_disp && obj_disp != display) {
-                obj_disp_ptr = &obj_disp->object_list_next;
-                obj_disp = *obj_disp_ptr;
-            }
-
-            if (obj_disp) {
-                *obj_disp_ptr = obj_disp->object_list_next;
-
-                if (!object->display_list) {
-                    obj2_ptr = &ctx->object_list;
-                    obj2 = *obj2_ptr;
-
-                    while (obj2 != object) {
-                        assert(obj2);
-                        obj2_ptr = &obj2->next;
-                        obj2 = *obj2_ptr;
-                    }
-
-                    *obj2_ptr = obj2->next;
-
-                    av_free(obj2);
-                }
-            }
-        }
-
-        region->display_list = display->region_list_next;
-
-        av_free(display);
-    }
-
-}
-
-static void delete_state(DVBSubContext *ctx)
-{
-    DVBSubRegion *region;
-    DVBSubCLUT *clut;
-
-    while (ctx->region_list) {
-        region = ctx->region_list;
-
-        ctx->region_list = region->next;
-
-        delete_region_display_list(ctx, region);
-        av_free(region->pbuf);
-        av_free(region);
-    }
-
-    while (ctx->clut_list) {
-        clut = ctx->clut_list;
-
-        ctx->clut_list = clut->next;
-
-        av_free(clut);
-    }
-
-    av_freep(&ctx->display_definition);
-
-    /* Should already be null */
-    if (ctx->object_list)
-        av_log(0, AV_LOG_ERROR, "Memory deallocation error!\n");
-}
-
-static av_cold int dvbsub_init_decoder(AVCodecContext *avctx)
-{
-    int i, r, g, b, a = 0;
-    DVBSubContext *ctx = avctx->priv_data;
-
-    if (!avctx->extradata || avctx->extradata_size != 4) {
-        av_log(avctx, AV_LOG_WARNING, "Invalid extradata, subtitle streams may be combined!\n");
-        ctx->composition_id = -1;
-        ctx->ancillary_id   = -1;
-    } else {
-        ctx->composition_id = AV_RB16(avctx->extradata);
-        ctx->ancillary_id   = AV_RB16(avctx->extradata + 2);
-    }
-
-    default_clut.id = -1;
-    default_clut.next = NULL;
-
-    default_clut.clut4[0] = RGBA(  0,   0,   0,   0);
-    default_clut.clut4[1] = RGBA(255, 255, 255, 255);
-    default_clut.clut4[2] = RGBA(  0,   0,   0, 255);
-    default_clut.clut4[3] = RGBA(127, 127, 127, 255);
-
-    default_clut.clut16[0] = RGBA(  0,   0,   0,   0);
-    for (i = 1; i < 16; i++) {
-        if (i < 8) {
-            r = (i & 1) ? 255 : 0;
-            g = (i & 2) ? 255 : 0;
-            b = (i & 4) ? 255 : 0;
-        } else {
-            r = (i & 1) ? 127 : 0;
-            g = (i & 2) ? 127 : 0;
-            b = (i & 4) ? 127 : 0;
-        }
-        default_clut.clut16[i] = RGBA(r, g, b, 255);
-    }
-
-    default_clut.clut256[0] = RGBA(  0,   0,   0,   0);
-    for (i = 1; i < 256; i++) {
-        if (i < 8) {
-            r = (i & 1) ? 255 : 0;
-            g = (i & 2) ? 255 : 0;
-            b = (i & 4) ? 255 : 0;
-            a = 63;
-        } else {
-            switch (i & 0x88) {
-            case 0x00:
-                r = ((i & 1) ? 85 : 0) + ((i & 0x10) ? 170 : 0);
-                g = ((i & 2) ? 85 : 0) + ((i & 0x20) ? 170 : 0);
-                b = ((i & 4) ? 85 : 0) + ((i & 0x40) ? 170 : 0);
-                a = 255;
-                break;
-            case 0x08:
-                r = ((i & 1) ? 85 : 0) + ((i & 0x10) ? 170 : 0);
-                g = ((i & 2) ? 85 : 0) + ((i & 0x20) ? 170 : 0);
-                b = ((i & 4) ? 85 : 0) + ((i & 0x40) ? 170 : 0);
-                a = 127;
-                break;
-            case 0x80:
-                r = 127 + ((i & 1) ? 43 : 0) + ((i & 0x10) ? 85 : 0);
-                g = 127 + ((i & 2) ? 43 : 0) + ((i & 0x20) ? 85 : 0);
-                b = 127 + ((i & 4) ? 43 : 0) + ((i & 0x40) ? 85 : 0);
-                a = 255;
-                break;
-            case 0x88:
-                r = ((i & 1) ? 43 : 0) + ((i & 0x10) ? 85 : 0);
-                g = ((i & 2) ? 43 : 0) + ((i & 0x20) ? 85 : 0);
-                b = ((i & 4) ? 43 : 0) + ((i & 0x40) ? 85 : 0);
-                a = 255;
-                break;
-            }
-        }
-        default_clut.clut256[i] = RGBA(r, g, b, a);
-    }
-
-    return 0;
-}
-
-static av_cold int dvbsub_close_decoder(AVCodecContext *avctx)
-{
-    DVBSubContext *ctx = avctx->priv_data;
-    DVBSubRegionDisplay *display;
-
-    delete_state(ctx);
-
-    while (ctx->display_list) {
-        display = ctx->display_list;
-        ctx->display_list = display->next;
-
-        av_free(display);
-    }
-
-    return 0;
-}
-
-static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len,
-                                   const uint8_t **srcbuf, int buf_size,
-                                   int non_mod, uint8_t *map_table)
-{
-    GetBitContext gb;
-
-    int bits;
-    int run_length;
-    int pixels_read = 0;
-
-    init_get_bits(&gb, *srcbuf, buf_size << 3);
-
-    while (get_bits_count(&gb) < buf_size << 3 && pixels_read < dbuf_len) {
-        bits = get_bits(&gb, 2);
-
-        if (bits) {
-            if (non_mod != 1 || bits != 1) {
-                if (map_table)
-                    *destbuf++ = map_table[bits];
-                else
-                    *destbuf++ = bits;
-            }
-            pixels_read++;
-        } else {
-            bits = get_bits1(&gb);
-            if (bits == 1) {
-                run_length = get_bits(&gb, 3) + 3;
-                bits = get_bits(&gb, 2);
-
-                if (non_mod == 1 && bits == 1)
-                    pixels_read += run_length;
-                else {
-                    if (map_table)
-                        bits = map_table[bits];
-                    while (run_length-- > 0 && pixels_read < dbuf_len) {
-                        *destbuf++ = bits;
-                        pixels_read++;
-                    }
-                }
-            } else {
-                bits = get_bits1(&gb);
-                if (bits == 0) {
-                    bits = get_bits(&gb, 2);
-                    if (bits == 2) {
-                        run_length = get_bits(&gb, 4) + 12;
-                        bits = get_bits(&gb, 2);
-
-                        if (non_mod == 1 && bits == 1)
-                            pixels_read += run_length;
-                        else {
-                            if (map_table)
-                                bits = map_table[bits];
-                            while (run_length-- > 0 && pixels_read < dbuf_len) {
-                                *destbuf++ = bits;
-                                pixels_read++;
-                            }
-                        }
-                    } else if (bits == 3) {
-                        run_length = get_bits(&gb, 8) + 29;
-                        bits = get_bits(&gb, 2);
-
-                        if (non_mod == 1 && bits == 1)
-                            pixels_read += run_length;
-                        else {
-                            if (map_table)
-                                bits = map_table[bits];
-                            while (run_length-- > 0 && pixels_read < dbuf_len) {
-                                *destbuf++ = bits;
-                                pixels_read++;
-                            }
-                        }
-                    } else if (bits == 1) {
-                        pixels_read += 2;
-                        if (map_table)
-                            bits = map_table[0];
-                        else
-                            bits = 0;
-                        if (pixels_read <= dbuf_len) {
-                            *destbuf++ = bits;
-                            *destbuf++ = bits;
-                        }
-                    } else {
-                        (*srcbuf) += (get_bits_count(&gb) + 7) >> 3;
-                        return pixels_read;
-                    }
-                } else {
-                    if (map_table)
-                        bits = map_table[0];
-                    else
-                        bits = 0;
-                    *destbuf++ = bits;
-                    pixels_read++;
-                }
-            }
-        }
-    }
-
-    if (get_bits(&gb, 6))
-        av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
-
-    (*srcbuf) += (get_bits_count(&gb) + 7) >> 3;
-
-    return pixels_read;
-}
-
-static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len,
-                                   const uint8_t **srcbuf, int buf_size,
-                                   int non_mod, uint8_t *map_table)
-{
-    GetBitContext gb;
-
-    int bits;
-    int run_length;
-    int pixels_read = 0;
-
-    init_get_bits(&gb, *srcbuf, buf_size << 3);
-
-    while (get_bits_count(&gb) < buf_size << 3 && pixels_read < dbuf_len) {
-        bits = get_bits(&gb, 4);
-
-        if (bits) {
-            if (non_mod != 1 || bits != 1) {
-                if (map_table)
-                    *destbuf++ = map_table[bits];
-                else
-                    *destbuf++ = bits;
-            }
-            pixels_read++;
-        } else {
-            bits = get_bits1(&gb);
-            if (bits == 0) {
-                run_length = get_bits(&gb, 3);
-
-                if (run_length == 0) {
-                    (*srcbuf) += (get_bits_count(&gb) + 7) >> 3;
-                    return pixels_read;
-                }
-
-                run_length += 2;
-
-                if (map_table)
-                    bits = map_table[0];
-                else
-                    bits = 0;
-
-                while (run_length-- > 0 && pixels_read < dbuf_len) {
-                    *destbuf++ = bits;
-                    pixels_read++;
-                }
-            } else {
-                bits = get_bits1(&gb);
-                if (bits == 0) {
-                    run_length = get_bits(&gb, 2) + 4;
-                    bits = get_bits(&gb, 4);
-
-                    if (non_mod == 1 && bits == 1)
-                        pixels_read += run_length;
-                    else {
-                        if (map_table)
-                            bits = map_table[bits];
-                        while (run_length-- > 0 && pixels_read < dbuf_len) {
-                            *destbuf++ = bits;
-                            pixels_read++;
-                        }
-                    }
-                } else {
-                    bits = get_bits(&gb, 2);
-                    if (bits == 2) {
-                        run_length = get_bits(&gb, 4) + 9;
-                        bits = get_bits(&gb, 4);
-
-                        if (non_mod == 1 && bits == 1)
-                            pixels_read += run_length;
-                        else {
-                            if (map_table)
-                                bits = map_table[bits];
-                            while (run_length-- > 0 && pixels_read < dbuf_len) {
-                                *destbuf++ = bits;
-                                pixels_read++;
-                            }
-                        }
-                    } else if (bits == 3) {
-                        run_length = get_bits(&gb, 8) + 25;
-                        bits = get_bits(&gb, 4);
-
-                        if (non_mod == 1 && bits == 1)
-                            pixels_read += run_length;
-                        else {
-                            if (map_table)
-                                bits = map_table[bits];
-                            while (run_length-- > 0 && pixels_read < dbuf_len) {
-                                *destbuf++ = bits;
-                                pixels_read++;
-                            }
-                        }
-                    } else if (bits == 1) {
-                        pixels_read += 2;
-                        if (map_table)
-                            bits = map_table[0];
-                        else
-                            bits = 0;
-                        if (pixels_read <= dbuf_len) {
-                            *destbuf++ = bits;
-                            *destbuf++ = bits;
-                        }
-                    } else {
-                        if (map_table)
-                            bits = map_table[0];
-                        else
-                            bits = 0;
-                        *destbuf++ = bits;
-                        pixels_read ++;
-                    }
-                }
-            }
-        }
-    }
-
-    if (get_bits(&gb, 8))
-        av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
-
-    (*srcbuf) += (get_bits_count(&gb) + 7) >> 3;
-
-    return pixels_read;
-}
-
-static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len,
-                                    const uint8_t **srcbuf, int buf_size,
-                                    int non_mod, uint8_t *map_table)
-{
-    const uint8_t *sbuf_end = (*srcbuf) + buf_size;
-    int bits;
-    int run_length;
-    int pixels_read = 0;
-
-    while (*srcbuf < sbuf_end && pixels_read < dbuf_len) {
-        bits = *(*srcbuf)++;
-
-        if (bits) {
-            if (non_mod != 1 || bits != 1) {
-                if (map_table)
-                    *destbuf++ = map_table[bits];
-                else
-                    *destbuf++ = bits;
-            }
-            pixels_read++;
-        } else {
-            bits = *(*srcbuf)++;
-            run_length = bits & 0x7f;
-            if ((bits & 0x80) == 0) {
-                if (run_length == 0) {
-                    return pixels_read;
-                }
-
-                if (map_table)
-                    bits = map_table[0];
-                else
-                    bits = 0;
-                while (run_length-- > 0 && pixels_read < dbuf_len) {
-                    *destbuf++ = bits;
-                    pixels_read++;
-                }
-            } else {
-                bits = *(*srcbuf)++;
-
-                if (non_mod == 1 && bits == 1)
-                    pixels_read += run_length;
-                if (map_table)
-                    bits = map_table[bits];
-                else while (run_length-- > 0 && pixels_read < dbuf_len) {
-                    *destbuf++ = bits;
-                    pixels_read++;
-                }
-            }
-        }
-    }
-
-    if (*(*srcbuf)++)
-        av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
-
-    return pixels_read;
-}
-
-
-
-static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDisplay *display,
-                                          const uint8_t *buf, int buf_size, int top_bottom, int non_mod)
-{
-    DVBSubContext *ctx = avctx->priv_data;
-
-    DVBSubRegion *region = get_region(ctx, display->region_id);
-    const uint8_t *buf_end = buf + buf_size;
-    uint8_t *pbuf;
-    int x_pos, y_pos;
-    int i;
-
-    uint8_t map2to4[] = { 0x0,  0x7,  0x8,  0xf};
-    uint8_t map2to8[] = {0x00, 0x77, 0x88, 0xff};
-    uint8_t map4to8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
-                         0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
-    uint8_t *map_table;
-
-    av_dlog(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
-            top_bottom ? "bottom" : "top");
-
-    for (i = 0; i < buf_size; i++) {
-        if (i % 16 == 0)
-            av_dlog(avctx, "0x%8p: ", buf+i);
-
-        av_dlog(avctx, "%02x ", buf[i]);
-        if (i % 16 == 15)
-            av_dlog(avctx, "\n");
-    }
-
-    if (i % 16)
-        av_dlog(avctx, "\n");
-
-    if (region == 0)
-        return;
-
-    pbuf = region->pbuf;
-
-    x_pos = display->x_pos;
-    y_pos = display->y_pos;
-
-    if ((y_pos & 1) != top_bottom)
-        y_pos++;
-
-    while (buf < buf_end) {
-        if (x_pos > region->width || y_pos > region->height) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid object location!\n");
-            return;
-        }
-
-        switch (*buf++) {
-        case 0x10:
-            if (region->depth == 8)
-                map_table = map2to8;
-            else if (region->depth == 4)
-                map_table = map2to4;
-            else
-                map_table = NULL;
-
-            x_pos += dvbsub_read_2bit_string(pbuf + (y_pos * region->width) + x_pos,
-                                                region->width - x_pos, &buf, buf_end - buf,
-                                                non_mod, map_table);
-            break;
-        case 0x11:
-            if (region->depth < 4) {
-                av_log(avctx, AV_LOG_ERROR, "4-bit pixel string in %d-bit region!\n", region->depth);
-                return;
-            }
-
-            if (region->depth == 8)
-                map_table = map4to8;
-            else
-                map_table = NULL;
-
-            x_pos += dvbsub_read_4bit_string(pbuf + (y_pos * region->width) + x_pos,
-                                                region->width - x_pos, &buf, buf_end - buf,
-                                                non_mod, map_table);
-            break;
-        case 0x12:
-            if (region->depth < 8) {
-                av_log(avctx, AV_LOG_ERROR, "8-bit pixel string in %d-bit region!\n", region->depth);
-                return;
-            }
-
-            x_pos += dvbsub_read_8bit_string(pbuf + (y_pos * region->width) + x_pos,
-                                                region->width - x_pos, &buf, buf_end - buf,
-                                                non_mod, NULL);
-            break;
-
-        case 0x20:
-            map2to4[0] = (*buf) >> 4;
-            map2to4[1] = (*buf++) & 0xf;
-            map2to4[2] = (*buf) >> 4;
-            map2to4[3] = (*buf++) & 0xf;
-            break;
-        case 0x21:
-            for (i = 0; i < 4; i++)
-                map2to8[i] = *buf++;
-            break;
-        case 0x22:
-            for (i = 0; i < 16; i++)
-                map4to8[i] = *buf++;
-            break;
-
-        case 0xf0:
-            x_pos = display->x_pos;
-            y_pos += 2;
-            break;
-        default:
-            av_log(avctx, AV_LOG_INFO, "Unknown/unsupported pixel block 0x%x\n", *(buf-1));
-        }
-    }
-
-}
-
-static void dvbsub_parse_object_segment(AVCodecContext *avctx,
-                                        const uint8_t *buf, int buf_size)
-{
-    DVBSubContext *ctx = avctx->priv_data;
-
-    const uint8_t *buf_end = buf + buf_size;
-    const uint8_t *block;
-    int object_id;
-    DVBSubObject *object;
-    DVBSubObjectDisplay *display;
-    int top_field_len, bottom_field_len;
-
-    int coding_method, non_modifying_color;
-
-    object_id = AV_RB16(buf);
-    buf += 2;
-
-    object = get_object(ctx, object_id);
-
-    if (!object)
-        return;
-
-    coding_method = ((*buf) >> 2) & 3;
-    non_modifying_color = ((*buf++) >> 1) & 1;
-
-    if (coding_method == 0) {
-        top_field_len = AV_RB16(buf);
-        buf += 2;
-        bottom_field_len = AV_RB16(buf);
-        buf += 2;
-
-        if (buf + top_field_len + bottom_field_len > buf_end) {
-            av_log(avctx, AV_LOG_ERROR, "Field data size too large\n");
-            return;
-        }
-
-        for (display = object->display_list; display; display = display->object_list_next) {
-            block = buf;
-
-            dvbsub_parse_pixel_data_block(avctx, display, block, top_field_len, 0,
-                                            non_modifying_color);
-
-            if (bottom_field_len > 0)
-                block = buf + top_field_len;
-            else
-                bottom_field_len = top_field_len;
-
-            dvbsub_parse_pixel_data_block(avctx, display, block, bottom_field_len, 1,
-                                            non_modifying_color);
-        }
-
-/*  } else if (coding_method == 1) {*/
-
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "Unknown object coding %d\n", coding_method);
-    }
-
-}
-
-static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
-                                        const uint8_t *buf, int buf_size)
-{
-    DVBSubContext *ctx = avctx->priv_data;
-
-    const uint8_t *buf_end = buf + buf_size;
-    int i, clut_id;
-    DVBSubCLUT *clut;
-    int entry_id, depth , full_range;
-    int y, cr, cb, alpha;
-    int r, g, b, r_add, g_add, b_add;
-
-    av_dlog(avctx, "DVB clut packet:\n");
-
-    for (i=0; i < buf_size; i++) {
-        av_dlog(avctx, "%02x ", buf[i]);
-        if (i % 16 == 15)
-            av_dlog(avctx, "\n");
-    }
-
-    if (i % 16)
-        av_dlog(avctx, "\n");
-
-    clut_id = *buf++;
-    buf += 1;
-
-    clut = get_clut(ctx, clut_id);
-
-    if (!clut) {
-        clut = av_malloc(sizeof(DVBSubCLUT));
-
-        memcpy(clut, &default_clut, sizeof(DVBSubCLUT));
-
-        clut->id = clut_id;
-
-        clut->next = ctx->clut_list;
-        ctx->clut_list = clut;
-    }
-
-    while (buf + 4 < buf_end) {
-        entry_id = *buf++;
-
-        depth = (*buf) & 0xe0;
-
-        if (depth == 0) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid clut depth 0x%x!\n", *buf);
-            return;
-        }
-
-        full_range = (*buf++) & 1;
-
-        if (full_range) {
-            y = *buf++;
-            cr = *buf++;
-            cb = *buf++;
-            alpha = *buf++;
-        } else {
-            y = buf[0] & 0xfc;
-            cr = (((buf[0] & 3) << 2) | ((buf[1] >> 6) & 3)) << 4;
-            cb = (buf[1] << 2) & 0xf0;
-            alpha = (buf[1] << 6) & 0xc0;
-
-            buf += 2;
-        }
-
-        if (y == 0)
-            alpha = 0xff;
-
-        YUV_TO_RGB1_CCIR(cb, cr);
-        YUV_TO_RGB2_CCIR(r, g, b, y);
-
-        av_dlog(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
-
-        if (depth & 0x80)
-            clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
-        if (depth & 0x40)
-            clut->clut16[entry_id] = RGBA(r,g,b,255 - alpha);
-        if (depth & 0x20)
-            clut->clut256[entry_id] = RGBA(r,g,b,255 - alpha);
-    }
-}
-
-
-static void dvbsub_parse_region_segment(AVCodecContext *avctx,
-                                        const uint8_t *buf, int buf_size)
-{
-    DVBSubContext *ctx = avctx->priv_data;
-
-    const uint8_t *buf_end = buf + buf_size;
-    int region_id, object_id;
-    DVBSubRegion *region;
-    DVBSubObject *object;
-    DVBSubObjectDisplay *display;
-    int fill;
-
-    if (buf_size < 10)
-        return;
-
-    region_id = *buf++;
-
-    region = get_region(ctx, region_id);
-
-    if (!region) {
-        region = av_mallocz(sizeof(DVBSubRegion));
-
-        region->id = region_id;
-
-        region->next = ctx->region_list;
-        ctx->region_list = region;
-    }
-
-    fill = ((*buf++) >> 3) & 1;
-
-    region->width = AV_RB16(buf);
-    buf += 2;
-    region->height = AV_RB16(buf);
-    buf += 2;
-
-    if (region->width * region->height != region->buf_size) {
-        av_free(region->pbuf);
-
-        region->buf_size = region->width * region->height;
-
-        region->pbuf = av_malloc(region->buf_size);
-
-        fill = 1;
-    }
-
-    region->depth = 1 << (((*buf++) >> 2) & 7);
-    if(region->depth<2 || region->depth>8){
-        av_log(avctx, AV_LOG_ERROR, "region depth %d is invalid\n", region->depth);
-        region->depth= 4;
-    }
-    region->clut = *buf++;
-
-    if (region->depth == 8)
-        region->bgcolor = *buf++;
-    else {
-        buf += 1;
-
-        if (region->depth == 4)
-            region->bgcolor = (((*buf++) >> 4) & 15);
-        else
-            region->bgcolor = (((*buf++) >> 2) & 3);
-    }
-
-    av_dlog(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
-
-    if (fill) {
-        memset(region->pbuf, region->bgcolor, region->buf_size);
-        av_dlog(avctx, "Fill region (%d)\n", region->bgcolor);
-    }
-
-    delete_region_display_list(ctx, region);
-
-    while (buf + 5 < buf_end) {
-        object_id = AV_RB16(buf);
-        buf += 2;
-
-        object = get_object(ctx, object_id);
-
-        if (!object) {
-            object = av_mallocz(sizeof(DVBSubObject));
-
-            object->id = object_id;
-            object->next = ctx->object_list;
-            ctx->object_list = object;
-        }
-
-        object->type = (*buf) >> 6;
-
-        display = av_mallocz(sizeof(DVBSubObjectDisplay));
-
-        display->object_id = object_id;
-        display->region_id = region_id;
-
-        display->x_pos = AV_RB16(buf) & 0xfff;
-        buf += 2;
-        display->y_pos = AV_RB16(buf) & 0xfff;
-        buf += 2;
-
-        if ((object->type == 1 || object->type == 2) && buf+1 < buf_end) {
-            display->fgcolor = *buf++;
-            display->bgcolor = *buf++;
-        }
-
-        display->region_list_next = region->display_list;
-        region->display_list = display;
-
-        display->object_list_next = object->display_list;
-        object->display_list = display;
-    }
-}
-
-static void dvbsub_parse_page_segment(AVCodecContext *avctx,
-                                        const uint8_t *buf, int buf_size)
-{
-    DVBSubContext *ctx = avctx->priv_data;
-    DVBSubRegionDisplay *display;
-    DVBSubRegionDisplay *tmp_display_list, **tmp_ptr;
-
-    const uint8_t *buf_end = buf + buf_size;
-    int region_id;
-    int page_state;
-
-    if (buf_size < 1)
-        return;
-
-    ctx->time_out = *buf++;
-    page_state = ((*buf++) >> 2) & 3;
-
-    av_dlog(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
-
-    if (page_state == 2) {
-        delete_state(ctx);
-    }
-
-    tmp_display_list = ctx->display_list;
-    ctx->display_list = NULL;
-    ctx->display_list_size = 0;
-
-    while (buf + 5 < buf_end) {
-        region_id = *buf++;
-        buf += 1;
-
-        display = tmp_display_list;
-        tmp_ptr = &tmp_display_list;
-
-        while (display && display->region_id != region_id) {
-            tmp_ptr = &display->next;
-            display = display->next;
-        }
-
-        if (!display)
-            display = av_mallocz(sizeof(DVBSubRegionDisplay));
-
-        display->region_id = region_id;
-
-        display->x_pos = AV_RB16(buf);
-        buf += 2;
-        display->y_pos = AV_RB16(buf);
-        buf += 2;
-
-        *tmp_ptr = display->next;
-
-        display->next = ctx->display_list;
-        ctx->display_list = display;
-        ctx->display_list_size++;
-
-        av_dlog(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
-    }
-
-    while (tmp_display_list) {
-        display = tmp_display_list;
-
-        tmp_display_list = display->next;
-
-        av_free(display);
-    }
-
-}
-
-
-#ifdef DEBUG
-static void save_display_set(DVBSubContext *ctx)
-{
-    DVBSubRegion *region;
-    DVBSubRegionDisplay *display;
-    DVBSubCLUT *clut;
-    uint32_t *clut_table;
-    int x_pos, y_pos, width, height;
-    int x, y, y_off, x_off;
-    uint32_t *pbuf;
-    char filename[32];
-    static int fileno_index = 0;
-
-    x_pos = -1;
-    y_pos = -1;
-    width = 0;
-    height = 0;
-
-    for (display = ctx->display_list; display; display = display->next) {
-        region = get_region(ctx, display->region_id);
-
-        if (x_pos == -1) {
-            x_pos = display->x_pos;
-            y_pos = display->y_pos;
-            width = region->width;
-            height = region->height;
-        } else {
-            if (display->x_pos < x_pos) {
-                width += (x_pos - display->x_pos);
-                x_pos = display->x_pos;
-            }
-
-            if (display->y_pos < y_pos) {
-                height += (y_pos - display->y_pos);
-                y_pos = display->y_pos;
-            }
-
-            if (display->x_pos + region->width > x_pos + width) {
-                width = display->x_pos + region->width - x_pos;
-            }
-
-            if (display->y_pos + region->height > y_pos + height) {
-                height = display->y_pos + region->height - y_pos;
-            }
-        }
-    }
-
-    if (x_pos >= 0) {
-
-        pbuf = av_malloc(width * height * 4);
-
-        for (display = ctx->display_list; display; display = display->next) {
-            region = get_region(ctx, display->region_id);
-
-            x_off = display->x_pos - x_pos;
-            y_off = display->y_pos - y_pos;
-
-            clut = get_clut(ctx, region->clut);
-
-            if (clut == 0)
-                clut = &default_clut;
-
-            switch (region->depth) {
-            case 2:
-                clut_table = clut->clut4;
-                break;
-            case 8:
-                clut_table = clut->clut256;
-                break;
-            case 4:
-            default:
-                clut_table = clut->clut16;
-                break;
-            }
-
-            for (y = 0; y < region->height; y++) {
-                for (x = 0; x < region->width; x++) {
-                    pbuf[((y + y_off) * width) + x_off + x] =
-                        clut_table[region->pbuf[y * region->width + x]];
-                }
-            }
-
-        }
-
-        snprintf(filename, sizeof(filename), "dvbs.%d", fileno_index);
-
-        png_save2(filename, pbuf, width, height);
-
-        av_free(pbuf);
-    }
-
-    fileno_index++;
-}
-#endif
-
-static void dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
-                                                    const uint8_t *buf,
-                                                    int buf_size)
-{
-    DVBSubContext *ctx = avctx->priv_data;
-    DVBSubDisplayDefinition *display_def = ctx->display_definition;
-    int dds_version, info_byte;
-
-    if (buf_size < 5)
-        return;
-
-    info_byte   = bytestream_get_byte(&buf);
-    dds_version = info_byte >> 4;
-    if (display_def && display_def->version == dds_version)
-        return; // already have this display definition version
-
-    if (!display_def) {
-        display_def             = av_mallocz(sizeof(*display_def));
-        ctx->display_definition = display_def;
-    }
-    if (!display_def)
-        return;
-
-    display_def->version = dds_version;
-    display_def->x       = 0;
-    display_def->y       = 0;
-    display_def->width   = bytestream_get_be16(&buf) + 1;
-    display_def->height  = bytestream_get_be16(&buf) + 1;
-
-    if (buf_size < 13)
-        return;
-
-    if (info_byte & 1<<3) { // display_window_flag
-        display_def->x = bytestream_get_be16(&buf);
-        display_def->y = bytestream_get_be16(&buf);
-        display_def->width  = bytestream_get_be16(&buf) - display_def->x + 1;
-        display_def->height = bytestream_get_be16(&buf) - display_def->y + 1;
-    }
-}
-
-static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
-                                        int buf_size, AVSubtitle *sub)
-{
-    DVBSubContext *ctx = avctx->priv_data;
-    DVBSubDisplayDefinition *display_def = ctx->display_definition;
-
-    DVBSubRegion *region;
-    DVBSubRegionDisplay *display;
-    AVSubtitleRect *rect;
-    DVBSubCLUT *clut;
-    uint32_t *clut_table;
-    int i;
-    int offset_x=0, offset_y=0;
-
-    sub->rects = NULL;
-    sub->start_display_time = 0;
-    sub->end_display_time = ctx->time_out * 1000;
-    sub->format = 0;
-
-    if (display_def) {
-        offset_x = display_def->x;
-        offset_y = display_def->y;
-    }
-
-    sub->num_rects = ctx->display_list_size;
-
-    if (sub->num_rects > 0){
-        sub->rects = av_mallocz(sizeof(*sub->rects) * sub->num_rects);
-        for(i=0; i<sub->num_rects; i++)
-            sub->rects[i] = av_mallocz(sizeof(*sub->rects[i]));
-    }
-
-    i = 0;
-
-    for (display = ctx->display_list; display; display = display->next) {
-        region = get_region(ctx, display->region_id);
-        rect = sub->rects[i];
-
-        if (!region)
-            continue;
-
-        rect->x = display->x_pos + offset_x;
-        rect->y = display->y_pos + offset_y;
-        rect->w = region->width;
-        rect->h = region->height;
-        rect->nb_colors = 16;
-        rect->type      = SUBTITLE_BITMAP;
-        rect->pict.linesize[0] = region->width;
-
-        clut = get_clut(ctx, region->clut);
-
-        if (!clut)
-            clut = &default_clut;
-
-        switch (region->depth) {
-        case 2:
-            clut_table = clut->clut4;
-            break;
-        case 8:
-            clut_table = clut->clut256;
-            break;
-        case 4:
-        default:
-            clut_table = clut->clut16;
-            break;
-        }
-
-        rect->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
-        memcpy(rect->pict.data[1], clut_table, (1 << region->depth) * sizeof(uint32_t));
-
-        rect->pict.data[0] = av_malloc(region->buf_size);
-        memcpy(rect->pict.data[0], region->pbuf, region->buf_size);
-
-        i++;
-    }
-
-    sub->num_rects = i;
-
-#ifdef DEBUG
-    save_display_set(ctx);
-#endif
-
-    return 1;
-}
-
-static int dvbsub_decode(AVCodecContext *avctx,
-                         void *data, int *data_size,
-                         AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    DVBSubContext *ctx = avctx->priv_data;
-    AVSubtitle *sub = data;
-    const uint8_t *p, *p_end;
-    int segment_type;
-    int page_id;
-    int segment_length;
-    int i;
-
-    av_dlog(avctx, "DVB sub packet:\n");
-
-    for (i=0; i < buf_size; i++) {
-        av_dlog(avctx, "%02x ", buf[i]);
-        if (i % 16 == 15)
-            av_dlog(avctx, "\n");
-    }
-
-    if (i % 16)
-        av_dlog(avctx, "\n");
-
-    if (buf_size <= 6 || *buf != 0x0f) {
-        av_dlog(avctx, "incomplete or broken packet");
-        return -1;
-    }
-
-    p = buf;
-    p_end = buf + buf_size;
-
-    while (p_end - p >= 6 && *p == 0x0f) {
-        p += 1;
-        segment_type = *p++;
-        page_id = AV_RB16(p);
-        p += 2;
-        segment_length = AV_RB16(p);
-        p += 2;
-
-        if (p_end - p < segment_length) {
-            av_dlog(avctx, "incomplete or broken packet");
-            return -1;
-        }
-
-        if (page_id == ctx->composition_id || page_id == ctx->ancillary_id ||
-            ctx->composition_id == -1 || ctx->ancillary_id == -1) {
-            switch (segment_type) {
-            case DVBSUB_PAGE_SEGMENT:
-                dvbsub_parse_page_segment(avctx, p, segment_length);
-                break;
-            case DVBSUB_REGION_SEGMENT:
-                dvbsub_parse_region_segment(avctx, p, segment_length);
-                break;
-            case DVBSUB_CLUT_SEGMENT:
-                dvbsub_parse_clut_segment(avctx, p, segment_length);
-                break;
-            case DVBSUB_OBJECT_SEGMENT:
-                dvbsub_parse_object_segment(avctx, p, segment_length);
-                break;
-            case DVBSUB_DISPLAYDEFINITION_SEGMENT:
-                dvbsub_parse_display_definition_segment(avctx, p, segment_length);
-            case DVBSUB_DISPLAY_SEGMENT:
-                *data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub);
-                break;
-            default:
-                av_dlog(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
-                        segment_type, page_id, segment_length);
-                break;
-            }
-        }
-
-        p += segment_length;
-    }
-
-    return p - buf;
-}
-
-
-AVCodec ff_dvbsub_decoder = {
-    .name           = "dvbsub",
-    .long_name      = NULL_IF_CONFIG_SMALL("DVB subtitles"),
-    .type           = AVMEDIA_TYPE_SUBTITLE,
-    .id             = AV_CODEC_ID_DVB_SUBTITLE,
-    .priv_data_size = sizeof(DVBSubContext),
-    .init           = dvbsub_init_decoder,
-    .close          = dvbsub_close_decoder,
-    .decode         = dvbsub_decode,
-};
diff --git a/deps/libav/libavcodec/dvdata.c b/deps/libav/libavcodec/dvdata.c
deleted file mode 100644
index f9c22ac..0000000
--- a/deps/libav/libavcodec/dvdata.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Constants for DV codec
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Constants for DV codec.
- */
-
-#include <stdint.h>
-
-#include "dvdata.h"
-
-/* unquant tables (not used directly) */
-const uint8_t ff_dv_quant_shifts[22][4] = {
-  { 3,3,4,4 },
-  { 3,3,4,4 },
-  { 2,3,3,4 },
-  { 2,3,3,4 },
-  { 2,2,3,3 },
-  { 2,2,3,3 },
-  { 1,2,2,3 },
-  { 1,2,2,3 },
-  { 1,1,2,2 },
-  { 1,1,2,2 },
-  { 0,1,1,2 },
-  { 0,1,1,2 },
-  { 0,0,1,1 },
-  { 0,0,1,1 },
-  { 0,0,0,1 },
-  { 0,0,0,0 },
-  { 0,0,0,0 },
-  { 0,0,0,0 },
-  { 0,0,0,0 },
-  { 0,0,0,0 },
-  { 0,0,0,0 },
-  { 0,0,0,0 },
-};
-
-const uint8_t ff_dv_quant_offset[4] = { 6,  3,  0,  1 };
-
-const int ff_dv_iweight_88[64] = {
- 32768, 16710, 16710, 17735, 17015, 17735, 18197, 18079,
- 18079, 18197, 18725, 18559, 19196, 18559, 18725, 19284,
- 19108, 19692, 19692, 19108, 19284, 21400, 19645, 20262,
- 20214, 20262, 19645, 21400, 22733, 21845, 20867, 20815,
- 20815, 20867, 21845, 22733, 23173, 23173, 21400, 21400,
- 21400, 23173, 23173, 24600, 23764, 22017, 22017, 23764,
- 24600, 25267, 24457, 22672, 24457, 25267, 25971, 25191,
- 25191, 25971, 26715, 27962, 26715, 29642, 29642, 31536,
-};
-const int ff_dv_iweight_248[64] = {
- 32768, 17735, 16710, 18079, 18725, 21400, 17735, 19196,
- 19108, 21845, 16384, 17735, 18725, 21400, 16710, 18079,
- 20262, 23173, 18197, 19692, 18725, 20262, 20815, 23764,
- 17735, 19196, 19108, 21845, 20262, 23173, 18197, 19692,
- 21400, 24457, 19284, 20867, 21400, 23173, 22017, 25191,
- 18725, 20262, 20815, 23764, 21400, 24457, 19284, 20867,
- 24457, 27962, 22733, 24600, 25971, 29642, 21400, 23173,
- 22017, 25191, 24457, 27962, 22733, 24600, 25971, 29642,
-};
-
-/**
- * The "inverse" DV100 weights are actually just the spec weights (zig-zagged).
- */
-const int ff_dv_iweight_1080_y[64] = {
-    128,  16,  16,  17,  17,  17,  18,  18,
-     18,  18,  18,  18,  19,  18,  18,  19,
-     19,  19,  19,  19,  19,  42,  38,  40,
-     40,  40,  38,  42,  44,  43,  41,  41,
-     41,  41,  43,  44,  45,  45,  42,  42,
-     42,  45,  45,  48,  46,  43,  43,  46,
-     48,  49,  48,  44,  48,  49, 101,  98,
-     98, 101, 104, 109, 104, 116, 116, 123,
-};
-const int ff_dv_iweight_1080_c[64] = {
-    128,  16,  16,  17,  17,  17,  25,  25,
-     25,  25,  26,  25,  26,  25,  26,  26,
-     26,  27,  27,  26,  26,  42,  38,  40,
-     40,  40,  38,  42,  44,  43,  41,  41,
-     41,  41,  43,  44,  91,  91,  84,  84,
-     84,  91,  91,  96,  93,  86,  86,  93,
-     96, 197, 191, 177, 191, 197, 203, 197,
-    197, 203, 209, 219, 209, 232, 232, 246,
-};
-const int ff_dv_iweight_720_y[64] = {
-    128,  16,  16,  17,  17,  17,  18,  18,
-     18,  18,  18,  18,  19,  18,  18,  19,
-     19,  19,  19,  19,  19,  42,  38,  40,
-     40,  40,  38,  42,  44,  43,  41,  41,
-     41,  41,  43,  44,  68,  68,  63,  63,
-     63,  68,  68,  96,  92,  86,  86,  92,
-     96,  98,  96,  88,  96,  98, 202, 196,
-    196, 202, 208, 218, 208, 232, 232, 246,
-};
-const int ff_dv_iweight_720_c[64] = {
-    128,  24,  24,  26,  26,  26,  36,  36,
-     36,  36,  36,  36,  38,  36,  36,  38,
-     38,  38,  38,  38,  38,  84,  76,  80,
-     80,  80,  76,  84,  88,  86,  82,  82,
-     82,  82,  86,  88, 182, 182, 168, 168,
-    168, 182, 182, 192, 186, 192, 172, 186,
-    192, 394, 382, 354, 382, 394, 406, 394,
-    394, 406, 418, 438, 418, 464, 464, 492,
-};
-
-/*
- * There's a catch about the following three tables: the mapping they establish
- * between (run, level) and vlc is not 1-1. So you have to watch out for that
- * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82.
- */
-const uint16_t ff_dv_vlc_bits[NB_DV_VLC] = {
- 0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016,
- 0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a,
- 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2,
- 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea,
- 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x01e0, 0x01e1, 0x01e2,
- 0x01e3, 0x01e4, 0x01e5, 0x01e6, 0x01e7, 0x01e8, 0x01e9, 0x01ea,
- 0x01eb, 0x01ec, 0x01ed, 0x01ee, 0x01ef, 0x03e0, 0x03e1, 0x03e2,
- 0x03e3, 0x03e4, 0x03e5, 0x03e6, 0x07ce, 0x07cf, 0x07d0, 0x07d1,
- 0x07d2, 0x07d3, 0x07d4, 0x07d5, 0x0fac, 0x0fad, 0x0fae, 0x0faf,
- 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7,
- 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0fbd, 0x0fbe, 0x0fbf,
- 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
- 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f,
- 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
- 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f,
- 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
- 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, 0x1fac, 0x1fad, 0x1fae, 0x1faf,
- 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x1fb5, 0x1fb6, 0x1fb7,
- 0x1fb8, 0x1fb9, 0x1fba, 0x1fbb, 0x1fbc, 0x1fbd, 0x1fbe, 0x1fbf,
- 0x7f00, 0x7f01, 0x7f02, 0x7f03, 0x7f04, 0x7f05, 0x7f06, 0x7f07,
- 0x7f08, 0x7f09, 0x7f0a, 0x7f0b, 0x7f0c, 0x7f0d, 0x7f0e, 0x7f0f,
- 0x7f10, 0x7f11, 0x7f12, 0x7f13, 0x7f14, 0x7f15, 0x7f16, 0x7f17,
- 0x7f18, 0x7f19, 0x7f1a, 0x7f1b, 0x7f1c, 0x7f1d, 0x7f1e, 0x7f1f,
- 0x7f20, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27,
- 0x7f28, 0x7f29, 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2e, 0x7f2f,
- 0x7f30, 0x7f31, 0x7f32, 0x7f33, 0x7f34, 0x7f35, 0x7f36, 0x7f37,
- 0x7f38, 0x7f39, 0x7f3a, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, 0x7f3f,
- 0x7f40, 0x7f41, 0x7f42, 0x7f43, 0x7f44, 0x7f45, 0x7f46, 0x7f47,
- 0x7f48, 0x7f49, 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f,
- 0x7f50, 0x7f51, 0x7f52, 0x7f53, 0x7f54, 0x7f55, 0x7f56, 0x7f57,
- 0x7f58, 0x7f59, 0x7f5a, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f5f,
- 0x7f60, 0x7f61, 0x7f62, 0x7f63, 0x7f64, 0x7f65, 0x7f66, 0x7f67,
- 0x7f68, 0x7f69, 0x7f6a, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6e, 0x7f6f,
- 0x7f70, 0x7f71, 0x7f72, 0x7f73, 0x7f74, 0x7f75, 0x7f76, 0x7f77,
- 0x7f78, 0x7f79, 0x7f7a, 0x7f7b, 0x7f7c, 0x7f7d, 0x7f7e, 0x7f7f,
- 0x7f80, 0x7f81, 0x7f82, 0x7f83, 0x7f84, 0x7f85, 0x7f86, 0x7f87,
- 0x7f88, 0x7f89, 0x7f8a, 0x7f8b, 0x7f8c, 0x7f8d, 0x7f8e, 0x7f8f,
- 0x7f90, 0x7f91, 0x7f92, 0x7f93, 0x7f94, 0x7f95, 0x7f96, 0x7f97,
- 0x7f98, 0x7f99, 0x7f9a, 0x7f9b, 0x7f9c, 0x7f9d, 0x7f9e, 0x7f9f,
- 0x7fa0, 0x7fa1, 0x7fa2, 0x7fa3, 0x7fa4, 0x7fa5, 0x7fa6, 0x7fa7,
- 0x7fa8, 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7faf,
- 0x7fb0, 0x7fb1, 0x7fb2, 0x7fb3, 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7,
- 0x7fb8, 0x7fb9, 0x7fba, 0x7fbb, 0x7fbc, 0x7fbd, 0x7fbe, 0x7fbf,
- 0x7fc0, 0x7fc1, 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc5, 0x7fc6, 0x7fc7,
- 0x7fc8, 0x7fc9, 0x7fca, 0x7fcb, 0x7fcc, 0x7fcd, 0x7fce, 0x7fcf,
- 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd4, 0x7fd5, 0x7fd6, 0x7fd7,
- 0x7fd8, 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fdf,
- 0x7fe0, 0x7fe1, 0x7fe2, 0x7fe3, 0x7fe4, 0x7fe5, 0x7fe6, 0x7fe7,
- 0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef,
- 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7,
- 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
- 0x0006,
-};
-
-const uint8_t ff_dv_vlc_len[NB_DV_VLC] = {
-  2,  3,  4,  4,  4,  5,  5,  5,
-  5,  6,  6,  6,  6,  7,  7,  7,
-  7,  7,  7,  7,  7,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  9,  9, 10, 10, 10,
- 10, 10, 10, 10, 11, 11, 11, 11,
- 11, 11, 11, 11, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
-  4,
-};
-
-const uint8_t ff_dv_vlc_run[NB_DV_VLC] = {
-  0,  0,  1,  0,  0,  2,  1,  0,
-  0,  3,  4,  0,  0,  5,  6,  2,
-  1,  1,  0,  0,  0,  7,  8,  9,
- 10,  3,  4,  2,  1,  1,  1,  0,
-  0,  0,  0,  0,  0, 11, 12, 13,
- 14,  5,  6,  3,  4,  2,  2,  1,
-  0,  0,  0,  0,  0,  5,  3,  3,
-  2,  1,  1,  1,  0,  1,  6,  4,
-  3,  1,  1,  1,  2,  3,  4,  5,
-  7,  8,  9, 10,  7,  8,  4,  3,
-  2,  2,  2,  2,  2,  1,  1,  1,
-  0,  1,  2,  3,  4,  5,  6,  7,
-  8,  9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-127,
-};
-
-const uint8_t ff_dv_vlc_level[NB_DV_VLC] = {
-   1,   2,   1,   3,   4,   1,   2,   5,
-   6,   1,   1,   7,   8,   1,   1,   2,
-   3,   4,   9,  10,  11,   1,   1,   1,
-   1,   2,   2,   3,   5,   6,   7,  12,
-  13,  14,  15,  16,  17,   1,   1,   1,
-   1,   2,   2,   3,   3,   4,   5,   8,
-  18,  19,  20,  21,  22,   3,   4,   5,
-   6,   9,  10,  11,   0,   0,   3,   4,
-   6,  12,  13,  14,   0,   0,   0,   0,
-   2,   2,   2,   2,   3,   3,   5,   7,
-   7,   8,   9,  10,  11,  15,  16,  17,
-   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   1,   2,   3,   4,   5,   6,   7,
-   8,   9,  10,  11,  12,  13,  14,  15,
-  16,  17,  18,  19,  20,  21,  22,  23,
-  24,  25,  26,  27,  28,  29,  30,  31,
-  32,  33,  34,  35,  36,  37,  38,  39,
-  40,  41,  42,  43,  44,  45,  46,  47,
-  48,  49,  50,  51,  52,  53,  54,  55,
-  56,  57,  58,  59,  60,  61,  62,  63,
-  64,  65,  66,  67,  68,  69,  70,  71,
-  72,  73,  74,  75,  76,  77,  78,  79,
-  80,  81,  82,  83,  84,  85,  86,  87,
-  88,  89,  90,  91,  92,  93,  94,  95,
-  96,  97,  98,  99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 127,
- 128, 129, 130, 131, 132, 133, 134, 135,
- 136, 137, 138, 139, 140, 141, 142, 143,
- 144, 145, 146, 147, 148, 149, 150, 151,
- 152, 153, 154, 155, 156, 157, 158, 159,
- 160, 161, 162, 163, 164, 165, 166, 167,
- 168, 169, 170, 171, 172, 173, 174, 175,
- 176, 177, 178, 179, 180, 181, 182, 183,
- 184, 185, 186, 187, 188, 189, 190, 191,
- 192, 193, 194, 195, 196, 197, 198, 199,
- 200, 201, 202, 203, 204, 205, 206, 207,
- 208, 209, 210, 211, 212, 213, 214, 215,
- 216, 217, 218, 219, 220, 221, 222, 223,
- 224, 225, 226, 227, 228, 229, 230, 231,
- 232, 233, 234, 235, 236, 237, 238, 239,
- 240, 241, 242, 243, 244, 245, 246, 247,
- 248, 249, 250, 251, 252, 253, 254, 255,
-   0,
-};
diff --git a/deps/libav/libavcodec/dvdata.h b/deps/libav/libavcodec/dvdata.h
deleted file mode 100644
index 164ef1b..0000000
--- a/deps/libav/libavcodec/dvdata.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DVDATA_H
-#define AVCODEC_DVDATA_H
-
-#include <stdint.h>
-
-extern const uint8_t ff_dv_quant_shifts[22][4];
-extern const uint8_t ff_dv_quant_offset[4];
-
-extern const int ff_dv_iweight_88[64];
-extern const int ff_dv_iweight_248[64];
-extern const int ff_dv_iweight_1080_y[64];
-extern const int ff_dv_iweight_1080_c[64];
-extern const int ff_dv_iweight_720_y[64];
-extern const int ff_dv_iweight_720_c[64];
-
-#define NB_DV_VLC 409
-
-extern const uint16_t ff_dv_vlc_bits[NB_DV_VLC];
-extern const uint8_t ff_dv_vlc_len[NB_DV_VLC];
-extern const uint8_t ff_dv_vlc_run[NB_DV_VLC];
-extern const uint8_t ff_dv_vlc_level[NB_DV_VLC];
-
-#endif /* AVCODEC_DVDATA_H */
diff --git a/deps/libav/libavcodec/dvdec.c b/deps/libav/libavcodec/dvdec.c
deleted file mode 100644
index ef9ba4c..0000000
--- a/deps/libav/libavcodec/dvdec.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * DV decoder
- * Copyright (c) 2002 Fabrice Bellard
- * Copyright (c) 2004 Roman Shaposhnik
- *
- * 50 Mbps (DVCPRO50) support
- * Copyright (c) 2006 Daniel Maas <dmaas at maasdigital.com>
- *
- * 100 Mbps (DVCPRO HD) support
- * Initial code by Daniel Maas <dmaas at maasdigital.com> (funded by BBC R&D)
- * Final code by Roman Shaposhnik
- *
- * Many thanks to Dan Dennedy <dan at dennedy.org> for providing wealth
- * of DV technical info.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DV decoder
- */
-
-#include "libavutil/internal.h"
-#include "libavutil/pixdesc.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "simple_idct.h"
-#include "dvdata.h"
-#include "dv.h"
-
-typedef struct BlockInfo {
-    const uint32_t *factor_table;
-    const uint8_t *scan_table;
-    uint8_t pos; /* position in block */
-    void (*idct_put)(uint8_t *dest, int line_size, int16_t *block);
-    uint8_t partial_bit_count;
-    uint32_t partial_bit_buffer;
-    int shift_offset;
-} BlockInfo;
-
-static const int dv_iweight_bits = 14;
-
-/* decode AC coefficients */
-static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block)
-{
-    int last_index = gb->size_in_bits;
-    const uint8_t  *scan_table   = mb->scan_table;
-    const uint32_t *factor_table = mb->factor_table;
-    int pos               = mb->pos;
-    int partial_bit_count = mb->partial_bit_count;
-    int level, run, vlc_len, index;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-
-    /* if we must parse a partial VLC, we do it here */
-    if (partial_bit_count > 0) {
-        re_cache = re_cache >> partial_bit_count | mb->partial_bit_buffer;
-        re_index -= partial_bit_count;
-        mb->partial_bit_count = 0;
-    }
-
-    /* get the AC coefficients until last_index is reached */
-    for (;;) {
-        av_dlog(NULL, "%2d: bits=%04x index=%d\n", pos, SHOW_UBITS(re, gb, 16),
-                re_index);
-        /* our own optimized GET_RL_VLC */
-        index   = NEG_USR32(re_cache, TEX_VLC_BITS);
-        vlc_len = ff_dv_rl_vlc[index].len;
-        if (vlc_len < 0) {
-            index = NEG_USR32((unsigned)re_cache << TEX_VLC_BITS, -vlc_len) +
-                    ff_dv_rl_vlc[index].level;
-            vlc_len = TEX_VLC_BITS - vlc_len;
-        }
-        level = ff_dv_rl_vlc[index].level;
-        run   = ff_dv_rl_vlc[index].run;
-
-        /* gotta check if we're still within gb boundaries */
-        if (re_index + vlc_len > last_index) {
-            /* should be < 16 bits otherwise a codeword could have been parsed */
-            mb->partial_bit_count = last_index - re_index;
-            mb->partial_bit_buffer = re_cache & ~(-1u >> mb->partial_bit_count);
-            re_index = last_index;
-            break;
-        }
-        re_index += vlc_len;
-
-        av_dlog(NULL, "run=%d level=%d\n", run, level);
-        pos += run;
-        if (pos >= 64)
-            break;
-
-        level = (level * factor_table[pos] + (1 << (dv_iweight_bits - 1))) >> dv_iweight_bits;
-        block[scan_table[pos]] = level;
-
-        UPDATE_CACHE(re, gb);
-    }
-    CLOSE_READER(re, gb);
-    mb->pos = pos;
-}
-
-static inline void bit_copy(PutBitContext *pb, GetBitContext *gb)
-{
-    int bits_left = get_bits_left(gb);
-    while (bits_left >= MIN_CACHE_BITS) {
-        put_bits(pb, MIN_CACHE_BITS, get_bits(gb, MIN_CACHE_BITS));
-        bits_left -= MIN_CACHE_BITS;
-    }
-    if (bits_left > 0) {
-        put_bits(pb, bits_left, get_bits(gb, bits_left));
-    }
-}
-
-/* mb_x and mb_y are in units of 8 pixels */
-static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
-{
-    DVVideoContext *s = avctx->priv_data;
-    DVwork_chunk *work_chunk = arg;
-    int quant, dc, dct_mode, class1, j;
-    int mb_index, mb_x, mb_y, last_index;
-    int y_stride, linesize;
-    int16_t *block, *block1;
-    int c_offset;
-    uint8_t *y_ptr;
-    const uint8_t *buf_ptr;
-    PutBitContext pb, vs_pb;
-    GetBitContext gb;
-    BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1;
-    LOCAL_ALIGNED_16(int16_t, sblock, [5*DV_MAX_BPM], [64]);
-    LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [  80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
-    LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5*80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
-    const int log2_blocksize = 3;
-    int is_field_mode[5];
-
-    assert((((int)mb_bit_buffer) & 7) == 0);
-    assert((((int)vs_bit_buffer) & 7) == 0);
-
-    memset(sblock, 0, 5*DV_MAX_BPM*sizeof(*sblock));
-
-    /* pass 1: read DC and AC coefficients in blocks */
-    buf_ptr = &s->buf[work_chunk->buf_offset*80];
-    block1  = &sblock[0][0];
-    mb1     = mb_data;
-    init_put_bits(&vs_pb, vs_bit_buffer, 5 * 80);
-    for (mb_index = 0; mb_index < 5; mb_index++, mb1 += s->sys->bpm, block1 += s->sys->bpm * 64) {
-        /* skip header */
-        quant = buf_ptr[3] & 0x0f;
-        buf_ptr += 4;
-        init_put_bits(&pb, mb_bit_buffer, 80);
-        mb    = mb1;
-        block = block1;
-        is_field_mode[mb_index] = 0;
-        for (j = 0; j < s->sys->bpm; j++) {
-            last_index = s->sys->block_sizes[j];
-            init_get_bits(&gb, buf_ptr, last_index);
-
-            /* get the DC */
-            dc       = get_sbits(&gb, 9);
-            dct_mode = get_bits1(&gb);
-            class1   = get_bits(&gb, 2);
-            if (DV_PROFILE_IS_HD(s->sys)) {
-                mb->idct_put     = s->idct_put[0];
-                mb->scan_table   = s->dv_zigzag[0];
-                mb->factor_table = &s->sys->idct_factor[(j >= 4)*4*16*64 + class1*16*64 + quant*64];
-                is_field_mode[mb_index] |= !j && dct_mode;
-            } else {
-                mb->idct_put     = s->idct_put[dct_mode && log2_blocksize == 3];
-                mb->scan_table   = s->dv_zigzag[dct_mode];
-                mb->factor_table = &s->sys->idct_factor[(class1 == 3)*2*22*64 + dct_mode*22*64 +
-                                                        (quant + ff_dv_quant_offset[class1])*64];
-            }
-            dc = dc << 2;
-            /* convert to unsigned because 128 is not added in the
-               standard IDCT */
-            dc += 1024;
-            block[0] = dc;
-            buf_ptr += last_index >> 3;
-            mb->pos               = 0;
-            mb->partial_bit_count = 0;
-
-            av_dlog(avctx, "MB block: %d, %d ", mb_index, j);
-            dv_decode_ac(&gb, mb, block);
-
-            /* write the remaining bits in a new buffer only if the
-               block is finished */
-            if (mb->pos >= 64)
-                bit_copy(&pb, &gb);
-
-            block += 64;
-            mb++;
-        }
-
-        /* pass 2: we can do it just after */
-        av_dlog(avctx, "***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index);
-        block = block1;
-        mb    = mb1;
-        init_get_bits(&gb, mb_bit_buffer, put_bits_count(&pb));
-        put_bits32(&pb, 0); // padding must be zeroed
-        flush_put_bits(&pb);
-        for (j = 0; j < s->sys->bpm; j++, block += 64, mb++) {
-            if (mb->pos < 64 && get_bits_left(&gb) > 0) {
-                dv_decode_ac(&gb, mb, block);
-                /* if still not finished, no need to parse other blocks */
-                if (mb->pos < 64)
-                    break;
-            }
-        }
-        /* all blocks are finished, so the extra bytes can be used at
-           the video segment level */
-        if (j >= s->sys->bpm)
-            bit_copy(&vs_pb, &gb);
-    }
-
-    /* we need a pass over the whole video segment */
-    av_dlog(avctx, "***pass 3 size=%d\n", put_bits_count(&vs_pb));
-    block = &sblock[0][0];
-    mb    = mb_data;
-    init_get_bits(&gb, vs_bit_buffer, put_bits_count(&vs_pb));
-    put_bits32(&vs_pb, 0); // padding must be zeroed
-    flush_put_bits(&vs_pb);
-    for (mb_index = 0; mb_index < 5; mb_index++) {
-        for (j = 0; j < s->sys->bpm; j++) {
-            if (mb->pos < 64) {
-                av_dlog(avctx, "start %d:%d\n", mb_index, j);
-                dv_decode_ac(&gb, mb, block);
-            }
-            if (mb->pos >= 64 && mb->pos < 127)
-                av_log(avctx, AV_LOG_ERROR, "AC EOB marker is absent pos=%d\n", mb->pos);
-            block += 64;
-            mb++;
-        }
-    }
-
-    /* compute idct and place blocks */
-    block = &sblock[0][0];
-    mb    = mb_data;
-    for (mb_index = 0; mb_index < 5; mb_index++) {
-        dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);
-
-        /* idct_put'ting luminance */
-        if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) ||
-            (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||
-            (s->sys->height >= 720 && mb_y != 134)) {
-            y_stride = (s->frame->linesize[0] << ((!is_field_mode[mb_index]) * log2_blocksize));
-        } else {
-            y_stride = (2 << log2_blocksize);
-        }
-        y_ptr = s->frame->data[0] + ((mb_y * s->frame->linesize[0] + mb_x) << log2_blocksize);
-        linesize = s->frame->linesize[0] << is_field_mode[mb_index];
-        mb[0]    .idct_put(y_ptr                                   , linesize, block + 0*64);
-        if (s->sys->video_stype == 4) { /* SD 422 */
-            mb[2].idct_put(y_ptr + (1 << log2_blocksize)           , linesize, block + 2*64);
-        } else {
-            mb[1].idct_put(y_ptr + (1 << log2_blocksize)           , linesize, block + 1*64);
-            mb[2].idct_put(y_ptr                         + y_stride, linesize, block + 2*64);
-            mb[3].idct_put(y_ptr + (1 << log2_blocksize) + y_stride, linesize, block + 3*64);
-        }
-        mb += 4;
-        block += 4*64;
-
-        /* idct_put'ting chrominance */
-        c_offset = (((mb_y >>  (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->frame->linesize[1] +
-                     (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << log2_blocksize);
-        for (j = 2; j; j--) {
-            uint8_t *c_ptr = s->frame->data[j] + c_offset;
-            if (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) {
-                  uint64_t aligned_pixels[64/8];
-                  uint8_t *pixels = (uint8_t*)aligned_pixels;
-                  uint8_t *c_ptr1, *ptr1;
-                  int x, y;
-                  mb->idct_put(pixels, 8, block);
-                  for (y = 0; y < (1 << log2_blocksize); y++, c_ptr += s->frame->linesize[j], pixels += 8) {
-                      ptr1   = pixels + (1 << (log2_blocksize - 1));
-                      c_ptr1 = c_ptr + (s->frame->linesize[j] << log2_blocksize);
-                      for (x = 0; x < (1 << (log2_blocksize - 1)); x++) {
-                          c_ptr[x]  = pixels[x];
-                          c_ptr1[x] = ptr1[x];
-                      }
-                  }
-                  block += 64; mb++;
-            } else {
-                  y_stride = (mb_y == 134) ? (1 << log2_blocksize) :
-                                             s->frame->linesize[j] << ((!is_field_mode[mb_index]) * log2_blocksize);
-                  linesize = s->frame->linesize[j] << is_field_mode[mb_index];
-                  (mb++)->    idct_put(c_ptr           , linesize, block); block += 64;
-                  if (s->sys->bpm == 8) {
-                      (mb++)->idct_put(c_ptr + y_stride, linesize, block); block += 64;
-                  }
-            }
-        }
-    }
-    return 0;
-}
-
-/* NOTE: exactly one frame must be given (120000 bytes for NTSC,
-   144000 bytes for PAL - or twice those for 50Mbps) */
-static int dvvideo_decode_frame(AVCodecContext *avctx,
-                                 void *data, int *got_frame,
-                                 AVPacket *avpkt)
-{
-    uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    DVVideoContext *s = avctx->priv_data;
-    const uint8_t* vsc_pack;
-    int apt, is16_9, ret;
-
-    s->sys = avpriv_dv_frame_profile(s->sys, buf, buf_size);
-    if (!s->sys || buf_size < s->sys->frame_size || ff_dv_init_dynamic_tables(s->sys)) {
-        av_log(avctx, AV_LOG_ERROR, "could not find dv frame profile\n");
-        return -1; /* NOTE: we only accept several full frames */
-    }
-
-    s->frame            = data;
-    s->frame->key_frame = 1;
-    s->frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->pix_fmt   = s->sys->pix_fmt;
-    avctx->time_base = s->sys->time_base;
-
-    ret = ff_set_dimensions(avctx, s->sys->width, s->sys->height);
-    if (ret < 0)
-        return ret;
-
-    if (ff_get_buffer(avctx, s->frame, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
-    s->frame->interlaced_frame = 1;
-    s->frame->top_field_first  = 0;
-
-    s->buf = buf;
-    avctx->execute(avctx, dv_decode_video_segment, s->sys->work_chunks, NULL,
-                   dv_work_pool_size(s->sys), sizeof(DVwork_chunk));
-
-    emms_c();
-
-    /* return image */
-    *got_frame = 1;
-
-    /* Determine the codec's sample_aspect ratio from the packet */
-    vsc_pack = buf + 80*5 + 48 + 5;
-    if ( *vsc_pack == dv_video_control ) {
-        apt = buf[4] & 0x07;
-        is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 || (!apt && (vsc_pack[2] & 0x07) == 0x07)));
-        avctx->sample_aspect_ratio = s->sys->sar[is16_9];
-    }
-
-    return s->sys->frame_size;
-}
-
-AVCodec ff_dvvideo_decoder = {
-    .name           = "dvvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DVVIDEO,
-    .priv_data_size = sizeof(DVVideoContext),
-    .init           = ff_dvvideo_init,
-    .decode         = dvvideo_decode_frame,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
-};
diff --git a/deps/libav/libavcodec/dvdsub_parser.c b/deps/libav/libavcodec/dvdsub_parser.c
deleted file mode 100644
index 2ad3b33..0000000
--- a/deps/libav/libavcodec/dvdsub_parser.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DVD subtitle decoding
- * Copyright (c) 2005 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-
-/* parser definition */
-typedef struct DVDSubParseContext {
-    uint8_t *packet;
-    int packet_len;
-    int packet_index;
-} DVDSubParseContext;
-
-static av_cold int dvdsub_parse_init(AVCodecParserContext *s)
-{
-    return 0;
-}
-
-static int dvdsub_parse(AVCodecParserContext *s,
-                        AVCodecContext *avctx,
-                        const uint8_t **poutbuf, int *poutbuf_size,
-                        const uint8_t *buf, int buf_size)
-{
-    DVDSubParseContext *pc = s->priv_data;
-
-    if (pc->packet_index == 0) {
-        if (buf_size < 2)
-            return 0;
-        pc->packet_len = AV_RB16(buf);
-        if (pc->packet_len == 0) /* HD-DVD subpicture packet */
-            pc->packet_len = AV_RB32(buf+2);
-        av_freep(&pc->packet);
-        pc->packet = av_malloc(pc->packet_len);
-    }
-    if (pc->packet) {
-        if (pc->packet_index + buf_size <= pc->packet_len) {
-            memcpy(pc->packet + pc->packet_index, buf, buf_size);
-            pc->packet_index += buf_size;
-            if (pc->packet_index >= pc->packet_len) {
-                *poutbuf = pc->packet;
-                *poutbuf_size = pc->packet_len;
-                pc->packet_index = 0;
-                return buf_size;
-            }
-        } else {
-            /* erroneous size */
-            pc->packet_index = 0;
-        }
-    }
-    *poutbuf = NULL;
-    *poutbuf_size = 0;
-    return buf_size;
-}
-
-static av_cold void dvdsub_parse_close(AVCodecParserContext *s)
-{
-    DVDSubParseContext *pc = s->priv_data;
-    av_freep(&pc->packet);
-}
-
-AVCodecParser ff_dvdsub_parser = {
-    .codec_ids      = { AV_CODEC_ID_DVD_SUBTITLE },
-    .priv_data_size = sizeof(DVDSubParseContext),
-    .parser_init    = dvdsub_parse_init,
-    .parser_parse   = dvdsub_parse,
-    .parser_close   = dvdsub_parse_close,
-};
diff --git a/deps/libav/libavcodec/dvdsubdec.c b/deps/libav/libavcodec/dvdsubdec.c
deleted file mode 100644
index 6b168cb..0000000
--- a/deps/libav/libavcodec/dvdsubdec.c
+++ /dev/null
@@ -1,550 +0,0 @@
-/*
- * DVD subtitle decoding
- * Copyright (c) 2005 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "internal.h"
-
-#include "libavutil/attributes.h"
-#include "libavutil/colorspace.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/avstring.h"
-
-typedef struct DVDSubContext {
-    uint32_t palette[16];
-    int      has_palette;
-} DVDSubContext;
-
-static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *rgba, int num_values)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    uint8_t r, g, b;
-    int i, y, cb, cr;
-    int r_add, g_add, b_add;
-
-    for (i = num_values; i > 0; i--) {
-        y = *ycbcr++;
-        cr = *ycbcr++;
-        cb = *ycbcr++;
-        YUV_TO_RGB1_CCIR(cb, cr);
-        YUV_TO_RGB2_CCIR(r, g, b, y);
-        *rgba++ = (*alpha++ << 24) | (r << 16) | (g << 8) | b;
-    }
-}
-
-static int decode_run_2bit(GetBitContext *gb, int *color)
-{
-    unsigned int v, t;
-
-    v = 0;
-    for (t = 1; v < t && t <= 0x40; t <<= 2)
-        v = (v << 4) | get_bits(gb, 4);
-    *color = v & 3;
-    if (v < 4) { /* Code for fill rest of line */
-        return INT_MAX;
-    }
-    return v >> 2;
-}
-
-static int decode_run_8bit(GetBitContext *gb, int *color)
-{
-    int len;
-    int has_run = get_bits1(gb);
-    if (get_bits1(gb))
-        *color = get_bits(gb, 8);
-    else
-        *color = get_bits(gb, 2);
-    if (has_run) {
-        if (get_bits1(gb)) {
-            len = get_bits(gb, 7);
-            if (len == 0)
-                len = INT_MAX;
-            else
-                len += 9;
-        } else
-            len = get_bits(gb, 3) + 2;
-    } else
-        len = 1;
-    return len;
-}
-
-static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
-                      const uint8_t *buf, int start, int buf_size, int is_8bit)
-{
-    GetBitContext gb;
-    int bit_len;
-    int x, y, len, color;
-    uint8_t *d;
-
-    bit_len = (buf_size - start) * 8;
-    init_get_bits(&gb, buf + start, bit_len);
-
-    x = 0;
-    y = 0;
-    d = bitmap;
-    for(;;) {
-        if (get_bits_count(&gb) > bit_len)
-            return -1;
-        if (is_8bit)
-            len = decode_run_8bit(&gb, &color);
-        else
-            len = decode_run_2bit(&gb, &color);
-        len = FFMIN(len, w - x);
-        memset(d + x, color, len);
-        x += len;
-        if (x >= w) {
-            y++;
-            if (y >= h)
-                break;
-            d += linesize;
-            x = 0;
-            /* byte align */
-            align_get_bits(&gb);
-        }
-    }
-    return 0;
-}
-
-static void guess_palette(DVDSubContext* ctx,
-                          uint32_t *rgba_palette,
-                          uint8_t *colormap,
-                          uint8_t *alpha,
-                          uint32_t subtitle_color)
-{
-    uint8_t color_used[16] = { 0 };
-    int nb_opaque_colors, i, level, j, r, g, b;
-
-    if (ctx->has_palette) {
-        for (i = 0; i < 4; i++)
-            rgba_palette[i] = (ctx->palette[colormap[i]] & 0x00ffffff)
-                              | ((alpha[i] * 17) << 24);
-        return;
-    }
-
-    for(i = 0; i < 4; i++)
-        rgba_palette[i] = 0;
-
-    nb_opaque_colors = 0;
-    for(i = 0; i < 4; i++) {
-        if (alpha[i] != 0 && !color_used[colormap[i]]) {
-            color_used[colormap[i]] = 1;
-            nb_opaque_colors++;
-        }
-    }
-
-    if (nb_opaque_colors == 0)
-        return;
-
-    j = nb_opaque_colors;
-    memset(color_used, 0, 16);
-    for(i = 0; i < 4; i++) {
-        if (alpha[i] != 0) {
-            if (!color_used[colormap[i]])  {
-                level = (0xff * j) / nb_opaque_colors;
-                r = (((subtitle_color >> 16) & 0xff) * level) >> 8;
-                g = (((subtitle_color >> 8) & 0xff) * level) >> 8;
-                b = (((subtitle_color >> 0) & 0xff) * level) >> 8;
-                rgba_palette[i] = b | (g << 8) | (r << 16) | ((alpha[i] * 17) << 24);
-                color_used[colormap[i]] = (i + 1);
-                j--;
-            } else {
-                rgba_palette[i] = (rgba_palette[color_used[colormap[i]] - 1] & 0x00ffffff) |
-                                    ((alpha[i] * 17) << 24);
-            }
-        }
-    }
-}
-
-#define READ_OFFSET(a) (big_offsets ? AV_RB32(a) : AV_RB16(a))
-
-static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
-                                const uint8_t *buf, int buf_size)
-{
-    int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos;
-    int big_offsets, offset_size, is_8bit = 0;
-    const uint8_t *yuv_palette = 0;
-    uint8_t colormap[4] = { 0 }, alpha[256] = { 0 };
-    int date;
-    int i;
-    int is_menu = 0;
-
-    if (buf_size < 10)
-        return -1;
-    memset(sub_header, 0, sizeof(*sub_header));
-
-    if (AV_RB16(buf) == 0) {   /* HD subpicture with 4-byte offsets */
-        big_offsets = 1;
-        offset_size = 4;
-        cmd_pos = 6;
-    } else {
-        big_offsets = 0;
-        offset_size = 2;
-        cmd_pos = 2;
-    }
-
-    cmd_pos = READ_OFFSET(buf + cmd_pos);
-
-    while (cmd_pos > 0 && cmd_pos < buf_size - 2 - offset_size) {
-        date = AV_RB16(buf + cmd_pos);
-        next_cmd_pos = READ_OFFSET(buf + cmd_pos + 2);
-        av_dlog(NULL, "cmd_pos=0x%04x next=0x%04x date=%d\n",
-                cmd_pos, next_cmd_pos, date);
-        pos = cmd_pos + 2 + offset_size;
-        offset1 = -1;
-        offset2 = -1;
-        x1 = y1 = x2 = y2 = 0;
-        while (pos < buf_size) {
-            cmd = buf[pos++];
-            av_dlog(NULL, "cmd=%02x\n", cmd);
-            switch(cmd) {
-            case 0x00:
-                /* menu subpicture */
-                is_menu = 1;
-                break;
-            case 0x01:
-                /* set start date */
-                sub_header->start_display_time = (date << 10) / 90;
-                break;
-            case 0x02:
-                /* set end date */
-                sub_header->end_display_time = (date << 10) / 90;
-                break;
-            case 0x03:
-                /* set colormap */
-                if ((buf_size - pos) < 2)
-                    goto fail;
-                colormap[3] = buf[pos] >> 4;
-                colormap[2] = buf[pos] & 0x0f;
-                colormap[1] = buf[pos + 1] >> 4;
-                colormap[0] = buf[pos + 1] & 0x0f;
-                pos += 2;
-                break;
-            case 0x04:
-                /* set alpha */
-                if ((buf_size - pos) < 2)
-                    goto fail;
-                alpha[3] = buf[pos] >> 4;
-                alpha[2] = buf[pos] & 0x0f;
-                alpha[1] = buf[pos + 1] >> 4;
-                alpha[0] = buf[pos + 1] & 0x0f;
-                pos += 2;
-            av_dlog(NULL, "alpha=%x%x%x%x\n", alpha[0],alpha[1],alpha[2],alpha[3]);
-                break;
-            case 0x05:
-            case 0x85:
-                if ((buf_size - pos) < 6)
-                    goto fail;
-                x1 = (buf[pos] << 4) | (buf[pos + 1] >> 4);
-                x2 = ((buf[pos + 1] & 0x0f) << 8) | buf[pos + 2];
-                y1 = (buf[pos + 3] << 4) | (buf[pos + 4] >> 4);
-                y2 = ((buf[pos + 4] & 0x0f) << 8) | buf[pos + 5];
-                if (cmd & 0x80)
-                    is_8bit = 1;
-                av_dlog(NULL, "x1=%d x2=%d y1=%d y2=%d\n", x1, x2, y1, y2);
-                pos += 6;
-                break;
-            case 0x06:
-                if ((buf_size - pos) < 4)
-                    goto fail;
-                offset1 = AV_RB16(buf + pos);
-                offset2 = AV_RB16(buf + pos + 2);
-                av_dlog(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
-                pos += 4;
-                break;
-            case 0x86:
-                if ((buf_size - pos) < 8)
-                    goto fail;
-                offset1 = AV_RB32(buf + pos);
-                offset2 = AV_RB32(buf + pos + 4);
-                av_dlog(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
-                pos += 8;
-                break;
-
-            case 0x83:
-                /* HD set palette */
-                if ((buf_size - pos) < 768)
-                    goto fail;
-                yuv_palette = buf + pos;
-                pos += 768;
-                break;
-            case 0x84:
-                /* HD set contrast (alpha) */
-                if ((buf_size - pos) < 256)
-                    goto fail;
-                for (i = 0; i < 256; i++)
-                    alpha[i] = 0xFF - buf[pos+i];
-                pos += 256;
-                break;
-
-            case 0xff:
-                goto the_end;
-            default:
-                av_dlog(NULL, "unrecognised subpicture command 0x%x\n", cmd);
-                goto the_end;
-            }
-        }
-    the_end:
-        if (offset1 >= 0) {
-            int w, h;
-            uint8_t *bitmap;
-
-            /* decode the bitmap */
-            w = x2 - x1 + 1;
-            if (w < 0)
-                w = 0;
-            h = y2 - y1;
-            if (h < 0)
-                h = 0;
-            if (w > 0 && h > 0) {
-                if (sub_header->rects != NULL) {
-                    for (i = 0; i < sub_header->num_rects; i++) {
-                        av_freep(&sub_header->rects[i]->pict.data[0]);
-                        av_freep(&sub_header->rects[i]->pict.data[1]);
-                        av_freep(&sub_header->rects[i]);
-                    }
-                    av_freep(&sub_header->rects);
-                    sub_header->num_rects = 0;
-                }
-
-                bitmap = av_malloc(w * h);
-                sub_header->rects = av_mallocz(sizeof(*sub_header->rects));
-                sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
-                sub_header->num_rects = 1;
-                sub_header->rects[0]->pict.data[0] = bitmap;
-                decode_rle(bitmap, w * 2, w, (h + 1) / 2,
-                           buf, offset1, buf_size, is_8bit);
-                decode_rle(bitmap + w, w * 2, w, h / 2,
-                           buf, offset2, buf_size, is_8bit);
-                sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
-                if (is_8bit) {
-                    if (yuv_palette == 0)
-                        goto fail;
-                    sub_header->rects[0]->nb_colors = 256;
-                    yuv_a_to_rgba(yuv_palette, alpha, (uint32_t*)sub_header->rects[0]->pict.data[1], 256);
-                } else {
-                    sub_header->rects[0]->nb_colors = 4;
-                    guess_palette(ctx,
-                                  (uint32_t*)sub_header->rects[0]->pict.data[1],
-                                  colormap, alpha, 0xffff00);
-                }
-                sub_header->rects[0]->x = x1;
-                sub_header->rects[0]->y = y1;
-                sub_header->rects[0]->w = w;
-                sub_header->rects[0]->h = h;
-                sub_header->rects[0]->type = SUBTITLE_BITMAP;
-                sub_header->rects[0]->pict.linesize[0] = w;
-            }
-        }
-        if (next_cmd_pos == cmd_pos)
-            break;
-        cmd_pos = next_cmd_pos;
-    }
-    if (sub_header->num_rects > 0)
-        return is_menu;
- fail:
-    if (sub_header->rects != NULL) {
-        for (i = 0; i < sub_header->num_rects; i++) {
-            av_freep(&sub_header->rects[i]->pict.data[0]);
-            av_freep(&sub_header->rects[i]->pict.data[1]);
-            av_freep(&sub_header->rects[i]);
-        }
-        av_freep(&sub_header->rects);
-        sub_header->num_rects = 0;
-    }
-    return -1;
-}
-
-static int is_transp(const uint8_t *buf, int pitch, int n,
-                     const uint8_t *transp_color)
-{
-    int i;
-    for(i = 0; i < n; i++) {
-        if (!transp_color[*buf])
-            return 0;
-        buf += pitch;
-    }
-    return 1;
-}
-
-/* return 0 if empty rectangle, 1 if non empty */
-static int find_smallest_bounding_rectangle(AVSubtitle *s)
-{
-    uint8_t transp_color[256] = { 0 };
-    int y1, y2, x1, x2, y, w, h, i;
-    uint8_t *bitmap;
-
-    if (s->num_rects == 0 || s->rects == NULL || s->rects[0]->w <= 0 || s->rects[0]->h <= 0)
-        return 0;
-
-    for(i = 0; i < s->rects[0]->nb_colors; i++) {
-        if ((((uint32_t*)s->rects[0]->pict.data[1])[i] >> 24) == 0)
-            transp_color[i] = 1;
-    }
-    y1 = 0;
-    while (y1 < s->rects[0]->h && is_transp(s->rects[0]->pict.data[0] + y1 * s->rects[0]->pict.linesize[0],
-                                  1, s->rects[0]->w, transp_color))
-        y1++;
-    if (y1 == s->rects[0]->h) {
-        av_freep(&s->rects[0]->pict.data[0]);
-        s->rects[0]->w = s->rects[0]->h = 0;
-        return 0;
-    }
-
-    y2 = s->rects[0]->h - 1;
-    while (y2 > 0 && is_transp(s->rects[0]->pict.data[0] + y2 * s->rects[0]->pict.linesize[0], 1,
-                               s->rects[0]->w, transp_color))
-        y2--;
-    x1 = 0;
-    while (x1 < (s->rects[0]->w - 1) && is_transp(s->rects[0]->pict.data[0] + x1, s->rects[0]->pict.linesize[0],
-                                        s->rects[0]->h, transp_color))
-        x1++;
-    x2 = s->rects[0]->w - 1;
-    while (x2 > 0 && is_transp(s->rects[0]->pict.data[0] + x2, s->rects[0]->pict.linesize[0], s->rects[0]->h,
-                                  transp_color))
-        x2--;
-    w = x2 - x1 + 1;
-    h = y2 - y1 + 1;
-    bitmap = av_malloc(w * h);
-    if (!bitmap)
-        return 1;
-    for(y = 0; y < h; y++) {
-        memcpy(bitmap + w * y, s->rects[0]->pict.data[0] + x1 + (y1 + y) * s->rects[0]->pict.linesize[0], w);
-    }
-    av_freep(&s->rects[0]->pict.data[0]);
-    s->rects[0]->pict.data[0] = bitmap;
-    s->rects[0]->pict.linesize[0] = w;
-    s->rects[0]->w = w;
-    s->rects[0]->h = h;
-    s->rects[0]->x += x1;
-    s->rects[0]->y += y1;
-    return 1;
-}
-
-#ifdef DEBUG
-static void ppm_save(const char *filename, uint8_t *bitmap, int w, int h,
-                     uint32_t *rgba_palette)
-{
-    int x, y, v;
-    FILE *f;
-
-    f = fopen(filename, "w");
-    if (!f) {
-        perror(filename);
-        exit(1);
-    }
-    fprintf(f, "P6\n"
-            "%d %d\n"
-            "%d\n",
-            w, h, 255);
-    for(y = 0; y < h; y++) {
-        for(x = 0; x < w; x++) {
-            v = rgba_palette[bitmap[y * w + x]];
-            putc((v >> 16) & 0xff, f);
-            putc((v >> 8) & 0xff, f);
-            putc((v >> 0) & 0xff, f);
-        }
-    }
-    fclose(f);
-}
-#endif
-
-static int dvdsub_decode(AVCodecContext *avctx,
-                         void *data, int *data_size,
-                         AVPacket *avpkt)
-{
-    DVDSubContext *ctx = avctx->priv_data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    AVSubtitle *sub = data;
-    int is_menu;
-
-    is_menu = decode_dvd_subtitles(ctx, sub, buf, buf_size);
-
-    if (is_menu < 0) {
-    no_subtitle:
-        *data_size = 0;
-
-        return buf_size;
-    }
-    if (!is_menu && find_smallest_bounding_rectangle(sub) == 0)
-        goto no_subtitle;
-
-#if defined(DEBUG)
-    av_dlog(NULL, "start=%d ms end =%d ms\n",
-            sub->start_display_time,
-            sub->end_display_time);
-    ppm_save("/tmp/a.ppm", sub->rects[0]->pict.data[0],
-             sub->rects[0]->w, sub->rects[0]->h, sub->rects[0]->pict.data[1]);
-#endif
-
-    *data_size = 1;
-    return buf_size;
-}
-
-static av_cold int dvdsub_init(AVCodecContext *avctx)
-{
-    DVDSubContext *ctx = avctx->priv_data;
-    char *data, *cur;
-
-    if (!avctx->extradata || !avctx->extradata_size)
-        return 0;
-
-    data = av_malloc(avctx->extradata_size + 1);
-    if (!data)
-        return AVERROR(ENOMEM);
-    memcpy(data, avctx->extradata, avctx->extradata_size);
-    data[avctx->extradata_size] = '\0';
-    cur = data;
-
-    while (*cur) {
-        if (strncmp("palette:", cur, 8) == 0) {
-            int i;
-            char *p = cur + 8;
-            ctx->has_palette = 1;
-            for (i = 0; i < 16; i++) {
-                ctx->palette[i] = strtoul(p, &p, 16);
-                while (*p == ',' || av_isspace(*p))
-                    p++;
-            }
-        } else if (!strncmp("size:", cur, 5)) {
-            int w, h;
-            if (sscanf(cur + 5, "%dx%d", &w, &h) == 2) {
-               int ret = ff_set_dimensions(avctx, w, h);
-               if (ret < 0)
-                   return ret;
-            }
-        }
-        cur += strcspn(cur, "\n\r");
-        cur += strspn(cur, "\n\r");
-    }
-    av_free(data);
-    return 0;
-}
-
-AVCodec ff_dvdsub_decoder = {
-    .name           = "dvdsub",
-    .long_name      = NULL_IF_CONFIG_SMALL("DVD subtitles"),
-    .type           = AVMEDIA_TYPE_SUBTITLE,
-    .id             = AV_CODEC_ID_DVD_SUBTITLE,
-    .priv_data_size = sizeof(DVDSubContext),
-    .init           = dvdsub_init,
-    .decode         = dvdsub_decode,
-};
diff --git a/deps/libav/libavcodec/dvdsubenc.c b/deps/libav/libavcodec/dvdsubenc.c
deleted file mode 100644
index db6749e..0000000
--- a/deps/libav/libavcodec/dvdsubenc.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * DVD subtitle encoding
- * Copyright (c) 2005 Wolfram Gloger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "bytestream.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-// ncnt is the nibble counter
-#define PUTNIBBLE(val)\
-do {\
-    if (ncnt++ & 1)\
-        *q++ = bitbuf | ((val) & 0x0f);\
-    else\
-        bitbuf = (val) << 4;\
-} while(0)
-
-static void dvd_encode_rle(uint8_t **pq,
-                           const uint8_t *bitmap, int linesize,
-                           int w, int h,
-                           const int cmap[256])
-{
-    uint8_t *q;
-    unsigned int bitbuf = 0;
-    int ncnt;
-    int x, y, len, color;
-
-    q = *pq;
-
-    for (y = 0; y < h; ++y) {
-        ncnt = 0;
-        for(x = 0; x < w; x += len) {
-            color = bitmap[x];
-            for (len=1; x+len < w; ++len)
-                if (bitmap[x+len] != color)
-                    break;
-            color = cmap[color];
-            assert(color < 4);
-            if (len < 0x04) {
-                PUTNIBBLE((len << 2)|color);
-            } else if (len < 0x10) {
-                PUTNIBBLE(len >> 2);
-                PUTNIBBLE((len << 2)|color);
-            } else if (len < 0x40) {
-                PUTNIBBLE(0);
-                PUTNIBBLE(len >> 2);
-                PUTNIBBLE((len << 2)|color);
-            } else if (x+len == w) {
-                PUTNIBBLE(0);
-                PUTNIBBLE(0);
-                PUTNIBBLE(0);
-                PUTNIBBLE(color);
-            } else {
-                if (len > 0xff)
-                    len = 0xff;
-                PUTNIBBLE(0);
-                PUTNIBBLE(len >> 6);
-                PUTNIBBLE(len >> 2);
-                PUTNIBBLE((len << 2)|color);
-            }
-        }
-        /* end of line */
-        if (ncnt & 1)
-            PUTNIBBLE(0);
-        bitmap += linesize;
-    }
-
-    *pq = q;
-}
-
-static int encode_dvd_subtitles(uint8_t *outbuf, int outbuf_size,
-                                const AVSubtitle *h)
-{
-    uint8_t *q, *qq;
-    int object_id;
-    int offset1[20], offset2[20];
-    int i, imax, color, alpha, rects = h->num_rects;
-    unsigned long hmax;
-    unsigned long hist[256];
-    int           cmap[256];
-
-    if (rects == 0 || h->rects == NULL)
-        return -1;
-    if (rects > 20)
-        rects = 20;
-
-    // analyze bitmaps, compress to 4 colors
-    for (i=0; i<256; ++i) {
-        hist[i] = 0;
-        cmap[i] = 0;
-    }
-    for (object_id = 0; object_id < rects; object_id++)
-        for (i=0; i<h->rects[object_id]->w*h->rects[object_id]->h; ++i) {
-            color = h->rects[object_id]->pict.data[0][i];
-            // only count non-transparent pixels
-            alpha = ((uint32_t*)h->rects[object_id]->pict.data[1])[color] >> 24;
-            hist[color] += alpha;
-        }
-    for (color=3;; --color) {
-        hmax = 0;
-        imax = 0;
-        for (i=0; i<256; ++i)
-            if (hist[i] > hmax) {
-                imax = i;
-                hmax = hist[i];
-            }
-        if (hmax == 0)
-            break;
-        if (color == 0)
-            color = 3;
-        av_log(NULL, AV_LOG_DEBUG, "dvd_subtitle hist[%d]=%ld -> col %d\n",
-               imax, hist[imax], color);
-        cmap[imax] = color;
-        hist[imax] = 0;
-    }
-
-
-    // encode data block
-    q = outbuf + 4;
-    for (object_id = 0; object_id < rects; object_id++) {
-        offset1[object_id] = q - outbuf;
-        // worst case memory requirement: 1 nibble per pixel..
-        if ((q - outbuf) + h->rects[object_id]->w*h->rects[object_id]->h/2
-            + 17*rects + 21 > outbuf_size) {
-            av_log(NULL, AV_LOG_ERROR, "dvd_subtitle too big\n");
-            return -1;
-        }
-        dvd_encode_rle(&q, h->rects[object_id]->pict.data[0],
-                       h->rects[object_id]->w*2,
-                       h->rects[object_id]->w, h->rects[object_id]->h >> 1,
-                       cmap);
-        offset2[object_id] = q - outbuf;
-        dvd_encode_rle(&q, h->rects[object_id]->pict.data[0] + h->rects[object_id]->w,
-                       h->rects[object_id]->w*2,
-                       h->rects[object_id]->w, h->rects[object_id]->h >> 1,
-                       cmap);
-    }
-
-    // set data packet size
-    qq = outbuf + 2;
-    bytestream_put_be16(&qq, q - outbuf);
-
-    // send start display command
-    bytestream_put_be16(&q, (h->start_display_time*90) >> 10);
-    bytestream_put_be16(&q, (q - outbuf) /*- 2 */ + 8 + 12*rects + 2);
-    *q++ = 0x03; // palette - 4 nibbles
-    *q++ = 0x03; *q++ = 0x7f;
-    *q++ = 0x04; // alpha - 4 nibbles
-    *q++ = 0xf0; *q++ = 0x00;
-    //*q++ = 0x0f; *q++ = 0xff;
-
-    // XXX not sure if more than one rect can really be encoded..
-    // 12 bytes per rect
-    for (object_id = 0; object_id < rects; object_id++) {
-        int x2 = h->rects[object_id]->x + h->rects[object_id]->w - 1;
-        int y2 = h->rects[object_id]->y + h->rects[object_id]->h - 1;
-
-        *q++ = 0x05;
-        // x1 x2 -> 6 nibbles
-        *q++ = h->rects[object_id]->x >> 4;
-        *q++ = (h->rects[object_id]->x << 4) | ((x2 >> 8) & 0xf);
-        *q++ = x2;
-        // y1 y2 -> 6 nibbles
-        *q++ = h->rects[object_id]->y >> 4;
-        *q++ = (h->rects[object_id]->y << 4) | ((y2 >> 8) & 0xf);
-        *q++ = y2;
-
-        *q++ = 0x06;
-        // offset1, offset2
-        bytestream_put_be16(&q, offset1[object_id]);
-        bytestream_put_be16(&q, offset2[object_id]);
-    }
-    *q++ = 0x01; // start command
-    *q++ = 0xff; // terminating command
-
-    // send stop display command last
-    bytestream_put_be16(&q, (h->end_display_time*90) >> 10);
-    bytestream_put_be16(&q, (q - outbuf) - 2 /*+ 4*/);
-    *q++ = 0x02; // set end
-    *q++ = 0xff; // terminating command
-
-    qq = outbuf;
-    bytestream_put_be16(&qq, q - outbuf);
-
-    av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%td\n", q - outbuf);
-    return q - outbuf;
-}
-
-static int dvdsub_encode(AVCodecContext *avctx,
-                         unsigned char *buf, int buf_size,
-                         const AVSubtitle *sub)
-{
-    //DVDSubtitleContext *s = avctx->priv_data;
-    int ret;
-
-    ret = encode_dvd_subtitles(buf, buf_size, sub);
-    return ret;
-}
-
-AVCodec ff_dvdsub_encoder = {
-    .name           = "dvdsub",
-    .long_name      = NULL_IF_CONFIG_SMALL("DVD subtitles"),
-    .type           = AVMEDIA_TYPE_SUBTITLE,
-    .id             = AV_CODEC_ID_DVD_SUBTITLE,
-    .encode_sub     = dvdsub_encode,
-};
diff --git a/deps/libav/libavcodec/dvenc.c b/deps/libav/libavcodec/dvenc.c
deleted file mode 100644
index 73c07f2..0000000
--- a/deps/libav/libavcodec/dvenc.c
+++ /dev/null
@@ -1,709 +0,0 @@
-/*
- * DV encoder
- * Copyright (c) 2003 Roman Shaposhnik
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DV encoder
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/pixdesc.h"
-#include "config.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "put_bits.h"
-#include "dv.h"
-#include "dv_tablegen.h"
-
-static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
-{
-    if (!avpriv_dv_codec_profile(avctx)) {
-        av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video. "
-               "Valid DV profiles are:\n",
-               avctx->width, avctx->height, av_get_pix_fmt_name(avctx->pix_fmt));
-        ff_dv_print_profiles(avctx, AV_LOG_ERROR);
-        return AVERROR(EINVAL);
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    dv_vlc_map_tableinit();
-
-    return ff_dvvideo_init(avctx);
-}
-
-/* bit budget for AC only in 5 MBs */
-static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5;
-static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
-
-#if CONFIG_SMALL
-/* Converts run and level (where level != 0) pair into VLC, returning bit size */
-static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc)
-{
-    int size;
-    if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) {
-        *vlc = dv_vlc_map[run][level].vlc | sign;
-        size = dv_vlc_map[run][level].size;
-    }
-    else {
-        if (level < DV_VLC_MAP_LEV_SIZE) {
-            *vlc = dv_vlc_map[0][level].vlc | sign;
-            size = dv_vlc_map[0][level].size;
-        } else {
-            *vlc = 0xfe00 | (level << 1) | sign;
-            size = 16;
-        }
-        if (run) {
-            *vlc |= ((run < 16) ? dv_vlc_map[run-1][0].vlc :
-                                  (0x1f80 | (run - 1))) << size;
-            size +=  (run < 16) ? dv_vlc_map[run-1][0].size : 13;
-        }
-    }
-
-    return size;
-}
-
-static av_always_inline int dv_rl2vlc_size(int run, int level)
-{
-    int size;
-
-    if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) {
-        size = dv_vlc_map[run][level].size;
-    }
-    else {
-        size = (level < DV_VLC_MAP_LEV_SIZE) ? dv_vlc_map[0][level].size : 16;
-        if (run) {
-            size += (run < 16) ? dv_vlc_map[run-1][0].size : 13;
-        }
-    }
-    return size;
-}
-#else
-static av_always_inline int dv_rl2vlc(int run, int l, int sign, uint32_t* vlc)
-{
-    *vlc = dv_vlc_map[run][l].vlc | sign;
-    return dv_vlc_map[run][l].size;
-}
-
-static av_always_inline int dv_rl2vlc_size(int run, int l)
-{
-    return dv_vlc_map[run][l].size;
-}
-#endif
-
-typedef struct EncBlockInfo {
-    int      area_q[4];
-    int      bit_size[4];
-    int      prev[5];
-    int      cur_ac;
-    int      cno;
-    int      dct_mode;
-    int16_t  mb[64];
-    uint8_t  next[64];
-    uint8_t  sign[64];
-    uint8_t  partial_bit_count;
-    uint32_t partial_bit_buffer; /* we can't use uint16_t here */
-} EncBlockInfo;
-
-static av_always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi,
-                                                    PutBitContext* pb_pool,
-                                                    PutBitContext* pb_end)
-{
-    int prev, bits_left;
-    PutBitContext* pb = pb_pool;
-    int size = bi->partial_bit_count;
-    uint32_t vlc = bi->partial_bit_buffer;
-
-    bi->partial_bit_count = bi->partial_bit_buffer = 0;
-    for (;;){
-       /* Find suitable storage space */
-       for (; size > (bits_left = put_bits_left(pb)); pb++) {
-          if (bits_left) {
-              size -= bits_left;
-              put_bits(pb, bits_left, vlc >> size);
-              vlc = vlc & ((1 << size) - 1);
-          }
-          if (pb + 1 >= pb_end) {
-              bi->partial_bit_count  = size;
-              bi->partial_bit_buffer = vlc;
-              return pb;
-          }
-       }
-
-       /* Store VLC */
-       put_bits(pb, size, vlc);
-
-       if (bi->cur_ac >= 64)
-           break;
-
-       /* Construct the next VLC */
-       prev       = bi->cur_ac;
-       bi->cur_ac = bi->next[prev];
-       if (bi->cur_ac < 64){
-           size = dv_rl2vlc(bi->cur_ac - prev - 1, bi->mb[bi->cur_ac], bi->sign[bi->cur_ac], &vlc);
-       } else {
-           size = 4; vlc = 6; /* End Of Block stamp */
-       }
-    }
-    return pb;
-}
-
-static av_always_inline int dv_guess_dct_mode(DVVideoContext *s, uint8_t *data, int linesize) {
-    if (s->avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
-        int ps = s->ildct_cmp(NULL, data, NULL, linesize, 8) - 400;
-        if (ps > 0) {
-            int is = s->ildct_cmp(NULL, data           , NULL, linesize<<1, 4) +
-                     s->ildct_cmp(NULL, data + linesize, NULL, linesize<<1, 4);
-            return ps > is;
-        }
-    }
-
-    return 0;
-}
-
-static const int dv_weight_bits = 18;
-static const int dv_weight_88[64] = {
- 131072, 257107, 257107, 242189, 252167, 242189, 235923, 237536,
- 237536, 235923, 229376, 231390, 223754, 231390, 229376, 222935,
- 224969, 217965, 217965, 224969, 222935, 200636, 218652, 211916,
- 212325, 211916, 218652, 200636, 188995, 196781, 205965, 206433,
- 206433, 205965, 196781, 188995, 185364, 185364, 200636, 200704,
- 200636, 185364, 185364, 174609, 180568, 195068, 195068, 180568,
- 174609, 170091, 175557, 189591, 175557, 170091, 165371, 170627,
- 170627, 165371, 160727, 153560, 160727, 144651, 144651, 136258,
-};
-static const int dv_weight_248[64] = {
- 131072, 242189, 257107, 237536, 229376, 200636, 242189, 223754,
- 224969, 196781, 262144, 242189, 229376, 200636, 257107, 237536,
- 211916, 185364, 235923, 217965, 229376, 211916, 206433, 180568,
- 242189, 223754, 224969, 196781, 211916, 185364, 235923, 217965,
- 200704, 175557, 222935, 205965, 200636, 185364, 195068, 170627,
- 229376, 211916, 206433, 180568, 200704, 175557, 222935, 205965,
- 175557, 153560, 188995, 174609, 165371, 144651, 200636, 185364,
- 195068, 170627, 175557, 153560, 188995, 174609, 165371, 144651,
-};
-
-static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, int linesize, DVVideoContext *s, int bias)
-{
-    const int *weight;
-    const uint8_t* zigzag_scan;
-    LOCAL_ALIGNED_16(int16_t, blk, [64]);
-    int i, area;
-    /* We offer two different methods for class number assignment: the
-       method suggested in SMPTE 314M Table 22, and an improved
-       method. The SMPTE method is very conservative; it assigns class
-       3 (i.e. severe quantization) to any block where the largest AC
-       component is greater than 36. Libav's DV encoder tracks AC bit
-       consumption precisely, so there is no need to bias most blocks
-       towards strongly lossy compression. Instead, we assign class 2
-       to most blocks, and use class 3 only when strictly necessary
-       (for blocks whose largest AC component exceeds 255). */
-
-#if 0 /* SMPTE spec method */
-    static const int classes[] = {12, 24, 36, 0xffff};
-#else /* improved Libav method */
-    static const int classes[] = {-1, -1, 255, 0xffff};
-#endif
-    int max  = classes[0];
-    int prev = 0;
-
-    assert((((int)blk) & 15) == 0);
-
-    bi->area_q[0] = bi->area_q[1] = bi->area_q[2] = bi->area_q[3] = 0;
-    bi->partial_bit_count = 0;
-    bi->partial_bit_buffer = 0;
-    bi->cur_ac = 0;
-    if (data) {
-        bi->dct_mode = dv_guess_dct_mode(s, data, linesize);
-        s->get_pixels(blk, data, linesize);
-        s->fdct[bi->dct_mode](blk);
-    } else {
-        /* We rely on the fact that encoding all zeros leads to an immediate EOB,
-           which is precisely what the spec calls for in the "dummy" blocks. */
-        memset(blk, 0, 64*sizeof(*blk));
-        bi->dct_mode = 0;
-    }
-    bi->mb[0] = blk[0];
-
-    zigzag_scan = bi->dct_mode ? ff_zigzag248_direct : ff_zigzag_direct;
-    weight = bi->dct_mode ? dv_weight_248 : dv_weight_88;
-
-    for (area = 0; area < 4; area++) {
-       bi->prev[area]     = prev;
-       bi->bit_size[area] = 1; // 4 areas 4 bits for EOB :)
-       for (i = mb_area_start[area]; i < mb_area_start[area+1]; i++) {
-          int level = blk[zigzag_scan[i]];
-
-          if (level + 15 > 30U) {
-              bi->sign[i] = (level >> 31) & 1;
-              /* weight it and and shift down into range, adding for rounding */
-              /* the extra division by a factor of 2^4 reverses the 8x expansion of the DCT
-                 AND the 2x doubling of the weights */
-              level = (FFABS(level) * weight[i] + (1 << (dv_weight_bits+3))) >> (dv_weight_bits+4);
-              bi->mb[i] = level;
-              if (level > max)
-                  max = level;
-              bi->bit_size[area] += dv_rl2vlc_size(i - prev  - 1, level);
-              bi->next[prev]= i;
-              prev = i;
-          }
-       }
-    }
-    bi->next[prev]= i;
-    for (bi->cno = 0; max > classes[bi->cno]; bi->cno++);
-
-    bi->cno += bias;
-
-    if (bi->cno >= 3) {
-        bi->cno = 3;
-        prev    = 0;
-        i       = bi->next[prev];
-        for (area = 0; area < 4; area++) {
-            bi->prev[area]     = prev;
-            bi->bit_size[area] = 1; // 4 areas 4 bits for EOB :)
-            for (; i < mb_area_start[area+1]; i = bi->next[i]) {
-                bi->mb[i] >>= 1;
-
-                if (bi->mb[i]) {
-                    bi->bit_size[area] += dv_rl2vlc_size(i - prev - 1, bi->mb[i]);
-                    bi->next[prev]= i;
-                    prev = i;
-                }
-            }
-        }
-        bi->next[prev]= i;
-    }
-
-    return bi->bit_size[0] + bi->bit_size[1] + bi->bit_size[2] + bi->bit_size[3];
-}
-
-static inline void dv_guess_qnos(EncBlockInfo* blks, int* qnos)
-{
-    int size[5];
-    int i, j, k, a, prev, a2;
-    EncBlockInfo* b;
-
-    size[0] = size[1] = size[2] = size[3] = size[4] = 1 << 24;
-    do {
-       b = blks;
-       for (i = 0; i < 5; i++) {
-          if (!qnos[i])
-              continue;
-
-          qnos[i]--;
-          size[i] = 0;
-          for (j = 0; j < 6; j++, b++) {
-             for (a = 0; a < 4; a++) {
-                if (b->area_q[a] != ff_dv_quant_shifts[qnos[i] + ff_dv_quant_offset[b->cno]][a]) {
-                    b->bit_size[a] = 1; // 4 areas 4 bits for EOB :)
-                    b->area_q[a]++;
-                    prev = b->prev[a];
-                    assert(b->next[prev] >= mb_area_start[a+1] || b->mb[prev]);
-                    for (k = b->next[prev] ; k < mb_area_start[a+1]; k = b->next[k]) {
-                       b->mb[k] >>= 1;
-                       if (b->mb[k]) {
-                           b->bit_size[a] += dv_rl2vlc_size(k - prev - 1, b->mb[k]);
-                           prev = k;
-                       } else {
-                           if (b->next[k] >= mb_area_start[a+1] && b->next[k]<64){
-                                for (a2 = a + 1; b->next[k] >= mb_area_start[a2+1]; a2++)
-                                    b->prev[a2] = prev;
-                                assert(a2 < 4);
-                                assert(b->mb[b->next[k]]);
-                                b->bit_size[a2] += dv_rl2vlc_size(b->next[k] - prev - 1, b->mb[b->next[k]])
-                                                  -dv_rl2vlc_size(b->next[k] -    k - 1, b->mb[b->next[k]]);
-                                assert(b->prev[a2] == k && (a2 + 1 >= 4 || b->prev[a2+1] != k));
-                                b->prev[a2] = prev;
-                           }
-                           b->next[prev] = b->next[k];
-                       }
-                    }
-                    b->prev[a+1]= prev;
-                }
-                size[i] += b->bit_size[a];
-             }
-          }
-          if (vs_total_ac_bits >= size[0] + size[1] + size[2] + size[3] + size[4])
-                return;
-       }
-    } while (qnos[0]|qnos[1]|qnos[2]|qnos[3]|qnos[4]);
-
-
-    for (a = 2; a == 2 || vs_total_ac_bits < size[0]; a += a){
-        b = blks;
-        size[0] = 5 * 6 * 4; //EOB
-        for (j = 0; j < 6 *5; j++, b++) {
-            prev = b->prev[0];
-            for (k = b->next[prev]; k < 64; k = b->next[k]) {
-                if (b->mb[k] < a && b->mb[k] > -a){
-                    b->next[prev] = b->next[k];
-                }else{
-                    size[0] += dv_rl2vlc_size(k - prev - 1, b->mb[k]);
-                    prev = k;
-                }
-            }
-        }
-    }
-}
-
-static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
-{
-    DVVideoContext *s = avctx->priv_data;
-    DVwork_chunk *work_chunk = arg;
-    int mb_index, i, j;
-    int mb_x, mb_y, c_offset, linesize, y_stride;
-    uint8_t*  y_ptr;
-    uint8_t*  dif;
-    LOCAL_ALIGNED_8(uint8_t, scratch, [128]);
-    EncBlockInfo  enc_blks[5*DV_MAX_BPM];
-    PutBitContext pbs[5*DV_MAX_BPM];
-    PutBitContext* pb;
-    EncBlockInfo* enc_blk;
-    int       vs_bit_size = 0;
-    int       qnos[5] = {15, 15, 15, 15, 15}; /* No quantization */
-    int*      qnosp = &qnos[0];
-
-    dif = &s->buf[work_chunk->buf_offset*80];
-    enc_blk = &enc_blks[0];
-    for (mb_index = 0; mb_index < 5; mb_index++) {
-        dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);
-
-        /* initializing luminance blocks */
-        if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) ||
-            (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||
-            (s->sys->height >= 720 && mb_y != 134)) {
-            y_stride = s->frame->linesize[0] << 3;
-        } else {
-            y_stride = 16;
-        }
-        y_ptr    = s->frame->data[0] + ((mb_y * s->frame->linesize[0] + mb_x) << 3);
-        linesize = s->frame->linesize[0];
-
-        if (s->sys->video_stype == 4) { /* SD 422 */
-            vs_bit_size +=
-            dv_init_enc_block(enc_blk+0, y_ptr               , linesize, s, 0) +
-            dv_init_enc_block(enc_blk+1, NULL                , linesize, s, 0) +
-            dv_init_enc_block(enc_blk+2, y_ptr + 8           , linesize, s, 0) +
-            dv_init_enc_block(enc_blk+3, NULL                , linesize, s, 0);
-        } else {
-            vs_bit_size +=
-            dv_init_enc_block(enc_blk+0, y_ptr               , linesize, s, 0) +
-            dv_init_enc_block(enc_blk+1, y_ptr + 8           , linesize, s, 0) +
-            dv_init_enc_block(enc_blk+2, y_ptr     + y_stride, linesize, s, 0) +
-            dv_init_enc_block(enc_blk+3, y_ptr + 8 + y_stride, linesize, s, 0);
-        }
-        enc_blk += 4;
-
-        /* initializing chrominance blocks */
-        c_offset = (((mb_y >>  (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->frame->linesize[1] +
-                     (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << 3);
-        for (j = 2; j; j--) {
-            uint8_t *c_ptr = s->frame->data[j] + c_offset;
-            linesize = s->frame->linesize[j];
-            y_stride = (mb_y == 134) ? 8 : (s->frame->linesize[j] << 3);
-            if (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) {
-                uint8_t* d;
-                uint8_t* b = scratch;
-                for (i = 0; i < 8; i++) {
-                    d = c_ptr + (linesize << 3);
-                    b[0] = c_ptr[0]; b[1] = c_ptr[1]; b[2] = c_ptr[2]; b[3] = c_ptr[3];
-                    b[4] =     d[0]; b[5] =     d[1]; b[6] =     d[2]; b[7] =     d[3];
-                    c_ptr += linesize;
-                    b += 16;
-                }
-                c_ptr = scratch;
-                linesize = 16;
-            }
-
-            vs_bit_size += dv_init_enc_block(    enc_blk++, c_ptr           , linesize, s, 1);
-            if (s->sys->bpm == 8) {
-                vs_bit_size += dv_init_enc_block(enc_blk++, c_ptr + y_stride, linesize, s, 1);
-            }
-        }
-    }
-
-    if (vs_total_ac_bits < vs_bit_size)
-        dv_guess_qnos(&enc_blks[0], qnosp);
-
-    /* DIF encoding process */
-    for (j=0; j<5*s->sys->bpm;) {
-        int start_mb = j;
-
-        dif[3] = *qnosp++;
-        dif += 4;
-
-        /* First pass over individual cells only */
-        for (i=0; i<s->sys->bpm; i++, j++) {
-            int sz = s->sys->block_sizes[i]>>3;
-
-            init_put_bits(&pbs[j], dif, sz);
-            put_sbits(&pbs[j], 9, ((enc_blks[j].mb[0] >> 3) - 1024 + 2) >> 2);
-            put_bits(&pbs[j], 1, enc_blks[j].dct_mode);
-            put_bits(&pbs[j], 2, enc_blks[j].cno);
-
-            dv_encode_ac(&enc_blks[j], &pbs[j], &pbs[j+1]);
-            dif += sz;
-        }
-
-        /* Second pass over each MB space */
-        pb = &pbs[start_mb];
-        for (i=0; i<s->sys->bpm; i++) {
-            if (enc_blks[start_mb+i].partial_bit_count)
-                pb = dv_encode_ac(&enc_blks[start_mb+i], pb, &pbs[start_mb+s->sys->bpm]);
-        }
-    }
-
-    /* Third and final pass over the whole video segment space */
-    pb = &pbs[0];
-    for (j=0; j<5*s->sys->bpm; j++) {
-       if (enc_blks[j].partial_bit_count)
-           pb = dv_encode_ac(&enc_blks[j], pb, &pbs[s->sys->bpm*5]);
-       if (enc_blks[j].partial_bit_count)
-            av_log(avctx, AV_LOG_ERROR, "ac bitstream overflow\n");
-    }
-
-    for (j=0; j<5*s->sys->bpm; j++) {
-       int pos;
-       int size = pbs[j].size_in_bits >> 3;
-       flush_put_bits(&pbs[j]);
-       pos = put_bits_count(&pbs[j]) >> 3;
-       if (pos > size) {
-           av_log(avctx, AV_LOG_ERROR, "bitstream written beyond buffer size\n");
-           return -1;
-       }
-       memset(pbs[j].buf + pos, 0xff, size - pos);
-    }
-
-    return 0;
-}
-
-static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c,
-                                uint8_t* buf)
-{
-    /*
-     * Here's what SMPTE314M says about these two:
-     *    (page 6) APTn, AP1n, AP2n, AP3n: These data shall be identical
-     *             as track application IDs (APTn = 001, AP1n =
-     *             001, AP2n = 001, AP3n = 001), if the source signal
-     *             comes from a digital VCR. If the signal source is
-     *             unknown, all bits for these data shall be set to 1.
-     *    (page 12) STYPE: STYPE defines a signal type of video signal
-     *                     00000b = 4:1:1 compression
-     *                     00100b = 4:2:2 compression
-     *                     XXXXXX = Reserved
-     * Now, I've got two problems with these statements:
-     *   1. it looks like APT == 111b should be a safe bet, but it isn't.
-     *      It seems that for PAL as defined in IEC 61834 we have to set
-     *      APT to 000 and for SMPTE314M to 001.
-     *   2. It is not at all clear what STYPE is used for 4:2:0 PAL
-     *      compression scheme (if any).
-     */
-    int apt   = (c->sys->pix_fmt == AV_PIX_FMT_YUV420P ? 0 : 1);
-
-    uint8_t aspect = 0;
-    if ((int)(av_q2d(c->avctx->sample_aspect_ratio) * c->avctx->width / c->avctx->height * 10) >= 17) /* 16:9 */
-        aspect = 0x02;
-
-    buf[0] = (uint8_t)pack_id;
-    switch (pack_id) {
-    case dv_header525: /* I can't imagine why these two weren't defined as real */
-    case dv_header625: /* packs in SMPTE314M -- they definitely look like ones */
-          buf[1] = 0xf8 |        /* reserved -- always 1 */
-                   (apt & 0x07); /* APT: Track application ID */
-          buf[2] = (0    << 7) | /* TF1: audio data is 0 - valid; 1 - invalid */
-                   (0x0f << 3) | /* reserved -- always 1 */
-                   (apt & 0x07); /* AP1: Audio application ID */
-          buf[3] = (0    << 7) | /* TF2: video data is 0 - valid; 1 - invalid */
-                   (0x0f << 3) | /* reserved -- always 1 */
-                   (apt & 0x07); /* AP2: Video application ID */
-          buf[4] = (0    << 7) | /* TF3: subcode(SSYB) is 0 - valid; 1 - invalid */
-                   (0x0f << 3) | /* reserved -- always 1 */
-                   (apt & 0x07); /* AP3: Subcode application ID */
-          break;
-    case dv_video_source:
-          buf[1] = 0xff;      /* reserved -- always 1 */
-          buf[2] = (1 << 7) | /* B/W: 0 - b/w, 1 - color */
-                   (1 << 6) | /* following CLF is valid - 0, invalid - 1 */
-                   (3 << 4) | /* CLF: color frames ID (see ITU-R BT.470-4) */
-                   0xf;       /* reserved -- always 1 */
-          buf[3] = (3 << 6) | /* reserved -- always 1 */
-                   (c->sys->dsf << 5) | /*  system: 60fields/50fields */
-                   c->sys->video_stype; /* signal type video compression */
-          buf[4] = 0xff;      /* VISC: 0xff -- no information */
-          break;
-    case dv_video_control:
-          buf[1] = (0 << 6) | /* Copy generation management (CGMS) 0 -- free */
-                   0x3f;      /* reserved -- always 1 */
-          buf[2] = 0xc8 |     /* reserved -- always b11001xxx */
-                   aspect;
-          buf[3] = (1 << 7) | /* frame/field flag 1 -- frame, 0 -- field */
-                   (1 << 6) | /* first/second field flag 0 -- field 2, 1 -- field 1 */
-                   (1 << 5) | /* frame change flag 0 -- same picture as before, 1 -- different */
-                   (1 << 4) | /* 1 - interlaced, 0 - noninterlaced */
-                   0xc;       /* reserved -- always b1100 */
-          buf[4] = 0xff;      /* reserved -- always 1 */
-          break;
-    default:
-          buf[1] = buf[2] = buf[3] = buf[4] = 0xff;
-    }
-    return 5;
-}
-
-static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num,
-                                  uint8_t seq_num, uint8_t dif_num,
-                                  uint8_t* buf)
-{
-    buf[0] = (uint8_t)t;       /* Section type */
-    buf[1] = (seq_num  << 4) | /* DIF seq number 0-9 for 525/60; 0-11 for 625/50 */
-             (chan_num << 3) | /* FSC: for 50Mb/s 0 - first channel; 1 - second */
-             7;                /* reserved -- always 1 */
-    buf[2] = dif_num;          /* DIF block number Video: 0-134, Audio: 0-8 */
-    return 3;
-}
-
-
-static inline int dv_write_ssyb_id(uint8_t syb_num, uint8_t fr, uint8_t* buf)
-{
-    if (syb_num == 0 || syb_num == 6) {
-        buf[0] = (fr << 7) | /* FR ID 1 - first half of each channel; 0 - second */
-                 (0  << 4) | /* AP3 (Subcode application ID) */
-                 0x0f;       /* reserved -- always 1 */
-    }
-    else if (syb_num == 11) {
-        buf[0] = (fr << 7) | /* FR ID 1 - first half of each channel; 0 - second */
-                 0x7f;       /* reserved -- always 1 */
-    }
-    else {
-        buf[0] = (fr << 7) | /* FR ID 1 - first half of each channel; 0 - second */
-                 (0  << 4) | /* APT (Track application ID) */
-                 0x0f;       /* reserved -- always 1 */
-    }
-    buf[1] = 0xf0 |            /* reserved -- always 1 */
-             (syb_num & 0x0f); /* SSYB number 0 - 11   */
-    buf[2] = 0xff;             /* reserved -- always 1 */
-    return 3;
-}
-
-static void dv_format_frame(DVVideoContext* c, uint8_t* buf)
-{
-    int chan, i, j, k;
-
-    for (chan = 0; chan < c->sys->n_difchan; chan++) {
-        for (i = 0; i < c->sys->difseg_size; i++) {
-            memset(buf, 0xff, 80 * 6); /* first 6 DIF blocks are for control data */
-
-            /* DV header: 1DIF */
-            buf += dv_write_dif_id(dv_sect_header, chan, i, 0, buf);
-            buf += dv_write_pack((c->sys->dsf ? dv_header625 : dv_header525), c, buf);
-            buf += 72; /* unused bytes */
-
-            /* DV subcode: 2DIFs */
-            for (j = 0; j < 2; j++) {
-                buf += dv_write_dif_id(dv_sect_subcode, chan, i, j, buf);
-                for (k = 0; k < 6; k++)
-                     buf += dv_write_ssyb_id(k, (i < c->sys->difseg_size/2), buf) + 5;
-                buf += 29; /* unused bytes */
-            }
-
-            /* DV VAUX: 3DIFS */
-            for (j = 0; j < 3; j++) {
-                buf += dv_write_dif_id(dv_sect_vaux, chan, i, j, buf);
-                buf += dv_write_pack(dv_video_source,  c, buf);
-                buf += dv_write_pack(dv_video_control, c, buf);
-                buf += 7*5;
-                buf += dv_write_pack(dv_video_source,  c, buf);
-                buf += dv_write_pack(dv_video_control, c, buf);
-                buf += 4*5 + 2; /* unused bytes */
-            }
-
-            /* DV Audio/Video: 135 Video DIFs + 9 Audio DIFs */
-            for (j = 0; j < 135; j++) {
-                if (j%15 == 0) {
-                    memset(buf, 0xff, 80);
-                    buf += dv_write_dif_id(dv_sect_audio, chan, i, j/15, buf);
-                    buf += 77; /* audio control & shuffled PCM audio */
-                }
-                buf += dv_write_dif_id(dv_sect_video, chan, i, j, buf);
-                buf += 77; /* 1 video macroblock: 1 bytes control
-                              4 * 14 bytes Y 8x8 data
-                              10 bytes Cr 8x8 data
-                              10 bytes Cb 8x8 data */
-            }
-        }
-    }
-}
-
-
-static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,
-                                const AVFrame *frame, int *got_packet)
-{
-    DVVideoContext *s = c->priv_data;
-    int ret;
-
-    s->sys = avpriv_dv_codec_profile(c);
-    if (!s->sys || ff_dv_init_dynamic_tables(s->sys))
-        return -1;
-    if ((ret = ff_alloc_packet(pkt, s->sys->frame_size)) < 0) {
-        av_log(c, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    c->pix_fmt                = s->sys->pix_fmt;
-    s->frame                  = frame;
-    c->coded_frame->key_frame = 1;
-    c->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
-    s->buf = pkt->data;
-    c->execute(c, dv_encode_video_segment, s->sys->work_chunks, NULL,
-               dv_work_pool_size(s->sys), sizeof(DVwork_chunk));
-
-    emms_c();
-
-    dv_format_frame(s, pkt->data);
-
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static int dvvideo_encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-AVCodec ff_dvvideo_encoder = {
-    .name           = "dvvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DVVIDEO,
-    .priv_data_size = sizeof(DVVideoContext),
-    .init           = dvvideo_init_encoder,
-    .encode2        = dvvideo_encode_frame,
-    .close          = dvvideo_encode_close,
-    .capabilities   = CODEC_CAP_SLICE_THREADS,
-    .pix_fmts       = (const enum AVPixelFormat[]) {
-        AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/dxa.c b/deps/libav/libavcodec/dxa.c
deleted file mode 100644
index fa0677d..0000000
--- a/deps/libav/libavcodec/dxa.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Feeble Files/ScummVM DXA decoder
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DXA Video decoder
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-#include <zlib.h>
-
-/*
- * Decoder context
- */
-typedef struct DxaDecContext {
-    AVFrame *prev;
-
-    int dsize;
-    uint8_t *decomp_buf;
-    uint32_t pal[256];
-} DxaDecContext;
-
-static const int shift1[6] = { 0, 8, 8, 8, 4, 4 };
-static const int shift2[6] = { 0, 0, 8, 4, 0, 4 };
-
-static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst,
-                     int stride, uint8_t *src, uint8_t *ref)
-{
-    uint8_t *code, *data, *mv, *msk, *tmp, *tmp2;
-    int i, j, k;
-    int type, x, y, d, d2;
-    uint32_t mask;
-
-    code = src  + 12;
-    data = code + ((avctx->width * avctx->height) >> 4);
-    mv   = data + AV_RB32(src + 0);
-    msk  = mv   + AV_RB32(src + 4);
-
-    for(j = 0; j < avctx->height; j += 4){
-        for(i = 0; i < avctx->width; i += 4){
-            tmp  = dst + i;
-            tmp2 = ref + i;
-            type = *code++;
-            switch(type){
-            case 4: // motion compensation
-                x = (*mv) >> 4;    if(x & 8) x = 8 - x;
-                y = (*mv++) & 0xF; if(y & 8) y = 8 - y;
-                tmp2 += x + y*stride;
-            case 0: // skip
-            case 5: // skip in method 12
-                for(y = 0; y < 4; y++){
-                    memcpy(tmp, tmp2, 4);
-                    tmp  += stride;
-                    tmp2 += stride;
-                }
-                break;
-            case 1:  // masked change
-            case 10: // masked change with only half of pixels changed
-            case 11: // cases 10-15 are for method 12 only
-            case 12:
-            case 13:
-            case 14:
-            case 15:
-                if(type == 1){
-                    mask = AV_RB16(msk);
-                    msk += 2;
-                }else{
-                    type -= 10;
-                    mask = ((msk[0] & 0xF0) << shift1[type]) | ((msk[0] & 0xF) << shift2[type]);
-                    msk++;
-                }
-                for(y = 0; y < 4; y++){
-                    for(x = 0; x < 4; x++){
-                        tmp[x] = (mask & 0x8000) ? *data++ : tmp2[x];
-                        mask <<= 1;
-                    }
-                    tmp  += stride;
-                    tmp2 += stride;
-                }
-                break;
-            case 2: // fill block
-                for(y = 0; y < 4; y++){
-                    memset(tmp, data[0], 4);
-                    tmp += stride;
-                }
-                data++;
-                break;
-            case 3: // raw block
-                for(y = 0; y < 4; y++){
-                    memcpy(tmp, data, 4);
-                    data += 4;
-                    tmp  += stride;
-                }
-                break;
-            case 8: // subblocks - method 13 only
-                mask = *msk++;
-                for(k = 0; k < 4; k++){
-                    d  = ((k & 1) << 1) + ((k & 2) * stride);
-                    d2 = ((k & 1) << 1) + ((k & 2) * stride);
-                    tmp2 = ref + i + d2;
-                    switch(mask & 0xC0){
-                    case 0x80: // motion compensation
-                        x = (*mv) >> 4;    if(x & 8) x = 8 - x;
-                        y = (*mv++) & 0xF; if(y & 8) y = 8 - y;
-                        tmp2 += x + y*stride;
-                    case 0x00: // skip
-                        tmp[d + 0         ] = tmp2[0];
-                        tmp[d + 1         ] = tmp2[1];
-                        tmp[d + 0 + stride] = tmp2[0 + stride];
-                        tmp[d + 1 + stride] = tmp2[1 + stride];
-                        break;
-                    case 0x40: // fill
-                        tmp[d + 0         ] = data[0];
-                        tmp[d + 1         ] = data[0];
-                        tmp[d + 0 + stride] = data[0];
-                        tmp[d + 1 + stride] = data[0];
-                        data++;
-                        break;
-                    case 0xC0: // raw
-                        tmp[d + 0         ] = *data++;
-                        tmp[d + 1         ] = *data++;
-                        tmp[d + 0 + stride] = *data++;
-                        tmp[d + 1 + stride] = *data++;
-                        break;
-                    }
-                    mask <<= 2;
-                }
-                break;
-            case 32: // vector quantization - 2 colors
-                mask = AV_RB16(msk);
-                msk += 2;
-                for(y = 0; y < 4; y++){
-                    for(x = 0; x < 4; x++){
-                        tmp[x] = data[mask & 1];
-                        mask >>= 1;
-                    }
-                    tmp  += stride;
-                    tmp2 += stride;
-                }
-                data += 2;
-                break;
-            case 33: // vector quantization - 3 or 4 colors
-            case 34:
-                mask = AV_RB32(msk);
-                msk += 4;
-                for(y = 0; y < 4; y++){
-                    for(x = 0; x < 4; x++){
-                        tmp[x] = data[mask & 3];
-                        mask >>= 2;
-                    }
-                    tmp  += stride;
-                    tmp2 += stride;
-                }
-                data += type - 30;
-                break;
-            default:
-                av_log(avctx, AV_LOG_ERROR, "Unknown opcode %d\n", type);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        dst += stride * 4;
-        ref += stride * 4;
-    }
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    DxaDecContext * const c = avctx->priv_data;
-    uint8_t *outptr, *srcptr, *tmpptr;
-    unsigned long dsize;
-    int i, j, compr, ret;
-    int stride;
-    int orig_buf_size = buf_size;
-    int pc = 0;
-
-    /* make the palette available on the way out */
-    if(buf[0]=='C' && buf[1]=='M' && buf[2]=='A' && buf[3]=='P'){
-        int r, g, b;
-
-        buf += 4;
-        for(i = 0; i < 256; i++){
-            r = *buf++;
-            g = *buf++;
-            b = *buf++;
-            c->pal[i] = (r << 16) | (g << 8) | b;
-        }
-        pc = 1;
-        buf_size -= 768+4;
-    }
-
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
-    frame->palette_has_changed = pc;
-
-    outptr = frame->data[0];
-    srcptr = c->decomp_buf;
-    tmpptr = c->prev->data[0];
-    stride = frame->linesize[0];
-
-    if(buf[0]=='N' && buf[1]=='U' && buf[2]=='L' && buf[3]=='L')
-        compr = -1;
-    else
-        compr = buf[4];
-
-    dsize = c->dsize;
-    if((compr != 4 && compr != -1) && uncompress(c->decomp_buf, &dsize, buf + 9, buf_size - 9) != Z_OK){
-        av_log(avctx, AV_LOG_ERROR, "Uncompress failed!\n");
-        return AVERROR_UNKNOWN;
-    }
-    switch(compr){
-    case -1:
-        frame->key_frame = 0;
-        frame->pict_type = AV_PICTURE_TYPE_P;
-        if (c->prev->data[0])
-            memcpy(frame->data[0], c->prev->data[0], frame->linesize[0] * avctx->height);
-        else{ // Should happen only when first frame is 'NULL'
-            memset(frame->data[0], 0, frame->linesize[0] * avctx->height);
-            frame->key_frame = 1;
-            frame->pict_type = AV_PICTURE_TYPE_I;
-        }
-        break;
-    case 2:
-    case 4:
-        frame->key_frame = 1;
-        frame->pict_type = AV_PICTURE_TYPE_I;
-        for (j = 0; j < avctx->height; j++) {
-                memcpy(outptr, srcptr, avctx->width);
-            outptr += stride;
-            srcptr += avctx->width;
-        }
-        break;
-    case 3:
-    case 5:
-        if (!tmpptr) {
-            av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        frame->key_frame = 0;
-        frame->pict_type = AV_PICTURE_TYPE_P;
-        for (j = 0; j < avctx->height; j++) {
-            for (i = 0; i < avctx->width; i++)
-                outptr[i] = srcptr[i] ^ tmpptr[i];
-            tmpptr += stride;
-            outptr += stride;
-            srcptr += avctx->width;
-        }
-        break;
-    case 12: // ScummVM coding
-    case 13:
-        frame->key_frame = 0;
-        frame->pict_type = AV_PICTURE_TYPE_P;
-        decode_13(avctx, c, frame->data[0], frame->linesize[0], srcptr, c->prev->data[0]);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown/unsupported compression type %d\n", buf[4]);
-        return AVERROR_INVALIDDATA;
-    }
-
-    av_frame_unref(c->prev);
-    if ((ret = av_frame_ref(c->prev, frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return orig_buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    DxaDecContext * const c = avctx->priv_data;
-
-    c->prev = av_frame_alloc();
-    if (!c->prev)
-        return AVERROR(ENOMEM);
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    c->dsize = avctx->width * avctx->height * 2;
-    if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {
-        av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    DxaDecContext * const c = avctx->priv_data;
-
-    av_freep(&c->decomp_buf);
-    av_frame_free(&c->prev);
-
-    return 0;
-}
-
-AVCodec ff_dxa_decoder = {
-    .name           = "dxa",
-    .long_name      = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DXA,
-    .priv_data_size = sizeof(DxaDecContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/dxtory.c b/deps/libav/libavcodec/dxtory.c
deleted file mode 100644
index 5cb7fae..0000000
--- a/deps/libav/libavcodec/dxtory.c
+++ /dev/null
@@ -1,752 +0,0 @@
-/*
- * Dxtory decoder
- *
- * Copyright (c) 2011 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "bytestream.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "unary.h"
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-
-static int dxtory_decode_v1_rgb(AVCodecContext *avctx, AVFrame *pic,
-                                const uint8_t *src, int src_size,
-                                int id, int bpp)
-{
-    int h;
-    uint8_t *dst;
-    int ret;
-
-    if (src_size < avctx->width * avctx->height * bpp) {
-        av_log(avctx, AV_LOG_ERROR, "packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avctx->pix_fmt = id;
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    dst = pic->data[0];
-    for (h = 0; h < avctx->height; h++) {
-        memcpy(dst, src, avctx->width * bpp);
-        src += avctx->width * bpp;
-        dst += pic->linesize[0];
-    }
-
-    return 0;
-}
-
-static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
-                                const uint8_t *src, int src_size)
-{
-    int h, w;
-    uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
-    int ret;
-
-    if (src_size < avctx->width * avctx->height * 18 / 16) {
-        av_log(avctx, AV_LOG_ERROR, "packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV410P;
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    Y1 = pic->data[0];
-    Y2 = pic->data[0] + pic->linesize[0];
-    Y3 = pic->data[0] + pic->linesize[0] * 2;
-    Y4 = pic->data[0] + pic->linesize[0] * 3;
-    U  = pic->data[1];
-    V  = pic->data[2];
-    for (h = 0; h < avctx->height; h += 4) {
-        for (w = 0; w < avctx->width; w += 4) {
-            AV_COPY32(Y1 + w, src);
-            AV_COPY32(Y2 + w, src + 4);
-            AV_COPY32(Y3 + w, src + 8);
-            AV_COPY32(Y4 + w, src + 12);
-            U[w >> 2] = src[16] + 0x80;
-            V[w >> 2] = src[17] + 0x80;
-            src += 18;
-        }
-        Y1 += pic->linesize[0] << 2;
-        Y2 += pic->linesize[0] << 2;
-        Y3 += pic->linesize[0] << 2;
-        Y4 += pic->linesize[0] << 2;
-        U  += pic->linesize[1];
-        V  += pic->linesize[2];
-    }
-
-    return 0;
-}
-
-static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
-                                const uint8_t *src, int src_size)
-{
-    int h, w;
-    uint8_t *Y1, *Y2, *U, *V;
-    int ret;
-
-    if (src_size < avctx->width * avctx->height * 3 / 2) {
-        av_log(avctx, AV_LOG_ERROR, "packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    Y1 = pic->data[0];
-    Y2 = pic->data[0] + pic->linesize[0];
-    U  = pic->data[1];
-    V  = pic->data[2];
-    for (h = 0; h < avctx->height; h += 2) {
-        for (w = 0; w < avctx->width; w += 2) {
-            AV_COPY16(Y1 + w, src);
-            AV_COPY16(Y2 + w, src + 2);
-            U[w >> 1] = src[4] + 0x80;
-            V[w >> 1] = src[5] + 0x80;
-            src += 6;
-        }
-        Y1 += pic->linesize[0] << 1;
-        Y2 += pic->linesize[0] << 1;
-        U  += pic->linesize[1];
-        V  += pic->linesize[2];
-    }
-
-    return 0;
-}
-
-static int dxtory_decode_v1_444(AVCodecContext *avctx, AVFrame *pic,
-                                const uint8_t *src, int src_size)
-{
-    int h, w;
-    uint8_t *Y, *U, *V;
-    int ret;
-
-    if (src_size < avctx->width * avctx->height * 3) {
-        av_log(avctx, AV_LOG_ERROR, "packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV444P;
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    Y = pic->data[0];
-    U = pic->data[1];
-    V = pic->data[2];
-    for (h = 0; h < avctx->height; h++) {
-        for (w = 0; w < avctx->width; w++) {
-            Y[w] = *src++;
-            U[w] = *src++ ^ 0x80;
-            V[w] = *src++ ^ 0x80;
-        }
-        Y += pic->linesize[0];
-        U += pic->linesize[1];
-        V += pic->linesize[2];
-    }
-
-    return 0;
-}
-
-const uint8_t def_lru[8] = { 0x00, 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xFF };
-const uint8_t def_lru_555[8] = { 0x00, 0x08, 0x10, 0x18, 0x1F };
-const uint8_t def_lru_565[8] = { 0x00, 0x08, 0x10, 0x20, 0x30, 0x3F };
-
-static inline uint8_t decode_sym(GetBitContext *gb, uint8_t lru[8])
-{
-    uint8_t c, val;
-
-    c = get_unary(gb, 0, 8);
-    if (!c) {
-        val = get_bits(gb, 8);
-        memmove(lru + 1, lru, sizeof(*lru) * (8 - 1));
-    } else {
-        val = lru[c - 1];
-        memmove(lru + 1, lru, sizeof(*lru) * (c - 1));
-    }
-    lru[0] = val;
-
-    return val;
-}
-
-static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],
-                                     int bits)
-{
-    uint8_t c, val;
-
-    c = get_unary(gb, 0, bits);
-    if (!c) {
-        val = get_bits(gb, bits);
-        memmove(lru + 1, lru, sizeof(*lru) * (6 - 1));
-    } else {
-        val = lru[c - 1];
-        memmove(lru + 1, lru, sizeof(*lru) * (c - 1));
-    }
-    lru[0] = val;
-
-    return val;
-}
-
-static int dx2_decode_slice_565(GetBitContext *gb, int width, int height,
-                                uint8_t *dst, int stride, int is_565)
-{
-    int x, y;
-    int r, g, b;
-    uint8_t lru[3][8];
-
-    memcpy(lru[0], def_lru_555, 8 * sizeof(*def_lru));
-    memcpy(lru[1], is_565 ? def_lru_565 : def_lru_555, 8 * sizeof(*def_lru));
-    memcpy(lru[2], def_lru_555, 8 * sizeof(*def_lru));
-
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++) {
-            b = decode_sym_565(gb, lru[0], 5);
-            g = decode_sym_565(gb, lru[1], is_565 ? 6 : 5);
-            r = decode_sym_565(gb, lru[2], 5);
-            dst[x * 3 + 0] = (r << 3) | (r >> 2);
-            dst[x * 3 + 1] = is_565 ? (g << 2) | (g >> 4) : (g << 3) | (g >> 2);
-            dst[x * 3 + 2] = (b << 3) | (b >> 2);
-        }
-
-        dst += stride;
-    }
-
-    return 0;
-}
-
-static int dxtory_decode_v2_565(AVCodecContext *avctx, AVFrame *pic,
-                                const uint8_t *src, int src_size, int is_565)
-{
-    GetByteContext gb;
-    GetBitContext  gb2;
-    int nslices, slice, slice_height;
-    uint32_t off, slice_size;
-    uint8_t *dst;
-    int ret;
-
-    bytestream2_init(&gb, src, src_size);
-    nslices = bytestream2_get_le16(&gb);
-    off = FFALIGN(nslices * 4 + 2, 16);
-    if (src_size < off) {
-        av_log(avctx, AV_LOG_ERROR, "no slice data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!nslices || avctx->height % nslices) {
-        avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
-                              avctx->width, avctx->height);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    slice_height = avctx->height / nslices;
-    avctx->pix_fmt = AV_PIX_FMT_RGB24;
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    dst = pic->data[0];
-    for (slice = 0; slice < nslices; slice++) {
-        slice_size = bytestream2_get_le32(&gb);
-        if (slice_size > src_size - off) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "invalid slice size %d (only %d bytes left)\n",
-                   slice_size, src_size - off);
-            return AVERROR_INVALIDDATA;
-        }
-        if (slice_size <= 16) {
-            av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (AV_RL32(src + off) != slice_size - 16) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Slice sizes mismatch: got %d instead of %d\n",
-                   AV_RL32(src + off), slice_size - 16);
-        }
-        init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
-        dx2_decode_slice_565(&gb2, avctx->width, slice_height, dst,
-                             pic->linesize[0], is_565);
-
-        dst += pic->linesize[0] * slice_height;
-        off += slice_size;
-    }
-
-    return 0;
-}
-
-static int dx2_decode_slice_rgb(GetBitContext *gb, int width, int height,
-                                uint8_t *dst, int stride)
-{
-    int x, y, i;
-    uint8_t lru[3][8];
-
-    for (i = 0; i < 3; i++)
-        memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
-
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++) {
-            dst[x * 3 + 0] = decode_sym(gb, lru[0]);
-            dst[x * 3 + 1] = decode_sym(gb, lru[1]);
-            dst[x * 3 + 2] = decode_sym(gb, lru[2]);
-        }
-
-        dst += stride;
-    }
-
-    return 0;
-}
-
-static int dxtory_decode_v2_rgb(AVCodecContext *avctx, AVFrame *pic,
-                                const uint8_t *src, int src_size)
-{
-    GetByteContext gb;
-    GetBitContext  gb2;
-    int nslices, slice, slice_height;
-    uint32_t off, slice_size;
-    uint8_t *dst;
-    int ret;
-
-    bytestream2_init(&gb, src, src_size);
-    nslices = bytestream2_get_le16(&gb);
-    off = FFALIGN(nslices * 4 + 2, 16);
-    if (src_size < off) {
-        av_log(avctx, AV_LOG_ERROR, "no slice data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!nslices || avctx->height % nslices) {
-        avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
-                              avctx->width, avctx->height);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    slice_height = avctx->height / nslices;
-    avctx->pix_fmt = AV_PIX_FMT_BGR24;
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    dst = pic->data[0];
-    for (slice = 0; slice < nslices; slice++) {
-        slice_size = bytestream2_get_le32(&gb);
-        if (slice_size > src_size - off) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "invalid slice size %d (only %d bytes left)\n",
-                   slice_size, src_size - off);
-            return AVERROR_INVALIDDATA;
-        }
-        if (slice_size <= 16) {
-            av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (AV_RL32(src + off) != slice_size - 16) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Slice sizes mismatch: got %d instead of %d\n",
-                   AV_RL32(src + off), slice_size - 16);
-        }
-        init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
-        dx2_decode_slice_rgb(&gb2, avctx->width, slice_height, dst,
-                             pic->linesize[0]);
-
-        dst += pic->linesize[0] * slice_height;
-        off += slice_size;
-    }
-
-    return 0;
-}
-
-static int dx2_decode_slice_410(GetBitContext *gb, int width, int height,
-                                uint8_t *Y, uint8_t *U, uint8_t *V,
-                                int ystride, int ustride, int vstride)
-{
-    int x, y, i, j;
-    uint8_t lru[3][8];
-
-    for (i = 0; i < 3; i++)
-        memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
-
-    for (y = 0; y < height; y += 4) {
-        for (x = 0; x < width; x += 4) {
-            for (j = 0; j < 4; j++)
-                for (i = 0; i < 4; i++)
-                    Y[x + i + j * ystride] = decode_sym(gb, lru[0]);
-            U[x >> 2] = decode_sym(gb, lru[1]) ^ 0x80;
-            V[x >> 2] = decode_sym(gb, lru[2]) ^ 0x80;
-        }
-
-        Y += ystride << 2;
-        U += ustride;
-        V += vstride;
-    }
-
-    return 0;
-}
-
-static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic,
-                                const uint8_t *src, int src_size)
-{
-    GetByteContext gb;
-    GetBitContext  gb2;
-    int nslices, slice, slice_height, ref_slice_height;
-    int cur_y, next_y;
-    uint32_t off, slice_size;
-    uint8_t *Y, *U, *V;
-    int ret;
-
-    bytestream2_init(&gb, src, src_size);
-    nslices = bytestream2_get_le16(&gb);
-    off = FFALIGN(nslices * 4 + 2, 16);
-    if (src_size < off) {
-        av_log(avctx, AV_LOG_ERROR, "no slice data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!nslices || avctx->height % nslices) {
-        avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
-                              avctx->width, avctx->height);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    ref_slice_height = avctx->height / nslices;
-    if ((avctx->width & 3) || (avctx->height & 3)) {
-        avpriv_request_sample(avctx, "Frame dimensions %dx%d",
-                              avctx->width, avctx->height);
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV410P;
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    Y = pic->data[0];
-    U = pic->data[1];
-    V = pic->data[2];
-
-    cur_y  = 0;
-    next_y = ref_slice_height;
-    for (slice = 0; slice < nslices; slice++) {
-        slice_size   = bytestream2_get_le32(&gb);
-        slice_height = (next_y & ~3) - (cur_y & ~3);
-        if (slice_size > src_size - off) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "invalid slice size %d (only %d bytes left)\n",
-                   slice_size, src_size - off);
-            return AVERROR_INVALIDDATA;
-        }
-        if (slice_size <= 16) {
-            av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (AV_RL32(src + off) != slice_size - 16) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Slice sizes mismatch: got %d instead of %d\n",
-                   AV_RL32(src + off), slice_size - 16);
-        }
-        init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
-        dx2_decode_slice_410(&gb2, avctx->width, slice_height, Y, U, V,
-                             pic->linesize[0], pic->linesize[1],
-                             pic->linesize[2]);
-
-        Y += pic->linesize[0] *  slice_height;
-        U += pic->linesize[1] * (slice_height >> 2);
-        V += pic->linesize[2] * (slice_height >> 2);
-        off += slice_size;
-        cur_y   = next_y;
-        next_y += ref_slice_height;
-    }
-
-    return 0;
-}
-
-static int dx2_decode_slice_420(GetBitContext *gb, int width, int height,
-                                uint8_t *Y, uint8_t *U, uint8_t *V,
-                                int ystride, int ustride, int vstride)
-{
-    int x, y, i;
-    uint8_t lru[3][8];
-
-    for (i = 0; i < 3; i++)
-        memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
-
-    for (y = 0; y < height; y+=2) {
-        for (x = 0; x < width; x += 2) {
-            Y[x + 0 + 0 * ystride] = decode_sym(gb, lru[0]);
-            Y[x + 1 + 0 * ystride] = decode_sym(gb, lru[0]);
-            Y[x + 0 + 1 * ystride] = decode_sym(gb, lru[0]);
-            Y[x + 1 + 1 * ystride] = decode_sym(gb, lru[0]);
-            U[x >> 1] = decode_sym(gb, lru[1]) ^ 0x80;
-            V[x >> 1] = decode_sym(gb, lru[2]) ^ 0x80;
-        }
-
-        Y += ystride << 1;
-        U += ustride;
-        V += vstride;
-    }
-
-    return 0;
-}
-
-static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic,
-                                const uint8_t *src, int src_size)
-{
-    GetByteContext gb;
-    GetBitContext  gb2;
-    int nslices, slice, slice_height, ref_slice_height;
-    int cur_y, next_y;
-    uint32_t off, slice_size;
-    uint8_t *Y, *U, *V;
-    int ret;
-
-    bytestream2_init(&gb, src, src_size);
-    nslices = bytestream2_get_le16(&gb);
-    off = FFALIGN(nslices * 4 + 2, 16);
-    if (src_size < off) {
-        av_log(avctx, AV_LOG_ERROR, "no slice data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!nslices || avctx->height % nslices) {
-        avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
-                              avctx->width, avctx->height);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    ref_slice_height = avctx->height / nslices;
-    if ((avctx->width & 1) || (avctx->height & 1)) {
-        avpriv_request_sample(avctx, "Frame dimensions %dx%d",
-                              avctx->width, avctx->height);
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    Y = pic->data[0];
-    U = pic->data[1];
-    V = pic->data[2];
-
-    cur_y  = 0;
-    next_y = ref_slice_height;
-    for (slice = 0; slice < nslices; slice++) {
-        slice_size   = bytestream2_get_le32(&gb);
-        slice_height = (next_y & ~1) - (cur_y & ~1);
-        if (slice_size > src_size - off) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "invalid slice size %d (only %d bytes left)\n",
-                   slice_size, src_size - off);
-            return AVERROR_INVALIDDATA;
-        }
-        if (slice_size <= 16) {
-            av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (AV_RL32(src + off) != slice_size - 16) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Slice sizes mismatch: got %d instead of %d\n",
-                   AV_RL32(src + off), slice_size - 16);
-        }
-        init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
-        dx2_decode_slice_420(&gb2, avctx->width, slice_height, Y, U, V,
-                             pic->linesize[0], pic->linesize[1],
-                             pic->linesize[2]);
-
-        Y += pic->linesize[0] *  slice_height;
-        U += pic->linesize[1] * (slice_height >> 1);
-        V += pic->linesize[2] * (slice_height >> 1);
-        off += slice_size;
-        cur_y   = next_y;
-        next_y += ref_slice_height;
-    }
-
-    return 0;
-}
-
-static int dx2_decode_slice_444(GetBitContext *gb, int width, int height,
-                                uint8_t *Y, uint8_t *U, uint8_t *V,
-                                int ystride, int ustride, int vstride)
-{
-    int x, y, i;
-    uint8_t lru[3][8];
-
-    for (i = 0; i < 3; i++)
-        memcpy(lru[i], def_lru, 8 * sizeof(*def_lru));
-
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++) {
-            Y[x] = decode_sym(gb, lru[0]);
-            U[x] = decode_sym(gb, lru[1]) ^ 0x80;
-            V[x] = decode_sym(gb, lru[2]) ^ 0x80;
-        }
-
-        Y += ystride;
-        U += ustride;
-        V += vstride;
-    }
-
-    return 0;
-}
-
-static int dxtory_decode_v2_444(AVCodecContext *avctx, AVFrame *pic,
-                                const uint8_t *src, int src_size)
-{
-    GetByteContext gb;
-    GetBitContext  gb2;
-    int nslices, slice, slice_height;
-    uint32_t off, slice_size;
-    uint8_t *Y, *U, *V;
-    int ret;
-
-    bytestream2_init(&gb, src, src_size);
-    nslices = bytestream2_get_le16(&gb);
-    off = FFALIGN(nslices * 4 + 2, 16);
-    if (src_size < off) {
-        av_log(avctx, AV_LOG_ERROR, "no slice data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!nslices || avctx->height % nslices) {
-        avpriv_request_sample(avctx, "%d slices for %dx%d", nslices,
-                              avctx->width, avctx->height);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    slice_height = avctx->height / nslices;
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV444P;
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    Y = pic->data[0];
-    U = pic->data[1];
-    V = pic->data[2];
-
-    for (slice = 0; slice < nslices; slice++) {
-        slice_size = bytestream2_get_le32(&gb);
-        if (slice_size > src_size - off) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "invalid slice size %d (only %d bytes left)\n",
-                   slice_size, src_size - off);
-            return AVERROR_INVALIDDATA;
-        }
-        if (slice_size <= 16) {
-            av_log(avctx, AV_LOG_ERROR, "invalid slice size %d\n", slice_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (AV_RL32(src + off) != slice_size - 16) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Slice sizes mismatch: got %d instead of %d\n",
-                   AV_RL32(src + off), slice_size - 16);
-        }
-        init_get_bits(&gb2, src + off + 16, (slice_size - 16) * 8);
-        dx2_decode_slice_444(&gb2, avctx->width, slice_height, Y, U, V,
-                             pic->linesize[0], pic->linesize[1],
-                             pic->linesize[2]);
-
-        Y += pic->linesize[0] * slice_height;
-        U += pic->linesize[1] * slice_height;
-        V += pic->linesize[2] * slice_height;
-        off += slice_size;
-    }
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    AVFrame *pic = data;
-    const uint8_t *src = avpkt->data;
-    int ret;
-
-    if (avpkt->size < 16) {
-        av_log(avctx, AV_LOG_ERROR, "packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    switch (AV_RB32(src)) {
-    case 0x01000001:
-        ret = dxtory_decode_v1_rgb(avctx, pic, src + 16, avpkt->size - 16,
-                                   AV_PIX_FMT_BGR24, 3);
-        break;
-    case 0x01000009:
-        ret = dxtory_decode_v2_rgb(avctx, pic, src + 16, avpkt->size - 16);
-        break;
-    case 0x02000001:
-        ret = dxtory_decode_v1_420(avctx, pic, src + 16, avpkt->size - 16);
-        break;
-    case 0x02000009:
-        ret = dxtory_decode_v2_420(avctx, pic, src + 16, avpkt->size - 16);
-        break;
-    case 0x03000001:
-        ret = dxtory_decode_v1_410(avctx, pic, src + 16, avpkt->size - 16);
-        break;
-    case 0x03000009:
-        ret = dxtory_decode_v2_410(avctx, pic, src + 16, avpkt->size - 16);
-        break;
-    case 0x04000001:
-        ret = dxtory_decode_v1_444(avctx, pic, src + 16, avpkt->size - 16);
-        break;
-    case 0x04000009:
-        ret = dxtory_decode_v2_444(avctx, pic, src + 16, avpkt->size - 16);
-        break;
-    case 0x17000001:
-        ret = dxtory_decode_v1_rgb(avctx, pic, src + 16, avpkt->size - 16,
-                                   AV_PIX_FMT_RGB565LE, 2);
-        break;
-    case 0x17000009:
-        ret = dxtory_decode_v2_565(avctx, pic, src + 16, avpkt->size - 16, 1);
-        break;
-    case 0x18000001:
-    case 0x19000001:
-        ret = dxtory_decode_v1_rgb(avctx, pic, src + 16, avpkt->size - 16,
-                                   AV_PIX_FMT_RGB555LE, 2);
-        break;
-    case 0x18000009:
-    case 0x19000009:
-        ret = dxtory_decode_v2_565(avctx, pic, src + 16, avpkt->size - 16, 0);
-        break;
-    default:
-        avpriv_request_sample(avctx, "Frame header %X", AV_RB32(src));
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (ret)
-        return ret;
-
-    pic->pict_type = AV_PICTURE_TYPE_I;
-    pic->key_frame = 1;
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_dxtory_decoder = {
-    .name           = "dxtory",
-    .long_name      = NULL_IF_CONFIG_SMALL("Dxtory"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DXTORY,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/dxva2.c b/deps/libav/libavcodec/dxva2.c
deleted file mode 100644
index 6d4550c..0000000
--- a/deps/libav/libavcodec/dxva2.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * DXVA2 HW acceleration.
- *
- * copyright (c) 2010 Laurent Aimar
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <assert.h>
-#include <string.h>
-
-#include "libavutil/log.h"
-#include "libavutil/time.h"
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "dxva2_internal.h"
-
-void *ff_dxva2_get_surface(const Picture *picture)
-{
-    return picture->f.data[3];
-}
-
-unsigned ff_dxva2_get_surface_index(const struct dxva_context *ctx,
-                                    const Picture *picture)
-{
-    void *surface = ff_dxva2_get_surface(picture);
-    unsigned i;
-
-    for (i = 0; i < ctx->surface_count; i++)
-        if (ctx->surface[i] == surface)
-            return i;
-
-    assert(0);
-    return 0;
-}
-
-int ff_dxva2_commit_buffer(AVCodecContext *avctx,
-                           struct dxva_context *ctx,
-                           DXVA2_DecodeBufferDesc *dsc,
-                           unsigned type, const void *data, unsigned size,
-                           unsigned mb_count)
-{
-    void     *dxva_data;
-    unsigned dxva_size;
-    int      result;
-    HRESULT hr;
-
-    hr = IDirectXVideoDecoder_GetBuffer(ctx->decoder, type,
-                                        &dxva_data, &dxva_size);
-    if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %u: 0x%lx\n",
-               type, hr);
-        return -1;
-    }
-    if (size <= dxva_size) {
-        memcpy(dxva_data, data, size);
-
-        memset(dsc, 0, sizeof(*dsc));
-        dsc->CompressedBufferType = type;
-        dsc->DataSize             = size;
-        dsc->NumMBsInBuffer       = mb_count;
-
-        result = 0;
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "Buffer for type %u was too small\n", type);
-        result = -1;
-    }
-
-    hr = IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, type);
-    if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Failed to release buffer type %u: 0x%lx\n",
-               type, hr);
-        result = -1;
-    }
-    return result;
-}
-
-int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic,
-                              const void *pp, unsigned pp_size,
-                              const void *qm, unsigned qm_size,
-                              int (*commit_bs_si)(AVCodecContext *,
-                                                  DXVA2_DecodeBufferDesc *bs,
-                                                  DXVA2_DecodeBufferDesc *slice))
-{
-    struct dxva_context *ctx = avctx->hwaccel_context;
-    unsigned               buffer_count = 0;
-    DXVA2_DecodeBufferDesc buffer[4];
-    DXVA2_DecodeExecuteParams exec = { 0 };
-    int result, runs = 0;
-    HRESULT hr;
-
-    do {
-        hr = IDirectXVideoDecoder_BeginFrame(ctx->decoder,
-                                             ff_dxva2_get_surface(pic),
-                                             NULL);
-        if (hr == E_PENDING)
-            av_usleep(2000);
-    } while (hr == E_PENDING && ++runs < 50);
-
-    if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: 0x%lx\n", hr);
-        return -1;
-    }
-
-    result = ff_dxva2_commit_buffer(avctx, ctx, &buffer[buffer_count],
-                                    DXVA2_PictureParametersBufferType,
-                                    pp, pp_size, 0);
-    if (result) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Failed to add picture parameter buffer\n");
-        goto end;
-    }
-    buffer_count++;
-
-    if (qm_size > 0) {
-        result = ff_dxva2_commit_buffer(avctx, ctx, &buffer[buffer_count],
-                                        DXVA2_InverseQuantizationMatrixBufferType,
-                                        qm, qm_size, 0);
-        if (result) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Failed to add inverse quantization matrix buffer\n");
-            goto end;
-        }
-        buffer_count++;
-    }
-
-    result = commit_bs_si(avctx,
-                          &buffer[buffer_count + 0],
-                          &buffer[buffer_count + 1]);
-    if (result) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Failed to add bitstream or slice control buffer\n");
-        goto end;
-    }
-    buffer_count += 2;
-
-    /* TODO Film Grain when possible */
-
-    assert(buffer_count == 1 + (qm_size > 0) + 2);
-
-    exec.NumCompBuffers      = buffer_count;
-    exec.pCompressedBuffers  = buffer;
-    exec.pExtensionData      = NULL;
-    hr = IDirectXVideoDecoder_Execute(ctx->decoder, &exec);
-    if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to execute: 0x%lx\n", hr);
-        result = -1;
-    }
-
-end:
-    hr = IDirectXVideoDecoder_EndFrame(ctx->decoder, NULL);
-    if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to end frame: 0x%lx\n", hr);
-        result = -1;
-    }
-
-    return result;
-}
diff --git a/deps/libav/libavcodec/dxva2.h b/deps/libav/libavcodec/dxva2.h
deleted file mode 100644
index d161eb9..0000000
--- a/deps/libav/libavcodec/dxva2.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DXVA2 HW acceleration
- *
- * copyright (c) 2009 Laurent Aimar
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DXVA_H
-#define AVCODEC_DXVA_H
-
-/**
- * @file
- * @ingroup lavc_codec_hwaccel_dxva2
- * Public libavcodec DXVA2 header.
- */
-
-#define _WIN32_WINNT 0x0600
-#include <stdint.h>
-#include <d3d9.h>
-#include <dxva2api.h>
-
-/**
- * @defgroup lavc_codec_hwaccel_dxva2 DXVA2
- * @ingroup lavc_codec_hwaccel
- *
- * @{
- */
-
-#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
-
-/**
- * This structure is used to provides the necessary configurations and data
- * to the DXVA2 Libav HWAccel implementation.
- *
- * The application must make it available as AVCodecContext.hwaccel_context.
- */
-struct dxva_context {
-    /**
-     * DXVA2 decoder object
-     */
-    IDirectXVideoDecoder *decoder;
-
-    /**
-     * DXVA2 configuration used to create the decoder
-     */
-    const DXVA2_ConfigPictureDecode *cfg;
-
-    /**
-     * The number of surface in the surface array
-     */
-    unsigned surface_count;
-
-    /**
-     * The array of Direct3D surfaces used to create the decoder
-     */
-    LPDIRECT3DSURFACE9 *surface;
-
-    /**
-     * A bit field configuring the workarounds needed for using the decoder
-     */
-    uint64_t workaround;
-
-    /**
-     * Private to the Libav AVHWAccel implementation
-     */
-    unsigned report_id;
-};
-
-/**
- * @}
- */
-
-#endif /* AVCODEC_DXVA_H */
diff --git a/deps/libav/libavcodec/dxva2_h264.c b/deps/libav/libavcodec/dxva2_h264.c
deleted file mode 100644
index 6457824..0000000
--- a/deps/libav/libavcodec/dxva2_h264.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * DXVA2 H264 HW acceleration.
- *
- * copyright (c) 2009 Laurent Aimar
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "dxva2_internal.h"
-#include "h264.h"
-#include "h264data.h"
-
-struct dxva2_picture_context {
-    DXVA_PicParams_H264   pp;
-    DXVA_Qmatrix_H264     qm;
-    unsigned              slice_count;
-    DXVA_Slice_H264_Short slice_short[MAX_SLICES];
-    DXVA_Slice_H264_Long  slice_long[MAX_SLICES];
-    const uint8_t         *bitstream;
-    unsigned              bitstream_size;
-};
-
-static void fill_picture_entry(DXVA_PicEntry_H264 *pic,
-                               unsigned index, unsigned flag)
-{
-    assert((index&0x7f) == index && (flag&0x01) == flag);
-    pic->bPicEntry = index | (flag << 7);
-}
-
-static void fill_picture_parameters(struct dxva_context *ctx, const H264Context *h,
-                                    DXVA_PicParams_H264 *pp)
-{
-    const Picture *current_picture = h->cur_pic_ptr;
-    int i, j;
-
-    memset(pp, 0, sizeof(*pp));
-    /* Configure current picture */
-    fill_picture_entry(&pp->CurrPic,
-                       ff_dxva2_get_surface_index(ctx, current_picture),
-                       h->picture_structure == PICT_BOTTOM_FIELD);
-    /* Configure the set of references */
-    pp->UsedForReferenceFlags  = 0;
-    pp->NonExistingFrameFlags  = 0;
-    for (i = 0, j = 0; i < FF_ARRAY_ELEMS(pp->RefFrameList); i++) {
-        const Picture *r;
-        if (j < h->short_ref_count) {
-            r = h->short_ref[j++];
-        } else {
-            r = NULL;
-            while (!r && j < h->short_ref_count + 16)
-                r = h->long_ref[j++ - h->short_ref_count];
-        }
-        if (r) {
-            fill_picture_entry(&pp->RefFrameList[i],
-                               ff_dxva2_get_surface_index(ctx, r),
-                               r->long_ref != 0);
-
-            if ((r->reference & PICT_TOP_FIELD) && r->field_poc[0] != INT_MAX)
-                pp->FieldOrderCntList[i][0] = r->field_poc[0];
-            if ((r->reference & PICT_BOTTOM_FIELD) && r->field_poc[1] != INT_MAX)
-                pp->FieldOrderCntList[i][1] = r->field_poc[1];
-
-            pp->FrameNumList[i] = r->long_ref ? r->pic_id : r->frame_num;
-            if (r->reference & PICT_TOP_FIELD)
-                pp->UsedForReferenceFlags |= 1 << (2*i + 0);
-            if (r->reference & PICT_BOTTOM_FIELD)
-                pp->UsedForReferenceFlags |= 1 << (2*i + 1);
-        } else {
-            pp->RefFrameList[i].bPicEntry = 0xff;
-            pp->FieldOrderCntList[i][0]   = 0;
-            pp->FieldOrderCntList[i][1]   = 0;
-            pp->FrameNumList[i]           = 0;
-        }
-    }
-
-    pp->wFrameWidthInMbsMinus1        = h->mb_width  - 1;
-    pp->wFrameHeightInMbsMinus1       = h->mb_height - 1;
-    pp->num_ref_frames                = h->sps.ref_frame_count;
-
-    pp->wBitFields                    = ((h->picture_structure != PICT_FRAME) <<  0) |
-                                        ((h->sps.mb_aff &&
-                                        (h->picture_structure == PICT_FRAME)) <<  1) |
-                                        (h->sps.residual_color_transform_flag <<  2) |
-                                        /* sp_for_switch_flag (not implemented by Libav) */
-                                        (0                                    <<  3) |
-                                        (h->sps.chroma_format_idc             <<  4) |
-                                        ((h->nal_ref_idc != 0)                <<  6) |
-                                        (h->pps.constrained_intra_pred        <<  7) |
-                                        (h->pps.weighted_pred                 <<  8) |
-                                        (h->pps.weighted_bipred_idc           <<  9) |
-                                        /* MbsConsecutiveFlag */
-                                        (1                                    << 11) |
-                                        (h->sps.frame_mbs_only_flag           << 12) |
-                                        (h->pps.transform_8x8_mode            << 13) |
-                                        ((h->sps.level_idc >= 31)             << 14) |
-                                        /* IntraPicFlag (Modified if we detect a non
-                                         * intra slice in dxva2_h264_decode_slice) */
-                                        (1                                    << 15);
-
-    pp->bit_depth_luma_minus8         = h->sps.bit_depth_luma - 8;
-    pp->bit_depth_chroma_minus8       = h->sps.bit_depth_chroma - 8;
-    if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG)
-        pp->Reserved16Bits            = 0;
-    else
-        pp->Reserved16Bits            = 3; /* FIXME is there a way to detect the right mode ? */
-    pp->StatusReportFeedbackNumber    = 1 + ctx->report_id++;
-    pp->CurrFieldOrderCnt[0] = 0;
-    if ((h->picture_structure & PICT_TOP_FIELD) &&
-        current_picture->field_poc[0] != INT_MAX)
-        pp->CurrFieldOrderCnt[0] = current_picture->field_poc[0];
-    pp->CurrFieldOrderCnt[1] = 0;
-    if ((h->picture_structure & PICT_BOTTOM_FIELD) &&
-        current_picture->field_poc[1] != INT_MAX)
-        pp->CurrFieldOrderCnt[1] = current_picture->field_poc[1];
-    pp->pic_init_qs_minus26           = h->pps.init_qs - 26;
-    pp->chroma_qp_index_offset        = h->pps.chroma_qp_index_offset[0];
-    pp->second_chroma_qp_index_offset = h->pps.chroma_qp_index_offset[1];
-    pp->ContinuationFlag              = 1;
-    pp->pic_init_qp_minus26           = h->pps.init_qp - 26;
-    pp->num_ref_idx_l0_active_minus1  = h->pps.ref_count[0] - 1;
-    pp->num_ref_idx_l1_active_minus1  = h->pps.ref_count[1] - 1;
-    pp->Reserved8BitsA                = 0;
-    pp->frame_num                     = h->frame_num;
-    pp->log2_max_frame_num_minus4     = h->sps.log2_max_frame_num - 4;
-    pp->pic_order_cnt_type            = h->sps.poc_type;
-    if (h->sps.poc_type == 0)
-        pp->log2_max_pic_order_cnt_lsb_minus4 = h->sps.log2_max_poc_lsb - 4;
-    else if (h->sps.poc_type == 1)
-        pp->delta_pic_order_always_zero_flag = h->sps.delta_pic_order_always_zero_flag;
-    pp->direct_8x8_inference_flag     = h->sps.direct_8x8_inference_flag;
-    pp->entropy_coding_mode_flag      = h->pps.cabac;
-    pp->pic_order_present_flag        = h->pps.pic_order_present;
-    pp->num_slice_groups_minus1       = h->pps.slice_group_count - 1;
-    pp->slice_group_map_type          = h->pps.mb_slice_group_map_type;
-    pp->deblocking_filter_control_present_flag = h->pps.deblocking_filter_parameters_present;
-    pp->redundant_pic_cnt_present_flag= h->pps.redundant_pic_cnt_present;
-    pp->Reserved8BitsB                = 0;
-    pp->slice_group_change_rate_minus1= 0;  /* XXX not implemented by Libav */
-    //pp->SliceGroupMap[810];               /* XXX not implemented by Libav */
-}
-
-static void fill_scaling_lists(struct dxva_context *ctx, const H264Context *h, DXVA_Qmatrix_H264 *qm)
-{
-    unsigned i, j;
-    memset(qm, 0, sizeof(*qm));
-    if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG) {
-        for (i = 0; i < 6; i++)
-            for (j = 0; j < 16; j++)
-                qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][j];
-
-        for (i = 0; i < 64; i++) {
-            qm->bScalingLists8x8[0][i] = h->pps.scaling_matrix8[0][i];
-            qm->bScalingLists8x8[1][i] = h->pps.scaling_matrix8[3][i];
-        }
-    } else {
-        for (i = 0; i < 6; i++)
-            for (j = 0; j < 16; j++)
-                qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][zigzag_scan[j]];
-
-        for (i = 0; i < 64; i++) {
-            qm->bScalingLists8x8[0][i] = h->pps.scaling_matrix8[0][ff_zigzag_direct[i]];
-            qm->bScalingLists8x8[1][i] = h->pps.scaling_matrix8[3][ff_zigzag_direct[i]];
-        }
-    }
-}
-
-static int is_slice_short(struct dxva_context *ctx)
-{
-    assert(ctx->cfg->ConfigBitstreamRaw == 1 ||
-           ctx->cfg->ConfigBitstreamRaw == 2);
-    return ctx->cfg->ConfigBitstreamRaw == 2;
-}
-
-static void fill_slice_short(DXVA_Slice_H264_Short *slice,
-                             unsigned position, unsigned size)
-{
-    memset(slice, 0, sizeof(*slice));
-    slice->BSNALunitDataLocation = position;
-    slice->SliceBytesInBuffer    = size;
-    slice->wBadSliceChopping     = 0;
-}
-
-static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
-                            unsigned position, unsigned size)
-{
-    const H264Context *h = avctx->priv_data;
-    struct dxva_context *ctx = avctx->hwaccel_context;
-    unsigned list;
-
-    memset(slice, 0, sizeof(*slice));
-    slice->BSNALunitDataLocation = position;
-    slice->SliceBytesInBuffer    = size;
-    slice->wBadSliceChopping     = 0;
-
-    slice->first_mb_in_slice     = (h->mb_y >> FIELD_OR_MBAFF_PICTURE(h)) * h->mb_width + h->mb_x;
-    slice->NumMbsForSlice        = 0; /* XXX it is set once we have all slices */
-    slice->BitOffsetToSliceData  = get_bits_count(&h->gb);
-    slice->slice_type            = ff_h264_get_slice_type(h);
-    if (h->slice_type_fixed)
-        slice->slice_type += 5;
-    slice->luma_log2_weight_denom       = h->luma_log2_weight_denom;
-    slice->chroma_log2_weight_denom     = h->chroma_log2_weight_denom;
-    if (h->list_count > 0)
-        slice->num_ref_idx_l0_active_minus1 = h->ref_count[0] - 1;
-    if (h->list_count > 1)
-        slice->num_ref_idx_l1_active_minus1 = h->ref_count[1] - 1;
-    slice->slice_alpha_c0_offset_div2   = h->slice_alpha_c0_offset / 2 - 26;
-    slice->slice_beta_offset_div2       = h->slice_beta_offset     / 2 - 26;
-    slice->Reserved8Bits                = 0;
-
-    for (list = 0; list < 2; list++) {
-        unsigned i;
-        for (i = 0; i < FF_ARRAY_ELEMS(slice->RefPicList[list]); i++) {
-            if (list < h->list_count && i < h->ref_count[list]) {
-                const Picture *r = &h->ref_list[list][i];
-                unsigned plane;
-                fill_picture_entry(&slice->RefPicList[list][i],
-                                   ff_dxva2_get_surface_index(ctx, r),
-                                   r->reference == PICT_BOTTOM_FIELD);
-                for (plane = 0; plane < 3; plane++) {
-                    int w, o;
-                    if (plane == 0 && h->luma_weight_flag[list]) {
-                        w = h->luma_weight[i][list][0];
-                        o = h->luma_weight[i][list][1];
-                    } else if (plane >= 1 && h->chroma_weight_flag[list]) {
-                        w = h->chroma_weight[i][list][plane-1][0];
-                        o = h->chroma_weight[i][list][plane-1][1];
-                    } else {
-                        w = 1 << (plane == 0 ? h->luma_log2_weight_denom :
-                                               h->chroma_log2_weight_denom);
-                        o = 0;
-                    }
-                    slice->Weights[list][i][plane][0] = w;
-                    slice->Weights[list][i][plane][1] = o;
-                }
-            } else {
-                unsigned plane;
-                slice->RefPicList[list][i].bPicEntry = 0xff;
-                for (plane = 0; plane < 3; plane++) {
-                    slice->Weights[list][i][plane][0] = 0;
-                    slice->Weights[list][i][plane][1] = 0;
-                }
-            }
-        }
-    }
-    slice->slice_qs_delta    = 0; /* XXX not implemented by Libav */
-    slice->slice_qp_delta    = h->qscale - h->pps.init_qp;
-    slice->redundant_pic_cnt = h->redundant_pic_count;
-    if (h->slice_type == AV_PICTURE_TYPE_B)
-        slice->direct_spatial_mv_pred_flag = h->direct_spatial_mv_pred;
-    slice->cabac_init_idc = h->pps.cabac ? h->cabac_init_idc : 0;
-    if (h->deblocking_filter < 2)
-        slice->disable_deblocking_filter_idc = 1 - h->deblocking_filter;
-    else
-        slice->disable_deblocking_filter_idc = h->deblocking_filter;
-    slice->slice_id = h->current_slice - 1;
-}
-
-static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
-                                             DXVA2_DecodeBufferDesc *bs,
-                                             DXVA2_DecodeBufferDesc *sc)
-{
-    const H264Context *h = avctx->priv_data;
-    const unsigned mb_count = h->mb_width * h->mb_height;
-    struct dxva_context *ctx = avctx->hwaccel_context;
-    const Picture *current_picture = h->cur_pic_ptr;
-    struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
-    DXVA_Slice_H264_Short *slice = NULL;
-    uint8_t  *dxva_data, *current, *end;
-    unsigned dxva_size;
-    void     *slice_data;
-    unsigned slice_size;
-    unsigned padding;
-    unsigned i;
-
-    /* Create an annex B bitstream buffer with only slice NAL and finalize slice */
-    if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->decoder,
-                                               DXVA2_BitStreamDateBufferType,
-                                               &dxva_data, &dxva_size)))
-        return -1;
-    current = dxva_data;
-    end = dxva_data + dxva_size;
-
-    for (i = 0; i < ctx_pic->slice_count; i++) {
-        static const uint8_t start_code[] = { 0, 0, 1 };
-        static const unsigned start_code_size = sizeof(start_code);
-        unsigned position, size;
-
-        assert(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) ==
-               offsetof(DXVA_Slice_H264_Long,  BSNALunitDataLocation));
-        assert(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) ==
-               offsetof(DXVA_Slice_H264_Long,  SliceBytesInBuffer));
-
-        if (is_slice_short(ctx))
-            slice = &ctx_pic->slice_short[i];
-        else
-            slice = (DXVA_Slice_H264_Short*)&ctx_pic->slice_long[i];
-
-        position = slice->BSNALunitDataLocation;
-        size     = slice->SliceBytesInBuffer;
-        if (start_code_size + size > end - current) {
-            av_log(avctx, AV_LOG_ERROR, "Failed to build bitstream");
-            break;
-        }
-
-        slice->BSNALunitDataLocation = current - dxva_data;
-        slice->SliceBytesInBuffer    = start_code_size + size;
-
-        if (!is_slice_short(ctx)) {
-            DXVA_Slice_H264_Long *slice_long = (DXVA_Slice_H264_Long*)slice;
-            if (i < ctx_pic->slice_count - 1)
-                slice_long->NumMbsForSlice =
-                    slice_long[1].first_mb_in_slice - slice_long[0].first_mb_in_slice;
-            else
-                slice_long->NumMbsForSlice = mb_count - slice_long->first_mb_in_slice;
-        }
-
-        memcpy(current, start_code, start_code_size);
-        current += start_code_size;
-
-        memcpy(current, &ctx_pic->bitstream[position], size);
-        current += size;
-    }
-    padding = FFMIN(128 - ((current - dxva_data) & 127), end - current);
-    if (slice && padding > 0) {
-        memset(current, 0, padding);
-        current += padding;
-
-        slice->SliceBytesInBuffer += padding;
-    }
-    if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder,
-                                                  DXVA2_BitStreamDateBufferType)))
-        return -1;
-    if (i < ctx_pic->slice_count)
-        return -1;
-
-    memset(bs, 0, sizeof(*bs));
-    bs->CompressedBufferType = DXVA2_BitStreamDateBufferType;
-    bs->DataSize             = current - dxva_data;
-    bs->NumMBsInBuffer       = mb_count;
-
-    if (is_slice_short(ctx)) {
-        slice_data = ctx_pic->slice_short;
-        slice_size = ctx_pic->slice_count * sizeof(*ctx_pic->slice_short);
-    } else {
-        slice_data = ctx_pic->slice_long;
-        slice_size = ctx_pic->slice_count * sizeof(*ctx_pic->slice_long);
-    }
-    assert((bs->DataSize & 127) == 0);
-    return ff_dxva2_commit_buffer(avctx, ctx, sc,
-                                  DXVA2_SliceControlBufferType,
-                                  slice_data, slice_size, mb_count);
-}
-
-
-static int dxva2_h264_start_frame(AVCodecContext *avctx,
-                                  av_unused const uint8_t *buffer,
-                                  av_unused uint32_t size)
-{
-    const H264Context *h = avctx->priv_data;
-    struct dxva_context *ctx = avctx->hwaccel_context;
-    struct dxva2_picture_context *ctx_pic = h->cur_pic_ptr->hwaccel_picture_private;
-
-    if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0)
-        return -1;
-    assert(ctx_pic);
-
-    /* Fill up DXVA_PicParams_H264 */
-    fill_picture_parameters(ctx, h, &ctx_pic->pp);
-
-    /* Fill up DXVA_Qmatrix_H264 */
-    fill_scaling_lists(ctx, h, &ctx_pic->qm);
-
-    ctx_pic->slice_count    = 0;
-    ctx_pic->bitstream_size = 0;
-    ctx_pic->bitstream      = NULL;
-    return 0;
-}
-
-static int dxva2_h264_decode_slice(AVCodecContext *avctx,
-                                   const uint8_t *buffer,
-                                   uint32_t size)
-{
-    const H264Context *h = avctx->priv_data;
-    struct dxva_context *ctx = avctx->hwaccel_context;
-    const Picture *current_picture = h->cur_pic_ptr;
-    struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
-    unsigned position;
-
-    if (ctx_pic->slice_count >= MAX_SLICES)
-        return -1;
-
-    if (!ctx_pic->bitstream)
-        ctx_pic->bitstream = buffer;
-    ctx_pic->bitstream_size += size;
-
-    position = buffer - ctx_pic->bitstream;
-    if (is_slice_short(ctx))
-        fill_slice_short(&ctx_pic->slice_short[ctx_pic->slice_count],
-                         position, size);
-    else
-        fill_slice_long(avctx, &ctx_pic->slice_long[ctx_pic->slice_count],
-                        position, size);
-    ctx_pic->slice_count++;
-
-    if (h->slice_type != AV_PICTURE_TYPE_I && h->slice_type != AV_PICTURE_TYPE_SI)
-        ctx_pic->pp.wBitFields &= ~(1 << 15); /* Set IntraPicFlag to 0 */
-    return 0;
-}
-
-static int dxva2_h264_end_frame(AVCodecContext *avctx)
-{
-    H264Context *h = avctx->priv_data;
-    struct dxva2_picture_context *ctx_pic =
-        h->cur_pic_ptr->hwaccel_picture_private;
-    int ret;
-
-    if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
-        return -1;
-    ret = ff_dxva2_common_end_frame(avctx, h->cur_pic_ptr,
-                                    &ctx_pic->pp, sizeof(ctx_pic->pp),
-                                    &ctx_pic->qm, sizeof(ctx_pic->qm),
-                                    commit_bitstream_and_slice_buffer);
-    if (!ret)
-        ff_h264_draw_horiz_band(h, 0, h->avctx->height);
-    return ret;
-}
-
-AVHWAccel ff_h264_dxva2_hwaccel = {
-    .name           = "h264_dxva2",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H264,
-    .pix_fmt        = AV_PIX_FMT_DXVA2_VLD,
-    .start_frame    = dxva2_h264_start_frame,
-    .decode_slice   = dxva2_h264_decode_slice,
-    .end_frame      = dxva2_h264_end_frame,
-    .priv_data_size = sizeof(struct dxva2_picture_context),
-};
diff --git a/deps/libav/libavcodec/dxva2_internal.h b/deps/libav/libavcodec/dxva2_internal.h
deleted file mode 100644
index a81cfbe..0000000
--- a/deps/libav/libavcodec/dxva2_internal.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DXVA2 HW acceleration
- *
- * copyright (c) 2010 Laurent Aimar
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DXVA_INTERNAL_H
-#define AVCODEC_DXVA_INTERNAL_H
-
-#define _WIN32_WINNT 0x0600
-#define COBJMACROS
-
-#include "config.h"
-
-#include "dxva2.h"
-#if HAVE_DXVA_H
-#include <dxva.h>
-#endif
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-
-void *ff_dxva2_get_surface(const Picture *picture);
-
-unsigned ff_dxva2_get_surface_index(const struct dxva_context *,
-                                    const Picture *picture);
-
-int ff_dxva2_commit_buffer(AVCodecContext *, struct dxva_context *,
-                           DXVA2_DecodeBufferDesc *,
-                           unsigned type, const void *data, unsigned size,
-                           unsigned mb_count);
-
-
-int ff_dxva2_common_end_frame(AVCodecContext *, Picture *,
-                              const void *pp, unsigned pp_size,
-                              const void *qm, unsigned qm_size,
-                              int (*commit_bs_si)(AVCodecContext *,
-                                                  DXVA2_DecodeBufferDesc *bs,
-                                                  DXVA2_DecodeBufferDesc *slice));
-
-#endif /* AVCODEC_DXVA_INTERNAL_H */
diff --git a/deps/libav/libavcodec/dxva2_mpeg2.c b/deps/libav/libavcodec/dxva2_mpeg2.c
deleted file mode 100644
index 049fa48..0000000
--- a/deps/libav/libavcodec/dxva2_mpeg2.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * MPEG-2 HW acceleration.
- *
- * copyright (c) 2010 Laurent Aimar
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "dxva2_internal.h"
-
-#define MAX_SLICES (SLICE_MAX_START_CODE - SLICE_MIN_START_CODE + 1)
-struct dxva2_picture_context {
-    DXVA_PictureParameters pp;
-    DXVA_QmatrixData       qm;
-    unsigned               slice_count;
-    DXVA_SliceInfo         slice[MAX_SLICES];
-
-    const uint8_t          *bitstream;
-    unsigned               bitstream_size;
-};
-
-static void fill_picture_parameters(AVCodecContext *avctx,
-                                    struct dxva_context *ctx,
-                                    const struct MpegEncContext *s,
-                                    DXVA_PictureParameters *pp)
-{
-    const Picture *current_picture = s->current_picture_ptr;
-    int is_field = s->picture_structure != PICT_FRAME;
-
-    memset(pp, 0, sizeof(*pp));
-    pp->wDecodedPictureIndex         = ff_dxva2_get_surface_index(ctx, current_picture);
-    pp->wDeblockedPictureIndex       = 0;
-    if (s->pict_type != AV_PICTURE_TYPE_I)
-        pp->wForwardRefPictureIndex  = ff_dxva2_get_surface_index(ctx, &s->last_picture);
-    else
-        pp->wForwardRefPictureIndex  = 0xffff;
-    if (s->pict_type == AV_PICTURE_TYPE_B)
-        pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture);
-    else
-        pp->wBackwardRefPictureIndex = 0xffff;
-    pp->wPicWidthInMBminus1          = s->mb_width  - 1;
-    pp->wPicHeightInMBminus1         = (s->mb_height >> is_field) - 1;
-    pp->bMacroblockWidthMinus1       = 15;
-    pp->bMacroblockHeightMinus1      = 15;
-    pp->bBlockWidthMinus1            = 7;
-    pp->bBlockHeightMinus1           = 7;
-    pp->bBPPminus1                   = 7;
-    pp->bPicStructure                = s->picture_structure;
-    pp->bSecondField                 = is_field && !s->first_field;
-    pp->bPicIntra                    = s->pict_type == AV_PICTURE_TYPE_I;
-    pp->bPicBackwardPrediction       = s->pict_type == AV_PICTURE_TYPE_B;
-    pp->bBidirectionalAveragingMode  = 0;
-    pp->bMVprecisionAndChromaRelation= 0; /* FIXME */
-    pp->bChromaFormat                = s->chroma_format;
-    pp->bPicScanFixed                = 1;
-    pp->bPicScanMethod               = s->alternate_scan ? 1 : 0;
-    pp->bPicReadbackRequests         = 0;
-    pp->bRcontrol                    = 0;
-    pp->bPicSpatialResid8            = 0;
-    pp->bPicOverflowBlocks           = 0;
-    pp->bPicExtrapolation            = 0;
-    pp->bPicDeblocked                = 0;
-    pp->bPicDeblockConfined          = 0;
-    pp->bPic4MVallowed               = 0;
-    pp->bPicOBMC                     = 0;
-    pp->bPicBinPB                    = 0;
-    pp->bMV_RPS                      = 0;
-    pp->bReservedBits                = 0;
-    pp->wBitstreamFcodes             = (s->mpeg_f_code[0][0] << 12) |
-                                       (s->mpeg_f_code[0][1] <<  8) |
-                                       (s->mpeg_f_code[1][0] <<  4) |
-                                       (s->mpeg_f_code[1][1]      );
-    pp->wBitstreamPCEelements        = (s->intra_dc_precision         << 14) |
-                                       (s->picture_structure          << 12) |
-                                       (s->top_field_first            << 11) |
-                                       (s->frame_pred_frame_dct       << 10) |
-                                       (s->concealment_motion_vectors <<  9) |
-                                       (s->q_scale_type               <<  8) |
-                                       (s->intra_vlc_format           <<  7) |
-                                       (s->alternate_scan             <<  6) |
-                                       (s->repeat_first_field         <<  5) |
-                                       (s->chroma_420_type            <<  4) |
-                                       (s->progressive_frame          <<  3);
-    pp->bBitstreamConcealmentNeed    = 0;
-    pp->bBitstreamConcealmentMethod  = 0;
-}
-
-static void fill_quantization_matrices(AVCodecContext *avctx,
-                                       struct dxva_context *ctx,
-                                       const struct MpegEncContext *s,
-                                       DXVA_QmatrixData *qm)
-{
-    int i;
-    for (i = 0; i < 4; i++)
-        qm->bNewQmatrix[i] = 1;
-    for (i = 0; i < 64; i++) {
-        int n = s->dsp.idct_permutation[ff_zigzag_direct[i]];
-        qm->Qmatrix[0][i] = s->intra_matrix[n];;
-        qm->Qmatrix[1][i] = s->inter_matrix[n];;
-        qm->Qmatrix[2][i] = s->chroma_intra_matrix[n];;
-        qm->Qmatrix[3][i] = s->chroma_inter_matrix[n];;
-    }
-}
-
-static void fill_slice(AVCodecContext *avctx,
-                       const struct MpegEncContext *s,
-                       DXVA_SliceInfo *slice,
-                       unsigned position,
-                       const uint8_t *buffer, unsigned size)
-{
-    int is_field = s->picture_structure != PICT_FRAME;
-    GetBitContext gb;
-
-    memset(slice, 0, sizeof(*slice));
-    slice->wHorizontalPosition = s->mb_x;
-    slice->wVerticalPosition   = s->mb_y >> is_field;
-    slice->dwSliceBitsInBuffer = 8 * size;
-    slice->dwSliceDataLocation = position;
-    slice->bStartCodeBitOffset = 0;
-    slice->bReservedBits       = 0;
-    /* XXX We store the index of the first MB and it will be fixed later */
-    slice->wNumberMBsInSlice   = (s->mb_y >> is_field) * s->mb_width + s->mb_x;
-    slice->wBadSliceChopping   = 0;
-
-    init_get_bits(&gb, &buffer[4], 8 * (size - 4));
-
-    slice->wQuantizerScaleCode = get_bits(&gb, 5);
-    while (get_bits1(&gb))
-        skip_bits(&gb, 8);
-
-    slice->wMBbitOffset        = 4 * 8 + get_bits_count(&gb);
-}
-static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
-                                             DXVA2_DecodeBufferDesc *bs,
-                                             DXVA2_DecodeBufferDesc *sc)
-{
-    const struct MpegEncContext *s = avctx->priv_data;
-    struct dxva_context *ctx = avctx->hwaccel_context;
-    struct dxva2_picture_context *ctx_pic =
-        s->current_picture_ptr->hwaccel_picture_private;
-    const int is_field = s->picture_structure != PICT_FRAME;
-    const unsigned mb_count = s->mb_width * (s->mb_height >> is_field);
-    uint8_t  *dxva_data, *current, *end;
-    unsigned dxva_size;
-    unsigned i;
-
-    if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->decoder,
-                                              DXVA2_BitStreamDateBufferType,
-                                              &dxva_data, &dxva_size)))
-        return -1;
-    current = dxva_data;
-    end = dxva_data + dxva_size;
-
-    for (i = 0; i < ctx_pic->slice_count; i++) {
-        DXVA_SliceInfo *slice = &ctx_pic->slice[i];
-        unsigned position = slice->dwSliceDataLocation;
-        unsigned size     = slice->dwSliceBitsInBuffer / 8;
-        if (size > end - current) {
-            av_log(avctx, AV_LOG_ERROR, "Failed to build bitstream");
-            break;
-        }
-        slice->dwSliceDataLocation = current - dxva_data;
-
-        if (i < ctx_pic->slice_count - 1)
-            slice->wNumberMBsInSlice =
-                slice[1].wNumberMBsInSlice - slice[0].wNumberMBsInSlice;
-        else
-            slice->wNumberMBsInSlice =
-                mb_count - slice[0].wNumberMBsInSlice;
-
-        memcpy(current, &ctx_pic->bitstream[position], size);
-        current += size;
-    }
-    if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder,
-                                                  DXVA2_BitStreamDateBufferType)))
-        return -1;
-    if (i < ctx_pic->slice_count)
-        return -1;
-
-    memset(bs, 0, sizeof(*bs));
-    bs->CompressedBufferType = DXVA2_BitStreamDateBufferType;
-    bs->DataSize             = current - dxva_data;
-    bs->NumMBsInBuffer       = mb_count;
-
-    return ff_dxva2_commit_buffer(avctx, ctx, sc,
-                                  DXVA2_SliceControlBufferType,
-                                  ctx_pic->slice,
-                                  ctx_pic->slice_count * sizeof(*ctx_pic->slice),
-                                  mb_count);
-}
-
-static int dxva2_mpeg2_start_frame(AVCodecContext *avctx,
-                                   av_unused const uint8_t *buffer,
-                                   av_unused uint32_t size)
-{
-    const struct MpegEncContext *s = avctx->priv_data;
-    struct dxva_context *ctx = avctx->hwaccel_context;
-    struct dxva2_picture_context *ctx_pic =
-        s->current_picture_ptr->hwaccel_picture_private;
-
-    if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0)
-        return -1;
-    assert(ctx_pic);
-
-    fill_picture_parameters(avctx, ctx, s, &ctx_pic->pp);
-    fill_quantization_matrices(avctx, ctx, s, &ctx_pic->qm);
-
-    ctx_pic->slice_count    = 0;
-    ctx_pic->bitstream_size = 0;
-    ctx_pic->bitstream      = NULL;
-    return 0;
-}
-
-static int dxva2_mpeg2_decode_slice(AVCodecContext *avctx,
-                                    const uint8_t *buffer, uint32_t size)
-{
-    const struct MpegEncContext *s = avctx->priv_data;
-    struct dxva2_picture_context *ctx_pic =
-        s->current_picture_ptr->hwaccel_picture_private;
-    unsigned position;
-
-    if (ctx_pic->slice_count >= MAX_SLICES)
-        return -1;
-
-    if (!ctx_pic->bitstream)
-        ctx_pic->bitstream = buffer;
-    ctx_pic->bitstream_size += size;
-
-    position = buffer - ctx_pic->bitstream;
-    fill_slice(avctx, s, &ctx_pic->slice[ctx_pic->slice_count++], position,
-               buffer, size);
-    return 0;
-}
-
-static int dxva2_mpeg2_end_frame(AVCodecContext *avctx)
-{
-    struct MpegEncContext *s = avctx->priv_data;
-    struct dxva2_picture_context *ctx_pic =
-        s->current_picture_ptr->hwaccel_picture_private;
-    int ret;
-
-    if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
-        return -1;
-    ret = ff_dxva2_common_end_frame(avctx, s->current_picture_ptr,
-                                    &ctx_pic->pp, sizeof(ctx_pic->pp),
-                                    &ctx_pic->qm, sizeof(ctx_pic->qm),
-                                    commit_bitstream_and_slice_buffer);
-    if (!ret)
-        ff_mpeg_draw_horiz_band(s, 0, avctx->height);
-    return ret;
-}
-
-AVHWAccel ff_mpeg2_dxva2_hwaccel = {
-    .name           = "mpeg2_dxva2",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG2VIDEO,
-    .pix_fmt        = AV_PIX_FMT_DXVA2_VLD,
-    .start_frame    = dxva2_mpeg2_start_frame,
-    .decode_slice   = dxva2_mpeg2_decode_slice,
-    .end_frame      = dxva2_mpeg2_end_frame,
-    .priv_data_size = sizeof(struct dxva2_picture_context),
-};
diff --git a/deps/libav/libavcodec/dxva2_vc1.c b/deps/libav/libavcodec/dxva2_vc1.c
deleted file mode 100644
index a72d91e..0000000
--- a/deps/libav/libavcodec/dxva2_vc1.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * DXVA2 WMV3/VC-1 HW acceleration.
- *
- * copyright (c) 2010 Laurent Aimar
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "dxva2_internal.h"
-#include "vc1.h"
-#include "vc1data.h"
-
-struct dxva2_picture_context {
-    DXVA_PictureParameters pp;
-    DXVA_SliceInfo         si;
-
-    const uint8_t          *bitstream;
-    unsigned               bitstream_size;
-};
-
-static void fill_picture_parameters(AVCodecContext *avctx,
-                                    struct dxva_context *ctx, const VC1Context *v,
-                                    DXVA_PictureParameters *pp)
-{
-    const MpegEncContext *s = &v->s;
-    const Picture *current_picture = s->current_picture_ptr;
-
-    memset(pp, 0, sizeof(*pp));
-    pp->wDecodedPictureIndex    =
-    pp->wDeblockedPictureIndex  = ff_dxva2_get_surface_index(ctx, current_picture);
-    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type)
-        pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture);
-    else
-        pp->wForwardRefPictureIndex = 0xffff;
-    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type)
-        pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture);
-    else
-        pp->wBackwardRefPictureIndex = 0xffff;
-    if (v->profile == PROFILE_ADVANCED) {
-        /* It is the cropped width/height -1 of the frame */
-        pp->wPicWidthInMBminus1 = avctx->width  - 1;
-        pp->wPicHeightInMBminus1= avctx->height - 1;
-    } else {
-        /* It is the coded width/height in macroblock -1 of the frame */
-        pp->wPicWidthInMBminus1 = s->mb_width  - 1;
-        pp->wPicHeightInMBminus1= s->mb_height - 1;
-    }
-    pp->bMacroblockWidthMinus1  = 15;
-    pp->bMacroblockHeightMinus1 = 15;
-    pp->bBlockWidthMinus1       = 7;
-    pp->bBlockHeightMinus1      = 7;
-    pp->bBPPminus1              = 7;
-    if (s->picture_structure & PICT_TOP_FIELD)
-        pp->bPicStructure      |= 0x01;
-    if (s->picture_structure & PICT_BOTTOM_FIELD)
-        pp->bPicStructure      |= 0x02;
-    pp->bSecondField            = v->interlace && v->fcm != ILACE_FIELD && !s->first_field;
-    pp->bPicIntra               = s->pict_type == AV_PICTURE_TYPE_I || v->bi_type;
-    pp->bPicBackwardPrediction  = s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type;
-    pp->bBidirectionalAveragingMode = (1                                           << 7) |
-                                      ((ctx->cfg->ConfigIntraResidUnsigned != 0)   << 6) |
-                                      ((ctx->cfg->ConfigResidDiffAccelerator != 0) << 5) |
-                                      ((v->lumscale != 32 || v->lumshift != 0)     << 4) |
-                                      ((v->profile == PROFILE_ADVANCED)            << 3);
-    pp->bMVprecisionAndChromaRelation = ((v->mv_mode == MV_PMODE_1MV_HPEL_BILIN) << 3) |
-                                        (1                                       << 2) |
-                                        (0                                       << 1) |
-                                        (!s->quarter_sample                          );
-    pp->bChromaFormat           = v->chromaformat;
-    ctx->report_id++;
-    if (ctx->report_id >= (1 << 16))
-        ctx->report_id = 1;
-    pp->bPicScanFixed           = ctx->report_id >> 8;
-    pp->bPicScanMethod          = ctx->report_id & 0xff;
-    pp->bPicReadbackRequests    = 0;
-    pp->bRcontrol               = v->rnd;
-    pp->bPicSpatialResid8       = (v->panscanflag  << 7) |
-                                  (v->refdist_flag << 6) |
-                                  (s->loop_filter  << 5) |
-                                  (v->fastuvmc     << 4) |
-                                  (v->extended_mv  << 3) |
-                                  (v->dquant       << 1) |
-                                  (v->vstransform      );
-    pp->bPicOverflowBlocks      = (v->quantizer_mode << 6) |
-                                  (v->multires       << 5) |
-                                  (v->resync_marker  << 4) |
-                                  (v->rangered       << 3) |
-                                  (s->max_b_frames       );
-    pp->bPicExtrapolation       = (!v->interlace || v->fcm == PROGRESSIVE) ? 1 : 2;
-    pp->bPicDeblocked           = ((!pp->bPicBackwardPrediction && v->overlap)        << 6) |
-                                  ((v->profile != PROFILE_ADVANCED && v->rangeredfrm) << 5) |
-                                  (s->loop_filter                                     << 1);
-    pp->bPicDeblockConfined     = (v->postprocflag             << 7) |
-                                  (v->broadcast                << 6) |
-                                  (v->interlace                << 5) |
-                                  (v->tfcntrflag               << 4) |
-                                  (v->finterpflag              << 3) |
-                                  ((s->pict_type != AV_PICTURE_TYPE_B) << 2) |
-                                  (v->psf                      << 1) |
-                                  (v->extended_dmv                 );
-    if (s->pict_type != AV_PICTURE_TYPE_I)
-        pp->bPic4MVallowed      = v->mv_mode == MV_PMODE_MIXED_MV ||
-                                  (v->mv_mode == MV_PMODE_INTENSITY_COMP &&
-                                   v->mv_mode2 == MV_PMODE_MIXED_MV);
-    if (v->profile == PROFILE_ADVANCED)
-        pp->bPicOBMC            = (v->range_mapy_flag  << 7) |
-                                  (v->range_mapy       << 4) |
-                                  (v->range_mapuv_flag << 3) |
-                                  (v->range_mapuv          );
-    pp->bPicBinPB               = 0;
-    pp->bMV_RPS                 = 0;
-    pp->bReservedBits           = 0;
-    if (s->picture_structure == PICT_FRAME) {
-        pp->wBitstreamFcodes        = v->lumscale;
-        pp->wBitstreamPCEelements   = v->lumshift;
-    } else {
-        /* Syntax: (top_field_param << 8) | bottom_field_param */
-        pp->wBitstreamFcodes        = (v->lumscale << 8) | v->lumscale;
-        pp->wBitstreamPCEelements   = (v->lumshift << 8) | v->lumshift;
-    }
-    pp->bBitstreamConcealmentNeed   = 0;
-    pp->bBitstreamConcealmentMethod = 0;
-}
-
-static void fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice,
-                       unsigned position, unsigned size)
-{
-    const VC1Context *v = avctx->priv_data;
-    const MpegEncContext *s = &v->s;
-
-    memset(slice, 0, sizeof(*slice));
-    slice->wHorizontalPosition = 0;
-    slice->wVerticalPosition   = s->mb_y;
-    slice->dwSliceBitsInBuffer = 8 * size;
-    slice->dwSliceDataLocation = position;
-    slice->bStartCodeBitOffset = 0;
-    slice->bReservedBits       = 0;
-    slice->wMBbitOffset        = get_bits_count(&s->gb);
-    slice->wNumberMBsInSlice   = s->mb_width * s->mb_height; /* XXX We assume 1 slice */
-    slice->wQuantizerScaleCode = v->pq;
-    slice->wBadSliceChopping   = 0;
-}
-
-static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
-                                             DXVA2_DecodeBufferDesc *bs,
-                                             DXVA2_DecodeBufferDesc *sc)
-{
-    const VC1Context *v = avctx->priv_data;
-    struct dxva_context *ctx = avctx->hwaccel_context;
-    const MpegEncContext *s = &v->s;
-    struct dxva2_picture_context *ctx_pic = s->current_picture_ptr->hwaccel_picture_private;
-
-    DXVA_SliceInfo *slice = &ctx_pic->si;
-
-    static const uint8_t start_code[] = { 0, 0, 1, 0x0d };
-    const unsigned start_code_size = avctx->codec_id == AV_CODEC_ID_VC1 ? sizeof(start_code) : 0;
-    const unsigned slice_size = slice->dwSliceBitsInBuffer / 8;
-    const unsigned padding = 128 - ((start_code_size + slice_size) & 127);
-    const unsigned data_size = start_code_size + slice_size + padding;
-
-    uint8_t  *dxva_data;
-    unsigned dxva_size;
-    int result;
-
-    if (FAILED(IDirectXVideoDecoder_GetBuffer(ctx->decoder,
-                                              DXVA2_BitStreamDateBufferType,
-                                              &dxva_data, &dxva_size)))
-        return -1;
-
-    result = data_size <= dxva_size ? 0 : -1;
-    if (!result) {
-        if (start_code_size > 0)
-            memcpy(dxva_data, start_code, start_code_size);
-        memcpy(dxva_data + start_code_size,
-               ctx_pic->bitstream + slice->dwSliceDataLocation, slice_size);
-        if (padding > 0)
-            memset(dxva_data + start_code_size + slice_size, 0, padding);
-        slice->dwSliceBitsInBuffer = 8 * data_size;
-    }
-    if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder,
-                                                  DXVA2_BitStreamDateBufferType)))
-        return -1;
-    if (result)
-        return result;
-
-    memset(bs, 0, sizeof(*bs));
-    bs->CompressedBufferType = DXVA2_BitStreamDateBufferType;
-    bs->DataSize             = data_size;
-    bs->NumMBsInBuffer       = s->mb_width * s->mb_height;
-    assert((bs->DataSize & 127) == 0);
-
-    return ff_dxva2_commit_buffer(avctx, ctx, sc,
-                                  DXVA2_SliceControlBufferType,
-                                  slice, sizeof(*slice), bs->NumMBsInBuffer);
-}
-
-static int dxva2_vc1_start_frame(AVCodecContext *avctx,
-                                 av_unused const uint8_t *buffer,
-                                 av_unused uint32_t size)
-{
-    const VC1Context *v = avctx->priv_data;
-    struct dxva_context *ctx = avctx->hwaccel_context;
-    struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private;
-
-    if (!ctx->decoder || !ctx->cfg || ctx->surface_count <= 0)
-        return -1;
-    assert(ctx_pic);
-
-    fill_picture_parameters(avctx, ctx, v, &ctx_pic->pp);
-
-    ctx_pic->bitstream_size = 0;
-    ctx_pic->bitstream      = NULL;
-    return 0;
-}
-
-static int dxva2_vc1_decode_slice(AVCodecContext *avctx,
-                                  const uint8_t *buffer,
-                                  uint32_t size)
-{
-    const VC1Context *v = avctx->priv_data;
-    const Picture *current_picture = v->s.current_picture_ptr;
-    struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
-
-    if (ctx_pic->bitstream_size > 0)
-        return -1;
-
-    if (avctx->codec_id == AV_CODEC_ID_VC1 &&
-        size >= 4 && IS_MARKER(AV_RB32(buffer))) {
-        buffer += 4;
-        size   -= 4;
-    }
-
-    ctx_pic->bitstream_size = size;
-    ctx_pic->bitstream      = buffer;
-
-    fill_slice(avctx, &ctx_pic->si, 0, size);
-    return 0;
-}
-
-static int dxva2_vc1_end_frame(AVCodecContext *avctx)
-{
-    VC1Context *v = avctx->priv_data;
-    struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private;
-    int ret;
-
-    if (ctx_pic->bitstream_size <= 0)
-        return -1;
-
-    ret = ff_dxva2_common_end_frame(avctx, v->s.current_picture_ptr,
-                                    &ctx_pic->pp, sizeof(ctx_pic->pp),
-                                    NULL, 0,
-                                    commit_bitstream_and_slice_buffer);
-    if (!ret)
-        ff_mpeg_draw_horiz_band(&v->s, 0, avctx->height);
-    return ret;
-}
-
-#if CONFIG_WMV3_DXVA2_HWACCEL
-AVHWAccel ff_wmv3_dxva2_hwaccel = {
-    .name           = "wmv3_dxva2",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WMV3,
-    .pix_fmt        = AV_PIX_FMT_DXVA2_VLD,
-    .start_frame    = dxva2_vc1_start_frame,
-    .decode_slice   = dxva2_vc1_decode_slice,
-    .end_frame      = dxva2_vc1_end_frame,
-    .priv_data_size = sizeof(struct dxva2_picture_context),
-};
-#endif
-
-AVHWAccel ff_vc1_dxva2_hwaccel = {
-    .name           = "vc1_dxva2",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VC1,
-    .pix_fmt        = AV_PIX_FMT_DXVA2_VLD,
-    .start_frame    = dxva2_vc1_start_frame,
-    .decode_slice   = dxva2_vc1_decode_slice,
-    .end_frame      = dxva2_vc1_end_frame,
-    .priv_data_size = sizeof(struct dxva2_picture_context),
-};
diff --git a/deps/libav/libavcodec/eac3_data.c b/deps/libav/libavcodec/eac3_data.c
deleted file mode 100644
index b0416f3..0000000
--- a/deps/libav/libavcodec/eac3_data.c
+++ /dev/null
@@ -1,1134 +0,0 @@
-/*
- * E-AC-3 tables
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Tables taken directly from the E-AC-3 spec.
- */
-
-#include "eac3_data.h"
-#include "ac3.h"
-
-const uint8_t ff_eac3_bits_vs_hebap[20] = {
-    0,  2,  3,  4,  5,  7,  8,  9,  3,  4,
-    5,  6,  7,  8,  9, 10, 11, 12, 14, 16,
-};
-
-/**
- * Table E3.6, Gk=1
- * No gain (Gk=1) inverse quantization, remapping scale factors
- * ff_eac3_gaq_remap[hebap+8]
- */
-const int16_t ff_eac3_gaq_remap_1[12] = {
-    4681, 2185, 1057, 520, 258, 129, 64, 32, 16, 8, 2, 0
-};
-
-/**
- * Table E3.6, Gk=2 & Gk=4, A
- * Large mantissa inverse quantization, remapping scale factors
- * ff_eac3_gaq_remap_2_4_a[hebap-8][Gk=2,4]
- */
-const int16_t ff_eac3_gaq_remap_2_4_a[9][2] = {
-    { -10923, -4681 },
-    { -14043, -6554 },
-    { -15292, -7399 },
-    { -15855, -7802 },
-    { -16124, -7998 },
-    { -16255, -8096 },
-    { -16320, -8144 },
-    { -16352, -8168 },
-    { -16368, -8180 }
-};
-
-/**
- * Table E3.6, Gk=2 & Gk=4, B
- * Large mantissa inverse quantization, negative mantissa remapping offsets
- * ff_eac3_gaq_remap_3_4_b[hebap-8][Gk=2,4]
- */
-const int16_t ff_eac3_gaq_remap_2_4_b[9][2] = {
-    {  -5461, -1170 },
-    { -11703, -4915 },
-    { -14199, -6606 },
-    { -15327, -7412 },
-    { -15864, -7805 },
-    { -16126, -7999 },
-    { -16255, -8096 },
-    { -16320, -8144 },
-    { -16352, -8168 }
-};
-
-static const int16_t vq_hebap1[4][6] = {
-{   7167,    4739,    1106,    4269,   10412,    4820},
-{  -5702,   -3187,  -14483,   -1392,   -2027,     849},
-{    633,    6199,    7009,  -12779,   -2306,   -2636},
-{  -1468,   -7031,    7592,   10617,   -5946,   -3062},
-};
-static const int16_t vq_hebap2[8][6] = {
-{ -12073,     608,   -7019,     590,    4000,     869},
-{   6692,   15689,   -6178,   -9239,     -74,     133},
-{   1855,    -989,   20596,   -2920,   -4475,     225},
-{  -1194,   -3901,    -821,   -6566,    -875,  -20298},
-{  -2762,   -3181,   -4094,   -5623,  -16945,    9765},
-{   1547,    6839,    1980,   20233,   -1071,   -4986},
-{   6221,  -17915,   -5516,    6266,     358,    1162},
-{   3753,   -1066,    4283,   -3227,   15928,   10186},
-};
-static const int16_t vq_hebap3[16][6] = {
-{ -10028,   20779,   10982,   -4560,     798,     -68},
-{  11050,   20490,   -6617,   -5342,   -1797,   -1631},
-{   3977,    -542,    7118,   -1166,   18844,   14678},
-{  -4320,     -96,   -7295,    -492,  -22050,   -4277},
-{   2692,    5856,    5530,   21862,   -7212,   -5325},
-{   -135,  -23391,     962,    8115,    -644,     382},
-{  -1563,    3400,   -3299,    4693,   -6892,   22398},
-{   3535,    3030,    7296,    6214,   20476,  -12099},
-{     57,   -6823,    1848,  -22349,   -5919,    6823},
-{   -821,   -3655,    -387,   -6253,   -1735,  -22373},
-{  -6046,    1586,  -18890,  -14392,    9214,     705},
-{  -5716,     264,  -17964,   14618,    7921,    -337},
-{   -110,     108,       8,      74,     -89,     -50},
-{   6612,   -1517,   21687,   -1658,   -7949,    -246},
-{  21667,   -6335,   -8290,    -101,   -1349,     -22},
-{ -22003,   -6476,    7974,     648,    2054,    -331},
-};
-static const int16_t vq_hebap4[32][6] = {
-{   6636,   -4593,   14173,  -17297,  -16523,     864},
-{   3658,   22540,     104,   -1763,     -84,       6},
-{  21580,  -17815,   -7282,   -1575,   -2078,    -320},
-{  -2233,   10017,   -2728,   14938,  -13640,  -17659},
-{  -1564,  -17738,  -19161,   13735,    2757,    2951},
-{   4520,    5510,    7393,   10799,   19231,  -13770},
-{    399,    2976,   -1099,    5013,   -1159,   22095},
-{   3624,   -2359,    4680,   -2238,   22702,    3765},
-{  -4201,   -8285,   -6810,  -12390,  -18414,   15382},
-{  -5198,   -6869,  -10047,   -8364,  -16022,  -20562},
-{   -142,  -22671,    -368,    4391,    -464,     -13},
-{    814,   -1118,   -1089,  -22019,      74,    1553},
-{  -1618,   19222,  -17642,  -13490,     842,   -2309},
-{   4689,   16490,   20813,  -15387,   -4164,   -3968},
-{  -3308,   11214,  -13542,   13599,  -19473,   13770},
-{   1817,     854,   21225,    -966,   -1643,    -268},
-{  -2587,    -107,  -20154,     376,    1174,    -304},
-{  -2919,     453,   -5390,     750,  -22034,    -978},
-{ -19012,   16839,   10000,   -3580,    2211,    1459},
-{   1363,   -2658,     -33,   -4067,    1165,  -21985},
-{  -8592,   -2760,  -17520,  -15985,   14897,    1323},
-{    652,   -9331,    3253,  -14622,   12181,   19692},
-{  -6361,    5773,  -15395,   17291,   16590,   -2922},
-{   -661,    -601,    1609,   22610,     992,   -1045},
-{   4961,    9107,   11225,    7829,   16320,   18627},
-{ -21872,   -1433,     138,    1470,   -1891,    -196},
-{ -19499,  -18203,   11056,    -516,    2543,   -2249},
-{  -1196,  -17574,   20150,   11462,    -401,    2619},
-{   4638,   -8154,   11891,  -15759,   17615,  -14955},
-{    -83,     278,     323,      55,    -154,     232},
-{   7788,    1462,   18395,   15296,  -15763,   -1131},
-};
-static const int16_t vq_hebap5[128][6] = {
-{  -3394,  -19730,    2963,    9590,    4660,   19673},
-{ -15665,   -6405,   17671,    3860,   -8232,  -19429},
-{   4467,     412,  -17873,   -8037,     691,  -17307},
-{   3580,    2363,    6886,    3763,    6379,  -20522},
-{ -17230,  -14133,   -1396,  -23939,    8373,  -12537},
-{  -8073,  -21469,  -15638,    3214,    8105,   -5965},
-{   4343,    5169,    2683,  -16822,   -5146,  -16558},
-{   6348,  -10668,   12995,  -25500,  -22090,    4091},
-{  -2880,   -8366,   -5968,  -17158,   -2638,   23132},
-{  -5095,  -14281,  -22371,   21741,    3689,    2961},
-{  -2443,  -17739,   25155,    2707,    1594,       7},
-{ -18379,    9010,    4270,     731,    -426,    -640},
-{ -23695,   24732,    5642,     612,    -308,    -964},
-{   -767,    1268,     225,    1635,     173,     916},
-{   5455,    6493,    4902,   10560,   23041,  -17140},
-{  17219,  -21054,  -18716,    4936,   -3420,    3357},
-{  -1390,   15488,  -21946,  -14611,    1339,     542},
-{  -6866,   -2254,  -12070,   -3075,  -19981,  -20622},
-{  -1803,   11775,    1343,    8917,     693,   24497},
-{ -21610,    9462,    4681,    9254,   -7815,   15904},
-{  -5559,   -3018,   -9169,   -1347,  -22547,   12868},
-{   -366,    5076,   -1727,   20427,    -283,   -2923},
-{  -1886,   -6313,    -939,   -2081,   -1399,    3513},
-{  -3161,    -537,   -5075,   11268,   19396,     989},
-{   2345,    4153,    5769,   -4273,     233,    -399},
-{ -21894,   -1138,  -16474,    5902,    5488,   -3211},
-{  10007,  -12530,   18829,   20932,   -1158,    1790},
-{  -1165,    5014,   -1199,    6415,   -8418,  -21038},
-{   1892,   -3534,    3815,   -5846,   16427,   20288},
-{  -2664,  -11627,   -4147,  -18311,  -22710,   14848},
-{  17256,   10419,    7764,   12040,   18956,    2525},
-{ -21419,  -18685,  -10897,    4368,   -7051,    4539},
-{  -1574,    2050,    5760,   24756,   15983,   17678},
-{   -538,  -22867,   11067,   10301,     385,     528},
-{  -8465,   -3025,  -16357,  -23237,   16491,    3654},
-{   5840,     575,   11890,    1947,   25157,    6653},
-{   6625,   -3516,   -1964,    3850,    -390,    -116},
-{  18005,   20900,   14323,   -7621,  -10922,   11802},
-{  -4857,   -2932,  -13334,   -7815,   21622,    2267},
-{   -579,   -9431,    -748,  -21321,   12367,    8265},
-{  -8317,    1375,  -17847,    2921,    9062,   22046},
-{  18398,    8635,   -1503,   -2418,  -18295,  -14734},
-{  -2987,   15129,   -3331,   22300,   13878,  -13639},
-{   5874,  -19026,   15587,   11350,  -20738,    1971},
-{   1581,   -6955,  -21440,    2455,      65,     414},
-{    515,   -4468,    -665,   -4672,     125,  -19222},
-{  21495,  -20301,   -1872,   -1926,    -211,   -1022},
-{   5189,  -12250,   -1775,  -23550,   -4546,    5813},
-{    321,   -6331,   14646,    6975,   -1773,     867},
-{ -13814,    3180,    7927,     444,   19552,    3146},
-{  -6660,   12252,   -1972,   17408,  -24280,  -12956},
-{   -745,   14356,   -1107,   23742,   -9631,  -18344},
-{  18284,   -7909,   -7531,   19118,    7721,  -12659},
-{   1926,   15101,  -12848,    2153,   21631,    1864},
-{  -2130,   23416,   17056,  -15597,   -1544,      87},
-{   8314,  -11824,   14581,  -20591,    7891,   -2099},
-{  19600,   22814,  -17304,   -2040,     285,   -3863},
-{  -8214,  -18322,   10724,  -13744,  -13469,   -1666},
-{  14351,    4880,  -20034,     964,   -4221,    -180},
-{ -24598,  -16635,   19724,    5925,    4777,    4414},
-{  -2495,   23493,  -16141,    2918,   -1038,   -2010},
-{  18974,   -2540,   13343,    1405,   -6194,   -1136},
-{   2489,   13670,   22638,   -7311,    -129,   -2792},
-{ -13962,   16775,   23012,     728,    3397,     162},
-{   3038,     993,    8774,  -21969,   -6609,     910},
-{ -12444,  -22386,   -2626,   -5295,   19520,    9872},
-{  -1911,  -18274,  -18506,  -14962,    4760,    7119},
-{   8298,   -2978,   25886,    7660,   -7897,    1020},
-{   6132,   15127,   18757,  -24370,   -6529,   -6627},
-{   7924,   12125,   -9459,  -23962,    5502,     937},
-{ -17056,   -5373,    2522,     327,    1129,    -390},
-{  15774,   19955,  -10380,   11172,   -3107,   14853},
-{ -11904,   -8091,  -17928,  -22287,  -17237,   -6803},
-{ -12862,   -2172,   -6509,    5927,   12458,  -22355},
-{   -497,     322,    1038,   -6643,   -5404,   20311},
-{   1083,  -22984,   -8494,   12130,    -762,    2623},
-{   5067,   19712,   -1901,     -30,    -325,      85},
-{    987,   -5830,    4212,   -9030,    9121,  -25038},
-{  -7868,    7284,  -12292,   12914,  -21592,   20941},
-{  -1630,   -7694,   -2187,   -8525,   -5604,  -25196},
-{  -6668,     388,  -22535,    1526,    9082,     193},
-{  -7867,  -22308,    5163,     362,     944,    -259},
-{   3824,  -11850,    7591,  -23176,   25342,   23771},
-{ -10504,    4123,  -21111,   21173,   22439,    -838},
-{  -4723,   21795,    6184,    -122,    1642,    -717},
-{  24504,   19887,   -2043,     986,       7,     -55},
-{ -27313,    -135,    2437,     259,      89,     307},
-{  24446,   -3873,   -5391,    -820,   -2387,     361},
-{   5529,    5784,   18682,     242,  -21896,   -4003},
-{  22304,    4483,     722,  -12242,    7570,   15448},
-{   8673,    3009,   20437,   21108,  -21100,   -3080},
-{  -1132,    2705,   -1825,    5420,    -785,   18532},
-{  16932,  -13517,  -16509,  -14858,  -20327,  -14221},
-{   2219,    1380,   21474,   -1128,     327,      83},
-{  -2177,   21517,   -3856,  -14180,    -204,   -2191},
-{    953,   -9426,   15874,  -10710,   -3231,   21030},
-{   -421,   -1377,     640,   -8239,  -20976,    2174},
-{   4309,   18514,   -9100,  -18319,  -15518,    3704},
-{  -5943,     449,   -8387,    1075,  -22210,   -4992},
-{   2953,   12788,   18285,    1430,   14937,   21731},
-{  -2913,     401,   -4739,  -20105,    1699,   -1147},
-{   3449,    5241,    8853,   22134,   -7547,    1451},
-{  -2154,    8584,   18120,  -15614,   19319,   -5991},
-{   3501,    2841,    5897,    6397,    8630,   23018},
-{   2467,    2956,     379,    5703,  -22047,   -2189},
-{ -16963,    -594,   18822,   -5295,    1640,     774},
-{   2896,   -1424,    3586,   -2292,   19910,   -1822},
-{ -18575,   21219,  -14001,  -12573,   16466,     635},
-{  -1998,  -19314,  -16527,   12208,  -16576,   -7854},
-{  -9674,    1012,  -21645,    2883,  -12712,    2321},
-{  -1005,     471,   -3629,    8045,  -11087,   25533},
-{   4141,  -21472,   -2673,     756,    -663,    -523},
-{   6490,    8531,   19289,   18949,    6092,   -9347},
-{  16965,   24599,   14024,   10072,    -536,  -10438},
-{  -8147,    2145,  -23028,  -17073,    5451,   -4401},
-{ -14873,   20520,  -18303,   -9717,  -11885,  -17831},
-{  -2290,  -14120,    2070,   22467,    1671,     725},
-{  -8538,   14629,    3521,  -20577,    6673,    8200},
-{  20248,    4410,   -1366,    -585,    1229,   -2449},
-{   7467,   -7148,   13667,   -8246,   22392,  -17320},
-{  -1932,    3875,   -9064,   -3812,     958,     265},
-{  -4399,    2959,  -15911,   19598,    4954,   -1105},
-{  18009,   -9923,  -18137,   -3862,   11178,    5821},
-{ -14596,   -1227,    9660,   21619,   11228,  -11721},
-{   -721,   -1700,     109,   -2142,      61,   -6772},
-{ -24619,  -22520,    5608,   -1957,   -1761,   -1012},
-{ -23728,   -4451,   -2688,  -14679,   -4266,    9919},
-{   8495,    -894,   20438,  -13820,  -17267,     139},
-};
-static const int16_t vq_hebap6[256][6] = {
-{  10154,    7365,   16861,   18681,  -22893,   -3636},
-{  -2619,   -3788,   -5529,   -5192,   -9009,  -20298},
-{  -5583,  -22800,   21297,    7012,     745,     720},
-{    428,   -1459,     109,   -3082,     361,   -8403},
-{   8161,   22401,     241,    1755,    -874,   -2824},
-{   1140,   12643,    2306,   22263,  -25146,  -17557},
-{  -2609,    3379,   10337,  -19730,  -15468,  -23944},
-{  -4040,  -12796,  -25772,   13096,    3905,    1315},
-{   4624,  -23799,   13608,   25317,   -1175,    2173},
-{    -97,   13747,   -5122,   23255,    4214,  -22145},
-{   6878,    -322,   18264,    -854,  -11916,    -733},
-{  17280,  -12669,   -9693,   23563,  -16240,   -1309},
-{   5802,   -4968,   19526,  -21194,  -24622,    -183},
-{   5851,  -16137,   15229,   -9496,   -1538,     377},
-{  14096,   25057,   13419,    8290,   23320,   16818},
-{  -7261,     118,  -15867,   19097,    9781,    -277},
-{  -4288,   21589,  -13288,  -16259,   16633,   -4862},
-{   4909,  -19217,   23411,   14705,    -722,     125},
-{  19462,   -4732,   -1928,  -11527,   20770,    5425},
-{ -27562,   -2881,   -4331,     384,   -2103,    1367},
-{   -266,   -9175,    5441,   26333,   -1924,    4221},
-{  -2970,  -20170,  -21816,    5450,   -7426,    5344},
-{   -221,   -6696,     603,   -9140,    1308,  -27506},
-{   9621,   -8380,   -1967,    9403,   -1651,   22817},
-{   7566,   -5250,   -4165,    1385,    -990,     560},
-{  -1262,   24738,  -19057,   10741,    7585,   -7098},
-{    451,   20130,   -9949,   -6015,   -2188,   -1458},
-{  22249,    9380,    9096,   10959,   -2365,   -3724},
-{  18668,    -650,   -1234,   11092,    7678,    5969},
-{  19207,   -1485,   -1076,    -731,    -684,      43},
-{  -4973,   13430,   20139,      60,     476,    -935},
-{ -20029,    8710,    2499,    1016,   -1158,     335},
-{ -26413,   18598,   -2201,    -669,    3409,     793},
-{  -4726,    8875,  -24607,   -9646,    3643,    -283},
-{  13303,  -21404,   -3691,   -1184,   -1970,    1612},
-{    173,      60,     919,    1229,    6942,    -665},
-{  16377,   16991,    5341,  -14015,   -2304,  -20390},
-{  25334,  -10609,   11947,   -7653,   -6363,   14058},
-{  23929,  -13259,   -7226,    -937,     234,    -187},
-{   6311,   -1877,   12506,   -1879,   18751,  -23341},
-{    621,    6445,    3354,  -24274,    8406,    5315},
-{  -3297,   -5034,   -4704,   -5080,  -25730,    5347},
-{  -1275,  -13295,    -965,  -23318,    1214,   26259},
-{  -6252,   10035,  -20105,   15301,  -16073,    5136},
-{   9562,   -3911,  -19510,    4745,   22270,   -4171},
-{   7978,  -19600,   14024,   -5745,  -20855,    8939},
-{      7,   -4039,     991,   -6065,      52,  -19423},
-{   3485,    2969,    7732,    7786,   25312,    6206},
-{   -959,  -12812,   -1840,  -22743,    7324,   10830},
-{  -4686,    1678,  -10172,   -5205,    4294,   -1271},
-{   3889,    1302,    7450,     638,   20374,   -3133},
-{ -12496,   -9123,   18463,  -12343,   -7238,   18552},
-{  -6185,    8649,   -6903,    -895,   17109,   16604},
-{  -9896,   28579,    2845,    1640,    2925,    -298},
-{  14968,  -25988,   14878,  -24012,    1815,   -6474},
-{  26107,    5166,   21225,   15873,   21617,   14825},
-{ -21684,   16438,   20504,  -14346,   -7114,   -4162},
-{  28647,      90,   -1572,     789,    -902,     -75},
-{  -1479,    2471,   -4061,    3612,   -2240,   10914},
-{   8616,   17491,   17255,  -17456,   17022,  -16357},
-{ -20722,  -18597,   25274,   17720,   -3573,    1695},
-{   -997,    6129,   -6303,   11250,  -11359,  -19739},
-{    -74,   -4001,   -1584,   13384,     162,    -144},
-{   -529,   21068,    7923,  -11396,     422,     -26},
-{   7102,  -13531,  -20055,    2629,    -178,    -429},
-{   9201,    1368,  -22238,    2623,  -20499,   24889},
-{   -432,    6675,    -266,    8723,      80,   28024},
-{  19493,   -3108,   -9261,    1910,  -21777,    5345},
-{  14079,  -11489,   12604,    6079,   19877,    1315},
-{  10947,    9837,  -18612,   15742,    4792,     605},
-{  -1777,    3758,   -4087,   21696,    6024,    -576},
-{   3567,   -3578,   16379,    2680,   -1752,     716},
-{  -5049,   -1399,   -4550,    -652,  -17721,   -3366},
-{  -3635,   -4372,   -6522,  -22152,    7382,    1458},
-{  12242,   19190,    5646,   -7815,  -20289,   21344},
-{  -7508,   19952,   23542,   -9753,    5669,   -1990},
-{  -2275,   15438,   10907,  -17879,    6497,   13582},
-{ -15894,  -15646,   -4716,    6019,   24250,   -6179},
-{  -2049,   -6856,   -1208,     918,   17735,     -69},
-{  -3721,    9099,  -16065,  -23621,    5981,   -2344},
-{   7862,   -8918,   24033,   25508,  -11033,    -741},
-{ -12588,   19468,   14649,   15451,  -21226,    1171},
-{   2102,    1147,    2789,    4096,    2179,    8750},
-{ -18214,  -17758,  -10366,   -5203,   -1066,   -3541},
-{  -2819,  -19958,  -11921,    6032,    8315,   10374},
-{  -9078,   -2100,   19431,     -17,     732,    -689},
-{ -14512,  -19224,   -7095,   18727,    1870,   22906},
-{   3912,     659,   25597,   -4006,    9619,     877},
-{   2616,   22695,   -5770,   17920,    3812,   20220},
-{   2561,   26847,   -5245,  -10908,    2256,    -517},
-{  -4974,     198,  -21983,   -3608,   22174,  -18924},
-{  21308,   -1211,   19144,   16691,   -1588,   11390},
-{  -1790,    3959,   -3488,    7003,   -7107,   20877},
-{  -6108,  -17955,  -18722,   24763,   16508,    3211},
-{  20462,  -24987,  -20361,    4484,   -5111,    -478},
-{  -6378,   -1998,  -10229,    -561,  -22039,  -22339},
-{   3047,  -18850,    7586,   14743,  -19862,    6351},
-{  -5047,    1405,   -9672,    1055,  -21881,   11170},
-{   3481,   -9699,    6526,  -16655,   22813,   21907},
-{ -18570,   17501,   14664,    1291,    5026,   19676},
-{  16134,  -19810,  -16956,  -17939,  -16933,    5800},
-{  -8224,    4908,    8935,    2272,   -1140,  -23217},
-{   1572,    2753,   -1598,    2143,   -3346,  -21926},
-{  -9832,   -1060,  -27818,    1214,    7289,     150},
-{     98,    1538,     535,   17429,  -23198,    -901},
-{  21340,  -20146,    3297,   -1744,   -8207,  -21462},
-{  -4166,   -4633,  -17902,    5478,    1285,     136},
-{  18713,   21003,   24818,   11421,    1282,   -4618},
-{  -3535,    7636,    -265,    2141,    -829,   -2035},
-{  -3184,   19713,    2775,      -2,    1090,     104},
-{  -6771,  -20185,    2938,   -2125,     -36,    1268},
-{   9560,    9430,    9586,   22100,   13827,    6296},
-{   -535,  -20018,    4276,   -1868,    -448,  -17183},
-{ -24352,   14244,  -13647,  -21040,    2271,   11555},
-{  -2646,   15437,   -4589,   18638,   -4299,    -622},
-{ -20064,    4169,   18115,   -1404,   13722,   -1825},
-{ -16359,    9080,     744,   22021,     125,   10794},
-{   9644,  -14607,  -18479,  -14714,   11174,  -20754},
-{   -326,  -23762,    6144,    7909,     602,    1540},
-{  -6650,    6634,  -12683,   21396,   20785,   -6839},
-{   4252,  -21043,    5628,   18687,   23860,    8328},
-{  17986,    5704,   -5245,  -18093,    -555,    3219},
-{   6091,   14232,   -5117,  -17456,  -19452,  -11649},
-{ -21586,   11302,   15434,   25590,    6777,  -26683},
-{  21355,   -8244,    5877,   -3540,    6079,   -2567},
-{   2603,   -2455,    5421,  -12286,  -19100,    5574},
-{  -1721,  -26393,  -23664,   22904,    -349,    3787},
-{   2189,   -1203,    5340,    3249,  -22617,     104},
-{  -1664,  -11020,   -2857,  -20723,  -24049,   19900},
-{  22873,   -7345,  -18481,  -14616,   -8400,  -12965},
-{   3777,    3958,    8239,   20494,   -6991,   -1201},
-{   -160,   -1613,    -793,   -8681,     573,     776},
-{   4297,   -3786,   20373,    6082,   -5321,  -18400},
-{  18745,    2463,   12546,   -7749,   -7734,   -2183},
-{  11074,   -4720,   22119,    1825,  -24351,    4080},
-{   1503,  -19178,   -1569,      13,    -313,     375},
-{    318,    -575,    2544,     178,     102,      40},
-{ -15996,  -26897,    5008,    3320,     686,    1159},
-{  25755,   26886,     574,   -5930,   -3916,    1407},
-{  -9148,   -7665,   -2875,   -8384,  -18663,   26400},
-{  -7445,  -18040,  -18396,    8802,   -2252,  -21886},
-{   7851,   11773,   27485,  -12847,   -1410,   19590},
-{   2240,    5947,   11247,   15980,   -6499,   24280},
-{  21673,  -18515,    9771,    6550,   -2730,     334},
-{  -4149,    1576,  -11010,      89,  -24429,   -5710},
-{   7720,    1478,   21412,  -25025,   -8385,       9},
-{  -2448,   10218,  -12756,  -16079,    1161,  -21284},
-{  -8757,  -14429,  -22918,  -14812,    2629,   13844},
-{  -7252,    2843,   -9639,    2882,  -14625,   24497},
-{   -674,   -6530,     414,  -23333,  -21343,     454},
-{   2104,   -6312,   10887,   18087,   -1199,     175},
-{   -493,    -562,   -2739,     118,   -1074,      93},
-{ -10011,   -4075,  -28071,   22180,   15077,    -636},
-{  -4637,  -16408,   -9003,  -20418,  -11608,  -20932},
-{   4815,   15892,   24238,  -13634,   -3074,   -1059},
-{  -6724,    4610,  -18772,  -15283,  -16685,   23988},
-{  15349,    -674,   -3682,   21679,    4475,  -12088},
-{   4756,    2593,    5354,    6001,   15063,   26490},
-{ -23815,  -17251,    6944,     378,     694,     670},
-{  23392,   -8839,  -14713,    7544,    -876,   11088},
-{   3640,    3336,   22593,   -3495,   -2328,    -113},
-{    284,    6914,    3097,   10171,    6638,  -18621},
-{   2472,    5976,   11054,  -11936,    -603,    -663},
-{  16175,   16441,   13164,   -4043,    4667,    7431},
-{  19338,   15534,   -6533,    1681,   -4857,   17048},
-{  17027,     532,  -19064,   -1441,   -5130,    1085},
-{ -12617,  -17609,    2062,  -25332,   19009,  -16121},
-{  10056,  -21000,  -13634,   -2949,   15367,   19934},
-{   -648,   -1605,   10046,   -1592,   13296,   19808},
-{  -1054,   10744,     538,   24938,    9630,   -9052},
-{ -10099,    3042,  -25076,  -24052,   13971,     100},
-{   6547,    6907,    7031,   10348,   23775,  -17886},
-{ -22793,   -1984,   -1393,   -3330,    9267,   14317},
-{ -14346,   -3967,    3042,   16254,  -17303,    9646},
-{ -21393,   23628,   16773,     716,    2663,     114},
-{ -19016,   -3038,    1574,    -245,    1463,    -793},
-{  22410,   23441,  -14637,    -530,   17310,   13617},
-{ -11582,    7935,  -13954,   23465,  -24628,   26550},
-{  -1045,    3679,   -2218,   10572,   20999,   -3702},
-{ -15513,     197,   16718,  -24603,    4945,       5},
-{  10781,    4335,   26790,   -9059,  -16152,   -2840},
-{  16075,  -24100,   -3933,   -6833,   12645,   -7029},
-{   2096,  -25572,   -8370,    6814,      11,    1178},
-{ -11848,    -583,   -8889,  -20543,  -10471,    -380},
-{  -2487,   24777,  -21639,  -19341,    1660,    -732},
-{   2313,   13679,    4085,   24549,   24691,  -21179},
-{  -2366,    -504,   -4130,  -10570,   23668,    1961},
-{  20379,   17809,   -9506,    3733,  -18954,   -6292},
-{  -3856,   16802,    -929,  -20310,  -17739,    6797},
-{  12431,    6078,  -11272,  -14450,    6913,   23476},
-{   7636,   -1655,   23017,   10719,   -8292,     838},
-{  -8559,   -1235,  -18096,    3897,   16093,    1490},
-{  -3586,    8276,   15165,   -3791,  -21149,    1741},
-{  -4497,   21739,    2366,    -278,   -4792,   15549},
-{ -23122,  -13708,    7668,   16232,   24120,   15025},
-{ -20043,   12821,  -20160,   16691,  -11655,  -16081},
-{ -12601,   20239,    3496,   -2549,   -6745,  -11850},
-{   4441,    7812,   20783,   17080,   11523,   -9643},
-{  24766,    8494,  -23298,   -3262,   11101,   -7120},
-{ -10107,   -7623,  -22152,  -18303,   26645,    9550},
-{ -25549,     477,    7874,   -1538,    1123,    -168},
-{    470,    9834,    -347,   23945,  -10381,   -9467},
-{  -4096,   -9702,   -6856,  -21544,   20845,    7174},
-{   5370,    9748,  -23765,   -1190,     512,   -1538},
-{  -1006,  -10046,  -12649,   19234,   -1790,    -890},
-{  15108,   23620,  -15646,   -2522,   -1203,   -1325},
-{  -7406,   -2605,    1095,    -247,    -473,     177},
-{   8089,       4,   12424,  -22284,   10405,   -7728},
-{  22196,   10775,   -5043,     690,     534,    -212},
-{  -3153,   -1418,  -16835,   18426,   15821,   22956},
-{   5681,   -2229,    3196,   -3414,  -21817,  -14807},
-{     19,     787,    1032,     170,   -8295,    -645},
-{   -882,   -2319,  -27105,     432,   -4392,    1499},
-{  -1354,  -11819,     -76,  -20380,  -10293,   11328},
-{    211,   -4753,   -4675,   -6933,  -13538,   14479},
-{   6043,    5260,    -459,    -462,     143,     -65},
-{  -2572,    7256,   -3317,    9212,  -23184,   -9990},
-{ -24882,   -9532,   18874,    6101,    2429,  -14482},
-{   8314,    2277,   14192,    3512,   25881,   22000},
-{    208,   20218,    -281,  -24778,     -63,   -1183},
-{   1095,   -6034,    2706,  -21935,   -2655,     563},
-{     23,   -5930,     243,   -8989,    5345,   20558},
-{ -15466,   12699,    4160,   11087,   20621,  -10416},
-{  20995,     -85,   -8468,     194,    1003,   -9515},
-{ -19637,   -3335,  -14081,    3574,  -23381,    -667},
-{  -2076,    3489,   -3192,  -19367,     539,   -1530},
-{   7352,  -15213,   22596,   19369,    1043,   16627},
-{  -1872,    -413,    1235,   -5276,   -3550,   21903},
-{   7931,   -2008,   16968,   -6799,   29393,   -2475},
-{ -13589,    8389,  -23636,  -22091,  -14178,  -14297},
-{ -11575,  -20090,   16056,   -1848,   15721,    4500},
-{   3849,  -16581,   20161,  -21155,    7778,   11864},
-{  -6547,   -1273,  -18837,  -11218,   11636,    1044},
-{   2528,   -6691,  -17917,  -11362,   -4894,   -1008},
-{   1241,    4260,    2319,    6111,    3485,   20209},
-{   3014,   -3048,    5316,   -4539,   20831,    8702},
-{  -1790,  -14683,     278,   13956,  -10065,  -10547},
-{ -22732,   -7957,   -1154,   13821,   -1484,   -1247},
-{  -7317,    -615,   13094,   18927,    9897,    1452},
-{   2552,   -2338,    3424,   -4630,   11124,  -19584},
-{ -11125,  -20553,  -10855,  -10783,  -20767,    6833},
-{    984,  -15095,    5775,   25125,    5377,  -19799},
-{    517,   13272,   -7458,   -1711,   20612,   -6013},
-{ -21417,   13251,  -20795,   13449,   17281,   13104},
-{ -15811,  -16248,   23093,   -4037,   -8195,     871},
-{    582,   12571,  -21129,  -14766,   -9187,    5685},
-{   4318,   -1776,   11425,  -17763,   -9921,     577},
-{   6013,   16830,   17655,  -25766,   -4400,   -3550},
-{ -13744,  -16541,    3636,   -3330,  -21091,  -15886},
-{   6565,  -11147,    8649,  -13114,   23345,  -13565},
-{  -2542,   -9046,   -7558,   29240,    3701,    -383},
-{ -10612,   24995,    1893,   -8210,   20920,  -16210},
-{   5276,   16726,   10659,   19940,   -4799,  -19324},
-{   -532,   -9300,   27856,    4965,    -241,     536},
-{   -765,  -20706,   -3412,   18870,    2765,    1420},
-{  -3059,    2708,  -19022,    -331,    3537,     116},
-};
-static const int16_t vq_hebap7[512][6] = {
-{ -21173,   21893,   10390,   13646,   10718,   -9177},
-{ -22519,   -8193,   18328,   -6629,   25518,  -10848},
-{   6800,  -13758,  -13278,   22418,   14667,  -20938},
-{   2347,   10516,    1125,   -3455,    5569,   27136},
-{  -6617,   11851,  -24524,   22937,   20362,   -6019},
-{ -21768,   10681,  -19615,  -15021,   -8478,   -2081},
-{  -2745,    8684,   -4895,   27739,    7554,  -11961},
-{  -1020,    2460,    -954,    4754,    -627,  -16368},
-{ -19702,   23097,      75,  -13684,   -2644,    2108},
-{   4049,   -2872,    5851,   -4459,   22150,   12560},
-{ -21304,  -17129,    -730,    7419,  -11658,  -10523},
-{  11332,    1792,   26666,   23518,  -19561,    -491},
-{ -17827,  -16777,  -13606,  -14389,  -22029,   -2464},
-{   1091,   -5967,   -7975,  -16977,  -20432,  -21931},
-{  18388,   -1103,    1933,   13342,  -17463,   18114},
-{  22646,   17345,   -9966,   17919,   18274,     698},
-{   1484,   20297,   -5754,  -26515,    4941,  -22263},
-{  -2603,    4587,   -5842,   18464,    8767,   -2568},
-{  -2797,   -1602,   21713,    3099,  -25683,    3224},
-{ -19027,    4693,   -5007,    6060,    1972,  -15095},
-{  -2189,    9516,    -530,   20669,   -4662,   -8301},
-{ -22325,   -8887,    2529,  -11352,    5476,     998},
-{  22100,   -5052,    1651,   -2657,    4615,    2319},
-{  20855,   -3078,   -3330,    4105,   13470,    3069},
-{     85,   17289,   10264,  -14752,     214,      90},
-{ -26365,  -18849,  -19352,   19244,  -10218,    9909},
-{  -9739,   20497,   -6579,   -6983,    2891,    -738},
-{  20575,  -15860,  -22913,    6870,      76,     327},
-{   8744,  -12877,  -22945,   -2372,  -19424,   -9771},
-{ -12886,   16183,   21084,    3821,     749,  -13792},
-{ -15995,   18399,    2391,  -17661,   19484,   -6018},
-{   1423,   11734,    4051,   19290,    6857,  -19681},
-{  -5200,    9766,   18246,    2463,   18764,   -4852},
-{   -597,   19498,    1323,   -9096,    -308,   -1104},
-{  -3099,  -25731,  -15665,   25332,    4634,    2635},
-{  19623,   -2384,   -7913,   11796,   -9333,  -14084},
-{   2642,   26453,  -21091,  -10354,   -1693,   -1711},
-{  22031,   21625,   11580,  -22915,   -4141,     129},
-{  -6122,    3542,     915,    -261,     -17,    -383},
-{   1696,    6704,   -1425,   20838,     857,   -4416},
-{   1423,  -15280,   -8550,   -9667,    5210,    5687},
-{  -4520,    -613,  -11683,    5618,    4230,     619},
-{    937,   -4963,  -14102,  -17104,   -6906,   -5952},
-{ -15068,    -481,   -7237,  -14894,   18876,   21673},
-{ -25658,    2910,    1143,    -327,    -458,    -995},
-{  -9656,    -819,  -24900,    2804,   20225,    1083},
-{  -1111,   -3682,   -1788,  -19492,     966,     821},
-{   7293,  -21759,   10790,   -7059,  -23293,   -1723},
-{   -282,  -11093,     170,  -20950,  -28926,   12615},
-{  17938,    3713,   -1563,     885,       5,     564},
-{   6116,   22696,    2242,   -6951,    9975,   -6132},
-{   4338,   26808,   -3705,    1976,   -1079,   -2570},
-{   -661,   -7901,   -2668,  -15194,   17722,    4375},
-{  -4174,  -11053,     717,  -22506,    1562,   12252},
-{  -6405,   18334,    6103,    6983,    5956,   18195},
-{   9851,    5370,   23604,   -6861,   -6569,     -62},
-{  21964,   13359,    -683,    3785,    2168,     209},
-{  -3569,   -1127,  -19724,   -1544,    1308,    -803},
-{  -3083,   16049,  -13791,   -3077,    4294,   23713},
-{  -9999,    9943,  -15872,   12934,  -23631,   21699},
-{   9722,   22837,   12192,   15091,    5533,    4837},
-{   2243,    2099,    1243,    4089,    4748,   12956},
-{   4007,   -2468,    3353,   -3092,    8843,   17024},
-{   4330,    6127,    5549,    9249,   11226,   28592},
-{  -9586,   -8825,     236,    1009,     455,    -964},
-{   6829,   19290,   -1018,     200,    1821,     578},
-{   5196,     957,   10372,    3330,  -12800,    -127},
-{  -3022,   -8193,  -14557,   22061,    5920,    1053},
-{  10982,   25942,  -24546,  -23278,  -11905,   -6789},
-{  22667,  -11010,    5736,    2567,   23705,  -10253},
-{  -3343,   -4233,   -5458,   20667,  -10843,   -3605},
-{  -4131,   -3612,    4575,    -829,    -350,    -847},
-{  -3303,    3451,   -7398,  -11604,    3023,     455},
-{   3200,   -9547,    3202,  -22893,   11184,  -26466},
-{ -14093,   -4117,   15382,   14295,  -10915,  -20377},
-{   3807,  -11016,   22052,   14370,  -15328,   -7733},
-{  -6291,  -17719,   -1560,   12048,  -19805,    -443},
-{  -6147,   -4234,    -160,    8363,   22638,   11911},
-{  19197,    1175,    7422,   -9875,   -4136,    4704},
-{    -72,   -7652,    -112,  -11955,   -3230,   27175},
-{   3274,    5963,    7501,  -17019,     866,  -25452},
-{    737,    1861,    1833,    2022,    2384,    4755},
-{  -5217,    7512,    3323,    2715,    3065,   -1606},
-{   4247,     565,    5629,    2497,   18019,   -4920},
-{  -2833,  -17920,   -8062,   15738,   -1018,    2136},
-{   3050,  -19483,   16930,   29835,  -10222,   15153},
-{ -11346,     118,  -25796,  -13761,   15320,    -468},
-{  -4824,    4960,   -4263,    1575,  -10593,   19561},
-{  -8203,   -1409,    -763,   -1139,    -607,    1408},
-{  -2203,  -11415,    2021,   -6388,   -2600,     711},
-{   -413,   -2511,    -216,   -3519,  -28267,    1719},
-{ -14446,   17050,   13917,   13499,  -25762,  -16121},
-{  19228,    7341,  -12301,     682,   -3791,    -199},
-{  -4193,   20746,  -15651,   11349,    5860,    -824},
-{ -21490,   -3546,      -3,   -1705,   -3959,    9213},
-{  15445,   -1876,    2012,  -19627,   16228,   -4845},
-{  -2867,   -3733,   -7354,    -175,  -20119,   11174},
-{  -3571,  -24587,   19700,    6654,     979,    -654},
-{  21820,   -7430,   -6639,  -10767,   -8362,   15543},
-{  14827,   17977,   -7204,   -3409,    1906,  -17288},
-{   3525,   -3947,   -1415,   -2798,   17648,    2082},
-{  -6580,  -15255,  -17913,    1337,   15338,   21158},
-{   6210,    9698,   15155,  -24666,  -22507,   -3999},
-{  -1740,    -593,    1095,   -7779,   25058,    5601},
-{  21415,    -432,   -1658,   -6898,   -1438,  -14454},
-{  -6943,     700,  -12139,    -745,  -24187,   22466},
-{   6287,    3283,   11006,    3844,   19184,   14781},
-{ -22502,   15274,    5443,   -2808,    -970,   -3343},
-{   3257,   -3708,    4744,   -8301,   22814,  -10208},
-{  24346,  -20970,   19846,     987,  -11958,   -6277},
-{   3906,  -19701,   13060,   -1609,   18641,    7466},
-{ -26409,  -22549,   16305,    2014,   10975,   18032},
-{  -7039,    4655,  -14818,   18739,   15789,    1296},
-{   9310,   -1681,   14667,   -3326,   26535,  -11853},
-{   5728,    5917,   13400,   10020,   -2236,  -24704},
-{   1741,   -6727,   12695,  -22009,    4080,    5450},
-{  -2621,    9393,   21143,  -25938,   -3162,   -2529},
-{  20672,   18894,  -13939,    6990,   -8260,   15811},
-{ -23818,   11183,  -13639,   11868,   16045,    2630},
-{  18361,  -10220,     829,     856,   -1010,     157},
-{  14400,   -4678,    5153,  -13290,  -27434,  -11028},
-{  21613,   11256,   17453,    7604,   13130,    -484},
-{      7,    1236,     573,    4214,    5576,   -3081},
-{    916,   -9092,    1285,   -8958,    1185,  -28699},
-{  21587,   23695,   19116,   -2885,  -14282,   -8438},
-{  23414,   -6161,   12978,    3061,   -9351,    2236},
-{  -3070,   -7344,  -20140,    5788,     582,    -551},
-{  -3993,     315,   -7773,    8224,  -28082,  -12465},
-{  13766,  -15357,   19205,  -20624,   13043,  -19247},
-{   3777,    -177,    8029,   -1001,   17812,    5162},
-{  -7308,   -4327,  -18096,    -620,   -1350,   14932},
-{  14756,   -1221,  -12819,  -14922,    -547,   27125},
-{   2234,    1708,    2764,    5416,    7986,  -25163},
-{   2873,    3636,    3992,    5344,   10142,   21259},
-{   1158,    5379,     508,  -10514,     290,   -1615},
-{   1114,   24789,   16575,  -25168,    -298,   -2832},
-{  -1107,   -6144,   -1918,   -7791,   -2971,  -23276},
-{   4016,   10793,   17317,   -4342,  -20982,   -3383},
-{  -4494,    -207,   -9951,   -3575,    7947,    1154},
-{  -7576,    8117,  -14047,   16982,  -26457,  -27540},
-{ -15164,   16096,  -16844,   -8886,  -23720,   15906},
-{  24922,    5680,   -1874,     420,     132,     117},
-{   -506,  -19310,    -198,     412,    -311,     752},
-{  -1906,    3981,   -7688,   16566,  -19291,  -14722},
-{   -399,    -729,   -3807,   -4196,  -12395,    7639},
-{   3368,    2330,    9092,   23686,  -10290,   -1705},
-{  -3148,    2596,   -7986,   14602,   -4807,   16627},
-{   8057,    1481,      49,   17205,   24869,    7474},
-{ -19304,    -513,   11905,    2346,    5588,    3365},
-{  -5063,  -21812,   11370,   10896,    4881,     261},
-{   4794,   20577,    5109,   -6025,   -8049,   -1521},
-{   8125,  -14756,   20639,  -14918,   23941,   -3650},
-{  12451,    1381,    3613,    8687,  -24002,    4848},
-{   6726,   10643,   10086,   25217,  -25159,   -1065},
-{   6561,   13977,    2911,   21737,   16465,  -26050},
-{  -1776,    2575,  -19606,  -16800,    3032,    6679},
-{  15012,  -17910,   -8438,  -21554,  -27111,   11808},
-{   3448,    -924,  -15913,   -1135,    5126,  -20613},
-{   7720,    2226,   17463,    5434,   28942,   17552},
-{   1246,   15614,  -11743,   24618,  -17539,    3272},
-{   3215,   17950,    2783,    -722,  -22672,    5979},
-{  -5678,   -3184,  -26087,   26034,    6583,    3302},
-{  20310,   -3555,   -2715,    -444,   -1487,    1526},
-{ -20640,  -21970,  -12207,  -25793,    8863,   -1036},
-{  17888,     570,  -16102,    8329,   -2553,   15275},
-{  -2677,    9950,   -1879,   16477,  -12762,  -29007},
-{   -120,   -2221,     219,      97,     365,      35},
-{   1270,    -718,    1480,   -2689,    1930,   -7527},
-{   1896,    8750,    1906,   18235,  -12692,   -6174},
-{  -3733,   13713,   -9882,  -15960,   -1376,   -7146},
-{ -10600,    8496,   15967,   -8792,    7532,   20439},
-{   3041,  -13457,    1032,  -26952,    5787,   24984},
-{  -4590,   -8220,   -9322,   -6112,  -17243,   25745},
-{ -17808,    6970,    3752,     626,    -114,    2178},
-{   4449,   -4862,    7054,   -5404,    4738,   -2827},
-{   4922,    -651,   18939,   -9866,     848,    1886},
-{   -336,   -5410,    7234,   20444,   -9583,    -600},
-{    781,  -19474,  -12648,    6634,    1414,     450},
-{  -3399,  -16770,   11107,   13200,   -5498,   21663},
-{  -3265,    4859,   -5961,    7530,  -10837,   28086},
-{  10350,  -12901,   25699,   25640,    -639,     351},
-{   1163,   18763,   -5466,  -15087,    -145,   -1377},
-{ -14477,   27229,  -31383,  -32653,   21439,   -2894},
-{  15420,   18823,   22128,   19398,   22583,   13587},
-{ -10674,   10710,    5089,   -4756,     909,  -20760},
-{ -12948,  -20660,    7410,    2722,    3427,   11585},
-{  -1105,   18374,   19731,   -9650,   22442,   19634},
-{   -296,   -6798,  -14677,   21603,   19796,   21399},
-{ -19350,   -7501,   25446,   13144,    8588,  -25298},
-{   3092,  -10618,   20896,    9249,   -3326,    1796},
-{   -811,    1449,    3106,    4748,   12073,  -14262},
-{ -20720,   14275,   -4332,  -25838,   -5781,  -21149},
-{  -5132,   10554,  -14020,  -22150,    2840,    -554},
-{  25533,   17648,   14886,  -21074,    2459,   25142},
-{  -9370,   -1788,  -12862,   -5870,  -25811,  -11023},
-{   6698,     819,   10313,     166,   27581,     523},
-{    101,  -19388,    3413,    9638,      64,     806},
-{  -2742,  -17931,   -2576,   22818,    8553,    1126},
-{   2972,   15203,    1792,   25434,   -5728,  -17265},
-{  -1419,    1604,    4398,   11452,    1731,   23787},
-{  -5136,    4625,  -10653,   27981,    9897,   -2510},
-{ -10528,  -28033,    2999,   -1530,    -832,    -830},
-{ -11133,  -12511,   22206,   -7243,  -23578,  -21698},
-{  16935,  -21892,    1861,   -9606,    9432,   19026},
-{  10277,    9516,   26815,    2010,   -4943,   -9080},
-{   5547,   -2210,   14270,  -15300,  -19316,    1822},
-{  -4850,    -783,   -8959,   -3076,  -20056,   -3197},
-{   8232,   -2794,  -17752,   13308,    3229,    -991},
-{ -12237,   -6581,   10315,   -9552,    2260,  -20648},
-{  -7000,    5529,   -7553,   -7490,  -10342,  -10266},
-{   3641,   19479,   -5972,  -19097,  -18570,   12805},
-{   1283,   -4164,    4198,  -28473,   -2498,    1866},
-{  16047,   26826,  -13053,   -6316,     985,   -1597},
-{   -403,   13680,    6457,   25070,   27124,  -20710},
-{ -18070,   -1790,  -24986,    5953,    -954,   26600},
-{ -24224,  -15383,   24788,    1953,   -1136,     187},
-{  -2289,   12505,  -20738,    -904,   18324,   21258},
-{   2658,   -6140,   16179,   22276,    -556,    2154},
-{  -6087,   13950,  -25682,  -27713,    4049,   -4795},
-{ -21452,   26473,   19435,   -9124,     895,     303},
-{ -22200,  -26177,   -6026,   24729,  -22926,   -9030},
-{ -14276,  -15982,   23732,  -22851,    9268,   -3841},
-{  29482,   21923,   -6213,    1679,   -2059,   -1120},
-{   -435,    9802,   -3891,   12359,   -4288,  -18971},
-{  19768,     -86,    2467,    1990,   -1021,   -5354},
-{  20986,   -8783,   -5329,  -23562,   -4730,    2673},
-{  -5095,    5605,   -4629,   19150,   26037,  -12259},
-{    972,    6858,    4551,   27949,   -4025,   -2272},
-{   6075,   -3260,   -4989,    -373,   -1571,   -3730},
-{  -7256,  -12992,   -8820,   -5109,   23054,    5054},
-{    920,    2615,    7912,   -7353,   -4905,   20186},
-{   -250,    5454,    3140,    6928,  -18723,   -2051},
-{ -10299,   -4372,   19608,    4879,    -661,   -1885},
-{  14816,   -8603,  -19815,    6135,  -21210,   14108},
-{ -11945,   -2223,    5018,   11892,   22741,     406},
-{ -13184,   -2613,  -13256,  -22433,  -12482,   -8380},
-{  17066,   25267,   -2273,    5056,    -342,     145},
-{   8401,  -17683,   19112,   10615,  -19453,   17083},
-{  20821,   -5700,   12298,  -25598,   10391,    7692},
-{   4550,   15779,   17338,  -19379,   -4768,    1206},
-{  -7723,   10836,  -27164,  -11439,    6835,   -1776},
-{   2542,    3199,    4442,   17513,   -3711,    -914},
-{  20960,  -16774,   -5814,   11087,     -70,   22961},
-{   3305,    2919,    6256,   -4800,  -20966,   -3230},
-{   5924,  -16547,    2183,    2733,    3446,  -23306},
-{  -6061,    -194,  -13852,  -10971,   19488,    1029},
-{   4467,   -5964,  -19004,    1519,    -359,     855},
-{  -1581,   -7607,   22070,  -11580,  -10032,   17102},
-{ -12412,    2553,    4324,   22500,    5751,   12170},
-{ -25127,   17996,   -6384,    1180,    1182,    9622},
-{  23462,   -8471,   -4392,   -2669,    7638,  -16835},
-{  -5511,   -2887,  -10757,  -20883,    7246,    1053},
-{   2703,  -20602,   -7554,    7516,   -7740,    5868},
-{  20670,   21901,     457,   14969,  -17657,  -11921},
-{   3603,   -1595,   -2177,    -157,     -43,     605},
-{   2513,    8954,   10527,   22559,  -16100,  -16041},
-{   6002,    4951,    6795,   -4862,  -22400,   18849},
-{   7590,   -1693,  -24688,   -3404,   14169,    1214},
-{  -4398,   -6663,   -6870,  -10083,  -24596,    9253},
-{  10468,   17751,   -7748,     147,   -6314,    4419},
-{  16187,  -16557,   -4119,    4302,    7625,    5409},
-{   3303,    2735,    7458,  -19902,   -2254,   -3702},
-{  -2077,   21609,   14870,   12545,   -6081,   -1764},
-{   4678,   11740,    2859,    6953,    1919,   -3871},
-{   3522,  -21853,   -2469,  -10453,   18893,  -10742},
-{   3759,  -10191,   -4866,   -2659,  -17831,   -1242},
-{  14991,    9351,   11870,   -1573,   -4848,   22549},
-{   9509,  -27152,   10734,   20851,  -26185,  -17878},
-{  -7170,   -1392,  -19495,   12746,    8198,   -1988},
-{   1883,   28158,    -846,   -7235,     249,     233},
-{  -7200,     669,    -371,   -2948,   23234,   -5635},
-{   3141,     288,    3223,   -1258,     -98,  -27607},
-{  17373,  -23235,    5110,  -11199,   -2574,  -11487},
-{  -4928,    1518,   -5456,     670,  -18278,    1951},
-{  10334,  -19865,   -4649,     361,    -160,    -923},
-{  18732,   14264,   -3155,   -7485,   -3328,    5959},
-{  -3614,   21077,    7276,    3536,    8121,   -1528},
-{  -8422,     500,  -19182,   18929,   26392,   -1039},
-{  15639,   25668,    8375,    1903,    1945,  -11979},
-{  -2716,    3389,   26850,   -4587,    1803,      22},
-{   1177,    -655,    1233,   -2128,    7844,    1767},
-{   -761,    8209,  -19290,   -4593,    1923,    -343},
-{   -689,   -3530,   -3267,   -3804,   -2753,   18566},
-{  -2110,    1962,   -1353,   16643,    2765,  -23102},
-{   -433,    4905,     302,   13016,   15933,   -5905},
-{   3203,    4126,   11181,   -5496,   -2529,   -1160},
-{  -1091,   -6469,   -1415,    5682,    -268,     583},
-{  -9405,  -19572,    6216,    1658,     993,     -75},
-{  -1695,   -4504,   -2289,   -4088,   -6556,  -16577},
-{   4760,    -892,  -10902,    6516,   24199,   -6011},
-{   -253,    1000,      63,     -81,    -115,    -382},
-{  -1333,   24224,    -698,   -4667,   -2801,  -19144},
-{   -876,  -28866,  -21873,   12677,   -6344,    3235},
-{  16847,   21145,  -26172,   -3183,    -396,     230},
-{  18296,   -7790,  -12857,    -679,   -1473,       5},
-{ -10488,   11429,   25805,   -1122,    1401,    -438},
-{   3782,   -7429,   26720,   17567,   19257,   12542},
-{   6332,    -746,   12789,    9316,  -22542,   -5354},
-{   3418,  -22728,   26978,   18303,    1076,     956},
-{ -27315,   -2988,     920,     235,    2233,      81},
-{   6199,    5296,   16093,   14768,   -8429,   -1112},
-{  -6432,   19244,    9921,   -3253,    1278,    -954},
-{  24213,    2049,  -22931,    2585,   -2410,   -4216},
-{   9286,   14282,  -19735,   -3985,   -2344,    1028},
-{ -20128,   17993,   -9458,   23012,  -16983,    8625},
-{  -6896,  -20730,    3762,   17415,   22341,   19024},
-{    842,   24181,   25062,   -5839,     -78,     937},
-{   -621,   19722,  -24204,   -1962,  -14854,     -56},
-{  22766,   -5119,   17365,   23868,  -19480,   -6558},
-{  -2158,   17490,  -21435,    3340,  -12819,  -20295},
-{  -9621,   17325,     715,    2265,   -4123,    -492},
-{   9156,   12947,   27303,  -21175,   -6072,   -9457},
-{ -13164,  -23269,  -14006,   -4184,    6978,       2},
-{    938,  -13381,    3520,  -24297,   22902,   19589},
-{  -4911,  -19774,   19764,   -9310,  -12650,    3819},
-{  -5462,   -4249,   -6987,   -6260,  -13943,  -25150},
-{   9341,   10369,  -13862,   -6704,   22556,    -519},
-{   6651,   18768,   -4855,   12570,   14730,  -10209},
-{   -823,   18119,     398,   -1582,    -116,    -363},
-{  -6935,  -12694,  -28392,    8552,    6961,    -239},
-{  -2602,   -4704,   -1021,    2015,    5129,   23670},
-{ -12559,   -8190,  -25028,   18544,   14179,    1663},
-{   3813,   21036,   -9620,   -5051,   -1800,   -1087},
-{ -22057,   16675,   14960,    9459,    2786,   16991},
-{ -26040,  -19318,   -6414,    1104,    5798,  -18039},
-{  -1737,   24825,   10417,  -11087,     896,   -5273},
-{  -1855,   11661,   -2803,   24809,  -21435,  -19792},
-{ -23473,  -16729,   -5782,    5643,    2636,    4940},
-{  -1724,    4388,  -26673,  -13695,   10570,  -25895},
-{  15358,  -19496,   26242,  -18493,    1736,    8054},
-{   5684,   20890,    4091,  -19100,  -14588,  -10468},
-{  17260,  -16291,   14859,  -17711,  -19174,   12435},
-{ -27185,  -12573,    6743,    -562,     976,    -257},
-{  12395,   -8618,  -22248,  -19843,   11013,    7762},
-{   3799,   11853,  -27622,   -8473,    1089,   -1495},
-{   4141,   -2182,  -26720,    -735,    -774,    1469},
-{   3125,   13762,    4606,   29257,   18771,   -9958},
-{ -17465,   -9445,  -17562,   -2530,   -6435,   -3726},
-{  -1742,    4351,   -6841,  -19773,    9627,  -10654},
-{   7251,    3525,   10835,    5601,   25198,  -23348},
-{ -10300,  -17830,     631,   11640,    2044,  -20878},
-{   -873,   -8502,   -1063,  -15674,  -10693,   14934},
-{ -15957,   28137,    5268,     477,   -1053,    1158},
-{  -1495,   -8814,   -5764,  -24965,   25988,    7907},
-{  -1038,    -114,   -2308,   -1319,   -6480,    1472},
-{   4895,  -17897,  -25850,    5301,    -188,    1581},
-{   3200,   17225,    4346,   22101,  -18543,   22028},
-{ -10250,     545,  -10932,    2276,  -28070,    8118},
-{  15343,    2329,    9316,   20537,   14908,   21021},
-{   6329,    6130,  -24508,     837,   -8637,   -5844},
-{   7386,    -501,   10503,   20131,   11435,   -4755},
-{  -2745,   24174,   -9274,   15273,   -8389,   -5835},
-{   2992,   -2864,    6048,   -7473,   11687,  -19996},
-{   -883,  -11954,   -9976,  -21829,   -4436,  -27178},
-{   3458,   19626,    1280,    2597,   19849,    5255},
-{  -5315,   19133,  -14518,   -8946,   13749,   -1352},
-{  18642,   17655,   11001,    6817,  -18418,    6336},
-{  -1697,    2244,   -4640,    3948,  -12890,   -5273},
-{  20428,   10542,    4170,   -1012,   19439,   21691},
-{  -2943,  -19735,   -4208,    1320,     909,   -8897},
-{   9351,   -8066,   -2618,  -12933,   26582,    3507},
-{   9705,  -22628,    8311,    8167,  -13293,    5608},
-{   3222,    3749,   -1508,     165,     -52,    -196},
-{    102,  -22744,   -8832,     903,  -11421,  -14662},
-{   -120,    5998,   19765,   13401,    3628,    5197},
-{   8528,    5827,   -1066,     774,     -39,    -166},
-{   9411,   -9476,    9581,  -13004,   24456,   24900},
-{  17878,    2235,  -21639,   20478,    4716,   -7190},
-{  -2482,    9511,    1611,  -21943,   14230,   -1289},
-{   9288,   -2291,   23215,   -3452,  -10842,      11},
-{   9496,    3041,    5130,   -3890,  -21219,  -22589},
-{  14262,   -9838,   20195,   14019,      91,  -17200},
-{ -18591,     980,      17,     821,     120,    -574},
-{  12285,  -19269,   13742,   16373,    -161,    6025},
-{  -3364,    1530,   -4005,    2454,  -10872,  -23839},
-{    105,    5085,    -260,    5790,    -588,   19170},
-{   4121,    4169,   13439,   14644,   20899,    7434},
-{   -175,   13101,   -3704,   23233,    3907,   10106},
-{  -6101,   23467,    5204,   -1341,    1599,   13174},
-{  -3217,   -3494,   15117,   -8387,  -11762,   -4750},
-{   1146,    4675,  -19378,   14917,   -5091,     249},
-{ -21506,   10136,  -16473,  -13305,   18382,   -8601},
-{    628,    2447,    3344,    3130,   -5115,     119},
-{  17900,  -22422,  -17633,   21967,  -16293,   -7676},
-{  16863,   24214,    5612,   -3858,    -809,    3822},
-{  -2291,   10091,   -2360,  -25109,   -1226,     312},
-{   2957,   11256,   26745,  -13266,   -3455,   -1128},
-{ -19762,   -2708,    4604,    6355,    1638,   25501},
-{ -19593,   -7753,    3159,     -85,    -489,   -1855},
-{    814,   12510,   19077,   -4681,   -2610,   -1474},
-{ -23408,  -19027,    8137,   19878,    7912,    -282},
-{    839,  -19652,   11927,   27278,   -3211,    2266},
-{   4020,   -1110,    8226,   -1274,   20922,   25060},
-{  26576,     325,   -8693,    -232,   -2218,    -699},
-{ -11293,   -4200,    1805,   -6673,  -22940,   -1339},
-{  -2005,  -15886,   -1047,  -27687,  -13235,   14370},
-{ -22073,    1949,   13175,  -15656,   -1846,    8055},
-{   3039,   12025,    7132,  -24632,     413,   -2347},
-{ -24048,    -206,   12459,   -6654,    -417,  -10091},
-{  18179,  -23688,  -20515,  -16396,    7230,     763},
-{   5659,   -5085,   13878,  -23729,  -11077,  -19587},
-{  11340,     501,   25040,    7616,  -19658,    1605},
-{ -26650,    8878,   10544,     417,    1299,     261},
-{  14460,   11369,   -3263,    9990,    8194,   18111},
-{   1355,  -20838,   -9196,  -16060,   -8559,    -730},
-{  -1918,  -20937,  -18293,   -2461,   -2651,    4316},
-{  -2810,   24521,  -10996,  -25721,     308,   -1234},
-{  -9075,  -17280,   -1833,  -29342,  -24213,  -16631},
-{  -2843,   10165,   -5339,   -2888,   21858,  -21340},
-{ -15832,   14849,  -23780,    5184,   10113,  -20639},
-{ -19535,  -11361,    8413,    1486,  -23658,   -5759},
-{  -7512,    1027,  -20794,   13732,   19892,  -21934},
-{ -12132,   -7022,  -19175,   -8840,   22125,  -16490},
-{   1937,    5210,   -6318,  -23788,   13141,   11082},
-{   -205,    6036,    -380,    8658,    -233,   28020},
-{  -5523,    7477,    7635,   23595,    9763,   -2590},
-{  21658,  -28313,   -3086,    -300,   -1032,    1744},
-{ -22352,   16646,     208,    6665,  -17400,   -3028},
-{  18482,    9336,   -2737,  -19372,     407,   -4389},
-{  -4913,  -17370,   18819,  -17654,   13416,   15232},
-{   7749,    6368,   23135,  -18174,    7584,   -4248},
-{  -1489,   -6523,     586,  -10157,   14964,   25568},
-{   3844,   -6156,    4897,  -13045,  -22526,    5647},
-{  -8491,   -2105,  -24774,     905,   -9326,    1456},
-{  -3040,   -1476,    1166,   -4428,   11236,    9204},
-{   3397,   -1451,   13598,  -15841,   24540,    5819},
-{   8483,   -2993,   21547,  -16916,    7741,   24018},
-{ -14932,  -23758,   -5332,   -6664,   -4497,   13267},
-{  19379,   12916,   -2142,    -737,   21100,  -22101},
-{   3393,   -4629,    5735,  -18913,   -6969,    2687},
-{   1148,  -16147,  -21433,  -28095,    -630,  -14449},
-{   7300,     672,   18530,  -17452,  -10149,     351},
-{  11356,  -10974,   17212,    4624,     145,   17791},
-{   -711,   -3479,   -2238,   15887,    2027,       0},
-{ -28048,    1794,    -593,   -2758,  -21852,   11535},
-{ -19683,    4937,   22004,   21523,   -3148,    1790},
-{    813,    8231,    2633,   11981,   -3043,   22201},
-{   8952,  -24760,    -690,   14873,   -2366,   -5372},
-{   8406,   -5439,    -274,    -642,    -145,     778},
-{  -6605,    7258,   20780,  -23507,  -18625,   22782},
-{ -22896,  -25488,   10020,   -1614,    1508,   -1393},
-{   7607,     407,  -24678,  -16385,   -1804,   -4699},
-{ -10592,  -19139,   10462,   -3747,    8721,   -6919},
-{  13010,    5292,   -6230,   -4884,  -20904,   -1797},
-{  16891,  -13770,    -465,   19343,  -10741,  -12959},
-{  25193,  -14799,   -5681,    -521,    -321,   -1211},
-{   6917,   -3093,   20183,  -26903,  -12026,    1295},
-{    305,    1992,   19457,    -985,      25,    -521},
-{   6707,   -3698,    8365,   -8687,   21921,  -27166},
-{   4668,    5997,    7117,   11696,   24401,  -10794},
-{    744,   -9416,   19893,    1963,    7922,   -9824},
-{   3430,   21282,   -1736,   10844,    8821,   27015},
-{  -8813,    1521,  -24038,    1651,    7838,   -1208},
-{   3911,  -11221,    3273,  -12541,    7168,   18402},
-{  21642,    9117,  -11536,   -5256,    7077,    2382},
-{    100,    3817,   -6713,    1244,    1518,    -321},
-{   7946,  -18670,   10667,   -4866,     727,     776},
-{ -15883,   -8150,   -2087,   22739,    1567,   -3482},
-{   4380,   -2735,    8469,   -7025,  -11424,    1317},
-{  26970,    4393,    7665,   17561,    -714,     650},
-{ -16191,    -835,    8365,    1795,  -14314,   16297},
-{   4504,  -10048,    7662,  -26690,  -17428,    2580},
-{     48,   -3984,     564,   -5871,    2658,  -18658},
-{  12579,  -26016,  -15642,    2672,   -1347,    -887},
-{  -4950,    4208,   -6811,    2569,  -20621,   -8658},
-{  -1836,  -14818,   -5571,  -23322,  -14800,   25867},
-{   5434,  -28139,   -2357,   -2883,    -570,    2431},
-{  13096,   -2771,   24994,  -12496,  -24723,   -1025},
-{  -5676,   -4339,    1908,   18628,  -21323,   17366},
-{  27660,  -27897,  -15409,    1436,   -7112,   -2241},
-{   8019,    3847,   24568,    -469,    9674,   10683},
-{   -903,  -10149,    1801,  -21260,    4795,   -8751},
-{   1122,   -9582,    2625,   22791,     956,     882},
-{   7876,   19075,   -9900,  -24266,    7496,    9277},
-{    980,  -26764,   -5386,    5396,    1086,    1648},
-{  28838,   -1270,    -447,       5,    -429,     -20},
-{ -15283,    6132,   22812,    1252,   -9963,     511},
-{    851,    7925,    -457,  -12210,    4261,    7579},
-{  -4530,    8452,   -1246,   14501,  -24951,   -5760},
-{ -17814,  -10727,    9887,  -23929,  -13432,    1878},
-{ -15049,   10165,   16491,  -14603,  -11712,  -21156},
-{  -3317,     840,   -5683,   22413,    1994,     586},
-{  23158,   -5788,  -15043,  -10372,   -9271,  -13523},
-{   -773,   -9509,   -3993,  -24264,    8463,    5804},
-{  -8545,    -703,  -12440,   -3985,  -25122,  -28147},
-{ -16659,   16001,    2746,    1611,    5097,   -1043},
-{     41,   -7181,   19903,   31555,  -32237,   13927},
-{  -5658,     845,  -12774,    5705,   16695,     -86},
-{   5282,   14875,   27026,   21124,   15776,  -10477},
-{  14712,   19648,  -11487,  -13361,  -20196,  -15229},
-{   8597,   -9138,    -626,   10891,   -6015,    6346},
-{  -1488,   -1272,   -1479,   -1303,   -3704,   -5485},
-{  -3370,   17871,   -6604,   24930,   25886,   -3127},
-{   8416,   27783,   -1385,    5350,   -4260,   19993},
-{   5688,     362,   17246,    3809,   -3246,    1088},
-{   -105,  -29607,    2747,   15223,    -167,    3722},
-{   3502,   -3195,    8602,    7772,   -1566,    -915},
-{   -491,    3257,   -2423,    5522,   20606,    -100},
-{ -13948,  -11368,  -15375,  -21866,   -8520,   12221},
-{   -616,    2424,   -2023,    4398,   -3805,    8108},
-{  -7204,   21043,   21211,   -9395,  -19391,     896},
-{  -5737,  -15160,  -21298,   17066,   -1006,    -366},
-{   6261,    3240,  -11937,  -16213,  -15820,    6581},
-{  -3155,   24796,    2733,   -1257,    -875,   -1597},
-{ -20469,   11094,   24071,   -8987,   14136,    2220},
-{ -14106,   11959,  -22495,    4135,   -1055,   -5420},
-{    801,   -2655,      60,   -5324,    -790,    5937},
-{  -7372,   -1764,  -22433,  -26060,   21707,    4178},
-{  -5715,   -6648,  -14908,    1325,  -24044,    1493},
-{  -6024,  -12488,   23930,    2950,    1601,    1173},
-{  19067,   17630,   17929,  -10654,   10928,   -4958},
-{   3231,   -3284,   27336,    4174,   -1683,     497},
-};
-
-const int16_t (* const ff_eac3_mantissa_vq[8])[6] = {
-    NULL,
-    vq_hebap1,
-    vq_hebap2,
-    vq_hebap3,
-    vq_hebap4,
-    vq_hebap5,
-    vq_hebap6,
-    vq_hebap7,
-};
-
-/**
- * Table E2.14 Frame Exponent Strategy Combinations
- */
-const uint8_t ff_eac3_frm_expstr[32][6] = {
-{    EXP_D15,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE},
-{    EXP_D15,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE,    EXP_D45},
-{    EXP_D15,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE,    EXP_D25,  EXP_REUSE},
-{    EXP_D15,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE,    EXP_D45,    EXP_D45},
-{    EXP_D25,  EXP_REUSE,  EXP_REUSE,    EXP_D25,  EXP_REUSE,  EXP_REUSE},
-{    EXP_D25,  EXP_REUSE,  EXP_REUSE,    EXP_D25,  EXP_REUSE,    EXP_D45},
-{    EXP_D25,  EXP_REUSE,  EXP_REUSE,    EXP_D45,    EXP_D25,  EXP_REUSE},
-{    EXP_D25,  EXP_REUSE,  EXP_REUSE,    EXP_D45,    EXP_D45,    EXP_D45},
-{    EXP_D25,  EXP_REUSE,    EXP_D15,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE},
-{    EXP_D25,  EXP_REUSE,    EXP_D25,  EXP_REUSE,  EXP_REUSE,    EXP_D45},
-{    EXP_D25,  EXP_REUSE,    EXP_D25,  EXP_REUSE,    EXP_D25,  EXP_REUSE},
-{    EXP_D25,  EXP_REUSE,    EXP_D25,  EXP_REUSE,    EXP_D45,    EXP_D45},
-{    EXP_D25,  EXP_REUSE,    EXP_D45,    EXP_D25,  EXP_REUSE,  EXP_REUSE},
-{    EXP_D25,  EXP_REUSE,    EXP_D45,    EXP_D25,  EXP_REUSE,    EXP_D45},
-{    EXP_D25,  EXP_REUSE,    EXP_D45,    EXP_D45,    EXP_D25,  EXP_REUSE},
-{    EXP_D25,  EXP_REUSE,    EXP_D45,    EXP_D45,    EXP_D45,    EXP_D45},
-{    EXP_D45,    EXP_D15,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE},
-{    EXP_D45,    EXP_D15,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE,    EXP_D45},
-{    EXP_D45,    EXP_D25,  EXP_REUSE,  EXP_REUSE,    EXP_D25,  EXP_REUSE},
-{    EXP_D45,    EXP_D25,  EXP_REUSE,  EXP_REUSE,    EXP_D45,    EXP_D45},
-{    EXP_D45,    EXP_D25,  EXP_REUSE,    EXP_D25,  EXP_REUSE,  EXP_REUSE},
-{    EXP_D45,    EXP_D25,  EXP_REUSE,    EXP_D25,  EXP_REUSE,    EXP_D45},
-{    EXP_D45,    EXP_D25,  EXP_REUSE,    EXP_D45,    EXP_D25,  EXP_REUSE},
-{    EXP_D45,    EXP_D25,  EXP_REUSE,    EXP_D45,    EXP_D45,    EXP_D45},
-{    EXP_D45,    EXP_D45,    EXP_D15,  EXP_REUSE,  EXP_REUSE,  EXP_REUSE},
-{    EXP_D45,    EXP_D45,    EXP_D25,  EXP_REUSE,  EXP_REUSE,    EXP_D45},
-{    EXP_D45,    EXP_D45,    EXP_D25,  EXP_REUSE,    EXP_D25,  EXP_REUSE},
-{    EXP_D45,    EXP_D45,    EXP_D25,  EXP_REUSE,    EXP_D45,    EXP_D45},
-{    EXP_D45,    EXP_D45,    EXP_D45,    EXP_D25,  EXP_REUSE,  EXP_REUSE},
-{    EXP_D45,    EXP_D45,    EXP_D45,    EXP_D25,  EXP_REUSE,    EXP_D45},
-{    EXP_D45,    EXP_D45,    EXP_D45,    EXP_D45,    EXP_D25,  EXP_REUSE},
-{    EXP_D45,    EXP_D45,    EXP_D45,    EXP_D45,    EXP_D45,    EXP_D45},
-};
-
-/**
- * Table E.25: Spectral Extension Attenuation Table
- * ff_eac3_spx_atten_tab[code][bin]=pow(2.0,(bin+1)*(code+1)/-15.0);
- */
-const float ff_eac3_spx_atten_tab[32][3] = {
-    { 0.954841603910416503f, 0.911722488558216804f, 0.870550563296124125f },
-    { 0.911722488558216804f, 0.831237896142787758f, 0.757858283255198995f },
-    { 0.870550563296124125f, 0.757858283255198995f, 0.659753955386447100f },
-    { 0.831237896142787758f, 0.690956439983888004f, 0.574349177498517438f },
-    { 0.793700525984099792f, 0.629960524947436595f, 0.500000000000000000f },
-    { 0.757858283255198995f, 0.574349177498517438f, 0.435275281648062062f },
-    { 0.723634618720189082f, 0.523647061410313364f, 0.378929141627599553f },
-    { 0.690956439983888004f, 0.477420801955208307f, 0.329876977693223550f },
-    { 0.659753955386447100f, 0.435275281648062062f, 0.287174588749258719f },
-    { 0.629960524947436595f, 0.396850262992049896f, 0.250000000000000000f },
-    { 0.601512518041058319f, 0.361817309360094541f, 0.217637640824031003f },
-    { 0.574349177498517438f, 0.329876977693223550f, 0.189464570813799776f },
-    { 0.548412489847312945f, 0.300756259020529160f, 0.164938488846611775f },
-    { 0.523647061410313364f, 0.274206244923656473f, 0.143587294374629387f },
-    { 0.500000000000000000f, 0.250000000000000000f, 0.125000000000000000f },
-    { 0.477420801955208307f, 0.227930622139554201f, 0.108818820412015502f },
-    { 0.455861244279108402f, 0.207809474035696939f, 0.094732285406899888f },
-    { 0.435275281648062062f, 0.189464570813799776f, 0.082469244423305887f },
-    { 0.415618948071393879f, 0.172739109995972029f, 0.071793647187314694f },
-    { 0.396850262992049896f, 0.157490131236859149f, 0.062500000000000000f },
-    { 0.378929141627599553f, 0.143587294374629387f, 0.054409410206007751f },
-    { 0.361817309360094541f, 0.130911765352578369f, 0.047366142703449930f },
-    { 0.345478219991944002f, 0.119355200488802049f, 0.041234622211652958f },
-    { 0.329876977693223550f, 0.108818820412015502f, 0.035896823593657347f },
-    { 0.314980262473718298f, 0.099212565748012460f, 0.031250000000000000f },
-    { 0.300756259020529160f, 0.090454327340023621f, 0.027204705103003875f },
-    { 0.287174588749258719f, 0.082469244423305887f, 0.023683071351724965f },
-    { 0.274206244923656473f, 0.075189064755132290f, 0.020617311105826479f },
-    { 0.261823530705156682f, 0.068551561230914118f, 0.017948411796828673f },
-    { 0.250000000000000000f, 0.062500000000000000f, 0.015625000000000000f },
-    { 0.238710400977604098f, 0.056982655534888536f, 0.013602352551501938f },
-    { 0.227930622139554201f, 0.051952368508924235f, 0.011841535675862483f }
-};
diff --git a/deps/libav/libavcodec/eac3_data.h b/deps/libav/libavcodec/eac3_data.h
deleted file mode 100644
index 4d88ce0..0000000
--- a/deps/libav/libavcodec/eac3_data.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * E-AC-3 tables
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_EAC3_DATA_H
-#define AVCODEC_EAC3_DATA_H
-
-#include <stdint.h>
-
-extern const uint8_t ff_eac3_bits_vs_hebap[20];
-extern const int16_t ff_eac3_gaq_remap_1[12];
-extern const int16_t ff_eac3_gaq_remap_2_4_a[9][2];
-extern const int16_t ff_eac3_gaq_remap_2_4_b[9][2];
-
-extern const int16_t (* const ff_eac3_mantissa_vq[8])[6];
-extern const uint8_t ff_eac3_frm_expstr[32][6];
-extern const float   ff_eac3_spx_atten_tab[32][3];
-
-#endif /* AVCODEC_EAC3_DATA_H */
diff --git a/deps/libav/libavcodec/eac3dec.c b/deps/libav/libavcodec/eac3dec.c
deleted file mode 100644
index b9d079c..0000000
--- a/deps/libav/libavcodec/eac3dec.c
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * E-AC-3 decoder
- * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec at gmail.com>
- * Copyright (c) 2008 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * There are several features of E-AC-3 that this decoder does not yet support.
- *
- * Enhanced Coupling
- *     No known samples exist.  If any ever surface, this feature should not be
- *     too difficult to implement.
- *
- * Reduced Sample Rates
- *     No known samples exist.  The spec also does not give clear information
- *     on how this is to be implemented.
- *
- * Dependent Streams
- *     Only the independent stream is currently decoded. Any dependent
- *     streams are skipped.  We have only come across two examples of this, and
- *     they are both just test streams, one for HD-DVD and the other for
- *     Blu-ray.
- *
- * Transient Pre-noise Processing
- *     This is side information which a decoder should use to reduce artifacts
- *     caused by transients.  There are samples which are known to have this
- *     information, but this decoder currently ignores it.
- */
-
-
-#include "avcodec.h"
-#include "internal.h"
-#include "aac_ac3_parser.h"
-#include "ac3.h"
-#include "ac3_parser.h"
-#include "ac3dec.h"
-#include "ac3dec_data.h"
-#include "eac3_data.h"
-
-/** gain adaptive quantization mode */
-typedef enum {
-    EAC3_GAQ_NO =0,
-    EAC3_GAQ_12,
-    EAC3_GAQ_14,
-    EAC3_GAQ_124
-} EAC3GaqMode;
-
-#define EAC3_SR_CODE_REDUCED  3
-
-void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
-{
-    int bin, bnd, ch, i;
-    uint8_t wrapflag[SPX_MAX_BANDS]={1,0,}, num_copy_sections, copy_sizes[SPX_MAX_BANDS];
-    float rms_energy[SPX_MAX_BANDS];
-
-    /* Set copy index mapping table. Set wrap flags to apply a notch filter at
-       wrap points later on. */
-    bin = s->spx_dst_start_freq;
-    num_copy_sections = 0;
-    for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
-        int copysize;
-        int bandsize = s->spx_band_sizes[bnd];
-        if (bin + bandsize > s->spx_src_start_freq) {
-            copy_sizes[num_copy_sections++] = bin - s->spx_dst_start_freq;
-            bin = s->spx_dst_start_freq;
-            wrapflag[bnd] = 1;
-        }
-        for (i = 0; i < bandsize; i += copysize) {
-            if (bin == s->spx_src_start_freq) {
-                copy_sizes[num_copy_sections++] = bin - s->spx_dst_start_freq;
-                bin = s->spx_dst_start_freq;
-            }
-            copysize = FFMIN(bandsize - i, s->spx_src_start_freq - bin);
-            bin += copysize;
-        }
-    }
-    copy_sizes[num_copy_sections++] = bin - s->spx_dst_start_freq;
-
-    for (ch = 1; ch <= s->fbw_channels; ch++) {
-        if (!s->channel_uses_spx[ch])
-            continue;
-
-        /* Copy coeffs from normal bands to extension bands */
-        bin = s->spx_src_start_freq;
-        for (i = 0; i < num_copy_sections; i++) {
-            memcpy(&s->transform_coeffs[ch][bin],
-                   &s->transform_coeffs[ch][s->spx_dst_start_freq],
-                   copy_sizes[i]*sizeof(float));
-            bin += copy_sizes[i];
-        }
-
-        /* Calculate RMS energy for each SPX band. */
-        bin = s->spx_src_start_freq;
-        for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
-            int bandsize = s->spx_band_sizes[bnd];
-            float accum = 0.0f;
-            for (i = 0; i < bandsize; i++) {
-                float coeff = s->transform_coeffs[ch][bin++];
-                accum += coeff * coeff;
-            }
-            rms_energy[bnd] = sqrtf(accum / bandsize);
-        }
-
-        /* Apply a notch filter at transitions between normal and extension
-           bands and at all wrap points. */
-        if (s->spx_atten_code[ch] >= 0) {
-            const float *atten_tab = ff_eac3_spx_atten_tab[s->spx_atten_code[ch]];
-            bin = s->spx_src_start_freq - 2;
-            for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
-                if (wrapflag[bnd]) {
-                    float *coeffs = &s->transform_coeffs[ch][bin];
-                    coeffs[0] *= atten_tab[0];
-                    coeffs[1] *= atten_tab[1];
-                    coeffs[2] *= atten_tab[2];
-                    coeffs[3] *= atten_tab[1];
-                    coeffs[4] *= atten_tab[0];
-                }
-                bin += s->spx_band_sizes[bnd];
-            }
-        }
-
-        /* Apply noise-blended coefficient scaling based on previously
-           calculated RMS energy, blending factors, and SPX coordinates for
-           each band. */
-        bin = s->spx_src_start_freq;
-        for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
-            float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f / INT32_MIN);
-            float sscale = s->spx_signal_blend[ch][bnd];
-            for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
-                float noise  = nscale * (int32_t)av_lfg_get(&s->dith_state);
-                s->transform_coeffs[ch][bin]   *= sscale;
-                s->transform_coeffs[ch][bin++] += noise;
-            }
-        }
-    }
-}
-
-
-/** lrint(M_SQRT2*cos(2*M_PI/12)*(1<<23)) */
-#define COEFF_0 10273905LL
-
-/** lrint(M_SQRT2*cos(0*M_PI/12)*(1<<23)) = lrint(M_SQRT2*(1<<23)) */
-#define COEFF_1 11863283LL
-
-/** lrint(M_SQRT2*cos(5*M_PI/12)*(1<<23)) */
-#define COEFF_2  3070444LL
-
-/**
- * Calculate 6-point IDCT of the pre-mantissas.
- * All calculations are 24-bit fixed-point.
- */
-static void idct6(int pre_mant[6])
-{
-    int tmp;
-    int even0, even1, even2, odd0, odd1, odd2;
-
-    odd1 = pre_mant[1] - pre_mant[3] - pre_mant[5];
-
-    even2 = ( pre_mant[2]                * COEFF_0) >> 23;
-    tmp   = ( pre_mant[4]                * COEFF_1) >> 23;
-    odd0  = ((pre_mant[1] + pre_mant[5]) * COEFF_2) >> 23;
-
-    even0 = pre_mant[0] + (tmp >> 1);
-    even1 = pre_mant[0] - tmp;
-
-    tmp = even0;
-    even0 = tmp + even2;
-    even2 = tmp - even2;
-
-    tmp = odd0;
-    odd0 = tmp + pre_mant[1] + pre_mant[3];
-    odd2 = tmp + pre_mant[5] - pre_mant[3];
-
-    pre_mant[0] = even0 + odd0;
-    pre_mant[1] = even1 + odd1;
-    pre_mant[2] = even2 + odd2;
-    pre_mant[3] = even2 - odd2;
-    pre_mant[4] = even1 - odd1;
-    pre_mant[5] = even0 - odd0;
-}
-
-void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
-{
-    int bin, blk, gs;
-    int end_bap, gaq_mode;
-    GetBitContext *gbc = &s->gbc;
-    int gaq_gain[AC3_MAX_COEFS];
-
-    gaq_mode = get_bits(gbc, 2);
-    end_bap = (gaq_mode < 2) ? 12 : 17;
-
-    /* if GAQ gain is used, decode gain codes for bins with hebap between
-       8 and end_bap */
-    gs = 0;
-    if (gaq_mode == EAC3_GAQ_12 || gaq_mode == EAC3_GAQ_14) {
-        /* read 1-bit GAQ gain codes */
-        for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
-            if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < end_bap)
-                gaq_gain[gs++] = get_bits1(gbc) << (gaq_mode-1);
-        }
-    } else if (gaq_mode == EAC3_GAQ_124) {
-        /* read 1.67-bit GAQ gain codes (3 codes in 5 bits) */
-        int gc = 2;
-        for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
-            if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < 17) {
-                if (gc++ == 2) {
-                    int group_code = get_bits(gbc, 5);
-                    if (group_code > 26) {
-                        av_log(s->avctx, AV_LOG_WARNING, "GAQ gain group code out-of-range\n");
-                        group_code = 26;
-                    }
-                    gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][0];
-                    gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][1];
-                    gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][2];
-                    gc = 0;
-                }
-            }
-        }
-    }
-
-    gs=0;
-    for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
-        int hebap = s->bap[ch][bin];
-        int bits = ff_eac3_bits_vs_hebap[hebap];
-        if (!hebap) {
-            /* zero-mantissa dithering */
-            for (blk = 0; blk < 6; blk++) {
-                s->pre_mantissa[ch][bin][blk] = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
-            }
-        } else if (hebap < 8) {
-            /* Vector Quantization */
-            int v = get_bits(gbc, bits);
-            for (blk = 0; blk < 6; blk++) {
-                s->pre_mantissa[ch][bin][blk] = ff_eac3_mantissa_vq[hebap][v][blk] << 8;
-            }
-        } else {
-            /* Gain Adaptive Quantization */
-            int gbits, log_gain;
-            if (gaq_mode != EAC3_GAQ_NO && hebap < end_bap) {
-                log_gain = gaq_gain[gs++];
-            } else {
-                log_gain = 0;
-            }
-            gbits = bits - log_gain;
-
-            for (blk = 0; blk < 6; blk++) {
-                int mant = get_sbits(gbc, gbits);
-                if (log_gain && mant == -(1 << (gbits-1))) {
-                    /* large mantissa */
-                    int b;
-                    int mbits = bits - (2 - log_gain);
-                    mant = get_sbits(gbc, mbits);
-                    mant <<= (23 - (mbits - 1));
-                    /* remap mantissa value to correct for asymmetric quantization */
-                    if (mant >= 0)
-                        b = 1 << (23 - log_gain);
-                    else
-                        b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] << 8;
-                    mant += ((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * (int64_t)mant) >> 15) + b;
-                } else {
-                    /* small mantissa, no GAQ, or Gk=1 */
-                    mant <<= 24 - bits;
-                    if (!log_gain) {
-                        /* remap mantissa value for no GAQ or Gk=1 */
-                        mant += (ff_eac3_gaq_remap_1[hebap-8] * (int64_t)mant) >> 15;
-                    }
-                }
-                s->pre_mantissa[ch][bin][blk] = mant;
-            }
-        }
-        idct6(s->pre_mantissa[ch][bin]);
-    }
-}
-
-int ff_eac3_parse_header(AC3DecodeContext *s)
-{
-    int i, blk, ch;
-    int ac3_exponent_strategy, parse_aht_info, parse_spx_atten_data;
-    int parse_transient_proc_info;
-    int num_cpl_blocks;
-    GetBitContext *gbc = &s->gbc;
-
-    /* An E-AC-3 stream can have multiple independent streams which the
-       application can select from. each independent stream can also contain
-       dependent streams which are used to add or replace channels. */
-    if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
-        avpriv_request_sample(s->avctx, "Dependent substream decoding");
-        return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
-    } else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
-        av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
-        return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
-    }
-
-    /* The substream id indicates which substream this frame belongs to. each
-       independent stream has its own substream id, and the dependent streams
-       associated to an independent stream have matching substream id's. */
-    if (s->substreamid) {
-        /* only decode substream with id=0. skip any additional substreams. */
-        avpriv_request_sample(s->avctx, "Additional substreams");
-        return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
-    }
-
-    if (s->bit_alloc_params.sr_code == EAC3_SR_CODE_REDUCED) {
-        /* The E-AC-3 specification does not tell how to handle reduced sample
-           rates in bit allocation.  The best assumption would be that it is
-           handled like AC-3 DolbyNet, but we cannot be sure until we have a
-           sample which utilizes this feature. */
-        avpriv_request_sample(s->avctx, "Reduced sampling rate");
-        return AVERROR_PATCHWELCOME;
-    }
-    skip_bits(gbc, 5); // skip bitstream id
-
-    /* volume control params */
-    for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
-        skip_bits(gbc, 5); // skip dialog normalization
-        if (get_bits1(gbc)) {
-            skip_bits(gbc, 8); // skip compression gain word
-        }
-    }
-
-    /* dependent stream channel map */
-    if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
-        if (get_bits1(gbc)) {
-            skip_bits(gbc, 16); // skip custom channel map
-        }
-    }
-
-    /* mixing metadata */
-    if (get_bits1(gbc)) {
-        /* center and surround mix levels */
-        if (s->channel_mode > AC3_CHMODE_STEREO) {
-            s->preferred_downmix = get_bits(gbc, 2);
-            if (s->channel_mode & 1) {
-                /* if three front channels exist */
-                s->center_mix_level_ltrt = get_bits(gbc, 3);
-                s->center_mix_level      = get_bits(gbc, 3);
-            }
-            if (s->channel_mode & 4) {
-                /* if a surround channel exists */
-                s->surround_mix_level_ltrt = av_clip(get_bits(gbc, 3), 3, 7);
-                s->surround_mix_level      = av_clip(get_bits(gbc, 3), 3, 7);
-            }
-        }
-
-        /* lfe mix level */
-        if (s->lfe_on && (s->lfe_mix_level_exists = get_bits1(gbc))) {
-            s->lfe_mix_level = get_bits(gbc, 5);
-        }
-
-        /* info for mixing with other streams and substreams */
-        if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT) {
-            for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
-                // TODO: apply program scale factor
-                if (get_bits1(gbc)) {
-                    skip_bits(gbc, 6);  // skip program scale factor
-                }
-            }
-            if (get_bits1(gbc)) {
-                skip_bits(gbc, 6);  // skip external program scale factor
-            }
-            /* skip mixing parameter data */
-            switch(get_bits(gbc, 2)) {
-                case 1: skip_bits(gbc, 5);  break;
-                case 2: skip_bits(gbc, 12); break;
-                case 3: {
-                    int mix_data_size = (get_bits(gbc, 5) + 2) << 3;
-                    skip_bits_long(gbc, mix_data_size);
-                    break;
-                }
-            }
-            /* skip pan information for mono or dual mono source */
-            if (s->channel_mode < AC3_CHMODE_STEREO) {
-                for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
-                    if (get_bits1(gbc)) {
-                        /* note: this is not in the ATSC A/52B specification
-                           reference: ETSI TS 102 366 V1.1.1
-                                      section: E.1.3.1.25 */
-                        skip_bits(gbc, 8);  // skip pan mean direction index
-                        skip_bits(gbc, 6);  // skip reserved paninfo bits
-                    }
-                }
-            }
-            /* skip mixing configuration information */
-            if (get_bits1(gbc)) {
-                for (blk = 0; blk < s->num_blocks; blk++) {
-                    if (s->num_blocks == 1 || get_bits1(gbc)) {
-                        skip_bits(gbc, 5);
-                    }
-                }
-            }
-        }
-    }
-
-    /* informational metadata */
-    if (get_bits1(gbc)) {
-        s->bitstream_mode = get_bits(gbc, 3);
-        skip_bits(gbc, 2); // skip copyright bit and original bitstream bit
-        if (s->channel_mode == AC3_CHMODE_STEREO) {
-            s->dolby_surround_mode  = get_bits(gbc, 2);
-            s->dolby_headphone_mode = get_bits(gbc, 2);
-        }
-        if (s->channel_mode >= AC3_CHMODE_2F2R) {
-            s->dolby_surround_ex_mode = get_bits(gbc, 2);
-        }
-        for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
-            if (get_bits1(gbc)) {
-                skip_bits(gbc, 8); // skip mix level, room type, and A/D converter type
-            }
-        }
-        if (s->bit_alloc_params.sr_code != EAC3_SR_CODE_REDUCED) {
-            skip_bits1(gbc); // skip source sample rate code
-        }
-    }
-
-    /* converter synchronization flag
-       If frames are less than six blocks, this bit should be turned on
-       once every 6 blocks to indicate the start of a frame set.
-       reference: RFC 4598, Section 2.1.3  Frame Sets */
-    if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && s->num_blocks != 6) {
-        skip_bits1(gbc); // skip converter synchronization flag
-    }
-
-    /* original frame size code if this stream was converted from AC-3 */
-    if (s->frame_type == EAC3_FRAME_TYPE_AC3_CONVERT &&
-            (s->num_blocks == 6 || get_bits1(gbc))) {
-        skip_bits(gbc, 6); // skip frame size code
-    }
-
-    /* additional bitstream info */
-    if (get_bits1(gbc)) {
-        int addbsil = get_bits(gbc, 6);
-        for (i = 0; i < addbsil + 1; i++) {
-            skip_bits(gbc, 8); // skip additional bit stream info
-        }
-    }
-
-    /* audio frame syntax flags, strategy data, and per-frame data */
-
-    if (s->num_blocks == 6) {
-        ac3_exponent_strategy = get_bits1(gbc);
-        parse_aht_info        = get_bits1(gbc);
-    } else {
-        /* less than 6 blocks, so use AC-3-style exponent strategy syntax, and
-           do not use AHT */
-        ac3_exponent_strategy = 1;
-        parse_aht_info = 0;
-    }
-
-    s->snr_offset_strategy    = get_bits(gbc, 2);
-    parse_transient_proc_info = get_bits1(gbc);
-
-    s->block_switch_syntax = get_bits1(gbc);
-    if (!s->block_switch_syntax)
-        memset(s->block_switch, 0, sizeof(s->block_switch));
-
-    s->dither_flag_syntax = get_bits1(gbc);
-    if (!s->dither_flag_syntax) {
-        for (ch = 1; ch <= s->fbw_channels; ch++)
-            s->dither_flag[ch] = 1;
-    }
-    s->dither_flag[CPL_CH] = s->dither_flag[s->lfe_ch] = 0;
-
-    s->bit_allocation_syntax = get_bits1(gbc);
-    if (!s->bit_allocation_syntax) {
-        /* set default bit allocation parameters */
-        s->bit_alloc_params.slow_decay = ff_ac3_slow_decay_tab[2];
-        s->bit_alloc_params.fast_decay = ff_ac3_fast_decay_tab[1];
-        s->bit_alloc_params.slow_gain  = ff_ac3_slow_gain_tab [1];
-        s->bit_alloc_params.db_per_bit = ff_ac3_db_per_bit_tab[2];
-        s->bit_alloc_params.floor      = ff_ac3_floor_tab     [7];
-    }
-
-    s->fast_gain_syntax  = get_bits1(gbc);
-    s->dba_syntax        = get_bits1(gbc);
-    s->skip_syntax       = get_bits1(gbc);
-    parse_spx_atten_data = get_bits1(gbc);
-
-    /* coupling strategy occurrence and coupling use per block */
-    num_cpl_blocks = 0;
-    if (s->channel_mode > 1) {
-        for (blk = 0; blk < s->num_blocks; blk++) {
-            s->cpl_strategy_exists[blk] = (!blk || get_bits1(gbc));
-            if (s->cpl_strategy_exists[blk]) {
-                s->cpl_in_use[blk] = get_bits1(gbc);
-            } else {
-                s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
-            }
-            num_cpl_blocks += s->cpl_in_use[blk];
-        }
-    } else {
-        memset(s->cpl_in_use, 0, sizeof(s->cpl_in_use));
-    }
-
-    /* exponent strategy data */
-    if (ac3_exponent_strategy) {
-        /* AC-3-style exponent strategy syntax */
-        for (blk = 0; blk < s->num_blocks; blk++) {
-            for (ch = !s->cpl_in_use[blk]; ch <= s->fbw_channels; ch++) {
-                s->exp_strategy[blk][ch] = get_bits(gbc, 2);
-            }
-        }
-    } else {
-        /* LUT-based exponent strategy syntax */
-        for (ch = !((s->channel_mode > 1) && num_cpl_blocks); ch <= s->fbw_channels; ch++) {
-            int frmchexpstr = get_bits(gbc, 5);
-            for (blk = 0; blk < 6; blk++) {
-                s->exp_strategy[blk][ch] = ff_eac3_frm_expstr[frmchexpstr][blk];
-            }
-        }
-    }
-    /* LFE exponent strategy */
-    if (s->lfe_on) {
-        for (blk = 0; blk < s->num_blocks; blk++) {
-            s->exp_strategy[blk][s->lfe_ch] = get_bits1(gbc);
-        }
-    }
-    /* original exponent strategies if this stream was converted from AC-3 */
-    if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT &&
-            (s->num_blocks == 6 || get_bits1(gbc))) {
-        skip_bits(gbc, 5 * s->fbw_channels); // skip converter channel exponent strategy
-    }
-
-    /* determine which channels use AHT */
-    if (parse_aht_info) {
-        /* For AHT to be used, all non-zero blocks must reuse exponents from
-           the first block.  Furthermore, for AHT to be used in the coupling
-           channel, all blocks must use coupling and use the same coupling
-           strategy. */
-        s->channel_uses_aht[CPL_CH]=0;
-        for (ch = (num_cpl_blocks != 6); ch <= s->channels; ch++) {
-            int use_aht = 1;
-            for (blk = 1; blk < 6; blk++) {
-                if ((s->exp_strategy[blk][ch] != EXP_REUSE) ||
-                        (!ch && s->cpl_strategy_exists[blk])) {
-                    use_aht = 0;
-                    break;
-                }
-            }
-            s->channel_uses_aht[ch] = use_aht && get_bits1(gbc);
-        }
-    } else {
-        memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));
-    }
-
-    /* per-frame SNR offset */
-    if (!s->snr_offset_strategy) {
-        int csnroffst = (get_bits(gbc, 6) - 15) << 4;
-        int snroffst = (csnroffst + get_bits(gbc, 4)) << 2;
-        for (ch = 0; ch <= s->channels; ch++)
-            s->snr_offset[ch] = snroffst;
-    }
-
-    /* transient pre-noise processing data */
-    if (parse_transient_proc_info) {
-        for (ch = 1; ch <= s->fbw_channels; ch++) {
-            if (get_bits1(gbc)) { // channel in transient processing
-                skip_bits(gbc, 10); // skip transient processing location
-                skip_bits(gbc, 8);  // skip transient processing length
-            }
-        }
-    }
-
-    /* spectral extension attenuation data */
-    for (ch = 1; ch <= s->fbw_channels; ch++) {
-        if (parse_spx_atten_data && get_bits1(gbc)) {
-            s->spx_atten_code[ch] = get_bits(gbc, 5);
-        } else {
-            s->spx_atten_code[ch] = -1;
-        }
-    }
-
-    /* block start information */
-    if (s->num_blocks > 1 && get_bits1(gbc)) {
-        /* reference: Section E2.3.2.27
-           nblkstrtbits = (numblks - 1) * (4 + ceiling(log2(words_per_frame)))
-           The spec does not say what this data is or what it's used for.
-           It is likely the offset of each block within the frame. */
-        int block_start_bits = (s->num_blocks-1) * (4 + av_log2(s->frame_size-2));
-        skip_bits_long(gbc, block_start_bits);
-        avpriv_request_sample(s->avctx, "Block start info");
-    }
-
-    /* syntax state initialization */
-    for (ch = 1; ch <= s->fbw_channels; ch++) {
-        s->first_spx_coords[ch] = 1;
-        s->first_cpl_coords[ch] = 1;
-    }
-    s->first_cpl_leak = 1;
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/eac3enc.c b/deps/libav/libavcodec/eac3enc.c
deleted file mode 100644
index c238fc1..0000000
--- a/deps/libav/libavcodec/eac3enc.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * E-AC-3 encoder
- * Copyright (c) 2011 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * E-AC-3 encoder
- */
-
-#define CONFIG_AC3ENC_FLOAT 1
-
-#include "libavutil/attributes.h"
-#include "ac3enc.h"
-#include "eac3enc.h"
-#include "eac3_data.h"
-
-
-#define AC3ENC_TYPE AC3ENC_TYPE_EAC3
-#include "ac3enc_opts_template.c"
-static const AVClass eac3enc_class = { "E-AC-3 Encoder", av_default_item_name,
-                                       ac3_options, LIBAVUTIL_VERSION_INT };
-
-
-/**
- * LUT for finding a matching frame exponent strategy index from a set of
- * exponent strategies for a single channel across all 6 blocks.
- */
-static int8_t eac3_frame_expstr_index_tab[3][4][4][4][4][4];
-
-
-av_cold void ff_eac3_exponent_init(void)
-{
-    int i;
-
-    memset(eac3_frame_expstr_index_tab, -1, sizeof(eac3_frame_expstr_index_tab));
-    for (i = 0; i < 32; i++) {
-        eac3_frame_expstr_index_tab[ff_eac3_frm_expstr[i][0]-1]
-                                   [ff_eac3_frm_expstr[i][1]]
-                                   [ff_eac3_frm_expstr[i][2]]
-                                   [ff_eac3_frm_expstr[i][3]]
-                                   [ff_eac3_frm_expstr[i][4]]
-                                   [ff_eac3_frm_expstr[i][5]] = i;
-    }
-}
-
-
-void ff_eac3_get_frame_exp_strategy(AC3EncodeContext *s)
-{
-    int ch;
-
-    if (s->num_blocks < 6) {
-        s->use_frame_exp_strategy = 0;
-        return;
-    }
-
-    s->use_frame_exp_strategy = 1;
-    for (ch = !s->cpl_on; ch <= s->fbw_channels; ch++) {
-        int expstr = eac3_frame_expstr_index_tab[s->exp_strategy[ch][0]-1]
-                                                [s->exp_strategy[ch][1]]
-                                                [s->exp_strategy[ch][2]]
-                                                [s->exp_strategy[ch][3]]
-                                                [s->exp_strategy[ch][4]]
-                                                [s->exp_strategy[ch][5]];
-        if (expstr < 0) {
-            s->use_frame_exp_strategy = 0;
-            break;
-        }
-        s->frame_exp_strategy[ch] = expstr;
-    }
-}
-
-
-
-void ff_eac3_set_cpl_states(AC3EncodeContext *s)
-{
-    int ch, blk;
-    int first_cpl_coords[AC3_MAX_CHANNELS];
-
-    /* set first cpl coords */
-    for (ch = 1; ch <= s->fbw_channels; ch++)
-        first_cpl_coords[ch] = 1;
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        for (ch = 1; ch <= s->fbw_channels; ch++) {
-            if (block->channel_in_cpl[ch]) {
-                if (first_cpl_coords[ch]) {
-                    block->new_cpl_coords[ch] = 2;
-                    first_cpl_coords[ch]  = 0;
-                }
-            } else {
-                first_cpl_coords[ch] = 1;
-            }
-        }
-    }
-
-    /* set first cpl leak */
-    for (blk = 0; blk < s->num_blocks; blk++) {
-        AC3Block *block = &s->blocks[blk];
-        if (block->cpl_in_use) {
-            block->new_cpl_leak = 2;
-            break;
-        }
-    }
-}
-
-
-void ff_eac3_output_frame_header(AC3EncodeContext *s)
-{
-    int blk, ch;
-    AC3EncOptions *opt = &s->options;
-
-    put_bits(&s->pb, 16, 0x0b77);                   /* sync word */
-
-    /* BSI header */
-    put_bits(&s->pb,  2, 0);                        /* stream type = independent */
-    put_bits(&s->pb,  3, 0);                        /* substream id = 0 */
-    put_bits(&s->pb, 11, (s->frame_size / 2) - 1);  /* frame size */
-    if (s->bit_alloc.sr_shift) {
-        put_bits(&s->pb, 2, 0x3);                   /* fscod2 */
-        put_bits(&s->pb, 2, s->bit_alloc.sr_code);  /* sample rate code */
-    } else {
-        put_bits(&s->pb, 2, s->bit_alloc.sr_code);  /* sample rate code */
-        put_bits(&s->pb, 2, s->num_blks_code);      /* number of blocks */
-    }
-    put_bits(&s->pb, 3, s->channel_mode);           /* audio coding mode */
-    put_bits(&s->pb, 1, s->lfe_on);                 /* LFE channel indicator */
-    put_bits(&s->pb, 5, s->bitstream_id);           /* bitstream id (EAC3=16) */
-    put_bits(&s->pb, 5, -opt->dialogue_level);      /* dialogue normalization level */
-    put_bits(&s->pb, 1, 0);                         /* no compression gain */
-    /* mixing metadata*/
-    put_bits(&s->pb, 1, opt->eac3_mixing_metadata);
-    if (opt->eac3_mixing_metadata) {
-        if (s->channel_mode > AC3_CHMODE_STEREO)
-            put_bits(&s->pb, 2, opt->preferred_stereo_downmix);
-        if (s->has_center) {
-            put_bits(&s->pb, 3, s->ltrt_center_mix_level);
-            put_bits(&s->pb, 3, s->loro_center_mix_level);
-        }
-        if (s->has_surround) {
-            put_bits(&s->pb, 3, s->ltrt_surround_mix_level);
-            put_bits(&s->pb, 3, s->loro_surround_mix_level);
-        }
-        if (s->lfe_on)
-            put_bits(&s->pb, 1, 0);
-        put_bits(&s->pb, 1, 0);                     /* no program scale */
-        put_bits(&s->pb, 1, 0);                     /* no ext program scale */
-        put_bits(&s->pb, 2, 0);                     /* no mixing parameters */
-        if (s->channel_mode < AC3_CHMODE_STEREO)
-            put_bits(&s->pb, 1, 0);                 /* no pan info */
-        put_bits(&s->pb, 1, 0);                     /* no frame mix config info */
-    }
-    /* info metadata*/
-    put_bits(&s->pb, 1, opt->eac3_info_metadata);
-    if (opt->eac3_info_metadata) {
-        put_bits(&s->pb, 3, s->bitstream_mode);
-        put_bits(&s->pb, 1, opt->copyright);
-        put_bits(&s->pb, 1, opt->original);
-        if (s->channel_mode == AC3_CHMODE_STEREO) {
-            put_bits(&s->pb, 2, opt->dolby_surround_mode);
-            put_bits(&s->pb, 2, opt->dolby_headphone_mode);
-        }
-        if (s->channel_mode >= AC3_CHMODE_2F2R)
-            put_bits(&s->pb, 2, opt->dolby_surround_ex_mode);
-        put_bits(&s->pb, 1, opt->audio_production_info);
-        if (opt->audio_production_info) {
-            put_bits(&s->pb, 5, opt->mixing_level - 80);
-            put_bits(&s->pb, 2, opt->room_type);
-            put_bits(&s->pb, 1, opt->ad_converter_type);
-        }
-        put_bits(&s->pb, 1, 0);
-    }
-    if (s->num_blocks != 6)
-        put_bits(&s->pb, 1, !(s->avctx->frame_number % 6)); /* converter sync flag */
-    put_bits(&s->pb, 1, 0);                         /* no additional bit stream info */
-
-    /* frame header */
-    if (s->num_blocks == 6) {
-    put_bits(&s->pb, 1, !s->use_frame_exp_strategy);/* exponent strategy syntax */
-    put_bits(&s->pb, 1, 0);                         /* aht enabled = no */
-    }
-    put_bits(&s->pb, 2, 0);                         /* snr offset strategy = 1 */
-    put_bits(&s->pb, 1, 0);                         /* transient pre-noise processing enabled = no */
-    put_bits(&s->pb, 1, 0);                         /* block switch syntax enabled = no */
-    put_bits(&s->pb, 1, 0);                         /* dither flag syntax enabled = no */
-    put_bits(&s->pb, 1, 0);                         /* bit allocation model syntax enabled = no */
-    put_bits(&s->pb, 1, 0);                         /* fast gain codes enabled = no */
-    put_bits(&s->pb, 1, 0);                         /* dba syntax enabled = no */
-    put_bits(&s->pb, 1, 0);                         /* skip field syntax enabled = no */
-    put_bits(&s->pb, 1, 0);                         /* spx enabled = no */
-    /* coupling strategy use flags */
-    if (s->channel_mode > AC3_CHMODE_MONO) {
-        put_bits(&s->pb, 1, s->blocks[0].cpl_in_use);
-        for (blk = 1; blk < s->num_blocks; blk++) {
-            AC3Block *block = &s->blocks[blk];
-            put_bits(&s->pb, 1, block->new_cpl_strategy);
-            if (block->new_cpl_strategy)
-                put_bits(&s->pb, 1, block->cpl_in_use);
-        }
-    }
-    /* exponent strategy */
-    if (s->use_frame_exp_strategy) {
-        for (ch = !s->cpl_on; ch <= s->fbw_channels; ch++)
-            put_bits(&s->pb, 5, s->frame_exp_strategy[ch]);
-    } else {
-        for (blk = 0; blk < s->num_blocks; blk++)
-            for (ch = !s->blocks[blk].cpl_in_use; ch <= s->fbw_channels; ch++)
-                put_bits(&s->pb, 2, s->exp_strategy[ch][blk]);
-    }
-    if (s->lfe_on) {
-        for (blk = 0; blk < s->num_blocks; blk++)
-            put_bits(&s->pb, 1, s->exp_strategy[s->lfe_channel][blk]);
-    }
-    /* E-AC-3 to AC-3 converter exponent strategy (not optional when num blocks == 6) */
-    if (s->num_blocks != 6) {
-        put_bits(&s->pb, 1, 0);
-    } else {
-    for (ch = 1; ch <= s->fbw_channels; ch++) {
-        if (s->use_frame_exp_strategy)
-            put_bits(&s->pb, 5, s->frame_exp_strategy[ch]);
-        else
-            put_bits(&s->pb, 5, 0);
-    }
-    }
-    /* snr offsets */
-    put_bits(&s->pb, 6, s->coarse_snr_offset);
-    put_bits(&s->pb, 4, s->fine_snr_offset[1]);
-    /* block start info */
-    if (s->num_blocks > 1)
-        put_bits(&s->pb, 1, 0);
-}
-
-
-#if CONFIG_EAC3_ENCODER
-AVCodec ff_eac3_encoder = {
-    .name            = "eac3",
-    .long_name       = NULL_IF_CONFIG_SMALL("ATSC A/52 E-AC-3"),
-    .type            = AVMEDIA_TYPE_AUDIO,
-    .id              = AV_CODEC_ID_EAC3,
-    .priv_data_size  = sizeof(AC3EncodeContext),
-    .init            = ff_ac3_encode_init,
-    .encode2         = ff_ac3_float_encode_frame,
-    .close           = ff_ac3_encode_close,
-    .sample_fmts     = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-    .priv_class      = &eac3enc_class,
-    .channel_layouts = ff_ac3_channel_layouts,
-    .defaults        = ac3_defaults,
-};
-#endif
diff --git a/deps/libav/libavcodec/eac3enc.h b/deps/libav/libavcodec/eac3enc.h
deleted file mode 100644
index a92a24c..0000000
--- a/deps/libav/libavcodec/eac3enc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * E-AC-3 encoder
- * Copyright (c) 2011 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * E-AC-3 encoder
- */
-
-#ifndef AVCODEC_EAC3ENC_H
-#define AVCODEC_EAC3ENC_H
-
-#include "ac3enc.h"
-
-/**
- * Initialize E-AC-3 exponent tables.
- */
-void ff_eac3_exponent_init(void);
-
-/**
- * Determine frame exponent strategy use and indices.
- */
-void ff_eac3_get_frame_exp_strategy(AC3EncodeContext *s);
-
-/**
- * Set coupling states.
- * This determines whether certain flags must be written to the bitstream or
- * whether they will be implicitly already known by the decoder.
- */
-void ff_eac3_set_cpl_states(AC3EncodeContext *s);
-
-/**
- * Write the E-AC-3 frame header to the output bitstream.
- */
-void ff_eac3_output_frame_header(AC3EncodeContext *s);
-
-#endif /* AVCODEC_EAC3ENC_H */
diff --git a/deps/libav/libavcodec/eacmv.c b/deps/libav/libavcodec/eacmv.c
deleted file mode 100644
index 6adadb1..0000000
--- a/deps/libav/libavcodec/eacmv.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Electronic Arts CMV Video Decoder
- * Copyright (c) 2007-2008 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-/**
- * @file
- * Electronic Arts CMV Video Decoder
- * by Peter Ross (pross at xvid.org)
- *
- * Technical details here:
- * http://wiki.multimedia.cx/index.php?title=Electronic_Arts_CMV
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-
-typedef struct CmvContext {
-    AVCodecContext *avctx;
-    AVFrame *last_frame;   ///< last
-    AVFrame *last2_frame;  ///< second-last
-    int width, height;
-    unsigned int palette[AVPALETTE_COUNT];
-} CmvContext;
-
-static av_cold int cmv_decode_init(AVCodecContext *avctx){
-    CmvContext *s = avctx->priv_data;
-    s->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    s->last_frame  = av_frame_alloc();
-    s->last2_frame = av_frame_alloc();
-    if (!s->last_frame || !s->last2_frame) {
-        av_frame_free(&s->last_frame);
-        av_frame_free(&s->last2_frame);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static void cmv_decode_intra(CmvContext * s, AVFrame *frame,
-                             const uint8_t *buf, const uint8_t *buf_end)
-{
-    unsigned char *dst = frame->data[0];
-    int i;
-
-    for (i=0; i < s->avctx->height && buf_end - buf >= s->avctx->width; i++) {
-        memcpy(dst, buf, s->avctx->width);
-        dst += frame->linesize[0];
-        buf += s->avctx->width;
-    }
-}
-
-static void cmv_motcomp(unsigned char *dst, int dst_stride,
-                        const unsigned char *src, int src_stride,
-                        int x, int y,
-                        int xoffset, int yoffset,
-                        int width, int height){
-    int i,j;
-
-    for(j=y;j<y+4;j++)
-    for(i=x;i<x+4;i++)
-    {
-        if (i+xoffset>=0 && i+xoffset<width &&
-            j+yoffset>=0 && j+yoffset<height) {
-            dst[j*dst_stride + i] = src[(j+yoffset)*src_stride + i+xoffset];
-        }else{
-            dst[j*dst_stride + i] = 0;
-        }
-    }
-}
-
-static void cmv_decode_inter(CmvContext *s, AVFrame *frame, const uint8_t *buf,
-                             const uint8_t *buf_end)
-{
-    const uint8_t *raw = buf + (s->avctx->width*s->avctx->height/16);
-    int x,y,i;
-
-    i = 0;
-    for(y=0; y<s->avctx->height/4; y++)
-    for(x=0; x<s->avctx->width/4 && buf_end - buf > i; x++) {
-        if (buf[i]==0xFF) {
-            unsigned char *dst = frame->data[0] + (y*4)*frame->linesize[0] + x*4;
-            if (raw+16<buf_end && *raw==0xFF) { /* intra */
-                raw++;
-                memcpy(dst, raw, 4);
-                memcpy(dst +     frame->linesize[0], raw+4, 4);
-                memcpy(dst + 2 * frame->linesize[0], raw+8, 4);
-                memcpy(dst + 3 * frame->linesize[0], raw+12, 4);
-                raw+=16;
-            }else if(raw<buf_end) {  /* inter using second-last frame as reference */
-                int xoffset = (*raw & 0xF) - 7;
-                int yoffset = ((*raw >> 4)) - 7;
-                if (s->last2_frame->data[0])
-                    cmv_motcomp(frame->data[0], frame->linesize[0],
-                                s->last2_frame->data[0], s->last2_frame->linesize[0],
-                                x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
-                raw++;
-            }
-        }else{  /* inter using last frame as reference */
-            int xoffset = (buf[i] & 0xF) - 7;
-            int yoffset = ((buf[i] >> 4)) - 7;
-            if (s->last_frame->data[0])
-                cmv_motcomp(frame->data[0], frame->linesize[0],
-                            s->last_frame->data[0], s->last_frame->linesize[0],
-                            x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
-        }
-        i++;
-    }
-}
-
-static int cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
-{
-    int pal_start, pal_count, i, ret, fps;
-
-    if(buf_end - buf < 16) {
-        av_log(s->avctx, AV_LOG_WARNING, "truncated header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->width  = AV_RL16(&buf[4]);
-    s->height = AV_RL16(&buf[6]);
-
-    if (s->width  != s->avctx->width ||
-        s->height != s->avctx->height) {
-        av_frame_unref(s->last_frame);
-        av_frame_unref(s->last2_frame);
-    }
-
-    ret = ff_set_dimensions(s->avctx, s->width, s->height);
-    if (ret < 0)
-        return ret;
-
-    fps = AV_RL16(&buf[10]);
-    if (fps > 0)
-        s->avctx->time_base = (AVRational){ 1, fps };
-
-    pal_start = AV_RL16(&buf[12]);
-    pal_count = AV_RL16(&buf[14]);
-
-    buf += 16;
-    for (i=pal_start; i<pal_start+pal_count && i<AVPALETTE_COUNT && buf_end - buf >= 3; i++) {
-        s->palette[i] = AV_RB24(buf);
-        buf += 3;
-    }
-
-    return 0;
-}
-
-#define EA_PREAMBLE_SIZE 8
-#define MVIh_TAG MKTAG('M', 'V', 'I', 'h')
-
-static int cmv_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    CmvContext *s = avctx->priv_data;
-    const uint8_t *buf_end = buf + buf_size;
-    AVFrame *frame = data;
-    int ret;
-
-    if (buf_end - buf < EA_PREAMBLE_SIZE)
-        return AVERROR_INVALIDDATA;
-
-    if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) {
-        ret = cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end);
-        if (ret < 0)
-            return ret;
-        return buf_size;
-    }
-
-    if (av_image_check_size(s->width, s->height, 0, s->avctx))
-        return -1;
-
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    memcpy(frame->data[1], s->palette, AVPALETTE_SIZE);
-
-    buf += EA_PREAMBLE_SIZE;
-    if ((buf[0]&1)) {  // subtype
-        cmv_decode_inter(s, frame, buf+2, buf_end);
-        frame->key_frame = 0;
-        frame->pict_type = AV_PICTURE_TYPE_P;
-    }else{
-        frame->key_frame = 1;
-        frame->pict_type = AV_PICTURE_TYPE_I;
-        cmv_decode_intra(s, frame, buf+2, buf_end);
-    }
-
-    av_frame_unref(s->last2_frame);
-    av_frame_move_ref(s->last2_frame, s->last_frame);
-    if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int cmv_decode_end(AVCodecContext *avctx){
-    CmvContext *s = avctx->priv_data;
-
-    av_frame_free(&s->last_frame);
-    av_frame_free(&s->last2_frame);
-
-    return 0;
-}
-
-AVCodec ff_eacmv_decoder = {
-    .name           = "eacmv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CMV,
-    .priv_data_size = sizeof(CmvContext),
-    .init           = cmv_decode_init,
-    .close          = cmv_decode_end,
-    .decode         = cmv_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/eaidct.c b/deps/libav/libavcodec/eaidct.c
deleted file mode 100644
index 5b2db44..0000000
--- a/deps/libav/libavcodec/eaidct.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Electronic Arts TGQ/TQI/MAD IDCT algorithm
- * Copyright (c) 2007-2008 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Electronic Arts TGQ/TQI/MAD IDCT algorithm
- * @author Peter Ross <pross at xvid.org>
- */
-
-#include "eaidct.h"
-#include "libavutil/common.h"
-
-#define ASQRT 181 /* (1/sqrt(2))<<8 */
-#define A4    669 /* cos(pi/8)*sqrt(2)<<9 */
-#define A2    277 /* sin(pi/8)*sqrt(2)<<9 */
-#define A5    196 /* sin(pi/8)<<9 */
-
-#define IDCT_TRANSFORM(dest,s0,s1,s2,s3,s4,s5,s6,s7,d0,d1,d2,d3,d4,d5,d6,d7,munge,src) {\
-    const int a1 = (src)[s1] + (src)[s7]; \
-    const int a7 = (src)[s1] - (src)[s7]; \
-    const int a5 = (src)[s5] + (src)[s3]; \
-    const int a3 = (src)[s5] - (src)[s3]; \
-    const int a2 = (src)[s2] + (src)[s6]; \
-    const int a6 = (ASQRT*((src)[s2] - (src)[s6]))>>8; \
-    const int a0 = (src)[s0] + (src)[s4]; \
-    const int a4 = (src)[s0] - (src)[s4]; \
-    const int b0 = (((A4-A5)*a7 - A5*a3)>>9) + a1+a5; \
-    const int b1 = (((A4-A5)*a7 - A5*a3)>>9) + ((ASQRT*(a1-a5))>>8); \
-    const int b2 = (((A2+A5)*a3 + A5*a7)>>9) + ((ASQRT*(a1-a5))>>8); \
-    const int b3 =  ((A2+A5)*a3 + A5*a7)>>9; \
-    (dest)[d0] = munge(a0+a2+a6+b0); \
-    (dest)[d1] = munge(a4+a6   +b1); \
-    (dest)[d2] = munge(a4-a6   +b2); \
-    (dest)[d3] = munge(a0-a2-a6+b3); \
-    (dest)[d4] = munge(a0-a2-a6-b3); \
-    (dest)[d5] = munge(a4-a6   -b2); \
-    (dest)[d6] = munge(a4+a6   -b1); \
-    (dest)[d7] = munge(a0+a2+a6-b0); \
-}
-/* end IDCT_TRANSFORM macro */
-
-#define MUNGE_NONE(x) (x)
-#define IDCT_COL(dest,src) IDCT_TRANSFORM(dest,0,8,16,24,32,40,48,56,0,8,16,24,32,40,48,56,MUNGE_NONE,src)
-
-#define MUNGE_8BIT(x) av_clip_uint8((x)>>4)
-#define IDCT_ROW(dest,src) IDCT_TRANSFORM(dest,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,MUNGE_8BIT,src)
-
-static inline void ea_idct_col(int16_t *dest, const int16_t *src) {
-    if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) {
-        dest[0]  =
-        dest[8]  =
-        dest[16] =
-        dest[24] =
-        dest[32] =
-        dest[40] =
-        dest[48] =
-        dest[56] = src[0];
-    }else
-        IDCT_COL(dest, src);
-}
-
-void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block) {
-    int i;
-    int16_t temp[64];
-    block[0] += 4;
-    for (i=0; i<8; i++)
-        ea_idct_col(&temp[i], &block[i]);
-    for (i=0; i<8; i++)
-        IDCT_ROW( (&dest[i*linesize]), (&temp[8*i]) );
-}
diff --git a/deps/libav/libavcodec/eaidct.h b/deps/libav/libavcodec/eaidct.h
deleted file mode 100644
index e78de04..0000000
--- a/deps/libav/libavcodec/eaidct.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_EAIDCT_H
-#define AVCODEC_EAIDCT_H
-
-#include <stdint.h>
-
-void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block);
-
-#endif /* AVCODEC_EAIDCT_H */
diff --git a/deps/libav/libavcodec/eamad.c b/deps/libav/libavcodec/eamad.c
deleted file mode 100644
index 22070a4..0000000
--- a/deps/libav/libavcodec/eamad.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Electronic Arts Madcow Video Decoder
- * Copyright (c) 2007-2009 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-/**
- * @file
- * Electronic Arts Madcow Video Decoder
- * @author Peter Ross <pross at xvid.org>
- *
- * @see technical details at
- * http://wiki.multimedia.cx/index.php?title=Electronic_Arts_MAD
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "aandcttab.h"
-#include "eaidct.h"
-#include "internal.h"
-#include "mpeg12.h"
-#include "mpeg12data.h"
-#include "libavutil/imgutils.h"
-
-#define EA_PREAMBLE_SIZE    8
-#define MADk_TAG MKTAG('M', 'A', 'D', 'k')    /* MAD i-frame */
-#define MADm_TAG MKTAG('M', 'A', 'D', 'm')    /* MAD p-frame */
-#define MADe_TAG MKTAG('M', 'A', 'D', 'e')    /* MAD lqp-frame */
-
-typedef struct MadContext {
-    AVCodecContext *avctx;
-    DSPContext dsp;
-    AVFrame *last_frame;
-    GetBitContext gb;
-    void *bitstream_buf;
-    unsigned int bitstream_buf_size;
-    DECLARE_ALIGNED(16, int16_t, block)[64];
-    ScanTable scantable;
-    uint16_t quant_matrix[64];
-    int mb_x;
-    int mb_y;
-} MadContext;
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    MadContext *s = avctx->priv_data;
-    s->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    ff_dsputil_init(&s->dsp, avctx);
-    ff_init_scantable_permutation(s->dsp.idct_permutation, FF_NO_IDCT_PERM);
-    ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
-    ff_mpeg12_init_vlcs();
-
-    s->last_frame = av_frame_alloc();
-    if (!s->last_frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static inline void comp(unsigned char *dst, int dst_stride,
-                        unsigned char *src, int src_stride, int add)
-{
-    int j, i;
-    for (j=0; j<8; j++)
-        for (i=0; i<8; i++)
-            dst[j*dst_stride + i] = av_clip_uint8(src[j*src_stride + i] + add);
-}
-
-static inline void comp_block(MadContext *t, AVFrame *frame,
-                              int mb_x, int mb_y,
-                              int j, int mv_x, int mv_y, int add)
-{
-    if (j < 4) {
-        comp(frame->data[0] + (mb_y*16 + ((j&2)<<2))*frame->linesize[0] + mb_x*16 + ((j&1)<<3),
-             frame->linesize[0],
-             t->last_frame->data[0] + (mb_y*16 + ((j&2)<<2) + mv_y)*t->last_frame->linesize[0] + mb_x*16 + ((j&1)<<3) + mv_x,
-             t->last_frame->linesize[0], add);
-    } else if (!(t->avctx->flags & CODEC_FLAG_GRAY)) {
-        int index = j - 3;
-        comp(frame->data[index] + (mb_y*8)*frame->linesize[index] + mb_x * 8,
-             frame->linesize[index],
-             t->last_frame->data[index] + (mb_y * 8 + (mv_y/2))*t->last_frame->linesize[index] + mb_x * 8 + (mv_x/2),
-             t->last_frame->linesize[index], add);
-    }
-}
-
-static inline void idct_put(MadContext *t, AVFrame *frame, int16_t *block,
-                            int mb_x, int mb_y, int j)
-{
-    if (j < 4) {
-        ff_ea_idct_put_c(
-            frame->data[0] + (mb_y*16 + ((j&2)<<2))*frame->linesize[0] + mb_x*16 + ((j&1)<<3),
-            frame->linesize[0], block);
-    } else if (!(t->avctx->flags & CODEC_FLAG_GRAY)) {
-        int index = j - 3;
-        ff_ea_idct_put_c(
-            frame->data[index] + (mb_y*8)*frame->linesize[index] + mb_x*8,
-            frame->linesize[index], block);
-    }
-}
-
-static inline void decode_block_intra(MadContext *s, int16_t * block)
-{
-    int level, i, j, run;
-    RLTable *rl = &ff_rl_mpeg1;
-    const uint8_t *scantable = s->scantable.permutated;
-    int16_t *quant_matrix = s->quant_matrix;
-
-    block[0] = (128 + get_sbits(&s->gb, 8)) * quant_matrix[0];
-
-    /* The RL decoder is derived from mpeg1_decode_block_intra;
-       Escaped level and run values a decoded differently */
-    i = 0;
-    {
-        OPEN_READER(re, &s->gb);
-        /* now quantify & encode AC coefficients */
-        for (;;) {
-            UPDATE_CACHE(re, &s->gb);
-            GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
-            if (level == 127) {
-                break;
-            } else if (level != 0) {
-                i += run;
-                j = scantable[i];
-                level = (level*quant_matrix[j]) >> 4;
-                level = (level-1)|1;
-                level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
-                LAST_SKIP_BITS(re, &s->gb, 1);
-            } else {
-                /* escape */
-                UPDATE_CACHE(re, &s->gb);
-                level = SHOW_SBITS(re, &s->gb, 10); SKIP_BITS(re, &s->gb, 10);
-
-                UPDATE_CACHE(re, &s->gb);
-                run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
-
-                i += run;
-                j = scantable[i];
-                if (level < 0) {
-                    level = -level;
-                    level = (level*quant_matrix[j]) >> 4;
-                    level = (level-1)|1;
-                    level = -level;
-                } else {
-                    level = (level*quant_matrix[j]) >> 4;
-                    level = (level-1)|1;
-                }
-            }
-            if (i > 63) {
-                av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
-                return;
-            }
-
-            block[j] = level;
-        }
-        CLOSE_READER(re, &s->gb);
-    }
-}
-
-static int decode_motion(GetBitContext *gb)
-{
-    int value = 0;
-    if (get_bits1(gb)) {
-        if (get_bits1(gb))
-            value = -17;
-        value += get_bits(gb, 4) + 1;
-    }
-    return value;
-}
-
-static void decode_mb(MadContext *s, AVFrame *frame, int inter)
-{
-    int mv_map = 0;
-    int mv_x, mv_y;
-    int j;
-
-    if (inter) {
-        int v = decode210(&s->gb);
-        if (v < 2) {
-            mv_map = v ? get_bits(&s->gb, 6) : 63;
-            mv_x = decode_motion(&s->gb);
-            mv_y = decode_motion(&s->gb);
-        } else {
-            mv_map = 0;
-        }
-    }
-
-    for (j=0; j<6; j++) {
-        if (mv_map & (1<<j)) {  // mv_x and mv_y are guarded by mv_map
-            int add = 2*decode_motion(&s->gb);
-            comp_block(s, frame, s->mb_x, s->mb_y, j, mv_x, mv_y, add);
-        } else {
-            s->dsp.clear_block(s->block);
-            decode_block_intra(s, s->block);
-            idct_put(s, frame, s->block, s->mb_x, s->mb_y, j);
-        }
-    }
-}
-
-static void calc_quant_matrix(MadContext *s, int qscale)
-{
-    int i;
-
-    s->quant_matrix[0] = (ff_inv_aanscales[0]*ff_mpeg1_default_intra_matrix[0]) >> 11;
-    for (i=1; i<64; i++)
-        s->quant_matrix[i] = (ff_inv_aanscales[i]*ff_mpeg1_default_intra_matrix[i]*qscale + 32) >> 10;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    const uint8_t *buf_end = buf+buf_size;
-    MadContext *s     = avctx->priv_data;
-    AVFrame *frame    = data;
-    int width, height;
-    int chunk_type;
-    int inter, ret;
-
-    if (buf_size < 17) {
-        av_log(avctx, AV_LOG_ERROR, "Input buffer too small\n");
-        *got_frame = 0;
-        return -1;
-    }
-
-    chunk_type = AV_RL32(&buf[0]);
-    inter = (chunk_type == MADm_TAG || chunk_type == MADe_TAG);
-    buf += 8;
-
-    av_reduce(&avctx->time_base.num, &avctx->time_base.den,
-              AV_RL16(&buf[6]), 1000, 1<<30);
-
-    width  = AV_RL16(&buf[8]);
-    height = AV_RL16(&buf[10]);
-    calc_quant_matrix(s, buf[13]);
-    buf += 16;
-
-    if (avctx->width != width || avctx->height != height) {
-        av_frame_unref(s->last_frame);
-        if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
-            return ret;
-    }
-
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (inter && !s->last_frame->data[0]) {
-        av_log(avctx, AV_LOG_WARNING, "Missing reference frame.\n");
-        ret = ff_get_buffer(avctx, s->last_frame, AV_GET_BUFFER_FLAG_REF);
-        if (ret < 0)
-            return ret;
-        memset(s->last_frame->data[0], 0, s->last_frame->height *
-               s->last_frame->linesize[0]);
-        memset(s->last_frame->data[1], 0x80, s->last_frame->height / 2 *
-               s->last_frame->linesize[1]);
-        memset(s->last_frame->data[2], 0x80, s->last_frame->height / 2 *
-               s->last_frame->linesize[2]);
-    }
-
-    av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size,
-                          buf_end - buf);
-    if (!s->bitstream_buf)
-        return AVERROR(ENOMEM);
-    s->dsp.bswap16_buf(s->bitstream_buf, (const uint16_t*)buf, (buf_end-buf)/2);
-    init_get_bits(&s->gb, s->bitstream_buf, 8*(buf_end-buf));
-
-    for (s->mb_y=0; s->mb_y < (avctx->height+15)/16; s->mb_y++)
-        for (s->mb_x=0; s->mb_x < (avctx->width +15)/16; s->mb_x++)
-            decode_mb(s, frame, inter);
-
-    *got_frame = 1;
-
-    if (chunk_type != MADe_TAG) {
-        av_frame_unref(s->last_frame);
-        if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
-            return ret;
-    }
-
-    return buf_size;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    MadContext *t = avctx->priv_data;
-    av_frame_free(&t->last_frame);
-    av_free(t->bitstream_buf);
-    return 0;
-}
-
-AVCodec ff_eamad_decoder = {
-    .name           = "eamad",
-    .long_name      = NULL_IF_CONFIG_SMALL("Electronic Arts Madcow Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MAD,
-    .priv_data_size = sizeof(MadContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/eatgq.c b/deps/libav/libavcodec/eatgq.c
deleted file mode 100644
index 1ead5f7..0000000
--- a/deps/libav/libavcodec/eatgq.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Electronic Arts TGQ Video Decoder
- * Copyright (c) 2007-2008 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-/**
- * @file
- * Electronic Arts TGQ Video Decoder
- * @author Peter Ross <pross at xvid.org>
- *
- * Technical details here:
- * http://wiki.multimedia.cx/index.php?title=Electronic_Arts_TGQ
- */
-
-#include "avcodec.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "aandcttab.h"
-#include "eaidct.h"
-#include "internal.h"
-
-typedef struct TgqContext {
-    AVCodecContext *avctx;
-    int width, height;
-    ScanTable scantable;
-    int qtable[64];
-    DECLARE_ALIGNED(16, int16_t, block)[6][64];
-    GetByteContext gb;
-} TgqContext;
-
-static av_cold int tgq_decode_init(AVCodecContext *avctx)
-{
-    TgqContext *s = avctx->priv_data;
-    uint8_t idct_permutation[64];
-    s->avctx = avctx;
-    ff_init_scantable_permutation(idct_permutation, FF_NO_IDCT_PERM);
-    ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct);
-    avctx->time_base = (AVRational){1, 15};
-    avctx->pix_fmt   = AV_PIX_FMT_YUV420P;
-    return 0;
-}
-
-static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb)
-{
-    uint8_t *perm = s->scantable.permutated;
-    int i, j, value;
-    block[0] = get_sbits(gb, 8) * s->qtable[0];
-    for (i = 1; i < 64;) {
-        switch (show_bits(gb, 3)) {
-        case 4:
-            block[perm[i++]] = 0;
-        case 0:
-            block[perm[i++]] = 0;
-            skip_bits(gb, 3);
-            break;
-        case 5:
-        case 1:
-            skip_bits(gb, 2);
-            value = get_bits(gb, 6);
-            for (j = 0; j < value; j++)
-                block[perm[i++]] = 0;
-            break;
-        case 6:
-            skip_bits(gb, 3);
-            block[perm[i]] = -s->qtable[perm[i]];
-            i++;
-            break;
-        case 2:
-            skip_bits(gb, 3);
-            block[perm[i]] = s->qtable[perm[i]];
-            i++;
-            break;
-        case 7: // 111b
-        case 3: // 011b
-            skip_bits(gb, 2);
-            if (show_bits(gb, 6) == 0x3F) {
-                skip_bits(gb, 6);
-                block[perm[i]] = get_sbits(gb, 8) * s->qtable[perm[i]];
-            } else {
-                block[perm[i]] = get_sbits(gb, 6) * s->qtable[perm[i]];
-            }
-            i++;
-            break;
-        }
-    }
-    block[0] += 128 << 4;
-}
-
-static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], AVFrame *frame,
-                            int mb_x, int mb_y)
-{
-    int linesize = frame->linesize[0];
-    uint8_t *dest_y  = frame->data[0] + (mb_y * 16 * linesize)           + mb_x * 16;
-    uint8_t *dest_cb = frame->data[1] + (mb_y * 8  * frame->linesize[1]) + mb_x * 8;
-    uint8_t *dest_cr = frame->data[2] + (mb_y * 8  * frame->linesize[2]) + mb_x * 8;
-
-    ff_ea_idct_put_c(dest_y                   , linesize, block[0]);
-    ff_ea_idct_put_c(dest_y                + 8, linesize, block[1]);
-    ff_ea_idct_put_c(dest_y + 8 * linesize    , linesize, block[2]);
-    ff_ea_idct_put_c(dest_y + 8 * linesize + 8, linesize, block[3]);
-    if (!(s->avctx->flags & CODEC_FLAG_GRAY)) {
-         ff_ea_idct_put_c(dest_cb, frame->linesize[1], block[4]);
-         ff_ea_idct_put_c(dest_cr, frame->linesize[2], block[5]);
-    }
-}
-
-static inline void tgq_dconly(TgqContext *s, unsigned char *dst,
-                              int dst_stride, int dc)
-{
-    int level = av_clip_uint8((dc*s->qtable[0] + 2056) >> 4);
-    int j;
-    for (j = 0; j < 8; j++)
-        memset(dst + j * dst_stride, level, 8);
-}
-
-static void tgq_idct_put_mb_dconly(TgqContext *s, AVFrame *frame,
-                                   int mb_x, int mb_y, const int8_t *dc)
-{
-    int linesize = frame->linesize[0];
-    uint8_t *dest_y  = frame->data[0] + (mb_y * 16 * linesize)             + mb_x * 16;
-    uint8_t *dest_cb = frame->data[1] + (mb_y * 8  * frame->linesize[1]) + mb_x * 8;
-    uint8_t *dest_cr = frame->data[2] + (mb_y * 8  * frame->linesize[2]) + mb_x * 8;
-    tgq_dconly(s, dest_y,                    linesize, dc[0]);
-    tgq_dconly(s, dest_y                + 8, linesize, dc[1]);
-    tgq_dconly(s, dest_y + 8 * linesize,     linesize, dc[2]);
-    tgq_dconly(s, dest_y + 8 * linesize + 8, linesize, dc[3]);
-    if (!(s->avctx->flags & CODEC_FLAG_GRAY)) {
-        tgq_dconly(s, dest_cb, frame->linesize[1], dc[4]);
-        tgq_dconly(s, dest_cr, frame->linesize[2], dc[5]);
-    }
-}
-
-static void tgq_decode_mb(TgqContext *s, AVFrame *frame, int mb_y, int mb_x)
-{
-    int mode;
-    int i;
-    int8_t dc[6];
-
-    mode = bytestream2_get_byte(&s->gb);
-    if (mode > 12) {
-        GetBitContext gb;
-        init_get_bits(&gb, s->gb.buffer, FFMIN(s->gb.buffer_end - s->gb.buffer, mode) * 8);
-        for (i = 0; i < 6; i++)
-            tgq_decode_block(s, s->block[i], &gb);
-        tgq_idct_put_mb(s, s->block, frame, mb_x, mb_y);
-        bytestream2_skip(&s->gb, mode);
-    } else {
-        if (mode == 3) {
-            memset(dc, bytestream2_get_byte(&s->gb), 4);
-            dc[4] = bytestream2_get_byte(&s->gb);
-            dc[5] = bytestream2_get_byte(&s->gb);
-        } else if (mode == 6) {
-            bytestream2_get_buffer(&s->gb, dc, 6);
-        } else if (mode == 12) {
-            for (i = 0; i < 6; i++) {
-                dc[i] = bytestream2_get_byte(&s->gb);
-                bytestream2_skip(&s->gb, 1);
-            }
-        } else {
-            av_log(s->avctx, AV_LOG_ERROR, "unsupported mb mode %i\n", mode);
-        }
-        tgq_idct_put_mb_dconly(s, frame, mb_x, mb_y, dc);
-    }
-}
-
-static void tgq_calculate_qtable(TgqContext *s, int quant)
-{
-    int i, j;
-    const int a = (14 * (100 - quant)) / 100 + 1;
-    const int b = (11 * (100 - quant)) / 100 + 4;
-    for (j = 0; j < 8; j++)
-        for (i = 0; i < 8; i++)
-            s->qtable[j * 8 + i] = ((a * (j + i) / (7 + 7) + b) *
-                                    ff_inv_aanscales[j * 8 + i]) >> (14 - 4);
-}
-
-static int tgq_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    TgqContext *s      = avctx->priv_data;
-    AVFrame *frame     = data;
-    int x, y, ret;
-    int big_endian = AV_RL32(&buf[4]) > 0x000FFFFF;
-
-    if (buf_size < 16) {
-        av_log(avctx, AV_LOG_WARNING, "truncated header\n");
-        return AVERROR_INVALIDDATA;
-    }
-    bytestream2_init(&s->gb, buf + 8, buf_size - 8);
-    if (big_endian) {
-        s->width  = bytestream2_get_be16u(&s->gb);
-        s->height = bytestream2_get_be16u(&s->gb);
-    } else {
-        s->width  = bytestream2_get_le16u(&s->gb);
-        s->height = bytestream2_get_le16u(&s->gb);
-    }
-
-    ret = ff_set_dimensions(s->avctx, s->width, s->height);
-    if (ret < 0)
-        return ret;
-
-    tgq_calculate_qtable(s, bytestream2_get_byteu(&s->gb));
-    bytestream2_skip(&s->gb, 3);
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    frame->key_frame = 1;
-    frame->pict_type = AV_PICTURE_TYPE_I;
-
-    for (y = 0; y < FFALIGN(avctx->height, 16) >> 4; y++)
-        for (x = 0; x < FFALIGN(avctx->width, 16) >> 4; x++)
-            tgq_decode_mb(s, frame, y, x);
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_eatgq_decoder = {
-    .name           = "eatgq",
-    .long_name      = NULL_IF_CONFIG_SMALL("Electronic Arts TGQ video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TGQ,
-    .priv_data_size = sizeof(TgqContext),
-    .init           = tgq_decode_init,
-    .decode         = tgq_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/eatgv.c b/deps/libav/libavcodec/eatgv.c
deleted file mode 100644
index 3bc6506..0000000
--- a/deps/libav/libavcodec/eatgv.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Electronic Arts TGV Video Decoder
- * Copyright (c) 2007-2008 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-/**
- * @file
- * Electronic Arts TGV Video Decoder
- * by Peter Ross (pross at xvid.org)
- *
- * Technical details here:
- * http://wiki.multimedia.cx/index.php?title=Electronic_Arts_TGV
- */
-
-#include "avcodec.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "internal.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/mem.h"
-
-#define EA_PREAMBLE_SIZE    8
-#define kVGT_TAG MKTAG('k', 'V', 'G', 'T')
-
-typedef struct TgvContext {
-    AVCodecContext *avctx;
-    AVFrame *last_frame;
-    uint8_t *frame_buffer;
-    int width,height;
-    uint32_t palette[AVPALETTE_COUNT];
-
-    int (*mv_codebook)[2];
-    uint8_t (*block_codebook)[16];
-    int num_mvs;           ///< current length of mv_codebook
-    int num_blocks_packed; ///< current length of block_codebook
-} TgvContext;
-
-static av_cold int tgv_decode_init(AVCodecContext *avctx)
-{
-    TgvContext *s = avctx->priv_data;
-    s->avctx         = avctx;
-    avctx->time_base = (AVRational){1, 15};
-    avctx->pix_fmt   = AV_PIX_FMT_PAL8;
-
-    s->last_frame = av_frame_alloc();
-    if (!s->last_frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-/**
- * Unpack buffer
- * @return 0 on success, -1 on critical buffer underflow
- */
-static int unpack(const uint8_t *src, const uint8_t *src_end,
-                  uint8_t *dst, int width, int height)
-{
-    uint8_t *dst_end = dst + width*height;
-    int size, size1, size2, offset, run;
-    uint8_t *dst_start = dst;
-
-    if (src[0] & 0x01)
-        src += 5;
-    else
-        src += 2;
-
-    if (src + 3 > src_end)
-        return AVERROR_INVALIDDATA;
-    size = AV_RB24(src);
-    src += 3;
-
-    while (size > 0 && src < src_end) {
-
-        /* determine size1 and size2 */
-        size1 = (src[0] & 3);
-        if (src[0] & 0x80) {  // 1
-            if (src[0] & 0x40 ) {  // 11
-                if (src[0] & 0x20) {  // 111
-                    if (src[0] < 0xFC)  // !(111111)
-                        size1 = (((src[0] & 31) + 1) << 2);
-                    src++;
-                    size2 = 0;
-                } else {  // 110
-                    offset = ((src[0] & 0x10) << 12) + AV_RB16(&src[1]) + 1;
-                    size2  = ((src[0] & 0xC) << 6) + src[3] + 5;
-                    src   += 4;
-                }
-            } else {  // 10
-                size1  = ((src[1] & 0xC0) >> 6);
-                offset = (AV_RB16(&src[1]) & 0x3FFF) + 1;
-                size2  = (src[0] & 0x3F) + 4;
-                src   += 3;
-            }
-        } else {  // 0
-            offset = ((src[0] & 0x60) << 3) + src[1] + 1;
-            size2  = ((src[0] & 0x1C) >> 2) + 3;
-            src   += 2;
-        }
-
-
-        /* fetch strip from src */
-        if (size1 > src_end - src)
-            break;
-
-        if (size1 > 0) {
-            size -= size1;
-            run   = FFMIN(size1, dst_end - dst);
-            memcpy(dst, src, run);
-            dst += run;
-            src += run;
-        }
-
-        if (size2 > 0) {
-            if (dst - dst_start < offset)
-                return 0;
-            size -= size2;
-            run   = FFMIN(size2, dst_end - dst);
-            av_memcpy_backptr(dst, offset, run);
-            dst += run;
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Decode inter-frame
- * @return 0 on success, -1 on critical buffer underflow
- */
-static int tgv_decode_inter(TgvContext *s, AVFrame *frame,
-                            const uint8_t *buf, const uint8_t *buf_end)
-{
-    int num_mvs;
-    int num_blocks_raw;
-    int num_blocks_packed;
-    int vector_bits;
-    int i,j,x,y;
-    GetBitContext gb;
-    int mvbits;
-    const uint8_t *blocks_raw;
-
-    if (buf + 12 > buf_end)
-        return AVERROR_INVALIDDATA;
-
-    num_mvs           = AV_RL16(&buf[0]);
-    num_blocks_raw    = AV_RL16(&buf[2]);
-    num_blocks_packed = AV_RL16(&buf[4]);
-    vector_bits       = AV_RL16(&buf[6]);
-    buf += 12;
-
-    if (vector_bits > MIN_CACHE_BITS || !vector_bits) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Invalid value for motion vector bits: %d\n", vector_bits);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* allocate codebook buffers as necessary */
-    if (num_mvs > s->num_mvs) {
-        s->mv_codebook = av_realloc(s->mv_codebook, num_mvs*2*sizeof(int));
-        s->num_mvs = num_mvs;
-    }
-
-    if (num_blocks_packed > s->num_blocks_packed) {
-        int err;
-        if ((err = av_reallocp(&s->block_codebook, num_blocks_packed * 16)) < 0) {
-            s->num_blocks_packed = 0;
-            return err;
-        }
-        s->num_blocks_packed = num_blocks_packed;
-    }
-
-    /* read motion vectors */
-    mvbits = (num_mvs * 2 * 10 + 31) & ~31;
-
-    if (buf + (mvbits >> 3) + 16 * num_blocks_raw + 8 * num_blocks_packed > buf_end)
-        return AVERROR_INVALIDDATA;
-
-    init_get_bits(&gb, buf, mvbits);
-    for (i = 0; i < num_mvs; i++) {
-        s->mv_codebook[i][0] = get_sbits(&gb, 10);
-        s->mv_codebook[i][1] = get_sbits(&gb, 10);
-    }
-    buf += mvbits >> 3;
-
-    /* note ptr to uncompressed blocks */
-    blocks_raw = buf;
-    buf       += num_blocks_raw * 16;
-
-    /* read compressed blocks */
-    init_get_bits(&gb, buf, (buf_end - buf) << 3);
-    for (i = 0; i < num_blocks_packed; i++) {
-        int tmp[4];
-        for (j = 0; j < 4; j++)
-            tmp[j] = get_bits(&gb, 8);
-        for (j = 0; j < 16; j++)
-            s->block_codebook[i][15-j] = tmp[get_bits(&gb, 2)];
-    }
-
-    if (get_bits_left(&gb) < vector_bits *
-        (s->avctx->height / 4) * (s->avctx->width / 4))
-        return AVERROR_INVALIDDATA;
-
-    /* read vectors and build frame */
-    for (y = 0; y < s->avctx->height / 4; y++)
-        for (x = 0; x < s->avctx->width / 4; x++) {
-            unsigned int vector = get_bits(&gb, vector_bits);
-            const uint8_t *src;
-            int src_stride;
-
-            if (vector < num_mvs) {
-                int mx = x * 4 + s->mv_codebook[vector][0];
-                int my = y * 4 + s->mv_codebook[vector][1];
-
-                if (mx < 0 || mx + 4 > s->avctx->width ||
-                    my < 0 || my + 4 > s->avctx->height)
-                    continue;
-
-                src = s->last_frame->data[0] + mx + my * s->last_frame->linesize[0];
-                src_stride = s->last_frame->linesize[0];
-            } else {
-                int offset = vector - num_mvs;
-                if (offset < num_blocks_raw)
-                    src = blocks_raw + 16*offset;
-                else if (offset - num_blocks_raw < num_blocks_packed)
-                    src = s->block_codebook[offset - num_blocks_raw];
-                else
-                    continue;
-                src_stride = 4;
-            }
-
-            for (j = 0; j < 4; j++)
-                for (i = 0; i < 4; i++)
-                    frame->data[0][(y * 4 + j) * frame->linesize[0] + (x * 4 + i)] =
-                        src[j * src_stride + i];
-    }
-
-    return 0;
-}
-
-static int tgv_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf     = avpkt->data;
-    int buf_size           = avpkt->size;
-    TgvContext *s          = avctx->priv_data;
-    const uint8_t *buf_end = buf + buf_size;
-    AVFrame *frame         = data;
-    int chunk_type, ret;
-
-    chunk_type = AV_RL32(&buf[0]);
-    buf       += EA_PREAMBLE_SIZE;
-
-    if (chunk_type == kVGT_TAG) {
-        int pal_count, i;
-        if (buf + 12 > buf_end) {
-            av_log(avctx, AV_LOG_WARNING, "truncated header\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        s->width  = AV_RL16(&buf[0]);
-        s->height = AV_RL16(&buf[2]);
-        if (s->avctx->width != s->width || s->avctx->height != s->height) {
-            av_freep(&s->frame_buffer);
-            av_frame_unref(s->last_frame);
-            if ((ret = ff_set_dimensions(s->avctx, s->width, s->height)) < 0)
-                return ret;
-        }
-
-        pal_count = AV_RL16(&buf[6]);
-        buf += 12;
-        for (i = 0; i < pal_count && i < AVPALETTE_COUNT && buf + 2 < buf_end; i++) {
-            s->palette[i] = AV_RB24(buf);
-            buf += 3;
-        }
-    }
-
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
-        return ret;
-
-    memcpy(frame->data[1], s->palette, AVPALETTE_SIZE);
-
-    if (chunk_type == kVGT_TAG) {
-        int y;
-        frame->key_frame = 1;
-        frame->pict_type = AV_PICTURE_TYPE_I;
-
-        if (!s->frame_buffer &&
-            !(s->frame_buffer = av_malloc(s->width * s->height)))
-            return AVERROR(ENOMEM);
-
-        if (unpack(buf, buf_end, s->frame_buffer, s->avctx->width, s->avctx->height) < 0) {
-            av_log(avctx, AV_LOG_WARNING, "truncated intra frame\n");
-            return AVERROR_INVALIDDATA;
-        }
-        for (y = 0; y < s->height; y++)
-            memcpy(frame->data[0]  + y * frame->linesize[0],
-                   s->frame_buffer + y * s->width,
-                   s->width);
-    } else {
-        if (!s->last_frame->data[0]) {
-            av_log(avctx, AV_LOG_WARNING, "inter frame without corresponding intra frame\n");
-            return buf_size;
-        }
-        frame->key_frame = 0;
-        frame->pict_type = AV_PICTURE_TYPE_P;
-        if (tgv_decode_inter(s, frame, buf, buf_end) < 0) {
-            av_log(avctx, AV_LOG_WARNING, "truncated inter frame\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    av_frame_unref(s->last_frame);
-    if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int tgv_decode_end(AVCodecContext *avctx)
-{
-    TgvContext *s = avctx->priv_data;
-    av_frame_free(&s->last_frame);
-    av_freep(&s->frame_buffer);
-    av_free(s->mv_codebook);
-    av_free(s->block_codebook);
-    return 0;
-}
-
-AVCodec ff_eatgv_decoder = {
-    .name           = "eatgv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Electronic Arts TGV video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TGV,
-    .priv_data_size = sizeof(TgvContext),
-    .init           = tgv_decode_init,
-    .close          = tgv_decode_end,
-    .decode         = tgv_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/eatqi.c b/deps/libav/libavcodec/eatqi.c
deleted file mode 100644
index 2345cc7..0000000
--- a/deps/libav/libavcodec/eatqi.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Electronic Arts TQI Video Decoder
- * Copyright (c) 2007-2009 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-/**
- * @file
- * Electronic Arts TQI Video Decoder
- * @author Peter Ross <pross at xvid.org>
- * @see http://wiki.multimedia.cx/index.php?title=Electronic_Arts_TQI
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "aandcttab.h"
-#include "eaidct.h"
-#include "internal.h"
-#include "mpeg12.h"
-#include "mpegvideo.h"
-
-typedef struct TqiContext {
-    MpegEncContext s;
-    void *bitstream_buf;
-    unsigned int bitstream_buf_size;
-    DECLARE_ALIGNED(16, int16_t, block)[6][64];
-} TqiContext;
-
-static av_cold int tqi_decode_init(AVCodecContext *avctx)
-{
-    TqiContext *t = avctx->priv_data;
-    MpegEncContext *s = &t->s;
-    s->avctx = avctx;
-    ff_dsputil_init(&s->dsp, avctx);
-    ff_init_scantable_permutation(s->dsp.idct_permutation, FF_NO_IDCT_PERM);
-    ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
-    s->qscale = 1;
-    avctx->time_base = (AVRational){1, 15};
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    ff_mpeg12_init_vlcs();
-    return 0;
-}
-
-static int tqi_decode_mb(MpegEncContext *s, int16_t (*block)[64])
-{
-    int n;
-    s->dsp.clear_blocks(block[0]);
-    for (n=0; n<6; n++)
-        if (ff_mpeg1_decode_block_intra(s, block[n], n) < 0)
-            return -1;
-
-    return 0;
-}
-
-static inline void tqi_idct_put(TqiContext *t, AVFrame *frame, int16_t (*block)[64])
-{
-    MpegEncContext *s = &t->s;
-    int linesize = frame->linesize[0];
-    uint8_t *dest_y  = frame->data[0] + (s->mb_y * 16* linesize            ) + s->mb_x * 16;
-    uint8_t *dest_cb = frame->data[1] + (s->mb_y * 8 * frame->linesize[1]) + s->mb_x * 8;
-    uint8_t *dest_cr = frame->data[2] + (s->mb_y * 8 * frame->linesize[2]) + s->mb_x * 8;
-
-    ff_ea_idct_put_c(dest_y                 , linesize, block[0]);
-    ff_ea_idct_put_c(dest_y              + 8, linesize, block[1]);
-    ff_ea_idct_put_c(dest_y + 8*linesize    , linesize, block[2]);
-    ff_ea_idct_put_c(dest_y + 8*linesize + 8, linesize, block[3]);
-    if(!(s->avctx->flags&CODEC_FLAG_GRAY)) {
-        ff_ea_idct_put_c(dest_cb, frame->linesize[1], block[4]);
-        ff_ea_idct_put_c(dest_cr, frame->linesize[2], block[5]);
-    }
-}
-
-static void tqi_calculate_qtable(MpegEncContext *s, int quant)
-{
-    const int qscale = (215 - 2*quant)*5;
-    int i;
-    s->intra_matrix[0] = (ff_inv_aanscales[0]*ff_mpeg1_default_intra_matrix[0])>>11;
-    for(i=1; i<64; i++)
-        s->intra_matrix[i] = (ff_inv_aanscales[i]*ff_mpeg1_default_intra_matrix[i]*qscale + 32)>>14;
-}
-
-static int tqi_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    const uint8_t *buf_end = buf+buf_size;
-    TqiContext *t = avctx->priv_data;
-    MpegEncContext *s = &t->s;
-    AVFrame *frame = data;
-    int ret;
-
-    s->width  = AV_RL16(&buf[0]);
-    s->height = AV_RL16(&buf[2]);
-    tqi_calculate_qtable(s, buf[4]);
-    buf += 8;
-
-    ret = ff_set_dimensions(s->avctx, s->width, s->height);
-    if (ret < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    av_fast_padded_malloc(&t->bitstream_buf, &t->bitstream_buf_size,
-                          buf_end - buf);
-    if (!t->bitstream_buf)
-        return AVERROR(ENOMEM);
-    s->dsp.bswap_buf(t->bitstream_buf, (const uint32_t*)buf, (buf_end-buf)/4);
-    init_get_bits(&s->gb, t->bitstream_buf, 8*(buf_end-buf));
-
-    s->last_dc[0] = s->last_dc[1] = s->last_dc[2] = 0;
-    for (s->mb_y=0; s->mb_y<(avctx->height+15)/16; s->mb_y++)
-    for (s->mb_x=0; s->mb_x<(avctx->width+15)/16; s->mb_x++)
-    {
-        if (tqi_decode_mb(s, t->block) < 0)
-            break;
-        tqi_idct_put(t, frame, t->block);
-    }
-
-    *got_frame = 1;
-    return buf_size;
-}
-
-static av_cold int tqi_decode_end(AVCodecContext *avctx)
-{
-    TqiContext *t = avctx->priv_data;
-    av_free(t->bitstream_buf);
-    return 0;
-}
-
-AVCodec ff_eatqi_decoder = {
-    .name           = "eatqi",
-    .long_name      = NULL_IF_CONFIG_SMALL("Electronic Arts TQI Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TQI,
-    .priv_data_size = sizeof(TqiContext),
-    .init           = tqi_decode_init,
-    .close          = tqi_decode_end,
-    .decode         = tqi_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/elbg.c b/deps/libav/libavcodec/elbg.c
deleted file mode 100644
index 0aa8e16..0000000
--- a/deps/libav/libavcodec/elbg.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * Copyright (C) 2007 Vitor Sessak <vitor1001 at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Codebook Generator using the ELBG algorithm
- */
-
-#include <string.h>
-
-#include "libavutil/common.h"
-#include "libavutil/lfg.h"
-#include "elbg.h"
-#include "avcodec.h"
-
-#define DELTA_ERR_MAX 0.1  ///< Precision of the ELBG algorithm (as percentual error)
-
-/**
- * In the ELBG jargon, a cell is the set of points that are closest to a
- * codebook entry. Not to be confused with a RoQ Video cell. */
-typedef struct cell_s {
-    int index;
-    struct cell_s *next;
-} cell;
-
-/**
- * ELBG internal data
- */
-typedef struct{
-    int error;
-    int dim;
-    int numCB;
-    int *codebook;
-    cell **cells;
-    int *utility;
-    int *utility_inc;
-    int *nearest_cb;
-    int *points;
-    AVLFG *rand_state;
-    int *scratchbuf;
-} elbg_data;
-
-static inline int distance_limited(int *a, int *b, int dim, int limit)
-{
-    int i, dist=0;
-    for (i=0; i<dim; i++) {
-        dist += (a[i] - b[i])*(a[i] - b[i]);
-        if (dist > limit)
-            return INT_MAX;
-    }
-
-    return dist;
-}
-
-static inline void vect_division(int *res, int *vect, int div, int dim)
-{
-    int i;
-    if (div > 1)
-        for (i=0; i<dim; i++)
-            res[i] = ROUNDED_DIV(vect[i],div);
-    else if (res != vect)
-        memcpy(res, vect, dim*sizeof(int));
-
-}
-
-static int eval_error_cell(elbg_data *elbg, int *centroid, cell *cells)
-{
-    int error=0;
-    for (; cells; cells=cells->next)
-        error += distance_limited(centroid, elbg->points + cells->index*elbg->dim, elbg->dim, INT_MAX);
-
-    return error;
-}
-
-static int get_closest_codebook(elbg_data *elbg, int index)
-{
-    int i, pick=0, diff, diff_min = INT_MAX;
-    for (i=0; i<elbg->numCB; i++)
-        if (i != index) {
-            diff = distance_limited(elbg->codebook + i*elbg->dim, elbg->codebook + index*elbg->dim, elbg->dim, diff_min);
-            if (diff < diff_min) {
-                pick = i;
-                diff_min = diff;
-            }
-        }
-    return pick;
-}
-
-static int get_high_utility_cell(elbg_data *elbg)
-{
-    int i=0;
-    /* Using linear search, do binary if it ever turns to be speed critical */
-    int r = av_lfg_get(elbg->rand_state)%elbg->utility_inc[elbg->numCB-1] + 1;
-    while (elbg->utility_inc[i] < r)
-        i++;
-
-    assert(elbg->cells[i]);
-
-    return i;
-}
-
-/**
- * Implementation of the simple LBG algorithm for just two codebooks
- */
-static int simple_lbg(elbg_data *elbg,
-                      int dim,
-                      int *centroid[3],
-                      int newutility[3],
-                      int *points,
-                      cell *cells)
-{
-    int i, idx;
-    int numpoints[2] = {0,0};
-    int *newcentroid[2] = {
-        elbg->scratchbuf + 3*dim,
-        elbg->scratchbuf + 4*dim
-    };
-    cell *tempcell;
-
-    memset(newcentroid[0], 0, 2 * dim * sizeof(*newcentroid[0]));
-
-    newutility[0] =
-    newutility[1] = 0;
-
-    for (tempcell = cells; tempcell; tempcell=tempcell->next) {
-        idx = distance_limited(centroid[0], points + tempcell->index*dim, dim, INT_MAX)>=
-              distance_limited(centroid[1], points + tempcell->index*dim, dim, INT_MAX);
-        numpoints[idx]++;
-        for (i=0; i<dim; i++)
-            newcentroid[idx][i] += points[tempcell->index*dim + i];
-    }
-
-    vect_division(centroid[0], newcentroid[0], numpoints[0], dim);
-    vect_division(centroid[1], newcentroid[1], numpoints[1], dim);
-
-    for (tempcell = cells; tempcell; tempcell=tempcell->next) {
-        int dist[2] = {distance_limited(centroid[0], points + tempcell->index*dim, dim, INT_MAX),
-                       distance_limited(centroid[1], points + tempcell->index*dim, dim, INT_MAX)};
-        int idx = dist[0] > dist[1];
-        newutility[idx] += dist[idx];
-    }
-
-    return newutility[0] + newutility[1];
-}
-
-static void get_new_centroids(elbg_data *elbg, int huc, int *newcentroid_i,
-                              int *newcentroid_p)
-{
-    cell *tempcell;
-    int *min = newcentroid_i;
-    int *max = newcentroid_p;
-    int i;
-
-    for (i=0; i< elbg->dim; i++) {
-        min[i]=INT_MAX;
-        max[i]=0;
-    }
-
-    for (tempcell = elbg->cells[huc]; tempcell; tempcell = tempcell->next)
-        for(i=0; i<elbg->dim; i++) {
-            min[i]=FFMIN(min[i], elbg->points[tempcell->index*elbg->dim + i]);
-            max[i]=FFMAX(max[i], elbg->points[tempcell->index*elbg->dim + i]);
-        }
-
-    for (i=0; i<elbg->dim; i++) {
-        int ni = min[i] + (max[i] - min[i])/3;
-        int np = min[i] + (2*(max[i] - min[i]))/3;
-        newcentroid_i[i] = ni;
-        newcentroid_p[i] = np;
-    }
-}
-
-/**
- * Add the points in the low utility cell to its closest cell. Split the high
- * utility cell, putting the separed points in the (now empty) low utility
- * cell.
- *
- * @param elbg         Internal elbg data
- * @param indexes      {luc, huc, cluc}
- * @param newcentroid  A vector with the position of the new centroids
- */
-static void shift_codebook(elbg_data *elbg, int *indexes,
-                           int *newcentroid[3])
-{
-    cell *tempdata;
-    cell **pp = &elbg->cells[indexes[2]];
-
-    while(*pp)
-        pp= &(*pp)->next;
-
-    *pp = elbg->cells[indexes[0]];
-
-    elbg->cells[indexes[0]] = NULL;
-    tempdata = elbg->cells[indexes[1]];
-    elbg->cells[indexes[1]] = NULL;
-
-    while(tempdata) {
-        cell *tempcell2 = tempdata->next;
-        int idx = distance_limited(elbg->points + tempdata->index*elbg->dim,
-                           newcentroid[0], elbg->dim, INT_MAX) >
-                  distance_limited(elbg->points + tempdata->index*elbg->dim,
-                           newcentroid[1], elbg->dim, INT_MAX);
-
-        tempdata->next = elbg->cells[indexes[idx]];
-        elbg->cells[indexes[idx]] = tempdata;
-        tempdata = tempcell2;
-    }
-}
-
-static void evaluate_utility_inc(elbg_data *elbg)
-{
-    int i, inc=0;
-
-    for (i=0; i < elbg->numCB; i++) {
-        if (elbg->numCB*elbg->utility[i] > elbg->error)
-            inc += elbg->utility[i];
-        elbg->utility_inc[i] = inc;
-    }
-}
-
-
-static void update_utility_and_n_cb(elbg_data *elbg, int idx, int newutility)
-{
-    cell *tempcell;
-
-    elbg->utility[idx] = newutility;
-    for (tempcell=elbg->cells[idx]; tempcell; tempcell=tempcell->next)
-        elbg->nearest_cb[tempcell->index] = idx;
-}
-
-/**
- * Evaluate if a shift lower the error. If it does, call shift_codebooks
- * and update elbg->error, elbg->utility and elbg->nearest_cb.
- *
- * @param elbg  Internal elbg data
- * @param idx   {luc (low utility cell, huc (high utility cell), cluc (closest cell to low utility cell)}
- */
-static void try_shift_candidate(elbg_data *elbg, int idx[3])
-{
-    int j, k, olderror=0, newerror, cont=0;
-    int newutility[3];
-    int *newcentroid[3] = {
-        elbg->scratchbuf,
-        elbg->scratchbuf + elbg->dim,
-        elbg->scratchbuf + 2*elbg->dim
-    };
-    cell *tempcell;
-
-    for (j=0; j<3; j++)
-        olderror += elbg->utility[idx[j]];
-
-    memset(newcentroid[2], 0, elbg->dim*sizeof(int));
-
-    for (k=0; k<2; k++)
-        for (tempcell=elbg->cells[idx[2*k]]; tempcell; tempcell=tempcell->next) {
-            cont++;
-            for (j=0; j<elbg->dim; j++)
-                newcentroid[2][j] += elbg->points[tempcell->index*elbg->dim + j];
-        }
-
-    vect_division(newcentroid[2], newcentroid[2], cont, elbg->dim);
-
-    get_new_centroids(elbg, idx[1], newcentroid[0], newcentroid[1]);
-
-    newutility[2]  = eval_error_cell(elbg, newcentroid[2], elbg->cells[idx[0]]);
-    newutility[2] += eval_error_cell(elbg, newcentroid[2], elbg->cells[idx[2]]);
-
-    newerror = newutility[2];
-
-    newerror += simple_lbg(elbg, elbg->dim, newcentroid, newutility, elbg->points,
-                           elbg->cells[idx[1]]);
-
-    if (olderror > newerror) {
-        shift_codebook(elbg, idx, newcentroid);
-
-        elbg->error += newerror - olderror;
-
-        for (j=0; j<3; j++)
-            update_utility_and_n_cb(elbg, idx[j], newutility[j]);
-
-        evaluate_utility_inc(elbg);
-    }
- }
-
-/**
- * Implementation of the ELBG block
- */
-static void do_shiftings(elbg_data *elbg)
-{
-    int idx[3];
-
-    evaluate_utility_inc(elbg);
-
-    for (idx[0]=0; idx[0] < elbg->numCB; idx[0]++)
-        if (elbg->numCB*elbg->utility[idx[0]] < elbg->error) {
-            if (elbg->utility_inc[elbg->numCB-1] == 0)
-                return;
-
-            idx[1] = get_high_utility_cell(elbg);
-            idx[2] = get_closest_codebook(elbg, idx[0]);
-
-            if (idx[1] != idx[0] && idx[1] != idx[2])
-                try_shift_candidate(elbg, idx);
-        }
-}
-
-#define BIG_PRIME 433494437LL
-
-void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
-                  int numCB, int max_steps, int *closest_cb,
-                  AVLFG *rand_state)
-{
-    int i, k;
-
-    if (numpoints > 24*numCB) {
-        /* ELBG is very costly for a big number of points. So if we have a lot
-           of them, get a good initial codebook to save on iterations       */
-        int *temp_points = av_malloc(dim*(numpoints/8)*sizeof(int));
-        for (i=0; i<numpoints/8; i++) {
-            k = (i*BIG_PRIME) % numpoints;
-            memcpy(temp_points + i*dim, points + k*dim, dim*sizeof(int));
-        }
-
-        ff_init_elbg(temp_points, dim, numpoints/8, codebook, numCB, 2*max_steps, closest_cb, rand_state);
-        ff_do_elbg(temp_points, dim, numpoints/8, codebook, numCB, 2*max_steps, closest_cb, rand_state);
-
-        av_free(temp_points);
-
-    } else  // If not, initialize the codebook with random positions
-        for (i=0; i < numCB; i++)
-            memcpy(codebook + i*dim, points + ((i*BIG_PRIME)%numpoints)*dim,
-                   dim*sizeof(int));
-
-}
-
-void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
-                int numCB, int max_steps, int *closest_cb,
-                AVLFG *rand_state)
-{
-    int dist;
-    elbg_data elbg_d;
-    elbg_data *elbg = &elbg_d;
-    int i, j, k, last_error, steps=0;
-    int *dist_cb = av_malloc(numpoints*sizeof(int));
-    int *size_part = av_malloc(numCB*sizeof(int));
-    cell *list_buffer = av_malloc(numpoints*sizeof(cell));
-    cell *free_cells;
-    int best_dist, best_idx = 0;
-
-    elbg->error = INT_MAX;
-    elbg->dim = dim;
-    elbg->numCB = numCB;
-    elbg->codebook = codebook;
-    elbg->cells = av_malloc(numCB*sizeof(cell *));
-    elbg->utility = av_malloc(numCB*sizeof(int));
-    elbg->nearest_cb = closest_cb;
-    elbg->points = points;
-    elbg->utility_inc = av_malloc(numCB*sizeof(int));
-    elbg->scratchbuf = av_malloc(5*dim*sizeof(int));
-
-    elbg->rand_state = rand_state;
-
-    do {
-        free_cells = list_buffer;
-        last_error = elbg->error;
-        steps++;
-        memset(elbg->utility, 0, numCB*sizeof(int));
-        memset(elbg->cells, 0, numCB*sizeof(cell *));
-
-        elbg->error = 0;
-
-        /* This loop evaluate the actual Voronoi partition. It is the most
-           costly part of the algorithm. */
-        for (i=0; i < numpoints; i++) {
-            best_dist = distance_limited(elbg->points + i*elbg->dim, elbg->codebook + best_idx*elbg->dim, dim, INT_MAX);
-            for (k=0; k < elbg->numCB; k++) {
-                dist = distance_limited(elbg->points + i*elbg->dim, elbg->codebook + k*elbg->dim, dim, best_dist);
-                if (dist < best_dist) {
-                    best_dist = dist;
-                    best_idx = k;
-                }
-            }
-            elbg->nearest_cb[i] = best_idx;
-            dist_cb[i] = best_dist;
-            elbg->error += dist_cb[i];
-            elbg->utility[elbg->nearest_cb[i]] += dist_cb[i];
-            free_cells->index = i;
-            free_cells->next = elbg->cells[elbg->nearest_cb[i]];
-            elbg->cells[elbg->nearest_cb[i]] = free_cells;
-            free_cells++;
-        }
-
-        do_shiftings(elbg);
-
-        memset(size_part, 0, numCB*sizeof(int));
-
-        memset(elbg->codebook, 0, elbg->numCB*dim*sizeof(int));
-
-        for (i=0; i < numpoints; i++) {
-            size_part[elbg->nearest_cb[i]]++;
-            for (j=0; j < elbg->dim; j++)
-                elbg->codebook[elbg->nearest_cb[i]*elbg->dim + j] +=
-                    elbg->points[i*elbg->dim + j];
-        }
-
-        for (i=0; i < elbg->numCB; i++)
-            vect_division(elbg->codebook + i*elbg->dim,
-                          elbg->codebook + i*elbg->dim, size_part[i], elbg->dim);
-
-    } while(((last_error - elbg->error) > DELTA_ERR_MAX*elbg->error) &&
-            (steps < max_steps));
-
-    av_free(dist_cb);
-    av_free(size_part);
-    av_free(elbg->utility);
-    av_free(list_buffer);
-    av_free(elbg->cells);
-    av_free(elbg->utility_inc);
-    av_free(elbg->scratchbuf);
-}
diff --git a/deps/libav/libavcodec/elbg.h b/deps/libav/libavcodec/elbg.h
deleted file mode 100644
index b8ea489..0000000
--- a/deps/libav/libavcodec/elbg.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2007 Vitor Sessak <vitor1001 at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ELBG_H
-#define AVCODEC_ELBG_H
-
-#include "libavutil/lfg.h"
-
-/**
- * Implementation of the Enhanced LBG Algorithm
- * Based on the paper "Neural Networks 14:1219-1237" that can be found in
- * http://citeseer.ist.psu.edu/patan01enhanced.html .
- *
- * @param points Input points.
- * @param dim Dimension of the points.
- * @param numpoints Num of points in **points.
- * @param codebook Pointer to the output codebook. Must be allocated.
- * @param numCB Number of points in the codebook.
- * @param num_steps The maximum number of steps. One step is already a good compromise between time and quality.
- * @param closest_cb Return the closest codebook to each point. Must be allocated.
- * @param rand_state A random number generator state. Should be already initialized by av_lfg_init().
- */
-void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
-                int numCB, int num_steps, int *closest_cb,
-                AVLFG *rand_state);
-
-/**
- * Initialize the **codebook vector for the elbg algorithm. If you have already
- * a codebook and you want to refine it, you shouldn't call this function.
- * If numpoints < 8*numCB this function fills **codebook with random numbers.
- * If not, it calls ff_do_elbg for a (smaller) random sample of the points in
- * **points. Get the same parameters as ff_do_elbg.
- */
-void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
-                  int numCB, int num_steps, int *closest_cb,
-                  AVLFG *rand_state);
-
-#endif /* AVCODEC_ELBG_H */
diff --git a/deps/libav/libavcodec/error_resilience.c b/deps/libav/libavcodec/error_resilience.c
deleted file mode 100644
index 51ebc04..0000000
--- a/deps/libav/libavcodec/error_resilience.c
+++ /dev/null
@@ -1,1229 +0,0 @@
-/*
- * Error resilience / concealment
- *
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Error resilience / concealment.
- */
-
-#include <limits.h>
-
-#include "libavutil/internal.h"
-#include "avcodec.h"
-#include "error_resilience.h"
-#include "mpegvideo.h"
-#include "rectangle.h"
-#include "thread.h"
-#include "version.h"
-
-/**
- * @param stride the number of MVs to get to the next row
- * @param mv_step the number of MVs per row or column in a macroblock
- */
-static void set_mv_strides(ERContext *s, int *mv_step, int *stride)
-{
-    if (s->avctx->codec_id == AV_CODEC_ID_H264) {
-        assert(s->quarter_sample);
-        *mv_step = 4;
-        *stride  = s->mb_width * 4;
-    } else {
-        *mv_step = 2;
-        *stride  = s->b8_stride;
-    }
-}
-
-/**
- * Replace the current MB with a flat dc-only version.
- */
-static void put_dc(ERContext *s, uint8_t *dest_y, uint8_t *dest_cb,
-                   uint8_t *dest_cr, int mb_x, int mb_y)
-{
-    int *linesize = s->cur_pic->f.linesize;
-    int dc, dcu, dcv, y, i;
-    for (i = 0; i < 4; i++) {
-        dc = s->dc_val[0][mb_x * 2 + (i &  1) + (mb_y * 2 + (i >> 1)) * s->b8_stride];
-        if (dc < 0)
-            dc = 0;
-        else if (dc > 2040)
-            dc = 2040;
-        for (y = 0; y < 8; y++) {
-            int x;
-            for (x = 0; x < 8; x++)
-                dest_y[x + (i &  1) * 8 + (y + (i >> 1) * 8) * linesize[0]] = dc / 8;
-        }
-    }
-    dcu = s->dc_val[1][mb_x + mb_y * s->mb_stride];
-    dcv = s->dc_val[2][mb_x + mb_y * s->mb_stride];
-    if (dcu < 0)
-        dcu = 0;
-    else if (dcu > 2040)
-        dcu = 2040;
-    if (dcv < 0)
-        dcv = 0;
-    else if (dcv > 2040)
-        dcv = 2040;
-    for (y = 0; y < 8; y++) {
-        int x;
-        for (x = 0; x < 8; x++) {
-            dest_cb[x + y * linesize[1]] = dcu / 8;
-            dest_cr[x + y * linesize[2]] = dcv / 8;
-        }
-    }
-}
-
-static void filter181(int16_t *data, int width, int height, int stride)
-{
-    int x, y;
-
-    /* horizontal filter */
-    for (y = 1; y < height - 1; y++) {
-        int prev_dc = data[0 + y * stride];
-
-        for (x = 1; x < width - 1; x++) {
-            int dc;
-            dc = -prev_dc +
-                 data[x     + y * stride] * 8 -
-                 data[x + 1 + y * stride];
-            dc = (dc * 10923 + 32768) >> 16;
-            prev_dc = data[x + y * stride];
-            data[x + y * stride] = dc;
-        }
-    }
-
-    /* vertical filter */
-    for (x = 1; x < width - 1; x++) {
-        int prev_dc = data[x];
-
-        for (y = 1; y < height - 1; y++) {
-            int dc;
-
-            dc = -prev_dc +
-                 data[x +  y      * stride] * 8 -
-                 data[x + (y + 1) * stride];
-            dc = (dc * 10923 + 32768) >> 16;
-            prev_dc = data[x + y * stride];
-            data[x + y * stride] = dc;
-        }
-    }
-}
-
-/**
- * guess the dc of blocks which do not have an undamaged dc
- * @param w     width in 8 pixel blocks
- * @param h     height in 8 pixel blocks
- */
-static void guess_dc(ERContext *s, int16_t *dc, int w,
-                     int h, int stride, int is_luma)
-{
-    int b_x, b_y;
-
-    for (b_y = 0; b_y < h; b_y++) {
-        for (b_x = 0; b_x < w; b_x++) {
-            int color[4]    = { 1024, 1024, 1024, 1024 };
-            int distance[4] = { 9999, 9999, 9999, 9999 };
-            int mb_index, error, j;
-            int64_t guess, weight_sum;
-            mb_index = (b_x >> is_luma) + (b_y >> is_luma) * s->mb_stride;
-            error    = s->error_status_table[mb_index];
-
-            if (IS_INTER(s->cur_pic->mb_type[mb_index]))
-                continue; // inter
-            if (!(error & ER_DC_ERROR))
-                continue; // dc-ok
-
-            /* right block */
-            for (j = b_x + 1; j < w; j++) {
-                int mb_index_j = (j >> is_luma) + (b_y >> is_luma) * s->mb_stride;
-                int error_j    = s->error_status_table[mb_index_j];
-                int intra_j    = IS_INTRA(s->cur_pic->mb_type[mb_index_j]);
-                if (intra_j == 0 || !(error_j & ER_DC_ERROR)) {
-                    color[0]    = dc[j + b_y * stride];
-                    distance[0] = j - b_x;
-                    break;
-                }
-            }
-
-            /* left block */
-            for (j = b_x - 1; j >= 0; j--) {
-                int mb_index_j = (j >> is_luma) + (b_y >> is_luma) * s->mb_stride;
-                int error_j    = s->error_status_table[mb_index_j];
-                int intra_j    = IS_INTRA(s->cur_pic->mb_type[mb_index_j]);
-                if (intra_j == 0 || !(error_j & ER_DC_ERROR)) {
-                    color[1]    = dc[j + b_y * stride];
-                    distance[1] = b_x - j;
-                    break;
-                }
-            }
-
-            /* bottom block */
-            for (j = b_y + 1; j < h; j++) {
-                int mb_index_j = (b_x >> is_luma) + (j >> is_luma) * s->mb_stride;
-                int error_j    = s->error_status_table[mb_index_j];
-                int intra_j    = IS_INTRA(s->cur_pic->mb_type[mb_index_j]);
-
-                if (intra_j == 0 || !(error_j & ER_DC_ERROR)) {
-                    color[2]    = dc[b_x + j * stride];
-                    distance[2] = j - b_y;
-                    break;
-                }
-            }
-
-            /* top block */
-            for (j = b_y - 1; j >= 0; j--) {
-                int mb_index_j = (b_x >> is_luma) + (j >> is_luma) * s->mb_stride;
-                int error_j    = s->error_status_table[mb_index_j];
-                int intra_j    = IS_INTRA(s->cur_pic->mb_type[mb_index_j]);
-                if (intra_j == 0 || !(error_j & ER_DC_ERROR)) {
-                    color[3]    = dc[b_x + j * stride];
-                    distance[3] = b_y - j;
-                    break;
-                }
-            }
-
-            weight_sum = 0;
-            guess      = 0;
-            for (j = 0; j < 4; j++) {
-                int64_t weight  = 256 * 256 * 256 * 16 / distance[j];
-                guess          += weight * (int64_t) color[j];
-                weight_sum     += weight;
-            }
-            guess = (guess + weight_sum / 2) / weight_sum;
-            dc[b_x + b_y * stride] = guess;
-        }
-    }
-}
-
-/**
- * simple horizontal deblocking filter used for error resilience
- * @param w     width in 8 pixel blocks
- * @param h     height in 8 pixel blocks
- */
-static void h_block_filter(ERContext *s, uint8_t *dst, int w,
-                           int h, int stride, int is_luma)
-{
-    int b_x, b_y, mvx_stride, mvy_stride;
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    set_mv_strides(s, &mvx_stride, &mvy_stride);
-    mvx_stride >>= is_luma;
-    mvy_stride *= mvx_stride;
-
-    for (b_y = 0; b_y < h; b_y++) {
-        for (b_x = 0; b_x < w - 1; b_x++) {
-            int y;
-            int left_status  = s->error_status_table[( b_x      >> is_luma) + (b_y >> is_luma) * s->mb_stride];
-            int right_status = s->error_status_table[((b_x + 1) >> is_luma) + (b_y >> is_luma) * s->mb_stride];
-            int left_intra   = IS_INTRA(s->cur_pic->mb_type[( b_x      >> is_luma) + (b_y >> is_luma) * s->mb_stride]);
-            int right_intra  = IS_INTRA(s->cur_pic->mb_type[((b_x + 1) >> is_luma) + (b_y >> is_luma) * s->mb_stride]);
-            int left_damage  = left_status & ER_MB_ERROR;
-            int right_damage = right_status & ER_MB_ERROR;
-            int offset       = b_x * 8 + b_y * stride * 8;
-            int16_t *left_mv  = s->cur_pic->motion_val[0][mvy_stride * b_y + mvx_stride *  b_x];
-            int16_t *right_mv = s->cur_pic->motion_val[0][mvy_stride * b_y + mvx_stride * (b_x + 1)];
-            if (!(left_damage || right_damage))
-                continue; // both undamaged
-            if ((!left_intra) && (!right_intra) &&
-                FFABS(left_mv[0] - right_mv[0]) +
-                FFABS(left_mv[1] + right_mv[1]) < 2)
-                continue;
-
-            for (y = 0; y < 8; y++) {
-                int a, b, c, d;
-
-                a = dst[offset + 7 + y * stride] - dst[offset + 6 + y * stride];
-                b = dst[offset + 8 + y * stride] - dst[offset + 7 + y * stride];
-                c = dst[offset + 9 + y * stride] - dst[offset + 8 + y * stride];
-
-                d = FFABS(b) - ((FFABS(a) + FFABS(c) + 1) >> 1);
-                d = FFMAX(d, 0);
-                if (b < 0)
-                    d = -d;
-
-                if (d == 0)
-                    continue;
-
-                if (!(left_damage && right_damage))
-                    d = d * 16 / 9;
-
-                if (left_damage) {
-                    dst[offset + 7 + y * stride] = cm[dst[offset + 7 + y * stride] + ((d * 7) >> 4)];
-                    dst[offset + 6 + y * stride] = cm[dst[offset + 6 + y * stride] + ((d * 5) >> 4)];
-                    dst[offset + 5 + y * stride] = cm[dst[offset + 5 + y * stride] + ((d * 3) >> 4)];
-                    dst[offset + 4 + y * stride] = cm[dst[offset + 4 + y * stride] + ((d * 1) >> 4)];
-                }
-                if (right_damage) {
-                    dst[offset + 8 + y * stride] = cm[dst[offset +  8 + y * stride] - ((d * 7) >> 4)];
-                    dst[offset + 9 + y * stride] = cm[dst[offset +  9 + y * stride] - ((d * 5) >> 4)];
-                    dst[offset + 10+ y * stride] = cm[dst[offset + 10 + y * stride] - ((d * 3) >> 4)];
-                    dst[offset + 11+ y * stride] = cm[dst[offset + 11 + y * stride] - ((d * 1) >> 4)];
-                }
-            }
-        }
-    }
-}
-
-/**
- * simple vertical deblocking filter used for error resilience
- * @param w     width in 8 pixel blocks
- * @param h     height in 8 pixel blocks
- */
-static void v_block_filter(ERContext *s, uint8_t *dst, int w, int h,
-                           int stride, int is_luma)
-{
-    int b_x, b_y, mvx_stride, mvy_stride;
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    set_mv_strides(s, &mvx_stride, &mvy_stride);
-    mvx_stride >>= is_luma;
-    mvy_stride *= mvx_stride;
-
-    for (b_y = 0; b_y < h - 1; b_y++) {
-        for (b_x = 0; b_x < w; b_x++) {
-            int x;
-            int top_status    = s->error_status_table[(b_x >> is_luma) +  (b_y      >> is_luma) * s->mb_stride];
-            int bottom_status = s->error_status_table[(b_x >> is_luma) + ((b_y + 1) >> is_luma) * s->mb_stride];
-            int top_intra     = IS_INTRA(s->cur_pic->mb_type[(b_x >> is_luma) + ( b_y      >> is_luma) * s->mb_stride]);
-            int bottom_intra  = IS_INTRA(s->cur_pic->mb_type[(b_x >> is_luma) + ((b_y + 1) >> is_luma) * s->mb_stride]);
-            int top_damage    = top_status & ER_MB_ERROR;
-            int bottom_damage = bottom_status & ER_MB_ERROR;
-            int offset        = b_x * 8 + b_y * stride * 8;
-
-            int16_t *top_mv    = s->cur_pic->motion_val[0][mvy_stride *  b_y      + mvx_stride * b_x];
-            int16_t *bottom_mv = s->cur_pic->motion_val[0][mvy_stride * (b_y + 1) + mvx_stride * b_x];
-
-            if (!(top_damage || bottom_damage))
-                continue; // both undamaged
-
-            if ((!top_intra) && (!bottom_intra) &&
-                FFABS(top_mv[0] - bottom_mv[0]) +
-                FFABS(top_mv[1] + bottom_mv[1]) < 2)
-                continue;
-
-            for (x = 0; x < 8; x++) {
-                int a, b, c, d;
-
-                a = dst[offset + x + 7 * stride] - dst[offset + x + 6 * stride];
-                b = dst[offset + x + 8 * stride] - dst[offset + x + 7 * stride];
-                c = dst[offset + x + 9 * stride] - dst[offset + x + 8 * stride];
-
-                d = FFABS(b) - ((FFABS(a) + FFABS(c) + 1) >> 1);
-                d = FFMAX(d, 0);
-                if (b < 0)
-                    d = -d;
-
-                if (d == 0)
-                    continue;
-
-                if (!(top_damage && bottom_damage))
-                    d = d * 16 / 9;
-
-                if (top_damage) {
-                    dst[offset + x +  7 * stride] = cm[dst[offset + x +  7 * stride] + ((d * 7) >> 4)];
-                    dst[offset + x +  6 * stride] = cm[dst[offset + x +  6 * stride] + ((d * 5) >> 4)];
-                    dst[offset + x +  5 * stride] = cm[dst[offset + x +  5 * stride] + ((d * 3) >> 4)];
-                    dst[offset + x +  4 * stride] = cm[dst[offset + x +  4 * stride] + ((d * 1) >> 4)];
-                }
-                if (bottom_damage) {
-                    dst[offset + x +  8 * stride] = cm[dst[offset + x +  8 * stride] - ((d * 7) >> 4)];
-                    dst[offset + x +  9 * stride] = cm[dst[offset + x +  9 * stride] - ((d * 5) >> 4)];
-                    dst[offset + x + 10 * stride] = cm[dst[offset + x + 10 * stride] - ((d * 3) >> 4)];
-                    dst[offset + x + 11 * stride] = cm[dst[offset + x + 11 * stride] - ((d * 1) >> 4)];
-                }
-            }
-        }
-    }
-}
-
-static void guess_mv(ERContext *s)
-{
-    uint8_t *fixed = s->er_temp_buffer;
-#define MV_FROZEN    3
-#define MV_CHANGED   2
-#define MV_UNCHANGED 1
-    const int mb_stride = s->mb_stride;
-    const int mb_width  = s->mb_width;
-    const int mb_height = s->mb_height;
-    int i, depth, num_avail;
-    int mb_x, mb_y, mot_step, mot_stride;
-
-    set_mv_strides(s, &mot_step, &mot_stride);
-
-    num_avail = 0;
-    for (i = 0; i < s->mb_num; i++) {
-        const int mb_xy = s->mb_index2xy[i];
-        int f = 0;
-        int error = s->error_status_table[mb_xy];
-
-        if (IS_INTRA(s->cur_pic->mb_type[mb_xy]))
-            f = MV_FROZEN; // intra // FIXME check
-        if (!(error & ER_MV_ERROR))
-            f = MV_FROZEN; // inter with undamaged MV
-
-        fixed[mb_xy] = f;
-        if (f == MV_FROZEN)
-            num_avail++;
-    }
-
-    if ((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) ||
-        num_avail <= mb_width / 2) {
-        for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-            for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-                const int mb_xy = mb_x + mb_y * s->mb_stride;
-                int mv_dir = (s->last_pic && s->last_pic->f.data[0]) ? MV_DIR_FORWARD : MV_DIR_BACKWARD;
-
-                if (IS_INTRA(s->cur_pic->mb_type[mb_xy]))
-                    continue;
-                if (!(s->error_status_table[mb_xy] & ER_MV_ERROR))
-                    continue;
-
-                s->mv[0][0][0] = 0;
-                s->mv[0][0][1] = 0;
-                s->decode_mb(s->opaque, 0, mv_dir, MV_TYPE_16X16, &s->mv,
-                             mb_x, mb_y, 0, 0);
-            }
-        }
-        return;
-    }
-
-    for (depth = 0; ; depth++) {
-        int changed, pass, none_left;
-
-        none_left = 1;
-        changed   = 1;
-        for (pass = 0; (changed || pass < 2) && pass < 10; pass++) {
-            int mb_x, mb_y;
-            int score_sum = 0;
-
-            changed = 0;
-            for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-                for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-                    const int mb_xy        = mb_x + mb_y * s->mb_stride;
-                    int mv_predictor[8][2] = { { 0 } };
-                    int ref[8]             = { 0 };
-                    int pred_count         = 0;
-                    int j;
-                    int best_score         = 256 * 256 * 256 * 64;
-                    int best_pred          = 0;
-                    const int mot_index    = (mb_x + mb_y * mot_stride) * mot_step;
-                    int prev_x, prev_y, prev_ref;
-
-                    if ((mb_x ^ mb_y ^ pass) & 1)
-                        continue;
-
-                    if (fixed[mb_xy] == MV_FROZEN)
-                        continue;
-                    assert(!IS_INTRA(s->cur_pic->mb_type[mb_xy]));
-                    assert(s->last_pic && s->last_pic->f.data[0]);
-
-                    j = 0;
-                    if (mb_x > 0             && fixed[mb_xy - 1]         == MV_FROZEN)
-                        j = 1;
-                    if (mb_x + 1 < mb_width  && fixed[mb_xy + 1]         == MV_FROZEN)
-                        j = 1;
-                    if (mb_y > 0             && fixed[mb_xy - mb_stride] == MV_FROZEN)
-                        j = 1;
-                    if (mb_y + 1 < mb_height && fixed[mb_xy + mb_stride] == MV_FROZEN)
-                        j = 1;
-                    if (j == 0)
-                        continue;
-
-                    j = 0;
-                    if (mb_x > 0             && fixed[mb_xy - 1        ] == MV_CHANGED)
-                        j = 1;
-                    if (mb_x + 1 < mb_width  && fixed[mb_xy + 1        ] == MV_CHANGED)
-                        j = 1;
-                    if (mb_y > 0             && fixed[mb_xy - mb_stride] == MV_CHANGED)
-                        j = 1;
-                    if (mb_y + 1 < mb_height && fixed[mb_xy + mb_stride] == MV_CHANGED)
-                        j = 1;
-                    if (j == 0 && pass > 1)
-                        continue;
-
-                    none_left = 0;
-
-                    if (mb_x > 0 && fixed[mb_xy - 1]) {
-                        mv_predictor[pred_count][0] =
-                            s->cur_pic->motion_val[0][mot_index - mot_step][0];
-                        mv_predictor[pred_count][1] =
-                            s->cur_pic->motion_val[0][mot_index - mot_step][1];
-                        ref[pred_count] =
-                            s->cur_pic->ref_index[0][4 * (mb_xy - 1)];
-                        pred_count++;
-                    }
-                    if (mb_x + 1 < mb_width && fixed[mb_xy + 1]) {
-                        mv_predictor[pred_count][0] =
-                            s->cur_pic->motion_val[0][mot_index + mot_step][0];
-                        mv_predictor[pred_count][1] =
-                            s->cur_pic->motion_val[0][mot_index + mot_step][1];
-                        ref[pred_count] =
-                            s->cur_pic->ref_index[0][4 * (mb_xy + 1)];
-                        pred_count++;
-                    }
-                    if (mb_y > 0 && fixed[mb_xy - mb_stride]) {
-                        mv_predictor[pred_count][0] =
-                            s->cur_pic->motion_val[0][mot_index - mot_stride * mot_step][0];
-                        mv_predictor[pred_count][1] =
-                            s->cur_pic->motion_val[0][mot_index - mot_stride * mot_step][1];
-                        ref[pred_count] =
-                            s->cur_pic->ref_index[0][4 * (mb_xy - s->mb_stride)];
-                        pred_count++;
-                    }
-                    if (mb_y + 1<mb_height && fixed[mb_xy + mb_stride]) {
-                        mv_predictor[pred_count][0] =
-                            s->cur_pic->motion_val[0][mot_index + mot_stride * mot_step][0];
-                        mv_predictor[pred_count][1] =
-                            s->cur_pic->motion_val[0][mot_index + mot_stride * mot_step][1];
-                        ref[pred_count] =
-                            s->cur_pic->ref_index[0][4 * (mb_xy + s->mb_stride)];
-                        pred_count++;
-                    }
-                    if (pred_count == 0)
-                        continue;
-
-                    if (pred_count > 1) {
-                        int sum_x = 0, sum_y = 0, sum_r = 0;
-                        int max_x, max_y, min_x, min_y, max_r, min_r;
-
-                        for (j = 0; j < pred_count; j++) {
-                            sum_x += mv_predictor[j][0];
-                            sum_y += mv_predictor[j][1];
-                            sum_r += ref[j];
-                            if (j && ref[j] != ref[j - 1])
-                                goto skip_mean_and_median;
-                        }
-
-                        /* mean */
-                        mv_predictor[pred_count][0] = sum_x / j;
-                        mv_predictor[pred_count][1] = sum_y / j;
-                                 ref[pred_count]    = sum_r / j;
-
-                        /* median */
-                        if (pred_count >= 3) {
-                            min_y = min_x = min_r =  99999;
-                            max_y = max_x = max_r = -99999;
-                        } else {
-                            min_x = min_y = max_x = max_y = min_r = max_r = 0;
-                        }
-                        for (j = 0; j < pred_count; j++) {
-                            max_x = FFMAX(max_x, mv_predictor[j][0]);
-                            max_y = FFMAX(max_y, mv_predictor[j][1]);
-                            max_r = FFMAX(max_r, ref[j]);
-                            min_x = FFMIN(min_x, mv_predictor[j][0]);
-                            min_y = FFMIN(min_y, mv_predictor[j][1]);
-                            min_r = FFMIN(min_r, ref[j]);
-                        }
-                        mv_predictor[pred_count + 1][0] = sum_x - max_x - min_x;
-                        mv_predictor[pred_count + 1][1] = sum_y - max_y - min_y;
-                                 ref[pred_count + 1]    = sum_r - max_r - min_r;
-
-                        if (pred_count == 4) {
-                            mv_predictor[pred_count + 1][0] /= 2;
-                            mv_predictor[pred_count + 1][1] /= 2;
-                                     ref[pred_count + 1]    /= 2;
-                        }
-                        pred_count += 2;
-                    }
-
-skip_mean_and_median:
-                    /* zero MV */
-                    pred_count++;
-
-                    if (!fixed[mb_xy]) {
-                        if (s->avctx->codec_id == AV_CODEC_ID_H264) {
-                            // FIXME
-                        } else {
-                            ff_thread_await_progress(&s->last_pic->tf,
-                                                     mb_y, 0);
-                        }
-                        if (!s->last_pic->motion_val[0] ||
-                            !s->last_pic->ref_index[0])
-                            goto skip_last_mv;
-                        prev_x   = s->last_pic->motion_val[0][mot_index][0];
-                        prev_y   = s->last_pic->motion_val[0][mot_index][1];
-                        prev_ref = s->last_pic->ref_index[0][4 * mb_xy];
-                    } else {
-                        prev_x   = s->cur_pic->motion_val[0][mot_index][0];
-                        prev_y   = s->cur_pic->motion_val[0][mot_index][1];
-                        prev_ref = s->cur_pic->ref_index[0][4 * mb_xy];
-                    }
-
-                    /* last MV */
-                    mv_predictor[pred_count][0] = prev_x;
-                    mv_predictor[pred_count][1] = prev_y;
-                             ref[pred_count]    = prev_ref;
-                    pred_count++;
-
-skip_last_mv:
-
-                    for (j = 0; j < pred_count; j++) {
-                        int *linesize = s->cur_pic->f.linesize;
-                        int score = 0;
-                        uint8_t *src = s->cur_pic->f.data[0] +
-                                       mb_x * 16 + mb_y * 16 * linesize[0];
-
-                        s->cur_pic->motion_val[0][mot_index][0] =
-                            s->mv[0][0][0] = mv_predictor[j][0];
-                        s->cur_pic->motion_val[0][mot_index][1] =
-                            s->mv[0][0][1] = mv_predictor[j][1];
-
-                        // predictor intra or otherwise not available
-                        if (ref[j] < 0)
-                            continue;
-
-                        s->decode_mb(s->opaque, ref[j], MV_DIR_FORWARD,
-                                     MV_TYPE_16X16, &s->mv, mb_x, mb_y, 0, 0);
-
-                        if (mb_x > 0 && fixed[mb_xy - 1]) {
-                            int k;
-                            for (k = 0; k < 16; k++)
-                                score += FFABS(src[k * linesize[0] - 1] -
-                                               src[k * linesize[0]]);
-                        }
-                        if (mb_x + 1 < mb_width && fixed[mb_xy + 1]) {
-                            int k;
-                            for (k = 0; k < 16; k++)
-                                score += FFABS(src[k * linesize[0] + 15] -
-                                               src[k * linesize[0] + 16]);
-                        }
-                        if (mb_y > 0 && fixed[mb_xy - mb_stride]) {
-                            int k;
-                            for (k = 0; k < 16; k++)
-                                score += FFABS(src[k - linesize[0]] - src[k]);
-                        }
-                        if (mb_y + 1 < mb_height && fixed[mb_xy + mb_stride]) {
-                            int k;
-                            for (k = 0; k < 16; k++)
-                                score += FFABS(src[k + linesize[0] * 15] -
-                                               src[k + linesize[0] * 16]);
-                        }
-
-                        if (score <= best_score) { // <= will favor the last MV
-                            best_score = score;
-                            best_pred  = j;
-                        }
-                    }
-                    score_sum += best_score;
-                    s->mv[0][0][0] = mv_predictor[best_pred][0];
-                    s->mv[0][0][1] = mv_predictor[best_pred][1];
-
-                    for (i = 0; i < mot_step; i++)
-                        for (j = 0; j < mot_step; j++) {
-                            s->cur_pic->motion_val[0][mot_index + i + j * mot_stride][0] = s->mv[0][0][0];
-                            s->cur_pic->motion_val[0][mot_index + i + j * mot_stride][1] = s->mv[0][0][1];
-                        }
-
-                    s->decode_mb(s->opaque, ref[best_pred], MV_DIR_FORWARD,
-                                 MV_TYPE_16X16, &s->mv, mb_x, mb_y, 0, 0);
-
-
-                    if (s->mv[0][0][0] != prev_x || s->mv[0][0][1] != prev_y) {
-                        fixed[mb_xy] = MV_CHANGED;
-                        changed++;
-                    } else
-                        fixed[mb_xy] = MV_UNCHANGED;
-                }
-            }
-        }
-
-        if (none_left)
-            return;
-
-        for (i = 0; i < s->mb_num; i++) {
-            int mb_xy = s->mb_index2xy[i];
-            if (fixed[mb_xy])
-                fixed[mb_xy] = MV_FROZEN;
-        }
-    }
-}
-
-static int is_intra_more_likely(ERContext *s)
-{
-    int is_intra_likely, i, j, undamaged_count, skip_amount, mb_x, mb_y;
-
-    if (!s->last_pic || !s->last_pic->f.data[0])
-        return 1; // no previous frame available -> use spatial prediction
-
-    undamaged_count = 0;
-    for (i = 0; i < s->mb_num; i++) {
-        const int mb_xy = s->mb_index2xy[i];
-        const int error = s->error_status_table[mb_xy];
-        if (!((error & ER_DC_ERROR) && (error & ER_MV_ERROR)))
-            undamaged_count++;
-    }
-
-    if (s->avctx->codec_id == AV_CODEC_ID_H264 && s->ref_count <= 0)
-        return 1;
-
-    if (undamaged_count < 5)
-        return 0; // almost all MBs damaged -> use temporal prediction
-
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-    // prevent dsp.sad() check, that requires access to the image
-    if (CONFIG_MPEG_XVMC_DECODER    &&
-        s->avctx->xvmc_acceleration &&
-        s->cur_pic->f.pict_type == AV_PICTURE_TYPE_I)
-        return 1;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-    skip_amount     = FFMAX(undamaged_count / 50, 1); // check only up to 50 MBs
-    is_intra_likely = 0;
-
-    j = 0;
-    for (mb_y = 0; mb_y < s->mb_height - 1; mb_y++) {
-        for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-            int error;
-            const int mb_xy = mb_x + mb_y * s->mb_stride;
-
-            error = s->error_status_table[mb_xy];
-            if ((error & ER_DC_ERROR) && (error & ER_MV_ERROR))
-                continue; // skip damaged
-
-            j++;
-            // skip a few to speed things up
-            if ((j % skip_amount) != 0)
-                continue;
-
-            if (s->cur_pic->f.pict_type == AV_PICTURE_TYPE_I) {
-                int *linesize = s->cur_pic->f.linesize;
-                uint8_t *mb_ptr      = s->cur_pic->f.data[0] +
-                                       mb_x * 16 + mb_y * 16 * linesize[0];
-                uint8_t *last_mb_ptr = s->last_pic->f.data[0] +
-                                       mb_x * 16 + mb_y * 16 * linesize[0];
-
-                if (s->avctx->codec_id == AV_CODEC_ID_H264) {
-                    // FIXME
-                } else {
-                    ff_thread_await_progress(&s->last_pic->tf, mb_y, 0);
-                }
-                is_intra_likely += s->dsp->sad[0](NULL, last_mb_ptr, mb_ptr,
-                                                 linesize[0], 16);
-                is_intra_likely -= s->dsp->sad[0](NULL, last_mb_ptr,
-                                                 last_mb_ptr + linesize[0] * 16,
-                                                 linesize[0], 16);
-            } else {
-                if (IS_INTRA(s->cur_pic->mb_type[mb_xy]))
-                   is_intra_likely++;
-                else
-                   is_intra_likely--;
-            }
-        }
-    }
-    return is_intra_likely > 0;
-}
-
-void ff_er_frame_start(ERContext *s)
-{
-    if (!s->avctx->error_concealment)
-        return;
-
-    memset(s->error_status_table, ER_MB_ERROR | VP_START | ER_MB_END,
-           s->mb_stride * s->mb_height * sizeof(uint8_t));
-    s->error_count    = 3 * s->mb_num;
-    s->error_occurred = 0;
-}
-
-/**
- * Add a slice.
- * @param endx   x component of the last macroblock, can be -1
- *               for the last of the previous line
- * @param status the status at the end (ER_MV_END, ER_AC_ERROR, ...), it is
- *               assumed that no earlier end or error of the same type occurred
- */
-void ff_er_add_slice(ERContext *s, int startx, int starty,
-                     int endx, int endy, int status)
-{
-    const int start_i  = av_clip(startx + starty * s->mb_width, 0, s->mb_num - 1);
-    const int end_i    = av_clip(endx   + endy   * s->mb_width, 0, s->mb_num);
-    const int start_xy = s->mb_index2xy[start_i];
-    const int end_xy   = s->mb_index2xy[end_i];
-    int mask           = -1;
-
-    if (s->avctx->hwaccel)
-        return;
-
-    if (start_i > end_i || start_xy > end_xy) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "internal error, slice end before start\n");
-        return;
-    }
-
-    if (!s->avctx->error_concealment)
-        return;
-
-    mask &= ~VP_START;
-    if (status & (ER_AC_ERROR | ER_AC_END)) {
-        mask           &= ~(ER_AC_ERROR | ER_AC_END);
-        s->error_count -= end_i - start_i + 1;
-    }
-    if (status & (ER_DC_ERROR | ER_DC_END)) {
-        mask           &= ~(ER_DC_ERROR | ER_DC_END);
-        s->error_count -= end_i - start_i + 1;
-    }
-    if (status & (ER_MV_ERROR | ER_MV_END)) {
-        mask           &= ~(ER_MV_ERROR | ER_MV_END);
-        s->error_count -= end_i - start_i + 1;
-    }
-
-    if (status & ER_MB_ERROR) {
-        s->error_occurred = 1;
-        s->error_count    = INT_MAX;
-    }
-
-    if (mask == ~0x7F) {
-        memset(&s->error_status_table[start_xy], 0,
-               (end_xy - start_xy) * sizeof(uint8_t));
-    } else {
-        int i;
-        for (i = start_xy; i < end_xy; i++)
-            s->error_status_table[i] &= mask;
-    }
-
-    if (end_i == s->mb_num)
-        s->error_count = INT_MAX;
-    else {
-        s->error_status_table[end_xy] &= mask;
-        s->error_status_table[end_xy] |= status;
-    }
-
-    s->error_status_table[start_xy] |= VP_START;
-
-    if (start_xy > 0 && s->avctx->thread_count <= 1 &&
-        s->avctx->skip_top * s->mb_width < start_i) {
-        int prev_status = s->error_status_table[s->mb_index2xy[start_i - 1]];
-
-        prev_status &= ~ VP_START;
-        if (prev_status != (ER_MV_END | ER_DC_END | ER_AC_END))
-            s->error_count = INT_MAX;
-    }
-}
-
-void ff_er_frame_end(ERContext *s)
-{
-    int *linesize = s->cur_pic->f.linesize;
-    int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error;
-    int distance;
-    int threshold_part[4] = { 100, 100, 100 };
-    int threshold = 50;
-    int is_intra_likely;
-    int size = s->b8_stride * 2 * s->mb_height;
-
-    /* We do not support ER of field pictures yet,
-     * though it should not crash if enabled. */
-    if (!s->avctx->error_concealment || s->error_count == 0            ||
-        s->avctx->hwaccel                                              ||
-        !s->cur_pic || s->cur_pic->field_picture                               ||
-        s->error_count == 3 * s->mb_width *
-                          (s->avctx->skip_top + s->avctx->skip_bottom)) {
-        return;
-    };
-
-    if (s->cur_pic->motion_val[0] == NULL) {
-        av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
-
-        for (i = 0; i < 2; i++) {
-            s->cur_pic->ref_index_buf[i]  = av_buffer_allocz(s->mb_stride * s->mb_height * 4 * sizeof(uint8_t));
-            s->cur_pic->motion_val_buf[i] = av_buffer_allocz((size + 4) * 2 * sizeof(uint16_t));
-            if (!s->cur_pic->ref_index_buf[i] || !s->cur_pic->motion_val_buf[i])
-                break;
-            s->cur_pic->ref_index[i]  = s->cur_pic->ref_index_buf[i]->data;
-            s->cur_pic->motion_val[i] = (int16_t (*)[2])s->cur_pic->motion_val_buf[i]->data + 4;
-        }
-        if (i < 2) {
-            for (i = 0; i < 2; i++) {
-                av_buffer_unref(&s->cur_pic->ref_index_buf[i]);
-                av_buffer_unref(&s->cur_pic->motion_val_buf[i]);
-                s->cur_pic->ref_index[i]  = NULL;
-                s->cur_pic->motion_val[i] = NULL;
-            }
-            return;
-        }
-    }
-
-    if (s->avctx->debug & FF_DEBUG_ER) {
-        for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-            for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-                int status = s->error_status_table[mb_x + mb_y * s->mb_stride];
-
-                av_log(s->avctx, AV_LOG_DEBUG, "%2X ", status);
-            }
-            av_log(s->avctx, AV_LOG_DEBUG, "\n");
-        }
-    }
-
-    /* handle overlapping slices */
-    for (error_type = 1; error_type <= 3; error_type++) {
-        int end_ok = 0;
-
-        for (i = s->mb_num - 1; i >= 0; i--) {
-            const int mb_xy = s->mb_index2xy[i];
-            int error       = s->error_status_table[mb_xy];
-
-            if (error & (1 << error_type))
-                end_ok = 1;
-            if (error & (8 << error_type))
-                end_ok = 1;
-
-            if (!end_ok)
-                s->error_status_table[mb_xy] |= 1 << error_type;
-
-            if (error & VP_START)
-                end_ok = 0;
-        }
-    }
-
-    /* handle slices with partitions of different length */
-    if (s->partitioned_frame) {
-        int end_ok = 0;
-
-        for (i = s->mb_num - 1; i >= 0; i--) {
-            const int mb_xy = s->mb_index2xy[i];
-            int error       = s->error_status_table[mb_xy];
-
-            if (error & ER_AC_END)
-                end_ok = 0;
-            if ((error & ER_MV_END) ||
-                (error & ER_DC_END) ||
-                (error & ER_AC_ERROR))
-                end_ok = 1;
-
-            if (!end_ok)
-                s->error_status_table[mb_xy]|= ER_AC_ERROR;
-
-            if (error & VP_START)
-                end_ok = 0;
-        }
-    }
-
-    /* handle missing slices */
-    if (s->avctx->err_recognition & AV_EF_EXPLODE) {
-        int end_ok = 1;
-
-        // FIXME + 100 hack
-        for (i = s->mb_num - 2; i >= s->mb_width + 100; i--) {
-            const int mb_xy = s->mb_index2xy[i];
-            int error1 = s->error_status_table[mb_xy];
-            int error2 = s->error_status_table[s->mb_index2xy[i + 1]];
-
-            if (error1 & VP_START)
-                end_ok = 1;
-
-            if (error2 == (VP_START | ER_MB_ERROR | ER_MB_END) &&
-                error1 != (VP_START | ER_MB_ERROR | ER_MB_END) &&
-                ((error1 & ER_AC_END) || (error1 & ER_DC_END) ||
-                (error1 & ER_MV_END))) {
-                // end & uninit
-                end_ok = 0;
-            }
-
-            if (!end_ok)
-                s->error_status_table[mb_xy] |= ER_MB_ERROR;
-        }
-    }
-
-    /* backward mark errors */
-    distance = 9999999;
-    for (error_type = 1; error_type <= 3; error_type++) {
-        for (i = s->mb_num - 1; i >= 0; i--) {
-            const int mb_xy = s->mb_index2xy[i];
-            int       error = s->error_status_table[mb_xy];
-
-            if (!s->mbskip_table[mb_xy]) // FIXME partition specific
-                distance++;
-            if (error & (1 << error_type))
-                distance = 0;
-
-            if (s->partitioned_frame) {
-                if (distance < threshold_part[error_type - 1])
-                    s->error_status_table[mb_xy] |= 1 << error_type;
-            } else {
-                if (distance < threshold)
-                    s->error_status_table[mb_xy] |= 1 << error_type;
-            }
-
-            if (error & VP_START)
-                distance = 9999999;
-        }
-    }
-
-    /* forward mark errors */
-    error = 0;
-    for (i = 0; i < s->mb_num; i++) {
-        const int mb_xy = s->mb_index2xy[i];
-        int old_error   = s->error_status_table[mb_xy];
-
-        if (old_error & VP_START) {
-            error = old_error & ER_MB_ERROR;
-        } else {
-            error |= old_error & ER_MB_ERROR;
-            s->error_status_table[mb_xy] |= error;
-        }
-    }
-
-    /* handle not partitioned case */
-    if (!s->partitioned_frame) {
-        for (i = 0; i < s->mb_num; i++) {
-            const int mb_xy = s->mb_index2xy[i];
-            error = s->error_status_table[mb_xy];
-            if (error & ER_MB_ERROR)
-                error |= ER_MB_ERROR;
-            s->error_status_table[mb_xy] = error;
-        }
-    }
-
-    dc_error = ac_error = mv_error = 0;
-    for (i = 0; i < s->mb_num; i++) {
-        const int mb_xy = s->mb_index2xy[i];
-        error = s->error_status_table[mb_xy];
-        if (error & ER_DC_ERROR)
-            dc_error++;
-        if (error & ER_AC_ERROR)
-            ac_error++;
-        if (error & ER_MV_ERROR)
-            mv_error++;
-    }
-    av_log(s->avctx, AV_LOG_INFO, "concealing %d DC, %d AC, %d MV errors\n",
-           dc_error, ac_error, mv_error);
-
-    is_intra_likely = is_intra_more_likely(s);
-
-    /* set unknown mb-type to most likely */
-    for (i = 0; i < s->mb_num; i++) {
-        const int mb_xy = s->mb_index2xy[i];
-        error = s->error_status_table[mb_xy];
-        if (!((error & ER_DC_ERROR) && (error & ER_MV_ERROR)))
-            continue;
-
-        if (is_intra_likely)
-            s->cur_pic->mb_type[mb_xy] = MB_TYPE_INTRA4x4;
-        else
-            s->cur_pic->mb_type[mb_xy] = MB_TYPE_16x16 | MB_TYPE_L0;
-    }
-
-    // change inter to intra blocks if no reference frames are available
-    if (!(s->last_pic && s->last_pic->f.data[0]) &&
-        !(s->next_pic && s->next_pic->f.data[0]))
-        for (i = 0; i < s->mb_num; i++) {
-            const int mb_xy = s->mb_index2xy[i];
-            if (!IS_INTRA(s->cur_pic->mb_type[mb_xy]))
-                s->cur_pic->mb_type[mb_xy] = MB_TYPE_INTRA4x4;
-        }
-
-    /* handle inter blocks with damaged AC */
-    for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-        for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-            const int mb_xy   = mb_x + mb_y * s->mb_stride;
-            const int mb_type = s->cur_pic->mb_type[mb_xy];
-            const int dir     = !(s->last_pic && s->last_pic->f.data[0]);
-            const int mv_dir  = dir ? MV_DIR_BACKWARD : MV_DIR_FORWARD;
-            int mv_type;
-
-            error = s->error_status_table[mb_xy];
-
-            if (IS_INTRA(mb_type))
-                continue; // intra
-            if (error & ER_MV_ERROR)
-                continue; // inter with damaged MV
-            if (!(error & ER_AC_ERROR))
-                continue; // undamaged inter
-
-            if (IS_8X8(mb_type)) {
-                int mb_index = mb_x * 2 + mb_y * 2 * s->b8_stride;
-                int j;
-                mv_type = MV_TYPE_8X8;
-                for (j = 0; j < 4; j++) {
-                    s->mv[0][j][0] = s->cur_pic->motion_val[dir][mb_index + (j & 1) + (j >> 1) * s->b8_stride][0];
-                    s->mv[0][j][1] = s->cur_pic->motion_val[dir][mb_index + (j & 1) + (j >> 1) * s->b8_stride][1];
-                }
-            } else {
-                mv_type     = MV_TYPE_16X16;
-                s->mv[0][0][0] = s->cur_pic->motion_val[dir][mb_x * 2 + mb_y * 2 * s->b8_stride][0];
-                s->mv[0][0][1] = s->cur_pic->motion_val[dir][mb_x * 2 + mb_y * 2 * s->b8_stride][1];
-            }
-
-            s->decode_mb(s->opaque, 0 /* FIXME h264 partitioned slices need this set */,
-                         mv_dir, mv_type, &s->mv, mb_x, mb_y, 0, 0);
-        }
-    }
-
-    /* guess MVs */
-    if (s->cur_pic->f.pict_type == AV_PICTURE_TYPE_B) {
-        for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-            for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-                int       xy      = mb_x * 2 + mb_y * 2 * s->b8_stride;
-                const int mb_xy   = mb_x + mb_y * s->mb_stride;
-                const int mb_type = s->cur_pic->mb_type[mb_xy];
-                int mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
-
-                error = s->error_status_table[mb_xy];
-
-                if (IS_INTRA(mb_type))
-                    continue;
-                if (!(error & ER_MV_ERROR))
-                    continue; // inter with undamaged MV
-                if (!(error & ER_AC_ERROR))
-                    continue; // undamaged inter
-
-                if (!(s->last_pic && s->last_pic->f.data[0]))
-                    mv_dir &= ~MV_DIR_FORWARD;
-                if (!(s->next_pic && s->next_pic->f.data[0]))
-                    mv_dir &= ~MV_DIR_BACKWARD;
-
-                if (s->pp_time) {
-                    int time_pp = s->pp_time;
-                    int time_pb = s->pb_time;
-
-                    ff_thread_await_progress(&s->next_pic->tf, mb_y, 0);
-
-                    s->mv[0][0][0] = s->next_pic->motion_val[0][xy][0] *  time_pb            / time_pp;
-                    s->mv[0][0][1] = s->next_pic->motion_val[0][xy][1] *  time_pb            / time_pp;
-                    s->mv[1][0][0] = s->next_pic->motion_val[0][xy][0] * (time_pb - time_pp) / time_pp;
-                    s->mv[1][0][1] = s->next_pic->motion_val[0][xy][1] * (time_pb - time_pp) / time_pp;
-                } else {
-                    s->mv[0][0][0] = 0;
-                    s->mv[0][0][1] = 0;
-                    s->mv[1][0][0] = 0;
-                    s->mv[1][0][1] = 0;
-                }
-
-                s->decode_mb(s->opaque, 0, mv_dir, MV_TYPE_16X16, &s->mv,
-                             mb_x, mb_y, 0, 0);
-            }
-        }
-    } else
-        guess_mv(s);
-
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-    /* the filters below are not XvMC compatible, skip them */
-    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
-        goto ec_clean;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-    /* fill DC for inter blocks */
-    for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-        for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-            int dc, dcu, dcv, y, n;
-            int16_t *dc_ptr;
-            uint8_t *dest_y, *dest_cb, *dest_cr;
-            const int mb_xy   = mb_x + mb_y * s->mb_stride;
-            const int mb_type = s->cur_pic->mb_type[mb_xy];
-
-            error = s->error_status_table[mb_xy];
-
-            if (IS_INTRA(mb_type) && s->partitioned_frame)
-                continue;
-            // if (error & ER_MV_ERROR)
-            //     continue; // inter data damaged FIXME is this good?
-
-            dest_y  = s->cur_pic->f.data[0] + mb_x * 16 + mb_y * 16 * linesize[0];
-            dest_cb = s->cur_pic->f.data[1] + mb_x *  8 + mb_y *  8 * linesize[1];
-            dest_cr = s->cur_pic->f.data[2] + mb_x *  8 + mb_y *  8 * linesize[2];
-
-            dc_ptr = &s->dc_val[0][mb_x * 2 + mb_y * 2 * s->b8_stride];
-            for (n = 0; n < 4; n++) {
-                dc = 0;
-                for (y = 0; y < 8; y++) {
-                    int x;
-                    for (x = 0; x < 8; x++)
-                       dc += dest_y[x + (n & 1) * 8 +
-                             (y + (n >> 1) * 8) * linesize[0]];
-                }
-                dc_ptr[(n & 1) + (n >> 1) * s->b8_stride] = (dc + 4) >> 3;
-            }
-
-            dcu = dcv = 0;
-            for (y = 0; y < 8; y++) {
-                int x;
-                for (x = 0; x < 8; x++) {
-                    dcu += dest_cb[x + y * linesize[1]];
-                    dcv += dest_cr[x + y * linesize[2]];
-                }
-            }
-            s->dc_val[1][mb_x + mb_y * s->mb_stride] = (dcu + 4) >> 3;
-            s->dc_val[2][mb_x + mb_y * s->mb_stride] = (dcv + 4) >> 3;
-        }
-    }
-
-    /* guess DC for damaged blocks */
-    guess_dc(s, s->dc_val[0], s->mb_width * 2, s->mb_height * 2, s->b8_stride, 1);
-    guess_dc(s, s->dc_val[1], s->mb_width, s->mb_height, s->mb_stride, 0);
-    guess_dc(s, s->dc_val[2], s->mb_width, s->mb_height, s->mb_stride, 0);
-
-    /* filter luma DC */
-    filter181(s->dc_val[0], s->mb_width * 2, s->mb_height * 2, s->b8_stride);
-
-    /* render DC only intra */
-    for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-        for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-            uint8_t *dest_y, *dest_cb, *dest_cr;
-            const int mb_xy   = mb_x + mb_y * s->mb_stride;
-            const int mb_type = s->cur_pic->mb_type[mb_xy];
-
-            error = s->error_status_table[mb_xy];
-
-            if (IS_INTER(mb_type))
-                continue;
-            if (!(error & ER_AC_ERROR))
-                continue; // undamaged
-
-            dest_y  = s->cur_pic->f.data[0] + mb_x * 16 + mb_y * 16 * linesize[0];
-            dest_cb = s->cur_pic->f.data[1] + mb_x *  8 + mb_y *  8 * linesize[1];
-            dest_cr = s->cur_pic->f.data[2] + mb_x *  8 + mb_y *  8 * linesize[2];
-
-            put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y);
-        }
-    }
-
-    if (s->avctx->error_concealment & FF_EC_DEBLOCK) {
-        /* filter horizontal block boundaries */
-        h_block_filter(s, s->cur_pic->f.data[0], s->mb_width * 2,
-                       s->mb_height * 2, linesize[0], 1);
-        h_block_filter(s, s->cur_pic->f.data[1], s->mb_width,
-                       s->mb_height, linesize[1], 0);
-        h_block_filter(s, s->cur_pic->f.data[2], s->mb_width,
-                       s->mb_height, linesize[2], 0);
-
-        /* filter vertical block boundaries */
-        v_block_filter(s, s->cur_pic->f.data[0], s->mb_width * 2,
-                       s->mb_height * 2, linesize[0], 1);
-        v_block_filter(s, s->cur_pic->f.data[1], s->mb_width,
-                       s->mb_height, linesize[1], 0);
-        v_block_filter(s, s->cur_pic->f.data[2], s->mb_width,
-                       s->mb_height, linesize[2], 0);
-    }
-
-ec_clean:
-    /* clean a few tables */
-    for (i = 0; i < s->mb_num; i++) {
-        const int mb_xy = s->mb_index2xy[i];
-        int       error = s->error_status_table[mb_xy];
-
-        if (s->cur_pic->f.pict_type != AV_PICTURE_TYPE_B &&
-            (error & (ER_DC_ERROR | ER_MV_ERROR | ER_AC_ERROR))) {
-            s->mbskip_table[mb_xy] = 0;
-        }
-        s->mbintra_table[mb_xy] = 1;
-    }
-    s->cur_pic = NULL;
-    s->next_pic    = NULL;
-    s->last_pic    = NULL;
-}
diff --git a/deps/libav/libavcodec/error_resilience.h b/deps/libav/libavcodec/error_resilience.h
deleted file mode 100644
index f979656..0000000
--- a/deps/libav/libavcodec/error_resilience.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ERROR_RESILIENCE_H
-#define AVCODEC_ERROR_RESILIENCE_H
-
-#include <stdint.h>
-
-#include "avcodec.h"
-#include "dsputil.h"
-
-///< current MB is the first after a resync marker
-#define VP_START               1
-#define ER_AC_ERROR            2
-#define ER_DC_ERROR            4
-#define ER_MV_ERROR            8
-#define ER_AC_END              16
-#define ER_DC_END              32
-#define ER_MV_END              64
-
-#define ER_MB_ERROR (ER_AC_ERROR|ER_DC_ERROR|ER_MV_ERROR)
-#define ER_MB_END   (ER_AC_END|ER_DC_END|ER_MV_END)
-
-typedef struct ERContext {
-    AVCodecContext *avctx;
-    DSPContext *dsp;
-
-    int *mb_index2xy;
-    int mb_num;
-    int mb_width, mb_height;
-    int mb_stride;
-    int b8_stride;
-
-    int error_count, error_occurred;
-    uint8_t *error_status_table;
-    uint8_t *er_temp_buffer;
-    int16_t *dc_val[3];
-    uint8_t *mbskip_table;
-    uint8_t *mbintra_table;
-    int mv[2][4][2];
-
-    struct Picture *cur_pic;
-    struct Picture *last_pic;
-    struct Picture *next_pic;
-
-    uint16_t pp_time;
-    uint16_t pb_time;
-    int quarter_sample;
-    int partitioned_frame;
-    int ref_count;
-
-    void (*decode_mb)(void *opaque, int ref, int mv_dir, int mv_type,
-                      int (*mv)[2][4][2],
-                      int mb_x, int mb_y, int mb_intra, int mb_skipped);
-    void *opaque;
-} ERContext;
-
-void ff_er_frame_start(ERContext *s);
-void ff_er_frame_end(ERContext *s);
-void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy,
-                     int status);
-
-#endif /* AVCODEC_ERROR_RESILIENCE_H */
diff --git a/deps/libav/libavcodec/escape124.c b/deps/libav/libavcodec/escape124.c
deleted file mode 100644
index 30f22e0..0000000
--- a/deps/libav/libavcodec/escape124.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Escape 124 Video Decoder
- * Copyright (C) 2008 Eli Friedman (eli.friedman at gmail.com)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "internal.h"
-
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-
-typedef union MacroBlock {
-    uint16_t pixels[4];
-    uint32_t pixels32[2];
-} MacroBlock;
-
-typedef union SuperBlock {
-    uint16_t pixels[64];
-    uint32_t pixels32[32];
-} SuperBlock;
-
-typedef struct CodeBook {
-    unsigned depth;
-    unsigned size;
-    MacroBlock* blocks;
-} CodeBook;
-
-typedef struct Escape124Context {
-    AVFrame *frame;
-
-    unsigned num_superblocks;
-
-    CodeBook codebooks[3];
-} Escape124Context;
-
-static int can_safely_read(GetBitContext* gb, int bits) {
-    return get_bits_left(gb) >= bits;
-}
-
-/**
- * Initialize the decoder
- * @param avctx decoder context
- * @return 0 success, negative on error
- */
-static av_cold int escape124_decode_init(AVCodecContext *avctx)
-{
-    Escape124Context *s = avctx->priv_data;
-
-    avctx->pix_fmt = AV_PIX_FMT_RGB555;
-
-    s->num_superblocks = ((unsigned)avctx->width / 8) *
-                         ((unsigned)avctx->height / 8);
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static av_cold int escape124_decode_close(AVCodecContext *avctx)
-{
-    unsigned i;
-    Escape124Context *s = avctx->priv_data;
-
-    for (i = 0; i < 3; i++)
-        av_free(s->codebooks[i].blocks);
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth,
-                                 unsigned size)
-{
-    unsigned i, j;
-    CodeBook cb = { 0 };
-
-    if (!can_safely_read(gb, size * 34))
-        return cb;
-
-    if (size >= INT_MAX / sizeof(MacroBlock))
-        return cb;
-    cb.blocks = av_malloc(size ? size * sizeof(MacroBlock) : 1);
-    if (!cb.blocks)
-        return cb;
-
-    cb.depth = depth;
-    cb.size = size;
-    for (i = 0; i < size; i++) {
-        unsigned mask_bits = get_bits(gb, 4);
-        unsigned color0 = get_bits(gb, 15);
-        unsigned color1 = get_bits(gb, 15);
-
-        for (j = 0; j < 4; j++) {
-            if (mask_bits & (1 << j))
-                cb.blocks[i].pixels[j] = color1;
-            else
-                cb.blocks[i].pixels[j] = color0;
-        }
-    }
-    return cb;
-}
-
-static unsigned decode_skip_count(GetBitContext* gb)
-{
-    unsigned value;
-    // This function reads a maximum of 23 bits,
-    // which is within the padding space
-    if (!can_safely_read(gb, 1))
-        return -1;
-    value = get_bits1(gb);
-    if (!value)
-        return value;
-
-    value += get_bits(gb, 3);
-    if (value != (1 + ((1 << 3) - 1)))
-        return value;
-
-    value += get_bits(gb, 7);
-    if (value != (1 + ((1 << 3) - 1)) + ((1 << 7) - 1))
-        return value;
-
-    return value + get_bits(gb, 12);
-}
-
-static MacroBlock decode_macroblock(Escape124Context* s, GetBitContext* gb,
-                                    int* codebook_index, int superblock_index)
-{
-    // This function reads a maximum of 22 bits; the callers
-    // guard this function appropriately
-    unsigned block_index, depth;
-
-    if (get_bits1(gb)) {
-        static const char transitions[3][2] = { {2, 1}, {0, 2}, {1, 0} };
-        *codebook_index = transitions[*codebook_index][get_bits1(gb)];
-    }
-
-    depth = s->codebooks[*codebook_index].depth;
-
-    // depth = 0 means that this shouldn't read any bits;
-    // in theory, this is the same as get_bits(gb, 0), but
-    // that doesn't actually work.
-    block_index = depth ? get_bits(gb, depth) : 0;
-
-    if (*codebook_index == 1) {
-        block_index += superblock_index << s->codebooks[1].depth;
-    }
-
-    // This condition can occur with invalid bitstreams and
-    // *codebook_index == 2
-    if (block_index >= s->codebooks[*codebook_index].size)
-        return (MacroBlock) { { 0 } };
-
-    return s->codebooks[*codebook_index].blocks[block_index];
-}
-
-static void insert_mb_into_sb(SuperBlock* sb, MacroBlock mb, unsigned index) {
-   // Formula: ((index / 4) * 16 + (index % 4) * 2) / 2
-   uint32_t *dst = sb->pixels32 + index + (index & -4);
-
-   // This technically violates C99 aliasing rules, but it should be safe.
-   dst[0] = mb.pixels32[0];
-   dst[4] = mb.pixels32[1];
-}
-
-static void copy_superblock(uint16_t* dest, unsigned dest_stride,
-                            uint16_t* src, unsigned src_stride)
-{
-    unsigned y;
-    if (src)
-        for (y = 0; y < 8; y++)
-            memcpy(dest + y * dest_stride, src + y * src_stride,
-                   sizeof(uint16_t) * 8);
-    else
-        for (y = 0; y < 8; y++)
-            memset(dest + y * dest_stride, 0, sizeof(uint16_t) * 8);
-}
-
-static const uint16_t mask_matrix[] = {0x1,   0x2,   0x10,   0x20,
-                                       0x4,   0x8,   0x40,   0x80,
-                                       0x100, 0x200, 0x1000, 0x2000,
-                                       0x400, 0x800, 0x4000, 0x8000};
-
-static int escape124_decode_frame(AVCodecContext *avctx,
-                                  void *data, int *got_frame,
-                                  AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    Escape124Context *s = avctx->priv_data;
-    AVFrame *frame = data;
-
-    GetBitContext gb;
-    unsigned frame_flags, frame_size;
-    unsigned i;
-
-    unsigned superblock_index, cb_index = 1,
-             superblock_col_index = 0,
-             superblocks_per_row = avctx->width / 8, skip = -1;
-
-    uint16_t* old_frame_data, *new_frame_data;
-    unsigned old_stride, new_stride;
-    int ret;
-
-    init_get_bits(&gb, buf, buf_size * 8);
-
-    // This call also guards the potential depth reads for the
-    // codebook unpacking.
-    if (!can_safely_read(&gb, 64))
-        return -1;
-
-    frame_flags = get_bits_long(&gb, 32);
-    frame_size  = get_bits_long(&gb, 32);
-
-    // Leave last frame unchanged
-    // FIXME: Is this necessary?  I haven't seen it in any real samples
-    if (!(frame_flags & 0x114) || !(frame_flags & 0x7800000)) {
-        if (!s->frame->data[0])
-            return AVERROR_INVALIDDATA;
-
-        av_log(NULL, AV_LOG_DEBUG, "Skipping frame\n");
-
-        *got_frame = 1;
-        if ((ret = av_frame_ref(frame, s->frame)) < 0)
-            return ret;
-
-        return frame_size;
-    }
-
-    for (i = 0; i < 3; i++) {
-        if (frame_flags & (1 << (17 + i))) {
-            unsigned cb_depth, cb_size;
-            if (i == 2) {
-                // This codebook can be cut off at places other than
-                // powers of 2, leaving some of the entries undefined.
-                cb_size = get_bits_long(&gb, 20);
-                cb_depth = av_log2(cb_size - 1) + 1;
-            } else {
-                cb_depth = get_bits(&gb, 4);
-                if (i == 0) {
-                    // This is the most basic codebook: pow(2,depth) entries
-                    // for a depth-length key
-                    cb_size = 1 << cb_depth;
-                } else {
-                    // This codebook varies per superblock
-                    // FIXME: I don't think this handles integer overflow
-                    // properly
-                    cb_size = s->num_superblocks << cb_depth;
-                }
-            }
-            av_free(s->codebooks[i].blocks);
-            s->codebooks[i] = unpack_codebook(&gb, cb_depth, cb_size);
-            if (!s->codebooks[i].blocks)
-                return -1;
-        }
-    }
-
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    new_frame_data = (uint16_t*)frame->data[0];
-    new_stride = frame->linesize[0] / 2;
-    old_frame_data = (uint16_t*)s->frame->data[0];
-    old_stride = s->frame->linesize[0] / 2;
-
-    for (superblock_index = 0; superblock_index < s->num_superblocks;
-         superblock_index++) {
-        MacroBlock mb;
-        SuperBlock sb;
-        unsigned multi_mask = 0;
-
-        if (skip == -1) {
-            // Note that this call will make us skip the rest of the blocks
-            // if the frame prematurely ends
-            skip = decode_skip_count(&gb);
-        }
-
-        if (skip) {
-            copy_superblock(new_frame_data, new_stride,
-                            old_frame_data, old_stride);
-        } else {
-            copy_superblock(sb.pixels, 8,
-                            old_frame_data, old_stride);
-
-            while (can_safely_read(&gb, 1) && !get_bits1(&gb)) {
-                unsigned mask;
-                mb = decode_macroblock(s, &gb, &cb_index, superblock_index);
-                mask = get_bits(&gb, 16);
-                multi_mask |= mask;
-                for (i = 0; i < 16; i++) {
-                    if (mask & mask_matrix[i]) {
-                        insert_mb_into_sb(&sb, mb, i);
-                    }
-                }
-            }
-
-            if (can_safely_read(&gb, 1) && !get_bits1(&gb)) {
-                unsigned inv_mask = get_bits(&gb, 4);
-                for (i = 0; i < 4; i++) {
-                    if (inv_mask & (1 << i)) {
-                        multi_mask ^= 0xF << i*4;
-                    } else {
-                        multi_mask ^= get_bits(&gb, 4) << i*4;
-                    }
-                }
-
-                for (i = 0; i < 16; i++) {
-                    if (multi_mask & mask_matrix[i]) {
-                        if (!can_safely_read(&gb, 1))
-                            break;
-                        mb = decode_macroblock(s, &gb, &cb_index,
-                                               superblock_index);
-                        insert_mb_into_sb(&sb, mb, i);
-                    }
-                }
-            } else if (frame_flags & (1 << 16)) {
-                while (can_safely_read(&gb, 1) && !get_bits1(&gb)) {
-                    mb = decode_macroblock(s, &gb, &cb_index, superblock_index);
-                    insert_mb_into_sb(&sb, mb, get_bits(&gb, 4));
-                }
-            }
-
-            copy_superblock(new_frame_data, new_stride, sb.pixels, 8);
-        }
-
-        superblock_col_index++;
-        new_frame_data += 8;
-        if (old_frame_data)
-            old_frame_data += 8;
-        if (superblock_col_index == superblocks_per_row) {
-            new_frame_data += new_stride * 8 - superblocks_per_row * 8;
-            if (old_frame_data)
-                old_frame_data += old_stride * 8 - superblocks_per_row * 8;
-            superblock_col_index = 0;
-        }
-        skip--;
-    }
-
-    av_log(NULL, AV_LOG_DEBUG,
-           "Escape sizes: %i, %i, %i\n",
-           frame_size, buf_size, get_bits_count(&gb) / 8);
-
-    av_frame_unref(s->frame);
-    if ((ret = av_frame_ref(s->frame, frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    return frame_size;
-}
-
-
-AVCodec ff_escape124_decoder = {
-    .name           = "escape124",
-    .long_name      = NULL_IF_CONFIG_SMALL("Escape 124"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ESCAPE124,
-    .priv_data_size = sizeof(Escape124Context),
-    .init           = escape124_decode_init,
-    .close          = escape124_decode_close,
-    .decode         = escape124_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/escape130.c b/deps/libav/libavcodec/escape130.c
deleted file mode 100644
index bc865a3..0000000
--- a/deps/libav/libavcodec/escape130.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Escape 130 video decoder
- * Copyright (C) 2008 Eli Friedman (eli.friedman <at> gmail.com)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "internal.h"
-
-typedef struct Escape130Context {
-    uint8_t *old_y_avg;
-
-    uint8_t *new_y, *old_y;
-    uint8_t *new_u, *old_u;
-    uint8_t *new_v, *old_v;
-
-    uint8_t *buf1, *buf2;
-    int     linesize[3];
-} Escape130Context;
-
-static const uint8_t offset_table[] = { 2, 4, 10, 20 };
-static const int8_t sign_table[64][4] = {
-    {  0,  0,  0,  0 },
-    { -1,  1,  0,  0 },
-    {  1, -1,  0,  0 },
-    { -1,  0,  1,  0 },
-    { -1,  1,  1,  0 },
-    {  0, -1,  1,  0 },
-    {  1, -1,  1,  0 },
-    { -1, -1,  1,  0 },
-    {  1,  0, -1,  0 },
-    {  0,  1, -1,  0 },
-    {  1,  1, -1,  0 },
-    { -1,  1, -1,  0 },
-    {  1, -1, -1,  0 },
-    { -1,  0,  0,  1 },
-    { -1,  1,  0,  1 },
-    {  0, -1,  0,  1 },
-
-    {  0,  0,  0,  0 },
-    {  1, -1,  0,  1 },
-    { -1, -1,  0,  1 },
-    { -1,  0,  1,  1 },
-    { -1,  1,  1,  1 },
-    {  0, -1,  1,  1 },
-    {  1, -1,  1,  1 },
-    { -1, -1,  1,  1 },
-    {  0,  0, -1,  1 },
-    {  1,  0, -1,  1 },
-    { -1,  0, -1,  1 },
-    {  0,  1, -1,  1 },
-    {  1,  1, -1,  1 },
-    { -1,  1, -1,  1 },
-    {  0, -1, -1,  1 },
-    {  1, -1, -1,  1 },
-
-    {  0,  0,  0,  0 },
-    { -1, -1, -1,  1 },
-    {  1,  0,  0, -1 },
-    {  0,  1,  0, -1 },
-    {  1,  1,  0, -1 },
-    { -1,  1,  0, -1 },
-    {  1, -1,  0, -1 },
-    {  0,  0,  1, -1 },
-    {  1,  0,  1, -1 },
-    { -1,  0,  1, -1 },
-    {  0,  1,  1, -1 },
-    {  1,  1,  1, -1 },
-    { -1,  1,  1, -1 },
-    {  0, -1,  1, -1 },
-    {  1, -1,  1, -1 },
-    { -1, -1,  1, -1 },
-
-    {  0,  0,  0,  0 },
-    {  1,  0, -1, -1 },
-    {  0,  1, -1, -1 },
-    {  1,  1, -1, -1 },
-    { -1,  1, -1, -1 },
-    {  1, -1, -1, -1 }
-};
-
-static const int8_t luma_adjust[] = { -4, -3, -2, -1, 1, 2, 3, 4 };
-
-static const int8_t chroma_adjust[2][8] = {
-    { 1, 1, 0, -1, -1, -1,  0,  1 },
-    { 0, 1, 1,  1,  0, -1, -1, -1 }
-};
-
-const uint8_t chroma_vals[] = {
-     20,  28,  36,  44,  52,  60,  68,  76,
-     84,  92, 100, 106, 112, 116, 120, 124,
-    128, 132, 136, 140, 144, 150, 156, 164,
-    172, 180, 188, 196, 204, 212, 220, 228
-};
-
-static av_cold int escape130_decode_init(AVCodecContext *avctx)
-{
-    Escape130Context *s = avctx->priv_data;
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    if ((avctx->width & 1) || (avctx->height & 1)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Dimensions should be a multiple of two.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->old_y_avg = av_malloc(avctx->width * avctx->height / 4);
-    s->buf1      = av_malloc(avctx->width * avctx->height * 3 / 2);
-    s->buf2      = av_malloc(avctx->width * avctx->height * 3 / 2);
-    if (!s->old_y_avg || !s->buf1 || !s->buf2) {
-        av_freep(&s->old_y_avg);
-        av_freep(&s->buf1);
-        av_freep(&s->buf2);
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    s->linesize[0] = avctx->width;
-    s->linesize[1] =
-    s->linesize[2] = avctx->width / 2;
-
-    s->new_y = s->buf1;
-    s->new_u = s->new_y + avctx->width * avctx->height;
-    s->new_v = s->new_u + avctx->width * avctx->height / 4;
-    s->old_y = s->buf2;
-    s->old_u = s->old_y + avctx->width * avctx->height;
-    s->old_v = s->old_u + avctx->width * avctx->height / 4;
-    memset(s->old_y, 0,    avctx->width * avctx->height);
-    memset(s->old_u, 0x10, avctx->width * avctx->height / 4);
-    memset(s->old_v, 0x10, avctx->width * avctx->height / 4);
-
-    return 0;
-}
-
-static av_cold int escape130_decode_close(AVCodecContext *avctx)
-{
-    Escape130Context *s = avctx->priv_data;
-
-    av_freep(&s->old_y_avg);
-    av_freep(&s->buf1);
-    av_freep(&s->buf2);
-
-    return 0;
-}
-
-static int decode_skip_count(GetBitContext* gb)
-{
-    int value;
-
-    value = get_bits1(gb);
-    if (value)
-        return 0;
-
-    value = get_bits(gb, 3);
-    if (value)
-        return value;
-
-    value = get_bits(gb, 8);
-    if (value)
-        return value + 7;
-
-    value = get_bits(gb, 15);
-    if (value)
-        return value + 262;
-
-    return -1;
-}
-
-static int escape130_decode_frame(AVCodecContext *avctx, void *data,
-                                  int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf  = avpkt->data;
-    int buf_size        = avpkt->size;
-    Escape130Context *s = avctx->priv_data;
-    AVFrame *pic        = data;
-    GetBitContext gb;
-    int ret;
-
-    uint8_t *old_y, *old_cb, *old_cr,
-            *new_y, *new_cb, *new_cr;
-    uint8_t *dstY, *dstU, *dstV;
-    unsigned old_y_stride, old_cb_stride, old_cr_stride,
-             new_y_stride, new_cb_stride, new_cr_stride;
-    unsigned total_blocks = avctx->width * avctx->height / 4,
-             block_index, block_x = 0;
-    unsigned y[4] = { 0 }, cb = 0x10, cr = 0x10;
-    int skip = -1, y_avg = 0, i, j;
-    uint8_t *ya = s->old_y_avg;
-
-    // first 16 bytes are header; no useful information in here
-    if (buf_size <= 16) {
-        av_log(avctx, AV_LOG_ERROR, "Insufficient frame data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    init_get_bits(&gb, buf + 16, (buf_size - 16) * 8);
-
-    new_y  = s->new_y;
-    new_cb = s->new_u;
-    new_cr = s->new_v;
-    new_y_stride  = s->linesize[0];
-    new_cb_stride = s->linesize[1];
-    new_cr_stride = s->linesize[2];
-    old_y  = s->old_y;
-    old_cb = s->old_u;
-    old_cr = s->old_v;
-    old_y_stride  = s->linesize[0];
-    old_cb_stride = s->linesize[1];
-    old_cr_stride = s->linesize[2];
-
-    for (block_index = 0; block_index < total_blocks; block_index++) {
-        // Note that this call will make us skip the rest of the blocks
-        // if the frame ends prematurely.
-        if (skip == -1)
-            skip = decode_skip_count(&gb);
-        if (skip == -1) {
-            av_log(avctx, AV_LOG_ERROR, "Error decoding skip value\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (skip) {
-            y[0] = old_y[0];
-            y[1] = old_y[1];
-            y[2] = old_y[old_y_stride];
-            y[3] = old_y[old_y_stride + 1];
-            y_avg = ya[0];
-            cb = old_cb[0];
-            cr = old_cr[0];
-        } else {
-            if (get_bits1(&gb)) {
-                unsigned sign_selector       = get_bits(&gb, 6);
-                unsigned difference_selector = get_bits(&gb, 2);
-                y_avg = 2 * get_bits(&gb, 5);
-                for (i = 0; i < 4; i++) {
-                    y[i] = av_clip(y_avg + offset_table[difference_selector] *
-                                   sign_table[sign_selector][i], 0, 63);
-                }
-            } else if (get_bits1(&gb)) {
-                if (get_bits1(&gb)) {
-                    y_avg = get_bits(&gb, 6);
-                } else {
-                    unsigned adjust_index = get_bits(&gb, 3);
-                    y_avg = (y_avg + luma_adjust[adjust_index]) & 63;
-                }
-                for (i = 0; i < 4; i++)
-                    y[i] = y_avg;
-            }
-
-            if (get_bits1(&gb)) {
-                if (get_bits1(&gb)) {
-                    cb = get_bits(&gb, 5);
-                    cr = get_bits(&gb, 5);
-                } else {
-                    unsigned adjust_index = get_bits(&gb, 3);
-                    cb = (cb + chroma_adjust[0][adjust_index]) & 31;
-                    cr = (cr + chroma_adjust[1][adjust_index]) & 31;
-                }
-            }
-        }
-        *ya++ = y_avg;
-
-        new_y[0]                = y[0];
-        new_y[1]                = y[1];
-        new_y[new_y_stride]     = y[2];
-        new_y[new_y_stride + 1] = y[3];
-        *new_cb = cb;
-        *new_cr = cr;
-
-        old_y += 2;
-        old_cb++;
-        old_cr++;
-        new_y += 2;
-        new_cb++;
-        new_cr++;
-        block_x++;
-        if (block_x * 2 == avctx->width) {
-            block_x = 0;
-            old_y  += old_y_stride * 2  - avctx->width;
-            old_cb += old_cb_stride     - avctx->width / 2;
-            old_cr += old_cr_stride     - avctx->width / 2;
-            new_y  += new_y_stride * 2  - avctx->width;
-            new_cb += new_cb_stride     - avctx->width / 2;
-            new_cr += new_cr_stride     - avctx->width / 2;
-        }
-
-        skip--;
-    }
-
-    new_y  = s->new_y;
-    new_cb = s->new_u;
-    new_cr = s->new_v;
-    dstY   = pic->data[0];
-    dstU   = pic->data[1];
-    dstV   = pic->data[2];
-    for (j = 0; j < avctx->height; j++) {
-        for (i = 0; i < avctx->width; i++)
-            dstY[i] = new_y[i] << 2;
-        dstY  += pic->linesize[0];
-        new_y += new_y_stride;
-    }
-    for (j = 0; j < avctx->height / 2; j++) {
-        for (i = 0; i < avctx->width / 2; i++) {
-            dstU[i] = chroma_vals[new_cb[i]];
-            dstV[i] = chroma_vals[new_cr[i]];
-        }
-        dstU   += pic->linesize[1];
-        dstV   += pic->linesize[2];
-        new_cb += new_cb_stride;
-        new_cr += new_cr_stride;
-    }
-
-    av_dlog(avctx, "Frame data: provided %d bytes, used %d bytes\n",
-            buf_size, get_bits_count(&gb) >> 3);
-
-    FFSWAP(uint8_t*, s->old_y, s->new_y);
-    FFSWAP(uint8_t*, s->old_u, s->new_u);
-    FFSWAP(uint8_t*, s->old_v, s->new_v);
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_escape130_decoder = {
-    .name           = "escape130",
-    .long_name      = NULL_IF_CONFIG_SMALL("Escape 130"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ESCAPE130,
-    .priv_data_size = sizeof(Escape130Context),
-    .init           = escape130_decode_init,
-    .close          = escape130_decode_close,
-    .decode         = escape130_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/faandct.c b/deps/libav/libavcodec/faandct.c
deleted file mode 100644
index b1d7a14..0000000
--- a/deps/libav/libavcodec/faandct.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Floating point AAN DCT
- * this implementation is based upon the IJG integer AAN DCT (see jfdctfst.c)
- *
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2003 Roman Shaposhnik
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/**
- * @file
- * @brief
- *     Floating point AAN DCT
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "faandct.h"
-#include "libavutil/internal.h"
-#include "libavutil/libm.h"
-
-#define FLOAT float
-
-//numbers generated by simple c code (not as accurate as they could be)
-/*
-for(i=0; i<8; i++){
-    printf("#define B%d %1.20llf\n", i, (long double)1.0/(cosl(i*acosl(-1.0)/(long double)16.0)*sqrtl(2)));
-}
-*/
-#define B0 1.00000000000000000000
-#define B1 0.72095982200694791383 // (cos(pi*1/16)sqrt(2))^-1
-#define B2 0.76536686473017954350 // (cos(pi*2/16)sqrt(2))^-1
-#define B3 0.85043009476725644878 // (cos(pi*3/16)sqrt(2))^-1
-#define B4 1.00000000000000000000 // (cos(pi*4/16)sqrt(2))^-1
-#define B5 1.27275858057283393842 // (cos(pi*5/16)sqrt(2))^-1
-#define B6 1.84775906502257351242 // (cos(pi*6/16)sqrt(2))^-1
-#define B7 3.62450978541155137218 // (cos(pi*7/16)sqrt(2))^-1
-
-
-#define A1 0.70710678118654752438 // cos(pi*4/16)
-#define A2 0.54119610014619698435 // cos(pi*6/16)sqrt(2)
-#define A5 0.38268343236508977170 // cos(pi*6/16)
-#define A4 1.30656296487637652774 // cos(pi*2/16)sqrt(2)
-
-static const FLOAT postscale[64]={
-B0*B0, B0*B1, B0*B2, B0*B3, B0*B4, B0*B5, B0*B6, B0*B7,
-B1*B0, B1*B1, B1*B2, B1*B3, B1*B4, B1*B5, B1*B6, B1*B7,
-B2*B0, B2*B1, B2*B2, B2*B3, B2*B4, B2*B5, B2*B6, B2*B7,
-B3*B0, B3*B1, B3*B2, B3*B3, B3*B4, B3*B5, B3*B6, B3*B7,
-B4*B0, B4*B1, B4*B2, B4*B3, B4*B4, B4*B5, B4*B6, B4*B7,
-B5*B0, B5*B1, B5*B2, B5*B3, B5*B4, B5*B5, B5*B6, B5*B7,
-B6*B0, B6*B1, B6*B2, B6*B3, B6*B4, B6*B5, B6*B6, B6*B7,
-B7*B0, B7*B1, B7*B2, B7*B3, B7*B4, B7*B5, B7*B6, B7*B7,
-};
-
-static av_always_inline void row_fdct(FLOAT temp[64], int16_t *data)
-{
-    FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-    FLOAT tmp10, tmp11, tmp12, tmp13;
-    FLOAT z2, z4, z11, z13;
-    FLOAT av_unused z5;
-    int i;
-
-    for (i=0; i<8*8; i+=8) {
-        tmp0= data[0 + i] + data[7 + i];
-        tmp7= data[0 + i] - data[7 + i];
-        tmp1= data[1 + i] + data[6 + i];
-        tmp6= data[1 + i] - data[6 + i];
-        tmp2= data[2 + i] + data[5 + i];
-        tmp5= data[2 + i] - data[5 + i];
-        tmp3= data[3 + i] + data[4 + i];
-        tmp4= data[3 + i] - data[4 + i];
-
-        tmp10= tmp0 + tmp3;
-        tmp13= tmp0 - tmp3;
-        tmp11= tmp1 + tmp2;
-        tmp12= tmp1 - tmp2;
-
-        temp[0 + i]= tmp10 + tmp11;
-        temp[4 + i]= tmp10 - tmp11;
-
-        tmp12 += tmp13;
-        tmp12 *= A1;
-        temp[2 + i]= tmp13 + tmp12;
-        temp[6 + i]= tmp13 - tmp12;
-
-        tmp4 += tmp5;
-        tmp5 += tmp6;
-        tmp6 += tmp7;
-
-#if 0
-        z5= (tmp4 - tmp6) * A5;
-        z2= tmp4*A2 + z5;
-        z4= tmp6*A4 + z5;
-#else
-        z2= tmp4*(A2+A5) - tmp6*A5;
-        z4= tmp6*(A4-A5) + tmp4*A5;
-#endif
-        tmp5*=A1;
-
-        z11= tmp7 + tmp5;
-        z13= tmp7 - tmp5;
-
-        temp[5 + i]= z13 + z2;
-        temp[3 + i]= z13 - z2;
-        temp[1 + i]= z11 + z4;
-        temp[7 + i]= z11 - z4;
-    }
-}
-
-void ff_faandct(int16_t *data)
-{
-    FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-    FLOAT tmp10, tmp11, tmp12, tmp13;
-    FLOAT z2, z4, z11, z13;
-    FLOAT av_unused z5;
-    FLOAT temp[64];
-    int i;
-
-    emms_c();
-
-    row_fdct(temp, data);
-
-    for (i=0; i<8; i++) {
-        tmp0= temp[8*0 + i] + temp[8*7 + i];
-        tmp7= temp[8*0 + i] - temp[8*7 + i];
-        tmp1= temp[8*1 + i] + temp[8*6 + i];
-        tmp6= temp[8*1 + i] - temp[8*6 + i];
-        tmp2= temp[8*2 + i] + temp[8*5 + i];
-        tmp5= temp[8*2 + i] - temp[8*5 + i];
-        tmp3= temp[8*3 + i] + temp[8*4 + i];
-        tmp4= temp[8*3 + i] - temp[8*4 + i];
-
-        tmp10= tmp0 + tmp3;
-        tmp13= tmp0 - tmp3;
-        tmp11= tmp1 + tmp2;
-        tmp12= tmp1 - tmp2;
-
-        data[8*0 + i]= lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
-        data[8*4 + i]= lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
-
-        tmp12 += tmp13;
-        tmp12 *= A1;
-        data[8*2 + i]= lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
-        data[8*6 + i]= lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
-
-        tmp4 += tmp5;
-        tmp5 += tmp6;
-        tmp6 += tmp7;
-
-#if 0
-        z5= (tmp4 - tmp6) * A5;
-        z2= tmp4*A2 + z5;
-        z4= tmp6*A4 + z5;
-#else
-        z2= tmp4*(A2+A5) - tmp6*A5;
-        z4= tmp6*(A4-A5) + tmp4*A5;
-#endif
-        tmp5*=A1;
-
-        z11= tmp7 + tmp5;
-        z13= tmp7 - tmp5;
-
-        data[8*5 + i]= lrintf(postscale[8*5 + i] * (z13 + z2));
-        data[8*3 + i]= lrintf(postscale[8*3 + i] * (z13 - z2));
-        data[8*1 + i]= lrintf(postscale[8*1 + i] * (z11 + z4));
-        data[8*7 + i]= lrintf(postscale[8*7 + i] * (z11 - z4));
-    }
-}
-
-void ff_faandct248(int16_t *data)
-{
-    FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-    FLOAT tmp10, tmp11, tmp12, tmp13;
-    FLOAT temp[64];
-    int i;
-
-    emms_c();
-
-    row_fdct(temp, data);
-
-    for (i=0; i<8; i++) {
-        tmp0 = temp[8*0 + i] + temp[8*1 + i];
-        tmp1 = temp[8*2 + i] + temp[8*3 + i];
-        tmp2 = temp[8*4 + i] + temp[8*5 + i];
-        tmp3 = temp[8*6 + i] + temp[8*7 + i];
-        tmp4 = temp[8*0 + i] - temp[8*1 + i];
-        tmp5 = temp[8*2 + i] - temp[8*3 + i];
-        tmp6 = temp[8*4 + i] - temp[8*5 + i];
-        tmp7 = temp[8*6 + i] - temp[8*7 + i];
-
-        tmp10 = tmp0 + tmp3;
-        tmp11 = tmp1 + tmp2;
-        tmp12 = tmp1 - tmp2;
-        tmp13 = tmp0 - tmp3;
-
-        data[8*0 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
-        data[8*4 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
-
-        tmp12 += tmp13;
-        tmp12 *= A1;
-        data[8*2 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
-        data[8*6 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
-
-        tmp10 = tmp4 + tmp7;
-        tmp11 = tmp5 + tmp6;
-        tmp12 = tmp5 - tmp6;
-        tmp13 = tmp4 - tmp7;
-
-        data[8*1 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
-        data[8*5 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
-
-        tmp12 += tmp13;
-        tmp12 *= A1;
-        data[8*3 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
-        data[8*7 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
-    }
-}
diff --git a/deps/libav/libavcodec/faandct.h b/deps/libav/libavcodec/faandct.h
deleted file mode 100644
index 59d5ff3..0000000
--- a/deps/libav/libavcodec/faandct.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Floating point AAN DCT
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief
- *     Floating point AAN DCT
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVCODEC_FAANDCT_H
-#define AVCODEC_FAANDCT_H
-
-#include <stdint.h>
-
-void ff_faandct(int16_t *data);
-void ff_faandct248(int16_t *data);
-
-#endif /* AVCODEC_FAANDCT_H */
diff --git a/deps/libav/libavcodec/faanidct.c b/deps/libav/libavcodec/faanidct.c
deleted file mode 100644
index 5cacfdd..0000000
--- a/deps/libav/libavcodec/faanidct.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Floating point AAN IDCT
- * Copyright (c) 2008 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "faanidct.h"
-#include "libavutil/common.h"
-
-/* To allow switching to double. */
-#define FLOAT float
-
-#define B0 1.0000000000000000000000
-#define B1 1.3870398453221474618216 // cos(pi*1/16)sqrt(2)
-#define B2 1.3065629648763765278566 // cos(pi*2/16)sqrt(2)
-#define B3 1.1758756024193587169745 // cos(pi*3/16)sqrt(2)
-#define B4 1.0000000000000000000000 // cos(pi*4/16)sqrt(2)
-#define B5 0.7856949583871021812779 // cos(pi*5/16)sqrt(2)
-#define B6 0.5411961001461969843997 // cos(pi*6/16)sqrt(2)
-#define B7 0.2758993792829430123360 // cos(pi*7/16)sqrt(2)
-
-#define A4 0.70710678118654752438 // cos(pi*4/16)
-#define A2 0.92387953251128675613 // cos(pi*2/16)
-
-static const FLOAT prescale[64]={
-B0*B0/8, B0*B1/8, B0*B2/8, B0*B3/8, B0*B4/8, B0*B5/8, B0*B6/8, B0*B7/8,
-B1*B0/8, B1*B1/8, B1*B2/8, B1*B3/8, B1*B4/8, B1*B5/8, B1*B6/8, B1*B7/8,
-B2*B0/8, B2*B1/8, B2*B2/8, B2*B3/8, B2*B4/8, B2*B5/8, B2*B6/8, B2*B7/8,
-B3*B0/8, B3*B1/8, B3*B2/8, B3*B3/8, B3*B4/8, B3*B5/8, B3*B6/8, B3*B7/8,
-B4*B0/8, B4*B1/8, B4*B2/8, B4*B3/8, B4*B4/8, B4*B5/8, B4*B6/8, B4*B7/8,
-B5*B0/8, B5*B1/8, B5*B2/8, B5*B3/8, B5*B4/8, B5*B5/8, B5*B6/8, B5*B7/8,
-B6*B0/8, B6*B1/8, B6*B2/8, B6*B3/8, B6*B4/8, B6*B5/8, B6*B6/8, B6*B7/8,
-B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8,
-};
-
-static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){
-    int i;
-    FLOAT av_unused tmp0;
-    FLOAT s04, d04, s17, d17, s26, d26, s53, d53;
-    FLOAT os07, os16, os25, os34;
-    FLOAT od07, od16, od25, od34;
-
-    for(i=0; i<y*8; i+=y){
-        s17= temp[1*x + i] + temp[7*x + i];
-        d17= temp[1*x + i] - temp[7*x + i];
-        s53= temp[5*x + i] + temp[3*x + i];
-        d53= temp[5*x + i] - temp[3*x + i];
-
-        od07=  s17 + s53;
-        od25= (s17 - s53)*(2*A4);
-
-#if 0 //these 2 are equivalent
-        tmp0= (d17 + d53)*(2*A2);
-        od34=  d17*( 2*B6) - tmp0;
-        od16=  d53*(-2*B2) + tmp0;
-#else
-        od34=  d17*(2*(B6-A2)) - d53*(2*A2);
-        od16=  d53*(2*(A2-B2)) + d17*(2*A2);
-#endif
-
-        od16 -= od07;
-        od25 -= od16;
-        od34 += od25;
-
-        s26 = temp[2*x + i] + temp[6*x + i];
-        d26 = temp[2*x + i] - temp[6*x + i];
-        d26*= 2*A4;
-        d26-= s26;
-
-        s04= temp[0*x + i] + temp[4*x + i];
-        d04= temp[0*x + i] - temp[4*x + i];
-
-        os07= s04 + s26;
-        os34= s04 - s26;
-        os16= d04 + d26;
-        os25= d04 - d26;
-
-        if(type==0){
-            temp[0*x + i]= os07 + od07;
-            temp[7*x + i]= os07 - od07;
-            temp[1*x + i]= os16 + od16;
-            temp[6*x + i]= os16 - od16;
-            temp[2*x + i]= os25 + od25;
-            temp[5*x + i]= os25 - od25;
-            temp[3*x + i]= os34 - od34;
-            temp[4*x + i]= os34 + od34;
-        }else if(type==1){
-            data[0*x + i]= lrintf(os07 + od07);
-            data[7*x + i]= lrintf(os07 - od07);
-            data[1*x + i]= lrintf(os16 + od16);
-            data[6*x + i]= lrintf(os16 - od16);
-            data[2*x + i]= lrintf(os25 + od25);
-            data[5*x + i]= lrintf(os25 - od25);
-            data[3*x + i]= lrintf(os34 - od34);
-            data[4*x + i]= lrintf(os34 + od34);
-        }else if(type==2){
-            dest[0*stride + i]= av_clip_uint8(((int)dest[0*stride + i]) + lrintf(os07 + od07));
-            dest[7*stride + i]= av_clip_uint8(((int)dest[7*stride + i]) + lrintf(os07 - od07));
-            dest[1*stride + i]= av_clip_uint8(((int)dest[1*stride + i]) + lrintf(os16 + od16));
-            dest[6*stride + i]= av_clip_uint8(((int)dest[6*stride + i]) + lrintf(os16 - od16));
-            dest[2*stride + i]= av_clip_uint8(((int)dest[2*stride + i]) + lrintf(os25 + od25));
-            dest[5*stride + i]= av_clip_uint8(((int)dest[5*stride + i]) + lrintf(os25 - od25));
-            dest[3*stride + i]= av_clip_uint8(((int)dest[3*stride + i]) + lrintf(os34 - od34));
-            dest[4*stride + i]= av_clip_uint8(((int)dest[4*stride + i]) + lrintf(os34 + od34));
-        }else{
-            dest[0*stride + i]= av_clip_uint8(lrintf(os07 + od07));
-            dest[7*stride + i]= av_clip_uint8(lrintf(os07 - od07));
-            dest[1*stride + i]= av_clip_uint8(lrintf(os16 + od16));
-            dest[6*stride + i]= av_clip_uint8(lrintf(os16 - od16));
-            dest[2*stride + i]= av_clip_uint8(lrintf(os25 + od25));
-            dest[5*stride + i]= av_clip_uint8(lrintf(os25 - od25));
-            dest[3*stride + i]= av_clip_uint8(lrintf(os34 - od34));
-            dest[4*stride + i]= av_clip_uint8(lrintf(os34 + od34));
-        }
-    }
-}
-
-void ff_faanidct(int16_t block[64]){
-    FLOAT temp[64];
-    int i;
-
-    emms_c();
-
-    for(i=0; i<64; i++)
-        temp[i] = block[i] * prescale[i];
-
-    p8idct(block, temp, NULL, 0, 1, 8, 0);
-    p8idct(block, temp, NULL, 0, 8, 1, 1);
-}
-
-void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]){
-    FLOAT temp[64];
-    int i;
-
-    emms_c();
-
-    for(i=0; i<64; i++)
-        temp[i] = block[i] * prescale[i];
-
-    p8idct(block, temp, NULL,         0, 1, 8, 0);
-    p8idct(NULL , temp, dest, line_size, 8, 1, 2);
-}
-
-void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]){
-    FLOAT temp[64];
-    int i;
-
-    emms_c();
-
-    for(i=0; i<64; i++)
-        temp[i] = block[i] * prescale[i];
-
-    p8idct(block, temp, NULL,         0, 1, 8, 0);
-    p8idct(NULL , temp, dest, line_size, 8, 1, 3);
-}
diff --git a/deps/libav/libavcodec/faanidct.h b/deps/libav/libavcodec/faanidct.h
deleted file mode 100644
index 0c01520..0000000
--- a/deps/libav/libavcodec/faanidct.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Floating point AAN IDCT
- * Copyright (c) 2008 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_FAANIDCT_H
-#define AVCODEC_FAANIDCT_H
-
-#include <stdint.h>
-
-void ff_faanidct(int16_t block[64]);
-void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]);
-void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]);
-
-#endif /* AVCODEC_FAANIDCT_H */
diff --git a/deps/libav/libavcodec/faxcompr.c b/deps/libav/libavcodec/faxcompr.c
deleted file mode 100644
index 4cbda3f..0000000
--- a/deps/libav/libavcodec/faxcompr.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * CCITT Fax Group 3 and 4 decompression
- * Copyright (c) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * CCITT Fax Group 3 and 4 decompression
- * @author Konstantin Shishkov
- */
-#include "avcodec.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "faxcompr.h"
-
-#define CCITT_SYMS 104
-
-static const uint16_t ccitt_syms[CCITT_SYMS] = {
-    0,    1,    2,    3,    4,    5,    6,    7,    8,    9,   10,   11,   12,
-   13,   14,   15,   16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
-   26,   27,   28,   29,   30,   31,   32,   33,   34,   35,   36,   37,   38,
-   39,   40,   41,   42,   43,   44,   45,   46,   47,   48,   49,   50,   51,
-   52,   53,   54,   55,   56,   57,   58,   59,   60,   61,   62,   63,   64,
-  128,  192,  256,  320,  384,  448,  512,  576,  640,  704,  768,  832,  896,
-  960, 1024, 1088, 1152, 1216, 1280, 1344, 1408, 1472, 1536, 1600, 1664, 1728,
- 1792, 1856, 1920, 1984, 2048, 2112, 2176, 2240, 2304, 2368, 2432, 2496, 2560
-};
-
-static const uint8_t ccitt_codes_bits[2][CCITT_SYMS] =
-{
-  {
-    0x35, 0x07, 0x07, 0x08, 0x0B, 0x0C, 0x0E, 0x0F, 0x13, 0x14, 0x07, 0x08, 0x08,
-    0x03, 0x34, 0x35, 0x2A, 0x2B, 0x27, 0x0C, 0x08, 0x17, 0x03, 0x04, 0x28, 0x2B,
-    0x13, 0x24, 0x18, 0x02, 0x03, 0x1A, 0x1B, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
-    0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x04, 0x05, 0x0A, 0x0B, 0x52, 0x53, 0x54,
-    0x55, 0x24, 0x25, 0x58, 0x59, 0x5A, 0x5B, 0x4A, 0x4B, 0x32, 0x33, 0x34, 0x1B,
-    0x12, 0x17, 0x37, 0x36, 0x37, 0x64, 0x65, 0x68, 0x67, 0xCC, 0xCD, 0xD2, 0xD3,
-    0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0x98, 0x99, 0x9A, 0x18, 0x9B,
-    0x08, 0x0C, 0x0D, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F
-  },
-  {
-    0x37, 0x02, 0x03, 0x02, 0x03, 0x03, 0x02, 0x03, 0x05, 0x04, 0x04, 0x05, 0x07,
-    0x04, 0x07, 0x18, 0x17, 0x18, 0x08, 0x67, 0x68, 0x6C, 0x37, 0x28, 0x17, 0x18,
-    0xCA, 0xCB, 0xCC, 0xCD, 0x68, 0x69, 0x6A, 0x6B, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,
-    0xD7, 0x6C, 0x6D, 0xDA, 0xDB, 0x54, 0x55, 0x56, 0x57, 0x64, 0x65, 0x52, 0x53,
-    0x24, 0x37, 0x38, 0x27, 0x28, 0x58, 0x59, 0x2B, 0x2C, 0x5A, 0x66, 0x67, 0x0F,
-    0xC8, 0xC9, 0x5B, 0x33, 0x34, 0x35, 0x6C, 0x6D, 0x4A, 0x4B, 0x4C, 0x4D, 0x72,
-    0x73, 0x74, 0x75, 0x76, 0x77, 0x52, 0x53, 0x54, 0x55, 0x5A, 0x5B, 0x64, 0x65,
-    0x08, 0x0C, 0x0D, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F
-  }
-};
-
-static const uint8_t ccitt_codes_lens[2][CCITT_SYMS] =
-{
-  {
-     8,  6,  4,  4,  4,  4,  4,  4,  5,  5,  5,  5,  6,  6,  6,  6,  6,  6,  7,  7,
-     7,  7,  7,  7,  7,  7,  7,  7,  7,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  8,  8,  5,  5,  6,  7,  8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,
-     9,  9,  9,  9,  9,  9,  9,  9,  9,  6,  9, 11, 11, 11, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12
-  },
-  {
-    10,  3,  2,  2,  3,  4,  4,  5,  6,  6,  7,  7,  7,  8,  8,  9, 10, 10, 10, 11,
-    11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 10, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 11, 11, 11, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12
-  }
-};
-
-static const uint8_t ccitt_group3_2d_bits[11] = {
-    1, 1, 2, 2, 2, 1, 3, 3, 3, 1, 1
-};
-
-static const uint8_t ccitt_group3_2d_lens[11] = {
-    4, 3, 7, 6, 3, 1, 3, 6, 7, 7, 9
-};
-
-static VLC ccitt_vlc[2], ccitt_group3_2d_vlc;
-
-av_cold void ff_ccitt_unpack_init(void)
-{
-    static VLC_TYPE code_table1[528][2];
-    static VLC_TYPE code_table2[648][2];
-    int i;
-    static int initialized = 0;
-
-    if (initialized)
-        return;
-    ccitt_vlc[0].table = code_table1;
-    ccitt_vlc[0].table_allocated = 528;
-    ccitt_vlc[1].table = code_table2;
-    ccitt_vlc[1].table_allocated = 648;
-    for (i = 0; i < 2; i++) {
-        ff_init_vlc_sparse(&ccitt_vlc[i], 9, CCITT_SYMS,
-                           ccitt_codes_lens[i], 1, 1,
-                           ccitt_codes_bits[i], 1, 1,
-                           ccitt_syms, 2, 2,
-                           INIT_VLC_USE_NEW_STATIC);
-    }
-    INIT_VLC_STATIC(&ccitt_group3_2d_vlc, 9, 11,
-                    ccitt_group3_2d_lens, 1, 1,
-                    ccitt_group3_2d_bits, 1, 1, 512);
-    initialized = 1;
-}
-
-
-static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
-                                 unsigned int pix_left, int *runs,
-                                 const int *runend)
-{
-    int mode         = 0;
-    unsigned int run = 0;
-    unsigned int t;
-    for (;;) {
-        t    = get_vlc2(gb, ccitt_vlc[mode].table, 9, 2);
-        run += t;
-        if (t < 64) {
-            *runs++ = run;
-            if (runs >= runend) {
-                av_log(avctx, AV_LOG_ERROR, "Run overrun\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (pix_left <= run) {
-                if (pix_left == run)
-                    break;
-                av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n");
-                return AVERROR_INVALIDDATA;
-            }
-            pix_left -= run;
-            run       = 0;
-            mode      = !mode;
-        } else if ((int)t == -1) {
-            av_log(avctx, AV_LOG_ERROR, "Incorrect code\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    *runs++ = 0;
-    return 0;
-}
-
-static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
-                                 unsigned int width, int *runs,
-                                 const int *runend, const int *ref)
-{
-    int mode          = 0, saved_run = 0, t;
-    int run_off       = *ref++;
-    unsigned int offs = 0, run = 0;
-
-    runend--; // for the last written 0
-
-    while (offs < width) {
-        int cmode = get_vlc2(gb, ccitt_group3_2d_vlc.table, 9, 1);
-        if (cmode == -1) {
-            av_log(avctx, AV_LOG_ERROR, "Incorrect mode VLC\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (!cmode) { //pass mode
-            run_off += *ref++;
-            run      = run_off - offs;
-            offs     = run_off;
-            run_off += *ref++;
-            if (offs > width) {
-                av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n");
-                return AVERROR_INVALIDDATA;
-            }
-            saved_run += run;
-        } else if (cmode == 1) { //horizontal mode
-            int k;
-            for (k = 0; k < 2; k++) {
-                run = 0;
-                for (;;) {
-                    t = get_vlc2(gb, ccitt_vlc[mode].table, 9, 2);
-                    if (t == -1) {
-                        av_log(avctx, AV_LOG_ERROR, "Incorrect code\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    run += t;
-                    if (t < 64)
-                        break;
-                }
-                *runs++ = run + saved_run;
-                if (runs >= runend) {
-                    av_log(avctx, AV_LOG_ERROR, "Run overrun\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                saved_run = 0;
-                offs     += run;
-                if (offs > width || run > width) {
-                    av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                mode = !mode;
-            }
-        } else if (cmode == 9 || cmode == 10) {
-            avpriv_report_missing_feature(avctx, "Special modes support");
-            return AVERROR_PATCHWELCOME;
-        } else { //vertical mode
-            run      = run_off - offs + (cmode - 5);
-            run_off -= *--ref;
-            offs    += run;
-            if (offs > width || run > width) {
-                av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n");
-                return AVERROR_INVALIDDATA;
-            }
-            *runs++ = run + saved_run;
-            if (runs >= runend) {
-                av_log(avctx, AV_LOG_ERROR, "Run overrun\n");
-                return AVERROR_INVALIDDATA;
-            }
-            saved_run = 0;
-            mode      = !mode;
-        }
-        //sync line pointers
-        while (run_off <= offs) {
-            run_off += *ref++;
-            run_off += *ref++;
-        }
-    }
-    *runs++ = saved_run;
-    *runs++ = 0;
-    return 0;
-}
-
-static void put_line(uint8_t *dst, int size, int width, const int *runs)
-{
-    PutBitContext pb;
-    int run, mode = ~0, pix_left = width, run_idx = 0;
-
-    init_put_bits(&pb, dst, size * 8);
-    while (pix_left > 0) {
-        run       = runs[run_idx++];
-        mode      = ~mode;
-        pix_left -= run;
-        for (; run > 16; run -= 16)
-            put_sbits(&pb, 16, mode);
-        if (run)
-            put_sbits(&pb, run, mode);
-    }
-    flush_put_bits(&pb);
-}
-
-static int find_group3_syncmarker(GetBitContext *gb, int srcsize)
-{
-    unsigned int state = -1;
-    srcsize -= get_bits_count(gb);
-    while (srcsize-- > 0) {
-        state += state + get_bits1(gb);
-        if ((state & 0xFFF) == 1)
-            return 0;
-    }
-    return -1;
-}
-
-int ff_ccitt_unpack(AVCodecContext *avctx, const uint8_t *src, int srcsize,
-                    uint8_t *dst, int height, int stride,
-                    enum TiffCompr compr, int opts)
-{
-    int j;
-    GetBitContext gb;
-    int *runs, *ref = NULL, *runend;
-    int ret;
-    int runsize = avctx->width + 2;
-
-    runs = av_malloc(runsize * sizeof(runs[0]));
-    ref  = av_malloc(runsize * sizeof(ref[0]));
-    if (!runs || !ref) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-    ref[0] = avctx->width;
-    ref[1] = 0;
-    ref[2] = 0;
-    init_get_bits(&gb, src, srcsize * 8);
-    for (j = 0; j < height; j++) {
-        runend = runs + runsize;
-        if (compr == TIFF_G4) {
-            ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs, runend,
-                                        ref);
-            if (ret < 0)
-                goto fail;
-        } else {
-            int g3d1 = (compr == TIFF_G3) && !(opts & 1);
-            if (compr != TIFF_CCITT_RLE &&
-                find_group3_syncmarker(&gb, srcsize * 8) < 0)
-                break;
-            if (compr == TIFF_CCITT_RLE || g3d1 || get_bits1(&gb))
-                ret = decode_group3_1d_line(avctx, &gb, avctx->width, runs,
-                                            runend);
-            else
-                ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs,
-                                            runend, ref);
-            if (compr == TIFF_CCITT_RLE)
-                align_get_bits(&gb);
-        }
-        if (avctx->err_recognition & AV_EF_EXPLODE && ret < 0)
-            goto fail;
-
-        if (ret < 0) {
-            put_line(dst, stride, avctx->width, ref);
-        } else {
-            put_line(dst, stride, avctx->width, runs);
-            FFSWAP(int *, runs, ref);
-        }
-        dst += stride;
-    }
-    ret = 0;
-fail:
-    av_free(runs);
-    av_free(ref);
-    return ret;
-}
diff --git a/deps/libav/libavcodec/faxcompr.h b/deps/libav/libavcodec/faxcompr.h
deleted file mode 100644
index 8157f1f..0000000
--- a/deps/libav/libavcodec/faxcompr.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * CCITT Fax Group 3 and 4 decompression
- * Copyright (c) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * CCITT Fax Group 3 and 4 decompression
- * @author Konstantin Shishkov
- */
-#ifndef AVCODEC_FAXCOMPR_H
-#define AVCODEC_FAXCOMPR_H
-
-#include "avcodec.h"
-#include "tiff.h"
-
-/**
- * initialize upacker code
- */
-void ff_ccitt_unpack_init(void);
-
-/**
- * unpack data compressed with CCITT Group 3 1/2-D or Group 4 method
- */
-int ff_ccitt_unpack(AVCodecContext *avctx,
-                    const uint8_t *src, int srcsize,
-                    uint8_t *dst, int height, int stride,
-                    enum TiffCompr compr, int opts);
-
-#endif /* AVCODEC_FAXCOMPR_H */
diff --git a/deps/libav/libavcodec/fft-fixed-test.c b/deps/libav/libavcodec/fft-fixed-test.c
deleted file mode 100644
index d6ea987..0000000
--- a/deps/libav/libavcodec/fft-fixed-test.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define FFT_FLOAT 0
-#include "fft-test.c"
diff --git a/deps/libav/libavcodec/fft-internal.h b/deps/libav/libavcodec/fft-internal.h
deleted file mode 100644
index a449ec0..0000000
--- a/deps/libav/libavcodec/fft-internal.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_FFT_INTERNAL_H
-#define AVCODEC_FFT_INTERNAL_H
-
-#if FFT_FLOAT
-
-#define FIX15(v) (v)
-#define sqrthalf (float)M_SQRT1_2
-
-#define BF(x, y, a, b) do {                     \
-        x = a - b;                              \
-        y = a + b;                              \
-    } while (0)
-
-#define CMUL(dre, dim, are, aim, bre, bim) do { \
-        (dre) = (are) * (bre) - (aim) * (bim);  \
-        (dim) = (are) * (bim) + (aim) * (bre);  \
-    } while (0)
-
-#else
-
-#include "fft.h"
-#include "mathops.h"
-
-void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input);
-
-#define SCALE_FLOAT(a, bits) lrint((a) * (double)(1 << (bits)))
-#define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767)
-
-#define sqrthalf ((int16_t)((1<<15)*M_SQRT1_2))
-
-#define BF(x, y, a, b) do {                     \
-        x = (a - b) >> 1;                       \
-        y = (a + b) >> 1;                       \
-    } while (0)
-
-#define CMULS(dre, dim, are, aim, bre, bim, sh) do {            \
-        (dre) = (MUL16(are, bre) - MUL16(aim, bim)) >> sh;      \
-        (dim) = (MUL16(are, bim) + MUL16(aim, bre)) >> sh;      \
-    } while (0)
-
-#define CMUL(dre, dim, are, aim, bre, bim)      \
-    CMULS(dre, dim, are, aim, bre, bim, 15)
-
-#define CMULL(dre, dim, are, aim, bre, bim)     \
-    CMULS(dre, dim, are, aim, bre, bim, 0)
-
-#endif /* FFT_FLOAT */
-
-#define ff_imdct_calc_c FFT_NAME(ff_imdct_calc_c)
-#define ff_imdct_half_c FFT_NAME(ff_imdct_half_c)
-#define ff_mdct_calc_c  FFT_NAME(ff_mdct_calc_c)
-
-void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_mdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
-
-#endif /* AVCODEC_FFT_INTERNAL_H */
diff --git a/deps/libav/libavcodec/fft-test.c b/deps/libav/libavcodec/fft-test.c
deleted file mode 100644
index d0c22d0..0000000
--- a/deps/libav/libavcodec/fft-test.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FFT and MDCT tests.
- */
-
-#include "libavutil/cpu.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/lfg.h"
-#include "libavutil/log.h"
-#include "libavutil/time.h"
-#include "fft.h"
-#if FFT_FLOAT
-#include "dct.h"
-#include "rdft.h"
-#endif
-#include <math.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* reference fft */
-
-#define MUL16(a,b) ((a) * (b))
-
-#define CMAC(pre, pim, are, aim, bre, bim) \
-{\
-   pre += (MUL16(are, bre) - MUL16(aim, bim));\
-   pim += (MUL16(are, bim) + MUL16(bre, aim));\
-}
-
-#if FFT_FLOAT
-#   define RANGE 1.0
-#   define REF_SCALE(x, bits)  (x)
-#   define FMT "%10.6f"
-#else
-#   define RANGE 16384
-#   define REF_SCALE(x, bits) ((x) / (1<<(bits)))
-#   define FMT "%6d"
-#endif
-
-struct {
-    float re, im;
-} *exptab;
-
-static void fft_ref_init(int nbits, int inverse)
-{
-    int n, i;
-    double c1, s1, alpha;
-
-    n = 1 << nbits;
-    exptab = av_malloc((n / 2) * sizeof(*exptab));
-
-    for (i = 0; i < (n/2); i++) {
-        alpha = 2 * M_PI * (float)i / (float)n;
-        c1 = cos(alpha);
-        s1 = sin(alpha);
-        if (!inverse)
-            s1 = -s1;
-        exptab[i].re = c1;
-        exptab[i].im = s1;
-    }
-}
-
-static void fft_ref(FFTComplex *tabr, FFTComplex *tab, int nbits)
-{
-    int n, i, j, k, n2;
-    double tmp_re, tmp_im, s, c;
-    FFTComplex *q;
-
-    n = 1 << nbits;
-    n2 = n >> 1;
-    for (i = 0; i < n; i++) {
-        tmp_re = 0;
-        tmp_im = 0;
-        q = tab;
-        for (j = 0; j < n; j++) {
-            k = (i * j) & (n - 1);
-            if (k >= n2) {
-                c = -exptab[k - n2].re;
-                s = -exptab[k - n2].im;
-            } else {
-                c = exptab[k].re;
-                s = exptab[k].im;
-            }
-            CMAC(tmp_re, tmp_im, c, s, q->re, q->im);
-            q++;
-        }
-        tabr[i].re = REF_SCALE(tmp_re, nbits);
-        tabr[i].im = REF_SCALE(tmp_im, nbits);
-    }
-}
-
-static void imdct_ref(FFTSample *out, FFTSample *in, int nbits)
-{
-    int n = 1<<nbits;
-    int k, i, a;
-    double sum, f;
-
-    for (i = 0; i < n; i++) {
-        sum = 0;
-        for (k = 0; k < n/2; k++) {
-            a = (2 * i + 1 + (n / 2)) * (2 * k + 1);
-            f = cos(M_PI * a / (double)(2 * n));
-            sum += f * in[k];
-        }
-        out[i] = REF_SCALE(-sum, nbits - 2);
-    }
-}
-
-/* NOTE: no normalisation by 1 / N is done */
-static void mdct_ref(FFTSample *output, FFTSample *input, int nbits)
-{
-    int n = 1<<nbits;
-    int k, i;
-    double a, s;
-
-    /* do it by hand */
-    for (k = 0; k < n/2; k++) {
-        s = 0;
-        for (i = 0; i < n; i++) {
-            a = (2*M_PI*(2*i+1+n/2)*(2*k+1) / (4 * n));
-            s += input[i] * cos(a);
-        }
-        output[k] = REF_SCALE(s, nbits - 1);
-    }
-}
-
-#if FFT_FLOAT
-static void idct_ref(float *output, float *input, int nbits)
-{
-    int n = 1<<nbits;
-    int k, i;
-    double a, s;
-
-    /* do it by hand */
-    for (i = 0; i < n; i++) {
-        s = 0.5 * input[0];
-        for (k = 1; k < n; k++) {
-            a = M_PI*k*(i+0.5) / n;
-            s += input[k] * cos(a);
-        }
-        output[i] = 2 * s / n;
-    }
-}
-static void dct_ref(float *output, float *input, int nbits)
-{
-    int n = 1<<nbits;
-    int k, i;
-    double a, s;
-
-    /* do it by hand */
-    for (k = 0; k < n; k++) {
-        s = 0;
-        for (i = 0; i < n; i++) {
-            a = M_PI*k*(i+0.5) / n;
-            s += input[i] * cos(a);
-        }
-        output[k] = s;
-    }
-}
-#endif
-
-
-static FFTSample frandom(AVLFG *prng)
-{
-    return (int16_t)av_lfg_get(prng) / 32768.0 * RANGE;
-}
-
-static int check_diff(FFTSample *tab1, FFTSample *tab2, int n, double scale)
-{
-    int i;
-    double max= 0;
-    double error= 0;
-    int err = 0;
-
-    for (i = 0; i < n; i++) {
-        double e = fabsf(tab1[i] - (tab2[i] / scale)) / RANGE;
-        if (e >= 1e-3) {
-            av_log(NULL, AV_LOG_ERROR, "ERROR %5d: "FMT" "FMT"\n",
-                   i, tab1[i], tab2[i]);
-            err = 1;
-        }
-        error+= e*e;
-        if(e>max) max= e;
-    }
-    av_log(NULL, AV_LOG_INFO, "max:%f e:%g\n", max, sqrt(error)/n);
-    return err;
-}
-
-
-static void help(void)
-{
-    av_log(NULL, AV_LOG_INFO,"usage: fft-test [-h] [-s] [-i] [-n b]\n"
-           "-h     print this help\n"
-           "-s     speed test\n"
-           "-m     (I)MDCT test\n"
-           "-d     (I)DCT test\n"
-           "-r     (I)RDFT test\n"
-           "-i     inverse transform test\n"
-           "-n b   set the transform size to 2^b\n"
-           "-f x   set scale factor for output data of (I)MDCT to x\n"
-           );
-}
-
-enum tf_transform {
-    TRANSFORM_FFT,
-    TRANSFORM_MDCT,
-    TRANSFORM_RDFT,
-    TRANSFORM_DCT,
-};
-
-#if !HAVE_GETOPT
-#include "compat/getopt.c"
-#endif
-
-int main(int argc, char **argv)
-{
-    FFTComplex *tab, *tab1, *tab_ref;
-    FFTSample *tab2;
-    int it, i, c;
-    int cpuflags;
-    int do_speed = 0;
-    int err = 1;
-    enum tf_transform transform = TRANSFORM_FFT;
-    int do_inverse = 0;
-    FFTContext s1, *s = &s1;
-    FFTContext m1, *m = &m1;
-#if FFT_FLOAT
-    RDFTContext r1, *r = &r1;
-    DCTContext d1, *d = &d1;
-    int fft_size_2;
-#endif
-    int fft_nbits, fft_size;
-    double scale = 1.0;
-    AVLFG prng;
-    av_lfg_init(&prng, 1);
-
-    fft_nbits = 9;
-    for(;;) {
-        c = getopt(argc, argv, "hsimrdn:f:c:");
-        if (c == -1)
-            break;
-        switch(c) {
-        case 'h':
-            help();
-            return 1;
-        case 's':
-            do_speed = 1;
-            break;
-        case 'i':
-            do_inverse = 1;
-            break;
-        case 'm':
-            transform = TRANSFORM_MDCT;
-            break;
-        case 'r':
-            transform = TRANSFORM_RDFT;
-            break;
-        case 'd':
-            transform = TRANSFORM_DCT;
-            break;
-        case 'n':
-            fft_nbits = atoi(optarg);
-            break;
-        case 'f':
-            scale = atof(optarg);
-            break;
-        case 'c':
-            cpuflags = av_parse_cpu_flags(optarg);
-            if (cpuflags < 0)
-                return 1;
-            av_set_cpu_flags_mask(cpuflags);
-            break;
-        }
-    }
-
-    fft_size = 1 << fft_nbits;
-    tab = av_malloc(fft_size * sizeof(FFTComplex));
-    tab1 = av_malloc(fft_size * sizeof(FFTComplex));
-    tab_ref = av_malloc(fft_size * sizeof(FFTComplex));
-    tab2 = av_malloc(fft_size * sizeof(FFTSample));
-
-    switch (transform) {
-    case TRANSFORM_MDCT:
-        av_log(NULL, AV_LOG_INFO,"Scale factor is set to %f\n", scale);
-        if (do_inverse)
-            av_log(NULL, AV_LOG_INFO,"IMDCT");
-        else
-            av_log(NULL, AV_LOG_INFO,"MDCT");
-        ff_mdct_init(m, fft_nbits, do_inverse, scale);
-        break;
-    case TRANSFORM_FFT:
-        if (do_inverse)
-            av_log(NULL, AV_LOG_INFO,"IFFT");
-        else
-            av_log(NULL, AV_LOG_INFO,"FFT");
-        ff_fft_init(s, fft_nbits, do_inverse);
-        fft_ref_init(fft_nbits, do_inverse);
-        break;
-#if FFT_FLOAT
-    case TRANSFORM_RDFT:
-        if (do_inverse)
-            av_log(NULL, AV_LOG_INFO,"IDFT_C2R");
-        else
-            av_log(NULL, AV_LOG_INFO,"DFT_R2C");
-        ff_rdft_init(r, fft_nbits, do_inverse ? IDFT_C2R : DFT_R2C);
-        fft_ref_init(fft_nbits, do_inverse);
-        break;
-    case TRANSFORM_DCT:
-        if (do_inverse)
-            av_log(NULL, AV_LOG_INFO,"DCT_III");
-        else
-            av_log(NULL, AV_LOG_INFO,"DCT_II");
-        ff_dct_init(d, fft_nbits, do_inverse ? DCT_III : DCT_II);
-        break;
-#endif
-    default:
-        av_log(NULL, AV_LOG_ERROR, "Requested transform not supported\n");
-        return 1;
-    }
-    av_log(NULL, AV_LOG_INFO," %d test\n", fft_size);
-
-    /* generate random data */
-
-    for (i = 0; i < fft_size; i++) {
-        tab1[i].re = frandom(&prng);
-        tab1[i].im = frandom(&prng);
-    }
-
-    /* checking result */
-    av_log(NULL, AV_LOG_INFO,"Checking...\n");
-
-    switch (transform) {
-    case TRANSFORM_MDCT:
-        if (do_inverse) {
-            imdct_ref((FFTSample *)tab_ref, (FFTSample *)tab1, fft_nbits);
-            m->imdct_calc(m, tab2, (FFTSample *)tab1);
-            err = check_diff((FFTSample *)tab_ref, tab2, fft_size, scale);
-        } else {
-            mdct_ref((FFTSample *)tab_ref, (FFTSample *)tab1, fft_nbits);
-
-            m->mdct_calc(m, tab2, (FFTSample *)tab1);
-
-            err = check_diff((FFTSample *)tab_ref, tab2, fft_size / 2, scale);
-        }
-        break;
-    case TRANSFORM_FFT:
-        memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
-        s->fft_permute(s, tab);
-        s->fft_calc(s, tab);
-
-        fft_ref(tab_ref, tab1, fft_nbits);
-        err = check_diff((FFTSample *)tab_ref, (FFTSample *)tab, fft_size * 2, 1.0);
-        break;
-#if FFT_FLOAT
-    case TRANSFORM_RDFT:
-        fft_size_2 = fft_size >> 1;
-        if (do_inverse) {
-            tab1[         0].im = 0;
-            tab1[fft_size_2].im = 0;
-            for (i = 1; i < fft_size_2; i++) {
-                tab1[fft_size_2+i].re =  tab1[fft_size_2-i].re;
-                tab1[fft_size_2+i].im = -tab1[fft_size_2-i].im;
-            }
-
-            memcpy(tab2, tab1, fft_size * sizeof(FFTSample));
-            tab2[1] = tab1[fft_size_2].re;
-
-            r->rdft_calc(r, tab2);
-            fft_ref(tab_ref, tab1, fft_nbits);
-            for (i = 0; i < fft_size; i++) {
-                tab[i].re = tab2[i];
-                tab[i].im = 0;
-            }
-            err = check_diff((float *)tab_ref, (float *)tab, fft_size * 2, 0.5);
-        } else {
-            for (i = 0; i < fft_size; i++) {
-                tab2[i]    = tab1[i].re;
-                tab1[i].im = 0;
-            }
-            r->rdft_calc(r, tab2);
-            fft_ref(tab_ref, tab1, fft_nbits);
-            tab_ref[0].im = tab_ref[fft_size_2].re;
-            err = check_diff((float *)tab_ref, (float *)tab2, fft_size, 1.0);
-        }
-        break;
-    case TRANSFORM_DCT:
-        memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
-        d->dct_calc(d, tab);
-        if (do_inverse) {
-            idct_ref(tab_ref, tab1, fft_nbits);
-        } else {
-            dct_ref(tab_ref, tab1, fft_nbits);
-        }
-        err = check_diff((float *)tab_ref, (float *)tab, fft_size, 1.0);
-        break;
-#endif
-    }
-
-    /* do a speed test */
-
-    if (do_speed) {
-        int64_t time_start, duration;
-        int nb_its;
-
-        av_log(NULL, AV_LOG_INFO,"Speed test...\n");
-        /* we measure during about 1 seconds */
-        nb_its = 1;
-        for(;;) {
-            time_start = av_gettime();
-            for (it = 0; it < nb_its; it++) {
-                switch (transform) {
-                case TRANSFORM_MDCT:
-                    if (do_inverse) {
-                        m->imdct_calc(m, (FFTSample *)tab, (FFTSample *)tab1);
-                    } else {
-                        m->mdct_calc(m, (FFTSample *)tab, (FFTSample *)tab1);
-                    }
-                    break;
-                case TRANSFORM_FFT:
-                    memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
-                    s->fft_calc(s, tab);
-                    break;
-#if FFT_FLOAT
-                case TRANSFORM_RDFT:
-                    memcpy(tab2, tab1, fft_size * sizeof(FFTSample));
-                    r->rdft_calc(r, tab2);
-                    break;
-                case TRANSFORM_DCT:
-                    memcpy(tab2, tab1, fft_size * sizeof(FFTSample));
-                    d->dct_calc(d, tab2);
-                    break;
-#endif
-                }
-            }
-            duration = av_gettime() - time_start;
-            if (duration >= 1000000)
-                break;
-            nb_its *= 2;
-        }
-        av_log(NULL, AV_LOG_INFO,"time: %0.1f us/transform [total time=%0.2f s its=%d]\n",
-               (double)duration / nb_its,
-               (double)duration / 1000000.0,
-               nb_its);
-    }
-
-    switch (transform) {
-    case TRANSFORM_MDCT:
-        ff_mdct_end(m);
-        break;
-    case TRANSFORM_FFT:
-        ff_fft_end(s);
-        break;
-#if FFT_FLOAT
-    case TRANSFORM_RDFT:
-        ff_rdft_end(r);
-        break;
-    case TRANSFORM_DCT:
-        ff_dct_end(d);
-        break;
-#endif
-    }
-
-    av_free(tab);
-    av_free(tab1);
-    av_free(tab2);
-    av_free(tab_ref);
-    av_free(exptab);
-
-    if (err)
-        printf("Error: %d.\n", err);
-
-    return !!err;
-}
diff --git a/deps/libav/libavcodec/fft.h b/deps/libav/libavcodec/fft.h
deleted file mode 100644
index b150015..0000000
--- a/deps/libav/libavcodec/fft.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_FFT_H
-#define AVCODEC_FFT_H
-
-#ifndef FFT_FLOAT
-#define FFT_FLOAT 1
-#endif
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/mem.h"
-
-#if FFT_FLOAT
-
-#include "avfft.h"
-
-#define FFT_NAME(x) x
-
-typedef float FFTDouble;
-
-#else
-
-#define FFT_NAME(x) x ## _fixed
-
-typedef int16_t FFTSample;
-typedef int     FFTDouble;
-
-typedef struct FFTComplex {
-    int16_t re, im;
-} FFTComplex;
-
-typedef struct FFTContext FFTContext;
-
-#endif /* FFT_FLOAT */
-
-typedef struct FFTDComplex {
-    FFTDouble re, im;
-} FFTDComplex;
-
-/* FFT computation */
-
-struct FFTContext {
-    int nbits;
-    int inverse;
-    uint16_t *revtab;
-    FFTComplex *tmp_buf;
-    int mdct_size; /* size of MDCT (i.e. number of input data * 2) */
-    int mdct_bits; /* n = 2^nbits */
-    /* pre/post rotation tables */
-    FFTSample *tcos;
-    FFTSample *tsin;
-    /**
-     * Do the permutation needed BEFORE calling fft_calc().
-     */
-    void (*fft_permute)(struct FFTContext *s, FFTComplex *z);
-    /**
-     * Do a complex FFT with the parameters defined in ff_fft_init(). The
-     * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
-     */
-    void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
-    void (*imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
-    void (*imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
-    void (*mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
-    void (*mdct_calcw)(struct FFTContext *s, FFTDouble *output, const FFTSample *input);
-    int fft_permutation;
-#define FF_FFT_PERM_DEFAULT   0
-#define FF_FFT_PERM_SWAP_LSBS 1
-#define FF_FFT_PERM_AVX       2
-    int mdct_permutation;
-#define FF_MDCT_PERM_NONE       0
-#define FF_MDCT_PERM_INTERLEAVE 1
-};
-
-#if CONFIG_HARDCODED_TABLES
-#define COSTABLE_CONST const
-#else
-#define COSTABLE_CONST
-#endif
-
-#define COSTABLE(size) \
-    COSTABLE_CONST DECLARE_ALIGNED(32, FFTSample, FFT_NAME(ff_cos_##size))[size/2]
-
-extern COSTABLE(16);
-extern COSTABLE(32);
-extern COSTABLE(64);
-extern COSTABLE(128);
-extern COSTABLE(256);
-extern COSTABLE(512);
-extern COSTABLE(1024);
-extern COSTABLE(2048);
-extern COSTABLE(4096);
-extern COSTABLE(8192);
-extern COSTABLE(16384);
-extern COSTABLE(32768);
-extern COSTABLE(65536);
-extern COSTABLE_CONST FFTSample* const FFT_NAME(ff_cos_tabs)[17];
-
-#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs)
-
-/**
- * Initialize the cosine table in ff_cos_tabs[index]
- * @param index index in ff_cos_tabs array of the table to initialize
- */
-void ff_init_ff_cos_tabs(int index);
-
-#define ff_fft_init FFT_NAME(ff_fft_init)
-#define ff_fft_end  FFT_NAME(ff_fft_end)
-
-/**
- * Set up a complex FFT.
- * @param nbits           log2 of the length of the input array
- * @param inverse         if 0 perform the forward transform, if 1 perform the inverse
- */
-int ff_fft_init(FFTContext *s, int nbits, int inverse);
-
-void ff_fft_init_x86(FFTContext *s);
-void ff_fft_init_arm(FFTContext *s);
-void ff_fft_init_ppc(FFTContext *s);
-
-void ff_fft_fixed_init_arm(FFTContext *s);
-
-void ff_fft_end(FFTContext *s);
-
-#define ff_mdct_init FFT_NAME(ff_mdct_init)
-#define ff_mdct_end  FFT_NAME(ff_mdct_end)
-
-int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale);
-void ff_mdct_end(FFTContext *s);
-
-#endif /* AVCODEC_FFT_H */
diff --git a/deps/libav/libavcodec/fft_fixed.c b/deps/libav/libavcodec/fft_fixed.c
deleted file mode 100644
index bad4821..0000000
--- a/deps/libav/libavcodec/fft_fixed.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define FFT_FLOAT 0
-#include "fft_template.c"
diff --git a/deps/libav/libavcodec/fft_float.c b/deps/libav/libavcodec/fft_float.c
deleted file mode 100644
index ed4cffa..0000000
--- a/deps/libav/libavcodec/fft_float.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define FFT_FLOAT 1
-#include "fft_template.c"
diff --git a/deps/libav/libavcodec/fft_template.c b/deps/libav/libavcodec/fft_template.c
deleted file mode 100644
index 8b94ff1..0000000
--- a/deps/libav/libavcodec/fft_template.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * FFT/IFFT transforms
- * Copyright (c) 2008 Loren Merritt
- * Copyright (c) 2002 Fabrice Bellard
- * Partly based on libdjbfft by D. J. Bernstein
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FFT/IFFT transforms.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include "libavutil/mathematics.h"
-#include "fft.h"
-#include "fft-internal.h"
-
-/* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */
-#if !CONFIG_HARDCODED_TABLES
-COSTABLE(16);
-COSTABLE(32);
-COSTABLE(64);
-COSTABLE(128);
-COSTABLE(256);
-COSTABLE(512);
-COSTABLE(1024);
-COSTABLE(2048);
-COSTABLE(4096);
-COSTABLE(8192);
-COSTABLE(16384);
-COSTABLE(32768);
-COSTABLE(65536);
-#endif
-COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = {
-    NULL, NULL, NULL, NULL,
-    FFT_NAME(ff_cos_16),
-    FFT_NAME(ff_cos_32),
-    FFT_NAME(ff_cos_64),
-    FFT_NAME(ff_cos_128),
-    FFT_NAME(ff_cos_256),
-    FFT_NAME(ff_cos_512),
-    FFT_NAME(ff_cos_1024),
-    FFT_NAME(ff_cos_2048),
-    FFT_NAME(ff_cos_4096),
-    FFT_NAME(ff_cos_8192),
-    FFT_NAME(ff_cos_16384),
-    FFT_NAME(ff_cos_32768),
-    FFT_NAME(ff_cos_65536),
-};
-
-static void fft_permute_c(FFTContext *s, FFTComplex *z);
-static void fft_calc_c(FFTContext *s, FFTComplex *z);
-
-static int split_radix_permutation(int i, int n, int inverse)
-{
-    int m;
-    if(n <= 2) return i&1;
-    m = n >> 1;
-    if(!(i&m))            return split_radix_permutation(i, m, inverse)*2;
-    m >>= 1;
-    if(inverse == !(i&m)) return split_radix_permutation(i, m, inverse)*4 + 1;
-    else                  return split_radix_permutation(i, m, inverse)*4 - 1;
-}
-
-av_cold void ff_init_ff_cos_tabs(int index)
-{
-#if !CONFIG_HARDCODED_TABLES
-    int i;
-    int m = 1<<index;
-    double freq = 2*M_PI/m;
-    FFTSample *tab = FFT_NAME(ff_cos_tabs)[index];
-    for(i=0; i<=m/4; i++)
-        tab[i] = FIX15(cos(i*freq));
-    for(i=1; i<m/4; i++)
-        tab[m/2-i] = tab[i];
-#endif
-}
-
-static const int avx_tab[] = {
-    0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15
-};
-
-static int is_second_half_of_fft32(int i, int n)
-{
-    if (n <= 32)
-        return i >= 16;
-    else if (i < n/2)
-        return is_second_half_of_fft32(i, n/2);
-    else if (i < 3*n/4)
-        return is_second_half_of_fft32(i - n/2, n/4);
-    else
-        return is_second_half_of_fft32(i - 3*n/4, n/4);
-}
-
-static av_cold void fft_perm_avx(FFTContext *s)
-{
-    int i;
-    int n = 1 << s->nbits;
-
-    for (i = 0; i < n; i += 16) {
-        int k;
-        if (is_second_half_of_fft32(i, n)) {
-            for (k = 0; k < 16; k++)
-                s->revtab[-split_radix_permutation(i + k, n, s->inverse) & (n - 1)] =
-                    i + avx_tab[k];
-
-        } else {
-            for (k = 0; k < 16; k++) {
-                int j = i + k;
-                j = (j & ~7) | ((j >> 1) & 3) | ((j << 2) & 4);
-                s->revtab[-split_radix_permutation(i + k, n, s->inverse) & (n - 1)] = j;
-            }
-        }
-    }
-}
-
-av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
-{
-    int i, j, n;
-
-    if (nbits < 2 || nbits > 16)
-        goto fail;
-    s->nbits = nbits;
-    n = 1 << nbits;
-
-    s->revtab = av_malloc(n * sizeof(uint16_t));
-    if (!s->revtab)
-        goto fail;
-    s->tmp_buf = av_malloc(n * sizeof(FFTComplex));
-    if (!s->tmp_buf)
-        goto fail;
-    s->inverse = inverse;
-    s->fft_permutation = FF_FFT_PERM_DEFAULT;
-
-    s->fft_permute = fft_permute_c;
-    s->fft_calc    = fft_calc_c;
-#if CONFIG_MDCT
-    s->imdct_calc  = ff_imdct_calc_c;
-    s->imdct_half  = ff_imdct_half_c;
-    s->mdct_calc   = ff_mdct_calc_c;
-#endif
-
-#if FFT_FLOAT
-    if (ARCH_ARM)     ff_fft_init_arm(s);
-    if (ARCH_PPC)     ff_fft_init_ppc(s);
-    if (ARCH_X86)     ff_fft_init_x86(s);
-    if (CONFIG_MDCT)  s->mdct_calcw = s->mdct_calc;
-#else
-    if (CONFIG_MDCT)  s->mdct_calcw = ff_mdct_calcw_c;
-    if (ARCH_ARM)     ff_fft_fixed_init_arm(s);
-#endif
-
-    for(j=4; j<=nbits; j++) {
-        ff_init_ff_cos_tabs(j);
-    }
-
-    if (s->fft_permutation == FF_FFT_PERM_AVX) {
-        fft_perm_avx(s);
-    } else {
-        for(i=0; i<n; i++) {
-            int j = i;
-            if (s->fft_permutation == FF_FFT_PERM_SWAP_LSBS)
-                j = (j&~3) | ((j>>1)&1) | ((j<<1)&2);
-            s->revtab[-split_radix_permutation(i, n, s->inverse) & (n-1)] = j;
-        }
-    }
-
-    return 0;
- fail:
-    av_freep(&s->revtab);
-    av_freep(&s->tmp_buf);
-    return -1;
-}
-
-static void fft_permute_c(FFTContext *s, FFTComplex *z)
-{
-    int j, np;
-    const uint16_t *revtab = s->revtab;
-    np = 1 << s->nbits;
-    /* TODO: handle split-radix permute in a more optimal way, probably in-place */
-    for(j=0;j<np;j++) s->tmp_buf[revtab[j]] = z[j];
-    memcpy(z, s->tmp_buf, np * sizeof(FFTComplex));
-}
-
-av_cold void ff_fft_end(FFTContext *s)
-{
-    av_freep(&s->revtab);
-    av_freep(&s->tmp_buf);
-}
-
-#define BUTTERFLIES(a0,a1,a2,a3) {\
-    BF(t3, t5, t5, t1);\
-    BF(a2.re, a0.re, a0.re, t5);\
-    BF(a3.im, a1.im, a1.im, t3);\
-    BF(t4, t6, t2, t6);\
-    BF(a3.re, a1.re, a1.re, t4);\
-    BF(a2.im, a0.im, a0.im, t6);\
-}
-
-// force loading all the inputs before storing any.
-// this is slightly slower for small data, but avoids store->load aliasing
-// for addresses separated by large powers of 2.
-#define BUTTERFLIES_BIG(a0,a1,a2,a3) {\
-    FFTSample r0=a0.re, i0=a0.im, r1=a1.re, i1=a1.im;\
-    BF(t3, t5, t5, t1);\
-    BF(a2.re, a0.re, r0, t5);\
-    BF(a3.im, a1.im, i1, t3);\
-    BF(t4, t6, t2, t6);\
-    BF(a3.re, a1.re, r1, t4);\
-    BF(a2.im, a0.im, i0, t6);\
-}
-
-#define TRANSFORM(a0,a1,a2,a3,wre,wim) {\
-    CMUL(t1, t2, a2.re, a2.im, wre, -wim);\
-    CMUL(t5, t6, a3.re, a3.im, wre,  wim);\
-    BUTTERFLIES(a0,a1,a2,a3)\
-}
-
-#define TRANSFORM_ZERO(a0,a1,a2,a3) {\
-    t1 = a2.re;\
-    t2 = a2.im;\
-    t5 = a3.re;\
-    t6 = a3.im;\
-    BUTTERFLIES(a0,a1,a2,a3)\
-}
-
-/* z[0...8n-1], w[1...2n-1] */
-#define PASS(name)\
-static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\
-{\
-    FFTDouble t1, t2, t3, t4, t5, t6;\
-    int o1 = 2*n;\
-    int o2 = 4*n;\
-    int o3 = 6*n;\
-    const FFTSample *wim = wre+o1;\
-    n--;\
-\
-    TRANSFORM_ZERO(z[0],z[o1],z[o2],z[o3]);\
-    TRANSFORM(z[1],z[o1+1],z[o2+1],z[o3+1],wre[1],wim[-1]);\
-    do {\
-        z += 2;\
-        wre += 2;\
-        wim -= 2;\
-        TRANSFORM(z[0],z[o1],z[o2],z[o3],wre[0],wim[0]);\
-        TRANSFORM(z[1],z[o1+1],z[o2+1],z[o3+1],wre[1],wim[-1]);\
-    } while(--n);\
-}
-
-PASS(pass)
-#undef BUTTERFLIES
-#define BUTTERFLIES BUTTERFLIES_BIG
-PASS(pass_big)
-
-#define DECL_FFT(n,n2,n4)\
-static void fft##n(FFTComplex *z)\
-{\
-    fft##n2(z);\
-    fft##n4(z+n4*2);\
-    fft##n4(z+n4*3);\
-    pass(z,FFT_NAME(ff_cos_##n),n4/2);\
-}
-
-static void fft4(FFTComplex *z)
-{
-    FFTDouble t1, t2, t3, t4, t5, t6, t7, t8;
-
-    BF(t3, t1, z[0].re, z[1].re);
-    BF(t8, t6, z[3].re, z[2].re);
-    BF(z[2].re, z[0].re, t1, t6);
-    BF(t4, t2, z[0].im, z[1].im);
-    BF(t7, t5, z[2].im, z[3].im);
-    BF(z[3].im, z[1].im, t4, t8);
-    BF(z[3].re, z[1].re, t3, t7);
-    BF(z[2].im, z[0].im, t2, t5);
-}
-
-static void fft8(FFTComplex *z)
-{
-    FFTDouble t1, t2, t3, t4, t5, t6;
-
-    fft4(z);
-
-    BF(t1, z[5].re, z[4].re, -z[5].re);
-    BF(t2, z[5].im, z[4].im, -z[5].im);
-    BF(t5, z[7].re, z[6].re, -z[7].re);
-    BF(t6, z[7].im, z[6].im, -z[7].im);
-
-    BUTTERFLIES(z[0],z[2],z[4],z[6]);
-    TRANSFORM(z[1],z[3],z[5],z[7],sqrthalf,sqrthalf);
-}
-
-#if !CONFIG_SMALL
-static void fft16(FFTComplex *z)
-{
-    FFTDouble t1, t2, t3, t4, t5, t6;
-    FFTSample cos_16_1 = FFT_NAME(ff_cos_16)[1];
-    FFTSample cos_16_3 = FFT_NAME(ff_cos_16)[3];
-
-    fft8(z);
-    fft4(z+8);
-    fft4(z+12);
-
-    TRANSFORM_ZERO(z[0],z[4],z[8],z[12]);
-    TRANSFORM(z[2],z[6],z[10],z[14],sqrthalf,sqrthalf);
-    TRANSFORM(z[1],z[5],z[9],z[13],cos_16_1,cos_16_3);
-    TRANSFORM(z[3],z[7],z[11],z[15],cos_16_3,cos_16_1);
-}
-#else
-DECL_FFT(16,8,4)
-#endif
-DECL_FFT(32,16,8)
-DECL_FFT(64,32,16)
-DECL_FFT(128,64,32)
-DECL_FFT(256,128,64)
-DECL_FFT(512,256,128)
-#if !CONFIG_SMALL
-#define pass pass_big
-#endif
-DECL_FFT(1024,512,256)
-DECL_FFT(2048,1024,512)
-DECL_FFT(4096,2048,1024)
-DECL_FFT(8192,4096,2048)
-DECL_FFT(16384,8192,4096)
-DECL_FFT(32768,16384,8192)
-DECL_FFT(65536,32768,16384)
-
-static void (* const fft_dispatch[])(FFTComplex*) = {
-    fft4, fft8, fft16, fft32, fft64, fft128, fft256, fft512, fft1024,
-    fft2048, fft4096, fft8192, fft16384, fft32768, fft65536,
-};
-
-static void fft_calc_c(FFTContext *s, FFTComplex *z)
-{
-    fft_dispatch[s->nbits-2](z);
-}
diff --git a/deps/libav/libavcodec/ffv1.c b/deps/libav/libavcodec/ffv1.c
deleted file mode 100644
index 9e7ba2e..0000000
--- a/deps/libav/libavcodec/ffv1.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * FFV1 codec for libavcodec
- *
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FF Video Codec 1 (a lossless codec)
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "rangecoder.h"
-#include "golomb.h"
-#include "mathops.h"
-#include "ffv1.h"
-
-const int8_t ffv1_quant5_10bit[256] = {
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-     1,  1,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-    -1, -1, -1, -1, -1, -1, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0,
-};
-
-const int8_t ffv1_quant5[256] = {
-     0,  1,  1,  1,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1,
-};
-
-const int8_t ffv1_quant9_10bit[256] = {
-     0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,
-     3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
-     3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,  4,  4,  4,  4,  4,
-     4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
-     4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
-     4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
-     4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
-    -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
-    -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
-    -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
-    -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
-    -4, -4, -4, -4, -4, -4, -4, -4, -4, -3, -3, -3, -3, -3, -3, -3,
-    -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
-    -3, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -2, -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, -0, -0, -0, -0,
-};
-
-const int8_t ffv1_quant11[256] = {
-     0,  1,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,  4,
-     4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
-     4,  4,  4,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-    -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
-    -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
-    -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
-    -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
-    -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
-    -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -4, -4,
-    -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
-    -4, -4, -4, -4, -4, -3, -3, -3, -3, -3, -3, -3, -2, -2, -2, -1,
-};
-
-const uint8_t ffv1_ver2_state[256] = {
-      0,  10,  10,  10,  10,  16,  16,  16,  28,  16,  16,  29,  42,  49,  20,  49,
-     59,  25,  26,  26,  27,  31,  33,  33,  33,  34,  34,  37,  67,  38,  39,  39,
-     40,  40,  41,  79,  43,  44,  45,  45,  48,  48,  64,  50,  51,  52,  88,  52,
-     53,  74,  55,  57,  58,  58,  74,  60,  101, 61,  62,  84,  66,  66,  68,  69,
-     87,  82,  71,  97,  73,  73,  82,  75,  111, 77,  94,  78,  87,  81,  83,  97,
-     85,  83,  94,  86,  99,  89,  90,  99,  111, 92,  93,  134, 95,  98,  105, 98,
-    105, 110, 102, 108, 102, 118, 103, 106, 106, 113, 109, 112, 114, 112, 116, 125,
-    115, 116, 117, 117, 126, 119, 125, 121, 121, 123, 145, 124, 126, 131, 127, 129,
-    165, 130, 132, 138, 133, 135, 145, 136, 137, 139, 146, 141, 143, 142, 144, 148,
-    147, 155, 151, 149, 151, 150, 152, 157, 153, 154, 156, 168, 158, 162, 161, 160,
-    172, 163, 169, 164, 166, 184, 167, 170, 177, 174, 171, 173, 182, 176, 180, 178,
-    175, 189, 179, 181, 186, 183, 192, 185, 200, 187, 191, 188, 190, 197, 193, 196,
-    197, 194, 195, 196, 198, 202, 199, 201, 210, 203, 207, 204, 205, 206, 208, 214,
-    209, 211, 221, 212, 213, 215, 224, 216, 217, 218, 219, 220, 222, 228, 223, 225,
-    226, 224, 227, 229, 240, 230, 231, 232, 233, 234, 235, 236, 238, 239, 237, 242,
-    241, 243, 242, 244, 245, 246, 247, 248, 249, 250, 251, 252, 252, 253, 254, 255,
-};
-
-
-av_cold int ffv1_common_init(AVCodecContext *avctx)
-{
-    FFV1Context *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    s->flags = avctx->flags;
-
-    if (!avctx->width || !avctx->height)
-        return AVERROR_INVALIDDATA;
-
-    ff_dsputil_init(&s->dsp, avctx);
-
-    s->width  = avctx->width;
-    s->height = avctx->height;
-
-    // defaults
-    s->num_h_slices = 1;
-    s->num_v_slices = 1;
-
-    return 0;
-}
-
-int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
-{
-    int j;
-
-    fs->plane_count  = f->plane_count;
-    fs->transparency = f->transparency;
-    for (j = 0; j < f->plane_count; j++) {
-        PlaneContext *const p = &fs->plane[j];
-
-        if (fs->ac) {
-            if (!p->state)
-                p->state = av_malloc(CONTEXT_SIZE * p->context_count *
-                                     sizeof(uint8_t));
-            if (!p->state)
-                return AVERROR(ENOMEM);
-        } else {
-            if (!p->vlc_state)
-                p->vlc_state = av_malloc(p->context_count * sizeof(VlcState));
-            if (!p->vlc_state)
-                return AVERROR(ENOMEM);
-        }
-    }
-
-    if (fs->ac > 1) {
-        //FIXME only redo if state_transition changed
-        for (j = 1; j < 256; j++) {
-            fs->c.one_state[j]        = f->state_transition[j];
-            fs->c.zero_state[256 - j] = 256 - fs->c.one_state[j];
-        }
-    }
-
-    return 0;
-}
-
-av_cold int ffv1_init_slice_contexts(FFV1Context *f)
-{
-    int i;
-
-    f->slice_count = f->num_h_slices * f->num_v_slices;
-    if (f->slice_count <= 0) {
-        av_log(f->avctx, AV_LOG_ERROR, "Invalid number of slices\n");
-        return AVERROR(EINVAL);
-    }
-
-    for (i = 0; i < f->slice_count; i++) {
-        FFV1Context *fs = av_mallocz(sizeof(*fs));
-        int sx          = i % f->num_h_slices;
-        int sy          = i / f->num_h_slices;
-        int sxs         = f->avctx->width  *  sx      / f->num_h_slices;
-        int sxe         = f->avctx->width  * (sx + 1) / f->num_h_slices;
-        int sys         = f->avctx->height *  sy      / f->num_v_slices;
-        int sye         = f->avctx->height * (sy + 1) / f->num_v_slices;
-        f->slice_context[i] = fs;
-        memcpy(fs, f, sizeof(*fs));
-        memset(fs->rc_stat2, 0, sizeof(fs->rc_stat2));
-
-        fs->slice_width  = sxe - sxs;
-        fs->slice_height = sye - sys;
-        fs->slice_x      = sxs;
-        fs->slice_y      = sys;
-
-        fs->sample_buffer = av_malloc(3 * MAX_PLANES * (fs->width + 6) *
-                                      sizeof(*fs->sample_buffer));
-        if (!fs->sample_buffer)
-            return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-int ffv1_allocate_initial_states(FFV1Context *f)
-{
-    int i;
-
-    for (i = 0; i < f->quant_table_count; i++) {
-        f->initial_states[i] = av_malloc(f->context_count[i] *
-                                         sizeof(*f->initial_states[i]));
-        if (!f->initial_states[i])
-            return AVERROR(ENOMEM);
-        memset(f->initial_states[i], 128,
-               f->context_count[i] * sizeof(*f->initial_states[i]));
-    }
-    return 0;
-}
-
-void ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs)
-{
-    int i, j;
-
-    for (i = 0; i < f->plane_count; i++) {
-        PlaneContext *p = &fs->plane[i];
-
-        p->interlace_bit_state[0] = 128;
-        p->interlace_bit_state[1] = 128;
-
-        if (fs->ac) {
-            if (f->initial_states[p->quant_table_index]) {
-                memcpy(p->state, f->initial_states[p->quant_table_index],
-                       CONTEXT_SIZE * p->context_count);
-            } else
-                memset(p->state, 128, CONTEXT_SIZE * p->context_count);
-        } else {
-            for (j = 0; j < p->context_count; j++) {
-                p->vlc_state[j].drift     = 0;
-                p->vlc_state[j].error_sum = 4;    //FFMAX((RANGE + 32)/64, 2);
-                p->vlc_state[j].bias      = 0;
-                p->vlc_state[j].count     = 1;
-            }
-        }
-    }
-}
-
-av_cold int ffv1_close(AVCodecContext *avctx)
-{
-    FFV1Context *s = avctx->priv_data;
-    int i, j;
-
-    for (j = 0; j < s->slice_count; j++) {
-        FFV1Context *fs = s->slice_context[j];
-        for (i = 0; i < s->plane_count; i++) {
-            PlaneContext *p = &fs->plane[i];
-
-            av_freep(&p->state);
-            av_freep(&p->vlc_state);
-        }
-        av_freep(&fs->sample_buffer);
-    }
-
-    av_freep(&avctx->stats_out);
-    for (j = 0; j < s->quant_table_count; j++) {
-        av_freep(&s->initial_states[j]);
-        for (i = 0; i < s->slice_count; i++) {
-            FFV1Context *sf = s->slice_context[i];
-            av_freep(&sf->rc_stat2[j]);
-        }
-        av_freep(&s->rc_stat2[j]);
-    }
-
-    for (i = 0; i < s->slice_count; i++)
-        av_freep(&s->slice_context[i]);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/ffv1.h b/deps/libav/libavcodec/ffv1.h
deleted file mode 100644
index 40fc393..0000000
--- a/deps/libav/libavcodec/ffv1.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * FFV1 codec for libavcodec
- *
- * Copyright (c) 2003-2012 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_FFV1_H
-#define AVCODEC_FFV1_H
-
-#include <stdint.h>
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "rangecoder.h"
-
-#define MAX_PLANES 4
-#define CONTEXT_SIZE 32
-
-#define MAX_QUANT_TABLES 8
-#define MAX_CONTEXT_INPUTS 5
-
-extern const uint8_t ff_log2_run[41];
-
-extern const int8_t ffv1_quant5_10bit[256];
-extern const int8_t ffv1_quant5[256];
-extern const int8_t ffv1_quant9_10bit[256];
-extern const int8_t ffv1_quant11[256];
-extern const uint8_t ffv1_ver2_state[256];
-
-typedef struct VlcState {
-    int16_t drift;
-    uint16_t error_sum;
-    int8_t bias;
-    uint8_t count;
-} VlcState;
-
-typedef struct PlaneContext {
-    int16_t quant_table[MAX_CONTEXT_INPUTS][256];
-    int quant_table_index;
-    int context_count;
-    uint8_t (*state)[CONTEXT_SIZE];
-    VlcState *vlc_state;
-    uint8_t interlace_bit_state[2];
-} PlaneContext;
-
-#define MAX_SLICES 256
-
-typedef struct FFV1Context {
-    AVClass *class;
-    AVCodecContext *avctx;
-    RangeCoder c;
-    GetBitContext gb;
-    PutBitContext pb;
-    uint64_t rc_stat[256][2];
-    uint64_t (*rc_stat2[MAX_QUANT_TABLES])[32][2];
-    int version;
-    int minor_version;
-    int width, height;
-    int chroma_planes;
-    int chroma_h_shift, chroma_v_shift;
-    int transparency;
-    int flags;
-    int picture_number;
-    AVFrame *frame;
-    AVFrame *last_picture;
-
-    AVFrame *cur;
-    int plane_count;
-    int ac;     // 1 = range coder <-> 0 = golomb rice
-    int ac_byte_count;      // number of bytes used for AC coding
-    PlaneContext plane[MAX_PLANES];
-    int16_t quant_table[MAX_CONTEXT_INPUTS][256];
-    int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][256];
-    int context_count[MAX_QUANT_TABLES];
-    uint8_t state_transition[256];
-    uint8_t (*initial_states[MAX_QUANT_TABLES])[32];
-    int run_index;
-    int colorspace;
-    int16_t *sample_buffer;
-
-    int ec;
-    int slice_damaged;
-    int key_frame_ok;
-
-    int bits_per_raw_sample;
-    int packed_at_lsb;
-
-    int gob_count;
-    int quant_table_count;
-
-    DSPContext dsp;
-
-    struct FFV1Context *slice_context[MAX_SLICES];
-    int slice_count;
-    int num_v_slices;
-    int num_h_slices;
-    int slice_width;
-    int slice_height;
-    int slice_x;
-    int slice_y;
-} FFV1Context;
-
-static av_always_inline int fold(int diff, int bits)
-{
-    if (bits == 8)
-        diff = (int8_t)diff;
-    else {
-        diff +=  1 << (bits  - 1);
-        diff &= (1 <<  bits) - 1;
-        diff -=  1 << (bits  - 1);
-    }
-
-    return diff;
-}
-
-static inline int predict(int16_t *src, int16_t *last)
-{
-    const int LT = last[-1];
-    const int T  = last[0];
-    const int L  = src[-1];
-
-    return mid_pred(L, L + T - LT, T);
-}
-
-static inline int get_context(PlaneContext *p, int16_t *src,
-                              int16_t *last, int16_t *last2)
-{
-    const int LT = last[-1];
-    const int T  = last[0];
-    const int RT = last[1];
-    const int L  = src[-1];
-
-    if (p->quant_table[3][127]) {
-        const int TT = last2[0];
-        const int LL = src[-2];
-        return p->quant_table[0][(L - LT) & 0xFF] +
-               p->quant_table[1][(LT - T) & 0xFF] +
-               p->quant_table[2][(T - RT) & 0xFF] +
-               p->quant_table[3][(LL - L) & 0xFF] +
-               p->quant_table[4][(TT - T) & 0xFF];
-    } else
-        return p->quant_table[0][(L - LT) & 0xFF] +
-               p->quant_table[1][(LT - T) & 0xFF] +
-               p->quant_table[2][(T - RT) & 0xFF];
-}
-
-static inline void update_vlc_state(VlcState *const state, const int v)
-{
-    int drift = state->drift;
-    int count = state->count;
-    state->error_sum += FFABS(v);
-    drift            += v;
-
-    if (count == 128) { // FIXME: variable
-        count            >>= 1;
-        drift            >>= 1;
-        state->error_sum >>= 1;
-    }
-    count++;
-
-    if (drift <= -count) {
-        if (state->bias > -128)
-            state->bias--;
-
-        drift += count;
-        if (drift <= -count)
-            drift = -count + 1;
-    } else if (drift > 0) {
-        if (state->bias < 127)
-            state->bias++;
-
-        drift -= count;
-        if (drift > 0)
-            drift = 0;
-    }
-
-    state->drift = drift;
-    state->count = count;
-}
-
-int ffv1_common_init(AVCodecContext *avctx);
-int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs);
-int ffv1_init_slice_contexts(FFV1Context *f);
-int ffv1_allocate_initial_states(FFV1Context *f);
-void ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs);
-int ffv1_close(AVCodecContext *avctx);
-
-#endif /* AVCODEC_FFV1_H */
diff --git a/deps/libav/libavcodec/ffv1dec.c b/deps/libav/libavcodec/ffv1dec.c
deleted file mode 100644
index 8f7b2bf..0000000
--- a/deps/libav/libavcodec/ffv1dec.c
+++ /dev/null
@@ -1,937 +0,0 @@
-/*
- * FFV1 decoder
- *
- * Copyright (c) 2003-2012 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FF Video Codec 1 (a lossless codec) decoder
- */
-
-#include "libavutil/avassert.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/crc.h"
-#include "libavutil/opt.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/timer.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "rangecoder.h"
-#include "golomb.h"
-#include "mathops.h"
-#include "ffv1.h"
-
-static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
-                                               int is_signed)
-{
-    if (get_rac(c, state + 0))
-        return 0;
-    else {
-        int i, e, a;
-        e = 0;
-        while (get_rac(c, state + 1 + FFMIN(e, 9))) // 1..10
-            e++;
-
-        a = 1;
-        for (i = e - 1; i >= 0; i--)
-            a += a + get_rac(c, state + 22 + FFMIN(i, 9));  // 22..31
-
-        e = -(is_signed && get_rac(c, state + 11 + FFMIN(e, 10))); // 11..21
-        return (a ^ e) - e;
-    }
-}
-
-static av_noinline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed)
-{
-    return get_symbol_inline(c, state, is_signed);
-}
-
-static inline int get_vlc_symbol(GetBitContext *gb, VlcState *const state,
-                                 int bits)
-{
-    int k, i, v, ret;
-
-    i = state->count;
-    k = 0;
-    while (i < state->error_sum) { // FIXME: optimize
-        k++;
-        i += i;
-    }
-
-    assert(k <= 8);
-
-    v = get_sr_golomb(gb, k, 12, bits);
-    av_dlog(NULL, "v:%d bias:%d error:%d drift:%d count:%d k:%d",
-            v, state->bias, state->error_sum, state->drift, state->count, k);
-
-#if 0 // JPEG LS
-    if (k == 0 && 2 * state->drift <= -state->count)
-        v ^= (-1);
-#else
-    v ^= ((2 * state->drift + state->count) >> 31);
-#endif
-
-    ret = fold(v + state->bias, bits);
-
-    update_vlc_state(state, v);
-
-    return ret;
-}
-
-static av_always_inline void decode_line(FFV1Context *s, int w,
-                                         int16_t *sample[2],
-                                         int plane_index, int bits)
-{
-    PlaneContext *const p = &s->plane[plane_index];
-    RangeCoder *const c   = &s->c;
-    int x;
-    int run_count = 0;
-    int run_mode  = 0;
-    int run_index = s->run_index;
-
-    for (x = 0; x < w; x++) {
-        int diff, context, sign;
-
-        context = get_context(p, sample[1] + x, sample[0] + x, sample[1] + x);
-        if (context < 0) {
-            context = -context;
-            sign    = 1;
-        } else
-            sign = 0;
-
-        av_assert2(context < p->context_count);
-
-        if (s->ac) {
-            diff = get_symbol_inline(c, p->state[context], 1);
-        } else {
-            if (context == 0 && run_mode == 0)
-                run_mode = 1;
-
-            if (run_mode) {
-                if (run_count == 0 && run_mode == 1) {
-                    if (get_bits1(&s->gb)) {
-                        run_count = 1 << ff_log2_run[run_index];
-                        if (x + run_count <= w)
-                            run_index++;
-                    } else {
-                        if (ff_log2_run[run_index])
-                            run_count = get_bits(&s->gb, ff_log2_run[run_index]);
-                        else
-                            run_count = 0;
-                        if (run_index)
-                            run_index--;
-                        run_mode = 2;
-                    }
-                }
-                run_count--;
-                if (run_count < 0) {
-                    run_mode  = 0;
-                    run_count = 0;
-                    diff      = get_vlc_symbol(&s->gb, &p->vlc_state[context],
-                                               bits);
-                    if (diff >= 0)
-                        diff++;
-                } else
-                    diff = 0;
-            } else
-                diff = get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);
-
-            av_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",
-                    run_count, run_index, run_mode, x, get_bits_count(&s->gb));
-        }
-
-        if (sign)
-            diff = -diff;
-
-        sample[1][x] = (predict(sample[1] + x, sample[0] + x) + diff) &
-                       ((1 << bits) - 1);
-    }
-    s->run_index = run_index;
-}
-
-static void decode_plane(FFV1Context *s, uint8_t *src,
-                         int w, int h, int stride, int plane_index)
-{
-    int x, y;
-    int16_t *sample[2];
-    sample[0] = s->sample_buffer + 3;
-    sample[1] = s->sample_buffer + w + 6 + 3;
-
-    s->run_index = 0;
-
-    memset(s->sample_buffer, 0, 2 * (w + 6) * sizeof(*s->sample_buffer));
-
-    for (y = 0; y < h; y++) {
-        int16_t *temp = sample[0]; // FIXME: try a normal buffer
-
-        sample[0] = sample[1];
-        sample[1] = temp;
-
-        sample[1][-1] = sample[0][0];
-        sample[0][w]  = sample[0][w - 1];
-
-// { START_TIMER
-        if (s->avctx->bits_per_raw_sample <= 8) {
-            decode_line(s, w, sample, plane_index, 8);
-            for (x = 0; x < w; x++)
-                src[x + stride * y] = sample[1][x];
-        } else {
-            decode_line(s, w, sample, plane_index,
-                        s->avctx->bits_per_raw_sample);
-            if (s->packed_at_lsb) {
-                for (x = 0; x < w; x++)
-                    ((uint16_t *)(src + stride * y))[x] = sample[1][x];
-            } else {
-                for (x = 0; x < w; x++)
-                    ((uint16_t *)(src + stride * y))[x] = sample[1][x] << (16 - s->avctx->bits_per_raw_sample);
-            }
-        }
-// STOP_TIMER("decode-line") }
-    }
-}
-
-static void decode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h,
-                             int stride[3])
-{
-    int x, y, p;
-    int16_t *sample[4][2];
-    int lbd  = s->avctx->bits_per_raw_sample <= 8;
-    int bits = s->avctx->bits_per_raw_sample > 0
-               ? s->avctx->bits_per_raw_sample
-               : 8;
-    int offset = 1 << bits;
-
-    for (x = 0; x < 4; x++) {
-        sample[x][0] = s->sample_buffer +  x * 2      * (w + 6) + 3;
-        sample[x][1] = s->sample_buffer + (x * 2 + 1) * (w + 6) + 3;
-    }
-
-    s->run_index = 0;
-
-    memset(s->sample_buffer, 0, 8 * (w + 6) * sizeof(*s->sample_buffer));
-
-    for (y = 0; y < h; y++) {
-        for (p = 0; p < 3 + s->transparency; p++) {
-            int16_t *temp = sample[p][0]; //FIXME try a normal buffer
-
-            sample[p][0] = sample[p][1];
-            sample[p][1] = temp;
-
-            sample[p][1][-1] = sample[p][0][0];
-            sample[p][0][w]  = sample[p][0][w - 1];
-            if (lbd)
-                decode_line(s, w, sample[p], (p + 1) / 2, 9);
-            else
-                decode_line(s, w, sample[p], (p + 1) / 2, bits + 1);
-        }
-        for (x = 0; x < w; x++) {
-            int g = sample[0][1][x];
-            int b = sample[1][1][x];
-            int r = sample[2][1][x];
-            int a = sample[3][1][x];
-
-            b -= offset;
-            r -= offset;
-            g -= (b + r) >> 2;
-            b += g;
-            r += g;
-
-            if (lbd)
-                *((uint32_t *)(src[0] + x * 4 + stride[0] * y)) = b +
-                    (g << 8) + (r << 16) + (a << 24);
-            else {
-                *((uint16_t *)(src[0] + x * 2 + stride[0] * y)) = b;
-                *((uint16_t *)(src[1] + x * 2 + stride[1] * y)) = g;
-                *((uint16_t *)(src[2] + x * 2 + stride[2] * y)) = r;
-            }
-        }
-    }
-}
-
-static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
-{
-    RangeCoder *c = &fs->c;
-    uint8_t state[CONTEXT_SIZE];
-    unsigned ps, i, context_count;
-    memset(state, 128, sizeof(state));
-
-    if (fs->ac > 1) {
-        for (i = 1; i < 256; i++) {
-            fs->c.one_state[i]        = f->state_transition[i];
-            fs->c.zero_state[256 - i] = 256 - fs->c.one_state[i];
-        }
-    }
-
-    fs->slice_x      = get_symbol(c, state, 0) * f->width;
-    fs->slice_y      = get_symbol(c, state, 0) * f->height;
-    fs->slice_width  = (get_symbol(c, state, 0) + 1) * f->width + fs->slice_x;
-    fs->slice_height = (get_symbol(c, state, 0) + 1) * f->height + fs->slice_y;
-
-    fs->slice_x     /= f->num_h_slices;
-    fs->slice_y     /= f->num_v_slices;
-    fs->slice_width  = fs->slice_width / f->num_h_slices - fs->slice_x;
-    fs->slice_height = fs->slice_height / f->num_v_slices - fs->slice_y;
-    if ((unsigned)fs->slice_width  > f->width ||
-        (unsigned)fs->slice_height > f->height)
-        return AVERROR_INVALIDDATA;
-    if ((unsigned)fs->slice_x + (uint64_t)fs->slice_width  > f->width ||
-        (unsigned)fs->slice_y + (uint64_t)fs->slice_height > f->height)
-        return AVERROR_INVALIDDATA;
-
-    for (i = 0; i < f->plane_count; i++) {
-        PlaneContext *const p = &fs->plane[i];
-        int idx               = get_symbol(c, state, 0);
-        if (idx > (unsigned)f->quant_table_count) {
-            av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n");
-            return AVERROR_INVALIDDATA;
-        }
-        p->quant_table_index = idx;
-        memcpy(p->quant_table, f->quant_tables[idx], sizeof(p->quant_table));
-        context_count = f->context_count[idx];
-
-        if (p->context_count < context_count) {
-            av_freep(&p->state);
-            av_freep(&p->vlc_state);
-        }
-        p->context_count = context_count;
-    }
-
-    ps = get_symbol(c, state, 0);
-    if (ps == 1) {
-        f->cur->interlaced_frame = 1;
-        f->cur->top_field_first  = 1;
-    } else if (ps == 2) {
-        f->cur->interlaced_frame = 1;
-        f->cur->top_field_first  = 0;
-    } else if (ps == 3) {
-        f->cur->interlaced_frame = 0;
-    }
-    f->cur->sample_aspect_ratio.num = get_symbol(c, state, 0);
-    f->cur->sample_aspect_ratio.den = get_symbol(c, state, 0);
-
-    return 0;
-}
-
-static int decode_slice(AVCodecContext *c, void *arg)
-{
-    FFV1Context *fs = *(void **)arg;
-    FFV1Context *f  = fs->avctx->priv_data;
-    int width, height, x, y, ret;
-    const int ps = (av_pix_fmt_desc_get(c->pix_fmt)->flags & AV_PIX_FMT_FLAG_PLANAR)
-                   ? (c->bits_per_raw_sample > 8) + 1
-                   : 4;
-    AVFrame *const p = f->cur;
-
-    if (f->version > 2) {
-        if (decode_slice_header(f, fs) < 0) {
-            fs->slice_damaged = 1;
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    if ((ret = ffv1_init_slice_state(f, fs)) < 0)
-        return ret;
-    if (f->cur->key_frame)
-        ffv1_clear_slice_state(f, fs);
-    width  = fs->slice_width;
-    height = fs->slice_height;
-    x      = fs->slice_x;
-    y      = fs->slice_y;
-
-    if (!fs->ac) {
-        if (f->version == 3 && f->minor_version > 1 || f->version > 3)
-            get_rac(&fs->c, (uint8_t[]) { 129 });
-        fs->ac_byte_count = f->version > 2 || (!x && !y) ? fs->c.bytestream - fs->c.bytestream_start - 1 : 0;
-        init_get_bits(&fs->gb, fs->c.bytestream_start + fs->ac_byte_count,
-                      (fs->c.bytestream_end - fs->c.bytestream_start -
-                       fs->ac_byte_count) * 8);
-    }
-
-    av_assert1(width && height);
-    if (f->colorspace == 0) {
-        const int chroma_width  = -((-width) >> f->chroma_h_shift);
-        const int chroma_height = -((-height) >> f->chroma_v_shift);
-        const int cx            = x >> f->chroma_h_shift;
-        const int cy            = y >> f->chroma_v_shift;
-        decode_plane(fs, p->data[0] + ps * x + y * p->linesize[0], width,
-                     height, p->linesize[0],
-                     0);
-
-        if (f->chroma_planes) {
-            decode_plane(fs, p->data[1] + ps * cx + cy * p->linesize[1],
-                         chroma_width, chroma_height, p->linesize[1],
-                         1);
-            decode_plane(fs, p->data[2] + ps * cx + cy * p->linesize[2],
-                         chroma_width, chroma_height, p->linesize[2],
-                         1);
-        }
-        if (fs->transparency)
-            decode_plane(fs, p->data[3] + ps * x + y * p->linesize[3], width,
-                         height, p->linesize[3],
-                         2);
-    } else {
-        uint8_t *planes[3] = { p->data[0] + ps * x + y * p->linesize[0],
-                               p->data[1] + ps * x + y * p->linesize[1],
-                               p->data[2] + ps * x + y * p->linesize[2] };
-        decode_rgb_frame(fs, planes, width, height, p->linesize);
-    }
-    if (fs->ac && f->version > 2) {
-        int v;
-        get_rac(&fs->c, (uint8_t[]) { 129 });
-        v = fs->c.bytestream_end - fs->c.bytestream - 2 - 5 * f->ec;
-        if (v) {
-            av_log(f->avctx, AV_LOG_ERROR, "bytestream end mismatching by %d\n",
-                   v);
-            fs->slice_damaged = 1;
-        }
-    }
-
-    emms_c();
-
-    return 0;
-}
-
-static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale)
-{
-    int v;
-    int i = 0;
-    uint8_t state[CONTEXT_SIZE];
-
-    memset(state, 128, sizeof(state));
-
-    for (v = 0; i < 128; v++) {
-        unsigned len = get_symbol(c, state, 0) + 1;
-
-        if (len > 128 - i)
-            return -1;
-
-        while (len--) {
-            quant_table[i] = scale * v;
-            i++;
-        }
-    }
-
-    for (i = 1; i < 128; i++)
-        quant_table[256 - i] = -quant_table[i];
-    quant_table[128] = -quant_table[127];
-
-    return 2 * v - 1;
-}
-
-static int read_quant_tables(RangeCoder *c,
-                             int16_t quant_table[MAX_CONTEXT_INPUTS][256])
-{
-    int i;
-    int context_count = 1;
-
-    for (i = 0; i < 5; i++) {
-        context_count *= read_quant_table(c, quant_table[i], context_count);
-        if (context_count > 32768U) {
-            return -1;
-        }
-    }
-    return (context_count + 1) / 2;
-}
-
-static int read_extra_header(FFV1Context *f)
-{
-    RangeCoder *const c = &f->c;
-    uint8_t state[CONTEXT_SIZE];
-    int i, j, k, ret;
-    uint8_t state2[32][CONTEXT_SIZE];
-
-    memset(state2, 128, sizeof(state2));
-    memset(state, 128, sizeof(state));
-
-    ff_init_range_decoder(c, f->avctx->extradata, f->avctx->extradata_size);
-    ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8);
-
-    f->version = get_symbol(c, state, 0);
-    if (f->version > 2) {
-        c->bytestream_end -= 4;
-        f->minor_version   = get_symbol(c, state, 0);
-    }
-    f->ac = f->avctx->coder_type = get_symbol(c, state, 0);
-
-    if (f->ac > 1) {
-        for (i = 1; i < 256; i++)
-            f->state_transition[i] = get_symbol(c, state, 1) + c->one_state[i];
-    }
-
-    f->colorspace                 = get_symbol(c, state, 0); //YUV cs type
-    f->avctx->bits_per_raw_sample = get_symbol(c, state, 0);
-    f->chroma_planes              = get_rac(c, state);
-    f->chroma_h_shift             = get_symbol(c, state, 0);
-    f->chroma_v_shift             = get_symbol(c, state, 0);
-    f->transparency               = get_rac(c, state);
-    f->plane_count                = 2 + f->transparency;
-    f->num_h_slices               = 1 + get_symbol(c, state, 0);
-    f->num_v_slices               = 1 + get_symbol(c, state, 0);
-
-    if (f->num_h_slices > (unsigned)f->width ||
-        f->num_v_slices > (unsigned)f->height) {
-        av_log(f->avctx, AV_LOG_ERROR, "too many slices\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    f->quant_table_count = get_symbol(c, state, 0);
-    if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES)
-        return AVERROR_INVALIDDATA;
-    for (i = 0; i < f->quant_table_count; i++) {
-        f->context_count[i] = read_quant_tables(c, f->quant_tables[i]);
-        if (f->context_count[i] < 0) {
-            av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    if ((ret = ffv1_allocate_initial_states(f)) < 0)
-        return ret;
-
-    for (i = 0; i < f->quant_table_count; i++)
-        if (get_rac(c, state)) {
-            for (j = 0; j < f->context_count[i]; j++)
-                for (k = 0; k < CONTEXT_SIZE; k++) {
-                    int pred = j ? f->initial_states[i][j - 1][k] : 128;
-                    f->initial_states[i][j][k] =
-                        (pred + get_symbol(c, state2[k], 1)) & 0xFF;
-                }
-        }
-
-    if (f->version > 2) {
-        f->ec = get_symbol(c, state, 0);
-    }
-
-    if (f->version > 2) {
-        unsigned v;
-        v = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0,
-                   f->avctx->extradata, f->avctx->extradata_size);
-        if (v) {
-            av_log(f->avctx, AV_LOG_ERROR, "CRC mismatch %X!\n", v);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    return 0;
-}
-
-
-static int read_header(FFV1Context *f)
-{
-    uint8_t state[CONTEXT_SIZE];
-    int i, j, context_count = -1;
-    RangeCoder *const c = &f->slice_context[0]->c;
-
-    memset(state, 128, sizeof(state));
-
-    if (f->version < 2) {
-        unsigned v = get_symbol(c, state, 0);
-        if (v > 1) {
-            av_log(f->avctx, AV_LOG_ERROR,
-                   "invalid version %d in version 1 header\n", v);
-            return AVERROR_INVALIDDATA;
-        }
-        f->version = v;
-
-        f->ac = f->avctx->coder_type = get_symbol(c, state, 0);
-
-        if (f->ac > 1) {
-            for (i = 1; i < 256; i++)
-                f->state_transition[i] =
-                    get_symbol(c, state, 1) + c->one_state[i];
-        }
-
-        f->colorspace = get_symbol(c, state, 0); //YUV cs type
-
-        if (f->version > 0)
-            f->avctx->bits_per_raw_sample = get_symbol(c, state, 0);
-
-        f->chroma_planes  = get_rac(c, state);
-        f->chroma_h_shift = get_symbol(c, state, 0);
-        f->chroma_v_shift = get_symbol(c, state, 0);
-        f->transparency   = get_rac(c, state);
-        f->plane_count    = 2 + f->transparency;
-    }
-
-    if (f->colorspace == 0) {
-        if (!f->transparency && !f->chroma_planes) {
-            if (f->avctx->bits_per_raw_sample <= 8)
-                f->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-            else
-                f->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
-        } else if (f->avctx->bits_per_raw_sample <= 8 && !f->transparency) {
-            switch (16 * f->chroma_h_shift + f->chroma_v_shift) {
-            case 0x00:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
-                break;
-            case 0x01:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV440P;
-                break;
-            case 0x10:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-                break;
-            case 0x11:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-                break;
-            case 0x20:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV411P;
-                break;
-            case 0x22:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV410P;
-                break;
-            default:
-                av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
-                return AVERROR(ENOSYS);
-            }
-        } else if (f->avctx->bits_per_raw_sample <= 8 && f->transparency) {
-            switch (16 * f->chroma_h_shift + f->chroma_v_shift) {
-            case 0x00:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
-                break;
-            case 0x10:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUVA422P;
-                break;
-            case 0x11:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
-                break;
-            default:
-                av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
-                return AVERROR(ENOSYS);
-            }
-        } else if (f->avctx->bits_per_raw_sample == 9) {
-            f->packed_at_lsb = 1;
-            switch (16 * f->chroma_h_shift + f->chroma_v_shift) {
-            case 0x00:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV444P9;
-                break;
-            case 0x10:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV422P9;
-                break;
-            case 0x11:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV420P9;
-                break;
-            default:
-                av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
-                return AVERROR(ENOSYS);
-            }
-        } else if (f->avctx->bits_per_raw_sample == 10) {
-            f->packed_at_lsb = 1;
-            switch (16 * f->chroma_h_shift + f->chroma_v_shift) {
-            case 0x00:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
-                break;
-            case 0x10:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
-                break;
-            case 0x11:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
-                break;
-            default:
-                av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
-                return AVERROR(ENOSYS);
-            }
-        } else {
-            switch (16 * f->chroma_h_shift + f->chroma_v_shift) {
-            case 0x00:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV444P16;
-                break;
-            case 0x10:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
-                break;
-            case 0x11:
-                f->avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
-                break;
-            default:
-                av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
-                return AVERROR(ENOSYS);
-            }
-        }
-    } else if (f->colorspace == 1) {
-        if (f->chroma_h_shift || f->chroma_v_shift) {
-            av_log(f->avctx, AV_LOG_ERROR,
-                   "chroma subsampling not supported in this colorspace\n");
-            return AVERROR(ENOSYS);
-        }
-        switch (f->avctx->bits_per_raw_sample) {
-        case 0:
-        case 8:
-            f->avctx->pix_fmt = AV_PIX_FMT_RGB32;
-            break;
-        case 9:
-            f->avctx->pix_fmt = AV_PIX_FMT_GBRP9;
-            break;
-        case 10:
-            f->avctx->pix_fmt = AV_PIX_FMT_GBRP10;
-            break;
-        default:
-            av_log(f->avctx, AV_LOG_ERROR,
-                   "bit depth %d not supported\n",
-                   f->avctx->bits_per_raw_sample);
-            return AVERROR(ENOSYS);
-        }
-    } else {
-        av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n");
-        return AVERROR(ENOSYS);
-    }
-
-    av_dlog(f->avctx, "%d %d %d\n",
-            f->chroma_h_shift, f->chroma_v_shift, f->avctx->pix_fmt);
-    if (f->version < 2) {
-        context_count = read_quant_tables(c, f->quant_table);
-        if (context_count < 0) {
-            av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
-            return AVERROR_INVALIDDATA;
-        }
-    } else if (f->version < 3) {
-        f->slice_count = get_symbol(c, state, 0);
-    } else {
-        const uint8_t *p = c->bytestream_end;
-        for (f->slice_count = 0;
-             f->slice_count < MAX_SLICES && 3 < p - c->bytestream_start;
-             f->slice_count++) {
-            int trailer = 3 + 5 * !!f->ec;
-            int size    = AV_RB24(p - trailer);
-            if (size + trailer > p - c->bytestream_start)
-                break;
-            p -= size + trailer;
-        }
-    }
-    if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0) {
-        av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid\n",
-               f->slice_count);
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (j = 0; j < f->slice_count; j++) {
-        FFV1Context *fs = f->slice_context[j];
-        fs->ac            = f->ac;
-        fs->packed_at_lsb = f->packed_at_lsb;
-
-        fs->slice_damaged = 0;
-
-        if (f->version == 2) {
-            fs->slice_x     = get_symbol(c, state, 0) * f->width;
-            fs->slice_y     = get_symbol(c, state, 0) * f->height;
-            fs->slice_width =
-                (get_symbol(c, state, 0) + 1) * f->width + fs->slice_x;
-            fs->slice_height =
-                (get_symbol(c, state, 0) + 1) * f->height + fs->slice_y;
-
-            fs->slice_x      /= f->num_h_slices;
-            fs->slice_y      /= f->num_v_slices;
-            fs->slice_width  = fs->slice_width  / f->num_h_slices - fs->slice_x;
-            fs->slice_height = fs->slice_height / f->num_v_slices - fs->slice_y;
-            if ((unsigned)fs->slice_width > f->width ||
-                (unsigned)fs->slice_height > f->height)
-                return AVERROR_INVALIDDATA;
-            if ((unsigned)fs->slice_x + (uint64_t)fs->slice_width > f->width
-                || (unsigned)fs->slice_y + (uint64_t)fs->slice_height >
-                f->height)
-                return AVERROR_INVALIDDATA;
-        }
-
-        for (i = 0; i < f->plane_count; i++) {
-            PlaneContext *const p = &fs->plane[i];
-
-            if (f->version == 2) {
-                int idx = get_symbol(c, state, 0);
-                if (idx > (unsigned)f->quant_table_count) {
-                    av_log(f->avctx, AV_LOG_ERROR,
-                           "quant_table_index out of range\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                p->quant_table_index = idx;
-                memcpy(p->quant_table, f->quant_tables[idx],
-                       sizeof(p->quant_table));
-                context_count = f->context_count[idx];
-            } else {
-                memcpy(p->quant_table, f->quant_table, sizeof(p->quant_table));
-            }
-
-            if (f->version <= 2) {
-                av_assert0(context_count >= 0);
-                if (p->context_count < context_count) {
-                    av_freep(&p->state);
-                    av_freep(&p->vlc_state);
-                }
-                p->context_count = context_count;
-            }
-        }
-    }
-    return 0;
-}
-
-static av_cold int ffv1_decode_init(AVCodecContext *avctx)
-{
-    FFV1Context *f = avctx->priv_data;
-    int ret;
-
-    ffv1_common_init(avctx);
-
-    f->last_picture = av_frame_alloc();
-    if (!f->last_picture)
-        return AVERROR(ENOMEM);
-
-    if (avctx->extradata && (ret = read_extra_header(f)) < 0)
-        return ret;
-
-    if ((ret = ffv1_init_slice_contexts(f)) < 0)
-        return ret;
-
-    return 0;
-}
-
-static int ffv1_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf  = avpkt->data;
-    int buf_size        = avpkt->size;
-    FFV1Context *f      = avctx->priv_data;
-    RangeCoder *const c = &f->slice_context[0]->c;
-    int i, ret;
-    uint8_t keystate = 128;
-    const uint8_t *buf_p;
-    AVFrame *const p    = data;
-
-    f->cur = p;
-
-    ff_init_range_decoder(c, buf, buf_size);
-    ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8);
-
-    p->pict_type = AV_PICTURE_TYPE_I; //FIXME I vs. P
-    if (get_rac(c, &keystate)) {
-        p->key_frame    = 1;
-        f->key_frame_ok = 0;
-        if ((ret = read_header(f)) < 0)
-            return ret;
-        f->key_frame_ok = 1;
-    } else {
-        if (!f->key_frame_ok) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Cannot decode non-keyframe without valid keyframe\n");
-            return AVERROR_INVALIDDATA;
-        }
-        p->key_frame = 0;
-    }
-
-    if ((ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(avctx, AV_LOG_DEBUG,
-               "ver:%d keyframe:%d coder:%d ec:%d slices:%d bps:%d\n",
-               f->version, p->key_frame, f->ac, f->ec, f->slice_count,
-               f->avctx->bits_per_raw_sample);
-
-    buf_p = buf + buf_size;
-    for (i = f->slice_count - 1; i >= 0; i--) {
-        FFV1Context *fs = f->slice_context[i];
-        int trailer     = 3 + 5 * !!f->ec;
-        int v;
-
-        if (i || f->version > 2)
-            v = AV_RB24(buf_p - trailer) + trailer;
-        else
-            v = buf_p - c->bytestream_start;
-        if (buf_p - c->bytestream_start < v) {
-            av_log(avctx, AV_LOG_ERROR, "Slice pointer chain broken\n");
-            return AVERROR_INVALIDDATA;
-        }
-        buf_p -= v;
-
-        if (f->ec) {
-            unsigned crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0, buf_p, v);
-            if (crc) {
-                av_log(f->avctx, AV_LOG_ERROR, "CRC mismatch %X!\n", crc);
-                fs->slice_damaged = 1;
-            }
-        }
-
-        if (i) {
-            ff_init_range_decoder(&fs->c, buf_p, v);
-        } else
-            fs->c.bytestream_end = (uint8_t *)(buf_p + v);
-
-        fs->cur = p;
-    }
-
-    avctx->execute(avctx, decode_slice, &f->slice_context[0], NULL,
-                   f->slice_count,
-                   sizeof(void *));
-
-    for (i = f->slice_count - 1; i >= 0; i--) {
-        FFV1Context *fs = f->slice_context[i];
-        int j;
-        if (fs->slice_damaged && f->last_picture->data[0]) {
-            const uint8_t *src[4];
-            uint8_t *dst[4];
-            for (j = 0; j < 4; j++) {
-                int sh = (j == 1 || j == 2) ? f->chroma_h_shift : 0;
-                int sv = (j == 1 || j == 2) ? f->chroma_v_shift : 0;
-                dst[j] = p->data[j] + p->linesize[j] *
-                         (fs->slice_y >> sv) + (fs->slice_x >> sh);
-                src[j] = f->last_picture->data[j] +
-                         f->last_picture->linesize[j] *
-                         (fs->slice_y >> sv) + (fs->slice_x >> sh);
-            }
-            av_image_copy(dst, p->linesize, (const uint8_t **)src,
-                          f->last_picture->linesize,
-                          avctx->pix_fmt, fs->slice_width,
-                          fs->slice_height);
-        }
-    }
-
-    f->picture_number++;
-
-    av_frame_unref(f->last_picture);
-    if ((ret = av_frame_ref(f->last_picture, p)) < 0)
-        return ret;
-    f->cur = NULL;
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int ffv1_decode_close(AVCodecContext *avctx)
-{
-    FFV1Context *s = avctx->priv_data;;
-
-    av_frame_free(&s->last_picture);
-
-    ffv1_close(avctx);
-
-    return 0;
-}
-
-AVCodec ff_ffv1_decoder = {
-    .name           = "ffv1",
-    .long_name      = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FFV1,
-    .priv_data_size = sizeof(FFV1Context),
-    .init           = ffv1_decode_init,
-    .close          = ffv1_decode_close,
-    .decode         = ffv1_decode_frame,
-    .capabilities   = CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/ |
-                      CODEC_CAP_SLICE_THREADS,
-};
diff --git a/deps/libav/libavcodec/ffv1enc.c b/deps/libav/libavcodec/ffv1enc.c
deleted file mode 100644
index 179453d..0000000
--- a/deps/libav/libavcodec/ffv1enc.c
+++ /dev/null
@@ -1,1113 +0,0 @@
-/*
- * FFV1 encoder for libavcodec
- *
- * Copyright (c) 2003-2012 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FF Video Codec 1 (a lossless codec) encoder
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/crc.h"
-#include "libavutil/opt.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "rangecoder.h"
-#include "golomb.h"
-#include "mathops.h"
-#include "ffv1.h"
-
-static void find_best_state(uint8_t best_state[256][256],
-                            const uint8_t one_state[256])
-{
-    int i, j, k, m;
-    double l2tab[256];
-
-    for (i = 1; i < 256; i++)
-        l2tab[i] = log2(i / 256.0);
-
-    for (i = 0; i < 256; i++) {
-        double best_len[256];
-        double p = i / 256.0;
-
-        for (j = 0; j < 256; j++)
-            best_len[j] = 1 << 30;
-
-        for (j = FFMAX(i - 10, 1); j < FFMIN(i + 11, 256); j++) {
-            double occ[256] = { 0 };
-            double len      = 0;
-            occ[j] = 1.0;
-            for (k = 0; k < 256; k++) {
-                double newocc[256] = { 0 };
-                for (m = 1; m < 256; m++)
-                    if (occ[m]) {
-                        len -= occ[m] *     (p  * l2tab[m] +
-                                        (1 - p) * l2tab[256 - m]);
-                    }
-                if (len < best_len[k]) {
-                    best_len[k]      = len;
-                    best_state[i][k] = j;
-                }
-                for (m = 0; m < 256; m++)
-                    if (occ[m]) {
-                        newocc[one_state[m]]             += occ[m] * p;
-                        newocc[256 - one_state[256 - m]] += occ[m] * (1 - p);
-                    }
-                memcpy(occ, newocc, sizeof(occ));
-            }
-        }
-    }
-}
-
-static av_always_inline av_flatten void put_symbol_inline(RangeCoder *c,
-                                                          uint8_t *state, int v,
-                                                          int is_signed,
-                                                          uint64_t rc_stat[256][2],
-                                                          uint64_t rc_stat2[32][2])
-{
-    int i;
-
-#define put_rac(C, S, B)                        \
-    do {                                        \
-        if (rc_stat) {                          \
-            rc_stat[*(S)][B]++;                 \
-            rc_stat2[(S) - state][B]++;         \
-        }                                       \
-        put_rac(C, S, B);                       \
-    } while (0)
-
-    if (v) {
-        const int a = FFABS(v);
-        const int e = av_log2(a);
-        put_rac(c, state + 0, 0);
-        if (e <= 9) {
-            for (i = 0; i < e; i++)
-                put_rac(c, state + 1 + i, 1);  // 1..10
-            put_rac(c, state + 1 + i, 0);
-
-            for (i = e - 1; i >= 0; i--)
-                put_rac(c, state + 22 + i, (a >> i) & 1);  // 22..31
-
-            if (is_signed)
-                put_rac(c, state + 11 + e, v < 0);  // 11..21
-        } else {
-            for (i = 0; i < e; i++)
-                put_rac(c, state + 1 + FFMIN(i, 9), 1);  // 1..10
-            put_rac(c, state + 1 + 9, 0);
-
-            for (i = e - 1; i >= 0; i--)
-                put_rac(c, state + 22 + FFMIN(i, 9), (a >> i) & 1);  // 22..31
-
-            if (is_signed)
-                put_rac(c, state + 11 + 10, v < 0);  // 11..21
-        }
-    } else {
-        put_rac(c, state + 0, 1);
-    }
-#undef put_rac
-}
-
-static av_noinline void put_symbol(RangeCoder *c, uint8_t *state,
-                                   int v, int is_signed)
-{
-    put_symbol_inline(c, state, v, is_signed, NULL, NULL);
-}
-
-static inline void put_vlc_symbol(PutBitContext *pb, VlcState *const state,
-                                  int v, int bits)
-{
-    int i, k, code;
-    v = fold(v - state->bias, bits);
-
-    i = state->count;
-    k = 0;
-    while (i < state->error_sum) { // FIXME: optimize
-        k++;
-        i += i;
-    }
-
-    assert(k <= 13);
-
-#if 0 // JPEG LS
-    if (k == 0 && 2 * state->drift <= -state->count)
-        code = v ^ (-1);
-    else
-        code = v;
-#else
-    code = v ^ ((2 * state->drift + state->count) >> 31);
-#endif
-
-    av_dlog(NULL, "v:%d/%d bias:%d error:%d drift:%d count:%d k:%d\n", v, code,
-            state->bias, state->error_sum, state->drift, state->count, k);
-    set_sr_golomb(pb, code, k, 12, bits);
-
-    update_vlc_state(state, v);
-}
-
-static av_always_inline int encode_line(FFV1Context *s, int w,
-                                        int16_t *sample[3],
-                                        int plane_index, int bits)
-{
-    PlaneContext *const p = &s->plane[plane_index];
-    RangeCoder *const c   = &s->c;
-    int x;
-    int run_index = s->run_index;
-    int run_count = 0;
-    int run_mode  = 0;
-
-    if (s->ac) {
-        if (c->bytestream_end - c->bytestream < w * 20) {
-            av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
-            return AVERROR_INVALIDDATA;
-        }
-    } else {
-        if (s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb) >> 3) < w * 4) {
-            av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    for (x = 0; x < w; x++) {
-        int diff, context;
-
-        context = get_context(p, sample[0] + x, sample[1] + x, sample[2] + x);
-        diff    = sample[0][x] - predict(sample[0] + x, sample[1] + x);
-
-        if (context < 0) {
-            context = -context;
-            diff    = -diff;
-        }
-
-        diff = fold(diff, bits);
-
-        if (s->ac) {
-            if (s->flags & CODEC_FLAG_PASS1) {
-                put_symbol_inline(c, p->state[context], diff, 1, s->rc_stat,
-                                  s->rc_stat2[p->quant_table_index][context]);
-            } else {
-                put_symbol_inline(c, p->state[context], diff, 1, NULL, NULL);
-            }
-        } else {
-            if (context == 0)
-                run_mode = 1;
-
-            if (run_mode) {
-                if (diff) {
-                    while (run_count >= 1 << ff_log2_run[run_index]) {
-                        run_count -= 1 << ff_log2_run[run_index];
-                        run_index++;
-                        put_bits(&s->pb, 1, 1);
-                    }
-
-                    put_bits(&s->pb, 1 + ff_log2_run[run_index], run_count);
-                    if (run_index)
-                        run_index--;
-                    run_count = 0;
-                    run_mode  = 0;
-                    if (diff > 0)
-                        diff--;
-                } else {
-                    run_count++;
-                }
-            }
-
-            av_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",
-                    run_count, run_index, run_mode, x,
-                    (int)put_bits_count(&s->pb));
-
-            if (run_mode == 0)
-                put_vlc_symbol(&s->pb, &p->vlc_state[context], diff, bits);
-        }
-    }
-    if (run_mode) {
-        while (run_count >= 1 << ff_log2_run[run_index]) {
-            run_count -= 1 << ff_log2_run[run_index];
-            run_index++;
-            put_bits(&s->pb, 1, 1);
-        }
-
-        if (run_count)
-            put_bits(&s->pb, 1, 1);
-    }
-    s->run_index = run_index;
-
-    return 0;
-}
-
-static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h,
-                         int stride, int plane_index)
-{
-    int x, y, i;
-    const int ring_size = s->avctx->context_model ? 3 : 2;
-    int16_t *sample[3];
-    s->run_index = 0;
-
-    memset(s->sample_buffer, 0, ring_size * (w + 6) * sizeof(*s->sample_buffer));
-
-    for (y = 0; y < h; y++) {
-        for (i = 0; i < ring_size; i++)
-            sample[i] = s->sample_buffer + (w + 6) * ((h + i - y) % ring_size) + 3;
-
-        sample[0][-1] = sample[1][0];
-        sample[1][w]  = sample[1][w - 1];
-// { START_TIMER
-        if (s->bits_per_raw_sample <= 8) {
-            for (x = 0; x < w; x++)
-                sample[0][x] = src[x + stride * y];
-            encode_line(s, w, sample, plane_index, 8);
-        } else {
-            if (s->packed_at_lsb) {
-                for (x = 0; x < w; x++)
-                    sample[0][x] = ((uint16_t *)(src + stride * y))[x];
-            } else {
-                for (x = 0; x < w; x++)
-                    sample[0][x] =
-                        ((uint16_t *)(src + stride * y))[x] >> (16 - s->bits_per_raw_sample);
-            }
-            encode_line(s, w, sample, plane_index, s->bits_per_raw_sample);
-        }
-// STOP_TIMER("encode line") }
-    }
-}
-
-static void encode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h,
-                             int stride[3])
-{
-    int x, y, p, i;
-    const int ring_size = s->avctx->context_model ? 3 : 2;
-    int16_t *sample[MAX_PLANES][3];
-    int lbd  = s->avctx->bits_per_raw_sample <= 8;
-    int bits = s->avctx->bits_per_raw_sample > 0
-               ? s->avctx->bits_per_raw_sample
-               : 8;
-    int offset = 1 << bits;
-
-    s->run_index = 0;
-
-    memset(s->sample_buffer, 0, ring_size * MAX_PLANES *
-                                (w + 6) * sizeof(*s->sample_buffer));
-
-    for (y = 0; y < h; y++) {
-        for (i = 0; i < ring_size; i++)
-            for (p = 0; p < MAX_PLANES; p++)
-                sample[p][i] = s->sample_buffer + p * ring_size *
-                               (w + 6) +
-                               ((h + i - y) % ring_size) * (w + 6) + 3;
-
-        for (x = 0; x < w; x++) {
-            int b, g, r, av_uninit(a);
-            if (lbd) {
-                unsigned v = *((uint32_t *)(src[0] + x * 4 + stride[0] * y));
-                b = v & 0xFF;
-                g = (v >> 8) & 0xFF;
-                r = (v >> 16) & 0xFF;
-                a = v >> 24;
-            } else {
-                b = *((uint16_t *)(src[0] + x * 2 + stride[0] * y));
-                g = *((uint16_t *)(src[1] + x * 2 + stride[1] * y));
-                r = *((uint16_t *)(src[2] + x * 2 + stride[2] * y));
-            }
-
-            b -= g;
-            r -= g;
-            g += (b + r) >> 2;
-            b += offset;
-            r += offset;
-
-            sample[0][0][x] = g;
-            sample[1][0][x] = b;
-            sample[2][0][x] = r;
-            sample[3][0][x] = a;
-        }
-        for (p = 0; p < 3 + s->transparency; p++) {
-            sample[p][0][-1] = sample[p][1][0];
-            sample[p][1][w]  = sample[p][1][w - 1];
-            if (lbd)
-                encode_line(s, w, sample[p], (p + 1) / 2, 9);
-            else
-                encode_line(s, w, sample[p], (p + 1) / 2, bits + 1);
-        }
-    }
-}
-
-
-static void write_quant_table(RangeCoder *c, int16_t *quant_table)
-{
-    int last = 0;
-    int i;
-    uint8_t state[CONTEXT_SIZE];
-    memset(state, 128, sizeof(state));
-
-    for (i = 1; i < 128; i++)
-        if (quant_table[i] != quant_table[i - 1]) {
-            put_symbol(c, state, i - last - 1, 0);
-            last = i;
-        }
-    put_symbol(c, state, i - last - 1, 0);
-}
-
-static void write_quant_tables(RangeCoder *c,
-                               int16_t quant_table[MAX_CONTEXT_INPUTS][256])
-{
-    int i;
-    for (i = 0; i < 5; i++)
-        write_quant_table(c, quant_table[i]);
-}
-
-static void write_header(FFV1Context *f)
-{
-    uint8_t state[CONTEXT_SIZE];
-    int i, j;
-    RangeCoder *const c = &f->slice_context[0]->c;
-
-    memset(state, 128, sizeof(state));
-
-    if (f->version < 2) {
-        put_symbol(c, state, f->version, 0);
-        put_symbol(c, state, f->ac, 0);
-        if (f->ac > 1) {
-            for (i = 1; i < 256; i++)
-                put_symbol(c, state,
-                           f->state_transition[i] - c->one_state[i], 1);
-        }
-        put_symbol(c, state, f->colorspace, 0); // YUV cs type
-        if (f->version > 0)
-            put_symbol(c, state, f->bits_per_raw_sample, 0);
-        put_rac(c, state, f->chroma_planes);
-        put_symbol(c, state, f->chroma_h_shift, 0);
-        put_symbol(c, state, f->chroma_v_shift, 0);
-        put_rac(c, state, f->transparency);
-
-        write_quant_tables(c, f->quant_table);
-    } else if (f->version < 3) {
-        put_symbol(c, state, f->slice_count, 0);
-        for (i = 0; i < f->slice_count; i++) {
-            FFV1Context *fs = f->slice_context[i];
-            put_symbol(c, state,
-                       (fs->slice_x      + 1) * f->num_h_slices / f->width, 0);
-            put_symbol(c, state,
-                       (fs->slice_y      + 1) * f->num_v_slices / f->height, 0);
-            put_symbol(c, state,
-                       (fs->slice_width  + 1) * f->num_h_slices / f->width - 1,
-                       0);
-            put_symbol(c, state,
-                       (fs->slice_height + 1) * f->num_v_slices / f->height - 1,
-                       0);
-            for (j = 0; j < f->plane_count; j++) {
-                put_symbol(c, state, f->plane[j].quant_table_index, 0);
-                av_assert0(f->plane[j].quant_table_index == f->avctx->context_model);
-            }
-        }
-    }
-}
-
-static int write_extradata(FFV1Context *f)
-{
-    RangeCoder *const c = &f->c;
-    uint8_t state[CONTEXT_SIZE];
-    int i, j, k;
-    uint8_t state2[32][CONTEXT_SIZE];
-    unsigned v;
-
-    memset(state2, 128, sizeof(state2));
-    memset(state, 128, sizeof(state));
-
-    f->avctx->extradata_size = 10000 + 4 +
-                                    (11 * 11 * 5 * 5 * 5 + 11 * 11 * 11) * 32;
-    f->avctx->extradata = av_malloc(f->avctx->extradata_size);
-    ff_init_range_encoder(c, f->avctx->extradata, f->avctx->extradata_size);
-    ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8);
-
-    put_symbol(c, state, f->version, 0);
-    if (f->version > 2) {
-        if (f->version == 3)
-            f->minor_version = 2;
-        put_symbol(c, state, f->minor_version, 0);
-    }
-
-    put_symbol(c, state, f->ac, 0);
-    if (f->ac > 1)
-        for (i = 1; i < 256; i++)
-            put_symbol(c, state, f->state_transition[i] - c->one_state[i], 1);
-
-    put_symbol(c, state, f->colorspace, 0); // YUV cs type
-    put_symbol(c, state, f->bits_per_raw_sample, 0);
-    put_rac(c, state, f->chroma_planes);
-    put_symbol(c, state, f->chroma_h_shift, 0);
-    put_symbol(c, state, f->chroma_v_shift, 0);
-    put_rac(c, state, f->transparency);
-    put_symbol(c, state, f->num_h_slices - 1, 0);
-    put_symbol(c, state, f->num_v_slices - 1, 0);
-
-    put_symbol(c, state, f->quant_table_count, 0);
-    for (i = 0; i < f->quant_table_count; i++)
-        write_quant_tables(c, f->quant_tables[i]);
-
-    for (i = 0; i < f->quant_table_count; i++) {
-        for (j = 0; j < f->context_count[i] * CONTEXT_SIZE; j++)
-            if (f->initial_states[i] && f->initial_states[i][0][j] != 128)
-                break;
-        if (j < f->context_count[i] * CONTEXT_SIZE) {
-            put_rac(c, state, 1);
-            for (j = 0; j < f->context_count[i]; j++)
-                for (k = 0; k < CONTEXT_SIZE; k++) {
-                    int pred = j ? f->initial_states[i][j - 1][k] : 128;
-                    put_symbol(c, state2[k],
-                               (int8_t)(f->initial_states[i][j][k] - pred), 1);
-                }
-        } else {
-            put_rac(c, state, 0);
-        }
-    }
-
-    if (f->version > 2) {
-        put_symbol(c, state, f->ec, 0);
-    }
-
-    f->avctx->extradata_size = ff_rac_terminate(c);
-
-    v = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0,
-               f->avctx->extradata, f->avctx->extradata_size);
-    AV_WL32(f->avctx->extradata + f->avctx->extradata_size, v);
-    f->avctx->extradata_size += 4;
-
-    return 0;
-}
-
-static int sort_stt(FFV1Context *s, uint8_t stt[256])
-{
-    int i, i2, changed, print = 0;
-
-    do {
-        changed = 0;
-        for (i = 12; i < 244; i++) {
-            for (i2 = i + 1; i2 < 245 && i2 < i + 4; i2++) {
-
-#define COST(old, new)                                      \
-    s->rc_stat[old][0] * -log2((256 - (new)) / 256.0) +     \
-    s->rc_stat[old][1] * -log2((new)         / 256.0)
-
-#define COST2(old, new)                         \
-    COST(old, new) + COST(256 - (old), 256 - (new))
-
-                double size0 = COST2(i,  i) + COST2(i2, i2);
-                double sizeX = COST2(i, i2) + COST2(i2, i);
-                if (sizeX < size0 && i != 128 && i2 != 128) {
-                    int j;
-                    FFSWAP(int, stt[i], stt[i2]);
-                    FFSWAP(int, s->rc_stat[i][0], s->rc_stat[i2][0]);
-                    FFSWAP(int, s->rc_stat[i][1], s->rc_stat[i2][1]);
-                    if (i != 256 - i2) {
-                        FFSWAP(int, stt[256 - i], stt[256 - i2]);
-                        FFSWAP(int, s->rc_stat[256 - i][0], s->rc_stat[256 - i2][0]);
-                        FFSWAP(int, s->rc_stat[256 - i][1], s->rc_stat[256 - i2][1]);
-                    }
-                    for (j = 1; j < 256; j++) {
-                        if (stt[j] == i)
-                            stt[j] = i2;
-                        else if (stt[j] == i2)
-                            stt[j] = i;
-                        if (i != 256 - i2) {
-                            if (stt[256 - j] == 256 - i)
-                                stt[256 - j] = 256 - i2;
-                            else if (stt[256 - j] == 256 - i2)
-                                stt[256 - j] = 256 - i;
-                        }
-                    }
-                    print = changed = 1;
-                }
-            }
-        }
-    } while (changed);
-    return print;
-}
-
-static av_cold int init_slices_state(FFV1Context *f)
-{
-    int i, ret;
-    for (i = 0; i < f->slice_count; i++) {
-        FFV1Context *fs = f->slice_context[i];
-        if ((ret = ffv1_init_slice_state(f, fs)) < 0)
-            return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-static av_cold int ffv1_encode_init(AVCodecContext *avctx)
-{
-    FFV1Context *s = avctx->priv_data;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-    int i, j, k, m, ret;
-
-    ffv1_common_init(avctx);
-
-    s->version = 0;
-
-    if ((avctx->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2)) ||
-        avctx->slices > 1)
-        s->version = FFMAX(s->version, 2);
-
-    if (avctx->level == 3) {
-        s->version = 3;
-    }
-
-    if (s->ec < 0) {
-        s->ec = (s->version >= 3);
-    }
-
-    if (s->version >= 2 &&
-        avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Version %d requested, please set -strict experimental in "
-               "order to enable it\n",
-               s->version);
-        return AVERROR(ENOSYS);
-    }
-
-    s->ac = avctx->coder_type > 0 ? 2 : 0;
-
-    s->plane_count = 3;
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_YUV444P9:
-    case AV_PIX_FMT_YUV422P9:
-    case AV_PIX_FMT_YUV420P9:
-        if (!avctx->bits_per_raw_sample)
-            s->bits_per_raw_sample = 9;
-    case AV_PIX_FMT_YUV444P10:
-    case AV_PIX_FMT_YUV420P10:
-    case AV_PIX_FMT_YUV422P10:
-        s->packed_at_lsb = 1;
-        if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
-            s->bits_per_raw_sample = 10;
-    case AV_PIX_FMT_GRAY16:
-    case AV_PIX_FMT_YUV444P16:
-    case AV_PIX_FMT_YUV422P16:
-    case AV_PIX_FMT_YUV420P16:
-        if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) {
-            s->bits_per_raw_sample = 16;
-        } else if (!s->bits_per_raw_sample) {
-            s->bits_per_raw_sample = avctx->bits_per_raw_sample;
-        }
-        if (s->bits_per_raw_sample <= 8) {
-            av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample invalid\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (!s->ac && avctx->coder_type == -1) {
-            av_log(avctx, AV_LOG_INFO,
-                   "bits_per_raw_sample > 8, forcing coder 1\n");
-            s->ac = 2;
-        }
-        if (!s->ac) {
-            av_log(
-                avctx, AV_LOG_ERROR,
-                "bits_per_raw_sample of more than 8 needs -coder 1 currently\n");
-            return AVERROR_INVALIDDATA;
-        }
-        s->version = FFMAX(s->version, 1);
-    case AV_PIX_FMT_GRAY8:
-    case AV_PIX_FMT_YUV444P:
-    case AV_PIX_FMT_YUV440P:
-    case AV_PIX_FMT_YUV422P:
-    case AV_PIX_FMT_YUV420P:
-    case AV_PIX_FMT_YUV411P:
-    case AV_PIX_FMT_YUV410P:
-        s->chroma_planes = desc->nb_components < 3 ? 0 : 1;
-        s->colorspace    = 0;
-        break;
-    case AV_PIX_FMT_YUVA444P:
-    case AV_PIX_FMT_YUVA422P:
-    case AV_PIX_FMT_YUVA420P:
-        s->chroma_planes = 1;
-        s->colorspace    = 0;
-        s->transparency  = 1;
-        break;
-    case AV_PIX_FMT_RGB32:
-        s->colorspace   = 1;
-        s->transparency = 1;
-        break;
-    case AV_PIX_FMT_GBRP9:
-        if (!avctx->bits_per_raw_sample)
-            s->bits_per_raw_sample = 9;
-    case AV_PIX_FMT_GBRP10:
-        if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
-            s->bits_per_raw_sample = 10;
-    case AV_PIX_FMT_GBRP16:
-        if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
-            s->bits_per_raw_sample = 16;
-        else if (!s->bits_per_raw_sample)
-            s->bits_per_raw_sample = avctx->bits_per_raw_sample;
-        s->colorspace    = 1;
-        s->chroma_planes = 1;
-        s->version       = FFMAX(s->version, 1);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "format not supported\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (s->transparency) {
-        av_log(
-            avctx, AV_LOG_WARNING,
-            "Storing alpha plane, this will require a recent FFV1 decoder to playback!\n");
-    }
-    if (avctx->context_model > 1U) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Invalid context model %d, valid values are 0 and 1\n",
-               avctx->context_model);
-        return AVERROR(EINVAL);
-    }
-
-    if (s->ac > 1)
-        for (i = 1; i < 256; i++)
-            s->state_transition[i] = ffv1_ver2_state[i];
-
-    for (i = 0; i < 256; i++) {
-        s->quant_table_count = 2;
-        if (s->bits_per_raw_sample <= 8) {
-            s->quant_tables[0][0][i] = ffv1_quant11[i];
-            s->quant_tables[0][1][i] = ffv1_quant11[i] * 11;
-            s->quant_tables[0][2][i] = ffv1_quant11[i] * 11 * 11;
-            s->quant_tables[1][0][i] = ffv1_quant11[i];
-            s->quant_tables[1][1][i] = ffv1_quant11[i] * 11;
-            s->quant_tables[1][2][i] = ffv1_quant5[i]  * 11 * 11;
-            s->quant_tables[1][3][i] = ffv1_quant5[i]  *  5 * 11 * 11;
-            s->quant_tables[1][4][i] = ffv1_quant5[i]  *  5 *  5 * 11 * 11;
-        } else {
-            s->quant_tables[0][0][i] = ffv1_quant9_10bit[i];
-            s->quant_tables[0][1][i] = ffv1_quant9_10bit[i] * 11;
-            s->quant_tables[0][2][i] = ffv1_quant9_10bit[i] * 11 * 11;
-            s->quant_tables[1][0][i] = ffv1_quant9_10bit[i];
-            s->quant_tables[1][1][i] = ffv1_quant9_10bit[i] * 11;
-            s->quant_tables[1][2][i] = ffv1_quant5_10bit[i] * 11 * 11;
-            s->quant_tables[1][3][i] = ffv1_quant5_10bit[i] *  5 * 11 * 11;
-            s->quant_tables[1][4][i] = ffv1_quant5_10bit[i] *  5 *  5 * 11 * 11;
-        }
-    }
-    s->context_count[0] = (11 * 11 * 11        + 1) / 2;
-    s->context_count[1] = (11 * 11 * 5 * 5 * 5 + 1) / 2;
-    memcpy(s->quant_table, s->quant_tables[avctx->context_model],
-           sizeof(s->quant_table));
-
-    for (i = 0; i < s->plane_count; i++) {
-        PlaneContext *const p = &s->plane[i];
-
-        memcpy(p->quant_table, s->quant_table, sizeof(p->quant_table));
-        p->quant_table_index = avctx->context_model;
-        p->context_count     = s->context_count[p->quant_table_index];
-    }
-
-    if ((ret = ffv1_allocate_initial_states(s)) < 0)
-        return ret;
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
-    if (!s->transparency)
-        s->plane_count = 2;
-
-    av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift,
-                                     &s->chroma_v_shift);
-
-    s->picture_number = 0;
-
-    if (avctx->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2)) {
-        for (i = 0; i < s->quant_table_count; i++) {
-            s->rc_stat2[i] = av_mallocz(s->context_count[i] *
-                                        sizeof(*s->rc_stat2[i]));
-            if (!s->rc_stat2[i])
-                return AVERROR(ENOMEM);
-        }
-    }
-    if (avctx->stats_in) {
-        char *p = avctx->stats_in;
-        uint8_t best_state[256][256];
-        int gob_count = 0;
-        char *next;
-
-        av_assert0(s->version >= 2);
-
-        for (;; ) {
-            for (j = 0; j < 256; j++)
-                for (i = 0; i < 2; i++) {
-                    s->rc_stat[j][i] = strtol(p, &next, 0);
-                    if (next == p) {
-                        av_log(avctx, AV_LOG_ERROR,
-                               "2Pass file invalid at %d %d [%s]\n", j, i, p);
-                        return AVERROR_INVALIDDATA;
-                    }
-                    p = next;
-                }
-            for (i = 0; i < s->quant_table_count; i++)
-                for (j = 0; j < s->context_count[i]; j++) {
-                    for (k = 0; k < 32; k++)
-                        for (m = 0; m < 2; m++) {
-                            s->rc_stat2[i][j][k][m] = strtol(p, &next, 0);
-                            if (next == p) {
-                                av_log(avctx, AV_LOG_ERROR,
-                                       "2Pass file invalid at %d %d %d %d [%s]\n",
-                                       i, j, k, m, p);
-                                return AVERROR_INVALIDDATA;
-                            }
-                            p = next;
-                        }
-                }
-            gob_count = strtol(p, &next, 0);
-            if (next == p || gob_count <= 0) {
-                av_log(avctx, AV_LOG_ERROR, "2Pass file invalid\n");
-                return AVERROR_INVALIDDATA;
-            }
-            p = next;
-            while (*p == '\n' || *p == ' ')
-                p++;
-            if (p[0] == 0)
-                break;
-        }
-        sort_stt(s, s->state_transition);
-
-        find_best_state(best_state, s->state_transition);
-
-        for (i = 0; i < s->quant_table_count; i++) {
-            for (j = 0; j < s->context_count[i]; j++)
-                for (k = 0; k < 32; k++) {
-                    double p = 128;
-                    if (s->rc_stat2[i][j][k][0] + s->rc_stat2[i][j][k][1]) {
-                        p = 256.0 * s->rc_stat2[i][j][k][1] /
-                            (s->rc_stat2[i][j][k][0] + s->rc_stat2[i][j][k][1]);
-                    }
-                    s->initial_states[i][j][k] =
-                        best_state[av_clip(round(p), 1, 255)][av_clip((s->rc_stat2[i][j][k][0] +
-                                                                       s->rc_stat2[i][j][k][1]) /
-                                                                      gob_count, 0, 255)];
-                }
-        }
-    }
-
-    if (s->version > 1) {
-        for (s->num_v_slices = 2; s->num_v_slices < 9; s->num_v_slices++)
-            for (s->num_h_slices = s->num_v_slices;
-                 s->num_h_slices < 2 * s->num_v_slices; s->num_h_slices++)
-                if (avctx->slices == s->num_h_slices * s->num_v_slices &&
-                    avctx->slices <= 64 || !avctx->slices)
-                    goto slices_ok;
-        av_log(avctx, AV_LOG_ERROR,
-               "Unsupported number %d of slices requested, please specify a "
-               "supported number with -slices (ex:4,6,9,12,16, ...)\n",
-               avctx->slices);
-        return AVERROR(ENOSYS);
-slices_ok:
-        write_extradata(s);
-    }
-
-    if ((ret = ffv1_init_slice_contexts(s)) < 0)
-        return ret;
-    if ((ret = init_slices_state(s)) < 0)
-        return ret;
-
-#define STATS_OUT_SIZE 1024 * 1024 * 6
-    if (avctx->flags & CODEC_FLAG_PASS1) {
-        avctx->stats_out = av_mallocz(STATS_OUT_SIZE);
-        for (i = 0; i < s->quant_table_count; i++)
-            for (j = 0; j < s->slice_count; j++) {
-                FFV1Context *sf = s->slice_context[j];
-                av_assert0(!sf->rc_stat2[i]);
-                sf->rc_stat2[i] = av_mallocz(s->context_count[i] *
-                                             sizeof(*sf->rc_stat2[i]));
-                if (!sf->rc_stat2[i])
-                    return AVERROR(ENOMEM);
-            }
-    }
-
-    return 0;
-}
-
-static void encode_slice_header(FFV1Context *f, FFV1Context *fs)
-{
-    RangeCoder *c = &fs->c;
-    uint8_t state[CONTEXT_SIZE];
-    int j;
-    memset(state, 128, sizeof(state));
-
-    put_symbol(c, state, (fs->slice_x + 1) * f->num_h_slices / f->width, 0);
-    put_symbol(c, state, (fs->slice_y + 1) * f->num_v_slices / f->height, 0);
-    put_symbol(c, state, (fs->slice_width + 1) * f->num_h_slices / f->width - 1,
-               0);
-    put_symbol(c, state,
-               (fs->slice_height + 1) * f->num_v_slices / f->height - 1,
-               0);
-    for (j = 0; j < f->plane_count; j++) {
-        put_symbol(c, state, f->plane[j].quant_table_index, 0);
-        av_assert0(f->plane[j].quant_table_index == f->avctx->context_model);
-    }
-    if (!f->avctx->coded_frame->interlaced_frame)
-        put_symbol(c, state, 3, 0);
-    else
-        put_symbol(c, state, 1 + !f->avctx->coded_frame->top_field_first, 0);
-    put_symbol(c, state, f->avctx->coded_frame->sample_aspect_ratio.num, 0);
-    put_symbol(c, state, f->avctx->coded_frame->sample_aspect_ratio.den, 0);
-}
-
-static int encode_slice(AVCodecContext *c, void *arg)
-{
-    FFV1Context *fs  = *(void **)arg;
-    FFV1Context *f   = fs->avctx->priv_data;
-    int width        = fs->slice_width;
-    int height       = fs->slice_height;
-    int x            = fs->slice_x;
-    int y            = fs->slice_y;
-    const AVFrame *const p = f->frame;
-    const int ps     = (av_pix_fmt_desc_get(c->pix_fmt)->flags & AV_PIX_FMT_FLAG_PLANAR)
-                       ? (f->bits_per_raw_sample > 8) + 1
-                       : 4;
-
-    if (c->coded_frame->key_frame)
-        ffv1_clear_slice_state(f, fs);
-    if (f->version > 2) {
-        encode_slice_header(f, fs);
-    }
-    if (!fs->ac) {
-        if (f->version > 2)
-            put_rac(&fs->c, (uint8_t[]) { 129 }, 0);
-        fs->ac_byte_count = f->version > 2 || (!x && !y) ? ff_rac_terminate( &fs->c) : 0;
-        init_put_bits(&fs->pb, fs->c.bytestream_start + fs->ac_byte_count,
-                      fs->c.bytestream_end - fs->c.bytestream_start - fs->ac_byte_count);
-    }
-
-    if (f->colorspace == 0) {
-        const int chroma_width  = -((-width) >> f->chroma_h_shift);
-        const int chroma_height = -((-height) >> f->chroma_v_shift);
-        const int cx            = x >> f->chroma_h_shift;
-        const int cy            = y >> f->chroma_v_shift;
-
-        encode_plane(fs, p->data[0] + ps * x + y * p->linesize[0],
-                     width, height, p->linesize[0], 0);
-
-        if (f->chroma_planes) {
-            encode_plane(fs, p->data[1] + ps * cx + cy * p->linesize[1],
-                         chroma_width, chroma_height, p->linesize[1], 1);
-            encode_plane(fs, p->data[2] + ps * cx + cy * p->linesize[2],
-                         chroma_width, chroma_height, p->linesize[2], 1);
-        }
-        if (fs->transparency)
-            encode_plane(fs, p->data[3] + ps * x + y * p->linesize[3], width,
-                         height, p->linesize[3], 2);
-    } else {
-        uint8_t *planes[3] = { p->data[0] + ps * x + y * p->linesize[0],
-                               p->data[1] + ps * x + y * p->linesize[1],
-                               p->data[2] + ps * x + y * p->linesize[2] };
-        encode_rgb_frame(fs, planes, width, height, p->linesize);
-    }
-    emms_c();
-
-    return 0;
-}
-
-static int ffv1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *pict, int *got_packet)
-{
-    FFV1Context *f      = avctx->priv_data;
-    RangeCoder *const c = &f->slice_context[0]->c;
-    AVFrame *const p    = avctx->coded_frame;
-    int used_count      = 0;
-    uint8_t keystate    = 128;
-    uint8_t *buf_p;
-    int i, ret;
-
-    f->frame = pict;
-
-    if ((ret = ff_alloc_packet(pkt, avctx->width * avctx->height *
-                             ((8 * 2 + 1 + 1) * 4) / 8 +
-                             FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    ff_init_range_encoder(c, pkt->data, pkt->size);
-    ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8);
-
-    if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) {
-        put_rac(c, &keystate, 1);
-        p->key_frame = 1;
-        f->gob_count++;
-        write_header(f);
-    } else {
-        put_rac(c, &keystate, 0);
-        p->key_frame = 0;
-    }
-
-    if (f->ac > 1) {
-        int i;
-        for (i = 1; i < 256; i++) {
-            c->one_state[i]        = f->state_transition[i];
-            c->zero_state[256 - i] = 256 - c->one_state[i];
-        }
-    }
-
-    for (i = 1; i < f->slice_count; i++) {
-        FFV1Context *fs = f->slice_context[i];
-        uint8_t *start  = pkt->data +
-                          (pkt->size - used_count) * (int64_t)i / f->slice_count;
-        int len = pkt->size / f->slice_count;
-        ff_init_range_encoder(&fs->c, start, len);
-    }
-    avctx->execute(avctx, encode_slice, &f->slice_context[0], NULL,
-                   f->slice_count, sizeof(void *));
-
-    buf_p = pkt->data;
-    for (i = 0; i < f->slice_count; i++) {
-        FFV1Context *fs = f->slice_context[i];
-        int bytes;
-
-        if (fs->ac) {
-            uint8_t state = 129;
-            put_rac(&fs->c, &state, 0);
-            bytes = ff_rac_terminate(&fs->c);
-        } else {
-            flush_put_bits(&fs->pb); // FIXME: nicer padding
-            bytes = fs->ac_byte_count + (put_bits_count(&fs->pb) + 7) / 8;
-        }
-        if (i > 0 || f->version > 2) {
-            av_assert0(bytes < pkt->size / f->slice_count);
-            memmove(buf_p, fs->c.bytestream_start, bytes);
-            av_assert0(bytes < (1 << 24));
-            AV_WB24(buf_p + bytes, bytes);
-            bytes += 3;
-        }
-        if (f->ec) {
-            unsigned v;
-            buf_p[bytes++] = 0;
-            v = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0, buf_p, bytes);
-            AV_WL32(buf_p + bytes, v);
-            bytes += 4;
-        }
-        buf_p += bytes;
-    }
-
-    if ((avctx->flags & CODEC_FLAG_PASS1) && (f->picture_number & 31) == 0) {
-        int j, k, m;
-        char *p   = avctx->stats_out;
-        char *end = p + STATS_OUT_SIZE;
-
-        memset(f->rc_stat, 0, sizeof(f->rc_stat));
-        for (i = 0; i < f->quant_table_count; i++)
-            memset(f->rc_stat2[i], 0, f->context_count[i] * sizeof(*f->rc_stat2[i]));
-
-        for (j = 0; j < f->slice_count; j++) {
-            FFV1Context *fs = f->slice_context[j];
-            for (i = 0; i < 256; i++) {
-                f->rc_stat[i][0] += fs->rc_stat[i][0];
-                f->rc_stat[i][1] += fs->rc_stat[i][1];
-            }
-            for (i = 0; i < f->quant_table_count; i++) {
-                for (k = 0; k < f->context_count[i]; k++)
-                    for (m = 0; m < 32; m++) {
-                        f->rc_stat2[i][k][m][0] += fs->rc_stat2[i][k][m][0];
-                        f->rc_stat2[i][k][m][1] += fs->rc_stat2[i][k][m][1];
-                    }
-            }
-        }
-
-        for (j = 0; j < 256; j++) {
-            snprintf(p, end - p, "%" PRIu64 " %" PRIu64 " ",
-                     f->rc_stat[j][0], f->rc_stat[j][1]);
-            p += strlen(p);
-        }
-        snprintf(p, end - p, "\n");
-
-        for (i = 0; i < f->quant_table_count; i++) {
-            for (j = 0; j < f->context_count[i]; j++)
-                for (m = 0; m < 32; m++) {
-                    snprintf(p, end - p, "%" PRIu64 " %" PRIu64 " ",
-                             f->rc_stat2[i][j][m][0], f->rc_stat2[i][j][m][1]);
-                    p += strlen(p);
-                }
-        }
-        snprintf(p, end - p, "%d\n", f->gob_count);
-    } else if (avctx->flags & CODEC_FLAG_PASS1)
-        avctx->stats_out[0] = '\0';
-
-    f->picture_number++;
-    pkt->size   = buf_p - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY * p->key_frame;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int ffv1_encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    ffv1_close(avctx);
-    return 0;
-}
-
-#define OFFSET(x) offsetof(FFV1Context, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "slicecrc", "Protect slices with CRCs", OFFSET(ec), AV_OPT_TYPE_INT,
-             { .i64 = -1 }, -1, 1, VE },
-    { NULL }
-};
-
-static const AVClass class = {
-    .class_name = "ffv1 encoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVCodecDefault ffv1_defaults[] = {
-    { "coder", "-1" },
-    { NULL },
-};
-
-AVCodec ff_ffv1_encoder = {
-    .name           = "ffv1",
-    .long_name      = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FFV1,
-    .priv_data_size = sizeof(FFV1Context),
-    .init           = ffv1_encode_init,
-    .encode2        = ffv1_encode_frame,
-    .close          = ffv1_encode_close,
-    .capabilities   = CODEC_CAP_SLICE_THREADS,
-    .pix_fmts       = (const enum AVPixelFormat[]) {
-        AV_PIX_FMT_YUV420P,   AV_PIX_FMT_YUV422P,   AV_PIX_FMT_YUV444P,
-        AV_PIX_FMT_YUV411P,   AV_PIX_FMT_YUV410P,
-        AV_PIX_FMT_YUV444P9,  AV_PIX_FMT_YUV422P9,  AV_PIX_FMT_YUV420P9,
-        AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
-        AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
-        AV_PIX_FMT_RGB32,
-        AV_PIX_FMT_GBRP9,     AV_PIX_FMT_GBRP10,
-        AV_PIX_FMT_YUVA420P,  AV_PIX_FMT_YUVA422P,  AV_PIX_FMT_YUVA444P,
-        AV_PIX_FMT_GRAY16,    AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_NONE
-
-    },
-    .defaults       = ffv1_defaults,
-    .priv_class     = &class,
-};
diff --git a/deps/libav/libavcodec/fic.c b/deps/libav/libavcodec/fic.c
deleted file mode 100644
index df03437..0000000
--- a/deps/libav/libavcodec/fic.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Mirillis FIC decoder
- *
- * Copyright (c) 2014 Konstantin Shishkov
- * Copyright (c) 2014 Derek Buitenhuis
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "golomb.h"
-
-typedef struct FICThreadContext {
-    DECLARE_ALIGNED(16, int16_t, block)[64];
-    uint8_t *src;
-    int slice_h;
-    int src_size;
-    int y_off;
-} FICThreadContext;
-
-typedef struct FICContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    DSPContext dsp;
-    ScanTable scantable;
-
-    FICThreadContext *slice_data;
-    int slice_data_size;
-
-    const uint8_t *qmat;
-
-    enum AVPictureType cur_frame_type;
-
-    int aligned_width, aligned_height;
-    int num_slices, slice_h;
-} FICContext;
-
-static const uint8_t fic_qmat_hq[64] = {
-    1, 2, 2, 2, 3, 3, 3, 4,
-    2, 2, 2, 3, 3, 3, 4, 4,
-    2, 2, 3, 3, 3, 4, 4, 4,
-    2, 2, 3, 3, 3, 4, 4, 5,
-    2, 3, 3, 3, 4, 4, 5, 6,
-    3, 3, 3, 4, 4, 5, 6, 7,
-    3, 3, 3, 4, 4, 5, 7, 7,
-    3, 3, 4, 4, 5, 7, 7, 7,
-};
-
-static const uint8_t fic_qmat_lq[64] = {
-    1,  5,  6,  7,  8,  9,  9, 11,
-    5,  5,  7,  8,  9,  9, 11, 12,
-    6,  7,  8,  9,  9, 11, 11, 12,
-    7,  7,  8,  9,  9, 11, 12, 13,
-    7,  8,  9,  9, 10, 11, 13, 16,
-    8,  9,  9, 10, 11, 13, 16, 19,
-    8,  9,  9, 11, 12, 15, 18, 23,
-    9,  9, 11, 12, 15, 18, 23, 27
-};
-
-static const uint8_t fic_header[7] = { 0, 0, 1, 'F', 'I', 'C', 'V' };
-
-#define FIC_HEADER_SIZE 27
-
-static int fic_decode_block(FICContext *ctx, GetBitContext *gb,
-                            uint8_t *dst, int stride, int16_t *block)
-{
-    int i, num_coeff;
-
-    /* Is it a skip block? */
-    if (get_bits1(gb)) {
-        /* This is a P-frame. */
-        ctx->frame->key_frame = 0;
-        ctx->frame->pict_type = AV_PICTURE_TYPE_P;
-
-        return 0;
-    }
-
-    ctx->dsp.clear_block(block);
-
-    num_coeff = get_bits(gb, 7);
-    if (num_coeff > 64)
-        return AVERROR_INVALIDDATA;
-
-    for (i = 0; i < num_coeff; i++)
-        block[ctx->scantable.permutated[i]] = get_se_golomb(gb) * ctx->qmat[i];
-
-    ctx->dsp.idct_put(dst, stride, block);
-
-    return 0;
-}
-
-static int fic_decode_slice(AVCodecContext *avctx, void *tdata)
-{
-    FICContext *ctx        = avctx->priv_data;
-    FICThreadContext *tctx = tdata;
-    GetBitContext gb;
-    uint8_t *src = tctx->src;
-    int slice_h  = tctx->slice_h;
-    int src_size = tctx->src_size;
-    int y_off    = tctx->y_off;
-    int x, y, p;
-
-    init_get_bits(&gb, src, src_size * 8);
-
-    for (p = 0; p < 3; p++) {
-        int stride   = ctx->frame->linesize[p];
-        uint8_t* dst = ctx->frame->data[p] + (y_off >> !!p) * stride;
-
-        for (y = 0; y < (slice_h >> !!p); y += 8) {
-            for (x = 0; x < (ctx->aligned_width >> !!p); x += 8) {
-                int ret;
-
-                if ((ret = fic_decode_block(ctx, &gb, dst + x, stride, tctx->block)) != 0)
-                    return ret;
-            }
-
-            dst += 8 * stride;
-        }
-    }
-
-    return 0;
-}
-
-static int fic_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame, AVPacket *avpkt)
-{
-    FICContext *ctx = avctx->priv_data;
-    uint8_t *src = avpkt->data;
-    int ret;
-    int slice, nslices;
-    int msize;
-    int tsize;
-    uint8_t *sdata;
-
-    if ((ret = ff_reget_buffer(avctx, ctx->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    /* Header + at least one slice (4) */
-    if (avpkt->size < FIC_HEADER_SIZE + 4) {
-        av_log(avctx, AV_LOG_ERROR, "Frame data is too small.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Check for header. */
-    if (memcmp(src, fic_header, 7))
-        av_log(avctx, AV_LOG_WARNING, "Invalid FIC Header.\n");
-
-    /* Is it a skip frame? */
-    if (src[17])
-        goto skip;
-
-    nslices = src[13];
-    if (!nslices) {
-        av_log(avctx, AV_LOG_ERROR, "Zero slices found.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* High or Low Quality Matrix? */
-    ctx->qmat = src[23] ? fic_qmat_hq : fic_qmat_lq;
-
-    /* Skip cursor data. */
-    tsize = AV_RB24(src + 24);
-    if (tsize > avpkt->size - FIC_HEADER_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Slice height for all but the last slice. */
-    ctx->slice_h = 16 * (ctx->aligned_height >> 4) / nslices;
-    if (ctx->slice_h % 16)
-        ctx->slice_h = FFALIGN(ctx->slice_h - 16, 16);
-
-    /* First slice offset and remaining data. */
-    sdata = src + tsize + FIC_HEADER_SIZE + 4 * nslices;
-    msize = avpkt->size - nslices * 4 - tsize - FIC_HEADER_SIZE;
-
-    if (msize <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "Not enough frame data to decode.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /*
-     * Set the frametype to I initially. It will be set to P if the frame
-     * has any dependencies (skip blocks). There will be a race condition
-     * inside the slice decode function to set these, but we do not care.
-     * since they will only ever be set to 0/P.
-     */
-    ctx->frame->key_frame = 1;
-    ctx->frame->pict_type = AV_PICTURE_TYPE_I;
-
-    /* Allocate slice data. */
-    av_fast_malloc(&ctx->slice_data, &ctx->slice_data_size,
-                   nslices * sizeof(ctx->slice_data[0]));
-    if (!ctx->slice_data_size) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate slice data.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    for (slice = 0; slice < nslices; slice++) {
-        int slice_off = AV_RB32(src + tsize + FIC_HEADER_SIZE + slice * 4);
-        int slice_size;
-        int y_off   = ctx->slice_h * slice;
-        int slice_h = ctx->slice_h;
-
-        /*
-         * Either read the slice size, or consume all data left.
-         * Also, special case the last slight height.
-         */
-        if (slice == nslices - 1) {
-            slice_size   = msize;
-            slice_h      = FFALIGN(avctx->height - ctx->slice_h * (nslices - 1), 16);
-        } else {
-            slice_size = AV_RB32(src + tsize + FIC_HEADER_SIZE + slice * 4 + 4);
-        }
-
-        slice_size -= slice_off;
-
-        if (slice_off > msize || slice_off + slice_size > msize)
-            continue;
-
-        ctx->slice_data[slice].src      = sdata + slice_off;
-        ctx->slice_data[slice].src_size = slice_size;
-        ctx->slice_data[slice].slice_h  = slice_h;
-        ctx->slice_data[slice].y_off    = y_off;
-    }
-
-    if (ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
-                             NULL, nslices, sizeof(ctx->slice_data[0])) < 0)
-        return ret;
-
-skip:
-    *got_frame = 1;
-    if ((ret = av_frame_ref(data, ctx->frame)) < 0)
-        return ret;
-
-    return avpkt->size;
-}
-
-static av_cold int fic_decode_close(AVCodecContext *avctx)
-{
-    FICContext *ctx = avctx->priv_data;
-
-    av_freep(&ctx->slice_data);
-    av_frame_free(&ctx->frame);
-
-    return 0;
-}
-
-static av_cold int fic_decode_init(AVCodecContext *avctx)
-{
-    FICContext *ctx = avctx->priv_data;
-
-    /* Initialize various context values */
-    ctx->avctx            = avctx;
-    ctx->aligned_width    = FFALIGN(avctx->width,  16);
-    ctx->aligned_height   = FFALIGN(avctx->height, 16);
-
-    avctx->pix_fmt             = AV_PIX_FMT_YUV420P;
-    avctx->bits_per_raw_sample = 8;
-
-    ctx->frame = av_frame_alloc();
-    if (!ctx->frame)
-        return AVERROR(ENOMEM);
-
-    ff_dsputil_init(&ctx->dsp, avctx);
-
-    ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, ff_zigzag_direct);
-
-    return 0;
-}
-
-AVCodec ff_fic_decoder = {
-    .name           = "fic",
-    .long_name      = NULL_IF_CONFIG_SMALL("Mirillis FIC"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FIC,
-    .priv_data_size = sizeof(FICContext),
-    .init           = fic_decode_init,
-    .decode         = fic_decode_frame,
-    .close          = fic_decode_close,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
-};
diff --git a/deps/libav/libavcodec/file_open.c b/deps/libav/libavcodec/file_open.c
deleted file mode 100644
index 494a5d3..0000000
--- a/deps/libav/libavcodec/file_open.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "libavutil/file_open.c"
diff --git a/deps/libav/libavcodec/flac.c b/deps/libav/libavcodec/flac.c
deleted file mode 100644
index b3e3847..0000000
--- a/deps/libav/libavcodec/flac.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * FLAC common code
- * Copyright (c) 2009 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/crc.h"
-#include "libavutil/log.h"
-#include "bytestream.h"
-#include "get_bits.h"
-#include "flac.h"
-#include "flacdata.h"
-
-static const int8_t sample_size_table[] = { 0, 8, 12, 0, 16, 20, 24, 0 };
-
-static const uint64_t flac_channel_layouts[8] = {
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_QUAD,
-    AV_CH_LAYOUT_5POINT0,
-    AV_CH_LAYOUT_5POINT1,
-    AV_CH_LAYOUT_6POINT1,
-    AV_CH_LAYOUT_7POINT1
-};
-
-static int64_t get_utf8(GetBitContext *gb)
-{
-    int64_t val;
-    GET_UTF8(val, get_bits(gb, 8), return -1;)
-    return val;
-}
-
-int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
-                                FLACFrameInfo *fi, int log_level_offset)
-{
-    int bs_code, sr_code, bps_code;
-
-    /* frame sync code */
-    if ((get_bits(gb, 15) & 0x7FFF) != 0x7FFC) {
-        av_log(avctx, AV_LOG_ERROR + log_level_offset, "invalid sync code\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* variable block size stream code */
-    fi->is_var_size = get_bits1(gb);
-
-    /* block size and sample rate codes */
-    bs_code = get_bits(gb, 4);
-    sr_code = get_bits(gb, 4);
-
-    /* channels and decorrelation */
-    fi->ch_mode = get_bits(gb, 4);
-    if (fi->ch_mode < FLAC_MAX_CHANNELS) {
-        fi->channels = fi->ch_mode + 1;
-        fi->ch_mode = FLAC_CHMODE_INDEPENDENT;
-    } else if (fi->ch_mode < FLAC_MAX_CHANNELS + FLAC_CHMODE_MID_SIDE) {
-        fi->channels = 2;
-        fi->ch_mode -= FLAC_MAX_CHANNELS - 1;
-    } else {
-        av_log(avctx, AV_LOG_ERROR + log_level_offset,
-               "invalid channel mode: %d\n", fi->ch_mode);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* bits per sample */
-    bps_code = get_bits(gb, 3);
-    if (bps_code == 3 || bps_code == 7) {
-        av_log(avctx, AV_LOG_ERROR + log_level_offset,
-               "invalid sample size code (%d)\n",
-               bps_code);
-        return AVERROR_INVALIDDATA;
-    }
-    fi->bps = sample_size_table[bps_code];
-
-    /* reserved bit */
-    if (get_bits1(gb)) {
-        av_log(avctx, AV_LOG_ERROR + log_level_offset,
-               "broken stream, invalid padding\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* sample or frame count */
-    fi->frame_or_sample_num = get_utf8(gb);
-    if (fi->frame_or_sample_num < 0) {
-        av_log(avctx, AV_LOG_ERROR + log_level_offset,
-               "sample/frame number invalid; utf8 fscked\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* blocksize */
-    if (bs_code == 0) {
-        av_log(avctx, AV_LOG_ERROR + log_level_offset,
-               "reserved blocksize code: 0\n");
-        return AVERROR_INVALIDDATA;
-    } else if (bs_code == 6) {
-        fi->blocksize = get_bits(gb, 8) + 1;
-    } else if (bs_code == 7) {
-        fi->blocksize = get_bits(gb, 16) + 1;
-    } else {
-        fi->blocksize = ff_flac_blocksize_table[bs_code];
-    }
-
-    /* sample rate */
-    if (sr_code < 12) {
-        fi->samplerate = ff_flac_sample_rate_table[sr_code];
-    } else if (sr_code == 12) {
-        fi->samplerate = get_bits(gb, 8) * 1000;
-    } else if (sr_code == 13) {
-        fi->samplerate = get_bits(gb, 16);
-    } else if (sr_code == 14) {
-        fi->samplerate = get_bits(gb, 16) * 10;
-    } else {
-        av_log(avctx, AV_LOG_ERROR + log_level_offset,
-               "illegal sample rate code %d\n",
-               sr_code);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* header CRC-8 check */
-    skip_bits(gb, 8);
-    if (av_crc(av_crc_get_table(AV_CRC_8_ATM), 0, gb->buffer,
-               get_bits_count(gb)/8)) {
-        av_log(avctx, AV_LOG_ERROR + log_level_offset,
-               "header crc mismatch\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-int ff_flac_get_max_frame_size(int blocksize, int ch, int bps)
-{
-    /* Technically, there is no limit to FLAC frame size, but an encoder
-       should not write a frame that is larger than if verbatim encoding mode
-       were to be used. */
-
-    int count;
-
-    count = 16;                  /* frame header */
-    count += ch * ((7+bps+7)/8); /* subframe headers */
-    if (ch == 2) {
-        /* for stereo, need to account for using decorrelation */
-        count += (( 2*bps+1) * blocksize + 7) / 8;
-    } else {
-        count += ( ch*bps    * blocksize + 7) / 8;
-    }
-    count += 2; /* frame footer */
-
-    return count;
-}
-
-int avpriv_flac_is_extradata_valid(AVCodecContext *avctx,
-                               enum FLACExtradataFormat *format,
-                               uint8_t **streaminfo_start)
-{
-    if (!avctx->extradata || avctx->extradata_size < FLAC_STREAMINFO_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "extradata NULL or too small.\n");
-        return 0;
-    }
-    if (AV_RL32(avctx->extradata) != MKTAG('f','L','a','C')) {
-        /* extradata contains STREAMINFO only */
-        if (avctx->extradata_size != FLAC_STREAMINFO_SIZE) {
-            av_log(avctx, AV_LOG_WARNING, "extradata contains %d bytes too many.\n",
-                   FLAC_STREAMINFO_SIZE-avctx->extradata_size);
-        }
-        *format = FLAC_EXTRADATA_FORMAT_STREAMINFO;
-        *streaminfo_start = avctx->extradata;
-    } else {
-        if (avctx->extradata_size < 8+FLAC_STREAMINFO_SIZE) {
-            av_log(avctx, AV_LOG_ERROR, "extradata too small.\n");
-            return 0;
-        }
-        *format = FLAC_EXTRADATA_FORMAT_FULL_HEADER;
-        *streaminfo_start = &avctx->extradata[8];
-    }
-    return 1;
-}
-
-void ff_flac_set_channel_layout(AVCodecContext *avctx)
-{
-    if (avctx->channels <= FF_ARRAY_ELEMS(flac_channel_layouts))
-        avctx->channel_layout = flac_channel_layouts[avctx->channels - 1];
-    else
-        avctx->channel_layout = 0;
-}
-
-void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
-                              const uint8_t *buffer)
-{
-    GetBitContext gb;
-    init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8);
-
-    skip_bits(&gb, 16); /* skip min blocksize */
-    s->max_blocksize = get_bits(&gb, 16);
-    if (s->max_blocksize < FLAC_MIN_BLOCKSIZE) {
-        av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\n",
-               s->max_blocksize);
-        s->max_blocksize = 16;
-    }
-
-    skip_bits(&gb, 24); /* skip min frame size */
-    s->max_framesize = get_bits_long(&gb, 24);
-
-    s->samplerate = get_bits_long(&gb, 20);
-    s->channels = get_bits(&gb, 3) + 1;
-    s->bps = get_bits(&gb, 5) + 1;
-
-    avctx->channels = s->channels;
-    avctx->sample_rate = s->samplerate;
-    avctx->bits_per_raw_sample = s->bps;
-    ff_flac_set_channel_layout(avctx);
-
-    s->samples  = get_bits_long(&gb, 32) << 4;
-    s->samples |= get_bits(&gb, 4);
-
-    skip_bits_long(&gb, 64); /* md5 sum */
-    skip_bits_long(&gb, 64); /* md5 sum */
-}
-
-void avpriv_flac_parse_block_header(const uint8_t *block_header,
-                                int *last, int *type, int *size)
-{
-    int tmp = bytestream_get_byte(&block_header);
-    if (last)
-        *last = tmp & 0x80;
-    if (type)
-        *type = tmp & 0x7F;
-    if (size)
-        *size = bytestream_get_be24(&block_header);
-}
diff --git a/deps/libav/libavcodec/flac.h b/deps/libav/libavcodec/flac.h
deleted file mode 100644
index 63f41c2..0000000
--- a/deps/libav/libavcodec/flac.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * FLAC (Free Lossless Audio Codec) decoder/demuxer common functions
- * Copyright (c) 2008 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FLAC (Free Lossless Audio Codec) decoder/demuxer common functions
- */
-
-#ifndef AVCODEC_FLAC_H
-#define AVCODEC_FLAC_H
-
-#include "avcodec.h"
-#include "get_bits.h"
-
-#define FLAC_STREAMINFO_SIZE   34
-#define FLAC_MAX_CHANNELS       8
-#define FLAC_MIN_BLOCKSIZE     16
-#define FLAC_MAX_BLOCKSIZE  65535
-#define FLAC_MIN_FRAME_SIZE    11
-
-enum {
-    FLAC_CHMODE_INDEPENDENT = 0,
-    FLAC_CHMODE_LEFT_SIDE   = 1,
-    FLAC_CHMODE_RIGHT_SIDE  = 2,
-    FLAC_CHMODE_MID_SIDE    = 3,
-};
-
-enum {
-    FLAC_METADATA_TYPE_STREAMINFO = 0,
-    FLAC_METADATA_TYPE_PADDING,
-    FLAC_METADATA_TYPE_APPLICATION,
-    FLAC_METADATA_TYPE_SEEKTABLE,
-    FLAC_METADATA_TYPE_VORBIS_COMMENT,
-    FLAC_METADATA_TYPE_CUESHEET,
-    FLAC_METADATA_TYPE_PICTURE,
-    FLAC_METADATA_TYPE_INVALID = 127
-};
-
-enum FLACExtradataFormat {
-    FLAC_EXTRADATA_FORMAT_STREAMINFO  = 0,
-    FLAC_EXTRADATA_FORMAT_FULL_HEADER = 1
-};
-
-#define FLACCOMMONINFO \
-    int samplerate;         /**< sample rate                             */\
-    int channels;           /**< number of channels                      */\
-    int bps;                /**< bits-per-sample                         */\
-
-/**
- * Data needed from the Streaminfo header for use by the raw FLAC demuxer
- * and/or the FLAC decoder.
- */
-#define FLACSTREAMINFO \
-    FLACCOMMONINFO \
-    int max_blocksize;      /**< maximum block size, in samples          */\
-    int max_framesize;      /**< maximum frame size, in bytes            */\
-    int64_t samples;        /**< total number of samples                 */\
-
-typedef struct FLACStreaminfo {
-    FLACSTREAMINFO
-} FLACStreaminfo;
-
-typedef struct FLACFrameInfo {
-    FLACCOMMONINFO
-    int blocksize;          /**< block size of the frame                 */
-    int ch_mode;            /**< channel decorrelation mode              */
-    int64_t frame_or_sample_num;    /**< frame number or sample number   */
-    int is_var_size;                /**< specifies if the stream uses variable
-                                         block sizes or a fixed block size;
-                                         also determines the meaning of
-                                         frame_or_sample_num             */
-} FLACFrameInfo;
-
-/**
- * Parse the Streaminfo metadata block
- * @param[out] avctx   codec context to set basic stream parameters
- * @param[out] s       where parsed information is stored
- * @param[in]  buffer  pointer to start of 34-byte streaminfo data
- */
-void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
-                                  const uint8_t *buffer);
-
-/**
- * Validate the FLAC extradata.
- * @param[in]  avctx codec context containing the extradata.
- * @param[out] format extradata format.
- * @param[out] streaminfo_start pointer to start of 34-byte STREAMINFO data.
- * @return 1 if valid, 0 if not valid.
- */
-int avpriv_flac_is_extradata_valid(AVCodecContext *avctx,
-                                   enum FLACExtradataFormat *format,
-                                   uint8_t **streaminfo_start);
-
-/**
- * Parse the metadata block parameters from the header.
- * @param[in]  block_header header data, at least 4 bytes
- * @param[out] last indicator for last metadata block
- * @param[out] type metadata block type
- * @param[out] size metadata block size
- */
-void avpriv_flac_parse_block_header(const uint8_t *block_header,
-                                    int *last, int *type, int *size);
-
-/**
- * Calculate an estimate for the maximum frame size based on verbatim mode.
- * @param blocksize block size, in samples
- * @param ch number of channels
- * @param bps bits-per-sample
- */
-int ff_flac_get_max_frame_size(int blocksize, int ch, int bps);
-
-/**
- * Validate and decode a frame header.
- * @param      avctx AVCodecContext to use as av_log() context
- * @param      gb    GetBitContext from which to read frame header
- * @param[out] fi    frame information
- * @param      log_level_offset  log level offset. can be used to silence error messages.
- * @return non-zero on error, 0 if ok
- */
-int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
-                                FLACFrameInfo *fi, int log_level_offset);
-
-void ff_flac_set_channel_layout(AVCodecContext *avctx);
-
-#endif /* AVCODEC_FLAC_H */
diff --git a/deps/libav/libavcodec/flac_parser.c b/deps/libav/libavcodec/flac_parser.c
deleted file mode 100644
index bf2c118..0000000
--- a/deps/libav/libavcodec/flac_parser.c
+++ /dev/null
@@ -1,688 +0,0 @@
-/*
- * FLAC parser
- * Copyright (c) 2010 Michael Chinen
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FLAC parser
- *
- * The FLAC parser buffers input until FLAC_MIN_HEADERS has been found.
- * Each time it finds and verifies a CRC-8 header it sees which of the
- * FLAC_MAX_SEQUENTIAL_HEADERS that came before it have a valid CRC-16 footer
- * that ends at the newly found header.
- * Headers are scored by FLAC_HEADER_BASE_SCORE plus the max of its crc-verified
- * children, penalized by changes in sample rate, frame number, etc.
- * The parser returns the frame with the highest score.
- **/
-
-#include "libavutil/attributes.h"
-#include "libavutil/crc.h"
-#include "libavutil/fifo.h"
-#include "bytestream.h"
-#include "parser.h"
-#include "flac.h"
-
-/** maximum number of adjacent headers that compare CRCs against each other   */
-#define FLAC_MAX_SEQUENTIAL_HEADERS 3
-/** minimum number of headers buffered and checked before returning frames    */
-#define FLAC_MIN_HEADERS 10
-/** estimate for average size of a FLAC frame                                 */
-#define FLAC_AVG_FRAME_SIZE 8192
-
-/** scoring settings for score_header */
-#define FLAC_HEADER_BASE_SCORE        10
-#define FLAC_HEADER_CHANGED_PENALTY   7
-#define FLAC_HEADER_CRC_FAIL_PENALTY  50
-#define FLAC_HEADER_NOT_PENALIZED_YET 100000
-#define FLAC_HEADER_NOT_SCORED_YET    -100000
-
-/** largest possible size of flac header */
-#define MAX_FRAME_HEADER_SIZE 16
-
-typedef struct FLACHeaderMarker {
-    int offset;       /**< byte offset from start of FLACParseContext->buffer */
-    int *link_penalty;  /**< pointer to array of local scores between this header
-                           and the one at a distance equal array position     */
-    int max_score;    /**< maximum score found after checking each child that
-                           has a valid CRC                                    */
-    FLACFrameInfo fi; /**< decoded frame header info                          */
-    struct FLACHeaderMarker *next;       /**< next CRC-8 verified header that
-                                              immediately follows this one in
-                                              the bytestream                  */
-    struct FLACHeaderMarker *best_child; /**< following frame header with
-                                              which this frame has the best
-                                              score with                      */
-} FLACHeaderMarker;
-
-typedef struct FLACParseContext {
-    AVCodecParserContext *pc;      /**< parent context                        */
-    AVCodecContext *avctx;         /**< codec context pointer for logging     */
-    FLACHeaderMarker *headers;     /**< linked-list that starts at the first
-                                        CRC-8 verified header within buffer   */
-    FLACHeaderMarker *best_header; /**< highest scoring header within buffer  */
-    int nb_headers_found;          /**< number of headers found in the last
-                                        flac_parse() call                     */
-    int nb_headers_buffered;       /**< number of headers that are buffered   */
-    int best_header_valid;         /**< flag set when the parser returns junk;
-                                        if set return best_header next time   */
-    AVFifoBuffer *fifo_buf;        /**< buffer to store all data until headers
-                                        can be verified                       */
-    int end_padded;                /**< specifies if fifo_buf's end is padded */
-    uint8_t *wrap_buf;             /**< general fifo read buffer when wrapped */
-    int wrap_buf_allocated_size;   /**< actual allocated size of the buffer   */
-} FLACParseContext;
-
-static int frame_header_is_valid(AVCodecContext *avctx, const uint8_t *buf,
-                                 FLACFrameInfo *fi)
-{
-    GetBitContext gb;
-    init_get_bits(&gb, buf, MAX_FRAME_HEADER_SIZE * 8);
-    return !ff_flac_decode_frame_header(avctx, &gb, fi, 127);
-}
-
-/**
- * Non-destructive fast fifo pointer fetching
- * Returns a pointer from the specified offset.
- * If possible the pointer points within the fifo buffer.
- * Otherwise (if it would cause a wrap around,) a pointer to a user-specified
- * buffer is used.
- * The pointer can be NULL.  In any case it will be reallocated to hold the size.
- * If the returned pointer will be used after subsequent calls to flac_fifo_read_wrap
- * then the subsequent calls should pass in a different wrap_buf so as to not
- * overwrite the contents of the previous wrap_buf.
- * This function is based on av_fifo_generic_read, which is why there is a comment
- * about a memory barrier for SMP.
- */
-static uint8_t* flac_fifo_read_wrap(FLACParseContext *fpc, int offset, int len,
-                               uint8_t** wrap_buf, int* allocated_size)
-{
-    AVFifoBuffer *f   = fpc->fifo_buf;
-    uint8_t *start    = f->rptr + offset;
-    uint8_t *tmp_buf;
-
-    if (start >= f->end)
-        start -= f->end - f->buffer;
-    if (f->end - start >= len)
-        return start;
-
-    tmp_buf = av_fast_realloc(*wrap_buf, allocated_size, len);
-
-    if (!tmp_buf) {
-        av_log(fpc->avctx, AV_LOG_ERROR,
-               "couldn't reallocate wrap buffer of size %d", len);
-        return NULL;
-    }
-    *wrap_buf = tmp_buf;
-    do {
-        int seg_len = FFMIN(f->end - start, len);
-        memcpy(tmp_buf, start, seg_len);
-        tmp_buf = (uint8_t*)tmp_buf + seg_len;
-// memory barrier needed for SMP here in theory
-
-        start += seg_len - (f->end - f->buffer);
-        len -= seg_len;
-    } while (len > 0);
-
-    return *wrap_buf;
-}
-
-/**
- * Return a pointer in the fifo buffer where the offset starts at until
- * the wrap point or end of request.
- * len will contain the valid length of the returned buffer.
- * A second call to flac_fifo_read (with new offset and len) should be called
- * to get the post-wrap buf if the returned len is less than the requested.
- **/
-static uint8_t* flac_fifo_read(FLACParseContext *fpc, int offset, int *len)
-{
-    AVFifoBuffer *f   = fpc->fifo_buf;
-    uint8_t *start    = f->rptr + offset;
-
-    if (start >= f->end)
-        start -= f->end - f->buffer;
-    *len = FFMIN(*len, f->end - start);
-    return start;
-}
-
-static int find_headers_search_validate(FLACParseContext *fpc, int offset)
-{
-    FLACFrameInfo fi;
-    uint8_t *header_buf;
-    int size = 0;
-    header_buf = flac_fifo_read_wrap(fpc, offset,
-                                     MAX_FRAME_HEADER_SIZE,
-                                     &fpc->wrap_buf,
-                                     &fpc->wrap_buf_allocated_size);
-    if (frame_header_is_valid(fpc->avctx, header_buf, &fi)) {
-        FLACHeaderMarker **end_handle = &fpc->headers;
-        int i;
-
-        size = 0;
-        while (*end_handle) {
-            end_handle = &(*end_handle)->next;
-            size++;
-        }
-
-        *end_handle = av_mallocz(sizeof(FLACHeaderMarker));
-        if (!*end_handle) {
-            av_log(fpc->avctx, AV_LOG_ERROR,
-                   "couldn't allocate FLACHeaderMarker\n");
-            return AVERROR(ENOMEM);
-        }
-        (*end_handle)->fi           = fi;
-        (*end_handle)->offset       = offset;
-        (*end_handle)->link_penalty = av_malloc(sizeof(int) *
-                                            FLAC_MAX_SEQUENTIAL_HEADERS);
-        for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS; i++)
-            (*end_handle)->link_penalty[i] = FLAC_HEADER_NOT_PENALIZED_YET;
-
-        fpc->nb_headers_found++;
-        size++;
-    }
-    return size;
-}
-
-static int find_headers_search(FLACParseContext *fpc, uint8_t *buf, int buf_size,
-                               int search_start)
-
-{
-    int size = 0, mod_offset = (buf_size - 1) % 4, i, j;
-    uint32_t x;
-
-    for (i = 0; i < mod_offset; i++) {
-        if ((AV_RB16(buf + i) & 0xFFFE) == 0xFFF8)
-            size = find_headers_search_validate(fpc, search_start + i);
-    }
-
-    for (; i < buf_size - 1; i += 4) {
-        x = AV_RB32(buf + i);
-        if (((x & ~(x + 0x01010101)) & 0x80808080)) {
-            for (j = 0; j < 4; j++) {
-                if ((AV_RB16(buf + i + j) & 0xFFFE) == 0xFFF8)
-                    size = find_headers_search_validate(fpc, search_start + i + j);
-            }
-        }
-    }
-    return size;
-}
-
-static int find_new_headers(FLACParseContext *fpc, int search_start)
-{
-    FLACHeaderMarker *end;
-    int search_end, size = 0, read_len, temp;
-    uint8_t *buf;
-    fpc->nb_headers_found = 0;
-
-    /* Search for a new header of at most 16 bytes. */
-    search_end = av_fifo_size(fpc->fifo_buf) - (MAX_FRAME_HEADER_SIZE - 1);
-    read_len   = search_end - search_start + 1;
-    buf        = flac_fifo_read(fpc, search_start, &read_len);
-    size       = find_headers_search(fpc, buf, read_len, search_start);
-    search_start += read_len - 1;
-
-    /* If fifo end was hit do the wrap around. */
-    if (search_start != search_end) {
-        uint8_t wrap[2];
-
-        wrap[0]  = buf[read_len - 1];
-        read_len = search_end - search_start + 1;
-
-        /* search_start + 1 is the post-wrap offset in the fifo. */
-        buf      = flac_fifo_read(fpc, search_start + 1, &read_len);
-        wrap[1]  = buf[0];
-
-        if ((AV_RB16(wrap) & 0xFFFE) == 0xFFF8) {
-            temp = find_headers_search_validate(fpc, search_start);
-            size = FFMAX(size, temp);
-        }
-        search_start++;
-
-        /* Continue to do the last half of the wrap. */
-        temp     = find_headers_search(fpc, buf, read_len, search_start);
-        size     = FFMAX(size, temp);
-        search_start += read_len - 1;
-    }
-
-    /* Return the size even if no new headers were found. */
-    if (!size && fpc->headers)
-        for (end = fpc->headers; end; end = end->next)
-            size++;
-    return size;
-}
-
-static int check_header_mismatch(FLACParseContext  *fpc,
-                                 FLACHeaderMarker  *header,
-                                 FLACHeaderMarker  *child,
-                                 int                log_level_offset)
-{
-    FLACFrameInfo  *header_fi = &header->fi, *child_fi = &child->fi;
-    int deduction = 0, deduction_expected = 0, i;
-    if (child_fi->samplerate != header_fi->samplerate) {
-        deduction += FLAC_HEADER_CHANGED_PENALTY;
-        av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset,
-               "sample rate change detected in adjacent frames\n");
-    }
-    if (child_fi->bps != header_fi->bps) {
-        deduction += FLAC_HEADER_CHANGED_PENALTY;
-        av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset,
-               "bits per sample change detected in adjacent frames\n");
-    }
-    if (child_fi->is_var_size != header_fi->is_var_size) {
-        /* Changing blocking strategy not allowed per the spec */
-        deduction += FLAC_HEADER_BASE_SCORE;
-        av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset,
-                   "blocking strategy change detected in adjacent frames\n");
-    }
-    if (child_fi->channels != header_fi->channels) {
-        deduction += FLAC_HEADER_CHANGED_PENALTY;
-        av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset,
-                   "number of channels change detected in adjacent frames\n");
-    }
-    /* Check sample and frame numbers. */
-    if ((child_fi->frame_or_sample_num - header_fi->frame_or_sample_num
-         != header_fi->blocksize) &&
-        (child_fi->frame_or_sample_num
-         != header_fi->frame_or_sample_num + 1)) {
-        FLACHeaderMarker *curr;
-        int expected_frame_num, expected_sample_num;
-        /* If there are frames in the middle we expect this deduction,
-           as they are probably valid and this one follows it */
-
-        expected_frame_num = expected_sample_num = header_fi->frame_or_sample_num;
-        curr = header;
-        while (curr != child) {
-            /* Ignore frames that failed all crc checks */
-            for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS; i++) {
-                if (curr->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY) {
-                    expected_frame_num++;
-                    expected_sample_num += curr->fi.blocksize;
-                    break;
-                }
-            }
-            curr = curr->next;
-        }
-
-        if (expected_frame_num  == child_fi->frame_or_sample_num ||
-            expected_sample_num == child_fi->frame_or_sample_num)
-            deduction_expected = deduction ? 0 : 1;
-
-        deduction += FLAC_HEADER_CHANGED_PENALTY;
-        av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset,
-                   "sample/frame number mismatch in adjacent frames\n");
-    }
-
-    /* If we have suspicious headers, check the CRC between them */
-    if (deduction && !deduction_expected) {
-        FLACHeaderMarker *curr;
-        int read_len;
-        uint8_t *buf;
-        uint32_t crc = 1;
-        int inverted_test = 0;
-
-        /* Since CRC is expensive only do it if we haven't yet.
-           This assumes a CRC penalty is greater than all other check penalties */
-        curr = header->next;
-        for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS && curr != child; i++)
-            curr = curr->next;
-
-        if (header->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY ||
-            header->link_penalty[i] == FLAC_HEADER_NOT_PENALIZED_YET) {
-            FLACHeaderMarker *start, *end;
-
-            /* Although overlapping chains are scored, the crc should never
-               have to be computed twice for a single byte. */
-            start = header;
-            end   = child;
-            if (i > 0 &&
-                header->link_penalty[i - 1] >= FLAC_HEADER_CRC_FAIL_PENALTY) {
-                while (start->next != child)
-                    start = start->next;
-                inverted_test = 1;
-            } else if (i > 0 &&
-                       header->next->link_penalty[i-1] >=
-                       FLAC_HEADER_CRC_FAIL_PENALTY ) {
-                end = header->next;
-                inverted_test = 1;
-            }
-
-            read_len = end->offset - start->offset;
-            buf      = flac_fifo_read(fpc, start->offset, &read_len);
-            crc      = av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf, read_len);
-            read_len = (end->offset - start->offset) - read_len;
-
-            if (read_len) {
-                buf = flac_fifo_read(fpc, end->offset - read_len, &read_len);
-                crc = av_crc(av_crc_get_table(AV_CRC_16_ANSI), crc, buf, read_len);
-            }
-        }
-
-        if (!crc ^ !inverted_test) {
-            deduction += FLAC_HEADER_CRC_FAIL_PENALTY;
-            av_log(fpc->avctx, AV_LOG_WARNING + log_level_offset,
-                   "crc check failed from offset %i (frame %"PRId64") to %i (frame %"PRId64")\n",
-                   header->offset, header_fi->frame_or_sample_num,
-                   child->offset, child_fi->frame_or_sample_num);
-        }
-    }
-    return deduction;
-}
-
-/**
- * Score a header.
- *
- * Give FLAC_HEADER_BASE_SCORE points to a frame for existing.
- * If it has children, (subsequent frames of which the preceding CRC footer
- * validates against this one,) then take the maximum score of the children,
- * with a penalty of FLAC_HEADER_CHANGED_PENALTY applied for each change to
- * bps, sample rate, channels, but not decorrelation mode, or blocksize,
- * because it can change often.
- **/
-static int score_header(FLACParseContext *fpc, FLACHeaderMarker *header)
-{
-    FLACHeaderMarker *child;
-    int dist = 0;
-    int child_score;
-
-    if (header->max_score != FLAC_HEADER_NOT_SCORED_YET)
-        return header->max_score;
-
-    header->max_score = FLAC_HEADER_BASE_SCORE;
-
-    /* Check and compute the children's scores. */
-    child = header->next;
-    for (dist = 0; dist < FLAC_MAX_SEQUENTIAL_HEADERS && child; dist++) {
-        /* Look at the child's frame header info and penalize suspicious
-           changes between the headers. */
-        if (header->link_penalty[dist] == FLAC_HEADER_NOT_PENALIZED_YET) {
-            header->link_penalty[dist] = check_header_mismatch(fpc, header,
-                                                               child, AV_LOG_DEBUG);
-        }
-        child_score = score_header(fpc, child) - header->link_penalty[dist];
-
-        if (FLAC_HEADER_BASE_SCORE + child_score > header->max_score) {
-            /* Keep the child because the frame scoring is dynamic. */
-            header->best_child = child;
-            header->max_score  = FLAC_HEADER_BASE_SCORE + child_score;
-        }
-        child = child->next;
-    }
-
-    return header->max_score;
-}
-
-static void score_sequences(FLACParseContext *fpc)
-{
-    FLACHeaderMarker *curr;
-    int best_score = FLAC_HEADER_NOT_SCORED_YET;
-    /* First pass to clear all old scores. */
-    for (curr = fpc->headers; curr; curr = curr->next)
-        curr->max_score = FLAC_HEADER_NOT_SCORED_YET;
-
-    /* Do a second pass to score them all. */
-    for (curr = fpc->headers; curr; curr = curr->next) {
-        if (score_header(fpc, curr) > best_score) {
-            fpc->best_header = curr;
-            best_score       = curr->max_score;
-        }
-    }
-}
-
-static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf,
-                           int *poutbuf_size)
-{
-    FLACHeaderMarker *header = fpc->best_header;
-    FLACHeaderMarker *child  = header->best_child;
-    if (!child) {
-        *poutbuf_size = av_fifo_size(fpc->fifo_buf) - header->offset;
-    } else {
-        *poutbuf_size = child->offset - header->offset;
-
-        /* If the child has suspicious changes, log them */
-        check_header_mismatch(fpc, header, child, 0);
-    }
-
-    if (header->fi.channels != fpc->avctx->channels ||
-        !fpc->avctx->channel_layout) {
-        fpc->avctx->channels = header->fi.channels;
-        ff_flac_set_channel_layout(fpc->avctx);
-    }
-    fpc->avctx->sample_rate = header->fi.samplerate;
-    fpc->pc->duration       = header->fi.blocksize;
-    *poutbuf = flac_fifo_read_wrap(fpc, header->offset, *poutbuf_size,
-                                        &fpc->wrap_buf,
-                                        &fpc->wrap_buf_allocated_size);
-
-    fpc->best_header_valid = 0;
-    /* Return the negative overread index so the client can compute pos.
-       This should be the amount overread to the beginning of the child */
-    if (child)
-        return child->offset - av_fifo_size(fpc->fifo_buf);
-    return 0;
-}
-
-static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
-                      const uint8_t **poutbuf, int *poutbuf_size,
-                      const uint8_t *buf, int buf_size)
-{
-    FLACParseContext *fpc = s->priv_data;
-    FLACHeaderMarker *curr;
-    int nb_headers;
-    const uint8_t *read_end   = buf;
-    const uint8_t *read_start = buf;
-
-    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
-        FLACFrameInfo fi;
-        if (frame_header_is_valid(avctx, buf, &fi))
-            s->duration = fi.blocksize;
-        *poutbuf      = buf;
-        *poutbuf_size = buf_size;
-        return buf_size;
-    }
-
-    fpc->avctx = avctx;
-    if (fpc->best_header_valid)
-        return get_best_header(fpc, poutbuf, poutbuf_size);
-
-    /* If a best_header was found last call remove it with the buffer data. */
-    if (fpc->best_header && fpc->best_header->best_child) {
-        FLACHeaderMarker *temp;
-        FLACHeaderMarker *best_child = fpc->best_header->best_child;
-
-        /* Remove headers in list until the end of the best_header. */
-        for (curr = fpc->headers; curr != best_child; curr = temp) {
-            if (curr != fpc->best_header) {
-                av_log(avctx, AV_LOG_DEBUG,
-                       "dropping low score %i frame header from offset %i to %i\n",
-                       curr->max_score, curr->offset, curr->next->offset);
-            }
-            temp = curr->next;
-            av_freep(&curr->link_penalty);
-            av_free(curr);
-            fpc->nb_headers_buffered--;
-        }
-        /* Release returned data from ring buffer. */
-        av_fifo_drain(fpc->fifo_buf, best_child->offset);
-
-        /* Fix the offset for the headers remaining to match the new buffer. */
-        for (curr = best_child->next; curr; curr = curr->next)
-            curr->offset -= best_child->offset;
-
-        fpc->nb_headers_buffered--;
-        best_child->offset = 0;
-        fpc->headers       = best_child;
-        if (fpc->nb_headers_buffered >= FLAC_MIN_HEADERS) {
-            fpc->best_header = best_child;
-            return get_best_header(fpc, poutbuf, poutbuf_size);
-        }
-        fpc->best_header   = NULL;
-    } else if (fpc->best_header) {
-        /* No end frame no need to delete the buffer; probably eof */
-        FLACHeaderMarker *temp;
-
-        for (curr = fpc->headers; curr != fpc->best_header; curr = temp) {
-            temp = curr->next;
-            av_freep(&curr->link_penalty);
-            av_free(curr);
-        }
-        fpc->headers = fpc->best_header->next;
-        av_freep(&fpc->best_header->link_penalty);
-        av_freep(&fpc->best_header);
-    }
-
-    /* Find and score new headers. */
-    while ((buf && read_end < buf + buf_size &&
-            fpc->nb_headers_buffered < FLAC_MIN_HEADERS)
-           || (!buf && !fpc->end_padded)) {
-        int start_offset;
-
-        /* Pad the end once if EOF, to check the final region for headers. */
-        if (!buf) {
-            fpc->end_padded      = 1;
-            buf_size = MAX_FRAME_HEADER_SIZE;
-            read_end = read_start + MAX_FRAME_HEADER_SIZE;
-        } else {
-            /* The maximum read size is the upper-bound of what the parser
-               needs to have the required number of frames buffered */
-            int nb_desired = FLAC_MIN_HEADERS - fpc->nb_headers_buffered + 1;
-            read_end       = read_end + FFMIN(buf + buf_size - read_end,
-                                              nb_desired * FLAC_AVG_FRAME_SIZE);
-        }
-
-        /* Fill the buffer. */
-        if (av_fifo_realloc2(fpc->fifo_buf,
-                             (read_end - read_start) + av_fifo_size(fpc->fifo_buf)) < 0) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "couldn't reallocate buffer of size %td\n",
-                   (read_end - read_start) + av_fifo_size(fpc->fifo_buf));
-            goto handle_error;
-        }
-
-        if (buf) {
-            av_fifo_generic_write(fpc->fifo_buf, (void*) read_start,
-                                  read_end - read_start, NULL);
-        } else {
-            int8_t pad[MAX_FRAME_HEADER_SIZE] = { 0 };
-            av_fifo_generic_write(fpc->fifo_buf, (void*) pad, sizeof(pad), NULL);
-        }
-
-        /* Tag headers and update sequences. */
-        start_offset = av_fifo_size(fpc->fifo_buf) -
-                       ((read_end - read_start) + (MAX_FRAME_HEADER_SIZE - 1));
-        start_offset = FFMAX(0, start_offset);
-        nb_headers   = find_new_headers(fpc, start_offset);
-
-        if (nb_headers < 0) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "find_new_headers couldn't allocate FLAC header\n");
-            goto handle_error;
-        }
-
-        fpc->nb_headers_buffered = nb_headers;
-        /* Wait till FLAC_MIN_HEADERS to output a valid frame. */
-        if (!fpc->end_padded && fpc->nb_headers_buffered < FLAC_MIN_HEADERS) {
-            if (buf && read_end < buf + buf_size) {
-                read_start = read_end;
-                continue;
-            } else {
-                goto handle_error;
-            }
-        }
-
-        /* If headers found, update the scores since we have longer chains. */
-        if (fpc->end_padded || fpc->nb_headers_found)
-            score_sequences(fpc);
-
-        /* restore the state pre-padding */
-        if (fpc->end_padded) {
-            /* HACK: drain the tail of the fifo */
-            fpc->fifo_buf->wptr -= MAX_FRAME_HEADER_SIZE;
-            fpc->fifo_buf->wndx -= MAX_FRAME_HEADER_SIZE;
-            if (fpc->fifo_buf->wptr < 0) {
-                fpc->fifo_buf->wptr += fpc->fifo_buf->end -
-                    fpc->fifo_buf->buffer;
-            }
-            buf_size = 0;
-            read_start = read_end = NULL;
-        }
-    }
-
-    curr = fpc->headers;
-    for (curr = fpc->headers; curr; curr = curr->next)
-        if (!fpc->best_header || curr->max_score > fpc->best_header->max_score)
-            fpc->best_header = curr;
-
-    if (fpc->best_header) {
-        fpc->best_header_valid = 1;
-        if (fpc->best_header->offset > 0) {
-            /* Output a junk frame. */
-            av_log(avctx, AV_LOG_DEBUG, "Junk frame till offset %i\n",
-                   fpc->best_header->offset);
-
-            /* Set duration to 0. It is unknown or invalid in a junk frame. */
-            s->duration = 0;
-            *poutbuf_size     = fpc->best_header->offset;
-            *poutbuf          = flac_fifo_read_wrap(fpc, 0, *poutbuf_size,
-                                                    &fpc->wrap_buf,
-                                                    &fpc->wrap_buf_allocated_size);
-            return buf_size ? (read_end - buf) : (fpc->best_header->offset -
-                                           av_fifo_size(fpc->fifo_buf));
-        }
-        if (!buf_size)
-            return get_best_header(fpc, poutbuf, poutbuf_size);
-    }
-
-handle_error:
-    *poutbuf      = NULL;
-    *poutbuf_size = 0;
-    return read_end - buf;
-}
-
-static av_cold int flac_parse_init(AVCodecParserContext *c)
-{
-    FLACParseContext *fpc = c->priv_data;
-    fpc->pc = c;
-    /* There will generally be FLAC_MIN_HEADERS buffered in the fifo before
-       it drains.  This is allocated early to avoid slow reallocation. */
-    fpc->fifo_buf = av_fifo_alloc(FLAC_AVG_FRAME_SIZE * (FLAC_MIN_HEADERS + 3));
-    return 0;
-}
-
-static void flac_parse_close(AVCodecParserContext *c)
-{
-    FLACParseContext *fpc = c->priv_data;
-    FLACHeaderMarker *curr = fpc->headers, *temp;
-
-    while (curr) {
-        temp = curr->next;
-        av_freep(&curr->link_penalty);
-        av_free(curr);
-        curr = temp;
-    }
-    av_fifo_free(fpc->fifo_buf);
-    av_free(fpc->wrap_buf);
-}
-
-AVCodecParser ff_flac_parser = {
-    .codec_ids      = { AV_CODEC_ID_FLAC },
-    .priv_data_size = sizeof(FLACParseContext),
-    .parser_init    = flac_parse_init,
-    .parser_parse   = flac_parse,
-    .parser_close   = flac_parse_close,
-};
diff --git a/deps/libav/libavcodec/flacdata.c b/deps/libav/libavcodec/flacdata.c
deleted file mode 100644
index 820c3aa..0000000
--- a/deps/libav/libavcodec/flacdata.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * FLAC data
- * Copyright (c) 2003 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "internal.h"
-
-const int ff_flac_sample_rate_table[16] =
-{ 0,
-  88200, 176400, 192000,
-  8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
-  0, 0, 0, 0 };
-
-const int16_t ff_flac_blocksize_table[16] = {
-     0,    192, 576<<0, 576<<1, 576<<2, 576<<3,      0,      0,
-256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
-};
diff --git a/deps/libav/libavcodec/flacdata.h b/deps/libav/libavcodec/flacdata.h
deleted file mode 100644
index f566377..0000000
--- a/deps/libav/libavcodec/flacdata.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * FLAC data header
- * Copyright (c) 2003 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_FLACDATA_H
-#define AVCODEC_FLACDATA_H
-
-#include "internal.h"
-
-extern const int ff_flac_sample_rate_table[16];
-
-extern const int16_t ff_flac_blocksize_table[16];
-
-#endif /* AVCODEC_FLACDATA_H */
diff --git a/deps/libav/libavcodec/flacdec.c b/deps/libav/libavcodec/flacdec.c
deleted file mode 100644
index 0305d50..0000000
--- a/deps/libav/libavcodec/flacdec.c
+++ /dev/null
@@ -1,573 +0,0 @@
-/*
- * FLAC (Free Lossless Audio Codec) decoder
- * Copyright (c) 2003 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FLAC (Free Lossless Audio Codec) decoder
- * @author Alex Beregszaszi
- * @see http://flac.sourceforge.net/
- *
- * This decoder can be used in 1 of 2 ways: Either raw FLAC data can be fed
- * through, starting from the initial 'fLaC' signature; or by passing the
- * 34-byte streaminfo structure through avctx->extradata[_size] followed
- * by data starting with the 0xFFF8 marker.
- */
-
-#include <limits.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/crc.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "bytestream.h"
-#include "golomb.h"
-#include "flac.h"
-#include "flacdata.h"
-#include "flacdsp.h"
-
-typedef struct FLACContext {
-    FLACSTREAMINFO
-
-    AVCodecContext *avctx;                  ///< parent AVCodecContext
-    GetBitContext gb;                       ///< GetBitContext initialized to start at the current frame
-
-    int blocksize;                          ///< number of samples in the current frame
-    int sample_shift;                       ///< shift required to make output samples 16-bit or 32-bit
-    int ch_mode;                            ///< channel decorrelation type in the current frame
-    int got_streaminfo;                     ///< indicates if the STREAMINFO has been read
-
-    int32_t *decoded[FLAC_MAX_CHANNELS];    ///< decoded samples
-    uint8_t *decoded_buffer;
-    unsigned int decoded_buffer_size;
-
-    FLACDSPContext dsp;
-} FLACContext;
-
-static int allocate_buffers(FLACContext *s);
-
-static void flac_set_bps(FLACContext *s)
-{
-    enum AVSampleFormat req = s->avctx->request_sample_fmt;
-    int need32 = s->bps > 16;
-    int want32 = av_get_bytes_per_sample(req) > 2;
-    int planar = av_sample_fmt_is_planar(req);
-
-    if (need32 || want32) {
-        if (planar)
-            s->avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
-        else
-            s->avctx->sample_fmt = AV_SAMPLE_FMT_S32;
-        s->sample_shift = 32 - s->bps;
-    } else {
-        if (planar)
-            s->avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-        else
-            s->avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-        s->sample_shift = 16 - s->bps;
-    }
-}
-
-static av_cold int flac_decode_init(AVCodecContext *avctx)
-{
-    enum FLACExtradataFormat format;
-    uint8_t *streaminfo;
-    int ret;
-    FLACContext *s = avctx->priv_data;
-    s->avctx = avctx;
-
-    /* for now, the raw FLAC header is allowed to be passed to the decoder as
-       frame data instead of extradata. */
-    if (!avctx->extradata)
-        return 0;
-
-    if (!avpriv_flac_is_extradata_valid(avctx, &format, &streaminfo))
-        return AVERROR_INVALIDDATA;
-
-    /* initialize based on the demuxer-supplied streamdata header */
-    avpriv_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s, streaminfo);
-    ret = allocate_buffers(s);
-    if (ret < 0)
-        return ret;
-    flac_set_bps(s);
-    ff_flacdsp_init(&s->dsp, avctx->sample_fmt, s->bps);
-    s->got_streaminfo = 1;
-
-    return 0;
-}
-
-static void dump_headers(AVCodecContext *avctx, FLACStreaminfo *s)
-{
-    av_log(avctx, AV_LOG_DEBUG, "  Max Blocksize: %d\n", s->max_blocksize);
-    av_log(avctx, AV_LOG_DEBUG, "  Max Framesize: %d\n", s->max_framesize);
-    av_log(avctx, AV_LOG_DEBUG, "  Samplerate: %d\n", s->samplerate);
-    av_log(avctx, AV_LOG_DEBUG, "  Channels: %d\n", s->channels);
-    av_log(avctx, AV_LOG_DEBUG, "  Bits: %d\n", s->bps);
-}
-
-static int allocate_buffers(FLACContext *s)
-{
-    int buf_size;
-
-    buf_size = av_samples_get_buffer_size(NULL, s->channels, s->max_blocksize,
-                                          AV_SAMPLE_FMT_S32P, 0);
-    if (buf_size < 0)
-        return buf_size;
-
-    av_fast_malloc(&s->decoded_buffer, &s->decoded_buffer_size, buf_size);
-    if (!s->decoded_buffer)
-        return AVERROR(ENOMEM);
-
-    return av_samples_fill_arrays((uint8_t **)s->decoded, NULL,
-                                  s->decoded_buffer, s->channels,
-                                  s->max_blocksize, AV_SAMPLE_FMT_S32P, 0);
-}
-
-/**
- * Parse the STREAMINFO from an inline header.
- * @param s the flac decoding context
- * @param buf input buffer, starting with the "fLaC" marker
- * @param buf_size buffer size
- * @return non-zero if metadata is invalid
- */
-static int parse_streaminfo(FLACContext *s, const uint8_t *buf, int buf_size)
-{
-    int metadata_type, metadata_size, ret;
-
-    if (buf_size < FLAC_STREAMINFO_SIZE+8) {
-        /* need more data */
-        return 0;
-    }
-    avpriv_flac_parse_block_header(&buf[4], NULL, &metadata_type, &metadata_size);
-    if (metadata_type != FLAC_METADATA_TYPE_STREAMINFO ||
-        metadata_size != FLAC_STREAMINFO_SIZE) {
-        return AVERROR_INVALIDDATA;
-    }
-    avpriv_flac_parse_streaminfo(s->avctx, (FLACStreaminfo *)s, &buf[8]);
-    ret = allocate_buffers(s);
-    if (ret < 0)
-        return ret;
-    flac_set_bps(s);
-    ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
-    s->got_streaminfo = 1;
-
-    return 0;
-}
-
-/**
- * Determine the size of an inline header.
- * @param buf input buffer, starting with the "fLaC" marker
- * @param buf_size buffer size
- * @return number of bytes in the header, or 0 if more data is needed
- */
-static int get_metadata_size(const uint8_t *buf, int buf_size)
-{
-    int metadata_last, metadata_size;
-    const uint8_t *buf_end = buf + buf_size;
-
-    buf += 4;
-    do {
-        if (buf_end - buf < 4)
-            return 0;
-        avpriv_flac_parse_block_header(buf, &metadata_last, NULL, &metadata_size);
-        buf += 4;
-        if (buf_end - buf < metadata_size) {
-            /* need more data in order to read the complete header */
-            return 0;
-        }
-        buf += metadata_size;
-    } while (!metadata_last);
-
-    return buf_size - (buf_end - buf);
-}
-
-static int decode_residuals(FLACContext *s, int32_t *decoded, int pred_order)
-{
-    int i, tmp, partition, method_type, rice_order;
-    int rice_bits, rice_esc;
-    int samples;
-
-    method_type = get_bits(&s->gb, 2);
-    if (method_type > 1) {
-        av_log(s->avctx, AV_LOG_ERROR, "illegal residual coding method %d\n",
-               method_type);
-        return AVERROR_INVALIDDATA;
-    }
-
-    rice_order = get_bits(&s->gb, 4);
-
-    samples= s->blocksize >> rice_order;
-    if (pred_order > samples) {
-        av_log(s->avctx, AV_LOG_ERROR, "invalid predictor order: %i > %i\n",
-               pred_order, samples);
-        return AVERROR_INVALIDDATA;
-    }
-
-    rice_bits = 4 + method_type;
-    rice_esc  = (1 << rice_bits) - 1;
-
-    decoded += pred_order;
-    i= pred_order;
-    for (partition = 0; partition < (1 << rice_order); partition++) {
-        tmp = get_bits(&s->gb, rice_bits);
-        if (tmp == rice_esc) {
-            tmp = get_bits(&s->gb, 5);
-            for (; i < samples; i++)
-                *decoded++ = get_sbits_long(&s->gb, tmp);
-        } else {
-            for (; i < samples; i++) {
-                *decoded++ = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0);
-            }
-        }
-        i= 0;
-    }
-
-    return 0;
-}
-
-static int decode_subframe_fixed(FLACContext *s, int32_t *decoded,
-                                 int pred_order, int bps)
-{
-    const int blocksize = s->blocksize;
-    int a, b, c, d, i, ret;
-
-    /* warm up samples */
-    for (i = 0; i < pred_order; i++) {
-        decoded[i] = get_sbits_long(&s->gb, bps);
-    }
-
-    if ((ret = decode_residuals(s, decoded, pred_order)) < 0)
-        return ret;
-
-    if (pred_order > 0)
-        a = decoded[pred_order-1];
-    if (pred_order > 1)
-        b = a - decoded[pred_order-2];
-    if (pred_order > 2)
-        c = b - decoded[pred_order-2] + decoded[pred_order-3];
-    if (pred_order > 3)
-        d = c - decoded[pred_order-2] + 2*decoded[pred_order-3] - decoded[pred_order-4];
-
-    switch (pred_order) {
-    case 0:
-        break;
-    case 1:
-        for (i = pred_order; i < blocksize; i++)
-            decoded[i] = a += decoded[i];
-        break;
-    case 2:
-        for (i = pred_order; i < blocksize; i++)
-            decoded[i] = a += b += decoded[i];
-        break;
-    case 3:
-        for (i = pred_order; i < blocksize; i++)
-            decoded[i] = a += b += c += decoded[i];
-        break;
-    case 4:
-        for (i = pred_order; i < blocksize; i++)
-            decoded[i] = a += b += c += d += decoded[i];
-        break;
-    default:
-        av_log(s->avctx, AV_LOG_ERROR, "illegal pred order %d\n", pred_order);
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-static int decode_subframe_lpc(FLACContext *s, int32_t *decoded, int pred_order,
-                               int bps)
-{
-    int i, ret;
-    int coeff_prec, qlevel;
-    int coeffs[32];
-
-    /* warm up samples */
-    for (i = 0; i < pred_order; i++) {
-        decoded[i] = get_sbits_long(&s->gb, bps);
-    }
-
-    coeff_prec = get_bits(&s->gb, 4) + 1;
-    if (coeff_prec == 16) {
-        av_log(s->avctx, AV_LOG_ERROR, "invalid coeff precision\n");
-        return AVERROR_INVALIDDATA;
-    }
-    qlevel = get_sbits(&s->gb, 5);
-    if (qlevel < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "qlevel %d not supported, maybe buggy stream\n",
-               qlevel);
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (i = 0; i < pred_order; i++) {
-        coeffs[pred_order - i - 1] = get_sbits(&s->gb, coeff_prec);
-    }
-
-    if ((ret = decode_residuals(s, decoded, pred_order)) < 0)
-        return ret;
-
-    s->dsp.lpc(decoded, coeffs, pred_order, qlevel, s->blocksize);
-
-    return 0;
-}
-
-static inline int decode_subframe(FLACContext *s, int channel)
-{
-    int32_t *decoded = s->decoded[channel];
-    int type, wasted = 0;
-    int bps = s->bps;
-    int i, tmp, ret;
-
-    if (channel == 0) {
-        if (s->ch_mode == FLAC_CHMODE_RIGHT_SIDE)
-            bps++;
-    } else {
-        if (s->ch_mode == FLAC_CHMODE_LEFT_SIDE || s->ch_mode == FLAC_CHMODE_MID_SIDE)
-            bps++;
-    }
-
-    if (get_bits1(&s->gb)) {
-        av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n");
-        return AVERROR_INVALIDDATA;
-    }
-    type = get_bits(&s->gb, 6);
-
-    if (get_bits1(&s->gb)) {
-        int left = get_bits_left(&s->gb);
-        wasted = 1;
-        if ( left < 0 ||
-            (left < bps && !show_bits_long(&s->gb, left)) ||
-                           !show_bits_long(&s->gb, bps)) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Invalid number of wasted bits > available bits (%d) - left=%d\n",
-                   bps, left);
-            return AVERROR_INVALIDDATA;
-        }
-        while (!get_bits1(&s->gb))
-            wasted++;
-        bps -= wasted;
-    }
-    if (bps > 32) {
-        avpriv_report_missing_feature(s->avctx, "Decorrelated bit depth > 32");
-        return AVERROR_PATCHWELCOME;
-    }
-
-//FIXME use av_log2 for types
-    if (type == 0) {
-        tmp = get_sbits_long(&s->gb, bps);
-        for (i = 0; i < s->blocksize; i++)
-            decoded[i] = tmp;
-    } else if (type == 1) {
-        for (i = 0; i < s->blocksize; i++)
-            decoded[i] = get_sbits_long(&s->gb, bps);
-    } else if ((type >= 8) && (type <= 12)) {
-        if ((ret = decode_subframe_fixed(s, decoded, type & ~0x8, bps)) < 0)
-            return ret;
-    } else if (type >= 32) {
-        if ((ret = decode_subframe_lpc(s, decoded, (type & ~0x20)+1, bps)) < 0)
-            return ret;
-    } else {
-        av_log(s->avctx, AV_LOG_ERROR, "invalid coding type\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (wasted) {
-        int i;
-        for (i = 0; i < s->blocksize; i++)
-            decoded[i] <<= wasted;
-    }
-
-    return 0;
-}
-
-static int decode_frame(FLACContext *s)
-{
-    int i, ret;
-    GetBitContext *gb = &s->gb;
-    FLACFrameInfo fi;
-
-    if ((ret = ff_flac_decode_frame_header(s->avctx, gb, &fi, 0)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "invalid frame header\n");
-        return ret;
-    }
-
-    if (s->channels && fi.channels != s->channels && s->got_streaminfo) {
-        s->channels = s->avctx->channels = fi.channels;
-        ff_flac_set_channel_layout(s->avctx);
-        ret = allocate_buffers(s);
-        if (ret < 0)
-            return ret;
-    }
-    s->channels = s->avctx->channels = fi.channels;
-    if (!s->avctx->channel_layout)
-        ff_flac_set_channel_layout(s->avctx);
-    s->ch_mode = fi.ch_mode;
-
-    if (!s->bps && !fi.bps) {
-        av_log(s->avctx, AV_LOG_ERROR, "bps not found in STREAMINFO or frame header\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (!fi.bps) {
-        fi.bps = s->bps;
-    } else if (s->bps && fi.bps != s->bps) {
-        av_log(s->avctx, AV_LOG_ERROR, "switching bps mid-stream is not "
-                                       "supported\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!s->bps) {
-        s->bps = s->avctx->bits_per_raw_sample = fi.bps;
-        flac_set_bps(s);
-    }
-
-    if (!s->max_blocksize)
-        s->max_blocksize = FLAC_MAX_BLOCKSIZE;
-    if (fi.blocksize > s->max_blocksize) {
-        av_log(s->avctx, AV_LOG_ERROR, "blocksize %d > %d\n", fi.blocksize,
-               s->max_blocksize);
-        return AVERROR_INVALIDDATA;
-    }
-    s->blocksize = fi.blocksize;
-
-    if (!s->samplerate && !fi.samplerate) {
-        av_log(s->avctx, AV_LOG_ERROR, "sample rate not found in STREAMINFO"
-                                        " or frame header\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (fi.samplerate == 0)
-        fi.samplerate = s->samplerate;
-    s->samplerate = s->avctx->sample_rate = fi.samplerate;
-
-    if (!s->got_streaminfo) {
-        ret = allocate_buffers(s);
-        if (ret < 0)
-            return ret;
-        ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
-        s->got_streaminfo = 1;
-        dump_headers(s->avctx, (FLACStreaminfo *)s);
-    }
-
-//    dump_headers(s->avctx, (FLACStreaminfo *)s);
-
-    /* subframes */
-    for (i = 0; i < s->channels; i++) {
-        if ((ret = decode_subframe(s, i)) < 0)
-            return ret;
-    }
-
-    align_get_bits(gb);
-
-    /* frame footer */
-    skip_bits(gb, 16); /* data crc */
-
-    return 0;
-}
-
-static int flac_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    FLACContext *s = avctx->priv_data;
-    int bytes_read = 0;
-    int ret;
-
-    *got_frame_ptr = 0;
-
-    if (s->max_framesize == 0) {
-        s->max_framesize =
-            ff_flac_get_max_frame_size(s->max_blocksize ? s->max_blocksize : FLAC_MAX_BLOCKSIZE,
-                                       FLAC_MAX_CHANNELS, 32);
-    }
-
-    /* check that there is at least the smallest decodable amount of data.
-       this amount corresponds to the smallest valid FLAC frame possible.
-       FF F8 69 02 00 00 9A 00 00 34 46 */
-    if (buf_size < FLAC_MIN_FRAME_SIZE)
-        return buf_size;
-
-    /* check for inline header */
-    if (AV_RB32(buf) == MKBETAG('f','L','a','C')) {
-        if (!s->got_streaminfo && (ret = parse_streaminfo(s, buf, buf_size))) {
-            av_log(s->avctx, AV_LOG_ERROR, "invalid header\n");
-            return ret;
-        }
-        return get_metadata_size(buf, buf_size);
-    }
-
-    /* decode frame */
-    init_get_bits(&s->gb, buf, buf_size*8);
-    if ((ret = decode_frame(s)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "decode_frame() failed\n");
-        return ret;
-    }
-    bytes_read = (get_bits_count(&s->gb)+7)/8;
-
-    /* get output buffer */
-    frame->nb_samples = s->blocksize;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    s->dsp.decorrelate[s->ch_mode](frame->data, s->decoded, s->channels,
-                                   s->blocksize, s->sample_shift);
-
-    if (bytes_read > buf_size) {
-        av_log(s->avctx, AV_LOG_ERROR, "overread: %d\n", bytes_read - buf_size);
-        return AVERROR_INVALIDDATA;
-    }
-    if (bytes_read < buf_size) {
-        av_log(s->avctx, AV_LOG_DEBUG, "underread: %d orig size: %d\n",
-               buf_size - bytes_read, buf_size);
-    }
-
-    *got_frame_ptr = 1;
-
-    return bytes_read;
-}
-
-static av_cold int flac_decode_close(AVCodecContext *avctx)
-{
-    FLACContext *s = avctx->priv_data;
-
-    av_freep(&s->decoded_buffer);
-
-    return 0;
-}
-
-AVCodec ff_flac_decoder = {
-    .name           = "flac",
-    .long_name      = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_FLAC,
-    .priv_data_size = sizeof(FLACContext),
-    .init           = flac_decode_init,
-    .close          = flac_decode_close,
-    .decode         = flac_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
-                                                      AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_S32,
-                                                      AV_SAMPLE_FMT_S32P,
-                                                      -1 },
-};
diff --git a/deps/libav/libavcodec/flacdsp.c b/deps/libav/libavcodec/flacdsp.c
deleted file mode 100644
index b916869..0000000
--- a/deps/libav/libavcodec/flacdsp.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/samplefmt.h"
-#include "flacdsp.h"
-#include "config.h"
-
-#define SAMPLE_SIZE 16
-#define PLANAR 0
-#include "flacdsp_template.c"
-#include "flacdsp_lpc_template.c"
-
-#undef  PLANAR
-#define PLANAR 1
-#include "flacdsp_template.c"
-
-#undef  SAMPLE_SIZE
-#undef  PLANAR
-#define SAMPLE_SIZE 32
-#define PLANAR 0
-#include "flacdsp_template.c"
-#include "flacdsp_lpc_template.c"
-
-#undef  PLANAR
-#define PLANAR 1
-#include "flacdsp_template.c"
-
-static void flac_lpc_16_c(int32_t *decoded, const int coeffs[32],
-                          int pred_order, int qlevel, int len)
-{
-    int i, j;
-
-    for (i = pred_order; i < len - 1; i += 2, decoded += 2) {
-        int c = coeffs[0];
-        int d = decoded[0];
-        int s0 = 0, s1 = 0;
-        for (j = 1; j < pred_order; j++) {
-            s0 += c*d;
-            d = decoded[j];
-            s1 += c*d;
-            c = coeffs[j];
-        }
-        s0 += c*d;
-        d = decoded[j] += s0 >> qlevel;
-        s1 += c*d;
-        decoded[j + 1] += s1 >> qlevel;
-    }
-    if (i < len) {
-        int sum = 0;
-        for (j = 0; j < pred_order; j++)
-            sum += coeffs[j] * decoded[j];
-        decoded[j] += sum >> qlevel;
-    }
-}
-
-static void flac_lpc_32_c(int32_t *decoded, const int coeffs[32],
-                          int pred_order, int qlevel, int len)
-{
-    int i, j;
-
-    for (i = pred_order; i < len; i++, decoded++) {
-        int64_t sum = 0;
-        for (j = 0; j < pred_order; j++)
-            sum += (int64_t)coeffs[j] * decoded[j];
-        decoded[j] += sum >> qlevel;
-    }
-
-}
-
-av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt,
-                             int bps)
-{
-    if (bps > 16) {
-        c->lpc            = flac_lpc_32_c;
-        c->lpc_encode     = flac_lpc_encode_c_32;
-    } else {
-        c->lpc            = flac_lpc_16_c;
-        c->lpc_encode     = flac_lpc_encode_c_16;
-    }
-
-    switch (fmt) {
-    case AV_SAMPLE_FMT_S32:
-        c->decorrelate[0] = flac_decorrelate_indep_c_32;
-        c->decorrelate[1] = flac_decorrelate_ls_c_32;
-        c->decorrelate[2] = flac_decorrelate_rs_c_32;
-        c->decorrelate[3] = flac_decorrelate_ms_c_32;
-        break;
-
-    case AV_SAMPLE_FMT_S32P:
-        c->decorrelate[0] = flac_decorrelate_indep_c_32p;
-        c->decorrelate[1] = flac_decorrelate_ls_c_32p;
-        c->decorrelate[2] = flac_decorrelate_rs_c_32p;
-        c->decorrelate[3] = flac_decorrelate_ms_c_32p;
-        break;
-
-    case AV_SAMPLE_FMT_S16:
-        c->decorrelate[0] = flac_decorrelate_indep_c_16;
-        c->decorrelate[1] = flac_decorrelate_ls_c_16;
-        c->decorrelate[2] = flac_decorrelate_rs_c_16;
-        c->decorrelate[3] = flac_decorrelate_ms_c_16;
-        break;
-
-    case AV_SAMPLE_FMT_S16P:
-        c->decorrelate[0] = flac_decorrelate_indep_c_16p;
-        c->decorrelate[1] = flac_decorrelate_ls_c_16p;
-        c->decorrelate[2] = flac_decorrelate_rs_c_16p;
-        c->decorrelate[3] = flac_decorrelate_ms_c_16p;
-        break;
-    }
-
-    if (ARCH_ARM)
-        ff_flacdsp_init_arm(c, fmt, bps);
-}
diff --git a/deps/libav/libavcodec/flacdsp.h b/deps/libav/libavcodec/flacdsp.h
deleted file mode 100644
index 33184b5..0000000
--- a/deps/libav/libavcodec/flacdsp.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_FLACDSP_H
-#define AVCODEC_FLACDSP_H
-
-#include <stdint.h>
-#include "libavutil/samplefmt.h"
-
-typedef struct FLACDSPContext {
-    void (*decorrelate[4])(uint8_t **out, int32_t **in, int channels,
-                           int len, int shift);
-    void (*lpc)(int32_t *samples, const int coeffs[32], int order,
-                int qlevel, int len);
-    void (*lpc_encode)(int32_t *res, const int32_t *smp, int len, int order,
-                       const int32_t *coefs, int shift);
-} FLACDSPContext;
-
-void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int bps);
-void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt, int bps);
-
-#endif /* AVCODEC_FLACDSP_H */
diff --git a/deps/libav/libavcodec/flacdsp_lpc_template.c b/deps/libav/libavcodec/flacdsp_lpc_template.c
deleted file mode 100644
index 269e64b..0000000
--- a/deps/libav/libavcodec/flacdsp_lpc_template.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include "libavutil/avutil.h"
-#include "mathops.h"
-
-#undef FUNC
-#undef sum_type
-#undef MUL
-#undef CLIP
-#undef FSUF
-
-#define FUNC(n) AV_JOIN(n ## _, SAMPLE_SIZE)
-
-#if SAMPLE_SIZE == 32
-#   define sum_type  int64_t
-#   define MUL(a, b) MUL64(a, b)
-#   define CLIP(x) av_clipl_int32(x)
-#else
-#   define sum_type  int32_t
-#   define MUL(a, b) ((a) * (b))
-#   define CLIP(x) (x)
-#endif
-
-#define LPC1(x) {           \
-    int c = coefs[(x)-1];   \
-    p0   += MUL(c, s);      \
-    s     = smp[i-(x)+1];   \
-    p1   += MUL(c, s);      \
-}
-
-static av_always_inline void FUNC(lpc_encode_unrolled)(int32_t *res,
-                                  const int32_t *smp, int len, int order,
-                                  const int32_t *coefs, int shift, int big)
-{
-    int i;
-    for (i = order; i < len; i += 2) {
-        int s  = smp[i-order];
-        sum_type p0 = 0, p1 = 0;
-        if (big) {
-            switch (order) {
-            case 32: LPC1(32)
-            case 31: LPC1(31)
-            case 30: LPC1(30)
-            case 29: LPC1(29)
-            case 28: LPC1(28)
-            case 27: LPC1(27)
-            case 26: LPC1(26)
-            case 25: LPC1(25)
-            case 24: LPC1(24)
-            case 23: LPC1(23)
-            case 22: LPC1(22)
-            case 21: LPC1(21)
-            case 20: LPC1(20)
-            case 19: LPC1(19)
-            case 18: LPC1(18)
-            case 17: LPC1(17)
-            case 16: LPC1(16)
-            case 15: LPC1(15)
-            case 14: LPC1(14)
-            case 13: LPC1(13)
-            case 12: LPC1(12)
-            case 11: LPC1(11)
-            case 10: LPC1(10)
-            case  9: LPC1( 9)
-                     LPC1( 8)
-                     LPC1( 7)
-                     LPC1( 6)
-                     LPC1( 5)
-                     LPC1( 4)
-                     LPC1( 3)
-                     LPC1( 2)
-                     LPC1( 1)
-            }
-        } else {
-            switch (order) {
-            case  8: LPC1( 8)
-            case  7: LPC1( 7)
-            case  6: LPC1( 6)
-            case  5: LPC1( 5)
-            case  4: LPC1( 4)
-            case  3: LPC1( 3)
-            case  2: LPC1( 2)
-            case  1: LPC1( 1)
-            }
-        }
-        res[i  ] = smp[i  ] - CLIP(p0 >> shift);
-        res[i+1] = smp[i+1] - CLIP(p1 >> shift);
-    }
-}
-
-static void FUNC(flac_lpc_encode_c)(int32_t *res, const int32_t *smp, int len,
-                                    int order, const int32_t *coefs, int shift)
-{
-    int i;
-    for (i = 0; i < order; i++)
-        res[i] = smp[i];
-#if CONFIG_SMALL
-    for (i = order; i < len; i += 2) {
-        int j;
-        int s  = smp[i];
-        sum_type p0 = 0, p1 = 0;
-        for (j = 0; j < order; j++) {
-            int c = coefs[j];
-            p1   += MUL(c, s);
-            s     = smp[i-j-1];
-            p0   += MUL(c, s);
-        }
-        res[i  ] = smp[i  ] - CLIP(p0 >> shift);
-        res[i+1] = smp[i+1] - CLIP(p1 >> shift);
-    }
-#else
-    switch (order) {
-    case  1: FUNC(lpc_encode_unrolled)(res, smp, len,     1, coefs, shift, 0); break;
-    case  2: FUNC(lpc_encode_unrolled)(res, smp, len,     2, coefs, shift, 0); break;
-    case  3: FUNC(lpc_encode_unrolled)(res, smp, len,     3, coefs, shift, 0); break;
-    case  4: FUNC(lpc_encode_unrolled)(res, smp, len,     4, coefs, shift, 0); break;
-    case  5: FUNC(lpc_encode_unrolled)(res, smp, len,     5, coefs, shift, 0); break;
-    case  6: FUNC(lpc_encode_unrolled)(res, smp, len,     6, coefs, shift, 0); break;
-    case  7: FUNC(lpc_encode_unrolled)(res, smp, len,     7, coefs, shift, 0); break;
-    case  8: FUNC(lpc_encode_unrolled)(res, smp, len,     8, coefs, shift, 0); break;
-    default: FUNC(lpc_encode_unrolled)(res, smp, len, order, coefs, shift, 1); break;
-    }
-#endif
-}
diff --git a/deps/libav/libavcodec/flacdsp_template.c b/deps/libav/libavcodec/flacdsp_template.c
deleted file mode 100644
index 0affe22..0000000
--- a/deps/libav/libavcodec/flacdsp_template.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include "libavutil/avutil.h"
-
-#undef FUNC
-#undef FSUF
-#undef sample
-#undef sample_type
-#undef OUT
-#undef S
-
-#if SAMPLE_SIZE == 32
-#   define sample_type  int32_t
-#else
-#   define sample_type  int16_t
-#endif
-
-#if PLANAR
-#   define FSUF   AV_JOIN(SAMPLE_SIZE, p)
-#   define sample sample_type *
-#   define OUT(n) n
-#   define S(s, c, i) (s[c][i])
-#else
-#   define FSUF   SAMPLE_SIZE
-#   define sample sample_type
-#   define OUT(n) n[0]
-#   define S(s, c, i) (*s++)
-#endif
-
-#define FUNC(n) AV_JOIN(n ## _, FSUF)
-
-static void FUNC(flac_decorrelate_indep_c)(uint8_t **out, int32_t **in,
-                                           int channels, int len, int shift)
-{
-    sample *samples = (sample *) OUT(out);
-    int i, j;
-
-    for (j = 0; j < len; j++)
-        for (i = 0; i < channels; i++)
-            S(samples, i, j) = in[i][j] << shift;
-}
-
-static void FUNC(flac_decorrelate_ls_c)(uint8_t **out, int32_t **in,
-                                        int channels, int len, int shift)
-{
-    sample *samples = (sample *) OUT(out);
-    int i;
-
-    for (i = 0; i < len; i++) {
-        int a = in[0][i];
-        int b = in[1][i];
-        S(samples, 0, i) =  a      << shift;
-        S(samples, 1, i) = (a - b) << shift;
-    }
-}
-
-static void FUNC(flac_decorrelate_rs_c)(uint8_t **out, int32_t **in,
-                                        int channels, int len, int shift)
-{
-    sample *samples = (sample *) OUT(out);
-    int i;
-
-    for (i = 0; i < len; i++) {
-        int a = in[0][i];
-        int b = in[1][i];
-        S(samples, 0, i) = (a + b) << shift;
-        S(samples, 1, i) =  b      << shift;
-    }
-}
-
-static void FUNC(flac_decorrelate_ms_c)(uint8_t **out, int32_t **in,
-                                        int channels, int len, int shift)
-{
-    sample *samples = (sample *) OUT(out);
-    int i;
-
-    for (i = 0; i < len; i++) {
-        int a = in[0][i];
-        int b = in[1][i];
-        a -= b >> 1;
-        S(samples, 0, i) = (a + b) << shift;
-        S(samples, 1, i) =  a      << shift;
-    }
-}
diff --git a/deps/libav/libavcodec/flacenc.c b/deps/libav/libavcodec/flacenc.c
deleted file mode 100644
index 58e86be..0000000
--- a/deps/libav/libavcodec/flacenc.c
+++ /dev/null
@@ -1,1333 +0,0 @@
-/*
- * FLAC audio encoder
- * Copyright (c) 2006  Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/crc.h"
-#include "libavutil/intmath.h"
-#include "libavutil/md5.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "golomb.h"
-#include "internal.h"
-#include "lpc.h"
-#include "flac.h"
-#include "flacdata.h"
-#include "flacdsp.h"
-
-#define FLAC_SUBFRAME_CONSTANT  0
-#define FLAC_SUBFRAME_VERBATIM  1
-#define FLAC_SUBFRAME_FIXED     8
-#define FLAC_SUBFRAME_LPC      32
-
-#define MAX_FIXED_ORDER     4
-#define MAX_PARTITION_ORDER 8
-#define MAX_PARTITIONS     (1 << MAX_PARTITION_ORDER)
-#define MAX_LPC_PRECISION  15
-#define MAX_LPC_SHIFT      15
-
-enum CodingMode {
-    CODING_MODE_RICE  = 4,
-    CODING_MODE_RICE2 = 5,
-};
-
-typedef struct CompressionOptions {
-    int compression_level;
-    int block_time_ms;
-    enum FFLPCType lpc_type;
-    int lpc_passes;
-    int lpc_coeff_precision;
-    int min_prediction_order;
-    int max_prediction_order;
-    int prediction_order_method;
-    int min_partition_order;
-    int max_partition_order;
-    int ch_mode;
-} CompressionOptions;
-
-typedef struct RiceContext {
-    enum CodingMode coding_mode;
-    int porder;
-    int params[MAX_PARTITIONS];
-} RiceContext;
-
-typedef struct FlacSubframe {
-    int type;
-    int type_code;
-    int obits;
-    int wasted;
-    int order;
-    int32_t coefs[MAX_LPC_ORDER];
-    int shift;
-    RiceContext rc;
-    int32_t samples[FLAC_MAX_BLOCKSIZE];
-    int32_t residual[FLAC_MAX_BLOCKSIZE+1];
-} FlacSubframe;
-
-typedef struct FlacFrame {
-    FlacSubframe subframes[FLAC_MAX_CHANNELS];
-    int blocksize;
-    int bs_code[2];
-    uint8_t crc8;
-    int ch_mode;
-    int verbatim_only;
-} FlacFrame;
-
-typedef struct FlacEncodeContext {
-    AVClass *class;
-    PutBitContext pb;
-    int channels;
-    int samplerate;
-    int sr_code[2];
-    int bps_code;
-    int max_blocksize;
-    int min_framesize;
-    int max_framesize;
-    int max_encoded_framesize;
-    uint32_t frame_count;
-    uint64_t sample_count;
-    uint8_t md5sum[16];
-    FlacFrame frame;
-    CompressionOptions options;
-    AVCodecContext *avctx;
-    LPCContext lpc_ctx;
-    struct AVMD5 *md5ctx;
-    uint8_t *md5_buffer;
-    unsigned int md5_buffer_size;
-    DSPContext dsp;
-    FLACDSPContext flac_dsp;
-} FlacEncodeContext;
-
-
-/**
- * Write streaminfo metadata block to byte array.
- */
-static void write_streaminfo(FlacEncodeContext *s, uint8_t *header)
-{
-    PutBitContext pb;
-
-    memset(header, 0, FLAC_STREAMINFO_SIZE);
-    init_put_bits(&pb, header, FLAC_STREAMINFO_SIZE);
-
-    /* streaminfo metadata block */
-    put_bits(&pb, 16, s->max_blocksize);
-    put_bits(&pb, 16, s->max_blocksize);
-    put_bits(&pb, 24, s->min_framesize);
-    put_bits(&pb, 24, s->max_framesize);
-    put_bits(&pb, 20, s->samplerate);
-    put_bits(&pb, 3, s->channels-1);
-    put_bits(&pb,  5, s->avctx->bits_per_raw_sample - 1);
-    /* write 36-bit sample count in 2 put_bits() calls */
-    put_bits(&pb, 24, (s->sample_count & 0xFFFFFF000LL) >> 12);
-    put_bits(&pb, 12,  s->sample_count & 0x000000FFFLL);
-    flush_put_bits(&pb);
-    memcpy(&header[18], s->md5sum, 16);
-}
-
-
-/**
- * Set blocksize based on samplerate.
- * Choose the closest predefined blocksize >= BLOCK_TIME_MS milliseconds.
- */
-static int select_blocksize(int samplerate, int block_time_ms)
-{
-    int i;
-    int target;
-    int blocksize;
-
-    assert(samplerate > 0);
-    blocksize = ff_flac_blocksize_table[1];
-    target    = (samplerate * block_time_ms) / 1000;
-    for (i = 0; i < 16; i++) {
-        if (target >= ff_flac_blocksize_table[i] &&
-            ff_flac_blocksize_table[i] > blocksize) {
-            blocksize = ff_flac_blocksize_table[i];
-        }
-    }
-    return blocksize;
-}
-
-
-static av_cold void dprint_compression_options(FlacEncodeContext *s)
-{
-    AVCodecContext     *avctx = s->avctx;
-    CompressionOptions *opt   = &s->options;
-
-    av_log(avctx, AV_LOG_DEBUG, " compression: %d\n", opt->compression_level);
-
-    switch (opt->lpc_type) {
-    case FF_LPC_TYPE_NONE:
-        av_log(avctx, AV_LOG_DEBUG, " lpc type: None\n");
-        break;
-    case FF_LPC_TYPE_FIXED:
-        av_log(avctx, AV_LOG_DEBUG, " lpc type: Fixed pre-defined coefficients\n");
-        break;
-    case FF_LPC_TYPE_LEVINSON:
-        av_log(avctx, AV_LOG_DEBUG, " lpc type: Levinson-Durbin recursion with Welch window\n");
-        break;
-    case FF_LPC_TYPE_CHOLESKY:
-        av_log(avctx, AV_LOG_DEBUG, " lpc type: Cholesky factorization, %d pass%s\n",
-               opt->lpc_passes, opt->lpc_passes == 1 ? "" : "es");
-        break;
-    }
-
-    av_log(avctx, AV_LOG_DEBUG, " prediction order: %d, %d\n",
-           opt->min_prediction_order, opt->max_prediction_order);
-
-    switch (opt->prediction_order_method) {
-    case ORDER_METHOD_EST:
-        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "estimate");
-        break;
-    case ORDER_METHOD_2LEVEL:
-        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "2-level");
-        break;
-    case ORDER_METHOD_4LEVEL:
-        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "4-level");
-        break;
-    case ORDER_METHOD_8LEVEL:
-        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "8-level");
-        break;
-    case ORDER_METHOD_SEARCH:
-        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "full search");
-        break;
-    case ORDER_METHOD_LOG:
-        av_log(avctx, AV_LOG_DEBUG, " order method: %s\n", "log search");
-        break;
-    }
-
-
-    av_log(avctx, AV_LOG_DEBUG, " partition order: %d, %d\n",
-           opt->min_partition_order, opt->max_partition_order);
-
-    av_log(avctx, AV_LOG_DEBUG, " block size: %d\n", avctx->frame_size);
-
-    av_log(avctx, AV_LOG_DEBUG, " lpc precision: %d\n",
-           opt->lpc_coeff_precision);
-}
-
-
-static av_cold int flac_encode_init(AVCodecContext *avctx)
-{
-    int freq = avctx->sample_rate;
-    int channels = avctx->channels;
-    FlacEncodeContext *s = avctx->priv_data;
-    int i, level, ret;
-    uint8_t *streaminfo;
-
-    s->avctx = avctx;
-
-    switch (avctx->sample_fmt) {
-    case AV_SAMPLE_FMT_S16:
-        avctx->bits_per_raw_sample = 16;
-        s->bps_code                = 4;
-        break;
-    case AV_SAMPLE_FMT_S32:
-        if (avctx->bits_per_raw_sample != 24)
-            av_log(avctx, AV_LOG_WARNING, "encoding as 24 bits-per-sample\n");
-        avctx->bits_per_raw_sample = 24;
-        s->bps_code                = 6;
-        break;
-    }
-
-    if (channels < 1 || channels > FLAC_MAX_CHANNELS)
-        return -1;
-    s->channels = channels;
-
-    /* find samplerate in table */
-    if (freq < 1)
-        return -1;
-    for (i = 4; i < 12; i++) {
-        if (freq == ff_flac_sample_rate_table[i]) {
-            s->samplerate = ff_flac_sample_rate_table[i];
-            s->sr_code[0] = i;
-            s->sr_code[1] = 0;
-            break;
-        }
-    }
-    /* if not in table, samplerate is non-standard */
-    if (i == 12) {
-        if (freq % 1000 == 0 && freq < 255000) {
-            s->sr_code[0] = 12;
-            s->sr_code[1] = freq / 1000;
-        } else if (freq % 10 == 0 && freq < 655350) {
-            s->sr_code[0] = 14;
-            s->sr_code[1] = freq / 10;
-        } else if (freq < 65535) {
-            s->sr_code[0] = 13;
-            s->sr_code[1] = freq;
-        } else {
-            return -1;
-        }
-        s->samplerate = freq;
-    }
-
-    /* set compression option defaults based on avctx->compression_level */
-    if (avctx->compression_level < 0)
-        s->options.compression_level = 5;
-    else
-        s->options.compression_level = avctx->compression_level;
-
-    level = s->options.compression_level;
-    if (level > 12) {
-        av_log(avctx, AV_LOG_ERROR, "invalid compression level: %d\n",
-               s->options.compression_level);
-        return -1;
-    }
-
-    s->options.block_time_ms = ((int[]){ 27, 27, 27,105,105,105,105,105,105,105,105,105,105})[level];
-
-    if (s->options.lpc_type == FF_LPC_TYPE_DEFAULT)
-        s->options.lpc_type  = ((int[]){ FF_LPC_TYPE_FIXED,    FF_LPC_TYPE_FIXED,    FF_LPC_TYPE_FIXED,
-                                         FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_LEVINSON,
-                                         FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_LEVINSON,
-                                         FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_LEVINSON,
-                                         FF_LPC_TYPE_LEVINSON})[level];
-
-    s->options.min_prediction_order = ((int[]){  2,  0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1})[level];
-    s->options.max_prediction_order = ((int[]){  3,  4,  4,  6,  8,  8,  8,  8, 12, 12, 12, 32, 32})[level];
-
-    if (s->options.prediction_order_method < 0)
-        s->options.prediction_order_method = ((int[]){ ORDER_METHOD_EST,    ORDER_METHOD_EST,    ORDER_METHOD_EST,
-                                                       ORDER_METHOD_EST,    ORDER_METHOD_EST,    ORDER_METHOD_EST,
-                                                       ORDER_METHOD_4LEVEL, ORDER_METHOD_LOG,    ORDER_METHOD_4LEVEL,
-                                                       ORDER_METHOD_LOG,    ORDER_METHOD_SEARCH, ORDER_METHOD_LOG,
-                                                       ORDER_METHOD_SEARCH})[level];
-
-    if (s->options.min_partition_order > s->options.max_partition_order) {
-        av_log(avctx, AV_LOG_ERROR, "invalid partition orders: min=%d max=%d\n",
-               s->options.min_partition_order, s->options.max_partition_order);
-        return AVERROR(EINVAL);
-    }
-    if (s->options.min_partition_order < 0)
-        s->options.min_partition_order = ((int[]){  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0})[level];
-    if (s->options.max_partition_order < 0)
-        s->options.max_partition_order = ((int[]){  2,  2,  3,  3,  3,  8,  8,  8,  8,  8,  8,  8,  8})[level];
-
-    if (s->options.lpc_type == FF_LPC_TYPE_NONE) {
-        s->options.min_prediction_order = 0;
-    } else if (avctx->min_prediction_order >= 0) {
-        if (s->options.lpc_type == FF_LPC_TYPE_FIXED) {
-            if (avctx->min_prediction_order > MAX_FIXED_ORDER) {
-                av_log(avctx, AV_LOG_ERROR, "invalid min prediction order: %d\n",
-                       avctx->min_prediction_order);
-                return -1;
-            }
-        } else if (avctx->min_prediction_order < MIN_LPC_ORDER ||
-                   avctx->min_prediction_order > MAX_LPC_ORDER) {
-            av_log(avctx, AV_LOG_ERROR, "invalid min prediction order: %d\n",
-                   avctx->min_prediction_order);
-            return -1;
-        }
-        s->options.min_prediction_order = avctx->min_prediction_order;
-    }
-    if (s->options.lpc_type == FF_LPC_TYPE_NONE) {
-        s->options.max_prediction_order = 0;
-    } else if (avctx->max_prediction_order >= 0) {
-        if (s->options.lpc_type == FF_LPC_TYPE_FIXED) {
-            if (avctx->max_prediction_order > MAX_FIXED_ORDER) {
-                av_log(avctx, AV_LOG_ERROR, "invalid max prediction order: %d\n",
-                       avctx->max_prediction_order);
-                return -1;
-            }
-        } else if (avctx->max_prediction_order < MIN_LPC_ORDER ||
-                   avctx->max_prediction_order > MAX_LPC_ORDER) {
-            av_log(avctx, AV_LOG_ERROR, "invalid max prediction order: %d\n",
-                   avctx->max_prediction_order);
-            return -1;
-        }
-        s->options.max_prediction_order = avctx->max_prediction_order;
-    }
-    if (s->options.max_prediction_order < s->options.min_prediction_order) {
-        av_log(avctx, AV_LOG_ERROR, "invalid prediction orders: min=%d max=%d\n",
-               s->options.min_prediction_order, s->options.max_prediction_order);
-        return -1;
-    }
-
-    if (avctx->frame_size > 0) {
-        if (avctx->frame_size < FLAC_MIN_BLOCKSIZE ||
-                avctx->frame_size > FLAC_MAX_BLOCKSIZE) {
-            av_log(avctx, AV_LOG_ERROR, "invalid block size: %d\n",
-                   avctx->frame_size);
-            return -1;
-        }
-    } else {
-        s->avctx->frame_size = select_blocksize(s->samplerate, s->options.block_time_ms);
-    }
-    s->max_blocksize = s->avctx->frame_size;
-
-    /* set maximum encoded frame size in verbatim mode */
-    s->max_framesize = ff_flac_get_max_frame_size(s->avctx->frame_size,
-                                                  s->channels,
-                                                  s->avctx->bits_per_raw_sample);
-
-    /* initialize MD5 context */
-    s->md5ctx = av_md5_alloc();
-    if (!s->md5ctx)
-        return AVERROR(ENOMEM);
-    av_md5_init(s->md5ctx);
-
-    streaminfo = av_malloc(FLAC_STREAMINFO_SIZE);
-    if (!streaminfo)
-        return AVERROR(ENOMEM);
-    write_streaminfo(s, streaminfo);
-    avctx->extradata = streaminfo;
-    avctx->extradata_size = FLAC_STREAMINFO_SIZE;
-
-    s->frame_count   = 0;
-    s->min_framesize = s->max_framesize;
-
-    ret = ff_lpc_init(&s->lpc_ctx, avctx->frame_size,
-                      s->options.max_prediction_order, FF_LPC_TYPE_LEVINSON);
-
-    ff_dsputil_init(&s->dsp, avctx);
-    ff_flacdsp_init(&s->flac_dsp, avctx->sample_fmt,
-                    avctx->bits_per_raw_sample);
-
-    dprint_compression_options(s);
-
-    return ret;
-}
-
-
-static void init_frame(FlacEncodeContext *s, int nb_samples)
-{
-    int i, ch;
-    FlacFrame *frame;
-
-    frame = &s->frame;
-
-    for (i = 0; i < 16; i++) {
-        if (nb_samples == ff_flac_blocksize_table[i]) {
-            frame->blocksize  = ff_flac_blocksize_table[i];
-            frame->bs_code[0] = i;
-            frame->bs_code[1] = 0;
-            break;
-        }
-    }
-    if (i == 16) {
-        frame->blocksize = nb_samples;
-        if (frame->blocksize <= 256) {
-            frame->bs_code[0] = 6;
-            frame->bs_code[1] = frame->blocksize-1;
-        } else {
-            frame->bs_code[0] = 7;
-            frame->bs_code[1] = frame->blocksize-1;
-        }
-    }
-
-    for (ch = 0; ch < s->channels; ch++) {
-        FlacSubframe *sub = &frame->subframes[ch];
-
-        sub->wasted = 0;
-        sub->obits  = s->avctx->bits_per_raw_sample;
-
-        if (sub->obits > 16)
-            sub->rc.coding_mode = CODING_MODE_RICE2;
-        else
-            sub->rc.coding_mode = CODING_MODE_RICE;
-    }
-
-    frame->verbatim_only = 0;
-}
-
-
-/**
- * Copy channel-interleaved input samples into separate subframes.
- */
-static void copy_samples(FlacEncodeContext *s, const void *samples)
-{
-    int i, j, ch;
-    FlacFrame *frame;
-    int shift = av_get_bytes_per_sample(s->avctx->sample_fmt) * 8 -
-                s->avctx->bits_per_raw_sample;
-
-#define COPY_SAMPLES(bits) do {                                     \
-    const int ## bits ## _t *samples0 = samples;                    \
-    frame = &s->frame;                                              \
-    for (i = 0, j = 0; i < frame->blocksize; i++)                   \
-        for (ch = 0; ch < s->channels; ch++, j++)                   \
-            frame->subframes[ch].samples[i] = samples0[j] >> shift; \
-} while (0)
-
-    if (s->avctx->sample_fmt == AV_SAMPLE_FMT_S16)
-        COPY_SAMPLES(16);
-    else
-        COPY_SAMPLES(32);
-}
-
-
-static uint64_t rice_count_exact(int32_t *res, int n, int k)
-{
-    int i;
-    uint64_t count = 0;
-
-    for (i = 0; i < n; i++) {
-        int32_t v = -2 * res[i] - 1;
-        v ^= v >> 31;
-        count += (v >> k) + 1 + k;
-    }
-    return count;
-}
-
-
-static uint64_t subframe_count_exact(FlacEncodeContext *s, FlacSubframe *sub,
-                                     int pred_order)
-{
-    int p, porder, psize;
-    int i, part_end;
-    uint64_t count = 0;
-
-    /* subframe header */
-    count += 8;
-
-    /* subframe */
-    if (sub->type == FLAC_SUBFRAME_CONSTANT) {
-        count += sub->obits;
-    } else if (sub->type == FLAC_SUBFRAME_VERBATIM) {
-        count += s->frame.blocksize * sub->obits;
-    } else {
-        /* warm-up samples */
-        count += pred_order * sub->obits;
-
-        /* LPC coefficients */
-        if (sub->type == FLAC_SUBFRAME_LPC)
-            count += 4 + 5 + pred_order * s->options.lpc_coeff_precision;
-
-        /* rice-encoded block */
-        count += 2;
-
-        /* partition order */
-        porder = sub->rc.porder;
-        psize  = s->frame.blocksize >> porder;
-        count += 4;
-
-        /* residual */
-        i        = pred_order;
-        part_end = psize;
-        for (p = 0; p < 1 << porder; p++) {
-            int k = sub->rc.params[p];
-            count += sub->rc.coding_mode;
-            count += rice_count_exact(&sub->residual[i], part_end - i, k);
-            i = part_end;
-            part_end = FFMIN(s->frame.blocksize, part_end + psize);
-        }
-    }
-
-    return count;
-}
-
-
-#define rice_encode_count(sum, n, k) (((n)*((k)+1))+((sum-(n>>1))>>(k)))
-
-/**
- * Solve for d/dk(rice_encode_count) = n-((sum-(n>>1))>>(k+1)) = 0.
- */
-static int find_optimal_param(uint64_t sum, int n, int max_param)
-{
-    int k;
-    uint64_t sum2;
-
-    if (sum <= n >> 1)
-        return 0;
-    sum2 = sum - (n >> 1);
-    k    = av_log2(av_clipl_int32(sum2 / n));
-    return FFMIN(k, max_param);
-}
-
-
-static uint64_t calc_optimal_rice_params(RiceContext *rc, int porder,
-                                         uint64_t *sums, int n, int pred_order)
-{
-    int i;
-    int k, cnt, part, max_param;
-    uint64_t all_bits;
-
-    max_param = (1 << rc->coding_mode) - 2;
-
-    part     = (1 << porder);
-    all_bits = 4 * part;
-
-    cnt = (n >> porder) - pred_order;
-    for (i = 0; i < part; i++) {
-        k = find_optimal_param(sums[i], cnt, max_param);
-        rc->params[i] = k;
-        all_bits += rice_encode_count(sums[i], cnt, k);
-        cnt = n >> porder;
-    }
-
-    rc->porder = porder;
-
-    return all_bits;
-}
-
-
-static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order,
-                      uint64_t sums[][MAX_PARTITIONS])
-{
-    int i, j;
-    int parts;
-    uint32_t *res, *res_end;
-
-    /* sums for highest level */
-    parts   = (1 << pmax);
-    res     = &data[pred_order];
-    res_end = &data[n >> pmax];
-    for (i = 0; i < parts; i++) {
-        uint64_t sum = 0;
-        while (res < res_end)
-            sum += *(res++);
-        sums[pmax][i] = sum;
-        res_end += n >> pmax;
-    }
-    /* sums for lower levels */
-    for (i = pmax - 1; i >= pmin; i--) {
-        parts = (1 << i);
-        for (j = 0; j < parts; j++)
-            sums[i][j] = sums[i+1][2*j] + sums[i+1][2*j+1];
-    }
-}
-
-
-static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax,
-                                 int32_t *data, int n, int pred_order)
-{
-    int i;
-    uint64_t bits[MAX_PARTITION_ORDER+1];
-    int opt_porder;
-    RiceContext tmp_rc;
-    uint32_t *udata;
-    uint64_t sums[MAX_PARTITION_ORDER+1][MAX_PARTITIONS];
-
-    assert(pmin >= 0 && pmin <= MAX_PARTITION_ORDER);
-    assert(pmax >= 0 && pmax <= MAX_PARTITION_ORDER);
-    assert(pmin <= pmax);
-
-    tmp_rc.coding_mode = rc->coding_mode;
-
-    udata = av_malloc(n * sizeof(uint32_t));
-    for (i = 0; i < n; i++)
-        udata[i] = (2*data[i]) ^ (data[i]>>31);
-
-    calc_sums(pmin, pmax, udata, n, pred_order, sums);
-
-    opt_porder = pmin;
-    bits[pmin] = UINT32_MAX;
-    for (i = pmin; i <= pmax; i++) {
-        bits[i] = calc_optimal_rice_params(&tmp_rc, i, sums[i], n, pred_order);
-        if (bits[i] <= bits[opt_porder]) {
-            opt_porder = i;
-            *rc = tmp_rc;
-        }
-    }
-
-    av_freep(&udata);
-    return bits[opt_porder];
-}
-
-
-static int get_max_p_order(int max_porder, int n, int order)
-{
-    int porder = FFMIN(max_porder, av_log2(n^(n-1)));
-    if (order > 0)
-        porder = FFMIN(porder, av_log2(n/order));
-    return porder;
-}
-
-
-static uint64_t find_subframe_rice_params(FlacEncodeContext *s,
-                                          FlacSubframe *sub, int pred_order)
-{
-    int pmin = get_max_p_order(s->options.min_partition_order,
-                               s->frame.blocksize, pred_order);
-    int pmax = get_max_p_order(s->options.max_partition_order,
-                               s->frame.blocksize, pred_order);
-
-    uint64_t bits = 8 + pred_order * sub->obits + 2 + sub->rc.coding_mode;
-    if (sub->type == FLAC_SUBFRAME_LPC)
-        bits += 4 + 5 + pred_order * s->options.lpc_coeff_precision;
-    bits += calc_rice_params(&sub->rc, pmin, pmax, sub->residual,
-                             s->frame.blocksize, pred_order);
-    return bits;
-}
-
-
-static void encode_residual_fixed(int32_t *res, const int32_t *smp, int n,
-                                  int order)
-{
-    int i;
-
-    for (i = 0; i < order; i++)
-        res[i] = smp[i];
-
-    if (order == 0) {
-        for (i = order; i < n; i++)
-            res[i] = smp[i];
-    } else if (order == 1) {
-        for (i = order; i < n; i++)
-            res[i] = smp[i] - smp[i-1];
-    } else if (order == 2) {
-        int a = smp[order-1] - smp[order-2];
-        for (i = order; i < n; i += 2) {
-            int b    = smp[i  ] - smp[i-1];
-            res[i]   = b - a;
-            a        = smp[i+1] - smp[i  ];
-            res[i+1] = a - b;
-        }
-    } else if (order == 3) {
-        int a = smp[order-1] -   smp[order-2];
-        int c = smp[order-1] - 2*smp[order-2] + smp[order-3];
-        for (i = order; i < n; i += 2) {
-            int b    = smp[i  ] - smp[i-1];
-            int d    = b - a;
-            res[i]   = d - c;
-            a        = smp[i+1] - smp[i  ];
-            c        = a - b;
-            res[i+1] = c - d;
-        }
-    } else {
-        int a = smp[order-1] -   smp[order-2];
-        int c = smp[order-1] - 2*smp[order-2] +   smp[order-3];
-        int e = smp[order-1] - 3*smp[order-2] + 3*smp[order-3] - smp[order-4];
-        for (i = order; i < n; i += 2) {
-            int b    = smp[i  ] - smp[i-1];
-            int d    = b - a;
-            int f    = d - c;
-            res[i  ] = f - e;
-            a        = smp[i+1] - smp[i  ];
-            c        = a - b;
-            e        = c - d;
-            res[i+1] = e - f;
-        }
-    }
-}
-
-
-static int encode_residual_ch(FlacEncodeContext *s, int ch)
-{
-    int i, n;
-    int min_order, max_order, opt_order, omethod;
-    FlacFrame *frame;
-    FlacSubframe *sub;
-    int32_t coefs[MAX_LPC_ORDER][MAX_LPC_ORDER];
-    int shift[MAX_LPC_ORDER];
-    int32_t *res, *smp;
-
-    frame = &s->frame;
-    sub   = &frame->subframes[ch];
-    res   = sub->residual;
-    smp   = sub->samples;
-    n     = frame->blocksize;
-
-    /* CONSTANT */
-    for (i = 1; i < n; i++)
-        if(smp[i] != smp[0])
-            break;
-    if (i == n) {
-        sub->type = sub->type_code = FLAC_SUBFRAME_CONSTANT;
-        res[0] = smp[0];
-        return subframe_count_exact(s, sub, 0);
-    }
-
-    /* VERBATIM */
-    if (frame->verbatim_only || n < 5) {
-        sub->type = sub->type_code = FLAC_SUBFRAME_VERBATIM;
-        memcpy(res, smp, n * sizeof(int32_t));
-        return subframe_count_exact(s, sub, 0);
-    }
-
-    min_order  = s->options.min_prediction_order;
-    max_order  = s->options.max_prediction_order;
-    omethod    = s->options.prediction_order_method;
-
-    /* FIXED */
-    sub->type = FLAC_SUBFRAME_FIXED;
-    if (s->options.lpc_type == FF_LPC_TYPE_NONE  ||
-        s->options.lpc_type == FF_LPC_TYPE_FIXED || n <= max_order) {
-        uint64_t bits[MAX_FIXED_ORDER+1];
-        if (max_order > MAX_FIXED_ORDER)
-            max_order = MAX_FIXED_ORDER;
-        opt_order = 0;
-        bits[0]   = UINT32_MAX;
-        for (i = min_order; i <= max_order; i++) {
-            encode_residual_fixed(res, smp, n, i);
-            bits[i] = find_subframe_rice_params(s, sub, i);
-            if (bits[i] < bits[opt_order])
-                opt_order = i;
-        }
-        sub->order     = opt_order;
-        sub->type_code = sub->type | sub->order;
-        if (sub->order != max_order) {
-            encode_residual_fixed(res, smp, n, sub->order);
-            find_subframe_rice_params(s, sub, sub->order);
-        }
-        return subframe_count_exact(s, sub, sub->order);
-    }
-
-    /* LPC */
-    sub->type = FLAC_SUBFRAME_LPC;
-    opt_order = ff_lpc_calc_coefs(&s->lpc_ctx, smp, n, min_order, max_order,
-                                  s->options.lpc_coeff_precision, coefs, shift, s->options.lpc_type,
-                                  s->options.lpc_passes, omethod,
-                                  MAX_LPC_SHIFT, 0);
-
-    if (omethod == ORDER_METHOD_2LEVEL ||
-        omethod == ORDER_METHOD_4LEVEL ||
-        omethod == ORDER_METHOD_8LEVEL) {
-        int levels = 1 << omethod;
-        uint64_t bits[1 << ORDER_METHOD_8LEVEL];
-        int order       = -1;
-        int opt_index   = levels-1;
-        opt_order       = max_order-1;
-        bits[opt_index] = UINT32_MAX;
-        for (i = levels-1; i >= 0; i--) {
-            int last_order = order;
-            order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1;
-            order = av_clip(order, min_order - 1, max_order - 1);
-            if (order == last_order)
-                continue;
-            s->flac_dsp.lpc_encode(res, smp, n, order+1, coefs[order],
-                                   shift[order]);
-            bits[i] = find_subframe_rice_params(s, sub, order+1);
-            if (bits[i] < bits[opt_index]) {
-                opt_index = i;
-                opt_order = order;
-            }
-        }
-        opt_order++;
-    } else if (omethod == ORDER_METHOD_SEARCH) {
-        // brute-force optimal order search
-        uint64_t bits[MAX_LPC_ORDER];
-        opt_order = 0;
-        bits[0]   = UINT32_MAX;
-        for (i = min_order-1; i < max_order; i++) {
-            s->flac_dsp.lpc_encode(res, smp, n, i+1, coefs[i], shift[i]);
-            bits[i] = find_subframe_rice_params(s, sub, i+1);
-            if (bits[i] < bits[opt_order])
-                opt_order = i;
-        }
-        opt_order++;
-    } else if (omethod == ORDER_METHOD_LOG) {
-        uint64_t bits[MAX_LPC_ORDER];
-        int step;
-
-        opt_order = min_order - 1 + (max_order-min_order)/3;
-        memset(bits, -1, sizeof(bits));
-
-        for (step = 16; step; step >>= 1) {
-            int last = opt_order;
-            for (i = last-step; i <= last+step; i += step) {
-                if (i < min_order-1 || i >= max_order || bits[i] < UINT32_MAX)
-                    continue;
-                s->flac_dsp.lpc_encode(res, smp, n, i+1, coefs[i], shift[i]);
-                bits[i] = find_subframe_rice_params(s, sub, i+1);
-                if (bits[i] < bits[opt_order])
-                    opt_order = i;
-            }
-        }
-        opt_order++;
-    }
-
-    sub->order     = opt_order;
-    sub->type_code = sub->type | (sub->order-1);
-    sub->shift     = shift[sub->order-1];
-    for (i = 0; i < sub->order; i++)
-        sub->coefs[i] = coefs[sub->order-1][i];
-
-    s->flac_dsp.lpc_encode(res, smp, n, sub->order, sub->coefs, sub->shift);
-
-    find_subframe_rice_params(s, sub, sub->order);
-
-    return subframe_count_exact(s, sub, sub->order);
-}
-
-
-static int count_frame_header(FlacEncodeContext *s)
-{
-    uint8_t av_unused tmp;
-    int count;
-
-    /*
-    <14> Sync code
-    <1>  Reserved
-    <1>  Blocking strategy
-    <4>  Block size in inter-channel samples
-    <4>  Sample rate
-    <4>  Channel assignment
-    <3>  Sample size in bits
-    <1>  Reserved
-    */
-    count = 32;
-
-    /* coded frame number */
-    PUT_UTF8(s->frame_count, tmp, count += 8;)
-
-    /* explicit block size */
-    if (s->frame.bs_code[0] == 6)
-        count += 8;
-    else if (s->frame.bs_code[0] == 7)
-        count += 16;
-
-    /* explicit sample rate */
-    count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12)) * 8;
-
-    /* frame header CRC-8 */
-    count += 8;
-
-    return count;
-}
-
-
-static int encode_frame(FlacEncodeContext *s)
-{
-    int ch;
-    uint64_t count;
-
-    count = count_frame_header(s);
-
-    for (ch = 0; ch < s->channels; ch++)
-        count += encode_residual_ch(s, ch);
-
-    count += (8 - (count & 7)) & 7; // byte alignment
-    count += 16;                    // CRC-16
-
-    count >>= 3;
-    if (count > INT_MAX)
-        return AVERROR_BUG;
-    return count;
-}
-
-
-static void remove_wasted_bits(FlacEncodeContext *s)
-{
-    int ch, i;
-
-    for (ch = 0; ch < s->channels; ch++) {
-        FlacSubframe *sub = &s->frame.subframes[ch];
-        int32_t v         = 0;
-
-        for (i = 0; i < s->frame.blocksize; i++) {
-            v |= sub->samples[i];
-            if (v & 1)
-                break;
-        }
-
-        if (v && !(v & 1)) {
-            v = av_ctz(v);
-
-            for (i = 0; i < s->frame.blocksize; i++)
-                sub->samples[i] >>= v;
-
-            sub->wasted = v;
-            sub->obits -= v;
-
-            /* for 24-bit, check if removing wasted bits makes the range better
-               suited for using RICE instead of RICE2 for entropy coding */
-            if (sub->obits <= 17)
-                sub->rc.coding_mode = CODING_MODE_RICE;
-        }
-    }
-}
-
-
-static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n,
-                                int max_rice_param)
-{
-    int i, best;
-    int32_t lt, rt;
-    uint64_t sum[4];
-    uint64_t score[4];
-    int k;
-
-    /* calculate sum of 2nd order residual for each channel */
-    sum[0] = sum[1] = sum[2] = sum[3] = 0;
-    for (i = 2; i < n; i++) {
-        lt = left_ch[i]  - 2*left_ch[i-1]  + left_ch[i-2];
-        rt = right_ch[i] - 2*right_ch[i-1] + right_ch[i-2];
-        sum[2] += FFABS((lt + rt) >> 1);
-        sum[3] += FFABS(lt - rt);
-        sum[0] += FFABS(lt);
-        sum[1] += FFABS(rt);
-    }
-    /* estimate bit counts */
-    for (i = 0; i < 4; i++) {
-        k      = find_optimal_param(2 * sum[i], n, max_rice_param);
-        sum[i] = rice_encode_count( 2 * sum[i], n, k);
-    }
-
-    /* calculate score for each mode */
-    score[0] = sum[0] + sum[1];
-    score[1] = sum[0] + sum[3];
-    score[2] = sum[1] + sum[3];
-    score[3] = sum[2] + sum[3];
-
-    /* return mode with lowest score */
-    best = 0;
-    for (i = 1; i < 4; i++)
-        if (score[i] < score[best])
-            best = i;
-
-    return best;
-}
-
-
-/**
- * Perform stereo channel decorrelation.
- */
-static void channel_decorrelation(FlacEncodeContext *s)
-{
-    FlacFrame *frame;
-    int32_t *left, *right;
-    int i, n;
-
-    frame = &s->frame;
-    n     = frame->blocksize;
-    left  = frame->subframes[0].samples;
-    right = frame->subframes[1].samples;
-
-    if (s->channels != 2) {
-        frame->ch_mode = FLAC_CHMODE_INDEPENDENT;
-        return;
-    }
-
-    if (s->options.ch_mode < 0) {
-        int max_rice_param = (1 << frame->subframes[0].rc.coding_mode) - 2;
-        frame->ch_mode = estimate_stereo_mode(left, right, n, max_rice_param);
-    } else
-        frame->ch_mode = s->options.ch_mode;
-
-    /* perform decorrelation and adjust bits-per-sample */
-    if (frame->ch_mode == FLAC_CHMODE_INDEPENDENT)
-        return;
-    if (frame->ch_mode == FLAC_CHMODE_MID_SIDE) {
-        int32_t tmp;
-        for (i = 0; i < n; i++) {
-            tmp      = left[i];
-            left[i]  = (tmp + right[i]) >> 1;
-            right[i] =  tmp - right[i];
-        }
-        frame->subframes[1].obits++;
-    } else if (frame->ch_mode == FLAC_CHMODE_LEFT_SIDE) {
-        for (i = 0; i < n; i++)
-            right[i] = left[i] - right[i];
-        frame->subframes[1].obits++;
-    } else {
-        for (i = 0; i < n; i++)
-            left[i] -= right[i];
-        frame->subframes[0].obits++;
-    }
-}
-
-
-static void write_utf8(PutBitContext *pb, uint32_t val)
-{
-    uint8_t tmp;
-    PUT_UTF8(val, tmp, put_bits(pb, 8, tmp);)
-}
-
-
-static void write_frame_header(FlacEncodeContext *s)
-{
-    FlacFrame *frame;
-    int crc;
-
-    frame = &s->frame;
-
-    put_bits(&s->pb, 16, 0xFFF8);
-    put_bits(&s->pb, 4, frame->bs_code[0]);
-    put_bits(&s->pb, 4, s->sr_code[0]);
-
-    if (frame->ch_mode == FLAC_CHMODE_INDEPENDENT)
-        put_bits(&s->pb, 4, s->channels-1);
-    else
-        put_bits(&s->pb, 4, frame->ch_mode + FLAC_MAX_CHANNELS - 1);
-
-    put_bits(&s->pb, 3, s->bps_code);
-    put_bits(&s->pb, 1, 0);
-    write_utf8(&s->pb, s->frame_count);
-
-    if (frame->bs_code[0] == 6)
-        put_bits(&s->pb, 8, frame->bs_code[1]);
-    else if (frame->bs_code[0] == 7)
-        put_bits(&s->pb, 16, frame->bs_code[1]);
-
-    if (s->sr_code[0] == 12)
-        put_bits(&s->pb, 8, s->sr_code[1]);
-    else if (s->sr_code[0] > 12)
-        put_bits(&s->pb, 16, s->sr_code[1]);
-
-    flush_put_bits(&s->pb);
-    crc = av_crc(av_crc_get_table(AV_CRC_8_ATM), 0, s->pb.buf,
-                 put_bits_count(&s->pb) >> 3);
-    put_bits(&s->pb, 8, crc);
-}
-
-
-static void write_subframes(FlacEncodeContext *s)
-{
-    int ch;
-
-    for (ch = 0; ch < s->channels; ch++) {
-        FlacSubframe *sub = &s->frame.subframes[ch];
-        int i, p, porder, psize;
-        int32_t *part_end;
-        int32_t *res       =  sub->residual;
-        int32_t *frame_end = &sub->residual[s->frame.blocksize];
-
-        /* subframe header */
-        put_bits(&s->pb, 1, 0);
-        put_bits(&s->pb, 6, sub->type_code);
-        put_bits(&s->pb, 1, !!sub->wasted);
-        if (sub->wasted)
-            put_bits(&s->pb, sub->wasted, 1);
-
-        /* subframe */
-        if (sub->type == FLAC_SUBFRAME_CONSTANT) {
-            put_sbits(&s->pb, sub->obits, res[0]);
-        } else if (sub->type == FLAC_SUBFRAME_VERBATIM) {
-            while (res < frame_end)
-                put_sbits(&s->pb, sub->obits, *res++);
-        } else {
-            /* warm-up samples */
-            for (i = 0; i < sub->order; i++)
-                put_sbits(&s->pb, sub->obits, *res++);
-
-            /* LPC coefficients */
-            if (sub->type == FLAC_SUBFRAME_LPC) {
-                int cbits = s->options.lpc_coeff_precision;
-                put_bits( &s->pb, 4, cbits-1);
-                put_sbits(&s->pb, 5, sub->shift);
-                for (i = 0; i < sub->order; i++)
-                    put_sbits(&s->pb, cbits, sub->coefs[i]);
-            }
-
-            /* rice-encoded block */
-            put_bits(&s->pb, 2, sub->rc.coding_mode - 4);
-
-            /* partition order */
-            porder  = sub->rc.porder;
-            psize   = s->frame.blocksize >> porder;
-            put_bits(&s->pb, 4, porder);
-
-            /* residual */
-            part_end  = &sub->residual[psize];
-            for (p = 0; p < 1 << porder; p++) {
-                int k = sub->rc.params[p];
-                put_bits(&s->pb, sub->rc.coding_mode, k);
-                while (res < part_end)
-                    set_sr_golomb_flac(&s->pb, *res++, k, INT32_MAX, 0);
-                part_end = FFMIN(frame_end, part_end + psize);
-            }
-        }
-    }
-}
-
-
-static void write_frame_footer(FlacEncodeContext *s)
-{
-    int crc;
-    flush_put_bits(&s->pb);
-    crc = av_bswap16(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, s->pb.buf,
-                            put_bits_count(&s->pb)>>3));
-    put_bits(&s->pb, 16, crc);
-    flush_put_bits(&s->pb);
-}
-
-
-static int write_frame(FlacEncodeContext *s, AVPacket *avpkt)
-{
-    init_put_bits(&s->pb, avpkt->data, avpkt->size);
-    write_frame_header(s);
-    write_subframes(s);
-    write_frame_footer(s);
-    return put_bits_count(&s->pb) >> 3;
-}
-
-
-static int update_md5_sum(FlacEncodeContext *s, const void *samples)
-{
-    const uint8_t *buf;
-    int buf_size = s->frame.blocksize * s->channels *
-                   ((s->avctx->bits_per_raw_sample + 7) / 8);
-
-    if (s->avctx->bits_per_raw_sample > 16 || HAVE_BIGENDIAN) {
-        av_fast_malloc(&s->md5_buffer, &s->md5_buffer_size, buf_size);
-        if (!s->md5_buffer)
-            return AVERROR(ENOMEM);
-    }
-
-    if (s->avctx->bits_per_raw_sample <= 16) {
-        buf = (const uint8_t *)samples;
-#if HAVE_BIGENDIAN
-        s->dsp.bswap16_buf((uint16_t *)s->md5_buffer,
-                           (const uint16_t *)samples, buf_size / 2);
-        buf = s->md5_buffer;
-#endif
-    } else {
-        int i;
-        const int32_t *samples0 = samples;
-        uint8_t *tmp            = s->md5_buffer;
-
-        for (i = 0; i < s->frame.blocksize * s->channels; i++) {
-            int32_t v = samples0[i] >> 8;
-            *tmp++    = (v      ) & 0xFF;
-            *tmp++    = (v >>  8) & 0xFF;
-            *tmp++    = (v >> 16) & 0xFF;
-        }
-        buf = s->md5_buffer;
-    }
-    av_md5_update(s->md5ctx, buf, buf_size);
-
-    return 0;
-}
-
-
-static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                             const AVFrame *frame, int *got_packet_ptr)
-{
-    FlacEncodeContext *s;
-    int frame_bytes, out_bytes, ret;
-
-    s = avctx->priv_data;
-
-    /* when the last block is reached, update the header in extradata */
-    if (!frame) {
-        s->max_framesize = s->max_encoded_framesize;
-        av_md5_final(s->md5ctx, s->md5sum);
-        write_streaminfo(s, avctx->extradata);
-        return 0;
-    }
-
-    /* change max_framesize for small final frame */
-    if (frame->nb_samples < s->frame.blocksize) {
-        s->max_framesize = ff_flac_get_max_frame_size(frame->nb_samples,
-                                                      s->channels,
-                                                      avctx->bits_per_raw_sample);
-    }
-
-    init_frame(s, frame->nb_samples);
-
-    copy_samples(s, frame->data[0]);
-
-    channel_decorrelation(s);
-
-    remove_wasted_bits(s);
-
-    frame_bytes = encode_frame(s);
-
-    /* Fall back on verbatim mode if the compressed frame is larger than it
-       would be if encoded uncompressed. */
-    if (frame_bytes < 0 || frame_bytes > s->max_framesize) {
-        s->frame.verbatim_only = 1;
-        frame_bytes = encode_frame(s);
-        if (frame_bytes < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Bad frame count\n");
-            return frame_bytes;
-        }
-    }
-
-    if ((ret = ff_alloc_packet(avpkt, frame_bytes))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    out_bytes = write_frame(s, avpkt);
-
-    s->frame_count++;
-    s->sample_count += frame->nb_samples;
-    if ((ret = update_md5_sum(s, frame->data[0])) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error updating MD5 checksum\n");
-        return ret;
-    }
-    if (out_bytes > s->max_encoded_framesize)
-        s->max_encoded_framesize = out_bytes;
-    if (out_bytes < s->min_framesize)
-        s->min_framesize = out_bytes;
-
-    avpkt->pts      = frame->pts;
-    avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
-    avpkt->size     = out_bytes;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-
-static av_cold int flac_encode_close(AVCodecContext *avctx)
-{
-    if (avctx->priv_data) {
-        FlacEncodeContext *s = avctx->priv_data;
-        av_freep(&s->md5ctx);
-        av_freep(&s->md5_buffer);
-        ff_lpc_end(&s->lpc_ctx);
-    }
-    av_freep(&avctx->extradata);
-    avctx->extradata_size = 0;
-    return 0;
-}
-
-#define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
-{ "lpc_coeff_precision", "LPC coefficient precision", offsetof(FlacEncodeContext, options.lpc_coeff_precision), AV_OPT_TYPE_INT, {.i64 = 15 }, 0, MAX_LPC_PRECISION, FLAGS },
-{ "lpc_type", "LPC algorithm", offsetof(FlacEncodeContext, options.lpc_type), AV_OPT_TYPE_INT, {.i64 = FF_LPC_TYPE_DEFAULT }, FF_LPC_TYPE_DEFAULT, FF_LPC_TYPE_NB-1, FLAGS, "lpc_type" },
-{ "none",     NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_NONE },     INT_MIN, INT_MAX, FLAGS, "lpc_type" },
-{ "fixed",    NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_FIXED },    INT_MIN, INT_MAX, FLAGS, "lpc_type" },
-{ "levinson", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_LEVINSON }, INT_MIN, INT_MAX, FLAGS, "lpc_type" },
-{ "cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_CHOLESKY }, INT_MIN, INT_MAX, FLAGS, "lpc_type" },
-{ "lpc_passes", "Number of passes to use for Cholesky factorization during LPC analysis", offsetof(FlacEncodeContext, options.lpc_passes),  AV_OPT_TYPE_INT, {.i64 = 1 }, 1, INT_MAX, FLAGS },
-{ "min_partition_order",  NULL, offsetof(FlacEncodeContext, options.min_partition_order),  AV_OPT_TYPE_INT, {.i64 = -1 },      -1, MAX_PARTITION_ORDER, FLAGS },
-{ "max_partition_order",  NULL, offsetof(FlacEncodeContext, options.max_partition_order),  AV_OPT_TYPE_INT, {.i64 = -1 },      -1, MAX_PARTITION_ORDER, FLAGS },
-{ "prediction_order_method", "Search method for selecting prediction order", offsetof(FlacEncodeContext, options.prediction_order_method), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, ORDER_METHOD_LOG, FLAGS, "predm" },
-{ "estimation", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_EST },    INT_MIN, INT_MAX, FLAGS, "predm" },
-{ "2level",     NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_2LEVEL }, INT_MIN, INT_MAX, FLAGS, "predm" },
-{ "4level",     NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_4LEVEL }, INT_MIN, INT_MAX, FLAGS, "predm" },
-{ "8level",     NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_8LEVEL }, INT_MIN, INT_MAX, FLAGS, "predm" },
-{ "search",     NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_SEARCH }, INT_MIN, INT_MAX, FLAGS, "predm" },
-{ "log",        NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_LOG },    INT_MIN, INT_MAX, FLAGS, "predm" },
-{ "ch_mode", "Stereo decorrelation mode", offsetof(FlacEncodeContext, options.ch_mode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, FLAC_CHMODE_MID_SIDE, FLAGS, "ch_mode" },
-{ "auto",       NULL, 0, AV_OPT_TYPE_CONST, { .i64 = -1                      }, INT_MIN, INT_MAX, FLAGS, "ch_mode" },
-{ "indep",      NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FLAC_CHMODE_INDEPENDENT }, INT_MIN, INT_MAX, FLAGS, "ch_mode" },
-{ "left_side",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FLAC_CHMODE_LEFT_SIDE   }, INT_MIN, INT_MAX, FLAGS, "ch_mode" },
-{ "right_side", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FLAC_CHMODE_RIGHT_SIDE  }, INT_MIN, INT_MAX, FLAGS, "ch_mode" },
-{ "mid_side",   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FLAC_CHMODE_MID_SIDE    }, INT_MIN, INT_MAX, FLAGS, "ch_mode" },
-{ NULL },
-};
-
-static const AVClass flac_encoder_class = {
-    "FLAC encoder",
-    av_default_item_name,
-    options,
-    LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_flac_encoder = {
-    .name           = "flac",
-    .long_name      = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_FLAC,
-    .priv_data_size = sizeof(FlacEncodeContext),
-    .init           = flac_encode_init,
-    .encode2        = flac_encode_frame,
-    .close          = flac_encode_close,
-    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_S32,
-                                                     AV_SAMPLE_FMT_NONE },
-    .priv_class     = &flac_encoder_class,
-};
diff --git a/deps/libav/libavcodec/flashsv.c b/deps/libav/libavcodec/flashsv.c
deleted file mode 100644
index de7979c..0000000
--- a/deps/libav/libavcodec/flashsv.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- * Flash Screen Video decoder
- * Copyright (C) 2004 Alex Beregszaszi
- * Copyright (C) 2006 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Flash Screen Video decoder
- * @author Alex Beregszaszi
- * @author Benjamin Larsson
- * @author Daniel Verkamp
- * @author Konstantin Shishkov
- *
- * A description of the bitstream format for Flash Screen Video version 1/2
- * is part of the SWF File Format Specification (version 10), which can be
- * downloaded from http://www.adobe.com/devnet/swf.html.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <zlib.h>
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "get_bits.h"
-#include "internal.h"
-
-typedef struct BlockInfo {
-    uint8_t *pos;
-    int      size;
-} BlockInfo;
-
-typedef struct FlashSVContext {
-    AVCodecContext *avctx;
-    AVFrame        *frame;
-    int             image_width, image_height;
-    int             block_width, block_height;
-    uint8_t        *tmpblock;
-    int             block_size;
-    z_stream        zstream;
-    int             ver;
-    const uint32_t *pal;
-    int             is_keyframe;
-    uint8_t        *keyframedata;
-    uint8_t        *keyframe;
-    BlockInfo      *blocks;
-    uint8_t        *deflate_block;
-    int             deflate_block_size;
-    int             color_depth;
-    int             zlibprime_curr, zlibprime_prev;
-    int             diff_start, diff_height;
-} FlashSVContext;
-
-static int decode_hybrid(const uint8_t *sptr, uint8_t *dptr, int dx, int dy,
-                         int h, int w, int stride, const uint32_t *pal)
-{
-    int x, y;
-    const uint8_t *orig_src = sptr;
-
-    for (y = dx + h; y > dx; y--) {
-        uint8_t *dst = dptr + (y * stride) + dy * 3;
-        for (x = 0; x < w; x++) {
-            if (*sptr & 0x80) {
-                /* 15-bit color */
-                unsigned c = AV_RB16(sptr) & ~0x8000;
-                unsigned b =  c        & 0x1F;
-                unsigned g = (c >>  5) & 0x1F;
-                unsigned r =  c >> 10;
-                /* 000aaabb -> aaabbaaa  */
-                *dst++ = (b << 3) | (b >> 2);
-                *dst++ = (g << 3) | (g >> 2);
-                *dst++ = (r << 3) | (r >> 2);
-                sptr += 2;
-            } else {
-                /* palette index */
-                uint32_t c = pal[*sptr++];
-                bytestream_put_le24(&dst, c);
-            }
-        }
-    }
-    return sptr - orig_src;
-}
-
-static av_cold int flashsv_decode_end(AVCodecContext *avctx)
-{
-    FlashSVContext *s = avctx->priv_data;
-    inflateEnd(&s->zstream);
-    /* release the frame if needed */
-    av_frame_free(&s->frame);
-
-    /* free the tmpblock */
-    av_free(s->tmpblock);
-
-    return 0;
-}
-
-static av_cold int flashsv_decode_init(AVCodecContext *avctx)
-{
-    FlashSVContext *s = avctx->priv_data;
-    int zret; // Zlib return code
-
-    s->avctx          = avctx;
-    s->zstream.zalloc = Z_NULL;
-    s->zstream.zfree  = Z_NULL;
-    s->zstream.opaque = Z_NULL;
-    zret = inflateInit(&s->zstream);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
-        return 1;
-    }
-    avctx->pix_fmt = AV_PIX_FMT_BGR24;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame) {
-        flashsv_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static int flashsv2_prime(FlashSVContext *s, uint8_t *src, int size)
-{
-    z_stream zs;
-    int zret; // Zlib return code
-
-    zs.zalloc = NULL;
-    zs.zfree  = NULL;
-    zs.opaque = NULL;
-
-    s->zstream.next_in   = src;
-    s->zstream.avail_in  = size;
-    s->zstream.next_out  = s->tmpblock;
-    s->zstream.avail_out = s->block_size * 3;
-    inflate(&s->zstream, Z_SYNC_FLUSH);
-
-    deflateInit(&zs, 0);
-    zs.next_in   = s->tmpblock;
-    zs.avail_in  = s->block_size * 3 - s->zstream.avail_out;
-    zs.next_out  = s->deflate_block;
-    zs.avail_out = s->deflate_block_size;
-    deflate(&zs, Z_SYNC_FLUSH);
-    deflateEnd(&zs);
-
-    if ((zret = inflateReset(&s->zstream)) != Z_OK) {
-        av_log(s->avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
-        return AVERROR_UNKNOWN;
-    }
-
-    s->zstream.next_in   = s->deflate_block;
-    s->zstream.avail_in  = s->deflate_block_size - zs.avail_out;
-    s->zstream.next_out  = s->tmpblock;
-    s->zstream.avail_out = s->block_size * 3;
-    inflate(&s->zstream, Z_SYNC_FLUSH);
-
-    return 0;
-}
-
-static int flashsv_decode_block(AVCodecContext *avctx, AVPacket *avpkt,
-                                GetBitContext *gb, int block_size,
-                                int width, int height, int x_pos, int y_pos,
-                                int blk_idx)
-{
-    struct FlashSVContext *s = avctx->priv_data;
-    uint8_t *line = s->tmpblock;
-    int k;
-    int ret = inflateReset(&s->zstream);
-    if (ret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", ret);
-        return AVERROR_UNKNOWN;
-    }
-    if (s->zlibprime_curr || s->zlibprime_prev) {
-        ret = flashsv2_prime(s,
-                             s->blocks[blk_idx].pos,
-                             s->blocks[blk_idx].size);
-        if (ret < 0)
-            return ret;
-    }
-    s->zstream.next_in   = avpkt->data + get_bits_count(gb) / 8;
-    s->zstream.avail_in  = block_size;
-    s->zstream.next_out  = s->tmpblock;
-    s->zstream.avail_out = s->block_size * 3;
-    ret = inflate(&s->zstream, Z_FINISH);
-    if (ret == Z_DATA_ERROR) {
-        av_log(avctx, AV_LOG_ERROR, "Zlib resync occurred\n");
-        inflateSync(&s->zstream);
-        ret = inflate(&s->zstream, Z_FINISH);
-    }
-
-    if (ret != Z_OK && ret != Z_STREAM_END) {
-        //return -1;
-    }
-
-    if (s->is_keyframe) {
-        s->blocks[blk_idx].pos  = s->keyframedata + (get_bits_count(gb) / 8);
-        s->blocks[blk_idx].size = block_size;
-    }
-
-    y_pos += s->diff_start;
-
-    if (!s->color_depth) {
-        /* Flash Screen Video stores the image upside down, so copy
-         * lines to destination in reverse order. */
-        for (k = 1; k <= s->diff_height; k++) {
-            memcpy(s->frame->data[0] + x_pos * 3 +
-                   (s->image_height - y_pos - k) * s->frame->linesize[0],
-                   line, width * 3);
-            /* advance source pointer to next line */
-            line += width * 3;
-        }
-    } else {
-        /* hybrid 15-bit/palette mode */
-        decode_hybrid(s->tmpblock, s->frame->data[0],
-                      s->image_height - (y_pos + 1 + s->diff_height),
-                      x_pos, s->diff_height, width,
-                      s->frame->linesize[0], s->pal);
-    }
-    skip_bits_long(gb, 8 * block_size); /* skip the consumed bits */
-    return 0;
-}
-
-static int calc_deflate_block_size(int tmpblock_size)
-{
-    z_stream zstream;
-    int size;
-
-    zstream.zalloc = Z_NULL;
-    zstream.zfree  = Z_NULL;
-    zstream.opaque = Z_NULL;
-    if (deflateInit(&zstream, 0) != Z_OK)
-        return -1;
-    size = deflateBound(&zstream, tmpblock_size);
-    deflateEnd(&zstream);
-
-    return size;
-}
-
-static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
-                                int *got_frame, AVPacket *avpkt)
-{
-    int buf_size = avpkt->size;
-    FlashSVContext *s = avctx->priv_data;
-    int h_blocks, v_blocks, h_part, v_part, i, j, ret;
-    GetBitContext gb;
-
-    /* no supplementary picture */
-    if (buf_size == 0)
-        return 0;
-    if (buf_size < 4)
-        return -1;
-
-    init_get_bits(&gb, avpkt->data, buf_size * 8);
-
-    /* start to parse the bitstream */
-    s->block_width  = 16 * (get_bits(&gb, 4) + 1);
-    s->image_width  = get_bits(&gb, 12);
-    s->block_height = 16 * (get_bits(&gb, 4) + 1);
-    s->image_height = get_bits(&gb, 12);
-
-    if (s->ver == 2) {
-        skip_bits(&gb, 6);
-        if (get_bits1(&gb)) {
-            avpriv_request_sample(avctx, "iframe");
-            return AVERROR_PATCHWELCOME;
-        }
-        if (get_bits1(&gb)) {
-            avpriv_request_sample(avctx, "Custom palette");
-            return AVERROR_PATCHWELCOME;
-        }
-    }
-
-    /* calculate number of blocks and size of border (partial) blocks */
-    h_blocks = s->image_width  / s->block_width;
-    h_part   = s->image_width  % s->block_width;
-    v_blocks = s->image_height / s->block_height;
-    v_part   = s->image_height % s->block_height;
-
-    /* the block size could change between frames, make sure the buffer
-     * is large enough, if not, get a larger one */
-    if (s->block_size < s->block_width * s->block_height) {
-        int tmpblock_size = 3 * s->block_width * s->block_height, err;
-
-        if ((err = av_reallocp(&s->tmpblock, tmpblock_size)) < 0) {
-            s->block_size = 0;
-            av_log(avctx, AV_LOG_ERROR,
-                   "Cannot allocate decompression buffer.\n");
-            return err;
-        }
-        if (s->ver == 2) {
-            s->deflate_block_size = calc_deflate_block_size(tmpblock_size);
-            if (s->deflate_block_size <= 0) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Cannot determine deflate buffer size.\n");
-                return -1;
-            }
-            if ((err = av_reallocp(&s->deflate_block, s->deflate_block_size)) < 0) {
-                s->block_size = 0;
-                av_log(avctx, AV_LOG_ERROR, "Cannot allocate deflate buffer.\n");
-                return err;
-            }
-        }
-    }
-    s->block_size = s->block_width * s->block_height;
-
-    /* initialize the image size once */
-    if (avctx->width == 0 && avctx->height == 0) {
-        avctx->width  = s->image_width;
-        avctx->height = s->image_height;
-    }
-
-    /* check for changes of image width and image height */
-    if (avctx->width != s->image_width || avctx->height != s->image_height) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Frame width or height differs from first frame!\n");
-        av_log(avctx, AV_LOG_ERROR, "fh = %d, fv %d  vs  ch = %d, cv = %d\n",
-               avctx->height, avctx->width, s->image_height, s->image_width);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* we care for keyframes only in Screen Video v2 */
-    s->is_keyframe = (avpkt->flags & AV_PKT_FLAG_KEY) && (s->ver == 2);
-    if (s->is_keyframe) {
-        int err;
-        if ((err = av_reallocp(&s->keyframedata, avpkt->size)) < 0)
-            return err;
-        memcpy(s->keyframedata, avpkt->data, avpkt->size);
-        if ((err = av_reallocp(&s->blocks, (v_blocks + !!v_part) *
-                               (h_blocks + !!h_part) * sizeof(s->blocks[0]))) < 0)
-            return err;
-    }
-
-    av_dlog(avctx, "image: %dx%d block: %dx%d num: %dx%d part: %dx%d\n",
-            s->image_width, s->image_height, s->block_width, s->block_height,
-            h_blocks, v_blocks, h_part, v_part);
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    /* loop over all block columns */
-    for (j = 0; j < v_blocks + (v_part ? 1 : 0); j++) {
-
-        int y_pos  = j * s->block_height; // vertical position in frame
-        int cur_blk_height = (j < v_blocks) ? s->block_height : v_part;
-
-        /* loop over all block rows */
-        for (i = 0; i < h_blocks + (h_part ? 1 : 0); i++) {
-            int x_pos = i * s->block_width; // horizontal position in frame
-            int cur_blk_width = (i < h_blocks) ? s->block_width : h_part;
-            int has_diff = 0;
-
-            /* get the size of the compressed zlib chunk */
-            int size = get_bits(&gb, 16);
-
-            s->color_depth    = 0;
-            s->zlibprime_curr = 0;
-            s->zlibprime_prev = 0;
-            s->diff_start     = 0;
-            s->diff_height    = cur_blk_height;
-
-            if (8 * size > get_bits_left(&gb)) {
-                av_frame_unref(s->frame);
-                return AVERROR_INVALIDDATA;
-            }
-
-            if (s->ver == 2 && size) {
-                skip_bits(&gb, 3);
-                s->color_depth    = get_bits(&gb, 2);
-                has_diff          = get_bits1(&gb);
-                s->zlibprime_curr = get_bits1(&gb);
-                s->zlibprime_prev = get_bits1(&gb);
-
-                if (s->color_depth != 0 && s->color_depth != 2) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "%dx%d invalid color depth %d\n",
-                           i, j, s->color_depth);
-                    return AVERROR_INVALIDDATA;
-                }
-
-                if (has_diff) {
-                    if (!s->keyframe) {
-                        av_log(avctx, AV_LOG_ERROR,
-                               "Inter frame without keyframe\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    s->diff_start  = get_bits(&gb, 8);
-                    s->diff_height = get_bits(&gb, 8);
-                    if (s->diff_start + s->diff_height > cur_blk_height) {
-                        av_log(avctx, AV_LOG_ERROR,
-                               "Block parameters invalid: %d + %d > %d\n",
-                               s->diff_start, s->diff_height, cur_blk_height);
-                        return AVERROR_INVALIDDATA;
-                    }
-                    av_log(avctx, AV_LOG_DEBUG,
-                           "%dx%d diff start %d height %d\n",
-                           i, j, s->diff_start, s->diff_height);
-                    size -= 2;
-                }
-
-                if (s->zlibprime_prev)
-                    av_log(avctx, AV_LOG_DEBUG, "%dx%d zlibprime_prev\n", i, j);
-
-                if (s->zlibprime_curr) {
-                    int col = get_bits(&gb, 8);
-                    int row = get_bits(&gb, 8);
-                    av_log(avctx, AV_LOG_DEBUG, "%dx%d zlibprime_curr %dx%d\n",
-                           i, j, col, row);
-                    size -= 2;
-                    avpriv_request_sample(avctx, "zlibprime_curr");
-                    return AVERROR_PATCHWELCOME;
-                }
-                if (!s->blocks && (s->zlibprime_curr || s->zlibprime_prev)) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "no data available for zlib priming\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                size--; // account for flags byte
-            }
-
-            if (has_diff) {
-                int k;
-                int off = (s->image_height - y_pos - 1) * s->frame->linesize[0];
-
-                for (k = 0; k < cur_blk_height; k++) {
-                    int x = off - k * s->frame->linesize[0] + x_pos * 3;
-                    memcpy(s->frame->data[0] + x, s->keyframe + x,
-                           cur_blk_width * 3);
-                }
-            }
-
-            /* skip unchanged blocks, which have size 0 */
-            if (size) {
-                if (flashsv_decode_block(avctx, avpkt, &gb, size,
-                                         cur_blk_width, cur_blk_height,
-                                         x_pos, y_pos,
-                                         i + j * (h_blocks + !!h_part)))
-                    av_log(avctx, AV_LOG_ERROR,
-                           "error in decompression of block %dx%d\n", i, j);
-            }
-        }
-    }
-    if (s->is_keyframe && s->ver == 2) {
-        if (!s->keyframe) {
-            s->keyframe = av_malloc(s->frame->linesize[0] * avctx->height);
-            if (!s->keyframe) {
-                av_log(avctx, AV_LOG_ERROR, "Cannot allocate image data\n");
-                return AVERROR(ENOMEM);
-            }
-        }
-        memcpy(s->keyframe, s->frame->data[0],
-               s->frame->linesize[0] * avctx->height);
-    }
-
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    if ((get_bits_count(&gb) / 8) != buf_size)
-        av_log(avctx, AV_LOG_ERROR, "buffer not fully consumed (%d != %d)\n",
-               buf_size, (get_bits_count(&gb) / 8));
-
-    /* report that the buffer was completely consumed */
-    return buf_size;
-}
-
-#if CONFIG_FLASHSV_DECODER
-AVCodec ff_flashsv_decoder = {
-    .name           = "flashsv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FLASHSV,
-    .priv_data_size = sizeof(FlashSVContext),
-    .init           = flashsv_decode_init,
-    .close          = flashsv_decode_end,
-    .decode         = flashsv_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
-};
-#endif /* CONFIG_FLASHSV_DECODER */
-
-#if CONFIG_FLASHSV2_DECODER
-static const uint32_t ff_flashsv2_default_palette[128] = {
-    0x000000, 0x333333, 0x666666, 0x999999, 0xCCCCCC, 0xFFFFFF,
-    0x330000, 0x660000, 0x990000, 0xCC0000, 0xFF0000, 0x003300,
-    0x006600, 0x009900, 0x00CC00, 0x00FF00, 0x000033, 0x000066,
-    0x000099, 0x0000CC, 0x0000FF, 0x333300, 0x666600, 0x999900,
-    0xCCCC00, 0xFFFF00, 0x003333, 0x006666, 0x009999, 0x00CCCC,
-    0x00FFFF, 0x330033, 0x660066, 0x990099, 0xCC00CC, 0xFF00FF,
-    0xFFFF33, 0xFFFF66, 0xFFFF99, 0xFFFFCC, 0xFF33FF, 0xFF66FF,
-    0xFF99FF, 0xFFCCFF, 0x33FFFF, 0x66FFFF, 0x99FFFF, 0xCCFFFF,
-    0xCCCC33, 0xCCCC66, 0xCCCC99, 0xCCCCFF, 0xCC33CC, 0xCC66CC,
-    0xCC99CC, 0xCCFFCC, 0x33CCCC, 0x66CCCC, 0x99CCCC, 0xFFCCCC,
-    0x999933, 0x999966, 0x9999CC, 0x9999FF, 0x993399, 0x996699,
-    0x99CC99, 0x99FF99, 0x339999, 0x669999, 0xCC9999, 0xFF9999,
-    0x666633, 0x666699, 0x6666CC, 0x6666FF, 0x663366, 0x669966,
-    0x66CC66, 0x66FF66, 0x336666, 0x996666, 0xCC6666, 0xFF6666,
-    0x333366, 0x333399, 0x3333CC, 0x3333FF, 0x336633, 0x339933,
-    0x33CC33, 0x33FF33, 0x663333, 0x993333, 0xCC3333, 0xFF3333,
-    0x003366, 0x336600, 0x660033, 0x006633, 0x330066, 0x663300,
-    0x336699, 0x669933, 0x993366, 0x339966, 0x663399, 0x996633,
-    0x6699CC, 0x99CC66, 0xCC6699, 0x66CC99, 0x9966CC, 0xCC9966,
-    0x99CCFF, 0xCCFF99, 0xFF99CC, 0x99FFCC, 0xCC99FF, 0xFFCC99,
-    0x111111, 0x222222, 0x444444, 0x555555, 0xAAAAAA, 0xBBBBBB,
-    0xDDDDDD, 0xEEEEEE
-};
-
-static av_cold int flashsv2_decode_init(AVCodecContext *avctx)
-{
-    FlashSVContext *s = avctx->priv_data;
-    flashsv_decode_init(avctx);
-    s->pal = ff_flashsv2_default_palette;
-    s->ver = 2;
-
-    return 0;
-}
-
-static av_cold int flashsv2_decode_end(AVCodecContext *avctx)
-{
-    FlashSVContext *s = avctx->priv_data;
-
-    av_freep(&s->keyframedata);
-    av_freep(&s->blocks);
-    av_freep(&s->keyframe);
-    av_freep(&s->deflate_block);
-    flashsv_decode_end(avctx);
-
-    return 0;
-}
-
-AVCodec ff_flashsv2_decoder = {
-    .name           = "flashsv2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FLASHSV2,
-    .priv_data_size = sizeof(FlashSVContext),
-    .init           = flashsv2_decode_init,
-    .close          = flashsv2_decode_end,
-    .decode         = flashsv_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
-};
-#endif /* CONFIG_FLASHSV2_DECODER */
diff --git a/deps/libav/libavcodec/flashsvenc.c b/deps/libav/libavcodec/flashsvenc.c
deleted file mode 100644
index 71c81bd..0000000
--- a/deps/libav/libavcodec/flashsvenc.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Flash Screen Video encoder
- * Copyright (C) 2004 Alex Beregszaszi
- * Copyright (C) 2006 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* Encoding development sponsored by http://fh-campuswien.ac.at */
-
-/**
- * @file
- * Flash Screen Video encoder
- * @author Alex Beregszaszi
- * @author Benjamin Larsson
- *
- * A description of the bitstream format for Flash Screen Video version 1/2
- * is part of the SWF File Format Specification (version 10), which can be
- * downloaded from http://www.adobe.com/devnet/swf.html.
- */
-
-/*
- * Encoding ideas: A basic encoder would just use a fixed block size.
- * Block sizes can be multiples of 16, from 16 to 256. The blocks don't
- * have to be quadratic. A brute force search with a set of different
- * block sizes should give a better result than to just use a fixed size.
- *
- * TODO:
- * Don't reencode the frame in brute force mode if the frame is a dupe.
- * Speed up. Make the difference check faster.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <zlib.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "put_bits.h"
-#include "bytestream.h"
-
-
-typedef struct FlashSVContext {
-    AVCodecContext *avctx;
-    uint8_t        *previous_frame;
-    int             image_width, image_height;
-    int             block_width, block_height;
-    uint8_t        *tmpblock;
-    uint8_t        *encbuffer;
-    int             block_size;
-    z_stream        zstream;
-    int             last_key_frame;
-} FlashSVContext;
-
-static int copy_region_enc(uint8_t *sptr, uint8_t *dptr, int dx, int dy,
-                           int h, int w, int stride, uint8_t *pfptr)
-{
-    int i, j;
-    uint8_t *nsptr;
-    uint8_t *npfptr;
-    int diff = 0;
-
-    for (i = dx + h; i > dx; i--) {
-        nsptr  = sptr  + i * stride + dy * 3;
-        npfptr = pfptr + i * stride + dy * 3;
-        for (j = 0; j < w * 3; j++) {
-            diff    |= npfptr[j] ^ nsptr[j];
-            dptr[j]  = nsptr[j];
-        }
-        dptr += w * 3;
-    }
-    if (diff)
-        return 1;
-    return 0;
-}
-
-static av_cold int flashsv_encode_end(AVCodecContext *avctx)
-{
-    FlashSVContext *s = avctx->priv_data;
-
-    deflateEnd(&s->zstream);
-
-    av_free(s->encbuffer);
-    av_free(s->previous_frame);
-    av_free(s->tmpblock);
-
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-static av_cold int flashsv_encode_init(AVCodecContext *avctx)
-{
-    FlashSVContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    if (avctx->width > 4095 || avctx->height > 4095) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Input dimensions too large, input must be max 4096x4096 !\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    // Needed if zlib unused or init aborted before deflateInit
-    memset(&s->zstream, 0, sizeof(z_stream));
-
-    s->last_key_frame = 0;
-
-    s->image_width  = avctx->width;
-    s->image_height = avctx->height;
-
-    s->tmpblock  = av_mallocz(3 * 256 * 256);
-    s->encbuffer = av_mallocz(s->image_width * s->image_height * 3);
-
-    if (!s->tmpblock || !s->encbuffer) {
-        av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame) {
-        flashsv_encode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-
-static int encode_bitstream(FlashSVContext *s, const AVFrame *p, uint8_t *buf,
-                            int buf_size, int block_width, int block_height,
-                            uint8_t *previous_frame, int *I_frame)
-{
-
-    PutBitContext pb;
-    int h_blocks, v_blocks, h_part, v_part, i, j;
-    int buf_pos, res;
-    int pred_blocks = 0;
-
-    init_put_bits(&pb, buf, buf_size * 8);
-
-    put_bits(&pb,  4, block_width / 16 - 1);
-    put_bits(&pb, 12, s->image_width);
-    put_bits(&pb,  4, block_height / 16 - 1);
-    put_bits(&pb, 12, s->image_height);
-    flush_put_bits(&pb);
-    buf_pos = 4;
-
-    h_blocks = s->image_width  / block_width;
-    h_part   = s->image_width  % block_width;
-    v_blocks = s->image_height / block_height;
-    v_part   = s->image_height % block_height;
-
-    /* loop over all block columns */
-    for (j = 0; j < v_blocks + (v_part ? 1 : 0); j++) {
-
-        int y_pos = j * block_height; // vertical position in frame
-        int cur_blk_height = (j < v_blocks) ? block_height : v_part;
-
-        /* loop over all block rows */
-        for (i = 0; i < h_blocks + (h_part ? 1 : 0); i++) {
-            int x_pos = i * block_width; // horizontal position in frame
-            int cur_blk_width = (i < h_blocks) ? block_width : h_part;
-            int ret = Z_OK;
-            uint8_t *ptr = buf + buf_pos;
-
-            /* copy the block to the temp buffer before compression
-             * (if it differs from the previous frame's block) */
-            res = copy_region_enc(p->data[0], s->tmpblock,
-                                  s->image_height - (y_pos + cur_blk_height + 1),
-                                  x_pos, cur_blk_height, cur_blk_width,
-                                  p->linesize[0], previous_frame);
-
-            if (res || *I_frame) {
-                unsigned long zsize = 3 * block_width * block_height;
-                ret = compress2(ptr + 2, &zsize, s->tmpblock,
-                                3 * cur_blk_width * cur_blk_height, 9);
-
-                //ret = deflateReset(&s->zstream);
-                if (ret != Z_OK)
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "error while compressing block %dx%d\n", i, j);
-
-                bytestream_put_be16(&ptr, zsize);
-                buf_pos += zsize + 2;
-                av_dlog(s->avctx, "buf_pos = %d\n", buf_pos);
-            } else {
-                pred_blocks++;
-                bytestream_put_be16(&ptr, 0);
-                buf_pos += 2;
-            }
-        }
-    }
-
-    if (pred_blocks)
-        *I_frame = 0;
-    else
-        *I_frame = 1;
-
-    return buf_pos;
-}
-
-
-static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                                const AVFrame *pict, int *got_packet)
-{
-    FlashSVContext * const s = avctx->priv_data;
-    const AVFrame * const p = pict;
-    uint8_t *pfptr;
-    int res;
-    int I_frame = 0;
-    int opt_w = 4, opt_h = 4;
-
-    /* First frame needs to be a keyframe */
-    if (avctx->frame_number == 0) {
-        s->previous_frame = av_mallocz(FFABS(p->linesize[0]) * s->image_height);
-        if (!s->previous_frame) {
-            av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
-            return AVERROR(ENOMEM);
-        }
-        I_frame = 1;
-    }
-
-    if (p->linesize[0] < 0)
-        pfptr = s->previous_frame - (s->image_height - 1) * p->linesize[0];
-    else
-        pfptr = s->previous_frame;
-
-    /* Check the placement of keyframes */
-    if (avctx->gop_size > 0 &&
-        avctx->frame_number >= s->last_key_frame + avctx->gop_size) {
-        I_frame = 1;
-    }
-
-    if ((res = ff_alloc_packet(pkt, s->image_width * s->image_height * 3)) < 0) {
-        //Conservative upper bound check for compressed data
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n",
-               s->image_width * s->image_height * 3);
-        return res;
-    }
-
-    pkt->size = encode_bitstream(s, p, pkt->data, pkt->size, opt_w * 16, opt_h * 16,
-                                 pfptr, &I_frame);
-
-    //save the current frame
-    if (p->linesize[0] > 0)
-        memcpy(s->previous_frame, p->data[0], s->image_height * p->linesize[0]);
-    else
-        memcpy(s->previous_frame,
-               p->data[0] + p->linesize[0] * (s->image_height - 1),
-               s->image_height * FFABS(p->linesize[0]));
-
-    //mark the frame type so the muxer can mux it correctly
-    if (I_frame) {
-        avctx->coded_frame->pict_type      = AV_PICTURE_TYPE_I;
-        avctx->coded_frame->key_frame      = 1;
-        s->last_key_frame = avctx->frame_number;
-        av_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);
-    } else {
-        avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
-        avctx->coded_frame->key_frame = 0;
-    }
-
-    if (avctx->coded_frame->key_frame)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-AVCodec ff_flashsv_encoder = {
-    .name           = "flashsv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Flash Screen Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FLASHSV,
-    .priv_data_size = sizeof(FlashSVContext),
-    .init           = flashsv_encode_init,
-    .encode2        = flashsv_encode_frame,
-    .close          = flashsv_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/flicvideo.c b/deps/libav/libavcodec/flicvideo.c
deleted file mode 100644
index 68f45b4..0000000
--- a/deps/libav/libavcodec/flicvideo.c
+++ /dev/null
@@ -1,754 +0,0 @@
-/*
- * FLI/FLC Animation Video Decoder
- * Copyright (C) 2003, 2004 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Autodesk Animator FLI/FLC Video Decoder
- * by Mike Melanson (melanson at pcisys.net)
- * for more information on the .fli/.flc file format and all of its many
- * variations, visit:
- *   http://www.compuphase.com/flic.htm
- *
- * This decoder outputs PAL8/RGB555/RGB565 and maybe one day RGB24
- * colorspace data, depending on the FLC. To use this decoder, be
- * sure that your demuxer sends the FLI file header to the decoder via
- * the extradata chunk in AVCodecContext. The chunk should be 128 bytes
- * large. The only exception is for FLI files from the game "Magic Carpet",
- * in which the header is only 12 bytes.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "mathops.h"
-
-#define FLI_256_COLOR 4
-#define FLI_DELTA     7
-#define FLI_COLOR     11
-#define FLI_LC        12
-#define FLI_BLACK     13
-#define FLI_BRUN      15
-#define FLI_COPY      16
-#define FLI_MINI      18
-#define FLI_DTA_BRUN  25
-#define FLI_DTA_COPY  26
-#define FLI_DTA_LC    27
-
-#define FLI_TYPE_CODE     (0xAF11)
-#define FLC_FLX_TYPE_CODE (0xAF12)
-#define FLC_DTA_TYPE_CODE (0xAF44) /* Marks an "Extended FLC" comes from Dave's Targa Animator (DTA) */
-#define FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE (0xAF13)
-
-#define CHECK_PIXEL_PTR(n) \
-    if (pixel_ptr + n > pixel_limit) { \
-        av_log (s->avctx, AV_LOG_INFO, "Problem: pixel_ptr >= pixel_limit (%d >= %d)\n", \
-        pixel_ptr + n, pixel_limit); \
-        return AVERROR_INVALIDDATA; \
-    } \
-
-typedef struct FlicDecodeContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    unsigned int palette[256];
-    int new_palette;
-    int fli_type;  /* either 0xAF11 or 0xAF12, affects palette resolution */
-} FlicDecodeContext;
-
-static av_cold int flic_decode_init(AVCodecContext *avctx)
-{
-    FlicDecodeContext *s = avctx->priv_data;
-    unsigned char *fli_header = (unsigned char *)avctx->extradata;
-    int depth;
-
-    if (avctx->extradata_size != 12 &&
-        avctx->extradata_size != 128) {
-        av_log(avctx, AV_LOG_ERROR, "Expected extradata of 12 or 128 bytes\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->avctx = avctx;
-
-    s->fli_type = AV_RL16(&fli_header[4]); /* Might be overridden if a Magic Carpet FLC */
-
-    depth = 0;
-    if (s->avctx->extradata_size == 12) {
-        /* special case for magic carpet FLIs */
-        s->fli_type = FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE;
-        depth = 8;
-    } else {
-        depth = AV_RL16(&fli_header[12]);
-    }
-
-    if (depth == 0) {
-        depth = 8; /* Some FLC generators set depth to zero, when they mean 8Bpp. Fix up here */
-    }
-
-    if ((s->fli_type == FLC_FLX_TYPE_CODE) && (depth == 16)) {
-        depth = 15; /* Original Autodesk FLX's say the depth is 16Bpp when it is really 15Bpp */
-    }
-
-    switch (depth) {
-        case 8  : avctx->pix_fmt = AV_PIX_FMT_PAL8; break;
-        case 15 : avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
-        case 16 : avctx->pix_fmt = AV_PIX_FMT_RGB565; break;
-        case 24 : avctx->pix_fmt = AV_PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */
-                  av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n");
-                  return AVERROR_PATCHWELCOME;
-        default :
-                  av_log(avctx, AV_LOG_ERROR, "Unknown FLC/FLX depth of %d Bpp is unsupported.\n",depth);
-                  return AVERROR_INVALIDDATA;
-    }
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    s->new_palette = 0;
-
-    return 0;
-}
-
-static int flic_decode_frame_8BPP(AVCodecContext *avctx,
-                                  void *data, int *got_frame,
-                                  const uint8_t *buf, int buf_size)
-{
-    FlicDecodeContext *s = avctx->priv_data;
-
-    GetByteContext g2;
-    int stream_ptr_after_color_chunk;
-    int pixel_ptr;
-    int palette_ptr;
-    unsigned char palette_idx1;
-    unsigned char palette_idx2;
-
-    unsigned int frame_size;
-    int num_chunks;
-
-    unsigned int chunk_size;
-    int chunk_type;
-
-    int i, j, ret;
-
-    int color_packets;
-    int color_changes;
-    int color_shift;
-    unsigned char r, g, b;
-
-    int lines;
-    int compressed_lines;
-    int starting_line;
-    signed short line_packets;
-    int y_ptr;
-    int byte_run;
-    int pixel_skip;
-    int pixel_countdown;
-    unsigned char *pixels;
-    unsigned int pixel_limit;
-
-    bytestream2_init(&g2, buf, buf_size);
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    pixels = s->frame->data[0];
-    pixel_limit = s->avctx->height * s->frame->linesize[0];
-    frame_size = bytestream2_get_le32(&g2);
-    bytestream2_skip(&g2, 2); /* skip the magic number */
-    num_chunks = bytestream2_get_le16(&g2);
-    bytestream2_skip(&g2, 8);  /* skip padding */
-
-    frame_size -= 16;
-
-    /* iterate through the chunks */
-    while ((frame_size > 0) && (num_chunks > 0)) {
-        chunk_size = bytestream2_get_le32(&g2);
-        chunk_type = bytestream2_get_le16(&g2);
-
-        switch (chunk_type) {
-        case FLI_256_COLOR:
-        case FLI_COLOR:
-            stream_ptr_after_color_chunk = bytestream2_tell(&g2) + chunk_size - 6;
-
-            /* check special case: If this file is from the Magic Carpet
-             * game and uses 6-bit colors even though it reports 256-color
-             * chunks in a 0xAF12-type file (fli_type is set to 0xAF13 during
-             * initialization) */
-            if ((chunk_type == FLI_256_COLOR) && (s->fli_type != FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE))
-                color_shift = 0;
-            else
-                color_shift = 2;
-            /* set up the palette */
-            color_packets = bytestream2_get_le16(&g2);
-            palette_ptr = 0;
-            for (i = 0; i < color_packets; i++) {
-                /* first byte is how many colors to skip */
-                palette_ptr += bytestream2_get_byte(&g2);
-
-                /* next byte indicates how many entries to change */
-                color_changes = bytestream2_get_byte(&g2);
-
-                /* if there are 0 color changes, there are actually 256 */
-                if (color_changes == 0)
-                    color_changes = 256;
-
-                for (j = 0; j < color_changes; j++) {
-                    unsigned int entry;
-
-                    /* wrap around, for good measure */
-                    if ((unsigned)palette_ptr >= 256)
-                        palette_ptr = 0;
-
-                    r = bytestream2_get_byte(&g2) << color_shift;
-                    g = bytestream2_get_byte(&g2) << color_shift;
-                    b = bytestream2_get_byte(&g2) << color_shift;
-                    entry = (r << 16) | (g << 8) | b;
-                    if (s->palette[palette_ptr] != entry)
-                        s->new_palette = 1;
-                    s->palette[palette_ptr++] = entry;
-                }
-            }
-
-            /* color chunks sometimes have weird 16-bit alignment issues;
-             * therefore, take the hardline approach and skip
-             * to the value calculated w.r.t. the size specified by the color
-             * chunk header */
-            if (stream_ptr_after_color_chunk - bytestream2_tell(&g2) > 0)
-                bytestream2_skip(&g2, stream_ptr_after_color_chunk - bytestream2_tell(&g2));
-
-            break;
-
-        case FLI_DELTA:
-            y_ptr = 0;
-            compressed_lines = bytestream2_get_le16(&g2);
-            while (compressed_lines > 0) {
-                line_packets = bytestream2_get_le16(&g2);
-                if ((line_packets & 0xC000) == 0xC000) {
-                    // line skip opcode
-                    line_packets = -line_packets;
-                    y_ptr += line_packets * s->frame->linesize[0];
-                } else if ((line_packets & 0xC000) == 0x4000) {
-                    av_log(avctx, AV_LOG_ERROR, "Undefined opcode (%x) in DELTA_FLI\n", line_packets);
-                } else if ((line_packets & 0xC000) == 0x8000) {
-                    // "last byte" opcode
-                    pixel_ptr= y_ptr + s->frame->linesize[0] - 1;
-                    CHECK_PIXEL_PTR(0);
-                    pixels[pixel_ptr] = line_packets & 0xff;
-                } else {
-                    compressed_lines--;
-                    pixel_ptr = y_ptr;
-                    CHECK_PIXEL_PTR(0);
-                    pixel_countdown = s->avctx->width;
-                    for (i = 0; i < line_packets; i++) {
-                        /* account for the skip bytes */
-                        pixel_skip = bytestream2_get_byte(&g2);
-                        pixel_ptr += pixel_skip;
-                        pixel_countdown -= pixel_skip;
-                        byte_run = sign_extend(bytestream2_get_byte(&g2), 8);
-                        if (byte_run < 0) {
-                            byte_run = -byte_run;
-                            palette_idx1 = bytestream2_get_byte(&g2);
-                            palette_idx2 = bytestream2_get_byte(&g2);
-                            CHECK_PIXEL_PTR(byte_run * 2);
-                            for (j = 0; j < byte_run; j++, pixel_countdown -= 2) {
-                                pixels[pixel_ptr++] = palette_idx1;
-                                pixels[pixel_ptr++] = palette_idx2;
-                            }
-                        } else {
-                            CHECK_PIXEL_PTR(byte_run * 2);
-                            for (j = 0; j < byte_run * 2; j++, pixel_countdown--) {
-                                pixels[pixel_ptr++] = bytestream2_get_byte(&g2);
-                            }
-                        }
-                    }
-
-                    y_ptr += s->frame->linesize[0];
-                }
-            }
-            break;
-
-        case FLI_LC:
-            /* line compressed */
-            starting_line = bytestream2_get_le16(&g2);
-            y_ptr = 0;
-            y_ptr += starting_line * s->frame->linesize[0];
-
-            compressed_lines = bytestream2_get_le16(&g2);
-            while (compressed_lines > 0) {
-                pixel_ptr = y_ptr;
-                CHECK_PIXEL_PTR(0);
-                pixel_countdown = s->avctx->width;
-                line_packets = bytestream2_get_byte(&g2);
-                if (line_packets > 0) {
-                    for (i = 0; i < line_packets; i++) {
-                        /* account for the skip bytes */
-                        pixel_skip = bytestream2_get_byte(&g2);
-                        pixel_ptr += pixel_skip;
-                        pixel_countdown -= pixel_skip;
-                        byte_run = sign_extend(bytestream2_get_byte(&g2),8);
-                        if (byte_run > 0) {
-                            CHECK_PIXEL_PTR(byte_run);
-                            for (j = 0; j < byte_run; j++, pixel_countdown--) {
-                                pixels[pixel_ptr++] = bytestream2_get_byte(&g2);
-                            }
-                        } else if (byte_run < 0) {
-                            byte_run = -byte_run;
-                            palette_idx1 = bytestream2_get_byte(&g2);
-                            CHECK_PIXEL_PTR(byte_run);
-                            for (j = 0; j < byte_run; j++, pixel_countdown--) {
-                                pixels[pixel_ptr++] = palette_idx1;
-                            }
-                        }
-                    }
-                }
-
-                y_ptr += s->frame->linesize[0];
-                compressed_lines--;
-            }
-            break;
-
-        case FLI_BLACK:
-            /* set the whole frame to color 0 (which is usually black) */
-            memset(pixels, 0,
-                s->frame->linesize[0] * s->avctx->height);
-            break;
-
-        case FLI_BRUN:
-            /* Byte run compression: This chunk type only occurs in the first
-             * FLI frame and it will update the entire frame. */
-            y_ptr = 0;
-            for (lines = 0; lines < s->avctx->height; lines++) {
-                pixel_ptr = y_ptr;
-                /* disregard the line packets; instead, iterate through all
-                 * pixels on a row */
-                 bytestream2_skip(&g2, 1);
-                pixel_countdown = s->avctx->width;
-                while (pixel_countdown > 0) {
-                    byte_run = sign_extend(bytestream2_get_byte(&g2), 8);
-                    if (!byte_run) {
-                        av_log(avctx, AV_LOG_ERROR, "Invalid byte run value.\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-
-                    if (byte_run > 0) {
-                        palette_idx1 = bytestream2_get_byte(&g2);
-                        CHECK_PIXEL_PTR(byte_run);
-                        for (j = 0; j < byte_run; j++) {
-                            pixels[pixel_ptr++] = palette_idx1;
-                            pixel_countdown--;
-                            if (pixel_countdown < 0)
-                                av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) at line %d\n",
-                                       pixel_countdown, lines);
-                        }
-                    } else {  /* copy bytes if byte_run < 0 */
-                        byte_run = -byte_run;
-                        CHECK_PIXEL_PTR(byte_run);
-                        for (j = 0; j < byte_run; j++) {
-                            pixels[pixel_ptr++] = bytestream2_get_byte(&g2);
-                            pixel_countdown--;
-                            if (pixel_countdown < 0)
-                                av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) at line %d\n",
-                                       pixel_countdown, lines);
-                        }
-                    }
-                }
-
-                y_ptr += s->frame->linesize[0];
-            }
-            break;
-
-        case FLI_COPY:
-            /* copy the chunk (uncompressed frame) */
-            if (chunk_size - 6 > s->avctx->width * s->avctx->height) {
-                av_log(avctx, AV_LOG_ERROR, "In chunk FLI_COPY : source data (%d bytes) " \
-                       "bigger than image, skipping chunk\n", chunk_size - 6);
-                bytestream2_skip(&g2, chunk_size - 6);
-            } else {
-                for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height;
-                     y_ptr += s->frame->linesize[0]) {
-                    bytestream2_get_buffer(&g2, &pixels[y_ptr],
-                                           s->avctx->width);
-                }
-            }
-            break;
-
-        case FLI_MINI:
-            /* some sort of a thumbnail? disregard this chunk... */
-            bytestream2_skip(&g2, chunk_size - 6);
-            break;
-
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unrecognized chunk type: %d\n", chunk_type);
-            break;
-        }
-
-        frame_size -= chunk_size;
-        num_chunks--;
-    }
-
-    /* by the end of the chunk, the stream ptr should equal the frame
-     * size (minus 1, possibly); if it doesn't, issue a warning */
-    if ((bytestream2_get_bytes_left(&g2) != 0) &&
-        (bytestream2_get_bytes_left(&g2) != 1))
-        av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \
-               "and final chunk ptr = %d\n", buf_size,
-               buf_size - bytestream2_get_bytes_left(&g2));
-
-    /* make the palette available on the way out */
-    memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
-    if (s->new_palette) {
-        s->frame->palette_has_changed = 1;
-        s->new_palette = 0;
-    }
-
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
-                                      void *data, int *got_frame,
-                                      const uint8_t *buf, int buf_size)
-{
-    /* Note, the only difference between the 15Bpp and 16Bpp */
-    /* Format is the pixel format, the packets are processed the same. */
-    FlicDecodeContext *s = avctx->priv_data;
-
-    GetByteContext g2;
-    int pixel_ptr;
-    unsigned char palette_idx1;
-
-    unsigned int frame_size;
-    int num_chunks;
-
-    unsigned int chunk_size;
-    int chunk_type;
-
-    int i, j, ret;
-
-    int lines;
-    int compressed_lines;
-    signed short line_packets;
-    int y_ptr;
-    int byte_run;
-    int pixel_skip;
-    int pixel_countdown;
-    unsigned char *pixels;
-    int pixel;
-    unsigned int pixel_limit;
-
-    bytestream2_init(&g2, buf, buf_size);
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    pixels = s->frame->data[0];
-    pixel_limit = s->avctx->height * s->frame->linesize[0];
-
-    frame_size = bytestream2_get_le32(&g2);
-    bytestream2_skip(&g2, 2);  /* skip the magic number */
-    num_chunks = bytestream2_get_le16(&g2);
-    bytestream2_skip(&g2, 8);  /* skip padding */
-
-    frame_size -= 16;
-
-    /* iterate through the chunks */
-    while ((frame_size > 0) && (num_chunks > 0)) {
-        chunk_size = bytestream2_get_le32(&g2);
-        chunk_type = bytestream2_get_le16(&g2);
-
-        switch (chunk_type) {
-        case FLI_256_COLOR:
-        case FLI_COLOR:
-            /* For some reason, it seems that non-palettized flics do
-             * include one of these chunks in their first frame.
-             * Why I do not know, it seems rather extraneous. */
-            av_dlog(avctx,
-                    "Unexpected Palette chunk %d in non-palettized FLC\n",
-                    chunk_type);
-            bytestream2_skip(&g2, chunk_size - 6);
-            break;
-
-        case FLI_DELTA:
-        case FLI_DTA_LC:
-            y_ptr = 0;
-            compressed_lines = bytestream2_get_le16(&g2);
-            while (compressed_lines > 0) {
-                line_packets = bytestream2_get_le16(&g2);
-                if (line_packets < 0) {
-                    line_packets = -line_packets;
-                    y_ptr += line_packets * s->frame->linesize[0];
-                } else {
-                    compressed_lines--;
-                    pixel_ptr = y_ptr;
-                    CHECK_PIXEL_PTR(0);
-                    pixel_countdown = s->avctx->width;
-                    for (i = 0; i < line_packets; i++) {
-                        /* account for the skip bytes */
-                        pixel_skip = bytestream2_get_byte(&g2);
-                        pixel_ptr += (pixel_skip*2); /* Pixel is 2 bytes wide */
-                        pixel_countdown -= pixel_skip;
-                        byte_run = sign_extend(bytestream2_get_byte(&g2), 8);
-                        if (byte_run < 0) {
-                            byte_run = -byte_run;
-                            pixel    = bytestream2_get_le16(&g2);
-                            CHECK_PIXEL_PTR(2 * byte_run);
-                            for (j = 0; j < byte_run; j++, pixel_countdown -= 2) {
-                                *((signed short*)(&pixels[pixel_ptr])) = pixel;
-                                pixel_ptr += 2;
-                            }
-                        } else {
-                            CHECK_PIXEL_PTR(2 * byte_run);
-                            for (j = 0; j < byte_run; j++, pixel_countdown--) {
-                                *((signed short*)(&pixels[pixel_ptr])) = bytestream2_get_le16(&g2);
-                                pixel_ptr += 2;
-                            }
-                        }
-                    }
-
-                    y_ptr += s->frame->linesize[0];
-                }
-            }
-            break;
-
-        case FLI_LC:
-            av_log(avctx, AV_LOG_ERROR, "Unexpected FLI_LC chunk in non-palettized FLC\n");
-            bytestream2_skip(&g2, chunk_size - 6);
-            break;
-
-        case FLI_BLACK:
-            /* set the whole frame to 0x0000 which is black in both 15Bpp and 16Bpp modes. */
-            memset(pixels, 0x0000,
-                   s->frame->linesize[0] * s->avctx->height);
-            break;
-
-        case FLI_BRUN:
-            y_ptr = 0;
-            for (lines = 0; lines < s->avctx->height; lines++) {
-                pixel_ptr = y_ptr;
-                /* disregard the line packets; instead, iterate through all
-                 * pixels on a row */
-                bytestream2_skip(&g2, 1);
-                pixel_countdown = (s->avctx->width * 2);
-
-                while (pixel_countdown > 0) {
-                    byte_run = sign_extend(bytestream2_get_byte(&g2), 8);
-                    if (byte_run > 0) {
-                        palette_idx1 = bytestream2_get_byte(&g2);
-                        CHECK_PIXEL_PTR(byte_run);
-                        for (j = 0; j < byte_run; j++) {
-                            pixels[pixel_ptr++] = palette_idx1;
-                            pixel_countdown--;
-                            if (pixel_countdown < 0)
-                                av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) (linea%d)\n",
-                                       pixel_countdown, lines);
-                        }
-                    } else {  /* copy bytes if byte_run < 0 */
-                        byte_run = -byte_run;
-                        CHECK_PIXEL_PTR(byte_run);
-                        for (j = 0; j < byte_run; j++) {
-                            palette_idx1 = bytestream2_get_byte(&g2);
-                            pixels[pixel_ptr++] = palette_idx1;
-                            pixel_countdown--;
-                            if (pixel_countdown < 0)
-                                av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) at line %d\n",
-                                       pixel_countdown, lines);
-                        }
-                    }
-                }
-
-                /* Now FLX is strange, in that it is "byte" as opposed to "pixel" run length compressed.
-                 * This does not give us any good opportunity to perform word endian conversion
-                 * during decompression. So if it is required (i.e., this is not a LE target, we do
-                 * a second pass over the line here, swapping the bytes.
-                 */
-#if HAVE_BIGENDIAN
-                pixel_ptr = y_ptr;
-                pixel_countdown = s->avctx->width;
-                while (pixel_countdown > 0) {
-                    *((signed short*)(&pixels[pixel_ptr])) = AV_RL16(&buf[pixel_ptr]);
-                    pixel_ptr += 2;
-                }
-#endif
-                y_ptr += s->frame->linesize[0];
-            }
-            break;
-
-        case FLI_DTA_BRUN:
-            y_ptr = 0;
-            for (lines = 0; lines < s->avctx->height; lines++) {
-                pixel_ptr = y_ptr;
-                /* disregard the line packets; instead, iterate through all
-                 * pixels on a row */
-                bytestream2_skip(&g2, 1);
-                pixel_countdown = s->avctx->width; /* Width is in pixels, not bytes */
-
-                while (pixel_countdown > 0) {
-                    byte_run = sign_extend(bytestream2_get_byte(&g2), 8);
-                    if (byte_run > 0) {
-                        pixel    = bytestream2_get_le16(&g2);
-                        CHECK_PIXEL_PTR(2 * byte_run);
-                        for (j = 0; j < byte_run; j++) {
-                            *((signed short*)(&pixels[pixel_ptr])) = pixel;
-                            pixel_ptr += 2;
-                            pixel_countdown--;
-                            if (pixel_countdown < 0)
-                                av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d)\n",
-                                       pixel_countdown);
-                        }
-                    } else {  /* copy pixels if byte_run < 0 */
-                        byte_run = -byte_run;
-                        CHECK_PIXEL_PTR(2 * byte_run);
-                        for (j = 0; j < byte_run; j++) {
-                            *((signed short*)(&pixels[pixel_ptr])) = bytestream2_get_le16(&g2);
-                            pixel_ptr  += 2;
-                            pixel_countdown--;
-                            if (pixel_countdown < 0)
-                                av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d)\n",
-                                       pixel_countdown);
-                        }
-                    }
-                }
-
-                y_ptr += s->frame->linesize[0];
-            }
-            break;
-
-        case FLI_COPY:
-        case FLI_DTA_COPY:
-            /* copy the chunk (uncompressed frame) */
-            if (chunk_size - 6 > (unsigned int)(s->avctx->width * s->avctx->height)*2) {
-                av_log(avctx, AV_LOG_ERROR, "In chunk FLI_COPY : source data (%d bytes) " \
-                       "bigger than image, skipping chunk\n", chunk_size - 6);
-                bytestream2_skip(&g2, chunk_size - 6);
-            } else {
-
-                for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height;
-                     y_ptr += s->frame->linesize[0]) {
-
-                    pixel_countdown = s->avctx->width;
-                    pixel_ptr = 0;
-                    while (pixel_countdown > 0) {
-                      *((signed short*)(&pixels[y_ptr + pixel_ptr])) = bytestream2_get_le16(&g2);
-                      pixel_ptr += 2;
-                      pixel_countdown--;
-                    }
-                }
-            }
-            break;
-
-        case FLI_MINI:
-            /* some sort of a thumbnail? disregard this chunk... */
-            bytestream2_skip(&g2, chunk_size - 6);
-            break;
-
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unrecognized chunk type: %d\n", chunk_type);
-            break;
-        }
-
-        frame_size -= chunk_size;
-        num_chunks--;
-    }
-
-    /* by the end of the chunk, the stream ptr should equal the frame
-     * size (minus 1, possibly); if it doesn't, issue a warning */
-    if ((bytestream2_get_bytes_left(&g2) != 0) && (bytestream2_get_bytes_left(&g2) != 1))
-        av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \
-               "and final chunk ptr = %d\n", buf_size, bytestream2_tell(&g2));
-
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static int flic_decode_frame_24BPP(AVCodecContext *avctx,
-                                   void *data, int *got_frame,
-                                   const uint8_t *buf, int buf_size)
-{
-  av_log(avctx, AV_LOG_ERROR, "24Bpp FLC Unsupported due to lack of test files.\n");
-  return AVERROR_PATCHWELCOME;
-}
-
-static int flic_decode_frame(AVCodecContext *avctx,
-                             void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
-      return flic_decode_frame_8BPP(avctx, data, got_frame,
-                                    buf, buf_size);
-    }
-    else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) ||
-             (avctx->pix_fmt == AV_PIX_FMT_RGB565)) {
-      return flic_decode_frame_15_16BPP(avctx, data, got_frame,
-                                        buf, buf_size);
-    }
-    else if (avctx->pix_fmt == AV_PIX_FMT_BGR24) {
-      return flic_decode_frame_24BPP(avctx, data, got_frame,
-                                     buf, buf_size);
-    }
-
-    /* Should not get  here, ever as the pix_fmt is processed */
-    /* in flic_decode_init and the above if should deal with */
-    /* the finite set of possibilites allowable by here. */
-    /* But in case we do, just error out. */
-    av_log(avctx, AV_LOG_ERROR, "Unknown FLC format, my science cannot explain how this happened.\n");
-    return AVERROR_BUG;
-}
-
-
-static av_cold int flic_decode_end(AVCodecContext *avctx)
-{
-    FlicDecodeContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_flic_decoder = {
-    .name           = "flic",
-    .long_name      = NULL_IF_CONFIG_SMALL("Autodesk Animator Flic video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FLIC,
-    .priv_data_size = sizeof(FlicDecodeContext),
-    .init           = flic_decode_init,
-    .close          = flic_decode_end,
-    .decode         = flic_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/flv.h b/deps/libav/libavcodec/flv.h
deleted file mode 100644
index 3d9a2d5..0000000
--- a/deps/libav/libavcodec/flv.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * FLV specific private header.
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_FLV_H
-#define AVCODEC_FLV_H
-
-#include "mpegvideo.h"
-#include "get_bits.h"
-#include "put_bits.h"
-
-void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number);
-void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run, int last);
-
-int ff_flv_decode_picture_header(MpegEncContext *s);
-void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last);
-
-#endif /* AVCODEC_FLV_H */
diff --git a/deps/libav/libavcodec/flvdec.c b/deps/libav/libavcodec/flvdec.c
deleted file mode 100644
index 665208a..0000000
--- a/deps/libav/libavcodec/flvdec.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * FLV decoding.
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "mpegvideo.h"
-#include "h263.h"
-#include "flv.h"
-#include "libavutil/imgutils.h"
-
-void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last){
-    int is11 = get_bits1(gb);
-    *last = get_bits1(gb);
-    *run = get_bits(gb, 6);
-    if(is11){
-        *level = get_sbits(gb, 11);
-    } else {
-        *level = get_sbits(gb, 7);
-    }
-}
-
-int ff_flv_decode_picture_header(MpegEncContext *s)
-{
-    int format, width, height;
-
-    /* picture header */
-    if (get_bits_long(&s->gb, 17) != 1) {
-        av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
-        return -1;
-    }
-    format = get_bits(&s->gb, 5);
-    if (format != 0 && format != 1) {
-        av_log(s->avctx, AV_LOG_ERROR, "Bad picture format\n");
-        return -1;
-    }
-    s->h263_flv = format+1;
-    s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */
-    format = get_bits(&s->gb, 3);
-    switch (format) {
-    case 0:
-        width = get_bits(&s->gb, 8);
-        height = get_bits(&s->gb, 8);
-        break;
-    case 1:
-        width = get_bits(&s->gb, 16);
-        height = get_bits(&s->gb, 16);
-        break;
-    case 2:
-        width = 352;
-        height = 288;
-        break;
-    case 3:
-        width = 176;
-        height = 144;
-        break;
-    case 4:
-        width = 128;
-        height = 96;
-        break;
-    case 5:
-        width = 320;
-        height = 240;
-        break;
-    case 6:
-        width = 160;
-        height = 120;
-        break;
-    default:
-        width = height = 0;
-        break;
-    }
-    if(av_image_check_size(width, height, 0, s->avctx))
-        return -1;
-    s->width = width;
-    s->height = height;
-
-    s->pict_type = AV_PICTURE_TYPE_I + get_bits(&s->gb, 2);
-    s->droppable = s->pict_type > AV_PICTURE_TYPE_P;
-    if (s->droppable)
-        s->pict_type = AV_PICTURE_TYPE_P;
-
-    skip_bits1(&s->gb); /* deblocking flag */
-    s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
-
-    s->h263_plus = 0;
-
-    s->unrestricted_mv = 1;
-    s->h263_long_vectors = 0;
-
-    /* PEI */
-    while (get_bits1(&s->gb) != 0) {
-        skip_bits(&s->gb, 8);
-    }
-    s->f_code = 1;
-
-    if(s->avctx->debug & FF_DEBUG_PICT_INFO){
-        av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n",
-               s->droppable ? 'D' : av_get_picture_type_char(s->pict_type),
-               s->h263_flv - 1, s->qscale, s->picture_number);
-    }
-
-    s->y_dc_scale_table=
-    s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-
-    return 0;
-}
-
-AVCodec ff_flv_decoder = {
-    .name           = "flv",
-    .long_name      = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FLV1,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_h263_decode_init,
-    .close          = ff_h263_decode_end,
-    .decode         = ff_h263_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .pix_fmts       = ff_pixfmt_list_420,
-};
diff --git a/deps/libav/libavcodec/flvenc.c b/deps/libav/libavcodec/flvenc.c
deleted file mode 100644
index fbdb23d..0000000
--- a/deps/libav/libavcodec/flvenc.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * FLV Encoding specific code.
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "mpegvideo.h"
-#include "h263.h"
-#include "flv.h"
-
-void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number)
-{
-      int format;
-
-      avpriv_align_put_bits(&s->pb);
-
-      put_bits(&s->pb, 17, 1);
-      put_bits(&s->pb, 5, (s->h263_flv-1)); /* 0: h263 escape codes 1: 11-bit escape codes */
-      put_bits(&s->pb, 8, (((int64_t)s->picture_number * 30 * s->avctx->time_base.num) / //FIXME use timestamp
-                           s->avctx->time_base.den) & 0xff); /* TemporalReference */
-      if (s->width == 352 && s->height == 288)
-        format = 2;
-      else if (s->width == 176 && s->height == 144)
-        format = 3;
-      else if (s->width == 128 && s->height == 96)
-        format = 4;
-      else if (s->width == 320 && s->height == 240)
-        format = 5;
-      else if (s->width == 160 && s->height == 120)
-        format = 6;
-      else if (s->width <= 255 && s->height <= 255)
-        format = 0; /* use 1 byte width & height */
-      else
-        format = 1; /* use 2 bytes width & height */
-      put_bits(&s->pb, 3, format); /* PictureSize */
-      if (format == 0) {
-        put_bits(&s->pb, 8, s->width);
-        put_bits(&s->pb, 8, s->height);
-      } else if (format == 1) {
-        put_bits(&s->pb, 16, s->width);
-        put_bits(&s->pb, 16, s->height);
-      }
-      put_bits(&s->pb, 2, s->pict_type == AV_PICTURE_TYPE_P); /* PictureType */
-      put_bits(&s->pb, 1, 1); /* DeblockingFlag: on */
-      put_bits(&s->pb, 5, s->qscale); /* Quantizer */
-      put_bits(&s->pb, 1, 0); /* ExtraInformation */
-
-      if(s->h263_aic){
-        s->y_dc_scale_table=
-          s->c_dc_scale_table= ff_aic_dc_scale_table;
-      }else{
-        s->y_dc_scale_table=
-          s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-      }
-}
-
-void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run, int last){
-    if(level < 64) { // 7-bit level
-        put_bits(pb, 1, 0);
-        put_bits(pb, 1, last);
-        put_bits(pb, 6, run);
-
-        put_sbits(pb, 7, slevel);
-    } else {
-        /* 11-bit level */
-        put_bits(pb, 1, 1);
-        put_bits(pb, 1, last);
-        put_bits(pb, 6, run);
-
-        put_sbits(pb, 11, slevel);
-    }
-}
-
-FF_MPV_GENERIC_CLASS(flv)
-
-AVCodec ff_flv_encoder = {
-    .name           = "flv",
-    .long_name      = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FLV1,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &flv_class,
-};
diff --git a/deps/libav/libavcodec/fmtconvert.c b/deps/libav/libavcodec/fmtconvert.c
deleted file mode 100644
index 63f62c3..0000000
--- a/deps/libav/libavcodec/fmtconvert.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Format Conversion Utils
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "fmtconvert.h"
-#include "libavutil/common.h"
-
-static void int32_to_float_fmul_scalar_c(float *dst, const int32_t *src,
-                                         float mul, int len)
-{
-    int i;
-    for(i=0; i<len; i++)
-        dst[i] = src[i] * mul;
-}
-
-static void int32_to_float_fmul_array8_c(FmtConvertContext *c, float *dst,
-                                         const int32_t *src, const float *mul,
-                                         int len)
-{
-    int i;
-    for (i = 0; i < len; i += 8)
-        c->int32_to_float_fmul_scalar(&dst[i], &src[i], *mul++, 8);
-}
-
-static av_always_inline int float_to_int16_one(const float *src){
-    return av_clip_int16(lrintf(*src));
-}
-
-static void float_to_int16_c(int16_t *dst, const float *src, long len)
-{
-    int i;
-    for(i=0; i<len; i++)
-        dst[i] = float_to_int16_one(src+i);
-}
-
-static void float_to_int16_interleave_c(int16_t *dst, const float **src,
-                                        long len, int channels)
-{
-    int i,j,c;
-    if(channels==2){
-        for(i=0; i<len; i++){
-            dst[2*i]   = float_to_int16_one(src[0]+i);
-            dst[2*i+1] = float_to_int16_one(src[1]+i);
-        }
-    }else{
-        for(c=0; c<channels; c++)
-            for(i=0, j=c; i<len; i++, j+=channels)
-                dst[j] = float_to_int16_one(src[c]+i);
-    }
-}
-
-void ff_float_interleave_c(float *dst, const float **src, unsigned int len,
-                           int channels)
-{
-    int j, c;
-    unsigned int i;
-    if (channels == 2) {
-        for (i = 0; i < len; i++) {
-            dst[2*i]   = src[0][i];
-            dst[2*i+1] = src[1][i];
-        }
-    } else if (channels == 1 && len < INT_MAX / sizeof(float)) {
-        memcpy(dst, src[0], len * sizeof(float));
-    } else {
-        for (c = 0; c < channels; c++)
-            for (i = 0, j = c; i < len; i++, j += channels)
-                dst[j] = src[c][i];
-    }
-}
-
-av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx)
-{
-    c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c;
-    c->int32_to_float_fmul_array8 = int32_to_float_fmul_array8_c;
-    c->float_to_int16             = float_to_int16_c;
-    c->float_to_int16_interleave  = float_to_int16_interleave_c;
-    c->float_interleave           = ff_float_interleave_c;
-
-    if (ARCH_ARM) ff_fmt_convert_init_arm(c, avctx);
-    if (ARCH_PPC) ff_fmt_convert_init_ppc(c, avctx);
-    if (ARCH_X86) ff_fmt_convert_init_x86(c, avctx);
-}
diff --git a/deps/libav/libavcodec/fmtconvert.h b/deps/libav/libavcodec/fmtconvert.h
deleted file mode 100644
index bd833ef..0000000
--- a/deps/libav/libavcodec/fmtconvert.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Format Conversion Utils
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_FMTCONVERT_H
-#define AVCODEC_FMTCONVERT_H
-
-#include "avcodec.h"
-
-typedef struct FmtConvertContext {
-    /**
-     * Convert an array of int32_t to float and multiply by a float value.
-     * @param dst destination array of float.
-     *            constraints: 16-byte aligned
-     * @param src source array of int32_t.
-     *            constraints: 16-byte aligned
-     * @param len number of elements to convert.
-     *            constraints: multiple of 8
-     */
-    void (*int32_to_float_fmul_scalar)(float *dst, const int32_t *src,
-                                       float mul, int len);
-
-    /**
-     * Convert an array of int32_t to float and multiply by a float value from another array,
-     * stepping along the float array once for each 8 integers.
-     * @param c   pointer to FmtConvertContext.
-     * @param dst destination array of float.
-     *            constraints: 16-byte aligned
-     * @param src source array of int32_t.
-     *            constraints: 16-byte aligned
-     * @param mul source array of float multipliers.
-     * @param len number of elements to convert.
-     *            constraints: multiple of 8
-     */
-    void (*int32_to_float_fmul_array8)(struct FmtConvertContext *c,
-                                       float *dst, const int32_t *src,
-                                       const float *mul, int len);
-
-    /**
-     * Convert an array of float to an array of int16_t.
-     *
-     * Convert floats from in the range [-32768.0,32767.0] to ints
-     * without rescaling
-     *
-     * @param dst destination array of int16_t.
-     *            constraints: 16-byte aligned
-     * @param src source array of float.
-     *            constraints: 16-byte aligned
-     * @param len number of elements to convert.
-     *            constraints: multiple of 8
-     */
-    void (*float_to_int16)(int16_t *dst, const float *src, long len);
-
-    /**
-     * Convert multiple arrays of float to an interleaved array of int16_t.
-     *
-     * Convert floats from in the range [-32768.0,32767.0] to ints
-     * without rescaling
-     *
-     * @param dst destination array of interleaved int16_t.
-     *            constraints: 16-byte aligned
-     * @param src source array of float arrays, one for each channel.
-     *            constraints: 16-byte aligned
-     * @param len number of elements to convert.
-     *            constraints: multiple of 8
-     * @param channels number of channels
-     */
-    void (*float_to_int16_interleave)(int16_t *dst, const float **src,
-                                      long len, int channels);
-
-    /**
-     * Convert multiple arrays of float to an array of interleaved float.
-     *
-     * @param dst destination array of interleaved float.
-     *            constraints: 16-byte aligned
-     * @param src source array of float arrays, one for each channel.
-     *            constraints: 16-byte aligned
-     * @param len number of elements to convert.
-     *            constraints: multiple of 8
-     * @param channels number of channels
-     */
-    void (*float_interleave)(float *dst, const float **src, unsigned int len,
-                             int channels);
-} FmtConvertContext;
-
-void ff_float_interleave_c(float *dst, const float **src, unsigned int len,
-                           int channels);
-
-void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx);
-
-void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx);
-void ff_fmt_convert_init_ppc(FmtConvertContext *c, AVCodecContext *avctx);
-void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx);
-
-#endif /* AVCODEC_FMTCONVERT_H */
diff --git a/deps/libav/libavcodec/fraps.c b/deps/libav/libavcodec/fraps.c
deleted file mode 100644
index f12e4e0..0000000
--- a/deps/libav/libavcodec/fraps.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Fraps FPS1 decoder
- * Copyright (c) 2005 Roine Gustafsson
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Lossless Fraps 'FPS1' decoder
- * @author Roine Gustafsson (roine at users sf net)
- * @author Konstantin Shishkov
- *
- * Codec algorithm for version 0 is taken from Transcode <www.transcoding.org>
- *
- * Version 2 files support by Konstantin Shishkov
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "huffman.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "internal.h"
-
-#define FPS_TAG MKTAG('F', 'P', 'S', 'x')
-
-/**
- * local variable storage
- */
-typedef struct FrapsContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-    uint8_t *tmpbuf;
-    int tmpbuf_size;
-    DSPContext dsp;
-} FrapsContext;
-
-
-/**
- * initializes decoder
- * @param avctx codec context
- * @return 0 on success or negative if fails
- */
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    FrapsContext * const s = avctx->priv_data;
-
-    avctx->pix_fmt     = AV_PIX_FMT_NONE; /* set in decode_frame */
-
-    s->avctx  = avctx;
-    s->tmpbuf = NULL;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    ff_dsputil_init(&s->dsp, avctx);
-
-    return 0;
-}
-
-/**
- * Comparator - our nodes should ascend by count
- * but with preserved symbol order
- */
-static int huff_cmp(const void *va, const void *vb)
-{
-    const Node *a = va, *b = vb;
-    return (a->count - b->count)*256 + a->sym - b->sym;
-}
-
-/**
- * decode Fraps v2 packed plane
- */
-static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
-                               int h, const uint8_t *src, int size, int Uoff,
-                               const int step)
-{
-    int i, j, ret;
-    GetBitContext gb;
-    VLC vlc;
-    Node nodes[512];
-
-    for (i = 0; i < 256; i++)
-        nodes[i].count = bytestream_get_le32(&src);
-    size -= 1024;
-    if ((ret = ff_huff_build_tree(s->avctx, &vlc, 256, nodes, huff_cmp,
-                                  FF_HUFFMAN_FLAG_ZERO_COUNT)) < 0)
-        return ret;
-    /* we have built Huffman table and are ready to decode plane */
-
-    /* convert bits so they may be used by standard bitreader */
-    s->dsp.bswap_buf((uint32_t *)s->tmpbuf, (const uint32_t *)src, size >> 2);
-
-    init_get_bits(&gb, s->tmpbuf, size * 8);
-    for (j = 0; j < h; j++) {
-        for (i = 0; i < w*step; i += step) {
-            dst[i] = get_vlc2(&gb, vlc.table, 9, 3);
-            /* lines are stored as deltas between previous lines
-             * and we need to add 0x80 to the first lines of chroma planes
-             */
-            if (j)
-                dst[i] += dst[i - stride];
-            else if (Uoff)
-                dst[i] += 0x80;
-            if (get_bits_left(&gb) < 0) {
-                ff_free_vlc(&vlc);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        dst += stride;
-    }
-    ff_free_vlc(&vlc);
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    FrapsContext * const s = avctx->priv_data;
-    const uint8_t *buf     = avpkt->data;
-    int buf_size           = avpkt->size;
-    AVFrame *frame         = data;
-    AVFrame * const f      = s->frame;
-    uint32_t header;
-    unsigned int version,header_size;
-    unsigned int x, y;
-    const uint32_t *buf32;
-    uint32_t *luma1,*luma2,*cb,*cr;
-    uint32_t offs[4];
-    int i, j, ret, is_chroma, planes;
-    enum AVPixelFormat pix_fmt;
-    int prev_pic_bit, expected_size;
-
-    if (buf_size < 4) {
-        av_log(avctx, AV_LOG_ERROR, "Packet is too short\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    header      = AV_RL32(buf);
-    version     = header & 0xff;
-    header_size = (header & (1<<30))? 8 : 4; /* bit 30 means pad to 8 bytes */
-    prev_pic_bit = header & (1U << 31); /* bit 31 means same as previous pic */
-
-    if (version > 5) {
-        av_log(avctx, AV_LOG_ERROR,
-               "This file is encoded with Fraps version %d. " \
-               "This codec can only decode versions <= 5.\n", version);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    buf += 4;
-    if (header_size == 8)
-        buf += 4;
-
-    pix_fmt = version & 1 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUVJ420P;
-    if (avctx->pix_fmt != pix_fmt && f->data[0]) {
-        av_frame_unref(f);
-    }
-    avctx->pix_fmt = pix_fmt;
-
-    expected_size = header_size;
-
-    switch (version) {
-    case 0:
-    default:
-        /* Fraps v0 is a reordered YUV420 */
-        if (!prev_pic_bit)
-            expected_size += avctx->width * avctx->height * 3 / 2;
-        if (buf_size != expected_size) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid frame length %d (should be %d)\n",
-                   buf_size, expected_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (((avctx->width % 8) != 0) || ((avctx->height % 2) != 0)) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid frame size %dx%d\n",
-                   avctx->width, avctx->height);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if ((ret = ff_reget_buffer(avctx, f)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-            return ret;
-        }
-        f->pict_type = prev_pic_bit ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
-        f->key_frame = f->pict_type == AV_PICTURE_TYPE_I;
-
-        if (f->pict_type == AV_PICTURE_TYPE_I) {
-            buf32 = (const uint32_t*)buf;
-            for (y = 0; y < avctx->height / 2; y++) {
-                luma1 = (uint32_t*)&f->data[0][ y * 2      * f->linesize[0]];
-                luma2 = (uint32_t*)&f->data[0][(y * 2 + 1) * f->linesize[0]];
-                cr    = (uint32_t*)&f->data[1][ y          * f->linesize[1]];
-                cb    = (uint32_t*)&f->data[2][ y          * f->linesize[2]];
-                for (x = 0; x < avctx->width; x += 8) {
-                    *(luma1++) = *(buf32++);
-                    *(luma1++) = *(buf32++);
-                    *(luma2++) = *(buf32++);
-                    *(luma2++) = *(buf32++);
-                    *(cr++) = *(buf32++);
-                    *(cb++) = *(buf32++);
-                }
-            }
-        }
-        break;
-
-    case 1:
-        /* Fraps v1 is an upside-down BGR24 */
-        if (!prev_pic_bit)
-            expected_size += avctx->width * avctx->height * 3;
-        if (buf_size != expected_size) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid frame length %d (should be %d)\n",
-                   buf_size, expected_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if ((ret = ff_reget_buffer(avctx, f)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-            return ret;
-        }
-        f->pict_type = prev_pic_bit ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
-        f->key_frame = f->pict_type == AV_PICTURE_TYPE_I;
-
-        if (f->pict_type == AV_PICTURE_TYPE_I) {
-            for (y = 0; y<avctx->height; y++)
-                memcpy(&f->data[0][(avctx->height - y - 1) * f->linesize[0]],
-                       &buf[y * avctx->width * 3],
-                       3 * avctx->width);
-        }
-        break;
-
-    case 2:
-    case 4:
-        /**
-         * Fraps v2 is Huffman-coded YUV420 planes
-         * Fraps v4 is virtually the same
-         */
-        planes = 3;
-        if ((ret = ff_reget_buffer(avctx, f)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-            return ret;
-        }
-        /* skip frame */
-        if (buf_size == 8) {
-            f->pict_type = AV_PICTURE_TYPE_P;
-            f->key_frame = 0;
-            break;
-        }
-        f->pict_type = AV_PICTURE_TYPE_I;
-        f->key_frame = 1;
-        if ((AV_RL32(buf) != FPS_TAG) || (buf_size < (planes * 1024 + 24))) {
-            av_log(avctx, AV_LOG_ERROR, "Fraps: error in data stream\n");
-            return AVERROR_INVALIDDATA;
-        }
-        for (i = 0; i < planes; i++) {
-            offs[i] = AV_RL32(buf + 4 + i * 4);
-            if (offs[i] >= buf_size || (i && offs[i] <= offs[i - 1] + 1024)) {
-                av_log(avctx, AV_LOG_ERROR, "Fraps: plane %i offset is out of bounds\n", i);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        offs[planes] = buf_size;
-        for (i = 0; i < planes; i++) {
-            is_chroma = !!i;
-            av_fast_padded_malloc(&s->tmpbuf, &s->tmpbuf_size,
-                                  offs[i + 1] - offs[i] - 1024);
-            if (!s->tmpbuf)
-                return AVERROR(ENOMEM);
-            if ((ret = fraps2_decode_plane(s, f->data[i], f->linesize[i],
-                                           avctx->width  >> is_chroma,
-                                           avctx->height >> is_chroma,
-                                           buf + offs[i], offs[i + 1] - offs[i],
-                                           is_chroma, 1)) < 0) {
-                av_log(avctx, AV_LOG_ERROR, "Error decoding plane %i\n", i);
-                return ret;
-            }
-        }
-        break;
-    case 3:
-    case 5:
-        /* Virtually the same as version 4, but is for RGB24 */
-        planes = 3;
-        if ((ret = ff_reget_buffer(avctx, f)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-            return ret;
-        }
-        /* skip frame */
-        if (buf_size == 8) {
-            f->pict_type = AV_PICTURE_TYPE_P;
-            f->key_frame = 0;
-            break;
-        }
-        f->pict_type = AV_PICTURE_TYPE_I;
-        f->key_frame = 1;
-        if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) {
-            av_log(avctx, AV_LOG_ERROR, "Fraps: error in data stream\n");
-            return AVERROR_INVALIDDATA;
-        }
-        for (i = 0; i < planes; i++) {
-            offs[i] = AV_RL32(buf + 4 + i * 4);
-            if (offs[i] >= buf_size || (i && offs[i] <= offs[i - 1] + 1024)) {
-                av_log(avctx, AV_LOG_ERROR, "Fraps: plane %i offset is out of bounds\n", i);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        offs[planes] = buf_size;
-        for (i = 0; i < planes; i++) {
-            av_fast_padded_malloc(&s->tmpbuf, &s->tmpbuf_size,
-                                  offs[i + 1] - offs[i] - 1024);
-            if (!s->tmpbuf)
-                return AVERROR(ENOMEM);
-            if ((ret = fraps2_decode_plane(s, f->data[0] + i + (f->linesize[0] * (avctx->height - 1)),
-                                           -f->linesize[0], avctx->width, avctx->height,
-                                           buf + offs[i], offs[i + 1] - offs[i], 0, 3)) < 0) {
-                av_log(avctx, AV_LOG_ERROR, "Error decoding plane %i\n", i);
-                return ret;
-            }
-        }
-        // convert pseudo-YUV into real RGB
-        for (j = 0; j < avctx->height; j++) {
-            for (i = 0; i < avctx->width; i++) {
-                f->data[0][0 + i*3 + j*f->linesize[0]] += f->data[0][1 + i*3 + j*f->linesize[0]];
-                f->data[0][2 + i*3 + j*f->linesize[0]] += f->data[0][1 + i*3 + j*f->linesize[0]];
-            }
-        }
-        break;
-    }
-
-    if ((ret = av_frame_ref(frame, f)) < 0)
-        return ret;
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-
-/**
- * closes decoder
- * @param avctx codec context
- * @return 0 on success or negative if fails
- */
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    FrapsContext *s = (FrapsContext*)avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    av_freep(&s->tmpbuf);
-    return 0;
-}
-
-
-AVCodec ff_fraps_decoder = {
-    .name           = "fraps",
-    .long_name      = NULL_IF_CONFIG_SMALL("Fraps"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FRAPS,
-    .priv_data_size = sizeof(FrapsContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/frwu.c b/deps/libav/libavcodec/frwu.c
deleted file mode 100644
index 568b94f..0000000
--- a/deps/libav/libavcodec/frwu.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Forward Uncompressed
- *
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    if (avctx->width & 1) {
-        av_log(avctx, AV_LOG_ERROR, "frwu needs even width\n");
-        return AVERROR(EINVAL);
-    }
-    avctx->pix_fmt = AV_PIX_FMT_UYVY422;
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    int field, ret;
-    AVFrame *pic = data;
-    const uint8_t *buf = avpkt->data;
-    const uint8_t *buf_end = buf + avpkt->size;
-
-    if (avpkt->size < avctx->width * 2 * avctx->height + 4 + 2*8) {
-        av_log(avctx, AV_LOG_ERROR, "Packet is too small.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (bytestream_get_le32(&buf) != MKTAG('F', 'R', 'W', '1')) {
-        av_log(avctx, AV_LOG_ERROR, "incorrect marker\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    pic->pict_type = AV_PICTURE_TYPE_I;
-    pic->key_frame = 1;
-    pic->interlaced_frame = 1;
-    pic->top_field_first = 1;
-
-    for (field = 0; field < 2; field++) {
-        int i;
-        int field_h = (avctx->height + !field) >> 1;
-        int field_size, min_field_size = avctx->width * 2 * field_h;
-        uint8_t *dst = pic->data[0];
-        if (buf_end - buf < 8)
-            return AVERROR_INVALIDDATA;
-        buf += 4; // flags? 0x80 == bottom field maybe?
-        field_size = bytestream_get_le32(&buf);
-        if (field_size < min_field_size) {
-            av_log(avctx, AV_LOG_ERROR, "Field size %i is too small (required %i)\n", field_size, min_field_size);
-            return AVERROR_INVALIDDATA;
-        }
-        if (buf_end - buf < field_size) {
-            av_log(avctx, AV_LOG_ERROR, "Packet is too small, need %i, have %i\n", field_size, (int)(buf_end - buf));
-            return AVERROR_INVALIDDATA;
-        }
-        if (field)
-            dst += pic->linesize[0];
-        for (i = 0; i < field_h; i++) {
-            memcpy(dst, buf, avctx->width * 2);
-            buf += avctx->width * 2;
-            dst += pic->linesize[0] << 1;
-        }
-        buf += field_size - min_field_size;
-    }
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_frwu_decoder = {
-    .name           = "frwu",
-    .long_name      = NULL_IF_CONFIG_SMALL("Forward Uncompressed"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FRWU,
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/g2meet.c b/deps/libav/libavcodec/g2meet.c
deleted file mode 100644
index 89fafef..0000000
--- a/deps/libav/libavcodec/g2meet.c
+++ /dev/null
@@ -1,892 +0,0 @@
-/*
- * Go2Webinar decoder
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Go2Webinar decoder
- */
-
-#include <zlib.h>
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "mjpeg.h"
-
-enum ChunkType {
-    DISPLAY_INFO = 0xC8,
-    TILE_DATA,
-    CURSOR_POS,
-    CURSOR_SHAPE,
-    CHUNK_CC,
-    CHUNK_CD
-};
-
-enum Compression {
-    COMPR_EPIC_J_B = 2,
-    COMPR_KEMPF_J_B,
-};
-
-static const uint8_t luma_quant[64] = {
-     8,  6,  5,  8, 12, 20, 26, 31,
-     6,  6,  7, 10, 13, 29, 30, 28,
-     7,  7,  8, 12, 20, 29, 35, 28,
-     7,  9, 11, 15, 26, 44, 40, 31,
-     9, 11, 19, 28, 34, 55, 52, 39,
-    12, 18, 28, 32, 41, 52, 57, 46,
-    25, 32, 39, 44, 52, 61, 60, 51,
-    36, 46, 48, 49, 56, 50, 52, 50
-};
-
-static const uint8_t chroma_quant[64] = {
-     9,  9, 12, 24, 50, 50, 50, 50,
-     9, 11, 13, 33, 50, 50, 50, 50,
-    12, 13, 28, 50, 50, 50, 50, 50,
-    24, 33, 50, 50, 50, 50, 50, 50,
-    50, 50, 50, 50, 50, 50, 50, 50,
-    50, 50, 50, 50, 50, 50, 50, 50,
-    50, 50, 50, 50, 50, 50, 50, 50,
-    50, 50, 50, 50, 50, 50, 50, 50,
-};
-
-typedef struct JPGContext {
-    DSPContext dsp;
-    ScanTable  scantable;
-
-    VLC        dc_vlc[2], ac_vlc[2];
-    int        prev_dc[3];
-    DECLARE_ALIGNED(16, int16_t, block)[6][64];
-
-    uint8_t    *buf;
-} JPGContext;
-
-typedef struct G2MContext {
-    JPGContext jc;
-    int        version;
-
-    int        compression;
-    int        width, height, bpp;
-    int        tile_width, tile_height;
-    int        tiles_x, tiles_y, tile_x, tile_y;
-
-    int        got_header;
-
-    uint8_t    *framebuf;
-    int        framebuf_stride, old_width, old_height;
-
-    uint8_t    *synth_tile, *jpeg_tile;
-    int        tile_stride, old_tile_w, old_tile_h;
-
-    uint8_t    *kempf_buf, *kempf_flags;
-
-    uint8_t    *cursor;
-    int        cursor_stride;
-    int        cursor_fmt;
-    int        cursor_w, cursor_h, cursor_x, cursor_y;
-    int        cursor_hot_x, cursor_hot_y;
-} G2MContext;
-
-static av_cold int build_vlc(VLC *vlc, const uint8_t *bits_table,
-                             const uint8_t *val_table, int nb_codes,
-                             int is_ac)
-{
-    uint8_t  huff_size[256] = { 0 };
-    uint16_t huff_code[256];
-    uint16_t huff_sym[256];
-    int i;
-
-    ff_mjpeg_build_huffman_codes(huff_size, huff_code, bits_table, val_table);
-
-    for (i = 0; i < 256; i++)
-        huff_sym[i] = i + 16 * is_ac;
-
-    if (is_ac)
-        huff_sym[0] = 16 * 256;
-
-    return ff_init_vlc_sparse(vlc, 9, nb_codes, huff_size, 1, 1,
-                              huff_code, 2, 2, huff_sym, 2, 2, 0);
-}
-
-static av_cold int jpg_init(AVCodecContext *avctx, JPGContext *c)
-{
-    int ret;
-
-    ret = build_vlc(&c->dc_vlc[0], avpriv_mjpeg_bits_dc_luminance,
-                    avpriv_mjpeg_val_dc, 12, 0);
-    if (ret)
-        return ret;
-    ret = build_vlc(&c->dc_vlc[1], avpriv_mjpeg_bits_dc_chrominance,
-                    avpriv_mjpeg_val_dc, 12, 0);
-    if (ret)
-        return ret;
-    ret = build_vlc(&c->ac_vlc[0], avpriv_mjpeg_bits_ac_luminance,
-                    avpriv_mjpeg_val_ac_luminance, 251, 1);
-    if (ret)
-        return ret;
-    ret = build_vlc(&c->ac_vlc[1], avpriv_mjpeg_bits_ac_chrominance,
-                    avpriv_mjpeg_val_ac_chrominance, 251, 1);
-    if (ret)
-        return ret;
-
-    ff_dsputil_init(&c->dsp, avctx);
-    ff_init_scantable(c->dsp.idct_permutation, &c->scantable,
-                      ff_zigzag_direct);
-
-    return 0;
-}
-
-static av_cold void jpg_free_context(JPGContext *ctx)
-{
-    int i;
-
-    for (i = 0; i < 2; i++) {
-        ff_free_vlc(&ctx->dc_vlc[i]);
-        ff_free_vlc(&ctx->ac_vlc[i]);
-    }
-
-    av_freep(&ctx->buf);
-}
-
-static void jpg_unescape(const uint8_t *src, int src_size,
-                         uint8_t *dst, int *dst_size)
-{
-    const uint8_t *src_end = src + src_size;
-    uint8_t *dst_start = dst;
-
-    while (src < src_end) {
-        uint8_t x = *src++;
-
-        *dst++ = x;
-
-        if (x == 0xFF && !*src)
-            src++;
-    }
-    *dst_size = dst - dst_start;
-}
-
-static int jpg_decode_block(JPGContext *c, GetBitContext *gb,
-                            int plane, int16_t *block)
-{
-    int dc, val, pos;
-    const int is_chroma = !!plane;
-    const uint8_t *qmat = is_chroma ? chroma_quant : luma_quant;
-
-    c->dsp.clear_block(block);
-    dc = get_vlc2(gb, c->dc_vlc[is_chroma].table, 9, 3);
-    if (dc < 0)
-        return AVERROR_INVALIDDATA;
-    if (dc)
-        dc = get_xbits(gb, dc);
-    dc = dc * qmat[0] + c->prev_dc[plane];
-    block[0] = dc;
-    c->prev_dc[plane] = dc;
-
-    pos = 0;
-    while (pos < 63) {
-        val = get_vlc2(gb, c->ac_vlc[is_chroma].table, 9, 3);
-        if (val < 0)
-            return AVERROR_INVALIDDATA;
-        pos += val >> 4;
-        val &= 0xF;
-        if (pos > 63)
-            return val ? AVERROR_INVALIDDATA : 0;
-        if (val) {
-            int nbits = val;
-
-            val = get_xbits(gb, nbits);
-            val *= qmat[ff_zigzag_direct[pos]];
-            block[c->scantable.permutated[pos]] = val;
-        }
-    }
-    return 0;
-}
-
-static inline void yuv2rgb(uint8_t *out, int Y, int U, int V)
-{
-    out[0] = av_clip_uint8(Y + (             91881 * V + 32768 >> 16));
-    out[1] = av_clip_uint8(Y + (-22554 * U - 46802 * V + 32768 >> 16));
-    out[2] = av_clip_uint8(Y + (116130 * U             + 32768 >> 16));
-}
-
-static int jpg_decode_data(JPGContext *c, int width, int height,
-                           const uint8_t *src, int src_size,
-                           uint8_t *dst, int dst_stride,
-                           const uint8_t *mask, int mask_stride, int num_mbs,
-                           int swapuv)
-{
-    GetBitContext gb;
-    int mb_w, mb_h, mb_x, mb_y, i, j;
-    int bx, by;
-    int unesc_size;
-    int ret;
-
-    if ((ret = av_reallocp(&c->buf,
-                           src_size + FF_INPUT_BUFFER_PADDING_SIZE)) < 0)
-        return ret;
-    jpg_unescape(src, src_size, c->buf, &unesc_size);
-    memset(c->buf + unesc_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    init_get_bits(&gb, c->buf, unesc_size * 8);
-
-    width = FFALIGN(width, 16);
-    mb_w  =  width        >> 4;
-    mb_h  = (height + 15) >> 4;
-
-    if (!num_mbs)
-        num_mbs = mb_w * mb_h * 4;
-
-    for (i = 0; i < 3; i++)
-        c->prev_dc[i] = 1024;
-    bx = by = 0;
-    c->dsp.clear_blocks(c->block[0]);
-    for (mb_y = 0; mb_y < mb_h; mb_y++) {
-        for (mb_x = 0; mb_x < mb_w; mb_x++) {
-            if (mask && !mask[mb_x * 2] && !mask[mb_x * 2 + 1] &&
-                !mask[mb_x * 2 +     mask_stride] &&
-                !mask[mb_x * 2 + 1 + mask_stride]) {
-                bx += 16;
-                continue;
-            }
-            for (j = 0; j < 2; j++) {
-                for (i = 0; i < 2; i++) {
-                    if (mask && !mask[mb_x * 2 + i + j * mask_stride])
-                        continue;
-                    num_mbs--;
-                    if ((ret = jpg_decode_block(c, &gb, 0,
-                                                c->block[i + j * 2])) != 0)
-                        return ret;
-                    c->dsp.idct(c->block[i + j * 2]);
-                }
-            }
-            for (i = 1; i < 3; i++) {
-                if ((ret = jpg_decode_block(c, &gb, i, c->block[i + 3])) != 0)
-                    return ret;
-                c->dsp.idct(c->block[i + 3]);
-            }
-
-            for (j = 0; j < 16; j++) {
-                uint8_t *out = dst + bx * 3 + (by + j) * dst_stride;
-                for (i = 0; i < 16; i++) {
-                    int Y, U, V;
-
-                    Y = c->block[(j >> 3) * 2 + (i >> 3)][(i & 7) + (j & 7) * 8];
-                    U = c->block[4 ^ swapuv][(i >> 1) + (j >> 1) * 8] - 128;
-                    V = c->block[5 ^ swapuv][(i >> 1) + (j >> 1) * 8] - 128;
-                    yuv2rgb(out + i * 3, Y, U, V);
-                }
-            }
-
-            if (!num_mbs)
-                return 0;
-            bx += 16;
-        }
-        bx  = 0;
-        by += 16;
-        if (mask)
-            mask += mask_stride * 2;
-    }
-
-    return 0;
-}
-
-static void kempf_restore_buf(const uint8_t *src, int len,
-                              uint8_t *dst, int stride,
-                              const uint8_t *jpeg_tile, int tile_stride,
-                              int width, int height,
-                              const uint8_t *pal, int npal, int tidx)
-{
-    GetBitContext gb;
-    int i, j, nb, col;
-
-    init_get_bits(&gb, src, len * 8);
-
-    if (npal <= 2)       nb = 1;
-    else if (npal <= 4)  nb = 2;
-    else if (npal <= 16) nb = 4;
-    else                 nb = 8;
-
-    for (j = 0; j < height; j++, dst += stride, jpeg_tile += tile_stride) {
-        if (get_bits(&gb, 8))
-            continue;
-        for (i = 0; i < width; i++) {
-            col = get_bits(&gb, nb);
-            if (col != tidx)
-                memcpy(dst + i * 3, pal + col * 3, 3);
-            else
-                memcpy(dst + i * 3, jpeg_tile + i * 3, 3);
-        }
-    }
-}
-
-static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
-                             const uint8_t *src, int src_size)
-{
-    int width, height;
-    int hdr, zsize, npal, tidx = -1, ret;
-    int i, j;
-    const uint8_t *src_end = src + src_size;
-    uint8_t pal[768], transp[3];
-    uLongf dlen = (c->tile_width + 1) * c->tile_height;
-    int sub_type;
-    int nblocks, cblocks, bstride;
-    int bits, bitbuf, coded;
-    uint8_t *dst = c->framebuf + tile_x * c->tile_width * 3 +
-                   tile_y * c->tile_height * c->framebuf_stride;
-
-    if (src_size < 2)
-        return AVERROR_INVALIDDATA;
-
-    width  = FFMIN(c->width  - tile_x * c->tile_width,  c->tile_width);
-    height = FFMIN(c->height - tile_y * c->tile_height, c->tile_height);
-
-    hdr = *src++;
-    sub_type = hdr >> 5;
-    if (sub_type == 0) {
-        int j;
-        memcpy(transp, src, 3);
-        src += 3;
-        for (j = 0; j < height; j++, dst += c->framebuf_stride)
-            for (i = 0; i < width; i++)
-                memcpy(dst + i * 3, transp, 3);
-        return 0;
-    } else if (sub_type == 1) {
-        return jpg_decode_data(&c->jc, width, height, src, src_end - src,
-                               dst, c->framebuf_stride, NULL, 0, 0, 0);
-    }
-
-    if (sub_type != 2) {
-        memcpy(transp, src, 3);
-        src += 3;
-    }
-    npal = *src++ + 1;
-    memcpy(pal, src, npal * 3); src += npal * 3;
-    if (sub_type != 2) {
-        for (i = 0; i < npal; i++) {
-            if (!memcmp(pal + i * 3, transp, 3)) {
-               tidx = i;
-               break;
-            }
-        }
-    }
-
-    if (src_end - src < 2)
-        return 0;
-    zsize = (src[0] << 8) | src[1]; src += 2;
-
-    if (src_end - src < zsize)
-        return AVERROR_INVALIDDATA;
-
-    ret = uncompress(c->kempf_buf, &dlen, src, zsize);
-    if (ret)
-        return AVERROR_INVALIDDATA;
-    src += zsize;
-
-    if (sub_type == 2) {
-        kempf_restore_buf(c->kempf_buf, dlen, dst, c->framebuf_stride,
-                          NULL, 0, width, height, pal, npal, tidx);
-        return 0;
-    }
-
-    nblocks = *src++ + 1;
-    cblocks = 0;
-    bstride = FFALIGN(width, 16) >> 3;
-    // blocks are coded LSB and we need normal bitreader for JPEG data
-    bits = 0;
-    for (i = 0; i < (FFALIGN(height, 16) >> 4); i++) {
-        for (j = 0; j < (FFALIGN(width, 16) >> 4); j++) {
-            if (!bits) {
-                bitbuf = *src++;
-                bits   = 8;
-            }
-            coded = bitbuf & 1;
-            bits--;
-            bitbuf >>= 1;
-            cblocks += coded;
-            if (cblocks > nblocks)
-                return AVERROR_INVALIDDATA;
-            c->kempf_flags[j * 2 +      i * 2      * bstride] =
-            c->kempf_flags[j * 2 + 1 +  i * 2      * bstride] =
-            c->kempf_flags[j * 2 +     (i * 2 + 1) * bstride] =
-            c->kempf_flags[j * 2 + 1 + (i * 2 + 1) * bstride] = coded;
-        }
-    }
-
-    memset(c->jpeg_tile, 0, c->tile_stride * height);
-    jpg_decode_data(&c->jc, width, height, src, src_end - src,
-                    c->jpeg_tile, c->tile_stride,
-                    c->kempf_flags, bstride, nblocks * 4, 0);
-
-    kempf_restore_buf(c->kempf_buf, dlen, dst, c->framebuf_stride,
-                      c->jpeg_tile, c->tile_stride,
-                      width, height, pal, npal, tidx);
-
-    return 0;
-}
-
-static int g2m_init_buffers(G2MContext *c)
-{
-    int aligned_height;
-
-    if (!c->framebuf || c->old_width < c->width || c->old_height < c->height) {
-        c->framebuf_stride = FFALIGN(c->width * 3, 16);
-        aligned_height     = FFALIGN(c->height,    16);
-        av_free(c->framebuf);
-        c->framebuf = av_mallocz(c->framebuf_stride * aligned_height);
-        if (!c->framebuf)
-            return AVERROR(ENOMEM);
-    }
-    if (!c->synth_tile || !c->jpeg_tile ||
-        c->old_tile_w < c->tile_width ||
-        c->old_tile_h < c->tile_height) {
-        c->tile_stride = FFALIGN(c->tile_width * 3, 16);
-        aligned_height = FFALIGN(c->tile_height,    16);
-        av_free(c->synth_tile);
-        av_free(c->jpeg_tile);
-        av_free(c->kempf_buf);
-        av_free(c->kempf_flags);
-        c->synth_tile  = av_mallocz(c->tile_stride      * aligned_height);
-        c->jpeg_tile   = av_mallocz(c->tile_stride      * aligned_height);
-        c->kempf_buf   = av_mallocz((c->tile_width + 1) * aligned_height
-                                    + FF_INPUT_BUFFER_PADDING_SIZE);
-        c->kempf_flags = av_mallocz( c->tile_width      * aligned_height);
-        if (!c->synth_tile || !c->jpeg_tile ||
-            !c->kempf_buf || !c->kempf_flags)
-            return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static int g2m_load_cursor(AVCodecContext *avctx, G2MContext *c,
-                           GetByteContext *gb)
-{
-    int i, j, k;
-    uint8_t *dst;
-    uint32_t bits;
-    uint32_t cur_size, cursor_w, cursor_h, cursor_stride;
-    uint32_t cursor_hot_x, cursor_hot_y;
-    int cursor_fmt, err;
-
-    cur_size      = bytestream2_get_be32(gb);
-    cursor_w      = bytestream2_get_byte(gb);
-    cursor_h      = bytestream2_get_byte(gb);
-    cursor_hot_x  = bytestream2_get_byte(gb);
-    cursor_hot_y  = bytestream2_get_byte(gb);
-    cursor_fmt    = bytestream2_get_byte(gb);
-
-    cursor_stride = FFALIGN(cursor_w, 32) * 4;
-
-    if (cursor_w < 1 || cursor_w > 256 ||
-        cursor_h < 1 || cursor_h > 256) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid cursor dimensions %dx%d\n",
-               cursor_w, cursor_h);
-        return AVERROR_INVALIDDATA;
-    }
-    if (cursor_hot_x > cursor_w || cursor_hot_y > cursor_h) {
-        av_log(avctx, AV_LOG_WARNING, "Invalid hotspot position %d,%d\n",
-               cursor_hot_x, cursor_hot_y);
-        cursor_hot_x = FFMIN(cursor_hot_x, cursor_w - 1);
-        cursor_hot_y = FFMIN(cursor_hot_y, cursor_h - 1);
-    }
-    if (cur_size - 9 > bytestream2_get_bytes_left(gb) ||
-        c->cursor_w * c->cursor_h / 4 > cur_size) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %d/%d\n",
-               cur_size, bytestream2_get_bytes_left(gb));
-        return AVERROR_INVALIDDATA;
-    }
-    if (cursor_fmt != 1 && cursor_fmt != 32) {
-        avpriv_report_missing_feature(avctx, "Cursor format %d",
-                                      cursor_fmt);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if ((err = av_reallocp(&c->cursor, cursor_stride * cursor_h)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot allocate cursor buffer\n");
-        return err;
-    }
-
-    c->cursor_w      = cursor_w;
-    c->cursor_h      = cursor_h;
-    c->cursor_hot_x  = cursor_hot_x;
-    c->cursor_hot_y  = cursor_hot_y;
-    c->cursor_fmt    = cursor_fmt;
-    c->cursor_stride = cursor_stride;
-
-    dst = c->cursor;
-    switch (c->cursor_fmt) {
-    case 1: // old monochrome
-        for (j = 0; j < c->cursor_h; j++) {
-            for (i = 0; i < c->cursor_w; i += 32) {
-                bits = bytestream2_get_be32(gb);
-                for (k = 0; k < 32; k++) {
-                    dst[0] = !!(bits & 0x80000000);
-                    dst += 4;
-                    bits <<= 1;
-                }
-            }
-            dst += c->cursor_stride - c->cursor_w * 4;
-        }
-
-        dst = c->cursor;
-        for (j = 0; j < c->cursor_h; j++) {
-            for (i = 0; i < c->cursor_w; i += 32) {
-                bits = bytestream2_get_be32(gb);
-                for (k = 0; k < 32; k++) {
-                    int mask_bit = !!(bits & 0x80000000);
-                    switch (dst[0] * 2 + mask_bit) {
-                    case 0:
-                        dst[0] = 0xFF; dst[1] = 0x00;
-                        dst[2] = 0x00; dst[3] = 0x00;
-                        break;
-                    case 1:
-                        dst[0] = 0xFF; dst[1] = 0xFF;
-                        dst[2] = 0xFF; dst[3] = 0xFF;
-                        break;
-                    default:
-                        dst[0] = 0x00; dst[1] = 0x00;
-                        dst[2] = 0x00; dst[3] = 0x00;
-                    }
-                    dst += 4;
-                    bits <<= 1;
-                }
-            }
-            dst += c->cursor_stride - c->cursor_w * 4;
-        }
-        break;
-    case 32: // full colour
-        /* skip monochrome version of the cursor and decode RGBA instead */
-        bytestream2_skip(gb, c->cursor_h * (FFALIGN(c->cursor_w, 32) >> 3));
-        for (j = 0; j < c->cursor_h; j++) {
-            for (i = 0; i < c->cursor_w; i++) {
-                int val = bytestream2_get_be32(gb);
-                *dst++ = val >>  0;
-                *dst++ = val >>  8;
-                *dst++ = val >> 16;
-                *dst++ = val >> 24;
-            }
-            dst += c->cursor_stride - c->cursor_w * 4;
-        }
-        break;
-    default:
-        return AVERROR_PATCHWELCOME;
-    }
-    return 0;
-}
-
-#define APPLY_ALPHA(src, new, alpha) \
-    src = (src * (256 - alpha) + new * alpha) >> 8
-
-static void g2m_paint_cursor(G2MContext *c, uint8_t *dst, int stride)
-{
-    int i, j;
-    int x, y, w, h;
-    const uint8_t *cursor;
-
-    if (!c->cursor)
-        return;
-
-    x = c->cursor_x - c->cursor_hot_x;
-    y = c->cursor_y - c->cursor_hot_y;
-
-    cursor = c->cursor;
-    w      = c->cursor_w;
-    h      = c->cursor_h;
-
-    if (x + w > c->width)
-        w = c->width - x;
-    if (y + h > c->height)
-        h = c->height - y;
-    if (x < 0) {
-        w      +=  x;
-        cursor += -x * 4;
-    } else {
-        dst    +=  x * 3;
-    }
-    if (y < 0) {
-        h      +=  y;
-        cursor += -y * c->cursor_stride;
-    } else {
-        dst    +=  y * stride;
-    }
-    if (w < 0 || h < 0)
-        return;
-
-    for (j = 0; j < h; j++) {
-        for (i = 0; i < w; i++) {
-            uint8_t alpha = cursor[i * 4];
-            APPLY_ALPHA(dst[i * 3 + 0], cursor[i * 4 + 1], alpha);
-            APPLY_ALPHA(dst[i * 3 + 1], cursor[i * 4 + 2], alpha);
-            APPLY_ALPHA(dst[i * 3 + 2], cursor[i * 4 + 3], alpha);
-        }
-        dst    += stride;
-        cursor += c->cursor_stride;
-    }
-}
-
-static int g2m_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_picture_ptr, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    G2MContext *c = avctx->priv_data;
-    AVFrame *pic = data;
-    GetByteContext bc, tbc;
-    int magic;
-    int got_header = 0;
-    uint32_t chunk_size, r_mask, g_mask, b_mask;
-    int chunk_type, chunk_start;
-    int i;
-    int ret;
-
-    if (buf_size < 12) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Frame should have at least 12 bytes, got %d instead\n",
-               buf_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    bytestream2_init(&bc, buf, buf_size);
-
-    magic = bytestream2_get_be32(&bc);
-    if ((magic & ~0xF) != MKBETAG('G', '2', 'M', '0') ||
-        (magic & 0xF) < 2 || (magic & 0xF) > 4) {
-        av_log(avctx, AV_LOG_ERROR, "Wrong magic %08X\n", magic);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((magic & 0xF) != 4) {
-        av_log(avctx, AV_LOG_ERROR, "G2M2 and G2M3 are not yet supported\n");
-        return AVERROR(ENOSYS);
-    }
-
-    while (bytestream2_get_bytes_left(&bc) > 5) {
-        chunk_size  = bytestream2_get_le32(&bc) - 1;
-        chunk_type  = bytestream2_get_byte(&bc);
-        chunk_start = bytestream2_tell(&bc);
-        if (chunk_size > bytestream2_get_bytes_left(&bc)) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid chunk size %d type %02X\n",
-                   chunk_size, chunk_type);
-            break;
-        }
-        switch (chunk_type) {
-        case DISPLAY_INFO:
-            c->got_header = 0;
-            if (chunk_size < 21) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid display info size %d\n",
-                       chunk_size);
-                break;
-            }
-            c->width  = bytestream2_get_be32(&bc);
-            c->height = bytestream2_get_be32(&bc);
-            if (c->width  < 16 || c->width  > avctx->width ||
-                c->height < 16 || c->height > avctx->height) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Invalid frame dimensions %dx%d\n",
-                       c->width, c->height);
-                ret = AVERROR_INVALIDDATA;
-                goto header_fail;
-            }
-            if (c->width != avctx->width || c->height != avctx->height)
-                ff_set_dimensions(avctx, c->width, c->height);
-            c->compression = bytestream2_get_be32(&bc);
-            if (c->compression != 2 && c->compression != 3) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Unknown compression method %d\n",
-                       c->compression);
-                return AVERROR_PATCHWELCOME;
-            }
-            c->tile_width  = bytestream2_get_be32(&bc);
-            c->tile_height = bytestream2_get_be32(&bc);
-            if (!c->tile_width || !c->tile_height ||
-                ((c->tile_width | c->tile_height) & 0xF)) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Invalid tile dimensions %dx%d\n",
-                       c->tile_width, c->tile_height);
-                ret = AVERROR_INVALIDDATA;
-                goto header_fail;
-            }
-            c->tiles_x = (c->width  + c->tile_width  - 1) / c->tile_width;
-            c->tiles_y = (c->height + c->tile_height - 1) / c->tile_height;
-            c->bpp = bytestream2_get_byte(&bc);
-            if (c->bpp == 32) {
-                if (bytestream2_get_bytes_left(&bc) < 16 ||
-                    (chunk_size - 21) < 16 ) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Display info: missing bitmasks!\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                r_mask = bytestream2_get_be32(&bc);
-                g_mask = bytestream2_get_be32(&bc);
-                b_mask = bytestream2_get_be32(&bc);
-                if (r_mask != 0xFF0000 || g_mask != 0xFF00 || b_mask != 0xFF) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Invalid or unsupported bitmasks: R=%X, G=%X, B=%X\n",
-                           r_mask, g_mask, b_mask);
-                    return AVERROR_PATCHWELCOME;
-                }
-            } else {
-                avpriv_request_sample(avctx, "bpp=%d", c->bpp);
-                return AVERROR_PATCHWELCOME;
-            }
-            if (g2m_init_buffers(c)) {
-                ret = AVERROR(ENOMEM);
-                goto header_fail;
-            }
-            got_header = 1;
-            break;
-        case TILE_DATA:
-            if (!c->tiles_x || !c->tiles_y) {
-                av_log(avctx, AV_LOG_WARNING,
-                       "No display info - skipping tile\n");
-                break;
-            }
-            if (chunk_size < 2) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid tile data size %d\n",
-                       chunk_size);
-                break;
-            }
-            c->tile_x = bytestream2_get_byte(&bc);
-            c->tile_y = bytestream2_get_byte(&bc);
-            if (c->tile_x >= c->tiles_x || c->tile_y >= c->tiles_y) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Invalid tile pos %d,%d (in %dx%d grid)\n",
-                       c->tile_x, c->tile_y, c->tiles_x, c->tiles_y);
-                break;
-            }
-            ret = 0;
-            switch (c->compression) {
-            case COMPR_EPIC_J_B:
-                av_log(avctx, AV_LOG_ERROR,
-                       "ePIC j-b compression is not implemented yet\n");
-                return AVERROR(ENOSYS);
-            case COMPR_KEMPF_J_B:
-                ret = kempf_decode_tile(c, c->tile_x, c->tile_y,
-                                        buf + bytestream2_tell(&bc),
-                                        chunk_size - 2);
-                break;
-            }
-            if (ret && c->framebuf)
-                av_log(avctx, AV_LOG_ERROR, "Error decoding tile %d,%d\n",
-                       c->tile_x, c->tile_y);
-            break;
-        case CURSOR_POS:
-            if (chunk_size < 5) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid cursor pos size %d\n",
-                       chunk_size);
-                break;
-            }
-            c->cursor_x = bytestream2_get_be16(&bc);
-            c->cursor_y = bytestream2_get_be16(&bc);
-            break;
-        case CURSOR_SHAPE:
-            if (chunk_size < 8) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid cursor data size %d\n",
-                       chunk_size);
-                break;
-            }
-            bytestream2_init(&tbc, buf + bytestream2_tell(&bc),
-                             chunk_size - 4);
-            g2m_load_cursor(avctx, c, &tbc);
-            break;
-        case CHUNK_CC:
-        case CHUNK_CD:
-            break;
-        default:
-            av_log(avctx, AV_LOG_WARNING, "Skipping chunk type %02X\n",
-                   chunk_type);
-        }
-
-        /* navigate to next chunk */
-        bytestream2_skip(&bc, chunk_start + chunk_size - bytestream2_tell(&bc));
-    }
-    if (got_header)
-        c->got_header = 1;
-
-    if (c->width && c->height) {
-        if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-
-        pic->key_frame = got_header;
-        pic->pict_type = got_header ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
-
-        for (i = 0; i < avctx->height; i++)
-            memcpy(pic->data[0] + i * pic->linesize[0],
-                   c->framebuf  + i * c->framebuf_stride,
-                   c->width * 3);
-        g2m_paint_cursor(c, pic->data[0], pic->linesize[0]);
-
-        *got_picture_ptr = 1;
-    }
-
-    return buf_size;
-header_fail:
-    c->width   = c->height  = 0;
-    c->tiles_x = c->tiles_y = 0;
-    return ret;
-}
-
-static av_cold int g2m_decode_init(AVCodecContext *avctx)
-{
-    G2MContext * const c = avctx->priv_data;
-    int ret;
-
-    if ((ret = jpg_init(avctx, &c->jc)) != 0) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n");
-        jpg_free_context(&c->jc);
-        return AVERROR(ENOMEM);
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_RGB24;
-
-    return 0;
-}
-
-static av_cold int g2m_decode_end(AVCodecContext *avctx)
-{
-    G2MContext * const c = avctx->priv_data;
-
-    jpg_free_context(&c->jc);
-
-    av_freep(&c->kempf_buf);
-    av_freep(&c->kempf_flags);
-    av_freep(&c->synth_tile);
-    av_freep(&c->jpeg_tile);
-    av_freep(&c->cursor);
-    av_freep(&c->framebuf);
-
-    return 0;
-}
-
-AVCodec ff_g2m_decoder = {
-    .name           = "g2m",
-    .long_name      = NULL_IF_CONFIG_SMALL("Go2Meeting"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_G2M,
-    .priv_data_size = sizeof(G2MContext),
-    .init           = g2m_decode_init,
-    .close          = g2m_decode_end,
-    .decode         = g2m_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/g722.c b/deps/libav/libavcodec/g722.c
deleted file mode 100644
index a911bc7..0000000
--- a/deps/libav/libavcodec/g722.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * G.722 ADPCM audio encoder/decoder
- *
- * Copyright (c) CMU 1993 Computer Science, Speech Group
- *                        Chengxiang Lu and Alex Hauptmann
- * Copyright (c) 2005 Steve Underwood <steveu at coppice.org>
- * Copyright (c) 2009 Kenan Gillet
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * G.722 ADPCM audio codec
- *
- * This G.722 decoder is a bit-exact implementation of the ITU G.722
- * specification for all three specified bitrates - 64000bps, 56000bps
- * and 48000bps. It passes the ITU tests.
- *
- * @note For the 56000bps and 48000bps bitrates, the lowest 1 or 2 bits
- *       respectively of each byte are ignored.
- */
-
-#include "mathops.h"
-#include "g722.h"
-
-static const int8_t sign_lookup[2] = { -1, 1 };
-
-static const int16_t inv_log2_table[32] = {
-    2048, 2093, 2139, 2186, 2233, 2282, 2332, 2383,
-    2435, 2489, 2543, 2599, 2656, 2714, 2774, 2834,
-    2896, 2960, 3025, 3091, 3158, 3228, 3298, 3371,
-    3444, 3520, 3597, 3676, 3756, 3838, 3922, 4008
-};
-static const int16_t high_log_factor_step[2] = { 798, -214 };
-const int16_t ff_g722_high_inv_quant[4] = { -926, -202, 926, 202 };
-/**
- * low_log_factor_step[index] == wl[rl42[index]]
- */
-static const int16_t low_log_factor_step[16] = {
-     -60, 3042, 1198, 538, 334, 172,  58, -30,
-    3042, 1198,  538, 334, 172,  58, -30, -60
-};
-const int16_t ff_g722_low_inv_quant4[16] = {
-       0, -2557, -1612, -1121,  -786,  -530,  -323,  -150,
-    2557,  1612,  1121,   786,   530,   323,   150,     0
-};
-const int16_t ff_g722_low_inv_quant6[64] = {
-     -17,   -17,   -17,   -17, -3101, -2738, -2376, -2088,
-   -1873, -1689, -1535, -1399, -1279, -1170, -1072,  -982,
-    -899,  -822,  -750,  -682,  -618,  -558,  -501,  -447,
-    -396,  -347,  -300,  -254,  -211,  -170,  -130,   -91,
-    3101,  2738,  2376,  2088,  1873,  1689,  1535,  1399,
-    1279,  1170,  1072,   982,   899,   822,   750,   682,
-     618,   558,   501,   447,   396,   347,   300,   254,
-     211,   170,   130,    91,    54,    17,   -54,   -17
-};
-
-/**
- * quadrature mirror filter (QMF) coefficients
- *
- * ITU-T G.722 Table 11
- */
-static const int16_t qmf_coeffs[12] = {
-    3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11,
-};
-
-
-/**
- * adaptive predictor
- *
- * @param cur_diff the dequantized and scaled delta calculated from the
- *                 current codeword
- */
-static void do_adaptive_prediction(struct G722Band *band, const int cur_diff)
-{
-    int sg[2], limit, i, cur_qtzd_reconst;
-
-    const int cur_part_reconst = band->s_zero + cur_diff < 0;
-
-    sg[0] = sign_lookup[cur_part_reconst != band->part_reconst_mem[0]];
-    sg[1] = sign_lookup[cur_part_reconst == band->part_reconst_mem[1]];
-    band->part_reconst_mem[1] = band->part_reconst_mem[0];
-    band->part_reconst_mem[0] = cur_part_reconst;
-
-    band->pole_mem[1] = av_clip((sg[0] * av_clip(band->pole_mem[0], -8191, 8191) >> 5) +
-                                (sg[1] << 7) + (band->pole_mem[1] * 127 >> 7), -12288, 12288);
-
-    limit = 15360 - band->pole_mem[1];
-    band->pole_mem[0] = av_clip(-192 * sg[0] + (band->pole_mem[0] * 255 >> 8), -limit, limit);
-
-
-    if (cur_diff) {
-        for (i = 0; i < 6; i++)
-            band->zero_mem[i] = ((band->zero_mem[i]*255) >> 8) +
-                                ((band->diff_mem[i]^cur_diff) < 0 ? -128 : 128);
-    } else
-        for (i = 0; i < 6; i++)
-            band->zero_mem[i] = (band->zero_mem[i]*255) >> 8;
-
-    for (i = 5; i > 0; i--)
-        band->diff_mem[i] = band->diff_mem[i-1];
-    band->diff_mem[0] = av_clip_int16(cur_diff << 1);
-
-    band->s_zero = 0;
-    for (i = 5; i >= 0; i--)
-        band->s_zero += (band->zero_mem[i]*band->diff_mem[i]) >> 15;
-
-
-    cur_qtzd_reconst = av_clip_int16((band->s_predictor + cur_diff) << 1);
-    band->s_predictor = av_clip_int16(band->s_zero +
-                                      (band->pole_mem[0] * cur_qtzd_reconst >> 15) +
-                                      (band->pole_mem[1] * band->prev_qtzd_reconst >> 15));
-    band->prev_qtzd_reconst = cur_qtzd_reconst;
-}
-
-static inline int linear_scale_factor(const int log_factor)
-{
-    const int wd1 = inv_log2_table[(log_factor >> 6) & 31];
-    const int shift = log_factor >> 11;
-    return shift < 0 ? wd1 >> -shift : wd1 << shift;
-}
-
-void ff_g722_update_low_predictor(struct G722Band *band, const int ilow)
-{
-    do_adaptive_prediction(band,
-                           band->scale_factor * ff_g722_low_inv_quant4[ilow] >> 10);
-
-    // quantizer adaptation
-    band->log_factor   = av_clip((band->log_factor * 127 >> 7) +
-                                 low_log_factor_step[ilow], 0, 18432);
-    band->scale_factor = linear_scale_factor(band->log_factor - (8 << 11));
-}
-
-void ff_g722_update_high_predictor(struct G722Band *band, const int dhigh,
-                                  const int ihigh)
-{
-    do_adaptive_prediction(band, dhigh);
-
-    // quantizer adaptation
-    band->log_factor   = av_clip((band->log_factor * 127 >> 7) +
-                                 high_log_factor_step[ihigh&1], 0, 22528);
-    band->scale_factor = linear_scale_factor(band->log_factor - (10 << 11));
-}
-
-void ff_g722_apply_qmf(const int16_t *prev_samples, int *xout1, int *xout2)
-{
-    int i;
-
-    *xout1 = 0;
-    *xout2 = 0;
-    for (i = 0; i < 12; i++) {
-        MAC16(*xout2, prev_samples[2*i  ], qmf_coeffs[i   ]);
-        MAC16(*xout1, prev_samples[2*i+1], qmf_coeffs[11-i]);
-    }
-}
diff --git a/deps/libav/libavcodec/g722.h b/deps/libav/libavcodec/g722.h
deleted file mode 100644
index 71d03fc..0000000
--- a/deps/libav/libavcodec/g722.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) CMU 1993 Computer Science, Speech Group
- *                        Chengxiang Lu and Alex Hauptmann
- * Copyright (c) 2005 Steve Underwood <steveu at coppice.org>
- * Copyright (c) 2009 Kenan Gillet
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_G722_H
-#define AVCODEC_G722_H
-
-#include <stdint.h>
-#include "avcodec.h"
-
-#define PREV_SAMPLES_BUF_SIZE 1024
-
-typedef struct G722Context {
-    const AVClass *class;
-    int     bits_per_codeword;
-    int16_t prev_samples[PREV_SAMPLES_BUF_SIZE]; ///< memory of past decoded samples
-    int     prev_samples_pos;        ///< the number of values in prev_samples
-
-    /**
-     * The band[0] and band[1] correspond respectively to the lower band and higher band.
-     */
-    struct G722Band {
-        int16_t s_predictor;         ///< predictor output value
-        int32_t s_zero;              ///< previous output signal from zero predictor
-        int8_t  part_reconst_mem[2]; ///< signs of previous partially reconstructed signals
-        int16_t prev_qtzd_reconst;   ///< previous quantized reconstructed signal (internal value, using low_inv_quant4)
-        int16_t pole_mem[2];         ///< second-order pole section coefficient buffer
-        int32_t diff_mem[6];         ///< quantizer difference signal memory
-        int16_t zero_mem[6];         ///< Seventh-order zero section coefficient buffer
-        int16_t log_factor;          ///< delayed 2-logarithmic quantizer factor
-        int16_t scale_factor;        ///< delayed quantizer scale factor
-    } band[2];
-
-    struct TrellisNode {
-        struct G722Band state;
-        uint32_t ssd;
-        int path;
-    } *node_buf[2], **nodep_buf[2];
-
-    struct TrellisPath {
-        int value;
-        int prev;
-    } *paths[2];
-} G722Context;
-
-extern const int16_t ff_g722_high_inv_quant[4];
-extern const int16_t ff_g722_low_inv_quant4[16];
-extern const int16_t ff_g722_low_inv_quant6[64];
-
-void ff_g722_update_low_predictor(struct G722Band *band, const int ilow);
-
-void ff_g722_update_high_predictor(struct G722Band *band, const int dhigh,
-                                   const int ihigh);
-
-void ff_g722_apply_qmf(const int16_t *prev_samples, int *xout1, int *xout2);
-
-#endif /* AVCODEC_G722_H */
diff --git a/deps/libav/libavcodec/g722dec.c b/deps/libav/libavcodec/g722dec.c
deleted file mode 100644
index 26f288b..0000000
--- a/deps/libav/libavcodec/g722dec.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) CMU 1993 Computer Science, Speech Group
- *                        Chengxiang Lu and Alex Hauptmann
- * Copyright (c) 2005 Steve Underwood <steveu at coppice.org>
- * Copyright (c) 2009 Kenan Gillet
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * G.722 ADPCM audio decoder
- *
- * This G.722 decoder is a bit-exact implementation of the ITU G.722
- * specification for all three specified bitrates - 64000bps, 56000bps
- * and 48000bps. It passes the ITU tests.
- *
- * @note For the 56000bps and 48000bps bitrates, the lowest 1 or 2 bits
- *       respectively of each byte are ignored.
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "g722.h"
-#include "internal.h"
-
-#define OFFSET(x) offsetof(G722Context, x)
-#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "bits_per_codeword", "Bits per G722 codeword", OFFSET(bits_per_codeword), AV_OPT_TYPE_INT, { .i64 = 8 }, 6, 8, AD },
-    { NULL }
-};
-
-static const AVClass g722_decoder_class = {
-    .class_name = "g722 decoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static av_cold int g722_decode_init(AVCodecContext * avctx)
-{
-    G722Context *c = avctx->priv_data;
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
-
-    c->band[0].scale_factor = 8;
-    c->band[1].scale_factor = 2;
-    c->prev_samples_pos = 22;
-
-    return 0;
-}
-
-static const int16_t low_inv_quant5[32] = {
-     -35,   -35, -2919, -2195, -1765, -1458, -1219, -1023,
-    -858,  -714,  -587,  -473,  -370,  -276,  -190,  -110,
-    2919,  2195,  1765,  1458,  1219,  1023,   858,   714,
-     587,   473,   370,   276,   190,   110,    35,   -35
-};
-
-static const int16_t *low_inv_quants[3] = { ff_g722_low_inv_quant6,
-                                                    low_inv_quant5,
-                                            ff_g722_low_inv_quant4 };
-
-static int g722_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    G722Context *c = avctx->priv_data;
-    AVFrame *frame = data;
-    int16_t *out_buf;
-    int j, ret;
-    const int skip = 8 - c->bits_per_codeword;
-    const int16_t *quantizer_table = low_inv_quants[skip];
-    GetBitContext gb;
-
-    /* get output buffer */
-    frame->nb_samples = avpkt->size * 2;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    out_buf = (int16_t *)frame->data[0];
-
-    init_get_bits(&gb, avpkt->data, avpkt->size * 8);
-
-    for (j = 0; j < avpkt->size; j++) {
-        int ilow, ihigh, rlow, rhigh, dhigh;
-        int xout1, xout2;
-
-        ihigh = get_bits(&gb, 2);
-        ilow = get_bits(&gb, 6 - skip);
-        skip_bits(&gb, skip);
-
-        rlow = av_clip((c->band[0].scale_factor * quantizer_table[ilow] >> 10)
-                      + c->band[0].s_predictor, -16384, 16383);
-
-        ff_g722_update_low_predictor(&c->band[0], ilow >> (2 - skip));
-
-        dhigh = c->band[1].scale_factor * ff_g722_high_inv_quant[ihigh] >> 10;
-        rhigh = av_clip(dhigh + c->band[1].s_predictor, -16384, 16383);
-
-        ff_g722_update_high_predictor(&c->band[1], dhigh, ihigh);
-
-        c->prev_samples[c->prev_samples_pos++] = rlow + rhigh;
-        c->prev_samples[c->prev_samples_pos++] = rlow - rhigh;
-        ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24,
-                          &xout1, &xout2);
-        *out_buf++ = av_clip_int16(xout1 >> 11);
-        *out_buf++ = av_clip_int16(xout2 >> 11);
-        if (c->prev_samples_pos >= PREV_SAMPLES_BUF_SIZE) {
-            memmove(c->prev_samples, c->prev_samples + c->prev_samples_pos - 22,
-                    22 * sizeof(c->prev_samples[0]));
-            c->prev_samples_pos = 22;
-        }
-    }
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_adpcm_g722_decoder = {
-    .name           = "g722",
-    .long_name      = NULL_IF_CONFIG_SMALL("G.722 ADPCM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ADPCM_G722,
-    .priv_data_size = sizeof(G722Context),
-    .init           = g722_decode_init,
-    .decode         = g722_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .priv_class     = &g722_decoder_class,
-};
diff --git a/deps/libav/libavcodec/g722enc.c b/deps/libav/libavcodec/g722enc.c
deleted file mode 100644
index e7b67da..0000000
--- a/deps/libav/libavcodec/g722enc.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) CMU 1993 Computer Science, Speech Group
- *                        Chengxiang Lu and Alex Hauptmann
- * Copyright (c) 2005 Steve Underwood <steveu at coppice.org>
- * Copyright (c) 2009 Kenan Gillet
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * G.722 ADPCM audio encoder
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "g722.h"
-#include "libavutil/common.h"
-
-#define FREEZE_INTERVAL 128
-
-/* This is an arbitrary value. Allowing insanely large values leads to strange
-   problems, so we limit it to a reasonable value */
-#define MAX_FRAME_SIZE 32768
-
-/* We clip the value of avctx->trellis to prevent data type overflows and
-   undefined behavior. Using larger values is insanely slow anyway. */
-#define MIN_TRELLIS 0
-#define MAX_TRELLIS 16
-
-static av_cold int g722_encode_close(AVCodecContext *avctx)
-{
-    G722Context *c = avctx->priv_data;
-    int i;
-    for (i = 0; i < 2; i++) {
-        av_freep(&c->paths[i]);
-        av_freep(&c->node_buf[i]);
-        av_freep(&c->nodep_buf[i]);
-    }
-    return 0;
-}
-
-static av_cold int g722_encode_init(AVCodecContext * avctx)
-{
-    G722Context *c = avctx->priv_data;
-    int ret;
-
-    if (avctx->channels != 1) {
-        av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    c->band[0].scale_factor = 8;
-    c->band[1].scale_factor = 2;
-    c->prev_samples_pos = 22;
-
-    if (avctx->trellis) {
-        int frontier = 1 << avctx->trellis;
-        int max_paths = frontier * FREEZE_INTERVAL;
-        int i;
-        for (i = 0; i < 2; i++) {
-            c->paths[i] = av_mallocz(max_paths * sizeof(**c->paths));
-            c->node_buf[i] = av_mallocz(2 * frontier * sizeof(**c->node_buf));
-            c->nodep_buf[i] = av_mallocz(2 * frontier * sizeof(**c->nodep_buf));
-            if (!c->paths[i] || !c->node_buf[i] || !c->nodep_buf[i]) {
-                ret = AVERROR(ENOMEM);
-                goto error;
-            }
-        }
-    }
-
-    if (avctx->frame_size) {
-        /* validate frame size */
-        if (avctx->frame_size & 1 || avctx->frame_size > MAX_FRAME_SIZE) {
-            int new_frame_size;
-
-            if (avctx->frame_size == 1)
-                new_frame_size = 2;
-            else if (avctx->frame_size > MAX_FRAME_SIZE)
-                new_frame_size = MAX_FRAME_SIZE;
-            else
-                new_frame_size = avctx->frame_size - 1;
-
-            av_log(avctx, AV_LOG_WARNING, "Requested frame size is not "
-                   "allowed. Using %d instead of %d\n", new_frame_size,
-                   avctx->frame_size);
-            avctx->frame_size = new_frame_size;
-        }
-    } else {
-        /* This is arbitrary. We use 320 because it's 20ms @ 16kHz, which is
-           a common packet size for VoIP applications */
-        avctx->frame_size = 320;
-    }
-    avctx->delay = 22;
-
-    if (avctx->trellis) {
-        /* validate trellis */
-        if (avctx->trellis < MIN_TRELLIS || avctx->trellis > MAX_TRELLIS) {
-            int new_trellis = av_clip(avctx->trellis, MIN_TRELLIS, MAX_TRELLIS);
-            av_log(avctx, AV_LOG_WARNING, "Requested trellis value is not "
-                   "allowed. Using %d instead of %d\n", new_trellis,
-                   avctx->trellis);
-            avctx->trellis = new_trellis;
-        }
-    }
-
-    return 0;
-error:
-    g722_encode_close(avctx);
-    return ret;
-}
-
-static const int16_t low_quant[33] = {
-      35,   72,  110,  150,  190,  233,  276,  323,
-     370,  422,  473,  530,  587,  650,  714,  786,
-     858,  940, 1023, 1121, 1219, 1339, 1458, 1612,
-    1765, 1980, 2195, 2557, 2919
-};
-
-static inline void filter_samples(G722Context *c, const int16_t *samples,
-                                  int *xlow, int *xhigh)
-{
-    int xout1, xout2;
-    c->prev_samples[c->prev_samples_pos++] = samples[0];
-    c->prev_samples[c->prev_samples_pos++] = samples[1];
-    ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);
-    *xlow  = xout1 + xout2 >> 14;
-    *xhigh = xout1 - xout2 >> 14;
-    if (c->prev_samples_pos >= PREV_SAMPLES_BUF_SIZE) {
-        memmove(c->prev_samples,
-                c->prev_samples + c->prev_samples_pos - 22,
-                22 * sizeof(c->prev_samples[0]));
-        c->prev_samples_pos = 22;
-    }
-}
-
-static inline int encode_high(const struct G722Band *state, int xhigh)
-{
-    int diff = av_clip_int16(xhigh - state->s_predictor);
-    int pred = 141 * state->scale_factor >> 8;
-           /* = diff >= 0 ? (diff < pred) + 2 : diff >= -pred */
-    return ((diff ^ (diff >> (sizeof(diff)*8-1))) < pred) + 2*(diff >= 0);
-}
-
-static inline int encode_low(const struct G722Band* state, int xlow)
-{
-    int diff  = av_clip_int16(xlow - state->s_predictor);
-           /* = diff >= 0 ? diff : -(diff + 1) */
-    int limit = diff ^ (diff >> (sizeof(diff)*8-1));
-    int i = 0;
-    limit = limit + 1 << 10;
-    if (limit > low_quant[8] * state->scale_factor)
-        i = 9;
-    while (i < 29 && limit > low_quant[i] * state->scale_factor)
-        i++;
-    return (diff < 0 ? (i < 2 ? 63 : 33) : 61) - i;
-}
-
-static void g722_encode_trellis(G722Context *c, int trellis,
-                                uint8_t *dst, int nb_samples,
-                                const int16_t *samples)
-{
-    int i, j, k;
-    int frontier = 1 << trellis;
-    struct TrellisNode **nodes[2];
-    struct TrellisNode **nodes_next[2];
-    int pathn[2] = {0, 0}, froze = -1;
-    struct TrellisPath *p[2];
-
-    for (i = 0; i < 2; i++) {
-        nodes[i] = c->nodep_buf[i];
-        nodes_next[i] = c->nodep_buf[i] + frontier;
-        memset(c->nodep_buf[i], 0, 2 * frontier * sizeof(*c->nodep_buf[i]));
-        nodes[i][0] = c->node_buf[i] + frontier;
-        nodes[i][0]->ssd = 0;
-        nodes[i][0]->path = 0;
-        nodes[i][0]->state = c->band[i];
-    }
-
-    for (i = 0; i < nb_samples >> 1; i++) {
-        int xlow, xhigh;
-        struct TrellisNode *next[2];
-        int heap_pos[2] = {0, 0};
-
-        for (j = 0; j < 2; j++) {
-            next[j] = c->node_buf[j] + frontier*(i & 1);
-            memset(nodes_next[j], 0, frontier * sizeof(**nodes_next));
-        }
-
-        filter_samples(c, &samples[2*i], &xlow, &xhigh);
-
-        for (j = 0; j < frontier && nodes[0][j]; j++) {
-            /* Only k >> 2 affects the future adaptive state, therefore testing
-             * small steps that don't change k >> 2 is useless, the original
-             * value from encode_low is better than them. Since we step k
-             * in steps of 4, make sure range is a multiple of 4, so that
-             * we don't miss the original value from encode_low. */
-            int range = j < frontier/2 ? 4 : 0;
-            struct TrellisNode *cur_node = nodes[0][j];
-
-            int ilow = encode_low(&cur_node->state, xlow);
-
-            for (k = ilow - range; k <= ilow + range && k <= 63; k += 4) {
-                int decoded, dec_diff, pos;
-                uint32_t ssd;
-                struct TrellisNode* node;
-
-                if (k < 0)
-                    continue;
-
-                decoded = av_clip((cur_node->state.scale_factor *
-                                  ff_g722_low_inv_quant6[k] >> 10)
-                                + cur_node->state.s_predictor, -16384, 16383);
-                dec_diff = xlow - decoded;
-
-#define STORE_NODE(index, UPDATE, VALUE)\
-                ssd = cur_node->ssd + dec_diff*dec_diff;\
-                /* Check for wraparound. Using 64 bit ssd counters would \
-                 * be simpler, but is slower on x86 32 bit. */\
-                if (ssd < cur_node->ssd)\
-                    continue;\
-                if (heap_pos[index] < frontier) {\
-                    pos = heap_pos[index]++;\
-                    assert(pathn[index] < FREEZE_INTERVAL * frontier);\
-                    node = nodes_next[index][pos] = next[index]++;\
-                    node->path = pathn[index]++;\
-                } else {\
-                    /* Try to replace one of the leaf nodes with the new \
-                     * one, but not always testing the same leaf position */\
-                    pos = (frontier>>1) + (heap_pos[index] & ((frontier>>1) - 1));\
-                    if (ssd >= nodes_next[index][pos]->ssd)\
-                        continue;\
-                    heap_pos[index]++;\
-                    node = nodes_next[index][pos];\
-                }\
-                node->ssd = ssd;\
-                node->state = cur_node->state;\
-                UPDATE;\
-                c->paths[index][node->path].value = VALUE;\
-                c->paths[index][node->path].prev = cur_node->path;\
-                /* Sift the newly inserted node up in the heap to restore \
-                 * the heap property */\
-                while (pos > 0) {\
-                    int parent = (pos - 1) >> 1;\
-                    if (nodes_next[index][parent]->ssd <= ssd)\
-                        break;\
-                    FFSWAP(struct TrellisNode*, nodes_next[index][parent],\
-                                                nodes_next[index][pos]);\
-                    pos = parent;\
-                }
-                STORE_NODE(0, ff_g722_update_low_predictor(&node->state, k >> 2), k);
-            }
-        }
-
-        for (j = 0; j < frontier && nodes[1][j]; j++) {
-            int ihigh;
-            struct TrellisNode *cur_node = nodes[1][j];
-
-            /* We don't try to get any initial guess for ihigh via
-             * encode_high - since there's only 4 possible values, test
-             * them all. Testing all of these gives a much, much larger
-             * gain than testing a larger range around ilow. */
-            for (ihigh = 0; ihigh < 4; ihigh++) {
-                int dhigh, decoded, dec_diff, pos;
-                uint32_t ssd;
-                struct TrellisNode* node;
-
-                dhigh = cur_node->state.scale_factor *
-                        ff_g722_high_inv_quant[ihigh] >> 10;
-                decoded = av_clip(dhigh + cur_node->state.s_predictor,
-                                  -16384, 16383);
-                dec_diff = xhigh - decoded;
-
-                STORE_NODE(1, ff_g722_update_high_predictor(&node->state, dhigh, ihigh), ihigh);
-            }
-        }
-
-        for (j = 0; j < 2; j++) {
-            FFSWAP(struct TrellisNode**, nodes[j], nodes_next[j]);
-
-            if (nodes[j][0]->ssd > (1 << 16)) {
-                for (k = 1; k < frontier && nodes[j][k]; k++)
-                    nodes[j][k]->ssd -= nodes[j][0]->ssd;
-                nodes[j][0]->ssd = 0;
-            }
-        }
-
-        if (i == froze + FREEZE_INTERVAL) {
-            p[0] = &c->paths[0][nodes[0][0]->path];
-            p[1] = &c->paths[1][nodes[1][0]->path];
-            for (j = i; j > froze; j--) {
-                dst[j] = p[1]->value << 6 | p[0]->value;
-                p[0] = &c->paths[0][p[0]->prev];
-                p[1] = &c->paths[1][p[1]->prev];
-            }
-            froze = i;
-            pathn[0] = pathn[1] = 0;
-            memset(nodes[0] + 1, 0, (frontier - 1)*sizeof(**nodes));
-            memset(nodes[1] + 1, 0, (frontier - 1)*sizeof(**nodes));
-        }
-    }
-
-    p[0] = &c->paths[0][nodes[0][0]->path];
-    p[1] = &c->paths[1][nodes[1][0]->path];
-    for (j = i; j > froze; j--) {
-        dst[j] = p[1]->value << 6 | p[0]->value;
-        p[0] = &c->paths[0][p[0]->prev];
-        p[1] = &c->paths[1][p[1]->prev];
-    }
-    c->band[0] = nodes[0][0]->state;
-    c->band[1] = nodes[1][0]->state;
-}
-
-static av_always_inline void encode_byte(G722Context *c, uint8_t *dst,
-                                         const int16_t *samples)
-{
-    int xlow, xhigh, ilow, ihigh;
-    filter_samples(c, samples, &xlow, &xhigh);
-    ihigh = encode_high(&c->band[1], xhigh);
-    ilow  = encode_low (&c->band[0], xlow);
-    ff_g722_update_high_predictor(&c->band[1], c->band[1].scale_factor *
-                                ff_g722_high_inv_quant[ihigh] >> 10, ihigh);
-    ff_g722_update_low_predictor(&c->band[0], ilow >> 2);
-    *dst = ihigh << 6 | ilow;
-}
-
-static void g722_encode_no_trellis(G722Context *c,
-                                   uint8_t *dst, int nb_samples,
-                                   const int16_t *samples)
-{
-    int i;
-    for (i = 0; i < nb_samples; i += 2)
-        encode_byte(c, dst++, &samples[i]);
-}
-
-static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                             const AVFrame *frame, int *got_packet_ptr)
-{
-    G722Context *c = avctx->priv_data;
-    const int16_t *samples = (const int16_t *)frame->data[0];
-    int nb_samples, out_size, ret;
-
-    out_size = (frame->nb_samples + 1) / 2;
-    if ((ret = ff_alloc_packet(avpkt, out_size))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    nb_samples = frame->nb_samples - (frame->nb_samples & 1);
-
-    if (avctx->trellis)
-        g722_encode_trellis(c, avctx->trellis, avpkt->data, nb_samples, samples);
-    else
-        g722_encode_no_trellis(c, avpkt->data, nb_samples, samples);
-
-    /* handle last frame with odd frame_size */
-    if (nb_samples < frame->nb_samples) {
-        int16_t last_samples[2] = { samples[nb_samples], samples[nb_samples] };
-        encode_byte(c, &avpkt->data[nb_samples >> 1], last_samples);
-    }
-
-    if (frame->pts != AV_NOPTS_VALUE)
-        avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-AVCodec ff_adpcm_g722_encoder = {
-    .name           = "g722",
-    .long_name      = NULL_IF_CONFIG_SMALL("G.722 ADPCM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ADPCM_G722,
-    .priv_data_size = sizeof(G722Context),
-    .init           = g722_encode_init,
-    .close          = g722_encode_close,
-    .encode2        = g722_encode_frame,
-    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/g723_1.c b/deps/libav/libavcodec/g723_1.c
deleted file mode 100644
index bbdb404..0000000
--- a/deps/libav/libavcodec/g723_1.c
+++ /dev/null
@@ -1,1378 +0,0 @@
-/*
- * G.723.1 compatible decoder
- * Copyright (c) 2006 Benjamin Larsson
- * Copyright (c) 2010 Mohamed Naufal Basheer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * G.723.1 compatible decoder
- */
-
-#define BITSTREAM_READER_LE
-#include "libavutil/channel_layout.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "acelp_vectors.h"
-#include "celp_filters.h"
-#include "g723_1_data.h"
-#include "internal.h"
-
-#define CNG_RANDOM_SEED 12345
-
-/**
- * G723.1 frame types
- */
-enum FrameType {
-    ACTIVE_FRAME,        ///< Active speech
-    SID_FRAME,           ///< Silence Insertion Descriptor frame
-    UNTRANSMITTED_FRAME
-};
-
-enum Rate {
-    RATE_6300,
-    RATE_5300
-};
-
-/**
- * G723.1 unpacked data subframe
- */
-typedef struct {
-    int ad_cb_lag;     ///< adaptive codebook lag
-    int ad_cb_gain;
-    int dirac_train;
-    int pulse_sign;
-    int grid_index;
-    int amp_index;
-    int pulse_pos;
-} G723_1_Subframe;
-
-/**
- * Pitch postfilter parameters
- */
-typedef struct {
-    int     index;    ///< postfilter backward/forward lag
-    int16_t opt_gain; ///< optimal gain
-    int16_t sc_gain;  ///< scaling gain
-} PPFParam;
-
-typedef struct g723_1_context {
-    AVClass *class;
-
-    G723_1_Subframe subframe[4];
-    enum FrameType cur_frame_type;
-    enum FrameType past_frame_type;
-    enum Rate cur_rate;
-    uint8_t lsp_index[LSP_BANDS];
-    int pitch_lag[2];
-    int erased_frames;
-
-    int16_t prev_lsp[LPC_ORDER];
-    int16_t sid_lsp[LPC_ORDER];
-    int16_t prev_excitation[PITCH_MAX];
-    int16_t excitation[PITCH_MAX + FRAME_LEN + 4];
-    int16_t synth_mem[LPC_ORDER];
-    int16_t fir_mem[LPC_ORDER];
-    int     iir_mem[LPC_ORDER];
-
-    int random_seed;
-    int cng_random_seed;
-    int interp_index;
-    int interp_gain;
-    int sid_gain;
-    int cur_gain;
-    int reflection_coef;
-    int pf_gain;
-    int postfilter;
-
-    int16_t audio[FRAME_LEN + LPC_ORDER + PITCH_MAX + 4];
-} G723_1_Context;
-
-static av_cold int g723_1_decode_init(AVCodecContext *avctx)
-{
-    G723_1_Context *p = avctx->priv_data;
-
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
-    avctx->channels       = 1;
-    avctx->sample_rate    = 8000;
-    p->pf_gain            = 1 << 12;
-
-    memcpy(p->prev_lsp, dc_lsp, LPC_ORDER * sizeof(*p->prev_lsp));
-    memcpy(p->sid_lsp,  dc_lsp, LPC_ORDER * sizeof(*p->sid_lsp));
-
-    p->cng_random_seed = CNG_RANDOM_SEED;
-    p->past_frame_type = SID_FRAME;
-
-    return 0;
-}
-
-/**
- * Unpack the frame into parameters.
- *
- * @param p           the context
- * @param buf         pointer to the input buffer
- * @param buf_size    size of the input buffer
- */
-static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,
-                            int buf_size)
-{
-    GetBitContext gb;
-    int ad_cb_len;
-    int temp, info_bits, i;
-
-    init_get_bits(&gb, buf, buf_size * 8);
-
-    /* Extract frame type and rate info */
-    info_bits = get_bits(&gb, 2);
-
-    if (info_bits == 3) {
-        p->cur_frame_type = UNTRANSMITTED_FRAME;
-        return 0;
-    }
-
-    /* Extract 24 bit lsp indices, 8 bit for each band */
-    p->lsp_index[2] = get_bits(&gb, 8);
-    p->lsp_index[1] = get_bits(&gb, 8);
-    p->lsp_index[0] = get_bits(&gb, 8);
-
-    if (info_bits == 2) {
-        p->cur_frame_type = SID_FRAME;
-        p->subframe[0].amp_index = get_bits(&gb, 6);
-        return 0;
-    }
-
-    /* Extract the info common to both rates */
-    p->cur_rate       = info_bits ? RATE_5300 : RATE_6300;
-    p->cur_frame_type = ACTIVE_FRAME;
-
-    p->pitch_lag[0] = get_bits(&gb, 7);
-    if (p->pitch_lag[0] > 123)       /* test if forbidden code */
-        return -1;
-    p->pitch_lag[0] += PITCH_MIN;
-    p->subframe[1].ad_cb_lag = get_bits(&gb, 2);
-
-    p->pitch_lag[1] = get_bits(&gb, 7);
-    if (p->pitch_lag[1] > 123)
-        return -1;
-    p->pitch_lag[1] += PITCH_MIN;
-    p->subframe[3].ad_cb_lag = get_bits(&gb, 2);
-    p->subframe[0].ad_cb_lag = 1;
-    p->subframe[2].ad_cb_lag = 1;
-
-    for (i = 0; i < SUBFRAMES; i++) {
-        /* Extract combined gain */
-        temp = get_bits(&gb, 12);
-        ad_cb_len = 170;
-        p->subframe[i].dirac_train = 0;
-        if (p->cur_rate == RATE_6300 && p->pitch_lag[i >> 1] < SUBFRAME_LEN - 2) {
-            p->subframe[i].dirac_train = temp >> 11;
-            temp &= 0x7FF;
-            ad_cb_len = 85;
-        }
-        p->subframe[i].ad_cb_gain = FASTDIV(temp, GAIN_LEVELS);
-        if (p->subframe[i].ad_cb_gain < ad_cb_len) {
-            p->subframe[i].amp_index = temp - p->subframe[i].ad_cb_gain *
-                                       GAIN_LEVELS;
-        } else {
-            return -1;
-        }
-    }
-
-    p->subframe[0].grid_index = get_bits(&gb, 1);
-    p->subframe[1].grid_index = get_bits(&gb, 1);
-    p->subframe[2].grid_index = get_bits(&gb, 1);
-    p->subframe[3].grid_index = get_bits(&gb, 1);
-
-    if (p->cur_rate == RATE_6300) {
-        skip_bits(&gb, 1);  /* skip reserved bit */
-
-        /* Compute pulse_pos index using the 13-bit combined position index */
-        temp = get_bits(&gb, 13);
-        p->subframe[0].pulse_pos = temp / 810;
-
-        temp -= p->subframe[0].pulse_pos * 810;
-        p->subframe[1].pulse_pos = FASTDIV(temp, 90);
-
-        temp -= p->subframe[1].pulse_pos * 90;
-        p->subframe[2].pulse_pos = FASTDIV(temp, 9);
-        p->subframe[3].pulse_pos = temp - p->subframe[2].pulse_pos * 9;
-
-        p->subframe[0].pulse_pos = (p->subframe[0].pulse_pos << 16) +
-                                   get_bits(&gb, 16);
-        p->subframe[1].pulse_pos = (p->subframe[1].pulse_pos << 14) +
-                                   get_bits(&gb, 14);
-        p->subframe[2].pulse_pos = (p->subframe[2].pulse_pos << 16) +
-                                   get_bits(&gb, 16);
-        p->subframe[3].pulse_pos = (p->subframe[3].pulse_pos << 14) +
-                                   get_bits(&gb, 14);
-
-        p->subframe[0].pulse_sign = get_bits(&gb, 6);
-        p->subframe[1].pulse_sign = get_bits(&gb, 5);
-        p->subframe[2].pulse_sign = get_bits(&gb, 6);
-        p->subframe[3].pulse_sign = get_bits(&gb, 5);
-    } else { /* 5300 bps */
-        p->subframe[0].pulse_pos  = get_bits(&gb, 12);
-        p->subframe[1].pulse_pos  = get_bits(&gb, 12);
-        p->subframe[2].pulse_pos  = get_bits(&gb, 12);
-        p->subframe[3].pulse_pos  = get_bits(&gb, 12);
-
-        p->subframe[0].pulse_sign = get_bits(&gb, 4);
-        p->subframe[1].pulse_sign = get_bits(&gb, 4);
-        p->subframe[2].pulse_sign = get_bits(&gb, 4);
-        p->subframe[3].pulse_sign = get_bits(&gb, 4);
-    }
-
-    return 0;
-}
-
-/**
- * Bitexact implementation of sqrt(val/2).
- */
-static int16_t square_root(int val)
-{
-    int16_t res = 0;
-    int16_t exp = 0x4000;
-    int i;
-
-    for (i = 0; i < 14; i ++) {
-        int res_exp = res + exp;
-        if (val >= res_exp * res_exp << 1)
-            res += exp;
-        exp >>= 1;
-    }
-    return res;
-}
-
-/**
- * Calculate the number of left-shifts required for normalizing the input.
- *
- * @param num   input number
- * @param width width of the input, 16 bits(0) / 32 bits(1)
- */
-static int normalize_bits(int num, int width)
-{
-    return width - av_log2(num) - 1;
-}
-
-/**
- * Scale vector contents based on the largest of their absolutes.
- */
-static int scale_vector(int16_t *dst, const int16_t *vector, int length)
-{
-    int bits, max = 0;
-    int i;
-
-
-    for (i = 0; i < length; i++)
-        max |= FFABS(vector[i]);
-
-    max   = FFMIN(max, 0x7FFF);
-    bits  = normalize_bits(max, 15);
-
-    for (i = 0; i < length; i++)
-        dst[i] = vector[i] << bits >> 3;
-
-    return bits - 3;
-}
-
-/**
- * Perform inverse quantization of LSP frequencies.
- *
- * @param cur_lsp    the current LSP vector
- * @param prev_lsp   the previous LSP vector
- * @param lsp_index  VQ indices
- * @param bad_frame  bad frame flag
- */
-static void inverse_quant(int16_t *cur_lsp, int16_t *prev_lsp,
-                          uint8_t *lsp_index, int bad_frame)
-{
-    int min_dist, pred;
-    int i, j, temp, stable;
-
-    /* Check for frame erasure */
-    if (!bad_frame) {
-        min_dist     = 0x100;
-        pred         = 12288;
-    } else {
-        min_dist     = 0x200;
-        pred         = 23552;
-        lsp_index[0] = lsp_index[1] = lsp_index[2] = 0;
-    }
-
-    /* Get the VQ table entry corresponding to the transmitted index */
-    cur_lsp[0] = lsp_band0[lsp_index[0]][0];
-    cur_lsp[1] = lsp_band0[lsp_index[0]][1];
-    cur_lsp[2] = lsp_band0[lsp_index[0]][2];
-    cur_lsp[3] = lsp_band1[lsp_index[1]][0];
-    cur_lsp[4] = lsp_band1[lsp_index[1]][1];
-    cur_lsp[5] = lsp_band1[lsp_index[1]][2];
-    cur_lsp[6] = lsp_band2[lsp_index[2]][0];
-    cur_lsp[7] = lsp_band2[lsp_index[2]][1];
-    cur_lsp[8] = lsp_band2[lsp_index[2]][2];
-    cur_lsp[9] = lsp_band2[lsp_index[2]][3];
-
-    /* Add predicted vector & DC component to the previously quantized vector */
-    for (i = 0; i < LPC_ORDER; i++) {
-        temp        = ((prev_lsp[i] - dc_lsp[i]) * pred + (1 << 14)) >> 15;
-        cur_lsp[i] += dc_lsp[i] + temp;
-    }
-
-    for (i = 0; i < LPC_ORDER; i++) {
-        cur_lsp[0]             = FFMAX(cur_lsp[0],  0x180);
-        cur_lsp[LPC_ORDER - 1] = FFMIN(cur_lsp[LPC_ORDER - 1], 0x7e00);
-
-        /* Stability check */
-        for (j = 1; j < LPC_ORDER; j++) {
-            temp = min_dist + cur_lsp[j - 1] - cur_lsp[j];
-            if (temp > 0) {
-                temp >>= 1;
-                cur_lsp[j - 1] -= temp;
-                cur_lsp[j]     += temp;
-            }
-        }
-        stable = 1;
-        for (j = 1; j < LPC_ORDER; j++) {
-            temp = cur_lsp[j - 1] + min_dist - cur_lsp[j] - 4;
-            if (temp > 0) {
-                stable = 0;
-                break;
-            }
-        }
-        if (stable)
-            break;
-    }
-    if (!stable)
-        memcpy(cur_lsp, prev_lsp, LPC_ORDER * sizeof(*cur_lsp));
-}
-
-/**
- * Bitexact implementation of 2ab scaled by 1/2^16.
- *
- * @param a 32 bit multiplicand
- * @param b 16 bit multiplier
- */
-#define MULL2(a, b) \
-        ((((a) >> 16) * (b) << 1) + (((a) & 0xffff) * (b) >> 15))
-
-/**
- * Convert LSP frequencies to LPC coefficients.
- *
- * @param lpc buffer for LPC coefficients
- */
-static void lsp2lpc(int16_t *lpc)
-{
-    int f1[LPC_ORDER / 2 + 1];
-    int f2[LPC_ORDER / 2 + 1];
-    int i, j;
-
-    /* Calculate negative cosine */
-    for (j = 0; j < LPC_ORDER; j++) {
-        int index     = lpc[j] >> 7;
-        int offset    = lpc[j] & 0x7f;
-        int temp1     = cos_tab[index] << 16;
-        int temp2     = (cos_tab[index + 1] - cos_tab[index]) *
-                          ((offset << 8) + 0x80) << 1;
-
-        lpc[j] = -(av_sat_dadd32(1 << 15, temp1 + temp2) >> 16);
-    }
-
-    /*
-     * Compute sum and difference polynomial coefficients
-     * (bitexact alternative to lsp2poly() in lsp.c)
-     */
-    /* Initialize with values in Q28 */
-    f1[0] = 1 << 28;
-    f1[1] = (lpc[0] << 14) + (lpc[2] << 14);
-    f1[2] = lpc[0] * lpc[2] + (2 << 28);
-
-    f2[0] = 1 << 28;
-    f2[1] = (lpc[1] << 14) + (lpc[3] << 14);
-    f2[2] = lpc[1] * lpc[3] + (2 << 28);
-
-    /*
-     * Calculate and scale the coefficients by 1/2 in
-     * each iteration for a final scaling factor of Q25
-     */
-    for (i = 2; i < LPC_ORDER / 2; i++) {
-        f1[i + 1] = f1[i - 1] + MULL2(f1[i], lpc[2 * i]);
-        f2[i + 1] = f2[i - 1] + MULL2(f2[i], lpc[2 * i + 1]);
-
-        for (j = i; j >= 2; j--) {
-            f1[j] = MULL2(f1[j - 1], lpc[2 * i]) +
-                    (f1[j] >> 1) + (f1[j - 2] >> 1);
-            f2[j] = MULL2(f2[j - 1], lpc[2 * i + 1]) +
-                    (f2[j] >> 1) + (f2[j - 2] >> 1);
-        }
-
-        f1[0] >>= 1;
-        f2[0] >>= 1;
-        f1[1] = ((lpc[2 * i]     << 16 >> i) + f1[1]) >> 1;
-        f2[1] = ((lpc[2 * i + 1] << 16 >> i) + f2[1]) >> 1;
-    }
-
-    /* Convert polynomial coefficients to LPC coefficients */
-    for (i = 0; i < LPC_ORDER / 2; i++) {
-        int64_t ff1 = f1[i + 1] + f1[i];
-        int64_t ff2 = f2[i + 1] - f2[i];
-
-        lpc[i] = av_clipl_int32(((ff1 + ff2) << 3) + (1 << 15)) >> 16;
-        lpc[LPC_ORDER - i - 1] = av_clipl_int32(((ff1 - ff2) << 3) +
-                                                (1 << 15)) >> 16;
-    }
-}
-
-/**
- * Quantize LSP frequencies by interpolation and convert them to
- * the corresponding LPC coefficients.
- *
- * @param lpc      buffer for LPC coefficients
- * @param cur_lsp  the current LSP vector
- * @param prev_lsp the previous LSP vector
- */
-static void lsp_interpolate(int16_t *lpc, int16_t *cur_lsp, int16_t *prev_lsp)
-{
-    int i;
-    int16_t *lpc_ptr = lpc;
-
-    /* cur_lsp * 0.25 + prev_lsp * 0.75 */
-    ff_acelp_weighted_vector_sum(lpc, cur_lsp, prev_lsp,
-                                 4096, 12288, 1 << 13, 14, LPC_ORDER);
-    ff_acelp_weighted_vector_sum(lpc + LPC_ORDER, cur_lsp, prev_lsp,
-                                 8192, 8192, 1 << 13, 14, LPC_ORDER);
-    ff_acelp_weighted_vector_sum(lpc + 2 * LPC_ORDER, cur_lsp, prev_lsp,
-                                 12288, 4096, 1 << 13, 14, LPC_ORDER);
-    memcpy(lpc + 3 * LPC_ORDER, cur_lsp, LPC_ORDER * sizeof(*lpc));
-
-    for (i = 0; i < SUBFRAMES; i++) {
-        lsp2lpc(lpc_ptr);
-        lpc_ptr += LPC_ORDER;
-    }
-}
-
-/**
- * Generate a train of dirac functions with period as pitch lag.
- */
-static void gen_dirac_train(int16_t *buf, int pitch_lag)
-{
-    int16_t vector[SUBFRAME_LEN];
-    int i, j;
-
-    memcpy(vector, buf, SUBFRAME_LEN * sizeof(*vector));
-    for (i = pitch_lag; i < SUBFRAME_LEN; i += pitch_lag) {
-        for (j = 0; j < SUBFRAME_LEN - i; j++)
-            buf[i + j] += vector[j];
-    }
-}
-
-/**
- * Generate fixed codebook excitation vector.
- *
- * @param vector    decoded excitation vector
- * @param subfrm    current subframe
- * @param cur_rate  current bitrate
- * @param pitch_lag closed loop pitch lag
- * @param index     current subframe index
- */
-static void gen_fcb_excitation(int16_t *vector, G723_1_Subframe *subfrm,
-                               enum Rate cur_rate, int pitch_lag, int index)
-{
-    int temp, i, j;
-
-    memset(vector, 0, SUBFRAME_LEN * sizeof(*vector));
-
-    if (cur_rate == RATE_6300) {
-        if (subfrm->pulse_pos >= max_pos[index])
-            return;
-
-        /* Decode amplitudes and positions */
-        j = PULSE_MAX - pulses[index];
-        temp = subfrm->pulse_pos;
-        for (i = 0; i < SUBFRAME_LEN / GRID_SIZE; i++) {
-            temp -= combinatorial_table[j][i];
-            if (temp >= 0)
-                continue;
-            temp += combinatorial_table[j++][i];
-            if (subfrm->pulse_sign & (1 << (PULSE_MAX - j))) {
-                vector[subfrm->grid_index + GRID_SIZE * i] =
-                                        -fixed_cb_gain[subfrm->amp_index];
-            } else {
-                vector[subfrm->grid_index + GRID_SIZE * i] =
-                                         fixed_cb_gain[subfrm->amp_index];
-            }
-            if (j == PULSE_MAX)
-                break;
-        }
-        if (subfrm->dirac_train == 1)
-            gen_dirac_train(vector, pitch_lag);
-    } else { /* 5300 bps */
-        int cb_gain  = fixed_cb_gain[subfrm->amp_index];
-        int cb_shift = subfrm->grid_index;
-        int cb_sign  = subfrm->pulse_sign;
-        int cb_pos   = subfrm->pulse_pos;
-        int offset, beta, lag;
-
-        for (i = 0; i < 8; i += 2) {
-            offset         = ((cb_pos & 7) << 3) + cb_shift + i;
-            vector[offset] = (cb_sign & 1) ? cb_gain : -cb_gain;
-            cb_pos  >>= 3;
-            cb_sign >>= 1;
-        }
-
-        /* Enhance harmonic components */
-        lag  = pitch_contrib[subfrm->ad_cb_gain << 1] + pitch_lag +
-               subfrm->ad_cb_lag - 1;
-        beta = pitch_contrib[(subfrm->ad_cb_gain << 1) + 1];
-
-        if (lag < SUBFRAME_LEN - 2) {
-            for (i = lag; i < SUBFRAME_LEN; i++)
-                vector[i] += beta * vector[i - lag] >> 15;
-        }
-    }
-}
-
-/**
- * Get delayed contribution from the previous excitation vector.
- */
-static void get_residual(int16_t *residual, int16_t *prev_excitation, int lag)
-{
-    int offset = PITCH_MAX - PITCH_ORDER / 2 - lag;
-    int i;
-
-    residual[0] = prev_excitation[offset];
-    residual[1] = prev_excitation[offset + 1];
-
-    offset += 2;
-    for (i = 2; i < SUBFRAME_LEN + PITCH_ORDER - 1; i++)
-        residual[i] = prev_excitation[offset + (i - 2) % lag];
-}
-
-static int dot_product(const int16_t *a, const int16_t *b, int length)
-{
-    int i, sum = 0;
-
-    for (i = 0; i < length; i++) {
-        int prod = a[i] * b[i];
-        sum = av_sat_dadd32(sum, prod);
-    }
-    return sum;
-}
-
-/**
- * Generate adaptive codebook excitation.
- */
-static void gen_acb_excitation(int16_t *vector, int16_t *prev_excitation,
-                               int pitch_lag, G723_1_Subframe *subfrm,
-                               enum Rate cur_rate)
-{
-    int16_t residual[SUBFRAME_LEN + PITCH_ORDER - 1];
-    const int16_t *cb_ptr;
-    int lag = pitch_lag + subfrm->ad_cb_lag - 1;
-
-    int i;
-    int sum;
-
-    get_residual(residual, prev_excitation, lag);
-
-    /* Select quantization table */
-    if (cur_rate == RATE_6300 && pitch_lag < SUBFRAME_LEN - 2)
-        cb_ptr = adaptive_cb_gain85;
-    else
-        cb_ptr = adaptive_cb_gain170;
-
-    /* Calculate adaptive vector */
-    cb_ptr += subfrm->ad_cb_gain * 20;
-    for (i = 0; i < SUBFRAME_LEN; i++) {
-        sum = dot_product(residual + i, cb_ptr, PITCH_ORDER);
-        vector[i] = av_sat_dadd32(1 << 15, sum) >> 16;
-    }
-}
-
-/**
- * Estimate maximum auto-correlation around pitch lag.
- *
- * @param buf       buffer with offset applied
- * @param offset    offset of the excitation vector
- * @param ccr_max   pointer to the maximum auto-correlation
- * @param pitch_lag decoded pitch lag
- * @param length    length of autocorrelation
- * @param dir       forward lag(1) / backward lag(-1)
- */
-static int autocorr_max(const int16_t *buf, int offset, int *ccr_max,
-                        int pitch_lag, int length, int dir)
-{
-    int limit, ccr, lag = 0;
-    int i;
-
-    pitch_lag = FFMIN(PITCH_MAX - 3, pitch_lag);
-    if (dir > 0)
-        limit = FFMIN(FRAME_LEN + PITCH_MAX - offset - length, pitch_lag + 3);
-    else
-        limit = pitch_lag + 3;
-
-    for (i = pitch_lag - 3; i <= limit; i++) {
-        ccr = dot_product(buf, buf + dir * i, length);
-
-        if (ccr > *ccr_max) {
-            *ccr_max = ccr;
-            lag = i;
-        }
-    }
-    return lag;
-}
-
-/**
- * Calculate pitch postfilter optimal and scaling gains.
- *
- * @param lag      pitch postfilter forward/backward lag
- * @param ppf      pitch postfilter parameters
- * @param cur_rate current bitrate
- * @param tgt_eng  target energy
- * @param ccr      cross-correlation
- * @param res_eng  residual energy
- */
-static void comp_ppf_gains(int lag, PPFParam *ppf, enum Rate cur_rate,
-                           int tgt_eng, int ccr, int res_eng)
-{
-    int pf_residual;     /* square of postfiltered residual */
-    int temp1, temp2;
-
-    ppf->index = lag;
-
-    temp1 = tgt_eng * res_eng >> 1;
-    temp2 = ccr * ccr << 1;
-
-    if (temp2 > temp1) {
-        if (ccr >= res_eng) {
-            ppf->opt_gain = ppf_gain_weight[cur_rate];
-        } else {
-            ppf->opt_gain = (ccr << 15) / res_eng *
-                            ppf_gain_weight[cur_rate] >> 15;
-        }
-        /* pf_res^2 = tgt_eng + 2*ccr*gain + res_eng*gain^2 */
-        temp1       = (tgt_eng << 15) + (ccr * ppf->opt_gain << 1);
-        temp2       = (ppf->opt_gain * ppf->opt_gain >> 15) * res_eng;
-        pf_residual = av_sat_add32(temp1, temp2 + (1 << 15)) >> 16;
-
-        if (tgt_eng >= pf_residual << 1) {
-            temp1 = 0x7fff;
-        } else {
-            temp1 = (tgt_eng << 14) / pf_residual;
-        }
-
-        /* scaling_gain = sqrt(tgt_eng/pf_res^2) */
-        ppf->sc_gain = square_root(temp1 << 16);
-    } else {
-        ppf->opt_gain = 0;
-        ppf->sc_gain  = 0x7fff;
-    }
-
-    ppf->opt_gain = av_clip_int16(ppf->opt_gain * ppf->sc_gain >> 15);
-}
-
-/**
- * Calculate pitch postfilter parameters.
- *
- * @param p         the context
- * @param offset    offset of the excitation vector
- * @param pitch_lag decoded pitch lag
- * @param ppf       pitch postfilter parameters
- * @param cur_rate  current bitrate
- */
-static void comp_ppf_coeff(G723_1_Context *p, int offset, int pitch_lag,
-                           PPFParam *ppf, enum Rate cur_rate)
-{
-
-    int16_t scale;
-    int i;
-    int temp1, temp2;
-
-    /*
-     * 0 - target energy
-     * 1 - forward cross-correlation
-     * 2 - forward residual energy
-     * 3 - backward cross-correlation
-     * 4 - backward residual energy
-     */
-    int energy[5] = {0, 0, 0, 0, 0};
-    int16_t *buf  = p->audio + LPC_ORDER + offset;
-    int fwd_lag   = autocorr_max(buf, offset, &energy[1], pitch_lag,
-                                 SUBFRAME_LEN, 1);
-    int back_lag  = autocorr_max(buf, offset, &energy[3], pitch_lag,
-                                 SUBFRAME_LEN, -1);
-
-    ppf->index    = 0;
-    ppf->opt_gain = 0;
-    ppf->sc_gain  = 0x7fff;
-
-    /* Case 0, Section 3.6 */
-    if (!back_lag && !fwd_lag)
-        return;
-
-    /* Compute target energy */
-    energy[0] = dot_product(buf, buf, SUBFRAME_LEN);
-
-    /* Compute forward residual energy */
-    if (fwd_lag)
-        energy[2] = dot_product(buf + fwd_lag, buf + fwd_lag, SUBFRAME_LEN);
-
-    /* Compute backward residual energy */
-    if (back_lag)
-        energy[4] = dot_product(buf - back_lag, buf - back_lag, SUBFRAME_LEN);
-
-    /* Normalize and shorten */
-    temp1 = 0;
-    for (i = 0; i < 5; i++)
-        temp1 = FFMAX(energy[i], temp1);
-
-    scale = normalize_bits(temp1, 31);
-    for (i = 0; i < 5; i++)
-        energy[i] = (energy[i] << scale) >> 16;
-
-    if (fwd_lag && !back_lag) {  /* Case 1 */
-        comp_ppf_gains(fwd_lag,  ppf, cur_rate, energy[0], energy[1],
-                       energy[2]);
-    } else if (!fwd_lag) {       /* Case 2 */
-        comp_ppf_gains(-back_lag, ppf, cur_rate, energy[0], energy[3],
-                       energy[4]);
-    } else {                     /* Case 3 */
-
-        /*
-         * Select the largest of energy[1]^2/energy[2]
-         * and energy[3]^2/energy[4]
-         */
-        temp1 = energy[4] * ((energy[1] * energy[1] + (1 << 14)) >> 15);
-        temp2 = energy[2] * ((energy[3] * energy[3] + (1 << 14)) >> 15);
-        if (temp1 >= temp2) {
-            comp_ppf_gains(fwd_lag, ppf, cur_rate, energy[0], energy[1],
-                           energy[2]);
-        } else {
-            comp_ppf_gains(-back_lag, ppf, cur_rate, energy[0], energy[3],
-                           energy[4]);
-        }
-    }
-}
-
-/**
- * Classify frames as voiced/unvoiced.
- *
- * @param p         the context
- * @param pitch_lag decoded pitch_lag
- * @param exc_eng   excitation energy estimation
- * @param scale     scaling factor of exc_eng
- *
- * @return residual interpolation index if voiced, 0 otherwise
- */
-static int comp_interp_index(G723_1_Context *p, int pitch_lag,
-                             int *exc_eng, int *scale)
-{
-    int offset = PITCH_MAX + 2 * SUBFRAME_LEN;
-    int16_t *buf = p->audio + LPC_ORDER;
-
-    int index, ccr, tgt_eng, best_eng, temp;
-
-    *scale = scale_vector(buf, p->excitation, FRAME_LEN + PITCH_MAX);
-    buf   += offset;
-
-    /* Compute maximum backward cross-correlation */
-    ccr   = 0;
-    index = autocorr_max(buf, offset, &ccr, pitch_lag, SUBFRAME_LEN * 2, -1);
-    ccr   = av_sat_add32(ccr, 1 << 15) >> 16;
-
-    /* Compute target energy */
-    tgt_eng  = dot_product(buf, buf, SUBFRAME_LEN * 2);
-    *exc_eng = av_sat_add32(tgt_eng, 1 << 15) >> 16;
-
-    if (ccr <= 0)
-        return 0;
-
-    /* Compute best energy */
-    best_eng = dot_product(buf - index, buf - index, SUBFRAME_LEN * 2);
-    best_eng = av_sat_add32(best_eng, 1 << 15) >> 16;
-
-    temp = best_eng * *exc_eng >> 3;
-
-    if (temp < ccr * ccr)
-        return index;
-    else
-        return 0;
-}
-
-/**
- * Peform residual interpolation based on frame classification.
- *
- * @param buf   decoded excitation vector
- * @param out   output vector
- * @param lag   decoded pitch lag
- * @param gain  interpolated gain
- * @param rseed seed for random number generator
- */
-static void residual_interp(int16_t *buf, int16_t *out, int lag,
-                            int gain, int *rseed)
-{
-    int i;
-    if (lag) { /* Voiced */
-        int16_t *vector_ptr = buf + PITCH_MAX;
-        /* Attenuate */
-        for (i = 0; i < lag; i++)
-            out[i] = vector_ptr[i - lag] * 3 >> 2;
-        av_memcpy_backptr((uint8_t*)(out + lag), lag * sizeof(*out),
-                          (FRAME_LEN - lag) * sizeof(*out));
-    } else {  /* Unvoiced */
-        for (i = 0; i < FRAME_LEN; i++) {
-            *rseed = *rseed * 521 + 259;
-            out[i] = gain * *rseed >> 15;
-        }
-        memset(buf, 0, (FRAME_LEN + PITCH_MAX) * sizeof(*buf));
-    }
-}
-
-/**
- * Perform IIR filtering.
- *
- * @param fir_coef FIR coefficients
- * @param iir_coef IIR coefficients
- * @param src      source vector
- * @param dest     destination vector
- */
-static inline void iir_filter(int16_t *fir_coef, int16_t *iir_coef,
-                              int16_t *src, int *dest)
-{
-    int m, n;
-
-    for (m = 0; m < SUBFRAME_LEN; m++) {
-        int64_t filter = 0;
-        for (n = 1; n <= LPC_ORDER; n++) {
-            filter -= fir_coef[n - 1] * src[m - n] -
-                      iir_coef[n - 1] * (dest[m - n] >> 16);
-        }
-
-        dest[m] = av_clipl_int32((src[m] << 16) + (filter << 3) + (1 << 15));
-    }
-}
-
-/**
- * Adjust gain of postfiltered signal.
- *
- * @param p      the context
- * @param buf    postfiltered output vector
- * @param energy input energy coefficient
- */
-static void gain_scale(G723_1_Context *p, int16_t * buf, int energy)
-{
-    int num, denom, gain, bits1, bits2;
-    int i;
-
-    num   = energy;
-    denom = 0;
-    for (i = 0; i < SUBFRAME_LEN; i++) {
-        int temp = buf[i] >> 2;
-        temp *= temp;
-        denom = av_sat_dadd32(denom, temp);
-    }
-
-    if (num && denom) {
-        bits1   = normalize_bits(num,   31);
-        bits2   = normalize_bits(denom, 31);
-        num     = num << bits1 >> 1;
-        denom <<= bits2;
-
-        bits2 = 5 + bits1 - bits2;
-        bits2 = FFMAX(0, bits2);
-
-        gain = (num >> 1) / (denom >> 16);
-        gain = square_root(gain << 16 >> bits2);
-    } else {
-        gain = 1 << 12;
-    }
-
-    for (i = 0; i < SUBFRAME_LEN; i++) {
-        p->pf_gain = (15 * p->pf_gain + gain + (1 << 3)) >> 4;
-        buf[i]     = av_clip_int16((buf[i] * (p->pf_gain + (p->pf_gain >> 4)) +
-                                   (1 << 10)) >> 11);
-    }
-}
-
-/**
- * Perform formant filtering.
- *
- * @param p   the context
- * @param lpc quantized lpc coefficients
- * @param buf input buffer
- * @param dst output buffer
- */
-static void formant_postfilter(G723_1_Context *p, int16_t *lpc,
-                               int16_t *buf, int16_t *dst)
-{
-    int16_t filter_coef[2][LPC_ORDER];
-    int filter_signal[LPC_ORDER + FRAME_LEN], *signal_ptr;
-    int i, j, k;
-
-    memcpy(buf, p->fir_mem, LPC_ORDER * sizeof(*buf));
-    memcpy(filter_signal, p->iir_mem, LPC_ORDER * sizeof(*filter_signal));
-
-    for (i = LPC_ORDER, j = 0; j < SUBFRAMES; i += SUBFRAME_LEN, j++) {
-        for (k = 0; k < LPC_ORDER; k++) {
-            filter_coef[0][k] = (-lpc[k] * postfilter_tbl[0][k] +
-                                 (1 << 14)) >> 15;
-            filter_coef[1][k] = (-lpc[k] * postfilter_tbl[1][k] +
-                                 (1 << 14)) >> 15;
-        }
-        iir_filter(filter_coef[0], filter_coef[1], buf + i,
-                   filter_signal + i);
-        lpc += LPC_ORDER;
-    }
-
-    memcpy(p->fir_mem, buf + FRAME_LEN, LPC_ORDER * sizeof(*p->fir_mem));
-    memcpy(p->iir_mem, filter_signal + FRAME_LEN,
-           LPC_ORDER * sizeof(*p->iir_mem));
-
-    buf += LPC_ORDER;
-    signal_ptr = filter_signal + LPC_ORDER;
-    for (i = 0; i < SUBFRAMES; i++) {
-        int temp;
-        int auto_corr[2];
-        int scale, energy;
-
-        /* Normalize */
-        scale = scale_vector(dst, buf, SUBFRAME_LEN);
-
-        /* Compute auto correlation coefficients */
-        auto_corr[0] = dot_product(dst, dst + 1, SUBFRAME_LEN - 1);
-        auto_corr[1] = dot_product(dst, dst,     SUBFRAME_LEN);
-
-        /* Compute reflection coefficient */
-        temp = auto_corr[1] >> 16;
-        if (temp) {
-            temp = (auto_corr[0] >> 2) / temp;
-        }
-        p->reflection_coef = (3 * p->reflection_coef + temp + 2) >> 2;
-        temp = -p->reflection_coef >> 1 & ~3;
-
-        /* Compensation filter */
-        for (j = 0; j < SUBFRAME_LEN; j++) {
-            dst[j] = av_sat_dadd32(signal_ptr[j],
-                                   (signal_ptr[j - 1] >> 16) * temp) >> 16;
-        }
-
-        /* Compute normalized signal energy */
-        temp = 2 * scale + 4;
-        if (temp < 0) {
-            energy = av_clipl_int32((int64_t)auto_corr[1] << -temp);
-        } else
-            energy = auto_corr[1] >> temp;
-
-        gain_scale(p, dst, energy);
-
-        buf        += SUBFRAME_LEN;
-        signal_ptr += SUBFRAME_LEN;
-        dst        += SUBFRAME_LEN;
-    }
-}
-
-static int sid_gain_to_lsp_index(int gain)
-{
-    if (gain < 0x10)
-        return gain << 6;
-    else if (gain < 0x20)
-        return gain - 8 << 7;
-    else
-        return gain - 20 << 8;
-}
-
-static inline int cng_rand(int *state, int base)
-{
-    *state = (*state * 521 + 259) & 0xFFFF;
-    return (*state & 0x7FFF) * base >> 15;
-}
-
-static int estimate_sid_gain(G723_1_Context *p)
-{
-    int i, shift, seg, seg2, t, val, val_add, x, y;
-
-    shift = 16 - p->cur_gain * 2;
-    if (shift > 0)
-        t = p->sid_gain << shift;
-    else
-        t = p->sid_gain >> -shift;
-    x = t * cng_filt[0] >> 16;
-
-    if (x >= cng_bseg[2])
-        return 0x3F;
-
-    if (x >= cng_bseg[1]) {
-        shift = 4;
-        seg   = 3;
-    } else {
-        shift = 3;
-        seg   = (x >= cng_bseg[0]);
-    }
-    seg2 = FFMIN(seg, 3);
-
-    val     = 1 << shift;
-    val_add = val >> 1;
-    for (i = 0; i < shift; i++) {
-        t = seg * 32 + (val << seg2);
-        t *= t;
-        if (x >= t)
-            val += val_add;
-        else
-            val -= val_add;
-        val_add >>= 1;
-    }
-
-    t = seg * 32 + (val << seg2);
-    y = t * t - x;
-    if (y <= 0) {
-        t = seg * 32 + (val + 1 << seg2);
-        t = t * t - x;
-        val = (seg2 - 1 << 4) + val;
-        if (t >= y)
-            val++;
-    } else {
-        t = seg * 32 + (val - 1 << seg2);
-        t = t * t - x;
-        val = (seg2 - 1 << 4) + val;
-        if (t >= y)
-            val--;
-    }
-
-    return val;
-}
-
-static void generate_noise(G723_1_Context *p)
-{
-    int i, j, idx, t;
-    int off[SUBFRAMES];
-    int signs[SUBFRAMES / 2 * 11], pos[SUBFRAMES / 2 * 11];
-    int tmp[SUBFRAME_LEN * 2];
-    int16_t *vector_ptr;
-    int64_t sum;
-    int b0, c, delta, x, shift;
-
-    p->pitch_lag[0] = cng_rand(&p->cng_random_seed, 21) + 123;
-    p->pitch_lag[1] = cng_rand(&p->cng_random_seed, 19) + 123;
-
-    for (i = 0; i < SUBFRAMES; i++) {
-        p->subframe[i].ad_cb_gain = cng_rand(&p->cng_random_seed, 50) + 1;
-        p->subframe[i].ad_cb_lag  = cng_adaptive_cb_lag[i];
-    }
-
-    for (i = 0; i < SUBFRAMES / 2; i++) {
-        t = cng_rand(&p->cng_random_seed, 1 << 13);
-        off[i * 2]     =   t       & 1;
-        off[i * 2 + 1] = ((t >> 1) & 1) + SUBFRAME_LEN;
-        t >>= 2;
-        for (j = 0; j < 11; j++) {
-            signs[i * 11 + j] = (t & 1) * 2 - 1 << 14;
-            t >>= 1;
-        }
-    }
-
-    idx = 0;
-    for (i = 0; i < SUBFRAMES; i++) {
-        for (j = 0; j < SUBFRAME_LEN / 2; j++)
-            tmp[j] = j;
-        t = SUBFRAME_LEN / 2;
-        for (j = 0; j < pulses[i]; j++, idx++) {
-            int idx2 = cng_rand(&p->cng_random_seed, t);
-
-            pos[idx]  = tmp[idx2] * 2 + off[i];
-            tmp[idx2] = tmp[--t];
-        }
-    }
-
-    vector_ptr = p->audio + LPC_ORDER;
-    memcpy(vector_ptr, p->prev_excitation,
-           PITCH_MAX * sizeof(*p->excitation));
-    for (i = 0; i < SUBFRAMES; i += 2) {
-        gen_acb_excitation(vector_ptr, vector_ptr,
-                           p->pitch_lag[i >> 1], &p->subframe[i],
-                           p->cur_rate);
-        gen_acb_excitation(vector_ptr + SUBFRAME_LEN,
-                           vector_ptr + SUBFRAME_LEN,
-                           p->pitch_lag[i >> 1], &p->subframe[i + 1],
-                           p->cur_rate);
-
-        t = 0;
-        for (j = 0; j < SUBFRAME_LEN * 2; j++)
-            t |= FFABS(vector_ptr[j]);
-        t = FFMIN(t, 0x7FFF);
-        if (!t) {
-            shift = 0;
-        } else {
-            shift = -10 + av_log2(t);
-            if (shift < -2)
-                shift = -2;
-        }
-        sum = 0;
-        if (shift < 0) {
-           for (j = 0; j < SUBFRAME_LEN * 2; j++) {
-               t      = vector_ptr[j] << -shift;
-               sum   += t * t;
-               tmp[j] = t;
-           }
-        } else {
-           for (j = 0; j < SUBFRAME_LEN * 2; j++) {
-               t      = vector_ptr[j] >> shift;
-               sum   += t * t;
-               tmp[j] = t;
-           }
-        }
-
-        b0 = 0;
-        for (j = 0; j < 11; j++)
-            b0 += tmp[pos[(i / 2) * 11 + j]] * signs[(i / 2) * 11 + j];
-        b0 = b0 * 2 * 2979LL + (1 << 29) >> 30; // approximated division by 11
-
-        c = p->cur_gain * (p->cur_gain * SUBFRAME_LEN >> 5);
-        if (shift * 2 + 3 >= 0)
-            c >>= shift * 2 + 3;
-        else
-            c <<= -(shift * 2 + 3);
-        c = (av_clipl_int32(sum << 1) - c) * 2979LL >> 15;
-
-        delta = b0 * b0 * 2 - c;
-        if (delta <= 0) {
-            x = -b0;
-        } else {
-            delta = square_root(delta);
-            x     = delta - b0;
-            t     = delta + b0;
-            if (FFABS(t) < FFABS(x))
-                x = -t;
-        }
-        shift++;
-        if (shift < 0)
-           x >>= -shift;
-        else
-           x <<= shift;
-        x = av_clip(x, -10000, 10000);
-
-        for (j = 0; j < 11; j++) {
-            idx = (i / 2) * 11 + j;
-            vector_ptr[pos[idx]] = av_clip_int16(vector_ptr[pos[idx]] +
-                                                 (x * signs[idx] >> 15));
-        }
-
-        /* copy decoded data to serve as a history for the next decoded subframes */
-        memcpy(vector_ptr + PITCH_MAX, vector_ptr,
-               sizeof(*vector_ptr) * SUBFRAME_LEN * 2);
-        vector_ptr += SUBFRAME_LEN * 2;
-    }
-    /* Save the excitation for the next frame */
-    memcpy(p->prev_excitation, p->audio + LPC_ORDER + FRAME_LEN,
-           PITCH_MAX * sizeof(*p->excitation));
-}
-
-static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, AVPacket *avpkt)
-{
-    G723_1_Context *p  = avctx->priv_data;
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    int dec_mode       = buf[0] & 3;
-
-    PPFParam ppf[SUBFRAMES];
-    int16_t cur_lsp[LPC_ORDER];
-    int16_t lpc[SUBFRAMES * LPC_ORDER];
-    int16_t acb_vector[SUBFRAME_LEN];
-    int16_t *out;
-    int bad_frame = 0, i, j, ret;
-    int16_t *audio = p->audio;
-
-    if (buf_size < frame_size[dec_mode]) {
-        if (buf_size)
-            av_log(avctx, AV_LOG_WARNING,
-                   "Expected %d bytes, got %d - skipping packet\n",
-                   frame_size[dec_mode], buf_size);
-        *got_frame_ptr = 0;
-        return buf_size;
-    }
-
-    if (unpack_bitstream(p, buf, buf_size) < 0) {
-        bad_frame = 1;
-        if (p->past_frame_type == ACTIVE_FRAME)
-            p->cur_frame_type = ACTIVE_FRAME;
-        else
-            p->cur_frame_type = UNTRANSMITTED_FRAME;
-    }
-
-    frame->nb_samples = FRAME_LEN;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-         return ret;
-    }
-
-    out = (int16_t *)frame->data[0];
-
-    if (p->cur_frame_type == ACTIVE_FRAME) {
-        if (!bad_frame)
-            p->erased_frames = 0;
-        else if (p->erased_frames != 3)
-            p->erased_frames++;
-
-        inverse_quant(cur_lsp, p->prev_lsp, p->lsp_index, bad_frame);
-        lsp_interpolate(lpc, cur_lsp, p->prev_lsp);
-
-        /* Save the lsp_vector for the next frame */
-        memcpy(p->prev_lsp, cur_lsp, LPC_ORDER * sizeof(*p->prev_lsp));
-
-        /* Generate the excitation for the frame */
-        memcpy(p->excitation, p->prev_excitation,
-               PITCH_MAX * sizeof(*p->excitation));
-        if (!p->erased_frames) {
-            int16_t *vector_ptr = p->excitation + PITCH_MAX;
-
-            /* Update interpolation gain memory */
-            p->interp_gain = fixed_cb_gain[(p->subframe[2].amp_index +
-                                            p->subframe[3].amp_index) >> 1];
-            for (i = 0; i < SUBFRAMES; i++) {
-                gen_fcb_excitation(vector_ptr, &p->subframe[i], p->cur_rate,
-                                   p->pitch_lag[i >> 1], i);
-                gen_acb_excitation(acb_vector, &p->excitation[SUBFRAME_LEN * i],
-                                   p->pitch_lag[i >> 1], &p->subframe[i],
-                                   p->cur_rate);
-                /* Get the total excitation */
-                for (j = 0; j < SUBFRAME_LEN; j++) {
-                    int v = av_clip_int16(vector_ptr[j] << 1);
-                    vector_ptr[j] = av_clip_int16(v + acb_vector[j]);
-                }
-                vector_ptr += SUBFRAME_LEN;
-            }
-
-            vector_ptr = p->excitation + PITCH_MAX;
-
-            p->interp_index = comp_interp_index(p, p->pitch_lag[1],
-                                                &p->sid_gain, &p->cur_gain);
-
-            /* Peform pitch postfiltering */
-            if (p->postfilter) {
-                i = PITCH_MAX;
-                for (j = 0; j < SUBFRAMES; i += SUBFRAME_LEN, j++)
-                    comp_ppf_coeff(p, i, p->pitch_lag[j >> 1],
-                                   ppf + j, p->cur_rate);
-
-                for (i = 0, j = 0; j < SUBFRAMES; i += SUBFRAME_LEN, j++)
-                    ff_acelp_weighted_vector_sum(p->audio + LPC_ORDER + i,
-                                                 vector_ptr + i,
-                                                 vector_ptr + i + ppf[j].index,
-                                                 ppf[j].sc_gain,
-                                                 ppf[j].opt_gain,
-                                                 1 << 14, 15, SUBFRAME_LEN);
-            } else {
-                audio = vector_ptr - LPC_ORDER;
-            }
-
-            /* Save the excitation for the next frame */
-            memcpy(p->prev_excitation, p->excitation + FRAME_LEN,
-                   PITCH_MAX * sizeof(*p->excitation));
-        } else {
-            p->interp_gain = (p->interp_gain * 3 + 2) >> 2;
-            if (p->erased_frames == 3) {
-                /* Mute output */
-                memset(p->excitation, 0,
-                       (FRAME_LEN + PITCH_MAX) * sizeof(*p->excitation));
-                memset(p->prev_excitation, 0,
-                       PITCH_MAX * sizeof(*p->excitation));
-                memset(frame->data[0], 0,
-                       (FRAME_LEN + LPC_ORDER) * sizeof(int16_t));
-            } else {
-                int16_t *buf = p->audio + LPC_ORDER;
-
-                /* Regenerate frame */
-                residual_interp(p->excitation, buf, p->interp_index,
-                                p->interp_gain, &p->random_seed);
-
-                /* Save the excitation for the next frame */
-                memcpy(p->prev_excitation, buf + (FRAME_LEN - PITCH_MAX),
-                       PITCH_MAX * sizeof(*p->excitation));
-            }
-        }
-        p->cng_random_seed = CNG_RANDOM_SEED;
-    } else {
-        if (p->cur_frame_type == SID_FRAME) {
-            p->sid_gain = sid_gain_to_lsp_index(p->subframe[0].amp_index);
-            inverse_quant(p->sid_lsp, p->prev_lsp, p->lsp_index, 0);
-        } else if (p->past_frame_type == ACTIVE_FRAME) {
-            p->sid_gain = estimate_sid_gain(p);
-        }
-
-        if (p->past_frame_type == ACTIVE_FRAME)
-            p->cur_gain = p->sid_gain;
-        else
-            p->cur_gain = (p->cur_gain * 7 + p->sid_gain) >> 3;
-        generate_noise(p);
-        lsp_interpolate(lpc, p->sid_lsp, p->prev_lsp);
-        /* Save the lsp_vector for the next frame */
-        memcpy(p->prev_lsp, p->sid_lsp, LPC_ORDER * sizeof(*p->prev_lsp));
-    }
-
-    p->past_frame_type = p->cur_frame_type;
-
-    memcpy(p->audio, p->synth_mem, LPC_ORDER * sizeof(*p->audio));
-    for (i = LPC_ORDER, j = 0; j < SUBFRAMES; i += SUBFRAME_LEN, j++)
-        ff_celp_lp_synthesis_filter(p->audio + i, &lpc[j * LPC_ORDER],
-                                    audio + i, SUBFRAME_LEN, LPC_ORDER,
-                                    0, 1, 1 << 12);
-    memcpy(p->synth_mem, p->audio + FRAME_LEN, LPC_ORDER * sizeof(*p->audio));
-
-    if (p->postfilter) {
-        formant_postfilter(p, lpc, p->audio, out);
-    } else { // if output is not postfiltered it should be scaled by 2
-        for (i = 0; i < FRAME_LEN; i++)
-            out[i] = av_clip_int16(p->audio[LPC_ORDER + i] << 1);
-    }
-
-    *got_frame_ptr = 1;
-
-    return frame_size[dec_mode];
-}
-
-#define OFFSET(x) offsetof(G723_1_Context, x)
-#define AD     AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
-
-static const AVOption options[] = {
-    { "postfilter", "postfilter on/off", OFFSET(postfilter), AV_OPT_TYPE_INT,
-      { .i64 = 1 }, 0, 1, AD },
-    { NULL }
-};
-
-
-static const AVClass g723_1dec_class = {
-    .class_name = "G.723.1 decoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_g723_1_decoder = {
-    .name           = "g723_1",
-    .long_name      = NULL_IF_CONFIG_SMALL("G.723.1"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_G723_1,
-    .priv_data_size = sizeof(G723_1_Context),
-    .init           = g723_1_decode_init,
-    .decode         = g723_1_decode_frame,
-    .capabilities   = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
-    .priv_class     = &g723_1dec_class,
-};
diff --git a/deps/libav/libavcodec/g723_1_data.h b/deps/libav/libavcodec/g723_1_data.h
deleted file mode 100644
index 04f8a06..0000000
--- a/deps/libav/libavcodec/g723_1_data.h
+++ /dev/null
@@ -1,1200 +0,0 @@
-/*
- * G.723.1 compatible decoder data tables.
- * Copyright (c) 2006 Benjamin Larsson
- * Copyright (c) 2010 Mohamed Naufal Basheer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * G.723.1 compatible decoder data tables
- */
-
-#ifndef AVCODEC_G723_1_DATA_H
-#define AVCODEC_G723_1_DATA_H
-
-#include <stdint.h>
-
-#define SUBFRAMES       4
-#define SUBFRAME_LEN    60
-#define FRAME_LEN       (SUBFRAME_LEN << 2)
-#define LPC_ORDER       10
-#define LSP_BANDS       3
-#define LSP_CB_SIZE     256
-#define PITCH_MIN       18
-#define PITCH_MAX       (PITCH_MIN + 127)
-#define PITCH_ORDER     5
-#define GRID_SIZE       2
-#define PULSE_MAX       6
-#define GAIN_LEVELS     24
-#define COS_TBL_SIZE    512
-
-static const uint8_t frame_size[4] = { 24, 20, 4, 1 };
-
-/* Postfilter gain weighting factors scaled by 2^15 */
-static const int16_t ppf_gain_weight[2] = { 0x1800, 0x2000 };
-
-/* LSP DC component */
-static const int16_t dc_lsp[LPC_ORDER] = {
-    0x0c3b, 0x1271, 0x1e0a, 0x2a36, 0x3630,
-    0x406f, 0x4d28, 0x56f4, 0x638c, 0x6c46
-};
-
-/* Cosine table scaled by 2^14 */
-static const int16_t cos_tab[COS_TBL_SIZE] = {
-    16384,  16383,  16379,  16373,  16364,  16353,  16340,  16324,
-    16305,  16284,  16261,  16235,  16207,  16176,  16143,  16107,
-    16069,  16029,  15986,  15941,  15893,  15843,  15791,  15736,
-    15679,  15619,  15557,  15493,  15426,  15357,  15286,  15213,
-    15137,  15059,  14978,  14896,  14811,  14724,  14635,  14543,
-    14449,  14354,  14256,  14155,  14053,  13949,  13842,  13733,
-    13623,  13510,  13395,  13279,  13160,  13039,  12916,  12792,
-    12665,  12537,  12406,  12274,  12140,  12004,  11866,  11727,
-    11585,  11442,  11297,  11151,  11003,  10853,  10702,  10549,
-    10394,  10238,  10080,   9921,   9760,   9598,   9434,   9269,
-     9102,   8935,   8765,   8595,   8423,   8250,   8076,   7900,
-     7723,   7545,   7366,   7186,   7005,   6823,   6639,   6455,
-     6270,   6084,   5897,   5708,   5520,   5330,   5139,   4948,
-     4756,   4563,   4370,   4176,   3981,   3786,   3590,   3393,
-     3196,   2999,   2801,   2603,   2404,   2205,   2006,   1806,
-     1606,   1406,   1205,   1005,    804,    603,    402,    201,
-        0,   -201,   -402,   -603,   -804,  -1005,  -1205,  -1406,
-    -1606,  -1806,  -2006,  -2205,  -2404,  -2603,  -2801,  -2999,
-    -3196,  -3393,  -3590,  -3786,  -3981,  -4176,  -4370,  -4563,
-    -4756,  -4948,  -5139,  -5330,  -5520,  -5708,  -5897,  -6084,
-    -6270,  -6455,  -6639,  -6823,  -7005,  -7186,  -7366,  -7545,
-    -7723,  -7900,  -8076,  -8250,  -8423,  -8595,  -8765,  -8935,
-    -9102,  -9269,  -9434,  -9598,  -9760,  -9921, -10080, -10238,
-   -10394, -10549, -10702, -10853, -11003, -11151, -11297, -11442,
-   -11585, -11727, -11866, -12004, -12140, -12274, -12406, -12537,
-   -12665, -12792, -12916, -13039, -13160, -13279, -13395, -13510,
-   -13623, -13733, -13842, -13949, -14053, -14155, -14256, -14354,
-   -14449, -14543, -14635, -14724, -14811, -14896, -14978, -15059,
-   -15137, -15213, -15286, -15357, -15426, -15493, -15557, -15619,
-   -15679, -15736, -15791, -15843, -15893, -15941, -15986, -16029,
-   -16069, -16107, -16143, -16176, -16207, -16235, -16261, -16284,
-   -16305, -16324, -16340, -16353, -16364, -16373, -16379, -16383,
-   -16384, -16383, -16379, -16373, -16364, -16353, -16340, -16324,
-   -16305, -16284, -16261, -16235, -16207, -16176, -16143, -16107,
-   -16069, -16029, -15986, -15941, -15893, -15843, -15791, -15736,
-   -15679, -15619, -15557, -15493, -15426, -15357, -15286, -15213,
-   -15137, -15059, -14978, -14896, -14811, -14724, -14635, -14543,
-   -14449, -14354, -14256, -14155, -14053, -13949, -13842, -13733,
-   -13623, -13510, -13395, -13279, -13160, -13039, -12916, -12792,
-   -12665, -12537, -12406, -12274, -12140, -12004, -11866, -11727,
-   -11585, -11442, -11297, -11151, -11003, -10853, -10702, -10549,
-   -10394, -10238, -10080,  -9921,  -9760,  -9598,  -9434,  -9269,
-    -9102,  -8935,  -8765,  -8595,  -8423,  -8250,  -8076,  -7900,
-    -7723,  -7545,  -7366,  -7186,  -7005,  -6823,  -6639,  -6455,
-    -6270,  -6084,  -5897,  -5708,  -5520,  -5330,  -5139,  -4948,
-    -4756,  -4563,  -4370,  -4176,  -3981,  -3786,  -3590,  -3393,
-    -3196,  -2999,  -2801,  -2603,  -2404,  -2205,  -2006,  -1806,
-    -1606,  -1406,  -1205,  -1005,   -804,   -603,   -402,   -201,
-        0,    201,    402,    603,    804,   1005,   1205,   1406,
-     1606,   1806,   2006,   2205,   2404,   2603,   2801,   2999,
-     3196,   3393,   3590,   3786,   3981,   4176,   4370,   4563,
-     4756,   4948,   5139,   5330,   5520,   5708,   5897,   6084,
-     6270,   6455,   6639,   6823,   7005,   7186,   7366,   7545,
-     7723,   7900,   8076,   8250,   8423,   8595,   8765,   8935,
-     9102,   9269,   9434,   9598,   9760,   9921,  10080,  10238,
-    10394,  10549,  10702,  10853,  11003,  11151,  11297,  11442,
-    11585,  11727,  11866,  12004,  12140,  12274,  12406,  12537,
-    12665,  12792,  12916,  13039,  13160,  13279,  13395,  13510,
-    13623,  13733,  13842,  13949,  14053,  14155,  14256,  14354,
-    14449,  14543,  14635,  14724,  14811,  14896,  14978,  15059,
-    15137,  15213,  15286,  15357,  15426,  15493,  15557,  15619,
-    15679,  15736,  15791,  15843,  15893,  15941,  15986,  16029,
-    16069,  16107,  16143,  16176,  16207,  16235,  16261,  16284,
-    16305,  16324,  16340,  16353,  16364,  16373,  16379,  16383,
-};
-
-/* LSP VQ tables */
-static const int16_t lsp_band0[LSP_CB_SIZE][3] = {
-    {    0,      0,      0}, { -270,  -1372,  -1032}, { -541,  -1650,  -1382},
-    { -723,  -2011,  -2213}, { -941,  -1122,  -1942}, { -780,  -1145,  -2454},
-    { -884,  -1309,  -1373}, {-1051,  -1523,  -1766}, {-1083,  -1622,  -2300},
-    { -777,  -1377,  -2147}, { -935,  -1467,  -2763}, { -802,  -1327,  -3471},
-    { -935,  -1959,  -3999}, { -240,    -89,    222}, { -661,   -257,   -160},
-    { -994,   -466,   -419}, { -188,   -164,   -278}, { -342,   -512,   -415},
-    { -607,   -511,   -797}, {   16,     19,   -716}, {  374,    425,   -972},
-    { -346,    245,   -282}, { -265,    506,   -754}, { -620,   -147,   1955},
-    { -742,   -860,   2597}, { -150,   -352,   2704}, {  305,    880,   1954},
-    {  123,    731,   2766}, { -348,    765,   3327}, {  618,    221,   3258},
-    { -178,    -47,   4219}, {  393,   1304,   3842}, {  698,   1702,   4801},
-    {   63,   -584,   1229}, { -215,   -732,   1704}, {  172,   -335,   1909},
-    {   -2,    216,   1797}, {  353,    127,   2205}, {-1208,    188,     11},
-    { -513,    -75,   -683}, { -973,    222,   -646}, { -616,   -843,   -388},
-    { -950,  -1113,   -359}, {-1431,   -623,   -705}, {-1398,  -1063,   -178},
-    {  -45,   -461,     35}, {   -9,   -657,   -216}, {  127,  -1078,     95},
-    { -950,  -1156,    584}, {-1480,  -1494,    449}, { -120,   -705,    516},
-    { -368,   -961,    727}, { -378,   -526,    973}, { -793,   -614,    676},
-    { -801,   -755,   1287}, {-1476,   -340,   1636}, { -505,  -1254,   1543},
-    {-1243,  -1622,   1532}, { -776,  -1477,   -655}, {-1151,  -1296,   -823},
-    {-1153,  -1672,  -1124}, {-1291,  -2003,  -1702}, { -622,  -1283,     57},
-    { -471,  -1611,    509}, {-1060,  -1570,   -139}, { -873,  -2156,   -536},
-    {-1716,  -2021,   -364}, {-2150,  -3218,  -1291}, {-1248,  -1945,  -2904},
-    {-1215,  -2633,  -2855}, {  167,   -244,     84}, {  349,   -412,   -217},
-    {  -40,   -352,    632}, {  227,   -529,    405}, {   68,   -383,   -443},
-    {  167,   -558,   -706}, { -275,   -854,    -14}, { -351,  -1089,   -449},
-    {  341,    -72,   -289}, {  603,   -106,   -474}, {  322,   -219,   -649},
-    {  179,   -317,   -998}, {  450,   -291,   -996}, {  555,    195,   -525},
-    {  784,    272,   -831}, { -148,   -384,   -849}, {   82,   -536,  -1357},
-    {  238,   -172,  -1354}, {  422,   -268,  -1841}, {  297,   -737,  -2079},
-    { -111,   -801,   -598}, {    1,   -668,   -984}, { -131,   -818,  -1299},
-    { -329,   -521,  -1310}, { -151,   -778,  -1834}, {  -93,   -352,  -1746},
-    { -568,   -640,  -1821}, { -509,   -941,  -2183}, {  464,   -815,  -1250},
-    {   79,  -1133,  -1597}, { -184,  -1353,  -2123}, { -196,   -410,  -2427},
-    { -192,   -833,  -2810}, { -259,  -1382,  -3045}, { -217,      4,  -1166},
-    { -800,   -325,  -1219}, { -363,   -830,   -898}, { -661,  -1134,   -960},
-    { -386,   -980,  -1501}, { -627,  -1159,  -1722}, { -903,   -829,   -855},
-    { -685,   -829,  -1313}, {-1065,   -959,  -1405}, {  441,     25,   -847},
-    {  655,    -27,  -1181}, { 1159,   -110,   -705}, {  856,    253,  -1671},
-    {  415,    404,     -1}, {  322,    903,   -398}, {  670,    499,   -292},
-    {  803,    591,   -610}, { 1144,    591,   -814}, {  717,    183,    393},
-    {  857,    381,    106}, {  609,     62,    -27}, {  792,    198,   -325},
-    {  735,    805,     88}, { 1142,    812,     78}, { 1028,    366,   -292},
-    { 1309,    743,   -237}, { 1615,    589,    -79}, { 1010,    639,   -243},
-    {  999,    964,   -311}, { 1500,   1137,   -615}, {  988,    357,    646},
-    { 1227,    667,    683}, { 1164,   1565,    894}, { 1392,   2015,    477},
-    { 1138,    533,    250}, { 1437,    896,    391}, { 1765,   1118,     99},
-    { 1112,   1090,    802}, { 1596,    846,   1134}, {  937,   1161,    279},
-    { 1719,   1254,    683}, { 1338,   1086,     35}, { 1419,   1324,    428},
-    { 1428,   1524,     40}, { 2108,   1594,     89}, { 1015,    544,   1222},
-    { 1121,    925,   1263}, { 1030,   1318,   1485}, { 1295,    789,   1817},
-    { 1323,   1272,   1909}, { 1724,   1237,   1803}, { 1797,   1689,    858},
-    { 2149,   1367,   1301}, { 2302,   1867,    761}, { 2863,   2351,   1053},
-    {   52,    163,    -76}, {  230,    309,   -492}, {  -71,    619,     39},
-    { -218,    856,    499}, { -654,    736,   -207}, { -535,   1259,    155},
-    { -480,   1476,    643}, {  262,   1081,    102}, {  309,   1592,   -182},
-    {  627,   1629,    534}, {  337,    643,    456}, {  758,    670,    713},
-    {  202,   1126,    658}, {  612,   1131,    666}, {  686,   1223,   1136},
-    { -131,    377,    525}, {   42,    708,    907}, {   87,   1488,   1035},
-    {  432,   2117,    904}, {  137,    981,   1332}, { -447,   1014,   1136},
-    { -839,   1793,   1246}, { -559,    297,    198}, { -850,    685,    446},
-    {-1273,    632,    826}, { -401,   -544,    173}, { -753,   -793,    144},
-    { -436,     -9,    772}, { -115,   -243,   1310}, { -670,   -269,    374},
-    {-1027,    -13,    639}, { -887,    -81,   1137}, {-1277,   -455,    158},
-    {-1411,   -720,    736}, {  172,     88,    403}, {  386,    255,    756},
-    { -500,    522,    910}, { -958,    659,   1388}, { -395,    301,   1344},
-    { -356,    768,   1813}, { -613,    841,   2419}, {  445,   -122,    252},
-    {  629,    -87,    723}, {  283,   -253,    870}, {  456,   -116,   1381},
-    {  757,    180,   1059}, {  532,    408,   1509}, {  947,    288,   1806},
-    { 1325,    994,   2524}, {  892,   1219,   3023}, { 1397,   1596,   3406},
-    { 1143,   1552,   2546}, { 1850,   1433,   2710}, {  -10,    134,   1002},
-    {  154,    499,   1323}, {  508,    792,   1117}, {  509,   1340,   1616},
-    {  762,    862,   1608}, {  787,    740,   2320}, {  794,   1727,   1283},
-    {  465,   2108,   1660}, { -120,   1451,   1613}, { -386,   2016,   2169},
-    {  891,   1225,   2050}, {  456,   1480,   2185}, { 1493,   1283,   1209},
-    { 1397,   1636,   1518}, { 1776,   1738,   1552}, { 1572,   1698,   2141},
-    { 1389,   2126,   1271}, { 1959,   2413,   1119}, { 1365,   2892,   1505},
-    { 2206,   1971,   1623}, { 2076,   1950,   2280}, { 1717,   2291,   1867},
-    { 2366,   2515,   1953}, { 2865,   2838,   2522}, { 2535,   3465,   2011},
-    { 3381,   4127,   2638}, {  836,   2667,   2289}, { 1761,   2773,   2337},
-    { 1415,   3325,   2911}, { 2354,   3138,   3126}, { 2659,   4192,   4010},
-    { 1048,   1786,   1818}, { 1242,   2111,   2240}, { 1512,   2079,   2780},
-    { 1573,   2491,   3138}, { 2230,   2377,   2782}, {  416,   1773,   2704},
-    {  725,   2336,   3297}, { 1252,   2373,   3978}, { 2094,   2268,   3568},
-    { 2011,   2712,   4528}, { 1341,   3507,   3876}, { 1216,   3919,   4922},
-    { 1693,   4793,   6012}
-};
-
-static const int16_t lsp_band1[LSP_CB_SIZE][3] = {
-    {    0,      0,      0}, {-2114,  -1302,     76}, {-2652,  -1278,  -1368},
-    {-2847,   -828,   -349}, {-3812,  -2190,   -349}, {-3946,   -364,   -449},
-    {-2725,  -4492,  -3607}, {-3495,  -4764,  -1744}, {  -51,   -756,     84},
-    { -153,  -1191,    504}, {  108,  -1418,   1167}, { -835,   -896,    390},
-    { -569,  -1702,     87}, {-1151,  -1818,    933}, {-1826,  -2547,    411},
-    {-1842,  -1818,   1451}, {-2438,  -1611,    781}, {-2747,  -2477,   1311},
-    { -940,   1252,    477}, {-1629,   1688,    602}, {-1202,    617,    280},
-    {-1737,    393,    580}, {-1528,   1077,   1199}, {-2165,   -161,   1408},
-    {-2504,  -1087,   2371}, {-3458,   -175,   1395}, {-1397,    -98,   -843},
-    {-2252,   -177,  -1149}, {-1489,   -726,  -1283}, {-1558,   -265,  -1744},
-    {-1867,   -821,  -1897}, {-2062,  -1516,  -2340}, {-2595,  -1142,  -2861},
-    {  170,     46,   -819}, { -193,   -204,  -1151}, {  326,   -196,  -1532},
-    {  780,    329,   -816}, {  201,    369,  -1243}, {  650,   -209,  -1060},
-    { 1144,    -15,  -1216}, { 1203,   -259,  -1867}, { -890,   -564,  -1430},
-    { -638,   -852,  -1921}, {  177,   -739,  -1358}, { -261,   -526,  -1666},
-    {  206,   -407,  -2255}, {  338,   -526,   -822}, {  421,  -1095,  -1009},
-    {  765,   -607,  -1408}, {  825,  -1295,  -2004}, {  357,   -905,  -1815},
-    {  -58,  -1248,  -1588}, { -596,  -1436,  -2046}, {  -73,  -1159,  -2116},
-    { -115,  -1382,  -2581}, { -160,  -1723,  -1952}, {   -6,  -2196,  -2954},
-    { -649,  -1705,  -2603}, { -617,  -1453,  -3282}, { -949,  -2019,  -3102},
-    { -812,   1544,   1937}, {-1854,    574,   2000}, {-1463,   1140,   2649},
-    {-2683,   1748,   1452}, {-2486,   2241,   2523}, {  783,   1910,   1435},
-    {  581,   2682,   1376}, {  236,   2197,   1885}, { -453,   2943,   2057},
-    { -682,   2178,   2565}, {-1342,   3201,   3328}, { -288,   -184,    262},
-    {  121,   -149,   -183}, {  758,   -412,    206}, { 1038,   -204,    853},
-    { 1577,   -457,    700}, {  937,   -640,   -567}, { 1508,   -528,  -1024},
-    { -225,   -527,   -427}, { -564,  -1095,   -332}, { -742,   -353,   -186},
-    {-1288,   -459,     84}, {-1853,   -484,   -274}, {-1554,   -731,    825},
-    {-2425,   -234,    382}, {-1722,    293,   -271}, {-2515,    425,   -564},
-    {-2599,    818,    464}, { -358,    118,   -375}, { -613,    198,   -874},
-    { -690,    683,   -324}, {-1352,   1155,   -168}, {-1093,    129,   -324},
-    {-1184,    611,   -858}, {  433,    386,   -372}, { -120,    486,   -634},
-    {  234,    851,   -631}, {  602,    128,     46}, { 1099,    410,    159},
-    {  715,   -145,   -424}, { 1198,    -85,   -593}, { 1390,    367,   -358},
-    { 1683,    362,   -964}, { 1711,    622,     45}, { 2033,    833,   -383},
-    { 2890,    549,   -506}, {    7,    401,     52}, {   72,    811,    415},
-    {  566,    668,     41}, {  467,   1218,    130}, {   68,    957,   -187},
-    {  -25,   1649,   -103}, { -661,    260,    214}, { -925,    -94,    612},
-    { -321,   -422,    965}, { -788,   -672,   1783}, {  400,   -673,    779},
-    {  741,   -595,   1635}, { -161,    307,    657}, { -382,    836,    871},
-    { -814,    400,   1223}, {  364,    606,   1247}, {   57,     75,   1571},
-    {  151,    471,   2287}, {  -81,   1021,   1502}, {  227,   1470,   1097},
-    {  658,   1275,   1653}, {  664,   1478,   2377}, {  263,   -127,    444},
-    {  264,     89,    969}, {  794,    171,    576}, {  821,    186,   1226},
-    {  404,    462,    517}, {  339,    918,    794}, { 1280,   1423,    196},
-    { 1453,   2019,    365}, { 1615,   1481,    672}, { 2394,   1708,    508},
-    {  806,   1238,    573}, {  713,   1158,   1078}, { 1285,   1436,   1232},
-    { 1790,   1188,   1141}, {  765,    643,    864}, { 1032,    797,   1279},
-    {  900,    563,   1827}, { 1514,    673,   2312}, { 1544,   1129,   3240},
-    { 1469,   1050,   1594}, { 1945,   1318,   1988}, { 2397,   2026,   2060},
-    { 3538,   2057,   2620}, { 1249,   -118,     74}, { 1727,    194,    421},
-    { 2078,    -50,   -463}, {  970,    688,   -432}, { 1149,    952,   -110},
-    { 1254,   1275,   -651}, { 1386,    929,    401}, { 1960,   1167,    232},
-    {  407,   -752,   -243}, {  859,  -1118,    172}, { -227,   -860,   -992},
-    { -796,  -1175,  -1380}, {    8,  -1282,   -388}, {  353,  -1781,  -1037},
-    { -732,   -397,   -807}, { -853,    -28,  -1342}, {-1229,  -1207,  -1959},
-    {-1015,  -1125,  -2543}, {-1452,  -1791,  -2725}, {-1891,  -2416,  -3269},
-    { -918,  -1629,   -783}, { -580,  -2155,   -698}, {-1097,  -2364,    -96},
-    {-1387,  -1513,      7}, {-1588,  -2076,   -664}, {-1473,  -2740,   -784},
-    {-2378,  -3149,    -56}, {-2856,  -2092,   -169}, {-3391,  -3708,    316},
-    {-1176,   -890,   -614}, {-1944,  -1061,   -800}, { -299,  -1517,  -1000},
-    { -640,  -1850,  -1526}, {-1454,  -1536,  -1233}, {-1890,  -1955,  -1756},
-    {-1086,  -1921,  -2122}, { -750,  -2325,  -2260}, {-1325,  -2413,  -2673},
-    {-1114,  -2542,  -3459}, {-1341,  -2901,  -3963}, {-1160,  -2226,  -1393},
-    {-1001,  -2772,  -1573}, {-1594,  -2641,  -1978}, {-1534,  -3046,  -2624},
-    {-2224,  -2196,   -675}, {-2807,  -3054,  -1102}, {-2008,  -2840,  -1186},
-    {-1980,  -3332,  -1695}, {-1715,  -3562,   -505}, {-2527,  -4000,  -1887},
-    {-2333,  -2734,  -2296}, {-3440,  -2401,  -3211}, {-2008,  -3528,  -3337},
-    {-2247,  -3291,  -4510}, { -475,    949,    155}, { -149,   1365,    545},
-    { -757,   1644,   1083}, { -217,   2053,   1353}, {-1433,   2301,   1462},
-    {  495,   1661,    529}, {   10,   2037,    740}, { 2082,   1898,    978},
-    { 2831,   2294,    911}, {  842,    793,    420}, { 1223,   1023,    863},
-    { 1237,    451,    780}, { 1744,    708,    822}, { 1533,    284,   1384},
-    { 2135,    609,   1538}, { 2305,    626,    540}, { 2368,   1187,    955},
-    { 2586,   1255,     -7}, { 3116,   1131,    726}, { 3431,   1730,    428},
-    { 2734,   1648,   1307}, { 2988,   1231,   2010}, { 3523,   2024,   1488},
-    { 1034,   1657,    871}, { 1206,   2163,   1036}, { 1807,   2372,   1233},
-    { 1808,   1769,   1493}, { 1573,   2332,   1779}, { 1216,   1609,   1866},
-    { 1480,   1898,   2513}, {  465,   2708,   2776}, {  771,   3638,   3338},
-    { 1869,   2599,   2623}, { 2825,   2745,   2468}, { 2638,   2439,   1585},
-    { 2094,   2970,   1308}, { 2022,   3057,   1999}, { 3428,   2912,   1816},
-    { 4536,   2974,   2129}, { 1046,   2563,   2086}, { 1363,   3562,   2318},
-    { 2511,   1891,   2984}, { 1866,   2306,   3986}, { 3272,   2924,   3682},
-    { 3146,   3564,   2272}, { 3592,   3968,   2822}, { 2431,   3369,   3069},
-    { 1931,   4709,   3090}, { 2629,   4220,   3986}, { 4639,   4056,   3664},
-    { 4035,   5334,   4912}
-};
-
-static const int16_t lsp_band2[LSP_CB_SIZE][4] = {
-    {    0,      0,      0,      0}, {  601,    512,   -542,    334},
-    {  428,   1087,   -484,   -132}, {  652,    622,   -391,   -572},
-    {  378,    799,    141,   -860}, { 1040,    409,    112,   -554},
-    { 1123,    670,    -75,   -847}, { 1421,    494,   -315,  -1095},
-    {  787,   1001,    114,   -460}, {  988,   1672,    216,   -681},
-    { 1007,   1241,   -132,  -1247}, { 1073,    399,    186,     -5},
-    { 1262,    193,   -694,   -129}, {  325,    196,     51,   -641},
-    {  861,    -59,    350,   -458}, { 1261,    567,    586,   -346},
-    { 1532,    885,    210,   -517}, { 2027,    937,    113,   -792},
-    { 1383,   1064,    334,     38}, { 1964,   1468,    459,    133},
-    { 2062,   1186,    -98,   -121}, { 2577,   1445,    506,   -373},
-    { 2310,   1682,     -2,   -960}, { 2876,   1939,    765,    138},
-    { 3581,   2360,    649,   -414}, {  219,    176,   -398,   -309},
-    {  434,    -78,   -435,   -880}, { -344,    301,    265,   -552},
-    { -915,    470,    657,   -380}, {  419,   -432,   -163,   -453},
-    {  351,   -953,      8,   -562}, {  789,    -43,     20,   -958},
-    {  302,   -594,   -352,  -1159}, { 1040,    108,   -668,   -924},
-    { 1333,    210,  -1217,  -1663}, {  483,    589,   -350,  -1140},
-    { 1003,    824,   -802,  -1184}, {  745,     58,   -589,  -1443},
-    {  346,    247,   -915,  -1683}, {  270,    796,   -720,  -2043},
-    { 1208,    722,   -222,   -193}, { 1486,   1180,   -412,   -672},
-    { 1722,    179,    -69,   -521}, { 2047,    860,   -666,  -1410},
-    { -146,    222,   -281,   -805}, { -189,     90,   -114,  -1307},
-    { -152,   1086,   -241,   -764}, { -439,    733,   -601,  -1302},
-    { -833,   -167,   -351,   -601}, { -856,   -422,   -411,  -1059},
-    { -747,   -355,   -582,  -1644}, { -837,    210,   -916,  -1144},
-    {-1800,     32,   -878,  -1687}, {  -48,    -23,  -1146,     52},
-    { -350,   -409,  -1656,   -364}, {  265,   -728,   -858,   -577},
-    {  458,   -247,  -1141,   -997}, {  691,   -407,  -1988,  -1161},
-    {  -66,   -104,   -705,  -1249}, { -431,    -93,  -1191,  -1844},
-    {  203,   -732,  -1000,  -1693}, {   10,   -832,  -1846,  -1819},
-    {  493,   -128,  -1436,  -1768}, {  488,   -311,  -1730,  -2540},
-    { -653,   -532,  -1150,  -1172}, {-1086,   -289,  -1706,  -1533},
-    { -699,  -1205,  -1216,  -1766}, {-1032,  -1481,  -2074,  -1523},
-    { -721,  -1220,  -2277,  -2600}, {   12,   -539,  -1484,  -1131},
-    {  -40,   -911,  -2106,   -441}, { -471,   -484,  -2267,  -1549},
-    { -141,   -988,  -3006,  -1721}, {-1545,  -2102,   -583,    342},
-    {-1383,  -2772,   -386,    -13}, {-2118,  -2589,  -1205,     72},
-    {-2147,  -3231,   -965,    390}, {-2949,  -3300,   -621,    637},
-    {-3907,  -4138,   -865,    803}, {-1287,   -845,   -375,   -548},
-    {-1416,  -1169,   -487,  -1277}, {-1400,  -1690,  -1027,   -418},
-    {-2018,  -1909,  -1188,  -1260}, {-1418,  -2222,  -2029,   -128},
-    {-2067,  -2998,  -2693,   -310}, { -950,  -1028,  -1538,    185},
-    {-1616,   -915,  -2205,   -549}, {   19,   -821,  -1145,    352},
-    {  184,  -1175,  -1356,   -627}, { -547,  -1088,  -1661,   -911},
-    { -216,  -1502,  -2197,   -948}, { -795,  -1306,  -2374,   -451},
-    { -924,  -1889,  -2796,   -680}, { -600,  -1614,  -3609,   -885},
-    {-2392,  -2528,    319,    303}, {-2908,  -2095,   -310,    573},
-    {-3460,  -2141,     49,   -113}, {-2231,   -448,    675,   -146},
-    {-2805,   -532,   1231,    479}, {-2684,   -486,   -200,    611},
-    {-3525,   -971,   -198,    704}, {-3707,    173,    349,    254},
-    {-4734,  -1447,    -34,    880}, {  777,   -512,    114,    -10},
-    { 1250,    -66,    442,     -5}, {  604,    613,    452,   -352},
-    { 1224,    777,    675,  -1014}, {-1372,    -79,  -1208,   -238},
-    {-2389,    -17,  -1157,   -818}, {-1504,   -673,  -1133,  -1060},
-    {-1984,   -799,  -2005,  -1973}, {-2037,   -798,  -1068,   -105},
-    {-3190,   -899,  -1817,   -194}, { -156,   -886,    394,   -318},
-    { -258,  -1283,    551,    202}, { -536,  -1729,    910,    331},
-    { -847,  -1109,    795,   -163}, {-1171,  -1128,    715,    519},
-    {-1080,  -1319,   1685,    668}, {-1000,  -1921,     96,    211},
-    {-1487,  -2148,    831,    174}, {-1139,   -374,    414,     -4},
-    {-1517,  -1383,    396,   -352}, {-1012,    439,    -59,   -967},
-    {-1812,    706,   -440,  -1030}, {-1971,   -329,    -34,   -827},
-    {-2472,  -1588,   -151,   -606}, {-2161,    374,   -281,     76},
-    {-3012,    231,    -15,   -690}, { 1104,    566,    721,    209},
-    { 1685,    564,    383,     98}, { 1898,    750,    792,    -97},
-    {  556,    -64,    561,    -93}, {  876,    162,    913,    -22},
-    {  961,    675,   1296,    140}, {  756,   -396,    851,    544},
-    {  360,   -303,   1341,    396}, {  878,    -22,   1464,    863},
-    { -309,   -273,    642,   -129}, { -686,    -82,    842,    454},
-    {   -5,    -47,   1069,    998}, {  -94,    967,   1277,    298},
-    { -489,    385,   1473,    746}, { -369,   -717,   1333,    242},
-    {  281,   -993,   1726,    924}, {  464,    601,   1575,   1376},
-    { -250,    206,   2339,   1175}, { -438,    377,   -597,   -285},
-    {-1020,    787,   -790,   -287}, { -458,   -410,    215,    295},
-    { -589,   -860,   -121,    797}, {-1175,    122,   -437,    466},
-    {-1480,   -121,    367,    924}, {  234,    323,    770,   -555},
-    {  145,     30,    996,     26}, {   66,    849,     93,   -145},
-    { -117,   1261,    474,   -399}, {-1495,   1051,    218,   -506},
-    {-1390,    694,    994,     88}, {  616,      7,     78,    304},
-    { 1060,     52,    -62,    835}, {  833,    454,    649,   1359},
-    { -770,    464,     47,     93}, { -574,   1199,    -39,    379},
-    {  114,    -98,    488,    485}, {  727,    244,    606,    696},
-    {  -76,    455,    671,    546}, { -565,    -13,    145,    819},
-    { -376,    569,    448,   1128}, {  218,    122,    265,   1167},
-    {  230,    738,    932,   1003}, {  138,    477,     36,    450},
-    {  404,    787,    -73,   1000}, {  497,   1259,    387,   1231},
-    {   17,    207,    195,    -79}, {  562,    358,     53,   -158},
-    {  493,    387,    478,    189}, {  678,    831,    640,    558},
-    { -197,    523,    613,     57}, {  429,    894,    769,    111},
-    {   67,   1174,    568,    511}, { 1242,    824,    251,    840},
-    { 1419,   1074,    864,    481}, {  924,   1474,    669,    724},
-    { 1539,   1879,    654,   1590}, {  445,    337,   1111,    541},
-    {  472,   1421,   1264,   1094}, {  794,    735,   1103,    668},
-    { 1055,    863,   1192,   1020}, {  778,   1105,    806,   1798},
-    { 1052,   1527,   1587,   2151}, {  881,   1552,   1265,    391},
-    {  726,    872,   1812,    601}, { 1469,    280,   1008,    616},
-    { 1403,    577,   1803,   1244}, { 1650,   1314,   1148,   1072},
-    { 1297,   1669,   1911,   1026}, { 2093,   1044,   2115,   1189},
-    { 1644,   1961,   2587,   1512}, {   25,   -315,     -9,   -106},
-    {  290,   -339,    428,   -444}, {  -68,   -783,    735,    772},
-    {  245,   -555,    468,     47}, {  334,   -895,    814,    146},
-    {  235,    368,   -964,   -959}, { -203,    315,  -1566,  -1217},
-    {  801,     17,   -276,   -354}, {  894,   -495,   -789,   -635},
-    {  716,    291,  -1189,   -357}, {  560,   -260,   -733,     -2},
-    {  679,   -508,  -1429,    211}, {  -51,    -62,   -428,    557},
-    {  322,   -638,   -211,    614}, { -878,  -1057,    -84,    -71},
-    { -388,  -1415,   -167,   -318}, { -754,  -1574,    214,   -539},
-    {-1419,  -2004,    -92,   -787}, {  -47,   -856,   -347,   -255},
-    {   23,  -1211,   -173,    320}, { -658,   -487,   -893,    353},
-    { -783,  -1587,   -584,    507}, {-1420,   -859,   -378,    441},
-    {-2095,  -1491,   -137,    439}, { -321,  -1450,  -1288,    -12},
-    { -359,  -2113,   -553,     -8}, { -831,  -1918,  -1561,     32},
-    {-1014,  -2487,  -1359,   -939}, { -475,   -311,   -169,   -236},
-    { -907,   -426,    276,   -611}, {  -96,   -400,     50,   -710},
-    { -426,  -1022,    -10,   -985}, { -197,   -258,   -744,   -575},
-    { -611,   -930,   -771,   -394}, { -267,   -776,   -612,   -939},
-    { -256,  -1346,   -802,  -1122}, { -796,  -1570,   -825,   -754},
-    {  712,    876,    141,    227}, {  981,   1509,     85,    124},
-    { 1462,   1228,    979,    -39}, { 1734,    999,   1481,    440},
-    { 2293,   1116,    769,    440}, { 2504,   1480,   1241,    356},
-    { 2474,   1909,   1558,    810}, {  917,   1134,    607,   -134},
-    {  509,   1809,    781,   -123}, { 1712,   1506,    559,   -423},
-    { 2037,   2317,    726,   -155}, { 3031,   2676,   1203,    331},
-    { 3664,   3274,   1768,    531}, { 1610,   1839,    867,    183},
-    { 1774,   1972,   1538,     97}, { 1822,   2158,   1282,    659},
-    { 2222,   2758,   1818,    900}, { 3251,   2124,   1723,    996},
-    { 3633,   2336,   2408,   1453}, { 2923,   3517,   2567,   1318},
-};
-
-/*
- * Used for the coding/decoding of the pulses positions
- * for the MP-MLQ codebook
- */
-static const int32_t combinatorial_table[PULSE_MAX][SUBFRAME_LEN/GRID_SIZE] = {
-    {118755, 98280, 80730, 65780L, 53130,
-      42504, 33649, 26334,  20349, 15504,
-      11628,  8568,  6188,   4368,  3003,
-       2002,  1287,   792,    462,   252,
-        126,    56,    21,      6,     1,
-          0,     0,     0,      0,     0},
-
-    { 23751, 20475, 17550,  14950, 12650,
-      10626,  8855,  7315,   5985,  4845,
-       3876,  3060,  2380,   1820,  1365,
-       1001,   715,   495,    330,   210,
-        126,    70,    35,     15,     5,
-          1,     0,     0,      0,     0},
-
-    {  3654,  3276,  2925,   2600,  2300,
-       2024,  1771,  1540,   1330,  1140,
-        969,   816,   680,    560,   455,
-        364,   286,   220,    165,   120,
-         84,    56,    35,     20,    10,
-          4,     1,     0,      0,     0},
-
-    {   406,   378,   351,    325,   300,
-        276,   253,   231,    210,   190,
-        171,   153,   136,    120,   105,
-         91,    78,    66,     55,    45,
-         36,    28,    21,     15,    10,
-          6,     3,     1,      0,     0},
-
-    {    29,    28,    27,     26,    25,
-         24,    23,    22,     21,    20,
-         19,    18,    17,     16,    15,
-         14,    13,    12,     11,    10,
-          9,     8,     7,      6,     5,
-          4,     3,     2,      1,     0},
-
-    {     1,     1,     1,      1,     1,
-          1,     1,     1,      1,     1,
-          1,     1,     1,      1,     1,
-          1,     1,     1,      1,     1,
-          1,     1,     1,      1,     1,
-          1,     1,     1,      1,     1},
-};
-
-static const int16_t pitch_contrib[340] = {
-    60,     0,  0,  2489, 60,     0,  0,  5217,
-     1,  6171,  0,  3953,  0, 10364,  1,  9357,
-    -1,  8843,  1,  9396,  0,  5794, -1, 10816,
-     2, 11606, -2, 12072,  0,  8616,  1, 12170,
-     0, 14440,  0,  7787, -1, 13721,  0, 18205,
-     0, 14471,  0, 15807,  1, 15275,  0, 13480,
-    -1, 18375, -1,     0,  1, 11194, -1, 13010,
-     1, 18836, -2, 20354,  1, 16233, -1,     0,
-    60,     0,  0, 12130,  0, 13385,  1, 17834,
-     1, 20875,  0, 21996,  1,     0,  1, 18277,
-    -1, 21321,  1, 13738, -1, 19094, -1, 20387,
-    -1,     0,  0, 21008, 60,     0, -2, 22807,
-     0, 15900,  1,     0,  0, 17989, -1, 22259,
-     1, 24395,  1, 23138,  0, 23948,  1, 22997,
-     2, 22604, -1, 25942,  0, 26246,  1, 25321,
-     0, 26423,  0, 24061,  0, 27247, 60,     0,
-    -1, 25572,  1, 23918,  1, 25930,  2, 26408,
-    -1, 19049,  1, 27357, -1, 24538, 60,     0,
-    -1, 25093,  0, 28549,  1,     0,  0, 22793,
-    -1, 25659,  0, 29377,  0, 30276,  0, 26198,
-     1, 22521, -1, 28919,  0, 27384,  1, 30162,
-    -1,     0,  0, 24237, -1, 30062,  0, 21763,
-     1, 30917, 60,     0,  0, 31284,  0, 29433,
-     1, 26821,  1, 28655,  0, 31327,  2, 30799,
-     1, 31389,  0, 32322,  1, 31760, -2, 31830,
-     0, 26936, -1, 31180,  1, 30875,  0, 27873,
-    -1, 30429,  1, 31050,  0,     0,  0, 31912,
-     1, 31611,  0, 31565,  0, 25557,  0, 31357,
-    60,     0,  1, 29536,  1, 28985, -1, 26984,
-    -1, 31587,  2, 30836, -2, 31133,  0, 30243,
-    -1, 30742, -1, 32090, 60,     0,  2, 30902,
-    60,     0,  0, 30027,  0, 29042, 60,     0,
-     0, 31756,  0, 24553,  0, 25636, -2, 30501,
-    60,     0, -1, 29617,  0, 30649, 60,     0,
-     0, 29274,  2, 30415,  0, 27480,  0, 31213,
-    -1, 28147,  0, 30600,  1, 31652,  2, 29068,
-    60,     0,  1, 28571,  1, 28730,  1, 31422,
-     0, 28257,  0, 24797, 60,     0,  0,     0,
-    60,     0,  0, 22105,  0, 27852, 60,     0,
-    60,     0, -1, 24214,  0, 24642,  0, 23305,
-    60,     0, 60,     0,  1, 22883,  0, 21601,
-    60,     0,  2, 25650, 60,     0, -2, 31253,
-    -2, 25144,  0, 17998
-};
-
-/* Number of non-zero pulses in the MP-MLQ excitation */
-static const int8_t pulses[4] = {6, 5, 6, 5};
-
-/* Size of the MP-MLQ fixed excitation codebooks */
-static const int32_t max_pos[4] = {593775, 142506, 593775, 142506};
-
-static const int16_t fixed_cb_gain[GAIN_LEVELS] = {
-      1,    2,    3,    4,    6,    9,   13,   18,
-     26,   38,   55,   80,  115,  166,  240,  348,
-    502,  726, 1050, 1517, 2193, 3170, 4582, 6623,
-};
-
-static const int16_t adaptive_cb_gain85[85 * 20] = {
-        0,      0,      0,      0,      0,      0,      0,      0,
-        0,      0,      0,      0,      0,      0,      0,      0,
-        0,      0,      0,      0,    800,   1496,    167,   -256,
-     -338,    -39,   -136,     -1,     -4,     -6,    -73,     -8,
-      -15,     12,     23,      2,     16,     30,      3,     -5,
-     -462,   -686,    493,   2575,    311,    -13,    -28,    -14,
-     -404,     -5,    -19,     13,     20,     72,    107,    -77,
-        8,     13,     -9,    -48,   1483,    144,    784,    928,
-     1243,   -134,     -1,    -37,    -52,    -94,    -13,    -71,
-       -6,    -84,     -8,    -44,   -112,    -10,    -59,    -70,
-      -77,    275,   3522,   1056,  -1254,      0,     -4,   -757,
-      -68,    -95,      1,     16,    -59,      4,    -17,   -227,
-       -5,     21,    269,     80,   -125,    -40,   -264,    381,
-     5027,      0,      0,     -4,     -8,  -1542,      0,     -2,
-        0,      2,      0,      6,     38,     12,     81,   -117,
-      138,    332,   2215,   2574,   1339,     -1,     -6,   -299,
-     -404,   -109,     -2,    -18,    -44,    -21,    -52,   -348,
-      -11,    -27,   -181,   -210,   3685,   2883,   -887,    866,
-    -1639,   -828,   -507,    -48,    -45,   -164,   -648,    199,
-      156,   -194,   -152,     46,    368,    288,    -88,     86,
-     1396,   2146,   2235,    345,    942,   -118,   -281,   -305,
-       -7,    -54,   -182,   -190,   -292,    -29,    -45,    -47,
-      -80,   -123,   -128,    -19,     13,   4475,   3549,   -804,
-     -655,      0,  -1222,   -768,    -39,    -26,     -3,     -2,
-     -969,      0,    219,    174,      0,    179,    141,    -32,
-     -724,    254,    242,   6049,   2462,    -32,     -3,     -3,
-    -2233,   -370,     11,     10,     -3,    267,    -94,    -89,
-      108,    -38,    -36,   -909,    626,  -1713,   6121,   4561,
-    -1061,    -23,   -179,  -2287,  -1270,    -68,     65,   -233,
-      640,   -174,    477,  -1704,     40,   -111,    396,    295,
-     -350,   1391,   7985,    511,   -405,     -7,   -118,  -3892,
-      -15,    -10,     29,    170,   -678,     10,    -43,   -249,
-       -8,     34,    197,     12,   3144,   -529,    608,   2530,
-     3878,   -603,    -17,    -22,   -390,   -918,    101,   -116,
-       19,   -485,     81,    -93,   -744,    125,   -144,   -599,
-     2589,   -689,   3045,   5603,   -404,   -409,    -29,   -566,
-    -1916,    -10,    108,   -481,    128,   -885,    235,  -1041,
-       63,    -17,     75,    138,   3107,    513,   1374,  -3594,
-    -4922,   -589,    -16,   -115,   -788,  -1478,    -97,   -260,
-      -43,    681,    112,    301,    933,    154,    413,  -1079,
-     2468,   6010,   1107,   -390,   1961,   -372,  -2204,    -74,
-       -9,   -234,   -905,   -166,   -406,     58,    143,     26,
-     -295,   -719,   -132,     46,   4773,   2766,   2368,   4862,
-    -4044,  -1390,   -467,   -342,  -1443,   -998,   -806,   -690,
-     -399,  -1416,   -821,   -702,   1178,    682,    584,   1200,
-     1665,  -1879,   1443,   1701,   8562,   -169,   -215,   -127,
-     -176,  -4475,    190,   -146,    165,   -172,    195,   -149,
-     -870,    982,   -754,   -889,   2716,   9011,  -1007,    755,
-    -1785,   -450,  -4956,    -61,    -34,   -194,  -1493,    167,
-      554,   -125,   -415,     46,    296,    982,   -109,     82,
-    -2727,   7548,   1285,    938,   3420,   -453,  -3478,   -100,
-      -53,   -714,   1256,    213,   -592,    156,   -432,    -73,
-      569,  -1576,   -268,   -196,   3677,    882,   4050,   1202,
-     2323,   -825,    -47,  -1001,    -88,   -329,   -198,   -909,
-     -218,   -269,    -64,   -297,   -521,   -125,   -574,   -170,
-     2046,   -753,    122,  10102,    603,   -255,    -34,      0,
-    -6229,    -22,     94,    -15,      5,  -1261,    464,    -75,
-      -75,     27,     -4,   -372,    449,  -1815,  10690,   3870,
-     -527,    -12,   -201,  -6976,   -914,    -16,     49,   -293,
-     1184,   -106,    428,  -2525,     14,    -58,    344,    124,
-     -941,   2352,   5049,   3650,   2637,    -54,   -337,  -1556,
-     -813,   -424,    135,    290,   -725,    209,   -524,  -1125,
-      151,   -378,   -812,   -587,  -1879,    796,   3117,   9569,
-     -404,   -215,    -38,   -593,  -5589,     -9,     91,    357,
-     -151,   1097,   -464,  -1821,    -46,     19,     76,    236,
-    -1715,   2043,  -2096,   9946,   4001,   -179,   -254,   -268,
-    -6038,   -977,    213,   -219,    261,   1041,  -1240,   1272,
-      418,   -498,    511,  -2429,  -5772,   -618,  -3921,    284,
-    -3155,  -2033,    -23,   -938,     -4,   -607,   -218,  -1381,
-     -148,    100,     10,     68,  -1111,   -119,   -755,     54,
-      382,   4748,   8003,  -2064,   2198,     -8,  -1376,  -3909,
-     -260,   -294,   -110,   -186,  -2319,     48,    598,   1008,
-      -51,   -637,  -1073,    277,   -867,   3015,  11926,  -1675,
-      947,    -45,   -555,  -8681,   -171,    -54,    159,    631,
-    -2195,    -88,    308,   1219,     50,   -174,   -690,     96,
-    -4933,   -432,   6757,   3771,   1352,  -1485,    -11,  -2786,
-     -867,   -111,   -130,   2034,    178,   1135,     99,  -1555,
-      407,     35,   -557,   -311,    152,   9726,   4231,  -1928,
-     1490,     -1,  -5774,  -1092,   -226,   -135,    -90,    -39,
-    -2511,     17,   1144,    498,    -13,   -884,   -384,    175,
-     2512,    193,   9033,   5361,  -3148,   -385,     -2,  -4980,
-    -1754,   -605,    -29,  -1385,   -106,   -822,    -63,  -2956,
-      482,     37,   1735,   1030,   8464,   2844,     12,    549,
-     2132,  -4373,   -493,      0,    -18,   -277,  -1469,     -6,
-       -2,   -284,    -95,      0,  -1101,   -370,     -1,    -71,
-     2141,  -2602,   7166,   9046,  -1350,   -279,   -413,  -3134,
-    -4994,   -111,    340,   -936,   1138,  -1182,   1436,  -3957,
-      176,   -214,    590,    745,   -244,    278,  13307,   1227,
-     -161,     -3,     -4, -10808,    -91,     -1,      4,    198,
-     -226,     18,    -20,   -997,     -2,      2,    131,     12,
-    -1947,   8217,   6269,    917,  -2559,   -231,  -4121,  -2399,
-      -51,   -399,    976,    745,  -3144,    108,   -460,   -350,
-     -304,   1283,    979,    143,  -1810,   2061,  -2781,   6056,
-    10058,   -200,   -259,   -472,  -2238,  -6174,    227,   -307,
-      349,    669,   -761,   1028,   1111,  -1265,   1707,  -3717,
-     7827,   9161,  -3409,   2473,  -1510,  -3739,  -5122,   -709,
-     -373,   -139,  -4376,   1628,   1906,  -1181,  -1382,    514,
-      721,    844,   -314,    228,  -1430,   8313,   9541,  -2955,
-     1626,   -124,  -4218,  -5556,   -533,   -161,    725,    832,
-    -4841,   -257,   1499,   1721,    142,   -825,   -947,    293,
-     2819,  -4247,   5391,   8673,   2756,   -485,  -1101,  -1774,
-    -4591,   -463,    730,   -927,   1397,  -1492,   2248,  -2854,
-     -474,    714,   -907,  -1459,    141,  14552,    690,    257,
-     -112,     -1, -12926,    -29,     -4,      0,   -125,     -5,
-     -613,     -2,   -228,    -10,      0,     99,      4,      1,
-    11938,  -1859,   1806,   -962,   -884,  -8699,   -211,   -199,
-      -56,    -47,   1355,  -1316,    205,    701,   -109,    106,
-      644,   -100,     97,    -51,   3728,   1982,   2264,   4584,
-     3131,   -848,   -239,   -312,  -1282,   -598,   -451,   -515,
-     -273,  -1043,   -554,   -633,   -712,   -378,   -432,   -876,
-    -1181,    766,    720,  14303,   -216,    -85,    -35,    -31,
-   -12486,     -2,     55,     51,    -33,   1031,   -668,   -628,
-      -15,     10,      9,    189,  -4385,   4826,  10112,   1569,
-     3388,  -1173,  -1421,  -6242,   -150,   -700,   1291,   2706,
-    -2979,    420,   -462,   -969,    906,   -998,  -2091,   -324,
-     -448,   1932,  15591,  -1842,    657,    -12,   -227, -14837,
-     -207,    -26,     52,    427,  -1838,    -50,    217,   1753,
-       18,    -77,   -626,     74,  -4141,   1844,   3962,   5517,
-     6220,  -1046,   -207,   -958,  -1858,  -2361,    466,   1001,
-     -446,   1394,   -621,  -1334,   1572,   -700,  -1504,  -2094,
-      729,  -2299,  14755,   3657,   -952,    -32,   -322, -13288,
-     -816,    -55,    102,   -656,   2071,   -162,    513,  -3294,
-       42,   -133,    857,    212,  -1385,   5801,  13339,  -3137,
-     1344,   -117,  -2054, -10861,   -600,   -110,    490,   1127,
-    -4723,   -265,   1111,   2554,    113,   -476,  -1094,    257,
-     4710,   9661,   1073,  -2467,   3274,  -1354,  -5697,    -70,
-     -371,   -654,  -2777,   -308,   -633,    709,   1455,    161,
-     -941,  -1930,   -214,    493,   1843,  -3624,  12422,   6898,
-    -1559,   -207,   -802,  -9419,  -2904,   -148,    407,  -1397,
-     2748,   -775,   1526,  -5230,    175,   -344,   1182,    656,
-     1433,   2394,   2507,   1380,   8780,   -125,   -349,   -383,
-     -116,  -4705,   -209,   -219,   -366,   -120,   -201,   -211,
-     -768,  -1283,  -1343,   -740,  -1712,  12915,   5883,  -2197,
-      991,   -179, -10181,  -2112,   -294,    -60,   1350,    615,
-    -4638,   -229,   1732,    789,    103,   -781,   -356,    133,
-    15072,   2158,  -1245,    910,   -496, -13865,   -284,    -94,
-      -50,    -15,  -1986,   1145,    164,   -837,   -119,     69,
-      456,     65,    -37,     27,   4655,   7319,   4916,    586,
-    -3381,  -1322,  -3270,  -1475,    -20,   -697,  -2079,  -1396,
-    -2196,   -166,   -261,   -175,    960,   1510,   1014,    120,
-     1191,  -2140,   5120,  13498,  -1418,    -86,   -279,  -1600,
-   -11121,   -122,    155,   -372,    669,   -981,   1763,  -4218,
-      103,   -185,    443,   1168,  -1530,   -817,   8191,   9632,
-    -1452,   -143,    -40,  -4095,  -5663,   -128,    -76,    765,
-      408,    900,    480,  -4815,   -135,    -72,    726,    854,
-    -3236,    607,   1696,  -2106,  11485,   -639,    -22,   -175,
-     -270,  -8051,    119,    335,    -62,   -416,     78,    218,
-     2268,   -425,  -1189,   1476,   3203,  -1903,   -837,   9679,
-     7057,   -626,   -221,    -42,  -5718,  -3039,    372,    163,
-      -97,  -1892,   1124,    494,  -1380,    819,    360,  -4169,
-      213,   -655,  17015,    620,   -384,     -2,    -26, -17671,
-      -23,     -9,      8,   -221,    681,     -8,     24,   -644,
-        5,    -15,    399,     14,   5088,     35,  -3339,   3726,
-     8488,  -1580,      0,   -680,   -847,  -4397,    -10,   1037,
-        7,  -1157,     -8,    759,  -2636,    -18,   1730,  -1930,
-     -988,   1454,  -2688,  15039,   2682,    -59,   -129,   -441,
-   -13805,   -439,     87,   -162,    238,    907,  -1335,   2467,
-      161,   -238,    440,  -2462,  -4865,  -2842,    -53,   5495,
-     6523,  -1445,   -493,      0,  -1843,  -2597,   -844,    -16,
-       -9,   1632,    953,     18,   1937,   1131,     21,  -2188,
-     3076,  15069,  -2914,   1810,   -971,   -577, -13860,   -518,
-     -200,    -57,  -2829,    547,   2680,   -339,  -1665,    322,
-      182,    893,   -172,    107,   1311,   5355,  11054,   2299,
-    -3654,   -105,  -1750,  -7458,   -322,   -814,   -428,   -885,
-    -3613,   -184,   -751,  -1551,    292,   1194,   2465,    512,
-     4035,   5619,   4618,   1815,   1912,   -994,  -1927,  -1301,
-     -201,   -223,  -1384,  -1137,  -1583,   -447,   -622,   -511,
-     -471,   -656,   -539,   -211,  -2131,   2754,  -4501,  12879,
-     7432,   -277,   -463,  -1236, -10124,  -3371,    358,   -585,
-      756,   1675,  -2165,   3538,    967,  -1249,   2042,  -5842,
-     5618,   -515,   3219,  -4149,   4857,  -1926,    -16,   -632,
-    -1050,  -1440,    176,  -1104,    101,   1422,   -130,    815,
-    -1666,    152,   -954,   1230,   1838,  -1709,   1139,  16867,
-      716,   -206,   -178,    -79, -17366,    -31,    191,   -127,
-      118,  -1892,   1759,  -1173,    -80,     74,    -49,   -737,
-     1978,  -3845,  10050,  11854,  -2492,   -238,   -902,  -6164,
-    -8576,   -379,    464,  -1213,   2358,  -1431,   2782,  -7271,
-      301,   -585,   1529,   1803,  -2600,  11246,  11289,  -3647,
-     1463,   -412,  -7720,  -7778,   -812,   -130,   1784,   1791,
-    -7749,   -578,   2504,   2513,    232,  -1004,  -1008,    325,
-     3442,    907,   2725,   8970,   3638,   -723,    -50,   -453,
-    -4911,   -808,   -190,   -572,   -150,  -1884,   -496,  -1492,
-     -764,   -201,   -605,  -1992,   -126,  17498,   3481,  -2003,
-     1090,      0, -18689,   -739,   -244,    -72,    135,     26,
-    -3717,    -15,   2139,    425,      8,  -1165,   -231,    133,
-    -1814,   1048,  -2164,   4070,  16272,   -200,    -67,   -285,
-    -1011, -16160,    116,   -239,    138,    450,   -260,    537,
-     1801,  -1041,   2149,  -4042,   9354,  12580,  -1883,    962,
-     -617,  -5341,  -9660,   -216,    -56,    -23,  -7183,   1075,
-     1446,   -549,   -738,    110,    352,    474,    -71,     36,
-     1708,   4199,   7387,   6335,   1003,   -178,  -1076,  -3330,
-    -2449,    -61,   -437,   -770,  -1893,   -660,  -1623,  -2856,
-     -104,   -257,   -452,   -388,  -2624,   5623,  17310,  -2353,
-      592,   -420,  -1930, -18288,   -338,    -21,    900,   2772,
-    -5941,   -376,    807,   2486,     94,   -203,   -625,     85,
-     1211,   -850,   1193,  -1926,  15992,    -89,    -44,    -86,
-     -226, -15609,     62,    -88,     61,    142,   -100,    140,
-    -1182,    830,  -1165,   1880,   3983,  -2054,  11506,    -19,
-     3622,   -968,   -257,  -8080,      0,   -801,    499,  -2797,
-     1442,      4,     -2,     13,   -880,    454,  -2544,      4,
-     -786,  -1354,  16092,   7246,  -1665,    -37,   -111, -15805,
-    -3205,   -169,    -65,    772,   1330,    348,    599,  -7117,
-      -80,   -137,   1636,    736,  -4316,   -511,   6674,  11665,
-     4633,  -1137,    -15,  -2719,  -8305,  -1310,   -134,   1758,
-      208,   3073,    364,  -4752,   1220,    144,  -1887,  -3299,
-     7912,   4557,   1937,   1885,   7037,  -3821,  -1267,   -229,
-     -216,  -3022,  -2200,   -935,   -538,   -910,   -524,   -222,
-    -3398,  -1957,   -832,   -809,   3434,   2967,   5867,   8196,
-     8766,   -720,   -537,  -2101,  -4100,  -4690,   -622,  -1230,
-    -1062,  -1718,  -1484,  -2935,  -1837,  -1588,  -3139,  -4385,
-     5881,   9176,   8119,   3934,   3355,  -2111,  -5139,  -4023,
-     -944,   -687,  -3294,  -2914,  -4547,  -1412,  -2203,  -1949,
-    -1204,  -1879,  -1662,   -805
-};
-
-static const int16_t adaptive_cb_gain170[170 * 20] = {
-        0,      0,      0,      0,      0,      0,      0,      0,
-        0,      0,      0,      0,      0,      0,      0,      0,
-        0,      0,      0,      0,    776,    212,    715,    670,
-      809,    -36,     -2,    -31,    -27,    -39,    -10,    -33,
-       -9,    -31,     -8,    -29,    -38,    -10,    -35,    -33,
-     1296,   1316,   -168,   -320,   -815,   -102,   -105,     -1,
-       -6,    -40,   -104,     13,     13,     25,     25,     -3,
-       64,     65,     -8,    -15,   -589,    680,   2478,    308,
-     -596,    -21,    -28,   -375,     -5,    -21,     24,     89,
-     -102,     11,    -12,    -46,    -21,     24,     90,     11,
-     -735,   -487,     -5,   2948,    468,    -33,    -14,      0,
-     -530,    -13,    -21,      0,      0,    132,     87,      0,
-       21,     13,      0,    -84,   1042,   1730,   1068,    333,
-      626,    -66,   -182,    -69,     -6,    -23,   -110,    -67,
-     -112,    -21,    -35,    -21,    -39,    -66,    -40,    -12,
-      486,   -769,   4074,   2825,  -1107,    -14,    -36,  -1013,
-     -487,    -74,     22,   -120,    191,    -83,    132,   -702,
-       32,    -52,    275,    191,   1521,   -767,   -124,   4320,
-     1026,   -141,    -35,      0,  -1139,    -64,     71,     11,
-       -5,   -401,    202,     32,    -95,     48,      7,   -270,
-     2425,   1267,   3439,    -91,  -1166,   -359,    -98,   -722,
-        0,    -83,   -187,   -509,   -266,     13,      7,     19,
-      172,     90,    244,     -6,  -1251,    975,    173,   4039,
-     2005,    -95,    -58,     -1,   -996,   -245,     74,     13,
-      -10,    308,   -240,    -42,    153,   -119,    -21,   -494,
-     1820,    632,   1322,   2062,   1031,   -202,    -24,   -106,
-     -259,    -64,    -70,   -146,    -51,   -229,    -79,   -166,
-     -114,    -39,    -83,   -129,   -447,   4904,    244,   -315,
-    -2038,    -12,  -1467,     -3,     -6,   -253,    134,      6,
-      -73,     -8,     94,      4,    -55,    610,     30,    -39,
-     -208,  -1102,    463,   -448,   5653,     -2,    -74,    -13,
-      -12,  -1950,    -14,      5,     31,     -5,    -30,     12,
-       71,    380,   -159,    154,   4739,   2600,  -1864,    856,
-    -1554,  -1371,   -412,   -212,    -44,   -147,   -752,    539,
-      295,   -247,   -135,     97,    449,    246,   -176,     81,
-     1894,   3533,     35,    -26,   2145,   -219,   -762,      0,
-        0,   -280,   -408,     -4,     -7,      3,      5,      0,
-     -248,   -462,     -4,      3,  -2699,   1841,   4072,   2443,
-     1582,   -444,   -207,  -1012,   -364,   -152,    303,    670,
-     -457,    402,   -274,   -607,    260,   -177,   -393,   -236,
-     -844,   3358,   6106,  -1059,   -537,    -43,   -688,  -2275,
-      -68,    -17,    173,    314,  -1251,    -54,    217,    395,
-      -27,    110,    200,    -34,   1251,   1016,   3020,   2210,
-     1445,    -95,    -63,   -556,   -298,   -127,    -77,   -230,
-     -187,   -168,   -137,   -407,   -110,    -89,   -266,   -194,
-     2099,   2277,   4038,   3533,  -2870,   -269,   -316,   -995,
-     -762,   -503,   -291,   -517,   -561,   -452,   -491,   -871,
-      367,    399,    707,    619,    400,  -1114,   8516,   2422,
-    -1117,     -9,    -75,  -4426,   -358,    -76,     27,   -208,
-      579,    -59,    164,  -1259,     27,    -75,    580,    165,
-    -4398,  -2011,   3912,  -2407,   2258,  -1180,   -247,   -934,
-     -353,   -311,   -540,   1050,    480,   -646,   -295,    575,
-      606,    277,   -539,    331,   1767,  -1447,   4240,   6160,
-     -757,   -190,   -127,  -1097,  -2316,    -35,    156,   -457,
-      374,   -664,    544,  -1594,     81,    -66,    195,    284,
-     1594,  -1463,   1035,   6938,   1920,   -155,   -130,    -65,
-    -2938,   -225,    142,   -100,     92,   -675,    619,   -438,
-     -186,    171,   -121,   -813,   -562,   4716,   4085,   -591,
-     2421,    -19,  -1357,  -1018,    -21,   -357,    162,    140,
-    -1175,    -20,    170,    147,     83,   -696,   -603,     87,
-     1552,   8778,   -935,    354,  -1424,   -147,  -4703,    -53,
-       -7,   -123,   -831,     88,    501,    -33,   -189,     20,
-      134,    763,    -81,     30,   4831,  -4431,     41,  -1479,
-    -2976,  -1424,  -1198,      0,   -133,   -540,   1306,    -12,
-       11,    436,   -400,      3,    877,   -804,      7,   -268,
-     2090,   1192,   1006,   1645,   4853,   -266,    -86,    -61,
-     -165,  -1437,   -152,   -128,    -73,   -210,   -119,   -101,
-     -619,   -353,   -298,   -487,   2386,   5712,   1426,    -94,
-     1350,   -347,  -1991,   -124,      0,   -111,   -832,   -207,
-     -497,     13,     32,      8,   -196,   -470,   -117,      7,
-    -1349,   1091,   1659,   8891,    313,   -111,    -72,   -168,
-    -4825,     -5,     89,    136,   -110,    732,   -592,   -900,
-       25,    -20,    -31,   -170,   9980,    916,   -381,   -808,
-       88,  -6080,    -51,     -8,    -39,      0,   -558,    232,
-       21,    492,     45,    -18,    -53,     -4,      2,      4,
-     2338,  -1031,   -248,   3928,   6484,   -333,    -64,     -3,
-     -942,  -2566,    147,     35,    -15,   -560,    247,     59,
-     -925,    408,     98,  -1555,   6166,  -1240,   -337,   3672,
-    -1277,  -2320,    -93,     -6,   -823,    -99,    466,    126,
-      -25,  -1382,    278,     75,    480,    -96,    -26,    286,
-     4377,   -132,  -2588,   1701,   4865,  -1169,     -1,   -409,
-     -176,  -1444,     35,    691,    -20,   -454,     13,    268,
-    -1299,     39,    768,   -505,   2594,   3295,   3944,   1481,
-      682,   -410,   -662,   -949,   -133,    -28,   -521,   -624,
-     -793,   -234,   -297,   -356,   -108,   -137,   -164,    -61,
-     4151,    624,    815,   4485,   2229,  -1052,    -23,    -40,
-    -1228,   -303,   -158,   -206,    -31,  -1136,   -170,   -223,
-     -565,    -84,   -111,   -610,  -3575,   -361,   4924,   2791,
-     4698,   -780,     -7,  -1480,   -475,  -1347,    -78,   1074,
-      108,    609,     61,   -839,   1025,    103,  -1412,   -800,
-    -2518,   3791,   8623,    315,   2465,   -387,   -877,  -4538,
-       -6,   -370,    582,   1325,  -1995,     48,    -73,   -166,
-      378,   -570,  -1297,    -47,   -691,   2989,   9957,   -421,
-    -1142,    -29,   -545,  -6051,    -10,    -79,    126,    420,
-    -1817,    -17,     76,    256,    -48,    208,    694,    -29,
-    -1918,    104,  -3190,  -3410,  -4440,   -224,      0,   -621,
-     -709,  -1203,     12,   -373,     20,   -399,     21,   -664,
-     -519,     28,   -864,   -924,  -3359,  -1668,   1854,   6939,
-     1430,   -688,   -169,   -209,  -2939,   -124,   -341,    380,
-      188,   1422,    706,   -785,    293,    145,   -161,   -606,
-       42,   9706,   3164,   -952,    907,      0,  -5750,   -611,
-      -55,    -50,    -25,     -8,  -1874,      2,    564,    183,
-       -2,   -537,   -175,     52,   1607,    785,   2862,   4327,
-     3307,   -157,    -37,   -500,  -1143,   -667,    -77,   -280,
-     -137,   -424,   -207,   -756,   -324,   -158,   -577,   -873,
-     6801,   3416,   2227,   1682,  -3217,  -2823,   -712,   -302,
-     -172,   -631,  -1418,   -924,   -464,   -698,   -350,   -228,
-     1335,    670,    437,    330,   3459,   3898,    364,   7841,
-    -2640,   -730,   -927,     -8,  -3753,   -425,   -823,    -76,
-      -86,  -1655,  -1865,   -174,    557,    628,     58,   1263,
-    -5902,  -3458,  -2465,  -1886,   4334,  -2126,   -730,   -371,
-     -217,  -1146,  -1245,   -888,   -520,   -679,   -398,   -283,
-     1561,    915,    652,    499,  -3710,   1133,   7849,   3443,
-     -215,   -840,    -78,  -3760,   -723,     -2,    256,   1777,
-     -543,    779,   -238,  -1649,    -48,     14,    103,     45,
-     4132,   2828,      2,  -4212,  -4116,  -1042,   -488,      0,
-    -1083,  -1034,   -713,      0,      0,   1062,    727,      0,
-     1038,    710,      0,  -1058,   5875,   8496,  -1796,   1376,
-    -1786,  -2107,  -4406,   -197,   -115,   -194,  -3047,    644,
-      931,   -493,   -713,    150,    640,    926,   -195,    150,
-     3143,   3483,   3546,   -793,   4489,   -603,   -740,   -767,
-      -38,  -1230,   -668,   -680,   -754,    152,    168,    171,
-     -861,   -954,   -971,    217,   2845,   7965,   3695,  -5432,
-     3978,   -494,  -3873,   -833,  -1801,   -966,  -1383,   -641,
-    -1796,    943,   2641,   1225,   -691,  -1934,   -897,   1319,
-     1538,    150,   7139,   2049,   3097,   -144,     -1,  -3110,
-     -256,   -585,    -14,   -670,    -65,   -192,    -18,   -892,
-     -290,    -28,  -1349,   -387,    618,   7520,   4729,   -238,
-    -3373,    -23,  -3452,  -1365,     -3,   -694,   -283,   -178,
-    -2170,      8,    109,     68,    127,   1548,    973,    -49,
-     2965,  -3013,   7912,   7076,  -1997,   -536,   -554,  -3821,
-    -3056,   -243,    545,  -1431,   1455,  -1280,   1301,  -3417,
-      361,   -367,    964,    862,   2443,   -929,  -1113,   9677,
-     4138,   -364,    -52,    -75,  -5716,  -1045,    138,    166,
-      -63,  -1443,    549,    657,   -617,    234,    281,  -2444,
-     1966,   3309,  10085,  -3399,   2105,   -236,   -668,  -6207,
-     -705,   -270,   -397,  -1210,  -2037,    408,    686,   2092,
-     -252,   -425,  -1295,    436,   -112,  -1368,   8868,   4822,
-     2048,      0,   -114,  -4800,  -1419,   -256,     -9,     61,
-      740,     33,    402,  -2610,     14,    171,  -1108,   -602,
-    -2597,    438,  -1839,   6229,   7266,   -411,    -11,   -206,
-    -2368,  -3223,     69,   -291,     49,    987,   -166,    699,
-     1152,   -194,    816,  -2763,   3454,    553,   9127,   4946,
-    -5596,   -728,    -18,  -5084,  -1493,  -1911,   -116,  -1924,
-     -308,  -1042,   -166,  -2755,   1179,    188,   3117,   1689,
-     -532,   -663,  12262,   2495,  -1004,    -17,    -26,  -9177,
-     -380,    -61,    -21,    398,    496,     81,    101,  -1867,
-      -32,    -40,    751,    152,  -2100,   1317,  -1509,  11425,
-     2997,   -269,   -105,   -139,  -7967,   -548,    168,   -193,
-      121,   1464,   -918,   1052,    384,   -240,    276,  -2090,
-     1193,  -2697,  11259,   5373,   -763,    -86,   -444,  -7737,
-    -1762,    -35,    196,   -819,   1853,   -391,    884,  -3692,
-       55,   -125,    525,    250,   2405,   -471,  11079,    203,
-      782,   -353,    -13,  -7491,     -2,    -37,     69,  -1626,
-      318,    -29,      5,   -137,   -114,     22,   -529,     -9,
-    -1871,   5685,  11290,  -2662,   1353,   -213,  -1972,  -7780,
-     -432,   -111,    649,   1289,  -3917,   -304,    923,   1834,
-      154,   -469,   -932,    220,  -3768,   5927,  -3093,   5041,
-     5212,   -866,  -2144,   -584,  -1551,  -1658,   1363,   -711,
-     1119,   1159,  -1824,    951,   1198,  -1885,    984,  -1603,
-    -2546,   9502,   5969,  -2440,   1928,   -395,  -5511,  -2175,
-     -363,   -226,   1477,    927,  -3462,   -379,   1415,    889,
-      299,  -1118,   -702,    287,  -4963,   3568,   4592,   5508,
-     3451,  -1503,   -777,  -1287,  -1851,   -727,   1080,   1391,
-    -1000,   1668,  -1199,  -1543,   1045,   -751,   -967,  -1160,
-     1745,  -2586,   3983,  10899,  -1551,   -186,   -408,   -968,
-    -7250,   -146,    275,   -424,    628,  -1161,   1720,  -2649,
-      165,   -244,    377,   1032,    867,   -456,   -727,   3369,
-    11822,    -45,    -12,    -32,   -692,  -8531,     24,     38,
-      -20,   -178,     93,    149,   -625,    329,    525,  -2431,
-     7535,   2422,   1926,   1405,   1599,  -3466,   -358,   -226,
-     -120,   -156,  -1114,   -886,   -284,   -646,   -207,   -165,
-     -735,   -236,   -188,   -137,   1041,   -735,   -142,  13209,
-     1515,    -66,    -33,     -1, -10649,   -140,     46,      9,
-       -6,   -839,    593,    114,    -96,     68,     13,  -1222,
-     7950,   6745,  -1444,  -1008,   2721,  -3857,  -2777,   -127,
-      -62,   -452,  -3273,    700,    594,    489,    415,    -88,
-    -1320,  -1120,    239,    167,  -4754,  -1379,   4522,   -578,
-    -5733,  -1379,   -116,  -1248,    -20,  -2006,   -400,   1312,
-      380,   -167,    -48,    159,  -1663,   -482,   1582,   -202,
-     3220,   5978,   5923,   2430,  -2689,   -633,  -2181,  -2141,
-     -360,   -441,  -1175,  -1164,  -2161,   -477,   -886,   -878,
-      528,    981,    972,    398,    377,   1312,  13978,  -1470,
-      677,     -8,   -105, -11925,   -132,    -28,    -30,   -321,
-    -1119,     33,    117,   1254,    -15,    -54,   -577,     60,
-    -3435,   6770,    314,   -885,   5686,   -720,  -2797,     -6,
-      -47,  -1973,   1419,     65,   -129,   -185,    366,     16,
-     1192,  -2349,   -109,    307,   3171,   8774,  -2260,   2679,
-     3069,   -613,  -4699,   -312,   -438,   -575,  -1698,    437,
-     1210,   -518,  -1435,    369,   -594,  -1643,    423,   -501,
-     5557,   1509,   5407,   -125,  -7386,  -1884,   -139,  -1784,
-        0,  -3330,   -511,  -1834,   -498,     42,     11,     41,
-     2505,    680,   2438,    -56,  -2838,   2595,  13228,    271,
-     1793,   -491,   -411, -10680,     -4,   -196,    449,   2291,
-    -2095,     47,    -42,   -219,    310,   -284,  -1447,    -29,
-      664,   -278,  14966,    951,   -711,    -26,     -4, -13672,
-      -55,    -30,     11,   -606,    253,    -38,     16,   -869,
-       28,    -12,    650,     41,    808,   1770,   8658,   5863,
-    -1486,    -39,   -191,  -4576,  -2098,   -134,    -87,   -427,
-     -935,   -289,   -633,  -3098,     73,    160,    785,    531,
-     3063,   1539,   2000,   -542,   9576,   -572,   -144,   -244,
-      -17,  -5597,   -287,   -374,   -188,    101,     51,     66,
-    -1790,   -900,  -1169,    317,    514,  14083,   -323,    896,
-     -891,    -16, -12106,     -6,    -49,    -48,   -442,     10,
-      277,    -28,   -770,     17,     27,    766,    -17,     48,
-      892,    158,   5237,  11057,  -1603,    -48,     -1,  -1674,
-    -7462,   -156,     -8,   -285,    -50,   -602,   -106,  -3534,
-       87,     15,    512,   1082,  -1612,   2564,  -4296,  12526,
-     5710,   -158,   -401,  -1126,  -9576,  -1990,    252,   -422,
-      672,   1232,  -1960,   3284,    561,   -893,   1497,  -4365,
-     4889,  -6878,    612,   6109,   4753,  -1459,  -2887,    -22,
-    -2277,  -1379,   2052,   -182,    257,  -1823,   2564,   -228,
-    -1418,   1995,   -177,  -1772,   3053,   -506,   2403,   9625,
-     1322,   -569,    -15,   -352,  -5655,   -106,     94,   -448,
-       74,  -1794,    297,  -1412,   -246,     40,   -194,   -777,
-     -754,  12904,   4480,  -2113,   1471,    -34, -10163,  -1225,
-     -272,   -132,    594,    206,  -3529,    -97,   1664,    577,
-       67,  -1159,   -402,    189,   4255,   1476,   5055,   2393,
-     2912,  -1105,   -132,  -1559,   -349,   -517,   -383,  -1313,
-     -455,   -621,   -215,   -738,   -756,   -262,   -898,   -425,
-    -1371,    535,   1417,  14604,   -997,   -114,    -17,   -122,
-   -13017,    -60,     44,    118,    -46,   1222,   -477,  -1263,
-      -83,     32,     86,    888,   5368,  -1744,   4083,  -1236,
-     3753,  -1758,   -185,  -1017,    -93,   -860,    571,  -1338,
-      434,    405,   -131,    308,  -1229,    399,   -935,    283,
-     1588,  -3097,  14415,   3699,  -1171,   -154,   -585, -12683,
-     -835,    -83,    300,  -1397,   2725,   -358,    699,  -3255,
-      113,   -221,   1030,    264,    212,   7989,   9471,  -3344,
-     2009,     -2,  -3895,  -5475,   -682,   -246,   -103,   -123,
-    -4618,     43,   1630,   1933,    -26,   -979,  -1161,    410,
-      856,   2294,   -627,   6930,   6929,    -44,   -321,    -24,
-    -2931,  -2930,   -119,     32,     87,   -362,   -970,    265,
-     -362,   -970,    265,  -2931,   2357,  -4187,   7162,   7683,
-     3371,   -339,  -1070,  -3131,  -3603,   -693,    602,  -1030,
-     1830,  -1105,   1963,  -3359,   -485,    861,  -1474,  -1581,
-      350,   4585,  14053,  -3819,   1218,     -7,  -1283, -12054,
-     -890,    -90,    -97,   -300,  -3933,     81,   1068,   3275,
-      -26,   -341,  -1045,    284,  -3248,   3531,    475,   2137,
-    11711,   -644,   -761,    -13,   -278,  -8372,    700,     94,
-     -102,    423,   -460,    -62,   2322,  -2524,   -340,  -1528,
-    -3017,   3852,   1725,   8440,   5257,   -555,   -905,   -181,
-    -4348,  -1686,    709,    317,   -405,   1554,  -1984,   -889,
-      968,  -1236,   -553,  -2708,   -909,   3196,  15512,  -2528,
-     1066,    -50,   -623, -14686,   -390,    -69,    177,    861,
-    -3026,   -140,    493,   2393,     59,   -208,  -1009,    164,
-      959,  -3370,   9617,   9545,  -1761,    -56,   -693,  -5645,
-    -5561,   -189,    197,   -563,   1978,   -558,   1963,  -5603,
-      103,   -362,   1034,   1026,   7575,  11796,  -4845,   3252,
-    -1703,  -3502,  -8493,  -1433,   -645,   -177,  -5454,   2240,
-     3488,  -1503,  -2341,    961,    787,   1226,   -503,    338,
-     6409,   1722,   1764,  -4191,   6015,  -2507,   -181,   -189,
-    -1072,  -2208,   -673,   -690,   -185,   1639,    440,    451,
-    -2353,   -632,   -647,   1538,  -2420,  12161,   5038,   1286,
-    -2098,   -357,  -9027,  -1549,   -100,   -268,   1796,    744,
-    -3740,    190,   -954,   -395,   -310,   1557,    645,    164,
-    -2232,  -1341,   7246,   9470,  -1977,   -304,   -109,  -3204,
-    -5474,   -238,   -182,    987,    593,   1290,    775,  -4188,
-     -269,   -161,    874,   1143,   1030,   7034,   4231,   1551,
-     3077,    -64,  -3019,  -1093,   -146,   -577,   -442,   -266,
-    -1816,    -97,   -666,   -400,   -193,  -1321,   -794,   -291,
-     5121,  11835,   -477,  -1749,   2298,  -1601,  -8549,    -13,
-     -186,   -322,  -3699,    149,    344,    546,   1264,    -50,
-     -718,  -1660,     66,    245,  -3328,   3827,   5921,   9976,
-    -1045,   -676,   -894,  -2140,  -6075,    -66,    777,   1203,
-    -1383,   2027,  -2330,  -3605,   -212,    244,    377,    636,
-     3813,   5718,  -4666,  -3412,   5674,   -887,  -1995,  -1329,
-     -710,  -1965,  -1331,   1086,   1628,    794,   1191,   -972,
-    -1320,  -1980,   1616,   1181,   1348,  -3672,  13154,   6938,
-    -1690,   -110,   -823, -10561,  -2938,   -174,    302,  -1082,
-     2948,   -570,   1555,  -5570,    139,   -379,   1357,    716,
-     2151,  -3586,   6949,  12131,  -1224,   -282,   -785,  -2947,
-    -8982,    -91,    470,   -912,   1521,  -1592,   2655,  -5145,
-      160,   -268,    519,    906,  -2889,   9647,  10276,  -2728,
-      995,   -509,  -5680,  -6445,   -454,    -60,   1701,   1812,
-    -6051,   -481,   1606,   1711,    175,   -586,   -624,    165,
-     6177,   2184,    555,   1985,   6589,  -2329,   -291,    -18,
-     -240,  -2650,   -823,   -209,    -74,   -748,   -264,    -67,
-    -2484,   -878,   -223,   -798,   -492,    391,  17166,   -681,
-      240,    -14,     -9, -17987,    -28,     -3,     11,    515,
-     -410,    -20,     16,    713,      7,     -5,   -252,     10,
-    12628,   5448,  -2630,   3011,  -2695,  -9733,  -1811,   -422,
-     -553,   -443,  -4199,   2027,    874,  -2321,  -1001,    483,
-     2077,    896,   -432,    495,  -3628,   -534,   3447,   7002,
-     6751,   -803,    -17,   -725,  -2992,  -2782,   -118,    763,
-      112,   1550,    228,  -1473,   1495,    220,  -1420,  -2885,
-    -5239,   5901,   8107,   3650,   4846,  -1675,  -2125,  -4012,
-     -813,  -1433,   1887,   2592,  -2920,   1167,  -1315,  -1806,
-     1550,  -1745,  -2398,  -1080,   6157,   6678,   4099,  -1074,
-     2348,  -2314,  -2722,  -1025,    -70,   -336,  -2509,  -1540,
-    -1670,    403,    437,    268,   -882,   -957,   -587,    153,
-     1079,  16099,    242,   -881,   1690,    -71, -15820,     -3,
-      -47,   -174,  -1060,    -16,   -238,     58,    865,     13,
-     -111,  -1661,    -25,     90,   -278,    227,  -1039,   1636,
-    16945,     -4,     -3,    -65,   -163, -17526,      3,    -17,
-       14,     27,    -22,    103,    287,   -234,   1074,  -1693,
-    15778,  -1454,    574,   -603,   -107, -15195,   -129,    -20,
-      -22,      0,   1400,   -553,     51,    581,    -53,     21,
-      103,     -9,      3,     -3,   2406,   -836,  13224,   7993,
-    -4266,   -353,    -42, -10673,  -3899,  -1111,    122,  -1942,
-      674,  -1174,    407,  -6451,    626,   -217,   3443,   2081,
-     3184,  14368,  -3336,   2255,  -1801,   -619, -12600,   -679,
-     -310,   -198,  -2793,    648,   2926,   -438,  -1977,    459,
-      350,   1580,   -366,    247,  -1698,  17076,   2504,   -539,
-     -646,   -176, -17798,   -382,    -17,    -25,   1770,    259,
-    -2610,    -55,    561,     82,    -67,    673,     98,    -21,
-     2375,   -797,  -2696,  14483,   5383,   -344,    -38,   -443,
-   -12803,  -1769,    115,    391,   -131,  -2100,    705,   2384,
-     -780,    262,    886,  -4759,  -2691,   2554,  -4520,   9573,
-    10655,   -442,   -398,  -1247,  -5594,  -6930,    419,   -742,
-      704,   1572,  -1492,   2641,   1750,  -1661,   2939,  -6226,
-    -4332,  -4399,  -1657,   4880,   7375,  -1145,  -1181,   -167,
-    -1453,  -3319,  -1163,   -438,   -444,   1290,   1310,    493,
-     1950,   1980,    745,  -2196,  -3498,   7405,   9955,   2693,
-    -2971,   -746,  -3347,  -6049,   -442,   -538,   1581,   2125,
-    -4499,    575,  -1217,  -1636,   -634,   1342,   1805,    488,
-     6717,  -3792,   7739,   2798,   3489,  -2754,   -877,  -3655,
-     -477,   -743,   1554,  -3173,   1791,  -1147,    647,  -1321,
-    -1430,    807,  -1648,   -595,   5263,   9770,   3463,   1069,
-    -3971,  -1690,  -5826,   -732,    -69,   -962,  -3138,  -1112,
-    -2065,   -343,   -637,   -226,   1275,   2368,    839,    259,
-     1243,  -2634,  16772,   1871,    332,    -94,   -423, -17169,
-     -213,     -6,    199,  -1273,   2696,   -142,    300,  -1915,
-      -25,     53,   -339,    -37,   2691,   2836,   3105,   5711,
-     4817,   -442,   -491,   -588,  -1991,  -1416,   -465,   -510,
-     -537,   -938,   -988,  -1082,   -791,   -834,   -913,  -1679,
-     4366,   2944,   7210,   3627,   1161,  -1163,   -529,  -3172,
-     -803,    -82,   -784,  -1921,  -1295,   -966,   -651,  -1596,
-     -309,   -208,   -511,   -257,  13888,   3951,   -671,  -2305,
-     3354, -11773,   -953,    -27,   -324,   -686,  -3349,    569,
-      161,   1954,    556,    -94,  -2843,   -809,    137,    472,
-     7053,   5847,   2929,   8378,  -4794,  -3036,  -2086,   -523,
-    -4284,  -1403,  -2517,  -1261,  -1045,  -3607,  -2990,  -1498,
-     2064,   1711,    857,   2451,  -2191,  12838,   9182,  -3915,
-     1617,   -293, -10059,  -5146,   -935,   -159,   1717,   1228,
-    -7195,   -523,   3068,   2194,    216,  -1267,   -906,    386,
-    -4881,  13114,   5767,   -435,   4155,  -1454, -10498,  -2030,
-      -11,  -1054,   3907,   1718,  -4616,   -129,    348,    153,
-     1238,  -3326,  -1462,    110,   7843,  -1250,    210,   7106,
-    -5203,  -3754,    -95,     -2,  -3082,  -1652,    598,   -100,
-       16,  -3402,    542,    -91,   2491,   -397,     66,   2257,
-    -2463,   8168,  14551,  -3908,   1828,   -370,  -4072, -12923,
-     -932,   -204,   1228,   2188,  -7254,   -587,   1948,   3471,
-      274,   -911,  -1623,    436,  -1579,    347,   -272,  -2735,
-    16031,   -152,     -7,     -4,   -456, -15686,     33,    -26,
-        5,   -263,     58,    -45,   1545,   -340,    266,   2676,
-    -6327,   1328,   5093,  -5079,   7617,  -2443,   -107,  -1583,
-    -1574,  -3541,    513,   1967,   -413,  -1961,    411,   1578,
-     2941,   -617,  -2367,   2361,   3286,  -4509,  11306,  11025,
-    -2623,   -659,  -1241,  -7802,  -7419,   -420,    904,  -2267,
-     3112,  -2211,   3034,  -7608,    526,   -722,   1810,   1765,
-     5567,  17853,  -3754,   1166,   -519,  -1892, -19455,   -860,
-      -83,    -16,  -6067,   1275,   4090,   -396,  -1271,    267,
-      176,    566,   -119,     37,  -2136,   -424,  15292,   5108,
-    -1648,   -278,    -10, -14273,  -1593,   -165,    -55,   1993,
-      396,    666,    132,  -4768,   -214,    -42,   1538,    514,
-     2267,  -3297,   2549,  16563,   -791,   -313,   -663,   -396,
-   -16745,    -38,    456,   -352,    513,  -2291,   3333,  -2576,
-      109,   -159,    123,    799,   3655,   1899,  -3364,   6279,
-    12510,   -815,   -220,   -690,  -2406,  -9552,   -423,    750,
-      390,  -1400,   -728,   1289,  -2791,  -1450,   2568,  -4794,
-     8052,   2285,  -6193,   5138,   6003,  -3957,   -318,  -2341,
-    -1611,  -2199,  -1123,   3044,    864,  -2525,   -716,   1942,
-    -2950,   -837,   2269,  -1882,   -386,  -2291,   7679,  15387,
-    -2723,     -9,   -320,  -3599, -14452,   -452,    -54,    181,
-     1074,    362,   2152,  -7212,    -64,   -380,   1276,   2557,
-     2777,  -1173,   3984,  13079,   2508,   -470,    -84,   -969,
-   -10440,   -384,    198,   -675,    285,  -2217,    936,  -3180,
-     -425,    179,   -610,  -2002,  -1879,   1771,  -2684,  16705,
-     1833,   -215,   -191,   -439, -17032,   -205,    203,   -308,
-      290,   1916,  -1805,   2736,    210,   -198,    300,  -1869,
-     1052,   4495,  15519,   1467,  -4032,    -67,  -1233, -14700,
-     -131,   -992,   -288,   -997,  -4257,    -94,   -402,  -1389,
-      259,   1106,   3819,    361,   3010,   2544,   6969,   7559,
-     1996,   -553,   -395,  -2964,  -3487,   -243,   -467,  -1280,
-    -1082,  -1388,  -1174,  -3215,   -366,   -310,   -849,   -921,
-    -5209,  -1867,   8713,  10351,   1549,  -1656,   -212,  -4634,
-    -6540,   -146,   -593,   2770,    993,   3291,   1180,  -5505,
-      492,    176,   -824,   -979,  -4314,   8513,    913,   7547,
-    -2723,  -1135,  -4423,    -50,  -3476,   -452,   2241,    240,
-     -474,   1987,  -3921,   -420,   -717,   1415,    151,   1254,
-    12929,  -1219,   2448,   1757,   6303, -10204,    -90,   -365,
-     -188,  -2425,    962,  -1932,    182,  -1386,    130,   -262,
-    -4974,    469,   -941,   -676,   6465,   4132,   3167,   3160,
-     5697,  -2551,  -1042,   -612,   -609,  -1981,  -1630,  -1249,
-     -798,  -1247,   -797,   -611,  -2248,  -1437,  -1101,  -1099,
-    -3636,   4859,  18914,  -1335,    810,   -807,  -1441, -21836,
-     -108,    -40,   1078,   4198,  -5609,   -296,    396,   1541,
-      179,   -240,   -936,     66,   8844,   7864,    654,  -4063,
-    -5680,  -4774,  -3774,    -26,  -1007,  -1969,  -4245,   -353,
-     -314,   2193,   1950,    162,   3066,   2726,    226,  -1408,
-     1859,   2634,   9228,    996,   9464,   -211,   -423,  -5197,
-      -60,  -5467,   -299,  -1047,  -1483,   -113,   -160,   -561,
-    -1074,  -1521,  -5330,   -575,   2949,  12260,  10290,   -497,
-    -3943,   -530,  -9174,  -6463,    -15,   -949,  -2206,  -1852,
-    -7700,     89,    372,    312,    709,   2950,   2476,   -119,
-    -2903,   1552,  14867,   9970,   -496,   -514,   -147, -13491,
-    -6068,    -15,    275,   2634,  -1408,   1766,   -944,  -9047,
-      -87,     47,    450,    302,   3243,   8234,   7586,   3373,
-     2151,   -642,  -4138,  -3512,   -694,   -282,  -1630,  -1501,
-    -3812,   -667,  -1695,  -1561,   -425,  -1081,   -996,   -442,
-    -9631,     60,   3501,   5359,  10150,  -5662,      0,   -748,
-    -1752,  -6288,     35,   2058,    -12,   3150,    -19,  -1145,
-     5967,    -37,  -2169,  -3320,  -6874,  -2553,  -5446,  -2195,
-    -7841,  -2884,   -397,  -1810,   -294,  -3753,  -1071,  -2285,
-     -848,   -921,   -342,   -729,  -3290,  -1221,  -2606,  -1050,
-    -3413,  -1141,   4630,  13612,   7897,   -711,    -79,  -1308,
-   -11310,  -3806,   -237,    964,    322,   2836,    948,  -3847,
-     1645,    550,  -2231,  -6561,   4410,  -5678,   8006,  -3992,
-     3811,  -1187,  -1968,  -3912,   -973,   -886,   1528,  -2155,
-     2775,   1074,  -1383,   1951,  -1025,   1321,  -1862,    928,
-     5659,  11535,   2203,   -452,   7169,  -1954,  -8121,   -296,
-      -12,  -3137,  -3984,   -761,  -1551,    156,    318,     60,
-    -2476,  -5048,   -964,    197,   2914,  -2914,   3485,  -3965,
-    13675,   -518,   -518,   -741,   -959, -11414,    518,   -620,
-      620,    705,   -705,    843,  -2433,   2432,  -2909,   3310,
-     7843,   1907,   1022,   8882,   7972,  -3755,   -222,    -63,
-    -4815,  -3879,   -913,   -489,   -119,  -4252,  -1034,   -554,
-    -3816,   -928,   -497,  -4322,  13807,   9531,   1436,   1612,
-     1779, -11636,  -5544,   -125,   -158,   -193,  -8032,  -1210,
-     -835,  -1358,   -938,   -141,  -1499,  -1035,   -156,   -175,
-    13620,  -5337,   5450,  -2263,   1723, -11322,  -1738,  -1813,
-     -312,   -181,   4436,  -4531,   1775,   1881,   -737,    752,
-    -1432,    561,   -573,    238,   5297,   8374,   8872,   7694,
-     6538,  -1712,  -4280,  -4804,  -3613,  -2609,  -2707,  -2868,
-    -4534,  -2487,  -3932,  -4166,  -2113,  -3341,  -3540,  -3070
-};
-
-/* 0.65^i (Zero part) and 0.75^i (Pole part) scaled by 2^15 */
-static const int16_t postfilter_tbl[2][LPC_ORDER] = {
-    /* Zero */
-    { 21299, 13844,  8999,  5849, 3802, 2471, 1606, 1044,  679,  441 },
-    /* Pole */
-    { 24576, 18432, 13824, 10368, 7776, 5832, 4374, 3281, 2460, 1845 }
-};
-
-static const int cng_adaptive_cb_lag[4] = { 1, 0, 1, 3 };
-
-static const int cng_filt[4] = { 273, 998, 499, 333 };
-
-static const int cng_bseg[3] = { 2048, 18432, 231233 };
-
-#endif /* AVCODEC_G723_1_DATA_H */
diff --git a/deps/libav/libavcodec/g726.c b/deps/libav/libavcodec/g726.c
deleted file mode 100644
index 62aeb79..0000000
--- a/deps/libav/libavcodec/g726.c
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * G.726 ADPCM audio codec
- * Copyright (c) 2004 Roman Shaposhnik
- *
- * This is a very straightforward rendition of the G.726
- * Section 4 "Computational Details".
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <limits.h>
-
-#include "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "put_bits.h"
-
-/**
- * G.726 11bit float.
- * G.726 Standard uses rather odd 11bit floating point arithmentic for
- * numerous occasions. It's a mystery to me why they did it this way
- * instead of simply using 32bit integer arithmetic.
- */
-typedef struct Float11 {
-    uint8_t sign;   /**< 1bit sign */
-    uint8_t exp;    /**< 4bit exponent */
-    uint8_t mant;   /**< 6bit mantissa */
-} Float11;
-
-static inline Float11* i2f(int i, Float11* f)
-{
-    f->sign = (i < 0);
-    if (f->sign)
-        i = -i;
-    f->exp = av_log2_16bit(i) + !!i;
-    f->mant = i? (i<<6) >> f->exp : 1<<5;
-    return f;
-}
-
-static inline int16_t mult(Float11* f1, Float11* f2)
-{
-        int res, exp;
-
-        exp = f1->exp + f2->exp;
-        res = (((f1->mant * f2->mant) + 0x30) >> 4);
-        res = exp > 19 ? res << (exp - 19) : res >> (19 - exp);
-        return (f1->sign ^ f2->sign) ? -res : res;
-}
-
-static inline int sgn(int value)
-{
-    return (value < 0) ? -1 : 1;
-}
-
-typedef struct G726Tables {
-    const int* quant;         /**< quantization table */
-    const int16_t* iquant;    /**< inverse quantization table */
-    const int16_t* W;         /**< special table #1 ;-) */
-    const uint8_t* F;         /**< special table #2 */
-} G726Tables;
-
-typedef struct G726Context {
-    AVClass *class;
-    G726Tables tbls;    /**< static tables needed for computation */
-
-    Float11 sr[2];      /**< prev. reconstructed samples */
-    Float11 dq[6];      /**< prev. difference */
-    int a[2];           /**< second order predictor coeffs */
-    int b[6];           /**< sixth order predictor coeffs */
-    int pk[2];          /**< signs of prev. 2 sez + dq */
-
-    int ap;             /**< scale factor control */
-    int yu;             /**< fast scale factor */
-    int yl;             /**< slow scale factor */
-    int dms;            /**< short average magnitude of F[i] */
-    int dml;            /**< long average magnitude of F[i] */
-    int td;             /**< tone detect */
-
-    int se;             /**< estimated signal for the next iteration */
-    int sez;            /**< estimated second order prediction */
-    int y;              /**< quantizer scaling factor for the next iteration */
-    int code_size;
-} G726Context;
-
-static const int quant_tbl16[] =                  /**< 16kbit/s 2bits per sample */
-           { 260, INT_MAX };
-static const int16_t iquant_tbl16[] =
-           { 116, 365, 365, 116 };
-static const int16_t W_tbl16[] =
-           { -22, 439, 439, -22 };
-static const uint8_t F_tbl16[] =
-           { 0, 7, 7, 0 };
-
-static const int quant_tbl24[] =                  /**< 24kbit/s 3bits per sample */
-           {  7, 217, 330, INT_MAX };
-static const int16_t iquant_tbl24[] =
-           { INT16_MIN, 135, 273, 373, 373, 273, 135, INT16_MIN };
-static const int16_t W_tbl24[] =
-           { -4,  30, 137, 582, 582, 137,  30, -4 };
-static const uint8_t F_tbl24[] =
-           { 0, 1, 2, 7, 7, 2, 1, 0 };
-
-static const int quant_tbl32[] =                  /**< 32kbit/s 4bits per sample */
-           { -125,  79, 177, 245, 299, 348, 399, INT_MAX };
-static const int16_t iquant_tbl32[] =
-         { INT16_MIN,   4, 135, 213, 273, 323, 373, 425,
-                 425, 373, 323, 273, 213, 135,   4, INT16_MIN };
-static const int16_t W_tbl32[] =
-           { -12,  18,  41,  64, 112, 198, 355, 1122,
-            1122, 355, 198, 112,  64,  41,  18, -12};
-static const uint8_t F_tbl32[] =
-           { 0, 0, 0, 1, 1, 1, 3, 7, 7, 3, 1, 1, 1, 0, 0, 0 };
-
-static const int quant_tbl40[] =                  /**< 40kbit/s 5bits per sample */
-           { -122, -16,  67, 138, 197, 249, 297, 338,
-              377, 412, 444, 474, 501, 527, 552, INT_MAX };
-static const int16_t iquant_tbl40[] =
-         { INT16_MIN, -66,  28, 104, 169, 224, 274, 318,
-                 358, 395, 429, 459, 488, 514, 539, 566,
-                 566, 539, 514, 488, 459, 429, 395, 358,
-                 318, 274, 224, 169, 104,  28, -66, INT16_MIN };
-static const int16_t W_tbl40[] =
-           {   14,  14,  24,  39,  40,  41,   58,  100,
-              141, 179, 219, 280, 358, 440,  529,  696,
-              696, 529, 440, 358, 280, 219,  179,  141,
-              100,  58,  41,  40,  39,  24,   14,   14 };
-static const uint8_t F_tbl40[] =
-           { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 6,
-             6, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
-
-static const G726Tables G726Tables_pool[] =
-           {{ quant_tbl16, iquant_tbl16, W_tbl16, F_tbl16 },
-            { quant_tbl24, iquant_tbl24, W_tbl24, F_tbl24 },
-            { quant_tbl32, iquant_tbl32, W_tbl32, F_tbl32 },
-            { quant_tbl40, iquant_tbl40, W_tbl40, F_tbl40 }};
-
-
-/**
- * Para 4.2.2 page 18: Adaptive quantizer.
- */
-static inline uint8_t quant(G726Context* c, int d)
-{
-    int sign, exp, i, dln;
-
-    sign = i = 0;
-    if (d < 0) {
-        sign = 1;
-        d = -d;
-    }
-    exp = av_log2_16bit(d);
-    dln = ((exp<<7) + (((d<<7)>>exp)&0x7f)) - (c->y>>2);
-
-    while (c->tbls.quant[i] < INT_MAX && c->tbls.quant[i] < dln)
-        ++i;
-
-    if (sign)
-        i = ~i;
-    if (c->code_size != 2 && i == 0) /* I'm not sure this is a good idea */
-        i = 0xff;
-
-    return i;
-}
-
-/**
- * Para 4.2.3 page 22: Inverse adaptive quantizer.
- */
-static inline int16_t inverse_quant(G726Context* c, int i)
-{
-    int dql, dex, dqt;
-
-    dql = c->tbls.iquant[i] + (c->y >> 2);
-    dex = (dql>>7) & 0xf;        /* 4bit exponent */
-    dqt = (1<<7) + (dql & 0x7f); /* log2 -> linear */
-    return (dql < 0) ? 0 : ((dqt<<dex) >> 7);
-}
-
-static int16_t g726_decode(G726Context* c, int I)
-{
-    int dq, re_signal, pk0, fa1, i, tr, ylint, ylfrac, thr2, al, dq0;
-    Float11 f;
-    int I_sig= I >> (c->code_size - 1);
-
-    dq = inverse_quant(c, I);
-
-    /* Transition detect */
-    ylint = (c->yl >> 15);
-    ylfrac = (c->yl >> 10) & 0x1f;
-    thr2 = (ylint > 9) ? 0x1f << 10 : (0x20 + ylfrac) << ylint;
-    tr= (c->td == 1 && dq > ((3*thr2)>>2));
-
-    if (I_sig)  /* get the sign */
-        dq = -dq;
-    re_signal = c->se + dq;
-
-    /* Update second order predictor coefficient A2 and A1 */
-    pk0 = (c->sez + dq) ? sgn(c->sez + dq) : 0;
-    dq0 = dq ? sgn(dq) : 0;
-    if (tr) {
-        c->a[0] = 0;
-        c->a[1] = 0;
-        for (i=0; i<6; i++)
-            c->b[i] = 0;
-    } else {
-        /* This is a bit crazy, but it really is +255 not +256 */
-        fa1 = av_clip((-c->a[0]*c->pk[0]*pk0)>>5, -256, 255);
-
-        c->a[1] += 128*pk0*c->pk[1] + fa1 - (c->a[1]>>7);
-        c->a[1] = av_clip(c->a[1], -12288, 12288);
-        c->a[0] += 64*3*pk0*c->pk[0] - (c->a[0] >> 8);
-        c->a[0] = av_clip(c->a[0], -(15360 - c->a[1]), 15360 - c->a[1]);
-
-        for (i=0; i<6; i++)
-            c->b[i] += 128*dq0*sgn(-c->dq[i].sign) - (c->b[i]>>8);
-    }
-
-    /* Update Dq and Sr and Pk */
-    c->pk[1] = c->pk[0];
-    c->pk[0] = pk0 ? pk0 : 1;
-    c->sr[1] = c->sr[0];
-    i2f(re_signal, &c->sr[0]);
-    for (i=5; i>0; i--)
-        c->dq[i] = c->dq[i-1];
-    i2f(dq, &c->dq[0]);
-    c->dq[0].sign = I_sig; /* Isn't it crazy ?!?! */
-
-    c->td = c->a[1] < -11776;
-
-    /* Update Ap */
-    c->dms += (c->tbls.F[I]<<4) + ((- c->dms) >> 5);
-    c->dml += (c->tbls.F[I]<<4) + ((- c->dml) >> 7);
-    if (tr)
-        c->ap = 256;
-    else {
-        c->ap += (-c->ap) >> 4;
-        if (c->y <= 1535 || c->td || abs((c->dms << 2) - c->dml) >= (c->dml >> 3))
-            c->ap += 0x20;
-    }
-
-    /* Update Yu and Yl */
-    c->yu = av_clip(c->y + c->tbls.W[I] + ((-c->y)>>5), 544, 5120);
-    c->yl += c->yu + ((-c->yl)>>6);
-
-    /* Next iteration for Y */
-    al = (c->ap >= 256) ? 1<<6 : c->ap >> 2;
-    c->y = (c->yl + (c->yu - (c->yl>>6))*al) >> 6;
-
-    /* Next iteration for SE and SEZ */
-    c->se = 0;
-    for (i=0; i<6; i++)
-        c->se += mult(i2f(c->b[i] >> 2, &f), &c->dq[i]);
-    c->sez = c->se >> 1;
-    for (i=0; i<2; i++)
-        c->se += mult(i2f(c->a[i] >> 2, &f), &c->sr[i]);
-    c->se >>= 1;
-
-    return av_clip(re_signal << 2, -0xffff, 0xffff);
-}
-
-static av_cold int g726_reset(G726Context *c)
-{
-    int i;
-
-    c->tbls = G726Tables_pool[c->code_size - 2];
-    for (i=0; i<2; i++) {
-        c->sr[i].mant = 1<<5;
-        c->pk[i] = 1;
-    }
-    for (i=0; i<6; i++) {
-        c->dq[i].mant = 1<<5;
-    }
-    c->yu = 544;
-    c->yl = 34816;
-
-    c->y = 544;
-
-    return 0;
-}
-
-#if CONFIG_ADPCM_G726_ENCODER
-static int16_t g726_encode(G726Context* c, int16_t sig)
-{
-    uint8_t i;
-
-    i = quant(c, sig/4 - c->se) & ((1<<c->code_size) - 1);
-    g726_decode(c, i);
-    return i;
-}
-
-/* Interfacing to the libavcodec */
-
-static av_cold int g726_encode_init(AVCodecContext *avctx)
-{
-    G726Context* c = avctx->priv_data;
-
-    if (avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL &&
-        avctx->sample_rate != 8000) {
-        av_log(avctx, AV_LOG_ERROR, "Sample rates other than 8kHz are not "
-               "allowed when the compliance level is higher than unofficial. "
-               "Resample or reduce the compliance level.\n");
-        return AVERROR(EINVAL);
-    }
-    av_assert0(avctx->sample_rate > 0);
-
-    if(avctx->channels != 1){
-        av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (avctx->bit_rate)
-        c->code_size = (avctx->bit_rate + avctx->sample_rate/2) / avctx->sample_rate;
-
-    c->code_size = av_clip(c->code_size, 2, 5);
-    avctx->bit_rate = c->code_size * avctx->sample_rate;
-    avctx->bits_per_coded_sample = c->code_size;
-
-    g726_reset(c);
-
-    /* select a frame size that will end on a byte boundary and have a size of
-       approximately 1024 bytes */
-    avctx->frame_size = ((int[]){ 4096, 2736, 2048, 1640 })[c->code_size - 2];
-
-    return 0;
-}
-
-static int g726_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                             const AVFrame *frame, int *got_packet_ptr)
-{
-    G726Context *c = avctx->priv_data;
-    const int16_t *samples = (const int16_t *)frame->data[0];
-    PutBitContext pb;
-    int i, ret, out_size;
-
-    out_size = (frame->nb_samples * c->code_size + 7) / 8;
-    if ((ret = ff_alloc_packet(avpkt, out_size))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-    init_put_bits(&pb, avpkt->data, avpkt->size);
-
-    for (i = 0; i < frame->nb_samples; i++)
-        put_bits(&pb, c->code_size, g726_encode(c, *samples++));
-
-    flush_put_bits(&pb);
-
-    avpkt->size = out_size;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-#define OFFSET(x) offsetof(G726Context, x)
-#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "code_size", "Bits per code", OFFSET(code_size), AV_OPT_TYPE_INT, { .i64 = 4 }, 2, 5, AE },
-    { NULL },
-};
-
-static const AVClass class = {
-    .class_name = "g726",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVCodecDefault defaults[] = {
-    { "b", "0" },
-    { NULL },
-};
-
-AVCodec ff_adpcm_g726_encoder = {
-    .name           = "g726",
-    .long_name      = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ADPCM_G726,
-    .priv_data_size = sizeof(G726Context),
-    .init           = g726_encode_init,
-    .encode2        = g726_encode_frame,
-    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-    .priv_class     = &class,
-    .defaults       = defaults,
-};
-#endif
-
-#if CONFIG_ADPCM_G726_DECODER
-static av_cold int g726_decode_init(AVCodecContext *avctx)
-{
-    G726Context* c = avctx->priv_data;
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-
-    c->code_size = avctx->bits_per_coded_sample;
-    if (c->code_size < 2 || c->code_size > 5) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid number of bits %d\n", c->code_size);
-        return AVERROR(EINVAL);
-    }
-    g726_reset(c);
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-
-    return 0;
-}
-
-static int g726_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    G726Context *c = avctx->priv_data;
-    int16_t *samples;
-    GetBitContext gb;
-    int out_samples, ret;
-
-    out_samples = buf_size * 8 / c->code_size;
-
-    /* get output buffer */
-    frame->nb_samples = out_samples;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (int16_t *)frame->data[0];
-
-    init_get_bits(&gb, buf, buf_size * 8);
-
-    while (out_samples--)
-        *samples++ = g726_decode(c, get_bits(&gb, c->code_size));
-
-    if (get_bits_left(&gb) > 0)
-        av_log(avctx, AV_LOG_ERROR, "Frame invalidly split, missing parser?\n");
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-
-static void g726_decode_flush(AVCodecContext *avctx)
-{
-    G726Context *c = avctx->priv_data;
-    g726_reset(c);
-}
-
-AVCodec ff_adpcm_g726_decoder = {
-    .name           = "g726",
-    .long_name      = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ADPCM_G726,
-    .priv_data_size = sizeof(G726Context),
-    .init           = g726_decode_init,
-    .decode         = g726_decode_frame,
-    .flush          = g726_decode_flush,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
diff --git a/deps/libav/libavcodec/get_bits.h b/deps/libav/libavcodec/get_bits.h
deleted file mode 100644
index 5a0089a..0000000
--- a/deps/libav/libavcodec/get_bits.h
+++ /dev/null
@@ -1,629 +0,0 @@
-/*
- * copyright (c) 2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * bitstream reader API header.
- */
-
-#ifndef AVCODEC_GET_BITS_H
-#define AVCODEC_GET_BITS_H
-
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/log.h"
-#include "mathops.h"
-
-/*
- * Safe bitstream reading:
- * optionally, the get_bits API can check to ensure that we
- * don't read past input buffer boundaries. This is protected
- * with CONFIG_SAFE_BITSTREAM_READER at the global level, and
- * then below that with UNCHECKED_BITSTREAM_READER at the per-
- * decoder level. This means that decoders that check internally
- * can "#define UNCHECKED_BITSTREAM_READER 1" to disable
- * overread checks.
- * Boundary checking causes a minor performance penalty so for
- * applications that won't want/need this, it can be disabled
- * globally using "#define CONFIG_SAFE_BITSTREAM_READER 0".
- */
-#ifndef UNCHECKED_BITSTREAM_READER
-#define UNCHECKED_BITSTREAM_READER !CONFIG_SAFE_BITSTREAM_READER
-#endif
-
-typedef struct GetBitContext {
-    const uint8_t *buffer, *buffer_end;
-    int index;
-    int size_in_bits;
-#if !UNCHECKED_BITSTREAM_READER
-    int size_in_bits_plus8;
-#endif
-} GetBitContext;
-
-#define VLC_TYPE int16_t
-
-typedef struct VLC {
-    int bits;
-    VLC_TYPE (*table)[2]; ///< code, bits
-    int table_size, table_allocated;
-} VLC;
-
-typedef struct RL_VLC_ELEM {
-    int16_t level;
-    int8_t len;
-    uint8_t run;
-} RL_VLC_ELEM;
-
-/* Bitstream reader API docs:
- * name
- *   arbitrary name which is used as prefix for the internal variables
- *
- * gb
- *   getbitcontext
- *
- * OPEN_READER(name, gb)
- *   load gb into local variables
- *
- * CLOSE_READER(name, gb)
- *   store local vars in gb
- *
- * UPDATE_CACHE(name, gb)
- *   Refill the internal cache from the bitstream.
- *   After this call at least MIN_CACHE_BITS will be available.
- *
- * GET_CACHE(name, gb)
- *   Will output the contents of the internal cache,
- *   next bit is MSB of 32 or 64 bit (FIXME 64bit).
- *
- * SHOW_UBITS(name, gb, num)
- *   Will return the next num bits.
- *
- * SHOW_SBITS(name, gb, num)
- *   Will return the next num bits and do sign extension.
- *
- * SKIP_BITS(name, gb, num)
- *   Will skip over the next num bits.
- *   Note, this is equivalent to SKIP_CACHE; SKIP_COUNTER.
- *
- * SKIP_CACHE(name, gb, num)
- *   Will remove the next num bits from the cache (note SKIP_COUNTER
- *   MUST be called before UPDATE_CACHE / CLOSE_READER).
- *
- * SKIP_COUNTER(name, gb, num)
- *   Will increment the internal bit counter (see SKIP_CACHE & SKIP_BITS).
- *
- * LAST_SKIP_BITS(name, gb, num)
- *   Like SKIP_BITS, to be used if next call is UPDATE_CACHE or CLOSE_READER.
- *
- * For examples see get_bits, show_bits, skip_bits, get_vlc.
- */
-
-#ifdef LONG_BITSTREAM_READER
-#   define MIN_CACHE_BITS 32
-#else
-#   define MIN_CACHE_BITS 25
-#endif
-
-#if UNCHECKED_BITSTREAM_READER
-#define OPEN_READER(name, gb)                   \
-    unsigned int name ## _index = (gb)->index;  \
-    unsigned int av_unused name ## _cache = 0
-
-#define HAVE_BITS_REMAINING(name, gb) 1
-#else
-#define OPEN_READER(name, gb)                   \
-    unsigned int name ## _index = (gb)->index;  \
-    unsigned int av_unused name ## _cache = 0;  \
-    unsigned int av_unused name ## _size_plus8 = (gb)->size_in_bits_plus8
-
-#define HAVE_BITS_REMAINING(name, gb) name ## _index < name ## _size_plus8
-#endif
-
-#define CLOSE_READER(name, gb) (gb)->index = name ## _index
-
-#ifdef BITSTREAM_READER_LE
-
-# ifdef LONG_BITSTREAM_READER
-#   define UPDATE_CACHE(name, gb) name ## _cache = \
-        AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
-# else
-#   define UPDATE_CACHE(name, gb) name ## _cache = \
-        AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
-# endif
-
-# define SKIP_CACHE(name, gb, num) name ## _cache >>= (num)
-
-#else
-
-# ifdef LONG_BITSTREAM_READER
-#   define UPDATE_CACHE(name, gb) name ## _cache = \
-        AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7))
-# else
-#   define UPDATE_CACHE(name, gb) name ## _cache = \
-        AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7)
-# endif
-
-# define SKIP_CACHE(name, gb, num) name ## _cache <<= (num)
-
-#endif
-
-#if UNCHECKED_BITSTREAM_READER
-#   define SKIP_COUNTER(name, gb, num) name ## _index += (num)
-#else
-#   define SKIP_COUNTER(name, gb, num) \
-    name ## _index = FFMIN(name ## _size_plus8, name ## _index + (num))
-#endif
-
-#define SKIP_BITS(name, gb, num)                \
-    do {                                        \
-        SKIP_CACHE(name, gb, num);              \
-        SKIP_COUNTER(name, gb, num);            \
-    } while (0)
-
-#define LAST_SKIP_BITS(name, gb, num) SKIP_COUNTER(name, gb, num)
-
-#ifdef BITSTREAM_READER_LE
-#   define SHOW_UBITS(name, gb, num) zero_extend(name ## _cache, num)
-#   define SHOW_SBITS(name, gb, num) sign_extend(name ## _cache, num)
-#else
-#   define SHOW_UBITS(name, gb, num) NEG_USR32(name ## _cache, num)
-#   define SHOW_SBITS(name, gb, num) NEG_SSR32(name ## _cache, num)
-#endif
-
-#define GET_CACHE(name, gb) ((uint32_t) name ## _cache)
-
-static inline int get_bits_count(const GetBitContext *s)
-{
-    return s->index;
-}
-
-static inline void skip_bits_long(GetBitContext *s, int n)
-{
-#if UNCHECKED_BITSTREAM_READER
-    s->index += n;
-#else
-    s->index += av_clip(n, -s->index, s->size_in_bits_plus8 - s->index);
-#endif
-}
-
-/**
- * read mpeg1 dc style vlc (sign bit + mantisse with no MSB).
- * if MSB not set it is negative
- * @param n length in bits
- */
-static inline int get_xbits(GetBitContext *s, int n)
-{
-    register int sign;
-    register int32_t cache;
-    OPEN_READER(re, s);
-    UPDATE_CACHE(re, s);
-    cache = GET_CACHE(re, s);
-    sign  = ~cache >> 31;
-    LAST_SKIP_BITS(re, s, n);
-    CLOSE_READER(re, s);
-    return (NEG_USR32(sign ^ cache, n) ^ sign) - sign;
-}
-
-static inline int get_sbits(GetBitContext *s, int n)
-{
-    register int tmp;
-    OPEN_READER(re, s);
-    UPDATE_CACHE(re, s);
-    tmp = SHOW_SBITS(re, s, n);
-    LAST_SKIP_BITS(re, s, n);
-    CLOSE_READER(re, s);
-    return tmp;
-}
-
-/**
- * Read 1-25 bits.
- */
-static inline unsigned int get_bits(GetBitContext *s, int n)
-{
-    register int tmp;
-    OPEN_READER(re, s);
-    UPDATE_CACHE(re, s);
-    tmp = SHOW_UBITS(re, s, n);
-    LAST_SKIP_BITS(re, s, n);
-    CLOSE_READER(re, s);
-    return tmp;
-}
-
-/**
- * Show 1-25 bits.
- */
-static inline unsigned int show_bits(GetBitContext *s, int n)
-{
-    register int tmp;
-    OPEN_READER(re, s);
-    UPDATE_CACHE(re, s);
-    tmp = SHOW_UBITS(re, s, n);
-    return tmp;
-}
-
-static inline void skip_bits(GetBitContext *s, int n)
-{
-    OPEN_READER(re, s);
-    UPDATE_CACHE(re, s);
-    LAST_SKIP_BITS(re, s, n);
-    CLOSE_READER(re, s);
-}
-
-static inline unsigned int get_bits1(GetBitContext *s)
-{
-    unsigned int index = s->index;
-    uint8_t result     = s->buffer[index >> 3];
-#ifdef BITSTREAM_READER_LE
-    result >>= index & 7;
-    result  &= 1;
-#else
-    result <<= index & 7;
-    result >>= 8 - 1;
-#endif
-#if !UNCHECKED_BITSTREAM_READER
-    if (s->index < s->size_in_bits_plus8)
-#endif
-        index++;
-    s->index = index;
-
-    return result;
-}
-
-static inline unsigned int show_bits1(GetBitContext *s)
-{
-    return show_bits(s, 1);
-}
-
-static inline void skip_bits1(GetBitContext *s)
-{
-    skip_bits(s, 1);
-}
-
-/**
- * Read 0-32 bits.
- */
-static inline unsigned int get_bits_long(GetBitContext *s, int n)
-{
-    if (n <= MIN_CACHE_BITS) {
-        return get_bits(s, n);
-    } else {
-#ifdef BITSTREAM_READER_LE
-        int ret = get_bits(s, 16);
-        return ret | (get_bits(s, n - 16) << 16);
-#else
-        int ret = get_bits(s, 16) << (n - 16);
-        return ret | get_bits(s, n - 16);
-#endif
-    }
-}
-
-/*
- * Read 0-64 bits.
- */
-static inline uint64_t get_bits64(GetBitContext *s, int n)
-{
-    if (n <= 32) {
-        return get_bits_long(s, n);
-    } else {
-#ifdef BITSTREAM_READER_LE
-        uint64_t ret = get_bits_long(s, 32);
-        return ret | (uint64_t) get_bits_long(s, n - 32) << 32;
-#else
-        uint64_t ret = (uint64_t) get_bits_long(s, n - 32) << 32;
-        return ret | get_bits_long(s, 32);
-#endif
-    }
-}
-
-/**
- * Read 0-32 bits as a signed integer.
- */
-static inline int get_sbits_long(GetBitContext *s, int n)
-{
-    return sign_extend(get_bits_long(s, n), n);
-}
-
-/**
- * Show 0-32 bits.
- */
-static inline unsigned int show_bits_long(GetBitContext *s, int n)
-{
-    if (n <= MIN_CACHE_BITS) {
-        return show_bits(s, n);
-    } else {
-        GetBitContext gb = *s;
-        return get_bits_long(&gb, n);
-    }
-}
-
-static inline int check_marker(GetBitContext *s, const char *msg)
-{
-    int bit = get_bits1(s);
-    if (!bit)
-        av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg);
-
-    return bit;
-}
-
-/**
- * Initialize GetBitContext.
- * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
- *        larger than the actual read bits because some optimized bitstream
- *        readers read 32 or 64 bit at once and could read over the end
- * @param bit_size the size of the buffer in bits
- * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
- */
-static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
-                                int bit_size)
-{
-    int buffer_size;
-    int ret = 0;
-
-    if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
-        buffer_size = bit_size = 0;
-        buffer      = NULL;
-        ret         = AVERROR_INVALIDDATA;
-    }
-
-    buffer_size = (bit_size + 7) >> 3;
-
-    s->buffer             = buffer;
-    s->size_in_bits       = bit_size;
-#if !UNCHECKED_BITSTREAM_READER
-    s->size_in_bits_plus8 = bit_size + 8;
-#endif
-    s->buffer_end         = buffer + buffer_size;
-    s->index              = 0;
-
-    return ret;
-}
-
-/**
- * Initialize GetBitContext.
- * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
- *        larger than the actual read bits because some optimized bitstream
- *        readers read 32 or 64 bit at once and could read over the end
- * @param byte_size the size of the buffer in bytes
- * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
- */
-static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
-                                 int byte_size)
-{
-    if (byte_size > INT_MAX / 8)
-        return AVERROR_INVALIDDATA;
-    return init_get_bits(s, buffer, byte_size * 8);
-}
-
-static inline const uint8_t *align_get_bits(GetBitContext *s)
-{
-    int n = -get_bits_count(s) & 7;
-    if (n)
-        skip_bits(s, n);
-    return s->buffer + (s->index >> 3);
-}
-
-#define init_vlc(vlc, nb_bits, nb_codes,                \
-                 bits, bits_wrap, bits_size,            \
-                 codes, codes_wrap, codes_size,         \
-                 flags)                                 \
-    ff_init_vlc_sparse(vlc, nb_bits, nb_codes,          \
-                       bits, bits_wrap, bits_size,      \
-                       codes, codes_wrap, codes_size,   \
-                       NULL, 0, 0, flags)
-
-int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
-                       const void *bits, int bits_wrap, int bits_size,
-                       const void *codes, int codes_wrap, int codes_size,
-                       const void *symbols, int symbols_wrap, int symbols_size,
-                       int flags);
-void ff_free_vlc(VLC *vlc);
-
-#define INIT_VLC_LE             2
-#define INIT_VLC_USE_NEW_STATIC 4
-
-#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)       \
-    do {                                                                   \
-        static VLC_TYPE table[static_size][2];                             \
-        (vlc)->table           = table;                                    \
-        (vlc)->table_allocated = static_size;                              \
-        init_vlc(vlc, bits, a, b, c, d, e, f, g, INIT_VLC_USE_NEW_STATIC); \
-    } while (0)
-
-/**
- * If the vlc code is invalid and max_depth=1, then no bits will be removed.
- * If the vlc code is invalid and max_depth>1, then the number of bits removed
- * is undefined.
- */
-#define GET_VLC(code, name, gb, table, bits, max_depth)         \
-    do {                                                        \
-        int n, nb_bits;                                         \
-        unsigned int index;                                     \
-                                                                \
-        index = SHOW_UBITS(name, gb, bits);                     \
-        code  = table[index][0];                                \
-        n     = table[index][1];                                \
-                                                                \
-        if (max_depth > 1 && n < 0) {                           \
-            LAST_SKIP_BITS(name, gb, bits);                     \
-            UPDATE_CACHE(name, gb);                             \
-                                                                \
-            nb_bits = -n;                                       \
-                                                                \
-            index = SHOW_UBITS(name, gb, nb_bits) + code;       \
-            code  = table[index][0];                            \
-            n     = table[index][1];                            \
-            if (max_depth > 2 && n < 0) {                       \
-                LAST_SKIP_BITS(name, gb, nb_bits);              \
-                UPDATE_CACHE(name, gb);                         \
-                                                                \
-                nb_bits = -n;                                   \
-                                                                \
-                index = SHOW_UBITS(name, gb, nb_bits) + code;   \
-                code  = table[index][0];                        \
-                n     = table[index][1];                        \
-            }                                                   \
-        }                                                       \
-        SKIP_BITS(name, gb, n);                                 \
-    } while (0)
-
-#define GET_RL_VLC(level, run, name, gb, table, bits,           \
-                   max_depth, need_update)                      \
-    do {                                                        \
-        int n, nb_bits;                                         \
-        unsigned int index;                                     \
-                                                                \
-        index = SHOW_UBITS(name, gb, bits);                     \
-        level = table[index].level;                             \
-        n     = table[index].len;                               \
-                                                                \
-        if (max_depth > 1 && n < 0) {                           \
-            SKIP_BITS(name, gb, bits);                          \
-            if (need_update) {                                  \
-                UPDATE_CACHE(name, gb);                         \
-            }                                                   \
-                                                                \
-            nb_bits = -n;                                       \
-                                                                \
-            index = SHOW_UBITS(name, gb, nb_bits) + level;      \
-            level = table[index].level;                         \
-            n     = table[index].len;                           \
-        }                                                       \
-        run = table[index].run;                                 \
-        SKIP_BITS(name, gb, n);                                 \
-    } while (0)
-
-/**
- * Parse a vlc code.
- * @param bits is the number of bits which will be read at once, must be
- *             identical to nb_bits in init_vlc()
- * @param max_depth is the number of times bits bits must be read to completely
- *                  read the longest vlc code
- *                  = (max_vlc_length + bits - 1) / bits
- */
-static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
-                                     int bits, int max_depth)
-{
-    int code;
-
-    OPEN_READER(re, s);
-    UPDATE_CACHE(re, s);
-
-    GET_VLC(code, re, s, table, bits, max_depth);
-
-    CLOSE_READER(re, s);
-
-    return code;
-}
-
-static inline int decode012(GetBitContext *gb)
-{
-    int n;
-    n = get_bits1(gb);
-    if (n == 0)
-        return 0;
-    else
-        return get_bits1(gb) + 1;
-}
-
-static inline int decode210(GetBitContext *gb)
-{
-    if (get_bits1(gb))
-        return 0;
-    else
-        return 2 - get_bits1(gb);
-}
-
-static inline int get_bits_left(GetBitContext *gb)
-{
-    return gb->size_in_bits - get_bits_count(gb);
-}
-
-//#define TRACE
-
-#ifdef TRACE
-static inline void print_bin(int bits, int n)
-{
-    int i;
-
-    for (i = n - 1; i >= 0; i--)
-        av_log(NULL, AV_LOG_DEBUG, "%d", (bits >> i) & 1);
-    for (i = n; i < 24; i++)
-        av_log(NULL, AV_LOG_DEBUG, " ");
-}
-
-static inline int get_bits_trace(GetBitContext *s, int n, const char *file,
-                                 const char *func, int line)
-{
-    int r = get_bits(s, n);
-
-    print_bin(r, n);
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d bit @%5d in %s %s:%d\n",
-           r, n, r, get_bits_count(s) - n, file, func, line);
-
-    return r;
-}
-
-static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2],
-                                int bits, int max_depth, const char *file,
-                                const char *func, int line)
-{
-    int show  = show_bits(s, 24);
-    int pos   = get_bits_count(s);
-    int r     = get_vlc2(s, table, bits, max_depth);
-    int len   = get_bits_count(s) - pos;
-    int bits2 = show >> (24 - len);
-
-    print_bin(bits2, len);
-
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d vlc @%5d in %s %s:%d\n",
-           bits2, len, r, pos, file, func, line);
-
-    return r;
-}
-
-static inline int get_xbits_trace(GetBitContext *s, int n, const char *file,
-                                  const char *func, int line)
-{
-    int show = show_bits(s, n);
-    int r    = get_xbits(s, n);
-
-    print_bin(show, n);
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d xbt @%5d in %s %s:%d\n",
-           show, n, r, get_bits_count(s) - n, file, func, line);
-
-    return r;
-}
-
-#define get_bits(s, n)  get_bits_trace(s , n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_bits1(s)    get_bits_trace(s,  1, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_xbits(s, n) get_xbits_trace(s, n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-
-#define get_vlc(s, vlc)             get_vlc_trace(s, (vlc)->table, (vlc)->bits,   3, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_vlc2(s, tab, bits, max) get_vlc_trace(s,          tab,        bits, max, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-
-#define tprintf(p, ...) av_log(p, AV_LOG_DEBUG, __VA_ARGS__)
-
-#else //TRACE
-#define tprintf(p, ...) { }
-#endif
-
-#endif /* AVCODEC_GET_BITS_H */
diff --git a/deps/libav/libavcodec/gif.c b/deps/libav/libavcodec/gif.c
deleted file mode 100644
index c6c37b6..0000000
--- a/deps/libav/libavcodec/gif.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * GIF encoder.
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2002 Francois Revol
- * Copyright (c) 2006 Baptiste Coudurier
- *
- * first version by Francois Revol <revol at free.fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Features and limitations:
- * - currently no compression is performed,
- *   in fact the size of the data is 9/8 the size of the image in 8bpp
- * - uses only a global standard palette
- * - tested with IE 5.0, Opera for BeOS, NetPositive (BeOS), and Mozilla (BeOS).
- *
- * Reference documents:
- * http://www.goice.co.jp/member/mo/formats/gif.html
- * http://astronomy.swin.edu.au/pbourke/dataformats/gif/
- * http://www.dcs.ed.ac.uk/home/mxr/gfx/2d/GIF89a.txt
- *
- * this url claims to have an LZW algorithm not covered by Unisys patent:
- * http://www.msg.net/utility/whirlgif/gifencod.html
- * could help reduce the size of the files _a lot_...
- * some sites mentions an RLE type compression also.
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "lzw.h"
-
-/* The GIF format uses reversed order for bitstreams... */
-/* at least they don't use PDP_ENDIAN :) */
-#define BITSTREAM_WRITER_LE
-
-#include "put_bits.h"
-
-typedef struct {
-    LZWState *lzw;
-    uint8_t *buf;
-} GIFContext;
-
-/* GIF header */
-static int gif_image_write_header(AVCodecContext *avctx,
-                                  uint8_t **bytestream, uint32_t *palette)
-{
-    int i;
-    unsigned int v;
-
-    bytestream_put_buffer(bytestream, "GIF", 3);
-    bytestream_put_buffer(bytestream, "89a", 3);
-    bytestream_put_le16(bytestream, avctx->width);
-    bytestream_put_le16(bytestream, avctx->height);
-
-    bytestream_put_byte(bytestream, 0xf7); /* flags: global clut, 256 entries */
-    bytestream_put_byte(bytestream, 0x1f); /* background color index */
-    bytestream_put_byte(bytestream, 0); /* aspect ratio */
-
-    /* the global palette */
-    for(i=0;i<256;i++) {
-        v = palette[i];
-        bytestream_put_be24(bytestream, v);
-    }
-
-    return 0;
-}
-
-static int gif_image_write_image(AVCodecContext *avctx,
-                                 uint8_t **bytestream, uint8_t *end,
-                                 const uint8_t *buf, int linesize)
-{
-    GIFContext *s = avctx->priv_data;
-    int len = 0, height;
-    const uint8_t *ptr;
-    /* image block */
-
-    bytestream_put_byte(bytestream, 0x2c);
-    bytestream_put_le16(bytestream, 0);
-    bytestream_put_le16(bytestream, 0);
-    bytestream_put_le16(bytestream, avctx->width);
-    bytestream_put_le16(bytestream, avctx->height);
-    bytestream_put_byte(bytestream, 0x00); /* flags */
-    /* no local clut */
-
-    bytestream_put_byte(bytestream, 0x08);
-
-    ff_lzw_encode_init(s->lzw, s->buf, avctx->width*avctx->height,
-                       12, FF_LZW_GIF, put_bits);
-
-    ptr = buf;
-    for (height = avctx->height; height--;) {
-        len += ff_lzw_encode(s->lzw, ptr, avctx->width);
-        ptr += linesize;
-    }
-    len += ff_lzw_encode_flush(s->lzw, flush_put_bits);
-
-    ptr = s->buf;
-    while (len > 0) {
-        int size = FFMIN(255, len);
-        bytestream_put_byte(bytestream, size);
-        if (end - *bytestream < size)
-            return -1;
-        bytestream_put_buffer(bytestream, ptr, size);
-        ptr += size;
-        len -= size;
-    }
-    bytestream_put_byte(bytestream, 0x00); /* end of image block */
-    bytestream_put_byte(bytestream, 0x3b);
-    return 0;
-}
-
-static av_cold int gif_encode_init(AVCodecContext *avctx)
-{
-    GIFContext *s = avctx->priv_data;
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    s->lzw = av_mallocz(ff_lzw_encode_state_size);
-    if (!s->lzw)
-        return AVERROR(ENOMEM);
-    s->buf = av_malloc(avctx->width*avctx->height*2);
-    if (!s->buf)
-         return AVERROR(ENOMEM);
-    return 0;
-}
-
-/* better than nothing gif encoder */
-static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                            const AVFrame *pict, int *got_packet)
-{
-    uint8_t *outbuf_ptr, *end;
-    int ret;
-
-    if ((ret = ff_alloc_packet(pkt, avctx->width*avctx->height*7/5 + FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-    outbuf_ptr = pkt->data;
-    end        = pkt->data + pkt->size;
-
-    gif_image_write_header(avctx, &outbuf_ptr, (uint32_t *)pict->data[1]);
-    gif_image_write_image(avctx, &outbuf_ptr, end, pict->data[0], pict->linesize[0]);
-
-    pkt->size   = outbuf_ptr - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static int gif_encode_close(AVCodecContext *avctx)
-{
-    GIFContext *s = avctx->priv_data;
-
-    av_frame_free(&avctx->coded_frame);
-
-    av_freep(&s->lzw);
-    av_freep(&s->buf);
-    return 0;
-}
-
-AVCodec ff_gif_encoder = {
-    .name           = "gif",
-    .long_name      = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_GIF,
-    .priv_data_size = sizeof(GIFContext),
-    .init           = gif_encode_init,
-    .encode2        = gif_encode_frame,
-    .close          = gif_encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE,
-        AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/gifdec.c b/deps/libav/libavcodec/gifdec.c
deleted file mode 100644
index cdb7f23..0000000
--- a/deps/libav/libavcodec/gifdec.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * GIF decoder
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2006 Baptiste Coudurier
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "lzw.h"
-
-#define GCE_DISPOSAL_NONE       0
-#define GCE_DISPOSAL_INPLACE    1
-#define GCE_DISPOSAL_BACKGROUND 2
-#define GCE_DISPOSAL_RESTORE    3
-
-typedef struct GifState {
-    int screen_width;
-    int screen_height;
-    int bits_per_pixel;
-    int background_color_index;
-    int transparent_color_index;
-    int color_resolution;
-    uint32_t *image_palette;
-
-    /* after the frame is displayed, the disposal method is used */
-    int gce_disposal;
-    /* delay during which the frame is shown */
-    int gce_delay;
-
-    /* LZW compatible decoder */
-    GetByteContext gb;
-    LZWState *lzw;
-
-    /* aux buffers */
-    uint8_t global_palette[256 * 3];
-    uint8_t local_palette[256 * 3];
-
-  AVCodecContext* avctx;
-} GifState;
-
-static const uint8_t gif87a_sig[6] = "GIF87a";
-static const uint8_t gif89a_sig[6] = "GIF89a";
-
-static int gif_read_image(GifState *s, AVFrame *frame)
-{
-    int left, top, width, height, bits_per_pixel, code_size, flags;
-    int is_interleaved, has_local_palette, y, pass, y1, linesize, n, i;
-    uint8_t *ptr, *spal, *palette, *ptr1;
-
-    left   = bytestream2_get_le16(&s->gb);
-    top    = bytestream2_get_le16(&s->gb);
-    width  = bytestream2_get_le16(&s->gb);
-    height = bytestream2_get_le16(&s->gb);
-    flags  = bytestream2_get_byte(&s->gb);
-    is_interleaved = flags & 0x40;
-    has_local_palette = flags & 0x80;
-    bits_per_pixel = (flags & 0x07) + 1;
-
-    av_dlog(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
-
-    if (has_local_palette) {
-        bytestream2_get_buffer(&s->gb, s->local_palette, 3 * (1 << bits_per_pixel));
-        palette = s->local_palette;
-    } else {
-        palette = s->global_palette;
-        bits_per_pixel = s->bits_per_pixel;
-    }
-
-    /* verify that all the image is inside the screen dimensions */
-    if (left + width > s->screen_width ||
-        top + height > s->screen_height ||
-        !width || !height) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid image dimensions.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* build the palette */
-    n = (1 << bits_per_pixel);
-    spal = palette;
-    for(i = 0; i < n; i++) {
-        s->image_palette[i] = (0xffu << 24) | AV_RB24(spal);
-        spal += 3;
-    }
-    for(; i < 256; i++)
-        s->image_palette[i] = (0xffu << 24);
-    /* handle transparency */
-    if (s->transparent_color_index >= 0)
-        s->image_palette[s->transparent_color_index] = 0;
-
-    /* now get the image data */
-    code_size = bytestream2_get_byte(&s->gb);
-    ff_lzw_decode_init(s->lzw, code_size, s->gb.buffer,
-                       bytestream2_get_bytes_left(&s->gb), FF_LZW_GIF);
-
-    /* read all the image */
-    linesize = frame->linesize[0];
-    ptr1 = frame->data[0] + top * linesize + left;
-    ptr = ptr1;
-    pass = 0;
-    y1 = 0;
-    for (y = 0; y < height; y++) {
-        ff_lzw_decode(s->lzw, ptr, width);
-        if (is_interleaved) {
-            switch(pass) {
-            default:
-            case 0:
-            case 1:
-                y1 += 8;
-                ptr += linesize * 8;
-                if (y1 >= height) {
-                    y1 = pass ? 2 : 4;
-                    ptr = ptr1 + linesize * y1;
-                    pass++;
-                }
-                break;
-            case 2:
-                y1 += 4;
-                ptr += linesize * 4;
-                if (y1 >= height) {
-                    y1 = 1;
-                    ptr = ptr1 + linesize;
-                    pass++;
-                }
-                break;
-            case 3:
-                y1 += 2;
-                ptr += linesize * 2;
-                break;
-            }
-        } else {
-            ptr += linesize;
-        }
-    }
-    /* read the garbage data until end marker is found */
-    ff_lzw_decode_tail(s->lzw);
-
-    bytestream2_skip(&s->gb, ff_lzw_size_read(s->lzw));
-    return 0;
-}
-
-static int gif_read_extension(GifState *s)
-{
-    int ext_code, ext_len, i, gce_flags, gce_transparent_index;
-
-    /* extension */
-    ext_code = bytestream2_get_byte(&s->gb);
-    ext_len  = bytestream2_get_byte(&s->gb);
-
-    av_dlog(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
-
-    switch(ext_code) {
-    case 0xf9:
-        if (ext_len != 4)
-            goto discard_ext;
-        s->transparent_color_index = -1;
-        gce_flags    = bytestream2_get_byte(&s->gb);
-        s->gce_delay = bytestream2_get_le16(&s->gb);
-        gce_transparent_index = bytestream2_get_byte(&s->gb);
-        if (gce_flags & 0x01)
-            s->transparent_color_index = gce_transparent_index;
-        else
-            s->transparent_color_index = -1;
-        s->gce_disposal = (gce_flags >> 2) & 0x7;
-
-        av_dlog(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
-               gce_flags, s->gce_delay,
-               s->transparent_color_index, s->gce_disposal);
-
-        ext_len = bytestream2_get_byte(&s->gb);
-        break;
-    }
-
-    /* NOTE: many extension blocks can come after */
- discard_ext:
-    while (ext_len != 0) {
-        for (i = 0; i < ext_len; i++)
-            bytestream2_get_byte(&s->gb);
-        ext_len = bytestream2_get_byte(&s->gb);
-
-        av_dlog(s->avctx, "gif: ext_len1=%d\n", ext_len);
-    }
-    return 0;
-}
-
-static int gif_read_header1(GifState *s)
-{
-    uint8_t sig[6];
-    int v, n;
-    int has_global_palette;
-
-    if (bytestream2_get_bytes_left(&s->gb) < 13)
-        return AVERROR_INVALIDDATA;
-
-    /* read gif signature */
-    bytestream2_get_buffer(&s->gb, sig, 6);
-    if (memcmp(sig, gif87a_sig, 6) != 0 &&
-        memcmp(sig, gif89a_sig, 6) != 0)
-        return AVERROR_INVALIDDATA;
-
-    /* read screen header */
-    s->transparent_color_index = -1;
-    s->screen_width  = bytestream2_get_le16(&s->gb);
-    s->screen_height = bytestream2_get_le16(&s->gb);
-    if(   (unsigned)s->screen_width  > 32767
-       || (unsigned)s->screen_height > 32767){
-        av_log(NULL, AV_LOG_ERROR, "picture size too large\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    v = bytestream2_get_byte(&s->gb);
-    s->color_resolution = ((v & 0x70) >> 4) + 1;
-    has_global_palette = (v & 0x80);
-    s->bits_per_pixel = (v & 0x07) + 1;
-    s->background_color_index = bytestream2_get_byte(&s->gb);
-    bytestream2_get_byte(&s->gb);                /* ignored */
-
-    av_dlog(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
-           s->screen_width, s->screen_height, s->bits_per_pixel,
-           has_global_palette);
-
-    if (has_global_palette) {
-        n = 1 << s->bits_per_pixel;
-        if (bytestream2_get_bytes_left(&s->gb) < n * 3)
-            return AVERROR_INVALIDDATA;
-        bytestream2_get_buffer(&s->gb, s->global_palette, n * 3);
-    }
-    return 0;
-}
-
-static int gif_parse_next_image(GifState *s, AVFrame *frame)
-{
-    while (bytestream2_get_bytes_left(&s->gb) > 0) {
-        int code = bytestream2_get_byte(&s->gb);
-        int ret;
-
-        av_dlog(s->avctx, "gif: code=%02x '%c'\n", code, code);
-
-        switch (code) {
-        case ',':
-            return gif_read_image(s, frame);
-        case '!':
-            if ((ret = gif_read_extension(s)) < 0)
-                return ret;
-            break;
-        case ';':
-            /* end of image */
-        default:
-            /* error or erroneous EOF */
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    return AVERROR_INVALIDDATA;
-}
-
-static av_cold int gif_decode_init(AVCodecContext *avctx)
-{
-    GifState *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    ff_lzw_decode_open(&s->lzw);
-    return 0;
-}
-
-static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    GifState *s = avctx->priv_data;
-    AVFrame *picture = data;
-    int ret;
-
-    bytestream2_init(&s->gb, buf, buf_size);
-    if ((ret = gif_read_header1(s)) < 0)
-        return ret;
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    if ((ret = ff_set_dimensions(avctx, s->screen_width, s->screen_height)) < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    s->image_palette = (uint32_t *)picture->data[1];
-    ret = gif_parse_next_image(s, picture);
-    if (ret < 0)
-        return ret;
-
-    *got_frame = 1;
-    return bytestream2_tell(&s->gb);
-}
-
-static av_cold int gif_decode_close(AVCodecContext *avctx)
-{
-    GifState *s = avctx->priv_data;
-
-    ff_lzw_decode_close(&s->lzw);
-    return 0;
-}
-
-AVCodec ff_gif_decoder = {
-    .name           = "gif",
-    .long_name      = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_GIF,
-    .priv_data_size = sizeof(GifState),
-    .init           = gif_decode_init,
-    .close          = gif_decode_close,
-    .decode         = gif_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/golomb-test.c b/deps/libav/libavcodec/golomb-test.c
deleted file mode 100644
index e740a20..0000000
--- a/deps/libav/libavcodec/golomb-test.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <stdio.h>
-
-#include "libavutil/mem.h"
-
-#include "get_bits.h"
-#include "golomb.h"
-#include "put_bits.h"
-
-#define COUNT 8191
-#define SIZE (COUNT * 4)
-
-int main(void)
-{
-    int i, ret = 0;
-    uint8_t *temp;
-    PutBitContext pb;
-    GetBitContext gb;
-
-    temp = av_malloc(SIZE);
-    if (!temp)
-        return 2;
-
-    init_put_bits(&pb, temp, SIZE);
-    for (i = 0; i < COUNT; i++)
-        set_ue_golomb(&pb, i);
-    flush_put_bits(&pb);
-
-    init_get_bits(&gb, temp, 8 * SIZE);
-    for (i = 0; i < COUNT; i++) {
-        int j, s = show_bits(&gb, 25);
-
-        j = get_ue_golomb(&gb);
-        if (j != i) {
-            fprintf(stderr, "get_ue_golomb: expected %d, got %d. bits: %7x\n",
-                    i, j, s);
-            ret = 1;
-        }
-    }
-
-#define EXTEND(i) (i << 3 | i & 7)
-    init_put_bits(&pb, temp, SIZE);
-    for (i = 0; i < COUNT; i++)
-        set_ue_golomb(&pb, EXTEND(i));
-    flush_put_bits(&pb);
-
-    init_get_bits(&gb, temp, 8 * SIZE);
-    for (i = 0; i < COUNT; i++) {
-        int j, s = show_bits_long(&gb, 32);
-
-        j = get_ue_golomb_long(&gb);
-        if (j != EXTEND(i)) {
-            fprintf(stderr, "get_ue_golomb_long: expected %d, got %d. "
-                    "bits: %8x\n", EXTEND(i), j, s);
-            ret = 1;
-        }
-    }
-
-    init_put_bits(&pb, temp, SIZE);
-    for (i = 0; i < COUNT; i++)
-        set_se_golomb(&pb, i - COUNT / 2);
-    flush_put_bits(&pb);
-
-    init_get_bits(&gb, temp, 8 * SIZE);
-    for (i = 0; i < COUNT; i++) {
-        int j, s = show_bits(&gb, 25);
-
-        j = get_se_golomb(&gb);
-        if (j != i - COUNT / 2) {
-            fprintf(stderr, "get_se_golomb: expected %d, got %d. bits: %7x\n",
-                    i - COUNT / 2, j, s);
-            ret = 1;
-        }
-    }
-
-    av_free(temp);
-
-    return ret;
-}
diff --git a/deps/libav/libavcodec/golomb.c b/deps/libav/libavcodec/golomb.c
deleted file mode 100644
index 550c41e..0000000
--- a/deps/libav/libavcodec/golomb.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * exp golomb vlc stuff
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief
- *     exp golomb vlc stuff
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "libavutil/common.h"
-
-const uint8_t ff_golomb_vlc_len[512]={
-19,17,15,15,13,13,13,13,11,11,11,11,11,11,11,11,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
-};
-
-const uint8_t ff_ue_golomb_vlc_code[512]={
-32,32,32,32,32,32,32,32,31,32,32,32,32,32,32,32,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
- 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-const int8_t ff_se_golomb_vlc_code[512]={
- 17, 17, 17, 17, 17, 17, 17, 17, 16, 17, 17, 17, 17, 17, 17, 17,  8, -8,  9, -9, 10,-10, 11,-11, 12,-12, 13,-13, 14,-14, 15,-15,
-  4,  4,  4,  4, -4, -4, -4, -4,  5,  5,  5,  5, -5, -5, -5, -5,  6,  6,  6,  6, -6, -6, -6, -6,  7,  7,  7,  7, -7, -7, -7, -7,
-  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
-  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-};
-
-
-const uint8_t ff_ue_golomb_len[256]={
- 1, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,
-11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,
-13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
-13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,15,
-15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,17,
-};
-
-const uint8_t ff_interleaved_golomb_vlc_len[256]={
-9,9,7,7,9,9,7,7,5,5,5,5,5,5,5,5,
-9,9,7,7,9,9,7,7,5,5,5,5,5,5,5,5,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-9,9,7,7,9,9,7,7,5,5,5,5,5,5,5,5,
-9,9,7,7,9,9,7,7,5,5,5,5,5,5,5,5,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-};
-
-const uint8_t ff_interleaved_ue_golomb_vlc_code[256]={
- 15,16,7, 7, 17,18,8, 8, 3, 3, 3, 3, 3, 3, 3, 3,
- 19,20,9, 9, 21,22,10,10,4, 4, 4, 4, 4, 4, 4, 4,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 23,24,11,11,25,26,12,12,5, 5, 5, 5, 5, 5, 5, 5,
- 27,28,13,13,29,30,14,14,6, 6, 6, 6, 6, 6, 6, 6,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-const int8_t ff_interleaved_se_golomb_vlc_code[256]={
-  8, -8,  4,  4,  9, -9, -4, -4,  2,  2,  2,  2,  2,  2,  2,  2,
- 10,-10,  5,  5, 11,-11, -5, -5, -2, -2, -2, -2, -2, -2, -2, -2,
-  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
- 12,-12,  6,  6, 13,-13, -6, -6,  3,  3,  3,  3,  3,  3,  3,  3,
- 14,-14,  7,  7, 15,-15, -7, -7, -3, -3, -3, -3, -3, -3, -3, -3,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-};
-
-const uint8_t ff_interleaved_dirac_golomb_vlc_code[256]={
-0, 1, 0, 0, 2, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-4, 5, 2, 2, 6, 7, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-8, 9, 4, 4, 10,11,5, 5, 2, 2, 2, 2, 2, 2, 2, 2,
-12,13,6, 6, 14,15,7, 7, 3, 3, 3, 3, 3, 3, 3, 3,
-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};
diff --git a/deps/libav/libavcodec/golomb.h b/deps/libav/libavcodec/golomb.h
deleted file mode 100644
index 1754706..0000000
--- a/deps/libav/libavcodec/golomb.h
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * exp golomb vlc stuff
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2004 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief
- *     exp golomb vlc stuff
- * @author Michael Niedermayer <michaelni at gmx.at> and Alex Beregszaszi
- */
-
-#ifndef AVCODEC_GOLOMB_H
-#define AVCODEC_GOLOMB_H
-
-#include <stdint.h>
-
-#include "get_bits.h"
-#include "put_bits.h"
-
-#define INVALID_VLC           0x80000000
-
-extern const uint8_t ff_golomb_vlc_len[512];
-extern const uint8_t ff_ue_golomb_vlc_code[512];
-extern const  int8_t ff_se_golomb_vlc_code[512];
-extern const uint8_t ff_ue_golomb_len[256];
-
-extern const uint8_t ff_interleaved_golomb_vlc_len[256];
-extern const uint8_t ff_interleaved_ue_golomb_vlc_code[256];
-extern const  int8_t ff_interleaved_se_golomb_vlc_code[256];
-extern const uint8_t ff_interleaved_dirac_golomb_vlc_code[256];
-
-/**
- * read unsigned exp golomb code.
- */
-static inline int get_ue_golomb(GetBitContext *gb)
-{
-    unsigned int buf;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-    buf = GET_CACHE(re, gb);
-
-    if (buf >= (1 << 27)) {
-        buf >>= 32 - 9;
-        LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
-        CLOSE_READER(re, gb);
-
-        return ff_ue_golomb_vlc_code[buf];
-    } else {
-        int log = 2 * av_log2(buf) - 31;
-        buf >>= log;
-        buf--;
-        LAST_SKIP_BITS(re, gb, 32 - log);
-        CLOSE_READER(re, gb);
-
-        return buf;
-    }
-}
-
-/**
- * Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
- */
-static inline unsigned get_ue_golomb_long(GetBitContext *gb)
-{
-    unsigned buf, log;
-
-    buf = show_bits_long(gb, 32);
-    log = 31 - av_log2(buf);
-    skip_bits_long(gb, log);
-
-    return get_bits_long(gb, log + 1) - 1;
-}
-
-/**
- * read unsigned exp golomb code, constraint to a max of 31.
- * the return value is undefined if the stored value exceeds 31.
- */
-static inline int get_ue_golomb_31(GetBitContext *gb)
-{
-    unsigned int buf;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-    buf = GET_CACHE(re, gb);
-
-    buf >>= 32 - 9;
-    LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
-    CLOSE_READER(re, gb);
-
-    return ff_ue_golomb_vlc_code[buf];
-}
-
-static inline unsigned svq3_get_ue_golomb(GetBitContext *gb)
-{
-    uint32_t buf;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-    buf = GET_CACHE(re, gb);
-
-    if (buf & 0xAA800000) {
-        buf >>= 32 - 8;
-        LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]);
-        CLOSE_READER(re, gb);
-
-        return ff_interleaved_ue_golomb_vlc_code[buf];
-    } else {
-        unsigned ret = 1;
-
-        do {
-            buf >>= 32 - 8;
-            LAST_SKIP_BITS(re, gb,
-                           FFMIN(ff_interleaved_golomb_vlc_len[buf], 8));
-
-            if (ff_interleaved_golomb_vlc_len[buf] != 9) {
-                ret <<= (ff_interleaved_golomb_vlc_len[buf] - 1) >> 1;
-                ret  |= ff_interleaved_dirac_golomb_vlc_code[buf];
-                break;
-            }
-            ret = (ret << 4) | ff_interleaved_dirac_golomb_vlc_code[buf];
-            UPDATE_CACHE(re, gb);
-            buf = GET_CACHE(re, gb);
-        } while (HAVE_BITS_REMAINING(re, gb));
-
-        CLOSE_READER(re, gb);
-        return ret - 1;
-    }
-}
-
-/**
- * read unsigned truncated exp golomb code.
- */
-static inline int get_te0_golomb(GetBitContext *gb, int range)
-{
-    assert(range >= 1);
-
-    if (range == 1)
-        return 0;
-    else if (range == 2)
-        return get_bits1(gb) ^ 1;
-    else
-        return get_ue_golomb(gb);
-}
-
-/**
- * read unsigned truncated exp golomb code.
- */
-static inline int get_te_golomb(GetBitContext *gb, int range)
-{
-    assert(range >= 1);
-
-    if (range == 2)
-        return get_bits1(gb) ^ 1;
-    else
-        return get_ue_golomb(gb);
-}
-
-/**
- * read signed exp golomb code.
- */
-static inline int get_se_golomb(GetBitContext *gb)
-{
-    unsigned int buf;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-    buf = GET_CACHE(re, gb);
-
-    if (buf >= (1 << 27)) {
-        buf >>= 32 - 9;
-        LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
-        CLOSE_READER(re, gb);
-
-        return ff_se_golomb_vlc_code[buf];
-    } else {
-        int log = 2 * av_log2(buf) - 31;
-        buf >>= log;
-
-        LAST_SKIP_BITS(re, gb, 32 - log);
-        CLOSE_READER(re, gb);
-
-        if (buf & 1)
-            buf = -(buf >> 1);
-        else
-            buf = (buf >> 1);
-
-        return buf;
-    }
-}
-
-static inline int get_se_golomb_long(GetBitContext *gb)
-{
-    unsigned int buf = get_ue_golomb_long(gb);
-
-    if (buf & 1)
-        buf = (buf + 1) >> 1;
-    else
-        buf = -(buf >> 1);
-
-    return buf;
-}
-
-static inline int svq3_get_se_golomb(GetBitContext *gb)
-{
-    unsigned int buf;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-    buf = GET_CACHE(re, gb);
-
-    if (buf & 0xAA800000) {
-        buf >>= 32 - 8;
-        LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]);
-        CLOSE_READER(re, gb);
-
-        return ff_interleaved_se_golomb_vlc_code[buf];
-    } else {
-        int log;
-        LAST_SKIP_BITS(re, gb, 8);
-        UPDATE_CACHE(re, gb);
-        buf |= 1 | (GET_CACHE(re, gb) >> 8);
-
-        if ((buf & 0xAAAAAAAA) == 0)
-            return INVALID_VLC;
-
-        for (log = 31; (buf & 0x80000000) == 0; log--)
-            buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30);
-
-        LAST_SKIP_BITS(re, gb, 63 - 2 * log - 8);
-        CLOSE_READER(re, gb);
-
-        return (signed) (((((buf << log) >> log) - 1) ^ -(buf & 0x1)) + 1) >> 1;
-    }
-}
-
-static inline int dirac_get_se_golomb(GetBitContext *gb)
-{
-    uint32_t ret = svq3_get_ue_golomb(gb);
-
-    if (ret) {
-        uint32_t buf;
-        OPEN_READER(re, gb);
-        UPDATE_CACHE(re, gb);
-        buf = SHOW_SBITS(re, gb, 1);
-        LAST_SKIP_BITS(re, gb, 1);
-        ret = (ret ^ buf) - buf;
-        CLOSE_READER(re, gb);
-    }
-
-    return ret;
-}
-
-/**
- * read unsigned golomb rice code (ffv1).
- */
-static inline int get_ur_golomb(GetBitContext *gb, int k, int limit,
-                                int esc_len)
-{
-    unsigned int buf;
-    int log;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-    buf = GET_CACHE(re, gb);
-
-    log = av_log2(buf);
-
-    if (log > 31 - limit) {
-        buf >>= log - k;
-        buf  += (30 - log) << k;
-        LAST_SKIP_BITS(re, gb, 32 + k - log);
-        CLOSE_READER(re, gb);
-
-        return buf;
-    } else {
-        LAST_SKIP_BITS(re, gb, limit);
-        UPDATE_CACHE(re, gb);
-
-        buf = SHOW_UBITS(re, gb, esc_len);
-
-        LAST_SKIP_BITS(re, gb, esc_len);
-        CLOSE_READER(re, gb);
-
-        return buf + limit - 1;
-    }
-}
-
-/**
- * read unsigned golomb rice code (jpegls).
- */
-static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
-                                       int esc_len)
-{
-    unsigned int buf;
-    int log;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-    buf = GET_CACHE(re, gb);
-
-    log = av_log2(buf);
-
-    if (log - k >= 32 - MIN_CACHE_BITS + (MIN_CACHE_BITS == 32) &&
-        32 - log < limit) {
-        buf >>= log - k;
-        buf  += (30 - log) << k;
-        LAST_SKIP_BITS(re, gb, 32 + k - log);
-        CLOSE_READER(re, gb);
-
-        return buf;
-    } else {
-        int i;
-        for (i = 0; i < limit && SHOW_UBITS(re, gb, 1) == 0 && HAVE_BITS_REMAINING(re, gb); i++) {
-            LAST_SKIP_BITS(re, gb, 1);
-            UPDATE_CACHE(re, gb);
-        }
-        SKIP_BITS(re, gb, 1);
-
-        if (i < limit - 1) {
-            if (k) {
-                buf = SHOW_UBITS(re, gb, k);
-                LAST_SKIP_BITS(re, gb, k);
-            } else {
-                buf = 0;
-            }
-
-            CLOSE_READER(re, gb);
-            return buf + (i << k);
-        } else if (i == limit - 1) {
-            buf = SHOW_UBITS(re, gb, esc_len);
-            LAST_SKIP_BITS(re, gb, esc_len);
-            CLOSE_READER(re, gb);
-
-            return buf + 1;
-        } else
-            return -1;
-    }
-}
-
-/**
- * read signed golomb rice code (ffv1).
- */
-static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,
-                                int esc_len)
-{
-    int v = get_ur_golomb(gb, k, limit, esc_len);
-
-    v++;
-    if (v & 1)
-        return v >> 1;
-    else
-        return -(v >> 1);
-
-//    return (v>>1) ^ -(v&1);
-}
-
-/**
- * read signed golomb rice code (flac).
- */
-static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit,
-                                     int esc_len)
-{
-    int v = get_ur_golomb_jpegls(gb, k, limit, esc_len);
-    return (v >> 1) ^ -(v & 1);
-}
-
-/**
- * read unsigned golomb rice code (shorten).
- */
-static inline unsigned int get_ur_golomb_shorten(GetBitContext *gb, int k)
-{
-    return get_ur_golomb_jpegls(gb, k, INT_MAX, 0);
-}
-
-/**
- * read signed golomb rice code (shorten).
- */
-static inline int get_sr_golomb_shorten(GetBitContext *gb, int k)
-{
-    int uvar = get_ur_golomb_jpegls(gb, k + 1, INT_MAX, 0);
-    if (uvar & 1)
-        return ~(uvar >> 1);
-    else
-        return uvar >> 1;
-}
-
-#ifdef TRACE
-
-static inline int get_ue(GetBitContext *s, const char *file, const char *func,
-                         int line)
-{
-    int show = show_bits(s, 24);
-    int pos  = get_bits_count(s);
-    int i    = get_ue_golomb(s);
-    int len  = get_bits_count(s) - pos;
-    int bits = show >> (24 - len);
-
-    print_bin(bits, len);
-
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d ue  @%5d in %s %s:%d\n",
-           bits, len, i, pos, file, func, line);
-
-    return i;
-}
-
-static inline int get_se(GetBitContext *s, const char *file, const char *func,
-                         int line)
-{
-    int show = show_bits(s, 24);
-    int pos  = get_bits_count(s);
-    int i    = get_se_golomb(s);
-    int len  = get_bits_count(s) - pos;
-    int bits = show >> (24 - len);
-
-    print_bin(bits, len);
-
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d se  @%5d in %s %s:%d\n",
-           bits, len, i, pos, file, func, line);
-
-    return i;
-}
-
-static inline int get_te(GetBitContext *s, int r, char *file, const char *func,
-                         int line)
-{
-    int show = show_bits(s, 24);
-    int pos  = get_bits_count(s);
-    int i    = get_te0_golomb(s, r);
-    int len  = get_bits_count(s) - pos;
-    int bits = show >> (24 - len);
-
-    print_bin(bits, len);
-
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d te  @%5d in %s %s:%d\n",
-           bits, len, i, pos, file, func, line);
-
-    return i;
-}
-
-#define get_ue_golomb(a) get_ue(a, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_se_golomb(a) get_se(a, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_te_golomb(a, r)  get_te(a, r, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_te0_golomb(a, r) get_te(a, r, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-
-#endif /* TRACE */
-
-/**
- * write unsigned exp golomb code.
- */
-static inline void set_ue_golomb(PutBitContext *pb, int i)
-{
-    assert(i >= 0);
-
-#if 0
-    if (i = 0) {
-        put_bits(pb, 1, 1);
-        return;
-    }
-#endif
-    if (i < 256)
-        put_bits(pb, ff_ue_golomb_len[i], i + 1);
-    else {
-        int e = av_log2(i + 1);
-        put_bits(pb, 2 * e + 1, i + 1);
-    }
-}
-
-/**
- * write truncated unsigned exp golomb code.
- */
-static inline void set_te_golomb(PutBitContext *pb, int i, int range)
-{
-    assert(range >= 1);
-    assert(i <= range);
-
-    if (range == 2)
-        put_bits(pb, 1, i ^ 1);
-    else
-        set_ue_golomb(pb, i);
-}
-
-/**
- * write signed exp golomb code. 16 bits at most.
- */
-static inline void set_se_golomb(PutBitContext *pb, int i)
-{
-#if 0
-    if (i <= 0)
-        i = -2 * i;
-    else
-        i = 2 * i - 1;
-#elif 1
-    i = 2 * i - 1;
-    if (i < 0)
-        i ^= -1;    //FIXME check if gcc does the right thing
-#else
-    i  = 2 * i - 1;
-    i ^= (i >> 31);
-#endif
-    set_ue_golomb(pb, i);
-}
-
-/**
- * write unsigned golomb rice code (ffv1).
- */
-static inline void set_ur_golomb(PutBitContext *pb, int i, int k, int limit,
-                                 int esc_len)
-{
-    int e;
-
-    assert(i >= 0);
-
-    e = i >> k;
-    if (e < limit)
-        put_bits(pb, e + k + 1, (1 << k) + (i & ((1 << k) - 1)));
-    else
-        put_bits(pb, limit + esc_len, i - limit + 1);
-}
-
-/**
- * write unsigned golomb rice code (jpegls).
- */
-static inline void set_ur_golomb_jpegls(PutBitContext *pb, int i, int k,
-                                        int limit, int esc_len)
-{
-    int e;
-
-    assert(i >= 0);
-
-    e = (i >> k) + 1;
-    if (e < limit) {
-        while (e > 31) {
-            put_bits(pb, 31, 0);
-            e -= 31;
-        }
-        put_bits(pb, e, 1);
-        if (k)
-            put_sbits(pb, k, i);
-    } else {
-        while (limit > 31) {
-            put_bits(pb, 31, 0);
-            limit -= 31;
-        }
-        put_bits(pb, limit, 1);
-        put_bits(pb, esc_len, i - 1);
-    }
-}
-
-/**
- * write signed golomb rice code (ffv1).
- */
-static inline void set_sr_golomb(PutBitContext *pb, int i, int k, int limit,
-                                 int esc_len)
-{
-    int v;
-
-    v  = -2 * i - 1;
-    v ^= (v >> 31);
-
-    set_ur_golomb(pb, v, k, limit, esc_len);
-}
-
-/**
- * write signed golomb rice code (flac).
- */
-static inline void set_sr_golomb_flac(PutBitContext *pb, int i, int k,
-                                      int limit, int esc_len)
-{
-    int v;
-
-    v  = -2 * i - 1;
-    v ^= (v >> 31);
-
-    set_ur_golomb_jpegls(pb, v, k, limit, esc_len);
-}
-
-#endif /* AVCODEC_GOLOMB_H */
diff --git a/deps/libav/libavcodec/gsm.h b/deps/libav/libavcodec/gsm.h
deleted file mode 100644
index 238cb73..0000000
--- a/deps/libav/libavcodec/gsm.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * GSM common header
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_GSM_H
-#define AVCODEC_GSM_H
-
-/* bytes per block */
-#define GSM_BLOCK_SIZE     33
-#define GSM_MS_BLOCK_SIZE  65
-#define MSN_MIN_BLOCK_SIZE 41
-
-/* samples per block */
-#define GSM_FRAME_SIZE 160
-
-enum GSMModes {
-    GSM_13000 = 0,
-    MSN_12400,
-    MSN_11800,
-    MSN_11200,
-    MSN_10600,
-    MSN_10000,
-    MSN_9400,
-    MSN_8800,
-    MSN_8200,
-    NUM_GSM_MODES
-};
-
-#endif /* AVCODEC_GSM_H */
diff --git a/deps/libav/libavcodec/gsm_parser.c b/deps/libav/libavcodec/gsm_parser.c
deleted file mode 100644
index c0befc7..0000000
--- a/deps/libav/libavcodec/gsm_parser.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2012  Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * GSM audio parser
- *
- * Splits packets into individual blocks.
- */
-
-#include "parser.h"
-#include "gsm.h"
-
-typedef struct GSMParseContext {
-    ParseContext pc;
-    int block_size;
-    int duration;
-    int remaining;
-} GSMParseContext;
-
-static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
-                     const uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size)
-{
-    GSMParseContext *s = s1->priv_data;
-    ParseContext *pc = &s->pc;
-    int next;
-
-    if (!s->block_size) {
-        switch (avctx->codec_id) {
-        case AV_CODEC_ID_GSM:
-            s->block_size = GSM_BLOCK_SIZE;
-            s->duration   = GSM_FRAME_SIZE;
-            break;
-        case AV_CODEC_ID_GSM_MS:
-            s->block_size = avctx->block_align ? avctx->block_align
-                                               : GSM_MS_BLOCK_SIZE;
-            s->duration   = GSM_FRAME_SIZE * 2;
-            break;
-        default:
-            return AVERROR(EINVAL);
-        }
-    }
-
-    if (!s->remaining)
-        s->remaining = s->block_size;
-    if (s->remaining <= buf_size) {
-        next = s->remaining;
-        s->remaining = 0;
-    } else {
-        next = END_NOT_FOUND;
-        s->remaining -= buf_size;
-    }
-
-    if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) {
-        *poutbuf      = NULL;
-        *poutbuf_size = 0;
-        return buf_size;
-    }
-
-    s1->duration = s->duration;
-
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_gsm_parser = {
-    .codec_ids      = { AV_CODEC_ID_GSM, AV_CODEC_ID_GSM_MS },
-    .priv_data_size = sizeof(GSMParseContext),
-    .parser_parse   = gsm_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/gsmdec.c b/deps/libav/libavcodec/gsmdec.c
deleted file mode 100644
index b763ce8..0000000
--- a/deps/libav/libavcodec/gsmdec.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * gsm 06.10 decoder
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * GSM decoder
- */
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "msgsmdec.h"
-
-#include "gsmdec_template.c"
-
-static av_cold int gsm_init(AVCodecContext *avctx)
-{
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    if (!avctx->sample_rate)
-        avctx->sample_rate = 8000;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
-
-    switch (avctx->codec_id) {
-    case AV_CODEC_ID_GSM:
-        avctx->frame_size  = GSM_FRAME_SIZE;
-        avctx->block_align = GSM_BLOCK_SIZE;
-        break;
-    case AV_CODEC_ID_GSM_MS:
-        avctx->frame_size  = 2 * GSM_FRAME_SIZE;
-        if (!avctx->block_align)
-            avctx->block_align = GSM_MS_BLOCK_SIZE;
-        else
-            if (avctx->block_align < MSN_MIN_BLOCK_SIZE ||
-                avctx->block_align > GSM_MS_BLOCK_SIZE  ||
-                (avctx->block_align - MSN_MIN_BLOCK_SIZE) % 3) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid block alignment %d\n",
-                       avctx->block_align);
-                return AVERROR_INVALIDDATA;
-            }
-    }
-
-    return 0;
-}
-
-static int gsm_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    int res;
-    GetBitContext gb;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    int16_t *samples;
-
-    if (buf_size < avctx->block_align) {
-        av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = avctx->frame_size;
-    if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return res;
-    }
-    samples = (int16_t *)frame->data[0];
-
-    switch (avctx->codec_id) {
-    case AV_CODEC_ID_GSM:
-        init_get_bits(&gb, buf, buf_size * 8);
-        if (get_bits(&gb, 4) != 0xd)
-            av_log(avctx, AV_LOG_WARNING, "Missing GSM magic!\n");
-        res = gsm_decode_block(avctx, samples, &gb, GSM_13000);
-        if (res < 0)
-            return res;
-        break;
-    case AV_CODEC_ID_GSM_MS:
-        res = ff_msgsm_decode_block(avctx, samples, buf,
-                                    (GSM_MS_BLOCK_SIZE - avctx->block_align) / 3);
-        if (res < 0)
-            return res;
-    }
-
-    *got_frame_ptr = 1;
-
-    return avctx->block_align;
-}
-
-static void gsm_flush(AVCodecContext *avctx)
-{
-    GSMContext *s = avctx->priv_data;
-    memset(s, 0, sizeof(*s));
-}
-
-AVCodec ff_gsm_decoder = {
-    .name           = "gsm",
-    .long_name      = NULL_IF_CONFIG_SMALL("GSM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_GSM,
-    .priv_data_size = sizeof(GSMContext),
-    .init           = gsm_init,
-    .decode         = gsm_decode_frame,
-    .flush          = gsm_flush,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-AVCodec ff_gsm_ms_decoder = {
-    .name           = "gsm_ms",
-    .long_name      = NULL_IF_CONFIG_SMALL("GSM Microsoft variant"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_GSM_MS,
-    .priv_data_size = sizeof(GSMContext),
-    .init           = gsm_init,
-    .decode         = gsm_decode_frame,
-    .flush          = gsm_flush,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/gsmdec_data.c b/deps/libav/libavcodec/gsmdec_data.c
deleted file mode 100644
index c9b3183..0000000
--- a/deps/libav/libavcodec/gsmdec_data.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * gsm 06.10 decoder data
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include "gsmdec_data.h"
-
-const uint16_t ff_gsm_long_term_gain_tab[4] = {
-    3277, 11469, 21299, 32767
-};
-
-const int16_t ff_gsm_dequant_tab[64][8] = {
-    {   -28,    -20,    -12,     -4,      4,     12,     20,     28},
-    {   -56,    -40,    -24,     -8,      8,     24,     40,     56},
-    {   -84,    -60,    -36,    -12,     12,     36,     60,     84},
-    {  -112,    -80,    -48,    -16,     16,     48,     80,    112},
-    {  -140,   -100,    -60,    -20,     20,     60,    100,    140},
-    {  -168,   -120,    -72,    -24,     24,     72,    120,    168},
-    {  -196,   -140,    -84,    -28,     28,     84,    140,    196},
-    {  -224,   -160,    -96,    -32,     32,     96,    160,    224},
-    {  -252,   -180,   -108,    -36,     36,    108,    180,    252},
-    {  -280,   -200,   -120,    -40,     40,    120,    200,    280},
-    {  -308,   -220,   -132,    -44,     44,    132,    220,    308},
-    {  -336,   -240,   -144,    -48,     48,    144,    240,    336},
-    {  -364,   -260,   -156,    -52,     52,    156,    260,    364},
-    {  -392,   -280,   -168,    -56,     56,    168,    280,    392},
-    {  -420,   -300,   -180,    -60,     60,    180,    300,    420},
-    {  -448,   -320,   -192,    -64,     64,    192,    320,    448},
-    {  -504,   -360,   -216,    -72,     72,    216,    360,    504},
-    {  -560,   -400,   -240,    -80,     80,    240,    400,    560},
-    {  -616,   -440,   -264,    -88,     88,    264,    440,    616},
-    {  -672,   -480,   -288,    -96,     96,    288,    480,    672},
-    {  -728,   -520,   -312,   -104,    104,    312,    520,    728},
-    {  -784,   -560,   -336,   -112,    112,    336,    560,    784},
-    {  -840,   -600,   -360,   -120,    120,    360,    600,    840},
-    {  -896,   -640,   -384,   -128,    128,    384,    640,    896},
-    { -1008,   -720,   -432,   -144,    144,    432,    720,   1008},
-    { -1120,   -800,   -480,   -160,    160,    480,    800,   1120},
-    { -1232,   -880,   -528,   -176,    176,    528,    880,   1232},
-    { -1344,   -960,   -576,   -192,    192,    576,    960,   1344},
-    { -1456,  -1040,   -624,   -208,    208,    624,   1040,   1456},
-    { -1568,  -1120,   -672,   -224,    224,    672,   1120,   1568},
-    { -1680,  -1200,   -720,   -240,    240,    720,   1200,   1680},
-    { -1792,  -1280,   -768,   -256,    256,    768,   1280,   1792},
-    { -2016,  -1440,   -864,   -288,    288,    864,   1440,   2016},
-    { -2240,  -1600,   -960,   -320,    320,    960,   1600,   2240},
-    { -2464,  -1760,  -1056,   -352,    352,   1056,   1760,   2464},
-    { -2688,  -1920,  -1152,   -384,    384,   1152,   1920,   2688},
-    { -2912,  -2080,  -1248,   -416,    416,   1248,   2080,   2912},
-    { -3136,  -2240,  -1344,   -448,    448,   1344,   2240,   3136},
-    { -3360,  -2400,  -1440,   -480,    480,   1440,   2400,   3360},
-    { -3584,  -2560,  -1536,   -512,    512,   1536,   2560,   3584},
-    { -4032,  -2880,  -1728,   -576,    576,   1728,   2880,   4032},
-    { -4480,  -3200,  -1920,   -640,    640,   1920,   3200,   4480},
-    { -4928,  -3520,  -2112,   -704,    704,   2112,   3520,   4928},
-    { -5376,  -3840,  -2304,   -768,    768,   2304,   3840,   5376},
-    { -5824,  -4160,  -2496,   -832,    832,   2496,   4160,   5824},
-    { -6272,  -4480,  -2688,   -896,    896,   2688,   4480,   6272},
-    { -6720,  -4800,  -2880,   -960,    960,   2880,   4800,   6720},
-    { -7168,  -5120,  -3072,  -1024,   1024,   3072,   5120,   7168},
-    { -8063,  -5759,  -3456,  -1152,   1152,   3456,   5760,   8064},
-    { -8959,  -6399,  -3840,  -1280,   1280,   3840,   6400,   8960},
-    { -9855,  -7039,  -4224,  -1408,   1408,   4224,   7040,   9856},
-    {-10751,  -7679,  -4608,  -1536,   1536,   4608,   7680,  10752},
-    {-11647,  -8319,  -4992,  -1664,   1664,   4992,   8320,  11648},
-    {-12543,  -8959,  -5376,  -1792,   1792,   5376,   8960,  12544},
-    {-13439,  -9599,  -5760,  -1920,   1920,   5760,   9600,  13440},
-    {-14335, -10239,  -6144,  -2048,   2048,   6144,  10240,  14336},
-    {-16127, -11519,  -6912,  -2304,   2304,   6912,  11519,  16127},
-    {-17919, -12799,  -7680,  -2560,   2560,   7680,  12799,  17919},
-    {-19711, -14079,  -8448,  -2816,   2816,   8448,  14079,  19711},
-    {-21503, -15359,  -9216,  -3072,   3072,   9216,  15359,  21503},
-    {-23295, -16639,  -9984,  -3328,   3328,   9984,  16639,  23295},
-    {-25087, -17919, -10752,  -3584,   3584,  10752,  17919,  25087},
-    {-26879, -19199, -11520,  -3840,   3840,  11520,  19199,  26879},
-    {-28671, -20479, -12288,  -4096,   4096,  12288,  20479,  28671}
-};
-
-static const int apcm_bits[11][13] = {
-    { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
-    { 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1 },
-    { 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1 },
-    { 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1 },
-    { 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1 },
-    { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
-    { 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
-    { 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
-    { 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
-    { 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
-    { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }
-};
-
-const int* const ff_gsm_apcm_bits[][4] = {
-    { apcm_bits[10], apcm_bits[10], apcm_bits[10], apcm_bits[10] }, // 13000
-    { apcm_bits[10], apcm_bits[10], apcm_bits[10], apcm_bits[ 6] }, // 12400
-    { apcm_bits[10], apcm_bits[10], apcm_bits[ 7], apcm_bits[ 5] }, // 11800
-    { apcm_bits[10], apcm_bits[ 8], apcm_bits[ 5], apcm_bits[ 5] }, // 11200
-    { apcm_bits[ 9], apcm_bits[ 5], apcm_bits[ 5], apcm_bits[ 5] }, // 10600
-    { apcm_bits[ 5], apcm_bits[ 5], apcm_bits[ 5], apcm_bits[ 1] }, // 10000
-    { apcm_bits[ 5], apcm_bits[ 5], apcm_bits[ 2], apcm_bits[ 0] }, //  9400
-    { apcm_bits[ 5], apcm_bits[ 3], apcm_bits[ 0], apcm_bits[ 0] }, //  8800
-    { apcm_bits[ 4], apcm_bits[ 0], apcm_bits[ 0], apcm_bits[ 0] }, //  8200
-};
diff --git a/deps/libav/libavcodec/gsmdec_data.h b/deps/libav/libavcodec/gsmdec_data.h
deleted file mode 100644
index f5581d5..0000000
--- a/deps/libav/libavcodec/gsmdec_data.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * gsm 06.10 decoder data
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_GSMDEC_DATA_H
-#define AVCODEC_GSMDEC_DATA_H
-
-#include <stdint.h>
-#include "avcodec.h"
-
-typedef struct GSMContext {
-    // Contains first 120 elements from the previous frame
-    // (used by long_term_synth according to the "lag"),
-    // then in the following 160 elements the current
-    // frame is constructed.
-    int16_t ref_buf[280];
-    int v[9];
-    int lar[2][8];
-    int lar_idx;
-    int msr;
-} GSMContext;
-
-extern const uint16_t ff_gsm_long_term_gain_tab[4];
-extern const int16_t ff_gsm_dequant_tab[64][8];
-
-extern const int* const ff_gsm_apcm_bits[][4];
-
-#endif /* AVCODEC_GSMDEC_DATA_H */
diff --git a/deps/libav/libavcodec/gsmdec_template.c b/deps/libav/libavcodec/gsmdec_template.c
deleted file mode 100644
index 0b54dc5..0000000
--- a/deps/libav/libavcodec/gsmdec_template.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * gsm 06.10 decoder
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * GSM decoder
- */
-
-#include "get_bits.h"
-#include "gsm.h"
-#include "gsmdec_data.h"
-
-static const int requant_tab[4][8] = {
-    { 0 },
-    { 0, 7 },
-    { 0, 2, 5, 7 },
-    { 0, 1, 2, 3, 4, 5, 6, 7 }
-};
-
-static void apcm_dequant_add(GetBitContext *gb, int16_t *dst, const int *frame_bits)
-{
-    int i, val;
-    int maxidx = get_bits(gb, 6);
-    const int16_t *tab = ff_gsm_dequant_tab[maxidx];
-    for (i = 0; i < 13; i++) {
-        val = get_bits(gb, frame_bits[i]);
-        dst[3*i] += tab[requant_tab[frame_bits[i]][val]];
-    }
-}
-
-static inline int gsm_mult(int a, int b)
-{
-    return (a * b + (1 << 14)) >> 15;
-}
-
-static void long_term_synth(int16_t *dst, int lag, int gain_idx)
-{
-    int i;
-    const int16_t *src = dst - lag;
-    uint16_t gain = ff_gsm_long_term_gain_tab[gain_idx];
-    for (i = 0; i < 40; i++)
-        dst[i] = gsm_mult(gain, src[i]);
-}
-
-static inline int decode_log_area(int coded, int factor, int offset)
-{
-    coded <<= 10;
-    coded -= offset;
-    return gsm_mult(coded, factor) << 1;
-}
-
-static av_noinline int get_rrp(int filtered)
-{
-    int abs = FFABS(filtered);
-    if      (abs < 11059) abs <<= 1;
-    else if (abs < 20070) abs += 11059;
-    else                  abs = (abs >> 2) + 26112;
-    return filtered < 0 ? -abs : abs;
-}
-
-static int filter_value(int in, int rrp[8], int v[9])
-{
-    int i;
-    for (i = 7; i >= 0; i--) {
-        in -= gsm_mult(rrp[i], v[i]);
-        v[i + 1] = v[i] + gsm_mult(rrp[i], in);
-    }
-    v[0] = in;
-    return in;
-}
-
-static void short_term_synth(GSMContext *ctx, int16_t *dst, const int16_t *src)
-{
-    int i;
-    int rrp[8];
-    int *lar = ctx->lar[ctx->lar_idx];
-    int *lar_prev = ctx->lar[ctx->lar_idx ^ 1];
-    for (i = 0; i < 8; i++)
-        rrp[i] = get_rrp((lar_prev[i] >> 2) + (lar_prev[i] >> 1) + (lar[i] >> 2));
-    for (i = 0; i < 13; i++)
-        dst[i] = filter_value(src[i], rrp, ctx->v);
-
-    for (i = 0; i < 8; i++)
-        rrp[i] = get_rrp((lar_prev[i] >> 1) + (lar     [i] >> 1));
-    for (i = 13; i < 27; i++)
-        dst[i] = filter_value(src[i], rrp, ctx->v);
-
-    for (i = 0; i < 8; i++)
-        rrp[i] = get_rrp((lar_prev[i] >> 2) + (lar     [i] >> 1) + (lar[i] >> 2));
-    for (i = 27; i < 40; i++)
-        dst[i] = filter_value(src[i], rrp, ctx->v);
-
-    for (i = 0; i < 8; i++)
-        rrp[i] = get_rrp(lar[i]);
-    for (i = 40; i < 160; i++)
-        dst[i] = filter_value(src[i], rrp, ctx->v);
-
-    ctx->lar_idx ^= 1;
-}
-
-static int postprocess(int16_t *data, int msr)
-{
-    int i;
-    for (i = 0; i < 160; i++) {
-        msr = av_clip_int16(data[i] + gsm_mult(msr, 28180));
-        data[i] = av_clip_int16(msr << 1) & ~7;
-    }
-    return msr;
-}
-
-static int gsm_decode_block(AVCodecContext *avctx, int16_t *samples,
-                            GetBitContext *gb, int mode)
-{
-    GSMContext *ctx = avctx->priv_data;
-    int i;
-    int16_t *ref_dst = ctx->ref_buf + 120;
-    int *lar = ctx->lar[ctx->lar_idx];
-    lar[0] = decode_log_area(get_bits(gb, 6), 13107,  1 << 15);
-    lar[1] = decode_log_area(get_bits(gb, 6), 13107,  1 << 15);
-    lar[2] = decode_log_area(get_bits(gb, 5), 13107, (1 << 14) + 2048*2);
-    lar[3] = decode_log_area(get_bits(gb, 5), 13107, (1 << 14) - 2560*2);
-    lar[4] = decode_log_area(get_bits(gb, 4), 19223, (1 << 13) +   94*2);
-    lar[5] = decode_log_area(get_bits(gb, 4), 17476, (1 << 13) - 1792*2);
-    lar[6] = decode_log_area(get_bits(gb, 3), 31454, (1 << 12) -  341*2);
-    lar[7] = decode_log_area(get_bits(gb, 3), 29708, (1 << 12) - 1144*2);
-
-    for (i = 0; i < 4; i++) {
-        int lag      = get_bits(gb, 7);
-        int gain_idx = get_bits(gb, 2);
-        int offset   = get_bits(gb, 2);
-        lag = av_clip(lag, 40, 120);
-        long_term_synth(ref_dst, lag, gain_idx);
-        apcm_dequant_add(gb, ref_dst + offset, ff_gsm_apcm_bits[mode][i]);
-        ref_dst += 40;
-    }
-    memcpy(ctx->ref_buf, ctx->ref_buf + 160, 120 * sizeof(*ctx->ref_buf));
-    short_term_synth(ctx, samples, ctx->ref_buf + 120);
-    // for optimal speed this could be merged with short_term_synth,
-    // not done yet because it is a bit ugly
-    ctx->msr = postprocess(samples, ctx->msr);
-    return 0;
-}
diff --git a/deps/libav/libavcodec/h261.c b/deps/libav/libavcodec/h261.c
deleted file mode 100644
index b9783f1..0000000
--- a/deps/libav/libavcodec/h261.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * H261 common code
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2004 Maarten Daniels
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * h261codec.
- */
-
-#include "avcodec.h"
-#include "h261.h"
-
-#define IS_FIL(a)    ((a) & MB_TYPE_H261_FIL)
-
-uint8_t ff_h261_rl_table_store[2][2 * MAX_RUN + MAX_LEVEL + 3];
-
-static void h261_loop_filter(uint8_t *src, int stride)
-{
-    int x, y, xy, yz;
-    int temp[64];
-
-    for (x = 0; x < 8; x++) {
-        temp[x]         = 4 * src[x];
-        temp[x + 7 * 8] = 4 * src[x + 7 * stride];
-    }
-    for (y = 1; y < 7; y++) {
-        for (x = 0; x < 8; x++) {
-            xy       = y * stride + x;
-            yz       = y * 8      + x;
-            temp[yz] = src[xy - stride] + 2 * src[xy] + src[xy + stride];
-        }
-    }
-
-    for (y = 0; y < 8; y++) {
-        src[y * stride]     = (temp[y * 8]     + 2) >> 2;
-        src[y * stride + 7] = (temp[y * 8 + 7] + 2) >> 2;
-        for (x = 1; x < 7; x++) {
-            xy      = y * stride + x;
-            yz      = y * 8      + x;
-            src[xy] = (temp[yz - 1] + 2 * temp[yz] + temp[yz + 1] + 8) >> 4;
-        }
-    }
-}
-
-void ff_h261_loop_filter(MpegEncContext *s)
-{
-    H261Context *h       = (H261Context *)s;
-    const int linesize   = s->linesize;
-    const int uvlinesize = s->uvlinesize;
-    uint8_t *dest_y      = s->dest[0];
-    uint8_t *dest_cb     = s->dest[1];
-    uint8_t *dest_cr     = s->dest[2];
-
-    if (!(IS_FIL(h->mtype)))
-        return;
-
-    h261_loop_filter(dest_y,                    linesize);
-    h261_loop_filter(dest_y + 8,                linesize);
-    h261_loop_filter(dest_y + 8 * linesize,     linesize);
-    h261_loop_filter(dest_y + 8 * linesize + 8, linesize);
-    h261_loop_filter(dest_cb, uvlinesize);
-    h261_loop_filter(dest_cr, uvlinesize);
-}
-
-av_cold void ff_h261_common_init(void)
-{
-    static int done = 0;
-
-    if (done)
-        return;
-
-    ff_init_rl(&ff_h261_rl_tcoeff, ff_h261_rl_table_store);
-    done = 1;
-}
diff --git a/deps/libav/libavcodec/h261.h b/deps/libav/libavcodec/h261.h
deleted file mode 100644
index ad7e28b..0000000
--- a/deps/libav/libavcodec/h261.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * H261 decoder
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2004 Maarten Daniels
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * h261codec.
- */
-
-#ifndef AVCODEC_H261_H
-#define AVCODEC_H261_H
-
-#include "mpegvideo.h"
-#include "rl.h"
-
-/**
- * H261Context
- */
-typedef struct H261Context {
-    MpegEncContext s;
-
-    int current_mba;
-    int previous_mba;
-    int mba_diff;
-    int mtype;
-    int current_mv_x;
-    int current_mv_y;
-    int gob_number;
-    int gob_start_code_skipped; // 1 if gob start code is already read before gob header is read
-} H261Context;
-
-#define MB_TYPE_H261_FIL 0x800000
-
-extern uint8_t ff_h261_rl_table_store[2][2 * MAX_RUN + MAX_LEVEL + 3];
-
-extern const uint8_t ff_h261_mba_code[35];
-extern const uint8_t ff_h261_mba_bits[35];
-extern const uint8_t ff_h261_mtype_code[10];
-extern const uint8_t ff_h261_mtype_bits[10];
-extern const int     ff_h261_mtype_map[10];
-extern const uint8_t ff_h261_mv_tab[17][2];
-extern const uint8_t ff_h261_cbp_tab[63][2];
-extern RLTable ff_h261_rl_tcoeff;
-
-void ff_h261_loop_filter(MpegEncContext *s);
-void ff_h261_common_init(void);
-
-int ff_h261_get_picture_format(int width, int height);
-void ff_h261_reorder_mb_index(MpegEncContext *s);
-void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64],
-                       int motion_x, int motion_y);
-void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number);
-void ff_h261_encode_init(MpegEncContext *s);
-
-#endif /* AVCODEC_H261_H */
diff --git a/deps/libav/libavcodec/h261_parser.c b/deps/libav/libavcodec/h261_parser.c
deleted file mode 100644
index 2469424..0000000
--- a/deps/libav/libavcodec/h261_parser.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * H261 parser
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2004 Maarten Daniels
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * h261codec.
- */
-
-#include "parser.h"
-
-static int h261_find_frame_end(ParseContext *pc, AVCodecContext *avctx,
-                               const uint8_t *buf, int buf_size)
-{
-    int vop_found, i, j;
-    uint32_t state;
-
-    vop_found = pc->frame_start_found;
-    state     = pc->state;
-
-    for (i = 0; i < buf_size && !vop_found; i++) {
-        state = (state << 8) | buf[i];
-        for (j = 0; j < 8; j++) {
-            if (((state >> j) & 0xFFFFF0) == 0x000100) {
-                vop_found = 1;
-                break;
-            }
-        }
-    }
-    if (vop_found) {
-        for (; i < buf_size; i++) {
-            state = (state << 8) | buf[i];
-            for (j = 0; j < 8; j++) {
-                if (((state >> j) & 0xFFFFF0) == 0x000100) {
-                    pc->frame_start_found = 0;
-                    pc->state             = (state >> (3 * 8)) + 0xFF00;
-                    return i - 2;
-                }
-            }
-        }
-    }
-
-    pc->frame_start_found = vop_found;
-    pc->state             = state;
-    return END_NOT_FOUND;
-}
-
-static int h261_parse(AVCodecParserContext *s,
-                      AVCodecContext *avctx,
-                      const uint8_t **poutbuf, int *poutbuf_size,
-                      const uint8_t *buf, int buf_size)
-{
-    ParseContext *pc = s->priv_data;
-    int next;
-
-    next = h261_find_frame_end(pc, avctx, buf, buf_size);
-    if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-        *poutbuf      = NULL;
-        *poutbuf_size = 0;
-        return buf_size;
-    }
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_h261_parser = {
-    .codec_ids      = { AV_CODEC_ID_H261 },
-    .priv_data_size = sizeof(ParseContext),
-    .parser_parse   = h261_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/h261data.c b/deps/libav/libavcodec/h261data.c
deleted file mode 100644
index eb8e64a..0000000
--- a/deps/libav/libavcodec/h261data.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- * copyright (c) 2004 Maarten Daniels
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.261 tables.
- */
-
-#include <stdint.h>
-
-#include "rl.h"
-#include "h261.h"
-
-// H.261 VLC table for macroblock addressing
-const uint8_t ff_h261_mba_code[35] = {
-     1,  3,  2,  3,
-     2,  3,  2,  7,
-     6, 11, 10,  9,
-     8,  7,  6, 23,
-    22, 21, 20, 19,
-    18, 35, 34, 33,
-    32, 31, 30, 29,
-    28, 27, 26, 25,
-    24,
-    15, // (MBA stuffing)
-     1  // (start code)
-};
-
-const uint8_t ff_h261_mba_bits[35] = {
-     1,  3,  3,  4,
-     4,  5,  5,  7,
-     7,  8,  8,  8,
-     8,  8,  8, 10,
-    10, 10, 10, 10,
-    10, 11, 11, 11,
-    11, 11, 11, 11,
-    11, 11, 11, 11,
-    11,
-    11, // (MBA stuffing)
-    16  // (start code)
-};
-
-// H.261 VLC table for macroblock type
-const uint8_t ff_h261_mtype_code[10] = {
-    1, 1, 1, 1,
-    1, 1, 1, 1,
-    1, 1
-};
-
-const uint8_t ff_h261_mtype_bits[10] = {
-    4, 7,  1, 5,
-    9, 8, 10, 3,
-    2, 6
-};
-
-const int ff_h261_mtype_map[10] = {
-    MB_TYPE_INTRA4x4,
-    MB_TYPE_INTRA4x4 | MB_TYPE_QUANT,
-    MB_TYPE_CBP,
-    MB_TYPE_CBP | MB_TYPE_QUANT,
-    MB_TYPE_16x16,
-    MB_TYPE_16x16 | MB_TYPE_CBP,
-    MB_TYPE_16x16 | MB_TYPE_CBP | MB_TYPE_QUANT,
-    MB_TYPE_16x16 | MB_TYPE_H261_FIL,
-    MB_TYPE_16x16 | MB_TYPE_H261_FIL | MB_TYPE_CBP,
-    MB_TYPE_16x16 | MB_TYPE_H261_FIL | MB_TYPE_CBP | MB_TYPE_QUANT
-};
-
-// H.261 VLC table for motion vectors
-const uint8_t ff_h261_mv_tab[17][2] = {
-    {  1, 1 }, {  1, 2 }, { 1, 3 }, {  1,  4 }, {  3,  6 }, {  5,  7 }, {  4,  7 }, {  3,  7 },
-    { 11, 9 }, { 10, 9 }, { 9, 9 }, { 17, 10 }, { 16, 10 }, { 15, 10 }, { 14, 10 }, { 13, 10 }, { 12, 10 }
-};
-
-// H.261 VLC table for coded block pattern
-const uint8_t ff_h261_cbp_tab[63][2] = {
-    { 11, 5 }, {  9, 5 }, { 13, 6 }, { 13, 4 }, { 23, 7 }, { 19, 7 }, { 31, 8 }, { 12, 4 },
-    { 22, 7 }, { 18, 7 }, { 30, 8 }, { 19, 5 }, { 27, 8 }, { 23, 8 }, { 19, 8 }, { 11, 4 },
-    { 21, 7 }, { 17, 7 }, { 29, 8 }, { 17, 5 }, { 25, 8 }, { 21, 8 }, { 17, 8 }, { 15, 6 },
-    { 15, 8 }, { 13, 8 }, {  3, 9 }, { 15, 5 }, { 11, 8 }, {  7, 8 }, {  7, 9 }, { 10, 4 },
-    { 20, 7 }, { 16, 7 }, { 28, 8 }, { 14, 6 }, { 14, 8 }, { 12, 8 }, {  2, 9 }, { 16, 5 },
-    { 24, 8 }, { 20, 8 }, { 16, 8 }, { 14, 5 }, { 10, 8 }, {  6, 8 }, {  6, 9 }, { 18, 5 },
-    { 26, 8 }, { 22, 8 }, { 18, 8 }, { 13, 5 }, {  9, 8 }, {  5, 8 }, {  5, 9 }, { 12, 5 },
-    {  8, 8 }, {  4, 8 }, {  4, 9 }, {  7, 3 }, { 10, 5 }, {  8, 5 }, { 12, 6 }
-};
-
-// H.261 VLC table for transform coefficients
-static const uint16_t h261_tcoeff_vlc[65][2] = {
-    {  0x2,  2 }, {  0x3,  2 }, {  0x4,  4 }, {  0x5,  5 },
-    {  0x6,  7 }, { 0x26,  8 }, { 0x21,  8 }, {  0xa, 10 },
-    { 0x1d, 12 }, { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 },
-    { 0x1a, 13 }, { 0x19, 13 }, { 0x18, 13 }, { 0x17, 13 },
-    {  0x3,  3 }, {  0x6,  6 }, { 0x25,  8 }, {  0xc, 10 },
-    { 0x1b, 12 }, { 0x16, 13 }, { 0x15, 13 }, {  0x5,  4 },
-    {  0x4,  7 }, {  0xb, 10 }, { 0x14, 12 }, { 0x14, 13 },
-    {  0x7,  5 }, { 0x24,  8 }, { 0x1c, 12 }, { 0x13, 13 },
-    {  0x6,  5 }, {  0xf, 10 }, { 0x12, 12 }, {  0x7,  6 },
-    {  0x9, 10 }, { 0x12, 13 }, {  0x5,  6 }, { 0x1e, 12 },
-    {  0x4,  6 }, { 0x15, 12 }, {  0x7,  7 }, { 0x11, 12 },
-    {  0x5,  7 }, { 0x11, 13 }, { 0x27,  8 }, { 0x10, 13 },
-    { 0x23,  8 }, { 0x22,  8 }, { 0x20,  8 }, {  0xe, 10 },
-    {  0xd, 10 }, {  0x8, 10 }, { 0x1f, 12 }, { 0x1a, 12 },
-    { 0x19, 12 }, { 0x17, 12 }, { 0x16, 12 }, { 0x1f, 13 },
-    { 0x1e, 13 }, { 0x1d, 13 }, { 0x1c, 13 }, { 0x1b, 13 },
-    {  0x1,  6 }  // escape
-};
-
-static const int8_t h261_tcoeff_level[64] = {
-    0, 1,  2,  3,  4,  5,  6,  7,
-    8, 9, 10, 11, 12, 13, 14, 15,
-    1, 2,  3,  4,  5,  6,  7,  1,
-    2, 3,  4,  5,  1,  2,  3,  4,
-    1, 2,  3,  1,  2,  3,  1,  2,
-    1, 2,  1,  2,  1,  2,  1,  2,
-    1, 1,  1,  1,  1,  1,  1,  1,
-    1, 1,  1,  1,  1,  1,  1,  1
-};
-
-static const int8_t h261_tcoeff_run[64] = {
-     0,
-     0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  1,
-     1,  1,  1,  1,  1,  1,  2,  2,
-     2,  2,  2,  3,  3,  3,  3,  4,
-     4,  4,  5,  5,  5,  6,  6,  7,
-     7,  8,  8,  9,  9, 10, 10, 11,
-    12, 13, 14, 15, 16, 17, 18, 19,
-    20, 21, 22, 23, 24, 25, 26
-};
-
-RLTable ff_h261_rl_tcoeff = {
-    64,
-    64,
-    h261_tcoeff_vlc,
-    h261_tcoeff_run,
-    h261_tcoeff_level,
-};
diff --git a/deps/libav/libavcodec/h261dec.c b/deps/libav/libavcodec/h261dec.c
deleted file mode 100644
index 49eaee1..0000000
--- a/deps/libav/libavcodec/h261dec.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
- * H261 decoder
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2004 Maarten Daniels
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.261 decoder.
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h263.h"
-#include "h261.h"
-#include "internal.h"
-
-#define H261_MBA_VLC_BITS 9
-#define H261_MTYPE_VLC_BITS 6
-#define H261_MV_VLC_BITS 7
-#define H261_CBP_VLC_BITS 9
-#define TCOEFF_VLC_BITS 9
-#define MBA_STUFFING 33
-#define MBA_STARTCODE 34
-
-static VLC h261_mba_vlc;
-static VLC h261_mtype_vlc;
-static VLC h261_mv_vlc;
-static VLC h261_cbp_vlc;
-
-static av_cold void h261_decode_init_vlc(H261Context *h)
-{
-    static int done = 0;
-
-    if (!done) {
-        done = 1;
-        INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35,
-                        ff_h261_mba_bits, 1, 1,
-                        ff_h261_mba_code, 1, 1, 662);
-        INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10,
-                        ff_h261_mtype_bits, 1, 1,
-                        ff_h261_mtype_code, 1, 1, 80);
-        INIT_VLC_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17,
-                        &ff_h261_mv_tab[0][1], 2, 1,
-                        &ff_h261_mv_tab[0][0], 2, 1, 144);
-        INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63,
-                        &ff_h261_cbp_tab[0][1], 2, 1,
-                        &ff_h261_cbp_tab[0][0], 2, 1, 512);
-        INIT_VLC_RL(ff_h261_rl_tcoeff, 552);
-    }
-}
-
-static av_cold int h261_decode_init(AVCodecContext *avctx)
-{
-    H261Context *h          = avctx->priv_data;
-    MpegEncContext *const s = &h->s;
-
-    // set defaults
-    ff_MPV_decode_defaults(s);
-    s->avctx       = avctx;
-    s->width       = s->avctx->coded_width;
-    s->height      = s->avctx->coded_height;
-    s->codec_id    = s->avctx->codec->id;
-    s->out_format  = FMT_H261;
-    s->low_delay   = 1;
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    s->codec_id    = avctx->codec->id;
-
-    ff_h261_common_init();
-    h261_decode_init_vlc(h);
-
-    h->gob_start_code_skipped = 0;
-
-    return 0;
-}
-
-/**
- * Decode the group of blocks header or slice header.
- * @return <0 if an error occurred
- */
-static int h261_decode_gob_header(H261Context *h)
-{
-    unsigned int val;
-    MpegEncContext *const s = &h->s;
-
-    if (!h->gob_start_code_skipped) {
-        /* Check for GOB Start Code */
-        val = show_bits(&s->gb, 15);
-        if (val)
-            return -1;
-
-        /* We have a GBSC */
-        skip_bits(&s->gb, 16);
-    }
-
-    h->gob_start_code_skipped = 0;
-
-    h->gob_number = get_bits(&s->gb, 4); /* GN */
-    s->qscale     = get_bits(&s->gb, 5); /* GQUANT */
-
-    /* Check if gob_number is valid */
-    if (s->mb_height == 18) { // CIF
-        if ((h->gob_number <= 0) || (h->gob_number > 12))
-            return -1;
-    } else { // QCIF
-        if ((h->gob_number != 1) && (h->gob_number != 3) &&
-            (h->gob_number != 5))
-            return -1;
-    }
-
-    /* GEI */
-    while (get_bits1(&s->gb) != 0)
-        skip_bits(&s->gb, 8);
-
-    if (s->qscale == 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "qscale has forbidden 0 value\n");
-        if (s->avctx->err_recognition & AV_EF_BITSTREAM)
-            return -1;
-    }
-
-    /* For the first transmitted macroblock in a GOB, MBA is the absolute
-     * address. For subsequent macroblocks, MBA is the difference between
-     * the absolute addresses of the macroblock and the last transmitted
-     * macroblock. */
-    h->current_mba = 0;
-    h->mba_diff    = 0;
-
-    return 0;
-}
-
-/**
- * Decode the group of blocks / video packet header.
- * @return <0 if no resync found
- */
-static int h261_resync(H261Context *h)
-{
-    MpegEncContext *const s = &h->s;
-    int left, ret;
-
-    if (h->gob_start_code_skipped) {
-        ret = h261_decode_gob_header(h);
-        if (ret >= 0)
-            return 0;
-    } else {
-        if (show_bits(&s->gb, 15) == 0) {
-            ret = h261_decode_gob_header(h);
-            if (ret >= 0)
-                return 0;
-        }
-        // OK, it is not where it is supposed to be ...
-        s->gb = s->last_resync_gb;
-        align_get_bits(&s->gb);
-        left = get_bits_left(&s->gb);
-
-        for (; left > 15 + 1 + 4 + 5; left -= 8) {
-            if (show_bits(&s->gb, 15) == 0) {
-                GetBitContext bak = s->gb;
-
-                ret = h261_decode_gob_header(h);
-                if (ret >= 0)
-                    return 0;
-
-                s->gb = bak;
-            }
-            skip_bits(&s->gb, 8);
-        }
-    }
-
-    return -1;
-}
-
-/**
- * Decode skipped macroblocks.
- * @return 0
- */
-static int h261_decode_mb_skipped(H261Context *h, int mba1, int mba2)
-{
-    MpegEncContext *const s = &h->s;
-    int i;
-
-    s->mb_intra = 0;
-
-    for (i = mba1; i < mba2; i++) {
-        int j, xy;
-
-        s->mb_x = ((h->gob_number - 1) % 2) * 11 + i % 11;
-        s->mb_y = ((h->gob_number - 1) / 2) * 3 + i / 11;
-        xy      = s->mb_x + s->mb_y * s->mb_stride;
-        ff_init_block_index(s);
-        ff_update_block_index(s);
-
-        for (j = 0; j < 6; j++)
-            s->block_last_index[j] = -1;
-
-        s->mv_dir                      = MV_DIR_FORWARD;
-        s->mv_type                     = MV_TYPE_16X16;
-        s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
-        s->mv[0][0][0]                 = 0;
-        s->mv[0][0][1]                 = 0;
-        s->mb_skipped                  = 1;
-        h->mtype                      &= ~MB_TYPE_H261_FIL;
-
-        ff_MPV_decode_mb(s, s->block);
-    }
-
-    return 0;
-}
-
-static const int mvmap[17] = {
-    0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16
-};
-
-static int decode_mv_component(GetBitContext *gb, int v)
-{
-    int mv_diff = get_vlc2(gb, h261_mv_vlc.table, H261_MV_VLC_BITS, 2);
-
-    /* check if mv_diff is valid */
-    if (mv_diff < 0)
-        return v;
-
-    mv_diff = mvmap[mv_diff];
-
-    if (mv_diff && !get_bits1(gb))
-        mv_diff = -mv_diff;
-
-    v += mv_diff;
-    if (v <= -16)
-        v += 32;
-    else if (v >= 16)
-        v -= 32;
-
-    return v;
-}
-
-/**
- * Decode a macroblock.
- * @return <0 if an error occurred
- */
-static int h261_decode_block(H261Context *h, int16_t *block, int n, int coded)
-{
-    MpegEncContext *const s = &h->s;
-    int code, level, i, j, run;
-    RLTable *rl = &ff_h261_rl_tcoeff;
-    const uint8_t *scan_table;
-
-    /* For the variable length encoding there are two code tables, one being
-     * used for the first transmitted LEVEL in INTER, INTER + MC and
-     * INTER + MC + FIL blocks, the second for all other LEVELs except the
-     * first one in INTRA blocks which is fixed length coded with 8 bits.
-     * NOTE: The two code tables only differ in one VLC so we handle that
-     * manually. */
-    scan_table = s->intra_scantable.permutated;
-    if (s->mb_intra) {
-        /* DC coef */
-        level = get_bits(&s->gb, 8);
-        // 0 (00000000b) and -128 (10000000b) are FORBIDDEN
-        if ((level & 0x7F) == 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n",
-                   level, s->mb_x, s->mb_y);
-            return -1;
-        }
-        /* The code 1000 0000 is not used, the reconstruction level of 1024
-         * being coded as 1111 1111. */
-        if (level == 255)
-            level = 128;
-        block[0] = level;
-        i        = 1;
-    } else if (coded) {
-        // Run  Level   Code
-        // EOB          Not possible for first level when cbp is available (that's why the table is different)
-        // 0    1       1s
-        // *    *       0*
-        int check = show_bits(&s->gb, 2);
-        i = 0;
-        if (check & 0x2) {
-            skip_bits(&s->gb, 2);
-            block[0] = (check & 0x1) ? -1 : 1;
-            i        = 1;
-        }
-    } else {
-        i = 0;
-    }
-    if (!coded) {
-        s->block_last_index[n] = i - 1;
-        return 0;
-    }
-    for (;;) {
-        code = get_vlc2(&s->gb, rl->vlc.table, TCOEFF_VLC_BITS, 2);
-        if (code < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n",
-                   s->mb_x, s->mb_y);
-            return -1;
-        }
-        if (code == rl->n) {
-            /* escape */
-            /* The remaining combinations of (run, level) are encoded with a
-             * 20-bit word consisting of 6 bits escape, 6 bits run and 8 bits
-             * level. */
-            run   = get_bits(&s->gb, 6);
-            level = get_sbits(&s->gb, 8);
-        } else if (code == 0) {
-            break;
-        } else {
-            run   = rl->table_run[code];
-            level = rl->table_level[code];
-            if (get_bits1(&s->gb))
-                level = -level;
-        }
-        i += run;
-        if (i >= 64) {
-            av_log(s->avctx, AV_LOG_ERROR, "run overflow at %dx%d\n",
-                   s->mb_x, s->mb_y);
-            return -1;
-        }
-        j        = scan_table[i];
-        block[j] = level;
-        i++;
-    }
-    s->block_last_index[n] = i - 1;
-    return 0;
-}
-
-static int h261_decode_mb(H261Context *h)
-{
-    MpegEncContext *const s = &h->s;
-    int i, cbp, xy;
-
-    cbp = 63;
-    // Read mba
-    do {
-        h->mba_diff = get_vlc2(&s->gb, h261_mba_vlc.table,
-                               H261_MBA_VLC_BITS, 2);
-
-        /* Check for slice end */
-        /* NOTE: GOB can be empty (no MB data) or exist only of MBA_stuffing */
-        if (h->mba_diff == MBA_STARTCODE) { // start code
-            h->gob_start_code_skipped = 1;
-            return SLICE_END;
-        }
-    } while (h->mba_diff == MBA_STUFFING); // stuffing
-
-    if (h->mba_diff < 0) {
-        if (get_bits_left(&s->gb) <= 7)
-            return SLICE_END;
-
-        av_log(s->avctx, AV_LOG_ERROR, "illegal mba at %d %d\n", s->mb_x, s->mb_y);
-        return SLICE_ERROR;
-    }
-
-    h->mba_diff    += 1;
-    h->current_mba += h->mba_diff;
-
-    if (h->current_mba > MBA_STUFFING)
-        return SLICE_ERROR;
-
-    s->mb_x = ((h->gob_number - 1) % 2) * 11 + ((h->current_mba - 1) % 11);
-    s->mb_y = ((h->gob_number - 1) / 2) * 3 + ((h->current_mba - 1) / 11);
-    xy      = s->mb_x + s->mb_y * s->mb_stride;
-    ff_init_block_index(s);
-    ff_update_block_index(s);
-
-    // Read mtype
-    h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);
-    if (h->mtype < 0 || h->mtype >= FF_ARRAY_ELEMS(ff_h261_mtype_map)) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid mtype index %d\n",
-               h->mtype);
-        return SLICE_ERROR;
-    }
-    h->mtype = ff_h261_mtype_map[h->mtype];
-
-    // Read mquant
-    if (IS_QUANT(h->mtype))
-        ff_set_qscale(s, get_bits(&s->gb, 5));
-
-    s->mb_intra = IS_INTRA4x4(h->mtype);
-
-    // Read mv
-    if (IS_16X16(h->mtype)) {
-        /* Motion vector data is included for all MC macroblocks. MVD is
-         * obtained from the macroblock vector by subtracting the vector
-         * of the preceding macroblock. For this calculation the vector
-         * of the preceding macroblock is regarded as zero in the
-         * following three situations:
-         * 1) evaluating MVD for macroblocks 1, 12 and 23;
-         * 2) evaluating MVD for macroblocks in which MBA does not represent a difference of 1;
-         * 3) MTYPE of the previous macroblock was not MC. */
-        if ((h->current_mba ==  1) || (h->current_mba == 12) ||
-            (h->current_mba == 23) || (h->mba_diff != 1)) {
-            h->current_mv_x = 0;
-            h->current_mv_y = 0;
-        }
-
-        h->current_mv_x = decode_mv_component(&s->gb, h->current_mv_x);
-        h->current_mv_y = decode_mv_component(&s->gb, h->current_mv_y);
-    } else {
-        h->current_mv_x = 0;
-        h->current_mv_y = 0;
-    }
-
-    // Read cbp
-    if (HAS_CBP(h->mtype))
-        cbp = get_vlc2(&s->gb, h261_cbp_vlc.table, H261_CBP_VLC_BITS, 2) + 1;
-
-    if (s->mb_intra) {
-        s->current_picture.mb_type[xy] = MB_TYPE_INTRA;
-        goto intra;
-    }
-
-    //set motion vectors
-    s->mv_dir                      = MV_DIR_FORWARD;
-    s->mv_type                     = MV_TYPE_16X16;
-    s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
-    s->mv[0][0][0]                 = h->current_mv_x * 2; // gets divided by 2 in motion compensation
-    s->mv[0][0][1]                 = h->current_mv_y * 2;
-
-intra:
-    /* decode each block */
-    if (s->mb_intra || HAS_CBP(h->mtype)) {
-        s->dsp.clear_blocks(s->block[0]);
-        for (i = 0; i < 6; i++) {
-            if (h261_decode_block(h, s->block[i], i, cbp & 32) < 0)
-                return SLICE_ERROR;
-            cbp += cbp;
-        }
-    } else {
-        for (i = 0; i < 6; i++)
-            s->block_last_index[i] = -1;
-    }
-
-    ff_MPV_decode_mb(s, s->block);
-
-    return SLICE_OK;
-}
-
-/**
- * Decode the H.261 picture header.
- * @return <0 if no startcode found
- */
-static int h261_decode_picture_header(H261Context *h)
-{
-    MpegEncContext *const s = &h->s;
-    int format, i;
-    uint32_t startcode = 0;
-
-    for (i = get_bits_left(&s->gb); i > 24; i -= 1) {
-        startcode = ((startcode << 1) | get_bits(&s->gb, 1)) & 0x000FFFFF;
-
-        if (startcode == 0x10)
-            break;
-    }
-
-    if (startcode != 0x10) {
-        av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
-        return -1;
-    }
-
-    /* temporal reference */
-    i = get_bits(&s->gb, 5); /* picture timestamp */
-    if (i < (s->picture_number & 31))
-        i += 32;
-    s->picture_number = (s->picture_number & ~31) + i;
-
-    s->avctx->time_base      = (AVRational) { 1001, 30000 };
-
-    /* PTYPE starts here */
-    skip_bits1(&s->gb); /* split screen off */
-    skip_bits1(&s->gb); /* camera  off */
-    skip_bits1(&s->gb); /* freeze picture release off */
-
-    format = get_bits1(&s->gb);
-
-    // only 2 formats possible
-    if (format == 0) { // QCIF
-        s->width     = 176;
-        s->height    = 144;
-        s->mb_width  = 11;
-        s->mb_height = 9;
-    } else { // CIF
-        s->width     = 352;
-        s->height    = 288;
-        s->mb_width  = 22;
-        s->mb_height = 18;
-    }
-
-    s->mb_num = s->mb_width * s->mb_height;
-
-    skip_bits1(&s->gb); /* still image mode off */
-    skip_bits1(&s->gb); /* Reserved */
-
-    /* PEI */
-    while (get_bits1(&s->gb) != 0)
-        skip_bits(&s->gb, 8);
-
-    /* H.261 has no I-frames, but if we pass AV_PICTURE_TYPE_I for the first
-     * frame, the codec crashes if it does not contain all I-blocks
-     * (e.g. when a packet is lost). */
-    s->pict_type = AV_PICTURE_TYPE_P;
-
-    h->gob_number = 0;
-    return 0;
-}
-
-static int h261_decode_gob(H261Context *h)
-{
-    MpegEncContext *const s = &h->s;
-
-    ff_set_qscale(s, s->qscale);
-
-    /* decode mb's */
-    while (h->current_mba <= MBA_STUFFING) {
-        int ret;
-        /* DCT & quantize */
-        ret = h261_decode_mb(h);
-        if (ret < 0) {
-            if (ret == SLICE_END) {
-                h261_decode_mb_skipped(h, h->current_mba, 33);
-                return 0;
-            }
-            av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n",
-                   s->mb_x + s->mb_y * s->mb_stride);
-            return -1;
-        }
-
-        h261_decode_mb_skipped(h,
-                               h->current_mba - h->mba_diff,
-                               h->current_mba - 1);
-    }
-
-    return -1;
-}
-
-/**
- * returns the number of bytes consumed for building the current frame
- */
-static int get_consumed_bytes(MpegEncContext *s, int buf_size)
-{
-    int pos = get_bits_count(&s->gb) >> 3;
-    if (pos == 0)
-        pos = 1;      // avoid infinite loops (i doubt that is needed but ...)
-    if (pos + 10 > buf_size)
-        pos = buf_size;               // oops ;)
-
-    return pos;
-}
-
-static int h261_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    H261Context *h     = avctx->priv_data;
-    MpegEncContext *s  = &h->s;
-    int ret;
-    AVFrame *pict = data;
-
-    av_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
-    av_dlog(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
-    s->flags  = avctx->flags;
-    s->flags2 = avctx->flags2;
-
-    h->gob_start_code_skipped = 0;
-
-retry:
-    init_get_bits(&s->gb, buf, buf_size * 8);
-
-    if (!s->context_initialized)
-        // we need the IDCT permutaton for reading a custom matrix
-        if (ff_MPV_common_init(s) < 0)
-            return -1;
-
-    ret = h261_decode_picture_header(h);
-
-    /* skip if the header was thrashed */
-    if (ret < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
-        return -1;
-    }
-
-    if (s->width != avctx->coded_width || s->height != avctx->coded_height) {
-        ParseContext pc = s->parse_context; // FIXME move this demuxing hack to libavformat
-        s->parse_context.buffer = 0;
-        ff_MPV_common_end(s);
-        s->parse_context = pc;
-    }
-    if (!s->context_initialized) {
-        ret = ff_set_dimensions(avctx, s->width, s->height);
-        if (ret < 0)
-            return ret;
-
-        goto retry;
-    }
-
-    // for skipping the frame
-    s->current_picture.f.pict_type = s->pict_type;
-    s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
-
-    if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
-        (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||
-         avctx->skip_frame >= AVDISCARD_ALL)
-        return get_consumed_bytes(s, buf_size);
-
-    if (ff_MPV_frame_start(s, avctx) < 0)
-        return -1;
-
-    ff_mpeg_er_frame_start(s);
-
-    /* decode each macroblock */
-    s->mb_x = 0;
-    s->mb_y = 0;
-
-    while (h->gob_number < (s->mb_height == 18 ? 12 : 5)) {
-        if (h261_resync(h) < 0)
-            break;
-        h261_decode_gob(h);
-    }
-    ff_MPV_frame_end(s);
-
-    assert(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type);
-    assert(s->current_picture.f.pict_type == s->pict_type);
-
-    if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
-        return ret;
-    ff_print_debug_info(s, s->current_picture_ptr);
-
-    *got_frame = 1;
-
-    return get_consumed_bytes(s, buf_size);
-}
-
-static av_cold int h261_decode_end(AVCodecContext *avctx)
-{
-    H261Context *h    = avctx->priv_data;
-    MpegEncContext *s = &h->s;
-
-    ff_MPV_common_end(s);
-    return 0;
-}
-
-AVCodec ff_h261_decoder = {
-    .name           = "h261",
-    .long_name      = NULL_IF_CONFIG_SMALL("H.261"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H261,
-    .priv_data_size = sizeof(H261Context),
-    .init           = h261_decode_init,
-    .close          = h261_decode_end,
-    .decode         = h261_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/h261enc.c b/deps/libav/libavcodec/h261enc.c
deleted file mode 100644
index 4cff998..0000000
--- a/deps/libav/libavcodec/h261enc.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * H261 encoder
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2004 Maarten Daniels
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.261 encoder.
- */
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h263.h"
-#include "h261.h"
-
-int ff_h261_get_picture_format(int width, int height)
-{
-    // QCIF
-    if (width == 176 && height == 144)
-        return 0;
-    // CIF
-    else if (width == 352 && height == 288)
-        return 1;
-    // ERROR
-    else
-        return -1;
-}
-
-void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number)
-{
-    H261Context *h = (H261Context *)s;
-    int format, temp_ref;
-
-    avpriv_align_put_bits(&s->pb);
-
-    /* Update the pointer to last GOB */
-    s->ptr_lastgob = put_bits_ptr(&s->pb);
-
-    put_bits(&s->pb, 20, 0x10); /* PSC */
-
-    temp_ref = s->picture_number * (int64_t)30000 * s->avctx->time_base.num /
-               (1001 * (int64_t)s->avctx->time_base.den);   // FIXME maybe this should use a timestamp
-    put_sbits(&s->pb, 5, temp_ref); /* TemporalReference */
-
-    put_bits(&s->pb, 1, 0); /* split screen off */
-    put_bits(&s->pb, 1, 0); /* camera  off */
-    put_bits(&s->pb, 1, 0); /* freeze picture release off */
-
-    format = ff_h261_get_picture_format(s->width, s->height);
-
-    put_bits(&s->pb, 1, format); /* 0 == QCIF, 1 == CIF */
-
-    put_bits(&s->pb, 1, 0); /* still image mode */
-    put_bits(&s->pb, 1, 0); /* reserved */
-
-    put_bits(&s->pb, 1, 0); /* no PEI */
-    if (format == 0)
-        h->gob_number = -1;
-    else
-        h->gob_number = 0;
-    h->current_mba = 0;
-}
-
-/**
- * Encode a group of blocks header.
- */
-static void h261_encode_gob_header(MpegEncContext *s, int mb_line)
-{
-    H261Context *h = (H261Context *)s;
-    if (ff_h261_get_picture_format(s->width, s->height) == 0) {
-        h->gob_number += 2; // QCIF
-    } else {
-        h->gob_number++;    // CIF
-    }
-    put_bits(&s->pb, 16, 1);            /* GBSC */
-    put_bits(&s->pb, 4, h->gob_number); /* GN */
-    put_bits(&s->pb, 5, s->qscale);     /* GQUANT */
-    put_bits(&s->pb, 1, 0);             /* no GEI */
-    h->current_mba  = 0;
-    h->previous_mba = 0;
-    h->current_mv_x = 0;
-    h->current_mv_y = 0;
-}
-
-void ff_h261_reorder_mb_index(MpegEncContext *s)
-{
-    int index = s->mb_x + s->mb_y * s->mb_width;
-
-    if (index % 33 == 0)
-        h261_encode_gob_header(s, 0);
-
-    /* for CIF the GOB's are fragmented in the middle of a scanline
-     * that's why we need to adjust the x and y index of the macroblocks */
-    if (ff_h261_get_picture_format(s->width, s->height) == 1) { // CIF
-        s->mb_x  = index % 11;
-        index   /= 11;
-        s->mb_y  = index % 3;
-        index   /= 3;
-        s->mb_x += 11 * (index % 2);
-        index   /= 2;
-        s->mb_y += 3 * index;
-
-        ff_init_block_index(s);
-        ff_update_block_index(s);
-    }
-}
-
-static void h261_encode_motion(H261Context *h, int val)
-{
-    MpegEncContext *const s = &h->s;
-    int sign, code;
-    if (val == 0) {
-        code = 0;
-        put_bits(&s->pb, ff_h261_mv_tab[code][1], ff_h261_mv_tab[code][0]);
-    } else {
-        if (val > 15)
-            val -= 32;
-        if (val < -16)
-            val += 32;
-        sign = val < 0;
-        code = sign ? -val : val;
-        put_bits(&s->pb, ff_h261_mv_tab[code][1], ff_h261_mv_tab[code][0]);
-        put_bits(&s->pb, 1, sign);
-    }
-}
-
-static inline int get_cbp(MpegEncContext *s, int16_t block[6][64])
-{
-    int i, cbp;
-    cbp = 0;
-    for (i = 0; i < 6; i++)
-        if (s->block_last_index[i] >= 0)
-            cbp |= 1 << (5 - i);
-    return cbp;
-}
-
-/**
- * Encode an 8x8 block.
- * @param block the 8x8 block
- * @param n block index (0-3 are luma, 4-5 are chroma)
- */
-static void h261_encode_block(H261Context *h, int16_t *block, int n)
-{
-    MpegEncContext *const s = &h->s;
-    int level, run, i, j, last_index, last_non_zero, sign, slevel, code;
-    RLTable *rl;
-
-    rl = &ff_h261_rl_tcoeff;
-    if (s->mb_intra) {
-        /* DC coef */
-        level = block[0];
-        /* 255 cannot be represented, so we clamp */
-        if (level > 254) {
-            level    = 254;
-            block[0] = 254;
-        }
-        /* 0 cannot be represented also */
-        else if (level < 1) {
-            level    = 1;
-            block[0] = 1;
-        }
-        if (level == 128)
-            put_bits(&s->pb, 8, 0xff);
-        else
-            put_bits(&s->pb, 8, level);
-        i = 1;
-    } else if ((block[0] == 1 || block[0] == -1) &&
-               (s->block_last_index[n] > -1)) {
-        // special case
-        put_bits(&s->pb, 2, block[0] > 0 ? 2 : 3);
-        i = 1;
-    } else {
-        i = 0;
-    }
-
-    /* AC coefs */
-    last_index    = s->block_last_index[n];
-    last_non_zero = i - 1;
-    for (; i <= last_index; i++) {
-        j     = s->intra_scantable.permutated[i];
-        level = block[j];
-        if (level) {
-            run    = i - last_non_zero - 1;
-            sign   = 0;
-            slevel = level;
-            if (level < 0) {
-                sign  = 1;
-                level = -level;
-            }
-            code = get_rl_index(rl, 0 /*no last in H.261, EOB is used*/,
-                                run, level);
-            if (run == 0 && level < 16)
-                code += 1;
-            put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
-            if (code == rl->n) {
-                put_bits(&s->pb, 6, run);
-                assert(slevel != 0);
-                assert(level <= 127);
-                put_sbits(&s->pb, 8, slevel);
-            } else {
-                put_bits(&s->pb, 1, sign);
-            }
-            last_non_zero = i;
-        }
-    }
-    if (last_index > -1)
-        put_bits(&s->pb, rl->table_vlc[0][1], rl->table_vlc[0][0]); // EOB
-}
-
-void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64],
-                       int motion_x, int motion_y)
-{
-    H261Context *h = (H261Context *)s;
-    int mvd, mv_diff_x, mv_diff_y, i, cbp;
-    cbp = 63; // avoid warning
-    mvd = 0;
-
-    h->current_mba++;
-    h->mtype = 0;
-
-    if (!s->mb_intra) {
-        /* compute cbp */
-        cbp = get_cbp(s, block);
-
-        /* mvd indicates if this block is motion compensated */
-        mvd = motion_x | motion_y;
-
-        if ((cbp | mvd | s->dquant) == 0) {
-            /* skip macroblock */
-            s->skip_count++;
-            h->current_mv_x = 0;
-            h->current_mv_y = 0;
-            return;
-        }
-    }
-
-    /* MB is not skipped, encode MBA */
-    put_bits(&s->pb,
-             ff_h261_mba_bits[(h->current_mba - h->previous_mba) - 1],
-             ff_h261_mba_code[(h->current_mba - h->previous_mba) - 1]);
-
-    /* calculate MTYPE */
-    if (!s->mb_intra) {
-        h->mtype++;
-
-        if (mvd || s->loop_filter)
-            h->mtype += 3;
-        if (s->loop_filter)
-            h->mtype += 3;
-        if (cbp || s->dquant)
-            h->mtype++;
-        assert(h->mtype > 1);
-    }
-
-    if (s->dquant)
-        h->mtype++;
-
-    put_bits(&s->pb,
-             ff_h261_mtype_bits[h->mtype],
-             ff_h261_mtype_code[h->mtype]);
-
-    h->mtype = ff_h261_mtype_map[h->mtype];
-
-    if (IS_QUANT(h->mtype)) {
-        ff_set_qscale(s, s->qscale + s->dquant);
-        put_bits(&s->pb, 5, s->qscale);
-    }
-
-    if (IS_16X16(h->mtype)) {
-        mv_diff_x       = (motion_x >> 1) - h->current_mv_x;
-        mv_diff_y       = (motion_y >> 1) - h->current_mv_y;
-        h->current_mv_x = (motion_x >> 1);
-        h->current_mv_y = (motion_y >> 1);
-        h261_encode_motion(h, mv_diff_x);
-        h261_encode_motion(h, mv_diff_y);
-    }
-
-    h->previous_mba = h->current_mba;
-
-    if (HAS_CBP(h->mtype)) {
-        assert(cbp > 0);
-        put_bits(&s->pb,
-                 ff_h261_cbp_tab[cbp - 1][1],
-                 ff_h261_cbp_tab[cbp - 1][0]);
-    }
-    for (i = 0; i < 6; i++)
-        /* encode each block */
-        h261_encode_block(h, block[i], i);
-
-    if ((h->current_mba == 11) || (h->current_mba == 22) ||
-        (h->current_mba == 33) || (!IS_16X16(h->mtype))) {
-        h->current_mv_x = 0;
-        h->current_mv_y = 0;
-    }
-}
-
-av_cold void ff_h261_encode_init(MpegEncContext *s)
-{
-    ff_h261_common_init();
-
-    s->min_qcoeff       = -127;
-    s->max_qcoeff       = 127;
-    s->y_dc_scale_table =
-    s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
-}
-
-FF_MPV_GENERIC_CLASS(h261)
-
-AVCodec ff_h261_encoder = {
-    .name           = "h261",
-    .long_name      = NULL_IF_CONFIG_SMALL("H.261"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H261,
-    .priv_data_size = sizeof(H261Context),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
-                                                     AV_PIX_FMT_NONE },
-    .priv_class     = &h261_class,
-};
diff --git a/deps/libav/libavcodec/h263.c b/deps/libav/libavcodec/h263.c
deleted file mode 100644
index 2fa6ca3..0000000
--- a/deps/libav/libavcodec/h263.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * H263/MPEG4 backend for encoder and decoder
- * Copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support.
- * Copyright (c) 2001 Juan J. Sierralta P
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * h263/mpeg4 codec.
- */
-
-#include <limits.h>
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h263.h"
-#include "h263data.h"
-#include "mathops.h"
-#include "unary.h"
-#include "flv.h"
-#include "mpeg4video.h"
-
-
-uint8_t ff_h263_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
-
-
-void ff_h263_update_motion_val(MpegEncContext * s){
-    const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
-               //FIXME a lot of that is only needed for !low_delay
-    const int wrap = s->b8_stride;
-    const int xy = s->block_index[0];
-
-    s->current_picture.mbskip_table[mb_xy] = s->mb_skipped;
-
-    if(s->mv_type != MV_TYPE_8X8){
-        int motion_x, motion_y;
-        if (s->mb_intra) {
-            motion_x = 0;
-            motion_y = 0;
-        } else if (s->mv_type == MV_TYPE_16X16) {
-            motion_x = s->mv[0][0][0];
-            motion_y = s->mv[0][0][1];
-        } else /*if (s->mv_type == MV_TYPE_FIELD)*/ {
-            int i;
-            motion_x = s->mv[0][0][0] + s->mv[0][1][0];
-            motion_y = s->mv[0][0][1] + s->mv[0][1][1];
-            motion_x = (motion_x>>1) | (motion_x&1);
-            for(i=0; i<2; i++){
-                s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0];
-                s->p_field_mv_table[i][0][mb_xy][1]= s->mv[0][i][1];
-            }
-            s->current_picture.ref_index[0][4*mb_xy    ] =
-            s->current_picture.ref_index[0][4*mb_xy + 1] = s->field_select[0][0];
-            s->current_picture.ref_index[0][4*mb_xy + 2] =
-            s->current_picture.ref_index[0][4*mb_xy + 3] = s->field_select[0][1];
-        }
-
-        /* no update if 8X8 because it has been done during parsing */
-        s->current_picture.motion_val[0][xy][0]            = motion_x;
-        s->current_picture.motion_val[0][xy][1]            = motion_y;
-        s->current_picture.motion_val[0][xy + 1][0]        = motion_x;
-        s->current_picture.motion_val[0][xy + 1][1]        = motion_y;
-        s->current_picture.motion_val[0][xy + wrap][0]     = motion_x;
-        s->current_picture.motion_val[0][xy + wrap][1]     = motion_y;
-        s->current_picture.motion_val[0][xy + 1 + wrap][0] = motion_x;
-        s->current_picture.motion_val[0][xy + 1 + wrap][1] = motion_y;
-    }
-
-    if(s->encoding){ //FIXME encoding MUST be cleaned up
-        if (s->mv_type == MV_TYPE_8X8)
-            s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_8x8;
-        else if(s->mb_intra)
-            s->current_picture.mb_type[mb_xy] = MB_TYPE_INTRA;
-        else
-            s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_16x16;
-    }
-}
-
-int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr)
-{
-    int x, y, wrap, a, c, pred_dc;
-    int16_t *dc_val;
-
-    /* find prediction */
-    if (n < 4) {
-        x = 2 * s->mb_x + (n & 1);
-        y = 2 * s->mb_y + ((n & 2) >> 1);
-        wrap = s->b8_stride;
-        dc_val = s->dc_val[0];
-    } else {
-        x = s->mb_x;
-        y = s->mb_y;
-        wrap = s->mb_stride;
-        dc_val = s->dc_val[n - 4 + 1];
-    }
-    /* B C
-     * A X
-     */
-    a = dc_val[(x - 1) + (y) * wrap];
-    c = dc_val[(x) + (y - 1) * wrap];
-
-    /* No prediction outside GOB boundary */
-    if(s->first_slice_line && n!=3){
-        if(n!=2) c= 1024;
-        if(n!=1 && s->mb_x == s->resync_mb_x) a= 1024;
-    }
-    /* just DC prediction */
-    if (a != 1024 && c != 1024)
-        pred_dc = (a + c) >> 1;
-    else if (a != 1024)
-        pred_dc = a;
-    else
-        pred_dc = c;
-
-    /* we assume pred is positive */
-    *dc_val_ptr = &dc_val[x + y * wrap];
-    return pred_dc;
-}
-
-void ff_h263_loop_filter(MpegEncContext * s){
-    int qp_c;
-    const int linesize  = s->linesize;
-    const int uvlinesize= s->uvlinesize;
-    const int xy = s->mb_y * s->mb_stride + s->mb_x;
-    uint8_t *dest_y = s->dest[0];
-    uint8_t *dest_cb= s->dest[1];
-    uint8_t *dest_cr= s->dest[2];
-
-//    if(s->pict_type==AV_PICTURE_TYPE_B && !s->readable) return;
-
-    /*
-       Diag Top
-       Left Center
-    */
-    if (!IS_SKIP(s->current_picture.mb_type[xy])) {
-        qp_c= s->qscale;
-        s->h263dsp.h263_v_loop_filter(dest_y + 8 * linesize,     linesize, qp_c);
-        s->h263dsp.h263_v_loop_filter(dest_y + 8 * linesize + 8, linesize, qp_c);
-    }else
-        qp_c= 0;
-
-    if(s->mb_y){
-        int qp_dt, qp_tt, qp_tc;
-
-        if (IS_SKIP(s->current_picture.mb_type[xy - s->mb_stride]))
-            qp_tt=0;
-        else
-            qp_tt = s->current_picture.qscale_table[xy - s->mb_stride];
-
-        if(qp_c)
-            qp_tc= qp_c;
-        else
-            qp_tc= qp_tt;
-
-        if(qp_tc){
-            const int chroma_qp= s->chroma_qscale_table[qp_tc];
-            s->h263dsp.h263_v_loop_filter(dest_y,     linesize, qp_tc);
-            s->h263dsp.h263_v_loop_filter(dest_y + 8, linesize, qp_tc);
-
-            s->h263dsp.h263_v_loop_filter(dest_cb, uvlinesize, chroma_qp);
-            s->h263dsp.h263_v_loop_filter(dest_cr, uvlinesize, chroma_qp);
-        }
-
-        if(qp_tt)
-            s->h263dsp.h263_h_loop_filter(dest_y - 8 * linesize + 8, linesize, qp_tt);
-
-        if(s->mb_x){
-            if (qp_tt || IS_SKIP(s->current_picture.mb_type[xy - 1 - s->mb_stride]))
-                qp_dt= qp_tt;
-            else
-                qp_dt = s->current_picture.qscale_table[xy - 1 - s->mb_stride];
-
-            if(qp_dt){
-                const int chroma_qp= s->chroma_qscale_table[qp_dt];
-                s->h263dsp.h263_h_loop_filter(dest_y  - 8 * linesize,   linesize,   qp_dt);
-                s->h263dsp.h263_h_loop_filter(dest_cb - 8 * uvlinesize, uvlinesize, chroma_qp);
-                s->h263dsp.h263_h_loop_filter(dest_cr - 8 * uvlinesize, uvlinesize, chroma_qp);
-            }
-        }
-    }
-
-    if(qp_c){
-        s->h263dsp.h263_h_loop_filter(dest_y + 8, linesize, qp_c);
-        if(s->mb_y + 1 == s->mb_height)
-            s->h263dsp.h263_h_loop_filter(dest_y + 8 * linesize + 8, linesize, qp_c);
-    }
-
-    if(s->mb_x){
-        int qp_lc;
-        if (qp_c || IS_SKIP(s->current_picture.mb_type[xy - 1]))
-            qp_lc= qp_c;
-        else
-            qp_lc = s->current_picture.qscale_table[xy - 1];
-
-        if(qp_lc){
-            s->h263dsp.h263_h_loop_filter(dest_y, linesize, qp_lc);
-            if(s->mb_y + 1 == s->mb_height){
-                const int chroma_qp= s->chroma_qscale_table[qp_lc];
-                s->h263dsp.h263_h_loop_filter(dest_y + 8 * linesize, linesize, qp_lc);
-                s->h263dsp.h263_h_loop_filter(dest_cb, uvlinesize, chroma_qp);
-                s->h263dsp.h263_h_loop_filter(dest_cr, uvlinesize, chroma_qp);
-            }
-        }
-    }
-}
-
-void ff_h263_pred_acdc(MpegEncContext * s, int16_t *block, int n)
-{
-    int x, y, wrap, a, c, pred_dc, scale, i;
-    int16_t *dc_val, *ac_val, *ac_val1;
-
-    /* find prediction */
-    if (n < 4) {
-        x = 2 * s->mb_x + (n & 1);
-        y = 2 * s->mb_y + (n>> 1);
-        wrap = s->b8_stride;
-        dc_val = s->dc_val[0];
-        ac_val = s->ac_val[0][0];
-        scale = s->y_dc_scale;
-    } else {
-        x = s->mb_x;
-        y = s->mb_y;
-        wrap = s->mb_stride;
-        dc_val = s->dc_val[n - 4 + 1];
-        ac_val = s->ac_val[n - 4 + 1][0];
-        scale = s->c_dc_scale;
-    }
-
-    ac_val += ((y) * wrap + (x)) * 16;
-    ac_val1 = ac_val;
-
-    /* B C
-     * A X
-     */
-    a = dc_val[(x - 1) + (y) * wrap];
-    c = dc_val[(x) + (y - 1) * wrap];
-
-    /* No prediction outside GOB boundary */
-    if(s->first_slice_line && n!=3){
-        if(n!=2) c= 1024;
-        if(n!=1 && s->mb_x == s->resync_mb_x) a= 1024;
-    }
-
-    if (s->ac_pred) {
-        pred_dc = 1024;
-        if (s->h263_aic_dir) {
-            /* left prediction */
-            if (a != 1024) {
-                ac_val -= 16;
-                for(i=1;i<8;i++) {
-                    block[s->dsp.idct_permutation[i<<3]] += ac_val[i];
-                }
-                pred_dc = a;
-            }
-        } else {
-            /* top prediction */
-            if (c != 1024) {
-                ac_val -= 16 * wrap;
-                for(i=1;i<8;i++) {
-                    block[s->dsp.idct_permutation[i   ]] += ac_val[i + 8];
-                }
-                pred_dc = c;
-            }
-        }
-    } else {
-        /* just DC prediction */
-        if (a != 1024 && c != 1024)
-            pred_dc = (a + c) >> 1;
-        else if (a != 1024)
-            pred_dc = a;
-        else
-            pred_dc = c;
-    }
-
-    /* we assume pred is positive */
-    block[0]=block[0]*scale + pred_dc;
-
-    if (block[0] < 0)
-        block[0] = 0;
-    else
-        block[0] |= 1;
-
-    /* Update AC/DC tables */
-    dc_val[(x) + (y) * wrap] = block[0];
-
-    /* left copy */
-    for(i=1;i<8;i++)
-        ac_val1[i    ] = block[s->dsp.idct_permutation[i<<3]];
-    /* top copy */
-    for(i=1;i<8;i++)
-        ac_val1[8 + i] = block[s->dsp.idct_permutation[i   ]];
-}
-
-int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir,
-                             int *px, int *py)
-{
-    int wrap;
-    int16_t *A, *B, *C, (*mot_val)[2];
-    static const int off[4]= {2, 1, 1, -1};
-
-    wrap = s->b8_stride;
-    mot_val = s->current_picture.motion_val[dir] + s->block_index[block];
-
-    A = mot_val[ - 1];
-    /* special case for first (slice) line */
-    if (s->first_slice_line && block<3) {
-        // we can't just change some MVs to simulate that as we need them for the B frames (and ME)
-        // and if we ever support non rectangular objects than we need to do a few ifs here anyway :(
-        if(block==0){ //most common case
-            if(s->mb_x  == s->resync_mb_x){ //rare
-                *px= *py = 0;
-            }else if(s->mb_x + 1 == s->resync_mb_x && s->h263_pred){ //rare
-                C = mot_val[off[block] - wrap];
-                if(s->mb_x==0){
-                    *px = C[0];
-                    *py = C[1];
-                }else{
-                    *px = mid_pred(A[0], 0, C[0]);
-                    *py = mid_pred(A[1], 0, C[1]);
-                }
-            }else{
-                *px = A[0];
-                *py = A[1];
-            }
-        }else if(block==1){
-            if(s->mb_x + 1 == s->resync_mb_x && s->h263_pred){ //rare
-                C = mot_val[off[block] - wrap];
-                *px = mid_pred(A[0], 0, C[0]);
-                *py = mid_pred(A[1], 0, C[1]);
-            }else{
-                *px = A[0];
-                *py = A[1];
-            }
-        }else{ /* block==2*/
-            B = mot_val[ - wrap];
-            C = mot_val[off[block] - wrap];
-            if(s->mb_x == s->resync_mb_x) //rare
-                A[0]=A[1]=0;
-
-            *px = mid_pred(A[0], B[0], C[0]);
-            *py = mid_pred(A[1], B[1], C[1]);
-        }
-    } else {
-        B = mot_val[ - wrap];
-        C = mot_val[off[block] - wrap];
-        *px = mid_pred(A[0], B[0], C[0]);
-        *py = mid_pred(A[1], B[1], C[1]);
-    }
-    return *mot_val;
-}
-
-
-/**
- * Get the GOB height based on picture height.
- */
-int ff_h263_get_gob_height(MpegEncContext *s){
-    if (s->height <= 400)
-        return 1;
-    else if (s->height <= 800)
-        return  2;
-    else
-        return 4;
-}
diff --git a/deps/libav/libavcodec/h263.h b/deps/libav/libavcodec/h263.h
deleted file mode 100644
index c6ad618..0000000
--- a/deps/libav/libavcodec/h263.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * H263 internal header
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVCODEC_H263_H
-#define AVCODEC_H263_H
-
-#include <stdint.h>
-#include "libavutil/rational.h"
-#include "get_bits.h"
-#include "mpegvideo.h"
-#include "rl.h"
-
-#if !FF_API_ASPECT_EXTENDED
-#define FF_ASPECT_EXTENDED 15
-#endif
-
-// The defines below define the number of bits that are read at once for
-// reading vlc values. Changing these may improve speed and data cache needs
-// be aware though that decreasing them may need the number of stages that is
-// passed to get_vlc* to be increased.
-#define INTRA_MCBPC_VLC_BITS 6
-#define INTER_MCBPC_VLC_BITS 7
-#define CBPY_VLC_BITS 6
-#define TEX_VLC_BITS 9
-
-extern const AVRational ff_h263_pixel_aspect[16];
-extern const uint8_t ff_h263_cbpy_tab[16][2];
-
-extern const uint8_t ff_cbpc_b_tab[4][2];
-
-extern const uint8_t ff_mvtab[33][2];
-
-extern const uint8_t ff_h263_intra_MCBPC_code[9];
-extern const uint8_t ff_h263_intra_MCBPC_bits[9];
-
-extern const uint8_t ff_h263_inter_MCBPC_code[28];
-extern const uint8_t ff_h263_inter_MCBPC_bits[28];
-extern const uint8_t ff_h263_mbtype_b_tab[15][2];
-
-extern VLC ff_h263_intra_MCBPC_vlc;
-extern VLC ff_h263_inter_MCBPC_vlc;
-extern VLC ff_h263_cbpy_vlc;
-
-extern const uint16_t ff_inter_vlc[103][2];
-extern const int8_t ff_inter_level[102];
-extern const int8_t ff_inter_run[102];
-
-extern RLTable ff_h263_rl_inter;
-
-extern RLTable ff_rl_intra_aic;
-
-extern const uint16_t ff_h263_format[8][2];
-extern const uint8_t ff_modified_quant_tab[2][32];
-extern uint16_t ff_mba_max[6];
-extern uint8_t ff_mba_length[7];
-
-extern uint8_t ff_h263_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
-
-extern const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[];
-
-
-int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code);
-av_const int ff_h263_aspect_to_info(AVRational aspect);
-int ff_h263_decode_init(AVCodecContext *avctx);
-int ff_h263_decode_frame(AVCodecContext *avctx,
-                             void *data, int *got_frame,
-                             AVPacket *avpkt);
-int ff_h263_decode_end(AVCodecContext *avctx);
-void ff_h263_encode_mb(MpegEncContext *s,
-                       int16_t block[6][64],
-                       int motion_x, int motion_y);
-void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number);
-void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line);
-int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir,
-                             int *px, int *py);
-void ff_h263_encode_init(MpegEncContext *s);
-void ff_h263_decode_init_vlc(void);
-int ff_h263_decode_picture_header(MpegEncContext *s);
-int ff_h263_decode_gob_header(MpegEncContext *s);
-void ff_h263_update_motion_val(MpegEncContext * s);
-void ff_h263_loop_filter(MpegEncContext * s);
-int ff_h263_decode_mba(MpegEncContext *s);
-void ff_h263_encode_mba(MpegEncContext *s);
-void ff_init_qscale_tab(MpegEncContext *s);
-int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr);
-void ff_h263_pred_acdc(MpegEncContext * s, int16_t *block, int n);
-
-
-/**
- * Print picture info if FF_DEBUG_PICT_INFO is set.
- */
-void ff_h263_show_pict_info(MpegEncContext *s);
-
-int ff_intel_h263_decode_picture_header(MpegEncContext *s);
-int ff_h263_decode_mb(MpegEncContext *s,
-                      int16_t block[6][64]);
-
-/**
- * Return the value of the 3bit "source format" syntax element.
- * This represents some standard picture dimensions or indicates that
- * width&height are explicitly stored later.
- */
-int av_const h263_get_picture_format(int width, int height);
-
-void ff_clean_h263_qscales(MpegEncContext *s);
-int ff_h263_resync(MpegEncContext *s);
-const uint8_t *ff_h263_find_resync_marker(const uint8_t *p, const uint8_t *end);
-int ff_h263_get_gob_height(MpegEncContext *s);
-void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code);
-
-
-static inline int h263_get_motion_length(MpegEncContext * s, int val, int f_code){
-    int l, bit_size, code;
-
-    if (val == 0) {
-        return ff_mvtab[0][1];
-    } else {
-        bit_size = f_code - 1;
-        /* modulo encoding */
-        l= INT_BIT - 6 - bit_size;
-        val = (val<<l)>>l;
-        val--;
-        code = (val >> bit_size) + 1;
-
-        return ff_mvtab[code][1] + 1 + bit_size;
-    }
-}
-
-static inline void ff_h263_encode_motion_vector(MpegEncContext * s, int x, int y, int f_code){
-    if(s->flags2 & CODEC_FLAG2_NO_OUTPUT){
-        skip_put_bits(&s->pb,
-            h263_get_motion_length(s, x, f_code)
-           +h263_get_motion_length(s, y, f_code));
-    }else{
-        ff_h263_encode_motion(s, x, f_code);
-        ff_h263_encode_motion(s, y, f_code);
-    }
-}
-
-static inline int get_p_cbp(MpegEncContext * s,
-                      int16_t block[6][64],
-                      int motion_x, int motion_y){
-    int cbp, i;
-
-    if (s->mpv_flags & FF_MPV_FLAG_CBP_RD) {
-        int best_cbpy_score= INT_MAX;
-        int best_cbpc_score= INT_MAX;
-        int cbpc = (-1), cbpy= (-1);
-        const int offset= (s->mv_type==MV_TYPE_16X16 ? 0 : 16) + (s->dquant ? 8 : 0);
-        const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
-
-        for(i=0; i<4; i++){
-            int score= ff_h263_inter_MCBPC_bits[i + offset] * lambda;
-            if(i&1) score += s->coded_score[5];
-            if(i&2) score += s->coded_score[4];
-
-            if(score < best_cbpc_score){
-                best_cbpc_score= score;
-                cbpc= i;
-            }
-        }
-
-        for(i=0; i<16; i++){
-            int score= ff_h263_cbpy_tab[i ^ 0xF][1] * lambda;
-            if(i&1) score += s->coded_score[3];
-            if(i&2) score += s->coded_score[2];
-            if(i&4) score += s->coded_score[1];
-            if(i&8) score += s->coded_score[0];
-
-            if(score < best_cbpy_score){
-                best_cbpy_score= score;
-                cbpy= i;
-            }
-        }
-        cbp= cbpc + 4*cbpy;
-        if ((motion_x | motion_y | s->dquant) == 0 && s->mv_type==MV_TYPE_16X16){
-            if(best_cbpy_score + best_cbpc_score + 2*lambda >= 0)
-                cbp= 0;
-        }
-
-        for (i = 0; i < 6; i++) {
-            if (s->block_last_index[i] >= 0 && ((cbp >> (5 - i))&1)==0 ){
-                s->block_last_index[i]= -1;
-                s->dsp.clear_block(s->block[i]);
-            }
-        }
-    }else{
-        cbp= 0;
-        for (i = 0; i < 6; i++) {
-            if (s->block_last_index[i] >= 0)
-                cbp |= 1 << (5 - i);
-        }
-    }
-    return cbp;
-}
-
-static inline void memsetw(short *tab, int val, int n)
-{
-    int i;
-    for(i=0;i<n;i++)
-        tab[i] = val;
-}
-
-#endif /* AVCODEC_H263_H */
diff --git a/deps/libav/libavcodec/h263_parser.c b/deps/libav/libavcodec/h263_parser.c
deleted file mode 100644
index 71e047a..0000000
--- a/deps/libav/libavcodec/h263_parser.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * H.263 parser
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.263 parser
- */
-
-#include "parser.h"
-#include "h263_parser.h"
-
-int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
-    int vop_found, i;
-    uint32_t state;
-
-    vop_found= pc->frame_start_found;
-    state= pc->state;
-
-    i=0;
-    if(!vop_found){
-        for(i=0; i<buf_size; i++){
-            state= (state<<8) | buf[i];
-            if(state>>(32-22) == 0x20){
-                i++;
-                vop_found=1;
-                break;
-            }
-        }
-    }
-
-    if(vop_found){
-      for(; i<buf_size; i++){
-        state= (state<<8) | buf[i];
-        if(state>>(32-22) == 0x20){
-            pc->frame_start_found=0;
-            pc->state=-1;
-            return i-3;
-        }
-      }
-    }
-    pc->frame_start_found= vop_found;
-    pc->state= state;
-
-    return END_NOT_FOUND;
-}
-
-static int h263_parse(AVCodecParserContext *s,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
-{
-    ParseContext *pc = s->priv_data;
-    int next;
-
-    next= ff_h263_find_frame_end(pc, buf, buf_size);
-
-    if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-        *poutbuf = NULL;
-        *poutbuf_size = 0;
-        return buf_size;
-    }
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_h263_parser = {
-    .codec_ids      = { AV_CODEC_ID_H263 },
-    .priv_data_size = sizeof(ParseContext),
-    .parser_parse   = h263_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/h263_parser.h b/deps/libav/libavcodec/h263_parser.h
deleted file mode 100644
index 5bd715f..0000000
--- a/deps/libav/libavcodec/h263_parser.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * H.263 parser
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_H263_PARSER_H
-#define AVCODEC_H263_PARSER_H
-
-#include "parser.h"
-
-int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
-
-#endif /* AVCODEC_H263_PARSER_H */
diff --git a/deps/libav/libavcodec/h263data.h b/deps/libav/libavcodec/h263data.h
deleted file mode 100644
index c966aab..0000000
--- a/deps/libav/libavcodec/h263data.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support
- * copyright (c) 2001 Juan J. Sierralta P
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.263 tables.
- */
-
-#ifndef AVCODEC_H263DATA_H
-#define AVCODEC_H263DATA_H
-
-#include <stdint.h>
-#include "mpegvideo.h"
-
-/* intra MCBPC, mb_type = (intra), then (intraq) */
-const uint8_t ff_h263_intra_MCBPC_code[9] = { 1, 1, 2, 3, 1, 1, 2, 3, 1 };
-const uint8_t ff_h263_intra_MCBPC_bits[9] = { 1, 3, 3, 3, 4, 6, 6, 6, 9 };
-
-/* inter MCBPC, mb_type = (inter), (intra), (interq), (intraq), (inter4v) */
-/* Changed the tables for interq and inter4v+q, following the standard ** Juanjo ** */
-const uint8_t ff_h263_inter_MCBPC_code[28] = {
-    1, 3, 2, 5,
-    3, 4, 3, 3,
-    3, 7, 6, 5,
-    4, 4, 3, 2,
-    2, 5, 4, 5,
-    1, 0, 0, 0, /* Stuffing */
-    2, 12, 14, 15,
-};
-const uint8_t ff_h263_inter_MCBPC_bits[28] = {
-    1, 4, 4, 6, /* inter  */
-    5, 8, 8, 7, /* intra  */
-    3, 7, 7, 9, /* interQ */
-    6, 9, 9, 9, /* intraQ */
-    3, 7, 7, 8, /* inter4 */
-    9, 0, 0, 0, /* Stuffing */
-    11, 13, 13, 13,/* inter4Q*/
-};
-
-const uint8_t ff_h263_mbtype_b_tab[15][2] = {
- {1, 1},
- {3, 3},
- {1, 5},
- {4, 4},
- {5, 4},
- {6, 6},
- {2, 4},
- {3, 4},
- {7, 6},
- {4, 6},
- {5, 6},
- {1, 6},
- {1,10},
- {1, 7},
- {1, 8},
-};
-
-const uint8_t ff_cbpc_b_tab[4][2] = {
-{0, 1},
-{2, 2},
-{7, 3},
-{6, 3},
-};
-
-const uint8_t ff_h263_cbpy_tab[16][2] =
-{
-  {3,4}, {5,5}, {4,5}, {9,4}, {3,5}, {7,4}, {2,6}, {11,4},
-  {2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2}
-};
-
-const uint8_t ff_mvtab[33][2] =
-{
-  {1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7},
-  {11,9}, {10,9}, {9,9}, {17,10}, {16,10}, {15,10}, {14,10}, {13,10},
-  {12,10}, {11,10}, {10,10}, {9,10}, {8,10}, {7,10}, {6,10}, {5,10},
-  {4,10}, {7,11}, {6,11}, {5,11}, {4,11}, {3,11}, {2,11}, {3,12},
-  {2,12}
-};
-
-/* third non intra table */
-const uint16_t ff_inter_vlc[103][2] = {
-{ 0x2, 2 },{ 0xf, 4 },{ 0x15, 6 },{ 0x17, 7 },
-{ 0x1f, 8 },{ 0x25, 9 },{ 0x24, 9 },{ 0x21, 10 },
-{ 0x20, 10 },{ 0x7, 11 },{ 0x6, 11 },{ 0x20, 11 },
-{ 0x6, 3 },{ 0x14, 6 },{ 0x1e, 8 },{ 0xf, 10 },
-{ 0x21, 11 },{ 0x50, 12 },{ 0xe, 4 },{ 0x1d, 8 },
-{ 0xe, 10 },{ 0x51, 12 },{ 0xd, 5 },{ 0x23, 9 },
-{ 0xd, 10 },{ 0xc, 5 },{ 0x22, 9 },{ 0x52, 12 },
-{ 0xb, 5 },{ 0xc, 10 },{ 0x53, 12 },{ 0x13, 6 },
-{ 0xb, 10 },{ 0x54, 12 },{ 0x12, 6 },{ 0xa, 10 },
-{ 0x11, 6 },{ 0x9, 10 },{ 0x10, 6 },{ 0x8, 10 },
-{ 0x16, 7 },{ 0x55, 12 },{ 0x15, 7 },{ 0x14, 7 },
-{ 0x1c, 8 },{ 0x1b, 8 },{ 0x21, 9 },{ 0x20, 9 },
-{ 0x1f, 9 },{ 0x1e, 9 },{ 0x1d, 9 },{ 0x1c, 9 },
-{ 0x1b, 9 },{ 0x1a, 9 },{ 0x22, 11 },{ 0x23, 11 },
-{ 0x56, 12 },{ 0x57, 12 },{ 0x7, 4 },{ 0x19, 9 },
-{ 0x5, 11 },{ 0xf, 6 },{ 0x4, 11 },{ 0xe, 6 },
-{ 0xd, 6 },{ 0xc, 6 },{ 0x13, 7 },{ 0x12, 7 },
-{ 0x11, 7 },{ 0x10, 7 },{ 0x1a, 8 },{ 0x19, 8 },
-{ 0x18, 8 },{ 0x17, 8 },{ 0x16, 8 },{ 0x15, 8 },
-{ 0x14, 8 },{ 0x13, 8 },{ 0x18, 9 },{ 0x17, 9 },
-{ 0x16, 9 },{ 0x15, 9 },{ 0x14, 9 },{ 0x13, 9 },
-{ 0x12, 9 },{ 0x11, 9 },{ 0x7, 10 },{ 0x6, 10 },
-{ 0x5, 10 },{ 0x4, 10 },{ 0x24, 11 },{ 0x25, 11 },
-{ 0x26, 11 },{ 0x27, 11 },{ 0x58, 12 },{ 0x59, 12 },
-{ 0x5a, 12 },{ 0x5b, 12 },{ 0x5c, 12 },{ 0x5d, 12 },
-{ 0x5e, 12 },{ 0x5f, 12 },{ 0x3, 7 },
-};
-
-const int8_t ff_inter_level[102] = {
-  1,  2,  3,  4,  5,  6,  7,  8,
-  9, 10, 11, 12,  1,  2,  3,  4,
-  5,  6,  1,  2,  3,  4,  1,  2,
-  3,  1,  2,  3,  1,  2,  3,  1,
-  2,  3,  1,  2,  1,  2,  1,  2,
-  1,  2,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  2,  3,  1,  2,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,
-};
-
-const int8_t ff_inter_run[102] = {
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  1,  1,  1,  1,
-  1,  1,  2,  2,  2,  2,  3,  3,
-  3,  4,  4,  4,  5,  5,  5,  6,
-  6,  6,  7,  7,  8,  8,  9,  9,
- 10, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26,  0,  0,  0,  1,  1,  2,
-  3,  4,  5,  6,  7,  8,  9, 10,
- 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40,
-};
-
-RLTable ff_h263_rl_inter = {
-    102,
-    58,
-    ff_inter_vlc,
-    ff_inter_run,
-    ff_inter_level,
-};
-
-static const uint16_t intra_vlc_aic[103][2] = {
-{  0x2,  2 }, {  0x6,  3 }, {  0xe,  4 }, {  0xc,  5 },
-{  0xd,  5 }, { 0x10,  6 }, { 0x11,  6 }, { 0x12,  6 },
-{ 0x16,  7 }, { 0x1b,  8 }, { 0x20,  9 }, { 0x21,  9 },
-{ 0x1a,  9 }, { 0x1b,  9 }, { 0x1c,  9 }, { 0x1d,  9 },
-{ 0x1e,  9 }, { 0x1f,  9 }, { 0x23, 11 }, { 0x22, 11 },
-{ 0x57, 12 }, { 0x56, 12 }, { 0x55, 12 }, { 0x54, 12 },
-{ 0x53, 12 }, {  0xf,  4 }, { 0x14,  6 }, { 0x14,  7 },
-{ 0x1e,  8 }, {  0xf, 10 }, { 0x21, 11 }, { 0x50, 12 },
-{  0xb,  5 }, { 0x15,  7 }, {  0xe, 10 }, {  0x9, 10 },
-{ 0x15,  6 }, { 0x1d,  8 }, {  0xd, 10 }, { 0x51, 12 },
-{ 0x13,  6 }, { 0x23,  9 }, {  0x7, 11 }, { 0x17,  7 },
-{ 0x22,  9 }, { 0x52, 12 }, { 0x1c,  8 }, {  0xc, 10 },
-{ 0x1f,  8 }, {  0xb, 10 }, { 0x25,  9 }, {  0xa, 10 },
-{ 0x24,  9 }, {  0x6, 11 }, { 0x21, 10 }, { 0x20, 10 },
-{  0x8, 10 }, { 0x20, 11 }, {  0x7,  4 }, {  0xc,  6 },
-{ 0x10,  7 }, { 0x13,  8 }, { 0x11,  9 }, { 0x12,  9 },
-{  0x4, 10 }, { 0x27, 11 }, { 0x26, 11 }, { 0x5f, 12 },
-{  0xf,  6 }, { 0x13,  9 }, {  0x5, 10 }, { 0x25, 11 },
-{  0xe,  6 }, { 0x14,  9 }, { 0x24, 11 }, {  0xd,  6 },
-{  0x6, 10 }, { 0x5e, 12 }, { 0x11,  7 }, {  0x7, 10 },
-{ 0x13,  7 }, { 0x5d, 12 }, { 0x12,  7 }, { 0x5c, 12 },
-{ 0x14,  8 }, { 0x5b, 12 }, { 0x15,  8 }, { 0x1a,  8 },
-{ 0x19,  8 }, { 0x18,  8 }, { 0x17,  8 }, { 0x16,  8 },
-{ 0x19,  9 }, { 0x15,  9 }, { 0x16,  9 }, { 0x18,  9 },
-{ 0x17,  9 }, {  0x4, 11 }, {  0x5, 11 }, { 0x58, 12 },
-{ 0x59, 12 }, { 0x5a, 12 }, {  0x3,  7 },
-};
-
-static const int8_t intra_run_aic[102] = {
- 0,  0,  0,  0,  0,  0,  0,  0,
- 0,  0,  0,  0,  0,  0,  0,  0,
- 0,  0,  0,  0,  0,  0,  0,  0,
- 0,  1,  1,  1,  1,  1,  1,  1,
- 2,  2,  2,  2,  3,  3,  3,  3,
- 4,  4,  4,  5,  5,  5,  6,  6,
- 7,  7,  8,  8,  9,  9, 10, 11,
-12, 13,  0,  0,  0,  0,  0,  0,
- 0,  0,  0,  0,  1,  1,  1,  1,
- 2,  2,  2,  3,  3,  3,  4,  4,
- 5,  5,  6,  6,  7,  7,  8,  9,
-10, 11, 12, 13, 14, 15, 16, 17,
-18, 19, 20, 21, 22, 23,
-};
-
-static const int8_t intra_level_aic[102] = {
- 1,  2,  3,  4,  5,  6,  7,  8,
- 9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19, 20, 21, 22, 23, 24,
-25,  1,  2,  3,  4,  5,  6,  7,
- 1,  2,  3,  4,  1,  2,  3,  4,
- 1,  2,  3,  1,  2,  3,  1,  2,
- 1,  2,  1,  2,  1,  2,  1,  1,
- 1,  1,  1,  2,  3,  4,  5,  6,
- 7,  8,  9, 10,  1,  2,  3,  4,
- 1,  2,  3,  1,  2,  3,  1,  2,
- 1,  2,  1,  2,  1,  2,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,
-};
-
-RLTable ff_rl_intra_aic = {
-    102,
-    58,
-    intra_vlc_aic,
-    intra_run_aic,
-    intra_level_aic,
-};
-
-const uint16_t ff_h263_format[8][2] = {
-    { 0, 0 },
-    { 128, 96 },
-    { 176, 144 },
-    { 352, 288 },
-    { 704, 576 },
-    { 1408, 1152 },
-};
-
-const uint8_t ff_aic_dc_scale_table[32]={
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-    0, 2, 4, 6, 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
-};
-
-const uint8_t ff_modified_quant_tab[2][32]={
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-{
-    0, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9,10,11,12,13,14,15,16,17,18,18,19,20,21,22,23,24,25,26,27,28
-},{
-    0, 2, 3, 4, 5, 6, 7, 8, 9,10,11,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,31,31,26
-}
-};
-
-const uint8_t ff_h263_chroma_qscale_table[32]={
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-    0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 9,10,10,11,11,12,12,12,13,13,13,14,14,14,14,14,15,15,15,15,15
-};
-
-uint16_t ff_mba_max[6]={
-     47,  98, 395,1583,6335,9215
-};
-
-uint8_t ff_mba_length[7]={
-      6,   7,   9,  11,  13,  14,  14
-};
-
-const AVRational ff_h263_pixel_aspect[16]={
- {0, 1},
- {1, 1},
- {12, 11},
- {10, 11},
- {16, 11},
- {40, 33},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
-};
-
-#endif /* AVCODEC_H263DATA_H */
diff --git a/deps/libav/libavcodec/h263dec.c b/deps/libav/libavcodec/h263dec.c
deleted file mode 100644
index 6c2f322..0000000
--- a/deps/libav/libavcodec/h263dec.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- * H.263 decoder
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.263 decoder.
- */
-
-#include "libavutil/cpu.h"
-#include "avcodec.h"
-#include "error_resilience.h"
-#include "flv.h"
-#include "h263.h"
-#include "h263_parser.h"
-#include "internal.h"
-#include "mpeg4video.h"
-#include "mpeg4video_parser.h"
-#include "mpegvideo.h"
-#include "msmpeg4.h"
-#include "thread.h"
-
-av_cold int ff_h263_decode_init(AVCodecContext *avctx)
-{
-    MpegEncContext *s = avctx->priv_data;
-    int ret;
-
-    s->avctx           = avctx;
-    s->out_format      = FMT_H263;
-    s->width           = avctx->coded_width;
-    s->height          = avctx->coded_height;
-    s->workaround_bugs = avctx->workaround_bugs;
-
-    // set defaults
-    ff_MPV_decode_defaults(s);
-    s->quant_precision = 5;
-    s->decode_mb       = ff_h263_decode_mb;
-    s->low_delay       = 1;
-    if (avctx->codec->id == AV_CODEC_ID_MSS2)
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    else
-        avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);
-    s->unrestricted_mv = 1;
-
-    /* select sub codec */
-    switch (avctx->codec->id) {
-    case AV_CODEC_ID_H263:
-        s->unrestricted_mv = 0;
-        avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
-        break;
-    case AV_CODEC_ID_MPEG4:
-        break;
-    case AV_CODEC_ID_MSMPEG4V1:
-        s->h263_pred       = 1;
-        s->msmpeg4_version = 1;
-        break;
-    case AV_CODEC_ID_MSMPEG4V2:
-        s->h263_pred       = 1;
-        s->msmpeg4_version = 2;
-        break;
-    case AV_CODEC_ID_MSMPEG4V3:
-        s->h263_pred       = 1;
-        s->msmpeg4_version = 3;
-        break;
-    case AV_CODEC_ID_WMV1:
-        s->h263_pred       = 1;
-        s->msmpeg4_version = 4;
-        break;
-    case AV_CODEC_ID_WMV2:
-        s->h263_pred       = 1;
-        s->msmpeg4_version = 5;
-        break;
-    case AV_CODEC_ID_VC1:
-    case AV_CODEC_ID_WMV3:
-    case AV_CODEC_ID_VC1IMAGE:
-    case AV_CODEC_ID_WMV3IMAGE:
-    case AV_CODEC_ID_MSS2:
-        s->h263_pred       = 1;
-        s->msmpeg4_version = 6;
-        avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
-        break;
-    case AV_CODEC_ID_H263I:
-        break;
-    case AV_CODEC_ID_FLV1:
-        s->h263_flv = 1;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unsupported codec %d\n",
-               avctx->codec->id);
-        return AVERROR(ENOSYS);
-    }
-    s->codec_id    = avctx->codec->id;
-    avctx->hwaccel = ff_find_hwaccel(avctx);
-
-    /* for h263, we allocate the images after having read the header */
-    if (avctx->codec->id != AV_CODEC_ID_H263 &&
-        avctx->codec->id != AV_CODEC_ID_MPEG4)
-        if ((ret = ff_MPV_common_init(s)) < 0)
-            return ret;
-
-    ff_h263dsp_init(&s->h263dsp);
-    ff_h263_decode_init_vlc();
-
-    return 0;
-}
-
-av_cold int ff_h263_decode_end(AVCodecContext *avctx)
-{
-    MpegEncContext *s = avctx->priv_data;
-
-    ff_MPV_common_end(s);
-    return 0;
-}
-
-/**
- * Return the number of bytes consumed for building the current frame.
- */
-static int get_consumed_bytes(MpegEncContext *s, int buf_size)
-{
-    int pos = (get_bits_count(&s->gb) + 7) >> 3;
-
-    if (s->divx_packed || s->avctx->hwaccel) {
-        /* We would have to scan through the whole buf to handle the weird
-         * reordering ... */
-        return buf_size;
-    } else if (s->flags & CODEC_FLAG_TRUNCATED) {
-        pos -= s->parse_context.last_index;
-        // padding is not really read so this might be -1
-        if (pos < 0)
-            pos = 0;
-        return pos;
-    } else {
-        // avoid infinite loops (maybe not needed...)
-        if (pos == 0)
-            pos = 1;
-        // oops ;)
-        if (pos + 10 > buf_size)
-            pos = buf_size;
-
-        return pos;
-    }
-}
-
-static int decode_slice(MpegEncContext *s)
-{
-    const int part_mask = s->partitioned_frame
-                          ? (ER_AC_END | ER_AC_ERROR) : 0x7F;
-    const int mb_size = 16;
-    int ret;
-
-    s->last_resync_gb   = s->gb;
-    s->first_slice_line = 1;
-    s->resync_mb_x      = s->mb_x;
-    s->resync_mb_y      = s->mb_y;
-
-    ff_set_qscale(s, s->qscale);
-
-    if (s->avctx->hwaccel) {
-        const uint8_t *start = s->gb.buffer + get_bits_count(&s->gb) / 8;
-        const uint8_t *end   = ff_h263_find_resync_marker(start + 1,
-                                                          s->gb.buffer_end);
-        skip_bits_long(&s->gb, 8 * (end - start));
-        return s->avctx->hwaccel->decode_slice(s->avctx, start, end - start);
-    }
-
-    if (s->partitioned_frame) {
-        const int qscale = s->qscale;
-
-        if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4)
-            if ((ret = ff_mpeg4_decode_partitions(s->avctx->priv_data)) < 0)
-                return ret;
-
-        /* restore variables which were modified */
-        s->first_slice_line = 1;
-        s->mb_x             = s->resync_mb_x;
-        s->mb_y             = s->resync_mb_y;
-        ff_set_qscale(s, qscale);
-    }
-
-    for (; s->mb_y < s->mb_height; s->mb_y++) {
-        /* per-row end of slice checks */
-        if (s->msmpeg4_version) {
-            if (s->resync_mb_y + s->slice_height == s->mb_y) {
-                ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                                s->mb_x - 1, s->mb_y, ER_MB_END);
-
-                return 0;
-            }
-        }
-
-        if (s->msmpeg4_version == 1) {
-            s->last_dc[0] =
-            s->last_dc[1] =
-            s->last_dc[2] = 128;
-        }
-
-        ff_init_block_index(s);
-        for (; s->mb_x < s->mb_width; s->mb_x++) {
-            int ret;
-
-            ff_update_block_index(s);
-
-            if (s->resync_mb_x == s->mb_x && s->resync_mb_y + 1 == s->mb_y)
-                s->first_slice_line = 0;
-
-            /* DCT & quantize */
-
-            s->mv_dir  = MV_DIR_FORWARD;
-            s->mv_type = MV_TYPE_16X16;
-            av_dlog(s, "%d %d %06X\n",
-                    ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
-            ret = s->decode_mb(s, s->block);
-
-            if (s->pict_type != AV_PICTURE_TYPE_B)
-                ff_h263_update_motion_val(s);
-
-            if (ret < 0) {
-                const int xy = s->mb_x + s->mb_y * s->mb_stride;
-                if (ret == SLICE_END) {
-                    ff_MPV_decode_mb(s, s->block);
-                    if (s->loop_filter)
-                        ff_h263_loop_filter(s);
-
-                    ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                                    s->mb_x, s->mb_y, ER_MB_END & part_mask);
-
-                    s->padding_bug_score--;
-
-                    if (++s->mb_x >= s->mb_width) {
-                        s->mb_x = 0;
-                        ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
-                        ff_MPV_report_decode_progress(s);
-                        s->mb_y++;
-                    }
-                    return 0;
-                } else if (ret == SLICE_NOEND) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "Slice mismatch at MB: %d\n", xy);
-                    ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                                    s->mb_x + 1, s->mb_y,
-                                    ER_MB_END & part_mask);
-                    return AVERROR_INVALIDDATA;
-                }
-                av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", xy);
-                ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                                s->mb_x, s->mb_y, ER_MB_ERROR & part_mask);
-
-                return AVERROR_INVALIDDATA;
-            }
-
-            ff_MPV_decode_mb(s, s->block);
-            if (s->loop_filter)
-                ff_h263_loop_filter(s);
-        }
-
-        ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
-        ff_MPV_report_decode_progress(s);
-
-        s->mb_x = 0;
-    }
-
-    assert(s->mb_x == 0 && s->mb_y == s->mb_height);
-
-    if (s->codec_id == AV_CODEC_ID_MPEG4         &&
-        (s->workaround_bugs & FF_BUG_AUTODETECT) &&
-        get_bits_left(&s->gb) >= 48              &&
-        show_bits(&s->gb, 24) == 0x4010          &&
-        !s->data_partitioning)
-        s->padding_bug_score += 32;
-
-    /* try to detect the padding bug */
-    if (s->codec_id == AV_CODEC_ID_MPEG4         &&
-        (s->workaround_bugs & FF_BUG_AUTODETECT) &&
-        get_bits_left(&s->gb) >= 0               &&
-        get_bits_left(&s->gb) < 48               &&
-        !s->data_partitioning) {
-        const int bits_count = get_bits_count(&s->gb);
-        const int bits_left  = s->gb.size_in_bits - bits_count;
-
-        if (bits_left == 0) {
-            s->padding_bug_score += 16;
-        } else if (bits_left != 1) {
-            int v = show_bits(&s->gb, 8);
-            v |= 0x7F >> (7 - (bits_count & 7));
-
-            if (v == 0x7F && bits_left <= 8)
-                s->padding_bug_score--;
-            else if (v == 0x7F && ((get_bits_count(&s->gb) + 8) & 8) &&
-                     bits_left <= 16)
-                s->padding_bug_score += 4;
-            else
-                s->padding_bug_score++;
-        }
-    }
-
-    if (s->workaround_bugs & FF_BUG_AUTODETECT) {
-        if (s->padding_bug_score > -2 && !s->data_partitioning)
-            s->workaround_bugs |= FF_BUG_NO_PADDING;
-        else
-            s->workaround_bugs &= ~FF_BUG_NO_PADDING;
-    }
-
-    // handle formats which don't have unique end markers
-    if (s->msmpeg4_version || (s->workaround_bugs & FF_BUG_NO_PADDING)) { // FIXME perhaps solve this more cleanly
-        int left      = get_bits_left(&s->gb);
-        int max_extra = 7;
-
-        /* no markers in M$ crap */
-        if (s->msmpeg4_version && s->pict_type == AV_PICTURE_TYPE_I)
-            max_extra += 17;
-
-        /* buggy padding but the frame should still end approximately at
-         * the bitstream end */
-        if ((s->workaround_bugs & FF_BUG_NO_PADDING) &&
-            (s->err_recognition & AV_EF_BUFFER))
-            max_extra += 48;
-        else if ((s->workaround_bugs & FF_BUG_NO_PADDING))
-            max_extra += 256 * 256 * 256 * 64;
-
-        if (left > max_extra)
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "discarding %d junk bits at end, next would be %X\n",
-                   left, show_bits(&s->gb, 24));
-        else if (left < 0)
-            av_log(s->avctx, AV_LOG_ERROR, "overreading %d bits\n", -left);
-        else
-            ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                            s->mb_x - 1, s->mb_y, ER_MB_END);
-
-        return 0;
-    }
-
-    av_log(s->avctx, AV_LOG_ERROR,
-           "slice end not reached but screenspace end (%d left %06X, score= %d)\n",
-           get_bits_left(&s->gb), show_bits(&s->gb, 24), s->padding_bug_score);
-
-    ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y,
-                    ER_MB_END & part_mask);
-
-    return AVERROR_INVALIDDATA;
-}
-
-int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                         AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    MpegEncContext *s  = avctx->priv_data;
-    int ret;
-    AVFrame *pict = data;
-
-    s->flags  = avctx->flags;
-    s->flags2 = avctx->flags2;
-
-    /* no supplementary picture */
-    if (buf_size == 0) {
-        /* special case for last picture */
-        if (s->low_delay == 0 && s->next_picture_ptr) {
-            if ((ret = av_frame_ref(pict, &s->next_picture_ptr->f)) < 0)
-                return ret;
-            s->next_picture_ptr = NULL;
-
-            *got_frame = 1;
-        }
-
-        return 0;
-    }
-
-    if (s->flags & CODEC_FLAG_TRUNCATED) {
-        int next;
-
-        if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) {
-            next = ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size);
-        } else if (CONFIG_H263_DECODER && s->codec_id == AV_CODEC_ID_H263) {
-            next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size);
-        } else {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "this codec does not support truncated bitstreams\n");
-            return AVERROR(ENOSYS);
-        }
-
-        if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf,
-                             &buf_size) < 0)
-            return buf_size;
-    }
-
-    if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // divx 5.01+/xvid frame reorder
-        ret = init_get_bits8(&s->gb, s->bitstream_buffer,
-                             s->bitstream_buffer_size);
-    else
-        ret = init_get_bits8(&s->gb, buf, buf_size);
-    s->bitstream_buffer_size = 0;
-
-    if (ret < 0)
-        return ret;
-
-    if (!s->context_initialized)
-        // we need the idct permutaton for reading a custom matrix
-        if ((ret = ff_MPV_common_init(s)) < 0)
-            return ret;
-
-    /* We need to set current_picture_ptr before reading the header,
-     * otherwise we cannot store anyting in there */
-    if (s->current_picture_ptr == NULL || s->current_picture_ptr->f.data[0]) {
-        int i = ff_find_unused_picture(s, 0);
-        if (i < 0)
-            return i;
-        s->current_picture_ptr = &s->picture[i];
-    }
-
-    /* let's go :-) */
-    if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) {
-        ret = ff_wmv2_decode_picture_header(s);
-    } else if (CONFIG_MSMPEG4_DECODER && s->msmpeg4_version) {
-        ret = ff_msmpeg4_decode_picture_header(s);
-    } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {
-        if (s->avctx->extradata_size && s->picture_number == 0) {
-            GetBitContext gb;
-
-            ret = init_get_bits8(&gb, s->avctx->extradata,
-                                 s->avctx->extradata_size);
-            if (ret < 0)
-                return ret;
-            ff_mpeg4_decode_picture_header(avctx->priv_data, &gb);
-        }
-        ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &s->gb);
-    } else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) {
-        ret = ff_intel_h263_decode_picture_header(s);
-    } else if (CONFIG_FLV_DECODER && s->h263_flv) {
-        ret = ff_flv_decode_picture_header(s);
-    } else {
-        ret = ff_h263_decode_picture_header(s);
-    }
-
-    if (ret == FRAME_SKIPPED)
-        return get_consumed_bytes(s, buf_size);
-
-    /* skip if the header was thrashed */
-    if (ret < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
-        return ret;
-    }
-
-    avctx->has_b_frames = !s->low_delay;
-
-#define SET_QPEL_FUNC(postfix1, postfix2)                           \
-    s->dsp.put_        ## postfix1 = ff_put_        ## postfix2;    \
-    s->dsp.put_no_rnd_ ## postfix1 = ff_put_no_rnd_ ## postfix2;    \
-    s->dsp.avg_        ## postfix1 = ff_avg_        ## postfix2;
-
-    if (s->workaround_bugs & FF_BUG_STD_QPEL) {
-        SET_QPEL_FUNC(qpel_pixels_tab[0][5], qpel16_mc11_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[0][7], qpel16_mc31_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[0][9], qpel16_mc12_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[0][11], qpel16_mc32_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[0][13], qpel16_mc13_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[0][15], qpel16_mc33_old_c)
-
-        SET_QPEL_FUNC(qpel_pixels_tab[1][5], qpel8_mc11_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[1][7], qpel8_mc31_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[1][9], qpel8_mc12_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[1][11], qpel8_mc32_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[1][13], qpel8_mc13_old_c)
-        SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_old_c)
-    }
-
-    /* After H263 & mpeg4 header decode we have the height, width,
-     * and other parameters. So then we could init the picture.
-     * FIXME: By the way H263 decoder is evolving it should have
-     * an H263EncContext */
-    if (s->width  != avctx->coded_width  ||
-        s->height != avctx->coded_height ||
-        s->context_reinit) {
-        /* H.263 could change picture size any time */
-        s->context_reinit = 0;
-
-        ret = ff_set_dimensions(avctx, s->width, s->height);
-        if (ret < 0)
-            return ret;
-
-        if ((ret = ff_MPV_common_frame_size_change(s)))
-            return ret;
-    }
-
-    if (s->codec_id == AV_CODEC_ID_H263  ||
-        s->codec_id == AV_CODEC_ID_H263P ||
-        s->codec_id == AV_CODEC_ID_H263I)
-        s->gob_index = ff_h263_get_gob_height(s);
-
-    // for skipping the frame
-    s->current_picture.f.pict_type = s->pict_type;
-    s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
-
-    /* skip B-frames if we don't have reference frames */
-    if (s->last_picture_ptr == NULL &&
-        (s->pict_type == AV_PICTURE_TYPE_B || s->droppable))
-        return get_consumed_bytes(s, buf_size);
-    if ((avctx->skip_frame >= AVDISCARD_NONREF &&
-         s->pict_type == AV_PICTURE_TYPE_B)    ||
-        (avctx->skip_frame >= AVDISCARD_NONKEY &&
-         s->pict_type != AV_PICTURE_TYPE_I)    ||
-        avctx->skip_frame >= AVDISCARD_ALL)
-        return get_consumed_bytes(s, buf_size);
-
-    if (s->next_p_frame_damaged) {
-        if (s->pict_type == AV_PICTURE_TYPE_B)
-            return get_consumed_bytes(s, buf_size);
-        else
-            s->next_p_frame_damaged = 0;
-    }
-
-    if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) {
-        s->me.qpel_put = s->dsp.put_qpel_pixels_tab;
-        s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab;
-    } else {
-        s->me.qpel_put = s->dsp.put_no_rnd_qpel_pixels_tab;
-        s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab;
-    }
-
-    if ((ret = ff_MPV_frame_start(s, avctx)) < 0)
-        return ret;
-
-    if (!s->divx_packed && !avctx->hwaccel)
-        ff_thread_finish_setup(avctx);
-
-    if (avctx->hwaccel) {
-        ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer,
-                                          s->gb.buffer_end - s->gb.buffer);
-        if (ret < 0 )
-            return ret;
-    }
-
-    ff_mpeg_er_frame_start(s);
-
-    /* the second part of the wmv2 header contains the MB skip bits which
-     * are stored in current_picture->mb_type which is not available before
-     * ff_MPV_frame_start() */
-    if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) {
-        ret = ff_wmv2_decode_secondary_picture_header(s);
-        if (ret < 0)
-            return ret;
-        if (ret == 1)
-            goto intrax8_decoded;
-    }
-
-    /* decode each macroblock */
-    s->mb_x = 0;
-    s->mb_y = 0;
-
-    ret = decode_slice(s);
-    while (s->mb_y < s->mb_height) {
-        if (s->msmpeg4_version) {
-            if (s->slice_height == 0 || s->mb_x != 0 ||
-                (s->mb_y % s->slice_height) != 0 || get_bits_left(&s->gb) < 0)
-                break;
-        } else {
-            int prev_x = s->mb_x, prev_y = s->mb_y;
-            if (ff_h263_resync(s) < 0)
-                break;
-            if (prev_y * s->mb_width + prev_x < s->mb_y * s->mb_width + s->mb_x)
-                s->er.error_occurred = 1;
-        }
-
-        if (s->msmpeg4_version < 4 && s->h263_pred)
-            ff_mpeg4_clean_buffers(s);
-
-        if (decode_slice(s) < 0)
-            ret = AVERROR_INVALIDDATA;
-    }
-
-    if (s->msmpeg4_version && s->msmpeg4_version < 4 &&
-        s->pict_type == AV_PICTURE_TYPE_I)
-        if (!CONFIG_MSMPEG4_DECODER ||
-            ff_msmpeg4_decode_ext_header(s, buf_size) < 0)
-            s->er.error_status_table[s->mb_num - 1] = ER_MB_ERROR;
-
-    assert(s->bitstream_buffer_size == 0);
-
-    if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4)
-        ff_mpeg4_frame_end(avctx, buf, buf_size);
-
-intrax8_decoded:
-    ff_er_frame_end(&s->er);
-
-    if (avctx->hwaccel) {
-        ret = avctx->hwaccel->end_frame(avctx);
-        if (ret < 0)
-            return ret;
-    }
-
-    ff_MPV_frame_end(s);
-
-    if (!s->divx_packed && avctx->hwaccel)
-        ff_thread_finish_setup(avctx);
-
-    assert(s->current_picture.f.pict_type ==
-           s->current_picture_ptr->f.pict_type);
-    assert(s->current_picture.f.pict_type == s->pict_type);
-    if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
-        if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
-            return ret;
-        ff_print_debug_info(s, s->current_picture_ptr);
-    } else if (s->last_picture_ptr != NULL) {
-        if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
-            return ret;
-        ff_print_debug_info(s, s->last_picture_ptr);
-    }
-
-    if (s->last_picture_ptr || s->low_delay)
-        *got_frame = 1;
-
-    if (ret && (avctx->err_recognition & AV_EF_EXPLODE))
-        return ret;
-    else
-        return get_consumed_bytes(s, buf_size);
-}
-
-const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = {
-#if CONFIG_VAAPI
-    AV_PIX_FMT_VAAPI_VLD,
-#endif
-#if CONFIG_VDPAU
-    AV_PIX_FMT_VDPAU,
-#endif
-    AV_PIX_FMT_YUV420P,
-    AV_PIX_FMT_NONE
-};
-
-AVCodec ff_h263_decoder = {
-    .name           = "h263",
-    .long_name      = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H263,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_h263_decode_init,
-    .close          = ff_h263_decode_end,
-    .decode         = ff_h263_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
-                      CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
-    .flush          = ff_mpeg_flush,
-    .pix_fmts       = ff_h263_hwaccel_pixfmt_list_420,
-};
diff --git a/deps/libav/libavcodec/h263dsp.c b/deps/libav/libavcodec/h263dsp.c
deleted file mode 100644
index 70ecdb9..0000000
--- a/deps/libav/libavcodec/h263dsp.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "config.h"
-#include "h263dsp.h"
-
-const uint8_t ff_h263_loop_filter_strength[32] = {
-    0, 1, 1, 2, 2, 3, 3,  4,  4,  4,  5,  5,  6,  6,  7, 7,
-    7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12
-};
-
-static void h263_h_loop_filter_c(uint8_t *src, int stride, int qscale)
-{
-    int y;
-    const int strength = ff_h263_loop_filter_strength[qscale];
-
-    for (y = 0; y < 8; y++) {
-        int d1, d2, ad1;
-        int p0 = src[y * stride - 2];
-        int p1 = src[y * stride - 1];
-        int p2 = src[y * stride + 0];
-        int p3 = src[y * stride + 1];
-        int d  = (p0 - p3 + 4 * (p2 - p1)) / 8;
-
-        if (d < -2 * strength)
-            d1 = 0;
-        else if (d < -strength)
-            d1 = -2 * strength - d;
-        else if (d < strength)
-            d1 = d;
-        else if (d < 2 * strength)
-            d1 = 2 * strength - d;
-        else
-            d1 = 0;
-
-        p1 += d1;
-        p2 -= d1;
-        if (p1 & 256)
-            p1 = ~(p1 >> 31);
-        if (p2 & 256)
-            p2 = ~(p2 >> 31);
-
-        src[y * stride - 1] = p1;
-        src[y * stride + 0] = p2;
-
-        ad1 = FFABS(d1) >> 1;
-
-        d2 = av_clip((p0 - p3) / 4, -ad1, ad1);
-
-        src[y * stride - 2] = p0 - d2;
-        src[y * stride + 1] = p3 + d2;
-    }
-}
-
-static void h263_v_loop_filter_c(uint8_t *src, int stride, int qscale)
-{
-    int x;
-    const int strength = ff_h263_loop_filter_strength[qscale];
-
-    for (x = 0; x < 8; x++) {
-        int d1, d2, ad1;
-        int p0 = src[x - 2 * stride];
-        int p1 = src[x - 1 * stride];
-        int p2 = src[x + 0 * stride];
-        int p3 = src[x + 1 * stride];
-        int d  = (p0 - p3 + 4 * (p2 - p1)) / 8;
-
-        if (d < -2 * strength)
-            d1 = 0;
-        else if (d < -strength)
-            d1 = -2 * strength - d;
-        else if (d < strength)
-            d1 = d;
-        else if (d < 2 * strength)
-            d1 = 2 * strength - d;
-        else
-            d1 = 0;
-
-        p1 += d1;
-        p2 -= d1;
-        if (p1 & 256)
-            p1 = ~(p1 >> 31);
-        if (p2 & 256)
-            p2 = ~(p2 >> 31);
-
-        src[x - 1 * stride] = p1;
-        src[x + 0 * stride] = p2;
-
-        ad1 = FFABS(d1) >> 1;
-
-        d2 = av_clip((p0 - p3) / 4, -ad1, ad1);
-
-        src[x - 2 * stride] = p0 - d2;
-        src[x + stride]     = p3 + d2;
-    }
-}
-
-av_cold void ff_h263dsp_init(H263DSPContext *ctx)
-{
-    ctx->h263_h_loop_filter = h263_h_loop_filter_c;
-    ctx->h263_v_loop_filter = h263_v_loop_filter_c;
-
-    if (ARCH_X86)
-        ff_h263dsp_init_x86(ctx);
-}
diff --git a/deps/libav/libavcodec/h263dsp.h b/deps/libav/libavcodec/h263dsp.h
deleted file mode 100644
index 40f041c..0000000
--- a/deps/libav/libavcodec/h263dsp.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_H263DSP_H
-#define AVCODEC_H263DSP_H
-
-#include <stdint.h>
-
-extern const uint8_t ff_h263_loop_filter_strength[32];
-
-typedef struct H263DSPContext {
-    void (*h263_h_loop_filter)(uint8_t *src, int stride, int qscale);
-    void (*h263_v_loop_filter)(uint8_t *src, int stride, int qscale);
-} H263DSPContext;
-
-void ff_h263dsp_init(H263DSPContext *ctx);
-void ff_h263dsp_init_x86(H263DSPContext *ctx);
-
-#endif /* AVCODEC_H263DSP_H */
diff --git a/deps/libav/libavcodec/h264.c b/deps/libav/libavcodec/h264.c
deleted file mode 100644
index 29b96c4..0000000
--- a/deps/libav/libavcodec/h264.c
+++ /dev/null
@@ -1,5040 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 codec.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "libavutil/avassert.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/stereo3d.h"
-#include "libavutil/timer.h"
-#include "internal.h"
-#include "cabac.h"
-#include "cabac_functions.h"
-#include "dsputil.h"
-#include "error_resilience.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h264.h"
-#include "h264data.h"
-#include "h264chroma.h"
-#include "h264_mvpred.h"
-#include "golomb.h"
-#include "mathops.h"
-#include "rectangle.h"
-#include "svq3.h"
-#include "thread.h"
-
-#include <assert.h>
-
-const uint16_t ff_h264_mb_sizes[4] = { 256, 384, 512, 768 };
-
-static const uint8_t rem6[QP_MAX_NUM + 1] = {
-    0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2,
-    3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
-    0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
-};
-
-static const uint8_t div6[QP_MAX_NUM + 1] = {
-    0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3,  3,  3,
-    3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6,  6,  6,
-    7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
-};
-
-static const uint8_t field_scan[16] = {
-    0 + 0 * 4, 0 + 1 * 4, 1 + 0 * 4, 0 + 2 * 4,
-    0 + 3 * 4, 1 + 1 * 4, 1 + 2 * 4, 1 + 3 * 4,
-    2 + 0 * 4, 2 + 1 * 4, 2 + 2 * 4, 2 + 3 * 4,
-    3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4, 3 + 3 * 4,
-};
-
-static const uint8_t field_scan8x8[64] = {
-    0 + 0 * 8, 0 + 1 * 8, 0 + 2 * 8, 1 + 0 * 8,
-    1 + 1 * 8, 0 + 3 * 8, 0 + 4 * 8, 1 + 2 * 8,
-    2 + 0 * 8, 1 + 3 * 8, 0 + 5 * 8, 0 + 6 * 8,
-    0 + 7 * 8, 1 + 4 * 8, 2 + 1 * 8, 3 + 0 * 8,
-    2 + 2 * 8, 1 + 5 * 8, 1 + 6 * 8, 1 + 7 * 8,
-    2 + 3 * 8, 3 + 1 * 8, 4 + 0 * 8, 3 + 2 * 8,
-    2 + 4 * 8, 2 + 5 * 8, 2 + 6 * 8, 2 + 7 * 8,
-    3 + 3 * 8, 4 + 1 * 8, 5 + 0 * 8, 4 + 2 * 8,
-    3 + 4 * 8, 3 + 5 * 8, 3 + 6 * 8, 3 + 7 * 8,
-    4 + 3 * 8, 5 + 1 * 8, 6 + 0 * 8, 5 + 2 * 8,
-    4 + 4 * 8, 4 + 5 * 8, 4 + 6 * 8, 4 + 7 * 8,
-    5 + 3 * 8, 6 + 1 * 8, 6 + 2 * 8, 5 + 4 * 8,
-    5 + 5 * 8, 5 + 6 * 8, 5 + 7 * 8, 6 + 3 * 8,
-    7 + 0 * 8, 7 + 1 * 8, 6 + 4 * 8, 6 + 5 * 8,
-    6 + 6 * 8, 6 + 7 * 8, 7 + 2 * 8, 7 + 3 * 8,
-    7 + 4 * 8, 7 + 5 * 8, 7 + 6 * 8, 7 + 7 * 8,
-};
-
-static const uint8_t field_scan8x8_cavlc[64] = {
-    0 + 0 * 8, 1 + 1 * 8, 2 + 0 * 8, 0 + 7 * 8,
-    2 + 2 * 8, 2 + 3 * 8, 2 + 4 * 8, 3 + 3 * 8,
-    3 + 4 * 8, 4 + 3 * 8, 4 + 4 * 8, 5 + 3 * 8,
-    5 + 5 * 8, 7 + 0 * 8, 6 + 6 * 8, 7 + 4 * 8,
-    0 + 1 * 8, 0 + 3 * 8, 1 + 3 * 8, 1 + 4 * 8,
-    1 + 5 * 8, 3 + 1 * 8, 2 + 5 * 8, 4 + 1 * 8,
-    3 + 5 * 8, 5 + 1 * 8, 4 + 5 * 8, 6 + 1 * 8,
-    5 + 6 * 8, 7 + 1 * 8, 6 + 7 * 8, 7 + 5 * 8,
-    0 + 2 * 8, 0 + 4 * 8, 0 + 5 * 8, 2 + 1 * 8,
-    1 + 6 * 8, 4 + 0 * 8, 2 + 6 * 8, 5 + 0 * 8,
-    3 + 6 * 8, 6 + 0 * 8, 4 + 6 * 8, 6 + 2 * 8,
-    5 + 7 * 8, 6 + 4 * 8, 7 + 2 * 8, 7 + 6 * 8,
-    1 + 0 * 8, 1 + 2 * 8, 0 + 6 * 8, 3 + 0 * 8,
-    1 + 7 * 8, 3 + 2 * 8, 2 + 7 * 8, 4 + 2 * 8,
-    3 + 7 * 8, 5 + 2 * 8, 4 + 7 * 8, 5 + 4 * 8,
-    6 + 3 * 8, 6 + 5 * 8, 7 + 3 * 8, 7 + 7 * 8,
-};
-
-// zigzag_scan8x8_cavlc[i] = zigzag_scan8x8[(i/4) + 16*(i%4)]
-static const uint8_t zigzag_scan8x8_cavlc[64] = {
-    0 + 0 * 8, 1 + 1 * 8, 1 + 2 * 8, 2 + 2 * 8,
-    4 + 1 * 8, 0 + 5 * 8, 3 + 3 * 8, 7 + 0 * 8,
-    3 + 4 * 8, 1 + 7 * 8, 5 + 3 * 8, 6 + 3 * 8,
-    2 + 7 * 8, 6 + 4 * 8, 5 + 6 * 8, 7 + 5 * 8,
-    1 + 0 * 8, 2 + 0 * 8, 0 + 3 * 8, 3 + 1 * 8,
-    3 + 2 * 8, 0 + 6 * 8, 4 + 2 * 8, 6 + 1 * 8,
-    2 + 5 * 8, 2 + 6 * 8, 6 + 2 * 8, 5 + 4 * 8,
-    3 + 7 * 8, 7 + 3 * 8, 4 + 7 * 8, 7 + 6 * 8,
-    0 + 1 * 8, 3 + 0 * 8, 0 + 4 * 8, 4 + 0 * 8,
-    2 + 3 * 8, 1 + 5 * 8, 5 + 1 * 8, 5 + 2 * 8,
-    1 + 6 * 8, 3 + 5 * 8, 7 + 1 * 8, 4 + 5 * 8,
-    4 + 6 * 8, 7 + 4 * 8, 5 + 7 * 8, 6 + 7 * 8,
-    0 + 2 * 8, 2 + 1 * 8, 1 + 3 * 8, 5 + 0 * 8,
-    1 + 4 * 8, 2 + 4 * 8, 6 + 0 * 8, 4 + 3 * 8,
-    0 + 7 * 8, 4 + 4 * 8, 7 + 2 * 8, 3 + 6 * 8,
-    5 + 5 * 8, 6 + 5 * 8, 6 + 6 * 8, 7 + 7 * 8,
-};
-
-static const uint8_t dequant4_coeff_init[6][3] = {
-    { 10, 13, 16 },
-    { 11, 14, 18 },
-    { 13, 16, 20 },
-    { 14, 18, 23 },
-    { 16, 20, 25 },
-    { 18, 23, 29 },
-};
-
-static const uint8_t dequant8_coeff_init_scan[16] = {
-    0, 3, 4, 3, 3, 1, 5, 1, 4, 5, 2, 5, 3, 1, 5, 1
-};
-
-static const uint8_t dequant8_coeff_init[6][6] = {
-    { 20, 18, 32, 19, 25, 24 },
-    { 22, 19, 35, 21, 28, 26 },
-    { 26, 23, 42, 24, 33, 31 },
-    { 28, 25, 45, 26, 35, 33 },
-    { 32, 28, 51, 30, 40, 38 },
-    { 36, 32, 58, 34, 46, 43 },
-};
-
-static const enum AVPixelFormat h264_hwaccel_pixfmt_list_420[] = {
-#if CONFIG_H264_DXVA2_HWACCEL
-    AV_PIX_FMT_DXVA2_VLD,
-#endif
-#if CONFIG_H264_VAAPI_HWACCEL
-    AV_PIX_FMT_VAAPI_VLD,
-#endif
-#if CONFIG_H264_VDA_HWACCEL
-    AV_PIX_FMT_VDA_VLD,
-#endif
-#if CONFIG_H264_VDPAU_HWACCEL
-    AV_PIX_FMT_VDPAU,
-#endif
-    AV_PIX_FMT_YUV420P,
-    AV_PIX_FMT_NONE
-};
-
-static const enum AVPixelFormat h264_hwaccel_pixfmt_list_jpeg_420[] = {
-#if CONFIG_H264_DXVA2_HWACCEL
-    AV_PIX_FMT_DXVA2_VLD,
-#endif
-#if CONFIG_H264_VAAPI_HWACCEL
-    AV_PIX_FMT_VAAPI_VLD,
-#endif
-#if CONFIG_H264_VDA_HWACCEL
-    AV_PIX_FMT_VDA_VLD,
-#endif
-#if CONFIG_H264_VDPAU_HWACCEL
-    AV_PIX_FMT_VDPAU,
-#endif
-    AV_PIX_FMT_YUVJ420P,
-    AV_PIX_FMT_NONE
-};
-
-static void h264_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
-                              int (*mv)[2][4][2],
-                              int mb_x, int mb_y, int mb_intra, int mb_skipped)
-{
-    H264Context *h = opaque;
-
-    h->mb_x  = mb_x;
-    h->mb_y  = mb_y;
-    h->mb_xy = mb_x + mb_y * h->mb_stride;
-    memset(h->non_zero_count_cache, 0, sizeof(h->non_zero_count_cache));
-    assert(ref >= 0);
-    /* FIXME: It is possible albeit uncommon that slice references
-     * differ between slices. We take the easy approach and ignore
-     * it for now. If this turns out to have any relevance in
-     * practice then correct remapping should be added. */
-    if (ref >= h->ref_count[0])
-        ref = 0;
-    fill_rectangle(&h->cur_pic.ref_index[0][4 * h->mb_xy],
-                   2, 2, 2, ref, 1);
-    fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);
-    fill_rectangle(h->mv_cache[0][scan8[0]], 4, 4, 8,
-                   pack16to32((*mv)[0][0][0], (*mv)[0][0][1]), 4);
-    assert(!FRAME_MBAFF(h));
-    ff_h264_hl_decode_mb(h);
-}
-
-void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
-{
-    AVCodecContext *avctx = h->avctx;
-    Picture *cur  = &h->cur_pic;
-    Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-    int vshift = desc->log2_chroma_h;
-    const int field_pic = h->picture_structure != PICT_FRAME;
-    if (field_pic) {
-        height <<= 1;
-        y      <<= 1;
-    }
-
-    height = FFMIN(height, avctx->height - y);
-
-    if (field_pic && h->first_field && !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD))
-        return;
-
-    if (avctx->draw_horiz_band) {
-        AVFrame *src;
-        int offset[AV_NUM_DATA_POINTERS];
-        int i;
-
-        if (cur->f.pict_type == AV_PICTURE_TYPE_B || h->low_delay ||
-            (avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
-            src = &cur->f;
-        else if (last)
-            src = &last->f;
-        else
-            return;
-
-        offset[0] = y * src->linesize[0];
-        offset[1] =
-        offset[2] = (y >> vshift) * src->linesize[1];
-        for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
-            offset[i] = 0;
-
-        emms_c();
-
-        avctx->draw_horiz_band(avctx, src, offset,
-                               y, h->picture_structure, height);
-    }
-}
-
-static void unref_picture(H264Context *h, Picture *pic)
-{
-    int off = offsetof(Picture, tf) + sizeof(pic->tf);
-    int i;
-
-    if (!pic->f.buf[0])
-        return;
-
-    ff_thread_release_buffer(h->avctx, &pic->tf);
-    av_buffer_unref(&pic->hwaccel_priv_buf);
-
-    av_buffer_unref(&pic->qscale_table_buf);
-    av_buffer_unref(&pic->mb_type_buf);
-    for (i = 0; i < 2; i++) {
-        av_buffer_unref(&pic->motion_val_buf[i]);
-        av_buffer_unref(&pic->ref_index_buf[i]);
-    }
-
-    memset((uint8_t*)pic + off, 0, sizeof(*pic) - off);
-}
-
-static void release_unused_pictures(H264Context *h, int remove_current)
-{
-    int i;
-
-    /* release non reference frames */
-    for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-        if (h->DPB[i].f.buf[0] && !h->DPB[i].reference &&
-            (remove_current || &h->DPB[i] != h->cur_pic_ptr)) {
-            unref_picture(h, &h->DPB[i]);
-        }
-    }
-}
-
-static int ref_picture(H264Context *h, Picture *dst, Picture *src)
-{
-    int ret, i;
-
-    av_assert0(!dst->f.buf[0]);
-    av_assert0(src->f.buf[0]);
-
-    src->tf.f = &src->f;
-    dst->tf.f = &dst->f;
-    ret = ff_thread_ref_frame(&dst->tf, &src->tf);
-    if (ret < 0)
-        goto fail;
-
-    dst->qscale_table_buf = av_buffer_ref(src->qscale_table_buf);
-    dst->mb_type_buf      = av_buffer_ref(src->mb_type_buf);
-    if (!dst->qscale_table_buf || !dst->mb_type_buf)
-        goto fail;
-    dst->qscale_table = src->qscale_table;
-    dst->mb_type      = src->mb_type;
-
-    for (i = 0; i < 2; i++) {
-        dst->motion_val_buf[i] = av_buffer_ref(src->motion_val_buf[i]);
-        dst->ref_index_buf[i]  = av_buffer_ref(src->ref_index_buf[i]);
-        if (!dst->motion_val_buf[i] || !dst->ref_index_buf[i])
-            goto fail;
-        dst->motion_val[i] = src->motion_val[i];
-        dst->ref_index[i]  = src->ref_index[i];
-    }
-
-    if (src->hwaccel_picture_private) {
-        dst->hwaccel_priv_buf = av_buffer_ref(src->hwaccel_priv_buf);
-        if (!dst->hwaccel_priv_buf)
-            goto fail;
-        dst->hwaccel_picture_private = dst->hwaccel_priv_buf->data;
-    }
-
-    for (i = 0; i < 2; i++)
-        dst->field_poc[i] = src->field_poc[i];
-
-    memcpy(dst->ref_poc,   src->ref_poc,   sizeof(src->ref_poc));
-    memcpy(dst->ref_count, src->ref_count, sizeof(src->ref_count));
-
-    dst->poc           = src->poc;
-    dst->frame_num     = src->frame_num;
-    dst->mmco_reset    = src->mmco_reset;
-    dst->pic_id        = src->pic_id;
-    dst->long_ref      = src->long_ref;
-    dst->mbaff         = src->mbaff;
-    dst->field_picture = src->field_picture;
-    dst->needs_realloc = src->needs_realloc;
-    dst->reference     = src->reference;
-    dst->recovered     = src->recovered;
-
-    return 0;
-fail:
-    unref_picture(h, dst);
-    return ret;
-}
-
-static int alloc_scratch_buffers(H264Context *h, int linesize)
-{
-    int alloc_size = FFALIGN(FFABS(linesize) + 32, 32);
-
-    if (h->bipred_scratchpad)
-        return 0;
-
-    h->bipred_scratchpad = av_malloc(16 * 6 * alloc_size);
-    // edge emu needs blocksize + filter length - 1
-    // (= 21x21 for  h264)
-    h->edge_emu_buffer = av_mallocz(alloc_size * 2 * 21);
-    h->me.scratchpad   = av_mallocz(alloc_size * 2 * 16 * 2);
-
-    if (!h->bipred_scratchpad || !h->edge_emu_buffer || !h->me.scratchpad) {
-        av_freep(&h->bipred_scratchpad);
-        av_freep(&h->edge_emu_buffer);
-        av_freep(&h->me.scratchpad);
-        return AVERROR(ENOMEM);
-    }
-
-    h->me.temp = h->me.scratchpad;
-
-    return 0;
-}
-
-static int init_table_pools(H264Context *h)
-{
-    const int big_mb_num    = h->mb_stride * (h->mb_height + 1) + 1;
-    const int mb_array_size = h->mb_stride * h->mb_height;
-    const int b4_stride     = h->mb_width * 4 + 1;
-    const int b4_array_size = b4_stride * h->mb_height * 4;
-
-    h->qscale_table_pool = av_buffer_pool_init(big_mb_num + h->mb_stride,
-                                               av_buffer_allocz);
-    h->mb_type_pool      = av_buffer_pool_init((big_mb_num + h->mb_stride) *
-                                               sizeof(uint32_t), av_buffer_allocz);
-    h->motion_val_pool = av_buffer_pool_init(2 * (b4_array_size + 4) *
-                                             sizeof(int16_t), av_buffer_allocz);
-    h->ref_index_pool  = av_buffer_pool_init(4 * mb_array_size, av_buffer_allocz);
-
-    if (!h->qscale_table_pool || !h->mb_type_pool || !h->motion_val_pool ||
-        !h->ref_index_pool) {
-        av_buffer_pool_uninit(&h->qscale_table_pool);
-        av_buffer_pool_uninit(&h->mb_type_pool);
-        av_buffer_pool_uninit(&h->motion_val_pool);
-        av_buffer_pool_uninit(&h->ref_index_pool);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static int alloc_picture(H264Context *h, Picture *pic)
-{
-    int i, ret = 0;
-
-    av_assert0(!pic->f.data[0]);
-
-    pic->tf.f = &pic->f;
-    ret = ff_thread_get_buffer(h->avctx, &pic->tf, pic->reference ?
-                                                   AV_GET_BUFFER_FLAG_REF : 0);
-    if (ret < 0)
-        goto fail;
-
-    h->linesize   = pic->f.linesize[0];
-    h->uvlinesize = pic->f.linesize[1];
-
-    if (h->avctx->hwaccel) {
-        const AVHWAccel *hwaccel = h->avctx->hwaccel;
-        av_assert0(!pic->hwaccel_picture_private);
-        if (hwaccel->priv_data_size) {
-            pic->hwaccel_priv_buf = av_buffer_allocz(hwaccel->priv_data_size);
-            if (!pic->hwaccel_priv_buf)
-                return AVERROR(ENOMEM);
-            pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data;
-        }
-    }
-
-    if (!h->qscale_table_pool) {
-        ret = init_table_pools(h);
-        if (ret < 0)
-            goto fail;
-    }
-
-    pic->qscale_table_buf = av_buffer_pool_get(h->qscale_table_pool);
-    pic->mb_type_buf      = av_buffer_pool_get(h->mb_type_pool);
-    if (!pic->qscale_table_buf || !pic->mb_type_buf)
-        goto fail;
-
-    pic->mb_type      = (uint32_t*)pic->mb_type_buf->data + 2 * h->mb_stride + 1;
-    pic->qscale_table = pic->qscale_table_buf->data + 2 * h->mb_stride + 1;
-
-    for (i = 0; i < 2; i++) {
-        pic->motion_val_buf[i] = av_buffer_pool_get(h->motion_val_pool);
-        pic->ref_index_buf[i]  = av_buffer_pool_get(h->ref_index_pool);
-        if (!pic->motion_val_buf[i] || !pic->ref_index_buf[i])
-            goto fail;
-
-        pic->motion_val[i] = (int16_t (*)[2])pic->motion_val_buf[i]->data + 4;
-        pic->ref_index[i]  = pic->ref_index_buf[i]->data;
-    }
-
-    return 0;
-fail:
-    unref_picture(h, pic);
-    return (ret < 0) ? ret : AVERROR(ENOMEM);
-}
-
-static inline int pic_is_unused(H264Context *h, Picture *pic)
-{
-    if (!pic->f.buf[0])
-        return 1;
-    if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF))
-        return 1;
-    return 0;
-}
-
-static int find_unused_picture(H264Context *h)
-{
-    int i;
-
-    for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-        if (pic_is_unused(h, &h->DPB[i]))
-            break;
-    }
-    if (i == MAX_PICTURE_COUNT)
-        return AVERROR_INVALIDDATA;
-
-    if (h->DPB[i].needs_realloc) {
-        h->DPB[i].needs_realloc = 0;
-        unref_picture(h, &h->DPB[i]);
-    }
-
-    return i;
-}
-
-/**
- * Check if the top & left blocks are available if needed and
- * change the dc mode so it only uses the available blocks.
- */
-int ff_h264_check_intra4x4_pred_mode(H264Context *h)
-{
-    static const int8_t top[12] = {
-        -1, 0, LEFT_DC_PRED, -1, -1, -1, -1, -1, 0
-    };
-    static const int8_t left[12] = {
-        0, -1, TOP_DC_PRED, 0, -1, -1, -1, 0, -1, DC_128_PRED
-    };
-    int i;
-
-    if (!(h->top_samples_available & 0x8000)) {
-        for (i = 0; i < 4; i++) {
-            int status = top[h->intra4x4_pred_mode_cache[scan8[0] + i]];
-            if (status < 0) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "top block unavailable for requested intra4x4 mode %d at %d %d\n",
-                       status, h->mb_x, h->mb_y);
-                return AVERROR_INVALIDDATA;
-            } else if (status) {
-                h->intra4x4_pred_mode_cache[scan8[0] + i] = status;
-            }
-        }
-    }
-
-    if ((h->left_samples_available & 0x8888) != 0x8888) {
-        static const int mask[4] = { 0x8000, 0x2000, 0x80, 0x20 };
-        for (i = 0; i < 4; i++)
-            if (!(h->left_samples_available & mask[i])) {
-                int status = left[h->intra4x4_pred_mode_cache[scan8[0] + 8 * i]];
-                if (status < 0) {
-                    av_log(h->avctx, AV_LOG_ERROR,
-                           "left block unavailable for requested intra4x4 mode %d at %d %d\n",
-                           status, h->mb_x, h->mb_y);
-                    return AVERROR_INVALIDDATA;
-                } else if (status) {
-                    h->intra4x4_pred_mode_cache[scan8[0] + 8 * i] = status;
-                }
-            }
-    }
-
-    return 0;
-} // FIXME cleanup like ff_h264_check_intra_pred_mode
-
-/**
- * Check if the top & left blocks are available if needed and
- * change the dc mode so it only uses the available blocks.
- */
-int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma)
-{
-    static const int8_t top[4]  = { LEFT_DC_PRED8x8, 1, -1, -1 };
-    static const int8_t left[5] = { TOP_DC_PRED8x8, -1,  2, -1, DC_128_PRED8x8 };
-
-    if (mode > 3U) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "out of range intra chroma pred mode at %d %d\n",
-               h->mb_x, h->mb_y);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!(h->top_samples_available & 0x8000)) {
-        mode = top[mode];
-        if (mode < 0) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "top block unavailable for requested intra mode at %d %d\n",
-                   h->mb_x, h->mb_y);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    if ((h->left_samples_available & 0x8080) != 0x8080) {
-        mode = left[mode];
-        if (is_chroma && (h->left_samples_available & 0x8080)) {
-            // mad cow disease mode, aka MBAFF + constrained_intra_pred
-            mode = ALZHEIMER_DC_L0T_PRED8x8 +
-                   (!(h->left_samples_available & 0x8000)) +
-                   2 * (mode == DC_128_PRED8x8);
-        }
-        if (mode < 0) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "left block unavailable for requested intra mode at %d %d\n",
-                   h->mb_x, h->mb_y);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    return mode;
-}
-
-const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src,
-                                  int *dst_length, int *consumed, int length)
-{
-    int i, si, di;
-    uint8_t *dst;
-    int bufidx;
-
-    // src[0]&0x80; // forbidden bit
-    h->nal_ref_idc   = src[0] >> 5;
-    h->nal_unit_type = src[0] & 0x1F;
-
-    src++;
-    length--;
-
-#define STARTCODE_TEST                                                  \
-    if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) {         \
-        if (src[i + 2] != 3) {                                          \
-            /* startcode, so we must be past the end */                 \
-            length = i;                                                 \
-        }                                                               \
-        break;                                                          \
-    }
-
-#if HAVE_FAST_UNALIGNED
-#define FIND_FIRST_ZERO                                                 \
-    if (i > 0 && !src[i])                                               \
-        i--;                                                            \
-    while (src[i])                                                      \
-        i++
-
-#if HAVE_FAST_64BIT
-    for (i = 0; i + 1 < length; i += 9) {
-        if (!((~AV_RN64A(src + i) &
-               (AV_RN64A(src + i) - 0x0100010001000101ULL)) &
-              0x8000800080008080ULL))
-            continue;
-        FIND_FIRST_ZERO;
-        STARTCODE_TEST;
-        i -= 7;
-    }
-#else
-    for (i = 0; i + 1 < length; i += 5) {
-        if (!((~AV_RN32A(src + i) &
-               (AV_RN32A(src + i) - 0x01000101U)) &
-              0x80008080U))
-            continue;
-        FIND_FIRST_ZERO;
-        STARTCODE_TEST;
-        i -= 3;
-    }
-#endif
-#else
-    for (i = 0; i + 1 < length; i += 2) {
-        if (src[i])
-            continue;
-        if (i > 0 && src[i - 1] == 0)
-            i--;
-        STARTCODE_TEST;
-    }
-#endif
-
-    if (i >= length - 1) { // no escaped 0
-        *dst_length = length;
-        *consumed   = length + 1; // +1 for the header
-        return src;
-    }
-
-    // use second escape buffer for inter data
-    bufidx = h->nal_unit_type == NAL_DPC ? 1 : 0;
-    av_fast_malloc(&h->rbsp_buffer[bufidx], &h->rbsp_buffer_size[bufidx],
-                   length + FF_INPUT_BUFFER_PADDING_SIZE);
-    dst = h->rbsp_buffer[bufidx];
-
-    if (dst == NULL)
-        return NULL;
-
-    memcpy(dst, src, i);
-    si = di = i;
-    while (si + 2 < length) {
-        // remove escapes (very rare 1:2^22)
-        if (src[si + 2] > 3) {
-            dst[di++] = src[si++];
-            dst[di++] = src[si++];
-        } else if (src[si] == 0 && src[si + 1] == 0) {
-            if (src[si + 2] == 3) { // escape
-                dst[di++]  = 0;
-                dst[di++]  = 0;
-                si        += 3;
-                continue;
-            } else // next start code
-                goto nsc;
-        }
-
-        dst[di++] = src[si++];
-    }
-    while (si < length)
-        dst[di++] = src[si++];
-
-nsc:
-    memset(dst + di, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-    *dst_length = di;
-    *consumed   = si + 1; // +1 for the header
-    /* FIXME store exact number of bits in the getbitcontext
-     * (it is needed for decoding) */
-    return dst;
-}
-
-/**
- * Identify the exact end of the bitstream
- * @return the length of the trailing, or 0 if damaged
- */
-static int decode_rbsp_trailing(H264Context *h, const uint8_t *src)
-{
-    int v = *src;
-    int r;
-
-    tprintf(h->avctx, "rbsp trailing %X\n", v);
-
-    for (r = 1; r < 9; r++) {
-        if (v & 1)
-            return r;
-        v >>= 1;
-    }
-    return 0;
-}
-
-static inline int get_lowest_part_list_y(H264Context *h, Picture *pic, int n,
-                                         int height, int y_offset, int list)
-{
-    int raw_my             = h->mv_cache[list][scan8[n]][1];
-    int filter_height_up   = (raw_my & 3) ? 2 : 0;
-    int filter_height_down = (raw_my & 3) ? 3 : 0;
-    int full_my            = (raw_my >> 2) + y_offset;
-    int top                = full_my - filter_height_up;
-    int bottom             = full_my + filter_height_down + height;
-
-    return FFMAX(abs(top), bottom);
-}
-
-static inline void get_lowest_part_y(H264Context *h, int refs[2][48], int n,
-                                     int height, int y_offset, int list0,
-                                     int list1, int *nrefs)
-{
-    int my;
-
-    y_offset += 16 * (h->mb_y >> MB_FIELD(h));
-
-    if (list0) {
-        int ref_n    = h->ref_cache[0][scan8[n]];
-        Picture *ref = &h->ref_list[0][ref_n];
-
-        // Error resilience puts the current picture in the ref list.
-        // Don't try to wait on these as it will cause a deadlock.
-        // Fields can wait on each other, though.
-        if (ref->tf.progress->data != h->cur_pic.tf.progress->data ||
-            (ref->reference & 3) != h->picture_structure) {
-            my = get_lowest_part_list_y(h, ref, n, height, y_offset, 0);
-            if (refs[0][ref_n] < 0)
-                nrefs[0] += 1;
-            refs[0][ref_n] = FFMAX(refs[0][ref_n], my);
-        }
-    }
-
-    if (list1) {
-        int ref_n    = h->ref_cache[1][scan8[n]];
-        Picture *ref = &h->ref_list[1][ref_n];
-
-        if (ref->tf.progress->data != h->cur_pic.tf.progress->data ||
-            (ref->reference & 3) != h->picture_structure) {
-            my = get_lowest_part_list_y(h, ref, n, height, y_offset, 1);
-            if (refs[1][ref_n] < 0)
-                nrefs[1] += 1;
-            refs[1][ref_n] = FFMAX(refs[1][ref_n], my);
-        }
-    }
-}
-
-/**
- * Wait until all reference frames are available for MC operations.
- *
- * @param h the H264 context
- */
-static void await_references(H264Context *h)
-{
-    const int mb_xy   = h->mb_xy;
-    const int mb_type = h->cur_pic.mb_type[mb_xy];
-    int refs[2][48];
-    int nrefs[2] = { 0 };
-    int ref, list;
-
-    memset(refs, -1, sizeof(refs));
-
-    if (IS_16X16(mb_type)) {
-        get_lowest_part_y(h, refs, 0, 16, 0,
-                          IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
-    } else if (IS_16X8(mb_type)) {
-        get_lowest_part_y(h, refs, 0, 8, 0,
-                          IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
-        get_lowest_part_y(h, refs, 8, 8, 8,
-                          IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
-    } else if (IS_8X16(mb_type)) {
-        get_lowest_part_y(h, refs, 0, 16, 0,
-                          IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
-        get_lowest_part_y(h, refs, 4, 16, 0,
-                          IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
-    } else {
-        int i;
-
-        assert(IS_8X8(mb_type));
-
-        for (i = 0; i < 4; i++) {
-            const int sub_mb_type = h->sub_mb_type[i];
-            const int n           = 4 * i;
-            int y_offset          = (i & 2) << 2;
-
-            if (IS_SUB_8X8(sub_mb_type)) {
-                get_lowest_part_y(h, refs, n, 8, y_offset,
-                                  IS_DIR(sub_mb_type, 0, 0),
-                                  IS_DIR(sub_mb_type, 0, 1),
-                                  nrefs);
-            } else if (IS_SUB_8X4(sub_mb_type)) {
-                get_lowest_part_y(h, refs, n, 4, y_offset,
-                                  IS_DIR(sub_mb_type, 0, 0),
-                                  IS_DIR(sub_mb_type, 0, 1),
-                                  nrefs);
-                get_lowest_part_y(h, refs, n + 2, 4, y_offset + 4,
-                                  IS_DIR(sub_mb_type, 0, 0),
-                                  IS_DIR(sub_mb_type, 0, 1),
-                                  nrefs);
-            } else if (IS_SUB_4X8(sub_mb_type)) {
-                get_lowest_part_y(h, refs, n, 8, y_offset,
-                                  IS_DIR(sub_mb_type, 0, 0),
-                                  IS_DIR(sub_mb_type, 0, 1),
-                                  nrefs);
-                get_lowest_part_y(h, refs, n + 1, 8, y_offset,
-                                  IS_DIR(sub_mb_type, 0, 0),
-                                  IS_DIR(sub_mb_type, 0, 1),
-                                  nrefs);
-            } else {
-                int j;
-                assert(IS_SUB_4X4(sub_mb_type));
-                for (j = 0; j < 4; j++) {
-                    int sub_y_offset = y_offset + 2 * (j & 2);
-                    get_lowest_part_y(h, refs, n + j, 4, sub_y_offset,
-                                      IS_DIR(sub_mb_type, 0, 0),
-                                      IS_DIR(sub_mb_type, 0, 1),
-                                      nrefs);
-                }
-            }
-        }
-    }
-
-    for (list = h->list_count - 1; list >= 0; list--)
-        for (ref = 0; ref < 48 && nrefs[list]; ref++) {
-            int row = refs[list][ref];
-            if (row >= 0) {
-                Picture *ref_pic      = &h->ref_list[list][ref];
-                int ref_field         = ref_pic->reference - 1;
-                int ref_field_picture = ref_pic->field_picture;
-                int pic_height        = 16 * h->mb_height >> ref_field_picture;
-
-                row <<= MB_MBAFF(h);
-                nrefs[list]--;
-
-                if (!FIELD_PICTURE(h) && ref_field_picture) { // frame referencing two fields
-                    ff_thread_await_progress(&ref_pic->tf,
-                                             FFMIN((row >> 1) - !(row & 1),
-                                                   pic_height - 1),
-                                             1);
-                    ff_thread_await_progress(&ref_pic->tf,
-                                             FFMIN((row >> 1), pic_height - 1),
-                                             0);
-                } else if (FIELD_PICTURE(h) && !ref_field_picture) { // field referencing one field of a frame
-                    ff_thread_await_progress(&ref_pic->tf,
-                                             FFMIN(row * 2 + ref_field,
-                                                   pic_height - 1),
-                                             0);
-                } else if (FIELD_PICTURE(h)) {
-                    ff_thread_await_progress(&ref_pic->tf,
-                                             FFMIN(row, pic_height - 1),
-                                             ref_field);
-                } else {
-                    ff_thread_await_progress(&ref_pic->tf,
-                                             FFMIN(row, pic_height - 1),
-                                             0);
-                }
-            }
-        }
-}
-
-static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
-                                         int n, int square, int height,
-                                         int delta, int list,
-                                         uint8_t *dest_y, uint8_t *dest_cb,
-                                         uint8_t *dest_cr,
-                                         int src_x_offset, int src_y_offset,
-                                         qpel_mc_func *qpix_op,
-                                         h264_chroma_mc_func chroma_op,
-                                         int pixel_shift, int chroma_idc)
-{
-    const int mx      = h->mv_cache[list][scan8[n]][0] + src_x_offset * 8;
-    int my            = h->mv_cache[list][scan8[n]][1] + src_y_offset * 8;
-    const int luma_xy = (mx & 3) + ((my & 3) << 2);
-    ptrdiff_t offset  = ((mx >> 2) << pixel_shift) + (my >> 2) * h->mb_linesize;
-    uint8_t *src_y    = pic->f.data[0] + offset;
-    uint8_t *src_cb, *src_cr;
-    int extra_width  = 0;
-    int extra_height = 0;
-    int emu = 0;
-    const int full_mx    = mx >> 2;
-    const int full_my    = my >> 2;
-    const int pic_width  = 16 * h->mb_width;
-    const int pic_height = 16 * h->mb_height >> MB_FIELD(h);
-    int ysh;
-
-    if (mx & 7)
-        extra_width -= 3;
-    if (my & 7)
-        extra_height -= 3;
-
-    if (full_mx                <          0 - extra_width  ||
-        full_my                <          0 - extra_height ||
-        full_mx + 16 /*FIXME*/ > pic_width  + extra_width  ||
-        full_my + 16 /*FIXME*/ > pic_height + extra_height) {
-        h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
-                                 src_y - (2 << pixel_shift) - 2 * h->mb_linesize,
-                                 h->mb_linesize, h->mb_linesize,
-                                 16 + 5, 16 + 5 /*FIXME*/, full_mx - 2,
-                                 full_my - 2, pic_width, pic_height);
-        src_y = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
-        emu   = 1;
-    }
-
-    qpix_op[luma_xy](dest_y, src_y, h->mb_linesize); // FIXME try variable height perhaps?
-    if (!square)
-        qpix_op[luma_xy](dest_y + delta, src_y + delta, h->mb_linesize);
-
-    if (CONFIG_GRAY && h->flags & CODEC_FLAG_GRAY)
-        return;
-
-    if (chroma_idc == 3 /* yuv444 */) {
-        src_cb = pic->f.data[1] + offset;
-        if (emu) {
-            h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
-                                     src_cb - (2 << pixel_shift) - 2 * h->mb_linesize,
-                                     h->mb_linesize, h->mb_linesize,
-                                     16 + 5, 16 + 5 /*FIXME*/,
-                                     full_mx - 2, full_my - 2,
-                                     pic_width, pic_height);
-            src_cb = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
-        }
-        qpix_op[luma_xy](dest_cb, src_cb, h->mb_linesize); // FIXME try variable height perhaps?
-        if (!square)
-            qpix_op[luma_xy](dest_cb + delta, src_cb + delta, h->mb_linesize);
-
-        src_cr = pic->f.data[2] + offset;
-        if (emu) {
-            h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
-                                     src_cr - (2 << pixel_shift) - 2 * h->mb_linesize,
-                                     h->mb_linesize, h->mb_linesize,
-                                     16 + 5, 16 + 5 /*FIXME*/,
-                                     full_mx - 2, full_my - 2,
-                                     pic_width, pic_height);
-            src_cr = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
-        }
-        qpix_op[luma_xy](dest_cr, src_cr, h->mb_linesize); // FIXME try variable height perhaps?
-        if (!square)
-            qpix_op[luma_xy](dest_cr + delta, src_cr + delta, h->mb_linesize);
-        return;
-    }
-
-    ysh = 3 - (chroma_idc == 2 /* yuv422 */);
-    if (chroma_idc == 1 /* yuv420 */ && MB_FIELD(h)) {
-        // chroma offset when predicting from a field of opposite parity
-        my  += 2 * ((h->mb_y & 1) - (pic->reference - 1));
-        emu |= (my >> 3) < 0 || (my >> 3) + 8 >= (pic_height >> 1);
-    }
-
-    src_cb = pic->f.data[1] + ((mx >> 3) << pixel_shift) +
-             (my >> ysh) * h->mb_uvlinesize;
-    src_cr = pic->f.data[2] + ((mx >> 3) << pixel_shift) +
-             (my >> ysh) * h->mb_uvlinesize;
-
-    if (emu) {
-        h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb,
-                                 h->mb_uvlinesize, h->mb_uvlinesize,
-                                 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
-                                 pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
-        src_cb = h->edge_emu_buffer;
-    }
-    chroma_op(dest_cb, src_cb, h->mb_uvlinesize,
-              height >> (chroma_idc == 1 /* yuv420 */),
-              mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
-
-    if (emu) {
-        h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr,
-                                 h->mb_uvlinesize, h->mb_uvlinesize,
-                                 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
-                                 pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
-        src_cr = h->edge_emu_buffer;
-    }
-    chroma_op(dest_cr, src_cr, h->mb_uvlinesize, height >> (chroma_idc == 1 /* yuv420 */),
-              mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
-}
-
-static av_always_inline void mc_part_std(H264Context *h, int n, int square,
-                                         int height, int delta,
-                                         uint8_t *dest_y, uint8_t *dest_cb,
-                                         uint8_t *dest_cr,
-                                         int x_offset, int y_offset,
-                                         qpel_mc_func *qpix_put,
-                                         h264_chroma_mc_func chroma_put,
-                                         qpel_mc_func *qpix_avg,
-                                         h264_chroma_mc_func chroma_avg,
-                                         int list0, int list1,
-                                         int pixel_shift, int chroma_idc)
-{
-    qpel_mc_func *qpix_op         = qpix_put;
-    h264_chroma_mc_func chroma_op = chroma_put;
-
-    dest_y += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
-    if (chroma_idc == 3 /* yuv444 */) {
-        dest_cb += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
-        dest_cr += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
-    } else if (chroma_idc == 2 /* yuv422 */) {
-        dest_cb += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
-        dest_cr += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
-    } else { /* yuv420 */
-        dest_cb += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
-        dest_cr += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
-    }
-    x_offset += 8 * h->mb_x;
-    y_offset += 8 * (h->mb_y >> MB_FIELD(h));
-
-    if (list0) {
-        Picture *ref = &h->ref_list[0][h->ref_cache[0][scan8[n]]];
-        mc_dir_part(h, ref, n, square, height, delta, 0,
-                    dest_y, dest_cb, dest_cr, x_offset, y_offset,
-                    qpix_op, chroma_op, pixel_shift, chroma_idc);
-
-        qpix_op   = qpix_avg;
-        chroma_op = chroma_avg;
-    }
-
-    if (list1) {
-        Picture *ref = &h->ref_list[1][h->ref_cache[1][scan8[n]]];
-        mc_dir_part(h, ref, n, square, height, delta, 1,
-                    dest_y, dest_cb, dest_cr, x_offset, y_offset,
-                    qpix_op, chroma_op, pixel_shift, chroma_idc);
-    }
-}
-
-static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
-                                              int height, int delta,
-                                              uint8_t *dest_y, uint8_t *dest_cb,
-                                              uint8_t *dest_cr,
-                                              int x_offset, int y_offset,
-                                              qpel_mc_func *qpix_put,
-                                              h264_chroma_mc_func chroma_put,
-                                              h264_weight_func luma_weight_op,
-                                              h264_weight_func chroma_weight_op,
-                                              h264_biweight_func luma_weight_avg,
-                                              h264_biweight_func chroma_weight_avg,
-                                              int list0, int list1,
-                                              int pixel_shift, int chroma_idc)
-{
-    int chroma_height;
-
-    dest_y += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
-    if (chroma_idc == 3 /* yuv444 */) {
-        chroma_height     = height;
-        chroma_weight_avg = luma_weight_avg;
-        chroma_weight_op  = luma_weight_op;
-        dest_cb += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
-        dest_cr += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
-    } else if (chroma_idc == 2 /* yuv422 */) {
-        chroma_height = height;
-        dest_cb      += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
-        dest_cr      += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
-    } else { /* yuv420 */
-        chroma_height = height >> 1;
-        dest_cb      += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
-        dest_cr      += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
-    }
-    x_offset += 8 * h->mb_x;
-    y_offset += 8 * (h->mb_y >> MB_FIELD(h));
-
-    if (list0 && list1) {
-        /* don't optimize for luma-only case, since B-frames usually
-         * use implicit weights => chroma too. */
-        uint8_t *tmp_cb = h->bipred_scratchpad;
-        uint8_t *tmp_cr = h->bipred_scratchpad + (16 << pixel_shift);
-        uint8_t *tmp_y  = h->bipred_scratchpad + 16 * h->mb_uvlinesize;
-        int refn0       = h->ref_cache[0][scan8[n]];
-        int refn1       = h->ref_cache[1][scan8[n]];
-
-        mc_dir_part(h, &h->ref_list[0][refn0], n, square, height, delta, 0,
-                    dest_y, dest_cb, dest_cr,
-                    x_offset, y_offset, qpix_put, chroma_put,
-                    pixel_shift, chroma_idc);
-        mc_dir_part(h, &h->ref_list[1][refn1], n, square, height, delta, 1,
-                    tmp_y, tmp_cb, tmp_cr,
-                    x_offset, y_offset, qpix_put, chroma_put,
-                    pixel_shift, chroma_idc);
-
-        if (h->use_weight == 2) {
-            int weight0 = h->implicit_weight[refn0][refn1][h->mb_y & 1];
-            int weight1 = 64 - weight0;
-            luma_weight_avg(dest_y, tmp_y, h->mb_linesize,
-                            height, 5, weight0, weight1, 0);
-            chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize,
-                              chroma_height, 5, weight0, weight1, 0);
-            chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize,
-                              chroma_height, 5, weight0, weight1, 0);
-        } else {
-            luma_weight_avg(dest_y, tmp_y, h->mb_linesize, height,
-                            h->luma_log2_weight_denom,
-                            h->luma_weight[refn0][0][0],
-                            h->luma_weight[refn1][1][0],
-                            h->luma_weight[refn0][0][1] +
-                            h->luma_weight[refn1][1][1]);
-            chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, chroma_height,
-                              h->chroma_log2_weight_denom,
-                              h->chroma_weight[refn0][0][0][0],
-                              h->chroma_weight[refn1][1][0][0],
-                              h->chroma_weight[refn0][0][0][1] +
-                              h->chroma_weight[refn1][1][0][1]);
-            chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, chroma_height,
-                              h->chroma_log2_weight_denom,
-                              h->chroma_weight[refn0][0][1][0],
-                              h->chroma_weight[refn1][1][1][0],
-                              h->chroma_weight[refn0][0][1][1] +
-                              h->chroma_weight[refn1][1][1][1]);
-        }
-    } else {
-        int list     = list1 ? 1 : 0;
-        int refn     = h->ref_cache[list][scan8[n]];
-        Picture *ref = &h->ref_list[list][refn];
-        mc_dir_part(h, ref, n, square, height, delta, list,
-                    dest_y, dest_cb, dest_cr, x_offset, y_offset,
-                    qpix_put, chroma_put, pixel_shift, chroma_idc);
-
-        luma_weight_op(dest_y, h->mb_linesize, height,
-                       h->luma_log2_weight_denom,
-                       h->luma_weight[refn][list][0],
-                       h->luma_weight[refn][list][1]);
-        if (h->use_weight_chroma) {
-            chroma_weight_op(dest_cb, h->mb_uvlinesize, chroma_height,
-                             h->chroma_log2_weight_denom,
-                             h->chroma_weight[refn][list][0][0],
-                             h->chroma_weight[refn][list][0][1]);
-            chroma_weight_op(dest_cr, h->mb_uvlinesize, chroma_height,
-                             h->chroma_log2_weight_denom,
-                             h->chroma_weight[refn][list][1][0],
-                             h->chroma_weight[refn][list][1][1]);
-        }
-    }
-}
-
-static av_always_inline void prefetch_motion(H264Context *h, int list,
-                                             int pixel_shift, int chroma_idc)
-{
-    /* fetch pixels for estimated mv 4 macroblocks ahead
-     * optimized for 64byte cache lines */
-    const int refn = h->ref_cache[list][scan8[0]];
-    if (refn >= 0) {
-        const int mx  = (h->mv_cache[list][scan8[0]][0] >> 2) + 16 * h->mb_x + 8;
-        const int my  = (h->mv_cache[list][scan8[0]][1] >> 2) + 16 * h->mb_y;
-        uint8_t **src = h->ref_list[list][refn].f.data;
-        int off       = (mx << pixel_shift) +
-                        (my + (h->mb_x & 3) * 4) * h->mb_linesize +
-                        (64 << pixel_shift);
-        h->vdsp.prefetch(src[0] + off, h->linesize, 4);
-        if (chroma_idc == 3 /* yuv444 */) {
-            h->vdsp.prefetch(src[1] + off, h->linesize, 4);
-            h->vdsp.prefetch(src[2] + off, h->linesize, 4);
-        } else {
-            off = ((mx >> 1) << pixel_shift) +
-                  ((my >> 1) + (h->mb_x & 7)) * h->uvlinesize +
-                  (64 << pixel_shift);
-            h->vdsp.prefetch(src[1] + off, src[2] - src[1], 2);
-        }
-    }
-}
-
-static void free_tables(H264Context *h, int free_rbsp)
-{
-    int i;
-    H264Context *hx;
-
-    av_freep(&h->intra4x4_pred_mode);
-    av_freep(&h->chroma_pred_mode_table);
-    av_freep(&h->cbp_table);
-    av_freep(&h->mvd_table[0]);
-    av_freep(&h->mvd_table[1]);
-    av_freep(&h->direct_table);
-    av_freep(&h->non_zero_count);
-    av_freep(&h->slice_table_base);
-    h->slice_table = NULL;
-    av_freep(&h->list_counts);
-
-    av_freep(&h->mb2b_xy);
-    av_freep(&h->mb2br_xy);
-
-    av_buffer_pool_uninit(&h->qscale_table_pool);
-    av_buffer_pool_uninit(&h->mb_type_pool);
-    av_buffer_pool_uninit(&h->motion_val_pool);
-    av_buffer_pool_uninit(&h->ref_index_pool);
-
-    if (free_rbsp && h->DPB) {
-        for (i = 0; i < MAX_PICTURE_COUNT; i++)
-            unref_picture(h, &h->DPB[i]);
-        av_freep(&h->DPB);
-    } else if (h->DPB) {
-        for (i = 0; i < MAX_PICTURE_COUNT; i++)
-            h->DPB[i].needs_realloc = 1;
-    }
-
-    h->cur_pic_ptr = NULL;
-
-    for (i = 0; i < MAX_THREADS; i++) {
-        hx = h->thread_context[i];
-        if (!hx)
-            continue;
-        av_freep(&hx->top_borders[1]);
-        av_freep(&hx->top_borders[0]);
-        av_freep(&hx->bipred_scratchpad);
-        av_freep(&hx->edge_emu_buffer);
-        av_freep(&hx->dc_val_base);
-        av_freep(&hx->me.scratchpad);
-        av_freep(&hx->er.mb_index2xy);
-        av_freep(&hx->er.error_status_table);
-        av_freep(&hx->er.er_temp_buffer);
-        av_freep(&hx->er.mbintra_table);
-        av_freep(&hx->er.mbskip_table);
-
-        if (free_rbsp) {
-            av_freep(&hx->rbsp_buffer[1]);
-            av_freep(&hx->rbsp_buffer[0]);
-            hx->rbsp_buffer_size[0] = 0;
-            hx->rbsp_buffer_size[1] = 0;
-        }
-        if (i)
-            av_freep(&h->thread_context[i]);
-    }
-}
-
-static void init_dequant8_coeff_table(H264Context *h)
-{
-    int i, j, q, x;
-    const int max_qp = 51 + 6 * (h->sps.bit_depth_luma - 8);
-
-    for (i = 0; i < 6; i++) {
-        h->dequant8_coeff[i] = h->dequant8_buffer[i];
-        for (j = 0; j < i; j++)
-            if (!memcmp(h->pps.scaling_matrix8[j], h->pps.scaling_matrix8[i],
-                        64 * sizeof(uint8_t))) {
-                h->dequant8_coeff[i] = h->dequant8_buffer[j];
-                break;
-            }
-        if (j < i)
-            continue;
-
-        for (q = 0; q < max_qp + 1; q++) {
-            int shift = div6[q];
-            int idx   = rem6[q];
-            for (x = 0; x < 64; x++)
-                h->dequant8_coeff[i][q][(x >> 3) | ((x & 7) << 3)] =
-                    ((uint32_t)dequant8_coeff_init[idx][dequant8_coeff_init_scan[((x >> 1) & 12) | (x & 3)]] *
-                     h->pps.scaling_matrix8[i][x]) << shift;
-        }
-    }
-}
-
-static void init_dequant4_coeff_table(H264Context *h)
-{
-    int i, j, q, x;
-    const int max_qp = 51 + 6 * (h->sps.bit_depth_luma - 8);
-    for (i = 0; i < 6; i++) {
-        h->dequant4_coeff[i] = h->dequant4_buffer[i];
-        for (j = 0; j < i; j++)
-            if (!memcmp(h->pps.scaling_matrix4[j], h->pps.scaling_matrix4[i],
-                        16 * sizeof(uint8_t))) {
-                h->dequant4_coeff[i] = h->dequant4_buffer[j];
-                break;
-            }
-        if (j < i)
-            continue;
-
-        for (q = 0; q < max_qp + 1; q++) {
-            int shift = div6[q] + 2;
-            int idx   = rem6[q];
-            for (x = 0; x < 16; x++)
-                h->dequant4_coeff[i][q][(x >> 2) | ((x << 2) & 0xF)] =
-                    ((uint32_t)dequant4_coeff_init[idx][(x & 1) + ((x >> 2) & 1)] *
-                     h->pps.scaling_matrix4[i][x]) << shift;
-        }
-    }
-}
-
-static void init_dequant_tables(H264Context *h)
-{
-    int i, x;
-    init_dequant4_coeff_table(h);
-    if (h->pps.transform_8x8_mode)
-        init_dequant8_coeff_table(h);
-    if (h->sps.transform_bypass) {
-        for (i = 0; i < 6; i++)
-            for (x = 0; x < 16; x++)
-                h->dequant4_coeff[i][0][x] = 1 << 6;
-        if (h->pps.transform_8x8_mode)
-            for (i = 0; i < 6; i++)
-                for (x = 0; x < 64; x++)
-                    h->dequant8_coeff[i][0][x] = 1 << 6;
-    }
-}
-
-int ff_h264_alloc_tables(H264Context *h)
-{
-    const int big_mb_num = h->mb_stride * (h->mb_height + 1);
-    const int row_mb_num = h->mb_stride * 2 * h->avctx->thread_count;
-    int x, y, i;
-
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->intra4x4_pred_mode,
-                      row_mb_num * 8 * sizeof(uint8_t), fail)
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->non_zero_count,
-                      big_mb_num * 48 * sizeof(uint8_t), fail)
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->slice_table_base,
-                      (big_mb_num + h->mb_stride) * sizeof(*h->slice_table_base), fail)
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->cbp_table,
-                      big_mb_num * sizeof(uint16_t), fail)
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->chroma_pred_mode_table,
-                      big_mb_num * sizeof(uint8_t), fail)
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->mvd_table[0],
-                      16 * row_mb_num * sizeof(uint8_t), fail);
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->mvd_table[1],
-                      16 * row_mb_num * sizeof(uint8_t), fail);
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->direct_table,
-                      4 * big_mb_num * sizeof(uint8_t), fail);
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->list_counts,
-                      big_mb_num * sizeof(uint8_t), fail)
-
-    memset(h->slice_table_base, -1,
-           (big_mb_num + h->mb_stride) * sizeof(*h->slice_table_base));
-    h->slice_table = h->slice_table_base + h->mb_stride * 2 + 1;
-
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->mb2b_xy,
-                      big_mb_num * sizeof(uint32_t), fail);
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->mb2br_xy,
-                      big_mb_num * sizeof(uint32_t), fail);
-    for (y = 0; y < h->mb_height; y++)
-        for (x = 0; x < h->mb_width; x++) {
-            const int mb_xy = x + y * h->mb_stride;
-            const int b_xy  = 4 * x + 4 * y * h->b_stride;
-
-            h->mb2b_xy[mb_xy]  = b_xy;
-            h->mb2br_xy[mb_xy] = 8 * (FMO ? mb_xy : (mb_xy % (2 * h->mb_stride)));
-        }
-
-    if (!h->dequant4_coeff[0])
-        init_dequant_tables(h);
-
-    if (!h->DPB) {
-        h->DPB = av_mallocz_array(MAX_PICTURE_COUNT, sizeof(*h->DPB));
-        if (!h->DPB)
-            return AVERROR(ENOMEM);
-        for (i = 0; i < MAX_PICTURE_COUNT; i++)
-            av_frame_unref(&h->DPB[i].f);
-        av_frame_unref(&h->cur_pic.f);
-    }
-
-    return 0;
-
-fail:
-    free_tables(h, 1);
-    return AVERROR(ENOMEM);
-}
-
-/**
- * Mimic alloc_tables(), but for every context thread.
- */
-static void clone_tables(H264Context *dst, H264Context *src, int i)
-{
-    dst->intra4x4_pred_mode     = src->intra4x4_pred_mode + i * 8 * 2 * src->mb_stride;
-    dst->non_zero_count         = src->non_zero_count;
-    dst->slice_table            = src->slice_table;
-    dst->cbp_table              = src->cbp_table;
-    dst->mb2b_xy                = src->mb2b_xy;
-    dst->mb2br_xy               = src->mb2br_xy;
-    dst->chroma_pred_mode_table = src->chroma_pred_mode_table;
-    dst->mvd_table[0]           = src->mvd_table[0] + i * 8 * 2 * src->mb_stride;
-    dst->mvd_table[1]           = src->mvd_table[1] + i * 8 * 2 * src->mb_stride;
-    dst->direct_table           = src->direct_table;
-    dst->list_counts            = src->list_counts;
-    dst->DPB                    = src->DPB;
-    dst->cur_pic_ptr            = src->cur_pic_ptr;
-    dst->cur_pic                = src->cur_pic;
-    dst->bipred_scratchpad      = NULL;
-    dst->edge_emu_buffer        = NULL;
-    dst->me.scratchpad          = NULL;
-    ff_h264_pred_init(&dst->hpc, src->avctx->codec_id, src->sps.bit_depth_luma,
-                      src->sps.chroma_format_idc);
-}
-
-/**
- * Init context
- * Allocate buffers which are not shared amongst multiple threads.
- */
-static int context_init(H264Context *h)
-{
-    ERContext *er = &h->er;
-    int mb_array_size = h->mb_height * h->mb_stride;
-    int y_size  = (2 * h->mb_width + 1) * (2 * h->mb_height + 1);
-    int c_size  = h->mb_stride * (h->mb_height + 1);
-    int yc_size = y_size + 2   * c_size;
-    int x, y, i;
-
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->top_borders[0],
-                      h->mb_width * 16 * 3 * sizeof(uint8_t) * 2, fail)
-    FF_ALLOCZ_OR_GOTO(h->avctx, h->top_borders[1],
-                      h->mb_width * 16 * 3 * sizeof(uint8_t) * 2, fail)
-
-    h->ref_cache[0][scan8[5]  + 1] =
-    h->ref_cache[0][scan8[7]  + 1] =
-    h->ref_cache[0][scan8[13] + 1] =
-    h->ref_cache[1][scan8[5]  + 1] =
-    h->ref_cache[1][scan8[7]  + 1] =
-    h->ref_cache[1][scan8[13] + 1] = PART_NOT_AVAILABLE;
-
-    if (CONFIG_ERROR_RESILIENCE) {
-        /* init ER */
-        er->avctx          = h->avctx;
-        er->dsp            = &h->dsp;
-        er->decode_mb      = h264_er_decode_mb;
-        er->opaque         = h;
-        er->quarter_sample = 1;
-
-        er->mb_num      = h->mb_num;
-        er->mb_width    = h->mb_width;
-        er->mb_height   = h->mb_height;
-        er->mb_stride   = h->mb_stride;
-        er->b8_stride   = h->mb_width * 2 + 1;
-
-        FF_ALLOCZ_OR_GOTO(h->avctx, er->mb_index2xy, (h->mb_num + 1) * sizeof(int),
-                          fail); // error ressilience code looks cleaner with this
-        for (y = 0; y < h->mb_height; y++)
-            for (x = 0; x < h->mb_width; x++)
-                er->mb_index2xy[x + y * h->mb_width] = x + y * h->mb_stride;
-
-        er->mb_index2xy[h->mb_height * h->mb_width] = (h->mb_height - 1) *
-                                                      h->mb_stride + h->mb_width;
-
-        FF_ALLOCZ_OR_GOTO(h->avctx, er->error_status_table,
-                          mb_array_size * sizeof(uint8_t), fail);
-
-        FF_ALLOC_OR_GOTO(h->avctx, er->mbintra_table, mb_array_size, fail);
-        memset(er->mbintra_table, 1, mb_array_size);
-
-        FF_ALLOCZ_OR_GOTO(h->avctx, er->mbskip_table, mb_array_size + 2, fail);
-
-        FF_ALLOC_OR_GOTO(h->avctx, er->er_temp_buffer, h->mb_height * h->mb_stride,
-                         fail);
-
-        FF_ALLOCZ_OR_GOTO(h->avctx, h->dc_val_base, yc_size * sizeof(int16_t), fail);
-        er->dc_val[0] = h->dc_val_base + h->mb_width * 2 + 2;
-        er->dc_val[1] = h->dc_val_base + y_size + h->mb_stride + 1;
-        er->dc_val[2] = er->dc_val[1] + c_size;
-        for (i = 0; i < yc_size; i++)
-            h->dc_val_base[i] = 1024;
-    }
-
-    return 0;
-
-fail:
-    return AVERROR(ENOMEM); // free_tables will clean up for us
-}
-
-static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
-                            int parse_extradata);
-
-int ff_h264_decode_extradata(H264Context *h)
-{
-    AVCodecContext *avctx = h->avctx;
-    int ret;
-
-    if (avctx->extradata[0] == 1) {
-        int i, cnt, nalsize;
-        unsigned char *p = avctx->extradata;
-
-        h->is_avc = 1;
-
-        if (avctx->extradata_size < 7) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "avcC %d too short\n", avctx->extradata_size);
-            return AVERROR_INVALIDDATA;
-        }
-        /* sps and pps in the avcC always have length coded with 2 bytes,
-         * so put a fake nal_length_size = 2 while parsing them */
-        h->nal_length_size = 2;
-        // Decode sps from avcC
-        cnt = *(p + 5) & 0x1f; // Number of sps
-        p  += 6;
-        for (i = 0; i < cnt; i++) {
-            nalsize = AV_RB16(p) + 2;
-            if (p - avctx->extradata + nalsize > avctx->extradata_size)
-                return AVERROR_INVALIDDATA;
-            ret = decode_nal_units(h, p, nalsize, 1);
-            if (ret < 0) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Decoding sps %d from avcC failed\n", i);
-                return ret;
-            }
-            p += nalsize;
-        }
-        // Decode pps from avcC
-        cnt = *(p++); // Number of pps
-        for (i = 0; i < cnt; i++) {
-            nalsize = AV_RB16(p) + 2;
-            if (p - avctx->extradata + nalsize > avctx->extradata_size)
-                return AVERROR_INVALIDDATA;
-            ret = decode_nal_units(h, p, nalsize, 1);
-            if (ret < 0) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Decoding pps %d from avcC failed\n", i);
-                return ret;
-            }
-            p += nalsize;
-        }
-        // Now store right nal length size, that will be used to parse all other nals
-        h->nal_length_size = (avctx->extradata[4] & 0x03) + 1;
-    } else {
-        h->is_avc = 0;
-        ret = decode_nal_units(h, avctx->extradata, avctx->extradata_size, 1);
-        if (ret < 0)
-            return ret;
-    }
-    return 0;
-}
-
-av_cold int ff_h264_decode_init(AVCodecContext *avctx)
-{
-    H264Context *h = avctx->priv_data;
-    int i;
-    int ret;
-
-    h->avctx = avctx;
-
-    h->bit_depth_luma    = 8;
-    h->chroma_format_idc = 1;
-
-    ff_h264dsp_init(&h->h264dsp, 8, 1);
-    ff_h264chroma_init(&h->h264chroma, h->sps.bit_depth_chroma);
-    ff_h264qpel_init(&h->h264qpel, 8);
-    ff_h264_pred_init(&h->hpc, h->avctx->codec_id, 8, 1);
-
-    h->dequant_coeff_pps = -1;
-
-    /* needed so that IDCT permutation is known early */
-    if (CONFIG_ERROR_RESILIENCE)
-        ff_dsputil_init(&h->dsp, h->avctx);
-    ff_videodsp_init(&h->vdsp, 8);
-
-    memset(h->pps.scaling_matrix4, 16, 6 * 16 * sizeof(uint8_t));
-    memset(h->pps.scaling_matrix8, 16, 2 * 64 * sizeof(uint8_t));
-
-    h->picture_structure   = PICT_FRAME;
-    h->slice_context_count = 1;
-    h->workaround_bugs     = avctx->workaround_bugs;
-    h->flags               = avctx->flags;
-
-    /* set defaults */
-    // s->decode_mb = ff_h263_decode_mb;
-    if (!avctx->has_b_frames)
-        h->low_delay = 1;
-
-    avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
-
-    ff_h264_decode_init_vlc();
-
-    ff_init_cabac_states();
-
-    h->pixel_shift        = 0;
-    h->sps.bit_depth_luma = avctx->bits_per_raw_sample = 8;
-
-    h->thread_context[0] = h;
-    h->outputed_poc      = h->next_outputed_poc = INT_MIN;
-    for (i = 0; i < MAX_DELAYED_PIC_COUNT; i++)
-        h->last_pocs[i] = INT_MIN;
-    h->prev_poc_msb = 1 << 16;
-    h->x264_build   = -1;
-    ff_h264_reset_sei(h);
-    h->recovery_frame = -1;
-    h->frame_recovered = 0;
-    if (avctx->codec_id == AV_CODEC_ID_H264) {
-        if (avctx->ticks_per_frame == 1)
-            h->avctx->time_base.den *= 2;
-        avctx->ticks_per_frame = 2;
-    }
-
-    if (avctx->extradata_size > 0 && avctx->extradata) {
-       ret = ff_h264_decode_extradata(h);
-       if (ret < 0)
-           return ret;
-    }
-
-    if (h->sps.bitstream_restriction_flag &&
-        h->avctx->has_b_frames < h->sps.num_reorder_frames) {
-        h->avctx->has_b_frames = h->sps.num_reorder_frames;
-        h->low_delay           = 0;
-    }
-
-    avctx->internal->allocate_progress = 1;
-
-    return 0;
-}
-
-#define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b) + (size))))
-#undef REBASE_PICTURE
-#define REBASE_PICTURE(pic, new_ctx, old_ctx)             \
-    ((pic && pic >= old_ctx->DPB &&                       \
-      pic < old_ctx->DPB + MAX_PICTURE_COUNT) ?           \
-     &new_ctx->DPB[pic - old_ctx->DPB] : NULL)
-
-static void copy_picture_range(Picture **to, Picture **from, int count,
-                               H264Context *new_base,
-                               H264Context *old_base)
-{
-    int i;
-
-    for (i = 0; i < count; i++) {
-        assert((IN_RANGE(from[i], old_base, sizeof(*old_base)) ||
-                IN_RANGE(from[i], old_base->DPB,
-                         sizeof(Picture) * MAX_PICTURE_COUNT) ||
-                !from[i]));
-        to[i] = REBASE_PICTURE(from[i], new_base, old_base);
-    }
-}
-
-static int copy_parameter_set(void **to, void **from, int count, int size)
-{
-    int i;
-
-    for (i = 0; i < count; i++) {
-        if (to[i] && !from[i]) {
-            av_freep(&to[i]);
-        } else if (from[i] && !to[i]) {
-            to[i] = av_malloc(size);
-            if (!to[i])
-                return AVERROR(ENOMEM);
-        }
-
-        if (from[i])
-            memcpy(to[i], from[i], size);
-    }
-
-    return 0;
-}
-
-static int decode_init_thread_copy(AVCodecContext *avctx)
-{
-    H264Context *h = avctx->priv_data;
-
-    if (!avctx->internal->is_copy)
-        return 0;
-    memset(h->sps_buffers, 0, sizeof(h->sps_buffers));
-    memset(h->pps_buffers, 0, sizeof(h->pps_buffers));
-
-    h->context_initialized = 0;
-
-    return 0;
-}
-
-#define copy_fields(to, from, start_field, end_field)                   \
-    memcpy(&to->start_field, &from->start_field,                        \
-           (char *)&to->end_field - (char *)&to->start_field)
-
-static int h264_slice_header_init(H264Context *, int);
-
-static int h264_set_parameter_from_sps(H264Context *h);
-
-static int decode_update_thread_context(AVCodecContext *dst,
-                                        const AVCodecContext *src)
-{
-    H264Context *h = dst->priv_data, *h1 = src->priv_data;
-    int inited = h->context_initialized, err = 0;
-    int context_reinitialized = 0;
-    int i, ret;
-
-    if (dst == src || !h1->context_initialized)
-        return 0;
-
-    if (inited &&
-        (h->width                 != h1->width                 ||
-         h->height                != h1->height                ||
-         h->mb_width              != h1->mb_width              ||
-         h->mb_height             != h1->mb_height             ||
-         h->sps.bit_depth_luma    != h1->sps.bit_depth_luma    ||
-         h->sps.chroma_format_idc != h1->sps.chroma_format_idc ||
-         h->sps.colorspace        != h1->sps.colorspace)) {
-
-        /* set bits_per_raw_sample to the previous value. the check for changed
-         * bit depth in h264_set_parameter_from_sps() uses it and sets it to
-         * the current value */
-        h->avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
-
-        av_freep(&h->bipred_scratchpad);
-
-        h->width     = h1->width;
-        h->height    = h1->height;
-        h->mb_height = h1->mb_height;
-        h->mb_width  = h1->mb_width;
-        h->mb_num    = h1->mb_num;
-        h->mb_stride = h1->mb_stride;
-        h->b_stride  = h1->b_stride;
-
-        if ((err = h264_slice_header_init(h, 1)) < 0) {
-            av_log(h->avctx, AV_LOG_ERROR, "h264_slice_header_init() failed");
-            return err;
-        }
-        context_reinitialized = 1;
-
-        /* update linesize on resize. The decoder doesn't
-         * necessarily call h264_frame_start in the new thread */
-        h->linesize   = h1->linesize;
-        h->uvlinesize = h1->uvlinesize;
-
-        /* copy block_offset since frame_start may not be called */
-        memcpy(h->block_offset, h1->block_offset, sizeof(h->block_offset));
-    }
-
-    if (!inited) {
-        for (i = 0; i < MAX_SPS_COUNT; i++)
-            av_freep(h->sps_buffers + i);
-
-        for (i = 0; i < MAX_PPS_COUNT; i++)
-            av_freep(h->pps_buffers + i);
-
-        memcpy(h, h1, sizeof(*h1));
-        memset(h->sps_buffers, 0, sizeof(h->sps_buffers));
-        memset(h->pps_buffers, 0, sizeof(h->pps_buffers));
-        memset(&h->er, 0, sizeof(h->er));
-        memset(&h->me, 0, sizeof(h->me));
-        memset(&h->mb, 0, sizeof(h->mb));
-        memset(&h->mb_luma_dc, 0, sizeof(h->mb_luma_dc));
-        memset(&h->mb_padding, 0, sizeof(h->mb_padding));
-        h->context_initialized = 0;
-
-        memset(&h->cur_pic, 0, sizeof(h->cur_pic));
-        av_frame_unref(&h->cur_pic.f);
-        h->cur_pic.tf.f = &h->cur_pic.f;
-
-        h->avctx             = dst;
-        h->DPB               = NULL;
-        h->qscale_table_pool = NULL;
-        h->mb_type_pool      = NULL;
-        h->ref_index_pool    = NULL;
-        h->motion_val_pool   = NULL;
-
-        ret = ff_h264_alloc_tables(h);
-        if (ret < 0) {
-            av_log(dst, AV_LOG_ERROR, "Could not allocate memory\n");
-            return ret;
-        }
-        ret = context_init(h);
-        if (ret < 0) {
-            av_log(dst, AV_LOG_ERROR, "context_init() failed.\n");
-            return ret;
-        }
-
-        for (i = 0; i < 2; i++) {
-            h->rbsp_buffer[i]      = NULL;
-            h->rbsp_buffer_size[i] = 0;
-        }
-        h->bipred_scratchpad = NULL;
-        h->edge_emu_buffer   = NULL;
-
-        h->thread_context[0] = h;
-
-        h->context_initialized = 1;
-    }
-
-    h->avctx->coded_height  = h1->avctx->coded_height;
-    h->avctx->coded_width   = h1->avctx->coded_width;
-    h->avctx->width         = h1->avctx->width;
-    h->avctx->height        = h1->avctx->height;
-    h->coded_picture_number = h1->coded_picture_number;
-    h->first_field          = h1->first_field;
-    h->picture_structure    = h1->picture_structure;
-    h->qscale               = h1->qscale;
-    h->droppable            = h1->droppable;
-    h->low_delay            = h1->low_delay;
-
-    for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-        unref_picture(h, &h->DPB[i]);
-        if (h1->DPB[i].f.buf[0] &&
-            (ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
-            return ret;
-    }
-
-    h->cur_pic_ptr = REBASE_PICTURE(h1->cur_pic_ptr, h, h1);
-    unref_picture(h, &h->cur_pic);
-    if ((ret = ref_picture(h, &h->cur_pic, &h1->cur_pic)) < 0)
-        return ret;
-
-    h->workaround_bugs = h1->workaround_bugs;
-    h->low_delay       = h1->low_delay;
-    h->droppable       = h1->droppable;
-
-    /* frame_start may not be called for the next thread (if it's decoding
-     * a bottom field) so this has to be allocated here */
-    err = alloc_scratch_buffers(h, h1->linesize);
-    if (err < 0)
-        return err;
-
-    // extradata/NAL handling
-    h->is_avc = h1->is_avc;
-
-    // SPS/PPS
-    if ((ret = copy_parameter_set((void **)h->sps_buffers,
-                                  (void **)h1->sps_buffers,
-                                  MAX_SPS_COUNT, sizeof(SPS))) < 0)
-        return ret;
-    h->sps = h1->sps;
-    if ((ret = copy_parameter_set((void **)h->pps_buffers,
-                                  (void **)h1->pps_buffers,
-                                  MAX_PPS_COUNT, sizeof(PPS))) < 0)
-        return ret;
-    h->pps = h1->pps;
-
-    // Dequantization matrices
-    // FIXME these are big - can they be only copied when PPS changes?
-    copy_fields(h, h1, dequant4_buffer, dequant4_coeff);
-
-    for (i = 0; i < 6; i++)
-        h->dequant4_coeff[i] = h->dequant4_buffer[0] +
-                               (h1->dequant4_coeff[i] - h1->dequant4_buffer[0]);
-
-    for (i = 0; i < 6; i++)
-        h->dequant8_coeff[i] = h->dequant8_buffer[0] +
-                               (h1->dequant8_coeff[i] - h1->dequant8_buffer[0]);
-
-    h->dequant_coeff_pps = h1->dequant_coeff_pps;
-
-    // POC timing
-    copy_fields(h, h1, poc_lsb, redundant_pic_count);
-
-    // reference lists
-    copy_fields(h, h1, short_ref, cabac_init_idc);
-
-    copy_picture_range(h->short_ref, h1->short_ref, 32, h, h1);
-    copy_picture_range(h->long_ref, h1->long_ref, 32, h, h1);
-    copy_picture_range(h->delayed_pic, h1->delayed_pic,
-                       MAX_DELAYED_PIC_COUNT + 2, h, h1);
-
-    h->last_slice_type = h1->last_slice_type;
-
-    if (context_reinitialized)
-        h264_set_parameter_from_sps(h);
-
-    if (!h->cur_pic_ptr)
-        return 0;
-
-    if (!h->droppable) {
-        err = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
-        h->prev_poc_msb = h->poc_msb;
-        h->prev_poc_lsb = h->poc_lsb;
-    }
-    h->prev_frame_num_offset = h->frame_num_offset;
-    h->prev_frame_num        = h->frame_num;
-    h->outputed_poc          = h->next_outputed_poc;
-
-    h->recovery_frame        = h1->recovery_frame;
-    h->frame_recovered       = h1->frame_recovered;
-
-    return err;
-}
-
-static int h264_frame_start(H264Context *h)
-{
-    Picture *pic;
-    int i, ret;
-    const int pixel_shift = h->pixel_shift;
-
-    release_unused_pictures(h, 1);
-    h->cur_pic_ptr = NULL;
-
-    i = find_unused_picture(h);
-    if (i < 0) {
-        av_log(h->avctx, AV_LOG_ERROR, "no frame buffer available\n");
-        return i;
-    }
-    pic = &h->DPB[i];
-
-    pic->reference              = h->droppable ? 0 : h->picture_structure;
-    pic->f.coded_picture_number = h->coded_picture_number++;
-    pic->field_picture          = h->picture_structure != PICT_FRAME;
-    /*
-     * Zero key_frame here; IDR markings per slice in frame or fields are ORed
-     * in later.
-     * See decode_nal_units().
-     */
-    pic->f.key_frame = 0;
-    pic->mmco_reset  = 0;
-    pic->recovered   = 0;
-
-    if ((ret = alloc_picture(h, pic)) < 0)
-        return ret;
-
-    h->cur_pic_ptr = pic;
-    unref_picture(h, &h->cur_pic);
-    if ((ret = ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0)
-        return ret;
-
-    if (CONFIG_ERROR_RESILIENCE)
-        ff_er_frame_start(&h->er);
-
-    assert(h->linesize && h->uvlinesize);
-
-    for (i = 0; i < 16; i++) {
-        h->block_offset[i]           = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 4 * h->linesize * ((scan8[i] - scan8[0]) >> 3);
-        h->block_offset[48 + i]      = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 8 * h->linesize * ((scan8[i] - scan8[0]) >> 3);
-    }
-    for (i = 0; i < 16; i++) {
-        h->block_offset[16 + i]      =
-        h->block_offset[32 + i]      = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 4 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3);
-        h->block_offset[48 + 16 + i] =
-        h->block_offset[48 + 32 + i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 8 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3);
-    }
-
-    /* can't be in alloc_tables because linesize isn't known there.
-     * FIXME: redo bipred weight to not require extra buffer? */
-    for (i = 0; i < h->slice_context_count; i++)
-        if (h->thread_context[i]) {
-            ret = alloc_scratch_buffers(h->thread_context[i], h->linesize);
-            if (ret < 0)
-                return ret;
-        }
-
-    /* Some macroblocks can be accessed before they're available in case
-     * of lost slices, MBAFF or threading. */
-    memset(h->slice_table, -1,
-           (h->mb_height * h->mb_stride - 1) * sizeof(*h->slice_table));
-
-    // s->decode = (s->flags & CODEC_FLAG_PSNR) || !s->encoding ||
-    //             s->current_picture.f.reference /* || h->contains_intra */ || 1;
-
-    /* We mark the current picture as non-reference after allocating it, so
-     * that if we break out due to an error it can be released automatically
-     * in the next ff_MPV_frame_start().
-     */
-    h->cur_pic_ptr->reference = 0;
-
-    h->cur_pic_ptr->field_poc[0] = h->cur_pic_ptr->field_poc[1] = INT_MAX;
-
-    h->next_output_pic = NULL;
-
-    assert(h->cur_pic_ptr->long_ref == 0);
-
-    return 0;
-}
-
-/**
- * Run setup operations that must be run after slice header decoding.
- * This includes finding the next displayed frame.
- *
- * @param h h264 master context
- * @param setup_finished enough NALs have been read that we can call
- * ff_thread_finish_setup()
- */
-static void decode_postinit(H264Context *h, int setup_finished)
-{
-    Picture *out = h->cur_pic_ptr;
-    Picture *cur = h->cur_pic_ptr;
-    int i, pics, out_of_order, out_idx;
-    int invalid = 0, cnt = 0;
-
-    h->cur_pic_ptr->f.pict_type = h->pict_type;
-
-    if (h->next_output_pic)
-        return;
-
-    if (cur->field_poc[0] == INT_MAX || cur->field_poc[1] == INT_MAX) {
-        /* FIXME: if we have two PAFF fields in one packet, we can't start
-         * the next thread here. If we have one field per packet, we can.
-         * The check in decode_nal_units() is not good enough to find this
-         * yet, so we assume the worst for now. */
-        // if (setup_finished)
-        //    ff_thread_finish_setup(h->avctx);
-        return;
-    }
-
-    cur->f.interlaced_frame = 0;
-    cur->f.repeat_pict      = 0;
-
-    /* Signal interlacing information externally. */
-    /* Prioritize picture timing SEI information over used
-     * decoding process if it exists. */
-
-    if (h->sps.pic_struct_present_flag) {
-        switch (h->sei_pic_struct) {
-        case SEI_PIC_STRUCT_FRAME:
-            break;
-        case SEI_PIC_STRUCT_TOP_FIELD:
-        case SEI_PIC_STRUCT_BOTTOM_FIELD:
-            cur->f.interlaced_frame = 1;
-            break;
-        case SEI_PIC_STRUCT_TOP_BOTTOM:
-        case SEI_PIC_STRUCT_BOTTOM_TOP:
-            if (FIELD_OR_MBAFF_PICTURE(h))
-                cur->f.interlaced_frame = 1;
-            else
-                // try to flag soft telecine progressive
-                cur->f.interlaced_frame = h->prev_interlaced_frame;
-            break;
-        case SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
-        case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
-            /* Signal the possibility of telecined film externally
-             * (pic_struct 5,6). From these hints, let the applications
-             * decide if they apply deinterlacing. */
-            cur->f.repeat_pict = 1;
-            break;
-        case SEI_PIC_STRUCT_FRAME_DOUBLING:
-            cur->f.repeat_pict = 2;
-            break;
-        case SEI_PIC_STRUCT_FRAME_TRIPLING:
-            cur->f.repeat_pict = 4;
-            break;
-        }
-
-        if ((h->sei_ct_type & 3) &&
-            h->sei_pic_struct <= SEI_PIC_STRUCT_BOTTOM_TOP)
-            cur->f.interlaced_frame = (h->sei_ct_type & (1 << 1)) != 0;
-    } else {
-        /* Derive interlacing flag from used decoding process. */
-        cur->f.interlaced_frame = FIELD_OR_MBAFF_PICTURE(h);
-    }
-    h->prev_interlaced_frame = cur->f.interlaced_frame;
-
-    if (cur->field_poc[0] != cur->field_poc[1]) {
-        /* Derive top_field_first from field pocs. */
-        cur->f.top_field_first = cur->field_poc[0] < cur->field_poc[1];
-    } else {
-        if (cur->f.interlaced_frame || h->sps.pic_struct_present_flag) {
-            /* Use picture timing SEI information. Even if it is a
-             * information of a past frame, better than nothing. */
-            if (h->sei_pic_struct == SEI_PIC_STRUCT_TOP_BOTTOM ||
-                h->sei_pic_struct == SEI_PIC_STRUCT_TOP_BOTTOM_TOP)
-                cur->f.top_field_first = 1;
-            else
-                cur->f.top_field_first = 0;
-        } else {
-            /* Most likely progressive */
-            cur->f.top_field_first = 0;
-        }
-    }
-
-    if (h->sei_frame_packing_present &&
-        h->frame_packing_arrangement_type >= 0 &&
-        h->frame_packing_arrangement_type <= 6 &&
-        h->content_interpretation_type > 0 &&
-        h->content_interpretation_type < 3) {
-        AVStereo3D *stereo = av_stereo3d_create_side_data(&cur->f);
-        if (!stereo)
-            return;
-
-        switch (h->frame_packing_arrangement_type) {
-        case 0:
-            stereo->type = AV_STEREO3D_CHECKERBOARD;
-            break;
-        case 1:
-            stereo->type = AV_STEREO3D_LINES;
-            break;
-        case 2:
-            stereo->type = AV_STEREO3D_COLUMNS;
-            break;
-        case 3:
-            if (h->quincunx_subsampling)
-                stereo->type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX;
-            else
-                stereo->type = AV_STEREO3D_SIDEBYSIDE;
-            break;
-        case 4:
-            stereo->type = AV_STEREO3D_TOPBOTTOM;
-            break;
-        case 5:
-            stereo->type = AV_STEREO3D_FRAMESEQUENCE;
-            break;
-        case 6:
-            stereo->type = AV_STEREO3D_2D;
-            break;
-        }
-
-        if (h->content_interpretation_type == 2)
-            stereo->flags = AV_STEREO3D_FLAG_INVERT;
-    }
-
-    // FIXME do something with unavailable reference frames
-
-    /* Sort B-frames into display order */
-
-    if (h->sps.bitstream_restriction_flag &&
-        h->avctx->has_b_frames < h->sps.num_reorder_frames) {
-        h->avctx->has_b_frames = h->sps.num_reorder_frames;
-        h->low_delay           = 0;
-    }
-
-    if (h->avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT &&
-        !h->sps.bitstream_restriction_flag) {
-        h->avctx->has_b_frames = MAX_DELAYED_PIC_COUNT - 1;
-        h->low_delay           = 0;
-    }
-
-    pics = 0;
-    while (h->delayed_pic[pics])
-        pics++;
-
-    assert(pics <= MAX_DELAYED_PIC_COUNT);
-
-    h->delayed_pic[pics++] = cur;
-    if (cur->reference == 0)
-        cur->reference = DELAYED_PIC_REF;
-
-    /* Frame reordering. This code takes pictures from coding order and sorts
-     * them by their incremental POC value into display order. It supports POC
-     * gaps, MMCO reset codes and random resets.
-     * A "display group" can start either with a IDR frame (f.key_frame = 1),
-     * and/or can be closed down with a MMCO reset code. In sequences where
-     * there is no delay, we can't detect that (since the frame was already
-     * output to the user), so we also set h->mmco_reset to detect the MMCO
-     * reset code.
-     * FIXME: if we detect insufficient delays (as per h->avctx->has_b_frames),
-     * we increase the delay between input and output. All frames affected by
-     * the lag (e.g. those that should have been output before another frame
-     * that we already returned to the user) will be dropped. This is a bug
-     * that we will fix later. */
-    for (i = 0; i < MAX_DELAYED_PIC_COUNT; i++) {
-        cnt     += out->poc < h->last_pocs[i];
-        invalid += out->poc == INT_MIN;
-    }
-    if (!h->mmco_reset && !cur->f.key_frame &&
-        cnt + invalid == MAX_DELAYED_PIC_COUNT && cnt > 0) {
-        h->mmco_reset = 2;
-        if (pics > 1)
-            h->delayed_pic[pics - 2]->mmco_reset = 2;
-    }
-    if (h->mmco_reset || cur->f.key_frame) {
-        for (i = 0; i < MAX_DELAYED_PIC_COUNT; i++)
-            h->last_pocs[i] = INT_MIN;
-        cnt     = 0;
-        invalid = MAX_DELAYED_PIC_COUNT;
-    }
-    out     = h->delayed_pic[0];
-    out_idx = 0;
-    for (i = 1; i < MAX_DELAYED_PIC_COUNT &&
-                h->delayed_pic[i] &&
-                !h->delayed_pic[i - 1]->mmco_reset &&
-                !h->delayed_pic[i]->f.key_frame;
-         i++)
-        if (h->delayed_pic[i]->poc < out->poc) {
-            out     = h->delayed_pic[i];
-            out_idx = i;
-        }
-    if (h->avctx->has_b_frames == 0 &&
-        (h->delayed_pic[0]->f.key_frame || h->mmco_reset))
-        h->next_outputed_poc = INT_MIN;
-    out_of_order = !out->f.key_frame && !h->mmco_reset &&
-                   (out->poc < h->next_outputed_poc);
-
-    if (h->sps.bitstream_restriction_flag &&
-        h->avctx->has_b_frames >= h->sps.num_reorder_frames) {
-    } else if (out_of_order && pics - 1 == h->avctx->has_b_frames &&
-               h->avctx->has_b_frames < MAX_DELAYED_PIC_COUNT) {
-        if (invalid + cnt < MAX_DELAYED_PIC_COUNT) {
-            h->avctx->has_b_frames = FFMAX(h->avctx->has_b_frames, cnt);
-        }
-        h->low_delay = 0;
-    } else if (h->low_delay &&
-               ((h->next_outputed_poc != INT_MIN &&
-                 out->poc > h->next_outputed_poc + 2) ||
-                cur->f.pict_type == AV_PICTURE_TYPE_B)) {
-        h->low_delay = 0;
-        h->avctx->has_b_frames++;
-    }
-
-    if (pics > h->avctx->has_b_frames) {
-        out->reference &= ~DELAYED_PIC_REF;
-        // for frame threading, the owner must be the second field's thread or
-        // else the first thread can release the picture and reuse it unsafely
-        for (i = out_idx; h->delayed_pic[i]; i++)
-            h->delayed_pic[i] = h->delayed_pic[i + 1];
-    }
-    memmove(h->last_pocs, &h->last_pocs[1],
-            sizeof(*h->last_pocs) * (MAX_DELAYED_PIC_COUNT - 1));
-    h->last_pocs[MAX_DELAYED_PIC_COUNT - 1] = cur->poc;
-    if (!out_of_order && pics > h->avctx->has_b_frames) {
-        h->next_output_pic = out;
-        if (out->mmco_reset) {
-            if (out_idx > 0) {
-                h->next_outputed_poc                    = out->poc;
-                h->delayed_pic[out_idx - 1]->mmco_reset = out->mmco_reset;
-            } else {
-                h->next_outputed_poc = INT_MIN;
-            }
-        } else {
-            if (out_idx == 0 && pics > 1 && h->delayed_pic[0]->f.key_frame) {
-                h->next_outputed_poc = INT_MIN;
-            } else {
-                h->next_outputed_poc = out->poc;
-            }
-        }
-        h->mmco_reset = 0;
-    } else {
-        av_log(h->avctx, AV_LOG_DEBUG, "no picture\n");
-    }
-
-    if (h->next_output_pic) {
-        if (h->next_output_pic->recovered) {
-            // We have reached an recovery point and all frames after it in
-            // display order are "recovered".
-            h->frame_recovered |= FRAME_RECOVERED_SEI;
-        }
-        h->next_output_pic->recovered |= !!(h->frame_recovered & FRAME_RECOVERED_SEI);
-    }
-
-    if (setup_finished && !h->avctx->hwaccel)
-        ff_thread_finish_setup(h->avctx);
-}
-
-static av_always_inline void backup_mb_border(H264Context *h, uint8_t *src_y,
-                                              uint8_t *src_cb, uint8_t *src_cr,
-                                              int linesize, int uvlinesize,
-                                              int simple)
-{
-    uint8_t *top_border;
-    int top_idx = 1;
-    const int pixel_shift = h->pixel_shift;
-    int chroma444 = CHROMA444(h);
-    int chroma422 = CHROMA422(h);
-
-    src_y  -= linesize;
-    src_cb -= uvlinesize;
-    src_cr -= uvlinesize;
-
-    if (!simple && FRAME_MBAFF(h)) {
-        if (h->mb_y & 1) {
-            if (!MB_MBAFF(h)) {
-                top_border = h->top_borders[0][h->mb_x];
-                AV_COPY128(top_border, src_y + 15 * linesize);
-                if (pixel_shift)
-                    AV_COPY128(top_border + 16, src_y + 15 * linesize + 16);
-                if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
-                    if (chroma444) {
-                        if (pixel_shift) {
-                            AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
-                            AV_COPY128(top_border + 48, src_cb + 15 * uvlinesize + 16);
-                            AV_COPY128(top_border + 64, src_cr + 15 * uvlinesize);
-                            AV_COPY128(top_border + 80, src_cr + 15 * uvlinesize + 16);
-                        } else {
-                            AV_COPY128(top_border + 16, src_cb + 15 * uvlinesize);
-                            AV_COPY128(top_border + 32, src_cr + 15 * uvlinesize);
-                        }
-                    } else if (chroma422) {
-                        if (pixel_shift) {
-                            AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
-                            AV_COPY128(top_border + 48, src_cr + 15 * uvlinesize);
-                        } else {
-                            AV_COPY64(top_border + 16, src_cb + 15 * uvlinesize);
-                            AV_COPY64(top_border + 24, src_cr + 15 * uvlinesize);
-                        }
-                    } else {
-                        if (pixel_shift) {
-                            AV_COPY128(top_border + 32, src_cb + 7 * uvlinesize);
-                            AV_COPY128(top_border + 48, src_cr + 7 * uvlinesize);
-                        } else {
-                            AV_COPY64(top_border + 16, src_cb + 7 * uvlinesize);
-                            AV_COPY64(top_border + 24, src_cr + 7 * uvlinesize);
-                        }
-                    }
-                }
-            }
-        } else if (MB_MBAFF(h)) {
-            top_idx = 0;
-        } else
-            return;
-    }
-
-    top_border = h->top_borders[top_idx][h->mb_x];
-    /* There are two lines saved, the line above the top macroblock
-     * of a pair, and the line above the bottom macroblock. */
-    AV_COPY128(top_border, src_y + 16 * linesize);
-    if (pixel_shift)
-        AV_COPY128(top_border + 16, src_y + 16 * linesize + 16);
-
-    if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
-        if (chroma444) {
-            if (pixel_shift) {
-                AV_COPY128(top_border + 32, src_cb + 16 * linesize);
-                AV_COPY128(top_border + 48, src_cb + 16 * linesize + 16);
-                AV_COPY128(top_border + 64, src_cr + 16 * linesize);
-                AV_COPY128(top_border + 80, src_cr + 16 * linesize + 16);
-            } else {
-                AV_COPY128(top_border + 16, src_cb + 16 * linesize);
-                AV_COPY128(top_border + 32, src_cr + 16 * linesize);
-            }
-        } else if (chroma422) {
-            if (pixel_shift) {
-                AV_COPY128(top_border + 32, src_cb + 16 * uvlinesize);
-                AV_COPY128(top_border + 48, src_cr + 16 * uvlinesize);
-            } else {
-                AV_COPY64(top_border + 16, src_cb + 16 * uvlinesize);
-                AV_COPY64(top_border + 24, src_cr + 16 * uvlinesize);
-            }
-        } else {
-            if (pixel_shift) {
-                AV_COPY128(top_border + 32, src_cb + 8 * uvlinesize);
-                AV_COPY128(top_border + 48, src_cr + 8 * uvlinesize);
-            } else {
-                AV_COPY64(top_border + 16, src_cb + 8 * uvlinesize);
-                AV_COPY64(top_border + 24, src_cr + 8 * uvlinesize);
-            }
-        }
-    }
-}
-
-static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y,
-                                            uint8_t *src_cb, uint8_t *src_cr,
-                                            int linesize, int uvlinesize,
-                                            int xchg, int chroma444,
-                                            int simple, int pixel_shift)
-{
-    int deblock_topleft;
-    int deblock_top;
-    int top_idx = 1;
-    uint8_t *top_border_m1;
-    uint8_t *top_border;
-
-    if (!simple && FRAME_MBAFF(h)) {
-        if (h->mb_y & 1) {
-            if (!MB_MBAFF(h))
-                return;
-        } else {
-            top_idx = MB_MBAFF(h) ? 0 : 1;
-        }
-    }
-
-    if (h->deblocking_filter == 2) {
-        deblock_topleft = h->slice_table[h->mb_xy - 1 - h->mb_stride] == h->slice_num;
-        deblock_top     = h->top_type;
-    } else {
-        deblock_topleft = (h->mb_x > 0);
-        deblock_top     = (h->mb_y > !!MB_FIELD(h));
-    }
-
-    src_y  -= linesize   + 1 + pixel_shift;
-    src_cb -= uvlinesize + 1 + pixel_shift;
-    src_cr -= uvlinesize + 1 + pixel_shift;
-
-    top_border_m1 = h->top_borders[top_idx][h->mb_x - 1];
-    top_border    = h->top_borders[top_idx][h->mb_x];
-
-#define XCHG(a, b, xchg)                        \
-    if (pixel_shift) {                          \
-        if (xchg) {                             \
-            AV_SWAP64(b + 0, a + 0);            \
-            AV_SWAP64(b + 8, a + 8);            \
-        } else {                                \
-            AV_COPY128(b, a);                   \
-        }                                       \
-    } else if (xchg)                            \
-        AV_SWAP64(b, a);                        \
-    else                                        \
-        AV_COPY64(b, a);
-
-    if (deblock_top) {
-        if (deblock_topleft) {
-            XCHG(top_border_m1 + (8 << pixel_shift),
-                 src_y - (7 << pixel_shift), 1);
-        }
-        XCHG(top_border + (0 << pixel_shift), src_y + (1 << pixel_shift), xchg);
-        XCHG(top_border + (8 << pixel_shift), src_y + (9 << pixel_shift), 1);
-        if (h->mb_x + 1 < h->mb_width) {
-            XCHG(h->top_borders[top_idx][h->mb_x + 1],
-                 src_y + (17 << pixel_shift), 1);
-        }
-    }
-    if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
-        if (chroma444) {
-            if (deblock_top) {
-                if (deblock_topleft) {
-                    XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7 << pixel_shift), 1);
-                    XCHG(top_border_m1 + (40 << pixel_shift), src_cr - (7 << pixel_shift), 1);
-                }
-                XCHG(top_border + (16 << pixel_shift), src_cb + (1 << pixel_shift), xchg);
-                XCHG(top_border + (24 << pixel_shift), src_cb + (9 << pixel_shift), 1);
-                XCHG(top_border + (32 << pixel_shift), src_cr + (1 << pixel_shift), xchg);
-                XCHG(top_border + (40 << pixel_shift), src_cr + (9 << pixel_shift), 1);
-                if (h->mb_x + 1 < h->mb_width) {
-                    XCHG(h->top_borders[top_idx][h->mb_x + 1] + (16 << pixel_shift), src_cb + (17 << pixel_shift), 1);
-                    XCHG(h->top_borders[top_idx][h->mb_x + 1] + (32 << pixel_shift), src_cr + (17 << pixel_shift), 1);
-                }
-            }
-        } else {
-            if (deblock_top) {
-                if (deblock_topleft) {
-                    XCHG(top_border_m1 + (16 << pixel_shift), src_cb - (7 << pixel_shift), 1);
-                    XCHG(top_border_m1 + (24 << pixel_shift), src_cr - (7 << pixel_shift), 1);
-                }
-                XCHG(top_border + (16 << pixel_shift), src_cb + 1 + pixel_shift, 1);
-                XCHG(top_border + (24 << pixel_shift), src_cr + 1 + pixel_shift, 1);
-            }
-        }
-    }
-}
-
-static av_always_inline int dctcoef_get(int16_t *mb, int high_bit_depth,
-                                        int index)
-{
-    if (high_bit_depth) {
-        return AV_RN32A(((int32_t *)mb) + index);
-    } else
-        return AV_RN16A(mb + index);
-}
-
-static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth,
-                                         int index, int value)
-{
-    if (high_bit_depth) {
-        AV_WN32A(((int32_t *)mb) + index, value);
-    } else
-        AV_WN16A(mb + index, value);
-}
-
-static av_always_inline void hl_decode_mb_predict_luma(H264Context *h,
-                                                       int mb_type, int is_h264,
-                                                       int simple,
-                                                       int transform_bypass,
-                                                       int pixel_shift,
-                                                       int *block_offset,
-                                                       int linesize,
-                                                       uint8_t *dest_y, int p)
-{
-    void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
-    void (*idct_dc_add)(uint8_t *dst, int16_t *block, int stride);
-    int i;
-    int qscale = p == 0 ? h->qscale : h->chroma_qp[p - 1];
-    block_offset += 16 * p;
-    if (IS_INTRA4x4(mb_type)) {
-        if (IS_8x8DCT(mb_type)) {
-            if (transform_bypass) {
-                idct_dc_add =
-                idct_add    = h->h264dsp.h264_add_pixels8_clear;
-            } else {
-                idct_dc_add = h->h264dsp.h264_idct8_dc_add;
-                idct_add    = h->h264dsp.h264_idct8_add;
-            }
-            for (i = 0; i < 16; i += 4) {
-                uint8_t *const ptr = dest_y + block_offset[i];
-                const int dir      = h->intra4x4_pred_mode_cache[scan8[i]];
-                if (transform_bypass && h->sps.profile_idc == 244 && dir <= 1) {
-                    h->hpc.pred8x8l_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
-                } else {
-                    const int nnz = h->non_zero_count_cache[scan8[i + p * 16]];
-                    h->hpc.pred8x8l[dir](ptr, (h->topleft_samples_available << i) & 0x8000,
-                                         (h->topright_samples_available << i) & 0x4000, linesize);
-                    if (nnz) {
-                        if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
-                            idct_dc_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
-                        else
-                            idct_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
-                    }
-                }
-            }
-        } else {
-            if (transform_bypass) {
-                idct_dc_add  =
-                idct_add     = h->h264dsp.h264_add_pixels4_clear;
-            } else {
-                idct_dc_add = h->h264dsp.h264_idct_dc_add;
-                idct_add    = h->h264dsp.h264_idct_add;
-            }
-            for (i = 0; i < 16; i++) {
-                uint8_t *const ptr = dest_y + block_offset[i];
-                const int dir      = h->intra4x4_pred_mode_cache[scan8[i]];
-
-                if (transform_bypass && h->sps.profile_idc == 244 && dir <= 1) {
-                    h->hpc.pred4x4_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
-                } else {
-                    uint8_t *topright;
-                    int nnz, tr;
-                    uint64_t tr_high;
-                    if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) {
-                        const int topright_avail = (h->topright_samples_available << i) & 0x8000;
-                        assert(h->mb_y || linesize <= block_offset[i]);
-                        if (!topright_avail) {
-                            if (pixel_shift) {
-                                tr_high  = ((uint16_t *)ptr)[3 - linesize / 2] * 0x0001000100010001ULL;
-                                topright = (uint8_t *)&tr_high;
-                            } else {
-                                tr       = ptr[3 - linesize] * 0x01010101u;
-                                topright = (uint8_t *)&tr;
-                            }
-                        } else
-                            topright = ptr + (4 << pixel_shift) - linesize;
-                    } else
-                        topright = NULL;
-
-                    h->hpc.pred4x4[dir](ptr, topright, linesize);
-                    nnz = h->non_zero_count_cache[scan8[i + p * 16]];
-                    if (nnz) {
-                        if (is_h264) {
-                            if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
-                                idct_dc_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
-                            else
-                                idct_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
-                        } else if (CONFIG_SVQ3_DECODER)
-                            ff_svq3_add_idct_c(ptr, h->mb + i * 16 + p * 256, linesize, qscale, 0);
-                    }
-                }
-            }
-        }
-    } else {
-        h->hpc.pred16x16[h->intra16x16_pred_mode](dest_y, linesize);
-        if (is_h264) {
-            if (h->non_zero_count_cache[scan8[LUMA_DC_BLOCK_INDEX + p]]) {
-                if (!transform_bypass)
-                    h->h264dsp.h264_luma_dc_dequant_idct(h->mb + (p * 256 << pixel_shift),
-                                                         h->mb_luma_dc[p],
-                                                         h->dequant4_coeff[p][qscale][0]);
-                else {
-                    static const uint8_t dc_mapping[16] = {
-                         0 * 16,  1 * 16,  4 * 16,  5 * 16,
-                         2 * 16,  3 * 16,  6 * 16,  7 * 16,
-                         8 * 16,  9 * 16, 12 * 16, 13 * 16,
-                        10 * 16, 11 * 16, 14 * 16, 15 * 16
-                    };
-                    for (i = 0; i < 16; i++)
-                        dctcoef_set(h->mb + (p * 256 << pixel_shift),
-                                    pixel_shift, dc_mapping[i],
-                                    dctcoef_get(h->mb_luma_dc[p],
-                                                pixel_shift, i));
-                }
-            }
-        } else if (CONFIG_SVQ3_DECODER)
-            ff_svq3_luma_dc_dequant_idct_c(h->mb + p * 256,
-                                           h->mb_luma_dc[p], qscale);
-    }
-}
-
-static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, int mb_type,
-                                                    int is_h264, int simple,
-                                                    int transform_bypass,
-                                                    int pixel_shift,
-                                                    int *block_offset,
-                                                    int linesize,
-                                                    uint8_t *dest_y, int p)
-{
-    void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
-    int i;
-    block_offset += 16 * p;
-    if (!IS_INTRA4x4(mb_type)) {
-        if (is_h264) {
-            if (IS_INTRA16x16(mb_type)) {
-                if (transform_bypass) {
-                    if (h->sps.profile_idc == 244 &&
-                        (h->intra16x16_pred_mode == VERT_PRED8x8 ||
-                         h->intra16x16_pred_mode == HOR_PRED8x8)) {
-                        h->hpc.pred16x16_add[h->intra16x16_pred_mode](dest_y, block_offset,
-                                                                      h->mb + (p * 256 << pixel_shift),
-                                                                      linesize);
-                    } else {
-                        for (i = 0; i < 16; i++)
-                            if (h->non_zero_count_cache[scan8[i + p * 16]] ||
-                                dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
-                                h->h264dsp.h264_add_pixels4_clear(dest_y + block_offset[i],
-                                                                  h->mb + (i * 16 + p * 256 << pixel_shift),
-                                                                  linesize);
-                    }
-                } else {
-                    h->h264dsp.h264_idct_add16intra(dest_y, block_offset,
-                                                    h->mb + (p * 256 << pixel_shift),
-                                                    linesize,
-                                                    h->non_zero_count_cache + p * 5 * 8);
-                }
-            } else if (h->cbp & 15) {
-                if (transform_bypass) {
-                    const int di = IS_8x8DCT(mb_type) ? 4 : 1;
-                    idct_add = IS_8x8DCT(mb_type) ? h->h264dsp.h264_add_pixels8_clear
-                                                  : h->h264dsp.h264_add_pixels4_clear;
-                    for (i = 0; i < 16; i += di)
-                        if (h->non_zero_count_cache[scan8[i + p * 16]])
-                            idct_add(dest_y + block_offset[i],
-                                     h->mb + (i * 16 + p * 256 << pixel_shift),
-                                     linesize);
-                } else {
-                    if (IS_8x8DCT(mb_type))
-                        h->h264dsp.h264_idct8_add4(dest_y, block_offset,
-                                                   h->mb + (p * 256 << pixel_shift),
-                                                   linesize,
-                                                   h->non_zero_count_cache + p * 5 * 8);
-                    else
-                        h->h264dsp.h264_idct_add16(dest_y, block_offset,
-                                                   h->mb + (p * 256 << pixel_shift),
-                                                   linesize,
-                                                   h->non_zero_count_cache + p * 5 * 8);
-                }
-            }
-        } else if (CONFIG_SVQ3_DECODER) {
-            for (i = 0; i < 16; i++)
-                if (h->non_zero_count_cache[scan8[i + p * 16]] || h->mb[i * 16 + p * 256]) {
-                    // FIXME benchmark weird rule, & below
-                    uint8_t *const ptr = dest_y + block_offset[i];
-                    ff_svq3_add_idct_c(ptr, h->mb + i * 16 + p * 256, linesize,
-                                       h->qscale, IS_INTRA(mb_type) ? 1 : 0);
-                }
-        }
-    }
-}
-
-#define BITS   8
-#define SIMPLE 1
-#include "h264_mb_template.c"
-
-#undef  BITS
-#define BITS   16
-#include "h264_mb_template.c"
-
-#undef  SIMPLE
-#define SIMPLE 0
-#include "h264_mb_template.c"
-
-void ff_h264_hl_decode_mb(H264Context *h)
-{
-    const int mb_xy   = h->mb_xy;
-    const int mb_type = h->cur_pic.mb_type[mb_xy];
-    int is_complex    = CONFIG_SMALL || h->is_complex ||
-                        IS_INTRA_PCM(mb_type) || h->qscale == 0;
-
-    if (CHROMA444(h)) {
-        if (is_complex || h->pixel_shift)
-            hl_decode_mb_444_complex(h);
-        else
-            hl_decode_mb_444_simple_8(h);
-    } else if (is_complex) {
-        hl_decode_mb_complex(h);
-    } else if (h->pixel_shift) {
-        hl_decode_mb_simple_16(h);
-    } else
-        hl_decode_mb_simple_8(h);
-}
-
-int ff_pred_weight_table(H264Context *h)
-{
-    int list, i;
-    int luma_def, chroma_def;
-
-    h->use_weight             = 0;
-    h->use_weight_chroma      = 0;
-    h->luma_log2_weight_denom = get_ue_golomb(&h->gb);
-    if (h->sps.chroma_format_idc)
-        h->chroma_log2_weight_denom = get_ue_golomb(&h->gb);
-    luma_def   = 1 << h->luma_log2_weight_denom;
-    chroma_def = 1 << h->chroma_log2_weight_denom;
-
-    for (list = 0; list < 2; list++) {
-        h->luma_weight_flag[list]   = 0;
-        h->chroma_weight_flag[list] = 0;
-        for (i = 0; i < h->ref_count[list]; i++) {
-            int luma_weight_flag, chroma_weight_flag;
-
-            luma_weight_flag = get_bits1(&h->gb);
-            if (luma_weight_flag) {
-                h->luma_weight[i][list][0] = get_se_golomb(&h->gb);
-                h->luma_weight[i][list][1] = get_se_golomb(&h->gb);
-                if (h->luma_weight[i][list][0] != luma_def ||
-                    h->luma_weight[i][list][1] != 0) {
-                    h->use_weight             = 1;
-                    h->luma_weight_flag[list] = 1;
-                }
-            } else {
-                h->luma_weight[i][list][0] = luma_def;
-                h->luma_weight[i][list][1] = 0;
-            }
-
-            if (h->sps.chroma_format_idc) {
-                chroma_weight_flag = get_bits1(&h->gb);
-                if (chroma_weight_flag) {
-                    int j;
-                    for (j = 0; j < 2; j++) {
-                        h->chroma_weight[i][list][j][0] = get_se_golomb(&h->gb);
-                        h->chroma_weight[i][list][j][1] = get_se_golomb(&h->gb);
-                        if (h->chroma_weight[i][list][j][0] != chroma_def ||
-                            h->chroma_weight[i][list][j][1] != 0) {
-                            h->use_weight_chroma        = 1;
-                            h->chroma_weight_flag[list] = 1;
-                        }
-                    }
-                } else {
-                    int j;
-                    for (j = 0; j < 2; j++) {
-                        h->chroma_weight[i][list][j][0] = chroma_def;
-                        h->chroma_weight[i][list][j][1] = 0;
-                    }
-                }
-            }
-        }
-        if (h->slice_type_nos != AV_PICTURE_TYPE_B)
-            break;
-    }
-    h->use_weight = h->use_weight || h->use_weight_chroma;
-    return 0;
-}
-
-/**
- * Initialize implicit_weight table.
- * @param field  0/1 initialize the weight for interlaced MBAFF
- *                -1 initializes the rest
- */
-static void implicit_weight_table(H264Context *h, int field)
-{
-    int ref0, ref1, i, cur_poc, ref_start, ref_count0, ref_count1;
-
-    for (i = 0; i < 2; i++) {
-        h->luma_weight_flag[i]   = 0;
-        h->chroma_weight_flag[i] = 0;
-    }
-
-    if (field < 0) {
-        if (h->picture_structure == PICT_FRAME) {
-            cur_poc = h->cur_pic_ptr->poc;
-        } else {
-            cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure - 1];
-        }
-        if (h->ref_count[0] == 1 && h->ref_count[1] == 1 && !FRAME_MBAFF(h) &&
-            h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2 * cur_poc) {
-            h->use_weight        = 0;
-            h->use_weight_chroma = 0;
-            return;
-        }
-        ref_start  = 0;
-        ref_count0 = h->ref_count[0];
-        ref_count1 = h->ref_count[1];
-    } else {
-        cur_poc    = h->cur_pic_ptr->field_poc[field];
-        ref_start  = 16;
-        ref_count0 = 16 + 2 * h->ref_count[0];
-        ref_count1 = 16 + 2 * h->ref_count[1];
-    }
-
-    h->use_weight               = 2;
-    h->use_weight_chroma        = 2;
-    h->luma_log2_weight_denom   = 5;
-    h->chroma_log2_weight_denom = 5;
-
-    for (ref0 = ref_start; ref0 < ref_count0; ref0++) {
-        int poc0 = h->ref_list[0][ref0].poc;
-        for (ref1 = ref_start; ref1 < ref_count1; ref1++) {
-            int w = 32;
-            if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref) {
-                int poc1 = h->ref_list[1][ref1].poc;
-                int td   = av_clip(poc1 - poc0, -128, 127);
-                if (td) {
-                    int tb = av_clip(cur_poc - poc0, -128, 127);
-                    int tx = (16384 + (FFABS(td) >> 1)) / td;
-                    int dist_scale_factor = (tb * tx + 32) >> 8;
-                    if (dist_scale_factor >= -64 && dist_scale_factor <= 128)
-                        w = 64 - dist_scale_factor;
-                }
-            }
-            if (field < 0) {
-                h->implicit_weight[ref0][ref1][0] =
-                h->implicit_weight[ref0][ref1][1] = w;
-            } else {
-                h->implicit_weight[ref0][ref1][field] = w;
-            }
-        }
-    }
-}
-
-/**
- * instantaneous decoder refresh.
- */
-static void idr(H264Context *h)
-{
-    ff_h264_remove_all_refs(h);
-    h->prev_frame_num        = 0;
-    h->prev_frame_num_offset = 0;
-    h->prev_poc_msb          =
-    h->prev_poc_lsb          = 0;
-}
-
-/* forget old pics after a seek */
-static void flush_change(H264Context *h)
-{
-    int i;
-    for (i = 0; i < MAX_DELAYED_PIC_COUNT; i++)
-        h->last_pocs[i] = INT_MIN;
-    h->outputed_poc          = h->next_outputed_poc = INT_MIN;
-    h->prev_interlaced_frame = 1;
-    idr(h);
-    if (h->cur_pic_ptr)
-        h->cur_pic_ptr->reference = 0;
-    h->first_field = 0;
-    memset(h->ref_list[0], 0, sizeof(h->ref_list[0]));
-    memset(h->ref_list[1], 0, sizeof(h->ref_list[1]));
-    memset(h->default_ref_list[0], 0, sizeof(h->default_ref_list[0]));
-    memset(h->default_ref_list[1], 0, sizeof(h->default_ref_list[1]));
-    ff_h264_reset_sei(h);
-    h->recovery_frame = -1;
-    h->frame_recovered = 0;
-}
-
-/* forget old pics after a seek */
-static void flush_dpb(AVCodecContext *avctx)
-{
-    H264Context *h = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < MAX_DELAYED_PIC_COUNT; i++) {
-        if (h->delayed_pic[i])
-            h->delayed_pic[i]->reference = 0;
-        h->delayed_pic[i] = NULL;
-    }
-
-    flush_change(h);
-
-    if (h->DPB)
-        for (i = 0; i < MAX_PICTURE_COUNT; i++)
-            unref_picture(h, &h->DPB[i]);
-    h->cur_pic_ptr = NULL;
-    unref_picture(h, &h->cur_pic);
-
-    h->mb_x = h->mb_y = 0;
-
-    h->parse_context.state             = -1;
-    h->parse_context.frame_start_found = 0;
-    h->parse_context.overread          = 0;
-    h->parse_context.overread_index    = 0;
-    h->parse_context.index             = 0;
-    h->parse_context.last_index        = 0;
-
-    free_tables(h, 1);
-    h->context_initialized = 0;
-}
-
-int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc)
-{
-    const int max_frame_num = 1 << h->sps.log2_max_frame_num;
-    int field_poc[2];
-
-    h->frame_num_offset = h->prev_frame_num_offset;
-    if (h->frame_num < h->prev_frame_num)
-        h->frame_num_offset += max_frame_num;
-
-    if (h->sps.poc_type == 0) {
-        const int max_poc_lsb = 1 << h->sps.log2_max_poc_lsb;
-
-        if (h->poc_lsb < h->prev_poc_lsb &&
-            h->prev_poc_lsb - h->poc_lsb >= max_poc_lsb / 2)
-            h->poc_msb = h->prev_poc_msb + max_poc_lsb;
-        else if (h->poc_lsb > h->prev_poc_lsb &&
-                 h->prev_poc_lsb - h->poc_lsb < -max_poc_lsb / 2)
-            h->poc_msb = h->prev_poc_msb - max_poc_lsb;
-        else
-            h->poc_msb = h->prev_poc_msb;
-        field_poc[0] =
-        field_poc[1] = h->poc_msb + h->poc_lsb;
-        if (h->picture_structure == PICT_FRAME)
-            field_poc[1] += h->delta_poc_bottom;
-    } else if (h->sps.poc_type == 1) {
-        int abs_frame_num, expected_delta_per_poc_cycle, expectedpoc;
-        int i;
-
-        if (h->sps.poc_cycle_length != 0)
-            abs_frame_num = h->frame_num_offset + h->frame_num;
-        else
-            abs_frame_num = 0;
-
-        if (h->nal_ref_idc == 0 && abs_frame_num > 0)
-            abs_frame_num--;
-
-        expected_delta_per_poc_cycle = 0;
-        for (i = 0; i < h->sps.poc_cycle_length; i++)
-            // FIXME integrate during sps parse
-            expected_delta_per_poc_cycle += h->sps.offset_for_ref_frame[i];
-
-        if (abs_frame_num > 0) {
-            int poc_cycle_cnt          = (abs_frame_num - 1) / h->sps.poc_cycle_length;
-            int frame_num_in_poc_cycle = (abs_frame_num - 1) % h->sps.poc_cycle_length;
-
-            expectedpoc = poc_cycle_cnt * expected_delta_per_poc_cycle;
-            for (i = 0; i <= frame_num_in_poc_cycle; i++)
-                expectedpoc = expectedpoc + h->sps.offset_for_ref_frame[i];
-        } else
-            expectedpoc = 0;
-
-        if (h->nal_ref_idc == 0)
-            expectedpoc = expectedpoc + h->sps.offset_for_non_ref_pic;
-
-        field_poc[0] = expectedpoc + h->delta_poc[0];
-        field_poc[1] = field_poc[0] + h->sps.offset_for_top_to_bottom_field;
-
-        if (h->picture_structure == PICT_FRAME)
-            field_poc[1] += h->delta_poc[1];
-    } else {
-        int poc = 2 * (h->frame_num_offset + h->frame_num);
-
-        if (!h->nal_ref_idc)
-            poc--;
-
-        field_poc[0] = poc;
-        field_poc[1] = poc;
-    }
-
-    if (h->picture_structure != PICT_BOTTOM_FIELD)
-        pic_field_poc[0] = field_poc[0];
-    if (h->picture_structure != PICT_TOP_FIELD)
-        pic_field_poc[1] = field_poc[1];
-    *pic_poc = FFMIN(pic_field_poc[0], pic_field_poc[1]);
-
-    return 0;
-}
-
-/**
- * initialize scan tables
- */
-static void init_scan_tables(H264Context *h)
-{
-    int i;
-    for (i = 0; i < 16; i++) {
-#define T(x) (x >> 2) | ((x << 2) & 0xF)
-        h->zigzag_scan[i] = T(zigzag_scan[i]);
-        h->field_scan[i]  = T(field_scan[i]);
-#undef T
-    }
-    for (i = 0; i < 64; i++) {
-#define T(x) (x >> 3) | ((x & 7) << 3)
-        h->zigzag_scan8x8[i]       = T(ff_zigzag_direct[i]);
-        h->zigzag_scan8x8_cavlc[i] = T(zigzag_scan8x8_cavlc[i]);
-        h->field_scan8x8[i]        = T(field_scan8x8[i]);
-        h->field_scan8x8_cavlc[i]  = T(field_scan8x8_cavlc[i]);
-#undef T
-    }
-    if (h->sps.transform_bypass) { // FIXME same ugly
-        h->zigzag_scan_q0          = zigzag_scan;
-        h->zigzag_scan8x8_q0       = ff_zigzag_direct;
-        h->zigzag_scan8x8_cavlc_q0 = zigzag_scan8x8_cavlc;
-        h->field_scan_q0           = field_scan;
-        h->field_scan8x8_q0        = field_scan8x8;
-        h->field_scan8x8_cavlc_q0  = field_scan8x8_cavlc;
-    } else {
-        h->zigzag_scan_q0          = h->zigzag_scan;
-        h->zigzag_scan8x8_q0       = h->zigzag_scan8x8;
-        h->zigzag_scan8x8_cavlc_q0 = h->zigzag_scan8x8_cavlc;
-        h->field_scan_q0           = h->field_scan;
-        h->field_scan8x8_q0        = h->field_scan8x8;
-        h->field_scan8x8_cavlc_q0  = h->field_scan8x8_cavlc;
-    }
-}
-
-static int field_end(H264Context *h, int in_setup)
-{
-    AVCodecContext *const avctx = h->avctx;
-    int err = 0;
-    h->mb_y = 0;
-
-    if (!in_setup && !h->droppable)
-        ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
-                                  h->picture_structure == PICT_BOTTOM_FIELD);
-
-    if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) {
-        if (!h->droppable) {
-            err = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
-            h->prev_poc_msb = h->poc_msb;
-            h->prev_poc_lsb = h->poc_lsb;
-        }
-        h->prev_frame_num_offset = h->frame_num_offset;
-        h->prev_frame_num        = h->frame_num;
-        h->outputed_poc          = h->next_outputed_poc;
-    }
-
-    if (avctx->hwaccel) {
-        if (avctx->hwaccel->end_frame(avctx) < 0)
-            av_log(avctx, AV_LOG_ERROR,
-                   "hardware accelerator failed to decode picture\n");
-    }
-
-    /*
-     * FIXME: Error handling code does not seem to support interlaced
-     * when slices span multiple rows
-     * The ff_er_add_slice calls don't work right for bottom
-     * fields; they cause massive erroneous error concealing
-     * Error marking covers both fields (top and bottom).
-     * This causes a mismatched s->error_count
-     * and a bad error table. Further, the error count goes to
-     * INT_MAX when called for bottom field, because mb_y is
-     * past end by one (callers fault) and resync_mb_y != 0
-     * causes problems for the first MB line, too.
-     */
-    if (CONFIG_ERROR_RESILIENCE && !FIELD_PICTURE(h)) {
-        h->er.cur_pic  = h->cur_pic_ptr;
-        h->er.last_pic = h->ref_count[0] ? &h->ref_list[0][0] : NULL;
-        h->er.next_pic = h->ref_count[1] ? &h->ref_list[1][0] : NULL;
-        ff_er_frame_end(&h->er);
-    }
-    emms_c();
-
-    h->current_slice = 0;
-
-    return err;
-}
-
-/**
- * Replicate H264 "master" context to thread contexts.
- */
-static int clone_slice(H264Context *dst, H264Context *src)
-{
-    memcpy(dst->block_offset, src->block_offset, sizeof(dst->block_offset));
-    dst->cur_pic_ptr = src->cur_pic_ptr;
-    dst->cur_pic     = src->cur_pic;
-    dst->linesize    = src->linesize;
-    dst->uvlinesize  = src->uvlinesize;
-    dst->first_field = src->first_field;
-
-    dst->prev_poc_msb          = src->prev_poc_msb;
-    dst->prev_poc_lsb          = src->prev_poc_lsb;
-    dst->prev_frame_num_offset = src->prev_frame_num_offset;
-    dst->prev_frame_num        = src->prev_frame_num;
-    dst->short_ref_count       = src->short_ref_count;
-
-    memcpy(dst->short_ref,        src->short_ref,        sizeof(dst->short_ref));
-    memcpy(dst->long_ref,         src->long_ref,         sizeof(dst->long_ref));
-    memcpy(dst->default_ref_list, src->default_ref_list, sizeof(dst->default_ref_list));
-
-    memcpy(dst->dequant4_coeff,   src->dequant4_coeff,   sizeof(src->dequant4_coeff));
-    memcpy(dst->dequant8_coeff,   src->dequant8_coeff,   sizeof(src->dequant8_coeff));
-
-    return 0;
-}
-
-/**
- * Compute profile from profile_idc and constraint_set?_flags.
- *
- * @param sps SPS
- *
- * @return profile as defined by FF_PROFILE_H264_*
- */
-int ff_h264_get_profile(SPS *sps)
-{
-    int profile = sps->profile_idc;
-
-    switch (sps->profile_idc) {
-    case FF_PROFILE_H264_BASELINE:
-        // constraint_set1_flag set to 1
-        profile |= (sps->constraint_set_flags & 1 << 1) ? FF_PROFILE_H264_CONSTRAINED : 0;
-        break;
-    case FF_PROFILE_H264_HIGH_10:
-    case FF_PROFILE_H264_HIGH_422:
-    case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
-        // constraint_set3_flag set to 1
-        profile |= (sps->constraint_set_flags & 1 << 3) ? FF_PROFILE_H264_INTRA : 0;
-        break;
-    }
-
-    return profile;
-}
-
-static int h264_set_parameter_from_sps(H264Context *h)
-{
-    if (h->flags & CODEC_FLAG_LOW_DELAY ||
-        (h->sps.bitstream_restriction_flag &&
-         !h->sps.num_reorder_frames)) {
-        if (h->avctx->has_b_frames > 1 || h->delayed_pic[0])
-            av_log(h->avctx, AV_LOG_WARNING, "Delayed frames seen. "
-                   "Reenabling low delay requires a codec flush.\n");
-        else
-            h->low_delay = 1;
-    }
-
-    if (h->avctx->has_b_frames < 2)
-        h->avctx->has_b_frames = !h->low_delay;
-
-    if (h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
-        h->cur_chroma_format_idc      != h->sps.chroma_format_idc) {
-        if (h->sps.bit_depth_luma >= 8 && h->sps.bit_depth_luma <= 10) {
-            h->avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
-            h->cur_chroma_format_idc      = h->sps.chroma_format_idc;
-            h->pixel_shift                = h->sps.bit_depth_luma > 8;
-
-            ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma,
-                            h->sps.chroma_format_idc);
-            ff_h264chroma_init(&h->h264chroma, h->sps.bit_depth_chroma);
-            ff_h264qpel_init(&h->h264qpel, h->sps.bit_depth_luma);
-            ff_h264_pred_init(&h->hpc, h->avctx->codec_id, h->sps.bit_depth_luma,
-                              h->sps.chroma_format_idc);
-            if (CONFIG_ERROR_RESILIENCE)
-                ff_dsputil_init(&h->dsp, h->avctx);
-            ff_videodsp_init(&h->vdsp, h->sps.bit_depth_luma);
-        } else {
-            av_log(h->avctx, AV_LOG_ERROR, "Unsupported bit depth %d\n",
-                   h->sps.bit_depth_luma);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    return 0;
-}
-
-static enum AVPixelFormat get_pixel_format(H264Context *h)
-{
-    switch (h->sps.bit_depth_luma) {
-    case 9:
-        if (CHROMA444(h)) {
-            if (h->avctx->colorspace == AVCOL_SPC_RGB) {
-                return AV_PIX_FMT_GBRP9;
-            } else
-                return AV_PIX_FMT_YUV444P9;
-        } else if (CHROMA422(h))
-            return AV_PIX_FMT_YUV422P9;
-        else
-            return AV_PIX_FMT_YUV420P9;
-        break;
-    case 10:
-        if (CHROMA444(h)) {
-            if (h->avctx->colorspace == AVCOL_SPC_RGB) {
-                return AV_PIX_FMT_GBRP10;
-            } else
-                return AV_PIX_FMT_YUV444P10;
-        } else if (CHROMA422(h))
-            return AV_PIX_FMT_YUV422P10;
-        else
-            return AV_PIX_FMT_YUV420P10;
-        break;
-    case 8:
-        if (CHROMA444(h)) {
-            if (h->avctx->colorspace == AVCOL_SPC_RGB) {
-                return AV_PIX_FMT_GBRP;
-            } else
-                return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P
-                                                                 : AV_PIX_FMT_YUV444P;
-        } else if (CHROMA422(h)) {
-            return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P
-                                                             : AV_PIX_FMT_YUV422P;
-        } else {
-            return h->avctx->get_format(h->avctx, h->avctx->codec->pix_fmts ?
-                                        h->avctx->codec->pix_fmts :
-                                        h->avctx->color_range == AVCOL_RANGE_JPEG ?
-                                        h264_hwaccel_pixfmt_list_jpeg_420 :
-                                        h264_hwaccel_pixfmt_list_420);
-        }
-        break;
-    default:
-        av_log(h->avctx, AV_LOG_ERROR,
-               "Unsupported bit depth %d\n", h->sps.bit_depth_luma);
-        return AVERROR_INVALIDDATA;
-    }
-}
-
-/* export coded and cropped frame dimensions to AVCodecContext */
-static int init_dimensions(H264Context *h)
-{
-    int width  = h->width  - (h->sps.crop_right + h->sps.crop_left);
-    int height = h->height - (h->sps.crop_top   + h->sps.crop_bottom);
-
-    /* handle container cropping */
-    if (!h->sps.crop &&
-        FFALIGN(h->avctx->width,  16) == h->width &&
-        FFALIGN(h->avctx->height, 16) == h->height) {
-        width  = h->avctx->width;
-        height = h->avctx->height;
-    }
-
-    if (width <= 0 || height <= 0) {
-        av_log(h->avctx, AV_LOG_ERROR, "Invalid cropped dimensions: %dx%d.\n",
-               width, height);
-        if (h->avctx->err_recognition & AV_EF_EXPLODE)
-            return AVERROR_INVALIDDATA;
-
-        av_log(h->avctx, AV_LOG_WARNING, "Ignoring cropping information.\n");
-        h->sps.crop_bottom = h->sps.crop_top = h->sps.crop_right = h->sps.crop_left = 0;
-        h->sps.crop        = 0;
-
-        width  = h->width;
-        height = h->height;
-    }
-
-    h->avctx->coded_width  = h->width;
-    h->avctx->coded_height = h->height;
-    h->avctx->width        = width;
-    h->avctx->height       = height;
-
-    return 0;
-}
-
-static int h264_slice_header_init(H264Context *h, int reinit)
-{
-    int nb_slices = (HAVE_THREADS &&
-                     h->avctx->active_thread_type & FF_THREAD_SLICE) ?
-                    h->avctx->thread_count : 1;
-    int i, ret;
-
-    h->avctx->sample_aspect_ratio = h->sps.sar;
-    av_assert0(h->avctx->sample_aspect_ratio.den);
-    av_pix_fmt_get_chroma_sub_sample(h->avctx->pix_fmt,
-                                     &h->chroma_x_shift, &h->chroma_y_shift);
-
-    if (h->sps.timing_info_present_flag) {
-        int64_t den = h->sps.time_scale;
-        if (h->x264_build < 44U)
-            den *= 2;
-        av_reduce(&h->avctx->time_base.num, &h->avctx->time_base.den,
-                  h->sps.num_units_in_tick, den, 1 << 30);
-    }
-
-    h->avctx->hwaccel = ff_find_hwaccel(h->avctx);
-
-    if (reinit)
-        free_tables(h, 0);
-    h->first_field           = 0;
-    h->prev_interlaced_frame = 1;
-
-    init_scan_tables(h);
-    ret = ff_h264_alloc_tables(h);
-    if (ret < 0) {
-        av_log(h->avctx, AV_LOG_ERROR, "Could not allocate memory\n");
-        return ret;
-    }
-
-    if (nb_slices > MAX_THREADS || (nb_slices > h->mb_height && h->mb_height)) {
-        int max_slices;
-        if (h->mb_height)
-            max_slices = FFMIN(MAX_THREADS, h->mb_height);
-        else
-            max_slices = MAX_THREADS;
-        av_log(h->avctx, AV_LOG_WARNING, "too many threads/slices %d,"
-               " reducing to %d\n", nb_slices, max_slices);
-        nb_slices = max_slices;
-    }
-    h->slice_context_count = nb_slices;
-
-    if (!HAVE_THREADS || !(h->avctx->active_thread_type & FF_THREAD_SLICE)) {
-        ret = context_init(h);
-        if (ret < 0) {
-            av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n");
-            return ret;
-        }
-    } else {
-        for (i = 1; i < h->slice_context_count; i++) {
-            H264Context *c;
-            c                    = h->thread_context[i] = av_mallocz(sizeof(H264Context));
-            if (!c)
-                return AVERROR(ENOMEM);
-            c->avctx             = h->avctx;
-            c->dsp               = h->dsp;
-            c->vdsp              = h->vdsp;
-            c->h264dsp           = h->h264dsp;
-            c->h264qpel          = h->h264qpel;
-            c->h264chroma        = h->h264chroma;
-            c->sps               = h->sps;
-            c->pps               = h->pps;
-            c->pixel_shift       = h->pixel_shift;
-            c->width             = h->width;
-            c->height            = h->height;
-            c->linesize          = h->linesize;
-            c->uvlinesize        = h->uvlinesize;
-            c->chroma_x_shift    = h->chroma_x_shift;
-            c->chroma_y_shift    = h->chroma_y_shift;
-            c->qscale            = h->qscale;
-            c->droppable         = h->droppable;
-            c->data_partitioning = h->data_partitioning;
-            c->low_delay         = h->low_delay;
-            c->mb_width          = h->mb_width;
-            c->mb_height         = h->mb_height;
-            c->mb_stride         = h->mb_stride;
-            c->mb_num            = h->mb_num;
-            c->flags             = h->flags;
-            c->workaround_bugs   = h->workaround_bugs;
-            c->pict_type         = h->pict_type;
-
-            init_scan_tables(c);
-            clone_tables(c, h, i);
-            c->context_initialized = 1;
-        }
-
-        for (i = 0; i < h->slice_context_count; i++)
-            if ((ret = context_init(h->thread_context[i])) < 0) {
-                av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n");
-                return ret;
-            }
-    }
-
-    h->context_initialized = 1;
-
-    return 0;
-}
-
-int ff_set_ref_count(H264Context *h)
-{
-    int ref_count[2], list_count;
-    int num_ref_idx_active_override_flag, max_refs;
-
-    // set defaults, might be overridden a few lines later
-    ref_count[0] = h->pps.ref_count[0];
-    ref_count[1] = h->pps.ref_count[1];
-
-    if (h->slice_type_nos != AV_PICTURE_TYPE_I) {
-        if (h->slice_type_nos == AV_PICTURE_TYPE_B)
-            h->direct_spatial_mv_pred = get_bits1(&h->gb);
-        num_ref_idx_active_override_flag = get_bits1(&h->gb);
-
-        if (num_ref_idx_active_override_flag) {
-            ref_count[0] = get_ue_golomb(&h->gb) + 1;
-            if (ref_count[0] < 1)
-                return AVERROR_INVALIDDATA;
-            if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
-                ref_count[1] = get_ue_golomb(&h->gb) + 1;
-                if (ref_count[1] < 1)
-                    return AVERROR_INVALIDDATA;
-            }
-        }
-
-        if (h->slice_type_nos == AV_PICTURE_TYPE_B)
-            list_count = 2;
-        else
-            list_count = 1;
-    } else {
-        list_count   = 0;
-        ref_count[0] = ref_count[1] = 0;
-    }
-
-    max_refs = h->picture_structure == PICT_FRAME ? 16 : 32;
-
-    if (ref_count[0] > max_refs || ref_count[1] > max_refs) {
-        av_log(h->avctx, AV_LOG_ERROR, "reference overflow\n");
-        h->ref_count[0] = h->ref_count[1] = 0;
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (list_count != h->list_count ||
-        ref_count[0] != h->ref_count[0] ||
-        ref_count[1] != h->ref_count[1]) {
-        h->ref_count[0] = ref_count[0];
-        h->ref_count[1] = ref_count[1];
-        h->list_count   = list_count;
-        return 1;
-    }
-
-    return 0;
-}
-
-/**
- * Decode a slice header.
- * This will (re)intialize the decoder and call h264_frame_start() as needed.
- *
- * @param h h264context
- * @param h0 h264 master context (differs from 'h' when doing sliced based
- *           parallel decoding)
- *
- * @return 0 if okay, <0 if an error occurred, 1 if decoding must not be multithreaded
- */
-static int decode_slice_header(H264Context *h, H264Context *h0)
-{
-    unsigned int first_mb_in_slice;
-    unsigned int pps_id;
-    int ret;
-    unsigned int slice_type, tmp, i, j;
-    int default_ref_list_done = 0;
-    int last_pic_structure, last_pic_droppable;
-    int needs_reinit = 0;
-    int field_pic_flag, bottom_field_flag;
-
-    h->me.qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
-    h->me.qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
-
-    first_mb_in_slice = get_ue_golomb(&h->gb);
-
-    if (first_mb_in_slice == 0) { // FIXME better field boundary detection
-        if (h0->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
-            field_end(h, 1);
-        }
-
-        h0->current_slice = 0;
-        if (!h0->first_field) {
-            if (h->cur_pic_ptr && !h->droppable) {
-                ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
-                                          h->picture_structure == PICT_BOTTOM_FIELD);
-            }
-            h->cur_pic_ptr = NULL;
-        }
-    }
-
-    slice_type = get_ue_golomb_31(&h->gb);
-    if (slice_type > 9) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "slice type %d too large at %d %d\n",
-               h->slice_type, h->mb_x, h->mb_y);
-        return AVERROR_INVALIDDATA;
-    }
-    if (slice_type > 4) {
-        slice_type -= 5;
-        h->slice_type_fixed = 1;
-    } else
-        h->slice_type_fixed = 0;
-
-    slice_type = golomb_to_pict_type[slice_type];
-    if (slice_type == AV_PICTURE_TYPE_I ||
-        (h0->current_slice != 0 && slice_type == h0->last_slice_type)) {
-        default_ref_list_done = 1;
-    }
-    h->slice_type     = slice_type;
-    h->slice_type_nos = slice_type & 3;
-
-    if (h->nal_unit_type  == NAL_IDR_SLICE &&
-        h->slice_type_nos != AV_PICTURE_TYPE_I) {
-        av_log(h->avctx, AV_LOG_ERROR, "A non-intra slice in an IDR NAL unit.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    // to make a few old functions happy, it's wrong though
-    h->pict_type = h->slice_type;
-
-    pps_id = get_ue_golomb(&h->gb);
-    if (pps_id >= MAX_PPS_COUNT) {
-        av_log(h->avctx, AV_LOG_ERROR, "pps_id %u out of range\n", pps_id);
-        return AVERROR_INVALIDDATA;
-    }
-    if (!h0->pps_buffers[pps_id]) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "non-existing PPS %u referenced\n",
-               pps_id);
-        return AVERROR_INVALIDDATA;
-    }
-    h->pps = *h0->pps_buffers[pps_id];
-
-    if (!h0->sps_buffers[h->pps.sps_id]) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "non-existing SPS %u referenced\n",
-               h->pps.sps_id);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (h->pps.sps_id != h->sps.sps_id ||
-        h0->sps_buffers[h->pps.sps_id]->new) {
-        h0->sps_buffers[h->pps.sps_id]->new = 0;
-
-        h->sps = *h0->sps_buffers[h->pps.sps_id];
-
-        if (h->bit_depth_luma    != h->sps.bit_depth_luma ||
-            h->chroma_format_idc != h->sps.chroma_format_idc) {
-            h->bit_depth_luma    = h->sps.bit_depth_luma;
-            h->chroma_format_idc = h->sps.chroma_format_idc;
-            needs_reinit         = 1;
-        }
-        if ((ret = h264_set_parameter_from_sps(h)) < 0)
-            return ret;
-    }
-
-    h->avctx->profile = ff_h264_get_profile(&h->sps);
-    h->avctx->level   = h->sps.level_idc;
-    h->avctx->refs    = h->sps.ref_frame_count;
-
-    if (h->mb_width  != h->sps.mb_width ||
-        h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag))
-        needs_reinit = 1;
-
-    h->mb_width  = h->sps.mb_width;
-    h->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
-    h->mb_num    = h->mb_width * h->mb_height;
-    h->mb_stride = h->mb_width + 1;
-
-    h->b_stride = h->mb_width * 4;
-
-    h->chroma_y_shift = h->sps.chroma_format_idc <= 1; // 400 uses yuv420p
-
-    h->width  = 16 * h->mb_width;
-    h->height = 16 * h->mb_height;
-
-    ret = init_dimensions(h);
-    if (ret < 0)
-        return ret;
-
-    if (h->sps.video_signal_type_present_flag) {
-        h->avctx->color_range = h->sps.full_range ? AVCOL_RANGE_JPEG
-                                                  : AVCOL_RANGE_MPEG;
-        if (h->sps.colour_description_present_flag) {
-            if (h->avctx->colorspace != h->sps.colorspace)
-                needs_reinit = 1;
-            h->avctx->color_primaries = h->sps.color_primaries;
-            h->avctx->color_trc       = h->sps.color_trc;
-            h->avctx->colorspace      = h->sps.colorspace;
-        }
-    }
-
-    if (h->context_initialized &&
-        (h->width  != h->avctx->coded_width   ||
-         h->height != h->avctx->coded_height  ||
-         needs_reinit)) {
-        if (h != h0) {
-            av_log(h->avctx, AV_LOG_ERROR, "changing width/height on "
-                   "slice %d\n", h0->current_slice + 1);
-            return AVERROR_INVALIDDATA;
-        }
-
-        flush_change(h);
-
-        if ((ret = get_pixel_format(h)) < 0)
-            return ret;
-        h->avctx->pix_fmt = ret;
-
-        av_log(h->avctx, AV_LOG_INFO, "Reinit context to %dx%d, "
-               "pix_fmt: %d\n", h->width, h->height, h->avctx->pix_fmt);
-
-        if ((ret = h264_slice_header_init(h, 1)) < 0) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "h264_slice_header_init() failed\n");
-            return ret;
-        }
-    }
-    if (!h->context_initialized) {
-        if (h != h0) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "Cannot (re-)initialize context during parallel decoding.\n");
-            return AVERROR_PATCHWELCOME;
-        }
-
-        if ((ret = get_pixel_format(h)) < 0)
-            return ret;
-        h->avctx->pix_fmt = ret;
-
-        if ((ret = h264_slice_header_init(h, 0)) < 0) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "h264_slice_header_init() failed\n");
-            return ret;
-        }
-    }
-
-    if (h == h0 && h->dequant_coeff_pps != pps_id) {
-        h->dequant_coeff_pps = pps_id;
-        init_dequant_tables(h);
-    }
-
-    h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
-
-    h->mb_mbaff        = 0;
-    h->mb_aff_frame    = 0;
-    last_pic_structure = h0->picture_structure;
-    last_pic_droppable = h0->droppable;
-    h->droppable       = h->nal_ref_idc == 0;
-    if (h->sps.frame_mbs_only_flag) {
-        h->picture_structure = PICT_FRAME;
-    } else {
-        field_pic_flag = get_bits1(&h->gb);
-        if (field_pic_flag) {
-            bottom_field_flag = get_bits1(&h->gb);
-            h->picture_structure = PICT_TOP_FIELD + bottom_field_flag;
-        } else {
-            h->picture_structure = PICT_FRAME;
-            h->mb_aff_frame      = h->sps.mb_aff;
-        }
-    }
-    h->mb_field_decoding_flag = h->picture_structure != PICT_FRAME;
-
-    if (h0->current_slice != 0) {
-        if (last_pic_structure != h->picture_structure ||
-            last_pic_droppable != h->droppable) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "Changing field mode (%d -> %d) between slices is not allowed\n",
-                   last_pic_structure, h->picture_structure);
-            h->picture_structure = last_pic_structure;
-            h->droppable         = last_pic_droppable;
-            return AVERROR_INVALIDDATA;
-        } else if (!h0->cur_pic_ptr) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "unset cur_pic_ptr on slice %d\n",
-                   h0->current_slice + 1);
-            return AVERROR_INVALIDDATA;
-        }
-    } else {
-        /* Shorten frame num gaps so we don't have to allocate reference
-         * frames just to throw them away */
-        if (h->frame_num != h->prev_frame_num) {
-            int unwrap_prev_frame_num = h->prev_frame_num;
-            int max_frame_num         = 1 << h->sps.log2_max_frame_num;
-
-            if (unwrap_prev_frame_num > h->frame_num)
-                unwrap_prev_frame_num -= max_frame_num;
-
-            if ((h->frame_num - unwrap_prev_frame_num) > h->sps.ref_frame_count) {
-                unwrap_prev_frame_num = (h->frame_num - h->sps.ref_frame_count) - 1;
-                if (unwrap_prev_frame_num < 0)
-                    unwrap_prev_frame_num += max_frame_num;
-
-                h->prev_frame_num = unwrap_prev_frame_num;
-            }
-        }
-
-        /* See if we have a decoded first field looking for a pair...
-         * Here, we're using that to see if we should mark previously
-         * decode frames as "finished".
-         * We have to do that before the "dummy" in-between frame allocation,
-         * since that can modify s->current_picture_ptr. */
-        if (h0->first_field) {
-            assert(h0->cur_pic_ptr);
-            assert(h0->cur_pic_ptr->f.buf[0]);
-            assert(h0->cur_pic_ptr->reference != DELAYED_PIC_REF);
-
-            /* figure out if we have a complementary field pair */
-            if (!FIELD_PICTURE(h) || h->picture_structure == last_pic_structure) {
-                /* Previous field is unmatched. Don't display it, but let it
-                 * remain for reference if marked as such. */
-                if (!last_pic_droppable && last_pic_structure != PICT_FRAME) {
-                    ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
-                                              last_pic_structure == PICT_TOP_FIELD);
-                }
-            } else {
-                if (h0->cur_pic_ptr->frame_num != h->frame_num) {
-                    /* This and previous field were reference, but had
-                     * different frame_nums. Consider this field first in
-                     * pair. Throw away previous field except for reference
-                     * purposes. */
-                    if (!last_pic_droppable && last_pic_structure != PICT_FRAME) {
-                        ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
-                                                  last_pic_structure == PICT_TOP_FIELD);
-                    }
-                } else {
-                    /* Second field in complementary pair */
-                    if (!((last_pic_structure   == PICT_TOP_FIELD &&
-                           h->picture_structure == PICT_BOTTOM_FIELD) ||
-                          (last_pic_structure   == PICT_BOTTOM_FIELD &&
-                           h->picture_structure == PICT_TOP_FIELD))) {
-                        av_log(h->avctx, AV_LOG_ERROR,
-                               "Invalid field mode combination %d/%d\n",
-                               last_pic_structure, h->picture_structure);
-                        h->picture_structure = last_pic_structure;
-                        h->droppable         = last_pic_droppable;
-                        return AVERROR_INVALIDDATA;
-                    } else if (last_pic_droppable != h->droppable) {
-                        avpriv_request_sample(h->avctx,
-                                              "Found reference and non-reference fields in the same frame, which");
-                        h->picture_structure = last_pic_structure;
-                        h->droppable         = last_pic_droppable;
-                        return AVERROR_PATCHWELCOME;
-                    }
-                }
-            }
-        }
-
-        while (h->frame_num != h->prev_frame_num &&
-               h->frame_num != (h->prev_frame_num + 1) % (1 << h->sps.log2_max_frame_num)) {
-            Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL;
-            av_log(h->avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n",
-                   h->frame_num, h->prev_frame_num);
-            ret = h264_frame_start(h);
-            if (ret < 0) {
-                h0->first_field = 0;
-                return ret;
-            }
-
-            h->prev_frame_num++;
-            h->prev_frame_num        %= 1 << h->sps.log2_max_frame_num;
-            h->cur_pic_ptr->frame_num = h->prev_frame_num;
-            ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 0);
-            ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 1);
-            ret = ff_generate_sliding_window_mmcos(h, 1);
-            if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
-                return ret;
-            ret = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
-            if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
-                return ret;
-            /* Error concealment: If a ref is missing, copy the previous ref
-             * in its place.
-             * FIXME: Avoiding a memcpy would be nice, but ref handling makes
-             * many assumptions about there being no actual duplicates.
-             * FIXME: This does not copy padding for out-of-frame motion
-             * vectors.  Given we are concealing a lost frame, this probably
-             * is not noticeable by comparison, but it should be fixed. */
-            if (h->short_ref_count) {
-                if (prev) {
-                    av_image_copy(h->short_ref[0]->f.data,
-                                  h->short_ref[0]->f.linesize,
-                                  (const uint8_t **)prev->f.data,
-                                  prev->f.linesize,
-                                  h->avctx->pix_fmt,
-                                  h->mb_width  * 16,
-                                  h->mb_height * 16);
-                    h->short_ref[0]->poc = prev->poc + 2;
-                }
-                h->short_ref[0]->frame_num = h->prev_frame_num;
-            }
-        }
-
-        /* See if we have a decoded first field looking for a pair...
-         * We're using that to see whether to continue decoding in that
-         * frame, or to allocate a new one. */
-        if (h0->first_field) {
-            assert(h0->cur_pic_ptr);
-            assert(h0->cur_pic_ptr->f.buf[0]);
-            assert(h0->cur_pic_ptr->reference != DELAYED_PIC_REF);
-
-            /* figure out if we have a complementary field pair */
-            if (!FIELD_PICTURE(h) || h->picture_structure == last_pic_structure) {
-                /* Previous field is unmatched. Don't display it, but let it
-                 * remain for reference if marked as such. */
-                h0->cur_pic_ptr = NULL;
-                h0->first_field = FIELD_PICTURE(h);
-            } else {
-                if (h0->cur_pic_ptr->frame_num != h->frame_num) {
-                    /* This and the previous field had different frame_nums.
-                     * Consider this field first in pair. Throw away previous
-                     * one except for reference purposes. */
-                    h0->first_field = 1;
-                    h0->cur_pic_ptr = NULL;
-                } else {
-                    /* Second field in complementary pair */
-                    h0->first_field = 0;
-                }
-            }
-        } else {
-            /* Frame or first field in a potentially complementary pair */
-            h0->first_field = FIELD_PICTURE(h);
-        }
-
-        if (!FIELD_PICTURE(h) || h0->first_field) {
-            if (h264_frame_start(h) < 0) {
-                h0->first_field = 0;
-                return AVERROR_INVALIDDATA;
-            }
-        } else {
-            release_unused_pictures(h, 0);
-        }
-    }
-    if (h != h0 && (ret = clone_slice(h, h0)) < 0)
-        return ret;
-
-    h->cur_pic_ptr->frame_num = h->frame_num; // FIXME frame_num cleanup
-
-    assert(h->mb_num == h->mb_width * h->mb_height);
-    if (first_mb_in_slice << FIELD_OR_MBAFF_PICTURE(h) >= h->mb_num ||
-        first_mb_in_slice >= h->mb_num) {
-        av_log(h->avctx, AV_LOG_ERROR, "first_mb_in_slice overflow\n");
-        return AVERROR_INVALIDDATA;
-    }
-    h->resync_mb_x = h->mb_x =  first_mb_in_slice % h->mb_width;
-    h->resync_mb_y = h->mb_y = (first_mb_in_slice / h->mb_width) <<
-                               FIELD_OR_MBAFF_PICTURE(h);
-    if (h->picture_structure == PICT_BOTTOM_FIELD)
-        h->resync_mb_y = h->mb_y = h->mb_y + 1;
-    assert(h->mb_y < h->mb_height);
-
-    if (h->picture_structure == PICT_FRAME) {
-        h->curr_pic_num = h->frame_num;
-        h->max_pic_num  = 1 << h->sps.log2_max_frame_num;
-    } else {
-        h->curr_pic_num = 2 * h->frame_num + 1;
-        h->max_pic_num  = 1 << (h->sps.log2_max_frame_num + 1);
-    }
-
-    if (h->nal_unit_type == NAL_IDR_SLICE)
-        get_ue_golomb(&h->gb); /* idr_pic_id */
-
-    if (h->sps.poc_type == 0) {
-        h->poc_lsb = get_bits(&h->gb, h->sps.log2_max_poc_lsb);
-
-        if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME)
-            h->delta_poc_bottom = get_se_golomb(&h->gb);
-    }
-
-    if (h->sps.poc_type == 1 && !h->sps.delta_pic_order_always_zero_flag) {
-        h->delta_poc[0] = get_se_golomb(&h->gb);
-
-        if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME)
-            h->delta_poc[1] = get_se_golomb(&h->gb);
-    }
-
-    ff_init_poc(h, h->cur_pic_ptr->field_poc, &h->cur_pic_ptr->poc);
-
-    if (h->pps.redundant_pic_cnt_present)
-        h->redundant_pic_count = get_ue_golomb(&h->gb);
-
-    ret = ff_set_ref_count(h);
-    if (ret < 0)
-        return ret;
-    else if (ret == 1)
-        default_ref_list_done = 0;
-
-    if (!default_ref_list_done)
-        ff_h264_fill_default_ref_list(h);
-
-    if (h->slice_type_nos != AV_PICTURE_TYPE_I) {
-       ret = ff_h264_decode_ref_pic_list_reordering(h);
-       if (ret < 0) {
-           h->ref_count[1] = h->ref_count[0] = 0;
-           return ret;
-       }
-    }
-
-    if ((h->pps.weighted_pred && h->slice_type_nos == AV_PICTURE_TYPE_P) ||
-        (h->pps.weighted_bipred_idc == 1 &&
-         h->slice_type_nos == AV_PICTURE_TYPE_B))
-        ff_pred_weight_table(h);
-    else if (h->pps.weighted_bipred_idc == 2 &&
-             h->slice_type_nos == AV_PICTURE_TYPE_B) {
-        implicit_weight_table(h, -1);
-    } else {
-        h->use_weight = 0;
-        for (i = 0; i < 2; i++) {
-            h->luma_weight_flag[i]   = 0;
-            h->chroma_weight_flag[i] = 0;
-        }
-    }
-
-    // If frame-mt is enabled, only update mmco tables for the first slice
-    // in a field. Subsequent slices can temporarily clobber h->mmco_index
-    // or h->mmco, which will cause ref list mix-ups and decoding errors
-    // further down the line. This may break decoding if the first slice is
-    // corrupt, thus we only do this if frame-mt is enabled.
-    if (h->nal_ref_idc) {
-        ret = ff_h264_decode_ref_pic_marking(h0, &h->gb,
-                                             !(h->avctx->active_thread_type & FF_THREAD_FRAME) ||
-                                             h0->current_slice == 0);
-        if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
-            return AVERROR_INVALIDDATA;
-    }
-
-    if (FRAME_MBAFF(h)) {
-        ff_h264_fill_mbaff_ref_list(h);
-
-        if (h->pps.weighted_bipred_idc == 2 && h->slice_type_nos == AV_PICTURE_TYPE_B) {
-            implicit_weight_table(h, 0);
-            implicit_weight_table(h, 1);
-        }
-    }
-
-    if (h->slice_type_nos == AV_PICTURE_TYPE_B && !h->direct_spatial_mv_pred)
-        ff_h264_direct_dist_scale_factor(h);
-    ff_h264_direct_ref_list_init(h);
-
-    if (h->slice_type_nos != AV_PICTURE_TYPE_I && h->pps.cabac) {
-        tmp = get_ue_golomb_31(&h->gb);
-        if (tmp > 2) {
-            av_log(h->avctx, AV_LOG_ERROR, "cabac_init_idc %u overflow\n", tmp);
-            return AVERROR_INVALIDDATA;
-        }
-        h->cabac_init_idc = tmp;
-    }
-
-    h->last_qscale_diff = 0;
-    tmp = h->pps.init_qp + get_se_golomb(&h->gb);
-    if (tmp > 51 + 6 * (h->sps.bit_depth_luma - 8)) {
-        av_log(h->avctx, AV_LOG_ERROR, "QP %u out of range\n", tmp);
-        return AVERROR_INVALIDDATA;
-    }
-    h->qscale       = tmp;
-    h->chroma_qp[0] = get_chroma_qp(h, 0, h->qscale);
-    h->chroma_qp[1] = get_chroma_qp(h, 1, h->qscale);
-    // FIXME qscale / qp ... stuff
-    if (h->slice_type == AV_PICTURE_TYPE_SP)
-        get_bits1(&h->gb); /* sp_for_switch_flag */
-    if (h->slice_type == AV_PICTURE_TYPE_SP ||
-        h->slice_type == AV_PICTURE_TYPE_SI)
-        get_se_golomb(&h->gb); /* slice_qs_delta */
-
-    h->deblocking_filter     = 1;
-    h->slice_alpha_c0_offset = 0;
-    h->slice_beta_offset     = 0;
-    if (h->pps.deblocking_filter_parameters_present) {
-        tmp = get_ue_golomb_31(&h->gb);
-        if (tmp > 2) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "deblocking_filter_idc %u out of range\n", tmp);
-            return AVERROR_INVALIDDATA;
-        }
-        h->deblocking_filter = tmp;
-        if (h->deblocking_filter < 2)
-            h->deblocking_filter ^= 1;  // 1<->0
-
-        if (h->deblocking_filter) {
-            h->slice_alpha_c0_offset = get_se_golomb(&h->gb) * 2;
-            h->slice_beta_offset     = get_se_golomb(&h->gb) * 2;
-            if (h->slice_alpha_c0_offset >  12 ||
-                h->slice_alpha_c0_offset < -12 ||
-                h->slice_beta_offset >  12     ||
-                h->slice_beta_offset < -12) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "deblocking filter parameters %d %d out of range\n",
-                       h->slice_alpha_c0_offset, h->slice_beta_offset);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-
-    if (h->avctx->skip_loop_filter >= AVDISCARD_ALL ||
-        (h->avctx->skip_loop_filter >= AVDISCARD_NONKEY &&
-         h->slice_type_nos != AV_PICTURE_TYPE_I) ||
-        (h->avctx->skip_loop_filter >= AVDISCARD_BIDIR  &&
-         h->slice_type_nos == AV_PICTURE_TYPE_B) ||
-        (h->avctx->skip_loop_filter >= AVDISCARD_NONREF &&
-         h->nal_ref_idc == 0))
-        h->deblocking_filter = 0;
-
-    if (h->deblocking_filter == 1 && h0->max_contexts > 1) {
-        if (h->avctx->flags2 & CODEC_FLAG2_FAST) {
-            /* Cheat slightly for speed:
-             * Do not bother to deblock across slices. */
-            h->deblocking_filter = 2;
-        } else {
-            h0->max_contexts = 1;
-            if (!h0->single_decode_warning) {
-                av_log(h->avctx, AV_LOG_INFO,
-                       "Cannot parallelize deblocking type 1, decoding such frames in sequential order\n");
-                h0->single_decode_warning = 1;
-            }
-            if (h != h0) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "Deblocking switched inside frame.\n");
-                return 1;
-            }
-        }
-    }
-    h->qp_thresh = 15 -
-                   FFMIN(h->slice_alpha_c0_offset, h->slice_beta_offset) -
-                   FFMAX3(0,
-                          h->pps.chroma_qp_index_offset[0],
-                          h->pps.chroma_qp_index_offset[1]) +
-                   6 * (h->sps.bit_depth_luma - 8);
-
-    h0->last_slice_type = slice_type;
-    h->slice_num        = ++h0->current_slice;
-    if (h->slice_num >= MAX_SLICES) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "Too many slices, increase MAX_SLICES and recompile\n");
-    }
-
-    for (j = 0; j < 2; j++) {
-        int id_list[16];
-        int *ref2frm = h->ref2frm[h->slice_num & (MAX_SLICES - 1)][j];
-        for (i = 0; i < 16; i++) {
-            id_list[i] = 60;
-            if (j < h->list_count && i < h->ref_count[j] &&
-                h->ref_list[j][i].f.buf[0]) {
-                int k;
-                AVBuffer *buf = h->ref_list[j][i].f.buf[0]->buffer;
-                for (k = 0; k < h->short_ref_count; k++)
-                    if (h->short_ref[k]->f.buf[0]->buffer == buf) {
-                        id_list[i] = k;
-                        break;
-                    }
-                for (k = 0; k < h->long_ref_count; k++)
-                    if (h->long_ref[k] && h->long_ref[k]->f.buf[0]->buffer == buf) {
-                        id_list[i] = h->short_ref_count + k;
-                        break;
-                    }
-            }
-        }
-
-        ref2frm[0] =
-        ref2frm[1] = -1;
-        for (i = 0; i < 16; i++)
-            ref2frm[i + 2] = 4 * id_list[i] + (h->ref_list[j][i].reference & 3);
-        ref2frm[18 + 0] =
-        ref2frm[18 + 1] = -1;
-        for (i = 16; i < 48; i++)
-            ref2frm[i + 4] = 4 * id_list[(i - 16) >> 1] +
-                             (h->ref_list[j][i].reference & 3);
-    }
-
-    if (h->avctx->debug & FF_DEBUG_PICT_INFO) {
-        av_log(h->avctx, AV_LOG_DEBUG,
-               "slice:%d %s mb:%d %c%s%s pps:%u frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s %s\n",
-               h->slice_num,
-               (h->picture_structure == PICT_FRAME ? "F" : h->picture_structure == PICT_TOP_FIELD ? "T" : "B"),
-               first_mb_in_slice,
-               av_get_picture_type_char(h->slice_type),
-               h->slice_type_fixed ? " fix" : "",
-               h->nal_unit_type == NAL_IDR_SLICE ? " IDR" : "",
-               pps_id, h->frame_num,
-               h->cur_pic_ptr->field_poc[0],
-               h->cur_pic_ptr->field_poc[1],
-               h->ref_count[0], h->ref_count[1],
-               h->qscale,
-               h->deblocking_filter,
-               h->slice_alpha_c0_offset, h->slice_beta_offset,
-               h->use_weight,
-               h->use_weight == 1 && h->use_weight_chroma ? "c" : "",
-               h->slice_type == AV_PICTURE_TYPE_B ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : "");
-    }
-
-    return 0;
-}
-
-int ff_h264_get_slice_type(const H264Context *h)
-{
-    switch (h->slice_type) {
-    case AV_PICTURE_TYPE_P:
-        return 0;
-    case AV_PICTURE_TYPE_B:
-        return 1;
-    case AV_PICTURE_TYPE_I:
-        return 2;
-    case AV_PICTURE_TYPE_SP:
-        return 3;
-    case AV_PICTURE_TYPE_SI:
-        return 4;
-    default:
-        return AVERROR_INVALIDDATA;
-    }
-}
-
-static av_always_inline void fill_filter_caches_inter(H264Context *h,
-                                                      int mb_type, int top_xy,
-                                                      int left_xy[LEFT_MBS],
-                                                      int top_type,
-                                                      int left_type[LEFT_MBS],
-                                                      int mb_xy, int list)
-{
-    int b_stride = h->b_stride;
-    int16_t(*mv_dst)[2] = &h->mv_cache[list][scan8[0]];
-    int8_t *ref_cache = &h->ref_cache[list][scan8[0]];
-    if (IS_INTER(mb_type) || IS_DIRECT(mb_type)) {
-        if (USES_LIST(top_type, list)) {
-            const int b_xy  = h->mb2b_xy[top_xy] + 3 * b_stride;
-            const int b8_xy = 4 * top_xy + 2;
-            int (*ref2frm)[64] = h->ref2frm[h->slice_table[top_xy] & (MAX_SLICES - 1)][0] + (MB_MBAFF(h) ? 20 : 2);
-            AV_COPY128(mv_dst - 1 * 8, h->cur_pic.motion_val[list][b_xy + 0]);
-            ref_cache[0 - 1 * 8] =
-            ref_cache[1 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 0]];
-            ref_cache[2 - 1 * 8] =
-            ref_cache[3 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 1]];
-        } else {
-            AV_ZERO128(mv_dst - 1 * 8);
-            AV_WN32A(&ref_cache[0 - 1 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
-        }
-
-        if (!IS_INTERLACED(mb_type ^ left_type[LTOP])) {
-            if (USES_LIST(left_type[LTOP], list)) {
-                const int b_xy  = h->mb2b_xy[left_xy[LTOP]] + 3;
-                const int b8_xy = 4 * left_xy[LTOP] + 1;
-                int (*ref2frm)[64] = h->ref2frm[h->slice_table[left_xy[LTOP]] & (MAX_SLICES - 1)][0] + (MB_MBAFF(h) ? 20 : 2);
-                AV_COPY32(mv_dst - 1 +  0, h->cur_pic.motion_val[list][b_xy + b_stride * 0]);
-                AV_COPY32(mv_dst - 1 +  8, h->cur_pic.motion_val[list][b_xy + b_stride * 1]);
-                AV_COPY32(mv_dst - 1 + 16, h->cur_pic.motion_val[list][b_xy + b_stride * 2]);
-                AV_COPY32(mv_dst - 1 + 24, h->cur_pic.motion_val[list][b_xy + b_stride * 3]);
-                ref_cache[-1 +  0] =
-                ref_cache[-1 +  8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 0]];
-                ref_cache[-1 + 16] =
-                ref_cache[-1 + 24] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 1]];
-            } else {
-                AV_ZERO32(mv_dst - 1 +  0);
-                AV_ZERO32(mv_dst - 1 +  8);
-                AV_ZERO32(mv_dst - 1 + 16);
-                AV_ZERO32(mv_dst - 1 + 24);
-                ref_cache[-1 +  0] =
-                ref_cache[-1 +  8] =
-                ref_cache[-1 + 16] =
-                ref_cache[-1 + 24] = LIST_NOT_USED;
-            }
-        }
-    }
-
-    if (!USES_LIST(mb_type, list)) {
-        fill_rectangle(mv_dst, 4, 4, 8, pack16to32(0, 0), 4);
-        AV_WN32A(&ref_cache[0 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
-        AV_WN32A(&ref_cache[1 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
-        AV_WN32A(&ref_cache[2 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
-        AV_WN32A(&ref_cache[3 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
-        return;
-    }
-
-    {
-        int8_t *ref = &h->cur_pic.ref_index[list][4 * mb_xy];
-        int (*ref2frm)[64] = h->ref2frm[h->slice_num & (MAX_SLICES - 1)][0] + (MB_MBAFF(h) ? 20 : 2);
-        uint32_t ref01 = (pack16to32(ref2frm[list][ref[0]], ref2frm[list][ref[1]]) & 0x00FF00FF) * 0x0101;
-        uint32_t ref23 = (pack16to32(ref2frm[list][ref[2]], ref2frm[list][ref[3]]) & 0x00FF00FF) * 0x0101;
-        AV_WN32A(&ref_cache[0 * 8], ref01);
-        AV_WN32A(&ref_cache[1 * 8], ref01);
-        AV_WN32A(&ref_cache[2 * 8], ref23);
-        AV_WN32A(&ref_cache[3 * 8], ref23);
-    }
-
-    {
-        int16_t(*mv_src)[2] = &h->cur_pic.motion_val[list][4 * h->mb_x + 4 * h->mb_y * b_stride];
-        AV_COPY128(mv_dst + 8 * 0, mv_src + 0 * b_stride);
-        AV_COPY128(mv_dst + 8 * 1, mv_src + 1 * b_stride);
-        AV_COPY128(mv_dst + 8 * 2, mv_src + 2 * b_stride);
-        AV_COPY128(mv_dst + 8 * 3, mv_src + 3 * b_stride);
-    }
-}
-
-/**
- *
- * @return non zero if the loop filter can be skipped
- */
-static int fill_filter_caches(H264Context *h, int mb_type)
-{
-    const int mb_xy = h->mb_xy;
-    int top_xy, left_xy[LEFT_MBS];
-    int top_type, left_type[LEFT_MBS];
-    uint8_t *nnz;
-    uint8_t *nnz_cache;
-
-    top_xy = mb_xy - (h->mb_stride << MB_FIELD(h));
-
-    /* Wow, what a mess, why didn't they simplify the interlacing & intra
-     * stuff, I can't imagine that these complex rules are worth it. */
-
-    left_xy[LBOT] = left_xy[LTOP] = mb_xy - 1;
-    if (FRAME_MBAFF(h)) {
-        const int left_mb_field_flag = IS_INTERLACED(h->cur_pic.mb_type[mb_xy - 1]);
-        const int curr_mb_field_flag = IS_INTERLACED(mb_type);
-        if (h->mb_y & 1) {
-            if (left_mb_field_flag != curr_mb_field_flag)
-                left_xy[LTOP] -= h->mb_stride;
-        } else {
-            if (curr_mb_field_flag)
-                top_xy += h->mb_stride &
-                          (((h->cur_pic.mb_type[top_xy] >> 7) & 1) - 1);
-            if (left_mb_field_flag != curr_mb_field_flag)
-                left_xy[LBOT] += h->mb_stride;
-        }
-    }
-
-    h->top_mb_xy        = top_xy;
-    h->left_mb_xy[LTOP] = left_xy[LTOP];
-    h->left_mb_xy[LBOT] = left_xy[LBOT];
-    {
-        /* For sufficiently low qp, filtering wouldn't do anything.
-         * This is a conservative estimate: could also check beta_offset
-         * and more accurate chroma_qp. */
-        int qp_thresh = h->qp_thresh; // FIXME strictly we should store qp_thresh for each mb of a slice
-        int qp        = h->cur_pic.qscale_table[mb_xy];
-        if (qp <= qp_thresh &&
-            (left_xy[LTOP] < 0 ||
-             ((qp + h->cur_pic.qscale_table[left_xy[LTOP]] + 1) >> 1) <= qp_thresh) &&
-            (top_xy < 0 ||
-             ((qp + h->cur_pic.qscale_table[top_xy] + 1) >> 1) <= qp_thresh)) {
-            if (!FRAME_MBAFF(h))
-                return 1;
-            if ((left_xy[LTOP] < 0 ||
-                 ((qp + h->cur_pic.qscale_table[left_xy[LBOT]] + 1) >> 1) <= qp_thresh) &&
-                (top_xy < h->mb_stride ||
-                 ((qp + h->cur_pic.qscale_table[top_xy - h->mb_stride] + 1) >> 1) <= qp_thresh))
-                return 1;
-        }
-    }
-
-    top_type        = h->cur_pic.mb_type[top_xy];
-    left_type[LTOP] = h->cur_pic.mb_type[left_xy[LTOP]];
-    left_type[LBOT] = h->cur_pic.mb_type[left_xy[LBOT]];
-    if (h->deblocking_filter == 2) {
-        if (h->slice_table[top_xy] != h->slice_num)
-            top_type = 0;
-        if (h->slice_table[left_xy[LBOT]] != h->slice_num)
-            left_type[LTOP] = left_type[LBOT] = 0;
-    } else {
-        if (h->slice_table[top_xy] == 0xFFFF)
-            top_type = 0;
-        if (h->slice_table[left_xy[LBOT]] == 0xFFFF)
-            left_type[LTOP] = left_type[LBOT] = 0;
-    }
-    h->top_type        = top_type;
-    h->left_type[LTOP] = left_type[LTOP];
-    h->left_type[LBOT] = left_type[LBOT];
-
-    if (IS_INTRA(mb_type))
-        return 0;
-
-    fill_filter_caches_inter(h, mb_type, top_xy, left_xy,
-                             top_type, left_type, mb_xy, 0);
-    if (h->list_count == 2)
-        fill_filter_caches_inter(h, mb_type, top_xy, left_xy,
-                                 top_type, left_type, mb_xy, 1);
-
-    nnz       = h->non_zero_count[mb_xy];
-    nnz_cache = h->non_zero_count_cache;
-    AV_COPY32(&nnz_cache[4 + 8 * 1], &nnz[0]);
-    AV_COPY32(&nnz_cache[4 + 8 * 2], &nnz[4]);
-    AV_COPY32(&nnz_cache[4 + 8 * 3], &nnz[8]);
-    AV_COPY32(&nnz_cache[4 + 8 * 4], &nnz[12]);
-    h->cbp = h->cbp_table[mb_xy];
-
-    if (top_type) {
-        nnz = h->non_zero_count[top_xy];
-        AV_COPY32(&nnz_cache[4 + 8 * 0], &nnz[3 * 4]);
-    }
-
-    if (left_type[LTOP]) {
-        nnz = h->non_zero_count[left_xy[LTOP]];
-        nnz_cache[3 + 8 * 1] = nnz[3 + 0 * 4];
-        nnz_cache[3 + 8 * 2] = nnz[3 + 1 * 4];
-        nnz_cache[3 + 8 * 3] = nnz[3 + 2 * 4];
-        nnz_cache[3 + 8 * 4] = nnz[3 + 3 * 4];
-    }
-
-    /* CAVLC 8x8dct requires NNZ values for residual decoding that differ
-     * from what the loop filter needs */
-    if (!CABAC(h) && h->pps.transform_8x8_mode) {
-        if (IS_8x8DCT(top_type)) {
-            nnz_cache[4 + 8 * 0] =
-            nnz_cache[5 + 8 * 0] = (h->cbp_table[top_xy] & 0x4000) >> 12;
-            nnz_cache[6 + 8 * 0] =
-            nnz_cache[7 + 8 * 0] = (h->cbp_table[top_xy] & 0x8000) >> 12;
-        }
-        if (IS_8x8DCT(left_type[LTOP])) {
-            nnz_cache[3 + 8 * 1] =
-            nnz_cache[3 + 8 * 2] = (h->cbp_table[left_xy[LTOP]] & 0x2000) >> 12; // FIXME check MBAFF
-        }
-        if (IS_8x8DCT(left_type[LBOT])) {
-            nnz_cache[3 + 8 * 3] =
-            nnz_cache[3 + 8 * 4] = (h->cbp_table[left_xy[LBOT]] & 0x8000) >> 12; // FIXME check MBAFF
-        }
-
-        if (IS_8x8DCT(mb_type)) {
-            nnz_cache[scan8[0]] =
-            nnz_cache[scan8[1]] =
-            nnz_cache[scan8[2]] =
-            nnz_cache[scan8[3]] = (h->cbp & 0x1000) >> 12;
-
-            nnz_cache[scan8[0 + 4]] =
-            nnz_cache[scan8[1 + 4]] =
-            nnz_cache[scan8[2 + 4]] =
-            nnz_cache[scan8[3 + 4]] = (h->cbp & 0x2000) >> 12;
-
-            nnz_cache[scan8[0 + 8]] =
-            nnz_cache[scan8[1 + 8]] =
-            nnz_cache[scan8[2 + 8]] =
-            nnz_cache[scan8[3 + 8]] = (h->cbp & 0x4000) >> 12;
-
-            nnz_cache[scan8[0 + 12]] =
-            nnz_cache[scan8[1 + 12]] =
-            nnz_cache[scan8[2 + 12]] =
-            nnz_cache[scan8[3 + 12]] = (h->cbp & 0x8000) >> 12;
-        }
-    }
-
-    return 0;
-}
-
-static void loop_filter(H264Context *h, int start_x, int end_x)
-{
-    uint8_t *dest_y, *dest_cb, *dest_cr;
-    int linesize, uvlinesize, mb_x, mb_y;
-    const int end_mb_y       = h->mb_y + FRAME_MBAFF(h);
-    const int old_slice_type = h->slice_type;
-    const int pixel_shift    = h->pixel_shift;
-    const int block_h        = 16 >> h->chroma_y_shift;
-
-    if (h->deblocking_filter) {
-        for (mb_x = start_x; mb_x < end_x; mb_x++)
-            for (mb_y = end_mb_y - FRAME_MBAFF(h); mb_y <= end_mb_y; mb_y++) {
-                int mb_xy, mb_type;
-                mb_xy         = h->mb_xy = mb_x + mb_y * h->mb_stride;
-                h->slice_num  = h->slice_table[mb_xy];
-                mb_type       = h->cur_pic.mb_type[mb_xy];
-                h->list_count = h->list_counts[mb_xy];
-
-                if (FRAME_MBAFF(h))
-                    h->mb_mbaff               =
-                    h->mb_field_decoding_flag = !!IS_INTERLACED(mb_type);
-
-                h->mb_x = mb_x;
-                h->mb_y = mb_y;
-                dest_y  = h->cur_pic.f.data[0] +
-                          ((mb_x << pixel_shift) + mb_y * h->linesize) * 16;
-                dest_cb = h->cur_pic.f.data[1] +
-                          (mb_x << pixel_shift) * (8 << CHROMA444(h)) +
-                          mb_y * h->uvlinesize * block_h;
-                dest_cr = h->cur_pic.f.data[2] +
-                          (mb_x << pixel_shift) * (8 << CHROMA444(h)) +
-                          mb_y * h->uvlinesize * block_h;
-                // FIXME simplify above
-
-                if (MB_FIELD(h)) {
-                    linesize   = h->mb_linesize   = h->linesize   * 2;
-                    uvlinesize = h->mb_uvlinesize = h->uvlinesize * 2;
-                    if (mb_y & 1) { // FIXME move out of this function?
-                        dest_y  -= h->linesize   * 15;
-                        dest_cb -= h->uvlinesize * (block_h - 1);
-                        dest_cr -= h->uvlinesize * (block_h - 1);
-                    }
-                } else {
-                    linesize   = h->mb_linesize   = h->linesize;
-                    uvlinesize = h->mb_uvlinesize = h->uvlinesize;
-                }
-                backup_mb_border(h, dest_y, dest_cb, dest_cr, linesize,
-                                 uvlinesize, 0);
-                if (fill_filter_caches(h, mb_type))
-                    continue;
-                h->chroma_qp[0] = get_chroma_qp(h, 0, h->cur_pic.qscale_table[mb_xy]);
-                h->chroma_qp[1] = get_chroma_qp(h, 1, h->cur_pic.qscale_table[mb_xy]);
-
-                if (FRAME_MBAFF(h)) {
-                    ff_h264_filter_mb(h, mb_x, mb_y, dest_y, dest_cb, dest_cr,
-                                      linesize, uvlinesize);
-                } else {
-                    ff_h264_filter_mb_fast(h, mb_x, mb_y, dest_y, dest_cb,
-                                           dest_cr, linesize, uvlinesize);
-                }
-            }
-    }
-    h->slice_type   = old_slice_type;
-    h->mb_x         = end_x;
-    h->mb_y         = end_mb_y - FRAME_MBAFF(h);
-    h->chroma_qp[0] = get_chroma_qp(h, 0, h->qscale);
-    h->chroma_qp[1] = get_chroma_qp(h, 1, h->qscale);
-}
-
-static void predict_field_decoding_flag(H264Context *h)
-{
-    const int mb_xy = h->mb_x + h->mb_y * h->mb_stride;
-    int mb_type     = (h->slice_table[mb_xy - 1] == h->slice_num) ?
-                      h->cur_pic.mb_type[mb_xy - 1] :
-                      (h->slice_table[mb_xy - h->mb_stride] == h->slice_num) ?
-                      h->cur_pic.mb_type[mb_xy - h->mb_stride] : 0;
-    h->mb_mbaff     = h->mb_field_decoding_flag = IS_INTERLACED(mb_type) ? 1 : 0;
-}
-
-/**
- * Draw edges and report progress for the last MB row.
- */
-static void decode_finish_row(H264Context *h)
-{
-    int top            = 16 * (h->mb_y      >> FIELD_PICTURE(h));
-    int pic_height     = 16 *  h->mb_height >> FIELD_PICTURE(h);
-    int height         =  16      << FRAME_MBAFF(h);
-    int deblock_border = (16 + 4) << FRAME_MBAFF(h);
-
-    if (h->deblocking_filter) {
-        if ((top + height) >= pic_height)
-            height += deblock_border;
-        top -= deblock_border;
-    }
-
-    if (top >= pic_height || (top + height) < 0)
-        return;
-
-    height = FFMIN(height, pic_height - top);
-    if (top < 0) {
-        height = top + height;
-        top    = 0;
-    }
-
-    ff_h264_draw_horiz_band(h, top, height);
-
-    if (h->droppable)
-        return;
-
-    ff_thread_report_progress(&h->cur_pic_ptr->tf, top + height - 1,
-                              h->picture_structure == PICT_BOTTOM_FIELD);
-}
-
-static void er_add_slice(H264Context *h, int startx, int starty,
-                         int endx, int endy, int status)
-{
-#if CONFIG_ERROR_RESILIENCE
-    ERContext *er = &h->er;
-
-    er->ref_count = h->ref_count[0];
-    ff_er_add_slice(er, startx, starty, endx, endy, status);
-#endif
-}
-
-static int decode_slice(struct AVCodecContext *avctx, void *arg)
-{
-    H264Context *h = *(void **)arg;
-    int lf_x_start = h->mb_x;
-
-    h->mb_skip_run = -1;
-
-    h->is_complex = FRAME_MBAFF(h) || h->picture_structure != PICT_FRAME ||
-                    avctx->codec_id != AV_CODEC_ID_H264 ||
-                    (CONFIG_GRAY && (h->flags & CODEC_FLAG_GRAY));
-
-    if (h->pps.cabac) {
-        /* realign */
-        align_get_bits(&h->gb);
-
-        /* init cabac */
-        ff_init_cabac_decoder(&h->cabac,
-                              h->gb.buffer + get_bits_count(&h->gb) / 8,
-                              (get_bits_left(&h->gb) + 7) / 8);
-
-        ff_h264_init_cabac_states(h);
-
-        for (;;) {
-            // START_TIMER
-            int ret = ff_h264_decode_mb_cabac(h);
-            int eos;
-            // STOP_TIMER("decode_mb_cabac")
-
-            if (ret >= 0)
-                ff_h264_hl_decode_mb(h);
-
-            // FIXME optimal? or let mb_decode decode 16x32 ?
-            if (ret >= 0 && FRAME_MBAFF(h)) {
-                h->mb_y++;
-
-                ret = ff_h264_decode_mb_cabac(h);
-
-                if (ret >= 0)
-                    ff_h264_hl_decode_mb(h);
-                h->mb_y--;
-            }
-            eos = get_cabac_terminate(&h->cabac);
-
-            if ((h->workaround_bugs & FF_BUG_TRUNCATED) &&
-                h->cabac.bytestream > h->cabac.bytestream_end + 2) {
-                er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x - 1,
-                             h->mb_y, ER_MB_END);
-                if (h->mb_x >= lf_x_start)
-                    loop_filter(h, lf_x_start, h->mb_x + 1);
-                return 0;
-            }
-            if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 2) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "error while decoding MB %d %d, bytestream %td\n",
-                       h->mb_x, h->mb_y,
-                       h->cabac.bytestream_end - h->cabac.bytestream);
-                er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
-                             h->mb_y, ER_MB_ERROR);
-                return AVERROR_INVALIDDATA;
-            }
-
-            if (++h->mb_x >= h->mb_width) {
-                loop_filter(h, lf_x_start, h->mb_x);
-                h->mb_x = lf_x_start = 0;
-                decode_finish_row(h);
-                ++h->mb_y;
-                if (FIELD_OR_MBAFF_PICTURE(h)) {
-                    ++h->mb_y;
-                    if (FRAME_MBAFF(h) && h->mb_y < h->mb_height)
-                        predict_field_decoding_flag(h);
-                }
-            }
-
-            if (eos || h->mb_y >= h->mb_height) {
-                tprintf(h->avctx, "slice end %d %d\n",
-                        get_bits_count(&h->gb), h->gb.size_in_bits);
-                er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x - 1,
-                             h->mb_y, ER_MB_END);
-                if (h->mb_x > lf_x_start)
-                    loop_filter(h, lf_x_start, h->mb_x);
-                return 0;
-            }
-        }
-    } else {
-        for (;;) {
-            int ret = ff_h264_decode_mb_cavlc(h);
-
-            if (ret >= 0)
-                ff_h264_hl_decode_mb(h);
-
-            // FIXME optimal? or let mb_decode decode 16x32 ?
-            if (ret >= 0 && FRAME_MBAFF(h)) {
-                h->mb_y++;
-                ret = ff_h264_decode_mb_cavlc(h);
-
-                if (ret >= 0)
-                    ff_h264_hl_decode_mb(h);
-                h->mb_y--;
-            }
-
-            if (ret < 0) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "error while decoding MB %d %d\n", h->mb_x, h->mb_y);
-                er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
-                             h->mb_y, ER_MB_ERROR);
-                return ret;
-            }
-
-            if (++h->mb_x >= h->mb_width) {
-                loop_filter(h, lf_x_start, h->mb_x);
-                h->mb_x = lf_x_start = 0;
-                decode_finish_row(h);
-                ++h->mb_y;
-                if (FIELD_OR_MBAFF_PICTURE(h)) {
-                    ++h->mb_y;
-                    if (FRAME_MBAFF(h) && h->mb_y < h->mb_height)
-                        predict_field_decoding_flag(h);
-                }
-                if (h->mb_y >= h->mb_height) {
-                    tprintf(h->avctx, "slice end %d %d\n",
-                            get_bits_count(&h->gb), h->gb.size_in_bits);
-
-                    if (get_bits_left(&h->gb) == 0) {
-                        er_add_slice(h, h->resync_mb_x, h->resync_mb_y,
-                                     h->mb_x - 1, h->mb_y,
-                                     ER_MB_END);
-
-                        return 0;
-                    } else {
-                        er_add_slice(h, h->resync_mb_x, h->resync_mb_y,
-                                     h->mb_x - 1, h->mb_y,
-                                     ER_MB_END);
-
-                        return AVERROR_INVALIDDATA;
-                    }
-                }
-            }
-
-            if (get_bits_left(&h->gb) <= 0 && h->mb_skip_run <= 0) {
-                tprintf(h->avctx, "slice end %d %d\n",
-                        get_bits_count(&h->gb), h->gb.size_in_bits);
-
-                if (get_bits_left(&h->gb) == 0) {
-                    er_add_slice(h, h->resync_mb_x, h->resync_mb_y,
-                                 h->mb_x - 1, h->mb_y,
-                                 ER_MB_END);
-                    if (h->mb_x > lf_x_start)
-                        loop_filter(h, lf_x_start, h->mb_x);
-
-                    return 0;
-                } else {
-                    er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
-                                 h->mb_y, ER_MB_ERROR);
-
-                    return AVERROR_INVALIDDATA;
-                }
-            }
-        }
-    }
-}
-
-/**
- * Call decode_slice() for each context.
- *
- * @param h h264 master context
- * @param context_count number of contexts to execute
- */
-static int execute_decode_slices(H264Context *h, unsigned context_count)
-{
-    AVCodecContext *const avctx = h->avctx;
-    H264Context *hx;
-    int i;
-
-    if (h->mb_y >= h->mb_height) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "Input contains more MB rows than the frame height.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (h->avctx->hwaccel)
-        return 0;
-    if (context_count == 1) {
-        return decode_slice(avctx, &h);
-    } else {
-        for (i = 1; i < context_count; i++) {
-            hx                 = h->thread_context[i];
-            hx->er.error_count = 0;
-        }
-
-        avctx->execute(avctx, decode_slice, h->thread_context,
-                       NULL, context_count, sizeof(void *));
-
-        /* pull back stuff from slices to master context */
-        hx                   = h->thread_context[context_count - 1];
-        h->mb_x              = hx->mb_x;
-        h->mb_y              = hx->mb_y;
-        h->droppable         = hx->droppable;
-        h->picture_structure = hx->picture_structure;
-        for (i = 1; i < context_count; i++)
-            h->er.error_count += h->thread_context[i]->er.error_count;
-    }
-
-    return 0;
-}
-
-static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
-                            int parse_extradata)
-{
-    AVCodecContext *const avctx = h->avctx;
-    H264Context *hx; ///< thread context
-    int buf_index;
-    unsigned context_count;
-    int next_avc;
-    int pass = !(avctx->active_thread_type & FF_THREAD_FRAME);
-    int nals_needed = 0; ///< number of NALs that need decoding before the next frame thread starts
-    int nal_index;
-    int ret = 0;
-
-    h->max_contexts = h->slice_context_count;
-    if (!(avctx->flags2 & CODEC_FLAG2_CHUNKS)) {
-        h->current_slice = 0;
-        if (!h->first_field)
-            h->cur_pic_ptr = NULL;
-        ff_h264_reset_sei(h);
-    }
-
-    for (; pass <= 1; pass++) {
-        buf_index     = 0;
-        context_count = 0;
-        next_avc      = h->is_avc ? 0 : buf_size;
-        nal_index     = 0;
-        for (;;) {
-            int consumed;
-            int dst_length;
-            int bit_length;
-            const uint8_t *ptr;
-            int i, nalsize = 0;
-            int err;
-
-            if (buf_index >= next_avc) {
-                if (buf_index >= buf_size - h->nal_length_size)
-                    break;
-                nalsize = 0;
-                for (i = 0; i < h->nal_length_size; i++)
-                    nalsize = (nalsize << 8) | buf[buf_index++];
-                if (nalsize <= 0 || nalsize > buf_size - buf_index) {
-                    av_log(h->avctx, AV_LOG_ERROR,
-                           "AVC: nal size %d\n", nalsize);
-                    break;
-                }
-                next_avc = buf_index + nalsize;
-            } else {
-                // start code prefix search
-                for (; buf_index + 3 < next_avc; buf_index++)
-                    // This should always succeed in the first iteration.
-                    if (buf[buf_index]     == 0 &&
-                        buf[buf_index + 1] == 0 &&
-                        buf[buf_index + 2] == 1)
-                        break;
-
-                if (buf_index + 3 >= buf_size) {
-                    buf_index = buf_size;
-                    break;
-                }
-
-                buf_index += 3;
-                if (buf_index >= next_avc)
-                    continue;
-            }
-
-            hx = h->thread_context[context_count];
-
-            ptr = ff_h264_decode_nal(hx, buf + buf_index, &dst_length,
-                                     &consumed, next_avc - buf_index);
-            if (ptr == NULL || dst_length < 0) {
-                ret = -1;
-                goto end;
-            }
-            i = buf_index + consumed;
-            if ((h->workaround_bugs & FF_BUG_AUTODETECT) && i + 3 < next_avc &&
-                buf[i]     == 0x00 && buf[i + 1] == 0x00 &&
-                buf[i + 2] == 0x01 && buf[i + 3] == 0xE0)
-                h->workaround_bugs |= FF_BUG_TRUNCATED;
-
-            if (!(h->workaround_bugs & FF_BUG_TRUNCATED))
-                while (dst_length > 0 && ptr[dst_length - 1] == 0)
-                    dst_length--;
-            bit_length = !dst_length ? 0
-                                     : (8 * dst_length -
-                                        decode_rbsp_trailing(h, ptr + dst_length - 1));
-
-            if (h->avctx->debug & FF_DEBUG_STARTCODE)
-                av_log(h->avctx, AV_LOG_DEBUG,
-                       "NAL %d at %d/%d length %d\n",
-                       hx->nal_unit_type, buf_index, buf_size, dst_length);
-
-            if (h->is_avc && (nalsize != consumed) && nalsize)
-                av_log(h->avctx, AV_LOG_DEBUG,
-                       "AVC: Consumed only %d bytes instead of %d\n",
-                       consumed, nalsize);
-
-            buf_index += consumed;
-            nal_index++;
-
-            if (pass == 0) {
-                /* packets can sometimes contain multiple PPS/SPS,
-                 * e.g. two PAFF field pictures in one packet, or a demuxer
-                 * which splits NALs strangely if so, when frame threading we
-                 * can't start the next thread until we've read all of them */
-                switch (hx->nal_unit_type) {
-                case NAL_SPS:
-                case NAL_PPS:
-                    nals_needed = nal_index;
-                    break;
-                case NAL_DPA:
-                case NAL_IDR_SLICE:
-                case NAL_SLICE:
-                    init_get_bits(&hx->gb, ptr, bit_length);
-                    if (!get_ue_golomb(&hx->gb))
-                        nals_needed = nal_index;
-                }
-                continue;
-            }
-
-            if (avctx->skip_frame >= AVDISCARD_NONREF &&
-                h->nal_ref_idc == 0 &&
-                h->nal_unit_type != NAL_SEI)
-                continue;
-
-again:
-            /* Ignore every NAL unit type except PPS and SPS during extradata
-             * parsing. Decoding slices is not possible in codec init
-             * with frame-mt */
-            if (parse_extradata && HAVE_THREADS &&
-                (h->avctx->active_thread_type & FF_THREAD_FRAME) &&
-                (hx->nal_unit_type != NAL_PPS &&
-                 hx->nal_unit_type != NAL_SPS)) {
-                if (hx->nal_unit_type < NAL_AUD ||
-                    hx->nal_unit_type > NAL_AUXILIARY_SLICE)
-                    av_log(avctx, AV_LOG_INFO,
-                           "Ignoring NAL unit %d during extradata parsing\n",
-                           hx->nal_unit_type);
-                hx->nal_unit_type = NAL_FF_IGNORE;
-            }
-            err = 0;
-            switch (hx->nal_unit_type) {
-            case NAL_IDR_SLICE:
-                if (h->nal_unit_type != NAL_IDR_SLICE) {
-                    av_log(h->avctx, AV_LOG_ERROR,
-                           "Invalid mix of idr and non-idr slices\n");
-                    ret = -1;
-                    goto end;
-                }
-                idr(h); // FIXME ensure we don't lose some frames if there is reordering
-            case NAL_SLICE:
-                init_get_bits(&hx->gb, ptr, bit_length);
-                hx->intra_gb_ptr      =
-                hx->inter_gb_ptr      = &hx->gb;
-                hx->data_partitioning = 0;
-
-                if ((err = decode_slice_header(hx, h)))
-                    break;
-
-                if (h->sei_recovery_frame_cnt >= 0 && h->recovery_frame < 0) {
-                    h->recovery_frame = (h->frame_num + h->sei_recovery_frame_cnt) &
-                                        ((1 << h->sps.log2_max_frame_num) - 1);
-                }
-
-                h->cur_pic_ptr->f.key_frame |=
-                    (hx->nal_unit_type == NAL_IDR_SLICE) ||
-                    (h->sei_recovery_frame_cnt >= 0);
-
-                if (hx->nal_unit_type == NAL_IDR_SLICE ||
-                    h->recovery_frame == h->frame_num) {
-                    h->recovery_frame         = -1;
-                    h->cur_pic_ptr->recovered = 1;
-                }
-                // If we have an IDR, all frames after it in decoded order are
-                // "recovered".
-                if (hx->nal_unit_type == NAL_IDR_SLICE)
-                    h->frame_recovered |= FRAME_RECOVERED_IDR;
-                h->cur_pic_ptr->recovered |= !!(h->frame_recovered & FRAME_RECOVERED_IDR);
-
-                if (h->current_slice == 1) {
-                    if (!(avctx->flags2 & CODEC_FLAG2_CHUNKS))
-                        decode_postinit(h, nal_index >= nals_needed);
-
-                    if (h->avctx->hwaccel &&
-                        (ret = h->avctx->hwaccel->start_frame(h->avctx, NULL, 0)) < 0)
-                        return ret;
-                }
-
-                if (hx->redundant_pic_count == 0 &&
-                    (avctx->skip_frame < AVDISCARD_NONREF ||
-                     hx->nal_ref_idc) &&
-                    (avctx->skip_frame < AVDISCARD_BIDIR  ||
-                     hx->slice_type_nos != AV_PICTURE_TYPE_B) &&
-                    (avctx->skip_frame < AVDISCARD_NONKEY ||
-                     hx->slice_type_nos == AV_PICTURE_TYPE_I) &&
-                    avctx->skip_frame < AVDISCARD_ALL) {
-                    if (avctx->hwaccel) {
-                        ret = avctx->hwaccel->decode_slice(avctx,
-                                                           &buf[buf_index - consumed],
-                                                           consumed);
-                        if (ret < 0)
-                            return ret;
-                    } else
-                        context_count++;
-                }
-                break;
-            case NAL_DPA:
-                if (h->avctx->flags & CODEC_FLAG2_CHUNKS) {
-                    av_log(h->avctx, AV_LOG_ERROR,
-                           "Decoding in chunks is not supported for "
-                           "partitioned slices.\n");
-                    return AVERROR(ENOSYS);
-                }
-
-                init_get_bits(&hx->gb, ptr, bit_length);
-                hx->intra_gb_ptr =
-                hx->inter_gb_ptr = NULL;
-
-                if ((err = decode_slice_header(hx, h)) < 0) {
-                    /* make sure data_partitioning is cleared if it was set
-                     * before, so we don't try decoding a slice without a valid
-                     * slice header later */
-                    h->data_partitioning = 0;
-                    break;
-                }
-
-                hx->data_partitioning = 1;
-                break;
-            case NAL_DPB:
-                init_get_bits(&hx->intra_gb, ptr, bit_length);
-                hx->intra_gb_ptr = &hx->intra_gb;
-                break;
-            case NAL_DPC:
-                init_get_bits(&hx->inter_gb, ptr, bit_length);
-                hx->inter_gb_ptr = &hx->inter_gb;
-
-                if (hx->redundant_pic_count == 0 &&
-                    hx->intra_gb_ptr &&
-                    hx->data_partitioning &&
-                    h->cur_pic_ptr && h->context_initialized &&
-                    (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) &&
-                    (avctx->skip_frame < AVDISCARD_BIDIR  ||
-                     hx->slice_type_nos != AV_PICTURE_TYPE_B) &&
-                    (avctx->skip_frame < AVDISCARD_NONKEY ||
-                     hx->slice_type_nos == AV_PICTURE_TYPE_I) &&
-                    avctx->skip_frame < AVDISCARD_ALL)
-                    context_count++;
-                break;
-            case NAL_SEI:
-                init_get_bits(&h->gb, ptr, bit_length);
-                ff_h264_decode_sei(h);
-                break;
-            case NAL_SPS:
-                init_get_bits(&h->gb, ptr, bit_length);
-                ret = ff_h264_decode_seq_parameter_set(h);
-                if (ret < 0 && h->is_avc && (nalsize != consumed) && nalsize) {
-                    av_log(h->avctx, AV_LOG_DEBUG,
-                           "SPS decoding failure, trying again with the complete NAL\n");
-                    init_get_bits(&h->gb, buf + buf_index + 1 - consumed,
-                                  8 * (nalsize - 1));
-                    ff_h264_decode_seq_parameter_set(h);
-                }
-
-                ret = h264_set_parameter_from_sps(h);
-                if (ret < 0)
-                    goto end;
-
-                break;
-            case NAL_PPS:
-                init_get_bits(&h->gb, ptr, bit_length);
-                ff_h264_decode_picture_parameter_set(h, bit_length);
-                break;
-            case NAL_AUD:
-            case NAL_END_SEQUENCE:
-            case NAL_END_STREAM:
-            case NAL_FILLER_DATA:
-            case NAL_SPS_EXT:
-            case NAL_AUXILIARY_SLICE:
-                break;
-            case NAL_FF_IGNORE:
-                break;
-            default:
-                av_log(avctx, AV_LOG_DEBUG, "Unknown NAL code: %d (%d bits)\n",
-                       hx->nal_unit_type, bit_length);
-            }
-
-            if (context_count == h->max_contexts) {
-                execute_decode_slices(h, context_count);
-                context_count = 0;
-            }
-
-            if (err < 0) {
-                av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
-                h->ref_count[0] = h->ref_count[1] = h->list_count = 0;
-            } else if (err == 1) {
-                /* Slice could not be decoded in parallel mode, copy down
-                 * NAL unit stuff to context 0 and restart. Note that
-                 * rbsp_buffer is not transferred, but since we no longer
-                 * run in parallel mode this should not be an issue. */
-                h->nal_unit_type = hx->nal_unit_type;
-                h->nal_ref_idc   = hx->nal_ref_idc;
-                hx               = h;
-                goto again;
-            }
-        }
-    }
-    if (context_count)
-        execute_decode_slices(h, context_count);
-
-end:
-    /* clean up */
-    if (h->cur_pic_ptr && !h->droppable) {
-        ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
-                                  h->picture_structure == PICT_BOTTOM_FIELD);
-    }
-
-    return (ret < 0) ? ret : buf_index;
-}
-
-/**
- * Return the number of bytes consumed for building the current frame.
- */
-static int get_consumed_bytes(int pos, int buf_size)
-{
-    if (pos == 0)
-        pos = 1;          // avoid infinite loops (i doubt that is needed but ...)
-    if (pos + 10 > buf_size)
-        pos = buf_size;                   // oops ;)
-
-    return pos;
-}
-
-static int output_frame(H264Context *h, AVFrame *dst, AVFrame *src)
-{
-    int i;
-    int ret = av_frame_ref(dst, src);
-    if (ret < 0)
-        return ret;
-
-    if (!h->sps.crop)
-        return 0;
-
-    for (i = 0; i < 3; i++) {
-        int hshift = (i > 0) ? h->chroma_x_shift : 0;
-        int vshift = (i > 0) ? h->chroma_y_shift : 0;
-        int off    = ((h->sps.crop_left >> hshift) << h->pixel_shift) +
-                     (h->sps.crop_top >> vshift) * dst->linesize[i];
-        dst->data[i] += off;
-    }
-    return 0;
-}
-
-static int h264_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    H264Context *h     = avctx->priv_data;
-    AVFrame *pict      = data;
-    int buf_index      = 0;
-    int ret;
-
-    h->flags = avctx->flags;
-    /* reset data partitioning here, to ensure GetBitContexts from previous
-     * packets do not get used. */
-    h->data_partitioning = 0;
-
-    /* end of stream, output what is still in the buffers */
-out:
-    if (buf_size == 0) {
-        Picture *out;
-        int i, out_idx;
-
-        h->cur_pic_ptr = NULL;
-
-        // FIXME factorize this with the output code below
-        out     = h->delayed_pic[0];
-        out_idx = 0;
-        for (i = 1;
-             h->delayed_pic[i] &&
-             !h->delayed_pic[i]->f.key_frame &&
-             !h->delayed_pic[i]->mmco_reset;
-             i++)
-            if (h->delayed_pic[i]->poc < out->poc) {
-                out     = h->delayed_pic[i];
-                out_idx = i;
-            }
-
-        for (i = out_idx; h->delayed_pic[i]; i++)
-            h->delayed_pic[i] = h->delayed_pic[i + 1];
-
-        if (out) {
-            ret = output_frame(h, pict, &out->f);
-            if (ret < 0)
-                return ret;
-            *got_frame = 1;
-        }
-
-        return buf_index;
-    }
-
-    buf_index = decode_nal_units(h, buf, buf_size, 0);
-    if (buf_index < 0)
-        return AVERROR_INVALIDDATA;
-
-    if (!h->cur_pic_ptr && h->nal_unit_type == NAL_END_SEQUENCE) {
-        buf_size = 0;
-        goto out;
-    }
-
-    if (!(avctx->flags2 & CODEC_FLAG2_CHUNKS) && !h->cur_pic_ptr) {
-        if (avctx->skip_frame >= AVDISCARD_NONREF)
-            return 0;
-        av_log(avctx, AV_LOG_ERROR, "no frame!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!(avctx->flags2 & CODEC_FLAG2_CHUNKS) ||
-        (h->mb_y >= h->mb_height && h->mb_height)) {
-        if (avctx->flags2 & CODEC_FLAG2_CHUNKS)
-            decode_postinit(h, 1);
-
-        field_end(h, 0);
-
-        *got_frame = 0;
-        if (h->next_output_pic && ((avctx->flags & CODEC_FLAG_OUTPUT_CORRUPT) ||
-                                   h->next_output_pic->recovered)) {
-            if (!h->next_output_pic->recovered)
-                h->next_output_pic->f.flags |= AV_FRAME_FLAG_CORRUPT;
-
-            ret = output_frame(h, pict, &h->next_output_pic->f);
-            if (ret < 0)
-                return ret;
-            *got_frame = 1;
-        }
-    }
-
-    assert(pict->buf[0] || !*got_frame);
-
-    return get_consumed_bytes(buf_index, buf_size);
-}
-
-av_cold void ff_h264_free_context(H264Context *h)
-{
-    int i;
-
-    free_tables(h, 1); // FIXME cleanup init stuff perhaps
-
-    for (i = 0; i < MAX_SPS_COUNT; i++)
-        av_freep(h->sps_buffers + i);
-
-    for (i = 0; i < MAX_PPS_COUNT; i++)
-        av_freep(h->pps_buffers + i);
-}
-
-static av_cold int h264_decode_end(AVCodecContext *avctx)
-{
-    H264Context *h = avctx->priv_data;
-
-    ff_h264_free_context(h);
-
-    unref_picture(h, &h->cur_pic);
-
-    return 0;
-}
-
-static const AVProfile profiles[] = {
-    { FF_PROFILE_H264_BASELINE,             "Baseline"              },
-    { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline"  },
-    { FF_PROFILE_H264_MAIN,                 "Main"                  },
-    { FF_PROFILE_H264_EXTENDED,             "Extended"              },
-    { FF_PROFILE_H264_HIGH,                 "High"                  },
-    { FF_PROFILE_H264_HIGH_10,              "High 10"               },
-    { FF_PROFILE_H264_HIGH_10_INTRA,        "High 10 Intra"         },
-    { FF_PROFILE_H264_HIGH_422,             "High 4:2:2"            },
-    { FF_PROFILE_H264_HIGH_422_INTRA,       "High 4:2:2 Intra"      },
-    { FF_PROFILE_H264_HIGH_444,             "High 4:4:4"            },
-    { FF_PROFILE_H264_HIGH_444_PREDICTIVE,  "High 4:4:4 Predictive" },
-    { FF_PROFILE_H264_HIGH_444_INTRA,       "High 4:4:4 Intra"      },
-    { FF_PROFILE_H264_CAVLC_444,            "CAVLC 4:4:4"           },
-    { FF_PROFILE_UNKNOWN },
-};
-
-AVCodec ff_h264_decoder = {
-    .name                  = "h264",
-    .long_name             = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_H264,
-    .priv_data_size        = sizeof(H264Context),
-    .init                  = ff_h264_decode_init,
-    .close                 = h264_decode_end,
-    .decode                = h264_decode_frame,
-    .capabilities          = /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 |
-                             CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS |
-                             CODEC_CAP_FRAME_THREADS,
-    .flush                 = flush_dpb,
-    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(decode_update_thread_context),
-    .profiles              = NULL_IF_CONFIG_SMALL(profiles),
-};
diff --git a/deps/libav/libavcodec/h264.h b/deps/libav/libavcodec/h264.h
deleted file mode 100644
index f29bc6a..0000000
--- a/deps/libav/libavcodec/h264.h
+++ /dev/null
@@ -1,982 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 codec.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVCODEC_H264_H
-#define AVCODEC_H264_H
-
-#include "libavutil/intreadwrite.h"
-#include "cabac.h"
-#include "error_resilience.h"
-#include "get_bits.h"
-#include "mpegvideo.h"
-#include "h264chroma.h"
-#include "h264dsp.h"
-#include "h264pred.h"
-#include "h264qpel.h"
-#include "rectangle.h"
-
-#define MAX_SPS_COUNT          32
-#define MAX_PPS_COUNT         256
-
-#define MAX_MMCO_COUNT         66
-
-#define MAX_DELAYED_PIC_COUNT  16
-
-/* Compiling in interlaced support reduces the speed
- * of progressive decoding by about 2%. */
-#define ALLOW_INTERLACE
-
-#define FMO 0
-
-/**
- * The maximum number of slices supported by the decoder.
- * must be a power of 2
- */
-#define MAX_SLICES 16
-
-#ifdef ALLOW_INTERLACE
-#define MB_MBAFF(h)    h->mb_mbaff
-#define MB_FIELD(h)    h->mb_field_decoding_flag
-#define FRAME_MBAFF(h) h->mb_aff_frame
-#define FIELD_PICTURE(h) (h->picture_structure != PICT_FRAME)
-#define LEFT_MBS 2
-#define LTOP     0
-#define LBOT     1
-#define LEFT(i)  (i)
-#else
-#define MB_MBAFF(h)      0
-#define MB_FIELD(h)      0
-#define FRAME_MBAFF(h)   0
-#define FIELD_PICTURE(h) 0
-#undef  IS_INTERLACED
-#define IS_INTERLACED(mb_type) 0
-#define LEFT_MBS 1
-#define LTOP     0
-#define LBOT     0
-#define LEFT(i)  0
-#endif
-#define FIELD_OR_MBAFF_PICTURE(h) (FRAME_MBAFF(h) || FIELD_PICTURE(h))
-
-#ifndef CABAC
-#define CABAC(h) h->pps.cabac
-#endif
-
-#define CHROMA422(h) (h->sps.chroma_format_idc == 2)
-#define CHROMA444(h) (h->sps.chroma_format_idc == 3)
-
-#define EXTENDED_SAR       255
-
-#define MB_TYPE_REF0       MB_TYPE_ACPRED // dirty but it fits in 16 bit
-#define MB_TYPE_8x8DCT     0x01000000
-#define IS_REF0(a)         ((a) & MB_TYPE_REF0)
-#define IS_8x8DCT(a)       ((a) & MB_TYPE_8x8DCT)
-
-#define QP_MAX_NUM (51 + 2 * 6)           // The maximum supported qp
-
-/* NAL unit types */
-enum {
-    NAL_SLICE           = 1,
-    NAL_DPA             = 2,
-    NAL_DPB             = 3,
-    NAL_DPC             = 4,
-    NAL_IDR_SLICE       = 5,
-    NAL_SEI             = 6,
-    NAL_SPS             = 7,
-    NAL_PPS             = 8,
-    NAL_AUD             = 9,
-    NAL_END_SEQUENCE    = 10,
-    NAL_END_STREAM      = 11,
-    NAL_FILLER_DATA     = 12,
-    NAL_SPS_EXT         = 13,
-    NAL_AUXILIARY_SLICE = 19,
-    NAL_FF_IGNORE       = 0xff0f001,
-};
-
-/**
- * SEI message types
- */
-typedef enum {
-    SEI_TYPE_BUFFERING_PERIOD       = 0,   ///< buffering period (H.264, D.1.1)
-    SEI_TYPE_PIC_TIMING             = 1,   ///< picture timing
-    SEI_TYPE_USER_DATA_UNREGISTERED = 5,   ///< unregistered user data
-    SEI_TYPE_RECOVERY_POINT         = 6,   ///< recovery point (frame # to decoder sync)
-    SEI_TYPE_FRAME_PACKING          = 45,  ///< frame packing arrangement
-} SEI_Type;
-
-/**
- * pic_struct in picture timing SEI message
- */
-typedef enum {
-    SEI_PIC_STRUCT_FRAME             = 0, ///<  0: %frame
-    SEI_PIC_STRUCT_TOP_FIELD         = 1, ///<  1: top field
-    SEI_PIC_STRUCT_BOTTOM_FIELD      = 2, ///<  2: bottom field
-    SEI_PIC_STRUCT_TOP_BOTTOM        = 3, ///<  3: top field, bottom field, in that order
-    SEI_PIC_STRUCT_BOTTOM_TOP        = 4, ///<  4: bottom field, top field, in that order
-    SEI_PIC_STRUCT_TOP_BOTTOM_TOP    = 5, ///<  5: top field, bottom field, top field repeated, in that order
-    SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, ///<  6: bottom field, top field, bottom field repeated, in that order
-    SEI_PIC_STRUCT_FRAME_DOUBLING    = 7, ///<  7: %frame doubling
-    SEI_PIC_STRUCT_FRAME_TRIPLING    = 8  ///<  8: %frame tripling
-} SEI_PicStructType;
-
-/**
- * Sequence parameter set
- */
-typedef struct SPS {
-    unsigned int sps_id;
-    int profile_idc;
-    int level_idc;
-    int chroma_format_idc;
-    int transform_bypass;              ///< qpprime_y_zero_transform_bypass_flag
-    int log2_max_frame_num;            ///< log2_max_frame_num_minus4 + 4
-    int poc_type;                      ///< pic_order_cnt_type
-    int log2_max_poc_lsb;              ///< log2_max_pic_order_cnt_lsb_minus4
-    int delta_pic_order_always_zero_flag;
-    int offset_for_non_ref_pic;
-    int offset_for_top_to_bottom_field;
-    int poc_cycle_length;              ///< num_ref_frames_in_pic_order_cnt_cycle
-    int ref_frame_count;               ///< num_ref_frames
-    int gaps_in_frame_num_allowed_flag;
-    int mb_width;                      ///< pic_width_in_mbs_minus1 + 1
-    int mb_height;                     ///< pic_height_in_map_units_minus1 + 1
-    int frame_mbs_only_flag;
-    int mb_aff;                        ///< mb_adaptive_frame_field_flag
-    int direct_8x8_inference_flag;
-    int crop;                          ///< frame_cropping_flag
-
-    /* those 4 are already in luma samples */
-    unsigned int crop_left;            ///< frame_cropping_rect_left_offset
-    unsigned int crop_right;           ///< frame_cropping_rect_right_offset
-    unsigned int crop_top;             ///< frame_cropping_rect_top_offset
-    unsigned int crop_bottom;          ///< frame_cropping_rect_bottom_offset
-    int vui_parameters_present_flag;
-    AVRational sar;
-    int video_signal_type_present_flag;
-    int full_range;
-    int colour_description_present_flag;
-    enum AVColorPrimaries color_primaries;
-    enum AVColorTransferCharacteristic color_trc;
-    enum AVColorSpace colorspace;
-    int timing_info_present_flag;
-    uint32_t num_units_in_tick;
-    uint32_t time_scale;
-    int fixed_frame_rate_flag;
-    short offset_for_ref_frame[256]; // FIXME dyn aloc?
-    int bitstream_restriction_flag;
-    int num_reorder_frames;
-    int scaling_matrix_present;
-    uint8_t scaling_matrix4[6][16];
-    uint8_t scaling_matrix8[6][64];
-    int nal_hrd_parameters_present_flag;
-    int vcl_hrd_parameters_present_flag;
-    int pic_struct_present_flag;
-    int time_offset_length;
-    int cpb_cnt;                          ///< See H.264 E.1.2
-    int initial_cpb_removal_delay_length; ///< initial_cpb_removal_delay_length_minus1 + 1
-    int cpb_removal_delay_length;         ///< cpb_removal_delay_length_minus1 + 1
-    int dpb_output_delay_length;          ///< dpb_output_delay_length_minus1 + 1
-    int bit_depth_luma;                   ///< bit_depth_luma_minus8 + 8
-    int bit_depth_chroma;                 ///< bit_depth_chroma_minus8 + 8
-    int residual_color_transform_flag;    ///< residual_colour_transform_flag
-    int constraint_set_flags;             ///< constraint_set[0-3]_flag
-    int new;                              ///< flag to keep track if the decoder context needs re-init due to changed SPS
-} SPS;
-
-/**
- * Picture parameter set
- */
-typedef struct PPS {
-    unsigned int sps_id;
-    int cabac;                  ///< entropy_coding_mode_flag
-    int pic_order_present;      ///< pic_order_present_flag
-    int slice_group_count;      ///< num_slice_groups_minus1 + 1
-    int mb_slice_group_map_type;
-    unsigned int ref_count[2];  ///< num_ref_idx_l0/1_active_minus1 + 1
-    int weighted_pred;          ///< weighted_pred_flag
-    int weighted_bipred_idc;
-    int init_qp;                ///< pic_init_qp_minus26 + 26
-    int init_qs;                ///< pic_init_qs_minus26 + 26
-    int chroma_qp_index_offset[2];
-    int deblocking_filter_parameters_present; ///< deblocking_filter_parameters_present_flag
-    int constrained_intra_pred;     ///< constrained_intra_pred_flag
-    int redundant_pic_cnt_present;  ///< redundant_pic_cnt_present_flag
-    int transform_8x8_mode;         ///< transform_8x8_mode_flag
-    uint8_t scaling_matrix4[6][16];
-    uint8_t scaling_matrix8[6][64];
-    uint8_t chroma_qp_table[2][64]; ///< pre-scaled (with chroma_qp_index_offset) version of qp_table
-    int chroma_qp_diff;
-} PPS;
-
-/**
- * Memory management control operation opcode.
- */
-typedef enum MMCOOpcode {
-    MMCO_END = 0,
-    MMCO_SHORT2UNUSED,
-    MMCO_LONG2UNUSED,
-    MMCO_SHORT2LONG,
-    MMCO_SET_MAX_LONG,
-    MMCO_RESET,
-    MMCO_LONG,
-} MMCOOpcode;
-
-/**
- * Memory management control operation.
- */
-typedef struct MMCO {
-    MMCOOpcode opcode;
-    int short_pic_num;  ///< pic_num without wrapping (pic_num & max_pic_num)
-    int long_arg;       ///< index, pic_num, or num long refs depending on opcode
-} MMCO;
-
-/**
- * H264Context
- */
-typedef struct H264Context {
-    AVCodecContext *avctx;
-    DSPContext       dsp;
-    VideoDSPContext vdsp;
-    H264DSPContext h264dsp;
-    H264ChromaContext h264chroma;
-    H264QpelContext h264qpel;
-    MotionEstContext me;
-    ParseContext parse_context;
-    GetBitContext gb;
-    ERContext er;
-
-    Picture *DPB;
-    Picture *cur_pic_ptr;
-    Picture cur_pic;
-
-    int pixel_shift;    ///< 0 for 8-bit H264, 1 for high-bit-depth H264
-    int chroma_qp[2];   // QPc
-
-    int qp_thresh;      ///< QP threshold to skip loopfilter
-
-    /* coded dimensions -- 16 * mb w/h */
-    int width, height;
-    ptrdiff_t linesize, uvlinesize;
-    int chroma_x_shift, chroma_y_shift;
-
-    int qscale;
-    int droppable;
-    int data_partitioning;
-    int coded_picture_number;
-    int low_delay;
-
-    int context_initialized;
-    int flags;
-    int workaround_bugs;
-
-    int prev_mb_skipped;
-    int next_mb_skipped;
-
-    // prediction stuff
-    int chroma_pred_mode;
-    int intra16x16_pred_mode;
-
-    int topleft_mb_xy;
-    int top_mb_xy;
-    int topright_mb_xy;
-    int left_mb_xy[LEFT_MBS];
-
-    int topleft_type;
-    int top_type;
-    int topright_type;
-    int left_type[LEFT_MBS];
-
-    const uint8_t *left_block;
-    int topleft_partition;
-
-    int8_t intra4x4_pred_mode_cache[5 * 8];
-    int8_t(*intra4x4_pred_mode);
-    H264PredContext hpc;
-    unsigned int topleft_samples_available;
-    unsigned int top_samples_available;
-    unsigned int topright_samples_available;
-    unsigned int left_samples_available;
-    uint8_t (*top_borders[2])[(16 * 3) * 2];
-
-    /**
-     * non zero coeff count cache.
-     * is 64 if not available.
-     */
-    DECLARE_ALIGNED(8, uint8_t, non_zero_count_cache)[15 * 8];
-
-    uint8_t (*non_zero_count)[48];
-
-    /**
-     * Motion vector cache.
-     */
-    DECLARE_ALIGNED(16, int16_t, mv_cache)[2][5 * 8][2];
-    DECLARE_ALIGNED(8, int8_t, ref_cache)[2][5 * 8];
-#define LIST_NOT_USED -1 // FIXME rename?
-#define PART_NOT_AVAILABLE -2
-
-    /**
-     * number of neighbors (top and/or left) that used 8x8 dct
-     */
-    int neighbor_transform_size;
-
-    /**
-     * block_offset[ 0..23] for frame macroblocks
-     * block_offset[24..47] for field macroblocks
-     */
-    int block_offset[2 * (16 * 3)];
-
-    uint32_t *mb2b_xy;  // FIXME are these 4 a good idea?
-    uint32_t *mb2br_xy;
-    int b_stride;       // FIXME use s->b4_stride
-
-    ptrdiff_t mb_linesize;  ///< may be equal to s->linesize or s->linesize * 2, for mbaff
-    ptrdiff_t mb_uvlinesize;
-
-    SPS sps; ///< current sps
-    PPS pps; ///< current pps
-
-    uint32_t dequant4_buffer[6][QP_MAX_NUM + 1][16]; // FIXME should these be moved down?
-    uint32_t dequant8_buffer[6][QP_MAX_NUM + 1][64];
-    uint32_t(*dequant4_coeff[6])[16];
-    uint32_t(*dequant8_coeff[6])[64];
-
-    int slice_num;
-    uint16_t *slice_table;      ///< slice_table_base + 2*mb_stride + 1
-    int slice_type;
-    int slice_type_nos;         ///< S free slice type (SI/SP are remapped to I/P)
-    int slice_type_fixed;
-
-    // interlacing specific flags
-    int mb_aff_frame;
-    int mb_field_decoding_flag;
-    int mb_mbaff;               ///< mb_aff_frame && mb_field_decoding_flag
-    int picture_structure;
-    int first_field;
-
-    DECLARE_ALIGNED(8, uint16_t, sub_mb_type)[4];
-
-    // Weighted pred stuff
-    int use_weight;
-    int use_weight_chroma;
-    int luma_log2_weight_denom;
-    int chroma_log2_weight_denom;
-    // The following 2 can be changed to int8_t but that causes 10cpu cycles speedloss
-    int luma_weight[48][2][2];
-    int chroma_weight[48][2][2][2];
-    int implicit_weight[48][48][2];
-
-    int direct_spatial_mv_pred;
-    int col_parity;
-    int col_fieldoff;
-    int dist_scale_factor[32];
-    int dist_scale_factor_field[2][32];
-    int map_col_to_list0[2][16 + 32];
-    int map_col_to_list0_field[2][2][16 + 32];
-
-    /**
-     * num_ref_idx_l0/1_active_minus1 + 1
-     */
-    unsigned int ref_count[2];          ///< counts frames or fields, depending on current mb mode
-    unsigned int list_count;
-    uint8_t *list_counts;               ///< Array of list_count per MB specifying the slice type
-    Picture ref_list[2][48];            /**< 0..15: frame refs, 16..47: mbaff field refs.
-                                         *   Reordered version of default_ref_list
-                                         *   according to picture reordering in slice header */
-    int ref2frm[MAX_SLICES][2][64];     ///< reference to frame number lists, used in the loop filter, the first 2 are for -2,-1
-
-    // data partitioning
-    GetBitContext intra_gb;
-    GetBitContext inter_gb;
-    GetBitContext *intra_gb_ptr;
-    GetBitContext *inter_gb_ptr;
-
-    const uint8_t *intra_pcm_ptr;
-    DECLARE_ALIGNED(16, int16_t, mb)[16 * 48 * 2]; ///< as a dct coeffecient is int32_t in high depth, we need to reserve twice the space.
-    DECLARE_ALIGNED(16, int16_t, mb_luma_dc)[3][16 * 2];
-    int16_t mb_padding[256 * 2];        ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not too large or ensure that there is some unused stuff after mb
-
-    /**
-     * Cabac
-     */
-    CABACContext cabac;
-    uint8_t cabac_state[1024];
-
-    /* 0x100 -> non null luma_dc, 0x80/0x40 -> non null chroma_dc (cb/cr), 0x?0 -> chroma_cbp(0, 1, 2), 0x0? luma_cbp */
-    uint16_t *cbp_table;
-    int cbp;
-    int top_cbp;
-    int left_cbp;
-    /* chroma_pred_mode for i4x4 or i16x16, else 0 */
-    uint8_t *chroma_pred_mode_table;
-    int last_qscale_diff;
-    uint8_t (*mvd_table[2])[2];
-    DECLARE_ALIGNED(16, uint8_t, mvd_cache)[2][5 * 8][2];
-    uint8_t *direct_table;
-    uint8_t direct_cache[5 * 8];
-
-    uint8_t zigzag_scan[16];
-    uint8_t zigzag_scan8x8[64];
-    uint8_t zigzag_scan8x8_cavlc[64];
-    uint8_t field_scan[16];
-    uint8_t field_scan8x8[64];
-    uint8_t field_scan8x8_cavlc[64];
-    const uint8_t *zigzag_scan_q0;
-    const uint8_t *zigzag_scan8x8_q0;
-    const uint8_t *zigzag_scan8x8_cavlc_q0;
-    const uint8_t *field_scan_q0;
-    const uint8_t *field_scan8x8_q0;
-    const uint8_t *field_scan8x8_cavlc_q0;
-
-    int x264_build;
-
-    int mb_x, mb_y;
-    int resync_mb_x;
-    int resync_mb_y;
-    int mb_skip_run;
-    int mb_height, mb_width;
-    int mb_stride;
-    int mb_num;
-    int mb_xy;
-
-    int is_complex;
-
-    // deblock
-    int deblocking_filter;          ///< disable_deblocking_filter_idc with 1 <-> 0
-    int slice_alpha_c0_offset;
-    int slice_beta_offset;
-
-    // =============================================================
-    // Things below are not used in the MB or more inner code
-
-    int nal_ref_idc;
-    int nal_unit_type;
-    uint8_t *rbsp_buffer[2];
-    unsigned int rbsp_buffer_size[2];
-
-    /**
-     * Used to parse AVC variant of h264
-     */
-    int is_avc;           ///< this flag is != 0 if codec is avc1
-    int nal_length_size;  ///< Number of bytes used for nal length (1, 2 or 4)
-    int got_first;        ///< this flag is != 0 if we've parsed a frame
-
-    int bit_depth_luma;         ///< luma bit depth from sps to detect changes
-    int chroma_format_idc;      ///< chroma format from sps to detect changes
-
-    SPS *sps_buffers[MAX_SPS_COUNT];
-    PPS *pps_buffers[MAX_PPS_COUNT];
-
-    int dequant_coeff_pps;      ///< reinit tables when pps changes
-
-    uint16_t *slice_table_base;
-
-    // POC stuff
-    int poc_lsb;
-    int poc_msb;
-    int delta_poc_bottom;
-    int delta_poc[2];
-    int frame_num;
-    int prev_poc_msb;           ///< poc_msb of the last reference pic for POC type 0
-    int prev_poc_lsb;           ///< poc_lsb of the last reference pic for POC type 0
-    int frame_num_offset;       ///< for POC type 2
-    int prev_frame_num_offset;  ///< for POC type 2
-    int prev_frame_num;         ///< frame_num of the last pic for POC type 1/2
-
-    /**
-     * frame_num for frames or 2 * frame_num + 1 for field pics.
-     */
-    int curr_pic_num;
-
-    /**
-     * max_frame_num or 2 * max_frame_num for field pics.
-     */
-    int max_pic_num;
-
-    int redundant_pic_count;
-
-    Picture default_ref_list[2][32]; ///< base reference list for all slices of a coded picture
-    Picture *short_ref[32];
-    Picture *long_ref[32];
-    Picture *delayed_pic[MAX_DELAYED_PIC_COUNT + 2]; // FIXME size?
-    int last_pocs[MAX_DELAYED_PIC_COUNT];
-    Picture *next_output_pic;
-    int outputed_poc;
-    int next_outputed_poc;
-
-    /**
-     * memory management control operations buffer.
-     */
-    MMCO mmco[MAX_MMCO_COUNT];
-    int mmco_index;
-    int mmco_reset;
-
-    int long_ref_count;     ///< number of actual long term references
-    int short_ref_count;    ///< number of actual short term references
-
-    int cabac_init_idc;
-
-    /**
-     * @name Members for slice based multithreading
-     * @{
-     */
-    struct H264Context *thread_context[MAX_THREADS];
-
-    /**
-     * current slice number, used to initalize slice_num of each thread/context
-     */
-    int current_slice;
-
-    /**
-     * Max number of threads / contexts.
-     * This is equal to AVCodecContext.thread_count unless
-     * multithreaded decoding is impossible, in which case it is
-     * reduced to 1.
-     */
-    int max_contexts;
-
-    int slice_context_count;
-
-    /**
-     *  1 if the single thread fallback warning has already been
-     *  displayed, 0 otherwise.
-     */
-    int single_decode_warning;
-
-    enum AVPictureType pict_type;
-
-    int last_slice_type;
-    /** @} */
-
-    /**
-     * pic_struct in picture timing SEI message
-     */
-    SEI_PicStructType sei_pic_struct;
-
-    /**
-     * Complement sei_pic_struct
-     * SEI_PIC_STRUCT_TOP_BOTTOM and SEI_PIC_STRUCT_BOTTOM_TOP indicate interlaced frames.
-     * However, soft telecined frames may have these values.
-     * This is used in an attempt to flag soft telecine progressive.
-     */
-    int prev_interlaced_frame;
-
-    /**
-     * frame_packing_arrangment SEI message
-     */
-    int sei_frame_packing_present;
-    int frame_packing_arrangement_type;
-    int content_interpretation_type;
-    int quincunx_subsampling;
-
-    /**
-     * Bit set of clock types for fields/frames in picture timing SEI message.
-     * For each found ct_type, appropriate bit is set (e.g., bit 1 for
-     * interlaced).
-     */
-    int sei_ct_type;
-
-    /**
-     * dpb_output_delay in picture timing SEI message, see H.264 C.2.2
-     */
-    int sei_dpb_output_delay;
-
-    /**
-     * cpb_removal_delay in picture timing SEI message, see H.264 C.1.2
-     */
-    int sei_cpb_removal_delay;
-
-    /**
-     * recovery_frame_cnt from SEI message
-     *
-     * Set to -1 if no recovery point SEI message found or to number of frames
-     * before playback synchronizes. Frames having recovery point are key
-     * frames.
-     */
-    int sei_recovery_frame_cnt;
-
-    /**
-     * recovery_frame is the frame_num at which the next frame should
-     * be fully constructed.
-     *
-     * Set to -1 when not expecting a recovery point.
-     */
-    int recovery_frame;
-
-/**
- * We have seen an IDR, so all the following frames in coded order are correctly
- * decodable.
- */
-#define FRAME_RECOVERED_IDR  (1 << 0)
-/**
- * Sufficient number of frames have been decoded since a SEI recovery point,
- * so all the following frames in presentation order are correct.
- */
-#define FRAME_RECOVERED_SEI  (1 << 1)
-
-    int frame_recovered;    ///< Initial frame has been completely recovered
-
-    int luma_weight_flag[2];    ///< 7.4.3.2 luma_weight_lX_flag
-    int chroma_weight_flag[2];  ///< 7.4.3.2 chroma_weight_lX_flag
-
-    // Timestamp stuff
-    int sei_buffering_period_present;   ///< Buffering period SEI flag
-    int initial_cpb_removal_delay[32];  ///< Initial timestamps for CPBs
-
-    int cur_chroma_format_idc;
-    uint8_t *bipred_scratchpad;
-    uint8_t *edge_emu_buffer;
-    int16_t *dc_val_base;
-
-    AVBufferPool *qscale_table_pool;
-    AVBufferPool *mb_type_pool;
-    AVBufferPool *motion_val_pool;
-    AVBufferPool *ref_index_pool;
-} H264Context;
-
-extern const uint8_t ff_h264_chroma_qp[3][QP_MAX_NUM + 1]; ///< One chroma qp table for each supported bit depth (8, 9, 10).
-extern const uint16_t ff_h264_mb_sizes[4];
-
-/**
- * Decode SEI
- */
-int ff_h264_decode_sei(H264Context *h);
-
-/**
- * Decode SPS
- */
-int ff_h264_decode_seq_parameter_set(H264Context *h);
-
-/**
- * compute profile from sps
- */
-int ff_h264_get_profile(SPS *sps);
-
-/**
- * Decode PPS
- */
-int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length);
-
-/**
- * Decode a network abstraction layer unit.
- * @param consumed is the number of bytes used as input
- * @param length is the length of the array
- * @param dst_length is the number of decoded bytes FIXME here
- *                   or a decode rbsp tailing?
- * @return decoded bytes, might be src+1 if no escapes
- */
-const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src,
-                                  int *dst_length, int *consumed, int length);
-
-/**
- * Free any data that may have been allocated in the H264 context
- * like SPS, PPS etc.
- */
-void ff_h264_free_context(H264Context *h);
-
-/**
- * Reconstruct bitstream slice_type.
- */
-int ff_h264_get_slice_type(const H264Context *h);
-
-/**
- * Allocate tables.
- * needs width/height
- */
-int ff_h264_alloc_tables(H264Context *h);
-
-/**
- * Fill the default_ref_list.
- */
-int ff_h264_fill_default_ref_list(H264Context *h);
-
-int ff_h264_decode_ref_pic_list_reordering(H264Context *h);
-void ff_h264_fill_mbaff_ref_list(H264Context *h);
-void ff_h264_remove_all_refs(H264Context *h);
-
-/**
- * Execute the reference picture marking (memory management control operations).
- */
-int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count);
-
-int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
-                                   int first_slice);
-
-int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice);
-
-/**
- * Check if the top & left blocks are available if needed & change the
- * dc mode so it only uses the available blocks.
- */
-int ff_h264_check_intra4x4_pred_mode(H264Context *h);
-
-/**
- * Check if the top & left blocks are available if needed & change the
- * dc mode so it only uses the available blocks.
- */
-int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma);
-
-void ff_h264_hl_decode_mb(H264Context *h);
-int ff_h264_decode_extradata(H264Context *h);
-int ff_h264_decode_init(AVCodecContext *avctx);
-void ff_h264_decode_init_vlc(void);
-
-/**
- * Decode a macroblock
- * @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR on error
- */
-int ff_h264_decode_mb_cavlc(H264Context *h);
-
-/**
- * Decode a CABAC coded macroblock
- * @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR on error
- */
-int ff_h264_decode_mb_cabac(H264Context *h);
-
-void ff_h264_init_cabac_states(H264Context *h);
-
-void ff_h264_direct_dist_scale_factor(H264Context *const h);
-void ff_h264_direct_ref_list_init(H264Context *const h);
-void ff_h264_pred_direct_motion(H264Context *const h, int *mb_type);
-
-void ff_h264_filter_mb_fast(H264Context *h, int mb_x, int mb_y,
-                            uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr,
-                            unsigned int linesize, unsigned int uvlinesize);
-void ff_h264_filter_mb(H264Context *h, int mb_x, int mb_y,
-                       uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr,
-                       unsigned int linesize, unsigned int uvlinesize);
-
-/**
- * Reset SEI values at the beginning of the frame.
- *
- * @param h H.264 context.
- */
-void ff_h264_reset_sei(H264Context *h);
-
-/*
- * o-o o-o
- *  / / /
- * o-o o-o
- *  ,---'
- * o-o o-o
- *  / / /
- * o-o o-o
- */
-
-/* Scan8 organization:
- *    0 1 2 3 4 5 6 7
- * 0  DY    y y y y y
- * 1        y Y Y Y Y
- * 2        y Y Y Y Y
- * 3        y Y Y Y Y
- * 4        y Y Y Y Y
- * 5  DU    u u u u u
- * 6        u U U U U
- * 7        u U U U U
- * 8        u U U U U
- * 9        u U U U U
- * 10 DV    v v v v v
- * 11       v V V V V
- * 12       v V V V V
- * 13       v V V V V
- * 14       v V V V V
- * DY/DU/DV are for luma/chroma DC.
- */
-
-#define LUMA_DC_BLOCK_INDEX   48
-#define CHROMA_DC_BLOCK_INDEX 49
-
-// This table must be here because scan8[constant] must be known at compiletime
-static const uint8_t scan8[16 * 3 + 3] = {
-    4 +  1 * 8, 5 +  1 * 8, 4 +  2 * 8, 5 +  2 * 8,
-    6 +  1 * 8, 7 +  1 * 8, 6 +  2 * 8, 7 +  2 * 8,
-    4 +  3 * 8, 5 +  3 * 8, 4 +  4 * 8, 5 +  4 * 8,
-    6 +  3 * 8, 7 +  3 * 8, 6 +  4 * 8, 7 +  4 * 8,
-    4 +  6 * 8, 5 +  6 * 8, 4 +  7 * 8, 5 +  7 * 8,
-    6 +  6 * 8, 7 +  6 * 8, 6 +  7 * 8, 7 +  7 * 8,
-    4 +  8 * 8, 5 +  8 * 8, 4 +  9 * 8, 5 +  9 * 8,
-    6 +  8 * 8, 7 +  8 * 8, 6 +  9 * 8, 7 +  9 * 8,
-    4 + 11 * 8, 5 + 11 * 8, 4 + 12 * 8, 5 + 12 * 8,
-    6 + 11 * 8, 7 + 11 * 8, 6 + 12 * 8, 7 + 12 * 8,
-    4 + 13 * 8, 5 + 13 * 8, 4 + 14 * 8, 5 + 14 * 8,
-    6 + 13 * 8, 7 + 13 * 8, 6 + 14 * 8, 7 + 14 * 8,
-    0 +  0 * 8, 0 +  5 * 8, 0 + 10 * 8
-};
-
-static av_always_inline uint32_t pack16to32(int a, int b)
-{
-#if HAVE_BIGENDIAN
-    return (b & 0xFFFF) + (a << 16);
-#else
-    return (a & 0xFFFF) + (b << 16);
-#endif
-}
-
-static av_always_inline uint16_t pack8to16(int a, int b)
-{
-#if HAVE_BIGENDIAN
-    return (b & 0xFF) + (a << 8);
-#else
-    return (a & 0xFF) + (b << 8);
-#endif
-}
-
-/**
- * Get the chroma qp.
- */
-static av_always_inline int get_chroma_qp(H264Context *h, int t, int qscale)
-{
-    return h->pps.chroma_qp_table[t][qscale];
-}
-
-/**
- * Get the predicted intra4x4 prediction mode.
- */
-static av_always_inline int pred_intra_mode(H264Context *h, int n)
-{
-    const int index8 = scan8[n];
-    const int left   = h->intra4x4_pred_mode_cache[index8 - 1];
-    const int top    = h->intra4x4_pred_mode_cache[index8 - 8];
-    const int min    = FFMIN(left, top);
-
-    tprintf(h->avctx, "mode:%d %d min:%d\n", left, top, min);
-
-    if (min < 0)
-        return DC_PRED;
-    else
-        return min;
-}
-
-static av_always_inline void write_back_intra_pred_mode(H264Context *h)
-{
-    int8_t *i4x4       = h->intra4x4_pred_mode + h->mb2br_xy[h->mb_xy];
-    int8_t *i4x4_cache = h->intra4x4_pred_mode_cache;
-
-    AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4);
-    i4x4[4] = i4x4_cache[7 + 8 * 3];
-    i4x4[5] = i4x4_cache[7 + 8 * 2];
-    i4x4[6] = i4x4_cache[7 + 8 * 1];
-}
-
-static av_always_inline void write_back_non_zero_count(H264Context *h)
-{
-    const int mb_xy    = h->mb_xy;
-    uint8_t *nnz       = h->non_zero_count[mb_xy];
-    uint8_t *nnz_cache = h->non_zero_count_cache;
-
-    AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]);
-    AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]);
-    AV_COPY32(&nnz[ 8], &nnz_cache[4 + 8 * 3]);
-    AV_COPY32(&nnz[12], &nnz_cache[4 + 8 * 4]);
-    AV_COPY32(&nnz[16], &nnz_cache[4 + 8 * 6]);
-    AV_COPY32(&nnz[20], &nnz_cache[4 + 8 * 7]);
-    AV_COPY32(&nnz[32], &nnz_cache[4 + 8 * 11]);
-    AV_COPY32(&nnz[36], &nnz_cache[4 + 8 * 12]);
-
-    if (!h->chroma_y_shift) {
-        AV_COPY32(&nnz[24], &nnz_cache[4 + 8 * 8]);
-        AV_COPY32(&nnz[28], &nnz_cache[4 + 8 * 9]);
-        AV_COPY32(&nnz[40], &nnz_cache[4 + 8 * 13]);
-        AV_COPY32(&nnz[44], &nnz_cache[4 + 8 * 14]);
-    }
-}
-
-static av_always_inline void write_back_motion_list(H264Context *h,
-                                                    int b_stride,
-                                                    int b_xy, int b8_xy,
-                                                    int mb_type, int list)
-{
-    int16_t(*mv_dst)[2] = &h->cur_pic.motion_val[list][b_xy];
-    int16_t(*mv_src)[2] = &h->mv_cache[list][scan8[0]];
-    AV_COPY128(mv_dst + 0 * b_stride, mv_src + 8 * 0);
-    AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1);
-    AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2);
-    AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3);
-    if (CABAC(h)) {
-        uint8_t (*mvd_dst)[2] = &h->mvd_table[list][FMO ? 8 * h->mb_xy
-                                                        : h->mb2br_xy[h->mb_xy]];
-        uint8_t(*mvd_src)[2]  = &h->mvd_cache[list][scan8[0]];
-        if (IS_SKIP(mb_type)) {
-            AV_ZERO128(mvd_dst);
-        } else {
-            AV_COPY64(mvd_dst, mvd_src + 8 * 3);
-            AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8 * 0);
-            AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8 * 1);
-            AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8 * 2);
-        }
-    }
-
-    {
-        int8_t *ref_index = &h->cur_pic.ref_index[list][b8_xy];
-        int8_t *ref_cache = h->ref_cache[list];
-        ref_index[0 + 0 * 2] = ref_cache[scan8[0]];
-        ref_index[1 + 0 * 2] = ref_cache[scan8[4]];
-        ref_index[0 + 1 * 2] = ref_cache[scan8[8]];
-        ref_index[1 + 1 * 2] = ref_cache[scan8[12]];
-    }
-}
-
-static av_always_inline void write_back_motion(H264Context *h, int mb_type)
-{
-    const int b_stride      = h->b_stride;
-    const int b_xy  = 4 * h->mb_x + 4 * h->mb_y * h->b_stride; // try mb2b(8)_xy
-    const int b8_xy = 4 * h->mb_xy;
-
-    if (USES_LIST(mb_type, 0)) {
-        write_back_motion_list(h, b_stride, b_xy, b8_xy, mb_type, 0);
-    } else {
-        fill_rectangle(&h->cur_pic.ref_index[0][b8_xy],
-                       2, 2, 2, (uint8_t)LIST_NOT_USED, 1);
-    }
-    if (USES_LIST(mb_type, 1))
-        write_back_motion_list(h, b_stride, b_xy, b8_xy, mb_type, 1);
-
-    if (h->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) {
-        if (IS_8X8(mb_type)) {
-            uint8_t *direct_table = &h->direct_table[4 * h->mb_xy];
-            direct_table[1] = h->sub_mb_type[1] >> 1;
-            direct_table[2] = h->sub_mb_type[2] >> 1;
-            direct_table[3] = h->sub_mb_type[3] >> 1;
-        }
-    }
-}
-
-static av_always_inline int get_dct8x8_allowed(H264Context *h)
-{
-    if (h->sps.direct_8x8_inference_flag)
-        return !(AV_RN64A(h->sub_mb_type) &
-                 ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8) *
-                  0x0001000100010001ULL));
-    else
-        return !(AV_RN64A(h->sub_mb_type) &
-                 ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8 | MB_TYPE_DIRECT2) *
-                  0x0001000100010001ULL));
-}
-
-void ff_h264_draw_horiz_band(H264Context *h, int y, int height);
-int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc);
-int ff_pred_weight_table(H264Context *h);
-int ff_set_ref_count(H264Context *h);
-
-#endif /* AVCODEC_H264_H */
diff --git a/deps/libav/libavcodec/h264_cabac.c b/deps/libav/libavcodec/h264_cabac.c
deleted file mode 100644
index 654eab7..0000000
--- a/deps/libav/libavcodec/h264_cabac.c
+++ /dev/null
@@ -1,2423 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... cabac decoding
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 cabac decoding.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#define CABAC(h) 1
-
-#include "libavutil/attributes.h"
-#include "libavutil/timer.h"
-#include "config.h"
-#include "cabac.h"
-#include "cabac_functions.h"
-#include "internal.h"
-#include "avcodec.h"
-#include "h264.h"
-#include "h264data.h"
-#include "h264_mvpred.h"
-#include "golomb.h"
-
-#if ARCH_X86
-#include "x86/h264_i386.h"
-#endif
-
-#include <assert.h>
-
-/* Cabac pre state table */
-
-static const int8_t cabac_context_init_I[1024][2] =
-{
-    /* 0 - 10 */
-    { 20, -15 }, {  2, 54 },  {  3,  74 }, { 20, -15 },
-    {  2,  54 }, {  3, 74 },  { -28,127 }, { -23, 104 },
-    { -6,  53 }, { -1, 54 },  {  7,  51 },
-
-    /* 11 - 23 unsused for I */
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },
-
-    /* 24- 39 */
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-
-    /* 40 - 53 */
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },    { 0, 0 },
-
-    /* 54 - 59 */
-    { 0, 0 },    { 0, 0 },    { 0, 0 },      { 0, 0 },
-    { 0, 0 },    { 0, 0 },
-
-    /* 60 - 69 */
-    { 0, 41 },   { 0, 63 },   { 0, 63 },     { 0, 63 },
-    { -9, 83 },  { 4, 86 },   { 0, 97 },     { -7, 72 },
-    { 13, 41 },  { 3, 62 },
-
-    /* 70 -> 87 */
-    { 0, 11 },   { 1, 55 },   { 0, 69 },     { -17, 127 },
-    { -13, 102 },{ 0, 82 },   { -7, 74 },    { -21, 107 },
-    { -27, 127 },{ -31, 127 },{ -24, 127 },  { -18, 95 },
-    { -27, 127 },{ -21, 114 },{ -30, 127 },  { -17, 123 },
-    { -12, 115 },{ -16, 122 },
-
-    /* 88 -> 104 */
-    { -11, 115 },{ -12, 63 }, { -2, 68 },    { -15, 84 },
-    { -13, 104 },{ -3, 70 },  { -8, 93 },    { -10, 90 },
-    { -30, 127 },{ -1, 74 },  { -6, 97 },    { -7, 91 },
-    { -20, 127 },{ -4, 56 },  { -5, 82 },    { -7, 76 },
-    { -22, 125 },
-
-    /* 105 -> 135 */
-    { -7, 93 },  { -11, 87 }, { -3, 77 },    { -5, 71 },
-    { -4, 63 },  { -4, 68 },  { -12, 84 },   { -7, 62 },
-    { -7, 65 },  { 8, 61 },   { 5, 56 },     { -2, 66 },
-    { 1, 64 },   { 0, 61 },   { -2, 78 },    { 1, 50 },
-    { 7, 52 },   { 10, 35 },  { 0, 44 },     { 11, 38 },
-    { 1, 45 },   { 0, 46 },   { 5, 44 },     { 31, 17 },
-    { 1, 51 },   { 7, 50 },   { 28, 19 },    { 16, 33 },
-    { 14, 62 },  { -13, 108 },{ -15, 100 },
-
-    /* 136 -> 165 */
-    { -13, 101 },{ -13, 91 }, { -12, 94 },   { -10, 88 },
-    { -16, 84 }, { -10, 86 }, { -7, 83 },    { -13, 87 },
-    { -19, 94 }, { 1, 70 },   { 0, 72 },     { -5, 74 },
-    { 18, 59 },  { -8, 102 }, { -15, 100 },  { 0, 95 },
-    { -4, 75 },  { 2, 72 },   { -11, 75 },   { -3, 71 },
-    { 15, 46 },  { -13, 69 }, { 0, 62 },     { 0, 65 },
-    { 21, 37 },  { -15, 72 }, { 9, 57 },     { 16, 54 },
-    { 0, 62 },   { 12, 72 },
-
-    /* 166 -> 196 */
-    { 24, 0 },   { 15, 9 },   { 8, 25 },     { 13, 18 },
-    { 15, 9 },   { 13, 19 },  { 10, 37 },    { 12, 18 },
-    { 6, 29 },   { 20, 33 },  { 15, 30 },    { 4, 45 },
-    { 1, 58 },   { 0, 62 },   { 7, 61 },     { 12, 38 },
-    { 11, 45 },  { 15, 39 },  { 11, 42 },    { 13, 44 },
-    { 16, 45 },  { 12, 41 },  { 10, 49 },    { 30, 34 },
-    { 18, 42 },  { 10, 55 },  { 17, 51 },    { 17, 46 },
-    { 0, 89 },   { 26, -19 }, { 22, -17 },
-
-    /* 197 -> 226 */
-    { 26, -17 }, { 30, -25 }, { 28, -20 },   { 33, -23 },
-    { 37, -27 }, { 33, -23 }, { 40, -28 },   { 38, -17 },
-    { 33, -11 }, { 40, -15 }, { 41, -6 },    { 38, 1 },
-    { 41, 17 },  { 30, -6 },  { 27, 3 },     { 26, 22 },
-    { 37, -16 }, { 35, -4 },  { 38, -8 },    { 38, -3 },
-    { 37, 3 },   { 38, 5 },   { 42, 0 },     { 35, 16 },
-    { 39, 22 },  { 14, 48 },  { 27, 37 },    { 21, 60 },
-    { 12, 68 },  { 2, 97 },
-
-    /* 227 -> 251 */
-    { -3, 71 },  { -6, 42 },  { -5, 50 },    { -3, 54 },
-    { -2, 62 },  { 0, 58 },   { 1, 63 },     { -2, 72 },
-    { -1, 74 },  { -9, 91 },  { -5, 67 },    { -5, 27 },
-    { -3, 39 },  { -2, 44 },  { 0, 46 },     { -16, 64 },
-    { -8, 68 },  { -10, 78 }, { -6, 77 },    { -10, 86 },
-    { -12, 92 }, { -15, 55 }, { -10, 60 },   { -6, 62 },
-    { -4, 65 },
-
-    /* 252 -> 275 */
-    { -12, 73 }, { -8, 76 },  { -7, 80 },    { -9, 88 },
-    { -17, 110 },{ -11, 97 }, { -20, 84 },   { -11, 79 },
-    { -6, 73 },  { -4, 74 },  { -13, 86 },   { -13, 96 },
-    { -11, 97 }, { -19, 117 },{ -8, 78 },    { -5, 33 },
-    { -4, 48 },  { -2, 53 },  { -3, 62 },    { -13, 71 },
-    { -10, 79 }, { -12, 86 }, { -13, 90 },   { -14, 97 },
-
-    /* 276 a bit special (not used, bypass is used instead) */
-    { 0, 0 },
-
-    /* 277 -> 307 */
-    { -6, 93 },  { -6, 84 },  { -8, 79 },    { 0, 66 },
-    { -1, 71 },  { 0, 62 },   { -2, 60 },    { -2, 59 },
-    { -5, 75 },  { -3, 62 },  { -4, 58 },    { -9, 66 },
-    { -1, 79 },  { 0, 71 },   { 3, 68 },     { 10, 44 },
-    { -7, 62 },  { 15, 36 },  { 14, 40 },    { 16, 27 },
-    { 12, 29 },  { 1, 44 },   { 20, 36 },    { 18, 32 },
-    { 5, 42 },   { 1, 48 },   { 10, 62 },    { 17, 46 },
-    { 9, 64 },   { -12, 104 },{ -11, 97 },
-
-    /* 308 -> 337 */
-    { -16, 96 }, { -7, 88 },  { -8, 85 },    { -7, 85 },
-    { -9, 85 },  { -13, 88 }, { 4, 66 },     { -3, 77 },
-    { -3, 76 },  { -6, 76 },  { 10, 58 },    { -1, 76 },
-    { -1, 83 },  { -7, 99 },  { -14, 95 },   { 2, 95 },
-    { 0, 76 },   { -5, 74 },  { 0, 70 },     { -11, 75 },
-    { 1, 68 },   { 0, 65 },   { -14, 73 },   { 3, 62 },
-    { 4, 62 },   { -1, 68 },  { -13, 75 },   { 11, 55 },
-    { 5, 64 },   { 12, 70 },
-
-    /* 338 -> 368 */
-    { 15, 6 },   { 6, 19 },   { 7, 16 },     { 12, 14 },
-    { 18, 13 },  { 13, 11 },  { 13, 15 },    { 15, 16 },
-    { 12, 23 },  { 13, 23 },  { 15, 20 },    { 14, 26 },
-    { 14, 44 },  { 17, 40 },  { 17, 47 },    { 24, 17 },
-    { 21, 21 },  { 25, 22 },  { 31, 27 },    { 22, 29 },
-    { 19, 35 },  { 14, 50 },  { 10, 57 },    { 7, 63 },
-    { -2, 77 },  { -4, 82 },  { -3, 94 },    { 9, 69 },
-    { -12, 109 },{ 36, -35 }, { 36, -34 },
-
-    /* 369 -> 398 */
-    { 32, -26 }, { 37, -30 }, { 44, -32 },   { 34, -18 },
-    { 34, -15 }, { 40, -15 }, { 33, -7 },    { 35, -5 },
-    { 33, 0 },   { 38, 2 },   { 33, 13 },    { 23, 35 },
-    { 13, 58 },  { 29, -3 },  { 26, 0 },     { 22, 30 },
-    { 31, -7 },  { 35, -15 }, { 34, -3 },    { 34, 3 },
-    { 36, -1 },  { 34, 5 },   { 32, 11 },    { 35, 5 },
-    { 34, 12 },  { 39, 11 },  { 30, 29 },    { 34, 26 },
-    { 29, 39 },  { 19, 66 },
-
-    /* 399 -> 435 */
-    {  31,  21 }, {  31,  31 }, {  25,  50 },
-    { -17, 120 }, { -20, 112 }, { -18, 114 }, { -11,  85 },
-    { -15,  92 }, { -14,  89 }, { -26,  71 }, { -15,  81 },
-    { -14,  80 }, {   0,  68 }, { -14,  70 }, { -24,  56 },
-    { -23,  68 }, { -24,  50 }, { -11,  74 }, {  23, -13 },
-    {  26, -13 }, {  40, -15 }, {  49, -14 }, {  44,   3 },
-    {  45,   6 }, {  44,  34 }, {  33,  54 }, {  19,  82 },
-    {  -3,  75 }, {  -1,  23 }, {   1,  34 }, {   1,  43 },
-    {   0,  54 }, {  -2,  55 }, {   0,  61 }, {   1,  64 },
-    {   0,  68 }, {  -9,  92 },
-
-    /* 436 -> 459 */
-    { -14, 106 }, { -13,  97 }, { -15,  90 }, { -12,  90 },
-    { -18,  88 }, { -10,  73 }, {  -9,  79 }, { -14,  86 },
-    { -10,  73 }, { -10,  70 }, { -10,  69 }, {  -5,  66 },
-    {  -9,  64 }, {  -5,  58 }, {   2,  59 }, {  21, -10 },
-    {  24, -11 }, {  28,  -8 }, {  28,  -1 }, {  29,   3 },
-    {  29,   9 }, {  35,  20 }, {  29,  36 }, {  14,  67 },
-
-    /* 460 -> 1024 */
-    { -17, 123 }, { -12, 115 }, { -16, 122 }, { -11, 115 },
-    { -12,  63 }, {  -2,  68 }, { -15,  84 }, { -13, 104 },
-    {  -3,  70 }, {  -8,  93 }, { -10,  90 }, { -30, 127 },
-    { -17, 123 }, { -12, 115 }, { -16, 122 }, { -11, 115 },
-    { -12,  63 }, {  -2,  68 }, { -15,  84 }, { -13, 104 },
-    {  -3,  70 }, {  -8,  93 }, { -10,  90 }, { -30, 127 },
-    {  -7,  93 }, { -11,  87 }, {  -3,  77 }, {  -5,  71 },
-    {  -4,  63 }, {  -4,  68 }, { -12,  84 }, {  -7,  62 },
-    {  -7,  65 }, {   8,  61 }, {   5,  56 }, {  -2,  66 },
-    {   1,  64 }, {   0,  61 }, {  -2,  78 }, {   1,  50 },
-    {   7,  52 }, {  10,  35 }, {   0,  44 }, {  11,  38 },
-    {   1,  45 }, {   0,  46 }, {   5,  44 }, {  31,  17 },
-    {   1,  51 }, {   7,  50 }, {  28,  19 }, {  16,  33 },
-    {  14,  62 }, { -13, 108 }, { -15, 100 }, { -13, 101 },
-    { -13,  91 }, { -12,  94 }, { -10,  88 }, { -16,  84 },
-    { -10,  86 }, {  -7,  83 }, { -13,  87 }, { -19,  94 },
-    {   1,  70 }, {   0,  72 }, {  -5,  74 }, {  18,  59 },
-    {  -7,  93 }, { -11,  87 }, {  -3,  77 }, {  -5,  71 },
-    {  -4,  63 }, {  -4,  68 }, { -12,  84 }, {  -7,  62 },
-    {  -7,  65 }, {   8,  61 }, {   5,  56 }, {  -2,  66 },
-    {   1,  64 }, {   0,  61 }, {  -2,  78 }, {   1,  50 },
-    {   7,  52 }, {  10,  35 }, {   0,  44 }, {  11,  38 },
-    {   1,  45 }, {   0,  46 }, {   5,  44 }, {  31,  17 },
-    {   1,  51 }, {   7,  50 }, {  28,  19 }, {  16,  33 },
-    {  14,  62 }, { -13, 108 }, { -15, 100 }, { -13, 101 },
-    { -13,  91 }, { -12,  94 }, { -10,  88 }, { -16,  84 },
-    { -10,  86 }, {  -7,  83 }, { -13,  87 }, { -19,  94 },
-    {   1,  70 }, {   0,  72 }, {  -5,  74 }, {  18,  59 },
-    {  24,   0 }, {  15,   9 }, {   8,  25 }, {  13,  18 },
-    {  15,   9 }, {  13,  19 }, {  10,  37 }, {  12,  18 },
-    {   6,  29 }, {  20,  33 }, {  15,  30 }, {   4,  45 },
-    {   1,  58 }, {   0,  62 }, {   7,  61 }, {  12,  38 },
-    {  11,  45 }, {  15,  39 }, {  11,  42 }, {  13,  44 },
-    {  16,  45 }, {  12,  41 }, {  10,  49 }, {  30,  34 },
-    {  18,  42 }, {  10,  55 }, {  17,  51 }, {  17,  46 },
-    {   0,  89 }, {  26, -19 }, {  22, -17 }, {  26, -17 },
-    {  30, -25 }, {  28, -20 }, {  33, -23 }, {  37, -27 },
-    {  33, -23 }, {  40, -28 }, {  38, -17 }, {  33, -11 },
-    {  40, -15 }, {  41,  -6 }, {  38,   1 }, {  41,  17 },
-    {  24,   0 }, {  15,   9 }, {   8,  25 }, {  13,  18 },
-    {  15,   9 }, {  13,  19 }, {  10,  37 }, {  12,  18 },
-    {   6,  29 }, {  20,  33 }, {  15,  30 }, {   4,  45 },
-    {   1,  58 }, {   0,  62 }, {   7,  61 }, {  12,  38 },
-    {  11,  45 }, {  15,  39 }, {  11,  42 }, {  13,  44 },
-    {  16,  45 }, {  12,  41 }, {  10,  49 }, {  30,  34 },
-    {  18,  42 }, {  10,  55 }, {  17,  51 }, {  17,  46 },
-    {   0,  89 }, {  26, -19 }, {  22, -17 }, {  26, -17 },
-    {  30, -25 }, {  28, -20 }, {  33, -23 }, {  37, -27 },
-    {  33, -23 }, {  40, -28 }, {  38, -17 }, {  33, -11 },
-    {  40, -15 }, {  41,  -6 }, {  38,   1 }, {  41,  17 },
-    { -17, 120 }, { -20, 112 }, { -18, 114 }, { -11,  85 },
-    { -15,  92 }, { -14,  89 }, { -26,  71 }, { -15,  81 },
-    { -14,  80 }, {   0,  68 }, { -14,  70 }, { -24,  56 },
-    { -23,  68 }, { -24,  50 }, { -11,  74 }, { -14, 106 },
-    { -13,  97 }, { -15,  90 }, { -12,  90 }, { -18,  88 },
-    { -10,  73 }, {  -9,  79 }, { -14,  86 }, { -10,  73 },
-    { -10,  70 }, { -10,  69 }, {  -5,  66 }, {  -9,  64 },
-    {  -5,  58 }, {   2,  59 }, {  23, -13 }, {  26, -13 },
-    {  40, -15 }, {  49, -14 }, {  44,   3 }, {  45,   6 },
-    {  44,  34 }, {  33,  54 }, {  19,  82 }, {  21, -10 },
-    {  24, -11 }, {  28,  -8 }, {  28,  -1 }, {  29,   3 },
-    {  29,   9 }, {  35,  20 }, {  29,  36 }, {  14,  67 },
-    {  -3,  75 }, {  -1,  23 }, {   1,  34 }, {   1,  43 },
-    {   0,  54 }, {  -2,  55 }, {   0,  61 }, {   1,  64 },
-    {   0,  68 }, {  -9,  92 }, { -17, 120 }, { -20, 112 },
-    { -18, 114 }, { -11,  85 }, { -15,  92 }, { -14,  89 },
-    { -26,  71 }, { -15,  81 }, { -14,  80 }, {   0,  68 },
-    { -14,  70 }, { -24,  56 }, { -23,  68 }, { -24,  50 },
-    { -11,  74 }, { -14, 106 }, { -13,  97 }, { -15,  90 },
-    { -12,  90 }, { -18,  88 }, { -10,  73 }, {  -9,  79 },
-    { -14,  86 }, { -10,  73 }, { -10,  70 }, { -10,  69 },
-    {  -5,  66 }, {  -9,  64 }, {  -5,  58 }, {   2,  59 },
-    {  23, -13 }, {  26, -13 }, {  40, -15 }, {  49, -14 },
-    {  44,   3 }, {  45,   6 }, {  44,  34 }, {  33,  54 },
-    {  19,  82 }, {  21, -10 }, {  24, -11 }, {  28,  -8 },
-    {  28,  -1 }, {  29,   3 }, {  29,   9 }, {  35,  20 },
-    {  29,  36 }, {  14,  67 }, {  -3,  75 }, {  -1,  23 },
-    {   1,  34 }, {   1,  43 }, {   0,  54 }, {  -2,  55 },
-    {   0,  61 }, {   1,  64 }, {   0,  68 }, {  -9,  92 },
-    {  -6,  93 }, {  -6,  84 }, {  -8,  79 }, {   0,  66 },
-    {  -1,  71 }, {   0,  62 }, {  -2,  60 }, {  -2,  59 },
-    {  -5,  75 }, {  -3,  62 }, {  -4,  58 }, {  -9,  66 },
-    {  -1,  79 }, {   0,  71 }, {   3,  68 }, {  10,  44 },
-    {  -7,  62 }, {  15,  36 }, {  14,  40 }, {  16,  27 },
-    {  12,  29 }, {   1,  44 }, {  20,  36 }, {  18,  32 },
-    {   5,  42 }, {   1,  48 }, {  10,  62 }, {  17,  46 },
-    {   9,  64 }, { -12, 104 }, { -11,  97 }, { -16,  96 },
-    {  -7,  88 }, {  -8,  85 }, {  -7,  85 }, {  -9,  85 },
-    { -13,  88 }, {   4,  66 }, {  -3,  77 }, {  -3,  76 },
-    {  -6,  76 }, {  10,  58 }, {  -1,  76 }, {  -1,  83 },
-    {  -6,  93 }, {  -6,  84 }, {  -8,  79 }, {   0,  66 },
-    {  -1,  71 }, {   0,  62 }, {  -2,  60 }, {  -2,  59 },
-    {  -5,  75 }, {  -3,  62 }, {  -4,  58 }, {  -9,  66 },
-    {  -1,  79 }, {   0,  71 }, {   3,  68 }, {  10,  44 },
-    {  -7,  62 }, {  15,  36 }, {  14,  40 }, {  16,  27 },
-    {  12,  29 }, {   1,  44 }, {  20,  36 }, {  18,  32 },
-    {   5,  42 }, {   1,  48 }, {  10,  62 }, {  17,  46 },
-    {   9,  64 }, { -12, 104 }, { -11,  97 }, { -16,  96 },
-    {  -7,  88 }, {  -8,  85 }, {  -7,  85 }, {  -9,  85 },
-    { -13,  88 }, {   4,  66 }, {  -3,  77 }, {  -3,  76 },
-    {  -6,  76 }, {  10,  58 }, {  -1,  76 }, {  -1,  83 },
-    {  15,   6 }, {   6,  19 }, {   7,  16 }, {  12,  14 },
-    {  18,  13 }, {  13,  11 }, {  13,  15 }, {  15,  16 },
-    {  12,  23 }, {  13,  23 }, {  15,  20 }, {  14,  26 },
-    {  14,  44 }, {  17,  40 }, {  17,  47 }, {  24,  17 },
-    {  21,  21 }, {  25,  22 }, {  31,  27 }, {  22,  29 },
-    {  19,  35 }, {  14,  50 }, {  10,  57 }, {   7,  63 },
-    {  -2,  77 }, {  -4,  82 }, {  -3,  94 }, {   9,  69 },
-    { -12, 109 }, {  36, -35 }, {  36, -34 }, {  32, -26 },
-    {  37, -30 }, {  44, -32 }, {  34, -18 }, {  34, -15 },
-    {  40, -15 }, {  33,  -7 }, {  35,  -5 }, {  33,   0 },
-    {  38,   2 }, {  33,  13 }, {  23,  35 }, {  13,  58 },
-    {  15,   6 }, {   6,  19 }, {   7,  16 }, {  12,  14 },
-    {  18,  13 }, {  13,  11 }, {  13,  15 }, {  15,  16 },
-    {  12,  23 }, {  13,  23 }, {  15,  20 }, {  14,  26 },
-    {  14,  44 }, {  17,  40 }, {  17,  47 }, {  24,  17 },
-    {  21,  21 }, {  25,  22 }, {  31,  27 }, {  22,  29 },
-    {  19,  35 }, {  14,  50 }, {  10,  57 }, {   7,  63 },
-    {  -2,  77 }, {  -4,  82 }, {  -3,  94 }, {   9,  69 },
-    { -12, 109 }, {  36, -35 }, {  36, -34 }, {  32, -26 },
-    {  37, -30 }, {  44, -32 }, {  34, -18 }, {  34, -15 },
-    {  40, -15 }, {  33,  -7 }, {  35,  -5 }, {  33,   0 },
-    {  38,   2 }, {  33,  13 }, {  23,  35 }, {  13,  58 },
-    {  -3,  71 }, {  -6,  42 }, {  -5,  50 }, {  -3,  54 },
-    {  -2,  62 }, {   0,  58 }, {   1,  63 }, {  -2,  72 },
-    {  -1,  74 }, {  -9,  91 }, {  -5,  67 }, {  -5,  27 },
-    {  -3,  39 }, {  -2,  44 }, {   0,  46 }, { -16,  64 },
-    {  -8,  68 }, { -10,  78 }, {  -6,  77 }, { -10,  86 },
-    { -12,  92 }, { -15,  55 }, { -10,  60 }, {  -6,  62 },
-    {  -4,  65 }, { -12,  73 }, {  -8,  76 }, {  -7,  80 },
-    {  -9,  88 }, { -17, 110 }, {  -3,  71 }, {  -6,  42 },
-    {  -5,  50 }, {  -3,  54 }, {  -2,  62 }, {   0,  58 },
-    {   1,  63 }, {  -2,  72 }, {  -1,  74 }, {  -9,  91 },
-    {  -5,  67 }, {  -5,  27 }, {  -3,  39 }, {  -2,  44 },
-    {   0,  46 }, { -16,  64 }, {  -8,  68 }, { -10,  78 },
-    {  -6,  77 }, { -10,  86 }, { -12,  92 }, { -15,  55 },
-    { -10,  60 }, {  -6,  62 }, {  -4,  65 }, { -12,  73 },
-    {  -8,  76 }, {  -7,  80 }, {  -9,  88 }, { -17, 110 },
-    {  -3,  70 }, {  -8,  93 }, { -10,  90 }, { -30, 127 },
-    {  -3,  70 }, {  -8,  93 }, { -10,  90 }, { -30, 127 },
-    {  -3,  70 }, {  -8,  93 }, { -10,  90 }, { -30, 127 }
-};
-
-static const int8_t cabac_context_init_PB[3][1024][2] =
-{
-    /* i_cabac_init_idc == 0 */
-    {
-        /* 0 - 10 */
-        {  20, -15 }, {   2,  54 }, {   3,  74 }, {  20, -15 },
-        {   2,  54 }, {   3,  74 }, { -28, 127 }, { -23, 104 },
-        {  -6,  53 }, {  -1,  54 }, {   7,  51 },
-
-        /* 11 - 23 */
-        {  23,  33 }, {  23,   2 }, {  21,   0 }, {   1,   9 },
-        {   0,  49 }, { -37, 118 }, {   5,  57 }, { -13,  78 },
-        { -11,  65 }, {   1,  62 }, {  12,  49 }, {  -4,  73 },
-        {  17,  50 },
-
-        /* 24 - 39 */
-        {  18,  64 }, {   9,  43 }, {  29,   0 }, {  26,  67 },
-        {  16,  90 }, {   9, 104 }, { -46, 127 }, { -20, 104 },
-        {   1,  67 }, { -13,  78 }, { -11,  65 }, {   1,  62 },
-        {  -6,  86 }, { -17,  95 }, {  -6,  61 }, {   9,  45 },
-
-        /* 40 - 53 */
-        {  -3,  69 }, {  -6,  81 }, { -11,  96 }, {   6,  55 },
-        {   7,  67 }, {  -5,  86 }, {   2,  88 }, {   0,  58 },
-        {  -3,  76 }, { -10,  94 }, {   5,  54 }, {   4,  69 },
-        {  -3,  81 }, {   0,  88 },
-
-        /* 54 - 59 */
-        {  -7,  67 }, {  -5,  74 }, {  -4,  74 }, {  -5,  80 },
-        {  -7,  72 }, {   1,  58 },
-
-        /* 60 - 69 */
-        {   0,  41 }, {   0,  63 }, {   0,  63 }, { 0, 63 },
-        {  -9,  83 }, {   4,  86 }, {   0,  97 }, { -7, 72 },
-        {  13,  41 }, {   3,  62 },
-
-        /* 70 - 87 */
-        {   0,  45 }, {  -4,  78 }, {  -3,  96 }, { -27,  126 },
-        { -28,  98 }, { -25, 101 }, { -23,  67 }, { -28,  82 },
-        { -20,  94 }, { -16,  83 }, { -22, 110 }, { -21,  91 },
-        { -18, 102 }, { -13,  93 }, { -29, 127 }, {  -7,  92 },
-        {  -5,  89 }, {  -7,  96 }, { -13, 108 }, {  -3,  46 },
-        {  -1,  65 }, {  -1,  57 }, {  -9,  93 }, {  -3,  74 },
-        {  -9,  92 }, {  -8,  87 }, { -23, 126 }, {   5,  54 },
-        {   6,  60 }, {   6,  59 }, {   6,  69 }, {  -1,  48 },
-        {   0,  68 }, {  -4,  69 }, {  -8,  88 },
-
-        /* 105 -> 165 */
-        {  -2,  85 }, {  -6,  78 }, {  -1,  75 }, {  -7,  77 },
-        {   2,  54 }, {   5,  50 }, {  -3,  68 }, {   1,  50 },
-        {   6,  42 }, {  -4,  81 }, {   1,  63 }, {  -4,  70 },
-        {   0,  67 }, {   2,  57 }, {  -2,  76 }, {  11,  35 },
-        {   4,  64 }, {   1,  61 }, {  11,  35 }, {  18,  25 },
-        {  12,  24 }, {  13,  29 }, {  13,  36 }, { -10,  93 },
-        {  -7,  73 }, {  -2,  73 }, {  13,  46 }, {   9,  49 },
-        {  -7, 100 }, {   9,  53 }, {   2,  53 }, {   5,  53 },
-        {  -2,  61 }, {   0,  56 }, {   0,  56 }, { -13,  63 },
-        {  -5,  60 }, {  -1,  62 }, {   4,  57 }, {  -6,  69 },
-        {   4,  57 }, {  14,  39 }, {   4,  51 }, {  13,  68 },
-        {   3,  64 }, {   1,  61 }, {   9,  63 }, {   7,  50 },
-        {  16,  39 }, {   5,  44 }, {   4,  52 }, {  11,  48 },
-        {  -5,  60 }, {  -1,  59 }, {   0,  59 }, {  22,  33 },
-        {   5,  44 }, {  14,  43 }, {  -1,  78 }, {   0,  60 },
-        {   9,  69 },
-
-        /* 166 - 226 */
-        {  11,  28 }, {   2,  40 }, {   3,  44 }, {   0,  49 },
-        {   0,  46 }, {   2,  44 }, {   2,  51 }, {   0,  47 },
-        {   4,  39 }, {   2,  62 }, {   6,  46 }, {   0,  54 },
-        {   3,  54 }, {   2,  58 }, {   4,  63 }, {   6,  51 },
-        {   6,  57 }, {   7,  53 }, {   6,  52 }, {   6,  55 },
-        {  11,  45 }, {  14,  36 }, {   8,  53 }, {  -1,  82 },
-        {   7,  55 }, {  -3,  78 }, {  15,  46 }, {  22,  31 },
-        {  -1,  84 }, {  25,   7 }, {  30,  -7 }, {  28,   3 },
-        {  28,   4 }, {  32,   0 }, {  34,  -1 }, {  30,   6 },
-        {  30,   6 }, {  32,   9 }, {  31,  19 }, {  26,  27 },
-        {  26,  30 }, {  37,  20 }, {  28,  34 }, {  17,  70 },
-        {   1,  67 }, {   5,  59 }, {   9,  67 }, {  16,  30 },
-        {  18,  32 }, {  18,  35 }, {  22,  29 }, {  24,  31 },
-        {  23,  38 }, {  18,  43 }, {  20,  41 }, {  11,  63 },
-        {   9,  59 }, {   9,  64 }, {  -1,  94 }, {  -2,  89 },
-        {  -9, 108 },
-
-        /* 227 - 275 */
-        {  -6,  76 }, {  -2,  44 }, {   0,  45 }, {   0,  52 },
-        {  -3,  64 }, {  -2,  59 }, {  -4,  70 }, {  -4,  75 },
-        {  -8,  82 }, { -17, 102 }, {  -9,  77 }, {   3,  24 },
-        {   0,  42 }, {   0,  48 }, {   0,  55 }, {  -6,  59 },
-        {  -7,  71 }, { -12,  83 }, { -11,  87 }, { -30, 119 },
-        {   1,  58 }, {  -3,  29 }, {  -1,  36 }, {   1,  38 },
-        {   2,  43 }, {  -6,  55 }, {   0,  58 }, {   0,  64 },
-        {  -3,  74 }, { -10,  90 }, {   0,  70 }, {  -4,  29 },
-        {   5,  31 }, {   7,  42 }, {   1,  59 }, {  -2,  58 },
-        {  -3,  72 }, {  -3,  81 }, { -11,  97 }, {   0,  58 },
-        {   8,   5 }, {  10,  14 }, {  14,  18 }, {  13,  27 },
-        {   2,  40 }, {   0,  58 }, {  -3,  70 }, {  -6,  79 },
-        {  -8,  85 },
-
-        /* 276 a bit special (not used, bypass is used instead) */
-        { 0, 0 },
-
-        /* 277 - 337 */
-        { -13, 106 }, { -16, 106 }, { -10,  87 }, { -21, 114 },
-        { -18, 110 }, { -14,  98 }, { -22, 110 }, { -21, 106 },
-        { -18, 103 }, { -21, 107 }, { -23, 108 }, { -26, 112 },
-        { -10,  96 }, { -12,  95 }, {  -5,  91 }, {  -9,  93 },
-        { -22,  94 }, {  -5,  86 }, {   9,  67 }, {  -4,  80 },
-        { -10,  85 }, {  -1,  70 }, {   7,  60 }, {   9,  58 },
-        {   5,  61 }, {  12,  50 }, {  15,  50 }, {  18,  49 },
-        {  17,  54 }, {  10,  41 }, {   7,  46 }, {  -1,  51 },
-        {   7,  49 }, {   8,  52 }, {   9,  41 }, {   6,  47 },
-        {   2,  55 }, {  13,  41 }, {  10,  44 }, {   6,  50 },
-        {   5,  53 }, {  13,  49 }, {   4,  63 }, {   6,  64 },
-        {  -2,  69 }, {  -2,  59 }, {   6,  70 }, {  10,  44 },
-        {   9,  31 }, {  12,  43 }, {   3,  53 }, {  14,  34 },
-        {  10,  38 }, {  -3,  52 }, {  13,  40 }, {  17,  32 },
-        {   7,  44 }, {   7,  38 }, {  13,  50 }, {  10,  57 },
-        {  26,  43 },
-
-        /* 338 - 398 */
-        {  14,  11 }, {  11,  14 }, {   9,  11 }, {  18,  11 },
-        {  21,   9 }, {  23,  -2 }, {  32, -15 }, {  32, -15 },
-        {  34, -21 }, {  39, -23 }, {  42, -33 }, {  41, -31 },
-        {  46, -28 }, {  38, -12 }, {  21,  29 }, {  45, -24 },
-        {  53, -45 }, {  48, -26 }, {  65, -43 }, {  43, -19 },
-        {  39, -10 }, {  30,   9 }, {  18,  26 }, {  20,  27 },
-        {   0,  57 }, { -14,  82 }, {  -5,  75 }, { -19,  97 },
-        { -35, 125 }, {  27,   0 }, {  28,   0 }, {  31,  -4 },
-        {  27,   6 }, {  34,   8 }, {  30,  10 }, {  24,  22 },
-        {  33,  19 }, {  22,  32 }, {  26,  31 }, {  21,  41 },
-        {  26,  44 }, {  23,  47 }, {  16,  65 }, {  14,  71 },
-        {   8,  60 }, {   6,  63 }, {  17,  65 }, {  21,  24 },
-        {  23,  20 }, {  26,  23 }, {  27,  32 }, {  28,  23 },
-        {  28,  24 }, {  23,  40 }, {  24,  32 }, {  28,  29 },
-        {  23,  42 }, {  19,  57 }, {  22,  53 }, {  22,  61 },
-        {  11,  86 },
-
-        /* 399 - 435 */
-        {  12,  40 }, {  11,  51 }, {  14,  59 },
-        {  -4,  79 }, {  -7,  71 }, {  -5,  69 }, {  -9,  70 },
-        {  -8,  66 }, { -10,  68 }, { -19,  73 }, { -12,  69 },
-        { -16,  70 }, { -15,  67 }, { -20,  62 }, { -19,  70 },
-        { -16,  66 }, { -22,  65 }, { -20,  63 }, {   9,  -2 },
-        {  26,  -9 }, {  33,  -9 }, {  39,  -7 }, {  41,  -2 },
-        {  45,   3 }, {  49,   9 }, {  45,  27 }, {  36,  59 },
-        {  -6,  66 }, {  -7,  35 }, {  -7,  42 }, {  -8,  45 },
-        {  -5,  48 }, { -12,  56 }, {  -6,  60 }, {  -5,  62 },
-        {  -8,  66 }, {  -8,  76 },
-
-        /* 436 - 459 */
-        {  -5,  85 }, {  -6,  81 }, { -10,  77 }, {  -7,  81 },
-        { -17,  80 }, { -18,  73 }, {  -4,  74 }, { -10,  83 },
-        {  -9,  71 }, {  -9,  67 }, {  -1,  61 }, {  -8,  66 },
-        { -14,  66 }, {   0,  59 }, {   2,  59 }, {  21, -13 },
-        {  33, -14 }, {  39,  -7 }, {  46,  -2 }, {  51,   2 },
-        {  60,   6 }, {  61,  17 }, {  55,  34 }, {  42,  62 },
-
-        /* 460 - 1024 */
-        {  -7,  92 }, {  -5,  89 }, {  -7,  96 }, { -13, 108 },
-        {  -3,  46 }, {  -1,  65 }, {  -1,  57 }, {  -9,  93 },
-        {  -3,  74 }, {  -9,  92 }, {  -8,  87 }, { -23, 126 },
-        {  -7,  92 }, {  -5,  89 }, {  -7,  96 }, { -13, 108 },
-        {  -3,  46 }, {  -1,  65 }, {  -1,  57 }, {  -9,  93 },
-        {  -3,  74 }, {  -9,  92 }, {  -8,  87 }, { -23, 126 },
-        {  -2,  85 }, {  -6,  78 }, {  -1,  75 }, {  -7,  77 },
-        {   2,  54 }, {   5,  50 }, {  -3,  68 }, {   1,  50 },
-        {   6,  42 }, {  -4,  81 }, {   1,  63 }, {  -4,  70 },
-        {   0,  67 }, {   2,  57 }, {  -2,  76 }, {  11,  35 },
-        {   4,  64 }, {   1,  61 }, {  11,  35 }, {  18,  25 },
-        {  12,  24 }, {  13,  29 }, {  13,  36 }, { -10,  93 },
-        {  -7,  73 }, {  -2,  73 }, {  13,  46 }, {   9,  49 },
-        {  -7, 100 }, {   9,  53 }, {   2,  53 }, {   5,  53 },
-        {  -2,  61 }, {   0,  56 }, {   0,  56 }, { -13,  63 },
-        {  -5,  60 }, {  -1,  62 }, {   4,  57 }, {  -6,  69 },
-        {   4,  57 }, {  14,  39 }, {   4,  51 }, {  13,  68 },
-        {  -2,  85 }, {  -6,  78 }, {  -1,  75 }, {  -7,  77 },
-        {   2,  54 }, {   5,  50 }, {  -3,  68 }, {   1,  50 },
-        {   6,  42 }, {  -4,  81 }, {   1,  63 }, {  -4,  70 },
-        {   0,  67 }, {   2,  57 }, {  -2,  76 }, {  11,  35 },
-        {   4,  64 }, {   1,  61 }, {  11,  35 }, {  18,  25 },
-        {  12,  24 }, {  13,  29 }, {  13,  36 }, { -10,  93 },
-        {  -7,  73 }, {  -2,  73 }, {  13,  46 }, {   9,  49 },
-        {  -7, 100 }, {   9,  53 }, {   2,  53 }, {   5,  53 },
-        {  -2,  61 }, {   0,  56 }, {   0,  56 }, { -13,  63 },
-        {  -5,  60 }, {  -1,  62 }, {   4,  57 }, {  -6,  69 },
-        {   4,  57 }, {  14,  39 }, {   4,  51 }, {  13,  68 },
-        {  11,  28 }, {   2,  40 }, {   3,  44 }, {   0,  49 },
-        {   0,  46 }, {   2,  44 }, {   2,  51 }, {   0,  47 },
-        {   4,  39 }, {   2,  62 }, {   6,  46 }, {   0,  54 },
-        {   3,  54 }, {   2,  58 }, {   4,  63 }, {   6,  51 },
-        {   6,  57 }, {   7,  53 }, {   6,  52 }, {   6,  55 },
-        {  11,  45 }, {  14,  36 }, {   8,  53 }, {  -1,  82 },
-        {   7,  55 }, {  -3,  78 }, {  15,  46 }, {  22,  31 },
-        {  -1,  84 }, {  25,   7 }, {  30,  -7 }, {  28,   3 },
-        {  28,   4 }, {  32,   0 }, {  34,  -1 }, {  30,   6 },
-        {  30,   6 }, {  32,   9 }, {  31,  19 }, {  26,  27 },
-        {  26,  30 }, {  37,  20 }, {  28,  34 }, {  17,  70 },
-        {  11,  28 }, {   2,  40 }, {   3,  44 }, {   0,  49 },
-        {   0,  46 }, {   2,  44 }, {   2,  51 }, {   0,  47 },
-        {   4,  39 }, {   2,  62 }, {   6,  46 }, {   0,  54 },
-        {   3,  54 }, {   2,  58 }, {   4,  63 }, {   6,  51 },
-        {   6,  57 }, {   7,  53 }, {   6,  52 }, {   6,  55 },
-        {  11,  45 }, {  14,  36 }, {   8,  53 }, {  -1,  82 },
-        {   7,  55 }, {  -3,  78 }, {  15,  46 }, {  22,  31 },
-        {  -1,  84 }, {  25,   7 }, {  30,  -7 }, {  28,   3 },
-        {  28,   4 }, {  32,   0 }, {  34,  -1 }, {  30,   6 },
-        {  30,   6 }, {  32,   9 }, {  31,  19 }, {  26,  27 },
-        {  26,  30 }, {  37,  20 }, {  28,  34 }, {  17,  70 },
-        {  -4,  79 }, {  -7,  71 }, {  -5,  69 }, {  -9,  70 },
-        {  -8,  66 }, { -10,  68 }, { -19,  73 }, { -12,  69 },
-        { -16,  70 }, { -15,  67 }, { -20,  62 }, { -19,  70 },
-        { -16,  66 }, { -22,  65 }, { -20,  63 }, {  -5,  85 },
-        {  -6,  81 }, { -10,  77 }, {  -7,  81 }, { -17,  80 },
-        { -18,  73 }, {  -4,  74 }, { -10,  83 }, {  -9,  71 },
-        {  -9,  67 }, {  -1,  61 }, {  -8,  66 }, { -14,  66 },
-        {   0,  59 }, {   2,  59 }, {   9,  -2 }, {  26,  -9 },
-        {  33,  -9 }, {  39,  -7 }, {  41,  -2 }, {  45,   3 },
-        {  49,   9 }, {  45,  27 }, {  36,  59 }, {  21, -13 },
-        {  33, -14 }, {  39,  -7 }, {  46,  -2 }, {  51,   2 },
-        {  60,   6 }, {  61,  17 }, {  55,  34 }, {  42,  62 },
-        {  -6,  66 }, {  -7,  35 }, {  -7,  42 }, {  -8,  45 },
-        {  -5,  48 }, { -12,  56 }, {  -6,  60 }, {  -5,  62 },
-        {  -8,  66 }, {  -8,  76 }, {  -4,  79 }, {  -7,  71 },
-        {  -5,  69 }, {  -9,  70 }, {  -8,  66 }, { -10,  68 },
-        { -19,  73 }, { -12,  69 }, { -16,  70 }, { -15,  67 },
-        { -20,  62 }, { -19,  70 }, { -16,  66 }, { -22,  65 },
-        { -20,  63 }, {  -5,  85 }, {  -6,  81 }, { -10,  77 },
-        {  -7,  81 }, { -17,  80 }, { -18,  73 }, {  -4,  74 },
-        { -10,  83 }, {  -9,  71 }, {  -9,  67 }, {  -1,  61 },
-        {  -8,  66 }, { -14,  66 }, {   0,  59 }, {   2,  59 },
-        {   9,  -2 }, {  26,  -9 }, {  33,  -9 }, {  39,  -7 },
-        {  41,  -2 }, {  45,   3 }, {  49,   9 }, {  45,  27 },
-        {  36,  59 }, {  21, -13 }, {  33, -14 }, {  39,  -7 },
-        {  46,  -2 }, {  51,   2 }, {  60,   6 }, {  61,  17 },
-        {  55,  34 }, {  42,  62 }, {  -6,  66 }, {  -7,  35 },
-        {  -7,  42 }, {  -8,  45 }, {  -5,  48 }, { -12,  56 },
-        {  -6,  60 }, {  -5,  62 }, {  -8,  66 }, {  -8,  76 },
-        { -13, 106 }, { -16, 106 }, { -10,  87 }, { -21, 114 },
-        { -18, 110 }, { -14,  98 }, { -22, 110 }, { -21, 106 },
-        { -18, 103 }, { -21, 107 }, { -23, 108 }, { -26, 112 },
-        { -10,  96 }, { -12,  95 }, {  -5,  91 }, {  -9,  93 },
-        { -22,  94 }, {  -5,  86 }, {   9,  67 }, {  -4,  80 },
-        { -10,  85 }, {  -1,  70 }, {   7,  60 }, {   9,  58 },
-        {   5,  61 }, {  12,  50 }, {  15,  50 }, {  18,  49 },
-        {  17,  54 }, {  10,  41 }, {   7,  46 }, {  -1,  51 },
-        {   7,  49 }, {   8,  52 }, {   9,  41 }, {   6,  47 },
-        {   2,  55 }, {  13,  41 }, {  10,  44 }, {   6,  50 },
-        {   5,  53 }, {  13,  49 }, {   4,  63 }, {   6,  64 },
-        { -13, 106 }, { -16, 106 }, { -10,  87 }, { -21, 114 },
-        { -18, 110 }, { -14,  98 }, { -22, 110 }, { -21, 106 },
-        { -18, 103 }, { -21, 107 }, { -23, 108 }, { -26, 112 },
-        { -10,  96 }, { -12,  95 }, {  -5,  91 }, {  -9,  93 },
-        { -22,  94 }, {  -5,  86 }, {   9,  67 }, {  -4,  80 },
-        { -10,  85 }, {  -1,  70 }, {   7,  60 }, {   9,  58 },
-        {   5,  61 }, {  12,  50 }, {  15,  50 }, {  18,  49 },
-        {  17,  54 }, {  10,  41 }, {   7,  46 }, {  -1,  51 },
-        {   7,  49 }, {   8,  52 }, {   9,  41 }, {   6,  47 },
-        {   2,  55 }, {  13,  41 }, {  10,  44 }, {   6,  50 },
-        {   5,  53 }, {  13,  49 }, {   4,  63 }, {   6,  64 },
-        {  14,  11 }, {  11,  14 }, {   9,  11 }, {  18,  11 },
-        {  21,   9 }, {  23,  -2 }, {  32, -15 }, {  32, -15 },
-        {  34, -21 }, {  39, -23 }, {  42, -33 }, {  41, -31 },
-        {  46, -28 }, {  38, -12 }, {  21,  29 }, {  45, -24 },
-        {  53, -45 }, {  48, -26 }, {  65, -43 }, {  43, -19 },
-        {  39, -10 }, {  30,   9 }, {  18,  26 }, {  20,  27 },
-        {   0,  57 }, { -14,  82 }, {  -5,  75 }, { -19,  97 },
-        { -35, 125 }, {  27,   0 }, {  28,   0 }, {  31,  -4 },
-        {  27,   6 }, {  34,   8 }, {  30,  10 }, {  24,  22 },
-        {  33,  19 }, {  22,  32 }, {  26,  31 }, {  21,  41 },
-        {  26,  44 }, {  23,  47 }, {  16,  65 }, {  14,  71 },
-        {  14,  11 }, {  11,  14 }, {   9,  11 }, {  18,  11 },
-        {  21,   9 }, {  23,  -2 }, {  32, -15 }, {  32, -15 },
-        {  34, -21 }, {  39, -23 }, {  42, -33 }, {  41, -31 },
-        {  46, -28 }, {  38, -12 }, {  21,  29 }, {  45, -24 },
-        {  53, -45 }, {  48, -26 }, {  65, -43 }, {  43, -19 },
-        {  39, -10 }, {  30,   9 }, {  18,  26 }, {  20,  27 },
-        {   0,  57 }, { -14,  82 }, {  -5,  75 }, { -19,  97 },
-        { -35, 125 }, {  27,   0 }, {  28,   0 }, {  31,  -4 },
-        {  27,   6 }, {  34,   8 }, {  30,  10 }, {  24,  22 },
-        {  33,  19 }, {  22,  32 }, {  26,  31 }, {  21,  41 },
-        {  26,  44 }, {  23,  47 }, {  16,  65 }, {  14,  71 },
-        {  -6,  76 }, {  -2,  44 }, {   0,  45 }, {   0,  52 },
-        {  -3,  64 }, {  -2,  59 }, {  -4,  70 }, {  -4,  75 },
-        {  -8,  82 }, { -17, 102 }, {  -9,  77 }, {   3,  24 },
-        {   0,  42 }, {   0,  48 }, {   0,  55 }, {  -6,  59 },
-        {  -7,  71 }, { -12,  83 }, { -11,  87 }, { -30, 119 },
-        {   1,  58 }, {  -3,  29 }, {  -1,  36 }, {   1,  38 },
-        {   2,  43 }, {  -6,  55 }, {   0,  58 }, {   0,  64 },
-        {  -3,  74 }, { -10,  90 }, {  -6,  76 }, {  -2,  44 },
-        {   0,  45 }, {   0,  52 }, {  -3,  64 }, {  -2,  59 },
-        {  -4,  70 }, {  -4,  75 }, {  -8,  82 }, { -17, 102 },
-        {  -9,  77 }, {   3,  24 }, {   0,  42 }, {   0,  48 },
-        {   0,  55 }, {  -6,  59 }, {  -7,  71 }, { -12,  83 },
-        { -11,  87 }, { -30, 119 }, {   1,  58 }, {  -3,  29 },
-        {  -1,  36 }, {   1,  38 }, {   2,  43 }, {  -6,  55 },
-        {   0,  58 }, {   0,  64 }, {  -3,  74 }, { -10,  90 },
-        {  -3,  74 }, {  -9,  92 }, {  -8,  87 }, { -23, 126 },
-        {  -3,  74 }, {  -9,  92 }, {  -8,  87 }, { -23, 126 },
-        {  -3,  74 }, {  -9,  92 }, {  -8,  87 }, { -23, 126 }
-    },
-
-    /* i_cabac_init_idc == 1 */
-    {
-        /* 0 - 10 */
-        {  20, -15 }, {   2,  54 }, {   3,  74 }, {  20, -15 },
-        {   2,  54 }, {   3,  74 }, { -28, 127 }, { -23, 104 },
-        {  -6,  53 }, {  -1,  54 }, {   7,  51 },
-
-        /* 11 - 23 */
-        {  22,  25 }, {  34,   0 }, {  16,   0 }, {  -2,   9 },
-        {   4,  41 }, { -29, 118 }, {   2,  65 }, {  -6,  71 },
-        { -13,  79 }, {   5,  52 }, {   9,  50 }, {  -3,  70 },
-        {  10,  54 },
-
-        /* 24 - 39 */
-        {  26,  34 }, {  19,  22 }, {  40,   0 }, {  57,   2 },
-        {  41,  36 }, {  26,  69 }, { -45, 127 }, { -15, 101 },
-        {  -4,  76 }, {  -6,  71 }, { -13,  79 }, {   5,  52 },
-        {   6,  69 }, { -13,  90 }, {   0,  52 }, {   8,  43 },
-
-        /* 40 - 53 */
-        {  -2,  69 },{  -5,  82 },{ -10,  96 },{   2,  59 },
-        {   2,  75 },{  -3,  87 },{  -3,  100 },{   1,  56 },
-        {  -3,  74 },{  -6,  85 },{   0,  59 },{  -3,  81 },
-        {  -7,  86 },{  -5,  95 },
-
-        /* 54 - 59 */
-        {  -1,  66 },{  -1,  77 },{   1,  70 },{  -2,  86 },
-        {  -5,  72 },{   0,  61 },
-
-        /* 60 - 69 */
-        { 0, 41 },   { 0, 63 },   { 0, 63 },     { 0, 63 },
-        { -9, 83 },  { 4, 86 },   { 0, 97 },     { -7, 72 },
-        { 13, 41 },  { 3, 62 },
-
-        /* 70 - 104 */
-        {  13,  15 }, {   7,  51 }, {   2,  80 }, { -39, 127 },
-        { -18,  91 }, { -17,  96 }, { -26,  81 }, { -35,  98 },
-        { -24, 102 }, { -23,  97 }, { -27, 119 }, { -24,  99 },
-        { -21, 110 }, { -18, 102 }, { -36, 127 }, {   0,  80 },
-        {  -5,  89 }, {  -7,  94 }, {  -4,  92 }, {   0,  39 },
-        {   0,  65 }, { -15,  84 }, { -35, 127 }, {  -2,  73 },
-        { -12, 104 }, {  -9,  91 }, { -31, 127 }, {   3,  55 },
-        {   7,  56 }, {   7,  55 }, {   8,  61 }, {  -3,  53 },
-        {   0,  68 }, {  -7,  74 }, {  -9,  88 },
-
-        /* 105 -> 165 */
-        { -13, 103 }, { -13,  91 }, {  -9,  89 }, { -14,  92 },
-        {  -8,  76 }, { -12,  87 }, { -23, 110 }, { -24, 105 },
-        { -10,  78 }, { -20, 112 }, { -17,  99 }, { -78, 127 },
-        { -70, 127 }, { -50, 127 }, { -46, 127 }, {  -4,  66 },
-        {  -5,  78 }, {  -4,  71 }, {  -8,  72 }, {   2,  59 },
-        {  -1,  55 }, {  -7,  70 }, {  -6,  75 }, {  -8,  89 },
-        { -34, 119 }, {  -3,  75 }, {  32,  20 }, {  30,  22 },
-        { -44, 127 }, {   0,  54 }, {  -5,  61 }, {   0,  58 },
-        {  -1,  60 }, {  -3,  61 }, {  -8,  67 }, { -25,  84 },
-        { -14,  74 }, {  -5,  65 }, {   5,  52 }, {   2,  57 },
-        {   0,  61 }, {  -9,  69 }, { -11,  70 }, {  18,  55 },
-        {  -4,  71 }, {   0,  58 }, {   7,  61 }, {   9,  41 },
-        {  18,  25 }, {   9,  32 }, {   5,  43 }, {   9,  47 },
-        {   0,  44 }, {   0,  51 }, {   2,  46 }, {  19,  38 },
-        {  -4,  66 }, {  15,  38 }, {  12,  42 }, {   9,  34 },
-        {   0,  89 },
-
-        /* 166 - 226 */
-        {   4,  45 }, {  10,  28 }, {  10,  31 }, {  33, -11 },
-        {  52, -43 }, {  18,  15 }, {  28,   0 }, {  35, -22 },
-        {  38, -25 }, {  34,   0 }, {  39, -18 }, {  32, -12 },
-        { 102, -94 }, {   0,   0 }, {  56, -15 }, {  33,  -4 },
-        {  29,  10 }, {  37,  -5 }, {  51, -29 }, {  39,  -9 },
-        {  52, -34 }, {  69, -58 }, {  67, -63 }, {  44,  -5 },
-        {  32,   7 }, {  55, -29 }, {  32,   1 }, {   0,   0 },
-        {  27,  36 }, {  33, -25 }, {  34, -30 }, {  36, -28 },
-        {  38, -28 }, {  38, -27 }, {  34, -18 }, {  35, -16 },
-        {  34, -14 }, {  32,  -8 }, {  37,  -6 }, {  35,   0 },
-        {  30,  10 }, {  28,  18 }, {  26,  25 }, {  29,  41 },
-        {   0,  75 }, {   2,  72 }, {   8,  77 }, {  14,  35 },
-        {  18,  31 }, {  17,  35 }, {  21,  30 }, {  17,  45 },
-        {  20,  42 }, {  18,  45 }, {  27,  26 }, {  16,  54 },
-        {   7,  66 }, {  16,  56 }, {  11,  73 }, {  10,  67 },
-        { -10, 116 },
-
-        /* 227 - 275 */
-        { -23, 112 }, { -15,  71 }, {  -7,  61 }, {   0,  53 },
-        {  -5,  66 }, { -11,  77 }, {  -9,  80 }, {  -9,  84 },
-        { -10,  87 }, { -34, 127 }, { -21, 101 }, {  -3,  39 },
-        {  -5,  53 }, {  -7,  61 }, { -11,  75 }, { -15,  77 },
-        { -17,  91 }, { -25, 107 }, { -25, 111 }, { -28, 122 },
-        { -11,  76 }, { -10,  44 }, { -10,  52 }, { -10,  57 },
-        {  -9,  58 }, { -16,  72 }, {  -7,  69 }, {  -4,  69 },
-        {  -5,  74 }, {  -9,  86 }, {   2,  66 }, {  -9,  34 },
-        {   1,  32 }, {  11,  31 }, {   5,  52 }, {  -2,  55 },
-        {  -2,  67 }, {   0,  73 }, {  -8,  89 }, {   3,  52 },
-        {   7,   4 }, {  10,   8 }, {  17,   8 }, {  16,  19 },
-        {   3,  37 }, {  -1,  61 }, {  -5,  73 }, {  -1,  70 },
-        {  -4,  78 },
-
-        /* 276 a bit special (not used, bypass is used instead) */
-        { 0, 0 },
-
-        /* 277 - 337 */
-        { -21, 126 }, { -23, 124 }, { -20, 110 }, { -26, 126 },
-        { -25, 124 }, { -17, 105 }, { -27, 121 }, { -27, 117 },
-        { -17, 102 }, { -26, 117 }, { -27, 116 }, { -33, 122 },
-        { -10,  95 }, { -14, 100 }, {  -8,  95 }, { -17, 111 },
-        { -28, 114 }, {  -6,  89 }, {  -2,  80 }, {  -4,  82 },
-        {  -9,  85 }, {  -8,  81 }, {  -1,  72 }, {   5,  64 },
-        {   1,  67 }, {   9,  56 }, {   0,  69 }, {   1,  69 },
-        {   7,  69 }, {  -7,  69 }, {  -6,  67 }, { -16,  77 },
-        {  -2,  64 }, {   2,  61 }, {  -6,  67 }, {  -3,  64 },
-        {   2,  57 }, {  -3,  65 }, {  -3,  66 }, {   0,  62 },
-        {   9,  51 }, {  -1,  66 }, {  -2,  71 }, {  -2,  75 },
-        {  -1,  70 }, {  -9,  72 }, {  14,  60 }, {  16,  37 },
-        {   0,  47 }, {  18,  35 }, {  11,  37 }, {  12,  41 },
-        {  10,  41 }, {   2,  48 }, {  12,  41 }, {  13,  41 },
-        {   0,  59 }, {   3,  50 }, {  19,  40 }, {   3,  66 },
-        {  18,  50 },
-
-        /* 338 - 398 */
-        {  19,  -6 }, {  18,  -6 }, {  14,   0 }, {  26, -12 },
-        {  31, -16 }, {  33, -25 }, {  33, -22 }, {  37, -28 },
-        {  39, -30 }, {  42, -30 }, {  47, -42 }, {  45, -36 },
-        {  49, -34 }, {  41, -17 }, {  32,   9 }, {  69, -71 },
-        {  63, -63 }, {  66, -64 }, {  77, -74 }, {  54, -39 },
-        {  52, -35 }, {  41, -10 }, {  36,   0 }, {  40,  -1 },
-        {  30,  14 }, {  28,  26 }, {  23,  37 }, {  12,  55 },
-        {  11,  65 }, {  37, -33 }, {  39, -36 }, {  40, -37 },
-        {  38, -30 }, {  46, -33 }, {  42, -30 }, {  40, -24 },
-        {  49, -29 }, {  38, -12 }, {  40, -10 }, {  38,  -3 },
-        {  46,  -5 }, {  31,  20 }, {  29,  30 }, {  25,  44 },
-        {  12,  48 }, {  11,  49 }, {  26,  45 }, {  22,  22 },
-        {  23,  22 }, {  27,  21 }, {  33,  20 }, {  26,  28 },
-        {  30,  24 }, {  27,  34 }, {  18,  42 }, {  25,  39 },
-        {  18,  50 }, {  12,  70 }, {  21,  54 }, {  14,  71 },
-        {  11,  83 },
-
-        /* 399 - 435 */
-        {  25,  32 }, {  21,  49 }, {  21,  54 },
-        {  -5,  85 }, {  -6,  81 }, { -10,  77 }, {  -7,  81 },
-        { -17,  80 }, { -18,  73 }, {  -4,  74 }, { -10,  83 },
-        {  -9,  71 }, {  -9,  67 }, {  -1,  61 }, {  -8,  66 },
-        { -14,  66 }, {   0,  59 }, {   2,  59 }, {  17, -10 },
-        {  32, -13 }, {  42,  -9 }, {  49,  -5 }, {  53,   0 },
-        {  64,   3 }, {  68,  10 }, {  66,  27 }, {  47,  57 },
-        {  -5,  71 }, {   0,  24 }, {  -1,  36 }, {  -2,  42 },
-        {  -2,  52 }, {  -9,  57 }, {  -6,  63 }, {  -4,  65 },
-        {  -4,  67 }, {  -7,  82 },
-
-        /* 436 - 459 */
-        {  -3,  81 }, {  -3,  76 }, {  -7,  72 }, {  -6,  78 },
-        { -12,  72 }, { -14,  68 }, {  -3,  70 }, {  -6,  76 },
-        {  -5,  66 }, {  -5,  62 }, {   0,  57 }, {  -4,  61 },
-        {  -9,  60 }, {   1,  54 }, {   2,  58 }, {  17, -10 },
-        {  32, -13 }, {  42,  -9 }, {  49,  -5 }, {  53,   0 },
-        {  64,   3 }, {  68,  10 }, {  66,  27 }, {  47,  57 },
-
-        /* 460 - 1024 */
-        {   0,  80 }, {  -5,  89 }, {  -7,  94 }, {  -4,  92 },
-        {   0,  39 }, {   0,  65 }, { -15,  84 }, { -35, 127 },
-        {  -2,  73 }, { -12, 104 }, {  -9,  91 }, { -31, 127 },
-        {   0,  80 }, {  -5,  89 }, {  -7,  94 }, {  -4,  92 },
-        {   0,  39 }, {   0,  65 }, { -15,  84 }, { -35, 127 },
-        {  -2,  73 }, { -12, 104 }, {  -9,  91 }, { -31, 127 },
-        { -13, 103 }, { -13,  91 }, {  -9,  89 }, { -14,  92 },
-        {  -8,  76 }, { -12,  87 }, { -23, 110 }, { -24, 105 },
-        { -10,  78 }, { -20, 112 }, { -17,  99 }, { -78, 127 },
-        { -70, 127 }, { -50, 127 }, { -46, 127 }, {  -4,  66 },
-        {  -5,  78 }, {  -4,  71 }, {  -8,  72 }, {   2,  59 },
-        {  -1,  55 }, {  -7,  70 }, {  -6,  75 }, {  -8,  89 },
-        { -34, 119 }, {  -3,  75 }, {  32,  20 }, {  30,  22 },
-        { -44, 127 }, {   0,  54 }, {  -5,  61 }, {   0,  58 },
-        {  -1,  60 }, {  -3,  61 }, {  -8,  67 }, { -25,  84 },
-        { -14,  74 }, {  -5,  65 }, {   5,  52 }, {   2,  57 },
-        {   0,  61 }, {  -9,  69 }, { -11,  70 }, {  18,  55 },
-        { -13, 103 }, { -13,  91 }, {  -9,  89 }, { -14,  92 },
-        {  -8,  76 }, { -12,  87 }, { -23, 110 }, { -24, 105 },
-        { -10,  78 }, { -20, 112 }, { -17,  99 }, { -78, 127 },
-        { -70, 127 }, { -50, 127 }, { -46, 127 }, {  -4,  66 },
-        {  -5,  78 }, {  -4,  71 }, {  -8,  72 }, {   2,  59 },
-        {  -1,  55 }, {  -7,  70 }, {  -6,  75 }, {  -8,  89 },
-        { -34, 119 }, {  -3,  75 }, {  32,  20 }, {  30,  22 },
-        { -44, 127 }, {   0,  54 }, {  -5,  61 }, {   0,  58 },
-        {  -1,  60 }, {  -3,  61 }, {  -8,  67 }, { -25,  84 },
-        { -14,  74 }, {  -5,  65 }, {   5,  52 }, {   2,  57 },
-        {   0,  61 }, {  -9,  69 }, { -11,  70 }, {  18,  55 },
-        {   4,  45 }, {  10,  28 }, {  10,  31 }, {  33, -11 },
-        {  52, -43 }, {  18,  15 }, {  28,   0 }, {  35, -22 },
-        {  38, -25 }, {  34,   0 }, {  39, -18 }, {  32, -12 },
-        { 102, -94 }, {   0,   0 }, {  56, -15 }, {  33,  -4 },
-        {  29,  10 }, {  37,  -5 }, {  51, -29 }, {  39,  -9 },
-        {  52, -34 }, {  69, -58 }, {  67, -63 }, {  44,  -5 },
-        {  32,   7 }, {  55, -29 }, {  32,   1 }, {   0,   0 },
-        {  27,  36 }, {  33, -25 }, {  34, -30 }, {  36, -28 },
-        {  38, -28 }, {  38, -27 }, {  34, -18 }, {  35, -16 },
-        {  34, -14 }, {  32,  -8 }, {  37,  -6 }, {  35,   0 },
-        {  30,  10 }, {  28,  18 }, {  26,  25 }, {  29,  41 },
-        {   4,  45 }, {  10,  28 }, {  10,  31 }, {  33, -11 },
-        {  52, -43 }, {  18,  15 }, {  28,   0 }, {  35, -22 },
-        {  38, -25 }, {  34,   0 }, {  39, -18 }, {  32, -12 },
-        { 102, -94 }, {   0,   0 }, {  56, -15 }, {  33,  -4 },
-        {  29,  10 }, {  37,  -5 }, {  51, -29 }, {  39,  -9 },
-        {  52, -34 }, {  69, -58 }, {  67, -63 }, {  44,  -5 },
-        {  32,   7 }, {  55, -29 }, {  32,   1 }, {   0,   0 },
-        {  27,  36 }, {  33, -25 }, {  34, -30 }, {  36, -28 },
-        {  38, -28 }, {  38, -27 }, {  34, -18 }, {  35, -16 },
-        {  34, -14 }, {  32,  -8 }, {  37,  -6 }, {  35,   0 },
-        {  30,  10 }, {  28,  18 }, {  26,  25 }, {  29,  41 },
-        {  -5,  85 }, {  -6,  81 }, { -10,  77 }, {  -7,  81 },
-        { -17,  80 }, { -18,  73 }, {  -4,  74 }, { -10,  83 },
-        {  -9,  71 }, {  -9,  67 }, {  -1,  61 }, {  -8,  66 },
-        { -14,  66 }, {   0,  59 }, {   2,  59 }, {  -3,  81 },
-        {  -3,  76 }, {  -7,  72 }, {  -6,  78 }, { -12,  72 },
-        { -14,  68 }, {  -3,  70 }, {  -6,  76 }, {  -5,  66 },
-        {  -5,  62 }, {   0,  57 }, {  -4,  61 }, {  -9,  60 },
-        {   1,  54 }, {   2,  58 }, {  17, -10 }, {  32, -13 },
-        {  42,  -9 }, {  49,  -5 }, {  53,   0 }, {  64,   3 },
-        {  68,  10 }, {  66,  27 }, {  47,  57 }, {  17, -10 },
-        {  32, -13 }, {  42,  -9 }, {  49,  -5 }, {  53,   0 },
-        {  64,   3 }, {  68,  10 }, {  66,  27 }, {  47,  57 },
-        {  -5,  71 }, {   0,  24 }, {  -1,  36 }, {  -2,  42 },
-        {  -2,  52 }, {  -9,  57 }, {  -6,  63 }, {  -4,  65 },
-        {  -4,  67 }, {  -7,  82 }, {  -5,  85 }, {  -6,  81 },
-        { -10,  77 }, {  -7,  81 }, { -17,  80 }, { -18,  73 },
-        {  -4,  74 }, { -10,  83 }, {  -9,  71 }, {  -9,  67 },
-        {  -1,  61 }, {  -8,  66 }, { -14,  66 }, {   0,  59 },
-        {   2,  59 }, {  -3,  81 }, {  -3,  76 }, {  -7,  72 },
-        {  -6,  78 }, { -12,  72 }, { -14,  68 }, {  -3,  70 },
-        {  -6,  76 }, {  -5,  66 }, {  -5,  62 }, {   0,  57 },
-        {  -4,  61 }, {  -9,  60 }, {   1,  54 }, {   2,  58 },
-        {  17, -10 }, {  32, -13 }, {  42,  -9 }, {  49,  -5 },
-        {  53,   0 }, {  64,   3 }, {  68,  10 }, {  66,  27 },
-        {  47,  57 }, {  17, -10 }, {  32, -13 }, {  42,  -9 },
-        {  49,  -5 }, {  53,   0 }, {  64,   3 }, {  68,  10 },
-        {  66,  27 }, {  47,  57 }, {  -5,  71 }, {   0,  24 },
-        {  -1,  36 }, {  -2,  42 }, {  -2,  52 }, {  -9,  57 },
-        {  -6,  63 }, {  -4,  65 }, {  -4,  67 }, {  -7,  82 },
-        { -21, 126 }, { -23, 124 }, { -20, 110 }, { -26, 126 },
-        { -25, 124 }, { -17, 105 }, { -27, 121 }, { -27, 117 },
-        { -17, 102 }, { -26, 117 }, { -27, 116 }, { -33, 122 },
-        { -10,  95 }, { -14, 100 }, {  -8,  95 }, { -17, 111 },
-        { -28, 114 }, {  -6,  89 }, {  -2,  80 }, {  -4,  82 },
-        {  -9,  85 }, {  -8,  81 }, {  -1,  72 }, {   5,  64 },
-        {   1,  67 }, {   9,  56 }, {   0,  69 }, {   1,  69 },
-        {   7,  69 }, {  -7,  69 }, {  -6,  67 }, { -16,  77 },
-        {  -2,  64 }, {   2,  61 }, {  -6,  67 }, {  -3,  64 },
-        {   2,  57 }, {  -3,  65 }, {  -3,  66 }, {   0,  62 },
-        {   9,  51 }, {  -1,  66 }, {  -2,  71 }, {  -2,  75 },
-        { -21, 126 }, { -23, 124 }, { -20, 110 }, { -26, 126 },
-        { -25, 124 }, { -17, 105 }, { -27, 121 }, { -27, 117 },
-        { -17, 102 }, { -26, 117 }, { -27, 116 }, { -33, 122 },
-        { -10,  95 }, { -14, 100 }, {  -8,  95 }, { -17, 111 },
-        { -28, 114 }, {  -6,  89 }, {  -2,  80 }, {  -4,  82 },
-        {  -9,  85 }, {  -8,  81 }, {  -1,  72 }, {   5,  64 },
-        {   1,  67 }, {   9,  56 }, {   0,  69 }, {   1,  69 },
-        {   7,  69 }, {  -7,  69 }, {  -6,  67 }, { -16,  77 },
-        {  -2,  64 }, {   2,  61 }, {  -6,  67 }, {  -3,  64 },
-        {   2,  57 }, {  -3,  65 }, {  -3,  66 }, {   0,  62 },
-        {   9,  51 }, {  -1,  66 }, {  -2,  71 }, {  -2,  75 },
-        {  19,  -6 }, {  18,  -6 }, {  14,   0 }, {  26, -12 },
-        {  31, -16 }, {  33, -25 }, {  33, -22 }, {  37, -28 },
-        {  39, -30 }, {  42, -30 }, {  47, -42 }, {  45, -36 },
-        {  49, -34 }, {  41, -17 }, {  32,   9 }, {  69, -71 },
-        {  63, -63 }, {  66, -64 }, {  77, -74 }, {  54, -39 },
-        {  52, -35 }, {  41, -10 }, {  36,   0 }, {  40,  -1 },
-        {  30,  14 }, {  28,  26 }, {  23,  37 }, {  12,  55 },
-        {  11,  65 }, {  37, -33 }, {  39, -36 }, {  40, -37 },
-        {  38, -30 }, {  46, -33 }, {  42, -30 }, {  40, -24 },
-        {  49, -29 }, {  38, -12 }, {  40, -10 }, {  38,  -3 },
-        {  46,  -5 }, {  31,  20 }, {  29,  30 }, {  25,  44 },
-        {  19,  -6 }, {  18,  -6 }, {  14,   0 }, {  26, -12 },
-        {  31, -16 }, {  33, -25 }, {  33, -22 }, {  37, -28 },
-        {  39, -30 }, {  42, -30 }, {  47, -42 }, {  45, -36 },
-        {  49, -34 }, {  41, -17 }, {  32,   9 }, {  69, -71 },
-        {  63, -63 }, {  66, -64 }, {  77, -74 }, {  54, -39 },
-        {  52, -35 }, {  41, -10 }, {  36,   0 }, {  40,  -1 },
-        {  30,  14 }, {  28,  26 }, {  23,  37 }, {  12,  55 },
-        {  11,  65 }, {  37, -33 }, {  39, -36 }, {  40, -37 },
-        {  38, -30 }, {  46, -33 }, {  42, -30 }, {  40, -24 },
-        {  49, -29 }, {  38, -12 }, {  40, -10 }, {  38,  -3 },
-        {  46,  -5 }, {  31,  20 }, {  29,  30 }, {  25,  44 },
-        { -23, 112 }, { -15,  71 }, {  -7,  61 }, {   0,  53 },
-        {  -5,  66 }, { -11,  77 }, {  -9,  80 }, {  -9,  84 },
-        { -10,  87 }, { -34, 127 }, { -21, 101 }, {  -3,  39 },
-        {  -5,  53 }, {  -7,  61 }, { -11,  75 }, { -15,  77 },
-        { -17,  91 }, { -25, 107 }, { -25, 111 }, { -28, 122 },
-        { -11,  76 }, { -10,  44 }, { -10,  52 }, { -10,  57 },
-        {  -9,  58 }, { -16,  72 }, {  -7,  69 }, {  -4,  69 },
-        {  -5,  74 }, {  -9,  86 }, { -23, 112 }, { -15,  71 },
-        {  -7,  61 }, {   0,  53 }, {  -5,  66 }, { -11,  77 },
-        {  -9,  80 }, {  -9,  84 }, { -10,  87 }, { -34, 127 },
-        { -21, 101 }, {  -3,  39 }, {  -5,  53 }, {  -7,  61 },
-        { -11,  75 }, { -15,  77 }, { -17,  91 }, { -25, 107 },
-        { -25, 111 }, { -28, 122 }, { -11,  76 }, { -10,  44 },
-        { -10,  52 }, { -10,  57 }, {  -9,  58 }, { -16,  72 },
-        {  -7,  69 }, {  -4,  69 }, {  -5,  74 }, {  -9,  86 },
-        {  -2,  73 }, { -12, 104 }, {  -9,  91 }, { -31, 127 },
-        {  -2,  73 }, { -12, 104 }, {  -9,  91 }, { -31, 127 },
-        {  -2,  73 }, { -12, 104 }, {  -9,  91 }, { -31, 127 }
-    },
-
-    /* i_cabac_init_idc == 2 */
-    {
-        /* 0 - 10 */
-        {  20, -15 }, {   2,  54 }, {   3,  74 }, {  20, -15 },
-        {   2,  54 }, {   3,  74 }, { -28, 127 }, { -23, 104 },
-        {  -6,  53 }, {  -1,  54 }, {   7,  51 },
-
-        /* 11 - 23 */
-        {  29,  16 }, {  25,   0 }, {  14,   0 }, { -10,  51 },
-        {  -3,  62 }, { -27,  99 }, {  26,  16 }, {  -4,  85 },
-        { -24, 102 }, {   5,  57 }, {   6,  57 }, { -17,  73 },
-        {  14,  57 },
-
-        /* 24 - 39 */
-        {  20,  40 }, {  20,  10 }, {  29,   0 }, {  54,   0 },
-        {  37,  42 }, {  12,  97 }, { -32, 127 }, { -22, 117 },
-        {  -2,  74 }, {  -4,  85 }, { -24, 102 }, {   5,  57 },
-        {  -6,  93 }, { -14,  88 }, {  -6,  44 }, {   4,  55 },
-
-        /* 40 - 53 */
-        { -11,  89 },{ -15,  103 },{ -21,  116 },{  19,  57 },
-        {  20,  58 },{   4,  84 },{   6,  96 },{   1,  63 },
-        {  -5,  85 },{ -13,  106 },{   5,  63 },{   6,  75 },
-        {  -3,  90 },{  -1,  101 },
-
-        /* 54 - 59 */
-        {   3,  55 },{  -4,  79 },{  -2,  75 },{ -12,  97 },
-        {  -7,  50 },{   1,  60 },
-
-        /* 60 - 69 */
-        { 0, 41 },   { 0, 63 },   { 0, 63 },     { 0, 63 },
-        { -9, 83 },  { 4, 86 },   { 0, 97 },     { -7, 72 },
-        { 13, 41 },  { 3, 62 },
-
-        /* 70 - 104 */
-        {   7,  34 }, {  -9,  88 }, { -20, 127 }, { -36, 127 },
-        { -17,  91 }, { -14,  95 }, { -25,  84 }, { -25,  86 },
-        { -12,  89 }, { -17,  91 }, { -31, 127 }, { -14,  76 },
-        { -18, 103 }, { -13,  90 }, { -37, 127 }, {  11,  80 },
-        {   5,  76 }, {   2,  84 }, {   5,  78 }, {  -6,  55 },
-        {   4,  61 }, { -14,  83 }, { -37, 127 }, {  -5,  79 },
-        { -11, 104 }, { -11,  91 }, { -30, 127 }, {   0,  65 },
-        {  -2,  79 }, {   0,  72 }, {  -4,  92 }, {  -6,  56 },
-        {   3,  68 }, {  -8,  71 }, { -13,  98 },
-
-        /* 105 -> 165 */
-        {  -4,  86 }, { -12,  88 }, {  -5,  82 }, {  -3,  72 },
-        {  -4,  67 }, {  -8,  72 }, { -16,  89 }, {  -9,  69 },
-        {  -1,  59 }, {   5,  66 }, {   4,  57 }, {  -4,  71 },
-        {  -2,  71 }, {   2,  58 }, {  -1,  74 }, {  -4,  44 },
-        {  -1,  69 }, {   0,  62 }, {  -7,  51 }, {  -4,  47 },
-        {  -6,  42 }, {  -3,  41 }, {  -6,  53 }, {   8,  76 },
-        {  -9,  78 }, { -11,  83 }, {   9,  52 }, {   0,  67 },
-        {  -5,  90 }, {   1,  67 }, { -15,  72 }, {  -5,  75 },
-        {  -8,  80 }, { -21,  83 }, { -21,  64 }, { -13,  31 },
-        { -25,  64 }, { -29,  94 }, {   9,  75 }, {  17,  63 },
-        {  -8,  74 }, {  -5,  35 }, {  -2,  27 }, {  13,  91 },
-        {   3,  65 }, {  -7,  69 }, {   8,  77 }, { -10,  66 },
-        {   3,  62 }, {  -3,  68 }, { -20,  81 }, {   0,  30 },
-        {   1,   7 }, {  -3,  23 }, { -21,  74 }, {  16,  66 },
-        { -23, 124 }, {  17,  37 }, {  44, -18 }, {  50, -34 },
-        { -22, 127 },
-
-        /* 166 - 226 */
-        {   4,  39 }, {   0,  42 }, {   7,  34 }, {  11,  29 },
-        {   8,  31 }, {   6,  37 }, {   7,  42 }, {   3,  40 },
-        {   8,  33 }, {  13,  43 }, {  13,  36 }, {   4,  47 },
-        {   3,  55 }, {   2,  58 }, {   6,  60 }, {   8,  44 },
-        {  11,  44 }, {  14,  42 }, {   7,  48 }, {   4,  56 },
-        {   4,  52 }, {  13,  37 }, {   9,  49 }, {  19,  58 },
-        {  10,  48 }, {  12,  45 }, {   0,  69 }, {  20,  33 },
-        {   8,  63 }, {  35, -18 }, {  33, -25 }, {  28,  -3 },
-        {  24,  10 }, {  27,   0 }, {  34, -14 }, {  52, -44 },
-        {  39, -24 }, {  19,  17 }, {  31,  25 }, {  36,  29 },
-        {  24,  33 }, {  34,  15 }, {  30,  20 }, {  22,  73 },
-        {  20,  34 }, {  19,  31 }, {  27,  44 }, {  19,  16 },
-        {  15,  36 }, {  15,  36 }, {  21,  28 }, {  25,  21 },
-        {  30,  20 }, {  31,  12 }, {  27,  16 }, {  24,  42 },
-        {   0,  93 }, {  14,  56 }, {  15,  57 }, {  26,  38 },
-        { -24, 127 },
-
-        /* 227 - 275 */
-        { -24, 115 }, { -22,  82 }, {  -9,  62 }, {   0,  53 },
-        {   0,  59 }, { -14,  85 }, { -13,  89 }, { -13,  94 },
-        { -11,  92 }, { -29, 127 }, { -21, 100 }, { -14,  57 },
-        { -12,  67 }, { -11,  71 }, { -10,  77 }, { -21,  85 },
-        { -16,  88 }, { -23, 104 }, { -15,  98 }, { -37, 127 },
-        { -10,  82 }, {  -8,  48 }, {  -8,  61 }, {  -8,  66 },
-        {  -7,  70 }, { -14,  75 }, { -10,  79 }, {  -9,  83 },
-        { -12,  92 }, { -18, 108 }, {  -4,  79 }, { -22,  69 },
-        { -16,  75 }, {  -2,  58 }, {   1,  58 }, { -13,  78 },
-        {  -9,  83 }, {  -4,  81 }, { -13,  99 }, { -13,  81 },
-        {  -6,  38 }, { -13,  62 }, {  -6,  58 }, {  -2,  59 },
-        { -16,  73 }, { -10,  76 }, { -13,  86 }, {  -9,  83 },
-        { -10,  87 },
-
-        /* 276 a bit special (not used, bypass is used instead) */
-        { 0, 0 },
-
-        /* 277 - 337 */
-        { -22, 127 }, { -25, 127 }, { -25, 120 }, { -27, 127 },
-        { -19, 114 }, { -23, 117 }, { -25, 118 }, { -26, 117 },
-        { -24, 113 }, { -28, 118 }, { -31, 120 }, { -37, 124 },
-        { -10,  94 }, { -15, 102 }, { -10,  99 }, { -13, 106 },
-        { -50, 127 }, {  -5,  92 }, {  17,  57 }, {  -5,  86 },
-        { -13,  94 }, { -12,  91 }, {  -2,  77 }, {   0,  71 },
-        {  -1,  73 }, {   4,  64 }, {  -7,  81 }, {   5,  64 },
-        {  15,  57 }, {   1,  67 }, {   0,  68 }, { -10,  67 },
-        {   1,  68 }, {   0,  77 }, {   2,  64 }, {   0,  68 },
-        {  -5,  78 }, {   7,  55 }, {   5,  59 }, {   2,  65 },
-        {  14,  54 }, {  15,  44 }, {   5,  60 }, {   2,  70 },
-        {  -2,  76 }, { -18,  86 }, {  12,  70 }, {   5,  64 },
-        { -12,  70 }, {  11,  55 }, {   5,  56 }, {   0,  69 },
-        {   2,  65 }, {  -6,  74 }, {   5,  54 }, {   7,  54 },
-        {  -6,  76 }, { -11,  82 }, {  -2,  77 }, {  -2,  77 },
-        {  25,  42 },
-
-        /* 338 - 398 */
-        {  17, -13 }, {  16,  -9 }, {  17, -12 }, {  27, -21 },
-        {  37, -30 }, {  41, -40 }, {  42, -41 }, {  48, -47 },
-        {  39, -32 }, {  46, -40 }, {  52, -51 }, {  46, -41 },
-        {  52, -39 }, {  43, -19 }, {  32,  11 }, {  61, -55 },
-        {  56, -46 }, {  62, -50 }, {  81, -67 }, {  45, -20 },
-        {  35,  -2 }, {  28,  15 }, {  34,   1 }, {  39,   1 },
-        {  30,  17 }, {  20,  38 }, {  18,  45 }, {  15,  54 },
-        {   0,  79 }, {  36, -16 }, {  37, -14 }, {  37, -17 },
-        {  32,   1 }, {  34,  15 }, {  29,  15 }, {  24,  25 },
-        {  34,  22 }, {  31,  16 }, {  35,  18 }, {  31,  28 },
-        {  33,  41 }, {  36,  28 }, {  27,  47 }, {  21,  62 },
-        {  18,  31 }, {  19,  26 }, {  36,  24 }, {  24,  23 },
-        {  27,  16 }, {  24,  30 }, {  31,  29 }, {  22,  41 },
-        {  22,  42 }, {  16,  60 }, {  15,  52 }, {  14,  60 },
-        {   3,  78 }, { -16, 123 }, {  21,  53 }, {  22,  56 },
-        {  25,  61 },
-
-        /* 399 - 435 */
-        {  21,  33 }, {  19,  50 }, {  17,  61 },
-        {  -3,  78 }, {  -8,  74 }, {  -9,  72 }, { -10,  72 },
-        { -18,  75 }, { -12,  71 }, { -11,  63 }, {  -5,  70 },
-        { -17,  75 }, { -14,  72 }, { -16,  67 }, {  -8,  53 },
-        { -14,  59 }, {  -9,  52 }, { -11,  68 }, {   9,  -2 },
-        {  30, -10 }, {  31,  -4 }, {  33,  -1 }, {  33,   7 },
-        {  31,  12 }, {  37,  23 }, {  31,  38 }, {  20,  64 },
-        {  -9,  71 }, {  -7,  37 }, {  -8,  44 }, { -11,  49 },
-        { -10,  56 }, { -12,  59 }, {  -8,  63 }, {  -9,  67 },
-        {  -6,  68 }, { -10,  79 },
-
-        /* 436 - 459 */
-        {  -3,  78 }, {  -8,  74 }, {  -9,  72 }, { -10,  72 },
-        { -18,  75 }, { -12,  71 }, { -11,  63 }, {  -5,  70 },
-        { -17,  75 }, { -14,  72 }, { -16,  67 }, {  -8,  53 },
-        { -14,  59 }, {  -9,  52 }, { -11,  68 }, {   9,  -2 },
-        {  30, -10 }, {  31,  -4 }, {  33,  -1 }, {  33,   7 },
-        {  31,  12 }, {  37,  23 }, {  31,  38 }, {  20,  64 },
-
-        /* 460 - 1024 */
-        {  11,  80 }, {   5,  76 }, {   2,  84 }, {   5,  78 },
-        {  -6,  55 }, {   4,  61 }, { -14,  83 }, { -37, 127 },
-        {  -5,  79 }, { -11, 104 }, { -11,  91 }, { -30, 127 },
-        {  11,  80 }, {   5,  76 }, {   2,  84 }, {   5,  78 },
-        {  -6,  55 }, {   4,  61 }, { -14,  83 }, { -37, 127 },
-        {  -5,  79 }, { -11, 104 }, { -11,  91 }, { -30, 127 },
-        {  -4,  86 }, { -12,  88 }, {  -5,  82 }, {  -3,  72 },
-        {  -4,  67 }, {  -8,  72 }, { -16,  89 }, {  -9,  69 },
-        {  -1,  59 }, {   5,  66 }, {   4,  57 }, {  -4,  71 },
-        {  -2,  71 }, {   2,  58 }, {  -1,  74 }, {  -4,  44 },
-        {  -1,  69 }, {   0,  62 }, {  -7,  51 }, {  -4,  47 },
-        {  -6,  42 }, {  -3,  41 }, {  -6,  53 }, {   8,  76 },
-        {  -9,  78 }, { -11,  83 }, {   9,  52 }, {   0,  67 },
-        {  -5,  90 }, {   1,  67 }, { -15,  72 }, {  -5,  75 },
-        {  -8,  80 }, { -21,  83 }, { -21,  64 }, { -13,  31 },
-        { -25,  64 }, { -29,  94 }, {   9,  75 }, {  17,  63 },
-        {  -8,  74 }, {  -5,  35 }, {  -2,  27 }, {  13,  91 },
-        {  -4,  86 }, { -12,  88 }, {  -5,  82 }, {  -3,  72 },
-        {  -4,  67 }, {  -8,  72 }, { -16,  89 }, {  -9,  69 },
-        {  -1,  59 }, {   5,  66 }, {   4,  57 }, {  -4,  71 },
-        {  -2,  71 }, {   2,  58 }, {  -1,  74 }, {  -4,  44 },
-        {  -1,  69 }, {   0,  62 }, {  -7,  51 }, {  -4,  47 },
-        {  -6,  42 }, {  -3,  41 }, {  -6,  53 }, {   8,  76 },
-        {  -9,  78 }, { -11,  83 }, {   9,  52 }, {   0,  67 },
-        {  -5,  90 }, {   1,  67 }, { -15,  72 }, {  -5,  75 },
-        {  -8,  80 }, { -21,  83 }, { -21,  64 }, { -13,  31 },
-        { -25,  64 }, { -29,  94 }, {   9,  75 }, {  17,  63 },
-        {  -8,  74 }, {  -5,  35 }, {  -2,  27 }, {  13,  91 },
-        {   4,  39 }, {   0,  42 }, {   7,  34 }, {  11,  29 },
-        {   8,  31 }, {   6,  37 }, {   7,  42 }, {   3,  40 },
-        {   8,  33 }, {  13,  43 }, {  13,  36 }, {   4,  47 },
-        {   3,  55 }, {   2,  58 }, {   6,  60 }, {   8,  44 },
-        {  11,  44 }, {  14,  42 }, {   7,  48 }, {   4,  56 },
-        {   4,  52 }, {  13,  37 }, {   9,  49 }, {  19,  58 },
-        {  10,  48 }, {  12,  45 }, {   0,  69 }, {  20,  33 },
-        {   8,  63 }, {  35, -18 }, {  33, -25 }, {  28,  -3 },
-        {  24,  10 }, {  27,   0 }, {  34, -14 }, {  52, -44 },
-        {  39, -24 }, {  19,  17 }, {  31,  25 }, {  36,  29 },
-        {  24,  33 }, {  34,  15 }, {  30,  20 }, {  22,  73 },
-        {   4,  39 }, {   0,  42 }, {   7,  34 }, {  11,  29 },
-        {   8,  31 }, {   6,  37 }, {   7,  42 }, {   3,  40 },
-        {   8,  33 }, {  13,  43 }, {  13,  36 }, {   4,  47 },
-        {   3,  55 }, {   2,  58 }, {   6,  60 }, {   8,  44 },
-        {  11,  44 }, {  14,  42 }, {   7,  48 }, {   4,  56 },
-        {   4,  52 }, {  13,  37 }, {   9,  49 }, {  19,  58 },
-        {  10,  48 }, {  12,  45 }, {   0,  69 }, {  20,  33 },
-        {   8,  63 }, {  35, -18 }, {  33, -25 }, {  28,  -3 },
-        {  24,  10 }, {  27,   0 }, {  34, -14 }, {  52, -44 },
-        {  39, -24 }, {  19,  17 }, {  31,  25 }, {  36,  29 },
-        {  24,  33 }, {  34,  15 }, {  30,  20 }, {  22,  73 },
-        {  -3,  78 }, {  -8,  74 }, {  -9,  72 }, { -10,  72 },
-        { -18,  75 }, { -12,  71 }, { -11,  63 }, {  -5,  70 },
-        { -17,  75 }, { -14,  72 }, { -16,  67 }, {  -8,  53 },
-        { -14,  59 }, {  -9,  52 }, { -11,  68 }, {  -3,  78 },
-        {  -8,  74 }, {  -9,  72 }, { -10,  72 }, { -18,  75 },
-        { -12,  71 }, { -11,  63 }, {  -5,  70 }, { -17,  75 },
-        { -14,  72 }, { -16,  67 }, {  -8,  53 }, { -14,  59 },
-        {  -9,  52 }, { -11,  68 }, {   9,  -2 }, {  30, -10 },
-        {  31,  -4 }, {  33,  -1 }, {  33,   7 }, {  31,  12 },
-        {  37,  23 }, {  31,  38 }, {  20,  64 }, {   9,  -2 },
-        {  30, -10 }, {  31,  -4 }, {  33,  -1 }, {  33,   7 },
-        {  31,  12 }, {  37,  23 }, {  31,  38 }, {  20,  64 },
-        {  -9,  71 }, {  -7,  37 }, {  -8,  44 }, { -11,  49 },
-        { -10,  56 }, { -12,  59 }, {  -8,  63 }, {  -9,  67 },
-        {  -6,  68 }, { -10,  79 }, {  -3,  78 }, {  -8,  74 },
-        {  -9,  72 }, { -10,  72 }, { -18,  75 }, { -12,  71 },
-        { -11,  63 }, {  -5,  70 }, { -17,  75 }, { -14,  72 },
-        { -16,  67 }, {  -8,  53 }, { -14,  59 }, {  -9,  52 },
-        { -11,  68 }, {  -3,  78 }, {  -8,  74 }, {  -9,  72 },
-        { -10,  72 }, { -18,  75 }, { -12,  71 }, { -11,  63 },
-        {  -5,  70 }, { -17,  75 }, { -14,  72 }, { -16,  67 },
-        {  -8,  53 }, { -14,  59 }, {  -9,  52 }, { -11,  68 },
-        {   9,  -2 }, {  30, -10 }, {  31,  -4 }, {  33,  -1 },
-        {  33,   7 }, {  31,  12 }, {  37,  23 }, {  31,  38 },
-        {  20,  64 }, {   9,  -2 }, {  30, -10 }, {  31,  -4 },
-        {  33,  -1 }, {  33,   7 }, {  31,  12 }, {  37,  23 },
-        {  31,  38 }, {  20,  64 }, {  -9,  71 }, {  -7,  37 },
-        {  -8,  44 }, { -11,  49 }, { -10,  56 }, { -12,  59 },
-        {  -8,  63 }, {  -9,  67 }, {  -6,  68 }, { -10,  79 },
-        { -22, 127 }, { -25, 127 }, { -25, 120 }, { -27, 127 },
-        { -19, 114 }, { -23, 117 }, { -25, 118 }, { -26, 117 },
-        { -24, 113 }, { -28, 118 }, { -31, 120 }, { -37, 124 },
-        { -10,  94 }, { -15, 102 }, { -10,  99 }, { -13, 106 },
-        { -50, 127 }, {  -5,  92 }, {  17,  57 }, {  -5,  86 },
-        { -13,  94 }, { -12,  91 }, {  -2,  77 }, {   0,  71 },
-        {  -1,  73 }, {   4,  64 }, {  -7,  81 }, {   5,  64 },
-        {  15,  57 }, {   1,  67 }, {   0,  68 }, { -10,  67 },
-        {   1,  68 }, {   0,  77 }, {   2,  64 }, {   0,  68 },
-        {  -5,  78 }, {   7,  55 }, {   5,  59 }, {   2,  65 },
-        {  14,  54 }, {  15,  44 }, {   5,  60 }, {   2,  70 },
-        { -22, 127 }, { -25, 127 }, { -25, 120 }, { -27, 127 },
-        { -19, 114 }, { -23, 117 }, { -25, 118 }, { -26, 117 },
-        { -24, 113 }, { -28, 118 }, { -31, 120 }, { -37, 124 },
-        { -10,  94 }, { -15, 102 }, { -10,  99 }, { -13, 106 },
-        { -50, 127 }, {  -5,  92 }, {  17,  57 }, {  -5,  86 },
-        { -13,  94 }, { -12,  91 }, {  -2,  77 }, {   0,  71 },
-        {  -1,  73 }, {   4,  64 }, {  -7,  81 }, {   5,  64 },
-        {  15,  57 }, {   1,  67 }, {   0,  68 }, { -10,  67 },
-        {   1,  68 }, {   0,  77 }, {   2,  64 }, {   0,  68 },
-        {  -5,  78 }, {   7,  55 }, {   5,  59 }, {   2,  65 },
-        {  14,  54 }, {  15,  44 }, {   5,  60 }, {   2,  70 },
-        {  17, -13 }, {  16,  -9 }, {  17, -12 }, {  27, -21 },
-        {  37, -30 }, {  41, -40 }, {  42, -41 }, {  48, -47 },
-        {  39, -32 }, {  46, -40 }, {  52, -51 }, {  46, -41 },
-        {  52, -39 }, {  43, -19 }, {  32,  11 }, {  61, -55 },
-        {  56, -46 }, {  62, -50 }, {  81, -67 }, {  45, -20 },
-        {  35,  -2 }, {  28,  15 }, {  34,   1 }, {  39,   1 },
-        {  30,  17 }, {  20,  38 }, {  18,  45 }, {  15,  54 },
-        {   0,  79 }, {  36, -16 }, {  37, -14 }, {  37, -17 },
-        {  32,   1 }, {  34,  15 }, {  29,  15 }, {  24,  25 },
-        {  34,  22 }, {  31,  16 }, {  35,  18 }, {  31,  28 },
-        {  33,  41 }, {  36,  28 }, {  27,  47 }, {  21,  62 },
-        {  17, -13 }, {  16,  -9 }, {  17, -12 }, {  27, -21 },
-        {  37, -30 }, {  41, -40 }, {  42, -41 }, {  48, -47 },
-        {  39, -32 }, {  46, -40 }, {  52, -51 }, {  46, -41 },
-        {  52, -39 }, {  43, -19 }, {  32,  11 }, {  61, -55 },
-        {  56, -46 }, {  62, -50 }, {  81, -67 }, {  45, -20 },
-        {  35,  -2 }, {  28,  15 }, {  34,   1 }, {  39,   1 },
-        {  30,  17 }, {  20,  38 }, {  18,  45 }, {  15,  54 },
-        {   0,  79 }, {  36, -16 }, {  37, -14 }, {  37, -17 },
-        {  32,   1 }, {  34,  15 }, {  29,  15 }, {  24,  25 },
-        {  34,  22 }, {  31,  16 }, {  35,  18 }, {  31,  28 },
-        {  33,  41 }, {  36,  28 }, {  27,  47 }, {  21,  62 },
-        { -24, 115 }, { -22,  82 }, {  -9,  62 }, {   0,  53 },
-        {   0,  59 }, { -14,  85 }, { -13,  89 }, { -13,  94 },
-        { -11,  92 }, { -29, 127 }, { -21, 100 }, { -14,  57 },
-        { -12,  67 }, { -11,  71 }, { -10,  77 }, { -21,  85 },
-        { -16,  88 }, { -23, 104 }, { -15,  98 }, { -37, 127 },
-        { -10,  82 }, {  -8,  48 }, {  -8,  61 }, {  -8,  66 },
-        {  -7,  70 }, { -14,  75 }, { -10,  79 }, {  -9,  83 },
-        { -12,  92 }, { -18, 108 }, { -24, 115 }, { -22,  82 },
-        {  -9,  62 }, {   0,  53 }, {   0,  59 }, { -14,  85 },
-        { -13,  89 }, { -13,  94 }, { -11,  92 }, { -29, 127 },
-        { -21, 100 }, { -14,  57 }, { -12,  67 }, { -11,  71 },
-        { -10,  77 }, { -21,  85 }, { -16,  88 }, { -23, 104 },
-        { -15,  98 }, { -37, 127 }, { -10,  82 }, {  -8,  48 },
-        {  -8,  61 }, {  -8,  66 }, {  -7,  70 }, { -14,  75 },
-        { -10,  79 }, {  -9,  83 }, { -12,  92 }, { -18, 108 },
-        {  -5,  79 }, { -11, 104 }, { -11,  91 }, { -30, 127 },
-        {  -5,  79 }, { -11, 104 }, { -11,  91 }, { -30, 127 },
-        {  -5,  79 }, { -11, 104 }, { -11,  91 }, { -30, 127 }
-    }
-};
-
-void ff_h264_init_cabac_states(H264Context *h) {
-    int i;
-    const int8_t (*tab)[2];
-    const int slice_qp = av_clip(h->qscale - 6*(h->sps.bit_depth_luma-8), 0, 51);
-
-    if( h->slice_type_nos == AV_PICTURE_TYPE_I ) tab = cabac_context_init_I;
-    else                                 tab = cabac_context_init_PB[h->cabac_init_idc];
-
-    /* calculate pre-state */
-    for( i= 0; i < 1024; i++ ) {
-        int pre = 2*(((tab[i][0] * slice_qp) >>4 ) + tab[i][1]) - 127;
-
-        pre^= pre>>31;
-        if(pre > 124)
-            pre= 124 + (pre&1);
-
-        h->cabac_state[i] =  pre;
-    }
-}
-
-static int decode_cabac_field_decoding_flag(H264Context *h) {
-    const long mbb_xy = h->mb_xy - 2L*h->mb_stride;
-
-    unsigned long ctx = 0;
-
-    ctx += h->mb_field_decoding_flag & !!h->mb_x; //for FMO:(s->current_picture.mb_type[mba_xy] >> 7) & (h->slice_table[mba_xy] == h->slice_num);
-    ctx += (h->cur_pic.mb_type[mbb_xy] >> 7) & (h->slice_table[mbb_xy] == h->slice_num);
-
-    return get_cabac_noinline( &h->cabac, &(h->cabac_state+70)[ctx] );
-}
-
-static int decode_cabac_intra_mb_type(H264Context *h, int ctx_base, int intra_slice) {
-    uint8_t *state= &h->cabac_state[ctx_base];
-    int mb_type;
-
-    if(intra_slice){
-        int ctx=0;
-        if( h->left_type[LTOP] & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM))
-            ctx++;
-        if( h->top_type        & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM))
-            ctx++;
-        if( get_cabac_noinline( &h->cabac, &state[ctx] ) == 0 )
-            return 0;   /* I4x4 */
-        state += 2;
-    }else{
-        if( get_cabac_noinline( &h->cabac, state ) == 0 )
-            return 0;   /* I4x4 */
-    }
-
-    if( get_cabac_terminate( &h->cabac ) )
-        return 25;  /* PCM */
-
-    mb_type = 1; /* I16x16 */
-    mb_type += 12 * get_cabac_noinline( &h->cabac, &state[1] ); /* cbp_luma != 0 */
-    if( get_cabac_noinline( &h->cabac, &state[2] ) ) /* cbp_chroma */
-        mb_type += 4 + 4 * get_cabac_noinline( &h->cabac, &state[2+intra_slice] );
-    mb_type += 2 * get_cabac_noinline( &h->cabac, &state[3+intra_slice] );
-    mb_type += 1 * get_cabac_noinline( &h->cabac, &state[3+2*intra_slice] );
-    return mb_type;
-}
-
-static int decode_cabac_mb_skip( H264Context *h, int mb_x, int mb_y ) {
-    int mba_xy, mbb_xy;
-    int ctx = 0;
-
-    if (FRAME_MBAFF(h)) { //FIXME merge with the stuff in fill_caches?
-        int mb_xy = mb_x + (mb_y&~1)*h->mb_stride;
-        mba_xy = mb_xy - 1;
-        if( (mb_y&1)
-            && h->slice_table[mba_xy] == h->slice_num
-            && MB_FIELD(h) == !!IS_INTERLACED( h->cur_pic.mb_type[mba_xy] ) )
-            mba_xy += h->mb_stride;
-        if (MB_FIELD(h)) {
-            mbb_xy = mb_xy - h->mb_stride;
-            if( !(mb_y&1)
-                && h->slice_table[mbb_xy] == h->slice_num
-                && IS_INTERLACED( h->cur_pic.mb_type[mbb_xy] ) )
-                mbb_xy -= h->mb_stride;
-        }else
-            mbb_xy = mb_x + (mb_y-1)*h->mb_stride;
-    }else{
-        int mb_xy = h->mb_xy;
-        mba_xy = mb_xy - 1;
-        mbb_xy = mb_xy - (h->mb_stride << FIELD_PICTURE(h));
-    }
-
-    if( h->slice_table[mba_xy] == h->slice_num && !IS_SKIP(h->cur_pic.mb_type[mba_xy] ))
-        ctx++;
-    if( h->slice_table[mbb_xy] == h->slice_num && !IS_SKIP(h->cur_pic.mb_type[mbb_xy] ))
-        ctx++;
-
-    if( h->slice_type_nos == AV_PICTURE_TYPE_B )
-        ctx += 13;
-    return get_cabac_noinline( &h->cabac, &h->cabac_state[11+ctx] );
-}
-
-static int decode_cabac_mb_intra4x4_pred_mode( H264Context *h, int pred_mode ) {
-    int mode = 0;
-
-    if( get_cabac( &h->cabac, &h->cabac_state[68] ) )
-        return pred_mode;
-
-    mode += 1 * get_cabac( &h->cabac, &h->cabac_state[69] );
-    mode += 2 * get_cabac( &h->cabac, &h->cabac_state[69] );
-    mode += 4 * get_cabac( &h->cabac, &h->cabac_state[69] );
-
-    return mode + ( mode >= pred_mode );
-}
-
-static int decode_cabac_mb_chroma_pre_mode( H264Context *h) {
-    const int mba_xy = h->left_mb_xy[0];
-    const int mbb_xy = h->top_mb_xy;
-
-    int ctx = 0;
-
-    /* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */
-    if( h->left_type[LTOP] && h->chroma_pred_mode_table[mba_xy] != 0 )
-        ctx++;
-
-    if( h->top_type        && h->chroma_pred_mode_table[mbb_xy] != 0 )
-        ctx++;
-
-    if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+ctx] ) == 0 )
-        return 0;
-
-    if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+3] ) == 0 )
-        return 1;
-    if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+3] ) == 0 )
-        return 2;
-    else
-        return 3;
-}
-
-static int decode_cabac_mb_cbp_luma( H264Context *h) {
-    int cbp_b, cbp_a, ctx, cbp = 0;
-
-    cbp_a = h->left_cbp;
-    cbp_b = h->top_cbp;
-
-    ctx = !(cbp_a & 0x02) + 2 * !(cbp_b & 0x04);
-    cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]);
-    ctx = !(cbp   & 0x01) + 2 * !(cbp_b & 0x08);
-    cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 1;
-    ctx = !(cbp_a & 0x08) + 2 * !(cbp   & 0x01);
-    cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 2;
-    ctx = !(cbp   & 0x04) + 2 * !(cbp   & 0x02);
-    cbp += get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]) << 3;
-    return cbp;
-}
-static int decode_cabac_mb_cbp_chroma( H264Context *h) {
-    int ctx;
-    int cbp_a, cbp_b;
-
-    cbp_a = (h->left_cbp>>4)&0x03;
-    cbp_b = (h-> top_cbp>>4)&0x03;
-
-    ctx = 0;
-    if( cbp_a > 0 ) ctx++;
-    if( cbp_b > 0 ) ctx += 2;
-    if( get_cabac_noinline( &h->cabac, &h->cabac_state[77 + ctx] ) == 0 )
-        return 0;
-
-    ctx = 4;
-    if( cbp_a == 2 ) ctx++;
-    if( cbp_b == 2 ) ctx += 2;
-    return 1 + get_cabac_noinline( &h->cabac, &h->cabac_state[77 + ctx] );
-}
-
-static int decode_cabac_p_mb_sub_type( H264Context *h ) {
-    if( get_cabac( &h->cabac, &h->cabac_state[21] ) )
-        return 0;   /* 8x8 */
-    if( !get_cabac( &h->cabac, &h->cabac_state[22] ) )
-        return 1;   /* 8x4 */
-    if( get_cabac( &h->cabac, &h->cabac_state[23] ) )
-        return 2;   /* 4x8 */
-    return 3;       /* 4x4 */
-}
-static int decode_cabac_b_mb_sub_type( H264Context *h ) {
-    int type;
-    if( !get_cabac( &h->cabac, &h->cabac_state[36] ) )
-        return 0;   /* B_Direct_8x8 */
-    if( !get_cabac( &h->cabac, &h->cabac_state[37] ) )
-        return 1 + get_cabac( &h->cabac, &h->cabac_state[39] ); /* B_L0_8x8, B_L1_8x8 */
-    type = 3;
-    if( get_cabac( &h->cabac, &h->cabac_state[38] ) ) {
-        if( get_cabac( &h->cabac, &h->cabac_state[39] ) )
-            return 11 + get_cabac( &h->cabac, &h->cabac_state[39] ); /* B_L1_4x4, B_Bi_4x4 */
-        type += 4;
-    }
-    type += 2*get_cabac( &h->cabac, &h->cabac_state[39] );
-    type +=   get_cabac( &h->cabac, &h->cabac_state[39] );
-    return type;
-}
-
-static int decode_cabac_mb_ref( H264Context *h, int list, int n ) {
-    int refa = h->ref_cache[list][scan8[n] - 1];
-    int refb = h->ref_cache[list][scan8[n] - 8];
-    int ref  = 0;
-    int ctx  = 0;
-
-    if( h->slice_type_nos == AV_PICTURE_TYPE_B) {
-        if( refa > 0 && !(h->direct_cache[scan8[n] - 1]&(MB_TYPE_DIRECT2>>1)) )
-            ctx++;
-        if( refb > 0 && !(h->direct_cache[scan8[n] - 8]&(MB_TYPE_DIRECT2>>1)) )
-            ctx += 2;
-    } else {
-        if( refa > 0 )
-            ctx++;
-        if( refb > 0 )
-            ctx += 2;
-    }
-
-    while( get_cabac( &h->cabac, &h->cabac_state[54+ctx] ) ) {
-        ref++;
-        ctx = (ctx>>2)+4;
-        if(ref >= 32 /*h->ref_list[list]*/){
-            return -1;
-        }
-    }
-    return ref;
-}
-
-static int decode_cabac_mb_mvd( H264Context *h, int ctxbase, int amvd, int *mvda) {
-    int mvd;
-
-    if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+((amvd-3)>>(INT_BIT-1))+((amvd-33)>>(INT_BIT-1))+2])){
-//    if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+(amvd>2)+(amvd>32)])){
-        *mvda= 0;
-        return 0;
-    }
-
-    mvd= 1;
-    ctxbase+= 3;
-    while( mvd < 9 && get_cabac( &h->cabac, &h->cabac_state[ctxbase] ) ) {
-        if( mvd < 4 )
-            ctxbase++;
-        mvd++;
-    }
-
-    if( mvd >= 9 ) {
-        int k = 3;
-        while( get_cabac_bypass( &h->cabac ) ) {
-            mvd += 1 << k;
-            k++;
-            if(k>24){
-                av_log(h->avctx, AV_LOG_ERROR, "overflow in decode_cabac_mb_mvd\n");
-                return INT_MIN;
-            }
-        }
-        while( k-- ) {
-            mvd += get_cabac_bypass( &h->cabac )<<k;
-        }
-        *mvda=mvd < 70 ? mvd : 70;
-    }else
-        *mvda=mvd;
-    return get_cabac_bypass_sign( &h->cabac, -mvd );
-}
-
-#define DECODE_CABAC_MB_MVD( h,  list,  n )\
-{\
-    int amvd0 = h->mvd_cache[list][scan8[n] - 1][0] +\
-                h->mvd_cache[list][scan8[n] - 8][0];\
-    int amvd1 = h->mvd_cache[list][scan8[n] - 1][1] +\
-                h->mvd_cache[list][scan8[n] - 8][1];\
-\
-    mx += decode_cabac_mb_mvd( h, 40, amvd0, &mpx );\
-    my += decode_cabac_mb_mvd( h, 47, amvd1, &mpy );\
-}
-
-static av_always_inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx, int max_coeff, int is_dc ) {
-    int nza, nzb;
-    int ctx = 0;
-    static const uint16_t base_ctx[14] = {85,89,93,97,101,1012,460,464,468,1016,472,476,480,1020};
-
-    if( is_dc ) {
-        if( cat == 3 ) {
-            idx -= CHROMA_DC_BLOCK_INDEX;
-            nza = (h->left_cbp>>(6+idx))&0x01;
-            nzb = (h-> top_cbp>>(6+idx))&0x01;
-        } else {
-            idx -= LUMA_DC_BLOCK_INDEX;
-            nza = h->left_cbp&(0x100<<idx);
-            nzb = h-> top_cbp&(0x100<<idx);
-        }
-    } else {
-        nza = h->non_zero_count_cache[scan8[idx] - 1];
-        nzb = h->non_zero_count_cache[scan8[idx] - 8];
-    }
-
-    if( nza > 0 )
-        ctx++;
-
-    if( nzb > 0 )
-        ctx += 2;
-
-    return base_ctx[cat] + ctx;
-}
-
-static av_always_inline void
-decode_cabac_residual_internal(H264Context *h, int16_t *block,
-                               int cat, int n, const uint8_t *scantable,
-                               const uint32_t *qmul, int max_coeff,
-                               int is_dc, int chroma422)
-{
-    static const int significant_coeff_flag_offset[2][14] = {
-      { 105+0, 105+15, 105+29, 105+44, 105+47, 402, 484+0, 484+15, 484+29, 660, 528+0, 528+15, 528+29, 718 },
-      { 277+0, 277+15, 277+29, 277+44, 277+47, 436, 776+0, 776+15, 776+29, 675, 820+0, 820+15, 820+29, 733 }
-    };
-    static const int last_coeff_flag_offset[2][14] = {
-      { 166+0, 166+15, 166+29, 166+44, 166+47, 417, 572+0, 572+15, 572+29, 690, 616+0, 616+15, 616+29, 748 },
-      { 338+0, 338+15, 338+29, 338+44, 338+47, 451, 864+0, 864+15, 864+29, 699, 908+0, 908+15, 908+29, 757 }
-    };
-    static const int coeff_abs_level_m1_offset[14] = {
-        227+0, 227+10, 227+20, 227+30, 227+39, 426, 952+0, 952+10, 952+20, 708, 982+0, 982+10, 982+20, 766
-    };
-    static const uint8_t significant_coeff_flag_offset_8x8[2][63] = {
-      { 0, 1, 2, 3, 4, 5, 5, 4, 4, 3, 3, 4, 4, 4, 5, 5,
-        4, 4, 4, 4, 3, 3, 6, 7, 7, 7, 8, 9,10, 9, 8, 7,
-        7, 6,11,12,13,11, 6, 7, 8, 9,14,10, 9, 8, 6,11,
-       12,13,11, 6, 9,14,10, 9,11,12,13,11,14,10,12 },
-      { 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7, 7, 8, 4, 5,
-        6, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,11,12,11,
-        9, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,13,13, 9,
-        9,10,10, 8,13,13, 9, 9,10,10,14,14,14,14,14 }
-    };
-    static const uint8_t sig_coeff_offset_dc[7] = { 0, 0, 1, 1, 2, 2, 2 };
-    /* node ctx: 0..3: abslevel1 (with abslevelgt1 == 0).
-     * 4..7: abslevelgt1 + 3 (and abslevel1 doesn't matter).
-     * map node ctx => cabac ctx for level=1 */
-    static const uint8_t coeff_abs_level1_ctx[8] = { 1, 2, 3, 4, 0, 0, 0, 0 };
-    /* map node ctx => cabac ctx for level>1 */
-    static const uint8_t coeff_abs_levelgt1_ctx[2][8] = {
-        { 5, 5, 5, 5, 6, 7, 8, 9 },
-        { 5, 5, 5, 5, 6, 7, 8, 8 }, // 422/dc case
-    };
-    static const uint8_t coeff_abs_level_transition[2][8] = {
-    /* update node ctx after decoding a level=1 */
-        { 1, 2, 3, 3, 4, 5, 6, 7 },
-    /* update node ctx after decoding a level>1 */
-        { 4, 4, 4, 4, 5, 6, 7, 7 }
-    };
-
-    int index[64];
-
-    int av_unused last;
-    int coeff_count = 0;
-    int node_ctx = 0;
-
-    uint8_t *significant_coeff_ctx_base;
-    uint8_t *last_coeff_ctx_base;
-    uint8_t *abs_level_m1_ctx_base;
-
-#if !ARCH_X86
-#define CABAC_ON_STACK
-#endif
-#ifdef CABAC_ON_STACK
-#define CC &cc
-    CABACContext cc;
-    cc.range     = h->cabac.range;
-    cc.low       = h->cabac.low;
-    cc.bytestream= h->cabac.bytestream;
-    cc.bytestream_end = h->cabac.bytestream_end;
-#else
-#define CC &h->cabac
-#endif
-
-    significant_coeff_ctx_base = h->cabac_state
-        + significant_coeff_flag_offset[MB_FIELD(h)][cat];
-    last_coeff_ctx_base = h->cabac_state
-        + last_coeff_flag_offset[MB_FIELD(h)][cat];
-    abs_level_m1_ctx_base = h->cabac_state
-        + coeff_abs_level_m1_offset[cat];
-
-    if( !is_dc && max_coeff == 64 ) {
-#define DECODE_SIGNIFICANCE( coefs, sig_off, last_off ) \
-        for(last= 0; last < coefs; last++) { \
-            uint8_t *sig_ctx = significant_coeff_ctx_base + sig_off; \
-            if( get_cabac( CC, sig_ctx )) { \
-                uint8_t *last_ctx = last_coeff_ctx_base + last_off; \
-                index[coeff_count++] = last; \
-                if( get_cabac( CC, last_ctx ) ) { \
-                    last= max_coeff; \
-                    break; \
-                } \
-            } \
-        }\
-        if( last == max_coeff -1 ) {\
-            index[coeff_count++] = last;\
-        }
-        const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD(h)];
-#ifdef decode_significance
-        coeff_count = decode_significance_8x8(CC, significant_coeff_ctx_base, index,
-                                                 last_coeff_ctx_base, sig_off);
-    } else {
-        if (is_dc && chroma422) { // dc 422
-            DECODE_SIGNIFICANCE(7, sig_coeff_offset_dc[last], sig_coeff_offset_dc[last]);
-        } else {
-            coeff_count = decode_significance(CC, max_coeff, significant_coeff_ctx_base, index,
-                                                 last_coeff_ctx_base-significant_coeff_ctx_base);
-        }
-#else
-        DECODE_SIGNIFICANCE( 63, sig_off[last], ff_h264_last_coeff_flag_offset_8x8[last] );
-    } else {
-        if (is_dc && chroma422) { // dc 422
-            DECODE_SIGNIFICANCE(7, sig_coeff_offset_dc[last], sig_coeff_offset_dc[last]);
-        } else {
-            DECODE_SIGNIFICANCE(max_coeff - 1, last, last);
-        }
-#endif
-    }
-    assert(coeff_count > 0);
-
-    if( is_dc ) {
-        if( cat == 3 )
-            h->cbp_table[h->mb_xy] |= 0x40 << (n - CHROMA_DC_BLOCK_INDEX);
-        else
-            h->cbp_table[h->mb_xy] |= 0x100 << (n - LUMA_DC_BLOCK_INDEX);
-        h->non_zero_count_cache[scan8[n]] = coeff_count;
-    } else {
-        if( max_coeff == 64 )
-            fill_rectangle(&h->non_zero_count_cache[scan8[n]], 2, 2, 8, coeff_count, 1);
-        else {
-            assert( cat == 1 || cat ==  2 || cat ==  4 || cat == 7 || cat == 8 || cat == 11 || cat == 12 );
-            h->non_zero_count_cache[scan8[n]] = coeff_count;
-        }
-    }
-
-#define STORE_BLOCK(type) \
-    do { \
-        uint8_t *ctx = coeff_abs_level1_ctx[node_ctx] + abs_level_m1_ctx_base; \
- \
-        int j= scantable[index[--coeff_count]]; \
- \
-        if( get_cabac( CC, ctx ) == 0 ) { \
-            node_ctx = coeff_abs_level_transition[0][node_ctx]; \
-            if( is_dc ) { \
-                ((type*)block)[j] = get_cabac_bypass_sign( CC, -1); \
-            }else{ \
-                ((type*)block)[j] = (get_cabac_bypass_sign( CC, -qmul[j]) + 32) >> 6; \
-            } \
-        } else { \
-            int coeff_abs = 2; \
-            ctx = coeff_abs_levelgt1_ctx[is_dc && chroma422][node_ctx] + abs_level_m1_ctx_base; \
-            node_ctx = coeff_abs_level_transition[1][node_ctx]; \
-\
-            while( coeff_abs < 15 && get_cabac( CC, ctx ) ) { \
-                coeff_abs++; \
-            } \
-\
-            if( coeff_abs >= 15 ) { \
-                int j = 0; \
-                while( get_cabac_bypass( CC ) ) { \
-                    j++; \
-                } \
-\
-                coeff_abs=1; \
-                while( j-- ) { \
-                    coeff_abs += coeff_abs + get_cabac_bypass( CC ); \
-                } \
-                coeff_abs+= 14; \
-            } \
-\
-            if( is_dc ) { \
-                ((type*)block)[j] = get_cabac_bypass_sign( CC, -coeff_abs ); \
-            }else{ \
-                ((type*)block)[j] = ((int)(get_cabac_bypass_sign( CC, -coeff_abs ) * qmul[j] + 32)) >> 6; \
-            } \
-        } \
-    } while ( coeff_count );
-
-    if (h->pixel_shift) {
-        STORE_BLOCK(int32_t)
-    } else {
-        STORE_BLOCK(int16_t)
-    }
-#ifdef CABAC_ON_STACK
-            h->cabac.range     = cc.range     ;
-            h->cabac.low       = cc.low       ;
-            h->cabac.bytestream= cc.bytestream;
-#endif
-
-}
-
-static av_noinline void decode_cabac_residual_dc_internal(H264Context *h,
-                                                          int16_t *block,
-                                                          int cat, int n,
-                                                          const uint8_t *scantable,
-                                                          int max_coeff)
-{
-    decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 0);
-}
-
-static av_noinline void decode_cabac_residual_dc_internal_422(H264Context *h,
-                                                              int16_t *block,
-                                                              int cat, int n,
-                                                              const uint8_t *scantable,
-                                                              int max_coeff)
-{
-    decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 1);
-}
-
-static av_noinline void decode_cabac_residual_nondc_internal(H264Context *h,
-                                                             int16_t *block,
-                                                             int cat, int n,
-                                                             const uint8_t *scantable,
-                                                             const uint32_t *qmul,
-                                                             int max_coeff)
-{
-    decode_cabac_residual_internal(h, block, cat, n, scantable, qmul, max_coeff, 0, 0);
-}
-
-/* cat: 0-> DC 16x16  n = 0
- *      1-> AC 16x16  n = luma4x4idx
- *      2-> Luma4x4   n = luma4x4idx
- *      3-> DC Chroma n = iCbCr
- *      4-> AC Chroma n = 16 + 4 * iCbCr + chroma4x4idx
- *      5-> Luma8x8   n = 4 * luma8x8idx */
-
-/* Partially inline the CABAC residual decode: inline the coded block flag.
- * This has very little impact on binary size and improves performance
- * because it allows improved constant propagation into get_cabac_cbf_ctx,
- * as well as because most blocks have zero CBFs. */
-
-static av_always_inline void decode_cabac_residual_dc(H264Context *h,
-                                                      int16_t *block,
-                                                      int cat, int n,
-                                                      const uint8_t *scantable,
-                                                      int max_coeff)
-{
-    /* read coded block flag */
-    if( get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 1 ) ] ) == 0 ) {
-        h->non_zero_count_cache[scan8[n]] = 0;
-        return;
-    }
-    decode_cabac_residual_dc_internal( h, block, cat, n, scantable, max_coeff );
-}
-
-static av_always_inline void
-decode_cabac_residual_dc_422(H264Context *h, int16_t *block,
-                             int cat, int n, const uint8_t *scantable,
-                             int max_coeff)
-{
-    /* read coded block flag */
-    if (get_cabac(&h->cabac, &h->cabac_state[get_cabac_cbf_ctx(h, cat, n, max_coeff, 1)]) == 0) {
-        h->non_zero_count_cache[scan8[n]] = 0;
-        return;
-    }
-    decode_cabac_residual_dc_internal_422(h, block, cat, n, scantable, max_coeff);
-}
-
-static av_always_inline void decode_cabac_residual_nondc(H264Context *h,
-                                                         int16_t *block,
-                                                         int cat, int n,
-                                                         const uint8_t *scantable,
-                                                         const uint32_t *qmul,
-                                                         int max_coeff)
-{
-    /* read coded block flag */
-    if( (cat != 5 || CHROMA444(h)) && get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 0 ) ] ) == 0 ) {
-        if( max_coeff == 64 ) {
-            fill_rectangle(&h->non_zero_count_cache[scan8[n]], 2, 2, 8, 0, 1);
-        } else {
-            h->non_zero_count_cache[scan8[n]] = 0;
-        }
-        return;
-    }
-    decode_cabac_residual_nondc_internal( h, block, cat, n, scantable, qmul, max_coeff );
-}
-
-static av_always_inline void decode_cabac_luma_residual( H264Context *h, const uint8_t *scan, const uint8_t *scan8x8, int pixel_shift, int mb_type, int cbp, int p )
-{
-    static const uint8_t ctx_cat[4][3] = {{0,6,10},{1,7,11},{2,8,12},{5,9,13}};
-    const uint32_t *qmul;
-    int i8x8, i4x4;
-    int qscale = p == 0 ? h->qscale : h->chroma_qp[p-1];
-    if( IS_INTRA16x16( mb_type ) ) {
-        AV_ZERO128(h->mb_luma_dc[p]+0);
-        AV_ZERO128(h->mb_luma_dc[p]+8);
-        AV_ZERO128(h->mb_luma_dc[p]+16);
-        AV_ZERO128(h->mb_luma_dc[p]+24);
-        decode_cabac_residual_dc(h, h->mb_luma_dc[p], ctx_cat[0][p], LUMA_DC_BLOCK_INDEX+p, scan, 16);
-
-        if( cbp&15 ) {
-            qmul = h->dequant4_coeff[p][qscale];
-            for( i4x4 = 0; i4x4 < 16; i4x4++ ) {
-                const int index = 16*p + i4x4;
-                decode_cabac_residual_nondc(h, h->mb + (16*index << pixel_shift), ctx_cat[1][p], index, scan + 1, qmul, 15);
-            }
-        } else {
-            fill_rectangle(&h->non_zero_count_cache[scan8[16*p]], 4, 4, 8, 0, 1);
-        }
-    } else {
-        int cqm = (IS_INTRA( mb_type ) ? 0:3) + p;
-        for( i8x8 = 0; i8x8 < 4; i8x8++ ) {
-            if( cbp & (1<<i8x8) ) {
-                if( IS_8x8DCT(mb_type) ) {
-                    const int index = 16*p + 4*i8x8;
-                    decode_cabac_residual_nondc(h, h->mb + (16*index << pixel_shift), ctx_cat[3][p], index,
-                                                scan8x8, h->dequant8_coeff[cqm][qscale], 64);
-                } else {
-                    qmul = h->dequant4_coeff[cqm][qscale];
-                    for( i4x4 = 0; i4x4 < 4; i4x4++ ) {
-                        const int index = 16*p + 4*i8x8 + i4x4;
-//START_TIMER
-                        decode_cabac_residual_nondc(h, h->mb + (16*index << pixel_shift), ctx_cat[2][p], index, scan, qmul, 16);
-//STOP_TIMER("decode_residual")
-                    }
-                }
-            } else {
-                fill_rectangle(&h->non_zero_count_cache[scan8[4*i8x8+16*p]], 2, 2, 8, 0, 1);
-            }
-        }
-    }
-}
-
-/**
- * Decode a macroblock.
- * @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR if an error is noticed
- */
-int ff_h264_decode_mb_cabac(H264Context *h) {
-    int mb_xy;
-    int mb_type, partition_count, cbp = 0;
-    int dct8x8_allowed= h->pps.transform_8x8_mode;
-    int decode_chroma = h->sps.chroma_format_idc == 1 || h->sps.chroma_format_idc == 2;
-    const int pixel_shift = h->pixel_shift;
-
-    mb_xy = h->mb_xy = h->mb_x + h->mb_y*h->mb_stride;
-
-    tprintf(h->avctx, "pic:%d mb:%d/%d\n", h->frame_num, h->mb_x, h->mb_y);
-    if( h->slice_type_nos != AV_PICTURE_TYPE_I ) {
-        int skip;
-        /* a skipped mb needs the aff flag from the following mb */
-        if (FRAME_MBAFF(h) && (h->mb_y & 1) == 1 && h->prev_mb_skipped)
-            skip = h->next_mb_skipped;
-        else
-            skip = decode_cabac_mb_skip( h, h->mb_x, h->mb_y );
-        /* read skip flags */
-        if( skip ) {
-            if (FRAME_MBAFF(h) && (h->mb_y & 1) == 0) {
-                h->cur_pic.mb_type[mb_xy] = MB_TYPE_SKIP;
-                h->next_mb_skipped = decode_cabac_mb_skip( h, h->mb_x, h->mb_y+1 );
-                if(!h->next_mb_skipped)
-                    h->mb_mbaff = h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h);
-            }
-
-            decode_mb_skip(h);
-
-            h->cbp_table[mb_xy] = 0;
-            h->chroma_pred_mode_table[mb_xy] = 0;
-            h->last_qscale_diff = 0;
-
-            return 0;
-
-        }
-    }
-    if (FRAME_MBAFF(h)) {
-        if( (h->mb_y&1) == 0 )
-            h->mb_mbaff =
-            h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h);
-    }
-
-    h->prev_mb_skipped = 0;
-
-    fill_decode_neighbors(h, -(MB_FIELD(h)));
-
-    if( h->slice_type_nos == AV_PICTURE_TYPE_B ) {
-        int ctx = 0;
-        assert(h->slice_type_nos == AV_PICTURE_TYPE_B);
-
-        if( !IS_DIRECT( h->left_type[LTOP]-1 ) )
-            ctx++;
-        if( !IS_DIRECT( h->top_type-1 ) )
-            ctx++;
-
-        if( !get_cabac_noinline( &h->cabac, &h->cabac_state[27+ctx] ) ){
-            mb_type= 0; /* B_Direct_16x16 */
-        }else if( !get_cabac_noinline( &h->cabac, &h->cabac_state[27+3] ) ) {
-            mb_type= 1 + get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ); /* B_L[01]_16x16 */
-        }else{
-            int bits;
-            bits = get_cabac_noinline( &h->cabac, &h->cabac_state[27+4] ) << 3;
-            bits+= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 2;
-            bits+= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 1;
-            bits+= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] );
-            if( bits < 8 ){
-                mb_type= bits + 3; /* B_Bi_16x16 through B_L1_L0_16x8 */
-            }else if( bits == 13 ){
-                mb_type= decode_cabac_intra_mb_type(h, 32, 0);
-                goto decode_intra_mb;
-            }else if( bits == 14 ){
-                mb_type= 11; /* B_L1_L0_8x16 */
-            }else if( bits == 15 ){
-                mb_type= 22; /* B_8x8 */
-            }else{
-                bits= ( bits<<1 ) + get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] );
-                mb_type= bits - 4; /* B_L0_Bi_* through B_Bi_Bi_* */
-            }
-        }
-            partition_count= b_mb_type_info[mb_type].partition_count;
-            mb_type=         b_mb_type_info[mb_type].type;
-    } else if( h->slice_type_nos == AV_PICTURE_TYPE_P ) {
-        if( get_cabac_noinline( &h->cabac, &h->cabac_state[14] ) == 0 ) {
-            /* P-type */
-            if( get_cabac_noinline( &h->cabac, &h->cabac_state[15] ) == 0 ) {
-                /* P_L0_D16x16, P_8x8 */
-                mb_type= 3 * get_cabac_noinline( &h->cabac, &h->cabac_state[16] );
-            } else {
-                /* P_L0_D8x16, P_L0_D16x8 */
-                mb_type= 2 - get_cabac_noinline( &h->cabac, &h->cabac_state[17] );
-            }
-            partition_count= p_mb_type_info[mb_type].partition_count;
-            mb_type=         p_mb_type_info[mb_type].type;
-        } else {
-            mb_type= decode_cabac_intra_mb_type(h, 17, 0);
-            goto decode_intra_mb;
-        }
-    } else {
-        mb_type= decode_cabac_intra_mb_type(h, 3, 1);
-        if(h->slice_type == AV_PICTURE_TYPE_SI && mb_type)
-            mb_type--;
-        assert(h->slice_type_nos == AV_PICTURE_TYPE_I);
-decode_intra_mb:
-        partition_count = 0;
-        cbp= i_mb_type_info[mb_type].cbp;
-        h->intra16x16_pred_mode= i_mb_type_info[mb_type].pred_mode;
-        mb_type= i_mb_type_info[mb_type].type;
-    }
-    if(MB_FIELD(h))
-        mb_type |= MB_TYPE_INTERLACED;
-
-    h->slice_table[ mb_xy ]= h->slice_num;
-
-    if(IS_INTRA_PCM(mb_type)) {
-        const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] *
-                            h->sps.bit_depth_luma >> 3;
-        const uint8_t *ptr;
-
-        // We assume these blocks are very rare so we do not optimize it.
-        // FIXME The two following lines get the bitstream position in the cabac
-        // decode, I think it should be done by a function in cabac.h (or cabac.c).
-        ptr= h->cabac.bytestream;
-        if(h->cabac.low&0x1) ptr--;
-        if(CABAC_BITS==16){
-            if(h->cabac.low&0x1FF) ptr--;
-        }
-
-        // The pixels are stored in the same order as levels in h->mb array.
-        if ((int) (h->cabac.bytestream_end - ptr) < mb_size)
-            return -1;
-        h->intra_pcm_ptr = ptr;
-        ptr += mb_size;
-
-        ff_init_cabac_decoder(&h->cabac, ptr, h->cabac.bytestream_end - ptr);
-
-        // All blocks are present
-        h->cbp_table[mb_xy] = 0xf7ef;
-        h->chroma_pred_mode_table[mb_xy] = 0;
-        // In deblocking, the quantizer is 0
-        h->cur_pic.qscale_table[mb_xy] = 0;
-        // All coeffs are present
-        memset(h->non_zero_count[mb_xy], 16, 48);
-        h->cur_pic.mb_type[mb_xy] = mb_type;
-        h->last_qscale_diff = 0;
-        return 0;
-    }
-
-    fill_decode_caches(h, mb_type);
-
-    if( IS_INTRA( mb_type ) ) {
-        int i, pred_mode;
-        if( IS_INTRA4x4( mb_type ) ) {
-            if( dct8x8_allowed && get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] ) ) {
-                mb_type |= MB_TYPE_8x8DCT;
-                for( i = 0; i < 16; i+=4 ) {
-                    int pred = pred_intra_mode( h, i );
-                    int mode = decode_cabac_mb_intra4x4_pred_mode( h, pred );
-                    fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 );
-                }
-            } else {
-                for( i = 0; i < 16; i++ ) {
-                    int pred = pred_intra_mode( h, i );
-                    h->intra4x4_pred_mode_cache[ scan8[i] ] = decode_cabac_mb_intra4x4_pred_mode( h, pred );
-
-                    av_dlog(h->avctx, "i4x4 pred=%d mode=%d\n", pred,
-                            h->intra4x4_pred_mode_cache[scan8[i]]);
-                }
-            }
-            write_back_intra_pred_mode(h);
-            if( ff_h264_check_intra4x4_pred_mode(h) < 0 ) return -1;
-        } else {
-            h->intra16x16_pred_mode= ff_h264_check_intra_pred_mode( h, h->intra16x16_pred_mode, 0 );
-            if( h->intra16x16_pred_mode < 0 ) return -1;
-        }
-        if(decode_chroma){
-            h->chroma_pred_mode_table[mb_xy] =
-            pred_mode                        = decode_cabac_mb_chroma_pre_mode( h );
-
-            pred_mode= ff_h264_check_intra_pred_mode( h, pred_mode, 1 );
-            if( pred_mode < 0 ) return -1;
-            h->chroma_pred_mode= pred_mode;
-        } else {
-            h->chroma_pred_mode= DC_128_PRED8x8;
-        }
-    } else if( partition_count == 4 ) {
-        int i, j, sub_partition_count[4], list, ref[2][4];
-
-        if( h->slice_type_nos == AV_PICTURE_TYPE_B ) {
-            for( i = 0; i < 4; i++ ) {
-                h->sub_mb_type[i] = decode_cabac_b_mb_sub_type( h );
-                sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
-                h->sub_mb_type[i]=      b_sub_mb_type_info[ h->sub_mb_type[i] ].type;
-            }
-            if( IS_DIRECT(h->sub_mb_type[0] | h->sub_mb_type[1] |
-                          h->sub_mb_type[2] | h->sub_mb_type[3]) ) {
-                ff_h264_pred_direct_motion(h, &mb_type);
-                h->ref_cache[0][scan8[4]] =
-                h->ref_cache[1][scan8[4]] =
-                h->ref_cache[0][scan8[12]] =
-                h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE;
-                    for( i = 0; i < 4; i++ )
-                        fill_rectangle( &h->direct_cache[scan8[4*i]], 2, 2, 8, (h->sub_mb_type[i]>>1)&0xFF, 1 );
-            }
-        } else {
-            for( i = 0; i < 4; i++ ) {
-                h->sub_mb_type[i] = decode_cabac_p_mb_sub_type( h );
-                sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
-                h->sub_mb_type[i]=      p_sub_mb_type_info[ h->sub_mb_type[i] ].type;
-            }
-        }
-
-        for( list = 0; list < h->list_count; list++ ) {
-                for( i = 0; i < 4; i++ ) {
-                    if(IS_DIRECT(h->sub_mb_type[i])) continue;
-                    if(IS_DIR(h->sub_mb_type[i], 0, list)){
-                        int rc = h->ref_count[list] << MB_MBAFF(h);
-                        if (rc > 1) {
-                            ref[list][i] = decode_cabac_mb_ref( h, list, 4*i );
-                            if (ref[list][i] >= (unsigned) rc) {
-                                av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref[list][i], rc);
-                                return -1;
-                            }
-                        }else
-                            ref[list][i] = 0;
-                    } else {
-                        ref[list][i] = -1;
-                    }
-                                                       h->ref_cache[list][ scan8[4*i]+1 ]=
-                    h->ref_cache[list][ scan8[4*i]+8 ]=h->ref_cache[list][ scan8[4*i]+9 ]= ref[list][i];
-                }
-        }
-
-        if(dct8x8_allowed)
-            dct8x8_allowed = get_dct8x8_allowed(h);
-
-        for(list=0; list<h->list_count; list++){
-            for(i=0; i<4; i++){
-                h->ref_cache[list][ scan8[4*i]   ]=h->ref_cache[list][ scan8[4*i]+1 ];
-                if(IS_DIRECT(h->sub_mb_type[i])){
-                    fill_rectangle(h->mvd_cache[list][scan8[4*i]], 2, 2, 8, 0, 2);
-                    continue;
-                }
-
-                if(IS_DIR(h->sub_mb_type[i], 0, list) && !IS_DIRECT(h->sub_mb_type[i])){
-                    const int sub_mb_type= h->sub_mb_type[i];
-                    const int block_width= (sub_mb_type & (MB_TYPE_16x16|MB_TYPE_16x8)) ? 2 : 1;
-                    for(j=0; j<sub_partition_count[i]; j++){
-                        int mpx, mpy;
-                        int mx, my;
-                        const int index= 4*i + block_width*j;
-                        int16_t (* mv_cache)[2]= &h->mv_cache[list][ scan8[index] ];
-                        uint8_t (* mvd_cache)[2]= &h->mvd_cache[list][ scan8[index] ];
-                        pred_motion(h, index, block_width, list, h->ref_cache[list][ scan8[index] ], &mx, &my);
-                        DECODE_CABAC_MB_MVD( h, list, index)
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
-
-                        if(IS_SUB_8X8(sub_mb_type)){
-                            mv_cache[ 1 ][0]=
-                            mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx;
-                            mv_cache[ 1 ][1]=
-                            mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my;
-
-                            mvd_cache[ 1 ][0]=
-                            mvd_cache[ 8 ][0]= mvd_cache[ 9 ][0]= mpx;
-                            mvd_cache[ 1 ][1]=
-                            mvd_cache[ 8 ][1]= mvd_cache[ 9 ][1]= mpy;
-                        }else if(IS_SUB_8X4(sub_mb_type)){
-                            mv_cache[ 1 ][0]= mx;
-                            mv_cache[ 1 ][1]= my;
-
-                            mvd_cache[ 1 ][0]=  mpx;
-                            mvd_cache[ 1 ][1]= mpy;
-                        }else if(IS_SUB_4X8(sub_mb_type)){
-                            mv_cache[ 8 ][0]= mx;
-                            mv_cache[ 8 ][1]= my;
-
-                            mvd_cache[ 8 ][0]= mpx;
-                            mvd_cache[ 8 ][1]= mpy;
-                        }
-                        mv_cache[ 0 ][0]= mx;
-                        mv_cache[ 0 ][1]= my;
-
-                        mvd_cache[ 0 ][0]= mpx;
-                        mvd_cache[ 0 ][1]= mpy;
-                    }
-                }else{
-                    fill_rectangle(h->mv_cache [list][ scan8[4*i] ], 2, 2, 8, 0, 4);
-                    fill_rectangle(h->mvd_cache[list][ scan8[4*i] ], 2, 2, 8, 0, 2);
-                }
-            }
-        }
-    } else if( IS_DIRECT(mb_type) ) {
-        ff_h264_pred_direct_motion(h, &mb_type);
-        fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 2);
-        fill_rectangle(h->mvd_cache[1][scan8[0]], 4, 4, 8, 0, 2);
-        dct8x8_allowed &= h->sps.direct_8x8_inference_flag;
-    } else {
-        int list, i;
-        if(IS_16X16(mb_type)){
-            for(list=0; list<h->list_count; list++){
-                if(IS_DIR(mb_type, 0, list)){
-                    int ref, rc = h->ref_count[list] << MB_MBAFF(h);
-                    if (rc > 1) {
-                        ref= decode_cabac_mb_ref(h, list, 0);
-                        if (ref >= (unsigned) rc) {
-                            av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, rc);
-                            return -1;
-                        }
-                    }else
-                        ref=0;
-                        fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, ref, 1);
-                }
-            }
-            for(list=0; list<h->list_count; list++){
-                if(IS_DIR(mb_type, 0, list)){
-                    int mx,my,mpx,mpy;
-                    pred_motion(h, 0, 4, list, h->ref_cache[list][ scan8[0] ], &mx, &my);
-                    DECODE_CABAC_MB_MVD( h, list, 0)
-                    tprintf(h->avctx, "final mv:%d %d\n", mx, my);
-
-                    fill_rectangle(h->mvd_cache[list][ scan8[0] ], 4, 4, 8, pack8to16(mpx,mpy), 2);
-                    fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4);
-                }
-            }
-        }
-        else if(IS_16X8(mb_type)){
-            for(list=0; list<h->list_count; list++){
-                    for(i=0; i<2; i++){
-                        if(IS_DIR(mb_type, i, list)){
-                            int ref, rc = h->ref_count[list] << MB_MBAFF(h);
-                            if (rc > 1) {
-                                ref= decode_cabac_mb_ref( h, list, 8*i );
-                                if (ref >= (unsigned) rc) {
-                                    av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, rc);
-                                    return -1;
-                                }
-                            }else
-                                ref=0;
-                            fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, ref, 1);
-                        }else
-                            fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, (LIST_NOT_USED&0xFF), 1);
-                    }
-            }
-            for(list=0; list<h->list_count; list++){
-                for(i=0; i<2; i++){
-                    if(IS_DIR(mb_type, i, list)){
-                        int mx,my,mpx,mpy;
-                        pred_16x8_motion(h, 8*i, list, h->ref_cache[list][scan8[0] + 16*i], &mx, &my);
-                        DECODE_CABAC_MB_MVD( h, list, 8*i)
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
-
-                        fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack8to16(mpx,mpy), 2);
-                        fill_rectangle(h->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack16to32(mx,my), 4);
-                    }else{
-                        fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 2);
-                        fill_rectangle(h-> mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 4);
-                    }
-                }
-            }
-        }else{
-            assert(IS_8X16(mb_type));
-            for(list=0; list<h->list_count; list++){
-                    for(i=0; i<2; i++){
-                        if(IS_DIR(mb_type, i, list)){ //FIXME optimize
-                            int ref, rc = h->ref_count[list] << MB_MBAFF(h);
-                            if (rc > 1) {
-                                ref= decode_cabac_mb_ref( h, list, 4*i );
-                                if (ref >= (unsigned) rc) {
-                                    av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref, rc);
-                                    return -1;
-                                }
-                            }else
-                                ref=0;
-                            fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, ref, 1);
-                        }else
-                            fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, (LIST_NOT_USED&0xFF), 1);
-                    }
-            }
-            for(list=0; list<h->list_count; list++){
-                for(i=0; i<2; i++){
-                    if(IS_DIR(mb_type, i, list)){
-                        int mx,my,mpx,mpy;
-                        pred_8x16_motion(h, i*4, list, h->ref_cache[list][ scan8[0] + 2*i ], &mx, &my);
-                        DECODE_CABAC_MB_MVD( h, list, 4*i)
-
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
-                        fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack8to16(mpx,mpy), 2);
-                        fill_rectangle(h->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack16to32(mx,my), 4);
-                    }else{
-                        fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 2);
-                        fill_rectangle(h-> mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 4);
-                    }
-                }
-            }
-        }
-    }
-
-   if( IS_INTER( mb_type ) ) {
-        h->chroma_pred_mode_table[mb_xy] = 0;
-        write_back_motion( h, mb_type );
-   }
-
-    if( !IS_INTRA16x16( mb_type ) ) {
-        cbp  = decode_cabac_mb_cbp_luma( h );
-        if(decode_chroma)
-            cbp |= decode_cabac_mb_cbp_chroma( h ) << 4;
-    }
-
-    h->cbp_table[mb_xy] = h->cbp = cbp;
-
-    if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) {
-        mb_type |= MB_TYPE_8x8DCT * get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] );
-    }
-
-    /* It would be better to do this in fill_decode_caches, but we don't know
-     * the transform mode of the current macroblock there. */
-    if (CHROMA444(h) && IS_8x8DCT(mb_type)){
-        int i;
-        uint8_t *nnz_cache = h->non_zero_count_cache;
-        for (i = 0; i < 2; i++){
-            if (h->left_type[LEFT(i)] && !IS_8x8DCT(h->left_type[LEFT(i)])){
-                nnz_cache[3+8* 1 + 2*8*i]=
-                nnz_cache[3+8* 2 + 2*8*i]=
-                nnz_cache[3+8* 6 + 2*8*i]=
-                nnz_cache[3+8* 7 + 2*8*i]=
-                nnz_cache[3+8*11 + 2*8*i]=
-                nnz_cache[3+8*12 + 2*8*i]= IS_INTRA(mb_type) ? 64 : 0;
-            }
-        }
-        if (h->top_type && !IS_8x8DCT(h->top_type)){
-            uint32_t top_empty = CABAC(h) && !IS_INTRA(mb_type) ? 0 : 0x40404040;
-            AV_WN32A(&nnz_cache[4+8* 0], top_empty);
-            AV_WN32A(&nnz_cache[4+8* 5], top_empty);
-            AV_WN32A(&nnz_cache[4+8*10], top_empty);
-        }
-    }
-    h->cur_pic.mb_type[mb_xy] = mb_type;
-
-    if( cbp || IS_INTRA16x16( mb_type ) ) {
-        const uint8_t *scan, *scan8x8;
-        const uint32_t *qmul;
-
-        if(IS_INTERLACED(mb_type)){
-            scan8x8= h->qscale ? h->field_scan8x8 : h->field_scan8x8_q0;
-            scan= h->qscale ? h->field_scan : h->field_scan_q0;
-        }else{
-            scan8x8= h->qscale ? h->zigzag_scan8x8 : h->zigzag_scan8x8_q0;
-            scan= h->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
-        }
-
-        // decode_cabac_mb_dqp
-        if(get_cabac_noinline( &h->cabac, &h->cabac_state[60 + (h->last_qscale_diff != 0)])){
-            int val = 1;
-            int ctx= 2;
-            const int max_qp = 51 + 6*(h->sps.bit_depth_luma-8);
-
-            while( get_cabac_noinline( &h->cabac, &h->cabac_state[60 + ctx] ) ) {
-                ctx= 3;
-                val++;
-                if(val > 2*max_qp){ //prevent infinite loop
-                    av_log(h->avctx, AV_LOG_ERROR, "cabac decode of qscale diff failed at %d %d\n", h->mb_x, h->mb_y);
-                    return -1;
-                }
-            }
-
-            if( val&0x01 )
-                val=   (val + 1)>>1 ;
-            else
-                val= -((val + 1)>>1);
-            h->last_qscale_diff = val;
-            h->qscale += val;
-            if(((unsigned)h->qscale) > max_qp){
-                if(h->qscale<0) h->qscale+= max_qp+1;
-                else            h->qscale-= max_qp+1;
-            }
-            h->chroma_qp[0] = get_chroma_qp(h, 0, h->qscale);
-            h->chroma_qp[1] = get_chroma_qp(h, 1, h->qscale);
-        }else
-            h->last_qscale_diff=0;
-
-        decode_cabac_luma_residual(h, scan, scan8x8, pixel_shift, mb_type, cbp, 0);
-        if (CHROMA444(h)) {
-            decode_cabac_luma_residual(h, scan, scan8x8, pixel_shift, mb_type, cbp, 1);
-            decode_cabac_luma_residual(h, scan, scan8x8, pixel_shift, mb_type, cbp, 2);
-        } else if (CHROMA422(h)) {
-            if( cbp&0x30 ){
-                int c;
-                for (c = 0; c < 2; c++)
-                    decode_cabac_residual_dc_422(h, h->mb + ((256 + 16*16*c) << pixel_shift), 3,
-                                                 CHROMA_DC_BLOCK_INDEX + c,
-                                                 chroma422_dc_scan, 8);
-            }
-
-            if( cbp&0x20 ) {
-                int c, i, i8x8;
-                for( c = 0; c < 2; c++ ) {
-                    int16_t *mb = h->mb + (16*(16 + 16*c) << pixel_shift);
-                    qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[c]];
-                    for (i8x8 = 0; i8x8 < 2; i8x8++) {
-                        for (i = 0; i < 4; i++) {
-                            const int index = 16 + 16 * c + 8*i8x8 + i;
-                            decode_cabac_residual_nondc(h, mb, 4, index, scan + 1, qmul, 15);
-                            mb += 16<<pixel_shift;
-                        }
-                    }
-                }
-            } else {
-                fill_rectangle(&h->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
-                fill_rectangle(&h->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
-            }
-        } else /* yuv420 */ {
-            if( cbp&0x30 ){
-                int c;
-                for (c = 0; c < 2; c++)
-                    decode_cabac_residual_dc(h, h->mb + ((256 + 16*16*c) << pixel_shift), 3, CHROMA_DC_BLOCK_INDEX+c, chroma_dc_scan, 4);
-            }
-
-            if( cbp&0x20 ) {
-                int c, i;
-                for( c = 0; c < 2; c++ ) {
-                    qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[c]];
-                    for( i = 0; i < 4; i++ ) {
-                        const int index = 16 + 16 * c + i;
-                        decode_cabac_residual_nondc(h, h->mb + (16*index << pixel_shift), 4, index, scan + 1, qmul, 15);
-                    }
-                }
-            } else {
-                fill_rectangle(&h->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
-                fill_rectangle(&h->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
-            }
-        }
-    } else {
-        fill_rectangle(&h->non_zero_count_cache[scan8[ 0]], 4, 4, 8, 0, 1);
-        fill_rectangle(&h->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
-        fill_rectangle(&h->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
-        h->last_qscale_diff = 0;
-    }
-
-    h->cur_pic.qscale_table[mb_xy] = h->qscale;
-    write_back_non_zero_count(h);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/h264_cavlc.c b/deps/libav/libavcodec/h264_cavlc.c
deleted file mode 100644
index d3f6dcb..0000000
--- a/deps/libav/libavcodec/h264_cavlc.c
+++ /dev/null
@@ -1,1178 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... cavlc bitstream decoding
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 cavlc bitstream decoding.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#define CABAC(h) 0
-
-#include "internal.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h264.h"
-#include "h264data.h" // FIXME FIXME FIXME
-#include "h264_mvpred.h"
-#include "golomb.h"
-
-#include <assert.h>
-
-static const uint8_t golomb_to_inter_cbp_gray[16]={
- 0, 1, 2, 4, 8, 3, 5,10,12,15, 7,11,13,14, 6, 9,
-};
-
-static const uint8_t golomb_to_intra4x4_cbp_gray[16]={
-15, 0, 7,11,13,14, 3, 5,10,12, 1, 2, 4, 8, 6, 9,
-};
-
-static const uint8_t chroma_dc_coeff_token_len[4*5]={
- 2, 0, 0, 0,
- 6, 1, 0, 0,
- 6, 6, 3, 0,
- 6, 7, 7, 6,
- 6, 8, 8, 7,
-};
-
-static const uint8_t chroma_dc_coeff_token_bits[4*5]={
- 1, 0, 0, 0,
- 7, 1, 0, 0,
- 4, 6, 1, 0,
- 3, 3, 2, 5,
- 2, 3, 2, 0,
-};
-
-static const uint8_t chroma422_dc_coeff_token_len[4*9]={
-  1,  0,  0,  0,
-  7,  2,  0,  0,
-  7,  7,  3,  0,
-  9,  7,  7,  5,
-  9,  9,  7,  6,
- 10, 10,  9,  7,
- 11, 11, 10,  7,
- 12, 12, 11, 10,
- 13, 12, 12, 11,
-};
-
-static const uint8_t chroma422_dc_coeff_token_bits[4*9]={
-  1,   0,  0, 0,
- 15,   1,  0, 0,
- 14,  13,  1, 0,
-  7,  12, 11, 1,
-  6,   5, 10, 1,
-  7,   6,  4, 9,
-  7,   6,  5, 8,
-  7,   6,  5, 4,
-  7,   5,  4, 4,
-};
-
-static const uint8_t coeff_token_len[4][4*17]={
-{
-     1, 0, 0, 0,
-     6, 2, 0, 0,     8, 6, 3, 0,     9, 8, 7, 5,    10, 9, 8, 6,
-    11,10, 9, 7,    13,11,10, 8,    13,13,11, 9,    13,13,13,10,
-    14,14,13,11,    14,14,14,13,    15,15,14,14,    15,15,15,14,
-    16,15,15,15,    16,16,16,15,    16,16,16,16,    16,16,16,16,
-},
-{
-     2, 0, 0, 0,
-     6, 2, 0, 0,     6, 5, 3, 0,     7, 6, 6, 4,     8, 6, 6, 4,
-     8, 7, 7, 5,     9, 8, 8, 6,    11, 9, 9, 6,    11,11,11, 7,
-    12,11,11, 9,    12,12,12,11,    12,12,12,11,    13,13,13,12,
-    13,13,13,13,    13,14,13,13,    14,14,14,13,    14,14,14,14,
-},
-{
-     4, 0, 0, 0,
-     6, 4, 0, 0,     6, 5, 4, 0,     6, 5, 5, 4,     7, 5, 5, 4,
-     7, 5, 5, 4,     7, 6, 6, 4,     7, 6, 6, 4,     8, 7, 7, 5,
-     8, 8, 7, 6,     9, 8, 8, 7,     9, 9, 8, 8,     9, 9, 9, 8,
-    10, 9, 9, 9,    10,10,10,10,    10,10,10,10,    10,10,10,10,
-},
-{
-     6, 0, 0, 0,
-     6, 6, 0, 0,     6, 6, 6, 0,     6, 6, 6, 6,     6, 6, 6, 6,
-     6, 6, 6, 6,     6, 6, 6, 6,     6, 6, 6, 6,     6, 6, 6, 6,
-     6, 6, 6, 6,     6, 6, 6, 6,     6, 6, 6, 6,     6, 6, 6, 6,
-     6, 6, 6, 6,     6, 6, 6, 6,     6, 6, 6, 6,     6, 6, 6, 6,
-}
-};
-
-static const uint8_t coeff_token_bits[4][4*17]={
-{
-     1, 0, 0, 0,
-     5, 1, 0, 0,     7, 4, 1, 0,     7, 6, 5, 3,     7, 6, 5, 3,
-     7, 6, 5, 4,    15, 6, 5, 4,    11,14, 5, 4,     8,10,13, 4,
-    15,14, 9, 4,    11,10,13,12,    15,14, 9,12,    11,10,13, 8,
-    15, 1, 9,12,    11,14,13, 8,     7,10, 9,12,     4, 6, 5, 8,
-},
-{
-     3, 0, 0, 0,
-    11, 2, 0, 0,     7, 7, 3, 0,     7,10, 9, 5,     7, 6, 5, 4,
-     4, 6, 5, 6,     7, 6, 5, 8,    15, 6, 5, 4,    11,14,13, 4,
-    15,10, 9, 4,    11,14,13,12,     8,10, 9, 8,    15,14,13,12,
-    11,10, 9,12,     7,11, 6, 8,     9, 8,10, 1,     7, 6, 5, 4,
-},
-{
-    15, 0, 0, 0,
-    15,14, 0, 0,    11,15,13, 0,     8,12,14,12,    15,10,11,11,
-    11, 8, 9,10,     9,14,13, 9,     8,10, 9, 8,    15,14,13,13,
-    11,14,10,12,    15,10,13,12,    11,14, 9,12,     8,10,13, 8,
-    13, 7, 9,12,     9,12,11,10,     5, 8, 7, 6,     1, 4, 3, 2,
-},
-{
-     3, 0, 0, 0,
-     0, 1, 0, 0,     4, 5, 6, 0,     8, 9,10,11,    12,13,14,15,
-    16,17,18,19,    20,21,22,23,    24,25,26,27,    28,29,30,31,
-    32,33,34,35,    36,37,38,39,    40,41,42,43,    44,45,46,47,
-    48,49,50,51,    52,53,54,55,    56,57,58,59,    60,61,62,63,
-}
-};
-
-static const uint8_t total_zeros_len[16][16]= {
-    {1,3,3,4,4,5,5,6,6,7,7,8,8,9,9,9},
-    {3,3,3,3,3,4,4,4,4,5,5,6,6,6,6},
-    {4,3,3,3,4,4,3,3,4,5,5,6,5,6},
-    {5,3,4,4,3,3,3,4,3,4,5,5,5},
-    {4,4,4,3,3,3,3,3,4,5,4,5},
-    {6,5,3,3,3,3,3,3,4,3,6},
-    {6,5,3,3,3,2,3,4,3,6},
-    {6,4,5,3,2,2,3,3,6},
-    {6,6,4,2,2,3,2,5},
-    {5,5,3,2,2,2,4},
-    {4,4,3,3,1,3},
-    {4,4,2,1,3},
-    {3,3,1,2},
-    {2,2,1},
-    {1,1},
-};
-
-static const uint8_t total_zeros_bits[16][16]= {
-    {1,3,2,3,2,3,2,3,2,3,2,3,2,3,2,1},
-    {7,6,5,4,3,5,4,3,2,3,2,3,2,1,0},
-    {5,7,6,5,4,3,4,3,2,3,2,1,1,0},
-    {3,7,5,4,6,5,4,3,3,2,2,1,0},
-    {5,4,3,7,6,5,4,3,2,1,1,0},
-    {1,1,7,6,5,4,3,2,1,1,0},
-    {1,1,5,4,3,3,2,1,1,0},
-    {1,1,1,3,3,2,2,1,0},
-    {1,0,1,3,2,1,1,1},
-    {1,0,1,3,2,1,1},
-    {0,1,1,2,1,3},
-    {0,1,1,1,1},
-    {0,1,1,1},
-    {0,1,1},
-    {0,1},
-};
-
-static const uint8_t chroma_dc_total_zeros_len[3][4]= {
-    { 1, 2, 3, 3,},
-    { 1, 2, 2, 0,},
-    { 1, 1, 0, 0,},
-};
-
-static const uint8_t chroma_dc_total_zeros_bits[3][4]= {
-    { 1, 1, 1, 0,},
-    { 1, 1, 0, 0,},
-    { 1, 0, 0, 0,},
-};
-
-static const uint8_t chroma422_dc_total_zeros_len[7][8]= {
-    { 1, 3, 3, 4, 4, 4, 5, 5 },
-    { 3, 2, 3, 3, 3, 3, 3 },
-    { 3, 3, 2, 2, 3, 3 },
-    { 3, 2, 2, 2, 3 },
-    { 2, 2, 2, 2 },
-    { 2, 2, 1 },
-    { 1, 1 },
-};
-
-static const uint8_t chroma422_dc_total_zeros_bits[7][8]= {
-    { 1, 2, 3, 2, 3, 1, 1, 0 },
-    { 0, 1, 1, 4, 5, 6, 7 },
-    { 0, 1, 1, 2, 6, 7 },
-    { 6, 0, 1, 2, 7 },
-    { 0, 1, 2, 3 },
-    { 0, 1, 1 },
-    { 0, 1 },
-};
-
-static const uint8_t run_len[7][16]={
-    {1,1},
-    {1,2,2},
-    {2,2,2,2},
-    {2,2,2,3,3},
-    {2,2,3,3,3,3},
-    {2,3,3,3,3,3,3},
-    {3,3,3,3,3,3,3,4,5,6,7,8,9,10,11},
-};
-
-static const uint8_t run_bits[7][16]={
-    {1,0},
-    {1,1,0},
-    {3,2,1,0},
-    {3,2,1,1,0},
-    {3,2,3,2,1,0},
-    {3,0,1,3,2,5,4},
-    {7,6,5,4,3,2,1,1,1,1,1,1,1,1,1},
-};
-
-static VLC coeff_token_vlc[4];
-static VLC_TYPE coeff_token_vlc_tables[520+332+280+256][2];
-static const int coeff_token_vlc_tables_size[4]={520,332,280,256};
-
-static VLC chroma_dc_coeff_token_vlc;
-static VLC_TYPE chroma_dc_coeff_token_vlc_table[256][2];
-static const int chroma_dc_coeff_token_vlc_table_size = 256;
-
-static VLC chroma422_dc_coeff_token_vlc;
-static VLC_TYPE chroma422_dc_coeff_token_vlc_table[8192][2];
-static const int chroma422_dc_coeff_token_vlc_table_size = 8192;
-
-static VLC total_zeros_vlc[15];
-static VLC_TYPE total_zeros_vlc_tables[15][512][2];
-static const int total_zeros_vlc_tables_size = 512;
-
-static VLC chroma_dc_total_zeros_vlc[3];
-static VLC_TYPE chroma_dc_total_zeros_vlc_tables[3][8][2];
-static const int chroma_dc_total_zeros_vlc_tables_size = 8;
-
-static VLC chroma422_dc_total_zeros_vlc[7];
-static VLC_TYPE chroma422_dc_total_zeros_vlc_tables[7][32][2];
-static const int chroma422_dc_total_zeros_vlc_tables_size = 32;
-
-static VLC run_vlc[6];
-static VLC_TYPE run_vlc_tables[6][8][2];
-static const int run_vlc_tables_size = 8;
-
-static VLC run7_vlc;
-static VLC_TYPE run7_vlc_table[96][2];
-static const int run7_vlc_table_size = 96;
-
-#define LEVEL_TAB_BITS 8
-static int8_t cavlc_level_tab[7][1<<LEVEL_TAB_BITS][2];
-
-#define CHROMA_DC_COEFF_TOKEN_VLC_BITS 8
-#define CHROMA422_DC_COEFF_TOKEN_VLC_BITS 13
-#define COEFF_TOKEN_VLC_BITS           8
-#define TOTAL_ZEROS_VLC_BITS           9
-#define CHROMA_DC_TOTAL_ZEROS_VLC_BITS 3
-#define CHROMA422_DC_TOTAL_ZEROS_VLC_BITS 5
-#define RUN_VLC_BITS                   3
-#define RUN7_VLC_BITS                  6
-
-/**
- * Get the predicted number of non-zero coefficients.
- * @param n block index
- */
-static inline int pred_non_zero_count(H264Context *h, int n){
-    const int index8= scan8[n];
-    const int left= h->non_zero_count_cache[index8 - 1];
-    const int top = h->non_zero_count_cache[index8 - 8];
-    int i= left + top;
-
-    if(i<64) i= (i+1)>>1;
-
-    tprintf(h->avctx, "pred_nnz L%X T%X n%d s%d P%X\n", left, top, n, scan8[n], i&31);
-
-    return i&31;
-}
-
-static av_cold void init_cavlc_level_tab(void){
-    int suffix_length;
-    unsigned int i;
-
-    for(suffix_length=0; suffix_length<7; suffix_length++){
-        for(i=0; i<(1<<LEVEL_TAB_BITS); i++){
-            int prefix= LEVEL_TAB_BITS - av_log2(2*i);
-
-            if(prefix + 1 + suffix_length <= LEVEL_TAB_BITS){
-                int level_code = (prefix << suffix_length) +
-                    (i >> (av_log2(i) - suffix_length)) - (1 << suffix_length);
-                int mask = -(level_code&1);
-                level_code = (((2 + level_code) >> 1) ^ mask) - mask;
-                cavlc_level_tab[suffix_length][i][0]= level_code;
-                cavlc_level_tab[suffix_length][i][1]= prefix + 1 + suffix_length;
-            }else if(prefix + 1 <= LEVEL_TAB_BITS){
-                cavlc_level_tab[suffix_length][i][0]= prefix+100;
-                cavlc_level_tab[suffix_length][i][1]= prefix + 1;
-            }else{
-                cavlc_level_tab[suffix_length][i][0]= LEVEL_TAB_BITS+100;
-                cavlc_level_tab[suffix_length][i][1]= LEVEL_TAB_BITS;
-            }
-        }
-    }
-}
-
-av_cold void ff_h264_decode_init_vlc(void){
-    static int done = 0;
-
-    if (!done) {
-        int i;
-        int offset;
-        done = 1;
-
-        chroma_dc_coeff_token_vlc.table = chroma_dc_coeff_token_vlc_table;
-        chroma_dc_coeff_token_vlc.table_allocated = chroma_dc_coeff_token_vlc_table_size;
-        init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5,
-                 &chroma_dc_coeff_token_len [0], 1, 1,
-                 &chroma_dc_coeff_token_bits[0], 1, 1,
-                 INIT_VLC_USE_NEW_STATIC);
-
-        chroma422_dc_coeff_token_vlc.table = chroma422_dc_coeff_token_vlc_table;
-        chroma422_dc_coeff_token_vlc.table_allocated = chroma422_dc_coeff_token_vlc_table_size;
-        init_vlc(&chroma422_dc_coeff_token_vlc, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 4*9,
-                 &chroma422_dc_coeff_token_len [0], 1, 1,
-                 &chroma422_dc_coeff_token_bits[0], 1, 1,
-                 INIT_VLC_USE_NEW_STATIC);
-
-        offset = 0;
-        for(i=0; i<4; i++){
-            coeff_token_vlc[i].table = coeff_token_vlc_tables+offset;
-            coeff_token_vlc[i].table_allocated = coeff_token_vlc_tables_size[i];
-            init_vlc(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17,
-                     &coeff_token_len [i][0], 1, 1,
-                     &coeff_token_bits[i][0], 1, 1,
-                     INIT_VLC_USE_NEW_STATIC);
-            offset += coeff_token_vlc_tables_size[i];
-        }
-        /*
-         * This is a one time safety check to make sure that
-         * the packed static coeff_token_vlc table sizes
-         * were initialized correctly.
-         */
-        assert(offset == FF_ARRAY_ELEMS(coeff_token_vlc_tables));
-
-        for(i=0; i<3; i++){
-            chroma_dc_total_zeros_vlc[i].table = chroma_dc_total_zeros_vlc_tables[i];
-            chroma_dc_total_zeros_vlc[i].table_allocated = chroma_dc_total_zeros_vlc_tables_size;
-            init_vlc(&chroma_dc_total_zeros_vlc[i],
-                     CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 4,
-                     &chroma_dc_total_zeros_len [i][0], 1, 1,
-                     &chroma_dc_total_zeros_bits[i][0], 1, 1,
-                     INIT_VLC_USE_NEW_STATIC);
-        }
-
-        for(i=0; i<7; i++){
-            chroma422_dc_total_zeros_vlc[i].table = chroma422_dc_total_zeros_vlc_tables[i];
-            chroma422_dc_total_zeros_vlc[i].table_allocated = chroma422_dc_total_zeros_vlc_tables_size;
-            init_vlc(&chroma422_dc_total_zeros_vlc[i],
-                     CHROMA422_DC_TOTAL_ZEROS_VLC_BITS, 8,
-                     &chroma422_dc_total_zeros_len [i][0], 1, 1,
-                     &chroma422_dc_total_zeros_bits[i][0], 1, 1,
-                     INIT_VLC_USE_NEW_STATIC);
-        }
-
-        for(i=0; i<15; i++){
-            total_zeros_vlc[i].table = total_zeros_vlc_tables[i];
-            total_zeros_vlc[i].table_allocated = total_zeros_vlc_tables_size;
-            init_vlc(&total_zeros_vlc[i],
-                     TOTAL_ZEROS_VLC_BITS, 16,
-                     &total_zeros_len [i][0], 1, 1,
-                     &total_zeros_bits[i][0], 1, 1,
-                     INIT_VLC_USE_NEW_STATIC);
-        }
-
-        for(i=0; i<6; i++){
-            run_vlc[i].table = run_vlc_tables[i];
-            run_vlc[i].table_allocated = run_vlc_tables_size;
-            init_vlc(&run_vlc[i],
-                     RUN_VLC_BITS, 7,
-                     &run_len [i][0], 1, 1,
-                     &run_bits[i][0], 1, 1,
-                     INIT_VLC_USE_NEW_STATIC);
-        }
-        run7_vlc.table = run7_vlc_table,
-        run7_vlc.table_allocated = run7_vlc_table_size;
-        init_vlc(&run7_vlc, RUN7_VLC_BITS, 16,
-                 &run_len [6][0], 1, 1,
-                 &run_bits[6][0], 1, 1,
-                 INIT_VLC_USE_NEW_STATIC);
-
-        init_cavlc_level_tab();
-    }
-}
-
-/**
- *
- */
-static inline int get_level_prefix(GetBitContext *gb){
-    unsigned int buf;
-    int log;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-    buf=GET_CACHE(re, gb);
-
-    log= 32 - av_log2(buf);
-#ifdef TRACE
-    print_bin(buf>>(32-log), log);
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d lpr @%5d in %s get_level_prefix\n", buf>>(32-log), log, log-1, get_bits_count(gb), __FILE__);
-#endif
-
-    LAST_SKIP_BITS(re, gb, log);
-    CLOSE_READER(re, gb);
-
-    return log-1;
-}
-
-/**
- * Decode a residual block.
- * @param n block index
- * @param scantable scantable
- * @param max_coeff number of coefficients in the block
- * @return <0 if an error occurred
- */
-static int decode_residual(H264Context *h, GetBitContext *gb, int16_t *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){
-    static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3};
-    int level[16];
-    int zeros_left, coeff_token, total_coeff, i, trailing_ones, run_before;
-
-    //FIXME put trailing_onex into the context
-
-    if(max_coeff <= 8){
-        if (max_coeff == 4)
-            coeff_token = get_vlc2(gb, chroma_dc_coeff_token_vlc.table, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 1);
-        else
-            coeff_token = get_vlc2(gb, chroma422_dc_coeff_token_vlc.table, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 1);
-        total_coeff= coeff_token>>2;
-    }else{
-        if(n >= LUMA_DC_BLOCK_INDEX){
-            total_coeff= pred_non_zero_count(h, (n - LUMA_DC_BLOCK_INDEX)*16);
-            coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2);
-            total_coeff= coeff_token>>2;
-        }else{
-            total_coeff= pred_non_zero_count(h, n);
-            coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2);
-            total_coeff= coeff_token>>2;
-        }
-    }
-    h->non_zero_count_cache[ scan8[n] ]= total_coeff;
-
-    //FIXME set last_non_zero?
-
-    if(total_coeff==0)
-        return 0;
-    if(total_coeff > (unsigned)max_coeff) {
-        av_log(h->avctx, AV_LOG_ERROR, "corrupted macroblock %d %d (total_coeff=%d)\n", h->mb_x, h->mb_y, total_coeff);
-        return -1;
-    }
-
-    trailing_ones= coeff_token&3;
-    tprintf(h->avctx, "trailing:%d, total:%d\n", trailing_ones, total_coeff);
-    assert(total_coeff<=16);
-
-    i = show_bits(gb, 3);
-    skip_bits(gb, trailing_ones);
-    level[0] = 1-((i&4)>>1);
-    level[1] = 1-((i&2)   );
-    level[2] = 1-((i&1)<<1);
-
-    if(trailing_ones<total_coeff) {
-        int mask, prefix;
-        int suffix_length = total_coeff > 10 & trailing_ones < 3;
-        int bitsi= show_bits(gb, LEVEL_TAB_BITS);
-        int level_code= cavlc_level_tab[suffix_length][bitsi][0];
-
-        skip_bits(gb, cavlc_level_tab[suffix_length][bitsi][1]);
-        if(level_code >= 100){
-            prefix= level_code - 100;
-            if(prefix == LEVEL_TAB_BITS)
-                prefix += get_level_prefix(gb);
-
-            //first coefficient has suffix_length equal to 0 or 1
-            if(prefix<14){ //FIXME try to build a large unified VLC table for all this
-                if(suffix_length)
-                    level_code= (prefix<<1) + get_bits1(gb); //part
-                else
-                    level_code= prefix; //part
-            }else if(prefix==14){
-                if(suffix_length)
-                    level_code= (prefix<<1) + get_bits1(gb); //part
-                else
-                    level_code= prefix + get_bits(gb, 4); //part
-            }else{
-                level_code= 30 + get_bits(gb, prefix-3); //part
-                if(prefix>=16){
-                    if(prefix > 25+3){
-                        av_log(h->avctx, AV_LOG_ERROR, "Invalid level prefix\n");
-                        return -1;
-                    }
-                    level_code += (1<<(prefix-3))-4096;
-                }
-            }
-
-            if(trailing_ones < 3) level_code += 2;
-
-            suffix_length = 2;
-            mask= -(level_code&1);
-            level[trailing_ones]= (((2+level_code)>>1) ^ mask) - mask;
-        }else{
-            level_code += ((level_code>>31)|1) & -(trailing_ones < 3);
-
-            suffix_length = 1 + (level_code + 3U > 6U);
-            level[trailing_ones]= level_code;
-        }
-
-        //remaining coefficients have suffix_length > 0
-        for(i=trailing_ones+1;i<total_coeff;i++) {
-            static const unsigned int suffix_limit[7] = {0,3,6,12,24,48,INT_MAX };
-            int bitsi= show_bits(gb, LEVEL_TAB_BITS);
-            level_code= cavlc_level_tab[suffix_length][bitsi][0];
-
-            skip_bits(gb, cavlc_level_tab[suffix_length][bitsi][1]);
-            if(level_code >= 100){
-                prefix= level_code - 100;
-                if(prefix == LEVEL_TAB_BITS){
-                    prefix += get_level_prefix(gb);
-                }
-                if(prefix<15){
-                    level_code = (prefix<<suffix_length) + get_bits(gb, suffix_length);
-                }else{
-                    level_code = (15<<suffix_length) + get_bits(gb, prefix-3);
-                    if(prefix>=16)
-                        level_code += (1<<(prefix-3))-4096;
-                }
-                mask= -(level_code&1);
-                level_code= (((2+level_code)>>1) ^ mask) - mask;
-            }
-            level[i]= level_code;
-            suffix_length+= suffix_limit[suffix_length] + level_code > 2U*suffix_limit[suffix_length];
-        }
-    }
-
-    if(total_coeff == max_coeff)
-        zeros_left=0;
-    else{
-        if (max_coeff <= 8) {
-            if (max_coeff == 4)
-                zeros_left = get_vlc2(gb, chroma_dc_total_zeros_vlc[total_coeff - 1].table,
-                                      CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1);
-            else
-                zeros_left = get_vlc2(gb, chroma422_dc_total_zeros_vlc[total_coeff - 1].table,
-                                      CHROMA422_DC_TOTAL_ZEROS_VLC_BITS, 1);
-        } else {
-            zeros_left= get_vlc2(gb, total_zeros_vlc[total_coeff - 1].table, TOTAL_ZEROS_VLC_BITS, 1);
-        }
-    }
-
-#define STORE_BLOCK(type) \
-    scantable += zeros_left + total_coeff - 1; \
-    if(n >= LUMA_DC_BLOCK_INDEX){ \
-        ((type*)block)[*scantable] = level[0]; \
-        for(i=1;i<total_coeff && zeros_left > 0;i++) { \
-            if(zeros_left < 7) \
-                run_before= get_vlc2(gb, run_vlc[zeros_left - 1].table, RUN_VLC_BITS, 1); \
-            else \
-                run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); \
-            zeros_left -= run_before; \
-            scantable -= 1 + run_before; \
-            ((type*)block)[*scantable]= level[i]; \
-        } \
-        for(;i<total_coeff;i++) { \
-            scantable--; \
-            ((type*)block)[*scantable]= level[i]; \
-        } \
-    }else{ \
-        ((type*)block)[*scantable] = ((int)(level[0] * qmul[*scantable] + 32))>>6; \
-        for(i=1;i<total_coeff && zeros_left > 0;i++) { \
-            if(zeros_left < 7) \
-                run_before= get_vlc2(gb, run_vlc[zeros_left - 1].table, RUN_VLC_BITS, 1); \
-            else \
-                run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); \
-            zeros_left -= run_before; \
-            scantable -= 1 + run_before; \
-            ((type*)block)[*scantable]= ((int)(level[i] * qmul[*scantable] + 32))>>6; \
-        } \
-        for(;i<total_coeff;i++) { \
-            scantable--; \
-            ((type*)block)[*scantable]= ((int)(level[i] * qmul[*scantable] + 32))>>6; \
-        } \
-    }
-
-    if (zeros_left < 0) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "negative number of zero coeffs at %d %d\n", h->mb_x, h->mb_y);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (h->pixel_shift) {
-        STORE_BLOCK(int32_t)
-    } else {
-        STORE_BLOCK(int16_t)
-    }
-
-    return 0;
-}
-
-static av_always_inline int decode_luma_residual(H264Context *h, GetBitContext *gb, const uint8_t *scan, const uint8_t *scan8x8, int pixel_shift, int mb_type, int cbp, int p){
-    int i4x4, i8x8;
-    int qscale = p == 0 ? h->qscale : h->chroma_qp[p-1];
-    if(IS_INTRA16x16(mb_type)){
-        AV_ZERO128(h->mb_luma_dc[p]+0);
-        AV_ZERO128(h->mb_luma_dc[p]+8);
-        AV_ZERO128(h->mb_luma_dc[p]+16);
-        AV_ZERO128(h->mb_luma_dc[p]+24);
-        if( decode_residual(h, h->intra_gb_ptr, h->mb_luma_dc[p], LUMA_DC_BLOCK_INDEX+p, scan, NULL, 16) < 0){
-            return -1; //FIXME continue if partitioned and other return -1 too
-        }
-
-        assert((cbp&15) == 0 || (cbp&15) == 15);
-
-        if(cbp&15){
-            for(i8x8=0; i8x8<4; i8x8++){
-                for(i4x4=0; i4x4<4; i4x4++){
-                    const int index= i4x4 + 4*i8x8 + p*16;
-                    if( decode_residual(h, h->intra_gb_ptr, h->mb + (16*index << pixel_shift),
-                        index, scan + 1, h->dequant4_coeff[p][qscale], 15) < 0 ){
-                        return -1;
-                    }
-                }
-            }
-            return 0xf;
-        }else{
-            fill_rectangle(&h->non_zero_count_cache[scan8[p*16]], 4, 4, 8, 0, 1);
-            return 0;
-        }
-    }else{
-        int cqm = (IS_INTRA( mb_type ) ? 0:3)+p;
-        /* For CAVLC 4:4:4, we need to keep track of the luma 8x8 CBP for deblocking nnz purposes. */
-        int new_cbp = 0;
-        for(i8x8=0; i8x8<4; i8x8++){
-            if(cbp & (1<<i8x8)){
-                if(IS_8x8DCT(mb_type)){
-                    int16_t *buf = &h->mb[64*i8x8+256*p << pixel_shift];
-                    uint8_t *nnz;
-                    for(i4x4=0; i4x4<4; i4x4++){
-                        const int index= i4x4 + 4*i8x8 + p*16;
-                        if( decode_residual(h, gb, buf, index, scan8x8+16*i4x4,
-                                            h->dequant8_coeff[cqm][qscale], 16) < 0 )
-                            return -1;
-                    }
-                    nnz= &h->non_zero_count_cache[ scan8[4*i8x8+p*16] ];
-                    nnz[0] += nnz[1] + nnz[8] + nnz[9];
-                    new_cbp |= !!nnz[0] << i8x8;
-                }else{
-                    for(i4x4=0; i4x4<4; i4x4++){
-                        const int index= i4x4 + 4*i8x8 + p*16;
-                        if( decode_residual(h, gb, h->mb + (16*index << pixel_shift), index,
-                                            scan, h->dequant4_coeff[cqm][qscale], 16) < 0 ){
-                            return -1;
-                        }
-                        new_cbp |= h->non_zero_count_cache[ scan8[index] ] << i8x8;
-                    }
-                }
-            }else{
-                uint8_t * const nnz= &h->non_zero_count_cache[ scan8[4*i8x8+p*16] ];
-                nnz[0] = nnz[1] = nnz[8] = nnz[9] = 0;
-            }
-        }
-        return new_cbp;
-    }
-}
-
-int ff_h264_decode_mb_cavlc(H264Context *h){
-    int mb_xy;
-    int partition_count;
-    unsigned int mb_type, cbp;
-    int dct8x8_allowed= h->pps.transform_8x8_mode;
-    int decode_chroma = h->sps.chroma_format_idc == 1 || h->sps.chroma_format_idc == 2;
-    const int pixel_shift = h->pixel_shift;
-
-    mb_xy = h->mb_xy = h->mb_x + h->mb_y*h->mb_stride;
-
-    tprintf(h->avctx, "pic:%d mb:%d/%d\n", h->frame_num, h->mb_x, h->mb_y);
-    cbp = 0; /* avoid warning. FIXME: find a solution without slowing
-                down the code */
-    if(h->slice_type_nos != AV_PICTURE_TYPE_I){
-        if(h->mb_skip_run==-1)
-            h->mb_skip_run= get_ue_golomb(&h->gb);
-
-        if (h->mb_skip_run--) {
-            if(FRAME_MBAFF(h) && (h->mb_y&1) == 0){
-                if(h->mb_skip_run==0)
-                    h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&h->gb);
-            }
-            decode_mb_skip(h);
-            return 0;
-        }
-    }
-    if (FRAME_MBAFF(h)) {
-        if( (h->mb_y&1) == 0 )
-            h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&h->gb);
-    }
-
-    h->prev_mb_skipped= 0;
-
-    mb_type= get_ue_golomb(&h->gb);
-    if(h->slice_type_nos == AV_PICTURE_TYPE_B){
-        if(mb_type < 23){
-            partition_count= b_mb_type_info[mb_type].partition_count;
-            mb_type=         b_mb_type_info[mb_type].type;
-        }else{
-            mb_type -= 23;
-            goto decode_intra_mb;
-        }
-    }else if(h->slice_type_nos == AV_PICTURE_TYPE_P){
-        if(mb_type < 5){
-            partition_count= p_mb_type_info[mb_type].partition_count;
-            mb_type=         p_mb_type_info[mb_type].type;
-        }else{
-            mb_type -= 5;
-            goto decode_intra_mb;
-        }
-    }else{
-       assert(h->slice_type_nos == AV_PICTURE_TYPE_I);
-        if(h->slice_type == AV_PICTURE_TYPE_SI && mb_type)
-            mb_type--;
-decode_intra_mb:
-        if(mb_type > 25){
-            av_log(h->avctx, AV_LOG_ERROR, "mb_type %d in %c slice too large at %d %d\n", mb_type, av_get_picture_type_char(h->slice_type), h->mb_x, h->mb_y);
-            return -1;
-        }
-        partition_count=0;
-        cbp= i_mb_type_info[mb_type].cbp;
-        h->intra16x16_pred_mode= i_mb_type_info[mb_type].pred_mode;
-        mb_type= i_mb_type_info[mb_type].type;
-    }
-
-    if(MB_FIELD(h))
-        mb_type |= MB_TYPE_INTERLACED;
-
-    h->slice_table[ mb_xy ]= h->slice_num;
-
-    if(IS_INTRA_PCM(mb_type)){
-        const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] *
-                            h->sps.bit_depth_luma;
-
-        // We assume these blocks are very rare so we do not optimize it.
-        h->intra_pcm_ptr = align_get_bits(&h->gb);
-        if (get_bits_left(&h->gb) < mb_size) {
-            av_log(h->avctx, AV_LOG_ERROR, "Not enough data for an intra PCM block.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        skip_bits_long(&h->gb, mb_size);
-
-        // In deblocking, the quantizer is 0
-        h->cur_pic.qscale_table[mb_xy] = 0;
-        // All coeffs are present
-        memset(h->non_zero_count[mb_xy], 16, 48);
-
-        h->cur_pic.mb_type[mb_xy] = mb_type;
-        return 0;
-    }
-
-    fill_decode_neighbors(h, mb_type);
-    fill_decode_caches(h, mb_type);
-
-    //mb_pred
-    if(IS_INTRA(mb_type)){
-        int pred_mode;
-//            init_top_left_availability(h);
-        if(IS_INTRA4x4(mb_type)){
-            int i;
-            int di = 1;
-            if(dct8x8_allowed && get_bits1(&h->gb)){
-                mb_type |= MB_TYPE_8x8DCT;
-                di = 4;
-            }
-
-//                fill_intra4x4_pred_table(h);
-            for(i=0; i<16; i+=di){
-                int mode= pred_intra_mode(h, i);
-
-                if(!get_bits1(&h->gb)){
-                    const int rem_mode= get_bits(&h->gb, 3);
-                    mode = rem_mode + (rem_mode >= mode);
-                }
-
-                if(di==4)
-                    fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 );
-                else
-                    h->intra4x4_pred_mode_cache[ scan8[i] ] = mode;
-            }
-            write_back_intra_pred_mode(h);
-            if( ff_h264_check_intra4x4_pred_mode(h) < 0)
-                return -1;
-        }else{
-            h->intra16x16_pred_mode= ff_h264_check_intra_pred_mode(h, h->intra16x16_pred_mode, 0);
-            if(h->intra16x16_pred_mode < 0)
-                return -1;
-        }
-        if(decode_chroma){
-            pred_mode= ff_h264_check_intra_pred_mode(h, get_ue_golomb_31(&h->gb), 1);
-            if(pred_mode < 0)
-                return -1;
-            h->chroma_pred_mode= pred_mode;
-        } else {
-            h->chroma_pred_mode = DC_128_PRED8x8;
-        }
-    }else if(partition_count==4){
-        int i, j, sub_partition_count[4], list, ref[2][4];
-
-        if(h->slice_type_nos == AV_PICTURE_TYPE_B){
-            for(i=0; i<4; i++){
-                h->sub_mb_type[i]= get_ue_golomb_31(&h->gb);
-                if(h->sub_mb_type[i] >=13){
-                    av_log(h->avctx, AV_LOG_ERROR, "B sub_mb_type %u out of range at %d %d\n", h->sub_mb_type[i], h->mb_x, h->mb_y);
-                    return -1;
-                }
-                sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
-                h->sub_mb_type[i]=      b_sub_mb_type_info[ h->sub_mb_type[i] ].type;
-            }
-            if( IS_DIRECT(h->sub_mb_type[0]|h->sub_mb_type[1]|h->sub_mb_type[2]|h->sub_mb_type[3])) {
-                ff_h264_pred_direct_motion(h, &mb_type);
-                h->ref_cache[0][scan8[4]] =
-                h->ref_cache[1][scan8[4]] =
-                h->ref_cache[0][scan8[12]] =
-                h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE;
-            }
-        }else{
-            assert(h->slice_type_nos == AV_PICTURE_TYPE_P); //FIXME SP correct ?
-            for(i=0; i<4; i++){
-                h->sub_mb_type[i]= get_ue_golomb_31(&h->gb);
-                if(h->sub_mb_type[i] >=4){
-                    av_log(h->avctx, AV_LOG_ERROR, "P sub_mb_type %u out of range at %d %d\n", h->sub_mb_type[i], h->mb_x, h->mb_y);
-                    return -1;
-                }
-                sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
-                h->sub_mb_type[i]=      p_sub_mb_type_info[ h->sub_mb_type[i] ].type;
-            }
-        }
-
-        for(list=0; list<h->list_count; list++){
-            int ref_count = IS_REF0(mb_type) ? 1 : h->ref_count[list] << MB_MBAFF(h);
-            for(i=0; i<4; i++){
-                if(IS_DIRECT(h->sub_mb_type[i])) continue;
-                if(IS_DIR(h->sub_mb_type[i], 0, list)){
-                    unsigned int tmp;
-                    if(ref_count == 1){
-                        tmp= 0;
-                    }else if(ref_count == 2){
-                        tmp= get_bits1(&h->gb)^1;
-                    }else{
-                        tmp= get_ue_golomb_31(&h->gb);
-                        if(tmp>=ref_count){
-                            av_log(h->avctx, AV_LOG_ERROR, "ref %u overflow\n", tmp);
-                            return -1;
-                        }
-                    }
-                    ref[list][i]= tmp;
-                }else{
-                 //FIXME
-                    ref[list][i] = -1;
-                }
-            }
-        }
-
-        if(dct8x8_allowed)
-            dct8x8_allowed = get_dct8x8_allowed(h);
-
-        for(list=0; list<h->list_count; list++){
-            for(i=0; i<4; i++){
-                if(IS_DIRECT(h->sub_mb_type[i])) {
-                    h->ref_cache[list][ scan8[4*i] ] = h->ref_cache[list][ scan8[4*i]+1 ];
-                    continue;
-                }
-                h->ref_cache[list][ scan8[4*i]   ]=h->ref_cache[list][ scan8[4*i]+1 ]=
-                h->ref_cache[list][ scan8[4*i]+8 ]=h->ref_cache[list][ scan8[4*i]+9 ]= ref[list][i];
-
-                if(IS_DIR(h->sub_mb_type[i], 0, list)){
-                    const int sub_mb_type= h->sub_mb_type[i];
-                    const int block_width= (sub_mb_type & (MB_TYPE_16x16|MB_TYPE_16x8)) ? 2 : 1;
-                    for(j=0; j<sub_partition_count[i]; j++){
-                        int mx, my;
-                        const int index= 4*i + block_width*j;
-                        int16_t (* mv_cache)[2]= &h->mv_cache[list][ scan8[index] ];
-                        pred_motion(h, index, block_width, list, h->ref_cache[list][ scan8[index] ], &mx, &my);
-                        mx += get_se_golomb(&h->gb);
-                        my += get_se_golomb(&h->gb);
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
-
-                        if(IS_SUB_8X8(sub_mb_type)){
-                            mv_cache[ 1 ][0]=
-                            mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx;
-                            mv_cache[ 1 ][1]=
-                            mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my;
-                        }else if(IS_SUB_8X4(sub_mb_type)){
-                            mv_cache[ 1 ][0]= mx;
-                            mv_cache[ 1 ][1]= my;
-                        }else if(IS_SUB_4X8(sub_mb_type)){
-                            mv_cache[ 8 ][0]= mx;
-                            mv_cache[ 8 ][1]= my;
-                        }
-                        mv_cache[ 0 ][0]= mx;
-                        mv_cache[ 0 ][1]= my;
-                    }
-                }else{
-                    uint32_t *p= (uint32_t *)&h->mv_cache[list][ scan8[4*i] ][0];
-                    p[0] = p[1]=
-                    p[8] = p[9]= 0;
-                }
-            }
-        }
-    }else if(IS_DIRECT(mb_type)){
-        ff_h264_pred_direct_motion(h, &mb_type);
-        dct8x8_allowed &= h->sps.direct_8x8_inference_flag;
-    }else{
-        int list, mx, my, i;
-         //FIXME we should set ref_idx_l? to 0 if we use that later ...
-        if(IS_16X16(mb_type)){
-            for(list=0; list<h->list_count; list++){
-                    unsigned int val;
-                    if(IS_DIR(mb_type, 0, list)){
-                        int rc = h->ref_count[list] << MB_MBAFF(h);
-                        if (rc == 1) {
-                            val= 0;
-                        } else if (rc == 2) {
-                            val= get_bits1(&h->gb)^1;
-                        }else{
-                            val= get_ue_golomb_31(&h->gb);
-                            if (val >= rc) {
-                                av_log(h->avctx, AV_LOG_ERROR, "ref %u overflow\n", val);
-                                return -1;
-                            }
-                        }
-                    fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, val, 1);
-                    }
-            }
-            for(list=0; list<h->list_count; list++){
-                if(IS_DIR(mb_type, 0, list)){
-                    pred_motion(h, 0, 4, list, h->ref_cache[list][ scan8[0] ], &mx, &my);
-                    mx += get_se_golomb(&h->gb);
-                    my += get_se_golomb(&h->gb);
-                    tprintf(h->avctx, "final mv:%d %d\n", mx, my);
-
-                    fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4);
-                }
-            }
-        }
-        else if(IS_16X8(mb_type)){
-            for(list=0; list<h->list_count; list++){
-                    for(i=0; i<2; i++){
-                        unsigned int val;
-                        if(IS_DIR(mb_type, i, list)){
-                            int rc = h->ref_count[list] << MB_MBAFF(h);
-                            if (rc == 1) {
-                                val= 0;
-                            } else if (rc == 2) {
-                                val= get_bits1(&h->gb)^1;
-                            }else{
-                                val= get_ue_golomb_31(&h->gb);
-                                if (val >= rc) {
-                                    av_log(h->avctx, AV_LOG_ERROR, "ref %u overflow\n", val);
-                                    return -1;
-                                }
-                            }
-                        }else
-                            val= LIST_NOT_USED&0xFF;
-                        fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, val, 1);
-                    }
-            }
-            for(list=0; list<h->list_count; list++){
-                for(i=0; i<2; i++){
-                    unsigned int val;
-                    if(IS_DIR(mb_type, i, list)){
-                        pred_16x8_motion(h, 8*i, list, h->ref_cache[list][scan8[0] + 16*i], &mx, &my);
-                        mx += get_se_golomb(&h->gb);
-                        my += get_se_golomb(&h->gb);
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
-
-                        val= pack16to32(mx,my);
-                    }else
-                        val=0;
-                    fill_rectangle(h->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, val, 4);
-                }
-            }
-        }else{
-            assert(IS_8X16(mb_type));
-            for(list=0; list<h->list_count; list++){
-                    for(i=0; i<2; i++){
-                        unsigned int val;
-                        if(IS_DIR(mb_type, i, list)){ //FIXME optimize
-                            int rc = h->ref_count[list] << MB_MBAFF(h);
-                            if (rc == 1) {
-                                val= 0;
-                            } else if (rc == 2) {
-                                val= get_bits1(&h->gb)^1;
-                            }else{
-                                val= get_ue_golomb_31(&h->gb);
-                                if (val >= rc) {
-                                    av_log(h->avctx, AV_LOG_ERROR, "ref %u overflow\n", val);
-                                    return -1;
-                                }
-                            }
-                        }else
-                            val= LIST_NOT_USED&0xFF;
-                        fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, val, 1);
-                    }
-            }
-            for(list=0; list<h->list_count; list++){
-                for(i=0; i<2; i++){
-                    unsigned int val;
-                    if(IS_DIR(mb_type, i, list)){
-                        pred_8x16_motion(h, i*4, list, h->ref_cache[list][ scan8[0] + 2*i ], &mx, &my);
-                        mx += get_se_golomb(&h->gb);
-                        my += get_se_golomb(&h->gb);
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
-
-                        val= pack16to32(mx,my);
-                    }else
-                        val=0;
-                    fill_rectangle(h->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, val, 4);
-                }
-            }
-        }
-    }
-
-    if(IS_INTER(mb_type))
-        write_back_motion(h, mb_type);
-
-    if(!IS_INTRA16x16(mb_type)){
-        cbp= get_ue_golomb(&h->gb);
-
-        if(decode_chroma){
-            if(cbp > 47){
-                av_log(h->avctx, AV_LOG_ERROR, "cbp too large (%u) at %d %d\n", cbp, h->mb_x, h->mb_y);
-                return -1;
-            }
-            if(IS_INTRA4x4(mb_type)) cbp= golomb_to_intra4x4_cbp[cbp];
-            else                     cbp= golomb_to_inter_cbp   [cbp];
-        }else{
-            if(cbp > 15){
-                av_log(h->avctx, AV_LOG_ERROR, "cbp too large (%u) at %d %d\n", cbp, h->mb_x, h->mb_y);
-                return -1;
-            }
-            if(IS_INTRA4x4(mb_type)) cbp= golomb_to_intra4x4_cbp_gray[cbp];
-            else                     cbp= golomb_to_inter_cbp_gray[cbp];
-        }
-    }
-
-    if(dct8x8_allowed && (cbp&15) && !IS_INTRA(mb_type)){
-        mb_type |= MB_TYPE_8x8DCT*get_bits1(&h->gb);
-    }
-    h->cbp=
-    h->cbp_table[mb_xy]= cbp;
-    h->cur_pic.mb_type[mb_xy] = mb_type;
-
-    if(cbp || IS_INTRA16x16(mb_type)){
-        int i4x4, i8x8, chroma_idx;
-        int dquant;
-        int ret;
-        GetBitContext *gb= IS_INTRA(mb_type) ? h->intra_gb_ptr : h->inter_gb_ptr;
-        const uint8_t *scan, *scan8x8;
-        const int max_qp = 51 + 6*(h->sps.bit_depth_luma-8);
-
-        if(IS_INTERLACED(mb_type)){
-            scan8x8= h->qscale ? h->field_scan8x8_cavlc : h->field_scan8x8_cavlc_q0;
-            scan= h->qscale ? h->field_scan : h->field_scan_q0;
-        }else{
-            scan8x8= h->qscale ? h->zigzag_scan8x8_cavlc : h->zigzag_scan8x8_cavlc_q0;
-            scan= h->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
-        }
-
-        dquant= get_se_golomb(&h->gb);
-
-        h->qscale += dquant;
-
-        if(((unsigned)h->qscale) > max_qp){
-            if(h->qscale<0) h->qscale+= max_qp+1;
-            else            h->qscale-= max_qp+1;
-            if(((unsigned)h->qscale) > max_qp){
-                av_log(h->avctx, AV_LOG_ERROR, "dquant out of range (%d) at %d %d\n", dquant, h->mb_x, h->mb_y);
-                return -1;
-            }
-        }
-
-        h->chroma_qp[0]= get_chroma_qp(h, 0, h->qscale);
-        h->chroma_qp[1]= get_chroma_qp(h, 1, h->qscale);
-
-        if( (ret = decode_luma_residual(h, gb, scan, scan8x8, pixel_shift, mb_type, cbp, 0)) < 0 ){
-            return -1;
-        }
-        h->cbp_table[mb_xy] |= ret << 12;
-        if (CHROMA444(h)) {
-            if( decode_luma_residual(h, gb, scan, scan8x8, pixel_shift, mb_type, cbp, 1) < 0 ){
-                return -1;
-            }
-            if( decode_luma_residual(h, gb, scan, scan8x8, pixel_shift, mb_type, cbp, 2) < 0 ){
-                return -1;
-            }
-        } else if (CHROMA422(h)) {
-            if(cbp&0x30){
-                for(chroma_idx=0; chroma_idx<2; chroma_idx++)
-                    if (decode_residual(h, gb, h->mb + ((256 + 16*16*chroma_idx) << pixel_shift),
-                                        CHROMA_DC_BLOCK_INDEX+chroma_idx, chroma422_dc_scan,
-                                        NULL, 8) < 0) {
-                        return -1;
-                    }
-            }
-
-            if(cbp&0x20){
-                for(chroma_idx=0; chroma_idx<2; chroma_idx++){
-                    const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[chroma_idx]];
-                    int16_t *mb = h->mb + (16*(16 + 16*chroma_idx) << pixel_shift);
-                    for (i8x8 = 0; i8x8 < 2; i8x8++) {
-                        for (i4x4 = 0; i4x4 < 4; i4x4++) {
-                            const int index = 16 + 16*chroma_idx + 8*i8x8 + i4x4;
-                            if (decode_residual(h, gb, mb, index, scan + 1, qmul, 15) < 0)
-                                return -1;
-                            mb += 16 << pixel_shift;
-                        }
-                    }
-                }
-            }else{
-                fill_rectangle(&h->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
-                fill_rectangle(&h->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
-            }
-        } else /* yuv420 */ {
-            if(cbp&0x30){
-                for(chroma_idx=0; chroma_idx<2; chroma_idx++)
-                    if( decode_residual(h, gb, h->mb + ((256 + 16*16*chroma_idx) << pixel_shift), CHROMA_DC_BLOCK_INDEX+chroma_idx, chroma_dc_scan, NULL, 4) < 0){
-                        return -1;
-                    }
-            }
-
-            if(cbp&0x20){
-                for(chroma_idx=0; chroma_idx<2; chroma_idx++){
-                    const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[chroma_idx]];
-                    for(i4x4=0; i4x4<4; i4x4++){
-                        const int index= 16 + 16*chroma_idx + i4x4;
-                        if( decode_residual(h, gb, h->mb + (16*index << pixel_shift), index, scan + 1, qmul, 15) < 0){
-                            return -1;
-                        }
-                    }
-                }
-            }else{
-                fill_rectangle(&h->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
-                fill_rectangle(&h->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
-            }
-        }
-    }else{
-        fill_rectangle(&h->non_zero_count_cache[scan8[ 0]], 4, 4, 8, 0, 1);
-        fill_rectangle(&h->non_zero_count_cache[scan8[16]], 4, 4, 8, 0, 1);
-        fill_rectangle(&h->non_zero_count_cache[scan8[32]], 4, 4, 8, 0, 1);
-    }
-    h->cur_pic.qscale_table[mb_xy] = h->qscale;
-    write_back_non_zero_count(h);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/h264_direct.c b/deps/libav/libavcodec/h264_direct.c
deleted file mode 100644
index 85fda31..0000000
--- a/deps/libav/libavcodec/h264_direct.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... direct mb/block decoding
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 direct mb/block decoding.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "internal.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h264.h"
-#include "rectangle.h"
-#include "thread.h"
-
-#include <assert.h>
-
-
-static int get_scale_factor(H264Context * const h, int poc, int poc1, int i){
-    int poc0 = h->ref_list[0][i].poc;
-    int td = av_clip(poc1 - poc0, -128, 127);
-    if(td == 0 || h->ref_list[0][i].long_ref){
-        return 256;
-    }else{
-        int tb = av_clip(poc - poc0, -128, 127);
-        int tx = (16384 + (FFABS(td) >> 1)) / td;
-        return av_clip((tb*tx + 32) >> 6, -1024, 1023);
-    }
-}
-
-void ff_h264_direct_dist_scale_factor(H264Context * const h){
-    const int poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];
-    const int poc1 = h->ref_list[1][0].poc;
-    int i, field;
-
-    if (FRAME_MBAFF(h))
-        for (field = 0; field < 2; field++){
-            const int poc  = h->cur_pic_ptr->field_poc[field];
-            const int poc1 = h->ref_list[1][0].field_poc[field];
-            for (i = 0; i < 2 * h->ref_count[0]; i++)
-                h->dist_scale_factor_field[field][i^field] =
-                    get_scale_factor(h, poc, poc1, i+16);
-        }
-
-    for (i = 0; i < h->ref_count[0]; i++){
-        h->dist_scale_factor[i] = get_scale_factor(h, poc, poc1, i);
-    }
-}
-
-static void fill_colmap(H264Context *h, int map[2][16+32], int list, int field, int colfield, int mbafi){
-    Picture * const ref1 = &h->ref_list[1][0];
-    int j, old_ref, rfield;
-    int start= mbafi ? 16                      : 0;
-    int end  = mbafi ? 16+2*h->ref_count[0]    : h->ref_count[0];
-    int interl= mbafi || h->picture_structure != PICT_FRAME;
-
-    /* bogus; fills in for missing frames */
-    memset(map[list], 0, sizeof(map[list]));
-
-    for(rfield=0; rfield<2; rfield++){
-        for(old_ref=0; old_ref<ref1->ref_count[colfield][list]; old_ref++){
-            int poc = ref1->ref_poc[colfield][list][old_ref];
-
-            if     (!interl)
-                poc |= 3;
-            else if( interl && (poc&3) == 3) // FIXME: store all MBAFF references so this is not needed
-                poc= (poc&~3) + rfield + 1;
-
-            for(j=start; j<end; j++){
-                if (4 * h->ref_list[0][j].frame_num + (h->ref_list[0][j].reference & 3) == poc) {
-                    int cur_ref= mbafi ? (j-16)^field : j;
-                    if (ref1->mbaff)
-                        map[list][2 * old_ref + (rfield^field) + 16] = cur_ref;
-                    if(rfield == field || !interl)
-                        map[list][old_ref] = cur_ref;
-                    break;
-                }
-            }
-        }
-    }
-}
-
-void ff_h264_direct_ref_list_init(H264Context * const h){
-    Picture * const ref1 = &h->ref_list[1][0];
-    Picture * const cur = h->cur_pic_ptr;
-    int list, j, field;
-    int sidx= (h->picture_structure&1)^1;
-    int ref1sidx = (ref1->reference&1)^1;
-
-    for(list=0; list<2; list++){
-        cur->ref_count[sidx][list] = h->ref_count[list];
-        for(j=0; j<h->ref_count[list]; j++)
-            cur->ref_poc[sidx][list][j] = 4 * h->ref_list[list][j].frame_num + (h->ref_list[list][j].reference & 3);
-    }
-
-    if(h->picture_structure == PICT_FRAME){
-        memcpy(cur->ref_count[1], cur->ref_count[0], sizeof(cur->ref_count[0]));
-        memcpy(cur->ref_poc  [1], cur->ref_poc  [0], sizeof(cur->ref_poc  [0]));
-    }
-
-    cur->mbaff = FRAME_MBAFF(h);
-
-    h->col_fieldoff= 0;
-    if(h->picture_structure == PICT_FRAME){
-        int cur_poc = h->cur_pic_ptr->poc;
-        int *col_poc = h->ref_list[1]->field_poc;
-        h->col_parity= (FFABS(col_poc[0] - cur_poc) >= FFABS(col_poc[1] - cur_poc));
-        ref1sidx=sidx= h->col_parity;
-    } else if (!(h->picture_structure & h->ref_list[1][0].reference) && !h->ref_list[1][0].mbaff) { // FL -> FL & differ parity
-        h->col_fieldoff = 2 * h->ref_list[1][0].reference - 3;
-    }
-
-    if (h->slice_type_nos != AV_PICTURE_TYPE_B || h->direct_spatial_mv_pred)
-        return;
-
-    for(list=0; list<2; list++){
-        fill_colmap(h, h->map_col_to_list0, list, sidx, ref1sidx, 0);
-        if (FRAME_MBAFF(h))
-        for(field=0; field<2; field++)
-            fill_colmap(h, h->map_col_to_list0_field[field], list, field, field, 1);
-    }
-}
-
-static void await_reference_mb_row(H264Context * const h, Picture *ref, int mb_y)
-{
-    int ref_field = ref->reference - 1;
-    int ref_field_picture = ref->field_picture;
-    int ref_height = 16*h->mb_height >> ref_field_picture;
-
-    if(!HAVE_THREADS || !(h->avctx->active_thread_type&FF_THREAD_FRAME))
-        return;
-
-    //FIXME it can be safe to access mb stuff
-    //even if pixels aren't deblocked yet
-
-    ff_thread_await_progress(&ref->tf,
-                             FFMIN(16 * mb_y >> ref_field_picture, ref_height - 1),
-                             ref_field_picture && ref_field);
-}
-
-static void pred_spatial_direct_motion(H264Context * const h, int *mb_type){
-    int b8_stride = 2;
-    int b4_stride = h->b_stride;
-    int mb_xy = h->mb_xy, mb_y = h->mb_y;
-    int mb_type_col[2];
-    const int16_t (*l1mv0)[2], (*l1mv1)[2];
-    const int8_t *l1ref0, *l1ref1;
-    const int is_b8x8 = IS_8X8(*mb_type);
-    unsigned int sub_mb_type= MB_TYPE_L0L1;
-    int i8, i4;
-    int ref[2];
-    int mv[2];
-    int list;
-
-    assert(h->ref_list[1][0].reference & 3);
-
-    await_reference_mb_row(h, &h->ref_list[1][0], h->mb_y + !!IS_INTERLACED(*mb_type));
-
-#define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)
-
-
-    /* ref = min(neighbors) */
-    for(list=0; list<2; list++){
-        int left_ref = h->ref_cache[list][scan8[0] - 1];
-        int top_ref  = h->ref_cache[list][scan8[0] - 8];
-        int refc = h->ref_cache[list][scan8[0] - 8 + 4];
-        const int16_t *C= h->mv_cache[list][ scan8[0] - 8 + 4];
-        if(refc == PART_NOT_AVAILABLE){
-            refc = h->ref_cache[list][scan8[0] - 8 - 1];
-            C    = h-> mv_cache[list][scan8[0] - 8 - 1];
-        }
-        ref[list] = FFMIN3((unsigned)left_ref, (unsigned)top_ref, (unsigned)refc);
-        if(ref[list] >= 0){
-            //this is just pred_motion() but with the cases removed that cannot happen for direct blocks
-            const int16_t * const A= h->mv_cache[list][ scan8[0] - 1 ];
-            const int16_t * const B= h->mv_cache[list][ scan8[0] - 8 ];
-
-            int match_count= (left_ref==ref[list]) + (top_ref==ref[list]) + (refc==ref[list]);
-            if(match_count > 1){ //most common
-                mv[list]= pack16to32(mid_pred(A[0], B[0], C[0]),
-                                     mid_pred(A[1], B[1], C[1]) );
-            }else {
-                assert(match_count==1);
-                if(left_ref==ref[list]){
-                    mv[list]= AV_RN32A(A);
-                }else if(top_ref==ref[list]){
-                    mv[list]= AV_RN32A(B);
-                }else{
-                    mv[list]= AV_RN32A(C);
-                }
-            }
-        }else{
-            int mask= ~(MB_TYPE_L0 << (2*list));
-            mv[list] = 0;
-            ref[list] = -1;
-            if(!is_b8x8)
-                *mb_type &= mask;
-            sub_mb_type &= mask;
-        }
-    }
-    if(ref[0] < 0 && ref[1] < 0){
-        ref[0] = ref[1] = 0;
-        if(!is_b8x8)
-            *mb_type |= MB_TYPE_L0L1;
-        sub_mb_type |= MB_TYPE_L0L1;
-    }
-
-    if(!(is_b8x8|mv[0]|mv[1])){
-        fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1);
-        fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1);
-        fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, 0, 4);
-        fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, 0, 4);
-        *mb_type= (*mb_type & ~(MB_TYPE_8x8|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_P1L0|MB_TYPE_P1L1))|MB_TYPE_16x16|MB_TYPE_DIRECT2;
-        return;
-    }
-
-    if (IS_INTERLACED(h->ref_list[1][0].mb_type[mb_xy])) { // AFL/AFR/FR/FL -> AFL/FL
-        if (!IS_INTERLACED(*mb_type)) {                          //     AFR/FR    -> AFL/FL
-            mb_y = (h->mb_y&~1) + h->col_parity;
-            mb_xy= h->mb_x + ((h->mb_y&~1) + h->col_parity)*h->mb_stride;
-            b8_stride = 0;
-        }else{
-            mb_y  += h->col_fieldoff;
-            mb_xy += h->mb_stride*h->col_fieldoff; // non zero for FL -> FL & differ parity
-        }
-        goto single_col;
-    }else{                                               // AFL/AFR/FR/FL -> AFR/FR
-        if(IS_INTERLACED(*mb_type)){                     // AFL       /FL -> AFR/FR
-            mb_y = h->mb_y&~1;
-            mb_xy= h->mb_x + (h->mb_y&~1)*h->mb_stride;
-            mb_type_col[0] = h->ref_list[1][0].mb_type[mb_xy];
-            mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy + h->mb_stride];
-            b8_stride = 2+4*h->mb_stride;
-            b4_stride *= 6;
-            if (IS_INTERLACED(mb_type_col[0]) != IS_INTERLACED(mb_type_col[1])) {
-                mb_type_col[0] &= ~MB_TYPE_INTERLACED;
-                mb_type_col[1] &= ~MB_TYPE_INTERLACED;
-            }
-
-            sub_mb_type |= MB_TYPE_16x16|MB_TYPE_DIRECT2; /* B_SUB_8x8 */
-            if(    (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA)
-                && (mb_type_col[1] & MB_TYPE_16x16_OR_INTRA)
-                && !is_b8x8){
-                *mb_type   |= MB_TYPE_16x8 |MB_TYPE_DIRECT2; /* B_16x8 */
-            }else{
-                *mb_type   |= MB_TYPE_8x8;
-            }
-        }else{                                           //     AFR/FR    -> AFR/FR
-single_col:
-            mb_type_col[0] =
-            mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy];
-
-            sub_mb_type |= MB_TYPE_16x16|MB_TYPE_DIRECT2; /* B_SUB_8x8 */
-            if(!is_b8x8 && (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA)){
-                *mb_type   |= MB_TYPE_16x16|MB_TYPE_DIRECT2; /* B_16x16 */
-            }else if(!is_b8x8 && (mb_type_col[0] & (MB_TYPE_16x8|MB_TYPE_8x16))){
-                *mb_type   |= MB_TYPE_DIRECT2 | (mb_type_col[0] & (MB_TYPE_16x8|MB_TYPE_8x16));
-            }else{
-                if(!h->sps.direct_8x8_inference_flag){
-                    /* FIXME save sub mb types from previous frames (or derive from MVs)
-                    * so we know exactly what block size to use */
-                    sub_mb_type += (MB_TYPE_8x8-MB_TYPE_16x16); /* B_SUB_4x4 */
-                }
-                *mb_type   |= MB_TYPE_8x8;
-            }
-        }
-    }
-
-    await_reference_mb_row(h, &h->ref_list[1][0], mb_y);
-
-    l1mv0  = &h->ref_list[1][0].motion_val[0][h->mb2b_xy [mb_xy]];
-    l1mv1  = &h->ref_list[1][0].motion_val[1][h->mb2b_xy [mb_xy]];
-    l1ref0 = &h->ref_list[1][0].ref_index [0][4 * mb_xy];
-    l1ref1 = &h->ref_list[1][0].ref_index [1][4 * mb_xy];
-    if(!b8_stride){
-        if(h->mb_y&1){
-            l1ref0 += 2;
-            l1ref1 += 2;
-            l1mv0  +=  2*b4_stride;
-            l1mv1  +=  2*b4_stride;
-        }
-    }
-
-
-        if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){
-            int n=0;
-            for(i8=0; i8<4; i8++){
-                int x8 = i8&1;
-                int y8 = i8>>1;
-                int xy8 = x8+y8*b8_stride;
-                int xy4 = 3*x8+y8*b4_stride;
-                int a,b;
-
-                if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
-                    continue;
-                h->sub_mb_type[i8] = sub_mb_type;
-
-                fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
-                fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
-                if(!IS_INTRA(mb_type_col[y8]) && !h->ref_list[1][0].long_ref
-                   && (   (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1)
-                       || (l1ref0[xy8]  < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){
-                    a=b=0;
-                    if(ref[0] > 0)
-                        a= mv[0];
-                    if(ref[1] > 0)
-                        b= mv[1];
-                    n++;
-                }else{
-                    a= mv[0];
-                    b= mv[1];
-                }
-                fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4);
-                fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4);
-            }
-            if(!is_b8x8 && !(n&3))
-                *mb_type= (*mb_type & ~(MB_TYPE_8x8|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_P1L0|MB_TYPE_P1L1))|MB_TYPE_16x16|MB_TYPE_DIRECT2;
-        }else if(IS_16X16(*mb_type)){
-            int a,b;
-
-            fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1);
-            fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1);
-            if(!IS_INTRA(mb_type_col[0]) && !h->ref_list[1][0].long_ref
-               && (   (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1)
-                   || (l1ref0[0]  < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1
-                       && h->x264_build>33U))){
-                a=b=0;
-                if(ref[0] > 0)
-                    a= mv[0];
-                if(ref[1] > 0)
-                    b= mv[1];
-            }else{
-                a= mv[0];
-                b= mv[1];
-            }
-            fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4);
-            fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4);
-        }else{
-            int n=0;
-            for(i8=0; i8<4; i8++){
-                const int x8 = i8&1;
-                const int y8 = i8>>1;
-
-                if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
-                    continue;
-                h->sub_mb_type[i8] = sub_mb_type;
-
-                fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, mv[0], 4);
-                fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, mv[1], 4);
-                fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
-                fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
-
-                assert(b8_stride==2);
-                /* col_zero_flag */
-                if(!IS_INTRA(mb_type_col[0]) && !h->ref_list[1][0].long_ref && (   l1ref0[i8] == 0
-                                              || (l1ref0[i8] < 0 && l1ref1[i8] == 0
-                                                  && h->x264_build>33U))){
-                    const int16_t (*l1mv)[2]= l1ref0[i8] == 0 ? l1mv0 : l1mv1;
-                    if(IS_SUB_8X8(sub_mb_type)){
-                        const int16_t *mv_col = l1mv[x8*3 + y8*3*b4_stride];
-                        if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
-                            if(ref[0] == 0)
-                                fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
-                            if(ref[1] == 0)
-                                fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
-                            n+=4;
-                        }
-                    }else{
-                        int m=0;
-                    for(i4=0; i4<4; i4++){
-                        const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride];
-                        if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
-                            if(ref[0] == 0)
-                                AV_ZERO32(h->mv_cache[0][scan8[i8*4+i4]]);
-                            if(ref[1] == 0)
-                                AV_ZERO32(h->mv_cache[1][scan8[i8*4+i4]]);
-                            m++;
-                        }
-                    }
-                    if(!(m&3))
-                        h->sub_mb_type[i8]+= MB_TYPE_16x16 - MB_TYPE_8x8;
-                    n+=m;
-                    }
-                }
-            }
-            if(!is_b8x8 && !(n&15))
-                *mb_type= (*mb_type & ~(MB_TYPE_8x8|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_P1L0|MB_TYPE_P1L1))|MB_TYPE_16x16|MB_TYPE_DIRECT2;
-        }
-}
-
-static void pred_temp_direct_motion(H264Context * const h, int *mb_type){
-    int b8_stride = 2;
-    int b4_stride = h->b_stride;
-    int mb_xy = h->mb_xy, mb_y = h->mb_y;
-    int mb_type_col[2];
-    const int16_t (*l1mv0)[2], (*l1mv1)[2];
-    const int8_t *l1ref0, *l1ref1;
-    const int is_b8x8 = IS_8X8(*mb_type);
-    unsigned int sub_mb_type;
-    int i8, i4;
-
-    assert(h->ref_list[1][0].reference & 3);
-
-    await_reference_mb_row(h, &h->ref_list[1][0], h->mb_y + !!IS_INTERLACED(*mb_type));
-
-    if (IS_INTERLACED(h->ref_list[1][0].mb_type[mb_xy])) { // AFL/AFR/FR/FL -> AFL/FL
-        if (!IS_INTERLACED(*mb_type)) {                          //     AFR/FR    -> AFL/FL
-            mb_y = (h->mb_y&~1) + h->col_parity;
-            mb_xy= h->mb_x + ((h->mb_y&~1) + h->col_parity)*h->mb_stride;
-            b8_stride = 0;
-        }else{
-            mb_y  += h->col_fieldoff;
-            mb_xy += h->mb_stride*h->col_fieldoff; // non zero for FL -> FL & differ parity
-        }
-        goto single_col;
-    }else{                                               // AFL/AFR/FR/FL -> AFR/FR
-        if(IS_INTERLACED(*mb_type)){                     // AFL       /FL -> AFR/FR
-            mb_y = h->mb_y&~1;
-            mb_xy= h->mb_x + (h->mb_y&~1)*h->mb_stride;
-            mb_type_col[0] = h->ref_list[1][0].mb_type[mb_xy];
-            mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy + h->mb_stride];
-            b8_stride = 2+4*h->mb_stride;
-            b4_stride *= 6;
-            if (IS_INTERLACED(mb_type_col[0]) != IS_INTERLACED(mb_type_col[1])) {
-                mb_type_col[0] &= ~MB_TYPE_INTERLACED;
-                mb_type_col[1] &= ~MB_TYPE_INTERLACED;
-            }
-
-            sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_SUB_8x8 */
-
-            if(    (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA)
-                && (mb_type_col[1] & MB_TYPE_16x16_OR_INTRA)
-                && !is_b8x8){
-                *mb_type   |= MB_TYPE_16x8 |MB_TYPE_L0L1|MB_TYPE_DIRECT2; /* B_16x8 */
-            }else{
-                *mb_type   |= MB_TYPE_8x8|MB_TYPE_L0L1;
-            }
-        }else{                                           //     AFR/FR    -> AFR/FR
-single_col:
-            mb_type_col[0] =
-            mb_type_col[1] = h->ref_list[1][0].mb_type[mb_xy];
-
-            sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_SUB_8x8 */
-            if(!is_b8x8 && (mb_type_col[0] & MB_TYPE_16x16_OR_INTRA)){
-                *mb_type   |= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_16x16 */
-            }else if(!is_b8x8 && (mb_type_col[0] & (MB_TYPE_16x8|MB_TYPE_8x16))){
-                *mb_type   |= MB_TYPE_L0L1|MB_TYPE_DIRECT2 | (mb_type_col[0] & (MB_TYPE_16x8|MB_TYPE_8x16));
-            }else{
-                if(!h->sps.direct_8x8_inference_flag){
-                    /* FIXME save sub mb types from previous frames (or derive from MVs)
-                    * so we know exactly what block size to use */
-                    sub_mb_type = MB_TYPE_8x8|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_SUB_4x4 */
-                }
-                *mb_type   |= MB_TYPE_8x8|MB_TYPE_L0L1;
-            }
-        }
-    }
-
-    await_reference_mb_row(h, &h->ref_list[1][0], mb_y);
-
-    l1mv0  = &h->ref_list[1][0].motion_val[0][h->mb2b_xy [mb_xy]];
-    l1mv1  = &h->ref_list[1][0].motion_val[1][h->mb2b_xy [mb_xy]];
-    l1ref0 = &h->ref_list[1][0].ref_index [0][4 * mb_xy];
-    l1ref1 = &h->ref_list[1][0].ref_index [1][4 * mb_xy];
-    if(!b8_stride){
-        if(h->mb_y&1){
-            l1ref0 += 2;
-            l1ref1 += 2;
-            l1mv0  +=  2*b4_stride;
-            l1mv1  +=  2*b4_stride;
-        }
-    }
-
-    {
-        const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]};
-        const int *dist_scale_factor = h->dist_scale_factor;
-        int ref_offset;
-
-        if (FRAME_MBAFF(h) && IS_INTERLACED(*mb_type)) {
-            map_col_to_list0[0] = h->map_col_to_list0_field[h->mb_y&1][0];
-            map_col_to_list0[1] = h->map_col_to_list0_field[h->mb_y&1][1];
-            dist_scale_factor   =h->dist_scale_factor_field[h->mb_y&1];
-        }
-        ref_offset = (h->ref_list[1][0].mbaff<<4) & (mb_type_col[0]>>3); //if(h->ref_list[1][0].mbaff && IS_INTERLACED(mb_type_col[0])) ref_offset=16 else 0
-
-        if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){
-            int y_shift  = 2*!IS_INTERLACED(*mb_type);
-            assert(h->sps.direct_8x8_inference_flag);
-
-            for(i8=0; i8<4; i8++){
-                const int x8 = i8&1;
-                const int y8 = i8>>1;
-                int ref0, scale;
-                const int16_t (*l1mv)[2]= l1mv0;
-
-                if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
-                    continue;
-                h->sub_mb_type[i8] = sub_mb_type;
-
-                fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
-                if(IS_INTRA(mb_type_col[y8])){
-                    fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
-                    fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
-                    fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
-                    continue;
-                }
-
-                ref0 = l1ref0[x8 + y8*b8_stride];
-                if(ref0 >= 0)
-                    ref0 = map_col_to_list0[0][ref0 + ref_offset];
-                else{
-                    ref0 = map_col_to_list0[1][l1ref1[x8 + y8*b8_stride] + ref_offset];
-                    l1mv= l1mv1;
-                }
-                scale = dist_scale_factor[ref0];
-                fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
-
-                {
-                    const int16_t *mv_col = l1mv[x8*3 + y8*b4_stride];
-                    int my_col = (mv_col[1]<<y_shift)/2;
-                    int mx = (scale * mv_col[0] + 128) >> 8;
-                    int my = (scale * my_col + 128) >> 8;
-                    fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
-                    fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-my_col), 4);
-                }
-            }
-            return;
-        }
-
-        /* one-to-one mv scaling */
-
-        if(IS_16X16(*mb_type)){
-            int ref, mv0, mv1;
-
-            fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, 0, 1);
-            if(IS_INTRA(mb_type_col[0])){
-                ref=mv0=mv1=0;
-            }else{
-                const int ref0 = l1ref0[0] >= 0 ? map_col_to_list0[0][l1ref0[0] + ref_offset]
-                                                : map_col_to_list0[1][l1ref1[0] + ref_offset];
-                const int scale = dist_scale_factor[ref0];
-                const int16_t *mv_col = l1ref0[0] >= 0 ? l1mv0[0] : l1mv1[0];
-                int mv_l0[2];
-                mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
-                mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
-                ref= ref0;
-                mv0= pack16to32(mv_l0[0],mv_l0[1]);
-                mv1= pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]);
-            }
-            fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);
-            fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, mv0, 4);
-            fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, mv1, 4);
-        }else{
-            for(i8=0; i8<4; i8++){
-                const int x8 = i8&1;
-                const int y8 = i8>>1;
-                int ref0, scale;
-                const int16_t (*l1mv)[2]= l1mv0;
-
-                if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
-                    continue;
-                h->sub_mb_type[i8] = sub_mb_type;
-                fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
-                if(IS_INTRA(mb_type_col[0])){
-                    fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
-                    fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
-                    fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
-                    continue;
-                }
-
-                assert(b8_stride == 2);
-                ref0 = l1ref0[i8];
-                if(ref0 >= 0)
-                    ref0 = map_col_to_list0[0][ref0 + ref_offset];
-                else{
-                    ref0 = map_col_to_list0[1][l1ref1[i8] + ref_offset];
-                    l1mv= l1mv1;
-                }
-                scale = dist_scale_factor[ref0];
-
-                fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
-                if(IS_SUB_8X8(sub_mb_type)){
-                    const int16_t *mv_col = l1mv[x8*3 + y8*3*b4_stride];
-                    int mx = (scale * mv_col[0] + 128) >> 8;
-                    int my = (scale * mv_col[1] + 128) >> 8;
-                    fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
-                    fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4);
-                }else
-                for(i4=0; i4<4; i4++){
-                    const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride];
-                    int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]];
-                    mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
-                    mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
-                    AV_WN32A(h->mv_cache[1][scan8[i8*4+i4]],
-                        pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]));
-                }
-            }
-        }
-    }
-}
-
-void ff_h264_pred_direct_motion(H264Context * const h, int *mb_type){
-    if(h->direct_spatial_mv_pred){
-        pred_spatial_direct_motion(h, mb_type);
-    }else{
-        pred_temp_direct_motion(h, mb_type);
-    }
-}
diff --git a/deps/libav/libavcodec/h264_loopfilter.c b/deps/libav/libavcodec/h264_loopfilter.c
deleted file mode 100644
index 88ed34c..0000000
--- a/deps/libav/libavcodec/h264_loopfilter.c
+++ /dev/null
@@ -1,824 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... loop filter
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 loop filter.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "internal.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h264.h"
-#include "mathops.h"
-#include "rectangle.h"
-
-#include <assert.h>
-
-/* Deblocking filter (p153) */
-static const uint8_t alpha_table[52*3] = {
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  4,  4,  5,  6,
-     7,  8,  9, 10, 12, 13, 15, 17, 20, 22,
-    25, 28, 32, 36, 40, 45, 50, 56, 63, 71,
-    80, 90,101,113,127,144,162,182,203,226,
-   255,255,
-   255,255,255,255,255,255,255,255,255,255,255,255,255,
-   255,255,255,255,255,255,255,255,255,255,255,255,255,
-   255,255,255,255,255,255,255,255,255,255,255,255,255,
-   255,255,255,255,255,255,255,255,255,255,255,255,255,
-};
-static const uint8_t beta_table[52*3] = {
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  2,  2,  2,  3,
-     3,  3,  3,  4,  4,  4,  6,  6,  7,  7,
-     8,  8,  9,  9, 10, 10, 11, 11, 12, 12,
-    13, 13, 14, 14, 15, 15, 16, 16, 17, 17,
-    18, 18,
-    18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-    18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-};
-static const uint8_t tc0_table[52*3][4] = {
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
-    {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 1 },
-    {-1, 0, 0, 1 }, {-1, 0, 0, 1 }, {-1, 0, 0, 1 }, {-1, 0, 1, 1 }, {-1, 0, 1, 1 }, {-1, 1, 1, 1 },
-    {-1, 1, 1, 1 }, {-1, 1, 1, 1 }, {-1, 1, 1, 1 }, {-1, 1, 1, 2 }, {-1, 1, 1, 2 }, {-1, 1, 1, 2 },
-    {-1, 1, 1, 2 }, {-1, 1, 2, 3 }, {-1, 1, 2, 3 }, {-1, 2, 2, 3 }, {-1, 2, 2, 4 }, {-1, 2, 3, 4 },
-    {-1, 2, 3, 4 }, {-1, 3, 3, 5 }, {-1, 3, 4, 6 }, {-1, 3, 4, 6 }, {-1, 4, 5, 7 }, {-1, 4, 5, 8 },
-    {-1, 4, 6, 9 }, {-1, 5, 7,10 }, {-1, 6, 8,11 }, {-1, 6, 8,13 }, {-1, 7,10,14 }, {-1, 8,11,16 },
-    {-1, 9,12,18 }, {-1,10,13,20 }, {-1,11,15,23 }, {-1,13,17,25 },
-    {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
-    {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
-    {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
-    {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
-    {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
-    {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
-    {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
-    {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
-    {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
-};
-
-/* intra: 0 if this loopfilter call is guaranteed to be inter (bS < 4), 1 if it might be intra (bS == 4) */
-static av_always_inline void filter_mb_edgev(uint8_t *pix, int stride,
-                                             const int16_t bS[4],
-                                             unsigned int qp, int a, int b,
-                                             H264Context *h, int intra)
-{
-    const unsigned int index_a = qp + a;
-    const int alpha = alpha_table[index_a];
-    const int beta  = beta_table[qp + b];
-    if (alpha ==0 || beta == 0) return;
-
-    if( bS[0] < 4 || !intra ) {
-        int8_t tc[4];
-        tc[0] = tc0_table[index_a][bS[0]];
-        tc[1] = tc0_table[index_a][bS[1]];
-        tc[2] = tc0_table[index_a][bS[2]];
-        tc[3] = tc0_table[index_a][bS[3]];
-        h->h264dsp.h264_h_loop_filter_luma(pix, stride, alpha, beta, tc);
-    } else {
-        h->h264dsp.h264_h_loop_filter_luma_intra(pix, stride, alpha, beta);
-    }
-}
-
-static av_always_inline void filter_mb_edgecv(uint8_t *pix, int stride,
-                                              const int16_t bS[4],
-                                              unsigned int qp, int a, int b,
-                                              H264Context *h, int intra)
-{
-    const unsigned int index_a = qp + a;
-    const int alpha = alpha_table[index_a];
-    const int beta  = beta_table[qp + b];
-    if (alpha ==0 || beta == 0) return;
-
-    if( bS[0] < 4 || !intra ) {
-        int8_t tc[4];
-        tc[0] = tc0_table[index_a][bS[0]]+1;
-        tc[1] = tc0_table[index_a][bS[1]]+1;
-        tc[2] = tc0_table[index_a][bS[2]]+1;
-        tc[3] = tc0_table[index_a][bS[3]]+1;
-        h->h264dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc);
-    } else {
-        h->h264dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta);
-    }
-}
-
-static av_always_inline void filter_mb_mbaff_edgev(H264Context *h, uint8_t *pix,
-                                                   int stride,
-                                                   const int16_t bS[7], int bsi,
-                                                   int qp, int a, int b,
-                                                   int intra)
-{
-    const unsigned int index_a = qp + a;
-    const int alpha = alpha_table[index_a];
-    const int beta  = beta_table[qp + b];
-    if (alpha ==0 || beta == 0) return;
-
-    if( bS[0] < 4 || !intra ) {
-        int8_t tc[4];
-        tc[0] = tc0_table[index_a][bS[0*bsi]];
-        tc[1] = tc0_table[index_a][bS[1*bsi]];
-        tc[2] = tc0_table[index_a][bS[2*bsi]];
-        tc[3] = tc0_table[index_a][bS[3*bsi]];
-        h->h264dsp.h264_h_loop_filter_luma_mbaff(pix, stride, alpha, beta, tc);
-    } else {
-        h->h264dsp.h264_h_loop_filter_luma_mbaff_intra(pix, stride, alpha, beta);
-    }
-}
-
-static av_always_inline void filter_mb_mbaff_edgecv(H264Context *h,
-                                                    uint8_t *pix, int stride,
-                                                    const int16_t bS[7],
-                                                    int bsi, int qp, int a,
-                                                    int b, int intra)
-{
-    const unsigned int index_a = qp + a;
-    const int alpha = alpha_table[index_a];
-    const int beta  = beta_table[qp + b];
-    if (alpha ==0 || beta == 0) return;
-
-    if( bS[0] < 4 || !intra ) {
-        int8_t tc[4];
-        tc[0] = tc0_table[index_a][bS[0*bsi]] + 1;
-        tc[1] = tc0_table[index_a][bS[1*bsi]] + 1;
-        tc[2] = tc0_table[index_a][bS[2*bsi]] + 1;
-        tc[3] = tc0_table[index_a][bS[3*bsi]] + 1;
-        h->h264dsp.h264_h_loop_filter_chroma_mbaff(pix, stride, alpha, beta, tc);
-    } else {
-        h->h264dsp.h264_h_loop_filter_chroma_mbaff_intra(pix, stride, alpha, beta);
-    }
-}
-
-static av_always_inline void filter_mb_edgeh(uint8_t *pix, int stride,
-                                             const int16_t bS[4],
-                                             unsigned int qp, int a, int b,
-                                             H264Context *h, int intra)
-{
-    const unsigned int index_a = qp + a;
-    const int alpha = alpha_table[index_a];
-    const int beta  = beta_table[qp + b];
-    if (alpha ==0 || beta == 0) return;
-
-    if( bS[0] < 4 || !intra ) {
-        int8_t tc[4];
-        tc[0] = tc0_table[index_a][bS[0]];
-        tc[1] = tc0_table[index_a][bS[1]];
-        tc[2] = tc0_table[index_a][bS[2]];
-        tc[3] = tc0_table[index_a][bS[3]];
-        h->h264dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc);
-    } else {
-        h->h264dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta);
-    }
-}
-
-static av_always_inline void filter_mb_edgech(uint8_t *pix, int stride,
-                                              const int16_t bS[4],
-                                              unsigned int qp, int a, int b,
-                                              H264Context *h, int intra)
-{
-    const unsigned int index_a = qp + a;
-    const int alpha = alpha_table[index_a];
-    const int beta  = beta_table[qp + b];
-    if (alpha ==0 || beta == 0) return;
-
-    if( bS[0] < 4 || !intra ) {
-        int8_t tc[4];
-        tc[0] = tc0_table[index_a][bS[0]]+1;
-        tc[1] = tc0_table[index_a][bS[1]]+1;
-        tc[2] = tc0_table[index_a][bS[2]]+1;
-        tc[3] = tc0_table[index_a][bS[3]]+1;
-        h->h264dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc);
-    } else {
-        h->h264dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta);
-    }
-}
-
-static av_always_inline void h264_filter_mb_fast_internal(H264Context *h,
-                                                          int mb_x, int mb_y,
-                                                          uint8_t *img_y,
-                                                          uint8_t *img_cb,
-                                                          uint8_t *img_cr,
-                                                          unsigned int linesize,
-                                                          unsigned int uvlinesize,
-                                                          int pixel_shift)
-{
-    int chroma = !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY));
-    int chroma444 = CHROMA444(h);
-    int chroma422 = CHROMA422(h);
-
-    int mb_xy = h->mb_xy;
-    int left_type= h->left_type[LTOP];
-    int top_type= h->top_type;
-
-    int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
-    int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset;
-    int b = 52 + h->slice_beta_offset - qp_bd_offset;
-
-    int mb_type = h->cur_pic.mb_type[mb_xy];
-    int qp      = h->cur_pic.qscale_table[mb_xy];
-    int qp0     = h->cur_pic.qscale_table[mb_xy - 1];
-    int qp1     = h->cur_pic.qscale_table[h->top_mb_xy];
-    int qpc = get_chroma_qp( h, 0, qp );
-    int qpc0 = get_chroma_qp( h, 0, qp0 );
-    int qpc1 = get_chroma_qp( h, 0, qp1 );
-    qp0 = (qp + qp0 + 1) >> 1;
-    qp1 = (qp + qp1 + 1) >> 1;
-    qpc0 = (qpc + qpc0 + 1) >> 1;
-    qpc1 = (qpc + qpc1 + 1) >> 1;
-
-    if( IS_INTRA(mb_type) ) {
-        static const int16_t bS4[4] = {4,4,4,4};
-        static const int16_t bS3[4] = {3,3,3,3};
-        const int16_t *bSH = FIELD_PICTURE(h) ? bS3 : bS4;
-        if(left_type)
-            filter_mb_edgev( &img_y[4*0<<pixel_shift], linesize, bS4, qp0, a, b, h, 1);
-        if( IS_8x8DCT(mb_type) ) {
-            filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
-            if(top_type){
-                filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);
-            }
-            filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, a, b, h, 0);
-        } else {
-            filter_mb_edgev( &img_y[4*1<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
-            filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
-            filter_mb_edgev( &img_y[4*3<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
-            if(top_type){
-                filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);
-            }
-            filter_mb_edgeh( &img_y[4*1*linesize], linesize, bS3, qp, a, b, h, 0);
-            filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, a, b, h, 0);
-            filter_mb_edgeh( &img_y[4*3*linesize], linesize, bS3, qp, a, b, h, 0);
-        }
-        if(chroma){
-            if(chroma444){
-                if(left_type){
-                    filter_mb_edgev( &img_cb[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);
-                    filter_mb_edgev( &img_cr[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);
-                }
-                if( IS_8x8DCT(mb_type) ) {
-                    filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
-                    if(top_type){
-                        filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );
-                        filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );
-                    }
-                    filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
-                } else {
-                    filter_mb_edgev( &img_cb[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgev( &img_cr[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgev( &img_cb[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgev( &img_cr[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
-                    if(top_type){
-                        filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);
-                        filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);
-                    }
-                    filter_mb_edgeh( &img_cb[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgeh( &img_cr[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgeh( &img_cb[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);
-                    filter_mb_edgeh( &img_cr[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);
-                }
-            }else if(chroma422){
-                if(left_type){
-                    filter_mb_edgecv(&img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
-                    filter_mb_edgecv(&img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
-                }
-                filter_mb_edgecv(&img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
-                filter_mb_edgecv(&img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
-                if(top_type){
-                    filter_mb_edgech(&img_cb[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
-                    filter_mb_edgech(&img_cr[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
-                }
-                filter_mb_edgech(&img_cb[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
-                filter_mb_edgech(&img_cr[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
-                filter_mb_edgech(&img_cb[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
-                filter_mb_edgech(&img_cr[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
-                filter_mb_edgech(&img_cb[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
-                filter_mb_edgech(&img_cr[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
-            }else{
-                if(left_type){
-                    filter_mb_edgecv( &img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
-                    filter_mb_edgecv( &img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
-                }
-                filter_mb_edgecv( &img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
-                filter_mb_edgecv( &img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
-                if(top_type){
-                    filter_mb_edgech( &img_cb[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
-                    filter_mb_edgech( &img_cr[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
-                }
-                filter_mb_edgech( &img_cb[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
-                filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
-            }
-        }
-        return;
-    } else {
-        LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]);
-        int edges;
-        if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 && !chroma444 ) {
-            edges = 4;
-            AV_WN64A(bS[0][0], 0x0002000200020002ULL);
-            AV_WN64A(bS[0][2], 0x0002000200020002ULL);
-            AV_WN64A(bS[1][0], 0x0002000200020002ULL);
-            AV_WN64A(bS[1][2], 0x0002000200020002ULL);
-        } else {
-            int mask_edge1 = (3*(((5*mb_type)>>5)&1)) | (mb_type>>4); //(mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : (mb_type & MB_TYPE_16x8) ? 1 : 0;
-            int mask_edge0 = 3*((mask_edge1>>1) & ((5*left_type)>>5)&1); // (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) && (h->left_type[LTOP] & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : 0;
-            int step =  1+(mb_type>>24); //IS_8x8DCT(mb_type) ? 2 : 1;
-            edges = 4 - 3*((mb_type>>3) & !(h->cbp & 15)); //(mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4;
-            h->h264dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache,
-                                              h->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE(h));
-        }
-        if( IS_INTRA(left_type) )
-            AV_WN64A(bS[0][0], 0x0004000400040004ULL);
-        if( IS_INTRA(top_type) )
-            AV_WN64A(bS[1][0], FIELD_PICTURE(h) ? 0x0003000300030003ULL : 0x0004000400040004ULL);
-
-#define FILTER(hv,dir,edge,intra)\
-        if(AV_RN64A(bS[dir][edge])) {                                   \
-            filter_mb_edge##hv( &img_y[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qp : qp##dir, a, b, h, intra );\
-            if(chroma){\
-                if(chroma444){\
-                    filter_mb_edge##hv( &img_cb[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
-                    filter_mb_edge##hv( &img_cr[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
-                } else if(!(edge&1)) {\
-                    filter_mb_edgec##hv( &img_cb[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
-                    filter_mb_edgec##hv( &img_cr[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
-                }\
-            }\
-        }
-        if(left_type)
-            FILTER(v,0,0,1);
-        if( edges == 1 ) {
-            if(top_type)
-                FILTER(h,1,0,1);
-        } else if( IS_8x8DCT(mb_type) ) {
-            FILTER(v,0,2,0);
-            if(top_type)
-                FILTER(h,1,0,1);
-            FILTER(h,1,2,0);
-        } else {
-            FILTER(v,0,1,0);
-            FILTER(v,0,2,0);
-            FILTER(v,0,3,0);
-            if(top_type)
-                FILTER(h,1,0,1);
-            FILTER(h,1,1,0);
-            FILTER(h,1,2,0);
-            FILTER(h,1,3,0);
-        }
-#undef FILTER
-    }
-}
-
-void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) {
-    assert(!FRAME_MBAFF(h));
-    if(!h->h264dsp.h264_loop_filter_strength || h->pps.chroma_qp_diff) {
-        ff_h264_filter_mb(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize);
-        return;
-    }
-
-#if CONFIG_SMALL
-    h264_filter_mb_fast_internal(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, h->pixel_shift);
-#else
-    if(h->pixel_shift){
-        h264_filter_mb_fast_internal(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, 1);
-    }else{
-        h264_filter_mb_fast_internal(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, 0);
-    }
-#endif
-}
-
-static int check_mv(H264Context *h, long b_idx, long bn_idx, int mvy_limit){
-    int v;
-
-    v= h->ref_cache[0][b_idx] != h->ref_cache[0][bn_idx];
-    if(!v && h->ref_cache[0][b_idx]!=-1)
-        v= h->mv_cache[0][b_idx][0] - h->mv_cache[0][bn_idx][0] + 3 >= 7U |
-           FFABS( h->mv_cache[0][b_idx][1] - h->mv_cache[0][bn_idx][1] ) >= mvy_limit;
-
-    if(h->list_count==2){
-        if(!v)
-            v = h->ref_cache[1][b_idx] != h->ref_cache[1][bn_idx] |
-                h->mv_cache[1][b_idx][0] - h->mv_cache[1][bn_idx][0] + 3 >= 7U |
-                FFABS( h->mv_cache[1][b_idx][1] - h->mv_cache[1][bn_idx][1] ) >= mvy_limit;
-
-        if(v){
-            if(h->ref_cache[0][b_idx] != h->ref_cache[1][bn_idx] |
-               h->ref_cache[1][b_idx] != h->ref_cache[0][bn_idx])
-                return 1;
-            return
-                h->mv_cache[0][b_idx][0] - h->mv_cache[1][bn_idx][0] + 3 >= 7U |
-                FFABS( h->mv_cache[0][b_idx][1] - h->mv_cache[1][bn_idx][1] ) >= mvy_limit |
-                h->mv_cache[1][b_idx][0] - h->mv_cache[0][bn_idx][0] + 3 >= 7U |
-                FFABS( h->mv_cache[1][b_idx][1] - h->mv_cache[0][bn_idx][1] ) >= mvy_limit;
-        }
-    }
-
-    return v;
-}
-
-static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize, int mb_xy, int mb_type, int mvy_limit, int first_vertical_edge_done, int a, int b, int chroma, int dir) {
-    int edge;
-    int chroma_qp_avg[2];
-    int chroma444 = CHROMA444(h);
-    int chroma422 = CHROMA422(h);
-    const int mbm_xy = dir == 0 ? mb_xy -1 : h->top_mb_xy;
-    const int mbm_type = dir == 0 ? h->left_type[LTOP] : h->top_type;
-
-    // how often to recheck mv-based bS when iterating between edges
-    static const uint8_t mask_edge_tab[2][8]={{0,3,3,3,1,1,1,1},
-                                              {0,3,1,1,3,3,3,3}};
-    const int mask_edge = mask_edge_tab[dir][(mb_type>>3)&7];
-    const int edges = mask_edge== 3 && !(h->cbp&15) ? 1 : 4;
-
-    // how often to recheck mv-based bS when iterating along each edge
-    const int mask_par0 = mb_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir));
-
-    if(mbm_type && !first_vertical_edge_done){
-
-        if (FRAME_MBAFF(h) && (dir == 1) && ((mb_y&1) == 0)
-            && IS_INTERLACED(mbm_type&~mb_type)
-            ) {
-            // This is a special case in the norm where the filtering must
-            // be done twice (one each of the field) even if we are in a
-            // frame macroblock.
-            //
-            unsigned int tmp_linesize   = 2 *   linesize;
-            unsigned int tmp_uvlinesize = 2 * uvlinesize;
-            int mbn_xy = mb_xy - 2 * h->mb_stride;
-            int j;
-
-            for(j=0; j<2; j++, mbn_xy += h->mb_stride){
-                DECLARE_ALIGNED(8, int16_t, bS)[4];
-                int qp;
-                if (IS_INTRA(mb_type | h->cur_pic.mb_type[mbn_xy])) {
-                    AV_WN64A(bS, 0x0003000300030003ULL);
-                } else {
-                    if (!CABAC(h) && IS_8x8DCT(h->cur_pic.mb_type[mbn_xy])) {
-                        bS[0]= 1+((h->cbp_table[mbn_xy] & 0x4000)||h->non_zero_count_cache[scan8[0]+0]);
-                        bS[1]= 1+((h->cbp_table[mbn_xy] & 0x4000)||h->non_zero_count_cache[scan8[0]+1]);
-                        bS[2]= 1+((h->cbp_table[mbn_xy] & 0x8000)||h->non_zero_count_cache[scan8[0]+2]);
-                        bS[3]= 1+((h->cbp_table[mbn_xy] & 0x8000)||h->non_zero_count_cache[scan8[0]+3]);
-                    }else{
-                    const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy] + 3*4;
-                    int i;
-                    for( i = 0; i < 4; i++ ) {
-                        bS[i] = 1 + !!(h->non_zero_count_cache[scan8[0]+i] | mbn_nnz[i]);
-                    }
-                    }
-                }
-                // Do not use s->qscale as luma quantizer because it has not the same
-                // value in IPCM macroblocks.
-                qp = (h->cur_pic.qscale_table[mb_xy] + h->cur_pic.qscale_table[mbn_xy] + 1) >> 1;
-                tprintf(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, tmp_linesize, tmp_uvlinesize);
-                { int i; for (i = 0; i < 4; i++) tprintf(h->avctx, " bS[%d]:%d", i, bS[i]); tprintf(h->avctx, "\n"); }
-                filter_mb_edgeh( &img_y[j*linesize], tmp_linesize, bS, qp, a, b, h, 0 );
-                chroma_qp_avg[0] = (h->chroma_qp[0] + get_chroma_qp(h, 0, h->cur_pic.qscale_table[mbn_xy]) + 1) >> 1;
-                chroma_qp_avg[1] = (h->chroma_qp[1] + get_chroma_qp(h, 1, h->cur_pic.qscale_table[mbn_xy]) + 1) >> 1;
-                if (chroma) {
-                    if (chroma444) {
-                        filter_mb_edgeh (&img_cb[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp_avg[0], a, b, h, 0);
-                        filter_mb_edgeh (&img_cr[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp_avg[1], a, b, h, 0);
-                    } else {
-                        filter_mb_edgech(&img_cb[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp_avg[0], a, b, h, 0);
-                        filter_mb_edgech(&img_cr[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp_avg[1], a, b, h, 0);
-                    }
-                }
-            }
-        }else{
-            DECLARE_ALIGNED(8, int16_t, bS)[4];
-            int qp;
-
-            if( IS_INTRA(mb_type|mbm_type)) {
-                AV_WN64A(bS, 0x0003000300030003ULL);
-                if (   (!IS_INTERLACED(mb_type|mbm_type))
-                    || ((FRAME_MBAFF(h) || (h->picture_structure != PICT_FRAME)) && (dir == 0))
-                )
-                    AV_WN64A(bS, 0x0004000400040004ULL);
-            } else {
-                int i;
-                int mv_done;
-
-                if( dir && FRAME_MBAFF(h) && IS_INTERLACED(mb_type ^ mbm_type)) {
-                    AV_WN64A(bS, 0x0001000100010001ULL);
-                    mv_done = 1;
-                }
-                else if( mask_par0 && ((mbm_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)))) ) {
-                    int b_idx= 8 + 4;
-                    int bn_idx= b_idx - (dir ? 8:1);
-
-                    bS[0] = bS[1] = bS[2] = bS[3] = check_mv(h, 8 + 4, bn_idx, mvy_limit);
-                    mv_done = 1;
-                }
-                else
-                    mv_done = 0;
-
-                for( i = 0; i < 4; i++ ) {
-                    int x = dir == 0 ? 0 : i;
-                    int y = dir == 0 ? i    : 0;
-                    int b_idx= 8 + 4 + x + 8*y;
-                    int bn_idx= b_idx - (dir ? 8:1);
-
-                    if( h->non_zero_count_cache[b_idx] |
-                        h->non_zero_count_cache[bn_idx] ) {
-                        bS[i] = 2;
-                    }
-                    else if(!mv_done)
-                    {
-                        bS[i] = check_mv(h, b_idx, bn_idx, mvy_limit);
-                    }
-                }
-            }
-
-            /* Filter edge */
-            // Do not use s->qscale as luma quantizer because it has not the same
-            // value in IPCM macroblocks.
-            if(bS[0]+bS[1]+bS[2]+bS[3]){
-                qp = (h->cur_pic.qscale_table[mb_xy] + h->cur_pic.qscale_table[mbm_xy] + 1) >> 1;
-                tprintf(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
-                chroma_qp_avg[0] = (h->chroma_qp[0] + get_chroma_qp(h, 0, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
-                chroma_qp_avg[1] = (h->chroma_qp[1] + get_chroma_qp(h, 1, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
-                if( dir == 0 ) {
-                    filter_mb_edgev( &img_y[0], linesize, bS, qp, a, b, h, 1 );
-                    if (chroma) {
-                        if (chroma444) {
-                            filter_mb_edgev ( &img_cb[0], uvlinesize, bS, chroma_qp_avg[0], a, b, h, 1);
-                            filter_mb_edgev ( &img_cr[0], uvlinesize, bS, chroma_qp_avg[1], a, b, h, 1);
-                        } else {
-                            filter_mb_edgecv( &img_cb[0], uvlinesize, bS, chroma_qp_avg[0], a, b, h, 1);
-                            filter_mb_edgecv( &img_cr[0], uvlinesize, bS, chroma_qp_avg[1], a, b, h, 1);
-                        }
-                    }
-                } else {
-                    filter_mb_edgeh( &img_y[0], linesize, bS, qp, a, b, h, 1 );
-                    if (chroma) {
-                        if (chroma444) {
-                            filter_mb_edgeh ( &img_cb[0], uvlinesize, bS, chroma_qp_avg[0], a, b, h, 1);
-                            filter_mb_edgeh ( &img_cr[0], uvlinesize, bS, chroma_qp_avg[1], a, b, h, 1);
-                        } else {
-                            filter_mb_edgech( &img_cb[0], uvlinesize, bS, chroma_qp_avg[0], a, b, h, 1);
-                            filter_mb_edgech( &img_cr[0], uvlinesize, bS, chroma_qp_avg[1], a, b, h, 1);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /* Calculate bS */
-    for( edge = 1; edge < edges; edge++ ) {
-        DECLARE_ALIGNED(8, int16_t, bS)[4];
-        int qp;
-        const int deblock_edge = !IS_8x8DCT(mb_type & (edge<<24)); // (edge&1) && IS_8x8DCT(mb_type)
-
-        if (!deblock_edge && (!chroma422 || dir == 0))
-            continue;
-
-        if( IS_INTRA(mb_type)) {
-            AV_WN64A(bS, 0x0003000300030003ULL);
-        } else {
-            int i;
-            int mv_done;
-
-            if( edge & mask_edge ) {
-                AV_ZERO64(bS);
-                mv_done = 1;
-            }
-            else if( mask_par0 ) {
-                int b_idx= 8 + 4 + edge * (dir ? 8:1);
-                int bn_idx= b_idx - (dir ? 8:1);
-
-                bS[0] = bS[1] = bS[2] = bS[3] = check_mv(h, b_idx, bn_idx, mvy_limit);
-                mv_done = 1;
-            }
-            else
-                mv_done = 0;
-
-            for( i = 0; i < 4; i++ ) {
-                int x = dir == 0 ? edge : i;
-                int y = dir == 0 ? i    : edge;
-                int b_idx= 8 + 4 + x + 8*y;
-                int bn_idx= b_idx - (dir ? 8:1);
-
-                if( h->non_zero_count_cache[b_idx] |
-                    h->non_zero_count_cache[bn_idx] ) {
-                    bS[i] = 2;
-                }
-                else if(!mv_done)
-                {
-                    bS[i] = check_mv(h, b_idx, bn_idx, mvy_limit);
-                }
-            }
-
-            if(bS[0]+bS[1]+bS[2]+bS[3] == 0)
-                continue;
-        }
-
-        /* Filter edge */
-        // Do not use s->qscale as luma quantizer because it has not the same
-        // value in IPCM macroblocks.
-        qp = h->cur_pic.qscale_table[mb_xy];
-        tprintf(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
-        if( dir == 0 ) {
-            filter_mb_edgev( &img_y[4*edge << h->pixel_shift], linesize, bS, qp, a, b, h, 0 );
-            if (chroma) {
-                if (chroma444) {
-                    filter_mb_edgev ( &img_cb[4*edge << h->pixel_shift], uvlinesize, bS, h->chroma_qp[0], a, b, h, 0);
-                    filter_mb_edgev ( &img_cr[4*edge << h->pixel_shift], uvlinesize, bS, h->chroma_qp[1], a, b, h, 0);
-                } else if( (edge&1) == 0 ) {
-                    filter_mb_edgecv( &img_cb[2*edge << h->pixel_shift], uvlinesize, bS, h->chroma_qp[0], a, b, h, 0);
-                    filter_mb_edgecv( &img_cr[2*edge << h->pixel_shift], uvlinesize, bS, h->chroma_qp[1], a, b, h, 0);
-                }
-            }
-        } else {
-            if (chroma422) {
-                if (deblock_edge)
-                    filter_mb_edgeh(&img_y[4*edge*linesize], linesize, bS, qp, a, b, h, 0);
-                if (chroma) {
-                    filter_mb_edgech(&img_cb[4*edge*uvlinesize], uvlinesize, bS, h->chroma_qp[0], a, b, h, 0);
-                    filter_mb_edgech(&img_cr[4*edge*uvlinesize], uvlinesize, bS, h->chroma_qp[1], a, b, h, 0);
-                }
-            } else {
-                filter_mb_edgeh(&img_y[4*edge*linesize], linesize, bS, qp, a, b, h, 0);
-                if (chroma) {
-                    if (chroma444) {
-                        filter_mb_edgeh (&img_cb[4*edge*uvlinesize], uvlinesize, bS, h->chroma_qp[0], a, b, h, 0);
-                        filter_mb_edgeh (&img_cr[4*edge*uvlinesize], uvlinesize, bS, h->chroma_qp[1], a, b, h, 0);
-                    } else if ((edge&1) == 0) {
-                        filter_mb_edgech(&img_cb[2*edge*uvlinesize], uvlinesize, bS, h->chroma_qp[0], a, b, h, 0);
-                        filter_mb_edgech(&img_cr[2*edge*uvlinesize], uvlinesize, bS, h->chroma_qp[1], a, b, h, 0);
-                    }
-                }
-            }
-        }
-    }
-}
-
-void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) {
-    const int mb_xy= mb_x + mb_y*h->mb_stride;
-    const int mb_type = h->cur_pic.mb_type[mb_xy];
-    const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4;
-    int first_vertical_edge_done = 0;
-    av_unused int dir;
-    int chroma = !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY));
-    int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
-    int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset;
-    int b = 52 + h->slice_beta_offset - qp_bd_offset;
-
-    if (FRAME_MBAFF(h)
-            // and current and left pair do not have the same interlaced type
-            && IS_INTERLACED(mb_type^h->left_type[LTOP])
-            // and left mb is in available to us
-            && h->left_type[LTOP]) {
-        /* First vertical edge is different in MBAFF frames
-         * There are 8 different bS to compute and 2 different Qp
-         */
-        DECLARE_ALIGNED(8, int16_t, bS)[8];
-        int qp[2];
-        int bqp[2];
-        int rqp[2];
-        int mb_qp, mbn0_qp, mbn1_qp;
-        int i;
-        first_vertical_edge_done = 1;
-
-        if( IS_INTRA(mb_type) ) {
-            AV_WN64A(&bS[0], 0x0004000400040004ULL);
-            AV_WN64A(&bS[4], 0x0004000400040004ULL);
-        } else {
-            static const uint8_t offset[2][2][8]={
-                {
-                    {3+4*0, 3+4*0, 3+4*0, 3+4*0, 3+4*1, 3+4*1, 3+4*1, 3+4*1},
-                    {3+4*2, 3+4*2, 3+4*2, 3+4*2, 3+4*3, 3+4*3, 3+4*3, 3+4*3},
-                },{
-                    {3+4*0, 3+4*1, 3+4*2, 3+4*3, 3+4*0, 3+4*1, 3+4*2, 3+4*3},
-                    {3+4*0, 3+4*1, 3+4*2, 3+4*3, 3+4*0, 3+4*1, 3+4*2, 3+4*3},
-                }
-            };
-            const uint8_t *off= offset[MB_FIELD(h)][mb_y&1];
-            for( i = 0; i < 8; i++ ) {
-                int j= MB_FIELD(h) ? i>>2 : i&1;
-                int mbn_xy = h->left_mb_xy[LEFT(j)];
-                int mbn_type= h->left_type[LEFT(j)];
-
-                if( IS_INTRA( mbn_type ) )
-                    bS[i] = 4;
-                else{
-                    bS[i] = 1 + !!(h->non_zero_count_cache[12+8*(i>>1)] |
-                         ((!h->pps.cabac && IS_8x8DCT(mbn_type)) ?
-                            (h->cbp_table[mbn_xy] & (((MB_FIELD(h) ? (i&2) : (mb_y&1)) ? 8 : 2) << 12))
-                                                                       :
-                            h->non_zero_count[mbn_xy][ off[i] ]));
-                }
-            }
-        }
-
-        mb_qp   = h->cur_pic.qscale_table[mb_xy];
-        mbn0_qp = h->cur_pic.qscale_table[h->left_mb_xy[0]];
-        mbn1_qp = h->cur_pic.qscale_table[h->left_mb_xy[1]];
-        qp[0] = ( mb_qp + mbn0_qp + 1 ) >> 1;
-        bqp[0] = ( get_chroma_qp( h, 0, mb_qp ) +
-                   get_chroma_qp( h, 0, mbn0_qp ) + 1 ) >> 1;
-        rqp[0] = ( get_chroma_qp( h, 1, mb_qp ) +
-                   get_chroma_qp( h, 1, mbn0_qp ) + 1 ) >> 1;
-        qp[1] = ( mb_qp + mbn1_qp + 1 ) >> 1;
-        bqp[1] = ( get_chroma_qp( h, 0, mb_qp ) +
-                   get_chroma_qp( h, 0, mbn1_qp ) + 1 ) >> 1;
-        rqp[1] = ( get_chroma_qp( h, 1, mb_qp ) +
-                   get_chroma_qp( h, 1, mbn1_qp ) + 1 ) >> 1;
-
-        /* Filter edge */
-        tprintf(h->avctx, "filter mb:%d/%d MBAFF, QPy:%d/%d, QPb:%d/%d QPr:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], bqp[0], bqp[1], rqp[0], rqp[1], linesize, uvlinesize);
-        { int i; for (i = 0; i < 8; i++) tprintf(h->avctx, " bS[%d]:%d", i, bS[i]); tprintf(h->avctx, "\n"); }
-        if (MB_FIELD(h)) {
-            filter_mb_mbaff_edgev ( h, img_y                ,   linesize, bS  , 1, qp [0], a, b, 1 );
-            filter_mb_mbaff_edgev ( h, img_y  + 8*  linesize,   linesize, bS+4, 1, qp [1], a, b, 1 );
-            if (chroma){
-                if (CHROMA444(h)) {
-                    filter_mb_mbaff_edgev ( h, img_cb,                uvlinesize, bS  , 1, bqp[0], a, b, 1 );
-                    filter_mb_mbaff_edgev ( h, img_cb + 8*uvlinesize, uvlinesize, bS+4, 1, bqp[1], a, b, 1 );
-                    filter_mb_mbaff_edgev ( h, img_cr,                uvlinesize, bS  , 1, rqp[0], a, b, 1 );
-                    filter_mb_mbaff_edgev ( h, img_cr + 8*uvlinesize, uvlinesize, bS+4, 1, rqp[1], a, b, 1 );
-                } else if (CHROMA422(h)) {
-                    filter_mb_mbaff_edgecv(h, img_cb,                uvlinesize, bS  , 1, bqp[0], a, b, 1);
-                    filter_mb_mbaff_edgecv(h, img_cb + 8*uvlinesize, uvlinesize, bS+4, 1, bqp[1], a, b, 1);
-                    filter_mb_mbaff_edgecv(h, img_cr,                uvlinesize, bS  , 1, rqp[0], a, b, 1);
-                    filter_mb_mbaff_edgecv(h, img_cr + 8*uvlinesize, uvlinesize, bS+4, 1, rqp[1], a, b, 1);
-                }else{
-                    filter_mb_mbaff_edgecv( h, img_cb,                uvlinesize, bS  , 1, bqp[0], a, b, 1 );
-                    filter_mb_mbaff_edgecv( h, img_cb + 4*uvlinesize, uvlinesize, bS+4, 1, bqp[1], a, b, 1 );
-                    filter_mb_mbaff_edgecv( h, img_cr,                uvlinesize, bS  , 1, rqp[0], a, b, 1 );
-                    filter_mb_mbaff_edgecv( h, img_cr + 4*uvlinesize, uvlinesize, bS+4, 1, rqp[1], a, b, 1 );
-                }
-            }
-        }else{
-            filter_mb_mbaff_edgev ( h, img_y              , 2*  linesize, bS  , 2, qp [0], a, b, 1 );
-            filter_mb_mbaff_edgev ( h, img_y  +   linesize, 2*  linesize, bS+1, 2, qp [1], a, b, 1 );
-            if (chroma){
-                if (CHROMA444(h)) {
-                    filter_mb_mbaff_edgev ( h, img_cb,              2*uvlinesize, bS  , 2, bqp[0], a, b, 1 );
-                    filter_mb_mbaff_edgev ( h, img_cb + uvlinesize, 2*uvlinesize, bS+1, 2, bqp[1], a, b, 1 );
-                    filter_mb_mbaff_edgev ( h, img_cr,              2*uvlinesize, bS  , 2, rqp[0], a, b, 1 );
-                    filter_mb_mbaff_edgev ( h, img_cr + uvlinesize, 2*uvlinesize, bS+1, 2, rqp[1], a, b, 1 );
-                }else{
-                    filter_mb_mbaff_edgecv( h, img_cb,              2*uvlinesize, bS  , 2, bqp[0], a, b, 1 );
-                    filter_mb_mbaff_edgecv( h, img_cb + uvlinesize, 2*uvlinesize, bS+1, 2, bqp[1], a, b, 1 );
-                    filter_mb_mbaff_edgecv( h, img_cr,              2*uvlinesize, bS  , 2, rqp[0], a, b, 1 );
-                    filter_mb_mbaff_edgecv( h, img_cr + uvlinesize, 2*uvlinesize, bS+1, 2, rqp[1], a, b, 1 );
-                }
-            }
-        }
-    }
-
-#if CONFIG_SMALL
-    for( dir = 0; dir < 2; dir++ )
-        filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, dir ? 0 : first_vertical_edge_done, a, b, chroma, dir);
-#else
-    filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, first_vertical_edge_done, a, b, chroma, 0);
-    filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, 0,                        a, b, chroma, 1);
-#endif
-}
diff --git a/deps/libav/libavcodec/h264_mb_template.c b/deps/libav/libavcodec/h264_mb_template.c
deleted file mode 100644
index 9b63fef..0000000
--- a/deps/libav/libavcodec/h264_mb_template.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#undef FUNC
-#undef PIXEL_SHIFT
-
-#if SIMPLE
-#   define FUNC(n) AV_JOIN(n ## _simple_, BITS)
-#   define PIXEL_SHIFT (BITS >> 4)
-#else
-#   define FUNC(n) n ## _complex
-#   define PIXEL_SHIFT h->pixel_shift
-#endif
-
-#undef  CHROMA_IDC
-#define CHROMA_IDC 1
-#include "h264_mc_template.c"
-
-#undef  CHROMA_IDC
-#define CHROMA_IDC 2
-#include "h264_mc_template.c"
-
-static av_noinline void FUNC(hl_decode_mb)(H264Context *h)
-{
-    const int mb_x    = h->mb_x;
-    const int mb_y    = h->mb_y;
-    const int mb_xy   = h->mb_xy;
-    const int mb_type = h->cur_pic.mb_type[mb_xy];
-    uint8_t *dest_y, *dest_cb, *dest_cr;
-    int linesize, uvlinesize /*dct_offset*/;
-    int i, j;
-    int *block_offset = &h->block_offset[0];
-    const int transform_bypass = !SIMPLE && (h->qscale == 0 && h->sps.transform_bypass);
-    /* is_h264 should always be true if SVQ3 is disabled. */
-    const int is_h264 = !CONFIG_SVQ3_DECODER || SIMPLE || h->avctx->codec_id == AV_CODEC_ID_H264;
-    void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
-    const int block_h   = 16 >> h->chroma_y_shift;
-    const int chroma422 = CHROMA422(h);
-
-    dest_y  = h->cur_pic.f.data[0] + ((mb_x << PIXEL_SHIFT)     + mb_y * h->linesize)  * 16;
-    dest_cb = h->cur_pic.f.data[1] +  (mb_x << PIXEL_SHIFT) * 8 + mb_y * h->uvlinesize * block_h;
-    dest_cr = h->cur_pic.f.data[2] +  (mb_x << PIXEL_SHIFT) * 8 + mb_y * h->uvlinesize * block_h;
-
-    h->vdsp.prefetch(dest_y  + (h->mb_x & 3) * 4 * h->linesize   + (64 << PIXEL_SHIFT), h->linesize,       4);
-    h->vdsp.prefetch(dest_cb + (h->mb_x & 7)     * h->uvlinesize + (64 << PIXEL_SHIFT), dest_cr - dest_cb, 2);
-
-    h->list_counts[mb_xy] = h->list_count;
-
-    if (!SIMPLE && MB_FIELD(h)) {
-        linesize     = h->mb_linesize = h->linesize * 2;
-        uvlinesize   = h->mb_uvlinesize = h->uvlinesize * 2;
-        block_offset = &h->block_offset[48];
-        if (mb_y & 1) { // FIXME move out of this function?
-            dest_y  -= h->linesize * 15;
-            dest_cb -= h->uvlinesize * (block_h - 1);
-            dest_cr -= h->uvlinesize * (block_h - 1);
-        }
-        if (FRAME_MBAFF(h)) {
-            int list;
-            for (list = 0; list < h->list_count; list++) {
-                if (!USES_LIST(mb_type, list))
-                    continue;
-                if (IS_16X16(mb_type)) {
-                    int8_t *ref = &h->ref_cache[list][scan8[0]];
-                    fill_rectangle(ref, 4, 4, 8, (16 + *ref) ^ (h->mb_y & 1), 1);
-                } else {
-                    for (i = 0; i < 16; i += 4) {
-                        int ref = h->ref_cache[list][scan8[i]];
-                        if (ref >= 0)
-                            fill_rectangle(&h->ref_cache[list][scan8[i]], 2, 2,
-                                           8, (16 + ref) ^ (h->mb_y & 1), 1);
-                    }
-                }
-            }
-        }
-    } else {
-        linesize   = h->mb_linesize   = h->linesize;
-        uvlinesize = h->mb_uvlinesize = h->uvlinesize;
-        // dct_offset = s->linesize * 16;
-    }
-
-    if (!SIMPLE && IS_INTRA_PCM(mb_type)) {
-        if (PIXEL_SHIFT) {
-            const int bit_depth = h->sps.bit_depth_luma;
-            int j;
-            GetBitContext gb;
-            init_get_bits(&gb, h->intra_pcm_ptr,
-                          ff_h264_mb_sizes[h->sps.chroma_format_idc] * bit_depth);
-
-            for (i = 0; i < 16; i++) {
-                uint16_t *tmp_y = (uint16_t *)(dest_y + i * linesize);
-                for (j = 0; j < 16; j++)
-                    tmp_y[j] = get_bits(&gb, bit_depth);
-            }
-            if (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
-                if (!h->sps.chroma_format_idc) {
-                    for (i = 0; i < block_h; i++) {
-                        uint16_t *tmp_cb = (uint16_t *)(dest_cb + i * uvlinesize);
-                        for (j = 0; j < 8; j++)
-                            tmp_cb[j] = 1 << (bit_depth - 1);
-                    }
-                    for (i = 0; i < block_h; i++) {
-                        uint16_t *tmp_cr = (uint16_t *)(dest_cr + i * uvlinesize);
-                        for (j = 0; j < 8; j++)
-                            tmp_cr[j] = 1 << (bit_depth - 1);
-                    }
-                } else {
-                    for (i = 0; i < block_h; i++) {
-                        uint16_t *tmp_cb = (uint16_t *)(dest_cb + i * uvlinesize);
-                        for (j = 0; j < 8; j++)
-                            tmp_cb[j] = get_bits(&gb, bit_depth);
-                    }
-                    for (i = 0; i < block_h; i++) {
-                        uint16_t *tmp_cr = (uint16_t *)(dest_cr + i * uvlinesize);
-                        for (j = 0; j < 8; j++)
-                            tmp_cr[j] = get_bits(&gb, bit_depth);
-                    }
-                }
-            }
-        } else {
-            for (i = 0; i < 16; i++)
-                memcpy(dest_y + i * linesize, h->intra_pcm_ptr + i * 16, 16);
-            if (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
-                if (!h->sps.chroma_format_idc) {
-                    for (i = 0; i < block_h; i++) {
-                        memset(dest_cb + i * uvlinesize, 128, 8);
-                        memset(dest_cr + i * uvlinesize, 128, 8);
-                    }
-                } else {
-                    const uint8_t *src_cb = h->intra_pcm_ptr + 256;
-                    const uint8_t *src_cr = h->intra_pcm_ptr + 256 + block_h * 8;
-                    for (i = 0; i < block_h; i++) {
-                        memcpy(dest_cb + i * uvlinesize, src_cb + i * 8, 8);
-                        memcpy(dest_cr + i * uvlinesize, src_cr + i * 8, 8);
-                    }
-                }
-            }
-        }
-    } else {
-        if (IS_INTRA(mb_type)) {
-            if (h->deblocking_filter)
-                xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize,
-                               uvlinesize, 1, 0, SIMPLE, PIXEL_SHIFT);
-
-            if (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
-                h->hpc.pred8x8[h->chroma_pred_mode](dest_cb, uvlinesize);
-                h->hpc.pred8x8[h->chroma_pred_mode](dest_cr, uvlinesize);
-            }
-
-            hl_decode_mb_predict_luma(h, mb_type, is_h264, SIMPLE,
-                                      transform_bypass, PIXEL_SHIFT,
-                                      block_offset, linesize, dest_y, 0);
-
-            if (h->deblocking_filter)
-                xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize,
-                               uvlinesize, 0, 0, SIMPLE, PIXEL_SHIFT);
-        } else if (is_h264) {
-            if (chroma422) {
-                FUNC(hl_motion_422)(h, dest_y, dest_cb, dest_cr,
-                              h->me.qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
-                              h->me.qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
-                              h->h264dsp.weight_h264_pixels_tab,
-                              h->h264dsp.biweight_h264_pixels_tab);
-            } else {
-                FUNC(hl_motion_420)(h, dest_y, dest_cb, dest_cr,
-                              h->me.qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
-                              h->me.qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
-                              h->h264dsp.weight_h264_pixels_tab,
-                              h->h264dsp.biweight_h264_pixels_tab);
-            }
-        }
-
-        hl_decode_mb_idct_luma(h, mb_type, is_h264, SIMPLE, transform_bypass,
-                               PIXEL_SHIFT, block_offset, linesize, dest_y, 0);
-
-        if ((SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) &&
-            (h->cbp & 0x30)) {
-            uint8_t *dest[2] = { dest_cb, dest_cr };
-            if (transform_bypass) {
-                if (IS_INTRA(mb_type) && h->sps.profile_idc == 244 &&
-                    (h->chroma_pred_mode == VERT_PRED8x8 ||
-                     h->chroma_pred_mode == HOR_PRED8x8)) {
-                    h->hpc.pred8x8_add[h->chroma_pred_mode](dest[0],
-                                                            block_offset + 16,
-                                                            h->mb + (16 * 16 * 1 << PIXEL_SHIFT),
-                                                            uvlinesize);
-                    h->hpc.pred8x8_add[h->chroma_pred_mode](dest[1],
-                                                            block_offset + 32,
-                                                            h->mb + (16 * 16 * 2 << PIXEL_SHIFT),
-                                                            uvlinesize);
-                } else {
-                    idct_add = h->h264dsp.h264_add_pixels4_clear;
-                    for (j = 1; j < 3; j++) {
-                        for (i = j * 16; i < j * 16 + 4; i++)
-                            if (h->non_zero_count_cache[scan8[i]] ||
-                                dctcoef_get(h->mb, PIXEL_SHIFT, i * 16))
-                                idct_add(dest[j - 1] + block_offset[i],
-                                         h->mb + (i * 16 << PIXEL_SHIFT),
-                                         uvlinesize);
-                        if (chroma422) {
-                            for (i = j * 16 + 4; i < j * 16 + 8; i++)
-                                if (h->non_zero_count_cache[scan8[i + 4]] ||
-                                    dctcoef_get(h->mb, PIXEL_SHIFT, i * 16))
-                                    idct_add(dest[j - 1] + block_offset[i + 4],
-                                             h->mb + (i * 16 << PIXEL_SHIFT),
-                                             uvlinesize);
-                        }
-                    }
-                }
-            } else {
-                if (is_h264) {
-                    int qp[2];
-                    if (chroma422) {
-                        qp[0] = h->chroma_qp[0] + 3;
-                        qp[1] = h->chroma_qp[1] + 3;
-                    } else {
-                        qp[0] = h->chroma_qp[0];
-                        qp[1] = h->chroma_qp[1];
-                    }
-                    if (h->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 0]])
-                        h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16 * 16 * 1 << PIXEL_SHIFT),
-                                                               h->dequant4_coeff[IS_INTRA(mb_type) ? 1 : 4][qp[0]][0]);
-                    if (h->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 1]])
-                        h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16 * 16 * 2 << PIXEL_SHIFT),
-                                                               h->dequant4_coeff[IS_INTRA(mb_type) ? 2 : 5][qp[1]][0]);
-                    h->h264dsp.h264_idct_add8(dest, block_offset,
-                                              h->mb, uvlinesize,
-                                              h->non_zero_count_cache);
-                } else if (CONFIG_SVQ3_DECODER) {
-                    h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16 * 16 * 1,
-                                                           h->dequant4_coeff[IS_INTRA(mb_type) ? 1 : 4][h->chroma_qp[0]][0]);
-                    h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16 * 16 * 2,
-                                                           h->dequant4_coeff[IS_INTRA(mb_type) ? 2 : 5][h->chroma_qp[1]][0]);
-                    for (j = 1; j < 3; j++) {
-                        for (i = j * 16; i < j * 16 + 4; i++)
-                            if (h->non_zero_count_cache[scan8[i]] || h->mb[i * 16]) {
-                                uint8_t *const ptr = dest[j - 1] + block_offset[i];
-                                ff_svq3_add_idct_c(ptr, h->mb + i * 16,
-                                                   uvlinesize,
-                                                   ff_h264_chroma_qp[0][h->qscale + 12] - 12, 2);
-                            }
-                    }
-                }
-            }
-        }
-    }
-}
-
-#if !SIMPLE || BITS == 8
-
-#undef  CHROMA_IDC
-#define CHROMA_IDC 3
-#include "h264_mc_template.c"
-
-static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h)
-{
-    const int mb_x    = h->mb_x;
-    const int mb_y    = h->mb_y;
-    const int mb_xy   = h->mb_xy;
-    const int mb_type = h->cur_pic.mb_type[mb_xy];
-    uint8_t *dest[3];
-    int linesize;
-    int i, j, p;
-    int *block_offset = &h->block_offset[0];
-    const int transform_bypass = !SIMPLE && (h->qscale == 0 && h->sps.transform_bypass);
-    const int plane_count      = (SIMPLE || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) ? 3 : 1;
-
-    for (p = 0; p < plane_count; p++) {
-        dest[p] = h->cur_pic.f.data[p] +
-                  ((mb_x << PIXEL_SHIFT) + mb_y * h->linesize) * 16;
-        h->vdsp.prefetch(dest[p] + (h->mb_x & 3) * 4 * h->linesize + (64 << PIXEL_SHIFT),
-                         h->linesize, 4);
-    }
-
-    h->list_counts[mb_xy] = h->list_count;
-
-    if (!SIMPLE && MB_FIELD(h)) {
-        linesize     = h->mb_linesize = h->mb_uvlinesize = h->linesize * 2;
-        block_offset = &h->block_offset[48];
-        if (mb_y & 1) // FIXME move out of this function?
-            for (p = 0; p < 3; p++)
-                dest[p] -= h->linesize * 15;
-        if (FRAME_MBAFF(h)) {
-            int list;
-            for (list = 0; list < h->list_count; list++) {
-                if (!USES_LIST(mb_type, list))
-                    continue;
-                if (IS_16X16(mb_type)) {
-                    int8_t *ref = &h->ref_cache[list][scan8[0]];
-                    fill_rectangle(ref, 4, 4, 8, (16 + *ref) ^ (h->mb_y & 1), 1);
-                } else {
-                    for (i = 0; i < 16; i += 4) {
-                        int ref = h->ref_cache[list][scan8[i]];
-                        if (ref >= 0)
-                            fill_rectangle(&h->ref_cache[list][scan8[i]], 2, 2,
-                                           8, (16 + ref) ^ (h->mb_y & 1), 1);
-                    }
-                }
-            }
-        }
-    } else {
-        linesize = h->mb_linesize = h->mb_uvlinesize = h->linesize;
-    }
-
-    if (!SIMPLE && IS_INTRA_PCM(mb_type)) {
-        if (PIXEL_SHIFT) {
-            const int bit_depth = h->sps.bit_depth_luma;
-            GetBitContext gb;
-            init_get_bits(&gb, h->intra_pcm_ptr, 768 * bit_depth);
-
-            for (p = 0; p < plane_count; p++)
-                for (i = 0; i < 16; i++) {
-                    uint16_t *tmp = (uint16_t *)(dest[p] + i * linesize);
-                    for (j = 0; j < 16; j++)
-                        tmp[j] = get_bits(&gb, bit_depth);
-                }
-        } else {
-            for (p = 0; p < plane_count; p++)
-                for (i = 0; i < 16; i++)
-                    memcpy(dest[p] + i * linesize,
-                           h->intra_pcm_ptr + p * 256 + i * 16, 16);
-        }
-    } else {
-        if (IS_INTRA(mb_type)) {
-            if (h->deblocking_filter)
-                xchg_mb_border(h, dest[0], dest[1], dest[2], linesize,
-                               linesize, 1, 1, SIMPLE, PIXEL_SHIFT);
-
-            for (p = 0; p < plane_count; p++)
-                hl_decode_mb_predict_luma(h, mb_type, 1, SIMPLE,
-                                          transform_bypass, PIXEL_SHIFT,
-                                          block_offset, linesize, dest[p], p);
-
-            if (h->deblocking_filter)
-                xchg_mb_border(h, dest[0], dest[1], dest[2], linesize,
-                               linesize, 0, 1, SIMPLE, PIXEL_SHIFT);
-        } else {
-            FUNC(hl_motion_444)(h, dest[0], dest[1], dest[2],
-                      h->me.qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
-                      h->me.qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
-                      h->h264dsp.weight_h264_pixels_tab,
-                      h->h264dsp.biweight_h264_pixels_tab);
-        }
-
-        for (p = 0; p < plane_count; p++)
-            hl_decode_mb_idct_luma(h, mb_type, 1, SIMPLE, transform_bypass,
-                                   PIXEL_SHIFT, block_offset, linesize,
-                                   dest[p], p);
-    }
-}
-
-#endif
diff --git a/deps/libav/libavcodec/h264_mc_template.c b/deps/libav/libavcodec/h264_mc_template.c
deleted file mode 100644
index dee02f5..0000000
--- a/deps/libav/libavcodec/h264_mc_template.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#undef MCFUNC
-
-#if   CHROMA_IDC == 1
-#   define MCFUNC(n) FUNC(n ## _420)
-#elif CHROMA_IDC == 2
-#   define MCFUNC(n) FUNC(n ## _422)
-#elif CHROMA_IDC == 3
-#   define MCFUNC(n) FUNC(n ## _444)
-#endif
-
-#undef  mc_part
-#define mc_part MCFUNC(mc_part)
-
-static void mc_part(H264Context *h, int n, int square,
-                    int height, int delta,
-                    uint8_t *dest_y, uint8_t *dest_cb,
-                    uint8_t *dest_cr,
-                    int x_offset, int y_offset,
-                    qpel_mc_func *qpix_put,
-                    h264_chroma_mc_func chroma_put,
-                    qpel_mc_func *qpix_avg,
-                    h264_chroma_mc_func chroma_avg,
-                    h264_weight_func *weight_op,
-                    h264_biweight_func *weight_avg,
-                    int list0, int list1)
-{
-    if ((h->use_weight == 2 && list0 && list1 &&
-         (h->implicit_weight[h->ref_cache[0][scan8[n]]][h->ref_cache[1][scan8[n]]][h->mb_y & 1] != 32)) ||
-        h->use_weight == 1)
-        mc_part_weighted(h, n, square, height, delta, dest_y, dest_cb, dest_cr,
-                         x_offset, y_offset, qpix_put, chroma_put,
-                         weight_op[0], weight_op[1], weight_avg[0],
-                         weight_avg[1], list0, list1, PIXEL_SHIFT, CHROMA_IDC);
-    else
-        mc_part_std(h, n, square, height, delta, dest_y, dest_cb, dest_cr,
-                    x_offset, y_offset, qpix_put, chroma_put, qpix_avg,
-                    chroma_avg, list0, list1, PIXEL_SHIFT, CHROMA_IDC);
-}
-
-static void MCFUNC(hl_motion)(H264Context *h, uint8_t *dest_y,
-                              uint8_t *dest_cb, uint8_t *dest_cr,
-                              qpel_mc_func(*qpix_put)[16],
-                              h264_chroma_mc_func(*chroma_put),
-                              qpel_mc_func(*qpix_avg)[16],
-                              h264_chroma_mc_func(*chroma_avg),
-                              h264_weight_func *weight_op,
-                              h264_biweight_func *weight_avg)
-{
-    const int mb_xy   = h->mb_xy;
-    const int mb_type = h->cur_pic.mb_type[mb_xy];
-
-    assert(IS_INTER(mb_type));
-
-    if (HAVE_THREADS && (h->avctx->active_thread_type & FF_THREAD_FRAME))
-        await_references(h);
-    prefetch_motion(h, 0, PIXEL_SHIFT, CHROMA_IDC);
-
-    if (IS_16X16(mb_type)) {
-        mc_part(h, 0, 1, 16, 0, dest_y, dest_cb, dest_cr, 0, 0,
-                qpix_put[0], chroma_put[0], qpix_avg[0], chroma_avg[0],
-                weight_op, weight_avg,
-                IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));
-    } else if (IS_16X8(mb_type)) {
-        mc_part(h, 0, 0, 8, 8 << PIXEL_SHIFT, dest_y, dest_cb, dest_cr, 0, 0,
-                qpix_put[1], chroma_put[0], qpix_avg[1], chroma_avg[0],
-                weight_op, weight_avg,
-                IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));
-        mc_part(h, 8, 0, 8, 8 << PIXEL_SHIFT, dest_y, dest_cb, dest_cr, 0, 4,
-                qpix_put[1], chroma_put[0], qpix_avg[1], chroma_avg[0],
-                weight_op, weight_avg,
-                IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));
-    } else if (IS_8X16(mb_type)) {
-        mc_part(h, 0, 0, 16, 8 * h->mb_linesize, dest_y, dest_cb, dest_cr, 0, 0,
-                qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
-                &weight_op[1], &weight_avg[1],
-                IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));
-        mc_part(h, 4, 0, 16, 8 * h->mb_linesize, dest_y, dest_cb, dest_cr, 4, 0,
-                qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
-                &weight_op[1], &weight_avg[1],
-                IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));
-    } else {
-        int i;
-
-        assert(IS_8X8(mb_type));
-
-        for (i = 0; i < 4; i++) {
-            const int sub_mb_type = h->sub_mb_type[i];
-            const int n  = 4 * i;
-            int x_offset = (i & 1) << 2;
-            int y_offset = (i & 2) << 1;
-
-            if (IS_SUB_8X8(sub_mb_type)) {
-                mc_part(h, n, 1, 8, 0, dest_y, dest_cb, dest_cr,
-                        x_offset, y_offset,
-                        qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
-                        &weight_op[1], &weight_avg[1],
-                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
-            } else if (IS_SUB_8X4(sub_mb_type)) {
-                mc_part(h, n, 0, 4, 4 << PIXEL_SHIFT, dest_y, dest_cb, dest_cr,
-                        x_offset, y_offset,
-                        qpix_put[2], chroma_put[1], qpix_avg[2], chroma_avg[1],
-                        &weight_op[1], &weight_avg[1],
-                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
-                mc_part(h, n + 2, 0, 4, 4 << PIXEL_SHIFT,
-                        dest_y, dest_cb, dest_cr, x_offset, y_offset + 2,
-                        qpix_put[2], chroma_put[1], qpix_avg[2], chroma_avg[1],
-                        &weight_op[1], &weight_avg[1],
-                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
-            } else if (IS_SUB_4X8(sub_mb_type)) {
-                mc_part(h, n, 0, 8, 4 * h->mb_linesize,
-                        dest_y, dest_cb, dest_cr, x_offset, y_offset,
-                        qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
-                        &weight_op[2], &weight_avg[2],
-                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
-                mc_part(h, n + 1, 0, 8, 4 * h->mb_linesize,
-                        dest_y, dest_cb, dest_cr, x_offset + 2, y_offset,
-                        qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
-                        &weight_op[2], &weight_avg[2],
-                        IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
-            } else {
-                int j;
-                assert(IS_SUB_4X4(sub_mb_type));
-                for (j = 0; j < 4; j++) {
-                    int sub_x_offset = x_offset + 2 * (j & 1);
-                    int sub_y_offset = y_offset + (j & 2);
-                    mc_part(h, n + j, 1, 4, 0,
-                            dest_y, dest_cb, dest_cr, sub_x_offset, sub_y_offset,
-                            qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
-                            &weight_op[2], &weight_avg[2],
-                            IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
-                }
-            }
-        }
-    }
-
-    prefetch_motion(h, 1, PIXEL_SHIFT, CHROMA_IDC);
-}
-
diff --git a/deps/libav/libavcodec/h264_mp4toannexb_bsf.c b/deps/libav/libavcodec/h264_mp4toannexb_bsf.c
deleted file mode 100644
index 3b212e5..0000000
--- a/deps/libav/libavcodec/h264_mp4toannexb_bsf.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * H.264 MP4 to Annex B byte stream format filter
- * Copyright (c) 2007 Benoit Fouet <benoit.fouet at free.fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-
-typedef struct H264BSFContext {
-    uint8_t  length_size;
-    uint8_t  first_idr;
-    int      extradata_parsed;
-} H264BSFContext;
-
-static int alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size,
-                          const uint8_t *sps_pps, uint32_t sps_pps_size,
-                          const uint8_t *in, uint32_t in_size)
-{
-    uint32_t offset         = *poutbuf_size;
-    uint8_t nal_header_size = offset ? 3 : 4;
-    int err;
-
-    *poutbuf_size += sps_pps_size + in_size + nal_header_size;
-    if ((err = av_reallocp(poutbuf,
-                           *poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
-        *poutbuf_size = 0;
-        return err;
-    }
-    if (sps_pps)
-        memcpy(*poutbuf + offset, sps_pps, sps_pps_size);
-    memcpy(*poutbuf + sps_pps_size + nal_header_size + offset, in, in_size);
-    if (!offset) {
-        AV_WB32(*poutbuf + sps_pps_size, 1);
-    } else {
-        (*poutbuf + offset + sps_pps_size)[0] =
-        (*poutbuf + offset + sps_pps_size)[1] = 0;
-        (*poutbuf + offset + sps_pps_size)[2] = 1;
-    }
-
-    return 0;
-}
-
-static int h264_extradata_to_annexb(AVCodecContext *avctx, const int padding)
-{
-    uint16_t unit_size;
-    uint64_t total_size                 = 0;
-    uint8_t *out                        = NULL, unit_nb, sps_done = 0,
-             sps_seen                   = 0, pps_seen = 0;
-    const uint8_t *extradata            = avctx->extradata + 4;
-    static const uint8_t nalu_header[4] = { 0, 0, 0, 1 };
-    int length_size = (*extradata++ & 0x3) + 1; // retrieve length coded size
-
-    if (length_size == 3)
-        return AVERROR(EINVAL);
-
-    /* retrieve sps and pps unit(s) */
-    unit_nb = *extradata++ & 0x1f; /* number of sps unit(s) */
-    if (!unit_nb) {
-        unit_nb = *extradata++; /* number of pps unit(s) */
-        sps_done++;
-
-        if (unit_nb)
-            pps_seen = 1;
-    } else {
-        sps_seen = 1;
-    }
-
-    while (unit_nb--) {
-        int err;
-
-        unit_size   = AV_RB16(extradata);
-        total_size += unit_size + 4;
-        if (total_size > INT_MAX - padding ||
-            extradata + 2 + unit_size > avctx->extradata +
-            avctx->extradata_size) {
-            av_free(out);
-            return AVERROR(EINVAL);
-        }
-        if ((err = av_reallocp(&out, total_size + padding)) < 0)
-            return err;
-        memcpy(out + total_size - unit_size - 4, nalu_header, 4);
-        memcpy(out + total_size - unit_size, extradata + 2, unit_size);
-        extradata += 2 + unit_size;
-
-        if (!unit_nb && !sps_done++) {
-            unit_nb = *extradata++; /* number of pps unit(s) */
-            if (unit_nb)
-                pps_seen = 1;
-        }
-    }
-
-    if (out)
-        memset(out + total_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-    if (!sps_seen)
-        av_log(avctx, AV_LOG_WARNING,
-               "Warning: SPS NALU missing or invalid. "
-               "The resulting stream may not play.\n");
-
-    if (!pps_seen)
-        av_log(avctx, AV_LOG_WARNING,
-               "Warning: PPS NALU missing or invalid. "
-               "The resulting stream may not play.\n");
-
-    av_free(avctx->extradata);
-    avctx->extradata      = out;
-    avctx->extradata_size = total_size;
-
-    return length_size;
-}
-
-static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
-                                   AVCodecContext *avctx, const char *args,
-                                   uint8_t **poutbuf, int *poutbuf_size,
-                                   const uint8_t *buf, int buf_size,
-                                   int keyframe)
-{
-    H264BSFContext *ctx = bsfc->priv_data;
-    uint8_t unit_type;
-    int32_t nal_size;
-    uint32_t cumul_size    = 0;
-    const uint8_t *buf_end = buf + buf_size;
-    int ret = 0;
-
-    /* nothing to filter */
-    if (!avctx->extradata || avctx->extradata_size < 6) {
-        *poutbuf      = (uint8_t *)buf;
-        *poutbuf_size = buf_size;
-        return 0;
-    }
-
-    /* retrieve sps and pps NAL units from extradata */
-    if (!ctx->extradata_parsed) {
-        ret = h264_extradata_to_annexb(avctx, FF_INPUT_BUFFER_PADDING_SIZE);
-        if (ret < 0)
-            return ret;
-        ctx->length_size      = ret;
-        ctx->first_idr        = 1;
-        ctx->extradata_parsed = 1;
-    }
-
-    *poutbuf_size = 0;
-    *poutbuf      = NULL;
-    do {
-        if (buf + ctx->length_size > buf_end)
-            goto fail;
-
-        if (ctx->length_size == 1) {
-            nal_size = buf[0];
-        } else if (ctx->length_size == 2) {
-            nal_size = AV_RB16(buf);
-        } else
-            nal_size = AV_RB32(buf);
-
-        buf      += ctx->length_size;
-        unit_type = *buf & 0x1f;
-
-        if (buf + nal_size > buf_end || nal_size < 0)
-            goto fail;
-
-        /* prepend only to the first type 5 NAL unit of an IDR picture */
-        if (ctx->first_idr && unit_type == 5) {
-            if (alloc_and_copy(poutbuf, poutbuf_size,
-                               avctx->extradata, avctx->extradata_size,
-                               buf, nal_size) < 0)
-                goto fail;
-            ctx->first_idr = 0;
-        } else {
-            if (alloc_and_copy(poutbuf, poutbuf_size,
-                               NULL, 0, buf, nal_size) < 0)
-                goto fail;
-            if (!ctx->first_idr && unit_type == 1)
-                ctx->first_idr = 1;
-        }
-
-        buf        += nal_size;
-        cumul_size += nal_size + ctx->length_size;
-    } while (cumul_size < buf_size);
-
-    return 1;
-
-fail:
-    av_freep(poutbuf);
-    *poutbuf_size = 0;
-    return AVERROR(EINVAL);
-}
-
-AVBitStreamFilter ff_h264_mp4toannexb_bsf = {
-    "h264_mp4toannexb",
-    sizeof(H264BSFContext),
-    h264_mp4toannexb_filter,
-};
diff --git a/deps/libav/libavcodec/h264_mvpred.h b/deps/libav/libavcodec/h264_mvpred.h
deleted file mode 100644
index a7545f0..0000000
--- a/deps/libav/libavcodec/h264_mvpred.h
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... motion vector predicion
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 motion vector predicion.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVCODEC_H264_MVPRED_H
-#define AVCODEC_H264_MVPRED_H
-
-#include "internal.h"
-#include "avcodec.h"
-#include "h264.h"
-
-#include <assert.h>
-
-static av_always_inline int fetch_diagonal_mv(H264Context *h, const int16_t **C,
-                                              int i, int list, int part_width)
-{
-    const int topright_ref = h->ref_cache[list][i - 8 + part_width];
-
-    /* there is no consistent mapping of mvs to neighboring locations that will
-     * make mbaff happy, so we can't move all this logic to fill_caches */
-    if (FRAME_MBAFF(h)) {
-#define SET_DIAG_MV(MV_OP, REF_OP, XY, Y4)                              \
-        const int xy = XY, y4 = Y4;                                     \
-        const int mb_type = mb_types[xy + (y4 >> 2) * h->mb_stride];    \
-        if (!USES_LIST(mb_type, list))                                  \
-            return LIST_NOT_USED;                                       \
-        mv = h->cur_pic_ptr->motion_val[list][h->mb2b_xy[xy] + 3 + y4 * h->b_stride]; \
-        h->mv_cache[list][scan8[0] - 2][0] = mv[0];                     \
-        h->mv_cache[list][scan8[0] - 2][1] = mv[1] MV_OP;               \
-        return h->cur_pic_ptr->ref_index[list][4 * xy + 1 + (y4 & ~1)] REF_OP;
-
-        if (topright_ref == PART_NOT_AVAILABLE
-            && i >= scan8[0] + 8 && (i & 7) == 4
-            && h->ref_cache[list][scan8[0] - 1] != PART_NOT_AVAILABLE) {
-            const uint32_t *mb_types = h->cur_pic_ptr->mb_type;
-            const int16_t *mv;
-            AV_ZERO32(h->mv_cache[list][scan8[0] - 2]);
-            *C = h->mv_cache[list][scan8[0] - 2];
-
-            if (!MB_FIELD(h) && IS_INTERLACED(h->left_type[0])) {
-                SET_DIAG_MV(* 2, >> 1, h->left_mb_xy[0] + h->mb_stride,
-                            (h->mb_y & 1) * 2 + (i >> 5));
-            }
-            if (MB_FIELD(h) && !IS_INTERLACED(h->left_type[0])) {
-                // left shift will turn LIST_NOT_USED into PART_NOT_AVAILABLE, but that's OK.
-                SET_DIAG_MV(/ 2, << 1, h->left_mb_xy[i >= 36], ((i >> 2)) & 3);
-            }
-        }
-#undef SET_DIAG_MV
-    }
-
-    if (topright_ref != PART_NOT_AVAILABLE) {
-        *C = h->mv_cache[list][i - 8 + part_width];
-        return topright_ref;
-    } else {
-        tprintf(h->avctx, "topright MV not available\n");
-
-        *C = h->mv_cache[list][i - 8 - 1];
-        return h->ref_cache[list][i - 8 - 1];
-    }
-}
-
-/**
- * Get the predicted MV.
- * @param n the block index
- * @param part_width the width of the partition (4, 8,16) -> (1, 2, 4)
- * @param mx the x component of the predicted motion vector
- * @param my the y component of the predicted motion vector
- */
-static av_always_inline void pred_motion(H264Context *const h, int n,
-                                         int part_width, int list, int ref,
-                                         int *const mx, int *const my)
-{
-    const int index8       = scan8[n];
-    const int top_ref      = h->ref_cache[list][index8 - 8];
-    const int left_ref     = h->ref_cache[list][index8 - 1];
-    const int16_t *const A = h->mv_cache[list][index8 - 1];
-    const int16_t *const B = h->mv_cache[list][index8 - 8];
-    const int16_t *C;
-    int diagonal_ref, match_count;
-
-    assert(part_width == 1 || part_width == 2 || part_width == 4);
-
-/* mv_cache
- * B . . A T T T T
- * U . . L . . , .
- * U . . L . . . .
- * U . . L . . , .
- * . . . L . . . .
- */
-
-    diagonal_ref = fetch_diagonal_mv(h, &C, index8, list, part_width);
-    match_count  = (diagonal_ref == ref) + (top_ref == ref) + (left_ref == ref);
-    tprintf(h->avctx, "pred_motion match_count=%d\n", match_count);
-    if (match_count > 1) { //most common
-        *mx = mid_pred(A[0], B[0], C[0]);
-        *my = mid_pred(A[1], B[1], C[1]);
-    } else if (match_count == 1) {
-        if (left_ref == ref) {
-            *mx = A[0];
-            *my = A[1];
-        } else if (top_ref == ref) {
-            *mx = B[0];
-            *my = B[1];
-        } else {
-            *mx = C[0];
-            *my = C[1];
-        }
-    } else {
-        if (top_ref      == PART_NOT_AVAILABLE &&
-            diagonal_ref == PART_NOT_AVAILABLE &&
-            left_ref     != PART_NOT_AVAILABLE) {
-            *mx = A[0];
-            *my = A[1];
-        } else {
-            *mx = mid_pred(A[0], B[0], C[0]);
-            *my = mid_pred(A[1], B[1], C[1]);
-        }
-    }
-
-    tprintf(h->avctx,
-            "pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n",
-            top_ref, B[0], B[1], diagonal_ref, C[0], C[1], left_ref,
-            A[0], A[1], ref, *mx, *my, h->mb_x, h->mb_y, n, list);
-}
-
-/**
- * Get the directionally predicted 16x8 MV.
- * @param n the block index
- * @param mx the x component of the predicted motion vector
- * @param my the y component of the predicted motion vector
- */
-static av_always_inline void pred_16x8_motion(H264Context *const h,
-                                              int n, int list, int ref,
-                                              int *const mx, int *const my)
-{
-    if (n == 0) {
-        const int top_ref      = h->ref_cache[list][scan8[0] - 8];
-        const int16_t *const B = h->mv_cache[list][scan8[0] - 8];
-
-        tprintf(h->avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n",
-                top_ref, B[0], B[1], h->mb_x, h->mb_y, n, list);
-
-        if (top_ref == ref) {
-            *mx = B[0];
-            *my = B[1];
-            return;
-        }
-    } else {
-        const int left_ref     = h->ref_cache[list][scan8[8] - 1];
-        const int16_t *const A = h->mv_cache[list][scan8[8] - 1];
-
-        tprintf(h->avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n",
-                left_ref, A[0], A[1], h->mb_x, h->mb_y, n, list);
-
-        if (left_ref == ref) {
-            *mx = A[0];
-            *my = A[1];
-            return;
-        }
-    }
-
-    //RARE
-    pred_motion(h, n, 4, list, ref, mx, my);
-}
-
-/**
- * Get the directionally predicted 8x16 MV.
- * @param n the block index
- * @param mx the x component of the predicted motion vector
- * @param my the y component of the predicted motion vector
- */
-static av_always_inline void pred_8x16_motion(H264Context *const h,
-                                              int n, int list, int ref,
-                                              int *const mx, int *const my)
-{
-    if (n == 0) {
-        const int left_ref     = h->ref_cache[list][scan8[0] - 1];
-        const int16_t *const A = h->mv_cache[list][scan8[0] - 1];
-
-        tprintf(h->avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n",
-                left_ref, A[0], A[1], h->mb_x, h->mb_y, n, list);
-
-        if (left_ref == ref) {
-            *mx = A[0];
-            *my = A[1];
-            return;
-        }
-    } else {
-        const int16_t *C;
-        int diagonal_ref;
-
-        diagonal_ref = fetch_diagonal_mv(h, &C, scan8[4], list, 2);
-
-        tprintf(h->avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n",
-                diagonal_ref, C[0], C[1], h->mb_x, h->mb_y, n, list);
-
-        if (diagonal_ref == ref) {
-            *mx = C[0];
-            *my = C[1];
-            return;
-        }
-    }
-
-    //RARE
-    pred_motion(h, n, 2, list, ref, mx, my);
-}
-
-#define FIX_MV_MBAFF(type, refn, mvn, idx)      \
-    if (FRAME_MBAFF(h)) {                       \
-        if (MB_FIELD(h)) {                      \
-            if (!IS_INTERLACED(type)) {         \
-                refn <<= 1;                     \
-                AV_COPY32(mvbuf[idx], mvn);     \
-                mvbuf[idx][1] /= 2;             \
-                mvn = mvbuf[idx];               \
-            }                                   \
-        } else {                                \
-            if (IS_INTERLACED(type)) {          \
-                refn >>= 1;                     \
-                AV_COPY32(mvbuf[idx], mvn);     \
-                mvbuf[idx][1] <<= 1;            \
-                mvn = mvbuf[idx];               \
-            }                                   \
-        }                                       \
-    }
-
-static av_always_inline void pred_pskip_motion(H264Context *const h)
-{
-    DECLARE_ALIGNED(4, static const int16_t, zeromv)[2] = { 0 };
-    DECLARE_ALIGNED(4, int16_t, mvbuf)[3][2];
-    int8_t *ref     = h->cur_pic.ref_index[0];
-    int16_t(*mv)[2] = h->cur_pic.motion_val[0];
-    int top_ref, left_ref, diagonal_ref, match_count, mx, my;
-    const int16_t *A, *B, *C;
-    int b_stride = h->b_stride;
-
-    fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1);
-
-    /* To avoid doing an entire fill_decode_caches, we inline the relevant
-     * parts here.
-     * FIXME: this is a partial duplicate of the logic in fill_decode_caches,
-     * but it's faster this way.  Is there a way to avoid this duplication?
-     */
-    if (USES_LIST(h->left_type[LTOP], 0)) {
-        left_ref = ref[4 * h->left_mb_xy[LTOP] + 1 + (h->left_block[0] & ~1)];
-        A = mv[h->mb2b_xy[h->left_mb_xy[LTOP]] + 3 + b_stride * h->left_block[0]];
-        FIX_MV_MBAFF(h->left_type[LTOP], left_ref, A, 0);
-        if (!(left_ref | AV_RN32A(A)))
-            goto zeromv;
-    } else if (h->left_type[LTOP]) {
-        left_ref = LIST_NOT_USED;
-        A        = zeromv;
-    } else {
-        goto zeromv;
-    }
-
-    if (USES_LIST(h->top_type, 0)) {
-        top_ref = ref[4 * h->top_mb_xy + 2];
-        B       = mv[h->mb2b_xy[h->top_mb_xy] + 3 * b_stride];
-        FIX_MV_MBAFF(h->top_type, top_ref, B, 1);
-        if (!(top_ref | AV_RN32A(B)))
-            goto zeromv;
-    } else if (h->top_type) {
-        top_ref = LIST_NOT_USED;
-        B       = zeromv;
-    } else {
-        goto zeromv;
-    }
-
-    tprintf(h->avctx, "pred_pskip: (%d) (%d) at %2d %2d\n",
-            top_ref, left_ref, h->mb_x, h->mb_y);
-
-    if (USES_LIST(h->topright_type, 0)) {
-        diagonal_ref = ref[4 * h->topright_mb_xy + 2];
-        C = mv[h->mb2b_xy[h->topright_mb_xy] + 3 * b_stride];
-        FIX_MV_MBAFF(h->topright_type, diagonal_ref, C, 2);
-    } else if (h->topright_type) {
-        diagonal_ref = LIST_NOT_USED;
-        C = zeromv;
-    } else {
-        if (USES_LIST(h->topleft_type, 0)) {
-            diagonal_ref = ref[4 * h->topleft_mb_xy + 1 +
-                               (h->topleft_partition & 2)];
-            C = mv[h->mb2b_xy[h->topleft_mb_xy] + 3 + b_stride +
-                   (h->topleft_partition & 2 * b_stride)];
-            FIX_MV_MBAFF(h->topleft_type, diagonal_ref, C, 2);
-        } else if (h->topleft_type) {
-            diagonal_ref = LIST_NOT_USED;
-            C            = zeromv;
-        } else {
-            diagonal_ref = PART_NOT_AVAILABLE;
-            C            = zeromv;
-        }
-    }
-
-    match_count = !diagonal_ref + !top_ref + !left_ref;
-    tprintf(h->avctx, "pred_pskip_motion match_count=%d\n", match_count);
-    if (match_count > 1) {
-        mx = mid_pred(A[0], B[0], C[0]);
-        my = mid_pred(A[1], B[1], C[1]);
-    } else if (match_count == 1) {
-        if (!left_ref) {
-            mx = A[0];
-            my = A[1];
-        } else if (!top_ref) {
-            mx = B[0];
-            my = B[1];
-        } else {
-            mx = C[0];
-            my = C[1];
-        }
-    } else {
-        mx = mid_pred(A[0], B[0], C[0]);
-        my = mid_pred(A[1], B[1], C[1]);
-    }
-
-    fill_rectangle(h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx, my), 4);
-    return;
-
-zeromv:
-    fill_rectangle(h->mv_cache[0][scan8[0]], 4, 4, 8, 0, 4);
-    return;
-}
-
-static void fill_decode_neighbors(H264Context *h, int mb_type)
-{
-    const int mb_xy = h->mb_xy;
-    int topleft_xy, top_xy, topright_xy, left_xy[LEFT_MBS];
-    static const uint8_t left_block_options[4][32] = {
-        { 0, 1, 2, 3, 7, 10, 8, 11, 3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4, 3 + 3 * 4, 1 + 4 * 4, 1 + 8 * 4, 1 + 5 * 4, 1 + 9 * 4 },
-        { 2, 2, 3, 3, 8, 11, 8, 11, 3 + 2 * 4, 3 + 2 * 4, 3 + 3 * 4, 3 + 3 * 4, 1 + 5 * 4, 1 + 9 * 4, 1 + 5 * 4, 1 + 9 * 4 },
-        { 0, 0, 1, 1, 7, 10, 7, 10, 3 + 0 * 4, 3 + 0 * 4, 3 + 1 * 4, 3 + 1 * 4, 1 + 4 * 4, 1 + 8 * 4, 1 + 4 * 4, 1 + 8 * 4 },
-        { 0, 2, 0, 2, 7, 10, 7, 10, 3 + 0 * 4, 3 + 2 * 4, 3 + 0 * 4, 3 + 2 * 4, 1 + 4 * 4, 1 + 8 * 4, 1 + 4 * 4, 1 + 8 * 4 }
-    };
-
-    h->topleft_partition = -1;
-
-    top_xy = mb_xy - (h->mb_stride << MB_FIELD(h));
-
-    /* Wow, what a mess, why didn't they simplify the interlacing & intra
-     * stuff, I can't imagine that these complex rules are worth it. */
-
-    topleft_xy    = top_xy - 1;
-    topright_xy   = top_xy + 1;
-    left_xy[LBOT] = left_xy[LTOP] = mb_xy - 1;
-    h->left_block = left_block_options[0];
-    if (FRAME_MBAFF(h)) {
-        const int left_mb_field_flag = IS_INTERLACED(h->cur_pic.mb_type[mb_xy - 1]);
-        const int curr_mb_field_flag = IS_INTERLACED(mb_type);
-        if (h->mb_y & 1) {
-            if (left_mb_field_flag != curr_mb_field_flag) {
-                left_xy[LBOT] = left_xy[LTOP] = mb_xy - h->mb_stride - 1;
-                if (curr_mb_field_flag) {
-                    left_xy[LBOT] += h->mb_stride;
-                    h->left_block  = left_block_options[3];
-                } else {
-                    topleft_xy += h->mb_stride;
-                    /* take top left mv from the middle of the mb, as opposed
-                     * to all other modes which use the bottom right partition */
-                    h->topleft_partition = 0;
-                    h->left_block        = left_block_options[1];
-                }
-            }
-        } else {
-            if (curr_mb_field_flag) {
-                topleft_xy  += h->mb_stride & (((h->cur_pic.mb_type[top_xy - 1] >> 7) & 1) - 1);
-                topright_xy += h->mb_stride & (((h->cur_pic.mb_type[top_xy + 1] >> 7) & 1) - 1);
-                top_xy      += h->mb_stride & (((h->cur_pic.mb_type[top_xy]     >> 7) & 1) - 1);
-            }
-            if (left_mb_field_flag != curr_mb_field_flag) {
-                if (curr_mb_field_flag) {
-                    left_xy[LBOT] += h->mb_stride;
-                    h->left_block  = left_block_options[3];
-                } else {
-                    h->left_block = left_block_options[2];
-                }
-            }
-        }
-    }
-
-    h->topleft_mb_xy    = topleft_xy;
-    h->top_mb_xy        = top_xy;
-    h->topright_mb_xy   = topright_xy;
-    h->left_mb_xy[LTOP] = left_xy[LTOP];
-    h->left_mb_xy[LBOT] = left_xy[LBOT];
-    //FIXME do we need all in the context?
-
-    h->topleft_type    = h->cur_pic.mb_type[topleft_xy];
-    h->top_type        = h->cur_pic.mb_type[top_xy];
-    h->topright_type   = h->cur_pic.mb_type[topright_xy];
-    h->left_type[LTOP] = h->cur_pic.mb_type[left_xy[LTOP]];
-    h->left_type[LBOT] = h->cur_pic.mb_type[left_xy[LBOT]];
-
-    if (FMO) {
-        if (h->slice_table[topleft_xy] != h->slice_num)
-            h->topleft_type = 0;
-        if (h->slice_table[top_xy] != h->slice_num)
-            h->top_type = 0;
-        if (h->slice_table[left_xy[LTOP]] != h->slice_num)
-            h->left_type[LTOP] = h->left_type[LBOT] = 0;
-    } else {
-        if (h->slice_table[topleft_xy] != h->slice_num) {
-            h->topleft_type = 0;
-            if (h->slice_table[top_xy] != h->slice_num)
-                h->top_type = 0;
-            if (h->slice_table[left_xy[LTOP]] != h->slice_num)
-                h->left_type[LTOP] = h->left_type[LBOT] = 0;
-        }
-    }
-    if (h->slice_table[topright_xy] != h->slice_num)
-        h->topright_type = 0;
-}
-
-static void fill_decode_caches(H264Context *h, int mb_type)
-{
-    int topleft_xy, top_xy, topright_xy, left_xy[LEFT_MBS];
-    int topleft_type, top_type, topright_type, left_type[LEFT_MBS];
-    const uint8_t *left_block = h->left_block;
-    int i;
-    uint8_t *nnz;
-    uint8_t *nnz_cache;
-
-    topleft_xy      = h->topleft_mb_xy;
-    top_xy          = h->top_mb_xy;
-    topright_xy     = h->topright_mb_xy;
-    left_xy[LTOP]   = h->left_mb_xy[LTOP];
-    left_xy[LBOT]   = h->left_mb_xy[LBOT];
-    topleft_type    = h->topleft_type;
-    top_type        = h->top_type;
-    topright_type   = h->topright_type;
-    left_type[LTOP] = h->left_type[LTOP];
-    left_type[LBOT] = h->left_type[LBOT];
-
-    if (!IS_SKIP(mb_type)) {
-        if (IS_INTRA(mb_type)) {
-            int type_mask = h->pps.constrained_intra_pred ? IS_INTRA(-1) : -1;
-            h->topleft_samples_available      =
-                h->top_samples_available      =
-                    h->left_samples_available = 0xFFFF;
-            h->topright_samples_available     = 0xEEEA;
-
-            if (!(top_type & type_mask)) {
-                h->topleft_samples_available  = 0xB3FF;
-                h->top_samples_available      = 0x33FF;
-                h->topright_samples_available = 0x26EA;
-            }
-            if (IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[LTOP])) {
-                if (IS_INTERLACED(mb_type)) {
-                    if (!(left_type[LTOP] & type_mask)) {
-                        h->topleft_samples_available &= 0xDFFF;
-                        h->left_samples_available    &= 0x5FFF;
-                    }
-                    if (!(left_type[LBOT] & type_mask)) {
-                        h->topleft_samples_available &= 0xFF5F;
-                        h->left_samples_available    &= 0xFF5F;
-                    }
-                } else {
-                    int left_typei = h->cur_pic.mb_type[left_xy[LTOP] + h->mb_stride];
-
-                    assert(left_xy[LTOP] == left_xy[LBOT]);
-                    if (!((left_typei & type_mask) && (left_type[LTOP] & type_mask))) {
-                        h->topleft_samples_available &= 0xDF5F;
-                        h->left_samples_available    &= 0x5F5F;
-                    }
-                }
-            } else {
-                if (!(left_type[LTOP] & type_mask)) {
-                    h->topleft_samples_available &= 0xDF5F;
-                    h->left_samples_available    &= 0x5F5F;
-                }
-            }
-
-            if (!(topleft_type & type_mask))
-                h->topleft_samples_available &= 0x7FFF;
-
-            if (!(topright_type & type_mask))
-                h->topright_samples_available &= 0xFBFF;
-
-            if (IS_INTRA4x4(mb_type)) {
-                if (IS_INTRA4x4(top_type)) {
-                    AV_COPY32(h->intra4x4_pred_mode_cache + 4 + 8 * 0, h->intra4x4_pred_mode + h->mb2br_xy[top_xy]);
-                } else {
-                    h->intra4x4_pred_mode_cache[4 + 8 * 0] =
-                    h->intra4x4_pred_mode_cache[5 + 8 * 0] =
-                    h->intra4x4_pred_mode_cache[6 + 8 * 0] =
-                    h->intra4x4_pred_mode_cache[7 + 8 * 0] = 2 - 3 * !(top_type & type_mask);
-                }
-                for (i = 0; i < 2; i++) {
-                    if (IS_INTRA4x4(left_type[LEFT(i)])) {
-                        int8_t *mode = h->intra4x4_pred_mode + h->mb2br_xy[left_xy[LEFT(i)]];
-                        h->intra4x4_pred_mode_cache[3 + 8 * 1 + 2 * 8 * i] = mode[6 - left_block[0 + 2 * i]];
-                        h->intra4x4_pred_mode_cache[3 + 8 * 2 + 2 * 8 * i] = mode[6 - left_block[1 + 2 * i]];
-                    } else {
-                        h->intra4x4_pred_mode_cache[3 + 8 * 1 + 2 * 8 * i] =
-                        h->intra4x4_pred_mode_cache[3 + 8 * 2 + 2 * 8 * i] = 2 - 3 * !(left_type[LEFT(i)] & type_mask);
-                    }
-                }
-            }
-        }
-
-        /*
-         * 0 . T T. T T T T
-         * 1 L . .L . . . .
-         * 2 L . .L . . . .
-         * 3 . T TL . . . .
-         * 4 L . .L . . . .
-         * 5 L . .. . . . .
-         */
-        /* FIXME: constraint_intra_pred & partitioning & nnz
-         * (let us hope this is just a typo in the spec) */
-        nnz_cache = h->non_zero_count_cache;
-        if (top_type) {
-            nnz = h->non_zero_count[top_xy];
-            AV_COPY32(&nnz_cache[4 + 8 * 0], &nnz[4 * 3]);
-            if (!h->chroma_y_shift) {
-                AV_COPY32(&nnz_cache[4 + 8 *  5], &nnz[4 *  7]);
-                AV_COPY32(&nnz_cache[4 + 8 * 10], &nnz[4 * 11]);
-            } else {
-                AV_COPY32(&nnz_cache[4 + 8 *  5], &nnz[4 * 5]);
-                AV_COPY32(&nnz_cache[4 + 8 * 10], &nnz[4 * 9]);
-            }
-        } else {
-            uint32_t top_empty = CABAC(h) && !IS_INTRA(mb_type) ? 0 : 0x40404040;
-            AV_WN32A(&nnz_cache[4 + 8 *  0], top_empty);
-            AV_WN32A(&nnz_cache[4 + 8 *  5], top_empty);
-            AV_WN32A(&nnz_cache[4 + 8 * 10], top_empty);
-        }
-
-        for (i = 0; i < 2; i++) {
-            if (left_type[LEFT(i)]) {
-                nnz = h->non_zero_count[left_xy[LEFT(i)]];
-                nnz_cache[3 + 8 * 1 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i]];
-                nnz_cache[3 + 8 * 2 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i]];
-                if (CHROMA444(h)) {
-                    nnz_cache[3 + 8 *  6 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] + 4 * 4];
-                    nnz_cache[3 + 8 *  7 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] + 4 * 4];
-                    nnz_cache[3 + 8 * 11 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] + 8 * 4];
-                    nnz_cache[3 + 8 * 12 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] + 8 * 4];
-                } else if (CHROMA422(h)) {
-                    nnz_cache[3 + 8 *  6 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] - 2 + 4 * 4];
-                    nnz_cache[3 + 8 *  7 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] - 2 + 4 * 4];
-                    nnz_cache[3 + 8 * 11 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] - 2 + 8 * 4];
-                    nnz_cache[3 + 8 * 12 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] - 2 + 8 * 4];
-                } else {
-                    nnz_cache[3 + 8 *  6 + 8 * i] = nnz[left_block[8 + 4 + 2 * i]];
-                    nnz_cache[3 + 8 * 11 + 8 * i] = nnz[left_block[8 + 5 + 2 * i]];
-                }
-            } else {
-                nnz_cache[3 + 8 *  1 + 2 * 8 * i] =
-                nnz_cache[3 + 8 *  2 + 2 * 8 * i] =
-                nnz_cache[3 + 8 *  6 + 2 * 8 * i] =
-                nnz_cache[3 + 8 *  7 + 2 * 8 * i] =
-                nnz_cache[3 + 8 * 11 + 2 * 8 * i] =
-                nnz_cache[3 + 8 * 12 + 2 * 8 * i] = CABAC(h) && !IS_INTRA(mb_type) ? 0 : 64;
-            }
-        }
-
-        if (CABAC(h)) {
-            // top_cbp
-            if (top_type)
-                h->top_cbp = h->cbp_table[top_xy];
-            else
-                h->top_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;
-            // left_cbp
-            if (left_type[LTOP]) {
-                h->left_cbp =   (h->cbp_table[left_xy[LTOP]] & 0x7F0) |
-                               ((h->cbp_table[left_xy[LTOP]] >> (left_block[0] & (~1))) & 2) |
-                              (((h->cbp_table[left_xy[LBOT]] >> (left_block[2] & (~1))) & 2) << 2);
-            } else {
-                h->left_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;
-            }
-        }
-    }
-
-    if (IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)) {
-        int list;
-        int b_stride = h->b_stride;
-        for (list = 0; list < h->list_count; list++) {
-            int8_t *ref_cache = &h->ref_cache[list][scan8[0]];
-            int8_t *ref       = h->cur_pic.ref_index[list];
-            int16_t(*mv_cache)[2] = &h->mv_cache[list][scan8[0]];
-            int16_t(*mv)[2]       = h->cur_pic.motion_val[list];
-            if (!USES_LIST(mb_type, list))
-                continue;
-            assert(!(IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred));
-
-            if (USES_LIST(top_type, list)) {
-                const int b_xy = h->mb2b_xy[top_xy] + 3 * b_stride;
-                AV_COPY128(mv_cache[0 - 1 * 8], mv[b_xy + 0]);
-                ref_cache[0 - 1 * 8] =
-                ref_cache[1 - 1 * 8] = ref[4 * top_xy + 2];
-                ref_cache[2 - 1 * 8] =
-                ref_cache[3 - 1 * 8] = ref[4 * top_xy + 3];
-            } else {
-                AV_ZERO128(mv_cache[0 - 1 * 8]);
-                AV_WN32A(&ref_cache[0 - 1 * 8],
-                         ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE) & 0xFF) * 0x01010101u);
-            }
-
-            if (mb_type & (MB_TYPE_16x8 | MB_TYPE_8x8)) {
-                for (i = 0; i < 2; i++) {
-                    int cache_idx = -1 + i * 2 * 8;
-                    if (USES_LIST(left_type[LEFT(i)], list)) {
-                        const int b_xy  = h->mb2b_xy[left_xy[LEFT(i)]] + 3;
-                        const int b8_xy = 4 * left_xy[LEFT(i)] + 1;
-                        AV_COPY32(mv_cache[cache_idx],
-                                  mv[b_xy + b_stride * left_block[0 + i * 2]]);
-                        AV_COPY32(mv_cache[cache_idx + 8],
-                                  mv[b_xy + b_stride * left_block[1 + i * 2]]);
-                        ref_cache[cache_idx]     = ref[b8_xy + (left_block[0 + i * 2] & ~1)];
-                        ref_cache[cache_idx + 8] = ref[b8_xy + (left_block[1 + i * 2] & ~1)];
-                    } else {
-                        AV_ZERO32(mv_cache[cache_idx]);
-                        AV_ZERO32(mv_cache[cache_idx + 8]);
-                        ref_cache[cache_idx]     =
-                        ref_cache[cache_idx + 8] = (left_type[LEFT(i)]) ? LIST_NOT_USED
-                                                                        : PART_NOT_AVAILABLE;
-                    }
-                }
-            } else {
-                if (USES_LIST(left_type[LTOP], list)) {
-                    const int b_xy  = h->mb2b_xy[left_xy[LTOP]] + 3;
-                    const int b8_xy = 4 * left_xy[LTOP] + 1;
-                    AV_COPY32(mv_cache[-1], mv[b_xy + b_stride * left_block[0]]);
-                    ref_cache[-1] = ref[b8_xy + (left_block[0] & ~1)];
-                } else {
-                    AV_ZERO32(mv_cache[-1]);
-                    ref_cache[-1] = left_type[LTOP] ? LIST_NOT_USED
-                                                    : PART_NOT_AVAILABLE;
-                }
-            }
-
-            if (USES_LIST(topright_type, list)) {
-                const int b_xy = h->mb2b_xy[topright_xy] + 3 * b_stride;
-                AV_COPY32(mv_cache[4 - 1 * 8], mv[b_xy]);
-                ref_cache[4 - 1 * 8] = ref[4 * topright_xy + 2];
-            } else {
-                AV_ZERO32(mv_cache[4 - 1 * 8]);
-                ref_cache[4 - 1 * 8] = topright_type ? LIST_NOT_USED
-                                                     : PART_NOT_AVAILABLE;
-            }
-            if (ref_cache[4 - 1 * 8] < 0) {
-                if (USES_LIST(topleft_type, list)) {
-                    const int b_xy  = h->mb2b_xy[topleft_xy] + 3 + b_stride +
-                                      (h->topleft_partition & 2 * b_stride);
-                    const int b8_xy = 4 * topleft_xy + 1 + (h->topleft_partition & 2);
-                    AV_COPY32(mv_cache[-1 - 1 * 8], mv[b_xy]);
-                    ref_cache[-1 - 1 * 8] = ref[b8_xy];
-                } else {
-                    AV_ZERO32(mv_cache[-1 - 1 * 8]);
-                    ref_cache[-1 - 1 * 8] = topleft_type ? LIST_NOT_USED
-                                                         : PART_NOT_AVAILABLE;
-                }
-            }
-
-            if ((mb_type & (MB_TYPE_SKIP | MB_TYPE_DIRECT2)) && !FRAME_MBAFF(h))
-                continue;
-
-            if (!(mb_type & (MB_TYPE_SKIP | MB_TYPE_DIRECT2))) {
-                uint8_t(*mvd_cache)[2]   = &h->mvd_cache[list][scan8[0]];
-                uint8_t(*mvd)[2]         = h->mvd_table[list];
-                ref_cache[2 + 8 * 0] =
-                ref_cache[2 + 8 * 2] = PART_NOT_AVAILABLE;
-                AV_ZERO32(mv_cache[2 + 8 * 0]);
-                AV_ZERO32(mv_cache[2 + 8 * 2]);
-
-                if (CABAC(h)) {
-                    if (USES_LIST(top_type, list)) {
-                        const int b_xy = h->mb2br_xy[top_xy];
-                        AV_COPY64(mvd_cache[0 - 1 * 8], mvd[b_xy + 0]);
-                    } else {
-                        AV_ZERO64(mvd_cache[0 - 1 * 8]);
-                    }
-                    if (USES_LIST(left_type[LTOP], list)) {
-                        const int b_xy = h->mb2br_xy[left_xy[LTOP]] + 6;
-                        AV_COPY16(mvd_cache[-1 + 0 * 8], mvd[b_xy - left_block[0]]);
-                        AV_COPY16(mvd_cache[-1 + 1 * 8], mvd[b_xy - left_block[1]]);
-                    } else {
-                        AV_ZERO16(mvd_cache[-1 + 0 * 8]);
-                        AV_ZERO16(mvd_cache[-1 + 1 * 8]);
-                    }
-                    if (USES_LIST(left_type[LBOT], list)) {
-                        const int b_xy = h->mb2br_xy[left_xy[LBOT]] + 6;
-                        AV_COPY16(mvd_cache[-1 + 2 * 8], mvd[b_xy - left_block[2]]);
-                        AV_COPY16(mvd_cache[-1 + 3 * 8], mvd[b_xy - left_block[3]]);
-                    } else {
-                        AV_ZERO16(mvd_cache[-1 + 2 * 8]);
-                        AV_ZERO16(mvd_cache[-1 + 3 * 8]);
-                    }
-                    AV_ZERO16(mvd_cache[2 + 8 * 0]);
-                    AV_ZERO16(mvd_cache[2 + 8 * 2]);
-                    if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
-                        uint8_t *direct_cache = &h->direct_cache[scan8[0]];
-                        uint8_t *direct_table = h->direct_table;
-                        fill_rectangle(direct_cache, 4, 4, 8, MB_TYPE_16x16 >> 1, 1);
-
-                        if (IS_DIRECT(top_type)) {
-                            AV_WN32A(&direct_cache[-1 * 8],
-                                     0x01010101u * (MB_TYPE_DIRECT2 >> 1));
-                        } else if (IS_8X8(top_type)) {
-                            int b8_xy = 4 * top_xy;
-                            direct_cache[0 - 1 * 8] = direct_table[b8_xy + 2];
-                            direct_cache[2 - 1 * 8] = direct_table[b8_xy + 3];
-                        } else {
-                            AV_WN32A(&direct_cache[-1 * 8],
-                                     0x01010101 * (MB_TYPE_16x16 >> 1));
-                        }
-
-                        if (IS_DIRECT(left_type[LTOP]))
-                            direct_cache[-1 + 0 * 8] = MB_TYPE_DIRECT2 >> 1;
-                        else if (IS_8X8(left_type[LTOP]))
-                            direct_cache[-1 + 0 * 8] = direct_table[4 * left_xy[LTOP] + 1 + (left_block[0] & ~1)];
-                        else
-                            direct_cache[-1 + 0 * 8] = MB_TYPE_16x16 >> 1;
-
-                        if (IS_DIRECT(left_type[LBOT]))
-                            direct_cache[-1 + 2 * 8] = MB_TYPE_DIRECT2 >> 1;
-                        else if (IS_8X8(left_type[LBOT]))
-                            direct_cache[-1 + 2 * 8] = direct_table[4 * left_xy[LBOT] + 1 + (left_block[2] & ~1)];
-                        else
-                            direct_cache[-1 + 2 * 8] = MB_TYPE_16x16 >> 1;
-                    }
-                }
-            }
-
-#define MAP_MVS                                                         \
-    MAP_F2F(scan8[0] - 1 - 1 * 8, topleft_type)                         \
-    MAP_F2F(scan8[0] + 0 - 1 * 8, top_type)                             \
-    MAP_F2F(scan8[0] + 1 - 1 * 8, top_type)                             \
-    MAP_F2F(scan8[0] + 2 - 1 * 8, top_type)                             \
-    MAP_F2F(scan8[0] + 3 - 1 * 8, top_type)                             \
-    MAP_F2F(scan8[0] + 4 - 1 * 8, topright_type)                        \
-    MAP_F2F(scan8[0] - 1 + 0 * 8, left_type[LTOP])                      \
-    MAP_F2F(scan8[0] - 1 + 1 * 8, left_type[LTOP])                      \
-    MAP_F2F(scan8[0] - 1 + 2 * 8, left_type[LBOT])                      \
-    MAP_F2F(scan8[0] - 1 + 3 * 8, left_type[LBOT])
-
-            if (FRAME_MBAFF(h)) {
-                if (MB_FIELD(h)) {
-
-#define MAP_F2F(idx, mb_type)                                           \
-    if (!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0) {      \
-        h->ref_cache[list][idx]    <<= 1;                               \
-        h->mv_cache[list][idx][1]   /= 2;                               \
-        h->mvd_cache[list][idx][1] >>= 1;                               \
-    }
-
-                    MAP_MVS
-                } else {
-
-#undef MAP_F2F
-#define MAP_F2F(idx, mb_type)                                           \
-    if (IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0) {       \
-        h->ref_cache[list][idx]    >>= 1;                               \
-        h->mv_cache[list][idx][1]  <<= 1;                               \
-        h->mvd_cache[list][idx][1] <<= 1;                               \
-    }
-
-                    MAP_MVS
-#undef MAP_F2F
-                }
-            }
-        }
-    }
-
-    h->neighbor_transform_size = !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[LTOP]);
-}
-
-/**
- * decodes a P_SKIP or B_SKIP macroblock
- */
-static void av_unused decode_mb_skip(H264Context *h)
-{
-    const int mb_xy = h->mb_xy;
-    int mb_type     = 0;
-
-    memset(h->non_zero_count[mb_xy], 0, 48);
-
-    if (MB_FIELD(h))
-        mb_type |= MB_TYPE_INTERLACED;
-
-    if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
-        // just for fill_caches. pred_direct_motion will set the real mb_type
-        mb_type |= MB_TYPE_L0L1 | MB_TYPE_DIRECT2 | MB_TYPE_SKIP;
-        if (h->direct_spatial_mv_pred) {
-            fill_decode_neighbors(h, mb_type);
-            fill_decode_caches(h, mb_type); //FIXME check what is needed and what not ...
-        }
-        ff_h264_pred_direct_motion(h, &mb_type);
-        mb_type |= MB_TYPE_SKIP;
-    } else {
-        mb_type |= MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_SKIP;
-
-        fill_decode_neighbors(h, mb_type);
-        pred_pskip_motion(h);
-    }
-
-    write_back_motion(h, mb_type);
-    h->cur_pic.mb_type[mb_xy]      = mb_type;
-    h->cur_pic.qscale_table[mb_xy] = h->qscale;
-    h->slice_table[mb_xy]            = h->slice_num;
-    h->prev_mb_skipped               = 1;
-}
-
-#endif /* AVCODEC_H264_MVPRED_H */
diff --git a/deps/libav/libavcodec/h264_parser.c b/deps/libav/libavcodec/h264_parser.c
deleted file mode 100644
index a16229a..0000000
--- a/deps/libav/libavcodec/h264_parser.c
+++ /dev/null
@@ -1,514 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... parser
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 parser.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "libavutil/attributes.h"
-#include "parser.h"
-#include "h264data.h"
-#include "golomb.h"
-#include "internal.h"
-
-#include <assert.h>
-
-
-static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
-                               int buf_size)
-{
-    int i;
-    uint32_t state;
-    ParseContext *pc = &h->parse_context;
-//    mb_addr= pc->mb_addr - 1;
-    state = pc->state;
-    if (state > 13)
-        state = 7;
-
-    for (i = 0; i < buf_size; i++) {
-        if (state == 7) {
-            i += h->h264dsp.h264_find_start_code_candidate(buf + i, buf_size - i);
-            if (i < buf_size)
-                state = 2;
-        } else if (state <= 2) {
-            if (buf[i] == 1)
-                state ^= 5;            // 2->7, 1->4, 0->5
-            else if (buf[i])
-                state = 7;
-            else
-                state >>= 1;           // 2->1, 1->0, 0->0
-        } else if (state <= 5) {
-            int nalu_type = buf[i] & 0x1F;
-            if (nalu_type == NAL_SEI || nalu_type == NAL_SPS ||
-                nalu_type == NAL_PPS || nalu_type == NAL_AUD) {
-                if (pc->frame_start_found) {
-                    i++;
-                    goto found;
-                }
-            } else if (nalu_type == NAL_SLICE || nalu_type == NAL_DPA ||
-                       nalu_type == NAL_IDR_SLICE) {
-                if (pc->frame_start_found) {
-                    state += 8;
-                    continue;
-                } else
-                    pc->frame_start_found = 1;
-            }
-            state = 7;
-        } else {
-            if (buf[i] & 0x80)
-                goto found;
-            state = 7;
-        }
-    }
-    pc->state = state;
-    return END_NOT_FOUND;
-
-found:
-    pc->state             = 7;
-    pc->frame_start_found = 0;
-    return i - (state & 5);
-}
-
-static int scan_mmco_reset(AVCodecParserContext *s)
-{
-    H264Context *h = s->priv_data;
-
-    h->slice_type_nos = s->pict_type & 3;
-
-    if (h->pps.redundant_pic_cnt_present)
-        get_ue_golomb(&h->gb); // redundant_pic_count
-
-    if (ff_set_ref_count(h) < 0)
-        return AVERROR_INVALIDDATA;
-
-    if (h->slice_type_nos != AV_PICTURE_TYPE_I) {
-        int list;
-        for (list = 0; list < h->list_count; list++) {
-            if (get_bits1(&h->gb)) {
-                int index;
-                for (index = 0; ; index++) {
-                    unsigned int reordering_of_pic_nums_idc = get_ue_golomb_31(&h->gb);
-
-                    if (reordering_of_pic_nums_idc < 3)
-                        get_ue_golomb(&h->gb);
-                    else if (reordering_of_pic_nums_idc > 3) {
-                        av_log(h->avctx, AV_LOG_ERROR,
-                               "illegal reordering_of_pic_nums_idc %d\n",
-                               reordering_of_pic_nums_idc);
-                        return AVERROR_INVALIDDATA;
-                    } else
-                        break;
-
-                    if (index >= h->ref_count[list]) {
-                        av_log(h->avctx, AV_LOG_ERROR,
-                               "reference count %d overflow\n", index);
-                        return AVERROR_INVALIDDATA;
-                    }
-                }
-            }
-        }
-    }
-
-    if ((h->pps.weighted_pred && h->slice_type_nos == AV_PICTURE_TYPE_P) ||
-        (h->pps.weighted_bipred_idc == 1 && h->slice_type_nos == AV_PICTURE_TYPE_B))
-        ff_pred_weight_table(h);
-
-    if (get_bits1(&h->gb)) { // adaptive_ref_pic_marking_mode_flag
-        int i;
-        for (i = 0; i < MAX_MMCO_COUNT; i++) {
-            MMCOOpcode opcode = get_ue_golomb_31(&h->gb);
-            if (opcode > (unsigned) MMCO_LONG) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "illegal memory management control operation %d\n",
-                       opcode);
-                return AVERROR_INVALIDDATA;
-            }
-            if (opcode == MMCO_END)
-               return 0;
-            else if (opcode == MMCO_RESET)
-                return 1;
-
-            if (opcode == MMCO_SHORT2UNUSED || opcode == MMCO_SHORT2LONG)
-                get_ue_golomb(&h->gb);
-            if (opcode == MMCO_SHORT2LONG || opcode == MMCO_LONG2UNUSED ||
-                opcode == MMCO_LONG || opcode == MMCO_SET_MAX_LONG)
-                get_ue_golomb_31(&h->gb);
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Parse NAL units of found picture and decode some basic information.
- *
- * @param s parser context.
- * @param avctx codec context.
- * @param buf buffer with field/frame data.
- * @param buf_size size of the buffer.
- */
-static inline int parse_nal_units(AVCodecParserContext *s,
-                                  AVCodecContext *avctx,
-                                  const uint8_t *buf, int buf_size)
-{
-    H264Context *h         = s->priv_data;
-    const uint8_t *buf_end = buf + buf_size;
-    unsigned int pps_id;
-    unsigned int slice_type;
-    int state = -1, got_reset = 0;
-    const uint8_t *ptr;
-    int field_poc[2];
-
-    /* set some sane default values */
-    s->pict_type         = AV_PICTURE_TYPE_I;
-    s->key_frame         = 0;
-    s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN;
-
-    h->avctx = avctx;
-    ff_h264_reset_sei(h);
-
-    if (!buf_size)
-        return 0;
-
-    for (;;) {
-        int src_length, dst_length, consumed;
-        buf = avpriv_find_start_code(buf, buf_end, &state);
-        if (buf >= buf_end)
-            break;
-        --buf;
-        src_length = buf_end - buf;
-        switch (state & 0x1f) {
-        case NAL_SLICE:
-        case NAL_IDR_SLICE:
-            // Do not walk the whole buffer just to decode slice header
-            if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) {
-                /* IDR or disposable slice
-                 * No need to decode many bytes because MMCOs shall not be present. */
-                if (src_length > 60)
-                    src_length = 60;
-            } else {
-                /* To decode up to MMCOs */
-                if (src_length > 1000)
-                    src_length = 1000;
-            }
-            break;
-        }
-        ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length);
-        if (ptr == NULL || dst_length < 0)
-            break;
-
-        init_get_bits(&h->gb, ptr, 8 * dst_length);
-        switch (h->nal_unit_type) {
-        case NAL_SPS:
-            ff_h264_decode_seq_parameter_set(h);
-            break;
-        case NAL_PPS:
-            ff_h264_decode_picture_parameter_set(h, h->gb.size_in_bits);
-            break;
-        case NAL_SEI:
-            ff_h264_decode_sei(h);
-            break;
-        case NAL_IDR_SLICE:
-            s->key_frame = 1;
-
-            h->prev_frame_num        = 0;
-            h->prev_frame_num_offset = 0;
-            h->prev_poc_msb          =
-            h->prev_poc_lsb          = 0;
-        /* fall through */
-        case NAL_SLICE:
-            get_ue_golomb(&h->gb);  // skip first_mb_in_slice
-            slice_type   = get_ue_golomb_31(&h->gb);
-            s->pict_type = golomb_to_pict_type[slice_type % 5];
-            if (h->sei_recovery_frame_cnt >= 0) {
-                /* key frame, since recovery_frame_cnt is set */
-                s->key_frame = 1;
-            }
-            pps_id = get_ue_golomb(&h->gb);
-            if (pps_id >= MAX_PPS_COUNT) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "pps_id %u out of range\n", pps_id);
-                return -1;
-            }
-            if (!h->pps_buffers[pps_id]) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "non-existing PPS %u referenced\n", pps_id);
-                return -1;
-            }
-            h->pps = *h->pps_buffers[pps_id];
-            if (!h->sps_buffers[h->pps.sps_id]) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "non-existing SPS %u referenced\n", h->pps.sps_id);
-                return -1;
-            }
-            h->sps       = *h->sps_buffers[h->pps.sps_id];
-            h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
-
-            avctx->profile = ff_h264_get_profile(&h->sps);
-            avctx->level   = h->sps.level_idc;
-
-            if (h->sps.frame_mbs_only_flag) {
-                h->picture_structure = PICT_FRAME;
-            } else {
-                if (get_bits1(&h->gb)) { // field_pic_flag
-                    h->picture_structure = PICT_TOP_FIELD + get_bits1(&h->gb); // bottom_field_flag
-                } else {
-                    h->picture_structure = PICT_FRAME;
-                }
-            }
-
-            if (h->nal_unit_type == NAL_IDR_SLICE)
-                get_ue_golomb(&h->gb); /* idr_pic_id */
-            if (h->sps.poc_type == 0) {
-                h->poc_lsb = get_bits(&h->gb, h->sps.log2_max_poc_lsb);
-
-                if (h->pps.pic_order_present == 1 &&
-                    h->picture_structure == PICT_FRAME)
-                    h->delta_poc_bottom = get_se_golomb(&h->gb);
-            }
-
-            if (h->sps.poc_type == 1 &&
-                !h->sps.delta_pic_order_always_zero_flag) {
-                h->delta_poc[0] = get_se_golomb(&h->gb);
-
-                if (h->pps.pic_order_present == 1 &&
-                    h->picture_structure == PICT_FRAME)
-                    h->delta_poc[1] = get_se_golomb(&h->gb);
-            }
-
-            /* Decode POC of this picture.
-             * The prev_ values needed for decoding POC of the next picture are not set here. */
-            field_poc[0] = field_poc[1] = INT_MAX;
-            ff_init_poc(h, field_poc, &s->output_picture_number);
-
-            /* Continue parsing to check if MMCO_RESET is present.
-             * FIXME: MMCO_RESET could appear in non-first slice.
-             *        Maybe, we should parse all undisposable non-IDR slice of this
-             *        picture until encountering MMCO_RESET in a slice of it. */
-            if (h->nal_ref_idc && h->nal_unit_type != NAL_IDR_SLICE) {
-                got_reset = scan_mmco_reset(s);
-                if (got_reset < 0)
-                    return got_reset;
-            }
-
-            /* Set up the prev_ values for decoding POC of the next picture. */
-            h->prev_frame_num        = got_reset ? 0 : h->frame_num;
-            h->prev_frame_num_offset = got_reset ? 0 : h->frame_num_offset;
-            if (h->nal_ref_idc != 0) {
-                if (!got_reset) {
-                    h->prev_poc_msb = h->poc_msb;
-                    h->prev_poc_lsb = h->poc_lsb;
-                } else {
-                    h->prev_poc_msb = 0;
-                    h->prev_poc_lsb =
-                        h->picture_structure == PICT_BOTTOM_FIELD ? 0 : field_poc[0];
-                }
-            }
-
-            if (h->sps.pic_struct_present_flag) {
-                switch (h->sei_pic_struct) {
-                case SEI_PIC_STRUCT_TOP_FIELD:
-                case SEI_PIC_STRUCT_BOTTOM_FIELD:
-                    s->repeat_pict = 0;
-                    break;
-                case SEI_PIC_STRUCT_FRAME:
-                case SEI_PIC_STRUCT_TOP_BOTTOM:
-                case SEI_PIC_STRUCT_BOTTOM_TOP:
-                    s->repeat_pict = 1;
-                    break;
-                case SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
-                case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
-                    s->repeat_pict = 2;
-                    break;
-                case SEI_PIC_STRUCT_FRAME_DOUBLING:
-                    s->repeat_pict = 3;
-                    break;
-                case SEI_PIC_STRUCT_FRAME_TRIPLING:
-                    s->repeat_pict = 5;
-                    break;
-                default:
-                    s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0;
-                    break;
-                }
-            } else {
-                s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0;
-            }
-
-            if (h->picture_structure == PICT_FRAME) {
-                s->picture_structure = AV_PICTURE_STRUCTURE_FRAME;
-                if (h->sps.pic_struct_present_flag) {
-                    switch (h->sei_pic_struct) {
-                    case SEI_PIC_STRUCT_TOP_BOTTOM:
-                    case SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
-                        s->field_order = AV_FIELD_TT;
-                        break;
-                    case SEI_PIC_STRUCT_BOTTOM_TOP:
-                    case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
-                        s->field_order = AV_FIELD_BB;
-                        break;
-                    default:
-                        s->field_order = AV_FIELD_PROGRESSIVE;
-                        break;
-                    }
-                } else {
-                    if (field_poc[0] < field_poc[1])
-                        s->field_order = AV_FIELD_TT;
-                    else if (field_poc[0] > field_poc[1])
-                        s->field_order = AV_FIELD_BB;
-                    else
-                        s->field_order = AV_FIELD_PROGRESSIVE;
-                }
-            } else {
-                if (h->picture_structure == PICT_TOP_FIELD)
-                    s->picture_structure = AV_PICTURE_STRUCTURE_TOP_FIELD;
-                else
-                    s->picture_structure = AV_PICTURE_STRUCTURE_BOTTOM_FIELD;
-                s->field_order = AV_FIELD_UNKNOWN;
-            }
-
-            return 0; /* no need to evaluate the rest */
-        }
-        buf += consumed;
-    }
-    /* didn't find a picture! */
-    av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n");
-    return -1;
-}
-
-static int h264_parse(AVCodecParserContext *s,
-                      AVCodecContext *avctx,
-                      const uint8_t **poutbuf, int *poutbuf_size,
-                      const uint8_t *buf, int buf_size)
-{
-    H264Context *h   = s->priv_data;
-    ParseContext *pc = &h->parse_context;
-    int next;
-
-    if (!h->got_first) {
-        h->got_first = 1;
-        if (avctx->extradata_size) {
-            h->avctx = avctx;
-            // must be done like in the decoder.
-            // otherwise opening the parser, creating extradata,
-            // and then closing and opening again
-            // will cause has_b_frames to be always set.
-            // NB: estimate_timings_from_pts behaves exactly like this.
-            if (!avctx->has_b_frames)
-                h->low_delay = 1;
-            ff_h264_decode_extradata(h);
-        }
-    }
-
-    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
-        next = buf_size;
-    } else {
-        next = h264_find_frame_end(h, buf, buf_size);
-
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf      = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-
-        if (next < 0 && next != END_NOT_FOUND) {
-            assert(pc->last_index + next >= 0);
-            h264_find_frame_end(h, &pc->buffer[pc->last_index + next], -next); // update state
-        }
-    }
-
-    parse_nal_units(s, avctx, buf, buf_size);
-
-    if (h->sei_cpb_removal_delay >= 0) {
-        s->dts_sync_point    = h->sei_buffering_period_present;
-        s->dts_ref_dts_delta = h->sei_cpb_removal_delay;
-        s->pts_dts_delta     = h->sei_dpb_output_delay;
-    } else {
-        s->dts_sync_point    = INT_MIN;
-        s->dts_ref_dts_delta = INT_MIN;
-        s->pts_dts_delta     = INT_MIN;
-    }
-
-    if (s->flags & PARSER_FLAG_ONCE) {
-        s->flags &= PARSER_FLAG_COMPLETE_FRAMES;
-    }
-
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-static int h264_split(AVCodecContext *avctx,
-                      const uint8_t *buf, int buf_size)
-{
-    int i;
-    uint32_t state = -1;
-    int has_sps    = 0;
-
-    for (i = 0; i <= buf_size; i++) {
-        if ((state & 0xFFFFFF1F) == 0x107)
-            has_sps = 1;
-        /*  if((state&0xFFFFFF1F) == 0x101 ||
-         *     (state&0xFFFFFF1F) == 0x102 ||
-         *     (state&0xFFFFFF1F) == 0x105) {
-         *  }
-         */
-        if ((state & 0xFFFFFF00) == 0x100 && (state & 0xFFFFFF1F) != 0x107 &&
-            (state & 0xFFFFFF1F) != 0x108 && (state & 0xFFFFFF1F) != 0x109) {
-            if (has_sps) {
-                while (i > 4 && buf[i - 5] == 0)
-                    i--;
-                return i - 4;
-            }
-        }
-        if (i < buf_size)
-            state = (state << 8) | buf[i];
-    }
-    return 0;
-}
-
-static void close(AVCodecParserContext *s)
-{
-    H264Context *h   = s->priv_data;
-    ParseContext *pc = &h->parse_context;
-
-    av_free(pc->buffer);
-    ff_h264_free_context(h);
-}
-
-static av_cold int init(AVCodecParserContext *s)
-{
-    H264Context *h = s->priv_data;
-    h->thread_context[0]   = h;
-    h->slice_context_count = 1;
-    ff_h264dsp_init(&h->h264dsp, 8, 1);
-    return 0;
-}
-
-AVCodecParser ff_h264_parser = {
-    .codec_ids      = { AV_CODEC_ID_H264 },
-    .priv_data_size = sizeof(H264Context),
-    .parser_init    = init,
-    .parser_parse   = h264_parse,
-    .parser_close   = close,
-    .split          = h264_split,
-};
diff --git a/deps/libav/libavcodec/h264_ps.c b/deps/libav/libavcodec/h264_ps.c
deleted file mode 100644
index 459bccc..0000000
--- a/deps/libav/libavcodec/h264_ps.c
+++ /dev/null
@@ -1,654 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... parameter set decoding
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 parameter set decoding.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "libavutil/imgutils.h"
-#include "internal.h"
-#include "avcodec.h"
-#include "h264.h"
-#include "h264data.h" //FIXME FIXME FIXME (just for zigzag_scan)
-#include "golomb.h"
-
-#define MAX_LOG2_MAX_FRAME_NUM    (12 + 4)
-#define MIN_LOG2_MAX_FRAME_NUM    4
-
-static const AVRational pixel_aspect[17] = {
-    {   0,  1 },
-    {   1,  1 },
-    {  12, 11 },
-    {  10, 11 },
-    {  16, 11 },
-    {  40, 33 },
-    {  24, 11 },
-    {  20, 11 },
-    {  32, 11 },
-    {  80, 33 },
-    {  18, 11 },
-    {  15, 11 },
-    {  64, 33 },
-    { 160, 99 },
-    {   4,  3 },
-    {   3,  2 },
-    {   2,  1 },
-};
-
-#define QP(qP, depth) ((qP) + 6 * ((depth) - 8))
-
-#define CHROMA_QP_TABLE_END(d)                                          \
-    QP(0,  d), QP(1,  d), QP(2,  d), QP(3,  d), QP(4,  d), QP(5,  d),   \
-    QP(6,  d), QP(7,  d), QP(8,  d), QP(9,  d), QP(10, d), QP(11, d),   \
-    QP(12, d), QP(13, d), QP(14, d), QP(15, d), QP(16, d), QP(17, d),   \
-    QP(18, d), QP(19, d), QP(20, d), QP(21, d), QP(22, d), QP(23, d),   \
-    QP(24, d), QP(25, d), QP(26, d), QP(27, d), QP(28, d), QP(29, d),   \
-    QP(29, d), QP(30, d), QP(31, d), QP(32, d), QP(32, d), QP(33, d),   \
-    QP(34, d), QP(34, d), QP(35, d), QP(35, d), QP(36, d), QP(36, d),   \
-    QP(37, d), QP(37, d), QP(37, d), QP(38, d), QP(38, d), QP(38, d),   \
-    QP(39, d), QP(39, d), QP(39, d), QP(39, d)
-
-const uint8_t ff_h264_chroma_qp[3][QP_MAX_NUM + 1] = {
-    { CHROMA_QP_TABLE_END(8) },
-    { 0, 1, 2, 3, 4, 5,
-      CHROMA_QP_TABLE_END(9) },
-    { 0, 1, 2, 3, 4, 5,
-      6, 7, 8, 9, 10, 11,
-      CHROMA_QP_TABLE_END(10) },
-};
-
-static const uint8_t default_scaling4[2][16] = {
-    {  6, 13, 20, 28, 13, 20, 28, 32,
-      20, 28, 32, 37, 28, 32, 37, 42 },
-    { 10, 14, 20, 24, 14, 20, 24, 27,
-      20, 24, 27, 30, 24, 27, 30, 34 }
-};
-
-static const uint8_t default_scaling8[2][64] = {
-    {  6, 10, 13, 16, 18, 23, 25, 27,
-      10, 11, 16, 18, 23, 25, 27, 29,
-      13, 16, 18, 23, 25, 27, 29, 31,
-      16, 18, 23, 25, 27, 29, 31, 33,
-      18, 23, 25, 27, 29, 31, 33, 36,
-      23, 25, 27, 29, 31, 33, 36, 38,
-      25, 27, 29, 31, 33, 36, 38, 40,
-      27, 29, 31, 33, 36, 38, 40, 42 },
-    {  9, 13, 15, 17, 19, 21, 22, 24,
-      13, 13, 17, 19, 21, 22, 24, 25,
-      15, 17, 19, 21, 22, 24, 25, 27,
-      17, 19, 21, 22, 24, 25, 27, 28,
-      19, 21, 22, 24, 25, 27, 28, 30,
-      21, 22, 24, 25, 27, 28, 30, 32,
-      22, 24, 25, 27, 28, 30, 32, 33,
-      24, 25, 27, 28, 30, 32, 33, 35 }
-};
-
-static inline int decode_hrd_parameters(H264Context *h, SPS *sps)
-{
-    int cpb_count, i;
-    cpb_count = get_ue_golomb_31(&h->gb) + 1;
-
-    if (cpb_count > 32U) {
-        av_log(h->avctx, AV_LOG_ERROR, "cpb_count %d invalid\n", cpb_count);
-        return AVERROR_INVALIDDATA;
-    }
-
-    get_bits(&h->gb, 4); /* bit_rate_scale */
-    get_bits(&h->gb, 4); /* cpb_size_scale */
-    for (i = 0; i < cpb_count; i++) {
-        get_ue_golomb_long(&h->gb); /* bit_rate_value_minus1 */
-        get_ue_golomb_long(&h->gb); /* cpb_size_value_minus1 */
-        get_bits1(&h->gb);          /* cbr_flag */
-    }
-    sps->initial_cpb_removal_delay_length = get_bits(&h->gb, 5) + 1;
-    sps->cpb_removal_delay_length         = get_bits(&h->gb, 5) + 1;
-    sps->dpb_output_delay_length          = get_bits(&h->gb, 5) + 1;
-    sps->time_offset_length               = get_bits(&h->gb, 5);
-    sps->cpb_cnt                          = cpb_count;
-    return 0;
-}
-
-static inline int decode_vui_parameters(H264Context *h, SPS *sps)
-{
-    int aspect_ratio_info_present_flag;
-    unsigned int aspect_ratio_idc;
-
-    aspect_ratio_info_present_flag = get_bits1(&h->gb);
-
-    if (aspect_ratio_info_present_flag) {
-        aspect_ratio_idc = get_bits(&h->gb, 8);
-        if (aspect_ratio_idc == EXTENDED_SAR) {
-            sps->sar.num = get_bits(&h->gb, 16);
-            sps->sar.den = get_bits(&h->gb, 16);
-        } else if (aspect_ratio_idc < FF_ARRAY_ELEMS(pixel_aspect)) {
-            sps->sar = pixel_aspect[aspect_ratio_idc];
-        } else {
-            av_log(h->avctx, AV_LOG_ERROR, "illegal aspect ratio\n");
-            return AVERROR_INVALIDDATA;
-        }
-    } else {
-        sps->sar.num =
-        sps->sar.den = 0;
-    }
-
-    if (get_bits1(&h->gb))      /* overscan_info_present_flag */
-        get_bits1(&h->gb);      /* overscan_appropriate_flag */
-
-    sps->video_signal_type_present_flag = get_bits1(&h->gb);
-    if (sps->video_signal_type_present_flag) {
-        get_bits(&h->gb, 3);                 /* video_format */
-        sps->full_range = get_bits1(&h->gb); /* video_full_range_flag */
-
-        sps->colour_description_present_flag = get_bits1(&h->gb);
-        if (sps->colour_description_present_flag) {
-            sps->color_primaries = get_bits(&h->gb, 8); /* colour_primaries */
-            sps->color_trc       = get_bits(&h->gb, 8); /* transfer_characteristics */
-            sps->colorspace      = get_bits(&h->gb, 8); /* matrix_coefficients */
-            if (sps->color_primaries >= AVCOL_PRI_NB)
-                sps->color_primaries = AVCOL_PRI_UNSPECIFIED;
-            if (sps->color_trc >= AVCOL_TRC_NB)
-                sps->color_trc = AVCOL_TRC_UNSPECIFIED;
-            if (sps->colorspace >= AVCOL_SPC_NB)
-                sps->colorspace = AVCOL_SPC_UNSPECIFIED;
-        }
-    }
-
-    /* chroma_location_info_present_flag */
-    if (get_bits1(&h->gb)) {
-        /* chroma_sample_location_type_top_field */
-        h->avctx->chroma_sample_location = get_ue_golomb(&h->gb) + 1;
-        get_ue_golomb(&h->gb);  /* chroma_sample_location_type_bottom_field */
-    }
-
-    sps->timing_info_present_flag = get_bits1(&h->gb);
-    if (sps->timing_info_present_flag) {
-        sps->num_units_in_tick = get_bits_long(&h->gb, 32);
-        sps->time_scale        = get_bits_long(&h->gb, 32);
-        if (!sps->num_units_in_tick || !sps->time_scale) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "time_scale/num_units_in_tick invalid or unsupported (%d/%d)\n",
-                   sps->time_scale, sps->num_units_in_tick);
-            return AVERROR_INVALIDDATA;
-        }
-        sps->fixed_frame_rate_flag = get_bits1(&h->gb);
-    }
-
-    sps->nal_hrd_parameters_present_flag = get_bits1(&h->gb);
-    if (sps->nal_hrd_parameters_present_flag)
-        if (decode_hrd_parameters(h, sps) < 0)
-            return AVERROR_INVALIDDATA;
-    sps->vcl_hrd_parameters_present_flag = get_bits1(&h->gb);
-    if (sps->vcl_hrd_parameters_present_flag)
-        if (decode_hrd_parameters(h, sps) < 0)
-            return AVERROR_INVALIDDATA;
-    if (sps->nal_hrd_parameters_present_flag ||
-        sps->vcl_hrd_parameters_present_flag)
-        get_bits1(&h->gb);     /* low_delay_hrd_flag */
-    sps->pic_struct_present_flag = get_bits1(&h->gb);
-
-    sps->bitstream_restriction_flag = get_bits1(&h->gb);
-    if (sps->bitstream_restriction_flag) {
-        get_bits1(&h->gb);     /* motion_vectors_over_pic_boundaries_flag */
-        get_ue_golomb(&h->gb); /* max_bytes_per_pic_denom */
-        get_ue_golomb(&h->gb); /* max_bits_per_mb_denom */
-        get_ue_golomb(&h->gb); /* log2_max_mv_length_horizontal */
-        get_ue_golomb(&h->gb); /* log2_max_mv_length_vertical */
-        sps->num_reorder_frames = get_ue_golomb(&h->gb);
-        get_ue_golomb(&h->gb); /*max_dec_frame_buffering*/
-
-        if (get_bits_left(&h->gb) < 0) {
-            sps->num_reorder_frames         = 0;
-            sps->bitstream_restriction_flag = 0;
-        }
-
-        if (sps->num_reorder_frames > 16U
-            /* max_dec_frame_buffering || max_dec_frame_buffering > 16 */) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "Clipping illegal num_reorder_frames %d\n",
-                   sps->num_reorder_frames);
-            sps->num_reorder_frames = 16;
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    if (get_bits_left(&h->gb) < 0) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "Overread VUI by %d bits\n", -get_bits_left(&h->gb));
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-static void decode_scaling_list(H264Context *h, uint8_t *factors, int size,
-                                const uint8_t *jvt_list,
-                                const uint8_t *fallback_list)
-{
-    int i, last = 8, next = 8;
-    const uint8_t *scan = size == 16 ? zigzag_scan : ff_zigzag_direct;
-    if (!get_bits1(&h->gb)) /* matrix not written, we use the predicted one */
-        memcpy(factors, fallback_list, size * sizeof(uint8_t));
-    else
-        for (i = 0; i < size; i++) {
-            if (next)
-                next = (last + get_se_golomb(&h->gb)) & 0xff;
-            if (!i && !next) { /* matrix not written, we use the preset one */
-                memcpy(factors, jvt_list, size * sizeof(uint8_t));
-                break;
-            }
-            last = factors[scan[i]] = next ? next : last;
-        }
-}
-
-static void decode_scaling_matrices(H264Context *h, SPS *sps,
-                                    PPS *pps, int is_sps,
-                                    uint8_t(*scaling_matrix4)[16],
-                                    uint8_t(*scaling_matrix8)[64])
-{
-    int fallback_sps = !is_sps && sps->scaling_matrix_present;
-    const uint8_t *fallback[4] = {
-        fallback_sps ? sps->scaling_matrix4[0] : default_scaling4[0],
-        fallback_sps ? sps->scaling_matrix4[3] : default_scaling4[1],
-        fallback_sps ? sps->scaling_matrix8[0] : default_scaling8[0],
-        fallback_sps ? sps->scaling_matrix8[3] : default_scaling8[1]
-    };
-    if (get_bits1(&h->gb)) {
-        sps->scaling_matrix_present |= is_sps;
-        decode_scaling_list(h, scaling_matrix4[0], 16, default_scaling4[0], fallback[0]);        // Intra, Y
-        decode_scaling_list(h, scaling_matrix4[1], 16, default_scaling4[0], scaling_matrix4[0]); // Intra, Cr
-        decode_scaling_list(h, scaling_matrix4[2], 16, default_scaling4[0], scaling_matrix4[1]); // Intra, Cb
-        decode_scaling_list(h, scaling_matrix4[3], 16, default_scaling4[1], fallback[1]);        // Inter, Y
-        decode_scaling_list(h, scaling_matrix4[4], 16, default_scaling4[1], scaling_matrix4[3]); // Inter, Cr
-        decode_scaling_list(h, scaling_matrix4[5], 16, default_scaling4[1], scaling_matrix4[4]); // Inter, Cb
-        if (is_sps || pps->transform_8x8_mode) {
-            decode_scaling_list(h, scaling_matrix8[0], 64, default_scaling8[0], fallback[2]); // Intra, Y
-            if (sps->chroma_format_idc == 3) {
-                decode_scaling_list(h, scaling_matrix8[1], 64, default_scaling8[0], scaling_matrix8[0]); // Intra, Cr
-                decode_scaling_list(h, scaling_matrix8[2], 64, default_scaling8[0], scaling_matrix8[1]); // Intra, Cb
-            }
-            decode_scaling_list(h, scaling_matrix8[3], 64, default_scaling8[1], fallback[3]); // Inter, Y
-            if (sps->chroma_format_idc == 3) {
-                decode_scaling_list(h, scaling_matrix8[4], 64, default_scaling8[1], scaling_matrix8[3]); // Inter, Cr
-                decode_scaling_list(h, scaling_matrix8[5], 64, default_scaling8[1], scaling_matrix8[4]); // Inter, Cb
-            }
-        }
-    }
-}
-
-int ff_h264_decode_seq_parameter_set(H264Context *h)
-{
-    int profile_idc, level_idc, constraint_set_flags = 0;
-    unsigned int sps_id;
-    int i, log2_max_frame_num_minus4;
-    SPS *sps;
-
-    profile_idc           = get_bits(&h->gb, 8);
-    constraint_set_flags |= get_bits1(&h->gb) << 0;   // constraint_set0_flag
-    constraint_set_flags |= get_bits1(&h->gb) << 1;   // constraint_set1_flag
-    constraint_set_flags |= get_bits1(&h->gb) << 2;   // constraint_set2_flag
-    constraint_set_flags |= get_bits1(&h->gb) << 3;   // constraint_set3_flag
-    get_bits(&h->gb, 4); // reserved
-    level_idc = get_bits(&h->gb, 8);
-    sps_id    = get_ue_golomb_31(&h->gb);
-
-    if (sps_id >= MAX_SPS_COUNT) {
-        av_log(h->avctx, AV_LOG_ERROR, "sps_id %u out of range\n", sps_id);
-        return AVERROR_INVALIDDATA;
-    }
-    sps = av_mallocz(sizeof(SPS));
-    if (!sps)
-        return AVERROR(ENOMEM);
-
-    sps->sps_id               = sps_id;
-    sps->time_offset_length   = 24;
-    sps->profile_idc          = profile_idc;
-    sps->constraint_set_flags = constraint_set_flags;
-    sps->level_idc            = level_idc;
-
-    memset(sps->scaling_matrix4, 16, sizeof(sps->scaling_matrix4));
-    memset(sps->scaling_matrix8, 16, sizeof(sps->scaling_matrix8));
-    sps->scaling_matrix_present = 0;
-
-    if (sps->profile_idc == 100 || sps->profile_idc == 110 ||
-        sps->profile_idc == 122 || sps->profile_idc == 244 ||
-        sps->profile_idc ==  44 || sps->profile_idc ==  83 ||
-        sps->profile_idc ==  86 || sps->profile_idc == 118 ||
-        sps->profile_idc == 128 || sps->profile_idc == 144) {
-        sps->chroma_format_idc = get_ue_golomb_31(&h->gb);
-        if (sps->chroma_format_idc > 3) {
-            avpriv_request_sample(h->avctx, "chroma_format_idc %u",
-                                  sps->chroma_format_idc);
-            goto fail;
-        } else if (sps->chroma_format_idc == 3) {
-            sps->residual_color_transform_flag = get_bits1(&h->gb);
-        }
-        sps->bit_depth_luma   = get_ue_golomb(&h->gb) + 8;
-        sps->bit_depth_chroma = get_ue_golomb(&h->gb) + 8;
-        if (sps->bit_depth_chroma != sps->bit_depth_luma) {
-            avpriv_request_sample(h->avctx,
-                                  "Different chroma and luma bit depth");
-            goto fail;
-        }
-        sps->transform_bypass = get_bits1(&h->gb);
-        decode_scaling_matrices(h, sps, NULL, 1,
-                                sps->scaling_matrix4, sps->scaling_matrix8);
-    } else {
-        sps->chroma_format_idc = 1;
-        sps->bit_depth_luma    = 8;
-        sps->bit_depth_chroma  = 8;
-    }
-
-    log2_max_frame_num_minus4 = get_ue_golomb(&h->gb);
-    if (log2_max_frame_num_minus4 < MIN_LOG2_MAX_FRAME_NUM - 4 ||
-        log2_max_frame_num_minus4 > MAX_LOG2_MAX_FRAME_NUM - 4) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "log2_max_frame_num_minus4 out of range (0-12): %d\n",
-               log2_max_frame_num_minus4);
-        goto fail;
-    }
-    sps->log2_max_frame_num = log2_max_frame_num_minus4 + 4;
-
-    sps->poc_type = get_ue_golomb_31(&h->gb);
-
-    if (sps->poc_type == 0) { // FIXME #define
-        sps->log2_max_poc_lsb = get_ue_golomb(&h->gb) + 4;
-    } else if (sps->poc_type == 1) { // FIXME #define
-        sps->delta_pic_order_always_zero_flag = get_bits1(&h->gb);
-        sps->offset_for_non_ref_pic           = get_se_golomb(&h->gb);
-        sps->offset_for_top_to_bottom_field   = get_se_golomb(&h->gb);
-        sps->poc_cycle_length                 = get_ue_golomb(&h->gb);
-
-        if ((unsigned)sps->poc_cycle_length >=
-            FF_ARRAY_ELEMS(sps->offset_for_ref_frame)) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "poc_cycle_length overflow %u\n", sps->poc_cycle_length);
-            goto fail;
-        }
-
-        for (i = 0; i < sps->poc_cycle_length; i++)
-            sps->offset_for_ref_frame[i] = get_se_golomb(&h->gb);
-    } else if (sps->poc_type != 2) {
-        av_log(h->avctx, AV_LOG_ERROR, "illegal POC type %d\n", sps->poc_type);
-        goto fail;
-    }
-
-    sps->ref_frame_count = get_ue_golomb_31(&h->gb);
-    if (sps->ref_frame_count > MAX_PICTURE_COUNT - 2 ||
-        sps->ref_frame_count >= 32U) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "too many reference frames %d\n", sps->ref_frame_count);
-        goto fail;
-    }
-    sps->gaps_in_frame_num_allowed_flag = get_bits1(&h->gb);
-    sps->mb_width                       = get_ue_golomb(&h->gb) + 1;
-    sps->mb_height                      = get_ue_golomb(&h->gb) + 1;
-    if ((unsigned)sps->mb_width  >= INT_MAX / 16 ||
-        (unsigned)sps->mb_height >= INT_MAX / 16 ||
-        av_image_check_size(16 * sps->mb_width,
-                            16 * sps->mb_height, 0, h->avctx)) {
-        av_log(h->avctx, AV_LOG_ERROR, "mb_width/height overflow\n");
-        goto fail;
-    }
-
-    sps->frame_mbs_only_flag = get_bits1(&h->gb);
-    if (!sps->frame_mbs_only_flag)
-        sps->mb_aff = get_bits1(&h->gb);
-    else
-        sps->mb_aff = 0;
-
-    sps->direct_8x8_inference_flag = get_bits1(&h->gb);
-    if (!sps->frame_mbs_only_flag && !sps->direct_8x8_inference_flag) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "This stream was generated by a broken encoder, invalid 8x8 inference\n");
-        goto fail;
-    }
-
-#ifndef ALLOW_INTERLACE
-    if (sps->mb_aff)
-        av_log(h->avctx, AV_LOG_ERROR,
-               "MBAFF support not included; enable it at compile-time.\n");
-#endif
-    sps->crop = get_bits1(&h->gb);
-    if (sps->crop) {
-        int crop_left   = get_ue_golomb(&h->gb);
-        int crop_right  = get_ue_golomb(&h->gb);
-        int crop_top    = get_ue_golomb(&h->gb);
-        int crop_bottom = get_ue_golomb(&h->gb);
-
-        if (h->avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
-            av_log(h->avctx, AV_LOG_DEBUG, "discarding sps cropping, original "
-                                           "values are l:%u r:%u t:%u b:%u\n",
-                   crop_left, crop_right, crop_top, crop_bottom);
-
-            sps->crop_left   =
-            sps->crop_right  =
-            sps->crop_top    =
-            sps->crop_bottom = 0;
-        } else {
-            int vsub   = (sps->chroma_format_idc == 1) ? 1 : 0;
-            int hsub   = (sps->chroma_format_idc == 1 ||
-                          sps->chroma_format_idc == 2) ? 1 : 0;
-            int step_x = 1 << hsub;
-            int step_y = (2 - sps->frame_mbs_only_flag) << vsub;
-
-            if (crop_left & (0x1F >> (sps->bit_depth_luma > 8)) &&
-                !(h->avctx->flags & CODEC_FLAG_UNALIGNED)) {
-                crop_left &= ~(0x1F >> (sps->bit_depth_luma > 8));
-                av_log(h->avctx, AV_LOG_WARNING,
-                       "Reducing left cropping to %d "
-                       "chroma samples to preserve alignment.\n",
-                       crop_left);
-            }
-
-            sps->crop_left   = crop_left   * step_x;
-            sps->crop_right  = crop_right  * step_x;
-            sps->crop_top    = crop_top    * step_y;
-            sps->crop_bottom = crop_bottom * step_y;
-        }
-    } else {
-        sps->crop_left   =
-        sps->crop_right  =
-        sps->crop_top    =
-        sps->crop_bottom =
-        sps->crop        = 0;
-    }
-
-    sps->vui_parameters_present_flag = get_bits1(&h->gb);
-    if (sps->vui_parameters_present_flag) {
-        int ret = decode_vui_parameters(h, sps);
-        if (ret < 0 && h->avctx->err_recognition & AV_EF_EXPLODE)
-            goto fail;
-    }
-
-    if (!sps->sar.den)
-        sps->sar.den = 1;
-
-    if (h->avctx->debug & FF_DEBUG_PICT_INFO) {
-        static const char csp[4][5] = { "Gray", "420", "422", "444" };
-        av_log(h->avctx, AV_LOG_DEBUG,
-               "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s %s %d/%d\n",
-               sps_id, sps->profile_idc, sps->level_idc,
-               sps->poc_type,
-               sps->ref_frame_count,
-               sps->mb_width, sps->mb_height,
-               sps->frame_mbs_only_flag ? "FRM" : (sps->mb_aff ? "MB-AFF" : "PIC-AFF"),
-               sps->direct_8x8_inference_flag ? "8B8" : "",
-               sps->crop_left, sps->crop_right,
-               sps->crop_top, sps->crop_bottom,
-               sps->vui_parameters_present_flag ? "VUI" : "",
-               csp[sps->chroma_format_idc],
-               sps->timing_info_present_flag ? sps->num_units_in_tick : 0,
-               sps->timing_info_present_flag ? sps->time_scale : 0);
-    }
-    sps->new = 1;
-
-    av_free(h->sps_buffers[sps_id]);
-    h->sps_buffers[sps_id] = sps;
-    h->sps                 = *sps;
-
-    return 0;
-
-fail:
-    av_free(sps);
-    return -1;
-}
-
-static void build_qp_table(PPS *pps, int t, int index, const int depth)
-{
-    int i;
-    const int max_qp = 51 + 6 * (depth - 8);
-    for (i = 0; i < max_qp + 1; i++)
-        pps->chroma_qp_table[t][i] =
-            ff_h264_chroma_qp[depth - 8][av_clip(i + index, 0, max_qp)];
-}
-
-int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
-{
-    unsigned int pps_id = get_ue_golomb(&h->gb);
-    PPS *pps;
-    const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
-    int bits_left;
-
-    if (pps_id >= MAX_PPS_COUNT) {
-        av_log(h->avctx, AV_LOG_ERROR, "pps_id %u out of range\n", pps_id);
-        return AVERROR_INVALIDDATA;
-    } else if (h->sps.bit_depth_luma > 10) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "Unimplemented luma bit depth=%d (max=10)\n",
-               h->sps.bit_depth_luma);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    pps = av_mallocz(sizeof(PPS));
-    if (!pps)
-        return AVERROR(ENOMEM);
-    pps->sps_id = get_ue_golomb_31(&h->gb);
-    if ((unsigned)pps->sps_id >= MAX_SPS_COUNT ||
-        h->sps_buffers[pps->sps_id] == NULL) {
-        av_log(h->avctx, AV_LOG_ERROR, "sps_id %u out of range\n", pps->sps_id);
-        goto fail;
-    }
-
-    pps->cabac             = get_bits1(&h->gb);
-    pps->pic_order_present = get_bits1(&h->gb);
-    pps->slice_group_count = get_ue_golomb(&h->gb) + 1;
-    if (pps->slice_group_count > 1) {
-        pps->mb_slice_group_map_type = get_ue_golomb(&h->gb);
-        av_log(h->avctx, AV_LOG_ERROR, "FMO not supported\n");
-        switch (pps->mb_slice_group_map_type) {
-        case 0:
-#if 0
-    |       for (i = 0; i <= num_slice_groups_minus1; i++)  |   |      |
-    |           run_length[i]                               |1  |ue(v) |
-#endif
-            break;
-        case 2:
-#if 0
-    |       for (i = 0; i < num_slice_groups_minus1; i++) { |   |      |
-    |           top_left_mb[i]                              |1  |ue(v) |
-    |           bottom_right_mb[i]                          |1  |ue(v) |
-    |       }                                               |   |      |
-#endif
-            break;
-        case 3:
-        case 4:
-        case 5:
-#if 0
-    |       slice_group_change_direction_flag               |1  |u(1)  |
-    |       slice_group_change_rate_minus1                  |1  |ue(v) |
-#endif
-            break;
-        case 6:
-#if 0
-    |       slice_group_id_cnt_minus1                       |1  |ue(v) |
-    |       for (i = 0; i <= slice_group_id_cnt_minus1; i++)|   |      |
-    |           slice_group_id[i]                           |1  |u(v)  |
-#endif
-            break;
-        }
-    }
-    pps->ref_count[0] = get_ue_golomb(&h->gb) + 1;
-    pps->ref_count[1] = get_ue_golomb(&h->gb) + 1;
-    if (pps->ref_count[0] - 1 > 32 - 1 || pps->ref_count[1] - 1 > 32 - 1) {
-        av_log(h->avctx, AV_LOG_ERROR, "reference overflow (pps)\n");
-        goto fail;
-    }
-
-    pps->weighted_pred                        = get_bits1(&h->gb);
-    pps->weighted_bipred_idc                  = get_bits(&h->gb, 2);
-    pps->init_qp                              = get_se_golomb(&h->gb) + 26 + qp_bd_offset;
-    pps->init_qs                              = get_se_golomb(&h->gb) + 26 + qp_bd_offset;
-    pps->chroma_qp_index_offset[0]            = get_se_golomb(&h->gb);
-    pps->deblocking_filter_parameters_present = get_bits1(&h->gb);
-    pps->constrained_intra_pred               = get_bits1(&h->gb);
-    pps->redundant_pic_cnt_present            = get_bits1(&h->gb);
-
-    pps->transform_8x8_mode = 0;
-    // contents of sps/pps can change even if id doesn't, so reinit
-    h->dequant_coeff_pps = -1;
-    memcpy(pps->scaling_matrix4, h->sps_buffers[pps->sps_id]->scaling_matrix4,
-           sizeof(pps->scaling_matrix4));
-    memcpy(pps->scaling_matrix8, h->sps_buffers[pps->sps_id]->scaling_matrix8,
-           sizeof(pps->scaling_matrix8));
-
-    bits_left = bit_length - get_bits_count(&h->gb);
-    if (bits_left && (bits_left > 8 ||
-                      show_bits(&h->gb, bits_left) != 1 << (bits_left - 1))) {
-        pps->transform_8x8_mode = get_bits1(&h->gb);
-        decode_scaling_matrices(h, h->sps_buffers[pps->sps_id], pps, 0,
-                                pps->scaling_matrix4, pps->scaling_matrix8);
-        // second_chroma_qp_index_offset
-        pps->chroma_qp_index_offset[1] = get_se_golomb(&h->gb);
-    } else {
-        pps->chroma_qp_index_offset[1] = pps->chroma_qp_index_offset[0];
-    }
-
-    build_qp_table(pps, 0, pps->chroma_qp_index_offset[0],
-                   h->sps.bit_depth_luma);
-    build_qp_table(pps, 1, pps->chroma_qp_index_offset[1],
-                   h->sps.bit_depth_luma);
-    if (pps->chroma_qp_index_offset[0] != pps->chroma_qp_index_offset[1])
-        pps->chroma_qp_diff = 1;
-
-    if (h->avctx->debug & FF_DEBUG_PICT_INFO) {
-        av_log(h->avctx, AV_LOG_DEBUG,
-               "pps:%u sps:%u %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d/%d %s %s %s %s\n",
-               pps_id, pps->sps_id,
-               pps->cabac ? "CABAC" : "CAVLC",
-               pps->slice_group_count,
-               pps->ref_count[0], pps->ref_count[1],
-               pps->weighted_pred ? "weighted" : "",
-               pps->init_qp, pps->init_qs, pps->chroma_qp_index_offset[0], pps->chroma_qp_index_offset[1],
-               pps->deblocking_filter_parameters_present ? "LPAR" : "",
-               pps->constrained_intra_pred ? "CONSTR" : "",
-               pps->redundant_pic_cnt_present ? "REDU" : "",
-               pps->transform_8x8_mode ? "8x8DCT" : "");
-    }
-
-    av_free(h->pps_buffers[pps_id]);
-    h->pps_buffers[pps_id] = pps;
-    return 0;
-
-fail:
-    av_free(pps);
-    return -1;
-}
diff --git a/deps/libav/libavcodec/h264_refs.c b/deps/libav/libavcodec/h264_refs.c
deleted file mode 100644
index a0b8f45..0000000
--- a/deps/libav/libavcodec/h264_refs.c
+++ /dev/null
@@ -1,813 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... reference picture handling
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10  reference picture handling.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "internal.h"
-#include "avcodec.h"
-#include "h264.h"
-#include "golomb.h"
-
-#include <assert.h>
-
-#define COPY_PICTURE(dst, src) \
-do {\
-    *(dst) = *(src);\
-    (dst)->f.extended_data = (dst)->f.data;\
-    (dst)->tf.f = &(dst)->f;\
-} while (0)
-
-
-static void pic_as_field(Picture *pic, const int parity){
-    int i;
-    for (i = 0; i < 4; ++i) {
-        if (parity == PICT_BOTTOM_FIELD)
-            pic->f.data[i] += pic->f.linesize[i];
-        pic->reference      = parity;
-        pic->f.linesize[i] *= 2;
-    }
-    pic->poc= pic->field_poc[parity == PICT_BOTTOM_FIELD];
-}
-
-static int split_field_copy(Picture *dest, Picture *src, int parity, int id_add)
-{
-    int match = !!(src->reference & parity);
-
-    if (match) {
-        COPY_PICTURE(dest, src);
-        if (parity != PICT_FRAME) {
-            pic_as_field(dest, parity);
-            dest->pic_id *= 2;
-            dest->pic_id += id_add;
-        }
-    }
-
-    return match;
-}
-
-static int build_def_list(Picture *def, int def_len,
-                          Picture **in, int len, int is_long, int sel)
-{
-    int  i[2] = { 0 };
-    int index = 0;
-
-    while ((i[0] < len || i[1] < len) && index < def_len) {
-        while (i[0] < len && !(in[i[0]] && (in[i[0]]->reference & sel)))
-            i[0]++;
-        while (i[1] < len && !(in[i[1]] && (in[i[1]]->reference & (sel ^ 3))))
-            i[1]++;
-        if (i[0] < len && index < def_len) {
-            in[i[0]]->pic_id = is_long ? i[0] : in[i[0]]->frame_num;
-            split_field_copy(&def[index++], in[i[0]++], sel, 1);
-        }
-        if (i[1] < len && index < def_len) {
-            in[i[1]]->pic_id = is_long ? i[1] : in[i[1]]->frame_num;
-            split_field_copy(&def[index++], in[i[1]++], sel ^ 3, 0);
-        }
-    }
-
-    return index;
-}
-
-static int add_sorted(Picture **sorted, Picture **src, int len, int limit, int dir)
-{
-    int i, best_poc;
-    int out_i = 0;
-
-    for (;;) {
-        best_poc = dir ? INT_MIN : INT_MAX;
-
-        for (i = 0; i < len; i++) {
-            const int poc = src[i]->poc;
-            if (((poc > limit) ^ dir) && ((poc < best_poc) ^ dir)) {
-                best_poc      = poc;
-                sorted[out_i] = src[i];
-            }
-        }
-        if (best_poc == (dir ? INT_MIN : INT_MAX))
-            break;
-        limit = sorted[out_i++]->poc - dir;
-    }
-    return out_i;
-}
-
-int ff_h264_fill_default_ref_list(H264Context *h)
-{
-    int i, len;
-
-    if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
-        Picture *sorted[32];
-        int cur_poc, list;
-        int lens[2];
-
-        if (FIELD_PICTURE(h))
-            cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];
-        else
-            cur_poc = h->cur_pic_ptr->poc;
-
-        for (list = 0; list < 2; list++) {
-            len  = add_sorted(sorted,       h->short_ref, h->short_ref_count, cur_poc, 1 ^ list);
-            len += add_sorted(sorted + len, h->short_ref, h->short_ref_count, cur_poc, 0 ^ list);
-            assert(len <= 32);
-
-            len  = build_def_list(h->default_ref_list[list], FF_ARRAY_ELEMS(h->default_ref_list[0]),
-                                  sorted, len, 0, h->picture_structure);
-            len += build_def_list(h->default_ref_list[list] + len,
-                                  FF_ARRAY_ELEMS(h->default_ref_list[0]) - len,
-                                  h->long_ref, 16, 1, h->picture_structure);
-
-            if (len < h->ref_count[list])
-                memset(&h->default_ref_list[list][len], 0, sizeof(Picture) * (h->ref_count[list] - len));
-            lens[list] = len;
-        }
-
-        if (lens[0] == lens[1] && lens[1] > 1) {
-            for (i = 0; i < lens[0] &&
-                        h->default_ref_list[0][i].f.buf[0]->buffer ==
-                        h->default_ref_list[1][i].f.buf[0]->buffer; i++);
-            if (i == lens[0]) {
-                Picture tmp;
-                COPY_PICTURE(&tmp, &h->default_ref_list[1][0]);
-                COPY_PICTURE(&h->default_ref_list[1][0], &h->default_ref_list[1][1]);
-                COPY_PICTURE(&h->default_ref_list[1][1], &tmp);
-            }
-        }
-    } else {
-        len  = build_def_list(h->default_ref_list[0], FF_ARRAY_ELEMS(h->default_ref_list[0]),
-                              h->short_ref, h->short_ref_count, 0, h->picture_structure);
-        len += build_def_list(h->default_ref_list[0] + len,
-                              FF_ARRAY_ELEMS(h->default_ref_list[0]) - len,
-                              h-> long_ref, 16, 1, h->picture_structure);
-
-        if (len < h->ref_count[0])
-            memset(&h->default_ref_list[0][len], 0, sizeof(Picture) * (h->ref_count[0] - len));
-    }
-#ifdef TRACE
-    for (i = 0; i < h->ref_count[0]; i++) {
-        tprintf(h->avctx, "List0: %s fn:%d 0x%p\n",
-                (h->default_ref_list[0][i].long_ref ? "LT" : "ST"),
-                h->default_ref_list[0][i].pic_id,
-                h->default_ref_list[0][i].f.data[0]);
-    }
-    if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
-        for (i = 0; i < h->ref_count[1]; i++) {
-            tprintf(h->avctx, "List1: %s fn:%d 0x%p\n",
-                    (h->default_ref_list[1][i].long_ref ? "LT" : "ST"),
-                    h->default_ref_list[1][i].pic_id,
-                    h->default_ref_list[1][i].f.data[0]);
-        }
-    }
-#endif
-    return 0;
-}
-
-static void print_short_term(H264Context *h);
-static void print_long_term(H264Context *h);
-
-/**
- * Extract structure information about the picture described by pic_num in
- * the current decoding context (frame or field). Note that pic_num is
- * picture number without wrapping (so, 0<=pic_num<max_pic_num).
- * @param pic_num picture number for which to extract structure information
- * @param structure one of PICT_XXX describing structure of picture
- *                      with pic_num
- * @return frame number (short term) or long term index of picture
- *         described by pic_num
- */
-static int pic_num_extract(H264Context *h, int pic_num, int *structure)
-{
-    *structure = h->picture_structure;
-    if (FIELD_PICTURE(h)) {
-        if (!(pic_num & 1))
-            /* opposite field */
-            *structure ^= PICT_FRAME;
-        pic_num >>= 1;
-    }
-
-    return pic_num;
-}
-
-int ff_h264_decode_ref_pic_list_reordering(H264Context *h)
-{
-    int list, index, pic_structure, i;
-
-    print_short_term(h);
-    print_long_term(h);
-
-    for (list = 0; list < h->list_count; list++) {
-        for (i = 0; i < h->ref_count[list]; i++)
-            COPY_PICTURE(&h->ref_list[list][i], &h->default_ref_list[list][i]);
-
-        if (get_bits1(&h->gb)) {
-            int pred = h->curr_pic_num;
-
-            for (index = 0; ; index++) {
-                unsigned int reordering_of_pic_nums_idc = get_ue_golomb_31(&h->gb);
-                unsigned int pic_id;
-                int i;
-                Picture *ref = NULL;
-
-                if (reordering_of_pic_nums_idc == 3)
-                    break;
-
-                if (index >= h->ref_count[list]) {
-                    av_log(h->avctx, AV_LOG_ERROR, "reference count overflow\n");
-                    return -1;
-                }
-
-                switch (reordering_of_pic_nums_idc) {
-                case 0:
-                case 1: {
-                    const unsigned int abs_diff_pic_num = get_ue_golomb(&h->gb) + 1;
-                    int frame_num;
-
-                    if (abs_diff_pic_num > h->max_pic_num) {
-                        av_log(h->avctx, AV_LOG_ERROR,
-                               "abs_diff_pic_num overflow\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-
-                    if (reordering_of_pic_nums_idc == 0)
-                        pred -= abs_diff_pic_num;
-                    else
-                        pred += abs_diff_pic_num;
-                    pred &= h->max_pic_num - 1;
-
-                    frame_num = pic_num_extract(h, pred, &pic_structure);
-
-                    for (i = h->short_ref_count - 1; i >= 0; i--) {
-                        ref = h->short_ref[i];
-                        assert(ref->reference);
-                        assert(!ref->long_ref);
-                        if (ref->frame_num == frame_num &&
-                            (ref->reference & pic_structure))
-                            break;
-                    }
-                    if (i >= 0)
-                        ref->pic_id = pred;
-                    break;
-                }
-                case 2: {
-                    int long_idx;
-                    pic_id = get_ue_golomb(&h->gb); // long_term_pic_idx
-
-                    long_idx = pic_num_extract(h, pic_id, &pic_structure);
-
-                    if (long_idx > 31) {
-                        av_log(h->avctx, AV_LOG_ERROR,
-                               "long_term_pic_idx overflow\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    ref = h->long_ref[long_idx];
-                    assert(!(ref && !ref->reference));
-                    if (ref && (ref->reference & pic_structure)) {
-                        ref->pic_id = pic_id;
-                        assert(ref->long_ref);
-                        i = 0;
-                    } else {
-                        i = -1;
-                    }
-                    break;
-                }
-                default:
-                    av_log(h->avctx, AV_LOG_ERROR,
-                           "illegal reordering_of_pic_nums_idc\n");
-                    return AVERROR_INVALIDDATA;
-                }
-
-                if (i < 0) {
-                    av_log(h->avctx, AV_LOG_ERROR,
-                           "reference picture missing during reorder\n");
-                    memset(&h->ref_list[list][index], 0, sizeof(Picture)); // FIXME
-                } else {
-                    for (i = index; i + 1 < h->ref_count[list]; i++) {
-                        if (ref->long_ref == h->ref_list[list][i].long_ref &&
-                            ref->pic_id   == h->ref_list[list][i].pic_id)
-                            break;
-                    }
-                    for (; i > index; i--) {
-                        COPY_PICTURE(&h->ref_list[list][i], &h->ref_list[list][i - 1]);
-                    }
-                    COPY_PICTURE(&h->ref_list[list][index], ref);
-                    if (FIELD_PICTURE(h)) {
-                        pic_as_field(&h->ref_list[list][index], pic_structure);
-                    }
-                }
-            }
-        }
-    }
-    for (list = 0; list < h->list_count; list++) {
-        for (index = 0; index < h->ref_count[list]; index++) {
-            if (!h->ref_list[list][index].f.buf[0]) {
-                av_log(h->avctx, AV_LOG_ERROR, "Missing reference picture\n");
-                if (h->default_ref_list[list][0].f.buf[0])
-                    COPY_PICTURE(&h->ref_list[list][index], &h->default_ref_list[list][0]);
-                else
-                    return -1;
-            }
-        }
-    }
-
-    return 0;
-}
-
-void ff_h264_fill_mbaff_ref_list(H264Context *h)
-{
-    int list, i, j;
-    for (list = 0; list < 2; list++) { //FIXME try list_count
-        for (i = 0; i < h->ref_count[list]; i++) {
-            Picture *frame = &h->ref_list[list][i];
-            Picture *field = &h->ref_list[list][16 + 2 * i];
-            COPY_PICTURE(field, frame);
-            for (j = 0; j < 3; j++)
-                field[0].f.linesize[j] <<= 1;
-            field[0].reference = PICT_TOP_FIELD;
-            field[0].poc       = field[0].field_poc[0];
-            COPY_PICTURE(field + 1, field);
-            for (j = 0; j < 3; j++)
-                field[1].f.data[j] += frame->f.linesize[j];
-            field[1].reference = PICT_BOTTOM_FIELD;
-            field[1].poc       = field[1].field_poc[1];
-
-            h->luma_weight[16 + 2 * i][list][0] = h->luma_weight[16 + 2 * i + 1][list][0] = h->luma_weight[i][list][0];
-            h->luma_weight[16 + 2 * i][list][1] = h->luma_weight[16 + 2 * i + 1][list][1] = h->luma_weight[i][list][1];
-            for (j = 0; j < 2; j++) {
-                h->chroma_weight[16 + 2 * i][list][j][0] = h->chroma_weight[16 + 2 * i + 1][list][j][0] = h->chroma_weight[i][list][j][0];
-                h->chroma_weight[16 + 2 * i][list][j][1] = h->chroma_weight[16 + 2 * i + 1][list][j][1] = h->chroma_weight[i][list][j][1];
-            }
-        }
-    }
-}
-
-/**
- * Mark a picture as no longer needed for reference. The refmask
- * argument allows unreferencing of individual fields or the whole frame.
- * If the picture becomes entirely unreferenced, but is being held for
- * display purposes, it is marked as such.
- * @param refmask mask of fields to unreference; the mask is bitwise
- *                anded with the reference marking of pic
- * @return non-zero if pic becomes entirely unreferenced (except possibly
- *         for display purposes) zero if one of the fields remains in
- *         reference
- */
-static inline int unreference_pic(H264Context *h, Picture *pic, int refmask)
-{
-    int i;
-    if (pic->reference &= refmask) {
-        return 0;
-    } else {
-        for(i = 0; h->delayed_pic[i]; i++)
-            if(pic == h->delayed_pic[i]){
-                pic->reference = DELAYED_PIC_REF;
-                break;
-            }
-        return 1;
-    }
-}
-
-/**
- * Find a Picture in the short term reference list by frame number.
- * @param frame_num frame number to search for
- * @param idx the index into h->short_ref where returned picture is found
- *            undefined if no picture found.
- * @return pointer to the found picture, or NULL if no pic with the provided
- *                 frame number is found
- */
-static Picture *find_short(H264Context *h, int frame_num, int *idx)
-{
-    int i;
-
-    for (i = 0; i < h->short_ref_count; i++) {
-        Picture *pic = h->short_ref[i];
-        if (h->avctx->debug & FF_DEBUG_MMCO)
-            av_log(h->avctx, AV_LOG_DEBUG, "%d %d %p\n", i, pic->frame_num, pic);
-        if (pic->frame_num == frame_num) {
-            *idx = i;
-            return pic;
-        }
-    }
-    return NULL;
-}
-
-/**
- * Remove a picture from the short term reference list by its index in
- * that list.  This does no checking on the provided index; it is assumed
- * to be valid. Other list entries are shifted down.
- * @param i index into h->short_ref of picture to remove.
- */
-static void remove_short_at_index(H264Context *h, int i)
-{
-    assert(i >= 0 && i < h->short_ref_count);
-    h->short_ref[i] = NULL;
-    if (--h->short_ref_count)
-        memmove(&h->short_ref[i], &h->short_ref[i + 1],
-                (h->short_ref_count - i) * sizeof(Picture*));
-}
-
-/**
- *
- * @return the removed picture or NULL if an error occurs
- */
-static Picture *remove_short(H264Context *h, int frame_num, int ref_mask)
-{
-    Picture *pic;
-    int i;
-
-    if (h->avctx->debug & FF_DEBUG_MMCO)
-        av_log(h->avctx, AV_LOG_DEBUG, "remove short %d count %d\n", frame_num, h->short_ref_count);
-
-    pic = find_short(h, frame_num, &i);
-    if (pic) {
-        if (unreference_pic(h, pic, ref_mask))
-            remove_short_at_index(h, i);
-    }
-
-    return pic;
-}
-
-/**
- * Remove a picture from the long term reference list by its index in
- * that list.
- * @return the removed picture or NULL if an error occurs
- */
-static Picture *remove_long(H264Context *h, int i, int ref_mask)
-{
-    Picture *pic;
-
-    pic = h->long_ref[i];
-    if (pic) {
-        if (unreference_pic(h, pic, ref_mask)) {
-            assert(h->long_ref[i]->long_ref == 1);
-            h->long_ref[i]->long_ref = 0;
-            h->long_ref[i]           = NULL;
-            h->long_ref_count--;
-        }
-    }
-
-    return pic;
-}
-
-void ff_h264_remove_all_refs(H264Context *h)
-{
-    int i;
-
-    for (i = 0; i < 16; i++) {
-        remove_long(h, i, 0);
-    }
-    assert(h->long_ref_count == 0);
-
-    for (i = 0; i < h->short_ref_count; i++) {
-        unreference_pic(h, h->short_ref[i], 0);
-        h->short_ref[i] = NULL;
-    }
-    h->short_ref_count = 0;
-}
-
-/**
- * print short term list
- */
-static void print_short_term(H264Context *h)
-{
-    uint32_t i;
-    if (h->avctx->debug & FF_DEBUG_MMCO) {
-        av_log(h->avctx, AV_LOG_DEBUG, "short term list:\n");
-        for (i = 0; i < h->short_ref_count; i++) {
-            Picture *pic = h->short_ref[i];
-            av_log(h->avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n",
-                   i, pic->frame_num, pic->poc, pic->f.data[0]);
-        }
-    }
-}
-
-/**
- * print long term list
- */
-static void print_long_term(H264Context *h)
-{
-    uint32_t i;
-    if (h->avctx->debug & FF_DEBUG_MMCO) {
-        av_log(h->avctx, AV_LOG_DEBUG, "long term list:\n");
-        for (i = 0; i < 16; i++) {
-            Picture *pic = h->long_ref[i];
-            if (pic) {
-                av_log(h->avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n",
-                       i, pic->frame_num, pic->poc, pic->f.data[0]);
-            }
-        }
-    }
-}
-
-static int check_opcodes(MMCO *mmco1, MMCO *mmco2, int n_mmcos)
-{
-    int i;
-
-    for (i = 0; i < n_mmcos; i++) {
-        if (mmco1[i].opcode != mmco2[i].opcode)
-            return -1;
-    }
-
-    return 0;
-}
-
-int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice)
-{
-    MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;
-    int mmco_index = 0, i;
-
-    assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count);
-
-    if (h->short_ref_count &&
-        h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count &&
-        !(FIELD_PICTURE(h) && !h->first_field && h->cur_pic_ptr->reference)) {
-        mmco[0].opcode        = MMCO_SHORT2UNUSED;
-        mmco[0].short_pic_num = h->short_ref[h->short_ref_count - 1]->frame_num;
-        mmco_index            = 1;
-        if (FIELD_PICTURE(h)) {
-            mmco[0].short_pic_num *= 2;
-            mmco[1].opcode         = MMCO_SHORT2UNUSED;
-            mmco[1].short_pic_num  = mmco[0].short_pic_num + 1;
-            mmco_index             = 2;
-        }
-    }
-
-    if (first_slice) {
-        h->mmco_index = mmco_index;
-    } else if (!first_slice && mmco_index >= 0 &&
-               (mmco_index != h->mmco_index ||
-                (i = check_opcodes(h->mmco, mmco_temp, mmco_index)))) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "Inconsistent MMCO state between slices [%d, %d, %d]\n",
-               mmco_index, h->mmco_index, i);
-        return AVERROR_INVALIDDATA;
-    }
-    return 0;
-}
-
-int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
-{
-    int i, av_uninit(j);
-    int current_ref_assigned = 0, err = 0;
-    Picture *av_uninit(pic);
-
-    if ((h->avctx->debug & FF_DEBUG_MMCO) && mmco_count == 0)
-        av_log(h->avctx, AV_LOG_DEBUG, "no mmco here\n");
-
-    for (i = 0; i < mmco_count; i++) {
-        int av_uninit(structure), av_uninit(frame_num);
-        if (h->avctx->debug & FF_DEBUG_MMCO)
-            av_log(h->avctx, AV_LOG_DEBUG, "mmco:%d %d %d\n", h->mmco[i].opcode,
-                   h->mmco[i].short_pic_num, h->mmco[i].long_arg);
-
-        if (mmco[i].opcode == MMCO_SHORT2UNUSED ||
-            mmco[i].opcode == MMCO_SHORT2LONG) {
-            frame_num = pic_num_extract(h, mmco[i].short_pic_num, &structure);
-            pic       = find_short(h, frame_num, &j);
-            if (!pic) {
-                if (mmco[i].opcode != MMCO_SHORT2LONG ||
-                    !h->long_ref[mmco[i].long_arg]    ||
-                    h->long_ref[mmco[i].long_arg]->frame_num != frame_num) {
-                    av_log(h->avctx, AV_LOG_ERROR, "mmco: unref short failure\n");
-                    err = AVERROR_INVALIDDATA;
-                }
-                continue;
-            }
-        }
-
-        switch (mmco[i].opcode) {
-        case MMCO_SHORT2UNUSED:
-            if (h->avctx->debug & FF_DEBUG_MMCO)
-                av_log(h->avctx, AV_LOG_DEBUG, "mmco: unref short %d count %d\n",
-                       h->mmco[i].short_pic_num, h->short_ref_count);
-            remove_short(h, frame_num, structure ^ PICT_FRAME);
-            break;
-        case MMCO_SHORT2LONG:
-                if (h->long_ref[mmco[i].long_arg] != pic)
-                    remove_long(h, mmco[i].long_arg, 0);
-
-                remove_short_at_index(h, j);
-                h->long_ref[ mmco[i].long_arg ] = pic;
-                if (h->long_ref[mmco[i].long_arg]) {
-                    h->long_ref[mmco[i].long_arg]->long_ref = 1;
-                    h->long_ref_count++;
-                }
-            break;
-        case MMCO_LONG2UNUSED:
-            j   = pic_num_extract(h, mmco[i].long_arg, &structure);
-            pic = h->long_ref[j];
-            if (pic) {
-                remove_long(h, j, structure ^ PICT_FRAME);
-            } else if (h->avctx->debug & FF_DEBUG_MMCO)
-                av_log(h->avctx, AV_LOG_DEBUG, "mmco: unref long failure\n");
-            break;
-        case MMCO_LONG:
-                    // Comment below left from previous code as it is an interresting note.
-                    /* First field in pair is in short term list or
-                     * at a different long term index.
-                     * This is not allowed; see 7.4.3.3, notes 2 and 3.
-                     * Report the problem and keep the pair where it is,
-                     * and mark this field valid.
-                     */
-            if (h->short_ref[0] == h->cur_pic_ptr)
-                remove_short_at_index(h, 0);
-
-            if (h->long_ref[mmco[i].long_arg] != h->cur_pic_ptr) {
-                remove_long(h, mmco[i].long_arg, 0);
-
-                h->long_ref[mmco[i].long_arg]           = h->cur_pic_ptr;
-                h->long_ref[mmco[i].long_arg]->long_ref = 1;
-                h->long_ref_count++;
-            }
-
-            h->cur_pic_ptr->reference |= h->picture_structure;
-            current_ref_assigned = 1;
-            break;
-        case MMCO_SET_MAX_LONG:
-            assert(mmco[i].long_arg <= 16);
-            // just remove the long term which index is greater than new max
-            for (j = mmco[i].long_arg; j < 16; j++) {
-                remove_long(h, j, 0);
-            }
-            break;
-        case MMCO_RESET:
-            while (h->short_ref_count) {
-                remove_short(h, h->short_ref[0]->frame_num, 0);
-            }
-            for (j = 0; j < 16; j++) {
-                remove_long(h, j, 0);
-            }
-            h->frame_num  = h->cur_pic_ptr->frame_num = 0;
-            h->mmco_reset = 1;
-            h->cur_pic_ptr->mmco_reset = 1;
-            break;
-        default: assert(0);
-        }
-    }
-
-    if (!current_ref_assigned) {
-        /* Second field of complementary field pair; the first field of
-         * which is already referenced. If short referenced, it
-         * should be first entry in short_ref. If not, it must exist
-         * in long_ref; trying to put it on the short list here is an
-         * error in the encoded bit stream (ref: 7.4.3.3, NOTE 2 and 3).
-         */
-        if (h->short_ref_count && h->short_ref[0] == h->cur_pic_ptr) {
-            /* Just mark the second field valid */
-            h->cur_pic_ptr->reference = PICT_FRAME;
-        } else if (h->cur_pic_ptr->long_ref) {
-            av_log(h->avctx, AV_LOG_ERROR, "illegal short term reference "
-                                           "assignment for second field "
-                                           "in complementary field pair "
-                                           "(first field is long term)\n");
-            err = AVERROR_INVALIDDATA;
-        } else {
-            pic = remove_short(h, h->cur_pic_ptr->frame_num, 0);
-            if (pic) {
-                av_log(h->avctx, AV_LOG_ERROR, "illegal short term buffer state detected\n");
-                err = AVERROR_INVALIDDATA;
-            }
-
-            if (h->short_ref_count)
-                memmove(&h->short_ref[1], &h->short_ref[0],
-                        h->short_ref_count * sizeof(Picture*));
-
-            h->short_ref[0] = h->cur_pic_ptr;
-            h->short_ref_count++;
-            h->cur_pic_ptr->reference |= h->picture_structure;
-        }
-    }
-
-    if (h->long_ref_count + h->short_ref_count -
-        (h->short_ref[0] == h->cur_pic_ptr) > h->sps.ref_frame_count) {
-
-        /* We have too many reference frames, probably due to corrupted
-         * stream. Need to discard one frame. Prevents overrun of the
-         * short_ref and long_ref buffers.
-         */
-        av_log(h->avctx, AV_LOG_ERROR,
-               "number of reference frames (%d+%d) exceeds max (%d; probably "
-               "corrupt input), discarding one\n",
-               h->long_ref_count, h->short_ref_count, h->sps.ref_frame_count);
-        err = AVERROR_INVALIDDATA;
-
-        if (h->long_ref_count && !h->short_ref_count) {
-            for (i = 0; i < 16; ++i)
-                if (h->long_ref[i])
-                    break;
-
-            assert(i < 16);
-            remove_long(h, i, 0);
-        } else {
-            pic = h->short_ref[h->short_ref_count - 1];
-            remove_short(h, pic->frame_num, 0);
-        }
-    }
-
-    print_short_term(h);
-    print_long_term(h);
-    return (h->avctx->err_recognition & AV_EF_EXPLODE) ? err : 0;
-}
-
-int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
-                                   int first_slice)
-{
-    int i, ret;
-    MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;
-    int mmco_index = 0;
-
-    if (h->nal_unit_type == NAL_IDR_SLICE) { // FIXME fields
-        skip_bits1(gb); // broken_link
-        if (get_bits1(gb)) {
-            mmco[0].opcode   = MMCO_LONG;
-            mmco[0].long_arg = 0;
-            mmco_index       = 1;
-        }
-    } else {
-        if (get_bits1(gb)) { // adaptive_ref_pic_marking_mode_flag
-            for (i = 0; i < MAX_MMCO_COUNT; i++) {
-                MMCOOpcode opcode = get_ue_golomb_31(gb);
-
-                mmco[i].opcode = opcode;
-                if (opcode == MMCO_SHORT2UNUSED || opcode == MMCO_SHORT2LONG) {
-                    mmco[i].short_pic_num =
-                        (h->curr_pic_num - get_ue_golomb(gb) - 1) &
-                            (h->max_pic_num - 1);
-#if 0
-                    if (mmco[i].short_pic_num >= h->short_ref_count ||
-                        h->short_ref[ mmco[i].short_pic_num ] == NULL){
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "illegal short ref in memory management control "
-                               "operation %d\n", mmco);
-                        return -1;
-                    }
-#endif
-                }
-                if (opcode == MMCO_SHORT2LONG || opcode == MMCO_LONG2UNUSED ||
-                    opcode == MMCO_LONG || opcode == MMCO_SET_MAX_LONG) {
-                    unsigned int long_arg = get_ue_golomb_31(gb);
-                    if (long_arg >= 32 ||
-                        (long_arg >= 16 && !(opcode == MMCO_SET_MAX_LONG &&
-                                             long_arg == 16) &&
-                         !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE(h)))) {
-                        av_log(h->avctx, AV_LOG_ERROR,
-                               "illegal long ref in memory management control "
-                               "operation %d\n", opcode);
-                        return -1;
-                    }
-                    mmco[i].long_arg = long_arg;
-                }
-
-                if (opcode > (unsigned) MMCO_LONG) {
-                    av_log(h->avctx, AV_LOG_ERROR,
-                           "illegal memory management control operation %d\n",
-                           opcode);
-                    return -1;
-                }
-                if (opcode == MMCO_END)
-                    break;
-            }
-            mmco_index = i;
-        } else {
-            if (first_slice) {
-                ret = ff_generate_sliding_window_mmcos(h, first_slice);
-                if (ret < 0 && h->avctx->err_recognition & AV_EF_EXPLODE)
-                    return ret;
-            }
-            mmco_index = -1;
-        }
-    }
-
-    if (first_slice && mmco_index != -1) {
-        h->mmco_index = mmco_index;
-    } else if (!first_slice && mmco_index >= 0 &&
-               (mmco_index != h->mmco_index ||
-                check_opcodes(h->mmco, mmco_temp, mmco_index))) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "Inconsistent MMCO state between slices [%d, %d]\n",
-               mmco_index, h->mmco_index);
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/h264_sei.c b/deps/libav/libavcodec/h264_sei.c
deleted file mode 100644
index 6fca2c3..0000000
--- a/deps/libav/libavcodec/h264_sei.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... sei decoding
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 sei decoding.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "avcodec.h"
-#include "golomb.h"
-#include "h264.h"
-#include "internal.h"
-
-static const uint8_t sei_num_clock_ts_table[9] = {
-    1, 1, 1, 2, 2, 3, 3, 2, 3
-};
-
-void ff_h264_reset_sei(H264Context *h)
-{
-    h->sei_recovery_frame_cnt       = -1;
-    h->sei_dpb_output_delay         =  0;
-    h->sei_cpb_removal_delay        = -1;
-    h->sei_buffering_period_present =  0;
-    h->sei_frame_packing_present    =  0;
-}
-
-static int decode_picture_timing(H264Context *h)
-{
-    if (h->sps.nal_hrd_parameters_present_flag ||
-        h->sps.vcl_hrd_parameters_present_flag) {
-        h->sei_cpb_removal_delay = get_bits(&h->gb,
-                                            h->sps.cpb_removal_delay_length);
-        h->sei_dpb_output_delay  = get_bits(&h->gb,
-                                            h->sps.dpb_output_delay_length);
-    }
-    if (h->sps.pic_struct_present_flag) {
-        unsigned int i, num_clock_ts;
-
-        h->sei_pic_struct = get_bits(&h->gb, 4);
-        h->sei_ct_type    = 0;
-
-        if (h->sei_pic_struct > SEI_PIC_STRUCT_FRAME_TRIPLING)
-            return AVERROR_INVALIDDATA;
-
-        num_clock_ts = sei_num_clock_ts_table[h->sei_pic_struct];
-
-        for (i = 0; i < num_clock_ts; i++) {
-            if (get_bits(&h->gb, 1)) {                /* clock_timestamp_flag */
-                unsigned int full_timestamp_flag;
-
-                h->sei_ct_type |= 1 << get_bits(&h->gb, 2);
-                skip_bits(&h->gb, 1);                 /* nuit_field_based_flag */
-                skip_bits(&h->gb, 5);                 /* counting_type */
-                full_timestamp_flag = get_bits(&h->gb, 1);
-                skip_bits(&h->gb, 1);                 /* discontinuity_flag */
-                skip_bits(&h->gb, 1);                 /* cnt_dropped_flag */
-                skip_bits(&h->gb, 8);                 /* n_frames */
-                if (full_timestamp_flag) {
-                    skip_bits(&h->gb, 6);             /* seconds_value 0..59 */
-                    skip_bits(&h->gb, 6);             /* minutes_value 0..59 */
-                    skip_bits(&h->gb, 5);             /* hours_value 0..23 */
-                } else {
-                    if (get_bits(&h->gb, 1)) {        /* seconds_flag */
-                        skip_bits(&h->gb, 6);         /* seconds_value range 0..59 */
-                        if (get_bits(&h->gb, 1)) {    /* minutes_flag */
-                            skip_bits(&h->gb, 6);     /* minutes_value 0..59 */
-                            if (get_bits(&h->gb, 1))  /* hours_flag */
-                                skip_bits(&h->gb, 5); /* hours_value 0..23 */
-                        }
-                    }
-                }
-                if (h->sps.time_offset_length > 0)
-                    skip_bits(&h->gb,
-                              h->sps.time_offset_length); /* time_offset */
-            }
-        }
-
-        if (h->avctx->debug & FF_DEBUG_PICT_INFO)
-            av_log(h->avctx, AV_LOG_DEBUG, "ct_type:%X pic_struct:%d\n",
-                   h->sei_ct_type, h->sei_pic_struct);
-    }
-    return 0;
-}
-
-static int decode_unregistered_user_data(H264Context *h, int size)
-{
-    uint8_t user_data[16 + 256];
-    int e, build, i;
-
-    if (size < 16)
-        return AVERROR_INVALIDDATA;
-
-    for (i = 0; i < sizeof(user_data) - 1 && i < size; i++)
-        user_data[i] = get_bits(&h->gb, 8);
-
-    user_data[i] = 0;
-    e = sscanf(user_data + 16, "x264 - core %d", &build);
-    if (e == 1 && build > 0)
-        h->x264_build = build;
-
-    if (h->avctx->debug & FF_DEBUG_BUGS)
-        av_log(h->avctx, AV_LOG_DEBUG, "user data:\"%s\"\n", user_data + 16);
-
-    for (; i < size; i++)
-        skip_bits(&h->gb, 8);
-
-    return 0;
-}
-
-static int decode_recovery_point(H264Context *h)
-{
-    h->sei_recovery_frame_cnt = get_ue_golomb(&h->gb);
-
-    /* 1b exact_match_flag,
-     * 1b broken_link_flag,
-     * 2b changing_slice_group_idc */
-    skip_bits(&h->gb, 4);
-
-    return 0;
-}
-
-static int decode_buffering_period(H264Context *h)
-{
-    unsigned int sps_id;
-    int sched_sel_idx;
-    SPS *sps;
-
-    sps_id = get_ue_golomb_31(&h->gb);
-    if (sps_id > 31 || !h->sps_buffers[sps_id]) {
-        av_log(h->avctx, AV_LOG_ERROR,
-               "non-existing SPS %d referenced in buffering period\n", sps_id);
-        return AVERROR_INVALIDDATA;
-    }
-    sps = h->sps_buffers[sps_id];
-
-    // NOTE: This is really so duplicated in the standard... See H.264, D.1.1
-    if (sps->nal_hrd_parameters_present_flag) {
-        for (sched_sel_idx = 0; sched_sel_idx < sps->cpb_cnt; sched_sel_idx++) {
-            h->initial_cpb_removal_delay[sched_sel_idx] =
-                get_bits(&h->gb, sps->initial_cpb_removal_delay_length);
-            // initial_cpb_removal_delay_offset
-            skip_bits(&h->gb, sps->initial_cpb_removal_delay_length);
-        }
-    }
-    if (sps->vcl_hrd_parameters_present_flag) {
-        for (sched_sel_idx = 0; sched_sel_idx < sps->cpb_cnt; sched_sel_idx++) {
-            h->initial_cpb_removal_delay[sched_sel_idx] =
-                get_bits(&h->gb, sps->initial_cpb_removal_delay_length);
-            // initial_cpb_removal_delay_offset
-            skip_bits(&h->gb, sps->initial_cpb_removal_delay_length);
-        }
-    }
-
-    h->sei_buffering_period_present = 1;
-    return 0;
-}
-
-static int decode_frame_packing_arrangement(H264Context *h)
-{
-    get_ue_golomb(&h->gb);              // frame_packing_arrangement_id
-    h->sei_frame_packing_present = !get_bits1(&h->gb);
-
-    if (h->sei_frame_packing_present) {
-        h->frame_packing_arrangement_type = get_bits(&h->gb, 7);
-        h->quincunx_subsampling           = get_bits1(&h->gb);
-        h->content_interpretation_type    = get_bits(&h->gb, 6);
-
-        // the following skips: spatial_flipping_flag, frame0_flipped_flag,
-        // field_views_flag, current_frame_is_frame0_flag,
-        // frame0_self_contained_flag, frame1_self_contained_flag
-        skip_bits(&h->gb, 6);
-
-        if (!h->quincunx_subsampling && h->frame_packing_arrangement_type != 5)
-            skip_bits(&h->gb, 16);      // frame[01]_grid_position_[xy]
-        skip_bits(&h->gb, 8);           // frame_packing_arrangement_reserved_byte
-        get_ue_golomb(&h->gb);          // frame_packing_arrangement_repetition_period
-    }
-    skip_bits1(&h->gb);                 // frame_packing_arrangement_extension_flag
-
-    return 0;
-}
-
-int ff_h264_decode_sei(H264Context *h)
-{
-    while (get_bits_left(&h->gb) > 16) {
-        int size = 0;
-        int type = 0;
-        int ret  = 0;
-
-        do
-            type += show_bits(&h->gb, 8);
-        while (get_bits(&h->gb, 8) == 255);
-
-        do
-            size += show_bits(&h->gb, 8);
-        while (get_bits(&h->gb, 8) == 255);
-
-        if (size > get_bits_left(&h->gb) / 8) {
-            av_log(h->avctx, AV_LOG_ERROR, "SEI type %d truncated at %d\n",
-                   type, get_bits_left(&h->gb));
-            return AVERROR_INVALIDDATA;
-        }
-
-        switch (type) {
-        case SEI_TYPE_PIC_TIMING: // Picture timing SEI
-            ret = decode_picture_timing(h);
-            if (ret < 0)
-                return ret;
-            break;
-        case SEI_TYPE_USER_DATA_UNREGISTERED:
-            ret = decode_unregistered_user_data(h, size);
-            if (ret < 0)
-                return ret;
-            break;
-        case SEI_TYPE_RECOVERY_POINT:
-            ret = decode_recovery_point(h);
-            if (ret < 0)
-                return ret;
-            break;
-        case SEI_TYPE_BUFFERING_PERIOD:
-            ret = decode_buffering_period(h);
-            if (ret < 0)
-                return ret;
-            break;
-        case SEI_TYPE_FRAME_PACKING:
-            ret = decode_frame_packing_arrangement(h);
-            if (ret < 0)
-                return ret;
-            break;
-        default:
-            av_log(h->avctx, AV_LOG_DEBUG, "unknown SEI type %d\n", type);
-            skip_bits(&h->gb, 8 * size);
-        }
-
-        // FIXME check bits here
-        align_get_bits(&h->gb);
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/h264addpx_template.c b/deps/libav/libavcodec/h264addpx_template.c
deleted file mode 100644
index cdbfc67..0000000
--- a/deps/libav/libavcodec/h264addpx_template.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003-2011 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 DSP functions.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "bit_depth_template.c"
-
-static void FUNCC(ff_h264_add_pixels4)(uint8_t *_dst, int16_t *_src, int stride)
-{
-    int i;
-    pixel *dst = (pixel *) _dst;
-    dctcoef *src = (dctcoef *) _src;
-    stride /= sizeof(pixel);
-
-    for (i = 0; i < 4; i++) {
-        dst[0] += src[0];
-        dst[1] += src[1];
-        dst[2] += src[2];
-        dst[3] += src[3];
-
-        dst += stride;
-        src += 4;
-    }
-
-    memset(_src, 0, sizeof(dctcoef) * 16);
-}
-
-static void FUNCC(ff_h264_add_pixels8)(uint8_t *_dst, int16_t *_src, int stride)
-{
-    int i;
-    pixel *dst = (pixel *) _dst;
-    dctcoef *src = (dctcoef *) _src;
-    stride /= sizeof(pixel);
-
-    for (i = 0; i < 8; i++) {
-        dst[0] += src[0];
-        dst[1] += src[1];
-        dst[2] += src[2];
-        dst[3] += src[3];
-        dst[4] += src[4];
-        dst[5] += src[5];
-        dst[6] += src[6];
-        dst[7] += src[7];
-
-        dst += stride;
-        src += 8;
-    }
-
-    memset(_src, 0, sizeof(dctcoef) * 64);
-}
diff --git a/deps/libav/libavcodec/h264chroma.c b/deps/libav/libavcodec/h264chroma.c
deleted file mode 100644
index d5146de..0000000
--- a/deps/libav/libavcodec/h264chroma.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "h264chroma.h"
-
-#define BIT_DEPTH 8
-#include "h264chroma_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 16
-#include "h264chroma_template.c"
-#undef BIT_DEPTH
-
-#define SET_CHROMA(depth)                                                   \
-    c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_ ## depth ## _c; \
-    c->put_h264_chroma_pixels_tab[1] = put_h264_chroma_mc4_ ## depth ## _c; \
-    c->put_h264_chroma_pixels_tab[2] = put_h264_chroma_mc2_ ## depth ## _c; \
-    c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_ ## depth ## _c; \
-    c->avg_h264_chroma_pixels_tab[1] = avg_h264_chroma_mc4_ ## depth ## _c; \
-    c->avg_h264_chroma_pixels_tab[2] = avg_h264_chroma_mc2_ ## depth ## _c; \
-
-av_cold void ff_h264chroma_init(H264ChromaContext *c, int bit_depth)
-{
-    if (bit_depth > 8 && bit_depth <= 16) {
-        SET_CHROMA(16);
-    } else {
-        SET_CHROMA(8);
-    }
-
-    if (ARCH_AARCH64)
-        ff_h264chroma_init_aarch64(c, bit_depth);
-    if (ARCH_ARM)
-        ff_h264chroma_init_arm(c, bit_depth);
-    if (ARCH_PPC)
-        ff_h264chroma_init_ppc(c, bit_depth);
-    if (ARCH_X86)
-        ff_h264chroma_init_x86(c, bit_depth);
-}
diff --git a/deps/libav/libavcodec/h264chroma.h b/deps/libav/libavcodec/h264chroma.h
deleted file mode 100644
index 93064fe..0000000
--- a/deps/libav/libavcodec/h264chroma.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_H264CHROMA_H
-#define AVCODEC_H264CHROMA_H
-
-#include <stdint.h>
-
-typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
-
-typedef struct H264ChromaContext {
-    h264_chroma_mc_func put_h264_chroma_pixels_tab[3];
-    h264_chroma_mc_func avg_h264_chroma_pixels_tab[3];
-} H264ChromaContext;
-
-void ff_h264chroma_init(H264ChromaContext *c, int bit_depth);
-
-void ff_h264chroma_init_aarch64(H264ChromaContext *c, int bit_depth);
-void ff_h264chroma_init_arm(H264ChromaContext *c, int bit_depth);
-void ff_h264chroma_init_ppc(H264ChromaContext *c, int bit_depth);
-void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth);
-
-#endif /* AVCODEC_H264CHROMA_H */
diff --git a/deps/libav/libavcodec/h264chroma_template.c b/deps/libav/libavcodec/h264chroma_template.c
deleted file mode 100644
index 028ed13..0000000
--- a/deps/libav/libavcodec/h264chroma_template.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <assert.h>
-
-#include "bit_depth_template.c"
-
-#define H264_CHROMA_MC(OPNAME, OP)\
-static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    const int A=(8-x)*(8-y);\
-    const int B=(  x)*(8-y);\
-    const int C=(8-x)*(  y);\
-    const int D=(  x)*(  y);\
-    int i;\
-    stride /= sizeof(pixel);\
-    \
-    assert(x<8 && y<8 && x>=0 && y>=0);\
-\
-    if(D){\
-        for(i=0; i<h; i++){\
-            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
-            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
-            dst+= stride;\
-            src+= stride;\
-        }\
-    } else if (B + C) {\
-        const int E= B+C;\
-        const int step= C ? stride : 1;\
-        for(i=0; i<h; i++){\
-            OP(dst[0], (A*src[0] + E*src[step+0]));\
-            OP(dst[1], (A*src[1] + E*src[step+1]));\
-            dst+= stride;\
-            src+= stride;\
-        }\
-    } else {\
-        for ( i = 0; i < h; i++){\
-            OP(dst[0], A * src[0]);\
-            OP(dst[1], A * src[1]);\
-            dst += stride;\
-            src += stride;\
-        }\
-    }\
-}\
-\
-static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    const int A=(8-x)*(8-y);\
-    const int B=(  x)*(8-y);\
-    const int C=(8-x)*(  y);\
-    const int D=(  x)*(  y);\
-    int i;\
-    stride /= sizeof(pixel);\
-    \
-    assert(x<8 && y<8 && x>=0 && y>=0);\
-\
-    if(D){\
-        for(i=0; i<h; i++){\
-            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
-            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
-            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
-            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
-            dst+= stride;\
-            src+= stride;\
-        }\
-    } else if (B + C) {\
-        const int E= B+C;\
-        const int step= C ? stride : 1;\
-        for(i=0; i<h; i++){\
-            OP(dst[0], (A*src[0] + E*src[step+0]));\
-            OP(dst[1], (A*src[1] + E*src[step+1]));\
-            OP(dst[2], (A*src[2] + E*src[step+2]));\
-            OP(dst[3], (A*src[3] + E*src[step+3]));\
-            dst+= stride;\
-            src+= stride;\
-        }\
-    } else {\
-        for ( i = 0; i < h; i++){\
-            OP(dst[0], A * src[0]);\
-            OP(dst[1], A * src[1]);\
-            OP(dst[2], A * src[2]);\
-            OP(dst[3], A * src[3]);\
-            dst += stride;\
-            src += stride;\
-        }\
-    }\
-}\
-\
-static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    const int A=(8-x)*(8-y);\
-    const int B=(  x)*(8-y);\
-    const int C=(8-x)*(  y);\
-    const int D=(  x)*(  y);\
-    int i;\
-    stride /= sizeof(pixel);\
-    \
-    assert(x<8 && y<8 && x>=0 && y>=0);\
-\
-    if(D){\
-        for(i=0; i<h; i++){\
-            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
-            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
-            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
-            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
-            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\
-            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\
-            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\
-            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\
-            dst+= stride;\
-            src+= stride;\
-        }\
-    } else if (B + C) {\
-        const int E= B+C;\
-        const int step= C ? stride : 1;\
-        for(i=0; i<h; i++){\
-            OP(dst[0], (A*src[0] + E*src[step+0]));\
-            OP(dst[1], (A*src[1] + E*src[step+1]));\
-            OP(dst[2], (A*src[2] + E*src[step+2]));\
-            OP(dst[3], (A*src[3] + E*src[step+3]));\
-            OP(dst[4], (A*src[4] + E*src[step+4]));\
-            OP(dst[5], (A*src[5] + E*src[step+5]));\
-            OP(dst[6], (A*src[6] + E*src[step+6]));\
-            OP(dst[7], (A*src[7] + E*src[step+7]));\
-            dst+= stride;\
-            src+= stride;\
-        }\
-    } else {\
-        for ( i = 0; i < h; i++){\
-            OP(dst[0], A * src[0]);\
-            OP(dst[1], A * src[1]);\
-            OP(dst[2], A * src[2]);\
-            OP(dst[3], A * src[3]);\
-            OP(dst[4], A * src[4]);\
-            OP(dst[5], A * src[5]);\
-            OP(dst[6], A * src[6]);\
-            OP(dst[7], A * src[7]);\
-            dst += stride;\
-            src += stride;\
-        }\
-    }\
-}
-
-#define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1)
-#define op_put(a, b) a = (((b) + 32)>>6)
-
-H264_CHROMA_MC(put_       , op_put)
-H264_CHROMA_MC(avg_       , op_avg)
-#undef op_avg
-#undef op_put
diff --git a/deps/libav/libavcodec/h264data.h b/deps/libav/libavcodec/h264data.h
deleted file mode 100644
index f90a267..0000000
--- a/deps/libav/libavcodec/h264data.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * H26L/H264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief
- *     H264 / AVC / MPEG4 part10 codec data table
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVCODEC_H264DATA_H
-#define AVCODEC_H264DATA_H
-
-#include <stdint.h>
-
-#include "libavutil/rational.h"
-#include "mpegvideo.h"
-#include "h264.h"
-
-static const uint8_t golomb_to_pict_type[5] = {
-    AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_I,
-    AV_PICTURE_TYPE_SP, AV_PICTURE_TYPE_SI
-};
-
-static const uint8_t golomb_to_intra4x4_cbp[48] = {
-    47, 31, 15, 0,  23, 27, 29, 30, 7,  11, 13, 14, 39, 43, 45, 46,
-    16, 3,  5,  10, 12, 19, 21, 26, 28, 35, 37, 42, 44, 1,  2,  4,
-    8,  17, 18, 20, 24, 6,  9,  22, 25, 32, 33, 34, 36, 40, 38, 41
-};
-
-static const uint8_t golomb_to_inter_cbp[48] = {
-    0,  16, 1,  2,  4,  8,  32, 3,  5,  10, 12, 15, 47, 7,  11, 13,
-    14, 6,  9,  31, 35, 37, 42, 44, 33, 34, 36, 40, 39, 43, 45, 46,
-    17, 18, 20, 24, 19, 21, 26, 28, 23, 27, 29, 30, 22, 25, 38, 41
-};
-
-static const uint8_t zigzag_scan[16] = {
-    0 + 0 * 4, 1 + 0 * 4, 0 + 1 * 4, 0 + 2 * 4,
-    1 + 1 * 4, 2 + 0 * 4, 3 + 0 * 4, 2 + 1 * 4,
-    1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4,
-    3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 4,
-};
-
-static const uint8_t chroma_dc_scan[4] = {
-    (0 + 0 * 2) * 16, (1 + 0 * 2) * 16,
-    (0 + 1 * 2) * 16, (1 + 1 * 2) * 16,
-};
-
-static const uint8_t chroma422_dc_scan[8] = {
-    (0 + 0 * 2) * 16, (0 + 1 * 2) * 16,
-    (1 + 0 * 2) * 16, (0 + 2 * 2) * 16,
-    (0 + 3 * 2) * 16, (1 + 1 * 2) * 16,
-    (1 + 2 * 2) * 16, (1 + 3 * 2) * 16,
-};
-
-typedef struct IMbInfo {
-    uint16_t type;
-    uint8_t pred_mode;
-    uint8_t cbp;
-} IMbInfo;
-
-static const IMbInfo i_mb_type_info[26] = {
-    { MB_TYPE_INTRA4x4,  -1,  -1 },
-    { MB_TYPE_INTRA16x16, 2,   0 },
-    { MB_TYPE_INTRA16x16, 1,   0 },
-    { MB_TYPE_INTRA16x16, 0,   0 },
-    { MB_TYPE_INTRA16x16, 3,   0 },
-    { MB_TYPE_INTRA16x16, 2,  16 },
-    { MB_TYPE_INTRA16x16, 1,  16 },
-    { MB_TYPE_INTRA16x16, 0,  16 },
-    { MB_TYPE_INTRA16x16, 3,  16 },
-    { MB_TYPE_INTRA16x16, 2,  32 },
-    { MB_TYPE_INTRA16x16, 1,  32 },
-    { MB_TYPE_INTRA16x16, 0,  32 },
-    { MB_TYPE_INTRA16x16, 3,  32 },
-    { MB_TYPE_INTRA16x16, 2,  15 +  0 },
-    { MB_TYPE_INTRA16x16, 1,  15 +  0 },
-    { MB_TYPE_INTRA16x16, 0,  15 +  0 },
-    { MB_TYPE_INTRA16x16, 3,  15 +  0 },
-    { MB_TYPE_INTRA16x16, 2,  15 + 16 },
-    { MB_TYPE_INTRA16x16, 1,  15 + 16 },
-    { MB_TYPE_INTRA16x16, 0,  15 + 16 },
-    { MB_TYPE_INTRA16x16, 3,  15 + 16 },
-    { MB_TYPE_INTRA16x16, 2,  15 + 32 },
-    { MB_TYPE_INTRA16x16, 1,  15 + 32 },
-    { MB_TYPE_INTRA16x16, 0,  15 + 32 },
-    { MB_TYPE_INTRA16x16, 3,  15 + 32 },
-    { MB_TYPE_INTRA_PCM,  -1, -1 },
-};
-
-typedef struct PMbInfo {
-    uint16_t type;
-    uint8_t partition_count;
-} PMbInfo;
-
-static const PMbInfo p_mb_type_info[5] = {
-    { MB_TYPE_16x16 | MB_TYPE_P0L0,                               1 },
-    { MB_TYPE_16x8  | MB_TYPE_P0L0 | MB_TYPE_P1L0,                2 },
-    { MB_TYPE_8x16  | MB_TYPE_P0L0 | MB_TYPE_P1L0,                2 },
-    { MB_TYPE_8x8   | MB_TYPE_P0L0 | MB_TYPE_P1L0,                4 },
-    { MB_TYPE_8x8   | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_REF0, 4 },
-};
-
-static const PMbInfo p_sub_mb_type_info[4] = {
-    { MB_TYPE_16x16 | MB_TYPE_P0L0, 1 },
-    { MB_TYPE_16x8  | MB_TYPE_P0L0, 2 },
-    { MB_TYPE_8x16  | MB_TYPE_P0L0, 2 },
-    { MB_TYPE_8x8   | MB_TYPE_P0L0, 4 },
-};
-
-static const PMbInfo b_mb_type_info[23] = {
-    { MB_TYPE_DIRECT2 | MB_TYPE_L0L1,                                              1, },
-    { MB_TYPE_16x16   | MB_TYPE_P0L0,                                              1, },
-    { MB_TYPE_16x16   | MB_TYPE_P0L1,                                              1, },
-    { MB_TYPE_16x16   | MB_TYPE_P0L0 | MB_TYPE_P0L1,                               1, },
-    { MB_TYPE_16x8    | MB_TYPE_P0L0 | MB_TYPE_P1L0,                               2, },
-    { MB_TYPE_8x16    | MB_TYPE_P0L0 | MB_TYPE_P1L0,                               2, },
-    { MB_TYPE_16x8    | MB_TYPE_P0L1 | MB_TYPE_P1L1,                               2, },
-    { MB_TYPE_8x16    | MB_TYPE_P0L1 | MB_TYPE_P1L1,                               2, },
-    { MB_TYPE_16x8    | MB_TYPE_P0L0 | MB_TYPE_P1L1,                               2, },
-    { MB_TYPE_8x16    | MB_TYPE_P0L0 | MB_TYPE_P1L1,                               2, },
-    { MB_TYPE_16x8    | MB_TYPE_P0L1 | MB_TYPE_P1L0,                               2, },
-    { MB_TYPE_8x16    | MB_TYPE_P0L1 | MB_TYPE_P1L0,                               2, },
-    { MB_TYPE_16x8    | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1,                2, },
-    { MB_TYPE_8x16    | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1,                2, },
-    { MB_TYPE_16x8    | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1,                2, },
-    { MB_TYPE_8x16    | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1,                2, },
-    { MB_TYPE_16x8    | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0,                2, },
-    { MB_TYPE_8x16    | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0,                2, },
-    { MB_TYPE_16x8    | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1,                2, },
-    { MB_TYPE_8x16    | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1,                2, },
-    { MB_TYPE_16x8    | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
-    { MB_TYPE_8x16    | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
-    { MB_TYPE_8x8     | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
-};
-
-static const PMbInfo b_sub_mb_type_info[13] = {
-    { MB_TYPE_DIRECT2,                                                           1, },
-    { MB_TYPE_16x16 | MB_TYPE_P0L0,                                              1, },
-    { MB_TYPE_16x16 | MB_TYPE_P0L1,                                              1, },
-    { MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1,                               1, },
-    { MB_TYPE_16x8  | MB_TYPE_P0L0 | MB_TYPE_P1L0,                               2, },
-    { MB_TYPE_8x16  | MB_TYPE_P0L0 | MB_TYPE_P1L0,                               2, },
-    { MB_TYPE_16x8  | MB_TYPE_P0L1 | MB_TYPE_P1L1,                               2, },
-    { MB_TYPE_8x16  | MB_TYPE_P0L1 | MB_TYPE_P1L1,                               2, },
-    { MB_TYPE_16x8  | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
-    { MB_TYPE_8x16  | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
-    { MB_TYPE_8x8   | MB_TYPE_P0L0 | MB_TYPE_P1L0,                               4, },
-    { MB_TYPE_8x8   | MB_TYPE_P0L1 | MB_TYPE_P1L1,                               4, },
-    { MB_TYPE_8x8   | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
-};
-
-#endif /* AVCODEC_H264DATA_H */
diff --git a/deps/libav/libavcodec/h264dsp.c b/deps/libav/libavcodec/h264dsp.c
deleted file mode 100644
index a5b1591..0000000
--- a/deps/libav/libavcodec/h264dsp.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 DSP functions.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "h264dsp.h"
-#include "h264idct.h"
-#include "libavutil/common.h"
-
-#define BIT_DEPTH 8
-#include "h264dsp_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 9
-#include "h264dsp_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "h264dsp_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 8
-#include "h264addpx_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 16
-#include "h264addpx_template.c"
-#undef BIT_DEPTH
-
-static int h264_find_start_code_candidate_c(const uint8_t *buf, int size)
-{
-    int i = 0;
-#if HAVE_FAST_UNALIGNED
-    /* we check i < size instead of i + 3 / 7 because it is
-     * simpler and there must be FF_INPUT_BUFFER_PADDING_SIZE
-     * bytes at the end.
-     */
-#if HAVE_FAST_64BIT
-    while (i < size &&
-            !((~*(const uint64_t *)(buf + i) &
-                    (*(const uint64_t *)(buf + i) - 0x0101010101010101ULL)) &
-                    0x8080808080808080ULL))
-        i += 8;
-#else
-    while (i < size &&
-            !((~*(const uint32_t *)(buf + i) &
-                    (*(const uint32_t *)(buf + i) - 0x01010101U)) &
-                    0x80808080U))
-        i += 4;
-#endif
-#endif
-    for (; i < size; i++)
-        if (!buf[i])
-            break;
-    return i;
-}
-
-av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
-                             const int chroma_format_idc)
-{
-#undef FUNC
-#define FUNC(a, depth) a ## _ ## depth ## _c
-
-#define ADDPX_DSP(depth) \
-    c->h264_add_pixels4_clear = FUNC(ff_h264_add_pixels4, depth);\
-    c->h264_add_pixels8_clear = FUNC(ff_h264_add_pixels8, depth)
-
-    if (bit_depth > 8 && bit_depth <= 16) {
-        ADDPX_DSP(16);
-    } else {
-        ADDPX_DSP(8);
-    }
-
-#define H264_DSP(depth) \
-    c->h264_idct_add= FUNC(ff_h264_idct_add, depth);\
-    c->h264_idct8_add= FUNC(ff_h264_idct8_add, depth);\
-    c->h264_idct_dc_add= FUNC(ff_h264_idct_dc_add, depth);\
-    c->h264_idct8_dc_add= FUNC(ff_h264_idct8_dc_add, depth);\
-    c->h264_idct_add16     = FUNC(ff_h264_idct_add16, depth);\
-    c->h264_idct8_add4     = FUNC(ff_h264_idct8_add4, depth);\
-    if (chroma_format_idc <= 1)\
-        c->h264_idct_add8  = FUNC(ff_h264_idct_add8, depth);\
-    else\
-        c->h264_idct_add8  = FUNC(ff_h264_idct_add8_422, depth);\
-    c->h264_idct_add16intra= FUNC(ff_h264_idct_add16intra, depth);\
-    c->h264_luma_dc_dequant_idct= FUNC(ff_h264_luma_dc_dequant_idct, depth);\
-    if (chroma_format_idc <= 1)\
-        c->h264_chroma_dc_dequant_idct= FUNC(ff_h264_chroma_dc_dequant_idct, depth);\
-    else\
-        c->h264_chroma_dc_dequant_idct= FUNC(ff_h264_chroma422_dc_dequant_idct, depth);\
-\
-    c->weight_h264_pixels_tab[0]= FUNC(weight_h264_pixels16, depth);\
-    c->weight_h264_pixels_tab[1]= FUNC(weight_h264_pixels8, depth);\
-    c->weight_h264_pixels_tab[2]= FUNC(weight_h264_pixels4, depth);\
-    c->weight_h264_pixels_tab[3]= FUNC(weight_h264_pixels2, depth);\
-    c->biweight_h264_pixels_tab[0]= FUNC(biweight_h264_pixels16, depth);\
-    c->biweight_h264_pixels_tab[1]= FUNC(biweight_h264_pixels8, depth);\
-    c->biweight_h264_pixels_tab[2]= FUNC(biweight_h264_pixels4, depth);\
-    c->biweight_h264_pixels_tab[3]= FUNC(biweight_h264_pixels2, depth);\
-\
-    c->h264_v_loop_filter_luma= FUNC(h264_v_loop_filter_luma, depth);\
-    c->h264_h_loop_filter_luma= FUNC(h264_h_loop_filter_luma, depth);\
-    c->h264_h_loop_filter_luma_mbaff= FUNC(h264_h_loop_filter_luma_mbaff, depth);\
-    c->h264_v_loop_filter_luma_intra= FUNC(h264_v_loop_filter_luma_intra, depth);\
-    c->h264_h_loop_filter_luma_intra= FUNC(h264_h_loop_filter_luma_intra, depth);\
-    c->h264_h_loop_filter_luma_mbaff_intra= FUNC(h264_h_loop_filter_luma_mbaff_intra, depth);\
-    c->h264_v_loop_filter_chroma= FUNC(h264_v_loop_filter_chroma, depth);\
-    if (chroma_format_idc <= 1)\
-        c->h264_h_loop_filter_chroma= FUNC(h264_h_loop_filter_chroma, depth);\
-    else\
-        c->h264_h_loop_filter_chroma= FUNC(h264_h_loop_filter_chroma422, depth);\
-    if (chroma_format_idc <= 1)\
-        c->h264_h_loop_filter_chroma_mbaff= FUNC(h264_h_loop_filter_chroma_mbaff, depth);\
-    else\
-        c->h264_h_loop_filter_chroma_mbaff= FUNC(h264_h_loop_filter_chroma422_mbaff, depth);\
-    c->h264_v_loop_filter_chroma_intra= FUNC(h264_v_loop_filter_chroma_intra, depth);\
-    if (chroma_format_idc <= 1)\
-        c->h264_h_loop_filter_chroma_intra= FUNC(h264_h_loop_filter_chroma_intra, depth);\
-    else\
-        c->h264_h_loop_filter_chroma_intra= FUNC(h264_h_loop_filter_chroma422_intra, depth);\
-    if (chroma_format_idc <= 1)\
-        c->h264_h_loop_filter_chroma_mbaff_intra= FUNC(h264_h_loop_filter_chroma_mbaff_intra, depth);\
-    else\
-        c->h264_h_loop_filter_chroma_mbaff_intra= FUNC(h264_h_loop_filter_chroma422_mbaff_intra, depth);\
-    c->h264_loop_filter_strength= NULL;
-
-    switch (bit_depth) {
-    case 9:
-        H264_DSP(9);
-        break;
-    case 10:
-        H264_DSP(10);
-        break;
-    default:
-        H264_DSP(8);
-        break;
-    }
-    c->h264_find_start_code_candidate = h264_find_start_code_candidate_c;
-
-    if (ARCH_AARCH64) ff_h264dsp_init_aarch64(c, bit_depth, chroma_format_idc);
-    if (ARCH_ARM) ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc);
-    if (ARCH_PPC) ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc);
-    if (ARCH_X86) ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc);
-}
diff --git a/deps/libav/libavcodec/h264dsp.h b/deps/libav/libavcodec/h264dsp.h
deleted file mode 100644
index 9c41336..0000000
--- a/deps/libav/libavcodec/h264dsp.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2003-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 DSP functions.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVCODEC_H264DSP_H
-#define AVCODEC_H264DSP_H
-
-#include <stdint.h>
-
-typedef void (*h264_weight_func)(uint8_t *block, int stride, int height,
-                                 int log2_denom, int weight, int offset);
-typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src,
-                                   int stride, int height, int log2_denom,
-                                   int weightd, int weights, int offset);
-
-/**
- * Context for storing H.264 DSP functions
- */
-typedef struct H264DSPContext {
-    /* weighted MC */
-    h264_weight_func weight_h264_pixels_tab[4];
-    h264_biweight_func biweight_h264_pixels_tab[4];
-
-    /* loop filter */
-    void (*h264_v_loop_filter_luma)(uint8_t *pix /*align 16*/, int stride,
-                                    int alpha, int beta, int8_t *tc0);
-    void (*h264_h_loop_filter_luma)(uint8_t *pix /*align 4 */, int stride,
-                                    int alpha, int beta, int8_t *tc0);
-    void (*h264_h_loop_filter_luma_mbaff)(uint8_t *pix /*align 16*/, int stride,
-                                          int alpha, int beta, int8_t *tc0);
-    /* v/h_loop_filter_luma_intra: align 16 */
-    void (*h264_v_loop_filter_luma_intra)(uint8_t *pix, int stride,
-                                          int alpha, int beta);
-    void (*h264_h_loop_filter_luma_intra)(uint8_t *pix, int stride,
-                                          int alpha, int beta);
-    void (*h264_h_loop_filter_luma_mbaff_intra)(uint8_t *pix /*align 16*/,
-                                                int stride, int alpha, int beta);
-    void (*h264_v_loop_filter_chroma)(uint8_t *pix /*align 8*/, int stride,
-                                      int alpha, int beta, int8_t *tc0);
-    void (*h264_h_loop_filter_chroma)(uint8_t *pix /*align 4*/, int stride,
-                                      int alpha, int beta, int8_t *tc0);
-    void (*h264_h_loop_filter_chroma_mbaff)(uint8_t *pix /*align 8*/,
-                                            int stride, int alpha, int beta,
-                                            int8_t *tc0);
-    void (*h264_v_loop_filter_chroma_intra)(uint8_t *pix /*align 8*/,
-                                            int stride, int alpha, int beta);
-    void (*h264_h_loop_filter_chroma_intra)(uint8_t *pix /*align 8*/,
-                                            int stride, int alpha, int beta);
-    void (*h264_h_loop_filter_chroma_mbaff_intra)(uint8_t *pix /*align 8*/,
-                                                  int stride, int alpha, int beta);
-    // h264_loop_filter_strength: simd only. the C version is inlined in h264.c
-    void (*h264_loop_filter_strength)(int16_t bS[2][4][4], uint8_t nnz[40],
-                                      int8_t ref[2][40], int16_t mv[2][40][2],
-                                      int bidir, int edges, int step,
-                                      int mask_mv0, int mask_mv1, int field);
-
-    /* IDCT */
-    void (*h264_idct_add)(uint8_t *dst /*align 4*/,
-                          int16_t *block /*align 16*/, int stride);
-    void (*h264_idct8_add)(uint8_t *dst /*align 8*/,
-                           int16_t *block /*align 16*/, int stride);
-    void (*h264_idct_dc_add)(uint8_t *dst /*align 4*/,
-                             int16_t *block /*align 16*/, int stride);
-    void (*h264_idct8_dc_add)(uint8_t *dst /*align 8*/,
-                              int16_t *block /*align 16*/, int stride);
-
-    void (*h264_idct_add16)(uint8_t *dst /*align 16*/, const int *blockoffset,
-                            int16_t *block /*align 16*/, int stride,
-                            const uint8_t nnzc[15 * 8]);
-    void (*h264_idct8_add4)(uint8_t *dst /*align 16*/, const int *blockoffset,
-                            int16_t *block /*align 16*/, int stride,
-                            const uint8_t nnzc[15 * 8]);
-    void (*h264_idct_add8)(uint8_t **dst /*align 16*/, const int *blockoffset,
-                           int16_t *block /*align 16*/, int stride,
-                           const uint8_t nnzc[15 * 8]);
-    void (*h264_idct_add16intra)(uint8_t *dst /*align 16*/, const int *blockoffset,
-                                 int16_t *block /*align 16*/,
-                                 int stride, const uint8_t nnzc[15 * 8]);
-    void (*h264_luma_dc_dequant_idct)(int16_t *output,
-                                      int16_t *input /*align 16*/, int qmul);
-    void (*h264_chroma_dc_dequant_idct)(int16_t *block, int qmul);
-
-    /* bypass-transform */
-    void (*h264_add_pixels8_clear)(uint8_t *dst, int16_t *block, int stride);
-    void (*h264_add_pixels4_clear)(uint8_t *dst, int16_t *block, int stride);
-
-    /**
-     * Search buf from the start for up to size bytes. Return the index
-     * of a zero byte, or >= size if not found. Ideally, use lookahead
-     * to filter out any zero bytes that are known to not be followed by
-     * one or more further zero bytes and a one byte. Better still, filter
-     * out any bytes that form the trailing_zero_8bits syntax element too.
-     */
-    int (*h264_find_start_code_candidate)(const uint8_t *buf, int size);
-} H264DSPContext;
-
-void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
-                     const int chroma_format_idc);
-void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
-                             const int chroma_format_idc);
-void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
-                         const int chroma_format_idc);
-void ff_h264dsp_init_ppc(H264DSPContext *c, const int bit_depth,
-                         const int chroma_format_idc);
-void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
-                         const int chroma_format_idc);
-
-#endif /* AVCODEC_H264DSP_H */
diff --git a/deps/libav/libavcodec/h264dsp_template.c b/deps/libav/libavcodec/h264dsp_template.c
deleted file mode 100644
index 3d99cfc..0000000
--- a/deps/libav/libavcodec/h264dsp_template.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 DSP functions.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "bit_depth_template.c"
-
-#define op_scale1(x)  block[x] = av_clip_pixel( (block[x]*weight + offset) >> log2_denom )
-#define op_scale2(x)  dst[x] = av_clip_pixel( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1))
-#define H264_WEIGHT(W) \
-static void FUNCC(weight_h264_pixels ## W)(uint8_t *_block, int stride, int height, \
-                                           int log2_denom, int weight, int offset) \
-{ \
-    int y; \
-    pixel *block = (pixel*)_block; \
-    stride /= sizeof(pixel); \
-    offset <<= (log2_denom + (BIT_DEPTH-8)); \
-    if(log2_denom) offset += 1<<(log2_denom-1); \
-    for (y = 0; y < height; y++, block += stride) { \
-        op_scale1(0); \
-        op_scale1(1); \
-        if(W==2) continue; \
-        op_scale1(2); \
-        op_scale1(3); \
-        if(W==4) continue; \
-        op_scale1(4); \
-        op_scale1(5); \
-        op_scale1(6); \
-        op_scale1(7); \
-        if(W==8) continue; \
-        op_scale1(8); \
-        op_scale1(9); \
-        op_scale1(10); \
-        op_scale1(11); \
-        op_scale1(12); \
-        op_scale1(13); \
-        op_scale1(14); \
-        op_scale1(15); \
-    } \
-} \
-static void FUNCC(biweight_h264_pixels ## W)(uint8_t *_dst, uint8_t *_src, int stride, int height, \
-                                             int log2_denom, int weightd, int weights, int offset) \
-{ \
-    int y; \
-    pixel *dst = (pixel*)_dst; \
-    pixel *src = (pixel*)_src; \
-    stride /= sizeof(pixel); \
-    offset <<= (BIT_DEPTH-8); \
-    offset = ((offset + 1) | 1) << log2_denom; \
-    for (y = 0; y < height; y++, dst += stride, src += stride) { \
-        op_scale2(0); \
-        op_scale2(1); \
-        if(W==2) continue; \
-        op_scale2(2); \
-        op_scale2(3); \
-        if(W==4) continue; \
-        op_scale2(4); \
-        op_scale2(5); \
-        op_scale2(6); \
-        op_scale2(7); \
-        if(W==8) continue; \
-        op_scale2(8); \
-        op_scale2(9); \
-        op_scale2(10); \
-        op_scale2(11); \
-        op_scale2(12); \
-        op_scale2(13); \
-        op_scale2(14); \
-        op_scale2(15); \
-    } \
-}
-
-H264_WEIGHT(16)
-H264_WEIGHT(8)
-H264_WEIGHT(4)
-H264_WEIGHT(2)
-
-#undef op_scale1
-#undef op_scale2
-#undef H264_WEIGHT
-
-static av_always_inline av_flatten void FUNCC(h264_loop_filter_luma)(uint8_t *_pix, int xstride, int ystride, int inner_iters, int alpha, int beta, int8_t *tc0)
-{
-    pixel *pix = (pixel*)_pix;
-    int i, d;
-    xstride /= sizeof(pixel);
-    ystride /= sizeof(pixel);
-    alpha <<= BIT_DEPTH - 8;
-    beta  <<= BIT_DEPTH - 8;
-    for( i = 0; i < 4; i++ ) {
-        const int tc_orig = tc0[i] << (BIT_DEPTH - 8);
-        if( tc_orig < 0 ) {
-            pix += inner_iters*ystride;
-            continue;
-        }
-        for( d = 0; d < inner_iters; d++ ) {
-            const int p0 = pix[-1*xstride];
-            const int p1 = pix[-2*xstride];
-            const int p2 = pix[-3*xstride];
-            const int q0 = pix[0];
-            const int q1 = pix[1*xstride];
-            const int q2 = pix[2*xstride];
-
-            if( FFABS( p0 - q0 ) < alpha &&
-                FFABS( p1 - p0 ) < beta &&
-                FFABS( q1 - q0 ) < beta ) {
-
-                int tc = tc_orig;
-                int i_delta;
-
-                if( FFABS( p2 - p0 ) < beta ) {
-                    if(tc_orig)
-                    pix[-2*xstride] = p1 + av_clip( (( p2 + ( ( p0 + q0 + 1 ) >> 1 ) ) >> 1) - p1, -tc_orig, tc_orig );
-                    tc++;
-                }
-                if( FFABS( q2 - q0 ) < beta ) {
-                    if(tc_orig)
-                    pix[   xstride] = q1 + av_clip( (( q2 + ( ( p0 + q0 + 1 ) >> 1 ) ) >> 1) - q1, -tc_orig, tc_orig );
-                    tc++;
-                }
-
-                i_delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
-                pix[-xstride] = av_clip_pixel( p0 + i_delta );    /* p0' */
-                pix[0]        = av_clip_pixel( q0 - i_delta );    /* q0' */
-            }
-            pix += ystride;
-        }
-    }
-}
-static void FUNCC(h264_v_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
-    FUNCC(h264_loop_filter_luma)(pix, stride, sizeof(pixel), 4, alpha, beta, tc0);
-}
-static void FUNCC(h264_h_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
-    FUNCC(h264_loop_filter_luma)(pix, sizeof(pixel), stride, 4, alpha, beta, tc0);
-}
-static void FUNCC(h264_h_loop_filter_luma_mbaff)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
-    FUNCC(h264_loop_filter_luma)(pix, sizeof(pixel), stride, 2, alpha, beta, tc0);
-}
-
-static av_always_inline av_flatten void FUNCC(h264_loop_filter_luma_intra)(uint8_t *_pix, int xstride, int ystride, int inner_iters, int alpha, int beta)
-{
-    pixel *pix = (pixel*)_pix;
-    int d;
-    xstride /= sizeof(pixel);
-    ystride /= sizeof(pixel);
-    alpha <<= BIT_DEPTH - 8;
-    beta  <<= BIT_DEPTH - 8;
-    for( d = 0; d < 4 * inner_iters; d++ ) {
-        const int p2 = pix[-3*xstride];
-        const int p1 = pix[-2*xstride];
-        const int p0 = pix[-1*xstride];
-
-        const int q0 = pix[ 0*xstride];
-        const int q1 = pix[ 1*xstride];
-        const int q2 = pix[ 2*xstride];
-
-        if( FFABS( p0 - q0 ) < alpha &&
-            FFABS( p1 - p0 ) < beta &&
-            FFABS( q1 - q0 ) < beta ) {
-
-            if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){
-                if( FFABS( p2 - p0 ) < beta)
-                {
-                    const int p3 = pix[-4*xstride];
-                    /* p0', p1', p2' */
-                    pix[-1*xstride] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3;
-                    pix[-2*xstride] = ( p2 + p1 + p0 + q0 + 2 ) >> 2;
-                    pix[-3*xstride] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3;
-                } else {
-                    /* p0' */
-                    pix[-1*xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
-                }
-                if( FFABS( q2 - q0 ) < beta)
-                {
-                    const int q3 = pix[3*xstride];
-                    /* q0', q1', q2' */
-                    pix[0*xstride] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3;
-                    pix[1*xstride] = ( p0 + q0 + q1 + q2 + 2 ) >> 2;
-                    pix[2*xstride] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3;
-                } else {
-                    /* q0' */
-                    pix[0*xstride] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
-                }
-            }else{
-                /* p0', q0' */
-                pix[-1*xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
-                pix[ 0*xstride] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
-            }
-        }
-        pix += ystride;
-    }
-}
-static void FUNCC(h264_v_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta)
-{
-    FUNCC(h264_loop_filter_luma_intra)(pix, stride, sizeof(pixel), 4, alpha, beta);
-}
-static void FUNCC(h264_h_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta)
-{
-    FUNCC(h264_loop_filter_luma_intra)(pix, sizeof(pixel), stride, 4, alpha, beta);
-}
-static void FUNCC(h264_h_loop_filter_luma_mbaff_intra)(uint8_t *pix, int stride, int alpha, int beta)
-{
-    FUNCC(h264_loop_filter_luma_intra)(pix, sizeof(pixel), stride, 2, alpha, beta);
-}
-
-static av_always_inline av_flatten void FUNCC(h264_loop_filter_chroma)(uint8_t *_pix, int xstride, int ystride, int inner_iters, int alpha, int beta, int8_t *tc0)
-{
-    pixel *pix = (pixel*)_pix;
-    int i, d;
-    xstride /= sizeof(pixel);
-    ystride /= sizeof(pixel);
-    alpha <<= BIT_DEPTH - 8;
-    beta  <<= BIT_DEPTH - 8;
-    for( i = 0; i < 4; i++ ) {
-        const int tc = ((tc0[i] - 1) << (BIT_DEPTH - 8)) + 1;
-        if( tc <= 0 ) {
-            pix += inner_iters*ystride;
-            continue;
-        }
-        for( d = 0; d < inner_iters; d++ ) {
-            const int p0 = pix[-1*xstride];
-            const int p1 = pix[-2*xstride];
-            const int q0 = pix[0];
-            const int q1 = pix[1*xstride];
-
-            if( FFABS( p0 - q0 ) < alpha &&
-                FFABS( p1 - p0 ) < beta &&
-                FFABS( q1 - q0 ) < beta ) {
-
-                int delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
-
-                pix[-xstride] = av_clip_pixel( p0 + delta );    /* p0' */
-                pix[0]        = av_clip_pixel( q0 - delta );    /* q0' */
-            }
-            pix += ystride;
-        }
-    }
-}
-static void FUNCC(h264_v_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
-    FUNCC(h264_loop_filter_chroma)(pix, stride, sizeof(pixel), 2, alpha, beta, tc0);
-}
-static void FUNCC(h264_h_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
-    FUNCC(h264_loop_filter_chroma)(pix, sizeof(pixel), stride, 2, alpha, beta, tc0);
-}
-static void FUNCC(h264_h_loop_filter_chroma_mbaff)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
-    FUNCC(h264_loop_filter_chroma)(pix, sizeof(pixel), stride, 1, alpha, beta, tc0);
-}
-static void FUNCC(h264_h_loop_filter_chroma422)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
-    FUNCC(h264_loop_filter_chroma)(pix, sizeof(pixel), stride, 4, alpha, beta, tc0);
-}
-static void FUNCC(h264_h_loop_filter_chroma422_mbaff)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
-    FUNCC(h264_loop_filter_chroma)(pix, sizeof(pixel), stride, 2, alpha, beta, tc0);
-}
-
-static av_always_inline av_flatten void FUNCC(h264_loop_filter_chroma_intra)(uint8_t *_pix, int xstride, int ystride, int inner_iters, int alpha, int beta)
-{
-    pixel *pix = (pixel*)_pix;
-    int d;
-    xstride /= sizeof(pixel);
-    ystride /= sizeof(pixel);
-    alpha <<= BIT_DEPTH - 8;
-    beta  <<= BIT_DEPTH - 8;
-    for( d = 0; d < 4 * inner_iters; d++ ) {
-        const int p0 = pix[-1*xstride];
-        const int p1 = pix[-2*xstride];
-        const int q0 = pix[0];
-        const int q1 = pix[1*xstride];
-
-        if( FFABS( p0 - q0 ) < alpha &&
-            FFABS( p1 - p0 ) < beta &&
-            FFABS( q1 - q0 ) < beta ) {
-
-            pix[-xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2;   /* p0' */
-            pix[0]        = ( 2*q1 + q0 + p1 + 2 ) >> 2;   /* q0' */
-        }
-        pix += ystride;
-    }
-}
-static void FUNCC(h264_v_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta)
-{
-    FUNCC(h264_loop_filter_chroma_intra)(pix, stride, sizeof(pixel), 2, alpha, beta);
-}
-static void FUNCC(h264_h_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta)
-{
-    FUNCC(h264_loop_filter_chroma_intra)(pix, sizeof(pixel), stride, 2, alpha, beta);
-}
-static void FUNCC(h264_h_loop_filter_chroma_mbaff_intra)(uint8_t *pix, int stride, int alpha, int beta)
-{
-    FUNCC(h264_loop_filter_chroma_intra)(pix, sizeof(pixel), stride, 1, alpha, beta);
-}
-static void FUNCC(h264_h_loop_filter_chroma422_intra)(uint8_t *pix, int stride, int alpha, int beta)
-{
-    FUNCC(h264_loop_filter_chroma_intra)(pix, sizeof(pixel), stride, 4, alpha, beta);
-}
-static void FUNCC(h264_h_loop_filter_chroma422_mbaff_intra)(uint8_t *pix, int stride, int alpha, int beta)
-{
-    FUNCC(h264_loop_filter_chroma_intra)(pix, sizeof(pixel), stride, 2, alpha, beta);
-}
diff --git a/deps/libav/libavcodec/h264idct.c b/deps/libav/libavcodec/h264idct.c
deleted file mode 100644
index ea08d03..0000000
--- a/deps/libav/libavcodec/h264idct.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * H.264 IDCT
- * Copyright (c) 2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 IDCT.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "h264idct.h"
-
-#define BIT_DEPTH 8
-#include "h264idct_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 9
-#include "h264idct_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "h264idct_template.c"
-#undef BIT_DEPTH
diff --git a/deps/libav/libavcodec/h264idct.h b/deps/libav/libavcodec/h264idct.h
deleted file mode 100644
index 816a825..0000000
--- a/deps/libav/libavcodec/h264idct.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_H264IDCT_H
-#define AVCODEC_H264IDCT_H
-
-#include <stdint.h>
-
-#define H264_IDCT(depth) \
-void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
-void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
-void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
-void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
-void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
-void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
-void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
-void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
-void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
-void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(int16_t *output, int16_t *input, int qmul);\
-void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul);\
-void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul);
-
-H264_IDCT( 8)
-H264_IDCT( 9)
-H264_IDCT(10)
-
-#endif /* AVCODEC_H264IDCT_H */
diff --git a/deps/libav/libavcodec/h264idct_template.c b/deps/libav/libavcodec/h264idct_template.c
deleted file mode 100644
index aadafad..0000000
--- a/deps/libav/libavcodec/h264idct_template.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * H.264 IDCT
- * Copyright (c) 2004-2011 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 IDCT.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "bit_depth_template.c"
-#include "libavutil/common.h"
-#include "h264.h"
-
-void FUNCC(ff_h264_idct_add)(uint8_t *_dst, int16_t *_block, int stride)
-{
-    int i;
-    pixel *dst = (pixel*)_dst;
-    dctcoef *block = (dctcoef*)_block;
-    stride /= sizeof(pixel);
-
-    block[0] += 1 << 5;
-
-    for(i=0; i<4; i++){
-        const int z0=  block[i + 4*0]     +  block[i + 4*2];
-        const int z1=  block[i + 4*0]     -  block[i + 4*2];
-        const int z2= (block[i + 4*1]>>1) -  block[i + 4*3];
-        const int z3=  block[i + 4*1]     + (block[i + 4*3]>>1);
-
-        block[i + 4*0]= z0 + z3;
-        block[i + 4*1]= z1 + z2;
-        block[i + 4*2]= z1 - z2;
-        block[i + 4*3]= z0 - z3;
-    }
-
-    for(i=0; i<4; i++){
-        const int z0=  block[0 + 4*i]     +  block[2 + 4*i];
-        const int z1=  block[0 + 4*i]     -  block[2 + 4*i];
-        const int z2= (block[1 + 4*i]>>1) -  block[3 + 4*i];
-        const int z3=  block[1 + 4*i]     + (block[3 + 4*i]>>1);
-
-        dst[i + 0*stride]= av_clip_pixel(dst[i + 0*stride] + ((z0 + z3) >> 6));
-        dst[i + 1*stride]= av_clip_pixel(dst[i + 1*stride] + ((z1 + z2) >> 6));
-        dst[i + 2*stride]= av_clip_pixel(dst[i + 2*stride] + ((z1 - z2) >> 6));
-        dst[i + 3*stride]= av_clip_pixel(dst[i + 3*stride] + ((z0 - z3) >> 6));
-    }
-
-    memset(block, 0, 16 * sizeof(dctcoef));
-}
-
-void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, int16_t *_block, int stride){
-    int i;
-    pixel *dst = (pixel*)_dst;
-    dctcoef *block = (dctcoef*)_block;
-    stride /= sizeof(pixel);
-
-    block[0] += 32;
-
-    for( i = 0; i < 8; i++ )
-    {
-        const int a0 =  block[i+0*8] + block[i+4*8];
-        const int a2 =  block[i+0*8] - block[i+4*8];
-        const int a4 = (block[i+2*8]>>1) - block[i+6*8];
-        const int a6 = (block[i+6*8]>>1) + block[i+2*8];
-
-        const int b0 = a0 + a6;
-        const int b2 = a2 + a4;
-        const int b4 = a2 - a4;
-        const int b6 = a0 - a6;
-
-        const int a1 = -block[i+3*8] + block[i+5*8] - block[i+7*8] - (block[i+7*8]>>1);
-        const int a3 =  block[i+1*8] + block[i+7*8] - block[i+3*8] - (block[i+3*8]>>1);
-        const int a5 = -block[i+1*8] + block[i+7*8] + block[i+5*8] + (block[i+5*8]>>1);
-        const int a7 =  block[i+3*8] + block[i+5*8] + block[i+1*8] + (block[i+1*8]>>1);
-
-        const int b1 = (a7>>2) + a1;
-        const int b3 =  a3 + (a5>>2);
-        const int b5 = (a3>>2) - a5;
-        const int b7 =  a7 - (a1>>2);
-
-        block[i+0*8] = b0 + b7;
-        block[i+7*8] = b0 - b7;
-        block[i+1*8] = b2 + b5;
-        block[i+6*8] = b2 - b5;
-        block[i+2*8] = b4 + b3;
-        block[i+5*8] = b4 - b3;
-        block[i+3*8] = b6 + b1;
-        block[i+4*8] = b6 - b1;
-    }
-    for( i = 0; i < 8; i++ )
-    {
-        const int a0 =  block[0+i*8] + block[4+i*8];
-        const int a2 =  block[0+i*8] - block[4+i*8];
-        const int a4 = (block[2+i*8]>>1) - block[6+i*8];
-        const int a6 = (block[6+i*8]>>1) + block[2+i*8];
-
-        const int b0 = a0 + a6;
-        const int b2 = a2 + a4;
-        const int b4 = a2 - a4;
-        const int b6 = a0 - a6;
-
-        const int a1 = -block[3+i*8] + block[5+i*8] - block[7+i*8] - (block[7+i*8]>>1);
-        const int a3 =  block[1+i*8] + block[7+i*8] - block[3+i*8] - (block[3+i*8]>>1);
-        const int a5 = -block[1+i*8] + block[7+i*8] + block[5+i*8] + (block[5+i*8]>>1);
-        const int a7 =  block[3+i*8] + block[5+i*8] + block[1+i*8] + (block[1+i*8]>>1);
-
-        const int b1 = (a7>>2) + a1;
-        const int b3 =  a3 + (a5>>2);
-        const int b5 = (a3>>2) - a5;
-        const int b7 =  a7 - (a1>>2);
-
-        dst[i + 0*stride] = av_clip_pixel( dst[i + 0*stride] + ((b0 + b7) >> 6) );
-        dst[i + 1*stride] = av_clip_pixel( dst[i + 1*stride] + ((b2 + b5) >> 6) );
-        dst[i + 2*stride] = av_clip_pixel( dst[i + 2*stride] + ((b4 + b3) >> 6) );
-        dst[i + 3*stride] = av_clip_pixel( dst[i + 3*stride] + ((b6 + b1) >> 6) );
-        dst[i + 4*stride] = av_clip_pixel( dst[i + 4*stride] + ((b6 - b1) >> 6) );
-        dst[i + 5*stride] = av_clip_pixel( dst[i + 5*stride] + ((b4 - b3) >> 6) );
-        dst[i + 6*stride] = av_clip_pixel( dst[i + 6*stride] + ((b2 - b5) >> 6) );
-        dst[i + 7*stride] = av_clip_pixel( dst[i + 7*stride] + ((b0 - b7) >> 6) );
-    }
-
-    memset(block, 0, 64 * sizeof(dctcoef));
-}
-
-// assumes all AC coefs are 0
-void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, int16_t *_block, int stride){
-    int i, j;
-    pixel *dst = (pixel*)_dst;
-    dctcoef *block = (dctcoef*)_block;
-    int dc = (block[0] + 32) >> 6;
-    stride /= sizeof(pixel);
-    block[0] = 0;
-    for( j = 0; j < 4; j++ )
-    {
-        for( i = 0; i < 4; i++ )
-            dst[i] = av_clip_pixel( dst[i] + dc );
-        dst += stride;
-    }
-}
-
-void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_dst, int16_t *_block, int stride){
-    int i, j;
-    pixel *dst = (pixel*)_dst;
-    dctcoef *block = (dctcoef*)_block;
-    int dc = (block[0] + 32) >> 6;
-    block[0] = 0;
-    stride /= sizeof(pixel);
-    for( j = 0; j < 8; j++ )
-    {
-        for( i = 0; i < 8; i++ )
-            dst[i] = av_clip_pixel( dst[i] + dc );
-        dst += stride;
-    }
-}
-
-void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
-    int i;
-    for(i=0; i<16; i++){
-        int nnz = nnzc[ scan8[i] ];
-        if(nnz){
-            if(nnz==1 && ((dctcoef*)block)[i*16]) FUNCC(ff_h264_idct_dc_add)(dst + block_offset[i], block + i*16*sizeof(pixel), stride);
-            else                                  FUNCC(ff_h264_idct_add   )(dst + block_offset[i], block + i*16*sizeof(pixel), stride);
-        }
-    }
-}
-
-void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
-    int i;
-    for(i=0; i<16; i++){
-        if(nnzc[ scan8[i] ])             FUNCC(ff_h264_idct_add   )(dst + block_offset[i], block + i*16*sizeof(pixel), stride);
-        else if(((dctcoef*)block)[i*16]) FUNCC(ff_h264_idct_dc_add)(dst + block_offset[i], block + i*16*sizeof(pixel), stride);
-    }
-}
-
-void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
-    int i;
-    for(i=0; i<16; i+=4){
-        int nnz = nnzc[ scan8[i] ];
-        if(nnz){
-            if(nnz==1 && ((dctcoef*)block)[i*16]) FUNCC(ff_h264_idct8_dc_add)(dst + block_offset[i], block + i*16*sizeof(pixel), stride);
-            else                                  FUNCC(ff_h264_idct8_add   )(dst + block_offset[i], block + i*16*sizeof(pixel), stride);
-        }
-    }
-}
-
-void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
-    int i, j;
-    for(j=1; j<3; j++){
-        for(i=j*16; i<j*16+4; i++){
-            if(nnzc[ scan8[i] ])
-                FUNCC(ff_h264_idct_add   )(dest[j-1] + block_offset[i], block + i*16*sizeof(pixel), stride);
-            else if(((dctcoef*)block)[i*16])
-                FUNCC(ff_h264_idct_dc_add)(dest[j-1] + block_offset[i], block + i*16*sizeof(pixel), stride);
-        }
-    }
-}
-
-void FUNCC(ff_h264_idct_add8_422)(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
-    int i, j;
-
-    for(j=1; j<3; j++){
-        for(i=j*16; i<j*16+4; i++){
-            if(nnzc[ scan8[i] ])
-                FUNCC(ff_h264_idct_add   )(dest[j-1] + block_offset[i], block + i*16*sizeof(pixel), stride);
-            else if(((dctcoef*)block)[i*16])
-                FUNCC(ff_h264_idct_dc_add)(dest[j-1] + block_offset[i], block + i*16*sizeof(pixel), stride);
-        }
-    }
-
-    for(j=1; j<3; j++){
-        for(i=j*16+4; i<j*16+8; i++){
-            if(nnzc[ scan8[i+4] ])
-                FUNCC(ff_h264_idct_add   )(dest[j-1] + block_offset[i+4], block + i*16*sizeof(pixel), stride);
-            else if(((dctcoef*)block)[i*16])
-                FUNCC(ff_h264_idct_dc_add)(dest[j-1] + block_offset[i+4], block + i*16*sizeof(pixel), stride);
-        }
-    }
-}
-
-/**
- * IDCT transforms the 16 dc values and dequantizes them.
- * @param qmul quantization parameter
- */
-void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, int16_t *_input, int qmul){
-#define stride 16
-    int i;
-    int temp[16];
-    static const uint8_t x_offset[4]={0, 2*stride, 8*stride, 10*stride};
-    dctcoef *input = (dctcoef*)_input;
-    dctcoef *output = (dctcoef*)_output;
-
-    for(i=0; i<4; i++){
-        const int z0= input[4*i+0] + input[4*i+1];
-        const int z1= input[4*i+0] - input[4*i+1];
-        const int z2= input[4*i+2] - input[4*i+3];
-        const int z3= input[4*i+2] + input[4*i+3];
-
-        temp[4*i+0]= z0+z3;
-        temp[4*i+1]= z0-z3;
-        temp[4*i+2]= z1-z2;
-        temp[4*i+3]= z1+z2;
-    }
-
-    for(i=0; i<4; i++){
-        const int offset= x_offset[i];
-        const int z0= temp[4*0+i] + temp[4*2+i];
-        const int z1= temp[4*0+i] - temp[4*2+i];
-        const int z2= temp[4*1+i] - temp[4*3+i];
-        const int z3= temp[4*1+i] + temp[4*3+i];
-
-        output[stride* 0+offset]= ((((z0 + z3)*qmul + 128 ) >> 8));
-        output[stride* 1+offset]= ((((z1 + z2)*qmul + 128 ) >> 8));
-        output[stride* 4+offset]= ((((z1 - z2)*qmul + 128 ) >> 8));
-        output[stride* 5+offset]= ((((z0 - z3)*qmul + 128 ) >> 8));
-    }
-#undef stride
-}
-
-void FUNCC(ff_h264_chroma422_dc_dequant_idct)(int16_t *_block, int qmul){
-    const int stride= 16*2;
-    const int xStride= 16;
-    int i;
-    int temp[8];
-    static const uint8_t x_offset[2]={0, 16};
-    dctcoef *block = (dctcoef*)_block;
-
-    for(i=0; i<4; i++){
-        temp[2*i+0] = block[stride*i + xStride*0] + block[stride*i + xStride*1];
-        temp[2*i+1] = block[stride*i + xStride*0] - block[stride*i + xStride*1];
-    }
-
-    for(i=0; i<2; i++){
-        const int offset= x_offset[i];
-        const int z0= temp[2*0+i] + temp[2*2+i];
-        const int z1= temp[2*0+i] - temp[2*2+i];
-        const int z2= temp[2*1+i] - temp[2*3+i];
-        const int z3= temp[2*1+i] + temp[2*3+i];
-
-        block[stride*0+offset]= ((z0 + z3)*qmul + 128) >> 8;
-        block[stride*1+offset]= ((z1 + z2)*qmul + 128) >> 8;
-        block[stride*2+offset]= ((z1 - z2)*qmul + 128) >> 8;
-        block[stride*3+offset]= ((z0 - z3)*qmul + 128) >> 8;
-    }
-}
-
-void FUNCC(ff_h264_chroma_dc_dequant_idct)(int16_t *_block, int qmul){
-    const int stride= 16*2;
-    const int xStride= 16;
-    int a,b,c,d,e;
-    dctcoef *block = (dctcoef*)_block;
-
-    a= block[stride*0 + xStride*0];
-    b= block[stride*0 + xStride*1];
-    c= block[stride*1 + xStride*0];
-    d= block[stride*1 + xStride*1];
-
-    e= a-b;
-    a= a+b;
-    b= c-d;
-    c= c+d;
-
-    block[stride*0 + xStride*0]= ((a+c)*qmul) >> 7;
-    block[stride*0 + xStride*1]= ((e+b)*qmul) >> 7;
-    block[stride*1 + xStride*0]= ((a-c)*qmul) >> 7;
-    block[stride*1 + xStride*1]= ((e-b)*qmul) >> 7;
-}
diff --git a/deps/libav/libavcodec/h264pred.c b/deps/libav/libavcodec/h264pred.c
deleted file mode 100644
index 0d47897..0000000
--- a/deps/libav/libavcodec/h264pred.c
+++ /dev/null
@@ -1,575 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 prediction functions.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "libavutil/attributes.h"
-#include "dsputil.h"
-#include "h264pred.h"
-
-#define BIT_DEPTH 8
-#include "h264pred_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 9
-#include "h264pred_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "h264pred_template.c"
-#undef BIT_DEPTH
-
-static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright,
-                                   ptrdiff_t stride)
-{
-    const unsigned lt = src[-1-1*stride];
-    LOAD_TOP_EDGE
-    LOAD_TOP_RIGHT_EDGE
-    uint32_t v = PACK_4U8((lt + 2*t0 + t1 + 2) >> 2,
-                          (t0 + 2*t1 + t2 + 2) >> 2,
-                          (t1 + 2*t2 + t3 + 2) >> 2,
-                          (t2 + 2*t3 + t4 + 2) >> 2);
-
-    AV_WN32A(src+0*stride, v);
-    AV_WN32A(src+1*stride, v);
-    AV_WN32A(src+2*stride, v);
-    AV_WN32A(src+3*stride, v);
-}
-
-static void pred4x4_horizontal_vp8_c(uint8_t *src, const uint8_t *topright,
-                                     ptrdiff_t stride)
-{
-    const unsigned lt = src[-1-1*stride];
-    LOAD_LEFT_EDGE
-
-    AV_WN32A(src+0*stride, ((lt + 2*l0 + l1 + 2) >> 2)*0x01010101);
-    AV_WN32A(src+1*stride, ((l0 + 2*l1 + l2 + 2) >> 2)*0x01010101);
-    AV_WN32A(src+2*stride, ((l1 + 2*l2 + l3 + 2) >> 2)*0x01010101);
-    AV_WN32A(src+3*stride, ((l2 + 2*l3 + l3 + 2) >> 2)*0x01010101);
-}
-
-static void pred4x4_down_left_svq3_c(uint8_t *src, const uint8_t *topright,
-                                     ptrdiff_t stride)
-{
-    LOAD_TOP_EDGE
-    LOAD_LEFT_EDGE
-
-    src[0+0*stride]=(l1 + t1)>>1;
-    src[1+0*stride]=
-    src[0+1*stride]=(l2 + t2)>>1;
-    src[2+0*stride]=
-    src[1+1*stride]=
-    src[0+2*stride]=
-    src[3+0*stride]=
-    src[2+1*stride]=
-    src[1+2*stride]=
-    src[0+3*stride]=
-    src[3+1*stride]=
-    src[2+2*stride]=
-    src[1+3*stride]=
-    src[3+2*stride]=
-    src[2+3*stride]=
-    src[3+3*stride]=(l3 + t3)>>1;
-}
-
-static void pred4x4_down_left_rv40_c(uint8_t *src, const uint8_t *topright,
-                                     ptrdiff_t stride)
-{
-    LOAD_TOP_EDGE
-    LOAD_TOP_RIGHT_EDGE
-    LOAD_LEFT_EDGE
-    LOAD_DOWN_LEFT_EDGE
-
-    src[0+0*stride]=(t0 + t2 + 2*t1 + 2 + l0 + l2 + 2*l1 + 2)>>3;
-    src[1+0*stride]=
-    src[0+1*stride]=(t1 + t3 + 2*t2 + 2 + l1 + l3 + 2*l2 + 2)>>3;
-    src[2+0*stride]=
-    src[1+1*stride]=
-    src[0+2*stride]=(t2 + t4 + 2*t3 + 2 + l2 + l4 + 2*l3 + 2)>>3;
-    src[3+0*stride]=
-    src[2+1*stride]=
-    src[1+2*stride]=
-    src[0+3*stride]=(t3 + t5 + 2*t4 + 2 + l3 + l5 + 2*l4 + 2)>>3;
-    src[3+1*stride]=
-    src[2+2*stride]=
-    src[1+3*stride]=(t4 + t6 + 2*t5 + 2 + l4 + l6 + 2*l5 + 2)>>3;
-    src[3+2*stride]=
-    src[2+3*stride]=(t5 + t7 + 2*t6 + 2 + l5 + l7 + 2*l6 + 2)>>3;
-    src[3+3*stride]=(t6 + t7 + 1 + l6 + l7 + 1)>>2;
-}
-
-static void pred4x4_down_left_rv40_nodown_c(uint8_t *src,
-                                            const uint8_t *topright,
-                                            ptrdiff_t stride)
-{
-    LOAD_TOP_EDGE
-    LOAD_TOP_RIGHT_EDGE
-    LOAD_LEFT_EDGE
-
-    src[0+0*stride]=(t0 + t2 + 2*t1 + 2 + l0 + l2 + 2*l1 + 2)>>3;
-    src[1+0*stride]=
-    src[0+1*stride]=(t1 + t3 + 2*t2 + 2 + l1 + l3 + 2*l2 + 2)>>3;
-    src[2+0*stride]=
-    src[1+1*stride]=
-    src[0+2*stride]=(t2 + t4 + 2*t3 + 2 + l2 + 3*l3 + 2)>>3;
-    src[3+0*stride]=
-    src[2+1*stride]=
-    src[1+2*stride]=
-    src[0+3*stride]=(t3 + t5 + 2*t4 + 2 + l3*4 + 2)>>3;
-    src[3+1*stride]=
-    src[2+2*stride]=
-    src[1+3*stride]=(t4 + t6 + 2*t5 + 2 + l3*4 + 2)>>3;
-    src[3+2*stride]=
-    src[2+3*stride]=(t5 + t7 + 2*t6 + 2 + l3*4 + 2)>>3;
-    src[3+3*stride]=(t6 + t7 + 1 + 2*l3 + 1)>>2;
-}
-
-static void pred4x4_vertical_left_rv40(uint8_t *src, const uint8_t *topright,
-                                       ptrdiff_t stride,
-                                       const int l0, const int l1, const int l2,
-                                       const int l3, const int l4)
-{
-    LOAD_TOP_EDGE
-    LOAD_TOP_RIGHT_EDGE
-
-    src[0+0*stride]=(2*t0 + 2*t1 + l1 + 2*l2 + l3 + 4)>>3;
-    src[1+0*stride]=
-    src[0+2*stride]=(t1 + t2 + 1)>>1;
-    src[2+0*stride]=
-    src[1+2*stride]=(t2 + t3 + 1)>>1;
-    src[3+0*stride]=
-    src[2+2*stride]=(t3 + t4+ 1)>>1;
-    src[3+2*stride]=(t4 + t5+ 1)>>1;
-    src[0+1*stride]=(t0 + 2*t1 + t2 + l2 + 2*l3 + l4 + 4)>>3;
-    src[1+1*stride]=
-    src[0+3*stride]=(t1 + 2*t2 + t3 + 2)>>2;
-    src[2+1*stride]=
-    src[1+3*stride]=(t2 + 2*t3 + t4 + 2)>>2;
-    src[3+1*stride]=
-    src[2+3*stride]=(t3 + 2*t4 + t5 + 2)>>2;
-    src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
-}
-
-static void pred4x4_vertical_left_rv40_c(uint8_t *src, const uint8_t *topright,
-                                         ptrdiff_t stride)
-{
-    LOAD_LEFT_EDGE
-    LOAD_DOWN_LEFT_EDGE
-
-    pred4x4_vertical_left_rv40(src, topright, stride, l0, l1, l2, l3, l4);
-}
-
-static void pred4x4_vertical_left_rv40_nodown_c(uint8_t *src,
-                                                const uint8_t *topright,
-                                                ptrdiff_t stride)
-{
-    LOAD_LEFT_EDGE
-
-    pred4x4_vertical_left_rv40(src, topright, stride, l0, l1, l2, l3, l3);
-}
-
-static void pred4x4_vertical_left_vp8_c(uint8_t *src, const uint8_t *topright,
-                                        ptrdiff_t stride)
-{
-    LOAD_TOP_EDGE
-    LOAD_TOP_RIGHT_EDGE
-
-    src[0+0*stride]=(t0 + t1 + 1)>>1;
-    src[1+0*stride]=
-    src[0+2*stride]=(t1 + t2 + 1)>>1;
-    src[2+0*stride]=
-    src[1+2*stride]=(t2 + t3 + 1)>>1;
-    src[3+0*stride]=
-    src[2+2*stride]=(t3 + t4 + 1)>>1;
-    src[0+1*stride]=(t0 + 2*t1 + t2 + 2)>>2;
-    src[1+1*stride]=
-    src[0+3*stride]=(t1 + 2*t2 + t3 + 2)>>2;
-    src[2+1*stride]=
-    src[1+3*stride]=(t2 + 2*t3 + t4 + 2)>>2;
-    src[3+1*stride]=
-    src[2+3*stride]=(t3 + 2*t4 + t5 + 2)>>2;
-    src[3+2*stride]=(t4 + 2*t5 + t6 + 2)>>2;
-    src[3+3*stride]=(t5 + 2*t6 + t7 + 2)>>2;
-}
-
-static void pred4x4_horizontal_up_rv40_c(uint8_t *src, const uint8_t *topright,
-                                         ptrdiff_t stride)
-{
-    LOAD_LEFT_EDGE
-    LOAD_DOWN_LEFT_EDGE
-    LOAD_TOP_EDGE
-    LOAD_TOP_RIGHT_EDGE
-
-    src[0+0*stride]=(t1 + 2*t2 + t3 + 2*l0 + 2*l1 + 4)>>3;
-    src[1+0*stride]=(t2 + 2*t3 + t4 + l0 + 2*l1 + l2 + 4)>>3;
-    src[2+0*stride]=
-    src[0+1*stride]=(t3 + 2*t4 + t5 + 2*l1 + 2*l2 + 4)>>3;
-    src[3+0*stride]=
-    src[1+1*stride]=(t4 + 2*t5 + t6 + l1 + 2*l2 + l3 + 4)>>3;
-    src[2+1*stride]=
-    src[0+2*stride]=(t5 + 2*t6 + t7 + 2*l2 + 2*l3 + 4)>>3;
-    src[3+1*stride]=
-    src[1+2*stride]=(t6 + 3*t7 + l2 + 3*l3 + 4)>>3;
-    src[3+2*stride]=
-    src[1+3*stride]=(l3 + 2*l4 + l5 + 2)>>2;
-    src[0+3*stride]=
-    src[2+2*stride]=(t6 + t7 + l3 + l4 + 2)>>2;
-    src[2+3*stride]=(l4 + l5 + 1)>>1;
-    src[3+3*stride]=(l4 + 2*l5 + l6 + 2)>>2;
-}
-
-static void pred4x4_horizontal_up_rv40_nodown_c(uint8_t *src,
-                                                const uint8_t *topright,
-                                                ptrdiff_t stride)
-{
-    LOAD_LEFT_EDGE
-    LOAD_TOP_EDGE
-    LOAD_TOP_RIGHT_EDGE
-
-    src[0+0*stride]=(t1 + 2*t2 + t3 + 2*l0 + 2*l1 + 4)>>3;
-    src[1+0*stride]=(t2 + 2*t3 + t4 + l0 + 2*l1 + l2 + 4)>>3;
-    src[2+0*stride]=
-    src[0+1*stride]=(t3 + 2*t4 + t5 + 2*l1 + 2*l2 + 4)>>3;
-    src[3+0*stride]=
-    src[1+1*stride]=(t4 + 2*t5 + t6 + l1 + 2*l2 + l3 + 4)>>3;
-    src[2+1*stride]=
-    src[0+2*stride]=(t5 + 2*t6 + t7 + 2*l2 + 2*l3 + 4)>>3;
-    src[3+1*stride]=
-    src[1+2*stride]=(t6 + 3*t7 + l2 + 3*l3 + 4)>>3;
-    src[3+2*stride]=
-    src[1+3*stride]=l3;
-    src[0+3*stride]=
-    src[2+2*stride]=(t6 + t7 + 2*l3 + 2)>>2;
-    src[2+3*stride]=
-    src[3+3*stride]=l3;
-}
-
-static void pred4x4_tm_vp8_c(uint8_t *src, const uint8_t *topright,
-                             ptrdiff_t stride)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
-    uint8_t *top = src-stride;
-    int y;
-
-    for (y = 0; y < 4; y++) {
-        const uint8_t *cm_in = cm + src[-1];
-        src[0] = cm_in[top[0]];
-        src[1] = cm_in[top[1]];
-        src[2] = cm_in[top[2]];
-        src[3] = cm_in[top[3]];
-        src += stride;
-    }
-}
-
-static void pred16x16_plane_svq3_c(uint8_t *src, ptrdiff_t stride)
-{
-    pred16x16_plane_compat_8_c(src, stride, 1, 0);
-}
-
-static void pred16x16_plane_rv40_c(uint8_t *src, ptrdiff_t stride)
-{
-    pred16x16_plane_compat_8_c(src, stride, 0, 1);
-}
-
-static void pred16x16_tm_vp8_c(uint8_t *src, ptrdiff_t stride)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
-    uint8_t *top = src-stride;
-    int y;
-
-    for (y = 0; y < 16; y++) {
-        const uint8_t *cm_in = cm + src[-1];
-        src[0]  = cm_in[top[0]];
-        src[1]  = cm_in[top[1]];
-        src[2]  = cm_in[top[2]];
-        src[3]  = cm_in[top[3]];
-        src[4]  = cm_in[top[4]];
-        src[5]  = cm_in[top[5]];
-        src[6]  = cm_in[top[6]];
-        src[7]  = cm_in[top[7]];
-        src[8]  = cm_in[top[8]];
-        src[9]  = cm_in[top[9]];
-        src[10] = cm_in[top[10]];
-        src[11] = cm_in[top[11]];
-        src[12] = cm_in[top[12]];
-        src[13] = cm_in[top[13]];
-        src[14] = cm_in[top[14]];
-        src[15] = cm_in[top[15]];
-        src += stride;
-    }
-}
-
-static void pred8x8_left_dc_rv40_c(uint8_t *src, ptrdiff_t stride)
-{
-    int i;
-    unsigned dc0;
-
-    dc0=0;
-    for(i=0;i<8; i++)
-        dc0+= src[-1+i*stride];
-    dc0= 0x01010101*((dc0 + 4)>>3);
-
-    for(i=0; i<8; i++){
-        ((uint32_t*)(src+i*stride))[0]=
-        ((uint32_t*)(src+i*stride))[1]= dc0;
-    }
-}
-
-static void pred8x8_top_dc_rv40_c(uint8_t *src, ptrdiff_t stride)
-{
-    int i;
-    unsigned dc0;
-
-    dc0=0;
-    for(i=0;i<8; i++)
-        dc0+= src[i-stride];
-    dc0= 0x01010101*((dc0 + 4)>>3);
-
-    for(i=0; i<8; i++){
-        ((uint32_t*)(src+i*stride))[0]=
-        ((uint32_t*)(src+i*stride))[1]= dc0;
-    }
-}
-
-static void pred8x8_dc_rv40_c(uint8_t *src, ptrdiff_t stride)
-{
-    int i;
-    unsigned dc0 = 0;
-
-    for(i=0;i<4; i++){
-        dc0+= src[-1+i*stride] + src[i-stride];
-        dc0+= src[4+i-stride];
-        dc0+= src[-1+(i+4)*stride];
-    }
-    dc0= 0x01010101*((dc0 + 8)>>4);
-
-    for(i=0; i<4; i++){
-        ((uint32_t*)(src+i*stride))[0]= dc0;
-        ((uint32_t*)(src+i*stride))[1]= dc0;
-    }
-    for(i=4; i<8; i++){
-        ((uint32_t*)(src+i*stride))[0]= dc0;
-        ((uint32_t*)(src+i*stride))[1]= dc0;
-    }
-}
-
-static void pred8x8_tm_vp8_c(uint8_t *src, ptrdiff_t stride)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
-    uint8_t *top = src-stride;
-    int y;
-
-    for (y = 0; y < 8; y++) {
-        const uint8_t *cm_in = cm + src[-1];
-        src[0] = cm_in[top[0]];
-        src[1] = cm_in[top[1]];
-        src[2] = cm_in[top[2]];
-        src[3] = cm_in[top[3]];
-        src[4] = cm_in[top[4]];
-        src[5] = cm_in[top[5]];
-        src[6] = cm_in[top[6]];
-        src[7] = cm_in[top[7]];
-        src += stride;
-    }
-}
-
-/**
- * Set the intra prediction function pointers.
- */
-av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
-                               const int bit_depth,
-                               const int chroma_format_idc)
-{
-#undef FUNC
-#undef FUNCC
-#define FUNC(a, depth) a ## _ ## depth
-#define FUNCC(a, depth) a ## _ ## depth ## _c
-#define FUNCD(a) a ## _c
-
-#define H264_PRED(depth) \
-    if(codec_id != AV_CODEC_ID_RV40){\
-        if(codec_id == AV_CODEC_ID_VP8) {\
-            h->pred4x4[VERT_PRED       ]= FUNCD(pred4x4_vertical_vp8);\
-            h->pred4x4[HOR_PRED        ]= FUNCD(pred4x4_horizontal_vp8);\
-        } else {\
-            h->pred4x4[VERT_PRED       ]= FUNCC(pred4x4_vertical          , depth);\
-            h->pred4x4[HOR_PRED        ]= FUNCC(pred4x4_horizontal        , depth);\
-        }\
-        h->pred4x4[DC_PRED             ]= FUNCC(pred4x4_dc                , depth);\
-        if(codec_id == AV_CODEC_ID_SVQ3)\
-            h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCD(pred4x4_down_left_svq3);\
-        else\
-            h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCC(pred4x4_down_left     , depth);\
-        h->pred4x4[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred4x4_down_right        , depth);\
-        h->pred4x4[VERT_RIGHT_PRED     ]= FUNCC(pred4x4_vertical_right    , depth);\
-        h->pred4x4[HOR_DOWN_PRED       ]= FUNCC(pred4x4_horizontal_down   , depth);\
-        if (codec_id == AV_CODEC_ID_VP8) {\
-            h->pred4x4[VERT_LEFT_PRED  ]= FUNCD(pred4x4_vertical_left_vp8);\
-        } else\
-            h->pred4x4[VERT_LEFT_PRED  ]= FUNCC(pred4x4_vertical_left     , depth);\
-        h->pred4x4[HOR_UP_PRED         ]= FUNCC(pred4x4_horizontal_up     , depth);\
-        if(codec_id != AV_CODEC_ID_VP8) {\
-            h->pred4x4[LEFT_DC_PRED    ]= FUNCC(pred4x4_left_dc           , depth);\
-            h->pred4x4[TOP_DC_PRED     ]= FUNCC(pred4x4_top_dc            , depth);\
-            h->pred4x4[DC_128_PRED     ]= FUNCC(pred4x4_128_dc            , depth);\
-        } else {\
-            h->pred4x4[TM_VP8_PRED     ]= FUNCD(pred4x4_tm_vp8);\
-            h->pred4x4[DC_127_PRED     ]= FUNCC(pred4x4_127_dc            , depth);\
-            h->pred4x4[DC_129_PRED     ]= FUNCC(pred4x4_129_dc            , depth);\
-            h->pred4x4[VERT_VP8_PRED   ]= FUNCC(pred4x4_vertical          , depth);\
-            h->pred4x4[HOR_VP8_PRED    ]= FUNCC(pred4x4_horizontal        , depth);\
-        }\
-    }else{\
-        h->pred4x4[VERT_PRED           ]= FUNCC(pred4x4_vertical          , depth);\
-        h->pred4x4[HOR_PRED            ]= FUNCC(pred4x4_horizontal        , depth);\
-        h->pred4x4[DC_PRED             ]= FUNCC(pred4x4_dc                , depth);\
-        h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCD(pred4x4_down_left_rv40);\
-        h->pred4x4[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred4x4_down_right        , depth);\
-        h->pred4x4[VERT_RIGHT_PRED     ]= FUNCC(pred4x4_vertical_right    , depth);\
-        h->pred4x4[HOR_DOWN_PRED       ]= FUNCC(pred4x4_horizontal_down   , depth);\
-        h->pred4x4[VERT_LEFT_PRED      ]= FUNCD(pred4x4_vertical_left_rv40);\
-        h->pred4x4[HOR_UP_PRED         ]= FUNCD(pred4x4_horizontal_up_rv40);\
-        h->pred4x4[LEFT_DC_PRED        ]= FUNCC(pred4x4_left_dc           , depth);\
-        h->pred4x4[TOP_DC_PRED         ]= FUNCC(pred4x4_top_dc            , depth);\
-        h->pred4x4[DC_128_PRED         ]= FUNCC(pred4x4_128_dc            , depth);\
-        h->pred4x4[DIAG_DOWN_LEFT_PRED_RV40_NODOWN]= FUNCD(pred4x4_down_left_rv40_nodown);\
-        h->pred4x4[HOR_UP_PRED_RV40_NODOWN]= FUNCD(pred4x4_horizontal_up_rv40_nodown);\
-        h->pred4x4[VERT_LEFT_PRED_RV40_NODOWN]= FUNCD(pred4x4_vertical_left_rv40_nodown);\
-    }\
-\
-    h->pred8x8l[VERT_PRED           ]= FUNCC(pred8x8l_vertical            , depth);\
-    h->pred8x8l[HOR_PRED            ]= FUNCC(pred8x8l_horizontal          , depth);\
-    h->pred8x8l[DC_PRED             ]= FUNCC(pred8x8l_dc                  , depth);\
-    h->pred8x8l[DIAG_DOWN_LEFT_PRED ]= FUNCC(pred8x8l_down_left           , depth);\
-    h->pred8x8l[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred8x8l_down_right          , depth);\
-    h->pred8x8l[VERT_RIGHT_PRED     ]= FUNCC(pred8x8l_vertical_right      , depth);\
-    h->pred8x8l[HOR_DOWN_PRED       ]= FUNCC(pred8x8l_horizontal_down     , depth);\
-    h->pred8x8l[VERT_LEFT_PRED      ]= FUNCC(pred8x8l_vertical_left       , depth);\
-    h->pred8x8l[HOR_UP_PRED         ]= FUNCC(pred8x8l_horizontal_up       , depth);\
-    h->pred8x8l[LEFT_DC_PRED        ]= FUNCC(pred8x8l_left_dc             , depth);\
-    h->pred8x8l[TOP_DC_PRED         ]= FUNCC(pred8x8l_top_dc              , depth);\
-    h->pred8x8l[DC_128_PRED         ]= FUNCC(pred8x8l_128_dc              , depth);\
-\
-    if (chroma_format_idc <= 1) {\
-        h->pred8x8[VERT_PRED8x8   ]= FUNCC(pred8x8_vertical               , depth);\
-        h->pred8x8[HOR_PRED8x8    ]= FUNCC(pred8x8_horizontal             , depth);\
-    } else {\
-        h->pred8x8[VERT_PRED8x8   ]= FUNCC(pred8x16_vertical              , depth);\
-        h->pred8x8[HOR_PRED8x8    ]= FUNCC(pred8x16_horizontal            , depth);\
-    }\
-    if (codec_id != AV_CODEC_ID_VP8) {\
-        if (chroma_format_idc <= 1) {\
-            h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x8_plane                , depth);\
-        } else {\
-            h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x16_plane               , depth);\
-        }\
-    } else\
-        h->pred8x8[PLANE_PRED8x8]= FUNCD(pred8x8_tm_vp8);\
-    if(codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8){\
-        if (chroma_format_idc <= 1) {\
-            h->pred8x8[DC_PRED8x8     ]= FUNCC(pred8x8_dc                     , depth);\
-            h->pred8x8[LEFT_DC_PRED8x8]= FUNCC(pred8x8_left_dc                , depth);\
-            h->pred8x8[TOP_DC_PRED8x8 ]= FUNCC(pred8x8_top_dc                 , depth);\
-            h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8 ]= FUNC(pred8x8_mad_cow_dc_l0t, depth);\
-            h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8 ]= FUNC(pred8x8_mad_cow_dc_0lt, depth);\
-            h->pred8x8[ALZHEIMER_DC_L00_PRED8x8 ]= FUNC(pred8x8_mad_cow_dc_l00, depth);\
-            h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8 ]= FUNC(pred8x8_mad_cow_dc_0l0, depth);\
-        } else {\
-            h->pred8x8[DC_PRED8x8     ]= FUNCC(pred8x16_dc                    , depth);\
-            h->pred8x8[LEFT_DC_PRED8x8]= FUNCC(pred8x16_left_dc               , depth);\
-            h->pred8x8[TOP_DC_PRED8x8 ]= FUNCC(pred8x16_top_dc                , depth);\
-            h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8 ]= FUNC(pred8x16_mad_cow_dc_l0t, depth);\
-            h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8 ]= FUNC(pred8x16_mad_cow_dc_0lt, depth);\
-            h->pred8x8[ALZHEIMER_DC_L00_PRED8x8 ]= FUNC(pred8x16_mad_cow_dc_l00, depth);\
-            h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8 ]= FUNC(pred8x16_mad_cow_dc_0l0, depth);\
-        }\
-    }else{\
-        h->pred8x8[DC_PRED8x8     ]= FUNCD(pred8x8_dc_rv40);\
-        h->pred8x8[LEFT_DC_PRED8x8]= FUNCD(pred8x8_left_dc_rv40);\
-        h->pred8x8[TOP_DC_PRED8x8 ]= FUNCD(pred8x8_top_dc_rv40);\
-        if (codec_id == AV_CODEC_ID_VP8) {\
-            h->pred8x8[DC_127_PRED8x8]= FUNCC(pred8x8_127_dc              , depth);\
-            h->pred8x8[DC_129_PRED8x8]= FUNCC(pred8x8_129_dc              , depth);\
-        }\
-    }\
-    if (chroma_format_idc <= 1) {\
-        h->pred8x8[DC_128_PRED8x8 ]= FUNCC(pred8x8_128_dc                 , depth);\
-    } else {\
-        h->pred8x8[DC_128_PRED8x8 ]= FUNCC(pred8x16_128_dc                , depth);\
-    }\
-\
-    h->pred16x16[DC_PRED8x8     ]= FUNCC(pred16x16_dc                     , depth);\
-    h->pred16x16[VERT_PRED8x8   ]= FUNCC(pred16x16_vertical               , depth);\
-    h->pred16x16[HOR_PRED8x8    ]= FUNCC(pred16x16_horizontal             , depth);\
-    switch(codec_id){\
-    case AV_CODEC_ID_SVQ3:\
-       h->pred16x16[PLANE_PRED8x8  ]= FUNCD(pred16x16_plane_svq3);\
-       break;\
-    case AV_CODEC_ID_RV40:\
-       h->pred16x16[PLANE_PRED8x8  ]= FUNCD(pred16x16_plane_rv40);\
-       break;\
-    case AV_CODEC_ID_VP8:\
-       h->pred16x16[PLANE_PRED8x8  ]= FUNCD(pred16x16_tm_vp8);\
-       h->pred16x16[DC_127_PRED8x8]= FUNCC(pred16x16_127_dc               , depth);\
-       h->pred16x16[DC_129_PRED8x8]= FUNCC(pred16x16_129_dc               , depth);\
-       break;\
-    default:\
-       h->pred16x16[PLANE_PRED8x8  ]= FUNCC(pred16x16_plane               , depth);\
-       break;\
-    }\
-    h->pred16x16[LEFT_DC_PRED8x8]= FUNCC(pred16x16_left_dc                , depth);\
-    h->pred16x16[TOP_DC_PRED8x8 ]= FUNCC(pred16x16_top_dc                 , depth);\
-    h->pred16x16[DC_128_PRED8x8 ]= FUNCC(pred16x16_128_dc                 , depth);\
-\
-    /* special lossless h/v prediction for h264 */ \
-    h->pred4x4_add  [VERT_PRED   ]= FUNCC(pred4x4_vertical_add            , depth);\
-    h->pred4x4_add  [ HOR_PRED   ]= FUNCC(pred4x4_horizontal_add          , depth);\
-    h->pred8x8l_add [VERT_PRED   ]= FUNCC(pred8x8l_vertical_add           , depth);\
-    h->pred8x8l_add [ HOR_PRED   ]= FUNCC(pred8x8l_horizontal_add         , depth);\
-    if (chroma_format_idc <= 1) {\
-    h->pred8x8_add  [VERT_PRED8x8]= FUNCC(pred8x8_vertical_add            , depth);\
-    h->pred8x8_add  [ HOR_PRED8x8]= FUNCC(pred8x8_horizontal_add          , depth);\
-    } else {\
-        h->pred8x8_add  [VERT_PRED8x8]= FUNCC(pred8x16_vertical_add            , depth);\
-        h->pred8x8_add  [ HOR_PRED8x8]= FUNCC(pred8x16_horizontal_add          , depth);\
-    }\
-    h->pred16x16_add[VERT_PRED8x8]= FUNCC(pred16x16_vertical_add          , depth);\
-    h->pred16x16_add[ HOR_PRED8x8]= FUNCC(pred16x16_horizontal_add        , depth);\
-
-    switch (bit_depth) {
-        case 9:
-            H264_PRED(9)
-            break;
-        case 10:
-            H264_PRED(10)
-            break;
-        default:
-            H264_PRED(8)
-            break;
-    }
-
-    if (ARCH_ARM) ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc);
-    if (ARCH_X86) ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc);
-}
diff --git a/deps/libav/libavcodec/h264pred.h b/deps/libav/libavcodec/h264pred.h
deleted file mode 100644
index 62e5b79..0000000
--- a/deps/libav/libavcodec/h264pred.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 prediction functions.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVCODEC_H264PRED_H
-#define AVCODEC_H264PRED_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-/**
- * Prediction types
- */
-//@{
-#define VERT_PRED              0
-#define HOR_PRED               1
-#define DC_PRED                2
-#define DIAG_DOWN_LEFT_PRED    3
-#define DIAG_DOWN_RIGHT_PRED   4
-#define VERT_RIGHT_PRED        5
-#define HOR_DOWN_PRED          6
-#define VERT_LEFT_PRED         7
-#define HOR_UP_PRED            8
-
-// DC edge (not for VP8)
-#define LEFT_DC_PRED           9
-#define TOP_DC_PRED           10
-#define DC_128_PRED           11
-
-// RV40 specific
-#define DIAG_DOWN_LEFT_PRED_RV40_NODOWN   12
-#define HOR_UP_PRED_RV40_NODOWN           13
-#define VERT_LEFT_PRED_RV40_NODOWN        14
-
-// VP8 specific
-#define TM_VP8_PRED            9    ///< "True Motion", used instead of plane
-#define VERT_VP8_PRED         10    ///< for VP8, #VERT_PRED is the average of
-                                    ///< (left col+cur col x2+right col) / 4;
-                                    ///< this is the "unaveraged" one
-#define HOR_VP8_PRED          11    ///< unaveraged version of #HOR_PRED, see
-                                    ///< #VERT_VP8_PRED for details
-#define DC_127_PRED           12
-#define DC_129_PRED           13
-
-#define DC_PRED8x8             0
-#define HOR_PRED8x8            1
-#define VERT_PRED8x8           2
-#define PLANE_PRED8x8          3
-
-// DC edge
-#define LEFT_DC_PRED8x8        4
-#define TOP_DC_PRED8x8         5
-#define DC_128_PRED8x8         6
-
-// H264/SVQ3 (8x8) specific
-#define ALZHEIMER_DC_L0T_PRED8x8  7
-#define ALZHEIMER_DC_0LT_PRED8x8  8
-#define ALZHEIMER_DC_L00_PRED8x8  9
-#define ALZHEIMER_DC_0L0_PRED8x8 10
-
-// VP8 specific
-#define DC_127_PRED8x8         7
-#define DC_129_PRED8x8         8
-//@}
-
-/**
- * Context for storing H.264 prediction functions
- */
-typedef struct H264PredContext {
-    void(*pred4x4[9 + 3 + 3])(uint8_t *src, const uint8_t *topright,
-                              ptrdiff_t stride);
-    void(*pred8x8l[9 + 3])(uint8_t *src, int topleft, int topright,
-                           ptrdiff_t stride);
-    void(*pred8x8[4 + 3 + 4])(uint8_t *src, ptrdiff_t stride);
-    void(*pred16x16[4 + 3 + 2])(uint8_t *src, ptrdiff_t stride);
-
-    void(*pred4x4_add[2])(uint8_t *pix /*align  4*/,
-                          int16_t *block /*align 16*/, ptrdiff_t stride);
-    void(*pred8x8l_add[2])(uint8_t *pix /*align  8*/,
-                           int16_t *block /*align 16*/, ptrdiff_t stride);
-    void(*pred8x8_add[3])(uint8_t *pix /*align  8*/,
-                          const int *block_offset,
-                          int16_t *block /*align 16*/, ptrdiff_t stride);
-    void(*pred16x16_add[3])(uint8_t *pix /*align 16*/,
-                            const int *block_offset,
-                            int16_t *block /*align 16*/, ptrdiff_t stride);
-} H264PredContext;
-
-void ff_h264_pred_init(H264PredContext *h, int codec_id,
-                       const int bit_depth, const int chroma_format_idc);
-void ff_h264_pred_init_arm(H264PredContext *h, int codec_id,
-                           const int bit_depth, const int chroma_format_idc);
-void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
-                           const int bit_depth, const int chroma_format_idc);
-
-#endif /* AVCODEC_H264PRED_H */
diff --git a/deps/libav/libavcodec/h264pred_template.c b/deps/libav/libavcodec/h264pred_template.c
deleted file mode 100644
index e15c76c..0000000
--- a/deps/libav/libavcodec/h264pred_template.c
+++ /dev/null
@@ -1,1279 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003-2011 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 prediction functions.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "mathops.h"
-
-#include "bit_depth_template.c"
-
-static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright,
-                                    ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const pixel4 a= AV_RN4PA(src-stride);
-
-    AV_WN4PA(src+0*stride, a);
-    AV_WN4PA(src+1*stride, a);
-    AV_WN4PA(src+2*stride, a);
-    AV_WN4PA(src+3*stride, a);
-}
-
-static void FUNCC(pred4x4_horizontal)(uint8_t *_src, const uint8_t *topright,
-                                      ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    AV_WN4PA(src+0*stride, PIXEL_SPLAT_X4(src[-1+0*stride]));
-    AV_WN4PA(src+1*stride, PIXEL_SPLAT_X4(src[-1+1*stride]));
-    AV_WN4PA(src+2*stride, PIXEL_SPLAT_X4(src[-1+2*stride]));
-    AV_WN4PA(src+3*stride, PIXEL_SPLAT_X4(src[-1+3*stride]));
-}
-
-static void FUNCC(pred4x4_dc)(uint8_t *_src, const uint8_t *topright,
-                              ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const int dc= (  src[-stride] + src[1-stride] + src[2-stride] + src[3-stride]
-                   + src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 4) >>3;
-    const pixel4 a = PIXEL_SPLAT_X4(dc);
-
-    AV_WN4PA(src+0*stride, a);
-    AV_WN4PA(src+1*stride, a);
-    AV_WN4PA(src+2*stride, a);
-    AV_WN4PA(src+3*stride, a);
-}
-
-static void FUNCC(pred4x4_left_dc)(uint8_t *_src, const uint8_t *topright,
-                                   ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const int dc= (  src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 2) >>2;
-    const pixel4 a = PIXEL_SPLAT_X4(dc);
-
-    AV_WN4PA(src+0*stride, a);
-    AV_WN4PA(src+1*stride, a);
-    AV_WN4PA(src+2*stride, a);
-    AV_WN4PA(src+3*stride, a);
-}
-
-static void FUNCC(pred4x4_top_dc)(uint8_t *_src, const uint8_t *topright,
-                                  ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const int dc= (  src[-stride] + src[1-stride] + src[2-stride] + src[3-stride] + 2) >>2;
-    const pixel4 a = PIXEL_SPLAT_X4(dc);
-
-    AV_WN4PA(src+0*stride, a);
-    AV_WN4PA(src+1*stride, a);
-    AV_WN4PA(src+2*stride, a);
-    AV_WN4PA(src+3*stride, a);
-}
-
-static void FUNCC(pred4x4_128_dc)(uint8_t *_src, const uint8_t *topright,
-                                  ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const pixel4 a = PIXEL_SPLAT_X4(1<<(BIT_DEPTH-1));
-
-    AV_WN4PA(src+0*stride, a);
-    AV_WN4PA(src+1*stride, a);
-    AV_WN4PA(src+2*stride, a);
-    AV_WN4PA(src+3*stride, a);
-}
-
-static void FUNCC(pred4x4_127_dc)(uint8_t *_src, const uint8_t *topright,
-                                  ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const pixel4 a = PIXEL_SPLAT_X4((1<<(BIT_DEPTH-1))-1);
-
-    AV_WN4PA(src+0*stride, a);
-    AV_WN4PA(src+1*stride, a);
-    AV_WN4PA(src+2*stride, a);
-    AV_WN4PA(src+3*stride, a);
-}
-
-static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright,
-                                  ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const pixel4 a = PIXEL_SPLAT_X4((1<<(BIT_DEPTH-1))+1);
-
-    AV_WN4PA(src+0*stride, a);
-    AV_WN4PA(src+1*stride, a);
-    AV_WN4PA(src+2*stride, a);
-    AV_WN4PA(src+3*stride, a);
-}
-
-
-#define LOAD_TOP_RIGHT_EDGE\
-    const unsigned av_unused t4 = topright[0];\
-    const unsigned av_unused t5 = topright[1];\
-    const unsigned av_unused t6 = topright[2];\
-    const unsigned av_unused t7 = topright[3];\
-
-#define LOAD_DOWN_LEFT_EDGE\
-    const unsigned av_unused l4 = src[-1+4*stride];\
-    const unsigned av_unused l5 = src[-1+5*stride];\
-    const unsigned av_unused l6 = src[-1+6*stride];\
-    const unsigned av_unused l7 = src[-1+7*stride];\
-
-#define LOAD_LEFT_EDGE\
-    const unsigned av_unused l0 = src[-1+0*stride];\
-    const unsigned av_unused l1 = src[-1+1*stride];\
-    const unsigned av_unused l2 = src[-1+2*stride];\
-    const unsigned av_unused l3 = src[-1+3*stride];\
-
-#define LOAD_TOP_EDGE\
-    const unsigned av_unused t0 = src[ 0-1*stride];\
-    const unsigned av_unused t1 = src[ 1-1*stride];\
-    const unsigned av_unused t2 = src[ 2-1*stride];\
-    const unsigned av_unused t3 = src[ 3-1*stride];\
-
-static void FUNCC(pred4x4_down_right)(uint8_t *_src, const uint8_t *topright,
-                                      ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const int lt= src[-1-1*stride];
-    LOAD_TOP_EDGE
-    LOAD_LEFT_EDGE
-
-    src[0+3*stride]=(l3 + 2*l2 + l1 + 2)>>2;
-    src[0+2*stride]=
-    src[1+3*stride]=(l2 + 2*l1 + l0 + 2)>>2;
-    src[0+1*stride]=
-    src[1+2*stride]=
-    src[2+3*stride]=(l1 + 2*l0 + lt + 2)>>2;
-    src[0+0*stride]=
-    src[1+1*stride]=
-    src[2+2*stride]=
-    src[3+3*stride]=(l0 + 2*lt + t0 + 2)>>2;
-    src[1+0*stride]=
-    src[2+1*stride]=
-    src[3+2*stride]=(lt + 2*t0 + t1 + 2)>>2;
-    src[2+0*stride]=
-    src[3+1*stride]=(t0 + 2*t1 + t2 + 2)>>2;
-    src[3+0*stride]=(t1 + 2*t2 + t3 + 2)>>2;
-}
-
-static void FUNCC(pred4x4_down_left)(uint8_t *_src, const uint8_t *_topright,
-                                     ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    const pixel *topright = (const pixel*)_topright;
-    int stride = _stride/sizeof(pixel);
-    LOAD_TOP_EDGE
-    LOAD_TOP_RIGHT_EDGE
-//    LOAD_LEFT_EDGE
-
-    src[0+0*stride]=(t0 + t2 + 2*t1 + 2)>>2;
-    src[1+0*stride]=
-    src[0+1*stride]=(t1 + t3 + 2*t2 + 2)>>2;
-    src[2+0*stride]=
-    src[1+1*stride]=
-    src[0+2*stride]=(t2 + t4 + 2*t3 + 2)>>2;
-    src[3+0*stride]=
-    src[2+1*stride]=
-    src[1+2*stride]=
-    src[0+3*stride]=(t3 + t5 + 2*t4 + 2)>>2;
-    src[3+1*stride]=
-    src[2+2*stride]=
-    src[1+3*stride]=(t4 + t6 + 2*t5 + 2)>>2;
-    src[3+2*stride]=
-    src[2+3*stride]=(t5 + t7 + 2*t6 + 2)>>2;
-    src[3+3*stride]=(t6 + 3*t7 + 2)>>2;
-}
-
-static void FUNCC(pred4x4_vertical_right)(uint8_t *_src,
-                                          const uint8_t *topright,
-                                          ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const int lt= src[-1-1*stride];
-    LOAD_TOP_EDGE
-    LOAD_LEFT_EDGE
-
-    src[0+0*stride]=
-    src[1+2*stride]=(lt + t0 + 1)>>1;
-    src[1+0*stride]=
-    src[2+2*stride]=(t0 + t1 + 1)>>1;
-    src[2+0*stride]=
-    src[3+2*stride]=(t1 + t2 + 1)>>1;
-    src[3+0*stride]=(t2 + t3 + 1)>>1;
-    src[0+1*stride]=
-    src[1+3*stride]=(l0 + 2*lt + t0 + 2)>>2;
-    src[1+1*stride]=
-    src[2+3*stride]=(lt + 2*t0 + t1 + 2)>>2;
-    src[2+1*stride]=
-    src[3+3*stride]=(t0 + 2*t1 + t2 + 2)>>2;
-    src[3+1*stride]=(t1 + 2*t2 + t3 + 2)>>2;
-    src[0+2*stride]=(lt + 2*l0 + l1 + 2)>>2;
-    src[0+3*stride]=(l0 + 2*l1 + l2 + 2)>>2;
-}
-
-static void FUNCC(pred4x4_vertical_left)(uint8_t *_src,
-                                         const uint8_t *_topright,
-                                         ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    const pixel *topright = (const pixel*)_topright;
-    int stride = _stride/sizeof(pixel);
-    LOAD_TOP_EDGE
-    LOAD_TOP_RIGHT_EDGE
-
-    src[0+0*stride]=(t0 + t1 + 1)>>1;
-    src[1+0*stride]=
-    src[0+2*stride]=(t1 + t2 + 1)>>1;
-    src[2+0*stride]=
-    src[1+2*stride]=(t2 + t3 + 1)>>1;
-    src[3+0*stride]=
-    src[2+2*stride]=(t3 + t4+ 1)>>1;
-    src[3+2*stride]=(t4 + t5+ 1)>>1;
-    src[0+1*stride]=(t0 + 2*t1 + t2 + 2)>>2;
-    src[1+1*stride]=
-    src[0+3*stride]=(t1 + 2*t2 + t3 + 2)>>2;
-    src[2+1*stride]=
-    src[1+3*stride]=(t2 + 2*t3 + t4 + 2)>>2;
-    src[3+1*stride]=
-    src[2+3*stride]=(t3 + 2*t4 + t5 + 2)>>2;
-    src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
-}
-
-static void FUNCC(pred4x4_horizontal_up)(uint8_t *_src, const uint8_t *topright,
-                                         ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    LOAD_LEFT_EDGE
-
-    src[0+0*stride]=(l0 + l1 + 1)>>1;
-    src[1+0*stride]=(l0 + 2*l1 + l2 + 2)>>2;
-    src[2+0*stride]=
-    src[0+1*stride]=(l1 + l2 + 1)>>1;
-    src[3+0*stride]=
-    src[1+1*stride]=(l1 + 2*l2 + l3 + 2)>>2;
-    src[2+1*stride]=
-    src[0+2*stride]=(l2 + l3 + 1)>>1;
-    src[3+1*stride]=
-    src[1+2*stride]=(l2 + 2*l3 + l3 + 2)>>2;
-    src[3+2*stride]=
-    src[1+3*stride]=
-    src[0+3*stride]=
-    src[2+2*stride]=
-    src[2+3*stride]=
-    src[3+3*stride]=l3;
-}
-
-static void FUNCC(pred4x4_horizontal_down)(uint8_t *_src,
-                                           const uint8_t *topright,
-                                           ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const int lt= src[-1-1*stride];
-    LOAD_TOP_EDGE
-    LOAD_LEFT_EDGE
-
-    src[0+0*stride]=
-    src[2+1*stride]=(lt + l0 + 1)>>1;
-    src[1+0*stride]=
-    src[3+1*stride]=(l0 + 2*lt + t0 + 2)>>2;
-    src[2+0*stride]=(lt + 2*t0 + t1 + 2)>>2;
-    src[3+0*stride]=(t0 + 2*t1 + t2 + 2)>>2;
-    src[0+1*stride]=
-    src[2+2*stride]=(l0 + l1 + 1)>>1;
-    src[1+1*stride]=
-    src[3+2*stride]=(lt + 2*l0 + l1 + 2)>>2;
-    src[0+2*stride]=
-    src[2+3*stride]=(l1 + l2+ 1)>>1;
-    src[1+2*stride]=
-    src[3+3*stride]=(l0 + 2*l1 + l2 + 2)>>2;
-    src[0+3*stride]=(l2 + l3 + 1)>>1;
-    src[1+3*stride]=(l1 + 2*l2 + l3 + 2)>>2;
-}
-
-static void FUNCC(pred16x16_vertical)(uint8_t *_src, ptrdiff_t _stride)
-{
-    int i;
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const pixel4 a = AV_RN4PA(((pixel4*)(src-stride))+0);
-    const pixel4 b = AV_RN4PA(((pixel4*)(src-stride))+1);
-    const pixel4 c = AV_RN4PA(((pixel4*)(src-stride))+2);
-    const pixel4 d = AV_RN4PA(((pixel4*)(src-stride))+3);
-
-    for(i=0; i<16; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, b);
-        AV_WN4PA(((pixel4*)(src+i*stride))+2, c);
-        AV_WN4PA(((pixel4*)(src+i*stride))+3, d);
-    }
-}
-
-static void FUNCC(pred16x16_horizontal)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i;
-    pixel *src = (pixel*)_src;
-    stride /= sizeof(pixel);
-
-    for(i=0; i<16; i++){
-        const pixel4 a = PIXEL_SPLAT_X4(src[-1+i*stride]);
-
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, a);
-        AV_WN4PA(((pixel4*)(src+i*stride))+2, a);
-        AV_WN4PA(((pixel4*)(src+i*stride))+3, a);
-    }
-}
-
-#define PREDICT_16x16_DC(v)\
-    for(i=0; i<16; i++){\
-        AV_WN4PA(src+ 0, v);\
-        AV_WN4PA(src+ 4, v);\
-        AV_WN4PA(src+ 8, v);\
-        AV_WN4PA(src+12, v);\
-        src += stride;\
-    }
-
-static void FUNCC(pred16x16_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i, dc=0;
-    pixel *src = (pixel*)_src;
-    pixel4 dcsplat;
-    stride /= sizeof(pixel);
-
-    for(i=0;i<16; i++){
-        dc+= src[-1+i*stride];
-    }
-
-    for(i=0;i<16; i++){
-        dc+= src[i-stride];
-    }
-
-    dcsplat = PIXEL_SPLAT_X4((dc+16)>>5);
-    PREDICT_16x16_DC(dcsplat);
-}
-
-static void FUNCC(pred16x16_left_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i, dc=0;
-    pixel *src = (pixel*)_src;
-    pixel4 dcsplat;
-    stride /= sizeof(pixel);
-
-    for(i=0;i<16; i++){
-        dc+= src[-1+i*stride];
-    }
-
-    dcsplat = PIXEL_SPLAT_X4((dc+8)>>4);
-    PREDICT_16x16_DC(dcsplat);
-}
-
-static void FUNCC(pred16x16_top_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i, dc=0;
-    pixel *src = (pixel*)_src;
-    pixel4 dcsplat;
-    stride /= sizeof(pixel);
-
-    for(i=0;i<16; i++){
-        dc+= src[i-stride];
-    }
-
-    dcsplat = PIXEL_SPLAT_X4((dc+8)>>4);
-    PREDICT_16x16_DC(dcsplat);
-}
-
-#define PRED16x16_X(n, v) \
-static void FUNCC(pred16x16_##n##_dc)(uint8_t *_src, ptrdiff_t stride)\
-{\
-    int i;\
-    pixel *src = (pixel*)_src;\
-    stride /= sizeof(pixel);\
-    PREDICT_16x16_DC(PIXEL_SPLAT_X4(v));\
-}
-
-PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1)
-PRED16x16_X(128, (1<<(BIT_DEPTH-1))+0)
-PRED16x16_X(129, (1<<(BIT_DEPTH-1))+1)
-
-static inline void FUNCC(pred16x16_plane_compat)(uint8_t *_src,
-                                                 ptrdiff_t _stride,
-                                                 const int svq3,
-                                                 const int rv40)
-{
-  int i, j, k;
-  int a;
-  INIT_CLIP
-  pixel *src = (pixel*)_src;
-  int stride = _stride/sizeof(pixel);
-  const pixel * const src0 = src +7-stride;
-  const pixel *       src1 = src +8*stride-1;
-  const pixel *       src2 = src1-2*stride;    // == src+6*stride-1;
-  int H = src0[1] - src0[-1];
-  int V = src1[0] - src2[ 0];
-  for(k=2; k<=8; ++k) {
-    src1 += stride; src2 -= stride;
-    H += k*(src0[k] - src0[-k]);
-    V += k*(src1[0] - src2[ 0]);
-  }
-  if(svq3){
-    H = ( 5*(H/4) ) / 16;
-    V = ( 5*(V/4) ) / 16;
-
-    /* required for 100% accuracy */
-    i = H; H = V; V = i;
-  }else if(rv40){
-    H = ( H + (H>>2) ) >> 4;
-    V = ( V + (V>>2) ) >> 4;
-  }else{
-    H = ( 5*H+32 ) >> 6;
-    V = ( 5*V+32 ) >> 6;
-  }
-
-  a = 16*(src1[0] + src2[16] + 1) - 7*(V+H);
-  for(j=16; j>0; --j) {
-    int b = a;
-    a += V;
-    for(i=-16; i<0; i+=4) {
-      src[16+i] = CLIP((b    ) >> 5);
-      src[17+i] = CLIP((b+  H) >> 5);
-      src[18+i] = CLIP((b+2*H) >> 5);
-      src[19+i] = CLIP((b+3*H) >> 5);
-      b += 4*H;
-    }
-    src += stride;
-  }
-}
-
-static void FUNCC(pred16x16_plane)(uint8_t *src, ptrdiff_t stride)
-{
-    FUNCC(pred16x16_plane_compat)(src, stride, 0, 0);
-}
-
-static void FUNCC(pred8x8_vertical)(uint8_t *_src, ptrdiff_t _stride)
-{
-    int i;
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    const pixel4 a= AV_RN4PA(((pixel4*)(src-stride))+0);
-    const pixel4 b= AV_RN4PA(((pixel4*)(src-stride))+1);
-
-    for(i=0; i<8; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, b);
-    }
-}
-
-static void FUNCC(pred8x16_vertical)(uint8_t *_src, ptrdiff_t _stride)
-{
-    int i;
-    pixel *src = (pixel*)_src;
-    int stride = _stride>>(sizeof(pixel)-1);
-    const pixel4 a= AV_RN4PA(((pixel4*)(src-stride))+0);
-    const pixel4 b= AV_RN4PA(((pixel4*)(src-stride))+1);
-
-    for(i=0; i<16; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, b);
-    }
-}
-
-static void FUNCC(pred8x8_horizontal)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i;
-    pixel *src = (pixel*)_src;
-    stride /= sizeof(pixel);
-
-    for(i=0; i<8; i++){
-        const pixel4 a = PIXEL_SPLAT_X4(src[-1+i*stride]);
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, a);
-    }
-}
-
-static void FUNCC(pred8x16_horizontal)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i;
-    pixel *src = (pixel*)_src;
-    stride >>= sizeof(pixel)-1;
-    for(i=0; i<16; i++){
-        const pixel4 a = PIXEL_SPLAT_X4(src[-1+i*stride]);
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, a);
-    }
-}
-
-#define PRED8x8_X(n, v)\
-static void FUNCC(pred8x8_##n##_dc)(uint8_t *_src, ptrdiff_t stride)\
-{\
-    int i;\
-    const pixel4 a = PIXEL_SPLAT_X4(v);\
-    pixel *src = (pixel*)_src;\
-    stride /= sizeof(pixel);\
-    for(i=0; i<8; i++){\
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);\
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, a);\
-    }\
-}
-
-PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1)
-PRED8x8_X(128, (1<<(BIT_DEPTH-1))+0)
-PRED8x8_X(129, (1<<(BIT_DEPTH-1))+1)
-
-static void FUNCC(pred8x16_128_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    FUNCC(pred8x8_128_dc)(_src, stride);
-    FUNCC(pred8x8_128_dc)(_src+8*stride, stride);
-}
-
-static void FUNCC(pred8x8_left_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i;
-    int dc0, dc2;
-    pixel4 dc0splat, dc2splat;
-    pixel *src = (pixel*)_src;
-    stride /= sizeof(pixel);
-
-    dc0=dc2=0;
-    for(i=0;i<4; i++){
-        dc0+= src[-1+i*stride];
-        dc2+= src[-1+(i+4)*stride];
-    }
-    dc0splat = PIXEL_SPLAT_X4((dc0 + 2)>>2);
-    dc2splat = PIXEL_SPLAT_X4((dc2 + 2)>>2);
-
-    for(i=0; i<4; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc0splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc0splat);
-    }
-    for(i=4; i<8; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc2splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc2splat);
-    }
-}
-
-static void FUNCC(pred8x16_left_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    FUNCC(pred8x8_left_dc)(_src, stride);
-    FUNCC(pred8x8_left_dc)(_src+8*stride, stride);
-}
-
-static void FUNCC(pred8x8_top_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i;
-    int dc0, dc1;
-    pixel4 dc0splat, dc1splat;
-    pixel *src = (pixel*)_src;
-    stride /= sizeof(pixel);
-
-    dc0=dc1=0;
-    for(i=0;i<4; i++){
-        dc0+= src[i-stride];
-        dc1+= src[4+i-stride];
-    }
-    dc0splat = PIXEL_SPLAT_X4((dc0 + 2)>>2);
-    dc1splat = PIXEL_SPLAT_X4((dc1 + 2)>>2);
-
-    for(i=0; i<4; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc0splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc1splat);
-    }
-    for(i=4; i<8; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc0splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc1splat);
-    }
-}
-
-static void FUNCC(pred8x16_top_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i;
-    int dc0, dc1;
-    pixel4 dc0splat, dc1splat;
-    pixel *src = (pixel*)_src;
-    stride >>= sizeof(pixel)-1;
-
-    dc0=dc1=0;
-    for(i=0;i<4; i++){
-        dc0+= src[i-stride];
-        dc1+= src[4+i-stride];
-    }
-    dc0splat = PIXEL_SPLAT_X4((dc0 + 2)>>2);
-    dc1splat = PIXEL_SPLAT_X4((dc1 + 2)>>2);
-
-    for(i=0; i<16; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc0splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc1splat);
-    }
-}
-
-static void FUNCC(pred8x8_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i;
-    int dc0, dc1, dc2;
-    pixel4 dc0splat, dc1splat, dc2splat, dc3splat;
-    pixel *src = (pixel*)_src;
-    stride /= sizeof(pixel);
-
-    dc0=dc1=dc2=0;
-    for(i=0;i<4; i++){
-        dc0+= src[-1+i*stride] + src[i-stride];
-        dc1+= src[4+i-stride];
-        dc2+= src[-1+(i+4)*stride];
-    }
-    dc0splat = PIXEL_SPLAT_X4((dc0 + 4)>>3);
-    dc1splat = PIXEL_SPLAT_X4((dc1 + 2)>>2);
-    dc2splat = PIXEL_SPLAT_X4((dc2 + 2)>>2);
-    dc3splat = PIXEL_SPLAT_X4((dc1 + dc2 + 4)>>3);
-
-    for(i=0; i<4; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc0splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc1splat);
-    }
-    for(i=4; i<8; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc2splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc3splat);
-    }
-}
-
-static void FUNCC(pred8x16_dc)(uint8_t *_src, ptrdiff_t stride)
-{
-    int i;
-    int dc0, dc1, dc2, dc3, dc4;
-    pixel4 dc0splat, dc1splat, dc2splat, dc3splat, dc4splat, dc5splat, dc6splat, dc7splat;
-    pixel *src = (pixel*)_src;
-    stride >>= sizeof(pixel)-1;
-
-    dc0=dc1=dc2=dc3=dc4=0;
-    for(i=0;i<4; i++){
-        dc0+= src[-1+i*stride] + src[i-stride];
-        dc1+= src[4+i-stride];
-        dc2+= src[-1+(i+4)*stride];
-        dc3+= src[-1+(i+8)*stride];
-        dc4+= src[-1+(i+12)*stride];
-    }
-    dc0splat = PIXEL_SPLAT_X4((dc0 + 4)>>3);
-    dc1splat = PIXEL_SPLAT_X4((dc1 + 2)>>2);
-    dc2splat = PIXEL_SPLAT_X4((dc2 + 2)>>2);
-    dc3splat = PIXEL_SPLAT_X4((dc1 + dc2 + 4)>>3);
-    dc4splat = PIXEL_SPLAT_X4((dc3 + 2)>>2);
-    dc5splat = PIXEL_SPLAT_X4((dc1 + dc3 + 4)>>3);
-    dc6splat = PIXEL_SPLAT_X4((dc4 + 2)>>2);
-    dc7splat = PIXEL_SPLAT_X4((dc1 + dc4 + 4)>>3);
-
-    for(i=0; i<4; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc0splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc1splat);
-    }
-    for(i=4; i<8; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc2splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc3splat);
-    }
-    for(i=8; i<12; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc4splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc5splat);
-    }
-    for(i=12; i<16; i++){
-        AV_WN4PA(((pixel4*)(src+i*stride))+0, dc6splat);
-        AV_WN4PA(((pixel4*)(src+i*stride))+1, dc7splat);
-    }
-}
-
-static void FUNC(pred8x8_mad_cow_dc_l0t)(uint8_t *src, ptrdiff_t stride)
-{
-    FUNCC(pred8x8_top_dc)(src, stride);
-    FUNCC(pred4x4_dc)(src, NULL, stride);
-}
-
-static void FUNC(pred8x16_mad_cow_dc_l0t)(uint8_t *src, ptrdiff_t stride)
-{
-    FUNCC(pred8x16_top_dc)(src, stride);
-    FUNCC(pred4x4_dc)(src, NULL, stride);
-}
-
-static void FUNC(pred8x8_mad_cow_dc_0lt)(uint8_t *src, ptrdiff_t stride)
-{
-    FUNCC(pred8x8_dc)(src, stride);
-    FUNCC(pred4x4_top_dc)(src, NULL, stride);
-}
-
-static void FUNC(pred8x16_mad_cow_dc_0lt)(uint8_t *src, ptrdiff_t stride)
-{
-    FUNCC(pred8x16_dc)(src, stride);
-    FUNCC(pred4x4_top_dc)(src, NULL, stride);
-}
-
-static void FUNC(pred8x8_mad_cow_dc_l00)(uint8_t *src, ptrdiff_t stride)
-{
-    FUNCC(pred8x8_left_dc)(src, stride);
-    FUNCC(pred4x4_128_dc)(src + 4*stride                  , NULL, stride);
-    FUNCC(pred4x4_128_dc)(src + 4*stride + 4*sizeof(pixel), NULL, stride);
-}
-
-static void FUNC(pred8x16_mad_cow_dc_l00)(uint8_t *src, ptrdiff_t stride)
-{
-    FUNCC(pred8x16_left_dc)(src, stride);
-    FUNCC(pred4x4_128_dc)(src + 4*stride                  , NULL, stride);
-    FUNCC(pred4x4_128_dc)(src + 4*stride + 4*sizeof(pixel), NULL, stride);
-}
-
-static void FUNC(pred8x8_mad_cow_dc_0l0)(uint8_t *src, ptrdiff_t stride)
-{
-    FUNCC(pred8x8_left_dc)(src, stride);
-    FUNCC(pred4x4_128_dc)(src                  , NULL, stride);
-    FUNCC(pred4x4_128_dc)(src + 4*sizeof(pixel), NULL, stride);
-}
-
-static void FUNC(pred8x16_mad_cow_dc_0l0)(uint8_t *src, ptrdiff_t stride)
-{
-    FUNCC(pred8x16_left_dc)(src, stride);
-    FUNCC(pred4x4_128_dc)(src                  , NULL, stride);
-    FUNCC(pred4x4_128_dc)(src + 4*sizeof(pixel), NULL, stride);
-}
-
-static void FUNCC(pred8x8_plane)(uint8_t *_src, ptrdiff_t _stride)
-{
-  int j, k;
-  int a;
-  INIT_CLIP
-  pixel *src = (pixel*)_src;
-  int stride = _stride/sizeof(pixel);
-  const pixel * const src0 = src +3-stride;
-  const pixel *       src1 = src +4*stride-1;
-  const pixel *       src2 = src1-2*stride;    // == src+2*stride-1;
-  int H = src0[1] - src0[-1];
-  int V = src1[0] - src2[ 0];
-  for(k=2; k<=4; ++k) {
-    src1 += stride; src2 -= stride;
-    H += k*(src0[k] - src0[-k]);
-    V += k*(src1[0] - src2[ 0]);
-  }
-  H = ( 17*H+16 ) >> 5;
-  V = ( 17*V+16 ) >> 5;
-
-  a = 16*(src1[0] + src2[8]+1) - 3*(V+H);
-  for(j=8; j>0; --j) {
-    int b = a;
-    a += V;
-    src[0] = CLIP((b    ) >> 5);
-    src[1] = CLIP((b+  H) >> 5);
-    src[2] = CLIP((b+2*H) >> 5);
-    src[3] = CLIP((b+3*H) >> 5);
-    src[4] = CLIP((b+4*H) >> 5);
-    src[5] = CLIP((b+5*H) >> 5);
-    src[6] = CLIP((b+6*H) >> 5);
-    src[7] = CLIP((b+7*H) >> 5);
-    src += stride;
-  }
-}
-
-static void FUNCC(pred8x16_plane)(uint8_t *_src, ptrdiff_t _stride)
-{
-  int j, k;
-  int a;
-  INIT_CLIP
-  pixel *src = (pixel*)_src;
-  int stride = _stride>>(sizeof(pixel)-1);
-  const pixel * const src0 = src +3-stride;
-  const pixel *       src1 = src +8*stride-1;
-  const pixel *       src2 = src1-2*stride;    // == src+6*stride-1;
-  int H = src0[1] - src0[-1];
-  int V = src1[0] - src2[ 0];
-
-  for (k = 2; k <= 4; ++k) {
-      src1 += stride; src2 -= stride;
-      H += k*(src0[k] - src0[-k]);
-      V += k*(src1[0] - src2[ 0]);
-  }
-  for (; k <= 8; ++k) {
-      src1 += stride; src2 -= stride;
-      V += k*(src1[0] - src2[0]);
-  }
-
-  H = (17*H+16) >> 5;
-  V = (5*V+32) >> 6;
-
-  a = 16*(src1[0] + src2[8] + 1) - 7*V - 3*H;
-  for(j=16; j>0; --j) {
-    int b = a;
-    a += V;
-    src[0] = CLIP((b    ) >> 5);
-    src[1] = CLIP((b+  H) >> 5);
-    src[2] = CLIP((b+2*H) >> 5);
-    src[3] = CLIP((b+3*H) >> 5);
-    src[4] = CLIP((b+4*H) >> 5);
-    src[5] = CLIP((b+5*H) >> 5);
-    src[6] = CLIP((b+6*H) >> 5);
-    src[7] = CLIP((b+7*H) >> 5);
-    src += stride;
-  }
-}
-
-#define SRC(x,y) src[(x)+(y)*stride]
-#define PL(y) \
-    const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
-#define PREDICT_8x8_LOAD_LEFT \
-    const int l0 = ((has_topleft ? SRC(-1,-1) : SRC(-1,0)) \
-                     + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \
-    PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \
-    const int l7 av_unused = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2
-
-#define PT(x) \
-    const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
-#define PREDICT_8x8_LOAD_TOP \
-    const int t0 = ((has_topleft ? SRC(-1,-1) : SRC(0,-1)) \
-                     + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \
-    PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \
-    const int t7 av_unused = ((has_topright ? SRC(8,-1) : SRC(7,-1)) \
-                     + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2
-
-#define PTR(x) \
-    t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
-#define PREDICT_8x8_LOAD_TOPRIGHT \
-    int t8, t9, t10, t11, t12, t13, t14, t15; \
-    if(has_topright) { \
-        PTR(8) PTR(9) PTR(10) PTR(11) PTR(12) PTR(13) PTR(14) \
-        t15 = (SRC(14,-1) + 3*SRC(15,-1) + 2) >> 2; \
-    } else t8=t9=t10=t11=t12=t13=t14=t15= SRC(7,-1);
-
-#define PREDICT_8x8_LOAD_TOPLEFT \
-    const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2
-
-#define PREDICT_8x8_DC(v) \
-    int y; \
-    for( y = 0; y < 8; y++ ) { \
-        AV_WN4PA(((pixel4*)src)+0, v); \
-        AV_WN4PA(((pixel4*)src)+1, v); \
-        src += stride; \
-    }
-
-static void FUNCC(pred8x8l_128_dc)(uint8_t *_src, int has_topleft,
-                                   int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-
-    PREDICT_8x8_DC(PIXEL_SPLAT_X4(1<<(BIT_DEPTH-1)));
-}
-static void FUNCC(pred8x8l_left_dc)(uint8_t *_src, int has_topleft,
-                                    int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-
-    PREDICT_8x8_LOAD_LEFT;
-    const pixel4 dc = PIXEL_SPLAT_X4((l0+l1+l2+l3+l4+l5+l6+l7+4) >> 3);
-    PREDICT_8x8_DC(dc);
-}
-static void FUNCC(pred8x8l_top_dc)(uint8_t *_src, int has_topleft,
-                                   int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-
-    PREDICT_8x8_LOAD_TOP;
-    const pixel4 dc = PIXEL_SPLAT_X4((t0+t1+t2+t3+t4+t5+t6+t7+4) >> 3);
-    PREDICT_8x8_DC(dc);
-}
-static void FUNCC(pred8x8l_dc)(uint8_t *_src, int has_topleft,
-                               int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-
-    PREDICT_8x8_LOAD_LEFT;
-    PREDICT_8x8_LOAD_TOP;
-    const pixel4 dc = PIXEL_SPLAT_X4((l0+l1+l2+l3+l4+l5+l6+l7
-                                     +t0+t1+t2+t3+t4+t5+t6+t7+8) >> 4);
-    PREDICT_8x8_DC(dc);
-}
-static void FUNCC(pred8x8l_horizontal)(uint8_t *_src, int has_topleft,
-                                       int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    pixel4 a;
-
-    PREDICT_8x8_LOAD_LEFT;
-#define ROW(y) a = PIXEL_SPLAT_X4(l##y); \
-               AV_WN4PA(src+y*stride, a); \
-               AV_WN4PA(src+y*stride+4, a);
-    ROW(0); ROW(1); ROW(2); ROW(3); ROW(4); ROW(5); ROW(6); ROW(7);
-#undef ROW
-}
-static void FUNCC(pred8x8l_vertical)(uint8_t *_src, int has_topleft,
-                                     int has_topright, ptrdiff_t _stride)
-{
-    int y;
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    pixel4 a, b;
-
-    PREDICT_8x8_LOAD_TOP;
-    src[0] = t0;
-    src[1] = t1;
-    src[2] = t2;
-    src[3] = t3;
-    src[4] = t4;
-    src[5] = t5;
-    src[6] = t6;
-    src[7] = t7;
-    a = AV_RN4PA(((pixel4*)src)+0);
-    b = AV_RN4PA(((pixel4*)src)+1);
-    for( y = 1; y < 8; y++ ) {
-        AV_WN4PA(((pixel4*)(src+y*stride))+0, a);
-        AV_WN4PA(((pixel4*)(src+y*stride))+1, b);
-    }
-}
-static void FUNCC(pred8x8l_down_left)(uint8_t *_src, int has_topleft,
-                                      int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    PREDICT_8x8_LOAD_TOP;
-    PREDICT_8x8_LOAD_TOPRIGHT;
-    SRC(0,0)= (t0 + 2*t1 + t2 + 2) >> 2;
-    SRC(0,1)=SRC(1,0)= (t1 + 2*t2 + t3 + 2) >> 2;
-    SRC(0,2)=SRC(1,1)=SRC(2,0)= (t2 + 2*t3 + t4 + 2) >> 2;
-    SRC(0,3)=SRC(1,2)=SRC(2,1)=SRC(3,0)= (t3 + 2*t4 + t5 + 2) >> 2;
-    SRC(0,4)=SRC(1,3)=SRC(2,2)=SRC(3,1)=SRC(4,0)= (t4 + 2*t5 + t6 + 2) >> 2;
-    SRC(0,5)=SRC(1,4)=SRC(2,3)=SRC(3,2)=SRC(4,1)=SRC(5,0)= (t5 + 2*t6 + t7 + 2) >> 2;
-    SRC(0,6)=SRC(1,5)=SRC(2,4)=SRC(3,3)=SRC(4,2)=SRC(5,1)=SRC(6,0)= (t6 + 2*t7 + t8 + 2) >> 2;
-    SRC(0,7)=SRC(1,6)=SRC(2,5)=SRC(3,4)=SRC(4,3)=SRC(5,2)=SRC(6,1)=SRC(7,0)= (t7 + 2*t8 + t9 + 2) >> 2;
-    SRC(1,7)=SRC(2,6)=SRC(3,5)=SRC(4,4)=SRC(5,3)=SRC(6,2)=SRC(7,1)= (t8 + 2*t9 + t10 + 2) >> 2;
-    SRC(2,7)=SRC(3,6)=SRC(4,5)=SRC(5,4)=SRC(6,3)=SRC(7,2)= (t9 + 2*t10 + t11 + 2) >> 2;
-    SRC(3,7)=SRC(4,6)=SRC(5,5)=SRC(6,4)=SRC(7,3)= (t10 + 2*t11 + t12 + 2) >> 2;
-    SRC(4,7)=SRC(5,6)=SRC(6,5)=SRC(7,4)= (t11 + 2*t12 + t13 + 2) >> 2;
-    SRC(5,7)=SRC(6,6)=SRC(7,5)= (t12 + 2*t13 + t14 + 2) >> 2;
-    SRC(6,7)=SRC(7,6)= (t13 + 2*t14 + t15 + 2) >> 2;
-    SRC(7,7)= (t14 + 3*t15 + 2) >> 2;
-}
-static void FUNCC(pred8x8l_down_right)(uint8_t *_src, int has_topleft,
-                                       int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    PREDICT_8x8_LOAD_TOP;
-    PREDICT_8x8_LOAD_LEFT;
-    PREDICT_8x8_LOAD_TOPLEFT;
-    SRC(0,7)= (l7 + 2*l6 + l5 + 2) >> 2;
-    SRC(0,6)=SRC(1,7)= (l6 + 2*l5 + l4 + 2) >> 2;
-    SRC(0,5)=SRC(1,6)=SRC(2,7)= (l5 + 2*l4 + l3 + 2) >> 2;
-    SRC(0,4)=SRC(1,5)=SRC(2,6)=SRC(3,7)= (l4 + 2*l3 + l2 + 2) >> 2;
-    SRC(0,3)=SRC(1,4)=SRC(2,5)=SRC(3,6)=SRC(4,7)= (l3 + 2*l2 + l1 + 2) >> 2;
-    SRC(0,2)=SRC(1,3)=SRC(2,4)=SRC(3,5)=SRC(4,6)=SRC(5,7)= (l2 + 2*l1 + l0 + 2) >> 2;
-    SRC(0,1)=SRC(1,2)=SRC(2,3)=SRC(3,4)=SRC(4,5)=SRC(5,6)=SRC(6,7)= (l1 + 2*l0 + lt + 2) >> 2;
-    SRC(0,0)=SRC(1,1)=SRC(2,2)=SRC(3,3)=SRC(4,4)=SRC(5,5)=SRC(6,6)=SRC(7,7)= (l0 + 2*lt + t0 + 2) >> 2;
-    SRC(1,0)=SRC(2,1)=SRC(3,2)=SRC(4,3)=SRC(5,4)=SRC(6,5)=SRC(7,6)= (lt + 2*t0 + t1 + 2) >> 2;
-    SRC(2,0)=SRC(3,1)=SRC(4,2)=SRC(5,3)=SRC(6,4)=SRC(7,5)= (t0 + 2*t1 + t2 + 2) >> 2;
-    SRC(3,0)=SRC(4,1)=SRC(5,2)=SRC(6,3)=SRC(7,4)= (t1 + 2*t2 + t3 + 2) >> 2;
-    SRC(4,0)=SRC(5,1)=SRC(6,2)=SRC(7,3)= (t2 + 2*t3 + t4 + 2) >> 2;
-    SRC(5,0)=SRC(6,1)=SRC(7,2)= (t3 + 2*t4 + t5 + 2) >> 2;
-    SRC(6,0)=SRC(7,1)= (t4 + 2*t5 + t6 + 2) >> 2;
-    SRC(7,0)= (t5 + 2*t6 + t7 + 2) >> 2;
-}
-static void FUNCC(pred8x8l_vertical_right)(uint8_t *_src, int has_topleft,
-                                           int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    PREDICT_8x8_LOAD_TOP;
-    PREDICT_8x8_LOAD_LEFT;
-    PREDICT_8x8_LOAD_TOPLEFT;
-    SRC(0,6)= (l5 + 2*l4 + l3 + 2) >> 2;
-    SRC(0,7)= (l6 + 2*l5 + l4 + 2) >> 2;
-    SRC(0,4)=SRC(1,6)= (l3 + 2*l2 + l1 + 2) >> 2;
-    SRC(0,5)=SRC(1,7)= (l4 + 2*l3 + l2 + 2) >> 2;
-    SRC(0,2)=SRC(1,4)=SRC(2,6)= (l1 + 2*l0 + lt + 2) >> 2;
-    SRC(0,3)=SRC(1,5)=SRC(2,7)= (l2 + 2*l1 + l0 + 2) >> 2;
-    SRC(0,1)=SRC(1,3)=SRC(2,5)=SRC(3,7)= (l0 + 2*lt + t0 + 2) >> 2;
-    SRC(0,0)=SRC(1,2)=SRC(2,4)=SRC(3,6)= (lt + t0 + 1) >> 1;
-    SRC(1,1)=SRC(2,3)=SRC(3,5)=SRC(4,7)= (lt + 2*t0 + t1 + 2) >> 2;
-    SRC(1,0)=SRC(2,2)=SRC(3,4)=SRC(4,6)= (t0 + t1 + 1) >> 1;
-    SRC(2,1)=SRC(3,3)=SRC(4,5)=SRC(5,7)= (t0 + 2*t1 + t2 + 2) >> 2;
-    SRC(2,0)=SRC(3,2)=SRC(4,4)=SRC(5,6)= (t1 + t2 + 1) >> 1;
-    SRC(3,1)=SRC(4,3)=SRC(5,5)=SRC(6,7)= (t1 + 2*t2 + t3 + 2) >> 2;
-    SRC(3,0)=SRC(4,2)=SRC(5,4)=SRC(6,6)= (t2 + t3 + 1) >> 1;
-    SRC(4,1)=SRC(5,3)=SRC(6,5)=SRC(7,7)= (t2 + 2*t3 + t4 + 2) >> 2;
-    SRC(4,0)=SRC(5,2)=SRC(6,4)=SRC(7,6)= (t3 + t4 + 1) >> 1;
-    SRC(5,1)=SRC(6,3)=SRC(7,5)= (t3 + 2*t4 + t5 + 2) >> 2;
-    SRC(5,0)=SRC(6,2)=SRC(7,4)= (t4 + t5 + 1) >> 1;
-    SRC(6,1)=SRC(7,3)= (t4 + 2*t5 + t6 + 2) >> 2;
-    SRC(6,0)=SRC(7,2)= (t5 + t6 + 1) >> 1;
-    SRC(7,1)= (t5 + 2*t6 + t7 + 2) >> 2;
-    SRC(7,0)= (t6 + t7 + 1) >> 1;
-}
-static void FUNCC(pred8x8l_horizontal_down)(uint8_t *_src, int has_topleft,
-                                            int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    PREDICT_8x8_LOAD_TOP;
-    PREDICT_8x8_LOAD_LEFT;
-    PREDICT_8x8_LOAD_TOPLEFT;
-    SRC(0,7)= (l6 + l7 + 1) >> 1;
-    SRC(1,7)= (l5 + 2*l6 + l7 + 2) >> 2;
-    SRC(0,6)=SRC(2,7)= (l5 + l6 + 1) >> 1;
-    SRC(1,6)=SRC(3,7)= (l4 + 2*l5 + l6 + 2) >> 2;
-    SRC(0,5)=SRC(2,6)=SRC(4,7)= (l4 + l5 + 1) >> 1;
-    SRC(1,5)=SRC(3,6)=SRC(5,7)= (l3 + 2*l4 + l5 + 2) >> 2;
-    SRC(0,4)=SRC(2,5)=SRC(4,6)=SRC(6,7)= (l3 + l4 + 1) >> 1;
-    SRC(1,4)=SRC(3,5)=SRC(5,6)=SRC(7,7)= (l2 + 2*l3 + l4 + 2) >> 2;
-    SRC(0,3)=SRC(2,4)=SRC(4,5)=SRC(6,6)= (l2 + l3 + 1) >> 1;
-    SRC(1,3)=SRC(3,4)=SRC(5,5)=SRC(7,6)= (l1 + 2*l2 + l3 + 2) >> 2;
-    SRC(0,2)=SRC(2,3)=SRC(4,4)=SRC(6,5)= (l1 + l2 + 1) >> 1;
-    SRC(1,2)=SRC(3,3)=SRC(5,4)=SRC(7,5)= (l0 + 2*l1 + l2 + 2) >> 2;
-    SRC(0,1)=SRC(2,2)=SRC(4,3)=SRC(6,4)= (l0 + l1 + 1) >> 1;
-    SRC(1,1)=SRC(3,2)=SRC(5,3)=SRC(7,4)= (lt + 2*l0 + l1 + 2) >> 2;
-    SRC(0,0)=SRC(2,1)=SRC(4,2)=SRC(6,3)= (lt + l0 + 1) >> 1;
-    SRC(1,0)=SRC(3,1)=SRC(5,2)=SRC(7,3)= (l0 + 2*lt + t0 + 2) >> 2;
-    SRC(2,0)=SRC(4,1)=SRC(6,2)= (t1 + 2*t0 + lt + 2) >> 2;
-    SRC(3,0)=SRC(5,1)=SRC(7,2)= (t2 + 2*t1 + t0 + 2) >> 2;
-    SRC(4,0)=SRC(6,1)= (t3 + 2*t2 + t1 + 2) >> 2;
-    SRC(5,0)=SRC(7,1)= (t4 + 2*t3 + t2 + 2) >> 2;
-    SRC(6,0)= (t5 + 2*t4 + t3 + 2) >> 2;
-    SRC(7,0)= (t6 + 2*t5 + t4 + 2) >> 2;
-}
-static void FUNCC(pred8x8l_vertical_left)(uint8_t *_src, int has_topleft,
-                                          int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    PREDICT_8x8_LOAD_TOP;
-    PREDICT_8x8_LOAD_TOPRIGHT;
-    SRC(0,0)= (t0 + t1 + 1) >> 1;
-    SRC(0,1)= (t0 + 2*t1 + t2 + 2) >> 2;
-    SRC(0,2)=SRC(1,0)= (t1 + t2 + 1) >> 1;
-    SRC(0,3)=SRC(1,1)= (t1 + 2*t2 + t3 + 2) >> 2;
-    SRC(0,4)=SRC(1,2)=SRC(2,0)= (t2 + t3 + 1) >> 1;
-    SRC(0,5)=SRC(1,3)=SRC(2,1)= (t2 + 2*t3 + t4 + 2) >> 2;
-    SRC(0,6)=SRC(1,4)=SRC(2,2)=SRC(3,0)= (t3 + t4 + 1) >> 1;
-    SRC(0,7)=SRC(1,5)=SRC(2,3)=SRC(3,1)= (t3 + 2*t4 + t5 + 2) >> 2;
-    SRC(1,6)=SRC(2,4)=SRC(3,2)=SRC(4,0)= (t4 + t5 + 1) >> 1;
-    SRC(1,7)=SRC(2,5)=SRC(3,3)=SRC(4,1)= (t4 + 2*t5 + t6 + 2) >> 2;
-    SRC(2,6)=SRC(3,4)=SRC(4,2)=SRC(5,0)= (t5 + t6 + 1) >> 1;
-    SRC(2,7)=SRC(3,5)=SRC(4,3)=SRC(5,1)= (t5 + 2*t6 + t7 + 2) >> 2;
-    SRC(3,6)=SRC(4,4)=SRC(5,2)=SRC(6,0)= (t6 + t7 + 1) >> 1;
-    SRC(3,7)=SRC(4,5)=SRC(5,3)=SRC(6,1)= (t6 + 2*t7 + t8 + 2) >> 2;
-    SRC(4,6)=SRC(5,4)=SRC(6,2)=SRC(7,0)= (t7 + t8 + 1) >> 1;
-    SRC(4,7)=SRC(5,5)=SRC(6,3)=SRC(7,1)= (t7 + 2*t8 + t9 + 2) >> 2;
-    SRC(5,6)=SRC(6,4)=SRC(7,2)= (t8 + t9 + 1) >> 1;
-    SRC(5,7)=SRC(6,5)=SRC(7,3)= (t8 + 2*t9 + t10 + 2) >> 2;
-    SRC(6,6)=SRC(7,4)= (t9 + t10 + 1) >> 1;
-    SRC(6,7)=SRC(7,5)= (t9 + 2*t10 + t11 + 2) >> 2;
-    SRC(7,6)= (t10 + t11 + 1) >> 1;
-    SRC(7,7)= (t10 + 2*t11 + t12 + 2) >> 2;
-}
-static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft,
-                                          int has_topright, ptrdiff_t _stride)
-{
-    pixel *src = (pixel*)_src;
-    int stride = _stride/sizeof(pixel);
-    PREDICT_8x8_LOAD_LEFT;
-    SRC(0,0)= (l0 + l1 + 1) >> 1;
-    SRC(1,0)= (l0 + 2*l1 + l2 + 2) >> 2;
-    SRC(0,1)=SRC(2,0)= (l1 + l2 + 1) >> 1;
-    SRC(1,1)=SRC(3,0)= (l1 + 2*l2 + l3 + 2) >> 2;
-    SRC(0,2)=SRC(2,1)=SRC(4,0)= (l2 + l3 + 1) >> 1;
-    SRC(1,2)=SRC(3,1)=SRC(5,0)= (l2 + 2*l3 + l4 + 2) >> 2;
-    SRC(0,3)=SRC(2,2)=SRC(4,1)=SRC(6,0)= (l3 + l4 + 1) >> 1;
-    SRC(1,3)=SRC(3,2)=SRC(5,1)=SRC(7,0)= (l3 + 2*l4 + l5 + 2) >> 2;
-    SRC(0,4)=SRC(2,3)=SRC(4,2)=SRC(6,1)= (l4 + l5 + 1) >> 1;
-    SRC(1,4)=SRC(3,3)=SRC(5,2)=SRC(7,1)= (l4 + 2*l5 + l6 + 2) >> 2;
-    SRC(0,5)=SRC(2,4)=SRC(4,3)=SRC(6,2)= (l5 + l6 + 1) >> 1;
-    SRC(1,5)=SRC(3,4)=SRC(5,3)=SRC(7,2)= (l5 + 2*l6 + l7 + 2) >> 2;
-    SRC(0,6)=SRC(2,5)=SRC(4,4)=SRC(6,3)= (l6 + l7 + 1) >> 1;
-    SRC(1,6)=SRC(3,5)=SRC(5,4)=SRC(7,3)= (l6 + 3*l7 + 2) >> 2;
-    SRC(0,7)=SRC(1,7)=SRC(2,6)=SRC(2,7)=SRC(3,6)=
-    SRC(3,7)=SRC(4,5)=SRC(4,6)=SRC(4,7)=SRC(5,5)=
-    SRC(5,6)=SRC(5,7)=SRC(6,4)=SRC(6,5)=SRC(6,6)=
-    SRC(6,7)=SRC(7,4)=SRC(7,5)=SRC(7,6)=SRC(7,7)= l7;
-}
-#undef PREDICT_8x8_LOAD_LEFT
-#undef PREDICT_8x8_LOAD_TOP
-#undef PREDICT_8x8_LOAD_TOPLEFT
-#undef PREDICT_8x8_LOAD_TOPRIGHT
-#undef PREDICT_8x8_DC
-#undef PTR
-#undef PT
-#undef PL
-#undef SRC
-
-static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, int16_t *_block,
-                                        ptrdiff_t stride)
-{
-    int i;
-    pixel *pix = (pixel*)_pix;
-    const dctcoef *block = (const dctcoef*)_block;
-    stride /= sizeof(pixel);
-    pix -= stride;
-    for(i=0; i<4; i++){
-        pixel v = pix[0];
-        pix[1*stride]= v += block[0];
-        pix[2*stride]= v += block[4];
-        pix[3*stride]= v += block[8];
-        pix[4*stride]= v +  block[12];
-        pix++;
-        block++;
-    }
-
-    memset(_block, 0, sizeof(dctcoef) * 16);
-}
-
-static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, int16_t *_block,
-                                          ptrdiff_t stride)
-{
-    int i;
-    pixel *pix = (pixel*)_pix;
-    const dctcoef *block = (const dctcoef*)_block;
-    stride /= sizeof(pixel);
-    for(i=0; i<4; i++){
-        pixel v = pix[-1];
-        pix[0]= v += block[0];
-        pix[1]= v += block[1];
-        pix[2]= v += block[2];
-        pix[3]= v +  block[3];
-        pix+= stride;
-        block+= 4;
-    }
-
-    memset(_block, 0, sizeof(dctcoef) * 16);
-}
-
-static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, int16_t *_block,
-                                         ptrdiff_t stride)
-{
-    int i;
-    pixel *pix = (pixel*)_pix;
-    const dctcoef *block = (const dctcoef*)_block;
-    stride /= sizeof(pixel);
-    pix -= stride;
-    for(i=0; i<8; i++){
-        pixel v = pix[0];
-        pix[1*stride]= v += block[0];
-        pix[2*stride]= v += block[8];
-        pix[3*stride]= v += block[16];
-        pix[4*stride]= v += block[24];
-        pix[5*stride]= v += block[32];
-        pix[6*stride]= v += block[40];
-        pix[7*stride]= v += block[48];
-        pix[8*stride]= v +  block[56];
-        pix++;
-        block++;
-    }
-
-    memset(_block, 0, sizeof(dctcoef) * 64);
-}
-
-static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, int16_t *_block,
-                                           ptrdiff_t stride)
-{
-    int i;
-    pixel *pix = (pixel*)_pix;
-    const dctcoef *block = (const dctcoef*)_block;
-    stride /= sizeof(pixel);
-    for(i=0; i<8; i++){
-        pixel v = pix[-1];
-        pix[0]= v += block[0];
-        pix[1]= v += block[1];
-        pix[2]= v += block[2];
-        pix[3]= v += block[3];
-        pix[4]= v += block[4];
-        pix[5]= v += block[5];
-        pix[6]= v += block[6];
-        pix[7]= v +  block[7];
-        pix+= stride;
-        block+= 8;
-    }
-
-    memset(_block, 0, sizeof(dctcoef) * 64);
-}
-
-static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset,
-                                          int16_t *block,
-                                          ptrdiff_t stride)
-{
-    int i;
-    for(i=0; i<16; i++)
-        FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
-}
-
-static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix,
-                                            const int *block_offset,
-                                            int16_t *block,
-                                            ptrdiff_t stride)
-{
-    int i;
-    for(i=0; i<16; i++)
-        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
-}
-
-static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset,
-                                        int16_t *block, ptrdiff_t stride)
-{
-    int i;
-    for(i=0; i<4; i++)
-        FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
-}
-
-static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset,
-                                         int16_t *block, ptrdiff_t stride)
-{
-    int i;
-    for(i=0; i<4; i++)
-        FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
-    for(i=4; i<8; i++)
-        FUNCC(pred4x4_vertical_add)(pix + block_offset[i+4], block + i*16*sizeof(pixel), stride);
-}
-
-static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset,
-                                          int16_t *block,
-                                          ptrdiff_t stride)
-{
-    int i;
-    for(i=0; i<4; i++)
-        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
-}
-
-static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix,
-                                           const int *block_offset,
-                                           int16_t *block, ptrdiff_t stride)
-{
-    int i;
-    for(i=0; i<4; i++)
-        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
-    for(i=4; i<8; i++)
-        FUNCC(pred4x4_horizontal_add)(pix + block_offset[i+4], block + i*16*sizeof(pixel), stride);
-}
diff --git a/deps/libav/libavcodec/h264qpel.c b/deps/libav/libavcodec/h264qpel.c
deleted file mode 100644
index ec46da2..0000000
--- a/deps/libav/libavcodec/h264qpel.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "h264qpel.h"
-
-#define BIT_DEPTH 8
-#include "h264qpel_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 9
-#include "h264qpel_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "h264qpel_template.c"
-#undef BIT_DEPTH
-
-av_cold void ff_h264qpel_init(H264QpelContext *c, int bit_depth)
-{
-#undef FUNCC
-#define FUNCC(f, depth) f ## _ ## depth ## _c
-
-#define dspfunc2(PFX, IDX, NUM, depth)                                  \
-    c->PFX ## _pixels_tab[IDX][ 0] = FUNCC(PFX ## NUM ## _mc00, depth); \
-    c->PFX ## _pixels_tab[IDX][ 1] = FUNCC(PFX ## NUM ## _mc10, depth); \
-    c->PFX ## _pixels_tab[IDX][ 2] = FUNCC(PFX ## NUM ## _mc20, depth); \
-    c->PFX ## _pixels_tab[IDX][ 3] = FUNCC(PFX ## NUM ## _mc30, depth); \
-    c->PFX ## _pixels_tab[IDX][ 4] = FUNCC(PFX ## NUM ## _mc01, depth); \
-    c->PFX ## _pixels_tab[IDX][ 5] = FUNCC(PFX ## NUM ## _mc11, depth); \
-    c->PFX ## _pixels_tab[IDX][ 6] = FUNCC(PFX ## NUM ## _mc21, depth); \
-    c->PFX ## _pixels_tab[IDX][ 7] = FUNCC(PFX ## NUM ## _mc31, depth); \
-    c->PFX ## _pixels_tab[IDX][ 8] = FUNCC(PFX ## NUM ## _mc02, depth); \
-    c->PFX ## _pixels_tab[IDX][ 9] = FUNCC(PFX ## NUM ## _mc12, depth); \
-    c->PFX ## _pixels_tab[IDX][10] = FUNCC(PFX ## NUM ## _mc22, depth); \
-    c->PFX ## _pixels_tab[IDX][11] = FUNCC(PFX ## NUM ## _mc32, depth); \
-    c->PFX ## _pixels_tab[IDX][12] = FUNCC(PFX ## NUM ## _mc03, depth); \
-    c->PFX ## _pixels_tab[IDX][13] = FUNCC(PFX ## NUM ## _mc13, depth); \
-    c->PFX ## _pixels_tab[IDX][14] = FUNCC(PFX ## NUM ## _mc23, depth); \
-    c->PFX ## _pixels_tab[IDX][15] = FUNCC(PFX ## NUM ## _mc33, depth)
-
-#define SET_QPEL(depth)                         \
-    dspfunc2(put_h264_qpel, 0, 16, depth);      \
-    dspfunc2(put_h264_qpel, 1,  8, depth);      \
-    dspfunc2(put_h264_qpel, 2,  4, depth);      \
-    dspfunc2(put_h264_qpel, 3,  2, depth);      \
-    dspfunc2(avg_h264_qpel, 0, 16, depth);      \
-    dspfunc2(avg_h264_qpel, 1,  8, depth);      \
-    dspfunc2(avg_h264_qpel, 2,  4, depth)
-
-    switch (bit_depth) {
-    default:
-        SET_QPEL(8);
-        break;
-    case 9:
-        SET_QPEL(9);
-        break;
-    case 10:
-        SET_QPEL(10);
-        break;
-    }
-
-    if (ARCH_AARCH64)
-        ff_h264qpel_init_aarch64(c, bit_depth);
-    if (ARCH_ARM)
-        ff_h264qpel_init_arm(c, bit_depth);
-    if (ARCH_PPC)
-        ff_h264qpel_init_ppc(c, bit_depth);
-    if (ARCH_X86)
-        ff_h264qpel_init_x86(c, bit_depth);
-}
diff --git a/deps/libav/libavcodec/h264qpel.h b/deps/libav/libavcodec/h264qpel.h
deleted file mode 100644
index 202e97d..0000000
--- a/deps/libav/libavcodec/h264qpel.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_H264QPEL_H
-#define AVCODEC_H264QPEL_H
-
-#include "dsputil.h"
-
-typedef struct H264QpelContext {
-    qpel_mc_func put_h264_qpel_pixels_tab[4][16];
-    qpel_mc_func avg_h264_qpel_pixels_tab[4][16];
-} H264QpelContext;
-
-void ff_h264qpel_init(H264QpelContext *c, int bit_depth);
-
-void ff_h264qpel_init_aarch64(H264QpelContext *c, int bit_depth);
-void ff_h264qpel_init_arm(H264QpelContext *c, int bit_depth);
-void ff_h264qpel_init_ppc(H264QpelContext *c, int bit_depth);
-void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth);
-
-#endif /* AVCODEC_H264QPEL_H */
diff --git a/deps/libav/libavcodec/h264qpel_template.c b/deps/libav/libavcodec/h264qpel_template.c
deleted file mode 100644
index 027edf5..0000000
--- a/deps/libav/libavcodec/h264qpel_template.c
+++ /dev/null
@@ -1,549 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "bit_depth_template.c"
-#include "hpel_template.c"
-
-static inline void FUNC(copy_block2)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
-{
-    int i;
-    for(i=0; i<h; i++)
-    {
-        AV_WN2P(dst   , AV_RN2P(src   ));
-        dst+=dstStride;
-        src+=srcStride;
-    }
-}
-
-static inline void FUNC(copy_block4)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
-{
-    int i;
-    for(i=0; i<h; i++)
-    {
-        AV_WN4P(dst   , AV_RN4P(src   ));
-        dst+=dstStride;
-        src+=srcStride;
-    }
-}
-
-static inline void FUNC(copy_block8)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
-{
-    int i;
-    for(i=0; i<h; i++)
-    {
-        AV_WN4P(dst                , AV_RN4P(src                ));
-        AV_WN4P(dst+4*sizeof(pixel), AV_RN4P(src+4*sizeof(pixel)));
-        dst+=dstStride;
-        src+=srcStride;
-    }
-}
-
-static inline void FUNC(copy_block16)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
-{
-    int i;
-    for(i=0; i<h; i++)
-    {
-        AV_WN4P(dst                 , AV_RN4P(src                 ));
-        AV_WN4P(dst+ 4*sizeof(pixel), AV_RN4P(src+ 4*sizeof(pixel)));
-        AV_WN4P(dst+ 8*sizeof(pixel), AV_RN4P(src+ 8*sizeof(pixel)));
-        AV_WN4P(dst+12*sizeof(pixel), AV_RN4P(src+12*sizeof(pixel)));
-        dst+=dstStride;
-        src+=srcStride;
-    }
-}
-
-#define H264_LOWPASS(OPNAME, OP, OP2) \
-static av_unused void FUNC(OPNAME ## h264_qpel2_h_lowpass)(uint8_t *_dst, uint8_t *_src, int dstStride, int srcStride){\
-    const int h=2;\
-    INIT_CLIP\
-    int i;\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    dstStride /= sizeof(pixel);\
-    srcStride /= sizeof(pixel);\
-    for(i=0; i<h; i++)\
-    {\
-        OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]));\
-        OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]));\
-        dst+=dstStride;\
-        src+=srcStride;\
-    }\
-}\
-\
-static av_unused void FUNC(OPNAME ## h264_qpel2_v_lowpass)(uint8_t *_dst, uint8_t *_src, int dstStride, int srcStride){\
-    const int w=2;\
-    INIT_CLIP\
-    int i;\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    dstStride /= sizeof(pixel);\
-    srcStride /= sizeof(pixel);\
-    for(i=0; i<w; i++)\
-    {\
-        const int srcB= src[-2*srcStride];\
-        const int srcA= src[-1*srcStride];\
-        const int src0= src[0 *srcStride];\
-        const int src1= src[1 *srcStride];\
-        const int src2= src[2 *srcStride];\
-        const int src3= src[3 *srcStride];\
-        const int src4= src[4 *srcStride];\
-        OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
-        OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
-        dst++;\
-        src++;\
-    }\
-}\
-\
-static av_unused void FUNC(OPNAME ## h264_qpel2_hv_lowpass)(uint8_t *_dst, int16_t *tmp, uint8_t *_src, int dstStride, int tmpStride, int srcStride){\
-    const int h=2;\
-    const int w=2;\
-    const int pad = (BIT_DEPTH > 9) ? (-10 * ((1<<BIT_DEPTH)-1)) : 0;\
-    INIT_CLIP\
-    int i;\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    dstStride /= sizeof(pixel);\
-    srcStride /= sizeof(pixel);\
-    src -= 2*srcStride;\
-    for(i=0; i<h+5; i++)\
-    {\
-        tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]) + pad;\
-        tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]) + pad;\
-        tmp+=tmpStride;\
-        src+=srcStride;\
-    }\
-    tmp -= tmpStride*(h+5-2);\
-    for(i=0; i<w; i++)\
-    {\
-        const int tmpB= tmp[-2*tmpStride] - pad;\
-        const int tmpA= tmp[-1*tmpStride] - pad;\
-        const int tmp0= tmp[0 *tmpStride] - pad;\
-        const int tmp1= tmp[1 *tmpStride] - pad;\
-        const int tmp2= tmp[2 *tmpStride] - pad;\
-        const int tmp3= tmp[3 *tmpStride] - pad;\
-        const int tmp4= tmp[4 *tmpStride] - pad;\
-        OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
-        OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
-        dst++;\
-        tmp++;\
-    }\
-}\
-static void FUNC(OPNAME ## h264_qpel4_h_lowpass)(uint8_t *_dst, uint8_t *_src, int dstStride, int srcStride){\
-    const int h=4;\
-    INIT_CLIP\
-    int i;\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    dstStride /= sizeof(pixel);\
-    srcStride /= sizeof(pixel);\
-    for(i=0; i<h; i++)\
-    {\
-        OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]));\
-        OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]));\
-        OP(dst[2], (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5]));\
-        OP(dst[3], (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6]));\
-        dst+=dstStride;\
-        src+=srcStride;\
-    }\
-}\
-\
-static void FUNC(OPNAME ## h264_qpel4_v_lowpass)(uint8_t *_dst, uint8_t *_src, int dstStride, int srcStride){\
-    const int w=4;\
-    INIT_CLIP\
-    int i;\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    dstStride /= sizeof(pixel);\
-    srcStride /= sizeof(pixel);\
-    for(i=0; i<w; i++)\
-    {\
-        const int srcB= src[-2*srcStride];\
-        const int srcA= src[-1*srcStride];\
-        const int src0= src[0 *srcStride];\
-        const int src1= src[1 *srcStride];\
-        const int src2= src[2 *srcStride];\
-        const int src3= src[3 *srcStride];\
-        const int src4= src[4 *srcStride];\
-        const int src5= src[5 *srcStride];\
-        const int src6= src[6 *srcStride];\
-        OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
-        OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
-        OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*5 + (src0+src5));\
-        OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*5 + (src1+src6));\
-        dst++;\
-        src++;\
-    }\
-}\
-\
-static void FUNC(OPNAME ## h264_qpel4_hv_lowpass)(uint8_t *_dst, int16_t *tmp, uint8_t *_src, int dstStride, int tmpStride, int srcStride){\
-    const int h=4;\
-    const int w=4;\
-    const int pad = (BIT_DEPTH > 9) ? (-10 * ((1<<BIT_DEPTH)-1)) : 0;\
-    INIT_CLIP\
-    int i;\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    dstStride /= sizeof(pixel);\
-    srcStride /= sizeof(pixel);\
-    src -= 2*srcStride;\
-    for(i=0; i<h+5; i++)\
-    {\
-        tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]) + pad;\
-        tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]) + pad;\
-        tmp[2]= (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5]) + pad;\
-        tmp[3]= (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6]) + pad;\
-        tmp+=tmpStride;\
-        src+=srcStride;\
-    }\
-    tmp -= tmpStride*(h+5-2);\
-    for(i=0; i<w; i++)\
-    {\
-        const int tmpB= tmp[-2*tmpStride] - pad;\
-        const int tmpA= tmp[-1*tmpStride] - pad;\
-        const int tmp0= tmp[0 *tmpStride] - pad;\
-        const int tmp1= tmp[1 *tmpStride] - pad;\
-        const int tmp2= tmp[2 *tmpStride] - pad;\
-        const int tmp3= tmp[3 *tmpStride] - pad;\
-        const int tmp4= tmp[4 *tmpStride] - pad;\
-        const int tmp5= tmp[5 *tmpStride] - pad;\
-        const int tmp6= tmp[6 *tmpStride] - pad;\
-        OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
-        OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
-        OP2(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));\
-        OP2(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));\
-        dst++;\
-        tmp++;\
-    }\
-}\
-\
-static void FUNC(OPNAME ## h264_qpel8_h_lowpass)(uint8_t *_dst, uint8_t *_src, int dstStride, int srcStride){\
-    const int h=8;\
-    INIT_CLIP\
-    int i;\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    dstStride /= sizeof(pixel);\
-    srcStride /= sizeof(pixel);\
-    for(i=0; i<h; i++)\
-    {\
-        OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3 ]));\
-        OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4 ]));\
-        OP(dst[2], (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5 ]));\
-        OP(dst[3], (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6 ]));\
-        OP(dst[4], (src[4]+src[5])*20 - (src[3 ]+src[6])*5 + (src[2 ]+src[7 ]));\
-        OP(dst[5], (src[5]+src[6])*20 - (src[4 ]+src[7])*5 + (src[3 ]+src[8 ]));\
-        OP(dst[6], (src[6]+src[7])*20 - (src[5 ]+src[8])*5 + (src[4 ]+src[9 ]));\
-        OP(dst[7], (src[7]+src[8])*20 - (src[6 ]+src[9])*5 + (src[5 ]+src[10]));\
-        dst+=dstStride;\
-        src+=srcStride;\
-    }\
-}\
-\
-static void FUNC(OPNAME ## h264_qpel8_v_lowpass)(uint8_t *_dst, uint8_t *_src, int dstStride, int srcStride){\
-    const int w=8;\
-    INIT_CLIP\
-    int i;\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    dstStride /= sizeof(pixel);\
-    srcStride /= sizeof(pixel);\
-    for(i=0; i<w; i++)\
-    {\
-        const int srcB= src[-2*srcStride];\
-        const int srcA= src[-1*srcStride];\
-        const int src0= src[0 *srcStride];\
-        const int src1= src[1 *srcStride];\
-        const int src2= src[2 *srcStride];\
-        const int src3= src[3 *srcStride];\
-        const int src4= src[4 *srcStride];\
-        const int src5= src[5 *srcStride];\
-        const int src6= src[6 *srcStride];\
-        const int src7= src[7 *srcStride];\
-        const int src8= src[8 *srcStride];\
-        const int src9= src[9 *srcStride];\
-        const int src10=src[10*srcStride];\
-        OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
-        OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
-        OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*5 + (src0+src5));\
-        OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*5 + (src1+src6));\
-        OP(dst[4*dstStride], (src4+src5)*20 - (src3+src6)*5 + (src2+src7));\
-        OP(dst[5*dstStride], (src5+src6)*20 - (src4+src7)*5 + (src3+src8));\
-        OP(dst[6*dstStride], (src6+src7)*20 - (src5+src8)*5 + (src4+src9));\
-        OP(dst[7*dstStride], (src7+src8)*20 - (src6+src9)*5 + (src5+src10));\
-        dst++;\
-        src++;\
-    }\
-}\
-\
-static void FUNC(OPNAME ## h264_qpel8_hv_lowpass)(uint8_t *_dst, int16_t *tmp, uint8_t *_src, int dstStride, int tmpStride, int srcStride){\
-    const int h=8;\
-    const int w=8;\
-    const int pad = (BIT_DEPTH > 9) ? (-10 * ((1<<BIT_DEPTH)-1)) : 0;\
-    INIT_CLIP\
-    int i;\
-    pixel *dst = (pixel*)_dst;\
-    pixel *src = (pixel*)_src;\
-    dstStride /= sizeof(pixel);\
-    srcStride /= sizeof(pixel);\
-    src -= 2*srcStride;\
-    for(i=0; i<h+5; i++)\
-    {\
-        tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3 ]) + pad;\
-        tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4 ]) + pad;\
-        tmp[2]= (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5 ]) + pad;\
-        tmp[3]= (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6 ]) + pad;\
-        tmp[4]= (src[4]+src[5])*20 - (src[3 ]+src[6])*5 + (src[2 ]+src[7 ]) + pad;\
-        tmp[5]= (src[5]+src[6])*20 - (src[4 ]+src[7])*5 + (src[3 ]+src[8 ]) + pad;\
-        tmp[6]= (src[6]+src[7])*20 - (src[5 ]+src[8])*5 + (src[4 ]+src[9 ]) + pad;\
-        tmp[7]= (src[7]+src[8])*20 - (src[6 ]+src[9])*5 + (src[5 ]+src[10]) + pad;\
-        tmp+=tmpStride;\
-        src+=srcStride;\
-    }\
-    tmp -= tmpStride*(h+5-2);\
-    for(i=0; i<w; i++)\
-    {\
-        const int tmpB= tmp[-2*tmpStride] - pad;\
-        const int tmpA= tmp[-1*tmpStride] - pad;\
-        const int tmp0= tmp[0 *tmpStride] - pad;\
-        const int tmp1= tmp[1 *tmpStride] - pad;\
-        const int tmp2= tmp[2 *tmpStride] - pad;\
-        const int tmp3= tmp[3 *tmpStride] - pad;\
-        const int tmp4= tmp[4 *tmpStride] - pad;\
-        const int tmp5= tmp[5 *tmpStride] - pad;\
-        const int tmp6= tmp[6 *tmpStride] - pad;\
-        const int tmp7= tmp[7 *tmpStride] - pad;\
-        const int tmp8= tmp[8 *tmpStride] - pad;\
-        const int tmp9= tmp[9 *tmpStride] - pad;\
-        const int tmp10=tmp[10*tmpStride] - pad;\
-        OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
-        OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
-        OP2(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));\
-        OP2(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));\
-        OP2(dst[4*dstStride], (tmp4+tmp5)*20 - (tmp3+tmp6)*5 + (tmp2+tmp7));\
-        OP2(dst[5*dstStride], (tmp5+tmp6)*20 - (tmp4+tmp7)*5 + (tmp3+tmp8));\
-        OP2(dst[6*dstStride], (tmp6+tmp7)*20 - (tmp5+tmp8)*5 + (tmp4+tmp9));\
-        OP2(dst[7*dstStride], (tmp7+tmp8)*20 - (tmp6+tmp9)*5 + (tmp5+tmp10));\
-        dst++;\
-        tmp++;\
-    }\
-}\
-\
-static void FUNC(OPNAME ## h264_qpel16_v_lowpass)(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst                , src                , dstStride, srcStride);\
-    FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst                , src                , dstStride, srcStride);\
-    FUNC(OPNAME ## h264_qpel8_v_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
-}\
-\
-static void FUNC(OPNAME ## h264_qpel16_h_lowpass)(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst                , src                , dstStride, srcStride);\
-    FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst                , src                , dstStride, srcStride);\
-    FUNC(OPNAME ## h264_qpel8_h_lowpass)(dst+8*sizeof(pixel), src+8*sizeof(pixel), dstStride, srcStride);\
-}\
-\
-static void FUNC(OPNAME ## h264_qpel16_hv_lowpass)(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
-    FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst                , tmp  , src                , dstStride, tmpStride, srcStride);\
-    FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst+8*sizeof(pixel), tmp+8, src+8*sizeof(pixel), dstStride, tmpStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst                , tmp  , src                , dstStride, tmpStride, srcStride);\
-    FUNC(OPNAME ## h264_qpel8_hv_lowpass)(dst+8*sizeof(pixel), tmp+8, src+8*sizeof(pixel), dstStride, tmpStride, srcStride);\
-}\
-
-#define H264_MC(OPNAME, SIZE) \
-static av_unused void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc00)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    FUNCC(OPNAME ## pixels ## SIZE)(dst, src, stride, SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc10)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t half[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(half, src, SIZE*sizeof(pixel), stride);\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, src, half, stride, stride, SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc20)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    FUNC(OPNAME ## h264_qpel ## SIZE ## _h_lowpass)(dst, src, stride, stride);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc30)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t half[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(half, src, SIZE*sizeof(pixel), stride);\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, src+sizeof(pixel), half, stride, stride, SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc01)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
-    uint8_t half[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
-    FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(half, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, full_mid, half, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc02)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
-    FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
-    FUNC(OPNAME ## h264_qpel ## SIZE ## _v_lowpass)(dst, full_mid, stride, SIZE*sizeof(pixel));\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc03)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
-    uint8_t half[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
-    FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(half, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, full_mid+SIZE*sizeof(pixel), half, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc11)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
-    uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
-    uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src, SIZE*sizeof(pixel), stride);\
-    FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
-    FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc31)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
-    uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
-    uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src, SIZE*sizeof(pixel), stride);\
-    FUNC(copy_block ## SIZE )(full, src - stride*2 + sizeof(pixel), SIZE*sizeof(pixel),  stride, SIZE + 5);\
-    FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc13)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
-    uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
-    uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src + stride, SIZE*sizeof(pixel), stride);\
-    FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
-    FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc33)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
-    uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
-    uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src + stride, SIZE*sizeof(pixel), stride);\
-    FUNC(copy_block ## SIZE )(full, src - stride*2 + sizeof(pixel), SIZE*sizeof(pixel),  stride, SIZE + 5);\
-    FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc22)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    int16_t tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
-    FUNC(OPNAME ## h264_qpel ## SIZE ## _hv_lowpass)(dst, tmp, src, stride, SIZE*sizeof(pixel), stride);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc21)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    int16_t tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
-    uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src, SIZE*sizeof(pixel), stride);\
-    FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc23)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    int16_t tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t halfH[SIZE*SIZE*sizeof(pixel)];\
-    uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(put_h264_qpel ## SIZE ## _h_lowpass)(halfH, src + stride, SIZE*sizeof(pixel), stride);\
-    FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfH, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc12)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
-    int16_t tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
-    uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(copy_block ## SIZE )(full, src - stride*2, SIZE*sizeof(pixel),  stride, SIZE + 5);\
-    FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
-    FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfV, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-\
-static void FUNCC(OPNAME ## h264_qpel ## SIZE ## _mc32)(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t * const full_mid= full + SIZE*2*sizeof(pixel);\
-    int16_t tmp[SIZE*(SIZE+5)*sizeof(pixel)];\
-    uint8_t halfV[SIZE*SIZE*sizeof(pixel)];\
-    uint8_t halfHV[SIZE*SIZE*sizeof(pixel)];\
-    FUNC(copy_block ## SIZE )(full, src - stride*2 + sizeof(pixel), SIZE*sizeof(pixel),  stride, SIZE + 5);\
-    FUNC(put_h264_qpel ## SIZE ## _v_lowpass)(halfV, full_mid, SIZE*sizeof(pixel), SIZE*sizeof(pixel));\
-    FUNC(put_h264_qpel ## SIZE ## _hv_lowpass)(halfHV, tmp, src, SIZE*sizeof(pixel), SIZE*sizeof(pixel), stride);\
-    FUNC(OPNAME ## pixels ## SIZE ## _l2)(dst, halfV, halfHV, stride, SIZE*sizeof(pixel), SIZE*sizeof(pixel), SIZE);\
-}\
-
-#define op_avg(a, b)  a = (((a)+CLIP(((b) + 16)>>5)+1)>>1)
-//#define op_avg2(a, b) a = (((a)*w1+cm[((b) + 16)>>5]*w2 + o + 64)>>7)
-#define op_put(a, b)  a = CLIP(((b) + 16)>>5)
-#define op2_avg(a, b)  a = (((a)+CLIP(((b) + 512)>>10)+1)>>1)
-#define op2_put(a, b)  a = CLIP(((b) + 512)>>10)
-
-H264_LOWPASS(put_       , op_put, op2_put)
-H264_LOWPASS(avg_       , op_avg, op2_avg)
-H264_MC(put_, 2)
-H264_MC(put_, 4)
-H264_MC(put_, 8)
-H264_MC(put_, 16)
-H264_MC(avg_, 4)
-H264_MC(avg_, 8)
-H264_MC(avg_, 16)
-
-#undef op_avg
-#undef op_put
-#undef op2_avg
-#undef op2_put
diff --git a/deps/libav/libavcodec/hevc.c b/deps/libav/libavcodec/hevc.c
deleted file mode 100644
index 49ed285..0000000
--- a/deps/libav/libavcodec/hevc.c
+++ /dev/null
@@ -1,3273 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- * Copyright (C) 2012 - 2013 Mickael Raulet
- * Copyright (C) 2012 - 2013 Gildas Cocherel
- * Copyright (C) 2012 - 2013 Wassim Hamidouche
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-#include "libavutil/md5.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/stereo3d.h"
-
-#include "bytestream.h"
-#include "cabac_functions.h"
-#include "dsputil.h"
-#include "golomb.h"
-#include "hevc.h"
-
-const uint8_t ff_hevc_qpel_extra_before[4] = { 0, 3, 3, 2 };
-const uint8_t ff_hevc_qpel_extra_after[4]  = { 0, 3, 4, 4 };
-const uint8_t ff_hevc_qpel_extra[4]        = { 0, 6, 7, 6 };
-
-static const uint8_t scan_1x1[1] = { 0 };
-
-static const uint8_t horiz_scan2x2_x[4] = { 0, 1, 0, 1 };
-
-static const uint8_t horiz_scan2x2_y[4] = { 0, 0, 1, 1 };
-
-static const uint8_t horiz_scan4x4_x[16] = {
-    0, 1, 2, 3,
-    0, 1, 2, 3,
-    0, 1, 2, 3,
-    0, 1, 2, 3,
-};
-
-static const uint8_t horiz_scan4x4_y[16] = {
-    0, 0, 0, 0,
-    1, 1, 1, 1,
-    2, 2, 2, 2,
-    3, 3, 3, 3,
-};
-
-static const uint8_t horiz_scan8x8_inv[8][8] = {
-    {  0,  1,  2,  3, 16, 17, 18, 19, },
-    {  4,  5,  6,  7, 20, 21, 22, 23, },
-    {  8,  9, 10, 11, 24, 25, 26, 27, },
-    { 12, 13, 14, 15, 28, 29, 30, 31, },
-    { 32, 33, 34, 35, 48, 49, 50, 51, },
-    { 36, 37, 38, 39, 52, 53, 54, 55, },
-    { 40, 41, 42, 43, 56, 57, 58, 59, },
-    { 44, 45, 46, 47, 60, 61, 62, 63, },
-};
-
-static const uint8_t diag_scan2x2_x[4] = { 0, 0, 1, 1 };
-
-static const uint8_t diag_scan2x2_y[4] = { 0, 1, 0, 1 };
-
-static const uint8_t diag_scan2x2_inv[2][2] = {
-    { 0, 2, },
-    { 1, 3, },
-};
-
-const uint8_t ff_hevc_diag_scan4x4_x[16] = {
-    0, 0, 1, 0,
-    1, 2, 0, 1,
-    2, 3, 1, 2,
-    3, 2, 3, 3,
-};
-
-const uint8_t ff_hevc_diag_scan4x4_y[16] = {
-    0, 1, 0, 2,
-    1, 0, 3, 2,
-    1, 0, 3, 2,
-    1, 3, 2, 3,
-};
-
-static const uint8_t diag_scan4x4_inv[4][4] = {
-    { 0,  2,  5,  9, },
-    { 1,  4,  8, 12, },
-    { 3,  7, 11, 14, },
-    { 6, 10, 13, 15, },
-};
-
-const uint8_t ff_hevc_diag_scan8x8_x[64] = {
-    0, 0, 1, 0,
-    1, 2, 0, 1,
-    2, 3, 0, 1,
-    2, 3, 4, 0,
-    1, 2, 3, 4,
-    5, 0, 1, 2,
-    3, 4, 5, 6,
-    0, 1, 2, 3,
-    4, 5, 6, 7,
-    1, 2, 3, 4,
-    5, 6, 7, 2,
-    3, 4, 5, 6,
-    7, 3, 4, 5,
-    6, 7, 4, 5,
-    6, 7, 5, 6,
-    7, 6, 7, 7,
-};
-
-const uint8_t ff_hevc_diag_scan8x8_y[64] = {
-    0, 1, 0, 2,
-    1, 0, 3, 2,
-    1, 0, 4, 3,
-    2, 1, 0, 5,
-    4, 3, 2, 1,
-    0, 6, 5, 4,
-    3, 2, 1, 0,
-    7, 6, 5, 4,
-    3, 2, 1, 0,
-    7, 6, 5, 4,
-    3, 2, 1, 7,
-    6, 5, 4, 3,
-    2, 7, 6, 5,
-    4, 3, 7, 6,
-    5, 4, 7, 6,
-    5, 7, 6, 7,
-};
-
-static const uint8_t diag_scan8x8_inv[8][8] = {
-    {  0,  2,  5,  9, 14, 20, 27, 35, },
-    {  1,  4,  8, 13, 19, 26, 34, 42, },
-    {  3,  7, 12, 18, 25, 33, 41, 48, },
-    {  6, 11, 17, 24, 32, 40, 47, 53, },
-    { 10, 16, 23, 31, 39, 46, 52, 57, },
-    { 15, 22, 30, 38, 45, 51, 56, 60, },
-    { 21, 29, 37, 44, 50, 55, 59, 62, },
-    { 28, 36, 43, 49, 54, 58, 61, 63, },
-};
-
-/**
- * NOTE: Each function hls_foo correspond to the function foo in the
- * specification (HLS stands for High Level Syntax).
- */
-
-/**
- * Section 5.7
- */
-
-/* free everything allocated  by pic_arrays_init() */
-static void pic_arrays_free(HEVCContext *s)
-{
-    av_freep(&s->sao);
-    av_freep(&s->deblock);
-    av_freep(&s->split_cu_flag);
-
-    av_freep(&s->skip_flag);
-    av_freep(&s->tab_ct_depth);
-
-    av_freep(&s->tab_ipm);
-    av_freep(&s->cbf_luma);
-    av_freep(&s->is_pcm);
-
-    av_freep(&s->qp_y_tab);
-    av_freep(&s->tab_slice_address);
-    av_freep(&s->filter_slice_edges);
-
-    av_freep(&s->horizontal_bs);
-    av_freep(&s->vertical_bs);
-
-    av_buffer_pool_uninit(&s->tab_mvf_pool);
-    av_buffer_pool_uninit(&s->rpl_tab_pool);
-}
-
-/* allocate arrays that depend on frame dimensions */
-static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
-{
-    int log2_min_cb_size = sps->log2_min_cb_size;
-    int width            = sps->width;
-    int height           = sps->height;
-    int pic_size         = width * height;
-    int pic_size_in_ctb  = ((width  >> log2_min_cb_size) + 1) *
-                           ((height >> log2_min_cb_size) + 1);
-    int ctb_count        = sps->ctb_width * sps->ctb_height;
-    int min_pu_size      = sps->min_pu_width * sps->min_pu_height;
-
-    s->bs_width  = width  >> 3;
-    s->bs_height = height >> 3;
-
-    s->sao           = av_mallocz_array(ctb_count, sizeof(*s->sao));
-    s->deblock       = av_mallocz_array(ctb_count, sizeof(*s->deblock));
-    s->split_cu_flag = av_malloc(pic_size);
-    if (!s->sao || !s->deblock || !s->split_cu_flag)
-        goto fail;
-
-    s->skip_flag    = av_malloc(pic_size_in_ctb);
-    s->tab_ct_depth = av_malloc(sps->min_cb_height * sps->min_cb_width);
-    if (!s->skip_flag || !s->tab_ct_depth)
-        goto fail;
-
-    s->cbf_luma = av_malloc(sps->min_tb_width * sps->min_tb_height);
-    s->tab_ipm  = av_mallocz(min_pu_size);
-    s->is_pcm   = av_malloc(min_pu_size);
-    if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
-        goto fail;
-
-    s->filter_slice_edges = av_malloc(ctb_count);
-    s->tab_slice_address  = av_malloc(pic_size_in_ctb *
-                                      sizeof(*s->tab_slice_address));
-    s->qp_y_tab           = av_malloc(pic_size_in_ctb *
-                                      sizeof(*s->qp_y_tab));
-    if (!s->qp_y_tab || !s->filter_slice_edges || !s->tab_slice_address)
-        goto fail;
-
-    s->horizontal_bs = av_mallocz(2 * s->bs_width * (s->bs_height + 1));
-    s->vertical_bs   = av_mallocz(2 * s->bs_width * (s->bs_height + 1));
-    if (!s->horizontal_bs || !s->vertical_bs)
-        goto fail;
-
-    s->tab_mvf_pool = av_buffer_pool_init(min_pu_size * sizeof(MvField),
-                                          av_buffer_alloc);
-    s->rpl_tab_pool = av_buffer_pool_init(ctb_count * sizeof(RefPicListTab),
-                                          av_buffer_allocz);
-    if (!s->tab_mvf_pool || !s->rpl_tab_pool)
-        goto fail;
-
-    return 0;
-
-fail:
-    pic_arrays_free(s);
-    return AVERROR(ENOMEM);
-}
-
-static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
-{
-    int i = 0;
-    int j = 0;
-    uint8_t luma_weight_l0_flag[16];
-    uint8_t chroma_weight_l0_flag[16];
-    uint8_t luma_weight_l1_flag[16];
-    uint8_t chroma_weight_l1_flag[16];
-
-    s->sh.luma_log2_weight_denom = get_ue_golomb_long(gb);
-    if (s->sps->chroma_format_idc != 0) {
-        int delta = get_se_golomb(gb);
-        s->sh.chroma_log2_weight_denom = av_clip_c(s->sh.luma_log2_weight_denom + delta, 0, 7);
-    }
-
-    for (i = 0; i < s->sh.nb_refs[L0]; i++) {
-        luma_weight_l0_flag[i] = get_bits1(gb);
-        if (!luma_weight_l0_flag[i]) {
-            s->sh.luma_weight_l0[i] = 1 << s->sh.luma_log2_weight_denom;
-            s->sh.luma_offset_l0[i] = 0;
-        }
-    }
-    if (s->sps->chroma_format_idc != 0) { // FIXME: invert "if" and "for"
-        for (i = 0; i < s->sh.nb_refs[L0]; i++)
-            chroma_weight_l0_flag[i] = get_bits1(gb);
-    } else {
-        for (i = 0; i < s->sh.nb_refs[L0]; i++)
-            chroma_weight_l0_flag[i] = 0;
-    }
-    for (i = 0; i < s->sh.nb_refs[L0]; i++) {
-        if (luma_weight_l0_flag[i]) {
-            int delta_luma_weight_l0 = get_se_golomb(gb);
-            s->sh.luma_weight_l0[i] = (1 << s->sh.luma_log2_weight_denom) + delta_luma_weight_l0;
-            s->sh.luma_offset_l0[i] = get_se_golomb(gb);
-        }
-        if (chroma_weight_l0_flag[i]) {
-            for (j = 0; j < 2; j++) {
-                int delta_chroma_weight_l0 = get_se_golomb(gb);
-                int delta_chroma_offset_l0 = get_se_golomb(gb);
-                s->sh.chroma_weight_l0[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l0;
-                s->sh.chroma_offset_l0[i][j] = av_clip_c((delta_chroma_offset_l0 - ((128 * s->sh.chroma_weight_l0[i][j])
-                                                                                    >> s->sh.chroma_log2_weight_denom) + 128), -128, 127);
-            }
-        } else {
-            s->sh.chroma_weight_l0[i][0] = 1 << s->sh.chroma_log2_weight_denom;
-            s->sh.chroma_offset_l0[i][0] = 0;
-            s->sh.chroma_weight_l0[i][1] = 1 << s->sh.chroma_log2_weight_denom;
-            s->sh.chroma_offset_l0[i][1] = 0;
-        }
-    }
-    if (s->sh.slice_type == B_SLICE) {
-        for (i = 0; i < s->sh.nb_refs[L1]; i++) {
-            luma_weight_l1_flag[i] = get_bits1(gb);
-            if (!luma_weight_l1_flag[i]) {
-                s->sh.luma_weight_l1[i] = 1 << s->sh.luma_log2_weight_denom;
-                s->sh.luma_offset_l1[i] = 0;
-            }
-        }
-        if (s->sps->chroma_format_idc != 0) {
-            for (i = 0; i < s->sh.nb_refs[L1]; i++)
-                chroma_weight_l1_flag[i] = get_bits1(gb);
-        } else {
-            for (i = 0; i < s->sh.nb_refs[L1]; i++)
-                chroma_weight_l1_flag[i] = 0;
-        }
-        for (i = 0; i < s->sh.nb_refs[L1]; i++) {
-            if (luma_weight_l1_flag[i]) {
-                int delta_luma_weight_l1 = get_se_golomb(gb);
-                s->sh.luma_weight_l1[i] = (1 << s->sh.luma_log2_weight_denom) + delta_luma_weight_l1;
-                s->sh.luma_offset_l1[i] = get_se_golomb(gb);
-            }
-            if (chroma_weight_l1_flag[i]) {
-                for (j = 0; j < 2; j++) {
-                    int delta_chroma_weight_l1 = get_se_golomb(gb);
-                    int delta_chroma_offset_l1 = get_se_golomb(gb);
-                    s->sh.chroma_weight_l1[i][j] = (1 << s->sh.chroma_log2_weight_denom) + delta_chroma_weight_l1;
-                    s->sh.chroma_offset_l1[i][j] = av_clip_c((delta_chroma_offset_l1 - ((128 * s->sh.chroma_weight_l1[i][j])
-                                                                                        >> s->sh.chroma_log2_weight_denom) + 128), -128, 127);
-                }
-            } else {
-                s->sh.chroma_weight_l1[i][0] = 1 << s->sh.chroma_log2_weight_denom;
-                s->sh.chroma_offset_l1[i][0] = 0;
-                s->sh.chroma_weight_l1[i][1] = 1 << s->sh.chroma_log2_weight_denom;
-                s->sh.chroma_offset_l1[i][1] = 0;
-            }
-        }
-    }
-}
-
-static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
-{
-    const HEVCSPS *sps = s->sps;
-    int max_poc_lsb    = 1 << sps->log2_max_poc_lsb;
-    int prev_delta_msb = 0;
-    unsigned int nb_sps = 0, nb_sh;
-    int i;
-
-    rps->nb_refs = 0;
-    if (!sps->long_term_ref_pics_present_flag)
-        return 0;
-
-    if (sps->num_long_term_ref_pics_sps > 0)
-        nb_sps = get_ue_golomb_long(gb);
-    nb_sh = get_ue_golomb_long(gb);
-
-    if (nb_sh + nb_sps > FF_ARRAY_ELEMS(rps->poc))
-        return AVERROR_INVALIDDATA;
-
-    rps->nb_refs = nb_sh + nb_sps;
-
-    for (i = 0; i < rps->nb_refs; i++) {
-        uint8_t delta_poc_msb_present;
-
-        if (i < nb_sps) {
-            uint8_t lt_idx_sps = 0;
-
-            if (sps->num_long_term_ref_pics_sps > 1)
-                lt_idx_sps = get_bits(gb, av_ceil_log2(sps->num_long_term_ref_pics_sps));
-
-            rps->poc[i]  = sps->lt_ref_pic_poc_lsb_sps[lt_idx_sps];
-            rps->used[i] = sps->used_by_curr_pic_lt_sps_flag[lt_idx_sps];
-        } else {
-            rps->poc[i]  = get_bits(gb, sps->log2_max_poc_lsb);
-            rps->used[i] = get_bits1(gb);
-        }
-
-        delta_poc_msb_present = get_bits1(gb);
-        if (delta_poc_msb_present) {
-            int delta = get_ue_golomb_long(gb);
-
-            if (i && i != nb_sps)
-                delta += prev_delta_msb;
-
-            rps->poc[i] += s->poc - delta * max_poc_lsb - s->sh.pic_order_cnt_lsb;
-            prev_delta_msb = delta;
-        }
-    }
-
-    return 0;
-}
-
-static int set_sps(HEVCContext *s, const HEVCSPS *sps)
-{
-    int ret;
-    unsigned int num = 0, den = 0;
-
-    pic_arrays_free(s);
-    ret = pic_arrays_init(s, sps);
-    if (ret < 0)
-        goto fail;
-
-    s->avctx->coded_width         = sps->width;
-    s->avctx->coded_height        = sps->height;
-    s->avctx->width               = sps->output_width;
-    s->avctx->height              = sps->output_height;
-    s->avctx->pix_fmt             = sps->pix_fmt;
-    s->avctx->sample_aspect_ratio = sps->vui.sar;
-    s->avctx->has_b_frames        = sps->temporal_layer[sps->max_sub_layers - 1].num_reorder_pics;
-
-    if (sps->vui.video_signal_type_present_flag)
-        s->avctx->color_range = sps->vui.video_full_range_flag ? AVCOL_RANGE_JPEG
-                                                               : AVCOL_RANGE_MPEG;
-    else
-        s->avctx->color_range = AVCOL_RANGE_MPEG;
-
-    if (sps->vui.colour_description_present_flag) {
-        s->avctx->color_primaries = sps->vui.colour_primaries;
-        s->avctx->color_trc       = sps->vui.transfer_characteristic;
-        s->avctx->colorspace      = sps->vui.matrix_coeffs;
-    } else {
-        s->avctx->color_primaries = AVCOL_PRI_UNSPECIFIED;
-        s->avctx->color_trc       = AVCOL_TRC_UNSPECIFIED;
-        s->avctx->colorspace      = AVCOL_SPC_UNSPECIFIED;
-    }
-
-    ff_hevc_pred_init(&s->hpc,     sps->bit_depth);
-    ff_hevc_dsp_init (&s->hevcdsp, sps->bit_depth);
-    ff_videodsp_init (&s->vdsp,    sps->bit_depth);
-
-    if (sps->sao_enabled) {
-        av_frame_unref(s->tmp_frame);
-        ret = ff_get_buffer(s->avctx, s->tmp_frame, AV_GET_BUFFER_FLAG_REF);
-        if (ret < 0)
-            goto fail;
-        s->frame = s->tmp_frame;
-    }
-
-    s->sps = sps;
-    s->vps = (HEVCVPS*) s->vps_list[s->sps->vps_id]->data;
-
-    if (s->vps->vps_timing_info_present_flag) {
-        num = s->vps->vps_num_units_in_tick;
-        den = s->vps->vps_time_scale;
-    } else if (sps->vui.vui_timing_info_present_flag) {
-        num = sps->vui.vui_num_units_in_tick;
-        den = sps->vui.vui_time_scale;
-    }
-
-    if (num != 0 && den != 0)
-        av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den,
-                  num, den, 1 << 30);
-
-    return 0;
-
-fail:
-    pic_arrays_free(s);
-    s->sps = NULL;
-    return ret;
-}
-
-static int hls_slice_header(HEVCContext *s)
-{
-    GetBitContext *gb = &s->HEVClc.gb;
-    SliceHeader *sh   = &s->sh;
-    int i, ret;
-
-    // Coded parameters
-    sh->first_slice_in_pic_flag = get_bits1(gb);
-    if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) {
-        s->seq_decode = (s->seq_decode + 1) & 0xff;
-        s->max_ra     = INT_MAX;
-        if (IS_IDR(s))
-            ff_hevc_clear_refs(s);
-    }
-    if (s->nal_unit_type >= 16 && s->nal_unit_type <= 23)
-        sh->no_output_of_prior_pics_flag = get_bits1(gb);
-
-    sh->pps_id = get_ue_golomb_long(gb);
-    if (sh->pps_id >= MAX_PPS_COUNT || !s->pps_list[sh->pps_id]) {
-        av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", sh->pps_id);
-        return AVERROR_INVALIDDATA;
-    }
-    if (!sh->first_slice_in_pic_flag &&
-        s->pps != (HEVCPPS*)s->pps_list[sh->pps_id]->data) {
-        av_log(s->avctx, AV_LOG_ERROR, "PPS changed between slices.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    s->pps = (HEVCPPS*)s->pps_list[sh->pps_id]->data;
-
-    if (s->sps != (HEVCSPS*)s->sps_list[s->pps->sps_id]->data) {
-        s->sps = (HEVCSPS*)s->sps_list[s->pps->sps_id]->data;
-
-        ff_hevc_clear_refs(s);
-        ret = set_sps(s, s->sps);
-        if (ret < 0)
-            return ret;
-
-        s->seq_decode = (s->seq_decode + 1) & 0xff;
-        s->max_ra     = INT_MAX;
-    }
-
-    s->avctx->profile = s->sps->ptl.general_ptl.profile_idc;
-    s->avctx->level   = s->sps->ptl.general_ptl.level_idc;
-
-    sh->dependent_slice_segment_flag = 0;
-    if (!sh->first_slice_in_pic_flag) {
-        int slice_address_length;
-
-        if (s->pps->dependent_slice_segments_enabled_flag)
-            sh->dependent_slice_segment_flag = get_bits1(gb);
-
-        slice_address_length = av_ceil_log2(s->sps->ctb_width *
-                                            s->sps->ctb_height);
-        sh->slice_segment_addr = get_bits(gb, slice_address_length);
-        if (sh->slice_segment_addr >= s->sps->ctb_width * s->sps->ctb_height) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Invalid slice segment address: %u.\n",
-                   sh->slice_segment_addr);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (!sh->dependent_slice_segment_flag) {
-            sh->slice_addr = sh->slice_segment_addr;
-            s->slice_idx++;
-        }
-    } else {
-        sh->slice_segment_addr = sh->slice_addr = 0;
-        s->slice_idx           = 0;
-        s->slice_initialized   = 0;
-    }
-
-    if (!sh->dependent_slice_segment_flag) {
-        s->slice_initialized = 0;
-
-        for (i = 0; i < s->pps->num_extra_slice_header_bits; i++)
-            skip_bits(gb, 1);  // slice_reserved_undetermined_flag[]
-
-        sh->slice_type = get_ue_golomb_long(gb);
-        if (!(sh->slice_type == I_SLICE ||
-              sh->slice_type == P_SLICE ||
-              sh->slice_type == B_SLICE)) {
-            av_log(s->avctx, AV_LOG_ERROR, "Unknown slice type: %d.\n",
-                   sh->slice_type);
-            return AVERROR_INVALIDDATA;
-        }
-        if (IS_IRAP(s) && sh->slice_type != I_SLICE) {
-            av_log(s->avctx, AV_LOG_ERROR, "Inter slices in an IRAP frame.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (s->pps->output_flag_present_flag)
-            sh->pic_output_flag = get_bits1(gb);
-
-        if (s->sps->separate_colour_plane_flag)
-            sh->colour_plane_id = get_bits(gb, 2);
-
-        if (!IS_IDR(s)) {
-            int short_term_ref_pic_set_sps_flag, poc;
-
-            sh->pic_order_cnt_lsb = get_bits(gb, s->sps->log2_max_poc_lsb);
-            poc = ff_hevc_compute_poc(s, sh->pic_order_cnt_lsb);
-            if (!sh->first_slice_in_pic_flag && poc != s->poc) {
-                av_log(s->avctx, AV_LOG_WARNING,
-                       "Ignoring POC change between slices: %d -> %d\n", s->poc, poc);
-                if (s->avctx->err_recognition & AV_EF_EXPLODE)
-                    return AVERROR_INVALIDDATA;
-                poc = s->poc;
-            }
-            s->poc = poc;
-
-            short_term_ref_pic_set_sps_flag = get_bits1(gb);
-            if (!short_term_ref_pic_set_sps_flag) {
-                ret = ff_hevc_decode_short_term_rps(s, &sh->slice_rps, s->sps, 1);
-                if (ret < 0)
-                    return ret;
-
-                sh->short_term_rps = &sh->slice_rps;
-            } else {
-                int numbits, rps_idx;
-
-                if (!s->sps->nb_st_rps) {
-                    av_log(s->avctx, AV_LOG_ERROR, "No ref lists in the SPS.\n");
-                    return AVERROR_INVALIDDATA;
-                }
-
-                numbits = av_ceil_log2(s->sps->nb_st_rps);
-                rps_idx = numbits > 0 ? get_bits(gb, numbits) : 0;
-                sh->short_term_rps = &s->sps->st_rps[rps_idx];
-            }
-
-            ret = decode_lt_rps(s, &sh->long_term_rps, gb);
-            if (ret < 0) {
-                av_log(s->avctx, AV_LOG_WARNING, "Invalid long term RPS.\n");
-                if (s->avctx->err_recognition & AV_EF_EXPLODE)
-                    return AVERROR_INVALIDDATA;
-            }
-
-            if (s->sps->sps_temporal_mvp_enabled_flag)
-                sh->slice_temporal_mvp_enabled_flag = get_bits1(gb);
-            else
-                sh->slice_temporal_mvp_enabled_flag = 0;
-        } else {
-            s->sh.short_term_rps = NULL;
-            s->poc               = 0;
-        }
-
-        /* 8.3.1 */
-        if (s->temporal_id == 0 &&
-            s->nal_unit_type != NAL_TRAIL_N &&
-            s->nal_unit_type != NAL_TSA_N   &&
-            s->nal_unit_type != NAL_STSA_N  &&
-            s->nal_unit_type != NAL_RADL_N  &&
-            s->nal_unit_type != NAL_RADL_R  &&
-            s->nal_unit_type != NAL_RASL_N  &&
-            s->nal_unit_type != NAL_RASL_R)
-            s->pocTid0 = s->poc;
-
-        if (s->sps->sao_enabled) {
-            sh->slice_sample_adaptive_offset_flag[0] = get_bits1(gb);
-            sh->slice_sample_adaptive_offset_flag[1] =
-            sh->slice_sample_adaptive_offset_flag[2] = get_bits1(gb);
-        } else {
-            sh->slice_sample_adaptive_offset_flag[0] = 0;
-            sh->slice_sample_adaptive_offset_flag[1] = 0;
-            sh->slice_sample_adaptive_offset_flag[2] = 0;
-        }
-
-        sh->nb_refs[L0] = sh->nb_refs[L1] = 0;
-        if (sh->slice_type == P_SLICE || sh->slice_type == B_SLICE) {
-            int nb_refs;
-
-            sh->nb_refs[L0] = s->pps->num_ref_idx_l0_default_active;
-            if (sh->slice_type == B_SLICE)
-                sh->nb_refs[L1] = s->pps->num_ref_idx_l1_default_active;
-
-            if (get_bits1(gb)) { // num_ref_idx_active_override_flag
-                sh->nb_refs[L0] = get_ue_golomb_long(gb) + 1;
-                if (sh->slice_type == B_SLICE)
-                    sh->nb_refs[L1] = get_ue_golomb_long(gb) + 1;
-            }
-            if (sh->nb_refs[L0] > MAX_REFS || sh->nb_refs[L1] > MAX_REFS) {
-                av_log(s->avctx, AV_LOG_ERROR, "Too many refs: %d/%d.\n",
-                       sh->nb_refs[L0], sh->nb_refs[L1]);
-                return AVERROR_INVALIDDATA;
-            }
-
-            sh->rpl_modification_flag[0] = 0;
-            sh->rpl_modification_flag[1] = 0;
-            nb_refs = ff_hevc_frame_nb_refs(s);
-            if (!nb_refs) {
-                av_log(s->avctx, AV_LOG_ERROR, "Zero refs for a frame with P or B slices.\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            if (s->pps->lists_modification_present_flag && nb_refs > 1) {
-                sh->rpl_modification_flag[0] = get_bits1(gb);
-                if (sh->rpl_modification_flag[0]) {
-                    for (i = 0; i < sh->nb_refs[L0]; i++)
-                        sh->list_entry_lx[0][i] = get_bits(gb, av_ceil_log2(nb_refs));
-                }
-
-                if (sh->slice_type == B_SLICE) {
-                    sh->rpl_modification_flag[1] = get_bits1(gb);
-                    if (sh->rpl_modification_flag[1] == 1)
-                        for (i = 0; i < sh->nb_refs[L1]; i++)
-                            sh->list_entry_lx[1][i] = get_bits(gb, av_ceil_log2(nb_refs));
-                }
-            }
-
-            if (sh->slice_type == B_SLICE)
-                sh->mvd_l1_zero_flag = get_bits1(gb);
-
-            if (s->pps->cabac_init_present_flag)
-                sh->cabac_init_flag = get_bits1(gb);
-            else
-                sh->cabac_init_flag = 0;
-
-            sh->collocated_ref_idx = 0;
-            if (sh->slice_temporal_mvp_enabled_flag) {
-                sh->collocated_list = L0;
-                if (sh->slice_type == B_SLICE)
-                    sh->collocated_list = !get_bits1(gb);
-
-                if (sh->nb_refs[sh->collocated_list] > 1) {
-                    sh->collocated_ref_idx = get_ue_golomb_long(gb);
-                    if (sh->collocated_ref_idx >= sh->nb_refs[sh->collocated_list]) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "Invalid collocated_ref_idx: %d.\n",
-                               sh->collocated_ref_idx);
-                        return AVERROR_INVALIDDATA;
-                    }
-                }
-            }
-
-            if ((s->pps->weighted_pred_flag   && sh->slice_type == P_SLICE) ||
-                (s->pps->weighted_bipred_flag && sh->slice_type == B_SLICE)) {
-                pred_weight_table(s, gb);
-            }
-
-            sh->max_num_merge_cand = 5 - get_ue_golomb_long(gb);
-            if (sh->max_num_merge_cand < 1 || sh->max_num_merge_cand > 5) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "Invalid number of merging MVP candidates: %d.\n",
-                       sh->max_num_merge_cand);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-
-        sh->slice_qp_delta = get_se_golomb(gb);
-
-        if (s->pps->pic_slice_level_chroma_qp_offsets_present_flag) {
-            sh->slice_cb_qp_offset = get_se_golomb(gb);
-            sh->slice_cr_qp_offset = get_se_golomb(gb);
-        } else {
-            sh->slice_cb_qp_offset = 0;
-            sh->slice_cr_qp_offset = 0;
-        }
-
-        if (s->pps->deblocking_filter_control_present_flag) {
-            int deblocking_filter_override_flag = 0;
-
-            if (s->pps->deblocking_filter_override_enabled_flag)
-                deblocking_filter_override_flag = get_bits1(gb);
-
-            if (deblocking_filter_override_flag) {
-                sh->disable_deblocking_filter_flag = get_bits1(gb);
-                if (!sh->disable_deblocking_filter_flag) {
-                    sh->beta_offset = get_se_golomb(gb) * 2;
-                    sh->tc_offset   = get_se_golomb(gb) * 2;
-                }
-            } else {
-                sh->disable_deblocking_filter_flag = s->pps->disable_dbf;
-                sh->beta_offset                    = s->pps->beta_offset;
-                sh->tc_offset                      = s->pps->tc_offset;
-            }
-        } else {
-            sh->disable_deblocking_filter_flag = 0;
-            sh->beta_offset                    = 0;
-            sh->tc_offset                      = 0;
-        }
-
-        if (s->pps->seq_loop_filter_across_slices_enabled_flag &&
-            (sh->slice_sample_adaptive_offset_flag[0] ||
-             sh->slice_sample_adaptive_offset_flag[1] ||
-             !sh->disable_deblocking_filter_flag)) {
-            sh->slice_loop_filter_across_slices_enabled_flag = get_bits1(gb);
-        } else {
-            sh->slice_loop_filter_across_slices_enabled_flag = s->pps->seq_loop_filter_across_slices_enabled_flag;
-        }
-    } else if (!s->slice_initialized) {
-        av_log(s->avctx, AV_LOG_ERROR, "Independent slice segment missing.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    sh->num_entry_point_offsets = 0;
-    if (s->pps->tiles_enabled_flag || s->pps->entropy_coding_sync_enabled_flag) {
-        sh->num_entry_point_offsets = get_ue_golomb_long(gb);
-        if (sh->num_entry_point_offsets > 0) {
-            int offset_len = get_ue_golomb_long(gb) + 1;
-
-            for (i = 0; i < sh->num_entry_point_offsets; i++)
-                skip_bits(gb, offset_len);
-        }
-    }
-
-    if (s->pps->slice_header_extension_present_flag) {
-        unsigned int length = get_ue_golomb_long(gb);
-        for (i = 0; i < length; i++)
-            skip_bits(gb, 8);  // slice_header_extension_data_byte
-    }
-
-    // Inferred parameters
-    sh->slice_qp = 26 + s->pps->pic_init_qp_minus26 + sh->slice_qp_delta;
-    if (sh->slice_qp > 51 ||
-        sh->slice_qp < -s->sps->qp_bd_offset) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "The slice_qp %d is outside the valid range "
-               "[%d, 51].\n",
-               sh->slice_qp,
-               -s->sps->qp_bd_offset);
-        return AVERROR_INVALIDDATA;
-    }
-
-    sh->slice_ctb_addr_rs = sh->slice_segment_addr;
-
-    if (!s->sh.slice_ctb_addr_rs && s->sh.dependent_slice_segment_flag) {
-        av_log(s->avctx, AV_LOG_ERROR, "Impossible slice segment.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->HEVClc.first_qp_group = !s->sh.dependent_slice_segment_flag;
-
-    if (!s->pps->cu_qp_delta_enabled_flag)
-        s->HEVClc.qp_y = FFUMOD(s->sh.slice_qp + 52 + 2 * s->sps->qp_bd_offset,
-                                52 + s->sps->qp_bd_offset) - s->sps->qp_bd_offset;
-
-    s->slice_initialized = 1;
-
-    return 0;
-}
-
-#define CTB(tab, x, y) ((tab)[(y) * s->sps->ctb_width + (x)])
-
-#define SET_SAO(elem, value)                            \
-do {                                                    \
-    if (!sao_merge_up_flag && !sao_merge_left_flag)     \
-        sao->elem = value;                              \
-    else if (sao_merge_left_flag)                       \
-        sao->elem = CTB(s->sao, rx-1, ry).elem;         \
-    else if (sao_merge_up_flag)                         \
-        sao->elem = CTB(s->sao, rx, ry-1).elem;         \
-    else                                                \
-        sao->elem = 0;                                  \
-} while (0)
-
-static void hls_sao_param(HEVCContext *s, int rx, int ry)
-{
-    HEVCLocalContext *lc    = &s->HEVClc;
-    int sao_merge_left_flag = 0;
-    int sao_merge_up_flag   = 0;
-    int shift               = s->sps->bit_depth - FFMIN(s->sps->bit_depth, 10);
-    SAOParams *sao          = &CTB(s->sao, rx, ry);
-    int c_idx, i;
-
-    if (s->sh.slice_sample_adaptive_offset_flag[0] ||
-        s->sh.slice_sample_adaptive_offset_flag[1]) {
-        if (rx > 0) {
-            if (lc->ctb_left_flag)
-                sao_merge_left_flag = ff_hevc_sao_merge_flag_decode(s);
-        }
-        if (ry > 0 && !sao_merge_left_flag) {
-            if (lc->ctb_up_flag)
-                sao_merge_up_flag = ff_hevc_sao_merge_flag_decode(s);
-        }
-    }
-
-    for (c_idx = 0; c_idx < 3; c_idx++) {
-        if (!s->sh.slice_sample_adaptive_offset_flag[c_idx]) {
-            sao->type_idx[c_idx] = SAO_NOT_APPLIED;
-            continue;
-        }
-
-        if (c_idx == 2) {
-            sao->type_idx[2] = sao->type_idx[1];
-            sao->eo_class[2] = sao->eo_class[1];
-        } else {
-            SET_SAO(type_idx[c_idx], ff_hevc_sao_type_idx_decode(s));
-        }
-
-        if (sao->type_idx[c_idx] == SAO_NOT_APPLIED)
-            continue;
-
-        for (i = 0; i < 4; i++)
-            SET_SAO(offset_abs[c_idx][i], ff_hevc_sao_offset_abs_decode(s));
-
-        if (sao->type_idx[c_idx] == SAO_BAND) {
-            for (i = 0; i < 4; i++) {
-                if (sao->offset_abs[c_idx][i]) {
-                    SET_SAO(offset_sign[c_idx][i],
-                            ff_hevc_sao_offset_sign_decode(s));
-                } else {
-                    sao->offset_sign[c_idx][i] = 0;
-                }
-            }
-            SET_SAO(band_position[c_idx], ff_hevc_sao_band_position_decode(s));
-        } else if (c_idx != 2) {
-            SET_SAO(eo_class[c_idx], ff_hevc_sao_eo_class_decode(s));
-        }
-
-        // Inferred parameters
-        sao->offset_val[c_idx][0] = 0;
-        for (i = 0; i < 4; i++) {
-            sao->offset_val[c_idx][i + 1] = sao->offset_abs[c_idx][i] << shift;
-            if (sao->type_idx[c_idx] == SAO_EDGE) {
-                if (i > 1)
-                    sao->offset_val[c_idx][i + 1] = -sao->offset_val[c_idx][i + 1];
-            } else if (sao->offset_sign[c_idx][i]) {
-                sao->offset_val[c_idx][i + 1] = -sao->offset_val[c_idx][i + 1];
-            }
-        }
-    }
-}
-
-#undef SET_SAO
-#undef CTB
-
-static void hls_residual_coding(HEVCContext *s, int x0, int y0,
-                                int log2_trafo_size, enum ScanType scan_idx,
-                                int c_idx)
-{
-#define GET_COORD(offset, n)                                    \
-    do {                                                        \
-        x_c = (scan_x_cg[offset >> 4] << 2) + scan_x_off[n];    \
-        y_c = (scan_y_cg[offset >> 4] << 2) + scan_y_off[n];    \
-    } while (0)
-    HEVCLocalContext *lc    = &s->HEVClc;
-    int transform_skip_flag = 0;
-
-    int last_significant_coeff_x, last_significant_coeff_y;
-    int last_scan_pos;
-    int n_end;
-    int num_coeff    = 0;
-    int greater1_ctx = 1;
-
-    int num_last_subset;
-    int x_cg_last_sig, y_cg_last_sig;
-
-    const uint8_t *scan_x_cg, *scan_y_cg, *scan_x_off, *scan_y_off;
-
-    ptrdiff_t stride = s->frame->linesize[c_idx];
-    int hshift       = s->sps->hshift[c_idx];
-    int vshift       = s->sps->vshift[c_idx];
-    uint8_t *dst     = &s->frame->data[c_idx][(y0 >> vshift) * stride +
-                                              ((x0 >> hshift) << s->sps->pixel_shift)];
-    DECLARE_ALIGNED(16, int16_t, coeffs[MAX_TB_SIZE * MAX_TB_SIZE]) = { 0 };
-    DECLARE_ALIGNED(8, uint8_t, significant_coeff_group_flag[8][8]) = { { 0 } };
-
-    int trafo_size = 1 << log2_trafo_size;
-    int i, qp, shift, add, scale, scale_m;
-    const uint8_t level_scale[] = { 40, 45, 51, 57, 64, 72 };
-    const uint8_t *scale_matrix;
-    uint8_t dc_scale;
-
-    // Derive QP for dequant
-    if (!lc->cu.cu_transquant_bypass_flag) {
-        static const int qp_c[] = {
-            29, 30, 31, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37
-        };
-
-        static const uint8_t rem6[51 + 2 * 6 + 1] = {
-            0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2,
-            3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5,
-            0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
-        };
-
-        static const uint8_t div6[51 + 2 * 6 + 1] = {
-            0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,  3,  3,  3,
-            3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6,  6,  6,  6,
-            7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
-        };
-        int qp_y = lc->qp_y;
-
-        if (c_idx == 0) {
-            qp = qp_y + s->sps->qp_bd_offset;
-        } else {
-            int qp_i, offset;
-
-            if (c_idx == 1)
-                offset = s->pps->cb_qp_offset + s->sh.slice_cb_qp_offset;
-            else
-                offset = s->pps->cr_qp_offset + s->sh.slice_cr_qp_offset;
-
-            qp_i = av_clip_c(qp_y + offset, -s->sps->qp_bd_offset, 57);
-            if (qp_i < 30)
-                qp = qp_i;
-            else if (qp_i > 43)
-                qp = qp_i - 6;
-            else
-                qp = qp_c[qp_i - 30];
-
-            qp += s->sps->qp_bd_offset;
-        }
-
-        shift    = s->sps->bit_depth + log2_trafo_size - 5;
-        add      = 1 << (shift - 1);
-        scale    = level_scale[rem6[qp]] << (div6[qp]);
-        scale_m  = 16; // default when no custom scaling lists.
-        dc_scale = 16;
-
-        if (s->sps->scaling_list_enable_flag) {
-            const ScalingList *sl = s->pps->scaling_list_data_present_flag ?
-                                    &s->pps->scaling_list : &s->sps->scaling_list;
-            int matrix_id = lc->cu.pred_mode != MODE_INTRA;
-
-            if (log2_trafo_size != 5)
-                matrix_id = 3 * matrix_id + c_idx;
-
-            scale_matrix = sl->sl[log2_trafo_size - 2][matrix_id];
-            if (log2_trafo_size >= 4)
-                dc_scale = sl->sl_dc[log2_trafo_size - 4][matrix_id];
-        }
-    }
-
-    if (s->pps->transform_skip_enabled_flag &&
-        !lc->cu.cu_transquant_bypass_flag   &&
-        log2_trafo_size == 2) {
-        transform_skip_flag = ff_hevc_transform_skip_flag_decode(s, c_idx);
-    }
-
-    last_significant_coeff_x =
-        ff_hevc_last_significant_coeff_x_prefix_decode(s, c_idx, log2_trafo_size);
-    last_significant_coeff_y =
-        ff_hevc_last_significant_coeff_y_prefix_decode(s, c_idx, log2_trafo_size);
-
-    if (last_significant_coeff_x > 3) {
-        int suffix = ff_hevc_last_significant_coeff_suffix_decode(s, last_significant_coeff_x);
-        last_significant_coeff_x = (1 << ((last_significant_coeff_x >> 1) - 1)) *
-                                   (2 + (last_significant_coeff_x & 1)) +
-                                   suffix;
-    }
-
-    if (last_significant_coeff_y > 3) {
-        int suffix = ff_hevc_last_significant_coeff_suffix_decode(s, last_significant_coeff_y);
-        last_significant_coeff_y = (1 << ((last_significant_coeff_y >> 1) - 1)) *
-                                   (2 + (last_significant_coeff_y & 1)) +
-                                   suffix;
-    }
-
-    if (scan_idx == SCAN_VERT)
-        FFSWAP(int, last_significant_coeff_x, last_significant_coeff_y);
-
-    x_cg_last_sig = last_significant_coeff_x >> 2;
-    y_cg_last_sig = last_significant_coeff_y >> 2;
-
-    switch (scan_idx) {
-    case SCAN_DIAG: {
-        int last_x_c = last_significant_coeff_x & 3;
-        int last_y_c = last_significant_coeff_y & 3;
-
-        scan_x_off = ff_hevc_diag_scan4x4_x;
-        scan_y_off = ff_hevc_diag_scan4x4_y;
-        num_coeff  = diag_scan4x4_inv[last_y_c][last_x_c];
-        if (trafo_size == 4) {
-            scan_x_cg = scan_1x1;
-            scan_y_cg = scan_1x1;
-        } else if (trafo_size == 8) {
-            num_coeff += diag_scan2x2_inv[y_cg_last_sig][x_cg_last_sig] << 4;
-            scan_x_cg  = diag_scan2x2_x;
-            scan_y_cg  = diag_scan2x2_y;
-        } else if (trafo_size == 16) {
-            num_coeff += diag_scan4x4_inv[y_cg_last_sig][x_cg_last_sig] << 4;
-            scan_x_cg  = ff_hevc_diag_scan4x4_x;
-            scan_y_cg  = ff_hevc_diag_scan4x4_y;
-        } else { // trafo_size == 32
-            num_coeff += diag_scan8x8_inv[y_cg_last_sig][x_cg_last_sig] << 4;
-            scan_x_cg  = ff_hevc_diag_scan8x8_x;
-            scan_y_cg  = ff_hevc_diag_scan8x8_y;
-        }
-        break;
-    }
-    case SCAN_HORIZ:
-        scan_x_cg  = horiz_scan2x2_x;
-        scan_y_cg  = horiz_scan2x2_y;
-        scan_x_off = horiz_scan4x4_x;
-        scan_y_off = horiz_scan4x4_y;
-        num_coeff  = horiz_scan8x8_inv[last_significant_coeff_y][last_significant_coeff_x];
-        break;
-    default: //SCAN_VERT
-        scan_x_cg  = horiz_scan2x2_y;
-        scan_y_cg  = horiz_scan2x2_x;
-        scan_x_off = horiz_scan4x4_y;
-        scan_y_off = horiz_scan4x4_x;
-        num_coeff  = horiz_scan8x8_inv[last_significant_coeff_x][last_significant_coeff_y];
-        break;
-    }
-    num_coeff++;
-    num_last_subset = (num_coeff - 1) >> 4;
-
-    for (i = num_last_subset; i >= 0; i--) {
-        int n, m;
-        int x_cg, y_cg, x_c, y_c;
-        int implicit_non_zero_coeff = 0;
-        int64_t trans_coeff_level;
-        int prev_sig = 0;
-        int offset   = i << 4;
-
-        uint8_t significant_coeff_flag_idx[16];
-        uint8_t nb_significant_coeff_flag = 0;
-
-        x_cg = scan_x_cg[i];
-        y_cg = scan_y_cg[i];
-
-        if (i < num_last_subset && i > 0) {
-            int ctx_cg = 0;
-            if (x_cg < (1 << (log2_trafo_size - 2)) - 1)
-                ctx_cg += significant_coeff_group_flag[x_cg + 1][y_cg];
-            if (y_cg < (1 << (log2_trafo_size - 2)) - 1)
-                ctx_cg += significant_coeff_group_flag[x_cg][y_cg + 1];
-
-            significant_coeff_group_flag[x_cg][y_cg] =
-                ff_hevc_significant_coeff_group_flag_decode(s, c_idx, ctx_cg);
-            implicit_non_zero_coeff = 1;
-        } else {
-            significant_coeff_group_flag[x_cg][y_cg] =
-                ((x_cg == x_cg_last_sig && y_cg == y_cg_last_sig) ||
-                 (x_cg == 0 && y_cg == 0));
-        }
-
-        last_scan_pos = num_coeff - offset - 1;
-
-        if (i == num_last_subset) {
-            n_end                         = last_scan_pos - 1;
-            significant_coeff_flag_idx[0] = last_scan_pos;
-            nb_significant_coeff_flag     = 1;
-        } else {
-            n_end = 15;
-        }
-
-        if (x_cg < ((1 << log2_trafo_size) - 1) >> 2)
-            prev_sig = significant_coeff_group_flag[x_cg + 1][y_cg];
-        if (y_cg < ((1 << log2_trafo_size) - 1) >> 2)
-            prev_sig += significant_coeff_group_flag[x_cg][y_cg + 1] << 1;
-
-        for (n = n_end; n >= 0; n--) {
-            GET_COORD(offset, n);
-
-            if (significant_coeff_group_flag[x_cg][y_cg] &&
-                (n > 0 || implicit_non_zero_coeff == 0)) {
-                if (ff_hevc_significant_coeff_flag_decode(s, c_idx, x_c, y_c,
-                                                          log2_trafo_size,
-                                                          scan_idx,
-                                                          prev_sig) == 1) {
-                    significant_coeff_flag_idx[nb_significant_coeff_flag] = n;
-                    nb_significant_coeff_flag++;
-                    implicit_non_zero_coeff = 0;
-                }
-            } else {
-                int last_cg = (x_c == (x_cg << 2) && y_c == (y_cg << 2));
-                if (last_cg && implicit_non_zero_coeff && significant_coeff_group_flag[x_cg][y_cg]) {
-                    significant_coeff_flag_idx[nb_significant_coeff_flag] = n;
-                    nb_significant_coeff_flag++;
-                }
-            }
-        }
-
-        n_end = nb_significant_coeff_flag;
-
-        if (n_end) {
-            int first_nz_pos_in_cg = 16;
-            int last_nz_pos_in_cg = -1;
-            int c_rice_param = 0;
-            int first_greater1_coeff_idx = -1;
-            uint8_t coeff_abs_level_greater1_flag[16] = { 0 };
-            uint16_t coeff_sign_flag;
-            int sum_abs = 0;
-            int sign_hidden = 0;
-
-            // initialize first elem of coeff_bas_level_greater1_flag
-            int ctx_set = (i > 0 && c_idx == 0) ? 2 : 0;
-
-            if (!(i == num_last_subset) && greater1_ctx == 0)
-                ctx_set++;
-            greater1_ctx      = 1;
-            last_nz_pos_in_cg = significant_coeff_flag_idx[0];
-
-            for (m = 0; m < (n_end > 8 ? 8 : n_end); m++) {
-                int n_idx = significant_coeff_flag_idx[m];
-                int inc   = (ctx_set << 2) + greater1_ctx;
-                coeff_abs_level_greater1_flag[n_idx] =
-                    ff_hevc_coeff_abs_level_greater1_flag_decode(s, c_idx, inc);
-                if (coeff_abs_level_greater1_flag[n_idx]) {
-                    greater1_ctx = 0;
-                } else if (greater1_ctx > 0 && greater1_ctx < 3) {
-                    greater1_ctx++;
-                }
-
-                if (coeff_abs_level_greater1_flag[n_idx] &&
-                    first_greater1_coeff_idx == -1)
-                    first_greater1_coeff_idx = n_idx;
-            }
-            first_nz_pos_in_cg = significant_coeff_flag_idx[n_end - 1];
-            sign_hidden        = last_nz_pos_in_cg - first_nz_pos_in_cg >= 4 &&
-                                 !lc->cu.cu_transquant_bypass_flag;
-
-            if (first_greater1_coeff_idx != -1) {
-                coeff_abs_level_greater1_flag[first_greater1_coeff_idx] += ff_hevc_coeff_abs_level_greater2_flag_decode(s, c_idx, ctx_set);
-            }
-            if (!s->pps->sign_data_hiding_flag || !sign_hidden) {
-                coeff_sign_flag = ff_hevc_coeff_sign_flag(s, nb_significant_coeff_flag) << (16 - nb_significant_coeff_flag);
-            } else {
-                coeff_sign_flag = ff_hevc_coeff_sign_flag(s, nb_significant_coeff_flag - 1) << (16 - (nb_significant_coeff_flag - 1));
-            }
-
-            for (m = 0; m < n_end; m++) {
-                n = significant_coeff_flag_idx[m];
-                GET_COORD(offset, n);
-                trans_coeff_level = 1 + coeff_abs_level_greater1_flag[n];
-                if (trans_coeff_level == ((m < 8) ?
-                                          ((n == first_greater1_coeff_idx) ? 3 : 2) : 1)) {
-                    int last_coeff_abs_level_remaining = ff_hevc_coeff_abs_level_remaining(s, trans_coeff_level, c_rice_param);
-
-                    trans_coeff_level += last_coeff_abs_level_remaining;
-                    if ((trans_coeff_level) > (3 * (1 << c_rice_param)))
-                        c_rice_param = FFMIN(c_rice_param + 1, 4);
-                }
-                if (s->pps->sign_data_hiding_flag && sign_hidden) {
-                    sum_abs += trans_coeff_level;
-                    if (n == first_nz_pos_in_cg && ((sum_abs & 1) == 1))
-                        trans_coeff_level = -trans_coeff_level;
-                }
-                if (coeff_sign_flag >> 15)
-                    trans_coeff_level = -trans_coeff_level;
-                coeff_sign_flag <<= 1;
-                if (!lc->cu.cu_transquant_bypass_flag) {
-                    if (s->sps->scaling_list_enable_flag) {
-                        if (y_c || x_c || log2_trafo_size < 4) {
-                            int pos;
-                            switch (log2_trafo_size) {
-                            case 3:  pos = (y_c        << 3) +  x_c;       break;
-                            case 4:  pos = ((y_c >> 1) << 3) + (x_c >> 1); break;
-                            case 5:  pos = ((y_c >> 2) << 3) + (x_c >> 2); break;
-                            default: pos = (y_c        << 2) +  x_c;
-                            }
-                            scale_m = scale_matrix[pos];
-                        } else {
-                            scale_m = dc_scale;
-                        }
-                    }
-                    trans_coeff_level = (trans_coeff_level * (int64_t)scale * (int64_t)scale_m + add) >> shift;
-                    if(trans_coeff_level < 0) {
-                        if((~trans_coeff_level) & 0xFffffffffff8000)
-                            trans_coeff_level = -32768;
-                    } else {
-                        if (trans_coeff_level & 0xffffffffffff8000)
-                            trans_coeff_level = 32767;
-                    }
-                }
-                coeffs[y_c * trafo_size + x_c] = trans_coeff_level;
-            }
-        }
-    }
-
-    if (lc->cu.cu_transquant_bypass_flag) {
-        s->hevcdsp.transquant_bypass[log2_trafo_size - 2](dst, coeffs, stride);
-    } else {
-        if (transform_skip_flag)
-            s->hevcdsp.transform_skip(dst, coeffs, stride);
-        else if (lc->cu.pred_mode == MODE_INTRA && c_idx == 0 &&
-                 log2_trafo_size == 2)
-            s->hevcdsp.transform_4x4_luma_add(dst, coeffs, stride);
-        else
-            s->hevcdsp.transform_add[log2_trafo_size - 2](dst, coeffs, stride);
-    }
-}
-
-static int hls_transform_unit(HEVCContext *s, int x0, int y0,
-                              int xBase, int yBase, int cb_xBase, int cb_yBase,
-                              int log2_cb_size, int log2_trafo_size,
-                              int trafo_depth, int blk_idx)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-
-    if (lc->cu.pred_mode == MODE_INTRA) {
-        int trafo_size = 1 << log2_trafo_size;
-        ff_hevc_set_neighbour_available(s, x0, y0, trafo_size, trafo_size);
-
-        s->hpc.intra_pred(s, x0, y0, log2_trafo_size, 0);
-        if (log2_trafo_size > 2) {
-            trafo_size = trafo_size << (s->sps->hshift[1] - 1);
-            ff_hevc_set_neighbour_available(s, x0, y0, trafo_size, trafo_size);
-            s->hpc.intra_pred(s, x0, y0, log2_trafo_size - 1, 1);
-            s->hpc.intra_pred(s, x0, y0, log2_trafo_size - 1, 2);
-        } else if (blk_idx == 3) {
-            trafo_size = trafo_size << s->sps->hshift[1];
-            ff_hevc_set_neighbour_available(s, xBase, yBase,
-                                            trafo_size, trafo_size);
-            s->hpc.intra_pred(s, xBase, yBase, log2_trafo_size, 1);
-            s->hpc.intra_pred(s, xBase, yBase, log2_trafo_size, 2);
-        }
-    }
-
-    if (lc->tt.cbf_luma ||
-        SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) ||
-        SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0)) {
-        int scan_idx   = SCAN_DIAG;
-        int scan_idx_c = SCAN_DIAG;
-
-        if (s->pps->cu_qp_delta_enabled_flag && !lc->tu.is_cu_qp_delta_coded) {
-            lc->tu.cu_qp_delta = ff_hevc_cu_qp_delta_abs(s);
-            if (lc->tu.cu_qp_delta != 0)
-                if (ff_hevc_cu_qp_delta_sign_flag(s) == 1)
-                    lc->tu.cu_qp_delta = -lc->tu.cu_qp_delta;
-            lc->tu.is_cu_qp_delta_coded = 1;
-
-            if (lc->tu.cu_qp_delta < -(26 + s->sps->qp_bd_offset / 2) ||
-                lc->tu.cu_qp_delta >  (25 + s->sps->qp_bd_offset / 2)) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "The cu_qp_delta %d is outside the valid range "
-                       "[%d, %d].\n",
-                       lc->tu.cu_qp_delta,
-                       -(26 + s->sps->qp_bd_offset / 2),
-                        (25 + s->sps->qp_bd_offset / 2));
-                return AVERROR_INVALIDDATA;
-            }
-
-            ff_hevc_set_qPy(s, x0, y0, cb_xBase, cb_yBase, log2_cb_size);
-        }
-
-        if (lc->cu.pred_mode == MODE_INTRA && log2_trafo_size < 4) {
-            if (lc->tu.cur_intra_pred_mode >= 6 &&
-                lc->tu.cur_intra_pred_mode <= 14) {
-                scan_idx = SCAN_VERT;
-            } else if (lc->tu.cur_intra_pred_mode >= 22 &&
-                       lc->tu.cur_intra_pred_mode <= 30) {
-                scan_idx = SCAN_HORIZ;
-            }
-
-            if (lc->pu.intra_pred_mode_c >=  6 &&
-                lc->pu.intra_pred_mode_c <= 14) {
-                scan_idx_c = SCAN_VERT;
-            } else if (lc->pu.intra_pred_mode_c >= 22 &&
-                       lc->pu.intra_pred_mode_c <= 30) {
-                scan_idx_c = SCAN_HORIZ;
-            }
-        }
-
-        if (lc->tt.cbf_luma)
-            hls_residual_coding(s, x0, y0, log2_trafo_size, scan_idx, 0);
-        if (log2_trafo_size > 2) {
-            if (SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0))
-                hls_residual_coding(s, x0, y0, log2_trafo_size - 1, scan_idx_c, 1);
-            if (SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0))
-                hls_residual_coding(s, x0, y0, log2_trafo_size - 1, scan_idx_c, 2);
-        } else if (blk_idx == 3) {
-            if (SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], xBase, yBase))
-                hls_residual_coding(s, xBase, yBase, log2_trafo_size, scan_idx_c, 1);
-            if (SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], xBase, yBase))
-                hls_residual_coding(s, xBase, yBase, log2_trafo_size, scan_idx_c, 2);
-        }
-    }
-    return 0;
-}
-
-static void set_deblocking_bypass(HEVCContext *s, int x0, int y0, int log2_cb_size)
-{
-    int cb_size          = 1 << log2_cb_size;
-    int log2_min_pu_size = s->sps->log2_min_pu_size;
-
-    int min_pu_width     = s->sps->min_pu_width;
-    int x_end = FFMIN(x0 + cb_size, s->sps->width);
-    int y_end = FFMIN(y0 + cb_size, s->sps->height);
-    int i, j;
-
-    for (j = (y0 >> log2_min_pu_size); j < (y_end >> log2_min_pu_size); j++)
-        for (i = (x0 >> log2_min_pu_size); i < (x_end >> log2_min_pu_size); i++)
-            s->is_pcm[i + j * min_pu_width] = 2;
-}
-
-static int hls_transform_tree(HEVCContext *s, int x0, int y0,
-                              int xBase, int yBase, int cb_xBase, int cb_yBase,
-                              int log2_cb_size, int log2_trafo_size,
-                              int trafo_depth, int blk_idx)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    uint8_t split_transform_flag;
-    int ret;
-
-    if (trafo_depth > 0 && log2_trafo_size == 2) {
-        SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) =
-            SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth - 1], xBase, yBase);
-        SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0) =
-            SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth - 1], xBase, yBase);
-    } else {
-        SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) =
-        SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0) = 0;
-    }
-
-    if (lc->cu.intra_split_flag) {
-        if (trafo_depth == 1)
-            lc->tu.cur_intra_pred_mode = lc->pu.intra_pred_mode[blk_idx];
-    } else {
-        lc->tu.cur_intra_pred_mode = lc->pu.intra_pred_mode[0];
-    }
-
-    lc->tt.cbf_luma = 1;
-
-    lc->tt.inter_split_flag = s->sps->max_transform_hierarchy_depth_inter == 0 &&
-                              lc->cu.pred_mode == MODE_INTER &&
-                              lc->cu.part_mode != PART_2Nx2N &&
-                              trafo_depth == 0;
-
-    if (log2_trafo_size <= s->sps->log2_max_trafo_size &&
-        log2_trafo_size >  s->sps->log2_min_tb_size    &&
-        trafo_depth     < lc->cu.max_trafo_depth       &&
-        !(lc->cu.intra_split_flag && trafo_depth == 0)) {
-        split_transform_flag = ff_hevc_split_transform_flag_decode(s, log2_trafo_size);
-    } else {
-        split_transform_flag = log2_trafo_size > s->sps->log2_max_trafo_size ||
-                               (lc->cu.intra_split_flag && trafo_depth == 0) ||
-                               lc->tt.inter_split_flag;
-    }
-
-    if (log2_trafo_size > 2) {
-        if (trafo_depth == 0 ||
-            SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth - 1], xBase, yBase)) {
-            SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) =
-                ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
-        }
-
-        if (trafo_depth == 0 ||
-            SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth - 1], xBase, yBase)) {
-            SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0) =
-                ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
-        }
-    }
-
-    if (split_transform_flag) {
-        int x1 = x0 + ((1 << log2_trafo_size) >> 1);
-        int y1 = y0 + ((1 << log2_trafo_size) >> 1);
-
-        ret = hls_transform_tree(s, x0, y0, x0, y0, cb_xBase, cb_yBase,
-                                 log2_cb_size, log2_trafo_size - 1,
-                                 trafo_depth + 1, 0);
-        if (ret < 0)
-            return ret;
-        ret = hls_transform_tree(s, x1, y0, x0, y0, cb_xBase, cb_yBase,
-                                 log2_cb_size, log2_trafo_size - 1,
-                                 trafo_depth + 1, 1);
-        if (ret < 0)
-            return ret;
-        ret = hls_transform_tree(s, x0, y1, x0, y0, cb_xBase, cb_yBase,
-                                 log2_cb_size, log2_trafo_size - 1,
-                                 trafo_depth + 1, 2);
-        if (ret < 0)
-            return ret;
-        ret = hls_transform_tree(s, x1, y1, x0, y0, cb_xBase, cb_yBase,
-                                 log2_cb_size, log2_trafo_size - 1,
-                                 trafo_depth + 1, 3);
-        if (ret < 0)
-            return ret;
-    } else {
-        int min_tu_size      = 1 << s->sps->log2_min_tb_size;
-        int log2_min_tu_size = s->sps->log2_min_tb_size;
-        int min_tu_width     = s->sps->min_tb_width;
-
-        if (lc->cu.pred_mode == MODE_INTRA || trafo_depth != 0 ||
-            SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) ||
-            SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0)) {
-            lc->tt.cbf_luma = ff_hevc_cbf_luma_decode(s, trafo_depth);
-        }
-
-        ret = hls_transform_unit(s, x0, y0, xBase, yBase, cb_xBase, cb_yBase,
-                                 log2_cb_size, log2_trafo_size, trafo_depth,
-                                 blk_idx);
-        if (ret < 0)
-            return ret;
-        // TODO: store cbf_luma somewhere else
-        if (lc->tt.cbf_luma) {
-            int i, j;
-            for (i = 0; i < (1 << log2_trafo_size); i += min_tu_size)
-                for (j = 0; j < (1 << log2_trafo_size); j += min_tu_size) {
-                    int x_tu = (x0 + j) >> log2_min_tu_size;
-                    int y_tu = (y0 + i) >> log2_min_tu_size;
-                    s->cbf_luma[y_tu * min_tu_width + x_tu] = 1;
-                }
-        }
-        if (!s->sh.disable_deblocking_filter_flag) {
-            ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_trafo_size,
-                                                  lc->slice_or_tiles_up_boundary,
-                                                  lc->slice_or_tiles_left_boundary);
-            if (s->pps->transquant_bypass_enable_flag &&
-                lc->cu.cu_transquant_bypass_flag)
-                set_deblocking_bypass(s, x0, y0, log2_trafo_size);
-        }
-    }
-    return 0;
-}
-
-static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
-{
-    //TODO: non-4:2:0 support
-    HEVCLocalContext *lc = &s->HEVClc;
-    GetBitContext gb;
-    int cb_size   = 1 << log2_cb_size;
-    int stride0   = s->frame->linesize[0];
-    uint8_t *dst0 = &s->frame->data[0][y0 * stride0 + (x0 << s->sps->pixel_shift)];
-    int   stride1 = s->frame->linesize[1];
-    uint8_t *dst1 = &s->frame->data[1][(y0 >> s->sps->vshift[1]) * stride1 + ((x0 >> s->sps->hshift[1]) << s->sps->pixel_shift)];
-    int   stride2 = s->frame->linesize[2];
-    uint8_t *dst2 = &s->frame->data[2][(y0 >> s->sps->vshift[2]) * stride2 + ((x0 >> s->sps->hshift[2]) << s->sps->pixel_shift)];
-
-    int length         = cb_size * cb_size * s->sps->pcm.bit_depth + ((cb_size * cb_size) >> 1) * s->sps->pcm.bit_depth_chroma;
-    const uint8_t *pcm = skip_bytes(&s->HEVClc.cc, (length + 7) >> 3);
-    int ret;
-
-    ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size,
-                                          lc->slice_or_tiles_up_boundary,
-                                          lc->slice_or_tiles_left_boundary);
-
-    ret = init_get_bits(&gb, pcm, length);
-    if (ret < 0)
-        return ret;
-
-    s->hevcdsp.put_pcm(dst0, stride0, cb_size,     &gb, s->sps->pcm.bit_depth);
-    s->hevcdsp.put_pcm(dst1, stride1, cb_size / 2, &gb, s->sps->pcm.bit_depth_chroma);
-    s->hevcdsp.put_pcm(dst2, stride2, cb_size / 2, &gb, s->sps->pcm.bit_depth_chroma);
-    return 0;
-}
-
-static void hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    int x = ff_hevc_abs_mvd_greater0_flag_decode(s);
-    int y = ff_hevc_abs_mvd_greater0_flag_decode(s);
-
-    if (x)
-        x += ff_hevc_abs_mvd_greater1_flag_decode(s);
-    if (y)
-        y += ff_hevc_abs_mvd_greater1_flag_decode(s);
-
-    switch (x) {
-    case 2: lc->pu.mvd.x = ff_hevc_mvd_decode(s);           break;
-    case 1: lc->pu.mvd.x = ff_hevc_mvd_sign_flag_decode(s); break;
-    case 0: lc->pu.mvd.x = 0;                               break;
-    }
-
-    switch (y) {
-    case 2: lc->pu.mvd.y = ff_hevc_mvd_decode(s);           break;
-    case 1: lc->pu.mvd.y = ff_hevc_mvd_sign_flag_decode(s); break;
-    case 0: lc->pu.mvd.y = 0;                               break;
-    }
-}
-
-/**
- * 8.5.3.2.2.1 Luma sample interpolation process
- *
- * @param s HEVC decoding context
- * @param dst target buffer for block data at block position
- * @param dststride stride of the dst buffer
- * @param ref reference picture buffer at origin (0, 0)
- * @param mv motion vector (relative to block position) to get pixel data from
- * @param x_off horizontal position of block from origin (0, 0)
- * @param y_off vertical position of block from origin (0, 0)
- * @param block_w width of block
- * @param block_h height of block
- */
-static void luma_mc(HEVCContext *s, int16_t *dst, ptrdiff_t dststride,
-                    AVFrame *ref, const Mv *mv, int x_off, int y_off,
-                    int block_w, int block_h)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    uint8_t *src         = ref->data[0];
-    ptrdiff_t srcstride  = ref->linesize[0];
-    int pic_width        = s->sps->width;
-    int pic_height       = s->sps->height;
-
-    int mx         = mv->x & 3;
-    int my         = mv->y & 3;
-    int extra_left = ff_hevc_qpel_extra_before[mx];
-    int extra_top  = ff_hevc_qpel_extra_before[my];
-
-    x_off += mv->x >> 2;
-    y_off += mv->y >> 2;
-    src   += y_off * srcstride + (x_off << s->sps->pixel_shift);
-
-    if (x_off < extra_left || y_off < extra_top ||
-        x_off >= pic_width - block_w - ff_hevc_qpel_extra_after[mx] ||
-        y_off >= pic_height - block_h - ff_hevc_qpel_extra_after[my]) {
-        const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
-        int offset = extra_top * srcstride + (extra_left << s->sps->pixel_shift);
-        int buf_offset = extra_top *
-                         edge_emu_stride + (extra_left << s->sps->pixel_shift);
-
-        s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src - offset,
-                                 edge_emu_stride, srcstride,
-                                 block_w + ff_hevc_qpel_extra[mx],
-                                 block_h + ff_hevc_qpel_extra[my],
-                                 x_off - extra_left, y_off - extra_top,
-                                 pic_width, pic_height);
-        src = lc->edge_emu_buffer + buf_offset;
-        srcstride = edge_emu_stride;
-    }
-    s->hevcdsp.put_hevc_qpel[my][mx](dst, dststride, src, srcstride, block_w,
-                                     block_h, lc->mc_buffer);
-}
-
-/**
- * 8.5.3.2.2.2 Chroma sample interpolation process
- *
- * @param s HEVC decoding context
- * @param dst1 target buffer for block data at block position (U plane)
- * @param dst2 target buffer for block data at block position (V plane)
- * @param dststride stride of the dst1 and dst2 buffers
- * @param ref reference picture buffer at origin (0, 0)
- * @param mv motion vector (relative to block position) to get pixel data from
- * @param x_off horizontal position of block from origin (0, 0)
- * @param y_off vertical position of block from origin (0, 0)
- * @param block_w width of block
- * @param block_h height of block
- */
-static void chroma_mc(HEVCContext *s, int16_t *dst1, int16_t *dst2,
-                      ptrdiff_t dststride, AVFrame *ref, const Mv *mv,
-                      int x_off, int y_off, int block_w, int block_h)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    uint8_t *src1        = ref->data[1];
-    uint8_t *src2        = ref->data[2];
-    ptrdiff_t src1stride = ref->linesize[1];
-    ptrdiff_t src2stride = ref->linesize[2];
-    int pic_width        = s->sps->width >> 1;
-    int pic_height       = s->sps->height >> 1;
-
-    int mx = mv->x & 7;
-    int my = mv->y & 7;
-
-    x_off += mv->x >> 3;
-    y_off += mv->y >> 3;
-    src1  += y_off * src1stride + (x_off << s->sps->pixel_shift);
-    src2  += y_off * src2stride + (x_off << s->sps->pixel_shift);
-
-    if (x_off < EPEL_EXTRA_BEFORE || y_off < EPEL_EXTRA_AFTER ||
-        x_off >= pic_width - block_w - EPEL_EXTRA_AFTER ||
-        y_off >= pic_height - block_h - EPEL_EXTRA_AFTER) {
-        const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << s->sps->pixel_shift;
-        int offset1 = EPEL_EXTRA_BEFORE * (src1stride + (1 << s->sps->pixel_shift));
-        int buf_offset1 = EPEL_EXTRA_BEFORE *
-                          (edge_emu_stride + (1 << s->sps->pixel_shift));
-        int offset2 = EPEL_EXTRA_BEFORE * (src2stride + (1 << s->sps->pixel_shift));
-        int buf_offset2 = EPEL_EXTRA_BEFORE *
-                          (edge_emu_stride + (1 << s->sps->pixel_shift));
-
-        s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src1 - offset1,
-                                 edge_emu_stride, src1stride,
-                                 block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
-                                 x_off - EPEL_EXTRA_BEFORE,
-                                 y_off - EPEL_EXTRA_BEFORE,
-                                 pic_width, pic_height);
-
-        src1 = lc->edge_emu_buffer + buf_offset1;
-        src1stride = edge_emu_stride;
-        s->hevcdsp.put_hevc_epel[!!my][!!mx](dst1, dststride, src1, src1stride,
-                                             block_w, block_h, mx, my, lc->mc_buffer);
-
-        s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src2 - offset2,
-                                 edge_emu_stride, src2stride,
-                                 block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
-                                 x_off - EPEL_EXTRA_BEFORE,
-                                 y_off - EPEL_EXTRA_BEFORE,
-                                 pic_width, pic_height);
-        src2 = lc->edge_emu_buffer + buf_offset2;
-        src2stride = edge_emu_stride;
-
-        s->hevcdsp.put_hevc_epel[!!my][!!mx](dst2, dststride, src2, src2stride,
-                                             block_w, block_h, mx, my,
-                                             lc->mc_buffer);
-    } else {
-        s->hevcdsp.put_hevc_epel[!!my][!!mx](dst1, dststride, src1, src1stride,
-                                             block_w, block_h, mx, my,
-                                             lc->mc_buffer);
-        s->hevcdsp.put_hevc_epel[!!my][!!mx](dst2, dststride, src2, src2stride,
-                                             block_w, block_h, mx, my,
-                                             lc->mc_buffer);
-    }
-}
-
-static void hevc_await_progress(HEVCContext *s, HEVCFrame *ref,
-                                const Mv *mv, int y0, int height)
-{
-    int y = (mv->y >> 2) + y0 + height + 9;
-    ff_thread_await_progress(&ref->tf, y, 0);
-}
-
-static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
-                                int nPbW, int nPbH,
-                                int log2_cb_size, int partIdx)
-{
-#define POS(c_idx, x, y)                                                              \
-    &s->frame->data[c_idx][((y) >> s->sps->vshift[c_idx]) * s->frame->linesize[c_idx] + \
-                           (((x) >> s->sps->hshift[c_idx]) << s->sps->pixel_shift)]
-    HEVCLocalContext *lc = &s->HEVClc;
-    int merge_idx = 0;
-    struct MvField current_mv = {{{ 0 }}};
-
-    int min_pu_width = s->sps->min_pu_width;
-
-    MvField *tab_mvf = s->ref->tab_mvf;
-    RefPicList  *refPicList = s->ref->refPicList;
-    HEVCFrame *ref0, *ref1;
-
-    int tmpstride = MAX_PB_SIZE;
-
-    uint8_t *dst0 = POS(0, x0, y0);
-    uint8_t *dst1 = POS(1, x0, y0);
-    uint8_t *dst2 = POS(2, x0, y0);
-    int log2_min_cb_size = s->sps->log2_min_cb_size;
-    int min_cb_width     = s->sps->min_cb_width;
-    int x_cb             = x0 >> log2_min_cb_size;
-    int y_cb             = y0 >> log2_min_cb_size;
-    int ref_idx[2];
-    int mvp_flag[2];
-    int x_pu, y_pu;
-    int i, j;
-
-    if (SAMPLE_CTB(s->skip_flag, x_cb, y_cb)) {
-        if (s->sh.max_num_merge_cand > 1)
-            merge_idx = ff_hevc_merge_idx_decode(s);
-        else
-            merge_idx = 0;
-
-        ff_hevc_luma_mv_merge_mode(s, x0, y0,
-                                   1 << log2_cb_size,
-                                   1 << log2_cb_size,
-                                   log2_cb_size, partIdx,
-                                   merge_idx, &current_mv);
-        x_pu = x0 >> s->sps->log2_min_pu_size;
-        y_pu = y0 >> s->sps->log2_min_pu_size;
-
-        for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
-            for (j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
-                tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
-    } else { /* MODE_INTER */
-        lc->pu.merge_flag = ff_hevc_merge_flag_decode(s);
-        if (lc->pu.merge_flag) {
-            if (s->sh.max_num_merge_cand > 1)
-                merge_idx = ff_hevc_merge_idx_decode(s);
-            else
-                merge_idx = 0;
-
-            ff_hevc_luma_mv_merge_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
-                                       partIdx, merge_idx, &current_mv);
-            x_pu = x0 >> s->sps->log2_min_pu_size;
-            y_pu = y0 >> s->sps->log2_min_pu_size;
-
-            for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
-                for (j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
-                    tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
-        } else {
-            enum InterPredIdc inter_pred_idc = PRED_L0;
-            ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);
-            if (s->sh.slice_type == B_SLICE)
-                inter_pred_idc = ff_hevc_inter_pred_idc_decode(s, nPbW, nPbH);
-
-            if (inter_pred_idc != PRED_L1) {
-                if (s->sh.nb_refs[L0]) {
-                    ref_idx[0] = ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L0]);
-                    current_mv.ref_idx[0] = ref_idx[0];
-                }
-                current_mv.pred_flag[0] = 1;
-                hls_mvd_coding(s, x0, y0, 0);
-                mvp_flag[0] = ff_hevc_mvp_lx_flag_decode(s);
-                ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
-                                         partIdx, merge_idx, &current_mv,
-                                         mvp_flag[0], 0);
-                current_mv.mv[0].x += lc->pu.mvd.x;
-                current_mv.mv[0].y += lc->pu.mvd.y;
-            }
-
-            if (inter_pred_idc != PRED_L0) {
-                if (s->sh.nb_refs[L1]) {
-                    ref_idx[1] = ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L1]);
-                    current_mv.ref_idx[1] = ref_idx[1];
-                }
-
-                if (s->sh.mvd_l1_zero_flag == 1 && inter_pred_idc == PRED_BI) {
-                    lc->pu.mvd.x = 0;
-                    lc->pu.mvd.y = 0;
-                } else {
-                    hls_mvd_coding(s, x0, y0, 1);
-                }
-
-                current_mv.pred_flag[1] = 1;
-                mvp_flag[1] = ff_hevc_mvp_lx_flag_decode(s);
-                ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
-                                         partIdx, merge_idx, &current_mv,
-                                         mvp_flag[1], 1);
-                current_mv.mv[1].x += lc->pu.mvd.x;
-                current_mv.mv[1].y += lc->pu.mvd.y;
-            }
-
-            x_pu = x0 >> s->sps->log2_min_pu_size;
-            y_pu = y0 >> s->sps->log2_min_pu_size;
-
-            for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
-                for(j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
-                    tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
-        }
-    }
-
-    if (current_mv.pred_flag[0]) {
-        ref0 = refPicList[0].ref[current_mv.ref_idx[0]];
-        if (!ref0)
-            return;
-        hevc_await_progress(s, ref0, &current_mv.mv[0], y0, nPbH);
-    }
-    if (current_mv.pred_flag[1]) {
-        ref1 = refPicList[1].ref[current_mv.ref_idx[1]];
-        if (!ref1)
-            return;
-        hevc_await_progress(s, ref1, &current_mv.mv[1], y0, nPbH);
-    }
-
-    if (current_mv.pred_flag[0] && !current_mv.pred_flag[1]) {
-        DECLARE_ALIGNED(16, int16_t,  tmp[MAX_PB_SIZE * MAX_PB_SIZE]);
-        DECLARE_ALIGNED(16, int16_t, tmp2[MAX_PB_SIZE * MAX_PB_SIZE]);
-
-        luma_mc(s, tmp, tmpstride, ref0->frame,
-                &current_mv.mv[0], x0, y0, nPbW, nPbH);
-
-        if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
-            (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
-            s->hevcdsp.weighted_pred(s->sh.luma_log2_weight_denom,
-                                     s->sh.luma_weight_l0[current_mv.ref_idx[0]],
-                                     s->sh.luma_offset_l0[current_mv.ref_idx[0]],
-                                     dst0, s->frame->linesize[0], tmp,
-                                     tmpstride, nPbW, nPbH);
-        } else {
-            s->hevcdsp.put_unweighted_pred(dst0, s->frame->linesize[0], tmp, tmpstride, nPbW, nPbH);
-        }
-        chroma_mc(s, tmp, tmp2, tmpstride, ref0->frame,
-                  &current_mv.mv[0], x0 / 2, y0 / 2, nPbW / 2, nPbH / 2);
-
-        if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
-            (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
-            s->hevcdsp.weighted_pred(s->sh.chroma_log2_weight_denom,
-                                     s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0],
-                                     s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0],
-                                     dst1, s->frame->linesize[1], tmp, tmpstride,
-                                     nPbW / 2, nPbH / 2);
-            s->hevcdsp.weighted_pred(s->sh.chroma_log2_weight_denom,
-                                     s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1],
-                                     s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1],
-                                     dst2, s->frame->linesize[2], tmp2, tmpstride,
-                                     nPbW / 2, nPbH / 2);
-        } else {
-            s->hevcdsp.put_unweighted_pred(dst1, s->frame->linesize[1], tmp, tmpstride, nPbW/2, nPbH/2);
-            s->hevcdsp.put_unweighted_pred(dst2, s->frame->linesize[2], tmp2, tmpstride, nPbW/2, nPbH/2);
-        }
-    } else if (!current_mv.pred_flag[0] && current_mv.pred_flag[1]) {
-        DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]);
-        DECLARE_ALIGNED(16, int16_t, tmp2[MAX_PB_SIZE * MAX_PB_SIZE]);
-
-        if (!ref1)
-            return;
-
-        luma_mc(s, tmp, tmpstride, ref1->frame,
-                &current_mv.mv[1], x0, y0, nPbW, nPbH);
-
-        if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
-            (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
-            s->hevcdsp.weighted_pred(s->sh.luma_log2_weight_denom,
-                                      s->sh.luma_weight_l1[current_mv.ref_idx[1]],
-                                      s->sh.luma_offset_l1[current_mv.ref_idx[1]],
-                                      dst0, s->frame->linesize[0], tmp, tmpstride,
-                                      nPbW, nPbH);
-        } else {
-            s->hevcdsp.put_unweighted_pred(dst0, s->frame->linesize[0], tmp, tmpstride, nPbW, nPbH);
-        }
-
-        chroma_mc(s, tmp, tmp2, tmpstride, ref1->frame,
-                  &current_mv.mv[1], x0/2, y0/2, nPbW/2, nPbH/2);
-
-        if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
-            (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
-            s->hevcdsp.weighted_pred(s->sh.chroma_log2_weight_denom,
-                                     s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0],
-                                     s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0],
-                                     dst1, s->frame->linesize[1], tmp, tmpstride, nPbW/2, nPbH/2);
-            s->hevcdsp.weighted_pred(s->sh.chroma_log2_weight_denom,
-                                     s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1],
-                                     s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1],
-                                     dst2, s->frame->linesize[2], tmp2, tmpstride, nPbW/2, nPbH/2);
-        } else {
-            s->hevcdsp.put_unweighted_pred(dst1, s->frame->linesize[1], tmp, tmpstride, nPbW/2, nPbH/2);
-            s->hevcdsp.put_unweighted_pred(dst2, s->frame->linesize[2], tmp2, tmpstride, nPbW/2, nPbH/2);
-        }
-    } else if (current_mv.pred_flag[0] && current_mv.pred_flag[1]) {
-        DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]);
-        DECLARE_ALIGNED(16, int16_t, tmp2[MAX_PB_SIZE * MAX_PB_SIZE]);
-        DECLARE_ALIGNED(16, int16_t, tmp3[MAX_PB_SIZE * MAX_PB_SIZE]);
-        DECLARE_ALIGNED(16, int16_t, tmp4[MAX_PB_SIZE * MAX_PB_SIZE]);
-        HEVCFrame *ref0 = refPicList[0].ref[current_mv.ref_idx[0]];
-        HEVCFrame *ref1 = refPicList[1].ref[current_mv.ref_idx[1]];
-
-        if (!ref0 || !ref1)
-            return;
-
-        luma_mc(s, tmp, tmpstride, ref0->frame,
-                &current_mv.mv[0], x0, y0, nPbW, nPbH);
-        luma_mc(s, tmp2, tmpstride, ref1->frame,
-                &current_mv.mv[1], x0, y0, nPbW, nPbH);
-
-        if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
-            (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
-            s->hevcdsp.weighted_pred_avg(s->sh.luma_log2_weight_denom,
-                                         s->sh.luma_weight_l0[current_mv.ref_idx[0]],
-                                         s->sh.luma_weight_l1[current_mv.ref_idx[1]],
-                                         s->sh.luma_offset_l0[current_mv.ref_idx[0]],
-                                         s->sh.luma_offset_l1[current_mv.ref_idx[1]],
-                                         dst0, s->frame->linesize[0],
-                                         tmp, tmp2, tmpstride, nPbW, nPbH);
-        } else {
-            s->hevcdsp.put_weighted_pred_avg(dst0, s->frame->linesize[0],
-                                             tmp, tmp2, tmpstride, nPbW, nPbH);
-        }
-
-        chroma_mc(s, tmp, tmp2, tmpstride, ref0->frame,
-                  &current_mv.mv[0], x0 / 2, y0 / 2, nPbW / 2, nPbH / 2);
-        chroma_mc(s, tmp3, tmp4, tmpstride, ref1->frame,
-                  &current_mv.mv[1], x0 / 2, y0 / 2, nPbW / 2, nPbH / 2);
-
-        if ((s->sh.slice_type == P_SLICE && s->pps->weighted_pred_flag) ||
-            (s->sh.slice_type == B_SLICE && s->pps->weighted_bipred_flag)) {
-            s->hevcdsp.weighted_pred_avg(s->sh.chroma_log2_weight_denom,
-                                         s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0],
-                                         s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0],
-                                         s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0],
-                                         s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0],
-                                         dst1, s->frame->linesize[1], tmp, tmp3,
-                                         tmpstride, nPbW / 2, nPbH / 2);
-            s->hevcdsp.weighted_pred_avg(s->sh.chroma_log2_weight_denom,
-                                         s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1],
-                                         s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1],
-                                         s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1],
-                                         s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1],
-                                         dst2, s->frame->linesize[2], tmp2, tmp4,
-                                         tmpstride, nPbW / 2, nPbH / 2);
-        } else {
-            s->hevcdsp.put_weighted_pred_avg(dst1, s->frame->linesize[1], tmp, tmp3, tmpstride, nPbW/2, nPbH/2);
-            s->hevcdsp.put_weighted_pred_avg(dst2, s->frame->linesize[2], tmp2, tmp4, tmpstride, nPbW/2, nPbH/2);
-        }
-    }
-}
-
-/**
- * 8.4.1
- */
-static int luma_intra_pred_mode(HEVCContext *s, int x0, int y0, int pu_size,
-                                int prev_intra_luma_pred_flag)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    int x_pu             = x0 >> s->sps->log2_min_pu_size;
-    int y_pu             = y0 >> s->sps->log2_min_pu_size;
-    int min_pu_width     = s->sps->min_pu_width;
-    int size_in_pus      = pu_size >> s->sps->log2_min_pu_size;
-    int x0b              = x0 & ((1 << s->sps->log2_ctb_size) - 1);
-    int y0b              = y0 & ((1 << s->sps->log2_ctb_size) - 1);
-
-    int cand_up   = (lc->ctb_up_flag || y0b) ?
-                    s->tab_ipm[(y_pu - 1) * min_pu_width + x_pu] : INTRA_DC;
-    int cand_left = (lc->ctb_left_flag || x0b) ?
-                    s->tab_ipm[y_pu * min_pu_width + x_pu - 1]   : INTRA_DC;
-
-    int y_ctb = (y0 >> (s->sps->log2_ctb_size)) << (s->sps->log2_ctb_size);
-
-    MvField *tab_mvf = s->ref->tab_mvf;
-    int intra_pred_mode;
-    int candidate[3];
-    int i, j;
-
-    // intra_pred_mode prediction does not cross vertical CTB boundaries
-    if ((y0 - 1) < y_ctb)
-        cand_up = INTRA_DC;
-
-    if (cand_left == cand_up) {
-        if (cand_left < 2) {
-            candidate[0] = INTRA_PLANAR;
-            candidate[1] = INTRA_DC;
-            candidate[2] = INTRA_ANGULAR_26;
-        } else {
-            candidate[0] = cand_left;
-            candidate[1] = 2 + ((cand_left - 2 - 1 + 32) & 31);
-            candidate[2] = 2 + ((cand_left - 2 + 1) & 31);
-        }
-    } else {
-        candidate[0] = cand_left;
-        candidate[1] = cand_up;
-        if (candidate[0] != INTRA_PLANAR && candidate[1] != INTRA_PLANAR) {
-            candidate[2] = INTRA_PLANAR;
-        } else if (candidate[0] != INTRA_DC && candidate[1] != INTRA_DC) {
-            candidate[2] = INTRA_DC;
-        } else {
-            candidate[2] = INTRA_ANGULAR_26;
-        }
-    }
-
-    if (prev_intra_luma_pred_flag) {
-        intra_pred_mode = candidate[lc->pu.mpm_idx];
-    } else {
-        if (candidate[0] > candidate[1])
-            FFSWAP(uint8_t, candidate[0], candidate[1]);
-        if (candidate[0] > candidate[2])
-            FFSWAP(uint8_t, candidate[0], candidate[2]);
-        if (candidate[1] > candidate[2])
-            FFSWAP(uint8_t, candidate[1], candidate[2]);
-
-        intra_pred_mode = lc->pu.rem_intra_luma_pred_mode;
-        for (i = 0; i < 3; i++)
-            if (intra_pred_mode >= candidate[i])
-                intra_pred_mode++;
-    }
-
-    /* write the intra prediction units into the mv array */
-    if (!size_in_pus)
-        size_in_pus = 1;
-    for (i = 0; i < size_in_pus; i++) {
-        memset(&s->tab_ipm[(y_pu + i) * min_pu_width + x_pu],
-               intra_pred_mode, size_in_pus);
-
-        for (j = 0; j < size_in_pus; j++) {
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].is_intra     = 1;
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].pred_flag[0] = 0;
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].pred_flag[1] = 0;
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].ref_idx[0]   = 0;
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].ref_idx[1]   = 0;
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].mv[0].x      = 0;
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].mv[0].y      = 0;
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].mv[1].x      = 0;
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + i].mv[1].y      = 0;
-        }
-    }
-
-    return intra_pred_mode;
-}
-
-static av_always_inline void set_ct_depth(HEVCContext *s, int x0, int y0,
-                                          int log2_cb_size, int ct_depth)
-{
-    int length = (1 << log2_cb_size) >> s->sps->log2_min_cb_size;
-    int x_cb   = x0 >> s->sps->log2_min_cb_size;
-    int y_cb   = y0 >> s->sps->log2_min_cb_size;
-    int y;
-
-    for (y = 0; y < length; y++)
-        memset(&s->tab_ct_depth[(y_cb + y) * s->sps->min_cb_width + x_cb],
-               ct_depth, length);
-}
-
-static void intra_prediction_unit(HEVCContext *s, int x0, int y0,
-                                  int log2_cb_size)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    static const uint8_t intra_chroma_table[4] = { 0, 26, 10, 1 };
-    uint8_t prev_intra_luma_pred_flag[4];
-    int split   = lc->cu.part_mode == PART_NxN;
-    int pb_size = (1 << log2_cb_size) >> split;
-    int side    = split + 1;
-    int chroma_mode;
-    int i, j;
-
-    for (i = 0; i < side; i++)
-        for (j = 0; j < side; j++)
-            prev_intra_luma_pred_flag[2 * i + j] = ff_hevc_prev_intra_luma_pred_flag_decode(s);
-
-    for (i = 0; i < side; i++) {
-        for (j = 0; j < side; j++) {
-            if (prev_intra_luma_pred_flag[2 * i + j])
-                lc->pu.mpm_idx = ff_hevc_mpm_idx_decode(s);
-            else
-                lc->pu.rem_intra_luma_pred_mode = ff_hevc_rem_intra_luma_pred_mode_decode(s);
-
-            lc->pu.intra_pred_mode[2 * i + j] =
-                luma_intra_pred_mode(s, x0 + pb_size * j, y0 + pb_size * i, pb_size,
-                                     prev_intra_luma_pred_flag[2 * i + j]);
-        }
-    }
-
-    chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(s);
-    if (chroma_mode != 4) {
-        if (lc->pu.intra_pred_mode[0] == intra_chroma_table[chroma_mode])
-            lc->pu.intra_pred_mode_c = 34;
-        else
-            lc->pu.intra_pred_mode_c = intra_chroma_table[chroma_mode];
-    } else {
-        lc->pu.intra_pred_mode_c = lc->pu.intra_pred_mode[0];
-    }
-}
-
-static void intra_prediction_unit_default_value(HEVCContext *s,
-                                                int x0, int y0,
-                                                int log2_cb_size)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    int pb_size          = 1 << log2_cb_size;
-    int size_in_pus      = pb_size >> s->sps->log2_min_pu_size;
-    int min_pu_width     = s->sps->min_pu_width;
-    MvField *tab_mvf     = s->ref->tab_mvf;
-    int x_pu             = x0 >> s->sps->log2_min_pu_size;
-    int y_pu             = y0 >> s->sps->log2_min_pu_size;
-    int j, k;
-
-    if (size_in_pus == 0)
-        size_in_pus = 1;
-    for (j = 0; j < size_in_pus; j++) {
-        memset(&s->tab_ipm[(y_pu + j) * min_pu_width + x_pu], INTRA_DC, size_in_pus);
-        for (k = 0; k < size_in_pus; k++)
-            tab_mvf[(y_pu + j) * min_pu_width + x_pu + k].is_intra = lc->cu.pred_mode == MODE_INTRA;
-    }
-}
-
-static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size)
-{
-    int cb_size          = 1 << log2_cb_size;
-    HEVCLocalContext *lc = &s->HEVClc;
-    int log2_min_cb_size = s->sps->log2_min_cb_size;
-    int length           = cb_size >> log2_min_cb_size;
-    int min_cb_width     = s->sps->min_cb_width;
-    int x_cb             = x0 >> log2_min_cb_size;
-    int y_cb             = y0 >> log2_min_cb_size;
-    int x, y, ret;
-
-    lc->cu.x                = x0;
-    lc->cu.y                = y0;
-    lc->cu.rqt_root_cbf     = 1;
-    lc->cu.pred_mode        = MODE_INTRA;
-    lc->cu.part_mode        = PART_2Nx2N;
-    lc->cu.intra_split_flag = 0;
-    lc->cu.pcm_flag         = 0;
-
-    SAMPLE_CTB(s->skip_flag, x_cb, y_cb) = 0;
-    for (x = 0; x < 4; x++)
-        lc->pu.intra_pred_mode[x] = 1;
-    if (s->pps->transquant_bypass_enable_flag) {
-        lc->cu.cu_transquant_bypass_flag = ff_hevc_cu_transquant_bypass_flag_decode(s);
-        if (lc->cu.cu_transquant_bypass_flag)
-            set_deblocking_bypass(s, x0, y0, log2_cb_size);
-    } else
-        lc->cu.cu_transquant_bypass_flag = 0;
-
-    if (s->sh.slice_type != I_SLICE) {
-        uint8_t skip_flag = ff_hevc_skip_flag_decode(s, x0, y0, x_cb, y_cb);
-
-        lc->cu.pred_mode = MODE_SKIP;
-        x = y_cb * min_cb_width + x_cb;
-        for (y = 0; y < length; y++) {
-            memset(&s->skip_flag[x], skip_flag, length);
-            x += min_cb_width;
-        }
-        lc->cu.pred_mode = skip_flag ? MODE_SKIP : MODE_INTER;
-    }
-
-    if (SAMPLE_CTB(s->skip_flag, x_cb, y_cb)) {
-        hls_prediction_unit(s, x0, y0, cb_size, cb_size, log2_cb_size, 0);
-        intra_prediction_unit_default_value(s, x0, y0, log2_cb_size);
-
-        if (!s->sh.disable_deblocking_filter_flag)
-            ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size,
-                                                  lc->slice_or_tiles_up_boundary,
-                                                  lc->slice_or_tiles_left_boundary);
-    } else {
-        if (s->sh.slice_type != I_SLICE)
-            lc->cu.pred_mode = ff_hevc_pred_mode_decode(s);
-        if (lc->cu.pred_mode != MODE_INTRA ||
-            log2_cb_size == s->sps->log2_min_cb_size) {
-            lc->cu.part_mode        = ff_hevc_part_mode_decode(s, log2_cb_size);
-            lc->cu.intra_split_flag = lc->cu.part_mode == PART_NxN &&
-                                      lc->cu.pred_mode == MODE_INTRA;
-        }
-
-        if (lc->cu.pred_mode == MODE_INTRA) {
-            if (lc->cu.part_mode == PART_2Nx2N && s->sps->pcm_enabled_flag &&
-                log2_cb_size >= s->sps->pcm.log2_min_pcm_cb_size &&
-                log2_cb_size <= s->sps->pcm.log2_max_pcm_cb_size) {
-                lc->cu.pcm_flag = ff_hevc_pcm_flag_decode(s);
-            }
-            if (lc->cu.pcm_flag) {
-                intra_prediction_unit_default_value(s, x0, y0, log2_cb_size);
-                ret = hls_pcm_sample(s, x0, y0, log2_cb_size);
-                if (s->sps->pcm.loop_filter_disable_flag)
-                    set_deblocking_bypass(s, x0, y0, log2_cb_size);
-
-                if (ret < 0)
-                    return ret;
-            } else {
-                intra_prediction_unit(s, x0, y0, log2_cb_size);
-            }
-        } else {
-            intra_prediction_unit_default_value(s, x0, y0, log2_cb_size);
-            switch (lc->cu.part_mode) {
-            case PART_2Nx2N:
-                hls_prediction_unit(s, x0, y0, cb_size, cb_size, log2_cb_size, 0);
-                break;
-            case PART_2NxN:
-                hls_prediction_unit(s, x0, y0,               cb_size, cb_size / 2, log2_cb_size, 0);
-                hls_prediction_unit(s, x0, y0 + cb_size / 2, cb_size, cb_size / 2, log2_cb_size, 1);
-                break;
-            case PART_Nx2N:
-                hls_prediction_unit(s, x0,               y0, cb_size / 2, cb_size, log2_cb_size, 0);
-                hls_prediction_unit(s, x0 + cb_size / 2, y0, cb_size / 2, cb_size, log2_cb_size, 1);
-                break;
-            case PART_2NxnU:
-                hls_prediction_unit(s, x0, y0,               cb_size, cb_size     / 4, log2_cb_size, 0);
-                hls_prediction_unit(s, x0, y0 + cb_size / 4, cb_size, cb_size * 3 / 4, log2_cb_size, 1);
-                break;
-            case PART_2NxnD:
-                hls_prediction_unit(s, x0, y0,                   cb_size, cb_size * 3 / 4, log2_cb_size, 0);
-                hls_prediction_unit(s, x0, y0 + cb_size * 3 / 4, cb_size, cb_size     / 4, log2_cb_size, 1);
-                break;
-            case PART_nLx2N:
-                hls_prediction_unit(s, x0,               y0, cb_size     / 4, cb_size, log2_cb_size, 0);
-                hls_prediction_unit(s, x0 + cb_size / 4, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 1);
-                break;
-            case PART_nRx2N:
-                hls_prediction_unit(s, x0,                   y0, cb_size * 3 / 4, cb_size, log2_cb_size, 0);
-                hls_prediction_unit(s, x0 + cb_size * 3 / 4, y0, cb_size     / 4, cb_size, log2_cb_size, 1);
-                break;
-            case PART_NxN:
-                hls_prediction_unit(s, x0,               y0,               cb_size / 2, cb_size / 2, log2_cb_size, 0);
-                hls_prediction_unit(s, x0 + cb_size / 2, y0,               cb_size / 2, cb_size / 2, log2_cb_size, 1);
-                hls_prediction_unit(s, x0,               y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 2);
-                hls_prediction_unit(s, x0 + cb_size / 2, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 3);
-                break;
-            }
-        }
-
-        if (!lc->cu.pcm_flag) {
-            if (lc->cu.pred_mode != MODE_INTRA &&
-                !(lc->cu.part_mode == PART_2Nx2N && lc->pu.merge_flag)) {
-                lc->cu.rqt_root_cbf = ff_hevc_no_residual_syntax_flag_decode(s);
-            }
-            if (lc->cu.rqt_root_cbf) {
-                lc->cu.max_trafo_depth = lc->cu.pred_mode == MODE_INTRA ?
-                                         s->sps->max_transform_hierarchy_depth_intra + lc->cu.intra_split_flag :
-                                         s->sps->max_transform_hierarchy_depth_inter;
-                ret = hls_transform_tree(s, x0, y0, x0, y0, x0, y0,
-                                         log2_cb_size,
-                                         log2_cb_size, 0, 0);
-                if (ret < 0)
-                    return ret;
-            } else {
-                if (!s->sh.disable_deblocking_filter_flag)
-                    ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size,
-                                                          lc->slice_or_tiles_up_boundary,
-                                                          lc->slice_or_tiles_left_boundary);
-            }
-        }
-    }
-
-    if (s->pps->cu_qp_delta_enabled_flag && lc->tu.is_cu_qp_delta_coded == 0)
-        ff_hevc_set_qPy(s, x0, y0, x0, y0, log2_cb_size);
-
-    x = y_cb * min_cb_width + x_cb;
-    for (y = 0; y < length; y++) {
-        memset(&s->qp_y_tab[x], lc->qp_y, length);
-        x += min_cb_width;
-    }
-
-    set_ct_depth(s, x0, y0, log2_cb_size, lc->ct.depth);
-
-    return 0;
-}
-
-static int hls_coding_quadtree(HEVCContext *s, int x0, int y0,
-                               int log2_cb_size, int cb_depth)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    const int cb_size    = 1 << log2_cb_size;
-
-    lc->ct.depth = cb_depth;
-    if (x0 + cb_size <= s->sps->width  &&
-        y0 + cb_size <= s->sps->height &&
-        log2_cb_size > s->sps->log2_min_cb_size) {
-        SAMPLE(s->split_cu_flag, x0, y0) =
-            ff_hevc_split_coding_unit_flag_decode(s, cb_depth, x0, y0);
-    } else {
-        SAMPLE(s->split_cu_flag, x0, y0) =
-            (log2_cb_size > s->sps->log2_min_cb_size);
-    }
-    if (s->pps->cu_qp_delta_enabled_flag &&
-        log2_cb_size >= s->sps->log2_ctb_size - s->pps->diff_cu_qp_delta_depth) {
-        lc->tu.is_cu_qp_delta_coded = 0;
-        lc->tu.cu_qp_delta          = 0;
-    }
-
-    if (SAMPLE(s->split_cu_flag, x0, y0)) {
-        const int cb_size_split = cb_size >> 1;
-        const int x1 = x0 + cb_size_split;
-        const int y1 = y0 + cb_size_split;
-
-        log2_cb_size--;
-        cb_depth++;
-
-#define SUBDIVIDE(x, y)                                                \
-do {                                                                   \
-    if (x < s->sps->width && y < s->sps->height) {                     \
-        int ret = hls_coding_quadtree(s, x, y, log2_cb_size, cb_depth);\
-        if (ret < 0)                                                   \
-            return ret;                                                \
-    }                                                                  \
-} while (0)
-
-        SUBDIVIDE(x0, y0);
-        SUBDIVIDE(x1, y0);
-        SUBDIVIDE(x0, y1);
-        SUBDIVIDE(x1, y1);
-    } else {
-        int ret = hls_coding_unit(s, x0, y0, log2_cb_size);
-        if (ret < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb,
-                                 int ctb_addr_ts)
-{
-    HEVCLocalContext *lc  = &s->HEVClc;
-    int ctb_size          = 1 << s->sps->log2_ctb_size;
-    int ctb_addr_rs       = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts];
-    int ctb_addr_in_slice = ctb_addr_rs - s->sh.slice_addr;
-
-    int tile_left_boundary, tile_up_boundary;
-    int slice_left_boundary, slice_up_boundary;
-
-    s->tab_slice_address[ctb_addr_rs] = s->sh.slice_addr;
-
-    if (s->pps->entropy_coding_sync_enabled_flag) {
-        if (x_ctb == 0 && (y_ctb & (ctb_size - 1)) == 0)
-            lc->first_qp_group = 1;
-        lc->end_of_tiles_x = s->sps->width;
-    } else if (s->pps->tiles_enabled_flag) {
-        if (ctb_addr_ts && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[ctb_addr_ts - 1]) {
-            int idxX = s->pps->col_idxX[x_ctb >> s->sps->log2_ctb_size];
-            lc->start_of_tiles_x = x_ctb;
-            lc->end_of_tiles_x   = x_ctb + (s->pps->column_width[idxX] << s->sps->log2_ctb_size);
-            lc->first_qp_group   = 1;
-        }
-    } else {
-        lc->end_of_tiles_x = s->sps->width;
-    }
-
-    lc->end_of_tiles_y = FFMIN(y_ctb + ctb_size, s->sps->height);
-
-    if (s->pps->tiles_enabled_flag) {
-        tile_left_boundary  = x_ctb > 0 &&
-                              s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - 1]];
-        slice_left_boundary = x_ctb > 0 &&
-                              s->tab_slice_address[ctb_addr_rs] == s->tab_slice_address[ctb_addr_rs - 1];
-        tile_up_boundary  = y_ctb > 0 &&
-                            s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->sps->ctb_width]];
-        slice_up_boundary = y_ctb > 0 &&
-                            s->tab_slice_address[ctb_addr_rs] == s->tab_slice_address[ctb_addr_rs - s->sps->ctb_width];
-    } else {
-        tile_left_boundary  =
-        tile_up_boundary    = 1;
-        slice_left_boundary = ctb_addr_in_slice > 0;
-        slice_up_boundary   = ctb_addr_in_slice >= s->sps->ctb_width;
-    }
-    lc->slice_or_tiles_left_boundary = (!slice_left_boundary) + (!tile_left_boundary << 1);
-    lc->slice_or_tiles_up_boundary   = (!slice_up_boundary + (!tile_up_boundary << 1));
-    lc->ctb_left_flag = ((x_ctb > 0) && (ctb_addr_in_slice > 0) && tile_left_boundary);
-    lc->ctb_up_flag   = ((y_ctb > 0) && (ctb_addr_in_slice >= s->sps->ctb_width) && tile_up_boundary);
-    lc->ctb_up_right_flag = ((y_ctb > 0)  && (ctb_addr_in_slice+1 >= s->sps->ctb_width) && (s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs+1 - s->sps->ctb_width]]));
-    lc->ctb_up_left_flag = ((x_ctb > 0) && (y_ctb > 0)  && (ctb_addr_in_slice-1 >= s->sps->ctb_width) && (s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs-1 - s->sps->ctb_width]]));
-}
-
-static int hls_slice_data(HEVCContext *s)
-{
-    int ctb_size    = 1 << s->sps->log2_ctb_size;
-    int more_data   = 1;
-    int x_ctb       = 0;
-    int y_ctb       = 0;
-    int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs];
-    int ret;
-
-    while (more_data && ctb_addr_ts < s->sps->ctb_size) {
-        int ctb_addr_rs = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts];
-
-        x_ctb = (ctb_addr_rs % ((s->sps->width + ctb_size - 1) >> s->sps->log2_ctb_size)) << s->sps->log2_ctb_size;
-        y_ctb = (ctb_addr_rs / ((s->sps->width + ctb_size - 1) >> s->sps->log2_ctb_size)) << s->sps->log2_ctb_size;
-        hls_decode_neighbour(s, x_ctb, y_ctb, ctb_addr_ts);
-
-        ff_hevc_cabac_init(s, ctb_addr_ts);
-
-        hls_sao_param(s, x_ctb >> s->sps->log2_ctb_size, y_ctb >> s->sps->log2_ctb_size);
-
-        s->deblock[ctb_addr_rs].beta_offset = s->sh.beta_offset;
-        s->deblock[ctb_addr_rs].tc_offset   = s->sh.tc_offset;
-        s->filter_slice_edges[ctb_addr_rs]  = s->sh.slice_loop_filter_across_slices_enabled_flag;
-
-        ret = hls_coding_quadtree(s, x_ctb, y_ctb, s->sps->log2_ctb_size, 0);
-        if (ret < 0)
-            return ret;
-        more_data = !ff_hevc_end_of_slice_flag_decode(s);
-
-        ctb_addr_ts++;
-        ff_hevc_save_states(s, ctb_addr_ts);
-        ff_hevc_hls_filters(s, x_ctb, y_ctb, ctb_size);
-    }
-
-    if (x_ctb + ctb_size >= s->sps->width &&
-        y_ctb + ctb_size >= s->sps->height)
-        ff_hevc_hls_filter(s, x_ctb, y_ctb);
-
-    return ctb_addr_ts;
-}
-
-/**
- * @return AVERROR_INVALIDDATA if the packet is not a valid NAL unit,
- * 0 if the unit should be skipped, 1 otherwise
- */
-static int hls_nal_unit(HEVCContext *s)
-{
-    GetBitContext *gb = &s->HEVClc.gb;
-    int nuh_layer_id;
-
-    if (get_bits1(gb) != 0)
-        return AVERROR_INVALIDDATA;
-
-    s->nal_unit_type = get_bits(gb, 6);
-
-    nuh_layer_id   = get_bits(gb, 6);
-    s->temporal_id = get_bits(gb, 3) - 1;
-    if (s->temporal_id < 0)
-        return AVERROR_INVALIDDATA;
-
-    av_log(s->avctx, AV_LOG_DEBUG,
-           "nal_unit_type: %d, nuh_layer_id: %dtemporal_id: %d\n",
-           s->nal_unit_type, nuh_layer_id, s->temporal_id);
-
-    return nuh_layer_id == 0;
-}
-
-static void restore_tqb_pixels(HEVCContext *s)
-{
-    int min_pu_size = 1 << s->sps->log2_min_pu_size;
-    int x, y, c_idx;
-
-    for (c_idx = 0; c_idx < 3; c_idx++) {
-        ptrdiff_t stride = s->frame->linesize[c_idx];
-        int hshift       = s->sps->hshift[c_idx];
-        int vshift       = s->sps->vshift[c_idx];
-        for (y = 0; y < s->sps->min_pu_height; y++) {
-            for (x = 0; x < s->sps->min_pu_width; x++) {
-                if (s->is_pcm[y * s->sps->min_pu_width + x]) {
-                    int n;
-                    int len      = min_pu_size >> hshift;
-                    uint8_t *src = &s->frame->data[c_idx][((y << s->sps->log2_min_pu_size) >> vshift) * stride + (((x << s->sps->log2_min_pu_size) >> hshift) << s->sps->pixel_shift)];
-                    uint8_t *dst = &s->sao_frame->data[c_idx][((y << s->sps->log2_min_pu_size) >> vshift) * stride + (((x << s->sps->log2_min_pu_size) >> hshift) << s->sps->pixel_shift)];
-                    for (n = 0; n < (min_pu_size >> vshift); n++) {
-                        memcpy(dst, src, len);
-                        src += stride;
-                        dst += stride;
-                    }
-                }
-            }
-        }
-    }
-}
-
-static int set_side_data(HEVCContext *s)
-{
-    AVFrame *out = s->ref->frame;
-
-    if (s->sei_frame_packing_present &&
-        s->frame_packing_arrangement_type >= 3 &&
-        s->frame_packing_arrangement_type <= 5 &&
-        s->content_interpretation_type > 0 &&
-        s->content_interpretation_type < 3) {
-        AVStereo3D *stereo = av_stereo3d_create_side_data(out);
-        if (!stereo)
-            return AVERROR(ENOMEM);
-
-        switch (s->frame_packing_arrangement_type) {
-        case 3:
-            if (s->quincunx_subsampling)
-                stereo->type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX;
-            else
-                stereo->type = AV_STEREO3D_SIDEBYSIDE;
-            break;
-        case 4:
-            stereo->type = AV_STEREO3D_TOPBOTTOM;
-            break;
-        case 5:
-            stereo->type = AV_STEREO3D_FRAMESEQUENCE;
-            break;
-        }
-
-        if (s->content_interpretation_type == 2)
-            stereo->flags = AV_STEREO3D_FLAG_INVERT;
-    }
-
-    return 0;
-}
-
-static int hevc_frame_start(HEVCContext *s)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    int ret;
-
-    memset(s->horizontal_bs, 0, 2 * s->bs_width * (s->bs_height + 1));
-    memset(s->vertical_bs,   0, 2 * s->bs_width * (s->bs_height + 1));
-    memset(s->cbf_luma,      0, s->sps->min_tb_width * s->sps->min_tb_height);
-    memset(s->is_pcm,        0, s->sps->min_pu_width * s->sps->min_pu_height);
-
-    lc->start_of_tiles_x = 0;
-    s->is_decoded        = 0;
-    s->first_nal_type    = s->nal_unit_type;
-
-    if (s->pps->tiles_enabled_flag)
-        lc->end_of_tiles_x = s->pps->column_width[0] << s->sps->log2_ctb_size;
-
-    ret = ff_hevc_set_new_ref(s, s->sps->sao_enabled ? &s->sao_frame : &s->frame,
-                              s->poc);
-    if (ret < 0)
-        goto fail;
-
-    ret = ff_hevc_frame_rps(s);
-    if (ret < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Error constructing the frame RPS.\n");
-        goto fail;
-    }
-
-    ret = set_side_data(s);
-    if (ret < 0)
-        goto fail;
-
-    av_frame_unref(s->output_frame);
-    ret = ff_hevc_output_frame(s, s->output_frame, 0);
-    if (ret < 0)
-        goto fail;
-
-    ff_thread_finish_setup(s->avctx);
-
-    return 0;
-
-fail:
-    if (s->ref)
-        ff_thread_report_progress(&s->ref->tf, INT_MAX, 0);
-    s->ref = NULL;
-    return ret;
-}
-
-static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    GetBitContext *gb    = &lc->gb;
-    int ctb_addr_ts, ret;
-
-    ret = init_get_bits8(gb, nal, length);
-    if (ret < 0)
-        return ret;
-
-    ret = hls_nal_unit(s);
-    if (ret < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid NAL unit %d, skipping.\n",
-               s->nal_unit_type);
-        goto fail;
-    } else if (!ret)
-        return 0;
-
-    switch (s->nal_unit_type) {
-    case NAL_VPS:
-        ret = ff_hevc_decode_nal_vps(s);
-        if (ret < 0)
-            goto fail;
-        break;
-    case NAL_SPS:
-        ret = ff_hevc_decode_nal_sps(s);
-        if (ret < 0)
-            goto fail;
-        break;
-    case NAL_PPS:
-        ret = ff_hevc_decode_nal_pps(s);
-        if (ret < 0)
-            goto fail;
-        break;
-    case NAL_SEI_PREFIX:
-    case NAL_SEI_SUFFIX:
-        ret = ff_hevc_decode_nal_sei(s);
-        if (ret < 0)
-            goto fail;
-        break;
-    case NAL_TRAIL_R:
-    case NAL_TRAIL_N:
-    case NAL_TSA_N:
-    case NAL_TSA_R:
-    case NAL_STSA_N:
-    case NAL_STSA_R:
-    case NAL_BLA_W_LP:
-    case NAL_BLA_W_RADL:
-    case NAL_BLA_N_LP:
-    case NAL_IDR_W_RADL:
-    case NAL_IDR_N_LP:
-    case NAL_CRA_NUT:
-    case NAL_RADL_N:
-    case NAL_RADL_R:
-    case NAL_RASL_N:
-    case NAL_RASL_R:
-        ret = hls_slice_header(s);
-        if (ret < 0)
-            return ret;
-
-        if (s->max_ra == INT_MAX) {
-            if (s->nal_unit_type == NAL_CRA_NUT || IS_BLA(s)) {
-                s->max_ra = s->poc;
-            } else {
-                if (IS_IDR(s))
-                    s->max_ra = INT_MIN;
-            }
-        }
-
-        if ((s->nal_unit_type == NAL_RASL_R || s->nal_unit_type == NAL_RASL_N) &&
-            s->poc <= s->max_ra) {
-            s->is_decoded = 0;
-            break;
-        } else {
-            if (s->nal_unit_type == NAL_RASL_R && s->poc > s->max_ra)
-                s->max_ra = INT_MIN;
-        }
-
-        if (s->sh.first_slice_in_pic_flag) {
-            ret = hevc_frame_start(s);
-            if (ret < 0)
-                return ret;
-        } else if (!s->ref) {
-            av_log(s->avctx, AV_LOG_ERROR, "First slice in a frame missing.\n");
-            goto fail;
-        }
-
-        if (s->nal_unit_type != s->first_nal_type) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Non-matching NAL types of the VCL NALUs: %d %d\n",
-                   s->first_nal_type, s->nal_unit_type);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (!s->sh.dependent_slice_segment_flag &&
-            s->sh.slice_type != I_SLICE) {
-            ret = ff_hevc_slice_rpl(s);
-            if (ret < 0) {
-                av_log(s->avctx, AV_LOG_WARNING,
-                       "Error constructing the reference lists for the current slice.\n");
-                goto fail;
-            }
-        }
-
-        ctb_addr_ts = hls_slice_data(s);
-        if (ctb_addr_ts >= (s->sps->ctb_width * s->sps->ctb_height)) {
-            s->is_decoded = 1;
-            if ((s->pps->transquant_bypass_enable_flag ||
-                 (s->sps->pcm.loop_filter_disable_flag && s->sps->pcm_enabled_flag)) &&
-                s->sps->sao_enabled)
-                restore_tqb_pixels(s);
-        }
-
-        if (ctb_addr_ts < 0) {
-            ret = ctb_addr_ts;
-            goto fail;
-        }
-        break;
-    case NAL_EOS_NUT:
-    case NAL_EOB_NUT:
-        s->seq_decode = (s->seq_decode + 1) & 0xff;
-        s->max_ra     = INT_MAX;
-        break;
-    case NAL_AUD:
-    case NAL_FD_NUT:
-        break;
-    default:
-        av_log(s->avctx, AV_LOG_INFO,
-               "Skipping NAL unit %d\n", s->nal_unit_type);
-    }
-
-    return 0;
-fail:
-    if (s->avctx->err_recognition & AV_EF_EXPLODE)
-        return ret;
-    return 0;
-}
-
-/* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication
- * between these functions would be nice. */
-static int extract_rbsp(const uint8_t *src, int length,
-                        HEVCNAL *nal)
-{
-    int i, si, di;
-    uint8_t *dst;
-
-#define STARTCODE_TEST                                                  \
-        if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) {     \
-            if (src[i + 2] != 3) {                                      \
-                /* startcode, so we must be past the end */             \
-                length = i;                                             \
-            }                                                           \
-            break;                                                      \
-        }
-#if HAVE_FAST_UNALIGNED
-#define FIND_FIRST_ZERO                                                 \
-        if (i > 0 && !src[i])                                           \
-            i--;                                                        \
-        while (src[i])                                                  \
-            i++
-#if HAVE_FAST_64BIT
-    for (i = 0; i + 1 < length; i += 9) {
-        if (!((~AV_RN64A(src + i) &
-               (AV_RN64A(src + i) - 0x0100010001000101ULL)) &
-              0x8000800080008080ULL))
-            continue;
-        FIND_FIRST_ZERO;
-        STARTCODE_TEST;
-        i -= 7;
-    }
-#else
-    for (i = 0; i + 1 < length; i += 5) {
-        if (!((~AV_RN32A(src + i) &
-               (AV_RN32A(src + i) - 0x01000101U)) &
-              0x80008080U))
-            continue;
-        FIND_FIRST_ZERO;
-        STARTCODE_TEST;
-        i -= 3;
-    }
-#endif /* HAVE_FAST_64BIT */
-#else
-    for (i = 0; i + 1 < length; i += 2) {
-        if (src[i])
-            continue;
-        if (i > 0 && src[i - 1] == 0)
-            i--;
-        STARTCODE_TEST;
-    }
-#endif /* HAVE_FAST_UNALIGNED */
-
-    if (i >= length - 1) { // no escaped 0
-        nal->data = src;
-        nal->size = length;
-        return length;
-    }
-
-    av_fast_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size,
-                   length + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!nal->rbsp_buffer)
-        return AVERROR(ENOMEM);
-
-    dst = nal->rbsp_buffer;
-
-    memcpy(dst, src, i);
-    si = di = i;
-    while (si + 2 < length) {
-        // remove escapes (very rare 1:2^22)
-        if (src[si + 2] > 3) {
-            dst[di++] = src[si++];
-            dst[di++] = src[si++];
-        } else if (src[si] == 0 && src[si + 1] == 0) {
-            if (src[si + 2] == 3) { // escape
-                dst[di++] = 0;
-                dst[di++] = 0;
-                si       += 3;
-
-                continue;
-            } else // next start code
-                goto nsc;
-        }
-
-        dst[di++] = src[si++];
-    }
-    while (si < length)
-        dst[di++] = src[si++];
-
-nsc:
-    memset(dst + di, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-    nal->data = dst;
-    nal->size = di;
-    return si;
-}
-
-static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
-{
-    int i, consumed, ret = 0;
-
-    s->ref = NULL;
-    s->eos = 0;
-
-    /* split the input packet into NAL units, so we know the upper bound on the
-     * number of slices in the frame */
-    s->nb_nals = 0;
-    while (length >= 4) {
-        HEVCNAL *nal;
-        int extract_length = 0;
-
-        if (s->is_nalff) {
-            int i;
-            for (i = 0; i < s->nal_length_size; i++)
-                extract_length = (extract_length << 8) | buf[i];
-            buf    += s->nal_length_size;
-            length -= s->nal_length_size;
-
-            if (extract_length > length) {
-                av_log(s->avctx, AV_LOG_ERROR, "Invalid NAL unit size.\n");
-                ret = AVERROR_INVALIDDATA;
-                goto fail;
-            }
-        } else {
-            if (buf[2] == 0) {
-                length--;
-                buf++;
-                continue;
-            }
-            if (buf[0] != 0 || buf[1] != 0 || buf[2] != 1) {
-                ret = AVERROR_INVALIDDATA;
-                goto fail;
-            }
-
-            buf           += 3;
-            length        -= 3;
-            extract_length = length;
-        }
-
-        if (s->nals_allocated < s->nb_nals + 1) {
-            int new_size = s->nals_allocated + 1;
-            HEVCNAL *tmp = av_realloc_array(s->nals, new_size, sizeof(*tmp));
-            if (!tmp) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-            s->nals = tmp;
-            memset(s->nals + s->nals_allocated, 0,
-                   (new_size - s->nals_allocated) * sizeof(*tmp));
-            s->nals_allocated = new_size;
-        }
-        nal = &s->nals[s->nb_nals++];
-
-        consumed = extract_rbsp(buf, extract_length, nal);
-        if (consumed < 0) {
-            ret = consumed;
-            goto fail;
-        }
-
-        ret = init_get_bits8(&s->HEVClc.gb, nal->data, nal->size);
-        if (ret < 0)
-            goto fail;
-        hls_nal_unit(s);
-
-        if (s->nal_unit_type == NAL_EOB_NUT ||
-            s->nal_unit_type == NAL_EOS_NUT)
-            s->eos = 1;
-
-        buf    += consumed;
-        length -= consumed;
-    }
-
-    /* parse the NAL units */
-    for (i = 0; i < s->nb_nals; i++) {
-        int ret = decode_nal_unit(s, s->nals[i].data, s->nals[i].size);
-        if (ret < 0) {
-            av_log(s->avctx, AV_LOG_WARNING,
-                   "Error parsing NAL unit #%d.\n", i);
-            goto fail;
-        }
-    }
-
-fail:
-    if (s->ref)
-        ff_thread_report_progress(&s->ref->tf, INT_MAX, 0);
-
-    return ret;
-}
-
-static void print_md5(void *log_ctx, int level, uint8_t md5[16])
-{
-    int i;
-    for (i = 0; i < 16; i++)
-        av_log(log_ctx, level, "%02"PRIx8, md5[i]);
-}
-
-static int verify_md5(HEVCContext *s, AVFrame *frame)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
-    int pixel_shift;
-    int i, j;
-
-    if (!desc)
-        return AVERROR(EINVAL);
-
-    pixel_shift = desc->comp[0].depth_minus1 > 7;
-
-    av_log(s->avctx, AV_LOG_DEBUG, "Verifying checksum for frame with POC %d: ",
-           s->poc);
-
-    /* the checksums are LE, so we have to byteswap for >8bpp formats
-     * on BE arches */
-#if HAVE_BIGENDIAN
-    if (pixel_shift && !s->checksum_buf) {
-        av_fast_malloc(&s->checksum_buf, &s->checksum_buf_size,
-                       FFMAX3(frame->linesize[0], frame->linesize[1],
-                              frame->linesize[2]));
-        if (!s->checksum_buf)
-            return AVERROR(ENOMEM);
-    }
-#endif
-
-    for (i = 0; frame->data[i]; i++) {
-        int width  = s->avctx->coded_width;
-        int height = s->avctx->coded_height;
-        int w = (i == 1 || i == 2) ? (width  >> desc->log2_chroma_w) : width;
-        int h = (i == 1 || i == 2) ? (height >> desc->log2_chroma_h) : height;
-        uint8_t md5[16];
-
-        av_md5_init(s->md5_ctx);
-        for (j = 0; j < h; j++) {
-            const uint8_t *src = frame->data[i] + j * frame->linesize[i];
-#if HAVE_BIGENDIAN
-            if (pixel_shift) {
-                s->dsp.bswap16_buf((uint16_t*)s->checksum_buf,
-                                   (const uint16_t*)src, w);
-                src = s->checksum_buf;
-            }
-#endif
-            av_md5_update(s->md5_ctx, src, w << pixel_shift);
-        }
-        av_md5_final(s->md5_ctx, md5);
-
-        if (!memcmp(md5, s->md5[i], 16)) {
-            av_log   (s->avctx, AV_LOG_DEBUG, "plane %d - correct ", i);
-            print_md5(s->avctx, AV_LOG_DEBUG, md5);
-            av_log   (s->avctx, AV_LOG_DEBUG, "; ");
-        } else {
-            av_log   (s->avctx, AV_LOG_ERROR, "mismatching checksum of plane %d - ", i);
-            print_md5(s->avctx, AV_LOG_ERROR, md5);
-            av_log   (s->avctx, AV_LOG_ERROR, " != ");
-            print_md5(s->avctx, AV_LOG_ERROR, s->md5[i]);
-            av_log   (s->avctx, AV_LOG_ERROR, "\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    av_log(s->avctx, AV_LOG_DEBUG, "\n");
-
-    return 0;
-}
-
-static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output,
-                             AVPacket *avpkt)
-{
-    int ret;
-    HEVCContext *s = avctx->priv_data;
-
-    if (!avpkt->size) {
-        ret = ff_hevc_output_frame(s, data, 1);
-        if (ret < 0)
-            return ret;
-
-        *got_output = ret;
-        return 0;
-    }
-
-    s->ref = NULL;
-    ret    = decode_nal_units(s, avpkt->data, avpkt->size);
-    if (ret < 0)
-        return ret;
-
-    /* verify the SEI checksum */
-    if (avctx->err_recognition & AV_EF_CRCCHECK && s->is_decoded &&
-        s->is_md5) {
-        ret = verify_md5(s, s->ref->frame);
-        if (ret < 0 && avctx->err_recognition & AV_EF_EXPLODE) {
-            ff_hevc_unref_frame(s, s->ref, ~0);
-            return ret;
-        }
-    }
-    s->is_md5 = 0;
-
-    if (s->is_decoded) {
-        av_log(avctx, AV_LOG_DEBUG, "Decoded frame with POC %d.\n", s->poc);
-        s->is_decoded = 0;
-    }
-
-    if (s->output_frame->buf[0]) {
-        av_frame_move_ref(data, s->output_frame);
-        *got_output = 1;
-    }
-
-    return avpkt->size;
-}
-
-static int hevc_ref_frame(HEVCContext *s, HEVCFrame *dst, HEVCFrame *src)
-{
-    int ret = ff_thread_ref_frame(&dst->tf, &src->tf);
-    if (ret < 0)
-        return ret;
-
-    dst->tab_mvf_buf = av_buffer_ref(src->tab_mvf_buf);
-    if (!dst->tab_mvf_buf)
-        goto fail;
-    dst->tab_mvf = src->tab_mvf;
-
-    dst->rpl_tab_buf = av_buffer_ref(src->rpl_tab_buf);
-    if (!dst->rpl_tab_buf)
-        goto fail;
-    dst->rpl_tab = src->rpl_tab;
-
-    dst->rpl_buf = av_buffer_ref(src->rpl_buf);
-    if (!dst->rpl_buf)
-        goto fail;
-
-    dst->poc        = src->poc;
-    dst->ctb_count  = src->ctb_count;
-    dst->window     = src->window;
-    dst->flags      = src->flags;
-    dst->sequence   = src->sequence;
-
-    return 0;
-fail:
-    ff_hevc_unref_frame(s, dst, ~0);
-    return AVERROR(ENOMEM);
-}
-
-static av_cold int hevc_decode_free(AVCodecContext *avctx)
-{
-    HEVCContext       *s = avctx->priv_data;
-    int i;
-
-    pic_arrays_free(s);
-
-    av_freep(&s->md5_ctx);
-
-    av_frame_free(&s->tmp_frame);
-    av_frame_free(&s->output_frame);
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
-        ff_hevc_unref_frame(s, &s->DPB[i], ~0);
-        av_frame_free(&s->DPB[i].frame);
-    }
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->vps_list); i++)
-        av_buffer_unref(&s->vps_list[i]);
-    for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++)
-        av_buffer_unref(&s->sps_list[i]);
-    for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++)
-        av_buffer_unref(&s->pps_list[i]);
-
-    for (i = 0; i < s->nals_allocated; i++)
-        av_freep(&s->nals[i].rbsp_buffer);
-    av_freep(&s->nals);
-    s->nals_allocated = 0;
-
-    return 0;
-}
-
-static av_cold int hevc_init_context(AVCodecContext *avctx)
-{
-    HEVCContext *s = avctx->priv_data;
-    int i;
-
-    s->avctx = avctx;
-
-    s->tmp_frame = av_frame_alloc();
-    if (!s->tmp_frame)
-        goto fail;
-
-    s->output_frame = av_frame_alloc();
-    if (!s->output_frame)
-        goto fail;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
-        s->DPB[i].frame = av_frame_alloc();
-        if (!s->DPB[i].frame)
-            goto fail;
-        s->DPB[i].tf.f = s->DPB[i].frame;
-    }
-
-    s->max_ra = INT_MAX;
-
-    s->md5_ctx = av_md5_alloc();
-    if (!s->md5_ctx)
-        goto fail;
-
-    ff_dsputil_init(&s->dsp, avctx);
-
-    s->context_initialized = 1;
-
-    return 0;
-
-fail:
-    hevc_decode_free(avctx);
-    return AVERROR(ENOMEM);
-}
-
-static int hevc_update_thread_context(AVCodecContext *dst,
-                                      const AVCodecContext *src)
-{
-    HEVCContext *s  = dst->priv_data;
-    HEVCContext *s0 = src->priv_data;
-    int i, ret;
-
-    if (!s->context_initialized) {
-        ret = hevc_init_context(dst);
-        if (ret < 0)
-            return ret;
-    }
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
-        ff_hevc_unref_frame(s, &s->DPB[i], ~0);
-        if (s0->DPB[i].frame->buf[0]) {
-            ret = hevc_ref_frame(s, &s->DPB[i], &s0->DPB[i]);
-            if (ret < 0)
-                return ret;
-        }
-    }
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->vps_list); i++) {
-        av_buffer_unref(&s->vps_list[i]);
-        if (s0->vps_list[i]) {
-            s->vps_list[i] = av_buffer_ref(s0->vps_list[i]);
-            if (!s->vps_list[i])
-                return AVERROR(ENOMEM);
-        }
-    }
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++) {
-        av_buffer_unref(&s->sps_list[i]);
-        if (s0->sps_list[i]) {
-            s->sps_list[i] = av_buffer_ref(s0->sps_list[i]);
-            if (!s->sps_list[i])
-                return AVERROR(ENOMEM);
-        }
-    }
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++) {
-        av_buffer_unref(&s->pps_list[i]);
-        if (s0->pps_list[i]) {
-            s->pps_list[i] = av_buffer_ref(s0->pps_list[i]);
-            if (!s->pps_list[i])
-                return AVERROR(ENOMEM);
-        }
-    }
-
-    if (s->sps != s0->sps)
-        ret = set_sps(s, s0->sps);
-
-    s->seq_decode = s0->seq_decode;
-    s->seq_output = s0->seq_output;
-    s->pocTid0    = s0->pocTid0;
-    s->max_ra     = s0->max_ra;
-
-    s->is_nalff        = s0->is_nalff;
-    s->nal_length_size = s0->nal_length_size;
-
-    if (s0->eos) {
-        s->seq_decode = (s->seq_decode + 1) & 0xff;
-        s->max_ra = INT_MAX;
-    }
-
-    return 0;
-}
-
-static int hevc_decode_extradata(HEVCContext *s)
-{
-    AVCodecContext *avctx = s->avctx;
-    GetByteContext gb;
-    int ret;
-
-    bytestream2_init(&gb, avctx->extradata, avctx->extradata_size);
-
-    if (avctx->extradata_size > 3 &&
-        (avctx->extradata[0] || avctx->extradata[1] ||
-         avctx->extradata[2] > 1)) {
-        /* It seems the extradata is encoded as hvcC format.
-         * Temporarily, we support configurationVersion==0 until 14496-15 3rd
-         * is finalized. When finalized, configurationVersion will be 1 and we
-         * can recognize hvcC by checking if avctx->extradata[0]==1 or not. */
-        int i, j, num_arrays, nal_len_size;
-
-        s->is_nalff = 1;
-
-        bytestream2_skip(&gb, 21);
-        nal_len_size = (bytestream2_get_byte(&gb) & 3) + 1;
-        num_arrays   = bytestream2_get_byte(&gb);
-
-        /* nal units in the hvcC always have length coded with 2 bytes,
-         * so put a fake nal_length_size = 2 while parsing them */
-        s->nal_length_size = 2;
-
-        /* Decode nal units from hvcC. */
-        for (i = 0; i < num_arrays; i++) {
-            int type = bytestream2_get_byte(&gb) & 0x3f;
-            int cnt  = bytestream2_get_be16(&gb);
-
-            for (j = 0; j < cnt; j++) {
-                // +2 for the nal size field
-                int nalsize = bytestream2_peek_be16(&gb) + 2;
-                if (bytestream2_get_bytes_left(&gb) < nalsize) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "Invalid NAL unit size in extradata.\n");
-                    return AVERROR_INVALIDDATA;
-                }
-
-                ret = decode_nal_units(s, gb.buffer, nalsize);
-                if (ret < 0) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Decoding nal unit %d %d from hvcC failed\n",
-                           type, i);
-                    return ret;
-                }
-                bytestream2_skip(&gb, nalsize);
-            }
-        }
-
-        /* Now store right nal length size, that will be used to parse
-         * all other nals */
-        s->nal_length_size = nal_len_size;
-    } else {
-        s->is_nalff = 0;
-        ret = decode_nal_units(s, avctx->extradata, avctx->extradata_size);
-        if (ret < 0)
-            return ret;
-    }
-    return 0;
-}
-
-static av_cold int hevc_decode_init(AVCodecContext *avctx)
-{
-    HEVCContext *s = avctx->priv_data;
-    int ret;
-
-    ff_init_cabac_states();
-
-    avctx->internal->allocate_progress = 1;
-
-    ret = hevc_init_context(avctx);
-    if (ret < 0)
-        return ret;
-
-    if (avctx->extradata_size > 0 && avctx->extradata) {
-        ret = hevc_decode_extradata(s);
-        if (ret < 0) {
-            hevc_decode_free(avctx);
-            return ret;
-        }
-    }
-
-    return 0;
-}
-
-static av_cold int hevc_init_thread_copy(AVCodecContext *avctx)
-{
-    HEVCContext *s = avctx->priv_data;
-    int ret;
-
-    memset(s, 0, sizeof(*s));
-
-    ret = hevc_init_context(avctx);
-    if (ret < 0)
-        return ret;
-
-    return 0;
-}
-
-static void hevc_decode_flush(AVCodecContext *avctx)
-{
-    HEVCContext *s = avctx->priv_data;
-    ff_hevc_flush_dpb(s);
-    s->max_ra = INT_MAX;
-}
-
-#define OFFSET(x) offsetof(HEVCContext, x)
-#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
-
-static const AVProfile profiles[] = {
-    { FF_PROFILE_HEVC_MAIN,                 "Main"                },
-    { FF_PROFILE_HEVC_MAIN_10,              "Main 10"             },
-    { FF_PROFILE_HEVC_MAIN_STILL_PICTURE,   "Main Still Picture"  },
-    { FF_PROFILE_UNKNOWN },
-};
-
-static const AVOption options[] = {
-    { "apply_defdispwin", "Apply default display window from VUI", OFFSET(apply_defdispwin),
-        AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, PAR },
-    { NULL },
-};
-
-static const AVClass hevc_decoder_class = {
-    .class_name = "HEVC decoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_hevc_decoder = {
-    .name                  = "hevc",
-    .long_name             = NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_HEVC,
-    .priv_data_size        = sizeof(HEVCContext),
-    .priv_class            = &hevc_decoder_class,
-    .init                  = hevc_decode_init,
-    .close                 = hevc_decode_free,
-    .decode                = hevc_decode_frame,
-    .flush                 = hevc_decode_flush,
-    .update_thread_context = hevc_update_thread_context,
-    .init_thread_copy      = hevc_init_thread_copy,
-    .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
-                             CODEC_CAP_FRAME_THREADS,
-    .profiles              = NULL_IF_CONFIG_SMALL(profiles),
-};
diff --git a/deps/libav/libavcodec/hevc.h b/deps/libav/libavcodec/hevc.h
deleted file mode 100644
index 1197d08..0000000
--- a/deps/libav/libavcodec/hevc.h
+++ /dev/null
@@ -1,1003 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_HEVC_H
-#define AVCODEC_HEVC_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/buffer.h"
-#include "libavutil/md5.h"
-
-#include "avcodec.h"
-#include "cabac.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "hevcdsp.h"
-#include "internal.h"
-#include "thread.h"
-#include "videodsp.h"
-
-#define MAX_DPB_SIZE 16 // A.4.1
-#define MAX_REFS 16
-
-/**
- * 7.4.2.1
- */
-#define MAX_SUB_LAYERS 7
-#define MAX_VPS_COUNT 16
-#define MAX_SPS_COUNT 32
-#define MAX_PPS_COUNT 256
-#define MAX_SHORT_TERM_RPS_COUNT 64
-#define MAX_CU_SIZE 128
-
-//TODO: check if this is really the maximum
-#define MAX_TRANSFORM_DEPTH 5
-
-#define MAX_TB_SIZE 32
-#define MAX_PB_SIZE 64
-#define MAX_LOG2_CTB_SIZE 6
-#define MAX_QP 51
-#define DEFAULT_INTRA_TC_OFFSET 2
-
-#define HEVC_CONTEXTS 183
-
-#define MRG_MAX_NUM_CANDS     5
-
-#define L0 0
-#define L1 1
-
-#define EPEL_EXTRA_BEFORE 1
-#define EPEL_EXTRA_AFTER  2
-#define EPEL_EXTRA        3
-
-#define EDGE_EMU_BUFFER_STRIDE 80
-
-/**
- * Value of the luma sample at position (x, y) in the 2D array tab.
- */
-#define SAMPLE(tab, x, y) ((tab)[(y) * s->sps->width + (x)])
-#define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)])
-#define SAMPLE_CBF(tab, x, y) ((tab)[((y) & ((1<<log2_trafo_size)-1)) * MAX_CU_SIZE + ((x) & ((1<<log2_trafo_size)-1))])
-
-#define IS_IDR(s) (s->nal_unit_type == NAL_IDR_W_RADL || s->nal_unit_type == NAL_IDR_N_LP)
-#define IS_BLA(s) (s->nal_unit_type == NAL_BLA_W_RADL || s->nal_unit_type == NAL_BLA_W_LP || \
-                   s->nal_unit_type == NAL_BLA_N_LP)
-#define IS_IRAP(s) (s->nal_unit_type >= 16 && s->nal_unit_type <= 23)
-
-#define FFUDIV(a,b) (((a) > 0 ? (a) : (a) - (b) + 1) / (b))
-#define FFUMOD(a,b) ((a) - (b) * FFUDIV(a,b))
-
-/**
- * Table 7-3: NAL unit type codes
- */
-enum NALUnitType {
-    NAL_TRAIL_N    = 0,
-    NAL_TRAIL_R    = 1,
-    NAL_TSA_N      = 2,
-    NAL_TSA_R      = 3,
-    NAL_STSA_N     = 4,
-    NAL_STSA_R     = 5,
-    NAL_RADL_N     = 6,
-    NAL_RADL_R     = 7,
-    NAL_RASL_N     = 8,
-    NAL_RASL_R     = 9,
-    NAL_BLA_W_LP   = 16,
-    NAL_BLA_W_RADL = 17,
-    NAL_BLA_N_LP   = 18,
-    NAL_IDR_W_RADL = 19,
-    NAL_IDR_N_LP   = 20,
-    NAL_CRA_NUT    = 21,
-    NAL_VPS        = 32,
-    NAL_SPS        = 33,
-    NAL_PPS        = 34,
-    NAL_AUD        = 35,
-    NAL_EOS_NUT    = 36,
-    NAL_EOB_NUT    = 37,
-    NAL_FD_NUT     = 38,
-    NAL_SEI_PREFIX = 39,
-    NAL_SEI_SUFFIX = 40,
-};
-
-enum RPSType {
-    ST_CURR_BEF = 0,
-    ST_CURR_AFT,
-    ST_FOLL,
-    LT_CURR,
-    LT_FOLL,
-    NB_RPS_TYPE,
-};
-
-enum SliceType {
-    B_SLICE = 0,
-    P_SLICE = 1,
-    I_SLICE = 2,
-};
-
-enum SyntaxElement {
-    SAO_MERGE_FLAG = 0,
-    SAO_TYPE_IDX,
-    SAO_EO_CLASS,
-    SAO_BAND_POSITION,
-    SAO_OFFSET_ABS,
-    SAO_OFFSET_SIGN,
-    END_OF_SLICE_FLAG,
-    SPLIT_CODING_UNIT_FLAG,
-    CU_TRANSQUANT_BYPASS_FLAG,
-    SKIP_FLAG,
-    CU_QP_DELTA,
-    PRED_MODE_FLAG,
-    PART_MODE,
-    PCM_FLAG,
-    PREV_INTRA_LUMA_PRED_FLAG,
-    MPM_IDX,
-    REM_INTRA_LUMA_PRED_MODE,
-    INTRA_CHROMA_PRED_MODE,
-    MERGE_FLAG,
-    MERGE_IDX,
-    INTER_PRED_IDC,
-    REF_IDX_L0,
-    REF_IDX_L1,
-    ABS_MVD_GREATER0_FLAG,
-    ABS_MVD_GREATER1_FLAG,
-    ABS_MVD_MINUS2,
-    MVD_SIGN_FLAG,
-    MVP_LX_FLAG,
-    NO_RESIDUAL_DATA_FLAG,
-    SPLIT_TRANSFORM_FLAG,
-    CBF_LUMA,
-    CBF_CB_CR,
-    TRANSFORM_SKIP_FLAG,
-    LAST_SIGNIFICANT_COEFF_X_PREFIX,
-    LAST_SIGNIFICANT_COEFF_Y_PREFIX,
-    LAST_SIGNIFICANT_COEFF_X_SUFFIX,
-    LAST_SIGNIFICANT_COEFF_Y_SUFFIX,
-    SIGNIFICANT_COEFF_GROUP_FLAG,
-    SIGNIFICANT_COEFF_FLAG,
-    COEFF_ABS_LEVEL_GREATER1_FLAG,
-    COEFF_ABS_LEVEL_GREATER2_FLAG,
-    COEFF_ABS_LEVEL_REMAINING,
-    COEFF_SIGN_FLAG,
-};
-
-enum PartMode {
-    PART_2Nx2N = 0,
-    PART_2NxN  = 1,
-    PART_Nx2N  = 2,
-    PART_NxN   = 3,
-    PART_2NxnU = 4,
-    PART_2NxnD = 5,
-    PART_nLx2N = 6,
-    PART_nRx2N = 7,
-};
-
-enum PredMode {
-    MODE_INTER = 0,
-    MODE_INTRA,
-    MODE_SKIP,
-};
-
-enum InterPredIdc {
-    PRED_L0 = 0,
-    PRED_L1,
-    PRED_BI,
-};
-
-enum IntraPredMode {
-    INTRA_PLANAR = 0,
-    INTRA_DC,
-    INTRA_ANGULAR_2,
-    INTRA_ANGULAR_3,
-    INTRA_ANGULAR_4,
-    INTRA_ANGULAR_5,
-    INTRA_ANGULAR_6,
-    INTRA_ANGULAR_7,
-    INTRA_ANGULAR_8,
-    INTRA_ANGULAR_9,
-    INTRA_ANGULAR_10,
-    INTRA_ANGULAR_11,
-    INTRA_ANGULAR_12,
-    INTRA_ANGULAR_13,
-    INTRA_ANGULAR_14,
-    INTRA_ANGULAR_15,
-    INTRA_ANGULAR_16,
-    INTRA_ANGULAR_17,
-    INTRA_ANGULAR_18,
-    INTRA_ANGULAR_19,
-    INTRA_ANGULAR_20,
-    INTRA_ANGULAR_21,
-    INTRA_ANGULAR_22,
-    INTRA_ANGULAR_23,
-    INTRA_ANGULAR_24,
-    INTRA_ANGULAR_25,
-    INTRA_ANGULAR_26,
-    INTRA_ANGULAR_27,
-    INTRA_ANGULAR_28,
-    INTRA_ANGULAR_29,
-    INTRA_ANGULAR_30,
-    INTRA_ANGULAR_31,
-    INTRA_ANGULAR_32,
-    INTRA_ANGULAR_33,
-    INTRA_ANGULAR_34,
-};
-
-enum SAOType {
-    SAO_NOT_APPLIED = 0,
-    SAO_BAND,
-    SAO_EDGE,
-};
-
-enum SAOEOClass {
-    SAO_EO_HORIZ = 0,
-    SAO_EO_VERT,
-    SAO_EO_135D,
-    SAO_EO_45D,
-};
-
-enum ScanType {
-    SCAN_DIAG = 0,
-    SCAN_HORIZ,
-    SCAN_VERT,
-};
-
-typedef struct ShortTermRPS {
-    unsigned int num_negative_pics;
-    int num_delta_pocs;
-    int32_t delta_poc[32];
-    uint8_t used[32];
-} ShortTermRPS;
-
-typedef struct LongTermRPS {
-    int     poc[32];
-    uint8_t used[32];
-    uint8_t nb_refs;
-} LongTermRPS;
-
-typedef struct RefPicList {
-    struct HEVCFrame *ref[MAX_REFS];
-    int list[MAX_REFS];
-    int isLongTerm[MAX_REFS];
-    int nb_refs;
-} RefPicList;
-
-typedef struct RefPicListTab {
-    RefPicList refPicList[2];
-} RefPicListTab;
-
-typedef struct HEVCWindow {
-    int left_offset;
-    int right_offset;
-    int top_offset;
-    int bottom_offset;
-} HEVCWindow;
-
-typedef struct VUI {
-    AVRational sar;
-
-    int overscan_info_present_flag;
-    int overscan_appropriate_flag;
-
-    int video_signal_type_present_flag;
-    int video_format;
-    int video_full_range_flag;
-    int colour_description_present_flag;
-    uint8_t colour_primaries;
-    uint8_t transfer_characteristic;
-    uint8_t matrix_coeffs;
-
-    int chroma_loc_info_present_flag;
-    int chroma_sample_loc_type_top_field;
-    int chroma_sample_loc_type_bottom_field;
-    int neutra_chroma_indication_flag;
-
-    int field_seq_flag;
-    int frame_field_info_present_flag;
-
-    int default_display_window_flag;
-    HEVCWindow def_disp_win;
-
-    int vui_timing_info_present_flag;
-    uint32_t vui_num_units_in_tick;
-    uint32_t vui_time_scale;
-    int vui_poc_proportional_to_timing_flag;
-    int vui_num_ticks_poc_diff_one_minus1;
-    int vui_hrd_parameters_present_flag;
-
-    int bitstream_restriction_flag;
-    int tiles_fixed_structure_flag;
-    int motion_vectors_over_pic_boundaries_flag;
-    int restricted_ref_pic_lists_flag;
-    int min_spatial_segmentation_idc;
-    int max_bytes_per_pic_denom;
-    int max_bits_per_min_cu_denom;
-    int log2_max_mv_length_horizontal;
-    int log2_max_mv_length_vertical;
-} VUI;
-
-typedef struct PTLCommon {
-    uint8_t profile_space;
-    uint8_t tier_flag;
-    uint8_t profile_idc;
-    uint8_t profile_compatibility_flag[32];
-    uint8_t level_idc;
-    uint8_t progressive_source_flag;
-    uint8_t interlaced_source_flag;
-    uint8_t non_packed_constraint_flag;
-    uint8_t frame_only_constraint_flag;
-} PTLCommon;
-
-typedef struct PTL {
-    PTLCommon general_ptl;
-    PTLCommon sub_layer_ptl[MAX_SUB_LAYERS];
-
-    uint8_t sub_layer_profile_present_flag[MAX_SUB_LAYERS];
-    uint8_t sub_layer_level_present_flag[MAX_SUB_LAYERS];
-} PTL;
-
-typedef struct HEVCVPS {
-    uint8_t vps_temporal_id_nesting_flag;
-    int vps_max_layers;
-    int vps_max_sub_layers; ///< vps_max_temporal_layers_minus1 + 1
-
-    PTL ptl;
-    int vps_sub_layer_ordering_info_present_flag;
-    unsigned int vps_max_dec_pic_buffering[MAX_SUB_LAYERS];
-    unsigned int vps_num_reorder_pics[MAX_SUB_LAYERS];
-    unsigned int vps_max_latency_increase[MAX_SUB_LAYERS];
-    int vps_max_layer_id;
-    int vps_num_layer_sets; ///< vps_num_layer_sets_minus1 + 1
-    uint8_t vps_timing_info_present_flag;
-    uint32_t vps_num_units_in_tick;
-    uint32_t vps_time_scale;
-    uint8_t vps_poc_proportional_to_timing_flag;
-    int vps_num_ticks_poc_diff_one; ///< vps_num_ticks_poc_diff_one_minus1 + 1
-    int vps_num_hrd_parameters;
-} HEVCVPS;
-
-typedef struct ScalingList {
-    /* This is a little wasteful, since sizeID 0 only needs 8 coeffs,
-     * and size ID 3 only has 2 arrays, not 6. */
-    uint8_t sl[4][6][64];
-    uint8_t sl_dc[2][6];
-} ScalingList;
-
-typedef struct HEVCSPS {
-    int vps_id;
-    int chroma_format_idc;
-    uint8_t separate_colour_plane_flag;
-
-    ///< output (i.e. cropped) values
-    int output_width, output_height;
-    HEVCWindow output_window;
-
-    HEVCWindow pic_conf_win;
-
-    int bit_depth;
-    int pixel_shift;
-    enum AVPixelFormat pix_fmt;
-
-    unsigned int log2_max_poc_lsb;
-    int pcm_enabled_flag;
-
-    int max_sub_layers;
-    struct {
-        int max_dec_pic_buffering;
-        int num_reorder_pics;
-        int max_latency_increase;
-    } temporal_layer[MAX_SUB_LAYERS];
-
-    VUI vui;
-    PTL ptl;
-
-    uint8_t scaling_list_enable_flag;
-    ScalingList scaling_list;
-
-    unsigned int nb_st_rps;
-    ShortTermRPS st_rps[MAX_SHORT_TERM_RPS_COUNT];
-
-    uint8_t amp_enabled_flag;
-    uint8_t sao_enabled;
-
-    uint8_t long_term_ref_pics_present_flag;
-    uint16_t lt_ref_pic_poc_lsb_sps[32];
-    uint8_t used_by_curr_pic_lt_sps_flag[32];
-    uint8_t num_long_term_ref_pics_sps;
-
-    struct {
-        uint8_t bit_depth;
-        uint8_t bit_depth_chroma;
-        unsigned int log2_min_pcm_cb_size;
-        unsigned int log2_max_pcm_cb_size;
-        uint8_t loop_filter_disable_flag;
-    } pcm;
-    uint8_t sps_temporal_mvp_enabled_flag;
-    uint8_t sps_strong_intra_smoothing_enable_flag;
-
-    unsigned int log2_min_cb_size;
-    unsigned int log2_diff_max_min_coding_block_size;
-    unsigned int log2_min_tb_size;
-    unsigned int log2_max_trafo_size;
-    unsigned int log2_ctb_size;
-    unsigned int log2_min_pu_size;
-
-    int max_transform_hierarchy_depth_inter;
-    int max_transform_hierarchy_depth_intra;
-
-    ///< coded frame dimension in various units
-    int width;
-    int height;
-    int ctb_width;
-    int ctb_height;
-    int ctb_size;
-    int min_cb_width;
-    int min_cb_height;
-    int min_tb_width;
-    int min_tb_height;
-    int min_pu_width;
-    int min_pu_height;
-
-    int hshift[3];
-    int vshift[3];
-
-    int qp_bd_offset;
-} HEVCSPS;
-
-typedef struct HEVCPPS {
-    unsigned int sps_id; ///< seq_parameter_set_id
-
-    uint8_t sign_data_hiding_flag;
-
-    uint8_t cabac_init_present_flag;
-
-    int num_ref_idx_l0_default_active; ///< num_ref_idx_l0_default_active_minus1 + 1
-    int num_ref_idx_l1_default_active; ///< num_ref_idx_l1_default_active_minus1 + 1
-    int pic_init_qp_minus26;
-
-    uint8_t constrained_intra_pred_flag;
-    uint8_t transform_skip_enabled_flag;
-
-    uint8_t cu_qp_delta_enabled_flag;
-    int diff_cu_qp_delta_depth;
-
-    int cb_qp_offset;
-    int cr_qp_offset;
-    uint8_t pic_slice_level_chroma_qp_offsets_present_flag;
-    uint8_t weighted_pred_flag;
-    uint8_t weighted_bipred_flag;
-    uint8_t output_flag_present_flag;
-    uint8_t transquant_bypass_enable_flag;
-
-    uint8_t dependent_slice_segments_enabled_flag;
-    uint8_t tiles_enabled_flag;
-    uint8_t entropy_coding_sync_enabled_flag;
-
-    int num_tile_columns;   ///< num_tile_columns_minus1 + 1
-    int num_tile_rows;      ///< num_tile_rows_minus1 + 1
-    uint8_t uniform_spacing_flag;
-    uint8_t loop_filter_across_tiles_enabled_flag;
-
-    uint8_t seq_loop_filter_across_slices_enabled_flag;
-
-    uint8_t deblocking_filter_control_present_flag;
-    uint8_t deblocking_filter_override_enabled_flag;
-    uint8_t disable_dbf;
-    int beta_offset;    ///< beta_offset_div2 * 2
-    int tc_offset;      ///< tc_offset_div2 * 2
-
-    uint8_t scaling_list_data_present_flag;
-    ScalingList scaling_list;
-
-    uint8_t lists_modification_present_flag;
-    int log2_parallel_merge_level; ///< log2_parallel_merge_level_minus2 + 2
-    int num_extra_slice_header_bits;
-    uint8_t slice_header_extension_present_flag;
-
-    // Inferred parameters
-    unsigned int *column_width;  ///< ColumnWidth
-    unsigned int *row_height;    ///< RowHeight
-    unsigned int *col_bd;        ///< ColBd
-    unsigned int *row_bd;        ///< RowBd
-    int *col_idxX;
-
-    int *ctb_addr_rs_to_ts; ///< CtbAddrRSToTS
-    int *ctb_addr_ts_to_rs; ///< CtbAddrTSToRS
-    int *tile_id;           ///< TileId
-    int *tile_pos_rs;       ///< TilePosRS
-    int *min_cb_addr_zs;    ///< MinCbAddrZS
-    int *min_tb_addr_zs;    ///< MinTbAddrZS
-} HEVCPPS;
-
-typedef struct SliceHeader {
-    unsigned int pps_id;
-
-    ///< address (in raster order) of the first block in the current slice segment
-    unsigned int   slice_segment_addr;
-    ///< address (in raster order) of the first block in the current slice
-    unsigned int   slice_addr;
-
-    enum SliceType slice_type;
-
-    int pic_order_cnt_lsb;
-
-    uint8_t first_slice_in_pic_flag;
-    uint8_t dependent_slice_segment_flag;
-    uint8_t pic_output_flag;
-    uint8_t colour_plane_id;
-
-    ///< RPS coded in the slice header itself is stored here
-    ShortTermRPS slice_rps;
-    const ShortTermRPS *short_term_rps;
-    LongTermRPS long_term_rps;
-    unsigned int list_entry_lx[2][32];
-
-    uint8_t rpl_modification_flag[2];
-    uint8_t no_output_of_prior_pics_flag;
-    uint8_t slice_temporal_mvp_enabled_flag;
-
-    unsigned int nb_refs[2];
-
-    uint8_t slice_sample_adaptive_offset_flag[3];
-    uint8_t mvd_l1_zero_flag;
-
-    uint8_t cabac_init_flag;
-    uint8_t disable_deblocking_filter_flag; ///< slice_header_disable_deblocking_filter_flag
-    uint8_t slice_loop_filter_across_slices_enabled_flag;
-    uint8_t collocated_list;
-
-    unsigned int collocated_ref_idx;
-
-    int slice_qp_delta;
-    int slice_cb_qp_offset;
-    int slice_cr_qp_offset;
-
-    int beta_offset;    ///< beta_offset_div2 * 2
-    int tc_offset;      ///< tc_offset_div2 * 2
-
-    unsigned int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
-
-    int num_entry_point_offsets;
-
-    int8_t slice_qp;
-
-    uint8_t luma_log2_weight_denom;
-    int16_t chroma_log2_weight_denom;
-
-    int16_t luma_weight_l0[16];
-    int16_t chroma_weight_l0[16][2];
-    int16_t chroma_weight_l1[16][2];
-    int16_t luma_weight_l1[16];
-
-    int16_t luma_offset_l0[16];
-    int16_t chroma_offset_l0[16][2];
-
-    int16_t luma_offset_l1[16];
-    int16_t chroma_offset_l1[16][2];
-
-    int slice_ctb_addr_rs;
-} SliceHeader;
-
-typedef struct CodingTree {
-    int depth; ///< ctDepth
-} CodingTree;
-
-typedef struct CodingUnit {
-    int x;
-    int y;
-
-    enum PredMode pred_mode;    ///< PredMode
-    enum PartMode part_mode;    ///< PartMode
-
-    uint8_t rqt_root_cbf;
-
-    uint8_t pcm_flag;
-
-    // Inferred parameters
-    uint8_t intra_split_flag;   ///< IntraSplitFlag
-    uint8_t max_trafo_depth;    ///< MaxTrafoDepth
-    uint8_t cu_transquant_bypass_flag;
-} CodingUnit;
-
-typedef struct Mv {
-    int16_t x;  ///< horizontal component of motion vector
-    int16_t y;  ///< vertical component of motion vector
-} Mv;
-
-typedef struct MvField {
-    Mv mv[2];
-    int8_t ref_idx[2];
-    int8_t pred_flag[2];
-    uint8_t is_intra;
-} MvField;
-
-typedef struct NeighbourAvailable {
-    int cand_bottom_left;
-    int cand_left;
-    int cand_up;
-    int cand_up_left;
-    int cand_up_right;
-    int cand_up_right_sap;
-} NeighbourAvailable;
-
-typedef struct PredictionUnit {
-    int mpm_idx;
-    int rem_intra_luma_pred_mode;
-    uint8_t intra_pred_mode[4];
-    Mv mvd;
-    uint8_t merge_flag;
-    uint8_t intra_pred_mode_c;
-} PredictionUnit;
-
-typedef struct TransformTree {
-    uint8_t cbf_cb[MAX_TRANSFORM_DEPTH][MAX_CU_SIZE * MAX_CU_SIZE];
-    uint8_t cbf_cr[MAX_TRANSFORM_DEPTH][MAX_CU_SIZE * MAX_CU_SIZE];
-    uint8_t cbf_luma;
-
-    // Inferred parameters
-    uint8_t inter_split_flag;
-} TransformTree;
-
-typedef struct TransformUnit {
-    int cu_qp_delta;
-
-    // Inferred parameters;
-    int cur_intra_pred_mode;
-    uint8_t is_cu_qp_delta_coded;
-} TransformUnit;
-
-typedef struct DBParams {
-    int beta_offset;
-    int tc_offset;
-} DBParams;
-
-#define HEVC_FRAME_FLAG_OUTPUT    (1 << 0)
-#define HEVC_FRAME_FLAG_SHORT_REF (1 << 1)
-#define HEVC_FRAME_FLAG_LONG_REF  (1 << 2)
-
-typedef struct HEVCFrame {
-    AVFrame *frame;
-    ThreadFrame tf;
-    MvField *tab_mvf;
-    RefPicList *refPicList;
-    RefPicListTab **rpl_tab;
-    int ctb_count;
-    int poc;
-    struct HEVCFrame *collocated_ref;
-
-    HEVCWindow window;
-
-    AVBufferRef *tab_mvf_buf;
-    AVBufferRef *rpl_tab_buf;
-    AVBufferRef *rpl_buf;
-
-    /**
-     * A sequence counter, so that old frames are output first
-     * after a POC reset
-     */
-    uint16_t sequence;
-
-    /**
-     * A combination of HEVC_FRAME_FLAG_*
-     */
-    uint8_t flags;
-} HEVCFrame;
-
-typedef struct HEVCNAL {
-    uint8_t *rbsp_buffer;
-    int rbsp_buffer_size;
-
-    int size;
-    const uint8_t *data;
-} HEVCNAL;
-
-struct HEVCContext;
-
-typedef struct HEVCPredContext {
-    void (*intra_pred)(struct HEVCContext *s, int x0, int y0,
-                       int log2_size, int c_idx);
-
-    void (*pred_planar[4])(uint8_t *src, const uint8_t *top,
-                           const uint8_t *left, ptrdiff_t stride);
-    void (*pred_dc)(uint8_t *src, const uint8_t *top, const uint8_t *left,
-                    ptrdiff_t stride, int log2_size, int c_idx);
-    void (*pred_angular[4])(uint8_t *src, const uint8_t *top,
-                            const uint8_t *left, ptrdiff_t stride,
-                            int c_idx, int mode);
-} HEVCPredContext;
-
-typedef struct HEVCLocalContext {
-    DECLARE_ALIGNED(16, int16_t, mc_buffer[(MAX_PB_SIZE + 7) * MAX_PB_SIZE]);
-    uint8_t cabac_state[HEVC_CONTEXTS];
-
-    uint8_t first_qp_group;
-
-    GetBitContext gb;
-    CABACContext cc;
-    TransformTree tt;
-
-    int8_t qp_y;
-    int8_t curr_qp_y;
-
-    TransformUnit tu;
-
-    uint8_t ctb_left_flag;
-    uint8_t ctb_up_flag;
-    uint8_t ctb_up_right_flag;
-    uint8_t ctb_up_left_flag;
-    int     start_of_tiles_x;
-    int     end_of_tiles_x;
-    int     end_of_tiles_y;
-    /* +7 is for subpixel interpolation, *2 for high bit depths */
-    DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2];
-    CodingTree ct;
-    CodingUnit cu;
-    PredictionUnit pu;
-    NeighbourAvailable na;
-
-    uint8_t slice_or_tiles_left_boundary;
-    uint8_t slice_or_tiles_up_boundary;
-} HEVCLocalContext;
-
-typedef struct HEVCContext {
-    const AVClass *c;  // needed by private avoptions
-    AVCodecContext *avctx;
-
-    HEVCLocalContext HEVClc;
-
-    uint8_t cabac_state[HEVC_CONTEXTS];
-
-    /** 1 if the independent slice segment header was successfully parsed */
-    uint8_t slice_initialized;
-
-    AVFrame *frame;
-    AVFrame *sao_frame;
-    AVFrame *tmp_frame;
-    AVFrame *output_frame;
-
-    const HEVCVPS *vps;
-    const HEVCSPS *sps;
-    const HEVCPPS *pps;
-    AVBufferRef *vps_list[MAX_VPS_COUNT];
-    AVBufferRef *sps_list[MAX_SPS_COUNT];
-    AVBufferRef *pps_list[MAX_PPS_COUNT];
-
-    AVBufferPool *tab_mvf_pool;
-    AVBufferPool *rpl_tab_pool;
-
-    ///< candidate references for the current frame
-    RefPicList rps[5];
-
-    SliceHeader sh;
-    SAOParams *sao;
-    DBParams *deblock;
-    enum NALUnitType nal_unit_type;
-    int temporal_id;  ///< temporal_id_plus1 - 1
-    HEVCFrame *ref;
-    HEVCFrame DPB[32];
-    int poc;
-    int pocTid0;
-    int slice_idx; ///< number of the slice being currently decoded
-    int eos;       ///< current packet contains an EOS/EOB NAL
-    int max_ra;
-    int bs_width;
-    int bs_height;
-
-    int is_decoded;
-
-    HEVCPredContext hpc;
-    HEVCDSPContext hevcdsp;
-    VideoDSPContext vdsp;
-    DSPContext dsp;
-    int8_t *qp_y_tab;
-    uint8_t *split_cu_flag;
-    uint8_t *horizontal_bs;
-    uint8_t *vertical_bs;
-
-    int32_t *tab_slice_address;
-
-    //  CU
-    uint8_t *skip_flag;
-    uint8_t *tab_ct_depth;
-    // PU
-    uint8_t *tab_ipm;
-
-    uint8_t *cbf_luma; // cbf_luma of colocated TU
-    uint8_t *is_pcm;
-
-    // CTB-level flags affecting loop filter operation
-    uint8_t *filter_slice_edges;
-
-    /** used on BE to byteswap the lines for checksumming */
-    uint8_t *checksum_buf;
-    int      checksum_buf_size;
-
-    /**
-     * Sequence counters for decoded and output frames, so that old
-     * frames are output first after a POC reset
-     */
-    uint16_t seq_decode;
-    uint16_t seq_output;
-
-    HEVCNAL *nals;
-    int nb_nals;
-    int nals_allocated;
-    // type of the first VCL NAL of the current frame
-    enum NALUnitType first_nal_type;
-
-    // for checking the frame checksums
-    struct AVMD5 *md5_ctx;
-    uint8_t       md5[3][16];
-    uint8_t is_md5;
-
-    uint8_t context_initialized;
-    uint8_t is_nalff;       ///< this flag is != 0 if bitstream is encapsulated
-                            ///< as a format defined in 14496-15
-    int apply_defdispwin;
-
-    int nal_length_size;    ///< Number of bytes used for nal length (1, 2 or 4)
-    int nuh_layer_id;
-
-    /** frame packing arrangement variables */
-    int sei_frame_packing_present;
-    int frame_packing_arrangement_type;
-    int content_interpretation_type;
-    int quincunx_subsampling;
-} HEVCContext;
-
-int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
-                                  const HEVCSPS *sps, int is_slice_header);
-int ff_hevc_decode_nal_vps(HEVCContext *s);
-int ff_hevc_decode_nal_sps(HEVCContext *s);
-int ff_hevc_decode_nal_pps(HEVCContext *s);
-int ff_hevc_decode_nal_sei(HEVCContext *s);
-
-/**
- * Mark all frames in DPB as unused for reference.
- */
-void ff_hevc_clear_refs(HEVCContext *s);
-
-/**
- * Drop all frames currently in DPB.
- */
-void ff_hevc_flush_dpb(HEVCContext *s);
-
-/**
- * Compute POC of the current frame and return it.
- */
-int ff_hevc_compute_poc(HEVCContext *s, int poc_lsb);
-
-RefPicList *ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *frame,
-                                 int x0, int y0);
-
-/**
- * Construct the reference picture sets for the current frame.
- */
-int ff_hevc_frame_rps(HEVCContext *s);
-
-/**
- * Construct the reference picture list(s) for the current slice.
- */
-int ff_hevc_slice_rpl(HEVCContext *s);
-
-void ff_hevc_save_states(HEVCContext *s, int ctb_addr_ts);
-void ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts);
-int ff_hevc_sao_merge_flag_decode(HEVCContext *s);
-int ff_hevc_sao_type_idx_decode(HEVCContext *s);
-int ff_hevc_sao_band_position_decode(HEVCContext *s);
-int ff_hevc_sao_offset_abs_decode(HEVCContext *s);
-int ff_hevc_sao_offset_sign_decode(HEVCContext *s);
-int ff_hevc_sao_eo_class_decode(HEVCContext *s);
-int ff_hevc_end_of_slice_flag_decode(HEVCContext *s);
-int ff_hevc_cu_transquant_bypass_flag_decode(HEVCContext *s);
-int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0,
-                             int x_cb, int y_cb);
-int ff_hevc_pred_mode_decode(HEVCContext *s);
-int ff_hevc_split_coding_unit_flag_decode(HEVCContext *s, int ct_depth,
-                                          int x0, int y0);
-int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size);
-int ff_hevc_pcm_flag_decode(HEVCContext *s);
-int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCContext *s);
-int ff_hevc_mpm_idx_decode(HEVCContext *s);
-int ff_hevc_rem_intra_luma_pred_mode_decode(HEVCContext *s);
-int ff_hevc_intra_chroma_pred_mode_decode(HEVCContext *s);
-int ff_hevc_merge_idx_decode(HEVCContext *s);
-int ff_hevc_merge_flag_decode(HEVCContext *s);
-int ff_hevc_inter_pred_idc_decode(HEVCContext *s, int nPbW, int nPbH);
-int ff_hevc_ref_idx_lx_decode(HEVCContext *s, int num_ref_idx_lx);
-int ff_hevc_mvp_lx_flag_decode(HEVCContext *s);
-int ff_hevc_no_residual_syntax_flag_decode(HEVCContext *s);
-int ff_hevc_abs_mvd_greater0_flag_decode(HEVCContext *s);
-int ff_hevc_abs_mvd_greater1_flag_decode(HEVCContext *s);
-int ff_hevc_mvd_decode(HEVCContext *s);
-int ff_hevc_mvd_sign_flag_decode(HEVCContext *s);
-int ff_hevc_split_transform_flag_decode(HEVCContext *s, int log2_trafo_size);
-int ff_hevc_cbf_cb_cr_decode(HEVCContext *s, int trafo_depth);
-int ff_hevc_cbf_luma_decode(HEVCContext *s, int trafo_depth);
-int ff_hevc_transform_skip_flag_decode(HEVCContext *s, int c_idx);
-int ff_hevc_last_significant_coeff_x_prefix_decode(HEVCContext *s, int c_idx,
-                                                   int log2_size);
-int ff_hevc_last_significant_coeff_y_prefix_decode(HEVCContext *s, int c_idx,
-                                                   int log2_size);
-int ff_hevc_last_significant_coeff_suffix_decode(HEVCContext *s,
-                                                 int last_significant_coeff_prefix);
-int ff_hevc_significant_coeff_group_flag_decode(HEVCContext *s, int c_idx,
-                                                int ctx_cg);
-int ff_hevc_significant_coeff_flag_decode(HEVCContext *s, int c_idx, int x_c,
-                                          int y_c, int log2_trafo_size,
-                                          int scan_idx, int prev_sig);
-int ff_hevc_coeff_abs_level_greater1_flag_decode(HEVCContext *s, int c_idx,
-                                                 int ctx_set);
-int ff_hevc_coeff_abs_level_greater2_flag_decode(HEVCContext *s, int c_idx,
-                                                 int inc);
-int ff_hevc_coeff_abs_level_remaining(HEVCContext *s, int base_level,
-                                      int rc_rice_param);
-int ff_hevc_coeff_sign_flag(HEVCContext *s, uint8_t nb);
-
-/**
- * Get the number of candidate references for the current frame.
- */
-int ff_hevc_frame_nb_refs(HEVCContext *s);
-
-int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc);
-
-/**
- * Find next frame in output order and put a reference to it in frame.
- * @return 1 if a frame was output, 0 otherwise
- */
-int ff_hevc_output_frame(HEVCContext *s, AVFrame *frame, int flush);
-
-void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags);
-
-void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0,
-                                     int nPbW, int nPbH);
-void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0,
-                                int nPbW, int nPbH, int log2_cb_size,
-                                int part_idx, int merge_idx, MvField *mv);
-void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0,
-                              int nPbW, int nPbH, int log2_cb_size,
-                              int part_idx, int merge_idx,
-                              MvField *mv, int mvp_lx_flag, int LX);
-void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC, int xBase, int yBase,
-                     int log2_cb_size);
-void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
-                                           int log2_trafo_size,
-                                           int slice_or_tiles_up_boundary,
-                                           int slice_or_tiles_left_boundary);
-int ff_hevc_cu_qp_delta_sign_flag(HEVCContext *s);
-int ff_hevc_cu_qp_delta_abs(HEVCContext *s);
-void ff_hevc_hls_filter(HEVCContext *s, int x, int y);
-void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size);
-
-void ff_hevc_pps_free(HEVCPPS **ppps);
-
-void ff_hevc_pred_init(HEVCPredContext *hpc, int bit_depth);
-
-extern const uint8_t ff_hevc_qpel_extra_before[4];
-extern const uint8_t ff_hevc_qpel_extra_after[4];
-extern const uint8_t ff_hevc_qpel_extra[4];
-
-extern const uint8_t ff_hevc_diag_scan4x4_x[16];
-extern const uint8_t ff_hevc_diag_scan4x4_y[16];
-extern const uint8_t ff_hevc_diag_scan8x8_x[64];
-extern const uint8_t ff_hevc_diag_scan8x8_y[64];
-
-#endif /* AVCODEC_HEVC_H */
diff --git a/deps/libav/libavcodec/hevc_cabac.c b/deps/libav/libavcodec/hevc_cabac.c
deleted file mode 100644
index f2531d4..0000000
--- a/deps/libav/libavcodec/hevc_cabac.c
+++ /dev/null
@@ -1,872 +0,0 @@
-/*
- * HEVC CABAC decoding
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- * Copyright (C) 2012 - 2013 Gildas Cocherel
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-
-#include "cabac_functions.h"
-#include "hevc.h"
-
-#define CABAC_MAX_BIN 100
-
-/**
- * number of bin by SyntaxElement.
- */
-static const int8_t num_bins_in_se[] = {
-     1, // sao_merge_flag
-     1, // sao_type_idx
-     0, // sao_eo_class
-     0, // sao_band_position
-     0, // sao_offset_abs
-     0, // sao_offset_sign
-     0, // end_of_slice_flag
-     3, // split_coding_unit_flag
-     1, // cu_transquant_bypass_flag
-     3, // skip_flag
-     3, // cu_qp_delta
-     1, // pred_mode
-     4, // part_mode
-     0, // pcm_flag
-     1, // prev_intra_luma_pred_mode
-     0, // mpm_idx
-     0, // rem_intra_luma_pred_mode
-     2, // intra_chroma_pred_mode
-     1, // merge_flag
-     1, // merge_idx
-     5, // inter_pred_idc
-     2, // ref_idx_l0
-     2, // ref_idx_l1
-     2, // abs_mvd_greater0_flag
-     2, // abs_mvd_greater1_flag
-     0, // abs_mvd_minus2
-     0, // mvd_sign_flag
-     1, // mvp_lx_flag
-     1, // no_residual_data_flag
-     3, // split_transform_flag
-     2, // cbf_luma
-     4, // cbf_cb, cbf_cr
-     2, // transform_skip_flag[][]
-    18, // last_significant_coeff_x_prefix
-    18, // last_significant_coeff_y_prefix
-     0, // last_significant_coeff_x_suffix
-     0, // last_significant_coeff_y_suffix
-     4, // significant_coeff_group_flag
-    42, // significant_coeff_flag
-    24, // coeff_abs_level_greater1_flag
-     6, // coeff_abs_level_greater2_flag
-     0, // coeff_abs_level_remaining
-     0, // coeff_sign_flag
-};
-
-/**
- * Offset to ctxIdx 0 in init_values and states, indexed by SyntaxElement.
- */
-static const int elem_offset[sizeof(num_bins_in_se)] = {
-      0,
-      1,
-      2,
-      2,
-      2,
-      2,
-      2,
-      2,
-      5,
-      6,
-      9,
-     12,
-     13,
-     17,
-     17,
-     18,
-     18,
-     18,
-     20,
-     21,
-     22,
-     27,
-     29,
-     31,
-     33,
-     35,
-     35,
-     35,
-     36,
-     37,
-     40,
-     42,
-     46,
-     48,
-     66,
-     84,
-     84,
-     84,
-     88,
-    130,
-    154,
-    160,
-    160,
-};
-
-#define CNU 154
-/**
- * Indexed by init_type
- */
-static const uint8_t init_values[3][HEVC_CONTEXTS] = {
-    { // sao_merge_flag
-      153,
-      // sao_type_idx
-      200,
-      // split_coding_unit_flag
-      139, 141, 157,
-      // cu_transquant_bypass_flag
-      154,
-      // skip_flag
-      CNU, CNU, CNU,
-      // cu_qp_delta
-      154, 154, 154,
-      // pred_mode
-      CNU,
-      // part_mode
-      184, CNU, CNU, CNU,
-      // prev_intra_luma_pred_mode
-      184,
-      // intra_chroma_pred_mode
-      63, 139,
-      // merge_flag
-      CNU,
-      // merge_idx
-      CNU,
-      // inter_pred_idc
-      CNU, CNU, CNU, CNU, CNU,
-      // ref_idx_l0
-      CNU, CNU,
-      // ref_idx_l1
-      CNU, CNU,
-      // abs_mvd_greater1_flag
-      CNU, CNU,
-      // abs_mvd_greater1_flag
-      CNU, CNU,
-      // mvp_lx_flag
-      CNU,
-      // no_residual_data_flag
-      CNU,
-      // split_transform_flag
-      153, 138, 138,
-      // cbf_luma
-      111, 141,
-      // cbf_cb, cbf_cr
-      94, 138, 182, 154,
-      // transform_skip_flag
-      139, 139,
-      // last_significant_coeff_x_prefix
-      110, 110, 124, 125, 140, 153, 125, 127, 140, 109, 111, 143, 127, 111,
-       79, 108, 123,  63,
-      // last_significant_coeff_y_prefix
-      110, 110, 124, 125, 140, 153, 125, 127, 140, 109, 111, 143, 127, 111,
-       79, 108, 123,  63,
-      // significant_coeff_group_flag
-      91, 171, 134, 141,
-      // significant_coeff_flag
-      111, 111, 125, 110, 110,  94, 124, 108, 124, 107, 125, 141, 179, 153,
-      125, 107, 125, 141, 179, 153, 125, 107, 125, 141, 179, 153, 125, 140,
-      139, 182, 182, 152, 136, 152, 136, 153, 136, 139, 111, 136, 139, 111,
-      // coeff_abs_level_greater1_flag
-      140,  92, 137, 138, 140, 152, 138, 139, 153,  74, 149,  92, 139, 107,
-      122, 152, 140, 179, 166, 182, 140, 227, 122, 197,
-      // coeff_abs_level_greater2_flag
-      138, 153, 136, 167, 152, 152, },
-    { // sao_merge_flag
-      153,
-      // sao_type_idx
-      185,
-      // split_coding_unit_flag
-      107, 139, 126,
-      // cu_transquant_bypass_flag
-      154,
-      // skip_flag
-      197, 185, 201,
-      // cu_qp_delta
-      154, 154, 154,
-      // pred_mode
-      149,
-      // part_mode
-      154, 139, 154, 154,
-      // prev_intra_luma_pred_mode
-      154,
-      // intra_chroma_pred_mode
-      152, 139,
-      // merge_flag
-      110,
-      // merge_idx
-      122,
-      // inter_pred_idc
-      95, 79, 63, 31, 31,
-      // ref_idx_l0
-      153, 153,
-      // ref_idx_l1
-      153, 153,
-      // abs_mvd_greater1_flag
-      140, 198,
-      // abs_mvd_greater1_flag
-      140, 198,
-      // mvp_lx_flag
-      168,
-      // no_residual_data_flag
-      79,
-      // split_transform_flag
-      124, 138, 94,
-      // cbf_luma
-      153, 111,
-      // cbf_cb, cbf_cr
-      149, 107, 167, 154,
-      // transform_skip_flag
-      139, 139,
-      // last_significant_coeff_x_prefix
-      125, 110,  94, 110,  95,  79, 125, 111, 110,  78, 110, 111, 111,  95,
-       94, 108, 123, 108,
-      // last_significant_coeff_y_prefix
-      125, 110,  94, 110,  95,  79, 125, 111, 110,  78, 110, 111, 111,  95,
-       94, 108, 123, 108,
-      // significant_coeff_group_flag
-      121, 140, 61, 154,
-      // significant_coeff_flag
-      155, 154, 139, 153, 139, 123, 123,  63, 153, 166, 183, 140, 136, 153,
-      154, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 170,
-      153, 123, 123, 107, 121, 107, 121, 167, 151, 183, 140, 151, 183, 140,
-      // coeff_abs_level_greater1_flag
-      154, 196, 196, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121,
-      136, 137, 169, 194, 166, 167, 154, 167, 137, 182,
-      // coeff_abs_level_greater2_flag
-      107, 167, 91, 122, 107, 167, },
-    { // sao_merge_flag
-      153,
-      // sao_type_idx
-      160,
-      // split_coding_unit_flag
-      107, 139, 126,
-      // cu_transquant_bypass_flag
-      154,
-      // skip_flag
-      197, 185, 201,
-      // cu_qp_delta
-      154, 154, 154,
-      // pred_mode
-      134,
-      // part_mode
-      154, 139, 154, 154,
-      // prev_intra_luma_pred_mode
-      183,
-      // intra_chroma_pred_mode
-      152, 139,
-      // merge_flag
-      154,
-      // merge_idx
-      137,
-      // inter_pred_idc
-      95, 79, 63, 31, 31,
-      // ref_idx_l0
-      153, 153,
-      // ref_idx_l1
-      153, 153,
-      // abs_mvd_greater1_flag
-      169, 198,
-      // abs_mvd_greater1_flag
-      169, 198,
-      // mvp_lx_flag
-      168,
-      // no_residual_data_flag
-      79,
-      // split_transform_flag
-      224, 167, 122,
-      // cbf_luma
-      153, 111,
-      // cbf_cb, cbf_cr
-      149, 92, 167, 154,
-      // transform_skip_flag
-      139, 139,
-      // last_significant_coeff_x_prefix
-      125, 110, 124, 110,  95,  94, 125, 111, 111,  79, 125, 126, 111, 111,
-       79, 108, 123,  93,
-      // last_significant_coeff_y_prefix
-      125, 110, 124, 110,  95,  94, 125, 111, 111,  79, 125, 126, 111, 111,
-       79, 108, 123,  93,
-      // significant_coeff_group_flag
-      121, 140, 61, 154,
-      // significant_coeff_flag
-      170, 154, 139, 153, 139, 123, 123,  63, 124, 166, 183, 140, 136, 153,
-      154, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 170,
-      153, 138, 138, 122, 121, 122, 121, 167, 151, 183, 140, 151, 183, 140,
-      // coeff_abs_level_greater1_flag
-      154, 196, 167, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121,
-      136, 122, 169, 208, 166, 167, 154, 152, 167, 182,
-      // coeff_abs_level_greater2_flag
-      107, 167, 91, 107, 107, 167, },
-};
-
-void ff_hevc_save_states(HEVCContext *s, int ctb_addr_ts)
-{
-    if (s->pps->entropy_coding_sync_enabled_flag &&
-        (ctb_addr_ts % s->sps->ctb_width == 2 ||
-         (s->sps->ctb_width == 2 &&
-          ctb_addr_ts % s->sps->ctb_width == 0))) {
-        memcpy(s->cabac_state, s->HEVClc.cabac_state, HEVC_CONTEXTS);
-    }
-}
-
-static void load_states(HEVCContext *s)
-{
-    memcpy(s->HEVClc.cabac_state, s->cabac_state, HEVC_CONTEXTS);
-}
-
-static void cabac_reinit(HEVCLocalContext *lc)
-{
-    skip_bytes(&lc->cc, 0);
-}
-
-static void cabac_init_decoder(HEVCContext *s)
-{
-    GetBitContext *gb = &s->HEVClc.gb;
-    skip_bits(gb, 1);
-    align_get_bits(gb);
-    ff_init_cabac_decoder(&s->HEVClc.cc,
-                          gb->buffer + get_bits_count(gb) / 8,
-                          (get_bits_left(gb) + 7) / 8);
-}
-
-static void cabac_init_state(HEVCContext *s)
-{
-    int init_type = 2 - s->sh.slice_type;
-    int i;
-
-    if (s->sh.cabac_init_flag && s->sh.slice_type != I_SLICE)
-        init_type ^= 3;
-
-    for (i = 0; i < HEVC_CONTEXTS; i++) {
-        int init_value = init_values[init_type][i];
-        int m = (init_value >> 4) * 5 - 45;
-        int n = ((init_value & 15) << 3) - 16;
-        int pre = 2 * (((m * av_clip_c(s->sh.slice_qp, 0, 51)) >> 4) + n) - 127;
-
-        pre ^= pre >> 31;
-        if (pre > 124)
-            pre = 124 + (pre & 1);
-        s->HEVClc.cabac_state[i] = pre;
-    }
-}
-
-void ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts)
-{
-    if (ctb_addr_ts == s->pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]) {
-        cabac_init_decoder(s);
-        if (s->sh.dependent_slice_segment_flag == 0 ||
-            (s->pps->tiles_enabled_flag &&
-             s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[ctb_addr_ts - 1]))
-            cabac_init_state(s);
-
-        if (!s->sh.first_slice_in_pic_flag &&
-            s->pps->entropy_coding_sync_enabled_flag) {
-            if (ctb_addr_ts % s->sps->ctb_width == 0) {
-                if (s->sps->ctb_width == 1)
-                    cabac_init_state(s);
-                else if (s->sh.dependent_slice_segment_flag == 1)
-                    load_states(s);
-            }
-        }
-    } else {
-        if (s->pps->tiles_enabled_flag &&
-            s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[ctb_addr_ts - 1]) {
-            cabac_reinit(&s->HEVClc);
-            cabac_init_state(s);
-        }
-        if (s->pps->entropy_coding_sync_enabled_flag) {
-            if (ctb_addr_ts % s->sps->ctb_width == 0) {
-                get_cabac_terminate(&s->HEVClc.cc);
-                cabac_reinit(&s->HEVClc);
-
-                if (s->sps->ctb_width == 1)
-                    cabac_init_state(s);
-                else
-                    load_states(s);
-            }
-        }
-    }
-}
-
-#define GET_CABAC(ctx) get_cabac(&s->HEVClc.cc, &s->HEVClc.cabac_state[ctx])
-
-int ff_hevc_sao_merge_flag_decode(HEVCContext *s)
-{
-    return GET_CABAC(elem_offset[SAO_MERGE_FLAG]);
-}
-
-int ff_hevc_sao_type_idx_decode(HEVCContext *s)
-{
-    if (!GET_CABAC(elem_offset[SAO_TYPE_IDX]))
-        return 0;
-
-    if (!get_cabac_bypass(&s->HEVClc.cc))
-        return SAO_BAND;
-    return SAO_EDGE;
-}
-
-int ff_hevc_sao_band_position_decode(HEVCContext *s)
-{
-    int i;
-    int value = get_cabac_bypass(&s->HEVClc.cc);
-
-    for (i = 0; i < 4; i++)
-        value = (value << 1) | get_cabac_bypass(&s->HEVClc.cc);
-    return value;
-}
-
-int ff_hevc_sao_offset_abs_decode(HEVCContext *s)
-{
-    int i = 0;
-    int length = (1 << (FFMIN(s->sps->bit_depth, 10) - 5)) - 1;
-
-    while (i < length && get_cabac_bypass(&s->HEVClc.cc))
-        i++;
-    return i;
-}
-
-int ff_hevc_sao_offset_sign_decode(HEVCContext *s)
-{
-    return get_cabac_bypass(&s->HEVClc.cc);
-}
-
-int ff_hevc_sao_eo_class_decode(HEVCContext *s)
-{
-    int ret = get_cabac_bypass(&s->HEVClc.cc) << 1;
-    ret    |= get_cabac_bypass(&s->HEVClc.cc);
-    return ret;
-}
-
-int ff_hevc_end_of_slice_flag_decode(HEVCContext *s)
-{
-    return get_cabac_terminate(&s->HEVClc.cc);
-}
-
-int ff_hevc_cu_transquant_bypass_flag_decode(HEVCContext *s)
-{
-    return GET_CABAC(elem_offset[CU_TRANSQUANT_BYPASS_FLAG]);
-}
-
-int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0, int x_cb, int y_cb)
-{
-    int min_cb_width = s->sps->min_cb_width;
-    int inc = 0;
-    int x0b = x0 & ((1 << s->sps->log2_ctb_size) - 1);
-    int y0b = y0 & ((1 << s->sps->log2_ctb_size) - 1);
-
-    if (s->HEVClc.ctb_left_flag || x0b)
-        inc = !!SAMPLE_CTB(s->skip_flag, x_cb - 1, y_cb);
-    if (s->HEVClc.ctb_up_flag || y0b)
-        inc += !!SAMPLE_CTB(s->skip_flag, x_cb, y_cb - 1);
-
-    return GET_CABAC(elem_offset[SKIP_FLAG] + inc);
-}
-
-int ff_hevc_cu_qp_delta_abs(HEVCContext *s)
-{
-    int prefix_val = 0;
-    int suffix_val = 0;
-    int inc = 0;
-
-    while (prefix_val < 5 && GET_CABAC(elem_offset[CU_QP_DELTA] + inc)) {
-        prefix_val++;
-        inc = 1;
-    }
-    if (prefix_val >= 5) {
-        int k = 0;
-        while (k < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc.cc)) {
-            suffix_val += 1 << k;
-            k++;
-        }
-        if (k == CABAC_MAX_BIN)
-            av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k);
-
-        while (k--)
-            suffix_val += get_cabac_bypass(&s->HEVClc.cc) << k;
-    }
-    return prefix_val + suffix_val;
-}
-
-int ff_hevc_cu_qp_delta_sign_flag(HEVCContext *s)
-{
-    return get_cabac_bypass(&s->HEVClc.cc);
-}
-
-int ff_hevc_pred_mode_decode(HEVCContext *s)
-{
-    return GET_CABAC(elem_offset[PRED_MODE_FLAG]);
-}
-
-int ff_hevc_split_coding_unit_flag_decode(HEVCContext *s, int ct_depth, int x0, int y0)
-{
-    int inc = 0, depth_left = 0, depth_top = 0;
-    int x0b  = x0 & ((1 << s->sps->log2_ctb_size) - 1);
-    int y0b  = y0 & ((1 << s->sps->log2_ctb_size) - 1);
-    int x_cb = x0 >> s->sps->log2_min_cb_size;
-    int y_cb = y0 >> s->sps->log2_min_cb_size;
-
-    if (s->HEVClc.ctb_left_flag || x0b)
-        depth_left = s->tab_ct_depth[(y_cb) * s->sps->min_cb_width + x_cb - 1];
-    if (s->HEVClc.ctb_up_flag || y0b)
-        depth_top = s->tab_ct_depth[(y_cb - 1) * s->sps->min_cb_width + x_cb];
-
-    inc += (depth_left > ct_depth);
-    inc += (depth_top  > ct_depth);
-
-    return GET_CABAC(elem_offset[SPLIT_CODING_UNIT_FLAG] + inc);
-}
-
-int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size)
-{
-    if (GET_CABAC(elem_offset[PART_MODE])) // 1
-        return PART_2Nx2N;
-    if (log2_cb_size == s->sps->log2_min_cb_size) {
-        if (s->HEVClc.cu.pred_mode == MODE_INTRA) // 0
-            return PART_NxN;
-        if (GET_CABAC(elem_offset[PART_MODE] + 1)) // 01
-            return PART_2NxN;
-        if (log2_cb_size == 3) // 00
-            return PART_Nx2N;
-        if (GET_CABAC(elem_offset[PART_MODE] + 2)) // 001
-            return PART_Nx2N;
-        return PART_NxN; // 000
-    }
-
-    if (!s->sps->amp_enabled_flag) {
-        if (GET_CABAC(elem_offset[PART_MODE] + 1)) // 01
-            return PART_2NxN;
-        return PART_Nx2N;
-    }
-
-    if (GET_CABAC(elem_offset[PART_MODE] + 1)) { // 01X, 01XX
-        if (GET_CABAC(elem_offset[PART_MODE] + 3)) // 011
-            return PART_2NxN;
-        if (get_cabac_bypass(&s->HEVClc.cc)) // 0101
-            return PART_2NxnD;
-        return PART_2NxnU; // 0100
-    }
-
-    if (GET_CABAC(elem_offset[PART_MODE] + 3)) // 001
-        return PART_Nx2N;
-    if (get_cabac_bypass(&s->HEVClc.cc)) // 0001
-        return PART_nRx2N;
-    return PART_nLx2N;  // 0000
-}
-
-int ff_hevc_pcm_flag_decode(HEVCContext *s)
-{
-    return get_cabac_terminate(&s->HEVClc.cc);
-}
-
-int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCContext *s)
-{
-    return GET_CABAC(elem_offset[PREV_INTRA_LUMA_PRED_FLAG]);
-}
-
-int ff_hevc_mpm_idx_decode(HEVCContext *s)
-{
-    int i = 0;
-    while (i < 2 && get_cabac_bypass(&s->HEVClc.cc))
-        i++;
-    return i;
-}
-
-int ff_hevc_rem_intra_luma_pred_mode_decode(HEVCContext *s)
-{
-    int i;
-    int value = get_cabac_bypass(&s->HEVClc.cc);
-
-    for (i = 0; i < 4; i++)
-        value = (value << 1) | get_cabac_bypass(&s->HEVClc.cc);
-    return value;
-}
-
-int ff_hevc_intra_chroma_pred_mode_decode(HEVCContext *s)
-{
-    int ret;
-    if (!GET_CABAC(elem_offset[INTRA_CHROMA_PRED_MODE]))
-        return 4;
-
-    ret  = get_cabac_bypass(&s->HEVClc.cc) << 1;
-    ret |= get_cabac_bypass(&s->HEVClc.cc);
-    return ret;
-}
-
-int ff_hevc_merge_idx_decode(HEVCContext *s)
-{
-    int i = GET_CABAC(elem_offset[MERGE_IDX]);
-
-    if (i != 0) {
-        while (i < s->sh.max_num_merge_cand-1 && get_cabac_bypass(&s->HEVClc.cc))
-            i++;
-    }
-    return i;
-}
-
-int ff_hevc_merge_flag_decode(HEVCContext *s)
-{
-    return GET_CABAC(elem_offset[MERGE_FLAG]);
-}
-
-int ff_hevc_inter_pred_idc_decode(HEVCContext *s, int nPbW, int nPbH)
-{
-    if (nPbW + nPbH == 12)
-        return GET_CABAC(elem_offset[INTER_PRED_IDC] + 4);
-    if (GET_CABAC(elem_offset[INTER_PRED_IDC] + s->HEVClc.ct.depth))
-        return PRED_BI;
-
-    return GET_CABAC(elem_offset[INTER_PRED_IDC] + 4);
-}
-
-int ff_hevc_ref_idx_lx_decode(HEVCContext *s, int num_ref_idx_lx)
-{
-    int i = 0;
-    int max = num_ref_idx_lx - 1;
-    int max_ctx = FFMIN(max, 2);
-
-    while (i < max_ctx && GET_CABAC(elem_offset[REF_IDX_L0] + i))
-        i++;
-    if (i == 2) {
-        while (i < max && get_cabac_bypass(&s->HEVClc.cc))
-            i++;
-    }
-
-    return i;
-}
-
-int ff_hevc_mvp_lx_flag_decode(HEVCContext *s)
-{
-    return GET_CABAC(elem_offset[MVP_LX_FLAG]);
-}
-
-int ff_hevc_no_residual_syntax_flag_decode(HEVCContext *s)
-{
-    return GET_CABAC(elem_offset[NO_RESIDUAL_DATA_FLAG]);
-}
-
-int ff_hevc_abs_mvd_greater0_flag_decode(HEVCContext *s)
-{
-    return GET_CABAC(elem_offset[ABS_MVD_GREATER0_FLAG]);
-}
-
-int ff_hevc_abs_mvd_greater1_flag_decode(HEVCContext *s)
-{
-    return GET_CABAC(elem_offset[ABS_MVD_GREATER1_FLAG] + 1);
-}
-
-int ff_hevc_mvd_decode(HEVCContext *s)
-{
-    int ret = 2;
-    int k = 1;
-
-    while (k < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc.cc)) {
-        ret += 1 << k;
-        k++;
-    }
-    if (k == CABAC_MAX_BIN)
-        av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k);
-    while (k--)
-        ret += get_cabac_bypass(&s->HEVClc.cc) << k;
-    return get_cabac_bypass_sign(&s->HEVClc.cc, -ret);
-}
-
-int ff_hevc_mvd_sign_flag_decode(HEVCContext *s)
-{
-    return get_cabac_bypass_sign(&s->HEVClc.cc, -1);
-}
-
-int ff_hevc_split_transform_flag_decode(HEVCContext *s, int log2_trafo_size)
-{
-    return GET_CABAC(elem_offset[SPLIT_TRANSFORM_FLAG] + 5 - log2_trafo_size);
-}
-
-int ff_hevc_cbf_cb_cr_decode(HEVCContext *s, int trafo_depth)
-{
-    return GET_CABAC(elem_offset[CBF_CB_CR] + trafo_depth);
-}
-
-int ff_hevc_cbf_luma_decode(HEVCContext *s, int trafo_depth)
-{
-    return GET_CABAC(elem_offset[CBF_LUMA] + !trafo_depth);
-}
-
-int ff_hevc_transform_skip_flag_decode(HEVCContext *s, int c_idx)
-{
-    return GET_CABAC(elem_offset[TRANSFORM_SKIP_FLAG] + !!c_idx);
-}
-
-#define LAST_SIG_COEFF(elem)                                                    \
-    int i = 0;                                                                  \
-    int max = (log2_size << 1) - 1;                                             \
-    int ctx_offset, ctx_shift;                                                  \
-                                                                                \
-    if (c_idx == 0) {                                                           \
-        ctx_offset = 3 * (log2_size - 2)  + ((log2_size - 1) >> 2);             \
-        ctx_shift = (log2_size + 1) >> 2;                                       \
-    } else {                                                                    \
-        ctx_offset = 15;                                                        \
-        ctx_shift = log2_size - 2;                                              \
-    }                                                                           \
-    while (i < max &&                                                           \
-           GET_CABAC(elem_offset[elem] + (i >> ctx_shift) + ctx_offset))        \
-        i++;                                                                    \
-    return i;
-
-int ff_hevc_last_significant_coeff_x_prefix_decode(HEVCContext *s, int c_idx,
-                                                   int log2_size)
-{
-    LAST_SIG_COEFF(LAST_SIGNIFICANT_COEFF_X_PREFIX)
-}
-
-int ff_hevc_last_significant_coeff_y_prefix_decode(HEVCContext *s, int c_idx,
-                                                   int log2_size)
-{
-    LAST_SIG_COEFF(LAST_SIGNIFICANT_COEFF_Y_PREFIX)
-}
-
-int ff_hevc_last_significant_coeff_suffix_decode(HEVCContext *s,
-                                                 int last_significant_coeff_prefix)
-{
-    int i;
-    int length = (last_significant_coeff_prefix >> 1) - 1;
-    int value = get_cabac_bypass(&s->HEVClc.cc);
-
-    for (i = 1; i < length; i++)
-        value = (value << 1) | get_cabac_bypass(&s->HEVClc.cc);
-    return value;
-}
-
-int ff_hevc_significant_coeff_group_flag_decode(HEVCContext *s, int c_idx, int ctx_cg)
-{
-    int inc;
-
-    inc = FFMIN(ctx_cg, 1) + (c_idx>0 ? 2 : 0);
-
-    return GET_CABAC(elem_offset[SIGNIFICANT_COEFF_GROUP_FLAG] + inc);
-}
-
-int ff_hevc_significant_coeff_flag_decode(HEVCContext *s, int c_idx, int x_c, int y_c,
-                                          int log2_trafo_size, int scan_idx, int prev_sig)
-{
-    static const uint8_t ctx_idx_map[] = {
-        0, 1, 4, 5, 2, 3, 4, 5, 6, 6, 8, 8, 7, 7, 8, 8
-    };
-    int x_cg = x_c >> 2;
-    int y_cg = y_c >> 2;
-    int sig_ctx, inc;
-
-    if (x_c + y_c == 0) {
-        sig_ctx = 0;
-    } else if (log2_trafo_size == 2) {
-        sig_ctx = ctx_idx_map[(y_c << 2) + x_c];
-    } else {
-        switch (prev_sig) {
-        case 0: {
-                int x_off = x_c & 3;
-                int y_off = y_c & 3;
-                sig_ctx   = ((x_off + y_off) == 0) ? 2 : ((x_off + y_off) <= 2) ? 1 : 0;
-            }
-            break;
-        case 1:
-            sig_ctx = 2 - FFMIN(y_c & 3, 2);
-            break;
-        case 2:
-            sig_ctx = 2 - FFMIN(x_c & 3, 2);
-            break;
-        default:
-            sig_ctx = 2;
-        }
-
-        if (c_idx == 0 && (x_cg > 0 || y_cg > 0))
-            sig_ctx += 3;
-
-        if (log2_trafo_size == 3) {
-            sig_ctx += (scan_idx == SCAN_DIAG) ? 9 : 15;
-        } else {
-            sig_ctx += c_idx ? 12 : 21;
-        }
-    }
-
-    if (c_idx == 0)
-        inc = sig_ctx;
-    else
-        inc = sig_ctx + 27;
-
-    return GET_CABAC(elem_offset[SIGNIFICANT_COEFF_FLAG] + inc);
-}
-
-int ff_hevc_coeff_abs_level_greater1_flag_decode(HEVCContext *s, int c_idx, int inc)
-{
-
-    if (c_idx > 0)
-        inc += 16;
-
-    return GET_CABAC(elem_offset[COEFF_ABS_LEVEL_GREATER1_FLAG] + inc);
-}
-
-int ff_hevc_coeff_abs_level_greater2_flag_decode(HEVCContext *s, int c_idx, int inc)
-{
-    if (c_idx > 0)
-        inc += 4;
-
-    return GET_CABAC(elem_offset[COEFF_ABS_LEVEL_GREATER2_FLAG] + inc);
-}
-
-int ff_hevc_coeff_abs_level_remaining(HEVCContext *s, int base_level, int rc_rice_param)
-{
-    int prefix = 0;
-    int suffix = 0;
-    int last_coeff_abs_level_remaining;
-    int i;
-
-    while (prefix < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc.cc))
-        prefix++;
-    if (prefix == CABAC_MAX_BIN)
-        av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", prefix);
-    if (prefix < 3) {
-        for (i = 0; i < rc_rice_param; i++)
-            suffix = (suffix << 1) | get_cabac_bypass(&s->HEVClc.cc);
-        last_coeff_abs_level_remaining = (prefix << rc_rice_param) + suffix;
-    } else {
-        int prefix_minus3 = prefix - 3;
-        for (i = 0; i < prefix_minus3 + rc_rice_param; i++)
-            suffix = (suffix << 1) | get_cabac_bypass(&s->HEVClc.cc);
-        last_coeff_abs_level_remaining = (((1 << prefix_minus3) + 3 - 1)
-                                              << rc_rice_param) + suffix;
-    }
-    return last_coeff_abs_level_remaining;
-}
-
-int ff_hevc_coeff_sign_flag(HEVCContext *s, uint8_t nb)
-{
-    int i;
-    int ret = 0;
-
-    for (i = 0; i < nb; i++)
-        ret = (ret << 1) | get_cabac_bypass(&s->HEVClc.cc);
-    return ret;
-}
diff --git a/deps/libav/libavcodec/hevc_filter.c b/deps/libav/libavcodec/hevc_filter.c
deleted file mode 100644
index d3f2ff1..0000000
--- a/deps/libav/libavcodec/hevc_filter.c
+++ /dev/null
@@ -1,745 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- * Copyright (C) 2013 Seppo Tomperi
- * Copyright (C) 2013 Wassim Hamidouche
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-
-#include "cabac_functions.h"
-#include "golomb.h"
-#include "hevc.h"
-
-#define LUMA 0
-#define CB 1
-#define CR 2
-
-static const uint8_t tctable[54] = {
-    0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 0, 0, 1, // QP  0...18
-    1, 1, 1, 1, 1, 1, 1,  1,  2,  2,  2,  2,  3,  3,  3,  3, 4, 4, 4, // QP 19...37
-    5, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14, 16, 18, 20, 22, 24           // QP 38...53
-};
-
-static const uint8_t betatable[52] = {
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  6,  7,  8, // QP 0...18
-     9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, // QP 19...37
-    38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64                      // QP 38...51
-};
-
-static int chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset)
-{
-    static const int qp_c[] = {
-        29, 30, 31, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37
-    };
-    int qp, qp_i, offset, idxt;
-
-    // slice qp offset is not used for deblocking
-    if (c_idx == 1)
-        offset = s->pps->cb_qp_offset;
-    else
-        offset = s->pps->cr_qp_offset;
-
-    qp_i = av_clip_c(qp_y + offset, 0, 57);
-    if (qp_i < 30)
-        qp = qp_i;
-    else if (qp_i > 43)
-        qp = qp_i - 6;
-    else
-        qp = qp_c[qp_i - 30];
-
-    idxt = av_clip_c(qp + DEFAULT_INTRA_TC_OFFSET + tc_offset, 0, 53);
-    return tctable[idxt];
-}
-
-static int get_qPy_pred(HEVCContext *s, int xC, int yC,
-                        int xBase, int yBase, int log2_cb_size)
-{
-    HEVCLocalContext *lc     = &s->HEVClc;
-    int ctb_size_mask        = (1 << s->sps->log2_ctb_size) - 1;
-    int MinCuQpDeltaSizeMask = (1 << (s->sps->log2_ctb_size -
-                                      s->pps->diff_cu_qp_delta_depth)) - 1;
-    int xQgBase              = xBase - (xBase & MinCuQpDeltaSizeMask);
-    int yQgBase              = yBase - (yBase & MinCuQpDeltaSizeMask);
-    int min_cb_width         = s->sps->min_cb_width;
-    int min_cb_height        = s->sps->min_cb_height;
-    int x_cb                 = xQgBase >> s->sps->log2_min_cb_size;
-    int y_cb                 = yQgBase >> s->sps->log2_min_cb_size;
-    int availableA           = (xBase   & ctb_size_mask) &&
-                               (xQgBase & ctb_size_mask);
-    int availableB           = (yBase   & ctb_size_mask) &&
-                               (yQgBase & ctb_size_mask);
-    int qPy_pred, qPy_a, qPy_b;
-
-    // qPy_pred
-    if (lc->first_qp_group || (!xQgBase && !yQgBase)) {
-        lc->first_qp_group = !lc->tu.is_cu_qp_delta_coded;
-        qPy_pred = s->sh.slice_qp;
-    } else {
-        qPy_pred = lc->qp_y;
-        if (log2_cb_size < s->sps->log2_ctb_size -
-                           s->pps->diff_cu_qp_delta_depth) {
-            static const int offsetX[8][8] = {
-                { -1, 1, 3, 1, 7, 1, 3, 1 },
-                {  0, 0, 0, 0, 0, 0, 0, 0 },
-                {  1, 3, 1, 3, 1, 3, 1, 3 },
-                {  2, 2, 2, 2, 2, 2, 2, 2 },
-                {  3, 5, 7, 5, 3, 5, 7, 5 },
-                {  4, 4, 4, 4, 4, 4, 4, 4 },
-                {  5, 7, 5, 7, 5, 7, 5, 7 },
-                {  6, 6, 6, 6, 6, 6, 6, 6 }
-            };
-            static const int offsetY[8][8] = {
-                { 7, 0, 1, 2, 3, 4, 5, 6 },
-                { 0, 1, 2, 3, 4, 5, 6, 7 },
-                { 1, 0, 3, 2, 5, 4, 7, 6 },
-                { 0, 1, 2, 3, 4, 5, 6, 7 },
-                { 3, 0, 1, 2, 7, 4, 5, 6 },
-                { 0, 1, 2, 3, 4, 5, 6, 7 },
-                { 1, 0, 3, 2, 5, 4, 7, 6 },
-                { 0, 1, 2, 3, 4, 5, 6, 7 }
-            };
-            int xC0b = (xC - (xC & ctb_size_mask)) >> s->sps->log2_min_cb_size;
-            int yC0b = (yC - (yC & ctb_size_mask)) >> s->sps->log2_min_cb_size;
-            int idxX = (xQgBase  & ctb_size_mask)  >> s->sps->log2_min_cb_size;
-            int idxY = (yQgBase  & ctb_size_mask)  >> s->sps->log2_min_cb_size;
-            int idx_mask = ctb_size_mask >> s->sps->log2_min_cb_size;
-            int x, y;
-
-            x = FFMIN(xC0b +  offsetX[idxX][idxY],             min_cb_width  - 1);
-            y = FFMIN(yC0b + (offsetY[idxX][idxY] & idx_mask), min_cb_height - 1);
-
-            if (xC0b == (lc->start_of_tiles_x >> s->sps->log2_min_cb_size) &&
-                offsetX[idxX][idxY] == -1) {
-                x = (lc->end_of_tiles_x >> s->sps->log2_min_cb_size) - 1;
-                y = yC0b - 1;
-            }
-            qPy_pred = s->qp_y_tab[y * min_cb_width + x];
-        }
-    }
-
-    // qPy_a
-    if (availableA == 0)
-        qPy_a = qPy_pred;
-    else
-        qPy_a = s->qp_y_tab[(x_cb - 1) + y_cb * min_cb_width];
-
-    // qPy_b
-    if (availableB == 0)
-        qPy_b = qPy_pred;
-    else
-        qPy_b = s->qp_y_tab[x_cb + (y_cb - 1) * min_cb_width];
-
-    return (qPy_a + qPy_b + 1) >> 1;
-}
-
-void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC,
-                     int xBase, int yBase, int log2_cb_size)
-{
-    int qp_y = get_qPy_pred(s, xC, yC, xBase, yBase, log2_cb_size);
-
-    if (s->HEVClc.tu.cu_qp_delta != 0) {
-        int off = s->sps->qp_bd_offset;
-        s->HEVClc.qp_y = FFUMOD(qp_y + s->HEVClc.tu.cu_qp_delta + 52 + 2 * off,
-                                52 + off) - off;
-    } else
-        s->HEVClc.qp_y = qp_y;
-}
-
-static int get_qPy(HEVCContext *s, int xC, int yC)
-{
-    int log2_min_cb_size  = s->sps->log2_min_cb_size;
-    int x                 = xC >> log2_min_cb_size;
-    int y                 = yC >> log2_min_cb_size;
-    return s->qp_y_tab[x + y * s->sps->min_cb_width];
-}
-
-static void copy_CTB(uint8_t *dst, uint8_t *src,
-                     int width, int height, int stride)
-{
-    int i;
-
-    for (i = 0; i < height; i++) {
-        memcpy(dst, src, width);
-        dst += stride;
-        src += stride;
-    }
-}
-
-#define CTB(tab, x, y) ((tab)[(y) * s->sps->ctb_width + (x)])
-
-static void sao_filter_CTB(HEVCContext *s, int x, int y)
-{
-    //  TODO: This should be easily parallelizable
-    //  TODO: skip CBs when (cu_transquant_bypass_flag || (pcm_loop_filter_disable_flag && pcm_flag))
-    int c_idx = 0;
-    int class = 1, class_index;
-    int edges[4];  // 0 left 1 top 2 right 3 bottom
-    SAOParams *sao[4];
-    int classes[4];
-    int x_shift = 0, y_shift = 0;
-    int x_ctb = x >> s->sps->log2_ctb_size;
-    int y_ctb = y >> s->sps->log2_ctb_size;
-    int ctb_addr_rs = y_ctb * s->sps->ctb_width + x_ctb;
-    int ctb_addr_ts = s->pps->ctb_addr_rs_to_ts[ctb_addr_rs];
-
-    // flags indicating unfilterable edges
-    uint8_t vert_edge[]  = { 0, 0, 0, 0 };
-    uint8_t horiz_edge[] = { 0, 0, 0, 0 };
-    uint8_t diag_edge[]  = { 0, 0, 0, 0 };
-    uint8_t lfase[3]; // current, above, left
-    uint8_t no_tile_filter = s->pps->tiles_enabled_flag &&
-                             !s->pps->loop_filter_across_tiles_enabled_flag;
-    uint8_t left_tile_edge = 0, up_tile_edge = 0;
-
-    sao[0]     = &CTB(s->sao, x_ctb, y_ctb);
-    edges[0]   = x_ctb == 0;
-    edges[1]   = y_ctb == 0;
-    edges[2]   = x_ctb == s->sps->ctb_width  - 1;
-    edges[3]   = y_ctb == s->sps->ctb_height - 1;
-    lfase[0]   = CTB(s->filter_slice_edges, x_ctb, y_ctb);
-    classes[0] = 0;
-
-    if (!edges[0]) {
-        left_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs-1]];
-        sao[class] = &CTB(s->sao, x_ctb - 1, y_ctb);
-        vert_edge[0] = (!lfase[0] && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb - 1, y_ctb)) || left_tile_edge;
-        vert_edge[2] = vert_edge[0];
-        lfase[2]     = CTB(s->filter_slice_edges, x_ctb - 1, y_ctb);
-        classes[class] = 2;
-        class++;
-        x_shift = 8;
-    }
-
-    if (!edges[1]) {
-        up_tile_edge = no_tile_filter && s->pps->tile_id[ctb_addr_ts] != s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->sps->ctb_width]];
-        sao[class] = &CTB(s->sao, x_ctb, y_ctb - 1);
-        horiz_edge[0] = (!lfase[0] && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb, y_ctb - 1)) || up_tile_edge;
-        horiz_edge[1] = horiz_edge[0];
-        lfase[1] = CTB(s->filter_slice_edges, x_ctb, y_ctb - 1);
-        classes[class] = 1;
-        class++;
-        y_shift = 4;
-
-        if (!edges[0]) {
-            classes[class] = 3;
-            sao[class] = &CTB(s->sao, x_ctb - 1, y_ctb - 1);
-            class++;
-
-            // Tile check here is done current CTB row/col, not above/left like you'd expect,
-            //but that is because the tile boundary always extends through the whole pic
-            vert_edge[1] = (!lfase[1] && CTB(s->tab_slice_address, x_ctb, y_ctb - 1) != CTB(s->tab_slice_address, x_ctb - 1, y_ctb - 1)) || left_tile_edge;
-            vert_edge[3] = vert_edge[1];
-            horiz_edge[2] = (!lfase[2] && CTB(s->tab_slice_address, x_ctb - 1, y_ctb) != CTB(s->tab_slice_address, x_ctb - 1, y_ctb - 1)) || up_tile_edge;
-            horiz_edge[3] = horiz_edge[2];
-            diag_edge[0] = (!lfase[0] && CTB(s->tab_slice_address, x_ctb, y_ctb) != CTB(s->tab_slice_address, x_ctb - 1, y_ctb - 1)) || left_tile_edge || up_tile_edge;
-            diag_edge[3] = diag_edge[0];
-
-            // Does left CTB comes after above CTB?
-            if (CTB(s->tab_slice_address, x_ctb - 1, y_ctb) >
-                CTB(s->tab_slice_address, x_ctb, y_ctb - 1)) {
-                diag_edge[2] = !lfase[2] || left_tile_edge || up_tile_edge;
-                diag_edge[1] = diag_edge[2];
-            } else if (CTB(s->tab_slice_address, x_ctb - 1, y_ctb) <
-                       CTB(s->tab_slice_address, x_ctb, y_ctb - 1)) {
-                diag_edge[1] = !lfase[1] || left_tile_edge || up_tile_edge;
-                diag_edge[2] = diag_edge[1];
-            } else {
-                // Same slice, only consider tiles
-                diag_edge[2] = left_tile_edge || up_tile_edge;
-                diag_edge[1] = diag_edge[2];
-            }
-        }
-    }
-
-    for (c_idx = 0; c_idx < 3; c_idx++) {
-        int chroma = c_idx ? 1 : 0;
-        int x0 = x >> chroma;
-        int y0 = y >> chroma;
-        int stride = s->frame->linesize[c_idx];
-        int ctb_size = (1 << (s->sps->log2_ctb_size)) >> s->sps->hshift[c_idx];
-        int width = FFMIN(ctb_size,
-                          (s->sps->width >> s->sps->hshift[c_idx]) - x0);
-        int height = FFMIN(ctb_size,
-                           (s->sps->height >> s->sps->vshift[c_idx]) - y0);
-
-        uint8_t *src = &s->frame->data[c_idx][y0 * stride + (x0 << s->sps->pixel_shift)];
-        uint8_t *dst = &s->sao_frame->data[c_idx][y0 * stride + (x0 << s->sps->pixel_shift)];
-        int offset = (y_shift >> chroma) * stride + ((x_shift >> chroma) << s->sps->pixel_shift);
-
-        copy_CTB(dst - offset, src - offset,
-                 (edges[2] ? width  + (x_shift >> chroma) : width)  << s->sps->pixel_shift,
-                 (edges[3] ? height + (y_shift >> chroma) : height), stride);
-
-        for (class_index = 0; class_index < class; class_index++) {
-
-            switch (sao[class_index]->type_idx[c_idx]) {
-            case SAO_BAND:
-                s->hevcdsp.sao_band_filter[classes[class_index]](dst, src,
-                                                                 stride,
-                                                                 sao[class_index],
-                                                                 edges, width,
-                                                                 height, c_idx);
-                break;
-            case SAO_EDGE:
-                s->hevcdsp.sao_edge_filter[classes[class_index]](dst, src,
-                                                                 stride,
-                                                                 sao[class_index],
-                                                                 edges, width,
-                                                                 height, c_idx,
-                                                                 vert_edge[classes[class_index]],
-                                                                 horiz_edge[classes[class_index]],
-                                                                 diag_edge[classes[class_index]]);
-                break;
-            }
-        }
-    }
-}
-
-static int get_pcm(HEVCContext *s, int x, int y)
-{
-    int log2_min_pu_size = s->sps->log2_min_pu_size;
-    int x_pu             = x >> log2_min_pu_size;
-    int y_pu             = y >> log2_min_pu_size;
-
-    if (x < 0 || x_pu >= s->sps->min_pu_width ||
-        y < 0 || y_pu >= s->sps->min_pu_height)
-        return 2;
-    return s->is_pcm[y_pu * s->sps->min_pu_width + x_pu];
-}
-
-#define TC_CALC(qp, bs)                                                 \
-    tctable[av_clip((qp) + DEFAULT_INTRA_TC_OFFSET * ((bs) - 1) +       \
-                    (tc_offset >> 1 << 1),                              \
-                    0, MAX_QP + DEFAULT_INTRA_TC_OFFSET)]
-
-static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0)
-{
-    uint8_t *src;
-    int x, y, x_end, y_end, chroma;
-    int c_tc[2], beta[2], tc[2];
-    uint8_t no_p[2] = { 0 };
-    uint8_t no_q[2] = { 0 };
-
-    int log2_ctb_size = s->sps->log2_ctb_size;
-    int ctb_size        = 1 << log2_ctb_size;
-    int ctb             = (x0 >> log2_ctb_size) +
-                          (y0 >> log2_ctb_size) * s->sps->ctb_width;
-    int cur_tc_offset   = s->deblock[ctb].tc_offset;
-    int cur_beta_offset = s->deblock[ctb].beta_offset;
-    int tc_offset, left_tc_offset, beta_offset, left_beta_offset;
-    int pcmf = (s->sps->pcm_enabled_flag &&
-                s->sps->pcm.loop_filter_disable_flag) ||
-               s->pps->transquant_bypass_enable_flag;
-
-    if (x0) {
-        left_tc_offset   = s->deblock[ctb - 1].tc_offset;
-        left_beta_offset = s->deblock[ctb - 1].beta_offset;
-    }
-
-    x_end = x0 + ctb_size;
-    if (x_end > s->sps->width)
-        x_end = s->sps->width;
-    y_end = y0 + ctb_size;
-    if (y_end > s->sps->height)
-        y_end = s->sps->height;
-
-    tc_offset   = cur_tc_offset;
-    beta_offset = cur_beta_offset;
-
-    // vertical filtering luma
-    for (y = y0; y < y_end; y += 8) {
-        for (x = x0 ? x0 : 8; x < x_end; x += 8) {
-            const int bs0 = s->vertical_bs[(x >> 3) + (y       >> 2) * s->bs_width];
-            const int bs1 = s->vertical_bs[(x >> 3) + ((y + 4) >> 2) * s->bs_width];
-            if (bs0 || bs1) {
-                const int qp0 = (get_qPy(s, x - 1, y)     + get_qPy(s, x, y)     + 1) >> 1;
-                const int qp1 = (get_qPy(s, x - 1, y + 4) + get_qPy(s, x, y + 4) + 1) >> 1;
-
-                beta[0] = betatable[av_clip(qp0 + (beta_offset >> 1 << 1), 0, MAX_QP)];
-                beta[1] = betatable[av_clip(qp1 + (beta_offset >> 1 << 1), 0, MAX_QP)];
-                tc[0]   = bs0 ? TC_CALC(qp0, bs0) : 0;
-                tc[1]   = bs1 ? TC_CALC(qp1, bs1) : 0;
-                src     = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)];
-                if (pcmf) {
-                    no_p[0] = get_pcm(s, x - 1, y);
-                    no_p[1] = get_pcm(s, x - 1, y + 4);
-                    no_q[0] = get_pcm(s, x, y);
-                    no_q[1] = get_pcm(s, x, y + 4);
-                    s->hevcdsp.hevc_v_loop_filter_luma_c(src,
-                                                         s->frame->linesize[LUMA],
-                                                         beta, tc, no_p, no_q);
-                } else
-                    s->hevcdsp.hevc_v_loop_filter_luma(src,
-                                                       s->frame->linesize[LUMA],
-                                                       beta, tc, no_p, no_q);
-            }
-        }
-    }
-
-    // vertical filtering chroma
-    for (chroma = 1; chroma <= 2; chroma++) {
-        for (y = y0; y < y_end; y += 16) {
-            for (x = x0 ? x0 : 16; x < x_end; x += 16) {
-                const int bs0 = s->vertical_bs[(x >> 3) + (y       >> 2) * s->bs_width];
-                const int bs1 = s->vertical_bs[(x >> 3) + ((y + 8) >> 2) * s->bs_width];
-                if ((bs0 == 2) || (bs1 == 2)) {
-                    const int qp0 = (get_qPy(s, x - 1, y)     + get_qPy(s, x, y)     + 1) >> 1;
-                    const int qp1 = (get_qPy(s, x - 1, y + 8) + get_qPy(s, x, y + 8) + 1) >> 1;
-
-                    c_tc[0] = (bs0 == 2) ? chroma_tc(s, qp0, chroma, tc_offset) : 0;
-                    c_tc[1] = (bs1 == 2) ? chroma_tc(s, qp1, chroma, tc_offset) : 0;
-                    src     = &s->frame->data[chroma][y / 2 * s->frame->linesize[chroma] + ((x / 2) << s->sps->pixel_shift)];
-                    if (pcmf) {
-                        no_p[0] = get_pcm(s, x - 1, y);
-                        no_p[1] = get_pcm(s, x - 1, y + 8);
-                        no_q[0] = get_pcm(s, x, y);
-                        no_q[1] = get_pcm(s, x, y + 8);
-                        s->hevcdsp.hevc_v_loop_filter_chroma_c(src,
-                                                               s->frame->linesize[chroma],
-                                                               c_tc, no_p, no_q);
-                    } else
-                        s->hevcdsp.hevc_v_loop_filter_chroma(src,
-                                                             s->frame->linesize[chroma],
-                                                             c_tc, no_p, no_q);
-                }
-            }
-        }
-    }
-
-    // horizontal filtering luma
-    if (x_end != s->sps->width)
-        x_end -= 8;
-    for (y = y0 ? y0 : 8; y < y_end; y += 8) {
-        for (x = x0 ? x0 - 8 : 0; x < x_end; x += 8) {
-            const int bs0 = s->horizontal_bs[(x +     y * s->bs_width) >> 2];
-            const int bs1 = s->horizontal_bs[(x + 4 + y * s->bs_width) >> 2];
-            if (bs0 || bs1) {
-                const int qp0 = (get_qPy(s, x, y - 1)     + get_qPy(s, x, y)     + 1) >> 1;
-                const int qp1 = (get_qPy(s, x + 4, y - 1) + get_qPy(s, x + 4, y) + 1) >> 1;
-
-                tc_offset   = x >= x0 ? cur_tc_offset : left_tc_offset;
-                beta_offset = x >= x0 ? cur_beta_offset : left_beta_offset;
-
-                beta[0] = betatable[av_clip(qp0 + (beta_offset >> 1 << 1), 0, MAX_QP)];
-                beta[1] = betatable[av_clip(qp1 + (beta_offset >> 1 << 1), 0, MAX_QP)];
-                tc[0]   = bs0 ? TC_CALC(qp0, bs0) : 0;
-                tc[1]   = bs1 ? TC_CALC(qp1, bs1) : 0;
-                src     = &s->frame->data[LUMA][y * s->frame->linesize[LUMA] + (x << s->sps->pixel_shift)];
-                if (pcmf) {
-                    no_p[0] = get_pcm(s, x, y - 1);
-                    no_p[1] = get_pcm(s, x + 4, y - 1);
-                    no_q[0] = get_pcm(s, x, y);
-                    no_q[1] = get_pcm(s, x + 4, y);
-                    s->hevcdsp.hevc_h_loop_filter_luma_c(src,
-                                                         s->frame->linesize[LUMA],
-                                                         beta, tc, no_p, no_q);
-                } else
-                    s->hevcdsp.hevc_h_loop_filter_luma(src,
-                                                       s->frame->linesize[LUMA],
-                                                       beta, tc, no_p, no_q);
-            }
-        }
-    }
-
-    // horizontal filtering chroma
-    for (chroma = 1; chroma <= 2; chroma++) {
-        for (y = y0 ? y0 : 16; y < y_end; y += 16) {
-            for (x = x0 - 8; x < x_end; x += 16) {
-                int bs0, bs1;
-                // to make sure no memory access over boundary when x = -8
-                // TODO: simplify with row based deblocking
-                if (x < 0) {
-                    bs0 = 0;
-                    bs1 = s->horizontal_bs[(x + 8 + y * s->bs_width) >> 2];
-                } else if (x >= x_end - 8) {
-                    bs0 = s->horizontal_bs[(x +     y * s->bs_width) >> 2];
-                    bs1 = 0;
-                } else {
-                    bs0 = s->horizontal_bs[(x + y     * s->bs_width) >> 2];
-                    bs1 = s->horizontal_bs[(x + 8 + y * s->bs_width) >> 2];
-                }
-
-                if ((bs0 == 2) || (bs1 == 2)) {
-                    const int qp0 = bs0 == 2 ? (get_qPy(s, x,     y - 1) + get_qPy(s, x,     y) + 1) >> 1 : 0;
-                    const int qp1 = bs1 == 2 ? (get_qPy(s, x + 8, y - 1) + get_qPy(s, x + 8, y) + 1) >> 1 : 0;
-
-                    tc_offset = x >= x0 ? cur_tc_offset : left_tc_offset;
-                    c_tc[0]   = bs0 == 2 ? chroma_tc(s, qp0, chroma, tc_offset)     : 0;
-                    c_tc[1]   = bs1 == 2 ? chroma_tc(s, qp1, chroma, cur_tc_offset) : 0;
-                    src       = &s->frame->data[chroma][y / 2 * s->frame->linesize[chroma] + ((x / 2) << s->sps->pixel_shift)];
-                    if (pcmf) {
-                        no_p[0] = get_pcm(s, x, y - 1);
-                        no_p[1] = get_pcm(s, x + 8, y - 1);
-                        no_q[0] = get_pcm(s, x, y);
-                        no_q[1] = get_pcm(s, x + 8, y);
-                        s->hevcdsp.hevc_h_loop_filter_chroma_c(src,
-                                                               s->frame->linesize[chroma],
-                                                               c_tc, no_p, no_q);
-                    } else
-                        s->hevcdsp.hevc_h_loop_filter_chroma(src,
-                                                             s->frame->linesize[chroma],
-                                                             c_tc, no_p, no_q);
-                }
-            }
-        }
-    }
-}
-
-static int boundary_strength(HEVCContext *s, MvField *curr,
-                             uint8_t curr_cbf_luma, MvField *neigh,
-                             uint8_t neigh_cbf_luma,
-                             RefPicList *neigh_refPicList,
-                             int tu_border)
-{
-    int mvs = curr->pred_flag[0] + curr->pred_flag[1];
-
-    if (tu_border) {
-        if (curr->is_intra || neigh->is_intra)
-            return 2;
-        if (curr_cbf_luma || neigh_cbf_luma)
-            return 1;
-    }
-
-    if (mvs == neigh->pred_flag[0] + neigh->pred_flag[1]) {
-        if (mvs == 2) {
-            // same L0 and L1
-            if (s->ref->refPicList[0].list[curr->ref_idx[0]] == neigh_refPicList[0].list[neigh->ref_idx[0]]  &&
-                s->ref->refPicList[0].list[curr->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]] &&
-                neigh_refPicList[0].list[neigh->ref_idx[0]] == neigh_refPicList[1].list[neigh->ref_idx[1]]) {
-                if ((abs(neigh->mv[0].x - curr->mv[0].x) >= 4 || abs(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
-                     abs(neigh->mv[1].x - curr->mv[1].x) >= 4 || abs(neigh->mv[1].y - curr->mv[1].y) >= 4) &&
-                    (abs(neigh->mv[1].x - curr->mv[0].x) >= 4 || abs(neigh->mv[1].y - curr->mv[0].y) >= 4 ||
-                     abs(neigh->mv[0].x - curr->mv[1].x) >= 4 || abs(neigh->mv[0].y - curr->mv[1].y) >= 4))
-                    return 1;
-                else
-                    return 0;
-            } else if (neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&
-                       neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) {
-                if (abs(neigh->mv[0].x - curr->mv[0].x) >= 4 || abs(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
-                    abs(neigh->mv[1].x - curr->mv[1].x) >= 4 || abs(neigh->mv[1].y - curr->mv[1].y) >= 4)
-                    return 1;
-                else
-                    return 0;
-            } else if (neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&
-                       neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) {
-                if (abs(neigh->mv[1].x - curr->mv[0].x) >= 4 || abs(neigh->mv[1].y - curr->mv[0].y) >= 4 ||
-                    abs(neigh->mv[0].x - curr->mv[1].x) >= 4 || abs(neigh->mv[0].y - curr->mv[1].y) >= 4)
-                    return 1;
-                else
-                    return 0;
-            } else {
-                return 1;
-            }
-        } else { // 1 MV
-            Mv A, B;
-            int ref_A, ref_B;
-
-            if (curr->pred_flag[0]) {
-                A     = curr->mv[0];
-                ref_A = s->ref->refPicList[0].list[curr->ref_idx[0]];
-            } else {
-                A     = curr->mv[1];
-                ref_A = s->ref->refPicList[1].list[curr->ref_idx[1]];
-            }
-
-            if (neigh->pred_flag[0]) {
-                B     = neigh->mv[0];
-                ref_B = neigh_refPicList[0].list[neigh->ref_idx[0]];
-            } else {
-                B     = neigh->mv[1];
-                ref_B = neigh_refPicList[1].list[neigh->ref_idx[1]];
-            }
-
-            if (ref_A == ref_B) {
-                if (abs(A.x - B.x) >= 4 || abs(A.y - B.y) >= 4)
-                    return 1;
-                else
-                    return 0;
-            } else
-                return 1;
-        }
-    }
-
-    return 1;
-}
-
-void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
-                                           int log2_trafo_size,
-                                           int slice_or_tiles_up_boundary,
-                                           int slice_or_tiles_left_boundary)
-{
-    MvField *tab_mvf     = s->ref->tab_mvf;
-    int log2_min_pu_size = s->sps->log2_min_pu_size;
-    int log2_min_tu_size = s->sps->log2_min_tb_size;
-    int min_pu_width     = s->sps->min_pu_width;
-    int min_tu_width     = s->sps->min_tb_width;
-    int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width +
-                           (x0 >> log2_min_pu_size)].is_intra;
-    int i, j, bs;
-
-    if (y0 > 0 && (y0 & 7) == 0) {
-        int yp_pu = (y0 - 1) >> log2_min_pu_size;
-        int yq_pu =  y0      >> log2_min_pu_size;
-        int yp_tu = (y0 - 1) >> log2_min_tu_size;
-        int yq_tu =  y0      >> log2_min_tu_size;
-
-        for (i = 0; i < (1 << log2_trafo_size); i += 4) {
-            int x_pu = (x0 + i) >> log2_min_pu_size;
-            int x_tu = (x0 + i) >> log2_min_tu_size;
-            MvField *top  = &tab_mvf[yp_pu * min_pu_width + x_pu];
-            MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu];
-            uint8_t top_cbf_luma  = s->cbf_luma[yp_tu * min_tu_width + x_tu];
-            uint8_t curr_cbf_luma = s->cbf_luma[yq_tu * min_tu_width + x_tu];
-            RefPicList *top_refPicList = ff_hevc_get_ref_list(s, s->ref,
-                                                              x0 + i, y0 - 1);
-
-            bs = boundary_strength(s, curr, curr_cbf_luma,
-                                   top, top_cbf_luma, top_refPicList, 1);
-            if (!s->sh.slice_loop_filter_across_slices_enabled_flag &&
-                (slice_or_tiles_up_boundary & 1) &&
-                (y0 % (1 << s->sps->log2_ctb_size)) == 0)
-                bs = 0;
-            else if (!s->pps->loop_filter_across_tiles_enabled_flag &&
-                     (slice_or_tiles_up_boundary & 2) &&
-                     (y0 % (1 << s->sps->log2_ctb_size)) == 0)
-                bs = 0;
-            if (y0 == 0 || s->sh.disable_deblocking_filter_flag == 1)
-                bs = 0;
-            if (bs)
-                s->horizontal_bs[((x0 + i) + y0 * s->bs_width) >> 2] = bs;
-        }
-    }
-
-    // bs for TU internal horizontal PU boundaries
-    if (log2_trafo_size > s->sps->log2_min_pu_size && !is_intra)
-        for (j = 8; j < (1 << log2_trafo_size); j += 8) {
-            int yp_pu = (y0 + j - 1) >> log2_min_pu_size;
-            int yq_pu = (y0 + j)     >> log2_min_pu_size;
-            int yp_tu = (y0 + j - 1) >> log2_min_tu_size;
-            int yq_tu = (y0 + j)     >> log2_min_tu_size;
-
-            for (i = 0; i < (1 << log2_trafo_size); i += 4) {
-                int x_pu = (x0 + i) >> log2_min_pu_size;
-                int x_tu = (x0 + i) >> log2_min_tu_size;
-                MvField *top  = &tab_mvf[yp_pu * min_pu_width + x_pu];
-                MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu];
-                uint8_t top_cbf_luma  = s->cbf_luma[yp_tu * min_tu_width + x_tu];
-                uint8_t curr_cbf_luma = s->cbf_luma[yq_tu * min_tu_width + x_tu];
-                RefPicList *top_refPicList = ff_hevc_get_ref_list(s, s->ref,
-                                                                  x0 + i,
-                                                                  y0 + j - 1);
-
-                bs = boundary_strength(s, curr, curr_cbf_luma,
-                                       top, top_cbf_luma, top_refPicList, 0);
-                if (s->sh.disable_deblocking_filter_flag == 1)
-                    bs = 0;
-                if (bs)
-                    s->horizontal_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs;
-            }
-        }
-
-    // bs for vertical TU boundaries
-    if (x0 > 0 && (x0 & 7) == 0) {
-        int xp_pu = (x0 - 1) >> log2_min_pu_size;
-        int xq_pu =  x0      >> log2_min_pu_size;
-        int xp_tu = (x0 - 1) >> log2_min_tu_size;
-        int xq_tu =  x0      >> log2_min_tu_size;
-
-        for (i = 0; i < (1 << log2_trafo_size); i += 4) {
-            int y_pu      = (y0 + i) >> log2_min_pu_size;
-            int y_tu      = (y0 + i) >> log2_min_tu_size;
-            MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu];
-            MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu];
-
-            uint8_t left_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xp_tu];
-            uint8_t curr_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xq_tu];
-            RefPicList *left_refPicList = ff_hevc_get_ref_list(s, s->ref,
-                                                               x0 - 1, y0 + i);
-
-            bs = boundary_strength(s, curr, curr_cbf_luma,
-                                   left, left_cbf_luma, left_refPicList, 1);
-            if (!s->sh.slice_loop_filter_across_slices_enabled_flag &&
-                (slice_or_tiles_left_boundary & 1) &&
-                (x0 % (1 << s->sps->log2_ctb_size)) == 0)
-                bs = 0;
-            else if (!s->pps->loop_filter_across_tiles_enabled_flag &&
-                     (slice_or_tiles_left_boundary & 2) &&
-                     (x0 % (1 << s->sps->log2_ctb_size)) == 0)
-                bs = 0;
-            if (x0 == 0 || s->sh.disable_deblocking_filter_flag == 1)
-                bs = 0;
-            if (bs)
-                s->vertical_bs[(x0 >> 3) + ((y0 + i) >> 2) * s->bs_width] = bs;
-        }
-    }
-
-    // bs for TU internal vertical PU boundaries
-    if (log2_trafo_size > log2_min_pu_size && !is_intra)
-        for (j = 0; j < (1 << log2_trafo_size); j += 4) {
-            int y_pu = (y0 + j) >> log2_min_pu_size;
-            int y_tu = (y0 + j) >> log2_min_tu_size;
-
-            for (i = 8; i < (1 << log2_trafo_size); i += 8) {
-                int xp_pu = (x0 + i - 1) >> log2_min_pu_size;
-                int xq_pu = (x0 + i)     >> log2_min_pu_size;
-                int xp_tu = (x0 + i - 1) >> log2_min_tu_size;
-                int xq_tu = (x0 + i)     >> log2_min_tu_size;
-                MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu];
-                MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu];
-                uint8_t left_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xp_tu];
-                uint8_t curr_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xq_tu];
-                RefPicList *left_refPicList = ff_hevc_get_ref_list(s, s->ref,
-                                                                   x0 + i - 1,
-                                                                   y0 + j);
-
-                bs = boundary_strength(s, curr, curr_cbf_luma,
-                                       left, left_cbf_luma, left_refPicList, 0);
-                if (s->sh.disable_deblocking_filter_flag == 1)
-                    bs = 0;
-                if (bs)
-                    s->vertical_bs[((x0 + i) >> 3) + ((y0 + j) >> 2) * s->bs_width] = bs;
-            }
-        }
-}
-
-#undef LUMA
-#undef CB
-#undef CR
-
-void ff_hevc_hls_filter(HEVCContext *s, int x, int y)
-{
-    deblocking_filter_CTB(s, x, y);
-    if (s->sps->sao_enabled)
-        sao_filter_CTB(s, x, y);
-}
-
-void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size)
-{
-    if (y_ctb && x_ctb)
-        ff_hevc_hls_filter(s, x_ctb - ctb_size, y_ctb - ctb_size);
-    if (y_ctb && x_ctb >= s->sps->width - ctb_size) {
-        ff_hevc_hls_filter(s, x_ctb, y_ctb - ctb_size);
-        ff_thread_report_progress(&s->ref->tf, y_ctb - ctb_size, 0);
-    }
-    if (x_ctb && y_ctb >= s->sps->height - ctb_size)
-        ff_hevc_hls_filter(s, x_ctb - ctb_size, y_ctb);
-}
diff --git a/deps/libav/libavcodec/hevc_mvs.c b/deps/libav/libavcodec/hevc_mvs.c
deleted file mode 100644
index 2fe4dbb..0000000
--- a/deps/libav/libavcodec/hevc_mvs.c
+++ /dev/null
@@ -1,820 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- * Copyright (C) 2013 Anand Meher Kotra
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "hevc.h"
-
-static const uint8_t l0_l1_cand_idx[12][2] = {
-    { 0, 1, },
-    { 1, 0, },
-    { 0, 2, },
-    { 2, 0, },
-    { 1, 2, },
-    { 2, 1, },
-    { 0, 3, },
-    { 3, 0, },
-    { 1, 3, },
-    { 3, 1, },
-    { 2, 3, },
-    { 3, 2, },
-};
-
-void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0,
-                                     int nPbW, int nPbH)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    int x0b = x0 & ((1 << s->sps->log2_ctb_size) - 1);
-    int y0b = y0 & ((1 << s->sps->log2_ctb_size) - 1);
-
-    lc->na.cand_up       = (lc->ctb_up_flag   || y0b);
-    lc->na.cand_left     = (lc->ctb_left_flag || x0b);
-    lc->na.cand_up_left  = (!x0b && !y0b) ? lc->ctb_up_left_flag : lc->na.cand_left && lc->na.cand_up;
-    lc->na.cand_up_right_sap =
-            ((x0b + nPbW) == (1 << s->sps->log2_ctb_size)) ?
-                    lc->ctb_up_right_flag && !y0b : lc->na.cand_up;
-    lc->na.cand_up_right =
-            ((x0b + nPbW) == (1 << s->sps->log2_ctb_size) ?
-                    lc->ctb_up_right_flag && !y0b : lc->na.cand_up )
-                     && (x0 + nPbW) < lc->end_of_tiles_x;
-    lc->na.cand_bottom_left = ((y0 + nPbH) >= lc->end_of_tiles_y) ? 0 : lc->na.cand_left;
-}
-
-/*
- * 6.4.1 Derivation process for z-scan order block availability
- */
-static int z_scan_block_avail(HEVCContext *s, int xCurr, int yCurr,
-                              int xN, int yN)
-{
-#define MIN_TB_ADDR_ZS(x, y)                                            \
-    s->pps->min_tb_addr_zs[(y) * s->sps->min_tb_width + (x)]
-    int Curr = MIN_TB_ADDR_ZS(xCurr >> s->sps->log2_min_tb_size,
-                              yCurr >> s->sps->log2_min_tb_size);
-    int N;
-
-    if (xN < 0 || yN < 0 ||
-        xN >= s->sps->width ||
-        yN >= s->sps->height)
-        return 0;
-
-    N = MIN_TB_ADDR_ZS(xN >> s->sps->log2_min_tb_size,
-                       yN >> s->sps->log2_min_tb_size);
-
-    return N <= Curr;
-}
-
-static int same_prediction_block(HEVCLocalContext *lc, int log2_cb_size,
-                                 int x0, int y0, int nPbW, int nPbH,
-                                 int xA1, int yA1, int partIdx)
-{
-    return !(nPbW << 1 == 1 << log2_cb_size &&
-             nPbH << 1 == 1 << log2_cb_size && partIdx == 1 &&
-             lc->cu.x + nPbW > xA1 &&
-             lc->cu.y + nPbH <= yA1);
-}
-
-/*
- * 6.4.2 Derivation process for prediction block availability
- */
-static int check_prediction_block_available(HEVCContext *s, int log2_cb_size,
-                                            int x0, int y0, int nPbW, int nPbH,
-                                            int xA1, int yA1, int partIdx)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-
-    if (lc->cu.x < xA1 && lc->cu.y < yA1 &&
-        (lc->cu.x + (1 << log2_cb_size)) > xA1 &&
-        (lc->cu.y + (1 << log2_cb_size)) > yA1)
-        return same_prediction_block(lc, log2_cb_size, x0, y0,
-                                     nPbW, nPbH, xA1, yA1, partIdx);
-    else
-        return z_scan_block_avail(s, x0, y0, xA1, yA1);
-}
-
-//check if the two luma locations belong to the same mostion estimation region
-static int isDiffMER(HEVCContext *s, int xN, int yN, int xP, int yP)
-{
-    uint8_t plevel = s->pps->log2_parallel_merge_level;
-
-    return xN >> plevel == xP >> plevel &&
-           yN >> plevel == yP >> plevel;
-}
-
-#define MATCH(x) (A.x == B.x)
-
-// check if the mv's and refidx are the same between A and B
-static int compareMVrefidx(struct MvField A, struct MvField B)
-{
-    if (A.pred_flag[0] && A.pred_flag[1] && B.pred_flag[0] && B.pred_flag[1])
-        return MATCH(ref_idx[0]) && MATCH(mv[0].x) && MATCH(mv[0].y) &&
-               MATCH(ref_idx[1]) && MATCH(mv[1].x) && MATCH(mv[1].y);
-
-    if (A.pred_flag[0] && !A.pred_flag[1] && B.pred_flag[0] && !B.pred_flag[1])
-        return MATCH(ref_idx[0]) && MATCH(mv[0].x) && MATCH(mv[0].y);
-
-    if (!A.pred_flag[0] && A.pred_flag[1] && !B.pred_flag[0] && B.pred_flag[1])
-        return MATCH(ref_idx[1]) && MATCH(mv[1].x) && MATCH(mv[1].y);
-
-    return 0;
-}
-
-static av_always_inline void mv_scale(Mv *dst, Mv *src, int td, int tb)
-{
-    int tx, scale_factor;
-
-    td = av_clip_int8_c(td);
-    tb = av_clip_int8_c(tb);
-    tx = (0x4000 + abs(td / 2)) / td;
-    scale_factor = av_clip_c((tb * tx + 32) >> 6, -4096, 4095);
-    dst->x = av_clip_int16_c((scale_factor * src->x + 127 +
-                             (scale_factor * src->x < 0)) >> 8);
-    dst->y = av_clip_int16_c((scale_factor * src->y + 127 +
-                             (scale_factor * src->y < 0)) >> 8);
-}
-
-static int check_mvset(Mv *mvLXCol, Mv *mvCol,
-                       int colPic, int poc,
-                       RefPicList *refPicList, int X, int refIdxLx,
-                       RefPicList *refPicList_col, int listCol, int refidxCol)
-{
-    int cur_lt = refPicList[X].isLongTerm[refIdxLx];
-    int col_lt = refPicList_col[listCol].isLongTerm[refidxCol];
-    int col_poc_diff, cur_poc_diff;
-
-    if (cur_lt != col_lt) {
-        mvLXCol->x = 0;
-        mvLXCol->y = 0;
-        return 0;
-    }
-
-    col_poc_diff = colPic - refPicList_col[listCol].list[refidxCol];
-    cur_poc_diff = poc    - refPicList[X].list[refIdxLx];
-
-    if (!col_poc_diff)
-        col_poc_diff = 1;  // error resilience
-
-    if (cur_lt || col_poc_diff == cur_poc_diff) {
-        mvLXCol->x = mvCol->x;
-        mvLXCol->y = mvCol->y;
-    } else {
-        mv_scale(mvLXCol, mvCol, col_poc_diff, cur_poc_diff);
-    }
-    return 1;
-}
-
-#define CHECK_MVSET(l)                                          \
-    check_mvset(mvLXCol, temp_col.mv + l,                       \
-                colPic, s->poc,                                 \
-                refPicList, X, refIdxLx,                        \
-                refPicList_col, L ## l, temp_col.ref_idx[l])
-
-// derive the motion vectors section 8.5.3.1.8
-static int derive_temporal_colocated_mvs(HEVCContext *s, MvField temp_col,
-                                         int refIdxLx, Mv *mvLXCol, int X,
-                                         int colPic, RefPicList *refPicList_col)
-{
-    RefPicList *refPicList = s->ref->refPicList;
-
-    if (temp_col.is_intra) {
-        mvLXCol->x = 0;
-        mvLXCol->y = 0;
-        return 0;
-    }
-
-    if (temp_col.pred_flag[0] == 0)
-        return CHECK_MVSET(1);
-    else if (temp_col.pred_flag[0] == 1 && temp_col.pred_flag[1] == 0)
-        return CHECK_MVSET(0);
-    else if (temp_col.pred_flag[0] == 1 && temp_col.pred_flag[1] == 1) {
-        int check_diffpicount = 0;
-        int i = 0;
-        for (i = 0; i < refPicList[0].nb_refs; i++) {
-            if (refPicList[0].list[i] > s->poc)
-                check_diffpicount++;
-        }
-        for (i = 0; i < refPicList[1].nb_refs; i++) {
-            if (refPicList[1].list[i] > s->poc)
-                check_diffpicount++;
-        }
-        if (check_diffpicount == 0 && X == 0)
-            return CHECK_MVSET(0);
-        else if (check_diffpicount == 0 && X == 1)
-            return CHECK_MVSET(1);
-        else {
-            if (s->sh.collocated_list == L1)
-                return CHECK_MVSET(0);
-            else
-                return CHECK_MVSET(1);
-        }
-    }
-
-    return 0;
-}
-
-#define TAB_MVF(x, y)                                                   \
-    tab_mvf[(y) * min_pu_width + x]
-
-#define TAB_MVF_PU(v)                                                   \
-    TAB_MVF(x ## v ## _pu, y ## v ## _pu)
-
-#define DERIVE_TEMPORAL_COLOCATED_MVS                                   \
-    derive_temporal_colocated_mvs(s, temp_col,                          \
-                                  refIdxLx, mvLXCol, X, colPic,         \
-                                  ff_hevc_get_ref_list(s, ref, x, y))
-
-/*
- * 8.5.3.1.7  temporal luma motion vector prediction
- */
-static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
-                                       int nPbW, int nPbH, int refIdxLx,
-                                       Mv *mvLXCol, int X)
-{
-    MvField *tab_mvf;
-    MvField temp_col;
-    int x, y, x_pu, y_pu;
-    int min_pu_width = s->sps->min_pu_width;
-    int availableFlagLXCol = 0;
-    int colPic;
-
-    HEVCFrame *ref = s->ref->collocated_ref;
-
-    if (!ref)
-        return 0;
-
-    tab_mvf = ref->tab_mvf;
-    colPic  = ref->poc;
-
-    //bottom right collocated motion vector
-    x = x0 + nPbW;
-    y = y0 + nPbH;
-
-    ff_thread_await_progress(&ref->tf, y, 0);
-    if (tab_mvf &&
-        (y0 >> s->sps->log2_ctb_size) == (y >> s->sps->log2_ctb_size) &&
-        y < s->sps->height &&
-        x < s->sps->width) {
-        x                  = ((x >> 4) << 4);
-        y                  = ((y >> 4) << 4);
-        x_pu               = x >> s->sps->log2_min_pu_size;
-        y_pu               = y >> s->sps->log2_min_pu_size;
-        temp_col           = TAB_MVF(x_pu, y_pu);
-        availableFlagLXCol = DERIVE_TEMPORAL_COLOCATED_MVS;
-    }
-
-    // derive center collocated motion vector
-    if (tab_mvf && !availableFlagLXCol) {
-        x                  = x0 + (nPbW >> 1);
-        y                  = y0 + (nPbH >> 1);
-        x                  = ((x >> 4) << 4);
-        y                  = ((y >> 4) << 4);
-        x_pu               = x >> s->sps->log2_min_pu_size;
-        y_pu               = y >> s->sps->log2_min_pu_size;
-        temp_col           = TAB_MVF(x_pu, y_pu);
-        availableFlagLXCol = DERIVE_TEMPORAL_COLOCATED_MVS;
-    }
-    return availableFlagLXCol;
-}
-
-#define AVAILABLE(cand, v)                                      \
-    (cand && !TAB_MVF_PU(v).is_intra)
-
-#define PRED_BLOCK_AVAILABLE(v)                                 \
-    check_prediction_block_available(s, log2_cb_size,           \
-                                     x0, y0, nPbW, nPbH,        \
-                                     x ## v, y ## v, part_idx)
-
-#define COMPARE_MV_REFIDX(a, b)                                 \
-    compareMVrefidx(TAB_MVF_PU(a), TAB_MVF_PU(b))
-
-/*
- * 8.5.3.1.2  Derivation process for spatial merging candidates
- */
-static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0,
-                                            int nPbW, int nPbH,
-                                            int log2_cb_size,
-                                            int singleMCLFlag, int part_idx,
-                                            struct MvField mergecandlist[])
-{
-    HEVCLocalContext *lc   = &s->HEVClc;
-    RefPicList *refPicList = s->ref->refPicList;
-    MvField *tab_mvf       = s->ref->tab_mvf;
-
-    const int min_pu_width = s->sps->min_pu_width;
-
-    const int cand_bottom_left = lc->na.cand_bottom_left;
-    const int cand_left        = lc->na.cand_left;
-    const int cand_up_left     = lc->na.cand_up_left;
-    const int cand_up          = lc->na.cand_up;
-    const int cand_up_right    = lc->na.cand_up_right_sap;
-
-    const int xA1    = x0 - 1;
-    const int yA1    = y0 + nPbH - 1;
-    const int xA1_pu = xA1 >> s->sps->log2_min_pu_size;
-    const int yA1_pu = yA1 >> s->sps->log2_min_pu_size;
-
-    const int xB1    = x0 + nPbW - 1;
-    const int yB1    = y0 - 1;
-    const int xB1_pu = xB1 >> s->sps->log2_min_pu_size;
-    const int yB1_pu = yB1 >> s->sps->log2_min_pu_size;
-
-    const int xB0    = x0 + nPbW;
-    const int yB0    = y0 - 1;
-    const int xB0_pu = xB0 >> s->sps->log2_min_pu_size;
-    const int yB0_pu = yB0 >> s->sps->log2_min_pu_size;
-
-    const int xA0    = x0 - 1;
-    const int yA0    = y0 + nPbH;
-    const int xA0_pu = xA0 >> s->sps->log2_min_pu_size;
-    const int yA0_pu = yA0 >> s->sps->log2_min_pu_size;
-
-    const int xB2    = x0 - 1;
-    const int yB2    = y0 - 1;
-    const int xB2_pu = xB2 >> s->sps->log2_min_pu_size;
-    const int yB2_pu = yB2 >> s->sps->log2_min_pu_size;
-
-    const int nb_refs = (s->sh.slice_type == P_SLICE) ?
-                        s->sh.nb_refs[0] : FFMIN(s->sh.nb_refs[0], s->sh.nb_refs[1]);
-    int check_MER   = 1;
-    int check_MER_1 = 1;
-
-    int zero_idx = 0;
-
-    int nb_merge_cand = 0;
-    int nb_orig_merge_cand = 0;
-
-    int is_available_a0;
-    int is_available_a1;
-    int is_available_b0;
-    int is_available_b1;
-    int is_available_b2;
-    int check_B0;
-    int check_A0;
-
-    //first left spatial merge candidate
-    is_available_a1 = AVAILABLE(cand_left, A1);
-
-    if (!singleMCLFlag && part_idx == 1 &&
-        (lc->cu.part_mode == PART_Nx2N ||
-         lc->cu.part_mode == PART_nLx2N ||
-         lc->cu.part_mode == PART_nRx2N) ||
-        isDiffMER(s, xA1, yA1, x0, y0)) {
-        is_available_a1 = 0;
-    }
-
-    if (is_available_a1)
-        mergecandlist[nb_merge_cand++] = TAB_MVF_PU(A1);
-
-    // above spatial merge candidate
-    is_available_b1 = AVAILABLE(cand_up, B1);
-
-    if (!singleMCLFlag && part_idx == 1 &&
-        (lc->cu.part_mode == PART_2NxN ||
-         lc->cu.part_mode == PART_2NxnU ||
-         lc->cu.part_mode == PART_2NxnD) ||
-        isDiffMER(s, xB1, yB1, x0, y0)) {
-        is_available_b1 = 0;
-    }
-
-    if (is_available_a1 && is_available_b1)
-        check_MER = !COMPARE_MV_REFIDX(B1, A1);
-
-    if (is_available_b1 && check_MER)
-        mergecandlist[nb_merge_cand++] = TAB_MVF_PU(B1);
-
-    // above right spatial merge candidate
-    check_MER = 1;
-    check_B0  = PRED_BLOCK_AVAILABLE(B0);
-
-    is_available_b0 = check_B0 && AVAILABLE(cand_up_right, B0);
-
-    if (isDiffMER(s, xB0, yB0, x0, y0))
-        is_available_b0 = 0;
-
-    if (is_available_b1 && is_available_b0)
-        check_MER = !COMPARE_MV_REFIDX(B0, B1);
-
-    if (is_available_b0 && check_MER)
-        mergecandlist[nb_merge_cand++] = TAB_MVF_PU(B0);
-
-    // left bottom spatial merge candidate
-    check_MER = 1;
-    check_A0  = PRED_BLOCK_AVAILABLE(A0);
-
-    is_available_a0 = check_A0 && AVAILABLE(cand_bottom_left, A0);
-
-    if (isDiffMER(s, xA0, yA0, x0, y0))
-        is_available_a0 = 0;
-
-    if (is_available_a1 && is_available_a0)
-        check_MER = !COMPARE_MV_REFIDX(A0, A1);
-
-    if (is_available_a0 && check_MER)
-        mergecandlist[nb_merge_cand++] = TAB_MVF_PU(A0);
-
-    // above left spatial merge candidate
-    check_MER = 1;
-
-    is_available_b2 = AVAILABLE(cand_up_left, B2);
-
-    if (isDiffMER(s, xB2, yB2, x0, y0))
-        is_available_b2 = 0;
-
-    if (is_available_a1 && is_available_b2)
-        check_MER = !COMPARE_MV_REFIDX(B2, A1);
-
-    if (is_available_b1 && is_available_b2)
-        check_MER_1 = !COMPARE_MV_REFIDX(B2, B1);
-
-    if (is_available_b2 && check_MER && check_MER_1 && nb_merge_cand != 4)
-        mergecandlist[nb_merge_cand++] = TAB_MVF_PU(B2);
-
-    // temporal motion vector candidate
-    if (s->sh.slice_temporal_mvp_enabled_flag &&
-        nb_merge_cand < s->sh.max_num_merge_cand) {
-        Mv mv_l0_col, mv_l1_col;
-        int available_l0 = temporal_luma_motion_vector(s, x0, y0, nPbW, nPbH,
-                                                       0, &mv_l0_col, 0);
-        int available_l1 = (s->sh.slice_type == B_SLICE) ?
-                           temporal_luma_motion_vector(s, x0, y0, nPbW, nPbH,
-                                                       0, &mv_l1_col, 1) : 0;
-
-        if (available_l0 || available_l1) {
-            mergecandlist[nb_merge_cand].is_intra     = 0;
-            mergecandlist[nb_merge_cand].pred_flag[0] = available_l0;
-            mergecandlist[nb_merge_cand].pred_flag[1] = available_l1;
-            if (available_l0) {
-                mergecandlist[nb_merge_cand].mv[0]      = mv_l0_col;
-                mergecandlist[nb_merge_cand].ref_idx[0] = 0;
-            }
-            if (available_l1) {
-                mergecandlist[nb_merge_cand].mv[1]      = mv_l1_col;
-                mergecandlist[nb_merge_cand].ref_idx[1] = 0;
-            }
-            nb_merge_cand++;
-        }
-    }
-
-    nb_orig_merge_cand = nb_merge_cand;
-
-    // combined bi-predictive merge candidates  (applies for B slices)
-    if (s->sh.slice_type == B_SLICE && nb_orig_merge_cand > 1 &&
-        nb_orig_merge_cand < s->sh.max_num_merge_cand) {
-        int comb_idx;
-
-        for (comb_idx = 0; nb_merge_cand < s->sh.max_num_merge_cand &&
-                           comb_idx < nb_orig_merge_cand * (nb_orig_merge_cand - 1); comb_idx++) {
-            int l0_cand_idx = l0_l1_cand_idx[comb_idx][0];
-            int l1_cand_idx = l0_l1_cand_idx[comb_idx][1];
-            MvField l0_cand = mergecandlist[l0_cand_idx];
-            MvField l1_cand = mergecandlist[l1_cand_idx];
-
-            if (l0_cand.pred_flag[0] && l1_cand.pred_flag[1] &&
-                (refPicList[0].list[l0_cand.ref_idx[0]] !=
-                 refPicList[1].list[l1_cand.ref_idx[1]] ||
-                 l0_cand.mv[0].x != l1_cand.mv[1].x ||
-                 l0_cand.mv[0].y != l1_cand.mv[1].y)) {
-                mergecandlist[nb_merge_cand].ref_idx[0]   = l0_cand.ref_idx[0];
-                mergecandlist[nb_merge_cand].ref_idx[1]   = l1_cand.ref_idx[1];
-                mergecandlist[nb_merge_cand].pred_flag[0] = 1;
-                mergecandlist[nb_merge_cand].pred_flag[1] = 1;
-                mergecandlist[nb_merge_cand].mv[0].x      = l0_cand.mv[0].x;
-                mergecandlist[nb_merge_cand].mv[0].y      = l0_cand.mv[0].y;
-                mergecandlist[nb_merge_cand].mv[1].x      = l1_cand.mv[1].x;
-                mergecandlist[nb_merge_cand].mv[1].y      = l1_cand.mv[1].y;
-                mergecandlist[nb_merge_cand].is_intra     = 0;
-                nb_merge_cand++;
-            }
-        }
-    }
-
-    // append Zero motion vector candidates
-    while (nb_merge_cand < s->sh.max_num_merge_cand) {
-        mergecandlist[nb_merge_cand].pred_flag[0] = 1;
-        mergecandlist[nb_merge_cand].pred_flag[1] = s->sh.slice_type == B_SLICE;
-        mergecandlist[nb_merge_cand].mv[0].x      = 0;
-        mergecandlist[nb_merge_cand].mv[0].y      = 0;
-        mergecandlist[nb_merge_cand].mv[1].x      = 0;
-        mergecandlist[nb_merge_cand].mv[1].y      = 0;
-        mergecandlist[nb_merge_cand].is_intra     = 0;
-        mergecandlist[nb_merge_cand].ref_idx[0]   = zero_idx < nb_refs ? zero_idx : 0;
-        mergecandlist[nb_merge_cand].ref_idx[1]   = zero_idx < nb_refs ? zero_idx : 0;
-
-        nb_merge_cand++;
-        zero_idx++;
-    }
-}
-
-/*
- * 8.5.3.1.1 Derivation process of luma Mvs for merge mode
- */
-void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW,
-                                int nPbH, int log2_cb_size, int part_idx,
-                                int merge_idx, MvField *mv)
-{
-    int singleMCLFlag = 0;
-    int nCS = 1 << log2_cb_size;
-    struct MvField mergecand_list[MRG_MAX_NUM_CANDS] = { { { { 0 } } } };
-    int nPbW2 = nPbW;
-    int nPbH2 = nPbH;
-    HEVCLocalContext *lc = &s->HEVClc;
-
-    if (s->pps->log2_parallel_merge_level > 2 && nCS == 8) {
-        singleMCLFlag = 1;
-        x0            = lc->cu.x;
-        y0            = lc->cu.y;
-        nPbW          = nCS;
-        nPbH          = nCS;
-        part_idx      = 0;
-    }
-
-    ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);
-    derive_spatial_merge_candidates(s, x0, y0, nPbW, nPbH, log2_cb_size,
-                                    singleMCLFlag, part_idx, mergecand_list);
-
-    if (mergecand_list[merge_idx].pred_flag[0] == 1 &&
-        mergecand_list[merge_idx].pred_flag[1] == 1 &&
-        (nPbW2 + nPbH2) == 12) {
-        mergecand_list[merge_idx].ref_idx[1]   = -1;
-        mergecand_list[merge_idx].pred_flag[1] = 0;
-    }
-
-    *mv = mergecand_list[merge_idx];
-}
-
-static av_always_inline void dist_scale(HEVCContext *s, Mv *mv,
-                                        int min_pu_width, int x, int y,
-                                        int elist, int ref_idx_curr, int ref_idx)
-{
-    RefPicList *refPicList = s->ref->refPicList;
-    MvField *tab_mvf       = s->ref->tab_mvf;
-    int ref_pic_elist      = refPicList[elist].list[TAB_MVF(x, y).ref_idx[elist]];
-    int ref_pic_curr       = refPicList[ref_idx_curr].list[ref_idx];
-
-    if (ref_pic_elist != ref_pic_curr) {
-        int poc_diff = s->poc - ref_pic_elist;
-        if (!poc_diff)
-            poc_diff = 1;
-        mv_scale(mv, mv, poc_diff, s->poc - ref_pic_curr);
-    }
-}
-
-static int mv_mp_mode_mx(HEVCContext *s, int x, int y, int pred_flag_index,
-                         Mv *mv, int ref_idx_curr, int ref_idx)
-{
-    MvField *tab_mvf = s->ref->tab_mvf;
-    int min_pu_width = s->sps->min_pu_width;
-
-    RefPicList *refPicList = s->ref->refPicList;
-
-    if (TAB_MVF(x, y).pred_flag[pred_flag_index] == 1 &&
-        refPicList[pred_flag_index].list[TAB_MVF(x, y).ref_idx[pred_flag_index]] == refPicList[ref_idx_curr].list[ref_idx]) {
-        *mv = TAB_MVF(x, y).mv[pred_flag_index];
-        return 1;
-    }
-    return 0;
-}
-
-static int mv_mp_mode_mx_lt(HEVCContext *s, int x, int y, int pred_flag_index,
-                            Mv *mv, int ref_idx_curr, int ref_idx)
-{
-    MvField *tab_mvf = s->ref->tab_mvf;
-    int min_pu_width = s->sps->min_pu_width;
-
-    RefPicList *refPicList = s->ref->refPicList;
-    int currIsLongTerm     = refPicList[ref_idx_curr].isLongTerm[ref_idx];
-
-    int colIsLongTerm =
-        refPicList[pred_flag_index].isLongTerm[(TAB_MVF(x, y).ref_idx[pred_flag_index])];
-
-    if (TAB_MVF(x, y).pred_flag[pred_flag_index] &&
-        colIsLongTerm == currIsLongTerm) {
-        *mv = TAB_MVF(x, y).mv[pred_flag_index];
-        if (!currIsLongTerm)
-            dist_scale(s, mv, min_pu_width, x, y,
-                       pred_flag_index, ref_idx_curr, ref_idx);
-        return 1;
-    }
-    return 0;
-}
-
-#define MP_MX(v, pred, mx)                                      \
-    mv_mp_mode_mx(s, x ## v ## _pu, y ## v ## _pu, pred,        \
-                  &mx, ref_idx_curr, ref_idx)
-
-#define MP_MX_LT(v, pred, mx)                                   \
-    mv_mp_mode_mx_lt(s, x ## v ## _pu, y ## v ## _pu, pred,     \
-                     &mx, ref_idx_curr, ref_idx)
-
-void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,
-                              int nPbH, int log2_cb_size, int part_idx,
-                              int merge_idx, MvField *mv,
-                              int mvp_lx_flag, int LX)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    MvField *tab_mvf = s->ref->tab_mvf;
-    int isScaledFlag_L0 = 0;
-    int availableFlagLXA0 = 0;
-    int availableFlagLXB0 = 0;
-    int numMVPCandLX = 0;
-    int min_pu_width = s->sps->min_pu_width;
-
-    int xA0, yA0;
-    int xA0_pu, yA0_pu;
-    int is_available_a0;
-
-    int xA1, yA1;
-    int xA1_pu, yA1_pu;
-    int is_available_a1;
-
-    int xB0, yB0;
-    int xB0_pu, yB0_pu;
-    int is_available_b0;
-
-    int xB1, yB1;
-    int xB1_pu = 0, yB1_pu = 0;
-    int is_available_b1 = 0;
-
-    int xB2, yB2;
-    int xB2_pu = 0, yB2_pu = 0;
-    int is_available_b2 = 0;
-    Mv mvpcand_list[2] = { { 0 } };
-    Mv mxA = { 0 };
-    Mv mxB = { 0 };
-    int ref_idx_curr = 0;
-    int ref_idx = 0;
-    int pred_flag_index_l0;
-    int pred_flag_index_l1;
-    int x0b = x0 & ((1 << s->sps->log2_ctb_size) - 1);
-    int y0b = y0 & ((1 << s->sps->log2_ctb_size) - 1);
-
-    int cand_up = (lc->ctb_up_flag || y0b);
-    int cand_left = (lc->ctb_left_flag || x0b);
-    int cand_up_left =
-            (!x0b && !y0b) ? lc->ctb_up_left_flag : cand_left && cand_up;
-    int cand_up_right =
-            (x0b + nPbW == (1 << s->sps->log2_ctb_size) ||
-             x0  + nPbW >= lc->end_of_tiles_x) ? lc->ctb_up_right_flag && !y0b
-                                               : cand_up;
-    int cand_bottom_left = (y0 + nPbH >= lc->end_of_tiles_y) ? 0 : cand_left;
-
-    ref_idx_curr       = LX;
-    ref_idx            = mv->ref_idx[LX];
-    pred_flag_index_l0 = LX;
-    pred_flag_index_l1 = !LX;
-
-    // left bottom spatial candidate
-    xA0 = x0 - 1;
-    yA0 = y0 + nPbH;
-    xA0_pu = xA0 >> s->sps->log2_min_pu_size;
-    yA0_pu = yA0 >> s->sps->log2_min_pu_size;
-
-    is_available_a0 = PRED_BLOCK_AVAILABLE(A0) && AVAILABLE(cand_bottom_left, A0);
-
-    //left spatial merge candidate
-    xA1    = x0 - 1;
-    yA1    = y0 + nPbH - 1;
-    xA1_pu = xA1 >> s->sps->log2_min_pu_size;
-    yA1_pu = yA1 >> s->sps->log2_min_pu_size;
-
-    is_available_a1 = AVAILABLE(cand_left, A1);
-    if (is_available_a0 || is_available_a1)
-        isScaledFlag_L0 = 1;
-
-    if (is_available_a0) {
-        availableFlagLXA0 = MP_MX(A0, pred_flag_index_l0, mxA);
-        if (!availableFlagLXA0)
-            availableFlagLXA0 = MP_MX(A0, pred_flag_index_l1, mxA);
-    }
-
-    if (is_available_a1 && !availableFlagLXA0) {
-        availableFlagLXA0 = MP_MX(A1, pred_flag_index_l0, mxA);
-        if (!availableFlagLXA0)
-            availableFlagLXA0 = MP_MX(A1, pred_flag_index_l1, mxA);
-    }
-
-    if (is_available_a0 && !availableFlagLXA0) {
-        availableFlagLXA0 = MP_MX_LT(A0, pred_flag_index_l0, mxA);
-        if (!availableFlagLXA0)
-            availableFlagLXA0 = MP_MX_LT(A0, pred_flag_index_l1, mxA);
-    }
-
-    if (is_available_a1 && !availableFlagLXA0) {
-        availableFlagLXA0 = MP_MX_LT(A1, pred_flag_index_l0, mxA);
-        if (!availableFlagLXA0)
-            availableFlagLXA0 = MP_MX_LT(A1, pred_flag_index_l1, mxA);
-    }
-
-    // B candidates
-    // above right spatial merge candidate
-    xB0    = x0 + nPbW;
-    yB0    = y0 - 1;
-    xB0_pu = xB0 >> s->sps->log2_min_pu_size;
-    yB0_pu = yB0 >> s->sps->log2_min_pu_size;
-
-    is_available_b0 = PRED_BLOCK_AVAILABLE(B0) && AVAILABLE(cand_up_right, B0);
-
-    if (is_available_b0) {
-        availableFlagLXB0 = MP_MX(B0, pred_flag_index_l0, mxB);
-        if (!availableFlagLXB0)
-            availableFlagLXB0 = MP_MX(B0, pred_flag_index_l1, mxB);
-    }
-
-    if (!availableFlagLXB0) {
-        // above spatial merge candidate
-        xB1    = x0 + nPbW - 1;
-        yB1    = y0 - 1;
-        xB1_pu = xB1 >> s->sps->log2_min_pu_size;
-        yB1_pu = yB1 >> s->sps->log2_min_pu_size;
-
-        is_available_b1 = AVAILABLE(cand_up, B1);
-
-        if (is_available_b1) {
-            availableFlagLXB0 = MP_MX(B1, pred_flag_index_l0, mxB);
-            if (!availableFlagLXB0)
-                availableFlagLXB0 = MP_MX(B1, pred_flag_index_l1, mxB);
-        }
-    }
-
-    if (!availableFlagLXB0) {
-        // above left spatial merge candidate
-        xB2 = x0 - 1;
-        yB2 = y0 - 1;
-        xB2_pu = xB2 >> s->sps->log2_min_pu_size;
-        yB2_pu = yB2 >> s->sps->log2_min_pu_size;
-        is_available_b2 = AVAILABLE(cand_up_left, B2);
-
-        if (is_available_b2) {
-            availableFlagLXB0 = MP_MX(B2, pred_flag_index_l0, mxB);
-            if (!availableFlagLXB0)
-                availableFlagLXB0 = MP_MX(B2, pred_flag_index_l1, mxB);
-        }
-    }
-
-    if (isScaledFlag_L0 == 0) {
-        if (availableFlagLXB0) {
-            availableFlagLXA0 = 1;
-            mxA = mxB;
-        }
-        availableFlagLXB0 = 0;
-
-        // XB0 and L1
-        if (is_available_b0) {
-            availableFlagLXB0 = MP_MX_LT(B0, pred_flag_index_l0, mxB);
-            if (!availableFlagLXB0)
-                availableFlagLXB0 = MP_MX_LT(B0, pred_flag_index_l1, mxB);
-        }
-
-        if (is_available_b1 && !availableFlagLXB0) {
-            availableFlagLXB0 = MP_MX_LT(B1, pred_flag_index_l0, mxB);
-            if (!availableFlagLXB0)
-                availableFlagLXB0 = MP_MX_LT(B1, pred_flag_index_l1, mxB);
-        }
-
-        if (is_available_b2 && !availableFlagLXB0) {
-            availableFlagLXB0 = MP_MX_LT(B2, pred_flag_index_l0, mxB);
-            if (!availableFlagLXB0)
-                availableFlagLXB0 = MP_MX_LT(B2, pred_flag_index_l1, mxB);
-        }
-    }
-
-    if (availableFlagLXA0)
-        mvpcand_list[numMVPCandLX++] = mxA;
-
-    if (availableFlagLXB0 && (!availableFlagLXA0 || mxA.x != mxB.x || mxA.y != mxB.y))
-        mvpcand_list[numMVPCandLX++] = mxB;
-
-    //temporal motion vector prediction candidate
-    if (numMVPCandLX < 2 && s->sh.slice_temporal_mvp_enabled_flag) {
-        Mv mv_col;
-        int available_col = temporal_luma_motion_vector(s, x0, y0, nPbW,
-                                                        nPbH, ref_idx,
-                                                        &mv_col, LX);
-        if (available_col)
-            mvpcand_list[numMVPCandLX++] = mv_col;
-    }
-
-    // insert zero motion vectors when the number of available candidates are less than 2
-    while (numMVPCandLX < 2)
-        mvpcand_list[numMVPCandLX++] = (Mv){ 0, 0 };
-
-    mv->mv[LX].x = mvpcand_list[mvp_lx_flag].x;
-    mv->mv[LX].y = mvpcand_list[mvp_lx_flag].y;
-}
diff --git a/deps/libav/libavcodec/hevc_parser.c b/deps/libav/libavcodec/hevc_parser.c
deleted file mode 100644
index ac2c6f5..0000000
--- a/deps/libav/libavcodec/hevc_parser.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * HEVC Annex B format parser
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-
-#include "parser.h"
-#include "hevc.h"
-
-#define START_CODE 0x000001 ///< start_code_prefix_one_3bytes
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or END_NOT_FOUND
- */
-static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
-                               int buf_size)
-{
-    int i;
-    ParseContext *pc = s->priv_data;
-
-    for (i = 0; i < buf_size; i++) {
-        int nut;
-
-        pc->state64 = (pc->state64 << 8) | buf[i];
-
-        if (((pc->state64 >> 3 * 8) & 0xFFFFFF) != START_CODE)
-            continue;
-
-        nut = (pc->state64 >> 2 * 8 + 1) & 0x3F;
-        // Beginning of access unit
-        if ((nut >= NAL_VPS && nut <= NAL_AUD) || nut == NAL_SEI_PREFIX ||
-            (nut >= 41 && nut <= 44) || (nut >= 48 && nut <= 55)) {
-            if (pc->frame_start_found) {
-                pc->frame_start_found = 0;
-                return i - 5;
-            }
-        } else if (nut <= NAL_RASL_R ||
-                   (nut >= NAL_BLA_W_LP && nut <= NAL_CRA_NUT)) {
-            int first_slice_segment_in_pic_flag = buf[i] >> 7;
-            if (first_slice_segment_in_pic_flag) {
-                if (!pc->frame_start_found) {
-                    pc->frame_start_found = 1;
-                    s->key_frame = nut >= NAL_BLA_W_LP && nut <= NAL_CRA_NUT;
-                } else { // First slice of next frame found
-                    pc->frame_start_found = 0;
-                    return i - 5;
-                }
-            }
-        }
-    }
-
-    return END_NOT_FOUND;
-}
-
-static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx,
-                      const uint8_t **poutbuf, int *poutbuf_size,
-                      const uint8_t *buf, int buf_size)
-{
-    int next;
-    ParseContext *pc = s->priv_data;
-
-    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
-        next = buf_size;
-    } else {
-        next = hevc_find_frame_end(s, buf, buf_size);
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf      = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-    }
-
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-// Split after the parameter sets at the beginning of the stream if they exist.
-static int hevc_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
-{
-    int i;
-    uint32_t state = -1;
-    int has_ps = 0;
-
-    for (i = 0; i < buf_size; i++) {
-        state = (state << 8) | buf[i];
-        if (((state >> 8) & 0xFFFFFF) == START_CODE) {
-            int nut = (state >> 1) & 0x3F;
-            if (nut >= NAL_VPS && nut <= NAL_PPS)
-                has_ps = 1;
-            else if (has_ps)
-                return i - 3;
-            else // no parameter set at the beginning of the stream
-                return 0;
-        }
-    }
-    return 0;
-}
-
-AVCodecParser ff_hevc_parser = {
-    .codec_ids      = { AV_CODEC_ID_HEVC },
-    .priv_data_size = sizeof(ParseContext),
-    .parser_parse   = hevc_parse,
-    .parser_close   = ff_parse_close,
-    .split          = hevc_split,
-};
diff --git a/deps/libav/libavcodec/hevc_ps.c b/deps/libav/libavcodec/hevc_ps.c
deleted file mode 100644
index 5e5d4a7..0000000
--- a/deps/libav/libavcodec/hevc_ps.c
+++ /dev/null
@@ -1,1329 +0,0 @@
-/*
- * HEVC Parameter Set decoding
- *
- * Copyright (C) 2012 - 2103 Guillaume Martres
- * Copyright (C) 2012 - 2103 Mickael Raulet
- * Copyright (C) 2012 - 2013 Gildas Cocherel
- * Copyright (C) 2013 Vittorio Giovara
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/imgutils.h"
-
-#include "golomb.h"
-#include "hevc.h"
-
-static const uint8_t default_scaling_list_intra[] = {
-    16, 16, 16, 16, 17, 18, 21, 24,
-    16, 16, 16, 16, 17, 19, 22, 25,
-    16, 16, 17, 18, 20, 22, 25, 29,
-    16, 16, 18, 21, 24, 27, 31, 36,
-    17, 17, 20, 24, 30, 35, 41, 47,
-    18, 19, 22, 27, 35, 44, 54, 65,
-    21, 22, 25, 31, 41, 54, 70, 88,
-    24, 25, 29, 36, 47, 65, 88, 115
-};
-
-static const uint8_t default_scaling_list_inter[] = {
-    16, 16, 16, 16, 17, 18, 20, 24,
-    16, 16, 16, 17, 18, 20, 24, 25,
-    16, 16, 17, 18, 20, 24, 25, 28,
-    16, 17, 18, 20, 24, 25, 28, 33,
-    17, 18, 20, 24, 25, 28, 33, 41,
-    18, 20, 24, 25, 28, 33, 41, 54,
-    20, 24, 25, 28, 33, 41, 54, 71,
-    24, 25, 28, 33, 41, 54, 71, 91
-};
-
-static const AVRational vui_sar[] = {
-    {  0,   1 },
-    {  1,   1 },
-    { 12,  11 },
-    { 10,  11 },
-    { 16,  11 },
-    { 40,  33 },
-    { 24,  11 },
-    { 20,  11 },
-    { 32,  11 },
-    { 80,  33 },
-    { 18,  11 },
-    { 15,  11 },
-    { 64,  33 },
-    { 160, 99 },
-    {  4,   3 },
-    {  3,   2 },
-    {  2,   1 },
-};
-
-int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
-                                  const HEVCSPS *sps, int is_slice_header)
-{
-    HEVCLocalContext *lc = &s->HEVClc;
-    uint8_t rps_predict = 0;
-    int delta_poc;
-    int k0 = 0;
-    int k1 = 0;
-    int k  = 0;
-    int i;
-
-    GetBitContext *gb = &lc->gb;
-
-    if (rps != sps->st_rps && sps->nb_st_rps)
-        rps_predict = get_bits1(gb);
-
-    if (rps_predict) {
-        const ShortTermRPS *rps_ridx;
-        int delta_rps, abs_delta_rps;
-        uint8_t use_delta_flag = 0;
-        uint8_t delta_rps_sign;
-
-        if (is_slice_header) {
-            unsigned int delta_idx = get_ue_golomb_long(gb) + 1;
-            if (delta_idx > sps->nb_st_rps) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "Invalid value of delta_idx in slice header RPS: %d > %d.\n",
-                       delta_idx, sps->nb_st_rps);
-                return AVERROR_INVALIDDATA;
-            }
-            rps_ridx = &sps->st_rps[sps->nb_st_rps - delta_idx];
-        } else
-            rps_ridx = &sps->st_rps[rps - sps->st_rps - 1];
-
-        delta_rps_sign = get_bits1(gb);
-        abs_delta_rps  = get_ue_golomb_long(gb) + 1;
-        delta_rps      = (1 - (delta_rps_sign << 1)) * abs_delta_rps;
-        for (i = 0; i <= rps_ridx->num_delta_pocs; i++) {
-            int used = rps->used[k] = get_bits1(gb);
-
-            if (!used)
-                use_delta_flag = get_bits1(gb);
-
-            if (used || use_delta_flag) {
-                if (i < rps_ridx->num_delta_pocs)
-                    delta_poc = delta_rps + rps_ridx->delta_poc[i];
-                else
-                    delta_poc = delta_rps;
-                rps->delta_poc[k] = delta_poc;
-                if (delta_poc < 0)
-                    k0++;
-                else
-                    k1++;
-                k++;
-            }
-        }
-
-        rps->num_delta_pocs    = k;
-        rps->num_negative_pics = k0;
-        // sort in increasing order (smallest first)
-        if (rps->num_delta_pocs != 0) {
-            int used, tmp;
-            for (i = 1; i < rps->num_delta_pocs; i++) {
-                delta_poc = rps->delta_poc[i];
-                used      = rps->used[i];
-                for (k = i - 1; k >= 0; k--) {
-                    tmp = rps->delta_poc[k];
-                    if (delta_poc < tmp) {
-                        rps->delta_poc[k + 1] = tmp;
-                        rps->used[k + 1]      = rps->used[k];
-                        rps->delta_poc[k]     = delta_poc;
-                        rps->used[k]          = used;
-                    }
-                }
-            }
-        }
-        if ((rps->num_negative_pics >> 1) != 0) {
-            int used;
-            k = rps->num_negative_pics - 1;
-            // flip the negative values to largest first
-            for (i = 0; i < rps->num_negative_pics >> 1; i++) {
-                delta_poc         = rps->delta_poc[i];
-                used              = rps->used[i];
-                rps->delta_poc[i] = rps->delta_poc[k];
-                rps->used[i]      = rps->used[k];
-                rps->delta_poc[k] = delta_poc;
-                rps->used[k]      = used;
-                k--;
-            }
-        }
-    } else {
-        unsigned int prev, nb_positive_pics;
-        rps->num_negative_pics = get_ue_golomb_long(gb);
-        nb_positive_pics       = get_ue_golomb_long(gb);
-
-        if (rps->num_negative_pics >= MAX_REFS ||
-            nb_positive_pics >= MAX_REFS) {
-            av_log(s->avctx, AV_LOG_ERROR, "Too many refs in a short term RPS.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        rps->num_delta_pocs = rps->num_negative_pics + nb_positive_pics;
-        if (rps->num_delta_pocs) {
-            prev = 0;
-            for (i = 0; i < rps->num_negative_pics; i++) {
-                delta_poc = get_ue_golomb_long(gb) + 1;
-                prev -= delta_poc;
-                rps->delta_poc[i] = prev;
-                rps->used[i]      = get_bits1(gb);
-            }
-            prev = 0;
-            for (i = 0; i < nb_positive_pics; i++) {
-                delta_poc = get_ue_golomb_long(gb) + 1;
-                prev += delta_poc;
-                rps->delta_poc[rps->num_negative_pics + i] = prev;
-                rps->used[rps->num_negative_pics + i]      = get_bits1(gb);
-            }
-        }
-    }
-    return 0;
-}
-
-
-static void decode_profile_tier_level(HEVCContext *s, PTLCommon *ptl)
-{
-    int i;
-    GetBitContext *gb = &s->HEVClc.gb;
-
-    ptl->profile_space = get_bits(gb, 2);
-    ptl->tier_flag     = get_bits1(gb);
-    ptl->profile_idc   = get_bits(gb, 5);
-    if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN)
-        av_log(s->avctx, AV_LOG_DEBUG, "Main profile bitstream\n");
-    else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_10)
-        av_log(s->avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n");
-    else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_STILL_PICTURE)
-        av_log(s->avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n");
-    else
-        av_log(s->avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc);
-
-    for (i = 0; i < 32; i++)
-        ptl->profile_compatibility_flag[i] = get_bits1(gb);
-    ptl->progressive_source_flag    = get_bits1(gb);
-    ptl->interlaced_source_flag     = get_bits1(gb);
-    ptl->non_packed_constraint_flag = get_bits1(gb);
-    ptl->frame_only_constraint_flag = get_bits1(gb);
-
-    skip_bits(gb, 16); // XXX_reserved_zero_44bits[0..15]
-    skip_bits(gb, 16); // XXX_reserved_zero_44bits[16..31]
-    skip_bits(gb, 12); // XXX_reserved_zero_44bits[32..43]
-}
-
-static void parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
-{
-    int i;
-    GetBitContext *gb = &s->HEVClc.gb;
-    decode_profile_tier_level(s, &ptl->general_ptl);
-    ptl->general_ptl.level_idc = get_bits(gb, 8);
-
-    for (i = 0; i < max_num_sub_layers - 1; i++) {
-        ptl->sub_layer_profile_present_flag[i] = get_bits1(gb);
-        ptl->sub_layer_level_present_flag[i]   = get_bits1(gb);
-    }
-    if (max_num_sub_layers - 1 > 0)
-        for (i = max_num_sub_layers - 1; i < 8; i++)
-            skip_bits(gb, 2); // reserved_zero_2bits[i]
-    for (i = 0; i < max_num_sub_layers - 1; i++) {
-        if (ptl->sub_layer_profile_present_flag[i])
-            decode_profile_tier_level(s, &ptl->sub_layer_ptl[i]);
-        if (ptl->sub_layer_level_present_flag[i])
-            ptl->sub_layer_ptl[i].level_idc = get_bits(gb, 8);
-    }
-}
-
-static void decode_sublayer_hrd(HEVCContext *s, unsigned int nb_cpb,
-                                int subpic_params_present)
-{
-    GetBitContext *gb = &s->HEVClc.gb;
-    int i;
-
-    for (i = 0; i < nb_cpb; i++) {
-        get_ue_golomb_long(gb); // bit_rate_value_minus1
-        get_ue_golomb_long(gb); // cpb_size_value_minus1
-
-        if (subpic_params_present) {
-            get_ue_golomb_long(gb); // cpb_size_du_value_minus1
-            get_ue_golomb_long(gb); // bit_rate_du_value_minus1
-        }
-        skip_bits1(gb); // cbr_flag
-    }
-}
-
-static void decode_hrd(HEVCContext *s, int common_inf_present,
-                       int max_sublayers)
-{
-    GetBitContext *gb = &s->HEVClc.gb;
-    int nal_params_present = 0, vcl_params_present = 0;
-    int subpic_params_present = 0;
-    int i;
-
-    if (common_inf_present) {
-        nal_params_present = get_bits1(gb);
-        vcl_params_present = get_bits1(gb);
-
-        if (nal_params_present || vcl_params_present) {
-            subpic_params_present = get_bits1(gb);
-
-            if (subpic_params_present) {
-                skip_bits(gb, 8); // tick_divisor_minus2
-                skip_bits(gb, 5); // du_cpb_removal_delay_increment_length_minus1
-                skip_bits(gb, 1); // sub_pic_cpb_params_in_pic_timing_sei_flag
-                skip_bits(gb, 5); // dpb_output_delay_du_length_minus1
-            }
-
-            skip_bits(gb, 4); // bit_rate_scale
-            skip_bits(gb, 4); // cpb_size_scale
-
-            if (subpic_params_present)
-                skip_bits(gb, 4);  // cpb_size_du_scale
-
-            skip_bits(gb, 5); // initial_cpb_removal_delay_length_minus1
-            skip_bits(gb, 5); // au_cpb_removal_delay_length_minus1
-            skip_bits(gb, 5); // dpb_output_delay_length_minus1
-        }
-    }
-
-    for (i = 0; i < max_sublayers; i++) {
-        int low_delay = 0;
-        unsigned int nb_cpb = 1;
-        int fixed_rate = get_bits1(gb);
-
-        if (!fixed_rate)
-            fixed_rate = get_bits1(gb);
-
-        if (fixed_rate)
-            get_ue_golomb_long(gb);  // elemental_duration_in_tc_minus1
-        else
-            low_delay = get_bits1(gb);
-
-        if (!low_delay)
-            nb_cpb = get_ue_golomb_long(gb) + 1;
-
-        if (nal_params_present)
-            decode_sublayer_hrd(s, nb_cpb, subpic_params_present);
-        if (vcl_params_present)
-            decode_sublayer_hrd(s, nb_cpb, subpic_params_present);
-    }
-}
-
-int ff_hevc_decode_nal_vps(HEVCContext *s)
-{
-    int i,j;
-    GetBitContext *gb = &s->HEVClc.gb;
-    int vps_id = 0;
-    HEVCVPS *vps;
-    AVBufferRef *vps_buf = av_buffer_allocz(sizeof(*vps));
-
-    if (!vps_buf)
-        return AVERROR(ENOMEM);
-    vps = (HEVCVPS*)vps_buf->data;
-
-    av_log(s->avctx, AV_LOG_DEBUG, "Decoding VPS\n");
-
-    vps_id = get_bits(gb, 4);
-    if (vps_id >= MAX_VPS_COUNT) {
-        av_log(s->avctx, AV_LOG_ERROR, "VPS id out of range: %d\n", vps_id);
-        goto err;
-    }
-
-    if (get_bits(gb, 2) != 3) { // vps_reserved_three_2bits
-        av_log(s->avctx, AV_LOG_ERROR, "vps_reserved_three_2bits is not three\n");
-        goto err;
-    }
-
-    vps->vps_max_layers               = get_bits(gb, 6) + 1;
-    vps->vps_max_sub_layers           = get_bits(gb, 3) + 1;
-    vps->vps_temporal_id_nesting_flag = get_bits1(gb);
-
-    if (get_bits(gb, 16) != 0xffff) { // vps_reserved_ffff_16bits
-        av_log(s->avctx, AV_LOG_ERROR, "vps_reserved_ffff_16bits is not 0xffff\n");
-        goto err;
-    }
-
-    if (vps->vps_max_sub_layers > MAX_SUB_LAYERS) {
-        av_log(s->avctx, AV_LOG_ERROR, "vps_max_sub_layers out of range: %d\n",
-               vps->vps_max_sub_layers);
-        goto err;
-    }
-
-    parse_ptl(s, &vps->ptl, vps->vps_max_sub_layers);
-
-    vps->vps_sub_layer_ordering_info_present_flag = get_bits1(gb);
-
-    i = vps->vps_sub_layer_ordering_info_present_flag ? 0 : vps->vps_max_sub_layers - 1;
-    for (; i < vps->vps_max_sub_layers; i++) {
-        vps->vps_max_dec_pic_buffering[i] = get_ue_golomb_long(gb) + 1;
-        vps->vps_num_reorder_pics[i]      = get_ue_golomb_long(gb);
-        vps->vps_max_latency_increase[i]  = get_ue_golomb_long(gb) - 1;
-
-        if (vps->vps_max_dec_pic_buffering[i] > MAX_DPB_SIZE) {
-            av_log(s->avctx, AV_LOG_ERROR, "vps_max_dec_pic_buffering_minus1 out of range: %d\n",
-                   vps->vps_max_dec_pic_buffering[i] - 1);
-            goto err;
-        }
-        if (vps->vps_num_reorder_pics[i] > vps->vps_max_dec_pic_buffering[i] - 1) {
-            av_log(s->avctx, AV_LOG_ERROR, "vps_max_num_reorder_pics out of range: %d\n",
-                   vps->vps_num_reorder_pics[i]);
-            goto err;
-        }
-    }
-
-    vps->vps_max_layer_id   = get_bits(gb, 6);
-    vps->vps_num_layer_sets = get_ue_golomb_long(gb) + 1;
-    for (i = 1; i < vps->vps_num_layer_sets; i++)
-        for (j = 0; j <= vps->vps_max_layer_id; j++)
-            skip_bits(gb, 1);  // layer_id_included_flag[i][j]
-
-    vps->vps_timing_info_present_flag = get_bits1(gb);
-    if (vps->vps_timing_info_present_flag) {
-        vps->vps_num_units_in_tick               = get_bits_long(gb, 32);
-        vps->vps_time_scale                      = get_bits_long(gb, 32);
-        vps->vps_poc_proportional_to_timing_flag = get_bits1(gb);
-        if (vps->vps_poc_proportional_to_timing_flag)
-            vps->vps_num_ticks_poc_diff_one = get_ue_golomb_long(gb) + 1;
-        vps->vps_num_hrd_parameters = get_ue_golomb_long(gb);
-        for (i = 0; i < vps->vps_num_hrd_parameters; i++) {
-            int common_inf_present = 1;
-
-            get_ue_golomb_long(gb); // hrd_layer_set_idx
-            if (i)
-                common_inf_present = get_bits1(gb);
-            decode_hrd(s, common_inf_present, vps->vps_max_sub_layers);
-        }
-    }
-    get_bits1(gb); /* vps_extension_flag */
-
-    av_buffer_unref(&s->vps_list[vps_id]);
-    s->vps_list[vps_id] = vps_buf;
-    return 0;
-
-err:
-    av_buffer_unref(&vps_buf);
-    return AVERROR_INVALIDDATA;
-}
-
-static void decode_vui(HEVCContext *s, HEVCSPS *sps)
-{
-    VUI *vui          = &sps->vui;
-    GetBitContext *gb = &s->HEVClc.gb;
-    int sar_present;
-
-    av_log(s->avctx, AV_LOG_DEBUG, "Decoding VUI\n");
-
-    sar_present = get_bits1(gb);
-    if (sar_present) {
-        uint8_t sar_idx = get_bits(gb, 8);
-        if (sar_idx < FF_ARRAY_ELEMS(vui_sar))
-            vui->sar = vui_sar[sar_idx];
-        else if (sar_idx == 255) {
-            vui->sar.num = get_bits(gb, 16);
-            vui->sar.den = get_bits(gb, 16);
-        } else
-            av_log(s->avctx, AV_LOG_WARNING,
-                   "Unknown SAR index: %u.\n", sar_idx);
-    }
-
-    vui->overscan_info_present_flag = get_bits1(gb);
-    if (vui->overscan_info_present_flag)
-        vui->overscan_appropriate_flag = get_bits1(gb);
-
-    vui->video_signal_type_present_flag = get_bits1(gb);
-    if (vui->video_signal_type_present_flag) {
-        vui->video_format                    = get_bits(gb, 3);
-        vui->video_full_range_flag           = get_bits1(gb);
-        vui->colour_description_present_flag = get_bits1(gb);
-        if (vui->video_full_range_flag && sps->pix_fmt == AV_PIX_FMT_YUV420P)
-            sps->pix_fmt = AV_PIX_FMT_YUVJ420P;
-        if (vui->colour_description_present_flag) {
-            vui->colour_primaries        = get_bits(gb, 8);
-            vui->transfer_characteristic = get_bits(gb, 8);
-            vui->matrix_coeffs           = get_bits(gb, 8);
-
-            // Set invalid values to "unspecified"
-            if (vui->colour_primaries >= AVCOL_PRI_NB)
-                vui->colour_primaries = AVCOL_PRI_UNSPECIFIED;
-            if (vui->transfer_characteristic >= AVCOL_TRC_NB)
-                vui->transfer_characteristic = AVCOL_TRC_UNSPECIFIED;
-            if (vui->matrix_coeffs >= AVCOL_SPC_NB)
-                vui->matrix_coeffs = AVCOL_SPC_UNSPECIFIED;
-        }
-    }
-
-    vui->chroma_loc_info_present_flag = get_bits1(gb);
-    if (vui->chroma_loc_info_present_flag) {
-        vui->chroma_sample_loc_type_top_field    = get_ue_golomb_long(gb);
-        vui->chroma_sample_loc_type_bottom_field = get_ue_golomb_long(gb);
-    }
-
-    vui->neutra_chroma_indication_flag = get_bits1(gb);
-    vui->field_seq_flag                = get_bits1(gb);
-    vui->frame_field_info_present_flag = get_bits1(gb);
-
-    vui->default_display_window_flag = get_bits1(gb);
-    if (vui->default_display_window_flag) {
-        //TODO: * 2 is only valid for 420
-        vui->def_disp_win.left_offset   = get_ue_golomb_long(gb) * 2;
-        vui->def_disp_win.right_offset  = get_ue_golomb_long(gb) * 2;
-        vui->def_disp_win.top_offset    = get_ue_golomb_long(gb) * 2;
-        vui->def_disp_win.bottom_offset = get_ue_golomb_long(gb) * 2;
-
-        if (s->apply_defdispwin &&
-            s->avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
-            av_log(s->avctx, AV_LOG_DEBUG,
-                   "discarding vui default display window, "
-                   "original values are l:%u r:%u t:%u b:%u\n",
-                   vui->def_disp_win.left_offset,
-                   vui->def_disp_win.right_offset,
-                   vui->def_disp_win.top_offset,
-                   vui->def_disp_win.bottom_offset);
-
-            vui->def_disp_win.left_offset   =
-            vui->def_disp_win.right_offset  =
-            vui->def_disp_win.top_offset    =
-            vui->def_disp_win.bottom_offset = 0;
-        }
-    }
-
-    vui->vui_timing_info_present_flag = get_bits1(gb);
-    if (vui->vui_timing_info_present_flag) {
-        vui->vui_num_units_in_tick               = get_bits_long(gb, 32);
-        vui->vui_time_scale                      = get_bits_long(gb, 32);
-        vui->vui_poc_proportional_to_timing_flag = get_bits1(gb);
-        if (vui->vui_poc_proportional_to_timing_flag)
-            vui->vui_num_ticks_poc_diff_one_minus1 = get_ue_golomb_long(gb);
-        vui->vui_hrd_parameters_present_flag = get_bits1(gb);
-        if (vui->vui_hrd_parameters_present_flag)
-            decode_hrd(s, 1, sps->max_sub_layers);
-    }
-
-    vui->bitstream_restriction_flag = get_bits1(gb);
-    if (vui->bitstream_restriction_flag) {
-        vui->tiles_fixed_structure_flag              = get_bits1(gb);
-        vui->motion_vectors_over_pic_boundaries_flag = get_bits1(gb);
-        vui->restricted_ref_pic_lists_flag           = get_bits1(gb);
-        vui->min_spatial_segmentation_idc            = get_ue_golomb_long(gb);
-        vui->max_bytes_per_pic_denom                 = get_ue_golomb_long(gb);
-        vui->max_bits_per_min_cu_denom               = get_ue_golomb_long(gb);
-        vui->log2_max_mv_length_horizontal           = get_ue_golomb_long(gb);
-        vui->log2_max_mv_length_vertical             = get_ue_golomb_long(gb);
-    }
-}
-
-static void set_default_scaling_list_data(ScalingList *sl)
-{
-    int matrixId;
-
-    for (matrixId = 0; matrixId < 6; matrixId++) {
-        // 4x4 default is 16
-        memset(sl->sl[0][matrixId], 16, 16);
-        sl->sl_dc[0][matrixId] = 16; // default for 16x16
-        sl->sl_dc[1][matrixId] = 16; // default for 32x32
-    }
-    memcpy(sl->sl[1][0], default_scaling_list_intra, 64);
-    memcpy(sl->sl[1][1], default_scaling_list_intra, 64);
-    memcpy(sl->sl[1][2], default_scaling_list_intra, 64);
-    memcpy(sl->sl[1][3], default_scaling_list_inter, 64);
-    memcpy(sl->sl[1][4], default_scaling_list_inter, 64);
-    memcpy(sl->sl[1][5], default_scaling_list_inter, 64);
-    memcpy(sl->sl[2][0], default_scaling_list_intra, 64);
-    memcpy(sl->sl[2][1], default_scaling_list_intra, 64);
-    memcpy(sl->sl[2][2], default_scaling_list_intra, 64);
-    memcpy(sl->sl[2][3], default_scaling_list_inter, 64);
-    memcpy(sl->sl[2][4], default_scaling_list_inter, 64);
-    memcpy(sl->sl[2][5], default_scaling_list_inter, 64);
-    memcpy(sl->sl[3][0], default_scaling_list_intra, 64);
-    memcpy(sl->sl[3][1], default_scaling_list_inter, 64);
-}
-
-static int scaling_list_data(HEVCContext *s, ScalingList *sl)
-{
-    GetBitContext *gb = &s->HEVClc.gb;
-    uint8_t scaling_list_pred_mode_flag[4][6];
-    int32_t scaling_list_dc_coef[2][6];
-    int size_id, matrix_id, i, pos;
-
-    for (size_id = 0; size_id < 4; size_id++)
-        for (matrix_id = 0; matrix_id < (size_id == 3 ? 2 : 6); matrix_id++) {
-            scaling_list_pred_mode_flag[size_id][matrix_id] = get_bits1(gb);
-            if (!scaling_list_pred_mode_flag[size_id][matrix_id]) {
-                unsigned int delta = get_ue_golomb_long(gb);
-                /* Only need to handle non-zero delta. Zero means default,
-                 * which should already be in the arrays. */
-                if (delta) {
-                    // Copy from previous array.
-                    if (matrix_id < delta) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "Invalid delta in scaling list data: %d.\n", delta);
-                        return AVERROR_INVALIDDATA;
-                    }
-
-                    memcpy(sl->sl[size_id][matrix_id],
-                           sl->sl[size_id][matrix_id - delta],
-                           size_id > 0 ? 64 : 16);
-                    if (size_id > 1)
-                        sl->sl_dc[size_id - 2][matrix_id] = sl->sl_dc[size_id - 2][matrix_id - delta];
-                }
-            } else {
-                int next_coef, coef_num;
-                int32_t scaling_list_delta_coef;
-
-                next_coef = 8;
-                coef_num  = FFMIN(64, 1 << (4 + (size_id << 1)));
-                if (size_id > 1) {
-                    scaling_list_dc_coef[size_id - 2][matrix_id] = get_se_golomb(gb) + 8;
-                    next_coef = scaling_list_dc_coef[size_id - 2][matrix_id];
-                    sl->sl_dc[size_id - 2][matrix_id] = next_coef;
-                }
-                for (i = 0; i < coef_num; i++) {
-                    if (size_id == 0)
-                        pos = 4 * ff_hevc_diag_scan4x4_y[i] +
-                                  ff_hevc_diag_scan4x4_x[i];
-                    else
-                        pos = 8 * ff_hevc_diag_scan8x8_y[i] +
-                                  ff_hevc_diag_scan8x8_x[i];
-
-                    scaling_list_delta_coef = get_se_golomb(gb);
-                    next_coef = (next_coef + scaling_list_delta_coef + 256) % 256;
-                    sl->sl[size_id][matrix_id][pos] = next_coef;
-                }
-            }
-        }
-
-    return 0;
-}
-
-int ff_hevc_decode_nal_sps(HEVCContext *s)
-{
-    const AVPixFmtDescriptor *desc;
-    GetBitContext *gb = &s->HEVClc.gb;
-    int ret = 0;
-    unsigned int sps_id = 0;
-    int log2_diff_max_min_transform_block_size;
-    int bit_depth_chroma, start, vui_present, sublayer_ordering_info;
-    int i;
-
-    HEVCSPS *sps;
-    AVBufferRef *sps_buf = av_buffer_allocz(sizeof(*sps));
-
-    if (!sps_buf)
-        return AVERROR(ENOMEM);
-    sps = (HEVCSPS*)sps_buf->data;
-
-    av_log(s->avctx, AV_LOG_DEBUG, "Decoding SPS\n");
-
-    // Coded parameters
-
-    sps->vps_id = get_bits(gb, 4);
-    if (sps->vps_id >= MAX_VPS_COUNT) {
-        av_log(s->avctx, AV_LOG_ERROR, "VPS id out of range: %d\n", sps->vps_id);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-
-    if (!s->vps_list[sps->vps_id]) {
-        av_log(s->avctx, AV_LOG_ERROR, "VPS %d does not exist\n",
-               sps->vps_id);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-
-    sps->max_sub_layers = get_bits(gb, 3) + 1;
-    if (sps->max_sub_layers > MAX_SUB_LAYERS) {
-        av_log(s->avctx, AV_LOG_ERROR, "sps_max_sub_layers out of range: %d\n",
-               sps->max_sub_layers);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-
-    skip_bits1(gb); // temporal_id_nesting_flag
-
-    parse_ptl(s, &sps->ptl, sps->max_sub_layers);
-
-    sps_id = get_ue_golomb_long(gb);
-    if (sps_id >= MAX_SPS_COUNT) {
-        av_log(s->avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", sps_id);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-
-    sps->chroma_format_idc = get_ue_golomb_long(gb);
-    if (sps->chroma_format_idc != 1) {
-        avpriv_report_missing_feature(s->avctx, "chroma_format_idc != 1\n");
-        ret = AVERROR_PATCHWELCOME;
-        goto err;
-    }
-
-    if (sps->chroma_format_idc == 3)
-        sps->separate_colour_plane_flag = get_bits1(gb);
-
-    sps->width  = get_ue_golomb_long(gb);
-    sps->height = get_ue_golomb_long(gb);
-    if ((ret = av_image_check_size(sps->width,
-                                   sps->height, 0, s->avctx)) < 0)
-        goto err;
-
-    if (get_bits1(gb)) { // pic_conformance_flag
-        //TODO: * 2 is only valid for 420
-        sps->pic_conf_win.left_offset   = get_ue_golomb_long(gb) * 2;
-        sps->pic_conf_win.right_offset  = get_ue_golomb_long(gb) * 2;
-        sps->pic_conf_win.top_offset    = get_ue_golomb_long(gb) * 2;
-        sps->pic_conf_win.bottom_offset = get_ue_golomb_long(gb) * 2;
-
-        if (s->avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
-            av_log(s->avctx, AV_LOG_DEBUG,
-                   "discarding sps conformance window, "
-                   "original values are l:%u r:%u t:%u b:%u\n",
-                   sps->pic_conf_win.left_offset,
-                   sps->pic_conf_win.right_offset,
-                   sps->pic_conf_win.top_offset,
-                   sps->pic_conf_win.bottom_offset);
-
-            sps->pic_conf_win.left_offset   =
-            sps->pic_conf_win.right_offset  =
-            sps->pic_conf_win.top_offset    =
-            sps->pic_conf_win.bottom_offset = 0;
-        }
-        sps->output_window = sps->pic_conf_win;
-    }
-
-    sps->bit_depth   = get_ue_golomb_long(gb) + 8;
-    bit_depth_chroma = get_ue_golomb_long(gb) + 8;
-    if (bit_depth_chroma != sps->bit_depth) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Luma bit depth (%d) is different from chroma bit depth (%d), "
-               "this is unsupported.\n",
-               sps->bit_depth, bit_depth_chroma);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-
-    if (sps->chroma_format_idc == 1) {
-        switch (sps->bit_depth) {
-        case 8:  sps->pix_fmt = AV_PIX_FMT_YUV420P;   break;
-        case 9:  sps->pix_fmt = AV_PIX_FMT_YUV420P9;  break;
-        case 10: sps->pix_fmt = AV_PIX_FMT_YUV420P10; break;
-        default:
-            av_log(s->avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n",
-                   sps->bit_depth);
-            ret = AVERROR_PATCHWELCOME;
-            goto err;
-        }
-    } else {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "non-4:2:0 support is currently unspecified.\n");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    desc = av_pix_fmt_desc_get(sps->pix_fmt);
-    if (!desc) {
-        ret = AVERROR(EINVAL);
-        goto err;
-    }
-
-    sps->hshift[0] = sps->vshift[0] = 0;
-    sps->hshift[2] = sps->hshift[1] = desc->log2_chroma_w;
-    sps->vshift[2] = sps->vshift[1] = desc->log2_chroma_h;
-
-    sps->pixel_shift = sps->bit_depth > 8;
-
-    sps->log2_max_poc_lsb = get_ue_golomb_long(gb) + 4;
-    if (sps->log2_max_poc_lsb > 16) {
-        av_log(s->avctx, AV_LOG_ERROR, "log2_max_pic_order_cnt_lsb_minus4 out range: %d\n",
-               sps->log2_max_poc_lsb - 4);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-
-    sublayer_ordering_info = get_bits1(gb);
-    start = sublayer_ordering_info ? 0 : sps->max_sub_layers - 1;
-    for (i = start; i < sps->max_sub_layers; i++) {
-        sps->temporal_layer[i].max_dec_pic_buffering = get_ue_golomb_long(gb) + 1;
-        sps->temporal_layer[i].num_reorder_pics      = get_ue_golomb_long(gb);
-        sps->temporal_layer[i].max_latency_increase  = get_ue_golomb_long(gb) - 1;
-        if (sps->temporal_layer[i].max_dec_pic_buffering > MAX_DPB_SIZE) {
-            av_log(s->avctx, AV_LOG_ERROR, "sps_max_dec_pic_buffering_minus1 out of range: %d\n",
-                   sps->temporal_layer[i].max_dec_pic_buffering - 1);
-            ret = AVERROR_INVALIDDATA;
-            goto err;
-        }
-        if (sps->temporal_layer[i].num_reorder_pics > sps->temporal_layer[i].max_dec_pic_buffering - 1) {
-            av_log(s->avctx, AV_LOG_ERROR, "sps_max_num_reorder_pics out of range: %d\n",
-                   sps->temporal_layer[i].num_reorder_pics);
-            ret = AVERROR_INVALIDDATA;
-            goto err;
-        }
-    }
-
-    if (!sublayer_ordering_info) {
-        for (i = 0; i < start; i++) {
-            sps->temporal_layer[i].max_dec_pic_buffering = sps->temporal_layer[start].max_dec_pic_buffering;
-            sps->temporal_layer[i].num_reorder_pics      = sps->temporal_layer[start].num_reorder_pics;
-            sps->temporal_layer[i].max_latency_increase  = sps->temporal_layer[start].max_latency_increase;
-        }
-    }
-
-    sps->log2_min_cb_size                    = get_ue_golomb_long(gb) + 3;
-    sps->log2_diff_max_min_coding_block_size = get_ue_golomb_long(gb);
-    sps->log2_min_tb_size                    = get_ue_golomb_long(gb) + 2;
-    log2_diff_max_min_transform_block_size   = get_ue_golomb_long(gb);
-    sps->log2_max_trafo_size                 = log2_diff_max_min_transform_block_size +
-                                               sps->log2_min_tb_size;
-
-    if (sps->log2_min_tb_size >= sps->log2_min_cb_size) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid value for log2_min_tb_size");
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-    sps->max_transform_hierarchy_depth_inter = get_ue_golomb_long(gb);
-    sps->max_transform_hierarchy_depth_intra = get_ue_golomb_long(gb);
-
-    sps->scaling_list_enable_flag = get_bits1(gb);
-    if (sps->scaling_list_enable_flag) {
-        set_default_scaling_list_data(&sps->scaling_list);
-
-        if (get_bits1(gb)) {
-            ret = scaling_list_data(s, &sps->scaling_list);
-            if (ret < 0)
-                goto err;
-        }
-    }
-
-    sps->amp_enabled_flag = get_bits1(gb);
-    sps->sao_enabled      = get_bits1(gb);
-
-    sps->pcm_enabled_flag = get_bits1(gb);
-    if (sps->pcm_enabled_flag) {
-        sps->pcm.bit_depth   = get_bits(gb, 4) + 1;
-        sps->pcm.bit_depth_chroma = get_bits(gb, 4) + 1;
-        sps->pcm.log2_min_pcm_cb_size = get_ue_golomb_long(gb) + 3;
-        sps->pcm.log2_max_pcm_cb_size = sps->pcm.log2_min_pcm_cb_size +
-                                        get_ue_golomb_long(gb);
-        if (sps->pcm.bit_depth > sps->bit_depth) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "PCM bit depth (%d) is greater than normal bit depth (%d)\n",
-                   sps->pcm.bit_depth, sps->bit_depth);
-            ret = AVERROR_INVALIDDATA;
-            goto err;
-        }
-
-        sps->pcm.loop_filter_disable_flag = get_bits1(gb);
-    }
-
-    sps->nb_st_rps = get_ue_golomb_long(gb);
-    if (sps->nb_st_rps > MAX_SHORT_TERM_RPS_COUNT) {
-        av_log(s->avctx, AV_LOG_ERROR, "Too many short term RPS: %d.\n",
-               sps->nb_st_rps);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-    for (i = 0; i < sps->nb_st_rps; i++) {
-        if ((ret = ff_hevc_decode_short_term_rps(s, &sps->st_rps[i],
-                                                 sps, 0)) < 0)
-            goto err;
-    }
-
-    sps->long_term_ref_pics_present_flag = get_bits1(gb);
-    if (sps->long_term_ref_pics_present_flag) {
-        sps->num_long_term_ref_pics_sps = get_ue_golomb_long(gb);
-        for (i = 0; i < sps->num_long_term_ref_pics_sps; i++) {
-            sps->lt_ref_pic_poc_lsb_sps[i]       = get_bits(gb, sps->log2_max_poc_lsb);
-            sps->used_by_curr_pic_lt_sps_flag[i] = get_bits1(gb);
-        }
-    }
-
-    sps->sps_temporal_mvp_enabled_flag          = get_bits1(gb);
-    sps->sps_strong_intra_smoothing_enable_flag = get_bits1(gb);
-    sps->vui.sar = (AVRational){0, 1};
-    vui_present = get_bits1(gb);
-    if (vui_present)
-        decode_vui(s, sps);
-    skip_bits1(gb); // sps_extension_flag
-
-    if (s->apply_defdispwin) {
-        sps->output_window.left_offset   += sps->vui.def_disp_win.left_offset;
-        sps->output_window.right_offset  += sps->vui.def_disp_win.right_offset;
-        sps->output_window.top_offset    += sps->vui.def_disp_win.top_offset;
-        sps->output_window.bottom_offset += sps->vui.def_disp_win.bottom_offset;
-    }
-    if (sps->output_window.left_offset & (0x1F >> (sps->pixel_shift)) &&
-        !(s->avctx->flags & CODEC_FLAG_UNALIGNED)) {
-        sps->output_window.left_offset &= ~(0x1F >> (sps->pixel_shift));
-        av_log(s->avctx, AV_LOG_WARNING, "Reducing left output window to %d "
-               "chroma samples to preserve alignment.\n",
-               sps->output_window.left_offset);
-    }
-    sps->output_width  = sps->width -
-                         (sps->output_window.left_offset + sps->output_window.right_offset);
-    sps->output_height = sps->height -
-                         (sps->output_window.top_offset + sps->output_window.bottom_offset);
-    if (sps->output_width <= 0 || sps->output_height <= 0) {
-        av_log(s->avctx, AV_LOG_WARNING, "Invalid visible frame dimensions: %dx%d.\n",
-               sps->output_width, sps->output_height);
-        if (s->avctx->err_recognition & AV_EF_EXPLODE) {
-            ret = AVERROR_INVALIDDATA;
-            goto err;
-        }
-        av_log(s->avctx, AV_LOG_WARNING,
-               "Displaying the whole video surface.\n");
-        sps->pic_conf_win.left_offset   =
-        sps->pic_conf_win.right_offset  =
-        sps->pic_conf_win.top_offset    =
-        sps->pic_conf_win.bottom_offset = 0;
-        sps->output_width               = sps->width;
-        sps->output_height              = sps->height;
-    }
-
-    // Inferred parameters
-    sps->log2_ctb_size = sps->log2_min_cb_size +
-                         sps->log2_diff_max_min_coding_block_size;
-    sps->log2_min_pu_size = sps->log2_min_cb_size - 1;
-
-    sps->ctb_width  = (sps->width  + (1 << sps->log2_ctb_size) - 1) >> sps->log2_ctb_size;
-    sps->ctb_height = (sps->height + (1 << sps->log2_ctb_size) - 1) >> sps->log2_ctb_size;
-    sps->ctb_size   = sps->ctb_width * sps->ctb_height;
-
-    sps->min_cb_width  = sps->width  >> sps->log2_min_cb_size;
-    sps->min_cb_height = sps->height >> sps->log2_min_cb_size;
-    sps->min_tb_width  = sps->width  >> sps->log2_min_tb_size;
-    sps->min_tb_height = sps->height >> sps->log2_min_tb_size;
-    sps->min_pu_width  = sps->width  >> sps->log2_min_pu_size;
-    sps->min_pu_height = sps->height >> sps->log2_min_pu_size;
-
-    sps->qp_bd_offset = 6 * (sps->bit_depth - 8);
-
-    if (sps->width  & ((1 << sps->log2_min_cb_size) - 1) ||
-        sps->height & ((1 << sps->log2_min_cb_size) - 1)) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid coded frame dimensions.\n");
-        goto err;
-    }
-
-    if (sps->log2_ctb_size > MAX_LOG2_CTB_SIZE) {
-        av_log(s->avctx, AV_LOG_ERROR, "CTB size out of range: 2^%d\n", sps->log2_ctb_size);
-        goto err;
-    }
-    if (sps->max_transform_hierarchy_depth_inter > sps->log2_ctb_size - sps->log2_min_tb_size) {
-        av_log(s->avctx, AV_LOG_ERROR, "max_transform_hierarchy_depth_inter out of range: %d\n",
-               sps->max_transform_hierarchy_depth_inter);
-        goto err;
-    }
-    if (sps->max_transform_hierarchy_depth_intra > sps->log2_ctb_size - sps->log2_min_tb_size) {
-        av_log(s->avctx, AV_LOG_ERROR, "max_transform_hierarchy_depth_intra out of range: %d\n",
-               sps->max_transform_hierarchy_depth_intra);
-        goto err;
-    }
-    if (sps->log2_max_trafo_size > FFMIN(sps->log2_ctb_size, 5)) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "max transform block size out of range: %d\n",
-               sps->log2_max_trafo_size);
-        goto err;
-    }
-
-    if (s->avctx->debug & FF_DEBUG_BITSTREAM) {
-        av_log(s->avctx, AV_LOG_DEBUG,
-               "Parsed SPS: id %d; coded wxh: %dx%d; "
-               "cropped wxh: %dx%d; pix_fmt: %s.\n",
-               sps_id, sps->width, sps->height,
-               sps->output_width, sps->output_height,
-               av_get_pix_fmt_name(sps->pix_fmt));
-    }
-
-    /* check if this is a repeat of an already parsed SPS, then keep the
-     * original one.
-     * otherwise drop all PPSes that depend on it */
-    if (s->sps_list[sps_id] &&
-        !memcmp(s->sps_list[sps_id]->data, sps_buf->data, sps_buf->size)) {
-        av_buffer_unref(&sps_buf);
-    } else {
-        for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++) {
-            if (s->pps_list[i] && ((HEVCPPS*)s->pps_list[i]->data)->sps_id == sps_id)
-                av_buffer_unref(&s->pps_list[i]);
-        }
-        av_buffer_unref(&s->sps_list[sps_id]);
-        s->sps_list[sps_id] = sps_buf;
-    }
-
-    return 0;
-
-err:
-    av_buffer_unref(&sps_buf);
-    return ret;
-}
-
-static void hevc_pps_free(void *opaque, uint8_t *data)
-{
-    HEVCPPS *pps = (HEVCPPS*)data;
-
-    av_freep(&pps->column_width);
-    av_freep(&pps->row_height);
-    av_freep(&pps->col_bd);
-    av_freep(&pps->row_bd);
-    av_freep(&pps->col_idxX);
-    av_freep(&pps->ctb_addr_rs_to_ts);
-    av_freep(&pps->ctb_addr_ts_to_rs);
-    av_freep(&pps->tile_pos_rs);
-    av_freep(&pps->tile_id);
-    av_freep(&pps->min_cb_addr_zs);
-    av_freep(&pps->min_tb_addr_zs);
-
-    av_freep(&pps);
-}
-
-int ff_hevc_decode_nal_pps(HEVCContext *s)
-{
-    GetBitContext *gb = &s->HEVClc.gb;
-    HEVCSPS      *sps = NULL;
-    int pic_area_in_ctbs, pic_area_in_min_cbs, pic_area_in_min_tbs;
-    int log2_diff_ctb_min_tb_size;
-    int i, j, x, y, ctb_addr_rs, tile_id;
-    int ret = 0;
-    unsigned int pps_id = 0;
-
-    AVBufferRef *pps_buf;
-    HEVCPPS *pps = av_mallocz(sizeof(*pps));
-
-    if (!pps)
-        return AVERROR(ENOMEM);
-
-    pps_buf = av_buffer_create((uint8_t *)pps, sizeof(*pps),
-                               hevc_pps_free, NULL, 0);
-    if (!pps_buf) {
-        av_freep(&pps);
-        return AVERROR(ENOMEM);
-    }
-
-    av_log(s->avctx, AV_LOG_DEBUG, "Decoding PPS\n");
-
-    // Default values
-    pps->loop_filter_across_tiles_enabled_flag = 1;
-    pps->num_tile_columns                      = 1;
-    pps->num_tile_rows                         = 1;
-    pps->uniform_spacing_flag                  = 1;
-    pps->disable_dbf                           = 0;
-    pps->beta_offset                           = 0;
-    pps->tc_offset                             = 0;
-
-    // Coded parameters
-    pps_id = get_ue_golomb_long(gb);
-    if (pps_id >= MAX_PPS_COUNT) {
-        av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", pps_id);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-    pps->sps_id = get_ue_golomb_long(gb);
-    if (pps->sps_id >= MAX_SPS_COUNT) {
-        av_log(s->avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", pps->sps_id);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-    if (!s->sps_list[pps->sps_id]) {
-        av_log(s->avctx, AV_LOG_ERROR, "SPS %u does not exist.\n", pps->sps_id);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-    sps = (HEVCSPS *)s->sps_list[pps->sps_id]->data;
-
-    pps->dependent_slice_segments_enabled_flag = get_bits1(gb);
-    pps->output_flag_present_flag              = get_bits1(gb);
-    pps->num_extra_slice_header_bits           = get_bits(gb, 3);
-
-    pps->sign_data_hiding_flag = get_bits1(gb);
-
-    pps->cabac_init_present_flag = get_bits1(gb);
-
-    pps->num_ref_idx_l0_default_active = get_ue_golomb_long(gb) + 1;
-    pps->num_ref_idx_l1_default_active = get_ue_golomb_long(gb) + 1;
-
-    pps->pic_init_qp_minus26 = get_se_golomb(gb);
-
-    pps->constrained_intra_pred_flag = get_bits1(gb);
-    pps->transform_skip_enabled_flag = get_bits1(gb);
-
-    pps->cu_qp_delta_enabled_flag = get_bits1(gb);
-    pps->diff_cu_qp_delta_depth   = 0;
-    if (pps->cu_qp_delta_enabled_flag)
-        pps->diff_cu_qp_delta_depth = get_ue_golomb_long(gb);
-
-    pps->cb_qp_offset = get_se_golomb(gb);
-    if (pps->cb_qp_offset < -12 || pps->cb_qp_offset > 12) {
-        av_log(s->avctx, AV_LOG_ERROR, "pps_cb_qp_offset out of range: %d\n",
-               pps->cb_qp_offset);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-    pps->cr_qp_offset = get_se_golomb(gb);
-    if (pps->cr_qp_offset < -12 || pps->cr_qp_offset > 12) {
-        av_log(s->avctx, AV_LOG_ERROR, "pps_cr_qp_offset out of range: %d\n",
-               pps->cr_qp_offset);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-    pps->pic_slice_level_chroma_qp_offsets_present_flag = get_bits1(gb);
-
-    pps->weighted_pred_flag   = get_bits1(gb);
-    pps->weighted_bipred_flag = get_bits1(gb);
-
-    pps->transquant_bypass_enable_flag    = get_bits1(gb);
-    pps->tiles_enabled_flag               = get_bits1(gb);
-    pps->entropy_coding_sync_enabled_flag = get_bits1(gb);
-
-    if (pps->tiles_enabled_flag) {
-        pps->num_tile_columns = get_ue_golomb_long(gb) + 1;
-        pps->num_tile_rows    = get_ue_golomb_long(gb) + 1;
-        if (pps->num_tile_columns == 0 ||
-            pps->num_tile_columns >= sps->width) {
-            av_log(s->avctx, AV_LOG_ERROR, "num_tile_columns_minus1 out of range: %d\n",
-                   pps->num_tile_columns - 1);
-            ret = AVERROR_INVALIDDATA;
-            goto err;
-        }
-        if (pps->num_tile_rows == 0 ||
-            pps->num_tile_rows >= sps->height) {
-            av_log(s->avctx, AV_LOG_ERROR, "num_tile_rows_minus1 out of range: %d\n",
-                   pps->num_tile_rows - 1);
-            ret = AVERROR_INVALIDDATA;
-            goto err;
-        }
-
-        pps->column_width = av_malloc_array(pps->num_tile_columns, sizeof(*pps->column_width));
-        pps->row_height   = av_malloc_array(pps->num_tile_rows,    sizeof(*pps->row_height));
-        if (!pps->column_width || !pps->row_height) {
-            ret = AVERROR(ENOMEM);
-            goto err;
-        }
-
-        pps->uniform_spacing_flag = get_bits1(gb);
-        if (!pps->uniform_spacing_flag) {
-            uint64_t sum = 0;
-            for (i = 0; i < pps->num_tile_columns - 1; i++) {
-                pps->column_width[i] = get_ue_golomb_long(gb) + 1;
-                sum                 += pps->column_width[i];
-            }
-            if (sum >= sps->ctb_width) {
-                av_log(s->avctx, AV_LOG_ERROR, "Invalid tile widths.\n");
-                ret = AVERROR_INVALIDDATA;
-                goto err;
-            }
-            pps->column_width[pps->num_tile_columns - 1] = sps->ctb_width - sum;
-
-            sum = 0;
-            for (i = 0; i < pps->num_tile_rows - 1; i++) {
-                pps->row_height[i] = get_ue_golomb_long(gb) + 1;
-                sum               += pps->row_height[i];
-            }
-            if (sum >= sps->ctb_height) {
-                av_log(s->avctx, AV_LOG_ERROR, "Invalid tile heights.\n");
-                ret = AVERROR_INVALIDDATA;
-                goto err;
-            }
-            pps->row_height[pps->num_tile_rows - 1] = sps->ctb_height - sum;
-        }
-        pps->loop_filter_across_tiles_enabled_flag = get_bits1(gb);
-    }
-
-    pps->seq_loop_filter_across_slices_enabled_flag = get_bits1(gb);
-
-    pps->deblocking_filter_control_present_flag = get_bits1(gb);
-    if (pps->deblocking_filter_control_present_flag) {
-        pps->deblocking_filter_override_enabled_flag = get_bits1(gb);
-        pps->disable_dbf                             = get_bits1(gb);
-        if (!pps->disable_dbf) {
-            pps->beta_offset = get_se_golomb(gb) * 2;
-            pps->tc_offset = get_se_golomb(gb) * 2;
-            if (pps->beta_offset/2 < -6 || pps->beta_offset/2 > 6) {
-                av_log(s->avctx, AV_LOG_ERROR, "pps_beta_offset_div2 out of range: %d\n",
-                       pps->beta_offset/2);
-                ret = AVERROR_INVALIDDATA;
-                goto err;
-            }
-            if (pps->tc_offset/2 < -6 || pps->tc_offset/2 > 6) {
-                av_log(s->avctx, AV_LOG_ERROR, "pps_tc_offset_div2 out of range: %d\n",
-                       pps->tc_offset/2);
-                ret = AVERROR_INVALIDDATA;
-                goto err;
-            }
-        }
-    }
-
-    pps->scaling_list_data_present_flag = get_bits1(gb);
-    if (pps->scaling_list_data_present_flag) {
-        set_default_scaling_list_data(&pps->scaling_list);
-        ret = scaling_list_data(s, &pps->scaling_list);
-        if (ret < 0)
-            goto err;
-    }
-    pps->lists_modification_present_flag = get_bits1(gb);
-    pps->log2_parallel_merge_level       = get_ue_golomb_long(gb) + 2;
-    if (pps->log2_parallel_merge_level > sps->log2_ctb_size) {
-        av_log(s->avctx, AV_LOG_ERROR, "log2_parallel_merge_level_minus2 out of range: %d\n",
-               pps->log2_parallel_merge_level - 2);
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-
-    pps->slice_header_extension_present_flag = get_bits1(gb);
-    skip_bits1(gb);     // pps_extension_flag
-
-    // Inferred parameters
-    pps->col_bd   = av_malloc_array(pps->num_tile_columns + 1, sizeof(*pps->col_bd));
-    pps->row_bd   = av_malloc_array(pps->num_tile_rows + 1,    sizeof(*pps->row_bd));
-    pps->col_idxX = av_malloc_array(sps->ctb_width,    sizeof(*pps->col_idxX));
-    if (!pps->col_bd || !pps->row_bd || !pps->col_idxX) {
-        ret = AVERROR(ENOMEM);
-        goto err;
-    }
-
-    if (pps->uniform_spacing_flag) {
-        if (!pps->column_width) {
-            pps->column_width = av_malloc_array(pps->num_tile_columns, sizeof(*pps->column_width));
-            pps->row_height   = av_malloc_array(pps->num_tile_rows,    sizeof(*pps->row_height));
-        }
-        if (!pps->column_width || !pps->row_height) {
-            ret = AVERROR(ENOMEM);
-            goto err;
-        }
-
-        for (i = 0; i < pps->num_tile_columns; i++) {
-            pps->column_width[i] = ((i + 1) * sps->ctb_width) / pps->num_tile_columns -
-                                   (i * sps->ctb_width) / pps->num_tile_columns;
-        }
-
-        for (i = 0; i < pps->num_tile_rows; i++) {
-            pps->row_height[i] = ((i + 1) * sps->ctb_height) / pps->num_tile_rows -
-                                 (i * sps->ctb_height) / pps->num_tile_rows;
-        }
-    }
-
-    pps->col_bd[0] = 0;
-    for (i = 0; i < pps->num_tile_columns; i++)
-        pps->col_bd[i + 1] = pps->col_bd[i] + pps->column_width[i];
-
-    pps->row_bd[0] = 0;
-    for (i = 0; i < pps->num_tile_rows; i++)
-        pps->row_bd[i + 1] = pps->row_bd[i] + pps->row_height[i];
-
-    for (i = 0, j = 0; i < sps->ctb_width; i++) {
-        if (i > pps->col_bd[j])
-            j++;
-        pps->col_idxX[i] = j;
-    }
-
-    /**
-     * 6.5
-     */
-    pic_area_in_ctbs     = sps->ctb_width    * sps->ctb_height;
-    pic_area_in_min_cbs  = sps->min_cb_width * sps->min_cb_height;
-    pic_area_in_min_tbs  = sps->min_tb_width * sps->min_tb_height;
-
-    pps->ctb_addr_rs_to_ts = av_malloc_array(pic_area_in_ctbs,    sizeof(*pps->ctb_addr_rs_to_ts));
-    pps->ctb_addr_ts_to_rs = av_malloc_array(pic_area_in_ctbs,    sizeof(*pps->ctb_addr_ts_to_rs));
-    pps->tile_id           = av_malloc_array(pic_area_in_ctbs,    sizeof(*pps->tile_id));
-    pps->min_cb_addr_zs    = av_malloc_array(pic_area_in_min_cbs, sizeof(*pps->min_cb_addr_zs));
-    pps->min_tb_addr_zs    = av_malloc_array(pic_area_in_min_tbs, sizeof(*pps->min_tb_addr_zs));
-    if (!pps->ctb_addr_rs_to_ts || !pps->ctb_addr_ts_to_rs ||
-        !pps->tile_id || !pps->min_cb_addr_zs || !pps->min_tb_addr_zs) {
-        ret = AVERROR(ENOMEM);
-        goto err;
-    }
-
-    for (ctb_addr_rs = 0; ctb_addr_rs < pic_area_in_ctbs; ctb_addr_rs++) {
-        int tb_x   = ctb_addr_rs % sps->ctb_width;
-        int tb_y   = ctb_addr_rs / sps->ctb_width;
-        int tile_x = 0;
-        int tile_y = 0;
-        int val    = 0;
-
-        for (i = 0; i < pps->num_tile_columns; i++) {
-            if (tb_x < pps->col_bd[i + 1]) {
-                tile_x = i;
-                break;
-            }
-        }
-
-        for (i = 0; i < pps->num_tile_rows; i++) {
-            if (tb_y < pps->row_bd[i + 1]) {
-                tile_y = i;
-                break;
-            }
-        }
-
-        for (i = 0; i < tile_x; i++)
-            val += pps->row_height[tile_y] * pps->column_width[i];
-        for (i = 0; i < tile_y; i++)
-            val += sps->ctb_width * pps->row_height[i];
-
-        val += (tb_y - pps->row_bd[tile_y]) * pps->column_width[tile_x] +
-               tb_x - pps->col_bd[tile_x];
-
-        pps->ctb_addr_rs_to_ts[ctb_addr_rs] = val;
-        pps->ctb_addr_ts_to_rs[val]         = ctb_addr_rs;
-    }
-
-    for (j = 0, tile_id = 0; j < pps->num_tile_rows; j++)
-        for (i = 0; i < pps->num_tile_columns; i++, tile_id++)
-            for (y = pps->row_bd[j]; y < pps->row_bd[j + 1]; y++)
-                for (x = pps->col_bd[i]; x < pps->col_bd[i + 1]; x++)
-                    pps->tile_id[pps->ctb_addr_rs_to_ts[y * sps->ctb_width + x]] = tile_id;
-
-    pps->tile_pos_rs = av_malloc_array(tile_id, sizeof(*pps->tile_pos_rs));
-    if (!pps->tile_pos_rs) {
-        ret = AVERROR(ENOMEM);
-        goto err;
-    }
-
-    for (j = 0; j < pps->num_tile_rows; j++)
-        for (i = 0; i < pps->num_tile_columns; i++)
-            pps->tile_pos_rs[j * pps->num_tile_columns + i] = pps->row_bd[j] * sps->ctb_width + pps->col_bd[i];
-
-    for (y = 0; y < sps->min_cb_height; y++) {
-        for (x = 0; x < sps->min_cb_width; x++) {
-            int tb_x        = x >> sps->log2_diff_max_min_coding_block_size;
-            int tb_y        = y >> sps->log2_diff_max_min_coding_block_size;
-            int ctb_addr_rs = sps->ctb_width * tb_y + tb_x;
-            int val         = pps->ctb_addr_rs_to_ts[ctb_addr_rs] <<
-                              (sps->log2_diff_max_min_coding_block_size * 2);
-            for (i = 0; i < sps->log2_diff_max_min_coding_block_size; i++) {
-                int m = 1 << i;
-                val += (m & x ? m * m : 0) + (m & y ? 2 * m * m : 0);
-            }
-            pps->min_cb_addr_zs[y * sps->min_cb_width + x] = val;
-        }
-    }
-
-    log2_diff_ctb_min_tb_size = sps->log2_ctb_size - sps->log2_min_tb_size;
-    for (y = 0; y < sps->min_tb_height; y++) {
-        for (x = 0; x < sps->min_tb_width; x++) {
-            int tb_x        = x >> log2_diff_ctb_min_tb_size;
-            int tb_y        = y >> log2_diff_ctb_min_tb_size;
-            int ctb_addr_rs = sps->ctb_width * tb_y + tb_x;
-            int val         = pps->ctb_addr_rs_to_ts[ctb_addr_rs] <<
-                              (log2_diff_ctb_min_tb_size * 2);
-            for (i = 0; i < log2_diff_ctb_min_tb_size; i++) {
-                int m = 1 << i;
-                val += (m & x ? m * m : 0) + (m & y ? 2 * m * m : 0);
-            }
-            pps->min_tb_addr_zs[y * sps->min_tb_width + x] = val;
-        }
-    }
-
-    av_buffer_unref(&s->pps_list[pps_id]);
-    s->pps_list[pps_id] = pps_buf;
-
-    return 0;
-
-err:
-    av_buffer_unref(&pps_buf);
-    return ret;
-}
diff --git a/deps/libav/libavcodec/hevc_refs.c b/deps/libav/libavcodec/hevc_refs.c
deleted file mode 100644
index 2fbe9e7..0000000
--- a/deps/libav/libavcodec/hevc_refs.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- * Copyright (C) 2012 - 2013 Gildas Cocherel
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/pixdesc.h"
-
-#include "internal.h"
-#include "thread.h"
-#include "hevc.h"
-
-void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags)
-{
-    /* frame->frame can be NULL if context init failed */
-    if (!frame->frame || !frame->frame->buf[0])
-        return;
-
-    frame->flags &= ~flags;
-    if (!frame->flags) {
-        ff_thread_release_buffer(s->avctx, &frame->tf);
-
-        av_buffer_unref(&frame->tab_mvf_buf);
-        frame->tab_mvf = NULL;
-
-        av_buffer_unref(&frame->rpl_buf);
-        av_buffer_unref(&frame->rpl_tab_buf);
-        frame->rpl_tab    = NULL;
-        frame->refPicList = NULL;
-
-        frame->collocated_ref = NULL;
-    }
-}
-
-RefPicList *ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *ref, int x0, int y0)
-{
-    if (x0 < 0 || y0 < 0) {
-        return s->ref->refPicList;
-    } else {
-        int x_cb         = x0 >> s->sps->log2_ctb_size;
-        int y_cb         = y0 >> s->sps->log2_ctb_size;
-        int pic_width_cb = (s->sps->width + (1 << s->sps->log2_ctb_size) - 1) >>
-                           s->sps->log2_ctb_size;
-        int ctb_addr_ts  = s->pps->ctb_addr_rs_to_ts[y_cb * pic_width_cb + x_cb];
-        return (RefPicList *)ref->rpl_tab[ctb_addr_ts];
-    }
-}
-
-void ff_hevc_clear_refs(HEVCContext *s)
-{
-    int i;
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++)
-        ff_hevc_unref_frame(s, &s->DPB[i],
-                            HEVC_FRAME_FLAG_SHORT_REF |
-                            HEVC_FRAME_FLAG_LONG_REF);
-}
-
-void ff_hevc_flush_dpb(HEVCContext *s)
-{
-    int i;
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++)
-        ff_hevc_unref_frame(s, &s->DPB[i], ~0);
-}
-
-static HEVCFrame *alloc_frame(HEVCContext *s)
-{
-    int i, j, ret;
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
-        HEVCFrame *frame = &s->DPB[i];
-        if (frame->frame->buf[0])
-            continue;
-
-        ret = ff_thread_get_buffer(s->avctx, &frame->tf,
-                                   AV_GET_BUFFER_FLAG_REF);
-        if (ret < 0)
-            return NULL;
-
-        frame->rpl_buf = av_buffer_allocz(s->nb_nals * sizeof(RefPicListTab));
-        if (!frame->rpl_buf)
-            goto fail;
-
-        frame->tab_mvf_buf = av_buffer_pool_get(s->tab_mvf_pool);
-        if (!frame->tab_mvf_buf)
-            goto fail;
-        frame->tab_mvf = (MvField *)frame->tab_mvf_buf->data;
-
-        frame->rpl_tab_buf = av_buffer_pool_get(s->rpl_tab_pool);
-        if (!frame->rpl_tab_buf)
-            goto fail;
-        frame->rpl_tab   = (RefPicListTab **)frame->rpl_tab_buf->data;
-        frame->ctb_count = s->sps->ctb_width * s->sps->ctb_height;
-        for (j = 0; j < frame->ctb_count; j++)
-            frame->rpl_tab[j] = (RefPicListTab *)frame->rpl_buf->data;
-
-        return frame;
-
-fail:
-        ff_hevc_unref_frame(s, frame, ~0);
-        return NULL;
-    }
-    av_log(s->avctx, AV_LOG_ERROR, "Error allocating frame, DPB full.\n");
-    return NULL;
-}
-
-int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
-{
-    HEVCFrame *ref;
-    int i;
-
-    /* check that this POC doesn't already exist */
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
-        HEVCFrame *frame = &s->DPB[i];
-
-        if (frame->frame->buf[0] && frame->sequence == s->seq_decode &&
-            frame->poc == poc) {
-            av_log(s->avctx, AV_LOG_ERROR, "Duplicate POC in a sequence: %d.\n",
-                   poc);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    ref = alloc_frame(s);
-    if (!ref)
-        return AVERROR(ENOMEM);
-
-    *frame = ref->frame;
-    s->ref = ref;
-
-    ref->poc      = poc;
-    ref->flags    = HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_SHORT_REF;
-    ref->sequence = s->seq_decode;
-    ref->window   = s->sps->output_window;
-
-    return 0;
-}
-
-int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
-{
-    do {
-        int nb_output = 0;
-        int min_poc   = INT_MAX;
-        int i, min_idx, ret;
-
-        for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
-            HEVCFrame *frame = &s->DPB[i];
-            if ((frame->flags & HEVC_FRAME_FLAG_OUTPUT) &&
-                frame->sequence == s->seq_output) {
-                nb_output++;
-                if (frame->poc < min_poc) {
-                    min_poc = frame->poc;
-                    min_idx = i;
-                }
-            }
-        }
-
-        /* wait for more frames before output */
-        if (!flush && s->seq_output == s->seq_decode && s->sps &&
-            nb_output <= s->sps->temporal_layer[s->sps->max_sub_layers - 1].num_reorder_pics)
-            return 0;
-
-        if (nb_output) {
-            HEVCFrame *frame = &s->DPB[min_idx];
-            const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->frame->format);
-            int pixel_shift;
-
-            if (!desc)
-                return AVERROR_BUG;
-
-            pixel_shift = desc->comp[0].depth_minus1 > 7;
-
-            ret = av_frame_ref(out, frame->frame);
-            ff_hevc_unref_frame(s, frame, HEVC_FRAME_FLAG_OUTPUT);
-            if (ret < 0)
-                return ret;
-
-            for (i = 0; i < 3; i++) {
-                int hshift = (i > 0) ? desc->log2_chroma_w : 0;
-                int vshift = (i > 0) ? desc->log2_chroma_h : 0;
-                int off = ((frame->window.left_offset >> hshift) << pixel_shift) +
-                          (frame->window.top_offset   >> vshift) * out->linesize[i];
-                out->data[i] += off;
-            }
-            av_log(s->avctx, AV_LOG_DEBUG,
-                   "Output frame with POC %d.\n", frame->poc);
-            return 1;
-        }
-
-        if (s->seq_output != s->seq_decode)
-            s->seq_output = (s->seq_output + 1) & 0xff;
-        else
-            break;
-    } while (1);
-
-    return 0;
-}
-
-static int init_slice_rpl(HEVCContext *s)
-{
-    HEVCFrame *frame = s->ref;
-    int ctb_count    = frame->ctb_count;
-    int ctb_addr_ts  = s->pps->ctb_addr_rs_to_ts[s->sh.slice_segment_addr];
-    int i;
-
-    if (s->slice_idx >= frame->rpl_buf->size / sizeof(RefPicListTab))
-        return AVERROR_INVALIDDATA;
-
-    for (i = ctb_addr_ts; i < ctb_count; i++)
-        frame->rpl_tab[i] = (RefPicListTab *)frame->rpl_buf->data + s->slice_idx;
-
-    frame->refPicList = (RefPicList *)frame->rpl_tab[ctb_addr_ts];
-
-    return 0;
-}
-
-int ff_hevc_slice_rpl(HEVCContext *s)
-{
-    SliceHeader *sh = &s->sh;
-
-    uint8_t nb_list = sh->slice_type == B_SLICE ? 2 : 1;
-    uint8_t list_idx;
-    int i, j, ret;
-
-    ret = init_slice_rpl(s);
-    if (ret < 0)
-        return ret;
-
-    if (!(s->rps[ST_CURR_BEF].nb_refs + s->rps[ST_CURR_AFT].nb_refs +
-          s->rps[LT_CURR].nb_refs)) {
-        av_log(s->avctx, AV_LOG_ERROR, "Zero refs in the frame RPS.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (list_idx = 0; list_idx < nb_list; list_idx++) {
-        RefPicList  rpl_tmp = { { 0 } };
-        RefPicList *rpl     = &s->ref->refPicList[list_idx];
-
-        /* The order of the elements is
-         * ST_CURR_BEF - ST_CURR_AFT - LT_CURR for the L0 and
-         * ST_CURR_AFT - ST_CURR_BEF - LT_CURR for the L1 */
-        int cand_lists[3] = { list_idx ? ST_CURR_AFT : ST_CURR_BEF,
-                              list_idx ? ST_CURR_BEF : ST_CURR_AFT,
-                              LT_CURR };
-
-        /* concatenate the candidate lists for the current frame */
-        while (rpl_tmp.nb_refs < sh->nb_refs[list_idx]) {
-            for (i = 0; i < FF_ARRAY_ELEMS(cand_lists); i++) {
-                RefPicList *rps = &s->rps[cand_lists[i]];
-                for (j = 0; j < rps->nb_refs && rpl_tmp.nb_refs < MAX_REFS; j++) {
-                    rpl_tmp.list[rpl_tmp.nb_refs]       = rps->list[j];
-                    rpl_tmp.ref[rpl_tmp.nb_refs]        = rps->ref[j];
-                    rpl_tmp.isLongTerm[rpl_tmp.nb_refs] = i == 2;
-                    rpl_tmp.nb_refs++;
-                }
-            }
-        }
-
-        /* reorder the references if necessary */
-        if (sh->rpl_modification_flag[list_idx]) {
-            for (i = 0; i < sh->nb_refs[list_idx]; i++) {
-                int idx = sh->list_entry_lx[list_idx][i];
-
-                if (idx >= rpl_tmp.nb_refs) {
-                    av_log(s->avctx, AV_LOG_ERROR, "Invalid reference index.\n");
-                    return AVERROR_INVALIDDATA;
-                }
-
-                rpl->list[i]       = rpl_tmp.list[idx];
-                rpl->ref[i]        = rpl_tmp.ref[idx];
-                rpl->isLongTerm[i] = rpl_tmp.isLongTerm[idx];
-                rpl->nb_refs++;
-            }
-        } else {
-            memcpy(rpl, &rpl_tmp, sizeof(*rpl));
-            rpl->nb_refs = FFMIN(rpl->nb_refs, sh->nb_refs[list_idx]);
-        }
-
-        if (sh->collocated_list == list_idx &&
-            sh->collocated_ref_idx < rpl->nb_refs)
-            s->ref->collocated_ref = rpl->ref[sh->collocated_ref_idx];
-    }
-
-    return 0;
-}
-
-static HEVCFrame *find_ref_idx(HEVCContext *s, int poc)
-{
-    int i;
-    int LtMask = (1 << s->sps->log2_max_poc_lsb) - 1;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
-        HEVCFrame *ref = &s->DPB[i];
-        if (ref->frame->buf[0] && (ref->sequence == s->seq_decode)) {
-            if ((ref->poc & LtMask) == poc)
-                return ref;
-        }
-    }
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
-        HEVCFrame *ref = &s->DPB[i];
-        if (ref->frame->buf[0] && ref->sequence == s->seq_decode) {
-            if (ref->poc == poc || (ref->poc & LtMask) == poc)
-                return ref;
-        }
-    }
-
-    av_log(s->avctx, AV_LOG_ERROR,
-           "Could not find ref with POC %d\n", poc);
-    return NULL;
-}
-
-static void mark_ref(HEVCFrame *frame, int flag)
-{
-    frame->flags &= ~(HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF);
-    frame->flags |= flag;
-}
-
-static HEVCFrame *generate_missing_ref(HEVCContext *s, int poc)
-{
-    HEVCFrame *frame;
-    int i, x, y;
-
-    frame = alloc_frame(s);
-    if (!frame)
-        return NULL;
-
-    if (!s->sps->pixel_shift) {
-        for (i = 0; frame->frame->buf[i]; i++)
-            memset(frame->frame->buf[i]->data, 1 << (s->sps->bit_depth - 1),
-                   frame->frame->buf[i]->size);
-    } else {
-        for (i = 0; frame->frame->data[i]; i++)
-            for (y = 0; y < (s->sps->height >> s->sps->vshift[i]); y++)
-                for (x = 0; x < (s->sps->width >> s->sps->hshift[i]); x++) {
-                    AV_WN16(frame->frame->data[i] + y * frame->frame->linesize[i] + 2 * x,
-                            1 << (s->sps->bit_depth - 1));
-                }
-    }
-
-    frame->poc      = poc;
-    frame->sequence = s->seq_decode;
-    frame->flags    = 0;
-
-    ff_thread_report_progress(&frame->tf, INT_MAX, 0);
-
-    return frame;
-}
-
-/* add a reference with the given poc to the list and mark it as used in DPB */
-static int add_candidate_ref(HEVCContext *s, RefPicList *list,
-                             int poc, int ref_flag)
-{
-    HEVCFrame *ref = find_ref_idx(s, poc);
-
-    if (ref == s->ref)
-        return AVERROR_INVALIDDATA;
-
-    if (!ref) {
-        ref = generate_missing_ref(s, poc);
-        if (!ref)
-            return AVERROR(ENOMEM);
-    }
-
-    list->list[list->nb_refs] = ref->poc;
-    list->ref[list->nb_refs]  = ref;
-    list->nb_refs++;
-
-    mark_ref(ref, ref_flag);
-    return 0;
-}
-
-int ff_hevc_frame_rps(HEVCContext *s)
-{
-    const ShortTermRPS *short_rps = s->sh.short_term_rps;
-    const LongTermRPS  *long_rps  = &s->sh.long_term_rps;
-    RefPicList               *rps = s->rps;
-    int i, ret;
-
-    if (!short_rps) {
-        rps[0].nb_refs = rps[1].nb_refs = 0;
-        return 0;
-    }
-
-    /* clear the reference flags on all frames except the current one */
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
-        HEVCFrame *frame = &s->DPB[i];
-
-        if (frame == s->ref)
-            continue;
-
-        mark_ref(frame, 0);
-    }
-
-    for (i = 0; i < NB_RPS_TYPE; i++)
-        rps[i].nb_refs = 0;
-
-    /* add the short refs */
-    for (i = 0; i < short_rps->num_delta_pocs; i++) {
-        int poc = s->poc + short_rps->delta_poc[i];
-        int list;
-
-        if (!short_rps->used[i])
-            list = ST_FOLL;
-        else if (i < short_rps->num_negative_pics)
-            list = ST_CURR_BEF;
-        else
-            list = ST_CURR_AFT;
-
-        ret = add_candidate_ref(s, &rps[list], poc, HEVC_FRAME_FLAG_SHORT_REF);
-        if (ret < 0)
-            return ret;
-    }
-
-    /* add the long refs */
-    for (i = 0; i < long_rps->nb_refs; i++) {
-        int poc  = long_rps->poc[i];
-        int list = long_rps->used[i] ? LT_CURR : LT_FOLL;
-
-        ret = add_candidate_ref(s, &rps[list], poc, HEVC_FRAME_FLAG_LONG_REF);
-        if (ret < 0)
-            return ret;
-    }
-
-    /* release any frames that are now unused */
-    for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++)
-        ff_hevc_unref_frame(s, &s->DPB[i], 0);
-
-    return 0;
-}
-
-int ff_hevc_compute_poc(HEVCContext *s, int poc_lsb)
-{
-    int max_poc_lsb  = 1 << s->sps->log2_max_poc_lsb;
-    int prev_poc_lsb = s->pocTid0 % max_poc_lsb;
-    int prev_poc_msb = s->pocTid0 - prev_poc_lsb;
-    int poc_msb;
-
-    if (poc_lsb < prev_poc_lsb && prev_poc_lsb - poc_lsb >= max_poc_lsb / 2)
-        poc_msb = prev_poc_msb + max_poc_lsb;
-    else if (poc_lsb > prev_poc_lsb && poc_lsb - prev_poc_lsb > max_poc_lsb / 2)
-        poc_msb = prev_poc_msb - max_poc_lsb;
-    else
-        poc_msb = prev_poc_msb;
-
-    // For BLA picture types, POCmsb is set to 0.
-    if (s->nal_unit_type == NAL_BLA_W_LP   ||
-        s->nal_unit_type == NAL_BLA_W_RADL ||
-        s->nal_unit_type == NAL_BLA_N_LP)
-        poc_msb = 0;
-
-    return poc_msb + poc_lsb;
-}
-
-int ff_hevc_frame_nb_refs(HEVCContext *s)
-{
-    int ret = 0;
-    int i;
-    const ShortTermRPS *rps = s->sh.short_term_rps;
-    LongTermRPS *long_rps   = &s->sh.long_term_rps;
-
-    if (rps) {
-        for (i = 0; i < rps->num_negative_pics; i++)
-            ret += !!rps->used[i];
-        for (; i < rps->num_delta_pocs; i++)
-            ret += !!rps->used[i];
-    }
-
-    if (long_rps) {
-        for (i = 0; i < long_rps->nb_refs; i++)
-            ret += !!long_rps->used[i];
-    }
-    return ret;
-}
diff --git a/deps/libav/libavcodec/hevc_sei.c b/deps/libav/libavcodec/hevc_sei.c
deleted file mode 100644
index b011596..0000000
--- a/deps/libav/libavcodec/hevc_sei.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * HEVC Supplementary Enhancement Information messages
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- * Copyright (C) 2012 - 2013 Gildas Cocherel
- * Copyright (C) 2013 Vittorio Giovara
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "golomb.h"
-#include "hevc.h"
-
-static void decode_nal_sei_decoded_picture_hash(HEVCContext *s)
-{
-    int cIdx, i;
-    GetBitContext *gb = &s->HEVClc.gb;
-    uint8_t hash_type = get_bits(gb, 8);
-
-    for (cIdx = 0; cIdx < 3; cIdx++) {
-        if (hash_type == 0) {
-            s->is_md5 = 1;
-            for (i = 0; i < 16; i++)
-                s->md5[cIdx][i] = get_bits(gb, 8);
-        } else if (hash_type == 1) {
-            // picture_crc = get_bits(gb, 16);
-            skip_bits(gb, 16);
-        } else if (hash_type == 2) {
-            // picture_checksum = get_bits(gb, 32);
-            skip_bits(gb, 32);
-        }
-    }
-}
-
-static void decode_nal_sei_frame_packing_arrangement(HEVCContext *s)
-{
-    GetBitContext *gb = &s->HEVClc.gb;
-
-    get_ue_golomb(gb);                  // frame_packing_arrangement_id
-    s->sei_frame_packing_present = !get_bits1(gb);
-
-    if (s->sei_frame_packing_present) {
-        s->frame_packing_arrangement_type = get_bits(gb, 7);
-        s->quincunx_subsampling           = get_bits1(gb);
-        s->content_interpretation_type    = get_bits(gb, 6);
-
-        // the following skips spatial_flipping_flag frame0_flipped_flag
-        // field_views_flag current_frame_is_frame0_flag
-        // frame0_self_contained_flag frame1_self_contained_flag
-        skip_bits(gb, 6);
-
-        if (!s->quincunx_subsampling && s->frame_packing_arrangement_type != 5)
-            skip_bits(gb, 16);  // frame[01]_grid_position_[xy]
-        skip_bits(gb, 8);       // frame_packing_arrangement_reserved_byte
-        skip_bits1(gb);         // frame_packing_arrangement_persistance_flag
-    }
-    skip_bits1(gb);             // upsampled_aspect_ratio_flag
-}
-
-static int decode_nal_sei_message(HEVCContext *s)
-{
-    GetBitContext *gb = &s->HEVClc.gb;
-
-    int payload_type = 0;
-    int payload_size = 0;
-    int byte = 0xFF;
-    av_log(s->avctx, AV_LOG_DEBUG, "Decoding SEI\n");
-
-    while (byte == 0xFF) {
-        byte          = get_bits(gb, 8);
-        payload_type += byte;
-    }
-    byte = 0xFF;
-    while (byte == 0xFF) {
-        byte          = get_bits(gb, 8);
-        payload_size += byte;
-    }
-    if (s->nal_unit_type == NAL_SEI_PREFIX) {
-        if (payload_type == 256)
-            decode_nal_sei_decoded_picture_hash(s);
-        else if (payload_type == 45)
-            decode_nal_sei_frame_packing_arrangement(s);
-        else {
-            av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", payload_type);
-            skip_bits(gb, 8 * payload_size);
-        }
-    } else { /* nal_unit_type == NAL_SEI_SUFFIX */
-        if (payload_type == 132)
-            decode_nal_sei_decoded_picture_hash(s);
-        else {
-            av_log(s->avctx, AV_LOG_DEBUG, "Skipped SUFFIX SEI %d\n", payload_type);
-            skip_bits(gb, 8 * payload_size);
-        }
-    }
-    return 0;
-}
-
-static int more_rbsp_data(GetBitContext *gb)
-{
-    return get_bits_left(gb) > 0 && show_bits(gb, 8) != 0x80;
-}
-
-int ff_hevc_decode_nal_sei(HEVCContext *s)
-{
-    do {
-        decode_nal_sei_message(s);
-    } while (more_rbsp_data(&s->HEVClc.gb));
-    return 0;
-}
diff --git a/deps/libav/libavcodec/hevcdsp.c b/deps/libav/libavcodec/hevcdsp.c
deleted file mode 100644
index de8c3d2..0000000
--- a/deps/libav/libavcodec/hevcdsp.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "hevcdsp.h"
-
-static const int8_t transform[32][32] = {
-    { 64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,
-      64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64 },
-    { 90,  90,  88,  85,  82,  78,  73,  67,  61,  54,  46,  38,  31,  22,  13,   4,
-      -4, -13, -22, -31, -38, -46, -54, -61, -67, -73, -78, -82, -85, -88, -90, -90 },
-    { 90,  87,  80,  70,  57,  43,  25,   9,  -9, -25, -43, -57, -70, -80, -87, -90,
-     -90, -87, -80, -70, -57, -43, -25,  -9,   9,  25,  43,  57,  70,  80,  87,  90 },
-    { 90,  82,  67,  46,  22,  -4, -31, -54, -73, -85, -90, -88, -78, -61, -38, -13,
-      13,  38,  61,  78,  88,  90,  85,  73,  54,  31,   4, -22, -46, -67, -82, -90 },
-    { 89,  75,  50,  18, -18, -50, -75, -89, -89, -75, -50, -18,  18,  50,  75,  89,
-      89,  75,  50,  18, -18, -50, -75, -89, -89, -75, -50, -18,  18,  50,  75,  89 },
-    { 88,  67,  31, -13, -54, -82, -90, -78, -46, -4,   38,  73,  90,  85,  61,  22,
-     -22, -61, -85, -90, -73, -38,   4,  46,  78,  90,  82,  54,  13, -31, -67, -88 },
-    { 87,  57,   9, -43, -80, -90, -70, -25,  25,  70,  90,  80,  43,  -9, -57, -87,
-     -87, -57,  -9,  43,  80,  90,  70,  25, -25, -70, -90, -80, -43,   9,  57,  87 },
-    { 85,  46, -13, -67, -90, -73, -22,  38,  82,  88,  54,  -4, -61, -90, -78, -31,
-      31,  78,  90,  61,   4, -54, -88, -82, -38,  22,  73,  90,  67,  13, -46, -85 },
-    { 83,  36, -36, -83, -83, -36,  36,  83,  83,  36, -36, -83, -83, -36,  36,  83,
-      83,  36, -36, -83, -83, -36,  36,  83,  83,  36, -36, -83, -83, -36,  36,  83 },
-    { 82,  22, -54, -90, -61,  13,  78,  85,  31, -46, -90, -67,   4,  73,  88,  38,
-     -38, -88, -73,  -4,  67,  90,  46, -31, -85, -78, -13,  61,  90,  54, -22, -82 },
-    { 80,   9, -70, -87, -25,  57,  90,  43, -43, -90, -57,  25,  87,  70,  -9, -80,
-     -80,  -9,  70,  87,  25, -57, -90, -43,  43,  90,  57, -25, -87, -70,   9,  80 },
-    { 78,  -4, -82, -73,  13,  85,  67, -22, -88, -61,  31,  90,  54, -38, -90, -46,
-      46,  90,  38, -54, -90, -31,  61,  88,  22, -67, -85, -13,  73,  82,   4, -78 },
-    { 75, -18, -89, -50,  50,  89,  18, -75, -75,  18,  89,  50, -50, -89, -18,  75,
-      75, -18, -89, -50,  50,  89,  18, -75, -75,  18,  89,  50, -50, -89, -18,  75 },
-    { 73, -31, -90, -22,  78,  67, -38, -90, -13,  82,  61, -46, -88,  -4,  85,  54,
-     -54, -85,   4,  88,  46, -61, -82,  13,  90,  38, -67, -78,  22,  90,  31, -73 },
-    { 70, -43, -87,   9,  90,  25, -80, -57,  57,  80, -25, -90,  -9,  87,  43, -70,
-     -70,  43,  87,  -9, -90, -25,  80,  57, -57, -80,  25,  90,   9, -87, -43,  70 },
-    { 67, -54, -78,  38,  85, -22, -90,   4,  90,  13, -88, -31,  82,  46, -73, -61,
-      61,  73, -46, -82,  31,  88, -13, -90,  -4,  90,  22, -85, -38,  78,  54, -67 },
-    { 64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,
-      64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64 },
-    { 61, -73, -46,  82,  31, -88, -13,  90,  -4, -90,  22,  85, -38, -78,  54,  67,
-     -67, -54,  78,  38, -85, -22,  90,   4, -90,  13,  88, -31, -82,  46,  73, -61 },
-    { 57, -80, -25,  90,  -9, -87,  43,  70, -70, -43,  87,   9, -90,  25,  80, -57,
-     -57,  80,  25, -90,   9,  87, -43, -70,  70,  43, -87,  -9,  90, -25, -80,  57 },
-    { 54, -85,  -4,  88, -46, -61,  82,  13, -90,  38,  67, -78, -22,  90, -31, -73,
-      73,  31, -90,  22,  78, -67, -38,  90, -13, -82,  61,  46, -88,   4,  85, -54 },
-    { 50, -89,  18,  75, -75, -18,  89, -50, -50,  89, -18, -75,  75,  18, -89,  50,
-      50, -89,  18,  75, -75, -18,  89, -50, -50,  89, -18, -75,  75,  18, -89,  50 },
-    { 46, -90,  38,  54, -90,  31,  61, -88,  22,  67, -85,  13,  73, -82,   4,  78,
-     -78,  -4,  82, -73, -13,  85, -67, -22,  88, -61, -31,  90, -54, -38,  90, -46 },
-    { 43, -90,  57,  25, -87,  70,   9, -80,  80,  -9, -70,  87, -25, -57,  90, -43,
-     -43,  90, -57, -25,  87, -70,  -9,  80, -80,   9,  70, -87,  25,  57, -90,  43 },
-    { 38, -88,  73,  -4, -67,  90, -46, -31,  85, -78,  13,  61, -90,  54,  22, -82,
-      82, -22, -54,  90, -61, -13,  78, -85,  31,  46, -90,  67,   4, -73,  88, -38 },
-    { 36, -83,  83, -36, -36,  83, -83,  36,  36, -83,  83, -36, -36,  83, -83,  36,
-      36, -83,  83, -36, -36,  83, -83,  36,  36, -83,  83, -36, -36,  83, -83,  36 },
-    { 31, -78,  90, -61,   4,  54, -88,  82, -38, -22,  73, -90,  67, -13, -46,  85,
-     -85,  46,  13, -67,  90, -73,  22,  38, -82,  88, -54,  -4,  61, -90,  78, -31 },
-    { 25, -70,  90, -80,  43,   9, -57,  87, -87,  57,  -9, -43,  80, -90,  70, -25,
-     -25,  70, -90,  80, -43,  -9,  57, -87,  87, -57,   9,  43, -80,  90, -70,  25 },
-    { 22, -61,  85, -90,  73, -38,  -4,  46, -78,  90, -82,  54, -13, -31,  67, -88,
-      88, -67,  31,  13, -54,  82, -90,  78, -46,   4,  38, -73,  90, -85,  61, -22 },
-    { 18, -50,  75, -89,  89, -75,  50, -18, -18,  50, -75,  89, -89,  75, -50,  18,
-      18, -50,  75, -89,  89, -75,  50, -18, -18,  50, -75,  89, -89,  75, -50,  18 },
-    { 13, -38,  61, -78,  88, -90,  85, -73,  54, -31,   4,  22, -46,  67, -82,  90,
-     -90,  82, -67,  46, -22,  -4,  31, -54,  73, -85,  90, -88,  78, -61,  38, -13 },
-    {  9, -25,  43, -57,  70, -80,  87, -90,  90, -87,  80, -70,  57, -43,  25, -9,
-      -9,  25, -43,  57, -70,  80, -87,  90, -90,  87, -80,  70, -57,  43, -25,   9 },
-    {  4, -13,  22, -31,  38, -46,  54, -61,  67, -73,  78, -82,  85, -88,  90, -90,
-      90, -90,  88, -85,  82, -78,  73, -67,  61, -54,  46, -38,  31, -22,  13,  -4 },
-};
-
-DECLARE_ALIGNED(16, const int8_t, ff_hevc_epel_filters[7][16]) = {
-    { -2, 58, 10, -2, -2, 58, 10, -2, -2, 58, 10, -2, -2, 58, 10, -2 },
-    { -4, 54, 16, -2, -4, 54, 16, -2, -4, 54, 16, -2, -4, 54, 16, -2 },
-    { -6, 46, 28, -4, -6, 46, 28, -4, -6, 46, 28, -4, -6, 46, 28, -4 },
-    { -4, 36, 36, -4, -4, 36, 36, -4, -4, 36, 36, -4, -4, 36, 36, -4 },
-    { -4, 28, 46, -6, -4, 28, 46, -6, -4, 28, 46, -6, -4, 28, 46, -6 },
-    { -2, 16, 54, -4, -2, 16, 54, -4, -2, 16, 54, -4, -2, 16, 54, -4 },
-    { -2, 10, 58, -2, -2, 10, 58, -2, -2, 10, 58, -2, -2, 10, 58, -2 },
-};
-
-#define BIT_DEPTH 8
-#include "hevcdsp_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 9
-#include "hevcdsp_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "hevcdsp_template.c"
-#undef BIT_DEPTH
-
-void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
-{
-#undef FUNC
-#define FUNC(a, depth) a ## _ ## depth
-
-#define HEVC_DSP(depth)                                                     \
-    hevcdsp->put_pcm                = FUNC(put_pcm, depth);                 \
-    hevcdsp->transquant_bypass[0]   = FUNC(transquant_bypass4x4, depth);    \
-    hevcdsp->transquant_bypass[1]   = FUNC(transquant_bypass8x8, depth);    \
-    hevcdsp->transquant_bypass[2]   = FUNC(transquant_bypass16x16, depth);  \
-    hevcdsp->transquant_bypass[3]   = FUNC(transquant_bypass32x32, depth);  \
-    hevcdsp->transform_skip         = FUNC(transform_skip, depth);          \
-    hevcdsp->transform_4x4_luma_add = FUNC(transform_4x4_luma_add, depth);  \
-    hevcdsp->transform_add[0]       = FUNC(transform_4x4_add, depth);       \
-    hevcdsp->transform_add[1]       = FUNC(transform_8x8_add, depth);       \
-    hevcdsp->transform_add[2]       = FUNC(transform_16x16_add, depth);     \
-    hevcdsp->transform_add[3]       = FUNC(transform_32x32_add, depth);     \
-                                                                            \
-    hevcdsp->sao_band_filter[0] = FUNC(sao_band_filter_0, depth);           \
-    hevcdsp->sao_band_filter[1] = FUNC(sao_band_filter_1, depth);           \
-    hevcdsp->sao_band_filter[2] = FUNC(sao_band_filter_2, depth);           \
-    hevcdsp->sao_band_filter[3] = FUNC(sao_band_filter_3, depth);           \
-                                                                            \
-    hevcdsp->sao_edge_filter[0] = FUNC(sao_edge_filter_0, depth);           \
-    hevcdsp->sao_edge_filter[1] = FUNC(sao_edge_filter_1, depth);           \
-    hevcdsp->sao_edge_filter[2] = FUNC(sao_edge_filter_2, depth);           \
-    hevcdsp->sao_edge_filter[3] = FUNC(sao_edge_filter_3, depth);           \
-                                                                            \
-    hevcdsp->put_hevc_qpel[0][0] = FUNC(put_hevc_qpel_pixels, depth);       \
-    hevcdsp->put_hevc_qpel[0][1] = FUNC(put_hevc_qpel_h1, depth);           \
-    hevcdsp->put_hevc_qpel[0][2] = FUNC(put_hevc_qpel_h2, depth);           \
-    hevcdsp->put_hevc_qpel[0][3] = FUNC(put_hevc_qpel_h3, depth);           \
-    hevcdsp->put_hevc_qpel[1][0] = FUNC(put_hevc_qpel_v1, depth);           \
-    hevcdsp->put_hevc_qpel[1][1] = FUNC(put_hevc_qpel_h1v1, depth);         \
-    hevcdsp->put_hevc_qpel[1][2] = FUNC(put_hevc_qpel_h2v1, depth);         \
-    hevcdsp->put_hevc_qpel[1][3] = FUNC(put_hevc_qpel_h3v1, depth);         \
-    hevcdsp->put_hevc_qpel[2][0] = FUNC(put_hevc_qpel_v2, depth);           \
-    hevcdsp->put_hevc_qpel[2][1] = FUNC(put_hevc_qpel_h1v2, depth);         \
-    hevcdsp->put_hevc_qpel[2][2] = FUNC(put_hevc_qpel_h2v2, depth);         \
-    hevcdsp->put_hevc_qpel[2][3] = FUNC(put_hevc_qpel_h3v2, depth);         \
-    hevcdsp->put_hevc_qpel[3][0] = FUNC(put_hevc_qpel_v3, depth);           \
-    hevcdsp->put_hevc_qpel[3][1] = FUNC(put_hevc_qpel_h1v3, depth);         \
-    hevcdsp->put_hevc_qpel[3][2] = FUNC(put_hevc_qpel_h2v3, depth);         \
-    hevcdsp->put_hevc_qpel[3][3] = FUNC(put_hevc_qpel_h3v3, depth);         \
-                                                                            \
-    hevcdsp->put_hevc_epel[0][0] = FUNC(put_hevc_epel_pixels, depth);       \
-    hevcdsp->put_hevc_epel[0][1] = FUNC(put_hevc_epel_h, depth);            \
-    hevcdsp->put_hevc_epel[1][0] = FUNC(put_hevc_epel_v, depth);            \
-    hevcdsp->put_hevc_epel[1][1] = FUNC(put_hevc_epel_hv, depth);           \
-                                                                            \
-    hevcdsp->put_unweighted_pred   = FUNC(put_unweighted_pred, depth);      \
-    hevcdsp->put_weighted_pred_avg = FUNC(put_weighted_pred_avg, depth);    \
-                                                                            \
-    hevcdsp->weighted_pred         = FUNC(weighted_pred, depth);            \
-    hevcdsp->weighted_pred_avg     = FUNC(weighted_pred_avg, depth);        \
-                                                                            \
-    hevcdsp->hevc_h_loop_filter_luma     = FUNC(hevc_h_loop_filter_luma, depth);   \
-    hevcdsp->hevc_v_loop_filter_luma     = FUNC(hevc_v_loop_filter_luma, depth);   \
-    hevcdsp->hevc_h_loop_filter_chroma   = FUNC(hevc_h_loop_filter_chroma, depth); \
-    hevcdsp->hevc_v_loop_filter_chroma   = FUNC(hevc_v_loop_filter_chroma, depth); \
-    hevcdsp->hevc_h_loop_filter_luma_c   = FUNC(hevc_h_loop_filter_luma, depth);   \
-    hevcdsp->hevc_v_loop_filter_luma_c   = FUNC(hevc_v_loop_filter_luma, depth);   \
-    hevcdsp->hevc_h_loop_filter_chroma_c = FUNC(hevc_h_loop_filter_chroma, depth); \
-    hevcdsp->hevc_v_loop_filter_chroma_c = FUNC(hevc_v_loop_filter_chroma, depth);
-
-    switch (bit_depth) {
-    case 9:
-        HEVC_DSP(9);
-        break;
-    case 10:
-        HEVC_DSP(10);
-        break;
-    default:
-        HEVC_DSP(8);
-        break;
-    }
-}
diff --git a/deps/libav/libavcodec/hevcdsp.h b/deps/libav/libavcodec/hevcdsp.h
deleted file mode 100644
index 30ca209..0000000
--- a/deps/libav/libavcodec/hevcdsp.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_HEVCDSP_H
-#define AVCODEC_HEVCDSP_H
-
-#include "get_bits.h"
-
-typedef struct SAOParams {
-    int offset_abs[3][4];   ///< sao_offset_abs
-    int offset_sign[3][4];  ///< sao_offset_sign
-
-    int band_position[3];   ///< sao_band_position
-
-    int eo_class[3];        ///< sao_eo_class
-
-    int offset_val[3][5];   ///<SaoOffsetVal
-
-    uint8_t type_idx[3];    ///< sao_type_idx
-} SAOParams;
-
-typedef struct HEVCDSPContext {
-    void (*put_pcm)(uint8_t *dst, ptrdiff_t stride, int size,
-                    GetBitContext *gb, int pcm_bit_depth);
-
-    void (*transquant_bypass[4])(uint8_t *dst, int16_t *coeffs,
-                                 ptrdiff_t stride);
-
-    void (*transform_skip)(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
-    void (*transform_4x4_luma_add)(uint8_t *dst, int16_t *coeffs,
-                                   ptrdiff_t stride);
-    void (*transform_add[4])(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
-
-    void (*sao_band_filter[4])(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
-                               struct SAOParams *sao, int *borders,
-                               int width, int height, int c_idx);
-    void (*sao_edge_filter[4])(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
-                               struct SAOParams *sao, int *borders, int width,
-                               int height, int c_idx, uint8_t vert_edge,
-                               uint8_t horiz_edge, uint8_t diag_edge);
-
-    void (*put_hevc_qpel[4][4])(int16_t *dst, ptrdiff_t dststride, uint8_t *src,
-                                ptrdiff_t srcstride, int width, int height,
-                                int16_t *mcbuffer);
-    void (*put_hevc_epel[2][2])(int16_t *dst, ptrdiff_t dststride, uint8_t *src,
-                                ptrdiff_t srcstride, int width, int height,
-                                int mx, int my, int16_t *mcbuffer);
-
-    void (*put_unweighted_pred)(uint8_t *dst, ptrdiff_t dststride, int16_t *src,
-                                ptrdiff_t srcstride, int width, int height);
-    void (*put_weighted_pred_avg)(uint8_t *dst, ptrdiff_t dststride,
-                                  int16_t *src1, int16_t *src2,
-                                  ptrdiff_t srcstride, int width, int height);
-    void (*weighted_pred)(uint8_t denom, int16_t wlxFlag, int16_t olxFlag,
-                          uint8_t *dst, ptrdiff_t dststride, int16_t *src,
-                          ptrdiff_t srcstride, int width, int height);
-    void (*weighted_pred_avg)(uint8_t denom, int16_t wl0Flag, int16_t wl1Flag,
-                              int16_t ol0Flag, int16_t ol1Flag, uint8_t *dst,
-                              ptrdiff_t dststride, int16_t *src1, int16_t *src2,
-                              ptrdiff_t srcstride, int width, int height);
-
-    void (*hevc_h_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
-                                    int *beta, int *tc,
-                                    uint8_t *no_p, uint8_t *no_q);
-    void (*hevc_v_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
-                                    int *beta, int *tc,
-                                    uint8_t *no_p, uint8_t *no_q);
-    void (*hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
-                                      int *tc, uint8_t *no_p, uint8_t *no_q);
-    void (*hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
-                                      int *tc, uint8_t *no_p, uint8_t *no_q);
-    void (*hevc_h_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
-                                      int *beta, int *tc,
-                                      uint8_t *no_p, uint8_t *no_q);
-    void (*hevc_v_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride,
-                                      int *beta, int *tc,
-                                      uint8_t *no_p, uint8_t *no_q);
-    void (*hevc_h_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
-                                        int *tc, uint8_t *no_p,
-                                        uint8_t *no_q);
-    void (*hevc_v_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride,
-                                        int *tc, uint8_t *no_p,
-                                        uint8_t *no_q);
-} HEVCDSPContext;
-
-void ff_hevc_dsp_init(HEVCDSPContext *hpc, int bit_depth);
-
-extern const int8_t ff_hevc_epel_filters[7][16];
-
-#endif /* AVCODEC_HEVCDSP_H */
diff --git a/deps/libav/libavcodec/hevcdsp_template.c b/deps/libav/libavcodec/hevcdsp_template.c
deleted file mode 100644
index 104c1eb..0000000
--- a/deps/libav/libavcodec/hevcdsp_template.c
+++ /dev/null
@@ -1,1340 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "get_bits.h"
-#include "hevc.h"
-
-#include "bit_depth_template.c"
-
-static void FUNC(put_pcm)(uint8_t *_dst, ptrdiff_t stride, int size,
-                          GetBitContext *gb, int pcm_bit_depth)
-{
-    int x, y;
-    pixel *dst = (pixel *)_dst;
-
-    stride /= sizeof(pixel);
-
-    for (y = 0; y < size; y++) {
-        for (x = 0; x < size; x++)
-            dst[x] = get_bits(gb, pcm_bit_depth) << (BIT_DEPTH - pcm_bit_depth);
-        dst += stride;
-    }
-}
-
-static void FUNC(transquant_bypass4x4)(uint8_t *_dst, int16_t *coeffs,
-                                       ptrdiff_t stride)
-{
-    int x, y;
-    pixel *dst = (pixel *)_dst;
-
-    stride /= sizeof(pixel);
-
-    for (y = 0; y < 4; y++) {
-        for (x = 0; x < 4; x++) {
-            dst[x] = av_clip_pixel(dst[x] + *coeffs);
-            coeffs++;
-        }
-        dst += stride;
-    }
-}
-
-static void FUNC(transquant_bypass8x8)(uint8_t *_dst, int16_t *coeffs,
-                                       ptrdiff_t stride)
-{
-    int x, y;
-    pixel *dst = (pixel *)_dst;
-
-    stride /= sizeof(pixel);
-
-    for (y = 0; y < 8; y++) {
-        for (x = 0; x < 8; x++) {
-            dst[x] = av_clip_pixel(dst[x] + *coeffs);
-            coeffs++;
-        }
-        dst += stride;
-    }
-}
-
-static void FUNC(transquant_bypass16x16)(uint8_t *_dst, int16_t *coeffs,
-                                         ptrdiff_t stride)
-{
-    int x, y;
-    pixel *dst = (pixel *)_dst;
-
-    stride /= sizeof(pixel);
-
-    for (y = 0; y < 16; y++) {
-        for (x = 0; x < 16; x++) {
-            dst[x] = av_clip_pixel(dst[x] + *coeffs);
-            coeffs++;
-        }
-        dst += stride;
-    }
-}
-
-static void FUNC(transquant_bypass32x32)(uint8_t *_dst, int16_t *coeffs,
-                                         ptrdiff_t stride)
-{
-    int x, y;
-    pixel *dst = (pixel *)_dst;
-
-    stride /= sizeof(pixel);
-
-    for (y = 0; y < 32; y++) {
-        for (x = 0; x < 32; x++) {
-            dst[x] = av_clip_pixel(dst[x] + *coeffs);
-            coeffs++;
-        }
-        dst += stride;
-    }
-}
-
-static void FUNC(transform_skip)(uint8_t *_dst, int16_t *coeffs,
-                                 ptrdiff_t stride)
-{
-    pixel *dst = (pixel *)_dst;
-    int shift  = 13 - BIT_DEPTH;
-#if BIT_DEPTH <= 13
-    int offset = 1 << (shift - 1);
-#else
-    int offset = 0;
-#endif
-    int x, y;
-
-    stride /= sizeof(pixel);
-
-    for (y = 0; y < 4 * 4; y += 4) {
-        for (x = 0; x < 4; x++)
-            dst[x] = av_clip_pixel(dst[x] + ((coeffs[y + x] + offset) >> shift));
-        dst += stride;
-    }
-}
-
-#define SET(dst, x)   (dst) = (x)
-#define SCALE(dst, x) (dst) = av_clip_int16(((x) + add) >> shift)
-#define ADD_AND_SCALE(dst, x)                                           \
-    (dst) = av_clip_pixel((dst) + av_clip_int16(((x) + add) >> shift))
-
-#define TR_4x4_LUMA(dst, src, step, assign)                             \
-    do {                                                                \
-        int c0 = src[0 * step] + src[2 * step];                         \
-        int c1 = src[2 * step] + src[3 * step];                         \
-        int c2 = src[0 * step] - src[3 * step];                         \
-        int c3 = 74 * src[1 * step];                                    \
-                                                                        \
-        assign(dst[2 * step], 74 * (src[0 * step] -                     \
-                                    src[2 * step] +                     \
-                                    src[3 * step]));                    \
-        assign(dst[0 * step], 29 * c0 + 55 * c1 + c3);                  \
-        assign(dst[1 * step], 55 * c2 - 29 * c1 + c3);                  \
-        assign(dst[3 * step], 55 * c0 + 29 * c2 - c3);                  \
-    } while (0)
-
-static void FUNC(transform_4x4_luma_add)(uint8_t *_dst, int16_t *coeffs,
-                                         ptrdiff_t stride)
-{
-    int i;
-    pixel *dst   = (pixel *)_dst;
-    int shift    = 7;
-    int add      = 1 << (shift - 1);
-    int16_t *src = coeffs;
-
-    stride /= sizeof(pixel);
-
-    for (i = 0; i < 4; i++) {
-        TR_4x4_LUMA(src, src, 4, SCALE);
-        src++;
-    }
-
-    shift = 20 - BIT_DEPTH;
-    add   = 1 << (shift - 1);
-    for (i = 0; i < 4; i++) {
-        TR_4x4_LUMA(dst, coeffs, 1, ADD_AND_SCALE);
-        coeffs += 4;
-        dst    += stride;
-    }
-}
-
-#undef TR_4x4_LUMA
-
-#define TR_4(dst, src, dstep, sstep, assign)                            \
-    do {                                                                \
-        const int e0 = transform[8 * 0][0] * src[0 * sstep] +           \
-                       transform[8 * 2][0] * src[2 * sstep];            \
-        const int e1 = transform[8 * 0][1] * src[0 * sstep] +           \
-                       transform[8 * 2][1] * src[2 * sstep];            \
-        const int o0 = transform[8 * 1][0] * src[1 * sstep] +           \
-                       transform[8 * 3][0] * src[3 * sstep];            \
-        const int o1 = transform[8 * 1][1] * src[1 * sstep] +           \
-                       transform[8 * 3][1] * src[3 * sstep];            \
-                                                                        \
-        assign(dst[0 * dstep], e0 + o0);                                \
-        assign(dst[1 * dstep], e1 + o1);                                \
-        assign(dst[2 * dstep], e1 - o1);                                \
-        assign(dst[3 * dstep], e0 - o0);                                \
-    } while (0)
-
-static void FUNC(transform_4x4_add)(uint8_t *_dst, int16_t *coeffs,
-                                    ptrdiff_t stride)
-{
-    int i;
-    pixel *dst   = (pixel *)_dst;
-    int shift    = 7;
-    int add      = 1 << (shift - 1);
-    int16_t *src = coeffs;
-
-    stride /= sizeof(pixel);
-
-    for (i = 0; i < 4; i++) {
-        TR_4(src, src, 4, 4, SCALE);
-        src++;
-    }
-
-    shift = 20 - BIT_DEPTH;
-    add   = 1 << (shift - 1);
-    for (i = 0; i < 4; i++) {
-        TR_4(dst, coeffs, 1, 1, ADD_AND_SCALE);
-        coeffs += 4;
-        dst    += stride;
-    }
-}
-
-#define TR_8(dst, src, dstep, sstep, assign)                      \
-    do {                                                          \
-        int i, j;                                                 \
-        int e_8[4];                                               \
-        int o_8[4] = { 0 };                                       \
-        for (i = 0; i < 4; i++)                                   \
-            for (j = 1; j < 8; j += 2)                            \
-                o_8[i] += transform[4 * j][i] * src[j * sstep];   \
-        TR_4(e_8, src, 1, 2 * sstep, SET);                        \
-                                                                  \
-        for (i = 0; i < 4; i++) {                                 \
-            assign(dst[i * dstep], e_8[i] + o_8[i]);              \
-            assign(dst[(7 - i) * dstep], e_8[i] - o_8[i]);        \
-        }                                                         \
-    } while (0)
-
-#define TR_16(dst, src, dstep, sstep, assign)                     \
-    do {                                                          \
-        int i, j;                                                 \
-        int e_16[8];                                              \
-        int o_16[8] = { 0 };                                      \
-        for (i = 0; i < 8; i++)                                   \
-            for (j = 1; j < 16; j += 2)                           \
-                o_16[i] += transform[2 * j][i] * src[j * sstep];  \
-        TR_8(e_16, src, 1, 2 * sstep, SET);                       \
-                                                                  \
-        for (i = 0; i < 8; i++) {                                 \
-            assign(dst[i * dstep], e_16[i] + o_16[i]);            \
-            assign(dst[(15 - i) * dstep], e_16[i] - o_16[i]);     \
-        }                                                         \
-    } while (0)
-
-#define TR_32(dst, src, dstep, sstep, assign)                     \
-    do {                                                          \
-        int i, j;                                                 \
-        int e_32[16];                                             \
-        int o_32[16] = { 0 };                                     \
-        for (i = 0; i < 16; i++)                                  \
-            for (j = 1; j < 32; j += 2)                           \
-                o_32[i] += transform[j][i] * src[j * sstep];      \
-        TR_16(e_32, src, 1, 2 * sstep, SET);                      \
-                                                                  \
-        for (i = 0; i < 16; i++) {                                \
-            assign(dst[i * dstep], e_32[i] + o_32[i]);            \
-            assign(dst[(31 - i) * dstep], e_32[i] - o_32[i]);     \
-        }                                                         \
-    } while (0)
-
-
-
-static void FUNC(transform_8x8_add)(uint8_t *_dst, int16_t *coeffs,
-                                    ptrdiff_t stride)
-{
-    int i;
-    pixel *dst   = (pixel *)_dst;
-    int shift    = 7;
-    int add      = 1 << (shift - 1);
-    int16_t *src = coeffs;
-
-    stride /= sizeof(pixel);
-
-    for (i = 0; i < 8; i++) {
-        TR_8(src, src, 8, 8, SCALE);
-        src++;
-    }
-
-    shift = 20 - BIT_DEPTH;
-    add   = 1 << (shift - 1);
-    for (i = 0; i < 8; i++) {
-        TR_8(dst, coeffs, 1, 1, ADD_AND_SCALE);
-        coeffs += 8;
-        dst    += stride;
-    }
-}
-
-static void FUNC(transform_16x16_add)(uint8_t *_dst, int16_t *coeffs,
-                                      ptrdiff_t stride)
-{
-    int i;
-    pixel *dst   = (pixel *)_dst;
-    int shift    = 7;
-    int add      = 1 << (shift - 1);
-    int16_t *src = coeffs;
-
-    stride /= sizeof(pixel);
-
-    for (i = 0; i < 16; i++) {
-        TR_16(src, src, 16, 16, SCALE);
-        src++;
-    }
-
-    shift = 20 - BIT_DEPTH;
-    add   = 1 << (shift - 1);
-    for (i = 0; i < 16; i++) {
-        TR_16(dst, coeffs, 1, 1, ADD_AND_SCALE);
-        coeffs += 16;
-        dst    += stride;
-    }
-}
-
-static void FUNC(transform_32x32_add)(uint8_t *_dst, int16_t *coeffs,
-                                      ptrdiff_t stride)
-{
-    int i;
-    pixel *dst   = (pixel *)_dst;
-    int shift    = 7;
-    int add      = 1 << (shift - 1);
-    int16_t *src = coeffs;
-
-    stride /= sizeof(pixel);
-
-    for (i = 0; i < 32; i++) {
-        TR_32(src, src, 32, 32, SCALE);
-        src++;
-    }
-    src   = coeffs;
-    shift = 20 - BIT_DEPTH;
-    add   = 1 << (shift - 1);
-    for (i = 0; i < 32; i++) {
-        TR_32(dst, coeffs, 1, 1, ADD_AND_SCALE);
-        coeffs += 32;
-        dst    += stride;
-    }
-}
-
-static void FUNC(sao_band_filter)(uint8_t *_dst, uint8_t *_src,
-                                  ptrdiff_t stride, SAOParams *sao,
-                                  int *borders, int width, int height,
-                                  int c_idx, int class)
-{
-    pixel *dst = (pixel *)_dst;
-    pixel *src = (pixel *)_src;
-    int offset_table[32] = { 0 };
-    int k, y, x;
-    int chroma = !!c_idx;
-    int shift  = BIT_DEPTH - 5;
-    int *sao_offset_val = sao->offset_val[c_idx];
-    int sao_left_class  = sao->band_position[c_idx];
-    int init_y = 0, init_x = 0;
-
-    stride /= sizeof(pixel);
-
-    switch (class) {
-    case 0:
-        if (!borders[2])
-            width -= (8 >> chroma) + 2;
-        if (!borders[3])
-            height -= (4 >> chroma) + 2;
-        break;
-    case 1:
-        init_y = -(4 >> chroma) - 2;
-        if (!borders[2])
-            width -= (8 >> chroma) + 2;
-        height = (4 >> chroma) + 2;
-        break;
-    case 2:
-        init_x = -(8 >> chroma) - 2;
-        width  =  (8 >> chroma) + 2;
-        if (!borders[3])
-            height -= (4 >> chroma) + 2;
-        break;
-    case 3:
-        init_y = -(4 >> chroma) - 2;
-        init_x = -(8 >> chroma) - 2;
-        width  =  (8 >> chroma) + 2;
-        height =  (4 >> chroma) + 2;
-        break;
-    }
-
-    dst = dst + (init_y * stride + init_x);
-    src = src + (init_y * stride + init_x);
-    for (k = 0; k < 4; k++)
-        offset_table[(k + sao_left_class) & 31] = sao_offset_val[k + 1];
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++)
-            dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]);
-        dst += stride;
-        src += stride;
-    }
-}
-
-static void FUNC(sao_band_filter_0)(uint8_t *dst, uint8_t *src,
-                                    ptrdiff_t stride, SAOParams *sao,
-                                    int *borders, int width, int height,
-                                    int c_idx)
-{
-    FUNC(sao_band_filter)(dst, src, stride, sao, borders,
-                          width, height, c_idx, 0);
-}
-
-static void FUNC(sao_band_filter_1)(uint8_t *dst, uint8_t *src,
-                                    ptrdiff_t stride, SAOParams *sao,
-                                    int *borders, int width, int height,
-                                    int c_idx)
-{
-    FUNC(sao_band_filter)(dst, src, stride, sao, borders,
-                          width, height, c_idx, 1);
-}
-
-static void FUNC(sao_band_filter_2)(uint8_t *dst, uint8_t *src,
-                                    ptrdiff_t stride, SAOParams *sao,
-                                    int *borders, int width, int height,
-                                    int c_idx)
-{
-    FUNC(sao_band_filter)(dst, src, stride, sao, borders,
-                          width, height, c_idx, 2);
-}
-
-static void FUNC(sao_band_filter_3)(uint8_t *_dst, uint8_t *_src,
-                                    ptrdiff_t stride, SAOParams *sao,
-                                    int *borders, int width, int height,
-                                    int c_idx)
-{
-    FUNC(sao_band_filter)(_dst, _src, stride, sao, borders,
-                          width, height, c_idx, 3);
-}
-
-static void FUNC(sao_edge_filter_0)(uint8_t *_dst, uint8_t *_src,
-                                    ptrdiff_t stride, SAOParams *sao,
-                                    int *borders, int _width, int _height,
-                                    int c_idx, uint8_t vert_edge,
-                                    uint8_t horiz_edge, uint8_t diag_edge)
-{
-    int x, y;
-    pixel *dst = (pixel *)_dst;
-    pixel *src = (pixel *)_src;
-    int chroma = !!c_idx;
-    int *sao_offset_val = sao->offset_val[c_idx];
-    int sao_eo_class    = sao->eo_class[c_idx];
-    int init_x = 0, init_y = 0, width = _width, height = _height;
-
-    static const int8_t pos[4][2][2] = {
-        { { -1,  0 }, {  1, 0 } }, // horizontal
-        { {  0, -1 }, {  0, 1 } }, // vertical
-        { { -1, -1 }, {  1, 1 } }, // 45 degree
-        { {  1, -1 }, { -1, 1 } }, // 135 degree
-    };
-    static const uint8_t edge_idx[] = { 1, 2, 0, 3, 4 };
-
-#define CMP(a, b) ((a) > (b) ? 1 : ((a) == (b) ? 0 : -1))
-
-    stride /= sizeof(pixel);
-
-    if (!borders[2])
-        width -= (8 >> chroma) + 2;
-    if (!borders[3])
-        height -= (4 >> chroma) + 2;
-
-    dst = dst + (init_y * stride + init_x);
-    src = src + (init_y * stride + init_x);
-    init_y = init_x = 0;
-    if (sao_eo_class != SAO_EO_VERT) {
-        if (borders[0]) {
-            int offset_val = sao_offset_val[0];
-            int y_stride   = 0;
-            for (y = 0; y < height; y++) {
-                dst[y_stride] = av_clip_pixel(src[y_stride] + offset_val);
-                y_stride     += stride;
-            }
-            init_x = 1;
-        }
-        if (borders[2]) {
-            int offset_val = sao_offset_val[0];
-            int x_stride   = width - 1;
-            for (x = 0; x < height; x++) {
-                dst[x_stride] = av_clip_pixel(src[x_stride] + offset_val);
-                x_stride     += stride;
-            }
-            width--;
-        }
-    }
-    if (sao_eo_class != SAO_EO_HORIZ) {
-        if (borders[1]) {
-            int offset_val = sao_offset_val[0];
-            for (x = init_x; x < width; x++)
-                dst[x] = av_clip_pixel(src[x] + offset_val);
-            init_y = 1;
-        }
-        if (borders[3]) {
-            int offset_val = sao_offset_val[0];
-            int y_stride   = stride * (height - 1);
-            for (x = init_x; x < width; x++)
-                dst[x + y_stride] = av_clip_pixel(src[x + y_stride] + offset_val);
-            height--;
-        }
-    }
-    {
-        int y_stride = init_y * stride;
-        int pos_0_0  = pos[sao_eo_class][0][0];
-        int pos_0_1  = pos[sao_eo_class][0][1];
-        int pos_1_0  = pos[sao_eo_class][1][0];
-        int pos_1_1  = pos[sao_eo_class][1][1];
-
-        int y_stride_0_1 = (init_y + pos_0_1) * stride;
-        int y_stride_1_1 = (init_y + pos_1_1) * stride;
-        for (y = init_y; y < height; y++) {
-            for (x = init_x; x < width; x++) {
-                int diff0         = CMP(src[x + y_stride], src[x + pos_0_0 + y_stride_0_1]);
-                int diff1         = CMP(src[x + y_stride], src[x + pos_1_0 + y_stride_1_1]);
-                int offset_val    = edge_idx[2 + diff0 + diff1];
-                dst[x + y_stride] = av_clip_pixel(src[x + y_stride] + sao_offset_val[offset_val]);
-            }
-            y_stride     += stride;
-            y_stride_0_1 += stride;
-            y_stride_1_1 += stride;
-        }
-    }
-
-    {
-        // Restore pixels that can't be modified
-        int save_upper_left = !diag_edge && sao_eo_class == SAO_EO_135D && !borders[0] && !borders[1];
-        if (vert_edge && sao_eo_class != SAO_EO_VERT)
-            for (y = init_y+save_upper_left; y< height; y++)
-                dst[y*stride] = src[y*stride];
-        if(horiz_edge && sao_eo_class != SAO_EO_HORIZ)
-            for(x = init_x+save_upper_left; x<width; x++)
-                dst[x] = src[x];
-        if(diag_edge && sao_eo_class == SAO_EO_135D)
-            dst[0] = src[0];
-    }
-
-#undef CMP
-}
-
-static void FUNC(sao_edge_filter_1)(uint8_t *_dst, uint8_t *_src,
-                                    ptrdiff_t stride, SAOParams *sao,
-                                    int *borders, int _width, int _height,
-                                    int c_idx, uint8_t vert_edge,
-                                    uint8_t horiz_edge, uint8_t diag_edge)
-{
-    int x, y;
-    pixel *dst = (pixel *)_dst;
-    pixel *src = (pixel *)_src;
-    int chroma = !!c_idx;
-    int *sao_offset_val = sao->offset_val[c_idx];
-    int sao_eo_class    = sao->eo_class[c_idx];
-    int init_x = 0, init_y = 0, width = _width, height = _height;
-
-    static const int8_t pos[4][2][2] = {
-        { { -1, 0  }, { 1,  0 } }, // horizontal
-        { { 0,  -1 }, { 0,  1 } }, // vertical
-        { { -1, -1 }, { 1,  1 } }, // 45 degree
-        { { 1,  -1 }, { -1, 1 } }, // 135 degree
-    };
-    static const uint8_t edge_idx[] = { 1, 2, 0, 3, 4 };
-
-#define CMP(a, b) ((a) > (b) ? 1 : ((a) == (b) ? 0 : -1))
-
-    stride /= sizeof(pixel);
-
-    init_y = -(4 >> chroma) - 2;
-    if (!borders[2])
-        width -= (8 >> chroma) + 2;
-    height = (4 >> chroma) + 2;
-
-    dst = dst + (init_y * stride + init_x);
-    src = src + (init_y * stride + init_x);
-    init_y = init_x = 0;
-    if (sao_eo_class != SAO_EO_VERT) {
-        if (borders[0]) {
-            int offset_val = sao_offset_val[0];
-            int y_stride   = 0;
-            for (y = 0; y < height; y++) {
-                dst[y_stride] = av_clip_pixel(src[y_stride] + offset_val);
-                y_stride     += stride;
-            }
-            init_x = 1;
-        }
-        if (borders[2]) {
-            int offset_val = sao_offset_val[0];
-            int x_stride   = width - 1;
-            for (x = 0; x < height; x++) {
-                dst[x_stride] = av_clip_pixel(src[x_stride] + offset_val);
-                x_stride     += stride;
-            }
-            width--;
-        }
-    }
-    {
-        int y_stride = init_y * stride;
-        int pos_0_0  = pos[sao_eo_class][0][0];
-        int pos_0_1  = pos[sao_eo_class][0][1];
-        int pos_1_0  = pos[sao_eo_class][1][0];
-        int pos_1_1  = pos[sao_eo_class][1][1];
-
-        int y_stride_0_1 = (init_y + pos_0_1) * stride;
-        int y_stride_1_1 = (init_y + pos_1_1) * stride;
-        for (y = init_y; y < height; y++) {
-            for (x = init_x; x < width; x++) {
-                int diff0         = CMP(src[x + y_stride], src[x + pos_0_0 + y_stride_0_1]);
-                int diff1         = CMP(src[x + y_stride], src[x + pos_1_0 + y_stride_1_1]);
-                int offset_val    = edge_idx[2 + diff0 + diff1];
-                dst[x + y_stride] = av_clip_pixel(src[x + y_stride] + sao_offset_val[offset_val]);
-            }
-            y_stride     += stride;
-            y_stride_0_1 += stride;
-            y_stride_1_1 += stride;
-        }
-    }
-
-    {
-        // Restore pixels that can't be modified
-        int save_lower_left = !diag_edge && sao_eo_class == SAO_EO_45D && !borders[0];
-        if(vert_edge && sao_eo_class != SAO_EO_VERT)
-            for(y = init_y; y< height-save_lower_left; y++)
-                dst[y*stride] = src[y*stride];
-        if(horiz_edge && sao_eo_class != SAO_EO_HORIZ)
-            for(x = init_x+save_lower_left; x<width; x++)
-                dst[(height-1)*stride+x] = src[(height-1)*stride+x];
-        if(diag_edge && sao_eo_class == SAO_EO_45D)
-            dst[stride*(height-1)] = src[stride*(height-1)];
-    }
-
-#undef CMP
-}
-
-static void FUNC(sao_edge_filter_2)(uint8_t *_dst, uint8_t *_src,
-                                    ptrdiff_t stride, SAOParams *sao,
-                                    int *borders, int _width, int _height,
-                                    int c_idx, uint8_t vert_edge,
-                                    uint8_t horiz_edge, uint8_t diag_edge)
-{
-    int x, y;
-    pixel *dst = (pixel *)_dst;
-    pixel *src = (pixel *)_src;
-    int chroma = !!c_idx;
-    int *sao_offset_val = sao->offset_val[c_idx];
-    int sao_eo_class    = sao->eo_class[c_idx];
-    int init_x = 0, init_y = 0, width = _width, height = _height;
-
-    static const int8_t pos[4][2][2] = {
-        { { -1,  0 }, {  1, 0 } }, // horizontal
-        { {  0, -1 }, {  0, 1 } }, // vertical
-        { { -1, -1 }, {  1, 1 } }, // 45 degree
-        { {  1, -1 }, { -1, 1 } }, // 135 degree
-    };
-    static const uint8_t edge_idx[] = { 1, 2, 0, 3, 4 };
-
-#define CMP(a, b) ((a) > (b) ? 1 : ((a) == (b) ? 0 : -1))
-
-    stride /= sizeof(pixel);
-
-    init_x = -(8 >> chroma) - 2;
-    width  =  (8 >> chroma) + 2;
-    if (!borders[3])
-        height -= (4 >> chroma) + 2;
-
-    dst = dst + (init_y * stride + init_x);
-    src = src + (init_y * stride + init_x);
-    init_y = init_x = 0;
-    if (sao_eo_class != SAO_EO_HORIZ) {
-        if (borders[1]) {
-            int offset_val = sao_offset_val[0];
-            for (x = init_x; x < width; x++)
-                dst[x] = av_clip_pixel(src[x] + offset_val);
-            init_y = 1;
-        }
-        if (borders[3]) {
-            int offset_val = sao_offset_val[0];
-            int y_stride   = stride * (height - 1);
-            for (x = init_x; x < width; x++)
-                dst[x + y_stride] = av_clip_pixel(src[x + y_stride] + offset_val);
-            height--;
-        }
-    }
-    {
-        int y_stride = init_y * stride;
-        int pos_0_0  = pos[sao_eo_class][0][0];
-        int pos_0_1  = pos[sao_eo_class][0][1];
-        int pos_1_0  = pos[sao_eo_class][1][0];
-        int pos_1_1  = pos[sao_eo_class][1][1];
-
-        int y_stride_0_1 = (init_y + pos_0_1) * stride;
-        int y_stride_1_1 = (init_y + pos_1_1) * stride;
-        for (y = init_y; y < height; y++) {
-            for (x = init_x; x < width; x++) {
-                int diff0         = CMP(src[x + y_stride], src[x + pos_0_0 + y_stride_0_1]);
-                int diff1         = CMP(src[x + y_stride], src[x + pos_1_0 + y_stride_1_1]);
-                int offset_val    = edge_idx[2 + diff0 + diff1];
-                dst[x + y_stride] = av_clip_pixel(src[x + y_stride] + sao_offset_val[offset_val]);
-            }
-            y_stride     += stride;
-            y_stride_0_1 += stride;
-            y_stride_1_1 += stride;
-        }
-    }
-
-    {
-        // Restore pixels that can't be modified
-        int save_upper_right = !diag_edge && sao_eo_class == SAO_EO_45D && !borders[1];
-        if(vert_edge && sao_eo_class != SAO_EO_VERT)
-            for(y = init_y+save_upper_right; y< height; y++)
-                dst[y*stride+width-1] = src[y*stride+width-1];
-        if(horiz_edge && sao_eo_class != SAO_EO_HORIZ)
-            for(x = init_x; x<width-save_upper_right; x++)
-                dst[x] = src[x];
-        if(diag_edge && sao_eo_class == SAO_EO_45D)
-            dst[width-1] = src[width-1];
-    }
-#undef CMP
-}
-
-static void FUNC(sao_edge_filter_3)(uint8_t *_dst, uint8_t *_src,
-                                    ptrdiff_t stride, SAOParams *sao,
-                                    int *borders, int _width, int _height,
-                                    int c_idx, uint8_t vert_edge,
-                                    uint8_t horiz_edge, uint8_t diag_edge)
-{
-    int x, y;
-    pixel *dst = (pixel *)_dst;
-    pixel *src = (pixel *)_src;
-    int chroma = !!c_idx;
-    int *sao_offset_val = sao->offset_val[c_idx];
-    int sao_eo_class    = sao->eo_class[c_idx];
-    int init_x = 0, init_y = 0, width = _width, height = _height;
-
-    static const int8_t pos[4][2][2] = {
-        { { -1,  0 }, {  1, 0 } }, // horizontal
-        { {  0, -1 }, {  0, 1 } }, // vertical
-        { { -1, -1 }, {  1, 1 } }, // 45 degree
-        { {  1, -1 }, { -1, 1 } }, // 135 degree
-    };
-    static const uint8_t edge_idx[] = { 1, 2, 0, 3, 4 };
-
-#define CMP(a, b) ((a) > (b) ? 1 : ((a) == (b) ? 0 : -1))
-
-    stride /= sizeof(pixel);
-
-    init_y = -(4 >> chroma) - 2;
-    init_x = -(8 >> chroma) - 2;
-    width  =  (8 >> chroma) + 2;
-    height =  (4 >> chroma) + 2;
-
-
-    dst    = dst + (init_y * stride + init_x);
-    src    = src + (init_y * stride + init_x);
-    init_y = init_x = 0;
-
-    {
-        int y_stride = init_y * stride;
-        int pos_0_0  = pos[sao_eo_class][0][0];
-        int pos_0_1  = pos[sao_eo_class][0][1];
-        int pos_1_0  = pos[sao_eo_class][1][0];
-        int pos_1_1  = pos[sao_eo_class][1][1];
-
-        int y_stride_0_1 = (init_y + pos_0_1) * stride;
-        int y_stride_1_1 = (init_y + pos_1_1) * stride;
-
-        for (y = init_y; y < height; y++) {
-            for (x = init_x; x < width; x++) {
-                int diff0         = CMP(src[x + y_stride], src[x + pos_0_0 + y_stride_0_1]);
-                int diff1         = CMP(src[x + y_stride], src[x + pos_1_0 + y_stride_1_1]);
-                int offset_val    = edge_idx[2 + diff0 + diff1];
-                dst[x + y_stride] = av_clip_pixel(src[x + y_stride] + sao_offset_val[offset_val]);
-            }
-            y_stride     += stride;
-            y_stride_0_1 += stride;
-            y_stride_1_1 += stride;
-        }
-    }
-
-    {
-        // Restore pixels that can't be modified
-        int save_lower_right = !diag_edge && sao_eo_class == SAO_EO_135D;
-        if(vert_edge && sao_eo_class != SAO_EO_VERT)
-            for(y = init_y; y< height-save_lower_right; y++)
-                dst[y*stride+width-1] = src[y*stride+width-1];
-        if(horiz_edge && sao_eo_class != SAO_EO_HORIZ)
-            for(x = init_x; x<width-save_lower_right; x++)
-                dst[(height-1)*stride+x] = src[(height-1)*stride+x];
-        if(diag_edge && sao_eo_class == SAO_EO_135D)
-            dst[stride*(height-1)+width-1] = src[stride*(height-1)+width-1];
-    }
-#undef CMP
-}
-
-#undef SET
-#undef SCALE
-#undef ADD_AND_SCALE
-#undef TR_4
-#undef TR_8
-#undef TR_16
-#undef TR_32
-
-static void FUNC(put_hevc_qpel_pixels)(int16_t *dst, ptrdiff_t dststride,
-                                       uint8_t *_src, ptrdiff_t _srcstride,
-                                       int width, int height, int16_t* mcbuffer)
-{
-    int x, y;
-    pixel *src          = (pixel *)_src;
-    ptrdiff_t srcstride = _srcstride / sizeof(pixel);
-
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++)
-            dst[x] = src[x] << (14 - BIT_DEPTH);
-        src += srcstride;
-        dst += dststride;
-    }
-}
-
-#define QPEL_FILTER_1(src, stride)      \
-    (1 * -src[x - 3 * stride] +         \
-     4 *  src[x - 2 * stride] -         \
-    10 *  src[x -     stride] +         \
-    58 *  src[x]              +         \
-    17 *  src[x +     stride] -         \
-     5 *  src[x + 2 * stride] +         \
-     1 *  src[x + 3 * stride])
-
-#define QPEL_FILTER_2(src, stride)      \
-    (1  * -src[x - 3 * stride] +        \
-     4  *  src[x - 2 * stride] -        \
-    11  *  src[x -     stride] +        \
-    40  *  src[x]              +        \
-    40  *  src[x +     stride] -        \
-    11  *  src[x + 2 * stride] +        \
-     4  *  src[x + 3 * stride] -        \
-     1  *  src[x + 4 * stride])
-
-#define QPEL_FILTER_3(src, stride)      \
-    (1  * src[x - 2 * stride] -         \
-     5  * src[x -     stride] +         \
-    17  * src[x]              +         \
-    58  * src[x + stride]     -         \
-    10  * src[x + 2 * stride] +         \
-     4  * src[x + 3 * stride] -         \
-     1  * src[x + 4 * stride])
-
-
-#define PUT_HEVC_QPEL_H(H)                                                     \
-static void FUNC(put_hevc_qpel_h ## H)(int16_t *dst,  ptrdiff_t dststride,     \
-                                       uint8_t *_src, ptrdiff_t _srcstride,    \
-                                       int width, int height,                  \
-                                       int16_t* mcbuffer)                      \
-{                                                                              \
-    int x, y;                                                                  \
-    pixel *src = (pixel*)_src;                                                 \
-    ptrdiff_t srcstride = _srcstride / sizeof(pixel);                          \
-                                                                               \
-    for (y = 0; y < height; y++) {                                             \
-        for (x = 0; x < width; x++)                                            \
-            dst[x] = QPEL_FILTER_ ## H(src, 1) >> (BIT_DEPTH - 8);             \
-        src += srcstride;                                                      \
-        dst += dststride;                                                      \
-    }                                                                          \
-}
-
-#define PUT_HEVC_QPEL_V(V)                                                     \
-static void FUNC(put_hevc_qpel_v ## V)(int16_t *dst,  ptrdiff_t dststride,     \
-                                       uint8_t *_src, ptrdiff_t _srcstride,    \
-                                       int width, int height,                  \
-                                       int16_t* mcbuffer)                      \
-{                                                                              \
-    int x, y;                                                                  \
-    pixel *src = (pixel*)_src;                                                 \
-    ptrdiff_t srcstride = _srcstride / sizeof(pixel);                          \
-                                                                               \
-    for (y = 0; y < height; y++)  {                                            \
-        for (x = 0; x < width; x++)                                            \
-            dst[x] = QPEL_FILTER_ ## V(src, srcstride) >> (BIT_DEPTH - 8);     \
-        src += srcstride;                                                      \
-        dst += dststride;                                                      \
-    }                                                                          \
-}
-
-#define PUT_HEVC_QPEL_HV(H, V)                                                 \
-static void FUNC(put_hevc_qpel_h ## H ## v ## V)(int16_t *dst,                 \
-                                                 ptrdiff_t dststride,          \
-                                                 uint8_t *_src,                \
-                                                 ptrdiff_t _srcstride,         \
-                                                 int width, int height,        \
-                                                 int16_t* mcbuffer)            \
-{                                                                              \
-    int x, y;                                                                  \
-    pixel *src = (pixel*)_src;                                                 \
-    ptrdiff_t srcstride = _srcstride / sizeof(pixel);                          \
-                                                                               \
-    int16_t tmp_array[(MAX_PB_SIZE + 7) * MAX_PB_SIZE];                        \
-    int16_t *tmp = tmp_array;                                                  \
-                                                                               \
-    src -= ff_hevc_qpel_extra_before[V] * srcstride;                           \
-                                                                               \
-    for (y = 0; y < height + ff_hevc_qpel_extra[V]; y++) {                     \
-        for (x = 0; x < width; x++)                                            \
-            tmp[x] = QPEL_FILTER_ ## H(src, 1) >> (BIT_DEPTH - 8);             \
-        src += srcstride;                                                      \
-        tmp += MAX_PB_SIZE;                                                    \
-    }                                                                          \
-                                                                               \
-    tmp = tmp_array + ff_hevc_qpel_extra_before[V] * MAX_PB_SIZE;              \
-                                                                               \
-    for (y = 0; y < height; y++) {                                             \
-        for (x = 0; x < width; x++)                                            \
-            dst[x] = QPEL_FILTER_ ## V(tmp, MAX_PB_SIZE) >> 6;                 \
-        tmp += MAX_PB_SIZE;                                                    \
-        dst += dststride;                                                      \
-    }                                                                          \
-}
-
-PUT_HEVC_QPEL_H(1)
-PUT_HEVC_QPEL_H(2)
-PUT_HEVC_QPEL_H(3)
-PUT_HEVC_QPEL_V(1)
-PUT_HEVC_QPEL_V(2)
-PUT_HEVC_QPEL_V(3)
-PUT_HEVC_QPEL_HV(1, 1)
-PUT_HEVC_QPEL_HV(1, 2)
-PUT_HEVC_QPEL_HV(1, 3)
-PUT_HEVC_QPEL_HV(2, 1)
-PUT_HEVC_QPEL_HV(2, 2)
-PUT_HEVC_QPEL_HV(2, 3)
-PUT_HEVC_QPEL_HV(3, 1)
-PUT_HEVC_QPEL_HV(3, 2)
-PUT_HEVC_QPEL_HV(3, 3)
-
-static void FUNC(put_hevc_epel_pixels)(int16_t *dst, ptrdiff_t dststride,
-                                       uint8_t *_src, ptrdiff_t _srcstride,
-                                       int width, int height, int mx, int my,
-                                       int16_t* mcbuffer)
-{
-    int x, y;
-    pixel *src          = (pixel *)_src;
-    ptrdiff_t srcstride = _srcstride / sizeof(pixel);
-
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++)
-            dst[x] = src[x] << (14 - BIT_DEPTH);
-        src += srcstride;
-        dst += dststride;
-    }
-}
-
-#define EPEL_FILTER(src, stride)                \
-    (filter_0 * src[x - stride] +               \
-     filter_1 * src[x]          +               \
-     filter_2 * src[x + stride] +               \
-     filter_3 * src[x + 2 * stride])
-
-static void FUNC(put_hevc_epel_h)(int16_t *dst, ptrdiff_t dststride,
-                                  uint8_t *_src, ptrdiff_t _srcstride,
-                                  int width, int height, int mx, int my,
-                                  int16_t* mcbuffer)
-{
-    int x, y;
-    pixel *src = (pixel *)_src;
-    ptrdiff_t srcstride  = _srcstride / sizeof(pixel);
-    const int8_t *filter = ff_hevc_epel_filters[mx - 1];
-    int8_t filter_0 = filter[0];
-    int8_t filter_1 = filter[1];
-    int8_t filter_2 = filter[2];
-    int8_t filter_3 = filter[3];
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++)
-            dst[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
-        src += srcstride;
-        dst += dststride;
-    }
-}
-
-static void FUNC(put_hevc_epel_v)(int16_t *dst, ptrdiff_t dststride,
-                                  uint8_t *_src, ptrdiff_t _srcstride,
-                                  int width, int height, int mx, int my,
-                                  int16_t* mcbuffer)
-{
-    int x, y;
-    pixel *src = (pixel *)_src;
-    ptrdiff_t srcstride = _srcstride / sizeof(pixel);
-    const int8_t *filter = ff_hevc_epel_filters[my - 1];
-    int8_t filter_0 = filter[0];
-    int8_t filter_1 = filter[1];
-    int8_t filter_2 = filter[2];
-    int8_t filter_3 = filter[3];
-
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++)
-            dst[x] = EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8);
-        src += srcstride;
-        dst += dststride;
-    }
-}
-
-static void FUNC(put_hevc_epel_hv)(int16_t *dst, ptrdiff_t dststride,
-                                   uint8_t *_src, ptrdiff_t _srcstride,
-                                   int width, int height, int mx, int my,
-                                   int16_t* mcbuffer)
-{
-    int x, y;
-    pixel *src = (pixel *)_src;
-    ptrdiff_t srcstride = _srcstride / sizeof(pixel);
-    const int8_t *filter_h = ff_hevc_epel_filters[mx - 1];
-    const int8_t *filter_v = ff_hevc_epel_filters[my - 1];
-    int8_t filter_0 = filter_h[0];
-    int8_t filter_1 = filter_h[1];
-    int8_t filter_2 = filter_h[2];
-    int8_t filter_3 = filter_h[3];
-    int16_t tmp_array[(MAX_PB_SIZE + 3) * MAX_PB_SIZE];
-    int16_t *tmp = tmp_array;
-
-    src -= EPEL_EXTRA_BEFORE * srcstride;
-
-    for (y = 0; y < height + EPEL_EXTRA; y++) {
-        for (x = 0; x < width; x++)
-            tmp[x] = EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8);
-        src += srcstride;
-        tmp += MAX_PB_SIZE;
-    }
-
-    tmp      = tmp_array + EPEL_EXTRA_BEFORE * MAX_PB_SIZE;
-    filter_0 = filter_v[0];
-    filter_1 = filter_v[1];
-    filter_2 = filter_v[2];
-    filter_3 = filter_v[3];
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++)
-            dst[x] = EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6;
-        tmp += MAX_PB_SIZE;
-        dst += dststride;
-    }
-}
-
-static void FUNC(put_unweighted_pred)(uint8_t *_dst, ptrdiff_t _dststride,
-                                      int16_t *src, ptrdiff_t srcstride,
-                                      int width, int height)
-{
-    int x, y;
-    pixel *dst          = (pixel *)_dst;
-    ptrdiff_t dststride = _dststride / sizeof(pixel);
-
-    int shift = 14 - BIT_DEPTH;
-#if BIT_DEPTH < 14
-    int offset = 1 << (shift - 1);
-#else
-    int offset = 0;
-#endif
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++)
-            dst[x] = av_clip_pixel((src[x] + offset) >> shift);
-        dst += dststride;
-        src += srcstride;
-    }
-}
-
-static void FUNC(put_weighted_pred_avg)(uint8_t *_dst, ptrdiff_t _dststride,
-                                        int16_t *src1, int16_t *src2,
-                                        ptrdiff_t srcstride,
-                                        int width, int height)
-{
-    int x, y;
-    pixel *dst          = (pixel *)_dst;
-    ptrdiff_t dststride = _dststride / sizeof(pixel);
-
-    int shift = 14 + 1 - BIT_DEPTH;
-#if BIT_DEPTH < 14
-    int offset = 1 << (shift - 1);
-#else
-    int offset = 0;
-#endif
-
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++)
-            dst[x] = av_clip_pixel((src1[x] + src2[x] + offset) >> shift);
-        dst  += dststride;
-        src1 += srcstride;
-        src2 += srcstride;
-    }
-}
-
-static void FUNC(weighted_pred)(uint8_t denom, int16_t wlxFlag, int16_t olxFlag,
-                                uint8_t *_dst, ptrdiff_t _dststride,
-                                int16_t *src, ptrdiff_t srcstride,
-                                int width, int height)
-{
-    int shift, log2Wd, wx, ox, x, y, offset;
-    pixel *dst          = (pixel *)_dst;
-    ptrdiff_t dststride = _dststride / sizeof(pixel);
-
-    shift  = 14 - BIT_DEPTH;
-    log2Wd = denom + shift;
-    offset = 1 << (log2Wd - 1);
-    wx     = wlxFlag;
-    ox     = olxFlag * (1 << (BIT_DEPTH - 8));
-
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++) {
-            if (log2Wd >= 1) {
-                dst[x] = av_clip_pixel(((src[x] * wx + offset) >> log2Wd) + ox);
-            } else {
-                dst[x] = av_clip_pixel(src[x] * wx + ox);
-            }
-        }
-        dst += dststride;
-        src += srcstride;
-    }
-}
-
-static void FUNC(weighted_pred_avg)(uint8_t denom,
-                                    int16_t wl0Flag, int16_t wl1Flag,
-                                    int16_t ol0Flag, int16_t ol1Flag,
-                                    uint8_t *_dst, ptrdiff_t _dststride,
-                                    int16_t *src1, int16_t *src2,
-                                    ptrdiff_t srcstride,
-                                    int width, int height)
-{
-    int shift, log2Wd, w0, w1, o0, o1, x, y;
-    pixel *dst = (pixel *)_dst;
-    ptrdiff_t dststride = _dststride / sizeof(pixel);
-
-    shift  = 14 - BIT_DEPTH;
-    log2Wd = denom + shift;
-    w0     = wl0Flag;
-    w1     = wl1Flag;
-    o0     = ol0Flag * (1 << (BIT_DEPTH - 8));
-    o1     = ol1Flag * (1 << (BIT_DEPTH - 8));
-
-    for (y = 0; y < height; y++) {
-        for (x = 0; x < width; x++)
-            dst[x] = av_clip_pixel((src1[x] * w0 + src2[x] * w1 +
-                                    ((o0 + o1 + 1) << log2Wd)) >> (log2Wd + 1));
-        dst  += dststride;
-        src1 += srcstride;
-        src2 += srcstride;
-    }
-}
-
-// line zero
-#define P3 pix[-4 * xstride]
-#define P2 pix[-3 * xstride]
-#define P1 pix[-2 * xstride]
-#define P0 pix[-1 * xstride]
-#define Q0 pix[0 * xstride]
-#define Q1 pix[1 * xstride]
-#define Q2 pix[2 * xstride]
-#define Q3 pix[3 * xstride]
-
-// line three. used only for deblocking decision
-#define TP3 pix[-4 * xstride + 3 * ystride]
-#define TP2 pix[-3 * xstride + 3 * ystride]
-#define TP1 pix[-2 * xstride + 3 * ystride]
-#define TP0 pix[-1 * xstride + 3 * ystride]
-#define TQ0 pix[0  * xstride + 3 * ystride]
-#define TQ1 pix[1  * xstride + 3 * ystride]
-#define TQ2 pix[2  * xstride + 3 * ystride]
-#define TQ3 pix[3  * xstride + 3 * ystride]
-
-static void FUNC(hevc_loop_filter_luma)(uint8_t *_pix,
-                                        ptrdiff_t _xstride, ptrdiff_t _ystride,
-                                        int *_beta, int *_tc,
-                                        uint8_t *_no_p, uint8_t *_no_q)
-{
-    int d, j;
-    pixel *pix        = (pixel *)_pix;
-    ptrdiff_t xstride = _xstride / sizeof(pixel);
-    ptrdiff_t ystride = _ystride / sizeof(pixel);
-
-    for (j = 0; j < 2; j++) {
-        const int dp0  = abs(P2  - 2 * P1  + P0);
-        const int dq0  = abs(Q2  - 2 * Q1  + Q0);
-        const int dp3  = abs(TP2 - 2 * TP1 + TP0);
-        const int dq3  = abs(TQ2 - 2 * TQ1 + TQ0);
-        const int d0   = dp0 + dq0;
-        const int d3   = dp3 + dq3;
-        const int beta = _beta[j] << (BIT_DEPTH - 8);
-        const int tc   = _tc[j]   << (BIT_DEPTH - 8);
-        const int no_p = _no_p[j];
-        const int no_q = _no_q[j];
-
-        if (d0 + d3 >= beta) {
-            pix += 4 * ystride;
-            continue;
-        } else {
-            const int beta_3 = beta >> 3;
-            const int beta_2 = beta >> 2;
-            const int tc25   = ((tc * 5 + 1) >> 1);
-
-            if (abs(P3  -  P0) + abs(Q3  -  Q0) < beta_3 && abs(P0  -  Q0) < tc25 &&
-                abs(TP3 - TP0) + abs(TQ3 - TQ0) < beta_3 && abs(TP0 - TQ0) < tc25 &&
-                                      (d0 << 1) < beta_2 &&      (d3 << 1) < beta_2) {
-                // strong filtering
-                const int tc2 = tc << 1;
-                for (d = 0; d < 4; d++) {
-                    const int p3 = P3;
-                    const int p2 = P2;
-                    const int p1 = P1;
-                    const int p0 = P0;
-                    const int q0 = Q0;
-                    const int q1 = Q1;
-                    const int q2 = Q2;
-                    const int q3 = Q3;
-                    if (!no_p) {
-                        P0 = p0 + av_clip(((p2 + 2 * p1 + 2 * p0 + 2 * q0 + q1 + 4) >> 3) - p0, -tc2, tc2);
-                        P1 = p1 + av_clip(((p2 + p1 + p0 + q0 + 2) >> 2) - p1, -tc2, tc2);
-                        P2 = p2 + av_clip(((2 * p3 + 3 * p2 + p1 + p0 + q0 + 4) >> 3) - p2, -tc2, tc2);
-                    }
-                    if (!no_q) {
-                        Q0 = q0 + av_clip(((p1 + 2 * p0 + 2 * q0 + 2 * q1 + q2 + 4) >> 3) - q0, -tc2, tc2);
-                        Q1 = q1 + av_clip(((p0 + q0 + q1 + q2 + 2) >> 2) - q1, -tc2, tc2);
-                        Q2 = q2 + av_clip(((2 * q3 + 3 * q2 + q1 + q0 + p0 + 4) >> 3) - q2, -tc2, tc2);
-                    }
-                    pix += ystride;
-                }
-            } else { // normal filtering
-                int nd_p = 1;
-                int nd_q = 1;
-                const int tc_2 = tc >> 1;
-                if (dp0 + dp3 < ((beta + (beta >> 1)) >> 3))
-                    nd_p = 2;
-                if (dq0 + dq3 < ((beta + (beta >> 1)) >> 3))
-                    nd_q = 2;
-
-                for (d = 0; d < 4; d++) {
-                    const int p2 = P2;
-                    const int p1 = P1;
-                    const int p0 = P0;
-                    const int q0 = Q0;
-                    const int q1 = Q1;
-                    const int q2 = Q2;
-                    int delta0   = (9 * (q0 - p0) - 3 * (q1 - p1) + 8) >> 4;
-                    if (abs(delta0) < 10 * tc) {
-                        delta0 = av_clip(delta0, -tc, tc);
-                        if (!no_p)
-                            P0 = av_clip_pixel(p0 + delta0);
-                        if (!no_q)
-                            Q0 = av_clip_pixel(q0 - delta0);
-                        if (!no_p && nd_p > 1) {
-                            const int deltap1 = av_clip((((p2 + p0 + 1) >> 1) - p1 + delta0) >> 1, -tc_2, tc_2);
-                            P1 = av_clip_pixel(p1 + deltap1);
-                        }
-                        if (!no_q && nd_q > 1) {
-                            const int deltaq1 = av_clip((((q2 + q0 + 1) >> 1) - q1 - delta0) >> 1, -tc_2, tc_2);
-                            Q1 = av_clip_pixel(q1 + deltaq1);
-                        }
-                    }
-                    pix += ystride;
-                }
-            }
-        }
-    }
-}
-
-static void FUNC(hevc_loop_filter_chroma)(uint8_t *_pix, ptrdiff_t _xstride,
-                                          ptrdiff_t _ystride, int *_tc,
-                                          uint8_t *_no_p, uint8_t *_no_q)
-{
-    int d, j, no_p, no_q;
-    pixel *pix        = (pixel *)_pix;
-    ptrdiff_t xstride = _xstride / sizeof(pixel);
-    ptrdiff_t ystride = _ystride / sizeof(pixel);
-
-    for (j = 0; j < 2; j++) {
-        const int tc = _tc[j] << (BIT_DEPTH - 8);
-        if (tc <= 0) {
-            pix += 4 * ystride;
-            continue;
-        }
-        no_p = _no_p[j];
-        no_q = _no_q[j];
-
-        for (d = 0; d < 4; d++) {
-            int delta0;
-            const int p1 = P1;
-            const int p0 = P0;
-            const int q0 = Q0;
-            const int q1 = Q1;
-            delta0 = av_clip((((q0 - p0) << 2) + p1 - q1 + 4) >> 3, -tc, tc);
-            if (!no_p)
-                P0 = av_clip_pixel(p0 + delta0);
-            if (!no_q)
-                Q0 = av_clip_pixel(q0 - delta0);
-            pix += ystride;
-        }
-    }
-}
-
-static void FUNC(hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
-                                            int *tc, uint8_t *no_p,
-                                            uint8_t *no_q)
-{
-    FUNC(hevc_loop_filter_chroma)(pix, stride, sizeof(pixel), tc, no_p, no_q);
-}
-
-static void FUNC(hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride,
-                                            int *tc, uint8_t *no_p,
-                                            uint8_t *no_q)
-{
-    FUNC(hevc_loop_filter_chroma)(pix, sizeof(pixel), stride, tc, no_p, no_q);
-}
-
-static void FUNC(hevc_h_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
-                                          int *beta, int *tc, uint8_t *no_p,
-                                          uint8_t *no_q)
-{
-    FUNC(hevc_loop_filter_luma)(pix, stride, sizeof(pixel),
-                                beta, tc, no_p, no_q);
-}
-
-static void FUNC(hevc_v_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
-                                          int *beta, int *tc, uint8_t *no_p,
-                                          uint8_t *no_q)
-{
-    FUNC(hevc_loop_filter_luma)(pix, sizeof(pixel), stride,
-                                beta, tc, no_p, no_q);
-}
-
-#undef P3
-#undef P2
-#undef P1
-#undef P0
-#undef Q0
-#undef Q1
-#undef Q2
-#undef Q3
-
-#undef TP3
-#undef TP2
-#undef TP1
-#undef TP0
-#undef TQ0
-#undef TQ1
-#undef TQ2
-#undef TQ3
diff --git a/deps/libav/libavcodec/hevcpred.c b/deps/libav/libavcodec/hevcpred.c
deleted file mode 100644
index 1121f30..0000000
--- a/deps/libav/libavcodec/hevcpred.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "hevc.h"
-
-#define BIT_DEPTH 8
-#include "hevcpred_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 9
-#include "hevcpred_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "hevcpred_template.c"
-#undef BIT_DEPTH
-
-void ff_hevc_pred_init(HEVCPredContext *hpc, int bit_depth)
-{
-#undef FUNC
-#define FUNC(a, depth) a ## _ ## depth
-
-#define HEVC_PRED(depth)                                \
-    hpc->intra_pred      = FUNC(intra_pred, depth);     \
-    hpc->pred_planar[0]  = FUNC(pred_planar_0, depth);  \
-    hpc->pred_planar[1]  = FUNC(pred_planar_1, depth);  \
-    hpc->pred_planar[2]  = FUNC(pred_planar_2, depth);  \
-    hpc->pred_planar[3]  = FUNC(pred_planar_3, depth);  \
-    hpc->pred_dc         = FUNC(pred_dc, depth);        \
-    hpc->pred_angular[0] = FUNC(pred_angular_0, depth); \
-    hpc->pred_angular[1] = FUNC(pred_angular_1, depth); \
-    hpc->pred_angular[2] = FUNC(pred_angular_2, depth); \
-    hpc->pred_angular[3] = FUNC(pred_angular_3, depth);
-
-    switch (bit_depth) {
-    case 9:
-        HEVC_PRED(9);
-        break;
-    case 10:
-        HEVC_PRED(10);
-        break;
-    default:
-        HEVC_PRED(8);
-        break;
-    }
-}
diff --git a/deps/libav/libavcodec/hevcpred_template.c b/deps/libav/libavcodec/hevcpred_template.c
deleted file mode 100644
index 27f4b9e..0000000
--- a/deps/libav/libavcodec/hevcpred_template.c
+++ /dev/null
@@ -1,560 +0,0 @@
-/*
- * HEVC video decoder
- *
- * Copyright (C) 2012 - 2013 Guillaume Martres
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/pixdesc.h"
-
-#include "hevc.h"
-
-#include "bit_depth_template.c"
-
-#define POS(x, y) src[(x) + stride * (y)]
-
-static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int c_idx)
-{
-#define PU(x) \
-    ((x) >> s->sps->log2_min_pu_size)
-#define MVF(x, y) \
-    (s->ref->tab_mvf[(x) + (y) * min_pu_width])
-#define MVF_PU(x, y) \
-    MVF(PU(x0 + ((x) << hshift)), PU(y0 + ((y) << vshift)))
-#define IS_INTRA(x, y) \
-    MVF_PU(x, y).is_intra
-#define MIN_TB_ADDR_ZS(x, y) \
-    s->pps->min_tb_addr_zs[(y) * s->sps->min_tb_width + (x)]
-#define EXTEND_LEFT(ptr, start, length) \
-        for (i = (start); i > (start) - (length); i--) \
-            ptr[i - 1] = ptr[i]
-#define EXTEND_RIGHT(ptr, start, length) \
-        for (i = (start); i < (start) + (length); i++) \
-            ptr[i] = ptr[i - 1]
-#define EXTEND_UP(ptr, start, length)   EXTEND_LEFT(ptr, start, length)
-#define EXTEND_DOWN(ptr, start, length) EXTEND_RIGHT(ptr, start, length)
-#define EXTEND_LEFT_CIP(ptr, start, length) \
-        for (i = (start); i > (start) - (length); i--) \
-            if (!IS_INTRA(i - 1, -1)) \
-                ptr[i - 1] = ptr[i]
-#define EXTEND_RIGHT_CIP(ptr, start, length) \
-        for (i = (start); i < (start) + (length); i++) \
-            if (!IS_INTRA(i, -1)) \
-                ptr[i] = ptr[i - 1]
-#define EXTEND_UP_CIP(ptr, start, length) \
-        for (i = (start); i > (start) - (length); i--) \
-            if (!IS_INTRA(-1, i - 1)) \
-                ptr[i - 1] = ptr[i]
-#define EXTEND_UP_CIP_0(ptr, start, length) \
-        for (i = (start); i > (start) - (length); i--) \
-            ptr[i - 1] = ptr[i]
-#define EXTEND_DOWN_CIP(ptr, start, length) \
-        for (i = (start); i < (start) + (length); i++) \
-            if (!IS_INTRA(-1, i)) \
-                ptr[i] = ptr[i - 1]
-    HEVCLocalContext *lc = &s->HEVClc;
-    int i;
-    int hshift = s->sps->hshift[c_idx];
-    int vshift = s->sps->vshift[c_idx];
-    int size = (1 << log2_size);
-    int size_in_luma = size << hshift;
-    int size_in_tbs = size_in_luma >> s->sps->log2_min_tb_size;
-    int x = x0 >> hshift;
-    int y = y0 >> vshift;
-    int x_tb = x0 >> s->sps->log2_min_tb_size;
-    int y_tb = y0 >> s->sps->log2_min_tb_size;
-    int cur_tb_addr = MIN_TB_ADDR_ZS(x_tb, y_tb);
-
-    ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(pixel);
-    pixel *src = (pixel*)s->frame->data[c_idx] + x + y * stride;
-
-    int min_pu_width = s->sps->min_pu_width;
-
-    enum IntraPredMode mode = c_idx ? lc->pu.intra_pred_mode_c :
-                              lc->tu.cur_intra_pred_mode;
-
-    pixel left_array[2 * MAX_TB_SIZE + 1];
-    pixel filtered_left_array[2 * MAX_TB_SIZE + 1];
-    pixel top_array[2 * MAX_TB_SIZE + 1];
-    pixel filtered_top_array[2 * MAX_TB_SIZE + 1];
-
-    pixel *left          = left_array + 1;
-    pixel *top           = top_array  + 1;
-    pixel *filtered_left = filtered_left_array + 1;
-    pixel *filtered_top  = filtered_top_array  + 1;
-
-    int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb - 1, y_tb + size_in_tbs);
-    int cand_left        = lc->na.cand_left;
-    int cand_up_left     = lc->na.cand_up_left;
-    int cand_up          = lc->na.cand_up;
-    int cand_up_right    = lc->na.cand_up_right && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb + size_in_tbs, y_tb - 1);
-
-    int bottom_left_size = (FFMIN(y0 + 2 * size_in_luma, s->sps->height) -
-                            (y0 + size_in_luma)) >> vshift;
-    int top_right_size   = (FFMIN(x0 + 2 * size_in_luma, s->sps->width) -
-                            (x0 + size_in_luma)) >> hshift;
-
-    if (s->pps->constrained_intra_pred_flag == 1) {
-        int size_in_luma_pu = PU(size_in_luma);
-        int on_pu_edge_x    = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1));
-        int on_pu_edge_y    = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1));
-        if (!size_in_luma_pu)
-            size_in_luma_pu++;
-        if (cand_bottom_left == 1 && on_pu_edge_x) {
-            int x_left_pu   = PU(x0 - 1);
-            int y_bottom_pu = PU(y0 + size_in_luma);
-            int max = FFMIN(size_in_luma_pu, s->sps->min_pu_height - y_bottom_pu);
-            cand_bottom_left = 0;
-            for (i = 0; i < max; i++)
-                cand_bottom_left |= MVF(x_left_pu, y_bottom_pu + i).is_intra;
-        }
-        if (cand_left == 1 && on_pu_edge_x) {
-            int x_left_pu   = PU(x0 - 1);
-            int y_left_pu   = PU(y0);
-            int max = FFMIN(size_in_luma_pu, s->sps->min_pu_height - y_left_pu);
-            cand_left = 0;
-            for (i = 0; i < max; i++)
-                cand_left |= MVF(x_left_pu, y_left_pu + i).is_intra;
-        }
-        if (cand_up_left == 1) {
-            int x_left_pu   = PU(x0 - 1);
-            int y_top_pu    = PU(y0 - 1);
-            cand_up_left = MVF(x_left_pu, y_top_pu).is_intra;
-        }
-        if (cand_up == 1 && on_pu_edge_y) {
-            int x_top_pu    = PU(x0);
-            int y_top_pu    = PU(y0 - 1);
-            int max = FFMIN(size_in_luma_pu, s->sps->min_pu_width - x_top_pu);
-            cand_up = 0;
-            for (i = 0; i < max; i++)
-                cand_up |= MVF(x_top_pu + i, y_top_pu).is_intra;
-        }
-        if (cand_up_right == 1 && on_pu_edge_y) {
-            int y_top_pu    = PU(y0 - 1);
-            int x_right_pu  = PU(x0 + size_in_luma);
-            int max = FFMIN(size_in_luma_pu, s->sps->min_pu_width - x_right_pu);
-            cand_up_right = 0;
-            for (i = 0; i < max; i++)
-                cand_up_right |= MVF(x_right_pu + i, y_top_pu).is_intra;
-        }
-        for (i = 0; i < 2 * MAX_TB_SIZE; i++) {
-            left[i] = 128;
-            top[i]  = 128;
-        }
-    }
-    if (cand_bottom_left) {
-        for (i = size + bottom_left_size; i < (size << 1); i++)
-            if (IS_INTRA(-1, size + bottom_left_size - 1) ||
-                !s->pps->constrained_intra_pred_flag)
-                left[i] = POS(-1, size + bottom_left_size - 1);
-        for (i = size + bottom_left_size - 1; i >= size; i--)
-            if (IS_INTRA(-1, i) || !s->pps->constrained_intra_pred_flag)
-                left[i] = POS(-1, i);
-    }
-    if (cand_left)
-        for (i = size - 1; i >= 0; i--)
-            if (IS_INTRA(-1, i) || !s->pps->constrained_intra_pred_flag)
-                left[i] = POS(-1, i);
-    if (cand_up_left)
-        if (IS_INTRA(-1, -1) || !s->pps->constrained_intra_pred_flag) {
-            left[-1] = POS(-1, -1);
-            top[-1]  = left[-1];
-        }
-    if (cand_up)
-        for (i = size - 1; i >= 0; i--)
-            if (IS_INTRA(i, -1) || !s->pps->constrained_intra_pred_flag)
-                top[i] = POS(i, -1);
-    if (cand_up_right) {
-        for (i = size + top_right_size; i < (size << 1); i++)
-            if (IS_INTRA(size + top_right_size - 1, -1) ||
-                !s->pps->constrained_intra_pred_flag)
-                top[i] = POS(size + top_right_size - 1, -1);
-        for (i = size + top_right_size - 1; i >= size; i--)
-            if (IS_INTRA(i, -1) || !s->pps->constrained_intra_pred_flag)
-                top[i] = POS(i, -1);
-    }
-
-    if (s->pps->constrained_intra_pred_flag == 1) {
-        if (cand_bottom_left || cand_left || cand_up_left || cand_up || cand_up_right) {
-            int size_max_x = x0 + ((2 * size) << hshift) < s->sps->width ?
-                                    2 * size : (s->sps->width - x0) >> hshift;
-            int size_max_y = y0 + ((2 * size) << vshift) < s->sps->height ?
-                                    2 * size : (s->sps->height - y0) >> vshift;
-            int j = size + (cand_bottom_left? bottom_left_size: 0) -1;
-            if (!cand_up_right) {
-                size_max_x = x0 + ((size) << hshift) < s->sps->width ?
-                                                    size : (s->sps->width - x0) >> hshift;
-            }
-            if (!cand_bottom_left) {
-                size_max_y = y0 + (( size) << vshift) < s->sps->height ?
-                                                     size : (s->sps->height - y0) >> vshift;
-            }
-            if (cand_bottom_left || cand_left || cand_up_left) {
-                while (j > -1 && !IS_INTRA(-1, j))
-                    j--;
-                if (!IS_INTRA(-1, j)) {
-                    j = 0;
-                    while (j < size_max_x && !IS_INTRA(j, -1))
-                        j++;
-                    EXTEND_LEFT_CIP(top, j, j + 1);
-                    left[-1] = top[-1];
-                    j        = 0;
-                }
-            } else {
-                j = 0;
-                while (j < size_max_x && !IS_INTRA(j, -1))
-                    j++;
-                if (j > 0)
-                    if (x0 > 0) {
-                        EXTEND_LEFT_CIP(top, j, j + 1);
-                    } else {
-                        EXTEND_LEFT_CIP(top, j, j);
-                        top[-1] = top[0];
-                    }
-                left[-1] = top[-1];
-                j        = 0;
-            }
-            if (cand_bottom_left || cand_left) {
-                EXTEND_DOWN_CIP(left, j, size_max_y - j);
-            }
-            if (!cand_left) {
-                EXTEND_DOWN(left, 0, size);
-            }
-            if (!cand_bottom_left) {
-                EXTEND_DOWN(left, size, size);
-            }
-            if (x0 != 0 && y0 != 0) {
-                EXTEND_UP_CIP(left, size_max_y - 1, size_max_y);
-            } else if (x0 == 0) {
-                EXTEND_UP_CIP_0(left, size_max_y - 1, size_max_y);
-            } else {
-                EXTEND_UP_CIP(left, size_max_y - 1, size_max_y - 1);
-            }
-            top[-1] = left[-1];
-            if (y0 != 0) {
-                EXTEND_RIGHT_CIP(top, 0, size_max_x);
-            }
-        }
-    }
-    // Infer the unavailable samples
-    if (!cand_bottom_left) {
-        if (cand_left) {
-            EXTEND_DOWN(left, size, size);
-        } else if (cand_up_left) {
-            EXTEND_DOWN(left, 0, 2 * size);
-            cand_left = 1;
-        } else if (cand_up) {
-            left[-1] = top[0];
-            EXTEND_DOWN(left, 0, 2 * size);
-            cand_up_left = 1;
-            cand_left    = 1;
-        } else if (cand_up_right) {
-            EXTEND_LEFT(top, size, size);
-            left[-1] = top[0];
-            EXTEND_DOWN(left, 0, 2 * size);
-            cand_up      = 1;
-            cand_up_left = 1;
-            cand_left    = 1;
-        } else { // No samples available
-            top[0] = left[-1] = (1 << (BIT_DEPTH - 1));
-            EXTEND_RIGHT(top, 1, 2 * size - 1);
-            EXTEND_DOWN(left, 0, 2 * size);
-        }
-    }
-
-    if (!cand_left) {
-        EXTEND_UP(left, size, size);
-    }
-    if (!cand_up_left) {
-        left[-1] = left[0];
-    }
-    if (!cand_up) {
-        top[0] = left[-1];
-        EXTEND_RIGHT(top, 1, size - 1);
-    }
-    if (!cand_up_right) {
-        EXTEND_RIGHT(top, size, size);
-    }
-
-    top[-1] = left[-1];
-
-    // Filtering process
-    if (c_idx == 0 && mode != INTRA_DC && size != 4) {
-        int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
-        int min_dist_vert_hor = FFMIN(FFABS((int)mode - 26),
-                                      FFABS((int)mode - 10));
-        if (min_dist_vert_hor > intra_hor_ver_dist_thresh[log2_size - 3]) {
-            int threshold = 1 << (BIT_DEPTH - 5);
-            if (s->sps->sps_strong_intra_smoothing_enable_flag &&
-                log2_size == 5 &&
-                FFABS(top[-1]  + top[63]  - 2 * top[31])  < threshold &&
-                FFABS(left[-1] + left[63] - 2 * left[31]) < threshold) {
-                // We can't just overwrite values in top because it could be
-                // a pointer into src
-                filtered_top[-1] = top[-1];
-                filtered_top[63] = top[63];
-                for (i = 0; i < 63; i++)
-                    filtered_top[i] = ((64 - (i + 1)) * top[-1] +
-                                             (i + 1)  * top[63] + 32) >> 6;
-                for (i = 0; i < 63; i++)
-                    left[i] = ((64 - (i + 1)) * left[-1] +
-                                     (i + 1)  * left[63] + 32) >> 6;
-                top = filtered_top;
-            } else {
-                filtered_left[2 * size - 1] = left[2 * size - 1];
-                filtered_top[2 * size - 1]  = top[2 * size - 1];
-                for (i = 2 * size - 2; i >= 0; i--)
-                    filtered_left[i] = (left[i + 1] + 2 * left[i] +
-                                        left[i - 1] + 2) >> 2;
-                filtered_top[-1]  =
-                filtered_left[-1] = (left[0] + 2 * left[-1] + top[0] + 2) >> 2;
-                for (i = 2 * size - 2; i >= 0; i--)
-                    filtered_top[i] = (top[i + 1] + 2 * top[i] +
-                                       top[i - 1] + 2) >> 2;
-                left = filtered_left;
-                top  = filtered_top;
-            }
-        }
-    }
-
-    switch (mode) {
-    case INTRA_PLANAR:
-        s->hpc.pred_planar[log2_size - 2]((uint8_t *)src, (uint8_t *)top,
-                                          (uint8_t *)left, stride);
-        break;
-    case INTRA_DC:
-        s->hpc.pred_dc((uint8_t *)src, (uint8_t *)top,
-                       (uint8_t *)left, stride, log2_size, c_idx);
-        break;
-    default:
-        s->hpc.pred_angular[log2_size - 2]((uint8_t *)src, (uint8_t *)top,
-                                           (uint8_t *)left, stride, c_idx,
-                                           mode);
-        break;
-    }
-}
-
-static void FUNC(pred_planar_0)(uint8_t *_src, const uint8_t *_top,
-                                const uint8_t *_left,
-                                ptrdiff_t stride)
-{
-    int x, y;
-    pixel *src        = (pixel *)_src;
-    const pixel *top  = (const pixel *)_top;
-    const pixel *left = (const pixel *)_left;
-    for (y = 0; y < 4; y++)
-        for (x = 0; x < 4; x++)
-            POS(x, y) = ((3 - x) * left[y] + (x + 1) * top[4]  +
-                         (3 - y) * top[x]  + (y + 1) * left[4] + 4) >> 3;
-}
-
-static void FUNC(pred_planar_1)(uint8_t *_src, const uint8_t *_top,
-                                const uint8_t *_left, ptrdiff_t stride)
-{
-    int x, y;
-    pixel *src        = (pixel *)_src;
-    const pixel *top  = (const pixel *)_top;
-    const pixel *left = (const pixel *)_left;
-    for (y = 0; y < 8; y++)
-        for (x = 0; x < 8; x++)
-            POS(x, y) = ((7 - x) * left[y] + (x + 1) * top[8]  +
-                         (7 - y) * top[x]  + (y + 1) * left[8] + 8) >> 4;
-}
-
-static void FUNC(pred_planar_2)(uint8_t *_src, const uint8_t *_top,
-                                const uint8_t *_left, ptrdiff_t stride)
-{
-    int x, y;
-    pixel *src        = (pixel *)_src;
-    const pixel *top  = (const pixel *)_top;
-    const pixel *left = (const pixel *)_left;
-    for (y = 0; y < 16; y++)
-        for (x = 0; x < 16; x++)
-            POS(x, y) = ((15 - x) * left[y] + (x + 1) * top[16]  +
-                         (15 - y) * top[x]  + (y + 1) * left[16] + 16) >> 5;
-}
-
-static void FUNC(pred_planar_3)(uint8_t *_src, const uint8_t *_top,
-                                const uint8_t *_left, ptrdiff_t stride)
-{
-    int x, y;
-    pixel *src        = (pixel *)_src;
-    const pixel *top  = (const pixel *)_top;
-    const pixel *left = (const pixel *)_left;
-    for (y = 0; y < 32; y++)
-        for (x = 0; x < 32; x++)
-            POS(x, y) = ((31 - x) * left[y] + (x + 1) * top[32]  +
-                         (31 - y) * top[x]  + (y + 1) * left[32] + 32) >> 6;
-}
-
-static void FUNC(pred_dc)(uint8_t *_src, const uint8_t *_top,
-                          const uint8_t *_left,
-                          ptrdiff_t stride, int log2_size, int c_idx)
-{
-    int i, j, x, y;
-    int size          = (1 << log2_size);
-    pixel *src        = (pixel *)_src;
-    const pixel *top  = (const pixel *)_top;
-    const pixel *left = (const pixel *)_left;
-    int dc            = size;
-    pixel4 a;
-    for (i = 0; i < size; i++)
-        dc += left[i] + top[i];
-
-    dc >>= log2_size + 1;
-
-    a = PIXEL_SPLAT_X4(dc);
-
-    for (i = 0; i < size; i++)
-        for (j = 0; j < size / 4; j++)
-            AV_WN4PA(&POS(j * 4, i), a);
-
-    if (c_idx == 0 && size < 32) {
-        POS(0, 0) = (left[0] + 2 * dc + top[0] + 2) >> 2;
-        for (x = 1; x < size; x++)
-            POS(x, 0) = (top[x] + 3 * dc + 2) >> 2;
-        for (y = 1; y < size; y++)
-            POS(0, y) = (left[y] + 3 * dc + 2) >> 2;
-    }
-}
-
-static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
-                                                const uint8_t *_top,
-                                                const uint8_t *_left,
-                                                ptrdiff_t stride, int c_idx,
-                                                int mode, int size)
-{
-    int x, y;
-    pixel *src        = (pixel *)_src;
-    const pixel *top  = (const pixel *)_top;
-    const pixel *left = (const pixel *)_left;
-
-    static const int intra_pred_angle[] = {
-         32,  26,  21,  17, 13,  9,  5, 2, 0, -2, -5, -9, -13, -17, -21, -26, -32,
-        -26, -21, -17, -13, -9, -5, -2, 0, 2,  5,  9, 13,  17,  21,  26,  32
-    };
-    static const int inv_angle[] = {
-        -4096, -1638, -910, -630, -482, -390, -315, -256, -315, -390, -482,
-        -630, -910, -1638, -4096
-    };
-
-    int angle = intra_pred_angle[mode - 2];
-    pixel ref_array[3 * MAX_TB_SIZE + 1];
-    pixel *ref_tmp = ref_array + size;
-    const pixel *ref;
-    int last = (size * angle) >> 5;
-
-    if (mode >= 18) {
-        ref = top - 1;
-        if (angle < 0 && last < -1) {
-            for (x = 0; x <= size; x++)
-                ref_tmp[x] = top[x - 1];
-            for (x = last; x <= -1; x++)
-                ref_tmp[x] = left[-1 + ((x * inv_angle[mode - 11] + 128) >> 8)];
-            ref = ref_tmp;
-        }
-
-        for (y = 0; y < size; y++) {
-            int idx  = ((y + 1) * angle) >> 5;
-            int fact = ((y + 1) * angle) & 31;
-            if (fact) {
-                for (x = 0; x < size; x++) {
-                    POS(x, y) = ((32 - fact) * ref[x + idx + 1] +
-                                       fact  * ref[x + idx + 2] + 16) >> 5;
-                }
-            } else {
-                for (x = 0; x < size; x++)
-                    POS(x, y) = ref[x + idx + 1];
-            }
-        }
-        if (mode == 26 && c_idx == 0 && size < 32) {
-            for (y = 0; y < size; y++)
-                POS(0, y) = av_clip_pixel(top[0] + ((left[y] - left[-1]) >> 1));
-        }
-    } else {
-        ref = left - 1;
-        if (angle < 0 && last < -1) {
-            for (x = 0; x <= size; x++)
-                ref_tmp[x] = left[x - 1];
-            for (x = last; x <= -1; x++)
-                ref_tmp[x] = top[-1 + ((x * inv_angle[mode - 11] + 128) >> 8)];
-            ref = ref_tmp;
-        }
-
-        for (x = 0; x < size; x++) {
-            int idx  = ((x + 1) * angle) >> 5;
-            int fact = ((x + 1) * angle) & 31;
-            if (fact) {
-                for (y = 0; y < size; y++) {
-                    POS(x, y) = ((32 - fact) * ref[y + idx + 1] +
-                                       fact  * ref[y + idx + 2] + 16) >> 5;
-                }
-            } else {
-                for (y = 0; y < size; y++)
-                    POS(x, y) = ref[y + idx + 1];
-            }
-        }
-        if (mode == 10 && c_idx == 0 && size < 32) {
-            for (x = 0; x < size; x++)
-                POS(x, 0) = av_clip_pixel(left[0] + ((top[x] - top[-1]) >> 1));
-        }
-    }
-}
-
-static void FUNC(pred_angular_0)(uint8_t *src, const uint8_t *top,
-                                 const uint8_t *left,
-                                 ptrdiff_t stride, int c_idx, int mode)
-{
-    FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 2);
-}
-
-static void FUNC(pred_angular_1)(uint8_t *src, const uint8_t *top,
-                                 const uint8_t *left,
-                                 ptrdiff_t stride, int c_idx, int mode)
-{
-    FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 3);
-}
-
-static void FUNC(pred_angular_2)(uint8_t *src, const uint8_t *top,
-                                 const uint8_t *left,
-                                 ptrdiff_t stride, int c_idx, int mode)
-{
-    FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 4);
-}
-
-static void FUNC(pred_angular_3)(uint8_t *src, const uint8_t *top,
-                                 const uint8_t *left,
-                                 ptrdiff_t stride, int c_idx, int mode)
-{
-    FUNC(pred_angular)(src, top, left, stride, c_idx, mode, 1 << 5);
-}
-
-#undef EXTEND_LEFT_CIP
-#undef EXTEND_RIGHT_CIP
-#undef EXTEND_UP_CIP
-#undef EXTEND_DOWN_CIP
-#undef IS_INTRA
-#undef MVF_PU
-#undef MVF
-#undef PU
-#undef EXTEND_LEFT
-#undef EXTEND_RIGHT
-#undef EXTEND_UP
-#undef EXTEND_DOWN
-#undef MIN_TB_ADDR_ZS
-#undef POS
diff --git a/deps/libav/libavcodec/hnm4video.c b/deps/libav/libavcodec/hnm4video.c
deleted file mode 100644
index b200e89..0000000
--- a/deps/libav/libavcodec/hnm4video.c
+++ /dev/null
@@ -1,459 +0,0 @@
-/*
- * Cryo Interactive Entertainment HNM4 video decoder
- *
- * Copyright (c) 2012 David Kment
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-#define HNM4_CHUNK_ID_PL 19536
-#define HNM4_CHUNK_ID_IZ 23113
-#define HNM4_CHUNK_ID_IU 21833
-#define HNM4_CHUNK_ID_SD 17491
-
-typedef struct Hnm4VideoContext {
-    uint8_t version;
-    uint16_t width;
-    uint16_t height;
-    uint8_t *current;
-    uint8_t *previous;
-    uint8_t *buffer1;
-    uint8_t *buffer2;
-    uint8_t *processed;
-    uint32_t palette[256];
-} Hnm4VideoContext;
-
-static int getbit(GetByteContext *gb, uint32_t *bitbuf, int *bits)
-{
-    int ret;
-
-    if (!*bits) {
-        *bitbuf = bytestream2_get_le32(gb);
-        *bits = 32;
-    }
-
-    ret = *bitbuf >> 31;
-    *bitbuf <<= 1;
-    (*bits)--;
-
-    return ret;
-}
-
-static void unpack_intraframe(AVCodecContext *avctx, uint8_t *src,
-                              uint32_t size)
-{
-    Hnm4VideoContext *hnm = avctx->priv_data;
-    GetByteContext gb;
-    uint32_t bitbuf = 0, writeoffset = 0, count = 0;
-    uint16_t word;
-    int32_t offset;
-    int bits = 0;
-
-    bytestream2_init(&gb, src, size);
-
-    while (bytestream2_tell(&gb) < size) {
-        if (getbit(&gb, &bitbuf, &bits)) {
-            if (writeoffset >= hnm->width * hnm->height) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Attempting to write out of bounds");
-                break;
-            }
-            hnm->current[writeoffset++] = bytestream2_get_byte(&gb);
-        } else {
-            if (getbit(&gb, &bitbuf, &bits)) {
-                word   = bytestream2_get_le16(&gb);
-                count  = word & 0x07;
-                offset = (word >> 3) - 0x2000;
-                if (!count)
-                    count = bytestream2_get_byte(&gb);
-                if (!count)
-                    return;
-            } else {
-                count  = getbit(&gb, &bitbuf, &bits) * 2;
-                count += getbit(&gb, &bitbuf, &bits);
-                offset = bytestream2_get_byte(&gb) - 0x0100;
-            }
-            count  += 2;
-            offset += writeoffset;
-            if (offset < 0 || offset + count >= hnm->width * hnm->height) {
-                av_log(avctx, AV_LOG_ERROR, "Attempting to read out of bounds");
-                break;
-            } else if (writeoffset + count >= hnm->width * hnm->height) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Attempting to write out of bounds");
-                break;
-            }
-            while (count--) {
-                hnm->current[writeoffset++] = hnm->current[offset++];
-            }
-        }
-    }
-}
-
-static void postprocess_current_frame(AVCodecContext *avctx)
-{
-    Hnm4VideoContext *hnm = avctx->priv_data;
-    uint32_t x, y, src_x, src_y;
-
-    for (y = 0; y < hnm->height; y++) {
-        src_y = y - (y % 2);
-        src_x = src_y * hnm->width + (y % 2);
-        for (x = 0; x < hnm->width; x++) {
-            hnm->processed[(y * hnm->width) + x] = hnm->current[src_x];
-            src_x += 2;
-        }
-    }
-}
-
-static void copy_processed_frame(AVCodecContext *avctx, AVFrame *frame)
-{
-    Hnm4VideoContext *hnm = avctx->priv_data;
-    uint8_t *src = hnm->processed;
-    uint8_t *dst = frame->data[0];
-    int y;
-
-    for (y = 0; y < hnm->height; y++) {
-        memcpy(dst, src, hnm->width);
-        src += hnm->width;
-        dst += frame->linesize[0];
-    }
-}
-
-static void decode_interframe_v4(AVCodecContext *avctx, uint8_t *src, uint32_t size)
-{
-    Hnm4VideoContext *hnm = avctx->priv_data;
-    GetByteContext gb;
-    uint32_t writeoffset = 0, count, left, offset;
-    uint8_t tag, previous, backline, backward, swap;
-
-    bytestream2_init(&gb, src, size);
-
-    while (bytestream2_tell(&gb) < size) {
-        count = bytestream2_peek_byte(&gb) & 0x1F;
-        if (count == 0) {
-            tag = bytestream2_get_byte(&gb) & 0xE0;
-            tag = tag >> 5;
-            if (tag == 0) {
-                hnm->current[writeoffset++] = bytestream2_get_byte(&gb);
-                hnm->current[writeoffset++] = bytestream2_get_byte(&gb);
-            } else if (tag == 1) {
-                writeoffset += bytestream2_get_byte(&gb) * 2;
-            } else if (tag == 2) {
-                count = bytestream2_get_le16(&gb);
-                count *= 2;
-                writeoffset += count;
-            } else if (tag == 3) {
-                count = bytestream2_get_byte(&gb) * 2;
-                while (count > 0) {
-                    hnm->current[writeoffset++] = bytestream2_peek_byte(&gb);
-                    count--;
-                }
-                bytestream2_skip(&gb, 1);
-            } else {
-                break;
-            }
-        } else {
-            previous = bytestream2_peek_byte(&gb) & 0x20;
-            backline = bytestream2_peek_byte(&gb) & 0x40;
-            backward = bytestream2_peek_byte(&gb) & 0x80;
-            bytestream2_skip(&gb, 1);
-            swap   = bytestream2_peek_byte(&gb) & 0x01;
-            offset = bytestream2_get_le16(&gb);
-            offset = (offset >> 1) & 0x7FFF;
-            offset = writeoffset + (offset * 2) - 0x8000;
-
-            left = count;
-
-            if (!backward && offset + count >= hnm->width * hnm->height) {
-                av_log(avctx, AV_LOG_ERROR, "Attempting to read out of bounds");
-                break;
-            } else if (backward && offset >= hnm->width * hnm->height) {
-                av_log(avctx, AV_LOG_ERROR, "Attempting to read out of bounds");
-                break;
-            } else if (writeoffset + count >= hnm->width * hnm->height) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Attempting to write out of bounds");
-                break;
-            }
-
-            if (previous) {
-                while (left > 0) {
-                    if (backline) {
-                        hnm->current[writeoffset++] = hnm->previous[offset - (2 * hnm->width) + 1];
-                        hnm->current[writeoffset++] = hnm->previous[offset++];
-                        offset++;
-                    } else {
-                        hnm->current[writeoffset++] = hnm->previous[offset++];
-                        hnm->current[writeoffset++] = hnm->previous[offset++];
-                    }
-                    if (backward)
-                        offset -= 4;
-                    left--;
-                }
-            } else {
-                while (left > 0) {
-                    if (backline) {
-                        hnm->current[writeoffset++] = hnm->current[offset - (2 * hnm->width) + 1];
-                        hnm->current[writeoffset++] = hnm->current[offset++];
-                        offset++;
-                    } else {
-                        hnm->current[writeoffset++] = hnm->current[offset++];
-                        hnm->current[writeoffset++] = hnm->current[offset++];
-                    }
-                    if (backward)
-                        offset -= 4;
-                    left--;
-                }
-            }
-
-            if (swap) {
-                left         = count;
-                writeoffset -= count * 2;
-                while (left > 0) {
-                    swap = hnm->current[writeoffset];
-                    hnm->current[writeoffset] = hnm->current[writeoffset + 1];
-                    hnm->current[writeoffset + 1] = swap;
-                    left--;
-                    writeoffset += 2;
-                }
-            }
-        }
-    }
-}
-
-static void decode_interframe_v4a(AVCodecContext *avctx, uint8_t *src,
-                                  uint32_t size)
-{
-    Hnm4VideoContext *hnm = avctx->priv_data;
-    GetByteContext gb;
-    uint32_t writeoffset = 0, offset;
-    uint8_t tag, count, previous, delta;
-
-    bytestream2_init(&gb, src, size);
-
-    while (bytestream2_tell(&gb) < size) {
-        count = bytestream2_peek_byte(&gb) & 0x3F;
-        if (count == 0) {
-            tag = bytestream2_get_byte(&gb) & 0xC0;
-            tag = tag >> 6;
-            if (tag == 0) {
-                writeoffset += bytestream2_get_byte(&gb);
-            } else if (tag == 1) {
-                hnm->current[writeoffset]              = bytestream2_get_byte(&gb);
-                hnm->current[writeoffset + hnm->width] = bytestream2_get_byte(&gb);
-                writeoffset++;
-            } else if (tag == 2) {
-                writeoffset += hnm->width;
-            } else if (tag == 3) {
-                break;
-            }
-        } else {
-            delta    = bytestream2_peek_byte(&gb) & 0x80;
-            previous = bytestream2_peek_byte(&gb) & 0x40;
-            bytestream2_skip(&gb, 1);
-
-            offset  = writeoffset;
-            offset += bytestream2_get_le16(&gb);
-
-            if (delta)
-                offset -= 0x10000;
-
-            if (offset + hnm->width + count >= hnm->width * hnm->height) {
-                av_log(avctx, AV_LOG_ERROR, "Attempting to read out of bounds");
-                break;
-            } else if (writeoffset + hnm->width + count >= hnm->width * hnm->height) {
-                av_log(avctx, AV_LOG_ERROR, "Attempting to write out of bounds");
-                break;
-            }
-
-            if (previous) {
-                while (count > 0) {
-                    hnm->current[writeoffset]              = hnm->previous[offset];
-                    hnm->current[writeoffset + hnm->width] = hnm->previous[offset + hnm->width];
-                    writeoffset++;
-                    offset++;
-                    count--;
-                }
-            } else {
-                while (count > 0) {
-                    hnm->current[writeoffset]              = hnm->current[offset];
-                    hnm->current[writeoffset + hnm->width] = hnm->current[offset + hnm->width];
-                    writeoffset++;
-                    offset++;
-                    count--;
-                }
-            }
-        }
-    }
-}
-
-static void hnm_update_palette(AVCodecContext *avctx, uint8_t *src,
-                               uint32_t size)
-{
-    Hnm4VideoContext *hnm = avctx->priv_data;
-    GetByteContext gb;
-    uint8_t start, writeoffset;
-    uint16_t count;
-    int eight_bit_colors;
-
-    eight_bit_colors = src[7] & 0x80 && hnm->version == 0x4a;
-
-    // skip first 8 bytes
-    bytestream2_init(&gb, src + 8, size - 8);
-
-    while (bytestream2_tell(&gb) < size - 8) {
-        start = bytestream2_get_byte(&gb);
-        count = bytestream2_get_byte(&gb);
-        if (start == 255 && count == 255)
-            break;
-        if (count == 0)
-            count = 256;
-        writeoffset = start;
-        while (count > 0) {
-            hnm->palette[writeoffset] = bytestream2_get_be24(&gb);
-            if (!eight_bit_colors)
-                hnm->palette[writeoffset] <<= 2;
-            count--;
-            writeoffset++;
-        }
-    }
-}
-
-static void hnm_flip_buffers(Hnm4VideoContext *hnm)
-{
-    uint8_t *temp;
-
-    temp          = hnm->current;
-    hnm->current  = hnm->previous;
-    hnm->previous = temp;
-}
-
-static int hnm_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame, AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    Hnm4VideoContext *hnm = avctx->priv_data;
-    int ret;
-    uint16_t chunk_id;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    chunk_id = AV_RL16(avpkt->data + 4);
-
-    if (chunk_id == HNM4_CHUNK_ID_PL) {
-        hnm_update_palette(avctx, avpkt->data, avpkt->size);
-        frame->palette_has_changed = 1;
-    } else if (chunk_id == HNM4_CHUNK_ID_IZ) {
-        unpack_intraframe(avctx, avpkt->data + 12, avpkt->size - 12);
-        memcpy(hnm->previous, hnm->current, hnm->width * hnm->height);
-        if (hnm->version == 0x4a)
-            memcpy(hnm->processed, hnm->current, hnm->width * hnm->height);
-        else
-            postprocess_current_frame(avctx);
-        copy_processed_frame(avctx, frame);
-        frame->pict_type = AV_PICTURE_TYPE_I;
-        frame->key_frame = 1;
-        memcpy(frame->data[1], hnm->palette, 256 * 4);
-        *got_frame = 1;
-    } else if (chunk_id == HNM4_CHUNK_ID_IU) {
-        if (hnm->version == 0x4a) {
-            decode_interframe_v4a(avctx, avpkt->data + 8, avpkt->size - 8);
-            memcpy(hnm->processed, hnm->current, hnm->width * hnm->height);
-        } else {
-            decode_interframe_v4(avctx, avpkt->data + 8, avpkt->size - 8);
-            postprocess_current_frame(avctx);
-        }
-        copy_processed_frame(avctx, frame);
-        frame->pict_type = AV_PICTURE_TYPE_P;
-        frame->key_frame = 0;
-        memcpy(frame->data[1], hnm->palette, 256 * 4);
-        *got_frame = 1;
-        hnm_flip_buffers(hnm);
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "invalid chunk id: %d\n", chunk_id);
-        return AVERROR_INVALIDDATA;
-    }
-
-    return avpkt->size;
-}
-
-static av_cold int hnm_decode_init(AVCodecContext *avctx)
-{
-    Hnm4VideoContext *hnm = avctx->priv_data;
-
-    if (avctx->extradata_size < 1) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Extradata missing, decoder requires version number\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    hnm->version   = avctx->extradata[0];
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-    hnm->width     = avctx->width;
-    hnm->height    = avctx->height;
-    hnm->buffer1   = av_mallocz(avctx->width * avctx->height);
-    hnm->buffer2   = av_mallocz(avctx->width * avctx->height);
-    hnm->processed = av_mallocz(avctx->width * avctx->height);
-
-    if (!hnm->buffer1 || !hnm->buffer2 || !hnm->processed) {
-        av_log(avctx, AV_LOG_ERROR, "av_mallocz() failed\n");
-        av_freep(&hnm->buffer1);
-        av_freep(&hnm->buffer2);
-        av_freep(&hnm->processed);
-        return AVERROR(ENOMEM);
-    }
-
-    hnm->current  = hnm->buffer1;
-    hnm->previous = hnm->buffer2;
-
-    return 0;
-}
-
-static av_cold int hnm_decode_end(AVCodecContext *avctx)
-{
-    Hnm4VideoContext *hnm = avctx->priv_data;
-
-    av_freep(&hnm->buffer1);
-    av_freep(&hnm->buffer2);
-    av_freep(&hnm->processed);
-
-    return 0;
-}
-
-AVCodec ff_hnm4_video_decoder = {
-    .name           = "hnm4video",
-    .long_name      = NULL_IF_CONFIG_SMALL("HNM 4 video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_HNM4_VIDEO,
-    .priv_data_size = sizeof(Hnm4VideoContext),
-    .init           = hnm_decode_init,
-    .close          = hnm_decode_end,
-    .decode         = hnm_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/hpel_template.c b/deps/libav/libavcodec/hpel_template.c
deleted file mode 100644
index 0c1f756..0000000
--- a/deps/libav/libavcodec/hpel_template.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define DEF_HPEL(OPNAME, OP) \
-static inline void FUNCC(OPNAME ## _pixels2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    int i;\
-    for(i=0; i<h; i++){\
-        OP(*((pixel2*)(block  )), AV_RN2P(pixels  ));\
-        pixels+=line_size;\
-        block +=line_size;\
-    }\
-}\
-static inline void FUNCC(OPNAME ## _pixels4)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    int i;\
-    for(i=0; i<h; i++){\
-        OP(*((pixel4*)(block  )), AV_RN4P(pixels  ));\
-        pixels+=line_size;\
-        block +=line_size;\
-    }\
-}\
-static inline void FUNCC(OPNAME ## _pixels8)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    int i;\
-    for(i=0; i<h; i++){\
-        OP(*((pixel4*)(block                )), AV_RN4P(pixels                ));\
-        OP(*((pixel4*)(block+4*sizeof(pixel))), AV_RN4P(pixels+4*sizeof(pixel)));\
-        pixels+=line_size;\
-        block +=line_size;\
-    }\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
-                                                int src_stride1, int src_stride2, int h){\
-    int i;\
-    for(i=0; i<h; i++){\
-        pixel4 a,b;\
-        a= AV_RN4P(&src1[i*src_stride1  ]);\
-        b= AV_RN4P(&src2[i*src_stride2  ]);\
-        OP(*((pixel4*)&dst[i*dst_stride  ]), rnd_avg_pixel4(a, b));\
-        a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
-        b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
-        OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), rnd_avg_pixel4(a, b));\
-    }\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels4_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
-                                                int src_stride1, int src_stride2, int h){\
-    int i;\
-    for(i=0; i<h; i++){\
-        pixel4 a,b;\
-        a= AV_RN4P(&src1[i*src_stride1  ]);\
-        b= AV_RN4P(&src2[i*src_stride2  ]);\
-        OP(*((pixel4*)&dst[i*dst_stride  ]), rnd_avg_pixel4(a, b));\
-    }\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels2_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
-                                                int src_stride1, int src_stride2, int h){\
-    int i;\
-    for(i=0; i<h; i++){\
-        pixel4 a,b;\
-        a= AV_RN2P(&src1[i*src_stride1  ]);\
-        b= AV_RN2P(&src2[i*src_stride2  ]);\
-        OP(*((pixel2*)&dst[i*dst_stride  ]), rnd_avg_pixel4(a, b));\
-    }\
-}\
-\
-static inline void FUNC(OPNAME ## _pixels16_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
-                                                int src_stride1, int src_stride2, int h){\
-    FUNC(OPNAME ## _pixels8_l2)(dst  , src1  , src2  , dst_stride, src_stride1, src_stride2, h);\
-    FUNC(OPNAME ## _pixels8_l2)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, h);\
-}\
-\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16)    , FUNCC(OPNAME ## _pixels8)    , 8*sizeof(pixel))
-
-
-#define op_avg(a, b) a = rnd_avg_pixel4(a, b)
-#define op_put(a, b) a = b
-
-DEF_HPEL(avg, op_avg)
-DEF_HPEL(put, op_put)
-#undef op_avg
-#undef op_put
diff --git a/deps/libav/libavcodec/hpeldsp.c b/deps/libav/libavcodec/hpeldsp.c
deleted file mode 100644
index f8b90e4..0000000
--- a/deps/libav/libavcodec/hpeldsp.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Half-pel DSP functions.
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * gmc & q-pel & 32/64 bit based MC by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Half-pel DSP functions.
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/intreadwrite.h"
-#include "hpeldsp.h"
-
-#define BIT_DEPTH 8
-#include "hpeldsp_template.c"
-
-av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
-{
-#define hpel_funcs(prefix, idx, num) \
-    c->prefix ## _pixels_tab idx [0] = prefix ## _pixels ## num ## _8_c; \
-    c->prefix ## _pixels_tab idx [1] = prefix ## _pixels ## num ## _x2_8_c; \
-    c->prefix ## _pixels_tab idx [2] = prefix ## _pixels ## num ## _y2_8_c; \
-    c->prefix ## _pixels_tab idx [3] = prefix ## _pixels ## num ## _xy2_8_c
-
-    hpel_funcs(put, [0], 16);
-    hpel_funcs(put, [1],  8);
-    hpel_funcs(put, [2],  4);
-    hpel_funcs(put, [3],  2);
-    hpel_funcs(put_no_rnd, [0], 16);
-    hpel_funcs(put_no_rnd, [1],  8);
-    hpel_funcs(avg, [0], 16);
-    hpel_funcs(avg, [1],  8);
-    hpel_funcs(avg, [2],  4);
-    hpel_funcs(avg, [3],  2);
-    hpel_funcs(avg_no_rnd,, 16);
-
-    if (ARCH_AARCH64)
-        ff_hpeldsp_init_aarch64(c, flags);
-    if (ARCH_ARM)
-        ff_hpeldsp_init_arm(c, flags);
-    if (ARCH_BFIN)
-        ff_hpeldsp_init_bfin(c, flags);
-    if (ARCH_PPC)
-        ff_hpeldsp_init_ppc(c, flags);
-    if (HAVE_VIS)
-        ff_hpeldsp_init_vis(c, flags);
-    if (ARCH_X86)
-        ff_hpeldsp_init_x86(c, flags);
-}
diff --git a/deps/libav/libavcodec/hpeldsp.h b/deps/libav/libavcodec/hpeldsp.h
deleted file mode 100644
index a109fe8..0000000
--- a/deps/libav/libavcodec/hpeldsp.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Half-pel DSP functions.
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Half-pel DSP functions.
- */
-
-#ifndef AVCODEC_HPELDSP_H
-#define AVCODEC_HPELDSP_H
-
-#include <stdint.h>
-#include <stddef.h>
-
-/* add and put pixel (decoding) */
-// blocksizes for hpel_pixels_func are 8x4,8x8 16x8 16x16
-// h for hpel_pixels_func is limited to {width/2, width} but never larger
-// than 16 and never smaller than 4
-typedef void (*op_pixels_func)(uint8_t *block /*align width (8 or 16)*/,
-                               const uint8_t *pixels /*align 1*/,
-                               ptrdiff_t line_size, int h);
-
-/**
- * Half-pel DSP context.
- */
-typedef struct HpelDSPContext {
-    /**
-     * Halfpel motion compensation with rounding (a+b+1)>>1.
-     * this is an array[4][4] of motion compensation functions for 4
-     * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
-     * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
-     * @param block destination where the result is stored
-     * @param pixels source
-     * @param line_size number of bytes in a horizontal line of block
-     * @param h height
-     */
-    op_pixels_func put_pixels_tab[4][4];
-
-    /**
-     * Halfpel motion compensation with rounding (a+b+1)>>1.
-     * This is an array[4][4] of motion compensation functions for 4
-     * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
-     * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
-     * @param block destination into which the result is averaged (a+b+1)>>1
-     * @param pixels source
-     * @param line_size number of bytes in a horizontal line of block
-     * @param h height
-     */
-    op_pixels_func avg_pixels_tab[4][4];
-
-    /**
-     * Halfpel motion compensation with no rounding (a+b)>>1.
-     * this is an array[2][4] of motion compensation functions for 2
-     * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
-     * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
-     * @param block destination where the result is stored
-     * @param pixels source
-     * @param line_size number of bytes in a horizontal line of block
-     * @param h height
-     */
-    op_pixels_func put_no_rnd_pixels_tab[2][4];
-
-    /**
-     * Halfpel motion compensation with no rounding (a+b)>>1.
-     * this is an array[4] of motion compensation functions for 1
-     * horizontal blocksize (16) and the 4 halfpel positions<br>
-     * *pixels_tab[0][ xhalfpel + 2*yhalfpel ]
-     * @param block destination into which the result is averaged (a+b)>>1
-     * @param pixels source
-     * @param line_size number of bytes in a horizontal line of block
-     * @param h height
-     */
-    op_pixels_func avg_no_rnd_pixels_tab[4];
-} HpelDSPContext;
-
-void ff_hpeldsp_init(HpelDSPContext *c, int flags);
-
-void ff_hpeldsp_init_aarch64(HpelDSPContext *c, int flags);
-void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags);
-void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags);
-void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags);
-void ff_hpeldsp_init_vis(HpelDSPContext *c, int flags);
-void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags);
-
-#endif /* AVCODEC_HPELDSP_H */
diff --git a/deps/libav/libavcodec/hpeldsp_template.c b/deps/libav/libavcodec/hpeldsp_template.c
deleted file mode 100644
index 6518941..0000000
--- a/deps/libav/libavcodec/hpeldsp_template.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Half-pel DSP functions.
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * gmc & q-pel & 32/64 bit based MC by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Half-pel DSP functions.
- */
-
-#include "bit_depth_template.c"
-
-#include "hpel_template.c"
-
-#define PIXOP2(OPNAME, OP) \
-static inline void FUNC(OPNAME ## _no_rnd_pixels8_l2)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
-                                                int src_stride1, int src_stride2, int h){\
-    int i;\
-    for(i=0; i<h; i++){\
-        pixel4 a,b;\
-        a= AV_RN4P(&src1[i*src_stride1  ]);\
-        b= AV_RN4P(&src2[i*src_stride2  ]);\
-        OP(*((pixel4*)&dst[i*dst_stride  ]), no_rnd_avg_pixel4(a, b));\
-        a= AV_RN4P(&src1[i*src_stride1+4*sizeof(pixel)]);\
-        b= AV_RN4P(&src2[i*src_stride2+4*sizeof(pixel)]);\
-        OP(*((pixel4*)&dst[i*dst_stride+4*sizeof(pixel)]), no_rnd_avg_pixel4(a, b));\
-    }\
-}\
-\
-static inline void FUNCC(OPNAME ## _no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels4_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels4_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels2_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels2_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *_block, const uint8_t *_pixels, ptrdiff_t line_size, int h)\
-{\
-        int i, a0, b0, a1, b1;\
-        pixel *block = (pixel*)_block;\
-        const pixel *pixels = (const pixel*)_pixels;\
-        line_size /= sizeof(pixel);\
-        a0= pixels[0];\
-        b0= pixels[1] + 2;\
-        a0 += b0;\
-        b0 += pixels[2];\
-\
-        pixels+=line_size;\
-        for(i=0; i<h; i+=2){\
-            a1= pixels[0];\
-            b1= pixels[1];\
-            a1 += b1;\
-            b1 += pixels[2];\
-\
-            block[0]= (a1+a0)>>2; /* FIXME non put */\
-            block[1]= (b1+b0)>>2;\
-\
-            pixels+=line_size;\
-            block +=line_size;\
-\
-            a0= pixels[0];\
-            b0= pixels[1] + 2;\
-            a0 += b0;\
-            b0 += pixels[2];\
-\
-            block[0]= (a1+a0)>>2;\
-            block[1]= (b1+b0)>>2;\
-            pixels+=line_size;\
-            block +=line_size;\
-        }\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels4_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\
-{\
-        /* FIXME HIGH BIT DEPTH */\
-        int i;\
-        const uint32_t a= AV_RN32(pixels  );\
-        const uint32_t b= AV_RN32(pixels+1);\
-        uint32_t l0=  (a&0x03030303UL)\
-                    + (b&0x03030303UL)\
-                    + 0x02020202UL;\
-        uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
-                   + ((b&0xFCFCFCFCUL)>>2);\
-        uint32_t l1,h1;\
-\
-        pixels+=line_size;\
-        for(i=0; i<h; i+=2){\
-            uint32_t a= AV_RN32(pixels  );\
-            uint32_t b= AV_RN32(pixels+1);\
-            l1=  (a&0x03030303UL)\
-               + (b&0x03030303UL);\
-            h1= ((a&0xFCFCFCFCUL)>>2)\
-              + ((b&0xFCFCFCFCUL)>>2);\
-            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-            pixels+=line_size;\
-            block +=line_size;\
-            a= AV_RN32(pixels  );\
-            b= AV_RN32(pixels+1);\
-            l0=  (a&0x03030303UL)\
-               + (b&0x03030303UL)\
-               + 0x02020202UL;\
-            h0= ((a&0xFCFCFCFCUL)>>2)\
-              + ((b&0xFCFCFCFCUL)>>2);\
-            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-            pixels+=line_size;\
-            block +=line_size;\
-        }\
-}\
-\
-static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\
-{\
-    /* FIXME HIGH BIT DEPTH */\
-    int j;\
-    for(j=0; j<2; j++){\
-        int i;\
-        const uint32_t a= AV_RN32(pixels  );\
-        const uint32_t b= AV_RN32(pixels+1);\
-        uint32_t l0=  (a&0x03030303UL)\
-                    + (b&0x03030303UL)\
-                    + 0x02020202UL;\
-        uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
-                   + ((b&0xFCFCFCFCUL)>>2);\
-        uint32_t l1,h1;\
-\
-        pixels+=line_size;\
-        for(i=0; i<h; i+=2){\
-            uint32_t a= AV_RN32(pixels  );\
-            uint32_t b= AV_RN32(pixels+1);\
-            l1=  (a&0x03030303UL)\
-               + (b&0x03030303UL);\
-            h1= ((a&0xFCFCFCFCUL)>>2)\
-              + ((b&0xFCFCFCFCUL)>>2);\
-            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-            pixels+=line_size;\
-            block +=line_size;\
-            a= AV_RN32(pixels  );\
-            b= AV_RN32(pixels+1);\
-            l0=  (a&0x03030303UL)\
-               + (b&0x03030303UL)\
-               + 0x02020202UL;\
-            h0= ((a&0xFCFCFCFCUL)>>2)\
-              + ((b&0xFCFCFCFCUL)>>2);\
-            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-            pixels+=line_size;\
-            block +=line_size;\
-        }\
-        pixels+=4-line_size*(h+1);\
-        block +=4-line_size*h;\
-    }\
-}\
-\
-static inline void FUNCC(OPNAME ## _no_rnd_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\
-{\
-    /* FIXME HIGH BIT DEPTH */\
-    int j;\
-    for(j=0; j<2; j++){\
-        int i;\
-        const uint32_t a= AV_RN32(pixels  );\
-        const uint32_t b= AV_RN32(pixels+1);\
-        uint32_t l0=  (a&0x03030303UL)\
-                    + (b&0x03030303UL)\
-                    + 0x01010101UL;\
-        uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
-                   + ((b&0xFCFCFCFCUL)>>2);\
-        uint32_t l1,h1;\
-\
-        pixels+=line_size;\
-        for(i=0; i<h; i+=2){\
-            uint32_t a= AV_RN32(pixels  );\
-            uint32_t b= AV_RN32(pixels+1);\
-            l1=  (a&0x03030303UL)\
-               + (b&0x03030303UL);\
-            h1= ((a&0xFCFCFCFCUL)>>2)\
-              + ((b&0xFCFCFCFCUL)>>2);\
-            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-            pixels+=line_size;\
-            block +=line_size;\
-            a= AV_RN32(pixels  );\
-            b= AV_RN32(pixels+1);\
-            l0=  (a&0x03030303UL)\
-               + (b&0x03030303UL)\
-               + 0x01010101UL;\
-            h0= ((a&0xFCFCFCFCUL)>>2)\
-              + ((b&0xFCFCFCFCUL)>>2);\
-            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
-            pixels+=line_size;\
-            block +=line_size;\
-        }\
-        pixels+=4-line_size*(h+1);\
-        block +=4-line_size*h;\
-    }\
-}\
-\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_x2) , FUNCC(OPNAME ## _pixels8_x2) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_y2) , FUNCC(OPNAME ## _pixels8_y2) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16_xy2), FUNCC(OPNAME ## _pixels8_xy2), 8*sizeof(pixel))\
-av_unused CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16)    , FUNCC(OPNAME ## _pixels8) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_x2) , FUNCC(OPNAME ## _no_rnd_pixels8_x2) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_y2) , FUNCC(OPNAME ## _no_rnd_pixels8_y2) , 8*sizeof(pixel))\
-CALL_2X_PIXELS(FUNCC(OPNAME ## _no_rnd_pixels16_xy2), FUNCC(OPNAME ## _no_rnd_pixels8_xy2), 8*sizeof(pixel))\
-
-#define op_avg(a, b) a = rnd_avg_pixel4(a, b)
-#define op_put(a, b) a = b
-#if BIT_DEPTH == 8
-#define put_no_rnd_pixels8_8_c put_pixels8_8_c
-PIXOP2(avg, op_avg)
-PIXOP2(put, op_put)
-#endif
-#undef op_avg
-#undef op_put
diff --git a/deps/libav/libavcodec/huffman.c b/deps/libav/libavcodec/huffman.c
deleted file mode 100644
index dec2197..0000000
--- a/deps/libav/libavcodec/huffman.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2006 Konstantin Shishkov
- * Copyright (c) 2007 Loren Merritt
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * huffman tree builder and VLC generator
- */
-
-#include <stdint.h>
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "huffman.h"
-
-/* symbol for Huffman tree node */
-#define HNODE -1
-
-typedef struct {
-    uint64_t val;
-    int name;
-} HeapElem;
-
-static void heap_sift(HeapElem *h, int root, int size)
-{
-    while (root * 2 + 1 < size) {
-        int child = root * 2 + 1;
-        if (child < size - 1 && h[child].val > h[child+1].val)
-            child++;
-        if (h[root].val > h[child].val) {
-            FFSWAP(HeapElem, h[root], h[child]);
-            root = child;
-        } else
-            break;
-    }
-}
-
-void ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats)
-{
-    HeapElem h[256];
-    int up[2*256];
-    int len[2*256];
-    int offset, i, next;
-    int size = 256;
-
-    for (offset = 1; ; offset <<= 1) {
-        for (i=0; i < size; i++) {
-            h[i].name = i;
-            h[i].val = (stats[i] << 8) + offset;
-        }
-        for (i = size / 2 - 1; i >= 0; i--)
-            heap_sift(h, i, size);
-
-        for (next = size; next < size * 2 - 1; next++) {
-            // merge the two smallest entries, and put it back in the heap
-            uint64_t min1v = h[0].val;
-            up[h[0].name] = next;
-            h[0].val = INT64_MAX;
-            heap_sift(h, 0, size);
-            up[h[0].name] = next;
-            h[0].name = next;
-            h[0].val += min1v;
-            heap_sift(h, 0, size);
-        }
-
-        len[2 * size - 2] = 0;
-        for (i = 2 * size - 3; i >= size; i--)
-            len[i] = len[up[i]] + 1;
-        for (i = 0; i < size; i++) {
-            dst[i] = len[up[i]] + 1;
-            if (dst[i] >= 32) break;
-        }
-        if (i==size) break;
-    }
-}
-
-static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat,
-                           Node *nodes, int node,
-                           uint32_t pfx, int pl, int *pos, int no_zero_count)
-{
-    int s;
-
-    s = nodes[node].sym;
-    if (s != HNODE || (no_zero_count && !nodes[node].count)) {
-        bits[*pos] = pfx;
-        lens[*pos] = pl;
-        xlat[*pos] = s;
-        (*pos)++;
-    } else {
-        pfx <<= 1;
-        pl++;
-        get_tree_codes(bits, lens, xlat, nodes, nodes[node].n0, pfx, pl,
-                       pos, no_zero_count);
-        pfx |= 1;
-        get_tree_codes(bits, lens, xlat, nodes, nodes[node].n0 + 1, pfx, pl,
-                       pos, no_zero_count);
-    }
-}
-
-static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags)
-{
-    int no_zero_count = !(flags & FF_HUFFMAN_FLAG_ZERO_COUNT);
-    uint32_t bits[256];
-    int16_t lens[256];
-    uint8_t xlat[256];
-    int pos = 0;
-
-    get_tree_codes(bits, lens, xlat, nodes, head, 0, 0,
-                   &pos, no_zero_count);
-    return ff_init_vlc_sparse(vlc, 9, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
-}
-
-
-/**
- * nodes size must be 2*nb_codes
- * first nb_codes nodes.count must be set
- */
-int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,
-                       Node *nodes, HuffCmp cmp, int flags)
-{
-    int i, j;
-    int cur_node;
-    int64_t sum = 0;
-
-    for (i = 0; i < nb_codes; i++) {
-        nodes[i].sym = i;
-        nodes[i].n0 = -2;
-        sum += nodes[i].count;
-    }
-
-    if (sum >> 31) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Too high symbol frequencies. "
-               "Tree construction is not possible\n");
-        return -1;
-    }
-    qsort(nodes, nb_codes, sizeof(Node), cmp);
-    cur_node = nb_codes;
-    nodes[nb_codes*2-1].count = 0;
-    for (i = 0; i < nb_codes * 2 - 1; i += 2) {
-        nodes[cur_node].sym = HNODE;
-        nodes[cur_node].count = nodes[i].count + nodes[i + 1].count;
-        nodes[cur_node].n0 = i;
-        for (j = cur_node; j > 0; j--) {
-            if (nodes[j].count > nodes[j - 1].count ||
-                (nodes[j].count == nodes[j - 1].count &&
-                 (!(flags & FF_HUFFMAN_FLAG_HNODE_FIRST) ||
-                  nodes[j].n0 == j - 1 || nodes[j].n0 == j - 2 ||
-                  (nodes[j].sym!=HNODE && nodes[j-1].sym!=HNODE))))
-                break;
-            FFSWAP(Node, nodes[j], nodes[j - 1]);
-        }
-        cur_node++;
-    }
-    if (build_huff_tree(vlc, nodes, nb_codes * 2 - 2, flags) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error building tree\n");
-        return -1;
-    }
-    return 0;
-}
diff --git a/deps/libav/libavcodec/huffman.h b/deps/libav/libavcodec/huffman.h
deleted file mode 100644
index 043e6e3..0000000
--- a/deps/libav/libavcodec/huffman.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * huffman tree builder and VLC generator
- */
-
-#ifndef AVCODEC_HUFFMAN_H
-#define AVCODEC_HUFFMAN_H
-
-#include "avcodec.h"
-#include "get_bits.h"
-
-typedef struct Node {
-    int16_t  sym;
-    int16_t  n0;
-    uint32_t count;
-} Node;
-
-#define FF_HUFFMAN_FLAG_HNODE_FIRST 0x01
-#define FF_HUFFMAN_FLAG_ZERO_COUNT  0x02
-
-typedef int (*HuffCmp)(const void *va, const void *vb);
-int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,
-                       Node *nodes, HuffCmp cmp, int flags);
-
-void ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats);
-
-#endif /* AVCODEC_HUFFMAN_H */
diff --git a/deps/libav/libavcodec/huffyuv.c b/deps/libav/libavcodec/huffyuv.c
deleted file mode 100644
index d4cf6fa..0000000
--- a/deps/libav/libavcodec/huffyuv.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * huffyuv codec for libavcodec
- *
- * Copyright (c) 2002-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
- * the algorithm used
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * huffyuv codec for libavcodec.
- */
-
-#include <stdint.h>
-
-#include "libavutil/mem.h"
-
-#include "avcodec.h"
-#include "huffyuv.h"
-
-int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table)
-{
-    int len, index;
-    uint32_t bits = 0;
-
-    for (len = 32; len > 0; len--) {
-        for (index = 0; index < 256; index++) {
-            if (len_table[index] == len)
-                dst[index] = bits++;
-        }
-        if (bits & 1) {
-            av_log(NULL, AV_LOG_ERROR, "Error generating huffman table\n");
-            return -1;
-        }
-        bits >>= 1;
-    }
-    return 0;
-}
-
-av_cold int ff_huffyuv_alloc_temp(HYuvContext *s)
-{
-    int i;
-
-    if (s->bitstream_bpp<24) {
-        for (i=0; i<3; i++) {
-            s->temp[i]= av_malloc(s->width + 16);
-            if (!s->temp[i])
-                return AVERROR(ENOMEM);
-        }
-    } else {
-        s->temp[0]= av_mallocz(4*s->width + 16);
-        if (!s->temp[0])
-            return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-av_cold void ff_huffyuv_common_init(AVCodecContext *avctx)
-{
-    HYuvContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    s->flags = avctx->flags;
-
-    ff_dsputil_init(&s->dsp, avctx);
-
-    s->width = avctx->width;
-    s->height = avctx->height;
-    assert(s->width>0 && s->height>0);
-}
-
-void ff_huffyuv_common_end(HYuvContext *s)
-{
-    int i;
-
-    for(i = 0; i < 3; i++) {
-        av_freep(&s->temp[i]);
-    }
-}
diff --git a/deps/libav/libavcodec/huffyuv.h b/deps/libav/libavcodec/huffyuv.h
deleted file mode 100644
index 9c875d5..0000000
--- a/deps/libav/libavcodec/huffyuv.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2002-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
- * the algorithm used
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * huffyuv codec for libavcodec.
- */
-
-#ifndef AVCODEC_HUFFYUV_H
-#define AVCODEC_HUFFYUV_H
-
-#include <stdint.h>
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "put_bits.h"
-
-#define VLC_BITS 11
-
-#if HAVE_BIGENDIAN
-#define B 3
-#define G 2
-#define R 1
-#define A 0
-#else
-#define B 0
-#define G 1
-#define R 2
-#define A 3
-#endif
-
-typedef enum Predictor {
-    LEFT = 0,
-    PLANE,
-    MEDIAN,
-} Predictor;
-
-typedef struct HYuvContext {
-    AVCodecContext *avctx;
-    Predictor predictor;
-    GetBitContext gb;
-    PutBitContext pb;
-    int interlaced;
-    int decorrelate;
-    int bitstream_bpp;
-    int version;
-    int yuy2;                               //use yuy2 instead of 422P
-    int bgr32;                              //use bgr32 instead of bgr24
-    int width, height;
-    int flags;
-    int context;
-    int picture_number;
-    int last_slice_end;
-    uint8_t *temp[3];
-    uint64_t stats[3][256];
-    uint8_t len[3][256];
-    uint32_t bits[3][256];
-    uint32_t pix_bgr_map[1<<VLC_BITS];
-    VLC vlc[6];                             //Y,U,V,YY,YU,YV
-    uint8_t *bitstream_buffer;
-    unsigned int bitstream_buffer_size;
-    DSPContext dsp;
-} HYuvContext;
-
-void ff_huffyuv_common_init(AVCodecContext *s);
-void ff_huffyuv_common_end(HYuvContext *s);
-int  ff_huffyuv_alloc_temp(HYuvContext *s);
-int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table);
-
-#endif /* AVCODEC_HUFFYUV_H */
diff --git a/deps/libav/libavcodec/huffyuvdec.c b/deps/libav/libavcodec/huffyuvdec.c
deleted file mode 100644
index ed490d4..0000000
--- a/deps/libav/libavcodec/huffyuvdec.c
+++ /dev/null
@@ -1,770 +0,0 @@
-/*
- * huffyuv decoder
- *
- * Copyright (c) 2002-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
- * the algorithm used
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * huffyuv decoder
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "huffyuv.h"
-#include "thread.h"
-
-#define classic_shift_luma_table_size 42
-static const unsigned char classic_shift_luma[classic_shift_luma_table_size + FF_INPUT_BUFFER_PADDING_SIZE] = {
-  34,36,35,69,135,232,9,16,10,24,11,23,12,16,13,10,14,8,15,8,
-  16,8,17,20,16,10,207,206,205,236,11,8,10,21,9,23,8,8,199,70,
-  69,68, 0
-};
-
-#define classic_shift_chroma_table_size 59
-static const unsigned char classic_shift_chroma[classic_shift_chroma_table_size + FF_INPUT_BUFFER_PADDING_SIZE] = {
-  66,36,37,38,39,40,41,75,76,77,110,239,144,81,82,83,84,85,118,183,
-  56,57,88,89,56,89,154,57,58,57,26,141,57,56,58,57,58,57,184,119,
-  214,245,116,83,82,49,80,79,78,77,44,75,41,40,39,38,37,36,34, 0
-};
-
-static const unsigned char classic_add_luma[256] = {
-    3,  9,  5, 12, 10, 35, 32, 29, 27, 50, 48, 45, 44, 41, 39, 37,
-   73, 70, 68, 65, 64, 61, 58, 56, 53, 50, 49, 46, 44, 41, 38, 36,
-   68, 65, 63, 61, 58, 55, 53, 51, 48, 46, 45, 43, 41, 39, 38, 36,
-   35, 33, 32, 30, 29, 27, 26, 25, 48, 47, 46, 44, 43, 41, 40, 39,
-   37, 36, 35, 34, 32, 31, 30, 28, 27, 26, 24, 23, 22, 20, 19, 37,
-   35, 34, 33, 31, 30, 29, 27, 26, 24, 23, 21, 20, 18, 17, 15, 29,
-   27, 26, 24, 22, 21, 19, 17, 16, 14, 26, 25, 23, 21, 19, 18, 16,
-   15, 27, 25, 23, 21, 19, 17, 16, 14, 26, 25, 23, 21, 18, 17, 14,
-   12, 17, 19, 13,  4,  9,  2, 11,  1,  7,  8,  0, 16,  3, 14,  6,
-   12, 10,  5, 15, 18, 11, 10, 13, 15, 16, 19, 20, 22, 24, 27, 15,
-   18, 20, 22, 24, 26, 14, 17, 20, 22, 24, 27, 15, 18, 20, 23, 25,
-   28, 16, 19, 22, 25, 28, 32, 36, 21, 25, 29, 33, 38, 42, 45, 49,
-   28, 31, 34, 37, 40, 42, 44, 47, 49, 50, 52, 54, 56, 57, 59, 60,
-   62, 64, 66, 67, 69, 35, 37, 39, 40, 42, 43, 45, 47, 48, 51, 52,
-   54, 55, 57, 59, 60, 62, 63, 66, 67, 69, 71, 72, 38, 40, 42, 43,
-   46, 47, 49, 51, 26, 28, 30, 31, 33, 34, 18, 19, 11, 13,  7,  8,
-};
-
-static const unsigned char classic_add_chroma[256] = {
-    3,  1,  2,  2,  2,  2,  3,  3,  7,  5,  7,  5,  8,  6, 11,  9,
-    7, 13, 11, 10,  9,  8,  7,  5,  9,  7,  6,  4,  7,  5,  8,  7,
-   11,  8, 13, 11, 19, 15, 22, 23, 20, 33, 32, 28, 27, 29, 51, 77,
-   43, 45, 76, 81, 46, 82, 75, 55, 56,144, 58, 80, 60, 74,147, 63,
-  143, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-   80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 27, 30, 21, 22,
-   17, 14,  5,  6,100, 54, 47, 50, 51, 53,106,107,108,109,110,111,
-  112,113,114,115,  4,117,118, 92, 94,121,122,  3,124,103,  2,  1,
-    0,129,130,131,120,119,126,125,136,137,138,139,140,141,142,134,
-  135,132,133,104, 64,101, 62, 57,102, 95, 93, 59, 61, 28, 97, 96,
-   52, 49, 48, 29, 32, 25, 24, 46, 23, 98, 45, 44, 43, 20, 42, 41,
-   19, 18, 99, 40, 15, 39, 38, 16, 13, 12, 11, 37, 10,  9,  8, 36,
-    7,128,127,105,123,116, 35, 34, 33,145, 31, 79, 42,146, 78, 26,
-   83, 48, 49, 50, 44, 47, 26, 31, 30, 18, 17, 19, 21, 24, 25, 13,
-   14, 16, 17, 18, 20, 21, 12, 14, 15,  9, 10,  6,  9,  6,  5,  8,
-    6, 12,  8, 10,  7,  9,  6,  4,  6,  2,  2,  3,  3,  3,  3,  2,
-};
-
-static int read_len_table(uint8_t *dst, GetBitContext *gb)
-{
-    int i, val, repeat;
-
-    for (i = 0; i < 256;) {
-        repeat = get_bits(gb, 3);
-        val    = get_bits(gb, 5);
-        if (repeat == 0)
-            repeat = get_bits(gb, 8);
-        if (i + repeat > 256 || get_bits_left(gb) < 0) {
-            av_log(NULL, AV_LOG_ERROR, "Error reading huffman table\n");
-            return -1;
-        }
-        while (repeat--)
-            dst[i++] = val;
-    }
-    return 0;
-}
-
-static void generate_joint_tables(HYuvContext *s)
-{
-    uint16_t symbols[1 << VLC_BITS];
-    uint16_t bits[1 << VLC_BITS];
-    uint8_t len[1 << VLC_BITS];
-    if (s->bitstream_bpp < 24) {
-        int p, i, y, u;
-        for (p = 0; p < 3; p++) {
-            for (i = y = 0; y < 256; y++) {
-                int len0 = s->len[0][y];
-                int limit = VLC_BITS - len0;
-                if(limit <= 0)
-                    continue;
-                for (u = 0; u < 256; u++) {
-                    int len1 = s->len[p][u];
-                    if (len1 > limit)
-                        continue;
-                    len[i] = len0 + len1;
-                    bits[i] = (s->bits[0][y] << len1) + s->bits[p][u];
-                    symbols[i] = (y << 8) + u;
-                    if(symbols[i] != 0xffff) // reserved to mean "invalid"
-                        i++;
-                }
-            }
-            ff_free_vlc(&s->vlc[3 + p]);
-            ff_init_vlc_sparse(&s->vlc[3 + p], VLC_BITS, i, len, 1, 1,
-                               bits, 2, 2, symbols, 2, 2, 0);
-        }
-    } else {
-        uint8_t (*map)[4] = (uint8_t(*)[4])s->pix_bgr_map;
-        int i, b, g, r, code;
-        int p0 = s->decorrelate;
-        int p1 = !s->decorrelate;
-        // restrict the range to +/-16 because that's pretty much guaranteed to
-        // cover all the combinations that fit in 11 bits total, and it doesn't
-        // matter if we miss a few rare codes.
-        for (i = 0, g = -16; g < 16; g++) {
-            int len0 = s->len[p0][g & 255];
-            int limit0 = VLC_BITS - len0;
-            if (limit0 < 2)
-                continue;
-            for (b = -16; b < 16; b++) {
-                int len1 = s->len[p1][b & 255];
-                int limit1 = limit0 - len1;
-                if (limit1 < 1)
-                    continue;
-                code = (s->bits[p0][g & 255] << len1) + s->bits[p1][b & 255];
-                for (r = -16; r < 16; r++) {
-                    int len2 = s->len[2][r & 255];
-                    if (len2 > limit1)
-                        continue;
-                    len[i] = len0 + len1 + len2;
-                    bits[i] = (code << len2) + s->bits[2][r & 255];
-                    if (s->decorrelate) {
-                        map[i][G] = g;
-                        map[i][B] = g + b;
-                        map[i][R] = g + r;
-                    } else {
-                        map[i][B] = g;
-                        map[i][G] = b;
-                        map[i][R] = r;
-                    }
-                    i++;
-                }
-            }
-        }
-        ff_free_vlc(&s->vlc[3]);
-        init_vlc(&s->vlc[3], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0);
-    }
-}
-
-static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)
-{
-    GetBitContext gb;
-    int i;
-
-    init_get_bits(&gb, src, length * 8);
-
-    for (i = 0; i < 3; i++) {
-        if (read_len_table(s->len[i], &gb) < 0)
-            return -1;
-        if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0) {
-            return -1;
-        }
-        ff_free_vlc(&s->vlc[i]);
-        init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
-                 s->bits[i], 4, 4, 0);
-    }
-
-    generate_joint_tables(s);
-
-    return (get_bits_count(&gb) + 7) / 8;
-}
-
-static int read_old_huffman_tables(HYuvContext *s)
-{
-    GetBitContext gb;
-    int i;
-
-    init_get_bits(&gb, classic_shift_luma,
-                  classic_shift_luma_table_size * 8);
-    if (read_len_table(s->len[0], &gb) < 0)
-        return -1;
-
-    init_get_bits(&gb, classic_shift_chroma,
-                  classic_shift_chroma_table_size * 8);
-    if (read_len_table(s->len[1], &gb) < 0)
-        return -1;
-
-    for(i=0; i<256; i++) s->bits[0][i] = classic_add_luma  [i];
-    for(i=0; i<256; i++) s->bits[1][i] = classic_add_chroma[i];
-
-    if (s->bitstream_bpp >= 24) {
-        memcpy(s->bits[1], s->bits[0], 256 * sizeof(uint32_t));
-        memcpy(s->len[1] , s->len [0], 256 * sizeof(uint8_t));
-    }
-    memcpy(s->bits[2], s->bits[1], 256 * sizeof(uint32_t));
-    memcpy(s->len[2] , s->len [1], 256 * sizeof(uint8_t));
-
-    for (i = 0; i < 3; i++) {
-        ff_free_vlc(&s->vlc[i]);
-        init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
-                 s->bits[i], 4, 4, 0);
-    }
-
-    generate_joint_tables(s);
-
-    return 0;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    HYuvContext *s = avctx->priv_data;
-
-    ff_huffyuv_common_init(avctx);
-    memset(s->vlc, 0, 3 * sizeof(VLC));
-
-    s->interlaced = s->height > 288;
-
-    s->bgr32 = 1;
-
-    if (avctx->extradata_size) {
-        if ((avctx->bits_per_coded_sample & 7) &&
-            avctx->bits_per_coded_sample != 12)
-            s->version = 1; // do such files exist at all?
-        else
-            s->version = 2;
-    } else
-        s->version = 0;
-
-    if (s->version == 2) {
-        int method, interlace;
-
-        if (avctx->extradata_size < 4)
-            return -1;
-
-        method = ((uint8_t*)avctx->extradata)[0];
-        s->decorrelate = method & 64 ? 1 : 0;
-        s->predictor = method & 63;
-        s->bitstream_bpp = ((uint8_t*)avctx->extradata)[1];
-        if (s->bitstream_bpp == 0)
-            s->bitstream_bpp = avctx->bits_per_coded_sample & ~7;
-        interlace = (((uint8_t*)avctx->extradata)[2] & 0x30) >> 4;
-        s->interlaced = (interlace == 1) ? 1 : (interlace == 2) ? 0 : s->interlaced;
-        s->context = ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0;
-
-        if ( read_huffman_tables(s, ((uint8_t*)avctx->extradata) + 4,
-                                 avctx->extradata_size - 4) < 0)
-            return -1;
-    }else{
-        switch (avctx->bits_per_coded_sample & 7) {
-        case 1:
-            s->predictor = LEFT;
-            s->decorrelate = 0;
-            break;
-        case 2:
-            s->predictor = LEFT;
-            s->decorrelate = 1;
-            break;
-        case 3:
-            s->predictor = PLANE;
-            s->decorrelate = avctx->bits_per_coded_sample >= 24;
-            break;
-        case 4:
-            s->predictor = MEDIAN;
-            s->decorrelate = 0;
-            break;
-        default:
-            s->predictor = LEFT; //OLD
-            s->decorrelate = 0;
-            break;
-        }
-        s->bitstream_bpp = avctx->bits_per_coded_sample & ~7;
-        s->context = 0;
-
-        if (read_old_huffman_tables(s) < 0)
-            return -1;
-    }
-
-    switch (s->bitstream_bpp) {
-    case 12:
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-        break;
-    case 16:
-        if (s->yuy2) {
-            avctx->pix_fmt = AV_PIX_FMT_YUYV422;
-        } else {
-            avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-        }
-        break;
-    case 24:
-    case 32:
-        if (s->bgr32) {
-            avctx->pix_fmt = AV_PIX_FMT_RGB32;
-        } else {
-            avctx->pix_fmt = AV_PIX_FMT_BGR24;
-        }
-        break;
-    default:
-        return AVERROR_INVALIDDATA;
-    }
-
-    ff_huffyuv_alloc_temp(s);
-
-    return 0;
-}
-
-static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
-{
-    HYuvContext *s = avctx->priv_data;
-    int i;
-
-    ff_huffyuv_alloc_temp(s);
-
-    for (i = 0; i < 6; i++)
-        s->vlc[i].table = NULL;
-
-    if (s->version == 2) {
-        if (read_huffman_tables(s, ((uint8_t*)avctx->extradata) + 4,
-                                avctx->extradata_size) < 0)
-            return -1;
-    } else {
-        if (read_old_huffman_tables(s) < 0)
-            return -1;
-    }
-
-    return 0;
-}
-
-/* TODO instead of restarting the read when the code isn't in the first level
- * of the joint table, jump into the 2nd level of the individual table. */
-#define READ_2PIX(dst0, dst1, plane1){\
-    uint16_t code = get_vlc2(&s->gb, s->vlc[3+plane1].table, VLC_BITS, 1);\
-    if(code != 0xffff){\
-        dst0 = code>>8;\
-        dst1 = code;\
-    }else{\
-        dst0 = get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);\
-        dst1 = get_vlc2(&s->gb, s->vlc[plane1].table, VLC_BITS, 3);\
-    }\
-}
-
-static void decode_422_bitstream(HYuvContext *s, int count)
-{
-    int i;
-
-    count /= 2;
-
-    if (count >= (get_bits_left(&s->gb)) / (31 * 4)) {
-        for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
-            READ_2PIX(s->temp[0][2 * i    ], s->temp[1][i], 1);
-            READ_2PIX(s->temp[0][2 * i + 1], s->temp[2][i], 2);
-        }
-    } else {
-        for (i = 0; i < count; i++) {
-            READ_2PIX(s->temp[0][2 * i    ], s->temp[1][i], 1);
-            READ_2PIX(s->temp[0][2 * i + 1], s->temp[2][i], 2);
-        }
-    }
-}
-
-static void decode_gray_bitstream(HYuvContext *s, int count)
-{
-    int i;
-
-    count/=2;
-
-    if (count >= (get_bits_left(&s->gb)) / (31 * 2)) {
-        for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
-            READ_2PIX(s->temp[0][2 * i], s->temp[0][2 * i + 1], 0);
-        }
-    } else {
-        for(i=0; i<count; i++){
-            READ_2PIX(s->temp[0][2 * i], s->temp[0][2 * i + 1], 0);
-        }
-    }
-}
-
-static av_always_inline void decode_bgr_1(HYuvContext *s, int count,
-                                          int decorrelate, int alpha)
-{
-    int i;
-    for (i = 0; i < count; i++) {
-        int code = get_vlc2(&s->gb, s->vlc[3].table, VLC_BITS, 1);
-        if (code != -1) {
-            *(uint32_t*)&s->temp[0][4 * i] = s->pix_bgr_map[code];
-        } else if(decorrelate) {
-            s->temp[0][4 * i + G] = get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
-            s->temp[0][4 * i + B] = get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3) +
-                                    s->temp[0][4 * i + G];
-            s->temp[0][4 * i + R] = get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3) +
-                                    s->temp[0][4 * i + G];
-        } else {
-            s->temp[0][4 * i + B] = get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
-            s->temp[0][4 * i + G] = get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
-            s->temp[0][4 * i + R] = get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
-        }
-        if (alpha)
-            s->temp[0][4 * i + A] = get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
-    }
-}
-
-static void decode_bgr_bitstream(HYuvContext *s, int count)
-{
-    if (s->decorrelate) {
-        if (s->bitstream_bpp==24)
-            decode_bgr_1(s, count, 1, 0);
-        else
-            decode_bgr_1(s, count, 1, 1);
-    } else {
-        if (s->bitstream_bpp==24)
-            decode_bgr_1(s, count, 0, 0);
-        else
-            decode_bgr_1(s, count, 0, 1);
-    }
-}
-
-static void draw_slice(HYuvContext *s, AVFrame *frame, int y)
-{
-    int h, cy, i;
-    int offset[AV_NUM_DATA_POINTERS];
-
-    if (s->avctx->draw_horiz_band==NULL)
-        return;
-
-    h = y - s->last_slice_end;
-    y -= h;
-
-    if (s->bitstream_bpp == 12) {
-        cy = y>>1;
-    } else {
-        cy = y;
-    }
-
-    offset[0] = frame->linesize[0] * y;
-    offset[1] = frame->linesize[1] * cy;
-    offset[2] = frame->linesize[2] * cy;
-    for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
-        offset[i] = 0;
-    emms_c();
-
-    s->avctx->draw_horiz_band(s->avctx, frame, offset, y, 3, h);
-
-    s->last_slice_end = y + h;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    HYuvContext *s = avctx->priv_data;
-    const int width = s->width;
-    const int width2 = s->width>>1;
-    const int height = s->height;
-    int fake_ystride, fake_ustride, fake_vstride;
-    ThreadFrame frame = { .f = data };
-    AVFrame * const p = data;
-    int table_size = 0;
-
-    av_fast_malloc(&s->bitstream_buffer,
-                   &s->bitstream_buffer_size,
-                   buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!s->bitstream_buffer)
-        return AVERROR(ENOMEM);
-
-    memset(s->bitstream_buffer + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer,
-                     (const uint32_t*)buf, buf_size / 4);
-
-    if (ff_thread_get_buffer(avctx, &frame, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
-
-    if (s->context) {
-        table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size);
-        if (table_size < 0)
-            return -1;
-    }
-
-    if ((unsigned)(buf_size-table_size) >= INT_MAX / 8)
-        return -1;
-
-    init_get_bits(&s->gb, s->bitstream_buffer+table_size,
-                  (buf_size-table_size) * 8);
-
-    fake_ystride = s->interlaced ? p->linesize[0] * 2  : p->linesize[0];
-    fake_ustride = s->interlaced ? p->linesize[1] * 2  : p->linesize[1];
-    fake_vstride = s->interlaced ? p->linesize[2] * 2  : p->linesize[2];
-
-    s->last_slice_end = 0;
-
-    if (s->bitstream_bpp < 24) {
-        int y, cy;
-        int lefty, leftu, leftv;
-        int lefttopy, lefttopu, lefttopv;
-
-        if (s->yuy2) {
-            p->data[0][3] = get_bits(&s->gb, 8);
-            p->data[0][2] = get_bits(&s->gb, 8);
-            p->data[0][1] = get_bits(&s->gb, 8);
-            p->data[0][0] = get_bits(&s->gb, 8);
-
-            av_log(avctx, AV_LOG_ERROR,
-                   "YUY2 output is not implemented yet\n");
-            return -1;
-        } else {
-
-            leftv = p->data[2][0] = get_bits(&s->gb, 8);
-            lefty = p->data[0][1] = get_bits(&s->gb, 8);
-            leftu = p->data[1][0] = get_bits(&s->gb, 8);
-                    p->data[0][0] = get_bits(&s->gb, 8);
-
-            switch (s->predictor) {
-            case LEFT:
-            case PLANE:
-                decode_422_bitstream(s, width-2);
-                lefty = s->dsp.add_hfyu_left_prediction(p->data[0] + 2, s->temp[0], width-2, lefty);
-                if (!(s->flags&CODEC_FLAG_GRAY)) {
-                    leftu = s->dsp.add_hfyu_left_prediction(p->data[1] + 1, s->temp[1], width2 - 1, leftu);
-                    leftv = s->dsp.add_hfyu_left_prediction(p->data[2] + 1, s->temp[2], width2 - 1, leftv);
-                }
-
-                for (cy = y = 1; y < s->height; y++, cy++) {
-                    uint8_t *ydst, *udst, *vdst;
-
-                    if (s->bitstream_bpp == 12) {
-                        decode_gray_bitstream(s, width);
-
-                        ydst = p->data[0] + p->linesize[0] * y;
-
-                        lefty = s->dsp.add_hfyu_left_prediction(ydst, s->temp[0], width, lefty);
-                        if (s->predictor == PLANE) {
-                            if (y > s->interlaced)
-                                s->dsp.add_bytes(ydst, ydst - fake_ystride, width);
-                        }
-                        y++;
-                        if (y >= s->height) break;
-                    }
-
-                    draw_slice(s, p, y);
-
-                    ydst = p->data[0] + p->linesize[0]*y;
-                    udst = p->data[1] + p->linesize[1]*cy;
-                    vdst = p->data[2] + p->linesize[2]*cy;
-
-                    decode_422_bitstream(s, width);
-                    lefty = s->dsp.add_hfyu_left_prediction(ydst, s->temp[0], width, lefty);
-                    if (!(s->flags & CODEC_FLAG_GRAY)) {
-                        leftu= s->dsp.add_hfyu_left_prediction(udst, s->temp[1], width2, leftu);
-                        leftv= s->dsp.add_hfyu_left_prediction(vdst, s->temp[2], width2, leftv);
-                    }
-                    if (s->predictor == PLANE) {
-                        if (cy > s->interlaced) {
-                            s->dsp.add_bytes(ydst, ydst - fake_ystride, width);
-                            if (!(s->flags & CODEC_FLAG_GRAY)) {
-                                s->dsp.add_bytes(udst, udst - fake_ustride, width2);
-                                s->dsp.add_bytes(vdst, vdst - fake_vstride, width2);
-                            }
-                        }
-                    }
-                }
-                draw_slice(s, p, height);
-
-                break;
-            case MEDIAN:
-                /* first line except first 2 pixels is left predicted */
-                decode_422_bitstream(s, width - 2);
-                lefty= s->dsp.add_hfyu_left_prediction(p->data[0] + 2, s->temp[0], width - 2, lefty);
-                if (!(s->flags & CODEC_FLAG_GRAY)) {
-                    leftu = s->dsp.add_hfyu_left_prediction(p->data[1] + 1, s->temp[1], width2 - 1, leftu);
-                    leftv = s->dsp.add_hfyu_left_prediction(p->data[2] + 1, s->temp[2], width2 - 1, leftv);
-                }
-
-                cy = y = 1;
-
-                /* second line is left predicted for interlaced case */
-                if (s->interlaced) {
-                    decode_422_bitstream(s, width);
-                    lefty = s->dsp.add_hfyu_left_prediction(p->data[0] + p->linesize[0], s->temp[0], width, lefty);
-                    if (!(s->flags & CODEC_FLAG_GRAY)) {
-                        leftu = s->dsp.add_hfyu_left_prediction(p->data[1] + p->linesize[2], s->temp[1], width2, leftu);
-                        leftv = s->dsp.add_hfyu_left_prediction(p->data[2] + p->linesize[1], s->temp[2], width2, leftv);
-                    }
-                    y++; cy++;
-                }
-
-                /* next 4 pixels are left predicted too */
-                decode_422_bitstream(s, 4);
-                lefty = s->dsp.add_hfyu_left_prediction(p->data[0] + fake_ystride, s->temp[0], 4, lefty);
-                if (!(s->flags&CODEC_FLAG_GRAY)) {
-                    leftu = s->dsp.add_hfyu_left_prediction(p->data[1] + fake_ustride, s->temp[1], 2, leftu);
-                    leftv = s->dsp.add_hfyu_left_prediction(p->data[2] + fake_vstride, s->temp[2], 2, leftv);
-                }
-
-                /* next line except the first 4 pixels is median predicted */
-                lefttopy = p->data[0][3];
-                decode_422_bitstream(s, width - 4);
-                s->dsp.add_hfyu_median_prediction(p->data[0] + fake_ystride+4, p->data[0]+4, s->temp[0], width-4, &lefty, &lefttopy);
-                if (!(s->flags&CODEC_FLAG_GRAY)) {
-                    lefttopu = p->data[1][1];
-                    lefttopv = p->data[2][1];
-                    s->dsp.add_hfyu_median_prediction(p->data[1] + fake_ustride+2, p->data[1] + 2, s->temp[1], width2 - 2, &leftu, &lefttopu);
-                    s->dsp.add_hfyu_median_prediction(p->data[2] + fake_vstride+2, p->data[2] + 2, s->temp[2], width2 - 2, &leftv, &lefttopv);
-                }
-                y++; cy++;
-
-                for (; y<height; y++, cy++) {
-                    uint8_t *ydst, *udst, *vdst;
-
-                    if (s->bitstream_bpp == 12) {
-                        while (2 * cy > y) {
-                            decode_gray_bitstream(s, width);
-                            ydst = p->data[0] + p->linesize[0] * y;
-                            s->dsp.add_hfyu_median_prediction(ydst, ydst - fake_ystride, s->temp[0], width, &lefty, &lefttopy);
-                            y++;
-                        }
-                        if (y >= height) break;
-                    }
-                    draw_slice(s, p, y);
-
-                    decode_422_bitstream(s, width);
-
-                    ydst = p->data[0] + p->linesize[0] * y;
-                    udst = p->data[1] + p->linesize[1] * cy;
-                    vdst = p->data[2] + p->linesize[2] * cy;
-
-                    s->dsp.add_hfyu_median_prediction(ydst, ydst - fake_ystride, s->temp[0], width, &lefty, &lefttopy);
-                    if (!(s->flags & CODEC_FLAG_GRAY)) {
-                        s->dsp.add_hfyu_median_prediction(udst, udst - fake_ustride, s->temp[1], width2, &leftu, &lefttopu);
-                        s->dsp.add_hfyu_median_prediction(vdst, vdst - fake_vstride, s->temp[2], width2, &leftv, &lefttopv);
-                    }
-                }
-
-                draw_slice(s, p, height);
-                break;
-            }
-        }
-    } else {
-        int y;
-        int leftr, leftg, leftb, lefta;
-        const int last_line = (height - 1) * p->linesize[0];
-
-        if (s->bitstream_bpp == 32) {
-            lefta = p->data[0][last_line+A] = get_bits(&s->gb, 8);
-            leftr = p->data[0][last_line+R] = get_bits(&s->gb, 8);
-            leftg = p->data[0][last_line+G] = get_bits(&s->gb, 8);
-            leftb = p->data[0][last_line+B] = get_bits(&s->gb, 8);
-        } else {
-            leftr = p->data[0][last_line+R] = get_bits(&s->gb, 8);
-            leftg = p->data[0][last_line+G] = get_bits(&s->gb, 8);
-            leftb = p->data[0][last_line+B] = get_bits(&s->gb, 8);
-            lefta = p->data[0][last_line+A] = 255;
-            skip_bits(&s->gb, 8);
-        }
-
-        if (s->bgr32) {
-            switch (s->predictor) {
-            case LEFT:
-            case PLANE:
-                decode_bgr_bitstream(s, width - 1);
-                s->dsp.add_hfyu_left_prediction_bgr32(p->data[0] + last_line+4, s->temp[0], width - 1, &leftr, &leftg, &leftb, &lefta);
-
-                for (y = s->height - 2; y >= 0; y--) { //Yes it is stored upside down.
-                    decode_bgr_bitstream(s, width);
-
-                    s->dsp.add_hfyu_left_prediction_bgr32(p->data[0] + p->linesize[0]*y, s->temp[0], width, &leftr, &leftg, &leftb, &lefta);
-                    if (s->predictor == PLANE) {
-                        if (s->bitstream_bpp != 32) lefta = 0;
-                        if ((y & s->interlaced) == 0 &&
-                            y < s->height - 1 - s->interlaced) {
-                            s->dsp.add_bytes(p->data[0] + p->linesize[0] * y,
-                                             p->data[0] + p->linesize[0] * y +
-                                             fake_ystride, fake_ystride);
-                        }
-                    }
-                }
-                // just 1 large slice as this is not possible in reverse order
-                draw_slice(s, p, height);
-                break;
-            default:
-                av_log(avctx, AV_LOG_ERROR,
-                       "prediction type not supported!\n");
-            }
-        }else{
-            av_log(avctx, AV_LOG_ERROR,
-                   "BGR24 output is not implemented yet\n");
-            return -1;
-        }
-    }
-    emms_c();
-
-    *got_frame = 1;
-
-    return (get_bits_count(&s->gb) + 31) / 32 * 4 + table_size;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    HYuvContext *s = avctx->priv_data;
-    int i;
-
-    ff_huffyuv_common_end(s);
-    av_freep(&s->bitstream_buffer);
-
-    for (i = 0; i < 6; i++) {
-        ff_free_vlc(&s->vlc[i]);
-    }
-
-    return 0;
-}
-
-#if CONFIG_HUFFYUV_DECODER
-AVCodec ff_huffyuv_decoder = {
-    .name             = "huffyuv",
-    .long_name        = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),
-    .type             = AVMEDIA_TYPE_VIDEO,
-    .id               = AV_CODEC_ID_HUFFYUV,
-    .priv_data_size   = sizeof(HYuvContext),
-    .init             = decode_init,
-    .close            = decode_end,
-    .decode           = decode_frame,
-    .capabilities     = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND |
-                        CODEC_CAP_FRAME_THREADS,
-    .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
-};
-#endif
-
-#if CONFIG_FFVHUFF_DECODER
-AVCodec ff_ffvhuff_decoder = {
-    .name             = "ffvhuff",
-    .long_name        = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"),
-    .type             = AVMEDIA_TYPE_VIDEO,
-    .id               = AV_CODEC_ID_FFVHUFF,
-    .priv_data_size   = sizeof(HYuvContext),
-    .init             = decode_init,
-    .close            = decode_end,
-    .decode           = decode_frame,
-    .capabilities     = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND |
-                        CODEC_CAP_FRAME_THREADS,
-    .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
-};
-#endif
diff --git a/deps/libav/libavcodec/huffyuvenc.c b/deps/libav/libavcodec/huffyuvenc.c
deleted file mode 100644
index ec07abd..0000000
--- a/deps/libav/libavcodec/huffyuvenc.c
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * Copyright (c) 2002-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
- * the algorithm used
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * huffyuv encoder
- */
-
-#include "avcodec.h"
-#include "huffyuv.h"
-#include "huffman.h"
-#include "put_bits.h"
-
-static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst,
-                                      uint8_t *src, int w, int left)
-{
-    int i;
-    if (w < 32) {
-        for (i = 0; i < w; i++) {
-            const int temp = src[i];
-            dst[i] = temp - left;
-            left   = temp;
-        }
-        return left;
-    } else {
-        for (i = 0; i < 16; i++) {
-            const int temp = src[i];
-            dst[i] = temp - left;
-            left   = temp;
-        }
-        s->dsp.diff_bytes(dst + 16, src + 16, src + 15, w - 16);
-        return src[w-1];
-    }
-}
-
-static inline void sub_left_prediction_bgr32(HYuvContext *s, uint8_t *dst,
-                                             uint8_t *src, int w,
-                                             int *red, int *green, int *blue,
-                                             int *alpha)
-{
-    int i;
-    int r, g, b, a;
-    r = *red;
-    g = *green;
-    b = *blue;
-    a = *alpha;
-
-    for (i = 0; i < FFMIN(w, 4); i++) {
-        const int rt = src[i * 4 + R];
-        const int gt = src[i * 4 + G];
-        const int bt = src[i * 4 + B];
-        const int at = src[i * 4 + A];
-        dst[i * 4 + R] = rt - r;
-        dst[i * 4 + G] = gt - g;
-        dst[i * 4 + B] = bt - b;
-        dst[i * 4 + A] = at - a;
-        r = rt;
-        g = gt;
-        b = bt;
-        a = at;
-    }
-
-    s->dsp.diff_bytes(dst + 16, src + 16, src + 12, w * 4 - 16);
-
-    *red   = src[(w - 1) * 4 + R];
-    *green = src[(w - 1) * 4 + G];
-    *blue  = src[(w - 1) * 4 + B];
-    *alpha = src[(w - 1) * 4 + A];
-}
-
-static inline void sub_left_prediction_rgb24(HYuvContext *s, uint8_t *dst,
-                                             uint8_t *src, int w,
-                                             int *red, int *green, int *blue)
-{
-    int i;
-    int r, g, b;
-    r = *red;
-    g = *green;
-    b = *blue;
-    for (i = 0; i < FFMIN(w, 16); i++) {
-        const int rt = src[i * 3 + 0];
-        const int gt = src[i * 3 + 1];
-        const int bt = src[i * 3 + 2];
-        dst[i * 3 + 0] = rt - r;
-        dst[i * 3 + 1] = gt - g;
-        dst[i * 3 + 2] = bt - b;
-        r = rt;
-        g = gt;
-        b = bt;
-    }
-
-    s->dsp.diff_bytes(dst + 48, src + 48, src + 48 - 3, w * 3 - 48);
-
-    *red   = src[(w - 1) * 3 + 0];
-    *green = src[(w - 1) * 3 + 1];
-    *blue  = src[(w - 1) * 3 + 2];
-}
-
-static int store_table(HYuvContext *s, const uint8_t *len, uint8_t *buf)
-{
-    int i;
-    int index = 0;
-
-    for (i = 0; i < 256;) {
-        int val = len[i];
-        int repeat = 0;
-
-        for (; i < 256 && len[i] == val && repeat < 255; i++)
-            repeat++;
-
-        assert(val < 32 && val >0 && repeat<256 && repeat>0);
-        if ( repeat > 7) {
-            buf[index++] = val;
-            buf[index++] = repeat;
-        } else {
-            buf[index++] = val | (repeat << 5);
-        }
-    }
-
-    return index;
-}
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    HYuvContext *s = avctx->priv_data;
-    int i, j;
-
-    ff_huffyuv_common_init(avctx);
-
-    avctx->extradata = av_mallocz(1024*30); // 256*3+4 == 772
-    avctx->stats_out = av_mallocz(1024*30); // 21*256*3(%llu ) + 3(\n) + 1(0) = 16132
-    s->version = 2;
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_YUV420P:
-    case AV_PIX_FMT_YUV422P:
-        if (s->width & 1) {
-            av_log(avctx, AV_LOG_ERROR, "Width must be even for this colorspace.\n");
-            return -1;
-        }
-        s->bitstream_bpp = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? 12 : 16;
-        break;
-    case AV_PIX_FMT_RGB32:
-        s->bitstream_bpp = 32;
-        break;
-    case AV_PIX_FMT_RGB24:
-        s->bitstream_bpp = 24;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "format not supported\n");
-        return -1;
-    }
-    avctx->bits_per_coded_sample = s->bitstream_bpp;
-    s->decorrelate = s->bitstream_bpp >= 24;
-    s->predictor = avctx->prediction_method;
-    s->interlaced = avctx->flags&CODEC_FLAG_INTERLACED_ME ? 1 : 0;
-    if (avctx->context_model == 1) {
-        s->context = avctx->context_model;
-        if (s->flags & (CODEC_FLAG_PASS1|CODEC_FLAG_PASS2)) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "context=1 is not compatible with "
-                   "2 pass huffyuv encoding\n");
-            return -1;
-        }
-    }else s->context= 0;
-
-    if (avctx->codec->id == AV_CODEC_ID_HUFFYUV) {
-        if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Error: YV12 is not supported by huffyuv; use "
-                   "vcodec=ffvhuff or format=422p\n");
-            return -1;
-        }
-        if (avctx->context_model) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Error: per-frame huffman tables are not supported "
-                   "by huffyuv; use vcodec=ffvhuff\n");
-            return -1;
-        }
-        if (s->interlaced != ( s->height > 288 ))
-            av_log(avctx, AV_LOG_INFO,
-                   "using huffyuv 2.2.0 or newer interlacing flag\n");
-    }
-
-    if (s->bitstream_bpp >= 24 && s->predictor == MEDIAN) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Error: RGB is incompatible with median predictor\n");
-        return -1;
-    }
-
-    ((uint8_t*)avctx->extradata)[0] = s->predictor | (s->decorrelate << 6);
-    ((uint8_t*)avctx->extradata)[1] = s->bitstream_bpp;
-    ((uint8_t*)avctx->extradata)[2] = s->interlaced ? 0x10 : 0x20;
-    if (s->context)
-        ((uint8_t*)avctx->extradata)[2] |= 0x40;
-    ((uint8_t*)avctx->extradata)[3] = 0;
-    s->avctx->extradata_size = 4;
-
-    if (avctx->stats_in) {
-        char *p = avctx->stats_in;
-
-        for (i = 0; i < 3; i++)
-            for (j = 0; j < 256; j++)
-                s->stats[i][j] = 1;
-
-        for (;;) {
-            for (i = 0; i < 3; i++) {
-                char *next;
-
-                for (j = 0; j < 256; j++) {
-                    s->stats[i][j] += strtol(p, &next, 0);
-                    if (next == p) return -1;
-                    p = next;
-                }
-            }
-            if (p[0] == 0 || p[1] == 0 || p[2] == 0) break;
-        }
-    } else {
-        for (i = 0; i < 3; i++)
-            for (j = 0; j < 256; j++) {
-                int d = FFMIN(j, 256 - j);
-
-                s->stats[i][j] = 100000000 / (d + 1);
-            }
-    }
-
-    for (i = 0; i < 3; i++) {
-        ff_huff_gen_len_table(s->len[i], s->stats[i]);
-
-        if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0) {
-            return -1;
-        }
-
-        s->avctx->extradata_size +=
-            store_table(s, s->len[i], &((uint8_t*)s->avctx->extradata)[s->avctx->extradata_size]);
-    }
-
-    if (s->context) {
-        for (i = 0; i < 3; i++) {
-            int pels = s->width * s->height / (i ? 40 : 10);
-            for (j = 0; j < 256; j++) {
-                int d = FFMIN(j, 256 - j);
-                s->stats[i][j] = pels/(d + 1);
-            }
-        }
-    } else {
-        for (i = 0; i < 3; i++)
-            for (j = 0; j < 256; j++)
-                s->stats[i][j]= 0;
-    }
-
-    ff_huffyuv_alloc_temp(s);
-
-    s->picture_number=0;
-
-    return 0;
-}
-static int encode_422_bitstream(HYuvContext *s, int offset, int count)
-{
-    int i;
-    const uint8_t *y = s->temp[0] + offset;
-    const uint8_t *u = s->temp[1] + offset / 2;
-    const uint8_t *v = s->temp[2] + offset / 2;
-
-    if (s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb) >> 3) < 2 * 4 * count) {
-        av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
-        return -1;
-    }
-
-#define LOAD4\
-            int y0 = y[2 * i];\
-            int y1 = y[2 * i + 1];\
-            int u0 = u[i];\
-            int v0 = v[i];
-
-    count /= 2;
-
-    if (s->flags & CODEC_FLAG_PASS1) {
-        for(i = 0; i < count; i++) {
-            LOAD4;
-            s->stats[0][y0]++;
-            s->stats[1][u0]++;
-            s->stats[0][y1]++;
-            s->stats[2][v0]++;
-        }
-    }
-    if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
-        return 0;
-    if (s->context) {
-        for (i = 0; i < count; i++) {
-            LOAD4;
-            s->stats[0][y0]++;
-            put_bits(&s->pb, s->len[0][y0], s->bits[0][y0]);
-            s->stats[1][u0]++;
-            put_bits(&s->pb, s->len[1][u0], s->bits[1][u0]);
-            s->stats[0][y1]++;
-            put_bits(&s->pb, s->len[0][y1], s->bits[0][y1]);
-            s->stats[2][v0]++;
-            put_bits(&s->pb, s->len[2][v0], s->bits[2][v0]);
-        }
-    } else {
-        for(i = 0; i < count; i++) {
-            LOAD4;
-            put_bits(&s->pb, s->len[0][y0], s->bits[0][y0]);
-            put_bits(&s->pb, s->len[1][u0], s->bits[1][u0]);
-            put_bits(&s->pb, s->len[0][y1], s->bits[0][y1]);
-            put_bits(&s->pb, s->len[2][v0], s->bits[2][v0]);
-        }
-    }
-    return 0;
-}
-
-static int encode_gray_bitstream(HYuvContext *s, int count)
-{
-    int i;
-
-    if (s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb) >> 3) < 4 * count) {
-        av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
-        return -1;
-    }
-
-#define LOAD2\
-            int y0 = s->temp[0][2 * i];\
-            int y1 = s->temp[0][2 * i + 1];
-#define STAT2\
-            s->stats[0][y0]++;\
-            s->stats[0][y1]++;
-#define WRITE2\
-            put_bits(&s->pb, s->len[0][y0], s->bits[0][y0]);\
-            put_bits(&s->pb, s->len[0][y1], s->bits[0][y1]);
-
-    count /= 2;
-
-    if (s->flags & CODEC_FLAG_PASS1) {
-        for (i = 0; i < count; i++) {
-            LOAD2;
-            STAT2;
-        }
-    }
-    if (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)
-        return 0;
-
-    if (s->context) {
-        for (i = 0; i < count; i++) {
-            LOAD2;
-            STAT2;
-            WRITE2;
-        }
-    } else {
-        for (i = 0; i < count; i++) {
-            LOAD2;
-            WRITE2;
-        }
-    }
-    return 0;
-}
-
-static inline int encode_bgra_bitstream(HYuvContext *s, int count, int planes)
-{
-    int i;
-
-    if (s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb) >> 3) <
-        4 * planes * count) {
-        av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
-        return -1;
-    }
-
-#define LOAD_GBRA                                                       \
-    int g = s->temp[0][planes == 3 ? 3 * i + 1 : 4 * i + G];            \
-    int b = s->temp[0][planes == 3 ? 3 * i + 2 : 4 * i + B] - g & 0xFF; \
-    int r = s->temp[0][planes == 3 ? 3 * i + 0 : 4 * i + R] - g & 0xFF; \
-    int a = s->temp[0][planes * i + A];
-
-#define STAT_BGRA                                                       \
-    s->stats[0][b]++;                                                   \
-    s->stats[1][g]++;                                                   \
-    s->stats[2][r]++;                                                   \
-    if (planes == 4)                                                    \
-        s->stats[2][a]++;
-
-#define WRITE_GBRA                                                      \
-    put_bits(&s->pb, s->len[1][g], s->bits[1][g]);                      \
-    put_bits(&s->pb, s->len[0][b], s->bits[0][b]);                      \
-    put_bits(&s->pb, s->len[2][r], s->bits[2][r]);                      \
-    if (planes == 4)                                                    \
-        put_bits(&s->pb, s->len[2][a], s->bits[2][a]);
-
-    if ((s->flags & CODEC_FLAG_PASS1) &&
-        (s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)) {
-        for (i = 0; i < count; i++) {
-            LOAD_GBRA;
-            STAT_BGRA;
-        }
-    } else if (s->context || (s->flags & CODEC_FLAG_PASS1)) {
-        for (i = 0; i < count; i++) {
-            LOAD_GBRA;
-            STAT_BGRA;
-            WRITE_GBRA;
-        }
-    } else {
-        for (i = 0; i < count; i++) {
-            LOAD_GBRA;
-            WRITE_GBRA;
-        }
-    }
-    return 0;
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *pict, int *got_packet)
-{
-    HYuvContext *s = avctx->priv_data;
-    const int width = s->width;
-    const int width2 = s->width>>1;
-    const int height = s->height;
-    const int fake_ystride = s->interlaced ? pict->linesize[0]*2  : pict->linesize[0];
-    const int fake_ustride = s->interlaced ? pict->linesize[1]*2  : pict->linesize[1];
-    const int fake_vstride = s->interlaced ? pict->linesize[2]*2  : pict->linesize[2];
-    const AVFrame * const p = pict;
-    int i, j, size = 0, ret;
-
-    if (!pkt->data &&
-        (ret = av_new_packet(pkt, width * height * 3 * 4 + FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error allocating output packet.\n");
-        return ret;
-    }
-
-    if (s->context) {
-        for (i = 0; i < 3; i++) {
-            ff_huff_gen_len_table(s->len[i], s->stats[i]);
-            if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i]) < 0)
-                return -1;
-            size += store_table(s, s->len[i], &pkt->data[size]);
-        }
-
-        for (i = 0; i < 3; i++)
-            for (j = 0; j < 256; j++)
-                s->stats[i][j] >>= 1;
-    }
-
-    init_put_bits(&s->pb, pkt->data + size, pkt->size - size);
-
-    if (avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
-        avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
-        int lefty, leftu, leftv, y, cy;
-
-        put_bits(&s->pb, 8, leftv = p->data[2][0]);
-        put_bits(&s->pb, 8, lefty = p->data[0][1]);
-        put_bits(&s->pb, 8, leftu = p->data[1][0]);
-        put_bits(&s->pb, 8,         p->data[0][0]);
-
-        lefty = sub_left_prediction(s, s->temp[0], p->data[0], width , 0);
-        leftu = sub_left_prediction(s, s->temp[1], p->data[1], width2, 0);
-        leftv = sub_left_prediction(s, s->temp[2], p->data[2], width2, 0);
-
-        encode_422_bitstream(s, 2, width-2);
-
-        if (s->predictor==MEDIAN) {
-            int lefttopy, lefttopu, lefttopv;
-            cy = y = 1;
-            if (s->interlaced) {
-                lefty = sub_left_prediction(s, s->temp[0], p->data[0] + p->linesize[0], width , lefty);
-                leftu = sub_left_prediction(s, s->temp[1], p->data[1] + p->linesize[1], width2, leftu);
-                leftv = sub_left_prediction(s, s->temp[2], p->data[2] + p->linesize[2], width2, leftv);
-
-                encode_422_bitstream(s, 0, width);
-                y++; cy++;
-            }
-
-            lefty = sub_left_prediction(s, s->temp[0], p->data[0] + fake_ystride, 4, lefty);
-            leftu = sub_left_prediction(s, s->temp[1], p->data[1] + fake_ustride, 2, leftu);
-            leftv = sub_left_prediction(s, s->temp[2], p->data[2] + fake_vstride, 2, leftv);
-
-            encode_422_bitstream(s, 0, 4);
-
-            lefttopy = p->data[0][3];
-            lefttopu = p->data[1][1];
-            lefttopv = p->data[2][1];
-            s->dsp.sub_hfyu_median_prediction(s->temp[0], p->data[0]+4, p->data[0] + fake_ystride + 4, width - 4 , &lefty, &lefttopy);
-            s->dsp.sub_hfyu_median_prediction(s->temp[1], p->data[1]+2, p->data[1] + fake_ustride + 2, width2 - 2, &leftu, &lefttopu);
-            s->dsp.sub_hfyu_median_prediction(s->temp[2], p->data[2]+2, p->data[2] + fake_vstride + 2, width2 - 2, &leftv, &lefttopv);
-            encode_422_bitstream(s, 0, width - 4);
-            y++; cy++;
-
-            for (; y < height; y++,cy++) {
-                uint8_t *ydst, *udst, *vdst;
-
-                if (s->bitstream_bpp == 12) {
-                    while (2 * cy > y) {
-                        ydst = p->data[0] + p->linesize[0] * y;
-                        s->dsp.sub_hfyu_median_prediction(s->temp[0], ydst - fake_ystride, ydst, width , &lefty, &lefttopy);
-                        encode_gray_bitstream(s, width);
-                        y++;
-                    }
-                    if (y >= height) break;
-                }
-                ydst = p->data[0] + p->linesize[0] * y;
-                udst = p->data[1] + p->linesize[1] * cy;
-                vdst = p->data[2] + p->linesize[2] * cy;
-
-                s->dsp.sub_hfyu_median_prediction(s->temp[0], ydst - fake_ystride, ydst, width , &lefty, &lefttopy);
-                s->dsp.sub_hfyu_median_prediction(s->temp[1], udst - fake_ustride, udst, width2, &leftu, &lefttopu);
-                s->dsp.sub_hfyu_median_prediction(s->temp[2], vdst - fake_vstride, vdst, width2, &leftv, &lefttopv);
-
-                encode_422_bitstream(s, 0, width);
-            }
-        } else {
-            for (cy = y = 1; y < height; y++, cy++) {
-                uint8_t *ydst, *udst, *vdst;
-
-                /* encode a luma only line & y++ */
-                if (s->bitstream_bpp == 12) {
-                    ydst = p->data[0] + p->linesize[0] * y;
-
-                    if (s->predictor == PLANE && s->interlaced < y) {
-                        s->dsp.diff_bytes(s->temp[1], ydst, ydst - fake_ystride, width);
-
-                        lefty = sub_left_prediction(s, s->temp[0], s->temp[1], width , lefty);
-                    } else {
-                        lefty = sub_left_prediction(s, s->temp[0], ydst, width , lefty);
-                    }
-                    encode_gray_bitstream(s, width);
-                    y++;
-                    if (y >= height) break;
-                }
-
-                ydst = p->data[0] + p->linesize[0] * y;
-                udst = p->data[1] + p->linesize[1] * cy;
-                vdst = p->data[2] + p->linesize[2] * cy;
-
-                if (s->predictor == PLANE && s->interlaced < cy) {
-                    s->dsp.diff_bytes(s->temp[1], ydst, ydst - fake_ystride, width);
-                    s->dsp.diff_bytes(s->temp[2], udst, udst - fake_ustride, width2);
-                    s->dsp.diff_bytes(s->temp[2] + width2, vdst, vdst - fake_vstride, width2);
-
-                    lefty = sub_left_prediction(s, s->temp[0], s->temp[1], width , lefty);
-                    leftu = sub_left_prediction(s, s->temp[1], s->temp[2], width2, leftu);
-                    leftv = sub_left_prediction(s, s->temp[2], s->temp[2] + width2, width2, leftv);
-                } else {
-                    lefty = sub_left_prediction(s, s->temp[0], ydst, width , lefty);
-                    leftu = sub_left_prediction(s, s->temp[1], udst, width2, leftu);
-                    leftv = sub_left_prediction(s, s->temp[2], vdst, width2, leftv);
-                }
-
-                encode_422_bitstream(s, 0, width);
-            }
-        }
-    } else if(avctx->pix_fmt == AV_PIX_FMT_RGB32) {
-        uint8_t *data = p->data[0] + (height - 1) * p->linesize[0];
-        const int stride = -p->linesize[0];
-        const int fake_stride = -fake_ystride;
-        int y;
-        int leftr, leftg, leftb, lefta;
-
-        put_bits(&s->pb, 8, lefta = data[A]);
-        put_bits(&s->pb, 8, leftr = data[R]);
-        put_bits(&s->pb, 8, leftg = data[G]);
-        put_bits(&s->pb, 8, leftb = data[B]);
-
-        sub_left_prediction_bgr32(s, s->temp[0], data + 4, width - 1,
-                                  &leftr, &leftg, &leftb, &lefta);
-        encode_bgra_bitstream(s, width - 1, 4);
-
-        for (y = 1; y < s->height; y++) {
-            uint8_t *dst = data + y*stride;
-            if (s->predictor == PLANE && s->interlaced < y) {
-                s->dsp.diff_bytes(s->temp[1], dst, dst - fake_stride, width * 4);
-                sub_left_prediction_bgr32(s, s->temp[0], s->temp[1], width,
-                                          &leftr, &leftg, &leftb, &lefta);
-            } else {
-                sub_left_prediction_bgr32(s, s->temp[0], dst, width,
-                                          &leftr, &leftg, &leftb, &lefta);
-            }
-            encode_bgra_bitstream(s, width, 4);
-        }
-    } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) {
-        uint8_t *data = p->data[0] + (height - 1) * p->linesize[0];
-        const int stride = -p->linesize[0];
-        const int fake_stride = -fake_ystride;
-        int y;
-        int leftr, leftg, leftb;
-
-        put_bits(&s->pb, 8, leftr = data[0]);
-        put_bits(&s->pb, 8, leftg = data[1]);
-        put_bits(&s->pb, 8, leftb = data[2]);
-        put_bits(&s->pb, 8, 0);
-
-        sub_left_prediction_rgb24(s, s->temp[0], data + 3, width - 1,
-                                  &leftr, &leftg, &leftb);
-        encode_bgra_bitstream(s, width-1, 3);
-
-        for (y = 1; y < s->height; y++) {
-            uint8_t *dst = data + y * stride;
-            if (s->predictor == PLANE && s->interlaced < y) {
-                s->dsp.diff_bytes(s->temp[1], dst, dst - fake_stride,
-                                  width * 3);
-                sub_left_prediction_rgb24(s, s->temp[0], s->temp[1], width,
-                                          &leftr, &leftg, &leftb);
-            } else {
-                sub_left_prediction_rgb24(s, s->temp[0], dst, width,
-                                          &leftr, &leftg, &leftb);
-            }
-            encode_bgra_bitstream(s, width, 3);
-        }
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
-    }
-    emms_c();
-
-    size += (put_bits_count(&s->pb) + 31) / 8;
-    put_bits(&s->pb, 16, 0);
-    put_bits(&s->pb, 15, 0);
-    size /= 4;
-
-    if ((s->flags&CODEC_FLAG_PASS1) && (s->picture_number & 31) == 0) {
-        int j;
-        char *p = avctx->stats_out;
-        char *end = p + 1024*30;
-        for (i = 0; i < 3; i++) {
-            for (j = 0; j < 256; j++) {
-                snprintf(p, end-p, "%"PRIu64" ", s->stats[i][j]);
-                p += strlen(p);
-                s->stats[i][j]= 0;
-            }
-            snprintf(p, end-p, "\n");
-            p++;
-        }
-    } else
-        avctx->stats_out[0] = '\0';
-    if (!(s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)) {
-        flush_put_bits(&s->pb);
-        s->dsp.bswap_buf((uint32_t*)pkt->data, (uint32_t*)pkt->data, size);
-    }
-
-    s->picture_number++;
-
-    pkt->size   = size * 4;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int encode_end(AVCodecContext *avctx)
-{
-    HYuvContext *s = avctx->priv_data;
-
-    ff_huffyuv_common_end(s);
-
-    av_freep(&avctx->extradata);
-    av_freep(&avctx->stats_out);
-
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-#if CONFIG_HUFFYUV_ENCODER
-AVCodec ff_huffyuv_encoder = {
-    .name           = "huffyuv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_HUFFYUV,
-    .priv_data_size = sizeof(HYuvContext),
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24,
-        AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
-    },
-};
-#endif
-
-#if CONFIG_FFVHUFF_ENCODER
-AVCodec ff_ffvhuff_encoder = {
-    .name           = "ffvhuff",
-    .long_name      = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_FFVHUFF,
-    .priv_data_size = sizeof(HYuvContext),
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24,
-        AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
-    },
-};
-#endif
diff --git a/deps/libav/libavcodec/idcinvideo.c b/deps/libav/libavcodec/idcinvideo.c
deleted file mode 100644
index 70c98d6..0000000
--- a/deps/libav/libavcodec/idcinvideo.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * id Quake II CIN Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * id Quake II Cin Video Decoder by Dr. Tim Ferguson
- * For more information about the id CIN format, visit:
- *   http://www.csse.monash.edu.au/~timf/
- *
- * This video decoder outputs PAL8 colorspace data. Interacting with this
- * decoder is a little involved. During initialization, the demuxer must
- * transmit the 65536-byte Huffman table(s) to the decoder via extradata.
- * Then, whenever a palette change is encountered while demuxing the file,
- * the demuxer must use the same extradata space to transmit an
- * AVPaletteControl structure.
- *
- * id CIN video is purely Huffman-coded, intraframe-only codec. It achieves
- * a little more compression by exploiting the fact that adjacent pixels
- * tend to be similar.
- *
- * Note that this decoder could use libavcodec's optimized VLC facilities
- * rather than naive, tree-based Huffman decoding. However, there are 256
- * Huffman tables. Plus, the VLC bit coding order is right -> left instead
- * or left -> right, so all of the bits would have to be reversed. Further,
- * the original Quake II implementation likely used a similar naive
- * decoding algorithm and it worked fine on much lower spec machines.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/internal.h"
-
-#define HUFFMAN_TABLE_SIZE 64 * 1024
-#define HUF_TOKENS 256
-#define PALETTE_COUNT 256
-
-typedef struct
-{
-  int count;
-  unsigned char used;
-  int children[2];
-} hnode;
-
-typedef struct IdcinContext {
-
-    AVCodecContext *avctx;
-
-    const unsigned char *buf;
-    int size;
-
-    hnode huff_nodes[256][HUF_TOKENS*2];
-    int num_huff_nodes[256];
-
-    uint32_t pal[256];
-} IdcinContext;
-
-/*
- * Find the lowest probability node in a Huffman table, and mark it as
- * being assigned to a higher probability.
- * @return the node index of the lowest unused node, or -1 if all nodes
- * are used.
- */
-static int huff_smallest_node(hnode *hnodes, int num_hnodes) {
-    int i;
-    int best, best_node;
-
-    best = 99999999;
-    best_node = -1;
-    for(i = 0; i < num_hnodes; i++) {
-        if(hnodes[i].used)
-            continue;
-        if(!hnodes[i].count)
-            continue;
-        if(hnodes[i].count < best) {
-            best = hnodes[i].count;
-            best_node = i;
-        }
-    }
-
-    if(best_node == -1)
-        return -1;
-    hnodes[best_node].used = 1;
-    return best_node;
-}
-
-/*
- * Build the Huffman tree using the generated/loaded probabilities histogram.
- *
- * On completion:
- *  huff_nodes[prev][i < HUF_TOKENS] - are the nodes at the base of the tree.
- *  huff_nodes[prev][i >= HUF_TOKENS] - are used to construct the tree.
- *  num_huff_nodes[prev] - contains the index to the root node of the tree.
- *    That is: huff_nodes[prev][num_huff_nodes[prev]] is the root node.
- */
-static av_cold void huff_build_tree(IdcinContext *s, int prev) {
-    hnode *node, *hnodes;
-     int num_hnodes, i;
-
-    num_hnodes = HUF_TOKENS;
-    hnodes = s->huff_nodes[prev];
-    for(i = 0; i < HUF_TOKENS * 2; i++)
-        hnodes[i].used = 0;
-
-    while (1) {
-        node = &hnodes[num_hnodes];             /* next free node */
-
-        /* pick two lowest counts */
-        node->children[0] = huff_smallest_node(hnodes, num_hnodes);
-        if(node->children[0] == -1)
-            break;      /* reached the root node */
-
-        node->children[1] = huff_smallest_node(hnodes, num_hnodes);
-        if(node->children[1] == -1)
-            break;      /* reached the root node */
-
-        /* combine nodes probability for new node */
-        node->count = hnodes[node->children[0]].count +
-        hnodes[node->children[1]].count;
-        num_hnodes++;
-    }
-
-    s->num_huff_nodes[prev] = num_hnodes - 1;
-}
-
-static av_cold int idcin_decode_init(AVCodecContext *avctx)
-{
-    IdcinContext *s = avctx->priv_data;
-    int i, j, histogram_index = 0;
-    unsigned char *histograms;
-
-    s->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    /* make sure the Huffman tables make it */
-    if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {
-        av_log(s->avctx, AV_LOG_ERROR, "  id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE);
-        return -1;
-    }
-
-    /* build the 256 Huffman decode trees */
-    histograms = (unsigned char *)s->avctx->extradata;
-    for (i = 0; i < 256; i++) {
-        for(j = 0; j < HUF_TOKENS; j++)
-            s->huff_nodes[i][j].count = histograms[histogram_index++];
-        huff_build_tree(s, i);
-    }
-
-    return 0;
-}
-
-static void idcin_decode_vlcs(IdcinContext *s, AVFrame *frame)
-{
-    hnode *hnodes;
-    long x, y;
-    int prev;
-    unsigned char v = 0;
-    int bit_pos, node_num, dat_pos;
-
-    prev = bit_pos = dat_pos = 0;
-    for (y = 0; y < (frame->linesize[0] * s->avctx->height);
-        y += frame->linesize[0]) {
-        for (x = y; x < y + s->avctx->width; x++) {
-            node_num = s->num_huff_nodes[prev];
-            hnodes = s->huff_nodes[prev];
-
-            while(node_num >= HUF_TOKENS) {
-                if(!bit_pos) {
-                    if(dat_pos >= s->size) {
-                        av_log(s->avctx, AV_LOG_ERROR, "Huffman decode error.\n");
-                        return;
-                    }
-                    bit_pos = 8;
-                    v = s->buf[dat_pos++];
-                }
-
-                node_num = hnodes[node_num].children[v & 0x01];
-                v = v >> 1;
-                bit_pos--;
-            }
-
-            frame->data[0][x] = node_num;
-            prev = node_num;
-        }
-    }
-}
-
-static int idcin_decode_frame(AVCodecContext *avctx,
-                              void *data, int *got_frame,
-                              AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    IdcinContext *s = avctx->priv_data;
-    const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-    AVFrame *frame = data;
-    int ret;
-
-    s->buf = buf;
-    s->size = buf_size;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "  id CIN Video: get_buffer() failed\n");
-        return ret;
-    }
-
-    idcin_decode_vlcs(s, frame);
-
-    if (pal) {
-        frame->palette_has_changed = 1;
-        memcpy(s->pal, pal, AVPALETTE_SIZE);
-    }
-    /* make the palette available on the way out */
-    memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
-
-    *got_frame = 1;
-
-    /* report that the buffer was completely consumed */
-    return buf_size;
-}
-
-AVCodec ff_idcin_decoder = {
-    .name           = "idcinvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("id Quake II CIN video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_IDCIN,
-    .priv_data_size = sizeof(IdcinContext),
-    .init           = idcin_decode_init,
-    .decode         = idcin_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/iff.c b/deps/libav/libavcodec/iff.c
deleted file mode 100644
index 112c2ca..0000000
--- a/deps/libav/libavcodec/iff.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- * IFF PBM/ILBM bitmap decoder
- * Copyright (c) 2010 Peter Ross <pross at xvid.org>
- * Copyright (c) 2010 Sebastian Vater <cdgs.basty at googlemail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * IFF PBM/ILBM bitmap decoder
- */
-
-#include <stdint.h>
-
-#include "libavutil/imgutils.h"
-#include "bytestream.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-
-typedef struct {
-    AVFrame *frame;
-    int planesize;
-    uint8_t * planebuf;
-    int init; // 1 if buffer and palette data already initialized, 0 otherwise
-} IffContext;
-
-#define LUT8_PART(plane, v)                             \
-    AV_LE2NE64C(UINT64_C(0x0000000)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x1000000)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x0010000)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x1010000)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x0000100)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x1000100)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x0010100)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x1010100)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x0000001)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x1000001)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x0010001)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x1010001)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x0000101)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x1000101)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x0010101)<<32 | v) << plane,  \
-    AV_LE2NE64C(UINT64_C(0x1010101)<<32 | v) << plane
-
-#define LUT8(plane) {                           \
-    LUT8_PART(plane, 0x0000000),                \
-    LUT8_PART(plane, 0x1000000),                \
-    LUT8_PART(plane, 0x0010000),                \
-    LUT8_PART(plane, 0x1010000),                \
-    LUT8_PART(plane, 0x0000100),                \
-    LUT8_PART(plane, 0x1000100),                \
-    LUT8_PART(plane, 0x0010100),                \
-    LUT8_PART(plane, 0x1010100),                \
-    LUT8_PART(plane, 0x0000001),                \
-    LUT8_PART(plane, 0x1000001),                \
-    LUT8_PART(plane, 0x0010001),                \
-    LUT8_PART(plane, 0x1010001),                \
-    LUT8_PART(plane, 0x0000101),                \
-    LUT8_PART(plane, 0x1000101),                \
-    LUT8_PART(plane, 0x0010101),                \
-    LUT8_PART(plane, 0x1010101),                \
-}
-
-// 8 planes * 8-bit mask
-static const uint64_t plane8_lut[8][256] = {
-    LUT8(0), LUT8(1), LUT8(2), LUT8(3),
-    LUT8(4), LUT8(5), LUT8(6), LUT8(7),
-};
-
-#define LUT32(plane) {                                \
-             0,          0,          0,          0,   \
-             0,          0,          0, 1 << plane,   \
-             0,          0, 1 << plane,          0,   \
-             0,          0, 1 << plane, 1 << plane,   \
-             0, 1 << plane,          0,          0,   \
-             0, 1 << plane,          0, 1 << plane,   \
-             0, 1 << plane, 1 << plane,          0,   \
-             0, 1 << plane, 1 << plane, 1 << plane,   \
-    1 << plane,          0,          0,          0,   \
-    1 << plane,          0,          0, 1 << plane,   \
-    1 << plane,          0, 1 << plane,          0,   \
-    1 << plane,          0, 1 << plane, 1 << plane,   \
-    1 << plane, 1 << plane,          0,          0,   \
-    1 << plane, 1 << plane,          0, 1 << plane,   \
-    1 << plane, 1 << plane, 1 << plane,          0,   \
-    1 << plane, 1 << plane, 1 << plane, 1 << plane,   \
-}
-
-// 32 planes * 4-bit mask * 4 lookup tables each
-static const uint32_t plane32_lut[32][16*4] = {
-    LUT32( 0), LUT32( 1), LUT32( 2), LUT32( 3),
-    LUT32( 4), LUT32( 5), LUT32( 6), LUT32( 7),
-    LUT32( 8), LUT32( 9), LUT32(10), LUT32(11),
-    LUT32(12), LUT32(13), LUT32(14), LUT32(15),
-    LUT32(16), LUT32(17), LUT32(18), LUT32(19),
-    LUT32(20), LUT32(21), LUT32(22), LUT32(23),
-    LUT32(24), LUT32(25), LUT32(26), LUT32(27),
-    LUT32(28), LUT32(29), LUT32(30), LUT32(31),
-};
-
-// Gray to RGB, required for palette table of grayscale images with bpp < 8
-static av_always_inline uint32_t gray2rgb(const uint32_t x) {
-    return x << 16 | x << 8 | x;
-}
-
-/**
- * Convert CMAP buffer (stored in extradata) to lavc palette format
- */
-static int cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)
-{
-    int count, i;
-
-    if (avctx->bits_per_coded_sample > 8) {
-        av_log(avctx, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    count = 1 << avctx->bits_per_coded_sample;
-    // If extradata is smaller than actually needed, fill the remaining with black.
-    count = FFMIN(avctx->extradata_size / 3, count);
-    if (count) {
-        for (i = 0; i < count; i++)
-            pal[i] = 0xFF000000 | AV_RB24(avctx->extradata + i * 3);
-    } else { // Create gray-scale color palette for bps < 8
-        count = 1 << avctx->bits_per_coded_sample;
-
-        for (i = 0; i < count; i++)
-            pal[i] = 0xFF000000 | gray2rgb((i * 255) >> avctx->bits_per_coded_sample);
-    }
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    IffContext *s = avctx->priv_data;
-    av_frame_free(&s->frame);
-    av_freep(&s->planebuf);
-    return 0;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    IffContext *s = avctx->priv_data;
-    int err;
-
-    if (avctx->bits_per_coded_sample <= 8) {
-        avctx->pix_fmt = (avctx->bits_per_coded_sample < 8 ||
-                          avctx->extradata_size) ? AV_PIX_FMT_PAL8
-                                                 : AV_PIX_FMT_GRAY8;
-    } else if (avctx->bits_per_coded_sample <= 32) {
-        avctx->pix_fmt = AV_PIX_FMT_BGR32;
-    } else {
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((err = av_image_check_size(avctx->width, avctx->height, 0, avctx)))
-        return err;
-    s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary
-    s->planebuf  = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!s->planebuf)
-        return AVERROR(ENOMEM);
-
-    s->frame = av_frame_alloc();
-    if (!s->frame) {
-        decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-/**
- * Decode interleaved plane buffer up to 8bpp
- * @param dst Destination buffer
- * @param buf Source buffer
- * @param buf_size
- * @param plane plane number to decode as
- */
-static void decodeplane8(uint8_t *dst, const uint8_t *buf, int buf_size, int plane)
-{
-    const uint64_t *lut = plane8_lut[plane];
-    do {
-        uint64_t v = AV_RN64A(dst) | lut[*buf++];
-        AV_WN64A(dst, v);
-        dst += 8;
-    } while (--buf_size);
-}
-
-/**
- * Decode interleaved plane buffer up to 24bpp
- * @param dst Destination buffer
- * @param buf Source buffer
- * @param buf_size
- * @param plane plane number to decode as
- */
-static void decodeplane32(uint32_t *dst, const uint8_t *buf, int buf_size, int plane)
-{
-    const uint32_t *lut = plane32_lut[plane];
-    do {
-        unsigned mask = (*buf >> 2) & ~3;
-        dst[0] |= lut[mask++];
-        dst[1] |= lut[mask++];
-        dst[2] |= lut[mask++];
-        dst[3] |= lut[mask];
-        mask    = (*buf++ << 2) & 0x3F;
-        dst[4] |= lut[mask++];
-        dst[5] |= lut[mask++];
-        dst[6] |= lut[mask++];
-        dst[7] |= lut[mask];
-        dst    += 8;
-    } while (--buf_size);
-}
-
-/**
- * Decode one complete byterun1 encoded line.
- *
- * @param dst the destination buffer where to store decompressed bitstream
- * @param dst_size the destination plane size in bytes
- * @param buf the source byterun1 compressed bitstream
- * @param buf_end the EOF of source byterun1 compressed bitstream
- * @return number of consumed bytes in byterun1 compressed bitstream
- */
-static int decode_byterun(uint8_t *dst, int dst_size,
-                          const uint8_t *buf, const uint8_t *const buf_end)
-{
-    const uint8_t *const buf_start = buf;
-    unsigned x;
-    for (x = 0; x < dst_size && buf < buf_end;) {
-        unsigned length;
-        const int8_t value = *buf++;
-        if (value >= 0) {
-            length = value + 1;
-            memcpy(dst + x, buf, FFMIN3(length, dst_size - x, buf_end - buf));
-            buf += length;
-        } else if (value > -128) {
-            length = -value + 1;
-            memset(dst + x, *buf++, FFMIN(length, dst_size - x));
-        } else { // noop
-            continue;
-        }
-        x += length;
-    }
-    return buf - buf_start;
-}
-
-static int decode_frame_ilbm(AVCodecContext *avctx,
-                             void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    IffContext *s          = avctx->priv_data;
-    const uint8_t *buf     = avpkt->data;
-    int buf_size           = avpkt->size;
-    const uint8_t *buf_end = buf + buf_size;
-    int y, plane, res;
-
-    if ((res = ff_reget_buffer(avctx, s->frame)) < 0)
-        return res;
-
-    if (!s->init && avctx->bits_per_coded_sample <= 8 &&
-        avctx->pix_fmt != AV_PIX_FMT_GRAY8) {
-        if ((res = cmap_read_palette(avctx, (uint32_t *)s->frame->data[1])) < 0)
-            return res;
-    }
-    s->init = 1;
-
-    if (avctx->codec_tag == MKTAG('I', 'L', 'B', 'M')) { // interleaved
-        if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
-            for (y = 0; y < avctx->height; y++) {
-                uint8_t *row = &s->frame->data[0][y * s->frame->linesize[0]];
-                memset(row, 0, avctx->width);
-                for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end;
-                     plane++) {
-                    decodeplane8(row, buf, FFMIN(s->planesize, buf_end - buf), plane);
-                    buf += s->planesize;
-                }
-            }
-        } else { // AV_PIX_FMT_BGR32
-            for (y = 0; y < avctx->height; y++) {
-                uint8_t *row = &s->frame->data[0][y * s->frame->linesize[0]];
-                memset(row, 0, avctx->width << 2);
-                for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end;
-                     plane++) {
-                    decodeplane32((uint32_t *)row, buf,
-                                  FFMIN(s->planesize, buf_end - buf), plane);
-                    buf += s->planesize;
-                }
-            }
-        }
-    } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) { // IFF-PBM
-        for (y = 0; y < avctx->height && buf < buf_end; y++) {
-            uint8_t *row = &s->frame->data[0][y * s->frame->linesize[0]];
-            memcpy(row, buf, FFMIN(avctx->width, buf_end - buf));
-            buf += avctx->width + (avctx->width % 2); // padding if odd
-        }
-    }
-
-    if ((res = av_frame_ref(data, s->frame)) < 0)
-        return res;
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static int decode_frame_byterun1(AVCodecContext *avctx,
-                                 void *data, int *got_frame,
-                                 AVPacket *avpkt)
-{
-    IffContext *s          = avctx->priv_data;
-    const uint8_t *buf     = avpkt->data;
-    int buf_size           = avpkt->size;
-    const uint8_t *buf_end = buf + buf_size;
-    int y, plane, res;
-
-    if ((res = ff_reget_buffer(avctx, s->frame)) < 0)
-        return res;
-
-    if (!s->init && avctx->bits_per_coded_sample <= 8 &&
-        avctx->pix_fmt != AV_PIX_FMT_GRAY8) {
-        if ((res = cmap_read_palette(avctx, (uint32_t *)s->frame->data[1])) < 0)
-            return res;
-    }
-    s->init = 1;
-
-    if (avctx->codec_tag == MKTAG('I', 'L', 'B', 'M')) { // interleaved
-        if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
-            for (y = 0; y < avctx->height; y++) {
-                uint8_t *row = &s->frame->data[0][y * s->frame->linesize[0]];
-                memset(row, 0, avctx->width);
-                for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) {
-                    buf += decode_byterun(s->planebuf, s->planesize, buf, buf_end);
-                    decodeplane8(row, s->planebuf, s->planesize, plane);
-                }
-            }
-        } else { // AV_PIX_FMT_BGR32
-            for (y = 0; y < avctx->height; y++) {
-                uint8_t *row = &s->frame->data[0][y * s->frame->linesize[0]];
-                memset(row, 0, avctx->width << 2);
-                for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) {
-                    buf += decode_byterun(s->planebuf, s->planesize, buf, buf_end);
-                    decodeplane32((uint32_t *)row, s->planebuf, s->planesize, plane);
-                }
-            }
-        }
-    } else {
-        for (y = 0; y < avctx->height; y++) {
-            uint8_t *row = &s->frame->data[0][y * s->frame->linesize[0]];
-            buf += decode_byterun(row, avctx->width, buf, buf_end);
-        }
-    }
-
-    if ((res = av_frame_ref(data, s->frame)) < 0)
-        return res;
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_iff_ilbm_decoder = {
-    .name           = "iff_ilbm",
-    .long_name      = NULL_IF_CONFIG_SMALL("IFF ILBM"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_IFF_ILBM,
-    .priv_data_size = sizeof(IffContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame_ilbm,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-AVCodec ff_iff_byterun1_decoder = {
-    .name           = "iff_byterun1",
-    .long_name      = NULL_IF_CONFIG_SMALL("IFF ByteRun1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_IFF_BYTERUN1,
-    .priv_data_size = sizeof(IffContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame_byterun1,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/iirfilter.c b/deps/libav/libavcodec/iirfilter.c
deleted file mode 100644
index 40a543d..0000000
--- a/deps/libav/libavcodec/iirfilter.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * IIR filter
- * Copyright (c) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * different IIR filters implementation
- */
-
-#include "iirfilter.h"
-#include <math.h>
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-
-/**
- * IIR filter global parameters
- */
-typedef struct FFIIRFilterCoeffs{
-    int   order;
-    float gain;
-    int   *cx;
-    float *cy;
-}FFIIRFilterCoeffs;
-
-/**
- * IIR filter state
- */
-typedef struct FFIIRFilterState{
-    float x[1];
-}FFIIRFilterState;
-
-/// maximum supported filter order
-#define MAXORDER 30
-
-static av_cold int butterworth_init_coeffs(void *avc,
-                                           struct FFIIRFilterCoeffs *c,
-                                           enum IIRFilterMode filt_mode,
-                                           int order, float cutoff_ratio,
-                                           float stopband)
-{
-    int i, j;
-    double wa;
-    double p[MAXORDER + 1][2];
-
-    if (filt_mode != FF_FILTER_MODE_LOWPASS) {
-        av_log(avc, AV_LOG_ERROR, "Butterworth filter currently only supports "
-               "low-pass filter mode\n");
-        return -1;
-    }
-    if (order & 1) {
-        av_log(avc, AV_LOG_ERROR, "Butterworth filter currently only supports "
-               "even filter orders\n");
-        return -1;
-    }
-
-    wa = 2 * tan(M_PI * 0.5 * cutoff_ratio);
-
-    c->cx[0] = 1;
-    for(i = 1; i < (order >> 1) + 1; i++)
-        c->cx[i] = c->cx[i - 1] * (order - i + 1LL) / i;
-
-    p[0][0] = 1.0;
-    p[0][1] = 0.0;
-    for(i = 1; i <= order; i++)
-        p[i][0] = p[i][1] = 0.0;
-    for(i = 0; i < order; i++){
-        double zp[2];
-        double th = (i + (order >> 1) + 0.5) * M_PI / order;
-        double a_re, a_im, c_re, c_im;
-        zp[0] = cos(th) * wa;
-        zp[1] = sin(th) * wa;
-        a_re = zp[0] + 2.0;
-        c_re = zp[0] - 2.0;
-        a_im =
-        c_im = zp[1];
-        zp[0] = (a_re * c_re + a_im * c_im) / (c_re * c_re + c_im * c_im);
-        zp[1] = (a_im * c_re - a_re * c_im) / (c_re * c_re + c_im * c_im);
-
-        for(j = order; j >= 1; j--)
-        {
-            a_re = p[j][0];
-            a_im = p[j][1];
-            p[j][0] = a_re*zp[0] - a_im*zp[1] + p[j-1][0];
-            p[j][1] = a_re*zp[1] + a_im*zp[0] + p[j-1][1];
-        }
-        a_re    = p[0][0]*zp[0] - p[0][1]*zp[1];
-        p[0][1] = p[0][0]*zp[1] + p[0][1]*zp[0];
-        p[0][0] = a_re;
-    }
-    c->gain = p[order][0];
-    for(i = 0; i < order; i++){
-        c->gain += p[i][0];
-        c->cy[i] = (-p[i][0] * p[order][0] + -p[i][1] * p[order][1]) /
-                   (p[order][0] * p[order][0] + p[order][1] * p[order][1]);
-    }
-    c->gain /= 1 << order;
-
-    return 0;
-}
-
-static av_cold int biquad_init_coeffs(void *avc, struct FFIIRFilterCoeffs *c,
-                                      enum IIRFilterMode filt_mode, int order,
-                                      float cutoff_ratio, float stopband)
-{
-    double cos_w0, sin_w0;
-    double a0, x0, x1;
-
-    if (filt_mode != FF_FILTER_MODE_HIGHPASS &&
-        filt_mode != FF_FILTER_MODE_LOWPASS) {
-        av_log(avc, AV_LOG_ERROR, "Biquad filter currently only supports "
-               "high-pass and low-pass filter modes\n");
-        return -1;
-    }
-    if (order != 2) {
-        av_log(avc, AV_LOG_ERROR, "Biquad filter must have order of 2\n");
-        return -1;
-    }
-
-    cos_w0 = cos(M_PI * cutoff_ratio);
-    sin_w0 = sin(M_PI * cutoff_ratio);
-
-    a0 = 1.0 + (sin_w0 / 2.0);
-
-    if (filt_mode == FF_FILTER_MODE_HIGHPASS) {
-        c->gain  =  ((1.0 + cos_w0) / 2.0)  / a0;
-        x0       =  ((1.0 + cos_w0) / 2.0)  / a0;
-        x1       = (-(1.0 + cos_w0))        / a0;
-    } else { // FF_FILTER_MODE_LOWPASS
-        c->gain  =  ((1.0 - cos_w0) / 2.0)  / a0;
-        x0       =  ((1.0 - cos_w0) / 2.0)  / a0;
-        x1       =   (1.0 - cos_w0)         / a0;
-    }
-    c->cy[0] = (-1.0 + (sin_w0 / 2.0)) / a0;
-    c->cy[1] =  (2.0 *  cos_w0)        / a0;
-
-    // divide by gain to make the x coeffs integers.
-    // during filtering, the delay state will include the gain multiplication
-    c->cx[0] = lrintf(x0 / c->gain);
-    c->cx[1] = lrintf(x1 / c->gain);
-
-    return 0;
-}
-
-av_cold struct FFIIRFilterCoeffs* ff_iir_filter_init_coeffs(void *avc,
-                                                enum IIRFilterType filt_type,
-                                                enum IIRFilterMode filt_mode,
-                                                int order, float cutoff_ratio,
-                                                float stopband, float ripple)
-{
-    FFIIRFilterCoeffs *c;
-    int ret = 0;
-
-    if (order <= 0 || order > MAXORDER || cutoff_ratio >= 1.0)
-        return NULL;
-
-    FF_ALLOCZ_OR_GOTO(avc, c,     sizeof(FFIIRFilterCoeffs),
-                      init_fail);
-    FF_ALLOC_OR_GOTO (avc, c->cx, sizeof(c->cx[0]) * ((order >> 1) + 1),
-                      init_fail);
-    FF_ALLOC_OR_GOTO (avc, c->cy, sizeof(c->cy[0]) * order,
-                      init_fail);
-    c->order = order;
-
-    switch (filt_type) {
-    case FF_FILTER_TYPE_BUTTERWORTH:
-        ret = butterworth_init_coeffs(avc, c, filt_mode, order, cutoff_ratio,
-                                      stopband);
-        break;
-    case FF_FILTER_TYPE_BIQUAD:
-        ret = biquad_init_coeffs(avc, c, filt_mode, order, cutoff_ratio,
-                                 stopband);
-        break;
-    default:
-        av_log(avc, AV_LOG_ERROR, "filter type is not currently implemented\n");
-        goto init_fail;
-    }
-
-    if (!ret)
-        return c;
-
-init_fail:
-    ff_iir_filter_free_coeffs(c);
-    return NULL;
-}
-
-av_cold struct FFIIRFilterState* ff_iir_filter_init_state(int order)
-{
-    FFIIRFilterState* s = av_mallocz(sizeof(FFIIRFilterState) + sizeof(s->x[0]) * (order - 1));
-    return s;
-}
-
-#define CONV_S16(dest, source) dest = av_clip_int16(lrintf(source));
-
-#define CONV_FLT(dest, source) dest = source;
-
-#define FILTER_BW_O4_1(i0, i1, i2, i3, fmt)         \
-    in = *src0 * c->gain                            \
-         + c->cy[0]*s->x[i0] + c->cy[1]*s->x[i1]    \
-         + c->cy[2]*s->x[i2] + c->cy[3]*s->x[i3];   \
-    res =  (s->x[i0] + in      )*1                  \
-         + (s->x[i1] + s->x[i3])*4                  \
-         +  s->x[i2]            *6;                 \
-    CONV_##fmt(*dst0, res)                          \
-    s->x[i0] = in;                                  \
-    src0 += sstep;                                  \
-    dst0 += dstep;
-
-#define FILTER_BW_O4(type, fmt) {           \
-    int i;                                  \
-    const type *src0 = src;                 \
-    type       *dst0 = dst;                 \
-    for (i = 0; i < size; i += 4) {         \
-        float in, res;                      \
-        FILTER_BW_O4_1(0, 1, 2, 3, fmt);    \
-        FILTER_BW_O4_1(1, 2, 3, 0, fmt);    \
-        FILTER_BW_O4_1(2, 3, 0, 1, fmt);    \
-        FILTER_BW_O4_1(3, 0, 1, 2, fmt);    \
-    }                                       \
-}
-
-#define FILTER_DIRECT_FORM_II(type, fmt) {                                  \
-    int i;                                                                  \
-    const type *src0 = src;                                                 \
-    type       *dst0 = dst;                                                 \
-    for (i = 0; i < size; i++) {                                            \
-        int j;                                                              \
-        float in, res;                                                      \
-        in = *src0 * c->gain;                                               \
-        for(j = 0; j < c->order; j++)                                       \
-            in += c->cy[j] * s->x[j];                                       \
-        res = s->x[0] + in + s->x[c->order >> 1] * c->cx[c->order >> 1];    \
-        for(j = 1; j < c->order >> 1; j++)                                  \
-            res += (s->x[j] + s->x[c->order - j]) * c->cx[j];               \
-        for(j = 0; j < c->order - 1; j++)                                   \
-            s->x[j] = s->x[j + 1];                                          \
-        CONV_##fmt(*dst0, res)                                              \
-        s->x[c->order - 1] = in;                                            \
-        src0 += sstep;                                                      \
-        dst0 += dstep;                                                      \
-    }                                                                       \
-}
-
-#define FILTER_O2(type, fmt) {                                              \
-    int i;                                                                  \
-    const type *src0 = src;                                                 \
-    type       *dst0 = dst;                                                 \
-    for (i = 0; i < size; i++) {                                            \
-        float in = *src0   * c->gain  +                                     \
-                   s->x[0] * c->cy[0] +                                     \
-                   s->x[1] * c->cy[1];                                      \
-        CONV_##fmt(*dst0, s->x[0] + in + s->x[1] * c->cx[1])                \
-        s->x[0] = s->x[1];                                                  \
-        s->x[1] = in;                                                       \
-        src0 += sstep;                                                      \
-        dst0 += dstep;                                                      \
-    }                                                                       \
-}
-
-void ff_iir_filter(const struct FFIIRFilterCoeffs *c,
-                   struct FFIIRFilterState *s, int size,
-                   const int16_t *src, int sstep, int16_t *dst, int dstep)
-{
-    if (c->order == 2) {
-        FILTER_O2(int16_t, S16)
-    } else if (c->order == 4) {
-        FILTER_BW_O4(int16_t, S16)
-    } else {
-        FILTER_DIRECT_FORM_II(int16_t, S16)
-    }
-}
-
-void ff_iir_filter_flt(const struct FFIIRFilterCoeffs *c,
-                       struct FFIIRFilterState *s, int size,
-                       const float *src, int sstep, float *dst, int dstep)
-{
-    if (c->order == 2) {
-        FILTER_O2(float, FLT)
-    } else if (c->order == 4) {
-        FILTER_BW_O4(float, FLT)
-    } else {
-        FILTER_DIRECT_FORM_II(float, FLT)
-    }
-}
-
-av_cold void ff_iir_filter_free_state(struct FFIIRFilterState *state)
-{
-    av_free(state);
-}
-
-av_cold void ff_iir_filter_free_coeffs(struct FFIIRFilterCoeffs *coeffs)
-{
-    if(coeffs){
-        av_free(coeffs->cx);
-        av_free(coeffs->cy);
-    }
-    av_free(coeffs);
-}
-
-#ifdef TEST
-#include <stdio.h>
-
-#define FILT_ORDER 4
-#define SIZE 1024
-int main(void)
-{
-    struct FFIIRFilterCoeffs *fcoeffs = NULL;
-    struct FFIIRFilterState  *fstate  = NULL;
-    float cutoff_coeff = 0.4;
-    int16_t x[SIZE], y[SIZE];
-    int i;
-
-    fcoeffs = ff_iir_filter_init_coeffs(NULL, FF_FILTER_TYPE_BUTTERWORTH,
-                                        FF_FILTER_MODE_LOWPASS, FILT_ORDER,
-                                        cutoff_coeff, 0.0, 0.0);
-    fstate  = ff_iir_filter_init_state(FILT_ORDER);
-
-    for (i = 0; i < SIZE; i++) {
-        x[i] = lrint(0.75 * INT16_MAX * sin(0.5*M_PI*i*i/SIZE));
-    }
-
-    ff_iir_filter(fcoeffs, fstate, SIZE, x, 1, y, 1);
-
-    for (i = 0; i < SIZE; i++)
-        printf("%6d %6d\n", x[i], y[i]);
-
-    ff_iir_filter_free_coeffs(fcoeffs);
-    ff_iir_filter_free_state(fstate);
-    return 0;
-}
-#endif /* TEST */
diff --git a/deps/libav/libavcodec/iirfilter.h b/deps/libav/libavcodec/iirfilter.h
deleted file mode 100644
index bc65a96..0000000
--- a/deps/libav/libavcodec/iirfilter.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * IIR filter
- * Copyright (c) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * IIR filter interface
- */
-
-#ifndef AVCODEC_IIRFILTER_H
-#define AVCODEC_IIRFILTER_H
-
-#include "avcodec.h"
-
-struct FFIIRFilterCoeffs;
-struct FFIIRFilterState;
-
-enum IIRFilterType{
-    FF_FILTER_TYPE_BESSEL,
-    FF_FILTER_TYPE_BIQUAD,
-    FF_FILTER_TYPE_BUTTERWORTH,
-    FF_FILTER_TYPE_CHEBYSHEV,
-    FF_FILTER_TYPE_ELLIPTIC,
-};
-
-enum IIRFilterMode{
-    FF_FILTER_MODE_LOWPASS,
-    FF_FILTER_MODE_HIGHPASS,
-    FF_FILTER_MODE_BANDPASS,
-    FF_FILTER_MODE_BANDSTOP,
-};
-
-/**
- * Initialize filter coefficients.
- *
- * @param avc          a pointer to an arbitrary struct of which the first
- *                     field is a pointer to an AVClass struct
- * @param filt_type    filter type (e.g. Butterworth)
- * @param filt_mode    filter mode (e.g. lowpass)
- * @param order        filter order
- * @param cutoff_ratio cutoff to input frequency ratio
- * @param stopband     stopband to input frequency ratio (used by bandpass and bandstop filter modes)
- * @param ripple       ripple factor (used only in Chebyshev filters)
- *
- * @return pointer to filter coefficients structure or NULL if filter cannot be created
- */
-struct FFIIRFilterCoeffs* ff_iir_filter_init_coeffs(void *avc,
-                                                enum IIRFilterType filt_type,
-                                                enum IIRFilterMode filt_mode,
-                                                int order, float cutoff_ratio,
-                                                float stopband, float ripple);
-
-/**
- * Create new filter state.
- *
- * @param order filter order
- *
- * @return pointer to new filter state or NULL if state creation fails
- */
-struct FFIIRFilterState* ff_iir_filter_init_state(int order);
-
-/**
- * Free filter coefficients.
- *
- * @param coeffs pointer allocated with ff_iir_filter_init_coeffs()
- */
-void ff_iir_filter_free_coeffs(struct FFIIRFilterCoeffs *coeffs);
-
-/**
- * Free filter state.
- *
- * @param state pointer allocated with ff_iir_filter_init_state()
- */
-void ff_iir_filter_free_state(struct FFIIRFilterState *state);
-
-/**
- * Perform IIR filtering on signed 16-bit input samples.
- *
- * @param coeffs pointer to filter coefficients
- * @param state  pointer to filter state
- * @param size   input length
- * @param src    source samples
- * @param sstep  source stride
- * @param dst    filtered samples (destination may be the same as input)
- * @param dstep  destination stride
- */
-void ff_iir_filter(const struct FFIIRFilterCoeffs *coeffs, struct FFIIRFilterState *state,
-                   int size, const int16_t *src, int sstep, int16_t *dst, int dstep);
-
-/**
- * Perform IIR filtering on floating-point input samples.
- *
- * @param coeffs pointer to filter coefficients
- * @param state  pointer to filter state
- * @param size   input length
- * @param src    source samples
- * @param sstep  source stride
- * @param dst    filtered samples (destination may be the same as input)
- * @param dstep  destination stride
- */
-void ff_iir_filter_flt(const struct FFIIRFilterCoeffs *coeffs,
-                       struct FFIIRFilterState *state, int size,
-                       const float *src, int sstep, float *dst, int dstep);
-
-#endif /* AVCODEC_IIRFILTER_H */
diff --git a/deps/libav/libavcodec/imc.c b/deps/libav/libavcodec/imc.c
deleted file mode 100644
index c1fbd76..0000000
--- a/deps/libav/libavcodec/imc.c
+++ /dev/null
@@ -1,1074 +0,0 @@
-/*
- * IMC compatible decoder
- * Copyright (c) 2002-2004 Maxim Poliakovski
- * Copyright (c) 2006 Benjamin Larsson
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- *  @file
- *  IMC - Intel Music Coder
- *  A mdct based codec using a 256 points large transform
- *  divided into 32 bands with some mix of scale factors.
- *  Only mono is supported.
- *
- */
-
-
-#include <math.h>
-#include <stddef.h>
-#include <stdio.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/internal.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "fft.h"
-#include "internal.h"
-#include "sinewin.h"
-
-#include "imcdata.h"
-
-#define IMC_BLOCK_SIZE 64
-#define IMC_FRAME_ID 0x21
-#define BANDS 32
-#define COEFFS 256
-
-typedef struct IMCChannel {
-    float old_floor[BANDS];
-    float flcoeffs1[BANDS];
-    float flcoeffs2[BANDS];
-    float flcoeffs3[BANDS];
-    float flcoeffs4[BANDS];
-    float flcoeffs5[BANDS];
-    float flcoeffs6[BANDS];
-    float CWdecoded[COEFFS];
-
-    int bandWidthT[BANDS];     ///< codewords per band
-    int bitsBandT[BANDS];      ///< how many bits per codeword in band
-    int CWlengthT[COEFFS];     ///< how many bits in each codeword
-    int levlCoeffBuf[BANDS];
-    int bandFlagsBuf[BANDS];   ///< flags for each band
-    int sumLenArr[BANDS];      ///< bits for all coeffs in band
-    int skipFlagRaw[BANDS];    ///< skip flags are stored in raw form or not
-    int skipFlagBits[BANDS];   ///< bits used to code skip flags
-    int skipFlagCount[BANDS];  ///< skipped coeffients per band
-    int skipFlags[COEFFS];     ///< skip coefficient decoding or not
-    int codewords[COEFFS];     ///< raw codewords read from bitstream
-
-    float last_fft_im[COEFFS];
-
-    int decoder_reset;
-} IMCChannel;
-
-typedef struct {
-    IMCChannel chctx[2];
-
-    /** MDCT tables */
-    //@{
-    float mdct_sine_window[COEFFS];
-    float post_cos[COEFFS];
-    float post_sin[COEFFS];
-    float pre_coef1[COEFFS];
-    float pre_coef2[COEFFS];
-    //@}
-
-    float sqrt_tab[30];
-    GetBitContext gb;
-
-    DSPContext dsp;
-    AVFloatDSPContext fdsp;
-    FFTContext fft;
-    DECLARE_ALIGNED(32, FFTComplex, samples)[COEFFS / 2];
-    float *out_samples;
-
-    int coef0_pos;
-
-    int8_t cyclTab[32], cyclTab2[32];
-    float  weights1[31], weights2[31];
-} IMCContext;
-
-static VLC huffman_vlc[4][4];
-
-#define VLC_TABLES_SIZE 9512
-
-static const int vlc_offsets[17] = {
-    0,     640, 1156, 1732, 2308, 2852, 3396, 3924,
-    4452, 5220, 5860, 6628, 7268, 7908, 8424, 8936, VLC_TABLES_SIZE
-};
-
-static VLC_TYPE vlc_tables[VLC_TABLES_SIZE][2];
-
-static inline double freq2bark(double freq)
-{
-    return 3.5 * atan((freq / 7500.0) * (freq / 7500.0)) + 13.0 * atan(freq * 0.00076);
-}
-
-static av_cold void iac_generate_tabs(IMCContext *q, int sampling_rate)
-{
-    double freqmin[32], freqmid[32], freqmax[32];
-    double scale = sampling_rate / (256.0 * 2.0 * 2.0);
-    double nyquist_freq = sampling_rate * 0.5;
-    double freq, bark, prev_bark = 0, tf, tb;
-    int i, j;
-
-    for (i = 0; i < 32; i++) {
-        freq = (band_tab[i] + band_tab[i + 1] - 1) * scale;
-        bark = freq2bark(freq);
-
-        if (i > 0) {
-            tb = bark - prev_bark;
-            q->weights1[i - 1] = pow(10.0, -1.0 * tb);
-            q->weights2[i - 1] = pow(10.0, -2.7 * tb);
-        }
-        prev_bark = bark;
-
-        freqmid[i] = freq;
-
-        tf = freq;
-        while (tf < nyquist_freq) {
-            tf += 0.5;
-            tb =  freq2bark(tf);
-            if (tb > bark + 0.5)
-                break;
-        }
-        freqmax[i] = tf;
-
-        tf = freq;
-        while (tf > 0.0) {
-            tf -= 0.5;
-            tb =  freq2bark(tf);
-            if (tb <= bark - 0.5)
-                break;
-        }
-        freqmin[i] = tf;
-    }
-
-    for (i = 0; i < 32; i++) {
-        freq = freqmax[i];
-        for (j = 31; j > 0 && freq <= freqmid[j]; j--);
-        q->cyclTab[i] = j + 1;
-
-        freq = freqmin[i];
-        for (j = 0; j < 32 && freq >= freqmid[j]; j++);
-        q->cyclTab2[i] = j - 1;
-    }
-}
-
-static av_cold int imc_decode_init(AVCodecContext *avctx)
-{
-    int i, j, ret;
-    IMCContext *q = avctx->priv_data;
-    double r1, r2;
-
-    if (avctx->codec_id == AV_CODEC_ID_IMC)
-        avctx->channels = 1;
-
-    if (avctx->channels > 2) {
-        avpriv_request_sample(avctx, "Number of channels > 2");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    for (j = 0; j < avctx->channels; j++) {
-        q->chctx[j].decoder_reset = 1;
-
-        for (i = 0; i < BANDS; i++)
-            q->chctx[j].old_floor[i] = 1.0;
-
-        for (i = 0; i < COEFFS / 2; i++)
-            q->chctx[j].last_fft_im[i] = 0;
-    }
-
-    /* Build mdct window, a simple sine window normalized with sqrt(2) */
-    ff_sine_window_init(q->mdct_sine_window, COEFFS);
-    for (i = 0; i < COEFFS; i++)
-        q->mdct_sine_window[i] *= sqrt(2.0);
-    for (i = 0; i < COEFFS / 2; i++) {
-        q->post_cos[i] = (1.0f / 32768) * cos(i / 256.0 * M_PI);
-        q->post_sin[i] = (1.0f / 32768) * sin(i / 256.0 * M_PI);
-
-        r1 = sin((i * 4.0 + 1.0) / 1024.0 * M_PI);
-        r2 = cos((i * 4.0 + 1.0) / 1024.0 * M_PI);
-
-        if (i & 0x1) {
-            q->pre_coef1[i] =  (r1 + r2) * sqrt(2.0);
-            q->pre_coef2[i] = -(r1 - r2) * sqrt(2.0);
-        } else {
-            q->pre_coef1[i] = -(r1 + r2) * sqrt(2.0);
-            q->pre_coef2[i] =  (r1 - r2) * sqrt(2.0);
-        }
-    }
-
-    /* Generate a square root table */
-
-    for (i = 0; i < 30; i++)
-        q->sqrt_tab[i] = sqrt(i);
-
-    /* initialize the VLC tables */
-    for (i = 0; i < 4 ; i++) {
-        for (j = 0; j < 4; j++) {
-            huffman_vlc[i][j].table = &vlc_tables[vlc_offsets[i * 4 + j]];
-            huffman_vlc[i][j].table_allocated = vlc_offsets[i * 4 + j + 1] - vlc_offsets[i * 4 + j];
-            init_vlc(&huffman_vlc[i][j], 9, imc_huffman_sizes[i],
-                     imc_huffman_lens[i][j], 1, 1,
-                     imc_huffman_bits[i][j], 2, 2, INIT_VLC_USE_NEW_STATIC);
-        }
-    }
-
-    if (avctx->codec_id == AV_CODEC_ID_IAC) {
-        iac_generate_tabs(q, avctx->sample_rate);
-    } else {
-        memcpy(q->cyclTab,  cyclTab,  sizeof(cyclTab));
-        memcpy(q->cyclTab2, cyclTab2, sizeof(cyclTab2));
-        memcpy(q->weights1, imc_weights1, sizeof(imc_weights1));
-        memcpy(q->weights2, imc_weights2, sizeof(imc_weights2));
-    }
-
-    if ((ret = ff_fft_init(&q->fft, 7, 1))) {
-        av_log(avctx, AV_LOG_INFO, "FFT init failed\n");
-        return ret;
-    }
-    ff_dsputil_init(&q->dsp, avctx);
-    avpriv_float_dsp_init(&q->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-    avctx->sample_fmt     = AV_SAMPLE_FMT_FLTP;
-    avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO
-                                                 : AV_CH_LAYOUT_STEREO;
-
-    return 0;
-}
-
-static void imc_calculate_coeffs(IMCContext *q, float *flcoeffs1,
-                                 float *flcoeffs2, int *bandWidthT,
-                                 float *flcoeffs3, float *flcoeffs5)
-{
-    float   workT1[BANDS];
-    float   workT2[BANDS];
-    float   workT3[BANDS];
-    float   snr_limit = 1.e-30;
-    float   accum = 0.0;
-    int i, cnt2;
-
-    for (i = 0; i < BANDS; i++) {
-        flcoeffs5[i] = workT2[i] = 0.0;
-        if (bandWidthT[i]) {
-            workT1[i] = flcoeffs1[i] * flcoeffs1[i];
-            flcoeffs3[i] = 2.0 * flcoeffs2[i];
-        } else {
-            workT1[i]    = 0.0;
-            flcoeffs3[i] = -30000.0;
-        }
-        workT3[i] = bandWidthT[i] * workT1[i] * 0.01;
-        if (workT3[i] <= snr_limit)
-            workT3[i] = 0.0;
-    }
-
-    for (i = 0; i < BANDS; i++) {
-        for (cnt2 = i; cnt2 < q->cyclTab[i]; cnt2++)
-            flcoeffs5[cnt2] = flcoeffs5[cnt2] + workT3[i];
-        workT2[cnt2 - 1] = workT2[cnt2 - 1] + workT3[i];
-    }
-
-    for (i = 1; i < BANDS; i++) {
-        accum = (workT2[i - 1] + accum) * q->weights1[i - 1];
-        flcoeffs5[i] += accum;
-    }
-
-    for (i = 0; i < BANDS; i++)
-        workT2[i] = 0.0;
-
-    for (i = 0; i < BANDS; i++) {
-        for (cnt2 = i - 1; cnt2 > q->cyclTab2[i]; cnt2--)
-            flcoeffs5[cnt2] += workT3[i];
-        workT2[cnt2+1] += workT3[i];
-    }
-
-    accum = 0.0;
-
-    for (i = BANDS-2; i >= 0; i--) {
-        accum = (workT2[i+1] + accum) * q->weights2[i];
-        flcoeffs5[i] += accum;
-        // there is missing code here, but it seems to never be triggered
-    }
-}
-
-
-static void imc_read_level_coeffs(IMCContext *q, int stream_format_code,
-                                  int *levlCoeffs)
-{
-    int i;
-    VLC *hufftab[4];
-    int start = 0;
-    const uint8_t *cb_sel;
-    int s;
-
-    s = stream_format_code >> 1;
-    hufftab[0] = &huffman_vlc[s][0];
-    hufftab[1] = &huffman_vlc[s][1];
-    hufftab[2] = &huffman_vlc[s][2];
-    hufftab[3] = &huffman_vlc[s][3];
-    cb_sel = imc_cb_select[s];
-
-    if (stream_format_code & 4)
-        start = 1;
-    if (start)
-        levlCoeffs[0] = get_bits(&q->gb, 7);
-    for (i = start; i < BANDS; i++) {
-        levlCoeffs[i] = get_vlc2(&q->gb, hufftab[cb_sel[i]]->table,
-                                 hufftab[cb_sel[i]]->bits, 2);
-        if (levlCoeffs[i] == 17)
-            levlCoeffs[i] += get_bits(&q->gb, 4);
-    }
-}
-
-static void imc_read_level_coeffs_raw(IMCContext *q, int stream_format_code,
-                                      int *levlCoeffs)
-{
-    int i;
-
-    q->coef0_pos  = get_bits(&q->gb, 5);
-    levlCoeffs[0] = get_bits(&q->gb, 7);
-    for (i = 1; i < BANDS; i++)
-        levlCoeffs[i] = get_bits(&q->gb, 4);
-}
-
-static void imc_decode_level_coefficients(IMCContext *q, int *levlCoeffBuf,
-                                          float *flcoeffs1, float *flcoeffs2)
-{
-    int i, level;
-    float tmp, tmp2;
-    // maybe some frequency division thingy
-
-    flcoeffs1[0] = 20000.0 / pow (2, levlCoeffBuf[0] * 0.18945); // 0.18945 = log2(10) * 0.05703125
-    flcoeffs2[0] = log2f(flcoeffs1[0]);
-    tmp  = flcoeffs1[0];
-    tmp2 = flcoeffs2[0];
-
-    for (i = 1; i < BANDS; i++) {
-        level = levlCoeffBuf[i];
-        if (level == 16) {
-            flcoeffs1[i] = 1.0;
-            flcoeffs2[i] = 0.0;
-        } else {
-            if (level < 17)
-                level -= 7;
-            else if (level <= 24)
-                level -= 32;
-            else
-                level -= 16;
-
-            tmp  *= imc_exp_tab[15 + level];
-            tmp2 += 0.83048 * level;  // 0.83048 = log2(10) * 0.25
-            flcoeffs1[i] = tmp;
-            flcoeffs2[i] = tmp2;
-        }
-    }
-}
-
-
-static void imc_decode_level_coefficients2(IMCContext *q, int *levlCoeffBuf,
-                                           float *old_floor, float *flcoeffs1,
-                                           float *flcoeffs2)
-{
-    int i;
-    /* FIXME maybe flag_buf = noise coding and flcoeffs1 = new scale factors
-     *       and flcoeffs2 old scale factors
-     *       might be incomplete due to a missing table that is in the binary code
-     */
-    for (i = 0; i < BANDS; i++) {
-        flcoeffs1[i] = 0;
-        if (levlCoeffBuf[i] < 16) {
-            flcoeffs1[i] = imc_exp_tab2[levlCoeffBuf[i]] * old_floor[i];
-            flcoeffs2[i] = (levlCoeffBuf[i] - 7) * 0.83048 + flcoeffs2[i]; // 0.83048 = log2(10) * 0.25
-        } else {
-            flcoeffs1[i] = old_floor[i];
-        }
-    }
-}
-
-static void imc_decode_level_coefficients_raw(IMCContext *q, int *levlCoeffBuf,
-                                              float *flcoeffs1, float *flcoeffs2)
-{
-    int i, level, pos;
-    float tmp, tmp2;
-
-    pos = q->coef0_pos;
-    flcoeffs1[pos] = 20000.0 / pow (2, levlCoeffBuf[0] * 0.18945); // 0.18945 = log2(10) * 0.05703125
-    flcoeffs2[pos] = log2f(flcoeffs1[0]);
-    tmp  = flcoeffs1[pos];
-    tmp2 = flcoeffs2[pos];
-
-    levlCoeffBuf++;
-    for (i = 0; i < BANDS; i++) {
-        if (i == pos)
-            continue;
-        level = *levlCoeffBuf++;
-        flcoeffs1[i] = tmp  * powf(10.0, -level * 0.4375); //todo tab
-        flcoeffs2[i] = tmp2 - 1.4533435415 * level; // 1.4533435415 = log2(10) * 0.4375
-    }
-}
-
-/**
- * Perform bit allocation depending on bits available
- */
-static int bit_allocation(IMCContext *q, IMCChannel *chctx,
-                          int stream_format_code, int freebits, int flag)
-{
-    int i, j;
-    const float limit = -1.e20;
-    float highest = 0.0;
-    int indx;
-    int t1 = 0;
-    int t2 = 1;
-    float summa = 0.0;
-    int iacc = 0;
-    int summer = 0;
-    int rres, cwlen;
-    float lowest = 1.e10;
-    int low_indx = 0;
-    float workT[32];
-    int flg;
-    int found_indx = 0;
-
-    for (i = 0; i < BANDS; i++)
-        highest = FFMAX(highest, chctx->flcoeffs1[i]);
-
-    for (i = 0; i < BANDS - 1; i++)
-        chctx->flcoeffs4[i] = chctx->flcoeffs3[i] - log2f(chctx->flcoeffs5[i]);
-    chctx->flcoeffs4[BANDS - 1] = limit;
-
-    highest = highest * 0.25;
-
-    for (i = 0; i < BANDS; i++) {
-        indx = -1;
-        if ((band_tab[i + 1] - band_tab[i]) == chctx->bandWidthT[i])
-            indx = 0;
-
-        if ((band_tab[i + 1] - band_tab[i]) > chctx->bandWidthT[i])
-            indx = 1;
-
-        if (((band_tab[i + 1] - band_tab[i]) / 2) >= chctx->bandWidthT[i])
-            indx = 2;
-
-        if (indx == -1)
-            return AVERROR_INVALIDDATA;
-
-        chctx->flcoeffs4[i] += xTab[(indx * 2 + (chctx->flcoeffs1[i] < highest)) * 2 + flag];
-    }
-
-    if (stream_format_code & 0x2) {
-        chctx->flcoeffs4[0] = limit;
-        chctx->flcoeffs4[1] = limit;
-        chctx->flcoeffs4[2] = limit;
-        chctx->flcoeffs4[3] = limit;
-    }
-
-    for (i = (stream_format_code & 0x2) ? 4 : 0; i < BANDS - 1; i++) {
-        iacc  += chctx->bandWidthT[i];
-        summa += chctx->bandWidthT[i] * chctx->flcoeffs4[i];
-    }
-
-    if (!iacc)
-        return AVERROR_INVALIDDATA;
-
-    chctx->bandWidthT[BANDS - 1] = 0;
-    summa = (summa * 0.5 - freebits) / iacc;
-
-
-    for (i = 0; i < BANDS / 2; i++) {
-        rres = summer - freebits;
-        if ((rres >= -8) && (rres <= 8))
-            break;
-
-        summer = 0;
-        iacc   = 0;
-
-        for (j = (stream_format_code & 0x2) ? 4 : 0; j < BANDS; j++) {
-            cwlen = av_clipf(((chctx->flcoeffs4[j] * 0.5) - summa + 0.5), 0, 6);
-
-            chctx->bitsBandT[j] = cwlen;
-            summer += chctx->bandWidthT[j] * cwlen;
-
-            if (cwlen > 0)
-                iacc += chctx->bandWidthT[j];
-        }
-
-        flg = t2;
-        t2 = 1;
-        if (freebits < summer)
-            t2 = -1;
-        if (i == 0)
-            flg = t2;
-        if (flg != t2)
-            t1++;
-
-        summa = (float)(summer - freebits) / ((t1 + 1) * iacc) + summa;
-    }
-
-    for (i = (stream_format_code & 0x2) ? 4 : 0; i < BANDS; i++) {
-        for (j = band_tab[i]; j < band_tab[i + 1]; j++)
-            chctx->CWlengthT[j] = chctx->bitsBandT[i];
-    }
-
-    if (freebits > summer) {
-        for (i = 0; i < BANDS; i++) {
-            workT[i] = (chctx->bitsBandT[i] == 6) ? -1.e20
-                                              : (chctx->bitsBandT[i] * -2 + chctx->flcoeffs4[i] - 0.415);
-        }
-
-        highest = 0.0;
-
-        do {
-            if (highest <= -1.e20)
-                break;
-
-            found_indx = 0;
-            highest = -1.e20;
-
-            for (i = 0; i < BANDS; i++) {
-                if (workT[i] > highest) {
-                    highest = workT[i];
-                    found_indx = i;
-                }
-            }
-
-            if (highest > -1.e20) {
-                workT[found_indx] -= 2.0;
-                if (++chctx->bitsBandT[found_indx] == 6)
-                    workT[found_indx] = -1.e20;
-
-                for (j = band_tab[found_indx]; j < band_tab[found_indx + 1] && (freebits > summer); j++) {
-                    chctx->CWlengthT[j]++;
-                    summer++;
-                }
-            }
-        } while (freebits > summer);
-    }
-    if (freebits < summer) {
-        for (i = 0; i < BANDS; i++) {
-            workT[i] = chctx->bitsBandT[i] ? (chctx->bitsBandT[i] * -2 + chctx->flcoeffs4[i] + 1.585)
-                                       : 1.e20;
-        }
-        if (stream_format_code & 0x2) {
-            workT[0] = 1.e20;
-            workT[1] = 1.e20;
-            workT[2] = 1.e20;
-            workT[3] = 1.e20;
-        }
-        while (freebits < summer) {
-            lowest   = 1.e10;
-            low_indx = 0;
-            for (i = 0; i < BANDS; i++) {
-                if (workT[i] < lowest) {
-                    lowest   = workT[i];
-                    low_indx = i;
-                }
-            }
-            // if (lowest >= 1.e10)
-            //     break;
-            workT[low_indx] = lowest + 2.0;
-
-            if (!--chctx->bitsBandT[low_indx])
-                workT[low_indx] = 1.e20;
-
-            for (j = band_tab[low_indx]; j < band_tab[low_indx+1] && (freebits < summer); j++) {
-                if (chctx->CWlengthT[j] > 0) {
-                    chctx->CWlengthT[j]--;
-                    summer--;
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-static void imc_get_skip_coeff(IMCContext *q, IMCChannel *chctx)
-{
-    int i, j;
-
-    memset(chctx->skipFlagBits,  0, sizeof(chctx->skipFlagBits));
-    memset(chctx->skipFlagCount, 0, sizeof(chctx->skipFlagCount));
-    for (i = 0; i < BANDS; i++) {
-        if (!chctx->bandFlagsBuf[i] || !chctx->bandWidthT[i])
-            continue;
-
-        if (!chctx->skipFlagRaw[i]) {
-            chctx->skipFlagBits[i] = band_tab[i + 1] - band_tab[i];
-
-            for (j = band_tab[i]; j < band_tab[i + 1]; j++) {
-                chctx->skipFlags[j] = get_bits1(&q->gb);
-                if (chctx->skipFlags[j])
-                    chctx->skipFlagCount[i]++;
-            }
-        } else {
-            for (j = band_tab[i]; j < band_tab[i + 1] - 1; j += 2) {
-                if (!get_bits1(&q->gb)) { // 0
-                    chctx->skipFlagBits[i]++;
-                    chctx->skipFlags[j]      = 1;
-                    chctx->skipFlags[j + 1]  = 1;
-                    chctx->skipFlagCount[i] += 2;
-                } else {
-                    if (get_bits1(&q->gb)) { // 11
-                        chctx->skipFlagBits[i] += 2;
-                        chctx->skipFlags[j]     = 0;
-                        chctx->skipFlags[j + 1] = 1;
-                        chctx->skipFlagCount[i]++;
-                    } else {
-                        chctx->skipFlagBits[i] += 3;
-                        chctx->skipFlags[j + 1] = 0;
-                        if (!get_bits1(&q->gb)) { // 100
-                            chctx->skipFlags[j] = 1;
-                            chctx->skipFlagCount[i]++;
-                        } else { // 101
-                            chctx->skipFlags[j] = 0;
-                        }
-                    }
-                }
-            }
-
-            if (j < band_tab[i + 1]) {
-                chctx->skipFlagBits[i]++;
-                if ((chctx->skipFlags[j] = get_bits1(&q->gb)))
-                    chctx->skipFlagCount[i]++;
-            }
-        }
-    }
-}
-
-/**
- * Increase highest' band coefficient sizes as some bits won't be used
- */
-static void imc_adjust_bit_allocation(IMCContext *q, IMCChannel *chctx,
-                                      int summer)
-{
-    float workT[32];
-    int corrected = 0;
-    int i, j;
-    float highest  = 0;
-    int found_indx = 0;
-
-    for (i = 0; i < BANDS; i++) {
-        workT[i] = (chctx->bitsBandT[i] == 6) ? -1.e20
-                                          : (chctx->bitsBandT[i] * -2 + chctx->flcoeffs4[i] - 0.415);
-    }
-
-    while (corrected < summer) {
-        if (highest <= -1.e20)
-            break;
-
-        highest = -1.e20;
-
-        for (i = 0; i < BANDS; i++) {
-            if (workT[i] > highest) {
-                highest = workT[i];
-                found_indx = i;
-            }
-        }
-
-        if (highest > -1.e20) {
-            workT[found_indx] -= 2.0;
-            if (++(chctx->bitsBandT[found_indx]) == 6)
-                workT[found_indx] = -1.e20;
-
-            for (j = band_tab[found_indx]; j < band_tab[found_indx+1] && (corrected < summer); j++) {
-                if (!chctx->skipFlags[j] && (chctx->CWlengthT[j] < 6)) {
-                    chctx->CWlengthT[j]++;
-                    corrected++;
-                }
-            }
-        }
-    }
-}
-
-static void imc_imdct256(IMCContext *q, IMCChannel *chctx, int channels)
-{
-    int i;
-    float re, im;
-    float *dst1 = q->out_samples;
-    float *dst2 = q->out_samples + (COEFFS - 1);
-
-    /* prerotation */
-    for (i = 0; i < COEFFS / 2; i++) {
-        q->samples[i].re = -(q->pre_coef1[i] * chctx->CWdecoded[COEFFS - 1 - i * 2]) -
-                            (q->pre_coef2[i] * chctx->CWdecoded[i * 2]);
-        q->samples[i].im =  (q->pre_coef2[i] * chctx->CWdecoded[COEFFS - 1 - i * 2]) -
-                            (q->pre_coef1[i] * chctx->CWdecoded[i * 2]);
-    }
-
-    /* FFT */
-    q->fft.fft_permute(&q->fft, q->samples);
-    q->fft.fft_calc(&q->fft, q->samples);
-
-    /* postrotation, window and reorder */
-    for (i = 0; i < COEFFS / 2; i++) {
-        re = ( q->samples[i].re * q->post_cos[i]) + (-q->samples[i].im * q->post_sin[i]);
-        im = (-q->samples[i].im * q->post_cos[i]) - ( q->samples[i].re * q->post_sin[i]);
-        *dst1 =  (q->mdct_sine_window[COEFFS - 1 - i * 2] * chctx->last_fft_im[i])
-               + (q->mdct_sine_window[i * 2] * re);
-        *dst2 =  (q->mdct_sine_window[i * 2] * chctx->last_fft_im[i])
-               - (q->mdct_sine_window[COEFFS - 1 - i * 2] * re);
-        dst1 += 2;
-        dst2 -= 2;
-        chctx->last_fft_im[i] = im;
-    }
-}
-
-static int inverse_quant_coeff(IMCContext *q, IMCChannel *chctx,
-                               int stream_format_code)
-{
-    int i, j;
-    int middle_value, cw_len, max_size;
-    const float *quantizer;
-
-    for (i = 0; i < BANDS; i++) {
-        for (j = band_tab[i]; j < band_tab[i + 1]; j++) {
-            chctx->CWdecoded[j] = 0;
-            cw_len = chctx->CWlengthT[j];
-
-            if (cw_len <= 0 || chctx->skipFlags[j])
-                continue;
-
-            max_size     = 1 << cw_len;
-            middle_value = max_size >> 1;
-
-            if (chctx->codewords[j] >= max_size || chctx->codewords[j] < 0)
-                return AVERROR_INVALIDDATA;
-
-            if (cw_len >= 4) {
-                quantizer = imc_quantizer2[(stream_format_code & 2) >> 1];
-                if (chctx->codewords[j] >= middle_value)
-                    chctx->CWdecoded[j] =  quantizer[chctx->codewords[j] - 8]                * chctx->flcoeffs6[i];
-                else
-                    chctx->CWdecoded[j] = -quantizer[max_size - chctx->codewords[j] - 8 - 1] * chctx->flcoeffs6[i];
-            }else{
-                quantizer = imc_quantizer1[((stream_format_code & 2) >> 1) | (chctx->bandFlagsBuf[i] << 1)];
-                if (chctx->codewords[j] >= middle_value)
-                    chctx->CWdecoded[j] =  quantizer[chctx->codewords[j] - 1]            * chctx->flcoeffs6[i];
-                else
-                    chctx->CWdecoded[j] = -quantizer[max_size - 2 - chctx->codewords[j]] * chctx->flcoeffs6[i];
-            }
-        }
-    }
-    return 0;
-}
-
-
-static int imc_get_coeffs(IMCContext *q, IMCChannel *chctx)
-{
-    int i, j, cw_len, cw;
-
-    for (i = 0; i < BANDS; i++) {
-        if (!chctx->sumLenArr[i])
-            continue;
-        if (chctx->bandFlagsBuf[i] || chctx->bandWidthT[i]) {
-            for (j = band_tab[i]; j < band_tab[i + 1]; j++) {
-                cw_len = chctx->CWlengthT[j];
-                cw = 0;
-
-                if (get_bits_count(&q->gb) + cw_len > 512) {
-                    av_dlog(NULL, "Band %i coeff %i cw_len %i\n", i, j, cw_len);
-                    return AVERROR_INVALIDDATA;
-                }
-
-                if (cw_len && (!chctx->bandFlagsBuf[i] || !chctx->skipFlags[j]))
-                    cw = get_bits(&q->gb, cw_len);
-
-                chctx->codewords[j] = cw;
-            }
-        }
-    }
-    return 0;
-}
-
-static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx)
-{
-    int i, j;
-    int bits, summer;
-
-    for (i = 0; i < BANDS; i++) {
-        chctx->sumLenArr[i]   = 0;
-        chctx->skipFlagRaw[i] = 0;
-        for (j = band_tab[i]; j < band_tab[i + 1]; j++)
-            chctx->sumLenArr[i] += chctx->CWlengthT[j];
-        if (chctx->bandFlagsBuf[i])
-            if ((((band_tab[i + 1] - band_tab[i]) * 1.5) > chctx->sumLenArr[i]) && (chctx->sumLenArr[i] > 0))
-                chctx->skipFlagRaw[i] = 1;
-    }
-
-    imc_get_skip_coeff(q, chctx);
-
-    for (i = 0; i < BANDS; i++) {
-        chctx->flcoeffs6[i] = chctx->flcoeffs1[i];
-        /* band has flag set and at least one coded coefficient */
-        if (chctx->bandFlagsBuf[i] && (band_tab[i + 1] - band_tab[i]) != chctx->skipFlagCount[i]) {
-            chctx->flcoeffs6[i] *= q->sqrt_tab[ band_tab[i + 1] - band_tab[i]] /
-                                   q->sqrt_tab[(band_tab[i + 1] - band_tab[i] - chctx->skipFlagCount[i])];
-        }
-    }
-
-    /* calculate bits left, bits needed and adjust bit allocation */
-    bits = summer = 0;
-
-    for (i = 0; i < BANDS; i++) {
-        if (chctx->bandFlagsBuf[i]) {
-            for (j = band_tab[i]; j < band_tab[i + 1]; j++) {
-                if (chctx->skipFlags[j]) {
-                    summer += chctx->CWlengthT[j];
-                    chctx->CWlengthT[j] = 0;
-                }
-            }
-            bits   += chctx->skipFlagBits[i];
-            summer -= chctx->skipFlagBits[i];
-        }
-    }
-    imc_adjust_bit_allocation(q, chctx, summer);
-}
-
-static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
-{
-    int stream_format_code;
-    int imc_hdr, i, j, ret;
-    int flag;
-    int bits;
-    int counter, bitscount;
-    IMCChannel *chctx = q->chctx + ch;
-
-
-    /* Check the frame header */
-    imc_hdr = get_bits(&q->gb, 9);
-    if (imc_hdr & 0x18) {
-        av_log(avctx, AV_LOG_ERROR, "frame header check failed!\n");
-        av_log(avctx, AV_LOG_ERROR, "got %X.\n", imc_hdr);
-        return AVERROR_INVALIDDATA;
-    }
-    stream_format_code = get_bits(&q->gb, 3);
-
-    if (stream_format_code & 0x04)
-        chctx->decoder_reset = 1;
-
-    if (chctx->decoder_reset) {
-        for (i = 0; i < BANDS; i++)
-            chctx->old_floor[i] = 1.0;
-        for (i = 0; i < COEFFS; i++)
-            chctx->CWdecoded[i] = 0;
-        chctx->decoder_reset = 0;
-    }
-
-    flag = get_bits1(&q->gb);
-    if (stream_format_code & 0x1)
-        imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf,
-                                          chctx->flcoeffs1, chctx->flcoeffs2);
-    else if (stream_format_code & 0x1)
-        imc_read_level_coeffs_raw(q, stream_format_code, chctx->levlCoeffBuf);
-    else
-        imc_read_level_coeffs(q, stream_format_code, chctx->levlCoeffBuf);
-
-    if (stream_format_code & 0x4)
-        imc_decode_level_coefficients(q, chctx->levlCoeffBuf,
-                                      chctx->flcoeffs1, chctx->flcoeffs2);
-    else
-        imc_decode_level_coefficients2(q, chctx->levlCoeffBuf, chctx->old_floor,
-                                       chctx->flcoeffs1, chctx->flcoeffs2);
-
-    memcpy(chctx->old_floor, chctx->flcoeffs1, 32 * sizeof(float));
-
-    counter = 0;
-    if (stream_format_code & 0x1) {
-        for (i = 0; i < BANDS; i++) {
-            chctx->bandWidthT[i]   = band_tab[i + 1] - band_tab[i];
-            chctx->bandFlagsBuf[i] = 0;
-            chctx->flcoeffs3[i]    = chctx->flcoeffs2[i] * 2;
-            chctx->flcoeffs5[i]    = 1.0;
-        }
-    } else {
-        for (i = 0; i < BANDS; i++) {
-            if (chctx->levlCoeffBuf[i] == 16) {
-                chctx->bandWidthT[i] = 0;
-                counter++;
-            } else
-                chctx->bandWidthT[i] = band_tab[i + 1] - band_tab[i];
-        }
-
-        memset(chctx->bandFlagsBuf, 0, BANDS * sizeof(int));
-        for (i = 0; i < BANDS - 1; i++)
-            if (chctx->bandWidthT[i])
-                chctx->bandFlagsBuf[i] = get_bits1(&q->gb);
-
-        imc_calculate_coeffs(q, chctx->flcoeffs1, chctx->flcoeffs2,
-                             chctx->bandWidthT, chctx->flcoeffs3,
-                             chctx->flcoeffs5);
-    }
-
-    bitscount = 0;
-    /* first 4 bands will be assigned 5 bits per coefficient */
-    if (stream_format_code & 0x2) {
-        bitscount += 15;
-
-        chctx->bitsBandT[0] = 5;
-        chctx->CWlengthT[0] = 5;
-        chctx->CWlengthT[1] = 5;
-        chctx->CWlengthT[2] = 5;
-        for (i = 1; i < 4; i++) {
-            if (stream_format_code & 0x1)
-                bits = 5;
-            else
-                bits = (chctx->levlCoeffBuf[i] == 16) ? 0 : 5;
-            chctx->bitsBandT[i] = bits;
-            for (j = band_tab[i]; j < band_tab[i + 1]; j++) {
-                chctx->CWlengthT[j] = bits;
-                bitscount      += bits;
-            }
-        }
-    }
-    if (avctx->codec_id == AV_CODEC_ID_IAC) {
-        bitscount += !!chctx->bandWidthT[BANDS - 1];
-        if (!(stream_format_code & 0x2))
-            bitscount += 16;
-    }
-
-    if ((ret = bit_allocation(q, chctx, stream_format_code,
-                              512 - bitscount - get_bits_count(&q->gb),
-                              flag)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Bit allocations failed\n");
-        chctx->decoder_reset = 1;
-        return ret;
-    }
-
-    if (stream_format_code & 0x1) {
-        for (i = 0; i < BANDS; i++)
-            chctx->skipFlags[i] = 0;
-    } else {
-        imc_refine_bit_allocation(q, chctx);
-    }
-
-    for (i = 0; i < BANDS; i++) {
-        chctx->sumLenArr[i] = 0;
-
-        for (j = band_tab[i]; j < band_tab[i + 1]; j++)
-            if (!chctx->skipFlags[j])
-                chctx->sumLenArr[i] += chctx->CWlengthT[j];
-    }
-
-    memset(chctx->codewords, 0, sizeof(chctx->codewords));
-
-    if (imc_get_coeffs(q, chctx) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Read coefficients failed\n");
-        chctx->decoder_reset = 1;
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (inverse_quant_coeff(q, chctx, stream_format_code) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Inverse quantization of coefficients failed\n");
-        chctx->decoder_reset = 1;
-        return AVERROR_INVALIDDATA;
-    }
-
-    memset(chctx->skipFlags, 0, sizeof(chctx->skipFlags));
-
-    imc_imdct256(q, chctx, avctx->channels);
-
-    return 0;
-}
-
-static int imc_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    int ret, i;
-
-    IMCContext *q = avctx->priv_data;
-
-    LOCAL_ALIGNED_16(uint16_t, buf16, [IMC_BLOCK_SIZE / 2]);
-
-    if (buf_size < IMC_BLOCK_SIZE * avctx->channels) {
-        av_log(avctx, AV_LOG_ERROR, "frame too small!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = COEFFS;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    for (i = 0; i < avctx->channels; i++) {
-        q->out_samples = (float *)frame->extended_data[i];
-
-        q->dsp.bswap16_buf(buf16, (const uint16_t*)buf, IMC_BLOCK_SIZE / 2);
-
-        init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8);
-
-        buf += IMC_BLOCK_SIZE;
-
-        if ((ret = imc_decode_block(avctx, q, i)) < 0)
-            return ret;
-    }
-
-    if (avctx->channels == 2) {
-        q->fdsp.butterflies_float((float *)frame->extended_data[0],
-                                  (float *)frame->extended_data[1], COEFFS);
-    }
-
-    *got_frame_ptr = 1;
-
-    return IMC_BLOCK_SIZE * avctx->channels;
-}
-
-
-static av_cold int imc_decode_close(AVCodecContext * avctx)
-{
-    IMCContext *q = avctx->priv_data;
-
-    ff_fft_end(&q->fft);
-
-    return 0;
-}
-
-
-AVCodec ff_imc_decoder = {
-    .name           = "imc",
-    .long_name      = NULL_IF_CONFIG_SMALL("IMC (Intel Music Coder)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_IMC,
-    .priv_data_size = sizeof(IMCContext),
-    .init           = imc_decode_init,
-    .close          = imc_decode_close,
-    .decode         = imc_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-
-AVCodec ff_iac_decoder = {
-    .name           = "iac",
-    .long_name      = NULL_IF_CONFIG_SMALL("IAC (Indeo Audio Coder)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_IAC,
-    .priv_data_size = sizeof(IMCContext),
-    .init           = imc_decode_init,
-    .close          = imc_decode_close,
-    .decode         = imc_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/imcdata.h b/deps/libav/libavcodec/imcdata.h
deleted file mode 100644
index 8e99391..0000000
--- a/deps/libav/libavcodec/imcdata.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * IMC compatible decoder
- * Copyright (c) 2002-2004 Maxim Poliakovski
- * Copyright (c) 2006 Benjamin Larsson
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_IMCDATA_H
-#define AVCODEC_IMCDATA_H
-
-#include <stdint.h>
-
-static const uint16_t band_tab[33] = {
-      0,   3,   6,   9,  12,  16,  20,  24,  29,  34,  40,
-     46,  53,  60,  68,  76,  84,  93, 102, 111, 121, 131,
-    141, 151, 162, 173, 184, 195, 207, 219, 231, 243, 256,
-};
-
-
-static const int8_t cyclTab[32] = {
-    1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11,
-   12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23,
-   24, 25, 26, 27, 28, 29, 30, 31, 32, 32,
-};
-
-static const int8_t cyclTab2[32] = {
-   -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22,
-23, 24, 25, 26, 27, 28, 29};
-
-static const float imc_weights1[31] = {
-    0.119595, 0.123124, 0.129192, 9.97377e-2, 8.1923e-2, 9.61153e-2, 8.77885e-2, 8.61174e-2,
-    9.00882e-2, 9.91658e-2, 0.112991, 0.131126, 0.152886, 0.177292, 0.221782, 0.244917, 0.267386,
-    0.306816, 0.323046, 0.33729, 0.366773, 0.392557, 0.398076, 0.403302, 0.42451, 0.444777,
-    0.449188, 0.455445, 0.477853, 0.500669, 0.510395};
-
-static const float imc_weights2[31] = {
-    3.23466e-3, 3.49886e-3, 3.98413e-3, 1.98116e-3, 1.16465e-3, 1.79283e-3, 1.40372e-3, 1.33274e-3,
-    1.50523e-3, 1.95064e-3, 2.77472e-3, 4.14725e-3, 6.2776e-3, 9.36401e-3, 1.71397e-2, 2.24052e-2,
-    2.83971e-2, 4.11689e-2, 4.73165e-2, 5.31631e-2, 6.66614e-2, 8.00824e-2, 8.31588e-2, 8.61397e-2,
-    9.89229e-2, 0.112197, 0.115227, 0.119613, 0.136174, 0.15445, 0.162685};
-
-static const float imc_quantizer1[4][8] = {
-    { 8.4431201e-1, 4.7358301e-1, 1.448354, 2.7073899e-1, 7.4449003e-1, 1.241991,  1.845484,  0.0},
-    { 8.6876702e-1, 4.7659001e-1, 1.478224, 2.5672799e-1, 7.55777e-1,   1.3229851, 2.03438,   0.0},
-    { 7.5891501e-1, 6.2272799e-1, 1.271322, 3.47904e-1,   7.5317699e-1, 1.150767,  1.628476,  0.0},
-    { 7.65257e-1,   6.44647e-1,   1.263824, 3.4548101e-1, 7.6384902e-1, 1.214466,  1.7638789, 0.0},
-};
-
-static const float imc_quantizer2[2][56] = {
-    { 1.39236e-1, 3.50548e-1, 5.9547901e-1, 8.5772401e-1, 1.121545, 1.3882281, 1.695882, 2.1270809,
-      7.2221003e-2, 1.85177e-1, 2.9521701e-1, 4.12568e-1, 5.4068601e-1, 6.7679501e-1, 8.1196898e-1, 9.4765198e-1,
-      1.0779999, 1.203415, 1.337265, 1.481871, 1.639982, 1.814766, 2.0701399, 2.449862,
-      3.7533998e-2, 1.02722e-1, 1.6021401e-1, 2.16043e-1, 2.7231601e-1, 3.3025399e-1, 3.9022601e-1, 4.52849e-1,
-      5.1794899e-1, 5.8529502e-1, 6.53956e-1, 7.2312802e-1, 7.9150802e-1, 8.5891002e-1, 9.28141e-1, 9.9706203e-1,
-      1.062153, 1.12564, 1.189834, 1.256122, 1.324469, 1.3955311, 1.468906, 1.545084,
-      1.6264729, 1.711524, 1.802705, 1.91023, 2.0533991, 2.22333, 2.4830019, 3.253329 },
-    { 1.11654e-1, 3.54469e-1, 6.4232099e-1, 9.6128798e-1, 1.295053, 1.61777, 1.989839, 2.51107,
-      5.7721999e-2, 1.69879e-1, 2.97589e-1, 4.3858799e-1, 5.9039903e-1, 7.4934798e-1, 9.1628098e-1, 1.087297,
-      1.262751, 1.4288321, 1.6040879, 1.79067, 2.000668, 2.2394669, 2.649332, 5.2760072,
-      2.9722e-2, 8.7316997e-2, 1.4445201e-1, 2.04247e-1, 2.6879501e-1, 3.3716801e-1, 4.08811e-1, 4.8306999e-1,
-      5.6049401e-1, 6.3955498e-1, 7.2044599e-1, 8.0427998e-1, 8.8933599e-1, 9.7537601e-1, 1.062461, 1.1510431,
-      1.240236, 1.326715, 1.412513, 1.500502, 1.591749, 1.686413, 1.785239, 1.891233,
-      2.0051291, 2.127681, 2.2709141, 2.475826, 2.7219379, 3.101985, 4.686213, 6.2287788},
-};
-
-
-static const float xTab[14] = {7.6, 3.6, 4.4, 3.7, 6.1, 5.1, 2.3, 1.6, 6.2, 1.5, 1.8, 1.2, 0, 0}; //10014048
-
-/* precomputed table for 10^(i/4), i=-15..16 */
-static const float imc_exp_tab[32] = {
-    1.778280e-4, 3.162278e-4, 5.623413e-4, 1.000000e-3,
-    1.778280e-3, 3.162278e-3, 5.623413e-3, 1.000000e-2,
-    1.778280e-2, 3.162278e-2, 5.623413e-2, 1.000000e-1,
-    1.778280e-1, 3.162278e-1, 5.623413e-1, 1.000000e00,
-    1.778280e00, 3.162278e00, 5.623413e00, 1.000000e01,
-    1.778280e01, 3.162278e01, 5.623413e01, 1.000000e02,
-    1.778280e02, 3.162278e02, 5.623413e02, 1.000000e03,
-    1.778280e03, 3.162278e03, 5.623413e03, 1.000000e04
-};
-static const float * const imc_exp_tab2 = imc_exp_tab + 8;
-
-
-static const uint8_t imc_cb_select[4][32] = {
-    { 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2 },
-    { 0, 2, 0, 3, 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
-    { 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-      3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2 },
-    { 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-      3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-static const uint8_t imc_huffman_sizes[4] = {
-    17,  17,  18,  18
-};
-
-static const uint8_t imc_huffman_lens[4][4][18] = {
-    {
-        { 16, 15, 13, 11,  8,  5,  3,  1,  2,  4,  6,  9, 10, 12, 14, 16,  7,  0 },
-        { 10,  8,  7,  6,  4,  4,  3,  2,  2,  3,  4,  6,  7,  9, 11, 11,  7,  0 },
-        { 15, 15, 14, 11,  8,  6,  4,  2,  1,  4,  5,  7,  9, 10, 12, 13,  4,  0 },
-        { 13, 11, 10,  8,  6,  4,  2,  2,  2,  3,  5,  7,  9, 12, 15, 15, 14,  0 },
-    },
-    {
-        { 14, 12, 10,  8,  7,  4,  2,  2,  2,  3,  5,  7,  9, 11, 13, 14,  7,  0 },
-        { 14, 13, 11,  8,  6,  4,  3,  2,  2,  3,  5,  7,  9, 10, 12, 14,  3,  0 },
-        { 13, 12, 10,  7,  5,  4,  3,  2,  2,  3,  4,  6,  8,  9, 11, 13,  4,  0 },
-        { 13, 12, 10,  7,  5,  4,  3,  2,  2,  3,  4,  6,  8,  9, 11, 13,  4,  0 },
-    },
-    {
-        { 16, 14, 12, 10,  8,  5,  3,  1,  2,  4,  7,  9, 11, 13, 15, 17,  6, 17 },
-        { 15, 13, 11,  8,  6,  4,  2,  2,  2,  3,  5,  7, 10, 12, 14, 16,  9, 16 },
-        { 14, 12, 11,  9,  8,  6,  3,  1,  2,  5,  7, 10, 13, 15, 16, 17,  4, 17 },
-        { 16, 14, 12,  9,  7,  5,  2,  2,  2,  3,  4,  6,  8, 11, 13, 15, 10, 16 },
-    },
-    {
-        { 13, 11, 10,  8,  7,  5,  2,  2,  2,  4,  6,  9, 12, 14, 15, 16,  3, 16 },
-        { 11, 11, 10,  9,  8,  7,  5,  4,  3,  3,  3,  3,  3,  3,  4,  5,  6,  5 },
-        {  9,  9,  7,  6,  5,  4,  3,  3,  2,  3,  4,  5,  4,  5,  5,  6,  8,  6 },
-        { 13, 12, 10,  8,  5,  3,  3,  2,  2,  3,  4,  7,  9, 11, 14, 15,  6, 15 },
-    }
-};
-
-static const uint16_t imc_huffman_bits[4][4][18] = {
-    {
-        { 0xCC32, 0x6618, 0x1987, 0x0660, 0x00CD, 0x0018, 0x0007, 0x0000, 0x0002, 0x000D, 0x0032, 0x0199, 0x0331, 0x0CC2, 0x330D, 0xCC33, 0x0067, 0x0000 },
-        { 0x02FE, 0x00BE, 0x005E, 0x002D, 0x000A, 0x0009, 0x0003, 0x0003, 0x0000, 0x0002, 0x0008, 0x002C, 0x005D, 0x017E, 0x05FE, 0x05FF, 0x005C, 0x0000 },
-        { 0x5169, 0x5168, 0x28B5, 0x0517, 0x00A3, 0x0029, 0x0008, 0x0003, 0x0000, 0x0009, 0x0015, 0x0050, 0x0144, 0x028A, 0x0A2C, 0x145B, 0x000B, 0x0000 },
-        { 0x1231, 0x048D, 0x0247, 0x0090, 0x0025, 0x0008, 0x0001, 0x0003, 0x0000, 0x0005, 0x0013, 0x0049, 0x0122, 0x0919, 0x48C3, 0x48C2, 0x2460, 0x0000 },
-    },
-    {
-        { 0x2D1D, 0x0B46, 0x02D0, 0x00B5, 0x0059, 0x000A, 0x0003, 0x0001, 0x0000, 0x0004, 0x0017, 0x005B, 0x0169, 0x05A2, 0x168F, 0x2D1C, 0x0058, 0x0000 },
-        { 0x1800, 0x0C01, 0x0301, 0x0061, 0x0019, 0x0007, 0x0004, 0x0003, 0x0000, 0x0005, 0x000D, 0x0031, 0x00C1, 0x0181, 0x0601, 0x1801, 0x0002, 0x0000 },
-        { 0x1556, 0x0AAA, 0x02AB, 0x0054, 0x0014, 0x000B, 0x0002, 0x0003, 0x0000, 0x0003, 0x0008, 0x002B, 0x00AB, 0x0154, 0x0554, 0x1557, 0x0009, 0x0000 },
-        { 0x1556, 0x0AAA, 0x02AB, 0x0054, 0x0014, 0x000B, 0x0002, 0x0003, 0x0000, 0x0003, 0x0008, 0x002B, 0x00AB, 0x0154, 0x0554, 0x1557, 0x0009, 0x0000 },
-    },
-    {
-        { 0x2993, 0x0A65, 0x0298, 0x00A7, 0x0028, 0x0004, 0x0000, 0x0001, 0x0001, 0x0003, 0x0015, 0x0052, 0x014D, 0x0533, 0x14C8, 0x5324, 0x000B, 0x5325 },
-        { 0x09B8, 0x026F, 0x009A, 0x0012, 0x0005, 0x0000, 0x0001, 0x0002, 0x0003, 0x0001, 0x0003, 0x0008, 0x004C, 0x0136, 0x04DD, 0x1373, 0x0027, 0x1372 },
-        { 0x0787, 0x01E0, 0x00F1, 0x003D, 0x001F, 0x0006, 0x0001, 0x0001, 0x0001, 0x0002, 0x000E, 0x0079, 0x03C2, 0x0F0D, 0x1E19, 0x3C30, 0x0000, 0x3C31 },
-        { 0x4B06, 0x12C0, 0x04B1, 0x0097, 0x0024, 0x0008, 0x0002, 0x0003, 0x0000, 0x0003, 0x0005, 0x0013, 0x004A, 0x0259, 0x0961, 0x2582, 0x012D, 0x4B07 },
-    },
-    {
-        { 0x0A5A, 0x0297, 0x014A, 0x0053, 0x0028, 0x000B, 0x0003, 0x0000, 0x0002, 0x0004, 0x0015, 0x00A4, 0x052C, 0x14B7, 0x296C, 0x52DB, 0x0003, 0x52DA },
-        { 0x0193, 0x0192, 0x00C8, 0x0065, 0x0033, 0x0018, 0x0007, 0x0004, 0x0000, 0x0004, 0x0005, 0x0007, 0x0006, 0x0003, 0x0005, 0x0005, 0x000D, 0x0004 },
-        { 0x0012, 0x0013, 0x0005, 0x0003, 0x0000, 0x0003, 0x0005, 0x0004, 0x0003, 0x0003, 0x0005, 0x0005, 0x0004, 0x0004, 0x0003, 0x0005, 0x0008, 0x0004 },
-        { 0x0D66, 0x06B2, 0x01AD, 0x006A, 0x000C, 0x0005, 0x0004, 0x0000, 0x0003, 0x0002, 0x0007, 0x0034, 0x00D7, 0x0358, 0x1ACF, 0x359C, 0x001B, 0x359D },
-    }
-};
-
-#endif /* AVCODEC_IMCDATA_H */
diff --git a/deps/libav/libavcodec/imgconvert.c b/deps/libav/libavcodec/imgconvert.c
deleted file mode 100644
index 4eb049f..0000000
--- a/deps/libav/libavcodec/imgconvert.c
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
- * Misc image conversion routines
- * Copyright (c) 2001, 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * misc image conversion routines
- */
-
-/* TODO:
- * - write 'ffimg' program to test all the image related stuff
- * - move all api to slice based system
- * - integrate deinterlacing, postprocessing and scaling in the conversion process
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "imgconvert.h"
-#include "internal.h"
-#include "libavutil/colorspace.h"
-#include "libavutil/common.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/imgutils.h"
-
-#if HAVE_MMX_EXTERNAL
-#include "x86/dsputil_x86.h"
-#endif
-
-#if HAVE_MMX_EXTERNAL
-#define deinterlace_line_inplace ff_deinterlace_line_inplace_mmx
-#define deinterlace_line         ff_deinterlace_line_mmx
-#else
-#define deinterlace_line_inplace deinterlace_line_inplace_c
-#define deinterlace_line         deinterlace_line_c
-#endif
-
-void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    *h_shift = desc->log2_chroma_w;
-    *v_shift = desc->log2_chroma_h;
-}
-
-static int is_gray(const AVPixFmtDescriptor *desc)
-{
-    return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;
-}
-
-int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
-                             enum AVPixelFormat src_pix_fmt,
-                             int has_alpha)
-{
-    const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
-    const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
-    int loss, i, nb_components = FFMIN(src_desc->nb_components,
-                                       dst_desc->nb_components);
-
-    /* compute loss */
-    loss = 0;
-
-    if (dst_pix_fmt == src_pix_fmt)
-        return 0;
-
-    for (i = 0; i < nb_components; i++)
-        if (src_desc->comp[i].depth_minus1 > dst_desc->comp[i].depth_minus1)
-            loss |= FF_LOSS_DEPTH;
-
-    if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||
-        dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
-        loss |= FF_LOSS_RESOLUTION;
-
-    if ((src_desc->flags & AV_PIX_FMT_FLAG_RGB) != (dst_desc->flags & AV_PIX_FMT_FLAG_RGB))
-        loss |= FF_LOSS_COLORSPACE;
-
-    if (has_alpha && !(dst_desc->flags & AV_PIX_FMT_FLAG_ALPHA) &&
-         (dst_desc->flags & AV_PIX_FMT_FLAG_ALPHA))
-        loss |= FF_LOSS_ALPHA;
-
-    if (dst_pix_fmt == AV_PIX_FMT_PAL8 && !is_gray(src_desc))
-        return loss | FF_LOSS_COLORQUANT;
-
-    if (src_desc->nb_components > dst_desc->nb_components)
-        if (is_gray(dst_desc))
-            loss |= FF_LOSS_CHROMA;
-
-    return loss;
-}
-
-static enum AVPixelFormat avcodec_find_best_pix_fmt1(enum AVPixelFormat *pix_fmt_list,
-                                      enum AVPixelFormat src_pix_fmt,
-                                      int has_alpha,
-                                      int loss_mask)
-{
-    int dist, i, loss, min_dist;
-    enum AVPixelFormat dst_pix_fmt;
-
-    /* find exact color match with smallest size */
-    dst_pix_fmt = AV_PIX_FMT_NONE;
-    min_dist = 0x7fffffff;
-    i = 0;
-    while (pix_fmt_list[i] != AV_PIX_FMT_NONE) {
-        enum AVPixelFormat pix_fmt = pix_fmt_list[i];
-
-        if (i > AV_PIX_FMT_NB) {
-            av_log(NULL, AV_LOG_ERROR, "Pixel format list longer than expected, "
-                   "it is either not properly terminated or contains duplicates\n");
-            return AV_PIX_FMT_NONE;
-        }
-
-        loss = avcodec_get_pix_fmt_loss(pix_fmt, src_pix_fmt, has_alpha) & loss_mask;
-        if (loss == 0) {
-            dist = av_get_bits_per_pixel(av_pix_fmt_desc_get(pix_fmt));
-            if (dist < min_dist) {
-                min_dist = dist;
-                dst_pix_fmt = pix_fmt;
-            }
-        }
-        i++;
-    }
-    return dst_pix_fmt;
-}
-
-enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
-                                            enum AVPixelFormat src_pix_fmt,
-                                            int has_alpha, int *loss_ptr)
-{
-    enum AVPixelFormat dst_pix_fmt;
-    int loss_mask, i;
-    static const int loss_mask_order[] = {
-        ~0, /* no loss first */
-        ~FF_LOSS_ALPHA,
-        ~FF_LOSS_RESOLUTION,
-        ~(FF_LOSS_COLORSPACE | FF_LOSS_RESOLUTION),
-        ~FF_LOSS_COLORQUANT,
-        ~FF_LOSS_DEPTH,
-        0,
-    };
-
-    /* try with successive loss */
-    i = 0;
-    for(;;) {
-        loss_mask = loss_mask_order[i++];
-        dst_pix_fmt = avcodec_find_best_pix_fmt1(pix_fmt_list, src_pix_fmt,
-                                                 has_alpha, loss_mask);
-        if (dst_pix_fmt >= 0)
-            goto found;
-        if (loss_mask == 0)
-            break;
-    }
-    return AV_PIX_FMT_NONE;
- found:
-    if (loss_ptr)
-        *loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
-    return dst_pix_fmt;
-}
-
-/* 2x2 -> 1x1 */
-void ff_shrink22(uint8_t *dst, int dst_wrap,
-                     const uint8_t *src, int src_wrap,
-                     int width, int height)
-{
-    int w;
-    const uint8_t *s1, *s2;
-    uint8_t *d;
-
-    for(;height > 0; height--) {
-        s1 = src;
-        s2 = s1 + src_wrap;
-        d = dst;
-        for(w = width;w >= 4; w-=4) {
-            d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
-            d[1] = (s1[2] + s1[3] + s2[2] + s2[3] + 2) >> 2;
-            d[2] = (s1[4] + s1[5] + s2[4] + s2[5] + 2) >> 2;
-            d[3] = (s1[6] + s1[7] + s2[6] + s2[7] + 2) >> 2;
-            s1 += 8;
-            s2 += 8;
-            d += 4;
-        }
-        for(;w > 0; w--) {
-            d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
-            s1 += 2;
-            s2 += 2;
-            d++;
-        }
-        src += 2 * src_wrap;
-        dst += dst_wrap;
-    }
-}
-
-/* 4x4 -> 1x1 */
-void ff_shrink44(uint8_t *dst, int dst_wrap,
-                     const uint8_t *src, int src_wrap,
-                     int width, int height)
-{
-    int w;
-    const uint8_t *s1, *s2, *s3, *s4;
-    uint8_t *d;
-
-    for(;height > 0; height--) {
-        s1 = src;
-        s2 = s1 + src_wrap;
-        s3 = s2 + src_wrap;
-        s4 = s3 + src_wrap;
-        d = dst;
-        for(w = width;w > 0; w--) {
-            d[0] = (s1[0] + s1[1] + s1[2] + s1[3] +
-                    s2[0] + s2[1] + s2[2] + s2[3] +
-                    s3[0] + s3[1] + s3[2] + s3[3] +
-                    s4[0] + s4[1] + s4[2] + s4[3] + 8) >> 4;
-            s1 += 4;
-            s2 += 4;
-            s3 += 4;
-            s4 += 4;
-            d++;
-        }
-        src += 4 * src_wrap;
-        dst += dst_wrap;
-    }
-}
-
-/* 8x8 -> 1x1 */
-void ff_shrink88(uint8_t *dst, int dst_wrap,
-                     const uint8_t *src, int src_wrap,
-                     int width, int height)
-{
-    int w, i;
-
-    for(;height > 0; height--) {
-        for(w = width;w > 0; w--) {
-            int tmp=0;
-            for(i=0; i<8; i++){
-                tmp += src[0] + src[1] + src[2] + src[3] + src[4] + src[5] + src[6] + src[7];
-                src += src_wrap;
-            }
-            *(dst++) = (tmp + 32)>>6;
-            src += 8 - 8*src_wrap;
-        }
-        src += 8*src_wrap - 8*width;
-        dst += dst_wrap - width;
-    }
-}
-
-/* return true if yuv planar */
-static inline int is_yuv_planar(const AVPixFmtDescriptor *desc)
-{
-    return (!(desc->flags & AV_PIX_FMT_FLAG_RGB) &&
-             (desc->flags & AV_PIX_FMT_FLAG_PLANAR));
-}
-
-int av_picture_crop(AVPicture *dst, const AVPicture *src,
-                    enum AVPixelFormat pix_fmt, int top_band, int left_band)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    int y_shift;
-    int x_shift;
-
-    if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB || !is_yuv_planar(desc))
-        return -1;
-
-    y_shift = desc->log2_chroma_h;
-    x_shift = desc->log2_chroma_w;
-
-    dst->data[0] = src->data[0] + (top_band * src->linesize[0]) + left_band;
-    dst->data[1] = src->data[1] + ((top_band >> y_shift) * src->linesize[1]) + (left_band >> x_shift);
-    dst->data[2] = src->data[2] + ((top_band >> y_shift) * src->linesize[2]) + (left_band >> x_shift);
-
-    dst->linesize[0] = src->linesize[0];
-    dst->linesize[1] = src->linesize[1];
-    dst->linesize[2] = src->linesize[2];
-    return 0;
-}
-
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
-                   enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright,
-            int *color)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    uint8_t *optr;
-    int y_shift;
-    int x_shift;
-    int yheight;
-    int i, y;
-
-    if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB ||
-        !is_yuv_planar(desc)) return -1;
-
-    for (i = 0; i < 3; i++) {
-        x_shift = i ? desc->log2_chroma_w : 0;
-        y_shift = i ? desc->log2_chroma_h : 0;
-
-        if (padtop || padleft) {
-            memset(dst->data[i], color[i],
-                dst->linesize[i] * (padtop >> y_shift) + (padleft >> x_shift));
-        }
-
-        if (padleft || padright) {
-            optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
-                (dst->linesize[i] - (padright >> x_shift));
-            yheight = (height - 1 - (padtop + padbottom)) >> y_shift;
-            for (y = 0; y < yheight; y++) {
-                memset(optr, color[i], (padleft + padright) >> x_shift);
-                optr += dst->linesize[i];
-            }
-        }
-
-        if (src) { /* first line */
-            uint8_t *iptr = src->data[i];
-            optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
-                    (padleft >> x_shift);
-            memcpy(optr, iptr, (width - padleft - padright) >> x_shift);
-            iptr += src->linesize[i];
-            optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
-                (dst->linesize[i] - (padright >> x_shift));
-            yheight = (height - 1 - (padtop + padbottom)) >> y_shift;
-            for (y = 0; y < yheight; y++) {
-                memset(optr, color[i], (padleft + padright) >> x_shift);
-                memcpy(optr + ((padleft + padright) >> x_shift), iptr,
-                       (width - padleft - padright) >> x_shift);
-                iptr += src->linesize[i];
-                optr += dst->linesize[i];
-            }
-        }
-
-        if (padbottom || padright) {
-            optr = dst->data[i] + dst->linesize[i] *
-                ((height - padbottom) >> y_shift) - (padright >> x_shift);
-            memset(optr, color[i],dst->linesize[i] *
-                (padbottom >> y_shift) + (padright >> x_shift));
-        }
-    }
-    return 0;
-}
-
-#if FF_API_DEINTERLACE
-
-#if !HAVE_MMX_EXTERNAL
-/* filter parameters: [-1 4 2 4 -1] // 8 */
-static void deinterlace_line_c(uint8_t *dst,
-                             const uint8_t *lum_m4, const uint8_t *lum_m3,
-                             const uint8_t *lum_m2, const uint8_t *lum_m1,
-                             const uint8_t *lum,
-                             int size)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    int sum;
-
-    for(;size > 0;size--) {
-        sum = -lum_m4[0];
-        sum += lum_m3[0] << 2;
-        sum += lum_m2[0] << 1;
-        sum += lum_m1[0] << 2;
-        sum += -lum[0];
-        dst[0] = cm[(sum + 4) >> 3];
-        lum_m4++;
-        lum_m3++;
-        lum_m2++;
-        lum_m1++;
-        lum++;
-        dst++;
-    }
-}
-
-static void deinterlace_line_inplace_c(uint8_t *lum_m4, uint8_t *lum_m3,
-                                       uint8_t *lum_m2, uint8_t *lum_m1,
-                                       uint8_t *lum, int size)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    int sum;
-
-    for(;size > 0;size--) {
-        sum = -lum_m4[0];
-        sum += lum_m3[0] << 2;
-        sum += lum_m2[0] << 1;
-        lum_m4[0]=lum_m2[0];
-        sum += lum_m1[0] << 2;
-        sum += -lum[0];
-        lum_m2[0] = cm[(sum + 4) >> 3];
-        lum_m4++;
-        lum_m3++;
-        lum_m2++;
-        lum_m1++;
-        lum++;
-    }
-}
-#endif /* !HAVE_MMX_EXTERNAL */
-
-/* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The
-   top field is copied as is, but the bottom field is deinterlaced
-   against the top field. */
-static void deinterlace_bottom_field(uint8_t *dst, int dst_wrap,
-                                    const uint8_t *src1, int src_wrap,
-                                    int width, int height)
-{
-    const uint8_t *src_m2, *src_m1, *src_0, *src_p1, *src_p2;
-    int y;
-
-    src_m2 = src1;
-    src_m1 = src1;
-    src_0=&src_m1[src_wrap];
-    src_p1=&src_0[src_wrap];
-    src_p2=&src_p1[src_wrap];
-    for(y=0;y<(height-2);y+=2) {
-        memcpy(dst,src_m1,width);
-        dst += dst_wrap;
-        deinterlace_line(dst,src_m2,src_m1,src_0,src_p1,src_p2,width);
-        src_m2 = src_0;
-        src_m1 = src_p1;
-        src_0 = src_p2;
-        src_p1 += 2*src_wrap;
-        src_p2 += 2*src_wrap;
-        dst += dst_wrap;
-    }
-    memcpy(dst,src_m1,width);
-    dst += dst_wrap;
-    /* do last line */
-    deinterlace_line(dst,src_m2,src_m1,src_0,src_0,src_0,width);
-}
-
-static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
-                                             int width, int height)
-{
-    uint8_t *src_m1, *src_0, *src_p1, *src_p2;
-    int y;
-    uint8_t *buf;
-    buf = av_malloc(width);
-
-    src_m1 = src1;
-    memcpy(buf,src_m1,width);
-    src_0=&src_m1[src_wrap];
-    src_p1=&src_0[src_wrap];
-    src_p2=&src_p1[src_wrap];
-    for(y=0;y<(height-2);y+=2) {
-        deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width);
-        src_m1 = src_p1;
-        src_0 = src_p2;
-        src_p1 += 2*src_wrap;
-        src_p2 += 2*src_wrap;
-    }
-    /* do last line */
-    deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width);
-    av_free(buf);
-}
-
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
-                          enum AVPixelFormat pix_fmt, int width, int height)
-{
-    int i;
-
-    if (pix_fmt != AV_PIX_FMT_YUV420P &&
-        pix_fmt != AV_PIX_FMT_YUVJ420P &&
-        pix_fmt != AV_PIX_FMT_YUV422P &&
-        pix_fmt != AV_PIX_FMT_YUVJ422P &&
-        pix_fmt != AV_PIX_FMT_YUV444P &&
-        pix_fmt != AV_PIX_FMT_YUV411P &&
-        pix_fmt != AV_PIX_FMT_GRAY8)
-        return -1;
-    if ((width & 3) != 0 || (height & 3) != 0)
-        return -1;
-
-    for(i=0;i<3;i++) {
-        if (i == 1) {
-            switch(pix_fmt) {
-            case AV_PIX_FMT_YUVJ420P:
-            case AV_PIX_FMT_YUV420P:
-                width >>= 1;
-                height >>= 1;
-                break;
-            case AV_PIX_FMT_YUV422P:
-            case AV_PIX_FMT_YUVJ422P:
-                width >>= 1;
-                break;
-            case AV_PIX_FMT_YUV411P:
-                width >>= 2;
-                break;
-            default:
-                break;
-            }
-            if (pix_fmt == AV_PIX_FMT_GRAY8) {
-                break;
-            }
-        }
-        if (src == dst) {
-            deinterlace_bottom_field_inplace(dst->data[i], dst->linesize[i],
-                                 width, height);
-        } else {
-            deinterlace_bottom_field(dst->data[i],dst->linesize[i],
-                                        src->data[i], src->linesize[i],
-                                        width, height);
-        }
-    }
-    emms_c();
-    return 0;
-}
-
-#endif /* FF_API_DEINTERLACE */
diff --git a/deps/libav/libavcodec/imgconvert.h b/deps/libav/libavcodec/imgconvert.h
deleted file mode 100644
index 91e9f91..0000000
--- a/deps/libav/libavcodec/imgconvert.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_IMGCONVERT_H
-#define AVCODEC_IMGCONVERT_H
-
-#include <stdint.h>
-
-/* 1/2^n downscaling functions */
-void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
-void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
-void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
-
-#endif /* AVCODEC_IMGCONVERT_H */
diff --git a/deps/libav/libavcodec/imx_dump_header_bsf.c b/deps/libav/libavcodec/imx_dump_header_bsf.c
deleted file mode 100644
index 5f5493f..0000000
--- a/deps/libav/libavcodec/imx_dump_header_bsf.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * imx dump header bitstream filter
- * Copyright (c) 2007 Baptiste Coudurier
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * imx dump header bitstream filter
- * modifies bitstream to fit in mov and be decoded by final cut pro decoder
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-
-
-static int imx_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
-                           uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size, int keyframe)
-{
-    /* MXF essence element key */
-    static const uint8_t imx_header[16] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01,0x05,0x01,0x01,0x00 };
-    uint8_t *poutbufp;
-
-    if (avctx->codec_id != AV_CODEC_ID_MPEG2VIDEO) {
-        av_log(avctx, AV_LOG_ERROR, "imx bitstream filter only applies to mpeg2video codec\n");
-        return 0;
-    }
-
-    *poutbuf = av_malloc(buf_size + 20 + FF_INPUT_BUFFER_PADDING_SIZE);
-    poutbufp = *poutbuf;
-    bytestream_put_buffer(&poutbufp, imx_header, 16);
-    bytestream_put_byte(&poutbufp, 0x83); /* KLV BER long form */
-    bytestream_put_be24(&poutbufp, buf_size);
-    bytestream_put_buffer(&poutbufp, buf, buf_size);
-    *poutbuf_size = poutbufp - *poutbuf;
-    return 1;
-}
-
-AVBitStreamFilter ff_imx_dump_header_bsf = {
-    "imxdump",
-    0,
-    imx_dump_header,
-};
diff --git a/deps/libav/libavcodec/indeo2.c b/deps/libav/libavcodec/indeo2.c
deleted file mode 100644
index 7df6e69..0000000
--- a/deps/libav/libavcodec/indeo2.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Intel Indeo 2 codec
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Intel Indeo 2 decoder.
- */
-
-#define BITSTREAM_READER_LE
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "indeo2data.h"
-#include "internal.h"
-#include "mathops.h"
-
-typedef struct Ir2Context{
-    AVCodecContext *avctx;
-    AVFrame *picture;
-    GetBitContext gb;
-    int decode_delta;
-} Ir2Context;
-
-#define CODE_VLC_BITS 14
-static VLC ir2_vlc;
-
-/* Indeo 2 codes are in range 0x01..0x7F and 0x81..0x90 */
-static inline int ir2_get_code(GetBitContext *gb)
-{
-    return get_vlc2(gb, ir2_vlc.table, CODE_VLC_BITS, 1) + 1;
-}
-
-static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst,
-                            int stride, const uint8_t *table)
-{
-    int i;
-    int j;
-    int out = 0;
-    int c;
-    int t;
-
-    if (width & 1)
-        return AVERROR_INVALIDDATA;
-
-    /* first line contain absolute values, other lines contain deltas */
-    while (out < width) {
-        c = ir2_get_code(&ctx->gb);
-        if (c >= 0x80) { /* we have a run */
-            c -= 0x7F;
-            if (out + c*2 > width)
-                return AVERROR_INVALIDDATA;
-            for (i = 0; i < c * 2; i++)
-                dst[out++] = 0x80;
-        } else { /* copy two values from table */
-            dst[out++] = table[c * 2];
-            dst[out++] = table[(c * 2) + 1];
-        }
-    }
-    dst += stride;
-
-    for (j = 1; j < height; j++) {
-        out = 0;
-        while (out < width) {
-            c = ir2_get_code(&ctx->gb);
-            if (c >= 0x80) { /* we have a skip */
-                c -= 0x7F;
-                if (out + c*2 > width)
-                    return AVERROR_INVALIDDATA;
-                for (i = 0; i < c * 2; i++) {
-                    dst[out] = dst[out - stride];
-                    out++;
-                }
-            } else { /* add two deltas from table */
-                t        = dst[out - stride] + (table[c * 2] - 128);
-                t        = av_clip_uint8(t);
-                dst[out] = t;
-                out++;
-                t        = dst[out - stride] + (table[(c * 2) + 1] - 128);
-                t        = av_clip_uint8(t);
-                dst[out] = t;
-                out++;
-            }
-        }
-        dst += stride;
-    }
-    return 0;
-}
-
-static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_t *dst,
-                                  int stride, const uint8_t *table)
-{
-    int j;
-    int out = 0;
-    int c;
-    int t;
-
-    if (width & 1)
-        return AVERROR_INVALIDDATA;
-
-    for (j = 0; j < height; j++) {
-        out = 0;
-        while (out < width) {
-            c = ir2_get_code(&ctx->gb);
-            if (c >= 0x80) { /* we have a skip */
-                c   -= 0x7F;
-                out += c * 2;
-            } else { /* add two deltas from table */
-                t        = dst[out] + (((table[c * 2] - 128)*3) >> 2);
-                t        = av_clip_uint8(t);
-                dst[out] = t;
-                out++;
-                t        = dst[out] + (((table[(c * 2) + 1] - 128)*3) >> 2);
-                t        = av_clip_uint8(t);
-                dst[out] = t;
-                out++;
-            }
-        }
-        dst += stride;
-    }
-    return 0;
-}
-
-static int ir2_decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    Ir2Context * const s = avctx->priv_data;
-    const uint8_t *buf   = avpkt->data;
-    int buf_size         = avpkt->size;
-    AVFrame *picture     = data;
-    AVFrame * const p    = s->picture;
-    int start, ret;
-
-    if ((ret = ff_reget_buffer(avctx, p)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    start = 48; /* hardcoded for now */
-
-    if (start >= buf_size) {
-        av_log(s->avctx, AV_LOG_ERROR, "input buffer size too small (%d)\n", buf_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->decode_delta = buf[18];
-
-    /* decide whether frame uses deltas or not */
-#ifndef BITSTREAM_READER_LE
-    for (i = 0; i < buf_size; i++)
-        buf[i] = ff_reverse[buf[i]];
-#endif
-
-    init_get_bits(&s->gb, buf + start, (buf_size - start) * 8);
-
-    if (s->decode_delta) { /* intraframe */
-        if ((ret = ir2_decode_plane(s, avctx->width, avctx->height,
-                                    p->data[0], p->linesize[0],
-                                    ir2_luma_table)) < 0)
-            return ret;
-
-        /* swapped U and V */
-        if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
-                                    p->data[2], p->linesize[2],
-                                    ir2_luma_table)) < 0)
-            return ret;
-        if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
-                                    p->data[1], p->linesize[1],
-                                    ir2_luma_table)) < 0)
-            return ret;
-    } else { /* interframe */
-        if ((ret = ir2_decode_plane_inter(s, avctx->width, avctx->height,
-                                          p->data[0], p->linesize[0],
-                                          ir2_luma_table)) < 0)
-            return ret;
-        /* swapped U and V */
-        if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
-                                          p->data[2], p->linesize[2],
-                                          ir2_luma_table)) < 0)
-            return ret;
-        if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
-                                          p->data[1], p->linesize[1],
-                                          ir2_luma_table)) < 0)
-            return ret;
-    }
-
-    if ((ret = av_frame_ref(picture, p)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int ir2_decode_init(AVCodecContext *avctx)
-{
-    Ir2Context * const ic = avctx->priv_data;
-    static VLC_TYPE vlc_tables[1 << CODE_VLC_BITS][2];
-
-    ic->avctx = avctx;
-
-    avctx->pix_fmt= AV_PIX_FMT_YUV410P;
-
-    ic->picture = av_frame_alloc();
-    if (!ic->picture)
-        return AVERROR(ENOMEM);
-
-    ir2_vlc.table = vlc_tables;
-    ir2_vlc.table_allocated = 1 << CODE_VLC_BITS;
-#ifdef BITSTREAM_READER_LE
-        init_vlc(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
-                 &ir2_codes[0][1], 4, 2,
-                 &ir2_codes[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-#else
-        init_vlc(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
-                 &ir2_codes[0][1], 4, 2,
-                 &ir2_codes[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
-#endif
-
-    return 0;
-}
-
-static av_cold int ir2_decode_end(AVCodecContext *avctx)
-{
-    Ir2Context * const ic = avctx->priv_data;
-
-    av_frame_free(&ic->picture);
-
-    return 0;
-}
-
-AVCodec ff_indeo2_decoder = {
-    .name           = "indeo2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Intel Indeo 2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_INDEO2,
-    .priv_data_size = sizeof(Ir2Context),
-    .init           = ir2_decode_init,
-    .close          = ir2_decode_end,
-    .decode         = ir2_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/indeo2data.h b/deps/libav/libavcodec/indeo2data.h
deleted file mode 100644
index ed8d83c..0000000
--- a/deps/libav/libavcodec/indeo2data.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Intel Indeo 2 codec
- * copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_INDEO2DATA_H
-#define AVCODEC_INDEO2DATA_H
-
-#include <stdint.h>
-
-#define IR2_CODES 143
-static const uint16_t ir2_codes[IR2_CODES][2] = {
-#ifdef BITSTREAM_READER_LE
-{0x0000,  3}, {0x0004,  3}, {0x0006,  3}, {0x0001,  5},
-{0x0009,  5}, {0x0019,  5}, {0x000D,  5}, {0x001D,  5},
-{0x0023,  6}, {0x0013,  6}, {0x0033,  6}, {0x000B,  6},
-{0x002B,  6}, {0x001B,  6}, {0x0007,  8}, {0x0087,  8},
-{0x0027,  8}, {0x00A7,  8}, {0x0067,  8}, {0x00E7,  8},
-{0x0097,  8}, {0x0057,  8}, {0x0037,  8}, {0x00B7,  8},
-{0x00F7,  8}, {0x000F,  9}, {0x008F,  9}, {0x018F,  9},
-{0x014F,  9}, {0x00CF,  9}, {0x002F,  9}, {0x012F,  9},
-{0x01AF,  9}, {0x006F,  9}, {0x00EF,  9}, {0x01EF,  9},
-{0x001F, 10}, {0x021F, 10}, {0x011F, 10}, {0x031F, 10},
-{0x009F, 10}, {0x029F, 10}, {0x019F, 10}, {0x039F, 10},
-{0x005F, 10}, {0x025F, 10}, {0x015F, 10}, {0x035F, 10},
-{0x00DF, 10}, {0x02DF, 10}, {0x01DF, 10}, {0x03DF, 10},
-{0x003F, 13}, {0x103F, 13}, {0x083F, 13}, {0x183F, 13},
-{0x043F, 13}, {0x143F, 13}, {0x0C3F, 13}, {0x1C3F, 13},
-{0x023F, 13}, {0x123F, 13}, {0x0A3F, 13}, {0x1A3F, 13},
-{0x063F, 13}, {0x163F, 13}, {0x0E3F, 13}, {0x1E3F, 13},
-{0x013F, 13}, {0x113F, 13}, {0x093F, 13}, {0x193F, 13},
-{0x053F, 13}, {0x153F, 13}, {0x0D3F, 13}, {0x1D3F, 13},
-{0x033F, 13}, {0x133F, 13}, {0x0B3F, 13}, {0x1B3F, 13},
-{0x073F, 13}, {0x173F, 13}, {0x0F3F, 13}, {0x1F3F, 13},
-{0x00BF, 13}, {0x10BF, 13}, {0x08BF, 13}, {0x18BF, 13},
-{0x04BF, 13}, {0x14BF, 13}, {0x0CBF, 13}, {0x1CBF, 13},
-{0x02BF, 13}, {0x12BF, 13}, {0x0ABF, 13}, {0x1ABF, 13},
-{0x06BF, 13}, {0x16BF, 13}, {0x0EBF, 13}, {0x1EBF, 13},
-{0x01BF, 13}, {0x11BF, 13}, {0x09BF, 13}, {0x19BF, 13},
-{0x05BF, 13}, {0x15BF, 13}, {0x0DBF, 13}, {0x1DBF, 13},
-{0x03BF, 13}, {0x13BF, 13}, {0x0BBF, 13}, {0x1BBF, 13},
-{0x07BF, 13}, {0x17BF, 13}, {0x0FBF, 13}, {0x1FBF, 13},
-{0x007F, 14}, {0x207F, 14}, {0x107F, 14}, {0x307F, 14},
-{0x087F, 14}, {0x287F, 14}, {0x187F, 14}, {0x387F, 14},
-{0x047F, 14}, {0x247F, 14}, {0x147F, 14}, {0x0002,  3},
-{0x0011,  5}, {0x0005,  5}, {0x0015,  5}, {0x0003,  6},
-{0x003B,  6}, {0x0047,  8}, {0x00C7,  8}, {0x0017,  8},
-{0x00D7,  8}, {0x0077,  8}, {0x010F,  9}, {0x004F,  9},
-{0x01CF,  9}, {0x00AF,  9}, {0x016F,  9},
-#else
-    {0x0000,  3}, {0x0001,  3}, {0x0003,  3}, {0x0010,  5},
-    {0x0012,  5}, {0x0013,  5}, {0x0016,  5}, {0x0017,  5},
-    {0x0031,  6}, {0x0032,  6}, {0x0033,  6}, {0x0034,  6},
-    {0x0035,  6}, {0x0036,  6}, {0x00E0,  8}, {0x00E1,  8},
-    {0x00E4,  8}, {0x00E5,  8}, {0x00E6,  8}, {0x00E7,  8},
-    {0x00E9,  8}, {0x00EA,  8}, {0x00EC,  8}, {0x00ED,  8},
-    {0x00EF,  8}, {0x01E0,  9}, {0x01E2,  9}, {0x01E3,  9},
-    {0x01E5,  9}, {0x01E6,  9}, {0x01E8,  9}, {0x01E9,  9},
-    {0x01EB,  9}, {0x01EC,  9}, {0x01EE,  9}, {0x01EF,  9},
-    {0x03E0, 10}, {0x03E1, 10}, {0x03E2, 10}, {0x03E3, 10},
-    {0x03E4, 10}, {0x03E5, 10}, {0x03E6, 10}, {0x03E7, 10},
-    {0x03E8, 10}, {0x03E9, 10}, {0x03EA, 10}, {0x03EB, 10},
-    {0x03EC, 10}, {0x03ED, 10}, {0x03EE, 10}, {0x03EF, 10},
-    {0x1F80, 13}, {0x1F81, 13}, {0x1F82, 13}, {0x1F83, 13},
-    {0x1F84, 13}, {0x1F85, 13}, {0x1F86, 13}, {0x1F87, 13},
-    {0x1F88, 13}, {0x1F89, 13}, {0x1F8A, 13}, {0x1F8B, 13},
-    {0x1F8C, 13}, {0x1F8D, 13}, {0x1F8E, 13}, {0x1F8F, 13},
-    {0x1F90, 13}, {0x1F91, 13}, {0x1F92, 13}, {0x1F93, 13},
-    {0x1F94, 13}, {0x1F95, 13}, {0x1F96, 13}, {0x1F97, 13},
-    {0x1F98, 13}, {0x1F99, 13}, {0x1F9A, 13}, {0x1F9B, 13},
-    {0x1F9C, 13}, {0x1F9D, 13}, {0x1F9E, 13}, {0x1F9F, 13},
-    {0x1FA0, 13}, {0x1FA1, 13}, {0x1FA2, 13}, {0x1FA3, 13},
-    {0x1FA4, 13}, {0x1FA5, 13}, {0x1FA6, 13}, {0x1FA7, 13},
-    {0x1FA8, 13}, {0x1FA9, 13}, {0x1FAA, 13}, {0x1FAB, 13},
-    {0x1FAC, 13}, {0x1FAD, 13}, {0x1FAE, 13}, {0x1FAF, 13},
-    {0x1FB0, 13}, {0x1FB1, 13}, {0x1FB2, 13}, {0x1FB3, 13},
-    {0x1FB4, 13}, {0x1FB5, 13}, {0x1FB6, 13}, {0x1FB7, 13},
-    {0x1FB8, 13}, {0x1FB9, 13}, {0x1FBA, 13}, {0x1FBB, 13},
-    {0x1FBC, 13}, {0x1FBD, 13}, {0x1FBE, 13}, {0x1FBF, 13},
-    {0x3F80, 14}, {0x3F81, 14}, {0x3F82, 14}, {0x3F83, 14},
-    {0x3F84, 14}, {0x3F85, 14}, {0x3F86, 14}, {0x3F87, 14},
-    {0x3F88, 14}, {0x3F89, 14}, {0x3F8A, 14}, {0x0002,  3},
-    {0x0011,  5}, {0x0014,  5}, {0x0015,  5}, {0x0030,  6},
-    {0x0037,  6}, {0x00E2,  8}, {0x00E3,  8}, {0x00E8,  8},
-    {0x00EB,  8}, {0x00EE,  8}, {0x01E1,  9}, {0x01E4,  9},
-    {0x01E7,  9}, {0x01EA,  9}, {0x01ED,  9}
-#endif
-};
-
-static const uint8_t ir2_luma_table[256] = {
- 0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
- 0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
- 0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
- 0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
- 0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
- 0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C,
- 0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
- 0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2,
- 0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
- 0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B,
- 0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
- 0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78,
- 0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
- 0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4,
- 0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
- 0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B,
- 0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
- 0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3,
- 0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
- 0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3,
- 0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
- 0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4,
- 0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
- 0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C,
- 0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
- 0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63,
- 0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
- 0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6,
- 0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
- 0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
- 0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
- 0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80
-};
-
-#endif /* AVCODEC_INDEO2DATA_H */
diff --git a/deps/libav/libavcodec/indeo3.c b/deps/libav/libavcodec/indeo3.c
deleted file mode 100644
index a9c02b2..0000000
--- a/deps/libav/libavcodec/indeo3.c
+++ /dev/null
@@ -1,1137 +0,0 @@
-/*
- * Indeo Video v3 compatible decoder
- * Copyright (c) 2009 - 2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This is a decoder for Intel Indeo Video v3.
- * It is based on vector quantization, run-length coding and motion compensation.
- * Known container formats: .avi and .mov
- * Known FOURCCs: 'IV31', 'IV32'
- *
- * @see http://wiki.multimedia.cx/index.php?title=Indeo_3
- */
-
-#include "libavutil/imgutils.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "get_bits.h"
-#include "hpeldsp.h"
-#include "internal.h"
-
-#include "indeo3data.h"
-
-/* RLE opcodes. */
-enum {
-    RLE_ESC_F9    = 249, ///< same as RLE_ESC_FA + do the same with next block
-    RLE_ESC_FA    = 250, ///< INTRA: skip block, INTER: copy data from reference
-    RLE_ESC_FB    = 251, ///< apply null delta to N blocks / skip N blocks
-    RLE_ESC_FC    = 252, ///< same as RLE_ESC_FD + do the same with next block
-    RLE_ESC_FD    = 253, ///< apply null delta to all remaining lines of this block
-    RLE_ESC_FE    = 254, ///< apply null delta to all lines up to the 3rd line
-    RLE_ESC_FF    = 255  ///< apply null delta to all lines up to the 2nd line
-};
-
-
-/* Some constants for parsing frame bitstream flags. */
-#define BS_8BIT_PEL     (1 << 1) ///< 8bit pixel bitdepth indicator
-#define BS_KEYFRAME     (1 << 2) ///< intra frame indicator
-#define BS_MV_Y_HALF    (1 << 4) ///< vertical mv halfpel resolution indicator
-#define BS_MV_X_HALF    (1 << 5) ///< horizontal mv halfpel resolution indicator
-#define BS_NONREF       (1 << 8) ///< nonref (discardable) frame indicator
-#define BS_BUFFER        9       ///< indicates which of two frame buffers should be used
-
-
-typedef struct Plane {
-    uint8_t         *buffers[2];
-    uint8_t         *pixels[2]; ///< pointer to the actual pixel data of the buffers above
-    uint32_t        width;
-    uint32_t        height;
-    uint32_t        pitch;
-} Plane;
-
-#define CELL_STACK_MAX  20
-
-typedef struct Cell {
-    int16_t         xpos;       ///< cell coordinates in 4x4 blocks
-    int16_t         ypos;
-    int16_t         width;      ///< cell width  in 4x4 blocks
-    int16_t         height;     ///< cell height in 4x4 blocks
-    uint8_t         tree;       ///< tree id: 0- MC tree, 1 - VQ tree
-    const int8_t    *mv_ptr;    ///< ptr to the motion vector if any
-} Cell;
-
-typedef struct Indeo3DecodeContext {
-    AVCodecContext *avctx;
-    HpelDSPContext  hdsp;
-
-    GetBitContext   gb;
-    int             need_resync;
-    int             skip_bits;
-    const uint8_t   *next_cell_data;
-    const uint8_t   *last_byte;
-    const int8_t    *mc_vectors;
-    unsigned        num_vectors;    ///< number of motion vectors in mc_vectors
-
-    int16_t         width, height;
-    uint32_t        frame_num;      ///< current frame number (zero-based)
-    uint32_t        data_size;      ///< size of the frame data in bytes
-    uint16_t        frame_flags;    ///< frame properties
-    uint8_t         cb_offset;      ///< needed for selecting VQ tables
-    uint8_t         buf_sel;        ///< active frame buffer: 0 - primary, 1 -secondary
-    const uint8_t   *y_data_ptr;
-    const uint8_t   *v_data_ptr;
-    const uint8_t   *u_data_ptr;
-    int32_t         y_data_size;
-    int32_t         v_data_size;
-    int32_t         u_data_size;
-    const uint8_t   *alt_quant;     ///< secondary VQ table set for the modes 1 and 4
-    Plane           planes[3];
-} Indeo3DecodeContext;
-
-
-static uint8_t requant_tab[8][128];
-
-/*
- *  Build the static requantization table.
- *  This table is used to remap pixel values according to a specific
- *  quant index and thus avoid overflows while adding deltas.
- */
-static av_cold void build_requant_tab(void)
-{
-    static int8_t offsets[8] = { 1, 1, 2, -3, -3, 3, 4, 4 };
-    static int8_t deltas [8] = { 0, 1, 0,  4,  4, 1, 0, 1 };
-
-    int i, j, step;
-
-    for (i = 0; i < 8; i++) {
-        step = i + 2;
-        for (j = 0; j < 128; j++)
-                requant_tab[i][j] = (j + offsets[i]) / step * step + deltas[i];
-    }
-
-    /* some last elements calculated above will have values >= 128 */
-    /* pixel values shall never exceed 127 so set them to non-overflowing values */
-    /* according with the quantization step of the respective section */
-    requant_tab[0][127] = 126;
-    requant_tab[1][119] = 118;
-    requant_tab[1][120] = 118;
-    requant_tab[2][126] = 124;
-    requant_tab[2][127] = 124;
-    requant_tab[6][124] = 120;
-    requant_tab[6][125] = 120;
-    requant_tab[6][126] = 120;
-    requant_tab[6][127] = 120;
-
-    /* Patch for compatibility with the Intel's binary decoders */
-    requant_tab[1][7] = 10;
-    requant_tab[4][8] = 10;
-}
-
-
-static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
-                                          AVCodecContext *avctx)
-{
-    int p, luma_width, luma_height, chroma_width, chroma_height;
-    int luma_pitch, chroma_pitch, luma_size, chroma_size;
-
-    luma_width  = ctx->width;
-    luma_height = ctx->height;
-
-    if (luma_width  < 16 || luma_width  > 640 ||
-        luma_height < 16 || luma_height > 480 ||
-        luma_width  &  3 || luma_height &   3) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
-               luma_width, luma_height);
-        return AVERROR_INVALIDDATA;
-    }
-
-    chroma_width  = FFALIGN(luma_width  >> 2, 4);
-    chroma_height = FFALIGN(luma_height >> 2, 4);
-
-    luma_pitch   = FFALIGN(luma_width,   16);
-    chroma_pitch = FFALIGN(chroma_width, 16);
-
-    /* Calculate size of the luminance plane.  */
-    /* Add one line more for INTRA prediction. */
-    luma_size = luma_pitch * (luma_height + 1);
-
-    /* Calculate size of a chrominance planes. */
-    /* Add one line more for INTRA prediction. */
-    chroma_size = chroma_pitch * (chroma_height + 1);
-
-    /* allocate frame buffers */
-    for (p = 0; p < 3; p++) {
-        ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
-        ctx->planes[p].width  = !p ? luma_width  : chroma_width;
-        ctx->planes[p].height = !p ? luma_height : chroma_height;
-
-        ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
-        ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
-
-        /* fill the INTRA prediction lines with the middle pixel value = 64 */
-        memset(ctx->planes[p].buffers[0], 0x40, ctx->planes[p].pitch);
-        memset(ctx->planes[p].buffers[1], 0x40, ctx->planes[p].pitch);
-
-        /* set buffer pointers = buf_ptr + pitch and thus skip the INTRA prediction line */
-        ctx->planes[p].pixels[0] = ctx->planes[p].buffers[0] + ctx->planes[p].pitch;
-        ctx->planes[p].pixels[1] = ctx->planes[p].buffers[1] + ctx->planes[p].pitch;
-        memset(ctx->planes[p].pixels[0], 0, ctx->planes[p].pitch * ctx->planes[p].height);
-        memset(ctx->planes[p].pixels[1], 0, ctx->planes[p].pitch * ctx->planes[p].height);
-    }
-
-    return 0;
-}
-
-
-static av_cold void free_frame_buffers(Indeo3DecodeContext *ctx)
-{
-    int p;
-
-    for (p = 0; p < 3; p++) {
-        av_freep(&ctx->planes[p].buffers[0]);
-        av_freep(&ctx->planes[p].buffers[1]);
-        ctx->planes[p].pixels[0] = ctx->planes[p].pixels[1] = 0;
-    }
-}
-
-
-/**
- *  Copy pixels of the cell(x + mv_x, y + mv_y) from the previous frame into
- *  the cell(x, y) in the current frame.
- *
- *  @param ctx      pointer to the decoder context
- *  @param plane    pointer to the plane descriptor
- *  @param cell     pointer to the cell  descriptor
- */
-static int copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell)
-{
-    int     h, w, mv_x, mv_y, offset, offset_dst;
-    uint8_t *src, *dst;
-
-    /* setup output and reference pointers */
-    offset_dst  = (cell->ypos << 2) * plane->pitch + (cell->xpos << 2);
-    dst         = plane->pixels[ctx->buf_sel] + offset_dst;
-    mv_y        = cell->mv_ptr[0];
-    mv_x        = cell->mv_ptr[1];
-
-    /* -1 because there is an extra line on top for prediction */
-    if ((cell->ypos << 2) + mv_y < -1 || (cell->xpos << 2) + mv_x < 0 ||
-        ((cell->ypos + cell->height) << 2) + mv_y > plane->height     ||
-        ((cell->xpos + cell->width)  << 2) + mv_x > plane->width) {
-        av_log(ctx->avctx, AV_LOG_ERROR,
-               "Motion vectors point out of the frame.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    offset      = offset_dst + mv_y * plane->pitch + mv_x;
-    src         = plane->pixels[ctx->buf_sel ^ 1] + offset;
-
-    h = cell->height << 2;
-
-    for (w = cell->width; w > 0;) {
-        /* copy using 16xH blocks */
-        if (!((cell->xpos << 2) & 15) && w >= 4) {
-            for (; w >= 4; src += 16, dst += 16, w -= 4)
-                ctx->hdsp.put_pixels_tab[0][0](dst, src, plane->pitch, h);
-        }
-
-        /* copy using 8xH blocks */
-        if (!((cell->xpos << 2) & 7) && w >= 2) {
-            ctx->hdsp.put_pixels_tab[1][0](dst, src, plane->pitch, h);
-            w -= 2;
-            src += 8;
-            dst += 8;
-        } else if (w >= 1) {
-            ctx->hdsp.put_pixels_tab[2][0](dst, src, plane->pitch, h);
-            w--;
-            src += 4;
-            dst += 4;
-        }
-    }
-
-    return 0;
-}
-
-
-/* Average 4/8 pixels at once without rounding using SWAR */
-#define AVG_32(dst, src, ref) \
-    AV_WN32A(dst, ((AV_RN32(src) + AV_RN32(ref)) >> 1) & 0x7F7F7F7FUL)
-
-#define AVG_64(dst, src, ref) \
-    AV_WN64A(dst, ((AV_RN64(src) + AV_RN64(ref)) >> 1) & 0x7F7F7F7F7F7F7F7FULL)
-
-
-/*
- *  Replicate each even pixel as follows:
- *  ABCDEFGH -> AACCEEGG
- */
-static inline uint64_t replicate64(uint64_t a) {
-#if HAVE_BIGENDIAN
-    a &= 0xFF00FF00FF00FF00ULL;
-    a |= a >> 8;
-#else
-    a &= 0x00FF00FF00FF00FFULL;
-    a |= a << 8;
-#endif
-    return a;
-}
-
-static inline uint32_t replicate32(uint32_t a) {
-#if HAVE_BIGENDIAN
-    a &= 0xFF00FF00UL;
-    a |= a >> 8;
-#else
-    a &= 0x00FF00FFUL;
-    a |= a << 8;
-#endif
-    return a;
-}
-
-
-/* Fill n lines with 64bit pixel value pix */
-static inline void fill_64(uint8_t *dst, const uint64_t pix, int32_t n,
-                           int32_t row_offset)
-{
-    for (; n > 0; dst += row_offset, n--)
-        AV_WN64A(dst, pix);
-}
-
-
-/* Error codes for cell decoding. */
-enum {
-    IV3_NOERR       = 0,
-    IV3_BAD_RLE     = 1,
-    IV3_BAD_DATA    = 2,
-    IV3_BAD_COUNTER = 3,
-    IV3_UNSUPPORTED = 4,
-    IV3_OUT_OF_DATA = 5
-};
-
-
-#define BUFFER_PRECHECK \
-if (*data_ptr >= last_ptr) \
-    return IV3_OUT_OF_DATA; \
-
-#define RLE_BLOCK_COPY \
-    if (cell->mv_ptr || !skip_flag) \
-        ctx->hdsp.put_pixels_tab[2][0](dst, ref, row_offset, 4 << v_zoom)
-
-#define RLE_BLOCK_COPY_8 \
-    pix64 = AV_RN64(ref);\
-    if (is_first_row) {/* special prediction case: top line of a cell */\
-        pix64 = replicate64(pix64);\
-        fill_64(dst + row_offset, pix64, 7, row_offset);\
-        AVG_64(dst, ref, dst + row_offset);\
-    } else \
-        fill_64(dst, pix64, 8, row_offset)
-
-#define RLE_LINES_COPY \
-    ctx->hdsp.put_pixels_tab[2][0](dst, ref, row_offset, num_lines << v_zoom)
-
-#define RLE_LINES_COPY_M10 \
-    pix64 = AV_RN64(ref);\
-    if (is_top_of_cell) {\
-        pix64 = replicate64(pix64);\
-        fill_64(dst + row_offset, pix64, (num_lines << 1) - 1, row_offset);\
-        AVG_64(dst, ref, dst + row_offset);\
-    } else \
-        fill_64(dst, pix64, num_lines << 1, row_offset)
-
-#define APPLY_DELTA_4 \
-    AV_WN16A(dst + line_offset    ,\
-             (AV_RN16(ref    ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
-    AV_WN16A(dst + line_offset + 2,\
-             (AV_RN16(ref + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\
-    if (mode >= 3) {\
-        if (is_top_of_cell && !cell->ypos) {\
-            AV_COPY32U(dst, dst + row_offset);\
-        } else {\
-            AVG_32(dst, ref, dst + row_offset);\
-        }\
-    }
-
-#define APPLY_DELTA_8 \
-    /* apply two 32-bit VQ deltas to next even line */\
-    if (is_top_of_cell) { \
-        AV_WN32A(dst + row_offset    , \
-                 (replicate32(AV_RN32(ref    )) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
-        AV_WN32A(dst + row_offset + 4, \
-                 (replicate32(AV_RN32(ref + 4)) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
-    } else { \
-        AV_WN32A(dst + row_offset    , \
-                 (AV_RN32(ref    ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
-        AV_WN32A(dst + row_offset + 4, \
-                 (AV_RN32(ref + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
-    } \
-    /* odd lines are not coded but rather interpolated/replicated */\
-    /* first line of the cell on the top of image? - replicate */\
-    /* otherwise - interpolate */\
-    if (is_top_of_cell && !cell->ypos) {\
-        AV_COPY64U(dst, dst + row_offset);\
-    } else \
-        AVG_64(dst, ref, dst + row_offset);
-
-
-#define APPLY_DELTA_1011_INTER \
-    if (mode == 10) { \
-        AV_WN32A(dst                 , \
-                 (AV_RN32(dst                 ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
-        AV_WN32A(dst + 4             , \
-                 (AV_RN32(dst + 4             ) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
-        AV_WN32A(dst + row_offset    , \
-                 (AV_RN32(dst + row_offset    ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
-        AV_WN32A(dst + row_offset + 4, \
-                 (AV_RN32(dst + row_offset + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
-    } else { \
-        AV_WN16A(dst                 , \
-                 (AV_RN16(dst                 ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
-        AV_WN16A(dst + 2             , \
-                 (AV_RN16(dst + 2             ) + delta_tab->deltas[dyad2]) & 0x7F7F);\
-        AV_WN16A(dst + row_offset    , \
-                 (AV_RN16(dst + row_offset    ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
-        AV_WN16A(dst + row_offset + 2, \
-                 (AV_RN16(dst + row_offset + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\
-    }
-
-
-static int decode_cell_data(Indeo3DecodeContext *ctx, Cell *cell,
-                            uint8_t *block, uint8_t *ref_block,
-                            int pitch, int h_zoom, int v_zoom, int mode,
-                            const vqEntry *delta[2], int swap_quads[2],
-                            const uint8_t **data_ptr, const uint8_t *last_ptr)
-{
-    int           x, y, line, num_lines;
-    int           rle_blocks = 0;
-    uint8_t       code, *dst, *ref;
-    const vqEntry *delta_tab;
-    unsigned int  dyad1, dyad2;
-    uint64_t      pix64;
-    int           skip_flag = 0, is_top_of_cell, is_first_row = 1;
-    int           row_offset, blk_row_offset, line_offset;
-
-    row_offset     =  pitch;
-    blk_row_offset = (row_offset << (2 + v_zoom)) - (cell->width << 2);
-    line_offset    = v_zoom ? row_offset : 0;
-
-    if (cell->height & v_zoom || cell->width & h_zoom)
-        return IV3_BAD_DATA;
-
-    for (y = 0; y < cell->height; is_first_row = 0, y += 1 + v_zoom) {
-        for (x = 0; x < cell->width; x += 1 + h_zoom) {
-            ref = ref_block;
-            dst = block;
-
-            if (rle_blocks > 0) {
-                if (mode <= 4) {
-                    RLE_BLOCK_COPY;
-                } else if (mode == 10 && !cell->mv_ptr) {
-                    RLE_BLOCK_COPY_8;
-                }
-                rle_blocks--;
-            } else {
-                for (line = 0; line < 4;) {
-                    num_lines = 1;
-                    is_top_of_cell = is_first_row && !line;
-
-                    /* select primary VQ table for odd, secondary for even lines */
-                    if (mode <= 4)
-                        delta_tab = delta[line & 1];
-                    else
-                        delta_tab = delta[1];
-                    BUFFER_PRECHECK;
-                    code = bytestream_get_byte(data_ptr);
-                    if (code < 248) {
-                        if (code < delta_tab->num_dyads) {
-                            BUFFER_PRECHECK;
-                            dyad1 = bytestream_get_byte(data_ptr);
-                            dyad2 = code;
-                            if (dyad1 >= delta_tab->num_dyads || dyad1 >= 248)
-                                return IV3_BAD_DATA;
-                        } else {
-                            /* process QUADS */
-                            code -= delta_tab->num_dyads;
-                            dyad1 = code / delta_tab->quad_exp;
-                            dyad2 = code % delta_tab->quad_exp;
-                            if (swap_quads[line & 1])
-                                FFSWAP(unsigned int, dyad1, dyad2);
-                        }
-                        if (mode <= 4) {
-                            APPLY_DELTA_4;
-                        } else if (mode == 10 && !cell->mv_ptr) {
-                            APPLY_DELTA_8;
-                        } else {
-                            APPLY_DELTA_1011_INTER;
-                        }
-                    } else {
-                        /* process RLE codes */
-                        switch (code) {
-                        case RLE_ESC_FC:
-                            skip_flag  = 0;
-                            rle_blocks = 1;
-                            code       = 253;
-                            /* FALLTHROUGH */
-                        case RLE_ESC_FF:
-                        case RLE_ESC_FE:
-                        case RLE_ESC_FD:
-                            num_lines = 257 - code - line;
-                            if (num_lines <= 0)
-                                return IV3_BAD_RLE;
-                            if (mode <= 4) {
-                                RLE_LINES_COPY;
-                            } else if (mode == 10 && !cell->mv_ptr) {
-                                RLE_LINES_COPY_M10;
-                            }
-                            break;
-                        case RLE_ESC_FB:
-                            BUFFER_PRECHECK;
-                            code = bytestream_get_byte(data_ptr);
-                            rle_blocks = (code & 0x1F) - 1; /* set block counter */
-                            if (code >= 64 || rle_blocks < 0)
-                                return IV3_BAD_COUNTER;
-                            skip_flag = code & 0x20;
-                            num_lines = 4 - line; /* enforce next block processing */
-                            if (mode >= 10 || (cell->mv_ptr || !skip_flag)) {
-                                if (mode <= 4) {
-                                    RLE_LINES_COPY;
-                                } else if (mode == 10 && !cell->mv_ptr) {
-                                    RLE_LINES_COPY_M10;
-                                }
-                            }
-                            break;
-                        case RLE_ESC_F9:
-                            skip_flag  = 1;
-                            rle_blocks = 1;
-                            /* FALLTHROUGH */
-                        case RLE_ESC_FA:
-                            if (line)
-                                return IV3_BAD_RLE;
-                            num_lines = 4; /* enforce next block processing */
-                            if (cell->mv_ptr) {
-                                if (mode <= 4) {
-                                    RLE_LINES_COPY;
-                                } else if (mode == 10 && !cell->mv_ptr) {
-                                    RLE_LINES_COPY_M10;
-                                }
-                            }
-                            break;
-                        default:
-                            return IV3_UNSUPPORTED;
-                        }
-                    }
-
-                    line += num_lines;
-                    ref  += row_offset * (num_lines << v_zoom);
-                    dst  += row_offset * (num_lines << v_zoom);
-                }
-            }
-
-            /* move to next horizontal block */
-            block     += 4 << h_zoom;
-            ref_block += 4 << h_zoom;
-        }
-
-        /* move to next line of blocks */
-        ref_block += blk_row_offset;
-        block     += blk_row_offset;
-    }
-    return IV3_NOERR;
-}
-
-
-/**
- *  Decode a vector-quantized cell.
- *  It consists of several routines, each of which handles one or more "modes"
- *  with which a cell can be encoded.
- *
- *  @param ctx      pointer to the decoder context
- *  @param avctx    ptr to the AVCodecContext
- *  @param plane    pointer to the plane descriptor
- *  @param cell     pointer to the cell  descriptor
- *  @param data_ptr pointer to the compressed data
- *  @param last_ptr pointer to the last byte to catch reads past end of buffer
- *  @return         number of consumed bytes or negative number in case of error
- */
-static int decode_cell(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
-                       Plane *plane, Cell *cell, const uint8_t *data_ptr,
-                       const uint8_t *last_ptr)
-{
-    int           x, mv_x, mv_y, mode, vq_index, prim_indx, second_indx;
-    int           zoom_fac;
-    int           offset, error = 0, swap_quads[2];
-    uint8_t       code, *block, *ref_block = 0;
-    const vqEntry *delta[2];
-    const uint8_t *data_start = data_ptr;
-
-    /* get coding mode and VQ table index from the VQ descriptor byte */
-    code     = *data_ptr++;
-    mode     = code >> 4;
-    vq_index = code & 0xF;
-
-    /* setup output and reference pointers */
-    offset = (cell->ypos << 2) * plane->pitch + (cell->xpos << 2);
-    block  =  plane->pixels[ctx->buf_sel] + offset;
-    if (!cell->mv_ptr) {
-        /* use previous line as reference for INTRA cells */
-        ref_block = block - plane->pitch;
-    } else if (mode >= 10) {
-        /* for mode 10 and 11 INTER first copy the predicted cell into the current one */
-        /* so we don't need to do data copying for each RLE code later */
-        int ret = copy_cell(ctx, plane, cell);
-        if (ret < 0)
-            return ret;
-    } else {
-        /* set the pointer to the reference pixels for modes 0-4 INTER */
-        mv_y      = cell->mv_ptr[0];
-        mv_x      = cell->mv_ptr[1];
-
-        /* -1 because there is an extra line on top for prediction */
-        if ((cell->ypos << 2) + mv_y < -1 || (cell->xpos << 2) + mv_x < 0 ||
-            ((cell->ypos + cell->height) << 2) + mv_y > plane->height     ||
-            ((cell->xpos + cell->width)  << 2) + mv_x > plane->width) {
-            av_log(ctx->avctx, AV_LOG_ERROR,
-                   "Motion vectors point out of the frame.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        offset   += mv_y * plane->pitch + mv_x;
-        ref_block = plane->pixels[ctx->buf_sel ^ 1] + offset;
-    }
-
-    /* select VQ tables as follows: */
-    /* modes 0 and 3 use only the primary table for all lines in a block */
-    /* while modes 1 and 4 switch between primary and secondary tables on alternate lines */
-    if (mode == 1 || mode == 4) {
-        code        = ctx->alt_quant[vq_index];
-        prim_indx   = (code >> 4)  + ctx->cb_offset;
-        second_indx = (code & 0xF) + ctx->cb_offset;
-    } else {
-        vq_index += ctx->cb_offset;
-        prim_indx = second_indx = vq_index;
-    }
-
-    if (prim_indx >= 24 || second_indx >= 24) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid VQ table indexes! Primary: %d, secondary: %d!\n",
-               prim_indx, second_indx);
-        return AVERROR_INVALIDDATA;
-    }
-
-    delta[0] = &vq_tab[second_indx];
-    delta[1] = &vq_tab[prim_indx];
-    swap_quads[0] = second_indx >= 16;
-    swap_quads[1] = prim_indx   >= 16;
-
-    /* requantize the prediction if VQ index of this cell differs from VQ index */
-    /* of the predicted cell in order to avoid overflows. */
-    if (vq_index >= 8 && ref_block) {
-        for (x = 0; x < cell->width << 2; x++)
-            ref_block[x] = requant_tab[vq_index & 7][ref_block[x]];
-    }
-
-    error = IV3_NOERR;
-
-    switch (mode) {
-    case 0: /*------------------ MODES 0 & 1 (4x4 block processing) --------------------*/
-    case 1:
-    case 3: /*------------------ MODES 3 & 4 (4x8 block processing) --------------------*/
-    case 4:
-        if (mode >= 3 && cell->mv_ptr) {
-            av_log(avctx, AV_LOG_ERROR, "Attempt to apply Mode 3/4 to an INTER cell!\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        zoom_fac = mode >= 3;
-        error = decode_cell_data(ctx, cell, block, ref_block, plane->pitch,
-                                 0, zoom_fac, mode, delta, swap_quads,
-                                 &data_ptr, last_ptr);
-        break;
-    case 10: /*-------------------- MODE 10 (8x8 block processing) ---------------------*/
-    case 11: /*----------------- MODE 11 (4x8 INTER block processing) ------------------*/
-        if (mode == 10 && !cell->mv_ptr) { /* MODE 10 INTRA processing */
-            error = decode_cell_data(ctx, cell, block, ref_block, plane->pitch,
-                                     1, 1, mode, delta, swap_quads,
-                                     &data_ptr, last_ptr);
-        } else { /* mode 10 and 11 INTER processing */
-            if (mode == 11 && !cell->mv_ptr) {
-               av_log(avctx, AV_LOG_ERROR, "Attempt to use Mode 11 for an INTRA cell!\n");
-               return AVERROR_INVALIDDATA;
-            }
-
-            zoom_fac = mode == 10;
-            error = decode_cell_data(ctx, cell, block, ref_block, plane->pitch,
-                                     zoom_fac, 1, mode, delta, swap_quads,
-                                     &data_ptr, last_ptr);
-        }
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unsupported coding mode: %d\n", mode);
-        return AVERROR_INVALIDDATA;
-    }//switch mode
-
-    switch (error) {
-    case IV3_BAD_RLE:
-        av_log(avctx, AV_LOG_ERROR, "Mode %d: RLE code %X is not allowed at the current line\n",
-               mode, data_ptr[-1]);
-        return AVERROR_INVALIDDATA;
-    case IV3_BAD_DATA:
-        av_log(avctx, AV_LOG_ERROR, "Mode %d: invalid VQ data\n", mode);
-        return AVERROR_INVALIDDATA;
-    case IV3_BAD_COUNTER:
-        av_log(avctx, AV_LOG_ERROR, "Mode %d: RLE-FB invalid counter: %d\n", mode, code);
-        return AVERROR_INVALIDDATA;
-    case IV3_UNSUPPORTED:
-        av_log(avctx, AV_LOG_ERROR, "Mode %d: unsupported RLE code: %X\n", mode, data_ptr[-1]);
-        return AVERROR_INVALIDDATA;
-    case IV3_OUT_OF_DATA:
-        av_log(avctx, AV_LOG_ERROR, "Mode %d: attempt to read past end of buffer\n", mode);
-        return AVERROR_INVALIDDATA;
-    }
-
-    return data_ptr - data_start; /* report number of bytes consumed from the input buffer */
-}
-
-
-/* Binary tree codes. */
-enum {
-    H_SPLIT    = 0,
-    V_SPLIT    = 1,
-    INTRA_NULL = 2,
-    INTER_DATA = 3
-};
-
-
-#define SPLIT_CELL(size, new_size) (new_size) = ((size) > 2) ? ((((size) + 2) >> 2) << 1) : 1
-
-#define UPDATE_BITPOS(n) \
-    ctx->skip_bits  += (n); \
-    ctx->need_resync = 1
-
-#define RESYNC_BITSTREAM \
-    if (ctx->need_resync && !(get_bits_count(&ctx->gb) & 7)) { \
-        skip_bits_long(&ctx->gb, ctx->skip_bits);              \
-        ctx->skip_bits   = 0;                                  \
-        ctx->need_resync = 0;                                  \
-    }
-
-#define CHECK_CELL \
-    if (curr_cell.xpos + curr_cell.width > (plane->width >> 2) ||               \
-        curr_cell.ypos + curr_cell.height > (plane->height >> 2)) {             \
-        av_log(avctx, AV_LOG_ERROR, "Invalid cell: x=%d, y=%d, w=%d, h=%d\n",   \
-               curr_cell.xpos, curr_cell.ypos, curr_cell.width, curr_cell.height); \
-        return AVERROR_INVALIDDATA;                                                              \
-    }
-
-
-static int parse_bintree(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
-                         Plane *plane, int code, Cell *ref_cell,
-                         const int depth, const int strip_width)
-{
-    Cell    curr_cell;
-    int     bytes_used, ret;
-
-    if (depth <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "Stack overflow (corrupted binary tree)!\n");
-        return AVERROR_INVALIDDATA; // unwind recursion
-    }
-
-    curr_cell = *ref_cell; // clone parent cell
-    if (code == H_SPLIT) {
-        SPLIT_CELL(ref_cell->height, curr_cell.height);
-        ref_cell->ypos   += curr_cell.height;
-        ref_cell->height -= curr_cell.height;
-        if (ref_cell->height <= 0 || curr_cell.height <= 0)
-            return AVERROR_INVALIDDATA;
-    } else if (code == V_SPLIT) {
-        if (curr_cell.width > strip_width) {
-            /* split strip */
-            curr_cell.width = (curr_cell.width <= (strip_width << 1) ? 1 : 2) * strip_width;
-        } else
-            SPLIT_CELL(ref_cell->width, curr_cell.width);
-        ref_cell->xpos  += curr_cell.width;
-        ref_cell->width -= curr_cell.width;
-        if (ref_cell->width <= 0 || curr_cell.width <= 0)
-            return AVERROR_INVALIDDATA;
-    }
-
-    while (1) { /* loop until return */
-        RESYNC_BITSTREAM;
-        switch (code = get_bits(&ctx->gb, 2)) {
-        case H_SPLIT:
-        case V_SPLIT:
-            if (parse_bintree(ctx, avctx, plane, code, &curr_cell, depth - 1, strip_width))
-                return AVERROR_INVALIDDATA;
-            break;
-        case INTRA_NULL:
-            if (!curr_cell.tree) { /* MC tree INTRA code */
-                curr_cell.mv_ptr = 0; /* mark the current strip as INTRA */
-                curr_cell.tree   = 1; /* enter the VQ tree */
-            } else { /* VQ tree NULL code */
-                RESYNC_BITSTREAM;
-                code = get_bits(&ctx->gb, 2);
-                if (code >= 2) {
-                    av_log(avctx, AV_LOG_ERROR, "Invalid VQ_NULL code: %d\n", code);
-                    return AVERROR_INVALIDDATA;
-                }
-                if (code == 1)
-                    av_log(avctx, AV_LOG_ERROR, "SkipCell procedure not implemented yet!\n");
-
-                CHECK_CELL
-                if (!curr_cell.mv_ptr)
-                    return AVERROR_INVALIDDATA;
-                ret = copy_cell(ctx, plane, &curr_cell);
-                return ret;
-            }
-            break;
-        case INTER_DATA:
-            if (!curr_cell.tree) { /* MC tree INTER code */
-                unsigned mv_idx;
-                /* get motion vector index and setup the pointer to the mv set */
-                if (!ctx->need_resync)
-                    ctx->next_cell_data = &ctx->gb.buffer[(get_bits_count(&ctx->gb) + 7) >> 3];
-                mv_idx = *(ctx->next_cell_data++);
-                if (mv_idx >= ctx->num_vectors) {
-                    av_log(avctx, AV_LOG_ERROR, "motion vector index out of range\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                curr_cell.mv_ptr = &ctx->mc_vectors[mv_idx << 1];
-                curr_cell.tree   = 1; /* enter the VQ tree */
-                UPDATE_BITPOS(8);
-            } else { /* VQ tree DATA code */
-                if (!ctx->need_resync)
-                    ctx->next_cell_data = &ctx->gb.buffer[(get_bits_count(&ctx->gb) + 7) >> 3];
-
-                CHECK_CELL
-                bytes_used = decode_cell(ctx, avctx, plane, &curr_cell,
-                                         ctx->next_cell_data, ctx->last_byte);
-                if (bytes_used < 0)
-                    return AVERROR_INVALIDDATA;
-
-                UPDATE_BITPOS(bytes_used << 3);
-                ctx->next_cell_data += bytes_used;
-                return 0;
-            }
-            break;
-        }
-    }//while
-
-    return 0;
-}
-
-
-static int decode_plane(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
-                        Plane *plane, const uint8_t *data, int32_t data_size,
-                        int32_t strip_width)
-{
-    Cell            curr_cell;
-    unsigned        num_vectors;
-
-    /* each plane data starts with mc_vector_count field, */
-    /* an optional array of motion vectors followed by the vq data */
-    num_vectors = bytestream_get_le32(&data);
-    if (num_vectors > 256) {
-        av_log(ctx->avctx, AV_LOG_ERROR,
-               "Read invalid number of motion vectors %d\n", num_vectors);
-        return AVERROR_INVALIDDATA;
-    }
-    if (num_vectors * 2 >= data_size)
-        return AVERROR_INVALIDDATA;
-
-    ctx->num_vectors = num_vectors;
-    ctx->mc_vectors  = num_vectors ? data : 0;
-
-    /* init the bitreader */
-    init_get_bits(&ctx->gb, &data[num_vectors * 2], (data_size - num_vectors * 2) << 3);
-    ctx->skip_bits   = 0;
-    ctx->need_resync = 0;
-
-    ctx->last_byte = data + data_size - 1;
-
-    /* initialize the 1st cell and set its dimensions to whole plane */
-    curr_cell.xpos   = curr_cell.ypos = 0;
-    curr_cell.width  = plane->width  >> 2;
-    curr_cell.height = plane->height >> 2;
-    curr_cell.tree   = 0; // we are in the MC tree now
-    curr_cell.mv_ptr = 0; // no motion vector = INTRA cell
-
-    return parse_bintree(ctx, avctx, plane, INTRA_NULL, &curr_cell, CELL_STACK_MAX, strip_width);
-}
-
-
-#define OS_HDR_ID   MKBETAG('F', 'R', 'M', 'H')
-
-static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
-                                const uint8_t *buf, int buf_size)
-{
-    GetByteContext gb;
-    const uint8_t   *bs_hdr;
-    uint32_t        frame_num, word2, check_sum, data_size;
-    uint32_t        y_offset, u_offset, v_offset, starts[3], ends[3];
-    uint16_t        height, width;
-    int             i, j;
-
-    bytestream2_init(&gb, buf, buf_size);
-
-    /* parse and check the OS header */
-    frame_num = bytestream2_get_le32(&gb);
-    word2     = bytestream2_get_le32(&gb);
-    check_sum = bytestream2_get_le32(&gb);
-    data_size = bytestream2_get_le32(&gb);
-
-    if ((frame_num ^ word2 ^ data_size ^ OS_HDR_ID) != check_sum) {
-        av_log(avctx, AV_LOG_ERROR, "OS header checksum mismatch!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* parse the bitstream header */
-    bs_hdr = gb.buffer;
-
-    if (bytestream2_get_le16(&gb) != 32) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported codec version!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->frame_num   =  frame_num;
-    ctx->frame_flags =  bytestream2_get_le16(&gb);
-    ctx->data_size   = (bytestream2_get_le32(&gb) + 7) >> 3;
-    ctx->cb_offset   =  bytestream2_get_byte(&gb);
-
-    if (ctx->data_size == 16)
-        return 4;
-    ctx->data_size = FFMIN(ctx->data_size, buf_size - 16);
-
-    bytestream2_skip(&gb, 3); // skip reserved byte and checksum
-
-    /* check frame dimensions */
-    height = bytestream2_get_le16(&gb);
-    width  = bytestream2_get_le16(&gb);
-    if (av_image_check_size(width, height, 0, avctx))
-        return AVERROR_INVALIDDATA;
-
-    if (width != ctx->width || height != ctx->height) {
-        int res;
-
-        av_dlog(avctx, "Frame dimensions changed!\n");
-
-        if (width  < 16 || width  > 640 ||
-            height < 16 || height > 480 ||
-            width  &  3 || height &   3) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid picture dimensions: %d x %d!\n", width, height);
-            return AVERROR_INVALIDDATA;
-        }
-
-        ctx->width  = width;
-        ctx->height = height;
-
-        free_frame_buffers(ctx);
-        if ((res = allocate_frame_buffers(ctx, avctx)) < 0)
-             return res;
-        ff_set_dimensions(avctx, width, height);
-    }
-
-    y_offset = bytestream2_get_le32(&gb);
-    v_offset = bytestream2_get_le32(&gb);
-    u_offset = bytestream2_get_le32(&gb);
-    bytestream2_skip(&gb, 4);
-
-    /* unfortunately there is no common order of planes in the buffer */
-    /* so we use that sorting algo for determining planes data sizes  */
-    starts[0] = y_offset;
-    starts[1] = v_offset;
-    starts[2] = u_offset;
-
-    for (j = 0; j < 3; j++) {
-        ends[j] = ctx->data_size;
-        for (i = 2; i >= 0; i--)
-            if (starts[i] < ends[j] && starts[i] > starts[j])
-                ends[j] = starts[i];
-    }
-
-    ctx->y_data_size = ends[0] - starts[0];
-    ctx->v_data_size = ends[1] - starts[1];
-    ctx->u_data_size = ends[2] - starts[2];
-    if (FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
-        FFMIN3(y_offset, v_offset, u_offset) < gb.buffer - bs_hdr + 16 ||
-        FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->y_data_ptr = bs_hdr + y_offset;
-    ctx->v_data_ptr = bs_hdr + v_offset;
-    ctx->u_data_ptr = bs_hdr + u_offset;
-    ctx->alt_quant  = gb.buffer;
-
-    if (ctx->data_size == 16) {
-        av_log(avctx, AV_LOG_DEBUG, "Sync frame encountered!\n");
-        return 16;
-    }
-
-    if (ctx->frame_flags & BS_8BIT_PEL) {
-        avpriv_request_sample(avctx, "8-bit pixel format");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (ctx->frame_flags & BS_MV_X_HALF || ctx->frame_flags & BS_MV_Y_HALF) {
-        avpriv_request_sample(avctx, "Halfpel motion vectors");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    return 0;
-}
-
-
-/**
- *  Convert and output the current plane.
- *  All pixel values will be upsampled by shifting right by one bit.
- *
- *  @param[in]  plane        pointer to the descriptor of the plane being processed
- *  @param[in]  buf_sel      indicates which frame buffer the input data stored in
- *  @param[out] dst          pointer to the buffer receiving converted pixels
- *  @param[in]  dst_pitch    pitch for moving to the next y line
- *  @param[in]  dst_height   output plane height
- */
-static void output_plane(const Plane *plane, int buf_sel, uint8_t *dst,
-                         int dst_pitch, int dst_height)
-{
-    int             x,y;
-    const uint8_t   *src  = plane->pixels[buf_sel];
-    uint32_t        pitch = plane->pitch;
-
-    dst_height = FFMIN(dst_height, plane->height);
-    for (y = 0; y < dst_height; y++) {
-        /* convert four pixels at once using SWAR */
-        for (x = 0; x < plane->width >> 2; x++) {
-            AV_WN32A(dst, (AV_RN32A(src) & 0x7F7F7F7F) << 1);
-            src += 4;
-            dst += 4;
-        }
-
-        for (x <<= 2; x < plane->width; x++)
-            *dst++ = *src++ << 1;
-
-        src += pitch     - plane->width;
-        dst += dst_pitch - plane->width;
-    }
-}
-
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    Indeo3DecodeContext *ctx = avctx->priv_data;
-
-    ctx->avctx     = avctx;
-    ctx->width     = avctx->width;
-    ctx->height    = avctx->height;
-    avctx->pix_fmt = AV_PIX_FMT_YUV410P;
-
-    build_requant_tab();
-
-    ff_hpeldsp_init(&ctx->hdsp, avctx->flags);
-
-    allocate_frame_buffers(ctx, avctx);
-
-    return 0;
-}
-
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    Indeo3DecodeContext *ctx = avctx->priv_data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    AVFrame *frame     = data;
-    int res;
-
-    res = decode_frame_headers(ctx, avctx, buf, buf_size);
-    if (res < 0)
-        return res;
-
-    /* skip sync(null) frames */
-    if (res) {
-        // we have processed 16 bytes but no data was decoded
-        *got_frame = 0;
-        return buf_size;
-    }
-
-    /* skip droppable INTER frames if requested */
-    if (ctx->frame_flags & BS_NONREF &&
-       (avctx->skip_frame >= AVDISCARD_NONREF))
-        return 0;
-
-    /* skip INTER frames if requested */
-    if (!(ctx->frame_flags & BS_KEYFRAME) && avctx->skip_frame >= AVDISCARD_NONKEY)
-        return 0;
-
-    /* use BS_BUFFER flag for buffer switching */
-    ctx->buf_sel = (ctx->frame_flags >> BS_BUFFER) & 1;
-
-    /* decode luma plane */
-    if ((res = decode_plane(ctx, avctx, ctx->planes, ctx->y_data_ptr, ctx->y_data_size, 40)))
-        return res;
-
-    /* decode chroma planes */
-    if ((res = decode_plane(ctx, avctx, &ctx->planes[1], ctx->u_data_ptr, ctx->u_data_size, 10)))
-        return res;
-
-    if ((res = decode_plane(ctx, avctx, &ctx->planes[2], ctx->v_data_ptr, ctx->v_data_size, 10)))
-        return res;
-
-    if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return res;
-    }
-
-    output_plane(&ctx->planes[0], ctx->buf_sel,
-                 frame->data[0], frame->linesize[0],
-                 avctx->height);
-    output_plane(&ctx->planes[1], ctx->buf_sel,
-                 frame->data[1], frame->linesize[1],
-                 (avctx->height + 3) >> 2);
-    output_plane(&ctx->planes[2], ctx->buf_sel,
-                 frame->data[2], frame->linesize[2],
-                 (avctx->height + 3) >> 2);
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-
-static av_cold int decode_close(AVCodecContext *avctx)
-{
-    free_frame_buffers(avctx->priv_data);
-
-    return 0;
-}
-
-AVCodec ff_indeo3_decoder = {
-    .name           = "indeo3",
-    .long_name      = NULL_IF_CONFIG_SMALL("Intel Indeo 3"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_INDEO3,
-    .priv_data_size = sizeof(Indeo3DecodeContext),
-    .init           = decode_init,
-    .close          = decode_close,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/indeo3data.h b/deps/libav/libavcodec/indeo3data.h
deleted file mode 100644
index 28c9bb6..0000000
--- a/deps/libav/libavcodec/indeo3data.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Indeo Video v3 compatible decoder
- * Copyright (c) 2009 - 2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_INDEO3DATA_H
-#define AVCODEC_INDEO3DATA_H
-
-#include <stdint.h>
-
-#include "config.h"
-
-/*
- * Define compressed VQ tables.
- */
-
-#define TAB_1_1 \
-    PD(   0,   0), E2(   2,   2), E4(  -1,   3), E2(   4,   4), E4(   1,   5),\
-    E2(  -4,   4), E4(  -2,   6), E4(   4,   9), E2(   9,   9), E4(   1,  10),\
-    E4(  -5,   8), E4(   9,  15), E4(  -3,  12), E4(   4,  16), E2(  16,  16),\
-    E4(   0,  18), E2( -12,  12), E4(  -9,  16), E4(  11,  27), E4(  19,  28),\
-    E4(  -6,  22), E4(   4,  29), E2(  30,  30), E4(  -2,  33), E4( -18,  23),\
-    E4( -15,  30), E4(  22,  46), E4(  13,  47), E4(  35,  49), E4( -11,  41),\
-    E4(   4,  51), E2(  54,  54), E2( -34,  34), E4( -29,  42), E4(  -6,  60),\
-    E4(  27,  76), E4(  43,  77), E4( -24,  55), E4(  14,  79), E4(  63,  83),\
-    E4( -20,  74), E4(   2,  88), E2(  93,  93), E4( -52,  61), E4(  52, 120),\
-    E4( -45,  75), E4(  75, 125), E4(  33, 122), E4( -13, 103), E4( -40,  96),\
-    E4( -34, 127), E2( -89,  89), E4( -78, 105), E2(  12,  12), E2(  23,  23),\
-    E2(  42,  42), E2(  73,  73)
-
-#define TAB_1_2 \
-    PD(   0,   0), E2(   3,   3), E4(  -1,   4), E2(   7,   7), E4(   2,   8),\
-    E4(  -2,   9), E2(  -6,   6), E4(   6,  13), E2(  13,  13), E4(   1,  14),\
-    E4(  -8,  12), E4(  14,  23), E4(  -5,  18), E4(   6,  24), E2(  24,  24),\
-    E4(  -1,  27), E2( -17,  17), E4( -13,  23), E4(  16,  40), E4(  28,  41),\
-    E4(  -9,  33), E4(   6,  43), E2(  46,  46), E4(  -4,  50), E4( -27,  34),\
-    E4( -22,  45), E4(  34,  69), E4(  19,  70), E4(  53,  73), E4( -17,  62),\
-    E4(   5,  77), E2(  82,  82), E2( -51,  51), E4( -43,  64), E4( -10,  90),\
-    E4(  41, 114), E4(  64, 116), E4( -37,  82), E4(  22, 119), E4(  95, 124),\
-    E4( -30, 111), E4( -78,  92), E4( -68, 113), E2(  18,  18), E2(  34,  34),\
-    E2(  63,  63), E2( 109, 109)
-
-#define TAB_1_3 \
-    PD(   0,   0), E2(   4,   4), E4(  -1,   5), E4(   3,  10), E2(   9,   9),\
-    E2(  -7,   7), E4(  -3,  12), E4(   8,  17), E2(  17,  17), E4(   1,  19),\
-    E4( -11,  16), E4(  -6,  23), E4(  18,  31), E4(   8,  32), E2(  33,  33),\
-    E4(  -1,  36), E2( -23,  23), E4( -17,  31), E4(  21,  54), E4(  37,  55),\
-    E4( -12,  44), E4(   8,  57), E2(  61,  61), E4(  -5,  66), E4( -36,  45),\
-    E4( -29,  60), E4(  45,  92), E4(  25,  93), E4(  71,  97), E4( -22,  83),\
-    E4(   7, 102), E2( 109, 109), E2( -68,  68), E4( -57,  85), E4( -13, 120),\
-    E4( -49, 110), E4(-104, 123), E2(  24,  24), E2(  46,  46), E2(  84,  84)
-
-#define TAB_1_4 \
-    PD(   0,   0), E2(   5,   5), E4(  -2,   7), E2(  11,  11), E4(   3,  13),\
-    E2(  -9,   9), E4(  -4,  15), E4(  11,  22), E2(  21,  21), E4(   2,  24),\
-    E4( -14,  20), E4(  23,  38), E4(  -8,  29), E4(  11,  39), E2(  41,  41),\
-    E4(  -1,  45), E2( -29,  29), E4( -22,  39), E4(  27,  67), E4(  47,  69),\
-    E4( -15,  56), E4(  11,  71), E2(  76,  76), E4(  -6,  83), E4( -45,  57),\
-    E4( -36,  75), E4(  56, 115), E4(  31, 117), E4(  88, 122), E4( -28, 104),\
-    E2( -85,  85), E4( -72, 106), E2(  30,  30), E2(  58,  58), E2( 105, 105)
-
-#define TAB_1_5 \
-    PD(   0,   0), E2(   6,   6), E4(  -2,   8), E2(  13,  13), E4(   4,  15),\
-    E2( -11,  11), E4(  -5,  18), E4(  13,  26), E2(  26,  26), E4(   2,  29),\
-    E4( -16,  24), E4(  28,  46), E4(  -9,  35), E4(  13,  47), E2(  49,  49),\
-    E4(  -1,  54), E2( -35,  35), E4( -26,  47), E4(  32,  81), E4(  56,  83),\
-    E4( -18,  67), E4(  13,  86), E2(  91,  91), E4(  -7,  99), E4( -54,  68),\
-    E4( -44,  90), E4( -33, 124), E2(-103, 103), E4( -86, 127), E2(  37,  37),\
-    E2(  69,  69)
-
-#define TAB_1_6 \
-    PD(   0,   0), E2(   7,   7), E4(  -3,  10), E2(  16,  16), E4(   5,  18),\
-    E2( -13,  13), E4(  -6,  21), E4(  15,  30), E2(  30,  30), E4(   2,  34),\
-    E4( -19,  28), E4(  32,  54), E4( -11,  41), E4(  15,  55), E2(  57,  57),\
-    E4(  -1,  63), E2( -40,  40), E4( -30,  55), E4(  37,  94), E4(  65,  96),\
-    E4( -21,  78), E4(  15, 100), E2( 106, 106), E4(  -8, 116), E4( -63,  79),\
-    E4( -51, 105), E2(-120, 120), E2(  43,  43), E2(  80,  80)
-
-#define TAB_1_7 \
-    PD(   0,   0), E2(   8,   8), E4(  -3,  11), E2(  18,  18), E4(   5,  20),\
-    E2( -15,  15), E4(  -7,  24), E4(  17,  35), E2(  34,  34), E4(   3,  38),\
-    E4( -22,  32), E4(  37,  61), E4( -13,  47), E4(  17,  63), E2(  65,  65),\
-    E4(  -1,  72), E2( -46,  46), E4( -35,  63), E4(  43, 107), E4(  75, 110),\
-    E4( -24,  89), E4(  17, 114), E2( 121, 121), E4( -72,  91), E4( -58, 120),\
-    E2(  49,  49), E2(  92,  92)
-
-#define TAB_1_8 \
-    PD(   0,   0), E2(   9,   9), E4(  -3,  12), E2(  20,  20), E4(   6,  23),\
-    E2( -17,  17), E4(  -7,  27), E4(  19,  39), E2(  39,  39), E4(   3,  43),\
-    E4( -24,  36), E4(  42,  69), E4( -14,  53), E4(  19,  71), E2(  73,  73),\
-    E4(  -2,  80), E2( -52,  52), E4( -39,  70), E4(  48, 121), E4(  84, 124),\
-    E4( -27, 100), E4( -81, 102), E2(  55,  55), E2( 104, 104)
-
-#define TAB_2_1 \
-    PD(   0,   0), E2(   2,   2), E4(   0,   2), E2(   4,   4), E4(   0,   4),\
-    E2(  -4,   4), E4(  -2,   6), E4(   4,   8), E2(   8,   8), E4(   0,  10),\
-    E4(  -4,   8), E4(   8,  14), E4(  -2,  12), E4(   4,  16), E2(  16,  16),\
-    E4(   0,  18), E2( -12,  12), E4(  -8,  16), E4(  10,  26), E4(  18,  28),\
-    E4(  -6,  22), E4(   4,  28), E2(  30,  30), E4(  -2,  32), E4( -18,  22),\
-    E4( -14,  30), E4(  22,  46), E4(  12,  46), E4(  34,  48), E4( -10,  40),\
-    E4(   4,  50), E2(  54,  54), E2( -34,  34), E4( -28,  42), E4(  -6,  60),\
-    E4(  26,  76), E4(  42,  76), E4( -24,  54), E4(  14,  78), E4(  62,  82),\
-    E4( -20,  74), E4(   2,  88), E2(  92,  92), E4( -52,  60), E4(  52, 118),\
-    E4( -44,  74), E4(  74, 118), E4(  32, 118), E4( -12, 102), E4( -40,  96),\
-    E4( -34, 118), E2( -88,  88), E4( -78, 104), E2(  12,  12), E2(  22,  22),\
-    E2(  42,  42), E2(  72,  72)
-
-#define TAB_2_2 \
-    PD(   0,   0), E2(   3,   3), E4(   0,   3), E2(   6,   6), E4(   3,   9),\
-    E4(  -3,   9), E2(  -6,   6), E4(   6,  12), E2(  12,  12), E4(   0,  15),\
-    E4(  -9,  12), E4(  15,  24), E4(  -6,  18), E4(   6,  24), E2(  24,  24),\
-    E4(   0,  27), E2( -18,  18), E4( -12,  24), E4(  15,  39), E4(  27,  42),\
-    E4(  -9,  33), E4(   6,  42), E2(  45,  45), E4(  -3,  51), E4( -27,  33),\
-    E4( -21,  45), E4(  33,  69), E4(  18,  69), E4(  54,  72), E4( -18,  63),\
-    E4(   6,  78), E2(  81,  81), E2( -51,  51), E4( -42,  63), E4(  -9,  90),\
-    E4(  42, 114), E4(  63, 117), E4( -36,  81), E4(  21, 120), E4(  96, 123),\
-    E4( -30, 111), E4( -78,  93), E4( -69, 114), E2(  18,  18), E2(  33,  33),\
-    E2(  63,  63), E2( 108, 108)
-
-#define TAB_2_3 \
-    PD(   0,   0), E2(   4,   4), E4(   0,   4), E4(   4,   8), E2(   8,   8),\
-    E2(  -8,   8), E4(  -4,  12), E4(   8,  16), E2(  16,  16), E4(   0,  20),\
-    E4( -12,  16), E4(  -4,  24), E4(  16,  32), E4(   8,  32), E2(  32,  32),\
-    E4(   0,  36), E2( -24,  24), E4( -16,  32), E4(  20,  52), E4(  36,  56),\
-    E4( -12,  44), E4(   8,  56), E2(  60,  60), E4(  -4,  64), E4( -36,  44),\
-    E4( -28,  60), E4(  44,  92), E4(  24,  92), E4(  72,  96), E4( -20,  84),\
-    E4(   8, 100), E2( 108, 108), E2( -68,  68), E4( -56,  84), E4( -12, 120),\
-    E4( -48, 108), E4(-104, 124), E2(  24,  24), E2(  44,  44), E2(  84,  84)
-
-#define TAB_2_4 \
-    PD(   0,   0), E2(   5,   5), E4(   0,   5), E2(  10,  10), E4(   5,  15),\
-    E2( -10,  10), E4(  -5,  15), E4(  10,  20), E2(  20,  20), E4(   0,  25),\
-    E4( -15,  20), E4(  25,  40), E4( -10,  30), E4(  10,  40), E2(  40,  40),\
-    E4(   0,  45), E2( -30,  30), E4( -20,  40), E4(  25,  65), E4(  45,  70),\
-    E4( -15,  55), E4(  10,  70), E2(  75,  75), E4(  -5,  85), E4( -45,  55),\
-    E4( -35,  75), E4(  55, 115), E4(  30, 115), E4(  90, 120), E4( -30, 105),\
-    E2( -85,  85), E4( -70, 105), E2(  30,  30), E2(  60,  60), E2( 105, 105)
-
-#define TAB_2_5 \
-    PD(   0,   0), E2(   6,   6), E4(   0,   6), E2(  12,  12), E4(   6,  12),\
-    E2( -12,  12), E4(  -6,  18), E4(  12,  24), E2(  24,  24), E4(   0,  30),\
-    E4( -18,  24), E4(  30,  48), E4(  -6,  36), E4(  12,  48), E2(  48,  48),\
-    E4(   0,  54), E2( -36,  36), E4( -24,  48), E4(  30,  78), E4(  54,  84),\
-    E4( -18,  66), E4(  12,  84), E2(  90,  90), E4(  -6,  96), E4( -54,  66),\
-    E4( -42,  90), E4( -30, 126), E2(-102, 102), E4( -84, 126), E2(  36,  36),\
-    E2(  66,  66)
-
-#define TAB_2_6 \
-    PD(   0,   0), E2(   7,   7), E4(   0,   7), E2(  14,  14), E4(   7,  21),\
-    E2( -14,  14), E4(  -7,  21), E4(  14,  28), E2(  28,  28), E4(   0,  35),\
-    E4( -21,  28), E4(  35,  56), E4( -14,  42), E4(  14,  56), E2(  56,  56),\
-    E4(   0,  63), E2( -42,  42), E4( -28,  56), E4(  35,  91), E4(  63,  98),\
-    E4( -21,  77), E4(  14,  98), E2( 105, 105), E4(  -7, 119), E4( -63,  77),\
-    E4( -49, 105), E2(-119, 119), E2(  42,  42), E2(  77,  77)
-
-#define TAB_2_7 \
-    PD(   0,   0), E2(   8,   8), E4(   0,   8), E2(  16,  16), E4(   8,  16),\
-    E2( -16,  16), E4(  -8,  24), E4(  16,  32), E2(  32,  32), E4(   0,  40),\
-    E4( -24,  32), E4(  40,  64), E4( -16,  48), E4(  16,  64), E2(  64,  64),\
-    E4(   0,  72), E2( -48,  48), E4( -32,  64), E4(  40, 104), E4(  72, 112),\
-    E4( -24,  88), E4(  16, 112), E2( 120, 120), E4( -72,  88), E4( -56, 120),\
-    E2(  48,  48), E2(  88,  88)
-
-#define TAB_2_8 \
-    PD(   0,   0), E2(   9,   9), E4(   0,   9), E2(  18,  18), E4(   9,  27),\
-    E2( -18,  18), E4(  -9,  27), E4(  18,  36), E2(  36,  36), E4(   0,  45),\
-    E4( -27,  36), E4(  45,  72), E4( -18,  54), E4(  18,  72), E2(  72,  72),\
-    E4(   0,  81), E2( -54,  54), E4( -36,  72), E4(  45, 117), E4(  81, 126),\
-    E4( -27,  99), E4( -81,  99), E2(  54,  54), E2( 108, 108)
-
-#define TAB_3_1 \
-    PD(   0,   0), E2(   2,   2), E4(   0,   3), E2(   6,   6), E4(   0,   7),\
-    E2(  -5,   5), E2(   5,  -5), E4(   6,  11), E4(   0,   8), E2(  11,  11),\
-    E4(   0,  12), E4(  12,  17), E2(  17,  17), E4(   6,  18), E4(  -8,  11),\
-    E4(   0,  15), E4(   0,  20), E4(  18,  25), E4(  11,  25), E2(  25,  25),\
-    E2( -14,  14), E2(  14, -14), E4(   0,  26), E4( -11,  18), E4(  -7,  22),\
-    E4(  26,  34), E4(  18,  34), E2(  34,  34), E4(  11,  35), E4(   0,  29),\
-    E4( -19,  22), E4( -15,  26), E4(   0,  37), E4(  27,  44), E4(  36,  44),\
-    E4(  18,  44), E4( -10,  33), E2(  45,  45)
-
-#define TAB_3_2 \
-    PD(   0,   0), E4(   0,   2), E2(   2,   2), E2(   6,   6), E4(   0,   6),\
-    E2(  -4,   4), E2(  10,  -6), E2(   0, -12), PD(  -6, -12), E2(   6, -12),\
-    PD(   6,  12), E2( -14,   0), E2(  12,  12), E2(   0, -18), E2(  14, -12),\
-    PD( -18,  -6), E2(  18,  -6), PD(  18,   6), PD( -10, -18), E2(  10, -18),\
-    PD(  10,  18), E2( -22,   0), E2(   0, -24), PD( -22, -12), E2(  22, -12),\
-    PD(  22,  12), PD(  -8, -24), E2(   8, -24), PD(   8,  24), PD( -26,  -6),\
-    E2(  26,  -6), PD(  26,   6), E2( -28,   0), E2(  20,  20), E2( -14, -26),\
-    E2( -30, -12), E2( -10, -32), E2( -18, -32), E2( -26, -26), E2( -34, -20),\
-    E2( -38, -12), E2( -32, -32), PD(  32,  32), PD( -22, -40), E2( -34, -34)
-
-#define TAB_3_3 \
-    PD(   0,   0), E4(   0,   2), E2(   4,   4), E2(  10,  10), E4(   0,  10),\
-    E2(  -6,   6), E2(  14,  -8), E2( -18,   0), E2(  10, -16), E2(   0, -24),\
-    PD( -24,  -8), E2(  24,  -8), PD(  24,   8), E2(  18,  18), E2(  20, -16),\
-    PD( -14, -26), E2(  14, -26), PD(  14,  26), E2( -30,   0), E2(   0, -34),\
-    PD( -34,  -8), E2(  34,  -8), PD(  34,   8), PD( -30, -18), E2(  30, -18),\
-    PD(  30,  18), PD( -10, -34), E2(  10, -34), PD(  10,  34), E2( -20, -34),\
-    E2( -40,   0), E2(  30,  30), E2( -40, -18), E2(   0, -44), E2( -16, -44),\
-    PD( -36, -36), E2( -36, -36), E2( -26, -44), E2( -46, -26), E2( -52, -18),\
-    PD( -20, -54), E2( -44, -44), PD( -32, -54), PD( -46, -46), E2( -46, -46)
-
-#define TAB_3_4 \
-    PD(   0,   0), E4(   0,   4), E2(   4,   4), E2(  12,  12), E4(   0,  12),\
-    E2(  -8,   8), E2(   8, -16), E2(   0, -24), PD( -24,  -8), E2(  24,  -8),\
-    PD(  24,   8), E2(  20, -16), E2( -28,   0), PD( -16, -24), E2(  16, -24),\
-    PD(  16,  24), E2(   0, -32), PD( -28, -16), E2(  28, -16), PD(  28,  16),\
-    PD(  -8, -32), PD(   8, -32), PD( -32,  -8), E2(  32,  -8), PD(  32,   8),\
-    PD(  -8,  32), PD(   8,  32), E2(  24,  24), E2(  24, -24), E2( -20, -32),\
-    E2( -40,   0), E2( -40, -16), PD(   0, -44), PD(   0, -44), E2( -44,   0),\
-    PD(   0,  44), PD(   0,  44), E2( -32, -32), E2( -16, -44), PD( -24, -44),\
-    E2( -44, -24), PD(  24,  44), E2( -48, -16), PD( -36, -36), E2( -36, -36),\
-    PD(  36,  36), PD( -20, -52), E2(  40,  40), PD( -32, -52)
-
-#define TAB_3_5 \
-    PD(   0,   0), E2(   2,   2), E2(   6,   6), E2(  12,  12), E2(  20,  20),\
-    E2(  32,  32), E2(  46,  46)
-
-
-/**
- * Pack two delta values (a,b) into one 16bit word
- * according with endianness of the host machine.
- */
-#if HAVE_BIGENDIAN
-#define PD(a,b) (((a) << 8) + (b))
-#else
-#define PD(a,b) (((b) << 8) + (a))
-#endif
-
-/**
- * Expand a pair of delta values (a,b)
- * into two/four delta entries.
- */
-#define E2(a, b) PD(a, b), PD(-(a), -(b))
-#define E4(a, b) PD(a, b), PD(-(a), -(b)), PD(b, a), PD(-(b), -(a))
-
-/*
- * VQ tables for 4x4 block modes.
- * Let the compiler decompress and build the tables for us.
- */
-static const int16_t delta_tab_1_1[195] = { TAB_1_1 };
-static const int16_t delta_tab_1_2[159] = { TAB_1_2 };
-static const int16_t delta_tab_1_3[133] = { TAB_1_3 };
-static const int16_t delta_tab_1_4[115] = { TAB_1_4 };
-static const int16_t delta_tab_1_5[101] = { TAB_1_5 };
-static const int16_t delta_tab_1_6[93]  = { TAB_1_6 };
-static const int16_t delta_tab_1_7[87]  = { TAB_1_7 };
-static const int16_t delta_tab_1_8[77]  = { TAB_1_8 };
-
-static const int16_t delta_tab_2_1[195] = { TAB_2_1 };
-static const int16_t delta_tab_2_2[159] = { TAB_2_2 };
-static const int16_t delta_tab_2_3[133] = { TAB_2_3 };
-static const int16_t delta_tab_2_4[115] = { TAB_2_4 };
-static const int16_t delta_tab_2_5[101] = { TAB_2_5 };
-static const int16_t delta_tab_2_6[93]  = { TAB_2_6 };
-static const int16_t delta_tab_2_7[87]  = { TAB_2_7 };
-static const int16_t delta_tab_2_8[77]  = { TAB_2_8 };
-
-static const int16_t delta_tab_3_1[128] = { TAB_3_1 };
-static const int16_t delta_tab_3_2[79]  = { TAB_3_2 };
-static const int16_t delta_tab_3_3[79]  = { TAB_3_3 };
-static const int16_t delta_tab_3_4[79]  = { TAB_3_4 };
-static const int16_t delta_tab_3_5[79]  = { TAB_3_5 };
-
-#undef PD
-
-/**
- * Pack four delta values (a,a,b,b) into one 32bit word
- * according with endianness of the host machine.
- */
-#if HAVE_BIGENDIAN
-#define PD(a,b) (((a) << 24) + ((a) << 16) + ((b) << 8) + (b))
-#else
-#define PD(a,b) (((b) << 24) + ((b) << 16) + ((a) << 8) + (a))
-#endif
-
-/*
- * VQ tables for 8x8 block modes.
- * Those are based on the same delta tables by using
- * each value twice: ABCD --> AABBCCDD.
- */
-static const int32_t delta_tab_1_1_m10[195] = { TAB_1_1 };
-static const int32_t delta_tab_1_2_m10[159] = { TAB_1_2 };
-static const int32_t delta_tab_1_3_m10[133] = { TAB_1_3 };
-static const int32_t delta_tab_1_4_m10[115] = { TAB_1_4 };
-static const int32_t delta_tab_1_5_m10[101] = { TAB_1_5 };
-static const int32_t delta_tab_1_6_m10[93]  = { TAB_1_6 };
-static const int32_t delta_tab_1_7_m10[87]  = { TAB_1_7 };
-static const int32_t delta_tab_1_8_m10[77]  = { TAB_1_8 };
-
-static const int32_t delta_tab_2_1_m10[195] = { TAB_2_1 };
-static const int32_t delta_tab_2_2_m10[159] = { TAB_2_2 };
-static const int32_t delta_tab_2_3_m10[133] = { TAB_2_3 };
-static const int32_t delta_tab_2_4_m10[115] = { TAB_2_4 };
-static const int32_t delta_tab_2_5_m10[101] = { TAB_2_5 };
-static const int32_t delta_tab_2_6_m10[93]  = { TAB_2_6 };
-static const int32_t delta_tab_2_7_m10[87]  = { TAB_2_7 };
-static const int32_t delta_tab_2_8_m10[77]  = { TAB_2_8 };
-
-static const int32_t delta_tab_3_1_m10[128] = { TAB_3_1 };
-static const int32_t delta_tab_3_2_m10[79]  = { TAB_3_2 };
-static const int32_t delta_tab_3_3_m10[79]  = { TAB_3_3 };
-static const int32_t delta_tab_3_4_m10[79]  = { TAB_3_4 };
-static const int32_t delta_tab_3_5_m10[79]  = { TAB_3_5 };
-
-
-typedef struct vqEntry {
-    const int16_t  *deltas;     ///< delta tables for 4x4 block modes
-    const int32_t  *deltas_m10; ///< delta tables for 8x8 block modes
-    uint8_t        num_dyads;   ///< number of two-pixel deltas
-    uint8_t        quad_exp;    ///< log2 of four-pixel deltas
-} vqEntry;
-
-static const vqEntry vq_tab[24] = {
-    /* set 1 */
-    { delta_tab_1_1, delta_tab_1_1_m10, 195,  7 },
-    { delta_tab_1_2, delta_tab_1_2_m10, 159,  9 },
-    { delta_tab_1_3, delta_tab_1_3_m10, 133, 10 },
-    { delta_tab_1_4, delta_tab_1_4_m10, 115, 11 },
-    { delta_tab_1_5, delta_tab_1_5_m10, 101, 12 },
-    { delta_tab_1_6, delta_tab_1_6_m10,  93, 12 },
-    { delta_tab_1_7, delta_tab_1_7_m10,  87, 12 },
-    { delta_tab_1_8, delta_tab_1_8_m10,  77, 13 },
-
-    /* set 2 */
-    { delta_tab_2_1, delta_tab_2_1_m10, 195,  7 },
-    { delta_tab_2_2, delta_tab_2_2_m10, 159,  9 },
-    { delta_tab_2_3, delta_tab_2_3_m10, 133, 10 },
-    { delta_tab_2_4, delta_tab_2_4_m10, 115, 11 },
-    { delta_tab_2_5, delta_tab_2_5_m10, 101, 12 },
-    { delta_tab_2_6, delta_tab_2_6_m10,  93, 12 },
-    { delta_tab_2_7, delta_tab_2_7_m10,  87, 12 },
-    { delta_tab_2_8, delta_tab_2_8_m10,  77, 13 },
-
-    /* set 3 */
-    { delta_tab_3_1, delta_tab_3_1_m10, 128, 11 },
-    { delta_tab_3_2, delta_tab_3_2_m10,  79, 13 },
-    { delta_tab_3_3, delta_tab_3_3_m10,  79, 13 },
-    { delta_tab_3_4, delta_tab_3_4_m10,  79, 13 },
-    { delta_tab_3_5, delta_tab_3_5_m10,  79, 13 },
-    { delta_tab_3_5, delta_tab_3_5_m10,  79, 13 },
-    { delta_tab_3_5, delta_tab_3_5_m10,  79, 13 },
-    { delta_tab_3_5, delta_tab_3_5_m10,  79, 13 }
-};
-
-#endif /* AVCODEC_INDEO3DATA_H */
diff --git a/deps/libav/libavcodec/indeo4.c b/deps/libav/libavcodec/indeo4.c
deleted file mode 100644
index 6a19955..0000000
--- a/deps/libav/libavcodec/indeo4.c
+++ /dev/null
@@ -1,650 +0,0 @@
-/*
- * Indeo Video Interactive v4 compatible decoder
- * Copyright (c) 2009-2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Indeo Video Interactive version 4 decoder
- *
- * Indeo 4 data is usually transported within .avi or .mov files.
- * Known FOURCCs: 'IV41'
- */
-
-#define BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "get_bits.h"
-#include "ivi_dsp.h"
-#include "ivi_common.h"
-#include "indeo4data.h"
-
-/**
- *  Indeo 4 frame types.
- */
-enum {
-    FRAMETYPE_INTRA       = 0,
-    FRAMETYPE_INTRA1      = 1,  ///< intra frame with slightly different bitstream coding
-    FRAMETYPE_INTER       = 2,  ///< non-droppable P-frame
-    FRAMETYPE_BIDIR       = 3,  ///< bidirectional frame
-    FRAMETYPE_INTER_NOREF = 4,  ///< droppable P-frame
-    FRAMETYPE_NULL_FIRST  = 5,  ///< empty frame with no data
-    FRAMETYPE_NULL_LAST   = 6   ///< empty frame with no data
-};
-
-#define IVI4_PIC_SIZE_ESC   7
-
-
-static const struct {
-    InvTransformPtr *inv_trans;
-    DCTransformPtr  *dc_trans;
-    int             is_2d_trans;
-} transforms[18] = {
-    { ff_ivi_inverse_haar_8x8,  ff_ivi_dc_haar_2d,       1 },
-    { ff_ivi_row_haar8,         ff_ivi_dc_haar_2d,       0 },
-    { ff_ivi_col_haar8,         ff_ivi_dc_haar_2d,       0 },
-    { ff_ivi_put_pixels_8x8,    ff_ivi_put_dc_pixel_8x8, 1 },
-    { ff_ivi_inverse_slant_8x8, ff_ivi_dc_slant_2d,      1 },
-    { ff_ivi_row_slant8,        ff_ivi_dc_row_slant,     1 },
-    { ff_ivi_col_slant8,        ff_ivi_dc_col_slant,     1 },
-    { NULL, NULL, 0 }, /* inverse DCT 8x8 */
-    { NULL, NULL, 0 }, /* inverse DCT 8x1 */
-    { NULL, NULL, 0 }, /* inverse DCT 1x8 */
-    { ff_ivi_inverse_haar_4x4,  ff_ivi_dc_haar_2d,       1 },
-    { ff_ivi_inverse_slant_4x4, ff_ivi_dc_slant_2d,      1 },
-    { NULL, NULL, 0 }, /* no transform 4x4 */
-    { ff_ivi_row_haar4,         ff_ivi_dc_haar_2d,       0 },
-    { ff_ivi_col_haar4,         ff_ivi_dc_haar_2d,       0 },
-    { ff_ivi_row_slant4,        ff_ivi_dc_row_slant,     0 },
-    { ff_ivi_col_slant4,        ff_ivi_dc_col_slant,     0 },
-    { NULL, NULL, 0 }, /* inverse DCT 4x4 */
-};
-
-/**
- *  Decode subdivision of a plane.
- *  This is a simplified version that checks for two supported subdivisions:
- *  - 1 wavelet band  per plane, size factor 1:1, code pattern: 3
- *  - 4 wavelet bands per plane, size factor 1:4, code pattern: 2,3,3,3,3
- *  Anything else is either unsupported or corrupt.
- *
- *  @param[in,out] gb    the GetBit context
- *  @return        number of wavelet bands or 0 on error
- */
-static int decode_plane_subdivision(GetBitContext *gb)
-{
-    int i;
-
-    switch (get_bits(gb, 2)) {
-    case 3:
-        return 1;
-    case 2:
-        for (i = 0; i < 4; i++)
-            if (get_bits(gb, 2) != 3)
-                return 0;
-        return 4;
-    default:
-        return 0;
-    }
-}
-
-static inline int scale_tile_size(int def_size, int size_factor)
-{
-    return size_factor == 15 ? def_size : (size_factor + 1) << 5;
-}
-
-/**
- *  Decode Indeo 4 picture header.
- *
- *  @param[in,out] ctx       pointer to the decoder context
- *  @param[in]     avctx     pointer to the AVCodecContext
- *  @return        result code: 0 = OK, negative number = error
- */
-static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
-{
-    int             pic_size_indx, i, p;
-    IVIPicConfig    pic_conf;
-
-    if (get_bits(&ctx->gb, 18) != 0x3FFF8) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid picture start code!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->prev_frame_type = ctx->frame_type;
-    ctx->frame_type      = get_bits(&ctx->gb, 3);
-    if (ctx->frame_type == 7) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame type: %d\n", ctx->frame_type);
-        return AVERROR_INVALIDDATA;
-    }
-
-#if IVI4_STREAM_ANALYSER
-    if (ctx->frame_type == FRAMETYPE_BIDIR)
-        ctx->has_b_frames = 1;
-#endif
-
-    ctx->transp_status = get_bits1(&ctx->gb);
-#if IVI4_STREAM_ANALYSER
-    if (ctx->transp_status) {
-        ctx->has_transp = 1;
-    }
-#endif
-
-    /* unknown bit: Mac decoder ignores this bit, XANIM returns error */
-    if (get_bits1(&ctx->gb)) {
-        av_log(avctx, AV_LOG_ERROR, "Sync bit is set!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->data_size = get_bits1(&ctx->gb) ? get_bits(&ctx->gb, 24) : 0;
-
-    /* null frames don't contain anything else so we just return */
-    if (ctx->frame_type >= FRAMETYPE_NULL_FIRST) {
-        av_dlog(avctx, "Null frame encountered!\n");
-        return 0;
-    }
-
-    /* Check key lock status. If enabled - ignore lock word.         */
-    /* Usually we have to prompt the user for the password, but      */
-    /* we don't do that because Indeo 4 videos can be decoded anyway */
-    if (get_bits1(&ctx->gb)) {
-        skip_bits_long(&ctx->gb, 32);
-        av_dlog(avctx, "Password-protected clip!\n");
-    }
-
-    pic_size_indx = get_bits(&ctx->gb, 3);
-    if (pic_size_indx == IVI4_PIC_SIZE_ESC) {
-        pic_conf.pic_height = get_bits(&ctx->gb, 16);
-        pic_conf.pic_width  = get_bits(&ctx->gb, 16);
-    } else {
-        pic_conf.pic_height = ivi4_common_pic_sizes[pic_size_indx * 2 + 1];
-        pic_conf.pic_width  = ivi4_common_pic_sizes[pic_size_indx * 2    ];
-    }
-
-    /* Decode tile dimensions. */
-    if (get_bits1(&ctx->gb)) {
-        pic_conf.tile_height = scale_tile_size(pic_conf.pic_height, get_bits(&ctx->gb, 4));
-        pic_conf.tile_width  = scale_tile_size(pic_conf.pic_width,  get_bits(&ctx->gb, 4));
-#if IVI4_STREAM_ANALYSER
-        ctx->uses_tiling = 1;
-#endif
-    } else {
-        pic_conf.tile_height = pic_conf.pic_height;
-        pic_conf.tile_width  = pic_conf.pic_width;
-    }
-
-    /* Decode chroma subsampling. We support only 4:4 aka YVU9. */
-    if (get_bits(&ctx->gb, 2)) {
-        av_log(avctx, AV_LOG_ERROR, "Only YVU9 picture format is supported!\n");
-        return AVERROR_INVALIDDATA;
-    }
-    pic_conf.chroma_height = (pic_conf.pic_height + 3) >> 2;
-    pic_conf.chroma_width  = (pic_conf.pic_width  + 3) >> 2;
-
-    /* decode subdivision of the planes */
-    pic_conf.luma_bands = decode_plane_subdivision(&ctx->gb);
-    if (pic_conf.luma_bands)
-        pic_conf.chroma_bands = decode_plane_subdivision(&ctx->gb);
-    ctx->is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1;
-    if (ctx->is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) {
-        av_log(avctx, AV_LOG_ERROR, "Scalability: unsupported subdivision! Luma bands: %d, chroma bands: %d\n",
-               pic_conf.luma_bands, pic_conf.chroma_bands);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* check if picture layout was changed and reallocate buffers */
-    if (ivi_pic_config_cmp(&pic_conf, &ctx->pic_conf)) {
-        if (ff_ivi_init_planes(ctx->planes, &pic_conf)) {
-            av_log(avctx, AV_LOG_ERROR, "Couldn't reallocate color planes!\n");
-            ctx->pic_conf.luma_bands = 0;
-            return AVERROR(ENOMEM);
-        }
-
-        ctx->pic_conf = pic_conf;
-
-        /* set default macroblock/block dimensions */
-        for (p = 0; p <= 2; p++) {
-            for (i = 0; i < (!p ? pic_conf.luma_bands : pic_conf.chroma_bands); i++) {
-                ctx->planes[p].bands[i].mb_size  = !p ? (!ctx->is_scalable ? 16 : 8) : 4;
-                ctx->planes[p].bands[i].blk_size = !p ? 8 : 4;
-            }
-        }
-
-        if (ff_ivi_init_tiles(ctx->planes, ctx->pic_conf.tile_width,
-                              ctx->pic_conf.tile_height)) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Couldn't reallocate internal structures!\n");
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    ctx->frame_num = get_bits1(&ctx->gb) ? get_bits(&ctx->gb, 20) : 0;
-
-    /* skip decTimeEst field if present */
-    if (get_bits1(&ctx->gb))
-        skip_bits(&ctx->gb, 8);
-
-    /* decode macroblock and block huffman codebooks */
-    if (ff_ivi_dec_huff_desc(&ctx->gb, get_bits1(&ctx->gb), IVI_MB_HUFF,  &ctx->mb_vlc,  avctx) ||
-        ff_ivi_dec_huff_desc(&ctx->gb, get_bits1(&ctx->gb), IVI_BLK_HUFF, &ctx->blk_vlc, avctx))
-        return AVERROR_INVALIDDATA;
-
-    ctx->rvmap_sel = get_bits1(&ctx->gb) ? get_bits(&ctx->gb, 3) : 8;
-
-    ctx->in_imf = get_bits1(&ctx->gb);
-    ctx->in_q   = get_bits1(&ctx->gb);
-
-    ctx->pic_glob_quant = get_bits(&ctx->gb, 5);
-
-    /* TODO: ignore this parameter if unused */
-    ctx->unknown1 = get_bits1(&ctx->gb) ? get_bits(&ctx->gb, 3) : 0;
-
-    ctx->checksum = get_bits1(&ctx->gb) ? get_bits(&ctx->gb, 16) : 0;
-
-    /* skip picture header extension if any */
-    while (get_bits1(&ctx->gb)) {
-        av_dlog(avctx, "Pic hdr extension encountered!\n");
-        skip_bits(&ctx->gb, 8);
-    }
-
-    if (get_bits1(&ctx->gb)) {
-        av_log(avctx, AV_LOG_ERROR, "Bad blocks bits encountered!\n");
-    }
-
-    align_get_bits(&ctx->gb);
-
-    return 0;
-}
-
-
-/**
- *  Decode Indeo 4 band header.
- *
- *  @param[in,out] ctx       pointer to the decoder context
- *  @param[in,out] band      pointer to the band descriptor
- *  @param[in]     avctx     pointer to the AVCodecContext
- *  @return        result code: 0 = OK, negative number = error
- */
-static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
-                           AVCodecContext *avctx)
-{
-    int plane, band_num, indx, transform_id, scan_indx;
-    int i;
-
-    plane    = get_bits(&ctx->gb, 2);
-    band_num = get_bits(&ctx->gb, 4);
-    if (band->plane != plane || band->band_num != band_num) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid band header sequence!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    band->is_empty = get_bits1(&ctx->gb);
-    if (!band->is_empty) {
-        int old_blk_size = band->blk_size;
-        /* skip header size
-         * If header size is not given, header size is 4 bytes. */
-        if (get_bits1(&ctx->gb))
-            skip_bits(&ctx->gb, 16);
-
-        band->is_halfpel = get_bits(&ctx->gb, 2);
-        if (band->is_halfpel >= 2) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid/unsupported mv resolution: %d!\n",
-                   band->is_halfpel);
-            return AVERROR_INVALIDDATA;
-        }
-#if IVI4_STREAM_ANALYSER
-        if (!band->is_halfpel)
-            ctx->uses_fullpel = 1;
-#endif
-
-        band->checksum_present = get_bits1(&ctx->gb);
-        if (band->checksum_present)
-            band->checksum = get_bits(&ctx->gb, 16);
-
-        indx = get_bits(&ctx->gb, 2);
-        if (indx == 3) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid block size!\n");
-            return AVERROR_INVALIDDATA;
-        }
-        band->mb_size  = 16 >> indx;
-        band->blk_size = 8 >> (indx >> 1);
-
-        band->inherit_mv     = get_bits1(&ctx->gb);
-        band->inherit_qdelta = get_bits1(&ctx->gb);
-
-        band->glob_quant = get_bits(&ctx->gb, 5);
-
-        if (!get_bits1(&ctx->gb) || ctx->frame_type == FRAMETYPE_INTRA) {
-            transform_id = get_bits(&ctx->gb, 5);
-            if (transform_id >= FF_ARRAY_ELEMS(transforms) ||
-                !transforms[transform_id].inv_trans) {
-                avpriv_request_sample(avctx, "Transform %d", transform_id);
-                return AVERROR_PATCHWELCOME;
-            }
-            if ((transform_id >= 7 && transform_id <= 9) ||
-                 transform_id == 17) {
-                avpriv_request_sample(avctx, "DCT transform");
-                return AVERROR_PATCHWELCOME;
-            }
-
-#if IVI4_STREAM_ANALYSER
-            if ((transform_id >= 0 && transform_id <= 2) || transform_id == 10)
-                ctx->uses_haar = 1;
-#endif
-
-            band->inv_transform = transforms[transform_id].inv_trans;
-            band->dc_transform  = transforms[transform_id].dc_trans;
-            band->is_2d_trans   = transforms[transform_id].is_2d_trans;
-            if (transform_id < 10)
-                band->transform_size = 8;
-            else
-                band->transform_size = 4;
-
-            if (band->blk_size != band->transform_size)
-                return AVERROR_INVALIDDATA;
-
-            scan_indx = get_bits(&ctx->gb, 4);
-            if (scan_indx == 15) {
-                av_log(avctx, AV_LOG_ERROR, "Custom scan pattern encountered!\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (scan_indx > 4 && scan_indx < 10) {
-                if (band->blk_size != 4)
-                    return AVERROR_INVALIDDATA;
-            } else if (band->blk_size != 8)
-                return AVERROR_INVALIDDATA;
-
-            band->scan = scan_index_to_tab[scan_indx];
-
-            band->quant_mat = get_bits(&ctx->gb, 5);
-            if (band->quant_mat >= FF_ARRAY_ELEMS(quant_index_to_tab)) {
-
-                if (band->quant_mat == 31)
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Custom quant matrix encountered!\n");
-                else
-                    avpriv_request_sample(avctx, "Quantization matrix %d",
-                                          band->quant_mat);
-                band->quant_mat = -1;
-                return AVERROR_INVALIDDATA;
-            }
-        } else {
-            if (old_blk_size != band->blk_size) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "The band block size does not match the configuration "
-                       "inherited\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (band->quant_mat < 0) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid quant_mat inherited\n");
-                return AVERROR_INVALIDDATA;
-            }
-        }
-
-        /* decode block huffman codebook */
-        if (!get_bits1(&ctx->gb))
-            band->blk_vlc.tab = ctx->blk_vlc.tab;
-        else
-            if (ff_ivi_dec_huff_desc(&ctx->gb, 1, IVI_BLK_HUFF,
-                                     &band->blk_vlc, avctx))
-                return AVERROR_INVALIDDATA;
-
-        /* select appropriate rvmap table for this band */
-        band->rvmap_sel = get_bits1(&ctx->gb) ? get_bits(&ctx->gb, 3) : 8;
-
-        /* decode rvmap probability corrections if any */
-        band->num_corr = 0; /* there is no corrections */
-        if (get_bits1(&ctx->gb)) {
-            band->num_corr = get_bits(&ctx->gb, 8); /* get number of correction pairs */
-            if (band->num_corr > 61) {
-                av_log(avctx, AV_LOG_ERROR, "Too many corrections: %d\n",
-                       band->num_corr);
-                return AVERROR_INVALIDDATA;
-            }
-
-            /* read correction pairs */
-            for (i = 0; i < band->num_corr * 2; i++)
-                band->corr[i] = get_bits(&ctx->gb, 8);
-        }
-    }
-
-    if (band->blk_size == 8) {
-        band->intra_base = &ivi4_quant_8x8_intra[quant_index_to_tab[band->quant_mat]][0];
-        band->inter_base = &ivi4_quant_8x8_inter[quant_index_to_tab[band->quant_mat]][0];
-    } else {
-        band->intra_base = &ivi4_quant_4x4_intra[quant_index_to_tab[band->quant_mat]][0];
-        band->inter_base = &ivi4_quant_4x4_inter[quant_index_to_tab[band->quant_mat]][0];
-    }
-
-    /* Indeo 4 doesn't use scale tables */
-    band->intra_scale = NULL;
-    band->inter_scale = NULL;
-
-    align_get_bits(&ctx->gb);
-
-    return 0;
-}
-
-
-/**
- *  Decode information (block type, cbp, quant delta, motion vector)
- *  for all macroblocks in the current tile.
- *
- *  @param[in,out] ctx       pointer to the decoder context
- *  @param[in,out] band      pointer to the band descriptor
- *  @param[in,out] tile      pointer to the tile descriptor
- *  @param[in]     avctx     pointer to the AVCodecContext
- *  @return        result code: 0 = OK, negative number = error
- */
-static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
-                          IVITile *tile, AVCodecContext *avctx)
-{
-    int         x, y, mv_x, mv_y, mv_delta, offs, mb_offset, blks_per_mb,
-                mv_scale, mb_type_bits;
-    IVIMbInfo   *mb, *ref_mb;
-    int         row_offset = band->mb_size * band->pitch;
-
-    mb     = tile->mbs;
-    ref_mb = tile->ref_mbs;
-    offs   = tile->ypos * band->pitch + tile->xpos;
-
-    blks_per_mb  = band->mb_size   != band->blk_size  ? 4 : 1;
-    mb_type_bits = ctx->frame_type == FRAMETYPE_BIDIR ? 2 : 1;
-
-    /* scale factor for motion vectors */
-    mv_scale = (ctx->planes[0].bands[0].mb_size >> 3) - (band->mb_size >> 3);
-    mv_x = mv_y = 0;
-
-    for (y = tile->ypos; y < tile->ypos + tile->height; y += band->mb_size) {
-        mb_offset = offs;
-
-        for (x = tile->xpos; x < tile->xpos + tile->width; x += band->mb_size) {
-            mb->xpos     = x;
-            mb->ypos     = y;
-            mb->buf_offs = mb_offset;
-
-            if (get_bits1(&ctx->gb)) {
-                if (ctx->frame_type == FRAMETYPE_INTRA) {
-                    av_log(avctx, AV_LOG_ERROR, "Empty macroblock in an INTRA picture!\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                mb->type = 1; /* empty macroblocks are always INTER */
-                mb->cbp  = 0; /* all blocks are empty */
-
-                mb->q_delta = 0;
-                if (!band->plane && !band->band_num && ctx->in_q) {
-                    mb->q_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
-                                           IVI_VLC_BITS, 1);
-                    mb->q_delta = IVI_TOSIGNED(mb->q_delta);
-                }
-
-                mb->mv_x = mb->mv_y = 0; /* no motion vector coded */
-                if (band->inherit_mv && ref_mb) {
-                    /* motion vector inheritance */
-                    if (mv_scale) {
-                        mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
-                        mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
-                    } else {
-                        mb->mv_x = ref_mb->mv_x;
-                        mb->mv_y = ref_mb->mv_y;
-                    }
-                }
-            } else {
-                if (band->inherit_mv) {
-                    /* copy mb_type from corresponding reference mb */
-                    if (!ref_mb)
-                        return AVERROR_INVALIDDATA;
-                    mb->type = ref_mb->type;
-                } else if (ctx->frame_type == FRAMETYPE_INTRA ||
-                           ctx->frame_type == FRAMETYPE_INTRA1) {
-                    mb->type = 0; /* mb_type is always INTRA for intra-frames */
-                } else {
-                    mb->type = get_bits(&ctx->gb, mb_type_bits);
-                }
-
-                mb->cbp = get_bits(&ctx->gb, blks_per_mb);
-
-                mb->q_delta = 0;
-                if (band->inherit_qdelta) {
-                    if (ref_mb) mb->q_delta = ref_mb->q_delta;
-                } else if (mb->cbp || (!band->plane && !band->band_num &&
-                           ctx->in_q)) {
-                    mb->q_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
-                                           IVI_VLC_BITS, 1);
-                    mb->q_delta = IVI_TOSIGNED(mb->q_delta);
-                }
-
-                if (!mb->type) {
-                    mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */
-                } else {
-                    if (band->inherit_mv) {
-                        if (ref_mb)
-                            /* motion vector inheritance */
-                            if (mv_scale) {
-                                mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
-                                mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
-                            } else {
-                                mb->mv_x = ref_mb->mv_x;
-                                mb->mv_y = ref_mb->mv_y;
-                            }
-                    } else {
-                        /* decode motion vector deltas */
-                        mv_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
-                                            IVI_VLC_BITS, 1);
-                        mv_y += IVI_TOSIGNED(mv_delta);
-                        mv_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
-                                            IVI_VLC_BITS, 1);
-                        mv_x += IVI_TOSIGNED(mv_delta);
-                        mb->mv_x = mv_x;
-                        mb->mv_y = mv_y;
-                    }
-                }
-            }
-
-            mb++;
-            if (ref_mb)
-                ref_mb++;
-            mb_offset += band->mb_size;
-        }
-
-        offs += row_offset;
-    }
-
-    align_get_bits(&ctx->gb);
-
-    return 0;
-}
-
-
-/**
- *  Rearrange decoding and reference buffers.
- *
- *  @param[in,out] ctx       pointer to the decoder context
- */
-static void switch_buffers(IVI45DecContext *ctx)
-{
-    switch (ctx->prev_frame_type) {
-    case FRAMETYPE_INTRA:
-    case FRAMETYPE_INTRA1:
-    case FRAMETYPE_INTER:
-        ctx->buf_switch ^= 1;
-        ctx->dst_buf     = ctx->buf_switch;
-        ctx->ref_buf     = ctx->buf_switch ^ 1;
-        break;
-    case FRAMETYPE_INTER_NOREF:
-        break;
-    }
-
-    switch (ctx->frame_type) {
-    case FRAMETYPE_INTRA:
-    case FRAMETYPE_INTRA1:
-        ctx->buf_switch = 0;
-        /* FALLTHROUGH */
-    case FRAMETYPE_INTER:
-        ctx->dst_buf = ctx->buf_switch;
-        ctx->ref_buf = ctx->buf_switch ^ 1;
-        break;
-    case FRAMETYPE_INTER_NOREF:
-    case FRAMETYPE_NULL_FIRST:
-    case FRAMETYPE_NULL_LAST:
-        break;
-    }
-}
-
-
-static int is_nonnull_frame(IVI45DecContext *ctx)
-{
-    return ctx->frame_type < FRAMETYPE_NULL_FIRST;
-}
-
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    IVI45DecContext *ctx = avctx->priv_data;
-
-    ff_ivi_init_static_vlc();
-
-    /* copy rvmap tables in our context so we can apply changes to them */
-    memcpy(ctx->rvmap_tabs, ff_ivi_rvmap_tabs, sizeof(ff_ivi_rvmap_tabs));
-
-    /* Force allocation of the internal buffers */
-    /* during picture header decoding.          */
-    ctx->pic_conf.pic_width  = 0;
-    ctx->pic_conf.pic_height = 0;
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV410P;
-
-    ctx->decode_pic_hdr   = decode_pic_hdr;
-    ctx->decode_band_hdr  = decode_band_hdr;
-    ctx->decode_mb_info   = decode_mb_info;
-    ctx->switch_buffers   = switch_buffers;
-    ctx->is_nonnull_frame = is_nonnull_frame;
-
-    return 0;
-}
-
-
-AVCodec ff_indeo4_decoder = {
-    .name           = "indeo4",
-    .long_name      = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 4"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_INDEO4,
-    .priv_data_size = sizeof(IVI45DecContext),
-    .init           = decode_init,
-    .close          = ff_ivi_decode_close,
-    .decode         = ff_ivi_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/indeo4data.h b/deps/libav/libavcodec/indeo4data.h
deleted file mode 100644
index 9b8945a..0000000
--- a/deps/libav/libavcodec/indeo4data.h
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Indeo Video Interactive 4 compatible decoder
- * Copyright (c) 2009-2010 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This file contains data needed for the Indeo 4 decoder.
- */
-
-#ifndef AVCODEC_INDEO4DATA_H
-#define AVCODEC_INDEO4DATA_H
-
-#include <stdint.h>
-#include "dsputil.h"
-#include "ivi_common.h"
-
-/**
- *  standard picture dimensions
- */
-static const uint16_t ivi4_common_pic_sizes[14] = {
-    640, 480, 320, 240, 160, 120, 704, 480, 352, 240, 352, 288, 176, 144
-};
-
-/**
- *  Indeo 4 8x8 scan (zigzag) patterns
- */
-static const uint8_t ivi4_alternate_scan_8x8[64] = {
-     0,  8,  1,  9, 16, 24,  2,  3, 17, 25, 10, 11, 32, 40, 48, 56,
-     4,  5,  6,  7, 33, 41, 49, 57, 18, 19, 26, 27, 12, 13, 14, 15,
-    34, 35, 43, 42, 50, 51, 59, 58, 20, 21, 22, 23, 31, 30, 29, 28,
-    36, 37, 38, 39, 47, 46, 45, 44, 52, 53, 54, 55, 63, 62, 61, 60
-};
-
-static const uint8_t ivi4_alternate_scan_4x4[16] = {
-    0, 1, 4, 5, 8, 12, 2, 3, 9, 13, 6, 7, 10, 11, 14, 15
-};
-
-static const uint8_t ivi4_vertical_scan_4x4[16] = {
-    0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15
-};
-
-static const uint8_t ivi4_horizontal_scan_4x4[16] = {
-    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
-};
-
-static const uint8_t *scan_index_to_tab[15] = {
-    // for 8x8 transforms
-    ff_zigzag_direct,
-    ivi4_alternate_scan_8x8,
-    ff_ivi_horizontal_scan_8x8,
-    ff_ivi_vertical_scan_8x8,
-    ff_zigzag_direct,
-
-    // for 4x4 transforms
-    ff_ivi_direct_scan_4x4,
-    ivi4_alternate_scan_4x4,
-    ivi4_vertical_scan_4x4,
-    ivi4_horizontal_scan_4x4,
-    ff_ivi_direct_scan_4x4,
-
-    // TODO: check if those are needed
-    ff_ivi_horizontal_scan_8x8,
-    ff_ivi_horizontal_scan_8x8,
-    ff_ivi_horizontal_scan_8x8,
-    ff_ivi_horizontal_scan_8x8,
-    ff_ivi_horizontal_scan_8x8
-};
-
-/**
- *  Indeo 4 dequant tables
- */
-static const uint16_t ivi4_quant_8x8_intra[9][64] = {
-  {
-      43,  342,  385,  470,  555,  555,  598,  726,
-     342,  342,  470,  513,  555,  598,  726,  769,
-     385,  470,  555,  555,  598,  726,  726,  811,
-     470,  470,  555,  555,  598,  726,  769,  854,
-     470,  555,  555,  598,  683,  726,  854, 1025,
-     555,  555,  598,  683,  726,  854, 1025, 1153,
-     555,  555,  598,  726,  811,  982, 1195, 1451,
-     555,  598,  726,  811,  982, 1195, 1451, 1793
-  },
-  {
-      86, 1195, 2390, 2390, 4865, 4865, 4865, 4865,
-    1195, 1195, 2390, 2390, 4865, 4865, 4865, 4865,
-    2390, 2390, 4865, 4865, 6827, 6827, 6827, 6827,
-    2390, 2390, 4865, 4865, 6827, 6827, 6827, 6827,
-    4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827,
-    4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827,
-    4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827,
-    4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827
-  },
-  {
-     235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
-     235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
-     235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
-     235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
-     235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
-     235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
-     235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
-     235, 1067, 1195, 1323, 1451, 1579, 1707, 1835
-  },
-  {
-    1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
-    1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
-    1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
-    1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
-    1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
-    1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
-    1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
-    1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414
-  },
-  {
-     897,  897,  897,  897,  897,  897,  897,  897,
-    1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-    1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238,
-    1409, 1409, 1409, 1409, 1409, 1409, 1409, 1409,
-    1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579,
-    1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
-    1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921,
-    2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091
-  },
-  {
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-    3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
-    3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
-    3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
-    3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
-    3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
-    3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414
-  },
-  {
-    2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
-    2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
-    2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
-    2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
-    2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
-    2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
-    2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
-    2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390
-  },
-  {
-      22,  171,  214,  257,  257,  299,  299,  342,
-     171,  171,  257,  257,  299,  299,  342,  385,
-     214,  257,  257,  299,  299,  342,  342,  385,
-     257,  257,  257,  299,  299,  342,  385,  427,
-     257,  257,  299,  299,  342,  385,  427,  513,
-     257,  299,  299,  342,  385,  427,  513,  598,
-     299,  299,  299,  385,  385,  470,  598,  726,
-     299,  299,  385,  385,  470,  598,  726,  897
-  },
-  {
-      86,  598, 1195, 1195, 2390, 2390, 2390, 2390,
-     598,  598, 1195, 1195, 2390, 2390, 2390, 2390,
-    1195, 1195, 2390, 2390, 3414, 3414, 3414, 3414,
-    1195, 1195, 2390, 2390, 3414, 3414, 3414, 3414,
-    2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414,
-    2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414,
-    2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414,
-    2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414
-  }
-};
-
-static const uint16_t ivi4_quant_8x8_inter[9][64] = {
-  {
-     427,  427,  470,  427,  427,  427,  470,  470,
-     427,  427,  470,  427,  427,  427,  470,  470,
-     470,  470,  470,  470,  470,  470,  470,  470,
-     427,  427,  470,  470,  427,  427,  470,  470,
-     427,  427,  470,  427,  427,  427,  470,  470,
-     427,  427,  470,  427,  427,  427,  470,  470,
-     470,  470,  470,  470,  470,  470,  470,  470,
-     470,  470,  470,  470,  470,  470,  470,  470
-  },
-  {
-    1707, 1707, 2433, 2433, 3414, 3414, 3414, 3414,
-    1707, 1707, 2433, 2433, 3414, 3414, 3414, 3414,
-    2433, 2433, 3414, 3414, 4822, 4822, 4822, 4822,
-    2433, 2433, 3414, 3414, 4822, 4822, 4822, 4822,
-    3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414,
-    3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414,
-    3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414,
-    3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414
-  },
-  {
-    1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
-    1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
-    1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
-    1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
-    1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
-    1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
-    1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
-    1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281
-  },
-  {
-    2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
-    2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
-    2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
-    2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
-    2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
-    2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
-    2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
-    2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433
-  },
-  {
-    1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
-    1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
-    1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281,
-    1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238,
-    1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
-    1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
-    1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281,
-    1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281
-  },
-  {
-    2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
-    2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
-    3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
-    3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
-    2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
-    2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
-    2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
-    2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433
-  },
-  {
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-    1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707
-  },
-  {
-      86,  171,  171,  214,  214,  214,  214,  257,
-     171,  171,  214,  214,  214,  214,  257,  257,
-     171,  214,  214,  214,  214,  257,  257,  257,
-     214,  214,  214,  214,  257,  257,  257,  299,
-     214,  214,  214,  257,  257,  257,  299,  299,
-     214,  214,  257,  257,  257,  299,  299,  299,
-     214,  257,  257,  257,  299,  299,  299,  342,
-     257,  257,  257,  299,  299,  299,  342,  342
-  },
-  {
-     854,  854, 1195, 1195, 1707, 1707, 1707, 1707,
-     854,  854, 1195, 1195, 1707, 1707, 1707, 1707,
-    1195, 1195, 1707, 1707, 2390, 2390, 2390, 2390,
-    1195, 1195, 1707, 1707, 2390, 2390, 2390, 2390,
-    1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707,
-    1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707,
-    1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707,
-    1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707
-  }
-};
-
-static const uint16_t ivi4_quant_4x4_intra[5][16] = {
-  {
-      22,  214,  257,  299,
-     214,  257,  299,  342,
-     257,  299,  342,  427,
-     299,  342,  427,  513
-  },
-  {
-     129, 1025, 1451, 1451,
-    1025, 1025, 1451, 1451,
-    1451, 1451, 2049, 2049,
-    1451, 1451, 2049, 2049
-  },
-  {
-      43,  171,  171,  171,
-      43,  171,  171,  171,
-      43,  171,  171,  171,
-      43,  171,  171,  171
-  },
-  {
-      43,   43,   43,   43,
-     171,  171,  171,  171,
-     171,  171,  171,  171,
-     171,  171,  171,  171
-  },
-  {
-      43,   43,   43,   43,
-      43,   43,   43,   43,
-      43,   43,   43,   43,
-      43,   43,   43,   43
-  }
-};
-
-static const uint16_t ivi4_quant_4x4_inter[5][16] = {
-  {
-     107,  214,  257,  299,
-     214,  257,  299,  299,
-     257,  299,  299,  342,
-     299,  299,  342,  342
-  },
-  {
-     513, 1025, 1238, 1238,
-    1025, 1025, 1238, 1238,
-    1238, 1238, 1451, 1451,
-    1238, 1238, 1451, 1451
-  },
-  {
-      43,  171,  171,  171,
-      43,  171,  171,  171,
-      43,  171,  171,  171,
-      43,  171,  171,  171
-  },
-  {
-      43,   43,   43,   43,
-     171,  171,  171,  171,
-     171,  171,  171,  171,
-     171,  171,  171,  171
-  },
-  {
-      43,   43,   43,   43,
-      43,   43,   43,   43,
-      43,   43,   43,   43,
-      43,   43,   43,   43
-  }
-};
-
-/**
- *  Table for mapping quant matrix index from the bitstream
- *  into internal quant table number.
- */
-static const uint8_t quant_index_to_tab[22] = {
-    0, 1, 0, 2, 1, 3, 0, 4, 1, 5, 0, 1, 6, 7, 8, // for 8x8 quant matrixes
-    0, 1, 2, 2, 3, 3, 4                          // for 4x4 quant matrixes
-};
-
-#endif /* AVCODEC_INDEO4DATA_H */
diff --git a/deps/libav/libavcodec/indeo5.c b/deps/libav/libavcodec/indeo5.c
deleted file mode 100644
index 83bbcbb..0000000
--- a/deps/libav/libavcodec/indeo5.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- * Indeo Video Interactive v5 compatible decoder
- * Copyright (c) 2009 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Indeo Video Interactive version 5 decoder
- *
- * Indeo5 data is usually transported within .avi or .mov files.
- * Known FOURCCs: 'IV50'
- */
-
-#define BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "ivi_dsp.h"
-#include "ivi_common.h"
-#include "indeo5data.h"
-
-/**
- *  Indeo5 frame types.
- */
-enum {
-    FRAMETYPE_INTRA       = 0,
-    FRAMETYPE_INTER       = 1,  ///< non-droppable P-frame
-    FRAMETYPE_INTER_SCAL  = 2,  ///< droppable P-frame used in the scalability mode
-    FRAMETYPE_INTER_NOREF = 3,  ///< droppable P-frame
-    FRAMETYPE_NULL        = 4   ///< empty frame with no data
-};
-
-#define IVI5_PIC_SIZE_ESC       15
-
-/**
- *  Decode Indeo5 GOP (Group of pictures) header.
- *  This header is present in key frames only.
- *  It defines parameters for all frames in a GOP.
- *
- *  @param[in,out] ctx    ptr to the decoder context
- *  @param[in]     avctx  ptr to the AVCodecContext
- *  @return         result code: 0 = OK, -1 = error
- */
-static int decode_gop_header(IVI45DecContext *ctx, AVCodecContext *avctx)
-{
-    int             result, i, p, tile_size, pic_size_indx, mb_size, blk_size;
-    int             quant_mat, blk_size_changed = 0;
-    IVIBandDesc     *band, *band1, *band2;
-    IVIPicConfig    pic_conf;
-
-    ctx->gop_flags = get_bits(&ctx->gb, 8);
-
-    ctx->gop_hdr_size = (ctx->gop_flags & 1) ? get_bits(&ctx->gb, 16) : 0;
-
-    if (ctx->gop_flags & IVI5_IS_PROTECTED)
-        ctx->lock_word = get_bits_long(&ctx->gb, 32);
-
-    tile_size = (ctx->gop_flags & 0x40) ? 64 << get_bits(&ctx->gb, 2) : 0;
-    if (tile_size > 256) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid tile size: %d\n", tile_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* decode number of wavelet bands */
-    /* num_levels * 3 + 1 */
-    pic_conf.luma_bands   = get_bits(&ctx->gb, 2) * 3 + 1;
-    pic_conf.chroma_bands = get_bits1(&ctx->gb)   * 3 + 1;
-    ctx->is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1;
-    if (ctx->is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) {
-        av_log(avctx, AV_LOG_ERROR, "Scalability: unsupported subdivision! Luma bands: %d, chroma bands: %d\n",
-               pic_conf.luma_bands, pic_conf.chroma_bands);
-        return AVERROR_INVALIDDATA;
-    }
-
-    pic_size_indx = get_bits(&ctx->gb, 4);
-    if (pic_size_indx == IVI5_PIC_SIZE_ESC) {
-        pic_conf.pic_height = get_bits(&ctx->gb, 13);
-        pic_conf.pic_width  = get_bits(&ctx->gb, 13);
-    } else {
-        pic_conf.pic_height = ivi5_common_pic_sizes[pic_size_indx * 2 + 1] << 2;
-        pic_conf.pic_width  = ivi5_common_pic_sizes[pic_size_indx * 2    ] << 2;
-    }
-
-    if (ctx->gop_flags & 2) {
-        avpriv_report_missing_feature(avctx, "YV12 picture format");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    pic_conf.chroma_height = (pic_conf.pic_height + 3) >> 2;
-    pic_conf.chroma_width  = (pic_conf.pic_width  + 3) >> 2;
-
-    if (!tile_size) {
-        pic_conf.tile_height = pic_conf.pic_height;
-        pic_conf.tile_width  = pic_conf.pic_width;
-    } else {
-        pic_conf.tile_height = pic_conf.tile_width = tile_size;
-    }
-
-    /* check if picture layout was changed and reallocate buffers */
-    if (ivi_pic_config_cmp(&pic_conf, &ctx->pic_conf) || ctx->gop_invalid) {
-        result = ff_ivi_init_planes(ctx->planes, &pic_conf);
-        if (result < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Couldn't reallocate color planes!\n");
-            return result;
-        }
-        ctx->pic_conf = pic_conf;
-        blk_size_changed = 1; /* force reallocation of the internal structures */
-    }
-
-    for (p = 0; p <= 1; p++) {
-        for (i = 0; i < (!p ? pic_conf.luma_bands : pic_conf.chroma_bands); i++) {
-            band = &ctx->planes[p].bands[i];
-
-            band->is_halfpel = get_bits1(&ctx->gb);
-
-            mb_size  = get_bits1(&ctx->gb);
-            blk_size = 8 >> get_bits1(&ctx->gb);
-            mb_size  = blk_size << !mb_size;
-
-            blk_size_changed = mb_size != band->mb_size || blk_size != band->blk_size;
-            if (blk_size_changed) {
-                band->mb_size  = mb_size;
-                band->blk_size = blk_size;
-            }
-
-            if (get_bits1(&ctx->gb)) {
-                avpriv_report_missing_feature(avctx, "Extended transform info");
-                return AVERROR_PATCHWELCOME;
-            }
-
-            /* select transform function and scan pattern according to plane and band number */
-            switch ((p << 2) + i) {
-            case 0:
-                band->inv_transform  = ff_ivi_inverse_slant_8x8;
-                band->dc_transform   = ff_ivi_dc_slant_2d;
-                band->scan           = ff_zigzag_direct;
-                band->transform_size = 8;
-                break;
-
-            case 1:
-                band->inv_transform  = ff_ivi_row_slant8;
-                band->dc_transform   = ff_ivi_dc_row_slant;
-                band->scan           = ff_ivi_vertical_scan_8x8;
-                band->transform_size = 8;
-                break;
-
-            case 2:
-                band->inv_transform  = ff_ivi_col_slant8;
-                band->dc_transform   = ff_ivi_dc_col_slant;
-                band->scan           = ff_ivi_horizontal_scan_8x8;
-                band->transform_size = 8;
-                break;
-
-            case 3:
-                band->inv_transform  = ff_ivi_put_pixels_8x8;
-                band->dc_transform   = ff_ivi_put_dc_pixel_8x8;
-                band->scan           = ff_ivi_horizontal_scan_8x8;
-                band->transform_size = 8;
-                break;
-
-            case 4:
-                band->inv_transform  = ff_ivi_inverse_slant_4x4;
-                band->dc_transform   = ff_ivi_dc_slant_2d;
-                band->scan           = ff_ivi_direct_scan_4x4;
-                band->transform_size = 4;
-                break;
-            }
-
-            band->is_2d_trans = band->inv_transform == ff_ivi_inverse_slant_8x8 ||
-                                band->inv_transform == ff_ivi_inverse_slant_4x4;
-
-            if (band->transform_size != band->blk_size)
-                return AVERROR_INVALIDDATA;
-
-            /* select dequant matrix according to plane and band number */
-            if (!p) {
-                quant_mat = (pic_conf.luma_bands > 1) ? i+1 : 0;
-            } else {
-                quant_mat = 5;
-            }
-
-            if (band->blk_size == 8) {
-                band->intra_base  = &ivi5_base_quant_8x8_intra[quant_mat][0];
-                band->inter_base  = &ivi5_base_quant_8x8_inter[quant_mat][0];
-                band->intra_scale = &ivi5_scale_quant_8x8_intra[quant_mat][0];
-                band->inter_scale = &ivi5_scale_quant_8x8_inter[quant_mat][0];
-            } else {
-                band->intra_base  = ivi5_base_quant_4x4_intra;
-                band->inter_base  = ivi5_base_quant_4x4_inter;
-                band->intra_scale = ivi5_scale_quant_4x4_intra;
-                band->inter_scale = ivi5_scale_quant_4x4_inter;
-            }
-
-            if (get_bits(&ctx->gb, 2)) {
-                av_log(avctx, AV_LOG_ERROR, "End marker missing!\n");
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-
-    /* copy chroma parameters into the 2nd chroma plane */
-    for (i = 0; i < pic_conf.chroma_bands; i++) {
-        band1 = &ctx->planes[1].bands[i];
-        band2 = &ctx->planes[2].bands[i];
-
-        band2->width         = band1->width;
-        band2->height        = band1->height;
-        band2->mb_size       = band1->mb_size;
-        band2->blk_size      = band1->blk_size;
-        band2->is_halfpel    = band1->is_halfpel;
-        band2->intra_base    = band1->intra_base;
-        band2->inter_base    = band1->inter_base;
-        band2->intra_scale   = band1->intra_scale;
-        band2->inter_scale   = band1->inter_scale;
-        band2->scan          = band1->scan;
-        band2->inv_transform = band1->inv_transform;
-        band2->dc_transform  = band1->dc_transform;
-        band2->is_2d_trans   = band1->is_2d_trans;
-    }
-
-    /* reallocate internal structures if needed */
-    if (blk_size_changed) {
-        result = ff_ivi_init_tiles(ctx->planes, pic_conf.tile_width,
-                                   pic_conf.tile_height);
-        if (result < 0) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Couldn't reallocate internal structures!\n");
-            return result;
-        }
-    }
-
-    if (ctx->gop_flags & 8) {
-        if (get_bits(&ctx->gb, 3)) {
-            av_log(avctx, AV_LOG_ERROR, "Alignment bits are not zero!\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (get_bits1(&ctx->gb))
-            skip_bits_long(&ctx->gb, 24); /* skip transparency fill color */
-    }
-
-    align_get_bits(&ctx->gb);
-
-    skip_bits(&ctx->gb, 23); /* FIXME: unknown meaning */
-
-    /* skip GOP extension if any */
-    if (get_bits1(&ctx->gb)) {
-        do {
-            i = get_bits(&ctx->gb, 16);
-        } while (i & 0x8000);
-    }
-
-    align_get_bits(&ctx->gb);
-
-    return 0;
-}
-
-
-/**
- *  Skip a header extension.
- *
- *  @param[in,out]  gb  the GetBit context
- */
-static inline void skip_hdr_extension(GetBitContext *gb)
-{
-    int i, len;
-
-    do {
-        len = get_bits(gb, 8);
-        for (i = 0; i < len; i++) skip_bits(gb, 8);
-    } while(len);
-}
-
-
-/**
- *  Decode Indeo5 picture header.
- *
- *  @param[in,out]  ctx    ptr to the decoder context
- *  @param[in]      avctx  ptr to the AVCodecContext
- *  @return         result code: 0 = OK, -1 = error
- */
-static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
-{
-    int ret;
-
-    if (get_bits(&ctx->gb, 5) != 0x1F) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid picture start code!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->prev_frame_type = ctx->frame_type;
-    ctx->frame_type      = get_bits(&ctx->gb, 3);
-    if (ctx->frame_type >= 5) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame type: %d \n", ctx->frame_type);
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->frame_num = get_bits(&ctx->gb, 8);
-
-    if (ctx->frame_type == FRAMETYPE_INTRA) {
-        if ((ret = decode_gop_header(ctx, avctx)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid GOP header, skipping frames.\n");
-            ctx->gop_invalid = 1;
-            return ret;
-        }
-        ctx->gop_invalid = 0;
-    }
-
-    if (ctx->frame_type != FRAMETYPE_NULL) {
-        ctx->frame_flags = get_bits(&ctx->gb, 8);
-
-        ctx->pic_hdr_size = (ctx->frame_flags & 1) ? get_bits_long(&ctx->gb, 24) : 0;
-
-        ctx->checksum = (ctx->frame_flags & 0x10) ? get_bits(&ctx->gb, 16) : 0;
-
-        /* skip unknown extension if any */
-        if (ctx->frame_flags & 0x20)
-            skip_hdr_extension(&ctx->gb); /* XXX: untested */
-
-        /* decode macroblock huffman codebook */
-        ret = ff_ivi_dec_huff_desc(&ctx->gb, ctx->frame_flags & 0x40,
-                                   IVI_MB_HUFF, &ctx->mb_vlc, avctx);
-        if (ret < 0)
-            return ret;
-
-        skip_bits(&ctx->gb, 3); /* FIXME: unknown meaning! */
-    }
-
-    align_get_bits(&ctx->gb);
-
-    return 0;
-}
-
-
-/**
- *  Decode Indeo5 band header.
- *
- *  @param[in,out]  ctx    ptr to the decoder context
- *  @param[in,out]  band   ptr to the band descriptor
- *  @param[in]      avctx  ptr to the AVCodecContext
- *  @return         result code: 0 = OK, -1 = error
- */
-static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
-                           AVCodecContext *avctx)
-{
-    int         i, ret;
-    uint8_t     band_flags;
-
-    band_flags = get_bits(&ctx->gb, 8);
-
-    if (band_flags & 1) {
-        band->is_empty = 1;
-        return 0;
-    }
-
-    band->data_size = (ctx->frame_flags & 0x80) ? get_bits_long(&ctx->gb, 24) : 0;
-
-    band->inherit_mv     = band_flags & 2;
-    band->inherit_qdelta = band_flags & 8;
-    band->qdelta_present = band_flags & 4;
-    if (!band->qdelta_present) band->inherit_qdelta = 1;
-
-    /* decode rvmap probability corrections if any */
-    band->num_corr = 0; /* there are no corrections */
-    if (band_flags & 0x10) {
-        band->num_corr = get_bits(&ctx->gb, 8); /* get number of correction pairs */
-        if (band->num_corr > 61) {
-            av_log(avctx, AV_LOG_ERROR, "Too many corrections: %d\n",
-                   band->num_corr);
-            return AVERROR_INVALIDDATA;
-        }
-
-        /* read correction pairs */
-        for (i = 0; i < band->num_corr * 2; i++)
-            band->corr[i] = get_bits(&ctx->gb, 8);
-    }
-
-    /* select appropriate rvmap table for this band */
-    band->rvmap_sel = (band_flags & 0x40) ? get_bits(&ctx->gb, 3) : 8;
-
-    /* decode block huffman codebook */
-    ret = ff_ivi_dec_huff_desc(&ctx->gb, band_flags & 0x80, IVI_BLK_HUFF,
-                               &band->blk_vlc, avctx);
-    if (ret < 0)
-        return ret;
-
-    band->checksum_present = get_bits1(&ctx->gb);
-    if (band->checksum_present)
-        band->checksum = get_bits(&ctx->gb, 16);
-
-    band->glob_quant = get_bits(&ctx->gb, 5);
-
-    /* skip unknown extension if any */
-    if (band_flags & 0x20) { /* XXX: untested */
-        align_get_bits(&ctx->gb);
-        skip_hdr_extension(&ctx->gb);
-    }
-
-    align_get_bits(&ctx->gb);
-
-    return 0;
-}
-
-
-/**
- *  Decode info (block type, cbp, quant delta, motion vector)
- *  for all macroblocks in the current tile.
- *
- *  @param[in,out]  ctx    ptr to the decoder context
- *  @param[in,out]  band   ptr to the band descriptor
- *  @param[in,out]  tile   ptr to the tile descriptor
- *  @param[in]      avctx  ptr to the AVCodecContext
- *  @return         result code: 0 = OK, -1 = error
- */
-static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
-                          IVITile *tile, AVCodecContext *avctx)
-{
-    int         x, y, mv_x, mv_y, mv_delta, offs, mb_offset,
-                mv_scale, blks_per_mb;
-    IVIMbInfo   *mb, *ref_mb;
-    int         row_offset = band->mb_size * band->pitch;
-
-    mb     = tile->mbs;
-    ref_mb = tile->ref_mbs;
-    offs   = tile->ypos * band->pitch + tile->xpos;
-
-    if (!ref_mb &&
-        ((band->qdelta_present && band->inherit_qdelta) || band->inherit_mv))
-        return AVERROR_INVALIDDATA;
-
-    if (tile->num_MBs != IVI_MBs_PER_TILE(tile->width, tile->height, band->mb_size)) {
-        av_log(avctx, AV_LOG_ERROR, "Allocated tile size %d mismatches parameters %d\n",
-               tile->num_MBs, IVI_MBs_PER_TILE(tile->width, tile->height, band->mb_size));
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* scale factor for motion vectors */
-    mv_scale = (ctx->planes[0].bands[0].mb_size >> 3) - (band->mb_size >> 3);
-    mv_x = mv_y = 0;
-
-    for (y = tile->ypos; y < (tile->ypos + tile->height); y += band->mb_size) {
-        mb_offset = offs;
-
-        for (x = tile->xpos; x < (tile->xpos + tile->width); x += band->mb_size) {
-            mb->xpos     = x;
-            mb->ypos     = y;
-            mb->buf_offs = mb_offset;
-
-            if (get_bits1(&ctx->gb)) {
-                if (ctx->frame_type == FRAMETYPE_INTRA) {
-                    av_log(avctx, AV_LOG_ERROR, "Empty macroblock in an INTRA picture!\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                mb->type = 1; /* empty macroblocks are always INTER */
-                mb->cbp  = 0; /* all blocks are empty */
-
-                mb->q_delta = 0;
-                if (!band->plane && !band->band_num && (ctx->frame_flags & 8)) {
-                    mb->q_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
-                                           IVI_VLC_BITS, 1);
-                    mb->q_delta = IVI_TOSIGNED(mb->q_delta);
-                }
-
-                mb->mv_x = mb->mv_y = 0; /* no motion vector coded */
-                if (band->inherit_mv){
-                    /* motion vector inheritance */
-                    if (mv_scale) {
-                        mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
-                        mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
-                    } else {
-                        mb->mv_x = ref_mb->mv_x;
-                        mb->mv_y = ref_mb->mv_y;
-                    }
-                }
-            } else {
-                if (band->inherit_mv) {
-                    mb->type = ref_mb->type; /* copy mb_type from corresponding reference mb */
-                } else if (ctx->frame_type == FRAMETYPE_INTRA) {
-                    mb->type = 0; /* mb_type is always INTRA for intra-frames */
-                } else {
-                    mb->type = get_bits1(&ctx->gb);
-                }
-
-                blks_per_mb = band->mb_size != band->blk_size ? 4 : 1;
-                mb->cbp = get_bits(&ctx->gb, blks_per_mb);
-
-                mb->q_delta = 0;
-                if (band->qdelta_present) {
-                    if (band->inherit_qdelta) {
-                        if (ref_mb) mb->q_delta = ref_mb->q_delta;
-                    } else if (mb->cbp || (!band->plane && !band->band_num &&
-                                           (ctx->frame_flags & 8))) {
-                        mb->q_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
-                                               IVI_VLC_BITS, 1);
-                        mb->q_delta = IVI_TOSIGNED(mb->q_delta);
-                    }
-                }
-
-                if (!mb->type) {
-                    mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */
-                } else {
-                    if (band->inherit_mv){
-                        /* motion vector inheritance */
-                        if (mv_scale) {
-                            mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
-                            mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
-                        } else {
-                            mb->mv_x = ref_mb->mv_x;
-                            mb->mv_y = ref_mb->mv_y;
-                        }
-                    } else {
-                        /* decode motion vector deltas */
-                        mv_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
-                                            IVI_VLC_BITS, 1);
-                        mv_y += IVI_TOSIGNED(mv_delta);
-                        mv_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
-                                            IVI_VLC_BITS, 1);
-                        mv_x += IVI_TOSIGNED(mv_delta);
-                        mb->mv_x = mv_x;
-                        mb->mv_y = mv_y;
-                    }
-                }
-            }
-
-            mb++;
-            if (ref_mb)
-                ref_mb++;
-            mb_offset += band->mb_size;
-        }
-
-        offs += row_offset;
-    }
-
-    align_get_bits(&ctx->gb);
-
-    return 0;
-}
-
-
-/**
- *  Switch buffers.
- *
- *  @param[in,out] ctx  ptr to the decoder context
- */
-static void switch_buffers(IVI45DecContext *ctx)
-{
-    switch (ctx->prev_frame_type) {
-    case FRAMETYPE_INTRA:
-    case FRAMETYPE_INTER:
-        ctx->buf_switch ^= 1;
-        ctx->dst_buf = ctx->buf_switch;
-        ctx->ref_buf = ctx->buf_switch ^ 1;
-        break;
-    case FRAMETYPE_INTER_SCAL:
-        if (!ctx->inter_scal) {
-            ctx->ref2_buf   = 2;
-            ctx->inter_scal = 1;
-        }
-        FFSWAP(int, ctx->dst_buf, ctx->ref2_buf);
-        ctx->ref_buf = ctx->ref2_buf;
-        break;
-    case FRAMETYPE_INTER_NOREF:
-        break;
-    }
-
-    switch (ctx->frame_type) {
-    case FRAMETYPE_INTRA:
-        ctx->buf_switch = 0;
-        /* FALLTHROUGH */
-    case FRAMETYPE_INTER:
-        ctx->inter_scal = 0;
-        ctx->dst_buf = ctx->buf_switch;
-        ctx->ref_buf = ctx->buf_switch ^ 1;
-        break;
-    case FRAMETYPE_INTER_SCAL:
-    case FRAMETYPE_INTER_NOREF:
-    case FRAMETYPE_NULL:
-        break;
-    }
-}
-
-
-static int is_nonnull_frame(IVI45DecContext *ctx)
-{
-    return ctx->frame_type != FRAMETYPE_NULL;
-}
-
-
-/**
- *  Initialize Indeo5 decoder.
- */
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    IVI45DecContext  *ctx = avctx->priv_data;
-    int             result;
-
-    ff_ivi_init_static_vlc();
-
-    /* copy rvmap tables in our context so we can apply changes to them */
-    memcpy(ctx->rvmap_tabs, ff_ivi_rvmap_tabs, sizeof(ff_ivi_rvmap_tabs));
-
-    /* set the initial picture layout according to the basic profile:
-       there is only one band per plane (no scalability), only one tile (no local decoding)
-       and picture format = YVU9 */
-    ctx->pic_conf.pic_width     = avctx->width;
-    ctx->pic_conf.pic_height    = avctx->height;
-    ctx->pic_conf.chroma_width  = (avctx->width  + 3) >> 2;
-    ctx->pic_conf.chroma_height = (avctx->height + 3) >> 2;
-    ctx->pic_conf.tile_width    = avctx->width;
-    ctx->pic_conf.tile_height   = avctx->height;
-    ctx->pic_conf.luma_bands    = ctx->pic_conf.chroma_bands = 1;
-
-    result = ff_ivi_init_planes(ctx->planes, &ctx->pic_conf);
-    if (result) {
-        av_log(avctx, AV_LOG_ERROR, "Couldn't allocate color planes!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->buf_switch = 0;
-    ctx->inter_scal = 0;
-
-    ctx->decode_pic_hdr   = decode_pic_hdr;
-    ctx->decode_band_hdr  = decode_band_hdr;
-    ctx->decode_mb_info   = decode_mb_info;
-    ctx->switch_buffers   = switch_buffers;
-    ctx->is_nonnull_frame = is_nonnull_frame;
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV410P;
-
-    return 0;
-}
-
-
-AVCodec ff_indeo5_decoder = {
-    .name           = "indeo5",
-    .long_name      = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 5"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_INDEO5,
-    .priv_data_size = sizeof(IVI45DecContext),
-    .init           = decode_init,
-    .close          = ff_ivi_decode_close,
-    .decode         = ff_ivi_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/indeo5data.h b/deps/libav/libavcodec/indeo5data.h
deleted file mode 100644
index f4252b5..0000000
--- a/deps/libav/libavcodec/indeo5data.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Indeo Video Interactive 5 compatible decoder
- * Copyright (c) 2009 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This file contains data needed for the Indeo5 decoder.
- */
-
-#ifndef AVCODEC_INDEO5DATA_H
-#define AVCODEC_INDEO5DATA_H
-
-#include <stdint.h>
-
-/**
- *  standard picture dimensions (width, height divided by 4)
- */
-static const uint8_t ivi5_common_pic_sizes[30] = {
-    160, 120, 80, 60, 40, 30, 176, 120, 88, 60, 88, 72, 44, 36, 60, 45, 160, 60,
-    176,  60, 20, 15, 22, 18,   0,   0,  0,  0,  0,  0
-};
-
-
-/**
- *  Indeo5 dequantization matrixes consist of two tables: base table
- *  and scale table. The base table defines the dequantization matrix
- *  itself and the scale table tells how this matrix should be scaled
- *  for a particular quant level (0...24).
- *
- *  ivi5_base_quant_bbb_ttt  - base  tables for block size 'bbb' of type 'ttt'
- *  ivi5_scale_quant_bbb_ttt - scale tables for block size 'bbb' of type 'ttt'
- */
-static const uint16_t ivi5_base_quant_8x8_inter[5][64] = {
-    {0x26, 0x3a, 0x3e, 0x46, 0x4a, 0x4e, 0x52, 0x5a, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x4e, 0x56, 0x5e,
-     0x3e, 0x42, 0x46, 0x48, 0x4c, 0x52, 0x5a, 0x62, 0x46, 0x46, 0x48, 0x4a, 0x4e, 0x56, 0x5e, 0x66,
-     0x4a, 0x4a, 0x4c, 0x4e, 0x52, 0x5a, 0x62, 0x6a, 0x4e, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x66, 0x6e,
-     0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x72, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76,
-    },
-    {0x26, 0x3a, 0x3e, 0x46, 0x4a, 0x4e, 0x52, 0x5a, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x4e, 0x56, 0x5e,
-     0x3e, 0x42, 0x46, 0x48, 0x4c, 0x52, 0x5a, 0x62, 0x46, 0x46, 0x48, 0x4a, 0x4e, 0x56, 0x5e, 0x66,
-     0x4a, 0x4a, 0x4c, 0x4e, 0x52, 0x5a, 0x62, 0x6a, 0x4e, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x66, 0x6e,
-     0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x72, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76,
-    },
-    {0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2,
-     0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2,
-     0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2,
-     0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2,
-    },
-    {0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
-     0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4,
-     0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2,
-     0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2,
-    },
-    {0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e,
-     0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e,
-     0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e,
-     0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e,
-    }
-};
-
-static const uint16_t ivi5_base_quant_8x8_intra[5][64] = {
-    {0x1a, 0x2e, 0x36, 0x42, 0x46, 0x4a, 0x4e, 0x5a, 0x2e, 0x32, 0x3e, 0x42, 0x46, 0x4e, 0x56, 0x6a,
-     0x36, 0x3e, 0x3e, 0x44, 0x4a, 0x54, 0x66, 0x72, 0x42, 0x42, 0x44, 0x4a, 0x52, 0x62, 0x6c, 0x7a,
-     0x46, 0x46, 0x4a, 0x52, 0x5e, 0x66, 0x72, 0x8e, 0x4a, 0x4e, 0x54, 0x62, 0x66, 0x6e, 0x86, 0xa6,
-     0x4e, 0x56, 0x66, 0x6c, 0x72, 0x86, 0x9a, 0xca, 0x5a, 0x6a, 0x72, 0x7a, 0x8e, 0xa6, 0xca, 0xfe,
-    },
-    {0x26, 0x3a, 0x3e, 0x46, 0x4a, 0x4e, 0x52, 0x5a, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x4e, 0x56, 0x5e,
-     0x3e, 0x42, 0x46, 0x48, 0x4c, 0x52, 0x5a, 0x62, 0x46, 0x46, 0x48, 0x4a, 0x4e, 0x56, 0x5e, 0x66,
-     0x4a, 0x4a, 0x4c, 0x4e, 0x52, 0x5a, 0x62, 0x6a, 0x4e, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x66, 0x6e,
-     0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x72, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76,
-    },
-    {0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2,
-     0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2,
-     0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2,
-     0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2,
-    },
-    {0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
-     0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4,
-     0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2,
-     0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2,
-    },
-    {0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e,
-     0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e,
-     0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e,
-     0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e,
-    }
-};
-
-static const uint16_t ivi5_base_quant_4x4_inter[16] = {
-    0x1e, 0x3e, 0x4a, 0x52, 0x3e, 0x4a, 0x52, 0x56, 0x4a, 0x52, 0x56, 0x5e, 0x52, 0x56, 0x5e, 0x66
-};
-
-static const uint16_t ivi5_base_quant_4x4_intra[16] = {
-    0x1e, 0x3e, 0x4a, 0x52, 0x3e, 0x4a, 0x52, 0x5e, 0x4a, 0x52, 0x5e, 0x7a, 0x52, 0x5e, 0x7a, 0x92
-};
-
-
-static const uint8_t ivi5_scale_quant_8x8_inter[5][24] = {
-    {0x0b, 0x11, 0x13, 0x14, 0x15, 0x16, 0x18, 0x1a, 0x1b, 0x1d, 0x20, 0x22,
-     0x23, 0x25, 0x28, 0x2a, 0x2e, 0x32, 0x35, 0x39, 0x3d, 0x41, 0x44, 0x4a,
-    },
-    {0x07, 0x14, 0x16, 0x18, 0x1b, 0x1e, 0x22, 0x25, 0x29, 0x2d, 0x31, 0x35,
-     0x3a, 0x3f, 0x44, 0x4a, 0x50, 0x56, 0x5c, 0x63, 0x6a, 0x71, 0x78, 0x7e,
-    },
-    {0x15, 0x25, 0x28, 0x2d, 0x30, 0x34, 0x3a, 0x3d, 0x42, 0x48, 0x4c, 0x51,
-     0x56, 0x5b, 0x60, 0x65, 0x6b, 0x70, 0x76, 0x7c, 0x82, 0x88, 0x8f, 0x97,
-    },
-    {0x13, 0x1f, 0x20, 0x22, 0x25, 0x28, 0x2b, 0x2d, 0x30, 0x33, 0x36, 0x39,
-     0x3c, 0x3f, 0x42, 0x45, 0x48, 0x4b, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x62,
-    },
-    {0x3c, 0x52, 0x58, 0x5d, 0x63, 0x68, 0x68, 0x6d, 0x73, 0x78, 0x7c, 0x80,
-     0x84, 0x89, 0x8e, 0x93, 0x98, 0x9d, 0xa3, 0xa9, 0xad, 0xb1, 0xb5, 0xba,
-    },
-};
-
-static const uint8_t ivi5_scale_quant_8x8_intra[5][24] = {
-    {0x0b, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x17, 0x18, 0x1a, 0x1c, 0x1e, 0x20,
-     0x22, 0x24, 0x27, 0x28, 0x2a, 0x2d, 0x2f, 0x31, 0x34, 0x37, 0x39, 0x3c,
-    },
-    {0x01, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1b, 0x1e, 0x22, 0x25, 0x28, 0x2c,
-     0x30, 0x34, 0x38, 0x3d, 0x42, 0x47, 0x4c, 0x52, 0x58, 0x5e, 0x65, 0x6c,
-    },
-    {0x13, 0x22, 0x27, 0x2a, 0x2d, 0x33, 0x36, 0x3c, 0x41, 0x45, 0x49, 0x4e,
-     0x53, 0x58, 0x5d, 0x63, 0x69, 0x6f, 0x75, 0x7c, 0x82, 0x88, 0x8e, 0x95,
-    },
-    {0x13, 0x1f, 0x21, 0x24, 0x27, 0x29, 0x2d, 0x2f, 0x34, 0x37, 0x3a, 0x3d,
-     0x40, 0x44, 0x48, 0x4c, 0x4f, 0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6b,
-    },
-    {0x31, 0x42, 0x47, 0x47, 0x4d, 0x52, 0x58, 0x58, 0x5d, 0x63, 0x67, 0x6b,
-     0x6f, 0x73, 0x78, 0x7c, 0x80, 0x84, 0x89, 0x8e, 0x93, 0x98, 0x9d, 0xa4,
-    }
-};
-
-static const uint8_t ivi5_scale_quant_4x4_inter[24] = {
-    0x0b, 0x0d, 0x0d, 0x0e, 0x11, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
-    0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
-};
-
-static const uint8_t ivi5_scale_quant_4x4_intra[24] = {
-    0x01, 0x0b, 0x0b, 0x0d, 0x0d, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x13, 0x14,
-    0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20
-};
-
-
-#endif /* AVCODEC_INDEO5DATA_H */
diff --git a/deps/libav/libavcodec/intelh263dec.c b/deps/libav/libavcodec/intelh263dec.c
deleted file mode 100644
index 78e3d52..0000000
--- a/deps/libav/libavcodec/intelh263dec.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * H.263i decoder
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "mpegvideo.h"
-#include "h263.h"
-
-/* don't understand why they choose a different header ! */
-int ff_intel_h263_decode_picture_header(MpegEncContext *s)
-{
-    int format;
-
-    /* picture header */
-    if (get_bits_long(&s->gb, 22) != 0x20) {
-        av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
-        return -1;
-    }
-    s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */
-
-    if (get_bits1(&s->gb) != 1) {
-        av_log(s->avctx, AV_LOG_ERROR, "Bad marker\n");
-        return -1;      /* marker */
-    }
-    if (get_bits1(&s->gb) != 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n");
-        return -1;      /* h263 id */
-    }
-    skip_bits1(&s->gb);         /* split screen off */
-    skip_bits1(&s->gb);         /* camera  off */
-    skip_bits1(&s->gb);         /* freeze picture release off */
-
-    format = get_bits(&s->gb, 3);
-    if (format == 0 || format == 6) {
-        av_log(s->avctx, AV_LOG_ERROR, "Intel H263 free format not supported\n");
-        return -1;
-    }
-    s->h263_plus = 0;
-
-    s->pict_type = AV_PICTURE_TYPE_I + get_bits1(&s->gb);
-
-    s->unrestricted_mv = get_bits1(&s->gb);
-    s->h263_long_vectors = s->unrestricted_mv;
-
-    if (get_bits1(&s->gb) != 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "SAC not supported\n");
-        return -1;      /* SAC: off */
-    }
-    s->obmc= get_bits1(&s->gb);
-    s->pb_frame = get_bits1(&s->gb);
-
-    if (format < 6) {
-        s->width = ff_h263_format[format][0];
-        s->height = ff_h263_format[format][1];
-        s->avctx->sample_aspect_ratio.num = 12;
-        s->avctx->sample_aspect_ratio.den = 11;
-    } else {
-        format = get_bits(&s->gb, 3);
-        if(format == 0 || format == 7){
-            av_log(s->avctx, AV_LOG_ERROR, "Wrong Intel H263 format\n");
-            return -1;
-        }
-        if(get_bits(&s->gb, 2))
-            av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
-        s->loop_filter = get_bits1(&s->gb);
-        if(get_bits1(&s->gb))
-            av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
-        if(get_bits1(&s->gb))
-            s->pb_frame = 2;
-        if(get_bits(&s->gb, 5))
-            av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
-        if(get_bits(&s->gb, 5) != 1)
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid marker\n");
-    }
-    if(format == 6){
-        int ar = get_bits(&s->gb, 4);
-        skip_bits(&s->gb, 9); // display width
-        skip_bits1(&s->gb);
-        skip_bits(&s->gb, 9); // display height
-        if(ar == 15){
-            s->avctx->sample_aspect_ratio.num = get_bits(&s->gb, 8); // aspect ratio - width
-            s->avctx->sample_aspect_ratio.den = get_bits(&s->gb, 8); // aspect ratio - height
-        } else {
-            s->avctx->sample_aspect_ratio = ff_h263_pixel_aspect[ar];
-        }
-        if (s->avctx->sample_aspect_ratio.num == 0)
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid aspect ratio.\n");
-    }
-
-    s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
-    skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */
-
-    if(s->pb_frame){
-        skip_bits(&s->gb, 3); //temporal reference for B-frame
-        skip_bits(&s->gb, 2); //dbquant
-    }
-
-    /* PEI */
-    while (get_bits1(&s->gb) != 0) {
-        skip_bits(&s->gb, 8);
-    }
-    s->f_code = 1;
-
-    s->y_dc_scale_table=
-    s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-
-    ff_h263_show_pict_info(s);
-
-    return 0;
-}
-
-AVCodec ff_h263i_decoder = {
-    .name           = "h263i",
-    .long_name      = NULL_IF_CONFIG_SMALL("Intel H.263"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H263I,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_h263_decode_init,
-    .close          = ff_h263_decode_end,
-    .decode         = ff_h263_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .pix_fmts       = ff_pixfmt_list_420,
-};
diff --git a/deps/libav/libavcodec/internal.h b/deps/libav/libavcodec/internal.h
deleted file mode 100644
index 9f7213c..0000000
--- a/deps/libav/libavcodec/internal.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * common internal api header.
- */
-
-#ifndef AVCODEC_INTERNAL_H
-#define AVCODEC_INTERNAL_H
-
-#include <stdint.h>
-
-#include "libavutil/buffer.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/pixfmt.h"
-#include "avcodec.h"
-#include "config.h"
-
-#define FF_SANE_NB_CHANNELS 63U
-
-typedef struct FramePool {
-    /**
-     * Pools for each data plane. For audio all the planes have the same size,
-     * so only pools[0] is used.
-     */
-    AVBufferPool *pools[4];
-
-    /*
-     * Pool parameters
-     */
-    int format;
-    int width, height;
-    int stride_align[AV_NUM_DATA_POINTERS];
-    int linesize[4];
-    int planes;
-    int channels;
-    int samples;
-} FramePool;
-
-typedef struct AVCodecInternal {
-    /**
-     * Whether the parent AVCodecContext is a copy of the context which had
-     * init() called on it.
-     * This is used by multithreading - shared tables and picture pointers
-     * should be freed from the original context only.
-     */
-    int is_copy;
-
-    /**
-     * Whether to allocate progress for frame threading.
-     *
-     * The codec must set it to 1 if it uses ff_thread_await/report_progress(),
-     * then progress will be allocated in ff_thread_get_buffer(). The frames
-     * then MUST be freed with ff_thread_release_buffer().
-     *
-     * If the codec does not need to call the progress functions (there are no
-     * dependencies between the frames), it should leave this at 0. Then it can
-     * decode straight to the user-provided frames (which the user will then
-     * free with av_frame_unref()), there is no need to call
-     * ff_thread_release_buffer().
-     */
-    int allocate_progress;
-
-    /**
-     * An audio frame with less than required samples has been submitted and
-     * padded with silence. Reject all subsequent frames.
-     */
-    int last_audio_frame;
-
-    AVFrame *to_free;
-
-    FramePool *pool;
-
-    void *thread_ctx;
-
-    /**
-     * Current packet as passed into the decoder, to avoid having to pass the
-     * packet into every function.
-     */
-    AVPacket *pkt;
-} AVCodecInternal;
-
-struct AVCodecDefault {
-    const uint8_t *key;
-    const uint8_t *value;
-};
-
-/**
- * Return the hardware accelerated codec for codec codec_id and
- * pixel format pix_fmt.
- *
- * @param avctx The codec context containing the codec_id and pixel format.
- * @return the hardware accelerated codec, or NULL if none was found.
- */
-AVHWAccel *ff_find_hwaccel(AVCodecContext *avctx);
-
-/**
- * Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
- * If there is no such matching pair then size is returned.
- */
-int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b);
-
-unsigned int avpriv_toupper4(unsigned int x);
-
-int avpriv_lock_avformat(void);
-int avpriv_unlock_avformat(void);
-
-/**
- * Maximum size in bytes of extradata.
- * This value was chosen such that every bit of the buffer is
- * addressable by a 32-bit signed integer as used by get_bits.
- */
-#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE)
-
-/**
- * Check AVPacket size and/or allocate data.
- *
- * Encoders supporting AVCodec.encode2() can use this as a convenience to
- * ensure the output packet data is large enough, whether provided by the user
- * or allocated in this function.
- *
- * @param avpkt   the AVPacket
- *                If avpkt->data is already set, avpkt->size is checked
- *                to ensure it is large enough.
- *                If avpkt->data is NULL, a new buffer is allocated.
- *                avpkt->size is set to the specified size.
- *                All other AVPacket fields will be reset with av_init_packet().
- * @param size    the minimum required packet size
- * @return        0 on success, negative error code on failure
- */
-int ff_alloc_packet(AVPacket *avpkt, int size);
-
-/**
- * Rescale from sample rate to AVCodecContext.time_base.
- */
-static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx,
-                                                        int64_t samples)
-{
-    return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate },
-                        avctx->time_base);
-}
-
-/**
- * Get a buffer for a frame. This is a wrapper around
- * AVCodecContext.get_buffer() and should be used instead calling get_buffer()
- * directly.
- */
-int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags);
-
-/**
- * Identical in function to av_frame_make_writable(), except it uses
- * ff_get_buffer() to allocate the buffer when needed.
- */
-int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame);
-
-const uint8_t *avpriv_find_start_code(const uint8_t *restrict p,
-                                      const uint8_t *end,
-                                      uint32_t *restrict state);
-
-/**
- * Check that the provided frame dimensions are valid and set them on the codec
- * context.
- */
-int ff_set_dimensions(AVCodecContext *s, int width, int height);
-
-/**
- * Add or update AV_FRAME_DATA_MATRIXENCODING side data.
- */
-int ff_side_data_update_matrix_encoding(AVFrame *frame,
-                                        enum AVMatrixEncoding matrix_encoding);
-
-#endif /* AVCODEC_INTERNAL_H */
diff --git a/deps/libav/libavcodec/interplayvideo.c b/deps/libav/libavcodec/interplayvideo.c
deleted file mode 100644
index 7d785e3..0000000
--- a/deps/libav/libavcodec/interplayvideo.c
+++ /dev/null
@@ -1,1024 +0,0 @@
-/*
- * Interplay MVE Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Interplay MVE Video Decoder by Mike Melanson (melanson at pcisys.net)
- * For more information about the Interplay MVE format, visit:
- *   http://www.pcisys.net/~melanson/codecs/interplay-mve.txt
- * This code is written in such a way that the identifiers match up
- * with the encoding descriptions in the document.
- *
- * This decoder presently only supports a PAL8 output colorspace.
- *
- * An Interplay video frame consists of 2 parts: The decoding map and
- * the video data. A demuxer must load these 2 parts together in a single
- * buffer before sending it through the stream to this decoder.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "hpeldsp.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "internal.h"
-
-#define PALETTE_COUNT 256
-
-typedef struct IpvideoContext {
-
-    AVCodecContext *avctx;
-    HpelDSPContext hdsp;
-    AVFrame *second_last_frame;
-    AVFrame *last_frame;
-    const unsigned char *decoding_map;
-    int decoding_map_size;
-
-    int is_16bpp;
-    GetByteContext stream_ptr, mv_ptr;
-    unsigned char *pixel_ptr;
-    int line_inc;
-    int stride;
-    int upper_motion_limit_offset;
-
-    uint32_t pal[256];
-} IpvideoContext;
-
-static int copy_from(IpvideoContext *s, AVFrame *src, AVFrame *dst, int delta_x, int delta_y)
-{
-    int current_offset = s->pixel_ptr - dst->data[0];
-    int motion_offset = current_offset + delta_y * dst->linesize[0]
-                       + delta_x * (1 + s->is_16bpp);
-    if (motion_offset < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset);
-        return AVERROR_INVALIDDATA;
-    } else if (motion_offset > s->upper_motion_limit_offset) {
-        av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n",
-            motion_offset, s->upper_motion_limit_offset);
-        return AVERROR_INVALIDDATA;
-    }
-    if (src->data[0] == NULL) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid decode type, corrupted header?\n");
-        return AVERROR(EINVAL);
-    }
-    s->hdsp.put_pixels_tab[!s->is_16bpp][0](s->pixel_ptr, src->data[0] + motion_offset,
-                                            dst->linesize[0], 8);
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x0(IpvideoContext *s, AVFrame *frame)
-{
-    return copy_from(s, s->last_frame, frame, 0, 0);
-}
-
-static int ipvideo_decode_block_opcode_0x1(IpvideoContext *s, AVFrame *frame)
-{
-    return copy_from(s, s->second_last_frame, frame, 0, 0);
-}
-
-static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s, AVFrame *frame)
-{
-    unsigned char B;
-    int x, y;
-
-    /* copy block from 2 frames ago using a motion vector; need 1 more byte */
-    if (!s->is_16bpp) {
-        B = bytestream2_get_byte(&s->stream_ptr);
-    } else {
-        B = bytestream2_get_byte(&s->mv_ptr);
-    }
-
-    if (B < 56) {
-        x = 8 + (B % 7);
-        y = B / 7;
-    } else {
-        x = -14 + ((B - 56) % 29);
-        y =   8 + ((B - 56) / 29);
-    }
-
-    av_dlog(NULL, "    motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
-    return copy_from(s, s->second_last_frame, frame, x, y);
-}
-
-static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s, AVFrame *frame)
-{
-    unsigned char B;
-    int x, y;
-
-    /* copy 8x8 block from current frame from an up/left block */
-
-    /* need 1 more byte for motion */
-    if (!s->is_16bpp) {
-        B = bytestream2_get_byte(&s->stream_ptr);
-    } else {
-        B = bytestream2_get_byte(&s->mv_ptr);
-    }
-
-    if (B < 56) {
-        x = -(8 + (B % 7));
-        y = -(B / 7);
-    } else {
-        x = -(-14 + ((B - 56) % 29));
-        y = -(  8 + ((B - 56) / 29));
-    }
-
-    av_dlog(NULL, "    motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
-    return copy_from(s, frame, frame, x, y);
-}
-
-static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    unsigned char B, BL, BH;
-
-    /* copy a block from the previous frame; need 1 more byte */
-    if (!s->is_16bpp) {
-        B = bytestream2_get_byte(&s->stream_ptr);
-    } else {
-        B = bytestream2_get_byte(&s->mv_ptr);
-    }
-
-    BL = B & 0x0F;
-    BH = (B >> 4) & 0x0F;
-    x = -8 + BL;
-    y = -8 + BH;
-
-    av_dlog(NULL, "    motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
-    return copy_from(s, s->last_frame, frame, x, y);
-}
-
-static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s, AVFrame *frame)
-{
-    signed char x, y;
-
-    /* copy a block from the previous frame using an expanded range;
-     * need 2 more bytes */
-    x = bytestream2_get_byte(&s->stream_ptr);
-    y = bytestream2_get_byte(&s->stream_ptr);
-
-    av_dlog(NULL, "    motion bytes = %d, %d\n", x, y);
-    return copy_from(s, s->last_frame, frame, x, y);
-}
-
-static int ipvideo_decode_block_opcode_0x6(IpvideoContext *s, AVFrame *frame)
-{
-    /* mystery opcode? skip multiple blocks? */
-    av_log(s->avctx, AV_LOG_ERROR, "  Interplay video: Help! Mystery opcode 0x6 seen\n");
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    unsigned char P[2];
-    unsigned int flags;
-
-    /* 2-color encoding */
-    P[0] = bytestream2_get_byte(&s->stream_ptr);
-    P[1] = bytestream2_get_byte(&s->stream_ptr);
-
-    if (P[0] <= P[1]) {
-
-        /* need 8 more bytes from the stream */
-        for (y = 0; y < 8; y++) {
-            flags = bytestream2_get_byte(&s->stream_ptr) | 0x100;
-            for (; flags != 1; flags >>= 1)
-                *s->pixel_ptr++ = P[flags & 1];
-            s->pixel_ptr += s->line_inc;
-        }
-
-    } else {
-
-        /* need 2 more bytes from the stream */
-        flags = bytestream2_get_le16(&s->stream_ptr);
-        for (y = 0; y < 8; y += 2) {
-            for (x = 0; x < 8; x += 2, flags >>= 1) {
-                s->pixel_ptr[x                ] =
-                s->pixel_ptr[x + 1            ] =
-                s->pixel_ptr[x +     s->stride] =
-                s->pixel_ptr[x + 1 + s->stride] = P[flags & 1];
-            }
-            s->pixel_ptr += s->stride * 2;
-        }
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x8(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    unsigned char P[4];
-    unsigned int flags = 0;
-
-    /* 2-color encoding for each 4x4 quadrant, or 2-color encoding on
-     * either top and bottom or left and right halves */
-    P[0] = bytestream2_get_byte(&s->stream_ptr);
-    P[1] = bytestream2_get_byte(&s->stream_ptr);
-
-    if (P[0] <= P[1]) {
-        for (y = 0; y < 16; y++) {
-            // new values for each 4x4 block
-            if (!(y & 3)) {
-                if (y) {
-                    P[0]  = bytestream2_get_byte(&s->stream_ptr);
-                    P[1]  = bytestream2_get_byte(&s->stream_ptr);
-                }
-                flags = bytestream2_get_le16(&s->stream_ptr);
-            }
-
-            for (x = 0; x < 4; x++, flags >>= 1)
-                *s->pixel_ptr++ = P[flags & 1];
-            s->pixel_ptr += s->stride - 4;
-            // switch to right half
-            if (y == 7) s->pixel_ptr -= 8 * s->stride - 4;
-        }
-
-    } else {
-        flags = bytestream2_get_le32(&s->stream_ptr);
-        P[2] = bytestream2_get_byte(&s->stream_ptr);
-        P[3] = bytestream2_get_byte(&s->stream_ptr);
-
-        if (P[2] <= P[3]) {
-
-            /* vertical split; left & right halves are 2-color encoded */
-
-            for (y = 0; y < 16; y++) {
-                for (x = 0; x < 4; x++, flags >>= 1)
-                    *s->pixel_ptr++ = P[flags & 1];
-                s->pixel_ptr += s->stride - 4;
-                // switch to right half
-                if (y == 7) {
-                    s->pixel_ptr -= 8 * s->stride - 4;
-                    P[0]  = P[2];
-                    P[1]  = P[3];
-                    flags = bytestream2_get_le32(&s->stream_ptr);
-                }
-            }
-
-        } else {
-
-            /* horizontal split; top & bottom halves are 2-color encoded */
-
-            for (y = 0; y < 8; y++) {
-                if (y == 4) {
-                    P[0]  = P[2];
-                    P[1]  = P[3];
-                    flags = bytestream2_get_le32(&s->stream_ptr);
-                }
-
-                for (x = 0; x < 8; x++, flags >>= 1)
-                    *s->pixel_ptr++ = P[flags & 1];
-                s->pixel_ptr += s->line_inc;
-            }
-        }
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    unsigned char P[4];
-
-    /* 4-color encoding */
-    bytestream2_get_buffer(&s->stream_ptr, P, 4);
-
-    if (P[0] <= P[1]) {
-        if (P[2] <= P[3]) {
-
-            /* 1 of 4 colors for each pixel, need 16 more bytes */
-            for (y = 0; y < 8; y++) {
-                /* get the next set of 8 2-bit flags */
-                int flags = bytestream2_get_le16(&s->stream_ptr);
-                for (x = 0; x < 8; x++, flags >>= 2)
-                    *s->pixel_ptr++ = P[flags & 0x03];
-                s->pixel_ptr += s->line_inc;
-            }
-
-        } else {
-            uint32_t flags;
-
-            /* 1 of 4 colors for each 2x2 block, need 4 more bytes */
-            flags = bytestream2_get_le32(&s->stream_ptr);
-
-            for (y = 0; y < 8; y += 2) {
-                for (x = 0; x < 8; x += 2, flags >>= 2) {
-                    s->pixel_ptr[x                ] =
-                    s->pixel_ptr[x + 1            ] =
-                    s->pixel_ptr[x +     s->stride] =
-                    s->pixel_ptr[x + 1 + s->stride] = P[flags & 0x03];
-                }
-                s->pixel_ptr += s->stride * 2;
-            }
-
-        }
-    } else {
-        uint64_t flags;
-
-        /* 1 of 4 colors for each 2x1 or 1x2 block, need 8 more bytes */
-        flags = bytestream2_get_le64(&s->stream_ptr);
-        if (P[2] <= P[3]) {
-            for (y = 0; y < 8; y++) {
-                for (x = 0; x < 8; x += 2, flags >>= 2) {
-                    s->pixel_ptr[x    ] =
-                    s->pixel_ptr[x + 1] = P[flags & 0x03];
-                }
-                s->pixel_ptr += s->stride;
-            }
-        } else {
-            for (y = 0; y < 8; y += 2) {
-                for (x = 0; x < 8; x++, flags >>= 2) {
-                    s->pixel_ptr[x            ] =
-                    s->pixel_ptr[x + s->stride] = P[flags & 0x03];
-                }
-                s->pixel_ptr += s->stride * 2;
-            }
-        }
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    unsigned char P[8];
-    int flags = 0;
-
-    bytestream2_get_buffer(&s->stream_ptr, P, 4);
-
-    /* 4-color encoding for each 4x4 quadrant, or 4-color encoding on
-     * either top and bottom or left and right halves */
-    if (P[0] <= P[1]) {
-
-        /* 4-color encoding for each quadrant; need 32 bytes */
-        for (y = 0; y < 16; y++) {
-            // new values for each 4x4 block
-            if (!(y & 3)) {
-                if (y) bytestream2_get_buffer(&s->stream_ptr, P, 4);
-                flags = bytestream2_get_le32(&s->stream_ptr);
-            }
-
-            for (x = 0; x < 4; x++, flags >>= 2)
-                *s->pixel_ptr++ = P[flags & 0x03];
-
-            s->pixel_ptr += s->stride - 4;
-            // switch to right half
-            if (y == 7) s->pixel_ptr -= 8 * s->stride - 4;
-        }
-
-    } else {
-        // vertical split?
-        int vert;
-        uint64_t flags = bytestream2_get_le64(&s->stream_ptr);
-
-        bytestream2_get_buffer(&s->stream_ptr, P + 4, 4);
-        vert = P[4] <= P[5];
-
-        /* 4-color encoding for either left and right or top and bottom
-         * halves */
-
-        for (y = 0; y < 16; y++) {
-            for (x = 0; x < 4; x++, flags >>= 2)
-                *s->pixel_ptr++ = P[flags & 0x03];
-
-            if (vert) {
-                s->pixel_ptr += s->stride - 4;
-                // switch to right half
-                if (y == 7) s->pixel_ptr -= 8 * s->stride - 4;
-            } else if (y & 1) s->pixel_ptr += s->line_inc;
-
-            // load values for second half
-            if (y == 7) {
-                memcpy(P, P + 4, 4);
-                flags = bytestream2_get_le64(&s->stream_ptr);
-            }
-        }
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xB(IpvideoContext *s, AVFrame *frame)
-{
-    int y;
-
-    /* 64-color encoding (each pixel in block is a different color) */
-    for (y = 0; y < 8; y++) {
-        bytestream2_get_buffer(&s->stream_ptr, s->pixel_ptr, 8);
-        s->pixel_ptr  += s->stride;
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xC(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-
-    /* 16-color block encoding: each 2x2 block is a different color */
-    for (y = 0; y < 8; y += 2) {
-        for (x = 0; x < 8; x += 2) {
-            s->pixel_ptr[x                ] =
-            s->pixel_ptr[x + 1            ] =
-            s->pixel_ptr[x +     s->stride] =
-            s->pixel_ptr[x + 1 + s->stride] = bytestream2_get_byte(&s->stream_ptr);
-        }
-        s->pixel_ptr += s->stride * 2;
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s, AVFrame *frame)
-{
-    int y;
-    unsigned char P[2];
-
-    /* 4-color block encoding: each 4x4 block is a different color */
-    for (y = 0; y < 8; y++) {
-        if (!(y & 3)) {
-            P[0] = bytestream2_get_byte(&s->stream_ptr);
-            P[1] = bytestream2_get_byte(&s->stream_ptr);
-        }
-        memset(s->pixel_ptr,     P[0], 4);
-        memset(s->pixel_ptr + 4, P[1], 4);
-        s->pixel_ptr += s->stride;
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xE(IpvideoContext *s, AVFrame *frame)
-{
-    int y;
-    unsigned char pix;
-
-    /* 1-color encoding: the whole block is 1 solid color */
-    pix = bytestream2_get_byte(&s->stream_ptr);
-
-    for (y = 0; y < 8; y++) {
-        memset(s->pixel_ptr, pix, 8);
-        s->pixel_ptr += s->stride;
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xF(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    unsigned char sample[2];
-
-    /* dithered encoding */
-    sample[0] = bytestream2_get_byte(&s->stream_ptr);
-    sample[1] = bytestream2_get_byte(&s->stream_ptr);
-
-    for (y = 0; y < 8; y++) {
-        for (x = 0; x < 8; x += 2) {
-            *s->pixel_ptr++ = sample[  y & 1 ];
-            *s->pixel_ptr++ = sample[!(y & 1)];
-        }
-        s->pixel_ptr += s->line_inc;
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x6_16(IpvideoContext *s, AVFrame *frame)
-{
-    signed char x, y;
-
-    /* copy a block from the second last frame using an expanded range */
-    x = bytestream2_get_byte(&s->stream_ptr);
-    y = bytestream2_get_byte(&s->stream_ptr);
-
-    av_dlog(NULL, "    motion bytes = %d, %d\n", x, y);
-    return copy_from(s, s->second_last_frame, frame, x, y);
-}
-
-static int ipvideo_decode_block_opcode_0x7_16(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    uint16_t P[2];
-    unsigned int flags;
-    uint16_t *pixel_ptr = (uint16_t*)s->pixel_ptr;
-
-    /* 2-color encoding */
-    P[0] = bytestream2_get_le16(&s->stream_ptr);
-    P[1] = bytestream2_get_le16(&s->stream_ptr);
-
-    if (!(P[0] & 0x8000)) {
-
-        for (y = 0; y < 8; y++) {
-            flags = bytestream2_get_byte(&s->stream_ptr) | 0x100;
-            for (; flags != 1; flags >>= 1)
-                *pixel_ptr++ = P[flags & 1];
-            pixel_ptr += s->line_inc;
-        }
-
-    } else {
-
-        flags = bytestream2_get_le16(&s->stream_ptr);
-        for (y = 0; y < 8; y += 2) {
-            for (x = 0; x < 8; x += 2, flags >>= 1) {
-                pixel_ptr[x                ] =
-                pixel_ptr[x + 1            ] =
-                pixel_ptr[x +     s->stride] =
-                pixel_ptr[x + 1 + s->stride] = P[flags & 1];
-            }
-            pixel_ptr += s->stride * 2;
-        }
-    }
-
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x8_16(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    uint16_t P[4];
-    unsigned int flags = 0;
-    uint16_t *pixel_ptr = (uint16_t*)s->pixel_ptr;
-
-    /* 2-color encoding for each 4x4 quadrant, or 2-color encoding on
-     * either top and bottom or left and right halves */
-    P[0] = bytestream2_get_le16(&s->stream_ptr);
-    P[1] = bytestream2_get_le16(&s->stream_ptr);
-
-    if (!(P[0] & 0x8000)) {
-
-        for (y = 0; y < 16; y++) {
-            // new values for each 4x4 block
-            if (!(y & 3)) {
-                if (y) {
-                    P[0] = bytestream2_get_le16(&s->stream_ptr);
-                    P[1] = bytestream2_get_le16(&s->stream_ptr);
-                }
-                flags = bytestream2_get_le16(&s->stream_ptr);
-            }
-
-            for (x = 0; x < 4; x++, flags >>= 1)
-                *pixel_ptr++ = P[flags & 1];
-            pixel_ptr += s->stride - 4;
-            // switch to right half
-            if (y == 7) pixel_ptr -= 8 * s->stride - 4;
-        }
-
-    } else {
-
-        flags = bytestream2_get_le32(&s->stream_ptr);
-        P[2]  = bytestream2_get_le16(&s->stream_ptr);
-        P[3]  = bytestream2_get_le16(&s->stream_ptr);
-
-        if (!(P[2] & 0x8000)) {
-
-            /* vertical split; left & right halves are 2-color encoded */
-
-            for (y = 0; y < 16; y++) {
-                for (x = 0; x < 4; x++, flags >>= 1)
-                    *pixel_ptr++ = P[flags & 1];
-                pixel_ptr += s->stride - 4;
-                // switch to right half
-                if (y == 7) {
-                    pixel_ptr -= 8 * s->stride - 4;
-                    P[0]  = P[2];
-                    P[1]  = P[3];
-                    flags = bytestream2_get_le32(&s->stream_ptr);
-                }
-            }
-
-        } else {
-
-            /* horizontal split; top & bottom halves are 2-color encoded */
-
-            for (y = 0; y < 8; y++) {
-                if (y == 4) {
-                    P[0]  = P[2];
-                    P[1]  = P[3];
-                    flags = bytestream2_get_le32(&s->stream_ptr);
-                }
-
-                for (x = 0; x < 8; x++, flags >>= 1)
-                    *pixel_ptr++ = P[flags & 1];
-                pixel_ptr += s->line_inc;
-            }
-        }
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x9_16(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    uint16_t P[4];
-    uint16_t *pixel_ptr = (uint16_t*)s->pixel_ptr;
-
-    /* 4-color encoding */
-    for (x = 0; x < 4; x++)
-        P[x] = bytestream2_get_le16(&s->stream_ptr);
-
-    if (!(P[0] & 0x8000)) {
-        if (!(P[2] & 0x8000)) {
-
-            /* 1 of 4 colors for each pixel */
-            for (y = 0; y < 8; y++) {
-                /* get the next set of 8 2-bit flags */
-                int flags = bytestream2_get_le16(&s->stream_ptr);
-                for (x = 0; x < 8; x++, flags >>= 2)
-                    *pixel_ptr++ = P[flags & 0x03];
-                pixel_ptr += s->line_inc;
-            }
-
-        } else {
-            uint32_t flags;
-
-            /* 1 of 4 colors for each 2x2 block */
-            flags = bytestream2_get_le32(&s->stream_ptr);
-
-            for (y = 0; y < 8; y += 2) {
-                for (x = 0; x < 8; x += 2, flags >>= 2) {
-                    pixel_ptr[x                ] =
-                    pixel_ptr[x + 1            ] =
-                    pixel_ptr[x +     s->stride] =
-                    pixel_ptr[x + 1 + s->stride] = P[flags & 0x03];
-                }
-                pixel_ptr += s->stride * 2;
-            }
-
-        }
-    } else {
-        uint64_t flags;
-
-        /* 1 of 4 colors for each 2x1 or 1x2 block */
-        flags = bytestream2_get_le64(&s->stream_ptr);
-        if (!(P[2] & 0x8000)) {
-            for (y = 0; y < 8; y++) {
-                for (x = 0; x < 8; x += 2, flags >>= 2) {
-                    pixel_ptr[x    ] =
-                    pixel_ptr[x + 1] = P[flags & 0x03];
-                }
-                pixel_ptr += s->stride;
-            }
-        } else {
-            for (y = 0; y < 8; y += 2) {
-                for (x = 0; x < 8; x++, flags >>= 2) {
-                    pixel_ptr[x            ] =
-                    pixel_ptr[x + s->stride] = P[flags & 0x03];
-                }
-                pixel_ptr += s->stride * 2;
-            }
-        }
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xA_16(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    uint16_t P[8];
-    int flags = 0;
-    uint16_t *pixel_ptr = (uint16_t*)s->pixel_ptr;
-
-    for (x = 0; x < 4; x++)
-        P[x] = bytestream2_get_le16(&s->stream_ptr);
-
-    /* 4-color encoding for each 4x4 quadrant, or 4-color encoding on
-     * either top and bottom or left and right halves */
-    if (!(P[0] & 0x8000)) {
-
-        /* 4-color encoding for each quadrant */
-        for (y = 0; y < 16; y++) {
-            // new values for each 4x4 block
-            if (!(y & 3)) {
-                if (y)
-                    for (x = 0; x < 4; x++)
-                        P[x] = bytestream2_get_le16(&s->stream_ptr);
-                flags = bytestream2_get_le32(&s->stream_ptr);
-            }
-
-            for (x = 0; x < 4; x++, flags >>= 2)
-                *pixel_ptr++ = P[flags & 0x03];
-
-            pixel_ptr += s->stride - 4;
-            // switch to right half
-            if (y == 7) pixel_ptr -= 8 * s->stride - 4;
-        }
-
-    } else {
-        // vertical split?
-        int vert;
-        uint64_t flags = bytestream2_get_le64(&s->stream_ptr);
-
-        for (x = 4; x < 8; x++)
-            P[x] = bytestream2_get_le16(&s->stream_ptr);
-        vert = !(P[4] & 0x8000);
-
-        /* 4-color encoding for either left and right or top and bottom
-         * halves */
-
-        for (y = 0; y < 16; y++) {
-            for (x = 0; x < 4; x++, flags >>= 2)
-                *pixel_ptr++ = P[flags & 0x03];
-
-            if (vert) {
-                pixel_ptr += s->stride - 4;
-                // switch to right half
-                if (y == 7) pixel_ptr -= 8 * s->stride - 4;
-            } else if (y & 1) pixel_ptr += s->line_inc;
-
-            // load values for second half
-            if (y == 7) {
-                memcpy(P, P + 4, 8);
-                flags = bytestream2_get_le64(&s->stream_ptr);
-            }
-        }
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xB_16(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    uint16_t *pixel_ptr = (uint16_t*)s->pixel_ptr;
-
-    /* 64-color encoding (each pixel in block is a different color) */
-    for (y = 0; y < 8; y++) {
-        for (x = 0; x < 8; x++)
-            pixel_ptr[x] = bytestream2_get_le16(&s->stream_ptr);
-        pixel_ptr  += s->stride;
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xC_16(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    uint16_t *pixel_ptr = (uint16_t*)s->pixel_ptr;
-
-    /* 16-color block encoding: each 2x2 block is a different color */
-    for (y = 0; y < 8; y += 2) {
-        for (x = 0; x < 8; x += 2) {
-            pixel_ptr[x                ] =
-            pixel_ptr[x + 1            ] =
-            pixel_ptr[x +     s->stride] =
-            pixel_ptr[x + 1 + s->stride] = bytestream2_get_le16(&s->stream_ptr);
-        }
-        pixel_ptr += s->stride * 2;
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xD_16(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    uint16_t P[2];
-    uint16_t *pixel_ptr = (uint16_t*)s->pixel_ptr;
-
-    /* 4-color block encoding: each 4x4 block is a different color */
-    for (y = 0; y < 8; y++) {
-        if (!(y & 3)) {
-            P[0] = bytestream2_get_le16(&s->stream_ptr);
-            P[1] = bytestream2_get_le16(&s->stream_ptr);
-        }
-        for (x = 0; x < 8; x++)
-            pixel_ptr[x] = P[x >> 2];
-        pixel_ptr += s->stride;
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xE_16(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    uint16_t pix;
-    uint16_t *pixel_ptr = (uint16_t*)s->pixel_ptr;
-
-    /* 1-color encoding: the whole block is 1 solid color */
-    pix = bytestream2_get_le16(&s->stream_ptr);
-
-    for (y = 0; y < 8; y++) {
-        for (x = 0; x < 8; x++)
-            pixel_ptr[x] = pix;
-        pixel_ptr += s->stride;
-    }
-
-    /* report success */
-    return 0;
-}
-
-static int (* const ipvideo_decode_block[])(IpvideoContext *s, AVFrame *frame) = {
-    ipvideo_decode_block_opcode_0x0, ipvideo_decode_block_opcode_0x1,
-    ipvideo_decode_block_opcode_0x2, ipvideo_decode_block_opcode_0x3,
-    ipvideo_decode_block_opcode_0x4, ipvideo_decode_block_opcode_0x5,
-    ipvideo_decode_block_opcode_0x6, ipvideo_decode_block_opcode_0x7,
-    ipvideo_decode_block_opcode_0x8, ipvideo_decode_block_opcode_0x9,
-    ipvideo_decode_block_opcode_0xA, ipvideo_decode_block_opcode_0xB,
-    ipvideo_decode_block_opcode_0xC, ipvideo_decode_block_opcode_0xD,
-    ipvideo_decode_block_opcode_0xE, ipvideo_decode_block_opcode_0xF,
-};
-
-static int (* const ipvideo_decode_block16[])(IpvideoContext *s, AVFrame *frame) = {
-    ipvideo_decode_block_opcode_0x0,    ipvideo_decode_block_opcode_0x1,
-    ipvideo_decode_block_opcode_0x2,    ipvideo_decode_block_opcode_0x3,
-    ipvideo_decode_block_opcode_0x4,    ipvideo_decode_block_opcode_0x5,
-    ipvideo_decode_block_opcode_0x6_16, ipvideo_decode_block_opcode_0x7_16,
-    ipvideo_decode_block_opcode_0x8_16, ipvideo_decode_block_opcode_0x9_16,
-    ipvideo_decode_block_opcode_0xA_16, ipvideo_decode_block_opcode_0xB_16,
-    ipvideo_decode_block_opcode_0xC_16, ipvideo_decode_block_opcode_0xD_16,
-    ipvideo_decode_block_opcode_0xE_16, ipvideo_decode_block_opcode_0x1,
-};
-
-static void ipvideo_decode_opcodes(IpvideoContext *s, AVFrame *frame)
-{
-    int x, y;
-    unsigned char opcode;
-    int ret;
-    GetBitContext gb;
-
-    bytestream2_skip(&s->stream_ptr, 14); /* data starts 14 bytes in */
-    if (!s->is_16bpp) {
-        /* this is PAL8, so make the palette available */
-        memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
-
-        s->stride = frame->linesize[0];
-    } else {
-        s->stride = frame->linesize[0] >> 1;
-        s->mv_ptr = s->stream_ptr;
-        bytestream2_skip(&s->mv_ptr, bytestream2_get_le16(&s->stream_ptr));
-    }
-    s->line_inc = s->stride - 8;
-    s->upper_motion_limit_offset = (s->avctx->height - 8) * frame->linesize[0]
-                                  + (s->avctx->width - 8) * (1 + s->is_16bpp);
-
-    init_get_bits(&gb, s->decoding_map, s->decoding_map_size * 8);
-    for (y = 0; y < s->avctx->height; y += 8) {
-        for (x = 0; x < s->avctx->width; x += 8) {
-            opcode = get_bits(&gb, 4);
-
-            av_dlog(s->avctx,
-                    "  block @ (%3d, %3d): encoding 0x%X, data ptr offset %d\n",
-                    x, y, opcode, bytestream2_tell(&s->stream_ptr));
-
-            if (!s->is_16bpp) {
-                s->pixel_ptr = frame->data[0] + x
-                              + y*frame->linesize[0];
-                ret = ipvideo_decode_block[opcode](s, frame);
-            } else {
-                s->pixel_ptr = frame->data[0] + x*2
-                              + y*frame->linesize[0];
-                ret = ipvideo_decode_block16[opcode](s, frame);
-            }
-            if (ret != 0) {
-                av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode problem on frame %d, @ block (%d, %d)\n",
-                       s->avctx->frame_number, x, y);
-                return;
-            }
-        }
-    }
-    if (bytestream2_get_bytes_left(&s->stream_ptr) > 1) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Interplay video: decode finished with %d bytes left over\n",
-               bytestream2_get_bytes_left(&s->stream_ptr));
-    }
-}
-
-static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
-{
-    IpvideoContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    s->is_16bpp = avctx->bits_per_coded_sample == 16;
-    avctx->pix_fmt = s->is_16bpp ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_PAL8;
-
-    ff_hpeldsp_init(&s->hdsp, avctx->flags);
-
-    s->last_frame        = av_frame_alloc();
-    s->second_last_frame = av_frame_alloc();
-    if (!s->last_frame || !s->second_last_frame) {
-        av_frame_free(&s->last_frame);
-        av_frame_free(&s->second_last_frame);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static int ipvideo_decode_frame(AVCodecContext *avctx,
-                                void *data, int *got_frame,
-                                AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    IpvideoContext *s = avctx->priv_data;
-    AVFrame *frame = data;
-    int ret;
-
-    /* decoding map contains 4 bits of information per 8x8 block */
-    s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);
-
-    /* compressed buffer needs to be large enough to at least hold an entire
-     * decoding map */
-    if (buf_size < s->decoding_map_size)
-        return buf_size;
-
-    s->decoding_map = buf;
-    bytestream2_init(&s->stream_ptr, buf + s->decoding_map_size,
-                     buf_size - s->decoding_map_size);
-
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "  Interplay Video: get_buffer() failed\n");
-        return ret;
-    }
-
-    if (!s->is_16bpp) {
-        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-        if (pal) {
-            frame->palette_has_changed = 1;
-            memcpy(s->pal, pal, AVPALETTE_SIZE);
-        }
-    }
-
-    ipvideo_decode_opcodes(s, frame);
-
-    *got_frame = 1;
-
-    /* shuffle frames */
-    av_frame_unref(s->second_last_frame);
-    FFSWAP(AVFrame*, s->second_last_frame, s->last_frame);
-    if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
-        return ret;
-
-    /* report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int ipvideo_decode_end(AVCodecContext *avctx)
-{
-    IpvideoContext *s = avctx->priv_data;
-
-    av_frame_free(&s->last_frame);
-    av_frame_free(&s->second_last_frame);
-
-    return 0;
-}
-
-AVCodec ff_interplay_video_decoder = {
-    .name           = "interplayvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("Interplay MVE video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_INTERPLAY_VIDEO,
-    .priv_data_size = sizeof(IpvideoContext),
-    .init           = ipvideo_decode_init,
-    .close          = ipvideo_decode_end,
-    .decode         = ipvideo_decode_frame,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_PARAM_CHANGE,
-};
diff --git a/deps/libav/libavcodec/intrax8.c b/deps/libav/libavcodec/intrax8.c
deleted file mode 100644
index 0cad9da..0000000
--- a/deps/libav/libavcodec/intrax8.c
+++ /dev/null
@@ -1,791 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief IntraX8 (J-Frame) subdecoder, used by WMV2 and VC-1
- */
-
-#include "avcodec.h"
-#include "error_resilience.h"
-#include "get_bits.h"
-#include "mpegvideo.h"
-#include "msmpeg4data.h"
-#include "intrax8huf.h"
-#include "intrax8.h"
-#include "intrax8dsp.h"
-
-#define MAX_TABLE_DEPTH(table_bits, max_bits) ((max_bits+table_bits-1)/table_bits)
-
-#define DC_VLC_BITS 9
-#define AC_VLC_BITS 9
-#define OR_VLC_BITS 7
-
-#define DC_VLC_MTD MAX_TABLE_DEPTH(DC_VLC_BITS, MAX_DC_VLC_BITS)
-#define AC_VLC_MTD MAX_TABLE_DEPTH(AC_VLC_BITS, MAX_AC_VLC_BITS)
-#define OR_VLC_MTD MAX_TABLE_DEPTH(OR_VLC_BITS, MAX_OR_VLC_BITS)
-
-static VLC j_ac_vlc[2][2][8];  //[quant<13],[intra/inter],[select]
-static VLC j_dc_vlc[2][8];     //[quant], [select]
-static VLC j_orient_vlc[2][4]; //[quant], [select]
-
-static av_cold void x8_vlc_init(void){
-    int i;
-    int offset = 0;
-    int sizeidx = 0;
-    static const uint16_t sizes[8*4 + 8*2 + 2 + 4] = {
-        576, 548, 582, 618, 546, 616, 560, 642,
-        584, 582, 704, 664, 512, 544, 656, 640,
-        512, 648, 582, 566, 532, 614, 596, 648,
-        586, 552, 584, 590, 544, 578, 584, 624,
-
-        528, 528, 526, 528, 536, 528, 526, 544,
-        544, 512, 512, 528, 528, 544, 512, 544,
-
-        128, 128, 128, 128, 128, 128};
-
-    static VLC_TYPE table[28150][2];
-
-#define  init_ac_vlc(dst,src) \
-    dst.table = &table[offset]; \
-    dst.table_allocated = sizes[sizeidx]; \
-    offset += sizes[sizeidx++]; \
-       init_vlc(&dst, \
-              AC_VLC_BITS,77, \
-              &src[1],4,2, \
-              &src[0],4,2, \
-              INIT_VLC_USE_NEW_STATIC)
-//set ac tables
-    for(i=0;i<8;i++){
-        init_ac_vlc( j_ac_vlc[0][0][i], x8_ac0_highquant_table[i][0] );
-        init_ac_vlc( j_ac_vlc[0][1][i], x8_ac1_highquant_table[i][0] );
-        init_ac_vlc( j_ac_vlc[1][0][i], x8_ac0_lowquant_table [i][0] );
-        init_ac_vlc( j_ac_vlc[1][1][i], x8_ac1_lowquant_table [i][0] );
-    }
-#undef init_ac_vlc
-
-//set dc tables
-#define init_dc_vlc(dst,src) \
-    dst.table = &table[offset]; \
-    dst.table_allocated = sizes[sizeidx]; \
-    offset += sizes[sizeidx++]; \
-        init_vlc(&dst, \
-        DC_VLC_BITS,34, \
-        &src[1],4,2, \
-        &src[0],4,2, \
-        INIT_VLC_USE_NEW_STATIC);
-    for(i=0;i<8;i++){
-        init_dc_vlc( j_dc_vlc[0][i], x8_dc_highquant_table[i][0]);
-        init_dc_vlc( j_dc_vlc[1][i], x8_dc_lowquant_table [i][0]);
-    }
-#undef init_dc_vlc
-
-//set orient tables
-#define init_or_vlc(dst,src) \
-    dst.table = &table[offset]; \
-    dst.table_allocated = sizes[sizeidx]; \
-    offset += sizes[sizeidx++]; \
-    init_vlc(&dst, \
-    OR_VLC_BITS,12, \
-    &src[1],4,2, \
-    &src[0],4,2, \
-    INIT_VLC_USE_NEW_STATIC);
-    for(i=0;i<2;i++){
-        init_or_vlc( j_orient_vlc[0][i], x8_orient_highquant_table[i][0]);
-    }
-    for(i=0;i<4;i++){
-        init_or_vlc( j_orient_vlc[1][i], x8_orient_lowquant_table [i][0])
-    }
-    if (offset != sizeof(table)/sizeof(VLC_TYPE)/2)
-        av_log(NULL, AV_LOG_ERROR, "table size %i does not match needed %i\n", (int)(sizeof(table)/sizeof(VLC_TYPE)/2), offset);
-}
-#undef init_or_vlc
-
-static void x8_reset_vlc_tables(IntraX8Context * w){
-    memset(w->j_dc_vlc,0,sizeof(w->j_dc_vlc));
-    memset(w->j_ac_vlc,0,sizeof(w->j_ac_vlc));
-    w->j_orient_vlc=NULL;
-}
-
-static inline void x8_select_ac_table(IntraX8Context * const w , int mode){
-    MpegEncContext * const s= w->s;
-    int table_index;
-
-    assert(mode<4);
-
-    if( w->j_ac_vlc[mode] ) return;
-
-    table_index = get_bits(&s->gb, 3);
-    w->j_ac_vlc[mode] = &j_ac_vlc[w->quant<13][mode>>1][table_index];//2 modes use same tables
-    assert(w->j_ac_vlc[mode]);
-}
-
-static inline int x8_get_orient_vlc(IntraX8Context * w){
-    MpegEncContext * const s= w->s;
-    int table_index;
-
-    if(!w->j_orient_vlc ){
-        table_index = get_bits(&s->gb, 1+(w->quant<13) );
-        w->j_orient_vlc = &j_orient_vlc[w->quant<13][table_index];
-    }
-    assert(w->j_orient_vlc);
-    assert(w->j_orient_vlc->table);
-
-    return get_vlc2(&s->gb, w->j_orient_vlc->table, OR_VLC_BITS, OR_VLC_MTD);
-}
-
-#define extra_bits(eb) (eb)
-#define extra_run   (0xFF<<8)
-#define extra_level (0x00<<8)
-#define   run_offset(r)    ((r)<<16)
-#define level_offset(l)    ((l)<<24)
-static const uint32_t ac_decode_table[]={
-    /*46*/ extra_bits(3) |  extra_run  | run_offset(16) | level_offset( 0),
-    /*47*/ extra_bits(3) |  extra_run  | run_offset(24) | level_offset( 0),
-    /*48*/ extra_bits(2) |  extra_run  | run_offset( 4) | level_offset( 1),
-    /*49*/ extra_bits(3) |  extra_run  | run_offset( 8) | level_offset( 1),
-
-    /*50*/ extra_bits(5) |  extra_run  | run_offset(32) | level_offset( 0),
-    /*51*/ extra_bits(4) |  extra_run  | run_offset(16) | level_offset( 1),
-
-    /*52*/ extra_bits(2) | extra_level | run_offset( 0) | level_offset( 4),
-    /*53*/ extra_bits(2) | extra_level | run_offset( 0) | level_offset( 8),
-    /*54*/ extra_bits(2) | extra_level | run_offset( 0) | level_offset(12),
-    /*55*/ extra_bits(3) | extra_level | run_offset( 0) | level_offset(16),
-    /*56*/ extra_bits(3) | extra_level | run_offset( 0) | level_offset(24),
-
-    /*57*/ extra_bits(2) | extra_level | run_offset( 1) | level_offset( 3),
-    /*58*/ extra_bits(3) | extra_level | run_offset( 1) | level_offset( 7),
-
-    /*59*/ extra_bits(2) |  extra_run  | run_offset(16) | level_offset( 0),
-    /*60*/ extra_bits(2) |  extra_run  | run_offset(20) | level_offset( 0),
-    /*61*/ extra_bits(2) |  extra_run  | run_offset(24) | level_offset( 0),
-    /*62*/ extra_bits(2) |  extra_run  | run_offset(28) | level_offset( 0),
-    /*63*/ extra_bits(4) |  extra_run  | run_offset(32) | level_offset( 0),
-    /*64*/ extra_bits(4) |  extra_run  | run_offset(48) | level_offset( 0),
-
-    /*65*/ extra_bits(2) |  extra_run  | run_offset( 4) | level_offset( 1),
-    /*66*/ extra_bits(3) |  extra_run  | run_offset( 8) | level_offset( 1),
-    /*67*/ extra_bits(4) |  extra_run  | run_offset(16) | level_offset( 1),
-
-    /*68*/ extra_bits(2) | extra_level | run_offset( 0) | level_offset( 4),
-    /*69*/ extra_bits(3) | extra_level | run_offset( 0) | level_offset( 8),
-    /*70*/ extra_bits(4) | extra_level | run_offset( 0) | level_offset(16),
-
-    /*71*/ extra_bits(2) | extra_level | run_offset( 1) | level_offset( 3),
-    /*72*/ extra_bits(3) | extra_level | run_offset( 1) | level_offset( 7),
-};
-//extra_bits = 3bits; extra_run/level = 1 bit; run_offset = 6bits; level_offset = 5 bits;
-#undef extra_bits
-#undef extra_run
-#undef extra_level
-#undef run_offset
-#undef level_offset
-
-static void x8_get_ac_rlf(IntraX8Context * const w, const int mode,
-                     int * const run, int * const level, int * const final){
-    MpegEncContext *  const s= w->s;
-    int i,e;
-
-//    x8_select_ac_table(w,mode);
-    i = get_vlc2(&s->gb, w->j_ac_vlc[mode]->table, AC_VLC_BITS, AC_VLC_MTD);
-
-    if(i<46){ //[0-45]
-        int t,l;
-        if(i<0){
-            (*level)=(*final)=//prevent 'may be used unilitialized'
-            (*run)=64;//this would cause error exit in the ac loop
-            return;
-        }
-
-        (*final) = t = (i>22);
-        i-=23*t;
-/*
-  i== 0-15 r=0-15 l=0 ;r=i& %01111
-  i==16-19 r=0-3  l=1 ;r=i& %00011
-  i==20-21 r=0-1  l=2 ;r=i& %00001
-  i==22    r=0    l=3 ;r=i& %00000
-l=lut_l[i/2]={0,0,0,0,0,0,0,0,1,1,2,3}[i>>1];// 11 10'01 01'00 00'00 00'00 00'00 00 => 0xE50000
-t=lut_mask[l]={0x0f,0x03,0x01,0x00}[l]; as i<256 the higher bits do not matter */
-        l=(0xE50000>>(i&(0x1E)))&3;/*0x1E or (~1) or ((i>>1)<<1)*/
-        t=(0x01030F>>(l<<3));
-
-        (*run)   = i&t;
-        (*level) = l;
-    }else if(i<73){//[46-72]
-        uint32_t sm;
-        uint32_t mask;
-
-        i-=46;
-        sm=ac_decode_table[i];
-
-        e=get_bits(&s->gb,sm&0xF);sm>>=8;//3bits
-        mask=sm&0xff;sm>>=8;             //1bit
-
-        (*run)  =(sm&0xff) + (e&( mask));//6bits
-        (*level)=(sm>>8)   + (e&(~mask));//5bits
-        (*final)=i>(58-46);
-    }else if(i<75){//[73-74]
-        static const uint8_t crazy_mix_runlevel[32]={
-        0x22,0x32,0x33,0x53,0x23,0x42,0x43,0x63,
-        0x24,0x52,0x34,0x73,0x25,0x62,0x44,0x83,
-        0x26,0x72,0x35,0x54,0x27,0x82,0x45,0x64,
-        0x28,0x92,0x36,0x74,0x29,0xa2,0x46,0x84};
-
-        (*final)=!(i&1);
-        e=get_bits(&s->gb,5);//get the extra bits
-        (*run)  =crazy_mix_runlevel[e]>>4;
-        (*level)=crazy_mix_runlevel[e]&0x0F;
-    }else{
-        (*level)=get_bits( &s->gb, 7-3*(i&1));
-        (*run)  =get_bits( &s->gb, 6);
-        (*final)=get_bits1(&s->gb);
-    }
-    return;
-}
-
-//static const uint8_t dc_extra_sbits[]   ={0, 1,1, 1,1, 2,2, 3,3,   4,4,   5,5,   6,6,    7,7    };
-static const uint8_t dc_index_offset[]  ={ 0, 1,2, 3,4, 5,7, 9,13, 17,25, 33,49, 65,97, 129,193};
-
-static int x8_get_dc_rlf(IntraX8Context * const w,int const mode, int * const level, int * const final){
-    MpegEncContext * const s= w->s;
-    int i,e,c;
-
-    assert(mode<3);
-    if( !w->j_dc_vlc[mode] ) {
-        int table_index;
-        table_index = get_bits(&s->gb, 3);
-        //4 modes, same table
-        w->j_dc_vlc[mode]= &j_dc_vlc[w->quant<13][table_index];
-    }
-    assert(w->j_dc_vlc);
-    assert(w->j_dc_vlc[mode]->table);
-
-    i=get_vlc2(&s->gb, w->j_dc_vlc[mode]->table, DC_VLC_BITS, DC_VLC_MTD);
-
-    /*(i>=17) {i-=17;final=1;}*/
-    c= i>16;
-    (*final)=c;
-    i-=17*c;
-
-    if(i<=0){
-        (*level)=0;
-        return -i;
-    }
-    c=(i+1)>>1;//hackish way to calculate dc_extra_sbits[]
-    c-=c>1;
-
-    e=get_bits(&s->gb,c);//get the extra bits
-    i=dc_index_offset[i]+(e>>1);
-
-    e= -(e & 1);//0,0xffffff
-    (*level)= (i ^ e) - e;// (i^0)-0 , (i^0xff)-(-1)
-    return 0;
-}
-//end of huffman
-
-static int x8_setup_spatial_predictor(IntraX8Context * const w, const int chroma){
-    MpegEncContext * const s= w->s;
-    int range;
-    int sum;
-    int quant;
-
-    w->dsp.setup_spatial_compensation(s->dest[chroma], s->edge_emu_buffer,
-                                      s->current_picture.f.linesize[chroma>0],
-                                      &range, &sum, w->edges);
-    if(chroma){
-        w->orient=w->chroma_orient;
-        quant=w->quant_dc_chroma;
-    }else{
-        quant=w->quant;
-    }
-
-    w->flat_dc=0;
-    if(range < quant || range < 3){
-        w->orient=0;
-        if(range < 3){//yep you read right, a +-1 idct error may break decoding!
-            w->flat_dc=1;
-            sum+=9;
-            w->predicted_dc = (sum*6899)>>17;//((1<<17)+9)/(8+8+1+2)=6899
-        }
-    }
-    if(chroma)
-        return 0;
-
-    assert(w->orient < 3);
-    if(range < 2*w->quant){
-        if( (w->edges&3) == 0){
-            if(w->orient==1) w->orient=11;
-            if(w->orient==2) w->orient=10;
-        }else{
-            w->orient=0;
-        }
-        w->raw_orient=0;
-    }else{
-        static const uint8_t prediction_table[3][12]={
-            {0,8,4, 10,11, 2,6,9,1,3,5,7},
-            {4,0,8, 11,10, 3,5,2,6,9,1,7},
-            {8,0,4, 10,11, 1,7,2,6,9,3,5}
-        };
-        w->raw_orient=x8_get_orient_vlc(w);
-        if(w->raw_orient<0) return -1;
-        assert(w->raw_orient < 12 );
-        assert(w->orient<3);
-        w->orient=prediction_table[w->orient][w->raw_orient];
-    }
-    return 0;
-}
-
-static void x8_update_predictions(IntraX8Context * const w, const int orient, const int est_run ){
-    MpegEncContext * const s= w->s;
-
-    w->prediction_table[s->mb_x*2+(s->mb_y&1)] = (est_run<<2) + 1*(orient==4) + 2*(orient==8);
-/*
-  y=2n+0 ->//0 2 4
-  y=2n+1 ->//1 3 5
-*/
-}
-static void x8_get_prediction_chroma(IntraX8Context * const w){
-    MpegEncContext * const s= w->s;
-
-    w->edges = 1*( !(s->mb_x>>1) );
-    w->edges|= 2*( !(s->mb_y>>1) );
-    w->edges|= 4*( s->mb_x >= (2*s->mb_width-1) );//mb_x for chroma would always be odd
-
-    w->raw_orient=0;
-    if(w->edges&3){//lut_co[8]={inv,4,8,8, inv,4,8,8}<- =>{1,1,0,0;1,1,0,0} => 0xCC
-        w->chroma_orient=4<<((0xCC>>w->edges)&1);
-        return;
-    }
-    w->chroma_orient = (w->prediction_table[2*s->mb_x-2] & 0x03)<<2;//block[x-1][y|1-1)]
-}
-
-static void x8_get_prediction(IntraX8Context * const w){
-    MpegEncContext * const s= w->s;
-    int a,b,c,i;
-
-    w->edges = 1*( !s->mb_x );
-    w->edges|= 2*( !s->mb_y );
-    w->edges|= 4*( s->mb_x >= (2*s->mb_width-1) );
-
-    switch(w->edges&3){
-        case 0:
-            break;
-        case 1:
-            //take the one from the above block[0][y-1]
-            w->est_run = w->prediction_table[!(s->mb_y&1)]>>2;
-            w->orient  = 1;
-            return;
-        case 2:
-            //take the one from the previous block[x-1][0]
-            w->est_run = w->prediction_table[2*s->mb_x-2]>>2;
-            w->orient  = 2;
-            return;
-        case 3:
-            w->est_run = 16;
-            w->orient  = 0;
-            return;
-    }
-    //no edge cases
-    b= w->prediction_table[2*s->mb_x   + !(s->mb_y&1) ];//block[x  ][y-1]
-    a= w->prediction_table[2*s->mb_x-2 +  (s->mb_y&1) ];//block[x-1][y  ]
-    c= w->prediction_table[2*s->mb_x-2 + !(s->mb_y&1) ];//block[x-1][y-1]
-
-    w->est_run = FFMIN(b,a);
-    /* This condition has nothing to do with w->edges, even if it looks
-       similar it would trigger if e.g. x=3;y=2;
-       I guess somebody wrote something wrong and it became standard. */
-    if( (s->mb_x & s->mb_y) != 0 ) w->est_run=FFMIN(c,w->est_run);
-    w->est_run>>=2;
-
-    a&=3;
-    b&=3;
-    c&=3;
-
-    i=( 0xFFEAF4C4>>(2*b+8*a) )&3;
-    if(i!=3) w->orient=i;
-    else     w->orient=( 0xFFEAD8>>(2*c+8*(w->quant>12)) )&3;
-/*
-lut1[b][a]={
-->{0, 1, 0, pad},
-  {0, 1, X, pad},
-  {2, 2, 2, pad}}
-   pad 2   2  2; pad X  1  0; pad 0  1  0 <-
--> 11 10 '10 10 '11 11'01 00 '11 00'01 00=>0xEAF4C4
-
-lut2[q>12][c]={
-  ->{0,2,1,pad},
-    {2,2,2,pad}}
-   pad 2  2  2; pad 1  2  0 <-
--> 11 10'10 10 '11 01'10 00=>0xEAD8
-*/
-}
-
-
-static void x8_ac_compensation(IntraX8Context * const w, int const direction, int const dc_level){
-    MpegEncContext * const s= w->s;
-    int t;
-#define B(x,y)  s->block[0][s->dsp.idct_permutation[(x)+(y)*8]]
-#define T(x)  ((x) * dc_level + 0x8000) >> 16;
-    switch(direction){
-    case 0:
-        t = T(3811);//h
-        B(1,0) -= t;
-        B(0,1) -= t;
-
-        t = T(487);//e
-        B(2,0) -= t;
-        B(0,2) -= t;
-
-        t = T(506);//f
-        B(3,0) -= t;
-        B(0,3) -= t;
-
-        t = T(135);//c
-        B(4,0) -= t;
-        B(0,4) -= t;
-        B(2,1) += t;
-        B(1,2) += t;
-        B(3,1) += t;
-        B(1,3) += t;
-
-        t = T(173);//d
-        B(5,0) -= t;
-        B(0,5) -= t;
-
-        t = T(61);//b
-        B(6,0) -= t;
-        B(0,6) -= t;
-        B(5,1) += t;
-        B(1,5) += t;
-
-        t = T(42); //a
-        B(7,0) -= t;
-        B(0,7) -= t;
-        B(4,1) += t;
-        B(1,4) += t;
-        B(4,4) += t;
-
-        t = T(1084);//g
-        B(1,1) += t;
-
-        s->block_last_index[0] = FFMAX(s->block_last_index[0], 7*8);
-        break;
-    case 1:
-        B(0,1) -= T(6269);
-        B(0,3) -= T( 708);
-        B(0,5) -= T( 172);
-        B(0,7) -= T(  73);
-
-        s->block_last_index[0] = FFMAX(s->block_last_index[0], 7*8);
-        break;
-    case 2:
-        B(1,0) -= T(6269);
-        B(3,0) -= T( 708);
-        B(5,0) -= T( 172);
-        B(7,0) -= T(  73);
-
-        s->block_last_index[0] = FFMAX(s->block_last_index[0], 7);
-        break;
-    }
-#undef B
-#undef T
-}
-
-static void dsp_x8_put_solidcolor(uint8_t const pix, uint8_t * dst, int const linesize){
-    int k;
-    for(k=0;k<8;k++){
-        memset(dst,pix,8);
-        dst+=linesize;
-    }
-}
-
-static const int16_t quant_table[64] = {
-    256, 256, 256, 256,  256, 256, 259, 262,
-    265, 269, 272, 275,  278, 282, 285, 288,
-    292, 295, 299, 303,  306, 310, 314, 317,
-    321, 325, 329, 333,  337, 341, 345, 349,
-    353, 358, 362, 366,  371, 375, 379, 384,
-    389, 393, 398, 403,  408, 413, 417, 422,
-    428, 433, 438, 443,  448, 454, 459, 465,
-    470, 476, 482, 488,  493, 499, 505, 511
-};
-
-static int x8_decode_intra_mb(IntraX8Context* const w, const int chroma){
-    MpegEncContext * const s= w->s;
-
-    uint8_t * scantable;
-    int final,run,level;
-    int ac_mode,dc_mode,est_run,dc_level;
-    int pos,n;
-    int zeros_only;
-    int use_quant_matrix;
-    int sign;
-
-    assert(w->orient<12);
-    s->dsp.clear_block(s->block[0]);
-
-    if(chroma){
-        dc_mode=2;
-    }else{
-        dc_mode=!!w->est_run;//0,1
-    }
-
-    if(x8_get_dc_rlf(w, dc_mode, &dc_level, &final)) return -1;
-    n=0;
-    zeros_only=0;
-    if(!final){//decode ac
-        use_quant_matrix=w->use_quant_matrix;
-        if(chroma){
-            ac_mode = 1;
-            est_run = 64;//not used
-        }else{
-            if (w->raw_orient < 3){
-                use_quant_matrix = 0;
-            }
-            if(w->raw_orient > 4){
-                ac_mode = 0;
-                est_run = 64;
-            }else{
-                if(w->est_run > 1){
-                    ac_mode = 2;
-                    est_run=w->est_run;
-                }else{
-                    ac_mode = 3;
-                    est_run = 64;
-                }
-            }
-        }
-        x8_select_ac_table(w,ac_mode);
-        /*scantable_selector[12]={0,2,0,1,1,1,0,2,2,0,1,2};<-
-        -> 10'01' 00'10' 10'00' 01'01' 01'00' 10'00 =>0x928548 */
-        scantable = w->scantable[ (0x928548>>(2*w->orient))&3 ].permutated;
-        pos=0;
-        do {
-            n++;
-            if( n >= est_run ){
-                ac_mode=3;
-                x8_select_ac_table(w,3);
-            }
-
-            x8_get_ac_rlf(w,ac_mode,&run,&level,&final);
-
-            pos+=run+1;
-            if(pos>63){
-                //this also handles vlc error in x8_get_ac_rlf
-                return -1;
-            }
-            level= (level+1) * w->dquant;
-            level+= w->qsum;
-
-            sign = - get_bits1(&s->gb);
-            level = (level ^ sign) - sign;
-
-            if(use_quant_matrix){
-                level = (level*quant_table[pos])>>8;
-            }
-            s->block[0][ scantable[pos] ]=level;
-        }while(!final);
-
-        s->block_last_index[0]=pos;
-    }else{//DC only
-        s->block_last_index[0]=0;
-        if(w->flat_dc && ((unsigned)(dc_level+1)) < 3){//[-1;1]
-            int32_t divide_quant= !chroma ? w->divide_quant_dc_luma:
-                                            w->divide_quant_dc_chroma;
-            int32_t dc_quant    = !chroma ? w->quant:
-                                            w->quant_dc_chroma;
-
-            //original intent dc_level+=predicted_dc/quant; but it got lost somewhere in the rounding
-            dc_level+= (w->predicted_dc*divide_quant + (1<<12) )>>13;
-
-            dsp_x8_put_solidcolor( av_clip_uint8((dc_level*dc_quant+4)>>3),
-                                   s->dest[chroma], s->current_picture.f.linesize[!!chroma]);
-
-            goto block_placed;
-        }
-        zeros_only = (dc_level == 0);
-    }
-    if(!chroma){
-        s->block[0][0] = dc_level*w->quant;
-    }else{
-        s->block[0][0] = dc_level*w->quant_dc_chroma;
-    }
-
-    //there is !zero_only check in the original, but dc_level check is enough
-    if( (unsigned int)(dc_level+1) >= 3 && (w->edges&3) != 3 ){
-        int direction;
-        /*ac_comp_direction[orient] = { 0, 3, 3, 1, 1, 0, 0, 0, 2, 2, 2, 1 };<-
-        -> 01'10' 10'10' 00'00' 00'01' 01'11' 11'00 =>0x6A017C */
-        direction= (0x6A017C>>(w->orient*2))&3;
-        if (direction != 3){
-            x8_ac_compensation(w, direction, s->block[0][0]);//modify block_last[]
-        }
-    }
-
-    if(w->flat_dc){
-        dsp_x8_put_solidcolor(w->predicted_dc, s->dest[chroma], s->current_picture.f.linesize[!!chroma]);
-    }else{
-        w->dsp.spatial_compensation[w->orient]( s->edge_emu_buffer,
-                                            s->dest[chroma],
-                                            s->current_picture.f.linesize[!!chroma] );
-    }
-    if(!zeros_only)
-        s->dsp.idct_add ( s->dest[chroma],
-                          s->current_picture.f.linesize[!!chroma],
-                          s->block[0] );
-
-block_placed:
-
-    if(!chroma){
-        x8_update_predictions(w,w->orient,n);
-    }
-
-    if(s->loop_filter){
-        uint8_t* ptr = s->dest[chroma];
-        int linesize = s->current_picture.f.linesize[!!chroma];
-
-        if(!( (w->edges&2) || ( zeros_only && (w->orient|4)==4 ) )){
-            w->dsp.h_loop_filter(ptr, linesize, w->quant);
-        }
-        if(!( (w->edges&1) || ( zeros_only && (w->orient|8)==8 ) )){
-            w->dsp.v_loop_filter(ptr, linesize, w->quant);
-        }
-    }
-    return 0;
-}
-
-static void x8_init_block_index(MpegEncContext *s){ //FIXME maybe merge with ff_*
-//not s->linesize as this would be wrong for field pics
-//not that IntraX8 has interlacing support ;)
-    const int linesize   = s->current_picture.f.linesize[0];
-    const int uvlinesize = s->current_picture.f.linesize[1];
-
-    s->dest[0] = s->current_picture.f.data[0];
-    s->dest[1] = s->current_picture.f.data[1];
-    s->dest[2] = s->current_picture.f.data[2];
-
-    s->dest[0] +=   s->mb_y        *   linesize << 3;
-    s->dest[1] += ( s->mb_y&(~1) ) * uvlinesize << 2;//chroma blocks are on add rows
-    s->dest[2] += ( s->mb_y&(~1) ) * uvlinesize << 2;
-}
-
-/**
- * Initialize IntraX8 frame decoder.
- * Requires valid MpegEncContext with valid s->mb_width before calling.
- * @param w pointer to IntraX8Context
- * @param s pointer to MpegEncContext of the parent codec
- */
-av_cold void ff_intrax8_common_init(IntraX8Context * w, MpegEncContext * const s){
-
-    w->s=s;
-    x8_vlc_init();
-    assert(s->mb_width>0);
-    w->prediction_table=av_mallocz(s->mb_width*2*2);//two rows, 2 blocks per cannon mb
-
-    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[0], ff_wmv1_scantable[0]);
-    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[1], ff_wmv1_scantable[2]);
-    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[2], ff_wmv1_scantable[3]);
-
-    ff_intrax8dsp_init(&w->dsp);
-}
-
-/**
- * Destroy IntraX8 frame structure.
- * @param w pointer to IntraX8Context
- */
-av_cold void ff_intrax8_common_end(IntraX8Context * w)
-{
-    av_freep(&w->prediction_table);
-}
-
-/**
- * Decode single IntraX8 frame.
- * The parent codec must fill s->loopfilter and s->gb (bitstream).
- * The parent codec must call MPV_frame_start(), ff_er_frame_start() before calling this function.
- * The parent codec must call ff_er_frame_end(), MPV_frame_end() after calling this function.
- * This function does not use MPV_decode_mb().
- * @param w pointer to IntraX8Context
- * @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1.
- * @param quant_offset offset away from zero
- */
-int ff_intrax8_decode_picture(IntraX8Context * const w, int dquant, int quant_offset){
-    MpegEncContext * const s= w->s;
-    int mb_xy;
-    assert(s);
-    w->use_quant_matrix = get_bits1(&s->gb);
-
-    w->dquant = dquant;
-    w->quant  = dquant >> 1;
-    w->qsum   = quant_offset;
-
-    w->divide_quant_dc_luma = ((1<<16) + (w->quant>>1)) / w->quant;
-    if(w->quant < 5){
-        w->quant_dc_chroma =  w->quant;
-        w->divide_quant_dc_chroma = w->divide_quant_dc_luma;
-    }else{
-        w->quant_dc_chroma =  w->quant+((w->quant+3)>>3);
-        w->divide_quant_dc_chroma = ((1<<16) + (w->quant_dc_chroma>>1)) / w->quant_dc_chroma;
-    }
-    x8_reset_vlc_tables(w);
-
-    s->resync_mb_x=0;
-    s->resync_mb_y=0;
-
-    for(s->mb_y=0; s->mb_y < s->mb_height*2; s->mb_y++){
-        x8_init_block_index(s);
-        mb_xy=(s->mb_y>>1)*s->mb_stride;
-
-        for(s->mb_x=0; s->mb_x < s->mb_width*2; s->mb_x++){
-            x8_get_prediction(w);
-            if(x8_setup_spatial_predictor(w,0)) goto error;
-            if(x8_decode_intra_mb(w,0)) goto error;
-
-            if( s->mb_x & s->mb_y & 1 ){
-                x8_get_prediction_chroma(w);
-
-                /*when setting up chroma, no vlc is read,
-                so no error condition can be reached*/
-                x8_setup_spatial_predictor(w,1);
-                if(x8_decode_intra_mb(w,1)) goto error;
-
-                x8_setup_spatial_predictor(w,2);
-                if(x8_decode_intra_mb(w,2)) goto error;
-
-                s->dest[1]+= 8;
-                s->dest[2]+= 8;
-
-                /*emulate MB info in the relevant tables*/
-                s->mbskip_table [mb_xy]=0;
-                s->mbintra_table[mb_xy]=1;
-                s->current_picture.qscale_table[mb_xy] = w->quant;
-                mb_xy++;
-            }
-            s->dest[0]+= 8;
-        }
-        if(s->mb_y&1){
-            ff_mpeg_draw_horiz_band(s, (s->mb_y-1)*8, 16);
-        }
-    }
-
-error:
-    ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                        (s->mb_x>>1)-1, (s->mb_y>>1)-1,
-                        ER_MB_END );
-    return 0;
-}
diff --git a/deps/libav/libavcodec/intrax8.h b/deps/libav/libavcodec/intrax8.h
deleted file mode 100644
index 6967317..0000000
--- a/deps/libav/libavcodec/intrax8.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_INTRAX8_H
-#define AVCODEC_INTRAX8_H
-
-#include "get_bits.h"
-#include "mpegvideo.h"
-#include "intrax8dsp.h"
-
-typedef struct IntraX8Context {
-    VLC * j_ac_vlc[4];//they point to the static j_mb_vlc
-    VLC * j_orient_vlc;
-    VLC * j_dc_vlc[3];
-
-    int use_quant_matrix;
-//set by ff_intrax8_common_init
-    uint8_t * prediction_table;//2*(mb_w*2)
-    ScanTable scantable[3];
-//set by the caller codec
-    MpegEncContext * s;
-    IntraX8DSPContext dsp;
-    int quant;
-    int dquant;
-    int qsum;
-//calculated per frame
-    int quant_dc_chroma;
-    int divide_quant_dc_luma;
-    int divide_quant_dc_chroma;
-//changed per block
-    int edges;
-    int flat_dc;
-    int predicted_dc;
-    int raw_orient;
-    int chroma_orient;
-    int orient;
-    int est_run;
-} IntraX8Context;
-
-void ff_intrax8_common_init(IntraX8Context * w, MpegEncContext * const s);
-void ff_intrax8_common_end(IntraX8Context * w);
-int  ff_intrax8_decode_picture(IntraX8Context * w, int quant, int halfpq);
-
-#endif /* AVCODEC_INTRAX8_H */
diff --git a/deps/libav/libavcodec/intrax8dsp.c b/deps/libav/libavcodec/intrax8dsp.c
deleted file mode 100644
index 1115945..0000000
--- a/deps/libav/libavcodec/intrax8dsp.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
-* @file
- *@brief IntraX8 frame subdecoder image manipulation routines
- */
-
-#include "intrax8dsp.h"
-#include "libavutil/common.h"
-
-/*
-area positions, #3 is 1 pixel only, other are 8 pixels
-   |66666666|
-  3|44444444|55555555|
-- -+--------+--------+
-1 2|XXXXXXXX|
-1 2|XXXXXXXX|
-1 2|XXXXXXXX|
-1 2|XXXXXXXX|
-1 2|XXXXXXXX|
-1 2|XXXXXXXX|
-1 2|XXXXXXXX|
-1 2|XXXXXXXX|
-^-start
-*/
-
-#define area1 (0)
-#define area2 (8)
-#define area3 (8+8)
-#define area4 (8+8+1)
-#define area5 (8+8+1+8)
-#define area6 (8+8+1+16)
-
-/**
- Collect statistics and prepare the edge pixels required by the other spatial compensation functions.
-
- * @param src pointer to the beginning of the processed block
- * @param dst pointer to emu_edge, edge pixels are stored the way other compensation routines do.
- * @param linesize byte offset between 2 vertical pixels in the source image
- * @param range pointer to the variable where the edge pixel range is to be stored (max-min values)
- * @param psum  pointer to the variable where the edge pixel sum is to be stored
- * @param edges Informs this routine that the block is on an image border, so it has to interpolate the missing edge pixels.
-                and some of the edge pixels should be interpolated, the flag has the following meaning:
-                1   - mb_x==0 - first block in the row, interpolate area #1,#2,#3;
-                2   - mb_y==0 - first row, interpolate area #3,#4,#5,#6;
-        note:   1|2 - mb_x==mb_y==0 - first block, use 0x80 value for all areas;
-                4   - mb_x>= (mb_width-1) last block in the row, interpolate area #5;
-*/
-static void x8_setup_spatial_compensation(uint8_t *src, uint8_t *dst, int linesize,
-           int * range, int * psum,  int edges){
-    uint8_t * ptr;
-    int sum;
-    int i;
-    int min_pix,max_pix;
-    uint8_t c;
-
-    if((edges&3)==3){
-        *psum=0x80*(8+1+8+2);
-        *range=0;
-        memset(dst,0x80,16+1+16+8);
-        //this triggers flat_dc for sure.
-        //flat_dc avoids all (other) prediction modes, but requires dc_level decoding.
-        return;
-    }
-
-    min_pix=256;
-    max_pix=-1;
-
-    sum=0;
-
-    if(!(edges&1)){//(mb_x!=0)//there is previous block on this row
-        ptr=src-1;//left column, area 2
-        for(i=7;i>=0;i--){
-            c=*(ptr-1);//area1, same mb as area2, no need to check
-            dst[area1+i]=c;
-            c=*(ptr);
-
-            sum+=c;
-            min_pix=FFMIN(min_pix,c);
-            max_pix=FFMAX(max_pix,c);
-            dst[area2+i]=c;
-
-            ptr+=linesize;
-        }
-    }
-
-    if(!(edges&2)){  //(mb_y!=0)//there is row above
-        ptr=src-linesize;//top line
-        for(i=0;i<8;i++){
-            c=*(ptr+i);
-            sum+=c;
-            min_pix=FFMIN(min_pix, c);
-            max_pix=FFMAX(max_pix, c);
-        }
-        if(edges&4){//last block on the row?
-            memset(dst+area5,c,8);//set with last pixel fr
-            memcpy(dst+area4, ptr, 8);
-        }else{
-            memcpy(dst+area4, ptr, 16);//both area4 and 5
-        }
-        memcpy(dst+area6, ptr-linesize, 8);//area6 always present in the above block
-    }
-    //now calculate the stuff we need
-    if(edges&3){//mb_x==0 || mb_y==0){
-        int avg=(sum+4)>>3;
-        if(edges&1){ //(mb_x==0) {//implies mb_y!=0
-            memset(dst+area1,avg,8+8+1);//areas 1,2 and 3 are averaged
-        }else{//implies y==0 x!=0
-            memset(dst+area3,avg, 1+16+8);//areas 3, 4,5,6
-        }
-        sum+=avg*9;
-    }else{
-        uint8_t c=*(src-1-linesize);//the edge pixel, in the top line and left column
-        dst[area3]=c;
-        sum+=c;
-        //edge pixel is not part of min/max
-    }
-    (*range) = max_pix - min_pix;
-    sum += *(dst+area5) + *(dst+area5+1);
-    *psum = sum;
-}
-
-
-static const uint16_t zero_prediction_weights[64*2] = {
-    640,  640,  669,  480,  708,  354,  748, 257,  792, 198,  760, 143,  808, 101,  772,  72,
-    480,  669,  537,  537,  598,  416,  661, 316,  719, 250,  707, 185,  768, 134,  745,  97,
-    354,  708,  416,  598,  488,  488,  564, 388,  634, 317,  642, 241,  716, 179,  706, 132,
-    257,  748,  316,  661,  388,  564,  469, 469,  543, 395,  571, 311,  655, 238,  660, 180,
-    198,  792,  250,  719,  317,  634,  395, 543,  469, 469,  507, 380,  597, 299,  616, 231,
-    161,  855,  206,  788,  266,  710,  340, 623,  411, 548,  455, 455,  548, 366,  576, 288,
-    122,  972,  159,  914,  211,  842,  276, 758,  341, 682,  389, 584,  483, 483,  520, 390,
-    110, 1172,  144, 1107,  193, 1028,  254, 932,  317, 846,  366, 731,  458, 611,  499, 499
-};
-
-static void spatial_compensation_0(uint8_t *src , uint8_t *dst, int linesize){
-    int i,j;
-    int x,y;
-    unsigned int p;//power divided by 2
-    int a;
-    uint16_t left_sum[2][8] = { { 0 } };
-    uint16_t  top_sum[2][8] = { { 0 } };
-
-    for(i=0;i<8;i++){
-        a=src[area2+7-i]<<4;
-        for(j=0;j<8;j++){
-            p=abs(i-j);
-            left_sum[p&1][j]+= a>>(p>>1);
-        }
-    }
-
-    for(i=0;i<8;i++){
-        a=src[area4+i]<<4;
-        for(j=0;j<8;j++){
-            p=abs(i-j);
-            top_sum[p&1][j]+=   a>>(p>>1);
-        }
-    }
-    for(;i<10;i++){
-        a=src[area4+i]<<4;
-        for(j=5;j<8;j++){
-            p=abs(i-j);
-            top_sum[p&1][j]+=   a>>(p>>1);
-        }
-    }
-    for(;i<12;i++){
-        a=src[area4+i]<<4;
-        for(j=7;j<8;j++){
-            p=abs(i-j);
-            top_sum[p&1][j]+=   a>>(p>>1);
-        }
-    }
-
-    for(i=0;i<8;i++){
-        top_sum [0][i]+=(top_sum [1][i]*181 + 128 )>>8;//181 is sqrt(2)/2
-        left_sum[0][i]+=(left_sum[1][i]*181 + 128 )>>8;
-    }
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x] = (
-                      (uint32_t)top_sum [0][x]*zero_prediction_weights[y*16+x*2+0] +
-                      (uint32_t)left_sum[0][y]*zero_prediction_weights[y*16+x*2+1] +
-                       0x8000
-                      )>>16;
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_1(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x]=src[area4 + FFMIN(2*y+x+2, 15) ];
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_2(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x]=src[area4 +1+y+x];
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_3(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x]=src[area4 +((y+1)>>1)+x];
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_4(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x]=( src[area4+x] + src[area6+x] + 1 )>>1;
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_5(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            if(2*x-y<0){
-                dst[x]=src[area2+9+2*x-y];
-            }else{
-                dst[x]=src[area4 +x-((y+1)>>1)];
-            }
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_6(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x]=src[area3+x-y];
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_7(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            if(x-2*y>0){
-                dst[x]=( src[area3-1+x-2*y] + src[area3+x-2*y] + 1)>>1;
-            }else{
-                dst[x]=src[area2+8-y +(x>>1)];
-            }
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_8(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x]=( src[area1+7-y] + src[area2+7-y] + 1 )>>1;
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_9(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x]=src[area2+6-FFMIN(x+y,6)];
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_10(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x]=(src[area2+7-y]*(8-x)+src[area4+x]*x+4)>>3;
-        }
-        dst+=linesize;
-    }
-}
-static void spatial_compensation_11(uint8_t *src , uint8_t *dst, int linesize){
-    int x,y;
-
-    for(y=0;y<8;y++){
-        for(x=0;x<8;x++){
-            dst[x]=(src[area2+7-y]*y+src[area4+x]*(8-y)+4)>>3;
-        }
-        dst+=linesize;
-    }
-}
-
-static void x8_loop_filter(uint8_t * ptr, const int a_stride, const int b_stride, int quant){
-    int i,t;
-    int p0,p1,p2,p3,p4,p5,p6,p7,p8,p9;
-    int ql=(quant+10)>>3;
-
-    for(i=0; i<8; i++,ptr+=b_stride){
-        p0=ptr[-5*a_stride];
-        p1=ptr[-4*a_stride];
-        p2=ptr[-3*a_stride];
-        p3=ptr[-2*a_stride];
-        p4=ptr[-1*a_stride];
-        p5=ptr[ 0         ];
-        p6=ptr[ 1*a_stride];
-        p7=ptr[ 2*a_stride];
-        p8=ptr[ 3*a_stride];
-        p9=ptr[ 4*a_stride];
-
-        t=
-            (FFABS(p1-p2) <= ql) +
-            (FFABS(p2-p3) <= ql) +
-            (FFABS(p3-p4) <= ql) +
-            (FFABS(p4-p5) <= ql);
-        if(t>0){//You need at least 1 to be able to reach a total score of 6.
-            t+=
-                (FFABS(p5-p6) <= ql) +
-                (FFABS(p6-p7) <= ql) +
-                (FFABS(p7-p8) <= ql) +
-                (FFABS(p8-p9) <= ql) +
-                (FFABS(p0-p1) <= ql);
-            if(t>=6){
-                int min,max;
-
-                min=max=p1;
-                min=FFMIN(min,p3); max=FFMAX(max,p3);
-                min=FFMIN(min,p5); max=FFMAX(max,p5);
-                min=FFMIN(min,p8); max=FFMAX(max,p8);
-                if(max-min<2*quant){//early stop
-                    min=FFMIN(min,p2); max=FFMAX(max,p2);
-                    min=FFMIN(min,p4); max=FFMAX(max,p4);
-                    min=FFMIN(min,p6); max=FFMAX(max,p6);
-                    min=FFMIN(min,p7); max=FFMAX(max,p7);
-                    if(max-min<2*quant){
-                        ptr[-2*a_stride]=(4*p2 + 3*p3 + 1*p7 + 4)>>3;
-                        ptr[-1*a_stride]=(3*p2 + 3*p4 + 2*p7 + 4)>>3;
-                        ptr[ 0         ]=(2*p2 + 3*p5 + 3*p7 + 4)>>3;
-                        ptr[ 1*a_stride]=(1*p2 + 3*p6 + 4*p7 + 4)>>3;
-                        continue;
-                    };
-                }
-            }
-        }
-        {
-            int x,x0,x1,x2;
-            int m;
-
-            x0 =   (2*p3 - 5*p4 + 5*p5 - 2*p6 + 4)>>3;
-            if(FFABS(x0) < quant){
-                x1=(2*p1 - 5*p2 + 5*p3 - 2*p4 + 4)>>3;
-                x2=(2*p5 - 5*p6 + 5*p7 - 2*p8 + 4)>>3;
-
-                x=FFABS(x0) - FFMIN( FFABS(x1), FFABS(x2) );
-                m=p4-p5;
-
-                if( x > 0 && (m^x0) <0){
-                    int32_t sign;
-
-                    sign=m>>31;
-                    m=(m^sign)-sign;//abs(m)
-                    m>>=1;
-
-                    x=(5*x)>>3;
-
-                    if(x>m) x=m;
-
-                    x=(x^sign)-sign;
-
-                    ptr[-1*a_stride] -= x;
-                    ptr[ 0]          += x;
-                }
-            }
-        }
-    }
-}
-
-static void x8_h_loop_filter(uint8_t *src, int stride, int qscale){
-    x8_loop_filter(src, stride, 1, qscale);
-}
-
-static void x8_v_loop_filter(uint8_t *src, int stride, int qscale){
-    x8_loop_filter(src, 1, stride, qscale);
-}
-
-av_cold void ff_intrax8dsp_init(IntraX8DSPContext *dsp)
-{
-    dsp->h_loop_filter=x8_h_loop_filter;
-    dsp->v_loop_filter=x8_v_loop_filter;
-    dsp->setup_spatial_compensation=x8_setup_spatial_compensation;
-    dsp->spatial_compensation[0]=spatial_compensation_0;
-    dsp->spatial_compensation[1]=spatial_compensation_1;
-    dsp->spatial_compensation[2]=spatial_compensation_2;
-    dsp->spatial_compensation[3]=spatial_compensation_3;
-    dsp->spatial_compensation[4]=spatial_compensation_4;
-    dsp->spatial_compensation[5]=spatial_compensation_5;
-    dsp->spatial_compensation[6]=spatial_compensation_6;
-    dsp->spatial_compensation[7]=spatial_compensation_7;
-    dsp->spatial_compensation[8]=spatial_compensation_8;
-    dsp->spatial_compensation[9]=spatial_compensation_9;
-    dsp->spatial_compensation[10]=spatial_compensation_10;
-    dsp->spatial_compensation[11]=spatial_compensation_11;
-}
diff --git a/deps/libav/libavcodec/intrax8dsp.h b/deps/libav/libavcodec/intrax8dsp.h
deleted file mode 100644
index 5c3cc4a..0000000
--- a/deps/libav/libavcodec/intrax8dsp.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_INTRAX8DSP_H
-#define AVCODEC_INTRAX8DSP_H
-
-#include <stdint.h>
-
-typedef struct IntraX8DSPContext {
-    void (*v_loop_filter)(uint8_t *src, int stride, int qscale);
-    void (*h_loop_filter)(uint8_t *src, int stride, int qscale);
-
-    void (*spatial_compensation[12])(uint8_t *src , uint8_t *dst, int linesize);
-    void (*setup_spatial_compensation)(uint8_t *src, uint8_t *dst, int linesize,
-                                       int *range, int *sum,  int edges);
-} IntraX8DSPContext;
-
-void ff_intrax8dsp_init(IntraX8DSPContext *dsp);
-
-#endif /* AVCODEC_INTRAX8DSP_H */
diff --git a/deps/libav/libavcodec/intrax8huf.h b/deps/libav/libavcodec/intrax8huf.h
deleted file mode 100644
index 6bf01f3..0000000
--- a/deps/libav/libavcodec/intrax8huf.h
+++ /dev/null
@@ -1,918 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_INTRAX8HUF_H
-#define AVCODEC_INTRAX8HUF_H
-
-#include <inttypes.h>
-
-
-static const uint16_t x8_orient_lowquant_table[4][12][2]={
-    {//0
-        {0x0000,  1}, {0x0004,  3}, {0x0005,  3}, {0x000C,  4},
-        {0x000D,  4}, {0x0038,  6}, {0x001D,  5}, {0x0039,  6},
-        {0x003C,  6}, {0x003D,  6}, {0x003E,  6}, {0x003F,  6},
-    },{//1
-        {0x0000,  5}, {0x0001,  5}, {0x0002,  5}, {0x0001,  2},
-        {0x0002,  2}, {0x0002,  4}, {0x0003,  5}, {0x0006,  3},
-        {0x0003,  4}, {0x000E,  4}, {0x001E,  5}, {0x001F,  5},
-    },{//2
-        {0x0000,  2}, {0x0001,  2}, {0x0004,  3}, {0x0005,  3},
-        {0x0006,  3}, {0x0038,  6}, {0x0039,  6}, {0x001D,  5},
-        {0x003C,  6}, {0x003D,  6}, {0x003E,  6}, {0x003F,  6},
-    },{//3
-        {0x0000,  3}, {0x0002,  4}, {0x0003,  4}, {0x0001,  2},
-        {0x0002,  2}, {0x0018,  5}, {0x0019,  5}, {0x000D,  4},
-        {0x001C,  5}, {0x001D,  5}, {0x001E,  5}, {0x001F,  5},
-    }
-};
-
-static const uint16_t x8_orient_highquant_table[2][12][2]={
-    {//0
-        {0x0000,  2}, {0x0001,  2}, {0x0004,  3}, {0x0005,  3},
-        {0x0006,  3}, {0x0038,  6}, {0x001D,  5}, {0x0039,  6},
-        {0x003C,  6}, {0x003D,  6}, {0x003E,  6}, {0x003F,  6},
-    },{//1
-        {0x0000,  1}, {0x0002,  2}, {0x0006,  3}, {0x001C,  5},
-        {0x001D,  5}, {0x0078,  7}, {0x003D,  6}, {0x0079,  7},
-        {0x007C,  7}, {0x007D,  7}, {0x007E,  7}, {0x007F,  7},
-    }
-};
-#define MAX_OR_VLC_BITS 7
-
-
-static const uint16_t x8_dc_lowquant_table[8][34][2]={
-    {//0
-        {0x0000,  5}, {0x0001,  4}, {0x0001,  5}, {0x0004,  5},
-        {0x0005,  5}, {0x0006,  5}, {0x000E,  6}, {0x000F,  6},
-        {0x0040,  8}, {0x0041,  8}, {0x0840, 13}, {0x0841, 13},
-        {0x0842, 13}, {0x0843, 13}, {0x0844, 13}, {0x0845, 13},
-        {0x0846, 13}, {0x0002,  2}, {0x0003,  2}, {0x0003,  3},
-        {0x0005,  4}, {0x0009,  5}, {0x0011,  6}, {0x0043,  8},
-        {0x0085,  9}, {0x0847, 13}, {0x0848, 13}, {0x0849, 13},
-        {0x084A, 13}, {0x084B, 13}, {0x084C, 13}, {0x084D, 13},
-        {0x084E, 13}, {0x084F, 13},
-    },{//1
-        {0x0000,  4}, {0x0001,  3}, {0x0002,  3}, {0x0001,  4},
-        {0x0006,  4}, {0x0004,  3}, {0x0007,  4}, {0x0005,  3},
-        {0x000C,  4}, {0x000D,  4}, {0x001C,  5}, {0x003A,  6},
-        {0x01D8,  9}, {0x01D9,  9}, {0x1DA0, 13}, {0x1DA1, 13},
-        {0x1DA2, 13}, {0x003C,  6}, {0x003D,  6}, {0x003E,  6},
-        {0x0077,  7}, {0x01DB,  9}, {0x007E,  7}, {0x00FE,  8},
-        {0x01FE,  9}, {0x1DA3, 13}, {0x1DA4, 13}, {0x1DA5, 13},
-        {0x0ED3, 12}, {0x0ED4, 12}, {0x01FF,  9}, {0x0ED5, 12},
-        {0x0ED6, 12}, {0x0ED7, 12},
-    },{//2
-        {0x0000,  4}, {0x0001,  3}, {0x0002,  3}, {0x0001,  4},
-        {0x0006,  4}, {0x0007,  4}, {0x0008,  4}, {0x0009,  4},
-        {0x0028,  6}, {0x0029,  6}, {0x0054,  7}, {0x0055,  7},
-        {0x0AC0, 12}, {0x0AC1, 12}, {0x0AC2, 12}, {0x0AC3, 12},
-        {0x0AC4, 12}, {0x000B,  4}, {0x0006,  3}, {0x000E,  4},
-        {0x001E,  5}, {0x003E,  6}, {0x003F,  6}, {0x0057,  7},
-        {0x00AD,  8}, {0x0AC5, 12}, {0x0AC6, 12}, {0x0AC7, 12},
-        {0x0AC8, 12}, {0x0AC9, 12}, {0x0ACA, 12}, {0x0ACB, 12},
-        {0x0566, 11}, {0x0567, 11},
-    },{//3
-        {0x0000,  4}, {0x0001,  2}, {0x0001,  3}, {0x0004,  3},
-        {0x0005,  3}, {0x0006,  3}, {0x0001,  4}, {0x000E,  4},
-        {0x003C,  6}, {0x003D,  6}, {0x007C,  7}, {0x00FA,  8},
-        {0x3EC0, 14}, {0x3EC1, 14}, {0x3EC2, 14}, {0x3EC3, 14},
-        {0x1F62, 13}, {0x01F7,  9}, {0x007E,  7}, {0x00FE,  8},
-        {0x00FF,  8}, {0x1F63, 13}, {0x1F64, 13}, {0x1F65, 13},
-        {0x1F66, 13}, {0x1F67, 13}, {0x1F68, 13}, {0x1F69, 13},
-        {0x1F6A, 13}, {0x1F6B, 13}, {0x1F6C, 13}, {0x1F6D, 13},
-        {0x1F6E, 13}, {0x1F6F, 13},
-    },{//4
-        {0x0000,  7}, {0x0001,  7}, {0x0002,  7}, {0x0003,  7},
-        {0x0004,  7}, {0x0005,  7}, {0x0006,  7}, {0x0007,  7},
-        {0x0008,  7}, {0x0009,  7}, {0x000A,  7}, {0x000B,  7},
-        {0x000C,  7}, {0x000D,  7}, {0x000E,  7}, {0x000F,  7},
-        {0x0010,  7}, {0x0001,  1}, {0x0001,  2}, {0x0011,  7},
-        {0x0012,  7}, {0x0013,  7}, {0x0014,  7}, {0x0015,  7},
-        {0x0016,  7}, {0x0017,  7}, {0x0018,  7}, {0x0019,  7},
-        {0x001A,  7}, {0x001B,  7}, {0x001C,  7}, {0x001D,  7},
-        {0x001E,  7}, {0x001F,  7},
-    },{//5
-        {0x0000,  5}, {0x0001,  4}, {0x0001,  5}, {0x0008,  6},
-        {0x0009,  6}, {0x000A,  6}, {0x0016,  7}, {0x000C,  6},
-        {0x0017,  7}, {0x000D,  6}, {0x0038,  8}, {0x001D,  7},
-        {0x0039,  8}, {0x0780, 13}, {0x0781, 13}, {0x0782, 13},
-        {0x0783, 13}, {0x0002,  3}, {0x0001,  1}, {0x0003,  3},
-        {0x001F,  7}, {0x003D,  8}, {0x0079,  9}, {0x0784, 13},
-        {0x0785, 13}, {0x0786, 13}, {0x0787, 13}, {0x0788, 13},
-        {0x0789, 13}, {0x078A, 13}, {0x078B, 13}, {0x078C, 13},
-        {0x078D, 13}, {0x03C7, 12},
-    },{//6
-        {0x0000,  4}, {0x0001,  2}, {0x0001,  3}, {0x0004,  3},
-        {0x0001,  4}, {0x000A,  4}, {0x0016,  5}, {0x002E,  6},
-        {0x005E,  7}, {0x005F,  7}, {0x00C0,  8}, {0x3040, 14},
-        {0x3041, 14}, {0x0305, 10}, {0x0183,  9}, {0x3042, 14},
-        {0x3043, 14}, {0x000D,  4}, {0x0007,  3}, {0x0019,  5},
-        {0x0031,  6}, {0x00C2,  8}, {0x00C3,  8}, {0x3044, 14},
-        {0x3045, 14}, {0x3046, 14}, {0x3047, 14}, {0x3048, 14},
-        {0x3049, 14}, {0x304A, 14}, {0x304B, 14}, {0x304C, 14},
-        {0x304D, 14}, {0x1827, 13},
-    },{//7
-        {0x0000,  6}, {0x0001,  6}, {0x0002,  6}, {0x0006,  7},
-        {0x0007,  7}, {0x0004,  6}, {0x0005,  6}, {0x0006,  6},
-        {0x000E,  7}, {0x001E,  8}, {0x001F,  8}, {0x0040,  9},
-        {0x0082, 10}, {0x0830, 14}, {0x0831, 14}, {0x0832, 14},
-        {0x0833, 14}, {0x0001,  1}, {0x0001,  2}, {0x0003,  4},
-        {0x0005,  5}, {0x0009,  6}, {0x0011,  7}, {0x0021,  8},
-        {0x0834, 14}, {0x0835, 14}, {0x0836, 14}, {0x0837, 14},
-        {0x0838, 14}, {0x0839, 14}, {0x083A, 14}, {0x083B, 14},
-        {0x041E, 13}, {0x041F, 13},
-    }
-};
-
-static const uint16_t x8_dc_highquant_table[8][34][2]={
-    {//0
-        {0x0000,  5}, {0x0001,  4}, {0x0002,  4}, {0x0001,  5},
-        {0x0006,  5}, {0x0004,  4}, {0x0007,  5}, {0x000A,  5},
-        {0x002C,  7}, {0x002D,  7}, {0x05C0, 12}, {0x05C1, 12},
-        {0x05C2, 12}, {0x05C3, 12}, {0x05C4, 12}, {0x05C5, 12},
-        {0x05C6, 12}, {0x0003,  3}, {0x0002,  2}, {0x0006,  3},
-        {0x000E,  4}, {0x001E,  5}, {0x001F,  5}, {0x002F,  7},
-        {0x005D,  8}, {0x05C7, 12}, {0x05C8, 12}, {0x05C9, 12},
-        {0x05CA, 12}, {0x05CB, 12}, {0x05CC, 12}, {0x05CD, 12},
-        {0x05CE, 12}, {0x05CF, 12},
-    },{//1
-        {0x0000,  3}, {0x0001,  3}, {0x0002,  3}, {0x0006,  4},
-        {0x0007,  4}, {0x0004,  3}, {0x000A,  4}, {0x000B,  4},
-        {0x0030,  6}, {0x0062,  7}, {0x0063,  7}, {0x0640, 11},
-        {0x0641, 11}, {0x0642, 11}, {0x0643, 11}, {0x0644, 11},
-        {0x0645, 11}, {0x0033,  6}, {0x000D,  4}, {0x001C,  5},
-        {0x001D,  5}, {0x003C,  6}, {0x001F,  5}, {0x0065,  7},
-        {0x007A,  7}, {0x0646, 11}, {0x007B,  7}, {0x0647, 11},
-        {0x0648, 11}, {0x0649, 11}, {0x064A, 11}, {0x064B, 11},
-        {0x0326, 10}, {0x0327, 10},
-    },{//2
-        {0x0000,  7}, {0x0001,  7}, {0x0001,  6}, {0x0004,  7},
-        {0x0003,  6}, {0x0005,  7}, {0x0010,  8}, {0x0011,  8},
-        {0x0240, 13}, {0x0241, 13}, {0x0242, 13}, {0x0243, 13},
-        {0x0244, 13}, {0x0245, 13}, {0x0246, 13}, {0x0247, 13},
-        {0x0124, 12}, {0x0001,  1}, {0x0001,  2}, {0x0001,  3},
-        {0x0003,  5}, {0x0005,  6}, {0x0013,  8}, {0x0125, 12},
-        {0x0126, 12}, {0x0127, 12}, {0x0128, 12}, {0x0129, 12},
-        {0x012A, 12}, {0x012B, 12}, {0x012C, 12}, {0x012D, 12},
-        {0x012E, 12}, {0x012F, 12},
-    },{//3
-        {0x0000,  4}, {0x0001,  3}, {0x0002,  3}, {0x0001,  4},
-        {0x0006,  4}, {0x0004,  3}, {0x0005,  3}, {0x0006,  3},
-        {0x000E,  5}, {0x000F,  5}, {0x0070,  7}, {0x0710, 11},
-        {0x0711, 11}, {0x0712, 11}, {0x0713, 11}, {0x0714, 11},
-        {0x0715, 11}, {0x001D,  5}, {0x0072,  7}, {0x003C,  6},
-        {0x003D,  6}, {0x0073,  7}, {0x007C,  7}, {0x007D,  7},
-        {0x007E,  7}, {0x0716, 11}, {0x0717, 11}, {0x0718, 11},
-        {0x007F,  7}, {0x0719, 11}, {0x071A, 11}, {0x071B, 11},
-        {0x038E, 10}, {0x038F, 10},
-    },{//4
-        {0x0000,  8}, {0x0001,  7}, {0x0002,  7}, {0x0003,  7},
-        {0x0002,  9}, {0x0008,  8}, {0x0003,  9}, {0x0240, 14},
-        {0x0241, 14}, {0x0242, 14}, {0x0243, 14}, {0x0244, 14},
-        {0x0245, 14}, {0x0246, 14}, {0x0247, 14}, {0x0124, 13},
-        {0x0125, 13}, {0x0001,  2}, {0x0001,  1}, {0x0001,  3},
-        {0x0001,  4}, {0x0003,  6}, {0x0005,  7}, {0x0013,  9},
-        {0x0126, 13}, {0x0127, 13}, {0x0128, 13}, {0x0129, 13},
-        {0x012A, 13}, {0x012B, 13}, {0x012C, 13}, {0x012D, 13},
-        {0x012E, 13}, {0x012F, 13},
-    },{//5
-        {0x0000,  7}, {0x0001,  7}, {0x0001,  6}, {0x0002,  6},
-        {0x0003,  6}, {0x0004,  6}, {0x0005,  6}, {0x0006,  6},
-        {0x0007,  6}, {0x0008,  6}, {0x0009,  6}, {0x000A,  6},
-        {0x000B,  6}, {0x000C,  6}, {0x000D,  6}, {0x000E,  6},
-        {0x000F,  6}, {0x0010,  6}, {0x0011,  6}, {0x0012,  6},
-        {0x0013,  6}, {0x0014,  6}, {0x0015,  6}, {0x0016,  6},
-        {0x0017,  6}, {0x0018,  6}, {0x0019,  6}, {0x0001,  1},
-        {0x001A,  6}, {0x001B,  6}, {0x001C,  6}, {0x001D,  6},
-        {0x001E,  6}, {0x001F,  6},
-    },{//6
-        {0x0000,  5}, {0x0001,  4}, {0x0001,  5}, {0x0004,  5},
-        {0x000A,  6}, {0x0006,  5}, {0x000B,  6}, {0x000E,  6},
-        {0x003C,  8}, {0x003D,  8}, {0x07C0, 13}, {0x07C1, 13},
-        {0x07C2, 13}, {0x07C3, 13}, {0x07C4, 13}, {0x07C5, 13},
-        {0x07C6, 13}, {0x0001,  2}, {0x0002,  2}, {0x0006,  3},
-        {0x000E,  4}, {0x001E,  5}, {0x001F,  5}, {0x003F,  8},
-        {0x007D,  9}, {0x07C7, 13}, {0x07C8, 13}, {0x07C9, 13},
-        {0x07CA, 13}, {0x07CB, 13}, {0x07CC, 13}, {0x07CD, 13},
-        {0x07CE, 13}, {0x07CF, 13},
-    },{//7
-        {0x0000,  7}, {0x0001,  7}, {0x0002,  7}, {0x0003,  7},
-        {0x0004,  7}, {0x0005,  7}, {0x0006,  7}, {0x0007,  7},
-        {0x0008,  7}, {0x0009,  7}, {0x000A,  7}, {0x000B,  7},
-        {0x000C,  7}, {0x000D,  7}, {0x000E,  7}, {0x000F,  7},
-        {0x0010,  7}, {0x0001,  1}, {0x0001,  2}, {0x0011,  7},
-        {0x0012,  7}, {0x0013,  7}, {0x0014,  7}, {0x0015,  7},
-        {0x0016,  7}, {0x0017,  7}, {0x0018,  7}, {0x0019,  7},
-        {0x001A,  7}, {0x001B,  7}, {0x001C,  7}, {0x001D,  7},
-        {0x001E,  7}, {0x001F,  7},
-    }
-};
-#define MAX_DC_VLC_BITS 14
-
-
-static const uint16_t x8_ac0_lowquant_table[8][77][2]={
-    {//0
-        {0x0000,  2}, {0x0002,  3}, {0x0006,  4}, {0x000E,  5},
-        {0x001E,  6}, {0x003E,  7}, {0x003F,  7}, {0x0040,  7},
-        {0x0104,  9}, {0x0083,  8}, {0x0084,  8}, {0x0085,  8},
-        {0x020A, 10}, {0x020B, 10}, {0x0218, 10}, {0x0219, 10},
-        {0x0009,  4}, {0x0044,  7}, {0x010D,  9}, {0x021C, 10},
-        {0x0023,  6}, {0x0045,  7}, {0x0050,  7}, {0x000B,  4},
-        {0x000C,  4}, {0x0015,  5}, {0x001A,  5}, {0x001B,  5},
-        {0x0029,  6}, {0x0038,  6}, {0x0039,  6}, {0x003A,  6},
-        {0x0051,  7}, {0x0076,  7}, {0x0077,  7}, {0x0078,  7},
-        {0x0079,  7}, {0x007A,  7}, {0x007B,  7}, {0x00F8,  8},
-        {0x010F,  9}, {0x021D, 10}, {0x3E40, 14}, {0x3E41, 14},
-        {0x3E42, 14}, {0x3E43, 14}, {0x03E5, 10}, {0x3E44, 14},
-        {0x01F3,  9}, {0x3E45, 14}, {0x3E46, 14}, {0x3E47, 14},
-        {0x00FA,  8}, {0x3E48, 14}, {0x3E49, 14}, {0x3E4A, 14},
-        {0x3E4B, 14}, {0x03EC, 10}, {0x3E4C, 14}, {0x007E,  7},
-        {0x00FE,  8}, {0x00FF,  8}, {0x01F7,  9}, {0x3E4D, 14},
-        {0x3E4E, 14}, {0x3E4F, 14}, {0x3ED0, 14}, {0x3ED1, 14},
-        {0x3ED2, 14}, {0x3ED3, 14}, {0x3ED4, 14}, {0x3ED5, 14},
-        {0x1F6B, 13}, {0x1F6C, 13}, {0x1F6D, 13}, {0x1F6E, 13},
-        {0x1F6F, 13},
-    },{//1
-        {0x0000,  3}, {0x0004,  5}, {0x0014,  7}, {0x000B,  6},
-        {0x000C,  6}, {0x002A,  8}, {0x002B,  8}, {0x0034,  8},
-        {0x0D40, 14}, {0x0D41, 14}, {0x001B,  7}, {0x0D42, 14},
-        {0x0D43, 14}, {0x0D44, 14}, {0x0D45, 14}, {0x0D46, 14},
-        {0x000E,  6}, {0x003C,  8}, {0x0D47, 14}, {0x003D,  8},
-        {0x0D48, 14}, {0x0D49, 14}, {0x0D4A, 14}, {0x0001,  2},
-        {0x0004,  3}, {0x0014,  5}, {0x000B,  4}, {0x000C,  4},
-        {0x000D,  4}, {0x002A,  6}, {0x001F,  7}, {0x0056,  7},
-        {0x0057,  7}, {0x0070,  7}, {0x00E2,  8}, {0x0072,  7},
-        {0x003A,  6}, {0x003B,  6}, {0x003C,  6}, {0x003D,  6},
-        {0x00E3,  8}, {0x0D4B, 14}, {0x00E6,  8}, {0x00E7,  8},
-        {0x00F8,  8}, {0x0D4C, 14}, {0x0D4D, 14}, {0x0D4E, 14},
-        {0x00F9,  8}, {0x0D4F, 14}, {0x0D50, 14}, {0x0D51, 14},
-        {0x06A9, 13}, {0x06AA, 13}, {0x06AB, 13}, {0x06AC, 13},
-        {0x06AD, 13}, {0x06AE, 13}, {0x06AF, 13}, {0x003F,  6},
-        {0x06B0, 13}, {0x06B1, 13}, {0x06B2, 13}, {0x06B3, 13},
-        {0x06B4, 13}, {0x007D,  7}, {0x06B5, 13}, {0x06B6, 13},
-        {0x06B7, 13}, {0x06B8, 13}, {0x06B9, 13}, {0x06BA, 13},
-        {0x06BB, 13}, {0x06BC, 13}, {0x06BD, 13}, {0x06BE, 13},
-        {0x06BF, 13},
-    },{//2
-        {0x0000,  2}, {0x0002,  3}, {0x0003,  3}, {0x0008,  4},
-        {0x0012,  5}, {0x0013,  5}, {0x0028,  6}, {0x0029,  6},
-        {0x0054,  7}, {0x0055,  7}, {0x0056,  7}, {0x00AE,  8},
-        {0x00AF,  8}, {0x00B0,  8}, {0x0162,  9}, {0x02C6, 10},
-        {0x000C,  4}, {0x002D,  6}, {0x00B2,  8}, {0x0166,  9},
-        {0x002E,  6}, {0x0167,  9}, {0x00BC,  8}, {0x001A,  5},
-        {0x0036,  6}, {0x0037,  6}, {0x0038,  6}, {0x005F,  7},
-        {0x0072,  7}, {0x0073,  7}, {0x0074,  7}, {0x0075,  7},
-        {0x0076,  7}, {0x0077,  7}, {0x0078,  7}, {0x0079,  7},
-        {0x007A,  7}, {0x007B,  7}, {0x00BD,  8}, {0xB1C0, 16},
-        {0xB1C1, 16}, {0x58E1, 15}, {0x0B1D, 12}, {0x58E2, 15},
-        {0x58E3, 15}, {0x58E4, 15}, {0x00F8,  8}, {0x03E4, 10},
-        {0x01F3,  9}, {0x0B1E, 12}, {0x58E5, 15}, {0x58E6, 15},
-        {0x00FA,  8}, {0x58E7, 15}, {0x58F8, 15}, {0x58F9, 15},
-        {0x58FA, 15}, {0x01F6,  9}, {0x58FB, 15}, {0x007E,  7},
-        {0x00FE,  8}, {0x00FF,  8}, {0x07CA, 11}, {0x0F96, 12},
-        {0x58FC, 15}, {0x58FD, 15}, {0x58FE, 15}, {0x58FF, 15},
-        {0x7CB8, 15}, {0x7CB9, 15}, {0x7CBA, 15}, {0x7CBB, 15},
-        {0x7CBC, 15}, {0x01F7,  9}, {0x7CBD, 15}, {0x7CBE, 15},
-        {0x7CBF, 15},
-    },{//3
-        {0x0000,  2}, {0x0002,  3}, {0x0006,  4}, {0x000E,  5},
-        {0x000F,  5}, {0x0020,  6}, {0x0021,  6}, {0x0044,  7},
-        {0x0045,  7}, {0x008C,  8}, {0x008D,  8}, {0x011C,  9},
-        {0x011D,  9}, {0x011E,  9}, {0x023E, 10}, {0x023F, 10},
-        {0x0005,  3}, {0x0012,  5}, {0x004C,  7}, {0x004D,  7},
-        {0x000C,  4}, {0x004E,  7}, {0x001A,  5}, {0x0036,  6},
-        {0x004F,  7}, {0x006E,  7}, {0x006F,  7}, {0x00E0,  8},
-        {0x00E1,  8}, {0x00E2,  8}, {0x00E3,  8}, {0x00E4,  8},
-        {0x00E5,  8}, {0x01CC,  9}, {0x00E7,  8}, {0x00E8,  8},
-        {0x00E9,  8}, {0x01CD,  9}, {0x0750, 11}, {0x03A9, 10},
-        {0x0751, 11}, {0x7540, 15}, {0x03AB, 10}, {0x7541, 15},
-        {0x7542, 15}, {0x7543, 15}, {0x01D6,  9}, {0x0755, 11},
-        {0x0076,  7}, {0x0EA9, 12}, {0x7544, 15}, {0x7545, 15},
-        {0x001E,  5}, {0x0077,  7}, {0x00F8,  8}, {0x03AE, 10},
-        {0x075E, 11}, {0x007D,  7}, {0x03E4, 10}, {0x00FC,  8},
-        {0x00FD,  8}, {0x03E5, 10}, {0x03E6, 10}, {0x0EBE, 12},
-        {0x7546, 15}, {0x07CE, 11}, {0x7547, 15}, {0x75F8, 15},
-        {0x75F9, 15}, {0x75FA, 15}, {0x75FB, 15}, {0x75FC, 15},
-        {0x75FD, 15}, {0x007F,  7}, {0x3AFF, 14}, {0x0F9E, 12},
-        {0x0F9F, 12},
-    },{//4
-        {0x0000,  3}, {0x0002,  4}, {0x0003,  4}, {0x0008,  5},
-        {0x0012,  6}, {0x0013,  6}, {0x0014,  6}, {0x002A,  7},
-        {0x0016,  6}, {0x002B,  7}, {0x005C,  8}, {0x005D,  8},
-        {0x005E,  8}, {0x00BE,  9}, {0x00BF,  9}, {0x0060,  8},
-        {0x0007,  4}, {0x000D,  5}, {0x0019,  6}, {0x0020,  6},
-        {0x0009,  4}, {0x0021,  6}, {0x0011,  5}, {0x0014,  5},
-        {0x002A,  6}, {0x002B,  6}, {0x002C,  6}, {0x002D,  6},
-        {0x002E,  6}, {0x002F,  6}, {0x0030,  6}, {0x0031,  7},
-        {0x0062,  7}, {0x0063,  7}, {0x0064,  7}, {0x0065,  7},
-        {0x0066,  7}, {0x0061,  8}, {0x0670, 11}, {0x0068,  7},
-        {0x0069,  7}, {0x00CF,  8}, {0x019D,  9}, {0x01A8,  9},
-        {0x01A9,  9}, {0x0339, 10}, {0x01AA,  9}, {0x0356, 10},
-        {0x0036,  6}, {0x00D6,  8}, {0x6710, 15}, {0x6711, 15},
-        {0x000E,  4}, {0x006E,  7}, {0x01AE,  9}, {0x6712, 15},
-        {0x6713, 15}, {0x003C,  6}, {0x0357, 10}, {0x006F,  7},
-        {0x00F4,  8}, {0x00F5,  8}, {0x035E, 10}, {0x01EC,  9},
-        {0x6714, 15}, {0x01ED,  9}, {0x035F, 10}, {0x03DC, 10},
-        {0x03DD, 10}, {0x6715, 15}, {0x338B, 14}, {0x338C, 14},
-        {0x338D, 14}, {0x001F,  5}, {0x01EF,  9}, {0x338E, 14},
-        {0x338F, 14},
-    },{//5
-        {0x0000,  2}, {0x0004,  4}, {0x000A,  5}, {0x000B,  5},
-        {0x0018,  6}, {0x0019,  6}, {0x0034,  7}, {0x006A,  8},
-        {0x006B,  8}, {0x006C,  8}, {0x00DA,  9}, {0x036C, 11},
-        {0x006E,  8}, {0x01B7, 10}, {0x036D, 11}, {0x3780, 15},
-        {0x0004,  3}, {0x000E,  5}, {0x001E,  6}, {0x003E,  7},
-        {0x000A,  4}, {0x002C,  6}, {0x0017,  5}, {0x002D,  6},
-        {0x003F,  7}, {0x00C0,  8}, {0x0061,  7}, {0x00C1,  8},
-        {0x0062,  7}, {0x00C6,  8}, {0x0064,  7}, {0x00C7,  8},
-        {0x00CA,  8}, {0x00DF,  9}, {0x0196,  9}, {0x0197,  9},
-        {0x0198,  9}, {0x0199,  9}, {0x0379, 11}, {0x019A,  9},
-        {0x01BD, 10}, {0x066C, 11}, {0x3781, 15}, {0x0337, 10},
-        {0x066D, 11}, {0x0670, 11}, {0x0339, 10}, {0x0671, 11},
-        {0x0034,  6}, {0x00CF,  8}, {0x3782, 15}, {0x3783, 15},
-        {0x000E,  4}, {0x001B,  5}, {0x006A,  7}, {0x006B,  7},
-        {0x019D,  9}, {0x003C,  6}, {0x00F4,  8}, {0x00F5,  8},
-        {0x03D8, 10}, {0x07B2, 11}, {0x3784, 15}, {0x03DA, 10},
-        {0x3785, 15}, {0x03DB, 10}, {0x03DC, 10}, {0x3786, 15},
-        {0x3787, 15}, {0x1BC4, 14}, {0x1BC5, 14}, {0x1BC6, 14},
-        {0x1BC7, 14}, {0x001F,  5}, {0x03DD, 10}, {0x07B3, 11},
-        {0x01EF,  9},
-    },{//6
-        {0x0000,  2}, {0x0004,  4}, {0x000A,  5}, {0x0016,  6},
-        {0x0017,  6}, {0x0060,  8}, {0x00C2,  9}, {0x0186, 10},
-        {0x0187, 10}, {0x00C4,  9}, {0x3140, 15}, {0x3141, 15},
-        {0x018B, 10}, {0x3142, 15}, {0x018C, 10}, {0x3143, 15},
-        {0x0007,  4}, {0x000D,  5}, {0x0064,  8}, {0x0065,  8},
-        {0x0010,  5}, {0x00C7,  9}, {0x0066,  8}, {0x0005,  3},
-        {0x0006,  3}, {0x0009,  4}, {0x0011,  5}, {0x0038,  6},
-        {0x0039,  6}, {0x0074,  7}, {0x0075,  7}, {0x0076,  7},
-        {0x0067,  8}, {0x00EE,  8}, {0x01DE,  9}, {0x00F0,  8},
-        {0x018D, 10}, {0x3144, 15}, {0x01DF,  9}, {0x003D,  6},
-        {0x003E,  6}, {0x01E2,  9}, {0x03C6, 10}, {0x00F2,  8},
-        {0x00F3,  8}, {0x03C7, 10}, {0x3145, 15}, {0x3146, 15},
-        {0x01F8,  9}, {0x3147, 15}, {0x3148, 15}, {0x3149, 15},
-        {0x00FD,  8}, {0x314A, 15}, {0x314B, 15}, {0x314C, 15},
-        {0x314D, 15}, {0x01F9,  9}, {0x314E, 15}, {0x01FC,  9},
-        {0x314F, 15}, {0x3150, 15}, {0x3151, 15}, {0x3152, 15},
-        {0x3153, 15}, {0x03FA, 10}, {0x03FB, 10}, {0x3154, 15},
-        {0x3155, 15}, {0x3156, 15}, {0x3157, 15}, {0x3158, 15},
-        {0x3159, 15}, {0x00FF,  8}, {0x18AD, 14}, {0x18AE, 14},
-        {0x18AF, 14},
-    },{//7
-        {0x0000,  4}, {0x0080, 11}, {0x0081, 11}, {0x0082, 11},
-        {0x0083, 11}, {0x0084, 11}, {0x0085, 11}, {0x0086, 11},
-        {0x0087, 11}, {0x0088, 11}, {0x0089, 11}, {0x008A, 11},
-        {0x008B, 11}, {0x008C, 11}, {0x008D, 11}, {0x008E, 11},
-        {0x008F, 11}, {0x0048, 10}, {0x0049, 10}, {0x004A, 10},
-        {0x004B, 10}, {0x004C, 10}, {0x004D, 10}, {0x0001,  1},
-        {0x0001,  2}, {0x004E, 10}, {0x0002,  4}, {0x0003,  4},
-        {0x004F, 10}, {0x0050, 10}, {0x0051, 10}, {0x0052, 10},
-        {0x0053, 10}, {0x0054, 10}, {0x0055, 10}, {0x0056, 10},
-        {0x0057, 10}, {0x0058, 10}, {0x0059, 10}, {0x005A, 10},
-        {0x005B, 10}, {0x005C, 10}, {0x005D, 10}, {0x005E, 10},
-        {0x005F, 10}, {0x0060, 10}, {0x0061, 10}, {0x0062, 10},
-        {0x0063, 10}, {0x0064, 10}, {0x0065, 10}, {0x0066, 10},
-        {0x0067, 10}, {0x0068, 10}, {0x0069, 10}, {0x006A, 10},
-        {0x006B, 10}, {0x006C, 10}, {0x006D, 10}, {0x006E, 10},
-        {0x006F, 10}, {0x0070, 10}, {0x0071, 10}, {0x0072, 10},
-        {0x0073, 10}, {0x0074, 10}, {0x0075, 10}, {0x0076, 10},
-        {0x0077, 10}, {0x0078, 10}, {0x0079, 10}, {0x007A, 10},
-        {0x007B, 10}, {0x007C, 10}, {0x007D, 10}, {0x007E, 10},
-        {0x007F, 10},
-    }
-};
-
-static const uint16_t x8_ac0_highquant_table[8][77][2]={
-    {//0
-        {0x0000,  3}, {0x0002,  4}, {0x000C,  6}, {0x000D,  6},
-        {0x001C,  7}, {0x000F,  6}, {0x1D00, 15}, {0x003B,  8},
-        {0x1D01, 15}, {0x0075,  9}, {0x1D02, 15}, {0x0080,  9},
-        {0x1D03, 15}, {0x1D04, 15}, {0x1D05, 15}, {0x0E83, 14},
-        {0x0009,  5}, {0x0011,  6}, {0x0081,  9}, {0x0082,  9},
-        {0x0021,  7}, {0x0028,  7}, {0x0083,  9}, {0x0002,  2},
-        {0x0003,  3}, {0x000C,  4}, {0x000D,  4}, {0x000B,  5},
-        {0x0015,  6}, {0x0052,  8}, {0x0070,  7}, {0x0039,  6},
-        {0x0071,  7}, {0x0053,  8}, {0x0E84, 14}, {0x0074,  7},
-        {0x0075,  7}, {0x0076,  7}, {0x01DC,  9}, {0x001E,  5},
-        {0x003E,  6}, {0x01DD,  9}, {0x00EF,  8}, {0x01F8,  9},
-        {0x01F9,  9}, {0x0E85, 14}, {0x0E86, 14}, {0x0E87, 14},
-        {0x00FD,  8}, {0x0E88, 14}, {0x0E89, 14}, {0x0E8A, 14},
-        {0x0E8B, 14}, {0x0E8C, 14}, {0x0E8D, 14}, {0x0E8E, 14},
-        {0x0E8F, 14}, {0x0E90, 14}, {0x0E91, 14}, {0x01FC,  9},
-        {0x0E92, 14}, {0x0E93, 14}, {0x0E94, 14}, {0x0E95, 14},
-        {0x0E96, 14}, {0x0E97, 14}, {0x01FD,  9}, {0x0E98, 14},
-        {0x01FE,  9}, {0x0E99, 14}, {0x0E9A, 14}, {0x0E9B, 14},
-        {0x0E9C, 14}, {0x01FF,  9}, {0x0E9D, 14}, {0x0E9E, 14},
-        {0x0E9F, 14},
-    },{//1
-        {0x0000,  3}, {0x0002,  4}, {0x0003,  4}, {0x0008,  5},
-        {0x0012,  6}, {0x0013,  6}, {0x0014,  6}, {0x0015,  6},
-        {0x002C,  7}, {0x005A,  8}, {0x005B,  8}, {0x005C,  8},
-        {0x005D,  8}, {0x1780, 14}, {0x0179, 10}, {0x017A, 10},
-        {0x0006,  4}, {0x000E,  5}, {0x001E,  6}, {0x003E,  7},
-        {0x0010,  5}, {0x0022,  6}, {0x0012,  5}, {0x000A,  4},
-        {0x0013,  5}, {0x0016,  5}, {0x0023,  6}, {0x002E,  6},
-        {0x002F,  6}, {0x0030,  6}, {0x0031,  6}, {0x003F,  7},
-        {0x005F,  8}, {0x00C8,  8}, {0x0065,  7}, {0x0066,  7},
-        {0x0067,  7}, {0x0068,  7}, {0x00C9,  8}, {0x0069,  7},
-        {0x006A,  7}, {0x00D6,  8}, {0x00D7,  8}, {0x00D8,  8},
-        {0x1781, 14}, {0x017B, 10}, {0x01B2,  9}, {0x1782, 14},
-        {0x001C,  5}, {0x01B3,  9}, {0x1783, 14}, {0x1784, 14},
-        {0x001D,  5}, {0x00DA,  8}, {0x1785, 14}, {0x1786, 14},
-        {0x1787, 14}, {0x0037,  6}, {0x00DB,  8}, {0x0078,  7},
-        {0x00F2,  8}, {0x01E6,  9}, {0x00F4,  8}, {0x1788, 14},
-        {0x1789, 14}, {0x00F5,  8}, {0x01E7,  9}, {0x178A, 14},
-        {0x178B, 14}, {0x178C, 14}, {0x178D, 14}, {0x01EC,  9},
-        {0x178E, 14}, {0x001F,  5}, {0x00F7,  8}, {0x01ED,  9},
-        {0x178F, 14},
-    },{//2
-        {0x0000,  4}, {0x0002,  5}, {0x0180, 12}, {0x0181, 12},
-        {0x0182, 12}, {0x0183, 12}, {0x0184, 12}, {0x0185, 12},
-        {0x0186, 12}, {0x0187, 12}, {0x0188, 12}, {0x0189, 12},
-        {0x00C5, 11}, {0x00C6, 11}, {0x00C7, 11}, {0x00C8, 11},
-        {0x00C9, 11}, {0x00CA, 11}, {0x00CB, 11}, {0x00CC, 11},
-        {0x00CD, 11}, {0x00CE, 11}, {0x00CF, 11}, {0x0001,  1},
-        {0x0001,  2}, {0x0004,  5}, {0x0005,  5}, {0x0006,  5},
-        {0x00D0, 11}, {0x00D1, 11}, {0x00D2, 11}, {0x00D3, 11},
-        {0x00D4, 11}, {0x00D5, 11}, {0x00D6, 11}, {0x00D7, 11},
-        {0x00D8, 11}, {0x00D9, 11}, {0x00DA, 11}, {0x0007,  5},
-        {0x00DB, 11}, {0x00DC, 11}, {0x00DD, 11}, {0x00DE, 11},
-        {0x00DF, 11}, {0x00E0, 11}, {0x00E1, 11}, {0x00E2, 11},
-        {0x00E3, 11}, {0x00E4, 11}, {0x00E5, 11}, {0x00E6, 11},
-        {0x00E7, 11}, {0x00E8, 11}, {0x00E9, 11}, {0x00EA, 11},
-        {0x00EB, 11}, {0x00EC, 11}, {0x00ED, 11}, {0x00EE, 11},
-        {0x00EF, 11}, {0x00F0, 11}, {0x00F1, 11}, {0x00F2, 11},
-        {0x00F3, 11}, {0x00F4, 11}, {0x00F5, 11}, {0x00F6, 11},
-        {0x00F7, 11}, {0x00F8, 11}, {0x00F9, 11}, {0x00FA, 11},
-        {0x00FB, 11}, {0x00FC, 11}, {0x00FD, 11}, {0x00FE, 11},
-        {0x00FF, 11},
-    },{//3
-        {0x0000,  8}, {0x0001,  8}, {0x0002,  8}, {0x0003,  8},
-        {0x0004,  8}, {0x0005,  8}, {0x0006,  8}, {0x0007,  8},
-        {0x0008,  8}, {0x0009,  8}, {0x000A,  8}, {0x000B,  8},
-        {0x000C,  8}, {0x000D,  8}, {0x000E,  8}, {0x000F,  8},
-        {0x0010,  8}, {0x0011,  8}, {0x0012,  8}, {0x0013,  8},
-        {0x0014,  8}, {0x0015,  8}, {0x0016,  8}, {0x0001,  1},
-        {0x0017,  8}, {0x000C,  7}, {0x000D,  7}, {0x000E,  7},
-        {0x000F,  7}, {0x0010,  7}, {0x0011,  7}, {0x0012,  7},
-        {0x0013,  7}, {0x0014,  7}, {0x0015,  7}, {0x0016,  7},
-        {0x0017,  7}, {0x0018,  7}, {0x0019,  7}, {0x001A,  7},
-        {0x001B,  7}, {0x001C,  7}, {0x001D,  7}, {0x001E,  7},
-        {0x001F,  7}, {0x0020,  7}, {0x0021,  7}, {0x0022,  7},
-        {0x0023,  7}, {0x0024,  7}, {0x0025,  7}, {0x0026,  7},
-        {0x0027,  7}, {0x0028,  7}, {0x0029,  7}, {0x002A,  7},
-        {0x002B,  7}, {0x002C,  7}, {0x002D,  7}, {0x002E,  7},
-        {0x002F,  7}, {0x0030,  7}, {0x0031,  7}, {0x0032,  7},
-        {0x0033,  7}, {0x0034,  7}, {0x0035,  7}, {0x0036,  7},
-        {0x0037,  7}, {0x0038,  7}, {0x0039,  7}, {0x003A,  7},
-        {0x003B,  7}, {0x003C,  7}, {0x003D,  7}, {0x003E,  7},
-        {0x003F,  7},
-    },{//4
-        {0x0000,  9}, {0x0001,  9}, {0x0002,  9}, {0x0003,  9},
-        {0x0004,  9}, {0x0005,  9}, {0x0006,  9}, {0x0007,  9},
-        {0x0008,  9}, {0x0009,  9}, {0x000A,  9}, {0x000B,  9},
-        {0x000C,  9}, {0x000D,  9}, {0x000E,  9}, {0x000F,  9},
-        {0x0010,  9}, {0x0011,  9}, {0x0012,  9}, {0x0013,  9},
-        {0x0014,  9}, {0x0015,  9}, {0x000B,  8}, {0x0001,  2},
-        {0x0001,  1}, {0x000C,  8}, {0x000D,  8}, {0x000E,  8},
-        {0x000F,  8}, {0x0010,  8}, {0x0011,  8}, {0x0012,  8},
-        {0x0013,  8}, {0x0014,  8}, {0x0015,  8}, {0x0016,  8},
-        {0x0017,  8}, {0x0018,  8}, {0x0019,  8}, {0x001A,  8},
-        {0x001B,  8}, {0x001C,  8}, {0x001D,  8}, {0x001E,  8},
-        {0x001F,  8}, {0x0020,  8}, {0x0021,  8}, {0x0022,  8},
-        {0x0023,  8}, {0x0024,  8}, {0x0025,  8}, {0x0026,  8},
-        {0x0027,  8}, {0x0028,  8}, {0x0029,  8}, {0x002A,  8},
-        {0x002B,  8}, {0x002C,  8}, {0x002D,  8}, {0x002E,  8},
-        {0x002F,  8}, {0x0030,  8}, {0x0031,  8}, {0x0032,  8},
-        {0x0033,  8}, {0x0034,  8}, {0x0035,  8}, {0x0036,  8},
-        {0x0037,  8}, {0x0038,  8}, {0x0039,  8}, {0x003A,  8},
-        {0x003B,  8}, {0x003C,  8}, {0x003D,  8}, {0x003E,  8},
-        {0x003F,  8},
-    },{//5
-        {0x0000, 10}, {0x0001, 10}, {0x0002, 10}, {0x0003, 10},
-        {0x0004, 10}, {0x0005, 10}, {0x0006, 10}, {0x0007, 10},
-        {0x0008, 10}, {0x0009, 10}, {0x000A, 10}, {0x000B, 10},
-        {0x000C, 10}, {0x000D, 10}, {0x000E, 10}, {0x000F, 10},
-        {0x0010, 10}, {0x0011, 10}, {0x0012, 10}, {0x0013, 10},
-        {0x000A,  9}, {0x000B,  9}, {0x000C,  9}, {0x0001,  1},
-        {0x0001,  3}, {0x000D,  9}, {0x000E,  9}, {0x0001,  2},
-        {0x000F,  9}, {0x0010,  9}, {0x0011,  9}, {0x0012,  9},
-        {0x0013,  9}, {0x0014,  9}, {0x0015,  9}, {0x0016,  9},
-        {0x0017,  9}, {0x0018,  9}, {0x0019,  9}, {0x001A,  9},
-        {0x001B,  9}, {0x001C,  9}, {0x001D,  9}, {0x001E,  9},
-        {0x001F,  9}, {0x0020,  9}, {0x0021,  9}, {0x0022,  9},
-        {0x0023,  9}, {0x0024,  9}, {0x0025,  9}, {0x0026,  9},
-        {0x0027,  9}, {0x0028,  9}, {0x0029,  9}, {0x002A,  9},
-        {0x002B,  9}, {0x002C,  9}, {0x002D,  9}, {0x002E,  9},
-        {0x002F,  9}, {0x0030,  9}, {0x0031,  9}, {0x0032,  9},
-        {0x0033,  9}, {0x0034,  9}, {0x0035,  9}, {0x0036,  9},
-        {0x0037,  9}, {0x0038,  9}, {0x0039,  9}, {0x003A,  9},
-        {0x003B,  9}, {0x003C,  9}, {0x003D,  9}, {0x003E,  9},
-        {0x003F,  9},
-    },{//6
-        {0x0000,  2}, {0x0004,  4}, {0x000A,  5}, {0x000B,  5},
-        {0x0018,  6}, {0x0019,  6}, {0x0034,  7}, {0x006A,  8},
-        {0x006B,  8}, {0x006C,  8}, {0x00DA,  9}, {0x00DB,  9},
-        {0x01B8, 10}, {0x00DD,  9}, {0x01B9, 10}, {0x3780, 15},
-        {0x0004,  3}, {0x000E,  5}, {0x001E,  6}, {0x001F,  6},
-        {0x000A,  4}, {0x0058,  7}, {0x0017,  5}, {0x0018,  5},
-        {0x0059,  7}, {0x005A,  7}, {0x005B,  7}, {0x00C8,  8},
-        {0x0065,  7}, {0x0066,  7}, {0x00C9,  8}, {0x00CE,  8},
-        {0x00CF,  8}, {0x00D0,  8}, {0x00D1,  8}, {0x00D2,  8},
-        {0x00D3,  8}, {0x00DF,  9}, {0x00D4,  8}, {0x00D5,  8},
-        {0x00D6,  8}, {0x01AE,  9}, {0x3781, 15}, {0x01BD, 10},
-        {0x035E, 10}, {0x035F, 10}, {0x3782, 15}, {0x0360, 10},
-        {0x0037,  6}, {0x01B1,  9}, {0x3783, 15}, {0x3784, 15},
-        {0x000E,  4}, {0x003C,  6}, {0x0361, 10}, {0x3785, 15},
-        {0x1BC3, 14}, {0x003D,  6}, {0x00D9,  8}, {0x1BC4, 14},
-        {0x0368, 10}, {0x1BC5, 14}, {0x1BC6, 14}, {0x1BC7, 14},
-        {0x1BC8, 14}, {0x00DB,  8}, {0x0369, 10}, {0x036A, 10},
-        {0x1BC9, 14}, {0x1BCA, 14}, {0x1BCB, 14}, {0x1BCC, 14},
-        {0x1BCD, 14}, {0x001F,  5}, {0x036B, 10}, {0x1BCE, 14},
-        {0x1BCF, 14},
-    },{//7
-        {0x0000,  3}, {0x0002,  4}, {0x0006,  5}, {0x0007,  5},
-        {0x0010,  6}, {0x0044,  8}, {0x0023,  7}, {0x0012,  6},
-        {0x0026,  7}, {0x08A0, 13}, {0x004E,  8}, {0x004F,  8},
-        {0x08A1, 13}, {0x08A2, 13}, {0x08A3, 13}, {0x0050,  8},
-        {0x0006,  4}, {0x000B,  5}, {0x0029,  7}, {0x0015,  6},
-        {0x001C,  6}, {0x003A,  7}, {0x001E,  6}, {0x0004,  3},
-        {0x0014,  5}, {0x0015,  5}, {0x000B,  4}, {0x001F,  6},
-        {0x0030,  6}, {0x0031,  6}, {0x0019,  5}, {0x0051,  8},
-        {0x0034,  6}, {0x0035,  6}, {0x0036,  6}, {0x0037,  6},
-        {0x0076,  8}, {0x0077,  8}, {0x0070,  7}, {0x001D,  5},
-        {0x0071,  7}, {0x0072,  7}, {0x08A4, 13}, {0x0073,  7},
-        {0x00F0,  8}, {0x08A5, 13}, {0x08A6, 13}, {0x08A7, 13},
-        {0x0079,  7}, {0x007A,  7}, {0x08A8, 13}, {0x08A9, 13},
-        {0x00F1,  8}, {0x08AA, 13}, {0x08AB, 13}, {0x08AC, 13},
-        {0x08AD, 13}, {0x00F6,  8}, {0x08AE, 13}, {0x007C,  7},
-        {0x00F7,  8}, {0x08AF, 13}, {0x08B0, 13}, {0x08B1, 13},
-        {0x08B2, 13}, {0x00FA,  8}, {0x08B3, 13}, {0x08B4, 13},
-        {0x08B5, 13}, {0x08B6, 13}, {0x08B7, 13}, {0x00FB,  8},
-        {0x045C, 12}, {0x003F,  6}, {0x045D, 12}, {0x045E, 12},
-        {0x045F, 12},
-    }
-};
-
-static const uint16_t x8_ac1_lowquant_table[8][77][2]={
-    {//0
-        {0x0000,  3}, {0x0002,  4}, {0x0003,  4}, {0x0008,  5},
-        {0x0012,  6}, {0x0026,  7}, {0x0014,  6}, {0x004E,  8},
-        {0x004F,  8}, {0x00A8,  9}, {0x0152, 10}, {0x00AA,  9},
-        {0x00AB,  9}, {0x00AC,  9}, {0x2A60, 15}, {0x02A7, 11},
-        {0x0006,  4}, {0x000B,  5}, {0x001C,  6}, {0x003A,  7},
-        {0x000F,  5}, {0x003B,  7}, {0x0010,  5}, {0x0005,  3},
-        {0x0009,  4}, {0x0011,  5}, {0x0018,  5}, {0x0019,  5},
-        {0x001A,  5}, {0x0036,  6}, {0x0037,  6}, {0x0070,  7},
-        {0x0057,  8}, {0x00E2,  8}, {0x00E3,  8}, {0x00E4,  8},
-        {0x00E5,  8}, {0x00AD,  9}, {0x0398, 10}, {0x003A,  6},
-        {0x0076,  7}, {0x00E7,  8}, {0x00EE,  8}, {0x00EF,  8},
-        {0x0732, 11}, {0x039A, 10}, {0x0733, 11}, {0x2A61, 15},
-        {0x0078,  7}, {0x1531, 14}, {0x1532, 14}, {0x1533, 14},
-        {0x003D,  6}, {0x039B, 10}, {0x1534, 14}, {0x1535, 14},
-        {0x1536, 14}, {0x0079,  7}, {0x1537, 14}, {0x00F8,  8},
-        {0x01F2,  9}, {0x07CC, 11}, {0x03E7, 10}, {0x07CD, 11},
-        {0x3E80, 14}, {0x00FB,  8}, {0x03E9, 10}, {0x3E81, 14},
-        {0x3E82, 14}, {0x3E83, 14}, {0x3E84, 14}, {0x3E85, 14},
-        {0x3E86, 14}, {0x003F,  6}, {0x01F5,  9}, {0x07D1, 11},
-        {0x3E87, 14},
-    },{//1
-        {0x0000,  2}, {0x0002,  3}, {0x0006,  4}, {0x000E,  5},
-        {0x001E,  6}, {0x001F,  6}, {0x0040,  7}, {0x0082,  8},
-        {0x0083,  8}, {0x0084,  8}, {0x010A,  9}, {0x010B,  9},
-        {0x0430, 11}, {0x0431, 11}, {0x0432, 11}, {0x0433, 11},
-        {0x0005,  3}, {0x0011,  5}, {0x0024,  6}, {0x004A,  7},
-        {0x000C,  4}, {0x0026,  6}, {0x000D,  4}, {0x0087,  8},
-        {0x010D,  9}, {0x0258, 10}, {0x012D,  9}, {0x0259, 10},
-        {0x025C, 10}, {0x0974, 12}, {0x025E, 10}, {0x025F, 10},
-        {0x0270, 10}, {0x0271, 10}, {0x04BB, 11}, {0x0975, 12},
-        {0x0272, 10}, {0x09CC, 12}, {0x09CD, 12}, {0x4E70, 15},
-        {0x4E71, 15}, {0x4E72, 15}, {0x4E73, 15}, {0x273A, 14},
-        {0x273B, 14}, {0x273C, 14}, {0x04E8, 11}, {0x04E9, 11},
-        {0x009E,  8}, {0x0275, 10}, {0x09D8, 12}, {0x273D, 14},
-        {0x000E,  4}, {0x003C,  6}, {0x007A,  7}, {0x009F,  8},
-        {0x0277, 10}, {0x003E,  6}, {0x00F6,  8}, {0x04ED, 11},
-        {0x03DC, 10}, {0x273E, 14}, {0x07BA, 11}, {0x09D9, 12},
-        {0x273F, 14}, {0x3DD8, 14}, {0x3DD9, 14}, {0x3DDA, 14},
-        {0x3DDB, 14}, {0x3DDC, 14}, {0x3DDD, 14}, {0x3DDE, 14},
-        {0x3DDF, 14}, {0x003F,  6}, {0x07BC, 11}, {0x07BD, 11},
-        {0x03DF, 10},
-    },{//2
-        {0x0000,  3}, {0x0002,  4}, {0x0006,  5}, {0x000E,  6},
-        {0x001E,  7}, {0x003E,  8}, {0x003F,  8}, {0x0040,  8},
-        {0x0104, 10}, {0x0083,  9}, {0x0105, 10}, {0x0108, 10},
-        {0x4240, 16}, {0x010A, 10}, {0x010B, 10}, {0x4241, 16},
-        {0x0003,  3}, {0x0009,  5}, {0x0011,  6}, {0x0043,  8},
-        {0x0004,  3}, {0x000A,  5}, {0x000A,  4}, {0x002C,  7},
-        {0x00B4,  9}, {0x00B5,  9}, {0x00B6,  9}, {0x00B7,  9},
-        {0x00B8,  9}, {0x0172, 10}, {0x0173, 10}, {0x0174, 10},
-        {0x0175, 10}, {0x0176, 10}, {0x0177, 10}, {0x00BC,  9},
-        {0x017A, 10}, {0x0213, 11}, {0x4242, 16}, {0x017B, 10},
-        {0x02F8, 11}, {0x017D, 10}, {0x02F9, 11}, {0x017E, 10},
-        {0x4243, 16}, {0x02FE, 11}, {0x2122, 15}, {0x2123, 15},
-        {0x0058,  7}, {0x0164,  9}, {0x2124, 15}, {0x2125, 15},
-        {0x0006,  3}, {0x000E,  4}, {0x002D,  6}, {0x002E,  6},
-        {0x00B3,  8}, {0x001E,  5}, {0x005E,  7}, {0x2126, 15},
-        {0x2127, 15}, {0x2128, 15}, {0x2129, 15}, {0x02FF, 11},
-        {0x212A, 15}, {0x0594, 11}, {0x0595, 11}, {0x0596, 11},
-        {0x212B, 15}, {0x212C, 15}, {0x212D, 15}, {0x212E, 15},
-        {0x212F, 15}, {0x001F,  5}, {0x0597, 11}, {0x00BE,  8},
-        {0x00BF,  8},
-    },{//3
-        {0x0000,  2}, {0x0002,  3}, {0x0006,  4}, {0x0007,  4},
-        {0x0010,  5}, {0x0011,  5}, {0x0024,  6}, {0x0025,  6},
-        {0x0026,  6}, {0x0027,  6}, {0x0050,  7}, {0x0051,  7},
-        {0x00A4,  8}, {0x00A5,  8}, {0x00A6,  8}, {0x014E,  9},
-        {0x000B,  4}, {0x002A,  6}, {0x0056,  7}, {0x014F,  9},
-        {0x0030,  6}, {0x00AE,  8}, {0x0062,  7}, {0x0032,  6},
-        {0x0033,  6}, {0x0034,  6}, {0x0035,  6}, {0x0036,  6},
-        {0x0063,  7}, {0x006E,  7}, {0x006F,  7}, {0x0070,  7},
-        {0x0071,  7}, {0x0072,  7}, {0x0073,  7}, {0x0074,  7},
-        {0x00AF,  8}, {0x00EA,  8}, {0x01D6,  9}, {0x075C, 11},
-        {0x03AF, 10}, {0x75D0, 15}, {0x75D1, 15}, {0x75D2, 15},
-        {0x75D3, 15}, {0x75D4, 15}, {0x0076,  7}, {0x00EE,  8},
-        {0x00EF,  8}, {0x0EBB, 12}, {0x01E0,  9}, {0x75D5, 15},
-        {0x0079,  7}, {0x01E1,  9}, {0x75D6, 15}, {0x75D7, 15},
-        {0x7880, 15}, {0x00F4,  8}, {0x0789, 11}, {0x003E,  6},
-        {0x007B,  7}, {0x00F5,  8}, {0x00FC,  8}, {0x007F,  7},
-        {0x01E3,  9}, {0x078A, 11}, {0x078B, 11}, {0x7881, 15},
-        {0x7882, 15}, {0x7883, 15}, {0x3C42, 14}, {0x3C43, 14},
-        {0x3C44, 14}, {0x00FD,  8}, {0x3C45, 14}, {0x3C46, 14},
-        {0x3C47, 14},
-    },{//4
-        {0x0000,  2}, {0x0004,  4}, {0x000A,  5}, {0x0016,  6},
-        {0x0017,  6}, {0x0030,  7}, {0x0031,  7}, {0x0064,  8},
-        {0x0065,  8}, {0x0066,  8}, {0x00CE,  9}, {0x00CF,  9},
-        {0x01A0, 10}, {0x01A1, 10}, {0x1A20, 14}, {0x0689, 12},
-        {0x0004,  3}, {0x000E,  5}, {0x001B,  6}, {0x0035,  7},
-        {0x000A,  4}, {0x001E,  6}, {0x0016,  5}, {0x0017,  5},
-        {0x001F,  6}, {0x0030,  6}, {0x0031,  6}, {0x0064,  7},
-        {0x0065,  7}, {0x0069,  8}, {0x0066,  7}, {0x00CE,  8},
-        {0x00CF,  8}, {0x00D0,  8}, {0x00D1,  8}, {0x00D2,  8},
-        {0x01A6,  9}, {0x01A3, 10}, {0x034E, 10}, {0x006A,  7},
-        {0x00D6,  8}, {0x01AE,  9}, {0x01AF,  9}, {0x034F, 10},
-        {0x0345, 11}, {0x01B0,  9}, {0x01B1,  9}, {0x0364, 10},
-        {0x006D,  7}, {0x00DC,  8}, {0x0D94, 12}, {0x0D95, 12},
-        {0x000E,  4}, {0x003C,  6}, {0x00DD,  8}, {0x00DE,  8},
-        {0x01B3,  9}, {0x003D,  6}, {0x00DF,  8}, {0x01F0,  9},
-        {0x03E2, 10}, {0x03E3, 10}, {0x06CB, 11}, {0x03E4, 10},
-        {0x07CA, 11}, {0x01F3,  9}, {0x01F4,  9}, {0x07CB, 11},
-        {0x07D4, 11}, {0x1A21, 14}, {0x1A22, 14}, {0x07D5, 11},
-        {0x1A23, 14}, {0x003F,  6}, {0x01F6,  9}, {0x01F7,  9},
-        {0x03EB, 10},
-    },{//5
-        {0x0000,  2}, {0x0002,  3}, {0x0006,  4}, {0x000E,  5},
-        {0x000F,  5}, {0x0020,  6}, {0x0021,  6}, {0x0044,  7},
-        {0x0045,  7}, {0x0046,  7}, {0x008E,  8}, {0x008F,  8},
-        {0x0090,  8}, {0x0122,  9}, {0x0246, 10}, {0x0124,  9},
-        {0x0005,  3}, {0x0013,  5}, {0x004A,  7}, {0x0093,  8},
-        {0x0018,  5}, {0x004B,  7}, {0x0032,  6}, {0x001A,  5},
-        {0x0033,  6}, {0x006C,  7}, {0x006D,  7}, {0x006E,  7},
-        {0x00DE,  8}, {0x00DF,  8}, {0x0070,  7}, {0x00E2,  8},
-        {0x00E3,  8}, {0x00E4,  8}, {0x00E5,  8}, {0x00E6,  8},
-        {0x00E7,  8}, {0x0125,  9}, {0x01D0,  9}, {0x048E, 11},
-        {0x091E, 12}, {0x091F, 12}, {0x7440, 15}, {0x1D11, 13},
-        {0x7441, 15}, {0x7442, 15}, {0x00E9,  8}, {0x01D4,  9},
-        {0x00EB,  8}, {0x03A3, 10}, {0x01D5,  9}, {0x1D12, 13},
-        {0x001E,  5}, {0x0076,  7}, {0x01DC,  9}, {0x01DD,  9},
-        {0x7443, 15}, {0x007C,  7}, {0x0745, 11}, {0x00EF,  8},
-        {0x00FA,  8}, {0x00FB,  8}, {0x01F8,  9}, {0x00FD,  8},
-        {0x07E4, 11}, {0x0FCA, 12}, {0x1D13, 13}, {0x7E58, 15},
-        {0x7E59, 15}, {0x7E5A, 15}, {0x7E5B, 15}, {0x7E5C, 15},
-        {0x7E5D, 15}, {0x007F,  7}, {0x3F2F, 14}, {0x07E6, 11},
-        {0x07E7, 11},
-    },{//6
-        {0x0000,  3}, {0x0002,  4}, {0x0003,  4}, {0x0008,  5},
-        {0x0009,  5}, {0x0014,  6}, {0x0015,  6}, {0x002C,  7},
-        {0x005A,  8}, {0x005B,  8}, {0x005C,  8}, {0x00BA,  9},
-        {0x00BB,  9}, {0x00BC,  9}, {0x02F4, 11}, {0x05EA, 12},
-        {0x0003,  3}, {0x0010,  5}, {0x0022,  6}, {0x0046,  7},
-        {0x0009,  4}, {0x0028,  6}, {0x0015,  5}, {0x000B,  4},
-        {0x0018,  5}, {0x0029,  6}, {0x0032,  6}, {0x0047,  7},
-        {0x0066,  7}, {0x0067,  7}, {0x0068,  7}, {0x0069,  7},
-        {0x006A,  7}, {0x005F,  8}, {0x00D6,  8}, {0x00D7,  8},
-        {0x01B0,  9}, {0x00D9,  8}, {0x017B, 10}, {0x006D,  7},
-        {0x00DC,  8}, {0x01B1,  9}, {0x06E8, 11}, {0x01BB,  9},
-        {0x0375, 10}, {0x05EB, 12}, {0x01BC,  9}, {0x6E90, 15},
-        {0x0038,  6}, {0x0072,  7}, {0x6E91, 15}, {0x6E92, 15},
-        {0x001D,  5}, {0x0073,  7}, {0x01BD,  9}, {0x06F8, 11},
-        {0x6E93, 15}, {0x003C,  6}, {0x01BF,  9}, {0x00F4,  8},
-        {0x01EA,  9}, {0x037D, 10}, {0x03D6, 10}, {0x06F9, 11},
-        {0x6E94, 15}, {0x00F6,  8}, {0x01EE,  9}, {0x6E95, 15},
-        {0x6E96, 15}, {0x6E97, 15}, {0x374C, 14}, {0x374D, 14},
-        {0x374E, 14}, {0x001F,  5}, {0x03D7, 10}, {0x01EF,  9},
-        {0x374F, 14},
-    },{//7
-        {0x0000,  2}, {0x0004,  4}, {0x000A,  5}, {0x0016,  6},
-        {0x002E,  7}, {0x002F,  7}, {0x0060,  8}, {0x0061,  8},
-        {0x00C4,  9}, {0x00C5,  9}, {0x00C6,  9}, {0x018E, 10},
-        {0x31E0, 15}, {0x31E1, 15}, {0x31E2, 15}, {0x31E3, 15},
-        {0x0004,  3}, {0x000D,  5}, {0x0019,  6}, {0x0038,  7},
-        {0x000A,  4}, {0x001D,  6}, {0x000B,  4}, {0x0072,  8},
-        {0x0073,  8}, {0x00F0,  9}, {0x01E2, 10}, {0x00F2,  9},
-        {0x01E3, 10}, {0x00F3,  9}, {0x01E8, 10}, {0x01E9, 10},
-        {0x31E4, 15}, {0x01EA, 10}, {0x031F, 11}, {0x03D6, 11},
-        {0x31E5, 15}, {0x01EC, 10}, {0x31E6, 15}, {0x00F7,  9},
-        {0x03D7, 11}, {0x31E7, 15}, {0x31E8, 15}, {0x03DA, 11},
-        {0x03DB, 11}, {0x31E9, 15}, {0x03E0, 11}, {0x31EA, 15},
-        {0x003F,  7}, {0x01F1, 10}, {0x31EB, 15}, {0x31EC, 15},
-        {0x0006,  3}, {0x001C,  5}, {0x0074,  7}, {0x0075,  7},
-        {0x00F9,  9}, {0x001E,  5}, {0x0076,  7}, {0x00FA,  9},
-        {0x03E1, 11}, {0x31ED, 15}, {0x18F7, 14}, {0x1F60, 14},
-        {0x1F61, 14}, {0x01DC,  9}, {0x01DD,  9}, {0x1F62, 14},
-        {0x1F63, 14}, {0x1F64, 14}, {0x1F65, 14}, {0x1F66, 14},
-        {0x1F67, 14}, {0x001F,  5}, {0x03ED, 11}, {0x00EF,  8},
-        {0x01F7, 10},
-    }
-};
-
-static const uint16_t x8_ac1_highquant_table[8][77][2]={
-    {//0
-        {0x0000,  3}, {0x0002,  4}, {0x0006,  5}, {0x0007,  5},
-        {0x0008,  5}, {0x0009,  5}, {0x0014,  6}, {0x002A,  7},
-        {0x0016,  6}, {0x002B,  7}, {0x005C,  8}, {0x002F,  7},
-        {0x0030,  7}, {0x005D,  8}, {0x0062,  8}, {0x00C6,  9},
-        {0x0007,  4}, {0x0019,  6}, {0x001A,  6}, {0x0036,  7},
-        {0x0010,  5}, {0x006E,  8}, {0x0022,  6}, {0x0009,  4},
-        {0x000A,  4}, {0x0016,  5}, {0x0023,  6}, {0x002E,  6},
-        {0x002F,  6}, {0x0030,  6}, {0x0062,  7}, {0x0063,  7},
-        {0x0064,  7}, {0x0065,  7}, {0x0066,  7}, {0x0067,  7},
-        {0x0068,  7}, {0x0069,  7}, {0x006A,  7}, {0x006B,  7},
-        {0x006C,  7}, {0x00C7,  9}, {0x00DE,  9}, {0x00DF,  9},
-        {0x06D0, 11}, {0x01B5,  9}, {0x0037,  6}, {0x00DB,  8},
-        {0x001C,  5}, {0x0074,  7}, {0x01D4,  9}, {0x01D5,  9},
-        {0x0076,  7}, {0x0369, 10}, {0x3688, 14}, {0x3689, 14},
-        {0x368A, 14}, {0x0077,  7}, {0x03AC, 10}, {0x0078,  7},
-        {0x00F2,  8}, {0x01D7,  9}, {0x00F3,  8}, {0x007A,  7},
-        {0x368B, 14}, {0x007B,  7}, {0x007C,  7}, {0x03AD, 10},
-        {0x03E8, 10}, {0x368C, 14}, {0x368D, 14}, {0x03E9, 10},
-        {0x368E, 14}, {0x003F,  6}, {0x01F5,  9}, {0x00FB,  8},
-        {0x368F, 14},
-    },{//1
-        {0x0000,  2}, {0x0004,  4}, {0x000A,  5}, {0x000B,  5},
-        {0x0018,  6}, {0x0032,  7}, {0x0033,  7}, {0x0034,  7},
-        {0x006A,  8}, {0x00D6,  9}, {0x00D7,  9}, {0x00D8,  9},
-        {0x00D9,  9}, {0x3680, 15}, {0x01B5, 10}, {0x0369, 11},
-        {0x0004,  3}, {0x000E,  5}, {0x001E,  6}, {0x0037,  7},
-        {0x000A,  4}, {0x0016,  5}, {0x000C,  4}, {0x001F,  6},
-        {0x005C,  7}, {0x005D,  7}, {0x00BC,  8}, {0x00BD,  8},
-        {0x005F,  7}, {0x00D0,  8}, {0x00DB,  9}, {0x00D1,  8},
-        {0x01A4,  9}, {0x01A5,  9}, {0x01A6,  9}, {0x01A7,  9},
-        {0x0350, 10}, {0x06A2, 11}, {0x06A3, 11}, {0x01A9,  9},
-        {0x01AA,  9}, {0x06AC, 11}, {0x3681, 15}, {0x0357, 10},
-        {0x3682, 15}, {0x3683, 15}, {0x3684, 15}, {0x3685, 15},
-        {0x0036,  6}, {0x00D6,  8}, {0x3686, 15}, {0x3687, 15},
-        {0x000E,  4}, {0x006E,  7}, {0x00D7,  8}, {0x06AD, 11},
-        {0x3688, 15}, {0x001E,  5}, {0x00DE,  8}, {0x06F8, 11},
-        {0x037D, 10}, {0x3689, 15}, {0x368A, 15}, {0x368B, 15},
-        {0x368C, 15}, {0x01BF,  9}, {0x368D, 15}, {0x1B47, 14},
-        {0x37C8, 14}, {0x37C9, 14}, {0x37CA, 14}, {0x37CB, 14},
-        {0x37CC, 14}, {0x001F,  5}, {0x37CD, 14}, {0x37CE, 14},
-        {0x37CF, 14},
-    },{//2
-        {0x0000,  3}, {0x0002,  4}, {0x0003,  4}, {0x0008,  5},
-        {0x0012,  6}, {0x0026,  7}, {0x0014,  6}, {0x0027,  7},
-        {0x00A8,  9}, {0x00A9,  9}, {0x0055,  8}, {0x2B00, 15},
-        {0x00AD,  9}, {0x2B01, 15}, {0x2B02, 15}, {0x2B03, 15},
-        {0x0003,  3}, {0x000B,  5}, {0x0040,  7}, {0x0041,  7},
-        {0x0009,  4}, {0x0021,  6}, {0x0011,  5}, {0x000A,  4},
-        {0x000B,  4}, {0x0018,  5}, {0x0032,  6}, {0x0033,  6},
-        {0x0034,  6}, {0x0035,  6}, {0x006C,  7}, {0x0057,  8},
-        {0x006D,  7}, {0x00DC,  8}, {0x0159, 10}, {0x00DD,  8},
-        {0x01BC,  9}, {0x037A, 10}, {0x037B, 10}, {0x0038,  6},
-        {0x0072,  7}, {0x01BE,  9}, {0x01BF,  9}, {0x00E6,  8},
-        {0x039C, 10}, {0x01CF,  9}, {0x2B04, 15}, {0x2B05, 15},
-        {0x0074,  7}, {0x01D4,  9}, {0x2B06, 15}, {0x2B07, 15},
-        {0x001E,  5}, {0x00EB,  8}, {0x1584, 14}, {0x1585, 14},
-        {0x1586, 14}, {0x003B,  6}, {0x01D5,  9}, {0x01F0,  9},
-        {0x039D, 10}, {0x03E2, 10}, {0x1587, 14}, {0x1588, 14},
-        {0x1589, 14}, {0x00F9,  8}, {0x158A, 14}, {0x158B, 14},
-        {0x03E3, 10}, {0x158C, 14}, {0x158D, 14}, {0x01F4,  9},
-        {0x158E, 14}, {0x003F,  6}, {0x00FB,  8}, {0x01F5,  9},
-        {0x158F, 14},
-    },{//3
-        {0x0000,  3}, {0x0002,  4}, {0x0006,  5}, {0x0007,  5},
-        {0x0010,  6}, {0x0011,  6}, {0x0024,  7}, {0x0025,  7},
-        {0x0013,  6}, {0x0014,  6}, {0x002A,  7}, {0x002B,  7},
-        {0x00B0,  9}, {0x00B1,  9}, {0x002D,  7}, {0x0059,  8},
-        {0x000C,  5}, {0x0017,  6}, {0x00D0,  9}, {0x0035,  7},
-        {0x001B,  6}, {0x0038,  7}, {0x0039,  7}, {0x0004,  3},
-        {0x0005,  3}, {0x000F,  5}, {0x0018,  5}, {0x001D,  6},
-        {0x0032,  6}, {0x0033,  6}, {0x0068,  7}, {0x0069,  7},
-        {0x0069,  8}, {0x00D4,  8}, {0x00D5,  8}, {0x00D6,  8},
-        {0x006C,  7}, {0x0037,  6}, {0x006D,  7}, {0x0070,  7},
-        {0x0039,  6}, {0x00D7,  8}, {0x00D1,  9}, {0x3880, 14},
-        {0x3881, 14}, {0x3882, 14}, {0x0074,  7}, {0x01C5,  9},
-        {0x0075,  7}, {0x00E3,  8}, {0x3883, 14}, {0x3884, 14},
-        {0x00EC,  8}, {0x3885, 14}, {0x1C43, 13}, {0x1C44, 13},
-        {0x1C45, 13}, {0x00ED,  8}, {0x1C46, 13}, {0x003C,  6},
-        {0x0077,  7}, {0x01E8,  9}, {0x003E,  6}, {0x007B,  7},
-        {0x1C47, 13}, {0x007E,  7}, {0x007F,  7}, {0x1C48, 13},
-        {0x1C49, 13}, {0x1C4A, 13}, {0x1C4B, 13}, {0x1C4C, 13},
-        {0x1C4D, 13}, {0x00F5,  8}, {0x1C4E, 13}, {0x01E9,  9},
-        {0x1C4F, 13},
-    },{//4
-        {0x0000,  2}, {0x0004,  4}, {0x000A,  5}, {0x000B,  5},
-        {0x0018,  6}, {0x0019,  6}, {0x0034,  7}, {0x0035,  7},
-        {0x0036,  7}, {0x006E,  8}, {0x00DE,  9}, {0x00DF,  9},
-        {0x01C0, 10}, {0x01C1, 10}, {0x01C2, 10}, {0x3860, 15},
-        {0x0004,  3}, {0x000F,  5}, {0x001D,  6}, {0x0039,  7},
-        {0x000A,  4}, {0x002C,  6}, {0x002D,  6}, {0x000C,  4},
-        {0x0017,  5}, {0x0034,  6}, {0x0035,  6}, {0x0036,  6},
-        {0x006E,  7}, {0x006F,  7}, {0x0070,  7}, {0x0071,  7},
-        {0x0071,  8}, {0x00E4,  8}, {0x00E5,  8}, {0x00E6,  8},
-        {0x00E7,  8}, {0x00E8,  8}, {0x03A4, 10}, {0x0075,  7},
-        {0x00EC,  8}, {0x01D3,  9}, {0x01DA,  9}, {0x03A5, 10},
-        {0x03B6, 10}, {0x070D, 12}, {0x03B7, 10}, {0x070E, 12},
-        {0x003C,  6}, {0x00EE,  8}, {0x3861, 15}, {0x3862, 15},
-        {0x003D,  6}, {0x01DE,  9}, {0x3863, 15}, {0x3864, 15},
-        {0x3865, 15}, {0x007C,  7}, {0x070F, 12}, {0x03BE, 10},
-        {0x03BF, 10}, {0x3866, 15}, {0x0FA0, 12}, {0x07D1, 11},
-        {0x3867, 15}, {0x00FB,  8}, {0x01F5,  9}, {0x7D08, 15},
-        {0x0FA4, 12}, {0x7D09, 15}, {0x7D0A, 15}, {0x7D0B, 15},
-        {0x3E86, 14}, {0x003F,  6}, {0x0FA5, 12}, {0x07D3, 11},
-        {0x3E87, 14},
-    },{//5
-        {0x0000,  3}, {0x0002,  4}, {0x0003,  4}, {0x0008,  5},
-        {0x0009,  5}, {0x0014,  6}, {0x002A,  7}, {0x0056,  8},
-        {0x02B8, 11}, {0x00AF,  9}, {0x02B9, 11}, {0x015D, 10},
-        {0x02C0, 11}, {0x2C10, 15}, {0x2C11, 15}, {0x2C12, 15},
-        {0x0006,  4}, {0x000E,  5}, {0x0017,  6}, {0x002D,  7},
-        {0x000F,  5}, {0x0040,  7}, {0x0021,  6}, {0x0005,  3},
-        {0x0009,  4}, {0x0011,  5}, {0x0018,  5}, {0x0019,  5},
-        {0x001A,  5}, {0x0036,  6}, {0x0037,  6}, {0x0041,  7},
-        {0x0059,  8}, {0x00E0,  8}, {0x00E1,  8}, {0x0071,  7},
-        {0x00E4,  8}, {0x00B1,  9}, {0x02C2, 11}, {0x001D,  5},
-        {0x0073,  7}, {0x00E5,  8}, {0x00F0,  8}, {0x0079,  7},
-        {0x03C4, 10}, {0x01E3,  9}, {0x01E8,  9}, {0x2C13, 15},
-        {0x007B,  7}, {0x2C14, 15}, {0x2C15, 15}, {0x2C16, 15},
-        {0x007C,  7}, {0x02C3, 11}, {0x2C17, 15}, {0x160C, 14},
-        {0x160D, 14}, {0x007D,  7}, {0x160E, 14}, {0x01E9,  9},
-        {0x03C5, 10}, {0x03D4, 10}, {0x01EB,  9}, {0x160F, 14},
-        {0x3D50, 14}, {0x00FC,  8}, {0x07AB, 11}, {0x3D51, 14},
-        {0x3D52, 14}, {0x3D53, 14}, {0x3D54, 14}, {0x01FA,  9},
-        {0x3D55, 14}, {0x007F,  7}, {0x01FB,  9}, {0x3D56, 14},
-        {0x3D57, 14},
-    },{//6
-        {0x0000,  3}, {0x0002,  4}, {0x0003,  4}, {0x0008,  5},
-        {0x0009,  5}, {0x000A,  5}, {0x000B,  5}, {0x0018,  6},
-        {0x0032,  7}, {0x000D,  5}, {0x0033,  7}, {0x0E00, 13},
-        {0x0039,  7}, {0x0E01, 13}, {0x003A,  7}, {0x0E02, 13},
-        {0x0008,  4}, {0x001E,  6}, {0x003B,  7}, {0x003E,  7},
-        {0x0012,  5}, {0x003F,  7}, {0x0013,  5}, {0x0028,  6},
-        {0x0029,  6}, {0x0054,  7}, {0x002B,  6}, {0x0055,  7},
-        {0x0058,  7}, {0x0E03, 13}, {0x0059,  7}, {0x005A,  7},
-        {0x0E04, 13}, {0x0E05, 13}, {0x0703, 12}, {0x005B,  7},
-        {0x005C,  7}, {0x0704, 12}, {0x0705, 12}, {0x005D,  7},
-        {0x0706, 12}, {0x0707, 12}, {0x0708, 12}, {0x0709, 12},
-        {0x070A, 12}, {0x070B, 12}, {0x0018,  5}, {0x002F,  6},
-        {0x000D,  4}, {0x0019,  5}, {0x070C, 12}, {0x0070,  7},
-        {0x001D,  5}, {0x070D, 12}, {0x070E, 12}, {0x070F, 12},
-        {0x0710, 12}, {0x0039,  6}, {0x0711, 12}, {0x003C,  6},
-        {0x0712, 12}, {0x0713, 12}, {0x0714, 12}, {0x0715, 12},
-        {0x0716, 12}, {0x003D,  6}, {0x0717, 12}, {0x0718, 12},
-        {0x0719, 12}, {0x071A, 12}, {0x071B, 12}, {0x071C, 12},
-        {0x071D, 12}, {0x001F,  5}, {0x071E, 12}, {0x0071,  7},
-        {0x071F, 12},
-    },{//7
-        {0x0000,  3}, {0x0002,  4}, {0x0006,  5}, {0x000E,  6},
-        {0x000F,  6}, {0x0040,  8}, {0x0041,  8}, {0x0042,  8},
-        {0x0218, 11}, {0x2190, 15}, {0x2191, 15}, {0x2192, 15},
-        {0x2193, 15}, {0x2194, 15}, {0x2195, 15}, {0x2196, 15},
-        {0x0005,  4}, {0x0011,  6}, {0x0024,  7}, {0x0087,  9},
-        {0x000C,  5}, {0x004A,  8}, {0x004B,  8}, {0x0002,  2},
-        {0x0006,  3}, {0x000D,  5}, {0x000E,  5}, {0x000F,  5},
-        {0x0013,  6}, {0x0038,  6}, {0x00E4,  8}, {0x00E5,  8},
-        {0x01CC,  9}, {0x00E7,  8}, {0x0074,  7}, {0x00EA,  8},
-        {0x01CD,  9}, {0x021A, 11}, {0x2197, 15}, {0x001E,  5},
-        {0x0076,  7}, {0x00EB,  8}, {0x01DC,  9}, {0x00EF,  8},
-        {0x01DD,  9}, {0x01F0,  9}, {0x2198, 15}, {0x2199, 15},
-        {0x00F9,  8}, {0x03E2, 10}, {0x219A, 15}, {0x219B, 15},
-        {0x00FA,  8}, {0x219C, 15}, {0x219D, 15}, {0x219E, 15},
-        {0x219F, 15}, {0x01F6,  9}, {0x21B0, 15}, {0x00FC,  8},
-        {0x01F7,  9}, {0x21B1, 15}, {0x21B2, 15}, {0x21B3, 15},
-        {0x21B4, 15}, {0x01FA,  9}, {0x21B5, 15}, {0x21B6, 15},
-        {0x21B7, 15}, {0x21B8, 15}, {0x21B9, 15}, {0x03E3, 10},
-        {0x10DD, 14}, {0x007F,  7}, {0x01FB,  9}, {0x10DE, 14},
-        {0x10DF, 14},
-    }
-};
-#define MAX_AC_VLC_BITS 16
-
-#endif /* AVCODEC_INTRAX8HUF_H */
diff --git a/deps/libav/libavcodec/ituh263dec.c b/deps/libav/libavcodec/ituh263dec.c
deleted file mode 100644
index 98c8cfc..0000000
--- a/deps/libav/libavcodec/ituh263dec.c
+++ /dev/null
@@ -1,1145 +0,0 @@
-/*
- * ITU H263 bitstream decoder
- * Copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support.
- * Copyright (c) 2001 Juan J. Sierralta P
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * h263 decoder.
- */
-
-#include <limits.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h263.h"
-#include "mathops.h"
-#include "unary.h"
-#include "flv.h"
-#include "mpeg4video.h"
-
-// The defines below define the number of bits that are read at once for
-// reading vlc values. Changing these may improve speed and data cache needs
-// be aware though that decreasing them may need the number of stages that is
-// passed to get_vlc* to be increased.
-#define MV_VLC_BITS 9
-#define H263_MBTYPE_B_VLC_BITS 6
-#define CBPC_B_VLC_BITS 3
-
-static const int h263_mb_type_b_map[15]= {
-    MB_TYPE_DIRECT2 | MB_TYPE_L0L1,
-    MB_TYPE_DIRECT2 | MB_TYPE_L0L1 | MB_TYPE_CBP,
-    MB_TYPE_DIRECT2 | MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_QUANT,
-                      MB_TYPE_L0                                 | MB_TYPE_16x16,
-                      MB_TYPE_L0   | MB_TYPE_CBP                 | MB_TYPE_16x16,
-                      MB_TYPE_L0   | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16,
-                      MB_TYPE_L1                                 | MB_TYPE_16x16,
-                      MB_TYPE_L1   | MB_TYPE_CBP                 | MB_TYPE_16x16,
-                      MB_TYPE_L1   | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16,
-                      MB_TYPE_L0L1                               | MB_TYPE_16x16,
-                      MB_TYPE_L0L1 | MB_TYPE_CBP                 | MB_TYPE_16x16,
-                      MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16,
-    0, //stuffing
-    MB_TYPE_INTRA4x4                | MB_TYPE_CBP,
-    MB_TYPE_INTRA4x4                | MB_TYPE_CBP | MB_TYPE_QUANT,
-};
-
-void ff_h263_show_pict_info(MpegEncContext *s){
-    if(s->avctx->debug&FF_DEBUG_PICT_INFO){
-    av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d%s%s%s%s%s%s%s%s%s %d/%d\n",
-         s->qscale, av_get_picture_type_char(s->pict_type),
-         s->gb.size_in_bits, 1-s->no_rounding,
-         s->obmc ? " AP" : "",
-         s->umvplus ? " UMV" : "",
-         s->h263_long_vectors ? " LONG" : "",
-         s->h263_plus ? " +" : "",
-         s->h263_aic ? " AIC" : "",
-         s->alt_inter_vlc ? " AIV" : "",
-         s->modified_quant ? " MQ" : "",
-         s->loop_filter ? " LOOP" : "",
-         s->h263_slice_structured ? " SS" : "",
-         s->avctx->time_base.den, s->avctx->time_base.num
-    );
-    }
-}
-
-/***********************************************/
-/* decoding */
-
-VLC ff_h263_intra_MCBPC_vlc;
-VLC ff_h263_inter_MCBPC_vlc;
-VLC ff_h263_cbpy_vlc;
-static VLC mv_vlc;
-static VLC h263_mbtype_b_vlc;
-static VLC cbpc_b_vlc;
-
-/* init vlcs */
-
-/* XXX: find a better solution to handle static init */
-av_cold void ff_h263_decode_init_vlc(void)
-{
-    static int done = 0;
-
-    if (!done) {
-        done = 1;
-
-        INIT_VLC_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,
-                 ff_h263_intra_MCBPC_bits, 1, 1,
-                 ff_h263_intra_MCBPC_code, 1, 1, 72);
-        INIT_VLC_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,
-                 ff_h263_inter_MCBPC_bits, 1, 1,
-                 ff_h263_inter_MCBPC_code, 1, 1, 198);
-        INIT_VLC_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16,
-                 &ff_h263_cbpy_tab[0][1], 2, 1,
-                 &ff_h263_cbpy_tab[0][0], 2, 1, 64);
-        INIT_VLC_STATIC(&mv_vlc, MV_VLC_BITS, 33,
-                 &ff_mvtab[0][1], 2, 1,
-                 &ff_mvtab[0][0], 2, 1, 538);
-        ff_init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]);
-        ff_init_rl(&ff_rl_intra_aic, ff_h263_static_rl_table_store[1]);
-        INIT_VLC_RL(ff_h263_rl_inter, 554);
-        INIT_VLC_RL(ff_rl_intra_aic, 554);
-        INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,
-                 &ff_h263_mbtype_b_tab[0][1], 2, 1,
-                 &ff_h263_mbtype_b_tab[0][0], 2, 1, 80);
-        INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4,
-                 &ff_cbpc_b_tab[0][1], 2, 1,
-                 &ff_cbpc_b_tab[0][0], 2, 1, 8);
-    }
-}
-
-int ff_h263_decode_mba(MpegEncContext *s)
-{
-    int i, mb_pos;
-
-    for(i=0; i<6; i++){
-        if(s->mb_num-1 <= ff_mba_max[i]) break;
-    }
-    mb_pos= get_bits(&s->gb, ff_mba_length[i]);
-    s->mb_x= mb_pos % s->mb_width;
-    s->mb_y= mb_pos / s->mb_width;
-
-    return mb_pos;
-}
-
-/**
- * Decode the group of blocks header or slice header.
- * @return <0 if an error occurred
- */
-static int h263_decode_gob_header(MpegEncContext *s)
-{
-    unsigned int val, gob_number;
-    int left;
-
-    /* Check for GOB Start Code */
-    val = show_bits(&s->gb, 16);
-    if(val)
-        return -1;
-
-        /* We have a GBSC probably with GSTUFF */
-    skip_bits(&s->gb, 16); /* Drop the zeros */
-    left= get_bits_left(&s->gb);
-    //MN: we must check the bits left or we might end in a infinite loop (or segfault)
-    for(;left>13; left--){
-        if(get_bits1(&s->gb)) break; /* Seek the '1' bit */
-    }
-    if(left<=13)
-        return -1;
-
-    if(s->h263_slice_structured){
-        if(get_bits1(&s->gb)==0)
-            return -1;
-
-        ff_h263_decode_mba(s);
-
-        if(s->mb_num > 1583)
-            if(get_bits1(&s->gb)==0)
-                return -1;
-
-        s->qscale = get_bits(&s->gb, 5); /* SQUANT */
-        if(get_bits1(&s->gb)==0)
-            return -1;
-        skip_bits(&s->gb, 2); /* GFID */
-    }else{
-        gob_number = get_bits(&s->gb, 5); /* GN */
-        s->mb_x= 0;
-        s->mb_y= s->gob_index* gob_number;
-        skip_bits(&s->gb, 2); /* GFID */
-        s->qscale = get_bits(&s->gb, 5); /* GQUANT */
-    }
-
-    if(s->mb_y >= s->mb_height)
-        return -1;
-
-    if(s->qscale==0)
-        return -1;
-
-    return 0;
-}
-
-/**
- * Find the next resync_marker.
- * @param p pointer to buffer to scan
- * @param end pointer to the end of the buffer
- * @return pointer to the next resync_marker, or end if none was found
- */
-const uint8_t *ff_h263_find_resync_marker(const uint8_t *restrict p, const uint8_t * restrict end)
-{
-    assert(p < end);
-
-    end-=2;
-    p++;
-    for(;p<end; p+=2){
-        if(!*p){
-            if     (!p[-1] && p[1]) return p - 1;
-            else if(!p[ 1] && p[2]) return p;
-        }
-    }
-    return end+2;
-}
-
-/**
- * Decode the group of blocks / video packet header.
- * @return bit position of the resync_marker, or <0 if none was found
- */
-int ff_h263_resync(MpegEncContext *s){
-    int left, pos, ret;
-
-    if(s->codec_id==AV_CODEC_ID_MPEG4){
-        skip_bits1(&s->gb);
-        align_get_bits(&s->gb);
-    }
-
-    if(show_bits(&s->gb, 16)==0){
-        pos= get_bits_count(&s->gb);
-        if(CONFIG_MPEG4_DECODER && s->codec_id==AV_CODEC_ID_MPEG4)
-            ret= ff_mpeg4_decode_video_packet_header(s->avctx->priv_data);
-        else
-            ret= h263_decode_gob_header(s);
-        if(ret>=0)
-            return pos;
-    }
-    //OK, it's not where it is supposed to be ...
-    s->gb= s->last_resync_gb;
-    align_get_bits(&s->gb);
-    left= get_bits_left(&s->gb);
-
-    for(;left>16+1+5+5; left-=8){
-        if(show_bits(&s->gb, 16)==0){
-            GetBitContext bak= s->gb;
-
-            pos= get_bits_count(&s->gb);
-            if(CONFIG_MPEG4_DECODER && s->codec_id==AV_CODEC_ID_MPEG4)
-                ret= ff_mpeg4_decode_video_packet_header(s->avctx->priv_data);
-            else
-                ret= h263_decode_gob_header(s);
-            if(ret>=0)
-                return pos;
-
-            s->gb= bak;
-        }
-        skip_bits(&s->gb, 8);
-    }
-
-    return -1;
-}
-
-int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code)
-{
-    int code, val, sign, shift;
-    code = get_vlc2(&s->gb, mv_vlc.table, MV_VLC_BITS, 2);
-
-    if (code == 0)
-        return pred;
-    if (code < 0)
-        return 0xffff;
-
-    sign = get_bits1(&s->gb);
-    shift = f_code - 1;
-    val = code;
-    if (shift) {
-        val = (val - 1) << shift;
-        val |= get_bits(&s->gb, shift);
-        val++;
-    }
-    if (sign)
-        val = -val;
-    val += pred;
-
-    /* modulo decoding */
-    if (!s->h263_long_vectors) {
-        val = sign_extend(val, 5 + f_code);
-    } else {
-        /* horrible h263 long vector mode */
-        if (pred < -31 && val < -63)
-            val += 64;
-        if (pred > 32 && val > 63)
-            val -= 64;
-
-    }
-    return val;
-}
-
-
-/* Decode RVLC of H.263+ UMV */
-static int h263p_decode_umotion(MpegEncContext * s, int pred)
-{
-   int code = 0, sign;
-
-   if (get_bits1(&s->gb)) /* Motion difference = 0 */
-      return pred;
-
-   code = 2 + get_bits1(&s->gb);
-
-   while (get_bits1(&s->gb))
-   {
-      code <<= 1;
-      code += get_bits1(&s->gb);
-   }
-   sign = code & 1;
-   code >>= 1;
-
-   code = (sign) ? (pred - code) : (pred + code);
-   av_dlog(s->avctx,"H.263+ UMV Motion = %d\n", code);
-   return code;
-
-}
-
-/**
- * read the next MVs for OBMC. yes this is a ugly hack, feel free to send a patch :)
- */
-static void preview_obmc(MpegEncContext *s){
-    GetBitContext gb= s->gb;
-
-    int cbpc, i, pred_x, pred_y, mx, my;
-    int16_t *mot_val;
-    const int xy= s->mb_x + 1 + s->mb_y * s->mb_stride;
-    const int stride= s->b8_stride*2;
-
-    for(i=0; i<4; i++)
-        s->block_index[i]+= 2;
-    for(i=4; i<6; i++)
-        s->block_index[i]+= 1;
-    s->mb_x++;
-
-    assert(s->pict_type == AV_PICTURE_TYPE_P);
-
-    do{
-        if (get_bits1(&s->gb)) {
-            /* skip mb */
-            mot_val = s->current_picture.motion_val[0][s->block_index[0]];
-            mot_val[0       ]= mot_val[2       ]=
-            mot_val[0+stride]= mot_val[2+stride]= 0;
-            mot_val[1       ]= mot_val[3       ]=
-            mot_val[1+stride]= mot_val[3+stride]= 0;
-
-            s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
-            goto end;
-        }
-        cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
-    }while(cbpc == 20);
-
-    if(cbpc & 4){
-        s->current_picture.mb_type[xy] = MB_TYPE_INTRA;
-    }else{
-        get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
-        if (cbpc & 8) {
-            if(s->modified_quant){
-                if(get_bits1(&s->gb)) skip_bits(&s->gb, 1);
-                else                  skip_bits(&s->gb, 5);
-            }else
-                skip_bits(&s->gb, 2);
-        }
-
-        if ((cbpc & 16) == 0) {
-                s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
-                /* 16x16 motion prediction */
-                mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-                if (s->umvplus)
-                   mx = h263p_decode_umotion(s, pred_x);
-                else
-                   mx = ff_h263_decode_motion(s, pred_x, 1);
-
-                if (s->umvplus)
-                   my = h263p_decode_umotion(s, pred_y);
-                else
-                   my = ff_h263_decode_motion(s, pred_y, 1);
-
-                mot_val[0       ]= mot_val[2       ]=
-                mot_val[0+stride]= mot_val[2+stride]= mx;
-                mot_val[1       ]= mot_val[3       ]=
-                mot_val[1+stride]= mot_val[3+stride]= my;
-        } else {
-            s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
-            for(i=0;i<4;i++) {
-                mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
-                if (s->umvplus)
-                  mx = h263p_decode_umotion(s, pred_x);
-                else
-                  mx = ff_h263_decode_motion(s, pred_x, 1);
-
-                if (s->umvplus)
-                  my = h263p_decode_umotion(s, pred_y);
-                else
-                  my = ff_h263_decode_motion(s, pred_y, 1);
-                if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
-                  skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
-                mot_val[0] = mx;
-                mot_val[1] = my;
-            }
-        }
-    }
-end:
-
-    for(i=0; i<4; i++)
-        s->block_index[i]-= 2;
-    for(i=4; i<6; i++)
-        s->block_index[i]-= 1;
-    s->mb_x--;
-
-    s->gb= gb;
-}
-
-static void h263_decode_dquant(MpegEncContext *s){
-    static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
-
-    if(s->modified_quant){
-        if(get_bits1(&s->gb))
-            s->qscale= ff_modified_quant_tab[get_bits1(&s->gb)][ s->qscale ];
-        else
-            s->qscale= get_bits(&s->gb, 5);
-    }else
-        s->qscale += quant_tab[get_bits(&s->gb, 2)];
-    ff_set_qscale(s, s->qscale);
-}
-
-static int h263_decode_block(MpegEncContext * s, int16_t * block,
-                             int n, int coded)
-{
-    int code, level, i, j, last, run;
-    RLTable *rl = &ff_h263_rl_inter;
-    const uint8_t *scan_table;
-    GetBitContext gb= s->gb;
-
-    scan_table = s->intra_scantable.permutated;
-    if (s->h263_aic && s->mb_intra) {
-        rl = &ff_rl_intra_aic;
-        i = 0;
-        if (s->ac_pred) {
-            if (s->h263_aic_dir)
-                scan_table = s->intra_v_scantable.permutated; /* left */
-            else
-                scan_table = s->intra_h_scantable.permutated; /* top */
-        }
-    } else if (s->mb_intra) {
-        /* DC coef */
-        if(s->codec_id == AV_CODEC_ID_RV10){
-#if CONFIG_RV10_DECODER
-          if (s->rv10_version == 3 && s->pict_type == AV_PICTURE_TYPE_I) {
-            int component, diff;
-            component = (n <= 3 ? 0 : n - 4 + 1);
-            level = s->last_dc[component];
-            if (s->rv10_first_dc_coded[component]) {
-                diff = ff_rv_decode_dc(s, n);
-                if (diff == 0xffff)
-                    return -1;
-                level += diff;
-                level = level & 0xff; /* handle wrap round */
-                s->last_dc[component] = level;
-            } else {
-                s->rv10_first_dc_coded[component] = 1;
-            }
-          } else {
-                level = get_bits(&s->gb, 8);
-                if (level == 255)
-                    level = 128;
-          }
-#endif
-        }else{
-            level = get_bits(&s->gb, 8);
-            if((level&0x7F) == 0){
-                av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n", level, s->mb_x, s->mb_y);
-                if(s->err_recognition & AV_EF_BITSTREAM)
-                    return -1;
-            }
-            if (level == 255)
-                level = 128;
-        }
-        block[0] = level;
-        i = 1;
-    } else {
-        i = 0;
-    }
-    if (!coded) {
-        if (s->mb_intra && s->h263_aic)
-            goto not_coded;
-        s->block_last_index[n] = i - 1;
-        return 0;
-    }
-retry:
-    for(;;) {
-        code = get_vlc2(&s->gb, rl->vlc.table, TEX_VLC_BITS, 2);
-        if (code < 0){
-            av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n", s->mb_x, s->mb_y);
-            return -1;
-        }
-        if (code == rl->n) {
-            /* escape */
-            if (CONFIG_FLV_DECODER && s->h263_flv > 1) {
-                ff_flv2_decode_ac_esc(&s->gb, &level, &run, &last);
-            } else {
-                last = get_bits1(&s->gb);
-                run = get_bits(&s->gb, 6);
-                level = (int8_t)get_bits(&s->gb, 8);
-                if(level == -128){
-                    if (s->codec_id == AV_CODEC_ID_RV10) {
-                        /* XXX: should patch encoder too */
-                        level = get_sbits(&s->gb, 12);
-                    }else{
-                        level = get_bits(&s->gb, 5);
-                        level |= get_sbits(&s->gb, 6)<<5;
-                    }
-                }
-            }
-        } else {
-            run = rl->table_run[code];
-            level = rl->table_level[code];
-            last = code >= rl->last;
-            if (get_bits1(&s->gb))
-                level = -level;
-        }
-        i += run;
-        if (i >= 64){
-            if(s->alt_inter_vlc && rl == &ff_h263_rl_inter && !s->mb_intra){
-                //Looks like a hack but no, it's the way it is supposed to work ...
-                rl = &ff_rl_intra_aic;
-                i = 0;
-                s->gb= gb;
-                s->dsp.clear_block(block);
-                goto retry;
-            }
-            av_log(s->avctx, AV_LOG_ERROR, "run overflow at %dx%d i:%d\n", s->mb_x, s->mb_y, s->mb_intra);
-            return -1;
-        }
-        j = scan_table[i];
-        block[j] = level;
-        if (last)
-            break;
-        i++;
-    }
-not_coded:
-    if (s->mb_intra && s->h263_aic) {
-        ff_h263_pred_acdc(s, block, n);
-        i = 63;
-    }
-    s->block_last_index[n] = i;
-    return 0;
-}
-
-static int h263_skip_b_part(MpegEncContext *s, int cbp)
-{
-    LOCAL_ALIGNED_16(int16_t, dblock, [64]);
-    int i, mbi;
-
-    /* we have to set s->mb_intra to zero to decode B-part of PB-frame correctly
-     * but real value should be restored in order to be used later (in OBMC condition)
-     */
-    mbi = s->mb_intra;
-    s->mb_intra = 0;
-    for (i = 0; i < 6; i++) {
-        if (h263_decode_block(s, dblock, i, cbp&32) < 0)
-            return -1;
-        cbp+=cbp;
-    }
-    s->mb_intra = mbi;
-    return 0;
-}
-
-static int h263_get_modb(GetBitContext *gb, int pb_frame, int *cbpb)
-{
-    int c, mv = 1;
-
-    if (pb_frame < 3) { // h.263 Annex G and i263 PB-frame
-        c = get_bits1(gb);
-        if (pb_frame == 2 && c)
-            mv = !get_bits1(gb);
-    } else { // h.263 Annex M improved PB-frame
-        mv = get_unary(gb, 0, 4) + 1;
-        c = mv & 1;
-        mv = !!(mv & 2);
-    }
-    if(c)
-        *cbpb = get_bits(gb, 6);
-    return mv;
-}
-
-int ff_h263_decode_mb(MpegEncContext *s,
-                      int16_t block[6][64])
-{
-    int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
-    int16_t *mot_val;
-    const int xy= s->mb_x + s->mb_y * s->mb_stride;
-    int cbpb = 0, pb_mv_count = 0;
-
-    assert(!s->h263_pred);
-
-    if (s->pict_type == AV_PICTURE_TYPE_P) {
-        do{
-            if (get_bits1(&s->gb)) {
-                /* skip mb */
-                s->mb_intra = 0;
-                for(i=0;i<6;i++)
-                    s->block_last_index[i] = -1;
-                s->mv_dir = MV_DIR_FORWARD;
-                s->mv_type = MV_TYPE_16X16;
-                s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
-                s->mv[0][0][0] = 0;
-                s->mv[0][0][1] = 0;
-                s->mb_skipped = !(s->obmc | s->loop_filter);
-                goto end;
-            }
-            cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
-            if (cbpc < 0){
-                av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-        }while(cbpc == 20);
-
-        s->dsp.clear_blocks(s->block[0]);
-
-        dquant = cbpc & 8;
-        s->mb_intra = ((cbpc & 4) != 0);
-        if (s->mb_intra) goto intra;
-
-        if(s->pb_frame && get_bits1(&s->gb))
-            pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb);
-        cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
-
-        if(s->alt_inter_vlc==0 || (cbpc & 3)!=3)
-            cbpy ^= 0xF;
-
-        cbp = (cbpc & 3) | (cbpy << 2);
-        if (dquant) {
-            h263_decode_dquant(s);
-        }
-
-        s->mv_dir = MV_DIR_FORWARD;
-        if ((cbpc & 16) == 0) {
-            s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
-            /* 16x16 motion prediction */
-            s->mv_type = MV_TYPE_16X16;
-            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-            if (s->umvplus)
-               mx = h263p_decode_umotion(s, pred_x);
-            else
-               mx = ff_h263_decode_motion(s, pred_x, 1);
-
-            if (mx >= 0xffff)
-                return -1;
-
-            if (s->umvplus)
-               my = h263p_decode_umotion(s, pred_y);
-            else
-               my = ff_h263_decode_motion(s, pred_y, 1);
-
-            if (my >= 0xffff)
-                return -1;
-            s->mv[0][0][0] = mx;
-            s->mv[0][0][1] = my;
-
-            if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
-               skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
-        } else {
-            s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
-            s->mv_type = MV_TYPE_8X8;
-            for(i=0;i<4;i++) {
-                mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
-                if (s->umvplus)
-                  mx = h263p_decode_umotion(s, pred_x);
-                else
-                  mx = ff_h263_decode_motion(s, pred_x, 1);
-                if (mx >= 0xffff)
-                    return -1;
-
-                if (s->umvplus)
-                  my = h263p_decode_umotion(s, pred_y);
-                else
-                  my = ff_h263_decode_motion(s, pred_y, 1);
-                if (my >= 0xffff)
-                    return -1;
-                s->mv[0][i][0] = mx;
-                s->mv[0][i][1] = my;
-                if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
-                  skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
-                mot_val[0] = mx;
-                mot_val[1] = my;
-            }
-        }
-    } else if(s->pict_type==AV_PICTURE_TYPE_B) {
-        int mb_type;
-        const int stride= s->b8_stride;
-        int16_t *mot_val0 = s->current_picture.motion_val[0][2 * (s->mb_x + s->mb_y * stride)];
-        int16_t *mot_val1 = s->current_picture.motion_val[1][2 * (s->mb_x + s->mb_y * stride)];
-//        const int mv_xy= s->mb_x + 1 + s->mb_y * s->mb_stride;
-
-        //FIXME ugly
-        mot_val0[0       ]= mot_val0[2       ]= mot_val0[0+2*stride]= mot_val0[2+2*stride]=
-        mot_val0[1       ]= mot_val0[3       ]= mot_val0[1+2*stride]= mot_val0[3+2*stride]=
-        mot_val1[0       ]= mot_val1[2       ]= mot_val1[0+2*stride]= mot_val1[2+2*stride]=
-        mot_val1[1       ]= mot_val1[3       ]= mot_val1[1+2*stride]= mot_val1[3+2*stride]= 0;
-
-        do{
-            mb_type= get_vlc2(&s->gb, h263_mbtype_b_vlc.table, H263_MBTYPE_B_VLC_BITS, 2);
-            if (mb_type < 0){
-                av_log(s->avctx, AV_LOG_ERROR, "b mb_type damaged at %d %d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-
-            mb_type= h263_mb_type_b_map[ mb_type ];
-        }while(!mb_type);
-
-        s->mb_intra = IS_INTRA(mb_type);
-        if(HAS_CBP(mb_type)){
-            s->dsp.clear_blocks(s->block[0]);
-            cbpc = get_vlc2(&s->gb, cbpc_b_vlc.table, CBPC_B_VLC_BITS, 1);
-            if(s->mb_intra){
-                dquant = IS_QUANT(mb_type);
-                goto intra;
-            }
-
-            cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
-
-            if (cbpy < 0){
-                av_log(s->avctx, AV_LOG_ERROR, "b cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-
-            if(s->alt_inter_vlc==0 || (cbpc & 3)!=3)
-                cbpy ^= 0xF;
-
-            cbp = (cbpc & 3) | (cbpy << 2);
-        }else
-            cbp=0;
-
-        assert(!s->mb_intra);
-
-        if(IS_QUANT(mb_type)){
-            h263_decode_dquant(s);
-        }
-
-        if(IS_DIRECT(mb_type)){
-            if (!s->pp_time)
-                return AVERROR_INVALIDDATA;
-            s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
-            mb_type |= ff_mpeg4_set_direct_mv(s, 0, 0);
-        }else{
-            s->mv_dir = 0;
-            s->mv_type= MV_TYPE_16X16;
-//FIXME UMV
-
-            if(USES_LIST(mb_type, 0)){
-                int16_t *mot_val= ff_h263_pred_motion(s, 0, 0, &mx, &my);
-                s->mv_dir = MV_DIR_FORWARD;
-
-                mx = ff_h263_decode_motion(s, mx, 1);
-                my = ff_h263_decode_motion(s, my, 1);
-
-                s->mv[0][0][0] = mx;
-                s->mv[0][0][1] = my;
-                mot_val[0       ]= mot_val[2       ]= mot_val[0+2*stride]= mot_val[2+2*stride]= mx;
-                mot_val[1       ]= mot_val[3       ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my;
-            }
-
-            if(USES_LIST(mb_type, 1)){
-                int16_t *mot_val= ff_h263_pred_motion(s, 0, 1, &mx, &my);
-                s->mv_dir |= MV_DIR_BACKWARD;
-
-                mx = ff_h263_decode_motion(s, mx, 1);
-                my = ff_h263_decode_motion(s, my, 1);
-
-                s->mv[1][0][0] = mx;
-                s->mv[1][0][1] = my;
-                mot_val[0       ]= mot_val[2       ]= mot_val[0+2*stride]= mot_val[2+2*stride]= mx;
-                mot_val[1       ]= mot_val[3       ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my;
-            }
-        }
-
-        s->current_picture.mb_type[xy] = mb_type;
-    } else { /* I-Frame */
-        do{
-            cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
-            if (cbpc < 0){
-                av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-        }while(cbpc == 8);
-
-        s->dsp.clear_blocks(s->block[0]);
-
-        dquant = cbpc & 4;
-        s->mb_intra = 1;
-intra:
-        s->current_picture.mb_type[xy] = MB_TYPE_INTRA;
-        if (s->h263_aic) {
-            s->ac_pred = get_bits1(&s->gb);
-            if(s->ac_pred){
-                s->current_picture.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED;
-
-                s->h263_aic_dir = get_bits1(&s->gb);
-            }
-        }else
-            s->ac_pred = 0;
-
-        if(s->pb_frame && get_bits1(&s->gb))
-            pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb);
-        cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
-        if(cbpy<0){
-            av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
-            return -1;
-        }
-        cbp = (cbpc & 3) | (cbpy << 2);
-        if (dquant) {
-            h263_decode_dquant(s);
-        }
-
-        pb_mv_count += !!s->pb_frame;
-    }
-
-    while(pb_mv_count--){
-        ff_h263_decode_motion(s, 0, 1);
-        ff_h263_decode_motion(s, 0, 1);
-    }
-
-    /* decode each block */
-    for (i = 0; i < 6; i++) {
-        if (h263_decode_block(s, block[i], i, cbp&32) < 0)
-            return -1;
-        cbp+=cbp;
-    }
-
-    if(s->pb_frame && h263_skip_b_part(s, cbpb) < 0)
-        return -1;
-    if(s->obmc && !s->mb_intra){
-        if(s->pict_type == AV_PICTURE_TYPE_P && s->mb_x+1<s->mb_width && s->mb_num_left != 1)
-            preview_obmc(s);
-    }
-end:
-
-        /* per-MB end of slice check */
-    {
-        int v= show_bits(&s->gb, 16);
-
-        if (get_bits_left(&s->gb) < 16) {
-            v >>= 16 - get_bits_left(&s->gb);
-        }
-
-        if(v==0)
-            return SLICE_END;
-    }
-
-    return SLICE_OK;
-}
-
-/* most is hardcoded. should extend to handle all h263 streams */
-int ff_h263_decode_picture_header(MpegEncContext *s)
-{
-    int format, width, height, i;
-    uint32_t startcode;
-
-    align_get_bits(&s->gb);
-
-    startcode= get_bits(&s->gb, 22-8);
-
-    for(i= get_bits_left(&s->gb); i>24; i-=8) {
-        startcode = ((startcode << 8) | get_bits(&s->gb, 8)) & 0x003FFFFF;
-
-        if(startcode == 0x20)
-            break;
-    }
-
-    if (startcode != 0x20) {
-        av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
-        return -1;
-    }
-    /* temporal reference */
-    i = get_bits(&s->gb, 8); /* picture timestamp */
-    if( (s->picture_number&~0xFF)+i < s->picture_number)
-        i+= 256;
-    s->picture_number= (s->picture_number&~0xFF) + i;
-
-    /* PTYPE starts here */
-    if (get_bits1(&s->gb) != 1) {
-        /* marker */
-        av_log(s->avctx, AV_LOG_ERROR, "Bad marker\n");
-        return -1;
-    }
-    if (get_bits1(&s->gb) != 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n");
-        return -1;      /* h263 id */
-    }
-    skip_bits1(&s->gb);         /* split screen off */
-    skip_bits1(&s->gb);         /* camera  off */
-    skip_bits1(&s->gb);         /* freeze picture release off */
-
-    format = get_bits(&s->gb, 3);
-    /*
-        0    forbidden
-        1    sub-QCIF
-        10   QCIF
-        7       extended PTYPE (PLUSPTYPE)
-    */
-
-    if (format != 7 && format != 6) {
-        s->h263_plus = 0;
-        /* H.263v1 */
-        width = ff_h263_format[format][0];
-        height = ff_h263_format[format][1];
-        if (!width)
-            return -1;
-
-        s->pict_type = AV_PICTURE_TYPE_I + get_bits1(&s->gb);
-
-        s->h263_long_vectors = get_bits1(&s->gb);
-
-        if (get_bits1(&s->gb) != 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "H263 SAC not supported\n");
-            return -1; /* SAC: off */
-        }
-        s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */
-        s->unrestricted_mv = s->h263_long_vectors || s->obmc;
-
-        s->pb_frame = get_bits1(&s->gb);
-        s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
-        skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */
-
-        s->width = width;
-        s->height = height;
-        s->avctx->sample_aspect_ratio= (AVRational){12,11};
-        s->avctx->time_base= (AVRational){1001, 30000};
-    } else {
-        int ufep;
-
-        /* H.263v2 */
-        s->h263_plus = 1;
-        ufep = get_bits(&s->gb, 3); /* Update Full Extended PTYPE */
-
-        /* ufep other than 0 and 1 are reserved */
-        if (ufep == 1) {
-            /* OPPTYPE */
-            format = get_bits(&s->gb, 3);
-            av_dlog(s->avctx, "ufep=1, format: %d\n", format);
-            s->custom_pcf= get_bits1(&s->gb);
-            s->umvplus = get_bits1(&s->gb); /* Unrestricted Motion Vector */
-            if (get_bits1(&s->gb) != 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "Syntax-based Arithmetic Coding (SAC) not supported\n");
-            }
-            s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */
-            s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */
-            s->loop_filter= get_bits1(&s->gb);
-            s->unrestricted_mv = s->umvplus || s->obmc || s->loop_filter;
-
-            s->h263_slice_structured= get_bits1(&s->gb);
-            if (get_bits1(&s->gb) != 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "Reference Picture Selection not supported\n");
-            }
-            if (get_bits1(&s->gb) != 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "Independent Segment Decoding not supported\n");
-            }
-            s->alt_inter_vlc= get_bits1(&s->gb);
-            s->modified_quant= get_bits1(&s->gb);
-            if(s->modified_quant)
-                s->chroma_qscale_table= ff_h263_chroma_qscale_table;
-
-            skip_bits(&s->gb, 1); /* Prevent start code emulation */
-
-            skip_bits(&s->gb, 3); /* Reserved */
-        } else if (ufep != 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "Bad UFEP type (%d)\n", ufep);
-            return -1;
-        }
-
-        /* MPPTYPE */
-        s->pict_type = get_bits(&s->gb, 3);
-        switch(s->pict_type){
-        case 0: s->pict_type= AV_PICTURE_TYPE_I;break;
-        case 1: s->pict_type= AV_PICTURE_TYPE_P;break;
-        case 2: s->pict_type= AV_PICTURE_TYPE_P;s->pb_frame = 3;break;
-        case 3: s->pict_type= AV_PICTURE_TYPE_B;break;
-        case 7: s->pict_type= AV_PICTURE_TYPE_I;break; //ZYGO
-        default:
-            return -1;
-        }
-        skip_bits(&s->gb, 2);
-        s->no_rounding = get_bits1(&s->gb);
-        skip_bits(&s->gb, 4);
-
-        /* Get the picture dimensions */
-        if (ufep) {
-            if (format == 6) {
-                /* Custom Picture Format (CPFMT) */
-                s->aspect_ratio_info = get_bits(&s->gb, 4);
-                av_dlog(s->avctx, "aspect: %d\n", s->aspect_ratio_info);
-                /* aspect ratios:
-                0 - forbidden
-                1 - 1:1
-                2 - 12:11 (CIF 4:3)
-                3 - 10:11 (525-type 4:3)
-                4 - 16:11 (CIF 16:9)
-                5 - 40:33 (525-type 16:9)
-                6-14 - reserved
-                */
-                width = (get_bits(&s->gb, 9) + 1) * 4;
-                skip_bits1(&s->gb);
-                height = get_bits(&s->gb, 9) * 4;
-                av_dlog(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height);
-                if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
-                    /* aspected dimensions */
-                    s->avctx->sample_aspect_ratio.num= get_bits(&s->gb, 8);
-                    s->avctx->sample_aspect_ratio.den= get_bits(&s->gb, 8);
-                }else{
-                    s->avctx->sample_aspect_ratio= ff_h263_pixel_aspect[s->aspect_ratio_info];
-                }
-            } else {
-                width = ff_h263_format[format][0];
-                height = ff_h263_format[format][1];
-                s->avctx->sample_aspect_ratio= (AVRational){12,11};
-            }
-            if ((width == 0) || (height == 0))
-                return -1;
-            s->width = width;
-            s->height = height;
-
-            if(s->custom_pcf){
-                int gcd;
-                s->avctx->time_base.den= 1800000;
-                s->avctx->time_base.num= 1000 + get_bits1(&s->gb);
-                s->avctx->time_base.num*= get_bits(&s->gb, 7);
-                if(s->avctx->time_base.num == 0){
-                    av_log(s, AV_LOG_ERROR, "zero framerate\n");
-                    return -1;
-                }
-                gcd= av_gcd(s->avctx->time_base.den, s->avctx->time_base.num);
-                s->avctx->time_base.den /= gcd;
-                s->avctx->time_base.num /= gcd;
-            }else{
-                s->avctx->time_base= (AVRational){1001, 30000};
-            }
-        }
-
-        if(s->custom_pcf){
-            skip_bits(&s->gb, 2); //extended Temporal reference
-        }
-
-        if (ufep) {
-            if (s->umvplus) {
-                if(get_bits1(&s->gb)==0) /* Unlimited Unrestricted Motion Vectors Indicator (UUI) */
-                    skip_bits1(&s->gb);
-            }
-            if(s->h263_slice_structured){
-                if (get_bits1(&s->gb) != 0) {
-                    av_log(s->avctx, AV_LOG_ERROR, "rectangular slices not supported\n");
-                }
-                if (get_bits1(&s->gb) != 0) {
-                    av_log(s->avctx, AV_LOG_ERROR, "unordered slices not supported\n");
-                }
-            }
-        }
-
-        s->qscale = get_bits(&s->gb, 5);
-    }
-
-    s->mb_width = (s->width  + 15) / 16;
-    s->mb_height = (s->height  + 15) / 16;
-    s->mb_num = s->mb_width * s->mb_height;
-
-    if (s->pb_frame) {
-        skip_bits(&s->gb, 3); /* Temporal reference for B-pictures */
-        if (s->custom_pcf)
-            skip_bits(&s->gb, 2); //extended Temporal reference
-        skip_bits(&s->gb, 2); /* Quantization information for B-pictures */
-    }
-
-    if (s->pict_type!=AV_PICTURE_TYPE_B) {
-        s->time            = s->picture_number;
-        s->pp_time         = s->time - s->last_non_b_time;
-        s->last_non_b_time = s->time;
-    }else{
-        s->time    = s->picture_number;
-        s->pb_time = s->pp_time - (s->last_non_b_time - s->time);
-        if (s->pp_time <=s->pb_time ||
-            s->pp_time <= s->pp_time - s->pb_time ||
-            s->pp_time <= 0){
-            s->pp_time = 2;
-            s->pb_time = 1;
-        }
-        ff_mpeg4_init_direct_mv(s);
-    }
-
-    /* PEI */
-    while (get_bits1(&s->gb) != 0) {
-        skip_bits(&s->gb, 8);
-    }
-
-    if(s->h263_slice_structured){
-        if (get_bits1(&s->gb) != 1) {
-            av_log(s->avctx, AV_LOG_ERROR, "SEPB1 marker missing\n");
-            return -1;
-        }
-
-        ff_h263_decode_mba(s);
-
-        if (get_bits1(&s->gb) != 1) {
-            av_log(s->avctx, AV_LOG_ERROR, "SEPB2 marker missing\n");
-            return -1;
-        }
-    }
-    s->f_code = 1;
-
-    if(s->h263_aic){
-         s->y_dc_scale_table=
-         s->c_dc_scale_table= ff_aic_dc_scale_table;
-    }else{
-        s->y_dc_scale_table=
-        s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-    }
-
-        ff_h263_show_pict_info(s);
-    if (s->pict_type == AV_PICTURE_TYPE_I && s->codec_tag == AV_RL32("ZYGO")){
-        int i,j;
-        for(i=0; i<85; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
-        av_log(s->avctx, AV_LOG_DEBUG, "\n");
-        for(i=0; i<13; i++){
-            for(j=0; j<3; j++){
-                int v= get_bits(&s->gb, 8);
-                v |= get_sbits(&s->gb, 8)<<8;
-                av_log(s->avctx, AV_LOG_DEBUG, " %5d", v);
-            }
-            av_log(s->avctx, AV_LOG_DEBUG, "\n");
-        }
-        for(i=0; i<50; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/ituh263enc.c b/deps/libav/libavcodec/ituh263enc.c
deleted file mode 100644
index 0f59944..0000000
--- a/deps/libav/libavcodec/ituh263enc.c
+++ /dev/null
@@ -1,839 +0,0 @@
-/*
- * ITU H263 bitstream encoder
- * Copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support.
- * Copyright (c) 2001 Juan J. Sierralta P
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * h263 bitstream encoder.
- */
-
-#include <limits.h>
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h263.h"
-#include "mathops.h"
-#include "unary.h"
-#include "flv.h"
-#include "mpeg4video.h"
-#include "internal.h"
-
-/**
- * Table of number of bits a motion vector component needs.
- */
-static uint8_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
-
-/**
- * Minimal fcode that a motion vector component would need.
- */
-static uint8_t fcode_tab[MAX_MV*2+1];
-
-/**
- * Minimal fcode that a motion vector component would need in umv.
- * All entries in this table are 1.
- */
-static uint8_t umv_fcode_tab[MAX_MV*2+1];
-
-//unified encoding tables for run length encoding of coefficients
-//unified in the sense that the specification specifies the encoding in several steps.
-static uint8_t  uni_h263_intra_aic_rl_len [64*64*2*2];
-static uint8_t  uni_h263_inter_rl_len [64*64*2*2];
-//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128 + (run)*256 + (level))
-//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run) + (level)*64)
-#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run)*128 + (level))
-
-static const uint8_t wrong_run[102] = {
- 1,  2,  3,  5,  4, 10,  9,  8,
-11, 15, 17, 16, 23, 22, 21, 20,
-19, 18, 25, 24, 27, 26, 11,  7,
- 6,  1,  2, 13,  2,  2,  2,  2,
- 6, 12,  3,  9,  1,  3,  4,  3,
- 7,  4,  1,  1,  5,  5, 14,  6,
- 1,  7,  1,  8,  1,  1,  1,  1,
-10,  1,  1,  5,  9, 17, 25, 24,
-29, 33, 32, 41,  2, 23, 28, 31,
- 3, 22, 30,  4, 27, 40,  8, 26,
- 6, 39,  7, 38, 16, 37, 15, 10,
-11, 12, 13, 14,  1, 21, 20, 18,
-19,  2,  1, 34, 35, 36
-};
-
-/**
- * Return the 4 bit value that specifies the given aspect ratio.
- * This may be one of the standard aspect ratios or it specifies
- * that the aspect will be stored explicitly later.
- */
-av_const int ff_h263_aspect_to_info(AVRational aspect){
-    int i;
-
-    if(aspect.num==0) aspect= (AVRational){1,1};
-
-    for(i=1; i<6; i++){
-        if(av_cmp_q(ff_h263_pixel_aspect[i], aspect) == 0){
-            return i;
-        }
-    }
-
-    return FF_ASPECT_EXTENDED;
-}
-
-void ff_h263_encode_picture_header(MpegEncContext * s, int picture_number)
-{
-    int format, coded_frame_rate, coded_frame_rate_base, i, temp_ref;
-    int best_clock_code=1;
-    int best_divisor=60;
-    int best_error= INT_MAX;
-
-    if(s->h263_plus){
-        for(i=0; i<2; i++){
-            int div, error;
-            div= (s->avctx->time_base.num*1800000LL + 500LL*s->avctx->time_base.den) / ((1000LL+i)*s->avctx->time_base.den);
-            div= av_clip(div, 1, 127);
-            error= FFABS(s->avctx->time_base.num*1800000LL - (1000LL+i)*s->avctx->time_base.den*div);
-            if(error < best_error){
-                best_error= error;
-                best_divisor= div;
-                best_clock_code= i;
-            }
-        }
-    }
-    s->custom_pcf= best_clock_code!=1 || best_divisor!=60;
-    coded_frame_rate= 1800000;
-    coded_frame_rate_base= (1000+best_clock_code)*best_divisor;
-
-    avpriv_align_put_bits(&s->pb);
-
-    /* Update the pointer to last GOB */
-    s->ptr_lastgob = put_bits_ptr(&s->pb);
-    put_bits(&s->pb, 22, 0x20); /* PSC */
-    temp_ref= s->picture_number * (int64_t)coded_frame_rate * s->avctx->time_base.num / //FIXME use timestamp
-                         (coded_frame_rate_base * (int64_t)s->avctx->time_base.den);
-    put_sbits(&s->pb, 8, temp_ref); /* TemporalReference */
-
-    put_bits(&s->pb, 1, 1);     /* marker */
-    put_bits(&s->pb, 1, 0);     /* h263 id */
-    put_bits(&s->pb, 1, 0);     /* split screen off */
-    put_bits(&s->pb, 1, 0);     /* camera  off */
-    put_bits(&s->pb, 1, 0);     /* freeze picture release off */
-
-    format = ff_match_2uint16(ff_h263_format, FF_ARRAY_ELEMS(ff_h263_format), s->width, s->height);
-    if (!s->h263_plus) {
-        /* H.263v1 */
-        put_bits(&s->pb, 3, format);
-        put_bits(&s->pb, 1, (s->pict_type == AV_PICTURE_TYPE_P));
-        /* By now UMV IS DISABLED ON H.263v1, since the restrictions
-        of H.263v1 UMV implies to check the predicted MV after
-        calculation of the current MB to see if we're on the limits */
-        put_bits(&s->pb, 1, 0);         /* Unrestricted Motion Vector: off */
-        put_bits(&s->pb, 1, 0);         /* SAC: off */
-        put_bits(&s->pb, 1, s->obmc);   /* Advanced Prediction */
-        put_bits(&s->pb, 1, 0);         /* only I/P frames, no PB frame */
-        put_bits(&s->pb, 5, s->qscale);
-        put_bits(&s->pb, 1, 0);         /* Continuous Presence Multipoint mode: off */
-    } else {
-        int ufep=1;
-        /* H.263v2 */
-        /* H.263 Plus PTYPE */
-
-        put_bits(&s->pb, 3, 7);
-        put_bits(&s->pb,3,ufep); /* Update Full Extended PTYPE */
-        if (format == 8)
-            put_bits(&s->pb,3,6); /* Custom Source Format */
-        else
-            put_bits(&s->pb, 3, format);
-
-        put_bits(&s->pb,1, s->custom_pcf);
-        put_bits(&s->pb,1, s->umvplus); /* Unrestricted Motion Vector */
-        put_bits(&s->pb,1,0); /* SAC: off */
-        put_bits(&s->pb,1,s->obmc); /* Advanced Prediction Mode */
-        put_bits(&s->pb,1,s->h263_aic); /* Advanced Intra Coding */
-        put_bits(&s->pb,1,s->loop_filter); /* Deblocking Filter */
-        put_bits(&s->pb,1,s->h263_slice_structured); /* Slice Structured */
-        put_bits(&s->pb,1,0); /* Reference Picture Selection: off */
-        put_bits(&s->pb,1,0); /* Independent Segment Decoding: off */
-        put_bits(&s->pb,1,s->alt_inter_vlc); /* Alternative Inter VLC */
-        put_bits(&s->pb,1,s->modified_quant); /* Modified Quantization: */
-        put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */
-        put_bits(&s->pb,3,0); /* Reserved */
-
-        put_bits(&s->pb, 3, s->pict_type == AV_PICTURE_TYPE_P);
-
-        put_bits(&s->pb,1,0); /* Reference Picture Resampling: off */
-        put_bits(&s->pb,1,0); /* Reduced-Resolution Update: off */
-        put_bits(&s->pb,1,s->no_rounding); /* Rounding Type */
-        put_bits(&s->pb,2,0); /* Reserved */
-        put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */
-
-        /* This should be here if PLUSPTYPE */
-        put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */
-
-        if (format == 8) {
-            /* Custom Picture Format (CPFMT) */
-            s->aspect_ratio_info= ff_h263_aspect_to_info(s->avctx->sample_aspect_ratio);
-
-            put_bits(&s->pb,4,s->aspect_ratio_info);
-            put_bits(&s->pb,9,(s->width >> 2) - 1);
-            put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */
-            put_bits(&s->pb,9,(s->height >> 2));
-            if (s->aspect_ratio_info == FF_ASPECT_EXTENDED){
-                put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num);
-                put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den);
-            }
-        }
-        if(s->custom_pcf){
-            if(ufep){
-                put_bits(&s->pb, 1, best_clock_code);
-                put_bits(&s->pb, 7, best_divisor);
-            }
-            put_sbits(&s->pb, 2, temp_ref>>8);
-        }
-
-        /* Unlimited Unrestricted Motion Vectors Indicator (UUI) */
-        if (s->umvplus)
-//            put_bits(&s->pb,1,1); /* Limited according tables of Annex D */
-//FIXME check actual requested range
-            put_bits(&s->pb,2,1); /* unlimited */
-        if(s->h263_slice_structured)
-            put_bits(&s->pb,2,0); /* no weird submodes */
-
-        put_bits(&s->pb, 5, s->qscale);
-    }
-
-    put_bits(&s->pb, 1, 0);     /* no PEI */
-
-    if(s->h263_slice_structured){
-        put_bits(&s->pb, 1, 1);
-
-        assert(s->mb_x == 0 && s->mb_y == 0);
-        ff_h263_encode_mba(s);
-
-        put_bits(&s->pb, 1, 1);
-    }
-
-    if(s->h263_aic){
-         s->y_dc_scale_table=
-         s->c_dc_scale_table= ff_aic_dc_scale_table;
-    }else{
-        s->y_dc_scale_table=
-        s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-    }
-}
-
-/**
- * Encode a group of blocks header.
- */
-void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line)
-{
-    put_bits(&s->pb, 17, 1); /* GBSC */
-
-    if(s->h263_slice_structured){
-        put_bits(&s->pb, 1, 1);
-
-        ff_h263_encode_mba(s);
-
-        if(s->mb_num > 1583)
-            put_bits(&s->pb, 1, 1);
-        put_bits(&s->pb, 5, s->qscale); /* GQUANT */
-        put_bits(&s->pb, 1, 1);
-        put_bits(&s->pb, 2, s->pict_type == AV_PICTURE_TYPE_I); /* GFID */
-    }else{
-        int gob_number= mb_line / s->gob_index;
-
-        put_bits(&s->pb, 5, gob_number); /* GN */
-        put_bits(&s->pb, 2, s->pict_type == AV_PICTURE_TYPE_I); /* GFID */
-        put_bits(&s->pb, 5, s->qscale); /* GQUANT */
-    }
-}
-
-/**
- * modify qscale so that encoding is acually possible in h263 (limit difference to -2..2)
- */
-void ff_clean_h263_qscales(MpegEncContext *s){
-    int i;
-    int8_t * const qscale_table = s->current_picture.qscale_table;
-
-    ff_init_qscale_tab(s);
-
-    for(i=1; i<s->mb_num; i++){
-        if(qscale_table[ s->mb_index2xy[i] ] - qscale_table[ s->mb_index2xy[i-1] ] >2)
-            qscale_table[ s->mb_index2xy[i] ]= qscale_table[ s->mb_index2xy[i-1] ]+2;
-    }
-    for(i=s->mb_num-2; i>=0; i--){
-        if(qscale_table[ s->mb_index2xy[i] ] - qscale_table[ s->mb_index2xy[i+1] ] >2)
-            qscale_table[ s->mb_index2xy[i] ]= qscale_table[ s->mb_index2xy[i+1] ]+2;
-    }
-
-    if(s->codec_id != AV_CODEC_ID_H263P){
-        for(i=1; i<s->mb_num; i++){
-            int mb_xy= s->mb_index2xy[i];
-
-            if(qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i-1]] && (s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_INTER4V)){
-                s->mb_type[mb_xy]|= CANDIDATE_MB_TYPE_INTER;
-            }
-        }
-    }
-}
-
-static const int dquant_code[5]= {1,0,9,2,3};
-
-/**
- * Encode an 8x8 block.
- * @param block the 8x8 block
- * @param n block index (0-3 are luma, 4-5 are chroma)
- */
-static void h263_encode_block(MpegEncContext * s, int16_t * block, int n)
-{
-    int level, run, last, i, j, last_index, last_non_zero, sign, slevel, code;
-    RLTable *rl;
-
-    rl = &ff_h263_rl_inter;
-    if (s->mb_intra && !s->h263_aic) {
-        /* DC coef */
-        level = block[0];
-        /* 255 cannot be represented, so we clamp */
-        if (level > 254) {
-            level = 254;
-            block[0] = 254;
-        }
-        /* 0 cannot be represented also */
-        else if (level < 1) {
-            level = 1;
-            block[0] = 1;
-        }
-        if (level == 128) //FIXME check rv10
-            put_bits(&s->pb, 8, 0xff);
-        else
-            put_bits(&s->pb, 8, level);
-        i = 1;
-    } else {
-        i = 0;
-        if (s->h263_aic && s->mb_intra)
-            rl = &ff_rl_intra_aic;
-
-        if(s->alt_inter_vlc && !s->mb_intra){
-            int aic_vlc_bits=0;
-            int inter_vlc_bits=0;
-            int wrong_pos=-1;
-            int aic_code;
-
-            last_index = s->block_last_index[n];
-            last_non_zero = i - 1;
-            for (; i <= last_index; i++) {
-                j = s->intra_scantable.permutated[i];
-                level = block[j];
-                if (level) {
-                    run = i - last_non_zero - 1;
-                    last = (i == last_index);
-
-                    if(level<0) level= -level;
-
-                    code = get_rl_index(rl, last, run, level);
-                    aic_code = get_rl_index(&ff_rl_intra_aic, last, run, level);
-                    inter_vlc_bits += rl->table_vlc[code][1]+1;
-                    aic_vlc_bits   += ff_rl_intra_aic.table_vlc[aic_code][1]+1;
-
-                    if (code == rl->n) {
-                        inter_vlc_bits += 1+6+8-1;
-                    }
-                    if (aic_code == ff_rl_intra_aic.n) {
-                        aic_vlc_bits += 1+6+8-1;
-                        wrong_pos += run + 1;
-                    }else
-                        wrong_pos += wrong_run[aic_code];
-                    last_non_zero = i;
-                }
-            }
-            i = 0;
-            if(aic_vlc_bits < inter_vlc_bits && wrong_pos > 63)
-                rl = &ff_rl_intra_aic;
-        }
-    }
-
-    /* AC coefs */
-    last_index = s->block_last_index[n];
-    last_non_zero = i - 1;
-    for (; i <= last_index; i++) {
-        j = s->intra_scantable.permutated[i];
-        level = block[j];
-        if (level) {
-            run = i - last_non_zero - 1;
-            last = (i == last_index);
-            sign = 0;
-            slevel = level;
-            if (level < 0) {
-                sign = 1;
-                level = -level;
-            }
-            code = get_rl_index(rl, last, run, level);
-            put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
-            if (code == rl->n) {
-              if(!CONFIG_FLV_ENCODER || s->h263_flv <= 1){
-                put_bits(&s->pb, 1, last);
-                put_bits(&s->pb, 6, run);
-
-                assert(slevel != 0);
-
-                if(level < 128)
-                    put_sbits(&s->pb, 8, slevel);
-                else{
-                    put_bits(&s->pb, 8, 128);
-                    put_sbits(&s->pb, 5, slevel);
-                    put_sbits(&s->pb, 6, slevel>>5);
-                }
-              }else{
-                    ff_flv2_encode_ac_esc(&s->pb, slevel, level, run, last);
-              }
-            } else {
-                put_bits(&s->pb, 1, sign);
-            }
-            last_non_zero = i;
-        }
-    }
-}
-
-/* Encode MV differences on H.263+ with Unrestricted MV mode */
-static void h263p_encode_umotion(MpegEncContext * s, int val)
-{
-    short sval = 0;
-    short i = 0;
-    short n_bits = 0;
-    short temp_val;
-    int code = 0;
-    int tcode;
-
-    if ( val == 0)
-        put_bits(&s->pb, 1, 1);
-    else if (val == 1)
-        put_bits(&s->pb, 3, 0);
-    else if (val == -1)
-        put_bits(&s->pb, 3, 2);
-    else {
-
-        sval = ((val < 0) ? (short)(-val):(short)val);
-        temp_val = sval;
-
-        while (temp_val != 0) {
-            temp_val = temp_val >> 1;
-            n_bits++;
-        }
-
-        i = n_bits - 1;
-        while (i > 0) {
-            tcode = (sval & (1 << (i-1))) >> (i-1);
-            tcode = (tcode << 1) | 1;
-            code = (code << 2) | tcode;
-            i--;
-        }
-        code = ((code << 1) | (val < 0)) << 1;
-        put_bits(&s->pb, (2*n_bits)+1, code);
-    }
-}
-
-void ff_h263_encode_mb(MpegEncContext * s,
-                       int16_t block[6][64],
-                       int motion_x, int motion_y)
-{
-    int cbpc, cbpy, i, cbp, pred_x, pred_y;
-    int16_t pred_dc;
-    int16_t rec_intradc[6];
-    int16_t *dc_ptr[6];
-    const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1);
-
-    if (!s->mb_intra) {
-        /* compute cbp */
-        cbp= get_p_cbp(s, block, motion_x, motion_y);
-
-        if ((cbp | motion_x | motion_y | s->dquant | (s->mv_type - MV_TYPE_16X16)) == 0) {
-            /* skip macroblock */
-            put_bits(&s->pb, 1, 1);
-            if(interleaved_stats){
-                s->misc_bits++;
-                s->last_bits++;
-            }
-            s->skip_count++;
-
-            return;
-        }
-        put_bits(&s->pb, 1, 0);         /* mb coded */
-
-        cbpc = cbp & 3;
-        cbpy = cbp >> 2;
-        if(s->alt_inter_vlc==0 || cbpc!=3)
-            cbpy ^= 0xF;
-        if(s->dquant) cbpc+= 8;
-        if(s->mv_type==MV_TYPE_16X16){
-            put_bits(&s->pb,
-                    ff_h263_inter_MCBPC_bits[cbpc],
-                    ff_h263_inter_MCBPC_code[cbpc]);
-
-            put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
-            if(s->dquant)
-                put_bits(&s->pb, 2, dquant_code[s->dquant+2]);
-
-            if(interleaved_stats){
-                s->misc_bits+= get_bits_diff(s);
-            }
-
-            /* motion vectors: 16x16 mode */
-            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-
-            if (!s->umvplus) {
-                ff_h263_encode_motion_vector(s, motion_x - pred_x,
-                                                motion_y - pred_y, 1);
-            }
-            else {
-                h263p_encode_umotion(s, motion_x - pred_x);
-                h263p_encode_umotion(s, motion_y - pred_y);
-                if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))
-                    /* To prevent Start Code emulation */
-                    put_bits(&s->pb,1,1);
-            }
-        }else{
-            put_bits(&s->pb,
-                    ff_h263_inter_MCBPC_bits[cbpc+16],
-                    ff_h263_inter_MCBPC_code[cbpc+16]);
-            put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
-            if(s->dquant)
-                put_bits(&s->pb, 2, dquant_code[s->dquant+2]);
-
-            if(interleaved_stats){
-                s->misc_bits+= get_bits_diff(s);
-            }
-
-            for(i=0; i<4; i++){
-                /* motion vectors: 8x8 mode*/
-                ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
-
-                motion_x = s->current_picture.motion_val[0][s->block_index[i]][0];
-                motion_y = s->current_picture.motion_val[0][s->block_index[i]][1];
-                if (!s->umvplus) {
-                    ff_h263_encode_motion_vector(s, motion_x - pred_x,
-                                                    motion_y - pred_y, 1);
-                }
-                else {
-                    h263p_encode_umotion(s, motion_x - pred_x);
-                    h263p_encode_umotion(s, motion_y - pred_y);
-                    if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))
-                        /* To prevent Start Code emulation */
-                        put_bits(&s->pb,1,1);
-                }
-            }
-        }
-
-        if(interleaved_stats){
-            s->mv_bits+= get_bits_diff(s);
-        }
-    } else {
-        assert(s->mb_intra);
-
-        cbp = 0;
-        if (s->h263_aic) {
-            /* Predict DC */
-            for(i=0; i<6; i++) {
-                int16_t level = block[i][0];
-                int scale;
-
-                if(i<4) scale= s->y_dc_scale;
-                else    scale= s->c_dc_scale;
-
-                pred_dc = ff_h263_pred_dc(s, i, &dc_ptr[i]);
-                level -= pred_dc;
-                /* Quant */
-                if (level >= 0)
-                    level = (level + (scale>>1))/scale;
-                else
-                    level = (level - (scale>>1))/scale;
-
-                /* AIC can change CBP */
-                if (level == 0 && s->block_last_index[i] == 0)
-                    s->block_last_index[i] = -1;
-
-                if(!s->modified_quant){
-                    if (level < -127)
-                        level = -127;
-                    else if (level > 127)
-                        level = 127;
-                }
-
-                block[i][0] = level;
-                /* Reconstruction */
-                rec_intradc[i] = scale*level + pred_dc;
-                /* Oddify */
-                rec_intradc[i] |= 1;
-                //if ((rec_intradc[i] % 2) == 0)
-                //    rec_intradc[i]++;
-                /* Clipping */
-                if (rec_intradc[i] < 0)
-                    rec_intradc[i] = 0;
-                else if (rec_intradc[i] > 2047)
-                    rec_intradc[i] = 2047;
-
-                /* Update AC/DC tables */
-                *dc_ptr[i] = rec_intradc[i];
-                if (s->block_last_index[i] >= 0)
-                    cbp |= 1 << (5 - i);
-            }
-        }else{
-            for(i=0; i<6; i++) {
-                /* compute cbp */
-                if (s->block_last_index[i] >= 1)
-                    cbp |= 1 << (5 - i);
-            }
-        }
-
-        cbpc = cbp & 3;
-        if (s->pict_type == AV_PICTURE_TYPE_I) {
-            if(s->dquant) cbpc+=4;
-            put_bits(&s->pb,
-                ff_h263_intra_MCBPC_bits[cbpc],
-                ff_h263_intra_MCBPC_code[cbpc]);
-        } else {
-            if(s->dquant) cbpc+=8;
-            put_bits(&s->pb, 1, 0);     /* mb coded */
-            put_bits(&s->pb,
-                ff_h263_inter_MCBPC_bits[cbpc + 4],
-                ff_h263_inter_MCBPC_code[cbpc + 4]);
-        }
-        if (s->h263_aic) {
-            /* XXX: currently, we do not try to use ac prediction */
-            put_bits(&s->pb, 1, 0);     /* no AC prediction */
-        }
-        cbpy = cbp >> 2;
-        put_bits(&s->pb, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
-        if(s->dquant)
-            put_bits(&s->pb, 2, dquant_code[s->dquant+2]);
-
-        if(interleaved_stats){
-            s->misc_bits+= get_bits_diff(s);
-        }
-    }
-
-    for(i=0; i<6; i++) {
-        /* encode each block */
-        h263_encode_block(s, block[i], i);
-
-        /* Update INTRADC for decoding */
-        if (s->h263_aic && s->mb_intra) {
-            block[i][0] = rec_intradc[i];
-
-        }
-    }
-
-    if(interleaved_stats){
-        if (!s->mb_intra) {
-            s->p_tex_bits+= get_bits_diff(s);
-            s->f_count++;
-        }else{
-            s->i_tex_bits+= get_bits_diff(s);
-            s->i_count++;
-        }
-    }
-}
-
-void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code)
-{
-    int range, bit_size, sign, code, bits;
-
-    if (val == 0) {
-        /* zero vector */
-        code = 0;
-        put_bits(&s->pb, ff_mvtab[code][1], ff_mvtab[code][0]);
-    } else {
-        bit_size = f_code - 1;
-        range = 1 << bit_size;
-        /* modulo encoding */
-        val = sign_extend(val, 6 + bit_size);
-        sign = val>>31;
-        val= (val^sign)-sign;
-        sign&=1;
-
-        val--;
-        code = (val >> bit_size) + 1;
-        bits = val & (range - 1);
-
-        put_bits(&s->pb, ff_mvtab[code][1] + 1, (ff_mvtab[code][0] << 1) | sign);
-        if (bit_size > 0) {
-            put_bits(&s->pb, bit_size, bits);
-        }
-    }
-}
-
-static av_cold void init_mv_penalty_and_fcode(MpegEncContext *s)
-{
-    int f_code;
-    int mv;
-
-    for(f_code=1; f_code<=MAX_FCODE; f_code++){
-        for(mv=-MAX_MV; mv<=MAX_MV; mv++){
-            int len;
-
-            if(mv==0) len= ff_mvtab[0][1];
-            else{
-                int val, bit_size, code;
-
-                bit_size = f_code - 1;
-
-                val=mv;
-                if (val < 0)
-                    val = -val;
-                val--;
-                code = (val >> bit_size) + 1;
-                if(code<33){
-                    len= ff_mvtab[code][1] + 1 + bit_size;
-                }else{
-                    len= ff_mvtab[32][1] + av_log2(code>>5) + 2 + bit_size;
-                }
-            }
-
-            mv_penalty[f_code][mv+MAX_MV]= len;
-        }
-    }
-
-    for(f_code=MAX_FCODE; f_code>0; f_code--){
-        for(mv=-(16<<f_code); mv<(16<<f_code); mv++){
-            fcode_tab[mv+MAX_MV]= f_code;
-        }
-    }
-
-    for(mv=0; mv<MAX_MV*2+1; mv++){
-        umv_fcode_tab[mv]= 1;
-    }
-}
-
-static av_cold void init_uni_h263_rl_tab(RLTable *rl, uint32_t *bits_tab,
-                                         uint8_t *len_tab)
-{
-    int slevel, run, last;
-
-    assert(MAX_LEVEL >= 64);
-    assert(MAX_RUN   >= 63);
-
-    for(slevel=-64; slevel<64; slevel++){
-        if(slevel==0) continue;
-        for(run=0; run<64; run++){
-            for(last=0; last<=1; last++){
-                const int index= UNI_MPEG4_ENC_INDEX(last, run, slevel+64);
-                int level= slevel < 0 ? -slevel : slevel;
-                int sign= slevel < 0 ? 1 : 0;
-                int bits, len, code;
-
-                len_tab[index]= 100;
-
-                /* ESC0 */
-                code= get_rl_index(rl, last, run, level);
-                bits= rl->table_vlc[code][0];
-                len=  rl->table_vlc[code][1];
-                bits=bits*2+sign; len++;
-
-                if(code!=rl->n && len < len_tab[index]){
-                    if(bits_tab) bits_tab[index]= bits;
-                    len_tab [index]= len;
-                }
-                /* ESC */
-                bits= rl->table_vlc[rl->n][0];
-                len = rl->table_vlc[rl->n][1];
-                bits=bits*2+last; len++;
-                bits=bits*64+run; len+=6;
-                bits=bits*256+(level&0xff); len+=8;
-
-                if(len < len_tab[index]){
-                    if(bits_tab) bits_tab[index]= bits;
-                    len_tab [index]= len;
-                }
-            }
-        }
-    }
-}
-
-av_cold void ff_h263_encode_init(MpegEncContext *s)
-{
-    static int done = 0;
-
-    if (!done) {
-        done = 1;
-
-        ff_init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]);
-        ff_init_rl(&ff_rl_intra_aic, ff_h263_static_rl_table_store[1]);
-
-        init_uni_h263_rl_tab(&ff_rl_intra_aic, NULL, uni_h263_intra_aic_rl_len);
-        init_uni_h263_rl_tab(&ff_h263_rl_inter    , NULL, uni_h263_inter_rl_len);
-
-        init_mv_penalty_and_fcode(s);
-    }
-    s->me.mv_penalty= mv_penalty; //FIXME exact table for msmpeg4 & h263p
-
-    s->intra_ac_vlc_length     =s->inter_ac_vlc_length     = uni_h263_inter_rl_len;
-    s->intra_ac_vlc_last_length=s->inter_ac_vlc_last_length= uni_h263_inter_rl_len + 128*64;
-    if(s->h263_aic){
-        s->intra_ac_vlc_length     = uni_h263_intra_aic_rl_len;
-        s->intra_ac_vlc_last_length= uni_h263_intra_aic_rl_len + 128*64;
-    }
-    s->ac_esc_length= 7+1+6+8;
-
-    // use fcodes >1 only for mpeg4 & h263 & h263p FIXME
-    switch(s->codec_id){
-    case AV_CODEC_ID_MPEG4:
-        s->fcode_tab= fcode_tab;
-        break;
-    case AV_CODEC_ID_H263P:
-        if(s->umvplus)
-            s->fcode_tab= umv_fcode_tab;
-        if(s->modified_quant){
-            s->min_qcoeff= -2047;
-            s->max_qcoeff=  2047;
-        }else{
-            s->min_qcoeff= -127;
-            s->max_qcoeff=  127;
-        }
-        break;
-        //Note for mpeg4 & h263 the dc-scale table will be set per frame as needed later
-    case AV_CODEC_ID_FLV1:
-        if (s->h263_flv > 1) {
-            s->min_qcoeff= -1023;
-            s->max_qcoeff=  1023;
-        } else {
-            s->min_qcoeff= -127;
-            s->max_qcoeff=  127;
-        }
-        s->y_dc_scale_table=
-        s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-        break;
-    default: //nothing needed - default table already set in mpegvideo.c
-        s->min_qcoeff= -127;
-        s->max_qcoeff=  127;
-        s->y_dc_scale_table=
-        s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-    }
-}
-
-void ff_h263_encode_mba(MpegEncContext *s)
-{
-    int i, mb_pos;
-
-    for(i=0; i<6; i++){
-        if(s->mb_num-1 <= ff_mba_max[i]) break;
-    }
-    mb_pos= s->mb_x + s->mb_width*s->mb_y;
-    put_bits(&s->pb, ff_mba_length[i], mb_pos);
-}
diff --git a/deps/libav/libavcodec/ivi_common.c b/deps/libav/libavcodec/ivi_common.c
deleted file mode 100644
index 1e064ed..0000000
--- a/deps/libav/libavcodec/ivi_common.c
+++ /dev/null
@@ -1,1463 +0,0 @@
-/*
- * common functions for Indeo Video Interactive codecs (Indeo4 and Indeo5)
- *
- * Copyright (c) 2009 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This file contains functions and data shared by both Indeo4 and
- * Indeo5 decoders.
- */
-
-#define BITSTREAM_READER_LE
-#include "libavutil/attributes.h"
-#include "libavutil/timer.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "mathops.h"
-#include "ivi_common.h"
-#include "ivi_dsp.h"
-
-/**
- * These are 2x8 predefined Huffman codebooks for coding macroblock/block
- * signals. They are specified using "huffman descriptors" in order to
- * avoid huge static tables. The decoding tables will be generated at
- * startup from these descriptors.
- */
-/** static macroblock huffman tables */
-static const IVIHuffDesc ivi_mb_huff_desc[8] = {
-    {8,  {0, 4, 5, 4, 4, 4, 6, 6}},
-    {12, {0, 2, 2, 3, 3, 3, 3, 5, 3, 2, 2, 2}},
-    {12, {0, 2, 3, 4, 3, 3, 3, 3, 4, 3, 2, 2}},
-    {12, {0, 3, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2}},
-    {13, {0, 4, 4, 3, 3, 3, 3, 2, 3, 3, 2, 1, 1}},
-    {9,  {0, 4, 4, 4, 4, 3, 3, 3, 2}},
-    {10, {0, 4, 4, 4, 4, 3, 3, 2, 2, 2}},
-    {12, {0, 4, 4, 4, 3, 3, 2, 3, 2, 2, 2, 2}}
-};
-
-/** static block huffman tables */
-static const IVIHuffDesc ivi_blk_huff_desc[8] = {
-    {10, {1, 2, 3, 4, 4, 7, 5, 5, 4, 1}},
-    {11, {2, 3, 4, 4, 4, 7, 5, 4, 3, 3, 2}},
-    {12, {2, 4, 5, 5, 5, 5, 6, 4, 4, 3, 1, 1}},
-    {13, {3, 3, 4, 4, 5, 6, 6, 4, 4, 3, 2, 1, 1}},
-    {11, {3, 4, 4, 5, 5, 5, 6, 5, 4, 2, 2}},
-    {13, {3, 4, 5, 5, 5, 5, 6, 4, 3, 3, 2, 1, 1}},
-    {13, {3, 4, 5, 5, 5, 6, 5, 4, 3, 3, 2, 1, 1}},
-    {9,  {3, 4, 4, 5, 5, 5, 6, 5, 5}}
-};
-
-static VLC ivi_mb_vlc_tabs [8]; ///< static macroblock Huffman tables
-static VLC ivi_blk_vlc_tabs[8]; ///< static block Huffman tables
-
-typedef void (*ivi_mc_func) (int16_t *buf, const int16_t *ref_buf,
-                             uint32_t pitch, int mc_type);
-
-static int ivi_mc(IVIBandDesc *band, ivi_mc_func mc,
-                  int offs, int mv_x, int mv_y, int mc_type)
-{
-    int ref_offs = offs + mv_y * band->pitch + mv_x;
-    int buf_size = band->pitch * band->aheight;
-    int min_size = band->pitch * (band->blk_size - 1) + band->blk_size;
-    int ref_size = (mc_type > 1) * band->pitch + (mc_type & 1);
-
-    if (offs < 0 || ref_offs < 0 || !band->ref_buf)
-        return AVERROR_INVALIDDATA;
-    if (buf_size - min_size < offs)
-        return AVERROR_INVALIDDATA;
-    if (buf_size - min_size - ref_size < ref_offs)
-        return AVERROR_INVALIDDATA;
-
-    mc(band->buf + offs, band->ref_buf + ref_offs, band->pitch, mc_type);
-
-    return 0;
-}
-
-/**
- *  Reverse "nbits" bits of the value "val" and return the result
- *  in the least significant bits.
- */
-static uint16_t inv_bits(uint16_t val, int nbits)
-{
-    uint16_t res;
-
-    if (nbits <= 8) {
-        res = ff_reverse[val] >> (8 - nbits);
-    } else
-        res = ((ff_reverse[val & 0xFF] << 8) +
-               (ff_reverse[val >> 8])) >> (16 - nbits);
-
-    return res;
-}
-
-/*
- *  Generate a huffman codebook from the given descriptor
- *  and convert it into the Libav VLC table.
- *
- *  @param[in]   cb    pointer to codebook descriptor
- *  @param[out]  vlc   where to place the generated VLC table
- *  @param[in]   flag  flag: 1 - for static or 0 for dynamic tables
- *  @return     result code: 0 - OK, -1 = error (invalid codebook descriptor)
- */
-static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag)
-{
-    int         pos, i, j, codes_per_row, prefix, not_last_row;
-    uint16_t    codewords[256]; /* FIXME: move this temporal storage out? */
-    uint8_t     bits[256];
-
-    pos = 0; /* current position = 0 */
-
-    for (i = 0; i < cb->num_rows; i++) {
-        codes_per_row = 1 << cb->xbits[i];
-        not_last_row  = (i != cb->num_rows - 1);
-        prefix        = ((1 << i) - 1) << (cb->xbits[i] + not_last_row);
-
-        for (j = 0; j < codes_per_row; j++) {
-            if (pos >= 256) /* Some Indeo5 codebooks can have more than 256 */
-                break;      /* elements, but only 256 codes are allowed! */
-
-            bits[pos] = i + cb->xbits[i] + not_last_row;
-            if (bits[pos] > IVI_VLC_BITS)
-                return AVERROR_INVALIDDATA; /* invalid descriptor */
-
-            codewords[pos] = inv_bits((prefix | j), bits[pos]);
-            if (!bits[pos])
-                bits[pos] = 1;
-
-            pos++;
-        }//for j
-    }//for i
-
-    /* number of codewords = pos */
-    return init_vlc(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2,
-                    (flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_LE);
-}
-
-av_cold void ff_ivi_init_static_vlc(void)
-{
-    int i;
-    static VLC_TYPE table_data[8192 * 16][2];
-    static int initialized_vlcs = 0;
-
-    if (initialized_vlcs)
-        return;
-    for (i = 0; i < 8; i++) {
-        ivi_mb_vlc_tabs[i].table = table_data + i * 2 * 8192;
-        ivi_mb_vlc_tabs[i].table_allocated = 8192;
-        ivi_create_huff_from_desc(&ivi_mb_huff_desc[i],
-                                  &ivi_mb_vlc_tabs[i], 1);
-        ivi_blk_vlc_tabs[i].table = table_data + (i * 2 + 1) * 8192;
-        ivi_blk_vlc_tabs[i].table_allocated = 8192;
-        ivi_create_huff_from_desc(&ivi_blk_huff_desc[i],
-                                  &ivi_blk_vlc_tabs[i], 1);
-    }
-    initialized_vlcs = 1;
-}
-
-/*
- *  Copy huffman codebook descriptors.
- *
- *  @param[out]  dst  ptr to the destination descriptor
- *  @param[in]   src  ptr to the source descriptor
- */
-static void ivi_huff_desc_copy(IVIHuffDesc *dst, const IVIHuffDesc *src)
-{
-    dst->num_rows = src->num_rows;
-    memcpy(dst->xbits, src->xbits, src->num_rows);
-}
-
-/*
- *  Compare two huffman codebook descriptors.
- *
- *  @param[in]  desc1  ptr to the 1st descriptor to compare
- *  @param[in]  desc2  ptr to the 2nd descriptor to compare
- *  @return         comparison result: 0 - equal, 1 - not equal
- */
-static int ivi_huff_desc_cmp(const IVIHuffDesc *desc1,
-                             const IVIHuffDesc *desc2)
-{
-    return desc1->num_rows != desc2->num_rows ||
-           memcmp(desc1->xbits, desc2->xbits, desc1->num_rows);
-}
-
-int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab,
-                         IVIHuffTab *huff_tab, AVCodecContext *avctx)
-{
-    int i, result;
-    IVIHuffDesc new_huff;
-
-    if (!desc_coded) {
-        /* select default table */
-        huff_tab->tab = (which_tab) ? &ivi_blk_vlc_tabs[7]
-                                    : &ivi_mb_vlc_tabs [7];
-        return 0;
-    }
-
-    huff_tab->tab_sel = get_bits(gb, 3);
-    if (huff_tab->tab_sel == 7) {
-        /* custom huffman table (explicitly encoded) */
-        new_huff.num_rows = get_bits(gb, 4);
-        if (!new_huff.num_rows) {
-            av_log(avctx, AV_LOG_ERROR, "Empty custom Huffman table!\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        for (i = 0; i < new_huff.num_rows; i++)
-            new_huff.xbits[i] = get_bits(gb, 4);
-
-        /* Have we got the same custom table? Rebuild if not. */
-        if (ivi_huff_desc_cmp(&new_huff, &huff_tab->cust_desc)) {
-            ivi_huff_desc_copy(&huff_tab->cust_desc, &new_huff);
-
-            if (huff_tab->cust_tab.table)
-                ff_free_vlc(&huff_tab->cust_tab);
-            result = ivi_create_huff_from_desc(&huff_tab->cust_desc,
-                    &huff_tab->cust_tab, 0);
-            if (result) {
-                // reset faulty description
-                huff_tab->cust_desc.num_rows = 0;
-                av_log(avctx, AV_LOG_ERROR,
-                       "Error while initializing custom vlc table!\n");
-                return result;
-            }
-        }
-        huff_tab->tab = &huff_tab->cust_tab;
-    } else {
-        /* select one of predefined tables */
-        huff_tab->tab = (which_tab) ? &ivi_blk_vlc_tabs[huff_tab->tab_sel]
-            : &ivi_mb_vlc_tabs [huff_tab->tab_sel];
-    }
-
-    return 0;
-}
-
-/*
- *  Free planes, bands and macroblocks buffers.
- *
- *  @param[in]  planes  pointer to the array of the plane descriptors
- */
-static av_cold void ivi_free_buffers(IVIPlaneDesc *planes)
-{
-    int p, b, t;
-
-    for (p = 0; p < 3; p++) {
-        for (b = 0; b < planes[p].num_bands; b++) {
-            av_freep(&planes[p].bands[b].bufs[0]);
-            av_freep(&planes[p].bands[b].bufs[1]);
-            av_freep(&planes[p].bands[b].bufs[2]);
-
-            if (planes[p].bands[b].blk_vlc.cust_tab.table)
-                ff_free_vlc(&planes[p].bands[b].blk_vlc.cust_tab);
-            for (t = 0; t < planes[p].bands[b].num_tiles; t++)
-                av_freep(&planes[p].bands[b].tiles[t].mbs);
-            av_freep(&planes[p].bands[b].tiles);
-        }
-        av_freep(&planes[p].bands);
-        planes[p].num_bands = 0;
-    }
-}
-
-av_cold int ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg)
-{
-    int p, b;
-    uint32_t b_width, b_height, align_fac, width_aligned,
-             height_aligned, buf_size;
-    IVIBandDesc *band;
-
-    ivi_free_buffers(planes);
-
-    if (cfg->pic_width < 1 || cfg->pic_height < 1 ||
-        cfg->luma_bands < 1 || cfg->chroma_bands < 1)
-        return AVERROR_INVALIDDATA;
-
-    /* fill in the descriptor of the luminance plane */
-    planes[0].width     = cfg->pic_width;
-    planes[0].height    = cfg->pic_height;
-    planes[0].num_bands = cfg->luma_bands;
-
-    /* fill in the descriptors of the chrominance planes */
-    planes[1].width     = planes[2].width     = (cfg->pic_width  + 3) >> 2;
-    planes[1].height    = planes[2].height    = (cfg->pic_height + 3) >> 2;
-    planes[1].num_bands = planes[2].num_bands = cfg->chroma_bands;
-
-    for (p = 0; p < 3; p++) {
-        planes[p].bands = av_mallocz(planes[p].num_bands * sizeof(IVIBandDesc));
-        if (!planes[p].bands)
-            return AVERROR(ENOMEM);
-
-        /* select band dimensions: if there is only one band then it
-         *  has the full size, if there are several bands each of them
-         *  has only half size */
-        b_width  = planes[p].num_bands == 1 ? planes[p].width
-                                            : (planes[p].width  + 1) >> 1;
-        b_height = planes[p].num_bands == 1 ? planes[p].height
-                                            : (planes[p].height + 1) >> 1;
-
-        /* luma   band buffers will be aligned on 16x16 (max macroblock size) */
-        /* chroma band buffers will be aligned on   8x8 (max macroblock size) */
-        align_fac       = p ? 8 : 16;
-        width_aligned   = FFALIGN(b_width , align_fac);
-        height_aligned  = FFALIGN(b_height, align_fac);
-        buf_size        = width_aligned * height_aligned * sizeof(int16_t);
-
-        for (b = 0; b < planes[p].num_bands; b++) {
-            band = &planes[p].bands[b]; /* select appropriate plane/band */
-            band->plane    = p;
-            band->band_num = b;
-            band->width    = b_width;
-            band->height   = b_height;
-            band->pitch    = width_aligned;
-            band->aheight  = height_aligned;
-            band->bufs[0]  = av_mallocz(buf_size);
-            band->bufs[1]  = av_mallocz(buf_size);
-            if (!band->bufs[0] || !band->bufs[1])
-                return AVERROR(ENOMEM);
-
-            /* allocate the 3rd band buffer for scalability mode */
-            if (cfg->luma_bands > 1) {
-                band->bufs[2] = av_mallocz(buf_size);
-                if (!band->bufs[2])
-                    return AVERROR(ENOMEM);
-            }
-            /* reset custom vlc */
-            planes[p].bands[0].blk_vlc.cust_desc.num_rows = 0;
-        }
-    }
-
-    return 0;
-}
-
-static int ivi_init_tiles(IVIBandDesc *band, IVITile *ref_tile,
-                          int p, int b, int t_height, int t_width)
-{
-    int x, y;
-    IVITile *tile = band->tiles;
-
-    for (y = 0; y < band->height; y += t_height) {
-        for (x = 0; x < band->width; x += t_width) {
-            tile->xpos     = x;
-            tile->ypos     = y;
-            tile->mb_size  = band->mb_size;
-            tile->width    = FFMIN(band->width - x,  t_width);
-            tile->height   = FFMIN(band->height - y, t_height);
-            tile->is_empty = tile->data_size = 0;
-            /* calculate number of macroblocks */
-            tile->num_MBs  = IVI_MBs_PER_TILE(tile->width, tile->height,
-                                              band->mb_size);
-
-            av_freep(&tile->mbs);
-            tile->mbs = av_malloc(tile->num_MBs * sizeof(IVIMbInfo));
-            if (!tile->mbs)
-                return AVERROR(ENOMEM);
-
-            tile->ref_mbs = 0;
-            if (p || b) {
-                if (tile->num_MBs != ref_tile->num_MBs)
-                    return AVERROR_INVALIDDATA;
-                tile->ref_mbs = ref_tile->mbs;
-                ref_tile++;
-            }
-            tile++;
-        }
-    }
-
-    return 0;
-}
-
-av_cold int ff_ivi_init_tiles(IVIPlaneDesc *planes,
-                              int tile_width, int tile_height)
-{
-    int p, b, x_tiles, y_tiles, t_width, t_height, ret;
-    IVIBandDesc *band;
-
-    for (p = 0; p < 3; p++) {
-        t_width  = !p ? tile_width  : (tile_width  + 3) >> 2;
-        t_height = !p ? tile_height : (tile_height + 3) >> 2;
-
-        if (!p && planes[0].num_bands == 4) {
-            t_width  >>= 1;
-            t_height >>= 1;
-        }
-
-        for (b = 0; b < planes[p].num_bands; b++) {
-            band = &planes[p].bands[b];
-            x_tiles = IVI_NUM_TILES(band->width, t_width);
-            y_tiles = IVI_NUM_TILES(band->height, t_height);
-            band->num_tiles = x_tiles * y_tiles;
-
-            av_freep(&band->tiles);
-            band->tiles = av_mallocz(band->num_tiles * sizeof(IVITile));
-            if (!band->tiles)
-                return AVERROR(ENOMEM);
-
-            /* use the first luma band as reference for motion vectors
-             * and quant */
-            ret = ivi_init_tiles(band, planes[0].bands[0].tiles,
-                                 p, b, t_height, t_width);
-            if (ret < 0)
-                return ret;
-        }
-    }
-
-    return 0;
-}
-
-/*
- *  Decode size of the tile data.
- *  The size is stored as a variable-length field having the following format:
- *  if (tile_data_size < 255) than this field is only one byte long
- *  if (tile_data_size >= 255) than this field four is byte long: 0xFF X1 X2 X3
- *  where X1-X3 is size of the tile data
- *
- *  @param[in,out]  gb  the GetBit context
- *  @return     size of the tile data in bytes
- */
-static int ivi_dec_tile_data_size(GetBitContext *gb)
-{
-    int    len;
-
-    len = 0;
-    if (get_bits1(gb)) {
-        len = get_bits(gb, 8);
-        if (len == 255)
-            len = get_bits_long(gb, 24);
-    }
-
-    /* align the bitstream reader on the byte boundary */
-    align_get_bits(gb);
-
-    return len;
-}
-
-static int ivi_dc_transform(IVIBandDesc *band, int *prev_dc, int buf_offs,
-                            int blk_size)
-{
-    int buf_size = band->pitch * band->aheight - buf_offs;
-    int min_size = (blk_size - 1) * band->pitch + blk_size;
-
-    if (!band->dc_transform)
-        return 0;
-
-
-    if (min_size > buf_size)
-        return AVERROR_INVALIDDATA;
-
-    band->dc_transform(prev_dc, band->buf + buf_offs,
-                       band->pitch, blk_size);
-
-    return 0;
-}
-
-static int ivi_decode_coded_blocks(GetBitContext *gb, IVIBandDesc *band,
-                                   ivi_mc_func mc, int mv_x, int mv_y,
-                                   int *prev_dc, int is_intra, int mc_type,
-                                   uint32_t quant, int offs,
-                                   AVCodecContext *avctx)
-{
-    const uint16_t *base_tab  = is_intra ? band->intra_base : band->inter_base;
-    RVMapDesc *rvmap = band->rv_map;
-    uint8_t col_flags[8];
-    int32_t trvec[64];
-    uint32_t sym = 0, lo, hi, q;
-    int pos, run, val;
-    int blk_size   = band->blk_size;
-    int num_coeffs = blk_size * blk_size;
-    int col_mask   = blk_size - 1;
-    int scan_pos   = -1;
-    int min_size   = band->pitch * (band->transform_size - 1) +
-                     band->transform_size;
-    int buf_size   = band->pitch * band->aheight - offs;
-
-    if (min_size > buf_size)
-        return AVERROR_INVALIDDATA;
-
-    if (!band->scan) {
-        av_log(avctx, AV_LOG_ERROR, "Scan pattern is not set.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* zero transform vector */
-    memset(trvec, 0, num_coeffs * sizeof(trvec[0]));
-    /* zero column flags */
-    memset(col_flags, 0, sizeof(col_flags));
-    while (scan_pos <= num_coeffs) {
-        sym = get_vlc2(gb, band->blk_vlc.tab->table,
-                       IVI_VLC_BITS, 1);
-        if (sym == rvmap->eob_sym)
-            break; /* End of block */
-
-        /* Escape - run/val explicitly coded using 3 vlc codes */
-        if (sym == rvmap->esc_sym) {
-            run = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1) + 1;
-            lo  = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1);
-            hi  = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1);
-            /* merge them and convert into signed val */
-            val = IVI_TOSIGNED((hi << 6) | lo);
-        } else {
-            if (sym >= 256U) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid sym encountered: %d.\n", sym);
-                return AVERROR_INVALIDDATA;
-            }
-            run = rvmap->runtab[sym];
-            val = rvmap->valtab[sym];
-        }
-
-        /* de-zigzag and dequantize */
-        scan_pos += run;
-        if (scan_pos >= num_coeffs || scan_pos < 0)
-            break;
-        pos = band->scan[scan_pos];
-
-        if (!val)
-            av_dlog(avctx, "Val = 0 encountered!\n");
-
-        q = (base_tab[pos] * quant) >> 9;
-        if (q > 1)
-            val = val * q + FFSIGN(val) * (((q ^ 1) - 1) >> 1);
-        trvec[pos] = val;
-        /* track columns containing non-zero coeffs */
-        col_flags[pos & col_mask] |= !!val;
-    }
-
-    if (scan_pos < 0 || scan_pos >= num_coeffs && sym != rvmap->eob_sym)
-        return AVERROR_INVALIDDATA; /* corrupt block data */
-
-    /* undoing DC coeff prediction for intra-blocks */
-    if (is_intra && band->is_2d_trans) {
-        *prev_dc     += trvec[0];
-        trvec[0]      = *prev_dc;
-        col_flags[0] |= !!*prev_dc;
-    }
-
-    /* apply inverse transform */
-    band->inv_transform(trvec, band->buf + offs,
-                        band->pitch, col_flags);
-
-    /* apply motion compensation */
-    if (!is_intra)
-        return ivi_mc(band, mc, offs, mv_x, mv_y, mc_type);
-
-    return 0;
-}
-/*
- *  Decode block data:
- *  extract huffman-coded transform coefficients from the bitstream,
- *  dequantize them, apply inverse transform and motion compensation
- *  in order to reconstruct the picture.
- *
- *  @param[in,out]  gb    the GetBit context
- *  @param[in]      band  pointer to the band descriptor
- *  @param[in]      tile  pointer to the tile descriptor
- *  @return     result code: 0 - OK, -1 = error (corrupted blocks data)
- */
-static int ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band,
-                             IVITile *tile, AVCodecContext *avctx)
-{
-    int mbn, blk, num_blocks, blk_size, ret, is_intra, mc_type = 0;
-    int mv_x = 0, mv_y = 0;
-    int32_t prev_dc;
-    uint32_t cbp, quant, buf_offs;
-    IVIMbInfo *mb;
-    ivi_mc_func mc_with_delta_func, mc_no_delta_func;
-    const uint8_t *scale_tab;
-
-    /* init intra prediction for the DC coefficient */
-    prev_dc    = 0;
-    blk_size   = band->blk_size;
-    /* number of blocks per mb */
-    num_blocks = (band->mb_size != blk_size) ? 4 : 1;
-    if (blk_size == 8) {
-        mc_with_delta_func = ff_ivi_mc_8x8_delta;
-        mc_no_delta_func   = ff_ivi_mc_8x8_no_delta;
-    } else {
-        mc_with_delta_func = ff_ivi_mc_4x4_delta;
-        mc_no_delta_func   = ff_ivi_mc_4x4_no_delta;
-    }
-
-    for (mbn = 0, mb = tile->mbs; mbn < tile->num_MBs; mb++, mbn++) {
-        is_intra = !mb->type;
-        cbp      = mb->cbp;
-        buf_offs = mb->buf_offs;
-
-        quant = band->glob_quant + mb->q_delta;
-        if (avctx->codec_id == AV_CODEC_ID_INDEO4)
-            quant = av_clip(quant, 0, 31);
-        else
-            quant = av_clip(quant, 0, 23);
-
-        scale_tab = is_intra ? band->intra_scale : band->inter_scale;
-        if (scale_tab)
-            quant = scale_tab[quant];
-
-        if (!is_intra) {
-            mv_x = mb->mv_x;
-            mv_y = mb->mv_y;
-            if (band->is_halfpel) {
-                mc_type = ((mv_y & 1) << 1) | (mv_x & 1);
-                mv_x >>= 1;
-                mv_y >>= 1; /* convert halfpel vectors into fullpel ones */
-            }
-            if (mb->type) {
-                int dmv_x, dmv_y, cx, cy;
-
-                dmv_x = mb->mv_x >> band->is_halfpel;
-                dmv_y = mb->mv_y >> band->is_halfpel;
-                cx    = mb->mv_x &  band->is_halfpel;
-                cy    = mb->mv_y &  band->is_halfpel;
-
-                if (mb->xpos + dmv_x < 0 ||
-                    mb->xpos + dmv_x + band->mb_size + cx > band->pitch ||
-                    mb->ypos + dmv_y < 0 ||
-                    mb->ypos + dmv_y + band->mb_size + cy > band->aheight) {
-                    return AVERROR_INVALIDDATA;
-                }
-            }
-        }
-
-        for (blk = 0; blk < num_blocks; blk++) {
-            /* adjust block position in the buffer according to its number */
-            if (blk & 1) {
-                buf_offs += blk_size;
-            } else if (blk == 2) {
-                buf_offs -= blk_size;
-                buf_offs += blk_size * band->pitch;
-            }
-
-            if (cbp & 1) { /* block coded ? */
-                ret = ivi_decode_coded_blocks(gb, band, mc_with_delta_func,
-                                              mv_x, mv_y, &prev_dc, is_intra,
-                                              mc_type, quant, buf_offs, avctx);
-                if (ret < 0)
-                    return ret;
-            } else {
-                /* block not coded */
-                /* for intra blocks apply the dc slant transform */
-                /* for inter - perform the motion compensation without delta */
-                if (is_intra) {
-                    ret = ivi_dc_transform(band, &prev_dc, buf_offs, blk_size);
-                    if (ret < 0)
-                        return ret;
-                } else {
-                    ret = ivi_mc(band, mc_no_delta_func, buf_offs,
-                                 mv_x, mv_y, mc_type);
-                    if (ret < 0)
-                        return ret;
-                }
-            }
-
-            cbp >>= 1;
-        }// for blk
-    }// for mbn
-
-    align_get_bits(gb);
-
-    return 0;
-}
-
-/**
- *  Handle empty tiles by performing data copying and motion
- *  compensation respectively.
- *
- *  @param[in]  avctx     ptr to the AVCodecContext
- *  @param[in]  band      pointer to the band descriptor
- *  @param[in]  tile      pointer to the tile descriptor
- *  @param[in]  mv_scale  scaling factor for motion vectors
- */
-static int ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band,
-                                  IVITile *tile, int32_t mv_scale)
-{
-    int             x, y, need_mc, mbn, blk, num_blocks, mv_x, mv_y, mc_type;
-    int             offs, mb_offset, row_offset, ret;
-    IVIMbInfo       *mb, *ref_mb;
-    const int16_t   *src;
-    int16_t         *dst;
-    ivi_mc_func     mc_no_delta_func;
-
-    if (tile->num_MBs != IVI_MBs_PER_TILE(tile->width, tile->height, band->mb_size)) {
-        av_log(avctx, AV_LOG_ERROR, "Allocated tile size %d mismatches "
-               "parameters %d in ivi_process_empty_tile()\n",
-               tile->num_MBs, IVI_MBs_PER_TILE(tile->width, tile->height, band->mb_size));
-        return AVERROR_INVALIDDATA;
-    }
-
-    offs       = tile->ypos * band->pitch + tile->xpos;
-    mb         = tile->mbs;
-    ref_mb     = tile->ref_mbs;
-    row_offset = band->mb_size * band->pitch;
-    need_mc    = 0; /* reset the mc tracking flag */
-
-    for (y = tile->ypos; y < (tile->ypos + tile->height); y += band->mb_size) {
-        mb_offset = offs;
-
-        for (x = tile->xpos; x < (tile->xpos + tile->width); x += band->mb_size) {
-            mb->xpos     = x;
-            mb->ypos     = y;
-            mb->buf_offs = mb_offset;
-
-            mb->type = 1; /* set the macroblocks type = INTER */
-            mb->cbp  = 0; /* all blocks are empty */
-
-            if (!band->qdelta_present && !band->plane && !band->band_num) {
-                mb->q_delta = band->glob_quant;
-                mb->mv_x    = 0;
-                mb->mv_y    = 0;
-            }
-
-            if (band->inherit_qdelta && ref_mb)
-                mb->q_delta = ref_mb->q_delta;
-
-            if (band->inherit_mv && ref_mb) {
-                /* motion vector inheritance */
-                if (mv_scale) {
-                    mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
-                    mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
-                } else {
-                    mb->mv_x = ref_mb->mv_x;
-                    mb->mv_y = ref_mb->mv_y;
-                }
-                need_mc |= mb->mv_x || mb->mv_y; /* tracking non-zero motion vectors */
-            }
-
-            mb++;
-            if (ref_mb)
-                ref_mb++;
-            mb_offset += band->mb_size;
-        } // for x
-        offs += row_offset;
-    } // for y
-
-    if (band->inherit_mv && need_mc) { /* apply motion compensation if there is at least one non-zero motion vector */
-        num_blocks = (band->mb_size != band->blk_size) ? 4 : 1; /* number of blocks per mb */
-        mc_no_delta_func = (band->blk_size == 8) ? ff_ivi_mc_8x8_no_delta
-                                                 : ff_ivi_mc_4x4_no_delta;
-
-        for (mbn = 0, mb = tile->mbs; mbn < tile->num_MBs; mb++, mbn++) {
-            mv_x = mb->mv_x;
-            mv_y = mb->mv_y;
-            if (!band->is_halfpel) {
-                mc_type = 0; /* we have only fullpel vectors */
-            } else {
-                mc_type = ((mv_y & 1) << 1) | (mv_x & 1);
-                mv_x >>= 1;
-                mv_y >>= 1; /* convert halfpel vectors into fullpel ones */
-            }
-
-            for (blk = 0; blk < num_blocks; blk++) {
-                /* adjust block position in the buffer according with its number */
-                offs = mb->buf_offs + band->blk_size * ((blk & 1) + !!(blk & 2) * band->pitch);
-                ret = ivi_mc(band, mc_no_delta_func, offs,
-                             mv_x, mv_y, mc_type);
-                if (ret < 0)
-                    return ret;
-            }
-        }
-    } else {
-        /* copy data from the reference tile into the current one */
-        src = band->ref_buf + tile->ypos * band->pitch + tile->xpos;
-        dst = band->buf     + tile->ypos * band->pitch + tile->xpos;
-        for (y = 0; y < tile->height; y++) {
-            memcpy(dst, src, tile->width*sizeof(band->buf[0]));
-            src += band->pitch;
-            dst += band->pitch;
-        }
-    }
-
-    return 0;
-}
-
-
-#ifdef DEBUG
-static uint16_t ivi_calc_band_checksum(IVIBandDesc *band)
-{
-    int         x, y;
-    int16_t     *src, checksum;
-
-    src = band->buf;
-    checksum = 0;
-
-    for (y = 0; y < band->height; src += band->pitch, y++)
-        for (x = 0; x < band->width; x++)
-            checksum += src[x];
-
-    return checksum;
-}
-#endif
-
-/*
- *  Convert and output the current plane.
- *  This conversion is done by adding back the bias value of 128
- *  (subtracted in the encoder) and clipping the result.
- *
- *  @param[in]   plane      pointer to the descriptor of the plane being processed
- *  @param[out]  dst        pointer to the buffer receiving converted pixels
- *  @param[in]   dst_pitch  pitch for moving to the next y line
- */
-static void ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch)
-{
-    int             x, y;
-    const int16_t   *src  = plane->bands[0].buf;
-    uint32_t        pitch = plane->bands[0].pitch;
-
-    if (!src)
-        return;
-
-    for (y = 0; y < plane->height; y++) {
-        for (x = 0; x < plane->width; x++)
-            dst[x] = av_clip_uint8(src[x] + 128);
-        src += pitch;
-        dst += dst_pitch;
-    }
-}
-
-/**
- *  Decode an Indeo 4 or 5 band.
- *
- *  @param[in,out]  ctx    ptr to the decoder context
- *  @param[in,out]  band   ptr to the band descriptor
- *  @param[in]      avctx  ptr to the AVCodecContext
- *  @return         result code: 0 = OK, -1 = error
- */
-static int decode_band(IVI45DecContext *ctx,
-                       IVIBandDesc *band, AVCodecContext *avctx)
-{
-    int         result, i, t, idx1, idx2, pos;
-    IVITile     *tile;
-
-    band->buf     = band->bufs[ctx->dst_buf];
-    if (!band->buf) {
-        av_log(avctx, AV_LOG_ERROR, "Band buffer points to no data!\n");
-        return AVERROR_INVALIDDATA;
-    }
-    band->ref_buf = band->bufs[ctx->ref_buf];
-    band->data_ptr = ctx->frame_data + (get_bits_count(&ctx->gb) >> 3);
-
-    result = ctx->decode_band_hdr(ctx, band, avctx);
-    if (result) {
-        av_log(avctx, AV_LOG_ERROR, "Error while decoding band header: %d\n",
-               result);
-        return result;
-    }
-
-    if (band->is_empty) {
-        av_log(avctx, AV_LOG_ERROR, "Empty band encountered!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    band->rv_map = &ctx->rvmap_tabs[band->rvmap_sel];
-
-    /* apply corrections to the selected rvmap table if present */
-    for (i = 0; i < band->num_corr; i++) {
-        idx1 = band->corr[i * 2];
-        idx2 = band->corr[i * 2 + 1];
-        FFSWAP(uint8_t, band->rv_map->runtab[idx1], band->rv_map->runtab[idx2]);
-        FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]);
-    }
-
-    pos = get_bits_count(&ctx->gb);
-
-    for (t = 0; t < band->num_tiles; t++) {
-        tile = &band->tiles[t];
-
-        if (tile->mb_size != band->mb_size) {
-            av_log(avctx, AV_LOG_ERROR, "MB sizes mismatch: %d vs. %d\n",
-                   band->mb_size, tile->mb_size);
-            return AVERROR_INVALIDDATA;
-        }
-        tile->is_empty = get_bits1(&ctx->gb);
-        if (tile->is_empty) {
-            result = ivi_process_empty_tile(avctx, band, tile,
-                                      (ctx->planes[0].bands[0].mb_size >> 3) - (band->mb_size >> 3));
-            if (result < 0)
-                break;
-            av_dlog(avctx, "Empty tile encountered!\n");
-        } else {
-            tile->data_size = ivi_dec_tile_data_size(&ctx->gb);
-            if (!tile->data_size) {
-                av_log(avctx, AV_LOG_ERROR, "Tile data size is zero!\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            result = ctx->decode_mb_info(ctx, band, tile, avctx);
-            if (result < 0)
-                break;
-
-            result = ivi_decode_blocks(&ctx->gb, band, tile, avctx);
-            if (result < 0) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Corrupted tile data encountered!\n");
-                break;
-            }
-
-            if (((get_bits_count(&ctx->gb) - pos) >> 3) != tile->data_size) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Tile data_size mismatch!\n");
-                result = AVERROR_INVALIDDATA;
-                break;
-            }
-
-            pos += tile->data_size << 3; // skip to next tile
-        }
-    }
-
-    /* restore the selected rvmap table by applying its corrections in
-     * reverse order */
-    for (i = band->num_corr-1; i >= 0; i--) {
-        idx1 = band->corr[i*2];
-        idx2 = band->corr[i*2+1];
-        FFSWAP(uint8_t, band->rv_map->runtab[idx1], band->rv_map->runtab[idx2]);
-        FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]);
-    }
-
-#ifdef DEBUG
-    if (band->checksum_present) {
-        uint16_t chksum = ivi_calc_band_checksum(band);
-        if (chksum != band->checksum) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Band checksum mismatch! Plane %d, band %d, "
-                   "received: %x, calculated: %x\n",
-                   band->plane, band->band_num, band->checksum, chksum);
-        }
-    }
-#endif
-
-    align_get_bits(&ctx->gb);
-
-    return result;
-}
-
-int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    IVI45DecContext *ctx = avctx->priv_data;
-    const uint8_t   *buf = avpkt->data;
-    AVFrame       *frame = data;
-    int             buf_size = avpkt->size;
-    int             result, p, b;
-
-    init_get_bits(&ctx->gb, buf, buf_size * 8);
-    ctx->frame_data = buf;
-    ctx->frame_size = buf_size;
-
-    result = ctx->decode_pic_hdr(ctx, avctx);
-    if (result) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Error while decoding picture header: %d\n", result);
-        return result;
-    }
-    if (ctx->gop_invalid)
-        return AVERROR_INVALIDDATA;
-
-    if (ctx->gop_flags & IVI5_IS_PROTECTED) {
-        avpriv_report_missing_feature(avctx, "Password-protected clip!\n");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (!ctx->planes[0].bands) {
-        av_log(avctx, AV_LOG_ERROR, "Color planes not initialized yet\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->switch_buffers(ctx);
-
-    //{ START_TIMER;
-
-    if (ctx->is_nonnull_frame(ctx)) {
-        for (p = 0; p < 3; p++) {
-            for (b = 0; b < ctx->planes[p].num_bands; b++) {
-                result = decode_band(ctx, &ctx->planes[p].bands[b], avctx);
-                if (result < 0) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Error while decoding band: %d, plane: %d\n", b, p);
-                    return result;
-                }
-            }
-        }
-    } else {
-        if (ctx->is_scalable)
-            return AVERROR_INVALIDDATA;
-
-        for (p = 0; p < 3; p++) {
-            if (!ctx->planes[p].bands[0].buf)
-                return AVERROR_INVALIDDATA;
-        }
-    }
-
-    //STOP_TIMER("decode_planes"); }
-
-    /* If the bidirectional mode is enabled, next I and the following P
-     * frame will be sent together. Unfortunately the approach below seems
-     * to be the only way to handle the B-frames mode.
-     * That's exactly the same Intel decoders do.
-     */
-    if (avctx->codec_id == AV_CODEC_ID_INDEO4 &&
-        ctx->frame_type == 0/*FRAMETYPE_INTRA*/) {
-        while (get_bits(&ctx->gb, 8)); // skip version string
-        skip_bits_long(&ctx->gb, 64);  // skip padding, TODO: implement correct 8-bytes alignment
-        if (get_bits_left(&ctx->gb) > 18 && show_bits(&ctx->gb, 18) == 0x3FFF8)
-            av_log(avctx, AV_LOG_ERROR, "Buffer contains IP frames!\n");
-    }
-
-    result = ff_set_dimensions(avctx, ctx->planes[0].width, ctx->planes[0].height);
-    if (result < 0)
-        return result;
-
-    if ((result = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return result;
-    }
-
-    if (ctx->is_scalable) {
-        if (avctx->codec_id == AV_CODEC_ID_INDEO4)
-            ff_ivi_recompose_haar(&ctx->planes[0], frame->data[0], frame->linesize[0]);
-        else
-            ff_ivi_recompose53   (&ctx->planes[0], frame->data[0], frame->linesize[0]);
-    } else {
-        ivi_output_plane(&ctx->planes[0], frame->data[0], frame->linesize[0]);
-    }
-
-    ivi_output_plane(&ctx->planes[2], frame->data[1], frame->linesize[1]);
-    ivi_output_plane(&ctx->planes[1], frame->data[2], frame->linesize[2]);
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-/**
- *  Close Indeo5 decoder and clean up its context.
- */
-av_cold int ff_ivi_decode_close(AVCodecContext *avctx)
-{
-    IVI45DecContext *ctx = avctx->priv_data;
-
-    ivi_free_buffers(&ctx->planes[0]);
-
-    if (ctx->mb_vlc.cust_tab.table)
-        ff_free_vlc(&ctx->mb_vlc.cust_tab);
-
-#if IVI4_STREAM_ANALYSER
-    if (avctx->codec_id == AV_CODEC_ID_INDEO4) {
-    if (ctx->is_scalable)
-        av_log(avctx, AV_LOG_ERROR, "This video uses scalability mode!\n");
-    if (ctx->uses_tiling)
-        av_log(avctx, AV_LOG_ERROR, "This video uses local decoding!\n");
-    if (ctx->has_b_frames)
-        av_log(avctx, AV_LOG_ERROR, "This video contains B-frames!\n");
-    if (ctx->has_transp)
-        av_log(avctx, AV_LOG_ERROR, "Transparency mode is enabled!\n");
-    if (ctx->uses_haar)
-        av_log(avctx, AV_LOG_ERROR, "This video uses Haar transform!\n");
-    if (ctx->uses_fullpel)
-        av_log(avctx, AV_LOG_ERROR, "This video uses fullpel motion vectors!\n");
-    }
-#endif
-
-    return 0;
-}
-
-
-/**
- *  Scan patterns shared between indeo4 and indeo5
- */
-const uint8_t ff_ivi_vertical_scan_8x8[64] = {
-    0,  8, 16, 24, 32, 40, 48, 56,
-    1,  9, 17, 25, 33, 41, 49, 57,
-    2, 10, 18, 26, 34, 42, 50, 58,
-    3, 11, 19, 27, 35, 43, 51, 59,
-    4, 12, 20, 28, 36, 44, 52, 60,
-    5, 13, 21, 29, 37, 45, 53, 61,
-    6, 14, 22, 30, 38, 46, 54, 62,
-    7, 15, 23, 31, 39, 47, 55, 63
-};
-
-const uint8_t ff_ivi_horizontal_scan_8x8[64] = {
-     0,  1,  2,  3,  4,  5,  6,  7,
-     8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23,
-    24, 25, 26, 27, 28, 29, 30, 31,
-    32, 33, 34, 35, 36, 37, 38, 39,
-    40, 41, 42, 43, 44, 45, 46, 47,
-    48, 49, 50, 51, 52, 53, 54, 55,
-    56, 57, 58, 59, 60, 61, 62, 63
-};
-
-const uint8_t ff_ivi_direct_scan_4x4[16] = {
-    0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15
-};
-
-
-/**
- *  Run-value (RLE) tables.
- */
-const RVMapDesc ff_ivi_rvmap_tabs[9] = {
-{   /* MapTab0 */
-    5, /* eob_sym */
-    2, /* esc_sym */
-    /* run table */
-    {1,  1,  0,  1,  1,  0,  1,  1,  2,  2,  1,  1,  1,  1,  3,  3,
-     1,  1,  2,  2,  1,  1,  4,  4,  1,  1,  1,  1,  2,  2,  5,  5,
-     1,  1,  3,  3,  1,  1,  6,  6,  1,  2,  1,  2,  7,  7,  1,  1,
-     8,  8,  1,  1,  4,  2,  1,  4,  2,  1,  3,  3,  1,  1,  1,  9,
-     9,  1,  2,  1,  2,  1,  5,  5,  1,  1, 10, 10,  1,  1,  3,  3,
-     2,  2,  1,  1, 11, 11,  6,  4,  4,  1,  6,  1,  2,  1,  2, 12,
-     8,  1, 12,  7,  8,  7,  1, 16,  1, 16,  1,  3,  3, 13,  1, 13,
-     2,  2,  1, 15,  1,  5, 14, 15,  1,  5, 14,  1, 17,  8, 17,  8,
-     1,  4,  4,  2,  2,  1, 25, 25, 24, 24,  1,  3,  1,  3,  1,  8,
-     6,  7,  6,  1, 18,  8, 18,  1,  7, 23,  2,  2, 23,  1,  1, 21,
-    22,  9,  9, 22, 19,  1, 21,  5, 19,  5,  1, 33, 20, 33, 20,  8,
-     4,  4,  1, 32,  2,  2,  8,  3, 32, 26,  3,  1,  7,  7, 26,  6,
-     1,  6,  1,  1, 16,  1, 10,  1, 10,  2, 16, 29, 28,  2, 29, 28,
-     1, 27,  5,  8,  5, 27,  1,  8,  3,  7,  3, 31, 41, 31,  1, 41,
-     6,  1,  6,  7,  4,  4,  1,  1,  2,  1,  2, 11, 34, 30, 11,  1,
-    30, 15, 15, 34, 36, 40, 36, 40, 35, 35, 37, 37, 39, 39, 38, 38},
-
-    /* value table */
-    { 1,  -1,   0,   2,  -2,   0,   3,  -3,   1,  -1,   4,  -4,   5,  -5,   1,  -1,
-      6,  -6,   2,  -2,   7,  -7,   1,  -1,   8,  -8,   9,  -9,   3,  -3,   1,  -1,
-     10, -10,   2,  -2,  11, -11,   1,  -1,  12,   4, -12,  -4,   1,  -1,  13, -13,
-      1,  -1,  14, -14,   2,   5,  15,  -2,  -5, -15,  -3,   3,  16, -16,  17,   1,
-     -1, -17,   6,  18,  -6, -18,   2,  -2,  19, -19,   1,  -1,  20, -20,   4,  -4,
-      7,  -7,  21, -21,   1,  -1,   2,   3,  -3,  22,  -2, -22,   8,  23,  -8,   1,
-      2, -23,  -1,   2,  -2,  -2,  24,   1, -24,  -1,  25,   5,  -5,   1, -25,  -1,
-      9,  -9,  26,   1, -26,   3,   1,  -1,  27,  -3,  -1, -27,   1,   3,  -1,  -3,
-     28,  -4,   4,  10, -10, -28,   1,  -1,   1,  -1,  29,   6, -29,  -6,  30,  -4,
-      3,   3,  -3, -30,   1,   4,  -1,  31,  -3,   1,  11, -11,  -1, -31,  32,  -1,
-     -1,   2,  -2,   1,   1, -32,   1,   4,  -1,  -4,  33,  -1,   1,   1,  -1,   5,
-      5,  -5, -33,  -1, -12,  12,  -5,  -7,   1,   1,   7,  34,   4,  -4,  -1,   4,
-    -34,  -4,  35,  36,  -2, -35,  -2, -36,   2,  13,   2,  -1,   1, -13,   1,  -1,
-     37,   1,  -5,   6,   5,  -1,  38,  -6,  -8,   5,   8,  -1,   1,   1, -37,  -1,
-      5,  39,  -5,  -5,   6,  -6, -38, -39, -14,  40,  14,   2,   1,   1,  -2, -40,
-     -1,  -2,   2,  -1,  -1,  -1,   1,   1,   1,  -1,   1,  -1,   1,  -1,   1,  -1}
-},{
-    /* MapTab1 */
-    0,  /* eob_sym */
-    38, /* esc_sym */
-    /* run table */
-    {0,  1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  8,  6,  8,  7,
-     7,  9,  9, 10, 10, 11, 11,  1, 12,  1, 12, 13, 13, 16, 14, 16,
-    14, 15, 15, 17, 17, 18,  0, 18, 19, 20, 21, 19, 22, 21, 20, 22,
-    25, 24,  2, 25, 24, 23, 23,  2, 26, 28, 26, 28, 29, 27, 29, 27,
-    33, 33,  1, 32,  1,  3, 32, 30, 36,  3, 36, 30, 31, 31, 35, 34,
-    37, 41, 34, 35, 37,  4, 41,  4, 49,  8,  8, 49, 40, 38,  5, 38,
-    40, 39,  5, 39, 42, 43, 42,  7, 57,  6, 43, 44,  6, 50,  7, 44,
-    57, 48, 50, 48, 45, 45, 46, 47, 51, 46, 47, 58,  1, 51, 58,  1,
-    52, 59, 53,  9, 52, 55, 55, 59, 53, 56, 54, 56, 54,  9, 64, 64,
-    60, 63, 60, 63, 61, 62, 61, 62,  2, 10,  2, 10, 11,  1, 11, 13,
-    12,  1, 12, 13, 16, 16,  8,  8, 14,  3,  3, 15, 14, 15,  4,  4,
-     1, 17, 17,  5,  1,  7,  7,  5,  6,  1,  2,  2,  6, 22,  1, 25,
-    21, 22,  8, 24,  1, 21, 25, 24,  8, 18, 18, 23,  9, 20, 23, 33,
-    29, 33, 20,  1, 19,  1, 29, 36,  9, 36, 19, 41, 28, 57, 32,  3,
-    28,  3,  1, 27, 49, 49,  1, 32, 26, 26,  2,  4,  4,  7, 57, 41,
-     2,  7, 10,  5, 37, 16, 10, 27,  8,  8, 13, 16, 37, 13,  1,  5},
-
-    /* value table */
-    {0,   1,  -1,   1,  -1,   1,  -1,   1,  -1,   1,  -1,   1,   1,  -1,  -1,   1,
-    -1,   1,  -1,   1,  -1,   1,  -1,   2,   1,  -2,  -1,   1,  -1,   1,   1,  -1,
-    -1,   1,  -1,   1,  -1,   1,   0,  -1,   1,   1,   1,  -1,   1,  -1,  -1,  -1,
-     1,   1,   2,  -1,  -1,   1,  -1,  -2,   1,   1,  -1,  -1,   1,   1,  -1,  -1,
-     1,  -1,   3,   1,  -3,   2,  -1,   1,   1,  -2,  -1,  -1,  -1,   1,   1,   1,
-     1,   1,  -1,  -1,  -1,   2,  -1,  -2,   1,   2,  -2,  -1,   1,   1,   2,  -1,
-    -1,   1,  -2,  -1,   1,   1,  -1,   2,   1,   2,  -1,   1,  -2,  -1,  -2,  -1,
-    -1,   1,   1,  -1,   1,  -1,   1,   1,   1,  -1,  -1,   1,   4,  -1,  -1,  -4,
-     1,   1,   1,   2,  -1,  -1,   1,  -1,  -1,   1,  -1,  -1,   1,  -2,   1,  -1,
-     1,   1,  -1,  -1,   1,   1,  -1,  -1,   3,   2,  -3,  -2,   2,   5,  -2,   2,
-     2,  -5,  -2,  -2,  -2,   2,  -3,   3,   2,   3,  -3,   2,  -2,  -2,   3,  -3,
-     6,   2,  -2,   3,  -6,   3,  -3,  -3,   3,   7,  -4,   4,  -3,   2,  -7,   2,
-     2,  -2,  -4,   2,   8,  -2,  -2,  -2,   4,   2,  -2,   2,   3,   2,  -2,  -2,
-     2,   2,  -2,  -8,  -2,   9,  -2,   2,  -3,  -2,   2,  -2,   2,   2,   2,   4,
-    -2,  -4,  10,   2,   2,  -2,  -9,  -2,   2,  -2,   5,   4,  -4,   4,  -2,   2,
-    -5,  -4,  -3,   4,   2,  -3,   3,  -2,  -5,   5,   3,   3,  -2,  -3, -10,  -4}
-},{
-    /* MapTab2 */
-    2,  /* eob_sym */
-    11, /* esc_sym */
-    /* run table */
-    {1,  1,  0,  2,  2,  1,  1,  3,  3,  4,  4,  0,  1,  1,  5,  5,
-     2,  2,  6,  6,  7,  7,  1,  8,  1,  8,  3,  3,  9,  9,  1,  2,
-     2,  1,  4, 10,  4, 10, 11, 11,  1,  5, 12, 12,  1,  5, 13, 13,
-     3,  3,  6,  6,  2,  2, 14, 14, 16, 16, 15,  7, 15,  8,  8,  7,
-     1,  1, 17, 17,  4,  4,  1,  1, 18, 18,  2,  2,  5,  5, 25,  3,
-     9,  3, 25,  9, 19, 24, 19, 24,  1, 21, 20,  1, 21, 22, 20, 22,
-    23, 23,  8,  6, 33,  6,  8, 33,  7,  7, 26, 26,  1, 32,  1, 32,
-    28,  4, 28, 10, 29, 27, 27, 10, 41,  4, 29,  2,  2, 41, 36, 31,
-    49, 31, 34, 30, 34, 36, 30, 35,  1, 49, 11,  5, 35, 11,  1,  3,
-     3,  5, 37, 37,  8, 40,  8, 40, 12, 12, 42, 42,  1, 38, 16, 57,
-     1,  6, 16, 39, 38,  6,  7,  7, 13, 13, 39, 43,  2, 43, 57,  2,
-    50,  9, 44,  9, 50,  4, 15, 48, 44,  4,  1, 15, 48, 14, 14,  1,
-    45, 45,  8,  3,  5,  8, 51, 47,  3, 46, 46, 47,  5, 51,  1, 17,
-    17, 58,  1, 58,  2, 52, 52,  2, 53,  7, 59,  6,  6, 56, 53, 55,
-     7, 55,  1, 54, 59, 56, 54, 10,  1, 10,  4, 60,  1, 60,  8,  4,
-     8, 64, 64, 61,  1, 63,  3, 63, 62, 61,  5, 11,  5,  3, 11, 62},
-
-    /* value table */
-    { 1,  -1,   0,   1,  -1,   2,  -2,   1,  -1,   1,  -1,   0,   3,  -3,   1,  -1,
-      2,  -2,   1,  -1,   1,  -1,   4,   1,  -4,  -1,   2,  -2,   1,  -1,   5,   3,
-     -3,  -5,   2,   1,  -2,  -1,   1,  -1,   6,   2,   1,  -1,  -6,  -2,   1,  -1,
-      3,  -3,   2,  -2,   4,  -4,   1,  -1,   1,  -1,   1,   2,  -1,   2,  -2,  -2,
-      7,  -7,   1,  -1,   3,  -3,   8,  -8,   1,  -1,   5,  -5,   3,  -3,   1,   4,
-      2,  -4,  -1,  -2,   1,   1,  -1,  -1,   9,   1,   1,  -9,  -1,   1,  -1,  -1,
-      1,  -1,   3,  -3,   1,   3,  -3,  -1,   3,  -3,   1,  -1,  10,   1, -10,  -1,
-      1,   4,  -1,   2,   1,  -1,   1,  -2,   1,  -4,  -1,   6,  -6,  -1,   1,   1,
-      1,  -1,   1,   1,  -1,  -1,  -1,   1,  11,  -1,  -2,   4,  -1,   2, -11,   5,
-     -5,  -4,  -1,   1,   4,   1,  -4,  -1,  -2,   2,   1,  -1,  12,   1,  -2,   1,
-    -12,   4,   2,   1,  -1,  -4,   4,  -4,   2,  -2,  -1,   1,   7,  -1,  -1,  -7,
-     -1,  -3,   1,   3,   1,   5,   2,   1,  -1,  -5,  13,  -2,  -1,   2,  -2, -13,
-      1,  -1,   5,   6,   5,  -5,   1,   1,  -6,   1,  -1,  -1,  -5,  -1,  14,   2,
-     -2,   1, -14,  -1,   8,   1,  -1,  -8,   1,   5,   1,   5,  -5,   1,  -1,   1,
-     -5,  -1,  15,   1,  -1,  -1,  -1,   3, -15,  -3,   6,   1,  16,  -1,   6,  -6,
-     -6,   1,  -1,   1, -16,   1,   7,  -1,   1,  -1,  -6,  -3,   6,  -7,   3,  -1}
-},{
-    /* MapTab3 */
-    0,  /* eob_sym */
-    35, /* esc_sym */
-    /* run table */
-    {0,  1,  1,  2,  2,  3,  3,  4,  4,  1,  1,  5,  5,  6,  6,  7,
-     7,  8,  8,  9,  9,  2,  2, 10, 10,  1,  1, 11, 11, 12, 12,  3,
-     3, 13, 13,  0, 14, 14, 16, 15, 16, 15,  4,  4, 17,  1, 17,  1,
-     5,  5, 18, 18,  2,  2,  6,  6,  8, 19,  7,  8,  7, 19, 20, 20,
-    21, 21, 22, 24, 22, 24, 23, 23,  1,  1, 25, 25,  3,  3, 26, 26,
-     9,  9, 27, 27, 28, 28, 33, 29,  4, 33, 29,  1,  4,  1, 32, 32,
-     2,  2, 31, 10, 30, 10, 30, 31, 34, 34,  5,  5, 36, 36, 35, 41,
-    35, 11, 41, 11, 37,  1,  8,  8, 37,  6,  1,  6, 40,  7,  7, 40,
-    12, 38, 12, 39, 39, 38, 49, 13, 49, 13,  3, 42,  3, 42, 16, 16,
-    43, 43, 14, 14,  1,  1, 44, 15, 44, 15,  2,  2, 57, 48, 50, 48,
-    57, 50,  4, 45, 45,  4, 46, 47, 47, 46,  1, 51,  1, 17, 17, 51,
-     8,  9,  9,  5, 58,  8, 58,  5, 52, 52, 55, 56, 53, 56, 55, 59,
-    59, 53, 54,  1,  6, 54,  7,  7,  6,  1,  2,  3,  2,  3, 64, 60,
-    60, 10, 10, 64, 61, 62, 61, 63,  1, 63, 62,  1, 18, 24, 18,  4,
-    25,  4,  8, 21, 21,  1, 24, 22, 25, 22,  8, 11, 19, 11, 23,  1,
-    20, 23, 19, 20,  5, 12,  5,  1, 16,  2, 12, 13,  2, 13,  1, 16},
-
-    /* value table */
-    { 0,   1,  -1,   1,  -1,   1,  -1,   1,  -1,   2,  -2,   1,  -1,   1,  -1,   1,
-     -1,   1,  -1,   1,  -1,   2,  -2,   1,  -1,   3,  -3,   1,  -1,   1,  -1,   2,
-     -2,   1,  -1,   0,   1,  -1,   1,   1,  -1,  -1,   2,  -2,   1,   4,  -1,  -4,
-      2,  -2,   1,  -1,  -3,   3,   2,  -2,   2,   1,   2,  -2,  -2,  -1,   1,  -1,
-      1,  -1,   1,   1,  -1,  -1,   1,  -1,   5,  -5,   1,  -1,   3,  -3,   1,  -1,
-      2,  -2,   1,  -1,   1,  -1,   1,   1,   3,  -1,  -1,   6,  -3,  -6,  -1,   1,
-      4,  -4,   1,   2,   1,  -2,  -1,  -1,   1,  -1,   3,  -3,   1,  -1,   1,   1,
-     -1,   2,  -1,  -2,   1,   7,  -3,   3,  -1,   3,  -7,  -3,   1,  -3,   3,  -1,
-      2,   1,  -2,   1,  -1,  -1,   1,   2,  -1,  -2,  -4,  -1,   4,   1,   2,  -2,
-      1,  -1,  -2,   2,   8,  -8,  -1,   2,   1,  -2,  -5,   5,   1,  -1,  -1,   1,
-     -1,   1,   4,  -1,   1,  -4,  -1,  -1,   1,   1,   9,   1,  -9,   2,  -2,  -1,
-     -4,   3,  -3,  -4,  -1,   4,   1,   4,   1,  -1,   1,  -1,   1,   1,  -1,   1,
-     -1,  -1,  -1,  10,   4,   1,   4,  -4,  -4, -10,   6,   5,  -6,  -5,   1,  -1,
-      1,   3,  -3,  -1,   1,  -1,  -1,  -1,  11,   1,   1, -11,  -2,  -2,   2,   5,
-     -2,  -5,  -5,   2,  -2,  12,   2,  -2,   2,   2,   5,  -3,  -2,   3,  -2, -12,
-     -2,   2,   2,   2,  -5,   3,   5,  13,  -3,   7,  -3,  -3,  -7,   3, -13,   3}
-},{
-    /* MapTab4 */
-    0,  /* eob_sym */
-    34, /* esc_sym */
-    /* run table */
-    {0,  1,  1,  1,  2,  2,  1,  3,  3,  1,  1,  1,  4,  4,  1,  5,
-     2,  1,  5,  2,  1,  1,  6,  6,  1,  1,  1,  1,  1,  7,  3,  1,
-     2,  3,  0,  1,  2,  7,  1,  1,  1,  8,  1,  1,  8,  1,  1,  1,
-     9,  1,  9,  1,  2,  1,  1,  2,  1,  1, 10,  4,  1, 10,  1,  4,
-     1,  1,  1,  1,  1,  3,  1,  1,  1,  3,  2,  1,  5,  1,  1,  1,
-     2,  5,  1, 11,  1, 11,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-     2,  1,  6,  1,  6,  1,  1,  2,  1,  1,  1,  1,  1,  1,  1, 12,
-     3,  1, 12,  1,  1,  1,  2,  1,  1,  3,  1,  1,  1,  1,  1,  1,
-     4,  1,  1,  1,  2,  1,  1,  4,  1,  1,  1,  1,  1,  1,  2,  1,
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  3,  1,  2,  1,  1,  5,
-     1,  1,  1,  1,  1,  7,  1,  7,  1,  1,  2,  3,  1,  1,  1,  1,
-     5,  1,  1,  1,  1,  1,  1,  2, 13,  1,  1,  1,  1,  1,  1,  1,
-     1,  1,  1,  1,  1,  1,  1,  1, 13,  2,  1,  1,  4,  1,  1,  1,
-     3,  1,  6,  1,  1,  1, 14,  1,  1,  1,  1,  1, 14,  6,  1,  1,
-     1,  1, 15,  2,  4,  1,  2,  3, 15,  1,  1,  1,  8,  1,  1,  8,
-     1,  1,  1,  1,  1,  1,  1,  1,  2,  1,  1,  1,  1,  1,  1,  1},
-
-    /* value table */
-    { 0,   1,  -1,   2,   1,  -1,  -2,   1,  -1,   3,  -3,   4,   1,  -1,  -4,   1,
-      2,   5,  -1,  -2,  -5,   6,   1,  -1,  -6,   7,  -7,   8,  -8,   1,   2,   9,
-      3,  -2,   0,  -9,  -3,  -1,  10, -10,  11,   1, -11,  12,  -1, -12,  13, -13,
-      1,  14,  -1, -14,   4,  15, -15,  -4,  16, -16,   1,   2,  17,  -1, -17,  -2,
-     18, -18,  19, -19,  20,   3, -20,  21, -21,  -3,   5,  22,   2, -22, -23,  23,
-     -5,  -2,  24,   1, -24,  -1,  25, -25,  26, -26, -27,  27,  28,  29, -28, -29,
-      6,  30,   2, -31,  -2, -30,  31,  -6, -32,  32,  33, -33,  34, -35, -34,   1,
-      4, -36,  -1,  35,  37,  36,   7, -37,  38,  -4, -38,  39,  41,  40, -40, -39,
-      3,  42, -43, -41,  -7, -42,  43,  -3,  44, -44,  45, -45,  46,  47,   8, -47,
-    -48, -46,  50, -50,  48,  49,  51, -49,  52, -52,   5, -51,  -8, -53,  53,   3,
-    -56,  56,  55,  54, -54,   2,  60,  -2, -55,  58,   9,  -5,  59,  57, -57, -63,
-     -3, -58, -60, -61,  61, -59, -62,  -9,   1,  64,  62,  69, -64,  63,  65, -67,
-    -68,  66, -65,  68, -66, -69,  67, -70,  -1,  10,  71, -71,   4,  73,  72,  70,
-      6, -76,  -3,  74, -78, -74,   1,  78,  80, -72, -75,  76,  -1,   3, -73,  79,
-     75,  77,   1,  11,  -4, -79, -10,  -6,  -1, -77, -83, -80,   2,  81, -84,  -2,
-     83, -81,  82, -82,  84, -87, -86,  85, -11, -85,  86, -89,  87, -88,  88,  89}
-},{
-    /* MapTab5 */
-    2,  /* eob_sym */
-    33, /* esc_sym */
-    /* run table */
-    {1,  1,  0,  2,  1,  2,  1,  3,  3,  1,  1,  4,  4,  2,  2,  1,
-     1,  5,  5,  6,  1,  6,  1,  7,  7,  3,  3,  2,  8,  2,  8,  1,
-     1,  0,  9,  9,  1,  1, 10,  4, 10,  4, 11, 11,  2,  1,  2,  1,
-    12, 12,  3,  3,  1,  1, 13,  5,  5, 13, 14,  1,  1, 14,  2,  2,
-     6,  6, 15,  1,  1, 15, 16,  4,  7, 16,  4,  7,  1,  1,  3,  3,
-     8,  8,  2,  2,  1,  1, 17, 17,  1,  1, 18, 18,  5,  5,  2,  2,
-     1,  1,  9, 19,  9, 19, 20,  3,  3, 20,  1, 10, 21,  1, 10,  4,
-     4, 21, 22,  6,  6, 22,  1,  1, 23, 24,  2,  2, 23, 24, 11,  1,
-     1, 11,  7, 25,  7,  1,  1, 25,  8,  8,  3, 26,  3,  1, 12,  2,
-     2, 26,  1, 12,  5,  5, 27,  4,  1,  4,  1, 27, 28,  1, 28, 13,
-     1, 13,  2, 29,  2,  1, 32,  6,  1, 30, 14, 29, 14,  6,  3, 31,
-     3,  1, 30,  1, 32, 31, 33,  9, 33,  1,  1,  7,  9,  7,  2,  2,
-     1,  1,  4, 36, 34,  4,  5, 10, 10,  5, 34,  1,  1, 35,  8,  8,
-    36,  3, 35,  1, 15,  3,  2,  1, 16, 15, 16,  2, 37,  1, 37,  1,
-     1,  1,  6,  6, 38,  1, 38, 11,  1, 39, 39, 40, 11,  2, 41,  4,
-    40,  1,  2,  4,  1,  1,  1, 41,  3,  1,  3,  1,  5,  7,  5,  7},
-
-    /* value table */
-    { 1,  -1,   0,   1,   2,  -1,  -2,   1,  -1,   3,  -3,   1,  -1,   2,  -2,   4,
-     -4,   1,  -1,   1,   5,  -1,  -5,   1,  -1,   2,  -2,   3,   1,  -3,  -1,   6,
-     -6,   0,   1,  -1,   7,  -7,   1,   2,  -1,  -2,   1,  -1,   4,   8,  -4,  -8,
-      1,  -1,   3,  -3,   9,  -9,   1,   2,  -2,  -1,   1,  10, -10,  -1,   5,  -5,
-      2,  -2,   1,  11, -11,  -1,   1,   3,   2,  -1,  -3,  -2,  12, -12,   4,  -4,
-      2,  -2,  -6,   6,  13, -13,   1,  -1,  14, -14,   1,  -1,   3,  -3,   7,  -7,
-     15, -15,   2,   1,  -2,  -1,   1,   5,  -5,  -1, -16,   2,   1,  16,  -2,   4,
-     -4,  -1,   1,   3,  -3,  -1,  17, -17,   1,   1,  -8,   8,  -1,  -1,   2,  18,
-    -18,  -2,   3,   1,  -3,  19, -19,  -1,   3,  -3,   6,   1,  -6,  20,   2,   9,
-     -9,  -1, -20,  -2,   4,  -4,   1,  -5,  21,   5, -21,  -1,   1, -22,  -1,   2,
-     22,  -2,  10,   1, -10,  23,   1,   4, -23,   1,   2,  -1,  -2,  -4,  -7,   1,
-      7, -24,  -1,  24,  -1,  -1,   1,   3,  -1, -25,  25,   4,  -3,  -4,  11, -11,
-     26, -26,   6,   1,   1,  -6,  -5,  -3,   3,   5,  -1, -27,  27,   1,   4,  -4,
-     -1,  -8,  -1,  28,   2,   8, -12, -28,  -2,  -2,   2,  12,  -1,  29,   1, -29,
-     30, -30,   5,  -5,   1, -31,  -1,   3,  31,  -1,   1,   1,  -3, -13,   1,  -7,
-     -1, -32,  13,   7,  32,  33, -33,  -1,  -9, -34,   9,  34,  -6,   5,   6,  -5}
-},{
-    /* MapTab6 */
-    2,  /* eob_sym */
-    13, /* esc_sym */
-    /* run table */
-    {1,  1,  0,  1,  1,  2,  2,  1,  1,  3,  3,  1,  1,  0,  2,  2,
-     4,  1,  4,  1,  1,  1,  5,  5,  1,  1,  6,  6,  2,  2,  1,  1,
-     3,  3,  7,  7,  1,  1,  8,  8,  1,  1,  2,  2,  1,  9,  1,  9,
-     4,  4, 10,  1,  1, 10,  1,  1, 11, 11,  3,  3,  1,  2,  1,  2,
-     1,  1, 12, 12,  5,  5,  1,  1, 13,  1,  1, 13,  2,  2,  1,  1,
-     6,  6,  1,  1,  4, 14,  4, 14,  3,  1,  3,  1,  1,  1, 15,  7,
-    15,  2,  2,  7,  1,  1,  1,  8,  1,  8, 16, 16,  1,  1,  1,  1,
-     2,  1,  1,  2,  1,  1,  3,  5,  5,  3,  4,  1,  1,  4,  1,  1,
-    17, 17,  9,  1,  1,  9,  2,  2,  1,  1, 10, 10,  1,  6,  1,  1,
-     6, 18,  1,  1, 18,  1,  1,  1,  2,  2,  3,  1,  3,  1,  1,  1,
-     4,  1, 19,  1, 19,  7,  1,  1, 20,  1,  4, 20,  1,  7, 11,  2,
-     1, 11, 21,  2,  8,  5,  1,  8,  1,  5, 21,  1,  1,  1, 22,  1,
-     1, 22,  1,  1,  3,  3,  1, 23,  2, 12, 24,  1,  1,  2,  1,  1,
-    12, 23,  1,  1, 24,  1,  1,  1,  4,  1,  1,  1,  2,  1,  6,  6,
-     4,  2,  1,  1,  1,  1,  1,  1,  1, 14, 13,  3,  1, 25,  9, 25,
-    14,  1,  9,  3, 13,  1,  1,  1,  1,  1, 10,  1,  1,  2, 10,  2},
-
-    /* value table */
-    {-20,  -1,   0,   2,  -2,   1,  -1,   3,  -3,   1,  -1,   4,  -4,   0,   2,  -2,
-       1,   5,  -1,  -5,   6,  -6,   1,  -1,   7,  -7,   1,  -1,   3,  -3,   8,  -8,
-       2,  -2,   1,  -1,   9,  -9,   1,  -1,  10, -10,   4,  -4,  11,   1, -11,  -1,
-       2,  -2,   1,  12, -12,  -1,  13, -13,   1,  -1,   3,  -3,  14,   5, -14,  -5,
-     -15,  15,  -1,   1,   2,  -2,  16, -16,   1,  17, -17,  -1,   6,  -6,  18, -18,
-       2,  -2, -19,  19,  -3,   1,   3,  -1,   4,  20,  -4,   1, -21,  21,   1,   2,
-      -1,  -7,   7,  -2,  22, -22,  23,   2, -23,  -2,   1,  -1, -24,  24, -25,  25,
-      -8, -26,  26,   8, -27,  27,   5,   3,  -3,  -5,  -4,  28, -28,   4,  29, -29,
-       1,  -1,  -2, -30,  30,   2,   9,  -9, -31,  31,   2,  -2, -32,   3,  32, -33,
-      -3,   1,  33, -34,  -1,  34, -35,  35, -10,  10,  -6,  36,   6, -36,  37, -37,
-      -5,  38,   1, -38,  -1,   3,  39, -39,  -1,  40,   5,   1, -40,  -3,   2, -11,
-     -41,  -2,   1,  11,  -3,  -4,  41,   3,  42,   4,  -1, -43, -42,  43,   1, -44,
-      45,  -1,  44, -45,  -7,   7, -46,   1, -12,   2,   1, -47,  46,  12,  47,  48,
-      -2,  -1, -48,  49,  -1, -50, -49,  50,  -6, -51,  51,  52, -13,  53,  -4,   4,
-       6,  13, -53, -52, -54,  55,  54, -55, -56,  -2,   2,  -8,  56,   1,  -3,  -1,
-       2,  58,   3,   8,  -2,  57, -58, -60, -59, -57,  -3,  60,  59, -14,   3,  14}
-},{
-    /* MapTab7 */
-    2,  /* eob_sym */
-    38, /* esc_sym */
-    /* run table */
-    {1,  1,  0,  2,  2,  1,  1,  3,  3,  4,  4,  5,  5,  1,  1,  6,
-     6,  2,  2,  7,  7,  8,  8,  1,  1,  3,  3,  9,  9, 10, 10,  1,
-     1,  2,  2,  4,  4, 11,  0, 11, 12, 12, 13, 13,  1,  1,  5,  5,
-    14, 14, 15, 16, 15, 16,  3,  3,  1,  6,  1,  6,  2,  2,  7,  7,
-     8,  8, 17, 17,  1,  1,  4,  4, 18, 18,  2,  2,  1, 19,  1, 20,
-    19, 20, 21, 21,  3,  3, 22, 22,  5,  5, 24,  1,  1, 23,  9, 23,
-    24,  9,  2,  2, 10,  1,  1, 10,  6,  6, 25,  4,  4, 25,  7,  7,
-    26,  8,  1,  8,  3,  1, 26,  3, 11, 11, 27, 27,  2, 28,  1,  2,
-    28,  1, 12, 12,  5,  5, 29, 13, 13, 29, 32,  1,  1, 33, 31, 30,
-    32,  4, 30, 33,  4, 31,  3, 14,  1,  1,  3, 34, 34,  2,  2, 14,
-     6,  6, 35, 36, 35, 36,  1, 15,  1, 16, 16, 15,  7,  9,  7,  9,
-    37,  8,  8, 37,  1,  1, 39,  2, 38, 39,  2, 40,  5, 38, 40,  5,
-     3,  3,  4,  4, 10, 10,  1,  1,  1,  1, 41,  2, 41,  2,  6,  6,
-     1,  1, 11, 42, 11, 43,  3, 42,  3, 17,  4, 43,  1, 17,  7,  1,
-     8, 44,  4,  7, 44,  5,  8,  2,  5,  1,  2, 48, 45,  1, 12, 45,
-    12, 48, 13, 13,  1,  9,  9, 46,  1, 46, 47, 47, 49, 18, 18, 49},
-
-    /* value table */
-    { 1,  -1,   0,   1,  -1,   2,  -2,   1,  -1,   1,  -1,   1,  -1,   3,  -3,   1,
-     -1,  -2,   2,   1,  -1,   1,  -1,   4,  -4,  -2,   2,   1,  -1,   1,  -1,   5,
-     -5,  -3,   3,   2,  -2,   1,   0,  -1,   1,  -1,   1,  -1,   6,  -6,   2,  -2,
-      1,  -1,   1,   1,  -1,  -1,  -3,   3,   7,   2,  -7,  -2,  -4,   4,   2,  -2,
-      2,  -2,   1,  -1,   8,  -8,   3,  -3,   1,  -1,  -5,   5,   9,   1,  -9,   1,
-     -1,  -1,   1,  -1,  -4,   4,   1,  -1,   3,  -3,   1, -10,  10,   1,   2,  -1,
-     -1,  -2,   6,  -6,   2,  11, -11,  -2,   3,  -3,   1,  -4,   4,  -1,   3,  -3,
-      1,   3,  12,  -3,  -5, -12,  -1,   5,   2,  -2,   1,  -1,  -7,   1,  13,   7,
-     -1, -13,   2,  -2,   4,  -4,   1,   2,  -2,  -1,   1,  14, -14,   1,   1,   1,
-     -1,  -5,  -1,  -1,   5,  -1,  -6,   2, -15,  15,   6,   1,  -1,  -8,   8,  -2,
-     -4,   4,   1,   1,  -1,  -1,  16,   2, -16,  -2,   2,  -2,   4,   3,  -4,  -3,
-     -1,  -4,   4,   1, -17,  17,  -1,  -9,   1,   1,   9,   1,  -5,  -1,  -1,   5,
-     -7,   7,   6,  -6,   3,  -3,  18, -18,  19, -19,   1, -10,  -1,  10,  -5,   5,
-     20, -20,  -3,   1,   3,   1,   8,  -1,  -8,   2,   7,  -1, -21,  -2,   5,  21,
-      5,  -1,  -7,  -5,   1,  -6,  -5, -11,   6,  22,  11,   1,   1, -22,  -3,  -1,
-      3,  -1,   3,  -3, -23,   4,  -4,   1,  23,  -1,   1,  -1,   1,  -2,   2,  -1}
-},{
-    /* MapTab8 */
-    4,  /* eob_sym */
-    11, /* esc_sym */
-    /* run table */
-    {1,  1,  1,  1,  0,  2,  2,  1,  1,  3,  3,  0,  1,  1,  2,  2,
-     4,  4,  1,  1,  5,  5,  1,  1,  2,  2,  3,  3,  6,  6,  1,  1,
-     7,  7,  8,  1,  8,  2,  2,  1,  4,  4,  1,  3,  1,  3,  9,  9,
-     2,  2,  1,  5,  1,  5, 10, 10,  1,  1, 11, 11,  3,  6,  3,  4,
-     4,  6,  2,  2,  1, 12,  1, 12,  7, 13,  7, 13,  1,  1,  8,  8,
-     2,  2, 14, 14, 16, 15, 16,  5,  5,  1,  3, 15,  1,  3,  4,  4,
-     1,  1, 17, 17,  2,  2,  6,  6,  1, 18,  1, 18, 22, 21, 22, 21,
-    25, 24, 25, 19,  9, 20,  9, 23, 19, 24, 20,  3, 23,  7,  3,  1,
-     1,  7, 28, 26, 29,  5, 28, 26,  5,  8, 29,  4,  8, 27,  2,  2,
-     4, 27,  1,  1, 10, 36, 10, 33, 33, 36, 30,  1, 32, 32,  1, 30,
-     6, 31, 31, 35,  3,  6, 11, 11,  3,  2, 35,  2, 34,  1, 34,  1,
-    37, 37, 12,  7, 12,  5, 41,  5,  4,  7,  1,  8, 13,  4,  1, 41,
-    13, 38,  8, 38,  9,  1, 40, 40,  9,  1, 39,  2,  2, 49, 39, 42,
-     3,  3, 14, 16, 49, 14, 16, 42, 43, 43,  6,  6, 15,  1,  1, 15,
-    44, 44,  1,  1, 50, 48,  4,  5,  4,  7,  5,  2, 10, 10, 48,  7,
-    50, 45,  2,  1, 45,  8,  8,  1, 46, 46,  3, 47, 47,  3,  1,  1},
-
-    /* value table */
-    { 1,  -1,   2,  -2,   0,   1,  -1,   3,  -3,   1,  -1,   0,   4,  -4,   2,  -2,
-      1,  -1,   5,  -5,   1,  -1,   6,  -6,   3,  -3,   2,  -2,   1,  -1,   7,  -7,
-      1,  -1,   1,   8,  -1,   4,  -4,  -8,   2,  -2,   9,   3,  -9,  -3,   1,  -1,
-      5,  -5,  10,   2, -10,  -2,   1,  -1,  11, -11,   1,  -1,  -4,   2,   4,   3,
-     -3,  -2,   6,  -6,  12,   1, -12,  -1,   2,   1,  -2,  -1,  13, -13,   2,  -2,
-      7,  -7,   1,  -1,   1,   1,  -1,   3,  -3,  14,   5,  -1, -14,  -5,   4,  -4,
-     15, -15,   1,  -1,   8,  -8,  -3,   3,  16,   1, -16,  -1,   1,   1,  -1,  -1,
-      1,   1,  -1,   1,   2,   1,  -2,   1,  -1,  -1,  -1,   6,  -1,   3,  -6,  17,
-    -17,  -3,   1,   1,   1,   4,  -1,  -1,  -4,   3,  -1,   5,  -3,  -1,  -9,   9,
-     -5,   1,  18, -18,   2,   1,  -2,   1,  -1,  -1,   1,  19,  -1,   1, -19,  -1,
-      4,   1,  -1,   1,   7,  -4,  -2,   2,  -7,  10,  -1, -10,   1,  20,  -1, -20,
-      1,  -1,   2,   4,  -2,   5,   1,  -5,   6,  -4,  21,   4,   2,  -6, -21,  -1,
-     -2,   1,  -4,  -1,  -3,  22,  -1,   1,   3, -22,  -1,  11, -11,   1,   1,   1,
-      8,  -8,   2,   2,  -1,  -2,  -2,  -1,   1,  -1,  -5,   5,   2,  23, -23,  -2,
-      1,  -1,  24, -24,  -1,  -1,   7,   6,  -7,   5,  -6,  12,  -3,   3,   1,  -5,
-      1,   1, -12,  25,  -1,  -5,   5, -25,  -1,   1,   9,   1,  -1,  -9,  26, -26}
-}
-};
diff --git a/deps/libav/libavcodec/ivi_common.h b/deps/libav/libavcodec/ivi_common.h
deleted file mode 100644
index fb97c8d..0000000
--- a/deps/libav/libavcodec/ivi_common.h
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * common functions for Indeo Video Interactive codecs (Indeo4 and Indeo5)
- *
- * Copyright (c) 2009 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This file contains structures and macros shared by both Indeo4 and
- * Indeo5 decoders.
- */
-
-#ifndef AVCODEC_IVI_COMMON_H
-#define AVCODEC_IVI_COMMON_H
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include <stdint.h>
-
-#define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes
-#define IVI4_STREAM_ANALYSER    0
-#define IVI5_IS_PROTECTED       0x20
-
-/**
- *  huffman codebook descriptor
- */
-typedef struct IVIHuffDesc {
-    int32_t     num_rows;
-    uint8_t     xbits[16];
-} IVIHuffDesc;
-
-/**
- *  macroblock/block huffman table descriptor
- */
-typedef struct IVIHuffTab {
-    int32_t     tab_sel;    /// index of one of the predefined tables
-                            /// or "7" for custom one
-    VLC         *tab;       /// pointer to the table associated with tab_sel
-
-    /// the following are used only when tab_sel == 7
-    IVIHuffDesc cust_desc;  /// custom Huffman codebook descriptor
-    VLC         cust_tab;   /// vlc table for custom codebook
-} IVIHuffTab;
-
-enum {
-    IVI_MB_HUFF   = 0,      /// Huffman table is used for coding macroblocks
-    IVI_BLK_HUFF  = 1       /// Huffman table is used for coding blocks
-};
-
-
-/**
- *  Common scan patterns (defined in ivi_common.c)
- */
-extern const uint8_t ff_ivi_vertical_scan_8x8[64];
-extern const uint8_t ff_ivi_horizontal_scan_8x8[64];
-extern const uint8_t ff_ivi_direct_scan_4x4[16];
-
-
-/**
- *  Declare inverse transform function types
- */
-typedef void (InvTransformPtr)(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags);
-typedef void (DCTransformPtr) (const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
-
-
-/**
- *  run-value (RLE) table descriptor
- */
-typedef struct RVMapDesc {
-    uint8_t     eob_sym; ///< end of block symbol
-    uint8_t     esc_sym; ///< escape symbol
-    uint8_t     runtab[256];
-    int8_t      valtab[256];
-} RVMapDesc;
-
-extern const RVMapDesc ff_ivi_rvmap_tabs[9];
-
-
-/**
- *  information for Indeo macroblock (16x16, 8x8 or 4x4)
- */
-typedef struct IVIMbInfo {
-    int16_t     xpos;
-    int16_t     ypos;
-    uint32_t    buf_offs; ///< address in the output buffer for this mb
-    uint8_t     type;     ///< macroblock type: 0 - INTRA, 1 - INTER
-    uint8_t     cbp;      ///< coded block pattern
-    int8_t      q_delta;  ///< quant delta
-    int8_t      mv_x;     ///< motion vector (x component)
-    int8_t      mv_y;     ///< motion vector (y component)
-} IVIMbInfo;
-
-
-/**
- *  information for Indeo tile
- */
-typedef struct IVITile {
-    int         xpos;
-    int         ypos;
-    int         width;
-    int         height;
-    int         mb_size;
-    int         is_empty;  ///< = 1 if this tile doesn't contain any data
-    int         data_size; ///< size of the data in bytes
-    int         num_MBs;   ///< number of macroblocks in this tile
-    IVIMbInfo   *mbs;      ///< array of macroblock descriptors
-    IVIMbInfo   *ref_mbs;  ///< ptr to the macroblock descriptors of the reference tile
-} IVITile;
-
-
-/**
- *  information for Indeo wavelet band
- */
-typedef struct IVIBandDesc {
-    int             plane;          ///< plane number this band belongs to
-    int             band_num;       ///< band number
-    int             width;
-    int             height;
-    int             aheight;        ///< aligned band height
-    const uint8_t   *data_ptr;      ///< ptr to the first byte of the band data
-    int             data_size;      ///< size of the band data
-    int16_t         *buf;           ///< pointer to the output buffer for this band
-    int16_t         *ref_buf;       ///< pointer to the reference frame buffer (for motion compensation)
-    int16_t         *bufs[3];       ///< array of pointers to the band buffers
-    int             pitch;          ///< pitch associated with the buffers above
-    int             is_empty;       ///< = 1 if this band doesn't contain any data
-    int             mb_size;        ///< macroblock size
-    int             blk_size;       ///< block size
-    int             is_halfpel;     ///< precision of the motion compensation: 0 - fullpel, 1 - halfpel
-    int             inherit_mv;     ///< tells if motion vector is inherited from reference macroblock
-    int             inherit_qdelta; ///< tells if quantiser delta is inherited from reference macroblock
-    int             qdelta_present; ///< tells if Qdelta signal is present in the bitstream (Indeo5 only)
-    int             quant_mat;      ///< dequant matrix index
-    int             glob_quant;     ///< quant base for this band
-    const uint8_t   *scan;          ///< ptr to the scan pattern
-
-    IVIHuffTab      blk_vlc;        ///< vlc table for decoding block data
-
-    int             num_corr;       ///< number of correction entries
-    uint8_t         corr[61*2];     ///< rvmap correction pairs
-    int             rvmap_sel;      ///< rvmap table selector
-    RVMapDesc       *rv_map;        ///< ptr to the RLE table for this band
-    int             num_tiles;      ///< number of tiles in this band
-    IVITile         *tiles;         ///< array of tile descriptors
-    InvTransformPtr *inv_transform;
-    int             transform_size;
-    DCTransformPtr  *dc_transform;
-    int             is_2d_trans;    ///< 1 indicates that the two-dimensional inverse transform is used
-    int32_t         checksum;       ///< for debug purposes
-    int             checksum_present;
-    int             bufsize;        ///< band buffer size in bytes
-    const uint16_t  *intra_base;    ///< quantization matrix for intra blocks
-    const uint16_t  *inter_base;    ///< quantization matrix for inter blocks
-    const uint8_t   *intra_scale;   ///< quantization coefficient for intra blocks
-    const uint8_t   *inter_scale;   ///< quantization coefficient for inter blocks
-} IVIBandDesc;
-
-
-/**
- *  color plane (luma or chroma) information
- */
-typedef struct IVIPlaneDesc {
-    uint16_t    width;
-    uint16_t    height;
-    uint8_t     num_bands;  ///< number of bands this plane subdivided into
-    IVIBandDesc *bands;     ///< array of band descriptors
-} IVIPlaneDesc;
-
-
-typedef struct IVIPicConfig {
-    uint16_t    pic_width;
-    uint16_t    pic_height;
-    uint16_t    chroma_width;
-    uint16_t    chroma_height;
-    uint16_t    tile_width;
-    uint16_t    tile_height;
-    uint8_t     luma_bands;
-    uint8_t     chroma_bands;
-} IVIPicConfig;
-
-typedef struct IVI45DecContext {
-    GetBitContext   gb;
-    RVMapDesc       rvmap_tabs[9];   ///< local corrected copy of the static rvmap tables
-
-    uint32_t        frame_num;
-    int             frame_type;
-    int             prev_frame_type; ///< frame type of the previous frame
-    uint32_t        data_size;       ///< size of the frame data in bytes from picture header
-    int             is_scalable;
-    int             transp_status;   ///< transparency mode status: 1 - enabled
-    const uint8_t   *frame_data;     ///< input frame data pointer
-    int             inter_scal;      ///< signals a sequence of scalable inter frames
-    uint32_t        frame_size;      ///< frame size in bytes
-    uint32_t        pic_hdr_size;    ///< picture header size in bytes
-    uint8_t         frame_flags;
-    uint16_t        checksum;        ///< frame checksum
-
-    IVIPicConfig    pic_conf;
-    IVIPlaneDesc    planes[3];       ///< color planes
-
-    int             buf_switch;      ///< used to switch between three buffers
-    int             dst_buf;         ///< buffer index for the currently decoded frame
-    int             ref_buf;         ///< inter frame reference buffer index
-    int             ref2_buf;        ///< temporal storage for switching buffers
-
-    IVIHuffTab      mb_vlc;          ///< current macroblock table descriptor
-    IVIHuffTab      blk_vlc;         ///< current block table descriptor
-
-    uint8_t         rvmap_sel;
-    uint8_t         in_imf;
-    uint8_t         in_q;            ///< flag for explicitly stored quantiser delta
-    uint8_t         pic_glob_quant;
-    uint8_t         unknown1;
-
-    uint16_t        gop_hdr_size;
-    uint8_t         gop_flags;
-    uint32_t        lock_word;
-
-#if IVI4_STREAM_ANALYSER
-    uint8_t         has_b_frames;
-    uint8_t         has_transp;
-    uint8_t         uses_tiling;
-    uint8_t         uses_haar;
-    uint8_t         uses_fullpel;
-#endif
-
-    int             (*decode_pic_hdr)  (struct IVI45DecContext *ctx, AVCodecContext *avctx);
-    int             (*decode_band_hdr) (struct IVI45DecContext *ctx, IVIBandDesc *band, AVCodecContext *avctx);
-    int             (*decode_mb_info)  (struct IVI45DecContext *ctx, IVIBandDesc *band, IVITile *tile, AVCodecContext *avctx);
-    void            (*switch_buffers)  (struct IVI45DecContext *ctx);
-    int             (*is_nonnull_frame)(struct IVI45DecContext *ctx);
-
-    int gop_invalid;
-} IVI45DecContext;
-
-/** compare some properties of two pictures */
-static inline int ivi_pic_config_cmp(IVIPicConfig *str1, IVIPicConfig *str2)
-{
-    return str1->pic_width    != str2->pic_width    || str1->pic_height    != str2->pic_height    ||
-           str1->chroma_width != str2->chroma_width || str1->chroma_height != str2->chroma_height ||
-           str1->tile_width   != str2->tile_width   || str1->tile_height   != str2->tile_height   ||
-           str1->luma_bands   != str2->luma_bands   || str1->chroma_bands  != str2->chroma_bands;
-}
-
-/** calculate number of tiles in a stride */
-#define IVI_NUM_TILES(stride, tile_size) (((stride) + (tile_size) - 1) / (tile_size))
-
-/** calculate number of macroblocks in a tile */
-#define IVI_MBs_PER_TILE(tile_width, tile_height, mb_size) \
-    ((((tile_width) + (mb_size) - 1) / (mb_size)) * (((tile_height) + (mb_size) - 1) / (mb_size)))
-
-/** convert unsigned values into signed ones (the sign is in the LSB) */
-#define IVI_TOSIGNED(val) (-(((val) >> 1) ^ -((val) & 1)))
-
-/** scale motion vector */
-static inline int ivi_scale_mv(int mv, int mv_scale)
-{
-    return (mv + (mv > 0) + (mv_scale - 1)) >> mv_scale;
-}
-
-/**
- * Initialize static codes used for macroblock and block decoding.
- */
-void ff_ivi_init_static_vlc(void);
-
-/**
- *  Decode a huffman codebook descriptor from the bitstream
- *  and select specified huffman table.
- *
- *  @param[in,out]  gb          the GetBit context
- *  @param[in]      desc_coded  flag signalling if table descriptor was coded
- *  @param[in]      which_tab   codebook purpose (IVI_MB_HUFF or IVI_BLK_HUFF)
- *  @param[out]     huff_tab    pointer to the descriptor of the selected table
- *  @param[in]      avctx       AVCodecContext pointer
- *  @return             zero on success, negative value otherwise
- */
-int  ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab,
-                          IVIHuffTab *huff_tab, AVCodecContext *avctx);
-
-/**
- *  Initialize planes (prepares descriptors, allocates buffers etc).
- *
- *  @param[in,out]  planes  pointer to the array of the plane descriptors
- *  @param[in]      cfg     pointer to the ivi_pic_config structure describing picture layout
- *  @return             result code: 0 - OK
- */
-int  ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg);
-
-/**
- *  Initialize tile and macroblock descriptors.
- *
- *  @param[in,out]  planes       pointer to the array of the plane descriptors
- *  @param[in]      tile_width   tile width
- *  @param[in]      tile_height  tile height
- *  @return             result code: 0 - OK
- */
-int  ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height);
-
-int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt);
-int ff_ivi_decode_close(AVCodecContext *avctx);
-
-#endif /* AVCODEC_IVI_COMMON_H */
diff --git a/deps/libav/libavcodec/ivi_dsp.c b/deps/libav/libavcodec/ivi_dsp.c
deleted file mode 100644
index bd1f523..0000000
--- a/deps/libav/libavcodec/ivi_dsp.c
+++ /dev/null
@@ -1,805 +0,0 @@
-/*
- * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5)
- *
- * Copyright (c) 2009-2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DSP functions (inverse transforms, motion compensation, wavelet recompostions)
- * for Indeo Video Interactive codecs.
- */
-
-#include "avcodec.h"
-#include "ivi_common.h"
-#include "ivi_dsp.h"
-
-void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
-                        const int dst_pitch)
-{
-    int             x, y, indx;
-    int32_t         p0, p1, p2, p3, tmp0, tmp1, tmp2;
-    int32_t         b0_1, b0_2, b1_1, b1_2, b1_3, b2_1, b2_2, b2_3, b2_4, b2_5, b2_6;
-    int32_t         b3_1, b3_2, b3_3, b3_4, b3_5, b3_6, b3_7, b3_8, b3_9;
-    int32_t         pitch, back_pitch;
-    const short    *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr;
-    const int       num_bands = 4;
-
-    /* all bands should have the same pitch */
-    pitch = plane->bands[0].pitch;
-
-    /* pixels at the position "y-1" will be set to pixels at the "y" for the 1st iteration */
-    back_pitch = 0;
-
-    /* get pointers to the wavelet bands */
-    b0_ptr = plane->bands[0].buf;
-    b1_ptr = plane->bands[1].buf;
-    b2_ptr = plane->bands[2].buf;
-    b3_ptr = plane->bands[3].buf;
-
-    for (y = 0; y < plane->height; y += 2) {
-        /* load storage variables with values */
-        if (num_bands > 0) {
-            b0_1 = b0_ptr[0];
-            b0_2 = b0_ptr[pitch];
-        }
-
-        if (num_bands > 1) {
-            b1_1 = b1_ptr[back_pitch];
-            b1_2 = b1_ptr[0];
-            b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch];
-        }
-
-        if (num_bands > 2) {
-            b2_2 = b2_ptr[0];     // b2[x,  y  ]
-            b2_3 = b2_2;          // b2[x+1,y  ] = b2[x,y]
-            b2_5 = b2_ptr[pitch]; // b2[x  ,y+1]
-            b2_6 = b2_5;          // b2[x+1,y+1] = b2[x,y+1]
-        }
-
-        if (num_bands > 3) {
-            b3_2 = b3_ptr[back_pitch]; // b3[x  ,y-1]
-            b3_3 = b3_2;               // b3[x+1,y-1] = b3[x  ,y-1]
-            b3_5 = b3_ptr[0];          // b3[x  ,y  ]
-            b3_6 = b3_5;               // b3[x+1,y  ] = b3[x  ,y  ]
-            b3_8 = b3_2 - b3_5*6 + b3_ptr[pitch];
-            b3_9 = b3_8;
-        }
-
-        for (x = 0, indx = 0; x < plane->width; x+=2, indx++) {
-            /* some values calculated in the previous iterations can */
-            /* be reused in the next ones, so do appropriate copying */
-            b2_1 = b2_2; // b2[x-1,y  ] = b2[x,  y  ]
-            b2_2 = b2_3; // b2[x  ,y  ] = b2[x+1,y  ]
-            b2_4 = b2_5; // b2[x-1,y+1] = b2[x  ,y+1]
-            b2_5 = b2_6; // b2[x  ,y+1] = b2[x+1,y+1]
-            b3_1 = b3_2; // b3[x-1,y-1] = b3[x  ,y-1]
-            b3_2 = b3_3; // b3[x  ,y-1] = b3[x+1,y-1]
-            b3_4 = b3_5; // b3[x-1,y  ] = b3[x  ,y  ]
-            b3_5 = b3_6; // b3[x  ,y  ] = b3[x+1,y  ]
-            b3_7 = b3_8; // vert_HPF(x-1)
-            b3_8 = b3_9; // vert_HPF(x  )
-
-            p0 = p1 = p2 = p3 = 0;
-
-            /* process the LL-band by applying LPF both vertically and horizontally */
-            if (num_bands > 0) {
-                tmp0 = b0_1;
-                tmp2 = b0_2;
-                b0_1 = b0_ptr[indx+1];
-                b0_2 = b0_ptr[pitch+indx+1];
-                tmp1 = tmp0 + b0_1;
-
-                p0 =  tmp0 << 4;
-                p1 =  tmp1 << 3;
-                p2 = (tmp0 + tmp2) << 3;
-                p3 = (tmp1 + tmp2 + b0_2) << 2;
-            }
-
-            /* process the HL-band by applying HPF vertically and LPF horizontally */
-            if (num_bands > 1) {
-                tmp0 = b1_2;
-                tmp1 = b1_1;
-                b1_2 = b1_ptr[indx+1];
-                b1_1 = b1_ptr[back_pitch+indx+1];
-
-                tmp2 = tmp1 - tmp0*6 + b1_3;
-                b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch+indx+1];
-
-                p0 += (tmp0 + tmp1) << 3;
-                p1 += (tmp0 + tmp1 + b1_1 + b1_2) << 2;
-                p2 +=  tmp2 << 2;
-                p3 += (tmp2 + b1_3) << 1;
-            }
-
-            /* process the LH-band by applying LPF vertically and HPF horizontally */
-            if (num_bands > 2) {
-                b2_3 = b2_ptr[indx+1];
-                b2_6 = b2_ptr[pitch+indx+1];
-
-                tmp0 = b2_1 + b2_2;
-                tmp1 = b2_1 - b2_2*6 + b2_3;
-
-                p0 += tmp0 << 3;
-                p1 += tmp1 << 2;
-                p2 += (tmp0 + b2_4 + b2_5) << 2;
-                p3 += (tmp1 + b2_4 - b2_5*6 + b2_6) << 1;
-            }
-
-            /* process the HH-band by applying HPF both vertically and horizontally */
-            if (num_bands > 3) {
-                b3_6 = b3_ptr[indx+1];            // b3[x+1,y  ]
-                b3_3 = b3_ptr[back_pitch+indx+1]; // b3[x+1,y-1]
-
-                tmp0 = b3_1 + b3_4;
-                tmp1 = b3_2 + b3_5;
-                tmp2 = b3_3 + b3_6;
-
-                b3_9 = b3_3 - b3_6*6 + b3_ptr[pitch+indx+1];
-
-                p0 += (tmp0 + tmp1) << 2;
-                p1 += (tmp0 - tmp1*6 + tmp2) << 1;
-                p2 += (b3_7 + b3_8) << 1;
-                p3 +=  b3_7 - b3_8*6 + b3_9;
-            }
-
-            /* output four pixels */
-            dst[x]             = av_clip_uint8((p0 >> 6) + 128);
-            dst[x+1]           = av_clip_uint8((p1 >> 6) + 128);
-            dst[dst_pitch+x]   = av_clip_uint8((p2 >> 6) + 128);
-            dst[dst_pitch+x+1] = av_clip_uint8((p3 >> 6) + 128);
-        }// for x
-
-        dst += dst_pitch << 1;
-
-        back_pitch = -pitch;
-
-        b0_ptr += pitch;
-        b1_ptr += pitch;
-        b2_ptr += pitch;
-        b3_ptr += pitch;
-    }
-}
-
-void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
-                           const int dst_pitch)
-{
-    int             x, y, indx, b0, b1, b2, b3, p0, p1, p2, p3;
-    const short    *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr;
-    int32_t         pitch;
-
-    /* all bands should have the same pitch */
-    pitch = plane->bands[0].pitch;
-
-    /* get pointers to the wavelet bands */
-    b0_ptr = plane->bands[0].buf;
-    b1_ptr = plane->bands[1].buf;
-    b2_ptr = plane->bands[2].buf;
-    b3_ptr = plane->bands[3].buf;
-
-    for (y = 0; y < plane->height; y += 2) {
-        for (x = 0, indx = 0; x < plane->width; x += 2, indx++) {
-            /* load coefficients */
-            b0 = b0_ptr[indx]; //should be: b0 = (num_bands > 0) ? b0_ptr[indx] : 0;
-            b1 = b1_ptr[indx]; //should be: b1 = (num_bands > 1) ? b1_ptr[indx] : 0;
-            b2 = b2_ptr[indx]; //should be: b2 = (num_bands > 2) ? b2_ptr[indx] : 0;
-            b3 = b3_ptr[indx]; //should be: b3 = (num_bands > 3) ? b3_ptr[indx] : 0;
-
-            /* haar wavelet recomposition */
-            p0 = (b0 + b1 + b2 + b3 + 2) >> 2;
-            p1 = (b0 + b1 - b2 - b3 + 2) >> 2;
-            p2 = (b0 - b1 + b2 - b3 + 2) >> 2;
-            p3 = (b0 - b1 - b2 + b3 + 2) >> 2;
-
-            /* bias, convert and output four pixels */
-            dst[x]                 = av_clip_uint8(p0 + 128);
-            dst[x + 1]             = av_clip_uint8(p1 + 128);
-            dst[dst_pitch + x]     = av_clip_uint8(p2 + 128);
-            dst[dst_pitch + x + 1] = av_clip_uint8(p3 + 128);
-        }// for x
-
-        dst += dst_pitch << 1;
-
-        b0_ptr += pitch;
-        b1_ptr += pitch;
-        b2_ptr += pitch;
-        b3_ptr += pitch;
-    }// for y
-}
-
-/** butterfly operation for the inverse Haar transform */
-#define IVI_HAAR_BFLY(s1, s2, o1, o2, t) \
-    t  = (s1 - s2) >> 1;\
-    o1 = (s1 + s2) >> 1;\
-    o2 = t;\
-
-/** inverse 8-point Haar transform */
-#define INV_HAAR8(s1, s5, s3, s7, s2, s4, s6, s8,\
-                  d1, d2, d3, d4, d5, d6, d7, d8,\
-                  t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
-    t1 = s1 << 1; t5 = s5 << 1;\
-    IVI_HAAR_BFLY(t1, t5, t1, t5, t0); IVI_HAAR_BFLY(t1, s3, t1, t3, t0);\
-    IVI_HAAR_BFLY(t5, s7, t5, t7, t0); IVI_HAAR_BFLY(t1, s2, t1, t2, t0);\
-    IVI_HAAR_BFLY(t3, s4, t3, t4, t0); IVI_HAAR_BFLY(t5, s6, t5, t6, t0);\
-    IVI_HAAR_BFLY(t7, s8, t7, t8, t0);\
-    d1 = COMPENSATE(t1);\
-    d2 = COMPENSATE(t2);\
-    d3 = COMPENSATE(t3);\
-    d4 = COMPENSATE(t4);\
-    d5 = COMPENSATE(t5);\
-    d6 = COMPENSATE(t6);\
-    d7 = COMPENSATE(t7);\
-    d8 = COMPENSATE(t8); }
-
-/** inverse 4-point Haar transform */
-#define INV_HAAR4(s1, s3, s5, s7, d1, d2, d3, d4, t0, t1, t2, t3, t4) {\
-    IVI_HAAR_BFLY(s1, s3, t0, t1, t4);\
-    IVI_HAAR_BFLY(t0, s5, t2, t3, t4);\
-    d1 = COMPENSATE(t2);\
-    d2 = COMPENSATE(t3);\
-    IVI_HAAR_BFLY(t1, s7, t2, t3, t4);\
-    d3 = COMPENSATE(t2);\
-    d4 = COMPENSATE(t3); }
-
-void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
-                             const uint8_t *flags)
-{
-    int     i, shift, sp1, sp2, sp3, sp4;
-    const int32_t *src;
-    int32_t *dst;
-    int     tmp[64];
-    int     t0, t1, t2, t3, t4, t5, t6, t7, t8;
-
-    /* apply the InvHaar8 to all columns */
-#define COMPENSATE(x) (x)
-    src = in;
-    dst = tmp;
-    for (i = 0; i < 8; i++) {
-        if (flags[i]) {
-            /* pre-scaling */
-            shift = !(i & 4);
-            sp1 = src[ 0] << shift;
-            sp2 = src[ 8] << shift;
-            sp3 = src[16] << shift;
-            sp4 = src[24] << shift;
-            INV_HAAR8(    sp1,     sp2,     sp3,     sp4,
-                      src[32], src[40], src[48], src[56],
-                      dst[ 0], dst[ 8], dst[16], dst[24],
-                      dst[32], dst[40], dst[48], dst[56],
-                      t0, t1, t2, t3, t4, t5, t6, t7, t8);
-        } else
-            dst[ 0] = dst[ 8] = dst[16] = dst[24] =
-            dst[32] = dst[40] = dst[48] = dst[56] = 0;
-
-        src++;
-        dst++;
-    }
-#undef  COMPENSATE
-
-    /* apply the InvHaar8 to all rows */
-#define COMPENSATE(x) (x)
-    src = tmp;
-    for (i = 0; i < 8; i++) {
-        if (   !src[0] && !src[1] && !src[2] && !src[3]
-            && !src[4] && !src[5] && !src[6] && !src[7]) {
-            memset(out, 0, 8 * sizeof(out[0]));
-        } else {
-            INV_HAAR8(src[0], src[1], src[2], src[3],
-                      src[4], src[5], src[6], src[7],
-                      out[0], out[1], out[2], out[3],
-                      out[4], out[5], out[6], out[7],
-                      t0, t1, t2, t3, t4, t5, t6, t7, t8);
-        }
-        src += 8;
-        out += pitch;
-    }
-#undef  COMPENSATE
-}
-
-void ff_ivi_row_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
-                      const uint8_t *flags)
-{
-    int     i;
-    int     t0, t1, t2, t3, t4, t5, t6, t7, t8;
-
-    /* apply the InvHaar8 to all rows */
-#define COMPENSATE(x) (x)
-    for (i = 0; i < 8; i++) {
-        if (   !in[0] && !in[1] && !in[2] && !in[3]
-            && !in[4] && !in[5] && !in[6] && !in[7]) {
-            memset(out, 0, 8 * sizeof(out[0]));
-        } else {
-            INV_HAAR8(in[0],  in[1],  in[2],  in[3],
-                      in[4],  in[5],  in[6],  in[7],
-                      out[0], out[1], out[2], out[3],
-                      out[4], out[5], out[6], out[7],
-                      t0, t1, t2, t3, t4, t5, t6, t7, t8);
-        }
-        in  += 8;
-        out += pitch;
-    }
-#undef  COMPENSATE
-}
-
-void ff_ivi_col_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
-                      const uint8_t *flags)
-{
-    int     i;
-    int     t0, t1, t2, t3, t4, t5, t6, t7, t8;
-
-    /* apply the InvHaar8 to all columns */
-#define COMPENSATE(x) (x)
-    for (i = 0; i < 8; i++) {
-        if (flags[i]) {
-            INV_HAAR8(in[ 0], in[ 8], in[16], in[24],
-                      in[32], in[40], in[48], in[56],
-                      out[0 * pitch], out[1 * pitch],
-                      out[2 * pitch], out[3 * pitch],
-                      out[4 * pitch], out[5 * pitch],
-                      out[6 * pitch], out[7 * pitch],
-                      t0, t1, t2, t3, t4, t5, t6, t7, t8);
-        } else
-            out[0 * pitch] = out[1 * pitch] =
-            out[2 * pitch] = out[3 * pitch] =
-            out[4 * pitch] = out[5 * pitch] =
-            out[6 * pitch] = out[7 * pitch] = 0;
-
-        in++;
-        out++;
-    }
-#undef  COMPENSATE
-}
-
-void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
-                             const uint8_t *flags)
-{
-    int     i, shift, sp1, sp2;
-    const int32_t *src;
-    int32_t *dst;
-    int     tmp[16];
-    int     t0, t1, t2, t3, t4;
-
-    /* apply the InvHaar4 to all columns */
-#define COMPENSATE(x) (x)
-    src = in;
-    dst = tmp;
-    for (i = 0; i < 4; i++) {
-        if (flags[i]) {
-            /* pre-scaling */
-            shift = !(i & 2);
-            sp1 = src[0] << shift;
-            sp2 = src[4] << shift;
-            INV_HAAR4(   sp1,    sp2, src[8], src[12],
-                      dst[0], dst[4], dst[8], dst[12],
-                      t0, t1, t2, t3, t4);
-        } else
-            dst[0] = dst[4] = dst[8] = dst[12] = 0;
-
-        src++;
-        dst++;
-    }
-#undef  COMPENSATE
-
-    /* apply the InvHaar8 to all rows */
-#define COMPENSATE(x) (x)
-    src = tmp;
-    for (i = 0; i < 4; i++) {
-        if (!src[0] && !src[1] && !src[2] && !src[3]) {
-            memset(out, 0, 4 * sizeof(out[0]));
-        } else {
-            INV_HAAR4(src[0], src[1], src[2], src[3],
-                      out[0], out[1], out[2], out[3],
-                      t0, t1, t2, t3, t4);
-        }
-        src += 4;
-        out += pitch;
-    }
-#undef  COMPENSATE
-}
-
-void ff_ivi_row_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
-                      const uint8_t *flags)
-{
-    int     i;
-    int     t0, t1, t2, t3, t4;
-
-    /* apply the InvHaar4 to all rows */
-#define COMPENSATE(x) (x)
-    for (i = 0; i < 4; i++) {
-        if (!in[0] && !in[1] && !in[2] && !in[3]) {
-            memset(out, 0, 4 * sizeof(out[0]));
-        } else {
-            INV_HAAR4(in[0], in[1], in[2], in[3],
-                      out[0], out[1], out[2], out[3],
-                      t0, t1, t2, t3, t4);
-        }
-        in  += 4;
-        out += pitch;
-    }
-#undef  COMPENSATE
-}
-
-void ff_ivi_col_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
-                      const uint8_t *flags)
-{
-    int     i;
-    int     t0, t1, t2, t3, t4;
-
-    /* apply the InvHaar8 to all columns */
-#define COMPENSATE(x) (x)
-    for (i = 0; i < 4; i++) {
-        if (flags[i]) {
-            INV_HAAR4(in[0], in[4], in[8], in[12],
-                      out[0 * pitch], out[1 * pitch],
-                      out[2 * pitch], out[3 * pitch],
-                      t0, t1, t2, t3, t4);
-        } else
-            out[0 * pitch] = out[1 * pitch] =
-            out[2 * pitch] = out[3 * pitch] = 0;
-
-        in++;
-        out++;
-    }
-#undef  COMPENSATE
-}
-
-void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
-                       int blk_size)
-{
-    int     x, y;
-    int16_t dc_coeff;
-
-    dc_coeff = (*in + 0) >> 3;
-
-    for (y = 0; y < blk_size; out += pitch, y++) {
-        for (x = 0; x < blk_size; x++)
-            out[x] = dc_coeff;
-    }
-}
-
-/** butterfly operation for the inverse slant transform */
-#define IVI_SLANT_BFLY(s1, s2, o1, o2, t) \
-    t  = s1 - s2;\
-    o1 = s1 + s2;\
-    o2 = t;\
-
-/** This is a reflection a,b = 1/2, 5/4 for the inverse slant transform */
-#define IVI_IREFLECT(s1, s2, o1, o2, t) \
-    t  = ((s1 + s2*2 + 2) >> 2) + s1;\
-    o2 = ((s1*2 - s2 + 2) >> 2) - s2;\
-    o1 = t;\
-
-/** This is a reflection a,b = 1/2, 7/8 for the inverse slant transform */
-#define IVI_SLANT_PART4(s1, s2, o1, o2, t) \
-    t  = s2 + ((s1*4  - s2 + 4) >> 3);\
-    o2 = s1 + ((-s1 - s2*4 + 4) >> 3);\
-    o1 = t;\
-
-/** inverse slant8 transform */
-#define IVI_INV_SLANT8(s1, s4, s8, s5, s2, s6, s3, s7,\
-                       d1, d2, d3, d4, d5, d6, d7, d8,\
-                       t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
-    IVI_SLANT_PART4(s4, s5, t4, t5, t0);\
-\
-    IVI_SLANT_BFLY(s1, t5, t1, t5, t0); IVI_SLANT_BFLY(s2, s6, t2, t6, t0);\
-    IVI_SLANT_BFLY(s7, s3, t7, t3, t0); IVI_SLANT_BFLY(t4, s8, t4, t8, t0);\
-\
-    IVI_SLANT_BFLY(t1, t2, t1, t2, t0); IVI_IREFLECT  (t4, t3, t4, t3, t0);\
-    IVI_SLANT_BFLY(t5, t6, t5, t6, t0); IVI_IREFLECT  (t8, t7, t8, t7, t0);\
-    IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\
-    IVI_SLANT_BFLY(t5, t8, t5, t8, t0); IVI_SLANT_BFLY(t6, t7, t6, t7, t0);\
-    d1 = COMPENSATE(t1);\
-    d2 = COMPENSATE(t2);\
-    d3 = COMPENSATE(t3);\
-    d4 = COMPENSATE(t4);\
-    d5 = COMPENSATE(t5);\
-    d6 = COMPENSATE(t6);\
-    d7 = COMPENSATE(t7);\
-    d8 = COMPENSATE(t8);}
-
-/** inverse slant4 transform */
-#define IVI_INV_SLANT4(s1, s4, s2, s3, d1, d2, d3, d4, t0, t1, t2, t3, t4) {\
-    IVI_SLANT_BFLY(s1, s2, t1, t2, t0); IVI_IREFLECT  (s4, s3, t4, t3, t0);\
-\
-    IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\
-    d1 = COMPENSATE(t1);\
-    d2 = COMPENSATE(t2);\
-    d3 = COMPENSATE(t3);\
-    d4 = COMPENSATE(t4);}
-
-void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
-{
-    int     i;
-    const int32_t *src;
-    int32_t *dst;
-    int     tmp[64];
-    int     t0, t1, t2, t3, t4, t5, t6, t7, t8;
-
-#define COMPENSATE(x) (x)
-    src = in;
-    dst = tmp;
-    for (i = 0; i < 8; i++) {
-        if (flags[i]) {
-            IVI_INV_SLANT8(src[0], src[8], src[16], src[24], src[32], src[40], src[48], src[56],
-                           dst[0], dst[8], dst[16], dst[24], dst[32], dst[40], dst[48], dst[56],
-                           t0, t1, t2, t3, t4, t5, t6, t7, t8);
-        } else
-            dst[0] = dst[8] = dst[16] = dst[24] = dst[32] = dst[40] = dst[48] = dst[56] = 0;
-
-            src++;
-            dst++;
-    }
-#undef COMPENSATE
-
-#define COMPENSATE(x) ((x + 1)>>1)
-    src = tmp;
-    for (i = 0; i < 8; i++) {
-        if (!src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) {
-            memset(out, 0, 8*sizeof(out[0]));
-        } else {
-            IVI_INV_SLANT8(src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7],
-                           out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7],
-                           t0, t1, t2, t3, t4, t5, t6, t7, t8);
-        }
-        src += 8;
-        out += pitch;
-    }
-#undef COMPENSATE
-}
-
-void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
-{
-    int     i;
-    const int32_t *src;
-    int32_t *dst;
-    int     tmp[16];
-    int     t0, t1, t2, t3, t4;
-
-#define COMPENSATE(x) (x)
-    src = in;
-    dst = tmp;
-    for (i = 0; i < 4; i++) {
-        if (flags[i]) {
-            IVI_INV_SLANT4(src[0], src[4], src[8], src[12],
-                           dst[0], dst[4], dst[8], dst[12],
-                           t0, t1, t2, t3, t4);
-        } else
-            dst[0] = dst[4] = dst[8] = dst[12] = 0;
-
-            src++;
-            dst++;
-    }
-#undef COMPENSATE
-
-#define COMPENSATE(x) ((x + 1)>>1)
-    src = tmp;
-    for (i = 0; i < 4; i++) {
-        if (!src[0] && !src[1] && !src[2] && !src[3]) {
-            out[0] = out[1] = out[2] = out[3] = 0;
-        } else {
-            IVI_INV_SLANT4(src[0], src[1], src[2], src[3],
-                           out[0], out[1], out[2], out[3],
-                           t0, t1, t2, t3, t4);
-        }
-        src += 4;
-        out += pitch;
-    }
-#undef COMPENSATE
-}
-
-void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
-{
-    int     x, y;
-    int16_t dc_coeff;
-
-    dc_coeff = (*in + 1) >> 1;
-
-    for (y = 0; y < blk_size; out += pitch, y++) {
-        for (x = 0; x < blk_size; x++)
-            out[x] = dc_coeff;
-    }
-}
-
-void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
-{
-    int     i;
-    int     t0, t1, t2, t3, t4, t5, t6, t7, t8;
-
-#define COMPENSATE(x) ((x + 1)>>1)
-    for (i = 0; i < 8; i++) {
-        if (!in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) {
-            memset(out, 0, 8*sizeof(out[0]));
-        } else {
-            IVI_INV_SLANT8( in[0],  in[1],  in[2],  in[3],  in[4],  in[5],  in[6],  in[7],
-                           out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7],
-                           t0, t1, t2, t3, t4, t5, t6, t7, t8);
-        }
-        in += 8;
-        out += pitch;
-    }
-#undef COMPENSATE
-}
-
-void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
-{
-    int     x, y;
-    int16_t dc_coeff;
-
-    dc_coeff = (*in + 1) >> 1;
-
-    for (x = 0; x < blk_size; x++)
-        out[x] = dc_coeff;
-
-    out += pitch;
-
-    for (y = 1; y < blk_size; out += pitch, y++) {
-        for (x = 0; x < blk_size; x++)
-            out[x] = 0;
-    }
-}
-
-void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
-{
-    int     i, row2, row4, row8;
-    int     t0, t1, t2, t3, t4, t5, t6, t7, t8;
-
-    row2 = pitch << 1;
-    row4 = pitch << 2;
-    row8 = pitch << 3;
-
-#define COMPENSATE(x) ((x + 1)>>1)
-    for (i = 0; i < 8; i++) {
-        if (flags[i]) {
-            IVI_INV_SLANT8(in[0], in[8], in[16], in[24], in[32], in[40], in[48], in[56],
-                           out[0], out[pitch], out[row2], out[row2 + pitch], out[row4],
-                           out[row4 + pitch],  out[row4 + row2], out[row8 - pitch],
-                           t0, t1, t2, t3, t4, t5, t6, t7, t8);
-        } else {
-            out[0] = out[pitch] = out[row2] = out[row2 + pitch] = out[row4] =
-            out[row4 + pitch] =  out[row4 + row2] = out[row8 - pitch] = 0;
-        }
-
-        in++;
-        out++;
-    }
-#undef COMPENSATE
-}
-
-void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
-{
-    int     x, y;
-    int16_t dc_coeff;
-
-    dc_coeff = (*in + 1) >> 1;
-
-    for (y = 0; y < blk_size; out += pitch, y++) {
-        out[0] = dc_coeff;
-        for (x = 1; x < blk_size; x++)
-            out[x] = 0;
-    }
-}
-
-void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
-{
-    int     i;
-    int     t0, t1, t2, t3, t4;
-
-#define COMPENSATE(x) ((x + 1)>>1)
-    for (i = 0; i < 4; i++) {
-        if (!in[0] && !in[1] && !in[2] && !in[3]) {
-            memset(out, 0, 4*sizeof(out[0]));
-        } else {
-            IVI_INV_SLANT4( in[0],  in[1],  in[2],  in[3],
-                           out[0], out[1], out[2], out[3],
-                           t0, t1, t2, t3, t4);
-        }
-        in  += 4;
-        out += pitch;
-    }
-#undef COMPENSATE
-}
-
-void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
-{
-    int     i, row2;
-    int     t0, t1, t2, t3, t4;
-
-    row2 = pitch << 1;
-
-#define COMPENSATE(x) ((x + 1)>>1)
-    for (i = 0; i < 4; i++) {
-        if (flags[i]) {
-            IVI_INV_SLANT4(in[0], in[4], in[8], in[12],
-                           out[0], out[pitch], out[row2], out[row2 + pitch],
-                           t0, t1, t2, t3, t4);
-        } else {
-            out[0] = out[pitch] = out[row2] = out[row2 + pitch] = 0;
-        }
-
-        in++;
-        out++;
-    }
-#undef COMPENSATE
-}
-
-void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
-                           const uint8_t *flags)
-{
-    int     x, y;
-
-    for (y = 0; y < 8; out += pitch, in += 8, y++)
-        for (x = 0; x < 8; x++)
-            out[x] = in[x];
-}
-
-void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
-                             int blk_size)
-{
-    int     y;
-
-    out[0] = in[0];
-    memset(out + 1, 0, 7*sizeof(out[0]));
-    out += pitch;
-
-    for (y = 1; y < 8; out += pitch, y++)
-        memset(out, 0, 8*sizeof(out[0]));
-}
-
-#define IVI_MC_TEMPLATE(size, suffix, OP) \
-void ff_ivi_mc_ ## size ##x## size ## suffix (int16_t *buf, const int16_t *ref_buf, \
-                                              uint32_t pitch, int mc_type) \
-{ \
-    int     i, j; \
-    const int16_t *wptr; \
-\
-    switch (mc_type) { \
-    case 0: /* fullpel (no interpolation) */ \
-        for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) { \
-            for (j = 0; j < size; j++) {\
-                OP(buf[j], ref_buf[j]); \
-            } \
-        } \
-        break; \
-    case 1: /* horizontal halfpel interpolation */ \
-        for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) \
-            for (j = 0; j < size; j++) \
-                OP(buf[j], (ref_buf[j] + ref_buf[j+1]) >> 1); \
-        break; \
-    case 2: /* vertical halfpel interpolation */ \
-        wptr = ref_buf + pitch; \
-        for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \
-            for (j = 0; j < size; j++) \
-                OP(buf[j], (ref_buf[j] + wptr[j]) >> 1); \
-        break; \
-    case 3: /* vertical and horizontal halfpel interpolation */ \
-        wptr = ref_buf + pitch; \
-        for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \
-            for (j = 0; j < size; j++) \
-                OP(buf[j], (ref_buf[j] + ref_buf[j+1] + wptr[j] + wptr[j+1]) >> 2); \
-        break; \
-    } \
-} \
-
-#define OP_PUT(a, b)  (a) = (b)
-#define OP_ADD(a, b)  (a) += (b)
-
-IVI_MC_TEMPLATE(8, _no_delta, OP_PUT)
-IVI_MC_TEMPLATE(8, _delta,    OP_ADD)
-IVI_MC_TEMPLATE(4, _no_delta, OP_PUT)
-IVI_MC_TEMPLATE(4, _delta,    OP_ADD)
diff --git a/deps/libav/libavcodec/ivi_dsp.h b/deps/libav/libavcodec/ivi_dsp.h
deleted file mode 100644
index 31d37e3..0000000
--- a/deps/libav/libavcodec/ivi_dsp.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5)
- *
- * Copyright (c) 2009-2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * DSP functions (inverse transforms, motion compensations, wavelet recompostion)
- * for Indeo Video Interactive codecs.
- */
-
-#ifndef AVCODEC_IVI_DSP_H
-#define AVCODEC_IVI_DSP_H
-
-#include "avcodec.h"
-#include "ivi_common.h"
-
-/**
- *  5/3 wavelet recomposition filter for Indeo5
- *
- *  @param[in]   plane        pointer to the descriptor of the plane being processed
- *  @param[out]  dst          pointer to the destination buffer
- *  @param[in]   dst_pitch    pitch of the destination buffer
- */
-void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
-                        const int dst_pitch);
-
-/**
- *  Haar wavelet recomposition filter for Indeo 4
- *
- *  @param[in]  plane        pointer to the descriptor of the plane being processed
- *  @param[out] dst          pointer to the destination buffer
- *  @param[in]  dst_pitch    pitch of the destination buffer
- */
-void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
-                           const int dst_pitch);
-
-/**
- *  two-dimensional inverse Haar 8x8 transform for Indeo 4
- *
- *  @param[in]  in        pointer to the vector of transform coefficients
- *  @param[out] out       pointer to the output buffer (frame)
- *  @param[in]  pitch     pitch to move to the next y line
- *  @param[in]  flags     pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
-                             const uint8_t *flags);
-
-/**
- *  one-dimensional inverse 8-point Haar transform on rows for Indeo 4
- *
- *  @param[in]  in        pointer to the vector of transform coefficients
- *  @param[out] out       pointer to the output buffer (frame)
- *  @param[in]  pitch     pitch to move to the next y line
- *  @param[in]  flags     pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_row_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
-                      const uint8_t *flags);
-
-/**
- *  one-dimensional inverse 8-point Haar transform on columns for Indeo 4
- *
- *  @param[in]  in        pointer to the vector of transform coefficients
- *  @param[out] out       pointer to the output buffer (frame)
- *  @param[in]  pitch     pitch to move to the next y line
- *  @param[in]  flags     pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_col_haar8(const int32_t *in, int16_t *out, uint32_t pitch,
-                      const uint8_t *flags);
-
-/**
- *  two-dimensional inverse Haar 4x4 transform for Indeo 4
- *
- *  @param[in]  in        pointer to the vector of transform coefficients
- *  @param[out] out       pointer to the output buffer (frame)
- *  @param[in]  pitch     pitch to move to the next y line
- *  @param[in]  flags     pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
-                             const uint8_t *flags);
-
-/**
- *  one-dimensional inverse 4-point Haar transform on rows for Indeo 4
- *
- *  @param[in]  in        pointer to the vector of transform coefficients
- *  @param[out] out       pointer to the output buffer (frame)
- *  @param[in]  pitch     pitch to move to the next y line
- *  @param[in]  flags     pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_row_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
-                      const uint8_t *flags);
-
-/**
- *  one-dimensional inverse 4-point Haar transform on columns for Indeo 4
- *
- *  @param[in]  in        pointer to the vector of transform coefficients
- *  @param[out] out       pointer to the output buffer (frame)
- *  @param[in]  pitch     pitch to move to the next y line
- *  @param[in]  flags     pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_col_haar4(const int32_t *in, int16_t *out, uint32_t pitch,
-                      const uint8_t *flags);
-
-/**
- *  DC-only two-dimensional inverse Haar transform for Indeo 4.
- *  Performing the inverse transform in this case is equivalent to
- *  spreading DC_coeff >> 3 over the whole block.
- *
- *  @param[in]  in          pointer to the dc coefficient
- *  @param[out] out         pointer to the output buffer (frame)
- *  @param[in]  pitch       pitch to move to the next y line
- *  @param[in]  blk_size    transform block size
- */
-void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
-                       int blk_size);
-
-/**
- *  two-dimensional inverse slant 8x8 transform
- *
- *  @param[in]    in      pointer to the vector of transform coefficients
- *  @param[out]   out     pointer to the output buffer (frame)
- *  @param[in]    pitch   pitch to move to the next y line
- *  @param[in]    flags   pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
-                              const uint8_t *flags);
-
-/**
- *  two-dimensional inverse slant 4x4 transform
- *
- *  @param[in]    in      pointer to the vector of transform coefficients
- *  @param[out]   out     pointer to the output buffer (frame)
- *  @param[in]    pitch   pitch to move to the next y line
- *  @param[in]    flags   pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
-                              const uint8_t *flags);
-
-/**
- *  DC-only two-dimensional inverse slant transform.
- *  Performing the inverse slant transform in this case is equivalent to
- *  spreading (DC_coeff + 1)/2 over the whole block.
- *  It works much faster than performing the slant transform on a vector of zeroes.
- *
- *  @param[in]    in          pointer to the dc coefficient
- *  @param[out]   out         pointer to the output buffer (frame)
- *  @param[in]    pitch       pitch to move to the next y line
- *  @param[in]    blk_size    transform block size
- */
-void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
-
-/**
- *  inverse 1D row slant transform
- *
- *  @param[in]    in      pointer to the vector of transform coefficients
- *  @param[out]   out     pointer to the output buffer (frame)
- *  @param[in]    pitch   pitch to move to the next y line
- *  @param[in]    flags   pointer to the array of column flags (unused here)
- */
-void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
-                       const uint8_t *flags);
-
-/**
- *  inverse 1D column slant transform
- *
- *  @param[in]    in      pointer to the vector of transform coefficients
- *  @param[out]   out     pointer to the output buffer (frame)
- *  @param[in]    pitch   pitch to move to the next y line
- *  @param[in]    flags   pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
-                       const uint8_t *flags);
-
-/**
- *  inverse 1D row slant transform
- *
- *  @param[in]    in      pointer to the vector of transform coefficients
- *  @param[out]   out     pointer to the output buffer (frame)
- *  @param[in]    pitch   pitch to move to the next y line
- *  @param[in]    flags   pointer to the array of column flags (unused here)
- */
-void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch,
-                       const uint8_t *flags);
-
-/**
- *  inverse 1D column slant transform
- *
- *  @param[in]    in      pointer to the vector of transform coefficients
- *  @param[out]   out     pointer to the output buffer (frame)
- *  @param[in]    pitch   pitch to move to the next y line
- *  @param[in]    flags   pointer to the array of column flags:
- *                        != 0 - non_empty column, 0 - empty one
- *                        (this array must be filled by caller)
- */
-void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch,
-                       const uint8_t *flags);
-
-/**
- *  DC-only inverse row slant transform
- */
-void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
-
-/**
- *  DC-only inverse column slant transform
- */
-void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
-
-/**
- *  Copy the pixels into the frame buffer.
- */
-void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags);
-
-/**
- *  Copy the DC coefficient into the first pixel of the block and
- *  zero all others.
- */
-void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
-
-/**
- *  8x8 block motion compensation with adding delta
- *
- *  @param[in,out]   buf      pointer to the block in the current frame buffer containing delta
- *  @param[in]       ref_buf  pointer to the corresponding block in the reference frame
- *  @param[in]       pitch    pitch for moving to the next y line
- *  @param[in]       mc_type  interpolation type
- */
-void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
-
-/**
- *  4x4 block motion compensation with adding delta
- *
- *  @param[in,out]   buf      pointer to the block in the current frame buffer containing delta
- *  @param[in]       ref_buf  pointer to the corresponding block in the reference frame
- *  @param[in]       pitch    pitch for moving to the next y line
- *  @param[in]       mc_type  interpolation type
- */
-void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
-
-/**
- *  motion compensation without adding delta
- *
- *  @param[in,out]  buf      pointer to the block in the current frame receiving the result
- *  @param[in]      ref_buf  pointer to the corresponding block in the reference frame
- *  @param[in]      pitch    pitch for moving to the next y line
- *  @param[in]      mc_type  interpolation type
- */
-void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
-
-/**
- *  4x4 block motion compensation without adding delta
- *
- *  @param[in,out]  buf      pointer to the block in the current frame receiving the result
- *  @param[in]      ref_buf  pointer to the corresponding block in the reference frame
- *  @param[in]      pitch    pitch for moving to the next y line
- *  @param[in]      mc_type  interpolation type
- */
-void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
-
-#endif /* AVCODEC_IVI_DSP_H */
diff --git a/deps/libav/libavcodec/jfdctfst.c b/deps/libav/libavcodec/jfdctfst.c
deleted file mode 100644
index bbcf598..0000000
--- a/deps/libav/libavcodec/jfdctfst.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * This file is part of the Independent JPEG Group's software.
- *
- * The authors make NO WARRANTY or representation, either express or implied,
- * with respect to this software, its quality, accuracy, merchantability, or
- * fitness for a particular purpose.  This software is provided "AS IS", and
- * you, its user, assume the entire risk as to its quality and accuracy.
- *
- * This software is copyright (C) 1994-1996, Thomas G. Lane.
- * All Rights Reserved except as specified below.
- *
- * Permission is hereby granted to use, copy, modify, and distribute this
- * software (or portions thereof) for any purpose, without fee, subject to
- * these conditions:
- * (1) If any part of the source code for this software is distributed, then
- * this README file must be included, with this copyright and no-warranty
- * notice unaltered; and any additions, deletions, or changes to the original
- * files must be clearly indicated in accompanying documentation.
- * (2) If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the work
- * of the Independent JPEG Group".
- * (3) Permission for use of this software is granted only if the user accepts
- * full responsibility for any undesirable consequences; the authors accept
- * NO LIABILITY for damages of any kind.
- *
- * These conditions apply to any software derived from or based on the IJG
- * code, not just to the unmodified library.  If you use our work, you ought
- * to acknowledge us.
- *
- * Permission is NOT granted for the use of any IJG author's name or company
- * name in advertising or publicity relating to this software or products
- * derived from it.  This software may be referred to only as "the Independent
- * JPEG Group's software".
- *
- * We specifically permit and encourage the use of this software as the basis
- * of commercial products, provided that all warranty or liability claims are
- * assumed by the product vendor.
- *
- * This file contains a fast, not so accurate integer implementation of the
- * forward DCT (Discrete Cosine Transform).
- *
- * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
- * on each column.  Direct algorithms are also available, but they are
- * much more complex and seem not to be any faster when reduced to code.
- *
- * This implementation is based on Arai, Agui, and Nakajima's algorithm for
- * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in
- * Japanese, but the algorithm is described in the Pennebaker & Mitchell
- * JPEG textbook (see REFERENCES section in file README).  The following code
- * is based directly on figure 4-8 in P&M.
- * While an 8-point DCT cannot be done in less than 11 multiplies, it is
- * possible to arrange the computation so that many of the multiplies are
- * simple scalings of the final outputs.  These multiplies can then be
- * folded into the multiplications or divisions by the JPEG quantization
- * table entries.  The AA&N method leaves only 5 multiplies and 29 adds
- * to be done in the DCT itself.
- * The primary disadvantage of this method is that with fixed-point math,
- * accuracy is lost due to imprecise representation of the scaled
- * quantization values.  The smaller the quantization table entry, the less
- * precise the scaled value, so this implementation does worse with high-
- * quality-setting files than with low-quality ones.
- */
-
-/**
- * @file
- * Independent JPEG Group's fast AAN dct.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "libavutil/common.h"
-#include "dct.h"
-
-#define DCTSIZE 8
-#define GLOBAL(x) x
-#define RIGHT_SHIFT(x, n) ((x) >> (n))
-
-/*
- * This module is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
-  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/* Scaling decisions are generally the same as in the LL&M algorithm;
- * see jfdctint.c for more details.  However, we choose to descale
- * (right shift) multiplication products as soon as they are formed,
- * rather than carrying additional fractional bits into subsequent additions.
- * This compromises accuracy slightly, but it lets us save a few shifts.
- * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
- * everywhere except in the multiplications proper; this saves a good deal
- * of work on 16-bit-int machines.
- *
- * Again to save a few shifts, the intermediate results between pass 1 and
- * pass 2 are not upscaled, but are represented only to integral precision.
- *
- * A final compromise is to represent the multiplicative constants to only
- * 8 fractional bits, rather than 13.  This saves some shifting work on some
- * machines, and may also reduce the cost of multiplication (since there
- * are fewer one-bits in the constants).
- */
-
-#define CONST_BITS  8
-
-
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-
-#if CONST_BITS == 8
-#define FIX_0_382683433  ((int32_t)   98)       /* FIX(0.382683433) */
-#define FIX_0_541196100  ((int32_t)  139)       /* FIX(0.541196100) */
-#define FIX_0_707106781  ((int32_t)  181)       /* FIX(0.707106781) */
-#define FIX_1_306562965  ((int32_t)  334)       /* FIX(1.306562965) */
-#else
-#define FIX_0_382683433  FIX(0.382683433)
-#define FIX_0_541196100  FIX(0.541196100)
-#define FIX_0_707106781  FIX(0.707106781)
-#define FIX_1_306562965  FIX(1.306562965)
-#endif
-
-
-/* We can gain a little more speed, with a further compromise in accuracy,
- * by omitting the addition in a descaling shift.  This yields an incorrectly
- * rounded result half the time...
- */
-
-#ifndef USE_ACCURATE_ROUNDING
-#undef DESCALE
-#define DESCALE(x,n)  RIGHT_SHIFT(x, n)
-#endif
-
-
-/* Multiply a int16_t variable by an int32_t constant, and immediately
- * descale to yield a int16_t result.
- */
-
-#define MULTIPLY(var,const)  ((int16_t) DESCALE((var) * (const), CONST_BITS))
-
-static av_always_inline void row_fdct(int16_t * data){
-  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-  int tmp10, tmp11, tmp12, tmp13;
-  int z1, z2, z3, z4, z5, z11, z13;
-  int16_t *dataptr;
-  int ctr;
-
-  /* Pass 1: process rows. */
-
-  dataptr = data;
-  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
-    tmp0 = dataptr[0] + dataptr[7];
-    tmp7 = dataptr[0] - dataptr[7];
-    tmp1 = dataptr[1] + dataptr[6];
-    tmp6 = dataptr[1] - dataptr[6];
-    tmp2 = dataptr[2] + dataptr[5];
-    tmp5 = dataptr[2] - dataptr[5];
-    tmp3 = dataptr[3] + dataptr[4];
-    tmp4 = dataptr[3] - dataptr[4];
-
-    /* Even part */
-
-    tmp10 = tmp0 + tmp3;        /* phase 2 */
-    tmp13 = tmp0 - tmp3;
-    tmp11 = tmp1 + tmp2;
-    tmp12 = tmp1 - tmp2;
-
-    dataptr[0] = tmp10 + tmp11; /* phase 3 */
-    dataptr[4] = tmp10 - tmp11;
-
-    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
-    dataptr[2] = tmp13 + z1;    /* phase 5 */
-    dataptr[6] = tmp13 - z1;
-
-    /* Odd part */
-
-    tmp10 = tmp4 + tmp5;        /* phase 2 */
-    tmp11 = tmp5 + tmp6;
-    tmp12 = tmp6 + tmp7;
-
-    /* The rotator is modified from fig 4-8 to avoid extra negations. */
-    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
-    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5;    /* c2-c6 */
-    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5;    /* c2+c6 */
-    z3 = MULTIPLY(tmp11, FIX_0_707106781);         /* c4 */
-
-    z11 = tmp7 + z3;            /* phase 5 */
-    z13 = tmp7 - z3;
-
-    dataptr[5] = z13 + z2;      /* phase 6 */
-    dataptr[3] = z13 - z2;
-    dataptr[1] = z11 + z4;
-    dataptr[7] = z11 - z4;
-
-    dataptr += DCTSIZE;         /* advance pointer to next row */
-  }
-}
-
-/*
- * Perform the forward DCT on one block of samples.
- */
-
-GLOBAL(void)
-ff_fdct_ifast (int16_t * data)
-{
-  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-  int tmp10, tmp11, tmp12, tmp13;
-  int z1, z2, z3, z4, z5, z11, z13;
-  int16_t *dataptr;
-  int ctr;
-
-  row_fdct(data);
-
-  /* Pass 2: process columns. */
-
-  dataptr = data;
-  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
-    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
-    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
-    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
-    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
-    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
-    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
-    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
-    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
-
-    /* Even part */
-
-    tmp10 = tmp0 + tmp3;        /* phase 2 */
-    tmp13 = tmp0 - tmp3;
-    tmp11 = tmp1 + tmp2;
-    tmp12 = tmp1 - tmp2;
-
-    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
-    dataptr[DCTSIZE*4] = tmp10 - tmp11;
-
-    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
-    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
-    dataptr[DCTSIZE*6] = tmp13 - z1;
-
-    /* Odd part */
-
-    tmp10 = tmp4 + tmp5;        /* phase 2 */
-    tmp11 = tmp5 + tmp6;
-    tmp12 = tmp6 + tmp7;
-
-    /* The rotator is modified from fig 4-8 to avoid extra negations. */
-    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
-    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
-    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
-    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
-
-    z11 = tmp7 + z3;            /* phase 5 */
-    z13 = tmp7 - z3;
-
-    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
-    dataptr[DCTSIZE*3] = z13 - z2;
-    dataptr[DCTSIZE*1] = z11 + z4;
-    dataptr[DCTSIZE*7] = z11 - z4;
-
-    dataptr++;                  /* advance pointer to next column */
-  }
-}
-
-/*
- * Perform the forward 2-4-8 DCT on one block of samples.
- */
-
-GLOBAL(void)
-ff_fdct_ifast248 (int16_t * data)
-{
-  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-  int tmp10, tmp11, tmp12, tmp13;
-  int z1;
-  int16_t *dataptr;
-  int ctr;
-
-  row_fdct(data);
-
-  /* Pass 2: process columns. */
-
-  dataptr = data;
-  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
-    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*1];
-    tmp1 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];
-    tmp2 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5];
-    tmp3 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7];
-    tmp4 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*1];
-    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];
-    tmp6 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5];
-    tmp7 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];
-
-    /* Even part */
-
-    tmp10 = tmp0 + tmp3;
-    tmp11 = tmp1 + tmp2;
-    tmp12 = tmp1 - tmp2;
-    tmp13 = tmp0 - tmp3;
-
-    dataptr[DCTSIZE*0] = tmp10 + tmp11;
-    dataptr[DCTSIZE*4] = tmp10 - tmp11;
-
-    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781);
-    dataptr[DCTSIZE*2] = tmp13 + z1;
-    dataptr[DCTSIZE*6] = tmp13 - z1;
-
-    tmp10 = tmp4 + tmp7;
-    tmp11 = tmp5 + tmp6;
-    tmp12 = tmp5 - tmp6;
-    tmp13 = tmp4 - tmp7;
-
-    dataptr[DCTSIZE*1] = tmp10 + tmp11;
-    dataptr[DCTSIZE*5] = tmp10 - tmp11;
-
-    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781);
-    dataptr[DCTSIZE*3] = tmp13 + z1;
-    dataptr[DCTSIZE*7] = tmp13 - z1;
-
-    dataptr++;                        /* advance pointer to next column */
-  }
-}
-
-
-#undef GLOBAL
-#undef CONST_BITS
-#undef DESCALE
-#undef FIX_0_541196100
-#undef FIX_1_306562965
diff --git a/deps/libav/libavcodec/jfdctint.c b/deps/libav/libavcodec/jfdctint.c
deleted file mode 100644
index ed6b7ff..0000000
--- a/deps/libav/libavcodec/jfdctint.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define BIT_DEPTH 8
-#include "jfdctint_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "jfdctint_template.c"
-#undef BIT_DEPTH
diff --git a/deps/libav/libavcodec/jfdctint_template.c b/deps/libav/libavcodec/jfdctint_template.c
deleted file mode 100644
index c6a1638..0000000
--- a/deps/libav/libavcodec/jfdctint_template.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * This file is part of the Independent JPEG Group's software.
- *
- * The authors make NO WARRANTY or representation, either express or implied,
- * with respect to this software, its quality, accuracy, merchantability, or
- * fitness for a particular purpose.  This software is provided "AS IS", and
- * you, its user, assume the entire risk as to its quality and accuracy.
- *
- * This software is copyright (C) 1991-1996, Thomas G. Lane.
- * All Rights Reserved except as specified below.
- *
- * Permission is hereby granted to use, copy, modify, and distribute this
- * software (or portions thereof) for any purpose, without fee, subject to
- * these conditions:
- * (1) If any part of the source code for this software is distributed, then
- * this README file must be included, with this copyright and no-warranty
- * notice unaltered; and any additions, deletions, or changes to the original
- * files must be clearly indicated in accompanying documentation.
- * (2) If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the work
- * of the Independent JPEG Group".
- * (3) Permission for use of this software is granted only if the user accepts
- * full responsibility for any undesirable consequences; the authors accept
- * NO LIABILITY for damages of any kind.
- *
- * These conditions apply to any software derived from or based on the IJG
- * code, not just to the unmodified library.  If you use our work, you ought
- * to acknowledge us.
- *
- * Permission is NOT granted for the use of any IJG author's name or company
- * name in advertising or publicity relating to this software or products
- * derived from it.  This software may be referred to only as "the Independent
- * JPEG Group's software".
- *
- * We specifically permit and encourage the use of this software as the basis
- * of commercial products, provided that all warranty or liability claims are
- * assumed by the product vendor.
- *
- * This file contains a slow-but-accurate integer implementation of the
- * forward DCT (Discrete Cosine Transform).
- *
- * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
- * on each column.  Direct algorithms are also available, but they are
- * much more complex and seem not to be any faster when reduced to code.
- *
- * This implementation is based on an algorithm described in
- *   C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
- *   Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
- *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
- * The primary algorithm described there uses 11 multiplies and 29 adds.
- * We use their alternate method with 12 multiplies and 32 adds.
- * The advantage of this method is that no data path contains more than one
- * multiplication; this allows a very simple and accurate implementation in
- * scaled fixed-point arithmetic, with a minimal number of shifts.
- */
-
-/**
- * @file
- * Independent JPEG Group's slow & accurate dct.
- */
-
-#include "libavutil/common.h"
-#include "dct.h"
-
-#include "bit_depth_template.c"
-
-#define DCTSIZE 8
-#define BITS_IN_JSAMPLE BIT_DEPTH
-#define GLOBAL(x) x
-#define RIGHT_SHIFT(x, n) ((x) >> (n))
-#define MULTIPLY16C16(var,const) ((var)*(const))
-
-#if 1 //def USE_ACCURATE_ROUNDING
-#define DESCALE(x,n)  RIGHT_SHIFT((x) + (1 << ((n) - 1)), n)
-#else
-#define DESCALE(x,n)  RIGHT_SHIFT(x, n)
-#endif
-
-
-/*
- * This module is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
-#error  "Sorry, this code only copes with 8x8 DCTs."
-#endif
-
-
-/*
- * The poop on this scaling stuff is as follows:
- *
- * Each 1-D DCT step produces outputs which are a factor of sqrt(N)
- * larger than the true DCT outputs.  The final outputs are therefore
- * a factor of N larger than desired; since N=8 this can be cured by
- * a simple right shift at the end of the algorithm.  The advantage of
- * this arrangement is that we save two multiplications per 1-D DCT,
- * because the y0 and y4 outputs need not be divided by sqrt(N).
- * In the IJG code, this factor of 8 is removed by the quantization step
- * (in jcdctmgr.c), NOT in this module.
- *
- * We have to do addition and subtraction of the integer inputs, which
- * is no problem, and multiplication by fractional constants, which is
- * a problem to do in integer arithmetic.  We multiply all the constants
- * by CONST_SCALE and convert them to integer constants (thus retaining
- * CONST_BITS bits of precision in the constants).  After doing a
- * multiplication we have to divide the product by CONST_SCALE, with proper
- * rounding, to produce the correct output.  This division can be done
- * cheaply as a right shift of CONST_BITS bits.  We postpone shifting
- * as long as possible so that partial sums can be added together with
- * full fractional precision.
- *
- * The outputs of the first pass are scaled up by PASS1_BITS bits so that
- * they are represented to better-than-integral precision.  These outputs
- * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
- * with the recommended scaling.  (For 12-bit sample data, the intermediate
- * array is int32_t anyway.)
- *
- * To avoid overflow of the 32-bit intermediate results in pass 2, we must
- * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
- * shows that the values given below are the most effective.
- */
-
-#undef CONST_BITS
-#undef PASS1_BITS
-#undef OUT_SHIFT
-
-#if BITS_IN_JSAMPLE == 8
-#define CONST_BITS  13
-#define PASS1_BITS  4   /* set this to 2 if 16x16 multiplies are faster */
-#define OUT_SHIFT   PASS1_BITS
-#else
-#define CONST_BITS  13
-#define PASS1_BITS  1   /* lose a little precision to avoid overflow */
-#define OUT_SHIFT   (PASS1_BITS + 1)
-#endif
-
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-
-#if CONST_BITS == 13
-#define FIX_0_298631336  ((int32_t)  2446)      /* FIX(0.298631336) */
-#define FIX_0_390180644  ((int32_t)  3196)      /* FIX(0.390180644) */
-#define FIX_0_541196100  ((int32_t)  4433)      /* FIX(0.541196100) */
-#define FIX_0_765366865  ((int32_t)  6270)      /* FIX(0.765366865) */
-#define FIX_0_899976223  ((int32_t)  7373)      /* FIX(0.899976223) */
-#define FIX_1_175875602  ((int32_t)  9633)      /* FIX(1.175875602) */
-#define FIX_1_501321110  ((int32_t)  12299)     /* FIX(1.501321110) */
-#define FIX_1_847759065  ((int32_t)  15137)     /* FIX(1.847759065) */
-#define FIX_1_961570560  ((int32_t)  16069)     /* FIX(1.961570560) */
-#define FIX_2_053119869  ((int32_t)  16819)     /* FIX(2.053119869) */
-#define FIX_2_562915447  ((int32_t)  20995)     /* FIX(2.562915447) */
-#define FIX_3_072711026  ((int32_t)  25172)     /* FIX(3.072711026) */
-#else
-#define FIX_0_298631336  FIX(0.298631336)
-#define FIX_0_390180644  FIX(0.390180644)
-#define FIX_0_541196100  FIX(0.541196100)
-#define FIX_0_765366865  FIX(0.765366865)
-#define FIX_0_899976223  FIX(0.899976223)
-#define FIX_1_175875602  FIX(1.175875602)
-#define FIX_1_501321110  FIX(1.501321110)
-#define FIX_1_847759065  FIX(1.847759065)
-#define FIX_1_961570560  FIX(1.961570560)
-#define FIX_2_053119869  FIX(2.053119869)
-#define FIX_2_562915447  FIX(2.562915447)
-#define FIX_3_072711026  FIX(3.072711026)
-#endif
-
-
-/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
- * For 8-bit samples with the recommended scaling, all the variable
- * and constant values involved are no more than 16 bits wide, so a
- * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
- * For 12-bit samples, a full 32-bit multiplication will be needed.
- */
-
-#if BITS_IN_JSAMPLE == 8 && CONST_BITS<=13 && PASS1_BITS<=2
-#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)
-#else
-#define MULTIPLY(var,const)  ((var) * (const))
-#endif
-
-
-static av_always_inline void FUNC(row_fdct)(int16_t *data)
-{
-  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-  int tmp10, tmp11, tmp12, tmp13;
-  int z1, z2, z3, z4, z5;
-  int16_t *dataptr;
-  int ctr;
-
-  /* Pass 1: process rows. */
-  /* Note results are scaled up by sqrt(8) compared to a true DCT; */
-  /* furthermore, we scale the results by 2**PASS1_BITS. */
-
-  dataptr = data;
-  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
-    tmp0 = dataptr[0] + dataptr[7];
-    tmp7 = dataptr[0] - dataptr[7];
-    tmp1 = dataptr[1] + dataptr[6];
-    tmp6 = dataptr[1] - dataptr[6];
-    tmp2 = dataptr[2] + dataptr[5];
-    tmp5 = dataptr[2] - dataptr[5];
-    tmp3 = dataptr[3] + dataptr[4];
-    tmp4 = dataptr[3] - dataptr[4];
-
-    /* Even part per LL&M figure 1 --- note that published figure is faulty;
-     * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
-     */
-
-    tmp10 = tmp0 + tmp3;
-    tmp13 = tmp0 - tmp3;
-    tmp11 = tmp1 + tmp2;
-    tmp12 = tmp1 - tmp2;
-
-    dataptr[0] = (int16_t) ((tmp10 + tmp11) << PASS1_BITS);
-    dataptr[4] = (int16_t) ((tmp10 - tmp11) << PASS1_BITS);
-
-    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
-    dataptr[2] = (int16_t) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
-                                   CONST_BITS-PASS1_BITS);
-    dataptr[6] = (int16_t) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
-                                   CONST_BITS-PASS1_BITS);
-
-    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
-     * cK represents cos(K*pi/16).
-     * i0..i3 in the paper are tmp4..tmp7 here.
-     */
-
-    z1 = tmp4 + tmp7;
-    z2 = tmp5 + tmp6;
-    z3 = tmp4 + tmp6;
-    z4 = tmp5 + tmp7;
-    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
-    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
-    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
-    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
-    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
-    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
-    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
-    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
-    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
-    z3 += z5;
-    z4 += z5;
-
-    dataptr[7] = (int16_t) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
-    dataptr[5] = (int16_t) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
-    dataptr[3] = (int16_t) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
-    dataptr[1] = (int16_t) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
-
-    dataptr += DCTSIZE;         /* advance pointer to next row */
-  }
-}
-
-/*
- * Perform the forward DCT on one block of samples.
- */
-
-GLOBAL(void)
-FUNC(ff_jpeg_fdct_islow)(int16_t *data)
-{
-  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-  int tmp10, tmp11, tmp12, tmp13;
-  int z1, z2, z3, z4, z5;
-  int16_t *dataptr;
-  int ctr;
-
-  FUNC(row_fdct)(data);
-
-  /* Pass 2: process columns.
-   * We remove the PASS1_BITS scaling, but leave the results scaled up
-   * by an overall factor of 8.
-   */
-
-  dataptr = data;
-  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
-    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
-    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
-    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
-    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
-    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
-    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
-    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
-    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
-
-    /* Even part per LL&M figure 1 --- note that published figure is faulty;
-     * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
-     */
-
-    tmp10 = tmp0 + tmp3;
-    tmp13 = tmp0 - tmp3;
-    tmp11 = tmp1 + tmp2;
-    tmp12 = tmp1 - tmp2;
-
-    dataptr[DCTSIZE*0] = DESCALE(tmp10 + tmp11, OUT_SHIFT);
-    dataptr[DCTSIZE*4] = DESCALE(tmp10 - tmp11, OUT_SHIFT);
-
-    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
-    dataptr[DCTSIZE*2] = DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
-                                 CONST_BITS + OUT_SHIFT);
-    dataptr[DCTSIZE*6] = DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
-                                 CONST_BITS + OUT_SHIFT);
-
-    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
-     * cK represents cos(K*pi/16).
-     * i0..i3 in the paper are tmp4..tmp7 here.
-     */
-
-    z1 = tmp4 + tmp7;
-    z2 = tmp5 + tmp6;
-    z3 = tmp4 + tmp6;
-    z4 = tmp5 + tmp7;
-    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
-    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
-    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
-    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
-    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
-    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
-    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
-    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
-    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
-    z3 += z5;
-    z4 += z5;
-
-    dataptr[DCTSIZE*7] = DESCALE(tmp4 + z1 + z3, CONST_BITS + OUT_SHIFT);
-    dataptr[DCTSIZE*5] = DESCALE(tmp5 + z2 + z4, CONST_BITS + OUT_SHIFT);
-    dataptr[DCTSIZE*3] = DESCALE(tmp6 + z2 + z3, CONST_BITS + OUT_SHIFT);
-    dataptr[DCTSIZE*1] = DESCALE(tmp7 + z1 + z4, CONST_BITS + OUT_SHIFT);
-
-    dataptr++;                  /* advance pointer to next column */
-  }
-}
-
-/*
- * The secret of DCT2-4-8 is really simple -- you do the usual 1-DCT
- * on the rows and then, instead of doing even and odd, part on the columns
- * you do even part two times.
- */
-GLOBAL(void)
-FUNC(ff_fdct248_islow)(int16_t *data)
-{
-  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
-  int tmp10, tmp11, tmp12, tmp13;
-  int z1;
-  int16_t *dataptr;
-  int ctr;
-
-  FUNC(row_fdct)(data);
-
-  /* Pass 2: process columns.
-   * We remove the PASS1_BITS scaling, but leave the results scaled up
-   * by an overall factor of 8.
-   */
-
-  dataptr = data;
-  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
-     tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*1];
-     tmp1 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];
-     tmp2 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5];
-     tmp3 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7];
-     tmp4 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*1];
-     tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];
-     tmp6 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5];
-     tmp7 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];
-
-     tmp10 = tmp0 + tmp3;
-     tmp11 = tmp1 + tmp2;
-     tmp12 = tmp1 - tmp2;
-     tmp13 = tmp0 - tmp3;
-
-     dataptr[DCTSIZE*0] = DESCALE(tmp10 + tmp11, OUT_SHIFT);
-     dataptr[DCTSIZE*4] = DESCALE(tmp10 - tmp11, OUT_SHIFT);
-
-     z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
-     dataptr[DCTSIZE*2] = DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
-                                  CONST_BITS+OUT_SHIFT);
-     dataptr[DCTSIZE*6] = DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
-                                  CONST_BITS+OUT_SHIFT);
-
-     tmp10 = tmp4 + tmp7;
-     tmp11 = tmp5 + tmp6;
-     tmp12 = tmp5 - tmp6;
-     tmp13 = tmp4 - tmp7;
-
-     dataptr[DCTSIZE*1] = DESCALE(tmp10 + tmp11, OUT_SHIFT);
-     dataptr[DCTSIZE*5] = DESCALE(tmp10 - tmp11, OUT_SHIFT);
-
-     z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
-     dataptr[DCTSIZE*3] = DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
-                                  CONST_BITS + OUT_SHIFT);
-     dataptr[DCTSIZE*7] = DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
-                                  CONST_BITS + OUT_SHIFT);
-
-     dataptr++;                 /* advance pointer to next column */
-  }
-}
diff --git a/deps/libav/libavcodec/jpeg2000.c b/deps/libav/libavcodec/jpeg2000.c
deleted file mode 100644
index bf46398..0000000
--- a/deps/libav/libavcodec/jpeg2000.c
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- * JPEG 2000 encoder and decoder common functions
- * Copyright (c) 2007 Kamil Nowosad
- * Copyright (c) 2013 Nicolas Bertrand <nicoinattendu at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * JPEG 2000 image encoder and decoder common functions
- */
-
-#include "libavutil/common.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-#include "jpeg2000.h"
-
-#define SHL(a, n) ((n) >= 0 ? (a) << (n) : (a) >> -(n))
-
-/* tag tree routines */
-
-/* allocate the memory for tag tree */
-static int32_t tag_tree_size(uint16_t w, uint16_t h)
-{
-    uint32_t res = 0;
-    while (w > 1 || h > 1) {
-        res += w * h;
-        if (res + 1 >= INT32_MAX)
-            return -1;
-        w = (w + 1) >> 1;
-        h = (h + 1) >> 1;
-    }
-    return (int32_t)(res + 1);
-}
-
-static Jpeg2000TgtNode *ff_jpeg2000_tag_tree_init(int w, int h)
-{
-    int pw = w, ph = h;
-    Jpeg2000TgtNode *res, *t, *t2;
-    int32_t tt_size;
-
-    tt_size = tag_tree_size(w, h);
-    if (tt_size == -1)
-        return NULL;
-
-    t = res = av_mallocz_array(tt_size, sizeof(*t));
-    if (!res)
-        return NULL;
-
-    while (w > 1 || h > 1) {
-        int i, j;
-        pw = w;
-        ph = h;
-
-        w  = (w + 1) >> 1;
-        h  = (h + 1) >> 1;
-        t2 = t + pw * ph;
-
-        for (i = 0; i < ph; i++)
-            for (j = 0; j < pw; j++)
-                t[i * pw + j].parent = &t2[(i >> 1) * w + (j >> 1)];
-
-        t = t2;
-    }
-    t[0].parent = NULL;
-    return res;
-}
-
-uint8_t ff_jpeg2000_sigctxno_lut[256][4];
-
-static int getsigctxno(int flag, int bandno)
-{
-    int h, v, d;
-
-    h = ((flag & JPEG2000_T1_SIG_E)  ? 1 : 0) +
-        ((flag & JPEG2000_T1_SIG_W)  ? 1 : 0);
-    v = ((flag & JPEG2000_T1_SIG_N)  ? 1 : 0) +
-        ((flag & JPEG2000_T1_SIG_S)  ? 1 : 0);
-    d = ((flag & JPEG2000_T1_SIG_NE) ? 1 : 0) +
-        ((flag & JPEG2000_T1_SIG_NW) ? 1 : 0) +
-        ((flag & JPEG2000_T1_SIG_SE) ? 1 : 0) +
-        ((flag & JPEG2000_T1_SIG_SW) ? 1 : 0);
-    if (bandno < 3) {
-        if (bandno == 1)
-            FFSWAP(int, h, v);
-        if (h == 2)
-            return 8;
-        if (h == 1) {
-            if (v >= 1)
-                return 7;
-            if (d >= 1)
-                return 6;
-            return 5;
-        }
-        if (v == 2)
-            return 4;
-        if (v == 1)
-            return 3;
-        if (d >= 2)
-            return 2;
-        if (d == 1)
-            return 1;
-    } else {
-        if (d >= 3)
-            return 8;
-        if (d == 2) {
-            if (h + v >= 1)
-                return 7;
-            return 6;
-        }
-        if (d == 1) {
-            if (h + v >= 2)
-                return 5;
-            if (h + v == 1)
-                return 4;
-            return 3;
-        }
-        if (h + v >= 2)
-            return 2;
-        if (h + v == 1)
-            return 1;
-    }
-    return 0;
-}
-
-uint8_t ff_jpeg2000_sgnctxno_lut[16][16], ff_jpeg2000_xorbit_lut[16][16];
-
-static const int contribtab[3][3] = { {  0, -1,  1 }, { -1, -1,  0 }, {  1,  0,  1 } };
-static const int  ctxlbltab[3][3] = { { 13, 12, 11 }, { 10,  9, 10 }, { 11, 12, 13 } };
-static const int  xorbittab[3][3] = { {  1,  1,  1 }, {  1,  0,  0 }, {  0,  0,  0 } };
-
-static int getsgnctxno(int flag, uint8_t *xorbit)
-{
-    int vcontrib, hcontrib;
-
-    hcontrib = contribtab[flag & JPEG2000_T1_SIG_E ? flag & JPEG2000_T1_SGN_E ? 1 : 2 : 0]
-                         [flag & JPEG2000_T1_SIG_W ? flag & JPEG2000_T1_SGN_W ? 1 : 2 : 0] + 1;
-    vcontrib = contribtab[flag & JPEG2000_T1_SIG_S ? flag & JPEG2000_T1_SGN_S ? 1 : 2 : 0]
-                         [flag & JPEG2000_T1_SIG_N ? flag & JPEG2000_T1_SGN_N ? 1 : 2 : 0] + 1;
-    *xorbit = xorbittab[hcontrib][vcontrib];
-
-    return ctxlbltab[hcontrib][vcontrib];
-}
-
-void ff_jpeg2000_init_tier1_luts(void)
-{
-    int i, j;
-    for (i = 0; i < 256; i++)
-        for (j = 0; j < 4; j++)
-            ff_jpeg2000_sigctxno_lut[i][j] = getsigctxno(i, j);
-    for (i = 0; i < 16; i++)
-        for (j = 0; j < 16; j++)
-            ff_jpeg2000_sgnctxno_lut[i][j] =
-                getsgnctxno(i + (j << 8), &ff_jpeg2000_xorbit_lut[i][j]);
-}
-
-void ff_jpeg2000_set_significance(Jpeg2000T1Context *t1, int x, int y,
-                                  int negative)
-{
-    x++;
-    y++;
-    t1->flags[y][x] |= JPEG2000_T1_SIG;
-    if (negative) {
-        t1->flags[y][x + 1] |= JPEG2000_T1_SIG_W | JPEG2000_T1_SGN_W;
-        t1->flags[y][x - 1] |= JPEG2000_T1_SIG_E | JPEG2000_T1_SGN_E;
-        t1->flags[y + 1][x] |= JPEG2000_T1_SIG_N | JPEG2000_T1_SGN_N;
-        t1->flags[y - 1][x] |= JPEG2000_T1_SIG_S | JPEG2000_T1_SGN_S;
-    } else {
-        t1->flags[y][x + 1] |= JPEG2000_T1_SIG_W;
-        t1->flags[y][x - 1] |= JPEG2000_T1_SIG_E;
-        t1->flags[y + 1][x] |= JPEG2000_T1_SIG_N;
-        t1->flags[y - 1][x] |= JPEG2000_T1_SIG_S;
-    }
-    t1->flags[y + 1][x + 1] |= JPEG2000_T1_SIG_NW;
-    t1->flags[y + 1][x - 1] |= JPEG2000_T1_SIG_NE;
-    t1->flags[y - 1][x + 1] |= JPEG2000_T1_SIG_SW;
-    t1->flags[y - 1][x - 1] |= JPEG2000_T1_SIG_SE;
-}
-
-static const uint8_t lut_gain[2][4] = { { 0, 0, 0, 0 }, { 0, 1, 1, 2 } };
-
-int ff_jpeg2000_init_component(Jpeg2000Component *comp,
-                               Jpeg2000CodingStyle *codsty,
-                               Jpeg2000QuantStyle *qntsty,
-                               int cbps, int dx, int dy,
-                               AVCodecContext *avctx)
-{
-    uint8_t log2_band_prec_width, log2_band_prec_height;
-    int reslevelno, bandno, gbandno = 0, ret, i, j;
-    uint32_t csize;
-
-    if (!codsty->nreslevels2decode) {
-        av_log(avctx, AV_LOG_ERROR, "nreslevels2decode uninitialized\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (ret = ff_jpeg2000_dwt_init(&comp->dwt, comp->coord,
-                                   codsty->nreslevels2decode - 1,
-                                   codsty->transform))
-        return ret;
-    // component size comp->coord is uint16_t so ir cannot overflow
-    csize = (comp->coord[0][1] - comp->coord[0][0]) *
-            (comp->coord[1][1] - comp->coord[1][0]);
-
-    if (codsty->transform == FF_DWT97) {
-        comp->i_data = NULL;
-        comp->f_data = av_malloc_array(csize, sizeof(*comp->f_data));
-        if (!comp->f_data)
-            return AVERROR(ENOMEM);
-    } else {
-        comp->f_data = NULL;
-        comp->i_data = av_malloc_array(csize, sizeof(*comp->i_data));
-        if (!comp->i_data)
-            return AVERROR(ENOMEM);
-    }
-    comp->reslevel = av_malloc_array(codsty->nreslevels, sizeof(*comp->reslevel));
-    if (!comp->reslevel)
-        return AVERROR(ENOMEM);
-    /* LOOP on resolution levels */
-    for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++) {
-        int declvl = codsty->nreslevels - reslevelno;    // N_L -r see  ISO/IEC 15444-1:2002 B.5
-        Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno;
-
-        /* Compute borders for each resolution level.
-         * Computation of trx_0, trx_1, try_0 and try_1.
-         * see ISO/IEC 15444-1:2002 eq. B.5 and B-14 */
-        for (i = 0; i < 2; i++)
-            for (j = 0; j < 2; j++)
-                reslevel->coord[i][j] =
-                    ff_jpeg2000_ceildivpow2(comp->coord_o[i][j], declvl - 1);
-        // update precincts size: 2^n value
-        reslevel->log2_prec_width  = codsty->log2_prec_widths[reslevelno];
-        reslevel->log2_prec_height = codsty->log2_prec_heights[reslevelno];
-
-        /* Number of bands for each resolution level */
-        if (reslevelno == 0)
-            reslevel->nbands = 1;
-        else
-            reslevel->nbands = 3;
-
-        /* Number of precincts wich span the tile for resolution level reslevelno
-         * see B.6 in ISO/IEC 15444-1:2002 eq. B-16
-         * num_precincts_x = |- trx_1 / 2 ^ log2_prec_width) -| - (trx_0 / 2 ^ log2_prec_width)
-         * num_precincts_y = |- try_1 / 2 ^ log2_prec_width) -| - (try_0 / 2 ^ log2_prec_width)
-         * for Dcinema profiles in JPEG 2000
-         * num_precincts_x = |- trx_1 / 2 ^ log2_prec_width) -|
-         * num_precincts_y = |- try_1 / 2 ^ log2_prec_width) -| */
-        if (reslevel->coord[0][1] == reslevel->coord[0][0])
-            reslevel->num_precincts_x = 0;
-        else
-            reslevel->num_precincts_x =
-                ff_jpeg2000_ceildivpow2(reslevel->coord[0][1],
-                                        reslevel->log2_prec_width) -
-                (reslevel->coord[0][0] >> reslevel->log2_prec_width);
-
-        if (reslevel->coord[1][1] == reslevel->coord[1][0])
-            reslevel->num_precincts_y = 0;
-        else
-            reslevel->num_precincts_y =
-                ff_jpeg2000_ceildivpow2(reslevel->coord[1][1],
-                                        reslevel->log2_prec_height) -
-                (reslevel->coord[1][0] >> reslevel->log2_prec_height);
-
-        reslevel->band = av_malloc_array(reslevel->nbands, sizeof(*reslevel->band));
-        if (!reslevel->band)
-            return AVERROR(ENOMEM);
-
-        for (bandno = 0; bandno < reslevel->nbands; bandno++, gbandno++) {
-            Jpeg2000Band *band = reslevel->band + bandno;
-            int cblkno, precno;
-            int nb_precincts;
-
-            /* TODO: Implementation of quantization step not finished,
-             * see ISO/IEC 15444-1:2002 E.1 and A.6.4. */
-            switch (qntsty->quantsty) {
-                uint8_t gain;
-                int numbps;
-            case JPEG2000_QSTY_NONE:
-                /* TODO: to verify. No quantization in this case */
-                band->f_stepsize = 1;
-                break;
-            case JPEG2000_QSTY_SI:
-                /*TODO: Compute formula to implement. */
-                numbps = cbps +
-                         lut_gain[codsty->transform == FF_DWT53][bandno + (reslevelno > 0)];
-                band->f_stepsize = SHL(2048 + qntsty->mant[gbandno],
-                                       2 + numbps - qntsty->expn[gbandno]);
-                break;
-            case JPEG2000_QSTY_SE:
-                /* Exponent quantization step.
-                 * Formula:
-                 * delta_b = 2 ^ (R_b - expn_b) * (1 + (mant_b / 2 ^ 11))
-                 * R_b = R_I + log2 (gain_b )
-                 * see ISO/IEC 15444-1:2002 E.1.1 eqn. E-3 and E-4 */
-                /* TODO/WARN: value of log2 (gain_b ) not taken into account
-                 * but it works (compared to OpenJPEG). Why?
-                 * Further investigation needed. */
-                gain            = cbps;
-                band->f_stepsize  = pow(2.0, gain - qntsty->expn[gbandno]);
-                band->f_stepsize *= qntsty->mant[gbandno] / 2048.0 + 1.0;
-                break;
-            default:
-                band->f_stepsize = 0;
-                av_log(avctx, AV_LOG_ERROR, "Unknown quantization format\n");
-                break;
-            }
-            /* FIXME: In openjepg code stespize = stepsize * 0.5. Why?
-             * If not set output of entropic decoder is not correct. */
-            if (!av_codec_is_encoder(avctx->codec))
-                band->f_stepsize *= 0.5;
-
-            band->i_stepsize = band->f_stepsize * (1 << 16);
-
-            /* computation of tbx_0, tbx_1, tby_0, tby_1
-             * see ISO/IEC 15444-1:2002 B.5 eq. B-15 and tbl B.1
-             * codeblock width and height is computed for
-             * DCI JPEG 2000 codeblock_width = codeblock_width = 32 = 2 ^ 5 */
-            if (reslevelno == 0) {
-                /* for reslevelno = 0, only one band, x0_b = y0_b = 0 */
-                for (i = 0; i < 2; i++)
-                    for (j = 0; j < 2; j++)
-                        band->coord[i][j] =
-                            ff_jpeg2000_ceildivpow2(comp->coord_o[i][j] - comp->coord_o[i][0],
-                                                    declvl - 1);
-                log2_band_prec_width  = reslevel->log2_prec_width;
-                log2_band_prec_height = reslevel->log2_prec_height;
-                /* see ISO/IEC 15444-1:2002 eq. B-17 and eq. B-15 */
-                band->log2_cblk_width  = FFMIN(codsty->log2_cblk_width,
-                                               reslevel->log2_prec_width);
-                band->log2_cblk_height = FFMIN(codsty->log2_cblk_height,
-                                               reslevel->log2_prec_height);
-            } else {
-                /* 3 bands x0_b = 1 y0_b = 0; x0_b = 0 y0_b = 1; x0_b = y0_b = 1 */
-                /* x0_b and y0_b are computed with ((bandno + 1 >> i) & 1) */
-                for (i = 0; i < 2; i++)
-                    for (j = 0; j < 2; j++)
-                        /* Formula example for tbx_0 = ceildiv((tcx_0 - 2 ^ (declvl - 1) * x0_b) / declvl) */
-                        band->coord[i][j] =
-                            ff_jpeg2000_ceildivpow2(comp->coord_o[i][j] - comp->coord_o[i][0] -
-                                                    (((bandno + 1 >> i) & 1) << declvl - 1),
-                                                    declvl);
-                /* TODO: Manage case of 3 band offsets here or
-                 * in coding/decoding function? */
-
-                /* see ISO/IEC 15444-1:2002 eq. B-17 and eq. B-15 */
-                band->log2_cblk_width  = FFMIN(codsty->log2_cblk_width,
-                                               reslevel->log2_prec_width - 1);
-                band->log2_cblk_height = FFMIN(codsty->log2_cblk_height,
-                                               reslevel->log2_prec_height - 1);
-
-                log2_band_prec_width  = reslevel->log2_prec_width  - 1;
-                log2_band_prec_height = reslevel->log2_prec_height - 1;
-            }
-
-            for (j = 0; j < 2; j++)
-                band->coord[0][j] = ff_jpeg2000_ceildiv(band->coord[0][j], dx);
-            for (j = 0; j < 2; j++)
-                band->coord[1][j] = ff_jpeg2000_ceildiv(band->coord[1][j], dy);
-
-            band->prec = av_malloc_array(reslevel->num_precincts_x *
-                                         reslevel->num_precincts_y,
-                                         sizeof(*band->prec));
-            if (!band->prec)
-                return AVERROR(ENOMEM);
-
-            nb_precincts = reslevel->num_precincts_x * reslevel->num_precincts_y;
-
-            for (precno = 0; precno < nb_precincts; precno++) {
-                Jpeg2000Prec *prec = band->prec + precno;
-
-                /* TODO: Explain formula for JPEG200 DCINEMA. */
-                /* TODO: Verify with previous count of codeblocks per band */
-
-                /* Compute P_x0 */
-                prec->coord[0][0] = (precno % reslevel->num_precincts_x) *
-                                    (1 << log2_band_prec_width);
-                prec->coord[0][0] = FFMAX(prec->coord[0][0], band->coord[0][0]);
-
-                /* Compute P_y0 */
-                prec->coord[1][0] = (precno / reslevel->num_precincts_x) *
-                                    (1 << log2_band_prec_height);
-                prec->coord[1][0] = FFMAX(prec->coord[1][0], band->coord[1][0]);
-
-                /* Compute P_x1 */
-                prec->coord[0][1] = prec->coord[0][0] +
-                                    (1 << log2_band_prec_width);
-                prec->coord[0][1] = FFMIN(prec->coord[0][1], band->coord[0][1]);
-
-                /* Compute P_y1 */
-                prec->coord[1][1] = prec->coord[1][0] +
-                                    (1 << log2_band_prec_height);
-                prec->coord[1][1] = FFMIN(prec->coord[1][1], band->coord[1][1]);
-
-                prec->nb_codeblocks_width =
-                    ff_jpeg2000_ceildivpow2(prec->coord[0][1] -
-                                            prec->coord[0][0],
-                                            band->log2_cblk_width);
-                prec->nb_codeblocks_height =
-                    ff_jpeg2000_ceildivpow2(prec->coord[1][1] -
-                                            prec->coord[1][0],
-                                            band->log2_cblk_height);
-
-                /* Tag trees initialization */
-                prec->cblkincl =
-                    ff_jpeg2000_tag_tree_init(prec->nb_codeblocks_width,
-                                              prec->nb_codeblocks_height);
-                if (!prec->cblkincl)
-                    return AVERROR(ENOMEM);
-
-                prec->zerobits =
-                    ff_jpeg2000_tag_tree_init(prec->nb_codeblocks_width,
-                                              prec->nb_codeblocks_height);
-                if (!prec->zerobits)
-                    return AVERROR(ENOMEM);
-
-                prec->cblk = av_mallocz_array(prec->nb_codeblocks_width *
-                                              prec->nb_codeblocks_height,
-                                              sizeof(*prec->cblk));
-                if (!prec->cblk)
-                    return AVERROR(ENOMEM);
-                for (cblkno = 0; cblkno < prec->nb_codeblocks_width * prec->nb_codeblocks_height; cblkno++) {
-                    Jpeg2000Cblk *cblk = prec->cblk + cblkno;
-                    uint16_t Cx0, Cy0;
-
-                    /* Compute coordinates of codeblocks */
-                    /* Compute Cx0*/
-                    Cx0 = (prec->coord[0][0] >> band->log2_cblk_width) << band->log2_cblk_width;
-                    Cx0 = Cx0 + ((cblkno % prec->nb_codeblocks_width)  << band->log2_cblk_width);
-                    cblk->coord[0][0] = FFMAX(Cx0, prec->coord[0][0]);
-
-                    /* Compute Cy0*/
-                    Cy0 = (prec->coord[1][0] >> band->log2_cblk_height) << band->log2_cblk_height;
-                    Cy0 = Cy0 + ((cblkno / prec->nb_codeblocks_width)   << band->log2_cblk_height);
-                    cblk->coord[1][0] = FFMAX(Cy0, prec->coord[1][0]);
-
-                    /* Compute Cx1 */
-                    cblk->coord[0][1] = FFMIN(Cx0 + (1 << band->log2_cblk_width),
-                                              prec->coord[0][1]);
-
-                    /* Compute Cy1 */
-                    cblk->coord[1][1] = FFMIN(Cy0 + (1 << band->log2_cblk_height),
-                                              prec->coord[1][1]);
-                    /* Update code-blocks coordinates according sub-band position */
-                    if ((bandno + !!reslevelno) & 1) {
-                        cblk->coord[0][0] += comp->reslevel[reslevelno-1].coord[0][1] -
-                                             comp->reslevel[reslevelno-1].coord[0][0];
-                        cblk->coord[0][1] += comp->reslevel[reslevelno-1].coord[0][1] -
-                                             comp->reslevel[reslevelno-1].coord[0][0];
-                    }
-                    if ((bandno + !!reslevelno) & 2) {
-                        cblk->coord[1][0] += comp->reslevel[reslevelno-1].coord[1][1] -
-                                             comp->reslevel[reslevelno-1].coord[1][0];
-                        cblk->coord[1][1] += comp->reslevel[reslevelno-1].coord[1][1] -
-                                             comp->reslevel[reslevelno-1].coord[1][0];
-                    }
-
-                    cblk->zero      = 0;
-                    cblk->lblock    = 3;
-                    cblk->length    = 0;
-                    cblk->lengthinc = 0;
-                    cblk->npasses   = 0;
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
-{
-    int reslevelno, bandno, precno;
-    for (reslevelno = 0;
-         comp->reslevel && reslevelno < codsty->nreslevels;
-         reslevelno++) {
-        Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno;
-
-        for (bandno = 0; bandno < reslevel->nbands; bandno++) {
-            Jpeg2000Band *band = reslevel->band + bandno;
-            for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++) {
-                Jpeg2000Prec *prec = band->prec + precno;
-                av_freep(&prec->zerobits);
-                av_freep(&prec->cblkincl);
-                av_freep(&prec->cblk);
-            }
-
-            av_freep(&band->prec);
-        }
-        av_freep(&reslevel->band);
-    }
-
-    ff_dwt_destroy(&comp->dwt);
-    av_freep(&comp->reslevel);
-    av_freep(&comp->i_data);
-    av_freep(&comp->f_data);
-}
diff --git a/deps/libav/libavcodec/jpeg2000.h b/deps/libav/libavcodec/jpeg2000.h
deleted file mode 100644
index b96b7e2..0000000
--- a/deps/libav/libavcodec/jpeg2000.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * JPEG 2000 common defines, structures and functions
- * Copyright (c) 2007 Kamil Nowosad
- * Copyright (c) 2013 Nicolas Bertrand <nicoinattendu at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_JPEG2000_H
-#define AVCODEC_JPEG2000_H
-
-/**
- * @file
- * JPEG 2000 structures and defines common
- * to encoder and decoder
- */
-
-#include <stdint.h>
-
-#include "avcodec.h"
-#include "mqc.h"
-#include "jpeg2000dwt.h"
-
-enum Jpeg2000Markers {
-    JPEG2000_SOC = 0xff4f, // start of codestream
-    JPEG2000_SIZ = 0xff51, // image and tile size
-    JPEG2000_COD,          // coding style default
-    JPEG2000_COC,          // coding style component
-    JPEG2000_TLM = 0xff55, // packed packet headers, tile-part header
-    JPEG2000_PLM = 0xff57, // tile-part lengths
-    JPEG2000_PLT,          // packet length, main header
-    JPEG2000_QCD = 0xff5c, // quantization default
-    JPEG2000_QCC,          // quantization component
-    JPEG2000_RGN,          // region of interest
-    JPEG2000_POC,          // progression order change
-    JPEG2000_PPM,          // packet length, tile-part header
-    JPEG2000_PPT,          // packed packet headers, main header
-    JPEG2000_CRG = 0xff63, // component registration
-    JPEG2000_COM,          // comment
-    JPEG2000_SOT = 0xff90, // start of tile-part
-    JPEG2000_SOP,          // start of packet
-    JPEG2000_EPH,          // end of packet header
-    JPEG2000_SOD,          // start of data
-    JPEG2000_EOC = 0xffd9, // end of codestream
-};
-
-enum Jpeg2000Quantsty { // quantization style
-    JPEG2000_QSTY_NONE, // no quantization
-    JPEG2000_QSTY_SI,   // scalar derived
-    JPEG2000_QSTY_SE    // scalar expounded
-};
-
-#define JPEG2000_MAX_CBLKW 64
-#define JPEG2000_MAX_CBLKH 64
-
-
-#define JPEG2000_MAX_DECLEVELS 32
-#define JPEG2000_MAX_RESLEVELS (JPEG2000_MAX_DECLEVELS + 1)
-
-// T1 flags
-// flags determining significance of neighbor coefficients
-#define JPEG2000_T1_SIG_N  0x0001
-#define JPEG2000_T1_SIG_E  0x0002
-#define JPEG2000_T1_SIG_W  0x0004
-#define JPEG2000_T1_SIG_S  0x0008
-#define JPEG2000_T1_SIG_NE 0x0010
-#define JPEG2000_T1_SIG_NW 0x0020
-#define JPEG2000_T1_SIG_SE 0x0040
-#define JPEG2000_T1_SIG_SW 0x0080
-#define JPEG2000_T1_SIG_NB (JPEG2000_T1_SIG_N  | JPEG2000_T1_SIG_E  |   \
-                            JPEG2000_T1_SIG_S  | JPEG2000_T1_SIG_W  |   \
-                            JPEG2000_T1_SIG_NE | JPEG2000_T1_SIG_NW |   \
-                            JPEG2000_T1_SIG_SE | JPEG2000_T1_SIG_SW)
-// flags determining sign bit of neighbor coefficients
-#define JPEG2000_T1_SGN_N  0x0100
-#define JPEG2000_T1_SGN_S  0x0200
-#define JPEG2000_T1_SGN_W  0x0400
-#define JPEG2000_T1_SGN_E  0x0800
-
-#define JPEG2000_T1_VIS    0x1000
-#define JPEG2000_T1_SIG    0x2000
-#define JPEG2000_T1_REF    0x4000
-
-#define JPEG2000_T1_SGN    0x8000
-
-// Codeblock coding styles
-#define JPEG2000_CBLK_BYPASS    0x01 // Selective arithmetic coding bypass
-#define JPEG2000_CBLK_RESET     0x02 // Reset context probabilities
-#define JPEG2000_CBLK_TERMALL   0x04 // Terminate after each coding pass
-#define JPEG2000_CBLK_VSC       0x08 // Vertical stripe causal context formation
-#define JPEG2000_CBLK_PREDTERM  0x10 // Predictable termination
-#define JPEG2000_CBLK_SEGSYM    0x20 // Segmentation symbols present
-
-// Coding styles
-#define JPEG2000_CSTY_PREC      0x01 // Precincts defined in coding style
-#define JPEG2000_CSTY_SOP       0x02 // SOP marker present
-#define JPEG2000_CSTY_EPH       0x04 // EPH marker present
-
-// Progression orders
-#define JPEG2000_PGOD_LRCP      0x00  // Layer-resolution level-component-position progression
-#define JPEG2000_PGOD_RLCP      0x01  // Resolution level-layer-component-position progression
-#define JPEG2000_PGOD_RPCL      0x02  // Resolution level-position-component-layer progression
-#define JPEG2000_PGOD_PCRL      0x03  // Position-component-resolution level-layer progression
-#define JPEG2000_PGOD_CPRL      0x04  // Component-position-resolution level-layer progression
-
-typedef struct Jpeg2000T1Context {
-    int data[JPEG2000_MAX_CBLKW][JPEG2000_MAX_CBLKH];
-    int flags[JPEG2000_MAX_CBLKW + 2][JPEG2000_MAX_CBLKH + 2];
-    MqcState mqc;
-} Jpeg2000T1Context;
-
-typedef struct Jpeg2000TgtNode {
-    uint8_t val;
-    uint8_t vis;
-    struct Jpeg2000TgtNode *parent;
-} Jpeg2000TgtNode;
-
-typedef struct Jpeg2000CodingStyle {
-    uint8_t nreslevels;       // number of resolution levels
-    uint8_t nreslevels2decode; // number of resolution levels to decode
-    uint8_t log2_cblk_width,
-            log2_cblk_height; // exponent of codeblock size
-    uint8_t transform;        // DWT type
-    uint8_t csty;             // coding style
-    uint8_t nlayers;          // number of layers
-    uint8_t mct;              // multiple component transformation
-    uint8_t cblk_style;       // codeblock coding style
-    uint8_t prog_order;       // progression order
-    uint8_t log2_prec_widths[JPEG2000_MAX_RESLEVELS];  // precincts size according resolution levels
-    uint8_t log2_prec_heights[JPEG2000_MAX_RESLEVELS]; // TODO: initialize prec_size array with 0?
-} Jpeg2000CodingStyle;
-
-typedef struct Jpeg2000QuantStyle {
-    uint8_t expn[JPEG2000_MAX_DECLEVELS * 3];  // quantization exponent
-    uint32_t mant[JPEG2000_MAX_DECLEVELS * 3]; // quantization mantissa
-    uint8_t quantsty;      // quantization style
-    uint8_t nguardbits;    // number of guard bits
-} Jpeg2000QuantStyle;
-
-typedef struct Jpeg2000Cblk {
-    uint8_t npasses;
-    uint8_t ninclpasses; // number coding of passes included in codestream
-    uint8_t nonzerobits;
-    uint16_t length;
-    uint16_t lengthinc;
-    uint8_t lblock;
-    uint8_t zero;
-    uint8_t data[8192];
-    uint16_t coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
-} Jpeg2000Cblk; // code block
-
-typedef struct Jpeg2000Prec {
-    uint16_t nb_codeblocks_width;
-    uint16_t nb_codeblocks_height;
-    Jpeg2000TgtNode *zerobits;
-    Jpeg2000TgtNode *cblkincl;
-    Jpeg2000Cblk *cblk;
-    uint16_t coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
-} Jpeg2000Prec; // precinct
-
-typedef struct Jpeg2000Band {
-    uint16_t coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
-    uint16_t log2_cblk_width, log2_cblk_height;
-    int i_stepsize; // quantization stepsize
-    float f_stepsize; // quantization stepsize
-    Jpeg2000Prec *prec;
-} Jpeg2000Band; // subband
-
-typedef struct Jpeg2000ResLevel {
-    uint8_t nbands;
-    uint16_t coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
-    uint16_t num_precincts_x, num_precincts_y; // number of precincts in x/y direction
-    uint8_t log2_prec_width, log2_prec_height; // exponent of precinct size
-    Jpeg2000Band *band;
-} Jpeg2000ResLevel; // resolution level
-
-typedef struct Jpeg2000Component {
-    Jpeg2000ResLevel *reslevel;
-    DWTContext dwt;
-    float *f_data;
-    int *i_data;
-    uint16_t coord[2][2];   // border coordinates {{x0, x1}, {y0, y1}} -- can be reduced with lowres option
-    uint16_t coord_o[2][2]; // border coordinates {{x0, x1}, {y0, y1}} -- original values from jpeg2000 headers
-} Jpeg2000Component;
-
-/* misc tools */
-static inline int ff_jpeg2000_ceildivpow2(int a, int b)
-{
-    return (a + (1 << b) - 1) >> b;
-}
-
-static inline int ff_jpeg2000_ceildiv(int a, int b)
-{
-    return (a + b - 1) / b;
-}
-
-/* TIER-1 routines */
-
-/* Set up lookup tables used in TIER-1. */
-void ff_jpeg2000_init_tier1_luts(void);
-
-/* Update significance of a coefficient at current position (x,y) and
- * for neighbors. */
-void ff_jpeg2000_set_significance(Jpeg2000T1Context *t1,
-                                  int x, int y, int negative);
-
-extern uint8_t ff_jpeg2000_sigctxno_lut[256][4];
-
-/* Get context label (number in range[0..8]) of a coefficient for significance
- * propagation and cleanup coding passes. */
-static inline int ff_jpeg2000_getsigctxno(int flag, int bandno)
-{
-    return ff_jpeg2000_sigctxno_lut[flag & 255][bandno];
-}
-
-static const uint8_t refctxno_lut[2][2] = { { 14, 15 }, { 16, 16 } };
-
-/* Get context label (number in range[14..16]) of a coefficient for magnitude
- * refinement pass. */
-static inline int ff_jpeg2000_getrefctxno(int flag)
-{
-    return refctxno_lut[(flag >> 14) & 1][(flag & 255) != 0];
-}
-
-extern uint8_t ff_jpeg2000_sgnctxno_lut[16][16];
-extern uint8_t ff_jpeg2000_xorbit_lut[16][16];
-
-/* Get context label (number in range[9..13]) for sign decoding. */
-static inline int ff_jpeg2000_getsgnctxno(int flag, int *xorbit)
-{
-    *xorbit = ff_jpeg2000_xorbit_lut[flag & 15][(flag >> 8) & 15];
-    return ff_jpeg2000_sgnctxno_lut[flag & 15][(flag >> 8) & 15];
-}
-
-int ff_jpeg2000_init_component(Jpeg2000Component *comp,
-                               Jpeg2000CodingStyle *codsty,
-                               Jpeg2000QuantStyle *qntsty,
-                               int cbps, int dx, int dy,
-                               AVCodecContext *ctx);
-
-void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty);
-
-#endif /* AVCODEC_JPEG2000_H */
diff --git a/deps/libav/libavcodec/jpeg2000dec.c b/deps/libav/libavcodec/jpeg2000dec.c
deleted file mode 100644
index cc154c3..0000000
--- a/deps/libav/libavcodec/jpeg2000dec.c
+++ /dev/null
@@ -1,1512 +0,0 @@
-/*
- * JPEG 2000 image decoder
- * Copyright (c) 2007 Kamil Nowosad
- * Copyright (c) 2013 Nicolas Bertrand <nicoinattendu at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * JPEG 2000 image decoder
- */
-
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "thread.h"
-#include "jpeg2000.h"
-
-#define JP2_SIG_TYPE    0x6A502020
-#define JP2_SIG_VALUE   0x0D0A870A
-#define JP2_CODESTREAM  0x6A703263
-
-#define HAD_COC 0x01
-#define HAD_QCC 0x02
-
-typedef struct Jpeg2000TilePart {
-    uint8_t tile_index;                 // Tile index who refers the tile-part
-    const uint8_t *tp_end;
-    GetByteContext tpg;                 // bit stream in tile-part
-} Jpeg2000TilePart;
-
-/* RMK: For JPEG2000 DCINEMA 3 tile-parts in a tile
- * one per component, so tile_part elements have a size of 3 */
-typedef struct Jpeg2000Tile {
-    Jpeg2000Component   *comp;
-    uint8_t             properties[4];
-    Jpeg2000CodingStyle codsty[4];
-    Jpeg2000QuantStyle  qntsty[4];
-    Jpeg2000TilePart    tile_part[3];
-    uint16_t tp_idx;                    // Tile-part index
-} Jpeg2000Tile;
-
-typedef struct Jpeg2000DecoderContext {
-    AVClass         *class;
-    AVCodecContext  *avctx;
-    GetByteContext g;
-
-    int             width, height;
-    int             image_offset_x, image_offset_y;
-    int             tile_offset_x, tile_offset_y;
-    uint8_t         cbps[4];    // bits per sample in particular components
-    uint8_t         sgnd[4];    // if a component is signed
-    uint8_t         properties[4];
-    int             cdx[4], cdy[4];
-    int             precision;
-    int             ncomponents;
-    int             tile_width, tile_height;
-    unsigned        numXtiles, numYtiles;
-    int             maxtilelen;
-
-    Jpeg2000CodingStyle codsty[4];
-    Jpeg2000QuantStyle  qntsty[4];
-
-    int             bit_index;
-
-    int16_t         curtileno;
-    Jpeg2000Tile    *tile;
-
-    /*options parameters*/
-    int             reduction_factor;
-} Jpeg2000DecoderContext;
-
-/* get_bits functions for JPEG2000 packet bitstream
- * It is a get_bit function with a bit-stuffing routine. If the value of the
- * byte is 0xFF, the next byte includes an extra zero bit stuffed into the MSB.
- * cf. ISO-15444-1:2002 / B.10.1 Bit-stuffing routine */
-static int get_bits(Jpeg2000DecoderContext *s, int n)
-{
-    int res = 0;
-    while (--n >= 0) {
-        res <<= 1;
-        if (s->bit_index == 0) {
-            s->bit_index = 7 + (bytestream2_get_byte(&s->g) != 0xFFu);
-        }
-        s->bit_index--;
-        res |= (bytestream2_peek_byte(&s->g) >> s->bit_index) & 1;
-    }
-    return res;
-}
-
-static void jpeg2000_flush(Jpeg2000DecoderContext *s)
-{
-    if (bytestream2_get_byte(&s->g) == 0xff)
-        bytestream2_skip(&s->g, 1);
-    s->bit_index = 8;
-}
-
-/* decode the value stored in node */
-static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node,
-                           int threshold)
-{
-    Jpeg2000TgtNode *stack[30];
-    int sp = -1, curval = 0;
-
-    if (!node)
-        return AVERROR_INVALIDDATA;
-
-    while (node && !node->vis) {
-        stack[++sp] = node;
-        node        = node->parent;
-    }
-
-    if (node)
-        curval = node->val;
-    else
-        curval = stack[sp]->val;
-
-    while (curval < threshold && sp >= 0) {
-        if (curval < stack[sp]->val)
-            curval = stack[sp]->val;
-        while (curval < threshold) {
-            int ret;
-            if ((ret = get_bits(s, 1)) > 0) {
-                stack[sp]->vis++;
-                break;
-            } else if (!ret)
-                curval++;
-            else
-                return ret;
-        }
-        stack[sp]->val = curval;
-        sp--;
-    }
-    return curval;
-}
-
-/* marker segments */
-/* get sizes and offsets of image, tiles; number of components */
-static int get_siz(Jpeg2000DecoderContext *s)
-{
-    int i;
-    int ncomponents;
-
-    if (bytestream2_get_bytes_left(&s->g) < 36)
-        return AVERROR_INVALIDDATA;
-
-    s->avctx->profile = bytestream2_get_be16u(&s->g); // Rsiz
-    s->width          = bytestream2_get_be32u(&s->g); // Width
-    s->height         = bytestream2_get_be32u(&s->g); // Height
-    s->image_offset_x = bytestream2_get_be32u(&s->g); // X0Siz
-    s->image_offset_y = bytestream2_get_be32u(&s->g); // Y0Siz
-    s->tile_width     = bytestream2_get_be32u(&s->g); // XTSiz
-    s->tile_height    = bytestream2_get_be32u(&s->g); // YTSiz
-    s->tile_offset_x  = bytestream2_get_be32u(&s->g); // XT0Siz
-    s->tile_offset_y  = bytestream2_get_be32u(&s->g); // YT0Siz
-    ncomponents       = bytestream2_get_be16u(&s->g); // CSiz
-
-    if (ncomponents <= 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid number of components: %d\n",
-               s->ncomponents);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (ncomponents > 3) {
-        avpriv_request_sample(s->avctx, "Support for %d components",
-                              s->ncomponents);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    s->ncomponents = ncomponents;
-
-    if (s->tile_width <= 0 || s->tile_height <= 0 ||
-        s->tile_width > s->width || s->tile_height > s->height) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid tile dimension %dx%d.\n",
-               s->tile_width, s->tile_height);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (bytestream2_get_bytes_left(&s->g) < 3 * s->ncomponents)
-        return AVERROR_INVALIDDATA;
-
-    for (i = 0; i < s->ncomponents; i++) { // Ssiz_i XRsiz_i, YRsiz_i
-        uint8_t x    = bytestream2_get_byteu(&s->g);
-        s->cbps[i]   = (x & 0x7f) + 1;
-        s->precision = FFMAX(s->cbps[i], s->precision);
-        s->sgnd[i]   = !!(x & 0x80);
-        s->cdx[i]    = bytestream2_get_byteu(&s->g);
-        s->cdy[i]    = bytestream2_get_byteu(&s->g);
-
-        if (s->cdx[i] != 1 || s->cdy[i] != 1) {
-            avpriv_request_sample(s->avctx,
-                                  "CDxy values %d %d for component %d",
-                                  s->cdx[i], s->cdy[i], i);
-            if (!s->cdx[i] || !s->cdy[i])
-                return AVERROR_INVALIDDATA;
-            else
-                return AVERROR_PATCHWELCOME;
-        }
-    }
-
-    s->numXtiles = ff_jpeg2000_ceildiv(s->width  - s->tile_offset_x, s->tile_width);
-    s->numYtiles = ff_jpeg2000_ceildiv(s->height - s->tile_offset_y, s->tile_height);
-
-    s->tile = av_mallocz_array(s->numXtiles * s->numYtiles, sizeof(*s->tile));
-    if (!s->tile) {
-        s->numXtiles = s->numYtiles = 0;
-        return AVERROR(ENOMEM);
-    }
-
-    for (i = 0; i < s->numXtiles * s->numYtiles; i++) {
-        Jpeg2000Tile *tile = s->tile + i;
-
-        tile->comp = av_mallocz(s->ncomponents * sizeof(*tile->comp));
-        if (!tile->comp)
-            return AVERROR(ENOMEM);
-    }
-
-    /* compute image size with reduction factor */
-    s->avctx->width  = ff_jpeg2000_ceildivpow2(s->width  - s->image_offset_x,
-                                               s->reduction_factor);
-    s->avctx->height = ff_jpeg2000_ceildivpow2(s->height - s->image_offset_y,
-                                               s->reduction_factor);
-
-    switch (s->ncomponents) {
-    case 1:
-        if (s->precision > 8)
-            s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
-        else
-            s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-        break;
-    case 3:
-        switch (s->avctx->profile) {
-        case FF_PROFILE_JPEG2000_DCINEMA_2K:
-        case FF_PROFILE_JPEG2000_DCINEMA_4K:
-            /* XYZ color-space for digital cinema profiles */
-            s->avctx->pix_fmt = AV_PIX_FMT_XYZ12;
-            break;
-        default:
-            if (s->precision > 8)
-                s->avctx->pix_fmt = AV_PIX_FMT_RGB48;
-            else
-                s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
-            break;
-        }
-        break;
-    case 4:
-        s->avctx->pix_fmt = AV_PIX_FMT_RGBA;
-        break;
-    default:
-        /* pixel format can not be identified */
-        s->avctx->pix_fmt = AV_PIX_FMT_NONE;
-        break;
-    }
-    return 0;
-}
-
-/* get common part for COD and COC segments */
-static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c)
-{
-    uint8_t byte;
-
-    if (bytestream2_get_bytes_left(&s->g) < 5)
-        return AVERROR_INVALIDDATA;
-
-    /*  nreslevels = number of resolution levels
-                   = number of decomposition level +1 */
-    c->nreslevels = bytestream2_get_byteu(&s->g) + 1;
-
-    if (c->nreslevels > JPEG2000_MAX_RESLEVELS)
-        return AVERROR_INVALIDDATA;
-
-    /* compute number of resolution levels to decode */
-    if (c->nreslevels < s->reduction_factor)
-        c->nreslevels2decode = 1;
-    else
-        c->nreslevels2decode = c->nreslevels - s->reduction_factor;
-
-    c->log2_cblk_width  = bytestream2_get_byteu(&s->g) + 2; // cblk width
-    c->log2_cblk_height = bytestream2_get_byteu(&s->g) + 2; // cblk height
-
-    if (c->log2_cblk_width > 10 || c->log2_cblk_height > 10 ||
-        c->log2_cblk_width + c->log2_cblk_height > 12) {
-        av_log(s->avctx, AV_LOG_ERROR, "cblk size invalid\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    c->cblk_style = bytestream2_get_byteu(&s->g);
-    if (c->cblk_style != 0) { // cblk style
-        avpriv_request_sample(s->avctx, "Support for extra cblk styles");
-        return AVERROR_PATCHWELCOME;
-    }
-    c->transform = bytestream2_get_byteu(&s->g); // DWT transformation type
-    /* set integer 9/7 DWT in case of BITEXACT flag */
-    if ((s->avctx->flags & CODEC_FLAG_BITEXACT) && (c->transform == FF_DWT97))
-        c->transform = FF_DWT97_INT;
-
-    if (c->csty & JPEG2000_CSTY_PREC) {
-        int i;
-        for (i = 0; i < c->nreslevels; i++) {
-            byte = bytestream2_get_byte(&s->g);
-            c->log2_prec_widths[i]  =  byte       & 0x0F;    // precinct PPx
-            c->log2_prec_heights[i] = (byte >> 4) & 0x0F;    // precinct PPy
-        }
-    } else {
-        memset(c->log2_prec_widths , 15, sizeof(c->log2_prec_widths ));
-        memset(c->log2_prec_heights, 15, sizeof(c->log2_prec_heights));
-    }
-    return 0;
-}
-
-/* get coding parameters for a particular tile or whole image*/
-static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
-                   uint8_t *properties)
-{
-    Jpeg2000CodingStyle tmp;
-    int compno, ret;
-
-    if (bytestream2_get_bytes_left(&s->g) < 5)
-        return AVERROR_INVALIDDATA;
-
-    tmp.csty = bytestream2_get_byteu(&s->g);
-
-    // get progression order
-    tmp.prog_order = bytestream2_get_byteu(&s->g);
-
-    tmp.nlayers    = bytestream2_get_be16u(&s->g);
-    tmp.mct        = bytestream2_get_byteu(&s->g); // multiple component transformation
-
-    if (tmp.mct && s->ncomponents < 3) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "MCT %d with too few components (%d)\n",
-               tmp.mct, s->ncomponents);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = get_cox(s, &tmp)) < 0)
-        return ret;
-
-    for (compno = 0; compno < s->ncomponents; compno++)
-        if (!(properties[compno] & HAD_COC))
-            memcpy(c + compno, &tmp, sizeof(tmp));
-    return 0;
-}
-
-/* Get coding parameters for a component in the whole image or a
- * particular tile. */
-static int get_coc(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
-                   uint8_t *properties)
-{
-    int compno, ret;
-
-    if (bytestream2_get_bytes_left(&s->g) < 2)
-        return AVERROR_INVALIDDATA;
-
-    compno = bytestream2_get_byteu(&s->g);
-
-    if (compno >= s->ncomponents) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Invalid compno %d. There are %d components in the image.\n",
-               compno, s->ncomponents);
-        return AVERROR_INVALIDDATA;
-    }
-
-    c      += compno;
-    c->csty = bytestream2_get_byteu(&s->g);
-
-    if ((ret = get_cox(s, c)) < 0)
-        return ret;
-
-    properties[compno] |= HAD_COC;
-    return 0;
-}
-
-/* Get common part for QCD and QCC segments. */
-static int get_qcx(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q)
-{
-    int i, x;
-
-    if (bytestream2_get_bytes_left(&s->g) < 1)
-        return AVERROR_INVALIDDATA;
-
-    x = bytestream2_get_byteu(&s->g); // Sqcd
-
-    q->nguardbits = x >> 5;
-    q->quantsty   = x & 0x1f;
-
-    if (q->quantsty == JPEG2000_QSTY_NONE) {
-        n -= 3;
-        if (bytestream2_get_bytes_left(&s->g) < n ||
-            n > JPEG2000_MAX_DECLEVELS)
-            return AVERROR_INVALIDDATA;
-        for (i = 0; i < n; i++)
-            q->expn[i] = bytestream2_get_byteu(&s->g) >> 3;
-    } else if (q->quantsty == JPEG2000_QSTY_SI) {
-        if (bytestream2_get_bytes_left(&s->g) < 2)
-            return AVERROR_INVALIDDATA;
-        x          = bytestream2_get_be16u(&s->g);
-        q->expn[0] = x >> 11;
-        q->mant[0] = x & 0x7ff;
-        for (i = 1; i < JPEG2000_MAX_DECLEVELS * 3; i++) {
-            int curexpn = FFMAX(0, q->expn[0] - (i - 1) / 3);
-            q->expn[i] = curexpn;
-            q->mant[i] = q->mant[0];
-        }
-    } else {
-        n = (n - 3) >> 1;
-        if (bytestream2_get_bytes_left(&s->g) < 2 * n ||
-            n > JPEG2000_MAX_DECLEVELS)
-            return AVERROR_INVALIDDATA;
-        for (i = 0; i < n; i++) {
-            x          = bytestream2_get_be16u(&s->g);
-            q->expn[i] = x >> 11;
-            q->mant[i] = x & 0x7ff;
-        }
-    }
-    return 0;
-}
-
-/* Get quantization parameters for a particular tile or a whole image. */
-static int get_qcd(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q,
-                   uint8_t *properties)
-{
-    Jpeg2000QuantStyle tmp;
-    int compno, ret;
-
-    if ((ret = get_qcx(s, n, &tmp)) < 0)
-        return ret;
-    for (compno = 0; compno < s->ncomponents; compno++)
-        if (!(properties[compno] & HAD_QCC))
-            memcpy(q + compno, &tmp, sizeof(tmp));
-    return 0;
-}
-
-/* Get quantization parameters for a component in the whole image
- * on in a particular tile. */
-static int get_qcc(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q,
-                   uint8_t *properties)
-{
-    int compno;
-
-    if (bytestream2_get_bytes_left(&s->g) < 1)
-        return AVERROR_INVALIDDATA;
-
-    compno = bytestream2_get_byteu(&s->g);
-
-    if (compno >= s->ncomponents) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Invalid compno %d. There are %d components in the image.\n",
-               compno, s->ncomponents);
-        return AVERROR_INVALIDDATA;
-    }
-
-    properties[compno] |= HAD_QCC;
-    return get_qcx(s, n - 1, q + compno);
-}
-
-/* Get start of tile segment. */
-static int get_sot(Jpeg2000DecoderContext *s, int n)
-{
-    Jpeg2000TilePart *tp;
-    uint16_t Isot;
-    uint32_t Psot;
-    uint8_t TPsot;
-
-    if (bytestream2_get_bytes_left(&s->g) < 8)
-        return AVERROR_INVALIDDATA;
-
-    Isot = bytestream2_get_be16u(&s->g);        // Isot
-    if (Isot >= s->numXtiles * s->numYtiles)
-        return AVERROR_INVALIDDATA;
-
-    if (Isot) {
-        avpriv_request_sample(s->avctx, "Support for more than one tile");
-        return AVERROR_PATCHWELCOME;
-    }
-    Psot  = bytestream2_get_be32u(&s->g);       // Psot
-    TPsot = bytestream2_get_byteu(&s->g);       // TPsot
-
-    /* Read TNSot but not used */
-    bytestream2_get_byteu(&s->g);               // TNsot
-
-    if (Psot > bytestream2_get_bytes_left(&s->g) + n + 2) {
-        av_log(s->avctx, AV_LOG_ERROR, "Psot %d too big\n", Psot);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (TPsot >= FF_ARRAY_ELEMS(s->tile[Isot].tile_part)) {
-        avpriv_request_sample(s->avctx, "Support for %d components", TPsot);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    s->tile[Isot].tp_idx = TPsot;
-    tp             = s->tile[Isot].tile_part + TPsot;
-    tp->tile_index = Isot;
-    tp->tp_end     = s->g.buffer + Psot - n - 2;
-
-    if (!TPsot) {
-        Jpeg2000Tile *tile = s->tile + s->curtileno;
-
-        /* copy defaults */
-        memcpy(tile->codsty, s->codsty, s->ncomponents * sizeof(Jpeg2000CodingStyle));
-        memcpy(tile->qntsty, s->qntsty, s->ncomponents * sizeof(Jpeg2000QuantStyle));
-    }
-
-    return 0;
-}
-
-/* Tile-part lengths: see ISO 15444-1:2002, section A.7.1
- * Used to know the number of tile parts and lengths.
- * There may be multiple TLMs in the header.
- * TODO: The function is not used for tile-parts management, nor anywhere else.
- * It can be useful to allocate memory for tile parts, before managing the SOT
- * markers. Parsing the TLM header is needed to increment the input header
- * buffer.
- * This marker is mandatory for DCI. */
-static uint8_t get_tlm(Jpeg2000DecoderContext *s, int n)
-{
-    uint8_t Stlm, ST, SP, tile_tlm, i;
-    bytestream2_get_byte(&s->g);               /* Ztlm: skipped */
-    Stlm = bytestream2_get_byte(&s->g);
-
-    // too complex ? ST = ((Stlm >> 4) & 0x01) + ((Stlm >> 4) & 0x02);
-    ST = (Stlm >> 4) & 0x03;
-    // TODO: Manage case of ST = 0b11 --> raise error
-    SP       = (Stlm >> 6) & 0x01;
-    tile_tlm = (n - 4) / ((SP + 1) * 2 + ST);
-    for (i = 0; i < tile_tlm; i++) {
-        switch (ST) {
-        case 0:
-            break;
-        case 1:
-            bytestream2_get_byte(&s->g);
-            break;
-        case 2:
-            bytestream2_get_be16(&s->g);
-            break;
-        case 3:
-            bytestream2_get_be32(&s->g);
-            break;
-        }
-        if (SP == 0) {
-            bytestream2_get_be16(&s->g);
-        } else {
-            bytestream2_get_be32(&s->g);
-        }
-    }
-    return 0;
-}
-
-static int init_tile(Jpeg2000DecoderContext *s, int tileno)
-{
-    int compno;
-    int tilex = tileno % s->numXtiles;
-    int tiley = tileno / s->numXtiles;
-    Jpeg2000Tile *tile = s->tile + tileno;
-
-    if (!tile->comp)
-        return AVERROR(ENOMEM);
-
-    for (compno = 0; compno < s->ncomponents; compno++) {
-        Jpeg2000Component *comp = tile->comp + compno;
-        Jpeg2000CodingStyle *codsty = tile->codsty + compno;
-        Jpeg2000QuantStyle  *qntsty = tile->qntsty + compno;
-        int ret; // global bandno
-
-        comp->coord_o[0][0] = FFMAX(tilex       * s->tile_width  + s->tile_offset_x, s->image_offset_x);
-        comp->coord_o[0][1] = FFMIN((tilex + 1) * s->tile_width  + s->tile_offset_x, s->width);
-        comp->coord_o[1][0] = FFMAX(tiley       * s->tile_height + s->tile_offset_y, s->image_offset_y);
-        comp->coord_o[1][1] = FFMIN((tiley + 1) * s->tile_height + s->tile_offset_y, s->height);
-
-        comp->coord[0][0] = ff_jpeg2000_ceildivpow2(comp->coord_o[0][0], s->reduction_factor);
-        comp->coord[0][1] = ff_jpeg2000_ceildivpow2(comp->coord_o[0][1], s->reduction_factor);
-        comp->coord[1][0] = ff_jpeg2000_ceildivpow2(comp->coord_o[1][0], s->reduction_factor);
-        comp->coord[1][1] = ff_jpeg2000_ceildivpow2(comp->coord_o[1][1], s->reduction_factor);
-
-        if (ret = ff_jpeg2000_init_component(comp, codsty, qntsty,
-                                             s->cbps[compno], s->cdx[compno],
-                                             s->cdy[compno], s->avctx))
-            return ret;
-    }
-    return 0;
-}
-
-/* Read the number of coding passes. */
-static int getnpasses(Jpeg2000DecoderContext *s)
-{
-    int num;
-    if (!get_bits(s, 1))
-        return 1;
-    if (!get_bits(s, 1))
-        return 2;
-    if ((num = get_bits(s, 2)) != 3)
-        return num < 0 ? num : 3 + num;
-    if ((num = get_bits(s, 5)) != 31)
-        return num < 0 ? num : 6 + num;
-    num = get_bits(s, 7);
-    return num < 0 ? num : 37 + num;
-}
-
-static int getlblockinc(Jpeg2000DecoderContext *s)
-{
-    int res = 0, ret;
-    while (ret = get_bits(s, 1)) {
-        if (ret < 0)
-            return ret;
-        res++;
-    }
-    return res;
-}
-
-static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
-                                  Jpeg2000CodingStyle *codsty,
-                                  Jpeg2000ResLevel *rlevel, int precno,
-                                  int layno, uint8_t *expn, int numgbits)
-{
-    int bandno, cblkno, ret, nb_code_blocks;
-
-    if (!(ret = get_bits(s, 1))) {
-        jpeg2000_flush(s);
-        return 0;
-    } else if (ret < 0)
-        return ret;
-
-    for (bandno = 0; bandno < rlevel->nbands; bandno++) {
-        Jpeg2000Band *band = rlevel->band + bandno;
-        Jpeg2000Prec *prec = band->prec + precno;
-
-        if (band->coord[0][0] == band->coord[0][1] ||
-            band->coord[1][0] == band->coord[1][1])
-            continue;
-        nb_code_blocks =  prec->nb_codeblocks_height *
-                          prec->nb_codeblocks_width;
-        for (cblkno = 0; cblkno < nb_code_blocks; cblkno++) {
-            Jpeg2000Cblk *cblk = prec->cblk + cblkno;
-            int incl, newpasses, llen;
-
-            if (cblk->npasses)
-                incl = get_bits(s, 1);
-            else
-                incl = tag_tree_decode(s, prec->cblkincl + cblkno, layno + 1) == layno;
-            if (!incl)
-                continue;
-            else if (incl < 0)
-                return incl;
-
-            if (!cblk->npasses) {
-                int v = expn[bandno] + numgbits - 1 -
-                        tag_tree_decode(s, prec->zerobits + cblkno, 100);
-                if (v < 0) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "nonzerobits %d invalid\n", v);
-                    return AVERROR_INVALIDDATA;
-                }
-                cblk->nonzerobits = v;
-            }
-            if ((newpasses = getnpasses(s)) < 0)
-                return newpasses;
-            if ((llen = getlblockinc(s)) < 0)
-                return llen;
-            cblk->lblock += llen;
-            if ((ret = get_bits(s, av_log2(newpasses) + cblk->lblock)) < 0)
-                return ret;
-            if (ret > sizeof(cblk->data)) {
-                avpriv_request_sample(s->avctx,
-                                      "Block with lengthinc greater than %zu",
-                                      sizeof(cblk->data));
-                return AVERROR_PATCHWELCOME;
-            }
-            cblk->lengthinc = ret;
-            cblk->npasses  += newpasses;
-        }
-    }
-    jpeg2000_flush(s);
-
-    if (codsty->csty & JPEG2000_CSTY_EPH) {
-        if (bytestream2_peek_be16(&s->g) == JPEG2000_EPH)
-            bytestream2_skip(&s->g, 2);
-        else
-            av_log(s->avctx, AV_LOG_ERROR, "EPH marker not found.\n");
-    }
-
-    for (bandno = 0; bandno < rlevel->nbands; bandno++) {
-        Jpeg2000Band *band = rlevel->band + bandno;
-        Jpeg2000Prec *prec = band->prec + precno;
-
-        nb_code_blocks = prec->nb_codeblocks_height * prec->nb_codeblocks_width;
-        for (cblkno = 0; cblkno < nb_code_blocks; cblkno++) {
-            Jpeg2000Cblk *cblk = prec->cblk + cblkno;
-            if (bytestream2_get_bytes_left(&s->g) < cblk->lengthinc)
-                return AVERROR_INVALIDDATA;
-            /* Code-block data can be empty. In that case initialize data
-             * with 0xFFFF. */
-            if (cblk->lengthinc > 0) {
-                bytestream2_get_bufferu(&s->g, cblk->data, cblk->lengthinc);
-            } else {
-                cblk->data[0] = 0xFF;
-                cblk->data[1] = 0xFF;
-            }
-            cblk->length   += cblk->lengthinc;
-            cblk->lengthinc = 0;
-
-            if (cblk->length > sizeof(cblk->data)) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "Block length %d > data size %zd\n",
-                       cblk->length, sizeof(cblk->data));
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-    return 0;
-}
-
-static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
-{
-    int ret = 0;
-    int layno, reslevelno, compno, precno, ok_reslevel;
-    int x, y;
-
-    s->bit_index = 8;
-    switch (tile->codsty[0].prog_order) {
-    case JPEG2000_PGOD_LRCP:
-        for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
-            ok_reslevel = 1;
-            for (reslevelno = 0; ok_reslevel; reslevelno++) {
-                ok_reslevel = 0;
-                for (compno = 0; compno < s->ncomponents; compno++) {
-                    Jpeg2000CodingStyle *codsty = tile->codsty + compno;
-                    Jpeg2000QuantStyle *qntsty  = tile->qntsty + compno;
-                    if (reslevelno < codsty->nreslevels) {
-                        Jpeg2000ResLevel *rlevel = tile->comp[compno].reslevel +
-                                                   reslevelno;
-                        ok_reslevel = 1;
-                        for (precno = 0; precno < rlevel->num_precincts_x * rlevel->num_precincts_y; precno++)
-                            if ((ret = jpeg2000_decode_packet(s,
-                                                              codsty, rlevel,
-                                                              precno, layno,
-                                                              qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
-                                                              qntsty->nguardbits)) < 0)
-                                return ret;
-                    }
-                }
-            }
-        }
-        break;
-
-    case JPEG2000_PGOD_CPRL:
-        for (compno = 0; compno < s->ncomponents; compno++) {
-            Jpeg2000CodingStyle *codsty = tile->codsty + compno;
-            Jpeg2000QuantStyle *qntsty  = tile->qntsty + compno;
-
-            /* Set bit stream buffer address according to tile-part.
-             * For DCinema one tile-part per component, so can be
-             * indexed by component. */
-            s->g = tile->tile_part[compno].tpg;
-
-            /* Position loop (y axis)
-             * TODO: Automate computing of step 256.
-             * Fixed here, but to be computed before entering here. */
-            for (y = 0; y < s->height; y += 256) {
-                /* Position loop (y axis)
-                 * TODO: automate computing of step 256.
-                 * Fixed here, but to be computed before entering here. */
-                for (x = 0; x < s->width; x += 256) {
-                    for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++) {
-                        uint16_t prcx, prcy;
-                        uint8_t reducedresno = codsty->nreslevels - 1 -reslevelno; //  ==> N_L - r
-                        Jpeg2000ResLevel *rlevel = tile->comp[compno].reslevel + reslevelno;
-
-                        if (!((y % (1 << (rlevel->log2_prec_height + reducedresno)) == 0) ||
-                              (y == 0))) // TODO: 2nd condition simplified as try0 always =0 for dcinema
-                            continue;
-
-                        if (!((x % (1 << (rlevel->log2_prec_width + reducedresno)) == 0) ||
-                              (x == 0))) // TODO: 2nd condition simplified as try0 always =0 for dcinema
-                            continue;
-
-                        // check if a precinct exists
-                        prcx   = ff_jpeg2000_ceildivpow2(x, reducedresno) >> rlevel->log2_prec_width;
-                        prcy   = ff_jpeg2000_ceildivpow2(y, reducedresno) >> rlevel->log2_prec_height;
-                        precno = prcx + rlevel->num_precincts_x * prcy;
-                        for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
-                            if ((ret = jpeg2000_decode_packet(s, codsty, rlevel,
-                                                              precno, layno,
-                                                              qntsty->expn + (reslevelno ? 3 * (reslevelno - 1) + 1 : 0),
-                                                              qntsty->nguardbits)) < 0)
-                                return ret;
-                        }
-                    }
-                }
-            }
-        }
-        break;
-
-    case JPEG2000_PGOD_RLCP:
-        avpriv_request_sample(s->avctx, "Progression order RLCP");
-        ret = AVERROR_PATCHWELCOME;
-        break;
-
-    case JPEG2000_PGOD_RPCL:
-        avpriv_request_sample(s->avctx, "Progression order RPCL");
-        ret = AVERROR_PATCHWELCOME;
-        break;
-
-    case JPEG2000_PGOD_PCRL:
-        avpriv_request_sample(s->avctx, "Progression order PCRL");
-        ret = AVERROR_PATCHWELCOME;
-        break;
-
-    default:
-        break;
-    }
-
-    /* EOC marker reached */
-    bytestream2_skip(&s->g, 2);
-
-    return ret;
-}
-
-/* TIER-1 routines */
-static void decode_sigpass(Jpeg2000T1Context *t1, int width, int height,
-                           int bpno, int bandno, int bpass_csty_symbol,
-                           int vert_causal_ctx_csty_symbol)
-{
-    int mask = 3 << (bpno - 1), y0, x, y;
-
-    for (y0 = 0; y0 < height; y0 += 4)
-        for (x = 0; x < width; x++)
-            for (y = y0; y < height && y < y0 + 4; y++) {
-                if ((t1->flags[y+1][x+1] & JPEG2000_T1_SIG_NB)
-                && !(t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {
-                    int flags_mask = -1;
-                    if (vert_causal_ctx_csty_symbol && y == y0 + 3)
-                        flags_mask &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE);
-                    if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1] & flags_mask, bandno))) {
-                        int xorbit, ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y+1][x+1], &xorbit);
-                        if (bpass_csty_symbol)
-                             t1->data[y][x] = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ? -mask : mask;
-                        else
-                             t1->data[y][x] = (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ^ xorbit) ?
-                                               -mask : mask;
-
-                        ff_jpeg2000_set_significance(t1, x, y,
-                                                     t1->data[y][x] < 0);
-                    }
-                    t1->flags[y + 1][x + 1] |= JPEG2000_T1_VIS;
-                }
-            }
-}
-
-static void decode_refpass(Jpeg2000T1Context *t1, int width, int height,
-                           int bpno)
-{
-    int phalf, nhalf;
-    int y0, x, y;
-
-    phalf = 1 << (bpno - 1);
-    nhalf = -phalf;
-
-    for (y0 = 0; y0 < height; y0 += 4)
-        for (x = 0; x < width; x++)
-            for (y = y0; y < height && y < y0 + 4; y++)
-                if ((t1->flags[y + 1][x + 1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS)) == JPEG2000_T1_SIG) {
-                    int ctxno = ff_jpeg2000_getrefctxno(t1->flags[y + 1][x + 1]);
-                    int r     = ff_mqc_decode(&t1->mqc,
-                                              t1->mqc.cx_states + ctxno)
-                                ? phalf : nhalf;
-                    t1->data[y][x]          += t1->data[y][x] < 0 ? -r : r;
-                    t1->flags[y + 1][x + 1] |= JPEG2000_T1_REF;
-                }
-}
-
-static void decode_clnpass(Jpeg2000DecoderContext *s, Jpeg2000T1Context *t1,
-                           int width, int height, int bpno, int bandno,
-                           int seg_symbols, int vert_causal_ctx_csty_symbol)
-{
-    int mask = 3 << (bpno - 1), y0, x, y, runlen, dec;
-
-    for (y0 = 0; y0 < height; y0 += 4) {
-        for (x = 0; x < width; x++) {
-            if (y0 + 3 < height &&
-                !((t1->flags[y0 + 1][x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
-                  (t1->flags[y0 + 2][x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
-                  (t1->flags[y0 + 3][x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)) ||
-                  (t1->flags[y0 + 4][x + 1] & (JPEG2000_T1_SIG_NB | JPEG2000_T1_VIS | JPEG2000_T1_SIG)))) {
-                if (!ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + MQC_CX_RL))
-                    continue;
-                runlen = ff_mqc_decode(&t1->mqc,
-                                       t1->mqc.cx_states + MQC_CX_UNI);
-                runlen = (runlen << 1) | ff_mqc_decode(&t1->mqc,
-                                                       t1->mqc.cx_states +
-                                                       MQC_CX_UNI);
-                dec = 1;
-            } else {
-                runlen = 0;
-                dec    = 0;
-            }
-
-            for (y = y0 + runlen; y < y0 + 4 && y < height; y++) {
-                if (!dec) {
-                    if (!(t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {
-                        int flags_mask = -1;
-                        if (vert_causal_ctx_csty_symbol && y == y0 + 3)
-                            flags_mask &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE);
-                        dec = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1] & flags_mask,
-                                                                                             bandno));
-                    }
-                }
-                if (dec) {
-                    int xorbit;
-                    int ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y + 1][x + 1],
-                                                        &xorbit);
-                    t1->data[y][x] = (ff_mqc_decode(&t1->mqc,
-                                                    t1->mqc.cx_states + ctxno) ^
-                                      xorbit)
-                                     ? -mask : mask;
-                    ff_jpeg2000_set_significance(t1, x, y, t1->data[y][x] < 0);
-                }
-                dec = 0;
-                t1->flags[y + 1][x + 1] &= ~JPEG2000_T1_VIS;
-            }
-        }
-    }
-    if (seg_symbols) {
-        int val;
-        val = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + MQC_CX_UNI);
-        val = (val << 1) + ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + MQC_CX_UNI);
-        val = (val << 1) + ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + MQC_CX_UNI);
-        val = (val << 1) + ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + MQC_CX_UNI);
-        if (val != 0xa)
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Segmentation symbol value incorrect\n");
-    }
-}
-
-static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
-                       Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk,
-                       int width, int height, int bandpos)
-{
-    int passno = cblk->npasses, pass_t = 2, bpno = cblk->nonzerobits - 1, y;
-    int clnpass_cnt = 0;
-    int bpass_csty_symbol           = codsty->cblk_style & JPEG2000_CBLK_BYPASS;
-    int vert_causal_ctx_csty_symbol = codsty->cblk_style & JPEG2000_CBLK_VSC;
-
-    for (y = 0; y < height; y++)
-        memset(t1->data[y], 0, width * sizeof(**t1->data));
-
-    /* If code-block contains no compressed data: nothing to do. */
-    if (!cblk->length)
-        return 0;
-    for (y = 0; y < height + 2; y++)
-        memset(t1->flags[y], 0, (width + 2) * sizeof(**t1->flags));
-
-    ff_mqc_initdec(&t1->mqc, cblk->data);
-    cblk->data[cblk->length]     = 0xff;
-    cblk->data[cblk->length + 1] = 0xff;
-
-    while (passno--) {
-        switch (pass_t) {
-        case 0:
-            decode_sigpass(t1, width, height, bpno + 1, bandpos,
-                           bpass_csty_symbol && (clnpass_cnt >= 4),
-                           vert_causal_ctx_csty_symbol);
-            break;
-        case 1:
-            decode_refpass(t1, width, height, bpno + 1);
-            if (bpass_csty_symbol && clnpass_cnt >= 4)
-                ff_mqc_initdec(&t1->mqc, cblk->data);
-            break;
-        case 2:
-            decode_clnpass(s, t1, width, height, bpno + 1, bandpos,
-                           codsty->cblk_style & JPEG2000_CBLK_SEGSYM,
-                           vert_causal_ctx_csty_symbol);
-            clnpass_cnt = clnpass_cnt + 1;
-            if (bpass_csty_symbol && clnpass_cnt >= 4)
-                ff_mqc_initdec(&t1->mqc, cblk->data);
-            break;
-        }
-
-        pass_t++;
-        if (pass_t == 3) {
-            bpno--;
-            pass_t = 0;
-        }
-    }
-    return 0;
-}
-
-/* TODO: Verify dequantization for lossless case
- * comp->data can be float or int
- * band->stepsize can be float or int
- * depending on the type of DWT transformation.
- * see ISO/IEC 15444-1:2002 A.6.1 */
-
-/* Float dequantization of a codeblock.*/
-static void dequantization_float(int x, int y, Jpeg2000Cblk *cblk,
-                                 Jpeg2000Component *comp,
-                                 Jpeg2000T1Context *t1, Jpeg2000Band *band)
-{
-    int i, j;
-    int w = cblk->coord[0][1] - cblk->coord[0][0];
-    for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
-        float *datap = &comp->f_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
-        int *src = t1->data[j];
-        for (i = 0; i < w; ++i)
-            datap[i] = src[i] * band->f_stepsize;
-    }
-}
-
-/* Integer dequantization of a codeblock.*/
-static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
-                               Jpeg2000Component *comp,
-                               Jpeg2000T1Context *t1, Jpeg2000Band *band)
-{
-    int i, j;
-    int w = cblk->coord[0][1] - cblk->coord[0][0];
-    for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
-        int32_t *datap = &comp->i_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
-        int *src = t1->data[j];
-        for (i = 0; i < w; ++i)
-            datap[i] = (src[i] * band->i_stepsize + (1 << 15)) >> 16;
-    }
-}
-
-/* Inverse ICT parameters in float and integer.
- * int value = (float value) * (1<<16) */
-static const float f_ict_params[4] = {
-    1.402f,
-    0.34413f,
-    0.71414f,
-    1.772f
-};
-static const int   i_ict_params[4] = {
-     91881,
-     22553,
-     46802,
-    116130
-};
-
-static void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
-{
-    int i, csize = 1;
-    int32_t *src[3],  i0,  i1,  i2;
-    float   *srcf[3], i0f, i1f, i2f;
-
-    for (i = 0; i < 3; i++)
-        if (tile->codsty[0].transform == FF_DWT97)
-            srcf[i] = tile->comp[i].f_data;
-        else
-            src [i] = tile->comp[i].i_data;
-
-    for (i = 0; i < 2; i++)
-        csize *= tile->comp[0].coord[i][1] - tile->comp[0].coord[i][0];
-    switch (tile->codsty[0].transform) {
-    case FF_DWT97:
-        for (i = 0; i < csize; i++) {
-            i0f = *srcf[0] + (f_ict_params[0] * *srcf[2]);
-            i1f = *srcf[0] - (f_ict_params[1] * *srcf[1])
-                           - (f_ict_params[2] * *srcf[2]);
-            i2f = *srcf[0] + (f_ict_params[3] * *srcf[1]);
-            *srcf[0]++ = i0f;
-            *srcf[1]++ = i1f;
-            *srcf[2]++ = i2f;
-        }
-        break;
-    case FF_DWT97_INT:
-        for (i = 0; i < csize; i++) {
-            i0 = *src[0] + (((i_ict_params[0] * *src[2]) + (1 << 15)) >> 16);
-            i1 = *src[0] - (((i_ict_params[1] * *src[1]) + (1 << 15)) >> 16)
-                         - (((i_ict_params[2] * *src[2]) + (1 << 15)) >> 16);
-            i2 = *src[0] + (((i_ict_params[3] * *src[1]) + (1 << 15)) >> 16);
-            *src[0]++ = i0;
-            *src[1]++ = i1;
-            *src[2]++ = i2;
-        }
-        break;
-    case FF_DWT53:
-        for (i = 0; i < csize; i++) {
-            i1 = *src[0] - (*src[2] + *src[1] >> 2);
-            i0 = i1 + *src[2];
-            i2 = i1 + *src[1];
-            *src[0]++ = i0;
-            *src[1]++ = i1;
-            *src[2]++ = i2;
-        }
-        break;
-    }
-}
-
-static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
-                                AVFrame *picture)
-{
-    int compno, reslevelno, bandno;
-    int x, y;
-
-    uint8_t *line;
-    Jpeg2000T1Context t1;
-    /* Loop on tile components */
-
-    for (compno = 0; compno < s->ncomponents; compno++) {
-        Jpeg2000Component *comp     = tile->comp + compno;
-        Jpeg2000CodingStyle *codsty = tile->codsty + compno;
-        /* Loop on resolution levels */
-        for (reslevelno = 0; reslevelno < codsty->nreslevels2decode; reslevelno++) {
-            Jpeg2000ResLevel *rlevel = comp->reslevel + reslevelno;
-            /* Loop on bands */
-            for (bandno = 0; bandno < rlevel->nbands; bandno++) {
-                uint16_t nb_precincts, precno;
-                Jpeg2000Band *band = rlevel->band + bandno;
-                int cblkno = 0, bandpos;
-                bandpos = bandno + (reslevelno > 0);
-
-                if (band->coord[0][0] == band->coord[0][1] ||
-                    band->coord[1][0] == band->coord[1][1])
-                    continue;
-
-                nb_precincts = rlevel->num_precincts_x * rlevel->num_precincts_y;
-                /* Loop on precincts */
-                for (precno = 0; precno < nb_precincts; precno++) {
-                    Jpeg2000Prec *prec = band->prec + precno;
-
-                    /* Loop on codeblocks */
-                    for (cblkno = 0; cblkno < prec->nb_codeblocks_width * prec->nb_codeblocks_height; cblkno++) {
-                        int x, y;
-                        Jpeg2000Cblk *cblk = prec->cblk + cblkno;
-                        decode_cblk(s, codsty, &t1, cblk,
-                                    cblk->coord[0][1] - cblk->coord[0][0],
-                                    cblk->coord[1][1] - cblk->coord[1][0],
-                                    bandpos);
-
-                        x = cblk->coord[0][0];
-                        y = cblk->coord[1][0];
-
-                        if (codsty->transform == FF_DWT97)
-                            dequantization_float(x, y, cblk, comp, &t1, band);
-                        else
-                            dequantization_int(x, y, cblk, comp, &t1, band);
-                   } /* end cblk */
-                } /*end prec */
-            } /* end band */
-        } /* end reslevel */
-
-        /* inverse DWT */
-        ff_dwt_decode(&comp->dwt, codsty->transform == FF_DWT97 ? (void*)comp->f_data : (void*)comp->i_data);
-    } /*end comp */
-
-    /* inverse MCT transformation */
-    if (tile->codsty[0].mct)
-        mct_decode(s, tile);
-
-    if (s->precision <= 8) {
-        for (compno = 0; compno < s->ncomponents; compno++) {
-            Jpeg2000Component *comp = tile->comp + compno;
-            Jpeg2000CodingStyle *codsty = tile->codsty + compno;
-            float *datap = comp->f_data;
-            int32_t *i_datap = comp->i_data;
-            int cbps = s->cbps[compno];
-            int w = tile->comp[compno].coord[0][1] - s->image_offset_x;
-
-            y    = tile->comp[compno].coord[1][0] - s->image_offset_y;
-            line = picture->data[0] + y * picture->linesize[0];
-            for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y += s->cdy[compno]) {
-                uint8_t *dst;
-
-                x   = tile->comp[compno].coord[0][0] - s->image_offset_x;
-                dst = line + x * s->ncomponents + compno;
-
-                if (codsty->transform == FF_DWT97) {
-                    for (; x < w; x += s->cdx[compno]) {
-                        int val = lrintf(*datap) + (1 << (cbps - 1));
-                        /* DC level shift and clip see ISO 15444-1:2002 G.1.2 */
-                        val = av_clip(val, 0, (1 << cbps) - 1);
-                        *dst = val << (8 - cbps);
-                        datap++;
-                        dst += s->ncomponents;
-                    }
-                } else {
-                    for (; x < w; x += s->cdx[compno]) {
-                        int val = *i_datap + (1 << (cbps - 1));
-                        /* DC level shift and clip see ISO 15444-1:2002 G.1.2 */
-                        val = av_clip(val, 0, (1 << cbps) - 1);
-                        *dst = val << (8 - cbps);
-                        i_datap++;
-                        dst += s->ncomponents;
-                    }
-                }
-                line += picture->linesize[0];
-            }
-        }
-    } else {
-        for (compno = 0; compno < s->ncomponents; compno++) {
-            Jpeg2000Component *comp = tile->comp + compno;
-            Jpeg2000CodingStyle *codsty = tile->codsty + compno;
-            float *datap = comp->f_data;
-            int32_t *i_datap = comp->i_data;
-            uint16_t *linel;
-            int cbps = s->cbps[compno];
-            int w = tile->comp[compno].coord[0][1] - s->image_offset_x;
-
-            y     = tile->comp[compno].coord[1][0] - s->image_offset_y;
-            linel = (uint16_t *)picture->data[0] + y * (picture->linesize[0] >> 1);
-            for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y += s->cdy[compno]) {
-                uint16_t *dst;
-                x   = tile->comp[compno].coord[0][0] - s->image_offset_x;
-                dst = linel + (x * s->ncomponents + compno);
-                if (codsty->transform == FF_DWT97) {
-                    for (; x < w; x += s-> cdx[compno]) {
-                        int  val = lrintf(*datap) + (1 << (cbps - 1));
-                        /* DC level shift and clip see ISO 15444-1:2002 G.1.2 */
-                        val = av_clip(val, 0, (1 << cbps) - 1);
-                        /* align 12 bit values in little-endian mode */
-                        *dst = val << (16 - cbps);
-                        datap++;
-                        dst += s->ncomponents;
-                    }
-                } else {
-                    for (; x < w; x += s-> cdx[compno]) {
-                        int val = *i_datap + (1 << (cbps - 1));
-                        /* DC level shift and clip see ISO 15444-1:2002 G.1.2 */
-                        val = av_clip(val, 0, (1 << cbps) - 1);
-                        /* align 12 bit values in little-endian mode */
-                        *dst = val << (16 - cbps);
-                        i_datap++;
-                        dst += s->ncomponents;
-                    }
-                }
-                linel += picture->linesize[0] >> 1;
-            }
-        }
-    }
-
-    return 0;
-}
-
-static void jpeg2000_dec_cleanup(Jpeg2000DecoderContext *s)
-{
-    int tileno, compno;
-    for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) {
-        for (compno = 0; compno < s->ncomponents; compno++) {
-            Jpeg2000Component *comp     = s->tile[tileno].comp   + compno;
-            Jpeg2000CodingStyle *codsty = s->tile[tileno].codsty + compno;
-
-            ff_jpeg2000_cleanup(comp, codsty);
-        }
-        av_freep(&s->tile[tileno].comp);
-    }
-    av_freep(&s->tile);
-    s->numXtiles = s->numYtiles = 0;
-}
-
-static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
-{
-    Jpeg2000CodingStyle *codsty = s->codsty;
-    Jpeg2000QuantStyle *qntsty  = s->qntsty;
-    uint8_t *properties         = s->properties;
-
-    for (;;) {
-        int len, ret = 0;
-        uint16_t marker;
-        int oldpos;
-
-        if (bytestream2_get_bytes_left(&s->g) < 2) {
-            av_log(s->avctx, AV_LOG_ERROR, "Missing EOC\n");
-            break;
-        }
-
-        marker = bytestream2_get_be16u(&s->g);
-        oldpos = bytestream2_tell(&s->g);
-
-        if (marker == JPEG2000_SOD) {
-            Jpeg2000Tile *tile;
-            Jpeg2000TilePart *tp;
-
-            if (s->curtileno < 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "Missing SOT\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (!s->tile) {
-                av_log(s->avctx, AV_LOG_ERROR, "Missing SIZ\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            tile = s->tile + s->curtileno;
-            tp = tile->tile_part + tile->tp_idx;
-            bytestream2_init(&tp->tpg, s->g.buffer, tp->tp_end - s->g.buffer);
-            bytestream2_skip(&s->g, tp->tp_end - s->g.buffer);
-
-            continue;
-        }
-        if (marker == JPEG2000_EOC)
-            break;
-
-        len = bytestream2_get_be16u(&s->g);
-        if (len < 2 || bytestream2_get_bytes_left(&s->g) < len - 2)
-            return AVERROR_INVALIDDATA;
-
-        switch (marker) {
-        case JPEG2000_SIZ:
-            ret = get_siz(s);
-            break;
-        case JPEG2000_COC:
-            ret = get_coc(s, codsty, properties);
-            break;
-        case JPEG2000_COD:
-            ret = get_cod(s, codsty, properties);
-            break;
-        case JPEG2000_QCC:
-            ret = get_qcc(s, len, qntsty, properties);
-            break;
-        case JPEG2000_QCD:
-            ret = get_qcd(s, len, qntsty, properties);
-            break;
-        case JPEG2000_SOT:
-            if (!(ret = get_sot(s, len))) {
-                codsty = s->tile[s->curtileno].codsty;
-                qntsty = s->tile[s->curtileno].qntsty;
-                properties = s->tile[s->curtileno].properties;
-            }
-            break;
-        case JPEG2000_COM:
-            // the comment is ignored
-            bytestream2_skip(&s->g, len - 2);
-            break;
-        case JPEG2000_TLM:
-            // Tile-part lengths
-            ret = get_tlm(s, len);
-            break;
-        default:
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "unsupported marker 0x%.4X at pos 0x%X\n",
-                   marker, bytestream2_tell(&s->g) - 4);
-            bytestream2_skip(&s->g, len - 2);
-            break;
-        }
-        if (bytestream2_tell(&s->g) - oldpos != len || ret) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "error during processing marker segment %.4x\n", marker);
-            return ret ? ret : -1;
-        }
-    }
-    return 0;
-}
-
-/* Read bit stream packets --> T2 operation. */
-static int jpeg2000_read_bitstream_packets(Jpeg2000DecoderContext *s)
-{
-    int ret = 0;
-    int tileno;
-
-    for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) {
-        Jpeg2000Tile *tile = s->tile + tileno;
-
-        if (ret = init_tile(s, tileno))
-            return ret;
-
-        s->g = tile->tile_part[0].tpg;
-        if (ret = jpeg2000_decode_packets(s, tile))
-            return ret;
-    }
-
-    return 0;
-}
-
-static int jp2_find_codestream(Jpeg2000DecoderContext *s)
-{
-    uint32_t atom_size, atom;
-    int found_codestream = 0, search_range = 10;
-
-    while(!found_codestream && search_range
-          &&
-          bytestream2_get_bytes_left(&s->g) >= 8) {
-        atom_size = bytestream2_get_be32u(&s->g);
-        atom      = bytestream2_get_be32u(&s->g);
-        if (atom == JP2_CODESTREAM) {
-            found_codestream = 1;
-        } else {
-            if (bytestream2_get_bytes_left(&s->g) < atom_size - 8)
-                return 0;
-            bytestream2_skipu(&s->g, atom_size - 8);
-            search_range--;
-        }
-    }
-
-    if (found_codestream)
-        return 1;
-    return 0;
-}
-
-static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
-                                 int *got_frame, AVPacket *avpkt)
-{
-    Jpeg2000DecoderContext *s = avctx->priv_data;
-    ThreadFrame frame = { .f = data };
-    AVFrame *picture = data;
-    int tileno, ret;
-
-    s->avctx     = avctx;
-    bytestream2_init(&s->g, avpkt->data, avpkt->size);
-    s->curtileno = 0; // TODO: only one tile in DCI JP2K. to implement for more tiles
-
-    if (bytestream2_get_bytes_left(&s->g) < 2) {
-        ret = AVERROR_INVALIDDATA;
-        goto end;
-    }
-
-    // check if the image is in jp2 format
-    if (bytestream2_get_bytes_left(&s->g) >= 12 &&
-       (bytestream2_get_be32u(&s->g) == 12) &&
-       (bytestream2_get_be32u(&s->g) == JP2_SIG_TYPE) &&
-       (bytestream2_get_be32u(&s->g) == JP2_SIG_VALUE)) {
-        if (!jp2_find_codestream(s)) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Could not find Jpeg2000 codestream atom.\n");
-            ret = AVERROR_INVALIDDATA;
-            goto end;
-        }
-    } else {
-        bytestream2_seek(&s->g, 0, SEEK_SET);
-    }
-
-    if (bytestream2_get_be16u(&s->g) != JPEG2000_SOC) {
-        av_log(avctx, AV_LOG_ERROR, "SOC marker not present\n");
-        ret = AVERROR_INVALIDDATA;
-        goto end;
-    }
-    if (ret = jpeg2000_read_main_headers(s))
-        goto end;
-
-    /* get picture buffer */
-    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "ff_thread_get_buffer() failed.\n");
-        goto end;
-    }
-    picture->pict_type = AV_PICTURE_TYPE_I;
-    picture->key_frame = 1;
-
-    if (ret = jpeg2000_read_bitstream_packets(s))
-        goto end;
-    for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++)
-        if (ret = jpeg2000_decode_tile(s, s->tile + tileno, picture))
-            goto end;
-
-    jpeg2000_dec_cleanup(s);
-
-    *got_frame = 1;
-
-    return bytestream2_tell(&s->g);
-
-end:
-    jpeg2000_dec_cleanup(s);
-    return ret;
-}
-
-static void jpeg2000_init_static_data(AVCodec *codec)
-{
-    ff_jpeg2000_init_tier1_luts();
-    ff_mqc_init_context_tables();
-}
-
-#define OFFSET(x) offsetof(Jpeg2000DecoderContext, x)
-#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
-
-static const AVOption options[] = {
-    { "lowres",  "Lower the decoding resolution by a power of two",
-        OFFSET(reduction_factor), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, JPEG2000_MAX_RESLEVELS - 1, VD },
-    { NULL },
-};
-
-static const AVProfile profiles[] = {
-    { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0,  "JPEG 2000 codestream restriction 0"   },
-    { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1,  "JPEG 2000 codestream restriction 1"   },
-    { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
-    { FF_PROFILE_JPEG2000_DCINEMA_2K,             "JPEG 2000 digital cinema 2K"          },
-    { FF_PROFILE_JPEG2000_DCINEMA_4K,             "JPEG 2000 digital cinema 4K"          },
-    { FF_PROFILE_UNKNOWN },
-};
-
-static const AVClass class = {
-    .class_name = "jpeg2000",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_jpeg2000_decoder = {
-    .name             = "jpeg2000",
-    .long_name        = NULL_IF_CONFIG_SMALL("JPEG 2000"),
-    .type             = AVMEDIA_TYPE_VIDEO,
-    .id               = AV_CODEC_ID_JPEG2000,
-    .capabilities     = CODEC_CAP_FRAME_THREADS,
-    .priv_data_size   = sizeof(Jpeg2000DecoderContext),
-    .init_static_data = jpeg2000_init_static_data,
-    .decode           = jpeg2000_decode_frame,
-    .priv_class       = &class,
-    .profiles         = NULL_IF_CONFIG_SMALL(profiles)
-};
diff --git a/deps/libav/libavcodec/jpeg2000dwt.c b/deps/libav/libavcodec/jpeg2000dwt.c
deleted file mode 100644
index 6642a53..0000000
--- a/deps/libav/libavcodec/jpeg2000dwt.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Discrete wavelet transform
- * Copyright (c) 2007 Kamil Nowosad
- * Copyright (c) 2013 Nicolas Bertrand <nicoinattendu at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Discrete wavelet transform
- */
-
-#include "libavutil/common.h"
-#include "libavutil/mem.h"
-#include "jpeg2000dwt.h"
-#include "internal.h"
-
-/* Defines for 9/7 DWT lifting parameters.
- * Parameters are in float. */
-#define F_LFTG_ALPHA  1.586134342059924f
-#define F_LFTG_BETA   0.052980118572961f
-#define F_LFTG_GAMMA  0.882911075530934f
-#define F_LFTG_DELTA  0.443506852043971f
-#define F_LFTG_K      1.230174104914001f
-#define F_LFTG_X      1.625732422f
-/* FIXME: Why use 1.625732422 instead of 1/F_LFTG_K?
- * Incorrect value in JPEG2000 norm.
- * see (ISO/IEC 15444:1 (version 2002) F.3.8.2 */
-
-/* Lifting parameters in integer format.
- * Computed as param = (float param) * (1 << 16) */
-#define I_LFTG_ALPHA  103949
-#define I_LFTG_BETA     3472
-#define I_LFTG_GAMMA   57862
-#define I_LFTG_DELTA   29066
-#define I_LFTG_K       80621
-#define I_LFTG_X      106544
-
-
-static inline void extend53(int *p, int i0, int i1)
-{
-    p[i0 - 1] = p[i0 + 1];
-    p[i1]     = p[i1 - 2];
-    p[i0 - 2] = p[i0 + 2];
-    p[i1 + 1] = p[i1 - 3];
-}
-
-static inline void extend97_float(float *p, int i0, int i1)
-{
-    int i;
-
-    for (i = 1; i <= 4; i++) {
-        p[i0 - i]     = p[i0 + i];
-        p[i1 + i - 1] = p[i1 - i - 1];
-    }
-}
-
-static inline void extend97_int(int32_t *p, int i0, int i1)
-{
-    int i;
-
-    for (i = 1; i <= 4; i++) {
-        p[i0 - i]     = p[i0 + i];
-        p[i1 + i - 1] = p[i1 - i - 1];
-    }
-}
-
-static void sr_1d53(int *p, int i0, int i1)
-{
-    int i;
-
-    if (i1 == i0 + 1)
-        return;
-
-    extend53(p, i0, i1);
-
-    for (i = i0 / 2; i < i1 / 2 + 1; i++)
-        p[2 * i] -= (p[2 * i - 1] + p[2 * i + 1] + 2) >> 2;
-    for (i = i0 / 2; i < i1 / 2; i++)
-        p[2 * i + 1] += (p[2 * i] + p[2 * i + 2]) >> 1;
-}
-
-static void dwt_decode53(DWTContext *s, int *t)
-{
-    int lev;
-    int w     = s->linelen[s->ndeclevels - 1][0];
-    int32_t *line = s->i_linebuf;
-    line += 3;
-
-    for (lev = 0; lev < s->ndeclevels; lev++) {
-        int lh = s->linelen[lev][0],
-            lv = s->linelen[lev][1],
-            mh = s->mod[lev][0],
-            mv = s->mod[lev][1],
-            lp;
-        int *l;
-
-        // HOR_SD
-        l = line + mh;
-        for (lp = 0; lp < lv; lp++) {
-            int i, j = 0;
-            // copy with interleaving
-            for (i = mh; i < lh; i += 2, j++)
-                l[i] = t[w * lp + j];
-            for (i = 1 - mh; i < lh; i += 2, j++)
-                l[i] = t[w * lp + j];
-
-            sr_1d53(line, mh, mh + lh);
-
-            for (i = 0; i < lh; i++)
-                t[w * lp + i] = l[i];
-        }
-
-        // VER_SD
-        l = line + mv;
-        for (lp = 0; lp < lh; lp++) {
-            int i, j = 0;
-            // copy with interleaving
-            for (i = mv; i < lv; i += 2, j++)
-                l[i] = t[w * j + lp];
-            for (i = 1 - mv; i < lv; i += 2, j++)
-                l[i] = t[w * j + lp];
-
-            sr_1d53(line, mv, mv + lv);
-
-            for (i = 0; i < lv; i++)
-                t[w * i + lp] = l[i];
-        }
-    }
-}
-
-static void sr_1d97_float(float *p, int i0, int i1)
-{
-    int i;
-
-    if (i1 == i0 + 1)
-        return;
-
-    extend97_float(p, i0, i1);
-
-    for (i = i0 / 2 - 1; i < i1 / 2 + 2; i++)
-        p[2 * i]     -= F_LFTG_DELTA * (p[2 * i - 1] + p[2 * i + 1]);
-    /* step 4 */
-    for (i = i0 / 2 - 1; i < i1 / 2 + 1; i++)
-        p[2 * i + 1] -= F_LFTG_GAMMA * (p[2 * i]     + p[2 * i + 2]);
-    /*step 5*/
-    for (i = i0 / 2; i < i1 / 2 + 1; i++)
-        p[2 * i]     += F_LFTG_BETA  * (p[2 * i - 1] + p[2 * i + 1]);
-    /* step 6 */
-    for (i = i0 / 2; i < i1 / 2; i++)
-        p[2 * i + 1] += F_LFTG_ALPHA * (p[2 * i]     + p[2 * i + 2]);
-}
-
-static void dwt_decode97_float(DWTContext *s, float *t)
-{
-    int lev;
-    int w       = s->linelen[s->ndeclevels - 1][0];
-    float *line = s->f_linebuf;
-    float *data = t;
-    /* position at index O of line range [0-5,w+5] cf. extend function */
-    line += 5;
-
-    for (lev = 0; lev < s->ndeclevels; lev++) {
-        int lh = s->linelen[lev][0],
-            lv = s->linelen[lev][1],
-            mh = s->mod[lev][0],
-            mv = s->mod[lev][1],
-            lp;
-        float *l;
-        // HOR_SD
-        l = line + mh;
-        for (lp = 0; lp < lv; lp++) {
-            int i, j = 0;
-            // copy with interleaving
-            for (i = mh; i < lh; i += 2, j++)
-                l[i] = data[w * lp + j] * F_LFTG_K;
-            for (i = 1 - mh; i < lh; i += 2, j++)
-                l[i] = data[w * lp + j] * F_LFTG_X;
-
-            sr_1d97_float(line, mh, mh + lh);
-
-            for (i = 0; i < lh; i++)
-                data[w * lp + i] = l[i];
-        }
-
-        // VER_SD
-        l = line + mv;
-        for (lp = 0; lp < lh; lp++) {
-            int i, j = 0;
-            // copy with interleaving
-            for (i = mv; i < lv; i += 2, j++)
-                l[i] = data[w * j + lp] * F_LFTG_K;
-            for (i = 1 - mv; i < lv; i += 2, j++)
-                l[i] = data[w * j + lp] * F_LFTG_X;
-
-            sr_1d97_float(line, mv, mv + lv);
-
-            for (i = 0; i < lv; i++)
-                data[w * i + lp] = l[i];
-        }
-    }
-}
-
-static void sr_1d97_int(int32_t *p, int i0, int i1)
-{
-    int i;
-
-    if (i1 == i0 + 1)
-        return;
-
-    extend97_int(p, i0, i1);
-
-    for (i = i0 / 2 - 1; i < i1 / 2 + 2; i++)
-        p[2 * i]     -= (I_LFTG_DELTA * (p[2 * i - 1] + p[2 * i + 1]) + (1 << 15)) >> 16;
-    /* step 4 */
-    for (i = i0 / 2 - 1; i < i1 / 2 + 1; i++)
-        p[2 * i + 1] -= (I_LFTG_GAMMA * (p[2 * i]     + p[2 * i + 2]) + (1 << 15)) >> 16;
-    /*step 5*/
-    for (i = i0 / 2; i < i1 / 2 + 1; i++)
-        p[2 * i]     += (I_LFTG_BETA  * (p[2 * i - 1] + p[2 * i + 1]) + (1 << 15)) >> 16;
-    /* step 6 */
-    for (i = i0 / 2; i < i1 / 2; i++)
-        p[2 * i + 1] += (I_LFTG_ALPHA * (p[2 * i]     + p[2 * i + 2]) + (1 << 15)) >> 16;
-}
-
-static void dwt_decode97_int(DWTContext *s, int32_t *t)
-{
-    int lev;
-    int w       = s->linelen[s->ndeclevels - 1][0];
-    int32_t *line = s->i_linebuf;
-    int32_t *data = t;
-    /* position at index O of line range [0-5,w+5] cf. extend function */
-    line += 5;
-
-    for (lev = 0; lev < s->ndeclevels; lev++) {
-        int lh = s->linelen[lev][0],
-            lv = s->linelen[lev][1],
-            mh = s->mod[lev][0],
-            mv = s->mod[lev][1],
-            lp;
-        int32_t *l;
-        // HOR_SD
-        l = line + mh;
-        for (lp = 0; lp < lv; lp++) {
-            int i, j = 0;
-            // rescale with interleaving
-            for (i = mh; i < lh; i += 2, j++)
-                l[i] = ((data[w * lp + j] * I_LFTG_K) + (1 << 15)) >> 16;
-            for (i = 1 - mh; i < lh; i += 2, j++)
-                l[i] = ((data[w * lp + j] * I_LFTG_X) + (1 << 15)) >> 16;
-
-            sr_1d97_int(line, mh, mh + lh);
-
-            for (i = 0; i < lh; i++)
-                data[w * lp + i] = l[i];
-        }
-
-        // VER_SD
-        l = line + mv;
-        for (lp = 0; lp < lh; lp++) {
-            int i, j = 0;
-            // rescale with interleaving
-            for (i = mv; i < lv; i += 2, j++)
-                l[i] = ((data[w * j + lp] * I_LFTG_K) + (1 << 15)) >> 16;
-            for (i = 1 - mv; i < lv; i += 2, j++)
-                l[i] = ((data[w * j + lp] * I_LFTG_X) + (1 << 15)) >> 16;
-
-            sr_1d97_int(line, mv, mv + lv);
-
-            for (i = 0; i < lv; i++)
-                data[w * i + lp] = l[i];
-        }
-    }
-}
-
-int ff_jpeg2000_dwt_init(DWTContext *s, uint16_t border[2][2],
-                         int decomp_levels, int type)
-{
-    int i, j, lev = decomp_levels, maxlen,
-        b[2][2];
-
-    s->ndeclevels = decomp_levels;
-    s->type       = type;
-
-    for (i = 0; i < 2; i++)
-        for (j = 0; j < 2; j++)
-            b[i][j] = border[i][j];
-
-    maxlen = FFMAX(b[0][1] - b[0][0],
-                   b[1][1] - b[1][0]);
-    while (--lev >= 0)
-        for (i = 0; i < 2; i++) {
-            s->linelen[lev][i] = b[i][1] - b[i][0];
-            s->mod[lev][i]     = b[i][0] & 1;
-            for (j = 0; j < 2; j++)
-                b[i][j] = (b[i][j] + 1) >> 1;
-        }
-    switch (type) {
-    case FF_DWT97:
-        s->f_linebuf = av_malloc((maxlen + 12) * sizeof(*s->f_linebuf));
-        if (!s->f_linebuf)
-            return AVERROR(ENOMEM);
-        break;
-     case FF_DWT97_INT:
-        s->i_linebuf = av_malloc((maxlen + 12) * sizeof(*s->i_linebuf));
-        if (!s->i_linebuf)
-            return AVERROR(ENOMEM);
-        break;
-    case FF_DWT53:
-        s->i_linebuf = av_malloc((maxlen +  6) * sizeof(*s->i_linebuf));
-        if (!s->i_linebuf)
-            return AVERROR(ENOMEM);
-        break;
-    default:
-        return -1;
-    }
-    return 0;
-}
-
-int ff_dwt_decode(DWTContext *s, void *t)
-{
-    switch (s->type) {
-    case FF_DWT97:
-        dwt_decode97_float(s, t);
-        break;
-    case FF_DWT97_INT:
-        dwt_decode97_int(s, t);
-        break;
-    case FF_DWT53:
-        dwt_decode53(s, t);
-        break;
-    default:
-        return -1;
-    }
-    return 0;
-}
-
-void ff_dwt_destroy(DWTContext *s)
-{
-    av_freep(&s->f_linebuf);
-    av_freep(&s->i_linebuf);
-}
diff --git a/deps/libav/libavcodec/jpeg2000dwt.h b/deps/libav/libavcodec/jpeg2000dwt.h
deleted file mode 100644
index 9aaa18b..0000000
--- a/deps/libav/libavcodec/jpeg2000dwt.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Discrete wavelet transform
- * Copyright (c) 2007 Kamil Nowosad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_JPEG2000DWT_H
-#define AVCODEC_JPEG2000DWT_H
-
-/**
- * @file
- * Discrete wavelet transform
- */
-
-#include <stdint.h>
-
-#define FF_DWT_MAX_DECLVLS 32 ///< max number of decomposition levels
-
-enum DWTType {
-    FF_DWT97,
-    FF_DWT53,
-    FF_DWT97_INT
-};
-
-typedef struct DWTContext {
-    /// line lengths { horizontal, vertical } in consecutive decomposition levels
-    uint16_t linelen[FF_DWT_MAX_DECLVLS][2];
-    uint8_t mod[FF_DWT_MAX_DECLVLS][2];  ///< coordinates (x0, y0) of decomp. levels mod 2
-    uint8_t ndeclevels;                  ///< number of decomposition levels
-    uint8_t type;                        ///< 0 for 9/7; 1 for 5/3
-    int32_t *i_linebuf;                  ///< int buffer used by transform
-    float   *f_linebuf;                  ///< float buffer used by transform
-} DWTContext;
-
-/**
- * Initialize DWT.
- * @param s                 DWT context
- * @param border            coordinates of transformed region {{x0, x1}, {y0, y1}}
- * @param decomp_levels     number of decomposition levels
- * @param type              0 for DWT 9/7; 1 for DWT 5/3
- */
-int ff_jpeg2000_dwt_init(DWTContext *s, uint16_t border[2][2],
-                         int decomp_levels, int type);
-
-int ff_dwt_decode(DWTContext *s, void *t);
-
-void ff_dwt_destroy(DWTContext *s);
-
-#endif /* AVCODEC_JPEG2000DWT_H */
diff --git a/deps/libav/libavcodec/jpegls.c b/deps/libav/libavcodec/jpegls.c
deleted file mode 100644
index 52a4500..0000000
--- a/deps/libav/libavcodec/jpegls.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * JPEG-LS common code
- * Copyright (c) 2003 Michael Niedermayer
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * JPEG-LS common code.
- */
-
-#include "jpegls.h"
-
-void ff_jpegls_init_state(JLSState *state)
-{
-    int i;
-
-    state->twonear = state->near * 2 + 1;
-    state->range   = (state->maxval + state->twonear - 1) / state->twonear + 1;
-
-    // QBPP = ceil(log2(RANGE))
-    for (state->qbpp = 0; (1 << state->qbpp) < state->range; state->qbpp++)
-        ;
-
-    if (state->bpp < 8)
-        state->limit = 2 * state->bpp - state->qbpp + 16;
-    else
-        state->limit = 4 * state->bpp - state->qbpp;
-
-    for (i = 0; i < 367; i++) {
-        state->A[i] = FFMAX(state->range + 32 >> 6, 2);
-        state->N[i] = 1;
-    }
-}
-
-/**
- * Custom value clipping function used in T1, T2, T3 calculation
- */
-static inline int iso_clip(int v, int vmin, int vmax)
-{
-    if (v > vmax || v < vmin)
-        return vmin;
-    else
-        return v;
-}
-
-void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all)
-{
-    const int basic_t1 = 3;
-    const int basic_t2 = 7;
-    const int basic_t3 = 21;
-    int factor;
-
-    if (s->maxval == 0 || reset_all)
-        s->maxval = (1 << s->bpp) - 1;
-
-    if (s->maxval >= 128) {
-        factor = FFMIN(s->maxval, 4095) + 128 >> 8;
-
-        if (s->T1 == 0 || reset_all)
-            s->T1 = iso_clip(factor * (basic_t1 - 2) + 2 + 3 * s->near,
-                             s->near + 1, s->maxval);
-        if (s->T2 == 0 || reset_all)
-            s->T2 = iso_clip(factor * (basic_t2 - 3) + 3 + 5 * s->near,
-                             s->T1, s->maxval);
-        if (s->T3 == 0 || reset_all)
-            s->T3 = iso_clip(factor * (basic_t3 - 4) + 4 + 7 * s->near,
-                             s->T2, s->maxval);
-    } else {
-        factor = 256 / (s->maxval + 1);
-
-        if (s->T1 == 0 || reset_all)
-            s->T1 = iso_clip(FFMAX(2, basic_t1 / factor + 3 * s->near),
-                             s->near + 1, s->maxval);
-        if (s->T2 == 0 || reset_all)
-            s->T2 = iso_clip(FFMAX(3, basic_t2 / factor + 5 * s->near),
-                             s->T1, s->maxval);
-        if (s->T3 == 0 || reset_all)
-            s->T3 = iso_clip(FFMAX(4, basic_t3 / factor + 7 * s->near),
-                             s->T2, s->maxval);
-    }
-
-    if (s->reset == 0 || reset_all)
-        s->reset = 64;
-    av_dlog(NULL, "[JPEG-LS RESET] T=%i,%i,%i\n", s->T1, s->T2, s->T3);
-}
diff --git a/deps/libav/libavcodec/jpegls.h b/deps/libav/libavcodec/jpegls.h
deleted file mode 100644
index eae3943..0000000
--- a/deps/libav/libavcodec/jpegls.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * JPEG-LS common code
- * Copyright (c) 2003 Michael Niedermayer
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * JPEG-LS common code.
- */
-
-#ifndef AVCODEC_JPEGLS_H
-#define AVCODEC_JPEGLS_H
-
-#include "libavutil/common.h"
-#include "avcodec.h"
-
-typedef struct JpeglsContext {
-    AVCodecContext *avctx;
-} JpeglsContext;
-
-typedef struct JLSState {
-    int T1, T2, T3;
-    int A[367], B[367], C[365], N[367];
-    int limit, reset, bpp, qbpp, maxval, range;
-    int near, twonear;
-    int run_index[3];
-} JLSState;
-
-extern const uint8_t ff_log2_run[32];
-
-/**
- * Calculate initial JPEG-LS parameters
- */
-void ff_jpegls_init_state(JLSState *state);
-
-/**
- * Calculate quantized gradient value, used for context determination
- */
-static inline int ff_jpegls_quantize(JLSState *s, int v)
-{
-    if (v == 0)
-        return 0;
-    if (v < 0) {
-        if (v <= -s->T3)
-            return -4;
-        if (v <= -s->T2)
-            return -3;
-        if (v <= -s->T1)
-            return -2;
-        if (v < -s->near)
-            return -1;
-        return 0;
-    } else {
-        if (v <= s->near)
-            return 0;
-        if (v < s->T1)
-            return 1;
-        if (v < s->T2)
-            return 2;
-        if (v < s->T3)
-            return 3;
-        return 4;
-    }
-}
-
-/**
- * Calculate JPEG-LS codec values
- */
-void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all);
-
-static inline void ff_jpegls_downscale_state(JLSState *state, int Q)
-{
-    if (state->N[Q] == state->reset) {
-        state->A[Q] >>= 1;
-        state->B[Q] >>= 1;
-        state->N[Q] >>= 1;
-    }
-    state->N[Q]++;
-}
-
-static inline int ff_jpegls_update_state_regular(JLSState *state,
-                                                 int Q, int err)
-{
-    state->A[Q] += FFABS(err);
-    err         *= state->twonear;
-    state->B[Q] += err;
-
-    ff_jpegls_downscale_state(state, Q);
-
-    if (state->B[Q] <= -state->N[Q]) {
-        state->B[Q] = FFMAX(state->B[Q] + state->N[Q], 1 - state->N[Q]);
-        if (state->C[Q] > -128)
-            state->C[Q]--;
-    } else if (state->B[Q] > 0) {
-        state->B[Q] = FFMIN(state->B[Q] - state->N[Q], 0);
-        if (state->C[Q] < 127)
-            state->C[Q]++;
-    }
-
-    return err;
-}
-
-#define R(a, i)    (bits == 8 ?  ((uint8_t *)(a))[i]      :  ((uint16_t *)(a))[i])
-#define W(a, i, v) (bits == 8 ? (((uint8_t *)(a))[i] = v) : (((uint16_t *)(a))[i] = v))
-
-#endif /* AVCODEC_JPEGLS_H */
diff --git a/deps/libav/libavcodec/jpeglsdec.c b/deps/libav/libavcodec/jpeglsdec.c
deleted file mode 100644
index df72ca3..0000000
--- a/deps/libav/libavcodec/jpeglsdec.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- * JPEG-LS decoder
- * Copyright (c) 2003 Michael Niedermayer
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * JPEG-LS decoder.
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "golomb.h"
-#include "mathops.h"
-#include "mjpeg.h"
-#include "mjpegdec.h"
-#include "jpegls.h"
-#include "jpeglsdec.h"
-
-/*
- * Uncomment this to significantly speed up decoding of broken JPEG-LS
- * (or test broken JPEG-LS decoder) and slow down ordinary decoding a bit.
- *
- * There is no Golomb code with length >= 32 bits possible, so check and
- * avoid situation of 32 zeros, Libav Golomb decoder is painfully slow
- * on this errors.
- */
-//#define JLS_BROKEN
-
-/**
- * Decode LSE block with initialization parameters
- */
-int ff_jpegls_decode_lse(MJpegDecodeContext *s)
-{
-    int id;
-
-    skip_bits(&s->gb, 16);  /* length: FIXME: verify field validity */
-    id = get_bits(&s->gb, 8);
-
-    switch (id) {
-    case 1:
-        s->maxval = get_bits(&s->gb, 16);
-        s->t1     = get_bits(&s->gb, 16);
-        s->t2     = get_bits(&s->gb, 16);
-        s->t3     = get_bits(&s->gb, 16);
-        s->reset  = get_bits(&s->gb, 16);
-
-//        ff_jpegls_reset_coding_parameters(s, 0);
-        //FIXME quant table?
-        break;
-    case 2:
-    case 3:
-        av_log(s->avctx, AV_LOG_ERROR, "palette not supported\n");
-        return AVERROR(ENOSYS);
-    case 4:
-        av_log(s->avctx, AV_LOG_ERROR, "oversize image not supported\n");
-        return AVERROR(ENOSYS);
-    default:
-        av_log(s->avctx, AV_LOG_ERROR, "invalid id %d\n", id);
-        return AVERROR_INVALIDDATA;
-    }
-    av_dlog(s->avctx, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3);
-
-    return 0;
-}
-
-/**
- * Get context-dependent Golomb code, decode it and update context
- */
-static inline int ls_get_code_regular(GetBitContext *gb, JLSState *state, int Q)
-{
-    int k, ret;
-
-    for (k = 0; (state->N[Q] << k) < state->A[Q]; k++)
-        ;
-
-#ifdef JLS_BROKEN
-    if (!show_bits_long(gb, 32))
-        return -1;
-#endif
-    ret = get_ur_golomb_jpegls(gb, k, state->limit, state->qbpp);
-
-    /* decode mapped error */
-    if (ret & 1)
-        ret = -(ret + 1 >> 1);
-    else
-        ret >>= 1;
-
-    /* for NEAR=0, k=0 and 2*B[Q] <= - N[Q] mapping is reversed */
-    if (!state->near && !k && (2 * state->B[Q] <= -state->N[Q]))
-        ret = -(ret + 1);
-
-    ret = ff_jpegls_update_state_regular(state, Q, ret);
-
-    return ret;
-}
-
-/**
- * Get Golomb code, decode it and update state for run termination
- */
-static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state,
-                                      int RItype, int limit_add)
-{
-    int k, ret, temp, map;
-    int Q = 365 + RItype;
-
-    temp = state->A[Q];
-    if (RItype)
-        temp += state->N[Q] >> 1;
-
-    for (k = 0; (state->N[Q] << k) < temp; k++)
-        ;
-
-#ifdef JLS_BROKEN
-    if (!show_bits_long(gb, 32))
-        return -1;
-#endif
-    ret = get_ur_golomb_jpegls(gb, k, state->limit - limit_add - 1,
-                               state->qbpp);
-
-    /* decode mapped error */
-    map = 0;
-    if (!k && (RItype || ret) && (2 * state->B[Q] < state->N[Q]))
-        map = 1;
-    ret += RItype + map;
-
-    if (ret & 1) {
-        ret = map - (ret + 1 >> 1);
-        state->B[Q]++;
-    } else {
-        ret = ret >> 1;
-    }
-
-    /* update state */
-    state->A[Q] += FFABS(ret) - RItype;
-    ret         *= state->twonear;
-    ff_jpegls_downscale_state(state, Q);
-
-    return ret;
-}
-
-/**
- * Decode one line of image
- */
-static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s,
-                                  void *last, void *dst, int last2, int w,
-                                  int stride, int comp, int bits)
-{
-    int i, x = 0;
-    int Ra, Rb, Rc, Rd;
-    int D0, D1, D2;
-
-    while (x < w) {
-        int err, pred;
-
-        /* compute gradients */
-        Ra = x ? R(dst, x - stride) : R(last, x);
-        Rb = R(last, x);
-        Rc = x ? R(last, x - stride) : last2;
-        Rd = (x >= w - stride) ? R(last, x) : R(last, x + stride);
-        D0 = Rd - Rb;
-        D1 = Rb - Rc;
-        D2 = Rc - Ra;
-        /* run mode */
-        if ((FFABS(D0) <= state->near) &&
-            (FFABS(D1) <= state->near) &&
-            (FFABS(D2) <= state->near)) {
-            int r;
-            int RItype;
-
-            /* decode full runs while available */
-            while (get_bits1(&s->gb)) {
-                int r;
-                r = 1 << ff_log2_run[state->run_index[comp]];
-                if (x + r * stride > w)
-                    r = (w - x) / stride;
-                for (i = 0; i < r; i++) {
-                    W(dst, x, Ra);
-                    x += stride;
-                }
-                /* if EOL reached, we stop decoding */
-                if (r != 1 << ff_log2_run[state->run_index[comp]])
-                    return;
-                if (state->run_index[comp] < 31)
-                    state->run_index[comp]++;
-                if (x + stride > w)
-                    return;
-            }
-            /* decode aborted run */
-            r = ff_log2_run[state->run_index[comp]];
-            if (r)
-                r = get_bits_long(&s->gb, r);
-            for (i = 0; i < r; i++) {
-                W(dst, x, Ra);
-                x += stride;
-            }
-
-            /* decode run termination value */
-            Rb     = R(last, x);
-            RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;
-            err    = ls_get_code_runterm(&s->gb, state, RItype,
-                                         ff_log2_run[state->run_index[comp]]);
-            if (state->run_index[comp])
-                state->run_index[comp]--;
-
-            if (state->near && RItype) {
-                pred = Ra + err;
-            } else {
-                if (Rb < Ra)
-                    pred = Rb - err;
-                else
-                    pred = Rb + err;
-            }
-        } else { /* regular mode */
-            int context, sign;
-
-            context = ff_jpegls_quantize(state, D0) * 81 +
-                      ff_jpegls_quantize(state, D1) *  9 +
-                      ff_jpegls_quantize(state, D2);
-            pred    = mid_pred(Ra, Ra + Rb - Rc, Rb);
-
-            if (context < 0) {
-                context = -context;
-                sign    = 1;
-            } else {
-                sign = 0;
-            }
-
-            if (sign) {
-                pred = av_clip(pred - state->C[context], 0, state->maxval);
-                err  = -ls_get_code_regular(&s->gb, state, context);
-            } else {
-                pred = av_clip(pred + state->C[context], 0, state->maxval);
-                err  = ls_get_code_regular(&s->gb, state, context);
-            }
-
-            /* we have to do something more for near-lossless coding */
-            pred += err;
-        }
-        if (state->near) {
-            if (pred < -state->near)
-                pred += state->range * state->twonear;
-            else if (pred > state->maxval + state->near)
-                pred -= state->range * state->twonear;
-            pred = av_clip(pred, 0, state->maxval);
-        }
-
-        pred &= state->maxval;
-        W(dst, x, pred);
-        x += stride;
-    }
-}
-
-int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
-                             int point_transform, int ilv)
-{
-    int i, t = 0;
-    uint8_t *zero, *last, *cur;
-    JLSState *state;
-    int off = 0, stride = 1, width, shift, ret = 0;
-
-    zero = av_mallocz(s->picture_ptr->linesize[0]);
-    last = zero;
-    cur  = s->picture_ptr->data[0];
-
-    state = av_mallocz(sizeof(JLSState));
-    /* initialize JPEG-LS state from JPEG parameters */
-    state->near   = near;
-    state->bpp    = (s->bits < 2) ? 2 : s->bits;
-    state->maxval = s->maxval;
-    state->T1     = s->t1;
-    state->T2     = s->t2;
-    state->T3     = s->t3;
-    state->reset  = s->reset;
-    ff_jpegls_reset_coding_parameters(state, 0);
-    ff_jpegls_init_state(state);
-
-    if (s->bits <= 8)
-        shift = point_transform + (8 - s->bits);
-    else
-        shift = point_transform + (16 - s->bits);
-
-    av_dlog(s->avctx,
-            "JPEG-LS params: %ix%i NEAR=%i MV=%i T(%i,%i,%i) "
-            "RESET=%i, LIMIT=%i, qbpp=%i, RANGE=%i\n",
-            s->width, s->height, state->near, state->maxval,
-            state->T1, state->T2, state->T3,
-            state->reset, state->limit, state->qbpp, state->range);
-    av_dlog(s->avctx, "JPEG params: ILV=%i Pt=%i BPP=%i, scan = %i\n",
-            ilv, point_transform, s->bits, s->cur_scan);
-    if (ilv == 0) { /* separate planes */
-        if (s->cur_scan > s->nb_components) {
-            ret = AVERROR_INVALIDDATA;
-            goto end;
-        }
-        off    = s->cur_scan - 1;
-        stride = (s->nb_components > 1) ? 3 : 1;
-        width  = s->width * stride;
-        cur   += off;
-        for (i = 0; i < s->height; i++) {
-            if (s->bits <= 8) {
-                ls_decode_line(state, s, last, cur, t, width, stride, off, 8);
-                t = last[0];
-            } else {
-                ls_decode_line(state, s, last, cur, t, width, stride, off, 16);
-                t = *((uint16_t *)last);
-            }
-            last = cur;
-            cur += s->picture_ptr->linesize[0];
-
-            if (s->restart_interval && !--s->restart_count) {
-                align_get_bits(&s->gb);
-                skip_bits(&s->gb, 16); /* skip RSTn */
-            }
-        }
-    } else if (ilv == 1) { /* line interleaving */
-        int j;
-        int Rc[3] = { 0, 0, 0 };
-        memset(cur, 0, s->picture_ptr->linesize[0]);
-        width = s->width * 3;
-        for (i = 0; i < s->height; i++) {
-            for (j = 0; j < 3; j++) {
-                ls_decode_line(state, s, last + j, cur + j,
-                               Rc[j], width, 3, j, 8);
-                Rc[j] = last[j];
-
-                if (s->restart_interval && !--s->restart_count) {
-                    align_get_bits(&s->gb);
-                    skip_bits(&s->gb, 16); /* skip RSTn */
-                }
-            }
-            last = cur;
-            cur += s->picture_ptr->linesize[0];
-        }
-    } else if (ilv == 2) { /* sample interleaving */
-        avpriv_report_missing_feature(s->avctx, "Sample interleaved images");
-        ret = AVERROR_PATCHWELCOME;
-        goto end;
-    }
-
-    if (shift) { /* we need to do point transform or normalize samples */
-        int x, w;
-
-        w = s->width * s->nb_components;
-
-        if (s->bits <= 8) {
-            uint8_t *src = s->picture_ptr->data[0];
-
-            for (i = 0; i < s->height; i++) {
-                for (x = off; x < w; x += stride)
-                    src[x] <<= shift;
-                src += s->picture_ptr->linesize[0];
-            }
-        } else {
-            uint16_t *src = (uint16_t *)s->picture_ptr->data[0];
-
-            for (i = 0; i < s->height; i++) {
-                for (x = 0; x < w; x++)
-                    src[x] <<= shift;
-                src += s->picture_ptr->linesize[0] / 2;
-            }
-        }
-    }
-
-end:
-    av_free(state);
-    av_free(zero);
-
-    return ret;
-}
-
-AVCodec ff_jpegls_decoder = {
-    .name           = "jpegls",
-    .long_name      = NULL_IF_CONFIG_SMALL("JPEG-LS"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_JPEGLS,
-    .priv_data_size = sizeof(MJpegDecodeContext),
-    .init           = ff_mjpeg_decode_init,
-    .close          = ff_mjpeg_decode_end,
-    .decode         = ff_mjpeg_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/jpeglsdec.h b/deps/libav/libavcodec/jpeglsdec.h
deleted file mode 100644
index d60a87b..0000000
--- a/deps/libav/libavcodec/jpeglsdec.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * JPEG-LS decoder
- * Copyright (c) 2003 Michael Niedermayer
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * JPEG-LS decoder.
- */
-
-#ifndef AVCODEC_JPEGLSDEC_H
-#define AVCODEC_JPEGLSDEC_H
-
-#include "mjpeg.h"
-#include "mjpegdec.h"
-
-/**
- * Decode LSE block with initialization parameters
- */
-int ff_jpegls_decode_lse(MJpegDecodeContext *s);
-
-int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
-                             int point_transform, int ilv);
-
-#endif /* AVCODEC_JPEGLSDEC_H */
diff --git a/deps/libav/libavcodec/jpeglsenc.c b/deps/libav/libavcodec/jpeglsenc.c
deleted file mode 100644
index 3af6412..0000000
--- a/deps/libav/libavcodec/jpeglsenc.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * JPEG-LS encoder
- * Copyright (c) 2003 Michael Niedermayer
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * JPEG-LS encoder.
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "golomb.h"
-#include "internal.h"
-#include "mathops.h"
-#include "mjpeg.h"
-#include "jpegls.h"
-
-/**
- * Encode error from regular symbol
- */
-static inline void ls_encode_regular(JLSState *state, PutBitContext *pb, int Q,
-                                     int err)
-{
-    int k;
-    int val;
-    int map;
-
-    for (k = 0; (state->N[Q] << k) < state->A[Q]; k++)
-        ;
-
-    map = !state->near && !k && (2 * state->B[Q] <= -state->N[Q]);
-
-    if (err < 0)
-        err += state->range;
-    if (err >= (state->range + 1 >> 1)) {
-        err -= state->range;
-        val  = 2 * FFABS(err) - 1 - map;
-    } else
-        val = 2 * err + map;
-
-    set_ur_golomb_jpegls(pb, val, k, state->limit, state->qbpp);
-
-    ff_jpegls_update_state_regular(state, Q, err);
-}
-
-/**
- * Encode error from run termination
- */
-static inline void ls_encode_runterm(JLSState *state, PutBitContext *pb,
-                                     int RItype, int err, int limit_add)
-{
-    int k;
-    int val, map;
-    int Q = 365 + RItype;
-    int temp;
-
-    temp = state->A[Q];
-    if (RItype)
-        temp += state->N[Q] >> 1;
-    for (k = 0; (state->N[Q] << k) < temp; k++)
-        ;
-    map = 0;
-    if (!k && err && (2 * state->B[Q] < state->N[Q]))
-        map = 1;
-
-    if (err < 0)
-        val = -(2 * err) - 1 - RItype + map;
-    else
-        val = 2 * err - RItype - map;
-    set_ur_golomb_jpegls(pb, val, k, state->limit - limit_add - 1, state->qbpp);
-
-    if (err < 0)
-        state->B[Q]++;
-    state->A[Q] += (val + 1 - RItype) >> 1;
-
-    ff_jpegls_downscale_state(state, Q);
-}
-
-/**
- * Encode run value as specified by JPEG-LS standard
- */
-static inline void ls_encode_run(JLSState *state, PutBitContext *pb, int run,
-                                 int comp, int trail)
-{
-    while (run >= (1 << ff_log2_run[state->run_index[comp]])) {
-        put_bits(pb, 1, 1);
-        run -= 1 << ff_log2_run[state->run_index[comp]];
-        if (state->run_index[comp] < 31)
-            state->run_index[comp]++;
-    }
-    /* if hit EOL, encode another full run, else encode aborted run */
-    if (!trail && run) {
-        put_bits(pb, 1, 1);
-    } else if (trail) {
-        put_bits(pb, 1, 0);
-        if (ff_log2_run[state->run_index[comp]])
-            put_bits(pb, ff_log2_run[state->run_index[comp]], run);
-    }
-}
-
-/**
- * Encode one line of image
- */
-static inline void ls_encode_line(JLSState *state, PutBitContext *pb,
-                                  void *last, void *cur, int last2, int w,
-                                  int stride, int comp, int bits)
-{
-    int x = 0;
-    int Ra, Rb, Rc, Rd;
-    int D0, D1, D2;
-
-    while (x < w) {
-        int err, pred, sign;
-
-        /* compute gradients */
-        Ra = x ? R(cur, x - stride) : R(last, x);
-        Rb = R(last, x);
-        Rc = x ? R(last, x - stride) : last2;
-        Rd = (x >= w - stride) ? R(last, x) : R(last, x + stride);
-        D0 = Rd - Rb;
-        D1 = Rb - Rc;
-        D2 = Rc - Ra;
-
-        /* run mode */
-        if ((FFABS(D0) <= state->near) &&
-            (FFABS(D1) <= state->near) &&
-            (FFABS(D2) <= state->near)) {
-            int RUNval, RItype, run;
-
-            run    = 0;
-            RUNval = Ra;
-            while (x < w && (FFABS(R(cur, x) - RUNval) <= state->near)) {
-                run++;
-                W(cur, x, Ra);
-                x += stride;
-            }
-            ls_encode_run(state, pb, run, comp, x < w);
-            if (x >= w)
-                return;
-            Rb     = R(last, x);
-            RItype = FFABS(Ra - Rb) <= state->near;
-            pred   = RItype ? Ra : Rb;
-            err    = R(cur, x) - pred;
-
-            if (!RItype && Ra > Rb)
-                err = -err;
-
-            if (state->near) {
-                if (err > 0)
-                    err =  (state->near + err) / state->twonear;
-                else
-                    err = -(state->near - err) / state->twonear;
-
-                if (RItype || (Rb >= Ra))
-                    Ra = av_clip(pred + err * state->twonear, 0, state->maxval);
-                else
-                    Ra = av_clip(pred - err * state->twonear, 0, state->maxval);
-                W(cur, x, Ra);
-            }
-            if (err < 0)
-                err += state->range;
-            if (err >= state->range + 1 >> 1)
-                err -= state->range;
-
-            ls_encode_runterm(state, pb, RItype, err,
-                              ff_log2_run[state->run_index[comp]]);
-
-            if (state->run_index[comp] > 0)
-                state->run_index[comp]--;
-        } else { /* regular mode */
-            int context;
-
-            context = ff_jpegls_quantize(state, D0) * 81 +
-                      ff_jpegls_quantize(state, D1) *  9 +
-                      ff_jpegls_quantize(state, D2);
-            pred    = mid_pred(Ra, Ra + Rb - Rc, Rb);
-
-            if (context < 0) {
-                context = -context;
-                sign    = 1;
-                pred    = av_clip(pred - state->C[context], 0, state->maxval);
-                err     = pred - R(cur, x);
-            } else {
-                sign = 0;
-                pred = av_clip(pred + state->C[context], 0, state->maxval);
-                err  = R(cur, x) - pred;
-            }
-
-            if (state->near) {
-                if (err > 0)
-                    err =  (state->near + err) / state->twonear;
-                else
-                    err = -(state->near - err) / state->twonear;
-                if (!sign)
-                    Ra = av_clip(pred + err * state->twonear, 0, state->maxval);
-                else
-                    Ra = av_clip(pred - err * state->twonear, 0, state->maxval);
-                W(cur, x, Ra);
-            }
-
-            ls_encode_regular(state, pb, context, err);
-        }
-        x += stride;
-    }
-}
-
-static void ls_store_lse(JLSState *state, PutBitContext *pb)
-{
-    /* Test if we have default params and don't need to store LSE */
-    JLSState state2 = { 0 };
-    state2.bpp  = state->bpp;
-    state2.near = state->near;
-    ff_jpegls_reset_coding_parameters(&state2, 1);
-    if (state->T1 == state2.T1 &&
-        state->T2 == state2.T2 &&
-        state->T3 == state2.T3 &&
-        state->reset == state2.reset)
-        return;
-    /* store LSE type 1 */
-    put_marker(pb, LSE);
-    put_bits(pb, 16, 13);
-    put_bits(pb, 8, 1);
-    put_bits(pb, 16, state->maxval);
-    put_bits(pb, 16, state->T1);
-    put_bits(pb, 16, state->T2);
-    put_bits(pb, 16, state->T3);
-    put_bits(pb, 16, state->reset);
-}
-
-static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
-                             const AVFrame *pict, int *got_packet)
-{
-    const AVFrame *const p = pict;
-    const int near         = avctx->prediction_method;
-    PutBitContext pb, pb2;
-    GetBitContext gb;
-    uint8_t *buf2, *zero, *cur, *last;
-    JLSState *state;
-    int i, size, ret;
-    int comps;
-
-    if (avctx->pix_fmt == AV_PIX_FMT_GRAY8 ||
-        avctx->pix_fmt == AV_PIX_FMT_GRAY16)
-        comps = 1;
-    else
-        comps = 3;
-
-    if ((ret = ff_alloc_packet(pkt, avctx->width * avctx->height * comps * 4 +
-                               FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    buf2 = av_malloc(pkt->size);
-
-    init_put_bits(&pb, pkt->data, pkt->size);
-    init_put_bits(&pb2, buf2, pkt->size);
-
-    /* write our own JPEG header, can't use mjpeg_picture_header */
-    put_marker(&pb, SOI);
-    put_marker(&pb, SOF48);
-    put_bits(&pb, 16, 8 + comps * 3); // header size depends on components
-    put_bits(&pb, 8, (avctx->pix_fmt == AV_PIX_FMT_GRAY16) ? 16 : 8);  // bpp
-    put_bits(&pb, 16, avctx->height);
-    put_bits(&pb, 16, avctx->width);
-    put_bits(&pb, 8, comps);          // components
-    for (i = 1; i <= comps; i++) {
-        put_bits(&pb, 8, i);     // component ID
-        put_bits(&pb, 8, 0x11);  // subsampling: none
-        put_bits(&pb, 8, 0);     // Tiq, used by JPEG-LS ext
-    }
-
-    put_marker(&pb, SOS);
-    put_bits(&pb, 16, 6 + comps * 2);
-    put_bits(&pb, 8, comps);
-    for (i = 1; i <= comps; i++) {
-        put_bits(&pb, 8, i);   // component ID
-        put_bits(&pb, 8, 0);   // mapping index: none
-    }
-    put_bits(&pb, 8, near);
-    put_bits(&pb, 8, (comps > 1) ? 1 : 0);  // interleaving: 0 - plane, 1 - line
-    put_bits(&pb, 8, 0);  // point transform: none
-
-    state = av_mallocz(sizeof(JLSState));
-    /* initialize JPEG-LS state from JPEG parameters */
-    state->near = near;
-    state->bpp  = (avctx->pix_fmt == AV_PIX_FMT_GRAY16) ? 16 : 8;
-    ff_jpegls_reset_coding_parameters(state, 0);
-    ff_jpegls_init_state(state);
-
-    ls_store_lse(state, &pb);
-
-    zero = av_mallocz(p->linesize[0]);
-    last = zero;
-    cur  = p->data[0];
-    if (avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
-        int t = 0;
-
-        for (i = 0; i < avctx->height; i++) {
-            ls_encode_line(state, &pb2, last, cur, t, avctx->width, 1, 0, 8);
-            t    = last[0];
-            last = cur;
-            cur += p->linesize[0];
-        }
-    } else if (avctx->pix_fmt == AV_PIX_FMT_GRAY16) {
-        int t = 0;
-
-        for (i = 0; i < avctx->height; i++) {
-            ls_encode_line(state, &pb2, last, cur, t, avctx->width, 1, 0, 16);
-            t    = *((uint16_t *)last);
-            last = cur;
-            cur += p->linesize[0];
-        }
-    } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) {
-        int j, width;
-        int Rc[3] = { 0, 0, 0 };
-
-        width = avctx->width * 3;
-        for (i = 0; i < avctx->height; i++) {
-            for (j = 0; j < 3; j++) {
-                ls_encode_line(state, &pb2, last + j, cur + j, Rc[j],
-                               width, 3, j, 8);
-                Rc[j] = last[j];
-            }
-            last = cur;
-            cur += p->linesize[0];
-        }
-    } else if (avctx->pix_fmt == AV_PIX_FMT_BGR24) {
-        int j, width;
-        int Rc[3] = { 0, 0, 0 };
-
-        width = avctx->width * 3;
-        for (i = 0; i < avctx->height; i++) {
-            for (j = 2; j >= 0; j--) {
-                ls_encode_line(state, &pb2, last + j, cur + j, Rc[j],
-                               width, 3, j, 8);
-                Rc[j] = last[j];
-            }
-            last = cur;
-            cur += p->linesize[0];
-        }
-    }
-
-    av_free(zero);
-    av_free(state);
-
-    /* the specification says that after doing 0xff escaping unused bits in
-     * the last byte must be set to 0, so just append 7 "optional" zero-bits
-     * to avoid special-casing. */
-    put_bits(&pb2, 7, 0);
-    size = put_bits_count(&pb2);
-    flush_put_bits(&pb2);
-    /* do escape coding */
-    init_get_bits(&gb, buf2, size);
-    size -= 7;
-    while (get_bits_count(&gb) < size) {
-        int v;
-        v = get_bits(&gb, 8);
-        put_bits(&pb, 8, v);
-        if (v == 0xFF) {
-            v = get_bits(&gb, 7);
-            put_bits(&pb, 8, v);
-        }
-    }
-    avpriv_align_put_bits(&pb);
-    av_free(buf2);
-
-    /* End of image */
-    put_marker(&pb, EOI);
-    flush_put_bits(&pb);
-
-    emms_c();
-
-    pkt->size   = put_bits_count(&pb) >> 3;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-static av_cold int encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-static av_cold int encode_init_ls(AVCodecContext *ctx)
-{
-    ctx->coded_frame = av_frame_alloc();
-    if (!ctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    ctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    ctx->coded_frame->key_frame = 1;
-
-    if (ctx->pix_fmt != AV_PIX_FMT_GRAY8  &&
-        ctx->pix_fmt != AV_PIX_FMT_GRAY16 &&
-        ctx->pix_fmt != AV_PIX_FMT_RGB24  &&
-        ctx->pix_fmt != AV_PIX_FMT_BGR24) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Only grayscale and RGB24/BGR24 images are supported\n");
-        return -1;
-    }
-    return 0;
-}
-
-AVCodec ff_jpegls_encoder = {
-    .name           = "jpegls",
-    .long_name      = NULL_IF_CONFIG_SMALL("JPEG-LS"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_JPEGLS,
-    .init           = encode_init_ls,
-    .close          = encode_close,
-    .encode2        = encode_picture_ls,
-    .pix_fmts       = (const enum AVPixelFormat[]) {
-        AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24,
-        AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
-        AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/jrevdct.c b/deps/libav/libavcodec/jrevdct.c
deleted file mode 100644
index e6846a1..0000000
--- a/deps/libav/libavcodec/jrevdct.c
+++ /dev/null
@@ -1,942 +0,0 @@
-/*
- * This file is part of the Independent JPEG Group's software.
- *
- * The authors make NO WARRANTY or representation, either express or implied,
- * with respect to this software, its quality, accuracy, merchantability, or
- * fitness for a particular purpose.  This software is provided "AS IS", and
- * you, its user, assume the entire risk as to its quality and accuracy.
- *
- * This software is copyright (C) 1991, 1992, Thomas G. Lane.
- * All Rights Reserved except as specified below.
- *
- * Permission is hereby granted to use, copy, modify, and distribute this
- * software (or portions thereof) for any purpose, without fee, subject to
- * these conditions:
- * (1) If any part of the source code for this software is distributed, then
- * this README file must be included, with this copyright and no-warranty
- * notice unaltered; and any additions, deletions, or changes to the original
- * files must be clearly indicated in accompanying documentation.
- * (2) If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the work
- * of the Independent JPEG Group".
- * (3) Permission for use of this software is granted only if the user accepts
- * full responsibility for any undesirable consequences; the authors accept
- * NO LIABILITY for damages of any kind.
- *
- * These conditions apply to any software derived from or based on the IJG
- * code, not just to the unmodified library.  If you use our work, you ought
- * to acknowledge us.
- *
- * Permission is NOT granted for the use of any IJG author's name or company
- * name in advertising or publicity relating to this software or products
- * derived from it.  This software may be referred to only as "the Independent
- * JPEG Group's software".
- *
- * We specifically permit and encourage the use of this software as the basis
- * of commercial products, provided that all warranty or liability claims are
- * assumed by the product vendor.
- *
- * This file contains the basic inverse-DCT transformation subroutine.
- *
- * This implementation is based on an algorithm described in
- *   C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
- *   Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
- *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
- * The primary algorithm described there uses 11 multiplies and 29 adds.
- * We use their alternate method with 12 multiplies and 32 adds.
- * The advantage of this method is that no data path contains more than one
- * multiplication; this allows a very simple and accurate implementation in
- * scaled fixed-point arithmetic, with a minimal number of shifts.
- *
- * I've made lots of modifications to attempt to take advantage of the
- * sparse nature of the DCT matrices we're getting.  Although the logic
- * is cumbersome, it's straightforward and the resulting code is much
- * faster.
- *
- * A better way to do this would be to pass in the DCT block as a sparse
- * matrix, perhaps with the difference cases encoded.
- */
-
-/**
- * @file
- * Independent JPEG Group's LLM idct.
- */
-
-#include "libavutil/common.h"
-#include "dct.h"
-
-#define EIGHT_BIT_SAMPLES
-
-#define DCTSIZE 8
-#define DCTSIZE2 64
-
-#define GLOBAL
-
-#define RIGHT_SHIFT(x, n) ((x) >> (n))
-
-typedef int16_t DCTBLOCK[DCTSIZE2];
-
-#define CONST_BITS 13
-
-/*
- * This routine is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
-  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/*
- * A 2-D IDCT can be done by 1-D IDCT on each row followed by 1-D IDCT
- * on each column.  Direct algorithms are also available, but they are
- * much more complex and seem not to be any faster when reduced to code.
- *
- * The poop on this scaling stuff is as follows:
- *
- * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
- * larger than the true IDCT outputs.  The final outputs are therefore
- * a factor of N larger than desired; since N=8 this can be cured by
- * a simple right shift at the end of the algorithm.  The advantage of
- * this arrangement is that we save two multiplications per 1-D IDCT,
- * because the y0 and y4 inputs need not be divided by sqrt(N).
- *
- * We have to do addition and subtraction of the integer inputs, which
- * is no problem, and multiplication by fractional constants, which is
- * a problem to do in integer arithmetic.  We multiply all the constants
- * by CONST_SCALE and convert them to integer constants (thus retaining
- * CONST_BITS bits of precision in the constants).  After doing a
- * multiplication we have to divide the product by CONST_SCALE, with proper
- * rounding, to produce the correct output.  This division can be done
- * cheaply as a right shift of CONST_BITS bits.  We postpone shifting
- * as long as possible so that partial sums can be added together with
- * full fractional precision.
- *
- * The outputs of the first pass are scaled up by PASS1_BITS bits so that
- * they are represented to better-than-integral precision.  These outputs
- * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
- * with the recommended scaling.  (To scale up 12-bit sample data further, an
- * intermediate int32 array would be needed.)
- *
- * To avoid overflow of the 32-bit intermediate results in pass 2, we must
- * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
- * shows that the values given below are the most effective.
- */
-
-#ifdef EIGHT_BIT_SAMPLES
-#define PASS1_BITS  2
-#else
-#define PASS1_BITS  1   /* lose a little precision to avoid overflow */
-#endif
-
-#define ONE         ((int32_t) 1)
-
-#define CONST_SCALE (ONE << CONST_BITS)
-
-/* Convert a positive real constant to an integer scaled by CONST_SCALE.
- * IMPORTANT: if your compiler doesn't do this arithmetic at compile time,
- * you will pay a significant penalty in run time.  In that case, figure
- * the correct integer constant values and insert them by hand.
- */
-
-/* Actually FIX is no longer used, we precomputed them all */
-#define FIX(x)  ((int32_t) ((x) * CONST_SCALE + 0.5))
-
-/* Descale and correctly round an int32_t value that's scaled by N bits.
- * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
- * the fudge factor is correct for either sign of X.
- */
-
-#define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
-
-/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
- * For 8-bit samples with the recommended scaling, all the variable
- * and constant values involved are no more than 16 bits wide, so a
- * 16x16->32 bit multiply can be used instead of a full 32x32 multiply;
- * this provides a useful speedup on many machines.
- * There is no way to specify a 16x16->32 multiply in portable C, but
- * some C compilers will do the right thing if you provide the correct
- * combination of casts.
- * NB: for 12-bit samples, a full 32-bit multiplication will be needed.
- */
-
-#ifdef EIGHT_BIT_SAMPLES
-#ifdef SHORTxSHORT_32           /* may work if 'int' is 32 bits */
-#define MULTIPLY(var,const)  (((int16_t) (var)) * ((int16_t) (const)))
-#endif
-#ifdef SHORTxLCONST_32          /* known to work with Microsoft C 6.0 */
-#define MULTIPLY(var,const)  (((int16_t) (var)) * ((int32_t) (const)))
-#endif
-#endif
-
-#ifndef MULTIPLY                /* default definition */
-#define MULTIPLY(var,const)  ((var) * (const))
-#endif
-
-
-/*
-  Unlike our decoder where we approximate the FIXes, we need to use exact
-ones here or successive P-frames will drift too much with Reference frame coding
-*/
-#define FIX_0_211164243 1730
-#define FIX_0_275899380 2260
-#define FIX_0_298631336 2446
-#define FIX_0_390180644 3196
-#define FIX_0_509795579 4176
-#define FIX_0_541196100 4433
-#define FIX_0_601344887 4926
-#define FIX_0_765366865 6270
-#define FIX_0_785694958 6436
-#define FIX_0_899976223 7373
-#define FIX_1_061594337 8697
-#define FIX_1_111140466 9102
-#define FIX_1_175875602 9633
-#define FIX_1_306562965 10703
-#define FIX_1_387039845 11363
-#define FIX_1_451774981 11893
-#define FIX_1_501321110 12299
-#define FIX_1_662939225 13623
-#define FIX_1_847759065 15137
-#define FIX_1_961570560 16069
-#define FIX_2_053119869 16819
-#define FIX_2_172734803 17799
-#define FIX_2_562915447 20995
-#define FIX_3_072711026 25172
-
-/*
- * Perform the inverse DCT on one block of coefficients.
- */
-
-void ff_j_rev_dct(DCTBLOCK data)
-{
-  int32_t tmp0, tmp1, tmp2, tmp3;
-  int32_t tmp10, tmp11, tmp12, tmp13;
-  int32_t z1, z2, z3, z4, z5;
-  int32_t d0, d1, d2, d3, d4, d5, d6, d7;
-  register int16_t *dataptr;
-  int rowctr;
-
-  /* Pass 1: process rows. */
-  /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
-  /* furthermore, we scale the results by 2**PASS1_BITS. */
-
-  dataptr = data;
-
-  for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
-    /* Due to quantization, we will usually find that many of the input
-     * coefficients are zero, especially the AC terms.  We can exploit this
-     * by short-circuiting the IDCT calculation for any row in which all
-     * the AC terms are zero.  In that case each output is equal to the
-     * DC coefficient (with scale factor as needed).
-     * With typical images and quantization tables, half or more of the
-     * row DCT calculations can be simplified this way.
-     */
-
-    register int *idataptr = (int*)dataptr;
-
-    /* WARNING: we do the same permutation as MMX idct to simplify the
-       video core */
-    d0 = dataptr[0];
-    d2 = dataptr[1];
-    d4 = dataptr[2];
-    d6 = dataptr[3];
-    d1 = dataptr[4];
-    d3 = dataptr[5];
-    d5 = dataptr[6];
-    d7 = dataptr[7];
-
-    if ((d1 | d2 | d3 | d4 | d5 | d6 | d7) == 0) {
-      /* AC terms all zero */
-      if (d0) {
-          /* Compute a 32 bit value to assign. */
-          int16_t dcval = (int16_t) (d0 << PASS1_BITS);
-          register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000);
-
-          idataptr[0] = v;
-          idataptr[1] = v;
-          idataptr[2] = v;
-          idataptr[3] = v;
-      }
-
-      dataptr += DCTSIZE;       /* advance pointer to next row */
-      continue;
-    }
-
-    /* Even part: reverse the even part of the forward DCT. */
-    /* The rotator is sqrt(2)*c(-6). */
-{
-    if (d6) {
-            if (d2) {
-                    /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */
-                    z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
-                    tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
-                    tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
-
-                    tmp0 = (d0 + d4) << CONST_BITS;
-                    tmp1 = (d0 - d4) << CONST_BITS;
-
-                    tmp10 = tmp0 + tmp3;
-                    tmp13 = tmp0 - tmp3;
-                    tmp11 = tmp1 + tmp2;
-                    tmp12 = tmp1 - tmp2;
-            } else {
-                    /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */
-                    tmp2 = MULTIPLY(-d6, FIX_1_306562965);
-                    tmp3 = MULTIPLY(d6, FIX_0_541196100);
-
-                    tmp0 = (d0 + d4) << CONST_BITS;
-                    tmp1 = (d0 - d4) << CONST_BITS;
-
-                    tmp10 = tmp0 + tmp3;
-                    tmp13 = tmp0 - tmp3;
-                    tmp11 = tmp1 + tmp2;
-                    tmp12 = tmp1 - tmp2;
-            }
-    } else {
-            if (d2) {
-                    /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */
-                    tmp2 = MULTIPLY(d2, FIX_0_541196100);
-                    tmp3 = MULTIPLY(d2, FIX_1_306562965);
-
-                    tmp0 = (d0 + d4) << CONST_BITS;
-                    tmp1 = (d0 - d4) << CONST_BITS;
-
-                    tmp10 = tmp0 + tmp3;
-                    tmp13 = tmp0 - tmp3;
-                    tmp11 = tmp1 + tmp2;
-                    tmp12 = tmp1 - tmp2;
-            } else {
-                    /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */
-                    tmp10 = tmp13 = (d0 + d4) << CONST_BITS;
-                    tmp11 = tmp12 = (d0 - d4) << CONST_BITS;
-            }
-      }
-
-    /* Odd part per figure 8; the matrix is unitary and hence its
-     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.
-     */
-
-    if (d7) {
-        if (d5) {
-            if (d3) {
-                if (d1) {
-                    /* d1 != 0, d3 != 0, d5 != 0, d7 != 0 */
-                    z1 = d7 + d1;
-                    z2 = d5 + d3;
-                    z3 = d7 + d3;
-                    z4 = d5 + d1;
-                    z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
-
-                    tmp0 = MULTIPLY(d7, FIX_0_298631336);
-                    tmp1 = MULTIPLY(d5, FIX_2_053119869);
-                    tmp2 = MULTIPLY(d3, FIX_3_072711026);
-                    tmp3 = MULTIPLY(d1, FIX_1_501321110);
-                    z1 = MULTIPLY(-z1, FIX_0_899976223);
-                    z2 = MULTIPLY(-z2, FIX_2_562915447);
-                    z3 = MULTIPLY(-z3, FIX_1_961570560);
-                    z4 = MULTIPLY(-z4, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z1 + z3;
-                    tmp1 += z2 + z4;
-                    tmp2 += z2 + z3;
-                    tmp3 += z1 + z4;
-                } else {
-                    /* d1 == 0, d3 != 0, d5 != 0, d7 != 0 */
-                    z2 = d5 + d3;
-                    z3 = d7 + d3;
-                    z5 = MULTIPLY(z3 + d5, FIX_1_175875602);
-
-                    tmp0 = MULTIPLY(d7, FIX_0_298631336);
-                    tmp1 = MULTIPLY(d5, FIX_2_053119869);
-                    tmp2 = MULTIPLY(d3, FIX_3_072711026);
-                    z1 = MULTIPLY(-d7, FIX_0_899976223);
-                    z2 = MULTIPLY(-z2, FIX_2_562915447);
-                    z3 = MULTIPLY(-z3, FIX_1_961570560);
-                    z4 = MULTIPLY(-d5, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z1 + z3;
-                    tmp1 += z2 + z4;
-                    tmp2 += z2 + z3;
-                    tmp3 = z1 + z4;
-                }
-            } else {
-                if (d1) {
-                    /* d1 != 0, d3 == 0, d5 != 0, d7 != 0 */
-                    z1 = d7 + d1;
-                    z4 = d5 + d1;
-                    z5 = MULTIPLY(d7 + z4, FIX_1_175875602);
-
-                    tmp0 = MULTIPLY(d7, FIX_0_298631336);
-                    tmp1 = MULTIPLY(d5, FIX_2_053119869);
-                    tmp3 = MULTIPLY(d1, FIX_1_501321110);
-                    z1 = MULTIPLY(-z1, FIX_0_899976223);
-                    z2 = MULTIPLY(-d5, FIX_2_562915447);
-                    z3 = MULTIPLY(-d7, FIX_1_961570560);
-                    z4 = MULTIPLY(-z4, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z1 + z3;
-                    tmp1 += z2 + z4;
-                    tmp2 = z2 + z3;
-                    tmp3 += z1 + z4;
-                } else {
-                    /* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */
-                    tmp0 = MULTIPLY(-d7, FIX_0_601344887);
-                    z1 = MULTIPLY(-d7, FIX_0_899976223);
-                    z3 = MULTIPLY(-d7, FIX_1_961570560);
-                    tmp1 = MULTIPLY(-d5, FIX_0_509795579);
-                    z2 = MULTIPLY(-d5, FIX_2_562915447);
-                    z4 = MULTIPLY(-d5, FIX_0_390180644);
-                    z5 = MULTIPLY(d5 + d7, FIX_1_175875602);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z3;
-                    tmp1 += z4;
-                    tmp2 = z2 + z3;
-                    tmp3 = z1 + z4;
-                }
-            }
-        } else {
-            if (d3) {
-                if (d1) {
-                    /* d1 != 0, d3 != 0, d5 == 0, d7 != 0 */
-                    z1 = d7 + d1;
-                    z3 = d7 + d3;
-                    z5 = MULTIPLY(z3 + d1, FIX_1_175875602);
-
-                    tmp0 = MULTIPLY(d7, FIX_0_298631336);
-                    tmp2 = MULTIPLY(d3, FIX_3_072711026);
-                    tmp3 = MULTIPLY(d1, FIX_1_501321110);
-                    z1 = MULTIPLY(-z1, FIX_0_899976223);
-                    z2 = MULTIPLY(-d3, FIX_2_562915447);
-                    z3 = MULTIPLY(-z3, FIX_1_961570560);
-                    z4 = MULTIPLY(-d1, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z1 + z3;
-                    tmp1 = z2 + z4;
-                    tmp2 += z2 + z3;
-                    tmp3 += z1 + z4;
-                } else {
-                    /* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */
-                    z3 = d7 + d3;
-
-                    tmp0 = MULTIPLY(-d7, FIX_0_601344887);
-                    z1 = MULTIPLY(-d7, FIX_0_899976223);
-                    tmp2 = MULTIPLY(d3, FIX_0_509795579);
-                    z2 = MULTIPLY(-d3, FIX_2_562915447);
-                    z5 = MULTIPLY(z3, FIX_1_175875602);
-                    z3 = MULTIPLY(-z3, FIX_0_785694958);
-
-                    tmp0 += z3;
-                    tmp1 = z2 + z5;
-                    tmp2 += z3;
-                    tmp3 = z1 + z5;
-                }
-            } else {
-                if (d1) {
-                    /* d1 != 0, d3 == 0, d5 == 0, d7 != 0 */
-                    z1 = d7 + d1;
-                    z5 = MULTIPLY(z1, FIX_1_175875602);
-
-                    z1 = MULTIPLY(z1, FIX_0_275899380);
-                    z3 = MULTIPLY(-d7, FIX_1_961570560);
-                    tmp0 = MULTIPLY(-d7, FIX_1_662939225);
-                    z4 = MULTIPLY(-d1, FIX_0_390180644);
-                    tmp3 = MULTIPLY(d1, FIX_1_111140466);
-
-                    tmp0 += z1;
-                    tmp1 = z4 + z5;
-                    tmp2 = z3 + z5;
-                    tmp3 += z1;
-                } else {
-                    /* d1 == 0, d3 == 0, d5 == 0, d7 != 0 */
-                    tmp0 = MULTIPLY(-d7, FIX_1_387039845);
-                    tmp1 = MULTIPLY(d7, FIX_1_175875602);
-                    tmp2 = MULTIPLY(-d7, FIX_0_785694958);
-                    tmp3 = MULTIPLY(d7, FIX_0_275899380);
-                }
-            }
-        }
-    } else {
-        if (d5) {
-            if (d3) {
-                if (d1) {
-                    /* d1 != 0, d3 != 0, d5 != 0, d7 == 0 */
-                    z2 = d5 + d3;
-                    z4 = d5 + d1;
-                    z5 = MULTIPLY(d3 + z4, FIX_1_175875602);
-
-                    tmp1 = MULTIPLY(d5, FIX_2_053119869);
-                    tmp2 = MULTIPLY(d3, FIX_3_072711026);
-                    tmp3 = MULTIPLY(d1, FIX_1_501321110);
-                    z1 = MULTIPLY(-d1, FIX_0_899976223);
-                    z2 = MULTIPLY(-z2, FIX_2_562915447);
-                    z3 = MULTIPLY(-d3, FIX_1_961570560);
-                    z4 = MULTIPLY(-z4, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 = z1 + z3;
-                    tmp1 += z2 + z4;
-                    tmp2 += z2 + z3;
-                    tmp3 += z1 + z4;
-                } else {
-                    /* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */
-                    z2 = d5 + d3;
-
-                    z5 = MULTIPLY(z2, FIX_1_175875602);
-                    tmp1 = MULTIPLY(d5, FIX_1_662939225);
-                    z4 = MULTIPLY(-d5, FIX_0_390180644);
-                    z2 = MULTIPLY(-z2, FIX_1_387039845);
-                    tmp2 = MULTIPLY(d3, FIX_1_111140466);
-                    z3 = MULTIPLY(-d3, FIX_1_961570560);
-
-                    tmp0 = z3 + z5;
-                    tmp1 += z2;
-                    tmp2 += z2;
-                    tmp3 = z4 + z5;
-                }
-            } else {
-                if (d1) {
-                    /* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */
-                    z4 = d5 + d1;
-
-                    z5 = MULTIPLY(z4, FIX_1_175875602);
-                    z1 = MULTIPLY(-d1, FIX_0_899976223);
-                    tmp3 = MULTIPLY(d1, FIX_0_601344887);
-                    tmp1 = MULTIPLY(-d5, FIX_0_509795579);
-                    z2 = MULTIPLY(-d5, FIX_2_562915447);
-                    z4 = MULTIPLY(z4, FIX_0_785694958);
-
-                    tmp0 = z1 + z5;
-                    tmp1 += z4;
-                    tmp2 = z2 + z5;
-                    tmp3 += z4;
-                } else {
-                    /* d1 == 0, d3 == 0, d5 != 0, d7 == 0 */
-                    tmp0 = MULTIPLY(d5, FIX_1_175875602);
-                    tmp1 = MULTIPLY(d5, FIX_0_275899380);
-                    tmp2 = MULTIPLY(-d5, FIX_1_387039845);
-                    tmp3 = MULTIPLY(d5, FIX_0_785694958);
-                }
-            }
-        } else {
-            if (d3) {
-                if (d1) {
-                    /* d1 != 0, d3 != 0, d5 == 0, d7 == 0 */
-                    z5 = d1 + d3;
-                    tmp3 = MULTIPLY(d1, FIX_0_211164243);
-                    tmp2 = MULTIPLY(-d3, FIX_1_451774981);
-                    z1 = MULTIPLY(d1, FIX_1_061594337);
-                    z2 = MULTIPLY(-d3, FIX_2_172734803);
-                    z4 = MULTIPLY(z5, FIX_0_785694958);
-                    z5 = MULTIPLY(z5, FIX_1_175875602);
-
-                    tmp0 = z1 - z4;
-                    tmp1 = z2 + z4;
-                    tmp2 += z5;
-                    tmp3 += z5;
-                } else {
-                    /* d1 == 0, d3 != 0, d5 == 0, d7 == 0 */
-                    tmp0 = MULTIPLY(-d3, FIX_0_785694958);
-                    tmp1 = MULTIPLY(-d3, FIX_1_387039845);
-                    tmp2 = MULTIPLY(-d3, FIX_0_275899380);
-                    tmp3 = MULTIPLY(d3, FIX_1_175875602);
-                }
-            } else {
-                if (d1) {
-                    /* d1 != 0, d3 == 0, d5 == 0, d7 == 0 */
-                    tmp0 = MULTIPLY(d1, FIX_0_275899380);
-                    tmp1 = MULTIPLY(d1, FIX_0_785694958);
-                    tmp2 = MULTIPLY(d1, FIX_1_175875602);
-                    tmp3 = MULTIPLY(d1, FIX_1_387039845);
-                } else {
-                    /* d1 == 0, d3 == 0, d5 == 0, d7 == 0 */
-                    tmp0 = tmp1 = tmp2 = tmp3 = 0;
-                }
-            }
-        }
-    }
-}
-    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
-    dataptr[0] = (int16_t) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
-    dataptr[7] = (int16_t) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
-    dataptr[1] = (int16_t) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
-    dataptr[6] = (int16_t) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
-    dataptr[2] = (int16_t) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
-    dataptr[5] = (int16_t) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
-    dataptr[3] = (int16_t) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
-    dataptr[4] = (int16_t) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
-
-    dataptr += DCTSIZE;         /* advance pointer to next row */
-  }
-
-  /* Pass 2: process columns. */
-  /* Note that we must descale the results by a factor of 8 == 2**3, */
-  /* and also undo the PASS1_BITS scaling. */
-
-  dataptr = data;
-  for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
-    /* Columns of zeroes can be exploited in the same way as we did with rows.
-     * However, the row calculation has created many nonzero AC terms, so the
-     * simplification applies less often (typically 5% to 10% of the time).
-     * On machines with very fast multiplication, it's possible that the
-     * test takes more time than it's worth.  In that case this section
-     * may be commented out.
-     */
-
-    d0 = dataptr[DCTSIZE*0];
-    d1 = dataptr[DCTSIZE*1];
-    d2 = dataptr[DCTSIZE*2];
-    d3 = dataptr[DCTSIZE*3];
-    d4 = dataptr[DCTSIZE*4];
-    d5 = dataptr[DCTSIZE*5];
-    d6 = dataptr[DCTSIZE*6];
-    d7 = dataptr[DCTSIZE*7];
-
-    /* Even part: reverse the even part of the forward DCT. */
-    /* The rotator is sqrt(2)*c(-6). */
-    if (d6) {
-            if (d2) {
-                    /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */
-                    z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
-                    tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
-                    tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
-
-                    tmp0 = (d0 + d4) << CONST_BITS;
-                    tmp1 = (d0 - d4) << CONST_BITS;
-
-                    tmp10 = tmp0 + tmp3;
-                    tmp13 = tmp0 - tmp3;
-                    tmp11 = tmp1 + tmp2;
-                    tmp12 = tmp1 - tmp2;
-            } else {
-                    /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */
-                    tmp2 = MULTIPLY(-d6, FIX_1_306562965);
-                    tmp3 = MULTIPLY(d6, FIX_0_541196100);
-
-                    tmp0 = (d0 + d4) << CONST_BITS;
-                    tmp1 = (d0 - d4) << CONST_BITS;
-
-                    tmp10 = tmp0 + tmp3;
-                    tmp13 = tmp0 - tmp3;
-                    tmp11 = tmp1 + tmp2;
-                    tmp12 = tmp1 - tmp2;
-            }
-    } else {
-            if (d2) {
-                    /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */
-                    tmp2 = MULTIPLY(d2, FIX_0_541196100);
-                    tmp3 = MULTIPLY(d2, FIX_1_306562965);
-
-                    tmp0 = (d0 + d4) << CONST_BITS;
-                    tmp1 = (d0 - d4) << CONST_BITS;
-
-                    tmp10 = tmp0 + tmp3;
-                    tmp13 = tmp0 - tmp3;
-                    tmp11 = tmp1 + tmp2;
-                    tmp12 = tmp1 - tmp2;
-            } else {
-                    /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */
-                    tmp10 = tmp13 = (d0 + d4) << CONST_BITS;
-                    tmp11 = tmp12 = (d0 - d4) << CONST_BITS;
-            }
-    }
-
-    /* Odd part per figure 8; the matrix is unitary and hence its
-     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.
-     */
-    if (d7) {
-        if (d5) {
-            if (d3) {
-                if (d1) {
-                    /* d1 != 0, d3 != 0, d5 != 0, d7 != 0 */
-                    z1 = d7 + d1;
-                    z2 = d5 + d3;
-                    z3 = d7 + d3;
-                    z4 = d5 + d1;
-                    z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
-
-                    tmp0 = MULTIPLY(d7, FIX_0_298631336);
-                    tmp1 = MULTIPLY(d5, FIX_2_053119869);
-                    tmp2 = MULTIPLY(d3, FIX_3_072711026);
-                    tmp3 = MULTIPLY(d1, FIX_1_501321110);
-                    z1 = MULTIPLY(-z1, FIX_0_899976223);
-                    z2 = MULTIPLY(-z2, FIX_2_562915447);
-                    z3 = MULTIPLY(-z3, FIX_1_961570560);
-                    z4 = MULTIPLY(-z4, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z1 + z3;
-                    tmp1 += z2 + z4;
-                    tmp2 += z2 + z3;
-                    tmp3 += z1 + z4;
-                } else {
-                    /* d1 == 0, d3 != 0, d5 != 0, d7 != 0 */
-                    z2 = d5 + d3;
-                    z3 = d7 + d3;
-                    z5 = MULTIPLY(z3 + d5, FIX_1_175875602);
-
-                    tmp0 = MULTIPLY(d7, FIX_0_298631336);
-                    tmp1 = MULTIPLY(d5, FIX_2_053119869);
-                    tmp2 = MULTIPLY(d3, FIX_3_072711026);
-                    z1 = MULTIPLY(-d7, FIX_0_899976223);
-                    z2 = MULTIPLY(-z2, FIX_2_562915447);
-                    z3 = MULTIPLY(-z3, FIX_1_961570560);
-                    z4 = MULTIPLY(-d5, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z1 + z3;
-                    tmp1 += z2 + z4;
-                    tmp2 += z2 + z3;
-                    tmp3 = z1 + z4;
-                }
-            } else {
-                if (d1) {
-                    /* d1 != 0, d3 == 0, d5 != 0, d7 != 0 */
-                    z1 = d7 + d1;
-                    z3 = d7;
-                    z4 = d5 + d1;
-                    z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
-
-                    tmp0 = MULTIPLY(d7, FIX_0_298631336);
-                    tmp1 = MULTIPLY(d5, FIX_2_053119869);
-                    tmp3 = MULTIPLY(d1, FIX_1_501321110);
-                    z1 = MULTIPLY(-z1, FIX_0_899976223);
-                    z2 = MULTIPLY(-d5, FIX_2_562915447);
-                    z3 = MULTIPLY(-d7, FIX_1_961570560);
-                    z4 = MULTIPLY(-z4, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z1 + z3;
-                    tmp1 += z2 + z4;
-                    tmp2 = z2 + z3;
-                    tmp3 += z1 + z4;
-                } else {
-                    /* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */
-                    tmp0 = MULTIPLY(-d7, FIX_0_601344887);
-                    z1 = MULTIPLY(-d7, FIX_0_899976223);
-                    z3 = MULTIPLY(-d7, FIX_1_961570560);
-                    tmp1 = MULTIPLY(-d5, FIX_0_509795579);
-                    z2 = MULTIPLY(-d5, FIX_2_562915447);
-                    z4 = MULTIPLY(-d5, FIX_0_390180644);
-                    z5 = MULTIPLY(d5 + d7, FIX_1_175875602);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z3;
-                    tmp1 += z4;
-                    tmp2 = z2 + z3;
-                    tmp3 = z1 + z4;
-                }
-            }
-        } else {
-            if (d3) {
-                if (d1) {
-                    /* d1 != 0, d3 != 0, d5 == 0, d7 != 0 */
-                    z1 = d7 + d1;
-                    z3 = d7 + d3;
-                    z5 = MULTIPLY(z3 + d1, FIX_1_175875602);
-
-                    tmp0 = MULTIPLY(d7, FIX_0_298631336);
-                    tmp2 = MULTIPLY(d3, FIX_3_072711026);
-                    tmp3 = MULTIPLY(d1, FIX_1_501321110);
-                    z1 = MULTIPLY(-z1, FIX_0_899976223);
-                    z2 = MULTIPLY(-d3, FIX_2_562915447);
-                    z3 = MULTIPLY(-z3, FIX_1_961570560);
-                    z4 = MULTIPLY(-d1, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 += z1 + z3;
-                    tmp1 = z2 + z4;
-                    tmp2 += z2 + z3;
-                    tmp3 += z1 + z4;
-                } else {
-                    /* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */
-                    z3 = d7 + d3;
-
-                    tmp0 = MULTIPLY(-d7, FIX_0_601344887);
-                    z1 = MULTIPLY(-d7, FIX_0_899976223);
-                    tmp2 = MULTIPLY(d3, FIX_0_509795579);
-                    z2 = MULTIPLY(-d3, FIX_2_562915447);
-                    z5 = MULTIPLY(z3, FIX_1_175875602);
-                    z3 = MULTIPLY(-z3, FIX_0_785694958);
-
-                    tmp0 += z3;
-                    tmp1 = z2 + z5;
-                    tmp2 += z3;
-                    tmp3 = z1 + z5;
-                }
-            } else {
-                if (d1) {
-                    /* d1 != 0, d3 == 0, d5 == 0, d7 != 0 */
-                    z1 = d7 + d1;
-                    z5 = MULTIPLY(z1, FIX_1_175875602);
-
-                    z1 = MULTIPLY(z1, FIX_0_275899380);
-                    z3 = MULTIPLY(-d7, FIX_1_961570560);
-                    tmp0 = MULTIPLY(-d7, FIX_1_662939225);
-                    z4 = MULTIPLY(-d1, FIX_0_390180644);
-                    tmp3 = MULTIPLY(d1, FIX_1_111140466);
-
-                    tmp0 += z1;
-                    tmp1 = z4 + z5;
-                    tmp2 = z3 + z5;
-                    tmp3 += z1;
-                } else {
-                    /* d1 == 0, d3 == 0, d5 == 0, d7 != 0 */
-                    tmp0 = MULTIPLY(-d7, FIX_1_387039845);
-                    tmp1 = MULTIPLY(d7, FIX_1_175875602);
-                    tmp2 = MULTIPLY(-d7, FIX_0_785694958);
-                    tmp3 = MULTIPLY(d7, FIX_0_275899380);
-                }
-            }
-        }
-    } else {
-        if (d5) {
-            if (d3) {
-                if (d1) {
-                    /* d1 != 0, d3 != 0, d5 != 0, d7 == 0 */
-                    z2 = d5 + d3;
-                    z4 = d5 + d1;
-                    z5 = MULTIPLY(d3 + z4, FIX_1_175875602);
-
-                    tmp1 = MULTIPLY(d5, FIX_2_053119869);
-                    tmp2 = MULTIPLY(d3, FIX_3_072711026);
-                    tmp3 = MULTIPLY(d1, FIX_1_501321110);
-                    z1 = MULTIPLY(-d1, FIX_0_899976223);
-                    z2 = MULTIPLY(-z2, FIX_2_562915447);
-                    z3 = MULTIPLY(-d3, FIX_1_961570560);
-                    z4 = MULTIPLY(-z4, FIX_0_390180644);
-
-                    z3 += z5;
-                    z4 += z5;
-
-                    tmp0 = z1 + z3;
-                    tmp1 += z2 + z4;
-                    tmp2 += z2 + z3;
-                    tmp3 += z1 + z4;
-                } else {
-                    /* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */
-                    z2 = d5 + d3;
-
-                    z5 = MULTIPLY(z2, FIX_1_175875602);
-                    tmp1 = MULTIPLY(d5, FIX_1_662939225);
-                    z4 = MULTIPLY(-d5, FIX_0_390180644);
-                    z2 = MULTIPLY(-z2, FIX_1_387039845);
-                    tmp2 = MULTIPLY(d3, FIX_1_111140466);
-                    z3 = MULTIPLY(-d3, FIX_1_961570560);
-
-                    tmp0 = z3 + z5;
-                    tmp1 += z2;
-                    tmp2 += z2;
-                    tmp3 = z4 + z5;
-                }
-            } else {
-                if (d1) {
-                    /* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */
-                    z4 = d5 + d1;
-
-                    z5 = MULTIPLY(z4, FIX_1_175875602);
-                    z1 = MULTIPLY(-d1, FIX_0_899976223);
-                    tmp3 = MULTIPLY(d1, FIX_0_601344887);
-                    tmp1 = MULTIPLY(-d5, FIX_0_509795579);
-                    z2 = MULTIPLY(-d5, FIX_2_562915447);
-                    z4 = MULTIPLY(z4, FIX_0_785694958);
-
-                    tmp0 = z1 + z5;
-                    tmp1 += z4;
-                    tmp2 = z2 + z5;
-                    tmp3 += z4;
-                } else {
-                    /* d1 == 0, d3 == 0, d5 != 0, d7 == 0 */
-                    tmp0 = MULTIPLY(d5, FIX_1_175875602);
-                    tmp1 = MULTIPLY(d5, FIX_0_275899380);
-                    tmp2 = MULTIPLY(-d5, FIX_1_387039845);
-                    tmp3 = MULTIPLY(d5, FIX_0_785694958);
-                }
-            }
-        } else {
-            if (d3) {
-                if (d1) {
-                    /* d1 != 0, d3 != 0, d5 == 0, d7 == 0 */
-                    z5 = d1 + d3;
-                    tmp3 = MULTIPLY(d1, FIX_0_211164243);
-                    tmp2 = MULTIPLY(-d3, FIX_1_451774981);
-                    z1 = MULTIPLY(d1, FIX_1_061594337);
-                    z2 = MULTIPLY(-d3, FIX_2_172734803);
-                    z4 = MULTIPLY(z5, FIX_0_785694958);
-                    z5 = MULTIPLY(z5, FIX_1_175875602);
-
-                    tmp0 = z1 - z4;
-                    tmp1 = z2 + z4;
-                    tmp2 += z5;
-                    tmp3 += z5;
-                } else {
-                    /* d1 == 0, d3 != 0, d5 == 0, d7 == 0 */
-                    tmp0 = MULTIPLY(-d3, FIX_0_785694958);
-                    tmp1 = MULTIPLY(-d3, FIX_1_387039845);
-                    tmp2 = MULTIPLY(-d3, FIX_0_275899380);
-                    tmp3 = MULTIPLY(d3, FIX_1_175875602);
-                }
-            } else {
-                if (d1) {
-                    /* d1 != 0, d3 == 0, d5 == 0, d7 == 0 */
-                    tmp0 = MULTIPLY(d1, FIX_0_275899380);
-                    tmp1 = MULTIPLY(d1, FIX_0_785694958);
-                    tmp2 = MULTIPLY(d1, FIX_1_175875602);
-                    tmp3 = MULTIPLY(d1, FIX_1_387039845);
-                } else {
-                    /* d1 == 0, d3 == 0, d5 == 0, d7 == 0 */
-                    tmp0 = tmp1 = tmp2 = tmp3 = 0;
-                }
-            }
-        }
-    }
-
-    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
-    dataptr[DCTSIZE*0] = (int16_t) DESCALE(tmp10 + tmp3,
-                                           CONST_BITS+PASS1_BITS+3);
-    dataptr[DCTSIZE*7] = (int16_t) DESCALE(tmp10 - tmp3,
-                                           CONST_BITS+PASS1_BITS+3);
-    dataptr[DCTSIZE*1] = (int16_t) DESCALE(tmp11 + tmp2,
-                                           CONST_BITS+PASS1_BITS+3);
-    dataptr[DCTSIZE*6] = (int16_t) DESCALE(tmp11 - tmp2,
-                                           CONST_BITS+PASS1_BITS+3);
-    dataptr[DCTSIZE*2] = (int16_t) DESCALE(tmp12 + tmp1,
-                                           CONST_BITS+PASS1_BITS+3);
-    dataptr[DCTSIZE*5] = (int16_t) DESCALE(tmp12 - tmp1,
-                                           CONST_BITS+PASS1_BITS+3);
-    dataptr[DCTSIZE*3] = (int16_t) DESCALE(tmp13 + tmp0,
-                                           CONST_BITS+PASS1_BITS+3);
-    dataptr[DCTSIZE*4] = (int16_t) DESCALE(tmp13 - tmp0,
-                                           CONST_BITS+PASS1_BITS+3);
-
-    dataptr++;                  /* advance pointer to next column */
-  }
-}
diff --git a/deps/libav/libavcodec/jvdec.c b/deps/libav/libavcodec/jvdec.c
deleted file mode 100644
index 662a944..0000000
--- a/deps/libav/libavcodec/jvdec.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Bitmap Brothers JV video decoder
- * Copyright (c) 2011 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Bitmap Brothers JV video decoder
- * @author Peter Ross <pross at xvid.org>
- */
-
-#include "libavutil/intreadwrite.h"
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "internal.h"
-
-typedef struct JvContext {
-    DSPContext dsp;
-    AVFrame   *frame;
-    uint32_t   palette[AVPALETTE_COUNT];
-    int        palette_has_changed;
-} JvContext;
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    JvContext *s = avctx->priv_data;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-    ff_dsputil_init(&s->dsp, avctx);
-    return 0;
-}
-
-/**
- * Decode 2x2 block
- */
-static inline void decode2x2(GetBitContext *gb, uint8_t *dst, int linesize)
-{
-    int i, j, v[2];
-
-    switch (get_bits(gb, 2)) {
-    case 1:
-        v[0] = get_bits(gb, 8);
-        for (j = 0; j < 2; j++)
-            memset(dst + j * linesize, v[0], 2);
-        break;
-    case 2:
-        v[0] = get_bits(gb, 8);
-        v[1] = get_bits(gb, 8);
-        for (j = 0; j < 2; j++)
-            for (i = 0; i < 2; i++)
-                dst[j * linesize + i] = v[get_bits1(gb)];
-        break;
-    case 3:
-        for (j = 0; j < 2; j++)
-            for (i = 0; i < 2; i++)
-                dst[j * linesize + i] = get_bits(gb, 8);
-    }
-}
-
-/**
- * Decode 4x4 block
- */
-static inline void decode4x4(GetBitContext *gb, uint8_t *dst, int linesize)
-{
-    int i, j, v[2];
-
-    switch (get_bits(gb, 2)) {
-    case 1:
-        v[0] = get_bits(gb, 8);
-        for (j = 0; j < 4; j++)
-            memset(dst + j * linesize, v[0], 4);
-        break;
-    case 2:
-        v[0] = get_bits(gb, 8);
-        v[1] = get_bits(gb, 8);
-        for (j = 2; j >= 0; j -= 2) {
-            for (i = 0; i < 4; i++)
-                dst[j * linesize + i] = v[get_bits1(gb)];
-            for (i = 0; i < 4; i++)
-                dst[(j + 1) * linesize + i] = v[get_bits1(gb)];
-        }
-        break;
-    case 3:
-        for (j = 0; j < 4; j += 2)
-            for (i = 0; i < 4; i += 2)
-                decode2x2(gb, dst + j * linesize + i, linesize);
-    }
-}
-
-/**
- * Decode 8x8 block
- */
-static inline void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize,
-                             DSPContext *dsp)
-{
-    int i, j, v[2];
-
-    switch (get_bits(gb, 2)) {
-    case 1:
-        v[0] = get_bits(gb, 8);
-        dsp->fill_block_tab[1](dst, v[0], linesize, 8);
-        break;
-    case 2:
-        v[0] = get_bits(gb, 8);
-        v[1] = get_bits(gb, 8);
-        for (j = 7; j >= 0; j--)
-            for (i = 0; i < 8; i++)
-                dst[j * linesize + i] = v[get_bits1(gb)];
-        break;
-    case 3:
-        for (j = 0; j < 8; j += 4)
-            for (i = 0; i < 8; i += 4)
-                decode4x4(gb, dst + j * linesize + i, linesize);
-    }
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    JvContext *s = avctx->priv_data;
-    int buf_size = avpkt->size;
-    const uint8_t *buf = avpkt->data;
-    const uint8_t *buf_end = buf + buf_size;
-    int video_size, video_type, i, j, ret;
-
-    video_size = AV_RL32(buf);
-    video_type = buf[4];
-    buf += 5;
-
-    if (video_size) {
-        if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-
-        if (video_type == 0 || video_type == 1) {
-            GetBitContext gb;
-            init_get_bits(&gb, buf, 8 * FFMIN(video_size, buf_end - buf));
-
-            for (j = 0; j < avctx->height; j += 8)
-                for (i = 0; i < avctx->width; i += 8)
-                    decode8x8(&gb,
-                              s->frame->data[0] + j * s->frame->linesize[0] + i,
-                              s->frame->linesize[0], &s->dsp);
-
-            buf += video_size;
-        } else if (video_type == 2) {
-            if (buf + 1 <= buf_end) {
-                int v = *buf++;
-                for (j = 0; j < avctx->height; j++)
-                    memset(s->frame->data[0] + j * s->frame->linesize[0],
-                           v, avctx->width);
-            }
-        } else {
-            av_log(avctx, AV_LOG_WARNING,
-                   "unsupported frame type %i\n", video_type);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    if (buf < buf_end) {
-        for (i = 0; i < AVPALETTE_COUNT && buf + 3 <= buf_end; i++) {
-            s->palette[i] = AV_RB24(buf) << 2;
-            buf += 3;
-        }
-        s->palette_has_changed = 1;
-    }
-
-    if (video_size) {
-        s->frame->key_frame           = 1;
-        s->frame->pict_type           = AV_PICTURE_TYPE_I;
-        s->frame->palette_has_changed = s->palette_has_changed;
-        s->palette_has_changed        = 0;
-        memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
-
-        if ((ret = av_frame_ref(data, s->frame)) < 0)
-            return ret;
-        *got_frame = 1;
-    }
-
-    return buf_size;
-}
-
-static av_cold int decode_close(AVCodecContext *avctx)
-{
-    JvContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_jv_decoder = {
-    .name           = "jv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Bitmap Brothers JV video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_JV,
-    .priv_data_size = sizeof(JvContext),
-    .init           = decode_init,
-    .close          = decode_close,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/kbdwin.c b/deps/libav/libavcodec/kbdwin.c
deleted file mode 100644
index 1b7313d..0000000
--- a/deps/libav/libavcodec/kbdwin.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <assert.h>
-#include "libavutil/mathematics.h"
-#include "libavutil/attributes.h"
-#include "kbdwin.h"
-
-#define BESSEL_I0_ITER 50 // default: 50 iterations of Bessel I0 approximation
-
-av_cold void ff_kbd_window_init(float *window, float alpha, int n)
-{
-   int i, j;
-   double sum = 0.0, bessel, tmp;
-   double local_window[FF_KBD_WINDOW_MAX];
-   double alpha2 = (alpha * M_PI / n) * (alpha * M_PI / n);
-
-   assert(n <= FF_KBD_WINDOW_MAX);
-
-   for (i = 0; i < n; i++) {
-       tmp = i * (n - i) * alpha2;
-       bessel = 1.0;
-       for (j = BESSEL_I0_ITER; j > 0; j--)
-           bessel = bessel * tmp / (j * j) + 1;
-       sum += bessel;
-       local_window[i] = sum;
-   }
-
-   sum++;
-   for (i = 0; i < n; i++)
-       window[i] = sqrt(local_window[i] / sum);
-}
diff --git a/deps/libav/libavcodec/kbdwin.h b/deps/libav/libavcodec/kbdwin.h
deleted file mode 100644
index 89b569a..0000000
--- a/deps/libav/libavcodec/kbdwin.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_KBDWIN_H
-#define AVCODEC_KBDWIN_H
-
-/**
- * Maximum window size for ff_kbd_window_init.
- */
-#define FF_KBD_WINDOW_MAX 1024
-
-/**
- * Generate a Kaiser-Bessel Derived Window.
- * @param   window  pointer to half window
- * @param   alpha   determines window shape
- * @param   n       size of half window, max FF_KBD_WINDOW_MAX
- */
-void ff_kbd_window_init(float *window, float alpha, int n);
-
-#endif /* AVCODEC_KBDWIN_H */
diff --git a/deps/libav/libavcodec/kgv1dec.c b/deps/libav/libavcodec/kgv1dec.c
deleted file mode 100644
index d58e775..0000000
--- a/deps/libav/libavcodec/kgv1dec.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Kega Game Video (KGV1) decoder
- * Copyright (c) 2010 Daniel Verkamp
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Kega Game Video decoder
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-
-typedef struct {
-    AVCodecContext *avctx;
-    uint16_t *frame_buffer;
-    uint16_t *last_frame_buffer;
-} KgvContext;
-
-static void decode_flush(AVCodecContext *avctx)
-{
-    KgvContext * const c = avctx->priv_data;
-
-    av_freep(&c->frame_buffer);
-    av_freep(&c->last_frame_buffer);
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    const uint8_t *buf = avpkt->data;
-    const uint8_t *buf_end = buf + avpkt->size;
-    KgvContext * const c = avctx->priv_data;
-    int offsets[8];
-    uint16_t *out, *prev;
-    int outcnt = 0, maxcnt;
-    int w, h, i, res;
-
-    if (avpkt->size < 2)
-        return AVERROR_INVALIDDATA;
-
-    w = (buf[0] + 1) * 8;
-    h = (buf[1] + 1) * 8;
-    buf += 2;
-
-    if (w != avctx->width || h != avctx->height) {
-        av_freep(&c->frame_buffer);
-        av_freep(&c->last_frame_buffer);
-        if ((res = ff_set_dimensions(avctx, w, h)) < 0)
-            return res;
-    }
-
-    if (!c->frame_buffer) {
-        c->frame_buffer      = av_mallocz(avctx->width * avctx->height * 2);
-        c->last_frame_buffer = av_mallocz(avctx->width * avctx->height * 2);
-        if (!c->frame_buffer || !c->last_frame_buffer) {
-            decode_flush(avctx);
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    maxcnt = w * h;
-
-    if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
-        return res;
-    out  = c->frame_buffer;
-    prev = c->last_frame_buffer;
-
-    for (i = 0; i < 8; i++)
-        offsets[i] = -1;
-
-    while (outcnt < maxcnt && buf_end - 2 > buf) {
-        int code = AV_RL16(buf);
-        buf += 2;
-
-        if (!(code & 0x8000)) {
-            out[outcnt++] = code; // rgb555 pixel coded directly
-        } else {
-            int count;
-            int inp_off;
-            uint16_t *inp;
-
-            if ((code & 0x6000) == 0x6000) {
-                // copy from previous frame
-                int oidx = (code >> 10) & 7;
-                int start;
-
-                count = (code & 0x3FF) + 3;
-
-                if (offsets[oidx] < 0) {
-                    if (buf_end - 3 < buf)
-                        break;
-                    offsets[oidx] = AV_RL24(buf);
-                    buf += 3;
-                }
-
-                start = (outcnt + offsets[oidx]) % maxcnt;
-
-                if (maxcnt - start < count)
-                    break;
-
-                if (!prev) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Frame reference does not exist\n");
-                    break;
-                }
-
-                inp = prev;
-                inp_off = start;
-            } else {
-                // copy from earlier in this frame
-                int offset = (code & 0x1FFF) + 1;
-
-                if (!(code & 0x6000)) {
-                    count = 2;
-                } else if ((code & 0x6000) == 0x2000) {
-                    count = 3;
-                } else {
-                    if (buf_end - 1 < buf)
-                        break;
-                    count = 4 + *buf++;
-                }
-
-                if (outcnt < offset)
-                    break;
-
-                inp = out;
-                inp_off = outcnt - offset;
-            }
-
-            if (maxcnt - outcnt < count)
-                break;
-
-            for (i = inp_off; i < count + inp_off; i++) {
-                out[outcnt++] = inp[i];
-            }
-        }
-    }
-
-    if (outcnt - maxcnt)
-        av_log(avctx, AV_LOG_DEBUG, "frame finished with %d diff\n", outcnt - maxcnt);
-
-    av_image_copy_plane(frame->data[0], frame->linesize[0],
-                        (const uint8_t*)c->frame_buffer,  avctx->width * 2,
-                        avctx->width * 2, avctx->height);
-    FFSWAP(uint16_t *, c->frame_buffer, c->last_frame_buffer);
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    KgvContext * const c = avctx->priv_data;
-
-    c->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_RGB555;
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    decode_flush(avctx);
-    return 0;
-}
-
-AVCodec ff_kgv1_decoder = {
-    .name           = "kgv1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Kega Game Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_KGV1,
-    .priv_data_size = sizeof(KgvContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .flush          = decode_flush,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/kmvc.c b/deps/libav/libavcodec/kmvc.c
deleted file mode 100644
index 5da8bb2..0000000
--- a/deps/libav/libavcodec/kmvc.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * KMVC decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Karl Morton's Video Codec decoder
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "libavutil/common.h"
-
-#define KMVC_KEYFRAME 0x80
-#define KMVC_PALETTE  0x40
-#define KMVC_METHOD   0x0F
-#define MAX_PALSIZE   256
-
-/*
- * Decoder context
- */
-typedef struct KmvcContext {
-    AVCodecContext *avctx;
-
-    int setpal;
-    int palsize;
-    uint32_t pal[MAX_PALSIZE];
-    uint8_t *cur, *prev;
-    uint8_t frm0[320 * 200], frm1[320 * 200];
-    GetByteContext g;
-} KmvcContext;
-
-typedef struct BitBuf {
-    int bits;
-    int bitbuf;
-} BitBuf;
-
-#define BLK(data, x, y)  data[av_clip((x) + (y) * 320, 0, 320 * 200 -1)]
-
-#define kmvc_init_getbits(bb, g)  bb.bits = 7; bb.bitbuf = bytestream2_get_byte(g);
-
-#define kmvc_getbit(bb, g, res) {\
-    res = 0; \
-    if (bb.bitbuf & (1 << bb.bits)) res = 1; \
-    bb.bits--; \
-    if(bb.bits == -1) { \
-        bb.bitbuf = bytestream2_get_byte(g); \
-        bb.bits = 7; \
-    } \
-}
-
-static int kmvc_decode_intra_8x8(KmvcContext * ctx, int w, int h)
-{
-    BitBuf bb;
-    int res, val;
-    int i, j;
-    int bx, by;
-    int l0x, l1x, l0y, l1y;
-    int mx, my;
-
-    kmvc_init_getbits(bb, &ctx->g);
-
-    for (by = 0; by < h; by += 8)
-        for (bx = 0; bx < w; bx += 8) {
-            if (!bytestream2_get_bytes_left(&ctx->g)) {
-                av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n");
-                return AVERROR_INVALIDDATA;
-            }
-            kmvc_getbit(bb, &ctx->g, res);
-            if (!res) {         // fill whole 8x8 block
-                val = bytestream2_get_byte(&ctx->g);
-                for (i = 0; i < 64; i++)
-                    BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val;
-            } else {            // handle four 4x4 subblocks
-                for (i = 0; i < 4; i++) {
-                    l0x = bx + (i & 1) * 4;
-                    l0y = by + (i & 2) * 2;
-                    kmvc_getbit(bb, &ctx->g, res);
-                    if (!res) {
-                        kmvc_getbit(bb, &ctx->g, res);
-                        if (!res) {     // fill whole 4x4 block
-                            val = bytestream2_get_byte(&ctx->g);
-                            for (j = 0; j < 16; j++)
-                                BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val;
-                        } else {        // copy block from already decoded place
-                            val = bytestream2_get_byte(&ctx->g);
-                            mx = val & 0xF;
-                            my = val >> 4;
-                            for (j = 0; j < 16; j++)
-                                BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) =
-                                    BLK(ctx->cur, l0x + (j & 3) - mx, l0y + (j >> 2) - my);
-                        }
-                    } else {    // descend to 2x2 sub-sub-blocks
-                        for (j = 0; j < 4; j++) {
-                            l1x = l0x + (j & 1) * 2;
-                            l1y = l0y + (j & 2);
-                            kmvc_getbit(bb, &ctx->g, res);
-                            if (!res) {
-                                kmvc_getbit(bb, &ctx->g, res);
-                                if (!res) {     // fill whole 2x2 block
-                                    val = bytestream2_get_byte(&ctx->g);
-                                    BLK(ctx->cur, l1x, l1y) = val;
-                                    BLK(ctx->cur, l1x + 1, l1y) = val;
-                                    BLK(ctx->cur, l1x, l1y + 1) = val;
-                                    BLK(ctx->cur, l1x + 1, l1y + 1) = val;
-                                } else {        // copy block from already decoded place
-                                    val = bytestream2_get_byte(&ctx->g);
-                                    mx = val & 0xF;
-                                    my = val >> 4;
-                                    BLK(ctx->cur, l1x, l1y) = BLK(ctx->cur, l1x - mx, l1y - my);
-                                    BLK(ctx->cur, l1x + 1, l1y) =
-                                        BLK(ctx->cur, l1x + 1 - mx, l1y - my);
-                                    BLK(ctx->cur, l1x, l1y + 1) =
-                                        BLK(ctx->cur, l1x - mx, l1y + 1 - my);
-                                    BLK(ctx->cur, l1x + 1, l1y + 1) =
-                                        BLK(ctx->cur, l1x + 1 - mx, l1y + 1 - my);
-                                }
-                            } else {    // read values for block
-                                BLK(ctx->cur, l1x, l1y) = bytestream2_get_byte(&ctx->g);
-                                BLK(ctx->cur, l1x + 1, l1y) = bytestream2_get_byte(&ctx->g);
-                                BLK(ctx->cur, l1x, l1y + 1) = bytestream2_get_byte(&ctx->g);
-                                BLK(ctx->cur, l1x + 1, l1y + 1) = bytestream2_get_byte(&ctx->g);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-    return 0;
-}
-
-static int kmvc_decode_inter_8x8(KmvcContext * ctx, int w, int h)
-{
-    BitBuf bb;
-    int res, val;
-    int i, j;
-    int bx, by;
-    int l0x, l1x, l0y, l1y;
-    int mx, my;
-
-    kmvc_init_getbits(bb, &ctx->g);
-
-    for (by = 0; by < h; by += 8)
-        for (bx = 0; bx < w; bx += 8) {
-            kmvc_getbit(bb, &ctx->g, res);
-            if (!res) {
-                kmvc_getbit(bb, &ctx->g, res);
-                if (!res) {     // fill whole 8x8 block
-                    if (!bytestream2_get_bytes_left(&ctx->g)) {
-                        av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    val = bytestream2_get_byte(&ctx->g);
-                    for (i = 0; i < 64; i++)
-                        BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val;
-                } else {        // copy block from previous frame
-                    for (i = 0; i < 64; i++)
-                        BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) =
-                            BLK(ctx->prev, bx + (i & 0x7), by + (i >> 3));
-                }
-            } else {            // handle four 4x4 subblocks
-                if (!bytestream2_get_bytes_left(&ctx->g)) {
-                    av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                for (i = 0; i < 4; i++) {
-                    l0x = bx + (i & 1) * 4;
-                    l0y = by + (i & 2) * 2;
-                    kmvc_getbit(bb, &ctx->g, res);
-                    if (!res) {
-                        kmvc_getbit(bb, &ctx->g, res);
-                        if (!res) {     // fill whole 4x4 block
-                            val = bytestream2_get_byte(&ctx->g);
-                            for (j = 0; j < 16; j++)
-                                BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val;
-                        } else {        // copy block
-                            val = bytestream2_get_byte(&ctx->g);
-                            mx = (val & 0xF) - 8;
-                            my = (val >> 4) - 8;
-                            for (j = 0; j < 16; j++)
-                                BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) =
-                                    BLK(ctx->prev, l0x + (j & 3) + mx, l0y + (j >> 2) + my);
-                        }
-                    } else {    // descend to 2x2 sub-sub-blocks
-                        for (j = 0; j < 4; j++) {
-                            l1x = l0x + (j & 1) * 2;
-                            l1y = l0y + (j & 2);
-                            kmvc_getbit(bb, &ctx->g, res);
-                            if (!res) {
-                                kmvc_getbit(bb, &ctx->g, res);
-                                if (!res) {     // fill whole 2x2 block
-                                    val = bytestream2_get_byte(&ctx->g);
-                                    BLK(ctx->cur, l1x, l1y) = val;
-                                    BLK(ctx->cur, l1x + 1, l1y) = val;
-                                    BLK(ctx->cur, l1x, l1y + 1) = val;
-                                    BLK(ctx->cur, l1x + 1, l1y + 1) = val;
-                                } else {        // copy block
-                                    val = bytestream2_get_byte(&ctx->g);
-                                    mx = (val & 0xF) - 8;
-                                    my = (val >> 4) - 8;
-                                    BLK(ctx->cur, l1x, l1y) = BLK(ctx->prev, l1x + mx, l1y + my);
-                                    BLK(ctx->cur, l1x + 1, l1y) =
-                                        BLK(ctx->prev, l1x + 1 + mx, l1y + my);
-                                    BLK(ctx->cur, l1x, l1y + 1) =
-                                        BLK(ctx->prev, l1x + mx, l1y + 1 + my);
-                                    BLK(ctx->cur, l1x + 1, l1y + 1) =
-                                        BLK(ctx->prev, l1x + 1 + mx, l1y + 1 + my);
-                                }
-                            } else {    // read values for block
-                                BLK(ctx->cur, l1x, l1y) = bytestream2_get_byte(&ctx->g);
-                                BLK(ctx->cur, l1x + 1, l1y) = bytestream2_get_byte(&ctx->g);
-                                BLK(ctx->cur, l1x, l1y + 1) = bytestream2_get_byte(&ctx->g);
-                                BLK(ctx->cur, l1x + 1, l1y + 1) = bytestream2_get_byte(&ctx->g);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    KmvcContext *const ctx = avctx->priv_data;
-    AVFrame *frame = data;
-    uint8_t *out, *src;
-    int i, ret;
-    int header;
-    int blocksize;
-    const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-
-    bytestream2_init(&ctx->g, avpkt->data, avpkt->size);
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    header = bytestream2_get_byte(&ctx->g);
-
-    /* blocksize 127 is really palette change event */
-    if (bytestream2_peek_byte(&ctx->g) == 127) {
-        bytestream2_skip(&ctx->g, 3);
-        for (i = 0; i < 127; i++) {
-            ctx->pal[i + (header & 0x81)] = bytestream2_get_be24(&ctx->g);
-            bytestream2_skip(&ctx->g, 1);
-        }
-        bytestream2_seek(&ctx->g, -127 * 4 - 3, SEEK_CUR);
-    }
-
-    if (header & KMVC_KEYFRAME) {
-        frame->key_frame = 1;
-        frame->pict_type = AV_PICTURE_TYPE_I;
-    } else {
-        frame->key_frame = 0;
-        frame->pict_type = AV_PICTURE_TYPE_P;
-    }
-
-    if (header & KMVC_PALETTE) {
-        frame->palette_has_changed = 1;
-        // palette starts from index 1 and has 127 entries
-        for (i = 1; i <= ctx->palsize; i++) {
-            ctx->pal[i] = bytestream2_get_be24(&ctx->g);
-        }
-    }
-
-    if (pal) {
-        frame->palette_has_changed = 1;
-        memcpy(ctx->pal, pal, AVPALETTE_SIZE);
-    }
-
-    if (ctx->setpal) {
-        ctx->setpal = 0;
-        frame->palette_has_changed = 1;
-    }
-
-    /* make the palette available on the way out */
-    memcpy(frame->data[1], ctx->pal, 1024);
-
-    blocksize = bytestream2_get_byte(&ctx->g);
-
-    if (blocksize != 8 && blocksize != 127) {
-        av_log(avctx, AV_LOG_ERROR, "Block size = %i\n", blocksize);
-        return AVERROR_INVALIDDATA;
-    }
-    memset(ctx->cur, 0, 320 * 200);
-    switch (header & KMVC_METHOD) {
-    case 0:
-    case 1: // used in palette changed event
-        memcpy(ctx->cur, ctx->prev, 320 * 200);
-        break;
-    case 3:
-        kmvc_decode_intra_8x8(ctx, avctx->width, avctx->height);
-        break;
-    case 4:
-        kmvc_decode_inter_8x8(ctx, avctx->width, avctx->height);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown compression method %i\n", header & KMVC_METHOD);
-        return AVERROR_INVALIDDATA;
-    }
-
-    out = frame->data[0];
-    src = ctx->cur;
-    for (i = 0; i < avctx->height; i++) {
-        memcpy(out, src, avctx->width);
-        src += 320;
-        out += frame->linesize[0];
-    }
-
-    /* flip buffers */
-    if (ctx->cur == ctx->frm0) {
-        ctx->cur = ctx->frm1;
-        ctx->prev = ctx->frm0;
-    } else {
-        ctx->cur = ctx->frm0;
-        ctx->prev = ctx->frm1;
-    }
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return avpkt->size;
-}
-
-
-
-/*
- * Init kmvc decoder
- */
-static av_cold int decode_init(AVCodecContext * avctx)
-{
-    KmvcContext *const c = avctx->priv_data;
-    int i;
-
-    c->avctx = avctx;
-
-    if (avctx->width > 320 || avctx->height > 200) {
-        av_log(avctx, AV_LOG_ERROR, "KMVC supports frames <= 320x200\n");
-        return AVERROR(EINVAL);
-    }
-
-    c->cur = c->frm0;
-    c->prev = c->frm1;
-
-    for (i = 0; i < 256; i++) {
-        c->pal[i] = i * 0x10101;
-    }
-
-    if (avctx->extradata_size < 12) {
-        av_log(avctx, AV_LOG_WARNING,
-               "Extradata missing, decoding may not work properly...\n");
-        c->palsize = 127;
-    } else {
-        c->palsize = AV_RL16(avctx->extradata + 10);
-        if (c->palsize >= MAX_PALSIZE) {
-            av_log(avctx, AV_LOG_ERROR, "KMVC palette too large\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    if (avctx->extradata_size == 1036) {        // palette in extradata
-        uint8_t *src = avctx->extradata + 12;
-        for (i = 0; i < 256; i++) {
-            c->pal[i] = AV_RL32(src);
-            src += 4;
-        }
-        c->setpal = 1;
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    return 0;
-}
-
-AVCodec ff_kmvc_decoder = {
-    .name           = "kmvc",
-    .long_name      = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_KMVC,
-    .priv_data_size = sizeof(KmvcContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/lagarith.c b/deps/libav/libavcodec/lagarith.c
deleted file mode 100644
index 2814e2d..0000000
--- a/deps/libav/libavcodec/lagarith.c
+++ /dev/null
@@ -1,707 +0,0 @@
-/*
- * Lagarith lossless decoder
- * Copyright (c) 2009 Nathan Caldwell <saintdev (at) gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Lagarith lossless decoder
- * @author Nathan Caldwell
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "mathops.h"
-#include "dsputil.h"
-#include "lagarithrac.h"
-#include "thread.h"
-
-enum LagarithFrameType {
-    FRAME_RAW           = 1,    /**< uncompressed */
-    FRAME_U_RGB24       = 2,    /**< unaligned RGB24 */
-    FRAME_ARITH_YUY2    = 3,    /**< arithmetic coded YUY2 */
-    FRAME_ARITH_RGB24   = 4,    /**< arithmetic coded RGB24 */
-    FRAME_SOLID_GRAY    = 5,    /**< solid grayscale color frame */
-    FRAME_SOLID_COLOR   = 6,    /**< solid non-grayscale color frame */
-    FRAME_OLD_ARITH_RGB = 7,    /**< obsolete arithmetic coded RGB (no longer encoded by upstream since version 1.1.0) */
-    FRAME_ARITH_RGBA    = 8,    /**< arithmetic coded RGBA */
-    FRAME_SOLID_RGBA    = 9,    /**< solid RGBA color frame */
-    FRAME_ARITH_YV12    = 10,   /**< arithmetic coded YV12 */
-    FRAME_REDUCED_RES   = 11,   /**< reduced resolution YV12 frame */
-};
-
-typedef struct LagarithContext {
-    AVCodecContext *avctx;
-    DSPContext dsp;
-    int zeros;                  /**< number of consecutive zero bytes encountered */
-    int zeros_rem;              /**< number of zero bytes remaining to output */
-    uint8_t *rgb_planes;
-    int      rgb_planes_allocated;
-    int rgb_stride;
-} LagarithContext;
-
-/**
- * Compute the 52bit mantissa of 1/(double)denom.
- * This crazy format uses floats in an entropy coder and we have to match x86
- * rounding exactly, thus ordinary floats aren't portable enough.
- * @param denom denominator
- * @return 52bit mantissa
- * @see softfloat_mul
- */
-static uint64_t softfloat_reciprocal(uint32_t denom)
-{
-    int shift = av_log2(denom - 1) + 1;
-    uint64_t ret = (1ULL << 52) / denom;
-    uint64_t err = (1ULL << 52) - ret * denom;
-    ret <<= shift;
-    err <<= shift;
-    err +=  denom / 2;
-    return ret + err / denom;
-}
-
-/**
- * (uint32_t)(x*f), where f has the given mantissa, and exponent 0
- * Used in combination with softfloat_reciprocal computes x/(double)denom.
- * @param x 32bit integer factor
- * @param mantissa mantissa of f with exponent 0
- * @return 32bit integer value (x*f)
- * @see softfloat_reciprocal
- */
-static uint32_t softfloat_mul(uint32_t x, uint64_t mantissa)
-{
-    uint64_t l = x * (mantissa & 0xffffffff);
-    uint64_t h = x * (mantissa >> 32);
-    h += l >> 32;
-    l &= 0xffffffff;
-    l += 1 << av_log2(h >> 21);
-    h += l >> 32;
-    return h >> 20;
-}
-
-static uint8_t lag_calc_zero_run(int8_t x)
-{
-    return (x << 1) ^ (x >> 7);
-}
-
-static int lag_decode_prob(GetBitContext *gb, uint32_t *value)
-{
-    static const uint8_t series[] = { 1, 2, 3, 5, 8, 13, 21 };
-    int i;
-    int bit     = 0;
-    int bits    = 0;
-    int prevbit = 0;
-    unsigned val;
-
-    for (i = 0; i < 7; i++) {
-        if (prevbit && bit)
-            break;
-        prevbit = bit;
-        bit = get_bits1(gb);
-        if (bit && !prevbit)
-            bits += series[i];
-    }
-    bits--;
-    if (bits < 0 || bits > 31) {
-        *value = 0;
-        return -1;
-    } else if (bits == 0) {
-        *value = 0;
-        return 0;
-    }
-
-    val  = get_bits_long(gb, bits);
-    val |= 1 << bits;
-
-    *value = val - 1;
-
-    return 0;
-}
-
-static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
-{
-    int i, j, scale_factor;
-    unsigned prob, cumulative_target;
-    unsigned cumul_prob = 0;
-    unsigned scaled_cumul_prob = 0;
-
-    rac->prob[0] = 0;
-    rac->prob[257] = UINT_MAX;
-    /* Read probabilities from bitstream */
-    for (i = 1; i < 257; i++) {
-        if (lag_decode_prob(gb, &rac->prob[i]) < 0) {
-            av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability encountered.\n");
-            return -1;
-        }
-        if ((uint64_t)cumul_prob + rac->prob[i] > UINT_MAX) {
-            av_log(rac->avctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n");
-            return -1;
-        }
-        cumul_prob += rac->prob[i];
-        if (!rac->prob[i]) {
-            if (lag_decode_prob(gb, &prob)) {
-                av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\n");
-                return -1;
-            }
-            if (prob > 257 - i)
-                prob = 257 - i;
-            for (j = 0; j < prob; j++)
-                rac->prob[++i] = 0;
-        }
-    }
-
-    if (!cumul_prob) {
-        av_log(rac->avctx, AV_LOG_ERROR, "All probabilities are 0!\n");
-        return -1;
-    }
-
-    /* Scale probabilities so cumulative probability is an even power of 2. */
-    scale_factor = av_log2(cumul_prob);
-
-    if (cumul_prob & (cumul_prob - 1)) {
-        uint64_t mul = softfloat_reciprocal(cumul_prob);
-        for (i = 1; i < 257; i++) {
-            rac->prob[i] = softfloat_mul(rac->prob[i], mul);
-            scaled_cumul_prob += rac->prob[i];
-        }
-
-        scale_factor++;
-        cumulative_target = 1 << scale_factor;
-
-        if (scaled_cumul_prob > cumulative_target) {
-            av_log(rac->avctx, AV_LOG_ERROR,
-                   "Scaled probabilities are larger than target!\n");
-            return -1;
-        }
-
-        scaled_cumul_prob = cumulative_target - scaled_cumul_prob;
-
-        for (i = 1; scaled_cumul_prob; i = (i & 0x7f) + 1) {
-            if (rac->prob[i]) {
-                rac->prob[i]++;
-                scaled_cumul_prob--;
-            }
-            /* Comment from reference source:
-             * if (b & 0x80 == 0) {     // order of operations is 'wrong'; it has been left this way
-             *                          // since the compression change is negligible and fixing it
-             *                          // breaks backwards compatibility
-             *      b =- (signed int)b;
-             *      b &= 0xFF;
-             * } else {
-             *      b++;
-             *      b &= 0x7f;
-             * }
-             */
-        }
-    }
-
-    rac->scale = scale_factor;
-
-    /* Fill probability array with cumulative probability for each symbol. */
-    for (i = 1; i < 257; i++)
-        rac->prob[i] += rac->prob[i - 1];
-
-    return 0;
-}
-
-static void add_lag_median_prediction(uint8_t *dst, uint8_t *src1,
-                                      uint8_t *diff, int w, int *left,
-                                      int *left_top)
-{
-    /* This is almost identical to add_hfyu_median_prediction in dsputil.h.
-     * However the &0xFF on the gradient predictor yealds incorrect output
-     * for lagarith.
-     */
-    int i;
-    uint8_t l, lt;
-
-    l  = *left;
-    lt = *left_top;
-
-    for (i = 0; i < w; i++) {
-        l = mid_pred(l, src1[i], l + src1[i] - lt) + diff[i];
-        lt = src1[i];
-        dst[i] = l;
-    }
-
-    *left     = l;
-    *left_top = lt;
-}
-
-static void lag_pred_line(LagarithContext *l, uint8_t *buf,
-                          int width, int stride, int line)
-{
-    int L, TL;
-
-    if (!line) {
-        int i, align_width = (width - 1) & ~31;
-        /* Left prediction only for first line */
-        L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1,
-                                            align_width, buf[0]);
-        for (i = align_width + 1; i < width; i++)
-            buf[i] += buf[i - 1];
-    } else {
-        /* Left pixel is actually prev_row[width] */
-        L = buf[width - stride - 1];
-
-        if (line == 1) {
-            /* Second line, left predict first pixel, the rest of the line is median predicted
-             * NOTE: In the case of RGB this pixel is top predicted */
-            TL = l->avctx->pix_fmt == AV_PIX_FMT_YUV420P ? buf[-stride] : L;
-        } else {
-            /* Top left is 2 rows back, last pixel */
-            TL = buf[width - (2 * stride) - 1];
-        }
-
-        add_lag_median_prediction(buf, buf - stride, buf,
-                                  width, &L, &TL);
-    }
-}
-
-static void lag_pred_line_yuy2(LagarithContext *l, uint8_t *buf,
-                               int width, int stride, int line,
-                               int is_luma)
-{
-    int L, TL;
-
-    if (!line) {
-        int i, align_width;
-        if (is_luma) {
-            buf++;
-            width--;
-        }
-
-        align_width = (width - 1) & ~31;
-        l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1, align_width, buf[0]);
-
-        for (i = align_width + 1; i < width; i++)
-            buf[i] += buf[i - 1];
-
-        return;
-    }
-    if (line == 1) {
-        const int HEAD = is_luma ? 4 : 2;
-        int i;
-
-        L  = buf[width - stride - 1];
-        TL = buf[HEAD  - stride - 1];
-        for (i = 0; i < HEAD; i++) {
-            L += buf[i];
-            buf[i] = L;
-        }
-        for (; i < width; i++) {
-            L      = mid_pred(L & 0xFF, buf[i - stride], (L + buf[i - stride] - TL) & 0xFF) + buf[i];
-            TL     = buf[i - stride];
-            buf[i] = L;
-        }
-    } else {
-        TL = buf[width - (2 * stride) - 1];
-        L  = buf[width - stride - 1];
-        l->dsp.add_hfyu_median_prediction(buf, buf - stride, buf, width,
-                                          &L, &TL);
-    }
-}
-
-static int lag_decode_line(LagarithContext *l, lag_rac *rac,
-                           uint8_t *dst, int width, int stride,
-                           int esc_count)
-{
-    int i = 0;
-    int ret = 0;
-
-    if (!esc_count)
-        esc_count = -1;
-
-    /* Output any zeros remaining from the previous run */
-handle_zeros:
-    if (l->zeros_rem) {
-        int count = FFMIN(l->zeros_rem, width - i);
-        memset(dst + i, 0, count);
-        i += count;
-        l->zeros_rem -= count;
-    }
-
-    while (i < width) {
-        dst[i] = lag_get_rac(rac);
-        ret++;
-
-        if (dst[i])
-            l->zeros = 0;
-        else
-            l->zeros++;
-
-        i++;
-        if (l->zeros == esc_count) {
-            int index = lag_get_rac(rac);
-            ret++;
-
-            l->zeros = 0;
-
-            l->zeros_rem = lag_calc_zero_run(index);
-            goto handle_zeros;
-        }
-    }
-    return ret;
-}
-
-static int lag_decode_zero_run_line(LagarithContext *l, uint8_t *dst,
-                                    const uint8_t *src, const uint8_t *src_end,
-                                    int width, int esc_count)
-{
-    int i = 0;
-    int count;
-    uint8_t zero_run = 0;
-    const uint8_t *src_start = src;
-    uint8_t mask1 = -(esc_count < 2);
-    uint8_t mask2 = -(esc_count < 3);
-    uint8_t *end = dst + (width - 2);
-
-output_zeros:
-    if (l->zeros_rem) {
-        count = FFMIN(l->zeros_rem, width - i);
-        if (end - dst < count) {
-            av_log(l->avctx, AV_LOG_ERROR, "Too many zeros remaining.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        memset(dst, 0, count);
-        l->zeros_rem -= count;
-        dst += count;
-    }
-
-    while (dst < end) {
-        i = 0;
-        while (!zero_run && dst + i < end) {
-            i++;
-            if (src + i >= src_end)
-                return AVERROR_INVALIDDATA;
-            zero_run =
-                !(src[i] | (src[i + 1] & mask1) | (src[i + 2] & mask2));
-        }
-        if (zero_run) {
-            zero_run = 0;
-            i += esc_count;
-            memcpy(dst, src, i);
-            dst += i;
-            l->zeros_rem = lag_calc_zero_run(src[i]);
-
-            src += i + 1;
-            goto output_zeros;
-        } else {
-            memcpy(dst, src, i);
-            src += i;
-            dst += i;
-        }
-    }
-    return src_start - src;
-}
-
-
-
-static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
-                                  int width, int height, int stride,
-                                  const uint8_t *src, int src_size)
-{
-    int i = 0;
-    int read = 0;
-    uint32_t length;
-    uint32_t offset = 1;
-    int esc_count = src[0];
-    GetBitContext gb;
-    lag_rac rac;
-    const uint8_t *src_end = src + src_size;
-
-    rac.avctx = l->avctx;
-    l->zeros = 0;
-
-    if (esc_count < 4) {
-        length = width * height;
-        if (esc_count && AV_RL32(src + 1) < length) {
-            length = AV_RL32(src + 1);
-            offset += 4;
-        }
-
-        init_get_bits(&gb, src + offset, src_size * 8);
-
-        if (lag_read_prob_header(&rac, &gb) < 0)
-            return -1;
-
-        ff_lag_rac_init(&rac, &gb, length - stride);
-
-        for (i = 0; i < height; i++)
-            read += lag_decode_line(l, &rac, dst + (i * stride), width,
-                                    stride, esc_count);
-
-        if (read > length)
-            av_log(l->avctx, AV_LOG_WARNING,
-                   "Output more bytes than length (%d of %d)\n", read,
-                   length);
-    } else if (esc_count < 8) {
-        esc_count -= 4;
-        if (esc_count > 0) {
-            /* Zero run coding only, no range coding. */
-            for (i = 0; i < height; i++) {
-                int res = lag_decode_zero_run_line(l, dst + (i * stride), src,
-                                                   src_end, width, esc_count);
-                if (res < 0)
-                    return res;
-                src += res;
-            }
-        } else {
-            if (src_size < width * height)
-                return AVERROR_INVALIDDATA; // buffer not big enough
-            /* Plane is stored uncompressed */
-            for (i = 0; i < height; i++) {
-                memcpy(dst + (i * stride), src, width);
-                src += width;
-            }
-        }
-    } else if (esc_count == 0xff) {
-        /* Plane is a solid run of given value */
-        for (i = 0; i < height; i++)
-            memset(dst + i * stride, src[1], width);
-        /* Do not apply prediction.
-           Note: memset to 0 above, setting first value to src[1]
-           and applying prediction gives the same result. */
-        return 0;
-    } else {
-        av_log(l->avctx, AV_LOG_ERROR,
-               "Invalid zero run escape code! (%#x)\n", esc_count);
-        return -1;
-    }
-
-    if (l->avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
-        for (i = 0; i < height; i++) {
-            lag_pred_line(l, dst, width, stride, i);
-            dst += stride;
-        }
-    } else {
-        for (i = 0; i < height; i++) {
-            lag_pred_line_yuy2(l, dst, width, stride, i,
-                               width == l->avctx->width);
-            dst += stride;
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Decode a frame.
- * @param avctx codec context
- * @param data output AVFrame
- * @param data_size size of output data or 0 if no picture is returned
- * @param avpkt input packet
- * @return number of consumed bytes on success or negative if decode fails
- */
-static int lag_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    LagarithContext *l = avctx->priv_data;
-    ThreadFrame frame = { .f = data };
-    AVFrame *const p  = data;
-    uint8_t frametype = 0;
-    uint32_t offset_gu = 0, offset_bv = 0, offset_ry = 9;
-    uint32_t offs[4];
-    uint8_t *srcs[4], *dst;
-    int i, j, planes = 3;
-
-    p->key_frame = 1;
-
-    frametype = buf[0];
-
-    offset_gu = AV_RL32(buf + 1);
-    offset_bv = AV_RL32(buf + 5);
-
-    switch (frametype) {
-    case FRAME_SOLID_RGBA:
-        avctx->pix_fmt = AV_PIX_FMT_RGB32;
-
-        if (ff_thread_get_buffer(avctx, &frame, 0) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return -1;
-        }
-
-        dst = p->data[0];
-        for (j = 0; j < avctx->height; j++) {
-            for (i = 0; i < avctx->width; i++)
-                AV_WN32(dst + i * 4, offset_gu);
-            dst += p->linesize[0];
-        }
-        break;
-    case FRAME_ARITH_RGBA:
-        avctx->pix_fmt = AV_PIX_FMT_RGB32;
-        planes = 4;
-        offset_ry += 4;
-        offs[3] = AV_RL32(buf + 9);
-    case FRAME_ARITH_RGB24:
-    case FRAME_U_RGB24:
-        if (frametype == FRAME_ARITH_RGB24 || frametype == FRAME_U_RGB24)
-            avctx->pix_fmt = AV_PIX_FMT_RGB24;
-
-        if (ff_thread_get_buffer(avctx, &frame, 0) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return -1;
-        }
-
-        offs[0] = offset_bv;
-        offs[1] = offset_gu;
-        offs[2] = offset_ry;
-
-        l->rgb_stride = FFALIGN(avctx->width, 16);
-        av_fast_malloc(&l->rgb_planes, &l->rgb_planes_allocated,
-                       l->rgb_stride * avctx->height * planes + 1);
-        if (!l->rgb_planes) {
-            av_log(avctx, AV_LOG_ERROR, "cannot allocate temporary buffer\n");
-            return AVERROR(ENOMEM);
-        }
-        for (i = 0; i < planes; i++)
-            srcs[i] = l->rgb_planes + (i + 1) * l->rgb_stride * avctx->height - l->rgb_stride;
-        if (offset_ry >= buf_size ||
-            offset_gu >= buf_size ||
-            offset_bv >= buf_size ||
-            (planes == 4 && offs[3] >= buf_size)) {
-            av_log(avctx, AV_LOG_ERROR,
-                    "Invalid frame offsets\n");
-            return AVERROR_INVALIDDATA;
-        }
-        for (i = 0; i < planes; i++)
-            lag_decode_arith_plane(l, srcs[i],
-                                   avctx->width, avctx->height,
-                                   -l->rgb_stride, buf + offs[i],
-                                   buf_size - offs[i]);
-        dst = p->data[0];
-        for (i = 0; i < planes; i++)
-            srcs[i] = l->rgb_planes + i * l->rgb_stride * avctx->height;
-        for (j = 0; j < avctx->height; j++) {
-            for (i = 0; i < avctx->width; i++) {
-                uint8_t r, g, b, a;
-                r = srcs[0][i];
-                g = srcs[1][i];
-                b = srcs[2][i];
-                r += g;
-                b += g;
-                if (frametype == FRAME_ARITH_RGBA) {
-                    a = srcs[3][i];
-                    AV_WN32(dst + i * 4, MKBETAG(a, r, g, b));
-                } else {
-                    dst[i * 3 + 0] = r;
-                    dst[i * 3 + 1] = g;
-                    dst[i * 3 + 2] = b;
-                }
-            }
-            dst += p->linesize[0];
-            for (i = 0; i < planes; i++)
-                srcs[i] += l->rgb_stride;
-        }
-        break;
-    case FRAME_ARITH_YUY2:
-        avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-
-        if (ff_thread_get_buffer(avctx, &frame, 0) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return -1;
-        }
-
-        if (offset_ry >= buf_size ||
-            offset_gu >= buf_size ||
-            offset_bv >= buf_size) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid frame offsets\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        lag_decode_arith_plane(l, p->data[0], avctx->width, avctx->height,
-                               p->linesize[0], buf + offset_ry,
-                               buf_size - offset_ry);
-        lag_decode_arith_plane(l, p->data[1], avctx->width / 2,
-                               avctx->height, p->linesize[1],
-                               buf + offset_gu, buf_size - offset_gu);
-        lag_decode_arith_plane(l, p->data[2], avctx->width / 2,
-                               avctx->height, p->linesize[2],
-                               buf + offset_bv, buf_size - offset_bv);
-        break;
-    case FRAME_ARITH_YV12:
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-        if (ff_thread_get_buffer(avctx, &frame, 0) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return -1;
-        }
-
-        if (offset_ry >= buf_size ||
-            offset_gu >= buf_size ||
-            offset_bv >= buf_size) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid frame offsets\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        lag_decode_arith_plane(l, p->data[0], avctx->width, avctx->height,
-                               p->linesize[0], buf + offset_ry,
-                               buf_size - offset_ry);
-        lag_decode_arith_plane(l, p->data[2], avctx->width / 2,
-                               avctx->height / 2, p->linesize[2],
-                               buf + offset_gu, buf_size - offset_gu);
-        lag_decode_arith_plane(l, p->data[1], avctx->width / 2,
-                               avctx->height / 2, p->linesize[1],
-                               buf + offset_bv, buf_size - offset_bv);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR,
-               "Unsupported Lagarith frame type: %#x\n", frametype);
-        return -1;
-    }
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int lag_decode_init(AVCodecContext *avctx)
-{
-    LagarithContext *l = avctx->priv_data;
-    l->avctx = avctx;
-
-    ff_dsputil_init(&l->dsp, avctx);
-
-    return 0;
-}
-
-static av_cold int lag_decode_end(AVCodecContext *avctx)
-{
-    LagarithContext *l = avctx->priv_data;
-
-    av_freep(&l->rgb_planes);
-
-    return 0;
-}
-
-AVCodec ff_lagarith_decoder = {
-    .name           = "lagarith",
-    .long_name      = NULL_IF_CONFIG_SMALL("Lagarith lossless"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_LAGARITH,
-    .priv_data_size = sizeof(LagarithContext),
-    .init           = lag_decode_init,
-    .close          = lag_decode_end,
-    .decode         = lag_decode_frame,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
-};
diff --git a/deps/libav/libavcodec/lagarithrac.c b/deps/libav/libavcodec/lagarithrac.c
deleted file mode 100644
index edfb18f..0000000
--- a/deps/libav/libavcodec/lagarithrac.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Lagarith range decoder
- * Copyright (c) 2009 Nathan Caldwell <saintdev (at) gmail.com>
- * Copyright (c) 2009 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Lagarith range decoder
- * @author Nathan Caldwell
- * @author David Conrad
- */
-
-#include "get_bits.h"
-#include "lagarithrac.h"
-
-void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length)
-{
-    int i, j, left;
-
-    /* According to reference decoder "1st byte is garbage",
-     * however, it gets skipped by the call to align_get_bits()
-     */
-    align_get_bits(gb);
-    left                = get_bits_left(gb) >> 3;
-    l->bytestream_start =
-    l->bytestream       = gb->buffer + get_bits_count(gb) / 8;
-    l->bytestream_end   = l->bytestream_start + FFMIN(length, left);
-
-    l->range        = 0x80;
-    l->low          = *l->bytestream >> 1;
-    l->hash_shift   = FFMAX(l->scale - 8, 0);
-
-    for (i = j = 0; i < 256; i++) {
-        unsigned r = i << l->hash_shift;
-        while (l->prob[j + 1] <= r)
-            j++;
-        l->range_hash[i] = j;
-    }
-
-    /* Add conversion factor to hash_shift so we don't have to in lag_get_rac. */
-    l->hash_shift += 23;
-}
diff --git a/deps/libav/libavcodec/lagarithrac.h b/deps/libav/libavcodec/lagarithrac.h
deleted file mode 100644
index e4f066e..0000000
--- a/deps/libav/libavcodec/lagarithrac.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Lagarith range decoder
- * Copyright (c) 2009 Nathan Caldwell <saintdev (at) gmail.com>
- * Copyright (c) 2009 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Lagarith range decoder
- * @author Nathan Caldwell
- * @author David Conrad
- */
-
-#ifndef AVCODEC_LAGARITHRAC_H
-#define AVCODEC_LAGARITHRAC_H
-
-#include <stdint.h>
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "get_bits.h"
-
-typedef struct lag_rac {
-    AVCodecContext *avctx;
-    unsigned low;
-    unsigned range;
-    unsigned scale;             /**< Number of bits of precision in range. */
-    unsigned hash_shift;        /**< Number of bits to shift to calculate hash for radix search. */
-
-    const uint8_t *bytestream_start;  /**< Start of input bytestream. */
-    const uint8_t *bytestream;        /**< Current position in input bytestream. */
-    const uint8_t *bytestream_end;    /**< End position of input bytestream. */
-
-    uint32_t prob[258];         /**< Table of cumulative probability for each symbol. */
-    uint8_t  range_hash[256];   /**< Hash table mapping upper byte to approximate symbol. */
-} lag_rac;
-
-void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length);
-
-/* TODO: Optimize */
-static inline void lag_rac_refill(lag_rac *l)
-{
-    while (l->range <= 0x800000) {
-        l->low   <<= 8;
-        l->range <<= 8;
-        l->low |= 0xff & (AV_RB16(l->bytestream) >> 1);
-        if (l->bytestream < l->bytestream_end)
-            l->bytestream++;
-    }
-}
-
-/**
- * Decode a single byte from the compressed plane described by *l.
- * @param l pointer to lag_rac for the current plane
- * @return next byte of decoded data
- */
-static inline uint8_t lag_get_rac(lag_rac *l)
-{
-    unsigned range_scaled, low_scaled, div;
-    int val;
-    uint8_t shift;
-
-    lag_rac_refill(l);
-
-    range_scaled = l->range >> l->scale;
-
-    if (l->low < range_scaled * l->prob[255]) {
-        /* val = 0 is frequent enough to deserve a shortcut */
-        if (l->low < range_scaled * l->prob[1]) {
-            val = 0;
-        } else {
-            /* FIXME __builtin_clz is ~20% faster here, but not allowed in generic code. */
-            shift = 30 - av_log2(range_scaled);
-            div = ((range_scaled << shift) + (1 << 23) - 1) >> 23;
-            /* low>>24 ensures that any cases too big for exact FASTDIV are
-             * under- rather than over-estimated
-             */
-            low_scaled = FASTDIV(l->low - (l->low >> 24), div);
-            shift -= l->hash_shift;
-            shift &= 31;
-            low_scaled = (low_scaled << shift) | (low_scaled >> (32 - shift));
-            /* low_scaled is now a lower bound of low/range_scaled */
-            val = l->range_hash[(uint8_t) low_scaled];
-            while (l->low >= range_scaled * l->prob[val + 1])
-                val++;
-        }
-
-        l->range = range_scaled * (l->prob[val + 1] - l->prob[val]);
-    } else {
-        val = 255;
-        l->range -= range_scaled * l->prob[255];
-    }
-
-    if (!l->range)
-        l->range = 0x80;
-
-    l->low -= range_scaled * l->prob[val];
-
-    return val;
-}
-
-
-#endif /* AVCODEC_LAGARITHRAC_H */
diff --git a/deps/libav/libavcodec/latm_parser.c b/deps/libav/libavcodec/latm_parser.c
deleted file mode 100644
index 6fdb897..0000000
--- a/deps/libav/libavcodec/latm_parser.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * copyright (c) 2008 Paul Kendall <paul at kcbbs.gen.nz>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AAC LATM parser
- */
-
-#include <stdint.h>
-#include "parser.h"
-
-#define LATM_HEADER     0x56e000        // 0x2b7 (11 bits)
-#define LATM_MASK       0xFFE000        // top 11 bits
-#define LATM_SIZE_MASK  0x001FFF        // bottom 13 bits
-
-typedef struct LATMParseContext{
-    ParseContext pc;
-    int count;
-} LATMParseContext;
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int latm_find_frame_end(AVCodecParserContext *s1, const uint8_t *buf,
-                               int buf_size)
-{
-    LATMParseContext *s = s1->priv_data;
-    ParseContext *pc    = &s->pc;
-    int pic_found, i;
-    uint32_t state;
-
-    pic_found = pc->frame_start_found;
-    state     = pc->state;
-
-    i = 0;
-    if (!pic_found) {
-        for (i = 0; i < buf_size; i++) {
-            state = (state<<8) | buf[i];
-            if ((state & LATM_MASK) == LATM_HEADER) {
-                i++;
-                s->count  = -i;
-                pic_found = 1;
-                break;
-            }
-        }
-    }
-
-    if (pic_found) {
-        /* EOF considered as end of frame */
-        if (buf_size == 0)
-            return 0;
-        if ((state & LATM_SIZE_MASK) - s->count <= buf_size) {
-            pc->frame_start_found = 0;
-            pc->state             = -1;
-            return (state & LATM_SIZE_MASK) - s->count;
-        }
-    }
-
-    s->count             += buf_size;
-    pc->frame_start_found = pic_found;
-    pc->state             = state;
-
-    return END_NOT_FOUND;
-}
-
-static int latm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
-                      const uint8_t **poutbuf, int *poutbuf_size,
-                      const uint8_t *buf, int buf_size)
-{
-    LATMParseContext *s = s1->priv_data;
-    ParseContext *pc    = &s->pc;
-    int next;
-
-    if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) {
-        next = buf_size;
-    } else {
-        next = latm_find_frame_end(s1, buf, buf_size);
-
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf      = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-    }
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_aac_latm_parser = {
-    .codec_ids      = { AV_CODEC_ID_AAC_LATM },
-    .priv_data_size = sizeof(LATMParseContext),
-    .parser_parse   = latm_parse,
-    .parser_close   = ff_parse_close
-};
diff --git a/deps/libav/libavcodec/lcl.h b/deps/libav/libavcodec/lcl.h
deleted file mode 100644
index 4e7e170..0000000
--- a/deps/libav/libavcodec/lcl.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * LCL (LossLess Codec Library) Codec
- * Copyright (c) 2002-2004 Roberto Togni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_LCL_H
-#define AVCODEC_LCL_H
-
-#define BMPTYPE_YUV 1
-#define BMPTYPE_RGB 2
-
-#define IMGTYPE_YUV111 0
-#define IMGTYPE_YUV422 1
-#define IMGTYPE_RGB24 2
-#define IMGTYPE_YUV411 3
-#define IMGTYPE_YUV211 4
-#define IMGTYPE_YUV420 5
-
-#define COMP_MSZH 0
-#define COMP_MSZH_NOCOMP 1
-#define COMP_ZLIB_HISPEED 1
-#define COMP_ZLIB_HICOMP 9
-#define COMP_ZLIB_NORMAL -1
-
-#define FLAG_MULTITHREAD 1
-#define FLAG_NULLFRAME 2
-#define FLAG_PNGFILTER 4
-#define FLAGMASK_UNUSED 0xf8
-
-#define CODEC_MSZH 1
-#define CODEC_ZLIB 3
-
-#endif /* AVCODEC_LCL_H */
diff --git a/deps/libav/libavcodec/lcldec.c b/deps/libav/libavcodec/lcldec.c
deleted file mode 100644
index 4d97948..0000000
--- a/deps/libav/libavcodec/lcldec.c
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- * LCL (LossLess Codec Library) Codec
- * Copyright (c) 2002-2004 Roberto Togni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * LCL (LossLess Codec Library) Video Codec
- * Decoder for MSZH and ZLIB codecs
- * Experimental encoder for ZLIB RGB24
- *
- * Fourcc: MSZH, ZLIB
- *
- * Original Win32 dll:
- * Ver2.23 By Kenji Oshima 2000.09.20
- * avimszh.dll, avizlib.dll
- *
- * A description of the decoding algorithm can be found here:
- *   http://www.pcisys.net/~melanson/codecs
- *
- * Supports: BGR24 (RGB 24bpp)
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/mem.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "lcl.h"
-
-#if CONFIG_ZLIB_DECODER
-#include <zlib.h>
-#endif
-
-/*
- * Decoder context
- */
-typedef struct LclDecContext {
-    // Image type
-    int imgtype;
-    // Compression type
-    int compression;
-    // Flags
-    int flags;
-    // Decompressed data size
-    unsigned int decomp_size;
-    // Decompression buffer
-    unsigned char* decomp_buf;
-#if CONFIG_ZLIB_DECODER
-    z_stream zstream;
-#endif
-} LclDecContext;
-
-
-/**
- * @param srcptr compressed source buffer, must be padded with at least 5 extra bytes
- * @param destptr must be padded sufficiently for av_memcpy_backptr
- */
-static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsigned char * destptr, unsigned int destsize)
-{
-    unsigned char *destptr_bak = destptr;
-    unsigned char *destptr_end = destptr + destsize;
-    const unsigned char *srcptr_end = srcptr + srclen;
-    unsigned mask = *srcptr++;
-    unsigned maskbit = 0x80;
-
-    while (srcptr < srcptr_end && destptr < destptr_end) {
-        if (!(mask & maskbit)) {
-            memcpy(destptr, srcptr, 4);
-            destptr += 4;
-            srcptr += 4;
-        } else {
-            unsigned ofs = bytestream_get_le16(&srcptr);
-            unsigned cnt = (ofs >> 11) + 1;
-            ofs &= 0x7ff;
-            ofs = FFMIN(ofs, destptr - destptr_bak);
-            cnt *= 4;
-            cnt = FFMIN(cnt, destptr_end - destptr);
-            av_memcpy_backptr(destptr, ofs, cnt);
-            destptr += cnt;
-        }
-        maskbit >>= 1;
-        if (!maskbit) {
-            mask = *srcptr++;
-            while (!mask) {
-                if (destptr_end - destptr < 32 || srcptr_end - srcptr < 32) break;
-                memcpy(destptr, srcptr, 32);
-                destptr += 32;
-                srcptr += 32;
-                mask = *srcptr++;
-            }
-            maskbit = 0x80;
-        }
-    }
-
-    return destptr - destptr_bak;
-}
-
-
-#if CONFIG_ZLIB_DECODER
-/**
- * @brief decompress a zlib-compressed data block into decomp_buf
- * @param src compressed input buffer
- * @param src_len data length in input buffer
- * @param offset offset in decomp_buf
- * @param expected expected decompressed length
- */
-static int zlib_decomp(AVCodecContext *avctx, const uint8_t *src, int src_len, int offset, int expected)
-{
-    LclDecContext *c = avctx->priv_data;
-    int zret = inflateReset(&c->zstream);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
-        return AVERROR_UNKNOWN;
-    }
-    c->zstream.next_in = src;
-    c->zstream.avail_in = src_len;
-    c->zstream.next_out = c->decomp_buf + offset;
-    c->zstream.avail_out = c->decomp_size - offset;
-    zret = inflate(&c->zstream, Z_FINISH);
-    if (zret != Z_OK && zret != Z_STREAM_END) {
-        av_log(avctx, AV_LOG_ERROR, "Inflate error: %d\n", zret);
-        return AVERROR_UNKNOWN;
-    }
-    if (expected != (unsigned int)c->zstream.total_out) {
-        av_log(avctx, AV_LOG_ERROR, "Decoded size differs (%d != %lu)\n",
-               expected, c->zstream.total_out);
-        return AVERROR_UNKNOWN;
-    }
-    return c->zstream.total_out;
-}
-#endif
-
-
-/*
- *
- * Decode a frame
- *
- */
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    LclDecContext * const c = avctx->priv_data;
-    unsigned char *encoded = (unsigned char *)buf;
-    unsigned int pixel_ptr;
-    int row, col;
-    unsigned char *outptr;
-    uint8_t *y_out, *u_out, *v_out;
-    unsigned int width = avctx->width; // Real image width
-    unsigned int height = avctx->height; // Real image height
-    unsigned int mszh_dlen;
-    unsigned char yq, y1q, uq, vq;
-    int uqvq, ret;
-    unsigned int mthread_inlen, mthread_outlen;
-    unsigned int len = buf_size;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    outptr = frame->data[0]; // Output image pointer
-
-    /* Decompress frame */
-    switch (avctx->codec_id) {
-    case AV_CODEC_ID_MSZH:
-        switch (c->compression) {
-        case COMP_MSZH:
-            if (c->flags & FLAG_MULTITHREAD) {
-                mthread_inlen = AV_RL32(encoded);
-                mthread_inlen = FFMIN(mthread_inlen, len - 8);
-                mthread_outlen = AV_RL32(encoded+4);
-                mthread_outlen = FFMIN(mthread_outlen, c->decomp_size);
-                mszh_dlen = mszh_decomp(encoded + 8, mthread_inlen, c->decomp_buf, c->decomp_size);
-                if (mthread_outlen != mszh_dlen) {
-                    av_log(avctx, AV_LOG_ERROR, "Mthread1 decoded size differs (%d != %d)\n",
-                           mthread_outlen, mszh_dlen);
-                    return AVERROR_INVALIDDATA;
-                }
-                mszh_dlen = mszh_decomp(encoded + 8 + mthread_inlen, len - 8 - mthread_inlen,
-                                        c->decomp_buf + mthread_outlen, c->decomp_size - mthread_outlen);
-                if (mthread_outlen != mszh_dlen) {
-                    av_log(avctx, AV_LOG_ERROR, "Mthread2 decoded size differs (%d != %d)\n",
-                           mthread_outlen, mszh_dlen);
-                    return AVERROR_INVALIDDATA;
-                }
-                encoded = c->decomp_buf;
-                len = c->decomp_size;
-            } else {
-                mszh_dlen = mszh_decomp(encoded, len, c->decomp_buf, c->decomp_size);
-                if (c->decomp_size != mszh_dlen) {
-                    av_log(avctx, AV_LOG_ERROR, "Decoded size differs (%d != %d)\n",
-                           c->decomp_size, mszh_dlen);
-                    return AVERROR_INVALIDDATA;
-                }
-                encoded = c->decomp_buf;
-                len = mszh_dlen;
-            }
-            break;
-        case COMP_MSZH_NOCOMP: {
-            int bppx2;
-            switch (c->imgtype) {
-            case IMGTYPE_YUV111:
-            case IMGTYPE_RGB24:
-                bppx2 = 6;
-                break;
-            case IMGTYPE_YUV422:
-            case IMGTYPE_YUV211:
-                bppx2 = 4;
-                break;
-            case IMGTYPE_YUV411:
-            case IMGTYPE_YUV420:
-                bppx2 = 3;
-                break;
-            default:
-                bppx2 = 0; // will error out below
-                break;
-            }
-            if (len < ((width * height * bppx2) >> 1))
-                return AVERROR_INVALIDDATA;
-            break;
-        }
-        default:
-            av_log(avctx, AV_LOG_ERROR, "BUG! Unknown MSZH compression in frame decoder.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        break;
-#if CONFIG_ZLIB_DECODER
-    case AV_CODEC_ID_ZLIB:
-        /* Using the original dll with normal compression (-1) and RGB format
-         * gives a file with ZLIB fourcc, but frame is really uncompressed.
-         * To be sure that's true check also frame size */
-        if (c->compression == COMP_ZLIB_NORMAL && c->imgtype == IMGTYPE_RGB24 &&
-            len == width * height * 3) {
-            if (c->flags & FLAG_PNGFILTER) {
-                memcpy(c->decomp_buf, encoded, len);
-                encoded = c->decomp_buf;
-            } else {
-                break;
-            }
-        } else if (c->flags & FLAG_MULTITHREAD) {
-            mthread_inlen = AV_RL32(encoded);
-            mthread_inlen = FFMIN(mthread_inlen, len - 8);
-            mthread_outlen = AV_RL32(encoded+4);
-            mthread_outlen = FFMIN(mthread_outlen, c->decomp_size);
-            ret = zlib_decomp(avctx, encoded + 8, mthread_inlen, 0, mthread_outlen);
-            if (ret < 0) return ret;
-            ret = zlib_decomp(avctx, encoded + 8 + mthread_inlen, len - 8 - mthread_inlen,
-                              mthread_outlen, mthread_outlen);
-            if (ret < 0) return ret;
-        } else {
-            int ret = zlib_decomp(avctx, encoded, len, 0, c->decomp_size);
-            if (ret < 0) return ret;
-        }
-        encoded = c->decomp_buf;
-        len = c->decomp_size;
-        break;
-#endif
-    default:
-        av_log(avctx, AV_LOG_ERROR, "BUG! Unknown codec in frame decoder compression switch.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-
-    /* Apply PNG filter */
-    if (avctx->codec_id == AV_CODEC_ID_ZLIB && (c->flags & FLAG_PNGFILTER)) {
-        switch (c->imgtype) {
-        case IMGTYPE_YUV111:
-        case IMGTYPE_RGB24:
-            for (row = 0; row < height; row++) {
-                pixel_ptr = row * width * 3;
-                yq = encoded[pixel_ptr++];
-                uqvq = AV_RL16(encoded+pixel_ptr);
-                pixel_ptr += 2;
-                for (col = 1; col < width; col++) {
-                    encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
-                    uqvq -= AV_RL16(encoded+pixel_ptr+1);
-                    AV_WL16(encoded+pixel_ptr+1, uqvq);
-                    pixel_ptr += 3;
-                }
-            }
-            break;
-        case IMGTYPE_YUV422:
-            for (row = 0; row < height; row++) {
-                pixel_ptr = row * width * 2;
-                yq = uq = vq =0;
-                for (col = 0; col < width/4; col++) {
-                    encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
-                    encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
-                    encoded[pixel_ptr+2] = yq -= encoded[pixel_ptr+2];
-                    encoded[pixel_ptr+3] = yq -= encoded[pixel_ptr+3];
-                    encoded[pixel_ptr+4] = uq -= encoded[pixel_ptr+4];
-                    encoded[pixel_ptr+5] = uq -= encoded[pixel_ptr+5];
-                    encoded[pixel_ptr+6] = vq -= encoded[pixel_ptr+6];
-                    encoded[pixel_ptr+7] = vq -= encoded[pixel_ptr+7];
-                    pixel_ptr += 8;
-                }
-            }
-            break;
-        case IMGTYPE_YUV411:
-            for (row = 0; row < height; row++) {
-                pixel_ptr = row * width / 2 * 3;
-                yq = uq = vq =0;
-                for (col = 0; col < width/4; col++) {
-                    encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
-                    encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
-                    encoded[pixel_ptr+2] = yq -= encoded[pixel_ptr+2];
-                    encoded[pixel_ptr+3] = yq -= encoded[pixel_ptr+3];
-                    encoded[pixel_ptr+4] = uq -= encoded[pixel_ptr+4];
-                    encoded[pixel_ptr+5] = vq -= encoded[pixel_ptr+5];
-                    pixel_ptr += 6;
-                }
-            }
-            break;
-        case IMGTYPE_YUV211:
-            for (row = 0; row < height; row++) {
-                pixel_ptr = row * width * 2;
-                yq = uq = vq =0;
-                for (col = 0; col < width/2; col++) {
-                    encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
-                    encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
-                    encoded[pixel_ptr+2] = uq -= encoded[pixel_ptr+2];
-                    encoded[pixel_ptr+3] = vq -= encoded[pixel_ptr+3];
-                    pixel_ptr += 4;
-                }
-            }
-            break;
-        case IMGTYPE_YUV420:
-            for (row = 0; row < height/2; row++) {
-                pixel_ptr = row * width * 3;
-                yq = y1q = uq = vq =0;
-                for (col = 0; col < width/2; col++) {
-                    encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
-                    encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
-                    encoded[pixel_ptr+2] = y1q -= encoded[pixel_ptr+2];
-                    encoded[pixel_ptr+3] = y1q -= encoded[pixel_ptr+3];
-                    encoded[pixel_ptr+4] = uq -= encoded[pixel_ptr+4];
-                    encoded[pixel_ptr+5] = vq -= encoded[pixel_ptr+5];
-                    pixel_ptr += 6;
-                }
-            }
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "BUG! Unknown imagetype in pngfilter switch.\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    /* Convert colorspace */
-    y_out = frame->data[0] + (height - 1) * frame->linesize[0];
-    u_out = frame->data[1] + (height - 1) * frame->linesize[1];
-    v_out = frame->data[2] + (height - 1) * frame->linesize[2];
-    switch (c->imgtype) {
-    case IMGTYPE_YUV111:
-        for (row = 0; row < height; row++) {
-            for (col = 0; col < width; col++) {
-                y_out[col] = *encoded++;
-                u_out[col] = *encoded++ + 128;
-                v_out[col] = *encoded++ + 128;
-            }
-            y_out -= frame->linesize[0];
-            u_out -= frame->linesize[1];
-            v_out -= frame->linesize[2];
-        }
-        break;
-    case IMGTYPE_YUV422:
-        for (row = 0; row < height; row++) {
-            for (col = 0; col < width - 3; col += 4) {
-                memcpy(y_out + col, encoded, 4);
-                encoded += 4;
-                u_out[ col >> 1     ] = *encoded++ + 128;
-                u_out[(col >> 1) + 1] = *encoded++ + 128;
-                v_out[ col >> 1     ] = *encoded++ + 128;
-                v_out[(col >> 1) + 1] = *encoded++ + 128;
-            }
-            y_out -= frame->linesize[0];
-            u_out -= frame->linesize[1];
-            v_out -= frame->linesize[2];
-        }
-        break;
-    case IMGTYPE_RGB24:
-        for (row = height - 1; row >= 0; row--) {
-            pixel_ptr = row * frame->linesize[0];
-            memcpy(outptr + pixel_ptr, encoded, 3 * width);
-            encoded += 3 * width;
-        }
-        break;
-    case IMGTYPE_YUV411:
-        for (row = 0; row < height; row++) {
-            for (col = 0; col < width - 3; col += 4) {
-                memcpy(y_out + col, encoded, 4);
-                encoded += 4;
-                u_out[col >> 2] = *encoded++ + 128;
-                v_out[col >> 2] = *encoded++ + 128;
-            }
-            y_out -= frame->linesize[0];
-            u_out -= frame->linesize[1];
-            v_out -= frame->linesize[2];
-        }
-        break;
-    case IMGTYPE_YUV211:
-        for (row = 0; row < height; row++) {
-            for (col = 0; col < width - 1; col += 2) {
-                memcpy(y_out + col, encoded, 2);
-                encoded += 2;
-                u_out[col >> 1] = *encoded++ + 128;
-                v_out[col >> 1] = *encoded++ + 128;
-            }
-            y_out -= frame->linesize[0];
-            u_out -= frame->linesize[1];
-            v_out -= frame->linesize[2];
-        }
-        break;
-    case IMGTYPE_YUV420:
-        u_out = frame->data[1] + ((height >> 1) - 1) * frame->linesize[1];
-        v_out = frame->data[2] + ((height >> 1) - 1) * frame->linesize[2];
-        for (row = 0; row < height - 1; row += 2) {
-            for (col = 0; col < width - 1; col += 2) {
-                memcpy(y_out + col, encoded, 2);
-                encoded += 2;
-                memcpy(y_out + col - frame->linesize[0], encoded, 2);
-                encoded += 2;
-                u_out[col >> 1] = *encoded++ + 128;
-                v_out[col >> 1] = *encoded++ + 128;
-            }
-            y_out -= frame->linesize[0] << 1;
-            u_out -= frame->linesize[1];
-            v_out -= frame->linesize[2];
-        }
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "BUG! Unknown imagetype in image decoder.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-/*
- *
- * Init lcl decoder
- *
- */
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    LclDecContext * const c = avctx->priv_data;
-    unsigned int basesize = avctx->width * avctx->height;
-    unsigned int max_basesize = FFALIGN(avctx->width,  4) *
-                                FFALIGN(avctx->height, 4);
-    unsigned int max_decomp_size;
-
-    if (avctx->extradata_size < 8) {
-        av_log(avctx, AV_LOG_ERROR, "Extradata size too small.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Check codec type */
-    if ((avctx->codec_id == AV_CODEC_ID_MSZH  && avctx->extradata[7] != CODEC_MSZH) ||
-        (avctx->codec_id == AV_CODEC_ID_ZLIB  && avctx->extradata[7] != CODEC_ZLIB)) {
-        av_log(avctx, AV_LOG_ERROR, "Codec id and codec type mismatch. This should not happen.\n");
-    }
-
-    /* Detect image type */
-    switch (c->imgtype = avctx->extradata[4]) {
-    case IMGTYPE_YUV111:
-        c->decomp_size = basesize * 3;
-        max_decomp_size = max_basesize * 3;
-        avctx->pix_fmt = AV_PIX_FMT_YUV444P;
-        av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 1:1:1.\n");
-        break;
-    case IMGTYPE_YUV422:
-        c->decomp_size = basesize * 2;
-        max_decomp_size = max_basesize * 2;
-        avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-        av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:2.\n");
-        break;
-    case IMGTYPE_RGB24:
-        c->decomp_size = basesize * 3;
-        max_decomp_size = max_basesize * 3;
-        avctx->pix_fmt = AV_PIX_FMT_BGR24;
-        av_log(avctx, AV_LOG_DEBUG, "Image type is RGB 24.\n");
-        break;
-    case IMGTYPE_YUV411:
-        c->decomp_size = basesize / 2 * 3;
-        max_decomp_size = max_basesize / 2 * 3;
-        avctx->pix_fmt = AV_PIX_FMT_YUV411P;
-        av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:1:1.\n");
-        break;
-    case IMGTYPE_YUV211:
-        c->decomp_size = basesize * 2;
-        max_decomp_size = max_basesize * 2;
-        avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-        av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 2:1:1.\n");
-        break;
-    case IMGTYPE_YUV420:
-        c->decomp_size = basesize / 2 * 3;
-        max_decomp_size = max_basesize / 2 * 3;
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-        av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:0.\n");
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unsupported image format %d.\n", c->imgtype);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Detect compression method */
-    c->compression = (int8_t)avctx->extradata[5];
-    switch (avctx->codec_id) {
-    case AV_CODEC_ID_MSZH:
-        switch (c->compression) {
-        case COMP_MSZH:
-            av_log(avctx, AV_LOG_DEBUG, "Compression enabled.\n");
-            break;
-        case COMP_MSZH_NOCOMP:
-            c->decomp_size = 0;
-            av_log(avctx, AV_LOG_DEBUG, "No compression.\n");
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unsupported compression format for MSZH (%d).\n", c->compression);
-            return AVERROR_INVALIDDATA;
-        }
-        break;
-#if CONFIG_ZLIB_DECODER
-    case AV_CODEC_ID_ZLIB:
-        switch (c->compression) {
-        case COMP_ZLIB_HISPEED:
-            av_log(avctx, AV_LOG_DEBUG, "High speed compression.\n");
-            break;
-        case COMP_ZLIB_HICOMP:
-            av_log(avctx, AV_LOG_DEBUG, "High compression.\n");
-            break;
-        case COMP_ZLIB_NORMAL:
-            av_log(avctx, AV_LOG_DEBUG, "Normal compression.\n");
-            break;
-        default:
-            if (c->compression < Z_NO_COMPRESSION || c->compression > Z_BEST_COMPRESSION) {
-                av_log(avctx, AV_LOG_ERROR, "Unsupported compression level for ZLIB: (%d).\n", c->compression);
-                return AVERROR_INVALIDDATA;
-            }
-            av_log(avctx, AV_LOG_DEBUG, "Compression level for ZLIB: (%d).\n", c->compression);
-        }
-        break;
-#endif
-    default:
-        av_log(avctx, AV_LOG_ERROR, "BUG! Unknown codec in compression switch.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Allocate decompression buffer */
-    if (c->decomp_size) {
-        if ((c->decomp_buf = av_malloc(max_decomp_size)) == NULL) {
-            av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    /* Detect flags */
-    c->flags = avctx->extradata[6];
-    if (c->flags & FLAG_MULTITHREAD)
-        av_log(avctx, AV_LOG_DEBUG, "Multithread encoder flag set.\n");
-    if (c->flags & FLAG_NULLFRAME)
-        av_log(avctx, AV_LOG_DEBUG, "Nullframe insertion flag set.\n");
-    if (avctx->codec_id == AV_CODEC_ID_ZLIB && (c->flags & FLAG_PNGFILTER))
-        av_log(avctx, AV_LOG_DEBUG, "PNG filter flag set.\n");
-    if (c->flags & FLAGMASK_UNUSED)
-        av_log(avctx, AV_LOG_ERROR, "Unknown flag set (%d).\n", c->flags);
-
-    /* If needed init zlib */
-#if CONFIG_ZLIB_DECODER
-    if (avctx->codec_id == AV_CODEC_ID_ZLIB) {
-        int zret;
-        c->zstream.zalloc = Z_NULL;
-        c->zstream.zfree = Z_NULL;
-        c->zstream.opaque = Z_NULL;
-        zret = inflateInit(&c->zstream);
-        if (zret != Z_OK) {
-            av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
-            av_freep(&c->decomp_buf);
-            return AVERROR_UNKNOWN;
-        }
-    }
-#endif
-
-    return 0;
-}
-
-/*
- *
- * Uninit lcl decoder
- *
- */
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    LclDecContext * const c = avctx->priv_data;
-
-    av_freep(&c->decomp_buf);
-#if CONFIG_ZLIB_DECODER
-    if (avctx->codec_id == AV_CODEC_ID_ZLIB)
-        inflateEnd(&c->zstream);
-#endif
-
-    return 0;
-}
-
-#if CONFIG_MSZH_DECODER
-AVCodec ff_mszh_decoder = {
-    .name           = "mszh",
-    .long_name      = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) MSZH"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSZH,
-    .priv_data_size = sizeof(LclDecContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
-
-#if CONFIG_ZLIB_DECODER
-AVCodec ff_zlib_decoder = {
-    .name           = "zlib",
-    .long_name      = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ZLIB,
-    .priv_data_size = sizeof(LclDecContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
diff --git a/deps/libav/libavcodec/lclenc.c b/deps/libav/libavcodec/lclenc.c
deleted file mode 100644
index 878d1e1..0000000
--- a/deps/libav/libavcodec/lclenc.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * LCL (LossLess Codec Library) Codec
- * Copyright (c) 2002-2004 Roberto Togni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * LCL (LossLess Codec Library) Video Codec
- * Decoder for MSZH and ZLIB codecs
- * Experimental encoder for ZLIB RGB24
- *
- * Fourcc: MSZH, ZLIB
- *
- * Original Win32 dll:
- * Ver2.23 By Kenji Oshima 2000.09.20
- * avimszh.dll, avizlib.dll
- *
- * A description of the decoding algorithm can be found here:
- *   http://www.pcisys.net/~melanson/codecs
- *
- * Supports: BGR24 (RGB 24bpp)
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "avcodec.h"
-#include "lcl.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-
-#include <zlib.h>
-
-/*
- * Decoder context
- */
-typedef struct LclEncContext {
-
-    AVCodecContext *avctx;
-
-    // Image type
-    int imgtype;
-    // Compression type
-    int compression;
-    // Flags
-    int flags;
-    z_stream zstream;
-} LclEncContext;
-
-/*
- *
- * Encode a frame
- *
- */
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *pict, int *got_packet)
-{
-    LclEncContext *c = avctx->priv_data;
-    const AVFrame * const p = pict;
-    int i, ret;
-    int zret; // Zlib return code
-    int max_size = deflateBound(&c->zstream, avctx->width * avctx->height * 3);
-
-    if (!pkt->data &&
-        (ret = av_new_packet(pkt, max_size)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Error allocating packet of size %d.\n", max_size);
-            return ret;
-    }
-
-    if(avctx->pix_fmt != AV_PIX_FMT_BGR24){
-        av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
-        return -1;
-    }
-
-    zret = deflateReset(&c->zstream);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Deflate reset error: %d\n", zret);
-        return -1;
-    }
-    c->zstream.next_out  = pkt->data;
-    c->zstream.avail_out = pkt->size;
-
-    for(i = avctx->height - 1; i >= 0; i--) {
-        c->zstream.next_in = p->data[0]+p->linesize[0]*i;
-        c->zstream.avail_in = avctx->width*3;
-        zret = deflate(&c->zstream, Z_NO_FLUSH);
-        if (zret != Z_OK) {
-            av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret);
-            return -1;
-        }
-    }
-    zret = deflate(&c->zstream, Z_FINISH);
-    if (zret != Z_STREAM_END) {
-        av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret);
-        return -1;
-    }
-
-    pkt->size   = c->zstream.total_out;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-/*
- *
- * Init lcl encoder
- *
- */
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    LclEncContext *c = avctx->priv_data;
-    int zret; // Zlib return code
-
-    c->avctx= avctx;
-
-    assert(avctx->width && avctx->height);
-
-    avctx->extradata= av_mallocz(8);
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    // Will be user settable someday
-    c->compression = 6;
-    c->flags = 0;
-    c->imgtype = IMGTYPE_RGB24;
-    avctx->bits_per_coded_sample= 24;
-
-    avctx->extradata[0]= 4;
-    avctx->extradata[1]= 0;
-    avctx->extradata[2]= 0;
-    avctx->extradata[3]= 0;
-    avctx->extradata[4]= c->imgtype;
-    avctx->extradata[5]= c->compression;
-    avctx->extradata[6]= c->flags;
-    avctx->extradata[7]= CODEC_ZLIB;
-    c->avctx->extradata_size= 8;
-
-    c->zstream.zalloc = Z_NULL;
-    c->zstream.zfree = Z_NULL;
-    c->zstream.opaque = Z_NULL;
-    zret = deflateInit(&c->zstream, c->compression);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Deflate init error: %d\n", zret);
-        return 1;
-    }
-
-    return 0;
-}
-
-/*
- *
- * Uninit lcl encoder
- *
- */
-static av_cold int encode_end(AVCodecContext *avctx)
-{
-    LclEncContext *c = avctx->priv_data;
-
-    av_freep(&avctx->extradata);
-    deflateEnd(&c->zstream);
-
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-AVCodec ff_zlib_encoder = {
-    .name           = "zlib",
-    .long_name      = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ZLIB,
-    .priv_data_size = sizeof(LclEncContext),
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/libavcodec.v b/deps/libav/libavcodec/libavcodec.v
deleted file mode 100644
index bf14807..0000000
--- a/deps/libav/libavcodec/libavcodec.v
+++ /dev/null
@@ -1,4 +0,0 @@
-LIBAVCODEC_$MAJOR {
-        global: av*;
-        local:  *;
-};
diff --git a/deps/libav/libavcodec/libfaac.c b/deps/libav/libavcodec/libfaac.c
deleted file mode 100644
index 9b5b11a..0000000
--- a/deps/libav/libavcodec/libfaac.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Interface to libfaac for aac encoding
- * Copyright (c) 2002 Gildas Bazin <gbazin at netcourrier.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Interface to libfaac for aac encoding.
- */
-
-#include <faac.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "audio_frame_queue.h"
-#include "internal.h"
-
-
-/* libfaac has an encoder delay of 1024 samples */
-#define FAAC_DELAY_SAMPLES 1024
-
-typedef struct FaacAudioContext {
-    faacEncHandle faac_handle;
-    AudioFrameQueue afq;
-} FaacAudioContext;
-
-
-static av_cold int Faac_encode_close(AVCodecContext *avctx)
-{
-    FaacAudioContext *s = avctx->priv_data;
-
-    av_freep(&avctx->extradata);
-    ff_af_queue_close(&s->afq);
-
-    if (s->faac_handle)
-        faacEncClose(s->faac_handle);
-
-    return 0;
-}
-
-static const int channel_maps[][6] = {
-    { 2, 0, 1 },          //< C L R
-    { 2, 0, 1, 3 },       //< C L R Cs
-    { 2, 0, 1, 3, 4 },    //< C L R Ls Rs
-    { 2, 0, 1, 4, 5, 3 }, //< C L R Ls Rs LFE
-};
-
-static av_cold int Faac_encode_init(AVCodecContext *avctx)
-{
-    FaacAudioContext *s = avctx->priv_data;
-    faacEncConfigurationPtr faac_cfg;
-    unsigned long samples_input, max_bytes_output;
-    int ret;
-
-    /* number of channels */
-    if (avctx->channels < 1 || avctx->channels > 6) {
-        av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed\n", avctx->channels);
-        ret = AVERROR(EINVAL);
-        goto error;
-    }
-
-    s->faac_handle = faacEncOpen(avctx->sample_rate,
-                                 avctx->channels,
-                                 &samples_input, &max_bytes_output);
-    if (!s->faac_handle) {
-        av_log(avctx, AV_LOG_ERROR, "error in faacEncOpen()\n");
-        ret = AVERROR_UNKNOWN;
-        goto error;
-    }
-
-    /* check faac version */
-    faac_cfg = faacEncGetCurrentConfiguration(s->faac_handle);
-    if (faac_cfg->version != FAAC_CFG_VERSION) {
-        av_log(avctx, AV_LOG_ERROR, "wrong libfaac version (compiled for: %d, using %d)\n", FAAC_CFG_VERSION, faac_cfg->version);
-        ret = AVERROR(EINVAL);
-        goto error;
-    }
-
-    /* put the options in the configuration struct */
-    switch(avctx->profile) {
-        case FF_PROFILE_AAC_MAIN:
-            faac_cfg->aacObjectType = MAIN;
-            break;
-        case FF_PROFILE_UNKNOWN:
-        case FF_PROFILE_AAC_LOW:
-            faac_cfg->aacObjectType = LOW;
-            break;
-        case FF_PROFILE_AAC_SSR:
-            faac_cfg->aacObjectType = SSR;
-            break;
-        case FF_PROFILE_AAC_LTP:
-            faac_cfg->aacObjectType = LTP;
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "invalid AAC profile\n");
-            ret = AVERROR(EINVAL);
-            goto error;
-    }
-    faac_cfg->mpegVersion = MPEG4;
-    faac_cfg->useTns = 0;
-    faac_cfg->allowMidside = 1;
-    faac_cfg->bitRate = avctx->bit_rate / avctx->channels;
-    faac_cfg->bandWidth = avctx->cutoff;
-    if(avctx->flags & CODEC_FLAG_QSCALE) {
-        faac_cfg->bitRate = 0;
-        faac_cfg->quantqual = avctx->global_quality / FF_QP2LAMBDA;
-    }
-    faac_cfg->outputFormat = 1;
-    faac_cfg->inputFormat = FAAC_INPUT_16BIT;
-    if (avctx->channels > 2)
-        memcpy(faac_cfg->channel_map, channel_maps[avctx->channels-3],
-               avctx->channels * sizeof(int));
-
-    avctx->frame_size = samples_input / avctx->channels;
-
-    /* Set decoder specific info */
-    avctx->extradata_size = 0;
-    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
-
-        unsigned char *buffer = NULL;
-        unsigned long decoder_specific_info_size;
-
-        if (!faacEncGetDecoderSpecificInfo(s->faac_handle, &buffer,
-                                           &decoder_specific_info_size)) {
-            avctx->extradata = av_malloc(decoder_specific_info_size + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!avctx->extradata) {
-                ret = AVERROR(ENOMEM);
-                goto error;
-            }
-            avctx->extradata_size = decoder_specific_info_size;
-            memcpy(avctx->extradata, buffer, avctx->extradata_size);
-            faac_cfg->outputFormat = 0;
-        }
-        free(buffer);
-    }
-
-    if (!faacEncSetConfiguration(s->faac_handle, faac_cfg)) {
-        av_log(avctx, AV_LOG_ERROR, "libfaac doesn't support this output format!\n");
-        ret = AVERROR(EINVAL);
-        goto error;
-    }
-
-    avctx->delay = FAAC_DELAY_SAMPLES;
-    ff_af_queue_init(avctx, &s->afq);
-
-    return 0;
-error:
-    Faac_encode_close(avctx);
-    return ret;
-}
-
-static int Faac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                             const AVFrame *frame, int *got_packet_ptr)
-{
-    FaacAudioContext *s = avctx->priv_data;
-    int bytes_written, ret;
-    int num_samples  = frame ? frame->nb_samples : 0;
-    void *samples    = frame ? frame->data[0]    : NULL;
-
-    if ((ret = ff_alloc_packet(avpkt, (7 + 768) * avctx->channels))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    bytes_written = faacEncEncode(s->faac_handle, samples,
-                                  num_samples * avctx->channels,
-                                  avpkt->data, avpkt->size);
-    if (bytes_written < 0) {
-        av_log(avctx, AV_LOG_ERROR, "faacEncEncode() error\n");
-        return bytes_written;
-    }
-
-    /* add current frame to the queue */
-    if (frame) {
-        if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
-            return ret;
-    }
-
-    if (!bytes_written)
-        return 0;
-
-    /* Get the next frame pts/duration */
-    ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
-                       &avpkt->duration);
-
-    avpkt->size = bytes_written;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-static const AVProfile profiles[] = {
-    { FF_PROFILE_AAC_MAIN, "Main" },
-    { FF_PROFILE_AAC_LOW,  "LC"   },
-    { FF_PROFILE_AAC_SSR,  "SSR"  },
-    { FF_PROFILE_AAC_LTP,  "LTP"  },
-    { FF_PROFILE_UNKNOWN },
-};
-
-static const uint64_t faac_channel_layouts[] = {
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_5POINT0_BACK,
-    AV_CH_LAYOUT_5POINT1_BACK,
-    0
-};
-
-AVCodec ff_libfaac_encoder = {
-    .name           = "libfaac",
-    .long_name      = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Coding)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AAC,
-    .priv_data_size = sizeof(FaacAudioContext),
-    .init           = Faac_encode_init,
-    .encode2        = Faac_encode_frame,
-    .close          = Faac_encode_close,
-    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-    .profiles       = NULL_IF_CONFIG_SMALL(profiles),
-    .channel_layouts = faac_channel_layouts,
-};
diff --git a/deps/libav/libavcodec/libfdk-aacdec.c b/deps/libav/libavcodec/libfdk-aacdec.c
deleted file mode 100644
index e459733..0000000
--- a/deps/libav/libavcodec/libfdk-aacdec.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * AAC decoder wrapper
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <fdk-aac/aacdecoder_lib.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "internal.h"
-
-enum ConcealMethod {
-    CONCEAL_METHOD_DEFAULT              = -1,
-    CONCEAL_METHOD_SPECTRAL_MUTING      =  0,
-    CONCEAL_METHOD_NOISE_SUBSTITUTION   =  1,
-    CONCEAL_METHOD_ENERGY_INTERPOLATION =  2,
-    CONCEAL_METHOD_NB,
-};
-
-typedef struct FDKAACDecContext {
-    const AVClass *class;
-    HANDLE_AACDECODER handle;
-    int initialized;
-    enum ConcealMethod conceal_method;
-} FDKAACDecContext;
-
-#define OFFSET(x) offsetof(FDKAACDecContext, x)
-#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
-static const AVOption fdk_aac_dec_options[] = {
-    { "conceal", "Error concealment method", OFFSET(conceal_method), AV_OPT_TYPE_INT, { .i64 = CONCEAL_METHOD_DEFAULT }, CONCEAL_METHOD_DEFAULT, CONCEAL_METHOD_NB - 1, AD, "conceal" },
-    { "default",  "Default",              0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_DEFAULT },              INT_MIN, INT_MAX, AD, "conceal" },
-    { "spectral", "Spectral muting",      0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_SPECTRAL_MUTING },      INT_MIN, INT_MAX, AD, "conceal" },
-    { "noise",    "Noise Substitution",   0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION },   INT_MIN, INT_MAX, AD, "conceal" },
-    { "energy",   "Energy Interpolation", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_ENERGY_INTERPOLATION }, INT_MIN, INT_MAX, AD, "conceal" },
-    { NULL }
-};
-
-static const AVClass fdk_aac_dec_class = {
-    "libfdk-aac decoder", av_default_item_name, fdk_aac_dec_options, LIBAVUTIL_VERSION_INT
-};
-
-static int get_stream_info(AVCodecContext *avctx)
-{
-    FDKAACDecContext *s   = avctx->priv_data;
-    CStreamInfo *info     = aacDecoder_GetStreamInfo(s->handle);
-    int channel_counts[9] = { 0 };
-    int i, ch_error       = 0;
-    uint64_t ch_layout    = 0;
-
-    if (!info) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to get stream info\n");
-        return AVERROR_UNKNOWN;
-    }
-
-    if (info->sampleRate <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "Stream info not initialized\n");
-        return AVERROR_UNKNOWN;
-    }
-    avctx->sample_rate = info->sampleRate;
-    avctx->frame_size  = info->frameSize;
-
-    for (i = 0; i < info->numChannels; i++) {
-        AUDIO_CHANNEL_TYPE ctype = info->pChannelType[i];
-        if (ctype <= ACT_NONE || ctype > ACT_TOP) {
-            av_log(avctx, AV_LOG_WARNING, "unknown channel type\n");
-            break;
-        }
-        channel_counts[ctype]++;
-    }
-    av_log(avctx, AV_LOG_DEBUG,
-           "%d channels - front:%d side:%d back:%d lfe:%d top:%d\n",
-           info->numChannels,
-           channel_counts[ACT_FRONT], channel_counts[ACT_SIDE],
-           channel_counts[ACT_BACK],  channel_counts[ACT_LFE],
-           channel_counts[ACT_FRONT_TOP] + channel_counts[ACT_SIDE_TOP] +
-           channel_counts[ACT_BACK_TOP]  + channel_counts[ACT_TOP]);
-
-    switch (channel_counts[ACT_FRONT]) {
-    case 4:
-        ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_LEFT_OF_CENTER |
-                     AV_CH_FRONT_RIGHT_OF_CENTER;
-        break;
-    case 3:
-        ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER;
-        break;
-    case 2:
-        ch_layout |= AV_CH_LAYOUT_STEREO;
-        break;
-    case 1:
-        ch_layout |= AV_CH_FRONT_CENTER;
-        break;
-    default:
-        av_log(avctx, AV_LOG_WARNING,
-               "unsupported number of front channels: %d\n",
-               channel_counts[ACT_FRONT]);
-        ch_error = 1;
-        break;
-    }
-    if (channel_counts[ACT_SIDE] > 0) {
-        if (channel_counts[ACT_SIDE] == 2) {
-            ch_layout |= AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT;
-        } else {
-            av_log(avctx, AV_LOG_WARNING,
-                   "unsupported number of side channels: %d\n",
-                   channel_counts[ACT_SIDE]);
-            ch_error = 1;
-        }
-    }
-    if (channel_counts[ACT_BACK] > 0) {
-        switch (channel_counts[ACT_BACK]) {
-        case 3:
-            ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_BACK_CENTER;
-            break;
-        case 2:
-            ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT;
-            break;
-        case 1:
-            ch_layout |= AV_CH_BACK_CENTER;
-            break;
-        default:
-            av_log(avctx, AV_LOG_WARNING,
-                   "unsupported number of back channels: %d\n",
-                   channel_counts[ACT_BACK]);
-            ch_error = 1;
-            break;
-        }
-    }
-    if (channel_counts[ACT_LFE] > 0) {
-        if (channel_counts[ACT_LFE] == 1) {
-            ch_layout |= AV_CH_LOW_FREQUENCY;
-        } else {
-            av_log(avctx, AV_LOG_WARNING,
-                   "unsupported number of LFE channels: %d\n",
-                   channel_counts[ACT_LFE]);
-            ch_error = 1;
-        }
-    }
-    if (!ch_error &&
-        av_get_channel_layout_nb_channels(ch_layout) != info->numChannels) {
-        av_log(avctx, AV_LOG_WARNING, "unsupported channel configuration\n");
-        ch_error = 1;
-    }
-    if (ch_error)
-        avctx->channel_layout = 0;
-    else
-        avctx->channel_layout = ch_layout;
-
-    avctx->channels = info->numChannels;
-
-    return 0;
-}
-
-static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
-{
-    FDKAACDecContext *s = avctx->priv_data;
-
-    if (s->handle)
-        aacDecoder_Close(s->handle);
-
-    return 0;
-}
-
-static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
-{
-    FDKAACDecContext *s = avctx->priv_data;
-    AAC_DECODER_ERROR err;
-
-    s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
-    if (!s->handle) {
-        av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
-        return AVERROR_UNKNOWN;
-    }
-
-    if (avctx->extradata_size) {
-        if ((err = aacDecoder_ConfigRaw(s->handle, &avctx->extradata,
-                                        &avctx->extradata_size)) != AAC_DEC_OK) {
-            av_log(avctx, AV_LOG_ERROR, "Unable to set extradata\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    if (s->conceal_method != CONCEAL_METHOD_DEFAULT) {
-        if ((err = aacDecoder_SetParam(s->handle, AAC_CONCEAL_METHOD,
-                                       s->conceal_method)) != AAC_DEC_OK) {
-            av_log(avctx, AV_LOG_ERROR, "Unable to set error concealment method\n");
-            return AVERROR_UNKNOWN;
-        }
-    }
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-
-    return 0;
-}
-
-static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data,
-                                int *got_frame_ptr, AVPacket *avpkt)
-{
-    FDKAACDecContext *s = avctx->priv_data;
-    AVFrame *frame = data;
-    int ret;
-    AAC_DECODER_ERROR err;
-    UINT valid = avpkt->size;
-    uint8_t *buf, *tmpptr = NULL;
-    int buf_size;
-
-    err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid);
-    if (err != AAC_DEC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->initialized) {
-        frame->nb_samples = avctx->frame_size;
-        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "ff_get_buffer() failed\n");
-            return ret;
-        }
-        buf = frame->extended_data[0];
-        buf_size = avctx->channels * frame->nb_samples *
-                   av_get_bytes_per_sample(avctx->sample_fmt);
-    } else {
-        buf_size = 50 * 1024;
-        buf = tmpptr = av_malloc(buf_size);
-        if (!buf)
-            return AVERROR(ENOMEM);
-    }
-
-    err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) buf, buf_size, 0);
-    if (err == AAC_DEC_NOT_ENOUGH_BITS) {
-        ret = avpkt->size - valid;
-        goto end;
-    }
-    if (err != AAC_DEC_OK) {
-        av_log(avctx, AV_LOG_ERROR,
-               "aacDecoder_DecodeFrame() failed: %x\n", err);
-        ret = AVERROR_UNKNOWN;
-        goto end;
-    }
-
-    if (!s->initialized) {
-        if ((ret = get_stream_info(avctx)) < 0)
-            goto end;
-        s->initialized = 1;
-        frame->nb_samples = avctx->frame_size;
-    }
-
-    if (tmpptr) {
-        frame->nb_samples = avctx->frame_size;
-        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "ff_get_buffer() failed\n");
-            goto end;
-        }
-        memcpy(frame->extended_data[0], tmpptr,
-               avctx->channels * avctx->frame_size *
-               av_get_bytes_per_sample(avctx->sample_fmt));
-    }
-
-    *got_frame_ptr = 1;
-    ret = avpkt->size - valid;
-
-end:
-    av_free(tmpptr);
-    return ret;
-}
-
-static av_cold void fdk_aac_decode_flush(AVCodecContext *avctx)
-{
-    FDKAACDecContext *s = avctx->priv_data;
-    AAC_DECODER_ERROR err;
-
-    if (!s->handle)
-        return;
-
-    if ((err = aacDecoder_SetParam(s->handle,
-                                   AAC_TPDEC_CLEAR_BUFFER, 1)) != AAC_DEC_OK)
-        av_log(avctx, AV_LOG_WARNING, "failed to clear buffer when flushing\n");
-}
-
-AVCodec ff_libfdk_aac_decoder = {
-    .name           = "libfdk_aac",
-    .long_name      = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AAC,
-    .priv_data_size = sizeof(FDKAACDecContext),
-    .init           = fdk_aac_decode_init,
-    .decode         = fdk_aac_decode_frame,
-    .close          = fdk_aac_decode_close,
-    .flush          = fdk_aac_decode_flush,
-    .capabilities   = CODEC_CAP_DR1,
-    .priv_class     = &fdk_aac_dec_class,
-};
diff --git a/deps/libav/libavcodec/libfdk-aacenc.c b/deps/libav/libavcodec/libfdk-aacenc.c
deleted file mode 100644
index 4827169..0000000
--- a/deps/libav/libavcodec/libfdk-aacenc.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * AAC encoder wrapper
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <fdk-aac/aacenc_lib.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "audio_frame_queue.h"
-#include "internal.h"
-
-typedef struct AACContext {
-    const AVClass *class;
-    HANDLE_AACENCODER handle;
-    int afterburner;
-    int eld_sbr;
-    int signaling;
-    int latm;
-    int header_period;
-    int vbr;
-
-    AudioFrameQueue afq;
-} AACContext;
-
-static const AVOption aac_enc_options[] = {
-    { "afterburner", "Afterburner (improved quality)", offsetof(AACContext, afterburner), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
-    { "eld_sbr", "Enable SBR for ELD (for SBR in other configurations, use the -profile parameter)", offsetof(AACContext, eld_sbr), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
-    { "signaling", "SBR/PS signaling style", offsetof(AACContext, signaling), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 2, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
-    { "default", "Choose signaling implicitly (explicit hierarchical by default, implicit if global header is disabled)", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
-    { "implicit", "Implicit backwards compatible signaling", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
-    { "explicit_sbr", "Explicit SBR, implicit PS signaling", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
-    { "explicit_hierarchical", "Explicit hierarchical signaling", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
-    { "latm", "Output LATM/LOAS encapsulated data", offsetof(AACContext, latm), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
-    { "header_period", "StreamMuxConfig and PCE repetition period (in frames)", offsetof(AACContext, header_period), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 0xffff, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
-    { "vbr", "VBR mode (1-5)", offsetof(AACContext, vbr), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 5, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
-    { NULL }
-};
-
-static const AVClass aac_enc_class = {
-    "libfdk_aac", av_default_item_name, aac_enc_options, LIBAVUTIL_VERSION_INT
-};
-
-static const char *aac_get_error(AACENC_ERROR err)
-{
-    switch (err) {
-    case AACENC_OK:
-        return "No error";
-    case AACENC_INVALID_HANDLE:
-        return "Invalid handle";
-    case AACENC_MEMORY_ERROR:
-        return "Memory allocation error";
-    case AACENC_UNSUPPORTED_PARAMETER:
-        return "Unsupported parameter";
-    case AACENC_INVALID_CONFIG:
-        return "Invalid config";
-    case AACENC_INIT_ERROR:
-        return "Initialization error";
-    case AACENC_INIT_AAC_ERROR:
-        return "AAC library initialization error";
-    case AACENC_INIT_SBR_ERROR:
-        return "SBR library initialization error";
-    case AACENC_INIT_TP_ERROR:
-        return "Transport library initialization error";
-    case AACENC_INIT_META_ERROR:
-        return "Metadata library initialization error";
-    case AACENC_ENCODE_ERROR:
-        return "Encoding error";
-    case AACENC_ENCODE_EOF:
-        return "End of file";
-    default:
-        return "Unknown error";
-    }
-}
-
-static int aac_encode_close(AVCodecContext *avctx)
-{
-    AACContext *s = avctx->priv_data;
-
-    if (s->handle)
-        aacEncClose(&s->handle);
-    av_freep(&avctx->extradata);
-    ff_af_queue_close(&s->afq);
-
-    return 0;
-}
-
-static av_cold int aac_encode_init(AVCodecContext *avctx)
-{
-    AACContext *s = avctx->priv_data;
-    int ret = AVERROR(EINVAL);
-    AACENC_InfoStruct info = { 0 };
-    CHANNEL_MODE mode;
-    AACENC_ERROR err;
-    int aot = FF_PROFILE_AAC_LOW + 1;
-    int sce = 0, cpe = 0;
-
-    if ((err = aacEncOpen(&s->handle, 0, avctx->channels)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
-               aac_get_error(err));
-        goto error;
-    }
-
-    if (avctx->profile != FF_PROFILE_UNKNOWN)
-        aot = avctx->profile + 1;
-
-    if ((err = aacEncoder_SetParam(s->handle, AACENC_AOT, aot)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to set the AOT %d: %s\n",
-               aot, aac_get_error(err));
-        goto error;
-    }
-
-    if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_sbr) {
-        if ((err = aacEncoder_SetParam(s->handle, AACENC_SBR_MODE,
-                                       1)) != AACENC_OK) {
-            av_log(avctx, AV_LOG_ERROR, "Unable to enable SBR for ELD: %s\n",
-                   aac_get_error(err));
-            goto error;
-        }
-    }
-
-    if ((err = aacEncoder_SetParam(s->handle, AACENC_SAMPLERATE,
-                                   avctx->sample_rate)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to set the sample rate %d: %s\n",
-               avctx->sample_rate, aac_get_error(err));
-        goto error;
-    }
-
-    switch (avctx->channels) {
-    case 1: mode = MODE_1;       sce = 1; cpe = 0; break;
-    case 2: mode = MODE_2;       sce = 0; cpe = 1; break;
-    case 3: mode = MODE_1_2;     sce = 1; cpe = 1; break;
-    case 4: mode = MODE_1_2_1;   sce = 2; cpe = 1; break;
-    case 5: mode = MODE_1_2_2;   sce = 1; cpe = 2; break;
-    case 6: mode = MODE_1_2_2_1; sce = 2; cpe = 2; break;
-    default:
-        av_log(avctx, AV_LOG_ERROR,
-               "Unsupported number of channels %d\n", avctx->channels);
-        goto error;
-    }
-
-    if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELMODE,
-                                   mode)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Unable to set channel mode %d: %s\n", mode, aac_get_error(err));
-        goto error;
-    }
-
-    if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELORDER,
-                                   1)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Unable to set wav channel order %d: %s\n",
-               mode, aac_get_error(err));
-        goto error;
-    }
-
-    if (avctx->flags & CODEC_FLAG_QSCALE || s->vbr) {
-        int mode = s->vbr ? s->vbr : avctx->global_quality;
-        if (mode <  1 || mode > 5) {
-            av_log(avctx, AV_LOG_WARNING,
-                   "VBR quality %d out of range, should be 1-5\n", mode);
-            mode = av_clip(mode, 1, 5);
-        }
-        av_log(avctx, AV_LOG_WARNING,
-               "Note, the VBR setting is unsupported and only works with "
-               "some parameter combinations\n");
-        if ((err = aacEncoder_SetParam(s->handle, AACENC_BITRATEMODE,
-                                       mode)) != AACENC_OK) {
-            av_log(avctx, AV_LOG_ERROR, "Unable to set the VBR bitrate mode %d: %s\n",
-                   mode, aac_get_error(err));
-            goto error;
-        }
-    } else {
-        if (avctx->bit_rate <= 0) {
-            if (avctx->profile == FF_PROFILE_AAC_HE_V2) {
-                sce = 1;
-                cpe = 0;
-            }
-            avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44;
-            if (avctx->profile == FF_PROFILE_AAC_HE ||
-                avctx->profile == FF_PROFILE_AAC_HE_V2 ||
-                avctx->profile == FF_PROFILE_MPEG2_AAC_HE ||
-                s->eld_sbr)
-                avctx->bit_rate /= 2;
-        }
-        if ((err = aacEncoder_SetParam(s->handle, AACENC_BITRATE,
-                                       avctx->bit_rate)) != AACENC_OK) {
-            av_log(avctx, AV_LOG_ERROR, "Unable to set the bitrate %d: %s\n",
-                   avctx->bit_rate, aac_get_error(err));
-            goto error;
-        }
-    }
-
-    /* Choose bitstream format - if global header is requested, use
-     * raw access units, otherwise use ADTS. */
-    if ((err = aacEncoder_SetParam(s->handle, AACENC_TRANSMUX,
-                                   avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 0 : s->latm ? 10 : 2)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to set the transmux format: %s\n",
-               aac_get_error(err));
-        goto error;
-    }
-
-    if (s->latm && s->header_period) {
-        if ((err = aacEncoder_SetParam(s->handle, AACENC_HEADER_PERIOD,
-                                       s->header_period)) != AACENC_OK) {
-             av_log(avctx, AV_LOG_ERROR, "Unable to set header period: %s\n",
-                    aac_get_error(err));
-             goto error;
-        }
-    }
-
-    /* If no signaling mode is chosen, use explicit hierarchical signaling
-     * if using mp4 mode (raw access units, with global header) and
-     * implicit signaling if using ADTS. */
-    if (s->signaling < 0)
-        s->signaling = avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 2 : 0;
-
-    if ((err = aacEncoder_SetParam(s->handle, AACENC_SIGNALING_MODE,
-                                   s->signaling)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to set signaling mode %d: %s\n",
-               s->signaling, aac_get_error(err));
-        goto error;
-    }
-
-    if ((err = aacEncoder_SetParam(s->handle, AACENC_AFTERBURNER,
-                                   s->afterburner)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to set afterburner to %d: %s\n",
-               s->afterburner, aac_get_error(err));
-        goto error;
-    }
-
-    if (avctx->cutoff > 0) {
-        if (avctx->cutoff < (avctx->sample_rate + 255) >> 8 || avctx->cutoff > 20000) {
-            av_log(avctx, AV_LOG_ERROR, "cutoff valid range is %d-20000\n",
-                   (avctx->sample_rate + 255) >> 8);
-            goto error;
-        }
-        if ((err = aacEncoder_SetParam(s->handle, AACENC_BANDWIDTH,
-                                       avctx->cutoff)) != AACENC_OK) {
-            av_log(avctx, AV_LOG_ERROR, "Unable to set the encoder bandwidth to %d: %s\n",
-                   avctx->cutoff, aac_get_error(err));
-            goto error;
-        }
-    }
-
-    if ((err = aacEncEncode(s->handle, NULL, NULL, NULL, NULL)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to initialize the encoder: %s\n",
-               aac_get_error(err));
-        return AVERROR(EINVAL);
-    }
-
-    if ((err = aacEncInfo(s->handle, &info)) != AACENC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to get encoder info: %s\n",
-               aac_get_error(err));
-        goto error;
-    }
-
-    avctx->frame_size = info.frameLength;
-    avctx->delay      = info.encoderDelay;
-    ff_af_queue_init(avctx, &s->afq);
-
-    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
-        avctx->extradata_size = info.confSize;
-        avctx->extradata      = av_mallocz(avctx->extradata_size +
-                                           FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!avctx->extradata) {
-            ret = AVERROR(ENOMEM);
-            goto error;
-        }
-
-        memcpy(avctx->extradata, info.confBuf, info.confSize);
-    }
-    return 0;
-error:
-    aac_encode_close(avctx);
-    return ret;
-}
-
-static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                            const AVFrame *frame, int *got_packet_ptr)
-{
-    AACContext    *s        = avctx->priv_data;
-    AACENC_BufDesc in_buf   = { 0 }, out_buf = { 0 };
-    AACENC_InArgs  in_args  = { 0 };
-    AACENC_OutArgs out_args = { 0 };
-    int in_buffer_identifier = IN_AUDIO_DATA;
-    int in_buffer_size, in_buffer_element_size;
-    int out_buffer_identifier = OUT_BITSTREAM_DATA;
-    int out_buffer_size, out_buffer_element_size;
-    void *in_ptr, *out_ptr;
-    int ret;
-    AACENC_ERROR err;
-
-    /* handle end-of-stream small frame and flushing */
-    if (!frame) {
-        in_args.numInSamples = -1;
-    } else {
-        in_ptr                   = frame->data[0];
-        in_buffer_size           = 2 * avctx->channels * frame->nb_samples;
-        in_buffer_element_size   = 2;
-
-        in_args.numInSamples     = avctx->channels * frame->nb_samples;
-        in_buf.numBufs           = 1;
-        in_buf.bufs              = &in_ptr;
-        in_buf.bufferIdentifiers = &in_buffer_identifier;
-        in_buf.bufSizes          = &in_buffer_size;
-        in_buf.bufElSizes        = &in_buffer_element_size;
-
-        /* add current frame to the queue */
-        if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
-            return ret;
-    }
-
-    /* The maximum packet size is 6144 bits aka 768 bytes per channel. */
-    if ((ret = ff_alloc_packet(avpkt, FFMAX(8192, 768 * avctx->channels)))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    out_ptr                   = avpkt->data;
-    out_buffer_size           = avpkt->size;
-    out_buffer_element_size   = 1;
-    out_buf.numBufs           = 1;
-    out_buf.bufs              = &out_ptr;
-    out_buf.bufferIdentifiers = &out_buffer_identifier;
-    out_buf.bufSizes          = &out_buffer_size;
-    out_buf.bufElSizes        = &out_buffer_element_size;
-
-    if ((err = aacEncEncode(s->handle, &in_buf, &out_buf, &in_args,
-                            &out_args)) != AACENC_OK) {
-        if (!frame && err == AACENC_ENCODE_EOF)
-            return 0;
-        av_log(avctx, AV_LOG_ERROR, "Unable to encode frame: %s\n",
-               aac_get_error(err));
-        return AVERROR(EINVAL);
-    }
-
-    if (!out_args.numOutBytes)
-        return 0;
-
-    /* Get the next frame pts & duration */
-    ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
-                       &avpkt->duration);
-
-    avpkt->size     = out_args.numOutBytes;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-static const AVProfile profiles[] = {
-    { FF_PROFILE_AAC_LOW,   "LC"       },
-    { FF_PROFILE_AAC_HE,    "HE-AAC"   },
-    { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
-    { FF_PROFILE_AAC_LD,    "LD"       },
-    { FF_PROFILE_AAC_ELD,   "ELD"      },
-    { FF_PROFILE_UNKNOWN },
-};
-
-static const AVCodecDefault aac_encode_defaults[] = {
-    { "b", "0" },
-    { NULL }
-};
-
-static const uint64_t aac_channel_layout[] = {
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_5POINT0_BACK,
-    AV_CH_LAYOUT_5POINT1_BACK,
-    0,
-};
-
-static const int aac_sample_rates[] = {
-    96000, 88200, 64000, 48000, 44100, 32000,
-    24000, 22050, 16000, 12000, 11025, 8000, 0
-};
-
-AVCodec ff_libfdk_aac_encoder = {
-    .name                  = "libfdk_aac",
-    .long_name             = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"),
-    .type                  = AVMEDIA_TYPE_AUDIO,
-    .id                    = AV_CODEC_ID_AAC,
-    .priv_data_size        = sizeof(AACContext),
-    .init                  = aac_encode_init,
-    .encode2               = aac_encode_frame,
-    .close                 = aac_encode_close,
-    .capabilities          = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
-    .sample_fmts           = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                            AV_SAMPLE_FMT_NONE },
-    .priv_class            = &aac_enc_class,
-    .defaults              = aac_encode_defaults,
-    .profiles              = profiles,
-    .supported_samplerates = aac_sample_rates,
-    .channel_layouts       = aac_channel_layout,
-};
diff --git a/deps/libav/libavcodec/libgsm.c b/deps/libav/libavcodec/libgsm.c
deleted file mode 100644
index dfab005..0000000
--- a/deps/libav/libavcodec/libgsm.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Interface to libgsm for gsm encoding/decoding
- * Copyright (c) 2005 Alban Bedel <albeu at free.fr>
- * Copyright (c) 2006, 2007 Michel Bardiaux <mbardiaux at mediaxim.be>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Interface to libgsm for gsm encoding/decoding
- */
-
-// The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html
-
-#include "config.h"
-#if HAVE_GSM_H
-#include <gsm.h>
-#else
-#include <gsm/gsm.h>
-#endif
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "gsm.h"
-
-static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
-    if (avctx->channels > 1) {
-        av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
-               avctx->channels);
-        return -1;
-    }
-
-    if (avctx->sample_rate != 8000) {
-        av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",
-               avctx->sample_rate);
-        if (avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)
-            return -1;
-    }
-    if (avctx->bit_rate != 13000 /* Official */ &&
-        avctx->bit_rate != 13200 /* Very common */ &&
-        avctx->bit_rate != 0 /* Unknown; a.o. mov does not set bitrate when decoding */ ) {
-        av_log(avctx, AV_LOG_ERROR, "Bitrate 13000bps required for GSM, got %dbps\n",
-               avctx->bit_rate);
-        if (avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)
-            return -1;
-    }
-
-    avctx->priv_data = gsm_create();
-
-    switch(avctx->codec_id) {
-    case AV_CODEC_ID_GSM:
-        avctx->frame_size = GSM_FRAME_SIZE;
-        avctx->block_align = GSM_BLOCK_SIZE;
-        break;
-    case AV_CODEC_ID_GSM_MS: {
-        int one = 1;
-        gsm_option(avctx->priv_data, GSM_OPT_WAV49, &one);
-        avctx->frame_size = 2*GSM_FRAME_SIZE;
-        avctx->block_align = GSM_MS_BLOCK_SIZE;
-        }
-    }
-
-    return 0;
-}
-
-static av_cold int libgsm_encode_close(AVCodecContext *avctx) {
-    gsm_destroy(avctx->priv_data);
-    avctx->priv_data = NULL;
-    return 0;
-}
-
-static int libgsm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                               const AVFrame *frame, int *got_packet_ptr)
-{
-    int ret;
-    gsm_signal *samples = (gsm_signal *)frame->data[0];
-    struct gsm_state *state = avctx->priv_data;
-
-    if ((ret = ff_alloc_packet(avpkt, avctx->block_align))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    switch(avctx->codec_id) {
-    case AV_CODEC_ID_GSM:
-        gsm_encode(state, samples, avpkt->data);
-        break;
-    case AV_CODEC_ID_GSM_MS:
-        gsm_encode(state, samples,                  avpkt->data);
-        gsm_encode(state, samples + GSM_FRAME_SIZE, avpkt->data + 32);
-    }
-
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-
-AVCodec ff_libgsm_encoder = {
-    .name           = "libgsm",
-    .long_name      = NULL_IF_CONFIG_SMALL("libgsm GSM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_GSM,
-    .init           = libgsm_encode_init,
-    .encode2        = libgsm_encode_frame,
-    .close          = libgsm_encode_close,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-};
-
-AVCodec ff_libgsm_ms_encoder = {
-    .name           = "libgsm_ms",
-    .long_name      = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_GSM_MS,
-    .init           = libgsm_encode_init,
-    .encode2        = libgsm_encode_frame,
-    .close          = libgsm_encode_close,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-};
-
-typedef struct LibGSMDecodeContext {
-    struct gsm_state *state;
-} LibGSMDecodeContext;
-
-static av_cold int libgsm_decode_init(AVCodecContext *avctx) {
-    LibGSMDecodeContext *s = avctx->priv_data;
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_rate    = 8000;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
-
-    s->state = gsm_create();
-
-    switch(avctx->codec_id) {
-    case AV_CODEC_ID_GSM:
-        avctx->frame_size  = GSM_FRAME_SIZE;
-        avctx->block_align = GSM_BLOCK_SIZE;
-        break;
-    case AV_CODEC_ID_GSM_MS: {
-        int one = 1;
-        gsm_option(s->state, GSM_OPT_WAV49, &one);
-        avctx->frame_size  = 2 * GSM_FRAME_SIZE;
-        avctx->block_align = GSM_MS_BLOCK_SIZE;
-        }
-    }
-
-    return 0;
-}
-
-static av_cold int libgsm_decode_close(AVCodecContext *avctx) {
-    LibGSMDecodeContext *s = avctx->priv_data;
-
-    gsm_destroy(s->state);
-    s->state = NULL;
-    return 0;
-}
-
-static int libgsm_decode_frame(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, AVPacket *avpkt)
-{
-    int i, ret;
-    LibGSMDecodeContext *s = avctx->priv_data;
-    AVFrame *frame         = data;
-    uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    int16_t *samples;
-
-    if (buf_size < avctx->block_align) {
-        av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = avctx->frame_size;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (int16_t *)frame->data[0];
-
-    for (i = 0; i < avctx->frame_size / GSM_FRAME_SIZE; i++) {
-        if ((ret = gsm_decode(s->state, buf, samples)) < 0)
-            return -1;
-        buf     += GSM_BLOCK_SIZE;
-        samples += GSM_FRAME_SIZE;
-    }
-
-    *got_frame_ptr = 1;
-
-    return avctx->block_align;
-}
-
-static void libgsm_flush(AVCodecContext *avctx) {
-    LibGSMDecodeContext *s = avctx->priv_data;
-    int one = 1;
-
-    gsm_destroy(s->state);
-    s->state = gsm_create();
-    if (avctx->codec_id == AV_CODEC_ID_GSM_MS)
-        gsm_option(s->state, GSM_OPT_WAV49, &one);
-}
-
-AVCodec ff_libgsm_decoder = {
-    .name           = "libgsm",
-    .long_name      = NULL_IF_CONFIG_SMALL("libgsm GSM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_GSM,
-    .priv_data_size = sizeof(LibGSMDecodeContext),
-    .init           = libgsm_decode_init,
-    .close          = libgsm_decode_close,
-    .decode         = libgsm_decode_frame,
-    .flush          = libgsm_flush,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-AVCodec ff_libgsm_ms_decoder = {
-    .name           = "libgsm_ms",
-    .long_name      = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_GSM_MS,
-    .priv_data_size = sizeof(LibGSMDecodeContext),
-    .init           = libgsm_decode_init,
-    .close          = libgsm_decode_close,
-    .decode         = libgsm_decode_frame,
-    .flush          = libgsm_flush,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/libilbc.c b/deps/libav/libavcodec/libilbc.c
deleted file mode 100644
index af693bd..0000000
--- a/deps/libav/libavcodec/libilbc.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * iLBC decoder/encoder stub
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <ilbc.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "internal.h"
-
-static int get_mode(AVCodecContext *avctx)
-{
-    if (avctx->block_align == 38)
-        return 20;
-    else if (avctx->block_align == 50)
-        return 30;
-    else if (avctx->bit_rate > 0)
-        return avctx->bit_rate <= 14000 ? 30 : 20;
-    else
-        return -1;
-}
-
-typedef struct ILBCDecContext {
-    const AVClass *class;
-    iLBC_Dec_Inst_t decoder;
-    int enhance;
-} ILBCDecContext;
-
-static const AVOption ilbc_dec_options[] = {
-    { "enhance", "Enhance the decoded audio (adds delay)", offsetof(ILBCDecContext, enhance), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM },
-    { NULL }
-};
-
-static const AVClass ilbc_dec_class = {
-    "libilbc", av_default_item_name, ilbc_dec_options, LIBAVUTIL_VERSION_INT
-};
-
-static av_cold int ilbc_decode_init(AVCodecContext *avctx)
-{
-    ILBCDecContext *s  = avctx->priv_data;
-    int mode;
-
-    if ((mode = get_mode(avctx)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "iLBC frame mode not indicated\n");
-        return AVERROR(EINVAL);
-    }
-
-    WebRtcIlbcfix_InitDecode(&s->decoder, mode, s->enhance);
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_rate    = 8000;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
-
-    return 0;
-}
-
-static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    ILBCDecContext *s  = avctx->priv_data;
-    AVFrame *frame     = data;
-    int ret;
-
-    if (s->decoder.no_of_bytes > buf_size) {
-        av_log(avctx, AV_LOG_ERROR, "iLBC frame too short (%u, should be %u)\n",
-               buf_size, s->decoder.no_of_bytes);
-        return AVERROR_INVALIDDATA;
-    }
-
-    frame->nb_samples = s->decoder.blockl;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0],
-                             (const WebRtc_UWord16*) buf, &s->decoder, 1);
-
-    *got_frame_ptr = 1;
-
-    return s->decoder.no_of_bytes;
-}
-
-AVCodec ff_libilbc_decoder = {
-    .name           = "libilbc",
-    .long_name      = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ILBC,
-    .priv_data_size = sizeof(ILBCDecContext),
-    .init           = ilbc_decode_init,
-    .decode         = ilbc_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .priv_class     = &ilbc_dec_class,
-};
-
-typedef struct ILBCEncContext {
-    const AVClass *class;
-    iLBC_Enc_Inst_t encoder;
-    int mode;
-} ILBCEncContext;
-
-static const AVOption ilbc_enc_options[] = {
-    { "mode", "iLBC mode (20 or 30 ms frames)", offsetof(ILBCEncContext, mode), AV_OPT_TYPE_INT, { .i64 = 20 }, 20, 30, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
-    { NULL }
-};
-
-static const AVClass ilbc_enc_class = {
-    "libilbc", av_default_item_name, ilbc_enc_options, LIBAVUTIL_VERSION_INT
-};
-
-static av_cold int ilbc_encode_init(AVCodecContext *avctx)
-{
-    ILBCEncContext *s = avctx->priv_data;
-    int mode;
-
-    if (avctx->sample_rate != 8000) {
-        av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (avctx->channels != 1) {
-        av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
-        return AVERROR(EINVAL);
-    }
-
-    if ((mode = get_mode(avctx)) > 0)
-        s->mode = mode;
-    else
-        s->mode = s->mode != 30 ? 20 : 30;
-    WebRtcIlbcfix_InitEncode(&s->encoder, s->mode);
-
-    avctx->block_align = s->encoder.no_of_bytes;
-    avctx->frame_size  = s->encoder.blockl;
-
-    return 0;
-}
-
-static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                             const AVFrame *frame, int *got_packet_ptr)
-{
-    ILBCEncContext *s = avctx->priv_data;
-    int ret;
-
-    if ((ret = ff_alloc_packet(avpkt, 50))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt->data, (const WebRtc_Word16*) frame->data[0], &s->encoder);
-
-    avpkt->size     = s->encoder.no_of_bytes;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-static const AVCodecDefault ilbc_encode_defaults[] = {
-    { "b", "0" },
-    { NULL }
-};
-
-AVCodec ff_libilbc_encoder = {
-    .name           = "libilbc",
-    .long_name      = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ILBC,
-    .priv_data_size = sizeof(ILBCEncContext),
-    .init           = ilbc_encode_init,
-    .encode2        = ilbc_encode_frame,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-    .defaults       = ilbc_encode_defaults,
-    .priv_class     = &ilbc_enc_class,
-};
diff --git a/deps/libav/libavcodec/libmp3lame.c b/deps/libav/libavcodec/libmp3lame.c
deleted file mode 100644
index ee76ff8..0000000
--- a/deps/libav/libavcodec/libmp3lame.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Interface to libmp3lame for mp3 encoding
- * Copyright (c) 2002 Lennert Buytenhek <buytenh at gnu.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Interface to libmp3lame for mp3 encoding.
- */
-
-#include <lame/lame.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "audio_frame_queue.h"
-#include "internal.h"
-#include "mpegaudio.h"
-#include "mpegaudiodecheader.h"
-
-#define BUFFER_SIZE (7200 + 2 * MPA_FRAME_SIZE + MPA_FRAME_SIZE / 4)
-
-typedef struct LAMEContext {
-    AVClass *class;
-    AVCodecContext *avctx;
-    lame_global_flags *gfp;
-    uint8_t *buffer;
-    int buffer_index;
-    int buffer_size;
-    int reservoir;
-    float *samples_flt[2];
-    AudioFrameQueue afq;
-    AVFloatDSPContext fdsp;
-} LAMEContext;
-
-
-static int realloc_buffer(LAMEContext *s)
-{
-    if (!s->buffer || s->buffer_size - s->buffer_index < BUFFER_SIZE) {
-        int new_size = s->buffer_index + 2 * BUFFER_SIZE, err;
-
-        av_dlog(s->avctx, "resizing output buffer: %d -> %d\n", s->buffer_size,
-                new_size);
-        if ((err = av_reallocp(&s->buffer, new_size)) < 0) {
-            s->buffer_size = s->buffer_index = 0;
-            return err;
-        }
-        s->buffer_size = new_size;
-    }
-    return 0;
-}
-
-static av_cold int mp3lame_encode_close(AVCodecContext *avctx)
-{
-    LAMEContext *s = avctx->priv_data;
-
-    av_freep(&s->samples_flt[0]);
-    av_freep(&s->samples_flt[1]);
-    av_freep(&s->buffer);
-
-    ff_af_queue_close(&s->afq);
-
-    lame_close(s->gfp);
-    return 0;
-}
-
-static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
-{
-    LAMEContext *s = avctx->priv_data;
-    int ret;
-
-    s->avctx = avctx;
-
-    /* initialize LAME and get defaults */
-    if ((s->gfp = lame_init()) == NULL)
-        return AVERROR(ENOMEM);
-
-    lame_set_num_channels(s->gfp, avctx->channels);
-    lame_set_mode(s->gfp, avctx->channels > 1 ? JOINT_STEREO : MONO);
-
-    /* sample rate */
-    lame_set_in_samplerate (s->gfp, avctx->sample_rate);
-    lame_set_out_samplerate(s->gfp, avctx->sample_rate);
-
-    /* algorithmic quality */
-    if (avctx->compression_level == FF_COMPRESSION_DEFAULT)
-        lame_set_quality(s->gfp, 5);
-    else
-        lame_set_quality(s->gfp, avctx->compression_level);
-
-    /* rate control */
-    if (avctx->flags & CODEC_FLAG_QSCALE) {
-        lame_set_VBR(s->gfp, vbr_default);
-        lame_set_VBR_quality(s->gfp, avctx->global_quality / (float)FF_QP2LAMBDA);
-    } else {
-        if (avctx->bit_rate)
-            lame_set_brate(s->gfp, avctx->bit_rate / 1000);
-    }
-
-    /* do not get a Xing VBR header frame from LAME */
-    lame_set_bWriteVbrTag(s->gfp,0);
-
-    /* bit reservoir usage */
-    lame_set_disable_reservoir(s->gfp, !s->reservoir);
-
-    /* set specified parameters */
-    if (lame_init_params(s->gfp) < 0) {
-        ret = -1;
-        goto error;
-    }
-
-    /* get encoder delay */
-    avctx->delay = lame_get_encoder_delay(s->gfp) + 528 + 1;
-    ff_af_queue_init(avctx, &s->afq);
-
-    avctx->frame_size  = lame_get_framesize(s->gfp);
-
-    /* allocate float sample buffers */
-    if (avctx->sample_fmt == AV_SAMPLE_FMT_FLTP) {
-        int ch;
-        for (ch = 0; ch < avctx->channels; ch++) {
-            s->samples_flt[ch] = av_malloc(avctx->frame_size *
-                                           sizeof(*s->samples_flt[ch]));
-            if (!s->samples_flt[ch]) {
-                ret = AVERROR(ENOMEM);
-                goto error;
-            }
-        }
-    }
-
-    ret = realloc_buffer(s);
-    if (ret < 0)
-        goto error;
-
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    return 0;
-error:
-    mp3lame_encode_close(avctx);
-    return ret;
-}
-
-#define ENCODE_BUFFER(func, buf_type, buf_name) do {                        \
-    lame_result = func(s->gfp,                                              \
-                       (const buf_type *)buf_name[0],                       \
-                       (const buf_type *)buf_name[1], frame->nb_samples,    \
-                       s->buffer + s->buffer_index,                         \
-                       s->buffer_size - s->buffer_index);                   \
-} while (0)
-
-static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                                const AVFrame *frame, int *got_packet_ptr)
-{
-    LAMEContext *s = avctx->priv_data;
-    MPADecodeHeader hdr;
-    int len, ret, ch;
-    int lame_result;
-
-    if (frame) {
-        switch (avctx->sample_fmt) {
-        case AV_SAMPLE_FMT_S16P:
-            ENCODE_BUFFER(lame_encode_buffer, int16_t, frame->data);
-            break;
-        case AV_SAMPLE_FMT_S32P:
-            ENCODE_BUFFER(lame_encode_buffer_int, int32_t, frame->data);
-            break;
-        case AV_SAMPLE_FMT_FLTP:
-            if (frame->linesize[0] < 4 * FFALIGN(frame->nb_samples, 8)) {
-                av_log(avctx, AV_LOG_ERROR, "inadequate AVFrame plane padding\n");
-                return AVERROR(EINVAL);
-            }
-            for (ch = 0; ch < avctx->channels; ch++) {
-                s->fdsp.vector_fmul_scalar(s->samples_flt[ch],
-                                           (const float *)frame->data[ch],
-                                           32768.0f,
-                                           FFALIGN(frame->nb_samples, 8));
-            }
-            ENCODE_BUFFER(lame_encode_buffer_float, float, s->samples_flt);
-            break;
-        default:
-            return AVERROR_BUG;
-        }
-    } else {
-        lame_result = lame_encode_flush(s->gfp, s->buffer + s->buffer_index,
-                                        s->buffer_size - s->buffer_index);
-    }
-    if (lame_result < 0) {
-        if (lame_result == -1) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "lame: output buffer too small (buffer index: %d, free bytes: %d)\n",
-                   s->buffer_index, s->buffer_size - s->buffer_index);
-        }
-        return -1;
-    }
-    s->buffer_index += lame_result;
-    ret = realloc_buffer(s);
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "error reallocating output buffer\n");
-        return ret;
-    }
-
-    /* add current frame to the queue */
-    if (frame) {
-        if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
-            return ret;
-    }
-
-    /* Move 1 frame from the LAME buffer to the output packet, if available.
-       We have to parse the first frame header in the output buffer to
-       determine the frame size. */
-    if (s->buffer_index < 4)
-        return 0;
-    if (avpriv_mpegaudio_decode_header(&hdr, AV_RB32(s->buffer))) {
-        av_log(avctx, AV_LOG_ERROR, "free format output not supported\n");
-        return -1;
-    }
-    len = hdr.frame_size;
-    av_dlog(avctx, "in:%d packet-len:%d index:%d\n", avctx->frame_size, len,
-            s->buffer_index);
-    if (len <= s->buffer_index) {
-        if ((ret = ff_alloc_packet(avpkt, len))) {
-            av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-            return ret;
-        }
-        memcpy(avpkt->data, s->buffer, len);
-        s->buffer_index -= len;
-        memmove(s->buffer, s->buffer + len, s->buffer_index);
-
-        /* Get the next frame pts/duration */
-        ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
-                           &avpkt->duration);
-
-        avpkt->size = len;
-        *got_packet_ptr = 1;
-    }
-    return 0;
-}
-
-#define OFFSET(x) offsetof(LAMEContext, x)
-#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "reservoir", "Use bit reservoir.", OFFSET(reservoir), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AE },
-    { NULL },
-};
-
-static const AVClass libmp3lame_class = {
-    .class_name = "libmp3lame encoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVCodecDefault libmp3lame_defaults[] = {
-    { "b",          "0" },
-    { NULL },
-};
-
-static const int libmp3lame_sample_rates[] = {
-    44100, 48000,  32000, 22050, 24000, 16000, 11025, 12000, 8000, 0
-};
-
-AVCodec ff_libmp3lame_encoder = {
-    .name                  = "libmp3lame",
-    .long_name             = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
-    .type                  = AVMEDIA_TYPE_AUDIO,
-    .id                    = AV_CODEC_ID_MP3,
-    .priv_data_size        = sizeof(LAMEContext),
-    .init                  = mp3lame_encode_init,
-    .encode2               = mp3lame_encode_frame,
-    .close                 = mp3lame_encode_close,
-    .capabilities          = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
-    .sample_fmts           = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P,
-                                                             AV_SAMPLE_FMT_FLTP,
-                                                             AV_SAMPLE_FMT_S16P,
-                                                             AV_SAMPLE_FMT_NONE },
-    .supported_samplerates = libmp3lame_sample_rates,
-    .channel_layouts       = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
-                                                  AV_CH_LAYOUT_STEREO,
-                                                  0 },
-    .priv_class            = &libmp3lame_class,
-    .defaults              = libmp3lame_defaults,
-};
diff --git a/deps/libav/libavcodec/libopencore-amr.c b/deps/libav/libavcodec/libopencore-amr.c
deleted file mode 100644
index 6b45959..0000000
--- a/deps/libav/libavcodec/libopencore-amr.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * AMR Audio decoder stub
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "audio_frame_queue.h"
-#include "internal.h"
-
-static int amr_decode_fix_avctx(AVCodecContext *avctx)
-{
-    const int is_amr_wb = 1 + (avctx->codec_id == AV_CODEC_ID_AMR_WB);
-
-    avctx->sample_rate = 8000 * is_amr_wb;
-
-    if (avctx->channels > 1) {
-        avpriv_report_missing_feature(avctx, "multi-channel AMR");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
-    return 0;
-}
-
-#if CONFIG_LIBOPENCORE_AMRNB
-
-#include <opencore-amrnb/interf_dec.h>
-#include <opencore-amrnb/interf_enc.h>
-
-typedef struct AMRContext {
-    AVClass *av_class;
-    void *dec_state;
-    void *enc_state;
-    int   enc_bitrate;
-    int   enc_mode;
-    int   enc_dtx;
-    int   enc_last_frame;
-    AudioFrameQueue afq;
-} AMRContext;
-
-#if CONFIG_LIBOPENCORE_AMRNB_DECODER
-static av_cold int amr_nb_decode_init(AVCodecContext *avctx)
-{
-    AMRContext *s  = avctx->priv_data;
-    int ret;
-
-    if ((ret = amr_decode_fix_avctx(avctx)) < 0)
-        return ret;
-
-    s->dec_state   = Decoder_Interface_init();
-    if (!s->dec_state) {
-        av_log(avctx, AV_LOG_ERROR, "Decoder_Interface_init error\n");
-        return -1;
-    }
-
-    return 0;
-}
-
-static av_cold int amr_nb_decode_close(AVCodecContext *avctx)
-{
-    AMRContext *s = avctx->priv_data;
-
-    Decoder_Interface_exit(s->dec_state);
-
-    return 0;
-}
-
-static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    AMRContext *s      = avctx->priv_data;
-    static const uint8_t block_size[16] = { 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };
-    enum Mode dec_mode;
-    int packet_size, ret;
-
-    av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",
-            buf, buf_size, avctx->frame_number);
-
-    /* get output buffer */
-    frame->nb_samples = 160;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    dec_mode    = (buf[0] >> 3) & 0x000F;
-    packet_size = block_size[dec_mode] + 1;
-
-    if (packet_size > buf_size) {
-        av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",
-               buf_size, packet_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",
-              packet_size, buf[0], buf[1], buf[2], buf[3]);
-    /* call decoder */
-    Decoder_Interface_Decode(s->dec_state, buf, (short *)frame->data[0], 0);
-
-    *got_frame_ptr = 1;
-
-    return packet_size;
-}
-
-AVCodec ff_libopencore_amrnb_decoder = {
-    .name           = "libopencore_amrnb",
-    .long_name      = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AMR_NB,
-    .priv_data_size = sizeof(AMRContext),
-    .init           = amr_nb_decode_init,
-    .close          = amr_nb_decode_close,
-    .decode         = amr_nb_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif /* CONFIG_LIBOPENCORE_AMRNB_DECODER */
-
-#if CONFIG_LIBOPENCORE_AMRNB_ENCODER
-/* Common code for fixed and float version*/
-typedef struct AMR_bitrates {
-    int       rate;
-    enum Mode mode;
-} AMR_bitrates;
-
-/* Match desired bitrate */
-static int get_bitrate_mode(int bitrate, void *log_ctx)
-{
-    /* make the correspondance between bitrate and mode */
-    static const AMR_bitrates rates[] = {
-        { 4750, MR475 }, { 5150, MR515 }, {  5900, MR59  }, {  6700, MR67  },
-        { 7400, MR74 },  { 7950, MR795 }, { 10200, MR102 }, { 12200, MR122 }
-    };
-    int i, best = -1, min_diff = 0;
-    char log_buf[200];
-
-    for (i = 0; i < 8; i++) {
-        if (rates[i].rate == bitrate)
-            return rates[i].mode;
-        if (best < 0 || abs(rates[i].rate - bitrate) < min_diff) {
-            best     = i;
-            min_diff = abs(rates[i].rate - bitrate);
-        }
-    }
-    /* no bitrate matching exactly, log a warning */
-    snprintf(log_buf, sizeof(log_buf), "bitrate not supported: use one of ");
-    for (i = 0; i < 8; i++)
-        av_strlcatf(log_buf, sizeof(log_buf), "%.2fk, ", rates[i].rate    / 1000.f);
-    av_strlcatf(log_buf, sizeof(log_buf), "using %.2fk", rates[best].rate / 1000.f);
-    av_log(log_ctx, AV_LOG_WARNING, "%s\n", log_buf);
-
-    return best;
-}
-
-static const AVOption options[] = {
-    { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRContext, enc_dtx), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
-    { NULL }
-};
-
-static const AVClass class = {
-    "libopencore_amrnb", av_default_item_name, options, LIBAVUTIL_VERSION_INT
-};
-
-static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
-{
-    AMRContext *s = avctx->priv_data;
-
-    if (avctx->sample_rate != 8000) {
-        av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
-        return AVERROR(ENOSYS);
-    }
-
-    if (avctx->channels != 1) {
-        av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
-        return AVERROR(ENOSYS);
-    }
-
-    avctx->frame_size  = 160;
-    avctx->delay       =  50;
-    ff_af_queue_init(avctx, &s->afq);
-
-    s->enc_state = Encoder_Interface_init(s->enc_dtx);
-    if (!s->enc_state) {
-        av_log(avctx, AV_LOG_ERROR, "Encoder_Interface_init error\n");
-        av_freep(&avctx->coded_frame);
-        return -1;
-    }
-
-    s->enc_mode    = get_bitrate_mode(avctx->bit_rate, avctx);
-    s->enc_bitrate = avctx->bit_rate;
-
-    return 0;
-}
-
-static av_cold int amr_nb_encode_close(AVCodecContext *avctx)
-{
-    AMRContext *s = avctx->priv_data;
-
-    Encoder_Interface_exit(s->enc_state);
-    ff_af_queue_close(&s->afq);
-    return 0;
-}
-
-static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                               const AVFrame *frame, int *got_packet_ptr)
-{
-    AMRContext *s = avctx->priv_data;
-    int written, ret;
-    int16_t *flush_buf = NULL;
-    const int16_t *samples = frame ? (const int16_t *)frame->data[0] : NULL;
-
-    if (s->enc_bitrate != avctx->bit_rate) {
-        s->enc_mode    = get_bitrate_mode(avctx->bit_rate, avctx);
-        s->enc_bitrate = avctx->bit_rate;
-    }
-
-    if ((ret = ff_alloc_packet(avpkt, 32))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    if (frame) {
-        if (frame->nb_samples < avctx->frame_size) {
-            flush_buf = av_mallocz(avctx->frame_size * sizeof(*flush_buf));
-            if (!flush_buf)
-                return AVERROR(ENOMEM);
-            memcpy(flush_buf, samples, frame->nb_samples * sizeof(*flush_buf));
-            samples = flush_buf;
-            if (frame->nb_samples < avctx->frame_size - avctx->delay)
-                s->enc_last_frame = -1;
-        }
-        if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) {
-            av_freep(&flush_buf);
-            return ret;
-        }
-    } else {
-        if (s->enc_last_frame < 0)
-            return 0;
-        flush_buf = av_mallocz(avctx->frame_size * sizeof(*flush_buf));
-        if (!flush_buf)
-            return AVERROR(ENOMEM);
-        samples = flush_buf;
-        s->enc_last_frame = -1;
-    }
-
-    written = Encoder_Interface_Encode(s->enc_state, s->enc_mode, samples,
-                                       avpkt->data, 0);
-    av_dlog(avctx, "amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",
-            written, s->enc_mode, frame[0]);
-
-    /* Get the next frame pts/duration */
-    ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
-                       &avpkt->duration);
-
-    avpkt->size = written;
-    *got_packet_ptr = 1;
-    av_freep(&flush_buf);
-    return 0;
-}
-
-AVCodec ff_libopencore_amrnb_encoder = {
-    .name           = "libopencore_amrnb",
-    .long_name      = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AMR_NB,
-    .priv_data_size = sizeof(AMRContext),
-    .init           = amr_nb_encode_init,
-    .encode2        = amr_nb_encode_frame,
-    .close          = amr_nb_encode_close,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-    .priv_class     = &class,
-};
-#endif /* CONFIG_LIBOPENCORE_AMRNB_ENCODER */
-
-#endif /* CONFIG_LIBOPENCORE_AMRNB */
-
-/* -----------AMR wideband ------------*/
-#if CONFIG_LIBOPENCORE_AMRWB_DECODER
-
-#include <opencore-amrwb/dec_if.h>
-#include <opencore-amrwb/if_rom.h>
-
-typedef struct AMRWBContext {
-    void  *state;
-} AMRWBContext;
-
-static av_cold int amr_wb_decode_init(AVCodecContext *avctx)
-{
-    AMRWBContext *s = avctx->priv_data;
-    int ret;
-
-    if ((ret = amr_decode_fix_avctx(avctx)) < 0)
-        return ret;
-
-    s->state        = D_IF_init();
-
-    return 0;
-}
-
-static int amr_wb_decode_frame(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    AMRWBContext *s    = avctx->priv_data;
-    int mode, ret;
-    int packet_size;
-    static const uint8_t block_size[16] = {18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1};
-
-    /* get output buffer */
-    frame->nb_samples = 320;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    mode        = (buf[0] >> 3) & 0x000F;
-    packet_size = block_size[mode];
-
-    if (packet_size > buf_size) {
-        av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n",
-               buf_size, packet_size + 1);
-        return AVERROR_INVALIDDATA;
-    }
-
-    D_IF_decode(s->state, buf, (short *)frame->data[0], _good_frame);
-
-    *got_frame_ptr = 1;
-
-    return packet_size;
-}
-
-static int amr_wb_decode_close(AVCodecContext *avctx)
-{
-    AMRWBContext *s = avctx->priv_data;
-
-    D_IF_exit(s->state);
-    return 0;
-}
-
-AVCodec ff_libopencore_amrwb_decoder = {
-    .name           = "libopencore_amrwb",
-    .long_name      = NULL_IF_CONFIG_SMALL("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AMR_WB,
-    .priv_data_size = sizeof(AMRWBContext),
-    .init           = amr_wb_decode_init,
-    .close          = amr_wb_decode_close,
-    .decode         = amr_wb_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-#endif /* CONFIG_LIBOPENCORE_AMRWB_DECODER */
diff --git a/deps/libav/libavcodec/libopenjpegdec.c b/deps/libav/libavcodec/libopenjpegdec.c
deleted file mode 100644
index d6fca33..0000000
--- a/deps/libav/libavcodec/libopenjpegdec.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * JPEG 2000 decoding support via OpenJPEG
- * Copyright (c) 2009 Jaikrishnan Menon <realityman at gmx.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * JPEG 2000 decoder using libopenjpeg
- */
-
-#define  OPJ_STATIC
-#include <openjpeg.h>
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/pixfmt.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "thread.h"
-
-#define JP2_SIG_TYPE    0x6A502020
-#define JP2_SIG_VALUE   0x0D0A870A
-
-// pix_fmts with lower bpp have to be listed before
-// similar pix_fmts with higher bpp.
-#define RGB_PIXEL_FORMATS  AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,  \
-                           AV_PIX_FMT_RGB48
-
-#define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8, AV_PIX_FMT_Y400A, \
-                           AV_PIX_FMT_GRAY16
-
-#define YUV_PIXEL_FORMATS  AV_PIX_FMT_YUV410P,   AV_PIX_FMT_YUV411P,   \
-                           AV_PIX_FMT_YUVA420P, \
-                           AV_PIX_FMT_YUV420P,   AV_PIX_FMT_YUV422P,   \
-                           AV_PIX_FMT_YUV440P,   AV_PIX_FMT_YUV444P,   \
-                           AV_PIX_FMT_YUV420P9,  AV_PIX_FMT_YUV422P9,  \
-                           AV_PIX_FMT_YUV444P9, \
-                           AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, \
-                           AV_PIX_FMT_YUV444P10, \
-                           AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, \
-                           AV_PIX_FMT_YUV444P16
-
-#define XYZ_PIXEL_FORMATS  AV_PIX_FMT_XYZ12
-
-static const enum AVPixelFormat rgb_pix_fmts[]  = {RGB_PIXEL_FORMATS};
-static const enum AVPixelFormat gray_pix_fmts[] = {GRAY_PIXEL_FORMATS};
-static const enum AVPixelFormat yuv_pix_fmts[]  = {YUV_PIXEL_FORMATS};
-static const enum AVPixelFormat any_pix_fmts[]  = {RGB_PIXEL_FORMATS,
-                                                 GRAY_PIXEL_FORMATS,
-                                                 YUV_PIXEL_FORMATS,
-                                                 XYZ_PIXEL_FORMATS};
-
-typedef struct {
-    AVClass *class;
-    opj_dparameters_t dec_params;
-    int lowres;
-    int lowqual;
-} LibOpenJPEGContext;
-
-static int libopenjpeg_matches_pix_fmt(const opj_image_t *img,
-                                       enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    int match = 1;
-
-    if (desc->nb_components != img->numcomps) {
-        return 0;
-    }
-
-    switch (desc->nb_components) {
-    case 4:
-        match = match &&
-            desc->comp[3].depth_minus1 + 1 >= img->comps[3].prec &&
-            1 == img->comps[3].dx &&
-            1 == img->comps[3].dy;
-    case 3:
-        match = match &&
-            desc->comp[2].depth_minus1 + 1 >= img->comps[2].prec &&
-            1 << desc->log2_chroma_w == img->comps[2].dx &&
-            1 << desc->log2_chroma_h == img->comps[2].dy;
-    case 2:
-        match = match &&
-            desc->comp[1].depth_minus1 + 1 >= img->comps[1].prec &&
-            1 << desc->log2_chroma_w == img->comps[1].dx &&
-            1 << desc->log2_chroma_h == img->comps[1].dy;
-    case 1:
-        match = match &&
-            desc->comp[0].depth_minus1 + 1 >= img->comps[0].prec &&
-            1 == img->comps[0].dx &&
-            1 == img->comps[0].dy;
-    default:
-        break;
-    }
-
-    return match;
-}
-
-static enum AVPixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *image)
-{
-    int index;
-    const enum AVPixelFormat *possible_fmts = NULL;
-    int possible_fmts_nb = 0;
-
-    switch (image->color_space) {
-    case CLRSPC_SRGB:
-        possible_fmts = rgb_pix_fmts;
-        possible_fmts_nb = FF_ARRAY_ELEMS(rgb_pix_fmts);
-        break;
-    case CLRSPC_GRAY:
-        possible_fmts = gray_pix_fmts;
-        possible_fmts_nb = FF_ARRAY_ELEMS(gray_pix_fmts);
-        break;
-    case CLRSPC_SYCC:
-        possible_fmts = yuv_pix_fmts;
-        possible_fmts_nb = FF_ARRAY_ELEMS(yuv_pix_fmts);
-        break;
-    default:
-        possible_fmts = any_pix_fmts;
-        possible_fmts_nb = FF_ARRAY_ELEMS(any_pix_fmts);
-        break;
-    }
-
-    for (index = 0; index < possible_fmts_nb; ++index) {
-        if (libopenjpeg_matches_pix_fmt(image, possible_fmts[index])) {
-            return possible_fmts[index];
-        }
-    }
-
-    return AV_PIX_FMT_NONE;
-}
-
-static inline int libopenjpeg_ispacked(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    int i, component_plane;
-
-    if (pix_fmt == AV_PIX_FMT_GRAY16)
-        return 0;
-
-    component_plane = desc->comp[0].plane;
-    for (i = 1; i < desc->nb_components; i++) {
-        if (component_plane != desc->comp[i].plane)
-            return 0;
-    }
-    return 1;
-}
-
-static void libopenjpeg_copy_to_packed8(AVFrame *picture, opj_image_t *image)
-{
-    uint8_t *img_ptr;
-    int index, x, y, c;
-
-    for (y = 0; y < picture->height; y++) {
-        index = y*picture->width;
-        img_ptr = picture->data[0] + y*picture->linesize[0];
-        for (x = 0; x < picture->width; x++, index++) {
-            for (c = 0; c < image->numcomps; c++) {
-                *img_ptr++ = image->comps[c].data[index];
-            }
-        }
-    }
-}
-
-static void libopenjpeg_copy_to_packed16(AVFrame *picture, opj_image_t *image)
-{
-    uint16_t *img_ptr;
-    int index, x, y, c;
-    int adjust[4];
-
-    for (x = 0; x < image->numcomps; x++)
-        adjust[x] = FFMAX(FFMIN(16 - image->comps[x].prec, 8), 0);
-
-    for (y = 0; y < picture->height; y++) {
-        index = y*picture->width;
-        img_ptr = (uint16_t*) (picture->data[0] + y*picture->linesize[0]);
-        for (x = 0; x < picture->width; x++, index++) {
-            for (c = 0; c < image->numcomps; c++) {
-                *img_ptr++ = image->comps[c].data[index] << adjust[c];
-            }
-        }
-    }
-}
-
-static void libopenjpeg_copyto8(AVFrame *picture, opj_image_t *image)
-{
-    int *comp_data;
-    uint8_t *img_ptr;
-    int index, x, y;
-
-    for (index = 0; index < image->numcomps; index++) {
-        comp_data = image->comps[index].data;
-        for (y = 0; y < image->comps[index].h; y++) {
-            img_ptr = picture->data[index] + y * picture->linesize[index];
-            for (x = 0; x < image->comps[index].w; x++) {
-                *img_ptr = (uint8_t) *comp_data;
-                img_ptr++;
-                comp_data++;
-            }
-        }
-    }
-}
-
-static void libopenjpeg_copyto16(AVFrame *p, opj_image_t *image)
-{
-    int *comp_data;
-    uint16_t *img_ptr;
-    int index, x, y;
-
-    for (index = 0; index < image->numcomps; index++) {
-        comp_data = image->comps[index].data;
-        for (y = 0; y < image->comps[index].h; y++) {
-            img_ptr = (uint16_t*) (p->data[index] + y * p->linesize[index]);
-            for (x = 0; x < image->comps[index].w; x++) {
-                *img_ptr = *comp_data;
-                img_ptr++;
-                comp_data++;
-            }
-        }
-    }
-}
-
-static av_cold int libopenjpeg_decode_init(AVCodecContext *avctx)
-{
-    LibOpenJPEGContext *ctx = avctx->priv_data;
-
-    opj_set_default_decoder_parameters(&ctx->dec_params);
-    return 0;
-}
-
-static int libopenjpeg_decode_frame(AVCodecContext *avctx,
-                                    void *data, int *got_frame,
-                                    AVPacket *avpkt)
-{
-    uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    LibOpenJPEGContext *ctx = avctx->priv_data;
-    ThreadFrame frame = { .f = data };
-    AVFrame *picture  = data;
-    const AVPixFmtDescriptor *desc;
-    opj_dinfo_t *dec;
-    opj_cio_t *stream;
-    opj_image_t *image;
-    int width, height, ret;
-    int pixel_size = 0;
-    int ispacked = 0;
-    int i;
-
-    *got_frame = 0;
-
-    // Check if input is a raw jpeg2k codestream or in jp2 wrapping
-    if ((AV_RB32(buf)     == 12)           &&
-        (AV_RB32(buf + 4) == JP2_SIG_TYPE) &&
-        (AV_RB32(buf + 8) == JP2_SIG_VALUE)) {
-        dec = opj_create_decompress(CODEC_JP2);
-    } else {
-        /* If the AVPacket contains a jp2c box, then skip to
-         * the starting byte of the codestream. */
-        if (AV_RB32(buf + 4) == AV_RB32("jp2c"))
-            buf += 8;
-        dec = opj_create_decompress(CODEC_J2K);
-    }
-
-    if (!dec) {
-        av_log(avctx, AV_LOG_ERROR, "Error initializing decoder.\n");
-        return AVERROR_UNKNOWN;
-    }
-    opj_set_event_mgr((opj_common_ptr)dec, NULL, NULL);
-
-    ctx->dec_params.cp_limit_decoding = LIMIT_TO_MAIN_HEADER;
-    ctx->dec_params.cp_reduce         = ctx->lowres;
-    ctx->dec_params.cp_layer          = ctx->lowqual;
-    // Tie decoder with decoding parameters
-    opj_setup_decoder(dec, &ctx->dec_params);
-    stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size);
-
-    if (!stream) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Codestream could not be opened for reading.\n");
-        opj_destroy_decompress(dec);
-        return AVERROR_UNKNOWN;
-    }
-
-    // Decode the header only.
-    image = opj_decode_with_info(dec, stream, NULL);
-    opj_cio_close(stream);
-
-    if (!image) {
-        av_log(avctx, AV_LOG_ERROR, "Error decoding codestream.\n");
-        opj_destroy_decompress(dec);
-        return AVERROR_UNKNOWN;
-    }
-
-    width  = image->x1 - image->x0;
-    height = image->y1 - image->y0;
-
-    if (ctx->lowres) {
-        width  = (width  + (1 << ctx->lowres) - 1) >> ctx->lowres;
-        height = (height + (1 << ctx->lowres) - 1) >> ctx->lowres;
-    }
-
-    ret = ff_set_dimensions(avctx, width, height);
-    if (ret < 0)
-        goto done;
-
-    if (avctx->pix_fmt != AV_PIX_FMT_NONE)
-        if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt))
-            avctx->pix_fmt = AV_PIX_FMT_NONE;
-
-    if (avctx->pix_fmt == AV_PIX_FMT_NONE)
-        avctx->pix_fmt = libopenjpeg_guess_pix_fmt(image);
-
-    if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to determine pixel format\n");
-        ret = AVERROR_INVALIDDATA;
-        goto done;
-    }
-
-    for (i = 0; i < image->numcomps; i++)
-        if (image->comps[i].prec > avctx->bits_per_raw_sample)
-            avctx->bits_per_raw_sample = image->comps[i].prec;
-
-    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "ff_thread_get_buffer() failed\n");
-        goto done;
-    }
-
-    ctx->dec_params.cp_limit_decoding = NO_LIMITATION;
-    // Tie decoder with decoding parameters.
-    opj_setup_decoder(dec, &ctx->dec_params);
-    stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size);
-    if (!stream) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Codestream could not be opened for reading.\n");
-        ret = AVERROR_UNKNOWN;
-        goto done;
-    }
-
-    opj_image_destroy(image);
-    // Decode the codestream
-    image = opj_decode_with_info(dec, stream, NULL);
-    opj_cio_close(stream);
-
-    if (!image) {
-        av_log(avctx, AV_LOG_ERROR, "Error decoding codestream.\n");
-        ret = AVERROR_UNKNOWN;
-        goto done;
-    }
-
-    desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-    pixel_size = desc->comp[0].step_minus1 + 1;
-    ispacked = libopenjpeg_ispacked(avctx->pix_fmt);
-
-    switch (pixel_size) {
-    case 1:
-        if (ispacked) {
-            libopenjpeg_copy_to_packed8(picture, image);
-        } else {
-            libopenjpeg_copyto8(picture, image);
-        }
-        break;
-    case 2:
-        if (ispacked) {
-            libopenjpeg_copy_to_packed8(picture, image);
-        } else {
-            libopenjpeg_copyto16(picture, image);
-        }
-        break;
-    case 3:
-    case 4:
-        if (ispacked) {
-            libopenjpeg_copy_to_packed8(picture, image);
-        }
-        break;
-    case 6:
-    case 8:
-        if (ispacked) {
-            libopenjpeg_copy_to_packed16(picture, image);
-        }
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "unsupported pixel size %d\n", pixel_size);
-        ret = AVERROR_PATCHWELCOME;
-        goto done;
-    }
-
-    *got_frame = 1;
-    ret        = buf_size;
-
-done:
-    opj_image_destroy(image);
-    opj_destroy_decompress(dec);
-    return ret;
-}
-
-#define OFFSET(x) offsetof(LibOpenJPEGContext, x)
-#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
-
-static const AVOption options[] = {
-    { "lowqual", "Limit the number of layers used for decoding",    OFFSET(lowqual), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VD },
-    { "lowres",  "Lower the decoding resolution by a power of two", OFFSET(lowres),  AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VD },
-    { NULL },
-};
-
-static const AVClass class = {
-    .class_name = "libopenjpeg",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_libopenjpeg_decoder = {
-    .name             = "libopenjpeg",
-    .long_name        = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),
-    .type             = AVMEDIA_TYPE_VIDEO,
-    .id               = AV_CODEC_ID_JPEG2000,
-    .priv_data_size   = sizeof(LibOpenJPEGContext),
-    .init             = libopenjpeg_decode_init,
-    .decode           = libopenjpeg_decode_frame,
-    .capabilities     = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
-    .priv_class       = &class,
-};
diff --git a/deps/libav/libavcodec/libopenjpegenc.c b/deps/libav/libavcodec/libopenjpegenc.c
deleted file mode 100644
index b84e6a4..0000000
--- a/deps/libav/libavcodec/libopenjpegenc.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * JPEG 2000 encoding support via OpenJPEG
- * Copyright (c) 2011 Michael Bradshaw <mbradshaw at sorensonmedia.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * JPEG 2000 encoder using libopenjpeg
- */
-
-#define  OPJ_STATIC
-#include <openjpeg.h>
-
-#include "libavutil/common.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "internal.h"
-
-typedef struct {
-    AVClass *avclass;
-    opj_image_t *image;
-    opj_cparameters_t enc_params;
-    opj_cinfo_t *compress;
-    opj_event_mgr_t event_mgr;
-    int format;
-    int profile;
-    int prog_order;
-    int cinema_mode;
-    int numresolution;
-    int numlayers;
-    int disto_alloc;
-    int fixed_alloc;
-    int fixed_quality;
-} LibOpenJPEGContext;
-
-static void error_callback(const char *msg, void *data)
-{
-    av_log(data, AV_LOG_ERROR, "%s\n", msg);
-}
-
-static void warning_callback(const char *msg, void *data)
-{
-    av_log(data, AV_LOG_WARNING, "%s\n", msg);
-}
-
-static void info_callback(const char *msg, void *data)
-{
-    av_log(data, AV_LOG_DEBUG, "%s\n", msg);
-}
-
-static opj_image_t *libopenjpeg_create_image(AVCodecContext *avctx,
-                                             opj_cparameters_t *parameters)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-    opj_image_cmptparm_t *cmptparm;
-    OPJ_COLOR_SPACE color_space;
-    opj_image_t *img;
-    int i;
-    int sub_dx[4];
-    int sub_dy[4];
-    int numcomps = desc->nb_components;
-
-    sub_dx[0] =
-    sub_dx[3] = 1;
-    sub_dy[0] =
-    sub_dy[3] = 1;
-    sub_dx[1] =
-    sub_dx[2] = 1 << desc->log2_chroma_w;
-    sub_dy[1] =
-    sub_dy[2] = 1 << desc->log2_chroma_h;
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_GRAY8:
-    case AV_PIX_FMT_GRAY16:
-    case AV_PIX_FMT_Y400A:
-        color_space = CLRSPC_GRAY;
-        break;
-    case AV_PIX_FMT_RGB24:
-    case AV_PIX_FMT_RGBA:
-    case AV_PIX_FMT_RGB48:
-        color_space = CLRSPC_SRGB;
-        break;
-    case AV_PIX_FMT_YUV410P:
-    case AV_PIX_FMT_YUV411P:
-    case AV_PIX_FMT_YUV420P:
-    case AV_PIX_FMT_YUV422P:
-    case AV_PIX_FMT_YUV440P:
-    case AV_PIX_FMT_YUV444P:
-    case AV_PIX_FMT_YUVA420P:
-    case AV_PIX_FMT_YUV420P9:
-    case AV_PIX_FMT_YUV422P9:
-    case AV_PIX_FMT_YUV444P9:
-    case AV_PIX_FMT_YUV420P10:
-    case AV_PIX_FMT_YUV422P10:
-    case AV_PIX_FMT_YUV444P10:
-    case AV_PIX_FMT_YUV420P16:
-    case AV_PIX_FMT_YUV422P16:
-    case AV_PIX_FMT_YUV444P16:
-        color_space = CLRSPC_SYCC;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR,
-               "The requested pixel format '%s' is not supported\n",
-               av_get_pix_fmt_name(avctx->pix_fmt));
-        return NULL;
-    }
-
-    cmptparm = av_mallocz(numcomps * sizeof(*cmptparm));
-    if (!cmptparm) {
-        av_log(avctx, AV_LOG_ERROR, "Not enough memory");
-        return NULL;
-    }
-
-    for (i = 0; i < numcomps; i++) {
-        cmptparm[i].prec = desc->comp[i].depth_minus1 + 1;
-        cmptparm[i].bpp  = desc->comp[i].depth_minus1 + 1;
-        cmptparm[i].sgnd = 0;
-        cmptparm[i].dx   = sub_dx[i];
-        cmptparm[i].dy   = sub_dy[i];
-        cmptparm[i].w    = avctx->width / sub_dx[i];
-        cmptparm[i].h    = avctx->height / sub_dy[i];
-    }
-
-    img = opj_image_create(numcomps, cmptparm, color_space);
-    av_freep(&cmptparm);
-    return img;
-}
-
-static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
-{
-    LibOpenJPEGContext *ctx = avctx->priv_data;
-    int err = AVERROR(ENOMEM);
-
-    opj_set_default_encoder_parameters(&ctx->enc_params);
-
-    ctx->enc_params.cp_rsiz          = ctx->profile;
-    ctx->enc_params.mode             = !!avctx->global_quality;
-    ctx->enc_params.cp_cinema        = ctx->cinema_mode;
-    ctx->enc_params.prog_order       = ctx->prog_order;
-    ctx->enc_params.numresolution    = ctx->numresolution;
-    ctx->enc_params.cp_disto_alloc   = ctx->disto_alloc;
-    ctx->enc_params.cp_fixed_alloc   = ctx->fixed_alloc;
-    ctx->enc_params.cp_fixed_quality = ctx->fixed_quality;
-    ctx->enc_params.tcp_numlayers    = ctx->numlayers;
-    ctx->enc_params.tcp_rates[0]     = FFMAX(avctx->compression_level, 0) * 2;
-
-    ctx->compress = opj_create_compress(ctx->format);
-    if (!ctx->compress) {
-        av_log(avctx, AV_LOG_ERROR, "Error creating the compressor\n");
-        return AVERROR(ENOMEM);
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame) {
-        av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
-        goto fail;
-    }
-
-    ctx->image = libopenjpeg_create_image(avctx, &ctx->enc_params);
-    if (!ctx->image) {
-        av_log(avctx, AV_LOG_ERROR, "Error creating the mj2 image\n");
-        err = AVERROR(EINVAL);
-        goto fail;
-    }
-
-    ctx->event_mgr.info_handler    = info_callback;
-    ctx->event_mgr.error_handler   = error_callback;
-    ctx->event_mgr.warning_handler = warning_callback;
-    opj_set_event_mgr((opj_common_ptr)ctx->compress, &ctx->event_mgr, avctx);
-
-    return 0;
-
-fail:
-    av_freep(&ctx->compress);
-    av_freep(&avctx->coded_frame);
-    return err;
-}
-
-static void libopenjpeg_copy_packed8(AVCodecContext *avctx,
-                                     const AVFrame *frame, opj_image_t *image)
-{
-    int compno;
-    int x, y;
-    int image_index, frame_index;
-    const int numcomps = image->numcomps;
-
-    for (compno = 0; compno < numcomps; ++compno) {
-        for (y = 0; y < avctx->height; ++y) {
-            image_index = y * avctx->width;
-            frame_index = y * frame->linesize[0] + compno;
-            for (x = 0; x < avctx->width; ++x) {
-                image->comps[compno].data[image_index++] =
-                    frame->data[0][frame_index];
-                frame_index += numcomps;
-            }
-        }
-    }
-}
-
-static void libopenjpeg_copy_packed16(AVCodecContext *avctx,
-                                      const AVFrame *frame, opj_image_t *image)
-{
-    int compno;
-    int x, y;
-    int image_index, frame_index;
-    const int numcomps = image->numcomps;
-    uint16_t *frame_ptr = (uint16_t*)frame->data[0];
-
-    for (compno = 0; compno < numcomps; ++compno) {
-        for (y = 0; y < avctx->height; ++y) {
-            image_index = y * avctx->width;
-            frame_index = y * (frame->linesize[0] / 2) + compno;
-            for (x = 0; x < avctx->width; ++x) {
-                image->comps[compno].data[image_index++] =
-                    frame_ptr[frame_index];
-                frame_index += numcomps;
-            }
-        }
-    }
-}
-
-static void libopenjpeg_copy_unpacked8(AVCodecContext *avctx,
-                                       const AVFrame *frame, opj_image_t *image)
-{
-    int compno;
-    int x, y;
-    int width, height;
-    int image_index, frame_index;
-    const int numcomps = image->numcomps;
-
-    for (compno = 0; compno < numcomps; ++compno) {
-        width  = avctx->width  / image->comps[compno].dx;
-        height = avctx->height / image->comps[compno].dy;
-        for (y = 0; y < height; ++y) {
-            image_index = y * width;
-            frame_index = y * frame->linesize[compno];
-            for (x = 0; x < width; ++x)
-                image->comps[compno].data[image_index++] =
-                    frame->data[compno][frame_index++];
-        }
-    }
-}
-
-static void libopenjpeg_copy_unpacked16(AVCodecContext *avctx,
-                                        const AVFrame *frame,
-                                        opj_image_t *image)
-{
-    int compno;
-    int x, y;
-    int width, height;
-    int image_index, frame_index;
-    const int numcomps = image->numcomps;
-    uint16_t *frame_ptr;
-
-    for (compno = 0; compno < numcomps; ++compno) {
-        width  = avctx->width  / image->comps[compno].dx;
-        height = avctx->height / image->comps[compno].dy;
-        frame_ptr = (uint16_t*)frame->data[compno];
-        for (y = 0; y < height; ++y) {
-            image_index = y * width;
-            frame_index = y * (frame->linesize[compno] / 2);
-            for (x = 0; x < width; ++x)
-                image->comps[compno].data[image_index++] =
-                    frame_ptr[frame_index++];
-        }
-    }
-}
-
-static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                                    const AVFrame *frame, int *got_packet)
-{
-    LibOpenJPEGContext *ctx = avctx->priv_data;
-    opj_cinfo_t *compress = ctx->compress;
-    opj_image_t *image    = ctx->image;
-    opj_cio_t *stream;
-    int ret, len;
-
-    // x0, y0 is the top left corner of the image
-    // x1, y1 is the width, height of the reference grid
-    image->x0 = 0;
-    image->y0 = 0;
-    image->x1 = (avctx->width  - 1) * ctx->enc_params.subsampling_dx + 1;
-    image->y1 = (avctx->height - 1) * ctx->enc_params.subsampling_dy + 1;
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB24:
-    case AV_PIX_FMT_RGBA:
-    case AV_PIX_FMT_Y400A:
-        libopenjpeg_copy_packed8(avctx, frame, image);
-        break;
-    case AV_PIX_FMT_RGB48:
-        libopenjpeg_copy_packed16(avctx, frame, image);
-        break;
-    case AV_PIX_FMT_GRAY8:
-    case AV_PIX_FMT_YUV410P:
-    case AV_PIX_FMT_YUV411P:
-    case AV_PIX_FMT_YUV420P:
-    case AV_PIX_FMT_YUV422P:
-    case AV_PIX_FMT_YUV440P:
-    case AV_PIX_FMT_YUV444P:
-    case AV_PIX_FMT_YUVA420P:
-        libopenjpeg_copy_unpacked8(avctx, frame, image);
-        break;
-    case AV_PIX_FMT_GRAY16:
-    case AV_PIX_FMT_YUV420P9:
-    case AV_PIX_FMT_YUV422P9:
-    case AV_PIX_FMT_YUV444P9:
-    case AV_PIX_FMT_YUV444P10:
-    case AV_PIX_FMT_YUV422P10:
-    case AV_PIX_FMT_YUV420P10:
-    case AV_PIX_FMT_YUV444P16:
-    case AV_PIX_FMT_YUV422P16:
-    case AV_PIX_FMT_YUV420P16:
-        libopenjpeg_copy_unpacked16(avctx, frame, image);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR,
-               "The frame's pixel format '%s' is not supported\n",
-               av_get_pix_fmt_name(avctx->pix_fmt));
-        return AVERROR(EINVAL);
-        break;
-    }
-
-    opj_setup_encoder(compress, &ctx->enc_params, image);
-    stream = opj_cio_open((opj_common_ptr)compress, NULL, 0);
-    if (!stream) {
-        av_log(avctx, AV_LOG_ERROR, "Error creating the cio stream\n");
-        return AVERROR(ENOMEM);
-    }
-
-    if (!opj_encode(compress, stream, image, NULL)) {
-        opj_cio_close(stream);
-        av_log(avctx, AV_LOG_ERROR, "Error during the opj encode\n");
-        return -1;
-    }
-
-    len = cio_tell(stream);
-    if ((ret = ff_alloc_packet(pkt, len)) < 0) {
-        opj_cio_close(stream);
-        return ret;
-    }
-
-    memcpy(pkt->data, stream->buffer, len);
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    opj_cio_close(stream);
-    return 0;
-}
-
-static av_cold int libopenjpeg_encode_close(AVCodecContext *avctx)
-{
-    LibOpenJPEGContext *ctx = avctx->priv_data;
-
-    opj_destroy_compress(ctx->compress);
-    opj_image_destroy(ctx->image);
-    av_freep(&avctx->coded_frame);
-    return 0;
-}
-
-#define OFFSET(x) offsetof(LibOpenJPEGContext, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "format",        "Codec Format",      OFFSET(format),        AV_OPT_TYPE_INT,   { .i64 = CODEC_JP2   }, CODEC_J2K, CODEC_JP2,   VE, "format"      },
-    { "j2k",           NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = CODEC_J2K   }, 0,         0,           VE, "format"      },
-    { "jp2",           NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = CODEC_JP2   }, 0,         0,           VE, "format"      },
-    { "profile",       NULL,                OFFSET(profile),       AV_OPT_TYPE_INT,   { .i64 = STD_RSIZ    }, STD_RSIZ,  CINEMA4K,    VE, "profile"     },
-    { "jpeg2000",      NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = STD_RSIZ    }, 0,         0,           VE, "profile"     },
-    { "cinema2k",      NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = CINEMA2K    }, 0,         0,           VE, "profile"     },
-    { "cinema4k",      NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = CINEMA4K    }, 0,         0,           VE, "profile"     },
-    { "cinema_mode",   "Digital Cinema",    OFFSET(cinema_mode),   AV_OPT_TYPE_INT,   { .i64 = OFF         }, OFF,       CINEMA4K_24, VE, "cinema_mode" },
-    { "off",           NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = OFF         }, 0,         0,           VE, "cinema_mode" },
-    { "2k_24",         NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = CINEMA2K_24 }, 0,         0,           VE, "cinema_mode" },
-    { "2k_48",         NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = CINEMA2K_48 }, 0,         0,           VE, "cinema_mode" },
-    { "4k_24",         NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = CINEMA4K_24 }, 0,         0,           VE, "cinema_mode" },
-    { "prog_order",    "Progression Order", OFFSET(prog_order),    AV_OPT_TYPE_INT,   { .i64 = LRCP        }, LRCP,      CPRL,        VE, "prog_order"  },
-    { "lrcp",          NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = LRCP        }, 0,         0,           VE, "prog_order"  },
-    { "rlcp",          NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = RLCP        }, 0,         0,           VE, "prog_order"  },
-    { "rpcl",          NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = RPCL        }, 0,         0,           VE, "prog_order"  },
-    { "pcrl",          NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = PCRL        }, 0,         0,           VE, "prog_order"  },
-    { "cprl",          NULL,                0,                     AV_OPT_TYPE_CONST, { .i64 = CPRL        }, 0,         0,           VE, "prog_order"  },
-    { "numresolution", NULL,                OFFSET(numresolution), AV_OPT_TYPE_INT,   { .i64 = 6           }, 1,         10,          VE },
-    { "numlayers",     NULL,                OFFSET(numlayers),     AV_OPT_TYPE_INT,   { .i64 = 1           }, 1,         10,          VE },
-    { "disto_alloc",   NULL,                OFFSET(disto_alloc),   AV_OPT_TYPE_INT,   { .i64 = 1           }, 0,         1,           VE },
-    { "fixed_alloc",   NULL,                OFFSET(fixed_alloc),   AV_OPT_TYPE_INT,   { .i64 = 0           }, 0,         1,           VE },
-    { "fixed_quality", NULL,                OFFSET(fixed_quality), AV_OPT_TYPE_INT,   { .i64 = 0           }, 0,         1,           VE },
-    { NULL },
-};
-
-static const AVClass class = {
-    .class_name = "libopenjpeg",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_libopenjpeg_encoder = {
-    .name           = "libopenjpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_JPEG2000,
-    .priv_data_size = sizeof(LibOpenJPEGContext),
-    .init           = libopenjpeg_encode_init,
-    .encode2        = libopenjpeg_encode_frame,
-    .close          = libopenjpeg_encode_close,
-    .capabilities   = 0,
-    .pix_fmts       = (const enum AVPixelFormat[]) {
-        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48,
-        AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_Y400A,
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P,
-        AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
-        AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
-        AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
-        AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
-        AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
-        AV_PIX_FMT_NONE
-    },
-    .priv_class     = &class,
-};
diff --git a/deps/libav/libavcodec/libopus.c b/deps/libav/libavcodec/libopus.c
deleted file mode 100644
index b511415..0000000
--- a/deps/libav/libavcodec/libopus.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * libopus encoder/decoder common code
- * Copyright (c) 2012 Nicolas George
- *
- * This file is part of libav.
- *
- * libav 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.
- *
- * libav 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 libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <opus_defines.h>
-
-#include "libavutil/common.h"
-#include "libavutil/error.h"
-#include "libopus.h"
-
-int ff_opus_error_to_averror(int err)
-{
-    switch (err) {
-    case OPUS_BAD_ARG:
-        return AVERROR(EINVAL);
-    case OPUS_BUFFER_TOO_SMALL:
-        return AVERROR_UNKNOWN;
-    case OPUS_INTERNAL_ERROR:
-        return AVERROR(EFAULT);
-    case OPUS_INVALID_PACKET:
-        return AVERROR_INVALIDDATA;
-    case OPUS_UNIMPLEMENTED:
-        return AVERROR(ENOSYS);
-    case OPUS_INVALID_STATE:
-        return AVERROR_UNKNOWN;
-    case OPUS_ALLOC_FAIL:
-        return AVERROR(ENOMEM);
-    default:
-        return AVERROR(EINVAL);
-    }
-}
diff --git a/deps/libav/libavcodec/libopus.h b/deps/libav/libavcodec/libopus.h
deleted file mode 100644
index b08257d..0000000
--- a/deps/libav/libavcodec/libopus.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * libopus encoder/decoder common code
- * Copyright (c) 2012 Nicolas George
- *
- * This file is part of libav.
- *
- * libav 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.
- *
- * libav 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 libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_LIBOPUS_H
-#define AVCODEC_LIBOPUS_H
-
-int ff_opus_error_to_averror(int err);
-
-#endif /* AVCODEC_LIBOPUS_H */
diff --git a/deps/libav/libavcodec/libopusdec.c b/deps/libav/libavcodec/libopusdec.c
deleted file mode 100644
index 398450f..0000000
--- a/deps/libav/libavcodec/libopusdec.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Opus decoder using libopus
- * Copyright (c) 2012 Nicolas George
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <opus.h>
-#include <opus_multistream.h>
-
-#include "libavutil/avassert.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "vorbis.h"
-#include "mathops.h"
-#include "libopus.h"
-
-struct libopus_context {
-    OpusMSDecoder *dec;
-};
-
-#define OPUS_HEAD_SIZE 19
-
-static av_cold int libopus_decode_init(AVCodecContext *avc)
-{
-    struct libopus_context *opus = avc->priv_data;
-    int ret, channel_map = 0, gain_db = 0, nb_streams, nb_coupled;
-    uint8_t mapping_arr[8] = { 0, 1 }, *mapping;
-
-    avc->sample_rate    = 48000;
-    avc->sample_fmt     = avc->request_sample_fmt == AV_SAMPLE_FMT_FLT ?
-                          AV_SAMPLE_FMT_FLT : AV_SAMPLE_FMT_S16;
-    avc->channel_layout = avc->channels > 8 ? 0 :
-                          ff_vorbis_channel_layouts[avc->channels - 1];
-
-    if (avc->extradata_size >= OPUS_HEAD_SIZE) {
-        gain_db     = sign_extend(AV_RL16(avc->extradata + 16), 16);
-        channel_map = AV_RL8 (avc->extradata + 18);
-    }
-    if (avc->extradata_size >= OPUS_HEAD_SIZE + 2 + avc->channels) {
-        nb_streams = avc->extradata[OPUS_HEAD_SIZE + 0];
-        nb_coupled = avc->extradata[OPUS_HEAD_SIZE + 1];
-        if (nb_streams + nb_coupled != avc->channels)
-            av_log(avc, AV_LOG_WARNING, "Inconsistent channel mapping.\n");
-        mapping = avc->extradata + OPUS_HEAD_SIZE + 2;
-    } else {
-        if (avc->channels > 2 || channel_map) {
-            av_log(avc, AV_LOG_ERROR,
-                   "No channel mapping for %d channels.\n", avc->channels);
-            return AVERROR(EINVAL);
-        }
-        nb_streams = 1;
-        nb_coupled = avc->channels > 1;
-        mapping    = mapping_arr;
-    }
-
-    if (avc->channels > 2 && avc->channels <= 8) {
-        const uint8_t *vorbis_offset = ff_vorbis_channel_layout_offsets[avc->channels - 1];
-        int ch;
-
-        /* Remap channels from vorbis order to libav order */
-        for (ch = 0; ch < avc->channels; ch++)
-            mapping_arr[ch] = mapping[vorbis_offset[ch]];
-        mapping = mapping_arr;
-    }
-
-    opus->dec = opus_multistream_decoder_create(avc->sample_rate, avc->channels,
-                                                nb_streams, nb_coupled,
-                                                mapping, &ret);
-    if (!opus->dec) {
-        av_log(avc, AV_LOG_ERROR, "Unable to create decoder: %s\n",
-               opus_strerror(ret));
-        return ff_opus_error_to_averror(ret);
-    }
-
-    ret = opus_multistream_decoder_ctl(opus->dec, OPUS_SET_GAIN(gain_db));
-    if (ret != OPUS_OK)
-        av_log(avc, AV_LOG_WARNING, "Failed to set gain: %s\n",
-               opus_strerror(ret));
-
-    avc->delay = 3840;  /* Decoder delay (in samples) at 48kHz */
-
-    return 0;
-}
-
-static av_cold int libopus_decode_close(AVCodecContext *avc)
-{
-    struct libopus_context *opus = avc->priv_data;
-
-    opus_multistream_decoder_destroy(opus->dec);
-    return 0;
-}
-
-#define MAX_FRAME_SIZE (960 * 6)
-
-static int libopus_decode(AVCodecContext *avc, void *data,
-                          int *got_frame_ptr, AVPacket *pkt)
-{
-    struct libopus_context *opus = avc->priv_data;
-    AVFrame *frame               = data;
-    int ret, nb_samples;
-
-    frame->nb_samples = MAX_FRAME_SIZE;
-    ret = ff_get_buffer(avc, frame, 0);
-    if (ret < 0) {
-        av_log(avc, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (avc->sample_fmt == AV_SAMPLE_FMT_S16)
-        nb_samples = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
-                                             (opus_int16 *)frame->data[0],
-                                             frame->nb_samples, 0);
-    else
-        nb_samples = opus_multistream_decode_float(opus->dec, pkt->data, pkt->size,
-                                                   (float *)frame->data[0],
-                                                   frame->nb_samples, 0);
-
-    if (nb_samples < 0) {
-        av_log(avc, AV_LOG_ERROR, "Decoding error: %s\n",
-               opus_strerror(nb_samples));
-        return ff_opus_error_to_averror(nb_samples);
-    }
-
-    frame->nb_samples = nb_samples;
-    *got_frame_ptr    = 1;
-
-    return pkt->size;
-}
-
-static void libopus_flush(AVCodecContext *avc)
-{
-    struct libopus_context *opus = avc->priv_data;
-
-    opus_multistream_decoder_ctl(opus->dec, OPUS_RESET_STATE);
-}
-
-AVCodec ff_libopus_decoder = {
-    .name           = "libopus",
-    .long_name      = NULL_IF_CONFIG_SMALL("libopus Opus"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_OPUS,
-    .priv_data_size = sizeof(struct libopus_context),
-    .init           = libopus_decode_init,
-    .close          = libopus_decode_close,
-    .decode         = libopus_decode,
-    .flush          = libopus_flush,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
-                                                     AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/libopusenc.c b/deps/libav/libavcodec/libopusenc.c
deleted file mode 100644
index 9af8bcd..0000000
--- a/deps/libav/libavcodec/libopusenc.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * Opus encoder using libopus
- * Copyright (c) 2012 Nathan Caldwell
- *
- * This file is part of libav.
- *
- * libav 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.
- *
- * libav 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 libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <opus.h>
-#include <opus_multistream.h>
-
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "libopus.h"
-#include "vorbis.h"
-#include "audio_frame_queue.h"
-
-typedef struct LibopusEncOpts {
-    int vbr;
-    int application;
-    int packet_loss;
-    int complexity;
-    float frame_duration;
-    int packet_size;
-    int max_bandwidth;
-} LibopusEncOpts;
-
-typedef struct LibopusEncContext {
-    AVClass *class;
-    OpusMSEncoder *enc;
-    int stream_count;
-    uint8_t *samples;
-    LibopusEncOpts opts;
-    AudioFrameQueue afq;
-} LibopusEncContext;
-
-static const uint8_t opus_coupled_streams[8] = {
-    0, 1, 1, 2, 2, 2, 2, 3
-};
-
-/* Opus internal to Vorbis channel order mapping written in the header */
-static const uint8_t opus_vorbis_channel_map[8][8] = {
-    { 0 },
-    { 0, 1 },
-    { 0, 2, 1 },
-    { 0, 1, 2, 3 },
-    { 0, 4, 1, 2, 3 },
-    { 0, 4, 1, 2, 3, 5 },
-    { 0, 4, 1, 2, 3, 5, 6 },
-    { 0, 6, 1, 2, 3, 4, 5, 7 },
-};
-
-/* libav to libopus channel order mapping, passed to libopus */
-static const uint8_t libav_libopus_channel_map[8][8] = {
-    { 0 },
-    { 0, 1 },
-    { 0, 1, 2 },
-    { 0, 1, 2, 3 },
-    { 0, 1, 3, 4, 2 },
-    { 0, 1, 4, 5, 2, 3 },
-    { 0, 1, 5, 6, 2, 4, 3 },
-    { 0, 1, 6, 7, 4, 5, 2, 3 },
-};
-
-static void libopus_write_header(AVCodecContext *avctx, int stream_count,
-                                 int coupled_stream_count,
-                                 const uint8_t *channel_mapping)
-{
-    uint8_t *p   = avctx->extradata;
-    int channels = avctx->channels;
-
-    bytestream_put_buffer(&p, "OpusHead", 8);
-    bytestream_put_byte(&p, 1); /* Version */
-    bytestream_put_byte(&p, channels);
-    bytestream_put_le16(&p, avctx->delay); /* Lookahead samples at 48kHz */
-    bytestream_put_le32(&p, avctx->sample_rate); /* Original sample rate */
-    bytestream_put_le16(&p, 0); /* Gain of 0dB is recommended. */
-
-    /* Channel mapping */
-    if (channels > 2) {
-        bytestream_put_byte(&p, channels <= 8 ? 1 : 255);
-        bytestream_put_byte(&p, stream_count);
-        bytestream_put_byte(&p, coupled_stream_count);
-        bytestream_put_buffer(&p, channel_mapping, channels);
-    } else {
-        bytestream_put_byte(&p, 0);
-    }
-}
-
-static int libopus_configure_encoder(AVCodecContext *avctx, OpusMSEncoder *enc,
-                                     LibopusEncOpts *opts)
-{
-    int ret;
-
-    ret = opus_multistream_encoder_ctl(enc, OPUS_SET_BITRATE(avctx->bit_rate));
-    if (ret != OPUS_OK) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Failed to set bitrate: %s\n", opus_strerror(ret));
-        return ret;
-    }
-
-    ret = opus_multistream_encoder_ctl(enc,
-                                       OPUS_SET_COMPLEXITY(opts->complexity));
-    if (ret != OPUS_OK)
-        av_log(avctx, AV_LOG_WARNING,
-               "Unable to set complexity: %s\n", opus_strerror(ret));
-
-    ret = opus_multistream_encoder_ctl(enc, OPUS_SET_VBR(!!opts->vbr));
-    if (ret != OPUS_OK)
-        av_log(avctx, AV_LOG_WARNING,
-               "Unable to set VBR: %s\n", opus_strerror(ret));
-
-    ret = opus_multistream_encoder_ctl(enc,
-                                       OPUS_SET_VBR_CONSTRAINT(opts->vbr == 2));
-    if (ret != OPUS_OK)
-        av_log(avctx, AV_LOG_WARNING,
-               "Unable to set constrained VBR: %s\n", opus_strerror(ret));
-
-    ret = opus_multistream_encoder_ctl(enc,
-                                       OPUS_SET_PACKET_LOSS_PERC(opts->packet_loss));
-    if (ret != OPUS_OK)
-        av_log(avctx, AV_LOG_WARNING,
-               "Unable to set expected packet loss percentage: %s\n",
-               opus_strerror(ret));
-
-    if (avctx->cutoff) {
-        ret = opus_multistream_encoder_ctl(enc,
-                                           OPUS_SET_MAX_BANDWIDTH(opts->max_bandwidth));
-        if (ret != OPUS_OK)
-            av_log(avctx, AV_LOG_WARNING,
-                   "Unable to set maximum bandwidth: %s\n", opus_strerror(ret));
-    }
-
-    return OPUS_OK;
-}
-
-static int av_cold libopus_encode_init(AVCodecContext *avctx)
-{
-    LibopusEncContext *opus = avctx->priv_data;
-    const uint8_t *channel_mapping;
-    OpusMSEncoder *enc;
-    int ret = OPUS_OK;
-    int coupled_stream_count, header_size, frame_size;
-
-    coupled_stream_count = opus_coupled_streams[avctx->channels - 1];
-    opus->stream_count   = avctx->channels - coupled_stream_count;
-    channel_mapping      = libav_libopus_channel_map[avctx->channels - 1];
-
-    /* FIXME: Opus can handle up to 255 channels. However, the mapping for
-     * anything greater than 8 is undefined. */
-    if (avctx->channels > 8)
-        av_log(avctx, AV_LOG_WARNING,
-               "Channel layout undefined for %d channels.\n", avctx->channels);
-
-    if (!avctx->bit_rate) {
-        /* Sane default copied from opusenc */
-        avctx->bit_rate = 64000 * opus->stream_count +
-                          32000 * coupled_stream_count;
-        av_log(avctx, AV_LOG_WARNING,
-               "No bit rate set. Defaulting to %d bps.\n", avctx->bit_rate);
-    }
-
-    if (avctx->bit_rate < 500 || avctx->bit_rate > 256000 * avctx->channels) {
-        av_log(avctx, AV_LOG_ERROR, "The bit rate %d bps is unsupported. "
-               "Please choose a value between 500 and %d.\n", avctx->bit_rate,
-               256000 * avctx->channels);
-        return AVERROR(EINVAL);
-    }
-
-    frame_size = opus->opts.frame_duration * 48000 / 1000;
-    switch (frame_size) {
-    case 120:
-    case 240:
-        if (opus->opts.application != OPUS_APPLICATION_RESTRICTED_LOWDELAY)
-            av_log(avctx, AV_LOG_WARNING,
-                   "LPC mode cannot be used with a frame duration of less "
-                   "than 10ms. Enabling restricted low-delay mode.\n"
-                   "Use a longer frame duration if this is not what you want.\n");
-        /* Frame sizes less than 10 ms can only use MDCT mode, so switching to
-         * RESTRICTED_LOWDELAY avoids an unnecessary extra 2.5ms lookahead. */
-        opus->opts.application = OPUS_APPLICATION_RESTRICTED_LOWDELAY;
-    case 480:
-    case 960:
-    case 1920:
-    case 2880:
-        opus->opts.packet_size =
-        avctx->frame_size      = frame_size * avctx->sample_rate / 48000;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame duration: %g.\n"
-               "Frame duration must be exactly one of: 2.5, 5, 10, 20, 40 or 60.\n",
-               opus->opts.frame_duration);
-        return AVERROR(EINVAL);
-    }
-
-    if (avctx->compression_level < 0 || avctx->compression_level > 10) {
-        av_log(avctx, AV_LOG_WARNING,
-               "Compression level must be in the range 0 to 10. "
-               "Defaulting to 10.\n");
-        opus->opts.complexity = 10;
-    } else {
-        opus->opts.complexity = avctx->compression_level;
-    }
-
-    if (avctx->cutoff) {
-        switch (avctx->cutoff) {
-        case  4000:
-            opus->opts.max_bandwidth = OPUS_BANDWIDTH_NARROWBAND;
-            break;
-        case  6000:
-            opus->opts.max_bandwidth = OPUS_BANDWIDTH_MEDIUMBAND;
-            break;
-        case  8000:
-            opus->opts.max_bandwidth = OPUS_BANDWIDTH_WIDEBAND;
-            break;
-        case 12000:
-            opus->opts.max_bandwidth = OPUS_BANDWIDTH_SUPERWIDEBAND;
-            break;
-        case 20000:
-            opus->opts.max_bandwidth = OPUS_BANDWIDTH_FULLBAND;
-            break;
-        default:
-            av_log(avctx, AV_LOG_WARNING,
-                   "Invalid frequency cutoff: %d. Using default maximum bandwidth.\n"
-                   "Cutoff frequency must be exactly one of: 4000, 6000, 8000, 12000 or 20000.\n",
-                   avctx->cutoff);
-            avctx->cutoff = 0;
-        }
-    }
-
-    enc = opus_multistream_encoder_create(avctx->sample_rate, avctx->channels,
-                                          opus->stream_count,
-                                          coupled_stream_count,
-                                          channel_mapping,
-                                          opus->opts.application, &ret);
-    if (ret != OPUS_OK) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Failed to create encoder: %s\n", opus_strerror(ret));
-        return ff_opus_error_to_averror(ret);
-    }
-
-    ret = libopus_configure_encoder(avctx, enc, &opus->opts);
-    if (ret != OPUS_OK) {
-        ret = ff_opus_error_to_averror(ret);
-        goto fail;
-    }
-
-    header_size = 19 + (avctx->channels > 2 ? 2 + avctx->channels : 0);
-    avctx->extradata = av_malloc(header_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!avctx->extradata) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to allocate extradata.\n");
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-    avctx->extradata_size = header_size;
-
-    opus->samples = av_mallocz(frame_size * avctx->channels *
-                               av_get_bytes_per_sample(avctx->sample_fmt));
-    if (!opus->samples) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to allocate samples buffer.\n");
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    ret = opus_multistream_encoder_ctl(enc, OPUS_GET_LOOKAHEAD(&avctx->delay));
-    if (ret != OPUS_OK)
-        av_log(avctx, AV_LOG_WARNING,
-               "Unable to get number of lookahead samples: %s\n",
-               opus_strerror(ret));
-
-    libopus_write_header(avctx, opus->stream_count, coupled_stream_count,
-                         opus_vorbis_channel_map[avctx->channels - 1]);
-
-    ff_af_queue_init(avctx, &opus->afq);
-
-    opus->enc = enc;
-
-    return 0;
-
-fail:
-    opus_multistream_encoder_destroy(enc);
-    av_freep(&avctx->extradata);
-    return ret;
-}
-
-static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
-                          const AVFrame *frame, int *got_packet_ptr)
-{
-    LibopusEncContext *opus = avctx->priv_data;
-    const int sample_size   = avctx->channels *
-                              av_get_bytes_per_sample(avctx->sample_fmt);
-    uint8_t *audio;
-    int ret;
-
-    if (frame) {
-        ff_af_queue_add(&opus->afq, frame);
-        if (frame->nb_samples < opus->opts.packet_size) {
-            audio = opus->samples;
-            memcpy(audio, frame->data[0], frame->nb_samples * sample_size);
-        } else
-            audio = frame->data[0];
-    } else {
-        if (!opus->afq.remaining_samples)
-            return 0;
-        audio = opus->samples;
-        memset(audio, 0, opus->opts.packet_size * sample_size);
-    }
-
-    /* Maximum packet size taken from opusenc in opus-tools. 60ms packets
-     * consist of 3 frames in one packet. The maximum frame size is 1275
-     * bytes along with the largest possible packet header of 7 bytes. */
-    if (ret = ff_alloc_packet(avpkt, (1275 * 3 + 7) * opus->stream_count)) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT)
-        ret = opus_multistream_encode_float(opus->enc, (float *)audio,
-                                            opus->opts.packet_size,
-                                            avpkt->data, avpkt->size);
-    else
-        ret = opus_multistream_encode(opus->enc, (opus_int16 *)audio,
-                                      opus->opts.packet_size,
-                                      avpkt->data, avpkt->size);
-
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Error encoding frame: %s\n", opus_strerror(ret));
-        return ff_opus_error_to_averror(ret);
-    }
-
-    av_shrink_packet(avpkt, ret);
-
-    ff_af_queue_remove(&opus->afq, opus->opts.packet_size,
-                       &avpkt->pts, &avpkt->duration);
-
-    *got_packet_ptr = 1;
-
-    return 0;
-}
-
-static int av_cold libopus_encode_close(AVCodecContext *avctx)
-{
-    LibopusEncContext *opus = avctx->priv_data;
-
-    opus_multistream_encoder_destroy(opus->enc);
-
-    ff_af_queue_close(&opus->afq);
-
-    av_freep(&opus->samples);
-    av_freep(&avctx->extradata);
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(LibopusEncContext, opts.x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption libopus_options[] = {
-    { "application",    "Intended application type",           OFFSET(application),    AV_OPT_TYPE_INT,   { .i64 = OPUS_APPLICATION_AUDIO }, OPUS_APPLICATION_VOIP, OPUS_APPLICATION_RESTRICTED_LOWDELAY, FLAGS, "application" },
-        { "voip",           "Favor improved speech intelligibility",   0, AV_OPT_TYPE_CONST, { .i64 = OPUS_APPLICATION_VOIP },                0, 0, FLAGS, "application" },
-        { "audio",          "Favor faithfulness to the input",         0, AV_OPT_TYPE_CONST, { .i64 = OPUS_APPLICATION_AUDIO },               0, 0, FLAGS, "application" },
-        { "lowdelay",       "Restrict to only the lowest delay modes", 0, AV_OPT_TYPE_CONST, { .i64 = OPUS_APPLICATION_RESTRICTED_LOWDELAY }, 0, 0, FLAGS, "application" },
-    { "frame_duration", "Duration of a frame in milliseconds", OFFSET(frame_duration), AV_OPT_TYPE_FLOAT, { .dbl = 20.0 }, 2.5, 60.0, FLAGS },
-    { "packet_loss",    "Expected packet loss percentage",     OFFSET(packet_loss),    AV_OPT_TYPE_INT,   { .i64 = 0 },    0,   100,  FLAGS },
-    { "vbr",            "Variable bit rate mode",              OFFSET(vbr),            AV_OPT_TYPE_INT,   { .i64 = 1 },    0,   2,    FLAGS, "vbr" },
-        { "off",            "Use constant bit rate", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "vbr" },
-        { "on",             "Use variable bit rate", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "vbr" },
-        { "constrained",    "Use constrained VBR",   0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, FLAGS, "vbr" },
-    { NULL },
-};
-
-static const AVClass libopus_class = {
-    .class_name = "libopus",
-    .item_name  = av_default_item_name,
-    .option     = libopus_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVCodecDefault libopus_defaults[] = {
-    { "b",                 "0" },
-    { "compression_level", "10" },
-    { NULL },
-};
-
-static const int libopus_sample_rates[] = {
-    48000, 24000, 16000, 12000, 8000, 0,
-};
-
-AVCodec ff_libopus_encoder = {
-    .name            = "libopus",
-    .long_name       = NULL_IF_CONFIG_SMALL("libopus Opus"),
-    .type            = AVMEDIA_TYPE_AUDIO,
-    .id              = AV_CODEC_ID_OPUS,
-    .priv_data_size  = sizeof(LibopusEncContext),
-    .init            = libopus_encode_init,
-    .encode2         = libopus_encode,
-    .close           = libopus_encode_close,
-    .capabilities    = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
-    .sample_fmts     = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                      AV_SAMPLE_FMT_FLT,
-                                                      AV_SAMPLE_FMT_NONE },
-    .channel_layouts = ff_vorbis_channel_layouts,
-    .supported_samplerates = libopus_sample_rates,
-    .priv_class      = &libopus_class,
-    .defaults        = libopus_defaults,
-};
diff --git a/deps/libav/libavcodec/libschroedinger.c b/deps/libav/libavcodec/libschroedinger.c
deleted file mode 100644
index fc9188c..0000000
--- a/deps/libav/libavcodec/libschroedinger.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
-* @file
-* function definitions common to libschroedinger decoder and encoder
-*/
-
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-#include "libschroedinger.h"
-
-static const SchroVideoFormatInfo ff_schro_video_format_info[] = {
-    { 640,  480,  24000, 1001},
-    { 176,  120,  15000, 1001},
-    { 176,  144,  25,    2   },
-    { 352,  240,  15000, 1001},
-    { 352,  288,  25,    2   },
-    { 704,  480,  15000, 1001},
-    { 704,  576,  25,    2   },
-    { 720,  480,  30000, 1001},
-    { 720,  576,  25,    1   },
-    { 1280, 720,  60000, 1001},
-    { 1280, 720,  50,    1   },
-    { 1920, 1080, 30000, 1001},
-    { 1920, 1080, 25,    1   },
-    { 1920, 1080, 60000, 1001},
-    { 1920, 1080, 50,    1   },
-    { 2048, 1080, 24,    1   },
-    { 4096, 2160, 24,    1   },
-};
-
-static unsigned int get_video_format_idx(AVCodecContext *avctx)
-{
-    unsigned int ret_idx = 0;
-    unsigned int idx;
-    unsigned int num_formats = sizeof(ff_schro_video_format_info) /
-                               sizeof(ff_schro_video_format_info[0]);
-
-    for (idx = 1; idx < num_formats; ++idx) {
-        const SchroVideoFormatInfo *vf = &ff_schro_video_format_info[idx];
-        if (avctx->width  == vf->width &&
-            avctx->height == vf->height) {
-            ret_idx = idx;
-            if (avctx->time_base.den == vf->frame_rate_num &&
-                avctx->time_base.num == vf->frame_rate_denom)
-                return idx;
-        }
-    }
-    return ret_idx;
-}
-
-av_cold void ff_schro_queue_init(FFSchroQueue *queue)
-{
-    queue->p_head = queue->p_tail = NULL;
-    queue->size = 0;
-}
-
-void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *))
-{
-    while (queue->p_head)
-        free_func(ff_schro_queue_pop(queue));
-}
-
-int ff_schro_queue_push_back(FFSchroQueue *queue, void *p_data)
-{
-    FFSchroQueueElement *p_new = av_mallocz(sizeof(FFSchroQueueElement));
-
-    if (!p_new)
-        return -1;
-
-    p_new->data = p_data;
-
-    if (!queue->p_head)
-        queue->p_head = p_new;
-    else
-        queue->p_tail->next = p_new;
-    queue->p_tail = p_new;
-
-    ++queue->size;
-    return 0;
-}
-
-void *ff_schro_queue_pop(FFSchroQueue *queue)
-{
-    FFSchroQueueElement *top = queue->p_head;
-
-    if (top) {
-        void *data = top->data;
-        queue->p_head = queue->p_head->next;
-        --queue->size;
-        av_freep(&top);
-        return data;
-    }
-
-    return NULL;
-}
-
-/**
-* Schroedinger video preset table. Ensure that this tables matches up correctly
-* with the ff_schro_video_format_info table.
-*/
-static const SchroVideoFormatEnum ff_schro_video_formats[]={
-    SCHRO_VIDEO_FORMAT_CUSTOM     ,
-    SCHRO_VIDEO_FORMAT_QSIF       ,
-    SCHRO_VIDEO_FORMAT_QCIF       ,
-    SCHRO_VIDEO_FORMAT_SIF        ,
-    SCHRO_VIDEO_FORMAT_CIF        ,
-    SCHRO_VIDEO_FORMAT_4SIF       ,
-    SCHRO_VIDEO_FORMAT_4CIF       ,
-    SCHRO_VIDEO_FORMAT_SD480I_60  ,
-    SCHRO_VIDEO_FORMAT_SD576I_50  ,
-    SCHRO_VIDEO_FORMAT_HD720P_60  ,
-    SCHRO_VIDEO_FORMAT_HD720P_50  ,
-    SCHRO_VIDEO_FORMAT_HD1080I_60 ,
-    SCHRO_VIDEO_FORMAT_HD1080I_50 ,
-    SCHRO_VIDEO_FORMAT_HD1080P_60 ,
-    SCHRO_VIDEO_FORMAT_HD1080P_50 ,
-    SCHRO_VIDEO_FORMAT_DC2K_24    ,
-    SCHRO_VIDEO_FORMAT_DC4K_24    ,
-};
-
-SchroVideoFormatEnum ff_get_schro_video_format_preset(AVCodecContext *avctx)
-{
-    unsigned int num_formats = sizeof(ff_schro_video_formats) /
-                               sizeof(ff_schro_video_formats[0]);
-
-    unsigned int idx = get_video_format_idx(avctx);
-
-    return (idx < num_formats) ? ff_schro_video_formats[idx] :
-                                 SCHRO_VIDEO_FORMAT_CUSTOM;
-}
-
-int ff_get_schro_frame_format (SchroChromaFormat schro_pix_fmt,
-                               SchroFrameFormat  *schro_frame_fmt)
-{
-    unsigned int num_formats = sizeof(schro_pixel_format_map) /
-                               sizeof(schro_pixel_format_map[0]);
-
-    int idx;
-
-    for (idx = 0; idx < num_formats; ++idx) {
-        if (schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt) {
-            *schro_frame_fmt = schro_pixel_format_map[idx].schro_frame_fmt;
-            return 0;
-        }
-    }
-    return -1;
-}
-
-static void free_schro_frame(SchroFrame *frame, void *priv)
-{
-    AVPicture *p_pic = priv;
-
-    if (!p_pic)
-        return;
-
-    avpicture_free(p_pic);
-    av_freep(&p_pic);
-}
-
-SchroFrame *ff_create_schro_frame(AVCodecContext *avctx,
-                                  SchroFrameFormat schro_frame_fmt)
-{
-    AVPicture *p_pic;
-    SchroFrame *p_frame;
-    int y_width, uv_width;
-    int y_height, uv_height;
-    int i;
-
-    y_width   = avctx->width;
-    y_height  = avctx->height;
-    uv_width  = y_width  >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt));
-    uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));
-
-    p_pic = av_mallocz(sizeof(AVPicture));
-    avpicture_alloc(p_pic, avctx->pix_fmt, y_width, y_height);
-
-    p_frame         = schro_frame_new();
-    p_frame->format = schro_frame_fmt;
-    p_frame->width  = y_width;
-    p_frame->height = y_height;
-    schro_frame_set_free_callback(p_frame, free_schro_frame, (void *)p_pic);
-
-    for (i = 0; i < 3; ++i) {
-        p_frame->components[i].width  = i ? uv_width : y_width;
-        p_frame->components[i].stride = p_pic->linesize[i];
-        p_frame->components[i].height = i ? uv_height : y_height;
-        p_frame->components[i].length =
-                 p_frame->components[i].stride * p_frame->components[i].height;
-        p_frame->components[i].data   = p_pic->data[i];
-
-        if (i) {
-            p_frame->components[i].v_shift =
-                SCHRO_FRAME_FORMAT_V_SHIFT(p_frame->format);
-            p_frame->components[i].h_shift =
-                SCHRO_FRAME_FORMAT_H_SHIFT(p_frame->format);
-        }
-    }
-
-    return p_frame;
-}
diff --git a/deps/libav/libavcodec/libschroedinger.h b/deps/libav/libavcodec/libschroedinger.h
deleted file mode 100644
index 5481f92..0000000
--- a/deps/libav/libavcodec/libschroedinger.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
-* @file
-* data structures common to libschroedinger decoder and encoder
-*/
-
-#ifndef AVCODEC_LIBSCHROEDINGER_H
-#define AVCODEC_LIBSCHROEDINGER_H
-
-#include <schroedinger/schrobitstream.h>
-#include <schroedinger/schroframe.h>
-
-#include "avcodec.h"
-
-typedef struct SchroVideoFormatInfo {
-    uint16_t width;
-    uint16_t height;
-    uint16_t frame_rate_num;
-    uint16_t frame_rate_denom;
-} SchroVideoFormatInfo;
-
-/**
-* contains a single encoded frame returned from Dirac or Schroedinger
-*/
-typedef struct FFSchroEncodedFrame {
-    /** encoded frame data */
-    uint8_t *p_encbuf;
-
-    /** encoded frame size */
-    uint32_t size;
-
-    /** encoded frame number. Will be used as pts */
-    uint32_t frame_num;
-
-    /** key frame flag. 1 : is key frame , 0 : in not key frame */
-    uint16_t key_frame;
-} FFSchroEncodedFrame;
-
-/**
-* queue element
-*/
-typedef struct FFSchroQueueElement {
-    /** Data to be stored in queue*/
-    void *data;
-    /** Pointer to next element queue */
-    struct FFSchroQueueElement *next;
-} FFSchroQueueElement;
-
-
-/**
-* A simple queue implementation used in libschroedinger
-*/
-typedef struct FFSchroQueue {
-    /** Pointer to head of queue */
-    FFSchroQueueElement *p_head;
-    /** Pointer to tail of queue */
-    FFSchroQueueElement *p_tail;
-    /** Queue size*/
-    int size;
-} FFSchroQueue;
-
-/**
-* Initialise the queue
-*/
-void ff_schro_queue_init(FFSchroQueue *queue);
-
-/**
-* Add an element to the end of the queue
-*/
-int ff_schro_queue_push_back(FFSchroQueue *queue, void *p_data);
-
-/**
-* Return the first element in the queue
-*/
-void *ff_schro_queue_pop(FFSchroQueue *queue);
-
-/**
-* Free the queue resources. free_func is a function supplied by the caller to
-* free any resources allocated by the caller. The data field of the queue
-* element is passed to it.
-*/
-void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *));
-
-static const struct {
-    enum AVPixelFormat  ff_pix_fmt;
-    SchroChromaFormat schro_pix_fmt;
-    SchroFrameFormat  schro_frame_fmt;
-} schro_pixel_format_map[] = {
-    { AV_PIX_FMT_YUV420P, SCHRO_CHROMA_420, SCHRO_FRAME_FORMAT_U8_420 },
-    { AV_PIX_FMT_YUV422P, SCHRO_CHROMA_422, SCHRO_FRAME_FORMAT_U8_422 },
-    { AV_PIX_FMT_YUV444P, SCHRO_CHROMA_444, SCHRO_FRAME_FORMAT_U8_444 },
-};
-
-/**
-* Returns the video format preset matching the input video dimensions and
-* time base.
-*/
-SchroVideoFormatEnum ff_get_schro_video_format_preset (AVCodecContext *avctx);
-
-/**
-* Sets the Schroedinger frame format corresponding to the Schro chroma format
-* passed. Returns 0 on success, -1 on failure.
-*/
-int ff_get_schro_frame_format(SchroChromaFormat schro_chroma_fmt,
-                              SchroFrameFormat  *schro_frame_fmt);
-
-/**
-* Create a Schro frame based on the dimensions and frame format
-* passed. Returns a pointer to a frame on success, NULL on failure.
-*/
-SchroFrame *ff_create_schro_frame(AVCodecContext *avctx,
-                                  SchroFrameFormat schro_frame_fmt);
-
-#endif /* AVCODEC_LIBSCHROEDINGER_H */
diff --git a/deps/libav/libavcodec/libschroedingerdec.c b/deps/libav/libavcodec/libschroedingerdec.c
deleted file mode 100644
index 7e258e3..0000000
--- a/deps/libav/libavcodec/libschroedingerdec.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Dirac decoder support via Schroedinger libraries
- * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
-* @file
-* Dirac decoder support via libschroedinger-1.0 libraries. More details about
-* the Schroedinger project can be found at http://www.diracvideo.org/.
-* The library implements Dirac Specification Version 2.2.
-* (http://dirac.sourceforge.net/specification.html).
-*/
-
-#include <string.h>
-
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "libschroedinger.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-
-#include <schroedinger/schro.h>
-#include <schroedinger/schrodebug.h>
-#include <schroedinger/schrovideoformat.h>
-
-/** SchroFrame and Pts relation */
-typedef struct LibSchroFrameContext {
-     SchroFrame *frame;
-     int64_t pts;
-} LibSchroFrameContext;
-
-/** libschroedinger decoder private data */
-typedef struct SchroDecoderParams {
-    /** Schroedinger video format */
-    SchroVideoFormat *format;
-
-    /** Schroedinger frame format */
-    SchroFrameFormat frame_format;
-
-    /** decoder handle */
-    SchroDecoder* decoder;
-
-    /** queue storing decoded frames */
-    FFSchroQueue dec_frame_queue;
-
-    /** end of sequence signalled */
-    int eos_signalled;
-
-    /** end of sequence pulled */
-    int eos_pulled;
-} SchroDecoderParams;
-
-typedef struct SchroParseUnitContext {
-    const uint8_t *buf;
-    int           buf_size;
-} SchroParseUnitContext;
-
-
-static void libschroedinger_decode_buffer_free(SchroBuffer *schro_buf,
-                                               void *priv)
-{
-    av_freep(&priv);
-}
-
-static void parse_context_init(SchroParseUnitContext *parse_ctx,
-                               const uint8_t *buf, int buf_size)
-{
-    parse_ctx->buf           = buf;
-    parse_ctx->buf_size      = buf_size;
-}
-
-static SchroBuffer *find_next_parse_unit(SchroParseUnitContext *parse_ctx)
-{
-    SchroBuffer *enc_buf = NULL;
-    int next_pu_offset = 0;
-    unsigned char *in_buf;
-
-    if (parse_ctx->buf_size < 13 ||
-        parse_ctx->buf[0] != 'B' ||
-        parse_ctx->buf[1] != 'B' ||
-        parse_ctx->buf[2] != 'C' ||
-        parse_ctx->buf[3] != 'D')
-        return NULL;
-
-    next_pu_offset = (parse_ctx->buf[5] << 24) +
-                     (parse_ctx->buf[6] << 16) +
-                     (parse_ctx->buf[7] <<  8) +
-                      parse_ctx->buf[8];
-
-    if (next_pu_offset == 0 &&
-        SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE(parse_ctx->buf[4]))
-        next_pu_offset = 13;
-
-    if (next_pu_offset <= 0 || parse_ctx->buf_size < next_pu_offset)
-        return NULL;
-
-    in_buf = av_malloc(next_pu_offset);
-    if (!in_buf) {
-        av_log(parse_ctx, AV_LOG_ERROR, "Unable to allocate input buffer\n");
-        return NULL;
-    }
-
-    memcpy(in_buf, parse_ctx->buf, next_pu_offset);
-    enc_buf       = schro_buffer_new_with_data(in_buf, next_pu_offset);
-    enc_buf->free = libschroedinger_decode_buffer_free;
-    enc_buf->priv = in_buf;
-
-    parse_ctx->buf      += next_pu_offset;
-    parse_ctx->buf_size -= next_pu_offset;
-
-    return enc_buf;
-}
-
-/**
-* Returns Libav chroma format.
-*/
-static enum AVPixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt)
-{
-    int num_formats = sizeof(schro_pixel_format_map) /
-                      sizeof(schro_pixel_format_map[0]);
-    int idx;
-
-    for (idx = 0; idx < num_formats; ++idx)
-        if (schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt)
-            return schro_pixel_format_map[idx].ff_pix_fmt;
-    return AV_PIX_FMT_NONE;
-}
-
-static av_cold int libschroedinger_decode_init(AVCodecContext *avctx)
-{
-
-    SchroDecoderParams *p_schro_params = avctx->priv_data;
-    /* First of all, initialize our supporting libraries. */
-    schro_init();
-
-    schro_debug_set_level(avctx->debug);
-    p_schro_params->decoder = schro_decoder_new();
-    schro_decoder_set_skip_ratio(p_schro_params->decoder, 1);
-
-    if (!p_schro_params->decoder)
-        return -1;
-
-    /* Initialize the decoded frame queue. */
-    ff_schro_queue_init(&p_schro_params->dec_frame_queue);
-    return 0;
-}
-
-static void libschroedinger_decode_frame_free(void *frame)
-{
-    schro_frame_unref(frame);
-}
-
-static void libschroedinger_handle_first_access_unit(AVCodecContext *avctx)
-{
-    SchroDecoderParams *p_schro_params = avctx->priv_data;
-    SchroDecoder *decoder = p_schro_params->decoder;
-
-    p_schro_params->format = schro_decoder_get_video_format(decoder);
-
-    /* Tell Libav about sequence details. */
-    if (av_image_check_size(p_schro_params->format->width,
-                            p_schro_params->format->height, 0, avctx) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid dimensions (%dx%d)\n",
-               p_schro_params->format->width, p_schro_params->format->height);
-        avctx->height = avctx->width = 0;
-        return;
-    }
-    avctx->height  = p_schro_params->format->height;
-    avctx->width   = p_schro_params->format->width;
-    avctx->pix_fmt = get_chroma_format(p_schro_params->format->chroma_format);
-
-    if (ff_get_schro_frame_format(p_schro_params->format->chroma_format,
-                                  &p_schro_params->frame_format) == -1) {
-        av_log(avctx, AV_LOG_ERROR,
-               "This codec currently only supports planar YUV 4:2:0, 4:2:2 "
-               "and 4:4:4 formats.\n");
-        return;
-    }
-
-    avctx->time_base.den = p_schro_params->format->frame_rate_numerator;
-    avctx->time_base.num = p_schro_params->format->frame_rate_denominator;
-}
-
-static int libschroedinger_decode_frame(AVCodecContext *avctx,
-                                        void *data, int *got_frame,
-                                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    int64_t pts  = avpkt->pts;
-    SchroTag *tag;
-
-    SchroDecoderParams *p_schro_params = avctx->priv_data;
-    SchroDecoder *decoder = p_schro_params->decoder;
-    SchroBuffer *enc_buf;
-    SchroFrame* frame;
-    AVFrame *avframe = data;
-    int state;
-    int go = 1;
-    int outer = 1;
-    SchroParseUnitContext parse_ctx;
-    LibSchroFrameContext *framewithpts = NULL;
-
-    *got_frame = 0;
-
-    parse_context_init(&parse_ctx, buf, buf_size);
-    if (!buf_size) {
-        if (!p_schro_params->eos_signalled) {
-            state = schro_decoder_push_end_of_stream(decoder);
-            p_schro_params->eos_signalled = 1;
-        }
-    }
-
-    /* Loop through all the individual parse units in the input buffer */
-    do {
-        if ((enc_buf = find_next_parse_unit(&parse_ctx))) {
-            /* Set Schrotag with the pts to be recovered after decoding*/
-            enc_buf->tag = schro_tag_new(av_malloc(sizeof(int64_t)), av_free);
-            if (!enc_buf->tag->value) {
-                av_log(avctx, AV_LOG_ERROR, "Unable to allocate SchroTag\n");
-                return AVERROR(ENOMEM);
-            }
-            AV_WN(64, enc_buf->tag->value, pts);
-            /* Push buffer into decoder. */
-            if (SCHRO_PARSE_CODE_IS_PICTURE(enc_buf->data[4]) &&
-                SCHRO_PARSE_CODE_NUM_REFS(enc_buf->data[4]) > 0)
-                avctx->has_b_frames = 1;
-            state = schro_decoder_push(decoder, enc_buf);
-            if (state == SCHRO_DECODER_FIRST_ACCESS_UNIT)
-                libschroedinger_handle_first_access_unit(avctx);
-            go = 1;
-        } else
-            outer = 0;
-
-        while (go) {
-            /* Parse data and process result. */
-            state = schro_decoder_wait(decoder);
-            switch (state) {
-            case SCHRO_DECODER_FIRST_ACCESS_UNIT:
-                libschroedinger_handle_first_access_unit(avctx);
-                break;
-
-            case SCHRO_DECODER_NEED_BITS:
-                /* Need more input data - stop iterating over what we have. */
-                go = 0;
-                break;
-
-            case SCHRO_DECODER_NEED_FRAME:
-                /* Decoder needs a frame - create one and push it in. */
-                frame = ff_create_schro_frame(avctx,
-                                              p_schro_params->frame_format);
-                schro_decoder_add_output_picture(decoder, frame);
-                break;
-
-            case SCHRO_DECODER_OK:
-                /* Pull a frame out of the decoder. */
-                tag   = schro_decoder_get_picture_tag(decoder);
-                frame = schro_decoder_pull(decoder);
-
-                if (frame) {
-                    /* Add relation between schroframe and pts. */
-                    framewithpts = av_malloc(sizeof(LibSchroFrameContext));
-                    if (!framewithpts) {
-                        av_log(avctx, AV_LOG_ERROR, "Unable to allocate FrameWithPts\n");
-                        return AVERROR(ENOMEM);
-                    }
-                    framewithpts->frame = frame;
-                    framewithpts->pts   = AV_RN64(tag->value);
-                    ff_schro_queue_push_back(&p_schro_params->dec_frame_queue,
-                                             framewithpts);
-                }
-                break;
-            case SCHRO_DECODER_EOS:
-                go = 0;
-                p_schro_params->eos_pulled = 1;
-                schro_decoder_reset(decoder);
-                outer = 0;
-                break;
-
-            case SCHRO_DECODER_ERROR:
-                return -1;
-                break;
-            }
-        }
-    } while (outer);
-
-    /* Grab next frame to be returned from the top of the queue. */
-    framewithpts = ff_schro_queue_pop(&p_schro_params->dec_frame_queue);
-
-    if (framewithpts && framewithpts->frame) {
-        if (ff_get_buffer(avctx, avframe, 0) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Unable to allocate buffer\n");
-            return AVERROR(ENOMEM);
-        }
-
-        memcpy(avframe->data[0],
-               framewithpts->frame->components[0].data,
-               framewithpts->frame->components[0].length);
-
-        memcpy(avframe->data[1],
-               framewithpts->frame->components[1].data,
-               framewithpts->frame->components[1].length);
-
-        memcpy(avframe->data[2],
-               framewithpts->frame->components[2].data,
-               framewithpts->frame->components[2].length);
-
-        /* Fill frame with current buffer data from Schroedinger. */
-        avframe->pkt_pts = framewithpts->pts;
-        avframe->linesize[0] = framewithpts->frame->components[0].stride;
-        avframe->linesize[1] = framewithpts->frame->components[1].stride;
-        avframe->linesize[2] = framewithpts->frame->components[2].stride;
-
-        *got_frame      = 1;
-
-        /* Now free the frame resources. */
-        libschroedinger_decode_frame_free(framewithpts->frame);
-        av_free(framewithpts);
-    } else {
-        data       = NULL;
-        *got_frame = 0;
-    }
-    return buf_size;
-}
-
-
-static av_cold int libschroedinger_decode_close(AVCodecContext *avctx)
-{
-    SchroDecoderParams *p_schro_params = avctx->priv_data;
-    /* Free the decoder. */
-    schro_decoder_free(p_schro_params->decoder);
-    av_freep(&p_schro_params->format);
-
-    /* Free data in the output frame queue. */
-    ff_schro_queue_free(&p_schro_params->dec_frame_queue,
-                        libschroedinger_decode_frame_free);
-
-    return 0;
-}
-
-static void libschroedinger_flush(AVCodecContext *avctx)
-{
-    /* Got a seek request. Free the decoded frames queue and then reset
-     * the decoder */
-    SchroDecoderParams *p_schro_params = avctx->priv_data;
-
-    /* Free data in the output frame queue. */
-    ff_schro_queue_free(&p_schro_params->dec_frame_queue,
-                        libschroedinger_decode_frame_free);
-
-    ff_schro_queue_init(&p_schro_params->dec_frame_queue);
-    schro_decoder_reset(p_schro_params->decoder);
-    p_schro_params->eos_pulled = 0;
-    p_schro_params->eos_signalled = 0;
-}
-
-AVCodec ff_libschroedinger_decoder = {
-    .name           = "libschroedinger",
-    .long_name      = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DIRAC,
-    .priv_data_size = sizeof(SchroDecoderParams),
-    .init           = libschroedinger_decode_init,
-    .close          = libschroedinger_decode_close,
-    .decode         = libschroedinger_decode_frame,
-    .capabilities   = CODEC_CAP_DELAY,
-    .flush          = libschroedinger_flush,
-};
diff --git a/deps/libav/libavcodec/libschroedingerenc.c b/deps/libav/libavcodec/libschroedingerenc.c
deleted file mode 100644
index 3dc1481..0000000
--- a/deps/libav/libavcodec/libschroedingerenc.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * Dirac encoder support via Schroedinger libraries
- * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
-* @file
-* Dirac encoder support via libschroedinger-1.0 libraries. More details about
-* the Schroedinger project can be found at http://www.diracvideo.org/.
-* The library implements Dirac Specification Version 2.2
-* (http://dirac.sourceforge.net/specification.html).
-*/
-
-#include <schroedinger/schro.h>
-#include <schroedinger/schrodebug.h>
-#include <schroedinger/schrovideoformat.h>
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "libschroedinger.h"
-#include "bytestream.h"
-
-
-/** libschroedinger encoder private data */
-typedef struct SchroEncoderParams {
-    /** Schroedinger video format */
-    SchroVideoFormat *format;
-
-    /** Schroedinger frame format */
-    SchroFrameFormat frame_format;
-
-    /** frame size */
-    int frame_size;
-
-    /** Schroedinger encoder handle*/
-    SchroEncoder* encoder;
-
-    /** buffer to store encoder output before writing it to the frame queue*/
-    unsigned char *enc_buf;
-
-    /** Size of encoder buffer*/
-    int enc_buf_size;
-
-    /** queue storing encoded frames */
-    FFSchroQueue enc_frame_queue;
-
-    /** end of sequence signalled */
-    int eos_signalled;
-
-    /** end of sequence pulled */
-    int eos_pulled;
-
-    /* counter for frames submitted to encoder, used as dts */
-    int64_t dts;
-} SchroEncoderParams;
-
-/**
-* Works out Schro-compatible chroma format.
-*/
-static int set_chroma_format(AVCodecContext *avctx)
-{
-    int num_formats = sizeof(schro_pixel_format_map) /
-                      sizeof(schro_pixel_format_map[0]);
-    int idx;
-
-    SchroEncoderParams *p_schro_params = avctx->priv_data;
-
-    for (idx = 0; idx < num_formats; ++idx) {
-        if (schro_pixel_format_map[idx].ff_pix_fmt == avctx->pix_fmt) {
-            p_schro_params->format->chroma_format =
-                            schro_pixel_format_map[idx].schro_pix_fmt;
-            return 0;
-        }
-    }
-
-    av_log(avctx, AV_LOG_ERROR,
-           "This codec currently only supports planar YUV 4:2:0, 4:2:2"
-           " and 4:4:4 formats.\n");
-
-    return -1;
-}
-
-static av_cold int libschroedinger_encode_init(AVCodecContext *avctx)
-{
-    SchroEncoderParams *p_schro_params = avctx->priv_data;
-    SchroVideoFormatEnum preset;
-
-    /* Initialize the libraries that libschroedinger depends on. */
-    schro_init();
-
-    /* Create an encoder object. */
-    p_schro_params->encoder = schro_encoder_new();
-
-    if (!p_schro_params->encoder) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Unrecoverable Error: schro_encoder_new failed. ");
-        return -1;
-    }
-
-    /* Initialize the format. */
-    preset = ff_get_schro_video_format_preset(avctx);
-    p_schro_params->format =
-                    schro_encoder_get_video_format(p_schro_params->encoder);
-    schro_video_format_set_std_video_format(p_schro_params->format, preset);
-    p_schro_params->format->width  = avctx->width;
-    p_schro_params->format->height = avctx->height;
-
-    if (set_chroma_format(avctx) == -1)
-        return -1;
-
-    if (avctx->color_primaries == AVCOL_PRI_BT709) {
-        p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_HDTV;
-    } else if (avctx->color_primaries == AVCOL_PRI_BT470BG) {
-        p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_625;
-    } else if (avctx->color_primaries == AVCOL_PRI_SMPTE170M) {
-        p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_525;
-    }
-
-    if (avctx->colorspace == AVCOL_SPC_BT709) {
-        p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_HDTV;
-    } else if (avctx->colorspace == AVCOL_SPC_BT470BG) {
-        p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_SDTV;
-    }
-
-    if (avctx->color_trc == AVCOL_TRC_BT709) {
-        p_schro_params->format->transfer_function = SCHRO_TRANSFER_CHAR_TV_GAMMA;
-    }
-
-    if (ff_get_schro_frame_format(p_schro_params->format->chroma_format,
-                                  &p_schro_params->frame_format) == -1) {
-        av_log(avctx, AV_LOG_ERROR,
-               "This codec currently supports only planar YUV 4:2:0, 4:2:2"
-               " and 4:4:4 formats.\n");
-        return -1;
-    }
-
-    p_schro_params->format->frame_rate_numerator   = avctx->time_base.den;
-    p_schro_params->format->frame_rate_denominator = avctx->time_base.num;
-
-    p_schro_params->frame_size = avpicture_get_size(avctx->pix_fmt,
-                                                    avctx->width,
-                                                    avctx->height);
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    if (!avctx->gop_size) {
-        schro_encoder_setting_set_double(p_schro_params->encoder,
-                                         "gop_structure",
-                                         SCHRO_ENCODER_GOP_INTRA_ONLY);
-
-        if (avctx->coder_type == FF_CODER_TYPE_VLC)
-            schro_encoder_setting_set_double(p_schro_params->encoder,
-                                             "enable_noarith", 1);
-    } else {
-        schro_encoder_setting_set_double(p_schro_params->encoder,
-                                         "au_distance", avctx->gop_size);
-        avctx->has_b_frames = 1;
-        p_schro_params->dts = -1;
-    }
-
-    /* FIXME - Need to handle SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY. */
-    if (avctx->flags & CODEC_FLAG_QSCALE) {
-        if (!avctx->global_quality) {
-            /* lossless coding */
-            schro_encoder_setting_set_double(p_schro_params->encoder,
-                                             "rate_control",
-                                             SCHRO_ENCODER_RATE_CONTROL_LOSSLESS);
-        } else {
-            int quality;
-            schro_encoder_setting_set_double(p_schro_params->encoder,
-                                             "rate_control",
-                                             SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY);
-
-            quality = avctx->global_quality / FF_QP2LAMBDA;
-            if (quality > 10)
-                quality = 10;
-            schro_encoder_setting_set_double(p_schro_params->encoder,
-                                             "quality", quality);
-        }
-    } else {
-        schro_encoder_setting_set_double(p_schro_params->encoder,
-                                         "rate_control",
-                                         SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE);
-
-        schro_encoder_setting_set_double(p_schro_params->encoder,
-                                         "bitrate", avctx->bit_rate);
-    }
-
-    if (avctx->flags & CODEC_FLAG_INTERLACED_ME)
-        /* All material can be coded as interlaced or progressive
-           irrespective of the type of source material. */
-        schro_encoder_setting_set_double(p_schro_params->encoder,
-                                         "interlaced_coding", 1);
-
-    schro_encoder_setting_set_double(p_schro_params->encoder, "open_gop",
-                                     !(avctx->flags & CODEC_FLAG_CLOSED_GOP));
-
-    /* FIXME: Signal range hardcoded to 8-bit data until both libschroedinger
-     * and libdirac support other bit-depth data. */
-    schro_video_format_set_std_signal_range(p_schro_params->format,
-                                            SCHRO_SIGNAL_RANGE_8BIT_VIDEO);
-
-    /* Set the encoder format. */
-    schro_encoder_set_video_format(p_schro_params->encoder,
-                                   p_schro_params->format);
-
-    /* Set the debug level. */
-    schro_debug_set_level(avctx->debug);
-
-    schro_encoder_start(p_schro_params->encoder);
-
-    /* Initialize the encoded frame queue. */
-    ff_schro_queue_init(&p_schro_params->enc_frame_queue);
-    return 0;
-}
-
-static SchroFrame *libschroedinger_frame_from_data(AVCodecContext *avctx,
-                                                   const AVFrame *frame)
-{
-    SchroEncoderParams *p_schro_params = avctx->priv_data;
-    SchroFrame *in_frame;
-    /* Input line size may differ from what the codec supports. Especially
-     * when transcoding from one format to another. So use avpicture_layout
-     * to copy the frame. */
-    in_frame = ff_create_schro_frame(avctx, p_schro_params->frame_format);
-
-    if (in_frame)
-        avpicture_layout((const AVPicture *)frame, avctx->pix_fmt,
-                          avctx->width, avctx->height,
-                          in_frame->components[0].data,
-                          p_schro_params->frame_size);
-
-    return in_frame;
-}
-
-static void libschroedinger_free_frame(void *data)
-{
-    FFSchroEncodedFrame *enc_frame = data;
-
-    av_freep(&enc_frame->p_encbuf);
-    av_free(enc_frame);
-}
-
-static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                                        const AVFrame *frame, int *got_packet)
-{
-    int enc_size = 0;
-    SchroEncoderParams *p_schro_params = avctx->priv_data;
-    SchroEncoder *encoder = p_schro_params->encoder;
-    struct FFSchroEncodedFrame *p_frame_output = NULL;
-    int go = 1;
-    SchroBuffer *enc_buf;
-    int presentation_frame;
-    int parse_code;
-    int last_frame_in_sequence = 0;
-    int pkt_size, ret;
-
-    if (!frame) {
-        /* Push end of sequence if not already signalled. */
-        if (!p_schro_params->eos_signalled) {
-            schro_encoder_end_of_stream(encoder);
-            p_schro_params->eos_signalled = 1;
-        }
-    } else {
-        /* Allocate frame data to schro input buffer. */
-        SchroFrame *in_frame = libschroedinger_frame_from_data(avctx, frame);
-        /* Load next frame. */
-        schro_encoder_push_frame(encoder, in_frame);
-    }
-
-    if (p_schro_params->eos_pulled)
-        go = 0;
-
-    /* Now check to see if we have any output from the encoder. */
-    while (go) {
-        int err;
-        SchroStateEnum state;
-        state = schro_encoder_wait(encoder);
-        switch (state) {
-        case SCHRO_STATE_HAVE_BUFFER:
-        case SCHRO_STATE_END_OF_STREAM:
-            enc_buf = schro_encoder_pull(encoder, &presentation_frame);
-            if (enc_buf->length <= 0)
-                return AVERROR_BUG;
-            parse_code = enc_buf->data[4];
-
-            /* All non-frame data is prepended to actual frame data to
-             * be able to set the pts correctly. So we don't write data
-             * to the frame output queue until we actually have a frame
-             */
-            if ((err = av_reallocp(&p_schro_params->enc_buf,
-                                   p_schro_params->enc_buf_size +
-                                   enc_buf->length)) < 0) {
-                p_schro_params->enc_buf_size = 0;
-                return err;
-            }
-
-            memcpy(p_schro_params->enc_buf + p_schro_params->enc_buf_size,
-                   enc_buf->data, enc_buf->length);
-            p_schro_params->enc_buf_size += enc_buf->length;
-
-
-            if (state == SCHRO_STATE_END_OF_STREAM) {
-                p_schro_params->eos_pulled = 1;
-                go = 0;
-            }
-
-            if (!SCHRO_PARSE_CODE_IS_PICTURE(parse_code)) {
-                schro_buffer_unref(enc_buf);
-                break;
-            }
-
-            /* Create output frame. */
-            p_frame_output = av_mallocz(sizeof(FFSchroEncodedFrame));
-            /* Set output data. */
-            p_frame_output->size     = p_schro_params->enc_buf_size;
-            p_frame_output->p_encbuf = p_schro_params->enc_buf;
-            if (SCHRO_PARSE_CODE_IS_INTRA(parse_code) &&
-                SCHRO_PARSE_CODE_IS_REFERENCE(parse_code))
-                p_frame_output->key_frame = 1;
-
-            /* Parse the coded frame number from the bitstream. Bytes 14
-             * through 17 represesent the frame number. */
-            p_frame_output->frame_num = AV_RB32(enc_buf->data + 13);
-
-            ff_schro_queue_push_back(&p_schro_params->enc_frame_queue,
-                                     p_frame_output);
-            p_schro_params->enc_buf_size = 0;
-            p_schro_params->enc_buf      = NULL;
-
-            schro_buffer_unref(enc_buf);
-
-            break;
-
-        case SCHRO_STATE_NEED_FRAME:
-            go = 0;
-            break;
-
-        case SCHRO_STATE_AGAIN:
-            break;
-
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unknown Schro Encoder state\n");
-            return -1;
-        }
-    }
-
-    /* Copy 'next' frame in queue. */
-
-    if (p_schro_params->enc_frame_queue.size == 1 &&
-        p_schro_params->eos_pulled)
-        last_frame_in_sequence = 1;
-
-    p_frame_output = ff_schro_queue_pop(&p_schro_params->enc_frame_queue);
-
-    if (!p_frame_output)
-        return 0;
-
-    pkt_size = p_frame_output->size;
-    if (last_frame_in_sequence && p_schro_params->enc_buf_size > 0)
-        pkt_size += p_schro_params->enc_buf_size;
-    if ((ret = ff_alloc_packet(pkt, pkt_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", pkt_size);
-        goto error;
-    }
-
-    memcpy(pkt->data, p_frame_output->p_encbuf, p_frame_output->size);
-    avctx->coded_frame->key_frame = p_frame_output->key_frame;
-    /* Use the frame number of the encoded frame as the pts. It is OK to
-     * do so since Dirac is a constant frame rate codec. It expects input
-     * to be of constant frame rate. */
-    pkt->pts =
-    avctx->coded_frame->pts = p_frame_output->frame_num;
-    pkt->dts = p_schro_params->dts++;
-    enc_size = p_frame_output->size;
-
-    /* Append the end of sequence information to the last frame in the
-     * sequence. */
-    if (last_frame_in_sequence && p_schro_params->enc_buf_size > 0) {
-        memcpy(pkt->data + enc_size, p_schro_params->enc_buf,
-               p_schro_params->enc_buf_size);
-        enc_size += p_schro_params->enc_buf_size;
-        av_freep(&p_schro_params->enc_buf);
-        p_schro_params->enc_buf_size = 0;
-    }
-
-    if (p_frame_output->key_frame)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-error:
-    /* free frame */
-    libschroedinger_free_frame(p_frame_output);
-    return ret;
-}
-
-
-static int libschroedinger_encode_close(AVCodecContext *avctx)
-{
-    SchroEncoderParams *p_schro_params = avctx->priv_data;
-
-    /* Close the encoder. */
-    schro_encoder_free(p_schro_params->encoder);
-
-    /* Free data in the output frame queue. */
-    ff_schro_queue_free(&p_schro_params->enc_frame_queue,
-                        libschroedinger_free_frame);
-
-
-    /* Free the encoder buffer. */
-    if (p_schro_params->enc_buf_size)
-        av_freep(&p_schro_params->enc_buf);
-
-    /* Free the video format structure. */
-    av_freep(&p_schro_params->format);
-
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-
-AVCodec ff_libschroedinger_encoder = {
-    .name           = "libschroedinger",
-    .long_name      = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_DIRAC,
-    .priv_data_size = sizeof(SchroEncoderParams),
-    .init           = libschroedinger_encode_init,
-    .encode2        = libschroedinger_encode_frame,
-    .close          = libschroedinger_encode_close,
-    .capabilities   = CODEC_CAP_DELAY,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/libspeexdec.c b/deps/libav/libavcodec/libspeexdec.c
deleted file mode 100644
index d00696e..0000000
--- a/deps/libav/libavcodec/libspeexdec.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (C) 2008 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <speex/speex.h>
-#include <speex/speex_header.h>
-#include <speex/speex_stereo.h>
-#include <speex/speex_callbacks.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "internal.h"
-
-typedef struct {
-    SpeexBits bits;
-    SpeexStereoState stereo;
-    void *dec_state;
-    int frame_size;
-} LibSpeexContext;
-
-
-static av_cold int libspeex_decode_init(AVCodecContext *avctx)
-{
-    LibSpeexContext *s = avctx->priv_data;
-    const SpeexMode *mode;
-    SpeexHeader *header = NULL;
-    int spx_mode;
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-    if (avctx->extradata && avctx->extradata_size >= 80) {
-        header = speex_packet_to_header(avctx->extradata,
-                                        avctx->extradata_size);
-        if (!header)
-            av_log(avctx, AV_LOG_WARNING, "Invalid Speex header\n");
-    }
-    if (header) {
-        avctx->channels    = header->nb_channels;
-        spx_mode           = header->mode;
-        speex_header_free(header);
-    } else {
-        switch (avctx->sample_rate) {
-        case 8000:  spx_mode = 0; break;
-        case 16000: spx_mode = 1; break;
-        case 32000: spx_mode = 2; break;
-        default:
-            /* libspeex can handle any mode if initialized as ultra-wideband */
-            av_log(avctx, AV_LOG_WARNING, "Invalid sample rate: %d\n"
-                                          "Decoding as 32kHz ultra-wideband\n",
-                                          avctx->sample_rate);
-            spx_mode = 2;
-        }
-    }
-
-    mode = speex_lib_get_mode(spx_mode);
-    if (!mode) {
-        av_log(avctx, AV_LOG_ERROR, "Unknown Speex mode %d", spx_mode);
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->sample_rate = 8000 << spx_mode;
-    s->frame_size      =  160 << spx_mode;
-
-    if (avctx->channels < 1 || avctx->channels > 2) {
-        /* libspeex can handle mono or stereo if initialized as stereo */
-        av_log(avctx, AV_LOG_ERROR, "Invalid channel count: %d.\n"
-                                    "Decoding as stereo.\n", avctx->channels);
-        avctx->channels = 2;
-    }
-    avctx->channel_layout = avctx->channels == 2 ? AV_CH_LAYOUT_STEREO :
-                                                   AV_CH_LAYOUT_MONO;
-
-    speex_bits_init(&s->bits);
-    s->dec_state = speex_decoder_init(mode);
-    if (!s->dec_state) {
-        av_log(avctx, AV_LOG_ERROR, "Error initializing libspeex decoder.\n");
-        return -1;
-    }
-
-    if (avctx->channels == 2) {
-        SpeexCallback callback;
-        callback.callback_id = SPEEX_INBAND_STEREO;
-        callback.func = speex_std_stereo_request_handler;
-        callback.data = &s->stereo;
-        s->stereo = (SpeexStereoState)SPEEX_STEREO_STATE_INIT;
-        speex_decoder_ctl(s->dec_state, SPEEX_SET_HANDLER, &callback);
-    }
-
-    return 0;
-}
-
-static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
-                                 int *got_frame_ptr, AVPacket *avpkt)
-{
-    uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    LibSpeexContext *s = avctx->priv_data;
-    AVFrame *frame     = data;
-    int16_t *output;
-    int ret, consumed = 0;
-
-    /* get output buffer */
-    frame->nb_samples = s->frame_size;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    output = (int16_t *)frame->data[0];
-
-    /* if there is not enough data left for the smallest possible frame or the
-       next 5 bits are a terminator code, reset the libspeex buffer using the
-       current packet, otherwise ignore the current packet and keep decoding
-       frames from the libspeex buffer. */
-    if (speex_bits_remaining(&s->bits) < 5 ||
-        speex_bits_peek_unsigned(&s->bits, 5) == 0xF) {
-        /* check for flush packet */
-        if (!buf || !buf_size) {
-            *got_frame_ptr = 0;
-            return buf_size;
-        }
-        /* set new buffer */
-        speex_bits_read_from(&s->bits, buf, buf_size);
-        consumed = buf_size;
-    }
-
-    /* decode a single frame */
-    ret = speex_decode_int(s->dec_state, &s->bits, output);
-    if (ret <= -2) {
-        av_log(avctx, AV_LOG_ERROR, "Error decoding Speex frame.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (avctx->channels == 2)
-        speex_decode_stereo_int(output, s->frame_size, &s->stereo);
-
-    *got_frame_ptr = 1;
-
-    return consumed;
-}
-
-static av_cold int libspeex_decode_close(AVCodecContext *avctx)
-{
-    LibSpeexContext *s = avctx->priv_data;
-
-    speex_bits_destroy(&s->bits);
-    speex_decoder_destroy(s->dec_state);
-
-    return 0;
-}
-
-static av_cold void libspeex_decode_flush(AVCodecContext *avctx)
-{
-    LibSpeexContext *s = avctx->priv_data;
-    speex_bits_reset(&s->bits);
-}
-
-AVCodec ff_libspeex_decoder = {
-    .name           = "libspeex",
-    .long_name      = NULL_IF_CONFIG_SMALL("libspeex Speex"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_SPEEX,
-    .priv_data_size = sizeof(LibSpeexContext),
-    .init           = libspeex_decode_init,
-    .close          = libspeex_decode_close,
-    .decode         = libspeex_decode_frame,
-    .flush          = libspeex_decode_flush,
-    .capabilities   = CODEC_CAP_SUBFRAMES | CODEC_CAP_DELAY | CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/libspeexenc.c b/deps/libav/libavcodec/libspeexenc.c
deleted file mode 100644
index 651d7ac..0000000
--- a/deps/libav/libavcodec/libspeexenc.c
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * Copyright (C) 2009 Justin Ruggles
- * Copyright (c) 2009 Xuggle Incorporated
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * libspeex Speex audio encoder
- *
- * Usage Guide
- * This explains the values that need to be set prior to initialization in
- * order to control various encoding parameters.
- *
- * Channels
- *     Speex only supports mono or stereo, so avctx->channels must be set to
- *     1 or 2.
- *
- * Sample Rate / Encoding Mode
- *     Speex has 3 modes, each of which uses a specific sample rate.
- *         narrowband     :  8 kHz
- *         wideband       : 16 kHz
- *         ultra-wideband : 32 kHz
- *     avctx->sample_rate must be set to one of these 3 values.  This will be
- *     used to set the encoding mode.
- *
- * Rate Control
- *     VBR mode is turned on by setting CODEC_FLAG_QSCALE in avctx->flags.
- *     avctx->global_quality is used to set the encoding quality.
- *     For CBR mode, avctx->bit_rate can be used to set the constant bitrate.
- *     Alternatively, the 'cbr_quality' option can be set from 0 to 10 to set
- *     a constant bitrate based on quality.
- *     For ABR mode, set avctx->bit_rate and set the 'abr' option to 1.
- *     Approx. Bitrate Range:
- *         narrowband     : 2400 - 25600 bps
- *         wideband       : 4000 - 43200 bps
- *         ultra-wideband : 4400 - 45200 bps
- *
- * Complexity
- *     Encoding complexity is controlled by setting avctx->compression_level.
- *     The valid range is 0 to 10.  A higher setting gives generally better
- *     quality at the expense of encoding speed.  This does not affect the
- *     bit rate.
- *
- * Frames-per-Packet
- *     The encoder defaults to using 1 frame-per-packet.  However, it is
- *     sometimes desirable to use multiple frames-per-packet to reduce the
- *     amount of container overhead.  This can be done by setting the
- *     'frames_per_packet' option to a value 1 to 8.
- *
- *
- * Optional features
- * Speex encoder supports several optional features, which can be useful
- * for some conditions.
- *
- * Voice Activity Detection
- *     When enabled, voice activity detection detects whether the audio
- *     being encoded is speech or silence/background noise. VAD is always
- *     implicitly activated when encoding in VBR, so the option is only useful
- *     in non-VBR operation. In this case, Speex detects non-speech periods and
- *     encodes them with just enough bits to reproduce the background noise.
- *
- * Discontinuous Transmission (DTX)
- *     DTX is an addition to VAD/VBR operation, that allows to stop transmitting
- *     completely when the background noise is stationary.
- *     In file-based operation only 5 bits are used for such frames.
- */
-
-#include <speex/speex.h>
-#include <speex/speex_header.h>
-#include <speex/speex_stereo.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "audio_frame_queue.h"
-
-typedef struct {
-    AVClass *class;             ///< AVClass for private options
-    SpeexBits bits;             ///< libspeex bitwriter context
-    SpeexHeader header;         ///< libspeex header struct
-    void *enc_state;            ///< libspeex encoder state
-    int frames_per_packet;      ///< number of frames to encode in each packet
-    float vbr_quality;          ///< VBR quality 0.0 to 10.0
-    int cbr_quality;            ///< CBR quality 0 to 10
-    int abr;                    ///< flag to enable ABR
-    int vad;                    ///< flag to enable VAD
-    int dtx;                    ///< flag to enable DTX
-    int pkt_frame_count;        ///< frame count for the current packet
-    AudioFrameQueue afq;        ///< frame queue
-} LibSpeexEncContext;
-
-static av_cold void print_enc_params(AVCodecContext *avctx,
-                                     LibSpeexEncContext *s)
-{
-    const char *mode_str = "unknown";
-
-    av_log(avctx, AV_LOG_DEBUG, "channels: %d\n", avctx->channels);
-    switch (s->header.mode) {
-    case SPEEX_MODEID_NB:  mode_str = "narrowband";     break;
-    case SPEEX_MODEID_WB:  mode_str = "wideband";       break;
-    case SPEEX_MODEID_UWB: mode_str = "ultra-wideband"; break;
-    }
-    av_log(avctx, AV_LOG_DEBUG, "mode: %s\n", mode_str);
-    if (s->header.vbr) {
-        av_log(avctx, AV_LOG_DEBUG, "rate control: VBR\n");
-        av_log(avctx, AV_LOG_DEBUG, "  quality: %f\n", s->vbr_quality);
-    } else if (s->abr) {
-        av_log(avctx, AV_LOG_DEBUG, "rate control: ABR\n");
-        av_log(avctx, AV_LOG_DEBUG, "  bitrate: %d bps\n", avctx->bit_rate);
-    } else {
-        av_log(avctx, AV_LOG_DEBUG, "rate control: CBR\n");
-        av_log(avctx, AV_LOG_DEBUG, "  bitrate: %d bps\n", avctx->bit_rate);
-    }
-    av_log(avctx, AV_LOG_DEBUG, "complexity: %d\n",
-           avctx->compression_level);
-    av_log(avctx, AV_LOG_DEBUG, "frame size: %d samples\n",
-           avctx->frame_size);
-    av_log(avctx, AV_LOG_DEBUG, "frames per packet: %d\n",
-           s->frames_per_packet);
-    av_log(avctx, AV_LOG_DEBUG, "packet size: %d\n",
-           avctx->frame_size * s->frames_per_packet);
-    av_log(avctx, AV_LOG_DEBUG, "voice activity detection: %d\n", s->vad);
-    av_log(avctx, AV_LOG_DEBUG, "discontinuous transmission: %d\n", s->dtx);
-}
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    LibSpeexEncContext *s = avctx->priv_data;
-    const SpeexMode *mode;
-    uint8_t *header_data;
-    int header_size;
-    int32_t complexity;
-
-    /* channels */
-    if (avctx->channels < 1 || avctx->channels > 2) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid channels (%d). Only stereo and "
-               "mono are supported\n", avctx->channels);
-        return AVERROR(EINVAL);
-    }
-
-    /* sample rate and encoding mode */
-    switch (avctx->sample_rate) {
-    case  8000: mode = &speex_nb_mode;  break;
-    case 16000: mode = &speex_wb_mode;  break;
-    case 32000: mode = &speex_uwb_mode; break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Sample rate of %d Hz is not supported. "
-               "Resample to 8, 16, or 32 kHz.\n", avctx->sample_rate);
-        return AVERROR(EINVAL);
-    }
-
-    /* initialize libspeex */
-    s->enc_state = speex_encoder_init(mode);
-    if (!s->enc_state) {
-        av_log(avctx, AV_LOG_ERROR, "Error initializing libspeex\n");
-        return -1;
-    }
-    speex_init_header(&s->header, avctx->sample_rate, avctx->channels, mode);
-
-    /* rate control method and parameters */
-    if (avctx->flags & CODEC_FLAG_QSCALE) {
-        /* VBR */
-        s->header.vbr = 1;
-        s->vad = 1; /* VAD is always implicitly activated for VBR */
-        speex_encoder_ctl(s->enc_state, SPEEX_SET_VBR, &s->header.vbr);
-        s->vbr_quality = av_clipf(avctx->global_quality / (float)FF_QP2LAMBDA,
-                                  0.0f, 10.0f);
-        speex_encoder_ctl(s->enc_state, SPEEX_SET_VBR_QUALITY, &s->vbr_quality);
-    } else {
-        s->header.bitrate = avctx->bit_rate;
-        if (avctx->bit_rate > 0) {
-            /* CBR or ABR by bitrate */
-            if (s->abr) {
-                speex_encoder_ctl(s->enc_state, SPEEX_SET_ABR,
-                                  &s->header.bitrate);
-                speex_encoder_ctl(s->enc_state, SPEEX_GET_ABR,
-                                  &s->header.bitrate);
-            } else {
-                speex_encoder_ctl(s->enc_state, SPEEX_SET_BITRATE,
-                                  &s->header.bitrate);
-                speex_encoder_ctl(s->enc_state, SPEEX_GET_BITRATE,
-                                  &s->header.bitrate);
-            }
-        } else {
-            /* CBR by quality */
-            speex_encoder_ctl(s->enc_state, SPEEX_SET_QUALITY,
-                              &s->cbr_quality);
-            speex_encoder_ctl(s->enc_state, SPEEX_GET_BITRATE,
-                              &s->header.bitrate);
-        }
-        /* stereo side information adds about 800 bps to the base bitrate */
-        /* TODO: this should be calculated exactly */
-        avctx->bit_rate = s->header.bitrate + (avctx->channels == 2 ? 800 : 0);
-    }
-
-    /* VAD is activated with VBR or can be turned on by itself */
-    if (s->vad)
-        speex_encoder_ctl(s->enc_state, SPEEX_SET_VAD, &s->vad);
-
-    /* Activiting Discontinuous Transmission */
-    if (s->dtx) {
-        speex_encoder_ctl(s->enc_state, SPEEX_SET_DTX, &s->dtx);
-        if (!(s->abr || s->vad || s->header.vbr))
-            av_log(avctx, AV_LOG_WARNING, "DTX is not much of use without ABR, VAD or VBR\n");
-    }
-
-    /* set encoding complexity */
-    if (avctx->compression_level > FF_COMPRESSION_DEFAULT) {
-        complexity = av_clip(avctx->compression_level, 0, 10);
-        speex_encoder_ctl(s->enc_state, SPEEX_SET_COMPLEXITY, &complexity);
-    }
-    speex_encoder_ctl(s->enc_state, SPEEX_GET_COMPLEXITY, &complexity);
-    avctx->compression_level = complexity;
-
-    /* set packet size */
-    avctx->frame_size = s->header.frame_size;
-    s->header.frames_per_packet = s->frames_per_packet;
-
-    /* set encoding delay */
-    speex_encoder_ctl(s->enc_state, SPEEX_GET_LOOKAHEAD, &avctx->delay);
-    ff_af_queue_init(avctx, &s->afq);
-
-    /* create header packet bytes from header struct */
-    /* note: libspeex allocates the memory for header_data, which is freed
-             below with speex_header_free() */
-    header_data = speex_header_to_packet(&s->header, &header_size);
-
-    /* allocate extradata and coded_frame */
-    avctx->extradata   = av_malloc(header_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!avctx->extradata) {
-        speex_header_free(header_data);
-        speex_encoder_destroy(s->enc_state);
-        av_log(avctx, AV_LOG_ERROR, "memory allocation error\n");
-        return AVERROR(ENOMEM);
-    }
-
-    /* copy header packet to extradata */
-    memcpy(avctx->extradata, header_data, header_size);
-    avctx->extradata_size = header_size;
-    speex_header_free(header_data);
-
-    /* init libspeex bitwriter */
-    speex_bits_init(&s->bits);
-
-    print_enc_params(avctx, s);
-    return 0;
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                        const AVFrame *frame, int *got_packet_ptr)
-{
-    LibSpeexEncContext *s = avctx->priv_data;
-    int16_t *samples      = frame ? (int16_t *)frame->data[0] : NULL;
-    int ret;
-
-    if (samples) {
-        /* encode Speex frame */
-        if (avctx->channels == 2)
-            speex_encode_stereo_int(samples, s->header.frame_size, &s->bits);
-        speex_encode_int(s->enc_state, samples, &s->bits);
-        s->pkt_frame_count++;
-        if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
-            return ret;
-    } else {
-        /* handle end-of-stream */
-        if (!s->pkt_frame_count)
-            return 0;
-        /* add extra terminator codes for unused frames in last packet */
-        while (s->pkt_frame_count < s->frames_per_packet) {
-            speex_bits_pack(&s->bits, 15, 5);
-            s->pkt_frame_count++;
-        }
-    }
-
-    /* write output if all frames for the packet have been encoded */
-    if (s->pkt_frame_count == s->frames_per_packet) {
-        s->pkt_frame_count = 0;
-        if ((ret = ff_alloc_packet(avpkt, speex_bits_nbytes(&s->bits)))) {
-            av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-            return ret;
-        }
-        ret = speex_bits_write(&s->bits, avpkt->data, avpkt->size);
-        speex_bits_reset(&s->bits);
-
-        /* Get the next frame pts/duration */
-        ff_af_queue_remove(&s->afq, s->frames_per_packet * avctx->frame_size,
-                           &avpkt->pts, &avpkt->duration);
-
-        avpkt->size = ret;
-        *got_packet_ptr = 1;
-        return 0;
-    }
-    return 0;
-}
-
-static av_cold int encode_close(AVCodecContext *avctx)
-{
-    LibSpeexEncContext *s = avctx->priv_data;
-
-    speex_bits_destroy(&s->bits);
-    speex_encoder_destroy(s->enc_state);
-
-    ff_af_queue_close(&s->afq);
-    av_freep(&avctx->extradata);
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(LibSpeexEncContext, x)
-#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "abr",               "Use average bit rate",                      OFFSET(abr),               AV_OPT_TYPE_INT, { .i64 = 0 }, 0,   1, AE },
-    { "cbr_quality",       "Set quality value (0 to 10) for CBR",       OFFSET(cbr_quality),       AV_OPT_TYPE_INT, { .i64 = 8 }, 0,  10, AE },
-    { "frames_per_packet", "Number of frames to encode in each packet", OFFSET(frames_per_packet), AV_OPT_TYPE_INT, { .i64 = 1 }, 1,   8, AE },
-    { "vad",               "Voice Activity Detection",                  OFFSET(vad),               AV_OPT_TYPE_INT, { .i64 = 0 }, 0,   1, AE },
-    { "dtx",               "Discontinuous Transmission",                OFFSET(dtx),               AV_OPT_TYPE_INT, { .i64 = 0 }, 0,   1, AE },
-    { NULL },
-};
-
-static const AVClass class = {
-    .class_name = "libspeex",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVCodecDefault defaults[] = {
-    { "b",                 "0" },
-    { "compression_level", "3" },
-    { NULL },
-};
-
-AVCodec ff_libspeex_encoder = {
-    .name           = "libspeex",
-    .long_name      = NULL_IF_CONFIG_SMALL("libspeex Speex"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_SPEEX,
-    .priv_data_size = sizeof(LibSpeexEncContext),
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = encode_close,
-    .capabilities   = CODEC_CAP_DELAY,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-    .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO,
-                                           AV_CH_LAYOUT_STEREO,
-                                           0 },
-    .supported_samplerates = (const int[]){ 8000, 16000, 32000, 0 },
-    .priv_class     = &class,
-    .defaults       = defaults,
-};
diff --git a/deps/libav/libavcodec/libtheoraenc.c b/deps/libav/libavcodec/libtheoraenc.c
deleted file mode 100644
index 75b0a16..0000000
--- a/deps/libav/libavcodec/libtheoraenc.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (c) 2006 Paul Richards <paul.richards at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Theora encoder using libtheora.
- * @author Paul Richards <paul.richards at gmail.com>
- *
- * A lot of this is copy / paste from other output codecs in
- * libavcodec or pure guesswork (or both).
- *
- * I have used t_ prefixes on variables which are libtheora types
- * and o_ prefixes on variables which are libogg types.
- */
-
-/* Libav includes */
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/log.h"
-#include "libavutil/base64.h"
-#include "avcodec.h"
-#include "internal.h"
-
-/* libtheora includes */
-#include <theora/theoraenc.h>
-
-typedef struct TheoraContext {
-    th_enc_ctx *t_state;
-    uint8_t    *stats;
-    int         stats_size;
-    int         stats_offset;
-    int         uv_hshift;
-    int         uv_vshift;
-    int         keyframe_mask;
-} TheoraContext;
-
-/** Concatenate an ogg_packet into the extradata. */
-static int concatenate_packet(unsigned int* offset,
-                              AVCodecContext* avc_context,
-                              const ogg_packet* packet)
-{
-    const char* message = NULL;
-    int newsize = avc_context->extradata_size + 2 + packet->bytes;
-    int err = AVERROR_INVALIDDATA;
-
-    if (packet->bytes < 0) {
-        message = "ogg_packet has negative size";
-    } else if (packet->bytes > 0xffff) {
-        message = "ogg_packet is larger than 65535 bytes";
-    } else if (newsize < avc_context->extradata_size) {
-        message = "extradata_size would overflow";
-    } else {
-        if ((err = av_reallocp(&avc_context->extradata, newsize)) < 0) {
-            avc_context->extradata_size = 0;
-            message = "av_realloc failed";
-        }
-    }
-    if (message) {
-        av_log(avc_context, AV_LOG_ERROR, "concatenate_packet failed: %s\n", message);
-        return err;
-    }
-
-    avc_context->extradata_size = newsize;
-    AV_WB16(avc_context->extradata + (*offset), packet->bytes);
-    *offset += 2;
-    memcpy(avc_context->extradata + (*offset), packet->packet, packet->bytes);
-    (*offset) += packet->bytes;
-    return 0;
-}
-
-static int get_stats(AVCodecContext *avctx, int eos)
-{
-#ifdef TH_ENCCTL_2PASS_OUT
-    TheoraContext *h = avctx->priv_data;
-    uint8_t *buf;
-    int bytes;
-
-    bytes = th_encode_ctl(h->t_state, TH_ENCCTL_2PASS_OUT, &buf, sizeof(buf));
-    if (bytes < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting first pass stats\n");
-        return -1;
-    }
-    if (!eos) {
-        h->stats = av_fast_realloc(h->stats, &h->stats_size,
-                                   h->stats_offset + bytes);
-        memcpy(h->stats + h->stats_offset, buf, bytes);
-        h->stats_offset += bytes;
-    } else {
-        int b64_size = AV_BASE64_SIZE(h->stats_offset);
-        // libtheora generates a summary header at the end
-        memcpy(h->stats, buf, bytes);
-        avctx->stats_out = av_malloc(b64_size);
-        av_base64_encode(avctx->stats_out, b64_size, h->stats, h->stats_offset);
-    }
-    return 0;
-#else
-    av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n");
-    return -1;
-#endif
-}
-
-// libtheora won't read the entire buffer we give it at once, so we have to
-// repeatedly submit it...
-static int submit_stats(AVCodecContext *avctx)
-{
-#ifdef TH_ENCCTL_2PASS_IN
-    TheoraContext *h = avctx->priv_data;
-    int bytes;
-    if (!h->stats) {
-        if (!avctx->stats_in) {
-            av_log(avctx, AV_LOG_ERROR, "No statsfile for second pass\n");
-            return -1;
-        }
-        h->stats_size = strlen(avctx->stats_in) * 3/4;
-        h->stats      = av_malloc(h->stats_size);
-        h->stats_size = av_base64_decode(h->stats, avctx->stats_in, h->stats_size);
-    }
-    while (h->stats_size - h->stats_offset > 0) {
-        bytes = th_encode_ctl(h->t_state, TH_ENCCTL_2PASS_IN,
-                              h->stats + h->stats_offset,
-                              h->stats_size - h->stats_offset);
-        if (bytes < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Error submitting stats\n");
-            return -1;
-        }
-        if (!bytes)
-            return 0;
-        h->stats_offset += bytes;
-    }
-    return 0;
-#else
-    av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n");
-    return -1;
-#endif
-}
-
-static av_cold int encode_init(AVCodecContext* avc_context)
-{
-    th_info t_info;
-    th_comment t_comment;
-    ogg_packet o_packet;
-    unsigned int offset;
-    TheoraContext *h = avc_context->priv_data;
-    uint32_t gop_size = avc_context->gop_size;
-
-    /* Set up the theora_info struct */
-    th_info_init(&t_info);
-    t_info.frame_width  = FFALIGN(avc_context->width,  16);
-    t_info.frame_height = FFALIGN(avc_context->height, 16);
-    t_info.pic_width    = avc_context->width;
-    t_info.pic_height   = avc_context->height;
-    t_info.pic_x        = 0;
-    t_info.pic_y        = 0;
-    /* Swap numerator and denominator as time_base in AVCodecContext gives the
-     * time period between frames, but theora_info needs the framerate.  */
-    t_info.fps_numerator   = avc_context->time_base.den;
-    t_info.fps_denominator = avc_context->time_base.num;
-    if (avc_context->sample_aspect_ratio.num) {
-        t_info.aspect_numerator   = avc_context->sample_aspect_ratio.num;
-        t_info.aspect_denominator = avc_context->sample_aspect_ratio.den;
-    } else {
-        t_info.aspect_numerator   = 1;
-        t_info.aspect_denominator = 1;
-    }
-
-    if (avc_context->color_primaries == AVCOL_PRI_BT470M)
-        t_info.colorspace = TH_CS_ITU_REC_470M;
-    else if (avc_context->color_primaries == AVCOL_PRI_BT470BG)
-        t_info.colorspace = TH_CS_ITU_REC_470BG;
-    else
-        t_info.colorspace = TH_CS_UNSPECIFIED;
-
-    if (avc_context->pix_fmt == AV_PIX_FMT_YUV420P)
-        t_info.pixel_fmt = TH_PF_420;
-    else if (avc_context->pix_fmt == AV_PIX_FMT_YUV422P)
-        t_info.pixel_fmt = TH_PF_422;
-    else if (avc_context->pix_fmt == AV_PIX_FMT_YUV444P)
-        t_info.pixel_fmt = TH_PF_444;
-    else {
-        av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n");
-        return -1;
-    }
-    av_pix_fmt_get_chroma_sub_sample(avc_context->pix_fmt,
-                                     &h->uv_hshift, &h->uv_vshift);
-
-    if (avc_context->flags & CODEC_FLAG_QSCALE) {
-        /* to be constant with the libvorbis implementation, clip global_quality to 0 - 10
-           Theora accepts a quality parameter p, which is:
-                * 0 <= p <=63
-                * an int value
-         */
-        t_info.quality        = av_clipf(avc_context->global_quality / (float)FF_QP2LAMBDA, 0, 10) * 6.3;
-        t_info.target_bitrate = 0;
-    } else {
-        t_info.target_bitrate = avc_context->bit_rate;
-        t_info.quality        = 0;
-    }
-
-    /* Now initialise libtheora */
-    h->t_state = th_encode_alloc(&t_info);
-    if (!h->t_state) {
-        av_log(avc_context, AV_LOG_ERROR, "theora_encode_init failed\n");
-        return -1;
-    }
-
-    h->keyframe_mask = (1 << t_info.keyframe_granule_shift) - 1;
-    /* Clear up theora_info struct */
-    th_info_clear(&t_info);
-
-    if (th_encode_ctl(h->t_state, TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE,
-                      &gop_size, sizeof(gop_size))) {
-        av_log(avc_context, AV_LOG_ERROR, "Error setting GOP size\n");
-        return -1;
-    }
-
-    // need to enable 2 pass (via TH_ENCCTL_2PASS_) before encoding headers
-    if (avc_context->flags & CODEC_FLAG_PASS1) {
-        if (get_stats(avc_context, 0))
-            return -1;
-    } else if (avc_context->flags & CODEC_FLAG_PASS2) {
-        if (submit_stats(avc_context))
-            return -1;
-    }
-
-    /*
-        Output first header packet consisting of theora
-        header, comment, and tables.
-
-        Each one is prefixed with a 16bit size, then they
-        are concatenated together into libavcodec's extradata.
-    */
-    offset = 0;
-
-    /* Headers */
-    th_comment_init(&t_comment);
-
-    while (th_encode_flushheader(h->t_state, &t_comment, &o_packet))
-        if (concatenate_packet(&offset, avc_context, &o_packet))
-            return -1;
-
-    th_comment_clear(&t_comment);
-
-    /* Set up the output AVFrame */
-    avc_context->coded_frame = av_frame_alloc();
-
-    return 0;
-}
-
-static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
-                        const AVFrame *frame, int *got_packet)
-{
-    th_ycbcr_buffer t_yuv_buffer;
-    TheoraContext *h = avc_context->priv_data;
-    ogg_packet o_packet;
-    int result, i, ret;
-
-    // EOS, finish and get 1st pass stats if applicable
-    if (!frame) {
-        th_encode_packetout(h->t_state, 1, &o_packet);
-        if (avc_context->flags & CODEC_FLAG_PASS1)
-            if (get_stats(avc_context, 1))
-                return -1;
-        return 0;
-    }
-
-    /* Copy planes to the theora yuv_buffer */
-    for (i = 0; i < 3; i++) {
-        t_yuv_buffer[i].width  = FFALIGN(avc_context->width,  16) >> (i && h->uv_hshift);
-        t_yuv_buffer[i].height = FFALIGN(avc_context->height, 16) >> (i && h->uv_vshift);
-        t_yuv_buffer[i].stride = frame->linesize[i];
-        t_yuv_buffer[i].data   = frame->data[i];
-    }
-
-    if (avc_context->flags & CODEC_FLAG_PASS2)
-        if (submit_stats(avc_context))
-            return -1;
-
-    /* Now call into theora_encode_YUVin */
-    result = th_encode_ycbcr_in(h->t_state, t_yuv_buffer);
-    if (result) {
-        const char* message;
-        switch (result) {
-        case -1:
-            message = "differing frame sizes";
-            break;
-        case TH_EINVAL:
-            message = "encoder is not ready or is finished";
-            break;
-        default:
-            message = "unknown reason";
-            break;
-        }
-        av_log(avc_context, AV_LOG_ERROR, "theora_encode_YUVin failed (%s) [%d]\n", message, result);
-        return -1;
-    }
-
-    if (avc_context->flags & CODEC_FLAG_PASS1)
-        if (get_stats(avc_context, 0))
-            return -1;
-
-    /* Pick up returned ogg_packet */
-    result = th_encode_packetout(h->t_state, 0, &o_packet);
-    switch (result) {
-    case 0:
-        /* No packet is ready */
-        return 0;
-    case 1:
-        /* Success, we have a packet */
-        break;
-    default:
-        av_log(avc_context, AV_LOG_ERROR, "theora_encode_packetout failed [%d]\n", result);
-        return -1;
-    }
-
-    /* Copy ogg_packet content out to buffer */
-    if ((ret = ff_alloc_packet(pkt, o_packet.bytes)) < 0) {
-        av_log(avc_context, AV_LOG_ERROR, "Error getting output packet of size %ld.\n", o_packet.bytes);
-        return ret;
-    }
-    memcpy(pkt->data, o_packet.packet, o_packet.bytes);
-
-    // HACK: assumes no encoder delay, this is true until libtheora becomes
-    // multithreaded (which will be disabled unless explicitly requested)
-    pkt->pts = pkt->dts = frame->pts;
-    avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask);
-    if (avc_context->coded_frame->key_frame)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int encode_close(AVCodecContext* avc_context)
-{
-    TheoraContext *h = avc_context->priv_data;
-
-    th_encode_free(h->t_state);
-    av_freep(&h->stats);
-    av_freep(&avc_context->coded_frame);
-    av_freep(&avc_context->stats_out);
-    av_freep(&avc_context->extradata);
-    avc_context->extradata_size = 0;
-
-    return 0;
-}
-
-/** AVCodec struct exposed to libavcodec */
-AVCodec ff_libtheora_encoder = {
-    .name           = "libtheora",
-    .long_name      = NULL_IF_CONFIG_SMALL("libtheora Theora"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_THEORA,
-    .priv_data_size = sizeof(TheoraContext),
-    .init           = encode_init,
-    .close          = encode_close,
-    .encode2        = encode_frame,
-    .capabilities   = CODEC_CAP_DELAY, // needed to get the statsfile summary
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/libvo-aacenc.c b/deps/libav/libavcodec/libvo-aacenc.c
deleted file mode 100644
index 9450792..0000000
--- a/deps/libav/libavcodec/libvo-aacenc.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * AAC encoder wrapper
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <vo-aacenc/voAAC.h>
-#include <vo-aacenc/cmnMemory.h>
-
-#include "avcodec.h"
-#include "audio_frame_queue.h"
-#include "internal.h"
-#include "mpeg4audio.h"
-
-#define FRAME_SIZE 1024
-#define ENC_DELAY  1600
-
-typedef struct AACContext {
-    VO_AUDIO_CODECAPI codec_api;
-    VO_HANDLE handle;
-    VO_MEM_OPERATOR mem_operator;
-    VO_CODEC_INIT_USERDATA user_data;
-    VO_PBYTE end_buffer;
-    AudioFrameQueue afq;
-    int last_frame;
-    int last_samples;
-} AACContext;
-
-
-static int aac_encode_close(AVCodecContext *avctx)
-{
-    AACContext *s = avctx->priv_data;
-
-    s->codec_api.Uninit(s->handle);
-    av_freep(&avctx->extradata);
-    ff_af_queue_close(&s->afq);
-    av_freep(&s->end_buffer);
-
-    return 0;
-}
-
-static av_cold int aac_encode_init(AVCodecContext *avctx)
-{
-    AACContext *s = avctx->priv_data;
-    AACENC_PARAM params = { 0 };
-    int index, ret;
-
-    avctx->frame_size = FRAME_SIZE;
-    avctx->delay      = ENC_DELAY;
-    s->last_frame     = 2;
-    ff_af_queue_init(avctx, &s->afq);
-
-    s->end_buffer = av_mallocz(avctx->frame_size * avctx->channels * 2);
-    if (!s->end_buffer) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-
-    voGetAACEncAPI(&s->codec_api);
-
-    s->mem_operator.Alloc = cmnMemAlloc;
-    s->mem_operator.Copy = cmnMemCopy;
-    s->mem_operator.Free = cmnMemFree;
-    s->mem_operator.Set = cmnMemSet;
-    s->mem_operator.Check = cmnMemCheck;
-    s->user_data.memflag = VO_IMF_USERMEMOPERATOR;
-    s->user_data.memData = &s->mem_operator;
-    s->codec_api.Init(&s->handle, VO_AUDIO_CodingAAC, &s->user_data);
-
-    params.sampleRate = avctx->sample_rate;
-    params.bitRate    = avctx->bit_rate;
-    params.nChannels  = avctx->channels;
-    params.adtsUsed   = !(avctx->flags & CODEC_FLAG_GLOBAL_HEADER);
-    if (s->codec_api.SetParam(s->handle, VO_PID_AAC_ENCPARAM, &params)
-        != VO_ERR_NONE) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to set encoding parameters\n");
-        ret = AVERROR(EINVAL);
-        goto error;
-    }
-
-    for (index = 0; index < 16; index++)
-        if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[index])
-            break;
-    if (index == 16) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n",
-                                    avctx->sample_rate);
-        ret = AVERROR(ENOSYS);
-        goto error;
-    }
-    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
-        avctx->extradata_size = 2;
-        avctx->extradata      = av_mallocz(avctx->extradata_size +
-                                           FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!avctx->extradata) {
-            ret = AVERROR(ENOMEM);
-            goto error;
-        }
-
-        avctx->extradata[0] = 0x02 << 3 | index >> 1;
-        avctx->extradata[1] = (index & 0x01) << 7 | avctx->channels << 3;
-    }
-    return 0;
-error:
-    aac_encode_close(avctx);
-    return ret;
-}
-
-static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                            const AVFrame *frame, int *got_packet_ptr)
-{
-    AACContext *s = avctx->priv_data;
-    VO_CODECBUFFER input = { 0 }, output = { 0 };
-    VO_AUDIO_OUTPUTINFO output_info = { { 0 } };
-    VO_PBYTE samples;
-    int ret;
-
-    /* handle end-of-stream small frame and flushing */
-    if (!frame) {
-        if (s->last_frame <= 0)
-            return 0;
-        if (s->last_samples > 0 && s->last_samples < ENC_DELAY - FRAME_SIZE) {
-            s->last_samples = 0;
-            s->last_frame--;
-        }
-        s->last_frame--;
-        memset(s->end_buffer, 0, 2 * avctx->channels * avctx->frame_size);
-        samples = s->end_buffer;
-    } else {
-        if (frame->nb_samples < avctx->frame_size) {
-            s->last_samples = frame->nb_samples;
-            memcpy(s->end_buffer, frame->data[0], 2 * avctx->channels * frame->nb_samples);
-            samples = s->end_buffer;
-        } else {
-            samples = (VO_PBYTE)frame->data[0];
-        }
-        /* add current frame to the queue */
-        if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
-            return ret;
-    }
-
-    if ((ret = ff_alloc_packet(avpkt, FFMAX(8192, 768 * avctx->channels)))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    input.Buffer  = samples;
-    input.Length  = 2 * avctx->channels * avctx->frame_size;
-    output.Buffer = avpkt->data;
-    output.Length = avpkt->size;
-
-    s->codec_api.SetInputData(s->handle, &input);
-    if (s->codec_api.GetOutputData(s->handle, &output, &output_info)
-        != VO_ERR_NONE) {
-        av_log(avctx, AV_LOG_ERROR, "Unable to encode frame\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* Get the next frame pts/duration */
-    ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
-                       &avpkt->duration);
-
-    avpkt->size = output.Length;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-AVCodec ff_libvo_aacenc_encoder = {
-    .name           = "libvo_aacenc",
-    .long_name      = NULL_IF_CONFIG_SMALL("Android VisualOn AAC (Advanced Audio Coding)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AAC,
-    .priv_data_size = sizeof(AACContext),
-    .init           = aac_encode_init,
-    .encode2        = aac_encode_frame,
-    .close          = aac_encode_close,
-    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/libvo-amrwbenc.c b/deps/libav/libavcodec/libvo-amrwbenc.c
deleted file mode 100644
index b255ba5..0000000
--- a/deps/libav/libavcodec/libvo-amrwbenc.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * AMR Audio encoder stub
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <vo-amrwbenc/enc_if.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "internal.h"
-
-#define MAX_PACKET_SIZE  (1 + (477 + 7) / 8)
-
-typedef struct AMRWBContext {
-    AVClass *av_class;
-    void  *state;
-    int    mode;
-    int    last_bitrate;
-    int    allow_dtx;
-} AMRWBContext;
-
-static const AVOption options[] = {
-    { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRWBContext, allow_dtx), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
-    { NULL }
-};
-
-static const AVClass class = {
-    "libvo_amrwbenc", av_default_item_name, options, LIBAVUTIL_VERSION_INT
-};
-
-static int get_wb_bitrate_mode(int bitrate, void *log_ctx)
-{
-    /* make the correspondance between bitrate and mode */
-    static const int rates[] = {  6600,  8850, 12650, 14250, 15850, 18250,
-                                 19850, 23050, 23850 };
-    int i, best = -1, min_diff = 0;
-    char log_buf[200];
-
-    for (i = 0; i < 9; i++) {
-        if (rates[i] == bitrate)
-            return i;
-        if (best < 0 || abs(rates[i] - bitrate) < min_diff) {
-            best     = i;
-            min_diff = abs(rates[i] - bitrate);
-        }
-    }
-    /* no bitrate matching exactly, log a warning */
-    snprintf(log_buf, sizeof(log_buf), "bitrate not supported: use one of ");
-    for (i = 0; i < 9; i++)
-        av_strlcatf(log_buf, sizeof(log_buf), "%.2fk, ", rates[i]    / 1000.f);
-    av_strlcatf(log_buf, sizeof(log_buf), "using %.2fk", rates[best] / 1000.f);
-    av_log(log_ctx, AV_LOG_WARNING, "%s\n", log_buf);
-
-    return best;
-}
-
-static av_cold int amr_wb_encode_init(AVCodecContext *avctx)
-{
-    AMRWBContext *s = avctx->priv_data;
-
-    if (avctx->sample_rate != 16000) {
-        av_log(avctx, AV_LOG_ERROR, "Only 16000Hz sample rate supported\n");
-        return AVERROR(ENOSYS);
-    }
-
-    if (avctx->channels != 1) {
-        av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
-        return AVERROR(ENOSYS);
-    }
-
-    s->mode            = get_wb_bitrate_mode(avctx->bit_rate, avctx);
-    s->last_bitrate    = avctx->bit_rate;
-
-    avctx->frame_size  = 320;
-    avctx->delay       =  80;
-
-    s->state     = E_IF_init();
-
-    return 0;
-}
-
-static int amr_wb_encode_close(AVCodecContext *avctx)
-{
-    AMRWBContext *s = avctx->priv_data;
-
-    E_IF_exit(s->state);
-    return 0;
-}
-
-static int amr_wb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                               const AVFrame *frame, int *got_packet_ptr)
-{
-    AMRWBContext *s = avctx->priv_data;
-    const int16_t *samples = (const int16_t *)frame->data[0];
-    int size, ret;
-
-    if ((ret = ff_alloc_packet(avpkt, MAX_PACKET_SIZE))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    if (s->last_bitrate != avctx->bit_rate) {
-        s->mode         = get_wb_bitrate_mode(avctx->bit_rate, avctx);
-        s->last_bitrate = avctx->bit_rate;
-    }
-    size = E_IF_encode(s->state, s->mode, samples, avpkt->data, s->allow_dtx);
-    if (size <= 0 || size > MAX_PACKET_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "Error encoding frame\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (frame->pts != AV_NOPTS_VALUE)
-        avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
-
-    avpkt->size = size;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-AVCodec ff_libvo_amrwbenc_encoder = {
-    .name           = "libvo_amrwbenc",
-    .long_name      = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB "
-                                           "(Adaptive Multi-Rate Wide-Band)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_AMR_WB,
-    .priv_data_size = sizeof(AMRWBContext),
-    .init           = amr_wb_encode_init,
-    .encode2        = amr_wb_encode_frame,
-    .close          = amr_wb_encode_close,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-    .priv_class     = &class,
-};
diff --git a/deps/libav/libavcodec/libvorbis.c b/deps/libav/libavcodec/libvorbis.c
deleted file mode 100644
index a635db3..0000000
--- a/deps/libav/libavcodec/libvorbis.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * copyright (c) 2002 Mark Hills <mark at pogo.org.uk>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Vorbis encoding support via libvorbisenc.
- * @author Mark Hills <mark at pogo.org.uk>
- */
-
-#include <vorbis/vorbisenc.h>
-
-#include "libavutil/fifo.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "audio_frame_queue.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "vorbis.h"
-#include "vorbis_parser.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-/* Number of samples the user should send in each call.
- * This value is used because it is the LCD of all possible frame sizes, so
- * an output packet will always start at the same point as one of the input
- * packets.
- */
-#define OGGVORBIS_FRAME_SIZE 64
-
-#define BUFFER_SIZE (1024 * 64)
-
-typedef struct OggVorbisContext {
-    AVClass *av_class;                  /**< class for AVOptions            */
-    vorbis_info vi;                     /**< vorbis_info used during init   */
-    vorbis_dsp_state vd;                /**< DSP state used for analysis    */
-    vorbis_block vb;                    /**< vorbis_block used for analysis */
-    AVFifoBuffer *pkt_fifo;             /**< output packet buffer           */
-    int eof;                            /**< end-of-file flag               */
-    int dsp_initialized;                /**< vd has been initialized        */
-    vorbis_comment vc;                  /**< VorbisComment info             */
-    ogg_packet op;                      /**< ogg packet                     */
-    double iblock;                      /**< impulse block bias option      */
-    VorbisParseContext vp;              /**< parse context to get durations */
-    AudioFrameQueue afq;                /**< frame queue for timestamps     */
-} OggVorbisContext;
-
-static const AVOption options[] = {
-    { "iblock", "Sets the impulse block bias", offsetof(OggVorbisContext, iblock), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -15, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
-    { NULL }
-};
-
-static const AVCodecDefault defaults[] = {
-    { "b",  "0" },
-    { NULL },
-};
-
-static const AVClass class = { "libvorbis", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
-
-
-static int vorbis_error_to_averror(int ov_err)
-{
-    switch (ov_err) {
-    case OV_EFAULT: return AVERROR_BUG;
-    case OV_EINVAL: return AVERROR(EINVAL);
-    case OV_EIMPL:  return AVERROR(EINVAL);
-    default:        return AVERROR_UNKNOWN;
-    }
-}
-
-static av_cold int oggvorbis_init_encoder(vorbis_info *vi,
-                                          AVCodecContext *avctx)
-{
-    OggVorbisContext *s = avctx->priv_data;
-    double cfreq;
-    int ret;
-
-    if (avctx->flags & CODEC_FLAG_QSCALE || !avctx->bit_rate) {
-        /* variable bitrate
-         * NOTE: we use the oggenc range of -1 to 10 for global_quality for
-         *       user convenience, but libvorbis uses -0.1 to 1.0.
-         */
-        float q = avctx->global_quality / (float)FF_QP2LAMBDA;
-        /* default to 3 if the user did not set quality or bitrate */
-        if (!(avctx->flags & CODEC_FLAG_QSCALE))
-            q = 3.0;
-        if ((ret = vorbis_encode_setup_vbr(vi, avctx->channels,
-                                           avctx->sample_rate,
-                                           q / 10.0)))
-            goto error;
-    } else {
-        int minrate = avctx->rc_min_rate > 0 ? avctx->rc_min_rate : -1;
-        int maxrate = avctx->rc_max_rate > 0 ? avctx->rc_max_rate : -1;
-
-        /* average bitrate */
-        if ((ret = vorbis_encode_setup_managed(vi, avctx->channels,
-                                               avctx->sample_rate, maxrate,
-                                               avctx->bit_rate, minrate)))
-            goto error;
-
-        /* variable bitrate by estimate, disable slow rate management */
-        if (minrate == -1 && maxrate == -1)
-            if ((ret = vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE2_SET, NULL)))
-                goto error;
-    }
-
-    /* cutoff frequency */
-    if (avctx->cutoff > 0) {
-        cfreq = avctx->cutoff / 1000.0;
-        if ((ret = vorbis_encode_ctl(vi, OV_ECTL_LOWPASS_SET, &cfreq)))
-            goto error;
-    }
-
-    /* impulse block bias */
-    if (s->iblock) {
-        if ((ret = vorbis_encode_ctl(vi, OV_ECTL_IBLOCK_SET, &s->iblock)))
-            goto error;
-    }
-
-    if ((ret = vorbis_encode_setup_init(vi)))
-        goto error;
-
-    return 0;
-error:
-    return vorbis_error_to_averror(ret);
-}
-
-/* How many bytes are needed for a buffer of length 'l' */
-static int xiph_len(int l)
-{
-    return 1 + l / 255 + l;
-}
-
-static av_cold int oggvorbis_encode_close(AVCodecContext *avctx)
-{
-    OggVorbisContext *s = avctx->priv_data;
-
-    /* notify vorbisenc this is EOF */
-    if (s->dsp_initialized)
-        vorbis_analysis_wrote(&s->vd, 0);
-
-    vorbis_block_clear(&s->vb);
-    vorbis_dsp_clear(&s->vd);
-    vorbis_info_clear(&s->vi);
-
-    av_fifo_free(s->pkt_fifo);
-    ff_af_queue_close(&s->afq);
-    av_freep(&avctx->extradata);
-
-    return 0;
-}
-
-static av_cold int oggvorbis_encode_init(AVCodecContext *avctx)
-{
-    OggVorbisContext *s = avctx->priv_data;
-    ogg_packet header, header_comm, header_code;
-    uint8_t *p;
-    unsigned int offset;
-    int ret;
-
-    vorbis_info_init(&s->vi);
-    if ((ret = oggvorbis_init_encoder(&s->vi, avctx))) {
-        av_log(avctx, AV_LOG_ERROR, "encoder setup failed\n");
-        goto error;
-    }
-    if ((ret = vorbis_analysis_init(&s->vd, &s->vi))) {
-        av_log(avctx, AV_LOG_ERROR, "analysis init failed\n");
-        ret = vorbis_error_to_averror(ret);
-        goto error;
-    }
-    s->dsp_initialized = 1;
-    if ((ret = vorbis_block_init(&s->vd, &s->vb))) {
-        av_log(avctx, AV_LOG_ERROR, "dsp init failed\n");
-        ret = vorbis_error_to_averror(ret);
-        goto error;
-    }
-
-    vorbis_comment_init(&s->vc);
-    vorbis_comment_add_tag(&s->vc, "encoder", LIBAVCODEC_IDENT);
-
-    if ((ret = vorbis_analysis_headerout(&s->vd, &s->vc, &header, &header_comm,
-                                         &header_code))) {
-        ret = vorbis_error_to_averror(ret);
-        goto error;
-    }
-
-    avctx->extradata_size = 1 + xiph_len(header.bytes)      +
-                                xiph_len(header_comm.bytes) +
-                                header_code.bytes;
-    p = avctx->extradata = av_malloc(avctx->extradata_size +
-                                     FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!p) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-    p[0]    = 2;
-    offset  = 1;
-    offset += av_xiphlacing(&p[offset], header.bytes);
-    offset += av_xiphlacing(&p[offset], header_comm.bytes);
-    memcpy(&p[offset], header.packet, header.bytes);
-    offset += header.bytes;
-    memcpy(&p[offset], header_comm.packet, header_comm.bytes);
-    offset += header_comm.bytes;
-    memcpy(&p[offset], header_code.packet, header_code.bytes);
-    offset += header_code.bytes;
-    assert(offset == avctx->extradata_size);
-
-    if ((ret = avpriv_vorbis_parse_extradata(avctx, &s->vp)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid extradata\n");
-        return ret;
-    }
-
-    vorbis_comment_clear(&s->vc);
-
-    avctx->frame_size = OGGVORBIS_FRAME_SIZE;
-    ff_af_queue_init(avctx, &s->afq);
-
-    s->pkt_fifo = av_fifo_alloc(BUFFER_SIZE);
-    if (!s->pkt_fifo) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-
-    return 0;
-error:
-    oggvorbis_encode_close(avctx);
-    return ret;
-}
-
-static int oggvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                                  const AVFrame *frame, int *got_packet_ptr)
-{
-    OggVorbisContext *s = avctx->priv_data;
-    ogg_packet op;
-    int ret, duration;
-
-    /* send samples to libvorbis */
-    if (frame) {
-        const int samples = frame->nb_samples;
-        float **buffer;
-        int c, channels = s->vi.channels;
-
-        buffer = vorbis_analysis_buffer(&s->vd, samples);
-        for (c = 0; c < channels; c++) {
-            int co = (channels > 8) ? c :
-                     ff_vorbis_encoding_channel_layout_offsets[channels - 1][c];
-            memcpy(buffer[c], frame->extended_data[co],
-                   samples * sizeof(*buffer[c]));
-        }
-        if ((ret = vorbis_analysis_wrote(&s->vd, samples)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "error in vorbis_analysis_wrote()\n");
-            return vorbis_error_to_averror(ret);
-        }
-        if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
-            return ret;
-    } else {
-        if (!s->eof)
-            if ((ret = vorbis_analysis_wrote(&s->vd, 0)) < 0) {
-                av_log(avctx, AV_LOG_ERROR, "error in vorbis_analysis_wrote()\n");
-                return vorbis_error_to_averror(ret);
-            }
-        s->eof = 1;
-    }
-
-    /* retrieve available packets from libvorbis */
-    while ((ret = vorbis_analysis_blockout(&s->vd, &s->vb)) == 1) {
-        if ((ret = vorbis_analysis(&s->vb, NULL)) < 0)
-            break;
-        if ((ret = vorbis_bitrate_addblock(&s->vb)) < 0)
-            break;
-
-        /* add any available packets to the output packet buffer */
-        while ((ret = vorbis_bitrate_flushpacket(&s->vd, &op)) == 1) {
-            if (av_fifo_space(s->pkt_fifo) < sizeof(ogg_packet) + op.bytes) {
-                av_log(avctx, AV_LOG_ERROR, "packet buffer is too small");
-                return AVERROR_BUG;
-            }
-            av_fifo_generic_write(s->pkt_fifo, &op, sizeof(ogg_packet), NULL);
-            av_fifo_generic_write(s->pkt_fifo, op.packet, op.bytes, NULL);
-        }
-        if (ret < 0) {
-            av_log(avctx, AV_LOG_ERROR, "error getting available packets\n");
-            break;
-        }
-    }
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "error getting available packets\n");
-        return vorbis_error_to_averror(ret);
-    }
-
-    /* check for available packets */
-    if (av_fifo_size(s->pkt_fifo) < sizeof(ogg_packet))
-        return 0;
-
-    av_fifo_generic_read(s->pkt_fifo, &op, sizeof(ogg_packet), NULL);
-
-    if ((ret = ff_alloc_packet(avpkt, op.bytes))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-    av_fifo_generic_read(s->pkt_fifo, avpkt->data, op.bytes, NULL);
-
-    avpkt->pts = ff_samples_to_time_base(avctx, op.granulepos);
-
-    duration = avpriv_vorbis_parse_frame(&s->vp, avpkt->data, avpkt->size);
-    if (duration > 0) {
-        /* we do not know encoder delay until we get the first packet from
-         * libvorbis, so we have to update the AudioFrameQueue counts */
-        if (!avctx->delay) {
-            avctx->delay              = duration;
-            s->afq.remaining_delay   += duration;
-            s->afq.remaining_samples += duration;
-        }
-        ff_af_queue_remove(&s->afq, duration, &avpkt->pts, &avpkt->duration);
-    }
-
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-AVCodec ff_libvorbis_encoder = {
-    .name           = "libvorbis",
-    .long_name      = NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_VORBIS,
-    .priv_data_size = sizeof(OggVorbisContext),
-    .init           = oggvorbis_encode_init,
-    .encode2        = oggvorbis_encode_frame,
-    .close          = oggvorbis_encode_close,
-    .capabilities   = CODEC_CAP_DELAY,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-    .priv_class     = &class,
-    .defaults       = defaults,
-};
diff --git a/deps/libav/libavcodec/libvpx.c b/deps/libav/libavcodec/libvpx.c
deleted file mode 100644
index 20f4484..0000000
--- a/deps/libav/libavcodec/libvpx.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2013 Guillaume Martres <smarter at ubuntu.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <vpx/vpx_codec.h>
-
-#include "libvpx.h"
-
-int ff_vp9_check_experimental(AVCodecContext *avctx)
-{
-    if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL &&
-        (vpx_codec_version_major() < 1 ||
-         (vpx_codec_version_major() == 1 && vpx_codec_version_minor() < 3))) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Non-experimental support of VP9 requires libvpx >= 1.3.0\n");
-        return AVERROR_EXPERIMENTAL;
-    }
-    return 0;
-}
diff --git a/deps/libav/libavcodec/libvpx.h b/deps/libav/libavcodec/libvpx.h
deleted file mode 100644
index cb1ed09..0000000
--- a/deps/libav/libavcodec/libvpx.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2013 Guillaume Martres <smarter at ubuntu.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_LIBVPX_H
-#define AVCODEC_LIBVPX_H
-
-#include "avcodec.h"
-
-int ff_vp9_check_experimental(AVCodecContext *avctx);
-
-#endif /* AVCODEC_LIBVPX_H */
diff --git a/deps/libav/libavcodec/libvpxdec.c b/deps/libav/libavcodec/libvpxdec.c
deleted file mode 100644
index 6052207..0000000
--- a/deps/libav/libavcodec/libvpxdec.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2010, Google, Inc.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP8 decoder support via libvpx
- */
-
-#define VPX_CODEC_DISABLE_COMPAT 1
-#include <vpx/vpx_decoder.h>
-#include <vpx/vp8dx.h>
-
-#include "libavutil/common.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "libvpx.h"
-
-typedef struct VP8DecoderContext {
-    struct vpx_codec_ctx decoder;
-} VP8Context;
-
-static av_cold int vpx_init(AVCodecContext *avctx,
-                            const struct vpx_codec_iface *iface)
-{
-    VP8Context *ctx = avctx->priv_data;
-    struct vpx_codec_dec_cfg deccfg = {
-        /* token partitions+1 would be a decent choice */
-        .threads = FFMIN(avctx->thread_count, 16)
-    };
-
-    av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str());
-    av_log(avctx, AV_LOG_VERBOSE, "%s\n", vpx_codec_build_config());
-
-    if (vpx_codec_dec_init(&ctx->decoder, iface, &deccfg, 0) != VPX_CODEC_OK) {
-        const char *error = vpx_codec_error(&ctx->decoder);
-        av_log(avctx, AV_LOG_ERROR, "Failed to initialize decoder: %s\n",
-               error);
-        return AVERROR(EINVAL);
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    return 0;
-}
-
-static int vp8_decode(AVCodecContext *avctx,
-                      void *data, int *got_frame, AVPacket *avpkt)
-{
-    VP8Context *ctx = avctx->priv_data;
-    AVFrame *picture = data;
-    const void *iter = NULL;
-    struct vpx_image *img;
-    int ret;
-
-    if (vpx_codec_decode(&ctx->decoder, avpkt->data, avpkt->size, NULL, 0) !=
-        VPX_CODEC_OK) {
-        const char *error  = vpx_codec_error(&ctx->decoder);
-        const char *detail = vpx_codec_error_detail(&ctx->decoder);
-
-        av_log(avctx, AV_LOG_ERROR, "Failed to decode frame: %s\n", error);
-        if (detail)
-            av_log(avctx, AV_LOG_ERROR, "  Additional information: %s\n",
-                   detail);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((img = vpx_codec_get_frame(&ctx->decoder, &iter))) {
-        if (img->fmt != VPX_IMG_FMT_I420) {
-            av_log(avctx, AV_LOG_ERROR, "Unsupported output colorspace (%d)\n",
-                   img->fmt);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if ((int) img->d_w != avctx->width || (int) img->d_h != avctx->height) {
-            av_log(avctx, AV_LOG_INFO, "dimension change! %dx%d -> %dx%d\n",
-                   avctx->width, avctx->height, img->d_w, img->d_h);
-            ret = ff_set_dimensions(avctx, img->d_w, img->d_h);
-            if (ret < 0)
-                return ret;
-        }
-        if ((ret = ff_get_buffer(avctx, picture, 0)) < 0)
-            return ret;
-        av_image_copy(picture->data, picture->linesize, img->planes,
-                      img->stride, avctx->pix_fmt, img->d_w, img->d_h);
-        *got_frame           = 1;
-    }
-    return avpkt->size;
-}
-
-static av_cold int vp8_free(AVCodecContext *avctx)
-{
-    VP8Context *ctx = avctx->priv_data;
-    vpx_codec_destroy(&ctx->decoder);
-    return 0;
-}
-
-#if CONFIG_LIBVPX_VP8_DECODER
-static av_cold int vp8_init(AVCodecContext *avctx)
-{
-    return vpx_init(avctx, &vpx_codec_vp8_dx_algo);
-}
-
-AVCodec ff_libvpx_vp8_decoder = {
-    .name           = "libvpx",
-    .long_name      = NULL_IF_CONFIG_SMALL("libvpx VP8"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VP8,
-    .priv_data_size = sizeof(VP8Context),
-    .init           = vp8_init,
-    .close          = vp8_free,
-    .decode         = vp8_decode,
-    .capabilities   = CODEC_CAP_AUTO_THREADS | CODEC_CAP_DR1,
-};
-#endif /* CONFIG_LIBVPX_VP8_DECODER */
-
-#if CONFIG_LIBVPX_VP9_DECODER
-static av_cold int vp9_init(AVCodecContext *avctx)
-{
-    int ret;
-    if ((ret = ff_vp9_check_experimental(avctx)))
-        return ret;
-    return vpx_init(avctx, &vpx_codec_vp9_dx_algo);
-}
-
-AVCodec ff_libvpx_vp9_decoder = {
-    .name           = "libvpx-vp9",
-    .long_name      = NULL_IF_CONFIG_SMALL("libvpx VP9"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VP9,
-    .priv_data_size = sizeof(VP8Context),
-    .init           = vp9_init,
-    .close          = vp8_free,
-    .decode         = vp8_decode,
-    .capabilities   = CODEC_CAP_AUTO_THREADS,
-};
-#endif /* CONFIG_LIBVPX_VP9_DECODER */
diff --git a/deps/libav/libavcodec/libvpxenc.c b/deps/libav/libavcodec/libvpxenc.c
deleted file mode 100644
index dc1ddc3..0000000
--- a/deps/libav/libavcodec/libvpxenc.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * Copyright (c) 2010, Google, Inc.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP8 encoder support via libvpx
- */
-
-#define VPX_DISABLE_CTRL_TYPECHECKS 1
-#define VPX_CODEC_DISABLE_COMPAT    1
-#include <vpx/vpx_encoder.h>
-#include <vpx/vp8cx.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libvpx.h"
-#include "libavutil/base64.h"
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-
-/**
- * Portion of struct vpx_codec_cx_pkt from vpx_encoder.h.
- * One encoded frame returned from the library.
- */
-struct FrameListData {
-    void *buf;                       /**< compressed data buffer */
-    size_t sz;                       /**< length of compressed data */
-    int64_t pts;                     /**< time stamp to show frame
-                                          (in timebase units) */
-    unsigned long duration;          /**< duration to show frame
-                                          (in timebase units) */
-    uint32_t flags;                  /**< flags for this frame */
-    struct FrameListData *next;
-};
-
-typedef struct VP8EncoderContext {
-    AVClass *class;
-    struct vpx_codec_ctx encoder;
-    struct vpx_image rawimg;
-    struct vpx_fixed_buf twopass_stats;
-    unsigned long deadline; //i.e., RT/GOOD/BEST
-    struct FrameListData *coded_frame_list;
-    int cpu_used;
-    int auto_alt_ref;
-    int arnr_max_frames;
-    int arnr_strength;
-    int arnr_type;
-    int lag_in_frames;
-    int error_resilient;
-    int crf;
-} VP8Context;
-
-/** String mappings for enum vp8e_enc_control_id */
-static const char *const ctlidstr[] = {
-    [VP8E_UPD_ENTROPY]           = "VP8E_UPD_ENTROPY",
-    [VP8E_UPD_REFERENCE]         = "VP8E_UPD_REFERENCE",
-    [VP8E_USE_REFERENCE]         = "VP8E_USE_REFERENCE",
-    [VP8E_SET_ROI_MAP]           = "VP8E_SET_ROI_MAP",
-    [VP8E_SET_ACTIVEMAP]         = "VP8E_SET_ACTIVEMAP",
-    [VP8E_SET_SCALEMODE]         = "VP8E_SET_SCALEMODE",
-    [VP8E_SET_CPUUSED]           = "VP8E_SET_CPUUSED",
-    [VP8E_SET_ENABLEAUTOALTREF]  = "VP8E_SET_ENABLEAUTOALTREF",
-    [VP8E_SET_NOISE_SENSITIVITY] = "VP8E_SET_NOISE_SENSITIVITY",
-    [VP8E_SET_SHARPNESS]         = "VP8E_SET_SHARPNESS",
-    [VP8E_SET_STATIC_THRESHOLD]  = "VP8E_SET_STATIC_THRESHOLD",
-    [VP8E_SET_TOKEN_PARTITIONS]  = "VP8E_SET_TOKEN_PARTITIONS",
-    [VP8E_GET_LAST_QUANTIZER]    = "VP8E_GET_LAST_QUANTIZER",
-    [VP8E_SET_ARNR_MAXFRAMES]    = "VP8E_SET_ARNR_MAXFRAMES",
-    [VP8E_SET_ARNR_STRENGTH]     = "VP8E_SET_ARNR_STRENGTH",
-    [VP8E_SET_ARNR_TYPE]         = "VP8E_SET_ARNR_TYPE",
-    [VP8E_SET_CQ_LEVEL]          = "VP8E_SET_CQ_LEVEL",
-};
-
-static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc)
-{
-    VP8Context *ctx = avctx->priv_data;
-    const char *error  = vpx_codec_error(&ctx->encoder);
-    const char *detail = vpx_codec_error_detail(&ctx->encoder);
-
-    av_log(avctx, AV_LOG_ERROR, "%s: %s\n", desc, error);
-    if (detail)
-        av_log(avctx, AV_LOG_ERROR, "  Additional information: %s\n", detail);
-}
-
-static av_cold void dump_enc_cfg(AVCodecContext *avctx,
-                                 const struct vpx_codec_enc_cfg *cfg)
-{
-    int width = -30;
-    int level = AV_LOG_DEBUG;
-
-    av_log(avctx, level, "vpx_codec_enc_cfg\n");
-    av_log(avctx, level, "generic settings\n"
-           "  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n"
-           "  %*s{%u/%u}\n  %*s%u\n  %*s%d\n  %*s%u\n",
-           width, "g_usage:",           cfg->g_usage,
-           width, "g_threads:",         cfg->g_threads,
-           width, "g_profile:",         cfg->g_profile,
-           width, "g_w:",               cfg->g_w,
-           width, "g_h:",               cfg->g_h,
-           width, "g_timebase:",        cfg->g_timebase.num, cfg->g_timebase.den,
-           width, "g_error_resilient:", cfg->g_error_resilient,
-           width, "g_pass:",            cfg->g_pass,
-           width, "g_lag_in_frames:",   cfg->g_lag_in_frames);
-    av_log(avctx, level, "rate control settings\n"
-           "  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n"
-           "  %*s%d\n  %*s%p(%zu)\n  %*s%u\n",
-           width, "rc_dropframe_thresh:",   cfg->rc_dropframe_thresh,
-           width, "rc_resize_allowed:",     cfg->rc_resize_allowed,
-           width, "rc_resize_up_thresh:",   cfg->rc_resize_up_thresh,
-           width, "rc_resize_down_thresh:", cfg->rc_resize_down_thresh,
-           width, "rc_end_usage:",          cfg->rc_end_usage,
-           width, "rc_twopass_stats_in:",   cfg->rc_twopass_stats_in.buf, cfg->rc_twopass_stats_in.sz,
-           width, "rc_target_bitrate:",     cfg->rc_target_bitrate);
-    av_log(avctx, level, "quantizer settings\n"
-           "  %*s%u\n  %*s%u\n",
-           width, "rc_min_quantizer:", cfg->rc_min_quantizer,
-           width, "rc_max_quantizer:", cfg->rc_max_quantizer);
-    av_log(avctx, level, "bitrate tolerance\n"
-           "  %*s%u\n  %*s%u\n",
-           width, "rc_undershoot_pct:", cfg->rc_undershoot_pct,
-           width, "rc_overshoot_pct:",  cfg->rc_overshoot_pct);
-    av_log(avctx, level, "decoder buffer model\n"
-            "  %*s%u\n  %*s%u\n  %*s%u\n",
-            width, "rc_buf_sz:",         cfg->rc_buf_sz,
-            width, "rc_buf_initial_sz:", cfg->rc_buf_initial_sz,
-            width, "rc_buf_optimal_sz:", cfg->rc_buf_optimal_sz);
-    av_log(avctx, level, "2 pass rate control settings\n"
-           "  %*s%u\n  %*s%u\n  %*s%u\n",
-           width, "rc_2pass_vbr_bias_pct:",       cfg->rc_2pass_vbr_bias_pct,
-           width, "rc_2pass_vbr_minsection_pct:", cfg->rc_2pass_vbr_minsection_pct,
-           width, "rc_2pass_vbr_maxsection_pct:", cfg->rc_2pass_vbr_maxsection_pct);
-    av_log(avctx, level, "keyframing settings\n"
-           "  %*s%d\n  %*s%u\n  %*s%u\n",
-           width, "kf_mode:",     cfg->kf_mode,
-           width, "kf_min_dist:", cfg->kf_min_dist,
-           width, "kf_max_dist:", cfg->kf_max_dist);
-    av_log(avctx, level, "\n");
-}
-
-static void coded_frame_add(void *list, struct FrameListData *cx_frame)
-{
-    struct FrameListData **p = list;
-
-    while (*p != NULL)
-        p = &(*p)->next;
-    *p = cx_frame;
-    cx_frame->next = NULL;
-}
-
-static av_cold void free_coded_frame(struct FrameListData *cx_frame)
-{
-    av_freep(&cx_frame->buf);
-    av_freep(&cx_frame);
-}
-
-static av_cold void free_frame_list(struct FrameListData *list)
-{
-    struct FrameListData *p = list;
-
-    while (p) {
-        list = list->next;
-        free_coded_frame(p);
-        p = list;
-    }
-}
-
-static av_cold int codecctl_int(AVCodecContext *avctx,
-                                enum vp8e_enc_control_id id, int val)
-{
-    VP8Context *ctx = avctx->priv_data;
-    char buf[80];
-    int width = -30;
-    int res;
-
-    snprintf(buf, sizeof(buf), "%s:", ctlidstr[id]);
-    av_log(avctx, AV_LOG_DEBUG, "  %*s%d\n", width, buf, val);
-
-    res = vpx_codec_control(&ctx->encoder, id, val);
-    if (res != VPX_CODEC_OK) {
-        snprintf(buf, sizeof(buf), "Failed to set %s codec control",
-                 ctlidstr[id]);
-        log_encoder_error(avctx, buf);
-    }
-
-    return res == VPX_CODEC_OK ? 0 : AVERROR(EINVAL);
-}
-
-static av_cold int vp8_free(AVCodecContext *avctx)
-{
-    VP8Context *ctx = avctx->priv_data;
-
-    vpx_codec_destroy(&ctx->encoder);
-    av_freep(&ctx->twopass_stats.buf);
-    av_freep(&avctx->coded_frame);
-    av_freep(&avctx->stats_out);
-    free_frame_list(ctx->coded_frame_list);
-    return 0;
-}
-
-static av_cold int vpx_init(AVCodecContext *avctx,
-                            const struct vpx_codec_iface *iface)
-{
-    VP8Context *ctx = avctx->priv_data;
-    struct vpx_codec_enc_cfg enccfg;
-    int res;
-
-    av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str());
-    av_log(avctx, AV_LOG_VERBOSE, "%s\n", vpx_codec_build_config());
-
-    if ((res = vpx_codec_enc_config_default(iface, &enccfg, 0)) != VPX_CODEC_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to get config: %s\n",
-               vpx_codec_err_to_string(res));
-        return AVERROR(EINVAL);
-    }
-    dump_enc_cfg(avctx, &enccfg);
-
-    enccfg.g_w            = avctx->width;
-    enccfg.g_h            = avctx->height;
-    enccfg.g_timebase.num = avctx->time_base.num;
-    enccfg.g_timebase.den = avctx->time_base.den;
-    enccfg.g_threads      = avctx->thread_count;
-
-    if (ctx->lag_in_frames >= 0)
-        enccfg.g_lag_in_frames = ctx->lag_in_frames;
-
-    if (avctx->flags & CODEC_FLAG_PASS1)
-        enccfg.g_pass = VPX_RC_FIRST_PASS;
-    else if (avctx->flags & CODEC_FLAG_PASS2)
-        enccfg.g_pass = VPX_RC_LAST_PASS;
-    else
-        enccfg.g_pass = VPX_RC_ONE_PASS;
-
-    if (!avctx->bit_rate)
-        avctx->bit_rate = enccfg.rc_target_bitrate * 1000;
-    else
-        enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000,
-                                              AV_ROUND_NEAR_INF);
-
-    if (ctx->crf)
-        enccfg.rc_end_usage = VPX_CQ;
-    else if (avctx->rc_min_rate == avctx->rc_max_rate &&
-             avctx->rc_min_rate == avctx->bit_rate)
-        enccfg.rc_end_usage = VPX_CBR;
-
-    if (avctx->qmin > 0)
-        enccfg.rc_min_quantizer = avctx->qmin;
-    if (avctx->qmax > 0)
-        enccfg.rc_max_quantizer = avctx->qmax;
-    enccfg.rc_dropframe_thresh = avctx->frame_skip_threshold;
-
-    //0-100 (0 => CBR, 100 => VBR)
-    enccfg.rc_2pass_vbr_bias_pct           = round(avctx->qcompress * 100);
-    enccfg.rc_2pass_vbr_minsection_pct     =
-        avctx->rc_min_rate * 100LL / avctx->bit_rate;
-    if (avctx->rc_max_rate)
-        enccfg.rc_2pass_vbr_maxsection_pct =
-            avctx->rc_max_rate * 100LL / avctx->bit_rate;
-
-    if (avctx->rc_buffer_size)
-        enccfg.rc_buf_sz         =
-            avctx->rc_buffer_size * 1000LL / avctx->bit_rate;
-    if (avctx->rc_initial_buffer_occupancy)
-        enccfg.rc_buf_initial_sz =
-            avctx->rc_initial_buffer_occupancy * 1000LL / avctx->bit_rate;
-    enccfg.rc_buf_optimal_sz     = enccfg.rc_buf_sz * 5 / 6;
-
-    //_enc_init() will balk if kf_min_dist differs from max w/VPX_KF_AUTO
-    if (avctx->keyint_min >= 0 && avctx->keyint_min == avctx->gop_size)
-        enccfg.kf_min_dist = avctx->keyint_min;
-    if (avctx->gop_size >= 0)
-        enccfg.kf_max_dist = avctx->gop_size;
-
-    if (enccfg.g_pass == VPX_RC_FIRST_PASS)
-        enccfg.g_lag_in_frames = 0;
-    else if (enccfg.g_pass == VPX_RC_LAST_PASS) {
-        int decode_size;
-
-        if (!avctx->stats_in) {
-            av_log(avctx, AV_LOG_ERROR, "No stats file for second pass\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        ctx->twopass_stats.sz  = strlen(avctx->stats_in) * 3 / 4;
-        ctx->twopass_stats.buf = av_malloc(ctx->twopass_stats.sz);
-        if (!ctx->twopass_stats.buf) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Stat buffer alloc (%zu bytes) failed\n",
-                   ctx->twopass_stats.sz);
-            return AVERROR(ENOMEM);
-        }
-        decode_size = av_base64_decode(ctx->twopass_stats.buf, avctx->stats_in,
-                                       ctx->twopass_stats.sz);
-        if (decode_size < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Stat buffer decode failed\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        ctx->twopass_stats.sz      = decode_size;
-        enccfg.rc_twopass_stats_in = ctx->twopass_stats;
-    }
-
-    /* 0-3: For non-zero values the encoder increasingly optimizes for reduced
-       complexity playback on low powered devices at the expense of encode
-       quality. */
-   if (avctx->profile != FF_PROFILE_UNKNOWN)
-       enccfg.g_profile = avctx->profile;
-
-    enccfg.g_error_resilient = ctx->error_resilient;
-
-    dump_enc_cfg(avctx, &enccfg);
-    /* Construct Encoder Context */
-    res = vpx_codec_enc_init(&ctx->encoder, iface, &enccfg, 0);
-    if (res != VPX_CODEC_OK) {
-        log_encoder_error(avctx, "Failed to initialize encoder");
-        return AVERROR(EINVAL);
-    }
-
-    //codec control failures are currently treated only as warnings
-    av_log(avctx, AV_LOG_DEBUG, "vpx_codec_control\n");
-    if (ctx->cpu_used != INT_MIN)
-        codecctl_int(avctx, VP8E_SET_CPUUSED,          ctx->cpu_used);
-    if (ctx->auto_alt_ref >= 0)
-        codecctl_int(avctx, VP8E_SET_ENABLEAUTOALTREF, ctx->auto_alt_ref);
-    if (ctx->arnr_max_frames >= 0)
-        codecctl_int(avctx, VP8E_SET_ARNR_MAXFRAMES,   ctx->arnr_max_frames);
-    if (ctx->arnr_strength >= 0)
-        codecctl_int(avctx, VP8E_SET_ARNR_STRENGTH,    ctx->arnr_strength);
-    if (ctx->arnr_type >= 0)
-        codecctl_int(avctx, VP8E_SET_ARNR_TYPE,        ctx->arnr_type);
-    codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction);
-    codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS,  av_log2(avctx->slices));
-    codecctl_int(avctx, VP8E_SET_STATIC_THRESHOLD,  avctx->mb_threshold);
-    codecctl_int(avctx, VP8E_SET_CQ_LEVEL,          ctx->crf);
-
-    //provide dummy value to initialize wrapper, values will be updated each _encode()
-    vpx_img_wrap(&ctx->rawimg, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1,
-                 (unsigned char*)1);
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame) {
-        av_log(avctx, AV_LOG_ERROR, "Error allocating coded frame\n");
-        vp8_free(avctx);
-        return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-static inline void cx_pktcpy(struct FrameListData *dst,
-                             const struct vpx_codec_cx_pkt *src)
-{
-    dst->pts      = src->data.frame.pts;
-    dst->duration = src->data.frame.duration;
-    dst->flags    = src->data.frame.flags;
-    dst->sz       = src->data.frame.sz;
-    dst->buf      = src->data.frame.buf;
-}
-
-/**
- * Store coded frame information in format suitable for return from encode2().
- *
- * Write information from @a cx_frame to @a pkt
- * @return packet data size on success
- * @return a negative AVERROR on error
- */
-static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
-                      AVPacket *pkt, AVFrame *coded_frame)
-{
-    int ret = ff_alloc_packet(pkt, cx_frame->sz);
-    if (ret >= 0) {
-        memcpy(pkt->data, cx_frame->buf, pkt->size);
-        pkt->pts = pkt->dts    = cx_frame->pts;
-        coded_frame->pts       = cx_frame->pts;
-        coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY);
-
-        if (coded_frame->key_frame) {
-            coded_frame->pict_type = AV_PICTURE_TYPE_I;
-            pkt->flags            |= AV_PKT_FLAG_KEY;
-        } else
-            coded_frame->pict_type = AV_PICTURE_TYPE_P;
-    } else {
-        av_log(avctx, AV_LOG_ERROR,
-               "Error getting output packet of size %zu.\n", cx_frame->sz);
-        return ret;
-    }
-    return pkt->size;
-}
-
-/**
- * Queue multiple output frames from the encoder, returning the front-most.
- * In cases where vpx_codec_get_cx_data() returns more than 1 frame append
- * the frame queue. Return the head frame if available.
- * @return Stored frame size
- * @return AVERROR(EINVAL) on output size error
- * @return AVERROR(ENOMEM) on coded frame queue data allocation error
- */
-static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,
-                        AVFrame *coded_frame)
-{
-    VP8Context *ctx = avctx->priv_data;
-    const struct vpx_codec_cx_pkt *pkt;
-    const void *iter = NULL;
-    int size = 0;
-
-    if (ctx->coded_frame_list) {
-        struct FrameListData *cx_frame = ctx->coded_frame_list;
-        /* return the leading frame if we've already begun queueing */
-        size = storeframe(avctx, cx_frame, pkt_out, coded_frame);
-        if (size < 0)
-            return size;
-        ctx->coded_frame_list = cx_frame->next;
-        free_coded_frame(cx_frame);
-    }
-
-    /* consume all available output from the encoder before returning. buffers
-       are only good through the next vpx_codec call */
-    while ((pkt = vpx_codec_get_cx_data(&ctx->encoder, &iter))) {
-        switch (pkt->kind) {
-        case VPX_CODEC_CX_FRAME_PKT:
-            if (!size) {
-                struct FrameListData cx_frame;
-
-                /* avoid storing the frame when the list is empty and we haven't yet
-                   provided a frame for output */
-                assert(!ctx->coded_frame_list);
-                cx_pktcpy(&cx_frame, pkt);
-                size = storeframe(avctx, &cx_frame, pkt_out, coded_frame);
-                if (size < 0)
-                    return size;
-            } else {
-                struct FrameListData *cx_frame =
-                    av_malloc(sizeof(struct FrameListData));
-
-                if (!cx_frame) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Frame queue element alloc failed\n");
-                    return AVERROR(ENOMEM);
-                }
-                cx_pktcpy(cx_frame, pkt);
-                cx_frame->buf = av_malloc(cx_frame->sz);
-
-                if (!cx_frame->buf) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Data buffer alloc (%zu bytes) failed\n",
-                           cx_frame->sz);
-                    return AVERROR(ENOMEM);
-                }
-                memcpy(cx_frame->buf, pkt->data.frame.buf, pkt->data.frame.sz);
-                coded_frame_add(&ctx->coded_frame_list, cx_frame);
-            }
-            break;
-        case VPX_CODEC_STATS_PKT: {
-            struct vpx_fixed_buf *stats = &ctx->twopass_stats;
-            int err;
-            if ((err = av_reallocp(&stats->buf,
-                                   stats->sz +
-                                   pkt->data.twopass_stats.sz)) < 0) {
-                stats->sz = 0;
-                av_log(avctx, AV_LOG_ERROR, "Stat buffer realloc failed\n");
-                return err;
-            }
-            memcpy((uint8_t*)stats->buf + stats->sz,
-                   pkt->data.twopass_stats.buf, pkt->data.twopass_stats.sz);
-            stats->sz += pkt->data.twopass_stats.sz;
-            break;
-        }
-        case VPX_CODEC_PSNR_PKT: //FIXME add support for CODEC_FLAG_PSNR
-        case VPX_CODEC_CUSTOM_PKT:
-            //ignore unsupported/unrecognized packet types
-            break;
-        }
-    }
-
-    return size;
-}
-
-static int vp8_encode(AVCodecContext *avctx, AVPacket *pkt,
-                      const AVFrame *frame, int *got_packet)
-{
-    VP8Context *ctx = avctx->priv_data;
-    struct vpx_image *rawimg = NULL;
-    int64_t timestamp = 0;
-    int res, coded_size;
-    vpx_enc_frame_flags_t flags = 0;
-
-    if (frame) {
-        rawimg                      = &ctx->rawimg;
-        rawimg->planes[VPX_PLANE_Y] = frame->data[0];
-        rawimg->planes[VPX_PLANE_U] = frame->data[1];
-        rawimg->planes[VPX_PLANE_V] = frame->data[2];
-        rawimg->stride[VPX_PLANE_Y] = frame->linesize[0];
-        rawimg->stride[VPX_PLANE_U] = frame->linesize[1];
-        rawimg->stride[VPX_PLANE_V] = frame->linesize[2];
-        timestamp                   = frame->pts;
-        if (frame->pict_type == AV_PICTURE_TYPE_I)
-            flags |= VPX_EFLAG_FORCE_KF;
-    }
-
-    res = vpx_codec_encode(&ctx->encoder, rawimg, timestamp,
-                           avctx->ticks_per_frame, flags, ctx->deadline);
-    if (res != VPX_CODEC_OK) {
-        log_encoder_error(avctx, "Error encoding frame");
-        return AVERROR_INVALIDDATA;
-    }
-    coded_size = queue_frames(avctx, pkt, avctx->coded_frame);
-
-    if (!frame && avctx->flags & CODEC_FLAG_PASS1) {
-        unsigned int b64_size = AV_BASE64_SIZE(ctx->twopass_stats.sz);
-
-        avctx->stats_out = av_malloc(b64_size);
-        if (!avctx->stats_out) {
-            av_log(avctx, AV_LOG_ERROR, "Stat buffer alloc (%d bytes) failed\n",
-                   b64_size);
-            return AVERROR(ENOMEM);
-        }
-        av_base64_encode(avctx->stats_out, b64_size, ctx->twopass_stats.buf,
-                         ctx->twopass_stats.sz);
-    }
-
-    *got_packet = !!coded_size;
-    return 0;
-}
-
-#define OFFSET(x) offsetof(VP8Context, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "cpu-used",        "Quality/Speed ratio modifier",           OFFSET(cpu_used),        AV_OPT_TYPE_INT, {.i64 = INT_MIN}, INT_MIN, INT_MAX, VE},
-    { "auto-alt-ref",    "Enable use of alternate reference "
-                         "frames (2-pass only)",                   OFFSET(auto_alt_ref),    AV_OPT_TYPE_INT, {.i64 = -1},      -1,      1,       VE},
-    { "lag-in-frames",   "Number of frames to look ahead for "
-                         "alternate reference frame selection",    OFFSET(lag_in_frames),   AV_OPT_TYPE_INT, {.i64 = -1},      -1,      INT_MAX, VE},
-    { "arnr-maxframes",  "altref noise reduction max frame count", OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1},      -1,      INT_MAX, VE},
-    { "arnr-strength",   "altref noise reduction filter strength", OFFSET(arnr_strength),   AV_OPT_TYPE_INT, {.i64 = -1},      -1,      INT_MAX, VE},
-    { "arnr-type",       "altref noise reduction filter type",     OFFSET(arnr_type),       AV_OPT_TYPE_INT, {.i64 = -1},      -1,      INT_MAX, VE, "arnr_type"},
-    { "backward",        NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1}, 0, 0, VE, "arnr_type" },
-    { "forward",         NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 2}, 0, 0, VE, "arnr_type" },
-    { "centered",        NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 3}, 0, 0, VE, "arnr_type" },
-    { "deadline",        "Time to spend encoding, in microseconds.", OFFSET(deadline),      AV_OPT_TYPE_INT, {.i64 = VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"},
-    { "best",            NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VPX_DL_BEST_QUALITY}, 0, 0, VE, "quality"},
-    { "good",            NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VPX_DL_GOOD_QUALITY}, 0, 0, VE, "quality"},
-    { "realtime",        NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VPX_DL_REALTIME},     0, 0, VE, "quality"},
-    { "error-resilient", "Error resilience configuration", OFFSET(error_resilient), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, VE, "er"},
-#ifdef VPX_ERROR_RESILIENT_DEFAULT
-    { "default",         "Improve resiliency against losses of whole frames", 0, AV_OPT_TYPE_CONST, {.i64 = VPX_ERROR_RESILIENT_DEFAULT}, 0, 0, VE, "er"},
-    { "partitions",      "The frame partitions are independently decodable "
-                         "by the bool decoder, meaning that partitions can be decoded even "
-                         "though earlier partitions have been lost. Note that intra predicition"
-                         " is still done over the partition boundary.",       0, AV_OPT_TYPE_CONST, {.i64 = VPX_ERROR_RESILIENT_PARTITIONS}, 0, 0, VE, "er"},
-#endif
-    { "crf",              "Select the quality for constant quality mode", offsetof(VP8Context, crf), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE },
-    { NULL }
-};
-
-static const AVCodecDefault defaults[] = {
-    { "qmin",             "-1" },
-    { "qmax",             "-1" },
-    { "g",                "-1" },
-    { "keyint_min",       "-1" },
-    { NULL },
-};
-
-#if CONFIG_LIBVPX_VP8_ENCODER
-static av_cold int vp8_init(AVCodecContext *avctx)
-{
-    return vpx_init(avctx, &vpx_codec_vp8_cx_algo);
-}
-
-static const AVClass class_vp8 = {
-    .class_name = "libvpx encoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_libvpx_vp8_encoder = {
-    .name           = "libvpx",
-    .long_name      = NULL_IF_CONFIG_SMALL("libvpx VP8"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VP8,
-    .priv_data_size = sizeof(VP8Context),
-    .init           = vp8_init,
-    .encode2        = vp8_encode,
-    .close          = vp8_free,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &class_vp8,
-    .defaults       = defaults,
-};
-#endif /* CONFIG_LIBVPX_VP8_ENCODER */
-
-#if CONFIG_LIBVPX_VP9_ENCODER
-static av_cold int vp9_init(AVCodecContext *avctx)
-{
-    int ret;
-    if ((ret = ff_vp9_check_experimental(avctx)))
-        return ret;
-    return vpx_init(avctx, &vpx_codec_vp9_cx_algo);
-}
-
-static const AVClass class_vp9 = {
-    .class_name = "libvpx encoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_libvpx_vp9_encoder = {
-    .name           = "libvpx-vp9",
-    .long_name      = NULL_IF_CONFIG_SMALL("libvpx VP9"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VP9,
-    .priv_data_size = sizeof(VP8Context),
-    .init           = vp9_init,
-    .encode2        = vp8_encode,
-    .close          = vp8_free,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &class_vp9,
-    .defaults       = defaults,
-};
-#endif /* CONFIG_LIBVPX_VP9_ENCODER */
diff --git a/deps/libav/libavcodec/libwavpackenc.c b/deps/libav/libavcodec/libwavpackenc.c
deleted file mode 100644
index 34ec013..0000000
--- a/deps/libav/libavcodec/libwavpackenc.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <wavpack/wavpack.h>
-#include <string.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-
-#include "audio_frame_queue.h"
-#include "avcodec.h"
-#include "internal.h"
-
-#define WV_DEFAULT_BLOCK_SIZE 32768
-
-typedef struct LibWavpackContext {
-    const AVClass *class;
-    WavpackContext *wv;
-    AudioFrameQueue afq;
-
-    AVPacket *pkt;
-    int user_size;
-
-    int got_output;
-} LibWavpackContext;
-
-static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                                const AVFrame *frame, int *got_output)
-{
-    LibWavpackContext *s = avctx->priv_data;
-    int ret;
-
-    s->got_output = 0;
-    s->pkt        = pkt;
-    s->user_size  = pkt->size;
-
-    if (frame) {
-        ret = ff_af_queue_add(&s->afq, frame);
-        if (ret < 0)
-            return ret;
-
-        ret = WavpackPackSamples(s->wv, (int32_t*)frame->data[0], frame->nb_samples);
-        if (!ret) {
-            av_log(avctx, AV_LOG_ERROR, "Error encoding a frame: %s\n",
-                   WavpackGetErrorMessage(s->wv));
-            return AVERROR_UNKNOWN;
-        }
-    }
-
-    if (!s->got_output &&
-        (!frame || frame->nb_samples < avctx->frame_size)) {
-        ret = WavpackFlushSamples(s->wv);
-        if (!ret) {
-            av_log(avctx, AV_LOG_ERROR, "Error flushing the encoder: %s\n",
-                   WavpackGetErrorMessage(s->wv));
-            return AVERROR_UNKNOWN;
-        }
-    }
-
-    if (s->got_output) {
-        ff_af_queue_remove(&s->afq, avctx->frame_size, &pkt->pts, &pkt->duration);
-        *got_output = 1;
-    }
-
-    return 0;
-}
-
-static int encode_callback(void *id, void *data, int32_t count)
-{
-    AVCodecContext *avctx = id;
-    LibWavpackContext *s  = avctx->priv_data;
-    int ret, offset = s->pkt->size;
-
-    if (s->user_size) {
-        if (s->user_size - count < s->pkt->size) {
-            av_log(avctx, AV_LOG_ERROR, "Provided packet too small.\n");
-            return 0;
-        }
-        s->pkt->size += count;
-    } else {
-        ret = av_grow_packet(s->pkt, count);
-        if (ret < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Error allocating output packet.\n");
-            return 0;
-        }
-    }
-
-    memcpy(s->pkt->data + offset, data, count);
-
-    s->got_output = 1;
-
-    return 1;
-}
-
-static av_cold int wavpack_encode_init(AVCodecContext *avctx)
-{
-    LibWavpackContext *s = avctx->priv_data;
-    WavpackConfig config = { 0 };
-    int ret;
-
-    s->wv = WavpackOpenFileOutput(encode_callback, avctx, NULL);
-    if (!s->wv) {
-        av_log(avctx, AV_LOG_ERROR, "Error allocating the encoder.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    if (!avctx->frame_size)
-        avctx->frame_size = WV_DEFAULT_BLOCK_SIZE;
-
-    config.bytes_per_sample = 4;
-    config.bits_per_sample  = 32;
-    config.block_samples    = avctx->frame_size;
-    config.channel_mask     = avctx->channel_layout;
-    config.num_channels     = avctx->channels;
-    config.sample_rate      = avctx->sample_rate;
-
-    if (avctx->compression_level != FF_COMPRESSION_DEFAULT) {
-        if (avctx->compression_level >= 3) {
-            config.flags |= CONFIG_VERY_HIGH_FLAG;
-
-            if      (avctx->compression_level >= 8)
-                config.xmode = 6;
-            else if (avctx->compression_level >= 7)
-                config.xmode = 5;
-            else if (avctx->compression_level >= 6)
-                config.xmode = 4;
-            else if (avctx->compression_level >= 5)
-                config.xmode = 3;
-            else if (avctx->compression_level >= 4)
-                config.xmode = 2;
-        } else if (avctx->compression_level >= 2)
-            config.flags |= CONFIG_HIGH_FLAG;
-        else if (avctx->compression_level < 1)
-            config.flags |= CONFIG_FAST_FLAG;
-    }
-
-    ret = WavpackSetConfiguration(s->wv, &config, -1);
-    if (!ret)
-        goto fail;
-
-    ret = WavpackPackInit(s->wv);
-    if (!ret)
-        goto fail;
-
-    ff_af_queue_init(avctx, &s->afq);
-
-    return 0;
-
-fail:
-    av_log(avctx, AV_LOG_ERROR, "Error configuring the encoder: %s.\n",
-           WavpackGetErrorMessage(s->wv));
-    WavpackCloseFile(s->wv);
-    return AVERROR_UNKNOWN;
-}
-
-static av_cold int wavpack_encode_close(AVCodecContext *avctx)
-{
-    LibWavpackContext *s = avctx->priv_data;
-
-    WavpackCloseFile(s->wv);
-
-    ff_af_queue_close(&s->afq);
-
-    return 0;
-}
-
-AVCodec ff_libwavpack_encoder = {
-    .name           = "libwavpack",
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_WAVPACK,
-    .priv_data_size = sizeof(LibWavpackContext),
-    .init           = wavpack_encode_init,
-    .encode2        = wavpack_encode_frame,
-    .close          = wavpack_encode_close,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/libwebpenc.c b/deps/libav/libavcodec/libwebpenc.c
deleted file mode 100644
index 74e73dc..0000000
--- a/deps/libav/libavcodec/libwebpenc.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * WebP encoding support via libwebp
- * Copyright (c) 2013 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * WebP encoder using libwebp
- */
-
-#include <webp/encode.h>
-
-#include "libavutil/common.h"
-#include "libavutil/frame.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "internal.h"
-
-typedef struct LibWebPContext {
-    AVClass *class;         // class for AVOptions
-    float quality;          // lossy quality 0 - 100
-    int lossless;           // use lossless encoding
-    int preset;             // configuration preset
-    int chroma_warning;     // chroma linesize mismatch warning has been printed
-    int conversion_warning; // pixel format conversion warning has been printed
-    WebPConfig config;      // libwebp configuration
-} LibWebPContext;
-
-static int libwebp_error_to_averror(int err)
-{
-    switch (err) {
-    case VP8_ENC_ERROR_OUT_OF_MEMORY:
-    case VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY:
-        return AVERROR(ENOMEM);
-    case VP8_ENC_ERROR_NULL_PARAMETER:
-    case VP8_ENC_ERROR_INVALID_CONFIGURATION:
-    case VP8_ENC_ERROR_BAD_DIMENSION:
-        return AVERROR(EINVAL);
-    }
-    return AVERROR_UNKNOWN;
-}
-
-static av_cold int libwebp_encode_init(AVCodecContext *avctx)
-{
-    LibWebPContext *s = avctx->priv_data;
-    int ret;
-
-    if (avctx->global_quality < 0)
-        avctx->global_quality = 75 * FF_QP2LAMBDA;
-    s->quality = av_clipf(avctx->global_quality / (float)FF_QP2LAMBDA,
-                          0.0f, 100.0f);
-
-    if (avctx->compression_level < 0 || avctx->compression_level > 6) {
-        av_log(avctx, AV_LOG_WARNING, "invalid compression level: %d\n",
-               avctx->compression_level);
-        avctx->compression_level = av_clip(avctx->compression_level, 0, 6);
-    }
-
-    if (s->preset >= WEBP_PRESET_DEFAULT) {
-        ret = WebPConfigPreset(&s->config, s->preset, s->quality);
-        if (!ret)
-            return AVERROR_UNKNOWN;
-        s->lossless              = s->config.lossless;
-        s->quality               = s->config.quality;
-        avctx->compression_level = s->config.method;
-    } else {
-        ret = WebPConfigInit(&s->config);
-        if (!ret)
-            return AVERROR_UNKNOWN;
-
-        s->config.lossless = s->lossless;
-        s->config.quality  = s->quality;
-        s->config.method   = avctx->compression_level;
-
-        ret = WebPValidateConfig(&s->config);
-        if (!ret)
-            return AVERROR(EINVAL);
-    }
-
-    av_log(avctx, AV_LOG_DEBUG, "%s - quality=%.1f method=%d\n",
-           s->lossless ? "Lossless" : "Lossy", s->quality,
-           avctx->compression_level);
-
-    return 0;
-}
-
-static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                                const AVFrame *frame, int *got_packet)
-{
-    LibWebPContext *s  = avctx->priv_data;
-    AVFrame *alt_frame = NULL;
-    WebPPicture *pic = NULL;
-    WebPMemoryWriter mw = { 0 };
-    int ret;
-
-    if (avctx->width > WEBP_MAX_DIMENSION || avctx->height > WEBP_MAX_DIMENSION) {
-        av_log(avctx, AV_LOG_ERROR, "Picture size is too large. Max is %dx%d.\n",
-               WEBP_MAX_DIMENSION, WEBP_MAX_DIMENSION);
-        return AVERROR(EINVAL);
-    }
-
-    pic = av_malloc(sizeof(*pic));
-    if (!pic)
-        return AVERROR(ENOMEM);
-
-    ret = WebPPictureInit(pic);
-    if (!ret) {
-        ret = AVERROR_UNKNOWN;
-        goto end;
-    }
-    pic->width  = avctx->width;
-    pic->height = avctx->height;
-
-    if (avctx->pix_fmt == AV_PIX_FMT_RGB32) {
-        if (!s->lossless) {
-            /* libwebp will automatically convert RGB input to YUV when
-               encoding lossy. */
-            if (!s->conversion_warning) {
-                av_log(avctx, AV_LOG_WARNING,
-                       "Using libwebp for RGB-to-YUV conversion. You may want "
-                       "to consider passing in YUV instead for lossy "
-                       "encoding.\n");
-                s->conversion_warning = 1;
-            }
-        }
-        pic->use_argb    = 1;
-        pic->argb        = (uint32_t *)frame->data[0];
-        pic->argb_stride = frame->linesize[0] / 4;
-    } else {
-        if (frame->linesize[1] != frame->linesize[2]) {
-            if (!s->chroma_warning) {
-                av_log(avctx, AV_LOG_WARNING,
-                       "Copying frame due to differing chroma linesizes.\n");
-                s->chroma_warning = 1;
-            }
-            alt_frame = av_frame_alloc();
-            if (!alt_frame) {
-                ret = AVERROR(ENOMEM);
-                goto end;
-            }
-            alt_frame->width  = frame->width;
-            alt_frame->height = frame->height;
-            alt_frame->format = frame->format;
-            ret = av_frame_get_buffer(alt_frame, 32);
-            if (ret < 0)
-                goto end;
-            av_image_copy(alt_frame->data, alt_frame->linesize,
-                          frame->data, frame->linesize,
-                          avctx->pix_fmt, frame->width, frame->height);
-            frame = alt_frame;
-        }
-        pic->use_argb  = 0;
-        pic->y         = frame->data[0];
-        pic->u         = frame->data[1];
-        pic->v         = frame->data[2];
-        pic->y_stride  = frame->linesize[0];
-        pic->uv_stride = frame->linesize[1];
-        if (avctx->pix_fmt == AV_PIX_FMT_YUVA420P) {
-            pic->colorspace = WEBP_YUV420A;
-            pic->a          = frame->data[3];
-            pic->a_stride   = frame->linesize[3];
-        } else {
-            pic->colorspace = WEBP_YUV420;
-        }
-
-        if (s->lossless) {
-            /* We do not have a way to automatically prioritize RGB over YUV
-               in automatic pixel format conversion based on whether we're
-               encoding lossless or lossy, so we do conversion with libwebp as
-               a convenience. */
-            if (!s->conversion_warning) {
-                av_log(avctx, AV_LOG_WARNING,
-                       "Using libwebp for YUV-to-RGB conversion. You may want "
-                       "to consider passing in RGB instead for lossless "
-                       "encoding.\n");
-                s->conversion_warning = 1;
-            }
-
-#if (WEBP_ENCODER_ABI_VERSION <= 0x201)
-            /* libwebp should do the conversion automatically, but there is a
-               bug that causes it to return an error instead, so a work-around
-               is required.
-               See https://code.google.com/p/webp/issues/detail?id=178 */
-            pic->memory_ = (void*)1;  /* something non-null */
-            ret = WebPPictureYUVAToARGB(pic);
-            if (!ret) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "WebPPictureYUVAToARGB() failed with error: %d\n",
-                       pic->error_code);
-                ret = libwebp_error_to_averror(pic->error_code);
-                goto end;
-            }
-            pic->memory_ = NULL;  /* restore pointer */
-#endif
-        }
-    }
-
-    WebPMemoryWriterInit(&mw);
-    pic->custom_ptr = &mw;
-    pic->writer     = WebPMemoryWrite;
-
-    ret = WebPEncode(&s->config, pic);
-    if (!ret) {
-        av_log(avctx, AV_LOG_ERROR, "WebPEncode() failed with error: %d\n",
-               pic->error_code);
-        ret = libwebp_error_to_averror(pic->error_code);
-        goto end;
-    }
-
-    ret = ff_alloc_packet(pkt, mw.size);
-    if (ret < 0)
-        goto end;
-    memcpy(pkt->data, mw.mem, mw.size);
-
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-end:
-    free(mw.mem); /* must use free() according to libwebp documentation */
-    WebPPictureFree(pic);
-    av_freep(&pic);
-    av_frame_free(&alt_frame);
-
-    return ret;
-}
-
-#define OFFSET(x) offsetof(LibWebPContext, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "lossless",   "Use lossless mode",       OFFSET(lossless), AV_OPT_TYPE_INT,   { .i64 =  0 },  0, 1,                           VE           },
-    { "preset",     "Configuration preset",    OFFSET(preset),   AV_OPT_TYPE_INT,   { .i64 = -1 }, -1, WEBP_PRESET_TEXT,            VE, "preset" },
-    { "none",       "do not use a preset",                              0, AV_OPT_TYPE_CONST, { .i64 = -1                  }, 0, 0, VE, "preset" },
-    { "default",    "default preset",                                   0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_DEFAULT }, 0, 0, VE, "preset" },
-    { "picture",    "digital picture, like portrait, inner shot",       0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_PICTURE }, 0, 0, VE, "preset" },
-    { "photo",      "outdoor photograph, with natural lighting",        0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_PHOTO   }, 0, 0, VE, "preset" },
-    { "drawing",    "hand or line drawing, with high-contrast details", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_DRAWING }, 0, 0, VE, "preset" },
-    { "icon",       "small-sized colorful images",                      0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_ICON    }, 0, 0, VE, "preset" },
-    { "text",       "text-like",                                        0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_TEXT    }, 0, 0, VE, "preset" },
-    { NULL },
-};
-
-static const AVClass class = {
-    .class_name = "libwebp",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVCodecDefault libwebp_defaults[] = {
-    { "compression_level",  "4"  },
-    { "global_quality",     "-1" },
-    { NULL },
-};
-
-AVCodec ff_libwebp_encoder = {
-    .name           = "libwebp",
-    .long_name      = NULL_IF_CONFIG_SMALL("libwebp WebP image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WEBP,
-    .priv_data_size = sizeof(LibWebPContext),
-    .init           = libwebp_encode_init,
-    .encode2        = libwebp_encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]) {
-        AV_PIX_FMT_RGB32,
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P,
-        AV_PIX_FMT_NONE
-    },
-    .priv_class     = &class,
-    .defaults       = libwebp_defaults,
-};
diff --git a/deps/libav/libavcodec/libx264.c b/deps/libav/libavcodec/libx264.c
deleted file mode 100644
index abf0a3e..0000000
--- a/deps/libav/libavcodec/libx264.c
+++ /dev/null
@@ -1,656 +0,0 @@
-/*
- * H.264 encoding using the x264 library
- * Copyright (C) 2005  Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-#include "libavutil/mem.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/stereo3d.h"
-#include "avcodec.h"
-#include "internal.h"
-
-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
-#endif
-
-#include <x264.h>
-#include <float.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef struct X264Context {
-    AVClass        *class;
-    x264_param_t    params;
-    x264_t         *enc;
-    x264_picture_t  pic;
-    uint8_t        *sei;
-    int             sei_size;
-    char *preset;
-    char *tune;
-    char *profile;
-    int fastfirstpass;
-    float crf;
-    float crf_max;
-    int cqp;
-    int aq_mode;
-    float aq_strength;
-    char *psy_rd;
-    int psy;
-    int rc_lookahead;
-    int weightp;
-    int weightb;
-    int ssim;
-    int intra_refresh;
-    int bluray_compat;
-    int b_bias;
-    int b_pyramid;
-    int mixed_refs;
-    int dct8x8;
-    int fast_pskip;
-    int aud;
-    int mbtree;
-    char *deblock;
-    float cplxblur;
-    char *partitions;
-    int direct_pred;
-    int slice_max_size;
-    char *stats;
-    int nal_hrd;
-    char *x264_params;
-} X264Context;
-
-static void X264_log(void *p, int level, const char *fmt, va_list args)
-{
-    static const int level_map[] = {
-        [X264_LOG_ERROR]   = AV_LOG_ERROR,
-        [X264_LOG_WARNING] = AV_LOG_WARNING,
-        [X264_LOG_INFO]    = AV_LOG_INFO,
-        [X264_LOG_DEBUG]   = AV_LOG_DEBUG
-    };
-
-    if (level < 0 || level > X264_LOG_DEBUG)
-        return;
-
-    av_vlog(p, level_map[level], fmt, args);
-}
-
-
-static int encode_nals(AVCodecContext *ctx, AVPacket *pkt,
-                       x264_nal_t *nals, int nnal)
-{
-    X264Context *x4 = ctx->priv_data;
-    uint8_t *p;
-    int i, size = x4->sei_size, ret;
-
-    if (!nnal)
-        return 0;
-
-    for (i = 0; i < nnal; i++)
-        size += nals[i].i_payload;
-
-    if ((ret = ff_alloc_packet(pkt, size)) < 0)
-        return ret;
-
-    p = pkt->data;
-
-    /* Write the SEI as part of the first frame. */
-    if (x4->sei_size > 0 && nnal > 0) {
-        memcpy(p, x4->sei, x4->sei_size);
-        p += x4->sei_size;
-        x4->sei_size = 0;
-    }
-
-    for (i = 0; i < nnal; i++){
-        memcpy(p, nals[i].p_payload, nals[i].i_payload);
-        p += nals[i].i_payload;
-    }
-
-    return 1;
-}
-
-static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
-                      int *got_packet)
-{
-    X264Context *x4 = ctx->priv_data;
-    x264_nal_t *nal;
-    int nnal, i, ret;
-    x264_picture_t pic_out;
-    AVFrameSideData *side_data;
-
-    x264_picture_init( &x4->pic );
-    x4->pic.img.i_csp   = x4->params.i_csp;
-    if (x264_bit_depth > 8)
-        x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
-    x4->pic.img.i_plane = 3;
-
-    if (frame) {
-        for (i = 0; i < 3; i++) {
-            x4->pic.img.plane[i]    = frame->data[i];
-            x4->pic.img.i_stride[i] = frame->linesize[i];
-        }
-
-        x4->pic.i_pts  = frame->pts;
-        x4->pic.i_type =
-            frame->pict_type == AV_PICTURE_TYPE_I ? X264_TYPE_KEYFRAME :
-            frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
-            frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
-                                            X264_TYPE_AUTO;
-        if (x4->params.b_tff != frame->top_field_first) {
-            x4->params.b_tff = frame->top_field_first;
-            x264_encoder_reconfig(x4->enc, &x4->params);
-        }
-        if (x4->params.vui.i_sar_height != ctx->sample_aspect_ratio.den ||
-            x4->params.vui.i_sar_width  != ctx->sample_aspect_ratio.num) {
-            x4->params.vui.i_sar_height = ctx->sample_aspect_ratio.den;
-            x4->params.vui.i_sar_width  = ctx->sample_aspect_ratio.num;
-            x264_encoder_reconfig(x4->enc, &x4->params);
-        }
-
-        side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_STEREO3D);
-        if (side_data) {
-            AVStereo3D *stereo = (AVStereo3D *)side_data->data;
-            int fpa_type;
-
-            switch (stereo->type) {
-            case AV_STEREO3D_CHECKERBOARD:
-                fpa_type = 0;
-                break;
-            case AV_STEREO3D_LINES:
-                fpa_type = 1;
-                break;
-            case AV_STEREO3D_COLUMNS:
-                fpa_type = 2;
-                break;
-            case AV_STEREO3D_SIDEBYSIDE:
-                fpa_type = 3;
-                break;
-            case AV_STEREO3D_TOPBOTTOM:
-                fpa_type = 4;
-                break;
-            case AV_STEREO3D_FRAMESEQUENCE:
-                fpa_type = 5;
-                break;
-            default:
-                fpa_type = -1;
-                break;
-            }
-
-            if (fpa_type != x4->params.i_frame_packing) {
-                x4->params.i_frame_packing = fpa_type;
-                x264_encoder_reconfig(x4->enc, &x4->params);
-            }
-        }
-    }
-    do {
-        if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
-            return -1;
-
-        ret = encode_nals(ctx, pkt, nal, nnal);
-        if (ret < 0)
-            return -1;
-    } while (!ret && !frame && x264_encoder_delayed_frames(x4->enc));
-
-    pkt->pts = pic_out.i_pts;
-    pkt->dts = pic_out.i_dts;
-
-    switch (pic_out.i_type) {
-    case X264_TYPE_IDR:
-    case X264_TYPE_I:
-        ctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-        break;
-    case X264_TYPE_P:
-        ctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
-        break;
-    case X264_TYPE_B:
-    case X264_TYPE_BREF:
-        ctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
-        break;
-    }
-
-    pkt->flags |= AV_PKT_FLAG_KEY*pic_out.b_keyframe;
-    if (ret)
-        ctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
-
-    *got_packet = ret;
-    return 0;
-}
-
-static av_cold int X264_close(AVCodecContext *avctx)
-{
-    X264Context *x4 = avctx->priv_data;
-
-    av_freep(&avctx->extradata);
-    av_free(x4->sei);
-
-    if (x4->enc)
-        x264_encoder_close(x4->enc);
-
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
-{
-    switch (pix_fmt) {
-    case AV_PIX_FMT_YUV420P:
-    case AV_PIX_FMT_YUVJ420P:
-    case AV_PIX_FMT_YUV420P9:
-    case AV_PIX_FMT_YUV420P10: return X264_CSP_I420;
-    case AV_PIX_FMT_YUV422P:
-    case AV_PIX_FMT_YUV422P10: return X264_CSP_I422;
-    case AV_PIX_FMT_YUV444P:
-    case AV_PIX_FMT_YUV444P9:
-    case AV_PIX_FMT_YUV444P10: return X264_CSP_I444;
-    case AV_PIX_FMT_NV12:      return X264_CSP_NV12;
-    case AV_PIX_FMT_NV16:
-    case AV_PIX_FMT_NV20:      return X264_CSP_NV16;
-    };
-    return 0;
-}
-
-#define PARSE_X264_OPT(name, var)\
-    if (x4->var && x264_param_parse(&x4->params, name, x4->var) < 0) {\
-        av_log(avctx, AV_LOG_ERROR, "Error parsing option '%s' with value '%s'.\n", name, x4->var);\
-        return AVERROR(EINVAL);\
-    }
-
-static av_cold int X264_init(AVCodecContext *avctx)
-{
-    X264Context *x4 = avctx->priv_data;
-
-    x264_param_default(&x4->params);
-
-    x4->params.b_deblocking_filter         = avctx->flags & CODEC_FLAG_LOOP_FILTER;
-
-    if (x4->preset || x4->tune)
-        if (x264_param_default_preset(&x4->params, x4->preset, x4->tune) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Error setting preset/tune %s/%s.\n", x4->preset, x4->tune);
-            return AVERROR(EINVAL);
-        }
-
-    if (avctx->level > 0)
-        x4->params.i_level_idc = avctx->level;
-
-    x4->params.pf_log               = X264_log;
-    x4->params.p_log_private        = avctx;
-    x4->params.i_log_level          = X264_LOG_DEBUG;
-    x4->params.i_csp                = convert_pix_fmt(avctx->pix_fmt);
-
-    if (avctx->bit_rate) {
-        x4->params.rc.i_bitrate   = avctx->bit_rate / 1000;
-        x4->params.rc.i_rc_method = X264_RC_ABR;
-    }
-    x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
-    x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate    / 1000;
-    x4->params.rc.b_stat_write      = avctx->flags & CODEC_FLAG_PASS1;
-    if (avctx->flags & CODEC_FLAG_PASS2) {
-        x4->params.rc.b_stat_read = 1;
-    } else {
-        if (x4->crf >= 0) {
-            x4->params.rc.i_rc_method   = X264_RC_CRF;
-            x4->params.rc.f_rf_constant = x4->crf;
-        } else if (x4->cqp >= 0) {
-            x4->params.rc.i_rc_method   = X264_RC_CQP;
-            x4->params.rc.i_qp_constant = x4->cqp;
-        }
-
-        if (x4->crf_max >= 0)
-            x4->params.rc.f_rf_constant_max = x4->crf_max;
-    }
-
-    if (avctx->rc_buffer_size && avctx->rc_initial_buffer_occupancy > 0 &&
-        (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) {
-        x4->params.rc.f_vbv_buffer_init =
-            (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
-    }
-
-    if (avctx->i_quant_factor > 0)
-        x4->params.rc.f_ip_factor         = 1 / fabs(avctx->i_quant_factor);
-    x4->params.rc.f_pb_factor             = avctx->b_quant_factor;
-    x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
-
-    if (avctx->me_method == ME_EPZS)
-        x4->params.analyse.i_me_method = X264_ME_DIA;
-    else if (avctx->me_method == ME_HEX)
-        x4->params.analyse.i_me_method = X264_ME_HEX;
-    else if (avctx->me_method == ME_UMH)
-        x4->params.analyse.i_me_method = X264_ME_UMH;
-    else if (avctx->me_method == ME_FULL)
-        x4->params.analyse.i_me_method = X264_ME_ESA;
-    else if (avctx->me_method == ME_TESA)
-        x4->params.analyse.i_me_method = X264_ME_TESA;
-
-    if (avctx->gop_size >= 0)
-        x4->params.i_keyint_max         = avctx->gop_size;
-    if (avctx->max_b_frames >= 0)
-        x4->params.i_bframe             = avctx->max_b_frames;
-    if (avctx->scenechange_threshold >= 0)
-        x4->params.i_scenecut_threshold = avctx->scenechange_threshold;
-    if (avctx->qmin >= 0)
-        x4->params.rc.i_qp_min          = avctx->qmin;
-    if (avctx->qmax >= 0)
-        x4->params.rc.i_qp_max          = avctx->qmax;
-    if (avctx->max_qdiff >= 0)
-        x4->params.rc.i_qp_step         = avctx->max_qdiff;
-    if (avctx->qblur >= 0)
-        x4->params.rc.f_qblur           = avctx->qblur;     /* temporally blur quants */
-    if (avctx->qcompress >= 0)
-        x4->params.rc.f_qcompress       = avctx->qcompress; /* 0.0 => cbr, 1.0 => constant qp */
-    if (avctx->refs >= 0)
-        x4->params.i_frame_reference    = avctx->refs;
-    if (avctx->trellis >= 0)
-        x4->params.analyse.i_trellis    = avctx->trellis;
-    if (avctx->me_range >= 0)
-        x4->params.analyse.i_me_range   = avctx->me_range;
-    if (avctx->noise_reduction >= 0)
-        x4->params.analyse.i_noise_reduction = avctx->noise_reduction;
-    if (avctx->me_subpel_quality >= 0)
-        x4->params.analyse.i_subpel_refine   = avctx->me_subpel_quality;
-    if (avctx->b_frame_strategy >= 0)
-        x4->params.i_bframe_adaptive = avctx->b_frame_strategy;
-    if (avctx->keyint_min >= 0)
-        x4->params.i_keyint_min = avctx->keyint_min;
-    if (avctx->coder_type >= 0)
-        x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC;
-    if (avctx->me_cmp >= 0)
-        x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA;
-
-    if (x4->aq_mode >= 0)
-        x4->params.rc.i_aq_mode = x4->aq_mode;
-    if (x4->aq_strength >= 0)
-        x4->params.rc.f_aq_strength = x4->aq_strength;
-    PARSE_X264_OPT("psy-rd", psy_rd);
-    PARSE_X264_OPT("deblock", deblock);
-    PARSE_X264_OPT("partitions", partitions);
-    PARSE_X264_OPT("stats", stats);
-    if (x4->psy >= 0)
-        x4->params.analyse.b_psy  = x4->psy;
-    if (x4->rc_lookahead >= 0)
-        x4->params.rc.i_lookahead = x4->rc_lookahead;
-    if (x4->weightp >= 0)
-        x4->params.analyse.i_weighted_pred = x4->weightp;
-    if (x4->weightb >= 0)
-        x4->params.analyse.b_weighted_bipred = x4->weightb;
-    if (x4->cplxblur >= 0)
-        x4->params.rc.f_complexity_blur = x4->cplxblur;
-
-    if (x4->ssim >= 0)
-        x4->params.analyse.b_ssim = x4->ssim;
-    if (x4->intra_refresh >= 0)
-        x4->params.b_intra_refresh = x4->intra_refresh;
-    if (x4->bluray_compat >= 0) {
-        x4->params.b_bluray_compat = x4->bluray_compat;
-        x4->params.b_vfr_input = 0;
-    }
-    if (x4->b_bias != INT_MIN)
-        x4->params.i_bframe_bias              = x4->b_bias;
-    if (x4->b_pyramid >= 0)
-        x4->params.i_bframe_pyramid = x4->b_pyramid;
-    if (x4->mixed_refs >= 0)
-        x4->params.analyse.b_mixed_references = x4->mixed_refs;
-    if (x4->dct8x8 >= 0)
-        x4->params.analyse.b_transform_8x8    = x4->dct8x8;
-    if (x4->fast_pskip >= 0)
-        x4->params.analyse.b_fast_pskip       = x4->fast_pskip;
-    if (x4->aud >= 0)
-        x4->params.b_aud                      = x4->aud;
-    if (x4->mbtree >= 0)
-        x4->params.rc.b_mb_tree               = x4->mbtree;
-    if (x4->direct_pred >= 0)
-        x4->params.analyse.i_direct_mv_pred   = x4->direct_pred;
-
-    if (x4->slice_max_size >= 0)
-        x4->params.i_slice_max_size =  x4->slice_max_size;
-
-    if (x4->fastfirstpass)
-        x264_param_apply_fastfirstpass(&x4->params);
-
-    if (x4->nal_hrd >= 0)
-        x4->params.i_nal_hrd = x4->nal_hrd;
-
-    if (x4->profile)
-        if (x264_param_apply_profile(&x4->params, x4->profile) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Error setting profile %s.\n", x4->profile);
-            return AVERROR(EINVAL);
-        }
-
-    x4->params.i_width          = avctx->width;
-    x4->params.i_height         = avctx->height;
-    x4->params.vui.i_sar_width  = avctx->sample_aspect_ratio.num;
-    x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den;
-    x4->params.i_fps_num = x4->params.i_timebase_den = avctx->time_base.den;
-    x4->params.i_fps_den = x4->params.i_timebase_num = avctx->time_base.num;
-
-    x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;
-
-    x4->params.i_threads      = avctx->thread_count;
-    if (avctx->thread_type)
-        x4->params.b_sliced_threads = avctx->thread_type == FF_THREAD_SLICE;
-
-    x4->params.b_interlaced   = avctx->flags & CODEC_FLAG_INTERLACED_DCT;
-
-    x4->params.b_open_gop     = !(avctx->flags & CODEC_FLAG_CLOSED_GOP);
-
-    x4->params.i_slice_count  = avctx->slices;
-
-    x4->params.vui.b_fullrange = avctx->pix_fmt == AV_PIX_FMT_YUVJ420P;
-
-    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
-        x4->params.b_repeat_headers = 0;
-
-    if (x4->x264_params) {
-        AVDictionary *dict    = NULL;
-        AVDictionaryEntry *en = NULL;
-
-        if (!av_dict_parse_string(&dict, x4->x264_params, "=", ":", 0)) {
-            while ((en = av_dict_get(dict, "", en, AV_DICT_IGNORE_SUFFIX))) {
-                if (x264_param_parse(&x4->params, en->key, en->value) < 0)
-                    av_log(avctx, AV_LOG_WARNING,
-                           "Error parsing option '%s = %s'.\n",
-                            en->key, en->value);
-            }
-
-            av_dict_free(&dict);
-        }
-    }
-
-    // update AVCodecContext with x264 parameters
-    avctx->has_b_frames = x4->params.i_bframe ?
-        x4->params.i_bframe_pyramid ? 2 : 1 : 0;
-    if (avctx->max_b_frames < 0)
-        avctx->max_b_frames = 0;
-
-    avctx->bit_rate = x4->params.rc.i_bitrate*1000;
-
-    x4->enc = x264_encoder_open(&x4->params);
-    if (!x4->enc)
-        return -1;
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
-        x264_nal_t *nal;
-        uint8_t *p;
-        int nnal, s, i;
-
-        s = x264_encoder_headers(x4->enc, &nal, &nnal);
-        avctx->extradata = p = av_malloc(s);
-
-        for (i = 0; i < nnal; i++) {
-            /* Don't put the SEI in extradata. */
-            if (nal[i].i_type == NAL_SEI) {
-                av_log(avctx, AV_LOG_INFO, "%s\n", nal[i].p_payload+25);
-                x4->sei_size = nal[i].i_payload;
-                x4->sei      = av_malloc(x4->sei_size);
-                memcpy(x4->sei, nal[i].p_payload, nal[i].i_payload);
-                continue;
-            }
-            memcpy(p, nal[i].p_payload, nal[i].i_payload);
-            p += nal[i].i_payload;
-        }
-        avctx->extradata_size = p - avctx->extradata;
-    }
-
-    return 0;
-}
-
-static const enum AVPixelFormat pix_fmts_8bit[] = {
-    AV_PIX_FMT_YUV420P,
-    AV_PIX_FMT_YUVJ420P,
-    AV_PIX_FMT_YUV422P,
-    AV_PIX_FMT_YUV444P,
-    AV_PIX_FMT_NV12,
-    AV_PIX_FMT_NV16,
-    AV_PIX_FMT_NONE
-};
-static const enum AVPixelFormat pix_fmts_9bit[] = {
-    AV_PIX_FMT_YUV420P9,
-    AV_PIX_FMT_YUV444P9,
-    AV_PIX_FMT_NONE
-};
-static const enum AVPixelFormat pix_fmts_10bit[] = {
-    AV_PIX_FMT_YUV420P10,
-    AV_PIX_FMT_YUV422P10,
-    AV_PIX_FMT_YUV444P10,
-    AV_PIX_FMT_NV20,
-    AV_PIX_FMT_NONE
-};
-
-static av_cold void X264_init_static(AVCodec *codec)
-{
-    if (x264_bit_depth == 8)
-        codec->pix_fmts = pix_fmts_8bit;
-    else if (x264_bit_depth == 9)
-        codec->pix_fmts = pix_fmts_9bit;
-    else if (x264_bit_depth == 10)
-        codec->pix_fmts = pix_fmts_10bit;
-}
-
-#define OFFSET(x) offsetof(X264Context, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "preset",        "Set the encoding preset (cf. x264 --fullhelp)",   OFFSET(preset),        AV_OPT_TYPE_STRING, { .str = "medium" }, 0, 0, VE},
-    { "tune",          "Tune the encoding params (cf. x264 --fullhelp)",  OFFSET(tune),          AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
-    { "profile",       "Set profile restrictions (cf. x264 --fullhelp) ", OFFSET(profile),       AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
-    { "fastfirstpass", "Use fast settings when encoding first pass",      OFFSET(fastfirstpass), AV_OPT_TYPE_INT,    { .i64 = 1 }, 0, 1, VE},
-    { "crf",           "Select the quality for constant quality mode",    OFFSET(crf),           AV_OPT_TYPE_FLOAT,  {.dbl = -1 }, -1, FLT_MAX, VE },
-    { "crf_max",       "In CRF mode, prevents VBV from lowering quality beyond this point.",OFFSET(crf_max), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, VE },
-    { "qp",            "Constant quantization parameter rate control method",OFFSET(cqp),        AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, INT_MAX, VE },
-    { "aq-mode",       "AQ method",                                       OFFSET(aq_mode),       AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, INT_MAX, VE, "aq_mode"},
-    { "none",          NULL,                              0, AV_OPT_TYPE_CONST, {.i64 = X264_AQ_NONE},         INT_MIN, INT_MAX, VE, "aq_mode" },
-    { "variance",      "Variance AQ (complexity mask)",   0, AV_OPT_TYPE_CONST, {.i64 = X264_AQ_VARIANCE},     INT_MIN, INT_MAX, VE, "aq_mode" },
-    { "autovariance",  "Auto-variance AQ (experimental)", 0, AV_OPT_TYPE_CONST, {.i64 = X264_AQ_AUTOVARIANCE}, INT_MIN, INT_MAX, VE, "aq_mode" },
-    { "aq-strength",   "AQ strength. Reduces blocking and blurring in flat and textured areas.", OFFSET(aq_strength), AV_OPT_TYPE_FLOAT, {.dbl = -1}, -1, FLT_MAX, VE},
-    { "psy",           "Use psychovisual optimizations.",                 OFFSET(psy),           AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, 1, VE },
-    { "psy-rd",        "Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.", OFFSET(psy_rd), AV_OPT_TYPE_STRING,  {0 }, 0, 0, VE},
-    { "rc-lookahead",  "Number of frames to look ahead for frametype and ratecontrol", OFFSET(rc_lookahead), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE },
-    { "weightb",       "Weighted prediction for B-frames.",               OFFSET(weightb),       AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, 1, VE },
-    { "weightp",       "Weighted prediction analysis method.",            OFFSET(weightp),       AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, INT_MAX, VE, "weightp" },
-    { "none",          NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_WEIGHTP_NONE},   INT_MIN, INT_MAX, VE, "weightp" },
-    { "simple",        NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_WEIGHTP_SIMPLE}, INT_MIN, INT_MAX, VE, "weightp" },
-    { "smart",         NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_WEIGHTP_SMART},  INT_MIN, INT_MAX, VE, "weightp" },
-    { "ssim",          "Calculate and print SSIM stats.",                 OFFSET(ssim),          AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, 1, VE },
-    { "intra-refresh", "Use Periodic Intra Refresh instead of IDR frames.",OFFSET(intra_refresh),AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, 1, VE },
-    { "bluray-compat", "Bluray compatibility workarounds.",               OFFSET(bluray_compat) ,AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, 1, VE },
-    { "b-bias",        "Influences how often B-frames are used",          OFFSET(b_bias),        AV_OPT_TYPE_INT,    { .i64 = INT_MIN}, INT_MIN, INT_MAX, VE },
-    { "b-pyramid",     "Keep some B-frames as references.",               OFFSET(b_pyramid),     AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, INT_MAX, VE, "b_pyramid" },
-    { "none",          NULL,                                  0, AV_OPT_TYPE_CONST, {.i64 = X264_B_PYRAMID_NONE},   INT_MIN, INT_MAX, VE, "b_pyramid" },
-    { "strict",        "Strictly hierarchical pyramid",       0, AV_OPT_TYPE_CONST, {.i64 = X264_B_PYRAMID_STRICT}, INT_MIN, INT_MAX, VE, "b_pyramid" },
-    { "normal",        "Non-strict (not Blu-ray compatible)", 0, AV_OPT_TYPE_CONST, {.i64 = X264_B_PYRAMID_NORMAL}, INT_MIN, INT_MAX, VE, "b_pyramid" },
-    { "mixed-refs",    "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, VE },
-    { "8x8dct",        "High profile 8x8 transform.",                     OFFSET(dct8x8),        AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, 1, VE},
-    { "fast-pskip",    NULL,                                              OFFSET(fast_pskip),    AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, 1, VE},
-    { "aud",           "Use access unit delimiters.",                     OFFSET(aud),           AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, 1, VE},
-    { "mbtree",        "Use macroblock tree ratecontrol.",                OFFSET(mbtree),        AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, 1, VE},
-    { "deblock",       "Loop filter parameters, in <alpha:beta> form.",   OFFSET(deblock),       AV_OPT_TYPE_STRING, { 0 },  0, 0, VE},
-    { "cplxblur",      "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), AV_OPT_TYPE_FLOAT,  {.dbl = -1 }, -1, FLT_MAX, VE},
-    { "partitions",    "A comma-separated list of partitions to consider. "
-                       "Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all", OFFSET(partitions), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
-    { "direct-pred",   "Direct MV prediction mode",                       OFFSET(direct_pred),   AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, INT_MAX, VE, "direct-pred" },
-    { "none",          NULL,      0,    AV_OPT_TYPE_CONST, { .i64 = X264_DIRECT_PRED_NONE },     0, 0, VE, "direct-pred" },
-    { "spatial",       NULL,      0,    AV_OPT_TYPE_CONST, { .i64 = X264_DIRECT_PRED_SPATIAL },  0, 0, VE, "direct-pred" },
-    { "temporal",      NULL,      0,    AV_OPT_TYPE_CONST, { .i64 = X264_DIRECT_PRED_TEMPORAL }, 0, 0, VE, "direct-pred" },
-    { "auto",          NULL,      0,    AV_OPT_TYPE_CONST, { .i64 = X264_DIRECT_PRED_AUTO },     0, 0, VE, "direct-pred" },
-    { "slice-max-size","Limit the size of each slice in bytes",           OFFSET(slice_max_size),AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, INT_MAX, VE },
-    { "stats",         "Filename for 2 pass stats",                       OFFSET(stats),         AV_OPT_TYPE_STRING, { 0 },  0,       0, VE },
-    { "nal-hrd",       "Signal HRD information (requires vbv-bufsize; "
-                       "cbr not allowed in .mp4)",                        OFFSET(nal_hrd),       AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, INT_MAX, VE, "nal-hrd" },
-    { "none",          NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_NONE}, INT_MIN, INT_MAX, VE, "nal-hrd" },
-    { "vbr",           NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR},  INT_MIN, INT_MAX, VE, "nal-hrd" },
-    { "cbr",           NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR},  INT_MIN, INT_MAX, VE, "nal-hrd" },
-    { "x264-params",  "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
-    { NULL },
-};
-
-static const AVClass class = {
-    .class_name = "libx264",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVCodecDefault x264_defaults[] = {
-    { "b",                "0" },
-    { "bf",               "-1" },
-    { "g",                "-1" },
-    { "i_qfactor",        "-1" },
-    { "qmin",             "-1" },
-    { "qmax",             "-1" },
-    { "qdiff",            "-1" },
-    { "qblur",            "-1" },
-    { "qcomp",            "-1" },
-    { "refs",             "-1" },
-    { "sc_threshold",     "-1" },
-    { "trellis",          "-1" },
-    { "nr",               "-1" },
-    { "me_range",         "-1" },
-    { "me_method",        "-1" },
-    { "subq",             "-1" },
-    { "b_strategy",       "-1" },
-    { "keyint_min",       "-1" },
-    { "coder",            "-1" },
-    { "cmp",              "-1" },
-    { "threads",          AV_STRINGIFY(X264_THREADS_AUTO) },
-    { "thread_type",      "0" },
-    { "flags",            "+cgop" },
-    { "rc_init_occupancy","-1" },
-    { NULL },
-};
-
-AVCodec ff_libx264_encoder = {
-    .name             = "libx264",
-    .long_name        = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
-    .type             = AVMEDIA_TYPE_VIDEO,
-    .id               = AV_CODEC_ID_H264,
-    .priv_data_size   = sizeof(X264Context),
-    .init             = X264_init,
-    .encode2          = X264_frame,
-    .close            = X264_close,
-    .capabilities     = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
-    .priv_class       = &class,
-    .defaults         = x264_defaults,
-    .init_static_data = X264_init_static,
-};
diff --git a/deps/libav/libavcodec/libxavs.c b/deps/libav/libavcodec/libxavs.c
deleted file mode 100644
index 7a74e36..0000000
--- a/deps/libav/libavcodec/libxavs.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * AVS encoding using the xavs library
- * Copyright (C) 2010 Amanda, Y.N. Wu <amanda11192003 at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <stdint.h>
-#include <float.h>
-#include <xavs.h>
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-
-#define END_OF_STREAM 0x001
-
-#define XAVS_PART_I8X8 0x002 /* Analyze i8x8 (requires 8x8 transform) */
-#define XAVS_PART_P8X8 0x010 /* Analyze p16x8, p8x16 and p8x8 */
-#define XAVS_PART_B8X8 0x100 /* Analyze b16x8, b*/
-
-typedef struct XavsContext {
-    AVClass        *class;
-    xavs_param_t    params;
-    xavs_t         *enc;
-    xavs_picture_t  pic;
-    uint8_t        *sei;
-    int             sei_size;
-    int             end_of_stream;
-    float crf;
-    int cqp;
-    int b_bias;
-    float cplxblur;
-    int direct_pred;
-    int aud;
-    int fast_pskip;
-    int mbtree;
-    int mixed_refs;
-
-    int64_t *pts_buffer;
-    int out_frame_count;
-} XavsContext;
-
-static void XAVS_log(void *p, int level, const char *fmt, va_list args)
-{
-    static const int level_map[] = {
-        [XAVS_LOG_ERROR]   = AV_LOG_ERROR,
-        [XAVS_LOG_WARNING] = AV_LOG_WARNING,
-        [XAVS_LOG_INFO]    = AV_LOG_INFO,
-        [XAVS_LOG_DEBUG]   = AV_LOG_DEBUG
-    };
-
-    if (level < 0 || level > XAVS_LOG_DEBUG)
-        return;
-
-    av_vlog(p, level_map[level], fmt, args);
-}
-
-static int encode_nals(AVCodecContext *ctx, AVPacket *pkt,
-                       xavs_nal_t *nals, int nnal)
-{
-    XavsContext *x4 = ctx->priv_data;
-    uint8_t *p;
-    int i, s, ret, size = x4->sei_size + FF_MIN_BUFFER_SIZE;
-
-    if (!nnal)
-        return 0;
-
-    for (i = 0; i < nnal; i++)
-        size += nals[i].i_payload;
-
-    if ((ret = ff_alloc_packet(pkt, size)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", size);
-        return ret;
-    }
-    p = pkt->data;
-
-    /* Write the SEI as part of the first frame. */
-    if (x4->sei_size > 0 && nnal > 0) {
-        memcpy(p, x4->sei, x4->sei_size);
-        p += x4->sei_size;
-        x4->sei_size = 0;
-    }
-
-    for (i = 0; i < nnal; i++) {
-        s = xavs_nal_encode(p, &size, 1, nals + i);
-        if (s < 0)
-            return -1;
-        p += s;
-    }
-    pkt->size = p - pkt->data;
-
-    return 1;
-}
-
-static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
-                      const AVFrame *frame, int *got_packet)
-{
-    XavsContext *x4 = avctx->priv_data;
-    xavs_nal_t *nal;
-    int nnal, i, ret;
-    xavs_picture_t pic_out;
-
-    x4->pic.img.i_csp   = XAVS_CSP_I420;
-    x4->pic.img.i_plane = 3;
-
-    if (frame) {
-       for (i = 0; i < 3; i++) {
-            x4->pic.img.plane[i] = frame->data[i];
-            x4->pic.img.i_stride[i] = frame->linesize[i];
-       }
-
-        x4->pic.i_pts  = frame->pts;
-        x4->pic.i_type = XAVS_TYPE_AUTO;
-        x4->pts_buffer[avctx->frame_number % (avctx->max_b_frames+1)] = frame->pts;
-    }
-
-    if (xavs_encoder_encode(x4->enc, &nal, &nnal,
-                            frame? &x4->pic: NULL, &pic_out) < 0)
-    return -1;
-
-    ret = encode_nals(avctx, pkt, nal, nnal);
-
-    if (ret < 0)
-        return -1;
-
-    if (!ret) {
-        if (!frame && !(x4->end_of_stream)) {
-            if ((ret = ff_alloc_packet(pkt, 4)) < 0)
-                return ret;
-
-            pkt->data[0] = 0x0;
-            pkt->data[1] = 0x0;
-            pkt->data[2] = 0x01;
-            pkt->data[3] = 0xb1;
-            pkt->dts = 2*x4->pts_buffer[(x4->out_frame_count-1)%(avctx->max_b_frames+1)] -
-                       x4->pts_buffer[(x4->out_frame_count-2)%(avctx->max_b_frames+1)];
-            x4->end_of_stream = END_OF_STREAM;
-            *got_packet = 1;
-        }
-        return 0;
-    }
-
-    avctx->coded_frame->pts = pic_out.i_pts;
-    pkt->pts = pic_out.i_pts;
-    if (avctx->has_b_frames) {
-        if (!x4->out_frame_count)
-            pkt->dts = pkt->pts - (x4->pts_buffer[1] - x4->pts_buffer[0]);
-        else
-            pkt->dts = x4->pts_buffer[(x4->out_frame_count-1)%(avctx->max_b_frames+1)];
-    } else
-        pkt->dts = pkt->pts;
-
-    switch (pic_out.i_type) {
-    case XAVS_TYPE_IDR:
-    case XAVS_TYPE_I:
-        avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-        break;
-    case XAVS_TYPE_P:
-        avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
-        break;
-    case XAVS_TYPE_B:
-    case XAVS_TYPE_BREF:
-        avctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
-        break;
-    }
-
-    /* There is no IDR frame in AVS JiZhun */
-    /* Sequence header is used as a flag */
-    if (pic_out.i_type == XAVS_TYPE_I) {
-        avctx->coded_frame->key_frame = 1;
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    }
-
-    avctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
-
-    x4->out_frame_count++;
-    *got_packet = ret;
-    return 0;
-}
-
-static av_cold int XAVS_close(AVCodecContext *avctx)
-{
-    XavsContext *x4 = avctx->priv_data;
-
-    av_freep(&avctx->extradata);
-    av_free(x4->sei);
-    av_freep(&x4->pts_buffer);
-
-    if (x4->enc)
-        xavs_encoder_close(x4->enc);
-
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-static av_cold int XAVS_init(AVCodecContext *avctx)
-{
-    XavsContext *x4 = avctx->priv_data;
-
-    x4->sei_size = 0;
-    xavs_param_default(&x4->params);
-
-    x4->params.pf_log               = XAVS_log;
-    x4->params.p_log_private        = avctx;
-    x4->params.i_keyint_max         = avctx->gop_size;
-    if (avctx->bit_rate) {
-        x4->params.rc.i_bitrate   = avctx->bit_rate / 1000;
-        x4->params.rc.i_rc_method = XAVS_RC_ABR;
-    }
-    x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
-    x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate    / 1000;
-    x4->params.rc.b_stat_write      = avctx->flags & CODEC_FLAG_PASS1;
-    if (avctx->flags & CODEC_FLAG_PASS2) {
-        x4->params.rc.b_stat_read = 1;
-    } else {
-        if (x4->crf >= 0) {
-            x4->params.rc.i_rc_method   = XAVS_RC_CRF;
-            x4->params.rc.f_rf_constant = x4->crf;
-        } else if (x4->cqp >= 0) {
-            x4->params.rc.i_rc_method   = XAVS_RC_CQP;
-            x4->params.rc.i_qp_constant = x4->cqp;
-        }
-    }
-
-    if (x4->aud >= 0)
-        x4->params.b_aud                      = x4->aud;
-    if (x4->mbtree >= 0)
-        x4->params.rc.b_mb_tree               = x4->mbtree;
-    if (x4->direct_pred >= 0)
-        x4->params.analyse.i_direct_mv_pred   = x4->direct_pred;
-    if (x4->fast_pskip >= 0)
-        x4->params.analyse.b_fast_pskip       = x4->fast_pskip;
-    if (x4->mixed_refs >= 0)
-        x4->params.analyse.b_mixed_references = x4->mixed_refs;
-    if (x4->b_bias != INT_MIN)
-        x4->params.i_bframe_bias              = x4->b_bias;
-    if (x4->cplxblur >= 0)
-        x4->params.rc.f_complexity_blur = x4->cplxblur;
-
-    x4->params.i_bframe          = avctx->max_b_frames;
-    /* cabac is not included in AVS JiZhun Profile */
-    x4->params.b_cabac           = 0;
-
-    x4->params.i_bframe_adaptive = avctx->b_frame_strategy;
-
-    avctx->has_b_frames          = !!avctx->max_b_frames;
-
-    /* AVS doesn't allow B picture as reference */
-    /* The max allowed reference frame number of B is 2 */
-    x4->params.i_keyint_min      = avctx->keyint_min;
-    if (x4->params.i_keyint_min > x4->params.i_keyint_max)
-        x4->params.i_keyint_min = x4->params.i_keyint_max;
-
-    x4->params.i_scenecut_threshold        = avctx->scenechange_threshold;
-
-   // x4->params.b_deblocking_filter       = avctx->flags & CODEC_FLAG_LOOP_FILTER;
-
-    x4->params.rc.i_qp_min                 = avctx->qmin;
-    x4->params.rc.i_qp_max                 = avctx->qmax;
-    x4->params.rc.i_qp_step                = avctx->max_qdiff;
-
-    x4->params.rc.f_qcompress       = avctx->qcompress; /* 0.0 => cbr, 1.0 => constant qp */
-    x4->params.rc.f_qblur           = avctx->qblur;     /* temporally blur quants */
-
-    x4->params.i_frame_reference    = avctx->refs;
-
-    x4->params.i_width              = avctx->width;
-    x4->params.i_height             = avctx->height;
-    x4->params.vui.i_sar_width      = avctx->sample_aspect_ratio.num;
-    x4->params.vui.i_sar_height     = avctx->sample_aspect_ratio.den;
-    /* This is only used for counting the fps */
-    x4->params.i_fps_num            = avctx->time_base.den;
-    x4->params.i_fps_den            = avctx->time_base.num;
-    x4->params.analyse.inter        = XAVS_ANALYSE_I8x8 |XAVS_ANALYSE_PSUB16x16| XAVS_ANALYSE_BSUB16x16;
-
-    switch (avctx->me_method) {
-         case  ME_EPZS:
-               x4->params.analyse.i_me_method = XAVS_ME_DIA;
-               break;
-         case  ME_HEX:
-               x4->params.analyse.i_me_method = XAVS_ME_HEX;
-               break;
-         case  ME_UMH:
-               x4->params.analyse.i_me_method = XAVS_ME_UMH;
-               break;
-         case  ME_FULL:
-               x4->params.analyse.i_me_method = XAVS_ME_ESA;
-               break;
-         case  ME_TESA:
-               x4->params.analyse.i_me_method = XAVS_ME_TESA;
-               break;
-         default:
-               x4->params.analyse.i_me_method = XAVS_ME_HEX;
-    }
-
-    x4->params.analyse.i_me_range = avctx->me_range;
-    x4->params.analyse.i_subpel_refine    = avctx->me_subpel_quality;
-
-    x4->params.analyse.b_chroma_me        = avctx->me_cmp & FF_CMP_CHROMA;
-    /* AVS P2 only enables 8x8 transform */
-    x4->params.analyse.b_transform_8x8    = 1; //avctx->flags2 & CODEC_FLAG2_8X8DCT;
-
-    x4->params.analyse.i_trellis          = avctx->trellis;
-    x4->params.analyse.i_noise_reduction  = avctx->noise_reduction;
-
-    if (avctx->level > 0)
-        x4->params.i_level_idc = avctx->level;
-
-    x4->params.rc.f_rate_tolerance =
-        (float)avctx->bit_rate_tolerance/avctx->bit_rate;
-
-    if ((avctx->rc_buffer_size) &&
-        (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) {
-        x4->params.rc.f_vbv_buffer_init =
-            (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
-    } else
-        x4->params.rc.f_vbv_buffer_init = 0.9;
-
-    /* TAG:do we have MB tree RC method */
-    /* what is the RC method we are now using? Default NO */
-    x4->params.rc.f_ip_factor             = 1 / fabs(avctx->i_quant_factor);
-    x4->params.rc.f_pb_factor             = avctx->b_quant_factor;
-    x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
-
-    x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;
-    x4->params.i_log_level    = XAVS_LOG_DEBUG;
-    x4->params.i_threads      = avctx->thread_count;
-    x4->params.b_interlaced   = avctx->flags & CODEC_FLAG_INTERLACED_DCT;
-
-    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
-        x4->params.b_repeat_headers = 0;
-
-    x4->enc = xavs_encoder_open(&x4->params);
-    if (!x4->enc)
-        return -1;
-
-    if (!(x4->pts_buffer = av_mallocz((avctx->max_b_frames+1) * sizeof(*x4->pts_buffer))))
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    /* TAG: Do we have GLOBAL HEADER in AVS */
-    /* We Have PPS and SPS in AVS */
-    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
-        xavs_nal_t *nal;
-        int nnal, s, i, size;
-        uint8_t *p;
-
-        s = xavs_encoder_headers(x4->enc, &nal, &nnal);
-
-        avctx->extradata = p = av_malloc(s);
-        for (i = 0; i < nnal; i++) {
-            /* Don't put the SEI in extradata. */
-            if (nal[i].i_type == NAL_SEI) {
-                x4->sei = av_malloc( 5 + nal[i].i_payload * 4 / 3 );
-                if (xavs_nal_encode(x4->sei, &x4->sei_size, 1, nal + i) < 0)
-                    return -1;
-
-                continue;
-            }
-            size = xavs_nal_encode(p, &s, 1, nal + i);
-            if (size < 0)
-                return -1;
-            p += size;
-        }
-        avctx->extradata_size = p - avctx->extradata;
-    }
-    return 0;
-}
-
-#define OFFSET(x) offsetof(XavsContext, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "crf",           "Select the quality for constant quality mode",    OFFSET(crf),           AV_OPT_TYPE_FLOAT,  {-1 }, -1, FLT_MAX, VE },
-    { "qp",            "Constant quantization parameter rate control method",OFFSET(cqp),        AV_OPT_TYPE_INT,    {.i64 = -1 }, -1, INT_MAX, VE },
-    { "b-bias",        "Influences how often B-frames are used",          OFFSET(b_bias),        AV_OPT_TYPE_INT,    {.i64 = INT_MIN}, INT_MIN, INT_MAX, VE },
-    { "cplxblur",      "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), AV_OPT_TYPE_FLOAT,  {-1 }, -1, FLT_MAX, VE},
-    { "direct-pred",   "Direct MV prediction mode",                       OFFSET(direct_pred),   AV_OPT_TYPE_INT,    {.i64 = -1 }, -1, INT_MAX, VE, "direct-pred" },
-    { "none",          NULL,      0,    AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_NONE },     0, 0, VE, "direct-pred" },
-    { "spatial",       NULL,      0,    AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_SPATIAL },  0, 0, VE, "direct-pred" },
-    { "temporal",      NULL,      0,    AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_TEMPORAL }, 0, 0, VE, "direct-pred" },
-    { "auto",          NULL,      0,    AV_OPT_TYPE_CONST, { .i64 = XAVS_DIRECT_PRED_AUTO },     0, 0, VE, "direct-pred" },
-    { "aud",           "Use access unit delimiters.",                     OFFSET(aud),           AV_OPT_TYPE_INT,    {.i64 = -1 }, -1, 1, VE},
-    { "mbtree",        "Use macroblock tree ratecontrol.",                OFFSET(mbtree),        AV_OPT_TYPE_INT,    {.i64 = -1 }, -1, 1, VE},
-    { "mixed-refs",    "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE },
-    { "fast-pskip",    NULL,                                              OFFSET(fast_pskip),    AV_OPT_TYPE_INT,    {.i64 = -1 }, -1, 1, VE},
-    { NULL },
-};
-
-static const AVClass class = {
-    .class_name = "libxavs",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVCodecDefault xavs_defaults[] = {
-    { "b",                "0" },
-    { NULL },
-};
-
-AVCodec ff_libxavs_encoder = {
-    .name           = "libxavs",
-    .long_name      = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_CAVS,
-    .priv_data_size = sizeof(XavsContext),
-    .init           = XAVS_init,
-    .encode2        = XAVS_frame,
-    .close          = XAVS_close,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &class,
-    .defaults       = xavs_defaults,
-};
diff --git a/deps/libav/libavcodec/libxvid.c b/deps/libav/libavcodec/libxvid.c
deleted file mode 100644
index fe68c8e..0000000
--- a/deps/libav/libavcodec/libxvid.c
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * Interface to xvidcore for mpeg4 encoding
- * Copyright (c) 2004 Adam Thayer <krevnik at comcast.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Interface to xvidcore for MPEG-4 compliant encoding.
- * @author Adam Thayer (krevnik at comcast.net)
- */
-
-#include <xvid.h>
-#include <unistd.h>
-#include "avcodec.h"
-#include "libavutil/cpu.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libxvid.h"
-#include "mpegvideo.h"
-
-/**
- * Buffer management macros.
- */
-#define BUFFER_SIZE                 1024
-#define BUFFER_REMAINING(x)         (BUFFER_SIZE - strlen(x))
-#define BUFFER_CAT(x)               (&((x)[strlen(x)]))
-
-/**
- * Structure for the private Xvid context.
- * This stores all the private context for the codec.
- */
-struct xvid_context {
-    void *encoder_handle;          /**< Handle for Xvid encoder */
-    int xsize;                     /**< Frame x size */
-    int ysize;                     /**< Frame y size */
-    int vop_flags;                 /**< VOP flags for Xvid encoder */
-    int vol_flags;                 /**< VOL flags for Xvid encoder */
-    int me_flags;                  /**< Motion Estimation flags */
-    int qscale;                    /**< Do we use constant scale? */
-    int quicktime_format;          /**< Are we in a QT-based format? */
-    char *twopassbuffer;           /**< Character buffer for two-pass */
-    char *old_twopassbuffer;       /**< Old character buffer (two-pass) */
-    char *twopassfile;             /**< second pass temp file name */
-    unsigned char *intra_matrix;   /**< P-Frame Quant Matrix */
-    unsigned char *inter_matrix;   /**< I-Frame Quant Matrix */
-};
-
-/**
- * Structure for the private first-pass plugin.
- */
-struct xvid_ff_pass1 {
-    int     version;                /**< Xvid version */
-    struct xvid_context *context;   /**< Pointer to private context */
-};
-
-/*
- * Xvid 2-Pass Kludge Section
- *
- * Xvid's default 2-pass doesn't allow us to create data as we need to, so
- * this section spends time replacing the first pass plugin so we can write
- * statistic information as libavcodec requests in. We have another kludge
- * that allows us to pass data to the second pass in Xvid without a custom
- * rate-control plugin.
- */
-
-/**
- * Initialize the two-pass plugin and context.
- *
- * @param param Input construction parameter structure
- * @param handle Private context handle
- * @return Returns XVID_ERR_xxxx on failure, or 0 on success.
- */
-static int xvid_ff_2pass_create(xvid_plg_create_t * param,
-                                void ** handle) {
-    struct xvid_ff_pass1 *x = (struct xvid_ff_pass1 *)param->param;
-    char *log = x->context->twopassbuffer;
-
-    /* Do a quick bounds check */
-    if( log == NULL )
-        return XVID_ERR_FAIL;
-
-    /* We use snprintf() */
-    /* This is because we can safely prevent a buffer overflow */
-    log[0] = 0;
-    snprintf(log, BUFFER_REMAINING(log),
-        "# avconv 2-pass log file, using xvid codec\n");
-    snprintf(BUFFER_CAT(log), BUFFER_REMAINING(log),
-        "# Do not modify. libxvidcore version: %d.%d.%d\n\n",
-        XVID_VERSION_MAJOR(XVID_VERSION),
-        XVID_VERSION_MINOR(XVID_VERSION),
-        XVID_VERSION_PATCH(XVID_VERSION));
-
-    *handle = x->context;
-    return 0;
-}
-
-/**
- * Destroy the two-pass plugin context.
- *
- * @param ref Context pointer for the plugin
- * @param param Destrooy context
- * @return Returns 0, success guaranteed
- */
-static int xvid_ff_2pass_destroy(struct xvid_context *ref,
-                                xvid_plg_destroy_t *param) {
-    /* Currently cannot think of anything to do on destruction */
-    /* Still, the framework should be here for reference/use */
-    if( ref->twopassbuffer != NULL )
-        ref->twopassbuffer[0] = 0;
-    return 0;
-}
-
-/**
- * Enable fast encode mode during the first pass.
- *
- * @param ref Context pointer for the plugin
- * @param param Frame data
- * @return Returns 0, success guaranteed
- */
-static int xvid_ff_2pass_before(struct xvid_context *ref,
-                                xvid_plg_data_t *param) {
-    int motion_remove;
-    int motion_replacements;
-    int vop_remove;
-
-    /* Nothing to do here, result is changed too much */
-    if( param->zone && param->zone->mode == XVID_ZONE_QUANT )
-        return 0;
-
-    /* We can implement a 'turbo' first pass mode here */
-    param->quant = 2;
-
-    /* Init values */
-    motion_remove = ~XVID_ME_CHROMA_PVOP &
-                    ~XVID_ME_CHROMA_BVOP &
-                    ~XVID_ME_EXTSEARCH16 &
-                    ~XVID_ME_ADVANCEDDIAMOND16;
-    motion_replacements = XVID_ME_FAST_MODEINTERPOLATE |
-                          XVID_ME_SKIP_DELTASEARCH |
-                          XVID_ME_FASTREFINE16 |
-                          XVID_ME_BFRAME_EARLYSTOP;
-    vop_remove = ~XVID_VOP_MODEDECISION_RD &
-                 ~XVID_VOP_FAST_MODEDECISION_RD &
-                 ~XVID_VOP_TRELLISQUANT &
-                 ~XVID_VOP_INTER4V &
-                 ~XVID_VOP_HQACPRED;
-
-    param->vol_flags &= ~XVID_VOL_GMC;
-    param->vop_flags &= vop_remove;
-    param->motion_flags &= motion_remove;
-    param->motion_flags |= motion_replacements;
-
-    return 0;
-}
-
-/**
- * Capture statistic data and write it during first pass.
- *
- * @param ref Context pointer for the plugin
- * @param param Statistic data
- * @return Returns XVID_ERR_xxxx on failure, or 0 on success
- */
-static int xvid_ff_2pass_after(struct xvid_context *ref,
-                                xvid_plg_data_t *param) {
-    char *log = ref->twopassbuffer;
-    const char *frame_types = " ipbs";
-    char frame_type;
-
-    /* Quick bounds check */
-    if( log == NULL )
-        return XVID_ERR_FAIL;
-
-    /* Convert the type given to us into a character */
-    if( param->type < 5 && param->type > 0 ) {
-        frame_type = frame_types[param->type];
-    } else {
-        return XVID_ERR_FAIL;
-    }
-
-    snprintf(BUFFER_CAT(log), BUFFER_REMAINING(log),
-        "%c %d %d %d %d %d %d\n",
-        frame_type, param->stats.quant, param->stats.kblks, param->stats.mblks,
-        param->stats.ublks, param->stats.length, param->stats.hlength);
-
-    return 0;
-}
-
-/**
- * Dispatch function for our custom plugin.
- * This handles the dispatch for the Xvid plugin. It passes data
- * on to other functions for actual processing.
- *
- * @param ref Context pointer for the plugin
- * @param cmd The task given for us to complete
- * @param p1 First parameter (varies)
- * @param p2 Second parameter (varies)
- * @return Returns XVID_ERR_xxxx on failure, or 0 on success
- */
-static int xvid_ff_2pass(void *ref, int cmd, void *p1, void *p2)
-{
-    switch( cmd ) {
-        case XVID_PLG_INFO:
-        case XVID_PLG_FRAME:
-            return 0;
-
-        case XVID_PLG_BEFORE:
-            return xvid_ff_2pass_before(ref, p1);
-
-        case XVID_PLG_CREATE:
-            return xvid_ff_2pass_create(p1, p2);
-
-        case XVID_PLG_AFTER:
-            return xvid_ff_2pass_after(ref, p1);
-
-        case XVID_PLG_DESTROY:
-            return xvid_ff_2pass_destroy(ref, p1);
-
-        default:
-            return XVID_ERR_FAIL;
-    }
-}
-
-/**
- * Routine to create a global VO/VOL header for MP4 container.
- * What we do here is extract the header from the Xvid bitstream
- * as it is encoded. We also strip the repeated headers from the
- * bitstream when a global header is requested for MPEG-4 ISO
- * compliance.
- *
- * @param avctx AVCodecContext pointer to context
- * @param frame Pointer to encoded frame data
- * @param header_len Length of header to search
- * @param frame_len Length of encoded frame data
- * @return Returns new length of frame data
- */
-static int xvid_strip_vol_header(AVCodecContext *avctx,
-                  AVPacket *pkt,
-                  unsigned int header_len,
-                  unsigned int frame_len) {
-    int vo_len = 0, i;
-
-    for( i = 0; i < header_len - 3; i++ ) {
-        if( pkt->data[i] == 0x00 &&
-            pkt->data[i+1] == 0x00 &&
-            pkt->data[i+2] == 0x01 &&
-            pkt->data[i+3] == 0xB6 ) {
-            vo_len = i;
-            break;
-        }
-    }
-
-    if( vo_len > 0 ) {
-        /* We need to store the header, so extract it */
-        if( avctx->extradata == NULL ) {
-            avctx->extradata = av_malloc(vo_len);
-            memcpy(avctx->extradata, pkt->data, vo_len);
-            avctx->extradata_size = vo_len;
-        }
-        /* Less dangerous now, memmove properly copies the two
-           chunks of overlapping data */
-        memmove(pkt->data, &pkt->data[vo_len], frame_len - vo_len);
-        pkt->size = frame_len - vo_len;
-    }
-    return 0;
-}
-
-/**
- * Routine to correct a possibly erroneous framerate being fed to us.
- * Xvid currently chokes on framerates where the ticks per frame is
- * extremely large. This function works to correct problems in this area
- * by estimating a new framerate and taking the simpler fraction of
- * the two presented.
- *
- * @param avctx Context that contains the framerate to correct.
- */
-static void xvid_correct_framerate(AVCodecContext *avctx)
-{
-    int frate, fbase;
-    int est_frate, est_fbase;
-    int gcd;
-    float est_fps, fps;
-
-    frate = avctx->time_base.den;
-    fbase = avctx->time_base.num;
-
-    gcd = av_gcd(frate, fbase);
-    if( gcd > 1 ) {
-        frate /= gcd;
-        fbase /= gcd;
-    }
-
-    if( frate <= 65000 && fbase <= 65000 ) {
-        avctx->time_base.den = frate;
-        avctx->time_base.num = fbase;
-        return;
-    }
-
-    fps = (float)frate / (float)fbase;
-    est_fps = roundf(fps * 1000.0) / 1000.0;
-
-    est_frate = (int)est_fps;
-    if( est_fps > (int)est_fps ) {
-        est_frate = (est_frate + 1) * 1000;
-        est_fbase = (int)roundf((float)est_frate / est_fps);
-    } else
-        est_fbase = 1;
-
-    gcd = av_gcd(est_frate, est_fbase);
-    if( gcd > 1 ) {
-        est_frate /= gcd;
-        est_fbase /= gcd;
-    }
-
-    if( fbase > est_fbase ) {
-        avctx->time_base.den = est_frate;
-        avctx->time_base.num = est_fbase;
-        av_log(avctx, AV_LOG_DEBUG,
-            "Xvid: framerate re-estimated: %.2f, %.3f%% correction\n",
-            est_fps, (((est_fps - fps)/fps) * 100.0));
-    } else {
-        avctx->time_base.den = frate;
-        avctx->time_base.num = fbase;
-    }
-}
-
-static av_cold int xvid_encode_init(AVCodecContext *avctx)  {
-    int xerr, i;
-    int xvid_flags = avctx->flags;
-    struct xvid_context *x = avctx->priv_data;
-    uint16_t *intra, *inter;
-    int fd;
-
-    xvid_plugin_single_t single       = { 0 };
-    struct xvid_ff_pass1 rc2pass1     = { 0 };
-    xvid_plugin_2pass2_t rc2pass2     = { 0 };
-    xvid_gbl_init_t xvid_gbl_init     = { 0 };
-    xvid_enc_create_t xvid_enc_create = { 0 };
-    xvid_enc_plugin_t plugins[7];
-
-    /* Bring in VOP flags from avconv command-line */
-    x->vop_flags = XVID_VOP_HALFPEL; /* Bare minimum quality */
-    if( xvid_flags & CODEC_FLAG_4MV )
-        x->vop_flags |= XVID_VOP_INTER4V; /* Level 3 */
-    if( avctx->trellis
-        )
-        x->vop_flags |= XVID_VOP_TRELLISQUANT; /* Level 5 */
-    if( xvid_flags & CODEC_FLAG_AC_PRED )
-        x->vop_flags |= XVID_VOP_HQACPRED; /* Level 6 */
-    if( xvid_flags & CODEC_FLAG_GRAY )
-        x->vop_flags |= XVID_VOP_GREYSCALE;
-
-    /* Decide which ME quality setting to use */
-    x->me_flags = 0;
-    switch( avctx->me_method ) {
-       case ME_FULL:   /* Quality 6 */
-           x->me_flags |=  XVID_ME_EXTSEARCH16
-                       |   XVID_ME_EXTSEARCH8;
-
-       case ME_EPZS:   /* Quality 4 */
-           x->me_flags |=  XVID_ME_ADVANCEDDIAMOND8
-                       |   XVID_ME_HALFPELREFINE8
-                       |   XVID_ME_CHROMA_PVOP
-                       |   XVID_ME_CHROMA_BVOP;
-
-       case ME_LOG:    /* Quality 2 */
-       case ME_PHODS:
-       case ME_X1:
-           x->me_flags |=  XVID_ME_ADVANCEDDIAMOND16
-                       |   XVID_ME_HALFPELREFINE16;
-
-       case ME_ZERO:   /* Quality 0 */
-       default:
-           break;
-    }
-
-    /* Decide how we should decide blocks */
-    switch( avctx->mb_decision ) {
-       case 2:
-           x->vop_flags |= XVID_VOP_MODEDECISION_RD;
-           x->me_flags |=  XVID_ME_HALFPELREFINE8_RD
-                       |   XVID_ME_QUARTERPELREFINE8_RD
-                       |   XVID_ME_EXTSEARCH_RD
-                       |   XVID_ME_CHECKPREDICTION_RD;
-       case 1:
-           if( !(x->vop_flags & XVID_VOP_MODEDECISION_RD) )
-               x->vop_flags |= XVID_VOP_FAST_MODEDECISION_RD;
-           x->me_flags |=  XVID_ME_HALFPELREFINE16_RD
-                       |   XVID_ME_QUARTERPELREFINE16_RD;
-
-       default:
-           break;
-    }
-
-    /* Bring in VOL flags from avconv command-line */
-    x->vol_flags = 0;
-    if( xvid_flags & CODEC_FLAG_GMC ) {
-        x->vol_flags |= XVID_VOL_GMC;
-        x->me_flags |= XVID_ME_GME_REFINE;
-    }
-    if( xvid_flags & CODEC_FLAG_QPEL ) {
-        x->vol_flags |= XVID_VOL_QUARTERPEL;
-        x->me_flags |= XVID_ME_QUARTERPELREFINE16;
-        if( x->vop_flags & XVID_VOP_INTER4V )
-            x->me_flags |= XVID_ME_QUARTERPELREFINE8;
-    }
-
-    xvid_gbl_init.version = XVID_VERSION;
-    xvid_gbl_init.debug = 0;
-
-#if ARCH_PPC
-    /* Xvid's PPC support is borked, use libavcodec to detect */
-#if HAVE_ALTIVEC
-    if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) {
-        xvid_gbl_init.cpu_flags = XVID_CPU_FORCE | XVID_CPU_ALTIVEC;
-    } else
-#endif
-        xvid_gbl_init.cpu_flags = XVID_CPU_FORCE;
-#else
-    /* Xvid can detect on x86 */
-    xvid_gbl_init.cpu_flags = 0;
-#endif
-
-    /* Initialize */
-    xvid_global(NULL, XVID_GBL_INIT, &xvid_gbl_init, NULL);
-
-    /* Create the encoder reference */
-    xvid_enc_create.version = XVID_VERSION;
-
-    /* Store the desired frame size */
-    xvid_enc_create.width = x->xsize = avctx->width;
-    xvid_enc_create.height = x->ysize = avctx->height;
-
-    /* Xvid can determine the proper profile to use */
-    /* xvid_enc_create.profile = XVID_PROFILE_S_L3; */
-
-    /* We don't use zones */
-    xvid_enc_create.zones = NULL;
-    xvid_enc_create.num_zones = 0;
-
-    xvid_enc_create.num_threads = avctx->thread_count;
-
-    xvid_enc_create.plugins = plugins;
-    xvid_enc_create.num_plugins = 0;
-
-    /* Initialize Buffers */
-    x->twopassbuffer = NULL;
-    x->old_twopassbuffer = NULL;
-    x->twopassfile = NULL;
-
-    if( xvid_flags & CODEC_FLAG_PASS1 ) {
-        rc2pass1.version = XVID_VERSION;
-        rc2pass1.context = x;
-        x->twopassbuffer = av_malloc(BUFFER_SIZE);
-        x->old_twopassbuffer = av_malloc(BUFFER_SIZE);
-        if( x->twopassbuffer == NULL || x->old_twopassbuffer == NULL ) {
-            av_log(avctx, AV_LOG_ERROR,
-                "Xvid: Cannot allocate 2-pass log buffers\n");
-            return -1;
-        }
-        x->twopassbuffer[0] = x->old_twopassbuffer[0] = 0;
-
-        plugins[xvid_enc_create.num_plugins].func = xvid_ff_2pass;
-        plugins[xvid_enc_create.num_plugins].param = &rc2pass1;
-        xvid_enc_create.num_plugins++;
-    } else if( xvid_flags & CODEC_FLAG_PASS2 ) {
-        rc2pass2.version = XVID_VERSION;
-        rc2pass2.bitrate = avctx->bit_rate;
-
-        fd = ff_tempfile("xvidff.", &x->twopassfile);
-        if( fd == -1 ) {
-            av_log(avctx, AV_LOG_ERROR,
-                "Xvid: Cannot write 2-pass pipe\n");
-            return -1;
-        }
-
-        if( avctx->stats_in == NULL ) {
-            av_log(avctx, AV_LOG_ERROR,
-                "Xvid: No 2-pass information loaded for second pass\n");
-            return -1;
-        }
-
-        if( strlen(avctx->stats_in) >
-              write(fd, avctx->stats_in, strlen(avctx->stats_in)) ) {
-            close(fd);
-            av_log(avctx, AV_LOG_ERROR,
-                "Xvid: Cannot write to 2-pass pipe\n");
-            return -1;
-        }
-
-        close(fd);
-        rc2pass2.filename = x->twopassfile;
-        plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2;
-        plugins[xvid_enc_create.num_plugins].param = &rc2pass2;
-        xvid_enc_create.num_plugins++;
-    } else if( !(xvid_flags & CODEC_FLAG_QSCALE) ) {
-        /* Single Pass Bitrate Control! */
-        single.version = XVID_VERSION;
-        single.bitrate = avctx->bit_rate;
-
-        plugins[xvid_enc_create.num_plugins].func = xvid_plugin_single;
-        plugins[xvid_enc_create.num_plugins].param = &single;
-        xvid_enc_create.num_plugins++;
-    }
-
-    /* Luminance Masking */
-    if( 0.0 != avctx->lumi_masking ) {
-        plugins[xvid_enc_create.num_plugins].func = xvid_plugin_lumimasking;
-        plugins[xvid_enc_create.num_plugins].param = NULL;
-        xvid_enc_create.num_plugins++;
-    }
-
-    /* Frame Rate and Key Frames */
-    xvid_correct_framerate(avctx);
-    xvid_enc_create.fincr = avctx->time_base.num;
-    xvid_enc_create.fbase = avctx->time_base.den;
-    if( avctx->gop_size > 0 )
-        xvid_enc_create.max_key_interval = avctx->gop_size;
-    else
-        xvid_enc_create.max_key_interval = 240; /* Xvid's best default */
-
-    /* Quants */
-    if( xvid_flags & CODEC_FLAG_QSCALE ) x->qscale = 1;
-    else x->qscale = 0;
-
-    xvid_enc_create.min_quant[0] = avctx->qmin;
-    xvid_enc_create.min_quant[1] = avctx->qmin;
-    xvid_enc_create.min_quant[2] = avctx->qmin;
-    xvid_enc_create.max_quant[0] = avctx->qmax;
-    xvid_enc_create.max_quant[1] = avctx->qmax;
-    xvid_enc_create.max_quant[2] = avctx->qmax;
-
-    /* Quant Matrices */
-    x->intra_matrix = x->inter_matrix = NULL;
-    if( avctx->mpeg_quant )
-       x->vol_flags |= XVID_VOL_MPEGQUANT;
-    if( (avctx->intra_matrix || avctx->inter_matrix) ) {
-       x->vol_flags |= XVID_VOL_MPEGQUANT;
-
-       if( avctx->intra_matrix ) {
-           intra = avctx->intra_matrix;
-           x->intra_matrix = av_malloc(sizeof(unsigned char) * 64);
-       } else
-           intra = NULL;
-       if( avctx->inter_matrix ) {
-           inter = avctx->inter_matrix;
-           x->inter_matrix = av_malloc(sizeof(unsigned char) * 64);
-       } else
-           inter = NULL;
-
-       for( i = 0; i < 64; i++ ) {
-           if( intra )
-               x->intra_matrix[i] = (unsigned char)intra[i];
-           if( inter )
-               x->inter_matrix[i] = (unsigned char)inter[i];
-       }
-    }
-
-    /* Misc Settings */
-    xvid_enc_create.frame_drop_ratio = 0;
-    xvid_enc_create.global = 0;
-    if( xvid_flags & CODEC_FLAG_CLOSED_GOP )
-        xvid_enc_create.global |= XVID_GLOBAL_CLOSED_GOP;
-
-    /* Determines which codec mode we are operating in */
-    avctx->extradata = NULL;
-    avctx->extradata_size = 0;
-    if( xvid_flags & CODEC_FLAG_GLOBAL_HEADER ) {
-        /* In this case, we are claiming to be MPEG4 */
-        x->quicktime_format = 1;
-        avctx->codec_id = AV_CODEC_ID_MPEG4;
-    } else {
-        /* We are claiming to be Xvid */
-        x->quicktime_format = 0;
-        if(!avctx->codec_tag)
-            avctx->codec_tag = AV_RL32("xvid");
-    }
-
-    /* Bframes */
-    xvid_enc_create.max_bframes = avctx->max_b_frames;
-    xvid_enc_create.bquant_offset = 100 * avctx->b_quant_offset;
-    xvid_enc_create.bquant_ratio = 100 * avctx->b_quant_factor;
-    if( avctx->max_b_frames > 0  && !x->quicktime_format ) xvid_enc_create.global |= XVID_GLOBAL_PACKED;
-
-    /* Create encoder context */
-    xerr = xvid_encore(NULL, XVID_ENC_CREATE, &xvid_enc_create, NULL);
-    if( xerr ) {
-        av_log(avctx, AV_LOG_ERROR, "Xvid: Could not create encoder reference\n");
-        return -1;
-    }
-
-    x->encoder_handle = xvid_enc_create.handle;
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                             const AVFrame *picture, int *got_packet)
-{
-    int xerr, i, ret, user_packet = !!pkt->data;
-    char *tmp;
-    struct xvid_context *x = avctx->priv_data;
-    AVFrame *p = avctx->coded_frame;
-    int mb_width   = (avctx->width  + 15) / 16;
-    int mb_height  = (avctx->height + 15) / 16;
-
-    xvid_enc_frame_t xvid_enc_frame = { 0 };
-    xvid_enc_stats_t xvid_enc_stats = { 0 };
-
-    if (!user_packet &&
-        (ret = av_new_packet(pkt, mb_width*mb_height*MAX_MB_BYTES + FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    /* Start setting up the frame */
-    xvid_enc_frame.version = XVID_VERSION;
-    xvid_enc_stats.version = XVID_VERSION;
-
-    /* Let Xvid know where to put the frame. */
-    xvid_enc_frame.bitstream = pkt->data;
-    xvid_enc_frame.length    = pkt->size;
-
-    /* Initialize input image fields */
-    if( avctx->pix_fmt != AV_PIX_FMT_YUV420P ) {
-        av_log(avctx, AV_LOG_ERROR, "Xvid: Color spaces other than 420p not supported\n");
-        return -1;
-    }
-
-    xvid_enc_frame.input.csp = XVID_CSP_PLANAR; /* YUV420P */
-
-    for( i = 0; i < 4; i++ ) {
-        xvid_enc_frame.input.plane[i] = picture->data[i];
-        xvid_enc_frame.input.stride[i] = picture->linesize[i];
-    }
-
-    /* Encoder Flags */
-    xvid_enc_frame.vop_flags = x->vop_flags;
-    xvid_enc_frame.vol_flags = x->vol_flags;
-    xvid_enc_frame.motion = x->me_flags;
-    xvid_enc_frame.type =
-        picture->pict_type == AV_PICTURE_TYPE_I ? XVID_TYPE_IVOP :
-        picture->pict_type == AV_PICTURE_TYPE_P ? XVID_TYPE_PVOP :
-        picture->pict_type == AV_PICTURE_TYPE_B ? XVID_TYPE_BVOP :
-                                          XVID_TYPE_AUTO;
-
-    /* Pixel aspect ratio setting */
-    if (avctx->sample_aspect_ratio.num < 1 || avctx->sample_aspect_ratio.num > 255 ||
-        avctx->sample_aspect_ratio.den < 1 || avctx->sample_aspect_ratio.den > 255) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid pixel aspect ratio %i/%i\n",
-               avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den);
-        return -1;
-    }
-    xvid_enc_frame.par = XVID_PAR_EXT;
-    xvid_enc_frame.par_width  = avctx->sample_aspect_ratio.num;
-    xvid_enc_frame.par_height = avctx->sample_aspect_ratio.den;
-
-    /* Quant Setting */
-    if( x->qscale ) xvid_enc_frame.quant = picture->quality / FF_QP2LAMBDA;
-    else xvid_enc_frame.quant = 0;
-
-    /* Matrices */
-    xvid_enc_frame.quant_intra_matrix = x->intra_matrix;
-    xvid_enc_frame.quant_inter_matrix = x->inter_matrix;
-
-    /* Encode */
-    xerr = xvid_encore(x->encoder_handle, XVID_ENC_ENCODE,
-        &xvid_enc_frame, &xvid_enc_stats);
-
-    /* Two-pass log buffer swapping */
-    avctx->stats_out = NULL;
-    if( x->twopassbuffer ) {
-        tmp = x->old_twopassbuffer;
-        x->old_twopassbuffer = x->twopassbuffer;
-        x->twopassbuffer = tmp;
-        x->twopassbuffer[0] = 0;
-        if( x->old_twopassbuffer[0] != 0 ) {
-            avctx->stats_out = x->old_twopassbuffer;
-        }
-    }
-
-    if (xerr > 0) {
-        *got_packet = 1;
-
-        p->quality = xvid_enc_stats.quant * FF_QP2LAMBDA;
-        if( xvid_enc_stats.type == XVID_TYPE_PVOP )
-            p->pict_type = AV_PICTURE_TYPE_P;
-        else if( xvid_enc_stats.type == XVID_TYPE_BVOP )
-            p->pict_type = AV_PICTURE_TYPE_B;
-        else if( xvid_enc_stats.type == XVID_TYPE_SVOP )
-            p->pict_type = AV_PICTURE_TYPE_S;
-        else
-            p->pict_type = AV_PICTURE_TYPE_I;
-        if( xvid_enc_frame.out_flags & XVID_KEYFRAME ) {
-            p->key_frame = 1;
-            pkt->flags |= AV_PKT_FLAG_KEY;
-            if( x->quicktime_format )
-                return xvid_strip_vol_header(avctx, pkt,
-                    xvid_enc_stats.hlength, xerr);
-         } else
-            p->key_frame = 0;
-
-        pkt->size = xerr;
-
-        return 0;
-    } else {
-        if (!user_packet)
-            av_free_packet(pkt);
-        if (!xerr)
-            return 0;
-        av_log(avctx, AV_LOG_ERROR, "Xvid: Encoding Error Occurred: %i\n", xerr);
-        return -1;
-    }
-}
-
-static av_cold int xvid_encode_close(AVCodecContext *avctx) {
-    struct xvid_context *x = avctx->priv_data;
-
-    xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
-
-    av_freep(&avctx->extradata);
-    if( x->twopassbuffer != NULL ) {
-        av_free(x->twopassbuffer);
-        av_free(x->old_twopassbuffer);
-    }
-    av_free(x->twopassfile);
-    av_free(x->intra_matrix);
-    av_free(x->inter_matrix);
-
-    return 0;
-}
-
-AVCodec ff_libxvid_encoder = {
-    .name           = "libxvid",
-    .long_name      = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG4,
-    .priv_data_size = sizeof(struct xvid_context),
-    .init           = xvid_encode_init,
-    .encode2        = xvid_encode_frame,
-    .close          = xvid_encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/libxvid.h b/deps/libav/libavcodec/libxvid.h
deleted file mode 100644
index 413d353..0000000
--- a/deps/libav/libavcodec/libxvid.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * copyright (C) 2006 Corey Hickey
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_LIBXVID_H
-#define AVCODEC_LIBXVID_H
-
-/**
- * @file
- * common functions for use with the Xvid wrappers
- */
-
-
-int ff_tempfile(const char *prefix, char **filename);
-
-#endif /* AVCODEC_LIBXVID_H */
diff --git a/deps/libav/libavcodec/libxvid_rc.c b/deps/libav/libavcodec/libxvid_rc.c
deleted file mode 100644
index 7f4a89d..0000000
--- a/deps/libav/libavcodec/libxvid_rc.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Xvid rate control wrapper for lavc video encoders
- *
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <xvid.h>
-#include <unistd.h>
-#if !HAVE_MKSTEMP
-#include <fcntl.h>
-#endif
-
-#include "libavutil/attributes.h"
-#include "libavutil/internal.h"
-#include "avcodec.h"
-#include "libxvid.h"
-#include "mpegvideo.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-/* Wrapper to work around the lack of mkstemp() on mingw.
- * Also, tries to create file in /tmp first, if possible.
- * *prefix can be a character constant; *filename will be allocated internally.
- * @return file descriptor of opened file (or -1 on error)
- * and opened file name in **filename. */
-int ff_tempfile(const char *prefix, char **filename) {
-    int fd=-1;
-#if !HAVE_MKSTEMP
-    *filename = tempnam(".", prefix);
-#else
-    size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */
-    *filename = av_malloc(len);
-#endif
-    /* -----common section-----*/
-    if (*filename == NULL) {
-        av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n");
-        return -1;
-    }
-#if !HAVE_MKSTEMP
-    fd = avpriv_open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444);
-#else
-    snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
-    fd = mkstemp(*filename);
-    if (fd < 0) {
-        snprintf(*filename, len, "./%sXXXXXX", prefix);
-        fd = mkstemp(*filename);
-    }
-#endif
-    /* -----common section-----*/
-    if (fd < 0) {
-        av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
-        return -1;
-    }
-    return fd; /* success */
-}
-
-av_cold int ff_xvid_rate_control_init(MpegEncContext *s)
-{
-    char *tmp_name;
-    int fd, i;
-    xvid_plg_create_t xvid_plg_create = { 0 };
-    xvid_plugin_2pass2_t xvid_2pass2  = { 0 };
-
-    fd=ff_tempfile("xvidrc.", &tmp_name);
-    if (fd == -1) {
-        av_log(NULL, AV_LOG_ERROR, "Can't create temporary pass2 file.\n");
-        return -1;
-    }
-
-    for(i=0; i<s->rc_context.num_entries; i++){
-        static const char frame_types[] = " ipbs";
-        char tmp[256];
-        RateControlEntry *rce;
-
-        rce= &s->rc_context.entry[i];
-
-        snprintf(tmp, sizeof(tmp), "%c %d %d %d %d %d %d\n",
-            frame_types[rce->pict_type], (int)lrintf(rce->qscale / FF_QP2LAMBDA), rce->i_count, s->mb_num - rce->i_count - rce->skip_count,
-            rce->skip_count, (rce->i_tex_bits + rce->p_tex_bits + rce->misc_bits+7)/8, (rce->header_bits+rce->mv_bits+7)/8);
-
-        write(fd, tmp, strlen(tmp));
-    }
-
-    close(fd);
-
-    xvid_2pass2.version= XVID_MAKE_VERSION(1,1,0);
-    xvid_2pass2.filename= tmp_name;
-    xvid_2pass2.bitrate= s->avctx->bit_rate;
-    xvid_2pass2.vbv_size= s->avctx->rc_buffer_size;
-    xvid_2pass2.vbv_maxrate= s->avctx->rc_max_rate;
-    xvid_2pass2.vbv_initial= s->avctx->rc_initial_buffer_occupancy;
-
-    xvid_plg_create.version= XVID_MAKE_VERSION(1,1,0);
-    xvid_plg_create.fbase= s->avctx->time_base.den;
-    xvid_plg_create.fincr= s->avctx->time_base.num;
-    xvid_plg_create.param= &xvid_2pass2;
-
-    if(xvid_plugin_2pass2(NULL, XVID_PLG_CREATE, &xvid_plg_create, &s->rc_context.non_lavc_opaque)<0){
-        av_log(NULL, AV_LOG_ERROR, "xvid_plugin_2pass2 failed\n");
-        return -1;
-    }
-    return 0;
-}
-
-float ff_xvid_rate_estimate_qscale(MpegEncContext *s, int dry_run){
-    xvid_plg_data_t xvid_plg_data = { 0 };
-
-    xvid_plg_data.version= XVID_MAKE_VERSION(1,1,0);
-    xvid_plg_data.width = s->width;
-    xvid_plg_data.height= s->height;
-    xvid_plg_data.mb_width = s->mb_width;
-    xvid_plg_data.mb_height= s->mb_height;
-    xvid_plg_data.fbase= s->avctx->time_base.den;
-    xvid_plg_data.fincr= s->avctx->time_base.num;
-    xvid_plg_data.min_quant[0]= s->avctx->qmin;
-    xvid_plg_data.min_quant[1]= s->avctx->qmin;
-    xvid_plg_data.min_quant[2]= s->avctx->qmin; //FIXME i/b factor & offset
-    xvid_plg_data.max_quant[0]= s->avctx->qmax;
-    xvid_plg_data.max_quant[1]= s->avctx->qmax;
-    xvid_plg_data.max_quant[2]= s->avctx->qmax; //FIXME i/b factor & offset
-    xvid_plg_data.bquant_offset = 0; //  100 * s->avctx->b_quant_offset;
-    xvid_plg_data.bquant_ratio = 100; // * s->avctx->b_quant_factor;
-
-    if(!s->rc_context.dry_run_qscale){
-        if(s->picture_number){
-            xvid_plg_data.length=
-            xvid_plg_data.stats.length= (s->frame_bits + 7)/8;
-            xvid_plg_data.frame_num= s->rc_context.last_picture_number;
-            xvid_plg_data.quant= s->qscale;
-
-            xvid_plg_data.type= s->last_pict_type;
-            if(xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_AFTER, &xvid_plg_data, NULL)){
-                av_log(s->avctx, AV_LOG_ERROR, "xvid_plugin_2pass2(handle, XVID_PLG_AFTER, ...) FAILED\n");
-                return -1;
-            }
-        }
-        s->rc_context.last_picture_number=
-        xvid_plg_data.frame_num= s->picture_number;
-        xvid_plg_data.quant= 0;
-        if(xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_BEFORE, &xvid_plg_data, NULL)){
-            av_log(s->avctx, AV_LOG_ERROR, "xvid_plugin_2pass2(handle, XVID_PLG_BEFORE, ...) FAILED\n");
-            return -1;
-        }
-        s->rc_context.dry_run_qscale= xvid_plg_data.quant;
-    }
-    xvid_plg_data.quant= s->rc_context.dry_run_qscale;
-    if(!dry_run)
-        s->rc_context.dry_run_qscale= 0;
-
-    if(s->pict_type == AV_PICTURE_TYPE_B) //FIXME this is not exactly identical to xvid
-        return xvid_plg_data.quant * FF_QP2LAMBDA * s->avctx->b_quant_factor + s->avctx->b_quant_offset;
-    else
-        return xvid_plg_data.quant * FF_QP2LAMBDA;
-}
-
-av_cold void ff_xvid_rate_control_uninit(MpegEncContext *s)
-{
-    xvid_plg_destroy_t xvid_plg_destroy;
-
-    xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_DESTROY, &xvid_plg_destroy, NULL);
-}
diff --git a/deps/libav/libavcodec/ljpegenc.c b/deps/libav/libavcodec/ljpegenc.c
deleted file mode 100644
index 7eb4675..0000000
--- a/deps/libav/libavcodec/ljpegenc.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * lossless JPEG encoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003 Alex Beregszaszi
- * Copyright (c) 2003-2004 Michael Niedermayer
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- *                                  by Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * lossless JPEG encoder.
- */
-
-#include "libavutil/frame.h"
-#include "libavutil/mem.h"
-#include "libavutil/pixdesc.h"
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "mpegvideo.h"
-#include "mjpeg.h"
-#include "mjpegenc.h"
-
-typedef struct LJpegEncContext {
-    DSPContext dsp;
-    ScanTable scantable;
-    uint16_t matrix[64];
-
-    int vsample[3];
-    int hsample[3];
-
-    uint16_t huff_code_dc_luminance[12];
-    uint16_t huff_code_dc_chrominance[12];
-    uint8_t  huff_size_dc_luminance[12];
-    uint8_t  huff_size_dc_chrominance[12];
-
-    uint16_t (*scratch)[4];
-} LJpegEncContext;
-
-static int ljpeg_encode_bgr(AVCodecContext *avctx, PutBitContext *pb,
-                            const AVFrame *frame)
-{
-    LJpegEncContext *s    = avctx->priv_data;
-    const int width       = frame->width;
-    const int height      = frame->height;
-    const int linesize    = frame->linesize[0];
-    uint16_t (*buffer)[4] = s->scratch;
-    const int predictor   = avctx->prediction_method+1;
-    int left[3], top[3], topleft[3];
-    int x, y, i;
-
-    for (i = 0; i < 3; i++)
-        buffer[0][i] = 1 << (9 - 1);
-
-    for (y = 0; y < height; y++) {
-        const int modified_predictor = y ? predictor : 1;
-        uint8_t *ptr = frame->data[0] + (linesize * y);
-
-        if (pb->buf_end - pb->buf - (put_bits_count(pb) >> 3) < width * 3 * 3) {
-            av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
-            return -1;
-        }
-
-        for (i = 0; i < 3; i++)
-            top[i]= left[i]= topleft[i]= buffer[0][i];
-
-        for (x = 0; x < width; x++) {
-            buffer[x][1] =  ptr[3 * x + 0] -     ptr[3 * x + 1] + 0x100;
-            buffer[x][2] =  ptr[3 * x + 2] -     ptr[3 * x + 1] + 0x100;
-            buffer[x][0] = (ptr[3 * x + 0] + 2 * ptr[3 * x + 1] + ptr[3 * x + 2]) >> 2;
-
-            for (i = 0; i < 3; i++) {
-                int pred, diff;
-
-                PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
-
-                topleft[i] = top[i];
-                top[i]     = buffer[x+1][i];
-
-                left[i]    = buffer[x][i];
-
-                diff       = ((left[i] - pred + 0x100) & 0x1FF) - 0x100;
-
-                if (i == 0)
-                    ff_mjpeg_encode_dc(pb, diff, s->huff_size_dc_luminance, s->huff_code_dc_luminance); //FIXME ugly
-                else
-                    ff_mjpeg_encode_dc(pb, diff, s->huff_size_dc_chrominance, s->huff_code_dc_chrominance);
-            }
-        }
-    }
-
-    return 0;
-}
-
-static inline void ljpeg_encode_yuv_mb(LJpegEncContext *s, PutBitContext *pb,
-                                       const AVFrame *frame, int predictor,
-                                       int mb_x, int mb_y)
-{
-    int i;
-
-    if (mb_x == 0 || mb_y == 0) {
-        for (i = 0; i < 3; i++) {
-            uint8_t *ptr;
-            int x, y, h, v, linesize;
-            h = s->hsample[i];
-            v = s->vsample[i];
-            linesize = frame->linesize[i];
-
-            for (y = 0; y < v; y++) {
-                for (x = 0; x < h; x++) {
-                    int pred;
-
-                    ptr = frame->data[i] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
-                    if (y == 0 && mb_y == 0) {
-                        if (x == 0 && mb_x == 0)
-                            pred = 128;
-                        else
-                            pred = ptr[-1];
-                    } else {
-                        if (x == 0 && mb_x == 0) {
-                            pred = ptr[-linesize];
-                        } else {
-                            PREDICT(pred, ptr[-linesize - 1], ptr[-linesize],
-                                    ptr[-1], predictor);
-                        }
-                    }
-
-                    if (i == 0)
-                        ff_mjpeg_encode_dc(pb, *ptr - pred, s->huff_size_dc_luminance, s->huff_code_dc_luminance); //FIXME ugly
-                    else
-                        ff_mjpeg_encode_dc(pb, *ptr - pred, s->huff_size_dc_chrominance, s->huff_code_dc_chrominance);
-                }
-            }
-        }
-    } else {
-        for (i = 0; i < 3; i++) {
-            uint8_t *ptr;
-            int x, y, h, v, linesize;
-            h = s->hsample[i];
-            v = s->vsample[i];
-            linesize = frame->linesize[i];
-
-            for (y = 0; y < v; y++) {
-                for (x = 0; x < h; x++) {
-                    int pred;
-
-                    ptr = frame->data[i] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
-                    PREDICT(pred, ptr[-linesize - 1], ptr[-linesize], ptr[-1], predictor);
-
-                    if (i == 0)
-                        ff_mjpeg_encode_dc(pb, *ptr - pred, s->huff_size_dc_luminance, s->huff_code_dc_luminance); //FIXME ugly
-                    else
-                        ff_mjpeg_encode_dc(pb, *ptr - pred, s->huff_size_dc_chrominance, s->huff_code_dc_chrominance);
-                }
-            }
-        }
-    }
-}
-
-static int ljpeg_encode_yuv(AVCodecContext *avctx, PutBitContext *pb,
-                            const AVFrame *frame)
-{
-    const int predictor = avctx->prediction_method + 1;
-    LJpegEncContext *s  = avctx->priv_data;
-    const int mb_width  = (avctx->width  + s->hsample[0] - 1) / s->hsample[0];
-    const int mb_height = (avctx->height + s->vsample[0] - 1) / s->vsample[0];
-    int mb_x, mb_y;
-
-    for (mb_y = 0; mb_y < mb_height; mb_y++) {
-        if (pb->buf_end - pb->buf - (put_bits_count(pb) >> 3) <
-            mb_width * 4 * 3 * s->hsample[0] * s->vsample[0]) {
-            av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
-            return -1;
-        }
-
-        for (mb_x = 0; mb_x < mb_width; mb_x++)
-            ljpeg_encode_yuv_mb(s, pb, frame, predictor, mb_x, mb_y);
-    }
-
-    return 0;
-}
-
-static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                              const AVFrame *pict, int *got_packet)
-{
-    LJpegEncContext *s = avctx->priv_data;
-    PutBitContext pb;
-    const int width  = avctx->width;
-    const int height = avctx->height;
-    const int mb_width  = (width  + s->hsample[0] - 1) / s->hsample[0];
-    const int mb_height = (height + s->vsample[0] - 1) / s->vsample[0];
-    int max_pkt_size = FF_MIN_BUFFER_SIZE;
-    int ret, header_bits;
-
-    if (avctx->pix_fmt == AV_PIX_FMT_BGR24)
-        max_pkt_size += width * height * 3 * 3;
-    else {
-        max_pkt_size += mb_width * mb_height * 3 * 4
-                        * s->hsample[0] * s->vsample[0];
-    }
-    if ((ret = ff_alloc_packet(pkt, max_pkt_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", max_pkt_size);
-        return ret;
-    }
-
-    init_put_bits(&pb, pkt->data, pkt->size);
-
-    ff_mjpeg_encode_picture_header(avctx, &pb, &s->scantable,
-                                   s->matrix);
-
-    header_bits = put_bits_count(&pb);
-
-    if (avctx->pix_fmt == AV_PIX_FMT_BGR24)
-        ret = ljpeg_encode_bgr(avctx, &pb, pict);
-    else
-        ret = ljpeg_encode_yuv(avctx, &pb, pict);
-    if (ret < 0)
-        return ret;
-
-    emms_c();
-
-    ff_mjpeg_encode_picture_trailer(&pb, header_bits);
-
-    flush_put_bits(&pb);
-    pkt->size   = put_bits_ptr(&pb) - pb.buf;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int ljpeg_encode_close(AVCodecContext *avctx)
-{
-    LJpegEncContext *s = avctx->priv_data;
-
-    av_frame_free(&avctx->coded_frame);
-    av_freep(&s->scratch);
-
-    return 0;
-}
-
-static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
-{
-    LJpegEncContext *s = avctx->priv_data;
-    int chroma_v_shift, chroma_h_shift;
-
-    if ((avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
-         avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
-         avctx->pix_fmt == AV_PIX_FMT_YUV444P) &&
-        avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Limited range YUV is non-standard, set strict_std_compliance to "
-               "at least unofficial to use it.\n");
-        return AVERROR(EINVAL);
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    s->scratch = av_malloc_array(avctx->width + 1, sizeof(*s->scratch));
-
-    ff_dsputil_init(&s->dsp, avctx);
-    ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
-
-    av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift,
-                                     &chroma_v_shift);
-
-    if (avctx->pix_fmt   == AV_PIX_FMT_BGR24) {
-        s->vsample[0] = s->hsample[0] =
-        s->vsample[1] = s->hsample[1] =
-        s->vsample[2] = s->hsample[2] = 1;
-    } else {
-        s->vsample[0] = 2;
-        s->vsample[1] = 2 >> chroma_v_shift;
-        s->vsample[2] = 2 >> chroma_v_shift;
-        s->hsample[0] = 2;
-        s->hsample[1] = 2 >> chroma_h_shift;
-        s->hsample[2] = 2 >> chroma_h_shift;
-    }
-
-    ff_mjpeg_build_huffman_codes(s->huff_size_dc_luminance,
-                                 s->huff_code_dc_luminance,
-                                 avpriv_mjpeg_bits_dc_luminance,
-                                 avpriv_mjpeg_val_dc);
-    ff_mjpeg_build_huffman_codes(s->huff_size_dc_chrominance,
-                                 s->huff_code_dc_chrominance,
-                                 avpriv_mjpeg_bits_dc_chrominance,
-                                 avpriv_mjpeg_val_dc);
-
-    return 0;
-}
-
-AVCodec ff_ljpeg_encoder = {
-    .name           = "ljpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("Lossless JPEG"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_LJPEG,
-    .priv_data_size = sizeof(LJpegEncContext),
-    .init           = ljpeg_encode_init,
-    .encode2        = ljpeg_encode_frame,
-    .close          = ljpeg_encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ420P,
-                                                    AV_PIX_FMT_YUVJ422P,
-                                                    AV_PIX_FMT_YUVJ444P,
-                                                    AV_PIX_FMT_BGR24,
-                                                    AV_PIX_FMT_YUV420P,
-                                                    AV_PIX_FMT_YUV422P,
-                                                    AV_PIX_FMT_YUVJ444P,
-                                                    AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/loco.c b/deps/libav/libavcodec/loco.c
deleted file mode 100644
index 6be081d..0000000
--- a/deps/libav/libavcodec/loco.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * LOCO codec
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * LOCO codec.
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "golomb.h"
-#include "internal.h"
-#include "mathops.h"
-
-enum LOCO_MODE {
-    LOCO_UNKN  =  0,
-    LOCO_CYUY2 = -1,
-    LOCO_CRGB  = -2,
-    LOCO_CRGBA = -3,
-    LOCO_CYV12 = -4,
-    LOCO_YUY2  =  1,
-    LOCO_UYVY  =  2,
-    LOCO_RGB   =  3,
-    LOCO_RGBA  =  4,
-    LOCO_YV12  =  5,
-};
-
-typedef struct LOCOContext {
-    AVCodecContext *avctx;
-    int lossy;
-    int mode;
-} LOCOContext;
-
-typedef struct RICEContext {
-    GetBitContext gb;
-    int save, run, run2; /* internal rice decoder state */
-    int sum, count; /* sum and count for getting rice parameter */
-    int lossy;
-} RICEContext;
-
-static int loco_get_rice_param(RICEContext *r)
-{
-    int cnt = 0;
-    int val = r->count;
-
-    while (r->sum > val && cnt < 9) {
-        val <<= 1;
-        cnt++;
-    }
-
-    return cnt;
-}
-
-static inline void loco_update_rice_param(RICEContext *r, int val)
-{
-    r->sum += val;
-    r->count++;
-
-    if (r->count == 16) {
-        r->sum   >>= 1;
-        r->count >>= 1;
-    }
-}
-
-static inline int loco_get_rice(RICEContext *r)
-{
-    int v;
-    if (r->run > 0) { /* we have zero run */
-        r->run--;
-        loco_update_rice_param(r, 0);
-        return 0;
-    }
-    v = get_ur_golomb_jpegls(&r->gb, loco_get_rice_param(r), INT_MAX, 0);
-    loco_update_rice_param(r, (v + 1) >> 1);
-    if (!v) {
-        if (r->save >= 0) {
-            r->run = get_ur_golomb_jpegls(&r->gb, 2, INT_MAX, 0);
-            if (r->run > 1)
-                r->save += r->run + 1;
-            else
-                r->save -= 3;
-        } else
-            r->run2++;
-    } else {
-        v = ((v >> 1) + r->lossy) ^ -(v & 1);
-        if (r->run2 > 0) {
-            if (r->run2 > 2)
-                r->save += r->run2;
-            else
-                r->save -= 3;
-            r->run2 = 0;
-        }
-    }
-
-    return v;
-}
-
-/* LOCO main predictor - LOCO-I/JPEG-LS predictor */
-static inline int loco_predict(uint8_t* data, int stride, int step)
-{
-    int a, b, c;
-
-    a = data[-stride];
-    b = data[-step];
-    c = data[-stride - step];
-
-    return mid_pred(a, a + b - c, b);
-}
-
-static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int height,
-                             int stride, const uint8_t *buf, int buf_size, int step)
-{
-    RICEContext rc;
-    int val;
-    int i, j;
-
-    init_get_bits(&rc.gb, buf, buf_size*8);
-    rc.save  = 0;
-    rc.run   = 0;
-    rc.run2  = 0;
-    rc.lossy = l->lossy;
-
-    rc.sum   = 8;
-    rc.count = 1;
-
-    /* restore top left pixel */
-    val     = loco_get_rice(&rc);
-    data[0] = 128 + val;
-    /* restore top line */
-    for (i = 1; i < width; i++) {
-        val = loco_get_rice(&rc);
-        data[i * step] = data[i * step - step] + val;
-    }
-    data += stride;
-    for (j = 1; j < height; j++) {
-        /* restore left column */
-        val = loco_get_rice(&rc);
-        data[0] = data[-stride] + val;
-        /* restore all other pixels */
-        for (i = 1; i < width; i++) {
-            val = loco_get_rice(&rc);
-            data[i * step] = loco_predict(&data[i * step], stride, step) + val;
-        }
-        data += stride;
-    }
-
-    return (get_bits_count(&rc.gb) + 7) >> 3;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    LOCOContext * const l = avctx->priv_data;
-    const uint8_t *buf    = avpkt->data;
-    int buf_size          = avpkt->size;
-    AVFrame * const p     = data;
-    int decoded, ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    p->key_frame = 1;
-
-    switch(l->mode) {
-    case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY:
-        decoded = loco_decode_plane(l, p->data[0], avctx->width, avctx->height,
-                                    p->linesize[0], buf, buf_size, 1);
-        if (decoded >= buf_size)
-            goto buf_too_small;
-        buf += decoded; buf_size -= decoded;
-
-        decoded = loco_decode_plane(l, p->data[1], avctx->width / 2, avctx->height,
-                                    p->linesize[1], buf, buf_size, 1);
-        if (decoded >= buf_size)
-            goto buf_too_small;
-        buf += decoded; buf_size -= decoded;
-
-        decoded = loco_decode_plane(l, p->data[2], avctx->width / 2, avctx->height,
-                                    p->linesize[2], buf, buf_size, 1);
-        break;
-    case LOCO_CYV12: case LOCO_YV12:
-        decoded = loco_decode_plane(l, p->data[0], avctx->width, avctx->height,
-                                    p->linesize[0], buf, buf_size, 1);
-        if (decoded >= buf_size)
-            goto buf_too_small;
-        buf += decoded; buf_size -= decoded;
-
-        decoded = loco_decode_plane(l, p->data[2], avctx->width / 2, avctx->height / 2,
-                                    p->linesize[2], buf, buf_size, 1);
-        if (decoded >= buf_size)
-            goto buf_too_small;
-        buf += decoded; buf_size -= decoded;
-
-        decoded = loco_decode_plane(l, p->data[1], avctx->width / 2, avctx->height / 2,
-                                    p->linesize[1], buf, buf_size, 1);
-        break;
-    case LOCO_CRGB: case LOCO_RGB:
-        decoded = loco_decode_plane(l, p->data[0] + p->linesize[0]*(avctx->height-1), avctx->width, avctx->height,
-                                    -p->linesize[0], buf, buf_size, 3);
-        if (decoded >= buf_size)
-            goto buf_too_small;
-        buf += decoded; buf_size -= decoded;
-
-        decoded = loco_decode_plane(l, p->data[0] + p->linesize[0]*(avctx->height-1) + 1, avctx->width, avctx->height,
-                                    -p->linesize[0], buf, buf_size, 3);
-        if (decoded >= buf_size)
-            goto buf_too_small;
-        buf += decoded; buf_size -= decoded;
-
-        decoded = loco_decode_plane(l, p->data[0] + p->linesize[0]*(avctx->height-1) + 2, avctx->width, avctx->height,
-                                    -p->linesize[0], buf, buf_size, 3);
-        break;
-    case LOCO_RGBA:
-        decoded = loco_decode_plane(l, p->data[0], avctx->width, avctx->height,
-                                    p->linesize[0], buf, buf_size, 4);
-        if (decoded >= buf_size)
-            goto buf_too_small;
-        buf += decoded; buf_size -= decoded;
-
-        decoded = loco_decode_plane(l, p->data[0] + 1, avctx->width, avctx->height,
-                                    p->linesize[0], buf, buf_size, 4);
-        if (decoded >= buf_size)
-            goto buf_too_small;
-        buf += decoded; buf_size -= decoded;
-
-        decoded = loco_decode_plane(l, p->data[0] + 2, avctx->width, avctx->height,
-                                    p->linesize[0], buf, buf_size, 4);
-        if (decoded >= buf_size)
-            goto buf_too_small;
-        buf += decoded; buf_size -= decoded;
-
-        decoded = loco_decode_plane(l, p->data[0] + 3, avctx->width, avctx->height,
-                                    p->linesize[0], buf, buf_size, 4);
-        break;
-    }
-
-    *got_frame      = 1;
-
-    return buf_size;
-buf_too_small:
-    av_log(avctx, AV_LOG_ERROR, "Input data too small.\n");
-    return AVERROR(EINVAL);
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    LOCOContext * const l = avctx->priv_data;
-    int version;
-
-    l->avctx = avctx;
-    if (avctx->extradata_size < 12) {
-        av_log(avctx, AV_LOG_ERROR, "Extradata size must be >= 12 instead of %i\n",
-               avctx->extradata_size);
-        return AVERROR_INVALIDDATA;
-    }
-    version = AV_RL32(avctx->extradata);
-    switch (version) {
-    case 1:
-        l->lossy = 0;
-        break;
-    case 2:
-        l->lossy = AV_RL32(avctx->extradata + 8);
-        break;
-    default:
-        l->lossy = AV_RL32(avctx->extradata + 8);
-        avpriv_request_sample(avctx, "LOCO codec version %i", version);
-    }
-
-    l->mode = AV_RL32(avctx->extradata + 4);
-    switch (l->mode) {
-    case LOCO_CYUY2:
-    case LOCO_YUY2:
-    case LOCO_UYVY:
-        avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-        break;
-    case LOCO_CRGB:
-    case LOCO_RGB:
-        avctx->pix_fmt = AV_PIX_FMT_BGR24;
-        break;
-    case LOCO_CYV12:
-    case LOCO_YV12:
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-        break;
-    case LOCO_CRGBA:
-    case LOCO_RGBA:
-        avctx->pix_fmt = AV_PIX_FMT_RGB32;
-        break;
-    default:
-        av_log(avctx, AV_LOG_INFO, "Unknown colorspace, index = %i\n", l->mode);
-        return AVERROR_INVALIDDATA;
-    }
-    if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(avctx, AV_LOG_INFO, "lossy:%i, version:%i, mode: %i\n", l->lossy, version, l->mode);
-
-    return 0;
-}
-
-AVCodec ff_loco_decoder = {
-    .name           = "loco",
-    .long_name      = NULL_IF_CONFIG_SMALL("LOCO"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_LOCO,
-    .priv_data_size = sizeof(LOCOContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/log2_tab.c b/deps/libav/libavcodec/log2_tab.c
deleted file mode 100644
index 47a1df0..0000000
--- a/deps/libav/libavcodec/log2_tab.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "libavutil/log2_tab.c"
diff --git a/deps/libav/libavcodec/lpc.c b/deps/libav/libavcodec/lpc.c
deleted file mode 100644
index fbd1bdf..0000000
--- a/deps/libav/libavcodec/lpc.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * LPC utility code
- * Copyright (c) 2006  Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/lls.h"
-
-#define LPC_USE_DOUBLE
-#include "lpc.h"
-
-
-/**
- * Apply Welch window function to audio block
- */
-static void lpc_apply_welch_window_c(const int32_t *data, int len,
-                                     double *w_data)
-{
-    int i, n2;
-    double w;
-    double c;
-
-    /* The optimization in commit fa4ed8c does not support odd len.
-     * If someone wants odd len extend that change. */
-    assert(!(len & 1));
-
-    n2 = (len >> 1);
-    c = 2.0 / (len - 1.0);
-
-    w_data+=n2;
-      data+=n2;
-    for(i=0; i<n2; i++) {
-        w = c - n2 + i;
-        w = 1.0 - (w * w);
-        w_data[-i-1] = data[-i-1] * w;
-        w_data[+i  ] = data[+i  ] * w;
-    }
-}
-
-/**
- * Calculate autocorrelation data from audio samples
- * A Welch window function is applied before calculation.
- */
-static void lpc_compute_autocorr_c(const double *data, int len, int lag,
-                                   double *autoc)
-{
-    int i, j;
-
-    for(j=0; j<lag; j+=2){
-        double sum0 = 1.0, sum1 = 1.0;
-        for(i=j; i<len; i++){
-            sum0 += data[i] * data[i-j];
-            sum1 += data[i] * data[i-j-1];
-        }
-        autoc[j  ] = sum0;
-        autoc[j+1] = sum1;
-    }
-
-    if(j==lag){
-        double sum = 1.0;
-        for(i=j-1; i<len; i+=2){
-            sum += data[i  ] * data[i-j  ]
-                 + data[i+1] * data[i-j+1];
-        }
-        autoc[j] = sum;
-    }
-}
-
-/**
- * Quantize LPC coefficients
- */
-static void quantize_lpc_coefs(double *lpc_in, int order, int precision,
-                               int32_t *lpc_out, int *shift, int max_shift, int zero_shift)
-{
-    int i;
-    double cmax, error;
-    int32_t qmax;
-    int sh;
-
-    /* define maximum levels */
-    qmax = (1 << (precision - 1)) - 1;
-
-    /* find maximum coefficient value */
-    cmax = 0.0;
-    for(i=0; i<order; i++) {
-        cmax= FFMAX(cmax, fabs(lpc_in[i]));
-    }
-
-    /* if maximum value quantizes to zero, return all zeros */
-    if(cmax * (1 << max_shift) < 1.0) {
-        *shift = zero_shift;
-        memset(lpc_out, 0, sizeof(int32_t) * order);
-        return;
-    }
-
-    /* calculate level shift which scales max coeff to available bits */
-    sh = max_shift;
-    while((cmax * (1 << sh) > qmax) && (sh > 0)) {
-        sh--;
-    }
-
-    /* since negative shift values are unsupported in decoder, scale down
-       coefficients instead */
-    if(sh == 0 && cmax > qmax) {
-        double scale = ((double)qmax) / cmax;
-        for(i=0; i<order; i++) {
-            lpc_in[i] *= scale;
-        }
-    }
-
-    /* output quantized coefficients and level shift */
-    error=0;
-    for(i=0; i<order; i++) {
-        error -= lpc_in[i] * (1 << sh);
-        lpc_out[i] = av_clip(lrintf(error), -qmax, qmax);
-        error -= lpc_out[i];
-    }
-    *shift = sh;
-}
-
-static int estimate_best_order(double *ref, int min_order, int max_order)
-{
-    int i, est;
-
-    est = min_order;
-    for(i=max_order-1; i>=min_order-1; i--) {
-        if(ref[i] > 0.10) {
-            est = i+1;
-            break;
-        }
-    }
-    return est;
-}
-
-int ff_lpc_calc_ref_coefs(LPCContext *s,
-                          const int32_t *samples, int order, double *ref)
-{
-    double autoc[MAX_LPC_ORDER + 1];
-
-    s->lpc_apply_welch_window(samples, s->blocksize, s->windowed_samples);
-    s->lpc_compute_autocorr(s->windowed_samples, s->blocksize, order, autoc);
-    compute_ref_coefs(autoc, order, ref, NULL);
-
-    return order;
-}
-
-/**
- * Calculate LPC coefficients for multiple orders
- *
- * @param lpc_type LPC method for determining coefficients,
- *                 see #FFLPCType for details
- */
-int ff_lpc_calc_coefs(LPCContext *s,
-                      const int32_t *samples, int blocksize, int min_order,
-                      int max_order, int precision,
-                      int32_t coefs[][MAX_LPC_ORDER], int *shift,
-                      enum FFLPCType lpc_type, int lpc_passes,
-                      int omethod, int max_shift, int zero_shift)
-{
-    double autoc[MAX_LPC_ORDER+1];
-    double ref[MAX_LPC_ORDER];
-    double lpc[MAX_LPC_ORDER][MAX_LPC_ORDER];
-    int i, j, pass = 0;
-    int opt_order;
-
-    assert(max_order >= MIN_LPC_ORDER && max_order <= MAX_LPC_ORDER &&
-           lpc_type > FF_LPC_TYPE_FIXED);
-
-    /* reinit LPC context if parameters have changed */
-    if (blocksize != s->blocksize || max_order != s->max_order ||
-        lpc_type  != s->lpc_type) {
-        ff_lpc_end(s);
-        ff_lpc_init(s, blocksize, max_order, lpc_type);
-    }
-
-    if (lpc_type == FF_LPC_TYPE_LEVINSON || (lpc_type == FF_LPC_TYPE_CHOLESKY && lpc_passes > 1)) {
-        s->lpc_apply_welch_window(samples, blocksize, s->windowed_samples);
-
-        s->lpc_compute_autocorr(s->windowed_samples, blocksize, max_order, autoc);
-
-        compute_lpc_coefs(autoc, max_order, &lpc[0][0], MAX_LPC_ORDER, 0, 1);
-
-        for(i=0; i<max_order; i++)
-            ref[i] = fabs(lpc[i][i]);
-
-        pass++;
-    }
-
-    if (lpc_type == FF_LPC_TYPE_CHOLESKY) {
-        LLSModel m[2];
-        LOCAL_ALIGNED(32, double, var, [FFALIGN(MAX_LPC_ORDER+1,4)]);
-        double av_uninit(weight);
-        memset(var, 0, FFALIGN(MAX_LPC_ORDER+1,4)*sizeof(*var));
-
-        for(j=0; j<max_order; j++)
-            m[0].coeff[max_order-1][j] = -lpc[max_order-1][j];
-
-        for(; pass<lpc_passes; pass++){
-            avpriv_init_lls(&m[pass&1], max_order);
-
-            weight=0;
-            for(i=max_order; i<blocksize; i++){
-                for(j=0; j<=max_order; j++)
-                    var[j]= samples[i-j];
-
-                if(pass){
-                    double eval, inv, rinv;
-                    eval= m[pass&1].evaluate_lls(&m[(pass-1)&1], var+1, max_order-1);
-                    eval= (512>>pass) + fabs(eval - var[0]);
-                    inv = 1/eval;
-                    rinv = sqrt(inv);
-                    for(j=0; j<=max_order; j++)
-                        var[j] *= rinv;
-                    weight += inv;
-                }else
-                    weight++;
-
-                m[pass&1].update_lls(&m[pass&1], var);
-            }
-            avpriv_solve_lls(&m[pass&1], 0.001, 0);
-        }
-
-        for(i=0; i<max_order; i++){
-            for(j=0; j<max_order; j++)
-                lpc[i][j]=-m[(pass-1)&1].coeff[i][j];
-            ref[i]= sqrt(m[(pass-1)&1].variance[i] / weight) * (blocksize - max_order) / 4000;
-        }
-        for(i=max_order-1; i>0; i--)
-            ref[i] = ref[i-1] - ref[i];
-    }
-    opt_order = max_order;
-
-    if(omethod == ORDER_METHOD_EST) {
-        opt_order = estimate_best_order(ref, min_order, max_order);
-        i = opt_order-1;
-        quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift);
-    } else {
-        for(i=min_order-1; i<max_order; i++) {
-            quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift);
-        }
-    }
-
-    return opt_order;
-}
-
-av_cold int ff_lpc_init(LPCContext *s, int blocksize, int max_order,
-                        enum FFLPCType lpc_type)
-{
-    s->blocksize = blocksize;
-    s->max_order = max_order;
-    s->lpc_type  = lpc_type;
-
-    s->windowed_buffer = av_mallocz((blocksize + 2 + FFALIGN(max_order, 4)) *
-                                    sizeof(*s->windowed_samples));
-    if (!s->windowed_buffer)
-        return AVERROR(ENOMEM);
-    s->windowed_samples = s->windowed_buffer + FFALIGN(max_order, 4);
-
-    s->lpc_apply_welch_window = lpc_apply_welch_window_c;
-    s->lpc_compute_autocorr   = lpc_compute_autocorr_c;
-
-    if (ARCH_X86)
-        ff_lpc_init_x86(s);
-
-    return 0;
-}
-
-av_cold void ff_lpc_end(LPCContext *s)
-{
-    av_freep(&s->windowed_buffer);
-}
diff --git a/deps/libav/libavcodec/lpc.h b/deps/libav/libavcodec/lpc.h
deleted file mode 100644
index c41a1f8..0000000
--- a/deps/libav/libavcodec/lpc.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * LPC utility code
- * Copyright (c) 2006  Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_LPC_H
-#define AVCODEC_LPC_H
-
-#include <stdint.h>
-
-#define ORDER_METHOD_EST     0
-#define ORDER_METHOD_2LEVEL  1
-#define ORDER_METHOD_4LEVEL  2
-#define ORDER_METHOD_8LEVEL  3
-#define ORDER_METHOD_SEARCH  4
-#define ORDER_METHOD_LOG     5
-
-#define MIN_LPC_ORDER        1
-#define MAX_LPC_ORDER       32
-
-/**
- * LPC analysis type
- */
-enum FFLPCType {
-    FF_LPC_TYPE_DEFAULT     = -1, ///< use the codec default LPC type
-    FF_LPC_TYPE_NONE        =  0, ///< do not use LPC prediction or use all zero coefficients
-    FF_LPC_TYPE_FIXED       =  1, ///< fixed LPC coefficients
-    FF_LPC_TYPE_LEVINSON    =  2, ///< Levinson-Durbin recursion
-    FF_LPC_TYPE_CHOLESKY    =  3, ///< Cholesky factorization
-    FF_LPC_TYPE_NB              , ///< Not part of ABI
-};
-
-typedef struct LPCContext {
-    int blocksize;
-    int max_order;
-    enum FFLPCType lpc_type;
-    double *windowed_buffer;
-    double *windowed_samples;
-
-    /**
-     * Apply a Welch window to an array of input samples.
-     * The output samples have the same scale as the input, but are in double
-     * sample format.
-     * @param data    input samples
-     * @param len     number of input samples
-     * @param w_data  output samples
-     */
-    void (*lpc_apply_welch_window)(const int32_t *data, int len,
-                                   double *w_data);
-    /**
-     * Perform autocorrelation on input samples with delay of 0 to lag.
-     * @param data  input samples.
-     *              constraints: no alignment needed, but must have have at
-     *              least lag*sizeof(double) valid bytes preceding it, and
-     *              size must be at least (len+1)*sizeof(double) if data is
-     *              16-byte aligned or (len+2)*sizeof(double) if data is
-     *              unaligned.
-     * @param len   number of input samples to process
-     * @param lag   maximum delay to calculate
-     * @param autoc output autocorrelation coefficients.
-     *              constraints: array size must be at least lag+1.
-     */
-    void (*lpc_compute_autocorr)(const double *data, int len, int lag,
-                                 double *autoc);
-} LPCContext;
-
-
-/**
- * Calculate LPC coefficients for multiple orders
- */
-int ff_lpc_calc_coefs(LPCContext *s,
-                      const int32_t *samples, int blocksize, int min_order,
-                      int max_order, int precision,
-                      int32_t coefs[][MAX_LPC_ORDER], int *shift,
-                      enum FFLPCType lpc_type, int lpc_passes,
-                      int omethod, int max_shift, int zero_shift);
-
-int ff_lpc_calc_ref_coefs(LPCContext *s,
-                          const int32_t *samples, int order, double *ref);
-
-/**
- * Initialize LPCContext.
- */
-int ff_lpc_init(LPCContext *s, int blocksize, int max_order,
-                enum FFLPCType lpc_type);
-void ff_lpc_init_x86(LPCContext *s);
-
-/**
- * Uninitialize LPCContext.
- */
-void ff_lpc_end(LPCContext *s);
-
-#ifdef LPC_USE_DOUBLE
-#define LPC_TYPE double
-#else
-#define LPC_TYPE float
-#endif
-
-/**
- * Schur recursion.
- * Produces reflection coefficients from autocorrelation data.
- */
-static inline void compute_ref_coefs(const LPC_TYPE *autoc, int max_order,
-                                     LPC_TYPE *ref, LPC_TYPE *error)
-{
-    int i, j;
-    LPC_TYPE err;
-    LPC_TYPE gen0[MAX_LPC_ORDER], gen1[MAX_LPC_ORDER];
-
-    for (i = 0; i < max_order; i++)
-        gen0[i] = gen1[i] = autoc[i + 1];
-
-    err    = autoc[0];
-    ref[0] = -gen1[0] / err;
-    err   +=  gen1[0] * ref[0];
-    if (error)
-        error[0] = err;
-    for (i = 1; i < max_order; i++) {
-        for (j = 0; j < max_order - i; j++) {
-            gen1[j] = gen1[j + 1] + ref[i - 1] * gen0[j];
-            gen0[j] = gen1[j + 1] * ref[i - 1] + gen0[j];
-        }
-        ref[i] = -gen1[0] / err;
-        err   +=  gen1[0] * ref[i];
-        if (error)
-            error[i] = err;
-    }
-}
-
-/**
- * Levinson-Durbin recursion.
- * Produce LPC coefficients from autocorrelation data.
- */
-static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order,
-                                    LPC_TYPE *lpc, int lpc_stride, int fail,
-                                    int normalize)
-{
-    int i, j;
-    LPC_TYPE err;
-    LPC_TYPE *lpc_last = lpc;
-
-    if (normalize)
-        err = *autoc++;
-
-    if (fail && (autoc[max_order - 1] == 0 || err <= 0))
-        return -1;
-
-    for(i=0; i<max_order; i++) {
-        LPC_TYPE r = -autoc[i];
-
-        if (normalize) {
-            for(j=0; j<i; j++)
-                r -= lpc_last[j] * autoc[i-j-1];
-
-            r /= err;
-            err *= 1.0 - (r * r);
-        }
-
-        lpc[i] = r;
-
-        for(j=0; j < (i+1)>>1; j++) {
-            LPC_TYPE f = lpc_last[    j];
-            LPC_TYPE b = lpc_last[i-1-j];
-            lpc[    j] = f + r * b;
-            lpc[i-1-j] = b + r * f;
-        }
-
-        if (fail && err < 0)
-            return -1;
-
-        lpc_last = lpc;
-        lpc += lpc_stride;
-    }
-
-    return 0;
-}
-
-#endif /* AVCODEC_LPC_H */
diff --git a/deps/libav/libavcodec/lsp.c b/deps/libav/libavcodec/lsp.c
deleted file mode 100644
index 8a05aed..0000000
--- a/deps/libav/libavcodec/lsp.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * LSP routines for ACELP-based codecs
- *
- * Copyright (c) 2007 Reynaldo H. Verdejo Pinochet (QCELP decoder)
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-
-#include "avcodec.h"
-#define FRAC_BITS 14
-#include "mathops.h"
-#include "lsp.h"
-
-void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, int lsfq_max, int lp_order)
-{
-    int i, j;
-
-    /* sort lsfq in ascending order. float bubble agorithm,
-       O(n) if data already sorted, O(n^2) - otherwise */
-    for(i=0; i<lp_order-1; i++)
-        for(j=i; j>=0 && lsfq[j] > lsfq[j+1]; j--)
-            FFSWAP(int16_t, lsfq[j], lsfq[j+1]);
-
-    for(i=0; i<lp_order; i++)
-    {
-        lsfq[i] = FFMAX(lsfq[i], lsfq_min);
-        lsfq_min = lsfq[i] + lsfq_min_distance;
-    }
-    lsfq[lp_order-1] = FFMIN(lsfq[lp_order-1], lsfq_max);//Is warning required ?
-}
-
-void ff_set_min_dist_lsf(float *lsf, double min_spacing, int size)
-{
-    int i;
-    float prev = 0.0;
-    for (i = 0; i < size; i++)
-        prev = lsf[i] = FFMAX(lsf[i], prev + min_spacing);
-}
-
-
-/* Cosine table: base_cos[i] = (1 << 15) * cos(i * PI / 64) */
-static const int16_t tab_cos[65] =
-{
-  32767,  32738,  32617,  32421,  32145,  31793,  31364,  30860,
-  30280,  29629,  28905,  28113,  27252,  26326,  25336,  24285,
-  23176,  22011,  20793,  19525,  18210,  16851,  15451,  14014,
-  12543,  11043,   9515,   7965,   6395,   4810,   3214,   1609,
-      1,  -1607,  -3211,  -4808,  -6393,  -7962,  -9513, -11040,
- -12541, -14012, -15449, -16848, -18207, -19523, -20791, -22009,
- -23174, -24283, -25334, -26324, -27250, -28111, -28904, -29627,
- -30279, -30858, -31363, -31792, -32144, -32419, -32616, -32736, -32768,
-};
-
-static int16_t ff_cos(uint16_t arg)
-{
-    uint8_t offset= arg;
-    uint8_t ind = arg >> 8;
-
-    assert(arg <= 0x3fff);
-
-    return tab_cos[ind] + (offset * (tab_cos[ind+1] - tab_cos[ind]) >> 8);
-}
-
-void ff_acelp_lsf2lsp(int16_t *lsp, const int16_t *lsf, int lp_order)
-{
-    int i;
-
-    /* Convert LSF to LSP, lsp=cos(lsf) */
-    for(i=0; i<lp_order; i++)
-        // 20861 = 2.0 / PI in (0.15)
-        lsp[i] = ff_cos(lsf[i] * 20861 >> 15); // divide by PI and (0,13) -> (0,14)
-}
-
-void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order)
-{
-    int i;
-
-    for(i = 0; i < lp_order; i++)
-        lsp[i] = cos(2.0 * M_PI * lsf[i]);
-}
-
-/**
- * @brief decodes polynomial coefficients from LSP
- * @param[out] f decoded polynomial coefficients (-0x20000000 <= (3.22) <= 0x1fffffff)
- * @param lsp LSP coefficients (-0x8000 <= (0.15) <= 0x7fff)
- */
-static void lsp2poly(int* f, const int16_t* lsp, int lp_half_order)
-{
-    int i, j;
-
-    f[0] = 0x400000;          // 1.0 in (3.22)
-    f[1] = -lsp[0] << 8;      // *2 and (0.15) -> (3.22)
-
-    for(i=2; i<=lp_half_order; i++)
-    {
-        f[i] = f[i-2];
-        for(j=i; j>1; j--)
-            f[j] -= MULL(f[j-1], lsp[2*i-2], FRAC_BITS) - f[j-2];
-
-        f[1] -= lsp[2*i-2] << 8;
-    }
-}
-
-void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order)
-{
-    int i;
-    int f1[MAX_LP_HALF_ORDER+1]; // (3.22)
-    int f2[MAX_LP_HALF_ORDER+1]; // (3.22)
-
-    lsp2poly(f1, lsp  , lp_half_order);
-    lsp2poly(f2, lsp+1, lp_half_order);
-
-    /* 3.2.6 of G.729, Equations 25 and  26*/
-    lp[0] = 4096;
-    for(i=1; i<lp_half_order+1; i++)
-    {
-        int ff1 = f1[i] + f1[i-1]; // (3.22)
-        int ff2 = f2[i] - f2[i-1]; // (3.22)
-
-        ff1 += 1 << 10; // for rounding
-        lp[i]    = (ff1 + ff2) >> 11; // divide by 2 and (3.22) -> (3.12)
-        lp[(lp_half_order << 1) + 1 - i] = (ff1 - ff2) >> 11; // divide by 2 and (3.22) -> (3.12)
-    }
-}
-
-void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int lp_order)
-{
-    int lp_half_order = lp_order >> 1;
-    double buf[MAX_LP_HALF_ORDER + 1];
-    double pa[MAX_LP_HALF_ORDER + 1];
-    double *qa = buf + 1;
-    int i,j;
-
-    qa[-1] = 0.0;
-
-    ff_lsp2polyf(lsp    , pa, lp_half_order    );
-    ff_lsp2polyf(lsp + 1, qa, lp_half_order - 1);
-
-    for (i = 1, j = lp_order - 1; i < lp_half_order; i++, j--) {
-        double paf =  pa[i]            * (1 + lsp[lp_order - 1]);
-        double qaf = (qa[i] - qa[i-2]) * (1 - lsp[lp_order - 1]);
-        lp[i-1]  = (paf + qaf) * 0.5;
-        lp[j-1]  = (paf - qaf) * 0.5;
-    }
-
-    lp[lp_half_order - 1] = (1.0 + lsp[lp_order - 1]) *
-        pa[lp_half_order] * 0.5;
-
-    lp[lp_order - 1] = lsp[lp_order - 1];
-}
-
-void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd, const int16_t* lsp_prev, int lp_order)
-{
-    int16_t lsp_1st[MAX_LP_ORDER]; // (0.15)
-    int i;
-
-    /* LSP values for first subframe (3.2.5 of G.729, Equation 24)*/
-    for(i=0; i<lp_order; i++)
-        lsp_1st[i] = (lsp_2nd[i] + lsp_prev[i]) >> 1;
-
-    ff_acelp_lsp2lpc(lp_1st, lsp_1st, lp_order >> 1);
-
-    /* LSP values for second subframe (3.2.5 of G.729)*/
-    ff_acelp_lsp2lpc(lp_2nd, lsp_2nd, lp_order >> 1);
-}
-
-void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order)
-{
-    int i, j;
-
-    f[0] = 1.0;
-    f[1] = -2 * lsp[0];
-    lsp -= 2;
-    for(i=2; i<=lp_half_order; i++)
-    {
-        double val = -2 * lsp[2*i];
-        f[i] = val * f[i-1] + 2*f[i-2];
-        for(j=i-1; j>1; j--)
-            f[j] += f[j-1] * val + f[j-2];
-        f[1] += val;
-    }
-}
-
-void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order)
-{
-    double pa[MAX_LP_HALF_ORDER+1], qa[MAX_LP_HALF_ORDER+1];
-    float *lpc2 = lpc + (lp_half_order << 1) - 1;
-
-    assert(lp_half_order <= MAX_LP_HALF_ORDER);
-
-    ff_lsp2polyf(lsp,     pa, lp_half_order);
-    ff_lsp2polyf(lsp + 1, qa, lp_half_order);
-
-    while (lp_half_order--) {
-        double paf = pa[lp_half_order+1] + pa[lp_half_order];
-        double qaf = qa[lp_half_order+1] - qa[lp_half_order];
-
-        lpc [ lp_half_order] = 0.5*(paf+qaf);
-        lpc2[-lp_half_order] = 0.5*(paf-qaf);
-    }
-}
-
-void ff_sort_nearly_sorted_floats(float *vals, int len)
-{
-    int i,j;
-
-    for (i = 0; i < len - 1; i++)
-        for (j = i; j >= 0 && vals[j] > vals[j+1]; j--)
-            FFSWAP(float, vals[j], vals[j+1]);
-}
diff --git a/deps/libav/libavcodec/lsp.h b/deps/libav/libavcodec/lsp.h
deleted file mode 100644
index 4b95567..0000000
--- a/deps/libav/libavcodec/lsp.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * LSP computing for ACELP-based codecs
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_LSP_H
-#define AVCODEC_LSP_H
-
-#include <stdint.h>
-
-/**
-  (I.F) means fixed-point value with F fractional and I integer bits
-*/
-
-/**
- * @brief ensure a minimum distance between LSFs
- * @param[in,out] lsfq LSF to check and adjust
- * @param lsfq_min_distance minimum distance between LSFs
- * @param lsfq_min minimum allowed LSF value
- * @param lsfq_max maximum allowed LSF value
- * @param lp_order LP filter order
- */
-void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, int lsfq_max, int lp_order);
-
-/**
- * Adjust the quantized LSFs so they are increasing and not too close.
- *
- * This step is not mentioned in the AMR spec but is in the reference C decoder.
- * Omitting this step creates audible distortion on the sinusoidal sweep
- * test vectors in 3GPP TS 26.074.
- *
- * @param[in,out] lsf    LSFs in Hertz
- * @param min_spacing    minimum distance between two consecutive lsf values
- * @param size           size of the lsf vector
- */
-void ff_set_min_dist_lsf(float *lsf, double min_spacing, int size);
-
-/**
- * @brief Convert LSF to LSP
- * @param[out] lsp LSP coefficients (-0x8000 <= (0.15) < 0x8000)
- * @param lsf normalized LSF coefficients (0 <= (2.13) < 0x2000 * PI)
- * @param lp_order LP filter order
- *
- * @remark It is safe to pass the same array into the lsf and lsp parameters.
- */
-void ff_acelp_lsf2lsp(int16_t *lsp, const int16_t *lsf, int lp_order);
-
-/**
- * Floating point version of ff_acelp_lsf2lsp()
- */
-void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order);
-
-/**
- * @brief LSP to LP conversion (3.2.6 of G.729)
- * @param[out] lp decoded LP coefficients (-0x8000 <= (3.12) < 0x8000)
- * @param lsp LSP coefficients (-0x8000 <= (0.15) < 0x8000)
- * @param lp_half_order LP filter order, divided by 2
- */
-void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order);
-
-/**
- * LSP to LP conversion (5.2.4 of AMR-WB)
- */
-void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int lp_order);
-
-/**
- * @brief Interpolate LSP for the first subframe and convert LSP -> LP for both subframes (3.2.5 and 3.2.6 of G.729)
- * @param[out] lp_1st decoded LP coefficients for first subframe  (-0x8000 <= (3.12) < 0x8000)
- * @param[out] lp_2nd decoded LP coefficients for second subframe (-0x8000 <= (3.12) < 0x8000)
- * @param lsp_2nd LSP coefficients of the second subframe (-0x8000 <= (0.15) < 0x8000)
- * @param lsp_prev LSP coefficients from the second subframe of the previous frame (-0x8000 <= (0.15) < 0x8000)
- * @param lp_order LP filter order
- */
-void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd, const int16_t* lsp_prev, int lp_order);
-
-
-#define MAX_LP_HALF_ORDER 10
-#define MAX_LP_ORDER      (2*MAX_LP_HALF_ORDER)
-
-/**
- * Reconstruct LPC coefficients from the line spectral pair frequencies.
- *
- * @param lsp line spectral pairs in cosine domain
- * @param lpc linear predictive coding coefficients
- * @param lp_half_order half the number of the amount of LPCs to be
- *        reconstructed, need to be smaller or equal to MAX_LP_HALF_ORDER
- *
- * @note buffers should have a minimux size of 2*lp_half_order elements.
- *
- * TIA/EIA/IS-733 2.4.3.3.5
- */
-void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order);
-
-/**
- * Sort values in ascending order.
- *
- * @note O(n) if data already sorted, O(n^2) - otherwise
- */
-void ff_sort_nearly_sorted_floats(float *vals, int len);
-
-/**
- * Compute the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients
- * needed for LSP to LPC conversion.
- * We only need to calculate the 6 first elements of the polynomial.
- *
- * @param lsp line spectral pairs in cosine domain
- * @param[out] f polynomial input/output as a vector
- *
- * TIA/EIA/IS-733 2.4.3.3.5-1/2
- */
-void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order);
-
-#endif /* AVCODEC_LSP_H */
diff --git a/deps/libav/libavcodec/lzw.c b/deps/libav/libavcodec/lzw.c
deleted file mode 100644
index fae5687..0000000
--- a/deps/libav/libavcodec/lzw.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * LZW decoder
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief LZW decoding routines
- * @author Fabrice Bellard
- * @author modified for use in TIFF by Konstantin Shishkov
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "lzw.h"
-#include "libavutil/mem.h"
-
-#define LZW_MAXBITS                 12
-#define LZW_SIZTABLE                (1<<LZW_MAXBITS)
-
-static const uint16_t mask[17] =
-{
-    0x0000, 0x0001, 0x0003, 0x0007,
-    0x000F, 0x001F, 0x003F, 0x007F,
-    0x00FF, 0x01FF, 0x03FF, 0x07FF,
-    0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF
-};
-
-struct LZWState {
-    GetByteContext gb;
-    int bbits;
-    unsigned int bbuf;
-
-    int mode;                   ///< Decoder mode
-    int cursize;                ///< The current code size
-    int curmask;
-    int codesize;
-    int clear_code;
-    int end_code;
-    int newcodes;               ///< First available code
-    int top_slot;               ///< Highest code for current size
-    int extra_slot;
-    int slot;                   ///< Last read code
-    int fc, oc;
-    uint8_t *sp;
-    uint8_t stack[LZW_SIZTABLE];
-    uint8_t suffix[LZW_SIZTABLE];
-    uint16_t prefix[LZW_SIZTABLE];
-    int bs;                     ///< current buffer size for GIF
-};
-
-/* get one code from stream */
-static int lzw_get_code(struct LZWState * s)
-{
-    int c;
-
-    if(s->mode == FF_LZW_GIF) {
-        while (s->bbits < s->cursize) {
-            if (!s->bs) {
-                s->bs = bytestream2_get_byte(&s->gb);
-            }
-            s->bbuf |= bytestream2_get_byte(&s->gb) << s->bbits;
-            s->bbits += 8;
-            s->bs--;
-        }
-        c = s->bbuf;
-        s->bbuf >>= s->cursize;
-    } else { // TIFF
-        while (s->bbits < s->cursize) {
-            s->bbuf = (s->bbuf << 8) | bytestream2_get_byte(&s->gb);
-            s->bbits += 8;
-        }
-        c = s->bbuf >> (s->bbits - s->cursize);
-    }
-    s->bbits -= s->cursize;
-    return c & s->curmask;
-}
-
-int ff_lzw_size_read(LZWState *p)
-{
-    struct LZWState *s = p;
-    return bytestream2_tell(&s->gb);
-}
-
-void ff_lzw_decode_tail(LZWState *p)
-{
-    struct LZWState *s = (struct LZWState *)p;
-
-    if(s->mode == FF_LZW_GIF) {
-        while (s->bs > 0 && bytestream2_get_bytes_left(&s->gb)) {
-            bytestream2_skip(&s->gb, s->bs);
-            s->bs = bytestream2_get_byte(&s->gb);
-        }
-    }else
-        bytestream2_skip(&s->gb, bytestream2_get_bytes_left(&s->gb));
-}
-
-av_cold void ff_lzw_decode_open(LZWState **p)
-{
-    *p = av_mallocz(sizeof(struct LZWState));
-}
-
-av_cold void ff_lzw_decode_close(LZWState **p)
-{
-    av_freep(p);
-}
-
-/**
- * Initialize LZW decoder
- * @param p LZW context
- * @param csize initial code size in bits
- * @param buf input data
- * @param buf_size input data size
- * @param mode decoder working mode - either GIF or TIFF
- */
-int ff_lzw_decode_init(LZWState *p, int csize, const uint8_t *buf, int buf_size, int mode)
-{
-    struct LZWState *s = (struct LZWState *)p;
-
-    if(csize < 1 || csize >= LZW_MAXBITS)
-        return -1;
-    /* read buffer */
-    bytestream2_init(&s->gb, buf, buf_size);
-    s->bbuf = 0;
-    s->bbits = 0;
-    s->bs = 0;
-
-    /* decoder */
-    s->codesize = csize;
-    s->cursize = s->codesize + 1;
-    s->curmask = mask[s->cursize];
-    s->top_slot = 1 << s->cursize;
-    s->clear_code = 1 << s->codesize;
-    s->end_code = s->clear_code + 1;
-    s->slot = s->newcodes = s->clear_code + 2;
-    s->oc = s->fc = -1;
-    s->sp = s->stack;
-
-    s->mode = mode;
-    s->extra_slot = s->mode == FF_LZW_TIFF;
-    return 0;
-}
-
-/**
- * Decode given number of bytes
- * NOTE: the algorithm here is inspired from the LZW GIF decoder
- *  written by Steven A. Bennett in 1987.
- *
- * @param p LZW context
- * @param buf output buffer
- * @param len number of bytes to decode
- * @return number of bytes decoded
- */
-int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){
-    int l, c, code, oc, fc;
-    uint8_t *sp;
-    struct LZWState *s = (struct LZWState *)p;
-
-    if (s->end_code < 0)
-        return 0;
-
-    l = len;
-    sp = s->sp;
-    oc = s->oc;
-    fc = s->fc;
-
-    for (;;) {
-        while (sp > s->stack) {
-            *buf++ = *(--sp);
-            if ((--l) == 0)
-                goto the_end;
-        }
-        c = lzw_get_code(s);
-        if (c == s->end_code) {
-            break;
-        } else if (c == s->clear_code) {
-            s->cursize = s->codesize + 1;
-            s->curmask = mask[s->cursize];
-            s->slot = s->newcodes;
-            s->top_slot = 1 << s->cursize;
-            fc= oc= -1;
-        } else {
-            code = c;
-            if (code == s->slot && fc>=0) {
-                *sp++ = fc;
-                code = oc;
-            }else if(code >= s->slot)
-                break;
-            while (code >= s->newcodes) {
-                *sp++ = s->suffix[code];
-                code = s->prefix[code];
-            }
-            *sp++ = code;
-            if (s->slot < s->top_slot && oc>=0) {
-                s->suffix[s->slot] = code;
-                s->prefix[s->slot++] = oc;
-            }
-            fc = code;
-            oc = c;
-            if (s->slot >= s->top_slot - s->extra_slot) {
-                if (s->cursize < LZW_MAXBITS) {
-                    s->top_slot <<= 1;
-                    s->curmask = mask[++s->cursize];
-                }
-            }
-        }
-    }
-    s->end_code = -1;
-  the_end:
-    s->sp = sp;
-    s->oc = oc;
-    s->fc = fc;
-    return len - l;
-}
diff --git a/deps/libav/libavcodec/lzw.h b/deps/libav/libavcodec/lzw.h
deleted file mode 100644
index d925d35..0000000
--- a/deps/libav/libavcodec/lzw.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * LZW decoder
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief LZW decoding routines
- * @author Fabrice Bellard
- * @author modified for use in TIFF by Konstantin Shishkov
- */
-
-#ifndef AVCODEC_LZW_H
-#define AVCODEC_LZW_H
-
-#include <stdint.h>
-
-struct PutBitContext;
-
-enum FF_LZW_MODES{
-    FF_LZW_GIF,
-    FF_LZW_TIFF
-};
-
-/* clients should not know what LZWState is */
-typedef void LZWState;
-
-/* first two functions de/allocate memory for LZWState */
-void ff_lzw_decode_open(LZWState **p);
-void ff_lzw_decode_close(LZWState **p);
-int ff_lzw_decode_init(LZWState *s, int csize, const uint8_t *buf, int buf_size, int mode);
-int ff_lzw_decode(LZWState *s, uint8_t *buf, int len);
-int ff_lzw_size_read(LZWState *lzw);
-void ff_lzw_decode_tail(LZWState *lzw);
-
-/** LZW encode state */
-struct LZWEncodeState;
-extern const int ff_lzw_encode_state_size;
-
-void ff_lzw_encode_init(struct LZWEncodeState *s, uint8_t *outbuf, int outsize,
-                        int maxbits, enum FF_LZW_MODES mode,
-                        void (*lzw_put_bits)(struct PutBitContext *, int, unsigned int));
-int ff_lzw_encode(struct LZWEncodeState * s, const uint8_t * inbuf, int insize);
-int ff_lzw_encode_flush(struct LZWEncodeState *s,
-                        void (*lzw_flush_put_bits)(struct PutBitContext *));
-
-#endif /* AVCODEC_LZW_H */
diff --git a/deps/libav/libavcodec/lzwenc.c b/deps/libav/libavcodec/lzwenc.c
deleted file mode 100644
index cb064e7..0000000
--- a/deps/libav/libavcodec/lzwenc.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * LZW encoder
- * Copyright (c) 2007 Bartlomiej Wolowiec
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * LZW encoder
- * @author Bartlomiej Wolowiec
- */
-
-#include "avcodec.h"
-#include "put_bits.h"
-#include "lzw.h"
-
-#define LZW_MAXBITS 12
-#define LZW_SIZTABLE (1<<LZW_MAXBITS)
-#define LZW_HASH_SIZE 16411
-#define LZW_HASH_SHIFT 6
-
-#define LZW_PREFIX_EMPTY -1
-#define LZW_PREFIX_FREE -2
-
-/** One code in hash table */
-typedef struct Code{
-    /// Hash code of prefix, LZW_PREFIX_EMPTY if empty prefix, or LZW_PREFIX_FREE if no code
-    int hash_prefix;
-    int code;               ///< LZW code
-    uint8_t suffix;         ///< Last character in code block
-}Code;
-
-/** LZW encode state */
-typedef struct LZWEncodeState {
-    int clear_code;          ///< Value of clear code
-    int end_code;            ///< Value of end code
-    Code tab[LZW_HASH_SIZE]; ///< Hash table
-    int tabsize;             ///< Number of values in hash table
-    int bits;                ///< Actual bits code
-    int bufsize;             ///< Size of output buffer
-    PutBitContext pb;        ///< Put bit context for output
-    int maxbits;             ///< Max bits code
-    int maxcode;             ///< Max value of code
-    int output_bytes;        ///< Number of written bytes
-    int last_code;           ///< Value of last output code or LZW_PREFIX_EMPTY
-    enum FF_LZW_MODES mode;  ///< TIFF or GIF
-    void (*put_bits)(PutBitContext *, int, unsigned); ///< GIF is LE while TIFF is BE
-}LZWEncodeState;
-
-
-const int ff_lzw_encode_state_size = sizeof(LZWEncodeState);
-
-/**
- * Hash function adding character
- * @param head LZW code for prefix
- * @param add Character to add
- * @return New hash value
- */
-static inline int hash(int head, const int add)
-{
-    head ^= (add << LZW_HASH_SHIFT);
-    if (head >= LZW_HASH_SIZE)
-        head -= LZW_HASH_SIZE;
-    assert(head >= 0 && head < LZW_HASH_SIZE);
-    return head;
-}
-
-/**
- * Hash function calculates next hash value
- * @param head Actual hash code
- * @param offset Offset calculated by hashOffset
- * @return New hash value
- */
-static inline int hashNext(int head, const int offset)
-{
-    head -= offset;
-    if(head < 0)
-        head += LZW_HASH_SIZE;
-    return head;
-}
-
-/**
- * Hash function calculates hash offset
- * @param head Actual hash code
- * @return Hash offset
- */
-static inline int hashOffset(const int head)
-{
-    return head ? LZW_HASH_SIZE - head : 1;
-}
-
-/**
- * Write one code to stream
- * @param s LZW state
- * @param c code to write
- */
-static inline void writeCode(LZWEncodeState * s, int c)
-{
-    assert(0 <= c && c < 1 << s->bits);
-    s->put_bits(&s->pb, s->bits, c);
-}
-
-
-/**
- * Find LZW code for block
- * @param s LZW state
- * @param c Last character in block
- * @param hash_prefix LZW code for prefix
- * @return LZW code for block or -1 if not found in table
- */
-static inline int findCode(LZWEncodeState * s, uint8_t c, int hash_prefix)
-{
-    int h = hash(FFMAX(hash_prefix, 0), c);
-    int hash_offset = hashOffset(h);
-
-    while (s->tab[h].hash_prefix != LZW_PREFIX_FREE) {
-        if ((s->tab[h].suffix == c)
-            && (s->tab[h].hash_prefix == hash_prefix))
-            return h;
-        h = hashNext(h, hash_offset);
-    }
-
-    return h;
-}
-
-/**
- * Add block to LZW code table
- * @param s LZW state
- * @param c Last character in block
- * @param hash_prefix LZW code for prefix
- * @param hash_code LZW code for bytes block
- */
-static inline void addCode(LZWEncodeState * s, uint8_t c, int hash_prefix, int hash_code)
-{
-    s->tab[hash_code].code = s->tabsize;
-    s->tab[hash_code].suffix = c;
-    s->tab[hash_code].hash_prefix = hash_prefix;
-
-    s->tabsize++;
-
-    if (s->tabsize >= (1 << s->bits) + (s->mode == FF_LZW_GIF))
-        s->bits++;
-}
-
-/**
- * Clear LZW code table
- * @param s LZW state
- */
-static void clearTable(LZWEncodeState * s)
-{
-    int i, h;
-
-    writeCode(s, s->clear_code);
-    s->bits = 9;
-    for (i = 0; i < LZW_HASH_SIZE; i++) {
-        s->tab[i].hash_prefix = LZW_PREFIX_FREE;
-    }
-    for (i = 0; i < 256; i++) {
-        h = hash(0, i);
-        s->tab[h].code = i;
-        s->tab[h].suffix = i;
-        s->tab[h].hash_prefix = LZW_PREFIX_EMPTY;
-    }
-    s->tabsize = 258;
-}
-
-/**
- * Calculate number of bytes written
- * @param s LZW encode state
- * @return Number of bytes written
- */
-static int writtenBytes(LZWEncodeState *s){
-    int ret = put_bits_count(&s->pb) >> 3;
-    ret -= s->output_bytes;
-    s->output_bytes += ret;
-    return ret;
-}
-
-/**
- * Initialize LZW encoder. Please set s->clear_code, s->end_code and s->maxbits before run.
- * @param s LZW state
- * @param outbuf Output buffer
- * @param outsize Size of output buffer
- * @param maxbits Maximum length of code
- */
-void ff_lzw_encode_init(LZWEncodeState *s, uint8_t *outbuf, int outsize,
-                        int maxbits, enum FF_LZW_MODES mode,
-                        void (*lzw_put_bits)(PutBitContext *, int, unsigned))
-{
-    s->clear_code = 256;
-    s->end_code = 257;
-    s->maxbits = maxbits;
-    init_put_bits(&s->pb, outbuf, outsize);
-    s->bufsize = outsize;
-    assert(s->maxbits >= 9 && s->maxbits <= LZW_MAXBITS);
-    s->maxcode = 1 << s->maxbits;
-    s->output_bytes = 0;
-    s->last_code = LZW_PREFIX_EMPTY;
-    s->bits = 9;
-    s->mode = mode;
-    s->put_bits = lzw_put_bits;
-}
-
-/**
- * LZW main compress function
- * @param s LZW state
- * @param inbuf Input buffer
- * @param insize Size of input buffer
- * @return Number of bytes written or -1 on error
- */
-int ff_lzw_encode(LZWEncodeState * s, const uint8_t * inbuf, int insize)
-{
-    int i;
-
-    if(insize * 3 > (s->bufsize - s->output_bytes) * 2){
-        return -1;
-    }
-
-    if (s->last_code == LZW_PREFIX_EMPTY)
-        clearTable(s);
-
-    for (i = 0; i < insize; i++) {
-        uint8_t c = *inbuf++;
-        int code = findCode(s, c, s->last_code);
-        if (s->tab[code].hash_prefix == LZW_PREFIX_FREE) {
-            writeCode(s, s->last_code);
-            addCode(s, c, s->last_code, code);
-            code= hash(0, c);
-        }
-        s->last_code = s->tab[code].code;
-        if (s->tabsize >= s->maxcode - 1) {
-            clearTable(s);
-        }
-    }
-
-    return writtenBytes(s);
-}
-
-/**
- * Write end code and flush bitstream
- * @param s LZW state
- * @return Number of bytes written or -1 on error
- */
-int ff_lzw_encode_flush(LZWEncodeState *s,
-                        void (*lzw_flush_put_bits)(PutBitContext *))
-{
-    if (s->last_code != -1)
-        writeCode(s, s->last_code);
-    writeCode(s, s->end_code);
-    lzw_flush_put_bits(&s->pb);
-    s->last_code = -1;
-
-    return writtenBytes(s);
-}
diff --git a/deps/libav/libavcodec/mace.c b/deps/libav/libavcodec/mace.c
deleted file mode 100644
index 25c6b70..0000000
--- a/deps/libav/libavcodec/mace.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * MACE decoder
- * Copyright (c) 2002 Laszlo Torok <torokl at alpha.dfmk.hu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MACE decoder.
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/common.h"
-
-/*
- * Adapted to libavcodec by Francois Revol <revol at free.fr>
- * (removed 68k REG stuff, changed types, added some statics and consts,
- * libavcodec api, context stuff, interlaced stereo out).
- */
-
-static const int16_t MACEtab1[] = {-13, 8, 76, 222, 222, 76, 8, -13};
-
-static const int16_t MACEtab3[] = {-18, 140, 140, -18};
-
-static const int16_t MACEtab2[][4] = {
-    {    37,    116,    206,    330}, {    39,    121,    216,    346},
-    {    41,    127,    225,    361}, {    42,    132,    235,    377},
-    {    44,    137,    245,    392}, {    46,    144,    256,    410},
-    {    48,    150,    267,    428}, {    51,    157,    280,    449},
-    {    53,    165,    293,    470}, {    55,    172,    306,    490},
-    {    58,    179,    319,    511}, {    60,    187,    333,    534},
-    {    63,    195,    348,    557}, {    66,    205,    364,    583},
-    {    69,    214,    380,    609}, {    72,    223,    396,    635},
-    {    75,    233,    414,    663}, {    79,    244,    433,    694},
-    {    82,    254,    453,    725}, {    86,    265,    472,    756},
-    {    90,    278,    495,    792}, {    94,    290,    516,    826},
-    {    98,    303,    538,    862}, {   102,    316,    562,    901},
-    {   107,    331,    588,    942}, {   112,    345,    614,    983},
-    {   117,    361,    641,   1027}, {   122,    377,    670,   1074},
-    {   127,    394,    701,   1123}, {   133,    411,    732,   1172},
-    {   139,    430,    764,   1224}, {   145,    449,    799,   1280},
-    {   152,    469,    835,   1337}, {   159,    490,    872,   1397},
-    {   166,    512,    911,   1459}, {   173,    535,    951,   1523},
-    {   181,    558,    993,   1590}, {   189,    584,   1038,   1663},
-    {   197,    610,   1085,   1738}, {   206,    637,   1133,   1815},
-    {   215,    665,   1183,   1895}, {   225,    695,   1237,   1980},
-    {   235,    726,   1291,   2068}, {   246,    759,   1349,   2161},
-    {   257,    792,   1409,   2257}, {   268,    828,   1472,   2357},
-    {   280,    865,   1538,   2463}, {   293,    903,   1606,   2572},
-    {   306,    944,   1678,   2688}, {   319,    986,   1753,   2807},
-    {   334,   1030,   1832,   2933}, {   349,   1076,   1914,   3065},
-    {   364,   1124,   1999,   3202}, {   380,   1174,   2088,   3344},
-    {   398,   1227,   2182,   3494}, {   415,   1281,   2278,   3649},
-    {   434,   1339,   2380,   3811}, {   453,   1398,   2486,   3982},
-    {   473,   1461,   2598,   4160}, {   495,   1526,   2714,   4346},
-    {   517,   1594,   2835,   4540}, {   540,   1665,   2961,   4741},
-    {   564,   1740,   3093,   4953}, {   589,   1818,   3232,   5175},
-    {   615,   1898,   3375,   5405}, {   643,   1984,   3527,   5647},
-    {   671,   2072,   3683,   5898}, {   701,   2164,   3848,   6161},
-    {   733,   2261,   4020,   6438}, {   766,   2362,   4199,   6724},
-    {   800,   2467,   4386,   7024}, {   836,   2578,   4583,   7339},
-    {   873,   2692,   4786,   7664}, {   912,   2813,   5001,   8008},
-    {   952,   2938,   5223,   8364}, {   995,   3070,   5457,   8739},
-    {  1039,   3207,   5701,   9129}, {  1086,   3350,   5956,   9537},
-    {  1134,   3499,   6220,   9960}, {  1185,   3655,   6497,  10404},
-    {  1238,   3818,   6788,  10869}, {  1293,   3989,   7091,  11355},
-    {  1351,   4166,   7407,  11861}, {  1411,   4352,   7738,  12390},
-    {  1474,   4547,   8084,  12946}, {  1540,   4750,   8444,  13522},
-    {  1609,   4962,   8821,  14126}, {  1680,   5183,   9215,  14756},
-    {  1756,   5415,   9626,  15415}, {  1834,   5657,  10057,  16104},
-    {  1916,   5909,  10505,  16822}, {  2001,   6173,  10975,  17574},
-    {  2091,   6448,  11463,  18356}, {  2184,   6736,  11974,  19175},
-    {  2282,   7037,  12510,  20032}, {  2383,   7351,  13068,  20926},
-    {  2490,   7679,  13652,  21861}, {  2601,   8021,  14260,  22834},
-    {  2717,   8380,  14897,  23854}, {  2838,   8753,  15561,  24918},
-    {  2965,   9144,  16256,  26031}, {  3097,   9553,  16982,  27193},
-    {  3236,   9979,  17740,  28407}, {  3380,  10424,  18532,  29675},
-    {  3531,  10890,  19359,  31000}, {  3688,  11375,  20222,  32382},
-    {  3853,  11883,  21125,  32767}, {  4025,  12414,  22069,  32767},
-    {  4205,  12967,  23053,  32767}, {  4392,  13546,  24082,  32767},
-    {  4589,  14151,  25157,  32767}, {  4793,  14783,  26280,  32767},
-    {  5007,  15442,  27452,  32767}, {  5231,  16132,  28678,  32767},
-    {  5464,  16851,  29957,  32767}, {  5708,  17603,  31294,  32767},
-    {  5963,  18389,  32691,  32767}, {  6229,  19210,  32767,  32767},
-    {  6507,  20067,  32767,  32767}, {  6797,  20963,  32767,  32767},
-    {  7101,  21899,  32767,  32767}, {  7418,  22876,  32767,  32767},
-    {  7749,  23897,  32767,  32767}, {  8095,  24964,  32767,  32767},
-    {  8456,  26078,  32767,  32767}, {  8833,  27242,  32767,  32767},
-    {  9228,  28457,  32767,  32767}, {  9639,  29727,  32767,  32767}
-};
-
-static const int16_t MACEtab4[][2] = {
-    {    64,    216}, {    67,    226}, {    70,    236}, {    74,    246},
-    {    77,    257}, {    80,    268}, {    84,    280}, {    88,    294},
-    {    92,    307}, {    96,    321}, {   100,    334}, {   104,    350},
-    {   109,    365}, {   114,    382}, {   119,    399}, {   124,    416},
-    {   130,    434}, {   136,    454}, {   142,    475}, {   148,    495},
-    {   155,    519}, {   162,    541}, {   169,    564}, {   176,    590},
-    {   185,    617}, {   193,    644}, {   201,    673}, {   210,    703},
-    {   220,    735}, {   230,    767}, {   240,    801}, {   251,    838},
-    {   262,    876}, {   274,    914}, {   286,    955}, {   299,    997},
-    {   312,   1041}, {   326,   1089}, {   341,   1138}, {   356,   1188},
-    {   372,   1241}, {   388,   1297}, {   406,   1354}, {   424,   1415},
-    {   443,   1478}, {   462,   1544}, {   483,   1613}, {   505,   1684},
-    {   527,   1760}, {   551,   1838}, {   576,   1921}, {   601,   2007},
-    {   628,   2097}, {   656,   2190}, {   686,   2288}, {   716,   2389},
-    {   748,   2496}, {   781,   2607}, {   816,   2724}, {   853,   2846},
-    {   891,   2973}, {   930,   3104}, {   972,   3243}, {  1016,   3389},
-    {  1061,   3539}, {  1108,   3698}, {  1158,   3862}, {  1209,   4035},
-    {  1264,   4216}, {  1320,   4403}, {  1379,   4599}, {  1441,   4806},
-    {  1505,   5019}, {  1572,   5244}, {  1642,   5477}, {  1715,   5722},
-    {  1792,   5978}, {  1872,   6245}, {  1955,   6522}, {  2043,   6813},
-    {  2134,   7118}, {  2229,   7436}, {  2329,   7767}, {  2432,   8114},
-    {  2541,   8477}, {  2655,   8854}, {  2773,   9250}, {  2897,   9663},
-    {  3026,  10094}, {  3162,  10546}, {  3303,  11016}, {  3450,  11508},
-    {  3604,  12020}, {  3765,  12556}, {  3933,  13118}, {  4108,  13703},
-    {  4292,  14315}, {  4483,  14953}, {  4683,  15621}, {  4892,  16318},
-    {  5111,  17046}, {  5339,  17807}, {  5577,  18602}, {  5826,  19433},
-    {  6086,  20300}, {  6358,  21205}, {  6642,  22152}, {  6938,  23141},
-    {  7248,  24173}, {  7571,  25252}, {  7909,  26380}, {  8262,  27557},
-    {  8631,  28786}, {  9016,  30072}, {  9419,  31413}, {  9839,  32767},
-    { 10278,  32767}, { 10737,  32767}, { 11216,  32767}, { 11717,  32767},
-    { 12240,  32767}, { 12786,  32767}, { 13356,  32767}, { 13953,  32767},
-    { 14576,  32767}, { 15226,  32767}, { 15906,  32767}, { 16615,  32767}
-};
-
-static const struct {
-    const int16_t *tab1; const int16_t *tab2; int stride;
-} tabs[] = {
-    {MACEtab1, &MACEtab2[0][0], 4},
-    {MACEtab3, &MACEtab4[0][0], 2},
-    {MACEtab1, &MACEtab2[0][0], 4}
-};
-
-#define QT_8S_2_16S(x) (((x) & 0xFF00) | (((x) >> 8) & 0xFF))
-
-typedef struct ChannelData {
-    int16_t index, factor, prev2, previous, level;
-} ChannelData;
-
-typedef struct MACEContext {
-    ChannelData chd[2];
-} MACEContext;
-
-/**
- * MACE version of av_clip_int16(). We have to do this to keep binary
- * identical output to the binary decoder.
- */
-static inline int16_t mace_broken_clip_int16(int n)
-{
-    if (n > 32767)
-        return 32767;
-    else if (n < -32768)
-        return -32767;
-    else
-        return n;
-}
-
-static int16_t read_table(ChannelData *chd, uint8_t val, int tab_idx)
-{
-    int16_t current;
-
-    if (val < tabs[tab_idx].stride)
-        current = tabs[tab_idx].tab2[((chd->index & 0x7f0) >> 4) * tabs[tab_idx].stride + val];
-    else
-        current = - 1 - tabs[tab_idx].tab2[((chd->index & 0x7f0) >> 4)*tabs[tab_idx].stride + 2*tabs[tab_idx].stride-val-1];
-
-    if (( chd->index += tabs[tab_idx].tab1[val]-(chd->index >> 5) ) < 0)
-      chd->index = 0;
-
-    return current;
-}
-
-static void chomp3(ChannelData *chd, int16_t *output, uint8_t val, int tab_idx)
-{
-
-    int16_t current = read_table(chd, val, tab_idx);
-
-    current = mace_broken_clip_int16(current + chd->level);
-
-    chd->level = current - (current >> 3);
-    *output = QT_8S_2_16S(current);
-}
-
-static void chomp6(ChannelData *chd, int16_t *output, uint8_t val, int tab_idx)
-{
-    int16_t current = read_table(chd, val, tab_idx);
-
-    if ((chd->previous ^ current) >= 0) {
-        chd->factor = FFMIN(chd->factor + 506, 32767);
-    } else {
-        if (chd->factor - 314 < -32768)
-            chd->factor = -32767;
-        else
-            chd->factor -= 314;
-    }
-
-    current = mace_broken_clip_int16(current + chd->level);
-
-    chd->level = (current*chd->factor) >> 15;
-    current >>= 1;
-
-    output[0] = QT_8S_2_16S(chd->previous + chd->prev2 -
-                            ((chd->prev2-current) >> 2));
-    output[1] = QT_8S_2_16S(chd->previous + current +
-                            ((chd->prev2-current) >> 2));
-    chd->prev2 = chd->previous;
-    chd->previous = current;
-}
-
-static av_cold int mace_decode_init(AVCodecContext * avctx)
-{
-    if (avctx->channels > 2 || avctx->channels < 1)
-        return AVERROR(EINVAL);
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-
-    return 0;
-}
-
-static int mace_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    int16_t **samples;
-    MACEContext *ctx = avctx->priv_data;
-    int i, j, k, l, ret;
-    int is_mace3 = (avctx->codec_id == AV_CODEC_ID_MACE3);
-
-    /* get output buffer */
-    frame->nb_samples = 3 * (buf_size << (1 - is_mace3)) / avctx->channels;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (int16_t **)frame->extended_data;
-
-    for(i = 0; i < avctx->channels; i++) {
-        int16_t *output = samples[i];
-
-        for (j=0; j < buf_size / (avctx->channels << is_mace3); j++)
-            for (k=0; k < (1 << is_mace3); k++) {
-                uint8_t pkt = buf[(i << is_mace3) +
-                                  (j*avctx->channels << is_mace3) + k];
-
-                uint8_t val[2][3] = {{pkt >> 5, (pkt >> 3) & 3, pkt & 7 },
-                                     {pkt & 7 , (pkt >> 3) & 3, pkt >> 5}};
-
-                for (l=0; l < 3; l++) {
-                    if (is_mace3)
-                        chomp3(&ctx->chd[i], output, val[1][l], l);
-                    else
-                        chomp6(&ctx->chd[i], output, val[0][l], l);
-
-                    output += 1 << (1-is_mace3);
-                }
-            }
-    }
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_mace3_decoder = {
-    .name           = "mace3",
-    .long_name      = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 3:1"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MACE3,
-    .priv_data_size = sizeof(MACEContext),
-    .init           = mace_decode_init,
-    .decode         = mace_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-
-AVCodec ff_mace6_decoder = {
-    .name           = "mace6",
-    .long_name      = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 6:1"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MACE6,
-    .priv_data_size = sizeof(MACEContext),
-    .init           = mace_decode_init,
-    .decode         = mace_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/mathops.h b/deps/libav/libavcodec/mathops.h
deleted file mode 100644
index 6c216c2..0000000
--- a/deps/libav/libavcodec/mathops.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * simple math operations
- * Copyright (c) 2001, 2002 Fabrice Bellard
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at> et al
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVCODEC_MATHOPS_H
-#define AVCODEC_MATHOPS_H
-
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "config.h"
-
-extern const uint32_t ff_inverse[257];
-extern const uint8_t  ff_reverse[256];
-extern const uint8_t ff_sqrt_tab[256];
-
-#if   ARCH_ARM
-#   include "arm/mathops.h"
-#elif ARCH_AVR32
-#   include "avr32/mathops.h"
-#elif ARCH_BFIN
-#   include "bfin/mathops.h"
-#elif ARCH_MIPS
-#   include "mips/mathops.h"
-#elif ARCH_PPC
-#   include "ppc/mathops.h"
-#elif ARCH_X86
-#   include "x86/mathops.h"
-#endif
-
-/* generic implementation */
-
-#ifndef MUL64
-#   define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
-#endif
-
-#ifndef MULL
-#   define MULL(a,b,s) (MUL64(a, b) >> (s))
-#endif
-
-#ifndef MULH
-static av_always_inline int MULH(int a, int b){
-    return MUL64(a, b) >> 32;
-}
-#endif
-
-#ifndef UMULH
-static av_always_inline unsigned UMULH(unsigned a, unsigned b){
-    return ((uint64_t)(a) * (uint64_t)(b))>>32;
-}
-#endif
-
-#ifndef MAC64
-#   define MAC64(d, a, b) ((d) += MUL64(a, b))
-#endif
-
-#ifndef MLS64
-#   define MLS64(d, a, b) ((d) -= MUL64(a, b))
-#endif
-
-/* signed 16x16 -> 32 multiply add accumulate */
-#ifndef MAC16
-#   define MAC16(rt, ra, rb) rt += (ra) * (rb)
-#endif
-
-/* signed 16x16 -> 32 multiply */
-#ifndef MUL16
-#   define MUL16(ra, rb) ((ra) * (rb))
-#endif
-
-#ifndef MLS16
-#   define MLS16(rt, ra, rb) ((rt) -= (ra) * (rb))
-#endif
-
-/* median of 3 */
-#ifndef mid_pred
-#define mid_pred mid_pred
-static inline av_const int mid_pred(int a, int b, int c)
-{
-#if 0
-    int t= (a-b)&((a-b)>>31);
-    a-=t;
-    b+=t;
-    b-= (b-c)&((b-c)>>31);
-    b+= (a-b)&((a-b)>>31);
-
-    return b;
-#else
-    if(a>b){
-        if(c>b){
-            if(c>a) b=a;
-            else    b=c;
-        }
-    }else{
-        if(b>c){
-            if(c>a) b=c;
-            else    b=a;
-        }
-    }
-    return b;
-#endif
-}
-#endif
-
-#ifndef sign_extend
-static inline av_const int sign_extend(int val, unsigned bits)
-{
-    unsigned shift = 8 * sizeof(int) - bits;
-    union { unsigned u; int s; } v = { (unsigned) val << shift };
-    return v.s >> shift;
-}
-#endif
-
-#ifndef zero_extend
-static inline av_const unsigned zero_extend(unsigned val, unsigned bits)
-{
-    return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits);
-}
-#endif
-
-#ifndef COPY3_IF_LT
-#define COPY3_IF_LT(x, y, a, b, c, d)\
-if ((y) < (x)) {\
-    (x) = (y);\
-    (a) = (b);\
-    (c) = (d);\
-}
-#endif
-
-#ifndef MASK_ABS
-#define MASK_ABS(mask, level) do {              \
-        mask  = level >> 31;                    \
-        level = (level ^ mask) - mask;          \
-    } while (0)
-#endif
-
-#ifndef NEG_SSR32
-#   define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s)))
-#endif
-
-#ifndef NEG_USR32
-#   define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s)))
-#endif
-
-#if HAVE_BIGENDIAN
-# ifndef PACK_2U8
-#   define PACK_2U8(a,b)     (((a) <<  8) | (b))
-# endif
-# ifndef PACK_4U8
-#   define PACK_4U8(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
-# endif
-# ifndef PACK_2U16
-#   define PACK_2U16(a,b)    (((a) << 16) | (b))
-# endif
-#else
-# ifndef PACK_2U8
-#   define PACK_2U8(a,b)     (((b) <<  8) | (a))
-# endif
-# ifndef PACK_4U2
-#   define PACK_4U8(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a))
-# endif
-# ifndef PACK_2U16
-#   define PACK_2U16(a,b)    (((b) << 16) | (a))
-# endif
-#endif
-
-#ifndef PACK_2S8
-#   define PACK_2S8(a,b)     PACK_2U8((a)&255, (b)&255)
-#endif
-#ifndef PACK_4S8
-#   define PACK_4S8(a,b,c,d) PACK_4U8((a)&255, (b)&255, (c)&255, (d)&255)
-#endif
-#ifndef PACK_2S16
-#   define PACK_2S16(a,b)    PACK_2U16((a)&0xffff, (b)&0xffff)
-#endif
-
-#ifndef FASTDIV
-#   define FASTDIV(a,b) ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32))
-#endif /* FASTDIV */
-
-#ifndef MOD_UNLIKELY
-#   define MOD_UNLIKELY(modulus, dividend, divisor, prev_dividend) \
-    do { \
-        if ((prev_dividend) == 0 || (dividend) - (prev_dividend) != (divisor)) \
-            (modulus) = (dividend) % (divisor); \
-        (prev_dividend) = (dividend); \
-    } while (0)
-#endif
-
-static inline av_const unsigned int ff_sqrt(unsigned int a)
-{
-    unsigned int b;
-
-    if (a < 255) return (ff_sqrt_tab[a + 1] - 1) >> 4;
-    else if (a < (1 << 12)) b = ff_sqrt_tab[a >> 4] >> 2;
-#if !CONFIG_SMALL
-    else if (a < (1 << 14)) b = ff_sqrt_tab[a >> 6] >> 1;
-    else if (a < (1 << 16)) b = ff_sqrt_tab[a >> 8]   ;
-#endif
-    else {
-        int s = av_log2_16bit(a >> 16) >> 1;
-        unsigned int c = a >> (s + 2);
-        b = ff_sqrt_tab[c >> (s + 8)];
-        b = FASTDIV(c,b) + (b << s);
-    }
-
-    return b - (a < b * b);
-}
-
-static inline int8_t ff_u8_to_s8(uint8_t a)
-{
-    union {
-        uint8_t u8;
-        int8_t  s8;
-    } b;
-    b.u8 = a;
-    return b.s8;
-}
-
-#endif /* AVCODEC_MATHOPS_H */
diff --git a/deps/libav/libavcodec/mathtables.c b/deps/libav/libavcodec/mathtables.c
deleted file mode 100644
index 8a3934b..0000000
--- a/deps/libav/libavcodec/mathtables.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-/* a*inverse[b]>>32 == a/b for all 0<=a<=16909558 && 2<=b<=256
- * for a>16909558, is an overestimate by less than 1 part in 1<<24 */
-const uint32_t ff_inverse[257]={
-         0, 4294967295U,2147483648U,1431655766, 1073741824,  858993460,  715827883,  613566757,
- 536870912,  477218589,  429496730,  390451573,  357913942,  330382100,  306783379,  286331154,
- 268435456,  252645136,  238609295,  226050911,  214748365,  204522253,  195225787,  186737709,
- 178956971,  171798692,  165191050,  159072863,  153391690,  148102321,  143165577,  138547333,
- 134217728,  130150525,  126322568,  122713352,  119304648,  116080198,  113025456,  110127367,
- 107374183,  104755300,  102261127,   99882961,   97612894,   95443718,   93368855,   91382283,
-  89478486,   87652394,   85899346,   84215046,   82595525,   81037119,   79536432,   78090315,
-  76695845,   75350304,   74051161,   72796056,   71582789,   70409300,   69273667,   68174085,
-  67108864,   66076420,   65075263,   64103990,   63161284,   62245903,   61356676,   60492498,
-  59652324,   58835169,   58040099,   57266231,   56512728,   55778797,   55063684,   54366675,
-  53687092,   53024288,   52377650,   51746594,   51130564,   50529028,   49941481,   49367441,
-  48806447,   48258060,   47721859,   47197443,   46684428,   46182445,   45691142,   45210183,
-  44739243,   44278014,   43826197,   43383509,   42949673,   42524429,   42107523,   41698712,
-  41297763,   40904451,   40518560,   40139882,   39768216,   39403370,   39045158,   38693400,
-  38347923,   38008561,   37675152,   37347542,   37025581,   36709123,   36398028,   36092163,
-  35791395,   35495598,   35204650,   34918434,   34636834,   34359739,   34087043,   33818641,
-  33554432,   33294321,   33038210,   32786010,   32537632,   32292988,   32051995,   31814573,
-  31580642,   31350127,   31122952,   30899046,   30678338,   30460761,   30246249,   30034737,
-  29826162,   29620465,   29417585,   29217465,   29020050,   28825284,   28633116,   28443493,
-  28256364,   28071682,   27889399,   27709467,   27531842,   27356480,   27183338,   27012373,
-  26843546,   26676816,   26512144,   26349493,   26188825,   26030105,   25873297,   25718368,
-  25565282,   25414008,   25264514,   25116768,   24970741,   24826401,   24683721,   24542671,
-  24403224,   24265352,   24129030,   23994231,   23860930,   23729102,   23598722,   23469767,
-  23342214,   23216040,   23091223,   22967740,   22845571,   22724695,   22605092,   22486740,
-  22369622,   22253717,   22139007,   22025474,   21913099,   21801865,   21691755,   21582751,
-  21474837,   21367997,   21262215,   21157475,   21053762,   20951060,   20849356,   20748635,
-  20648882,   20550083,   20452226,   20355296,   20259280,   20164166,   20069941,   19976593,
-  19884108,   19792477,   19701685,   19611723,   19522579,   19434242,   19346700,   19259944,
-  19173962,   19088744,   19004281,   18920561,   18837576,   18755316,   18673771,   18592933,
-  18512791,   18433337,   18354562,   18276457,   18199014,   18122225,   18046082,   17970575,
-  17895698,   17821442,   17747799,   17674763,   17602325,   17530479,   17459217,   17388532,
-  17318417,   17248865,   17179870,   17111424,   17043522,   16976156,   16909321,   16843010,
-  16777216
-};
-
-const uint8_t ff_sqrt_tab[256]={
-  0, 16, 23, 28, 32, 36, 40, 43, 46, 48, 51, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 77, 79, 80, 82, 84, 85, 87, 88, 90,
- 91, 92, 94, 95, 96, 98, 99,100,102,103,104,105,107,108,109,110,111,112,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
-128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,144,145,146,147,148,149,150,151,151,152,153,154,155,156,156,
-157,158,159,160,160,161,162,163,164,164,165,166,167,168,168,169,170,171,171,172,173,174,174,175,176,176,177,178,179,179,180,181,
-182,182,183,184,184,185,186,186,187,188,188,189,190,190,191,192,192,193,194,194,195,196,196,197,198,198,199,200,200,201,202,202,
-203,204,204,205,205,206,207,207,208,208,209,210,210,211,212,212,213,213,214,215,215,216,216,217,218,218,219,219,220,220,221,222,
-222,223,223,224,224,225,226,226,227,227,228,228,229,230,230,231,231,232,232,233,233,234,235,235,236,236,237,237,238,238,239,239,
-240,240,241,242,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,252,252,253,253,254,254,255,255,255
-};
-
-const uint8_t ff_reverse[256] = {
-0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
-0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
-0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
-0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
-0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
-0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
-0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
-0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
-0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
-0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
-0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
-0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
-0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
-0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
-0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
-0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
-};
-
-#define times4(x) x, x, x, x
-#define times256(x) times4(times4(times4(times4(times4(x)))))
-
-const uint8_t ff_cropTbl[256 + 2 * 1024] = {
-times256(0x00),
-0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
-0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
-0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
-0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
-0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
-0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
-0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
-0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
-0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
-0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
-0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
-0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
-0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
-0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
-0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
-0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
-times256(0xFF)
-};
-
-const uint8_t ff_zigzag_direct[64] = {
-    0,   1,  8, 16,  9,  2,  3, 10,
-    17, 24, 32, 25, 18, 11,  4,  5,
-    12, 19, 26, 33, 40, 48, 41, 34,
-    27, 20, 13,  6,  7, 14, 21, 28,
-    35, 42, 49, 56, 57, 50, 43, 36,
-    29, 22, 15, 23, 30, 37, 44, 51,
-    58, 59, 52, 45, 38, 31, 39, 46,
-    53, 60, 61, 54, 47, 55, 62, 63
-};
diff --git a/deps/libav/libavcodec/mdct_fixed.c b/deps/libav/libavcodec/mdct_fixed.c
deleted file mode 100644
index 9e06861..0000000
--- a/deps/libav/libavcodec/mdct_fixed.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define FFT_FLOAT 0
-#include "mdct_template.c"
-
-/* same as ff_mdct_calcw_c with double-width unscaled output */
-void ff_mdct_calcw_c(FFTContext *s, FFTDouble *out, const FFTSample *input)
-{
-    int i, j, n, n8, n4, n2, n3;
-    FFTDouble re, im;
-    const uint16_t *revtab = s->revtab;
-    const FFTSample *tcos = s->tcos;
-    const FFTSample *tsin = s->tsin;
-    FFTComplex *x = s->tmp_buf;
-    FFTDComplex *o = (FFTDComplex *)out;
-
-    n = 1 << s->mdct_bits;
-    n2 = n >> 1;
-    n4 = n >> 2;
-    n8 = n >> 3;
-    n3 = 3 * n4;
-
-    /* pre rotation */
-    for(i=0;i<n8;i++) {
-        re = RSCALE(-input[2*i+n3] - input[n3-1-2*i]);
-        im = RSCALE(-input[n4+2*i] + input[n4-1-2*i]);
-        j = revtab[i];
-        CMUL(x[j].re, x[j].im, re, im, -tcos[i], tsin[i]);
-
-        re = RSCALE( input[2*i]    - input[n2-1-2*i]);
-        im = RSCALE(-input[n2+2*i] - input[ n-1-2*i]);
-        j = revtab[n8 + i];
-        CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]);
-    }
-
-    s->fft_calc(s, x);
-
-    /* post rotation */
-    for(i=0;i<n8;i++) {
-        FFTDouble r0, i0, r1, i1;
-        CMULL(i1, r0, x[n8-i-1].re, x[n8-i-1].im, -tsin[n8-i-1], -tcos[n8-i-1]);
-        CMULL(i0, r1, x[n8+i  ].re, x[n8+i  ].im, -tsin[n8+i  ], -tcos[n8+i  ]);
-        o[n8-i-1].re = r0;
-        o[n8-i-1].im = i0;
-        o[n8+i  ].re = r1;
-        o[n8+i  ].im = i1;
-    }
-}
diff --git a/deps/libav/libavcodec/mdct_float.c b/deps/libav/libavcodec/mdct_float.c
deleted file mode 100644
index a0a62b3..0000000
--- a/deps/libav/libavcodec/mdct_float.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define FFT_FLOAT 1
-#include "mdct_template.c"
diff --git a/deps/libav/libavcodec/mdct_template.c b/deps/libav/libavcodec/mdct_template.c
deleted file mode 100644
index bad890e..0000000
--- a/deps/libav/libavcodec/mdct_template.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * MDCT/IMDCT transforms
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "fft.h"
-#include "fft-internal.h"
-
-/**
- * @file
- * MDCT/IMDCT transforms.
- */
-
-#if FFT_FLOAT
-#   define RSCALE(x) (x)
-#else
-#   define RSCALE(x) ((x) >> 1)
-#endif
-
-/**
- * init MDCT or IMDCT computation.
- */
-av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale)
-{
-    int n, n4, i;
-    double alpha, theta;
-    int tstep;
-
-    memset(s, 0, sizeof(*s));
-    n = 1 << nbits;
-    s->mdct_bits = nbits;
-    s->mdct_size = n;
-    n4 = n >> 2;
-    s->mdct_permutation = FF_MDCT_PERM_NONE;
-
-    if (ff_fft_init(s, s->mdct_bits - 2, inverse) < 0)
-        goto fail;
-
-    s->tcos = av_malloc(n/2 * sizeof(FFTSample));
-    if (!s->tcos)
-        goto fail;
-
-    switch (s->mdct_permutation) {
-    case FF_MDCT_PERM_NONE:
-        s->tsin = s->tcos + n4;
-        tstep = 1;
-        break;
-    case FF_MDCT_PERM_INTERLEAVE:
-        s->tsin = s->tcos + 1;
-        tstep = 2;
-        break;
-    default:
-        goto fail;
-    }
-
-    theta = 1.0 / 8.0 + (scale < 0 ? n4 : 0);
-    scale = sqrt(fabs(scale));
-    for(i=0;i<n4;i++) {
-        alpha = 2 * M_PI * (i + theta) / n;
-        s->tcos[i*tstep] = FIX15(-cos(alpha) * scale);
-        s->tsin[i*tstep] = FIX15(-sin(alpha) * scale);
-    }
-    return 0;
- fail:
-    ff_mdct_end(s);
-    return -1;
-}
-
-/**
- * Compute the middle half of the inverse MDCT of size N = 2^nbits,
- * thus excluding the parts that can be derived by symmetry
- * @param output N/2 samples
- * @param input N/2 samples
- */
-void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    int k, n8, n4, n2, n, j;
-    const uint16_t *revtab = s->revtab;
-    const FFTSample *tcos = s->tcos;
-    const FFTSample *tsin = s->tsin;
-    const FFTSample *in1, *in2;
-    FFTComplex *z = (FFTComplex *)output;
-
-    n = 1 << s->mdct_bits;
-    n2 = n >> 1;
-    n4 = n >> 2;
-    n8 = n >> 3;
-
-    /* pre rotation */
-    in1 = input;
-    in2 = input + n2 - 1;
-    for(k = 0; k < n4; k++) {
-        j=revtab[k];
-        CMUL(z[j].re, z[j].im, *in2, *in1, tcos[k], tsin[k]);
-        in1 += 2;
-        in2 -= 2;
-    }
-    s->fft_calc(s, z);
-
-    /* post rotation + reordering */
-    for(k = 0; k < n8; k++) {
-        FFTSample r0, i0, r1, i1;
-        CMUL(r0, i1, z[n8-k-1].im, z[n8-k-1].re, tsin[n8-k-1], tcos[n8-k-1]);
-        CMUL(r1, i0, z[n8+k  ].im, z[n8+k  ].re, tsin[n8+k  ], tcos[n8+k  ]);
-        z[n8-k-1].re = r0;
-        z[n8-k-1].im = i0;
-        z[n8+k  ].re = r1;
-        z[n8+k  ].im = i1;
-    }
-}
-
-/**
- * Compute inverse MDCT of size N = 2^nbits
- * @param output N samples
- * @param input N/2 samples
- */
-void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    int k;
-    int n = 1 << s->mdct_bits;
-    int n2 = n >> 1;
-    int n4 = n >> 2;
-
-    ff_imdct_half_c(s, output+n4, input);
-
-    for(k = 0; k < n4; k++) {
-        output[k] = -output[n2-k-1];
-        output[n-k-1] = output[n2+k];
-    }
-}
-
-/**
- * Compute MDCT of size N = 2^nbits
- * @param input N samples
- * @param out N/2 samples
- */
-void ff_mdct_calc_c(FFTContext *s, FFTSample *out, const FFTSample *input)
-{
-    int i, j, n, n8, n4, n2, n3;
-    FFTDouble re, im;
-    const uint16_t *revtab = s->revtab;
-    const FFTSample *tcos = s->tcos;
-    const FFTSample *tsin = s->tsin;
-    FFTComplex *x = (FFTComplex *)out;
-
-    n = 1 << s->mdct_bits;
-    n2 = n >> 1;
-    n4 = n >> 2;
-    n8 = n >> 3;
-    n3 = 3 * n4;
-
-    /* pre rotation */
-    for(i=0;i<n8;i++) {
-        re = RSCALE(-input[2*i+n3] - input[n3-1-2*i]);
-        im = RSCALE(-input[n4+2*i] + input[n4-1-2*i]);
-        j = revtab[i];
-        CMUL(x[j].re, x[j].im, re, im, -tcos[i], tsin[i]);
-
-        re = RSCALE( input[2*i]    - input[n2-1-2*i]);
-        im = RSCALE(-input[n2+2*i] - input[ n-1-2*i]);
-        j = revtab[n8 + i];
-        CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]);
-    }
-
-    s->fft_calc(s, x);
-
-    /* post rotation */
-    for(i=0;i<n8;i++) {
-        FFTSample r0, i0, r1, i1;
-        CMUL(i1, r0, x[n8-i-1].re, x[n8-i-1].im, -tsin[n8-i-1], -tcos[n8-i-1]);
-        CMUL(i0, r1, x[n8+i  ].re, x[n8+i  ].im, -tsin[n8+i  ], -tcos[n8+i  ]);
-        x[n8-i-1].re = r0;
-        x[n8-i-1].im = i0;
-        x[n8+i  ].re = r1;
-        x[n8+i  ].im = i1;
-    }
-}
-
-av_cold void ff_mdct_end(FFTContext *s)
-{
-    av_freep(&s->tcos);
-    ff_fft_end(s);
-}
diff --git a/deps/libav/libavcodec/mdec.c b/deps/libav/libavcodec/mdec.c
deleted file mode 100644
index b9ffca6..0000000
--- a/deps/libav/libavcodec/mdec.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Sony PlayStation MDEC (Motion DECoder)
- * Copyright (c) 2003 Michael Niedermayer
- *
- * based upon code from Sebastian Jedruszkiewicz <elf at frogger.rules.pl>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sony PlayStation MDEC (Motion DECoder)
- * This is very similar to intra-only MPEG-1.
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "mpeg12.h"
-#include "thread.h"
-
-typedef struct MDECContext {
-    AVCodecContext *avctx;
-    DSPContext dsp;
-    ThreadFrame frame;
-    GetBitContext gb;
-    ScanTable scantable;
-    int version;
-    int qscale;
-    int last_dc[3];
-    int mb_width;
-    int mb_height;
-    int mb_x, mb_y;
-    DECLARE_ALIGNED(16, int16_t, block)[6][64];
-    uint8_t *bitstream_buffer;
-    unsigned int bitstream_buffer_size;
-    int block_last_index[6];
-} MDECContext;
-
-//very similar to MPEG-1
-static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
-{
-    int level, diff, i, j, run;
-    int component;
-    RLTable *rl = &ff_rl_mpeg1;
-    uint8_t * const scantable = a->scantable.permutated;
-    const uint16_t *quant_matrix = ff_mpeg1_default_intra_matrix;
-    const int qscale = a->qscale;
-
-    /* DC coefficient */
-    if (a->version == 2) {
-        block[0] = 2 * get_sbits(&a->gb, 10) + 1024;
-    } else {
-        component = (n <= 3 ? 0 : n - 4 + 1);
-        diff = decode_dc(&a->gb, component);
-        if (diff >= 0xffff)
-            return AVERROR_INVALIDDATA;
-        a->last_dc[component] += diff;
-        block[0] = a->last_dc[component] << 3;
-    }
-
-    i = 0;
-    {
-        OPEN_READER(re, &a->gb);
-        /* now quantify & encode AC coefficients */
-        for (;;) {
-            UPDATE_CACHE(re, &a->gb);
-            GET_RL_VLC(level, run, re, &a->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
-            if (level == 127) {
-                break;
-            } else if (level != 0) {
-                i    += run;
-                j     = scantable[i];
-                level = (level * qscale * quant_matrix[j]) >> 3;
-                level = (level ^ SHOW_SBITS(re, &a->gb, 1)) - SHOW_SBITS(re, &a->gb, 1);
-                LAST_SKIP_BITS(re, &a->gb, 1);
-            } else {
-                /* escape */
-                run = SHOW_UBITS(re, &a->gb, 6)+1; LAST_SKIP_BITS(re, &a->gb, 6);
-                UPDATE_CACHE(re, &a->gb);
-                level = SHOW_SBITS(re, &a->gb, 10); SKIP_BITS(re, &a->gb, 10);
-                i    += run;
-                j     = scantable[i];
-                if (level < 0) {
-                    level = -level;
-                    level = (level * qscale * quant_matrix[j]) >> 3;
-                    level = (level - 1) | 1;
-                    level = -level;
-                } else {
-                    level = (level * qscale * quant_matrix[j]) >> 3;
-                    level = (level - 1) | 1;
-                }
-            }
-            if (i > 63) {
-                av_log(a->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", a->mb_x, a->mb_y);
-                return AVERROR_INVALIDDATA;
-            }
-
-            block[j] = level;
-        }
-        CLOSE_READER(re, &a->gb);
-    }
-    a->block_last_index[n] = i;
-    return 0;
-}
-
-static inline int decode_mb(MDECContext *a, int16_t block[6][64])
-{
-    int i, ret;
-    const int block_index[6] = { 5, 4, 0, 1, 2, 3 };
-
-    a->dsp.clear_blocks(block[0]);
-
-    for (i = 0; i < 6; i++) {
-        if ((ret = mdec_decode_block_intra(a, block[block_index[i]],
-                                           block_index[i])) < 0)
-            return ret;
-        if (get_bits_left(&a->gb) < 0)
-            return AVERROR_INVALIDDATA;
-    }
-    return 0;
-}
-
-static inline void idct_put(MDECContext *a, AVFrame *frame, int mb_x, int mb_y)
-{
-    int16_t (*block)[64] = a->block;
-    int linesize = frame->linesize[0];
-
-    uint8_t *dest_y  = frame->data[0] + (mb_y * 16* linesize              ) + mb_x * 16;
-    uint8_t *dest_cb = frame->data[1] + (mb_y * 8 * frame->linesize[1]) + mb_x * 8;
-    uint8_t *dest_cr = frame->data[2] + (mb_y * 8 * frame->linesize[2]) + mb_x * 8;
-
-    a->dsp.idct_put(dest_y,                    linesize, block[0]);
-    a->dsp.idct_put(dest_y                + 8, linesize, block[1]);
-    a->dsp.idct_put(dest_y + 8 * linesize,     linesize, block[2]);
-    a->dsp.idct_put(dest_y + 8 * linesize + 8, linesize, block[3]);
-
-    if (!(a->avctx->flags & CODEC_FLAG_GRAY)) {
-        a->dsp.idct_put(dest_cb, frame->linesize[1], block[4]);
-        a->dsp.idct_put(dest_cr, frame->linesize[2], block[5]);
-    }
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    MDECContext * const a = avctx->priv_data;
-    const uint8_t *buf    = avpkt->data;
-    int buf_size          = avpkt->size;
-    ThreadFrame frame     = { .f = data };
-    int i, ret;
-
-    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    frame.f->pict_type = AV_PICTURE_TYPE_I;
-    frame.f->key_frame = 1;
-
-    av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!a->bitstream_buffer)
-        return AVERROR(ENOMEM);
-    for (i = 0; i < buf_size; i += 2) {
-        a->bitstream_buffer[i]     = buf[i + 1];
-        a->bitstream_buffer[i + 1] = buf[i];
-    }
-    init_get_bits(&a->gb, a->bitstream_buffer, buf_size * 8);
-
-    /* skip over 4 preamble bytes in stream (typically 0xXX 0xXX 0x00 0x38) */
-    skip_bits(&a->gb, 32);
-
-    a->qscale  = get_bits(&a->gb, 16);
-    a->version = get_bits(&a->gb, 16);
-
-    a->last_dc[0] = a->last_dc[1] = a->last_dc[2] = 128;
-
-    for (a->mb_x = 0; a->mb_x < a->mb_width; a->mb_x++) {
-        for (a->mb_y = 0; a->mb_y < a->mb_height; a->mb_y++) {
-            if ((ret = decode_mb(a, a->block)) < 0)
-                return ret;
-
-            idct_put(a, frame.f, a->mb_x, a->mb_y);
-        }
-    }
-
-    *got_frame = 1;
-
-    return (get_bits_count(&a->gb) + 31) / 32 * 4;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    MDECContext * const a = avctx->priv_data;
-
-    a->mb_width  = (avctx->coded_width  + 15) / 16;
-    a->mb_height = (avctx->coded_height + 15) / 16;
-
-    a->avctx           = avctx;
-
-    ff_dsputil_init(&a->dsp, avctx);
-    ff_mpeg12_init_vlcs();
-    ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_zigzag_direct);
-
-    if (avctx->idct_algo == FF_IDCT_AUTO)
-        avctx->idct_algo = FF_IDCT_SIMPLE;
-    avctx->pix_fmt  = AV_PIX_FMT_YUVJ420P;
-
-    return 0;
-}
-
-static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
-{
-    MDECContext * const a = avctx->priv_data;
-
-    a->avctx           = avctx;
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    MDECContext * const a = avctx->priv_data;
-
-    av_freep(&a->bitstream_buffer);
-    a->bitstream_buffer_size = 0;
-
-    return 0;
-}
-
-AVCodec ff_mdec_decoder = {
-    .name             = "mdec",
-    .long_name        = NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion DECoder)"),
-    .type             = AVMEDIA_TYPE_VIDEO,
-    .id               = AV_CODEC_ID_MDEC,
-    .priv_data_size   = sizeof(MDECContext),
-    .init             = decode_init,
-    .close            = decode_end,
-    .decode           = decode_frame,
-    .capabilities     = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
-    .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy)
-};
diff --git a/deps/libav/libavcodec/metasound.c b/deps/libav/libavcodec/metasound.c
deleted file mode 100644
index ae16ad0..0000000
--- a/deps/libav/libavcodec/metasound.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Voxware MetaSound decoder
- * Copyright (c) 2013 Konstantin Shishkov
- * based on TwinVQ decoder
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <math.h>
-#include <stdint.h>
-
-#define BITSTREAM_READER_LE
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "fft.h"
-#include "internal.h"
-#include "lsp.h"
-#include "sinewin.h"
-
-#include "twinvq.h"
-#include "metasound_data.h"
-
-static void add_peak(float period, int width, const float *shape,
-                     float ppc_gain, float *speech, int len)
-{
-    int i, j, center;
-    const float *shape_end = shape + len;
-
-    // First peak centered around zero
-    for (i = 0; i < width / 2; i++)
-        speech[i] += ppc_gain * *shape++;
-
-    for (i = 1; i < ROUNDED_DIV(len, width); i++) {
-        center = (int)(i * period + 0.5);
-        for (j = -width / 2; j < (width + 1) / 2; j++)
-            speech[j + center] += ppc_gain * *shape++;
-    }
-
-    // For the last block, be careful not to go beyond the end of the buffer
-    center = (int)(i * period + 0.5);
-    for (j = -width / 2; j < (width + 1) / 2 && shape < shape_end; j++)
-        speech[j + center] += ppc_gain * *shape++;
-}
-
-static void decode_ppc(TwinVQContext *tctx, int period_coef, int g_coef,
-                       const float *shape, float *speech)
-{
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int isampf       = tctx->avctx->sample_rate / 1000;
-    int ibps         = tctx->avctx->bit_rate / (1000 * tctx->avctx->channels);
-    int width;
-
-    float ratio = (float)mtab->size / isampf;
-    float min_period, max_period, period_range, period;
-    float some_mult;
-
-    float pgain_base, pgain_step, ppc_gain;
-
-    if (tctx->avctx->channels == 1) {
-        min_period = log2(ratio * 0.2);
-        max_period = min_period + log2(6);
-    } else {
-        min_period = (int)(ratio * 0.2 * 400     + 0.5) / 400.0;
-        max_period = (int)(ratio * 0.2 * 400 * 6 + 0.5) / 400.0;
-    }
-    period_range = max_period - min_period;
-    period       = min_period + period_coef * period_range /
-                   ((1 << mtab->ppc_period_bit) - 1);
-    if (tctx->avctx->channels == 1)
-        period = powf(2.0, period);
-    else
-        period = (int)(period * 400 + 0.5) / 400.0;
-
-    switch (isampf) {
-    case  8: some_mult = 2.0; break;
-    case 11: some_mult = 3.0; break;
-    case 16: some_mult = 3.0; break;
-    case 22: some_mult = ibps == 32 ? 2.0 : 4.0; break;
-    case 44: some_mult = 8.0; break;
-    default: some_mult = 4.0;
-    }
-
-    width = (int)(some_mult / (mtab->size / period) * mtab->ppc_shape_len);
-    if (isampf == 22 && ibps == 32)
-        width = (int)((2.0 / period + 1) * width + 0.5);
-
-    pgain_base = tctx->avctx->channels == 2 ? 25000.0 : 20000.0;
-    pgain_step = pgain_base / ((1 << mtab->pgain_bit) - 1);
-    ppc_gain   = 1.0 / 8192 *
-                 twinvq_mulawinv(pgain_step * g_coef + pgain_step / 2,
-                                 pgain_base, TWINVQ_PGAIN_MU);
-
-    add_peak(period, width, shape, ppc_gain, speech, mtab->ppc_shape_len);
-}
-
-static void dec_bark_env(TwinVQContext *tctx, const uint8_t *in, int use_hist,
-                         int ch, float *out, float gain,
-                         enum TwinVQFrameType ftype)
-{
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int i, j;
-    float *hist     = tctx->bark_hist[ftype][ch];
-    float val       = ((const float []) { 0.4, 0.35, 0.28 })[ftype];
-    int bark_n_coef = mtab->fmode[ftype].bark_n_coef;
-    int fw_cb_len   = mtab->fmode[ftype].bark_env_size / bark_n_coef;
-    int idx         = 0;
-
-    if (tctx->avctx->channels == 1)
-        val = 0.5;
-    for (i = 0; i < fw_cb_len; i++)
-        for (j = 0; j < bark_n_coef; j++, idx++) {
-            float tmp2 = mtab->fmode[ftype].bark_cb[fw_cb_len * in[j] + i] *
-                         (1.0 / 2048);
-            float st;
-
-            if (tctx->avctx->channels == 1)
-                st = use_hist ?
-                    tmp2 + val * hist[idx] + 1.0 : tmp2 + 1.0;
-            else
-                st = use_hist ? (1.0 - val) * tmp2 + val * hist[idx] + 1.0
-                              : tmp2 + 1.0;
-
-            hist[idx] = tmp2;
-            if (st < 0.1)
-                st = 0.1;
-
-            twinvq_memset_float(out, st * gain,
-                                mtab->fmode[ftype].bark_tab[idx]);
-            out += mtab->fmode[ftype].bark_tab[idx];
-        }
-}
-
-static void read_cb_data(TwinVQContext *tctx, GetBitContext *gb,
-                         uint8_t *dst, enum TwinVQFrameType ftype)
-{
-    int i;
-
-    for (i = 0; i < tctx->n_div[ftype]; i++) {
-        int bs_second_part = (i >= tctx->bits_main_spec_change[ftype]);
-
-        *dst++ = get_bits(gb, tctx->bits_main_spec[0][ftype][bs_second_part]);
-        *dst++ = get_bits(gb, tctx->bits_main_spec[1][ftype][bs_second_part]);
-    }
-}
-
-static int metasound_read_bitstream(AVCodecContext *avctx, TwinVQContext *tctx,
-                                    const uint8_t *buf, int buf_size)
-{
-    TwinVQFrameData     *bits;
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int channels              = tctx->avctx->channels;
-    int sub;
-    GetBitContext gb;
-    int i, j, k;
-
-    init_get_bits(&gb, buf, buf_size * 8);
-
-    for (tctx->cur_frame = 0; tctx->cur_frame < tctx->frames_per_packet;
-         tctx->cur_frame++) {
-        bits = tctx->bits + tctx->cur_frame;
-
-        bits->window_type = get_bits(&gb, TWINVQ_WINDOW_TYPE_BITS);
-
-        if (bits->window_type > 8) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid window type, broken sample?\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        bits->ftype = ff_twinvq_wtype_to_ftype_table[tctx->bits[tctx->cur_frame].window_type];
-
-        sub = mtab->fmode[bits->ftype].sub;
-
-        if (bits->ftype != TWINVQ_FT_SHORT && !tctx->is_6kbps)
-            get_bits(&gb, 2);
-
-        read_cb_data(tctx, &gb, bits->main_coeffs, bits->ftype);
-
-        for (i = 0; i < channels; i++)
-            for (j = 0; j < sub; j++)
-                for (k = 0; k < mtab->fmode[bits->ftype].bark_n_coef; k++)
-                    bits->bark1[i][j][k] =
-                        get_bits(&gb, mtab->fmode[bits->ftype].bark_n_bit);
-
-        for (i = 0; i < channels; i++)
-            for (j = 0; j < sub; j++)
-                bits->bark_use_hist[i][j] = get_bits1(&gb);
-
-        if (bits->ftype == TWINVQ_FT_LONG) {
-            for (i = 0; i < channels; i++)
-                bits->gain_bits[i] = get_bits(&gb, TWINVQ_GAIN_BITS);
-        } else {
-            for (i = 0; i < channels; i++) {
-                bits->gain_bits[i] = get_bits(&gb, TWINVQ_GAIN_BITS);
-                for (j = 0; j < sub; j++)
-                    bits->sub_gain_bits[i * sub + j] =
-                        get_bits(&gb, TWINVQ_SUB_GAIN_BITS);
-            }
-        }
-
-        for (i = 0; i < channels; i++) {
-            bits->lpc_hist_idx[i] = get_bits(&gb, mtab->lsp_bit0);
-            bits->lpc_idx1[i]     = get_bits(&gb, mtab->lsp_bit1);
-
-            for (j = 0; j < mtab->lsp_split; j++)
-                bits->lpc_idx2[i][j] = get_bits(&gb, mtab->lsp_bit2);
-        }
-
-        if (bits->ftype == TWINVQ_FT_LONG) {
-            read_cb_data(tctx, &gb, bits->ppc_coeffs, 3);
-            for (i = 0; i < channels; i++) {
-                bits->p_coef[i] = get_bits(&gb, mtab->ppc_period_bit);
-                bits->g_coef[i] = get_bits(&gb, mtab->pgain_bit);
-            }
-        }
-
-        // subframes are aligned to nibbles
-        if (get_bits_count(&gb) & 3)
-            skip_bits(&gb, 4 - (get_bits_count(&gb) & 3));
-    }
-
-    return 0;
-}
-
-typedef struct MetasoundProps {
-    uint32_t tag;
-    int      bit_rate;
-    int      channels;
-    int      sample_rate;
-} MetasoundProps;
-
-static const MetasoundProps codec_props[] = {
-    { MKTAG('V','X','0','3'),  6, 1,  8000 },
-    { MKTAG('V','X','0','4'), 12, 2,  8000 },
-
-    { MKTAG('V','O','X','i'),  8, 1,  8000 },
-    { MKTAG('V','O','X','j'), 10, 1, 11025 },
-    { MKTAG('V','O','X','k'), 16, 1, 16000 },
-    { MKTAG('V','O','X','L'), 24, 1, 22050 },
-    { MKTAG('V','O','X','q'), 32, 1, 44100 },
-    { MKTAG('V','O','X','r'), 40, 1, 44100 },
-    { MKTAG('V','O','X','s'), 48, 1, 44100 },
-    { MKTAG('V','O','X','t'), 16, 2,  8000 },
-    { MKTAG('V','O','X','u'), 20, 2, 11025 },
-    { MKTAG('V','O','X','v'), 32, 2, 16000 },
-    { MKTAG('V','O','X','w'), 48, 2, 22050 },
-    { MKTAG('V','O','X','x'), 64, 2, 44100 },
-    { MKTAG('V','O','X','y'), 80, 2, 44100 },
-    { MKTAG('V','O','X','z'), 96, 2, 44100 },
-
-    { 0, 0, 0, 0 }
-};
-
-static av_cold int metasound_decode_init(AVCodecContext *avctx)
-{
-    int isampf, ibps;
-    TwinVQContext *tctx = avctx->priv_data;
-    uint32_t tag;
-    const MetasoundProps *props = codec_props;
-
-    if (!avctx->extradata || avctx->extradata_size < 16) {
-        av_log(avctx, AV_LOG_ERROR, "Missing or incomplete extradata\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    tag = AV_RL32(avctx->extradata + 12);
-
-    for (;;) {
-        if (!props->tag) {
-            av_log(avctx, AV_LOG_ERROR, "Could not find tag %08X\n", tag);
-            return AVERROR_INVALIDDATA;
-        }
-        if (props->tag == tag) {
-            avctx->sample_rate = props->sample_rate;
-            avctx->channels    = props->channels;
-            avctx->bit_rate    = props->bit_rate * 1000;
-            isampf             = avctx->sample_rate / 1000;
-            break;
-        }
-        props++;
-    }
-
-    if (avctx->channels <= 0 || avctx->channels > TWINVQ_CHANNELS_MAX) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %i\n",
-               avctx->channels);
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO
-                                                 : AV_CH_LAYOUT_STEREO;
-
-    ibps = avctx->bit_rate / (1000 * avctx->channels);
-
-    switch ((avctx->channels << 16) + (isampf << 8) + ibps) {
-    case (1 << 16) + ( 8 << 8) +  6:
-        tctx->mtab = &ff_metasound_mode0806;
-        break;
-    case (2 << 16) + ( 8 << 8) +  6:
-        tctx->mtab = &ff_metasound_mode0806s;
-        break;
-    case (1 << 16) + ( 8 << 8) +  8:
-        tctx->mtab = &ff_metasound_mode0808;
-        break;
-    case (2 << 16) + ( 8 << 8) +  8:
-        tctx->mtab = &ff_metasound_mode0808s;
-        break;
-    case (1 << 16) + (11 << 8) + 10:
-        tctx->mtab = &ff_metasound_mode1110;
-        break;
-    case (2 << 16) + (11 << 8) + 10:
-        tctx->mtab = &ff_metasound_mode1110s;
-        break;
-    case (1 << 16) + (16 << 8) + 16:
-        tctx->mtab = &ff_metasound_mode1616;
-        break;
-    case (2 << 16) + (16 << 8) + 16:
-        tctx->mtab = &ff_metasound_mode1616s;
-        break;
-    case (1 << 16) + (22 << 8) + 24:
-        tctx->mtab = &ff_metasound_mode2224;
-        break;
-    case (2 << 16) + (22 << 8) + 24:
-        tctx->mtab = &ff_metasound_mode2224s;
-        break;
-    case (1 << 16) + (44 << 8) + 32:
-        tctx->mtab = &ff_metasound_mode4432;
-        break;
-    case (2 << 16) + (44 << 8) + 32:
-        tctx->mtab = &ff_metasound_mode4432s;
-        break;
-    case (1 << 16) + (44 << 8) + 40:
-        tctx->mtab = &ff_metasound_mode4440;
-        break;
-    case (2 << 16) + (44 << 8) + 40:
-        tctx->mtab = &ff_metasound_mode4440s;
-        break;
-    case (1 << 16) + (44 << 8) + 48:
-        tctx->mtab = &ff_metasound_mode4448;
-        break;
-    case (2 << 16) + (44 << 8) + 48:
-        tctx->mtab = &ff_metasound_mode4448s;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR,
-               "This version does not support %d kHz - %d kbit/s/ch mode.\n",
-               isampf, ibps);
-        return AVERROR(ENOSYS);
-    }
-
-    tctx->codec          = TWINVQ_CODEC_METASOUND;
-    tctx->read_bitstream = metasound_read_bitstream;
-    tctx->dec_bark_env   = dec_bark_env;
-    tctx->decode_ppc     = decode_ppc;
-    tctx->frame_size     = avctx->bit_rate * tctx->mtab->size
-                                           / avctx->sample_rate;
-    tctx->is_6kbps       = ibps == 6;
-
-    return ff_twinvq_decode_init(avctx);
-}
-
-AVCodec ff_metasound_decoder = {
-    .name           = "metasound",
-    .long_name      = NULL_IF_CONFIG_SMALL("Voxware MetaSound"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_METASOUND,
-    .priv_data_size = sizeof(TwinVQContext),
-    .init           = metasound_decode_init,
-    .close          = ff_twinvq_decode_close,
-    .decode         = ff_twinvq_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/metasound_data.c b/deps/libav/libavcodec/metasound_data.c
deleted file mode 100644
index 8aa53e5..0000000
--- a/deps/libav/libavcodec/metasound_data.c
+++ /dev/null
@@ -1,15335 +0,0 @@
-/*
- * MetaSound decoder
- * Copyright (c) 2013 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "metasound_data.h"
-
-static const int16_t cb0806sl0[] = {
-      -417,   -225,    -84,     16,   -106,    -34,   -246,   -164,
-       112,     48,    -47,     36,    -65,    -68,   -172,  -1655,
-       -36,    140,     -3,     -2,     -2,      2,      0,      0,
-       178,      7,   -181,   -177,    120,    -64,   -129,     80,
-     -6826,    -38,    -25,    147,    148,    -13,    -25,    110,
-        21,     21,     -1,      0,      0,      0,      0,      0,
-      3319,    632,   -734,   -187,     40,   -249,   -155,     -1,
-      -173,     95,     28,     -2,     20,    -44,     35,    120,
-       -47,   -221,     -5,      2,     -7,      1,      0,      0,
-        63,    268,   -260,   -419,    187,    -75,   -228,    296,
-      -470,    177,   -515,    318,    124,    308,     92,    371,
-      3046,    362,     -1,     -1,    -10,      1,      0,      0,
-      -356,    -16,   -199,    117,    -75,     46,   -108,    -14,
-      -124,   -173,   4914,    -75,   -474,    105,     87,    190,
-      -183,   -208,      0,      0,      1,      1,      0,     -1,
-       162,     89,     49,   -314,  -2788,    265,   -263,     -3,
-     -3156,    316,    112,    128,   -333,   -138,   -114,   -141,
-      -287,   -234,     -1,      0,      0,      0,      0,      1,
-       733,    126,   -424,   -389,    642,    432,    134,   -251,
-       407,    -51,   -151,   -491,   -308,     91,     50,   3836,
-        87,    100,     -5,     -6,      0,      1,      0,      0,
-       304,   1727,     83,     -8,    216,    -81,   -189,    152,
-       -67,     15,    310,    -93,      6,    -37,     54,   -110,
-       -15,     78,      0,      0,      1,     12,      0,     -1,
-       129,   -198,      1,    -48,    -66,   -147,     30,    264,
-       -84,    102,     42,    126,      1,  -6451,    225,    -51,
-         8,    123,      0,     -1,      0,     -1,      0,      0,
-      -374,     66,   -256,    -80,  -1139,    303,   2002,   -199,
-       -98,    -98,    -39,    -76,    180,     15,   -456,    148,
-      -183,    118,     -2,      1,      0,      0,      0,      0,
-       151,     13,   -114,     65,   6156,     76,    -82,    -30,
-       -26,    163,     81,    167,    -83,   -101,     55,    -40,
-       161,   -793,     -8,      0,      0,     -1,     -1,      0,
-      -102,    -33,     55,   -131,    434,    108,     70,     68,
-        62,   1913,   -109,    235,    110,    124,    -25,    -58,
-       -76,     18,     -1,     -1,      0,      0,      0,      0,
-      -105,  -7322,     -9,     82,     53,    -43,     -5,     18,
-        90,     91,     20,    -34,     26,    -93,    -50,    -46,
-       -77,    105,      0,      6,    -12,     -6,      1,      0,
-     -1334,    980,   -163,   -351,   -514,    537,     62,   -300,
-        80,   -318,     14,  -3570,    -52,   -116,   -280,    540,
-       250,   -775,     -7,      0,      0,      0,      0,      0,
-       507,    317,   -417,   -236,  -2438,    -72,   -346,   2507,
-       302,   -185,     30,   1539,    205,     87,   -112,   -482,
-      -296,    132,     -1,      0,     -1,      1,      0,      0,
-       -64,   -208,   -159,      1,    336,    -62,    -14,     13,
-        81,    101,    382,     32,    116,     -5,    -41,     25,
-      -175,  -7829,      1,      0,      1,      0,      0,      0,
-      7551,     -7,     86,   -165,    -57,    -17,    183,   -207,
-        69,     54,    -99,    -25,    167,    -58,    107,    -81,
-       165,    172,      2,     -2,      0,      1,      0,     -9,
-        26,     28,     86,   -183,   -320,    -32,    116,    -53,
-       -49,    -15,    133,   -283,   -152,    576,   6630,    185,
-        44,     25,     20,      1,    -12,      1,     -1,      0,
-      -145,    -51,   -114,    -29,   -228,     78,   -409,    235,
-       147,     45,   -192,    177,    -91,     68,  -2572,    -52,
-        81,    181,     -5,     13,     -1,     -1,    -17,      0,
-       -65,    -23,    -28,      9,    242,     14,    -35,     88,
-        77,    -20,     37,  -7097,    -58,     51,    137,    126,
-       -90,    136,      0,      4,     -1,      0,      0,      0,
-      -266,    -82,   -205,    816,   -309,   3267,   1053,    369,
-      -216,   -302,     18,    168,    395,    273,    343,    243,
-       -98,    -53,      1,      0,      0,      1,      0,      0,
-       -65,    -76,   1850,   -991,   -454,   -535,   2927,   -145,
-       101,     23,     20,    234,    -74,     77,    114,      4,
-      -106,    527,    -11,      4,      0,      1,     -1,      0,
-       573,    -46,    207,   2640,   -956,     47,     26,    -10,
-       317,   -217,     -5,   -867,     -3,    213,     52,     53,
-      -428,   -175,      0,      0,     -1,     -1,      0,     -1,
-      -223,    -55,    135,    184,    313,      0,   2868,    245,
-     -3187,   -721,   -291,      9,   -265,   -120,   -105,    -36,
-       454,     55,     -1,     49,      0,      1,     -1,      0,
-      -291,     41,     84,    557,   -201,  -2300,    429,    283,
-        21,     -2,    132,    286,   -124,    149,    -14,    146,
-       320,   -298,      0,     -1,      1,     -2,      0,      0,
-       -86,  -3493,    131,  -3581,    185,     26,   -197,    -65,
-       -96,    147,    -53,   -150,    -35,    -35,    179,     68,
-      -157,      0,      0,      2,      0,      1,      2,     -1,
-       -22,   -218,     13,  -1447,   -400,    288,  -1295,      0,
-      -119,     69,    -56,   -139,    157,    -26,   -122,    -61,
-       -38,   -108,     -1,      1,      0,      0,      0,      0,
-      -229,   3335,    103,   -108,     10,   3008,   -712,     50,
-        27,    152,   -307,   -106,    148,    -77,   -178,    -46,
-         7,   -114,      0,     -9,      0,      0,      1,      0,
-       932,   -443,    311,    -75,     62,    -80,   -179,    459,
-      -232,   -160,      2,    169,    134,   -260,     41,   -149,
-        23,     92,     -2,      0,     11,      1,      0,      0,
-        16,    -90,   -574,   -171,    163,    261,   -299,   2994,
-        74,  -3818,   -396,   -171,     13,    -29,    -45,   -168,
-      -287,   -390,      1,      0,      0,     -4,      0,     -1,
-        89,   -702,   2223,    101,   -249,   2983,     36,   -333,
-      -382,    410,   -262,    185,   -146,     98,     -8,   -317,
-      -279,   -879,      0,      0,      0,      0,      4,      0,
-       -98,   -325,     75,   -229,    -13,    112,  -5743,    -34,
-       -89,    263,   -155,     80,    140,    -50,     33,    143,
-       -60,    -77,      1,     -2,      0,     -1,      1,      0,
-        52,   -576,   -543,  -1142,   -947,   -184,    449,    -71,
-       -75,   -156,  -3412,    -50,   -487,    307,    663,  -1000,
-      -415,  -2348,     -7,     -1,     -1,      0,      0,      0,
-        64,      3,    -35,     11,     14,   -198,     -2,  -8042,
-       140,    -11,    -93,     29,    -65,    330,     34,    110,
-       -19,   -137,      2,      0,      0,      0,      0,      0,
-      1236,    303,   2681,    234,   -217,   -406,   -395,   -380,
-       247,    349,   -101,    -33,    370,    -39,    139,     59,
-        18,     24,      0,      0,      0,      0,      0,      0,
-       166,    -21,  -5392,   -117,   -296,    114,    230,   -255,
-       131,    -53,     13,    -45,    200,      7,    -56,     87,
-        46,    223,    -59,      0,     -1,      0,      0,     -1,
-       214,   -511,    175,    204,   -123,    -47,   -440,      6,
-        23,     92,   -355,     80,  -4885,   -238,    -37,     78,
-      -218,    175,      0,      2,      0,      0,      0,      0,
-      -146,     74,    -13,     -4,     27,    -45,     51,     81,
-       -80,     53,    -18,    173,   -146,    -64,     -8,   8192,
-        79,     15,      0,     -3,      0,      1,      0,      0,
-        -3,    -16,    -28,    288,    -61,      4,   -187,      6,
-        -5,    -14,     77,    -12,    -53,     16,    -41,     -7,
-       -10,     -2,      7,     -1,     -9,      1,      0,      0,
-      -285,    -35,     -8,    221,    -68,    114,    135,     -8,
-      -203,   -181,    -91,   2043,    -58,    127,    201,    111,
-        46,   -344,    -11,    -49,      0,      1,      0,     -1,
-      -160,   -186,     58,   4761,    289,     51,   -145,     51,
-       -32,     71,     62,    175,    -13,    181,    203,    141,
-      -200,    106,     -1,      4,     -2,      0,      0,      0,
-       803,    -76,    -96,   -940,    300,   3429,    -84,   3037,
-       262,     -9,    -39,    120,   -629,   -309,    233,   -374,
-       398,    894,    -12,      1,      1,      1,      0,      0,
-      -282,   2525,    -31,   -176,  -2473,     53,    102,   -610,
-       180,   -145,     42,    -51,    223,     27,    -69,    727,
-       -14,    -51,      0,      0,      0,     -3,      0,    -40,
-       214,     72,     41,      1,    190,     78,   -228,   -235,
-       105,  -4619,   -140,    -46,     -7,     49,      9,    -19,
-       137,     -2,      9,      1,      0,      0,      0,      0,
-      -142,   -262,     29,   -142,     39,    -39,    -92,     95,
-        50,   -282,      2,   -106,    114,      8,     35,     78,
-      -121,   2589,      1,     -4,    -10,      1,      1,      0,
-      -192,     59,    287,    400,    -67,  -6989,   -301,    446,
-       115,      7,     33,    -60,    111,    102,      8,    206,
-        46,    -31,     -1,     -1,     -2,      0,      0,      0,
-      -104,    332,   -223,   1066,   -188,   1270,   -222,    309,
-      -296,    259,    780,   -460,  -1914,    218,   -556,    210,
-      2962,    130,      1,     -2,      2,      0,      1,      0,
-      -320,   -365,   -266,    822,   -119,    824,   -312,     58,
-     -1857,    235,     48,  -3985,    118,   -307,   -703,   -931,
-      -560,    105,     -2,     -3,      0,      0,      0,      1,
-       156,    -48,    187,    214,   -212,    180,    342,    373,
-      1973,    128,     -5,    146,    -40,    -11,     71,    -60,
-        76,     17,      0,      0,     -1,      2,      0,      7,
-       214,     63,    274,   2876,    -65,    314,    400,    344,
-       140,     39,    193,   -226,    124,  -3177,     68,     46,
-       -60,   -317,      2,      0,     -1,      0,      7,      0,
-      -160,    118,    233,    239,   -465,     96,    253,   3178,
-       -88,    299,    368,   -220,    197,    397,   -353,   -463,
-      -202,   -103,     -4,      0,      0,      0,      0,      0,
-       687,   -448,   -749,     87,    -35,    112,    309,    -33,
-       -16,     88,    141,     63,    -51,    274,   -113,    -76,
-        46,   -273,     -1,      1,      0,      1,      0,      1,
-      -298,   -206,    670,    303,   -451,   -277,   -493,    404,
-      -173,    284,    148,    626,   -322,   -296,    -68,   3044,
-      -442,   1138,     -7,      2,      0,      1,      0,      0,
-     -1338,     18,   2862,    223,    250,    260,    144,    259,
-       -38,   -647,    602,   -160,     75,     -5,     -8,     34,
-       237,     50,      2,      0,      1,     -1,     -1,      0,
-      -412,   2153,    933,    478,    768,    186,   -424,   -657,
-     -3458,   -443,    294,    224,   -468,    -58,   -120,  -1565,
-       211,   -420,      0,      0,      1,     -1,      0,      0,
-       198,    227,   -112,    350,    297,   -303,    108,   -192,
-       153,     32,  -2717,   -111,  -1093,   -200,    476,    326,
-      -271,    627,      0,     -4,      0,      0,      0,     -1,
-       462,   -616,    126,    316,  -2413,    204,   -350,  -3549,
-      -263,   -386,   -112,    483,  -1339,    636,     70,   -531,
-        96,     38,      8,     -1,      0,     -3,      0,      0,
-      -310,  -1128,    616,   -339,   -168,   -124,   -905,   -151,
-      -383,     76,    137,    -44,   3689,   -388,    184,   1799,
-      -102,   -930,      6,     -1,     -1,     -1,      0,      0,
-      -284,    280,     39,   -728,    143,     15,    181,    798,
-       382,     10,   2267,    -12,  -3582,    -27,    357,    514,
-      -565,   -121,      0,     -1,      0,     -9,     -1,      0,
-       429,    -16,   2993,  -2903,     47,   -136,     30,    792,
-      -327,   -347,    -69,    -50,    -93,   -223,   -438,    158,
-       203,   -475,      0,     -4,     -1,      2,      0,      0,
-     -3465,    415,   -963,    252,    397,   -945,   -448,   -231,
-      -130,    673,    504,     55,   -355,    221,     29,    167,
-       -19,    134,     -1,     -1,     -4,      0,    -14,     -2,
-        44,    433,   -535,   -216,   2485,     33,     19,   -100,
-      -185,   -171,     91,    336,   -208,    140,     -3,     46,
-       -67,   -116,     32,      0,      5,      3,      0,      0,
-       220,     91,    -65,    -15,   -169,    217,   -183,   -169,
-       -47,    181,   -272,    138,   -166,    110,     -9,     41,
-     -6957,     33,     -5,     -2,      1,      1,      0,     -1,
-       164,  -4062,   -109,    230,   -220,   1748,  -1338,   -246,
-      -242,    -98,    300,    217,   -202,   -130,    157,     -3,
-       -19,   -453,      0,      2,      0,      0,      0,      0,
-};
-
-static const int16_t cb0806sl1[] = {
-        75,     87,    -31,    607,   -132,   5963,   -262,    494,
-       134,     -4,    141,     19,    225,    229,    239,     93,
-       -20,   -189,      2,      0,     -3,     -1,     -1,      0,
-       214,   -206,    877,     83,   -588,     83,    132,     78,
-         5,    -85,     66,    -24,     47,    -11,     25,     26,
-        -3,     46,      2,     -5,      0,      1,     -1,      0,
-      -113,    295,    -81,     74,    223,    -50,    -93,  -5671,
-       -28,    115,    256,   -228,    -31,   -539,    300,   -278,
-       -59,    426,   -110,     -1,      1,      1,      0,      0,
-       -95,   -116,    266,    176,    761,     -3,     90,    -91,
-        98,   -209,   -414,    -27,    -56,     26,    -76,      6,
-       -32,   4634,      1,      0,     -4,      0,      0,      0,
-       177,    147,   -236,    -93,  -7925,     11,   -111,    -74,
-        36,    176,    352,     88,    112,     16,    144,   -110,
-        91,    329,     -1,      2,      0,      1,      0,      1,
-       119,    304,    -94,   -422,    113,    129,    -70,    155,
-       247,   -116,   -139,    327,   -355,     77,    143,  -5362,
-        27,   -377,     -1,      7,      2,      1,      0,      0,
-       179,    127,   1500,   -324,    -15,    673,    184,  -1382,
-       167,   1833,  -3058,    200,  -1203,    459,  -1905,   1020,
-      -259,   -120,     10,     -4,      0,      1,      0,      0,
-       995,   -112,     37,   -160,    -21,  -4011,    172,    228,
-      -210,     80,   -131,      1,     20,   -128,   -252,   -288,
-      -132,    337,     -1,      0,     -1,      0,      1,     -1,
-       -60,     61,    197,   -185,    -40,  -2951,   -592,    -57,
-       210,  -3248,   -226,    -44,    391,   -167,     -7,    219,
-       -15,    172,      0,     -1,      1,      0,      0,      0,
-       106,    -70,   -291,    192,     45,    162,     37,    143,
-        91,     21,  -7032,     12,   -173,    -30,      1,    259,
-      -286,    387,    -36,      0,      0,      0,      0,      0,
-     -1593,   -210,     83,     47,    194,     61,     85,   -182,
-       -23,     40,    -74,     22,     12,    216,     59,   -165,
-      -163,   -159,     -8,      0,      0,      2,      0,      0,
-        -3,    182,    -80,   2068,    702,    115,   -164,    -85,
-        21,   -124,   -191,   -113,    263,    138,   4235,     37,
-       204,   -436,      0,     24,      1,     -1,      0,      0,
-       147,     83,   -177,   -168,   -609,     -9,    -16,    -46,
-       127,    120,    -25,   3435,     51,     31,     49,    366,
-        31,   -129,      1,    -32,      0,     -1,      0,     -2,
-       295,    158,    116,     11,   -280,    471,    169,     29,
-     -2589,    338,     32,    299,    172,   -187,    -32,    437,
-       -38,    359,     -1,     -1,      1,      0,      0,      0,
-       243,    413,    -29,  -4774,    187,     12,   -117,    168,
-      -114,   -208,    -55,      5,      0,    -31,    436,    545,
-       -45,    272,      0,     -4,      0,      0,      1,      0,
-       127,     38,   6620,    -33,   -103,     34,     84,    -35,
-        30,   -131,     -8,    -79,   -126,    -98,     17,    -75,
-       -31,   -176,     14,     -1,      0,      0,     -1,     -1,
-       273,   -219,    176,    -83,    187,    -36,      1,   2639,
-       158,   3812,    127,   -233,    175,    310,    148,    387,
-       -14,    308,      0,     -3,      0,      0,      0,      0,
-      3321,   -447,    153,   -128,    254,   -275,     79,   -181,
-        17,    146,     61,     46,    -48,    253,     51,    -17,
-         1,      1,      0,      1,     -1,     -2,      0,    -13,
-       791,   -130,     40,     78,    -64,   -179,     42,   -455,
-       422,    112,    -19,  -4499,   -113,   -341,     52,     69,
-        67,    254,     -6,     -1,      4,      0,      0,      1,
-       -98,   -976,     68,   1563,    228,   1018,    458,  -1020,
-       411,    249,   -627,   2321,    738,   -460,  -1469,    362,
-       884,   -261,      0,     -1,      1,      1,      0,      0,
-      -601,    378,    -71,     61,   -160,    800,   -386,   -773,
-       303,    -53,    248,    -22,     59,  -3809,    -61,    102,
-       -45,    395,      0,      0,     28,      0,    -12,      0,
-       717,   -424,    499,    296,    -15,     11,   2732,   -103,
-      -119,   -116,    107,    -50,    462,     73,    -82,     75,
-        41,    131,      0,      3,      1,     -1,      0,      0,
-      -134,    109,     48,  -1847,   -205,     -6,     20,   -203,
-       136,    197,    113,    -77,   -124,    -50,    184,    225,
-      -175,   -295,     -1,     -1,     -6,     -1,     -1,      0,
-       -59,  -2017,   -193,   -237,    226,    630,   1950,     -2,
-       179,  -3666,    -34,    140,     88,    157,     51,     81,
-      -263,   -169,      1,      0,      0,      0,      0,      0,
-       229,    -14,  -1590,   -123,    162,     63,   -224,   -332,
-       119,   2931,     21,    -48,    406,     15,    320,    -51,
-        64,   -228,     -9,     -1,      0,     -1,      0,      0,
-      -453,     84,   -320,   -654,     -4,    -91,    -61,    558,
-       -61,   -233,     31,   -224,   -105,     63,     86,   3771,
-       162,  -1535,      3,     -3,      1,      1,      0,      1,
-     -1992,   -279,    -59,  -3048,  -1696,    102,   -168,    194,
-       172,   -142,     55,    134,    116,   -146,    -29,   -287,
-       102,    265,     -3,      1,      0,      1,      0,      0,
-       -96,     46,    -16,   2474,    -58,   -712,    -25,   -294,
-       187,     22,    -39,   -102,     62,   2666,   -237,     -1,
-        32,    -41,      0,      0,      0,      0,      0,      0,
-      -282,    -25,   -198,   -862,   -127,   -379,   -210,    -20,
-        45,    -79,  -2805,   -364,    575,    106,    215,   -410,
-       -76,    511,     15,    -44,     -1,      1,      0,      0,
-       329,    224,    130,     43,     -1,   -255,    -51,   -297,
-      4529,     52,    186,    757,    -68,    -89,     46,    250,
-        46,    -79,      5,      1,      0,      1,      0,    -19,
-        79,     74,     65,    256,    260,    492,   -106,   -217,
-      -357,     20,    166,    233,    132,    165,     18,     -1,
-      4445,    -22,      5,      3,     -7,      0,      0,     -6,
-      -922,   2156,    269,   1385,    235,   -206,    -94,    130,
-       112,    145,   -126,    166,      1,     45,     83,     36,
-      -153,   -255,      0,     -1,      0,      0,      1,      0,
-       241,   -237,   -117,   -510,     85,      7,  -4418,     30,
-        94,    -92,     99,    -71,    140,   -265,    149,     69,
-       286,    104,      0,     -2,      1,      0,      0,      0,
-      -165,     22,   -245,     29,     50,    145,    -53,   1641,
-       -40,   -128,   -112,   -190,     47,     53,   -247,    -50,
-        88,     39,      1,     -1,      0,      0,      0,      0,
-      -288,    130,     88,   -132,   4055,     -7,     55,   -105,
-       277,     81,     69,    -66,    -53,     52,    -56,     90,
-       160,    386,      1,     -4,      0,     -2,      0,      0,
-       107,    124,    -39,     40,     25,     -6,   -248,    -81,
-        70,    -13,     46,      5,     20,     24,     -5,     -2,
-       -41,    -34,      1,      1,     -8,      0,     -4,      0,
-       -61,      1,    457,    454,    768,     89,    640,     61,
-        66,   -360,  -2727,   -155,   -370,    -44,   -292,    570,
-        34,  -3209,     -5,     -1,      1,      0,     -1,      0,
-        22,    -82,    -20,   -125,    -91,     98,   7843,     25,
-        -2,    -31,      2,    -52,    -73,    -25,     31,    -35,
-        -6,   -114,      1,     -1,      2,      0,      0,      0,
-       217,  -5202,     86,    -76,    -76,    109,    389,    -95,
-      -253,    124,    130,     58,    190,    -44,    -67,   -142,
-        54,      6,     -1,      1,      1,      1,      0,      0,
-      -183,    547,   -200,    348,    372,    437,    425,    547,
-      -457,    388,     87,     38,   -522,   -210,   -556,     41,
-     -2979,    -17,      7,     -4,      6,      0,      0,      0,
-       189,    196,    240,    -75,     46,    -50,    101,   -160,
-       -16,   -223,     92,     71,  -7633,     78,     90,     69,
-       190,    -75,      2,      1,     -2,     -1,      0,      1,
-       205,   -433,   -267,   -175,   3068,   -210,   -514,    330,
-     -3099,   -273,    155,    132,   -306,    361,    316,    -53,
-      -421,   -125,     -3,      0,    -11,      0,      0,      0,
-       179,    -38,    151,    -36,    215,   -102,   -145,    139,
-        50,    200,    383,     37,   3102,    -27,      9,   -157,
-       -68,    367,      1,      1,      0,      0,      1,      0,
-       -50,    177,    -24,     24,    119,      4,     76,     99,
-      -111,  -7367,     26,     51,    -11,   -146,   -125,    -48,
-        54,     50,      1,      0,      0,      0,     -1,      0,
-       -71,    -16,   -184,    -61,    -36,   -151,     79,   -128,
-      -102,    135,   -228,    190,    -79,    -10,   -176,   -113,
-      1008,   -856,    -13,     -4,      8,     28,      0,      1,
-     -4909,    -93,   -167,   -141,     51,   -203,     71,   -199,
-       -49,    106,   -142,    -94,    126,   -225,    158,     36,
-       269,    159,      0,      1,      1,      0,      0,     -5,
-       -61,    -79,    -20,    306,     67,   -621,   1774,    346,
-      -442,    125,    305,   -170,     55,  -2537,   -103,    118,
-        87,    505,     16,     -7,     -2,      0,     20,      0,
-        35,   -154,   -158,    224,    -36,   -344,     79,   4232,
-       234,   -219,    -71,    204,   -484,   -131,   1153,     23,
-       111,    499,      5,      0,    -17,      0,      0,      1,
-      1135,  -3469,   -489,   2572,   -450,   -432,   -358,    -34,
-       -78,    -10,   -775,     17,   -131,   -154,    218,     82,
-      -312,    279,      1,      0,      1,      0,      0,      0,
-        96,    230,     18,     47,     -5,   -102,    646,   -122,
-        35,    -81,    183,    171,  -1479,    201,     84,    -24,
-       143,    302,      1,      5,      0,      0,      0,      0,
-       -34,    -48,     89,   7789,    -85,    -27,    -56,     46,
-        39,     30,     98,    -40,    138,   -147,    104,    -35,
-       -41,   -151,      1,      9,      1,      0,      0,      0,
-      -140,  -1970,   -170,    273,    226,     33,   -324,    -38,
-        11,    188,    603,    188,   -183,     98,    -58,    -67,
-       -63,      7,      0,      0,      0,      0,      1,      0,
-       384,    899,    493,    765,  -1062,    646,    275,  -2699,
-        93,    796,    120,    -25,    177,    -85,    721,   -189,
-      -295,   -436,      0,     -1,      0,      0,     -1,      0,
-      -358,    117,  -2435,    325,  -3137,   -158,     23,     97,
-         6,    204,    288,   -426,    156,     22,   -101,    171,
-       -56,    235,      0,     -1,      0,     -1,      0,      0,
-       656,   3878,   -286,   -383,     75,    -50,    114,   -377,
-      -105,    106,    154,    -30,   -204,   -105,    171,    -56,
-       230,   -587,      0,      1,      0,      8,      1,     -1,
-       -58,    177,     -7,     45,   -159,    405,     45,     84,
-      -206,     77,    277,   -259,    121,   3719,    140,     79,
-      -202,    843,     -8,      0,     -1,      1,     -2,      0,
-      -248,    560,   2651,    -49,   -625,   -147,  -2416,    119,
-       -70,     87,    137,     18,   -401,   -147,   -598,   -150,
-       239,  -1004,      7,      3,     13,      1,      1,      1,
-       276,    342,     97,    600,    230,     95,    213,    159,
-      -259,    -25,   -176,   3360,   -283,   -325,    -37,  -2626,
-      -151,    178,     -1,    -18,      0,      0,      0,      0,
-      -233,    237,    -78,    290,   -284,    141,    -20,    146,
-        58,    -21,     73,    -35,   -101,    -23,  -4068,   -116,
-        49,   -196,     -5,     -2,      0,      1,     -1,      0,
-      -292,   -195,     51,   -714,    172,     44,   -119,    134,
-       168,    107,    -74,  -2379,    308,    173,   -252,  -3470,
-      -135,    641,    -10,      0,      0,      1,      0,      0,
-       146,   2060,    -84,   -164,   -247,     26,  -1724,    216,
-       226,  -2499,    312,    -66,    850,     41,     -1,     20,
-     -1339,    411,      0,      0,     -1,    -12,      0,      0,
-       921,     17,  -3510,   -119,    325,     34,    -97,   -205,
-         3,   -188,    252,     91,      0,   -135,    -76,    208,
-       199,   -202,     -1,      1,      1,      2,      0,     -1,
-       -88,   -461,    319,   -963,    266,   1540,    643,  -3424,
-        76,  -1058,    501,    342,    297,    268,   -158,   -103,
-        26,    -30,      0,     -1,     -1,      0,      0,      0,
-       211,    245,    183,   1579,    106,     26,  -3450,    -22,
-     -1053,   -266,   -736,    113,    475,   -241,    117,    -85,
-      -492,    372,      0,      1,      1,      0,      0,      0,
-};
-
-static const int16_t cb0806ss0[] = {
-      -381,  -1638,  -8192,      5,    983,  -1481,    -20,   -719,
-      -238,    767,    571,   -200,    754,    460,   1678,   1376,
-      -155,  -1998,    294,   -455,     80,      2,     26,      3,
-        10,     25,   -931,  -1098,  -1166,  -3221,  -1995,    702,
-       104,  -2429,  -2270,   1372,   2326,    -37,  -1492,   1692,
-       644,  -1283,    363,    624,   -483,    -15,    346,     -6,
-         2,      0,      1,      3,      2,  -2429,  -8192,   -956,
-      1190,    706,   -955,    367,    959,   -194,   -723,  -1104,
-       375,    554,   -962,   -229,     66,    368,     18,   -150,
-        56,    968,    -15,      0,     -1,     -5,      0,      9,
-      -250,   -720,   1910,    827,    198,   -645,   2021,     32,
-     -1972,   -705,    441,    373,    800,  -2293,   1747,   1504,
-      -537,  -1731,  -1192,   1597,  -4031,     24,      0,     -2,
-         1,      1,      1,   -131,   1594,   -153,   1127,   2732,
-       469,   -558,    -11,   1190,    115,   -933,   1988,   1841,
-     -4530,   1385,    571,   2399,   1709,    -63,  -3663,  -2681,
-        57,     -4,     11,     -4,      0,     -3,    426,  -4257,
-      2755,    -76,  -1667,   2450,   -373,   3375,    -91,   -232,
-       511,    648,    886,   1182,   1667,     65,  -3029,   -579,
-       865,   2186,   2911,    537,      0,      2,     -3,      0,
-         7,    585,   8192,  -2855,   8192,   5527,  -5491,  -1926,
-     -4231,  -1204,   1953,  -1193,    191,   3278,  -1726,    259,
-     -2794,   4205,   4315,  -6121,   -606,  -1922,   3666,   -324,
-      -238,   -313,   -720,  -1447,   -539,   -794,   3151,  -1726,
-      3444,    876,    584,   -671,   -497,    407,    909,  -2183,
-      2575,    246,   -673,    270,    824,   1784,   -201,   7329,
-       589,    -70,     -1,      4,     -5,     -3,     -8,   -417,
-       382,   2786,   -972,    520,   1154,    886,    521,   6032,
-      -687,   3791,   -522,  -1226,    608,    428,    891,  -1524,
-     -1015,   1147,   1278,    559,     -6,      3,      0,      6,
-         2,     -3,    115,   3586,  -2847,     95,    460,   2832,
-      2326,  -1665,   1720,    453,    965,   1154,    452,  -1721,
-     -1375,   -269,   2138,  -2032,     55,   -674,   -870,   -124,
-         0,      5,      0,     -5,     -3,   -283,   1077,   2604,
-      1270,  -1082,  -1753,   6840,  -2502,    988,  -1790,   1378,
-      1231,    438,  -1188,    286,    540,   -138,   1054,   -111,
-     -2321,     74,     56,     -3,     -2,      0,    -32,      5,
-      1539,  -1399,   7413,   -903,  -1698,   1781,   -255,   -466,
-     -1436,   3419,   1916,    852,    590,  -1126,  -1617,  -1309,
-     -5560,   -241,   3363,  -1225,   2682,    620,     -6,     58,
-         2,   -186,    -17,  -2959,    619,   2228,  -2627,  -3119,
-       730,   3716,   -538,   -101,  -1863,   -516,    142,  -2384,
-     -1514,  -5506,   -825,    514,    714,    746,  -2790,    569,
-      -425,      4,    -68,     70,     24,     12,    817,   -276,
-     -3363,  -2942,    103,   -581,   -925,    651,    561,     43,
-       434,    712,   -541,  -2042,  -1291,   -453,   -443,  -4312,
-     -1344,   1277,    605,     -4,      0,     -1,     -1,      1,
-         2,   -930,    276,   3219,   -404,   -944,   -497,    840,
-       278,    -98,  -1432,  -1136,  -1975,  -1863,  -1102,  -1446,
-       938,    693,  -5186,     -1,   1085,  -2275,      1,      1,
-        -1,     -1,     -2,      3,  -1194,   -312,  -1257,   1973,
-      1570,  -1703,  -1637,    639,   -855,   1925,    970,    604,
-      1313,    780,  -5170,   -603,    220,   -731,   2952,   -872,
-       166,     30,      0,     -2,     -1,      3,     -1,   -743,
-       504,   1363,   1436,   1632,   -634,   -709,  -2346,     87,
-      1149,   3468,   2132,   3028,  -1039,    -92,   2087,   -990,
-      -301,    966,   -773,  -1057,     42,      0,     -2,      0,
-         2,      2,    252,    217,   3625,  -2323,    212,   -381,
-     -1121,   1664,   -307,   1680,   2193,  -1854,   -187,  -3100,
-       254,   -673,    595,   1995,    669,   -687,   -509,     13,
-         0,      8,     -3,     11,     -3,   -552,    -87,      6,
-      2933,   -267,  -1392,     40,    644,     32,   2966,  -1386,
-     -2480,   -956,   1160,   1399,   1049,   3902,  -2092,   -525,
-      1724,     69,    -33,      0,     -2,      0,      2,      2,
-      -452,  -4739,  -3237,   -510,   -598,  -1397,    855,   1573,
-      2143,    -79,  -1546,    -17,   -973,  -2400,   1689,    133,
-     -1213,    784,    726,    916,   -388,   -390,      1,     -1,
-        -3,     -1,      0,    170,   -205,  -2905,   8192,   -465,
-      3119,   4407,   -709,   -403,    859,   -373,  -1301,  -1397,
-      -750,    -88,    277,  -2097,   -222,   -134,    -88,  -1189,
-       974,    -56,    -57,    -83,    -21,    102,    626,   -114,
-     -2304,    979,  -1836,   -868,   1261,   2226,   -261,    579,
-       983,    655,  -2578,   1803,    117,  -1128,    365,   3971,
-      3539,    -21,   -790,    -62,      2,      3,     23,     -3,
-        31,   1273,   3212,  -1617,   4116,   -281,    725,   -284,
-      1079,    293,  -3759,   2581,  -1617,   -259,    -19,  -1999,
-      3040,  -3077,  -1522,   1056,    -92,    897,    243,     -1,
-        36,    -19,    -10,    -46,    231,   1129,    363,  -1978,
-      -882,  -1788,    319,   4807,  -1707,  -1379,  -1465,   2327,
-      -827,   -681,    410,  -1816,  -2507,   1036,    740,    730,
-      -687,    100,     -1,     -1,     -1,      1,     -4,   -276,
-       303,  -2331,  -2912,  -1864,  -3694,    412,  -1218,   1642,
-      4448,    658,   -213,    872,   2867,    227,    868,   -590,
-      2293,   1759,  -1666,  -1585,   -140,      1,     -3,     -1,
-        26,    -10,   -287,    898,  -2442,   3997,  -1655,  -1341,
-       -56,    689,  -1869,    572,  -2044,    616,  -2603,   -278,
-      2987,   2397,  -2055,    247,    128,    598,   1732,   -146,
-         0,      3,     -1,     -3,      5,    842,    597,    779,
-     -1529,   -802,   2142,  -1668,   2339,  -3550,  -2651,   1733,
-     -1531,    -46,    600,    618,   -867,   -665,   1524,    392,
-     -1386,  -3279,     45,      0,      9,     -7,     -3,     -8,
-      -224,  -2632,   -147,   -505,   2223,   1773,   1799,  -1696,
-       194,  -1186,   -543,    775,  -1171,   5491,  -2319,  -3193,
-      -313,   -355,   -133,  -1097,    125,    -22,     -2,      2,
-         1,     -3,    -10,   -354,  -1447,   -662,   -313,  -4302,
-      3888,   -121,   -323,   1112,   -801,  -1513,   -814,  -1646,
-      -616,  -1207,    347,    483,    670,    900,    -35,   -885,
-        14,      1,      0,      1,     -2,      7,   -432,   -486,
-     -1539,    785,   4853,    904,    925,    895,  -1223,  -2464,
-      3395,   -506,   -808,    207,    197,    874,   -928,   1347,
-      -107,   1512,   1063,   -182,      1,     -4,     -1,     -6,
-         3,  -1236,  -1047,    774,     26,   -630,    863,   1055,
-     -2632,  -1187,   -534,   -619,  -1079,  -2574,  -2037,    658,
-      1229,   -262,   2702,  -3393,  -2187,   1764,     66,      0,
-         7,      0,      7,     -3,    677,   -444,  -2111,  -5256,
-     -4485,  -1667,   2077,   1613,   1483,  -1520,   1600,   1767,
-      1148,   2054,   1676,   1866,    783,  -2199,    765,    568,
-      2779,   -683,      4,     17,      0,    -32,     15,     45,
-       228,  -2445,    752,   2510,  -1657,  -1039,    113,   1107,
-     -1054,  -1765,  -1245,  -2527,    589,    455,    328,    640,
-      -579,   2370,   1313,   -540,     31,      1,     -1,     -4,
-         2,     -3,   -235,   -560,    455,   3809,    102,    403,
-       -21,   1844,    402,    148,    -32,   5573,  -3765,   -265,
-      -718,   -399,   -349,    366,  -1105,     91,   1881,     34,
-         1,      1,      5,      0,      9,    289,  -1146,    795,
-     -2504,    412,   1156,   -302,   -946,   2063,  -2569,   -273,
-     -1434,    141,    642,   -631,   4856,  -1008,    169,    -40,
-       191,  -2293,    -86,      6,      1,     -2,      0,      1,
-       139,   1955,  -1111,   -944,    140,  -1074,   1071,  -1312,
-      -541,    664,   1801,   -892,   1605,  -1750,   -654,   -680,
-     -8102,    120,    -24,   1014,   -351,   -120,      0,     -2,
-         1,     -1,     -1,   1038,   5199,    779,  -1195,    128,
-       462,    184,   3705,  -1292,  -2247,  -2481,   2610,   4396,
-      4161,   4039,   1111,    838,    188,   -571,   2811,  -1915,
-     -1909,     13,     99,    -20,     -2,     11,    395,    155,
-      2667,   -202,  -2639,   1303,   -912,  -1734,   1097,   -583,
-      3532,   -218,  -1514,  -3881,    378,    -46,  -1189,   -957,
-     -3010,   -743,   -648,     15,      1,      3,      3,      4,
-        -4,    330,    198,   -275,   -677,  -8192,   -629,   1953,
-      -783,    592,    926,   1487,    -39,  -1002,   1134,   1560,
-       -27,   -118,  -1363,   -360,   2163,    442,     92,      1,
-         1,     -2,      5,      1,   -670,    326,   2773,   1346,
-       -26,    327,    184,  -1091,   -121,    576,  -1324,    212,
-      -645,    860,  -2111,   -493,  -2119,    316,   -688,    475,
-      -652,    -33,      0,      1,      2,      0,     -3,     92,
-       170,   6224,   2162,    761,  -1994,   2176,   1692,  -1773,
-       561,   -966,   3406,    -20,   -593,    574,   -681,   1121,
-      -335,   -412,  -2651,  -4712,    -79,      1,      2,     -1,
-         4,     -6,    932,  -2579,    344,  -2614,   1119,   6623,
-      -314,  -1068,    338,   1977,  -1375,  -1338,  -1996,   1310,
-       118,   -500,   -393,    622,  -1798,  -1232,      3,    -75,
-         0,     17,      0,     -2,     -9,    715,   8135,    400,
-      3748,   2156,   1882,    772,   2728,   -403,   -775,   2110,
-      1603,   -766,  -2592,    767,   -618,   4727,    668,   2280,
-     -1157,   1246,   -794,    -14,     -2,      2,      5,     16,
-      -107,    642,  -1806,   -158,  -2447,    309,   -764,   2313,
-      -101,   -766,    209,   -691,   2001,    268,   -273,    615,
-       803,   6062,   -434,   1287,   -543,     -3,      0,      0,
-         1,      1,      0,    503,   -598,  -2043,  -1160,   1074,
-      1255,   3269,   1405,   1182,    197,   3098,   -138,   2326,
-      -244,   -772,    901,   -225,    337,    -65,   -536,   -331,
-        15,      2,     13,      8,     -3,     20,    -32,    -52,
-     -1012,    232,   1502,    -17,  -1574,   -741,    -57,    164,
-       -22,     74,   -181,   1616,    296,  -1483,   1387,   -357,
-     -5380,   -322,  -1346,      6,     -3,      2,     -3,      1,
-         0,   -392,   -811,   -650,   -485,   3038,   2750,   -776,
-      -503,  -1664,   -323,    253,   -280,  -3459,  -1313,    541,
-      2182,   1287,   -782,   1785,   -695,    -49,     72,     -4,
-         0,    -15,      3,    -21,   -211,   1382,   -149,    684,
-      2210,   2654,  -1440,  -1209,    152,   1080,  -3078,   -694,
-      4738,    985,  -1337,    819,   -518,   1799,   -671,   3201,
-      2636,      7,      1,     -6,     14,    -31,      0,    -34,
-      4296,    -23,    194,   1976,   -993,   1353,    709,   -342,
-     -1142,   -140,   -271,   2291,   -709,   1734,    818,  -3571,
-      1125,    912,   -590,    784,   -275,     -2,     -1,     -5,
-        -1,      0,   -381,   2754,   1545,  -2270,   3608,   2308,
-     -1899,    178,    391,   1826,   -127,  -1417,   -822,   -712,
-      1682,   2225,   2247,    446,    994,     56,    734,    196,
-         7,      3,      8,      0,      7,    639,    833,  -3313,
-       675,   -263,   -648,   3016,   -701,    235,  -1304,   -582,
-     -2930,   -210,  -1243,    374,  -3095,  -2013,    354,    599,
-     -1469,    140,    -17,     -1,     -3,      2,      0,     -2,
-      -183,    399,   -603,    796,  -1424,   2685,  -3929,    416,
-     -2291,   1737,   1906,   1667,    810,   -222,   3242,  -3636,
-      5196,  -1542,    940,   -124,   2047,    -67,     -4,      6,
-        -1,     13,      2,   -161,    417,   4132,    492,  -1068,
-      -817,   2732,   -250,  -1457,   1723,   2104,   1121,  -1276,
-      1147,    990,   -523,  -1533,    297,   1219,   3901,  -2549,
-       -22,      0,      0,      0,      0,      2,  -1632,    172,
-       829,   -747,  -1229,  -1990,  -1070,   1134,   1623,    228,
-      3689,    625,   -757,   8192,    -82,    738,    213,   1900,
-     -1200,     91,    892,    -45,     15,     -1,      5,     -4,
-         5,    392,  -3067,  -1903,    139,    661,     43,   2174,
-     -1919,   -270,  -1490,   -569,      2,     85,  -1091,   6740,
-       886,     85,  -1052,   -647,   -563,  -2971,   -145,     -1,
-        39,     -5,     -6,     -7,  -1023,  -1104,  -1774,  -3154,
-     -1058,   3488,  -2551,   3547,   -253,   -204,   -235,  -1544,
-       -73,   -584,   -302,  -3118,  -2314,   -308,   1790,    916,
-       152,   -155,    -11,      6,    -26,     -1,    -31,     21,
-       919,  -1856,   -456,  -1050,    663,   1454,  -1515,  -2606,
-     -4287,   1553,   3564,   1334,   1797,   1540,   -392,   -701,
-      -971,  -3442,    281,   -271,    133,      1,      5,      4,
-        32,      3,   -521,  -1530,  -1368,   1787,   -515,   -913,
-     -2391,     93,   2690,   -578,   -576,  -1656,    554,    649,
-     -1509,   -258,   -605,   1233,  -2258,    640,    837,    -43,
-         1,     -3,      0,      5,      3,    148,  -4761,   1783,
-      3244,   -277,  -1139,   1539,  -2016,   1898,  -1276,   -776,
-     -1725,  -1900,    -51,    559,    311,   1737,   -928,   3687,
-     -1087,   1329,    134,      2,     -2,     -7,      9,      5,
-       -77,  -1116,   4986,   -940,   -905,  -3229,   -773,   3335,
-       -23,    578,  -2376,    386,    122,   1253,    363,  -2748,
-      -512,  -4612,   1690,    848,  -1116,    195,      5,      2,
-        11,      1,     18,    659,  -1282,    562,   1170,   4701,
-       903,    490,  -3508,   3468,    -39,    654,  -1196,   -909,
-      -268,    980,    283,   3221,    348,   1121,   -897,  -1011,
-      -103,    -11,     -2,     -9,     16,     -8,   -274,  -4100,
-     -2312,  -2379,    617,   1629,   2154,   3026,  -1737,   -603,
-      -803,   -366,    977,   1035,  -1835,   -255,   -275,  -1245,
-      1274,   -161,  -4476,   -181,     -4,      0,     -2,      1,
-         2,    156,    551,   -832,   -630,   3740,  -2115,    344,
-       229,   1295,     65,    290,  -1462,  -1794,   3297,  -1049,
-      2451,    322,  -2642,  -2810,  -1246,    613,     90,     -1,
-        -1,      0,      0,      0,   -277,    854,   1259,   1542,
-      -433,   3601,   -453,   1091,   -113,   1438,    994,  -2746,
-      -786,    867,   1422,   1093,  -1723,  -1167,  -1389,  -1062,
-      -436,    -81,      2,      1,     11,      1,     26,   -197,
-};
-
-static const int16_t cb0806ss1[] = {
-      1760,  -4335,   6384,  -2036,   2874,  -2504,  -1529,    102,
-      6995,  -1267,  -3141,   1050,    -59,   1556,  -1002,   1536,
-      1024,   1867,     40,  -1156,  -2627,   -213,  -1034,   -660,
-       291,   -963,   -323,    462,   -804,   2219,   -859,   1709,
-       550,  -3390,    319,     24,    644,   3154,   4503,  -1961,
-       744,    194,   -151,  -1255,  -1318,   3033,   -899,    -18,
-         1,      0,      2,      0,     28,  -1213,  -3725,  -2525,
-      -177,  -1164,    361,   -357,   -649,   -459,   1324,   2463,
-     -3108,  -3323,   -575,  -2744,   -108,   -121,   -508,   -564,
-      -849,   -773,   -288,      0,      8,      0,     -2,      5,
-       691,   -602,   2269,   2373,  -2027,    786,   3011,   3234,
-     -1387,   -310,    659,   -358,   1058,  -1554,   1031,    795,
-      2254,   -549,    334,    325,    599,    -36,     -1,     -1,
-        -2,      3,      4,   -450,   -533,  -1657,  -1928,  -1034,
-      -636,  -1446,   -320,   2695,   1184,    697,   1126,   1159,
-      2970,    449,    -30,  -2058,  -1171,   -684,    -66,    905,
-       -43,      1,      0,      3,      0,      3,    228,    272,
-       -79,   -718,   1978,    667,  -2760,   1507,  -1893,   -796,
-      1164,     35,  -4440,  -4492,  -1667,   4189,   6485,   -495,
-      1721,  -1639,   -526,    458,      0,    385,   -183,    511,
-      -153,  -2025,   -376,   2948,  -2606,   -910,   -741,   -427,
-     -1080,   2128,    565,   -483,   1791,  -2222,    -45,  -1204,
-       799,    512,  -4790,   1462,    511,  -1906,     15,      0,
-         0,      1,      3,      8,   -867,   -685,   -140,   5299,
-       376,   -891,   1657,   1843,  -1465,  -1297,    518,  -4640,
-       303,   -277,   -650,    -97,   2308,   -679,    720,   -171,
-      -475,   -269,      0,     -5,      4,     -1,      9,  -1155,
-     -4954,   1684,  -2045,    939,    819,   -751,   -165,    -93,
-     -2327,    306,    965,   4999,    557,    -55,   -999,     30,
-       -36,    989,  -1680,  -1594,    318,     -3,     -8,     -4,
-         1,     -9,   -402,   8192,    475,   2080,   -418,  -1739,
-      -273,    -55,   -441,    794,    -79,    272,  -2039,    789,
-      2266,    874,   2495,    627,   2203,   1212,  -1052,    389,
-        14,    -24,    -59,     10,    133,   -535,  -1160,  -1139,
-      -146,    180,   1064,   3718,  -1412,   1153,   1873,   -549,
-     -1698,  -1479,    209,    725,   -940,   2152,   1848,    678,
-      2493,   4608,    -11,      0,     -1,     -3,     -3,      2,
-       334,    681,    673,  -8192,   3958,  -3111,   1641,   1500,
-      1184,   -268,  -3147,    571,    958,   -663,  -1031,   -870,
-      -674,  -1098,   -529,     78,   1212,    120,     -8,    -13,
-        -5,    -42,    -37,   -498,   1304,  -2541,   1730,   -355,
-      1462,   2315,   2017,   -403,  -2010,    555,   1391,    887,
-      2039,    366,    135,     85,    371,   1291,   -225,    335,
-       -45,      0,      1,      2,     -1,      2,  -1095,   -261,
-      3249,   3212,  -1877,    934,  -1671,  -1289,   1398,  -2287,
-      -205,   1659,    642,   1105,    751,   2864,   1171,  -1001,
-       318,   -290,     60,    -54,      5,      3,      5,      2,
-         1,   -105,    590,     36,   -194,   1832,   -639,    777,
-      3243,    578,   2820,    428,   2020,    623,  -2104,    -52,
-      -331,  -1015,   3064,   -347,   -303,  -1100,     61,     -1,
-        -1,      0,      2,     -1,    592,    127,    887,  -1094,
-     -2819,   2573,  -2670,  -1693,  -2775,     48,   -266,   -961,
-      1220,   -472,    167,   3201,   1118,   -173,   1304,    -26,
-      -899,     76,      0,      3,      0,      1,     -1,   -718,
-      -746,    947,   -524,    142,    958,  -1609,   -777,  -1362,
-       385,   -578,  -6947,    157,   -290,   1357,  -1703,    484,
-       117,  -2224,  -3736,   -838,    -96,     -1,     11,      5,
-         4,      2,    475,   -426,    500,   -767,  -2304,   1248,
-      2200,  -1829,   -992,   -225,   -573,  -1107,   -832,   2555,
-     -2866,   3453,   4335,    -88,  -1160,  -1666,    -94,    -33,
-         0,      0,      1,     -2,     -7,   -147,  -8192,   1204,
-     -1181,   -702,   -604,   -770,   1032,   -173,    770,    861,
-       611,   -509,    802,   -467,    839,    491,   -785,    523,
-      -669,     73,    -34,      0,      0,     -2,     -3,     -3,
-       286,  -2183,  -1238,   1743,    387,  -2228,  -1404,  -3439,
-     -1701,  -2371,   -451,   2294,   2061,   3062,  -1122,  -1489,
-     -1274,     51,   5649,   -170,   2197,    365,     -1,    -13,
-         4,      3,     -5,    -15,  -4099,    789,   4132,   4982,
-     -1996,    784,    748,   2123,   3535,  -1493,  -1454,   -344,
-      -867,     40,    831,  -1198,     66,    542,   1633,  -2402,
-       117,   -119,    -18,     49,     18,     40,   -500,    808,
-      -726,   1192,   3623,   1526,   -484,   1080,  -2502,   -579,
-      1315,  -1887,     84,   1771,  -2902,   1387,  -1098,   1559,
-     -1126,    652,   -896,     32,     -1,      3,      1,      3,
-        -2,    233,    782,   8192,    566,   -701,   -352,   1047,
-       581,  -1070,   3159,  -1157,  -1585,   1599,   -978,   -663,
-      -931,  -2581,   5074,    781,   -551,   -590,   -247,    -63,
-       -54,    -50,    253,   -138,   -313,    387,  -3004,  -1136,
-       654,  -1283,   1318,    434,     80,  -1486,    694,   -512,
-       393,   -238,   -700,   -232,    706,   1478,  -8192,    377,
-       601,     18,     -1,     -3,      0,     -6,     -3,   2221,
-      3531,   -862,   1792,   -242,  -3686,    420,   1891,    918,
-      1324,    234,   -819,   -601,   2363,  -1097,   2355,    754,
-      -125,    245,   -615,   3285,    204,      0,      6,     -4,
-        -3,     -1,   -637,    673,   1233,   2886,    265,   -195,
-      -226,   2521,    281,   -210,   1809,  -2733,  -3865,  -2287,
-       641,  -2604,  -4235,    107,    789,   1163,  -2600,   -463,
-        -5,     10,      2,    -10,     39,   1380,    754,  -5077,
-      4061,  -1633,  -1738,  -1604,   1937,   1815,   1039,   3696,
-      -593,   2218,  -1061,   1081,  -1217,   2062,   -637,  -1580,
-       149,   -626,   -253,     -3,    -17,      2,     33,      1,
-       118,    525,    158,   1213,    910,   -105,  -1437,  -1311,
-      2255,   -419,  -2394,   1542,  -3830,  -1167,   -998,  -1099,
-      1635,   1678,  -1112,   -275,    122,    -50,      0,      3,
-         0,     -1,     -1,    998,  -4020,  -1913,  -1083,   -159,
-      1853,   -436,   -683,    298,    211,    711,   4128,  -1977,
-      -958,   1048,    642,   -420,    329,  -1150,    459,   2161,
-        29,     -4,      0,     -1,     -6,      1,   1365,   1053,
-      1032,    952,    854,   2405,   5106,   1863,   3049,    981,
-      -863,   -397,    508,  -1283,   -631,     17,    532,  -1453,
-     -1056,     66,    501,    -27,     -1,      3,     -1,    -13,
-        -2,   -273,  -2924,    839,   -433,   -395,   -252,   1945,
-       195,   -307,  -1297,  -1474,   -985,   4412,  -1017,   1074,
-      2711,    996,    919,    183,    -10,   -605,     38,      1,
-        -1,     -1,      2,      1,   2115,   -422,   3655,  -1972,
-      1473,  -2033,   2461,  -1112,  -1267,    179,   -394,   -906,
-     -1273,   -432,   1082,    367,   -720,   1746,   -657,    595,
-       701,     16,     -1,      0,      0,      2,     -3,   -255,
-       443,  -1840,  -2379,    296,    258,   -675,   -221,    406,
-      -216,  -6295,  -1041,   1062,    199,   1705,  -1032,  -1627,
-     -2399,    198,  -1097,   -271,    -99,      0,      1,     -2,
-         2,    -13,    343,   -219,  -1447,   1779,    630,  -1944,
-     -1093,  -1578,    -62,  -1334,   2811,   -815,   1311,  -3102,
-      -300,     67,     24,     98,    764,  -1246,    203,      6,
-         0,     -4,      0,      1,      0,    -18,  -1704,  -1427,
-      -352,  -2665,   -588,    287,    715,   -454,    688,   -424,
-      1736,  -1124,   1028,  -7581,   -752,   -482,   -363,    -75,
-      -720,   -619,    449,      0,      3,      0,     16,     -3,
-     -1211,   2484,   3490,   -547,   -705,   1776,   -286,  -1580,
-      2896,  -2257,   -214,  -1784,  -1266,   -562,  -1170,   -542,
-       785,   1606,    535,     51,  -1405,     -7,     -1,     -1,
-         0,     -1,      2,   -428,   -579,  -1091,  -2627,   2287,
-      -757,   1445,   -411,   -160,    567,    108,  -1305,  -4356,
-      -390,   -917,    345,  -2169,   -896,   3772,   1224,    691,
-       -25,      1,      1,      1,     -2,      1,    281,   1365,
-     -1628,   -585,   3485,    169,    746,   -395,   1072,   1569,
-     -1073,    744,   1274,  -3472,   1035,   -906,  -3394,  -1537,
-      -869,   2841,    401,      4,     -1,     -3,     -3,     -1,
-        -3,    -37,  -1628,   -888,    785,   3328,   1105,   3551,
-      6946,  -1688,   2690,  -2051,  -2212,  -3750,  -1903,   -497,
-      1251,   1187,  -6198,   3930,     85,  -1077,     16,    -23,
-       -80,   -130,     43,     66,   -974,    579,  -2047,  -3607,
-      -666,  -2248,   4619,   6846,     88,   -649,   1129,   -255,
-      3567,   -124,     41,     58,    634,  -1252,    696,   2536,
-     -1590,    209,     12,   -102,   -275,     27,    216,   1110,
-       259,  -2091,   1775,  -3768,    598,    441,  -1809,   -431,
-        22,   -991,   -621,     84,  -1803,   1585,    559,  -1101,
-        42,    456,   -392,   -874,     -4,      0,      0,      1,
-        -1,      0,   -371,   -211,   -339,  -1232,    438,  -2683,
-     -1007,   1250,   5343,    861,  -1305,   -577,   2107,  -2649,
-     -3227,   1020,   -127,    562,   5495,  -3136,   -414,   -529,
-        12,    -53,    -34,    151,    106,  -2946,   -575,  -1796,
-      3095,   -257,   -591,    126,    967,   -547,   -271,    560,
-       974,  -3335,  -2110,  -1403,   5915,  -1108,    388,  -1266,
-      -522,    336,    167,      1,     -3,     -2,      2,     -3,
-      -312,     19,   3356,   1123,   -676,   -247,    697,    548,
-      1768,   1174,   -525,   -253,   -423,    546,  -2373,  -2940,
-     -1055,  -2304,    203,   1309,   -574,     -8,      0,     -3,
-         4,      0,      4,   -215,   8192,   -670,  -1289,  -1547,
-      -304,   1498,   -967,   -529,   -582,  -2205,   1752,    321,
-       573,  -1096,     64,   1152,    -87,    574,   -250,    539,
-        62,      7,      2,     -1,     -3,      3,   -465,    243,
-     -1179,    828,  -2501,   -223,    198,   -883,   -740,   1113,
-     -1821,  -2068,  -3234,   1715,   1989,   1817,    727,   1640,
-      3386,  -1538,   -864,     45,      0,     -4,      0,      0,
-         2,    608,  -1495,   1259,   -132,   1311,    350,    537,
-      2735,   1428,    151,   1324,    547,  -3983,  -1892,    104,
-      2023,   1908,  -1042,   1130,   1252,   -701,      9,      0,
-        -2,     -1,      1,      1,    602,  -8192,  -2776,   -661,
-      1640,    443,   3452,   -738,    829,    637,    292,    232,
-      1352,   4879,   1429,    912,    649,   1593,    308,   -330,
-        68,     63,     -3,      4,    -57,     26,     25,   1250,
-       400,  -4839,    211,  -2748,   -664,    996,    341,  -1053,
-       321,   2458,    764,    743,   -729,     12,   -283,   -346,
-       118,   -249,   -153,  -2329,    -37,      0,     -1,      0,
-         1,      1,    352,   -878,   2336,   -634,  -2690,  -3415,
-     -2949,   -531,   1259,    394,    163,   -994,    845,   1259,
-       890,   1400,    279,   1908,    161,  -2174,   1876,     76,
-         1,     -1,     -1,     10,      0,     47,  -1123,   1611,
-       489,    618,   -816,     -7,   2001,  -1190,   1857,  -2749,
-      -311,   -331,    733,   1412,   1390,  -1525,   1262,  -1393,
-      -263,   3124,    -98,      0,      1,      0,      1,     -2,
-       514,  -3533,  -2394,   3623,    249,  -1056,    515,   1279,
-      2821,    477,    183,    689,   1182,   1378,   1287,   -711,
-      1264,   -713,   -278,    217,   -664,   -225,     -1,      0,
-         6,      2,      9,  -1171,   3119,   1340,  -1229,  -1929,
-      1984,  -1333,   1018,     10,   1205,     63,    358,  -1108,
-      -455,   -413,    854,  -1550,   -423,   -180,   2529,  -8192,
-       -18,      0,     -2,     -1,      0,      0,   -678,   3819,
-     -1316,   1159,    590,   -231,   2203,  -1533,    986,   4289,
-      1114,   1135,  -1162,   -921,    -58,    691,     11,  -1718,
-      -270,   -531,    530,     65,      0,     -1,      1,      4,
-         0,  -1184,  -1359,   7230,   -533,  -2077,  -1188,    113,
-     -1472,    490,   1518,   1476,  -1885,    934,    244,   1840,
-      -696,   -480,  -2476,   3324,  -2433,   1102,    120,      1,
-       -11,     -2,     18,     -3,  -1016,    189,  -3835,  -1659,
-       -46,   -180,  -2659,   1998,  -1437,   1107,  -2248,    165,
-      -657,  -5079,   -224,   1246,    469,    421,   1145,   1148,
-        84,    -18,      3,      0,      0,     -6,      0,    -66,
-      -206,   2279,   -220,   1606,   -421,  -1482,   -413,  -1237,
-       374,   3691,    491,   -774,    410,    791,    380,   3385,
-       615,   -950,   -620,   -197,     65,     -1,      3,     -3,
-         2,     -1,   -484,   1396,    273,  -3591,   1317,  -1013,
-      1563,   -134,    602,  -1069,    733,  -1167,    233,    319,
-      -262,    350,    780,   -407,   -496,  -1285,   1326,    -13,
-         0,      2,     -1,      0,     -1,   -328,   -626,   -848,
-       745,  -1047,   4048,   -380,   -456,  -1894,    869,  -1085,
-      -373,   2829,    622,    473,    394,    237,  -2175,   1167,
-     -4942,    246,    100,     -1,      1,     -6,      1,     -6,
-       -70,     35,   1613,   2597,   1307,   1756,  -1184,   1082,
-       971,  -2004,  -1459,   -494,    -40,    745,   2788,   -830,
-        76,    536,  -2002,    401,    -57,    -20,      0,      0,
-         0,      0,      0,     -8,    244,   1927,   1162,  -2416,
-     -1414,    463,    -89,   1217,   -798,    394,  -1527,   -719,
-      -666,    998,   1518,  -2455,  -3049,  -1174,  -2696,  -3119,
-         2,      0,     -2,      2,      2,      3,   1093,   -623,
-      1660,  -1635,   1457,   2560,    763,  -2750,    931,   1798,
-      2550,   1402,    914,   -919,   1931,   -383,   -435,   -583,
-       439,      9,  -1106,    -12,     -1,      0,      0,      0,
-        -2,   -335,   -730,  -2102,  -1414,   2576,  -3869,   1025,
-     -1657,     -2,    857,   -336,  -3011,    205,   1108,    364,
-      -789,   -179,    171,    331,   2204,    527,    -13,      1,
-        -3,      2,      1,     -4,   -565,   -211,   -139,   1799,
-       195,   -877,   -632,    358,   -244,  -1459,   1398,   2271,
-       550,   1987,   2206,   -337,    199,  -7036,    589,    195,
-      -466,     72,     -1,      2,      1,      0,      0,    -27,
-};
-
-static const int16_t cb0806sm0[] = {
-     -8192,    389,    245,    -67,    -42,     79,    503,   -488,
-      -310,    107,    -13,   -431,   -203,     96,    510,    151,
-       270,      0,      0,      0,      0,      0,   -463,    -23,
-       -72,   -322,     74,   1589,   -152,   -198,     81,   1120,
-      -125,   -434,  -3275,  -2210,   -348,   -344,     91,      0,
-         0,      0,      0,      0,   -254,   -224,     46,   -154,
-      -131,   -465,    -57,   8192,    345,    112,   -725,    -49,
-       183,   -191,    246,    263,    370,      0,      0,      0,
-         0,      0,     39,   -739,  -6603,  -2454,    -95,    312,
-       -53,   -392,     63,   -165,     31,   -505,    111,    484,
-      -535,    179,    143,      0,      0,      0,      0,      0,
-      1279,   -139,  -1769,    244,     59,   -135,   -429,    707,
-       809,  -4355,   -354,    428,   -300,    108,   -799,  -1421,
-       599,      0,      0,      0,      0,      0,      4,     -5,
-         7,     75,     49,   8192,    276,    200,    191,   -167,
-       -14,     82,    222,   -277,   -483,   -216,   -441,      0,
-         0,      0,      0,      0,    171,   -423,    174,    401,
-      -517,   -377,   -234,   -644,   -829,   -350,   -976,   -146,
-      -928,    296,   3003,   3545,    -30,      0,      0,      0,
-         0,      0,    161,  -6753,   1138,   -855,   -132,   -242,
-       559,   -225,   -346,   -168,     10,   -481,     -6,  -1208,
-       252,   -323,   -191,      0,      0,      0,      0,      0,
-      -262,    574,    433,   -145,    622,    329,  -2634,   -439,
-     -1178,    351,   -433,   -842,   4125,    296,    305,    359,
-       -22,      0,      0,      0,      0,      0,    -34,    -56,
-     -1019,   -247,   -163,    305,    574,    -51,   -179,     24,
-     -1097,    248,   -166,    -18,    303,    252,   -555,      0,
-         0,      0,      0,      0,   -400,   -254,   -256,   2783,
-      -296,  -1904,    552,   1284,   -336,  -2371,   3396,  -1092,
-       102,    176,    140,    640,   -359,      0,      0,      0,
-         0,      0,    373,    473,  -2167,   -774,   -388,    405,
-     -1402,  -1391,  -1319,   -155,   1104,   -533,    382,   1561,
-     -2958,    406,    787,      0,      0,      0,      0,      0,
-     -3800,    -58,   2098,   -181,   -570,    385,  -4125,    759,
-     -1584,      9,   -278,    201,   -528,   -527,   -435,    436,
-       681,      0,      0,      0,      0,      0,     30,    -80,
-       -60,  -4031,    -70,  -3367,    316,   -861,     67,   -169,
-      -144,   1598,    966,     32,  -1263,   -434,   -738,      0,
-         0,      0,      0,      0,    181,     12,    115,     91,
-       253,    518,    517,    216,    830,    336,   -568,  -3125,
-      -796,   -847,   1627,     58,   -158,      0,      0,      0,
-         0,      0,     48,   -851,   -286,    393,    390,    707,
-       595,    427,   -235,   -116,    814,   -198,   6145,  -1590,
-       647,     15,   -259,      0,      0,      0,      0,      0,
-      -621,    152,    590,    -16,    215,   -633,   -784,   -140,
-      1087,    723,  -4191,   2701,    951,   -972,    273,   -554,
-       387,      0,      0,      0,      0,      0,   -124,  -2939,
-       -38,    383,    234,    687,  -2873,   -466,     61,   -472,
-       854,   -396,    305,   -233,     82,  -2677,   -206,      0,
-         0,      0,      0,      0,   -120,   -246,   -614,   -394,
-      8192,     75,   -450,    177,   -251,     45,   -142,     65,
-     -1248,    -14,    389,    375,    114,      0,      0,      0,
-         0,      0,   2870,    158,   -473,   -166,    928,   -618,
-     -1909,    224,   -931,   1898,    -16,    427,    447,  -1044,
-        85,   -333,    197,      0,      0,      0,      0,      0,
-        78,    114,   -167,     73,  -1070,    -80,   3512,  -3004,
-     -1553,    769,    213,    851,   -377,    978,   1097,     71,
-        66,      0,      0,      0,      0,      0,   -129,    248,
-       455,   -376,    344,    128,    -60,    546,   -321,  -7898,
-      -719,    -55,   -941,   1242,    207,    215,    323,      0,
-         0,      0,      0,      0,    -24,   -225,    136,    142,
-      -739,   -117,      2,    242,   -152,    -20,  -1775,   -484,
-       -36,   -408,  -2767,   -471,    251,      0,      0,      0,
-         0,      0,     22,    111,   -180,  -7417,    365,    293,
-      -313,   1031,   -191,    154,   -210,   -239,    121,   -333,
-     -1504,    209,    146,      0,      0,      0,      0,      0,
-       898,   -643,   3080,    528,    -91,   -718,   -512,    275,
-     -3564,    396,    160,   -850,    346,   -595,   1558,    684,
-      -310,      0,      0,      0,      0,      0,    234,   -419,
-      -724,   -433,    292,  -1003,    682,   -117,  -1318,   -914,
-     -5137,    128,     53,    291,    408,   1269,   -284,      0,
-         0,      0,      0,      0,   -252,    190,  -2911,    130,
-       255,   -172,  -4331,     26,   -267,    280,   -133,   -613,
-     -1063,  -1135,    759,  -1290,    216,      0,      0,      0,
-         0,      0,    133,   -177,   4069,   -311,   -197,   3260,
-       341,    201,   -117,   -515,    105,   -658,    975,     81,
-      -333,   -333,    262,      0,      0,      0,      0,      0,
-       273,    -87,    321,    190,   1385,    274,    182,  -2553,
-      -150,    164,   -830,     89,   -459,  -5279,   -624,   -336,
-       399,      0,      0,      0,      0,      0,   -172,   -232,
-        11,     45,    121,   -254,   -457,    196,  -3487,   -838,
-       512,   -310,  -2831,    -85,     98,   -145,   -331,      0,
-         0,      0,      0,      0,    -55,   -149,   2068,    -61,
-      3087,   -143,   1574,  -1381,   2853,   1899,   -453,   -580,
-      -137,   1211,  -1413,    171,    125,      0,      0,      0,
-         0,      0,   -228,     30,   -956,   5569,    209,    -89,
-        25,    573,  -1669,    507,    182,   -132,    697,   -132,
-     -2964,   -637,    139,      0,      0,      0,      0,      0,
-     -3078,  -3278,   -771,    928,    -38,   -463,    820,   1141,
-     -1234,    620,    652,  -1710,   -382,  -1618,   -409,    179,
-       483,      0,      0,      0,      0,      0,   -102,   4256,
-       -20,   -162,   2021,    730,   1439,   2776,    459,    498,
-      -152,    482,     35,   -271,    810,  -1345,   -249,      0,
-         0,      0,      0,      0,    131,      5,   -281,    431,
-     -2498,  -1046,    482,    842,    297,   -311,  -1260,    148,
-      -906,  -4217,  -1411,   -102,   -361,      0,      0,      0,
-         0,      0,    116,  -3083,    235,  -1195,    -19,   -646,
-        42,    487,    309,   1654,   1051,  -1643,    689,   -823,
-      2279,   1488,    571,      0,      0,      0,      0,      0,
-        42,    -95,     -3,     36,   -170,   -114,   8104,    217,
-       140,   -217,    599,   -774,    -64,   -675,   -211,    166,
-       204,      0,      0,      0,      0,      0,     99,    594,
-       -48,    224,     52,  -1499,    271,   2224,   -219,   3184,
-      -165,    828,  -1345,   -785,    181,    133,    124,      0,
-         0,      0,      0,      0,   -235,   -286,    254,   -171,
-     -4980,   -453,  -1432,     12,    734,   -391,   -640,    339,
-       537,    313,   -700,   1016,    148,      0,      0,      0,
-         0,      0,    -49,    -19,    803,    935,    520,    -90,
-       641,   1053,   -454,   2338,  -6071,   -478,    616,   -559,
-      -339,    445,  -1464,      0,      0,      0,      0,      0,
-      -175,    111,   -132,     65,   -264,    732,    221,    231,
-     -1972,   -305,    325,   -859,    583,   1272,   -441,   2651,
-       229,      0,      0,      0,      0,      0,   -286,  -4646,
-      -262,    593,    613,    936,    310,   -615,     83,    223,
-      -816,   1910,   2041,    281,   -190,   -434,    114,      0,
-         0,      0,      0,      0,   -123,    684,   -208,    524,
-      -606,  -1223,    264,   -983,   -109,  -1057,    696,    195,
-      -521,    945,  -7503,    193,   -120,      0,      0,      0,
-         0,      0,     98,   -358,  -2165,    244,    277,    393,
-       771,   3360,   -258,  -1218,   -122,  -1253,  -2297,    806,
-      -198,    540,      7,      0,      0,      0,      0,      0,
-        78,   -281,   -368,   2809,    159,   2611,    833,   -120,
-     -3987,    933,    360,    -49,   -515,   -106,   -360,    650,
-      -125,      0,      0,      0,      0,      0,    203,   1369,
-       749,   -502,  -2295,   -326,    448,   -309,    630,    -84,
-       345,   -520,     -4,   -623,   1066,  -3915,    373,      0,
-         0,      0,      0,      0,  -4603,   -794,   -625,   -355,
-      1071,   -601,   -553,    593,   -296,    626,   -328,    621,
-        85,   1348,     92,   -288,    204,      0,      0,      0,
-         0,      0,     -9,    602,   -162,   -749,   -104,    464,
-      -372,  -1375,  -1905,   2200,     61,  -3308,   -897,    634,
-      1036,  -2112,   -182,      0,      0,      0,      0,      0,
-       -76,   2341,   -675,    -72,    -29,    704,   -536,   1656,
-      -541,   -736,  -1420,  -1539,   2458,   -228,    674,  -1258,
-        -3,      0,      0,      0,      0,      0,   -133,   1111,
-        63,    327,    470,   1226,    541,   -276,  -3042,  -1594,
-     -3192,    357,   -617,    658,   -315,   -978,    631,      0,
-         0,      0,      0,      0,    111,   -188,    619,    236,
-       104,     54,    545,    424,   5912,   -332,    711,  -1249,
-      -533,    291,  -1544,   -216,    113,      0,      0,      0,
-         0,      0,   -199,    267,    152,   -301,   -172,   1294,
-      2311,   -482,  -2451,    -82,   1833,    214,    130,  -1183,
-     -2212,    403,   -625,      0,      0,      0,      0,      0,
-      -106,    662,    -48,   -131,    324,   2337,    445,    462,
-      -349,   -189,    669,   4945,  -1797,     16,    268,   -602,
-         2,      0,      0,      0,      0,      0,     55,    154,
-       892,    -35,   -145,    357,    562,     42,     -9,   -284,
-       177,     84,    422,   -181,   -358,   7618,     29,      0,
-         0,      0,      0,      0,   -353,     68,    -41,  -4096,
-       177,    -20,   -267,    782,    954,   -430,   1573,   -696,
-      1785,  -3611,     89,   -243,    683,      0,      0,      0,
-         0,      0,   -220,   1983,   -891,    614,    226,   -202,
-        67,    761,   1904,    179,    226,    416,   -657,  -3409,
-      1026,   2834,   -438,      0,      0,      0,      0,      0,
-      -551,   -229,   -304,   -462,  -2277,   -419,    451,   -122,
-      -108,    258,    784,   1105,    382,    137,   5695,   -241,
-      -491,      0,      0,      0,      0,      0,     34,   -272,
-     -1687,   1769,   -332,    365,     33,  -2594,   3729,    325,
-        85,   -295,   -290,   -152,   2238,   -611,    -41,      0,
-         0,      0,      0,      0,    102,    166,    241,   1098,
-      -107,    775,   -414,   4256,   -277,    935,   -200,    495,
-       255,   1144,    468,   -184,    -59,      0,      0,      0,
-         0,      0,     94,   -282,    -57,     12,   -390,    245,
-      1872,   -620,   1089,   3754,    432,    947,   -509,   -284,
-     -3836,     26,    482,      0,      0,      0,      0,      0,
-         9,    971,   -373,   1111,   -480,   2342,   -182,    528,
-       802,   1196,  -1017,   -879,    499,   2800,   -830,   -230,
-        -4,      0,      0,      0,      0,      0,   -382,   -815,
-     -1669,  -2437,   -593,    193,   -688,    632,    479,   2883,
-       565,    540,      5,   1598,   1618,   -640,   -246,      0,
-         0,      0,      0,      0,   -421,   -103,   1482,  -3026,
-       -65,   -101,      4,   3921,    688,   -941,   -234,     49,
-       202,   1905,    935,  -1155,     -4,      0,      0,      0,
-         0,      0,    210,   -625,   -118,  -3215,    344,    978,
-       -10,    773,   -126,   -804,  -1534,    182,  -1146,   -646,
-      -146,   2011,    463,      0,      0,      0,      0,      0,
-};
-
-static const int16_t cb0806sm1[] = {
-        35,   -237,    547,    705,     -9,   1612,    382,    195,
-      -191,   -250,   -101,   -357,    709,    153,    850,  -5091,
-      -100,      0,      0,      0,      0,      0,  -6406,   -158,
-      -527,    137,   -330,    580,   -484,     63,    541,  -1245,
-      -205,    138,    247,   -489,   -147,   -132,   -863,      0,
-         0,      0,      0,      0,     53,    -38,    283,    -22,
-     -1506,   -467,   -418,    117,    133,  -2152,    -48,   -991,
-       808,  -1047,   2402,    261,    423,      0,      0,      0,
-         0,      0,    -14,    500,   4697,   -174,   -544,     87,
-      -379,   -243,    577,    682,    258,  -1190,  -1984,    599,
-       607,   -123,   -290,      0,      0,      0,      0,      0,
-        60,   4254,    194,    888,    -81,   -395,    422,  -1786,
-       916,    288,   1191,   -658,    502,   2177,   -977,   -301,
-       587,      0,      0,      0,      0,      0,    232,    204,
-      -452,   -853,  -4266,   -219,   1164,     92,     91,   1561,
-       950,   -705,  -1217,   -734,   1617,    120,   -324,      0,
-         0,      0,      0,      0,  -3442,   -456,   -667,    987,
-       -89,   1383,   -704,   -187,   -280,   -583,    341,   -732,
-       649,  -2129,  -3505,   -175,   -215,      0,      0,      0,
-         0,      0,    200,   -635,   -471,  -1221,    215,   2844,
-      1633,    522,   -720,   1722,   -272,    473,    198,   -604,
-       480,    -88,    169,      0,      0,      0,      0,      0,
-      -160,   -268,    130,    284,   -612,     95,     43,     42,
-       641,   -258,  -6884,   -167,   -689,    123,    276,   -592,
-       717,      0,      0,      0,      0,      0,    313,    -90,
-     -4310,   2706,  -1708,    648,   -796,    791,    998,   -468,
-       632,   1893,     43,   1937,  -1279,    -22,    -64,      0,
-         0,      0,      0,      0,   -106,    135,   -287,    335,
-     -7999,     51,   -250,   -388,     16,    285,   -101,    685,
-      -944,    604,   -624,   -792,    209,      0,      0,      0,
-         0,      0,    496,   -205,    422,     49,    274,   -229,
-       220,     73,   -734,    381,   -394,  -8192,   -405,    755,
-        -9,     46,    116,      0,      0,      0,      0,      0,
-       -28,    332,   1152,   -129,    244,     84,  -2193,    632,
-     -1854,   -384,    110,   -302,   -270,    435,  -1689,   -797,
-       686,      0,      0,      0,      0,      0,  -1660,    624,
-      -664,   2611,     30,  -1155,   -419,  -3539,   -568,   1719,
-     -1374,   -676,    -55,  -1934,    863,   1391,    433,      0,
-         0,      0,      0,      0,  -1012,    290,   2302,   -330,
-       -95,  -2355,    -55,   -763,  -1995,   -298,   -680,    715,
-       -85,   1615,   1011,  -1989,  -1028,      0,      0,      0,
-         0,      0,     21,  -5001,    507,    -58,    229,    -37,
-      -113,    632,   1809,    -62,    334,  -1201,   -893,   -344,
-        98,    438,    -65,      0,      0,      0,      0,      0,
-         0,    143,    131,    -18,   -135,   -306,    392,    232,
-       265,    543,    376,   -562,    362,   2458,    785,   3653,
-      -456,      0,      0,      0,      0,      0,    855,  -4009,
-     -1207,    118,    -86,   -223,    266,    154,  -1886,  -1145,
-       241,   -397,    246,    244,   -776,    808,   -132,      0,
-         0,      0,      0,      0,      2,   -633,    113,    -94,
-      -154,   -173,   -162,   -168,    439,  -6548,    778,   -392,
-       -60,     99,  -1901,    171,   -130,      0,      0,      0,
-         0,      0,    -11,   -324,    711,   -903,    560,  -1654,
-      1473,   -300,   1048,    137,  -1140,  -1115,  -1302,  -1008,
-      -792,  -3264,   -540,      0,      0,      0,      0,      0,
-      -347,     78,   -103,     -7,     -3,    437,   6053,    299,
-      -435,    323,    664,    477,   1097,    158,    656,    273,
-       200,      0,      0,      0,      0,      0,   -101,     80,
-      -153,    144,   -235,    492,   -399,     -3,   4958,    699,
-      -586,   -162,    153,   -860,    161,    665,      4,      0,
-         0,      0,      0,      0,    -87,   -189,   1744,   -350,
-     -1840,    325,  -2354,   1193,   1386,  -1589,     80,   1055,
-      -188,    273,    807,   2038,   -419,      0,      0,      0,
-         0,      0,     50,   -185,     68,    -59,     -9,     78,
-      -585,   -121,  -7888,    771,   -908,   -284,    349,    158,
-     -1122,   -139,   -189,      0,      0,      0,      0,      0,
-       310,   -286,    235,   -687,   -919,   -364,   -697,   -253,
-       492,    300,   -238,    272,    518,   -525,  -5863,   -190,
-       -59,      0,      0,      0,      0,      0,    151,    616,
-     -4420,    227,    240,   -252,    516,   -250,     68,    411,
-      -192,    -87,   -607,    671,   1281,   -317,   -305,      0,
-         0,      0,      0,      0,     -9,    817,   -451,  -1079,
-        86,   5060,  -1157,  -1159,   -421,    302,   1636,   -316,
-       -66,   -518,   1010,   1068,     96,      0,      0,      0,
-         0,      0,   -576,   -362,    107,   3516,    303,   -364,
-      -402,    805,    574,    993,   -554,    298,   -925,    410,
-      1898,     13,    138,      0,      0,      0,      0,      0,
-      -340,   -150,    528,    142,   -464,   1034,   -397,   3944,
-      -697,    962,    902,   1393,   2212,  -1021,  -1034,   -961,
-      -319,      0,      0,      0,      0,      0,     58,     38,
-       382,    221,   -212,    826,  -1373,  -4559,   1329,   -123,
-       216,    -23,   -736,     95,   -300,   -418,     -4,      0,
-         0,      0,      0,      0,    -58,   7814,    218,    141,
-       -90,   -124,    455,    -27,     49,   -311,   -364,     80,
-      -136,  -1257,     96,    332,   -287,      0,      0,      0,
-         0,      0,     -8,    624,    127,   1857,   -480,   -869,
-      -575,  -1461,   -493,   -261,     97,     32,   -328,   -467,
-       173,  -2588,    132,      0,      0,      0,      0,      0,
-      5257,  -1037,    191,   -844,    247,    130,   -571,   -548,
-      -496,    216,   -161,    336,     62,    990,    130,    517,
-       -65,      0,      0,      0,      0,      0,    -89,      9,
-      -138,    405,   -701,   -479,   3605,    699,   -629,   -102,
-        27,  -1374,  -1059,    -18,  -2707,   -172,   -557,      0,
-         0,      0,      0,      0,    -67,    209,    571,    -93,
-      -405,   -172,   -260,    -19,     86,     22,    659,   -630,
-       222,  -8192,    106,    -34,     60,      0,      0,      0,
-         0,      0,    -10,  -3386,    336,    651,  -1377,    681,
-       -16,    -45,   -382,   1102,   -280,    169,   -822,    522,
-       434,  -1111,   -299,      0,      0,      0,      0,      0,
-       194,   -445,   -231,   -532,   -438,   -180,   -591,  -1680,
-       179,   5921,   -184,   -685,   -467,    875,   -573,    282,
-       235,      0,      0,      0,      0,      0,    339,    139,
-      -745,    -68,   -201,    467,   -743,    477,    -23,  -1177,
-      1384,   -357,  -1254,  -3760,    454,   1175,    252,      0,
-         0,      0,      0,      0,    109,   -252,   8027,   -765,
-       136,    111,    -86,   -593,    -84,   -750,   -121,    782,
-       739,   -296,    284,    213,  -1196,      0,      0,      0,
-         0,      0,    -40,     69,   1992,    452,    -75,    -84,
-       683,   1678,  -1350,  -1846,   3068,   -749,  -1410,   -271,
-       536,   1120,    117,      0,      0,      0,      0,      0,
-      4053,    340,    108,    -88,    411,    990,    217,   3675,
-       755,    752,   -206,    205,   -297,   -573,    188,    127,
-      -313,      0,      0,      0,      0,      0,     47,  -2870,
-     -3417,    216,   1730,    -83,    189,  -1615,   1016,    -44,
-      -502,   2151,      6,  -1057,    550,    194,   -498,      0,
-         0,      0,      0,      0,   -133,      1,   -387,   -497,
-       586,    173,    923,  -4078,  -1232,    329,  -2086,   -185,
-       592,    681,   3320,   -914,   -327,      0,      0,      0,
-         0,      0,   -132,    493,   -179,    220,    142,  -4345,
-       422,   -173,    357,   1317,    240,   -525,   1613,   -178,
-     -1584,   -734,    549,      0,      0,      0,      0,      0,
-      -337,    111,  -1238,    116,    302,    325,    189,    610,
-     -3180,   -284,   -817,   1383,   1559,   -802,    422,    438,
-       460,      0,      0,      0,      0,      0,    -96,    372,
-       335,   -843,   3967,    221,    380,    227,    309,    447,
-      -199,   -257,    372,   -397,   -534,    736,   -152,      0,
-         0,      0,      0,      0,   -144,    463,    -54,   -288,
-       -83,    115,   -574,   -229,    485,  -2643,     58,   4312,
-     -1155,    642,   -647,   1122,    118,      0,      0,      0,
-         0,      0,    157,      6,  -1017,  -1155,    687,   -288,
-       918,   -212,   -332,  -2486,   -197,  -1025,   -546,   4099,
-       155,   -731,   -333,      0,      0,      0,      0,      0,
-       -43,   -496,   -546,   -541,    283,   -521,    -47,    -18,
-       208,   -552,   1899,   2107,    588,    818,   -911,  -1104,
-       -84,      0,      0,      0,      0,      0,    -71,     40,
-      -326,     92,    216,   -106,   -255,     28,    120,    -58,
-     -2720,   -133,   -288,    -28,  -1157,   1563,    400,      0,
-         0,      0,      0,      0,     40,     -4,    559,   1350,
-        30,   3905,   -675,  -1092,   -587,  -1524,  -1987,  -1031,
-      1892,   -679,   -623,   1051,    -33,      0,      0,      0,
-         0,      0,    -98,    106,    105,  -5887,   -463,    424,
-       -42,   -506,   -589,    376,    840,    140,   -640,    771,
-        23,   -441,     -6,      0,      0,      0,      0,      0,
-        22,    203,  -3452,   -635,   -605,   1668,    422,   2973,
-       394,  -1605,   -968,   -739,    344,  -1438,    820,  -1318,
-       -26,      0,      0,      0,      0,      0,    258,    -32,
-      1061,    643,   -152,     92,   -454,  -1305,   1621,    554,
-       344,     82,   -404,   5222,   -344,    286,    177,      0,
-         0,      0,      0,      0,     63,   -360,   -127,    814,
-      3639,  -3322,    390,     12,   -515,   -493,   1515,   1706,
-      -727,    394,   1164,    357,   -208,      0,      0,      0,
-         0,      0,    -27,    648,   -342,   -125,   -327,    194,
-     -3639,    598,     29,    244,    898,   -493,    372,   -635,
-       567,     31,   -237,      0,      0,      0,      0,      0,
-      -160,   2798,  -1768,  -2186,    493,    517,    -82,   -468,
-      -290,   2890,   -460,    450,    414,   -265,  -1121,    219,
-     -1115,      0,      0,      0,      0,      0,     14,     76,
-     -2806,    338,  -1429,   -402,    253,   -130,   -235,   -799,
-       309,   -525,   3823,    175,     36,    113,    247,      0,
-         0,      0,      0,      0,    352,    521,    213,   -107,
-       -71,   -762,    790,   -856,   -252,   -246,   -729,   -631,
-      1258,  -3276,   1534,   -436,   -635,      0,      0,      0,
-         0,      0,    -54,    118,   -453,   -124,    -32,    539,
-       356,   -169,   -202,   -590,    721,   -444,  -6260,   -275,
-      -239,   -105,    -52,      0,      0,      0,      0,      0,
-      -464,    507,   -796,   1273,   2297,    790,    652,    392,
-      3364,  -1949,   2154,   -701,   -229,     99,     88,    471,
-      -524,      0,      0,      0,      0,      0,     71,   -914,
-      1835,   -156,   -242,   -196,    513,    431,   -481,    -84,
-      -734,   4501,   -510,    115,    461,   -428,     83,      0,
-         0,      0,      0,      0,  -3987,   1063,   -717,  -2640,
-      -963,   -667,   -147,    536,    -68,    422,    341,  -1916,
-      -616,    996,    522,    568,   1174,      0,      0,      0,
-         0,      0,      8,    112,    693,    392,    445,   5309,
-       259,    121,   1670,    343,    176,    472,    197,    419,
-      -240,  -1178,   -107,      0,      0,      0,      0,      0,
-};
-
-static const int16_t cb0808l0[] = {
-       164,  -3637,  -3563,   -243,   -123,    -47,    -87,    -32,
-        62,    129,     -2,    131,    -36,   -202,   -197,     37,
-       -35,   -442,   -139,    -69,    -59,     29,    -62,    -67,
-       -17,    -42,     74,     10,    107,     74,   -109,     40,
-    -10210,    -33,  -3210,   -410,   -106,    512,     40,    -17,
-       109,     67,     99,    170,     53,     34,    -68,    -16,
-      3895,    -71,   -116,      1,    608,     66,   -215,     34,
-        77,     50,    -45,    -73,      3,     11,    -33,     18,
-       -34,     58,     25,   4420,     96,     77,    -67,     23,
-       -83,  -6724,    226,    -32,   -150,   -154,     30,    -12,
-        -8,     -7,     89,     42,    173,    -51,     38,  -1852,
-        40,    -48,    -40,     81,     34,     81,     66,     16,
-        20,      3,     99,     41,    123,     52,    154,     20,
-       -38,      6,  10889,    -44,     22,    -39,     55,    -34,
-        25,    -45,    -22,    139,     19,    -20,    -64,  -2242,
-      -473,   -113,    316,    127,    -31,    128,   -363,   -124,
-       196,    259,    -60,  -3792,    -41,   -103,    104,    -80,
-      -389,    179,    110,     83,   3174,     60,   -197,    101,
-        66,    -47,   -107,     96,    -27,     45,    -21,      6,
-       116,    -51,     -8,   -594,    377,   -279,    158,   -159,
-      4595,   -163,   -210,     19,      3,   -292,    -67,     14,
-       115,    -41,   -125,   -154,   -263,   -101,      4,    -11,
-       -89,    130,     58,     32,     92,     16,    126,    -93,
-       -99,  -4239,    -69,     88,      5,   -113,    -18,     35,
-        31,    -48,    -16,     35,     62,  -2839,     14,    121,
-        19,     41,    125,   -102,     26, -13144,      6,    -30,
-        -7,     60,      4,     36,    -40,    -26,     54,    -57,
-        -9,    -30,     13,     -1,     73,   -131,     29,    256,
-        39,    -51,    -12,   1788,      4,     10,    -58,     17,
-       -36,     -2,     13,     59,    -20,    -21,    173,    129,
-      -435,   -107,   -214,     33,   3078,     13,     31,    148,
-     -2975,   -311,     38,     25,   -247,   -542,     34,    106,
-      -392,     85,   -203,    182,   -232,    423,    629,   -183,
-       800,   -466,   3145,  -2498,   -305,     39,     22,     41,
-         0,    -14,    671,   -181,   3197,    109,   2900,     72,
-       -64,      8,    414,    133,    244,   -263,     53,    -69,
-        70, -13756,    -13,     21,     50,     12,    -14,    -12,
-        -7,     97,    -32,     24,     51,    -24,    -29,     53,
-        34,    -19,  -2341,    976,     25,    -58,     18,    -48,
-     -2490,    -55,    -31,   -165,    -36,     28,    -26,     92,
-        60,    137,     69,  -5341,   -125,   1966,   -154,    -66,
-       -13,    -84,    -13,     81,    -46,    -96,     50,    -50,
-      -114,     15,     30,   -211,   -147,   -555,   3998,     88,
-       358,   -159,   -105,    -51,   -109,    -16,     70,     91,
-       268,    125,    -95,    -62,     38,  -3227,   3591,    -15,
-        92,    -72,    115,    144,    -40,    142,    172,     72,
-       -17,     23,      1,     28,    -38,   -135,    220,    -80,
-      -179,      9,    -32,     -6,     37,    -33,     -3,    -89,
-      7314,      5,    194,    -13,     23,     31,     42,     84,
-       197,   -163,   -251,   -273,    193,    206,   -613,    394,
-      3469,   2587,   -701,     62,    301,   -104,    200,    164,
-      -201,   -473,     52,   -473,    128,   -381,    404,    -69,
-      -230,   -537,    157,    389,     -7,   2783,   3058,     95,
-       -59,   1618,      1,      4,     53,     -6,     28,     10,
-         2,     82,     28,     -8,    -14,     25,     59,     10,
-        -4,     36,   -777,  -4984,     29,      8,     85,    -43,
-      -137,    -34,     53,    -58,      1,    -27,     91,     15,
-        80,    -19,   -186,    467,     94,   -382,    129,    327,
-      3053,   -221,    399,  -2821,   1090,    278,     -2,   -163,
-      -398,    126,   -266,    180,   -235,     70,    -18,    -34,
-       -45,    159,    -32,     66,     11,   3177,   -188,     27,
-        35,    -52,    114,    -28,   -136,    186,   2146,    100,
-        92,      6,     58,    -70,    159,    -14,    -32,      9,
-         6,    -27,    -73,     28,     23,    -24,    101,    148,
-        80,    -52,    -27,    -53,    -36,      4,    -74,     47,
-       -30,   -108,     34,   7213,     12,     31,    -17,   -185,
-      3318,    199,    192,   3450,    -87,      3,     47,     46,
-      -141,     49,     83,    -82,   -132,    -82,     68,    138,
-     -1031,   -236,    390,    -37,     23,    -94,     -7,      9,
-     -2958,  -1846,    -43,     23,     25,    -79,   -193,    -77,
-     -3332,  -3355,   -139,     56,    163,  -3302,    -82,    -25,
-        35,     96,     73,    166,   -154,    174,   -121,     14,
-       -89,    101,  -3751,   -344,   -240,    -35,    401,    -14,
-        47,    -49,     24,    -78,     24,      6,     68,     51,
-      -145,     20,     83,     57,    147,   -100,     60,     33,
-       -53,     11,     37,  -5793,    -93,    -67,     -9,    117,
-       112,    -51,     60,     48,     49,    328,    293,    127,
-      -314,  -3022,    374,   3283,    -86,    588,   -346,    436,
-        -7,    -26,    -88,    104,    205,    150,    147,     34,
-       126,     85,     46,   -125,   -119,     75,     13,    144,
-      3721,    275,    -71,     43,    163,    -73,   -292,   -381,
-       -79,     33,     79,    -79,     34,    -94,     18,    229,
-        63,     28,    -44,     97,  -3606,     77,    -95,   -162,
-       163,     62,   6180,     81,    -51,    -19,     -5,    109,
-        71,      7,    -37,   -100,    -31,    -94,    188,    169,
-       -14,   2606,   -417,     18,  -4371,    -25,    180,    108,
-        17,     33,     48,    -46,    -93,    -77,     32,    -37,
-       -71,   -271,    -48,   -273,    -14,    115,    -59,   -312,
-     -3334,  -3046,     71,   -166,    379,    209,   -142,     22,
-        89,    -41,    -40,     -7,    -50,      8,    -15,     12,
-       -70,    -27,    -27,     25,    -31,     38,     -5,   2831,
-       -89,     -8,    -50,   -110,   1368,    -59,  -2307,      6,
-       179,     75,    189,    170,    -55,    330,    -70,    172,
-        67,   -492,    -57,  -3408,      9,    -93, -11400,     14,
-        -1,    -21,     65,    -15,     45,    -22,     40,    -10,
-       -41,     23,    -29,    -96,    -55,    -66,    -57,    -61,
-       -29,    -15,   -101,  -9831,     33,     42,    -35,     42,
-       -44,    -58,     11,    -40,     27,     21,    715,   -315,
-      -255,   -115,   1736,      4,     41,    -70,    -51,   -108,
-       160,     -9,     87,     -6,     36,    -20,    -68,     10,
-        82,    -33,    -42,     15,    -57,    -40,    -31,     21,
-     10023,     62,    -41,    -10,     85,    -65,    -12,    -61,
-       -72,   -610,    128,    -76,    198,    367,  -4564,     60,
-       158,    -13,   -134,    -45,    -33,    -11,    -51,    -72,
-       111,   -188,    232,   -494,    -27,     42,     46,    -23,
-       137,   3174,  -3598,    211,    152,    155,   -299,     56,
-       -23,   -123,    132,     50,     28,    -64,     28,      9,
-       -17,     31,    112,    -19,      4,     45,  -7175,     54,
-       -61,     -7,     87,    164,    195,    -29,    -48,     28,
-       -60,     70,    -69,    112,   -295,      5,    -89,     38,
-        36, -11501,     17,    -26,    -64,   -222,     91,    -23,
-       -89,      0,    -94,   2191,    -74,    -84,    -61,    -41,
-        57,     24,    -35,    -28,    -37,    486,    131,   3699,
-      -277,     64,   -125,   -243,    270,    313,   -112,    145,
-        47,  -2862,   -254,   -110,    -27,    -69,   -342,   -120,
-       216,     35,     24,     62,    -39,    -29,   2402,     -7,
-        -3,     14,    -47,    -27,      4,     27,     20,     81,
-       138,     75,    178,    421,  -2943,  -3080,    -84,    -40,
-       -58,   -195,   -182,    101,   -187,      6,    -83,    269,
-       -32,    -99,     51,    -38,     44,     82,    -14,    -35,
-         0,      8,    -23,  10754,    -73,    -57,     68,    107,
-        85,     77,    101,      1,    -28,    103,    -10,     48,
-        55,     33,    -93,    -18,      8,     28,    -14,   -575,
-        28, -11712,     90,   -186,     58,     38,    -42,   2156,
-       -82,     28,    -23,     43,     43,      8,     25,     65,
-         0,    -53,     28,    -88,    388,    -36,    363,     64,
-      3068,     56,    320,   -202,  -3433,     73,   -339,   -157,
-       373,   -216,    -43,    171,    140,   -437,   -143,  -2820,
-      -101,     53,   -111,     65,    -39,     65,    -30,     69,
-       -55,     49,     45,    126,    174,    220,     73,   -101,
-       -60,   -151,    -13,    -41,    -48,     -9,     25,   -122,
-       -80,  -2450,     19,     94,     14,    -18,    -19,     60,
-     -3252,    -10,   3390,    -15,   -365,    -15,    -73,   -222,
-       307,     70,    -95,    237,   -142,   -163,    -44,   -138,
-        -7,      6,    -36,    -67,      9,    -22,  10235,    -56,
-        -8,     44,   -155,   -117,    -22,    -32,    -74,    -14,
-};
-
-static const int16_t cb0808l1[] = {
-       -58,    222,   -154,    -74,    -53,   4939,    421,     67,
-        26,    132,     60,    -97,     -1,    -43,    328,      2,
-       460,    -66,    -11,    -45,    -56,    -86, -10569,   -129,
-        58,    -25,     39,     28,     26,     45,    -61,   -139,
-       -22,   -135,   -282,   -517,   -368,     55,    -47,     30,
-      -110,     47,     75,    -13,     65,    -41,    104,   4745,
-      -149,    -99,     28,    421,    517,    -56,     81,   -309,
-        67,    -42,     -6,     17,    -60,   -151,     50,    -84,
-        -9,     29,    -72,  -3019,     82,   -195,     41,    -14,
-      -206,    -34,    -58,    -18,     30,   2154,    -20,      2,
-        -1,     41,    -10,      7,     86,    494,    123,    328,
-        73,    213,    -29,     17,     43,    -92,    -61,     -9,
-      -130,   -113,     33,    -28,  -6677,   -198,   -185,   -236,
-       183,   -108,    739,     60,     98,   -314,     66,     10,
-     -3161,   -159,  -2850,    118,     37,    -41,   -119,   3087,
-        43,    -36,     42,    106,   -174,  -3379,    -92,   -142,
-      -237,     94,    -59,   -123,   -117,    144,    -75,    146,
-      -268,    561,  -1160,    336,   1477,    207,     89,    130,
-       127,   3763,   -372,     48,     99,    204,     84,    209,
-       103,    118,    125,    326,    -29,   -206,    139,    -61,
-        94,     77,   6624,   -163,     23,     27,   -104,    150,
-       -76,   -205,   -186,    -30,   -227,    -58,     17,     25,
-     -6536,    -19,    -66,    -45,    -72,     41,     49,    -79,
-       105,     -4,   -117,    -37,   -183,    216,    -27,    -23,
-       -31,  -2720,     53,    -23,    -46,     -9,    -10,     50,
-       -12,    -50,    -56,     35,   5498,   -110,     -2,     44,
-        -1,     13,     52,    -18,    -61,    -80,    -29,     25,
-        61,    -37,     93,    -19,     67,     75,    -41,    254,
-       161,    118,  -3379,    398,     -9,   -208,   -143,    207,
-      -135,    -32,    171,    187,   -194,    466,    -55,    158,
-        34,    105,   4986,     27,    -41,     20,     87,   -110,
-        39,     80,    -37,      8,    -25,    -44,   -108,   -171,
-      -366,    208,   -225,      1,   -124,     21,     81, -10349,
-       -51,     33,    -51,    141,    -36,    106,   -100,    320,
-       122,      3,    266,     72,     -8,   -112,     55,   -107,
-     -4154,    -69,      0,     71,   -153,    -80,    -50,     20,
-      -112,    225,  -1982,    273,    -19,   -127,    109,    -25,
-        47,     57,    -98,    -10,     42,    -25,     10,     24,
-        41,    -73,     45,  -3523,   -370,   3213,     54,    -87,
-        67,   -185,    100,    -33,    -41,      3,    -38,     70,
-      -108,   -120,    -67,   -144,   -181,    -33,   -104,    429,
-        89,    849,   3022,  -2765,   -341,    184,   -248,    610,
-       408,   -222,    184,     84,    -64,    479,   -146,     47,
-      -100,     13,     17,     -7,     58,    -13,    -36,    -23,
-        -1,    -25,     10,   2666,   -113,    -41,   -140,   3064,
-       105,     31,   3042,    -75,   -132,   -113,     80,   -100,
-       -39,    216,     -4,      7,    -43,    242,     19,  -1031,
-       731,  -3659,    -24,    -20,    109,    126,   2980,     19,
-       -11,    -48,     57,   -138,    -11,   -211,   -151,    540,
-      -113,   -110,      0,   -415,    150,    -80,    -80,    209,
-       -82,  -5212,   -125,    376,      8,    131,   -138,     30,
-      -922,   -320,    181,    -75,    138,   -112,    146,    -72,
-        64,    -75,   -262,   4872,    -11,    -61,     37,   -205,
-        48,  -2257,     82,    106,     93,    -66,     48,     71,
-        29,     72,     32,     29,     17,      5,     34,     29,
-       -29,    -72,     50,  -7702,   -114,   -117,     47,     11,
-        19,    100,     48,    -28,     -8,     53,     21,     80,
-       -43,     37,    164,     22,    -15,  -5258,    -23,    -32,
-       108,     52,      7,   -161,     11,     84,    141,     -8,
-       -12,    -25,    111,    146,    -96,     66,   7388,     54,
-        17,    -54,     62,     44,    -66,    -13,     26,     13,
-        85,    -79,    -21,     98,    156,    181,   -103,   -188,
-       -35,   -179,     83,    117,    -92,     49,   -185,   3800,
-       -90,     14,     42,     94,    -83,   -178,   -156,     -8,
-        33,     42,    204,     42,      1,    -85,     47,     10,
-     10804,     36,      8,     26,    -47,    -51,   -189,     83,
-       -47,    -23,    104,  -7142,    -67,     55,     21,     68,
-         8,    -84,    -60,    -43,    142,    -41,     27,    -72,
-       -70,   -170,   -141,    202,   -198,   -105,     41,  -3553,
-       -34,   -148,     34,    -62,   -161,    -20,    -73,    128,
-       162,  -8343,      4,    -71,    -46,     12,     27,     48,
-       -41,     50,    -19,    -88,      7,     79,     29,    -19,
-       -31,    -49,   -147,  -1886,   -103,   -213,     28,   -183,
-      4119,     87,      6,     -6,     51,   -190,   -167,   -116,
-        23,    -26,      7,    -38,   5442,  -1869,    -81,    197,
-       105,   -122,     65,    220,     32,    -57,    -39,    -15,
-         4,    112,    -55,   -139,   -825,    985,   -109,   2558,
-       218,     94,     65,   -184,   3269,    101,    -65,     42,
-       372,    -38,     58,      8,   -143,   -544,   -268,    121,
-        38,     61,    -63,    -10,    -30,    -52,    -76,    -74,
-     -6690,     -5,   -160,     76,    -77,     74,    374,   -917,
-       239,   -203,    550,    -84,   -305,    292,    -51,     36,
-       135,    -79,     27,    -69,   -309,   4561,    -67,     11,
-       -60,     43,     18,     -2,      8,    -15,     20,     22,
-        -2,    -41,  -2396,     37,    -79,     67,     27,    -84,
-       353,   -213,  -2336,     58,     39,    126,    -78,    -98,
-       -90,     -3,     -9,    -43,     -2,    -29,     -5,   -149,
-        42,     98,   -109,    137,     58,    -83,    -38,     51,
-      6525,     50,     97,    -31,      8,    132,    -71,    -55,
-        11,    120,      2,    -43,    136,    -37,    -85,    150,
-       133,     67,    -41,   -452,   -104,      4,    126,    100,
-     -2660,   -108,   -109,    -64,    615,    -75,     45,     10,
-       -57,    -57,   -108,    167,   -218,    -10,   -331,    -26,
-       -21,   6561,     73,   -599,    126,    -23,    250,   -103,
-        -4,    -28,    -20,    -35,    -19,     51,      9,    -25,
-       -40, -11220,     -2,     28,    -12,     23,   3481,    169,
-       159,   -217,    -48,    114,    -93,    -34,   -191,    -63,
-        31,    182,     79,     90,     55,     67,   -145,    409,
-       190,  -7791,    -26,     18,     71,   -113,    -80,     69,
-       -21,    -27,   -121,     51,   -148,    103,    196,   2726,
-       -67,   3022,    -28,     26,    -99,     51,     24,     61,
-       104,     89,    -57,    -23,   -112,     43,      6,     13,
-      -184,   -168,    117,    -29,   1865,     -3,     20,      8,
-        30,     32,    -81,     80,    -20,    -59,     37,     19,
-      -107,  -3920,   -259,     44,     23,   -129,     24,    -66,
-       -27,  -3071,    116,      9,    -76,     56,    -83,     25,
-        54,    -20,      2,    230,     56,    -41,    131,    -15,
-       -62,     61,     56,     74,    -34,    110,   4606,     -4,
-        18,    -47,    331,   -106,    -78,     70,     53,     70,
-       -22,     77,    -71,    -60,   -101,     70,      7,    104,
-        -7,     39,    -27,   7210,    253,    -15,      0,    -96,
-        32,     50,    -10,     33,   2058,     11,    -15,     42,
-       -14,     51,      4,     -3,    -11,    -86,     10,     33,
-        21,    -18,    -31,     -7,     53,     -7,     95,      7,
-        75, -11314,      7,     17,    -16,    -83,   -475,   -887,
-     -1141,      1,   -101,      5,    -46,    110,    -90,    -47,
-       -15,     19,     66,  -4078,    104,     43,    105,   -126,
-       181,     43,  -1655,    -81,    -11,     33,    -33,     33,
-        28,    -44,     35,     -6,    -38,     68,    -40,     67,
-        73,    -29,    171,  11982,     42,     -8,    -66,    -66,
-        40,    -19,     14,     33,    -63,     24,     94,    -94,
-      -106,    584,    330,   -108,  -3841,    782,   -300,    -11,
-      -303,   -174,   -217,     -3,     24,    168,    187,   -166,
-        54,    238,   -269,    -27,    182,     -4,    -72,    -47,
-        32,     39,   7622,    -46,    -67,    -53,     56,    123,
-       -50,     69,    -36,   -275,    628,    -55,    195,    -56,
-      -265,   -132,    -39,     -4,    169,    113,   -180,    -19,
-        88,  -6427,     42,   -257,   1180,    359,    335,   3821,
-       116,     79,      3,    -93,     67,    -44,     58,    -16,
-       265,    172,    -39,    -44,     18,     92,      4,    218,
-       122,  -2993,    150,    138,    618,     66,   -618,    402,
-      2227,     10,     38,    308,    338,    -70,    265,   1047,
-      -104,   -182,    305,   -162,    -99,    510,    -20,   -114,
-       529,    -42,  -3569,     52,    -80,   -314,    716,    -31,
-       259,     59,    -73,   -117,     38,    -44,    -16,    -74,
-     -5060,     35,     10,    -30,     54,    217,     36,   -205,
-};
-
-static const int16_t cb0808s0[] = {
-     -2191,   -865,  -1906,   -251,    274,    594,  -1214,    677,
-       482,  -1176,     43,  -1098,   -203,   -537,   1834,   1332,
-       308,    432,   -191,   3091,   1892,    926,   -446,  -1206,
-      -613,    198,    575,    -38,    264,    375,    278,   -691,
-      -107,     17,   -239,    261,    848,   -620,    183,    624,
-       122,   -358,    -50,   1017,  -1075,   -705,   -346,    337,
-      -121,    100,   -218,  -1051,   -463,  -4728,   -513,  -1151,
-       737,   4356,    684,  -1374,   1630,    521,   -520,    -52,
-        90,    119,    -43,   -131,     24,     -2,   -184,    -65,
-       614,    371,   -448,   -414,   1415,   -687,   -224,    584,
-      -768,  -1210,   2941,  -3057,    132,    406,   -952,    291,
-       295,   -798,    608,  -1476,   -516,     21,   -302,   2085,
-     -1700,  -2655,   -355,    175,   -409,    662,     46,   -247,
-      -201,   -580,    179,    -54,    458,    836,   1543,   1829,
-      -282,   -278,    412,   2422,   2077,    197,   -897,    451,
-       595,   1547,    538,    825,    563,    443,   -576,   -854,
-      -572,    241,   -471,    201,   -311,   -529,    112,  -5128,
-      -173,   -233,   -435,    340,    158,    -41,    273,   -224,
-       919,  -1570,   1075,    265,   -282,   1256,   1007,    231,
-       720,    417,   -401,  -4589,   -747,   -453,  -1112,     54,
-       156,   -561,   2746,   -422,    -83,    -91,   -381,   -270,
-     -1226,    987,   -965,    625,   -474,    565,   2890,    -85,
-      1291,   -280,    626,    -26,    840,   1122,  -1915,    780,
-      -702,    792,   -578,   -122,     -9,   1175,   -194,   -571,
-      2940,    540,     31,   1817,   -352,    264,    953,  -2035,
-       238,   3250,  -1561,    653,   -331,   -393,    827,   -382,
-       323,    281,  -1339,   -819,    545,    207,     14,    338,
-       432,    860,   1691,    142,    711,    381,  -1151,   4164,
-      -867,   -241,    111,   -513,   -863,     78,   1453,   -363,
-      -128,   -232,  -1853,   2373,  -1156,    210,    698,   1134,
-      -869,   -177,   -352,   1514,  -1370,   -789,  -1193,    819,
-       348,     80,    492,    179,   -909,    591,   -600,   -377,
-     -1709,     59,   -539,    557,    -45,   -362,    778,  -4919,
-      -647,    203,    865,   -313,   -257,    173,  -2415,   1005,
-     -1771,    843,   -474,   1619,   1193,   -186,    305,    636,
-      -662,   1976,    546,    -82,   -108,   -751,    850,    521,
-     -1625,  -3135,   -388,     64,    249,  -1189,  -1552,   2629,
-         2,   -221,   -105,    754,    251,    219,   -270,   -202,
-       545,    147,   1019,    108,  -1358,  -1317,   1362,  -1323,
-     -3322,   -405,   -371,   -554,   -334,    296,    493,    248,
-        -4,   1340,    123,   -584,   -804,   -766,   -164,   -470,
-       295,    218,     -3,     62,   -194,   -657,   5016,    280,
-        -4,    -69,   -281,   -994,    209,    307,   8648,    -37,
-      -138,     45,   -329,   -101,    -65,     98,     58,    714,
-        56,   -170,     60,   -203,   -248,    103,    107,   -408,
-       596,    170,     61,    584,    727,   -434,   -181,  -5116,
-      -502,    494,     52,     83,   -105,    325,     68,   -561,
-      -274,    371,  -1833,    -78,  -2990,    320,    141,   -748,
-      1764,   1157,   -538,   -276,  -1594,   -152,    838,    -45,
-      1137,     13,   -803,   -162,   -838,  -1199,   2003,    580,
-      3687,   -844,   -552,   -271,   -462,  -1034,    -29,    273,
-       862,    269,     95,    186,   -222,   -124,     79,    -34,
-      -684,    808,  -1061,   -916,    610,    539,   1289,    782,
-      1216,   3213,    -38,   -546,  -1209,   -398,     98,    -39,
-        58,  -1271,   -611,    573,    499,  -2170,   -157,   -943,
-      -595,    436,   1203,    487,  -1419,   -570,   1468,    711,
-      -589,   -101,   3299,    -45,  -1432,   -453,   1820,    677,
-      1052,  -1793,   1071,   -400,    268,   -464,    443,    508,
-      -273,   -736,   -233,    270,  -1187,  -1931,  -1208,   -519,
-      -879,    325,   1032,    280,    565,    294,   2588,   -303,
-       640,  -1398,   1070,    674,     57,   -165,    -46,    512,
-       757,  -3471,   -812,   -854,     45,    101,   3195,   -786,
-       -61,    122,  -1234,    -74,    119,   -389,    254,    -84,
-       829,   1465,   -930,    171,   -248,    201,    939,      1,
-        52,  -3517,  -1854,    147,   -843,    310,    502,    729,
-       191,    525,    333,   -669,  -3358,    215,    552,    156,
-     -1771,    982,   -746,    523,   -187,   -684,    456,    123,
-     -1544,   -145,     58,  -1083,  -1646,  -1309,    775,   1436,
-      1409,  -1114,   -171,     26,  -1775,   1103,   -392,  -2053,
-     -1221,    100,  -1120,     25,   -295,    306,   -105,   -514,
-     -4362,    156,  -2172,   -191,    -90,      7,    -62,    244,
-      -107,    521,    309,     22,   -663,    239,   -213,   -226,
-       100,   2228,   -330,   -197,  -1247,   -876,   1561,     -1,
-      -354,    439,   -163,   -318,    -61,  -1184,  -3022,   1434,
-        65,     87,    806,  -2093,   3016,   1022,   -779,   -391,
-       -18,  -1371,   -548,    910,   -910,   -438,    673,     48,
-      1028,    548,    153,   -337,    554,    353,   1686,    468,
-      -190,   -113,   -560,    542,     94,   -140,   -194,    -58,
-       165,   -154,   -311,   4744,   -148,     49,   -253,    180,
-       -65,   -125,   -139,    -49,   -115,   -270,    439,    139,
-       210,    202,   -207,    -65,   -477,    168,  -4720,    -96,
-     -1091,  -2071,   -567,  -1330,    237,    411,   -123,   1197,
-      2625,   1348,   -230,    362,   -147,   -139,   -699,   1210,
-      -299,     92,   2835,    -36,   -296,    287,   2426,  -1171,
-      -218,    884,   -320,   1130,  -1085,   1177,   -953,   -776,
-       609,    827,    -90,    131,  -2757,    567,    885,  -2359,
-       955,   -200,  -1883,    131,    282,    -80,    141,     -8,
-       -33,    333,    809,    357,    -13,    499,    597,    923,
-     -1725,  -1533,    465,    -93,   2187,   -841,    751,     74,
-     -2158,     99,  -1078,   -459,    648,   -258,    349,   -917,
-      1200,    374,  -1741,  -1013,    724,    -61,    182,   4032,
-      -581,   1123,   -400,   -459,   -443,   -316,      3,   -271,
-      -248,    -17,    595,    206,  -1188,   2869,   1338,   -253,
-       316,   -474,   1680,   -856,  -1487,    547,    679,    425,
-      -258,     92,     -4,    -24,    117,   -157,    385,   -257,
-      -332,  -5597,    -68,   -329,    -65,   -108,   -277,    202,
-      -400,    124,    -51,      5,     71,     90,   -927,    966,
-       780,    305,    703,    802,  -1661,  -1415,    -66,    437,
-      -610,    317,    795,    599,   -189,    322,   -519,  -4010,
-       729,   -620,  -2127,    351,    506,    -68,    162,   -983,
-      -288,   3167,   -140,    991,   -599,    128,   1868,     64,
-       -63,     -1,   2047,    155,   -871,   -130,    226,    508,
-       499,    882,   3762,   -383,    -23,      0,   -345,   -488,
-       167,    648,    395,    114,   1121,    343,    232,   -538,
-        15,    342,   -820,     38,    435,   -468,   -282,   -415,
-     -5021,   -293,    147,    533,   -128,    -70,    503,    844,
-       -86,   1836,  -2103,  -1143,    -70,   -510,    576,   -689,
-       410,  -2101,    433,    339,   -417,    820,    157,    173,
-       454,   -586,   1219,    -73,  -5123,    344,    397,     53,
-       105,    501,    -59,    515,    194,    356,     78,    706,
-       303,    332,   4532,    739,    961,   -521,   -392,     20,
-      -697,    823,    607,   -243,    332,    365,   -330,    307,
-       429,   -865,     -8,    545,     -3,   6041,   -310,    272,
-       464,     22,   -156,    142,    -63,    -87,    297,    -24,
-       562,     -9,    147,    341,    -21,    119,   1386,    947,
-     -1738,   -500,   -655,     95,     32,     32,    187,    518,
-      1330,     95,   -324,   3620,    737,    -54,     55,    670,
-     -1252,    995,    484,   1347,   -745,    244,    262,    -83,
-      -122,   1194,   -653,  -1111,   -327,   -325,   3579,   -214,
-       -37,   -412,   -267,   -377,    -62,    131,    360,    203,
-     -5713,    -42,     94,    279,    406,   -355,     34,   -144,
-       156,   -256,    -48,    -98,  -1392,   1273,    202,  -1249,
-     -3457,   -710,   1007,     37,  -1788,     86,   -570,    535,
-        17,   -369,   1640,    816,   -117,    128,   -969,  -1381,
-       224,   1519,   -996,   -833,    931,    185,    804,    465,
-        82,     69,   -247,   3312,   -430,    -23,    173,   -223,
-      3080,   1848,  -1187,  -1494,   -485,  -1131,    496,   -517,
-      -596,    320,   -853,  -1303,    240,   -298,    159,    527,
-      -257,    412,    839,  -1020,    706,  -3499,   -175,  -1089,
-      -717,   -325,    261,    310,  -1740,  -1035,   -403,   -229,
-      -861,   -970,    -62,   -192,    535,  -2154,   -364,  -1133,
-       979,  -3299,    353,    982,   -517,   1144,   -563,    675,
-       285,     63,     17,  -1957,     82,     28,   -513,    501,
-     -1183,   1476,   -813,   -254,  -1584,  -1181,   -426,    -56,
-      -916,    203,  -2693,    209,  -1066,  -1174,    279,    439,
-       201,   1179,    797,    407,    851,    927,    316,   -640,
-      1398,   -128,   2741,    563,  -1789,    989,    932,    247,
-         6,   -617,    268,   -691,   1112,   -569,    883,    298,
-        37,   -362,   -661,    -17,   -154,   -574,    721,   4578,
-       205,    507,     77,    -90,   -433,  -1613,    270,   -500,
-     -1061,   1634,   -388,   -432,   -648,  -1985,    629,   2887,
-      -201,    -32,    223,    621,    143,    446,   1384,   1109,
-       299,    329,  -1002,   -356,   1504,    -77,     49,    952,
-      4166,   -544,    -85,   -412,   -249,    474,     27,   -107,
-};
-
-static const int16_t cb0808s1[] = {
-      2632,   1511,    944,   -180,  -2377,     54,   -470,   -187,
-      -710,   -998,   -516,   -916,   -440,   -842,    285,     22,
-      -282,   -459,   -299,  -2769,  -2285,   -380,  -2194,    801,
-      -595,   -252,    504,    -69,   -752,    972,    639,    277,
-       502,    117,  -1072,   -145,   1462,   -528,   2165,    880,
-      -182,  -2953,    750,  -1090,    596,    105,    187,    555,
-      -153,   -113,    830,    161,    308,    -44,   -250,    -58,
-      -507,   -406,   -626,   1453,   1357,    116,   -456,   3242,
-      -607,     94,    390,    393,    114,   1069,     -2,      2,
-      2497,   1405,   -755,   1353,    192,   1288,   -187,    262,
-      1722,     91,    885,   -622,   -321,    246,  -1835,     17,
-       213,    -80,   -658,  -1940,    275,    845,   -365,    276,
-      2142,   -216,  -3402,   -646,    549,    -78,   -176,    -52,
-       785,  -1335,     44,    163,   -409,   1273,    679,   -377,
-       788,  -1355,  -1721,    332,    223,   1409,   -104,    165,
-       354,    322,   2414,  -1611,    216,     -6,   -232,  -1770,
-     -1931,   2496,   -530,    228,   -924,   -173,   -329,   -575,
-     -1709,   -900,    199,    223,    690,   -636,     73,   -367,
-       460,   -823,  -5105,    435,    957,    224,    246,    406,
-      -673,    752,    412,   -158,   -267,      4,    694,     10,
-       -45,    219,   1040,    778,  -1910,   1886,   -691,    674,
-      1085,   -537,    376,   1048,    858,   -161,    613,    376,
-       535,  -1349,  -1913,   -518,   -850,    665,    772,  -2985,
-       -66,    -42,   2142,   -848,  -1151,    237,   -211,   -161,
-     -2753,    603,    507,     39,   -575,    -61,  -1053,   -273,
-       290,   -258,   -162,    139,     95,    -12,   -201,   -236,
-       709,   -328,   -314,   -130,  -5337,    100,    -18,    -97,
-      -206,   1827,   1722,    302,    924,   -203,    761,   -715,
-       -24,    372,   -600,   2115,   1197,  -1406,    676,  -2068,
-      -167,   -221,   -936,   1419,    353,   -317,    245,  -2890,
-       623,    265,   -622,    204,   2549,    596,    239,    -25,
-      -672,    583,    117,    -13,  -2251,  -1325,   1984,   1431,
-     -1335,  -1268,    735,    245,    105,    593,   -193,   -614,
-       909,   -339,  -1033,    383,    102,    363,    732,   1439,
-      1028,   1275,    442,    987,  -3901,   -257,    -36,    224,
-      -116,   -402,    200,   -596,   -125,    372,   -572,    398,
-      -543,   1024,   1746,   -736,  -1056,  -1736,    953,   1026,
-      -965,    442,  -1565,   -448,    -96,   1498,     30,   -231,
-      -483,     73,  -3185,   1765,   1313,   -100,    477,   -198,
-       782,    316,    364,   -107,   -431,  -1795,   -244,    122,
-      -423,   -385,    457,   -872,   -535,  -1098,     80,   -110,
-      1420,    646,     33,  -3226,    648,    861,    328,  -1269,
-      -558,    495,    881,    112,    479,    170,   -309,   1904,
-     -1412,   -768,  -1220,    -34,    995,   -649,    162,      1,
-       153,    985,    762,   -263,   -188,     77,    760,  -2346,
-      3430,   -450,   1677,   1090,   1771,   2109,    -14,   -119,
-      -995,    268,    141,     33,     35,     31,    537,     65,
-      -345,     69,    192,    763,    -18,   1078,   3829,    274,
-       442,   -173,   -412,    434,   -695,    924,      2,   1551,
-       566,    -85,    217,    976,   2196,   -503,  -1401,    759,
-       922,  -3024,   -963,     -3,    600,   -452,   -193,   -787,
-         7,    186,    828,    515,    148,   -225,  -1250,   -985,
-       443,   -511,   2037,   1560,   3230,    647,   1418,   -165,
-      -261,   -369,    224,    450,   -100,   -271,   -122,   -511,
-      -691,  -1444,    906,   -144,    248,    452,    957,    -70,
-      -517,    116,  -3559,   -877,   -399,    418,  -1300,   -415,
-      -177,    770,  -2566,   -371,  -1673,  -1042,   -500,   -290,
-      -708,   -631,    193,   2494,    319,    545,    767,    102,
-       231,    -43,   -139,    -97,   -700,  -1592,    282,   1325,
-     -1419,   -647,    449,   1995,   -737,    661,   1617,    725,
-     -1464,    615,    906,    202,   -154,   -228,  -2194,   -231,
-       299,    110,   1318,   1053,   -312,    843,   -937,  -1697,
-      -592,  -1224,   -633,    -50,    792,   1600,  -1187,   -171,
-       211,   -744,   -306,    186,   1914,  -3119,   -904,   -159,
-       178,   -596,   -654,    817,     94,   -242,  -2376,   -218,
-      -421,   -365,   -699,    177,   -427,    -32,    265,    -33,
-       245,    -34,   5309,   -307,   -262,   -299,     86,    278,
-        33,   -200,   -180,    -56,    337,   1034,   -229,   4952,
-       306,   -609,    189,    -22,    280,   -160,   -507,    135,
-     -1265,   -252,    434,   -427,    158,   -546,   -130,  -2500,
-       597,    908,    918,    706,   1227,   3390,    995,    298,
-      -558,   1307,    765,   -144,    -37,   -286,    122,    215,
-     -1251,   1090,     85,   -914,    522,    316,   1829,   -701,
-      -365,  -3311,    312,     22,    680,  -1351,    220,    243,
-       166,    -36,    780,   2395,    -64,    836,   1037,    735,
-       966,    173,   1114,    192,    510,  -1054,   1341,   -616,
-      1559,    897,    338,     -3,   -194,   -214,   -573,   -265,
-       328,   -365,    433,   -505,    -86,     33,   -156,   -129,
-      -137,    119,    143,   5773,    -76,     68,    820,   1215,
-      1315,    713,     12,   1590,    131,   -193,   -881,   -227,
-       736,    581,    736,    -37,   -434,   -449,   -348,   4189,
-      2180,  -1360,  -1663,    -74,   1215,    278,   2092,    -66,
-       313,    388,  -1373,     25,    599,    888,    -87,    293,
-        30,    367,   1010,   -883,    818,   -910,  -1918,    864,
-       482,   -968,  -1249,    222,   1100,     23,    -87,   2493,
-      -248,   -622,    240,    151,    873,  -2735,   1325,   -700,
-      -411,    282,  -2361,  -1843,   -631,   -208,    103,   -411,
-       831,   -446,   -292,    450,    184,   -158,    484,  -1964,
-      4663,    123,     18,    174,    621,    158,   -788,    233,
-       302,    441,   -339,    200,    -62,   -197,     -9,   -236,
-       984,    584,   -521,   -373,   -205,    910,    392,    850,
-     -2968,     68,   -727,   1330,    578,     36,   -385,    754,
-      -538,    -36,    271,    418,   -548,   1775,  -1045,   -879,
-     -1407,    524,  -1085,  -1479,    371,     19,    873,    171,
-      2932,   -216,     42,     71,  -1187,   -570,   -524,    344,
-      -770,  -4086,   -735,   -515,   1055,   -551,    945,  -1408,
-       913,  -1005,   -222,   -443,     60,   -194,   -734,   1908,
-      -534,  -1351,     72,   -938,    -66,  -2756,   1313,   -169,
-     -1550,    450,   -610,    893,   1100,   -583,     87,   -145,
-      -210,    281,   1402,    674,      0,    -38,    874,   -363,
-      2436,   2156,  -1659,   -481,   -130,    -63,   -669,   -316,
-      -761,   -413,    108,   2362,    354,     76,  -1725,   -924,
-     -1443,   1251,    871,  -2058,    518,    955,   -283,    680,
-       -85,   -560,   -464,    127,   -216,  -1382,   1908,    238,
-      -182,    459,  -1227,   1144,   2266,    -96,    595,   -750,
-       912,   -198,   1786,  -1423,   -618,   -450,    185,  -1212,
-       706,   -689,   -154,   -365,   -681,  -1378,    914,  -1200,
-      -253,   -532,   3244,    444,      1,    -96,   -404,    -64,
-      -412,  -1400,  -2830,   -785,    940,   -217,    358,    618,
-       208,  -2974,   -365,    -32,    -63,   -233,   -868,   -413,
-       358,   -451,   1310,   -751,  -1329,  -2480,     63,    458,
-      -273,   1270,    316,     93,   -453,   -463,  -1258,    -57,
-     -1073,  -2037,     46,   -160,   4609,  -1193,    192,   -355,
-      -963,    -92,    752,    593,    102,    -80,   -121,    166,
-      -606,   -274,     28,    258,     45,    -45,    928,   -949,
-      -134,   -268,    -77,    242,   1623,  -1290,    739,    109,
-       285,    175,    -92,  -4053,   -482,    366,    217,   -126,
-      -843,    950,  -1068,    777,   1818,    550,   -891,    -34,
-      -995,   1976,   2677,   -764,     45,    -40,  -1800,    569,
-      -323,   -102,  -1064,   4000,   -109,   -423,   -289,    738,
-      -872,    808,   -977,    504,   -901,     41,    -45,   -287,
-      -140,   -444,    477,   -271,   -876,    301,  -2421,   1633,
-      -918,   -660,   -149,  -2542,   -503,   -265,   -107,   -623,
-      -447,   -782,   -858,   -535,   -220,    442,    661,   -209,
-       878,  -1601,   3610,    149,   -331,    190,    102,    270,
-      1451,    237,     13,  -1026,    178,   1290,   -281,   -217,
-        11,  -1728,   1043,  -2992,   -718,   -776,    357,   -615,
-      -231,    813,   -473,   1634,    539,   -513,    240,   1158,
-       144,     57,   1249,   1479,   -481,   -733,   1663,   -757,
-       641,    680,   -468,  -2697,    -29,    -62,   1253,   1142,
-       292,    245,    -96,    295,   -664,   -264,   -308,   -670,
-      -705,    155,  -4024,    330,    191,    -77,  -1502,    326,
-         9,    295,   -567,     34,   -104,   -123,   -320,   -255,
-      1124,    320,     98,   1299,   -436,   1491,   -341,    908,
-        11,      8,    988,  -1921,      5,  -1391,    859,  -1291,
-      -581,    546,    -95,    272,   -441,    185,   -256,    313,
-       466,   -393,    -50,   4430,   -940,     87,   -224,    390,
-      -539,   -290,  -1046,    531,  -2329,   1275,   -586,  -1046,
-     -1682,   1159,    908,   2023,    951,   -273,    -68,    713,
-      -556,    770,    783,    223,     60,   -881,    -97,    760,
-       556,   -237,   -263,   -246,   -240,    165,    526,    832,
-     -4761,    432,   -339,    186,    492,     81,   -136,   -827,
-      -390,  -1026,   -371,   -292,    937,   -243,   -136,      6,
-        49,   -223,   -600,   -355,   5306,    140,     34,    -84,
-};
-
-static const int16_t cb0808m0[] = {
-     -3555,   -106,   -131,    -53,   -156,    196,   -206,   -104,
-        18,  -2948,    122,    146,   -520,      2,    294,   -419,
-        -1,    -25,   -257,   9334,     87,    -55,    -42,     30,
-        92,     35,    195,     31,     59,     88,     47,     47,
-      -220,    564,  -1686,    426,    106,    396,     97,   1315,
-      2331,    167,  -1261,   1003,    732,   -300,   -342,    418,
-        87,    236,   -245,   2235,     11,    725,    -24,   -169,
-      -480,   2845,     96,    -34,     67,    857,     28,     50,
-        92,   2100,    -84,   -600,  -1990,  -2208,   -163,    299,
-       431,   -825,   -283,    299,    -98,    391,    -65,    -92,
-      -200,   -689,   2236,    -82,    -81,    -52,    127,     86,
-      -137,   -319,  -2561,    -90,    547,   -198,     10,    195,
-      -366,  -2688,    -77,   -234,   -112,   -245,    270,    199,
-      2674,    -57,   -673,     -9,   1029,    -31,    311,    -50,
-      -160,   -175,   2371,   2711,    409,    -19,     22,   -244,
-       312,   -158,    270,   -125,   -247,    118,    -91,   -602,
-        86,    174,   -216,     18,   3048,  -1953,    171,  -1985,
-      -297,    295,    -38,   -198,   -229,    363,    -13,    127,
-        13,   -202,   -117,     65,     74,     63,    125,    -62,
-        -2,   -543,   -680,  -4269,   -130,    325,    -49,   -245,
-       -50,   -509,   -151,    -19,      3,    152,   -980,   -129,
-      -234,    399,    349,    171,   -196,   4952,     -2,     36,
-       288,    771,   2313,    231,    -39,    572,  -3012,     77,
-      -501,   -215,   -228,   -444,    830,    200,   -188,   -157,
-      3248,    279,  -3319,      0,     76,     10,    160,    -80,
-       135,    102,   -349,    174,    -30,    -88,   -145,   -205,
-        10,   -185,    177,    -34,     25,     31,    218,     -4,
-       191,    172,    228,   -136,   -178,    268,    638,   3559,
-        55,    198,    145,    342,    -25,  -1940,   2866,   -334,
-      -921,   1941,   -464,    273,   -181,   -506,    -21,   -410,
-       116,   -179,    -49,   -273,    -22,    -36,  -1298,    274,
-     -1831,    321,   -382,    238,  -3464,    -68,   -194,     32,
-       -95,   -506,     72,     64,   -329,     19,    -39,    347,
-      -302,    204,    145,    -72,    855,   -112,  -3596,    989,
-     -2801,    386,  -2623,   -471,    101,   -155,    257,    291,
-        30,   -153,    185,    172,    511,     20,    166,    274,
-        29,  -3023,    129,     33,   -219,   -205,      6,     47,
-      -407,    137,    563,   -106,  -2065,     76,    201,    -99,
-      -170,    -77,    170,  -4536,   -440,    -96,   -940,  -1066,
-        81,    205,    358,    435,    -78,   -148,   -201,    -85,
-      -307,   -306,     14,    -47,   -101,   -187,   -136,    380,
-        -4,    -32,    -34,    -54,    528,    -58,   6389,    302,
-       -79,     52,    -28,    -65,    -77,    -12,   9024,   -100,
-       262,     20,    -67,    -31,     50,    -33,    -30,   -140,
-       326,  -1170,   -304,   -136,   -233,    170,     60,    314,
-      -166,   -208,   -105,   -245,   -169,    -72,    137,  -7173,
-        -2,    375,    152,    226,   -206,   -341,    303,     47,
-      1010,   -188,    577,   -292,  -3581,    -12,   -195,     20,
-      2165,   -206,    -88,    -83,   -132,    -40,   -443,    236,
-      -333,    179,   -211,    -56,    318,   -409,   3106,     95,
-     11636,    340,    204,   -323,    167,     76,     61,     65,
-      -157,     71,    -21,     38,     66,    391,    -52,     20,
-       -17,     11,    259,     45,   -194,    440,   3432,    122,
-       468,   -595,  -1856,     94,   -427,   -133,    149,   -273,
-        61,  -6622,     48,     97,   -162,     93,    402,   -104,
-      -207,     64,   -278,     92,    387,      3,     96,     -2,
-       -27,    -30,     84,     64,     35,    -65,     98,     85,
-       -16,   -248,   7930,     74,      4,   -104,     83,    -48,
-        40,  -2104,    -86,    -89,     99,   -142,     65,  -2713,
-        63,   -431,    523,    687,    212,  -1515,      3,     59,
-        55,     -6,     22,     -8,   -148,    180,     78,   7833,
-       -63,    -83,     13,   -187,   -116,    156,    -29,   -186,
-      -160,    148,    -82,   -303,   -166,    112,   -103,    -39,
-      -165,   2827,    -54,    -26,     24,  -3055,     78,     21,
-       128,    -81,    -25,   -122,     51,    -54,    -19,    188,
-       -18,     -1,   -140,    -18,  -8085,    124,    -46,     45,
-      -574,     12,   -150,    147,     65,   -209,   -396,   -444,
-     -3882,   -291,   -231,    296,    244,     76,    180,     36,
-     -2575,    659,    -63,   3277,    -85,     48,   -518,   -353,
-       130,     50,     13,    338,   -343,   -276,    -16,    353,
-     -6036,    -77,     18,    139,     43,    335,    294,     99,
-       219,    442,    -25,    -53,     40,    271,    175,   -282,
-       -91,    430,  -4428,    -15,  -2857,    -62,    -27,   -170,
-        33,   -681,   -110,    -76,    153,     42,   -134,   -145,
-       222,   -177,    -39,    314,   2270,    526,    500,   2417,
-       339,   1808,    -17,    464,   -525,    -97,    124,    -32,
-       370,     48,  -1675,    -62,   -169,   2642,   2511,    -43,
-     -1037,   -184,     54,   -569,   -504,   -247,    -40,    327,
-         7,     82,   -197,   2774,    -34,  -2931,   -204,   -112,
-       194,   -362,    187,     65,   -166,    115,   -125,     14,
-       210,    144,    -75,     57,   -255,   -151,  -3566,   -153,
-       182,     89,  -2530,     98,   -265,   -173,   -133,    260,
-       -25,  -1292,     35,    131,    -98,    -85,   -237,     82,
-      1353,     47,   3842,    148,    171,    183,    234,     89,
-       -93,     47,    102,     -4,     90,   2980,    289,   -231,
-       353,    497,   -109,    190,  -2869,    697,    136,     90,
-      -244,    298,   -119,   -519,    -50,    207,    -43,  -1376,
-       356,   1934,    701,  -2323,    671,     71,    -56,   -167,
-     -3793,  -3749,   -103,    134,   -228,    -13,     27,    -45,
-      -105,    172,    -77,    -23,     53,    110,   -118,    -80,
-      -164,   -192,   -563,    393,    -58,   -428,   -360,   3696,
-       162,   -173,   1683,   -430,    452,    -92,    107,    -41,
-        28,    -85,    421,    -66,    354,    -88,    723,   2751,
-     -2955,   -481,   -134,   -231,   -145,      3,     65,    -88,
-       189,    187,    151,    174,    -36,    240,   -253,   -235,
-      -194,  -5410,    -47,    -98,    338,   -487,    -81,    -35,
-       -82,   -440,     31,    109,    217,    276,  -1805,    278,
-       273,   -369,    629,   -293,   -525,  -3832,     73,    -56,
-      -363,   1709,    177,  -2813,    796,   -162,   -341,   1176,
-       -75,    533,    854,    719,    242,   -194,     90,   -147,
-       203,   -136,   -138,   -764,      6,  -2787,    -13,   1104,
-      1497,   1097,     90,   -867,   -718,   -317,    119,    180,
-       160,    257,   2532,   -557,    -62,     14,    665,   1520,
-       456,    826,    394,   -605,    908,    222,   -140,    121,
-       121,    232,    124,     96,    -87,     48,    -51,     41,
-     -7821,    -37,    130,    -11,    -33,   -137,     16,     42,
-      1509,     -8,    119,    -83,    -18,     64,     41,   -178,
-       -28,    182,    532,    678,    -75,    277,   -230,    -70,
-       -71,     -8,   -150,    321,  -6298,    -20,   -131,    -65,
-       139,   -215,   -155,    -27,   -110,   -257,     32,    201,
-       215,    184,   8932,   -106,    -50,     66,     15,    -44,
-       203,    -38,     19,    -78,     65,    135,   -123,    166,
-       117,     76,      4,     34,    -90,   5984,     59,    -72,
-       356,    -64,      6,    -62,     43,    -86,   -175,   -106,
-        10,     25,   3812,   -135,  -3313,    142,    348,   -101,
-       -35,    378,   -250,   -106,   -299,    237,     40,    -32,
-       236,   -521,     63,   -143,    538,   -256,     43,    -45,
-      1642,    726,  -3225,    109,   -997,      3,   -256,    -27,
-      -182,    -78,  -4092,     -9,    231,     34,      9,     -6,
-       155,   2842,     53,   -130,   -390,   -146,    168,    -74,
-     -2023,   -955,    576,   -629,    -76,     70,    140,   -287,
-      -401,    966,    359,   1185,   -226,    713,    753,   -739,
-     -4238,   3364,     75,   -213,     27,   -172,    -34,    171,
-      -118,    -46,   -164,    -13,    -54,   -203,   -154,    -12,
-        65,  -3777,  -3452,    297,   -104,    -93,    -81,     69,
-      -179,   -321,     51,     47,    242,    -15,   -144,    -43,
-      2827,     67,   -305,     54,  -3044,     57,    -15,   -427,
-       311,   -205,    226,   -490,     37,    363,    -88,   -408,
-};
-
-static const int16_t cb0808m1[] = {
-      3329,     59,    195,    -91,    -70,   3262,   -132,    360,
-       157,   -410,    184,    -99,   -138,    337,    289,    317,
-       156,   -589,   -127,   -204,     37,   -175,  -5661,    -52,
-       942,    156,     -1,   -197,    353,     90,     57,   -287,
-      -218,    438,     -4,   -262,      9,    322,   -167,   2904,
-       -12,  -2647,   -248,   -203,   -267,   -116,   -135,    333,
-      -220,   -200,     40,    228,   2677,   -462,   -183,   -129,
-      2898,   -728,    793,    422,    541,   -350,     28,    222,
-      2790,   -231,   -195,   -191,   3002,    182,   -610,    145,
-      -226,   -102,    285,    344,   -357,    217,   -146,    -98,
-        18,   -255,     96,   -151,    266,    208,   -459,   -132,
-      -345,   4059,   -371,     79,     44,    -63,   -233,    334,
-        44,   3884,     49,  -3303,     88,    -23,   -287,   -461,
-        57,     94,    -53,   -129,    104,    167,    -25,    -79,
-      -125,   -630,  -2352,    150,   -419,     40,    -63,    603,
-        67,    209,    321,  -1765,   -200,     68,    473,    622,
-         5,  -2883,    112,    188,   -189,  -2765,    169,    397,
-      -330,   -642,   -798,    129,   -110,   -164,    -20,    176,
-      -213,  -5415,     39,     31,     13,    270,   -477,    166,
-       167,      4,    216,    -12,   -528,    -75,   -291,    396,
-      -499,  -2011,   -172,   -265,     96,     83,   -279,    114,
-      -166,    833,     30,   2493,     94,    130,   -183,   -659,
-         1,   -227,     75,    349,  -2757,     82,   -116,      9,
-       952,   -112,  -2444,   -333,   -206,   -406,    201,     15,
-      -768,     88,   1390,    -33,   -558,     97,   -201,     29,
-      3470,     50,    -40,   -271,   -171,    -26,     47,    485,
-      -250,   3318,    112,    639,  -2911,    123,   -264,      3,
-         8,    379,     73,     54,     88,    227,     73,     58,
-      -572,    782,   -183,    305,     49,    -23,  -2968,    -41,
-       291,    -25,    157,    295,  -2118,    125,      5,   -193,
-      -159,   -543,    -75,   1181,   -191,   -547,    -93,    117,
-     -1831,    265,   -607,    -30,    194,  -3929,    -70,    159,
-        79,  -1519,     38,    201,     14,    -24,    -76,   -366,
-        14,  -2748,      0,   -372,    405,     39,   -170,    320,
-      -257,   2153,    -12,    158,    322,  -4013,     22,   -101,
-       217,    637,    273,   -430,    228,   -428,    102,   -356,
-      -266,     82,    -31,     14,   -223,  -2595,   -360,   2094,
-      -379,    624,   -192,    245,    294,   1484,   -117,    156,
-       -53,   3668,  -3573,   -118,   -213,    257,   -211,     66,
-       -62,   -173,   -166,   -123,    163,    -81,    -39,    -74,
-       -21,    126,    722,   -136,   2050,   -206,     86,    275,
-        76,   -249,     55,  -2508,     95,    -60,    -34,   -360,
-        -9,    187,     34,    -87,    -30,    137,     48,   4761,
-       109,    511,   -496,    104,    399,   -361,    162,     78,
-       -29,    159,   -112,    182,    246,     52,    255,    338,
-       -35,     -1,    -68,      5,    182,   7675,   -119,    -14,
-     -1901,   -111,   -106,     22,    -16,     81,    159,  -2423,
-       -71,    -24,   -153,   -520,    126,    370,   -186,    230,
-       -51,   -401,    206,    -32,     52,    -71,    -79,    503,
-      -239,   -231,     55,   -133,   5226,    -45,   -165,     57,
-      2314,   -209,    302,     78,    154,  -3092,   -605,   -498,
-       410,    159,    336,   -147,   -120,    143,     36,    587,
-      -182,   -182,   1457,   1008,   2524,   -446,   2333,   -497,
-      -761,   -162,    125,    420,    225,   -117,   -324,    437,
-       -50,    190,    129,    259,     33,     -2,     -9,     32,
-       -24,     91,     97,    201,     19,    169,   3535,    485,
-      -144,    330,   -193,  -2715,    603,    303,   1124,    107,
-     -1386,  -1437,   -203,    180,    -81,    303,    209,    -21,
-       -65,     26,     91,     98,  -1349,    196,   2103,    917,
-      -732,    834,   1456,    -92,   -455,   -130,   -732,   -288,
-        39,    -85,   -557,    -39,   3213,    297,    392,   -378,
-      -520,    795,  -2407,      6,      7,    406,    203,    -73,
-      -247,    317,  -3336,   3166,    206,    -36,    159,   -279,
-       442,     54,   -324,    -18,    544,   -250,    142,   -440,
-       100,   -145,  -3772,   -199,    139,   -156,    -11,     34,
-      -178,   -233,   -370,    601,    -58,   1679,   -170,     76,
-       684,    -35,    -73,    -52,    -33,     -3,    -89,     -5,
-       -82,     73,    -11,     51,    -48,    -12,   -376,   4348,
-      -203,   -432,    189,    -35,    144,     31,    181,   -106,
-     -5112,    552,    480,      0,     63,     31,     33,    504,
-      1055,  -3007,   -214,    154,   -100,    246,    269,   -423,
-       579,     63,   1668,   -296,    390,    109,     21,     -6,
-        71,   3321,    246,    197,    355,   -198,    472,    135,
-       437,  -1734,   1299,    227,   -618,    -48,   -199,    217,
-      -230,     70,     99,   2632,   -203,   3105,    -87,    149,
-       303,    124,    362,   -322,    -44,     38,    104,    -28,
-        48,   -175,   -468,   -410,  -4451,   -152,   2157,     26,
-      -281,   -581,     36,   -205,    101,    230,    192,   -129,
-       319,     20,     65,   4879,    123,   -236,   -178,   -128,
-      -387,   -124,    528,    142,   -775,   -301,    -88,   -380,
-       120,    -42,    -17,     64,  -1074,  -3350,   1335,  -1078,
-       -14,   -462,   -113,    253,    450,     36,     -8,   -346,
-       -54,     -7,     52,   -100,     74,   8266,   -193,    -36,
-       -51,     12,     59,    -68,    190,    -36,     89,     38,
-       -59,     13,    269,    109,    -15,   -141,    -64,    -60,
-       238,      6,  -4338,    381,   1252,    354,    -41,     41,
-       191,   -236,    122,  -2712,    352,   -117,   -121,   -284,
-      1516,    473,   -332,   -277,  -1792,   -335,     84,     64,
-      9595,   -246,   -278,    446,    -95,    -32,     60,   -146,
-       104,    -84,     -3,    107,   -116,   -377,    101,   -149,
-       -45,    364,    104,   -193,   -254,   2929,   -164,    -93,
-       324,    749,   -928,    435,   2357,    350,    -40,   -153,
-       -48,   -626,    390,    -48,  -4248,   -458,   -930,   -218,
-      -486,   1769,    335,    152,    165,    111,    118,   -407,
-       -87,   -373,   -333,   -134,     86,    -32,   -144,    -18,
-       -16,  -7549,   -146,     49,   -184,    116,    -28,    -51,
-       190,    115,     80,     68,    129,    206,    294,    331,
-       179,   -270,    174,   2444,     55,  -3271,     70,   -124,
-       228,    330,    -21,   -419,     62,   -140,  -2388,      7,
-     -2683,   -129,  -1050,   -548,    811,    189,    359,   -385,
-       -82,   9031,     95,     77,    -69,    164,    261,     61,
-       -73,    230,   -163,    141,    -38,    -43,   -150,    164,
-        28,    164,     59,    -58,   -312,   -134,    102,    -67,
-       166,   -163,     63,  -6795,   -103,   -147,     81,    273,
-       133,    122,   -162,   -207,    127,    -60,   4628,     -1,
-      1315,    518,   -163,   -246,     54,    239,    154,   -154,
-       265,   2000,     25,    227,     42,    179,     88,  -3446,
-      -214,    182,    438,     90,    196,    -69,    134,    -56,
-      -451,    716,  -1120,   -287,    118,    230,    -37,    145,
-       284,   -250,    139,   -947,    203,  -3176,    -57,    151,
-      3201,    818,    -87,    347,   -486,   -201,   1176,   -325,
-      -966,   -263,   -184,    238,   -156,   -396,    152,    959,
-       -59,    -33,   -159,     -3,   9394,   -119,    -81,    -50,
-        67,      9,     27,    -62,   -121,   -210,     48,   -211,
-         5,    396,    633,     34,    -16,     67,   -247,    -77,
-       128,    441,   3896,    251,    970,    119,   -387,    -35,
-       124,    -64,   -664,  -6550,    101,    -52,     19,     44,
-      -132,     79,    731,   -155,   -262,   -140,    -31,   -191,
-      -110,    276,   -162,    -49,     81,   -117,     15,   -570,
-       420,  -1232,   -125,   3737,    -95,    544,   -149,    463,
-      -129,   -345,    350,    183,    173,    197,    464,    180,
-      -249,   -365,   -785,     -9,  -3411,   -235,   -124,    225,
-     -4516,    196,   -150,    -89,    -89,     54,   -110,    137,
-      -431,    272,    -12,     -7,    114,   -201,    166,   1570,
-       -74,    -88,   6019,    350,    -75,     68,    -29,    -81,
-       -50,     57,    -62,    103,     61,    276,     22,   -131,
-      -134,  -3347,    -60,  -3397,   -311,   -105,     90,   -159,
-      -222,    151,    224,   -210,    264,    192,     29,    -84,
-};
-
-static const int16_t cb0808sl0[] = {
-        24,  -3148,  -3111,    106,     45,   -114,    -85,   -211,
-       154,    172,    246,    368,   -130,     58,   -135,     70,
-       102,   -150,    -76,     -7,     13,     -1,    -29,     20,
-        -7,    112,   -234,   -115,   -138,    -40,    106,    178,
-     -7276,   -537,     25,    856,    460,   3107,    146,   -520,
-      -631,   -118,    393,    179,    144,    -86,     47,     82,
-      3031,     28,    164,   -308,   -411,     72,    138,    378,
-       242,    253,     12,    158,    -28,    -60,    -29,    -46,
-        -5,    -11,     84,   2753,   -113,    -65,      3,      5,
-        13,  -5110,    -74,   -126,   -129,    -82,    -58,    116,
-        15,     68,    243,    -32,    126,    -48,     11,     -7,
-        75,     10,    166,   -153,      8,    -43,    -38,     81,
-       -41,     13,    100,     27,     46,   -441,    -56,     35,
-         4,     51,   7528,     52,   -141,   -153,     39,    -36,
-       -86,     80,    -35,     50,    -46,     23,    178,  -3986,
-     -3350,     59,   -278,     37,     -2,     14,   -157,   -208,
-      -317,    218,     15,   -296,    -32,    -51,     36,    -27,
-     -2062,     28,    -37,    322,   2286,    214,   -196,   -171,
-       -64,   -163,    265,    -50,      3,   -177,    -22,     68,
-       124,     37,    -15,  -2202,     60,    133,      4,    371,
-      2753,   -111,    480,   -446,    484,     43,    150,   -331,
-      1410,   -791,    123,   -136,   -192,    267,      0,    -89,
-      -105,    421,     68,   -126,     79,    279,    202,   -132,
-      -208,  -3345,   -105,     59,    118,   -647,    -48,    -12,
-       145,   -403,    200,      7,     -4,  -3192,   -223,     64,
-         0,    415,    366,    136,     49,  -7611,     79,   -105,
-       127,    -69,    -43,    103,    -95,    -93,    -10,    -30,
-        94,    108,   -109,      0,    -87,    -70,    300,    -93,
-       113,     25,    -17,   2263,     41,    192,     18,     73,
-       179,    129,    149,    -81,     -1,      0,    201,    184,
-       651,      8,     18,    114,   2820,    383,    -71,    376,
-     -2281,  -1190,   -143,    121,    -45,  -2157,   -410,     81,
-       -14,   1537,   -833,     29,   1150,   -494,     -8,    -14,
-       210,    188,   3073,  -1775,   -123,     80,   -103,    227,
-       296,    111,   1637,   -197,   1349,    174,   3276,     49,
-       -98,     74,    660,      3,   -252,   -356,     -9,    527,
-       -63,  -7995,    -16,     85,    249,     74,     26,      2,
-         3,     26,   -124,    -61,    -26,   -144,      4,    -52,
-         6,   -517,    -95,   2566,    -26,   -190,   -196,   -509,
-     -2982,      4,   -178,     -9,    -67,    -25,      1,    193,
-       -68,    -46,    -82,  -3734,    -14,   -339,    -44,   -151,
-        55,    230,     -3,    100,    -47,    -69,     35,    107,
-       127,   -175,    -11,    -10,   -158,   -140,   2934,   -132,
-      2571,   -158,   -217,    106,    137,   -222,     74,    -42,
-        64,    559,    122,     73,   -112,  -2964,   2502,     13,
-       301,    -41,    203,   -382,   -151,   -221,   -147,    -24,
-        83,     37,    -45,     56,     89,     71,    109,    -14,
-       -43,   -130,   -108,    -18,     74,    -23,    -34,     79,
-      7662,    -88,     70,     21,   -110,    147,     26,    250,
-        74,    165,     49,     43,     45,    -22,    -14,    293,
-      5275,     57,    -72,     93,     40,    115,   -139,   -332,
-        95,     92,    -26,     26,    169,    -94,    332,     71,
-      -482,    137,    190,    114,     14,    151,   3125,      6,
-       109,      6,      7,   1543,    282,    -24,     24,    142,
-        33,    123,     41,    -72,   -253,    -33,    309,   -107,
-       -64,   -131,     56,  -3528,     82,    -17,    417,    -47,
-      -588,    274,    155,    158,   -245,    186,    147,     -7,
-       -50,   -218,     12,    118,    -62,    652,    145,     64,
-      2473,   -146,    220,  -2973,     97,    284,     29,    268,
-        29,   -208,    -40,   -251,   -175,    -16,    -58,    -65,
-        28,     26,     55,     74,    -12,   1911,     43,    -82,
-      -150,    -13,   -119,      8,    119,    156,   1550,    -88,
-      -102,     46,    226,   -132,     95,    100,     87,      7,
-       -46,      8,    -32,    -16,    -12,    317,    -33,    -27,
-       291,    -88,    169,      1,   -101,    -61,    161,    162,
-       -33,     -1,     11,   5097,    -34,    142,     31,     94,
-      3619,    -94,     67,   3379,    -65,     28,    254,    189,
-       110,    138,    -41,     52,     32,   -104,    154,    172,
-     -2365,   -464,    281,    207,    -66,   -190,    399,   -158,
-        13,   -155,   -223,     92,   -108,    -25,    468,    189,
-     -4359,     42,   -135,    138,     36,  -1403,   -264,   -336,
-      -164,    -49,     54,   -125,    -61,     62,     16,    172,
-       182,   3134,  -1373,     63,   -227,   -106,   -133,   -165,
-       -69,    -57,   -184,    -46,      9,    -57,     50,     -3,
-       -62,    -15,   -123,    108,    111,     91,   -161,     23,
-       -81,      7,    208,  -5385,   -244,     24,     95,     12,
-      -264,     62,    -44,     21,   -240,   -299,    -12,    117,
-       -61,  -2551,    389,   2816,   -179,    203,   -421,    899,
-        -7,    174,   -200,     98,   1036,   -166,     11,   -137,
-        78,     -7,   -121,    245,    -77,    124,    102,     51,
-      3136,     74,   -310,     40,    212,   -239,   -373,   -154,
-       398,   2967,    654,    488,    103,   -230,   -330,    831,
-       -63,   -473,    152,   -556,  -2186,   -371,      4,     86,
-       -12,   -141,   5503,    -87,   -123,    -17,    -15,    154,
-       192,    -86,     97,    165,    352,     56,    154,     43,
-      -331,   1004,    -52,   -131,  -3311,      3,    110,   -153,
-       -70,    137,   -168,    -20,    115,    140,    -25,    -54,
-       -13,   -300,     57,   -131,    214,    261,    -92,    618,
-     -2752,  -3146,     61,    -51,    210,   -230,     87,   -184,
-       330,     22,    -19,   -107,   -477,    -39,      1,    127,
-       178,    -73,    425,     56,    -25,    -41,    135,   2423,
-        59,    -46,    -10,     49,   -116,    -51,  -2239,   -228,
-       -75,     48,      3,    181,    161,   -133,   -355,     81,
-         5,     84,   -222,    -83,     92,     33,  -7558,    -38,
-        -3,    159,     33,    -58,    -37,   -107,     16,    -61,
-       -94,     93,     97,     49,   -275,     29,   -198,     -4,
-       -68,     87,    116,  -7039,     46,     81,    -25,      0,
-        -7,    -46,    152,     64,    -40,   -143,    -56,    147,
-       403,    257,   2380,   -538,   -400,   -132,    -89,    -29,
-     -2878,    457,   -552,    -12,   -189,   -370,   -357,  -3679,
-       422,     63,    200,    116,     -9,   -229,    -72,   -100,
-      3346,     88,    -18,     28,    -47,    159,    108,   -160,
-       253,     58,   2938,     55,    366,    -33,  -3209,     31,
-      -148,    -10,    -40,   -443,    127,    120,    106,      9,
-         4,   -240,    200,    129,    328,   -102,    187,    182,
-       112,   2757,  -3260,    314,   -163,     -3,   -185,    354,
-       -97,    -69,   -199,     41,   -143,     19,    108,    -22,
-       -32,    -18,   -149,     35,     31,     -5,  -5083,     52,
-         9,      5,    -44,    -52,     76,      7,   -100,      7,
-       -79,      0,    -33,    110,   -208,     20,   -159,    -76,
-         2,  -8192,    156,    118,   -306,    -88,    136,   -293,
-      -176,    163,      8,   1871,   -112,    229,    311,    -95,
-       -75,     17,    217,    152,     62,     17,   -246,   3579,
-         5,    -87,    -21,     92,    114,   -185,    118,      8,
-       196,   -124,   -220,    175,    104,     54,    104,    -40,
-       -45,   -152,    392,    216,    -24,    -28,   2024,     -6,
-        42,    -91,   -201,     -9,   -192,     35,    -43,   1661,
-      -356,   1207,  -1322,    340,  -2937,    -16,    163,   -801,
-      -423,    197,   -512,    -70,    229,   -412,    291,    511,
-       -36,   -179,    -98,    -54,     93,     87,    263,    -44,
-       167,     77,     -4,   7278,   -101,   -193,     91,   -251,
-      -131,    269,     15,   -168,    -22,    -26,     44,     24,
-       154,    115,    -11,   -124,     28,     37,    -14,    -46,
-       -67,  -8192,    -51,   -169,     41,   -302,    -81,   1991,
-       -11,    136,   -175,     71,   -104,     89,     60,    137,
-        17,    106,     96,   -238,    -83,    -52,   -113,     53,
-      2903,    -47,      9,   -227,  -2784,   -245,    146,   -196,
-      -216,     41,     -6,   -128,    -53,      1,   -128,   -145,
-       149,     32,     25,    -57,    -14,     72,   -135,     10,
-     -1946,    -67,     74,   -127,    141,   -299,     55,      8,
-       947,  -2239,   -271,     74,   -227,    -81,     31,    291,
-       -86,  -2914,     22,     -7,    293,      2,    -25,      9,
-     -2997,     89,   3158,    192,    -46,   -246,   -140,     46,
-       287,    133,   -110,    308,   -114,    -33,   -106,      9,
-       -89,    105,    364,   -172,    185,    -61,   4464,    -92,
-      -264,    -66,   -161,    102,   -178,   -264,    -21,    114,
-};
-
-static const int16_t cb0808sl1[] = {
-       246,     -6,   -180,     90,    127,   3322,    598,    182,
-        81,     82,     67,    -39,     87,    -60,     -8,    -89,
-       185,     99,    -25,     27,      9,    -59,  -7421,     49,
-       -17,    116,    -85,      6,   -305,     88,   -164,     99,
-        61,   -415,   -114,   -288,      1,   -165,    -12,      5,
-      -143,   -142,   -521,   -245,    -53,     38,    -99,   3709,
-       -52,      0,    -41,   -135,    147,   -217,     62,  -2144,
-       255,    132,    264,     65,    -37,    204,   -338,   -280,
-       192,   -184,   -158,  -3685,    -26,    203,    430,    -29,
-       -16,     77,    230,   -311,    597,   2553,  -1126,    -63,
-       154,   -431,   -161,    315,    286,   -147,    177,     -3,
-        93,    449,    253,    -37,    101,   -244,    -77,     42,
-      -384,     22,     36,    235,  -4973,    243,   -120,   -105,
-      -226,   -114,   -455,   -404,    164,   -505,    476,   -124,
-     -2837,    -82,  -2920,     -3,      0,    134,    -94,    264,
-       -53,    -53,    108,     -3,   -845,  -2813,    228,   -179,
-       -60,     -2,     65,     33,   -153,    -16,   -149,  -2135,
-       209,   -929,   -288,    227,   2656,   -125,    -42,     17,
-        30,   3375,   -367,     53,   -262,   -351,    108,   -270,
-        11,    -57,   -182,    -51,   -149,   -287,   -115,    -24,
-        99,    -76,   6954,    -75,     -4,     38,   -168,    138,
-       109,   -239,    -45,     49,     28,  -1376,     49,     66,
-       -83,   -129,    -61,    -99,    135,     14,    -93,    111,
-        37,    -16,      2,    -76,    360,    -77,     82,    161,
-       149,  -1660,     18,     98,    -34,    -12,    -36,    -65,
-       126,    -57,     28,    519,   2044,    297,     73,   -218,
-        51,     17,     21,    -70,    -32,    -73,    -39,    -38,
-       -11,     60,     38,   -129,   -105,   -173,    200,      7,
-       124,    -74,  -2780,   2608,    -57,   -213,     54,   -200,
-       134,    208,    -34,    236,    143,    101,    327,    558,
-        75,    317,   3090,   -188,    544,   -186,     15,    116,
-       237,     76,   -105,     29,   -300,    -27,   -211,     71,
-      -144,    183,    -77,     38,    -16,     39,     56,  -7308,
-      -113,   -116,    -32,    222,     60,     76,    -21,     59,
-        52,    104,    383,     73,    149,     88,    127,     34,
-     -1819,    -46,     50,     11,   -159,   -223,   -163,   -149,
-        95,   -163,  -2168,    -19,   -937,   -183,     66,   -465,
-      -257,    341,    -70,    111,    228,     52,     83,     63,
-       -52,   -187,     16,  -2539,    -51,   3240,    -81,     87,
-      -116,   -183,   -182,     96,    -22,   -191,   -107,    217,
-       -10,   -215,      9,     -7,    -97,   -331,    -55,    513,
-      -398,   1378,   2627,  -2129,    563,   1462,   -369,    498,
-      1176,   -469,    220,   -953,   -122,   -236,   -306,   -276,
-        31,     35,   -167,    558,   -134,     45,    -54,     16,
-        36,     18,    300,   2438,     62,   -177,     77,   2638,
-      -108,   -115,   3392,    274,   -123,    -66,    201,   -400,
-       170,    142,    151,    332,     53,   -507,     81,   -653,
-       -93,  -3204,     -5,     10,    -43,     79,   3879,     77,
-       191,     24,     23,   -208,      6,   -109,    -97,    126,
-      -306,    629,     26,   -516,     79,     21,    131,     43,
-      -253,  -3463,    840,    653,    -95,    -48,    300,  -1026,
-      -324,   -909,   -383,    195,    342,   -136,   -192,    422,
-       262,    -13,    534,   3125,      8,   1672,    176,   -293,
-       211,  -1213,    537,    637,    -10,   -116,   -149,     44,
-        53,    105,      7,    -97,      3,     17,      8,    -21,
-        -7,    -41,    -38,  -4959,    -81,      1,    165,    196,
-        98,     35,    -35,      8,    -28,    113,    -20,    108,
-      -130,    -65,    172,   2858,     41,  -3295,    138,     10,
-       -95,    -30,   -173,     85,     42,     30,   -119,    161,
-       195,    125,    -32,    136,    319,    -33,   5142,     50,
-       100,    128,    -90,    -53,    -67,   -203,     28,     19,
-        37,   -137,   -124,   -105,    -25,  -3405,   -250,    294,
-       409,    -99,  -1072,   -383,    -12,    212,   -276,   3389,
-      -101,    171,    -41,   -554,   -295,   -437,     86,    158,
-      -242,    167,    135,      7,   -149,     48,     -4,    -84,
-      4911,    283,      5,    -14,    105,   -107,   -384,    102,
-       183,     47,     67,  -5105,     -5,     16,   -155,    181,
-       110,     24,    -77,    -32,    120,      1,     22,    167,
-       -90,   -150,     -5,    163,    -44,    -28,     54,  -3058,
-      -174,     58,    152,    -31,   -179,   -122,    -57,    232,
-      -395,  -4961,     61,   -115,     31,     14,     82,   -109,
-       -39,     59,    -49,   -133,     52,     17,     57,     52,
-       -63,    275,    146,    104,     53,     47,    -55,    311,
-      4871,    -26,     48,    -94,    -11,    -58,     63,    140,
-       -74,    -94,   -269,    -77,   3372,  -3116,     16,    -47,
-       -74,   -161,    115,     58,   -247,   -119,    399,     42,
-      -181,    154,   -218,    -24,   -237,     58,   -275,   2979,
-       187,   -124,    312,    301,   2767,     -8,     40,    -23,
-        -6,    -38,    -52,   -363,   -265,    -78,   -230,    286,
-      -135,   -337,    -81,    170,    -13,    -58,   -117,    519,
-     -4784,    157,   -193,      9,     62,    -21,    180,    128,
-       326,    213,   2440,     62,   -601,    -55,      2,    -18,
-      -342,    142,    358,   -632,   -377,   3590,   -248,   -278,
-      -235,    -28,    242,   -133,    144,     26,   -261,    113,
-        45,    -23,  -1984,    -77,    128,    249,     -8,   -266,
-       -38,     -6,  -1672,    -45,    -84,   -377,    154,     17,
-       -83,    -44,    156,   -137,     43,     91,    253,     17,
-       -71,    -92,    178,     12,     18,     -8,   -105,    101,
-      7068,     71,    -81,     84,    -33,     79,     53,     -7,
-       -85,   -265,    117,    317,    114,     72,   -482,   -418,
-      -185,    -97,    268,  -1543,    -79,   -146,    -48,    -45,
-     -3259,   -212,   1149,   -165,    177,   -158,    -77,    100,
-        86,    -69,    107,    219,   -512,   -253,   -418,    -45,
-        16,   5501,   -184,    207,     67,     46,    109,    -28,
-        -9,     33,     63,    -16,     39,     92,     27,     23,
-       -10,  -8192,      0,     50,    -57,     68,   -444,   1082,
-       247,   -138,    120,    472,   -692,    212,  -1576,     66,
-      3061,    402,   -160,    337,   -685,   -519,    227,   -279,
-        92,  -4135,   -393,    -44,      6,   -129,     59,    239,
-       151,    153,    -39,    116,    134,    -40,    171,    118,
-       207,   2615,     38,   -167,  -1671,     85,   -135,   -182,
-       -88,    246,     53,     29,     -2,     16,    232,    544,
-       -46,   -138,    122,    -52,   1312,      9,     92,     13,
-         4,     66,    -35,   -134,    -56,     85,    -43,    -31,
-        28,  -3187,    100,   -103,     70,     -3,    186,    -43,
-       122,  -3040,    -27,    -46,   -121,      1,     37,      0,
-       -60,      2,   -100,   -152,   -218,    175,   -406,    175,
-      -193,     68,   -208,    -23,   -230,    221,   3397,     45,
-        48,     37,    337,     11,     15,    -69,     -4,    -82,
-        53,     33,    -56,     75,    -98,    -69,    -11,    -19,
-       -12,     81,    -52,   5428,    121,     82,    465,     10,
-      -229,    126,     32,    119,    439,    126,   1996,    -85,
-       -81,    -57,     88,    232,    108,    -22,    -24,     27,
-      -136,     91,    -32,     18,    226,    -33,     15,    117,
-       145,  -7737,      9,     58,   -102,   -113,     26,  -2174,
-        28,   -421,    -11,    -70,    -23,    -70,   -119,    -96,
-      -133,    208,     20,  -3750,    -14,     23,     41,   -180,
-      2097,   -103,   -599,    146,    251,    -77,   -557,    -76,
-       -96,     69,    266,    316,     74,    -17,   -227,    223,
-        33,   -261,    135,   8126,    250,     -5,    -57,     35,
-       382,    -44,    136,     81,     42,    -80,    179,    -73,
-       -75,    -57,    274,    -15,  -3140,   3236,    196,    150,
-       -51,    222,   -190,     13,     83,   -313,   -149,     89,
-      -281,    -12,    -42,    293,    567,     19,    -43,    146,
-       102,    -39,   3666,     95,     76,     -1,     12,     27,
-         7,     -5,    261,    132,   -215,   -295,    -51,    496,
-        77,    100,     16,   -285,    649,    -95,    280,     77,
-       121,  -2676,     25,  -1148,   2912,   -341,    -91,   2380,
-       -80,     -6,    269,    -34,   -686,   -208,     19,    228,
-        24,     -5,   -150,     11,    214,   -316,   1187,    599,
-       -62,  -2274,   -240,     48,    -86,     87,     86,    477,
-      3832,     67,    135,     68,    747,    339,    385,   -255,
-      -224,    184,     70,    171,   -134,   2604,   -231,     72,
-       170,     51,  -2785,   -580,    -86,   -393,    -63,    -79,
-      -151,    334,     78,    329,   -278,    102,    -26,    -55,
-     -3531,   -378,   -247,    176,   -202,    147,    169,     87,
-};
-
-static const int16_t cb0808ss0[] = {
-     -1872,   -332,  -1311,   -512,   -934,    -11,    112,    389,
-      -189,  -1513,   1508,  -1081,    185,    -87,   3092,    529,
-      -166,   -171,  -1648,   2544,   2144,   -259,   -688,  -1113,
-       -71,    387,   1194,   -733,    175,    856,   -976,    268,
-       589,  -1773,   -426,   -109,   1210,   -486,    297,    195,
-      -991,  -1543,   -432,   1190,  -1089,   -531,   -421,     80,
-      -225,    354,   -231,   -670,   -299,  -3694,   -510,   -882,
-        31,   2804,    476,   -478,   1897,    686,  -1066,  -1222,
-      -882,   -374,   -427,  -1464,    957,    549,  -1211,   -204,
-      -218,  -1412,   -545,   -968,    943,   -342,     80,   -281,
-      -249,   -968,   3424,  -2342,   -212,    949,   -167,   -271,
-       607,   -838,   -418,   -891,   -398,   -877,    138,   1653,
-     -1034,  -2515,  -1363,  -1535,   -364,    432,   -324,  -1120,
-      1531,    407,   -698,    396,    325,   1432,    646,   2777,
-       174,   -836,   -605,   2257,   1086,   -888,    348,     36,
-       513,   2229,   1543,   1293,     94,   2444,   -574,  -1030,
-       933,     -9,   -668,    555,    346,    511,    715,  -4033,
-       409,   -299,   -166,    700,   -560,    950,  -1265,   -245,
-      1418,  -1362,    -20,    870,    152,    942,   -331,    -66,
-       227,   -186,    251,  -3632,  -1057,   -989,  -1798,    923,
-       542,   -630,   2889,   -128,   1475,    -97,   -964,   -860,
-       534,   -217,   -746,    181,    321,  -1007,   2595,   -411,
-      1298,    635,    310,   1955,    -17,    846,   -824,    -11,
-      -952,    208,    328,   -547,  -1086,   1481,   -264,  -1574,
-      3579,    500,    242,   1038,  -1030,    353,    -75,  -2100,
-      -347,   2662,  -2378,    261,    210,  -1151,    525,    291,
-       368,   -200,   -702,    105,   -140,    -81,    663,   -716,
-       334,   1220,    239,     21,    114,    301,  -1898,   3647,
-      -302,    550,   -489,   -484,   -853,   -274,   1509,   -419,
-      -330,  -1121,  -2666,   2507,   -621,   -818,   1188,    -69,
-      -885,    231,    316,   1837,   -740,   -187,   -102,   1148,
-      1219,   -123,    852,   1154,     27,    139,   -344,   -404,
-     -1133,    425,    353,    145,   -123,    179,     49,  -5836,
-      -571,     39,    274,    -38,   -457,    172,    -80,    593,
-     -1977,   -331,   -421,   1965,   1768,   -113,     64,   2272,
-       475,   2165,    210,    873,   -819,    757,   -119,   -530,
-     -1431,  -2167,  -1517,   -864,   1060,   -752,  -1366,   2349,
-      -671,   1180,   -179,     10,   -450,    781,   -799,  -1303,
-      -393,    -61,   -113,   2053,   -550,   -843,   1028,  -2044,
-     -2631,  -1388,   1078,    171,    517,    496,   -928,  -1695,
-       298,    708,   -557,    122,   -917,   -197,   -423,   1142,
-       116,   -528,   -585,   -470,    480,    400,   4605,    384,
-      -142,     57,  -2340,  -1507,    -67,    907,   8192,    356,
-       -18,   -704,    528,    -32,   -379,   -611,    418,    703,
-      -396,    531,    155,    642,    678,   -427,     85,    814,
-       212,    845,   -579,   -590,   -456,    103,   -624,  -4541,
-      -306,    638,   -760,     36,   -149,   1929,   1229,   -717,
-      -543,    530,   -694,    169,  -2996,    423,   -346,   -897,
-      1077,    255,  -1054,    -63,  -1773,   -479,    479,   -701,
-      1547,  -1683,   -342,   -926,    112,   -663,   1638,     -9,
-      2587,    311,   -561,   -932,   -539,   -335,    589,    779,
-      2345,   -432,    788,   -967,    319,     -4,    192,   -588,
-      -103,    357,  -3508,   -257,    707,   -473,   1521,     -9,
-       130,   3290,    274,   -296,   -802,   -139,   -814,    -19,
-       971,    849,    253,    486,     40,  -1216,   1179,  -1772,
-      -996,   1400,    838,   1955,  -1432,  -1925,   2324,    767,
-       896,   1314,   3407,  -1003,   -552,   -967,   -166,    -26,
-      1099,  -1965,      9,    239,    -10,   -243,    864,   1251,
-        91,  -2279,   -691,   -542,   -473,  -1908,  -1208,  -1447,
-      -891,   -311,  -1136,   1638,   1150,    586,   1656,    260,
-       538,  -1746,   1460,   -478,   -860,    297,   -605,   -139,
-       822,  -3718,   -194,    307,    609,     30,   3418,    226,
-      -338,    161,   -387,   -344,   -472,    354,   -170,   -421,
-       433,    601,  -1446,    821,    -48,    -31,    493,    916,
-      -347,  -3740,   -899,   1389,   -355,     71,    382,   -644,
-       485,    218,    975,   -542,  -3191,    742,   -102,   -783,
-     -1607,    473,    196,   1692,    -71,    258,   2446,   1507,
-      -968,  -1025,  -1087,    637,   -921,  -1405,   1192,    -88,
-      2044,  -1813,    922,    156,  -1096,   1007,   -695,   -485,
-     -1015,   -468,   -316,   1825,    190,   2132,   -205,   -218,
-     -3556,   -286,  -1350,   -212,   -634,    120,    417,   -311,
-       -90,    219,    870,   -334,  -1304,    523,    999,   -144,
-        98,   2157,    205,     45,   -247,   1401,   2423,    278,
-      -766,    -66,    309,   -121,    316,   -543,  -3418,    932,
-      -803,    637,    436,  -2341,   2016,    928,   -836,  -1212,
-       702,  -1179,   -544,      6,  -1429,   1014,    464,   1166,
-       581,   -291,    136,      0,    983,   -799,    693,   -230,
-      -727,   -186,   -310,    -76,    698,     -6,   -660,    762,
-       814,    451,   -328,   4469,   -454,     14,   -423,   -116,
-      -134,   -568,   1535,   -562,   -629,   -269,    826,    380,
-        68,    282,   -409,    640,   -384,    218,  -5702,   -280,
-      -638,  -2586,   -557,   -877,     49,    648,    434,   1178,
-      3442,    883,    -78,   2024,   -253,   -210,  -1090,    198,
-       -67,    -52,   3226,   -671,  -1606,     49,   1775,   -422,
-      -173,    309,   -720,   -667,   -505,   2073,   -678,  -1152,
-      -231,   -519,   -719,    422,  -2614,   -394,    543,   -993,
-      1449,    437,   -463,  -1286,   1191,  -1274,   -710,   -463,
-       659,   1493,     45,   -832,   -414,    306,     94,   1284,
-      -669,  -1312,   1082,   -917,   2489,   -494,    547,    738,
-     -1696,   -174,    282,  -1442,  -1455,   1633,    912,   -428,
-       964,     12,  -2404,   -485,    631,   -311,   1810,   2912,
-       -16,    576,     50,   -927,   -175,     37,    673,   -201,
-       995,    684,   -244,   -251,  -1444,   3195,   1863,    -88,
-     -1183,   -966,   1769,     36,   -825,    766,    489,    -86,
-      -365,   -106,  -1477,   -330,    125,   -253,   -250,   -523,
-      -731,  -5130,    653,    395,     99,   -845,   -721,    127,
-      -287,    850,    479,     25,    -30,     36,   -782,    611,
-       448,     99,    933,    -20,   -853,   -949,   -286,   -379,
-      -654,   -385,   1298,    547,    235,   1242,   -583,  -4147,
-        81,   -547,  -1142,   1280,   -223,  -1712,  -1501,    458,
-      -142,   2065,    208,    855,  -1115,   -187,    861,   1090,
-      -760,  -2551,   2326,   -378,  -1205,    488,   -241,    893,
-       113,    176,   4060,   -225,    -41,   -717,    -26,   -442,
-      -445,   -312,    813,    494,    314,   -210,    -98,   -788,
-       255,    632,   -506,    166,   -704,   -334,   -214,   -860,
-     -5281,     60,    -34,   -238,   -147,    643,    520,   2038,
-        28,   2433,  -1694,  -1316,   -615,    572,   -150,   -107,
-       349,  -1763,   -307,     78,  -1124,   -631,   1162,   -326,
-      -277,   -591,    558,   1016,  -4668,   -324,   -815,   -251,
-     -1284,     52,    294,  -1283,    598,    630,   -345,    641,
-       -34,   1085,   4247,    637,   1695,   -858,    212,   -243,
-       -64,    327,    557,    426,   -321,    363,   -652,    372,
-       777,   -567,   -749,  -1704,    414,   5299,    389,    242,
-        39,     31,   -315,    179,   -102,     11,     62,    248,
-       557,    706,    359,    -85,    303,   -403,   1531,    409,
-     -2092,    144,  -1354,     54,    -48,     51,  -1787,   1278,
-       942,   1264,  -1495,   1671,     92,   -899,  -1149,   1908,
-      -903,   -596,    342,   1749,   -825,    -13,    509,  -1163,
-      1065,   2405,   -253,   -741,   1099,   -528,   2971,   -412,
-      -235,   -869,   -136,   -352,   -489,   -384,    745,   -398,
-     -4197,     84,   1152,   -497,    955,   -161,    461,    -16,
-      -871,    801,    -93,    -15,   -352,   1826,   -490,   -536,
-     -2853,   -633,    128,  -1537,  -1670,    538,    788,   1276,
-       554,   -340,    565,   1216,  -1758,    384,  -1313,   -628,
-        24,    835,   -862,   -927,   1792,  -1042,    209,   -784,
-       807,   -383,  -1399,   3531,     52,   -537,    205,   -271,
-      3071,   1678,   -694,  -2313,  -1279,  -1656,   -428,  -1063,
-     -1576,   -323,   -342,   -257,   -227,   -716,   -458,   1161,
-      -180,    -71,    -40,  -1276,   1778,  -3123,   -378,  -1363,
-      -827,    880,    275,   -274,   -581,   -186,     -8,    661,
-     -1114,   -199,   -171,    379,    429,  -1551,   1645,   -857,
-      -163,  -2623,   1217,   1458,   -596,    -68,    383,    973,
-      -485,   -354,   -597,  -2875,   -516,    234,    -83,    340,
-      -396,   1365,   -574,   -816,  -2086,  -1059,  -1589,   -593,
-      -779,    334,   -546,     49,  -1065,  -1959,   1736,   1134,
-       187,   1833,     17,    -82,     68,    803,   -456,    -89,
-      1760,    836,   1570,    122,   -985,   2549,   1616,     82,
-      1102,    227,    222,  -1236,   -155,  -1012,    633,    467,
-       163,    445,    166,    766,   -253,   -347,   1041,   5121,
-       -21,    792,     81,   -478,    128,   -158,    316,  -1180,
-      -372,   1692,   -828,    -31,   1122,  -2583,   1346,   2483,
-       195,     72,    549,    424,    947,   -470,   1940,    -75,
-       505,   1377,    550,     58,   1785,    343,   -817,    874,
-      3483,   -307,   -576,    240,     35,    837,   -717,   -247,
-};
-
-static const int16_t cb0808ss1[] = {
-      2328,    183,   1652,   -907,  -3005,   1329,    -61,   -465,
-         0,   -453,  -1621,    223,    232,    -59,    254,   -312,
-      -117,    -59,   -477,  -2648,  -1176,   -227,  -1937,    962,
-       141,  -1489,    849,     93,  -1284,   1000,    295,    192,
-      -139,   -468,   -736,   -436,   2155,    371,   2475,   -348,
-       856,  -1985,     38,     94,    496,    758,    954,   -243,
-       134,  -1759,    491,  -1406,   1114,  -2554,   -447,   -692,
-     -2128,     44,   -923,   1610,    787,    150,   -500,   3442,
-      -698,    276,   -517,  -1555,    379,    -72,    810,  -1373,
-      2897,    936,   -586,   -438,    925,   1881,   -419,    211,
-      1724,    721,    885,    614,    253,    613,  -1440,    509,
-       842,  -2407,   -216,  -1765,    451,   1419,    599,    689,
-      1473,   -175,  -2974,  -1015,   1983,    -68,    640,     21,
-       140,  -1295,   -556,    -89,   -836,    718,   -343,  -1903,
-       443,    502,  -1064,   1328,     86,   2049,   1235,    130,
-       892,   1105,    692,  -2968,   -755,    473,    423,  -1371,
-     -2032,   1885,    -29,   -516,  -1118,    285,    482,    164,
-     -1932,   -685,   -819,    695,    715,  -1520,   1300,  -1188,
-      -121,   -197,  -4233,   -141,   1279,    299,    208,   1071,
-        20,    772,    692,    531,    257,    428,     78,    202,
-      -399,    -27,    793,   1150,   -736,    388,  -1922,    155,
-      -410,     85,   1135,    835,    133,    -88,     65,     62,
-      -534,   -136,  -4590,   -162,   -968,   1378,   -445,  -2825,
-       -93,   -519,    402,     12,  -1110,   -637,   -765,    210,
-     -2305,    654,    447,     26,   -265,    -91,     71,   -886,
-       126,   -109,      7,    346,     19,   -713,   -257,    774,
-      1080,   -579,    185,    200,  -5691,    541,    228,    424,
-        37,    512,    -78,   -201,    848,   -369,   1099,  -1001,
-       214,   -336,    266,   2502,   1583,  -2131,   -654,  -2476,
-       -97,   -787,   -738,   1056,   1385,    124,    944,  -3421,
-      1172,   -547,   -226,   1249,   1552,   1194,   -308,    489,
-     -1152,    751,    -92,   -168,  -3112,  -1451,   2038,     35,
-       371,  -1585,    535,    308,      5,    -53,    523,   -169,
-       591,   -175,  -1028,     91,    743,   -144,    230,   1831,
-      -177,    509,   1291,   1808,  -3322,   -815,   -227,   -475,
-     -1064,   -647,     79,   1223,    174,    -10,   -412,    393,
-      -305,   1224,   1310,     12,   -521,  -1267,   1911,   2245,
-       407,    724,  -1232,  -2017,    566,    506,   -467,    813,
-       660,   -196,  -3643,   2495,    870,   -561,    289,    662,
-       654,   -508,   -734,   -325,    622,    220,   -309,   -307,
-      -181,   -445,    131,  -1655,   -835,   -631,    883,    211,
-       737,    552,   -881,  -3103,   -766,    595,    112,    151,
-     -1177,    601,    479,    -14,     37,   -926,   -505,   1062,
-     -1755,   -799,   -178,   -555,   2509,   -694,   -792,    662,
-       737,    847,   1611,    397,    -67,   -134,    474,  -2251,
-      2698,   -245,   2054,   1603,   1291,   1188,     40,    763,
-      -216,   1554,   -297,  -1769,    410,   1270,   1089,    440,
-      -967,    294,    -37,    270,    471,   1287,   3773,   -108,
-      -610,   -275,   -298,    270,   -384,   2072,   -675,   1002,
-       174,     18,    171,    704,   3311,   -105,  -1774,    108,
-       511,  -3001,    -69,    543,   -227,  -1196,   1431,    -63,
-         6,   1279,     -1,    671,    239,  -2127,  -1924,   -934,
-       168,   -300,   1075,   1071,   3088,   -590,   1439,    329,
-      1073,    127,    762,   -131,    274,    837,   -134,   -610,
-      -399,  -1415,   1047,   -156,    415,    765,    698,    428,
-      -748,    241,  -4226,    152,   -829,   1040,   -937,    145,
-      -852,    -85,  -2957,   -130,   -406,    726,    168,    -37,
-     -1321,  -1069,  -1255,   1159,   1575,    552,    649,  -1953,
-       -17,   1027,   1078,   -385,  -2761,   -553,   -201,     58,
-     -1900,    -24,    283,   1248,    -90,    419,   1122,    902,
-     -1548,    -32,     34,   -360,    707,     45,  -3458,   -246,
-       287,    308,    397,    393,    822,   1323,   -565,    505,
-     -1553,  -1902,   -677,    625,   1079,   -135,  -2132,   -187,
-      -163,  -1001,  -1479,   -932,   1131,  -2588,   -316,     53,
-      1270,   -747,   -966,    980,    242,   -266,  -1575,  -1146,
-      -605,   -523,   -221,    585,   -787,   1365,   -286,   -183,
-       411,    546,   4779,   -286,   -578,   -101,    309,    896,
-        34,    451,  -1022,   -699,    170,    935,    458,   4143,
-       229,   -572,   -912,   -397,    -40,   -132,   -198,     98,
-     -1858,    612,    101,    -98,    -18,   -349,    322,  -1626,
-      1304,    273,   -235,    418,   -509,   3961,   -493,   1040,
-      -416,   1808,    161,   1443,   1052,   -460,     55,    -67,
-        41,    514,   1305,   -836,  -1636,   1353,    379,    147,
-       398,  -3814,   -679,    235,    327,  -2293,   -716,   1234,
-      -728,   -323,    698,   1992,      4,   -275,    944,    895,
-       212,    334,    285,   -710,   -891,  -1325,   3107,      3,
-       367,  -1779,    300,   -868,    -59,   -644,   -326,    111,
-       267,    -43,    421,    976,     57,   1461,   -172,    245,
-      -188,    296,   -215,   5269,    -46,    177,    199,   -539,
-        92,   -542,    251,    951,   -231,    117,   -580,   -898,
-       402,    847,      4,    384,   -215,    161,  -1991,   4422,
-      2461,  -1219,   -751,   1843,   1483,   1072,   2621,    -16,
-     -1157,    243,   -557,    651,    953,    476,   -417,   -533,
-       505,   -590,    713,    153,   1268,   -312,   -217,   -124,
-       870,   -484,   -751,   -161,    897,    755,   -823,   4117,
-     -1311,   -729,    447,   -642,    929,  -2408,   -338,   -967,
-      -104,  -1048,  -2216,  -1722,   -124,   -204,   -196,  -1156,
-      1460,    391,   -543,    120,     70,    204,   1185,  -2490,
-      2950,   -507,   -615,   1243,   -150,   -363,   -475,   -531,
-       783,    671,   -205,   -591,    217,   -523,    263,    -14,
-        71,    958,  -1185,  -1029,   -330,    327,   -705,   1229,
-     -2925,    131,   -495,   1756,   2101,    441,    -11,    133,
-      1274,   1253,   -154,    772,    522,   1725,   -277,  -1012,
-      -726,   1339,  -1200,   -241,   1676,    974,   2256,    347,
-      2743,   1482,   -738,   -241,   -868,  -1294,   -664,    855,
-     -1329,  -4174,  -1647,   -104,    101,    307,   -647,   -823,
-       347,      4,   -120,  -1112,    334,     27,    265,    990,
-       319,  -1414,    313,   -603,     52,  -3138,   1552,   -612,
-      -854,    626,    212,    773,   2334,    662,    614,    560,
-       589,   -533,   1337,    229,    557,    -26,   1458,   -626,
-      1890,   2392,  -1525,   1023,    667,   -431,     72,   1691,
-      1015,    -97,   -515,   1380,    796,   1192,    -39,    162,
-     -2821,   2960,   1558,  -1058,   1327,    793,   1231,   -743,
-     -1190,   -245,     29,    486,   -494,  -1371,   1633,    -66,
-     -1806,    231,   -664,   -147,   2402,   -584,    473,   -527,
-      1272,    464,   1991,  -1007,   -235,    357,    201,  -1176,
-      -341,    223,    -47,  -2089,    815,     49,    192,   -719,
-     -1041,   -248,   3046,    -40,   -501,   -346,  -1347,   -401,
-        57,  -1588,  -1039,    443,    590,  -1089,   -182,  -1365,
-     -1013,  -3917,   -382,    -98,   1025,    -51,    698,   -197,
-       848,    -75,   1596,   -408,  -1796,  -3191,   1155,    234,
-      -100,    698,    571,  -1233,   -315,  -1502,   -647,   -571,
-      -322,    842,  -1048,  -1115,   8192,   -784,   -472,     17,
-      -718,     37,   1190,   -393,    146,   -547,     90,   -433,
-      -321,  -1143,   -501,    468,    235,   -486,    -64,  -2214,
-      -330,   -837,   1214,   -127,    709,     -3,    623,   -384,
-       221,    297,   -783,  -3802,   -408,    -11,   -707,     92,
-      -275,   -268,   -117,   1580,   1466,    710,  -1300,    142,
-      -746,   1647,   2399,  -1231,    114,   1220,  -1112,    882,
-       467,   -973,   -976,   3855,   -647,   -150,  -1244,    973,
-      -364,   -154,    473,   -675,   -817,   -346,   -266,   -769,
-      -613,   -476,   1181,     -8,  -1054,    405,   -768,   1385,
-     -1598,   -892,    672,  -2185,     83,    -27,    582,   -434,
-      -944,     99,   -888,  -1658,  -1516,   2392,    726,   -222,
-       284,    324,   4848,    -67,   -782,    -45,    424,   -203,
-      -194,  -1229,   -114,   -189,   -216,    275,   -935,    -93,
-       117,  -1725,    360,  -2561,  -1555,  -1199,   -769,   -285,
-        74,   1267,   -387,   1368,    179,   -113,    952,   1025,
-       725,   -542,   -186,   1258,  -1396,   -747,    572,    603,
-      1965,   -668,    -12,  -2512,   1337,   -255,    254,   2285,
-      1136,   1397,    557,   -671,  -1149,   -614,   -462,   -913,
-      -452,   1206,  -2922,    485,   -882,    270,  -1309,   -605,
-       -21,   -580,  -1284,   -194,    169,  -2314,   -216,   -229,
-      1124,    103,  -1205,   1500,   1118,   1456,  -1149,    780,
-      -467,   -385,    585,  -1062,    289,  -3356,    198,   -309,
-      -310,     91,     44,   -377,   -632,   -737,   -516,     30,
-      -779,     73,   -482,   4661,   -275,     38,   -632,    479,
-      -345,   -406,     76,   -208,   -230,     80,   -220,   -313,
-       203,     -3,   1740,   -131,    773,    -30,    372,    767,
-      1673,   -770,   3326,   1586,    234,    408,   -257,    474,
-      -584,   -990,   1378,    696,     47,   -612,   -313,    189,
-     -3964,    795,   -289,    202,   -437,  -1648,    373,   -780,
-       -24,   -952,    123,    438,    797,    539,   -481,    191,
-       291,     37,   -790,   -321,   4520,    -49,   -281,    211,
-};
-
-static const int16_t cb0808sm0[] = {
-     -4664,   -115,     59,   -280,   -199,    -25,    213,   -937,
-       344,  -2137,   -841,   -370,    256,    512,   1098,   -130,
-        58,   -121,   -414,   8192,    489,   -296,    -33,     98,
-        49,   -217,    721,    -42,   -418,   -227,     -8,    205,
-      -276,    407,  -1218,   -146,   -292,   -143,    113,    978,
-      2693,     -9,  -1032,   1781,   1777,   -215,   -978,   -824,
-        68,   -162,     55,   2991,   -844,    682,    497,    406,
-      -922,   2471,    599,    774,   -129,   1292,  -1004,    777,
-        42,    314,   -102,   -963,  -2794,  -2620,    510,    355,
-       372,   -248,   -391,   -163,   -298,    561,    117,   1183,
-        38,    182,   1811,     -4,    328,    -13,   -456,    305,
-       368,  -1691,  -2818,  -1074,   1029,    261,  -1446,    343,
-        12,  -2757,   1021,   -375,     -3,   -155,    116,    195,
-      3420,     64,    139,    780,    187,   -464,    261,   -313,
-      -128,    185,   3703,   3160,    960,    706,     41,    405,
-        10,   1191,    353,   -549,    131,    164,    105,      1,
-        23,    386,     73,   -509,   2651,  -1441,   -834,  -1657,
-      -645,   1005,   -777,    695,    212,   1420,     65,    701,
-        25,    335,    136,    359,   -112,   -150,    191,    392,
-      -258,  -1140,    651,  -4551,    411,    251,   -169,    804,
-       -83,   -208,   -363,     81,    152,     75,  -1194,   -203,
-        -9,    157,    413,    -62,   -210,   5393,    -22,   -407,
-       132,   -288,   2360,    131,  -1535,    553,  -2524,   -140,
-       250,   1259,    -30,     -1,   1766,     99,   -529,     91,
-      3948,   -262,  -3752,   -382,   -339,   -701,   -140,   -787,
-        67,    -11,    331,   -828,   -443,    596,     47,   1634,
-        31,   -318,     39,    147,   -670,   -776,    707,   -921,
-       172,    971,   1163,     48,    -81,  -1357,   -181,   2872,
-      -152,    898,   1075,    529,     91,  -2279,   2925,   -848,
-       589,   1910,    549,   1088,    743,   -631,     42,  -1528,
-        23,    380,     -5,    389,  -1147,   -209,  -2041,    224,
-     -1998,    520,   -776,    193,  -2648,    -78,    -34,   -131,
-        22,   -200,    -28,     18,    328,    215,     67,     61,
-        50,    -72,    301,   -207,    413,    720,  -6194,    967,
-     -3275,    149,  -2444,   -521,   -772,   -278,    137,   -159,
-       932,   -111,   1219,    525,     17,   -684,  -1229,  -1776,
-        66,  -2307,   -195,   -527,    272,   -470,   -356,     -7,
-      -338,    146,   1021,   -893,  -2980,    591,    129,   -257,
-       209,    -58,    538,  -3973,    576,   -905,   -642,  -2092,
-       153,    737,   -596,    573,    236,   -887,  -1692,   -370,
-      -189,   -216,    -58,    714,     10,   -582,    517,    -86,
-       450,   -147,   -310,    162,   1747,   -656,   3577,    700,
-       190,   -685,   -170,    241,     91,   -126,   5567,    441,
-       -50,   -688,    -73,    938,    320,   -130,   -839,   1154,
-       149,   -446,    -10,    -11,     12,   -659,   -138,    637,
-      -470,    933,   -431,    235,    -86,     -2,   -407,  -5851,
-      -250,   1414,    525,    110,    421,    255,   -149,     86,
-       378,   -321,   1380,    118,  -2849,  -1138,    180,   1175,
-      1932,     32,   -488,   -121,   -412,   -441,    397,    249,
-      -172,    -95,    420,    375,   -132,   -215,   -167,   -206,
-      8192,   -116,    -61,   -311,    269,    615,   -353,   -115,
-      -383,    366,   -651,   -196,    -98,     85,    861,    543,
-      -231,    237,    493,    380,   -766,   -168,   3227,    659,
-       701,    181,  -3004,     -7,    154,    298,    298,   -257,
-       -32,  -5713,     48,    102,   -776,   -148,   -110,    316,
-      -645,    212,    213,    575,    -69,     31,    553,   -673,
-        -5,    -48,   -148,   -133,     11,    143,     10,    159,
-       319,     43,   7462,    162,    228,    -90,     75,    151,
-       103,  -2542,    -13,   -338,     11,   -442,    123,  -3039,
-      -452,      7,    106,    502,    227,  -2034,     90,    500,
-       -28,   -646,   -262,    -62,    -78,     40,    419,   6761,
-       -11,     40,    209,     61,   -151,    -68,   -245,   -401,
-        26,   -123,    189,    -57,    611,      6,  -1285,    -99,
-      -890,   3609,   -302,   -808,    639,  -3245,   -226,    107,
-        54,   -108,   -316,    -61,    -56,    228,    -16,    195,
-       275,    214,    -60,     77,  -7157,    130,      8,    244,
-     -2160,   -760,    450,   -186,   -378,     32,   -797,    214,
-     -3569,   -450,    307,    -17,   -141,     16,   1024,    404,
-     -2063,   -288,   -160,   4056,    877,   -346,   -970,    -87,
-       336,    961,    666,    585,   -465,  -1329,    350,   -338,
-     -5421,   -173,   -295,     72,   -201,    533,    462,   -133,
-      -937,   1891,    264,     71,   -935,    640,    687,    852,
-      -386,    -85,  -5644,    306,    240,    640,     67,     94,
-      -902,   -351,   -417,     -3,    284,     38,   -156,    359,
-        53,    139,    185,    274,   2613,    213,   1282,   2867,
-        30,   1234,   -911,    343,    -93,  -1671,     57,   -814,
-       -19,    326,   -256,   -113,     72,   3177,   3393,   -125,
-       460,   -261,   -503,  -1019,   -681,   -253,   -957,   -157,
-      -117,   -231,   -212,   1446,    225,  -3009,    313,   -435,
-       387,   -928,    696,   -857,   -452,     66,  -2063,    782,
-        14,    -94,     51,    242,   -422,    236,  -3825,   -666,
-       348,    196,  -2770,    429,   -416,   -266,  -1215,   -586,
-        84,    328,   -302,    219,   -457,   -532,   -764,     85,
-      2008,   -806,   2906,  -1405,    367,    835,    715,   -986,
-      -217,     88,   -328,    569,   -586,   3096,    249,   -615,
-       453,    176,   -540,    792,  -2472,   2189,    876,   -353,
-       111,    212,     -7,    597,   -154,    818,   -401,  -1408,
-       748,   2502,   1426,  -2897,   1069,    326,   -605,    120,
-     -4149,  -3087,    729,     82,    224,    320,    353,    -77,
-      -163,   -322,    220,  -1073,     10,    545,   -518,   -453,
-        50,   -386,  -2002,    614,   -705,   -806,   -928,   2941,
-      -520,    -35,   1208,    413,    900,    138,   -414,   -289,
-       -15,    -75,    185,   -373,    649,   -251,    666,   2708,
-     -2817,   -749,   -159,   -112,    454,   -385,   1037,    -46,
-       -25,    -14,     66,    552,    160,    -40,   -552,   -156,
-       151,  -5287,    541,   -242,    -82,  -1164,    849,   -773,
-      -136,   -162,    -76,     23,   -371,   -222,  -2245,    468,
-       425,   -356,    418,     -3,   -322,  -3573,    148,    260,
-      -155,   3301,   -165,  -3186,   -709,   -458,    870,    386,
-        59,   -161,    533,   -150,    598,    384,    900,  -1233,
-       -74,   -464,   -519,   -661,    -55,  -2562,    290,   1489,
-      1739,   2277,    874,  -1483,   -447,     93,    309,    311,
-      -203,    -19,   2271,  -1280,   -125,   -443,   -538,   2650,
-       -42,    290,    245,   -149,     24,     38,   -133,   1638,
-       210,   -239,   -180,    516,    -12,   -719,    -19,   -517,
-     -6190,   -181,    -89,    318,    485,    631,     11,   -205,
-       -57,    257,    573,    -72,    273,   -579,    107,     -5,
-       112,    425,   2449,   2741,    758,    656,   -663,   -282,
-       -48,    -45,   -294,   -448,  -5562,     61,     -1,   -464,
-      -263,   -688,   -115,    -15,   -108,   -569,   -448,    -48,
-      -180,   -105,     14,   -180,    490,    274,    625,   -588,
-      -120,   -196,   -305,   -126,    435,  -2490,  -2693,  -3414,
-        31,     97,   -167,   -114,    247,   7695,   -189,   -580,
-       219,    241,    188,    327,    179,   -193,    135,   -176,
-       127,    479,    529,    234,    112,    234,   -358,   -286,
-      1109,   2940,   -610,    -13,  -2650,    495,   1355,   -574,
-       -43,  -1497,   -292,   -503,    564,   -363,     24,   -313,
-      1387,    221,  -3612,    783,    637,     43,   1351,    217,
-       -21,    149,  -3104,    190,   -259,   -201,   -342,   -201,
-       166,   2411,  -1082,    283,   -382,   -725,    157,    155,
-     -1609,   -592,    527,  -2959,      9,    216,    526,     79,
-        54,   -132,    202,    785,    929,   1755,   -663,    366,
-     -3735,   3282,    305,    572,    -36,   -111,   -231,    119,
-       603,   1357,   -153,    553,    363,   -760,  -1188,    890,
-       147,  -3844,  -3788,    150,    257,   -588,   -234,    497,
-       361,   -543,    255,   -175,   -377,     49,   -616,   -200,
-      4115,   -541,    130,    678,  -3458,   -506,   -218,  -1317,
-       889,     29,   -104,     -2,    532,   -393,    513,   -792,
-};
-
-static const int16_t cb0808sm1[] = {
-      4123,    -74,    639,    326,   -110,   1896,    826,   -855,
-      -299,   -452,    536,   -323,    262,     79,    486,    144,
-       270,    -64,    277,    154,    399,     50,  -7270,    -61,
-        14,     -8,     19,   -104,    333,    119,    374,    389,
-      -196,     77,   -322,    261,     75,    386,    162,   2360,
-       644,  -2785,    355,    277,   -121,   -148,    156,   2136,
-       112,   -453,    429,    171,   2405,  -1245,   -775,   -181,
-      2110,   -583,    127,    889,   -290,   -550,   -165,   1027,
-      2155,   -351,   -936,    432,   2689,    217,    -20,    646,
-      -785,    908,    654,    970,   -294,    -41,    466,   -245,
-       138,     50,   -108,   -366,    177,    481,  -2118,    968,
-      -594,   3892,    528,    188,   -613,     18,    283,    733,
-       -35,   1598,    387,      1,    156,   -206,   -437,    203,
-      -244,   -347,    325,    296,    100,   1171,     49,    920,
-      -418,    -54,  -2756,     24,    123,   1018,    303,   -501,
-       901,   -447,    322,  -2361,   1039,  -1067,    877,   1329,
-      -143,  -2773,    269,   1560,    398,  -3193,    102,    990,
-       279,    379,   -204,   -144,   -174,    139,    411,   -234,
-        21,  -5064,   -188,    365,    278,    353,   -189,     94,
-       593,   -402,   -353,   -257,   -788,    383,  -1036,    569,
-       -72,  -1764,    571,   1003,    629,    670,  -1400,      0,
-      -435,     64,    189,   2874,    239,   1128,    992,   1213,
-        69,   -128,    207,    713,  -2436,   -931,   -387,   -111,
-      1064,   -170,  -2853,  -1072,   -367,  -1048,   -238,    -60,
-       -49,    340,   2382,    370,   -245,    351,    248,    -64,
-      2331,    458,   -484,    -34,    281,    689,    483,    636,
-       199,   3153,    607,   -124,  -3296,    953,   -407,     49,
-       455,   1083,    690,   -169,   -725,    311,   -493,  -1761,
-     -3054,    376,   -544,    479,     91,    159,  -2837,  -1257,
-      -830,   -948,   -254,    289,  -1039,    856,     86,   1123,
-       203,   -768,   1089,     73,   -866,    308,    437,    674,
-     -2067,   -240,  -1079,     33,  -1069,  -3502,    756,   -676,
-        45,  -2544,    378,   -365,   -275,   -293,   -394,   -649,
-      -507,  -2850,    672,    370,    186,   -417,    682,    185,
-       -15,   2863,     21,   -165,    356,  -3776,   -103,    535,
-      -416,   -345,    -31,     24,    -90,   -205,     96,   -966,
-        94,    424,     -5,   -188,    149,  -2193,   -183,   2342,
-       425,   -647,  -1697,   -627,   -444,   1248,   -967,   -702,
-       -48,   3616,  -3484,    774,   -299,     94,    421,    472,
-        71,   -144,   -523,    114,   -172,    349,   -285,   -106,
-       101,     59,    429,    512,   3362,    -38,    -62,     50,
-      -225,  -1408,    780,  -2747,   -404,    489,   -975,    840,
-       357,    982,    488,   -275,   -109,    393,    375,   4794,
-       183,   -110,    922,   -760,     61,  -1067,     -8,    322,
-        74,   -101,    554,   -350,   -486,     66,    384,    748,
-        14,    223,    -45,   -386,     69,   6231,    247,    325,
-      -320,    -47,    -50,   -165,    153,   -380,    589,  -3243,
-      -173,   -140,    341,   -747,  -1559,    639,  -1658,    356,
-       110,   -150,   -273,     76,   -632,   -425,   -227,    640,
-       211,    192,   -747,   -165,   4608,    290,   -160,   1268,
-      2754,     -3,    578,    189,   -485,  -2747,   -123,  -1309,
-       662,    601,     43,   -136,     84,   1625,  -1113,   1400,
-        75,   -126,   3581,   -243,   2339,   -514,   2203,   -400,
-      -483,    521,     30,   -246,    -76,    359,    101,    663,
-       -40,     57,     52,    360,   -447,   -290,    254,    104,
-       102,    113,    215,   -163,   -388,    299,   4570,     31,
-       108,    -41,     41,  -2633,   2891,   1188,   -505,   1061,
-      -349,   -604,   -449,   -374,   -320,    969,   -304,   -192,
-       246,   -152,    441,    -46,  -1416,    137,   1987,    495,
-       -63,   1087,    875,    699,    201,    211,  -3157,   -273,
-       -60,    195,  -2813,   -239,   2486,    -55,    294,    315,
-      -133,    448,  -1849,    363,   1063,     76,   -928,   -574,
-       -72,    -57,    168,   5673,   -156,   -116,    400,   -124,
-        82,    218,   -487,     37,    112,     53,   -544,    178,
-        99,    480,  -7179,   -196,    271,   -160,    308,    -62,
-       393,    394,   -220,   -740,    -14,     92,    408,   -364,
-       299,   -305,     76,   -239,     26,   -312,   -234,     34,
-      -189,    871,   -297,    364,    282,   -321,   -927,   4511,
-         2,      6,    308,    -82,     87,   -128,    518,     82,
-     -4509,   1145,    960,   -109,   -186,     83,   -144,    752,
-        84,  -2876,   -162,    877,   -249,    317,    510,    338,
-       298,    744,   2892,   -791,    363,   1088,    630,  -2506,
-        -1,   3150,    219,    130,    119,    313,   -822,   -668,
-      1201,  -2948,   -237,   -106,   -711,    405,    276,   -255,
-         0,    440,    161,   2587,   -734,   3376,    276,    154,
-       287,   -200,    594,    -29,    198,   -237,   -608,   -445,
-      -286,    202,   -783,    112,  -3879,     78,   2809,   -337,
-      -606,   -684,   -434,    559,    273,    201,    331,    903,
-       -53,    346,    700,   2599,    302,   -590,  -2551,   -498,
-       -26,   -667,    576,   -546,    457,   -289,  -1408,  -1021,
-       -63,     78,    153,    -83,   -696,  -3105,   2498,  -1502,
-     -1249,   -238,    254,   -287,    215,    313,    279,   -517,
-        67,    -58,   -148,  -1111,     58,   5151,    346,    283,
-      -367,   -900,    542,    209,   -438,   -128,   -135,     54,
-         7,    869,    291,  -1073,    775,    -61,   -145,    457,
-       562,   1332,  -4589,     99,   1366,    184,    980,   -920,
-        80,   -266,   -152,  -1877,   -266,    364,  -1432,    272,
-      2275,    567,     60,     50,  -2504,   -386,   -700,    373,
-      6775,    -15,   -434,    347,    215,   -369,    -20,   -281,
-      -243,   -325,    227,   -283,   -665,    -74,    336,   -674,
-      -112,   -369,    -53,   -396,    328,   3588,   -541,   -557,
-      -164,   1305,   -817,   -462,   1986,   1249,   -574,    130,
-       152,  -2375,   -425,    442,  -3827,    322,   -728,    563,
-      -179,    534,    620,   -937,    590,     -1,    -59,    584,
-       175,   -193,   -168,     -5,   -150,    156,   -175,   -178,
-      -245,  -7481,   -273,    212,    -35,    318,   -178,    446,
-       -55,    -26,     42,    -46,   -265,    767,    330,    295,
-       910,    -54,    490,   2952,    598,  -2578,   -644,    403,
-       149,    -88,    549,   -510,    596,   -225,  -2341,   -286,
-     -2724,      5,  -1960,   -262,    922,    537,    646,    -62,
-       -18,   8192,    484,    112,   -222,   -211,   -224,    317,
-       112,     82,   -853,      1,    176,   -475,   -162,    200,
-      -193,    166,   -228,   -214,     72,    417,    -27,    -16,
-         4,    395,   -515,  -6832,     28,    -47,    626,   -173,
-        63,     90,    141,    217,   1037,    335,   4520,   -896,
-       111,     91,   -656,   -103,   -729,    -29,    653,   -599,
-       -11,   2734,   -378,   -291,     60,    228,     47,  -3670,
-      -192,    653,    733,   -597,    898,   -420,   1572,   -133,
-      -154,    329,   -259,   -225,    218,    -82,    117,    300,
-      -479,    277,    787,  -1719,    136,  -3603,    702,   1357,
-      3340,    362,   -438,    131,  -1463,    367,   -467,   1722,
-     -2186,    343,   -379,   1221,   -562,   -260,   1157,   2692,
-        37,    -89,   -322,   -322,   8192,   -284,    235,   -528,
-       113,   -359,     44,     74,    119,   -917,    403,    410,
-      -150,    157,    514,    168,    407,   -246,    -31,    510,
-       105,    449,   4612,    635,    -90,  -1260,    774,   -284,
-       -80,    456,      7,  -3000,   -324,   -212,   -104,   -374,
-      -440,   1268,   2736,     53,  -1178,   -403,   -438,   -534,
-       121,    261,   -497,    -73,     10,   -262,     17,  -1870,
-       178,  -1339,    224,   3115,   -436,   -448,    385,    894,
-        -1,    105,    -18,    268,    342,    270,    891,    367,
-       121,   -325,  -1610,    -75,  -3233,   -189,  -1050,    961,
-     -2833,   -304,    -51,    400,   -284,   -810,    824,    -71,
-      -135,    194,    297,   -297,   1129,    660,    518,   2426,
-      -225,    251,   4677,   -176,   -464,    296,  -1208,   -423,
-      -875,   -581,   -707,  -1150,    499,   -778,     28,     29,
-       101,  -4213,   -127,  -3681,    425,    481,   -529,   -679,
-        11,    266,    127,   -445,    527,   -577,    310,   1465,
-};
-
-static const int16_t cb1110l0[] = {
-     -3748,  -3820,   -105,     16,    -22,     -7,    112,    -14,
-        52,     28,    -42,   -113,    132,    -81,     -8,   -112,
-        19,     33,   -251,    117,    -33,     -9,    -13,    -28,
-        60,    -30,     29,     27,    -58,     -7,      4,     43,
-    -10108,    -38,     -3,     48,      3,    -23,    202,   -175,
-      -202,     71,  -2143,      3,    -82,    -38,   -113,    141,
-        38,    -66,   -118,    -38,    -14,    148,   -264,    143,
-       -13,    -56,     -9,    -21,    -28,   8930,    -23,     53,
-       -40,     30,     72,    -46,     26,     66,     22,     32,
-        44,     22,    -50,    -66,   -115,   -141,     24,  -3013,
-     -3460,    492,    207,    -62,   -567,    134,    -26,    -64,
-       287,    343,   -213,     42,   -274,   -144,   -144,    -77,
-       -26,    -39,      4,     -4,     42,     43,     30,    -16,
-        34,    113,   9291,   -171,    -17,     24,    -53,    -27,
-        45,     42,    533,    146,    -65,     32,    156,   -144,
-      2821,    889,     -7,    614,     11,      1,   -473,    434,
-       659,   -323,  -2448,     23,   -138,   -582,    436,   -152,
-       -30,     29,   -290,   -302,   3127,    496,     14,   -346,
-       -70,    457,  -1976,   -229,     53,  -2077,   -313,     58,
-        33,    -91,   -175,    141,   2728,   3232,  -2150,    245,
-      -142,     13,   -318,     70,   -152,    -64,    132,   -322,
-        44,     30,    -70,   -184,    433,    -25,    -97,  -2035,
-       145,     47,    640,    179,   -441,     48,   -108,   1742,
-      -280,     33,  -3259,     79,   -147,    324,    -80,     65,
-        48,     90,     -7,    -21,     22,      3,     56,    -30,
-        14,     -2,   -111,     22,     -8,  -8252,   -103,    -36,
-        57,   -203,    287,  -2761,   -220,    143,     11,  -3597,
-        21,    -81,     62,    -99,     41,   -172,    108,     29,
-       351,   -370,     15,   -122,   -207,    275,    -93,  -2760,
-       400,   -212,    225,    230,   -239,  -3530,    -73,    211,
-       288,     85,     -6,   -634,     57,    -78,    361,   -149,
-     -1843,    -23,     17,    -37,    -71,   -174,   -237,     42,
-       -22,   -243,     63,   -101,    131,     35,    136,  -4025,
-        41,   -262,    -57,    197,   -290,    307,     35,    -16,
-         3,     -5,     45,     -7,      1,    -47,     41,    -19,
-        79,     78,     42,    -85,     74,   -414,   1696,    703,
-       297,  -3296,    108,   -546,   1129,     44,    447,   -433,
-       315,  -1012,    133,    141,   1051,    601,    -18,   -532,
-       -30,    712,   -127,   -210,     10,   2442,    -95,    -46,
-       -14,     77,     32,    -11,     10,   -103,    -15,    637,
-       -60,    352,    694,   -202,    284,  -5524,     92,    -82,
-         5,    140,    -54,   -115,     45,    287,    -14,   -307,
-      -342,     10,   -181,     50,    -30,     -6,  10144,     77,
-        42,     13,     26,    -20,     34,     10,     37,    -37,
-       -47,     90,     -5,    -44,    -85,    -64,    -51,     -1,
-        16,   -152,    -91,    212,      4,    -25,   -237,  -6124,
-        22,   -120,     -1,    171,    -17,    -43,    141,    -13,
-       -57,   -185,     80,    273,   -493,    178,     45,     11,
-       -57,     16,    -23,    -30,    -37,     82,      4,    -13,
-      -130,     98,    272,   -450,   -161,    133,   5104,     14,
-      4576,   -193,     11,     55,    -30,      1,    123,   -265,
-       -84,   -340,    -18,    152,    -24,   -266,     33,    -90,
-      -108,   -639,   1662,    299,    -14,   -389,   4679,   -226,
-        21,    311,   -294,    159,   -209,    172,    184,    292,
-      -373,    169,     84,     55,   -269,   1453,    -50,     41,
-        68,     -9,    -62,     35,     23,   -132,     96,     58,
-      -122,  -3956,   -318,    210,   -117,    678,   -104,    378,
-      -842,     61,   2549,     37,    149,   -512,     70,  -2971,
-       225,   -411,    230,   -214,    697,    -58,   -871,   -281,
-      -128,   -204,    -37,   -128,     51,   -174,   -405,    497,
-     -4455,   -219,    124,   -120,     63,    135,    201,   -122,
-      -435,   -677,    221,    138,    486,    535,   3153,    165,
-        11,   -275,     94,   -100,     69,     52,    -67,   -742,
-       212,     16,    -93,   -428,    863,    -17,  -2465,    767,
-       -35,   -130,     97,   1387,     34,     72,    -23,    -17,
-      2845,    -90,    -71,    213,    291,     87,    826,    -63,
-       189,    641,   -256,    832,   2087,   -199,   -170,   -193,
-       -62,     -7,     37,    -60,  -4277,    -43,     24,    -69,
-       574,   -163,   -113,    263,    -86,     45,    171,   1075,
-      -154,    -39,    121,     74,   -132,    182,     34,     13,
-      -278,    -41,     96,    716,   -221,   -626,   1205,    244,
-      -351,   3914,    -78,    -32,   2833,   -150,    -37,     95,
-      -227,    -84,  -3432,     57,    238,   -143,   -365,     39,
-        27,   -238,   -307,   -170,    124,     66,   -133,     40,
-        62,    -19,     42,    -66,      2,    -80,     -2,     60,
-         7,     10,    263,  -4987,    -69,   -389,     62,    -53,
-       -66,     24,    -87,     13,     34,    -15,    -25,    -20,
-       197,      9,    101,    -83,    -79,   -156,   -100,      2,
-      -108,   5687,   -157,    878,  -1728,     32,     72,    -66,
-        70,     -2,    -46,   -163,    206,     17,    247,   2974,
-       -66,   1354,    335,    238,   -249,   -410,   -553,    354,
-       -41,    132,    -96,     68,   2174,   -329,    -58,    -76,
-         6,   3089,    284,   -274,   -398,    471,    283,    427,
-      -220,     81,   2676,     40,    -23,    -46,    251,    109,
-     -3059,     50,    -25,   -551,    124,   -389,    228,     95,
-        56,  -1320,    -79,   1027,  -4938,   -105,    -82,     13,
-      -159,     52,   -101,     23,   -220,    -77,   -153,    113,
-      -282,     42,    185,   -144,   -402,     46,   -144,    -99,
-     -2862,  -3432,     -2,     16,    -32,     23,    -25,   -145,
-       181,     49,      6,   -236,   -226,    -28,    234,    -26,
-       -89,    -14,   -355,    146,    117,    -50,     76,    -10,
-       441,    -95,     -2,    346,   -242,  -3745,    884,   -305,
-      -184,    350,     18,   -293,   -328,    257,    109,     49,
-       157,    -44,    -70,     35,      6,     89,  -4085,   -167,
-      -263,    -59,     35,    -13,    430,   -212,     17,   -618,
-        -5,  -8968,    114,     41,     73,    -85,    122,      5,
-        38,     19,    -60,     14,    -36,    -42,    -89,     20,
-        85,    -17,     20,    282,  -3396,    -25,   3722,    151,
-      -183,    100,   -150,     19,   -221,    126,     34,    -21,
-        72,     28,    138,    -90,     30,    162,     46,     40,
-        27,     15,    -55,    -21,     38,     55,     32,     83,
-      9675,     31,     26,     -2,      4,     96,    -51,    120,
-      -132,    213,   2106,     39,   -251,     98,  -2572,   -429,
-      -331,   1436,   2078,    335,   -381,    371,    299,    339,
-       300,   -141,    -99,   -303,   2952,     49,     93,     40,
-     -3949,    -45,     50,   -215,     73,    -39,   -165,   -283,
-        46,   -123,   -347,     23,   -158,     41,     20,     41,
-       -46,     19,     34,     86,  -8770,     40,     20,    -32,
-       -30,    -16,     77,     72,     -4,     92,    -34,    103,
-       -77,    128,   -532,   -314,     24,    728,     49,    -36,
-      -178,     76,     22,    -14,   -164,   -194,     69,   3133,
-      1007,   -130,   -280,   2502,    482,     -2,     45,    -62,
-        -7,    -94,     17,     23,     -4,   9516,    -27,     11,
-        22,     54,    -13,      2,     -2,      6,    -22,    -63,
-        67,   -686,    130,  -2180,   -124,     57,    -61,   -158,
-      3364,    518,      4,    315,   -367,   -103,   -295,    259,
-      -597,     56,     -6,     72,    -86,    -45,    -13,    -47,
-       -13,    -27,     -3,     48,    -12,    -52,     -6,    -14,
-       -26,    -16,    -34,   9554,     80,     91,   -270,      1,
-      -121,    117,     33,      8,     40,    -99,    -79,     43,
-     -3451,    -92,    -70,    -57,     43,     68,     64,    284,
-      -639,    458,    118,    -54,  -2755,    370,    -66,     54,
-        27,   -198,    331,    115,    -40,   -209,   -312,     82,
-       -16,      8,    230,    212,   1853,    -94,   1957,   -118,
-       153,    -13,    -73,     71,    116,    -72,  -3285,    106,
-        19,   -121,    177,   -300,    455,    -29,     94,    190,
-       -21,     -8,    201,     16,      2,     83,  -6280,     32,
-       -18,     59,    -18,    -41,   -132,     22,      1,    -39,
-      -212,   -198,    186,   3154,   -102,   3463,   -280,   -118,
-      -132,   -132,     63,    -19,    353,    -24,    -77,    224,
-        82,    143,    -65,    165,    -16,  -3774,   3543,    -28,
-       -44,     93,    -45,    -13,    -24,     -5,    -40,     58,
-         3,     89,     71,    113,     46,     62,     44,    160,
-       -77,     -8,    -59,  -6505,    134,    -42,    -73,      0,
-        85,      2,     16,     34,    157,    -34,    -60,     78,
-        24,     64,     96,    478,    231,   -125,   -217,     13,
-        21,     44,     83,    198,    -69,     21,   -167,    -52,
-      4085,   -234,   -393,     17,   -446,   -354,    -28,     42,
-        53,    -37,     28,     15,    -16,    -10,    -85,   9471,
-       -16,    -89,    -87,    -56,     52,    -97,     86,     -7,
-      -103,    -12,     71,    -39,     17,    -40,     23,     63,
-        65,    -19,    -14,   -106,     29,   9707,     -1,    -12,
-         1,    -86,    100,      7,   1097,    266,    252,    197,
-       -64,   -214,   -197,    -28,   3843,  -1577,    310,   -117,
-       594,     13,     90,   -309,   -384,    134,    -90,   -194,
-      -316,   2884,    156,   -185,    196,   -103,     75,   1009,
-        69,    768,    -75,   -605,  -1488,    389,    242,    368,
-       278,   -122,  -2500,    121,      7,   -303,     91,    -10,
-      3642,     23,   -109,    -13,    138,   -405,     18,    -43,
-         3,     42,    194,   -112,    237,  -2241,     23,    296,
-       -83,    -14,    -58,   -163,     -8,   -174,   -239,     85,
-      -108,    -82,    -79,    344,    236,   -427,    127,     52,
-};
-
-static const int16_t cb1110l1[] = {
-       -64,     11,    -74,    -96,     39,   6072,     16,     46,
-      -215,    137,     77,    128,   -195,   -192,    -87,     96,
-       379,    -73,    367,    437,   -366,     84,   -155,    -29,
-       -69,    -61,    -34,   -129,    260,   -177,   3738,    739,
-      -221,    -14,    -40,      2,   -483,   -269,   2664,    166,
-        29,   -256,     30,     92,     51,    111,    -45,   3893,
-        90,    -30,    -99,     12,     74,    201,    -52,    -96,
-      -196,    -85,    -36,    123,    -44,    -68,      2,   8666,
-        33,    -41,     24,    -12,    -52,     69,     59,    -27,
-        38,   -148,    -55,    -20,    -60,     50,   3363,     30,
-      3749,    -92,    228,    173,   -239,   -167,    -75,    -79,
-       -86,   -217,     32,     34,   -137,    -13,     17,   -128,
-     -1462,   -170,   -224,   -393,  -3383,  -1243,    -47,     24,
-      -223,     26,    311,   -343,    -47,    784,    459,   -548,
-       558,    983,    103,    269,     32,     13,     19,    -84,
-       -37,    -29,    -47,  -6286,      7,     48,   -100,     13,
-        11,   -271,    -86,    115,    -17,    183,   3247,  -3336,
-        57,    -67,   -117,    -87,     19,     74,   -271,    237,
-       -24,    242,     49,   -179,    298,     85,    -69,    328,
-      -238,    -34,    103,    -50,     79,      2,    -27,    -16,
-      -103,    -61,   5868,   -105,   -262,     74,    -74,   -158,
-       263,   -110,    154,    212,     -3,    -84,   -126,     25,
-       -67,  -2501,    -12,    -35,    139,    259,    -95,   -141,
-       137,     90,     12,   -244,   -142,    314,     15,   -124,
-         1,    -25,    -27,     -2,     -6,     28,    -48,    -17,
-        -2,     43,     67,     42,   9023,    -25,     19,    -13,
-       -23,    -43,     73,    -30,    143,     -1,   2884,   -142,
-        -4,   3549,    -49,   -366,    110,    314,     19,    -55,
-       363,    204,    469,    189,    217,   -181,    119,     41,
-      -133,     29,    -55,    -94,     71,    -49,     41,     85,
-       -14,   6140,     71,   -142,     10,     18,    169,    136,
-       282,    -49,     36,    446,    -99,    263,     92,   2201,
-      -127,     43,   -143,   -350,     36,    389,   -208,     15,
-     -3610,   -275,    383,   1599,   -179,   -177,  -1100,     -4,
-        67,    -38,      2,    278,     39,    107,   -120,    465,
-       204,   -397,    305,    416,      7,   -262,     68,   2341,
-       189,    -75,    -23,     25,    -20,    -74,     56,    -43,
-      -125,    170,    509,     63,     26,    263,   -741,    -31,
-         8,   -296,    101,     20,   -149,   2846,   -218,    379,
-      -310,    151,    901,     84,    -85,    -83,   -387,    161,
-     -3102,   -158,   -438,     38,    191,    -58,   -202,    127,
-       126,    -88,   -430,  -3077,  -1829,   -332,     61,   -152,
-       -14,    -32,   -156,     -5,   -375,  -1083,  -5130,    110,
-        77,   -201,    -15,      4,     13,     86,    119,     67,
-       149,     80,    264,   -253,   -121,     63,    193,   -103,
-      -129,     63,    120,   -226,   -100,   3196,     72,    -11,
-         8,    -56,    279,    -73,   -192,     47,    -87,    125,
-       -43,   -108,    277,    188,   -107,    289,   5966,    -20,
-      -303,    -78,    -21,     40,   -139,     44,     28,      6,
-      -254,   -244,     47,     -1,   -151,     29,   -344,  -2318,
-        30,  -3767,    114,     84,   -155,     85,    -90,    155,
-       111,   -506,      6,    453,   -241,    215,    131,   -802,
-        15,   -343,    176,   -430,    251,    -74,      6,    -41,
-       -44,   -131,   -105,   -248,    346,     39,  -4524,     93,
-      -120,    -79,   -777,   -416,   -570,   -221,     21,     28,
-       -52,     56,     71,   -187,   2949,  -2531,    666,    799,
-      -137,    970,    243,   -695,   -148,   -281,    326,    450,
-      -734,    -99,  -2078,    112,    -83,    -90,    -78,    262,
-      -138,    -31,     -5,    -74,   -171,    -99,    344,    143,
-      4035,     56,   -121,   -921,     -8,     46,   4576,     97,
-      -219,    -34,    123,    -44,     -1,     85,    -36,    399,
-      -260,   -231,    132,   -318,     55,   -181,    156,  -3093,
-       142,     -9,  -3418,    -31,     43,    126,    136,    309,
-       -50,    -20,    170,    -90,    188,   -173,    175,     50,
-       144,   -244,     22,     64,   -476,    -22,    -66,    272,
-      3839,    715,   -188,    -82,   -250,   -587,     10,    368,
-      -507,    242,    -40,   -531,    451,     35,    560,   -107,
-       138,     15,    113,     56,    242,     33,    -23,    -27,
-        81,   -157,    301,   -327,    359,   3648,     62,  -1489,
-      -167,    136,    -39,    183,     53,   -151,    -16,    -60,
-       -65,  -5182,    -17,   -257,    -10,     56,   -104,    713,
-        -2,    328,     72,    353,     43,    -51,  -5949,     40,
-        32,    -82,    -36,    -22,     57,     56,     55,    112,
-      -104,     76,      5,     80,    -29,    173,   -360,   -113,
-        42,   -119,    180,    -26,    120,    250,  -3024,    198,
-       115,   -140,     22,    136,    275,    698,   -149,    699,
-       426,   -220,    279,     63,     55,    -63,   -108,    -51,
-       -70,    -70,    419,   -156,   5870,     33,    -57,   -114,
-      -388,   -213,   -164,   1543,    117,    165,   1944,    223,
-       -83,     46,    201,     12,   -103,    228,    139,   -207,
-       136,  -1218,   -544,   -723,     90,   -652,    793,     -1,
-      -100,    -32,   -236,     49,    164,    138,     16,     82,
-     -3221,    -62,   -168,     62,   -313,     98,   -652,   -484,
-       684,    -91,     33,  -2926,  -3453,    566,     34,     35,
-       104,     13,    189,    235,    -49,   -324,    126,    226,
-      -102,    123,   -253,   -403,     38,    160,     -5,    100,
-       -30,     16,    -19,    -44,      2,    -70,    -30,     82,
-       118,      6,    132,    -15,    -36,     59,  -8835,   -448,
-      3707,    324,     87,     67,   -110,    114,    -76,    294,
-       354,      7,    140,     11,    340,   -117,   -559,     67,
-       129,    201,   -314,    328,   -209,    102,   -121,    378,
-     -5010,    140,     53,     15,   -253,    -14,    414,   -183,
-       -70,    -25,    -51,     34,   -347,   -171,    146,    -98,
-      -101,     -3,    -99,     96,     66,     50,     -5,   -115,
-       -23,    -45,   -351,  -4202,    143,    480,    -46,    140,
-        17,  -6312,   -110,    -23,    150,     60,    -39,     -9,
-       -48,    -60,     -8,    -20,     37,     57,   -162,     60,
-      -137,     55,   -101,     65,    100,  -8952,      3,    -49,
-        -3,     -9,     28,     15,    -89,   -136,     59,    125,
-       -73,    -35,   -111,    -69,    -28,    111,    -16,     48,
-        27,   9272,     55,     34,    -92,     66,      3,      3,
-       -38,     12,     59,     95,   -100,      3,     51,    121,
-       146,   -200,    142,   -254,     65,      3,   -169,     -8,
-       -65,     44,     10,     15,    -99,     56,     -6,   -108,
-       -20,  -5461,    -89,    395,   2085,    486,    -48,    324,
-       422,  -3703,    468,    198,    239,      0,   -277,   -115,
-      -227,    227,    -29,    159,   -128,   -447,   -291,  -1953,
-      -110,     25,   2274,    141,    177,    204,     38,   -258,
-        90,     -8,   -131,  -2636,     55,    561,    -99,   -220,
-       -33,    142,   -334,   -160,   -117,    -12,    -33,      6,
-        72,     -3,    -11,     50,      1,    -45,      8,     23,
-       -15,    -33,    -15,     30,    -32,    107,    145,     14,
-        60,    114,     45,     24,   8811,     -9,     61,    192,
-        16,    124,     46,    -54,    -31,     89,   -147,   -112,
-      3341,   -395,     91,   -323,     45,   -156,     25,    -18,
-        34,   -534,    118,     83,   -187,    -92,    180,     34,
-       659,    135,    103,  -2342,     54,      6,    179,     40,
-       143,    232,  -3858,   -201,    179,     32,    -56,    406,
-      -236,    541,    -70,    -88,   -121,    447,   3028,   -223,
-       138,   -557,    230,   3457,     96,     -4,    -22,    -13,
-      -136,    -45,   -123,     -8,    107,    270,    132,    -64,
-       -32,    464,    -33,    -44,  -2544,   -251,   -246,    -71,
-     -4063,     40,    107,    384,    -22,   -197,     64,    166,
-      -137,    -44,     98,    -35,    193,      4,  -2103,     57,
-      -109,    245,   3487,    -55,    -60,     21,    187,   -267,
-       279,      3,    166,    -78,    108,   -135,    126,   -122,
-       171,   -133,    -21,   -134,    183,     25,    -56,  -6210,
-       107,    109,     22,    -93,     39,     95,     43,    -11,
-       -44,     -5,    -82,      6,    -54,    -27,   -116,    -16,
-        84,     44,     22,    -68,     -1,    -57,     78,     35,
-        83,   4664,     46,      1,   -164,   3301,   -358,  -3757,
-       236,    104,    -81,   -121,   -278,   -112,    -20,     89,
-      -123,     35,    113,     17,   -331,    273,   -172,    125,
-       -73,     77,   2515,  -3944,   -170,    -87,    174,     84,
-       142,    138,     13,    227,    127,    146,    141,    196,
-        38,    -40,   -112,    136,   2311,    328,     87,    -22,
-       -77,    -34,   -195,     58,   -333,    337,   -159,    626,
-     -3008,    408,    523,   -316,    539,   -587,    -81,  -2824,
-        98,    200,    613,   -107,   -170,  -1190,   1121,    521,
-       229,   -217,    143,    144,  -1248,   -384,   1535,    470,
-      -655,    492,   -429,    -26,   -132,   -180,     52,     97,
-        10,    -35,    -60,      7,  -5422,    -26,    154,   -132,
-      -221,    124,    136,    -17,    -68,     25,     29,      4,
-         5,    -15,      9,     69,    -16,    -47,    -76,      5,
-        41,      6,    -22,     63,     -8,   9709,    -33,    650,
-      -545,   -159,     81,    -75,     54,    -92,    -49,    -80,
-        14,    -78,   -145,   -399,  -3935,    186,  -1144,    207,
-        60,    286,   2642,     44,    117,   3758,   -154,    426,
-       331,   -615,   -216,    271,   -121,   -109,    495,     42,
-       813,    -19,    545,   -149,    633,  -2424,  -2089,    265,
-      -136,    -58,      4,    -28,    147,      2,   -123,    -93,
-        14,    -50,    317,    131,   -130,   -152,    322,   1023,
-};
-
-static const int16_t cb1110s0[] = {
-     -6433,    495,   -277,   -630,    411,   1241,   -326,   -425,
-       523,    114,   -225,    -53,   -538,   -702,   -260,   -417,
-      -401,   -222,   -263,   -416,    163,  -1256,    590,  -1176,
-      1865,   1483,   -927,    -65,   -674,   1303,   -147,   -750,
-      -132,    407,   -283,    852,   1788,  -2257,    210,   -450,
-       303,   -272,  -2536,     94,   2010,    428,   -921,     -3,
-       -71,   -875,    156,   -681,    521,     49,     51,   -523,
-      1532,   1619,   -690,    402,   -923,    318,    865,    193,
-     -2187,   -662,    553,  -1104,    -70,  -1313,    462,  -1045,
-       320,    937,  -1453,   -514,    404,   -231,  -1748,  -1592,
-     -2039,   -217,   -364,  -1313,   -428,   2419,   1257,  -1292,
-        19,   2867,   -278,  -1832,   -239,   -691,   -383,     62,
-       185,   -455,  -1589,    116,    419,   -319,   -418,    537,
-      -280,  -1834,   2681,   -857,   -210,   -156,  -1143,   -104,
-     -1774,   1702,    184,   1017,   -135,   -610,    525,    335,
-      -355,   -494,   -231,   -154,    986,    434,   1134,   1213,
-       914,   1457,   -258,  -1086,    477,  -2247,    498,  -1741,
-      -975,   -262,    812,    108,    834,   -412,    120,  -1032,
-      -533,   -456,    139,   -301,   -387,   -690,    798,      3,
-     -1556,   1261,    745,  -4486,      8,    213,    977,   -151,
-      -269,   -344,     13,    544,   -270,   -166,   -706,    672,
-       184,   -943,  -1714,   1510,   -739,   1891,   -477,    528,
-      1847,  -1572,    420,    103,    -85,    508,    231,   2024,
-     -1343,     20,    238,   -655,    668,  -1561,   -743,   -651,
-       709,  -1136,   -208,    979,    258,   -693,   -535,  -1126,
-      -283,   -944,   -209,    603,  -1797,  -2998,    253,   -296,
-       842,     63,   -203,   -468,    675,    337,   1458,    114,
-       259,   3202,    145,    419,    631,    352,   2309,   1337,
-       815,    -99,   -824,   -779,  -1839,  -1455,    166,  -2092,
-      1299,    162,  -1026,   -914,    128,   1321,    896,   -209,
-       255,  -1144,    807,  -2870,   -632,   -588,    866,     81,
-       453,    154,  -1258,   -499,   -452,    -98,   2599,   3070,
-       540,   -834,   -228,  -1268,   -313,   1269,    -65,    -56,
-      1035,   -499,   -507,   -657,    447,     26,     96,   -175,
-       133,   -291,   -538,   -259,      7,   -206,    411,    145,
-        25,    215,    267,  -4354,   -442,    250,   -814,   -143,
-      -459,   -182,   -640,  -1258,    169,    379,  -1196,    429,
-      -128,  -1971,   2681,    -45,   1641,    152,   -556,    909,
-       365,   -618,   -417,   -363,   -434,    270,  -1388,   -473,
-        62,     58,    509,  -3909,   1327,   1571,    482,   1081,
-      -896,    459,    480,   -557,   -267,    390,    -15,    484,
-       248,     52,     49,    702,    -10,    162,    245,   -416,
-      1397,     23,    183,    325,    591,   -816,   4429,    674,
-      -332,  -1243,     68,    285,    235,    759,   -315,    799,
-       313,   -331,   -182,   -629,    394,  -1079,   3879,    -81,
-       651,   -774,    -21,   -297,    231,  -1826,     47,    104,
-       284,   -171,   -198,   -110,   -193,    881,   -715,    294,
-      -490,    395,  -1261,   2859,  -3175,  -1477,    668,   -215,
-       310,     10,    762,   -837,    101,    142,    201,   -940,
-       453,    -82,    493,   -983,     23,   -211,    990,   1327,
-      4664,    -27,    821,    809,    500,    243,     41,    568,
-        44,   -320,    105,    461,    306,   -408,   -793,    -35,
-       -18,    229,    -12,   -416,    577,   -301,   4870,   -520,
-       499,     57,   -544,    -21,    611,    226,    -20,   -412,
-       440,   -680,    448,    430,    226,   -610,   -310,   -218,
-      1161,    523,   -400,   -148,    783,    395,   -126,    370,
-       686,   -497,   -301,    161,     -5,    238,    375,    357,
-      -126,    954,   5952,    -53,    121,   -405,   1571,    435,
-       461,  -1166,  -1163,   1347,   1394,    170,   2035,  -1580,
-      -958,    276,   -680,   -968,    275,   -323,    524,     48,
-     -1896,     46,   -495,    548,   -929,   -859,    224,   1079,
-       863,   3080,  -1594,   -379,    302,   -403,    710,    655,
-      -293,   -719,   -683,   -944,    228,   -341,    563,   -495,
-       920,    738,   -614,    552,   -249,   -402,   -164,   -262,
-      -425,  -4025,    164,   -984,   -518,    157,  -1156,   -729,
-      1024,   -768,   1003,    481,   -116,    319,   -918,   1563,
-      -662,   4852,    617,   -250,    549,   -265,    -93,    680,
-       470,    925,   -293,    629,    142,    231,     44,    133,
-        12,     40,   -867,    269,    -77,    445,  -1132,   -985,
-     -1304,    728,    424,    530,   -258,   -625,    377,  -1400,
-     -2538,   -470,  -1711,    413,  -1603,    -81,   -393,  -1013,
-      1130,    906,    287,    640,   3785,   -463,   -159,     43,
-      -165,   -441,   -513,   -287,   -554,   1547,    848,   -275,
-       936,    653,    769,    -58,  -1007,   -698,   -792,   2175,
-       398,   1382,   -122,    459,     -7,    281,   2785,   -637,
-       632,   -279,    293,  -1078,   -996,     96,   -293,  -1335,
-       -74,   -587,   -286,   -565,   -977,   -228,   5080,      3,
-       171,    111,    -34,   -177,   -619,    577,    448,   -280,
-       189,   1033,   -579,    134,   -713,   -947,   -249,  -1897,
-       364,   1748,  -2098,     21,    859,    -73,  -1881,    116,
-        36,   1591,   1386,  -1128,   -346,  -1015,    -25,    -90,
-      -691,   -984,   -120,     29,   -635,   -236,     26,   -691,
-      -742,   -203,    294,   -472,   -901,   2582,   -171,   -357,
-       406,    162,   1561,   -913,    308,  -3319,    461,    779,
-      -305,   -927,    290,   -941,    615,   -688,   -508,    222,
-      -432,    387,    170,   -115,  -5338,    508,   -212,    150,
-        26,    -38,    306,    -15,     50,   2008,  -1112,   -187,
-        44,    591,   -280,   1187,    934,   -228,    554,     65,
-     -1387,  -1999,   -805,   2555,  -1225,   -283,   -435,   -430,
-       -50,   -655,   -103,    248,   -234,     32,   -826,   -708,
-      -704,  -1006,    176,    784,    274,    626,  -2353,    707,
-      1852,   -132,   -196,   -169,   -463,  -2117,     56,    413,
-      -141,   -818,   -365,    921,   -816,   -126,   -135,    438,
-      -948,   -145,   -349,    700,    205,   1001,  -3626,    314,
-      -493,  -1182,    131,    733,   2404,  -1244,    564,   -960,
-       328,  -1137,   -108,   -755,   -168,   -995,    966,  -1706,
-      -565,    806,   -693,   1369,   -269,   -428,    675,    768,
-       341,   -794,   2265,   -208,  -1883,   -801,  -1889,    961,
-       182,   -504,   -595,    871,  -1280,    952,   1351,    665,
-       474,   1032,     58,    451,   -198,    345,    176,   -853,
-     -2891,   2250,    624,   -616,    183,    144,    736,      0,
-      -198,   -138,  -1218,   -501,   -658,    -24,   1232,   -286,
-      -233,   -937,   2150,  -1035,    449,   -623,  -2748,  -2176,
-       918,   -170,    421,   1376,     93,    153,    627,    493,
-        28,    549,   -292,   -175,   1066,   1037,   -475,    413,
-     -2006,  -2022,   -334,    365,    901,    945,   -663,    515,
-      -351,   -597,    155,   1318,   -153,    417,   -425,     44,
-       338,  -1958,   -355,   -596,  -2134,    360,    341,   2501,
-       824,  -2106,   -282,  -1723,   -735,   -550,   -743,    113,
-      1027,   -479,  -2114,    -16,   -631,   -282,  -1054,   1320,
-      -158,   -234,   3479,     28,   1818,    627,   1464,   -795,
-       -22,    897,     -6,    392,   -234,   -170,    714,   -382,
-      1262,     67,   -618,    145,     25,   -710,   -247,   -545,
-     -1386,  -1797,   -995,    865,    465,   -364,    830,    -53,
-     -1108,   -383,   -538,     85,    731,   -188,   -813,      2,
-     -1667,   3379,    289,    425,   1319,   -259,   -592,   -212,
-       271,   -268,   -126,   1282,    306,   3859,  -1423,    607,
-        20,    755,    174,   -782,     72,   -234,    675,  -1177,
-      1101,   -635,  -1641,   2574,   -978,  -1390,  -1743,   2183,
-        53,     75,    650,    -97,   -456,   -126,   -719,   -675,
-       557,   -375,    643,    853,    -81,   -192,  -1174,  -1288,
-      -954,   -883,   -806,  -2182,  -2111,  -1426,    180,   -266,
-      -301,    626,   -443,     61,   -149,   -443,   -935,    -48,
-       642,    250,     17,    596,   1342,  -2127,    323,  -1456,
-      1995,    837,  -1456,  -1683,    945,   -722,  -1445,    452,
-       178,   -441,   -250,   -137,   -128,    -50,   -311,   -600,
-      2237,    922,    139,   -107,   -637,   1770,  -2503,    413,
-      -803,    496,    209,   -391,    401,    412,   -552,    605,
-       -37,   -667,  -1609,    -19,  -1073,   1522,   -705,    670,
-      -992,    882,  -1213,   -854,   2150,   -371,     73,  -1167,
-      -592,   -153,   -509,   -584,   -495,    -83,   2075,  -1489,
-       719,   1245,  -1138,     72,    950,   -950,    542,   -590,
-       988,   1646,    -64,    562,   -223,     73,    583,   -151,
-       215,    914,   1391,  -2997,    161,    436,     49,   2225,
-       271,   -283,   3844,   -578,    335,    -90,   -698,   -162,
-      1236,   -117,    470,    383,   -718,    520,    295,     29,
-       292,   -179,    774,    204,    372,   -251,   -824,   -487,
-     -1822,   -312,   -731,    568,  -1008,   -255,    189,  -1195,
-       657,   -227,   3422,    651,   -220,  -1204,   -590,    713,
-       365,   -977,    204,   3118,    321,    922,   -347,   1505,
-       375,    -77,  -1520,  -1411,   -680,   -507,    543,   -492,
-     -1844,    135,    689,    384,   -408,    140,    633,  -1192,
-       475,    220,  -1711,  -1318,    606,   -103,   -712,  -1734,
-      -218,   -855,   -835,  -3071,   -109,   1391,     62,     21,
-       -75,    -77,    369,    216,  -1484,   2057,    661,    314,
-       275,   1048,    175,   1842,    743,    808,   -594,    338,
-     -1217,   1606,   -531,  -1360,  -1073,    452,   -531,   -798,
-      -771,  -1292,   -918,    606,  -1776,   -509,    178,   1422,
-      3424,    634,    722,   -257,    525,    437,   -197,   -130,
-       291,   -411,   -259,   -890,    -84,    368,   1117,  -1321,
-      -324,  -2122,    515,   1158,   1749,   -963,    681,     39,
-       268,    549,    324,   -601,    151,   -200,    829,   3881,
-       797,    660,   -572,   -693,    633,   1023,   -147,   -581,
-       102,   -207,   -163,   -511,    -30,   -102,    379,    776,
-       494,   -510,     55,  -1811,   1073,   4384,   -318,   3277,
-      1958,   -209,   -539,   1823,   1200,   -182,   -186,    213,
-       123,    506,   -471,   -431,   -698,   -331,  -1168,     88,
-       276,   -184,    733,   -295,  -1053,   -717,    862,  -1453,
-     -4235,   1063,   1049,   -621,   -429,    372,   1043,    599,
-       271,   -693,   -689,    122,    466,   -323,    332,   -533,
-       645,    516,   -371,   -207,  -2046,     72,  -1125,   -229,
-     -2769,   -330,   1387,    -89,    342,   2786,   -730,    152,
-       629,    809,   -459,   -248,   -266,    111,    380,    724,
-      -411,    640,    -72,    323,     34,   -277,    443,    289,
-       151,  -4816,    402,   -171,   -731,    635,    -84,   -133,
-      -310,    397,    904,   1193,  -1512,    -25,  -1306,    587,
-       322,  -3762,    537,   -306,   -981,    917,    190,    787,
-      -613,    149,    301,   -376,    366,    350,     18,    893,
-};
-
-static const int16_t cb1110s1[] = {
-      -332,   1306,   1626,   1555,  -3510,   -225,    418,   1520,
-      -969,    -74,   -286,    233,   -313,    -97,    375,    181,
-      -309,   1348,    969,   -504,   -141,    789,  -1224,   -137,
-      -704,     98,   1003,    466,   2259,   1485,   -225,     61,
-       272,   -223,   -347,    -23,   -368,     96,   2345,    112,
-       363,   -552,     -6,   -806,  -1637,  -1703,   1597,  -2114,
-      -196,    293,  -1173,   -630,   -863,  -1224,    784,   -722,
-       744,    885,    798,   -384,     92,    298,   -873,   1808,
-      1389,    488,  -1569,  -1541,  -3064,   -734,      3,    467,
-      -987,    346,   1915,   -683,    205,   -487,    341,   -330,
-       274,    -25,     49,    -83,   1246,   -405,   -777,    266,
-       121,   -250,    466,  -1232,  -3197,   -871,   -638,   -332,
-      1563,   1900,   -470,    556,   -465,   -412,    901,    -86,
-      -683,   -577,  -1033,    808,   -863,   1212,   -724,   2222,
-       429,   2733,    413,    891,   1669,    515,   -439,    187,
-      -359,    414,    176,   -706,    679,    -63,   1247,  -1721,
-       779,  -2770,   -484,   -633,   -993,   -243,   1442,   -312,
-      -324,   -370,    392,   -407,    229,     97,   1267,    -18,
-        46,   -303,   -684,    515,   -166,   4212,   -775,    -23,
-       -53,     23,   1966,   -465,    231,   1195,    252,  -1036,
-        16,   -824,   -116,   -582,   -286,    470,   -159,    217,
-      -456,    549,    648,     60,  -1119,    221,   -747,    354,
-      -628,   -486,    894,   1280,  -2631,    247,    430,  -1703,
-        69,   -236,    147,   1445,    540,   -936,    181,   -163,
-       931,  -1044,    669,   2457,    519,    597,  -2031,     11,
-     -1319,     -4,  -1190,     85,    254,  -1494,    230,   1583,
-      -547,    277,  -2006,   -103,   1195,  -2522,   1301,   -633,
-      -104,   -511,    573,   1628,   -451,  -1022,    564,   -692,
-       255,   1029,   -408,    757,    172,   -395,   -472,  -1703,
-     -1856,   -379,    289,    509,   -628,  -1349,   -207,    404,
-      -399,   1671,    392,   -935,   -190,    952,  -1267,   1150,
-      1562,   -609,    491,   -346,   -270,   -483,    310,   1420,
-     -1017,   1714,   -645,    897,  -1327,   3154,  -1046,   -857,
-      -499,   -496,  -1348,    399,     63,   -653,   -315,    820,
-      1645,    614,   2202,    779,   3001,   1382,    387,   -843,
-     -1840,    422,  -1017,    246,   -219,   -550,    105,   -608,
-       426,   -346,   -224,    375,     22,   -448,   -270,  -1150,
-      -897,   4298,   -882,     49,    633,   -937,   -694,    675,
-      -322,   -793,   -516,   -360,   -248,   1190,    575,   -843,
-       -13,     50,   -801,   1181,    452,   -335,   -495,   -102,
-     -1057,    506,   -206,     66,   -647,    991,    259,    259,
-      -468,    197,    373,  -4216,   -750,    224,   -182,    520,
-      -530,   1888,  -2018,  -1492,    656,  -1447,    993,   -790,
-      -785,    792,   1658,    373,    131,   -460,   -703,   1080,
-      -875,   -212,   -694,    747,   -639,  -2267,   1263,   -415,
-      -749,  -1278,    591,   -745,   -225,  -1677,     69,    625,
-      -146,    212,    345,    728,   -553,   1117,    471,    550,
-      -498,   -729,  -2070,   1006,   -330,    939,   3636,     34,
-       349,    761,   -131,    372,    610,   -399,     10,     86,
-       110,    931,  -1159,   -175,    633,    568,    140,    712,
-      2800,  -1558,   2343,      3,   -974,   -673,    233,   1436,
-      -783,    599,   -442,    852,    639,    447,   -976,   -564,
-      1511,     36,    529,    433,    677,   1971,   2777,   -820,
-      -655,  -1463,  -1392,  -1142,   -352,    432,    730,    439,
-      -273,    844,    108,    115,    408,   -361,    504,    337,
-        58,   1074,  -1645,  -1623,   -493,    -70,  -1585,   2878,
-      -741,    636,   -224,   -974,    722,   -147,    149,    135,
-      -107,   -154,  -1027,    -18,   -989,    282,   3173,   1123,
-      -778,   1389,   -591,    337,   1660,   -288,   1162,    -65,
-       660,    326,    141,    358,    679,   -222,    460,    105,
-       512,     36,   -854,   -477,   -942,  -2362,    265,   2252,
-      -164,  -2059,    106,    666,   -420,    521,   -178,    396,
-     -1836,    475,     82,    356,    207,    433,  -1005,     97,
-       385,   -304,   -853,   1282,   -239,  -2134,     83,     84,
-       201,  -1894,  -1603,    683,  -1957,   -113,    839,   1187,
-      -313,    774,   -754,    941,   -739,    748,    116,    716,
-      1134,   -530,  -2178,     71,   -611,   1544,   3527,     -3,
-       283,    527,    457,    399,    762,     17,   -279,    196,
-      -518,   -160,  -1204,   -289,  -1354,    132,   -315,   -290,
-     -2179,    676,  -1474,  -1010,  -1397,    363,    -45,    783,
-      1326,    -33,   -109,   -617,   -271,   -967,   -103,   1867,
-       769,    740,   -818,   1011,   1411,   -693,  -2458,    808,
-       806,   -213,    468,     31,    -70,    166,    230,   -405,
-       163,     70,    652,   1077,   -190,   -622,   2343,  -1328,
-       601,    928,  -1661,    174,    429,  -2479,    501,    503,
-       -41,   1365,    671,   1006,  -1968,      7,    103,   -399,
-      -382,    573,    -27,    554,  -2263,  -3174,    277,    177,
-       807,   -328,   -816,    453,  -1548,    828,   -327,    187,
-      -393,   -745,    -76,   -808,    575,     -8,   -326,  -2062,
-       601,    566,    755,    775,    595,    419,  -3925,   -226,
-       272,    368,    395,     59,   1117,    548,   -649,   -429,
-       321,    549,   -744,    319,     82,    135,     73,     14,
-       374,     93,   -270,   -453,    177,   4991,    569,    169,
-       111,   -246,   -362,    -88,    -49,    583,    -35,     60,
-      -759,   1327,   1768,    766,   -350,   -880,   -106,   -449,
-      -113,   -683,   -418,   -999,    992,    559,   -290,   -147,
-      -324,     93,   -947,  -3932,    -37,    307,   1087,   -314,
-      -293,    432,    830,   -130,   -208,     59,    719,   -348,
-      4511,    224,    488,   -174,    588,    795,   -301,   -246,
-      -447,    682,    917,  -1207,   -503,   -450,    575,   -116,
-      -126,    594,    -22,   -101,      5,  -1188,   -431,   1146,
-     -3869,    -72,    402,   -417,   -390,    350,   1141,   -138,
-       697,     77,  -3255,   -268,   -786,   -106,  -1386,    400,
-      -856,   -691,   -438,  -1550,   -228,   2162,    236,     64,
-      -382,      1,   1032,    153,   -659,   1563,   -410,   1280,
-      1573,  -3675,  -1041,    240,    401,    215,   -353,  -1140,
-       265,   -103,   -824,    -93,   -319,   -849,    253,   -477,
-      -463,    153,  -1017,    538,   1233,  -1041,     11,    998,
-      -437,   -569,   -970,   2118,  -1577,      1,    321,   1784,
-      -298,   2315,     72,    -20,     83,    905,  -1289,   -246,
-       731,   4076,  -1477,    602,   -911,    978,    698,   -239,
-       391,   -729,   -276,    225,    143,   -417,   -500,    -27,
-     -1220,     89,   -403,  -1453,  -2546,   1015,     70,     78,
-      2364,   -159,   -775,     29,     37,   -231,     73,    433,
-       426,   -529,    420,   -613,   -100,   -605,   1463,   1001,
-      1159,  -4082,   -553,    348,   -806,    624,   -162,  -1121,
-       -25,    919,    -62,     90,   -275,    233,    203,     32,
-       745,   -221,    458,    529,    901,   1088,     38,   1209,
-       450,    451,   2250,   -411,   -205,    761,    249,  -1226,
-      -266,  -3195,   -801,    -31,   1015,   -324,   -596,    -42,
-       150,    207,   2597,   1041,  -1045,  -2254,  -1428,    250,
-       217,     69,   -933,   1424,    280,    446,    524,    540,
-       639,  -1027,     23,    412,     36,    -67,    475,  -1126,
-      -739,   1160,    514,   -157,  -2832,  -1432,    559,     77,
-       740,   -888,    134,   1304,   -267,   -267,    329,      8,
-      1721,   1488,    -29,  -1760,  -1904,  -2634,  -1342,   -528,
-      2233,   -219,   -194,  -2919,    128,   1203,   -623,   -127,
-       488,   -386,   -133,   -329,     62,     85,   1271,   -185,
-      -479,   -588,  -2964,    546,   1651,   1526,   -830,   1046,
-       347,     63,  -1048,    239,   1402,    -22,    307,  -1606,
-       768,    999,    304,   -512,   -175,   -246,   -373,    529,
-        93,   -521,   1310,   -508,  -4366,     27,   -768,   -358,
-      -575,     -2,   -593,    -21,   -838,    635,    197,    634,
-       321,   -263,   -377,   -549,     20,    739,    395,     -9,
-      -392,     70,   5679,   -133,   -130,   -240,   -678,    421,
-      -101,    412,    143,    209,    194,    216,    200,    -22,
-      -748,   -399,   2863,    284,    231,    691,    571,  -3460,
-      -200,    312,    480,  -1338,   -603,    435,   -308,   -615,
-       520,    178,     68,   -716,     45,   -593,    -32,  -1393,
-      -554,  -1000,   -867,    613,    288,    507,    202,   -113,
-        17,     93,   -141,    -47,    665,    559,   -808,  -4091,
-      -575,   -193,   -873,   -790,    673,   -608,   -941,    745,
-      1562,  -1060,    988,   1192,     29,  -1207,    207,    653,
-      -622,   -132,    370,   1435,   1977,  -1878,   -119,    101,
-      -100,   -154,   -869,  -2375,   1254,    122,    188,    877,
-       188,   -838,   -355,    667,   3813,   1076,    369,   -771,
-      -712,   -669,    -14,    107,   1027,    112,   2306,   1418,
-       133,   1055,    377,    249,   1023,   -927,     12,  -1983,
-      1174,    223,    385,    827,   1425,  -1694,  -1178,    -94,
-      -593,   -286,   1263,   -671,   -425,   2002,    701,   1546,
-       547,    182,   1013,    128,    351,   -243,    407,   2349,
-      -376,    445,    -93,    968,   -337,   -601,   1342,    987,
-     -1499,   -644,    521,    327,   -557,   1800,     12,    285,
-       127,   -269,  -1989,   -449,     87,  -1042,    184,   -499,
-      1231,  -1664,   -352,      4,   1253,    403,  -1064,    837,
-     -1702,    133,   1687,  -1300,   2248,    179,   -847,   -617,
-       460,    450,   -260,     94,   -780,   -675,   1209,     38,
-       453,    857,   -631,    317,    535,   1086,   -196,    638,
-      -288,   -389,    688,    -93,   1271,  -4290,    -96,    445,
-        64,   -211,    148,    -74,    486,  -1873,   1214,   1836,
-      -708,   1800,   1644,    576,  -1088,  -1212,   1147,   -456,
-       173,   -911,    489,   -443,    644,    534,    846,  -1522,
-      -786,    497,   -401,  -1087,   1410,   1391,    837,   -253,
-       124,   -598,   -254,  -3945,  -1169,    103,   -193,     50,
-       846,  -1014,    353,    455,    784,   1343,   3055,    178,
-      -628,   -148,   -266,   -324,    -96,   -190,   -930,    115,
-       475,   -651,   -314,    -82,   -236,    -88,  -3753,  -1048,
-      -283,   -178,    351,   -671,    325,   1054,     28,    540,
-       113,    -73,    763,    844,    543,     -6,    799,    245,
-       176,    124,    262,   -112,   1010,    361,   -843,   3290,
-     -3741,    914,  -1835,   -259,   2467,    297,  -1205,    168,
-     -1917,    156,     87,    637,   -677,   -955,    312,   1246,
-      -219,     92,   1090,   -292,   -773,    343,   -523,    299,
-      -513,   1321,   -536,    586,  -1324,   2345,   2384,   -719,
-      -936,   1389,    -27,    880,    338,   -127,   -666,   -441,
-      1603,    143,   -218,   2167,  -1335,    469,  -1224,   2489,
-      1365,    568,     19,  -1322,   -736,    208,   -494,   -454,
-       990,   -250,    305,   -575,    206,   -168,  -1177,    282,
-};
-
-static const int16_t cb1110m0[] = {
-       429,   -104,   -210,    216,    361,  -2586,    253,  -1350,
-       145,   2795,     -5,    663,   -262,     37,   -122,    205,
-       270,    321,   2623,    256,      4,    -42,    -37,    112,
-      -346,     20,    -51,      9,    -90,  -3342,     78,     52,
-      -239,   -454,   -207,    355,   -136,    -19,    394,   -212,
-      -166,    -73,    -68,   1049,  -2945,    385,   -545,   -211,
-       116,    -15,    687,   -232,   1824,    -66,    133,   -403,
-       -63,      3,     46,   -104,   -101,    136,    -61,    420,
-       149,    -24,     -9,   4277,   -149,   -166,     96,    -35,
-      1786,  -1044,    115,  -1326,   3381,   -520,     70,   -134,
-      -433,   -198,    146,   -615,   -143,    201,    342,    412,
-      -162,     22,    111,     16,    -85,     14,   -120,     79,
-       -30,    -84,     56,    -34,    -52,   -147,     19,    155,
-        17,   -120,   5853,     96,    767,    262,   -194,    124,
-      -180,     13,   3081,     39,    402,     90,    292,     84,
-      1999,    -16,    866,    292,    416,   -314,    177,     -1,
-        68,      3,    -28,    -56,    -54,     10,     -5,    -63,
-        89,    -69,   -251,     70,   7523,    -83,     67,     62,
-       178,  -1723,    -76,    101,    369,   -139,     58,    135,
-       -32,    138,   3393,   -575,    586,    292,   -296,   -505,
-      -634,     52,    280,     78,     14,    117,    -39,     77,
-       231,    136,     14,     51,    173,    -96,      5,    378,
-       -52,  -4340,   -263,     61,     22,  -2896,    -20,    180,
-        21,   3636,   -138,    104,   -279,     56,   -407,     -8,
-      -123,    134,    -95,   -500,    266,    -64,    -43,      1,
-      -170,     31,    110,     53,     56,  -5938,    151,     49,
-       -76,   -166,     34,     -8,    193,    198,   -118,     -4,
-       -44,    249,    -28,   -102,  -3614,     49,    464,   -388,
-      -744,   -500,    603,    -88,    -19,   1606,    325,   -227,
-      -277,   -142,    232,  -1835,    150,    -89,     29,      9,
-        76,    425,   -320,    179,    231,   1720,    424,  -2730,
-      -298,    666,     72,   -428,  -1243,   -299,     93,    -12,
-       -20,    -96,   -123,     18,    188,     -1,   -235,     -2,
-      3328,    107,  -1489,    199,    893,    -63,     46,   3799,
-        22,   -118,   -127,    283,    254,  -2091,    293,    331,
-       857,    -92,     46,     13,   -457,    169,    851,    -19,
-      -231,  -8735,    -62,     69,   -190,   -103,    -31,    108,
-        66,     95,     53,     -6,     12,     19,    -73,    105,
-       -40,    -29,     60,   -263,   -107,   2233,   -246,    485,
-       342,   1732,     76,   2489,     40,     44,   -300,    280,
-      -109,   -107,   -990,    -45,   1014,  -5073,      1,   -169,
-        25,    -55,   -340,   -427,    603,    206,    151,    360,
-       312,    -44,   -106,    514,    683,     98,   3331,     19,
-      -106,    106,  -3383,     85,   -161,    -88,      8,     12,
-      -163,    183,   -393,    117,   -243,   -498,    -60,    292,
-      -322,  -2105,    920,    301,     41,    -19,   -142,  -2485,
-       631,   -289,   -849,    132,    800,   -255,   -390,    137,
-      -850,   -411,     41,    -93,  -8653,      9,    -25,    134,
-       -66,    222,    152,     59,     29,   -193,   -129,   -105,
-        39,    -21,    188,    111,     25,     -3,      0,    -79,
-      8907,    -24,    -18,     37,    -33,    -42,     87,    -44,
-        56,    -79,    -67,    -52,     18,   -132,   1925,    309,
-       145,   -443,   1279,    200,   1215,    281,   3343,    311,
-       390,   -154,   -119,   -523,     19,   -529,    190,    272,
-       541,   -393,    278,    161,     13,    161,    891,    -65,
-      -199,  -1376,   -350,  -1409,    340,   2115,   -209,   2459,
-        30,   -509,    141,     11,   -557,  -1560,  -1912,   -234,
-        76,    787,   2781,     45,   -158,    330,   -623,    655,
-      -845,   -463,   -119,   -252,   -299,  -1940,    145,     17,
-      -183,    -71,     98,     67,    145,   -134,    -88,     -5,
-     -3636,      3,     34,    231,    981,     33,   -953,   -403,
-       129,    215,    -11,    109,   -188,     51,   5176,    -89,
-      -113,     60,   -138,    -94,    142,    216,    322,    -33,
-       350,   -285,    182,     92,    -16,     12,     15,    126,
-       -27,      5,  -5220,   -154,     13,    109,     18,   -326,
-      -257,    118,    313,    342,   2289,    -35,    -22,    115,
-      -256,  -2908,     68,   1211,    203,   -735,   -380,   -134,
-       249,    522,    109,    -48,  -5114,     32,    -42,     85,
-       -99,    265,   -187,    -93,    373,    341,   -254,     16,
-      -121,    -92,   -260,    -80,     -2,   -322,    234,    -96,
-     -2834,    230,    146,   -264,  -3287,   -153,     41,   -349,
-      -149,    -98,    140,   -115,    628,    -11,    292,      4,
-      -166,     82,  -4548,    116,    -23,   -311,    612,   -334,
-       451,    259,    559,    320,   -267,    517,   -139,   -166,
-       126,     27,    -89,   -156,     14,     63,     -3,     31,
-       109,    -43,     10,  -7682,     36,    -23,     73,    129,
-         0,   -116,     66,      5,    137,    -17,   2523,    203,
-       431,  -2729,    175,    540,    454,   -175,   -297,    -60,
-       348,     53,    688,    -49,    133,    -72,    200,   -348,
-       136,   -142,  -2259,  -3047,    -60,   -737,     48,   -331,
-        85,   -134,    218,   -962,   -278,   -148,  -1077,   -131,
-        53,   -127,  -2265,     82,    -31,   -262,    226,   -385,
-        83,    756,  -2715,   -492,   -115,    663,   -312,    240,
-      -318,   -819,   3040,   -181,    148,    165,    376,     92,
-      -233,    188,   -100,    902,   -401,   1005,    -52,    162,
-       219,   1831,    -68,    -66, -10023,    -90,    -23,     39,
-       -91,   -231,     23,    174,     42,     79,    -57,    -58,
-        18,    175,     32,    122,   -185,    266,    162,    300,
-     -3158,  -3381,     -3,   -312,    178,    -24,   -234,    248,
-        68,    293,    360,   -146,    -30,     -2,    177,    113,
-     -1215,   -538,   -274,     79,     -2,    -17,   2791,     71,
-     -1300,     93,   -818,   -558,   -331,    115,    215,   -603,
-      -202,    113,    -87,     39,   -277,   3564,     75,   -444,
-       201,    111,   -369,  -1072,    212,   -276,   -322,   -484,
-      -700,     37,   -302,    177,     86,     10,    -87,     56,
-        76,  -8941,    -27,    -73,   -133,    -51,   -106,    -28,
-       -52,     49,     68,     26,     16,    -81,   -423,   2834,
-         7,    -54,   -107,    144,  -3812,     17,   -355,      3,
-       -32,    -24,     14,     76,    169,   -260,    349,   -159,
-      3691,   -184,   4345,    -46,    146,    -14,    143,   -384,
-       -75,     12,    144,    105,     47,    141,    -32,    -31,
-        48,    187,     74,    139,    132,     86,    -15,   -317,
-      -267,   3112,   1821,   -363,   -125,  -1152,   -294,   -449,
-       277,   1151,   -341,     12,    -41,    210,    -51,      6,
-        18,     53,     11,     37,    -36,    -70,     65,     44,
-     -7302,     15,   -133,     56,    150,     63,    515,    271,
-       -32,     47,     41,   -130,    168,   -158,   -239,    -60,
-       226,    247,   -593,   -237,  -3559,     65,    623,     16,
-      -212,     26,   -181,     81,     83,     26,    -25,    -92,
-        -5,     36,    -31,    277,   -263,    135,     78,   -173,
-       220,  -5260,   2239,    -96,    -19,    -95,     75,    -25,
-       -64,    244,   -154,  -2646,   -446,    980,    512,    392,
-      -402,  -1050,    276,   -456,  -1334,   1863,    636,  -1512,
-       234,    199,    237,    363,     66,    284,    198,   -277,
-      -267,   -540,   -329,    856,   -482,   -645,    178,   -240,
-      -178,   6633,     -5,    127,    -80,   -167,    307,      7,
-       248,     13,     53,    124,    215,   -310,    255,   -194,
-     -3066,    -22,   3524,     51,    193,    165,     82,    -80,
-        54,   -191,   -278,    -19,    379,    285,    -58,   -157,
-      -168,   -183,    388,   -198,    191,    107,     10,     -2,
-     -6148,     45,    -58,     48,   -150,    -72,    112,   -124,
-       -41,   -129,     36,    -66,  -3311,  -4092,     15,    -11,
-        93,    -54,     72,   -105,    131,     66,     29,    -54,
-       201,   -210,    221,     47,     55,    -99,     31,  -3626,
-     -3623,   -175,     91,    -53,     40,    -98,    -76,    224,
-        15,    172,     85,    103,   -147,   -135,   -214,   -313,
-      1304,    143,    190,     19,  -2526,    -91,   -168,    875,
-       -27,    789,    791,   -462,    912,   -580,     70,   1523,
-       787,   -150,    567,   2717,     -5,   2943,   -107,    155,
-        32,     65,    158,    133,   -191,    -44,    141,   -149,
-       199,    177,    270,    -14,    -57,  -3669,   3891,   -158,
-       239,    -17,     52,    244,   -343,   -118,    186,    -54,
-      -134,    106,   -133,   -116,    186,   -149,   -894,    -22,
-      -399,      1,    288,  -3988,   -260,    113,     66,   -276,
-       179,   -226,    119,    420,     51,   -483,    551,    129,
-       245,   2013,    639,    -87,   5058,     41,    -53,   -116,
-      -130,   -223,   -104,   -760,    276,    117,    338,   -137,
-      -233,    -65,    119,    100,  -3245,      2,   3877,    126,
-       172,     -2,    -72,   -153,    200,   -109,    -62,    135,
-       194,    -82,   -150,     98,    550,   -251,   -274,     71,
-       160,    121,    -13,   -365,    356,   -212,   -271,   5067,
-      -203,   -251,    222,     75,   -131,     17,    103,   -911,
-      -348,    -26,      6,    110,    120,   -645,    355,   -649,
-      -132,  -3416,     65,  -1478,    461,   -109,    258,    -15,
-};
-
-static const int16_t cb1110m1[] = {
-      -110,   2743,    -31,     86,    -11,   3705,    192,    -89,
-        57,   -252,    -11,   -212,    163,      0,   -137,    405,
-       -99,   -124,   -137,   -407,    125,    106,   -922,   1567,
-        85,    165,    241,    110,   2918,    598,   -443,    812,
-       159,    518,    555,  -1886,    -65,    -52,     -3,    -27,
-        56,    -30,   -126,    126,     23,     74,    157,   6990,
-       -34,     56,   -257,   -172,    115,    -23,   -616,   -243,
-      -441,     34,    159,      6,     78,   -119,     49,     34,
-      -133,    988,  -1007,    474,     77,   -274,    354,   4907,
-       222,    -16,     69,     -4,    924,    -18,   3535,   -299,
-       -38,    -83,   -111,    977,   -138,  -1075,   -444,    540,
-       199,    202,   -502,   -194,   -198,    249,    101,    276,
-       -89,     96,   -301,      6,  -4023,    -70,    174,     93,
-       192,   -120,    755,   -560,    -22,     78,     56,     29,
-        28,    -44,     65,     -4,      0,     49,   -250,     87,
-        46,     44,    -41,  -7035,     14,    288,    632,   -259,
-       -64,     20,   -178,   -343,   -274,    106,   2842,    336,
-      -283,    245,   -612,     -5,    500,     77,   2492,   -250,
-        64,    171,   -988,      4,    -51,    -34,   -555,   -171,
-     -2629,    272,   2852,   -162,    -98,   -237,   -278,   -489,
-       641,    -96,   7815,   -139,   -116,   -137,   -121,   -314,
-      -161,    211,     76,    136,    -35,   -124,    -27,     76,
-       -98,    133,     85,    332,  -4352,    507,    -14,   -275,
-      -212,    308,    258,    129,   -165,   -197,   -104,   -150,
-      -104,     60,    125,    568,     -3,   1694,     62,    -70,
-       109,    122,    -57,    -18,   8642,    100,     50,     92,
-        17,    -86,    -93,    -68,   -121,    -61,    -32,     27,
-      -188,    502,    123,    -81,     37,     48,    187,     75,
-       -30,    -22,   -224,   -292,     99,    -49,   4273,     10,
-       834,    -25,    225,   2773,     78,  -3281,   -181,    234,
-      -130,    -74,    101,    214,    -26,   -113,   -268,   -168,
-       -90,   -435,    -26,     38,   -569,  -4009,     -1,     11,
-        69,      3,    249,     98,    178,    131,    300,   -826,
-        48,    337,   -828,   -371,     96,    312,    712,   -667,
-       -70,  -2070,   -242,    519,   -676,    143,   -613,    893,
-     -2193,    471,   1071,    213,  -1231,   -196,   -580,    155,
-       401,     78,    -64,     27,   -238,     22,    -73,    -19,
-       194,     60,    -87,   -210,   -155,    244,   -123,   -169,
-     -4442,    169,   3132,   -181,     65,   3950,   -396,    209,
-        39,    -52,    -26,    166,      1,   -164,    143,    -66,
-       169,     46,    -16,   -295,     39,     42,     40,     67,
-        25,     17,     -1,  -8920,    -82,    -42,     49,     81,
-       -61,      1,     39,    -40,     18,     74,    206,   -131,
-       -71,    106,      7,     88,    -13,     69,   -113,    -89,
-       212,     -4,   4373,    -34,    283,    105,    252,     59,
-     -2578,   -298,   1846,   -110,   -105,   -310,   -143,   -127,
-       274,    225,    861,    262,   -815,   -311,    -26,   -685,
-       243,   -620,   -374,   2992,   -112,    -35,   2903,    -94,
-       -56,   -213,     65,    383,     41,    508,   -258,   -103,
-      -440,   -237,    428,    132,   2793,    -77,   -113,    -58,
-       -19,  -3857,    -25,     40,   -167,   -243,   -233,    -41,
-      -279,    213,    -22,      8,    120,    126,    159,   -212,
-      -244,    183,   1605,     62,    -12,   -244,    519,    780,
-       116,  -3197,   -992,    341,    222,    681,   -357,   -669,
-        55,   1213,    100,    441,      1,    -57,    232,     10,
-      -114,    318,   -147,     89,    188,    448,   -327,   3735,
-      -292,    875,   -216,    211,    111,    160,    172,    286,
-     -3513,   -849,   -185,     -9,     31,    442,    747,  -1045,
-       187,    704,   -219,    509,     48,     69,    -25,    -10,
-        75,     23,     10,     23,    -32,     89,   8628,    -77,
-       -19,     27,      0,   -232,     22,    -50,  -1904,   -137,
-      -169,    128,    138,     78,   -443,    243,    157,  -3809,
-       231,    277,   -341,     73,    -70,    596,    259,    157,
-      2197,    575,   2445,     11,    -53,    118,   -115,    562,
-       108,     30,   -241,     30,   -394,   -155,   -186,   -344,
-      -237,   -319,  -2258,    343,   -311,     14,    169,     59,
-       -15,    233,    732,    365,   -692,   -108,   1416,   -463,
-      -279,   -248,  -1731,   -406,   -278,    298,    209,   5333,
-      -198,   -167,     50,    439,    142,     91,   -523,    226,
-       262,   -130,    -15,    573,     -4,    271,     -2,    -47,
-         7,  -9106,    -69,    -44,   -144,    -98,    199,   -181,
-         6,     45,     47,     37,    -51,    -68,    -50,   -116,
-      -105,     49,    376,   -420,    187,   2894,     29,   -471,
-      -221,    455,     -1,   -858,     55,   -197,    359,  -1972,
-      -188,    921,   -134,    186,   -843,  -2542,    322,     -1,
-      -158,   -352,   -307,   -578,    -60,    143,  -1302,    333,
-       681,   1373,  -1021,     18,    284,    -28,      8,    -57,
-       -16,     15,     58,     31,   8389,    -35,     18,     77,
-       -78,     15,     36,     17,   -134,    -17,    316,   -680,
-       491,     38,   -217,   -278,    276,   -299,    -75,  -4030,
-      -293,   -507,    -62,   -344,     64,   -438,   -344,   -256,
-       341,    199,    -66,     28,    -17,    -17,      2,    142,
-         6,    -48,   -169,    -27,   -117,   6739,     42,    -61,
-       140,    246,   3357,  -3243,     48,    -55,     49,     27,
-         4,    172,   -169,      6,     69,   -265,     70,     25,
-       223,     28,    129,    231,     57,  -1608,   2640,    -28,
-      -197,     29,    -11,    138,    621,    427,     20,    514,
-       663,    562,    447,   -158,   -909,    343,   -321,   -257,
-      6641,     -1,    -20,    -70,     62,    241,     51,    -83,
-       -48,   -156,   -266,   -335,    -43,    421,    350,    306,
-       165,   -541,     47,      5,    -40,    364,     21,    190,
-     -4584,   -125,   -441,    489,   -571,    -47,    -10,    205,
-        60,    -73,   -584,    417,    233,    -34,   -109,     85,
-        41,    134,    485,   -171,   -183,  -1522,    202,    390,
-     -3112,    144,   1675,    651,    402,   1953,    120,     93,
-      -276,  -1930,   -197,    -61,    100,     81,   -250,   -155,
-       -19,    336,   -178,  -2340,     88,   -543,    226,  -2507,
-       -60,    -62,    218,     -9,    158,  -3617,    -66,     32,
-       314,   -192,   -121,    372,    334,    516,    412,    247,
-      -609,  -1237,    312,   -120,    -39,     47,     61,    -63,
-       -90,   4500,   -191,   -353,     10,     54,   -163,   -345,
-       121,   -318,   -235,    190,    -99,    181,  -3369,      4,
-      -188,    -87,    128,    167,   -507,  -1132,   -666,   -354,
-       121,     43,   -546,    601,   -409,    181,    -47,   -315,
-       127,  -2845,    487,    186,  -2724,    343,    177,   -837,
-       387,    -84,    259,    122,   -159,     88,    117,    137,
-        79,    126,   1584,   -521,  -2448,   2648,   -246,    -75,
-       567,    114,    244,    653,   -551,   -196,   -623,    205,
-       816,     48,   -326,     66,    -94,    -33,    133,    412,
-      -241,    491,    -32,   -712,   -249,  -3756,   -185,   -229,
-       248,    268,    557,     73,    164,     24,    -70,    -27,
-        54,   -156,    -51,    -47,    -26,     43,    187,    179,
-       -38,   -137,    218,   1916,   4614,    435,    -15,     21,
-       145,   1868,    241,    240,    299,   -204,     73,    -24,
-      -118,   -372,    -89,     23,   -298,    479,   2837,    959,
-       -76,    -85,     -2,     28,     94,  -3245,     28,   -130,
-       159,    295,    264,   -419,    -98,    -16,   -159,    349,
-       202,   -158,  -2680,   -210,   -390,    -18,     -8,    364,
-      1367,   -110,    932,   -232,   1348,    -80,    865,   -291,
-      -408,    406,   -118,   6462,    -55,     10,   -152,   -161,
-      -132,    231,    258,    135,    -13,   -104,    247,    207,
-      -238,    212,    -19,    -31,  -3303,   -160,    -24,   3402,
-        50,    116,   -191,     97,   -139,   -100,     71,    -49,
-      -293,    133,   -120,    -10,    197,    196,   -516,   -686,
-        79,    -52,   6002,    -47,     88,   -201,    146,    136,
-        54,    162,   -180,    287,     67,     70,    -55,    210,
-     -1938,    635,   -162,     82,   -120,   -456,    -75,  -3753,
-       -83,    176,    137,     18,     -6,   -281,    232,    137,
-      -167,    373,     78,  -2622,    -38,   -293,     89,     69,
-     -3476,      8,    152,    136,     32,    -15,   -140,     11,
-         6,     13,    481,   -175,   -228,   -254,    158,  -3423,
-       206,     22,    900,   2025,    266,   -402,    132,   -356,
-       558,   -592,   -262,   -419,   1002,     73,   -246,    -24,
-     -3145,   3220,    -33,    283,    398,    -31,    -25,     -7,
-       103,    -93,   -143,      1,     32,   -497,    206,    -35,
-      1424,    114,    140,   2393,   3245,   -218,   -163,    113,
-       191,   -164,   -215,    504,   -256,    140,   -364,   -226,
-      -340,     91,   -464,     32,    188,      4,     15,  -6068,
-        69,    109,    219,     75,    196,    -24,    -84,   -218,
-        27,     57,    -97,      8,   -338,     -4,    358,     23,
-       -52,    -68,    552,   4023,   -255,    684,    144,    188,
-       100,   -293,    462,    553,      9,    665,     12,   -640,
-     -5099,   -158,   -245,    -74,   -168,    263,   -355,   -370,
-      -653,   -163,   -473,   -394,   -233,    750,     17,    -31,
-};
-
-static const int16_t cb1110sl0[] = {
-     -3736,  -3737,    -18,   -285,    383,   -144,   -155,   -204,
-       296,   -399,   -663,    356,   -364,    329,   -330,     -5,
-       -52,    -88,    -41,    228,    -21,    -45,   -136,   -280,
-      -109,    -86,     57,     91,   -212,    158,   -106,    -90,
-     -8192,     70,   -255,     78,     -8,    -89,   -110,    -58,
-       104,    -51,  -2598,    411,    -94,   -567,    209,   -464,
-       139,   -234,   -336,    754,    863,    399,    345,    117,
-     -3435,   -219,    369,     59,   -325,   2439,   -148,      6,
-       -48,     84,    -14,     71,     94,     10,      6,     73,
-       106,   -490,   -200,    186,    345,     -8,     99,  -3687,
-     -1571,   1836,  -1593,   1111,  -3700,    470,     -6,    401,
-      -182,   -119,    438,   -263,    228,    785,   -361,    -56,
-      -492,    465,    333,     61,     53,    234,    -23,    -87,
-        39,    105,   7282,     59,    -47,    -57,    -77,    -45,
-      -172,     12,    179,   -134,     37,   -157,    -19,   -206,
-         9,   1186,   -264,    600,    350,    374,    115,    -55,
-       727,   -164,  -3903,   -735,    586,    -24,    145,   -786,
-      -118,    943,    514,    396,   3435,    -35,     83,    294,
-       107,     16,  -3636,    -93,    360,   -307,   -105,   -172,
-       204,    320,   -148,    410,    175,    335,      0,   -178,
-        12,     94,    -47,    -91,    -49,   -159,   -155,    -65,
-       -17,   -159,   -316,     64,    155,   -260,     81,  -4766,
-      -150,   -116,   -332,    128,    675,   -105,   -479,    563,
-      -101,    101,   -379,     33,     37,      1,    106,    151,
-        69,    140,     -6,    -74,    157,   -125,   -120,    -33,
-      -178,   -286,     60,   -158,     43,  -7291,   -295,    -68,
-       -34,    -68,    -58,      8,    176,    -42,   -212,    176,
-      -533,    -62,    -27,    167,    291,     59,    311,  -3050,
-       552,   -493,   -207,   2576,   -991,   -375,   -102,   -980,
-      1130,   -565,   -199,    559,  -1390,   -428,   -618,     70,
-      -437,   -245,  -1132,  -1302,   -453,     83,    222,  -1555,
-      -178,  -1396,  -1176,   -228,    730,  -3121,  -1085,     84,
-      -326,     71,   -185,   -315,    889,    803,  -2910,  -3609,
-      -639,   -199,    187,    137,   -622,    473,    121,    181,
-        85,    395,    523,    589,     71,    703,    123,    361,
-        47,   -675,    299,   -446,    307,    591,   3341,     64,
-       526,  -1541,    -50,  -1369,    701,   -144,   1720,   -713,
-       562,    297,    146,    -34,   1315,    956,    761,   -415,
-     -1311,    637,  -1263,  -1096,   -385,   3228,   -395,    317,
-      -354,   -503,    255,   -526,    245,    598,    853,   -269,
-      -110,   1354,    333,    110,    855,  -3346,    635,    636,
-      -917,   -577,    260,    147,   1041,   1273,    385,   -862,
-      1751,  -1099,     80,   -148,    120,   -118,   5565,   -484,
-       -74,    326,    291,    234,    -41,    212,    192,    207,
-      -108,    198,    118,   -389,    178,   -151,   -252,    -69,
-      -243,   -800,   2640,   -531,     84,   -301,    157,  -3428,
-         3,   -418,   -173,   -166,   -722,    207,    448,   -387,
-      -504,    202,    453,    210,   -203,    304,    190,   -264,
-       101,    -23,     36,     74,   -146,     26,     29,    -33,
-        59,   -127,     22,    213,   -167,    103,   8192,    183,
-      2709,   -125,    324,   -964,   -259,   -400,    -41,   -430,
-       367,    127,    266,    369,   1081,   -190,   -220,  -1083,
-       641,  -2733,    750,    525,   -623,    -18,   3159,    686,
-      -278,  -2083,   1680,    587,    123,     -6,   -266,    376,
-       522,   -433,   -499,    169,    106,   2041,    174,    571,
-      -108,    129,   -116,    -87,   -252,     89,    -14,     14,
-       120,  -7874,   -204,     15,     19,   -110,    -82,    -54,
-        66,     31,    210,     55,    339,     61,   -219,  -3205,
-      1292,     80,    344,   -733,   3172,    -21,    -55,    712,
-      -192,     38,    408,    489,    388,   -343,   -763,    438,
-     -1812,     -6,   -129,  -1392,   -382,    -28,    105,   -284,
-      -168,   -462,   -284,     22,    113,   1203,   3253,   -589,
-      -619,    348,    113,    847,      3,   -557,    460,   -636,
-      -601,   -742,     46,   -111,     51,    -66,  -2867,    551,
-       455,    898,     17,   2205,   1004,    -46,  -1475,   -367,
-      2849,    766,    -32,   -119,    624,   -722,   3371,    172,
-      -330,     93,   -221,    457,   -453,     84,   -281,   -360,
-       108,    487,   -301,    166,  -2611,    577,    192,     34,
-      1105,    705,     34,     29,  -3041,   -898,    172,    578,
-       307,    483,   -439,   -327,    360,   -935,    -76,    387,
-     -2485,    800,    333,    601,   -712,   -973,    -65,   -442,
-       220,   3577,   -428,   -210,    565,    757,   -382,    289,
-       726,    -19,   -182,    384,    -32,     38,   -810,   -181,
-     -2978,    259,   -213,   -473,   -187,   -823,   -279,   1518,
-        26,   -385,   1143,   -409,   1310,    676,  -2472,     64,
-      -391,   -102,    455,  -5751,    278,     30,     64,   -177,
-      -113,   -170,     94,   -234,   -167,    101,     -2,   -149,
-      -131,    351,   -254,   -138,    149,    -42,    631,    -21,
-       237,   2893,   -291,   2917,  -1240,    211,   -215,     22,
-      -827,   -160,    140,   -213,    156,   -250,  -1233,    691,
-       498,    -30,    350,    -28,    -12,    217,     34,   -348,
-       -70,   -140,    103,    -60,    353,   -200,   -314,    -74,
-       112,   4435,    -80,   -287,    413,    -99,   1407,   1519,
-     -2230,    114,   3179,   -523,     39,    340,   -379,    373,
-     -1552,   -138,   -446,   -106,   -762,  -1017,   -297,   -183,
-       498,   -481,    374,    271,  -5609,    297,     98,   -378,
-       187,    -78,   -125,    333,    114,    -81,     62,   -145,
-        14,    362,    518,    134,    195,    130,    -34,    -72,
-     -3088,  -2965,   -114,    585,    -78,      6,    552,   -633,
-       -98,   -224,    980,    338,    -83,  -1064,     42,    106,
-      -119,    644,   -293,    496,     67,    128,   -129,    620,
-        20,    526,   -177,     68,    351,  -3703,   1465,    905,
-      -245,     86,    511,     39,   -512,   -150,    239,     86,
-        60,     39,    -79,     -9,    -65,     77,  -7993,     57,
-       -19,     56,    -38,    161,   -221,   -129,      8,     93,
-        52,  -5622,   -114,    133,     26,     64,   -194,   -316,
-      -143,    225,    -66,    -81,    -74,    240,    130,    137,
-      -549,     11,    352,    -53,  -4029,    513,   3164,   -205,
-       127,     80,   -193,   -197,    -36,   -885,    223,   -858,
-         5,   -458,    290,    459,    247,   -284,   -176,   -748,
-       173,    191,    114,    406,    126,      3,     91,     84,
-      8027,    379,    -56,     47,     35,    246,   -143,     65,
-       -36,      8,     59,     67,    -69,   -421,  -3492,    312,
-      -252,    261,   3367,    319,    -67,     77,   -346,    386,
-        34,    237,     18,    111,    348,   -547,    186,    -93,
-     -3558,   -178,  -3801,   -133,    -27,   -561,   -308,    112,
-      -224,    272,   -195,   -270,   -179,   -165,    199,   -524,
-       681,   -117,   -429,     37,  -5891,     94,    -55,   -433,
-      -354,    122,    -60,     67,   -200,    -80,    267,   -136,
-       -42,    130,   -324,    -25,    156,    167,    -47,    178,
-         8,    289,    157,     88,    -28,    -39,   -262,    -11,
-         9,   -113,     76,   8192,     89,    115,   -298,    137,
-        34,      0,    261,    -30,     49,    274,    130,    824,
-      -944,    -56,   1074,   -314,    -76,    527,     75,  -3321,
-       733,   -798,   -352,  -1038,   1049,     72,   -233,    312,
-      3363,     69,    104,   -149,     22,    283,    -20,   -101,
-     -3350,    164,   -328,   -362,   -993,    430,     78,    125,
-       269,    -29,    362,    -73,    -30,  -1189,   1396,     59,
-     -1285,   -216,   -121,   3893,     84,   -464,    -38,   -113,
-      -369,   -181,   -930,  -1012,    394,    120,    274,   -552,
-      -800,    105,   -141,    -12,    241,   -667,    543,   -416,
-        28,   -182,     51,    905,  -3964,  -1213,     12,   -271,
-       378,   -234,    838,   -113,     56,    567,     35,     48,
-       490,   -180,   1097,    170,   2596,    -28,   3098,   -220,
-       424,    885,    -42,    783,    -30,    907,     63,     46,
-      -131,     28,    -55,     54,    -46,    -25,     30,     58,
-       -15,   -200,     -6,     11,    -70,     66,  -8089,     86,
-      -136,     96,    -56,   -101,    300,   -661,    -41,   -201,
-       760,   -252,    955,    189,   1459,   3562,   -457,     35,
-       -54,   -164,   -329,  -1245,   -830,   -365,   -399,    -23,
-       616,   -238,  -1301,   -198,    335,  -3400,    149,    175,
-       -97,   -279,   -594,    -92,   -915,   -830,    468,    628,
-       728,   1024,   -549,   1073,    222,   -142,    296,    -75,
-      -168,     -5,    -67,  -7311,    -50,   -256,   -321,    121,
-       358,   -272,     30,    258,    105,   -161,   -291,    462,
-        -7,   -211,   -227,   -104,   -151,   -152,    -72,    -98,
-       -59,    -23,    -98,   -203,    103,     89,    239,   -484,
-      7749,    110,     35,    345,    282,   -578,    140,    -51,
-       -62,   -238,    102,    454,     64,   -107,   -223,   -174,
-       285,    110,   -190,    -16,   1624,    142,   3813,   -849,
-        43,    234,     84,      0,   -132,    131,   -135,    -70,
-        -1,    125,    -83,    171,    109,   8044,     97,    -38,
-       143,     64,     13,      4,   -225,    181,    712,    626,
-        20,    167,   -467,    186,   3801,  -2179,   -647,   -119,
-      -112,   -183,   -223,    295,   -438,   -407,    -29,     36,
-       -34,   2536,    -47,   -402,    -33,    -62,   -136,   2444,
-      -152,   -717,   -868,     86,  -2323,    931,    659,  -1281,
-       -98,    638,   -162,    195,     -5,    -40,    -88,   3019,
-      3466,   -323,    316,   -784,   -715,      5,    188,     42,
-       155,   -608,    500,    185,    475,    100,    -51,    879,
-      -891,   -158,     18,   -453,    380,   -207,   -143,    401,
-      -153,    926,   -184,   2775,   3176,   -797,   -198,   -888,
-       405,    460,    309,    304,   -114,   2386,   2319,    658,
-     -2200,    216,    435,  -1210,   -655,    154,     81,    538,
-       908,    220,   -118,    482,   -864,   -526,   -241,    857,
-      -473,    774,   -288,   -886,     46,    250,    -96,    301,
-       120,   -488,   -128,   -233,    422,     38,  -3416,   -974,
-      -243,   -226,    381,   2394,    652,   3124,   -205,  -1303,
-      1484,   -159,   -152,  -1037,   -105,   -121,   -466,    -76,
-       605,    181,    -55,   -326,   -527,   -126,   1691,   1316,
-};
-
-static const int16_t cb1110sl1[] = {
-      -743,   -300,   -347,   -441,     85,   5282,   -250,     32,
-        28,   -306,   -434,     78,   -178,   -112,    -28,   -162,
-      -188,    -43,     17,     94,   -242,   -258,  -2691,   -471,
-      -556,   -815,    120,    -57,    -36,   -325,   3282,   -765,
-       355,      2,   -162,   -454,    -72,    192,     86,    219,
-      -123,    237,    135,    -42,    492,   -471,   -114,   5146,
-      -164,     28,     77,     70,    276,   -148,    333,     64,
-       -89,    -46,   -135,    474,   -218,   -119,    351,   7619,
-        93,    -80,    -84,    -51,   -110,   -223,    -13,   -116,
-      -160,   -102,    -64,   -140,   -376,    156,   -143,   -421,
-       105,    102,    519,   1256,    786,   -284,  -3029,  -3021,
-      -365,   -515,  -1358,   -273,    394,    489,   -242,     31,
-       239,  -1328,    169,   -488,  -3069,   -398,    303,   -274,
-       498,  -2758,   -748,   -208,   -324,   -285,     78,   -386,
-     -1063,    298,      5,    693,    160,   -629,   1656,    186,
-       457,    742,    422,  -3723,   1997,   1025,    -24,    291,
-      -588,     16,   -327,    459,   -521,    421,   1279,   -408,
-        -2,  -1320,    101,   -372,    -66,    100,   -605,   3214,
-      -374,   -660,   -371,    207,    175,   -553,   -574,   2962,
-       119,   -551,   -140,    -62,     50,   -608,   -237,   -100,
-       108,    101,   3258,    -31,    -45,    375,   -161,    132,
-      2842,   1458,    235,    800,   -113,    719,   -291,    -29,
-      -512,   -267,     53,    780,    -59,   3387,   -175,     88,
-       -78,   -475,   -536,    584,  -3025,    -19,   -105,     91,
-       875,    -55,   -771,    143,    384,    810,   -372,   -253,
-       160,   -128,    232,     98,   7755,    181,    -19,   -177,
-        46,    -39,    -30,   -212,   -289,     75,    127,   -114,
-        80,     79,    325,   -128,   -436,   2547,    -73,    -29,
-      1046,    344,   3340,   -335,    458,    637,   -175,   -695,
-      -366,    294,   -322,    564,    542,    209,    524,    -62,
-       444,   2827,    -53,     66,   -959,     84,    484,   -147,
-       158,    259,   -479,   3216,    232,    -68,    583,   -810,
-       107,     93,    629,   -168,    143,   -552,     96,    -71,
-     -3903,   -438,    335,   -133,   -186,   -278,     73,   -575,
-      -253,   -733,    -91,     -8,  -1149,    350,    140,     12,
-      3935,   -236,    103,    469,    610,   -536,   -305,   3112,
-        13,   -182,   -686,    637,    525,    327,    102,    -49,
-      -450,    -16,   -480,    233,    -82,   -132,  -3979,    426,
-       757,     54,    152,   -701,    513,   2330,    148,    242,
-      1709,    162,   -168,    146,      0,    891,   -644,    109,
-      -549,    104,    -50,    275,   -193,    -55,   -144,   -117,
-        31,   -234,     68,  -5369,     72,     54,     54,    119,
-      -140,    192,    286,    -42,   -278,  -3524,  -3609,    692,
-      -366,    -15,    343,   -885,   -267,    294,   -387,   -215,
-       -83,   -469,    790,     85,    428,   -613,    114,    634,
-       279,   -570,    616,   -813,   -117,   3073,   3121,   -717,
-      -200,    285,  -1061,    -44,    945,    386,   -166,    494,
-       776,     36,    -25,   -444,   -260,    407,   3885,   1049,
-      1348,    185,    454,   -136,  -2275,   1064,   -271,   -316,
-       645,  -1050,    483,    430,     32,    569,   -676,   -335,
-      -328,  -2982,   -370,     50,    189,    155,   1058,   -119,
-      -407,   -310,    461,   3293,   -604,    195,     48,     68,
-       196,    194,    547,   -210,    785,   -383,   -410,   -268,
-      -149,    192,    -88,    -13,     20,    -80,  -5146,    -86,
-      -111,     40,    -36,   -138,     12,    239,    -36,    -84,
-      -512,    149,   -237,   -672,   3477,  -3446,   1198,    220,
-       146,   -747,    242,     48,   -146,   -196,   -335,   -777,
-      -405,    620,   -340,   -367,   -389,   -108,    -27,   -184,
-     -2024,    518,    241,   -104,    417,  -1356,  -1961,    134,
-      3221,   -423,    286,    -60,   -110,   -568,     14,     76,
-      -144,    159,    704,   -410,    542,    -43,    223,    105,
-      -154,   -141,    -84,   -132,   -271,   -235,   -285,   -248,
-       480,    430,  -4711,   -487,    -86,    482,     80,     46,
-      -239,    -93,   -115,    -54,     -1,      7,     97,    -12,
-       151,   -180,    159,    -63,     65,   -215,     54,   5712,
-      2886,   -115,   -236,    113,    -25,   -301,   -450,   -276,
-       -78,    197,    -55,   -278,   -511,    163,   3442,   -910,
-       -74,   -225,   -103,     63,   -204,    -43,   -126,   -334,
-       223,    192,   -131,    202,    -83,   5000,    -66,    441,
-        33,      0,   -116,    237,   -238,    -37,    445,    -48,
-         7,  -1855,  -1154,   -251,   -117,   -185,    125,   1877,
-       375,    388,   -904,    202,    649,    376,  -3231,    897,
-       101,   -637,    376,     16,      1,    845,   -550,   -610,
-      -380,  -1363,   -955,     71,   1303,    296,   -264,   -584,
-       247,   3247,     98,   1035,   -670,    416,  -2008,   -448,
-       -56,   -169,  -1787,   3314,    408,   2541,   -833,     -2,
-      -169,   -184,    193,   -575,    -81,    410,   -293,   -478,
-        21,    194,    223,   -111,   4648,     60,    354,   -593,
-     -2429,   -671,    150,   -350,    151,   -448,     -5,    386,
-      -441,    131,   -339,     87,    815,    279,     51,    131,
-        56,  -3194,   -170,  -3899,   -297,    270,     21,   -215,
-         7,    205,   -305,    141,    577,     83,   -289,   -502,
-       -66,    -96,    433,   -106,   -685,   -194,    -82,     33,
-        98,    315,    258,  -2453,  -2957,    608,    672,    152,
-      -681,   1804,    -74,   -459,   -423,    114,  -1183,   -100,
-      -798,    357,    -79,  -3418,   -676,    580,  -1637,   -506,
-       306,    437,   1001,    731,   -885,  -1276,   -583,   -359,
-       650,     15,   -189,    190,     86,     39,  -7987,   -133,
-       324,    174,     22,     86,   -144,   -125,    -43,    -81,
-       -49,     68,     39,   -204,   -159,   -291,   -217,    -68,
-       264,    193,    406,    247,     27,   -272,   -168,    536,
-     -5740,   -141,     38,     18,     -7,    258,   -111,    125,
-       476,   -364,      5,     72,  -2668,   -197,   -605,   -671,
-       -82,    201,   -752,    227,    240,    345,    -11,   -138,
-       551,   -351,   -228,  -2774,   -132,   1115,  -1038,    -18,
-       791,  -3136,     81,    219,    357,    755,    579,     26,
-     -3129,   -398,   -719,    193,    495,    290,  -1123,    854,
-      -381,   -535,     33,    232,   2340,  -4577,    -94,   1023,
-      -117,     39,    -54,     15,   -161,   -860,     64,   -209,
-      -597,    415,   -135,   -407,   1068,    894,   -784,    108,
-       267,   7506,    140,     67,    198,     74,     52,   -388,
-      -184,    -24,    -54,    -24,    172,    172,    -50,   -184,
-      -113,    164,    128,    -39,    252,     90,    356,   -313,
-       -90,   -313,   -355,    -73,     19,    139,    141,   -122,
-      -231,  -4548,   -157,   -227,     47,    231,   -421,     60,
-       -80,  -3619,   4252,   -354,     69,    148,    336,    446,
-      -183,     86,    248,     35,     73,    120,    157,    156,
-      -291,   -523,     35,   -264,   3434,    189,    495,    -59,
-       533,   -343,   -554,  -3014,   -415,     17,    436,    552,
-      -240,   -394,   -761,     43,   -766,     46,  -1119,   -254,
-      1540,    195,   -298,   -833,     45,    -93,     61,     40,
-      -171,    167,     82,    107,     16,     40,   -166,    -46,
-       120,   -185,     13,    151,   8151,   -235,     92,    -23,
-       214,    206,    260,     93,    163,     78,    184,    -60,
-       -12,   -171,   -499,   -151,   -219,     11,   -221,    221,
-      3253,   -376,  -1079,   -481,    763,   -257,   -120,    -10,
-        34,   -640,    341,  -2953,    528,    567,   -672,   -335,
-      -175,    -61,    581,   -260,   1159,   -802,   1070,     12,
-       168,   2305,    291,    203,    -15,   -569,   3247,   -179,
-       620,    339,    224,    710,   -416,    512,    -86,    571,
-       439,   -167,    571,    -72,   -144,    236,   -382,     11,
-       268,   -176,   -136,   -337,    220,     64,    341,    361,
-     -4474,     25,    385,    453,   -153,     89,   -572,    245,
-      -197,     33,     75,    588,     51,   -199,    -74,   -149,
-       224,    210,   4689,    282,     20,    -47,    129,    221,
-       -72,     27,     76,     93,    331,    215,     -5,    -20,
-        74,    -80,    169,    126,    -40,   -137,    -24,  -8101,
-       -23,    165,    271,    403,    -34,    -19,    290,   -199,
-       -14,    205,    657,    301,   -885,   2457,  -1965,  -2266,
-     -1004,   -224,   -554,    182,   -220,   -467,   -611,   1012,
-      -122,   3303,    -73,   -205,     93,   3549,    217,   -223,
-        55,   -459,    541,    286,    -46,    128,    354,    137,
-       824,   -313,     32,    301,    139,   -492,    170,    136,
-       -35,   -752,   4613,   -830,    -34,     41,    344,    279,
-       643,   -394,   -461,    163,   -330,    199,   -215,     83,
-      1096,    613,   -473,    816,   3534,    210,   -772,    935,
-      -275,   -600,   -341,    602,    104,   -598,   -217,   -789,
-     -2428,    870,   -351,    474,     50,    321,   -148,  -2929,
-        25,   -135,    -46,     11,   -566,  -3057,   -664,    700,
-      -300,    256,   -960,    350,   -480,    414,    431,     24,
-       -51,   -228,    407,    142,   -321,    316,   -290,    149,
-        56,    -84,   -359,   -118,  -4948,    138,    373,    -49,
-       142,     71,   -163,    -13,   -279,     38,   -121,     35,
-       -47,    -70,    -43,    116,      3,   -159,    -11,     97,
-      -116,    -62,    156,    307,   -173,   7294,   -143,    288,
-       -34,    671,    613,     16,   -240,   -229,   -414,   -494,
-       -43,   -169,   -854,    336,   -991,    719,   -353,   -163,
-      -750,   2685,   2837,   -558,    129,   2076,    -47,    641,
-       -37,    -93,    226,    -69,    598,   -284,    127,    106,
-      -426,   -555,   -947,    485,     54,  -3175,    622,   -341,
-      -544,    278,   -205,   -689,    391,    238,      9,    152,
-      -233,   -392,     28,     36,   -394,  -1059,    132,   3761,
-      -480,     87,   -656,   1304,    478,   -272,     65,   -147,
-        91,    520,   -896,    166,     62,    -30,    -28,    194,
-       542,      3,    625,   1795,   3613,   1097,   1030,    906,
-       400,    133,   -127,    219,    958,     93,   -546,   -702,
-      2937,   -524,   -270,   -767,   -192,    725,   -897,   -643,
-      2502,    141,  -1147,    257,    279,    470,  -3001,   -104,
-        79,    508,    450,    265,    -21,    -74,   -437,    647,
-     -2755,   -407,   -816,    620,     24,    537,   -668,    604,
-};
-
-static const int16_t cb1110ss0[] = {
-     -8187,     90,   -694,   -168,   -452,     -4,   -259,   -332,
-       352,   -554,     43,    389,    236,    508,   -175,    461,
-      -277,    118,    651,   -245,    696,  -1423,    368,  -1417,
-      1782,   1650,   -540,     27,   -461,    516,   -599,   -185,
-       422,    -11,   -181,     19,   1809,  -3226,   -839,   -191,
-       468,    180,   -550,    198,   2487,   -923,  -1335,  -1008,
-      1029,   1716,    588,    371,    902,  -1214,    179,   1026,
-      1560,   1815,  -1714,   1230,   -712,   1675,   1867,   -154,
-     -2860,   -484,   2289,  -1018,     33,  -1494,    614,  -2340,
-      -724,  -1088,  -1930,   -775,   -876,    642,  -1358,   -144,
-     -2518,     62,    543,  -1049,  -1081,    672,   1305,  -1506,
-       -86,   2920,    518,  -1836,   -546,   -132,    -45,   -642,
-       381,   -404,  -2206,  -1211,    698,   -703,   -667,   -606,
-      -677,  -2246,    526,  -1157,    177,    510,  -1420,   -617,
-     -1819,   1710,   1631,   1049,  -1697,   -495,    961,  -1250,
-        39,    482,    445,   -956,    -71,    977,    426,   1826,
-       286,     36,    295,   1786,    794,  -3456,   1645,   -766,
-     -1580,  -2435,   1108,   -286,    731,   -659,    960,  -1759,
-      -978,    316,   -350,     91,    -35,   -222,  -1417,    -53,
-      -529,   -679,    681,  -4700,   -524,    -39,   -350,    196,
-       199,    191,    653,   1344,   -942,   -428,    156,    173,
-       636,  -1538,   1795,   1709,   -190,   1265,    164,    650,
-      2302,  -1757,   1762,    413,   -851,     44,  -1371,    343,
-     -3845,   -122,   1864,   -489,    601,   -748,   -402,    590,
-      -124,  -1988,  -1536,   -999,    399,   -753,    295,   -384,
-     -1316,     55,   -669,    262,  -1157,  -3766,    992,   -111,
-     -2928,  -1424,    -98,    -62,   -334,  -1848,    377,   1560,
-       947,   1568,   1554,    206,    664,   2014,   2098,   -164,
-      -640,  -2897,   -647,  -1675,  -2307,   -254,   -555,  -2426,
-      1497,    465,  -1525,  -1148,     55,    632,    554,   2068,
-       451,  -1532,   -715,  -2065,  -1177,   -623,    478,    -88,
-     -1140,    -72,   -450,   -248,  -1111,   -250,   1356,   2717,
-     -1841,    420,  -1299,  -1715,    746,   -101,    600,   1130,
-      -903,   -473,   1225,   -876,    193,    694,   -193,   -482,
-     -1838,     94,    157,   1131,    267,   -242,   2021,    -39,
-       795,   -285,    438,  -4322,   1097,   -621,   -518,   -338,
-      -289,   -114,   -671,   1700,   -477,    449,  -1664,   -693,
-      1403,  -3629,   1480,   -991,   -234,   -213,    354,   -269,
-     -1140,    -40,   1455,   -758,   1273,    497,   -686,   -945,
-        59,    -66,   -769,  -2930,   2343,   2452,  -1576,    995,
-      -734,   1009,     98,   -350,  -1116,    545,    189,     99,
-       566,   -916,     20,    117,   -807,    986,   -428,    177,
-      1247,    485,   -680,   1139,  -1263,   -256,   4828,     89,
-        27,  -1339,  -1091,    149,   -641,   -703,   -570,   -112,
-       346,    -93,   -641,    -97,   -991,  -2247,   2284,    847,
-      2110,  -1393,   -315,  -1468,    514,  -1493,    -46,   1135,
-     -1231,     39,   -913,   -278,   -762,   1775,   -684,    735,
-     -1676,    386,  -2030,   2534,  -2371,  -1661,   1204,   -111,
-        -8,   -607,   1233,  -1532,  -1263,   1530,   -537,  -1728,
-      -335,    269,   -614,     12,  -1187,   -770,    471,    373,
-      4743,     12,    197,    610,   -101,    417,   -350,    551,
-       544,   -898,    387,   -682,  -1216,    126,     96,     94,
-      -268,    535,    126,   -778,   1595,  -1379,   3366,     49,
-       460,   1772,    198,   -896,     75,    253,  -1376,     68,
-       838,  -1121,   -578,   -630,   -718,   -975,   -565,   1303,
-       354,   -769,    -38,   -246,   -193,   -408,     41,    165,
-       374,    -87,   -155,     -8,   -746,   -430,   -869,  -1842,
-      -385,    281,   5119,    432,   1119,   -807,   1756,    816,
-       131,   -548,   -528,   1347,    478,   1482,   2942,   -290,
-       650,   1012,    163,    840,   -804,     94,   2507,   1514,
-      -953,   -289,     23,   1128,   -895,  -1009,   1871,   -370,
-       699,    659,  -3069,   -695,  -1559,   1435,    672,     94,
-      1496,   -637,  -2208,   1083,    688,    485,    251,   -828,
-      1313,    -21,  -1948,    230,   -603,    783,   -829,    524,
-     -1142,  -3845,  -1383,    323,   1295,    732,    759,    591,
-        68,  -1869,   -756,   1727,    339,  -1565,   -510,   2623,
-       358,   3071,    281,   -790,   1129,    243,   -588,   -431,
-       492,    372,     96,    890,   -935,   -727,   -236,   -416,
-       171,    226,  -1090,   1257,  -1063,   -303,   -817,  -1506,
-      -947,   2282,   -659,   -406,     79,    772,   -816,  -2610,
-     -1802,  -1019,   -816,  -1886,  -1306,   1365,    624,  -2314,
-       -57,   1012,    215,   -130,   3404,   -864,    959,    202,
-       -26,  -1015,  -1212,    -34,   -408,   3494,   -284,    845,
-       275,  -1005,    458,    840,  -2258,    -13,   -129,   2536,
-      1269,   1216,   2071,   -243,    624,    584,   2192,    720,
-       604,  -1397,    766,    984,  -1050,    157,   -246,    438,
-       240,   -587,   1251,   -649,    -22,     33,   5818,    608,
-      -996,    474,   -523,   -454,   1252,   -791,    631,   -465,
-       663,    452,   1793,    853,     39,   3732,    758,  -1329,
-        11,   2217,   -136,   -540,   1335,     65,  -2047,    943,
-       701,   1886,   2085,   -890,    -16,   -184,    325,  -1077,
-      -271,  -1246,    391,  -1686,   -651,    -77,    319,    292,
-      -160,   1204,   1093,    776,   -310,   1512,  -1196,    149,
-        46,    593,   1738,   -566,     97,  -3667,   -485,   -683,
-      -121,   -216,   -149,   -344,    406,   -989,   -311,    383,
-       979,   -828,    394,    -22,  -5143,  -1368,    -18,   -433,
-       359,    607,    996,  -1144,   -229,   1365,  -1243,    413,
-      -591,   -621,    803,   1356,   -625,   1149,   -234,    182,
-     -1285,  -2487,    359,   2640,  -1426,    -66,   -688,    237,
-      1307,   -361,    108,    207,   1026,   -500,  -1156,  -1043,
-     -2192,  -2232,   1790,   1135,   1742,   1494,  -1156,   -698,
-      2520,  -2596,   -620,    431,    748,     88,    912,    832,
-      1122,   -483,   1837,   1821,   -826,   1112,   -424,   -306,
-      -750,   1085,    260,    152,   -114,  -1065,  -4518,   -300,
-      -976,    143,   1452,   1395,   1677,     59,    -51,  -1072,
-       868,   -171,    -26,   -914,   -109,  -2420,    -48,     69,
-      -230,    630,   -522,   2274,   1265,  -1612,   2570,    836,
-     -2042,  -1922,   2970,    775,   -320,  -2486,  -2935,    553,
-       178,    994,  -1054,  -1321,    699,    749,   1002,    513,
-       586,   1550,     35,    654,   -995,   1743,  -1049,   -405,
-     -3431,   1943,    700,    555,    111,    -67,   1007,    111,
-       -57,    661,    404,   -628,    425,   2185,    860,   -516,
-      -523,    452,    238,  -1778,   -378,   -721,  -2197,    218,
-       864,  -1031,   -832,    135,  -2543,   -447,    789,   1117,
-     -1491,    120,   1294,   -702,    627,   -412,   -902,    404,
-     -1843,   -786,   -597,    900,   1963,     22,   -843,   1168,
-     -1045,   -797,    764,   -423,    329,   2308,  -1950,    331,
-     -1090,  -2466,   -483,   2023,  -3363,   2126,    495,   2812,
-      1922,  -1488,  -1041,   -798,    135,    408,     33,    563,
-      1333,    -36,  -2181,   -787,    709,    287,   -971,     93,
-      -459,   -975,   2412,    280,   2555,     32,   2217,  -1825,
-       650,    313,    585,   -947,   1170,     45,   1108,   -435,
-      1092,    220,   -155,    512,    460,    211,   -231,   -627,
-      -836,  -2205,   -181,   -113,    130,    226,   -321,   -765,
-     -1327,  -1190,   -676,   -357,    691,    232,   -365,  -1818,
-     -3007,   2210,    997,    601,   2156,   -782,   1626,  -1081,
-       -49,   -616,    685,    -12,     40,   3480,    563,    515,
-       245,     51,    290,   1227,    171,  -1078,    520,   -483,
-       280,  -1517,  -1331,   2132,  -1176,  -1381,  -1546,   1436,
-      -852,   -505,    672,   -807,    623,   -244,   -125,  -1958,
-       516,    798,   1185,    922,    441,    651,   -610,  -1430,
-     -1887,    114,   -869,  -2024,  -1627,  -2276,   2008,  -1224,
-       125,   -609,    371,  -1104,   -506,   -942,   -624,   -478,
-       197,    141,   -242,  -1051,   1532,  -1269,    666,  -1055,
-      1689,    444,   1720,     16,    301,  -2311,   1196,   1108,
-      1298,   -564,  -1197,  -1858,    439,   -198,    324,  -1884,
-      3193,   2281,    201,    587,  -2028,   1969,  -1087,   -352,
-       -87,   -632,    144,    165,     68,   1150,    173,    478,
-      -837,   -470,   -464,   -195,   -205,   2111,     15,    643,
-      -453,   -339,  -1128,  -1368,   1182,    822,    654,  -2331,
-     -1668,   -215,   -678,  -2460,   1169,   -664,    777,   -348,
-      2570,   -767,   -563,    254,    562,   -557,      4,    -97,
-      1990,    373,   -780,   -677,   1996,  -1527,   -365,   -416,
-      -325,    587,    910,  -3780,   -553,    104,   1705,    240,
-      -719,  -1717,   2765,   -582,    -76,    399,  -1152,   2379,
-      3169,  -1153,   -725,    -35,  -1214,    362,   1600,   -724,
-       424,   -722,    472,    872,    694,   -126,  -1649,  -1314,
-     -1814,    -95,   -312,    -34,    780,   -884,    824,   -864,
-       526,   -100,   3820,    -56,   -452,     43,    564,    487,
-       177,    890,  -1423,    894,   -552,   1438,    204,   1015,
-        -4,    327,  -3327,   -433,   -335,   -869,   1312,   -488,
-     -1287,   -169,   2018,    435,     73,    508,   1160,  -1060,
-      -134,  -1304,   -341,    623,    125,    -15,  -1120,    108,
-       -71,  -1487,   -189,  -3640,   1424,   1740,   1116,    579,
-      1603,  -3294,   1241,   -225,   1481,   2775,   1326,   -242,
-      -632,  -1560,    563,    559,    138,    115,   -557,   2004,
-     -1771,    717,  -1052,  -1115,  -1634,    889,   -441,   1954,
-      -164,  -1507,  -1312,   -407,    662,   -867,   -896,    225,
-      2576,   -224,   -107,    237,   -694,    859,    192,  -1033,
-      2255,  -1225,   -891,  -1994,    -90,    339,   -382,   -774,
-      1460,  -1553,    648,   -521,   2370,    160,    714,     54,
-      -906,   1435,  -1752,   -274,   -523,    -36,   1208,   1553,
-      -339,   1000,   -178,    209,  -1001,    916,    495,    310,
-       726,    127,   -391,    107,   -513,  -1052,   -376,    297,
-      -307,    933,   -233,   -253,   1196,   4619,  -1278,    762,
-       -13,   -387,   -973,   2153,     68,    362,   -887,  -1922,
-      -106,    298,  -1127,  -2601,  -2184,   -111,    111,  -1588,
-      1002,   -365,  -2226,   -290,   -599,    610,    551,  -1368,
-     -4344,    618,   -172,    349,   -914,   -530,   -192,    718,
-       348,   -675,   -884,    913,    -94,    215,   -834,    353,
-       753,   -811,    -84,   -905,   -128,   -483,  -1782,  -1255,
-     -2333,  -1110,    477,   -566,    346,   2018,  -1644,   -325,
-      1365,  -1223,    158,  -1786,    566,    203,    742,    281,
-      -555,    573,   -978,   -459,  -1671,    378,   -689,    349,
-       606,  -5961,    562,    -13,   -223,   -419,   -442,   -447,
-       125,  -1052,     53,   2594,  -1377,    209,  -1549,    533,
-      -118,  -2538,   1808,   -364,    -37,   1221,    607,    593,
-       309,   -240,   1574,    254,    434,   -141,   -220,  -2018,
-};
-
-static const int16_t cb1110ss1[] = {
-       631,   3041,   1215,   2376,  -1843,   -103,    750,    144,
-       -87,   -249,    715,   -201,    758,    202,   -197,   -135,
-      -523,   1243,    457,   -717,   -700,   1662,    918,    -48,
-     -1008,    180,    411,    948,   2192,   2607,   -826,   -962,
-     -1130,    -59,  -1047,   -305,   -325,  -1032,   2096,   -287,
-       395,  -1543,   -268,  -1218,  -2045,  -1674,    951,  -1846,
-      -636,    263,   -138,   -287,   -327,  -2208,   -664,    496,
-      2179,   1645,    340,   -601,    473,    670,    950,   2774,
-       364,    613,  -1896,  -1876,  -3177,   -105,    506,   -164,
-       281,    718,   2419,  -1077,    -50,    365,  -1631,   -134,
-      -384,    231,    767,   -285,   1268,    321,  -1408,    217,
-      -409,   -725,   1225,  -2551,  -2622,   -274,    473,   2752,
-       -11,    342,   -495,   1627,     79,    240,      2,  -1021,
-       640,   -508,   -269,    648,   -116,  -1283,   -217,     13,
-     -1674,   2402,   -879,   1791,   2753,   2386,   1195,   -700,
-      -282,   -428,   -671,    -92,   1187,   -672,   1037,  -1913,
-       246,   -816,    -69,  -2284,   -712,   -996,   2498,    902,
-       809,   -149,     66,    775,    -44,   -566,    955,  -1073,
-     -1438,   -894,   -978,    274,   -390,   5528,   1153,     17,
-      -750,     63,    545,   -725,   -301,   -323,    661,   -813,
-      -347,    739,    335,    136,    203,    342,    802,   -199,
-      -818,   -679,   -282,   2195,  -1714,   -757,   -154,    182,
-       132,  -1737,    405,   2394,  -3727,   1349,    213,   -193,
-     -2495,  -1354,   -629,  -1171,   1429,    -16,    834,  -1260,
-       160,  -1892,    874,   1754,   -567,    344,  -3499,   1612,
-      -987,   -424,   -997,  -1640,    594,   1058,   -783,    511,
-      -604,  -1480,  -1754,   -424,   2262,  -1991,   1297,   -638,
-       350,   -588,    -55,   1483,   -456,   -567,    146,   -946,
-       731,   1541,   -759,    592,   1231,   -270,    171,  -1975,
-     -2707,   -456,   -227,    392,   -891,   1008,  -1066,   -487,
-       231,   1372,    -51,   -599,   -227,    696,   -820,    354,
-      1928,    -48,  -1302,   -570,    316,   -283,   -848,   2563,
-      -266,   2821,    540,    553,  -1272,   1120,  -1164,   -451,
-       384,  -1058,  -1018,   1735,    992,  -1220,    -83,   1490,
-      2304,    122,   1630,   1108,   1997,   2346,   -647,    301,
-     -1746,   -218,    313,    462,   1486,   -536,   -508,   -463,
-       104,    930,    605,   2116,    793,   2881,   -724,  -1379,
-       -53,   4458,    793,    275,   -180,   -516,   -489,   -774,
-      -265,    704,    112,    175,    112,   -121,    652,    310,
-       564,   -440,    773,   1885,    927,   -672,   -773,   1726,
-      -614,    818,   1589,   -372,   -207,    499,   -894,    987,
-       796,    652,  -1228,  -4010,  -2208,    458,    645,    498,
-      -279,   -852,  -1897,  -1820,    -35,    674,    201,    474,
-        77,     94,   2327,    723,  -1081,    261,    209,   1179,
-     -1175,    623,  -1293,   2154,   -117,  -3707,    940,    813,
-     -1059,   -335,   1306,    525,   -191,  -2066,   -425,     19,
-      -366,    529,   -145,    822,   -913,    254,    424,   -354,
-      -167,  -2437,  -1433,    603,   -318,  -1517,   4250,    541,
-     -1360,    450,   -531,    200,    534,   1200,   -222,   -535,
-      -162,  -1211,   -116,   -144,   -462,   -139,   -482,    511,
-      2068,  -2100,    971,  -1487,  -1050,  -3150,   -701,    119,
-        16,   1535,    272,  -1184,   2242,    488,   -492,   -915,
-      1660,    212,   -826,   -444,   1003,   2705,   3591,   -174,
-      -333,   -431,    -59,   -903,     61,    751,   1087,    -45,
-     -1031,    617,    686,    -15,    848,   -348,    947,    396,
-       931,   1785,   -552,   -920,   -669,    -63,  -1869,   2357,
-     -1549,    807,    889,  -1581,  -1071,   1587,  -1108,   1300,
-      -658,   -625,    300,   -285,   -977,   1656,   4183,   1487,
-      -191,    658,   -300,    497,   1378,   -300,   1031,    322,
-       114,   -449,    666,   1250,    264,    125,   -109,    748,
-      -503,    -40,    199,  -1212,  -1643,  -2522,    151,    121,
-     -1128,  -3200,    876,   -446,    878,   -989,   1510,   2261,
-     -1507,   1793,   -402,     30,    228,    -50,    985,  -1568,
-       755,   1559,   -688,   1342,   -423,  -1507,     96,   -501,
-       474,  -2926,  -2493,   -131,   -656,    450,   1035,    812,
-       -14,   -933,    941,   1396,   -957,   -621,   -516,    379,
-      -225,  -2063,  -2048,    669,    287,   1688,   1727,    299,
-      -658,    852,    745,   -260,    993,    158,  -1236,  -1422,
-        33,    611,   -112,   -323,   -194,    839,  -1407,  -1505,
-     -2010,   1267,   -355,   -675,  -3779,    768,   -228,   -643,
-       661,   1313,   -529,    962,   -948,   -212,   1043,   1560,
-      -174,   1744,   -938,    289,   1942,  -2228,  -1932,   1056,
-      -590,   -940,    922,    601,   -853,   -791,   -637,     -2,
-       -52,    -83,   -209,   1422,    856,  -1141,   2500,  -1195,
-       773,   1087,  -1389,    409,    439,  -3674,    453,   1637,
-       -15,   1013,   2635,   1530,  -1104,    440,    895,   -210,
-      1118,     -6,     45,     65,  -1110,  -3307,   -331,    478,
-      -155,   -410,   -721,  -1234,    129,   -971,  -1117,    -27,
-     -1132,  -1289,   1888,  -1112,    203,  -1091,    442,  -2207,
-       501,   -343,    468,    -52,    385,    269,  -3102,   -366,
-      -469,    391,    505,    176,    356,    -69,   -929,   1155,
-      -280,  -1264,   -897,   1006,   -494,    155,     36,   -627,
-       924,   -816,    154,   -750,   -837,   5263,  -1099,     91,
-      -481,     71,   -681,   -574,   1229,    675,   1217,   1073,
-      -695,    274,   -381,   -140,   1372,   -524,   1164,    341,
-      -149,   -856,    793,  -1294,    981,   -961,    371,   1178,
-      1463,    373,   1375,  -4384,    239,    136,     67,  -1196,
-      -126,  -1001,   -228,    150,    437,  -1830,    477,    498,
-      4246,    793,   -661,    260,  -1810,   1405,     76,    902,
-      -844,    908,   1830,     27,   -124,    257,    765,    -98,
-       592,    487,   -132,    202,    675,   -669,   -679,   1309,
-     -4002,   -206,    -66,   -390,   -253,   -190,   -921,    -83,
-      1411,   -417,  -2560,   -646,   1853,   -148,    548,   -370,
-      -723,    959,   -906,  -3058,   -276,    467,  -1280,    970,
-       687,    484,    506,   1143,  -1509,    828,  -2169,   2931,
-      1322,   -579,   1033,    209,   -979,    217,   -434,  -1438,
-       314,   2384,   -906,    -29,  -1478,    -31,    574,   -373,
-      1478,   -124,   -680,    330,    794,   -753,   -977,   1151,
-     -1190,  -1479,   -642,   1658,  -2201,  -1469,   1589,    587,
-        52,   1298,   2092,  -1483,    678,   1988,    918,   -648,
-       328,   2096,  -1090,   2153,  -1416,    295,    537,    261,
-       398,  -1389,   -399,   1105,     10,   -395,   1169,   -431,
-      -423,  -1617,    766,  -1900,  -3205,    131,   -746,   -852,
-      2215,   -317,   -232,   1079,    293,   -727,     50,   -446,
-      -713,   -897,    768,   -896,   -667,   -281,    377,    115,
-      1695,  -4870,    713,   -393,    251,   1268,    477,   -497,
-       294,     18,   -359,    556,    308,   -752,   -863,   -216,
-       151,   -163,    695,    587,    810,   2107,   -107,    921,
-      1203,   -472,   1280,    372,    110,   -581,   -225,   -714,
-       -58,  -2587,  -1980,   -186,   -372,  -1410,  -1504,  -1020,
-      -745,    -88,   2373,   -568,  -2841,  -2041,  -1841,   2065,
-       389,   -430,   1163,   -208,    569,    375,    650,    317,
-      1114,  -1036,   -959,   -896,   1060,   1014,   -599,  -1743,
-      1121,    808,   1556,    326,  -2876,  -1556,  -1283,    384,
-     -1102,    378,   1433,    702,   1454,  -1243,   -725,    224,
-      -610,   -455,   1413,  -1747,  -2516,   -572,  -1455,   -313,
-       231,    780,   1531,  -2475,    -34,    921,  -1650,    269,
-       818,      5,    835,   -209,   -911,   -432,  -1104,    165,
-     -1638,    -46,  -2031,   -445,   1308,   1519,  -1992,   1606,
-       956,    757,   1139,    116,    829,  -1376,    209,   -893,
-       963,   -569,   -466,   -185,  -1345,   1524,   1714,    269,
-       219,   -161,    482,  -1178,  -3621,   -831,   -668,   1871,
-      -529,   -983,    558,   -818,     81,    555,     33,   -473,
-      -187,    113,    899,   -577,  -1093,   1408,    902,   -258,
-      -111,   -648,   4340,   -780,   -651,    789,    -92,   2310,
-      -401,    669,   -213,    369,   -104,   -820,   -290,     48,
-      -917,     71,   1070,   -239,   -744,    891,     23,  -5130,
-      -761,    312,    319,    842,    280,     78,   -149,    352,
-      -594,   -361,    354,   -906,     42,  -1610,    835,    157,
-      -631,   1100,   -297,   1081,    -96,    484,   -825,  -2132,
-       549,   1305,    128,   -314,  -1733,   -265,   1285,  -4061,
-      -348,   -136,   -940,   -507,   -232,  -1511,   -876,     78,
-      2120,    175,   2216,   1179,    497,    335,    350,    -18,
-     -1307,   -387,  -2207,    587,   3209,   -370,   1155,   1501,
-     -1687,   -796,  -1417,   -733,   -269,    801,     83,   1173,
-       718,  -2702,     19,   -315,   4501,   1025,   -365,    348,
-      -417,   -510,   -172,  -1201,   1478,    671,   1933,   1759,
-       676,    416,     30,    400,    531,    351,  -1176,  -2807,
-      1969,  -1398,   1159,   -568,    754,   -149,  -1880,   -274,
-     -1203,    -43,   1391,    383,    702,   2116,   1299,   1952,
-       646,   -719,   1735,   -986,    100,   -956,   1040,   2287,
-     -1606,    612,   1760,    733,  -2453,    531,    -14,     -1,
-     -3214,  -1993,    371,    227,     45,   2011,   -531,   1089,
-     -1029,    282,  -2426,   -525,    989,   -469,    285,   1787,
-       927,   -335,   1127,   -305,   1143,   -412,  -1626,   1759,
-     -2567,    -82,   1170,  -3051,   1266,   1522,   -124,  -1935,
-       552,   1122,    -51,    347,   -674,   -360,   1183,    223,
-      3015,    955,   -826,   1108,   2325,    868,   1152,   1079,
-       223,    217,   -428,    382,    642,  -2849,   -767,    -70,
-       407,    147,   -392,   -407,    -55,   -508,   1785,   -683,
-      -885,    851,   3879,    471,   -674,   -231,   1493,   1621,
-     -1698,    528,    623,    300,   1367,   -588,    816,    -24,
-       600,   -182,   -841,    854,    370,    715,    116,    714,
-     -1308,   1435,   1802,  -2627,   -814,    363,   -318,    -73,
-       850,  -1744,   2509,   -303,   1077,    660,   2145,   2130,
-      -730,    -88,   -115,   -517,   -154,    160,   -337,     27,
-      1502,    509,    -70,    502,    820,   -309,  -3740,  -1294,
-      -610,    241,   -662,   -524,   1319,    456,    926,    958,
-      -111,  -1004,   1795,   -604,   1086,    462,   -127,   -125,
-       264,  -1093,   1427,    334,    838,   1979,   -576,   3052,
-     -3590,   1607,    356,    728,   1619,   -400,    279,    570,
-      -434,    777,  -1448,   -888,    156,   -277,  -1529,   1122,
-      2235,   -794,   3417,   -830,    -82,   -664,  -1837,    946,
-      -370,   1434,    -50,    742,  -2368,   1438,   1264,   1172,
-     -1338,   -108,   -226,   -958,  -2130,     -2,    917,    896,
-      1563,   2181,   2684,   2343,    237,   -407,  -2685,   1447,
-      1028,   -728,    109,   -620,    478,     46,   -542,   -789,
-      -879,   -438,   1244,   1075,  -1730,    119,   -694,    137,
-};
-
-static const int16_t cb1110sm0[] = {
-       916,   -269,    -44,    343,    623,  -2512,   -171,  -1904,
-      1001,   2776,    226,   1487,    705,    763,   -616,    288,
-      -212,   -535,   3080,   -352,   -367,    512,   -673,    620,
-      -874,    769,   -956,    460,   -601,  -2793,   -102,   -765,
-      -431,  -1369,    149,    481,    -49,    109,   -412,    670,
-      -615,    287,    150,    321,  -3293,   -237,  -1627,    188,
-      1867,   1481,    353,   -134,   2706,    147,     74,    -77,
-      -148,   -224,    196,    -60,    179,    125,    -13,   1011,
-      -189,   -172,    658,   4441,   -540,    531,    239,   -329,
-      2782,    392,     97,   -660,   3488,    -78,   1308,   -574,
-      -903,   -170,   -279,    173,    -70,    601,   -385,    123,
-      -423,   -512,   -193,   -233,    106,    175,    210,    185,
-       489,   -236,    153,   -670,     25,     61,   -196,    213,
-        67,    339,   5443,    116,   -647,    149,   -130,    197,
-       -11,    305,   2669,   1212,    298,     84,    219,    -26,
-      2661,    650,   1348,    -65,    574,  -1482,   -268,    -30,
-       626,    328,    279,   -245,     87,     94,   -202,      2,
-       366,   -505,   -592,      2,   5666,    384,     22,    227,
-       208,  -1221,     78,    155,    260,  -1111,    165,    396,
-      -678,   -739,   2503,  -2395,   2025,   1424,   -343,   -759,
-      -837,    101,     55,    274,   -481,     22,   -568,   1044,
-      -271,   -124,   -609,   -833,   -206,     53,   -591,   1150,
-     -1950,  -2875,   1949,     59,   -334,  -3230,    176,   1133,
-      -372,   2937,   -803,   -663,    631,   -659,    -32,    -82,
-       851,    113,    -60,   -625,    556,    177,    112,   -753,
-       -33,    313,    -33,   -208,   -177,  -5496,     55,   -533,
-      -815,    123,   -755,   -215,    638,    223,   -156,   -917,
-      -166,    -33,    504,    704,  -3001,    124,   -153,  -1809,
-      -977,   -717,   1718,    476,    212,   1661,    953,  -1422,
-     -1014,    -94,   -524,  -2562,   -267,    371,    104,    -63,
-      -546,    262,    193,  -1714,    261,   1867,    738,  -1878,
-       400,   1754,   -445,   -405,   -841,   -439,    709,     44,
-       675,    248,    640,   -138,   1217,    393,  -1402,    653,
-      3110,   -938,  -2491,   -688,   1214,   -649,  -1356,   2506,
-       203,    172,    679,   1003,    772,  -3010,     82,   -998,
-      1011,   -980,    -28,   -138,   -430,    614,    427,   -341,
-       201,  -8082,   -118,    224,  -1167,    195,   -920,   -352,
-      -657,      5,     46,    -39,    -72,    698,   -136,    -40,
-       391,    287,    157,  -1197,    -60,   2808,   -123,    489,
-       152,   2318,   -805,    958,     98,  -1496,   -835,   -846,
-       589,    455,   -868,    245,    -10,  -5047,     12,    -50,
-      1277,    -95,    456,    -49,    570,    608,   -658,   -352,
-      -277,   -268,    214,    388,   1865,      2,   3033,   -269,
-       259,    -75,  -3437,    800,   -190,    668,   -263,   -111,
-       229,    -43,   -139,    659,   -290,    782,    -18,   -854,
-       271,  -2223,     30,   -162,     71,     47,    756,  -1269,
-       336,    863,  -1998,    -16,   1172,    236,    929,   -477,
-     -2446,    -92,   -425,   -193,  -8192,    321,   -102,     85,
-       -85,    108,    318,    149,    -27,   -182,     69,   -237,
-        35,    451,   -263,   -890,   -348,   -295,     64,    410,
-      6427,    569,    604,    543,     38,     31,    -15,    148,
-       249,    -83,    -67,    457,    -76,   -560,    694,   -797,
-       190,   -113,   2006,    136,   1705,   -428,   3549,   -550,
-        70,     -3,   -147,   -288,   1142,   -919,    493,  -1305,
-      -460,   -151,    831,    623,   -768,   -211,     31,   -296,
-       167,  -2721,    -16,   -654,    243,   2555,   -311,   1845,
-      -531,   -576,    143,   -574,    490,  -1089,  -2302,   1080,
-       701,    472,   2782,    320,  -1455,   -632,   -218,    281,
-     -1492,   -661,  -1379,   -538,   -236,  -1928,   -502,   -565,
-      -480,    525,    -81,     38,    263,      3,    366,    163,
-     -3140,    882,    189,   1123,    382,  -1748,  -1210,    371,
-      -602,    696,   -413,   -207,    358,   -616,   4725,   -473,
-      -784,    249,    621,    764,   -265,  -1004,   -570,    339,
-      -643,   -123,    302,    284,      1,   -159,   -321,    250,
-      -297,    -43,  -3512,  -1064,   -493,    556,  -1184,   -263,
-      1314,   2028,   1074,      9,   2941,   -998,   -271,    966,
-      -754,  -2589,     88,    741,   -307,    134,    152,    -86,
-       311,    904,   -917,   1199,  -5090,    118,    181,   -311,
-      -412,    475,   -647,   -717,   -637,   -221,   -291,   -469,
-        77,    946,  -1196,   -119,   -175,    530,   -465,    383,
-     -1253,    589,    826,    835,  -3578,   -319,    -80,    488,
-      -238,   -497,    360,    839,   1870,    762,  -1669,   -769,
-       429,    778,  -3121,   -325,    -55,   -128,   2606,   -874,
-      1043,   -902,   1746,   -725,    115,    167,    142,    604,
-      -101,   -725,    -11,   -458,    -27,    450,    293,      2,
-      -383,     23,    172,  -6725,    400,   -205,    165,     45,
-       -38,     86,    372,    354,    -68,    390,   2444,    521,
-         4,  -3586,    357,    129,    665,   -328,    524,    113,
-      -446,   -514,   1132,    289,   -560,    239,    167,   -349,
-      -724,    101,  -3165,  -3139,   -163,   -147,    865,   -617,
-         0,   -789,    797,  -1026,    432,    359,   -460,   -105,
-      1119,    486,   -233,   -360,   -175,   -349,    837,    469,
-      -250,   -521,  -4470,   -108,   1009,   -575,    283,     22,
-      -555,   -682,   -234,   -249,    -33,   -106,    521,    515,
-      -283,    -78,    101,   -135,   -648,    506,    181,    392,
-      -517,   5405,    442,   -106,  -8168,     51,   -310,   -813,
-        49,   -314,    586,   -479,    376,    113,    337,   -151,
-       245,    270,     -1,    619,   -312,    -37,   -215,   -482,
-     -3055,  -3261,   -346,   -493,   -357,    306,   -160,    -21,
-       258,    872,   -577,   -141,     18,    -84,    693,    151,
-       218,   -533,    -37,    540,     61,     40,   3150,    157,
-     -2549,   -324,    267,   -456,  -1236,    798,    517,   -224,
-      -196,    587,   -495,     18,    258,   3147,    -15,   -568,
-       957,   -444,    637,   -354,    828,   1182,   -769,   -137,
-     -2130,    408,  -1667,    252,    282,    201,    239,    154,
-       125,  -7882,   -332,    198,    -47,    265,   -289,    358,
-        -4,    103,   -795,    207,     82,    229,    429,    361,
-       263,   -409,   -451,  -1036,  -3419,    899,   -568,  -1480,
-       898,    284,    -53,    179,    975,  -1283,    759,   -150,
-      3244,    408,   2579,   -418,   -117,    226,    583,    210,
-       -62,  -1513,   -148,   -820,   1073,   1290,   -263,   -454,
-       653,    555,    286,    218,   -105,   -135,    231,   -892,
-      -284,   2513,   2715,  -1530,   -165,  -1419,   -223,    -66,
-       525,   1556,    -18,   -664,    -19,    856,    179,    535,
-      -339,   -245,    498,    193,    235,    328,   -491,    231,
-     -5629,     65,    -85,    313,   -395,      6,    344,    267,
-       672,   -991,    178,  -1335,    -64,      9,  -1508,    -69,
-        57,   -310,  -1793,   -850,  -3669,    427,    -79,   -720,
-       219,    366,    131,    523,    141,  -1055,    -66,     13,
-      -843,    -55,   -794,    661,    112,   -407,   -496,    550,
-       931,  -3938,   1780,   -509,   -543,   -157,   -270,  -1015,
-       564,   -231,   -854,  -3372,   -327,    869,   -196,   -981,
-      -205,   -215,    605,    746,  -2188,   2250,     74,  -2979,
-      -242,    832,   -190,    365,  -1327,    453,     95,     76,
-       158,   -683,    628,    297,   -867,   -542,   -143,   -568,
-      -414,   6018,    -40,    -35,   -456,   -632,   -779,   -226,
-      -442,   -295,    310,   -766,    578,   -197,     84,   -961,
-     -3346,   -106,   3266,     -3,   -477,     -8,    652,    122,
-      -606,     49,     34,    686,    385,   -258,    214,   -572,
-       -72,   -193,    124,    440,     48,     45,     75,      9,
-     -7724,    200,   -364,    578,    318,   -461,     84,   -233,
-        46,   -404,    185,    470,  -3387,  -3397,    374,   -519,
-      -320,   -378,     27,    921,   -280,    188,   -245,    -69,
-      -322,    504,    -72,    460,    -80,    -35,   -220,  -3098,
-     -3678,    477,    248,   -801,    580,    187,    468,   -636,
-      -364,   -432,    183,    -82,    -79,    266,   -787,   -740,
-       552,    228,    238,    482,  -2229,    275,    149,   -360,
-      -350,   2774,    871,   -118,     55,   -961,   -165,   2429,
-       982,    313,   -502,   3094,   -431,   3485,    473,   -347,
-       171,    544,    253,   -324,    -50,    464,    116,    650,
-      1102,    495,    420,   -404,     -1,  -2991,   4055,    207,
-       374,   -187,   -121,    130,   -451,   -953,    822,    526,
-       287,    120,   -979,    376,    594,    -79,   -130,   -362,
-      -979,    166,    693,  -4108,     84,   -135,   -195,   -703,
-     -1506,  -1098,   -611,    870,    935,   -156,    974,    286,
-       -86,     83,   2975,   -681,   3218,   -286,   -452,    -70,
-      -113,   -395,    137,  -1295,   -503,    853,    297,   -352,
-     -1004,   -117,    476,   -431,  -2848,     -7,   3601,    402,
-      -534,    312,     86,   1524,   -358,   -164,    -43,    913,
-      1003,    239,   -364,    -88,   -468,   -672,    220,   -211,
-      -326,   -431,    438,   -297,    380,    125,   -146,   4550,
-      -271,   -831,    768,  -1360,    -45,    266,   -278,   -246,
-       625,   -132,    153,    514,    115,  -1311,    707,   -361,
-      -601,  -3224,    376,  -2107,   -259,  -1155,    426,   -646,
-};
-
-static const int16_t cb1110sm1[] = {
-       360,   3106,   -518,    185,   -906,   3245,    508,    -91,
-       938,  -1270,   -492,     36,    168,   -997,   -208,    991,
-        99,   1553,   -294,    204,    -22,   -108,  -2405,   2893,
-        49,     72,   -490,   -529,   -218,   1343,   -786,    903,
-       411,    207,    131,   -636,   -129,   -134,    621,   -253,
-       319,    135,   -234,    -75,   -293,     46,    207,   5985,
-       280,    -86,    -78,    690,    984,   -770,   -565,   -226,
-      -242,    374,     26,   -696,     81,   -277,     -9,    639,
-      -730,    250,   -232,   -488,   -284,    460,   -398,   4336,
-      -303,   -266,    546,   -292,   2936,     70,   2077,    373,
-      -141,    292,   2102,    340,   -312,   -523,   -341,   1017,
-       457,    224,    315,    271,   1080,    152,    192,    568,
-      1014,    155,     85,    329,  -5235,    137,   -503,    141,
-       275,     -7,    752,    282,   -267,    321,   -735,    746,
-       489,    450,    478,    432,   -152,    451,  -1192,   1267,
-      -341,   1136,    100,  -3538,  -1551,   1547,   -551,    294,
-      -473,   -821,    -51,    718,   -655,    -11,   2817,    -26,
-        73,   -459,  -1569,    181,    516,   -151,   2846,   -112,
-       186,    714,   -228,   -210,   -451,    920,    -99,   -132,
-     -2662,    589,   3040,    376,    662,   -834,    782,    542,
-      1485,    538,   3531,    107,     47,     62,    398,    -11,
-       -15,   -733,    471,   -231,    668,   -212,     38,   -536,
-     -1905,   2769,   -149,   1623,  -3418,    237,     55,   -328,
-      -770,    335,   2755,    340,     62,   -466,    267,   -946,
-       427,    266,     80,   1134,     34,    949,    366,   -339,
-      -112,      3,   -105,    442,   5117,    545,    -93,    611,
-      -186,    566,    -39,   -172,    -59,  -1120,    388,    703,
-       619,   -359,   -117,    -68,    569,    148,   -214,   -245,
-       281,    617,  -2337,    -88,   -255,    124,   3292,    443,
-       434,    -17,  -1157,   3090,   -205,   -245,   -983,    250,
-     -1086,    643,   1392,    831,    733,    -59,  -1199,   1747,
-      -415,   1073,    279,    428,   -512,  -3392,      0,     -6,
-       526,    275,    -79,    477,    411,     85,   1485,    795,
-      -209,    495,  -2628,    367,  -1734,    900,    301,    239,
-       -53,  -2068,    403,   1333,  -1304,   -566,  -1420,   -771,
-     -2300,    -15,    842,    342,  -2373,     61,  -1379,    303,
-       733,   -108,   -316,     94,   -477,   -254,   -211,    807,
-       273,   -792,    159,    -66,   -857,   1092,  -1001,    -69,
-     -3770,    999,   2418,    854,    173,   2281,   -681,    485,
-       578,    145,  -1245,    845,   -375,    219,   -259,    374,
-       751,    226,  -1347,   -825,     66,    319,   -173,    191,
-       445,    284,     62,  -8150,    -71,     53,    637,    -96,
-       227,     75,     73,    -88,    654,    -24,   -466,    477,
-       671,   -125,   -942,    104,    248,   -151,   -383,     11,
-       322,    332,   4160,    108,   -301,    463,   -402,    352,
-     -1799,    580,   1443,    396,    287,   -158,   -421,    340,
-      -349,    109,     61,     47,  -2816,   -298,   -947,   -817,
-       673,    189,     36,   4069,   -584,   -335,   2608,     10,
-      -378,   -630,   -801,    228,    946,   -405,  -1186,    473,
-       625,     -2,   -741,    523,   3747,    318,    733,    171,
-       268,  -2554,    402,   -252,   -205,    292,   -351,     64,
-       289,    801,    989,    435,   -100,   -163,  -1215,   -467,
-       661,   -714,    165,   -228,   -637,   1357,   -498,    -52,
-       488,  -3882,    130,  -1053,    796,   1040,    381,   -729,
-       147,    803,    169,     46,   -157,    167,   -209,    126,
-     -1016,     88,  -1018,   -458,   -527,   1259,    621,   3847,
-      -525,   1247,     18,    253,    642,    340,   -705,    838,
-     -2769,   -672,    153,    115,    453,    773,      9,  -2285,
-      -291,      6,   -219,    628,    284,   -330,    568,   -240,
-      -206,   -127,    273,    373,    367,   -494,   8192,   -595,
-      -255,   -158,   -326,    -60,    513,    334,   -667,   -549,
-      -110,      2,    573,   1086,   -610,   -368,    259,  -3611,
-      -455,   1577,   -524,     11,    904,    390,    313,    707,
-      2670,   -223,   2710,    593,    -25,    228,    540,    663,
-       740,  -1108,    298,   1223,   -531,  -1978,    248,   -661,
-      -341,   -910,  -2434,    111,    217,    748,    231,   -305,
-      -419,   1873,   1094,   -936,  -1741,   1133,   1881,   -671,
-        41,    268,  -1826,    466,    135,     37,   -200,   4623,
-     -1212,   -969,    541,   1278,    652,   1061,   -759,   -747,
-      -427,   -107,  -1329,   -583,   -255,    -67,   -311,    -10,
-      -421,  -8192,    322,   -181,   -442,     76,    176,   -742,
-      -175,    147,    385,   -275,    -87,   -704,   -545,   -315,
-      -414,    569,     81,   -387,    628,   2954,   -604,  -1459,
-       -29,   1693,    840,  -1024,    -66,   -317,    266,  -2465,
-      -917,    -14,    151,   -369,    366,  -2388,      1,   -773,
-      1333,    -99,    223,   -694,  -1169,    917,  -2496,  -1290,
-      -286,  -1007,   -508,    734,    451,   -256,    266,   -105,
-      -143,    439,   -120,   -146,   7690,   -183,    188,     68,
-      -385,      7,   -278,    -24,    -66,    292,    137,    143,
-        21,   -495,   -527,   -284,     89,  -1584,    -64,  -3664,
-       286,  -2258,     80,   -932,   -771,   -338,   -830,  -1029,
-       -99,    -32,   -800,    351,    -87,    600,    -93,    133,
-       389,   -690,    269,    201,   -328,   5489,    558,   -702,
-      -487,    210,   3107,  -3628,    -96,   -388,   -169,   -221,
-       339,    403,   -816,    -24,    469,   -112,    560,    844,
-      -441,    698,    169,   -378,   -283,   -924,   2842,   -479,
-      -694,   -117,    -94,    523,    974,   1356,   -638,    590,
-       820,   2164,    247,   -532,    648,   -243,   -599,    -67,
-      5686,    174,     78,   -608,    230,   -172,    369,    342,
-      -113,    111,   -345,   -311,    594,    350,   -260,  -1423,
-      -425,   -407,  -1017,   -298,   -180,   -738,   -891,     66,
-     -3312,  -1157,      1,    811,  -1431,    612,    797,  -1344,
-      -890,   -959,    318,    392,   -190,    735,    196,   -347,
-        61,   -116,    344,    243,   -411,   -446,     62,   -128,
-     -3386,    476,   2695,   -193,    -39,   1960,     -7,    909,
-      -118,  -2275,    -28,   -997,   -210,    374,   -586,    -82,
-       914,    323,    -73,  -2743,    858,    -65,     43,  -2444,
-      -246,    145,     78,   -638,    844,  -2079,    352,   -332,
-       615,   -779,    270,   1799,    680,    500,    686,   1168,
-      -397,  -2233,    -31,   -163,    -18,    602,   -232,   -915,
-      -941,   3708,   -337,   -559,    315,   -401,     42,     26,
-       316,   -100,   -191,     36,    206,    214,  -3336,   -407,
-       494,    749,   -491,   -162,    -55,  -2902,  -1515,   -198,
-      -311,   -359,    439,    359,   -935,    203,   -214,  -2401,
-      -607,  -2843,    818,   -579,  -2066,    388,   -514,   -912,
-       787,    564,    149,   -103,   -757,    389,    173,   -303,
-       154,    814,   1631,   -393,  -2264,   1664,   -802,    904,
-       541,    784,   1063,   1152,  -2510,    297,     84,   -154,
-       160,   -497,    -78,   1503,   -598,   -543,     86,   1683,
-      -330,     46,    -24,   -892,    747,  -3336,   -393,  -2268,
-       107,    710,   1682,   -277,   -278,   -276,   1253,    327,
-      -986,    802,    191,   -732,    286,   -761,   1008,    461,
-      1615,  -1041,   2127,   2456,   3927,   -160,    187,     31,
-      -101,   3258,    202,    -75,    330,    375,   -301,   -275,
-      -782,    949,     12,   -621,   -617,    572,   1007,    414,
-       -91,   -428,   -392,   -985,   -692,  -3422,    199,    845,
-        91,    418,    290,   -983,    721,  -1265,    208,   1200,
-        91,   -758,  -2649,   -451,   -814,   -623,   -458,    272,
-      2777,    809,   1282,    763,   1122,     21,    520,     50,
-     -1018,    428,    385,   6149,   -255,      8,    -12,     21,
-        20,    293,   -315,   -446,   -423,    549,    428,    -56,
-      -497,    101,    653,   -177,  -3975,     56,   -127,   3214,
-       291,   -384,   -721,    478,   -314,   -231,   -469,   -362,
-      -682,    765,   -308,    420,    456,    322,    -54,     -2,
-        10,   -239,   6916,   -461,   -482,   -211,   -286,   -110,
-      -877,   -711,   -470,    159,    260,     59,    252,    -97,
-     -2978,   -646,    -35,    156,   -123,    360,    556,  -3254,
-      -475,   -313,   -268,  -1771,   -538,    203,    967,    283,
-      -653,   -565,    387,  -3097,   -255,     25,    295,    264,
-     -3716,    505,   1024,   -315,   -215,   -222,   -780,    660,
-       431,   -341,   -521,     46,    127,   -244,   -772,  -3741,
-       190,   -335,    -17,   2135,    744,    -35,    627,  -1115,
-       681,   -343,    123,  -1534,    -86,   -542,   -297,    -82,
-     -2772,   3914,    -75,    526,    124,   -523,   -112,    500,
-       863,    371,    190,   1036,    141,  -1011,    373,    796,
-       421,   -682,    403,   2924,   3730,      6,    211,   -691,
-      -167,   -391,   -655,    162,    348,    216,   -227,   -535,
-      -147,    367,   -189,    331,   -191,    159,     49,  -4905,
-      -252,   -290,    609,   -452,   1042,   1027,   -645,   -159,
-      -633,   -542,   -925,   -262,    -91,    192,   1266,     -2,
-      -164,    587,    188,   3434,  -1014,      2,   1373,   1832,
-     -1224,   -965,    831,   -987,   1180,   1389,   -925,     48,
-     -3239,    263,   -329,   -660,   -733,    262,   -988,    598,
-     -2421,    630,    720,   -925,   -455,    208,   1092,   -294,
-};
-
-static const int16_t cb1616l0[] = {
-       -15,  -7707,    115,     30,    -36,    -27,    -22,    -43,
-         2,      5,     31,     -1,     87,      2,     41,     21,
-       270,     16,   3747,   -773,   3027,    224,     92,   -168,
-        -7,    -62,    -79,    -44,     -9,     -4,    -58,    -78,
-      1063,    203,     -2,     76,    289,    -36,     92,    -29,
-       -78,   -148,  -5176,    137,    219,    299,     89,   -233,
-        62,   -129,     33,    123,    -30,    197,   4018,    -37,
-       -38,    139,     41,    153,     71,    -26,     27,     53,
-        72,   3358,    -68,   -122,    293,    -19,   -355,    104,
-        34,   3121,     16,     29,   -344,     37,    174,    -28,
-       -43,   -102,    -59,  -1661,     14,      5,    -62,     -1,
-        14,     15,    -42,      4,    -31,     -2,     13,     23,
-       957,   -419,     20,     31,    -14,     51,     24,    -46,
-         8,    -16,     27,    -75,    -27,    -33,    -28,     18,
-       -67,   -152,    -48,     47,     90,     48,    -74,   -103,
-       -18,   4863,      3,    132,    414,    -86,    -60,    285,
-        16,     32,    -44,      0,     22,   -163,     23,     -3,
-        23,    -61,  13224,     52,   -139,    -13,    171,    215,
-       -51,    -21,    -48,     33,    -10,    -17,    -21,  -7662,
-       -57,    -44,    -51,     35,     35,     34,    105,    178,
-       -77,     77,    147,     67,   -816,   2913,  -3087,    516,
-      -112,   -296,     21,    133,    211,    162,     87,    -25,
-      -535,   -830,    -12,     46,    -59,    -10,     -4,     42,
-         0,    -91,     -9,     47,    -90,    -29,     74,    322,
-      -106,     83,     44,   4693,   -788,    -73,    -85,   -105,
-       -76,  -1031,     34,      6,     78,    -34,    160,    -48,
-      -707,    -12,     -9,     39,     14,     23,     88,  -2286,
-        21,    -25,     42,    130,     39,    251,     16,    -50,
-       397,   -226,  -2570,     88,   -129,   -347,    159,     92,
-         0,    -44,    -49,    235,   -196,    -24,    -36,    113,
-     13387,     45,     22,     54,    -20,     29,     27,    -27,
-        54,     38,    -63,    -12,    -74,     45,     -8,   -115,
-       591,     46,      5,   -234,     57,    124,     86,  -3794,
-       -51,    292,   -160,   -152,     96,   -334,    348,     96,
-      -186,  -3870,  -3715,     54,      0,    -29,    -65,    -68,
-         6,    132,     47,   -155,     62,     26,     66,    -10,
-       -46,  -3093,     66,   3633,    183,   -171,   -132,    -24,
-       154,    157,    129,   -185,     12,    -26,     96,    -12,
-        88,    -34,     42,    -15,     37,  -6625,    -27,     13,
-        41,    -30,     62,    142,    -93,   -168,     84,    -22,
-       139,    -19,     18,  10590,   -111,     36,     13,    -44,
-         4,    -45,     -3,     -3,     28,    -25,     -4,    115,
-       119,    -49,     41,     33,     87,    -85,  12444,     73,
-        71,   -111,     61,    -15,    117,     23,    -24,     -5,
-       131,    -31,     -1,    -22,    -57,    -12,     50,     35,
-     -1555,    -20,     38,     82,    -52,     27,   -128, -14106,
-       808,    190,     89,    595,     63,   -291,    282,    -48,
-        32,   -706,   -433,   -673,   3285,   1311,    830,   3745,
-      -204,  -1185,   -584,    -51,    952,   1005,   -566,   1764,
-       186,   1211,   -495,   -112,   1213,    192,   2320,    -43,
-       -30,     24,  -1152,      2,      2,     32,    -55,    -25,
-        -2,    -17,    -14,     -6,     22,    -54,     32,     45,
-        10,    -85,    -26,    -16,    -66,    -60,   -210,   -104,
-       208,   -248,     62,    -28, -14552,    -11,    -44,   1601,
-        47,   -138,     46,    -35,   2647,    -81,     -3,    -38,
-       -66,    -59,    -33,    -19,     43,    -17,    -79,     53,
-      1821,  -1572,   2582,     85,     48,   -140,     78,   -155,
-      -173,     96,    -32,    121,    -58,    201,   -174,    -54,
-        74,  -2442,   -282,   -771,     37,  -2930,     15,   1762,
-       154,    263,    -15,    -19,    139,    246,   -243,    -31,
-        84,    145,      8,    152,     43,    128,    679,   1828,
-      3476,     17,     92,    102,    258,    -29,   -275,    -39,
-      -187,     88,     70,     28,      2,   2143,    274,    202,
-       -67,    -13,    -22,     68,    -35,    135,    114,    108,
-        27,      1, -11248,   -100,     14,     26,     59,     10,
-       -24,     30,      1,    -38,     -9,     21,     18,     -1,
-      2029,    -83,   -342,   3443,    -25,      7,      0,     54,
-        78,    198,     45,    233,     -6,      0,   -109,   -172,
-     -2250,     41,    -79,   2820,     44,    216,     39,     59,
-       -41,     52,     79,    -52,     12,     23,    -72,   -125,
-        83,     17,    -28,    -32,     13,      2,     28,      0,
-       -26,     75,    -81,     66,     25,    -81,   6516,      9,
-       -93,     49,  -4036,  -2484,    -42,    -71,    178,     99,
-      -133,     79,    -41,   -112,     57,     66,    -28,     13,
-        39,     64,   -123,   3174,   3061,    259,     55,    123,
-      -123,    246,   -138,    139,     75,     31,   -215,   -154,
-      -218,     26,     16,     21,    126,     26,    -33,    -10,
-       -15,     16,    -20,    -53,     21,  15526,    -35,    -59,
-       -50,    -11,    -58,     67,    -11,    107,    -24,    -37,
-      8155,     31,   -111,    -62,    138,    -60,    -10,     84,
-      -128,     37,     24,    -45,    -10,    129,    -68,    -37,
-        42,    -80,   -205,    -79,   5994,    -93,   -270,   -400,
-        20,    -89,    -39,   -200,    230,    197,    325,   -305,
-      -294,     94,   3207,    128,   3119,    226,     28,    -49,
-       264,    186,      8,    -29,    -13,     27,     22,    -63,
-        43,     84,    -19,     57,  -2605,    316,    259,    -43,
-        50,  -2241,    105,    -12,    -23,    -36,     89,     41,
-       -15,    145,     10,    -81,      7,    -50,     70,     60,
-       -23,     55,    -62,      0,     52,    -77,    180,     74,
-        79, -14297,      6,     24,    299,   -107,      4,    -29,
-     -3252,    -51,     40,   -143,   3550,    -28,    102,     24,
-       215,    147,   -169,    -60,    -43,   -486,      5,     -1,
-        62,   -116,  -2917,    430,     50,   2927,    139,    127,
-        63,    -53,    141,   -255,    -85,     95,   -101,   -176,
-       195,    104,  -3066,    -56,   3239,   -161,   -214,     57,
-        24,   -375,   -181,      0,   -259,    130,   -120,     -2,
-        -6,    175,   -147,   -185,     68,    219,    425,   2685,
-     -3120,    266,    246,   -270,    -70,    273,    168,    121,
-      -143,   2641,   -553,   -547,    638,    113,   2965,   -161,
-        29,   -374,    105,   -869,    108,     70,     15,    230,
-       -54,   -106,    -21,     -4,     86,     85,    155,   -120,
-       -17,    -21,  -2534,     57,    149,   -129,     21,   -169,
-     -2289,   -127,    -19,    -26,      3,     60,     35,      1,
-       -28,     -7,     36,   -180,    -13,     87,    -68,     56,
-        80,     64,     -8,    -73,   6691,    -32,     47,     48,
-        -6,     61,     36,     -8,    -41,     -1,     13,     68,
-       140,    -51,     25,     12,      3,     57,    -54,    -33,
-       -19,     12,     28,    -60,    -56,  -2399,    -14,    127,
-      1935,     84,    127,   -193,     -3,   3307,    -56,     15,
-        31,   -116,   -187,    236,   -289,    261,     69,    144,
-      1723,     79,    -68,    102,    727,     69,    654,    -60,
-        21,    124,   3497,    248,   -684,   1469,    368,   -254,
-      -211,  -2600,    771,   -138,    368,   3089,     52,   -206,
-       147,    200,    -15,   -136,    194,   -164,   -352,   -152,
-     -4870,      5,    191,     -3,    -97,     28,    -41,    107,
-         2,     11,     60,    -76,    -35,    -42,    129,    -77,
-     -2610,   -295,   -218,   -369,     10,    253,     15,   -125,
-        74,    -87,    -70,   3366,    115,    240,   -106,    -93,
-       121,     10,     36,      9,    -18,    -66,    -77,      7,
-        37,    -76,    -22,   2913,    242,     22,    172,    102,
-       186,   -231,     90,    -11,    -57,     45,    -10,    -44,
-       -84,     44,   -117,    -43,     49,   5585,     18,   -166,
-       -43,     64,     28,     -9,     26,   -160,     31,    -28,
-        29,     56,     29,    -57,    109,    -25,   3140,   -131,
-        57,    -20,     27,    -27,     -5,    -42,    -52,     18,
-        23,    -56,    -38,    -14,    213,    -33,    -86,  -4741,
-      -151,    -46,      1,    -17,     46,      7,    -13,      0,
-        50,     28,    -57,  -7291,    -20,     12,     66,    214,
-};
-
-static const int16_t cb1616l1[] = {
-       -81,      5,    -16,     34,     19,  10938,    141,    -21,
-        27,   -105,   -110,     32,    -67,    -75,     19,   -138,
-         3,    -14,   -408,   -302,     36,  -4612,     23,   -579,
-       -35,     19,   -312,     35,    120,     97,     82,   -109,
-        41,  -1745,   -158,    299,  -3069,     84,     18,   -447,
-       -33,     65,    -32,     45,     -7,    144,     86,    100,
-     -1738,    250,   -226,   -137,    159,    -45,    134,    438,
-       102,     37,    -15,   -161,    -23,   4221,    174,     47,
-      -264,   -182,   -182,    686,   -248,     89,    -41,     80,
-     -2687,   -194,   2552,    407,  -1106,   -970,   -181,   -228,
-      4395,    118,   1027,   -255,    136,    100,    -43,    246,
-        80,     15,     34,     82,    -54,   -367,    698,    232,
-      -177,     45,    -67,     49,    138,   -158,    168,    202,
-        43,    -70,   -101,     20,    -97,  -3465,   -342,   -255,
-       127,     25,    -52,     -5,      7,     76,     -3,     19,
-       -19,     42,     10,    -63,     16,    121,    732,  -3127,
-       -43,    116,     36,  -2519,     23,     18,    181,     41,
-       -32,    -11,     22,     51,     35,     16,    -34,    -62,
-      1744,     94,    173,  -1243,   -262,     11,   3218,    239,
-       149,   -219,     29,    118,   -382,   -289,    -42,    161,
-        17,     -1,   2551,    -83,     90,   -128,    138,   3238,
-        43,    -29,   -112,    110,   -268,    293,     23,   -117,
-       -64,   -137,     79,    -70, -10747,    -66,     73,     90,
-        35,     90,    -29,    -78,   -111,     75,     48,      8,
-      -169,   2944,     16,     89,    186,    -34,     82,    241,
-       -46,    257,   -243,     93,   2966,    178,   -256,    -18,
-       -33,    103,   -320,   -271,   3088,   2893,   -250,    102,
-       696,    124,   -211,     18,   -143,     97,    216,    -99,
-       195,     40,    -35,    144,     26,    135,   -152,   -215,
-       120,     25,   -254,  -1875,    657,    197,  -3527,   -332,
-       310,    -11,   1958,    102,    -12,    -45,      2,   -127,
-         4,      1,    -19,     47,    -20,    -52,     97,    -30,
-     -7738,     51,     26,      5,    -21,     18,     15,     15,
-        66,     30,     -8,     -7,    -31,     -1,    -33,     38,
-       164,     90,   6798,    -33,    -90,    -17,     -5,     14,
-       -42,     21,    -20,    -41,     48,     -6,    -36,      6,
-      -207,  -4363,   5075,     31,      6,    100,     65,     86,
-        19,   -158,     28,   -134,    -91,    -68,      9,    -26,
-       -37,   2588,    307,   3467,   -451,    101,   -441,    323,
-        62,    188,   -132,   -294,     98,    -22,    152,    -46,
-        65,    -39,    -37,    -82,     -9,     18,     43,     17,
-         8,     56,     97, -11564,     21,     15,     75,     85,
-       155,     15,     32,      0,     20,    -45,   7412,     48,
-         3,     38,     72,     30,     23,     42,    -20,   -110,
-      -454,   -233,    653,   -325,   -276,    504,   -481,    583,
-       270,   -649,    481,  -3166,   1619,    164,    -90,    150,
-        32,    -96,    -47,     49,    -13,    115,   -183,     75,
-        62,  -9026,     12,    -93,   -715,      6,    137,   -338,
-       810,    -39,   -277,   -108,    -20,    315,    572,     -3,
-     -4570,   1053,   -132,     13,    388,   -223,   -355,     31,
-       -47,     61,   -113,      5,    -38,     43,    -47,    -80,
-      2550,     27,    247,    277,    -86,    336,    139,    146,
-      -111,    -73,    187,   -312,     68,   -276,     72,    638,
-        73,    792,   -170,   1383,    421,   -703,  -3813,    112,
-       391,   -195,   -162,    -28,    -25,    317,    228,    -83,
-      4611,    654,    353,   -380,   -283,   -627,   -301,    161,
-      -156,    -81,      5,    -15,    -13,    -17,     53,    -50,
-        36,    -66,  -7921,     -2,    -54,    -41,    -26,     47,
-        -3,     22,     -6,     11,     63,      2,     42,     71,
-       -50,    -87,    -39,      2,    -56,     -2,  11165,     44,
-      -119,    -74,    131,    134,      5,    115,    -39,    144,
-       -23,      0,    186,   4648,    351,     36,    -70,    -71,
-      1706,   2131,   -228,     42,      6,      8,      4,    -43,
-       -12,    -40,    -44,     -7,    -14,     11,     83,    -93,
-      -144,    186,    -46,     -9,     13,    -87,   -120,     70,
-      -209,    115,  -3513,    139,    -46,    133,     96,     25,
-       215,    -35,   -437,    126,    403,   -115,    145,    203,
-       -69,   -334,     37,    934,   -481,   3163,  -2528,    -49,
-        57,    100,     76,     82,    251,    288,   -114,     46,
-      -201,   -161,   -161,   -716,  -4080,    378,   -830,   -254,
-        12,  -2110,   -300,     78,    288,     48,    -90,    -99,
-       -31,   -110,    201,     66,    327,    119,   -180,    148,
-       633,     71,  -4100,     33,     57,     -9,    -48,    151,
-       -20,     72,     71,    -11,     39,    -67,    176,     27,
-       143,    198,    383,    155,   3182,   -128,   -152,  -3209,
-      -172,   -262,    -13,    129,   -167,   -128,     55,     46,
-       -37,     70,    107,      7,    -23,  -2082,    241,    236,
-       -47,    -85,    105,    -47,   -202,    208,    201,     30,
-      -106,    -14,    -38,     14,    -45,     24,    -24,  12083,
-        22,    151,    -58,     -9,     59,    170,    113,    -82,
-       369,   -155,     53,     97,   -185,    -57,    203,    311,
-       236,   4789,    -24,   -591,  -1463,    118,     94,   -274,
-      3188,   -145,   -406,    183,      0,    -54,     17,    -22,
-        37,    -55,    -34,     63,   -340,    175,   -300,    106,
-      -190,    -38,     67,     -2,     19,    -46,    -42,     11,
-       -33,    -33,    -28,    -10,    -27,  -9235,     29,     62,
-      -927,   1285,     49,     72,     65,     89,     57,    -44,
-        -9,    -15,     85,     -1,     74,     81,   -123,    160,
-        69,  -2803,    -22,     47,   -467,    -74,    748,    168,
-        -9,    235,  -3155,   -154,     48,    483,   -341,     74,
-      2403,     97,     93,   -106,    219,    136,   -191,    -50,
-         7,     71,   -103,    261,   3283,   -124,   -624,  -2570,
-        73,    -31,     10,    -73,     30,    -15,  -2256,     -2,
-       -73,     55,     73,     14,    -74,    -81,     38,    352,
-       108,    -18,     25,     61,     54,      1,     -5,    109,
-        25,  -2676,    -25,    -52,   -316,      2,     36,    -36,
-      -355,     40,    -19,    120,     27,     -4,    -51,     -8,
-        42,    -10,    -28,    -90,   -143,     29,    -10,  -8442,
-       -22,   -566,     59,    -39,     -1,     27,     29,    -20,
-         6,     19,      0,    -36,     38,     68,    -43,     35,
-        22,    -47,   -146,   3567,     13,     12,   3230,    -18,
-       -32,     75,   -112,     -8,   -157,    -23,    101,    165,
-       198,     93,    383,   1236,   1077,  -3592,  -1401,   1135,
-       844,   -266,    -74,    -70,   -280,    -98,     67,   -109,
-        38,  -5109,    -66,    -57,     89,    -21,      6,     19,
-       -21,     70,     60,     76,     35,     18,     44,     51,
-        45,     40,     54,  -6685,    -67,      9,    113,    -29,
-       -10,    -96,     80,     98,    103,    -40,     -8,    -20,
-      -131,     15,    262,     47,   -253,   -116,    -12,  -4807,
-         2,    -81,     76,    -46,     37,    353,   -130,   -191,
-      -127,    -10,    -35,     91,   -122,    173,   -165,     -8,
-    -15179,     86,   -186,    123,   -295,    -25,     21,     63,
-       -93,    730,     20,   -120,  -4624,    340,   -253,   -473,
-        44,    -18,    -99,    -37,    -54,   -317,     65,    -52,
-      2167,     68,   -245,    224,    117,   -180,  -4695,   -276,
-       118,    142,   -101,    202,   -301,    -33,   -129,   -303,
-       -90,    -75,     50,     98,    -56,    -68,   -153,    -38,
-       168,   -278,    -22,    -64,   9757,    -91,    -23,   1284,
-        53,     56,    -11,    -46,  -1645,     11,     15,     12,
-         8,    -40,     -2,     84,    -56,     17,     -7,    -30,
-     -4010,  -3557,   -252,     56,    -79,    -87,     -7,      8,
-        79,     16,     21,     51,    -63,    -22,    118,    228,
-     -1525,    -78,    -22,     -2,     16,    -49,     17,    -37,
-        -3,    -14,     10,     31,     17,   -111,     32,   -144,
-     -3612,   3473,     79,     23,    -89,     74,     33,    -29,
-        11,    -42,    -42,   -129,    -41,    155,     52,     31,
-      -162,  12609,    147,     17,     68,      2,     15,    -12,
-       -39,     50,   -108,    -66,    121,     69,    -27,     94,
-};
-
-static const int16_t cb1616s0[] = {
-      1213,  -1302,  -1130,     90,    -69,     22,   -360,    360,
-       -55,    453,   -705,   4416,    227,    173,     -8,    149,
-       210,   -118,     51,  -3759,    949,   2418,   -238,    201,
-      -597,     94,   -253,     24,    225,   -497,    -59,    273,
-       576,    651,    608,   -483,    335,   -125,    256,  -2873,
-       318,   -146,   -650,   -306,  -2021,   1044,     41,   -455,
-     -1120,    832,    978,    212,   -463,   -209,     12,   -275,
-       -20,    118,     31,    639,   5933,   -180,   -121,   -285,
-        65,    212,    439,   -135,    538,    116,   -302,   -245,
-      2534,   -623,   1549,    -34,    727,  -1750,   1477,     79,
-      1669,   -828,    618,   -856,    773,   -286,    343,    -94,
-       107,   -320,  -3144,   -380,    694,    -80,    843,    103,
-      -700,   -269,    452,  -6847,    -12,   -527,     97,    -21,
-       -76,   -246,      2,   -104,    -68,     98,    312,    117,
-      -342,   1025,    207,    838,    -71,   2463,     60,  -1294,
-      1549,  -1310,   -202,  -1585,    682,    327,    608,    649,
-       664,   -801,    588,    137,   -468,    286,    234,  -6726,
-      -107,    177,   -147,    278,    118,    -81,   -242,     97,
-      -235,   1599,   -877,   1985,    448,   -319,   -745,   -504,
-      -433,  -1859,    -35,    286,   -665,  -1449,   -124,    -97,
-       930,   2622,    682,    698,   1898,   1120,   -323,   -142,
-      -679,    294,   -162,   -539,  -1649,    152,     23,   -414,
-      1493,    602,    913,   1428,  -3212,   -103,   -330,    557,
-       463,     92,    251,    339,     16,    936,   -116,    229,
-      -827,   -504,   2015,   1553,   -503,   -350,    214,    386,
-       295,   2697,    429,     72,   -705,   -120,    427,   -139,
-      -334,   -318,  -6613,   -468,     10,   -122,     59,   -322,
-      -165,   -144,     45,   -427,    -12,    -79,   -202,   -266,
-       981,   -273,    240,   -454,    -30,   -119,    340,     92,
-      -251,    247,    189,     71,    243,  -5648,   -601,   -434,
-      -674,    867,   -713,   -428,   -101,   -231,   1144,    -89,
-       -10,     57,    302,    154,    362,   -425,   2014,   2577,
-     -8659,    389,    -90,     76,     15,    147,     30,   -202,
-       -99,   -255,   -242,   -165,    257,     97,     41,    -72,
-       263,    613,    272,    400,   5020,   -199,   -196,   -177,
-      -276,    -25,     28,     97,   -155,    119,    763,     33,
-     -3540,  -1447,     16,   -169,    148,   -143,    707,  -2483,
-       178,     83,    -83,    154,    -75,    -15,    153,    283,
-      -323,   -139,  -1390,     69,    725,  -1744,    331,  -3665,
-       415,   -514,   -366,    124,    660,   -295,    180,     77,
-      -228,    192,    684,   -193,      4,   4409,    298,    427,
-       591,    290,   -159,   -166,   -372,   -514,  -1840,   -562,
-       795,  -1765,   -349,   1178,  -1619,   -391,    615,   -784,
-      1353,    746,   -871,   -994,    182,   -464,   -498,    -96,
-      -306,   -729,    743,    270,    223,   -731,     73,   2692,
-      1110,  -2354,   -328,    -21,   -172,   -339,   -528,     93,
-      -338,    548,   1498,    309,   -134,    160,   -247,   -619,
-      1127,    783,  -1557,    400,   1035,   -445,   -155,  -2443,
-       590,   -790,    137,    388,   1188,    844,   -395,   1005,
-        55,   1141,   -122,  -3174,    138,    155,   -506,    306,
-     -3255,   2432,   -116,  -1289,   -744,   -350,      3,    192,
-      -156,     95,   -552,    -57,    329,   -405,    737,    138,
-      -835,   4096,  -1037,    797,   -417,   -418,   -507,   -694,
-      -256,     78,    -94,    -63,    -93,    754,   -555,    -90,
-     -1518,   -878,    167,   -392,   -100,    -78,    -80,    -45,
-      4774,    114,   -284,   -560,    -21,    275,     15,   -195,
-     -1692,   -711,  -1057,    167,  -1555,   -690,   -263,   -267,
-       310,   -229,    -14,   -880,    426,  -2826,    320,    -49,
-     -1223,   -725,   3538,   -270,   -606,  -1812,    481,   -703,
-       176,   -284,   -173,    271,    847,    711,    239,    314,
-      1233,    -61,    477,    429,   -691,   -156,   6712,    850,
-       365,    229,   -197,   -355,    298,    250,    207,   -437,
-     -1647,   -261,    165,    114,    165,   1165,    -58,   -597,
-     -3290,   -517,   -478,   -842,   -187,   -448,   -302,   -204,
-       410,    544,    669,  -2012,    476,    434,    214,    698,
-       302,    100,     61,     63,   -386,    918,   4434,   -230,
-       157,  -1019,  -1487,   2239,   -774,   -234,   -378,    772,
-      -190,    270,    -61,    -19,    322,    488,    937,  -3582,
-      -415,   2091,   1862,     81,   -134,   1285,  -2732,    221,
-      -235,    388,   -216,    -63,    664,   -105,    -37,    165,
-       899,   -373,    284,   -375,    286,   -263,   -295,    276,
-      -246,    188,   5285,   -303,    290,    -60,     -1,     95,
-      -703,   -288,     74,   -717,   -127,    -53,   -422,   -452,
-       166,    -54,    -15,    268,    238,    -31,   -279,  -5872,
-       863,   -907,   -101,    885,    552,    442,  -2336,  -2142,
-      -804,   -147,   -791,   1000,     96,    250,   -306,    134,
-       743,  -1648,   -867,    673,   1594,   3725,    527,   -676,
-      -661,    238,    262,    560,    277,    -58,    444,    166,
-     -1039,   -702,    558,   -970,  -1763,  -1198,    580,    378,
-      -421,   -972,    630,   -279,  -2456,  -1222,   -232,   -749,
-     -3325,    174,    789,    729,   -487,    583,   -157,   1503,
-      -801,    -38,    -11,    556,     81,   1508,   -140,     74,
-      1373,    912,   1471,      4,  -1080,   -105,    -58,   -104,
-       -54,   -544,  -2392,   1550,    318,   -506,    -11,   -180,
-     -1891,   -230,   -259,  -1182,   -154,    524,   -568,   1972,
-       546,    469,   -720,   1089,  -1530,   -680,   1349,    429,
-        82,  -1524,   1894,    -90,    188,   -145,     15,  -1113,
-        15,     53,    282,   2212,   -736,   -941,  -1148,   -344,
-      1473,    344,    392,   -333,   -556,   -480,  -3833,     35,
-      -160,   -525,    151,   -534,   -782,     38,    520,   -416,
-      -384,   7582,   -158,    -29,     74,    -57,    -23,     73,
-      -393,   -245,    -12,   -260,   -154,   -319,    357,    247,
-      -306,    351,    273,    755,    227,     89,    283,   -152,
-        17,   5129,    191,   -213,   -531,    255,   -468,   -209,
-      1128,     72,   -807,    225,   -319,   1638,     42,     20,
-       935,    -52,   -326,    541,  -1174,    130,    284,   -112,
-       444,   3959,    262,   -631,   -262,    275,   1025,    190,
-      1125,   -265,    -95,    265,     35,    270,    -92,    -30,
-      -141,    325,   -435,     45,   -659,    149,   3648,    339,
-     -1701,  -1338,   -144,   -989,   -604,     84,   -394,    168,
-      -302,  -1294,   -433,   -921,   1271,     77,    374,   -604,
-      -230,     97,    206,   -138,   2909,    478,    707,      0,
-      1242,   -340,  -1659,    349,   2751,  -1175,   -146,   1038,
-        65,   -775,   -423,     14,     22,     41,   -905,    287,
-       280,   -933,    195,  -1817,    540,  -2374,   -661,  -1102,
-       879,   1232,     29,  -1683,    286,   -136,    658,   -395,
-     -1782,  -2823,   -624,   -223,   -299,   2859,   -103,    -45,
-       544,     82,    -21,   -263,   -666,   -362,   -732,    249,
-      1087,   -242,     30,    663,   -386,   -350,   1240,   -492,
-      -868,     69,    -41,     35,     30,  -1791,   3870,   -455,
-      1355,   1098,   2933,    347,    361,     79,   2855,    -26,
-       -66,   -598,    -43,     21,   -386,   -802,    -81,   -436,
-       846,   -673,    377,   -326,  -1217,   1465,   -480,   -205,
-     -2168,  -1689,    690,    355,   1192,    734,   -113,     39,
-      -486,   -644,    438,   1096,   -723,   -524,  -1634,   -621,
-      -394,    226,    167,   -625,   -709,    854,   3005,   -910,
-        13,   -793,  -1517,  -1254,     18,   -440,   -836,    651,
-       -31,    229,  -1081,   -126,   -191,  -3612,    487,    451,
-      -292,    943,  -2018,   -618,   -259,   -649,   -723,   -447,
-      -238,   1096,  -2228,    675,    563,   -316,  -1248,     32,
-       -28,    293,  -1817,    226,    267,   1291,    624,  -2279,
-       143,    650,      5,   -563,   -504,  -2124,    -94,  -1613,
-     -3050,    708,  -3458,    442,     30,     65,    -80,     89,
-       204,   -245,     94,     28,     -2,   -231,    623,   -189,
-      -405,  -2147,   1147,   3124,    806,   1048,   1145,    653,
-        47,     86,     -4,     46,    437,    229,   -190,    310,
-      1995,    -48,  -1015,  -1806,   -266,   -941,    361,    179,
-       172,    397,    182,    323,   -516,   3435,      7,     -5,
-};
-
-static const int16_t cb1616s1[] = {
-     -2521,   -518,   1830,    985,   -500,    109,   -807,   -197,
-       543,  -1036,    104,   1989,    428,    740,   1110,   -366,
-      1482,    899,  -1828,    159,  -3015,   -311,   -792,    -42,
-         3,   -412,   -157,    -13,    863,   -248,    261,   -187,
-      -409,    156,    772,    271,    318,   -262,     78,   -571,
-        28,    370,    119,    302,  -4794,    106,   -123,   -153,
-      1857,   -702,   1090,   -319,    415,   -327,   2124,   -170,
-      -411,    174,     62,     -7,    921,   -128,    735,   -127,
-       972,   1678,    166,  -1471,   -208,   -224,    871,   -900,
-      -223,   -817,    288,   -472,     10,     31,   -401,  -3201,
-     -1290,     -3,   -301,    183,    730,    473,    438,    -81,
-       882,    -64,   2898,   -242,    408,   -211,   -333,   -254,
-      -820,    612,  -1128,    -60,    -73,  -2516,     45,    637,
-      -130,    459,   -312,   -223,   -629,   1490,   1792,   -199,
-       -21,   -545,   1772,  -1084,   -173,    381,    380,   1289,
-      -117,    483,    138,  -1200,   -519,    598,  -3453,    349,
-     -3102,   1260,   -170,    238,   -684,     48,   -483,   -883,
-      -879,    139,    298,   -110,   -203,   -955,    195,     57,
-      -550,   1945,   -711,   -688,  -1470,   1527,     58,    317,
-       656,    310,     57,    162,   2006,   1387,    845,   -127,
-      -398,    318,   2520,   2002,   -906,   -323,   -194,    907,
-       588,   -228,   -357,   -316,    557,   -596,  -1559,     -3,
-      1614,   1317,  -1701,    936,    -89,  -2270,   1327,   1046,
-       400,   -233,     18,   -730,    -23,   -181,   -593,     74,
-      -570,   -969,    432,   -261,   -833,    -90,  -4675,    786,
-      -566,   -183,   -859,   -554,    346,   -493,   -201,   -220,
-       241,   -919,  -1896,    265,   -802,   1380,   -718,  -1103,
-      -574,    307,    138,  -1260,    175,   2540,    -82,     58,
-      1046,  -1381,   2486,    582,    455,    485,   -824,   -150,
-        57,    -45,   -155,   -490,  -1108,  -2191,    833,    423,
-     -2011,    267,    779,    140,    -28,     57,     94,      6,
-      -301,      5,   -833,  -1226,   -193,   1110,    -63,     79,
-      -492,  -1465,  -2733,    444,     56,  -1116,   -601,     20,
-      -618,  -1315,   -695,   1146,    -66,    336,   -166,    158,
-       530,    -53,   -371,   -594,   -685,    114,   -146,    373,
-       174,     -1,     47,    119,   -124,   -121,  -6697,    -94,
-     -3544,   1506,   1221,   -101,   2160,    558,   -254,   -728,
-       511,    378,   -383,     12,    626,    172,    183,    354,
-        49,   1669,   1188,   3810,    409,    152,    694,  -2520,
-       342,     61,    -85,    -38,   -170,      5,    305,    154,
-      -348,    699,    332,   2542,    673,  -1130,  -2601,    554,
-      1483,    466,    271,    490,   -644,    822,    -96,    477,
-       131,  -2051,   -111,     43,    -31,    -62,   -767,  -3257,
-       663,    488,   1823,    522,   -525,   -249,    481,     -7,
-     -1298,   -941,   -335,   -566,    305,    534,   -735,    207,
-       709,  -3170,     19,    -20,  -1888,    271,  -1697,    117,
-      1837,   2690,    305,   -483,   -463,    407,   -706,    467,
-       518,   1806,    244,    -80,   -453,   -505,    882,    843,
-      1328,   -280,    175,    319,   -842,    192,   -680,   -469,
-      5440,   -205,   -187,     53,    332,    204,   -184,     96,
-      1026,   -525,     20,    975,    125,  -1562,  -1873,   -757,
-      -137,    133,    -10,   -340,   -783,  -1484,  -2206,   1238,
-     -5212,   -466,    129,   -224,     17,    497,    -41,    846,
-        88,    -41,    285,    284,   -155,     21,   -225,    150,
-       223,   -807,   -444,  -1141,   -908,    292,   -326,    559,
-      -446,   -283,    -41,   -277,  -3479,   -667,    532,     83,
-       257,    383,  -2986,   1685,    697,    777,   1551,   -142,
-      1786,    579,   -531,    787,    712,   -984,    603,   -174,
-      -459,   1303,   -943,    741,   1103,    -73,    600,   -403,
-       -42,   -169,    -90,    220,    208,    105,  -4083,  -1069,
-       981,   -926,    124,    273,   -145,   -133,    307,   4720,
-       209,    324,    -79,     12,    -41,   -220,    211,   -184,
-       435,    307,  -1544,     83,   1565,   -445,   -217,   -648,
-      -379,  -1270,  -1590,  -2337,   -860,    348,    648,   -157,
-      -785,   3318,   -123,   -138,   -412,   -876,    358,   -173,
-      -280,    -81,   -149,   -167,   -160,  -2113,     20,    -40,
-      1022,    432,   -721,     55,   -651,     17,  -1135,   -380,
-      -542,  -1128,   2919,   -475,   -143,    -53,    176,   -152,
-         7,    -29,   -172,    174,    195,  -8005,    277,    105,
-        35,    115,   -314,    137,   -253,     75,   -278,     90,
-     -1508,     79,   -153,   -560,   1027,   -349,   -292,   -466,
-     -1101,   -324,    -84,   4251,    822,   -420,     55,     43,
-      1886,    281,    964,   2408,    425,   1187,    -27,    -84,
-     -1277,     63,   -978,   -143,    506,    727,   -155,   -384,
-      3434,    592,   -262,   -438,    -30,   2849,    -69,    -58,
-      -181,    -87,     20,    299,    412,   -263,    702,    131,
-      -271,    -10,    736,    121,  -6299,   -132,   -116,     26,
-      -253,   -586,     32,   -145,   -251,    -12,    471,    135,
-       585,    604,     29,    873,    363,     -2,  -1595,     41,
-     -1147,   -142,    665,  -2752,   1302,   -358,   -134,     29,
-      -691,    -12,   -702,   -459,    100,    278,      9,     54,
-        66,   -458,     53,    213,    193,     14,   -400,   4870,
-      -950,   -209,     50,    470,    449,      3,   -118,   2287,
-      -469,    -58,    126,   1011,   -826,    386,  -1019,  -2390,
-      -586,  -1401,    137,    760,    141,    -89,    117,   -252,
-      3106,   -936,   -198,    390,    463,   -245,   -509,   -123,
-      3057,   1200,   3451,    282,   -332,   -585,   -662,   -955,
-       165,   -276,     73,    373,    202,    506,    356,    125,
-       141,   -613,   -670,    446,   2031,   1521,   -446,   1339,
-       198,   -112,    214,     70,    265,  -1310,   2492,   -133,
-     -1880,   -347,   -961,    312,  -3714,   -475,    102,    391,
-        64,   1091,   -686,   -101,    144,    447,    173,     66,
-      -374,    342,     69,  -3379,  -1331,   1160,   -889,   -858,
-       982,  -1613,   -223,     57,    186,    428,    226,   -477,
-       449,  -1052,   -661,   -382,    459,    277,   -277,   -250,
-        12,   4077,   -260,   -161,   -163,     38,    159,    243,
-       131,    457,  -2253,   -301,  -1626,     37,    806,    104,
-       191,   1899,    346,    398,  -1108,   -623,   -391,   1092,
-      1252,   1126,     81,   -116,   1192,    674,  -1321,    -32,
-      1739,   -708,   -230,   -844,   -507,    415,    261,    211,
-      -619,   -191,   5460,      8,    139,    197,    392,   -556,
-      -215,     66,     64,   -808,      0,   -136,    151,    156,
-       260,     94,    418,  -1446,   1815,   -540,   -793,    451,
-      -477,   1788,   -124,    330,   1638,    342,   -503,   -384,
-     -1201,   -762,    929,  -2886,    888,    -63,    318,    598,
-        42,  -1226,   -400,   -462,   -136,    321,   1872,    376,
-      1260,    142,    -79,   4377,      9,    294,    -71,   -190,
-       -21,  -2612,   -240,     26,    -18,   -227,    864,     79,
-      2588,   -882,     87,  -2976,      9,    480,  -1573,   -170,
-      -429,    201,   -124,    171,    632,    -60,   -447,     64,
-       -37,  -1182,    -86,   -105,   2901,  -3557,   -134,    486,
-       141,   -259,    239,    465,    467,   1009,   -409,     34,
-       254,   2469,   1002,    834,    557,   -845,    149,   -747,
-      -504,    494,   1382,   1067,    353,    191,  -1105,   1705,
-      -586,   1472,   -444,  -1303,    198,    602,    471,    468,
-      4855,    127,   -141,    487,   -454,   -138,   -392,   -118,
-      -491,   -948,     58,   -290,     -7,   -662,    229,   -268,
-        -2,   -537,   -620,  -4770,   1152,   -173,    166,    -69,
-        32,  -2555,    433,   -583,  -2219,   1107,   1082,   -942,
-      -173,    399,   -601,    250,    423,    125,   -448,    352,
-      -571,   -406,      0,   4735,   -264,   -174,  -1020,   1105,
-     -1149,   -171,   -252,   -130,   -202,    -74,    601,    601,
-       570,  -2742,  -1403,   3129,   -349,    194,    309,    130,
-       261,     93,    154,   -117,   -418,   -657,    270,   -160,
-      1660,   -818,    613,  -1458,   -653,  -3763,   -232,     90,
-      -265,    -99,    -28,    -13,   -281,   -553,     11,   -142,
-     -1764,  -4548,    936,    -21,   -683,    -88,   -806,   -187,
-        28,     78,    -70,    -99,     -2,   -493,    -16,     48,
-};
-
-static const int16_t cb1616m0[] = {
-     -3821,  -3397,    203,    -25,    -22,     68,    189,    -13,
-      -286,     94,     18,    288,     29,     -5,      3,   -414,
-      1483,   -172,  -1275,   -180,  -3792,    360,    145,   -143,
-       444,   -139,   -198,     70,    -17,   -353,   -121,     -6,
-        76,    -50,   2987,    173,  -3070,   -229,    -16,    192,
-       134,    -55,    -86,   -200,    128,  -2052,    -59,    -11,
-        -4,    309,    179,    494,   -138,   -363,   -336,    119,
-      -127,   2497,   -169,   -316,    -87,   -538,     42,   -534,
-       315,   2364,     61,    269,    -87,    -94,     82,  -2069,
-        18,   1238,     -7,     79,     -9,     41,     70,     50,
-       209,   -158,   -136,     28,   -275,     62,    296,     77,
-      6269,   -184,     73,    -19,    -25,    -57,    134,    -52,
-      8569,   -176,     -8,     17,     15,     79,     36,   -137,
-        12,     44,   -270,   2335,    111,    517,    -83,    207,
-      -276,   2577,   -198,     83,    376,    -75,   -273,     62,
-       109,      4,    -48,    122,    -41,     99,    -87,     14,
-     -7696,   -118,    -66,    171,     96,    -31,    123,   -217,
-      -676,   -439,    407,     97,   -281,   1873,    626,   -148,
-      -548,   1634,    704,     97,  -2076,   -336,    632,   -371,
-       113,    544,    -88,    184,  -2200,   -420,   -592,   -168,
-       759,    291,   2215,    704,   -140,   -145,  -4088,    295,
-       186,   -270,    283,    294,    -42,     76,     69,     41,
-      -140,   1635,   -200,   -682,    302,   -192,    902,   -540,
-      -843,   -494,   -529,    102,   -759,   -165,   3160,   -180,
-     -1450,   -424,    -16,      6,   -548,    296,  -3056,    219,
-     -1883,   -109,   -566,   -431,     95,   -422,   -532,    -26,
-       120,    -46,     23,    174,    175,   -369,    110,     -2,
-        25,    132,     -1,  -3338,    -67,   2140,    -25,    566,
-      -129,     35,   1187,    337,   1999,   2712,    -71,     45,
-      -177,     94,   -321,   -197,   -573,     98,    225,     46,
-        53,     78,    -40,     82,     23,   2718,   2534,     89,
-       -65,     77,    206,    343,    527,    102,   -191,     94,
-       463,    111,  -4529,     97,    876,   -205,   -944,    181,
-      -132,    467,    366,     85,   -302,   -100,    -33,    -76,
-     -3087,  -2546,    215,    277,    -52,    352,    137,    -45,
-       162,    590,    406,    382,     85,  -2824,    141,    219,
-     -3790,     40,    126,     32,     30,    100,    121,   -210,
-       196,   -268,    178,    102,   1229,    -80,   -750,    -11,
-       -57,     84,    238,   3571,    274,   -254,     55,  -1616,
-      -176,   -755,     46,  -1306,   -201,   -228,    101,    197,
-       -93,   -156,    319,     82,   -385,    -17,  -4660,    180,
-      1278,   -113,   -215,    103,    832,   -233,    412,    249,
-      -900,   -132,  -3427,     52,    416,    267,    317,   -384,
-       130,     78,     91,   -360,     75,    386,   2219,   -360,
-     -2975,     17,    286,   -294,   -213,    231,    131,    821,
-      -358,    222,   -230,    -44,    -93,  -1151,    294,   -316,
-        -8,    129,    231,   -993,    -58,   3319,     48,  -2546,
-      -213,    -14,   3208,    162,   -240,   -176,    307,   -165,
-       -20,    348,   -113,    -78,    -91,     -8,   -261,   8033,
-      -179,     64,     -7,   -113,    -59,    -32,   -170,     52,
-        55,    -80,    140,     64,    -39,    915,     28,    416,
-        38,  -2328,    206,    115,    366,    -92,    652,    110,
-     -2838,    -59,    613,     23,    109,   -151,   -198,    185,
-      3033,   -122,   2863,   -273,     86,     41,    114,    -99,
-       315,    372,     14,   2191,   -171,    531,    -18,    -34,
-      -352,    130,   -360,    117,  -2896,      2,   -564,     51,
-       223,     57,   -257,   3161,   3130,   -384,    126,    -40,
-      -160,   -232,   -138,     81,    -34,    -96,     82,      9,
-        62,   -161,    344,    100,    790,   -243,   -344,   -393,
-      -531,    401,     90,    171,    144,   -329,      7,  -4639,
-      -135,     -6,    351,    -21,   -195,    224,    -25,   6027,
-       224,    -14,    344,    170,   -169,    -97,    252,   -488,
-      -379,    -73,    629,     -9,    266,    152,    -64,    330,
-        -8,   2080,    -91,  -3315,    229,     25,     45,   -528,
-      -123,   2951,     40,    -85,     -4,  -2695,    -38,   -112,
-        84,    -30,     79,    762,    151,  -4089,    -95,   -151,
-         9,    138,   -206,     -3,  -2114,     99,   -100,    116,
-      -403,    -56,     -8,    -36,    115,    -18,   -195,    -38,
-      -240,      8,    -32,    122,    125,  -7406,     45,   -210,
-       111,   -152,   -152,    -35,    -72,     28,   -154,    303,
-     -3147,    459,  -2881,    -14,    -13,    -56,   -126,    -69,
-      -213,    -97,    202,    -88,   -277,   -557,    451,   -376,
-       -91,    319,    141,   2728,     23,   2506,   -101,    632,
-        62,   -314,    159,     44,   1231,    -65,    -37,    192,
-      3118,   -186,   -396,   -108,     71,   2111,    586,     95,
-        15,    -28,    176,     20,    -67,      3,   -265,    101,
-      -182,    -21,   -455,    -15,  -6225,    -45,   -353,   -384,
-       -22,    113,    -40,    -47,     57,    -73,   -503,    134,
-       736,    -70,   -125,     -5,   -250,     62,    165,    182,
-       185,   -132,    426,   -276,    100,   -497,    -23,     81,
-      -112,  -3528,  -1997,   -234,   -154,    -91,   -125,    -26,
-       179,   -611,    655,    767,  -1064,    130,   -264,    107,
-      2811,  -1391,    298,    -20,     37,    -74,    -12,   -157,
-      -270,   -106,   2559,    -89,  -3107,     55,    187,   -265,
-       195,    140,      1,   -484,    713,    171,  -1123,   -226,
-      3666,   -367,   -516,   -249,     38,    195,    236,   -378,
-      -383,   -205,    -72,     -7,     15,  -9329,     -6,    -26,
-        56,    141,     48,      6,   -141,    -95,    -69,    -40,
-       -99,    -80,     73,   -253,    456,   -174,     51,   -250,
-       -48,  -2115,    -63,  -2555,    -25,  -2058,    -58,     66,
-       176,     14, -10053,    -23,    -39,    -37,    -15,     38,
-        82,     11,     97,    169,      5,    -67,     57,     61,
-     -2248,    108,    -19,    256,   -169,   -122,   -336,   -431,
-       -77,   -250,   -156,   -745,    184,    684,  10559,   -199,
-       -34,    -37,     96,    -82,    -17,     60,     65,     21,
-       -67,   -337,     62,     35,     74,   -214,     38,     47,
-      -129,   6139,   -139,    -57,   -154,    261,      7,   -127,
-       109,     40,    179,    -99,    198,    -51,     48,    -36,
-     -2377,   -194,   -334,  -2826,    103,   -220,    -57,     41,
-       979,   -895,     68,   -217,  -1712,   -430,    -98,     91,
-      -107,  -1755,   2615,     84,   -500,    231,    480,    -31,
-       146,   -157,   -120,    152,   2342,    -36,  -1969,     57,
-      -109,    476,   -243,    261,    -58,   1998,      4,   1388,
-       -98,     45,   -140,    400,    -76,   -321,    -22,     -9,
-       210,    517,      5,  -4708,     66,   -330,   -405,    -19,
-      2158,    -65,  -2163,    244,    -16,   -192,    494,   -381,
-      -194,    413,     89,    220,    455,    -54,      4,    206,
-       221,  -4998,     63,   -365,    354,    364,    677,    207,
-       -66,    -27,   -477,   -182,    841,     85,    -40,    166,
-      -185,    321,   -293,   -181,   -429,   -231,   1401,   -122,
-       938,     67,   -185,     51,   3188,   -802,    421,  -3230,
-      1432,   -432,   -658,   -587,   -843,    421,    177,    446,
-       510,   -140,    -90,   -127,    -78,      2,   1089,   -185,
-       301,   -393,   4100,   -152,    265,    224,     25,     95,
-       534,    280,   -254,    -45,     -5,   -207,     49,   -126,
-      8922,     43,      9,     21,     28,     21,    -42,    -84,
-        38,     90,  -2014,     61,   -149,    188,  -3350,   -120,
-       -43,     10,     14,    155,   -225,   -351,   -114,     28,
-       -23,  -4400,    367,    -51,     76,    -89,   -113,    122,
-      2007,     25,   -348,   -227,   -370,    -61,    135,    -79,
-};
-
-static const int16_t cb1616m1[] = {
-      -321,     -7,  -6725,    -36,     77,    -20,   -101,   -529,
-      -166,     97,    -76,   -232,    -70,     16,     13,     93,
-       -50,    222,   -258,  -4424,   -125,    125,     83,    313,
-      -246,   -325,    108,   -331,    484,   -188,    192,   -964,
-      2603,    -38,  -2236,     58,    337,   -254,    -17,    -90,
-       -88,     40,   -141,  -1293,    -56,   -811,    247,    -78,
-       -34,    144,    112,     43,    142,   -137,   -147,     56,
-      -406,     12,    210,    132,   3707,    109,   -896,   -268,
-     -2295,   -509,     32,   -219,    113,   -104,    141,    273,
-        18,   -358,     16,  -3354,   3474,   -167,    220,     10,
-       104,   -175,     -8,    -71,    -77,    -48,    277,     82,
-        86,     35,   -712,    -32,     36,    -65,    213,    121,
-       -76,   -742,    291,  -4587,   -169,   -122,    -77,   -285,
-        54,   -120,     89,     71,     12,   -133,     54,   -215,
-     -1906,   -115,   3220,   -194,   -391,     87,    415,   -212,
-      -210,   -138,    182,    590,    713,    944,    320,    142,
-     -1970,    197,    -79,   -548,    458,   2836,     33,    -62,
-      -183,   -149,   -640,    147,   -427,   -113,   -178,  -1631,
-      -108,   2666,    -58,   2210,   -251,    288,     16,    382,
-      2123,    636,     -4,   1118,    232,    335,    -33,   -114,
-        24,    -68,   1309,    -38,   2080,    534,    288,   -162,
-      -630,   -360,   -643,     10,     62,  -2229,    263,     19,
-       310,    -44,    419,   2846,  -2579,   -159,   -246,    685,
-       -67,    394,    314,   -356,   -158,     19,     90,    116,
-     -2261,    163,    664,    163,   -191,    -49,    -18,   -308,
-       -15,   2508,   -370,    693,    -62,    818,   -307,   -658,
-       133,   1858,  -4900,     53,  -2485,    -48,     -9,    126,
-       159,      6,    -71,    291,    102,   -367,    -62,     27,
-        88,     -6,    204,    -65,   -725,     31,   -159,     -1,
-        -5,     45,   -133,   -146,    261,  -4481,    -19,    694,
-      -261,   -478,   -177,     88,    214,   -836,    -14,   -762,
-      -111,    501,      0,    254,   1971,  -1024,   2678,   -141,
-     -6064,     76,    430,    160,   -195,   -582,    280,    580,
-       183,   -315,    -13,    665,    -53,    315,   -199,    438,
-       220,   3267,    194,      2,   2808,    -88,     42,    150,
-      -179,    237,   -155,    143,     46,     99,     27,     30,
-     -6137,    -51,    -89,    201,    145,   -179,     13,   -358,
-        55,     71,     -3,     28,     -9,    -16,    125,    160,
-       159,    -21,  -5407,   -485,     -4,    -88,    -89,     44,
-         3,    166,     22,   -413,    993,     80,    485,   -107,
-       446,   -943,   1025,    261,     -3,   2991,    547,   -268,
-      -109,    536,    -10,    187,     17,    388,   -120,    -71,
-      -343,   -416,    162,     69,     -9,     46,   -477,     83,
-      6134,    146,   -236,   -125,    -94,    -55,   -274,   -231,
-      1120,    171,   -139,  -2714,     80,   -111,     20,   2475,
-      -135,  -1710,    317,   -762,    155,   1222,     68,   1192,
-       -15,   1825,    -36,    -45,   -120,   -484,   -131,   -162,
-      -128,    163,   -407,     72,   -222,    -46,   -222,  -5319,
-       278,   -373,   -436,    284,    138,   -243,   -104,     28,
-       -77,   3022,     93,    -15,   -581,   -498,    292,   -165,
-     -1740,    121,    195,  -1368,   -134,    -68,    -20,    -75,
-       -10,    113,    128,   -381,   -507,   -237,   -709,     13,
-       -22,    155,  -5065,    -95,    246,   -226,    193,    687,
-      1839,    246,   -232,   -359,    475,    106,    297,    205,
-     -2702,   -378,   -219,    -20,    140,  -3198,    192,  -3077,
-      -135,    -38,    -23,    213,    -72,    255,    -90,   -130,
-      -150,     62,   -484,    -94,  -2625,    -89,    344,   -129,
-      2655,    369,    -35,     17,   -697,    251,   -343,     68,
-        53,    176,   3104,    237,    -75,  -3020,    178,     45,
-       -86,     45,   -115,    183,     49,     26,    140,     77,
-        40,  -2315,    249,   1791,     48,   -755,    -12,    201,
-      -455,   -250,    -62,   1729,   -113,   -959,    238,   -114,
-       289,   -135,  -2208,   2748,     65,    306,    -83,      3,
-      -513,   -481,    -49,   -163,   -568,    -88,    668,    -51,
-     -2586,    106,    -22,    584,   -453,   -350,    333,   -177,
-      -236,   -657,    536,   -349,    394,    -56,     14,    133,
-       -55,    -84,    210,    -19,  -8647,    154,     80,     27,
-        -7,    -76,   -117,    100,   -201,      1,    296,   -101,
-        -6,   5642,    137,    -59,    -93,     95,   -110,   -280,
-       -61,   -300,     25,    887,     43,    -30,   2493,     76,
-       -22,   -343,    489,    266,    308,    163,    132,   -349,
-      2021,     18,  15536,     61,     11,    -41,    -42,     41,
-        -4,   -183,    -40,    -24,     26,    241,   -102,   -115,
-      -164,   2044,    -35,   -217,   -226,    734,   -228,  -2546,
-       218,      0,    122,   -150,   -528,   -188,  -1273,    155,
-       107,    -33,    -37,   -293,      6,    112,   -155,   -228,
-       192,  -2378,    153,  -1045,    213,   2975,     39,   -159,
-       -10,    -41,     34,   -125,      4,    -30,   3907,    -41,
-       848,   -346,    191,   -195,   -292,   -126,   3421,    -24,
-      -244,     92,    693,     64,   -193,    192,    121,    -33,
-      -141,    523,   -162,   2754,     71,     59,     40,    -63,
-      -142,   -100,   -338,    379,   -136,    -64,   -196,     11,
-      3198,    162,   2097,   -132,  -2359,   -193,   -398,   -318,
-       842,   -635,   -168,    425,   2001,   -136,    290,    206,
-       562,    -96,     -8,   -214,    -45,    -11,      4,     52,
-       177,   -148,    229,     33,    -48,    -46,   6538,   -106,
-       -27,    -22,   6527,     20,   -405,    157,     87,    208,
-      -117,     -4,     30,     87,     28,   -356,    -76,   -108,
-       -33,   -568,   -270,    177,     49,   -457,  -3210,    119,
-       103,    256,   -180,    211,  -1209,   -369,   -256,     37,
-       -47,   4976,     84,    207,    225,    224,   -425,    396,
-       921,     58,   -150,    104,   1509,     15,    -58,   1724,
-        47,    -24,     21,    376,    353,    482,   -236,    634,
-       306,   3179,     73,    -33,    -54,   -169,   -214,    146,
-      4322,   -216,   -644,    305,    305,   -453,     53,    143,
-        -9,  -1472,   -141,   1314,     57,     40,    -55,    -80,
-        67,   9264,     57,     86,     22,   -147,      1,     -6,
-         0,     39,      7,    114,    -51,   -137,    155,    -15,
-      -122,      5,    137,    125,    213,     -6,   7158,     36,
-       -52,    -54,    149,    901,    859,    703,    366,    673,
-       -13,   1186,    588,   -202,   -451,     18,   -585,   -250,
-     -2632,   -134,     61,  -3038,   1022,     78,   -672,   -276,
-        96,    838,    533,   -254,   -525,   -106,   -378,   1627,
-        12,     31,    317,   -118,     81,    313,   -186,    197,
-       452,  -2971,     83,   1326,    419,  -2366,   -328,    -87,
-      -103,   -243,   -280,     25,   -240,    590,   -232,    105,
-     -2966,  -2391,   -326,    338,     80,   -392,   -243,    271,
-        -7,   1127,      1,   1901,  -2279,   -207,     32,    -99,
-       560,   -193,    371,    494,    506,    255,    332,  10737,
-        48,      8,    -33,    -33,     32,    -33,     45,   -104,
-      -259,    -99,    -37,   -134,     72,    -50,    138,    428,
-     -2258,     77,    744,      5,     96,   3020,   -269,     49,
-       112,   -223,    186,     48,    224,   2571,    340,   -129,
-       -39,  -1900,    -45,   1978,   -261,    223,    294,     22,
-      -108,    -58,    109,    -31,  -3252,   -138,  -2969,    -19,
-      -133,    190,    -36,    132,   -136,     63,   -175,    351,
-       -76,    232,  -2708,    -17,    -24,   -130,   -474,     74,
-     -2978,     45,   -139,    -23,    227,    -42,   -141,    278,
-        81,      8,  -2491,   -446,    315,    -64,   -167,   -643,
-      -275,    100,      0,   2484,   -482,   -128,   -144,   -206,
-};
-
-static const int16_t cb1616sl0[] = {
-       -46,  -5073,    119,    -68,      8,   -160,    201,    -15,
-        55,     44,     44,   -197,   -110,    -83,    -90,    -66,
-       -29,   -128,   2449,   -182,   2226,    298,    -69,    189,
-      -167,    199,    -78,     60,   -154,   -169,   -242,    189,
-       214,    132,    -41,    169,    222,   -130,    209,     20,
-      -154,   -327,  -3458,    186,   1356,    672,    133,    100,
-       375,   -491,    -52,    -87,    153,    537,   2513,   -349,
-        47,    -27,    118,   -301,    250,     45,    191,   -150,
-       279,   2367,    -70,    191,   -301,   -206,     -5,    -40,
-      -201,   3680,    -67,     36,   -341,   -133,   -197,   -383,
-      -101,     21,    -68,  -1240,     69,     -8,     -7,    -16,
-        28,    -47,   -145,   -169,     32,    170,    246,    149,
-      3039,  -2617,    -42,    -95,    184,    -74,     71,    -56,
-       -22,    -85,   -203,    129,     97,   -105,    -91,   -304,
-         4,     93,     89,   2724,   2809,   -178,     52,   -155,
-      -152,    149,     47,    182,    124,    -75,     24,    256,
-       -38,     53,   -135,     63,     70,     59,    -59,      7,
-         6,     46,   8192,   -157,    142,     81,    121,    136,
-       -87,   -147,    -71,     59,     57,    119,     21,  -1938,
-        46,    186,    100,   -158,    -52,     34,     95,     22,
-        20,    179,    112,    116,    234,   2551,  -3012,   -167,
-       -93,   -379,    -90,     24,    208,    257,    253,     23,
-     -1361,    209,     75,    191,    -23,   -115,   2024,    264,
-        77,   -159,     77,   -219,   -237,   -154,     13,    273,
-     -3338,    122,   -205,   3796,    -96,    103,   -136,    -60,
-       115,    -81,     19,     69,    396,    225,   -280,     86,
-       329,    284,    505,    403,    -37,    203,    310,  -2587,
-     -2374,   -241,    -17,    492,    -42,    -32,    261,    112,
-       123,    -33,  -1271,   -112,    -41,     12,     82,     67,
-       -71,     56,    -10,    -83,    -28,     15,    -12,     42,
-      2292,    297,   -235,     -3,    528,    -57,    159,   -185,
-       -54,    -84,   -152,    775,     15,     54,    451,   -294,
-        53,     -2,    141,     39,    -65,     75,    149,  -5460,
-        17,    -58,   -126,   -281,    264,    151,    362,    -98,
-        62,  -2361,  -2560,    173,     42,   -290,   -161,    -96,
-       -52,     82,    130,    -86,   -150,     48,     20,    -57,
-        52,  -2263,    -96,   2662,    -66,     21,     74,    -37,
-        22,    323,     64,    270,   -141,   -599,   -300,   -121,
-       -12,   -128,    -96,     -3,   -129,  -4339,   -293,    -55,
-        31,    -82,      8,     82,    -20,     58,     15,   -238,
-       140,   -125,    -98,   7632,    -14,     96,   -129,    -12,
-       -39,     85,      0,   -104,   -225,     24,      3,     95,
-       -87,    115,    168,     19,     22,     95,   8056,     36,
-       -12,    106,    -99,    -15,    -87,    112,   -122,     55,
-        14,    282,    -31,     80,     42,     -4,     81,    -73,
-        74,    -10,     82,     35,    173,    -20,    -40,  -8192,
-       -35,   -386,    270,    263,   -231,   -142,     42,   -445,
-       204,    177,   -330,   -859,    715,   2731,     59,   2578,
-       220,   -478,      3,    410,    -47,     61,   -214,   2765,
-      -206,    174,     56,    427,    442,    118,   2708,    -66,
-       -40,     41,    119,    -65,    -71,    -21,    124,    106,
-       -18,  -2586,    -35,    106,   -364,    286,    -16,   -178,
-      -146,    -82,    157,     92,     -4,   -437,   -131,    -85,
-       -27,    -90,     23,    -58,  -5332,    115,    -69,    -25,
-       -14,     13,     52,     14,   -286,    -13,    -60,     16,
-        19,     53,     35,      7,    -21,      7,    231,     48,
-      2495,    -82,   2836,     44,   -134,    -76,     33,   -394,
-        47,   -124,   -175,     95,    103,    161,     57,    -37,
-       174,   -499,    131,   -394,   2007,  -2596,   -481,    294,
-       152,    601,    144,   -438,    109,   -204,    317,     37,
-       362,   -153,    216,    269,    -39,   1250,    505,    505,
-      2571,   -115,   -595,   -806,   -998,   1226,    -71,     26,
-       -67,    262,     51,   -161,    183,   1622,    -32,    233,
-         3,   -217,     19,    -16,    209,     51,     40,    -40,
-       -43,    -27,  -7227,     13,   -128,    -18,     82,    154,
-       133,   -121,     33,    -66,      8,   -102,     71,      8,
-      2780,    -43,     79,   3212,   -282,   -165,    125,     78,
-      -101,    -59,     59,   -136,    308,    -61,   -295,   -241,
-       -29,     27,   -326,   2932,   -563,    308,   -269,    -34,
-      -158,    -26,    -64,   -411,    -75,    420,   -294,   -239,
-       -11,    429,     44,     36,     69,   -200,    -56,    279,
-        80,   -218,   -294,   -294,    252,     64,   7793,      7,
-      -155,    -56,  -3118,  -2749,   -178,     62,    441,    105,
-       -45,     23,     23,   -101,   -109,    -26,   -149,    566,
-       -29,   -394,   -850,   1699,   1986,    243,   -665,    565,
-       155,  -1746,     96,   -344,   -651,    387,   -363,    283,
-       241,    101,     71,    -18,     -9,     43,    114,    -22,
-         9,   -109,   -119,    -92,    117,   8192,    -67,     87,
-       174,    -42,   -195,    527,   -155,   -195,   -167,  -1619,
-      2638,   -824,    121,     44,    138,   -808,    407,    584,
-      -217,    -90,   -278,    549,   -118,  -1278,    837,    220,
-       142,   -956,   -294,     89,   2627,    269,   -129,    253,
-        10,     15,    167,    163,     87,   -262,     89,     48,
-        14,     24,   2967,   -175,   2550,     51,     11,   -152,
-      -111,    230,   -267,    -79,    321,   -641,    507,    -32,
-       -20,   -238,     23,   -322,  -2506,    173,   2205,    -91,
-       -21,  -1594,    420,   -157,     97,     64,    126,    -38,
-       -84,     10,    -85,     93,    -21,    272,   -427,     30,
-       -60,     61,    -81,    -40,     27,     18,    -29,   -208,
-       -70,  -8192,     16,     15,     53,     34,     49,    -26,
-     -2512,   -152,     23,    -77,   3015,     87,   -164,    247,
-       119,     91,    444,    -43,   -166,    -26,    253,    -93,
-        50,    408,  -3274,    913,    104,    119,     17,    -54,
-        42,     19,   -294,   -298,   -416,    -82,     38,   -263,
-       137,    132,  -2609,    -44,   2783,    -34,     -9,    266,
-         8,     18,   -183,    520,    515,    -93,   -159,    -21,
-       186,     27,    -89,    137,     77,    -60,    -33,     34,
-     -5115,    -44,   -172,   -122,     -9,   -104,     69,     16,
-        94,   2813,   -200,   -142,    -50,    375,   3276,   -272,
-       -44,     47,    -41,   -188,    263,   -237,    -24,    312,
-       120,   -326,    823,    193,    410,    -95,    356,    565,
-       296,   1202,  -2737,   -968,     87,   -204,  -1329,   -826,
-      -827,    584,    194,    -31,    -12,   -109,    -39,     -7,
-        73,     29,     24,    -12,    256,    -98,    -46,     63,
-       207,     -8,     73,   -342,   4578,    -37,     60,    -66,
-         8,    -39,   -176,   -125,    -34,     57,   -141,    -52,
-       -39,   -128,    -50,   -143,    -85,   -107,     19,    -38,
-        74,    -40,   -161,    -54,    -63,  -3452,    176,    116,
-      5274,     19,    -42,    198,      3,     33,     80,    -99,
-      -111,     11,    -90,     97,     -6,     -3,    -52,    301,
-      2335,    148,   -171,    -88,     44,   -404,    124,      4,
-       -80,    189,   2838,     62,   -247,    394,   -230,    -91,
-        92,  -2587,     84,   -139,    -31,   3014,     25,    201,
-      -137,    -64,    383,      2,    -70,   -115,   -210,     43,
-     -1111,   -403,   -379,     -9,    243,     77,   -220,    -60,
-       -38,    -15,      7,    109,     41,    143,     56,   -211,
-     -2492,    -48,   -218,   -115,   -321,   -358,    388,    -10,
-      -172,    -52,    177,   2996,    -96,    480,    -23,    -15,
-       177,   -225,    217,     10,    367,    129,    -45,   -114,
-        23,    257,    -48,   2497,    236,     12,    197,    245,
-        19,   -173,   -321,    310,    406,   -280,    -72,   -279,
-        73,   3307,    245,     78,   -186,   2928,    264,    263,
-      -227,     50,    172,     91,    293,     24,   -148,   -245,
-       -61,    219,    -88,    169,    220,    -99,   3222,      3,
-         0,    103,     19,    116,     69,   -180,     -7,    -49,
-        26,    -59,    -93,    -68,    123,    357,    241,  -3308,
-      -297,    198,     40,    -80,    285,    161,     90,    -46,
-      -165,    -32,     87,  -5676,    254,    -37,      7,    -20,
-};
-
-static const int16_t cb1616sl1[] = {
-        73,     78,    -64,     76,     17,   6250,     -4,   -167,
-        52,      4,     -3,     11,   -189,    -19,   -136,   -220,
-        15,      6,   -420,  -2205,     38,  -2944,     16,    118,
-      -116,     61,    119,   -390,    217,    548,     24,    161,
-       -24,  -2342,   -148,   -159,  -2783,    225,    401,   -226,
-       210,    643,   -366,    240,    264,    167,    115,    827,
-       -39,   -161,     30,   -173,     42,     29,     98,    377,
-       -58,   -163,    -41,     27,     25,   4368,     87,  -2836,
-      -175,    -71,    -62,    -84,   -476,      4,   2466,    113,
-     -2830,   -916,    593,    276,   -356,   -427,   -686,   -215,
-      2752,    395,     -9,   -345,    117,   -122,   -327,     92,
-       107,   -106,     32,    270,    271,    171,   3138,    198,
-       -46,    -70,     46,    502,     91,     77,    -19,    216,
-        94,    122,    -64,   -392,    -31,  -2696,   -364,   -131,
-      -315,    129,   -461,    229,    192,    236,    185,   -263,
-      -173,     44,     24,   -267,    -40,   -177,   -149,  -2471,
-        26,    113,   -183,  -1693,   -188,     48,     22,    -73,
-        50,   -133,     58,    -70,   -173,   -308,   -442,   -188,
-        92,    389,    -35,    167,    235,     66,   2593,   2435,
-       244,    630,    -22,    235,    112,    -32,    533,   -158,
-        81,     71,     44,    -59,   -158,    -23,     28,   8192,
-       -58,   -181,     39,    220,    -54,   -124,    -59,   -277,
-        71,     41,    -82,   -157,  -6860,     -4,     44,    -84,
-       -48,    134,   -193,    159,    -45,    218,    -47,   -133,
-       147,   1749,    765,    -84,    184,   -317,   -286,    -17,
-      -340,   -262,   -244,    -21,   3122,    290,   -127,   -119,
-       179,   -128,   -125,   -439,   2766,   1917,     85,     57,
-       -32,    373,    -16,    170,    -74,     31,    425,    626,
-         1,   -511,     64,    387,    142,   -621,    183,   -224,
-       220,   1195,    386,  -3360,    332,    484,  -1112,    -96,
-       187,     43,   1838,     39,    -36,     13,   -132,     -8,
-        -1,    -43,     29,   -132,    -19,     10,     10,   -218,
-     -3659,    119,   -103,    -27,    -29,   -108,     13,    181,
-        39,   -117,     92,     37,    -17,   -198,    330,    538,
-        17,    113,   4758,      1,     28,    -10,     87,     22,
-        96,    -14,    -99,    -56,   -130,      0,    -55,     45,
-       -63,  -2845,   2751,    464,    -31,    -62,     76,   -154,
-        88,     81,    125,    373,   -348,    587,   -314,   -278,
-       -53,   2039,   -516,   2437,    191,   -212,     87,     -2,
-       181,   -242,    117,     23,    -63,    334,    145,    454,
-       343,   -235,     91,     69,     -8,      2,   -106,   -108,
-        -5,    137,   -168,  -7818,   -231,     25,     37,     75,
-      -138,     56,    142,   -596,    130,   -114,   3293,   -366,
-       290,    160,     -2,   -219,     83,    843,    -18,   1289,
-      -177,    226,    667,    252,   -683,    816,     26,    157,
-       168,   -487,    -49,  -3282,    432,    184,   1207,     23,
-       164,    544,    965,     -1,     61,   -118,     92,   1359,
-        89,  -3234,     15,    496,    244,    177,   -613,   -160,
-       -23,   -195,   -111,   -372,   -115,    278,     96,     77,
-     -2567,     49,   -423,   -468,     13,   -484,   1345,   -298,
-       194,   -123,   -248,   -139,    738,    102,   1154,   -335,
-      2694,   1326,    213,    758,     17,    154,    609,   -518,
-      -367,    201,   -144,     61,     66,   2288,     50,   2688,
-       -87,     45,    -13,   -101,    127,   -190,    -40,   -286,
-         6,    121,     32,     31,    119,    -85,     28,     93,
-      8192,    273,    169,     44,     37,    255,   -224,    219,
-       -34,   -127,   -134,    165,    169,    126,   -188,    -52,
-        98,     15,  -5820,   -193,   -331,   -395,     -1,     49,
-      -187,     55,   -121,   -196,    114,     10,    258,   -145,
-       -14,   -385,    105,   -187,     59,    383,   5322,    147,
-      -110,    -69,    378,    138,   -352,    -69,     15,   -267,
-        75,    162,     -6,   3148,    515,    231,    -74,   -436,
-      1288,   1234,   -105,     68,    -96,   -166,    -49,    -64,
-       144,    -67,    135,    258,    -71,   -162,    156,   -366,
-        -7,    -67,   -133,    -20,   -119,     71,    -84,     31,
-        26,    116,  -2237,    212,     43,    380,    -74,     13,
-        -7,    774,  -1276,   -103,   -124,    -48,   -178,   -319,
-        26,    435,   -111,    858,    295,   1601,  -2727,   -242,
-         8,     36,    -61,    -20,    -19,    -19,     31,    258,
-        21,    -14,    381,   -153,  -8192,    -99,    327,     72,
-       175,  -1181,   -271,    104,    -30,   -135,   -169,     21,
-        29,   -182,    -25,    125,    165,    -82,     73,    -26,
-      2311,    -85,  -2983,   -125,     85,   -206,   -100,   -100,
-        36,     -3,    -77,   -180,     35,      0,   -170,    123,
-       168,   -302,    366,   -334,   2936,    -70,    404,  -2870,
-        13,     79,    226,   -163,   -242,   -124,    -40,   -171,
-      -109,    189,     20,    -52,    144,  -1869,    -88,    230,
-        -8,    -27,     45,    131,    -11,   -188,     93,   -227,
-      -452,   -229,    158,    377,     -9,  -1736,     16,   3268,
-      -164,     41,    305,   -414,   -642,   -111,   -100,    118,
-      -155,   -236,    936,   -114,     51,     31,     60,   1299,
-         5,   3048,    274,    273,   -197,   -289,   -245,   -288,
-      1927,     -7,     27,    307,    174,   -243,    -95,   -134,
-        14,     24,   -119,   -132,  -2811,   -254,     35,     95,
-        22,    135,     21,   -155,    -80,   -143,    -60,     -6,
-       182,     77,     11,   -197,     -8,  -6080,     28,    155,
-        11,    -27,     22,    -48,     -8,    -50,   -122,     11,
-       -34,    342,     -1,     40,   -208,    117,    -35,    -69,
-       150,  -3944,   -425,     46,    456,    182,   -451,   -219,
-        38,     15,   -203,    766,   -232,    243,    -70,    179,
-      2107,   -222,    346,   -166,    143,    239,    245,     59,
-      -137,     17,    475,    -68,   2679,   -423,     20,   -313,
-        74,    152,    171,   -269,     68,     39,  -4743,     94,
-        -3,    110,    134,   -168,     73,    180,   -116,    276,
-       -74,   -203,      2,    -83,     17,    170,     96,    169,
-        75,  -5541,     46,     20,   -168,    -22,     35,    -74,
-       104,   -153,    264,      4,    -57,     94,   -192,    161,
-        15,      7,     45,   -186,     15,   -125,    121,  -4981,
-      -254,    179,    282,     72,    543,    -97,    363,     -5,
-       -67,   -389,    -66,    178,    427,   -276,  -2675,    447,
-        -2,   -125,   -223,   2869,   -502,    117,   2017,    -71,
-        41,      9,    124,     19,    357,   -562,     25,   -385,
-        80,    -53,   -175,   2532,    -73,  -2990,   -164,     57,
-      -128,   -254,     53,   -150,   -180,     16,    -45,    322,
-       266,  -2418,   -264,    317,    371,      5,    197,      7,
-     -2476,    -93,    152,     90,   -165,     11,   -259,    -24,
-       -55,    -16,     98,  -4904,   -116,     53,    205,    -45,
-       -57,    116,     75,    161,    -55,     97,   -292,     27,
-     -1396,    105,   -127,    133,   -265,    -33,      5,  -3622,
-        25,     -3,   -104,      8,   -283,   -229,    236,   -208,
-       145,    627,   -240,    118,    296,    108,   -309,     48,
-     -3345,    582,    498,    259,     20,    785,   -138,    421,
-        97,    370,    161,    141,  -2793,    106,   -246,   -140,
-      -172,     42,   -194,   -202,   -319,   -107,    -24,    423,
-      7293,   -109,    -13,   -242,     55,    171,     13,    -93,
-       131,   -141,     88,    132,     76,    176,     78,    153,
-       -63,    -55,   -410,    -39,      6,     27,   -223,   -174,
-        61,    645,    167,    -35,   3079,   -173,    950,      1,
-      -109,   -118,   -106,     15,  -1345,    -14,     50,    -70,
-       -69,     24,    109,    182,     84,     31,   -179,    -93,
-     -3152,  -3013,    -60,     56,    -60,     58,    166,   -161,
-        24,    129,      1,    181,    128,    -12,    273,    -43,
-     -1256,    134,    159,    -36,    175,     43,    -49,     41,
-        48,    -38,    -45,     59,    -36,    -82,     48,    -74,
-      -104,   2944,   -124,    -24,     98,    248,   -146,   -231,
-      -241,     72,   -114,    776,   -498,    242,   -357,    250,
-      -102,   7121,    109,     11,     94,    -53,     37,    -37,
-      -133,     24,   -157,     47,    -46,    -69,     62,    -79,
-};
-
-static const int16_t cb1616ss0[] = {
-      1401,    373,   -516,    330,   -711,   -752,   -475,   -224,
-       139,    492,   -556,   4629,   1039,    333,    872,   -542,
-       474,   -360,   -378,  -3459,    254,   1199,    113,   -525,
-     -1705,    231,     46,    188,    -50,  -1038,     32,   -198,
-      -109,    619,   1071,  -1601,   1002,   -411,   -189,  -3276,
-       615,   -468,   -467,   -275,  -1286,    736,    541,  -1107,
-       423,    191,    439,   -205,     17,    -87,    500,    176,
-       262,   -341,   -142,    268,   8164,     -2,    112,   -190,
-       227,    -50,   -143,   -326,    647,    601,    482,    443,
-      2761,   -497,    979,   -298,    454,  -2927,    746,   -735,
-      3921,    480,   -167,   -317,   1303,    111,    216,   -961,
-       110,   -595,    244,    246,   -222,   -205,     46,     61,
-      -798,    258,    360,  -7038,   -654,    -95,     75,    498,
-       -24,   -250,     71,    138,    527,    240,   -215,    250,
-      -408,    552,   -325,    333,   -989,   2648,   -483,  -1121,
-      2344,  -1647,   -116,   -901,    615,    327,      1,    497,
-       411,   -138,    332,    281,   -145,    337,    163,  -7379,
-        70,    265,    365,    238,    604,     99,   -149,    233,
-       109,    827,   -704,   1367,   1208,   -717,    -17,   -223,
-        15,  -3259,     53,   -485,   -631,    285,    511,     -8,
-       242,    547,    129,    145,   2046,    520,     44,   -177,
-       382,    283,   -169,   -346,  -2737,    294,  -1311,    145,
-      1873,    815,   1078,    677,  -3419,   -434,    484,    144,
-       -27,    669,    153,   -242,   -242,    814,    350,    361,
-      -462,    -63,   2317,   1259,   -373,   -489,   -534,    300,
-       867,   2621,   -117,   -168,   -414,   -239,    812,    840,
-       112,   -463,  -6286,   -693,   -830,    140,   -168,    448,
-       549,   -149,    418,   -105,    137,     31,    -40,    -43,
-       422,    -99,    297,      3,   -220,    -15,     81,     45,
-      -647,   -535,   -448,   -731,    250,  -6742,   -320,   -350,
-      -192,   1540,  -1112,  -1043,   1317,  -1203,   1035,   -506,
-       673,    721,    854,  -1487,    780,   -294,   1173,   2142,
-     -8192,   -170,   -138,    -54,    -54,   -233,   -127,    145,
-      -233,   -185,     87,     20,    530,   -305,    141,   -394,
-       310,     40,    645,    809,   4801,   -186,   -432,   -451,
-       312,   -144,    -65,     65,    135,    -64,    -15,   -357,
-     -3546,  -1299,    216,    249,    261,   -207,    117,  -3138,
-       527,     14,   -142,    286,    100,    340,    581,    157,
-       234,    739,  -2521,     -3,    639,  -1440,    131,  -3796,
-       159,     39,     41,   -659,    284,    165,   1100,   -346,
-      -481,    295,    806,   -227,   -288,   4520,    253,    487,
-      -252,     88,    -43,  -1612,     -5,    -57,    -66,     18,
-        19,    557,   -337,   1526,  -2897,    144,    844,   -404,
-      1976,    787,    246,    264,   -406,    778,   -918,     51,
-      -113,   -235,    518,    602,   -307,  -2046,   -692,   2775,
-       400,  -2165,   -184,    139,    403,  -1855,  -1317,    289,
-       710,   1124,   1888,   -517,    276,    190,    637,   -441,
-       717,    972,   -370,    478,    626,   -354,    241,  -3651,
-       145,      7,   -738,    397,    991,   -343,   -826,    142,
-       672,   2425,   -616,  -3278,    751,   -193,   -944,    -35,
-     -1061,   1258,    631,   -721,    145,   -112,    -69,    828,
-       -39,   -196,   -237,    -73,    771,   -195,    239,   -533,
-     -1673,   3477,   -559,    104,   -647,   -798,    167,   -497,
-      -559,    591,    259,    300,    -25,    422,     93,     39,
-       -63,    233,    144,  -1170,    142,   -456,     73,    411,
-      6920,   -338,   -307,    436,    143,    420,    152,     -9,
-     -1788,  -1096,  -2998,   -727,   -524,    128,    460,    782,
-      -102,   -576,   -138,   -976,   1035,  -3196,   -436,    -27,
-     -1047,  -1389,   3244,   -143,   -883,  -1012,      4,    327,
-        16,    411,   -497,   1444,    516,   1183,    252,    510,
-      -698,   -676,    569,    -70,   -397,   -227,   7829,    312,
-      -410,     20,     41,    -65,   -219,    175,    297,     40,
-     -1534,   -498,    194,    871,    409,    280,   1098,  -1471,
-     -2825,    931,   -105,   -545,   -801,   -795,   -372,     73,
-       331,    100,    488,  -2101,    560,     44,    885,   1065,
-       380,   -195,    276,    124,    -87,    193,   3979,     30,
-        95,   -509,   -931,   2737,   -457,    805,     10,     53,
-       -73,   -203,   -587,   -177,    242,    238,    656,  -3403,
-      -380,   2364,   2902,   -226,    204,   1559,  -2219,    -40,
-      -442,    111,   -703,   -424,   -252,   -241,    461,    749,
-       658,   -481,    125,   -366,    601,   -246,   -286,    132,
-       297,   -232,   5231,   -141,    196,   -121,   -235,    406,
-      -199,   -174,     87,   -107,    363,    272,   -563,   -620,
-       235,    223,   -627,   -339,   -467,    349,  -1596,  -5496,
-       644,    -96,    -81,   1938,    749,   -160,  -1976,  -1436,
-     -1056,  -1045,  -1098,   2327,    976,    -57,   -124,   1139,
-       275,   -209,   -636,    298,   2484,   2764,    962,    -39,
-       108,   -718,   -442,      9,    797,   1123,   1092,   1179,
-     -1170,   -701,   -381,   -237,  -1266,  -1045,   -337,   -351,
-      -274,   -981,   -272,   -111,  -3409,   -387,    421,   -406,
-     -2123,    623,    -18,   2473,    617,    176,     26,   1402,
-     -1351,    212,     23,   -172,    296,   1572,    -63,   -402,
-       837,   -521,   2209,   -613,   -329,   -309,   -180,  -1152,
-      -535,  -1380,  -2617,    475,    385,   -672,    182,     92,
-     -2211,    320,    109,   -633,   -582,   1208,  -1536,   1009,
-       896,   1991,   -374,   1750,  -1259,   -341,   1774,   1063,
-       678,  -2084,    987,   -337,     48,   -205,    -82,   -288,
-       388,    217,   1263,   2427,  -1472,  -1073,   -964,   -836,
-      2086,   -161,    438,   -449,    -37,   -926,  -3706,    164,
-      -372,   -616,    160,   -572,   -725,    727,     11,     53,
-       -84,   7494,    -74,    523,   -172,    464,    452,   -426,
-       803,    106,   -262,     32,    298,   -491,   -181,   -760,
-      -908,    303,    747,   1316,    272,    906,    767,    105,
-       247,   6120,    948,   -557,   -928,   -595,   -342,   -450,
-       686,   -815,  -1243,   -157,    572,   1414,    166,   -229,
-      3317,   1940,   -283,    623,   -781,    717,   -212,   -707,
-        30,   3635,   1147,   -696,   -928,   -637,    925,    797,
-       843,  -1359,    214,   1096,   1031,    852,    -84,   -228,
-       -34,   1067,  -1109,    392,    292,   -755,   3495,    -40,
-     -1806,   -637,   -236,   -602,   -264,   -147,    -68,   -233,
-       -55,  -2005,   -271,   -647,    963,    309,     -5,     56,
-      -275,   -398,     34,   -496,   2556,   1249,    -87,   -112,
-      1663,   -554,  -1926,    627,   2515,  -1128,   -566,   1539,
-       740,     38,   -614,    272,   -232,   -152,   -782,   -420,
-      -304,  -2313,    -33,   -944,    -77,  -3468,    -69,  -1730,
-       -21,    665,   -314,  -1640,    660,    661,    106,    -21,
-     -1505,  -2888,   -427,   -866,   -666,   3128,    786,    -55,
-       739,    112,      8,    567,   -602,   -350,    165,    108,
-       767,     64,   -715,    980,    673,   -186,    768,   -545,
-      -298,   -233,   -524,    -70,    511,  -2051,   3816,  -1104,
-       529,   1012,   2577,    777,    342,   -387,   2730,    247,
-       -20,   -227,   -432,   -263,   -885,  -1192,   -644,   -259,
-      2314,     38,    108,    614,   -386,    470,    -78,    681,
-     -3334,  -1049,   -300,    177,   -174,   -422,    110,   -641,
-      -406,   -472,    468,    885,   -730,   -877,  -1972,  -1372,
-      -410,    545,    543,   -800,  -1156,    279,   3290,  -1305,
-      -213,   -262,   -832,   -994,  -1110,    718,   -364,   1416,
-        -7,    963,    452,    680,    165,  -3815,    903,    806,
-       149,     11,  -1332,   -622,   -451,    152,   -618,   -309,
-       246,    435,  -2098,    487,    469,   -451,  -1574,   -204,
-      -187,    552,   -333,    515,   -331,   1452,    278,  -2691,
-      -146,   1009,    353,   -839,      6,  -3206,  -1080,   -572,
-     -2698,    752,  -1726,   -318,    397,   -152,   -128,    -77,
-       -36,   -506,    456,   1094,    281,   -158,    -19,   -149,
-        48,  -2831,   2042,   2545,   -161,    619,   1129,    274,
-        24,      1,    313,   -164,    655,    157,    770,    182,
-      1942,    241,   -898,  -1748,   -589,    256,    322,    683,
-       -65,    -73,    621,     74,   -317,   2585,    185,   -465,
-};
-
-static const int16_t cb1616ss1[] = {
-     -3218,   -607,   1665,   1100,   -563,    421,    377,    445,
-      -270,     -3,  -1503,    224,   -593,   -316,     31,    362,
-      1186,    389,  -1817,    589,  -2842,    289,  -1925,   -356,
-      -228,   -148,    618,    135,    358,    238,      1,   -767,
-      -266,      1,    101,    245,    231,   -167,    408,      1,
-       162,    -35,    241,    215,  -4702,    486,    546,   -339,
-       349,   -292,   1342,   -881,    184,   -675,   2639,   -284,
-      -995,    346,   -499,   1499,   1616,    578,    445,    -78,
-       844,   1800,   -686,   -414,  -1425,    795,    754,  -1418,
-      -178,  -2226,    515,   -143,     43,    569,    967,  -2333,
-     -1991,    282,    528,   1410,   -377,    736,    394,   -230,
-      -365,   -242,   2773,    136,   -738,    -36,  -1171,    -76,
-      -132,   -300,   -223,   -680,   -416,  -2738,     93,    414,
-       490,   -346,     75,  -1089,  -1132,   2237,   1844,    395,
-       325,  -1514,   1913,  -1850,   1162,   -442,    689,    -66,
-       -71,    -83,    342,   -197,   -940,    206,  -3381,  -1275,
-      -423,    -87,   -455,    498,    865,    355,   1225,   -115,
-     -3333,   -404,   -588,   1021,  -2180,  -1470,   1225,    728,
-        59,   2592,   -335,    194,   -649,   3586,   -951,   -142,
-      -947,    898,    -99,   -269,    977,   1520,    488,   -364,
-      -253,    127,   2524,    849,  -1166,   -191,    627,    372,
-       772,    145,    -21,    279,    402,   -863,  -2695,   1217,
-      1543,   1005,  -1419,   1712,    110,  -2191,    969,   1563,
-       183,    811,   -218,  -1078,   -220,  -1092,   -322,    803,
-      -533,   -359,    405,    -70,   -771,   -267,  -4730,    235,
-      -607,   -387,   -285,    -68,     48,    -60,   -222,    229,
-     -1087,  -1261,  -2249,   1265,  -1624,    864,    -65,    223,
-      -322,    337,   -262,  -3170,    -12,   4571,     19,    198,
-       458,  -1029,   2560,     -3,   -115,    619,   -645,   -836,
-      -399,    246,    -81,    -12,  -1057,  -2119,   2780,     25,
-     -1559,    291,    592,   -513,     62,    157,    553,    570,
-      -657,     72,   -118,   -284,   -454,   3853,    145,    259,
-     -1709,  -2161,  -3167,    189,   -233,  -1099,    141,    114,
-      -506,  -1012,   -775,    474,    331,    798,    469,   1915,
-        96,   -266,   -385,   -329,   -658,    192,     16,     97,
-       -47,    284,   -163,    200,    189,     18,  -7453,    160,
-     -2988,   2725,    520,   -132,   2593,    627,   -694,    -26,
-      -558,     44,   -209,     40,    377,    491,    -68,    384,
-       271,   2117,    642,   3166,   -569,    702,    513,  -1858,
-       108,    944,    248,    166,    681,    408,   -908,    525,
-      -145,   1035,    189,   2812,    135,   -356,  -2551,    401,
-       150,   -508,   -265,    244,    461,    958,   -233,   -204,
-       744,  -1603,    397,   -229,   -174,    539,   -139,  -4473,
-       837,   -310,    253,   -635,    397,    -80,    601,   -371,
-     -2015,   -261,   -364,     50,    331,     89,   -938,    709,
-      1444,  -2910,   -228,   -162,    419,     62,   -319,   -266,
-       584,   3728,     57,    220,   -543,    768,   -630,    361,
-       361,    642,   -313,    182,   -488,    -48,   3001,   -397,
-       640,    179,      8,   1081,  -1161,    -58,    -70,    -64,
-      4456,    323,    883,   -191,    -16,     61,    419,    429,
-       627,   -898,   -883,    750,    499,  -1335,   -467,  -1410,
-        -5,    283,   -301,    276,  -1636,    310,    114,   -428,
-     -8192,     12,   -114,     74,    215,    511,    317,   -314,
-       -86,    198,    138,    315,   -271,    246,   -363,    426,
-       608,   -714,    367,  -1356,  -2217,   1178,   -385,   1442,
-        28,   -642,   -371,    -87,  -2895,   -710,    303,   -150,
-      -398,   -868,  -1727,   1548,    982,   1177,    332,   -377,
-      1580,    962,  -1028,   1922,   1494,   -824,     93,  -1362,
-      -552,   1641,  -1729,    228,   1054,    421,   -185,   -536,
-        51,     87,   -204,     88,   -847,   -754,  -3761,  -2706,
-      -138,  -1242,     35,     64,    418,   -460,    713,   3960,
-       733,    468,   -150,   -823,   -211,   -674,    366,   -269,
-       180,   -294,   -384,    604,   1829,   -121,    271,    241,
-       192,   -211,  -2672,  -1483,  -1102,    960,     90,     49,
-     -1144,   2552,   -887,    -32,   -301,     62,   -183,    193,
-        78,   -781,    193,   -606,   -285,  -3082,    240,    392,
-       704,     20,  -1103,   -195,    166,    577,   -105,    -45,
-      -310,   -106,   3035,     28,   -369,    725,     53,     87,
-      -232,   -191,      7,   -282,   -572,  -8192,    325,     99,
-       162,   -113,   -237,   -209,    412,   -573,    295,   -389,
-     -1603,    -66,   -485,   -867,    466,   -882,    862,   -216,
-       221,     50,    -51,   3927,    557,    441,    223,    234,
-      4048,   -173,    420,   1670,    436,    341,    175,   -441,
-      -201,     75,   -549,    315,    172,    418,   -159,      7,
-      2973,     -3,   -220,  -1360,     26,   2781,    132,    295,
-       -15,    217,   -166,    187,   -282,    357,   -121,    480,
-      -216,    294,    263,     95,  -7367,    589,    -63,   -412,
-      -103,   -201,    335,    -96,   -203,    240,    223,   -435,
-       366,   -467,    118,    528,   -472,   -559,   -417,   -189,
-      -641,    339,   1546,  -2741,   1413,   -265,    637,  -1556,
-       -49,    422,   -195,    392,    -21,      3,     -2,    282,
-      -130,   -272,   -483,   -860,   -675,    762,  -1455,   5212,
-       178,    197,   -468,    270,   -310,   1038,    406,   2699,
-      -537,    -33,    272,    225,  -1986,   1295,   -857,  -2906,
-      -904,  -1861,   -206,    866,   -145,   -207,    252,   -825,
-      3051,  -1361,   -441,     85,   -186,   -127,    139,    285,
-      3067,   -332,   1163,    248,   -483,   -177,    268,    691,
-       733,   -104,    -54,   2541,  -1042,   -226,    165,    250,
-         7,   -259,   -383,    327,   2164,   2272,   -750,   2482,
-      -930,   -139,   1203,    766,    150,    320,    970,     28,
-     -1351,    467,    544,    521,  -2908,    -75,   -902,    611,
-       575,   1216,   -209,     -7,    541,    330,    528,    347,
-      -185,   -306,   -432,  -3384,  -1844,   -380,    155,  -1230,
-       629,  -1085,   -413,    119,    114,   1093,    198,    806,
-       491,   -137,   -518,    536,    -64,    387,  -1712,    608,
-       -24,   4961,    149,    299,   -342,    505,    503,   -387,
-      -944,   -297,  -2423,    -98,  -1027,   -432,   -259,    736,
-       127,   3561,   -473,   -623,   -751,    114,   -438,    657,
-      2448,    863,   -413,    -81,   2066,    988,   -539,   -528,
-      -111,    314,    390,  -1228,   -863,     19,    763,   2227,
-      -844,    -24,   4164,    139,    130,   -111,   -630,   -428,
-       538,   -606,    940,   -877,    122,    526,    194,   -104,
-       127,    117,    907,   -789,   2865,    526,   -548,   -253,
-       289,   2329,    176,    -70,    775,    681,     21,     38,
-     -1481,    766,   2093,  -2974,   -289,   -571,   -445,   1833,
-       333,    -84,   -243,   -413,    188,   -492,    -22,   -867,
-       605,   -333,    904,   3192,    -29,    491,   -411,    370,
-      -556,  -2671,   -294,    132,   -243,   -233,    180,    181,
-       383,    -79,     26,  -3539,    642,   1127,  -2125,   -170,
-      -386,   -135,   -703,   -290,   -157,   -444,   -885,   -341,
-      -920,    460,   -407,   -176,   3153,  -3084,   -505,    543,
-         7,     79,   1191,   1148,   -401,    -17,    289,   -735,
-       300,   1971,    626,   -146,    110,  -1281,   -613,   -649,
-      -206,   1850,    701,   1138,   -803,    742,  -1392,    147,
-       554,   1861,   -658,  -1481,    108,    856,   1021,    574,
-      3314,    518,  -1156,   -307,     42,    -92,   -132,    278,
-      -352,    -37,     35,    146,    -93,   -662,    216,    125,
-       823,   -876,   -170,  -5027,    444,   -182,    844,    189,
-      -490,  -1441,   -335,   -907,   -173,   1138,   -472,  -1505,
-     -1641,    648,     66,    627,     64,  -1096,   -620,   1588,
-      -506,    309,   -100,   5702,   -555,   -157,   -179,    -85,
-      -299,   -114,    -20,    178,    415,    118,   -581,   -132,
-      1025,  -2631,  -1154,   2623,   -286,    201,    340,    949,
-       235,    171,    649,    328,    397,   -142,   1369,     -7,
-      2305,   -373,    658,  -1681,   -744,  -3574,     34,   -183,
-      -504,    165,     81,     21,    635,   -307,    428,   -520,
-       164,  -4701,    744,    249,   -844,     -7,   -334,     38,
-       539,    267,   -213,     73,    134,   -251,   -248,   -923,
-};
-
-static const int16_t cb1616sm0[] = {
-     -4119,  -2861,    -76,    -49,   -192,   -542,      0,     94,
-      -550,      6,    601,    236,   -446,   -202,    167,    238,
-      2609,   -688,   -406,    265,  -3078,    321,     59,   -601,
-       157,    200,   -265,     78,   -699,   -679,     18,    -54,
-       203,   -687,   2683,   -111,  -3037,   -627,   -493,    413,
-      -480,     54,     75,    276,    206,  -1861,     17,   -420,
-      -169,    312,    361,   -277,    -12,   -363,   -592,    758,
-      -123,   3267,     78,   -862,     81,   -356,    596,   -536,
-       729,   2239,    -49,    553,    112,    444,    652,  -2990,
-       -70,   1084,   -436,     34,     53,    -10,    -23,     41,
-        -3,   -126,    207,   -130,   -208,     63,    480,    191,
-      6229,    -45,    -33,    -82,     35,     56,    259,      1,
-      8034,    -97,     52,   -159,   -334,    -41,     50,    -57,
-        56,   -194,   -567,   2050,    146,    987,   -383,    416,
-      -258,   2846,     51,      8,    690,   -126,   -704,    316,
-        16,     -4,    -90,    159,     34,    126,     65,    218,
-     -7037,   -261,    -87,    -21,   -185,     14,    112,     42,
-      -164,    274,   -269,   1138,   -208,    574,    589,   -143,
-      -479,   2745,    782,    -13,  -2492,   -132,    498,   -406,
-       260,    828,   -580,    558,  -2861,   -600,   -447,   -313,
-      1316,    800,   1772,   1131,    323,    -48,  -3972,    697,
-         5,   -403,     46,     95,    130,     84,    -39,    219,
-       117,   1629,   -189,  -1371,     25,   -116,   2311,   -681,
-      -411,   -685,  -1340,   -409,    223,   -462,   2530,   -816,
-     -1118,    314,   -893,   -109,   -262,    376,  -2795,    -48,
-     -2878,     -6,    180,     53,   -500,   -181,    125,   -291,
-      -265,   -154,    -23,   -184,    185,   -563,  -1159,    675,
-        24,   -213,    273,  -2905,   -242,   2373,     -6,   -166,
-        92,    276,   1375,    -28,   1879,   2572,    205,   -121,
-        51,    356,   -873,   -308,  -1060,    952,    719,    456,
-       106,    116,   -107,   -211,    -21,   3319,   2109,   -172,
-      -172,    143,   -718,   -138,   1135,    232,  -1361,    157,
-       -99,    522,  -4367,     84,    605,    319,   -937,   -397,
-       117,   -434,     82,    633,    274,  -1555,   -221,    -59,
-     -2419,  -2486,   -112,    136,   -182,   -480,     27,   -548,
-      -237,    817,    530,    656,    252,  -2685,    -26,    703,
-     -3268,    381,   -383,   -323,    105,   -500,     66,   -299,
-     -1056,   -363,    -69,     21,    292,    398,   -379,   -106,
-      -356,     38,    169,   2866,    206,   -523,   -277,  -2875,
-      -582,    -69,    649,     -3,    198,    -30,     98,    145,
-      -125,   -186,    -19,   -107,   -102,   -173,  -7299,    -62,
-      -503,   -231,     24,    145,   1367,   -355,   -175,    373,
-      -953,   -704,  -3454,    170,    899,    386,    592,   -754,
-       620,     81,     86,    -65,     84,    683,   3054,   -280,
-     -2825,   -757,     53,    -10,    441,   -145,    138,   1364,
-        -2,    -92,   -300,    225,   -199,  -2087,   1095,   -363,
-       -75,    288,    765,   -869,     -7,   3261,      9,  -2860,
-      -330,   -382,   3309,     28,    629,    244,   -143,   -298,
-      -512,   -409,   -241,    104,     -6,   -271,     -2,   8192,
-      -137,    139,   -304,    -14,     81,    262,    -36,     51,
-       380,     11,    101,    100,   -153,   2167,   -271,    267,
-       306,  -3008,    579,   -277,    316,    327,   1168,     71,
-     -1401,    389,    -25,   -265,    101,    -53,   -170,   -226,
-      2861,    145,   3040,   -159,     77,    -16,    233,   -570,
-       490,    661,    452,   1986,   -522,    212,   -107,    196,
-      -247,    308,   -353,    186,  -2689,    486,    -46,    813,
-       -24,    233,   -166,   3305,   2832,   -343,    -82,    475,
-       267,   -385,     26,    -35,   -226,     27,    416,    231,
-        12,     88,   -209,   -139,    404,   -239,   -109,   -182,
-      -851,    260,    242,    109,     11,  -1096,     85,  -4226,
-      -124,     12,   -139,   -100,   -604,    -87,     89,   5820,
-        59,    -43,    -84,    264,   -543,      0,    428,    -16,
-      -146,   -556,   -195,   -159,    875,     27,    261,    207,
-      -182,   2367,   -622,  -3193,    481,   -289,     52,     12,
-        34,   3014,     10,   -345,    -94,  -2883,    -62,    400,
-       249,     51,   -178,   1190,   -128,  -3940,     41,   -296,
-       -48,     13,    -26,    223,  -2392,    516,   -384,     33,
-       -46,   -161,    -43,   -224,    -89,     -4,   -349,    135,
-       540,   -120,   -276,   -198,    129,  -5113,    175,    -45,
-       -34,   -109,    419,    -45,   -104,   -185,   -393,    416,
-     -3514,    149,  -3088,   -115,    -78,    431,   -172,     21,
-      -290,   -162,    216,     41,    -56,   -487,    705,   -194,
-     -1003,    100,    172,   2793,    -83,   2584,   -189,   1198,
-       551,   -119,    -73,    -91,   2103,   -619,    124,    128,
-      2628,    192,    160,   -110,    270,   1739,   1062,   -568,
-       -73,    -56,    328,    100,    384,   -173,     83,     39,
-      -236,    -25,   -457,     53,  -6413,    345,   -459,   -110,
-        28,   -127,   -109,   -593,     32,    141,   -879,    254,
-      2132,   -410,   -623,   1103,  -2302,    528,    156,     28,
-        81,    613,    602,    171,    500,  -2356,    620,     17,
-      -523,  -2961,   -921,   -107,   -405,   -230,   -129,     18,
-       363,   -881,   1282,   1427,   -363,    658,    205,    -51,
-      2835,  -2003,    188,    -26,     73,   -231,    352,     74,
-      -490,   -222,   2423,   -341,  -2762,    -14,    -56,   -260,
-       -41,     33,    169,   -190,   1248,    -77,  -2322,   -607,
-      3610,   -104,   -200,    -90,    -81,    719,    -52,   -359,
-       394,   -301,     66,    -39,    -56,  -8192,     87,     56,
-      -291,     50,    231,    284,   -211,    -16,    -86,    -84,
-       -28,     52,      3,    -51,    304,   -224,    228,   -374,
-       458,  -1958,   -210,  -2613,    401,  -2128,   -119,    -12,
-       -60,    -14,  -8192,     53,     27,    113,    289,     -7,
-        22,     60,   -192,    333,     72,   -344,    238,    147,
-     -2235,    324,    124,    176,   -415,    450,   -476,   -558,
-      -429,   -246,   -551,   -287,    672,   2145,   8192,    161,
-      -165,    -34,    193,   -108,   -137,    -96,    -68,    156,
-       308,   -182,      5,    438,    -71,    -27,   -164,    187,
-      -110,   5786,    -82,   -130,   -126,    197,   -262,   -182,
-      -118,   -110,    121,    -93,    235,    -56,    -99,   -212,
-     -3013,   -193,    -10,  -2944,     58,   -135,   -624,   -170,
-        84,    339,    115,    -85,  -1886,    250,    123,   -104,
-      -374,  -2241,   2454,   -438,   -168,    632,   -136,   -725,
-      -329,   -394,    -60,     19,   2795,    438,   -796,    141,
-      -143,    132,    251,     37,    286,   1858,     39,   2381,
-        -9,    -85,   -110,    149,   -415,    355,   -172,     -9,
-      -149,    554,   -324,  -4931,   -537,   -261,   -585,   -291,
-       764,    -92,   -139,     -8,    -80,     65,     -6,    -26,
-       -81,     37,    -14,     45,    115,    171,   -321,    313,
-       308,  -4637,   -128,   -120,   -174,    148,    768,    490,
-        81,   -175,   -261,   -136,   1501,    345,     25,    -56,
-      -212,   -324,   -836,    207,   -652,   -752,   2406,   -332,
-       489,   -275,   -932,    284,   3103,   -315,    614,  -2711,
-      1706,  -1072,   -163,    -75,  -1104,    163,   -421,   1532,
-       -92,   -163,   -811,   -118,    -38,   -754,    466,   -314,
-       232,   -595,   3613,    -30,    570,    -62,    785,   1626,
-      1080,    553,   -407,     32,   -105,     82,   -156,    -75,
-      8063,    -67,    114,    -65,    -65,   -242,     98,   -124,
-        38,    441,  -2645,    -92,     69,     17,  -3284,   -278,
-      -278,    116,    567,   -742,    182,   -304,    432,    261,
-        86,  -4109,    389,    795,   -138,    151,    111,   -223,
-      2392,    399,   -135,   -545,    182,   -226,     61,    234,
-};
-
-static const int16_t cb1616sm1[] = {
-       -29,    -13,  -6217,   -136,   -196,     24,   -228,   -301,
-      -155,    -37,    -54,    -91,     -4,   -130,   -424,    -89,
-      -181,    657,    110,  -4526,   -391,    762,   1033,   -310,
-      -808,   -282,   -721,   -690,    258,   -259,     16,   -555,
-      2675,   -379,  -2580,    356,    198,   -455,     95,   -194,
-      -754,    383,   -263,   -873,    271,   -107,   -191,    -28,
-        11,    -66,     91,     25,   -215,      9,    152,     11,
-      -124,     66,    422,    521,   5401,    103,   -179,   -291,
-      -821,  -1265,   -396,    150,    -69,    -15,    154,   1504,
-      -445,    116,   -136,  -3528,   2819,     -5,    174,    166,
-       289,    -60,    158,   -701,     83,   -636,   -407,    194,
-      -240,   -138,    124,    -94,    132,   -105,   -106,     72,
-       139,    101,     97,  -7928,      6,    112,    164,    -83,
-      -329,     41,    124,    389,    -22,   -194,    157,   -378,
-     -2255,   -431,   3176,   -199,   -310,     49,    483,   -208,
-      -235,     11,     45,    637,   1220,   2309,     93,    514,
-     -1939,    136,    276,   -165,    137,   2496,     56,     31,
-       238,   -538,   -433,    690,   -318,    -44,    834,  -1684,
-      -132,   2619,   -157,   1959,   -566,    119,    183,    227,
-      2066,    401,    -48,   1257,    604,   1306,    149,    273,
-       586,   -199,   2166,    257,   2047,    -46,   -377,   -761,
-       -25,   -454,  -1592,    -42,    432,  -2312,    222,   -528,
-       -87,   -287,    532,   2906,  -2011,    720,    554,    423,
-      -576,    425,    280,   -894,   -232,   -179,    485,    628,
-     -2918,    405,    229,     -2,   -146,    127,   -329,   -243,
-       194,   2443,   -531,    592,    -14,   1679,    292,   -914,
-      -332,   2382,  -3040,    297,  -2856,    -88,    236,   -485,
-       438,    241,   -283,    448,    579,   -660,    277,    233,
-       201,    126,     15,   -411,   -560,   -582,   -389,   -392,
-        -7,    238,      1,    344,   -216,  -4601,   -457,   1027,
-      -114,     13,   -301,    288,    172,   -488,   -124,  -2721,
-       100,   -105,    434,    -13,   2791,   -827,   1600,   -219,
-     -4992,   -100,    411,    326,   -608,   -779,     94,    974,
-       453,  -1326,   -236,    429,   -189,    830,     32,    187,
-       459,   2489,    476,    165,   3261,   -445,    169,    179,
-      -113,    168,   -393,     52,   -383,    -33,     73,    137,
-     -6021,   -259,   -121,    -29,    -46,   -156,     68,   -225,
-       217,    152,   -280,      7,     62,      3,     17,    295,
-       221,   -158,  -5406,   -335,    232,   -454,   -320,    467,
-       -45,     96,   -170,   -267,   1273,    287,    258,    536,
-      -695,   -953,   1134,    428,    251,   3331,    717,   -804,
-       627,   1099,    120,      4,     42,    191,     -9,    259,
-      -335,   -337,    -25,    -56,    116,   -228,   -351,   -463,
-      5942,    193,   -114,    -64,   -268,    300,    146,    -15,
-       657,    367,     -2,  -2911,    838,   -251,     -1,   2897,
-       -78,   -609,   -545,   -588,    488,   1383,    486,   1820,
-       126,   2971,   -151,     11,     10,   -349,   -279,   -260,
-      -265,    142,   -683,   -191,    172,     30,   -293,  -5103,
-       -61,   -247,    -38,    722,    275,   -326,    -34,    132,
-       297,   3305,    -46,    227,  -1052,  -1114,    562,     62,
-     -1618,    699,    362,  -1624,   -455,    150,   -110,     61,
-      -266,   -168,   -168,   -391,    136,   -569,   -772,   -203,
-       467,     20,  -4747,   -170,    142,   -138,    129,   1719,
-      1896,    210,  -1008,    206,    585,   -325,    295,    175,
-     -2542,   -489,    121,    -94,    -38,  -2766,   -115,  -3206,
-      -305,    320,   -179,    503,     83,    -72,   -122,    -52,
-      -181,     98,     39,   -506,  -2751,    -93,     -1,    -59,
-      2645,    248,   -309,   -203,    138,    324,   -567,    696,
-      -493,    170,   2440,    919,   -420,  -3029,   -335,   -593,
-       -72,    536,    -82,    202,     78,    510,    184,     -2,
-       227,  -2830,     19,   1590,   -281,    387,    -46,    408,
-      -463,   -536,    262,   2214,   -115,  -1614,   -385,    203,
-        32,   -885,  -2606,   2338,     97,    292,   -449,    449,
-     -1038,   -582,      0,    -68,    211,   -160,     62,   -286,
-     -2466,   -421,    -48,   1903,  -1037,   -173,   1339,   -591,
-       152,  -1231,    792,    524,    214,    -92,     29,    181,
-      -225,   -150,     -1,    139,  -8135,    238,   -119,    189,
-        34,   -140,   -188,    141,   -112,     56,   -176,    154,
-        91,   5653,    298,   -316,    -23,    232,    -74,   -317,
-        -4,   -630,   -506,    105,  -1655,   -126,   2417,    113,
-       -95,   -472,    134,    290,   -755,    152,  -1222,    -58,
-       981,   -236,   8192,   -154,     75,    218,   -185,    107,
-       -10,     39,    265,   -225,    -87,      9,    123,   -906,
-      -382,   2544,     44,  -1985,   -102,    407,    -91,  -1835,
-      -108,    122,    142,    169,    134,   -721,  -1530,     -4,
-      -133,     45,    374,  -1049,    -76,     16,   -357,    277,
-       158,  -2596,     -4,  -1484,    -13,   2660,   -198,      9,
-      -218,    408,    -63,    177,    -71,   -195,   4293,     -8,
-       228,     34,   -421,    695,  -1409,     85,   2740,    350,
-        44,    473,    141,    -93,    144,    -59,   -220,   -154,
-      -148,   -168,   -205,   3049,    229,    194,   -107,     90,
-      -353,    508,   -343,    473,   -446,    457,   -452,   -116,
-      3493,    504,   2152,   -228,  -1832,   -463,   -657,    555,
-       657,    540,    546,    604,   2214,    -68,    254,    563,
-       267,    227,     92,   -107,    143,    260,     23,     42,
-        64,    -67,    138,   -167,     72,    457,   4958,     61,
-      -933,      1,   5341,    -32,     89,    161,    504,    823,
-       311,     11,   -184,   -574,    -79,  -1654,    -74,   -366,
-       164,   -363,    117,     53,    706,   -701,  -2966,    233,
-        11,    165,    394,    462,  -2632,    703,   -291,    -65,
-       -49,   4080,   -862,    -65,    -19,   -110,   -872,    323,
-       833,   -154,    369,    475,   2211,     20,   -212,   1711,
-       -24,    -28,    -58,     32,   1746,     41,   -779,    614,
-       508,   3050,    687,    423,   -182,   -484,    -60,    242,
-      3895,   -565,   -453,    110,    547,   -961,    320,    -34,
-      -347,  -1963,   -116,    730,   -435,    -34,     41,     26,
-       -51,   8192,   -115,    312,    184,   -148,   -199,    157,
-       153,     82,     99,    138,    -32,    -19,    -64,   -139,
-       107,     43,    133,    -87,     42,   -148,   7080,   -158,
-      -335,   -249,    -64,     81,    157,    813,   -279,   2226,
-       -16,   1191,   -705,    607,    205,    -11,  -1341,   -548,
-     -2251,   -326,   -149,  -2536,    139,   -750,     73,   -394,
-      -218,    -35,    181,    925,   -557,    226,    -63,   2582,
-      -737,    164,    181,   -167,   -230,    413,    328,    406,
-      -287,  -2992,    539,   1133,    -85,  -2162,   -154,   -357,
-      -245,     -8,    162,   -118,    111,   1275,     47,   -314,
-     -2043,  -2732,  -1052,    -28,    625,   -810,   -487,     40,
-      -131,    273,    105,   2605,  -2974,    268,    -19,   -257,
-       842,   -662,    855,    505,    590,   -243,     68,   6978,
-       118,   -101,    349,   -232,   -258,   -318,    212,     55,
-      -686,   -177,   -173,   -102,    480,     35,    149,    263,
-     -2838,   -198,    942,    392,    135,   2980,     34,     92,
-      -237,   -672,    224,   -298,    298,   2128,    359,    254,
-       150,   -839,   1001,   3234,   -169,    261,   -302,     74,
-      -277,    498,    321,    194,  -3275,   -152,  -2786,     33,
-        70,    236,   -222,     88,   -393,     47,   -636,    869,
-      -754,    842,  -2326,   -460,    133,      0,    264,    172,
-     -2955,   -286,   -243,    399,    882,   -722,   -382,    872,
-      -119,    -65,  -2403,   -119,   -246,   -890,   -185,    102,
-       -32,   -573,    225,   3044,   -484,    -40,   -809,    403,
-};
-
-static const int16_t cb2224l0[] = {
-     -3546,   -433,    -76,     46,     24,   -641,    214,    114,
-      -779,   -930,    -57,   -462,   -569,   -848,   -413,     53,
-        45,  -3172,   2915,   -734,    152,    487,   -113,    246,
-      -196,   -187,   -136,    469,    475,    382,    213,   -886,
-      -275,    313,   3148,    -62,   -773,    785,    -24,  -1499,
-       -65,   -175,  -1942,   -325,     78,    -15,    -38,      2,
-         6,    -29,    -16,   9690,    -15,    -49,    -13,     12,
-       -21,     11,    -45,    -63,   -528,    192,   -137,    201,
-       138,   -154,     57,    -88,  -1695,    155,    105,    121,
-      4249,    -59,    467,   -439,   4483,   -130,    -39,    262,
-       -21,   -377,    441,   -353,   -768,    366,     23,    841,
-       529,    195,   2722,   2892,   -255,    -67,    628,   -498,
-        33,    241,    212,  -1020,    -97,   -723,    594,     35,
-       -31,   1459,     19,    -75,    -27,     -1,     48,     28,
-       267,   -275,   3780,   -515,   -467,     36,   -405,   -272,
-     -1968,     60,     44,    449,  -2877,   -124,  -1524,   1195,
-      1042,    117,    115,   -305,    225,    215,   -357,    144,
-        35,    -23,     89,   2133,      2,     65,    -27,    -48,
-      -243,   -216,   -807,    700,   1258,      6,   -140,      4,
-       -31,    -21,     42,     67,     97,     -2,    104,    -10,
-     -7734,    134,    -50,    -95,    -88,   -269,    105,    -18,
-      -229,    453,   1038,  -2609,  -2944,    -57,     27,    372,
-        59,   -556,    -87,   -242,    114,   1083,   -119,   -139,
-       175,    146,    -55,   1689,    342,    501,   2722,  -1273,
-      1626,    868,   -290,   -145,     62,    194,    -23,   -179,
-      1540,    -85,    360,    254,    339,   -681,   2081,   2730,
-       838,   -128,     31,  -2133,   -173,    483,   -138,   2706,
-      2007,     91,    293,   -642,     35,    280,   -132,    454,
-       -66,  -6263,    -24,     82,    -31,    -39,      5,     41,
-        66,    239,     18,    -57,     61,   -117,    103,     16,
-     -1231,   1384,   -164,    104,    370,  -1891,   2237,   -440,
-     -1399,  -1394,      3,    274,    223,    -30,    -70,    579,
-       361,    423,    355,   -176,   -164,   -443,   -306,  -2382,
-       713,  -2987,   -340,   -691,   1407,     -5,    439,   -264,
-       -86,   1964,    -17,     88,    175,     56,   -119,     31,
-       466,   1980,    176,    513,   1809,     17,   3000,   1861,
-       -71,    314,   -255,   2041,    576,    203,    443,   -392,
-      -539,   -380,   -685,   -204,   -161,    287,    378,   -502,
-      1898,   1540,   1073,   2282,    573,    867,    122,   1064,
-      -628,   -564,     97,    280,    -36,   1601,    -90,   -174,
-       -10,     45,    -57,    159,   -496,    641,   -959,    -91,
-       -90,   3057,   1680,    -83,     80,     19,     63,   -119,
-         1,    -72,    466,   -335,    453,   -177,   3930,    -21,
-       327,   -199,   -651,    -38,     -6,    -13,      7,    -77,
-         1,      8,     40,   -125,     36,   -136,    272,   6266,
-     -3299,   3331,     24,     18,    -71,      9,    -79,   -374,
-      -277,    128,   -233,   -175,   -350,   -216,     81,   -693,
-       -49,     33,    -44,    -37,  -4260,    -70,     96,    177,
-      -319,    133,    178,   -377,    -45,    182,    156,   -155,
-       -34,     10,     22,     53,   -211,      4,   5740,     48,
-       -42,    114,    149,    -30,    122,   -106,   -309,   -148,
-       -82,     20,    130,   2734,    -40,   -596,   1309,   1163,
-     -1470,    396,   -264,    884,    142,  -1818,     67,     -1,
-        38,    -52,    -73,      1,    279,    143,    278,    -45,
-      1541,   -886,   -677,  -2609,    -88,  -3766,   -201,    237,
-       -40,    195,    -50,   -366,     88,    166,    403,    236,
-      -130,    205,    -45,  -8636,    -13,    -27,    -50,      8,
-        40,     21,     41,    -36,    -25,    -40,    -14,    -14,
-        42,    296,   2495,    372,   -361,   -501,   1951,  -2141,
-       220,   -847,     98,    228,   -250,    563,  -1121,    -29,
-      2888,   -196,    151,    -19,   -287,  -2298,     65,   -482,
-      -124,   -186,   1215,    468,   -781,   -227,    621,    298,
-       -42,    -44,   -115,      0,     50,    179,     23,      9,
-       -65,     -8,     10,   -101,  -4998,     77,   1181,   -304,
-       139,    250,  -2257,    -97,    847,    433,    385,  -2411,
-       800,   -852,   -528,    435,   -953,    -23,      4,    928,
-      -108,   -634,   -273,   -879,   2566,  -2609,    621,    807,
-       295,    -77,    627,  -1114,   -297,   -109,   2103,    -53,
-        -9,     44,     32,    339,    679,     77,  -3186,   -416,
-      1234,   -801,    472,    408,    153,    465,   1703,    879,
-     -2411,   -553,    440,   2099,   -899,   -288,    310,    665,
-       -47,   -148,   1457,   3932,   -213,    243,  -1763,     -2,
-       288,   -425,   -972,    478,   -302,    552,   -377,   -352,
-       179,   -480,   1466,   2019,   2817,      5,    824,     13,
-      -384,   -582,   -297,  -1165,    689,   -120,    703,   -118,
-       663,    206,    -49,  -2853,    -76,     32,    170,     11,
-        42,   -503,  -1139,   1548,   -287,  -1112,    765,   -455,
-       -35,   2452,     22,   -134,    144,   1867,   -149,   2771,
-        19,    264,    700,    -48,    286,   -593,  -2637,    408,
-      2304,    -14,    187,   -135,   -210,    745,    282,    724,
-       861,     21,   -414,    606,    836,   -564,    212,    203,
-        64,   4706,    -30,    -43,    -85,    -61,    -90,    644,
-      -281,    287,   -122,   -340,   -137,     36,     -4,    -22,
-         8,   9486,     -3,      4,     10,      4,     86,     58,
-        -8,      6,   -105,    -15,     15,    -63,    -58,    -30,
-        15,      0,    -19,     78,  -8267,   -134,     -8,    -45,
-       163,    -19,    149,   -298,   -167,     34,    190,    -39,
-     -2229,   2821,    126,    185,   -791,  -1229,   1003,   -331,
-       980,    659,    -60,    -60,    -48,     20,     12,   -167,
-       -60,    -39,     66,    180,    -22,    -20,     84,   -108,
-       131,    -10,  -8493,     -1,    -18,     -4,    -53,     25,
-       -63,    -14,     20,     25,    -41,     40,     -5,  -2330,
-       -74,     59,     -7,   -154,   -293,    -64,  -2702,    819,
-        75,    977,   -602,   1138,    160,    262,     26,    -81,
-        18,   5558,    118,   -167,     98,    110,     -5,    -44,
-       -27,     72,     51,   -189,      0,   1868,    743,   -275,
-      2530,      6,    180,  -1019,  -1307,    710,    303,   -152,
-      -115,  -1498,   -501,   -495,   -103,    -76,     78,     -7,
-     -9337,     -6,     31,    -21,     16,    -14,     57,     36,
-       -81,    -67,    -30,   -535,    216,    313,    310,   -157,
-      2830,   -914,    122,   1353,  -1842,    298,  -1165,    -13,
-      -253,   -100,   -560,    -61,     40,     24,      3,     56,
-       -18,   5709,     41,     13,    -23,    -55,    -98,    214,
-       109,   -205,    -45,     27,    -26,    177,   -290,     89,
-         8,   1315,   3102,   1657,    210,  -1032,    774,   -211,
-      -581,    -51,    896,    852,    331,    349,   -474,   -119,
-      -865,   -145,   2270,    703,  -1967,  -2088,    610,   -700,
-       113,   -231,   2062,   -152,   -599,   -474,    -38,   -601,
-       432,   -983,   -731,    744,  -2880,    156,   -240,  -1903,
-      2497,    -89,   -963,  -2179,  -1208,    189,    318,    150,
-       204,     29,   -167,   -138,    -93,     73,    292,  -3225,
-      -310,   -510,    173,    -90,    154,   1831,    380,  -1191,
-      -976,  -1460,   -514,    235,     13,  -2950,     22,    -95,
-       228,     85,     10,    264,  -3165,     46,   -184,   -782,
-       143,     -9,     37,     12,    108,    -65,    -64,    115,
-        86,   5039,    -55,   -203,   -163,   -462,     77,    -92,
-       423,    139,    239,     -5,   1887,    426,    729,    118,
-      -159,  -2821,   -124,   2147,   -167,  -1023,     92,    -23,
-       162,   -159,    -47,     -3,     14,    -34,     37,    -29,
-       -97,     41,    -92,    -75,  -6983,   -224,    250,    -80,
-};
-
-static const int16_t cb2224l1[] = {
-     -2888,   -183,   3606,      0,     33,     99,    -76,   -264,
-      -351,   -508,   -546,   -103,    252,    -49,     46,    -32,
-        48,   -245,     67,  -2408,    340,   3153,   -154,   -280,
-      -440,    374,   -224,    -39,   -720,   -289,   -136,  -3095,
-       -98,    -37,    -86,    145,     51,    132,    773,  -1158,
-      -330,   -449,   -141,  -1831,    666,  -2680,   -110,   -906,
-      -307,  -3299,    287,     55,   -521,   -173,   -431,   -383,
-        67,    -28,     34,    247,   2814,   1479,     32,  -2196,
-     -1625,    135,     72,      3,    634,     76,    502,   -306,
-      -366,   -120,   -219,   1934,    372,   -130,   -113,    255,
-       -14,     30,   -687,   -576,    797,    306,  -2360,   -242,
-      2062,     69,   2273,     26,    -20,    -21,    -68,    -69,
-     -4618,     60,   -171,   -235,   -271,    175,   -110,    147,
-       100,   1628,   -197,     -2,  -4002,    520,  -1236,    -21,
-        62,   -396,    513,   -369,   -168,    285,    561,    131,
-      1347,     83,   -101,     89,    206,      5,   4556,    -23,
-      1191,     39,    352,   -158,     99,   -195,    -33,    481,
-      -446,   -125,    181,   2678,   2860,   -524,   -239,     55,
-      -360,   -358,   -560,     93,    307,    285,     77,   -295,
-       -90,    114,    -45,     54,   -328,     94,   -222,    -30,
-     -5004,   -164,    100,    379,    208,    424,    -11,     26,
-        10,    -26,    -32,    114,     30,     18,    -44,   -221,
-      -184,    -32,      0,    -99,  -9001,     -7,    -33,      1,
-        41,     -3,     13,      9,    -46,    -86,     47,     56,
-        72,     -7,      5,  -1162,    101,    456,   -217,   3440,
-      -220,    400,    100,   1503,    365,    655,   -230,     42,
-      1129,    767,    192,    -16,  -3440,    -79,   -236,      3,
-       -80,     51,    -11,   -984,   -142,     29,    554,    339,
-      1851,    105,   -279,  -2915,    116,   3090,   -431,    233,
-       337,     61,    927,     32,   -174,    237,    255,   -250,
-       604,    115,   2036,     78,    -79,    -50,   -349,    338,
-       285,    169,    394,    -49,   1194,  -2966,    447,     57,
-     -2591,    415,   -586,  -2616,   -197,    -61,    596,  -1159,
-       130,   -441,    356,     47,   1192,    496,  -1801,    -15,
-      -142,    -23,    132,     21,     84,    234,   -137,     23,
-      -147,  -3254,    407,    107,   1132,    130,     74,    153,
-      3148,   2184,   -464,   1294,    222,    589,    457,   -397,
-       -87,   -605,   -631,    311,   -703,    110,     20,    -23,
-       -75,     18,    -43,   -182,      8,    -94,    151,   4989,
-      -619,    662,     82,      8,     69,     -4,    126,    -35,
-       -99,   -277,   -227,  -2212,   3188,   1115,   -467,   -618,
-      -989,    681,    218,    -25,    -37,     -9,     32,    -46,
-        97,     15,    -23,    -95,     -6,     55,     19,   7904,
-       -14,   -508,      3,     14,    -12,    -58,     28,    154,
-        11,    271,   -593,    344,   -336,   3489,    -41,  -2998,
-       622,  -2739,   2796,   1536,    310,    176,   -318,    399,
-       -70,   -298,   -509,    256,   -381,   -158,    322,   -197,
-         3,    -53,     37,     98,  -6136,    -25,    -54,     57,
-       138,    -74,    239,    -46,    -18,     29,   -265,  -2278,
-        22,    110,    -21,   -147,    266,     85,   -286,    137,
-      3434,   -485,     68,    475,     -3,    159,   -181,   -237,
-      1595,    759,    786,   1490,    926,  -2841,   -160,   1092,
-        -7,    130,    895,   -345,    -95,    -31,    -35,    139,
-       -98,   2106,    305,    672,    -66,    349,    229,  -1561,
-     -1694,  -1786,   -743,    -76,    -67,   1666,     76,     10,
-       -22,     60,    -45,      5,    409,   -458,    583,   -405,
-      2586,   -264,    175,    633,    842,   3208,  -1488,   -802,
-        40,   -119,   -197,    -84,   1645,    328,    823,   -175,
-       342,     12,   -217,     67,    124,   -180,   -106,  -2877,
-      -336,    171,    185,    132,  -2263,    -75,   -622,   -631,
-     -2404,    176,   -132,     35,    179,  -1498,    182,     68,
-       699,    597,  -2728,    325,     52,    421,   -863,    609,
-        53,   -159,    258,   -307,   2919,     44,   -826,   -467,
-        91,    542,   1883,    815,   -682,    548,   -419,    593,
-        82,  -2108,   -158,    -75,   -524,   2440,   -528,   -469,
-       723,    -14,  -1817,   -487,    448,      4,   -155,    -70,
-     -1715,     34,    -55,    134,      0,     19,    107,    419,
-       334,     74,    446,   1241,  -4288,     61,    -65,     21,
-        71,    133,      2,    -88,   -238,    322,   -283,     -6,
-       404,     98,     78,  -1951,    412,  -1942,    418,    257,
-       -42,  -2444,    -97,   1491,    464,    346,    229,   -154,
-        96,    261,     29,    302,     39,   -201,    -40,    -98,
-      -157,    335,  -3624,   -349,   -573,    633,   -116,   -312,
-       -82,    263,     -2,   -101,    -57,   1817,   -424,      3,
-      -245,    386,     74,    609,   2171,    -77,  -2604,  -1036,
-      -117,   1585,     -2,      9,    -23,     31,    -12,     48,
-       215,     84,     13,    219,    419,   -275,   4373,    -91,
-        -6,     18,   2228,    -46,    157,   -408,   2288,    654,
-      -725,   -245,    -10,  -1182,   1726,    324,    367,   3013,
-      3429,   -140,    360,   -122,   -574,   -165,    109,   -330,
-       -82,    340,   -133,    210,    355,     -8,     47,    -52,
-      8064,      5,     60,    -42,    -95,     -3,     91,    -69,
-       -47,    -42,    101,    118,    -44,    -16,    -14,     -9,
-        27,      8,    -33,     -3,  -9302,     27,     49,     -6,
-        61,     74,    204,    430,    252,   -259,     73,    125,
-       366,   -458,  -2846,     89,  -2694,   -106,   -344,   -702,
-       809,    451,     69,    585,  -1897,    608,  -1138,     52,
-       618,    106,    771,   2992,    266,   1007,    184,   -486,
-        36,   3317,   -311,     38,    105,    -89,     16,     97,
-       -88,     28,    183,  -2834,    -44,    387,    -49,    467,
-     -2524,     77,    -56,  -3727,     81,   -308,     63,   -137,
-       203,    -77,    139,    254,    -65,   -264,    -58,    631,
-     -2559,    739,  -1343,    595,   -117,   -193,  -2572,    322,
-       267,    185,    669,   -110,    641,    212,     45,    -16,
-        12,     14,     -3,    -12,     78,    -48,   -196,   -128,
-       179,    146,  -7348,    177,   -138,    -48,    142,    -33,
-        34,  -6037,     15,   -105,    103,    136,    -48,    217,
-      -169,     88,    -31,      9,     24,     41,   1733,  -2757,
-      -335,   1783,    988,   -161,   1014,    633,    -66,  -1114,
-       525,   -266,    461,   1137,    -26,   -173,     89,     82,
-     -3365,     67,   -198,   -107,     44,    352,   -793,    867,
-      -807,   -166,    107,      4,     71,     61,    124,     27,
-     -2477,    178,    -32,   -172,   2895,   1301,    798,    707,
-       267,   -720,   -403,    167,   -157,   2572,   -210,    527,
-      -312,  -1664,   -214,  -1556,   -332,    595,  -1634,    -58,
-       203,  -1777,   -469,     24,    188,    -59,   -860,    879,
-        15,    855,  -1534,   2910,    534,    -71,    276,    471,
-        41,    -25,    105,    -37,   -150,    110,    226,   -277,
-     -4687,    574,    139,   -152,   -586,     67,  -1082,    261,
-       -68,     25,   -216,    110,     46,  -3703,    281,    355,
-      -506,     80,   -218,    164,   -398,     75,    -97,   5782,
-        39,    -68,     26,     76,     74,     38,   -103,    105,
-        44,    116,    187,    288,     90,   5847,    -41,     28,
-       -19,     20,    129,    -99,    258,     22,    -28,   -120,
-      -101,   -121,     79,   -180,    -23,     22,     -5,    -60,
-        63,     35,  -8987,    -11,      2,    -15,     -3,    -28,
-        47,     29,    241,    132,   -166,   -259,    -48,    102,
-        70,   2830,   3163,    285,   -813,      0,    105,    176,
-      -455,    141,   1382,   -481,  -2282,   2971,   -200,   -473,
-        37,   -930,  -1162,    930,    890,    412,    190,   -160,
-};
-
-static const int16_t cb2224s0[] = {
-     -5789,   1229,   -138,   1010,    823,   -602,   -987,   -237,
-        47,    -29,    428,    210,     87,    -11,    -20,   -261,
-     -3148,   1219,  -2074,   -132,   -258,    707,   -634,    878,
-      -486,    989,   -276,   -137,   -263,    592,   1248,    474,
-      -293,   -981,   2125,   -653,  -1451,   -833,  -1522,    387,
-      -269,    349,    698,    295,    870,    661,   1532,    202,
-       654,    362,  -1265,   3972,   -651,    224,    213,   -728,
-       -83,    575,   -503,   -766,    559,   -657,     86,    941,
-      1498,    -72,   2297,   1413,   -376,    697,   -738,    384,
-      -807,   -354,   1141,    374,   1186,   -597,    222,    630,
-      -717,  -1653,    106,  -1377,   -929,    982,  -3469,   -321,
-      -201,  -1185,   -147,    -13,    268,    103,   2967,  -2083,
-      -416,    702,    377,  -1126,     92,    963,   -494,    -94,
-      -436,   1893,   1401,    -40,  -1464,  -1608,   1980,     44,
-       254,    676,    529,   -891,    -95,      9,   -172,   -129,
-       158,   -403,  -1147,   1026,   -410,     86,   2593,  -1060,
-      -621,    480,    254,   -780,    691,  -1020,     79,   -192,
-     -2264,  -1219,   -748,    602,    243,    338,    550,   -444,
-      -130,     79,     24,   3396,    124,   -572,    749,    976,
-        33,   -883,   -368,   -609,    694,   -569,   -560,    192,
-       868,    644,    173,     86,  -4302,    633,   7899,   -360,
-       478,    493,   -306,     14,    244,     96,     71,   -169,
-       336,    346,     74,    -52,   1779,    828,   -252,    739,
-     -1005,   -755,     31,    -46,    200,    581,    -11,    802,
-      1104,   3252,  -1053,    723,   -491,  -2492,  -2330,   -245,
-       308,  -1021,   -312,    563,    -85,    991,    -16,    224,
-       -85,   -957,   2262,  -4585,  -1475,    102,    310,    298,
-      -875,     -6,   -268,      8,   -284,    324,   -471,   -224,
-       133,   1502,  -1714,  -1095,   -104,    809,   2584,   -273,
-     -1014,   -296,    130,    732,   -259,   -335,   -745,   -619,
-      -716,    247,    503,    862,   -277,   -137,   -224,  -4897,
-       124,    277,    298,    -40,    169,    678,    557,   4379,
-       677,  -2016,   -506,   -108,    -47,     49,   -115,   -260,
-      -300,    206,   1196,    -17,    202,    365,   -808,   -473,
-      -160,   -609,    526,  -1124,   1629,  -2924,    713,   -487,
-      -109,    540,   -511,    221,   -394,  -1420,   1023,   -460,
-       424,    -86,   -875,  -1557,    -88,   -244,  -1597,  -3015,
-       355,    166,    330,   -334,   -325,    505,   3632,  -1760,
-      1626,   -427,    573,   1197,   -317,   -566,   -663,    460,
-       338,   -442,   -597,   1565,   -854,   -534,   -219,   -128,
-     -2175,    739,   1064,   2050,    -61,   -349,    361,   -375,
-      1111,   -122,   -121,   -164,  -2573,    938,   1758,    -15,
-       884,    865,   -630,   -573,    994,   1112,    -26,      9,
-       -30,   3893,    -38,   1386,    605,    568,   -680,    117,
-        37,    572,    245,    -53,  -1030,   -241,    397,    363,
-     -1632,   -567,    -26,   -698,  -2109,  -1033,  -1389,   1381,
-      -418,    402,   -534,      9,   1143,    991,    693,   2557,
-     -1268,   1273,   -192,   1225,    876,    472,    835,    509,
-      -452,  -1519,    482,   1103,   -626,   -299,   1580,  -1532,
-       599,   2245,    503,   -110,  -1879,    978,  -1158,   -130,
-      -665,    448,  -1247,    604,   -528,   -677,   -711,     78,
-      -563,   -349,    -53,    261,    952,   -338,   -534,     43,
-        -2,  -2555,   1976,   2393,   1715,    996,   5628,   1036,
-       171,    -28,   -199,    -83,   -126,    -35,   -248,   -393,
-        36,    209,     77,  -1793,    244,   -108,   -130,    -41,
-      -578,  -2347,   -687,   1650,    131,   -138,    407,   -228,
-     -1348,   -209,   -841,   1332,   -542,    220,   -193,    843,
-      -103,    853,    261,   -653,    217,   -107,   -113,    -54,
-     -4151,  -1303,   -287,   4065,   -376,    -71,     43,  -1481,
-      -359,   -481,     78,    529,    689,   -194,    178,     60,
-      -997,  -1555,   1687,    345,    169,    266,   2894,     83,
-      -500,   -425,   -396,   -245,      6,    517,    112,    129,
-       725,   -121,   -404,    234,     47,    -61,   -122,    710,
-     -4283,    985,     56,   -105,    -45,   1043,    720,     73,
-       321,   4452,  -1614,     91,   -620,   -299,    506,    766,
-      -882,    650,   -138,    123,   -608,    210,  -1582,   -538,
-       -62,    246,    464,   -332,  -1560,   2271,   1559,   -199,
-      -832,  -1133,   -797,    341,   1860,   1628,  -1133,   -607,
-       637,   -404,    437,  -1148,    542,   -474,   -882,   -610,
-     -1340,   -159,   1524,   1424,    169,     -6,     52,    447,
-     -5513,   -592,    244,   -294,     44,    164,    -51,    147,
-       202,    -48,    139,    113,   -399,    -17,   -173,   -199,
-         1,     17,   -166,     15,   -258,     -7,    238,  -5748,
-      -394,   -852,   -248,    -46,    192,    -32,  -1033,   -349,
-       151,    483,    130,  -1628,  -3391,   1527,    694,   -305,
-       740,   -357,   -491,   -186,  -1649,  -1394,   -873,    213,
-       652,  -1975,    319,  -1131,   -103,    -48,    673,    155,
-      -627,   1115,    469,  -1122,   1901,   -184,   -237,   -296,
-     -2887,   -120,    211,    835,     57,   -826,   1272,   -255,
-      -937,    242,   -525,    836,   -334,    393,   -624,    111,
-      -347,   -178,  -3441,    219,   -352,   1831,   -296,    587,
-      -357,  -1099,      5,    313,  -3806,   -394,    814,   -118,
-      -233,    -23,   -125,    -21,  -1414,    813,   -403,   2482,
-       442,   -184,    934,    340,    472,    374,   1073,   -283,
-     -2348,    477,   -387,   -713,   1071,   -899,    252,  -1299,
-      -502,   -375,   -410,  -1785,    686,   -605,   -141,   -871,
-     -1777,   2780,     53,   -237,   -237,   2701,    944,     44,
-       595,      3,   1263,  -1558,  -2267,   -998,    221,    355,
-      -319,   -739,  -1160,   -594,   2977,    191,    -41,   -284,
-        83,    484,    481,    -73,    -13,    138,  -2761,   -909,
-      -578,   -139,  -1056,    189,   -645,   -147,    -61,   -168,
-       368,    130,    390,   4187,    101,     79,    -45,    451,
-     -1374,  -1941,   -534,   -301,   -979,   -668,   -533,  -2978,
-       386,    574,   -454,     -4,    554,   -120,    366,     83,
-      1079,   -351,    156,    389,   7724,     83,    102,   -191,
-     -1059,   -255,    -86,    451,   -211,    175,    774,    306,
-      -253,   2386,   1166,  -2025,    223,    438,   1279,   1721,
-       -23,    -91,    606,  -1285,   -775,  -3228,   -536,    543,
-       877,   1140,  -1616,   -603,    550,   -678,   -462,    248,
-       209,   -515,   -310,  -2538,  -2002,    231,   -495,    319,
-       538,    509,   -113,    -17,    143,  -3062,    -29,    -52,
-       299,    681,    595,    390,    530,   -398,   -969,    472,
-     -1145,    860,   4113,    329,  -1183,   -691,   -605,    859,
-       305,    986,    -81,   2029,    408,      2,  -2442,     59,
-       -85,   -911,   -285,   -532,     28,    434,  -2295,    -76,
-     -2977,     51,    824,  -1786,   2301,    622,   -593,     -9,
-       643,    246,    427,    193,     51,    118,      4,    234,
-       459,     31,   -408,    710,   -264,    144,   -404,   -476,
-       278,  -4836,   -113,    382,    -29,    177,    345,    -33,
-       -17,    -85,   6027,     72,   -165,    544,   -198,     75,
-      -278,   -262,    155,    501,   -305,   -279,   -439,   1506,
-       827,   -875,  -2592,  -1196,  -1201,    149,     16,    547,
-      1020,   -616,    374,   -193,   -155,  -3627,    231,    264,
-     -2143,     90,    419,    574,   -795,    177,    328,    752,
-      -295,    210,   -360,  -1250,   2639,  -3172,    -13,    -34,
-       489,    484,   -390,   -159,   -285,     27,    444,   -252,
-       265,    530,  -2714,   -340,  -1543,   2330,  -1152,   -114,
-       452,    304,   -224,   -451,   -317,   -579,    301,   -567,
-      1214,   -594,   -621,  -2718,     59,    257,    410,     -3,
-       145,     70,    877,  -3103,    244,  -1134,    236,  -1148,
-};
-
-static const int16_t cb2224s1[] = {
-      8488,    277,     63,    173,    224,    -30,   -158,     64,
-       133,   -133,    234,    205,    -65,    408,    249,   -546,
-       -30,     -1,   -430,     80,    102,   -450,   -160,  -5634,
-       145,   -406,   -351,     37,    282,    232,   -898,    430,
-      3301,  -1175,   -559,    495,   2685,    -21,   -215,    -87,
-       728,    -55,    235,    430,   -250,   -505,    506,   -128,
-       -72,   3288,   1588,    291,      7,    -39,   -944,    478,
-      1719,    168,  -1085,    225,    330,   1480,   -183,   -597,
-     -6131,    668,   -387,    672,   -173,    -55,    113,     40,
-      -113,    -44,    341,   -340,   -594,  -1001,   1757,    127,
-       -59,    537,  -1834,   1401,    856,  -1153,   -234,   1232,
-      -562,    476,    110,   2188,    146,    119,   2119,   -872,
-       450,    597,   -371,  -1350,   -996,   -120,   -495,    829,
-       111,   -897,  -5445,   -670,    390,   -118,      4,    109,
-       772,    495,    196,    410,   -125,    812,    426,    900,
-       436,   1155,   -553,  -1223,    275,    266,   -891,     63,
-     -1267,    523,   -548,  -2445,    239,   1163,     72,    -68,
-     -1576,   2212,   -340,   1499,    494,   -671,    -73,   -281,
-       598,   1901,  -1652,   -845,    266,    795,   -545,   -574,
-        19,   -461,    371,    288,  -3959,    421,    299,   -121,
-     -2561,    -65,    118,    181,   -227,    719,    -92,  -2334,
-     -3178,  -2497,   -198,     58,   1279,   -309,    152,   -715,
-       466,   -316,     10,     98,   1568,  -1015,    -18,   -435,
-       -42,   2606,   1971,   -119,    705,    254,    443,     36,
-       788,   1135,   1234,   2281,    942,    115,    581,   -113,
-      -194,   -694,    434,    -30,   2835,   -423,    436,    522,
-       406,   1329,   1191,  -2628,    421,  -2601,    646,   -202,
-       637,    610,   -584,    357,  -1586,   -499,  -1230,    134,
-       -83,  -1264,   2434,    -58,  -2924,    641,   -285,    172,
-      -478,   -402,    584,  -1180,   -137,   -238,   -151,   -679,
-      -619,   -495,   1044,   1281,  -1180,   -444,    376,   1969,
-      -693,   -283,    618,    128,  -2622,    -90,   -115,    672,
-      1738,   -459,    519,   -924,   2582,    937,   -555,    672,
-       131,     31,    775,    307,   -282,   -527,  -1299,   -516,
-        10,    239,  -4069,    118,     10,   -665,    -15,   -484,
-       472,    262,    279,    677,   -755,   1288,  -1278,    403,
-       666,   -394,  -1230,  -2819,   -221,    109,    603,    754,
-       951,    488,   -147,   -107,   -426,   1875,   2056,   -129,
-       239,   -561,     81,   -324,    243,    349,    197,   -811,
-      -146,   -929,   1193,   1433,   -776,   3209,    434,     -6,
-      2465,   -231,    -57,    312,    899,   -396,   -170,   -549,
-       346,    135,     17,   -596,    401,    269,    499,    -64,
-      -321,   -342,   -132,   -312,   5845,    276,   -104,     -9,
-       -50,   -678,   -478,  -1125,  -1477,   2058,    156,    538,
-       451,   2572,    495,    101,     74,   -753,     98,    685,
-      2424,  -1999,   1050,   -280,  -1030,     29,   -178,   -244,
-      -134,    130,   -137,   -103,   -245,   2161,   -446,  -1016,
-       464,    573,   -473,    446,  -3822,    942,  -1261,   -334,
-       568,   -528,   -301,    415,   -740,    661,   -813,    849,
-      1491,    774,   -774,   1637,   -977,   -246,    647,   -572,
-      -140,  -2946,   -654,   -650,   -311,    339,   -165,    757,
-       803,   -958,    704,    171,    380,    763,    159,   2721,
-     -1599,   1006,   -118,   -597,   2985,   2699,     69,    395,
-       523,    657,    438,    190,     72,    164,   -268,   -145,
-       506,   -550,    222,  -3641,      5,   -173,     60,   -194,
-       677,    686,    724,   -107,    882,   -339,     14,    -54,
-       555,    483,   1523,    119,   -142,   -394,  -1683,   -984,
-        18,   -108,   -190,    141,    540,    281,  -1238,  -2195,
-      -341,   -327,  -1014,   -990,   4694,     46,  -1018,    360,
-      -671,    -83,    218,    857,    144,   -188,    463,   -379,
-      -571,   -865,  -1345,   -447,    -18,    -64,   5201,    132,
-        90,   -158,   -132,    381,    -85,   -107,   -103,    970,
-      -555,  -1204,   1802,   1230,    253,    540,   -372,  -2347,
-      -386,    835,   -705,   -437,    941,    795,   -182,   -368,
-      1088,    168,    256,    210,   -667,    290,   1783,   -636,
-       165,   -363,    638,  -3527,   1872,   1997,   1503,   -189,
-     -2587,   -359,    384,    493,   -384,   -658,  -1758,    993,
-      -306,    148,    198,    163,    430,   -313,   -149,   -337,
-       352,   -354,    484,    358,   -264,  -4525,   -560,    -55,
-       154,    374,   -317,   -426,   1446,   -161,   -285,   -110,
-       209,    299,   2329,     99,   1406,   1374,    993,   1178,
-      -413,   -642,   -103,   3678,  -1829,   -754,  -1358,   -349,
-       648,   -492,    755,    188,    114,   -444,   -930,   -224,
-       319,    212,   1223,   -648,    593,   1293,  -1289,     24,
-      -712,   2591,   -494,   1503,     -9,    534,    923,   1490,
-       985,    491,    272,    988,    348,   -503,   -454,    893,
-       409,   -422,  -1187,   3097,    602,   -402,    462,   1598,
-      -219,    982,    319,    125,    558,   -100,   -261,    108,
-       -59,  -3435,     76,  -1065,   -150,  -1758,  -1997,   1921,
-      1239,    426,    507,    173,   -856,   -829,   -538,    247,
-     -1203,    488,  -1094,    453,  -1104,   1021,   2185,  -2855,
-       427,    177,   -778,   -182,    641,   -670,     91,    569,
-        50,    -90,    571,    108,   -374,    174,   1997,    964,
-       644,   -428,  -1868,    668,    171,    320,    676,    121,
-      -218,   1901,   -857,   -721,   -194,  -2433,    -34,  -1671,
-       352,   -644,    295,    571,    253,   -288,  -1786,     32,
-        74,    -73,   -902,  -1954,  -1126,  -3427,    168,   -318,
-        23,   -755,   -441,    201,    -84,    499,    367,   -153,
-      -426,    716,    650,   -457,     80,   -709,    859,  -2098,
-      -723,   -197,  -1030,   -253,    283,  -1187,   -899,   1403,
-      -117,    -25,   7617,    -63,   -355,   -283,   -560,    -85,
-      -358,    -45,     63,    179,   -193,    130,   -294,   -676,
-      -525,   -907,   -430,   -627,  -5267,   -539,    257,    594,
-      -173,    890,    203,    -33,   -136,   -803,    479,    -56,
-      -634,    464,   -919,   -146,    306,      5,    198,    -90,
-      -138,   -337,   4826,   -310,    259,   1651,   -687,  -1676,
-       424,   2729,   -966,    -61,    386,     60,    769,    -72,
-     -1652,     49,    106,    503,  -1462,  -1056,    892,    359,
-       209,   -129,    260,   -130,  -2081,    798,    488,    846,
-      -836,   -366,   1786,  -2237,   -484,     72,  -2680,   -828,
-      -857,    920,    560,    930,   -197,     56,   -872,    -34,
-      -355,    929,     35,   -449,    514,     70,  -1277,    208,
-       353,   3654,   -256,    134,   -895,   -184,    375,    402,
-      1576,   1515,   -100,   -438,   -679,    384,   1143,    -24,
-       100,  -2818,    554,   -219,    105,    652,  -2778,   -108,
-        44,    306,    445,   -470,  -1151,  -1170,   1305,   -741,
-      1223,   -443,   -838,    374,  -3000,     72,   -590,   -587,
-      3686,     76,   -493,    246,   1348,  -1215,    473,   -244,
-      -304,   1937,    -68,   -626,    278,    392,   1167,  -1899,
-      -309,    474,    226,   -421,    -95,   -483,    105,   -148,
-       749,   -430,  -3057,   -789,  -1793,  -1857,   -158,   -489,
-      -676,   -204,    806,   -930,  -3192,   -204,   -106,   -812,
-      1159,    648,    119,    -93,   -205,   -139,    280,  -7786,
-      -388,   -132,    -12,   -332,     32,   -174,    100,    153,
-        -7,    289,    -29,   -984,   -329,   -592,   2568,    704,
-       544,     66,    521,   -661,  -1632,   -868,   -310,    313,
-      -466,   -347,   -146,    197,    266,    765,   -240,   -201,
-      -265,  -1129,    -35,   -563,   -356,    172,    862,   3831,
-      1547,  -1618,  -1445,  -3726,    388,    548,   -457,    143,
-       -38,    402,    255,    840,   -703,   -154,    776,  -1038,
-};
-
-static const int16_t cb2224m0[] = {
-     -7078,   2846,     79,   -111,    -20,    330,    227,    -36,
-       305,     45,     81,    148,    -13,     68,    364,   -317,
-       -72,   2021,     28,     93,    328,   -256,   -181,   2547,
-       235,  -1102,    130,   -577,   -164,   1290,   1885,   -171,
-      -147,  -3247,    324,    -72,   -313,    -62,     32,    284,
-      -138,     -9,   -146,   1709,   -390,   1833,    289,    125,
-      2369,     60,    223,   -137,    642,   -113,    204,    288,
-     -1516,   -138,    228,    368,    219,   -622,    273,   3211,
-      -215,   -423,    139,     65,     85,   -203,   -953,     11,
-       193,    294,    279,   3267,    246,  -2377,    -59,   -324,
-       136,   -492,     23,    -56,     79,    307,    115,   -146,
-      2229,    325,  -1680,   -597,   -423,   2200,    -44,     48,
-       386,    396,   -122,    -36,     35,   9763,     33,    -67,
-        19,    -34,     15,     41,    -25,    -30,    -61,     20,
-      -121,    117,   -155,    -28,    -65,    -27,     40,    137,
-       188,   -211,   -240,     71,    -33,  -4873,   1992,     56,
-     -2701,     -1,    151,    -96,    286,   -398,   -418,   -221,
-       295,   -394,   -119,   -182,   -124,     77,      7,    -44,
-       168,    -34,   -154,    257,      4,   -114,    634,    131,
-      4930,   -118,  -2364,     46,   -204,   -129,  -3168,   -138,
-      -489,    454,    -96,    120,   -447,      9,   -230,    174,
-     11359,    456,   -261,    -74,   -249,    -28,    149,    -79,
-       -36,    211,    -10,    213,   -110,    337,  -3800,      4,
-      -223,    -18,    136,   -290,   -155,   -235,     57,    447,
-      -495,   -231,    -15,  -1036,    -85,   -154,  -4421,    -19,
-      -237,  -1191,     12,    -19,      2,    -88,    -84,    269,
-        -7,    431,    -26,  -2676,   -100,    287,    -31,  -2916,
-      -160,    -83,   -198,      9,    183,   -279,    -68,    -23,
-       -55,   2955,   -121,    -71,    183,   -702,   -323,   1689,
-      -132,    309,    136,  -1217,    440,   -125,  -1671,   1569,
-      -161,   -108,    232,    269,   -516,     37,     21,   -260,
-      -230,    564,   -375,    224,    129,   4332,   -120,   3306,
-       153,    -25,   -260,    -84,    123,     21,      5,    -17,
-      -145,    -44,      7,     -1,    290,  -2394,   -182,     51,
-       933,   1037,     26,    211,    187,  -1783,     68,   -749,
-       -52,   1428,  -1571,   -261,     34,   -199,    722,   -127,
-      -118,   -114,  -2385,    146,  -1042,    -71,  -1475,   -150,
-     -2195,    151,    -29,      6,     96,  -1213,    282,    219,
-       466,    144,   -300,    109,    -74,    125,   2863,      2,
-     -2963,   -218,    235,      3,    359,    319,    372,   -500,
-      -271,    494,   2695,    -65,    -29,     47,     74,    -34,
-       -95,    -48,    -76,    -71,  -2985,    -30,    -11,     26,
-      -176,    107,     96,     22,    -60,    114,    -70,   -147,
-       -43,   6981,    110,    -86,     33,     66,      8,    -61,
-        52,   -169,     82,    233,     56,   -115,   -295,    241,
-     -1053,  -3914,    -79,    361,   -869,   -144,   -144,   -805,
-       158,   -278,    515,      4,   -317,    917,   -669,   3314,
-       253,   1316,    259,     12,   8170,     15,    129,   -200,
-       120,    -11,     34,    -77,    -13,    257,     79,      9,
-        23,     54,     73,      0,  -9972,      5,      7,     43,
-        29,      4,   -104,     43,    -36,     76,   -228,      1,
-       -77,   -156,    -69,   -209,     84,  -2826,    242,  -1461,
-      -718,    -14,   1784,    527,    226,   9852,     83,    -15,
-      -389,     34,     51,    -16,    -46,     -1,    232,    115,
-        26,    -42,   -124,    -78,     58,   3092,  -2757,   -111,
-       223,   -286,     23,   -170,   -166,   -264,    331,   -172,
-       -49,    -26,    166,   2616,    128,   3118,     59,    844,
-      -121,   -504,   -193,    -53,    -95,    282,    -21,     -8,
-       -11,     58,    -48,   9830,     25,    -26,     53,    113,
-        96,    125,     12,    -64,    185,    -31,     19,   -251,
-      -307,   -136,   1383,    -37,   -128,     56,   4303,   -232,
-      -272,     44,   -192,    531,   -143,   -697,  -2291,     70,
-       229,   -432,   -592,   1262,    906,   -207,   1522,    261,
-     -7848,    -39,   -976,    150,    115,   -139,     61,    -26,
-      -211,    807,    -25,    311,    -98,   -297,    133,    461,
-      -109,     -6,  -1031,    236,  -2851,     86,   2184,   -254,
-       -83,   -119,    878,   -107,    -25,   1636,   1696,   1517,
-       249,    -41,   -283,    -66,    741,    704,   -898,    302,
-       470,    360,     -7,  -6002,     26,    268,   -109,    150,
-       202,    196,   -262,    -57,    160,    155,      7,      9,
-     -5770,     28,    127,    112,    -76,   -790,     45,   -118,
-       201,   -831,     67,    -81,    199,    296,   1692,    -30,
-      -126,   -121,     29,    387,    215,    269,   -518,   -232,
-       155,   2735,   -235,    -82,    -33,   3089,  -3696,    -39,
-       -51,    124,   -220,     37,     51,   -129,    194,    -80,
-        81,      0,   -239,  -1924,   -244,    107,    372,    111,
-       206,    418,     39,   -118,  -2059,   -446,   1378,    661,
-     -2135,    122,   -105,     60,    272,    -91,   -227,     48,
-     -3226,    -88,   -109,    199,    566,    158,   2412,  -4380,
-      -177,    153,    252,     24,   -323,    264,   -116,    -12,
-      -333,     99,   -181,   -124,    256,   -131,    -39,    -45,
-       -88,     69,    -26,   -173,  -4820,    286,   -171,    -82,
-       431,     18,   -827,   -107,    142,     60,    300,    422,
-       263,     61,    350,     85,   1088,   -133,  -1284,     70,
-     -4577,      5,    114,    -23,     23,   2907,    174,     43,
-        18,     33,    -31,    320,     -9,    290,      2,     -7,
-        39,    -11,     52,     32,     -4,   8454,     18,     10,
-        67,     20,     22,     -3,   -209,   -103,   -212,   -101,
-      -101,   -420,  -2837,    -28,    398,    140,   1027,   -187,
-     -2338,    406,   -152,   -288,    723,   -412,  -1851,    185,
-       641,   -190,    107,     -7,  -3194,   -128,   -382,    165,
-      -256,     85,     96,    155,   -144,    431,   -356,    342,
-     -2508,  -2190,   -265,   -320,  -1345,     27,  -1981,  -1949,
-        95,    -78,   -456,   -359,    382,   -218,   -102,    164,
-       382,    907,    599,    665,   2843,   4275,     17,   -156,
-      -264,     73,    104,    -25,   -120,     91,     84,    325,
-       170,    -65,   -245,    -23,     89,     52,   4651,    124,
-       185,     30,    321,    145,    111,  -1265,    128,   -156,
-        64,     24,  -1934,    133,    -84,    -10,     34,    801,
-      -148,    -88,    169,  -1687,    419,   1739,   -204,    -70,
-       185,    117,    379,   -420,    145,  -3650,   -264,   1118,
-       331,   -818,   -665,   -420,     74,     32,   -152,   -226,
-         6,    216,   4173,     23,   1230,    239,      2,    -57,
-      -690,    516,     90,     58,    -24,    -61,    175,  -2796,
-      -113,   -270,     94,  -2319,   -158,  -1075,   -275,   -647,
-     -3839,     37,   4267,     20,    -49,    -88,     72,   -171,
-      -195,     45,    -23,   -159,    -64,    110,   -211,     42,
-      -211,   1591,    276,  -3662,    213,     54,   -180,    786,
-       -92,   -329,    382,    344,    165,    -63,     14,     -7,
-        66,     29,   8875,     43,    -50,     65,     13,     15,
-        48,    -40,    114,    125,    -27,    158,      3,    843,
-         8,   -646,    100,  -3121,   1720,     88,    898,    346,
-};
-
-static const int16_t cb2224m1[] = {
-      9581,   -198,   -100,    -22,    237,    -15,   -101,    -23,
-        46,    129,     63,   -143,      5,   -307,   -143,     -9,
-        27,     50,     40,   6048,     25,     58,    -16,   -161,
-      -109,   -157,    137,    115,    121,    164,      4,    -54,
-      6477,    -68,   -120,    -29,     45,     -8,    -13,    334,
-       -87,    105,  -1460,     28,   -334,   -163,    -64,  -3629,
-       -71,    176,   -195,     53,     -1,    -96,   -560,    -21,
-       135,    178,    -77,  -4202,     20,   2544,   -205,     85,
-      -332,    158,     61,   -105,    398,    -88,     14,    241,
-      -149,     62,   -124,   -136,   -153,     27,    190,   2595,
-        25,  -2499,   -530,   1809,   -104,  -2753,    298,    145,
-      -771,    139,    165,   2462,   -502,    860,   -174,    199,
-        74,    163,   -686,    -25,     57,   -103,   -309,   -360,
-        39,   -296,  -2765,   -319,   -950,   -678,  -1159,  -1743,
-      1499,   1776,   -176,      9,     44,   -581,     69,     39,
-       162,    326,    -96,    329,     -9,   1274,  -2443,   -105,
-       -50,   4212,    -23,    146,   -231,    -22,    -50,   -128,
-        11,     28,    116,   -215,     46,    217,    204,    153,
-       -73,   -156,   -100,    -31,   2632,   -190,  -2258,    199,
-     -1757,    194,     53,     38,  -5723,     66,    169,    352,
-       -39,   -150,     -1,   -462,     41,    -98,   -110,    -40,
-     -5763,   -190,   -158,  -1380,    205,   -227,   -402,     81,
-      -171,    407,   -125,   -320,   -456,   -317,    489,    698,
-      -308,   3989,   -172,    402,    196,   -457,  -1238,   -192,
-      -581,    -63,   -235,    153,  -1094,    -53,    -45,    -86,
-       240,   -192,  -2660,   2356,    153,    -60,    277,     33,
-       198,    -57,   1221,  -2984,   -327,   -326,    -48,     61,
-        93,    -34,   -167,   -311,    904,    348,    415,     57,
-      2000,    -77,    238,     40,  -3072,    -36,    283,    -54,
-      -655,   -250,    -22,   -569,   -584,    -18,    733,   -251,
-       -72,    -28,     80,   -306,    211,    188,   -149,   4596,
-       305,    372,    351,    -82,   -184,    -79,    -65,   2688,
-      2670,    -54,    -81,   -170,     19,    -88,    122,   -117,
-        33,     51,    -29,   -113,  -2973,     46,  -3294,     90,
-         8,   -180,   -227,    -62,     43,    -25,    187,   -380,
-       -29,    -89,    138,   -352,    231,   2632,    158,   1993,
-       -15,    350,    107,   -982,    -16,  -1120,    136,   -171,
-       -42,   2605,   -186,    110,    167,   1673,   1140,    -29,
-      -689,     81,    909,   -455,   2979,     44,      1,   -260,
-        26,     28,    -90,   -568,   -123,   -175,    232,    -38,
-      2372,    111,    312,    529,    -65,    331,    100,    488,
-        12,   -596,   -497,   2311,  -1097,   1242,    -94,  -2290,
-      -158,  -2651,     16,   -232,   3352,     24,    -53,    -83,
-        -5,    -52,    205,   -104,   -294,    217,   -196,    -37,
-        -7,      0,    -28,    -45,     60,     13,     41,    111,
-       142,  -7331,    -40,   -200,     18,   -166,  -1266,    -47,
-      -250,   -592,   -604,     33,     83,   -204,  -1131,   -166,
-      1348,  -1337,    184,     50, -10066,     30,     24,   -184,
-       137,     53,     32,     87,    -27,    151,    100,     10,
-       -47,     28,   -138,     12,  -2977,   -376,     58,    168,
-      1642,    144,   1039,   -399,   -807,      5,  -1715,     12,
-      -142,    -77,   -306,    758,    674,    -82,   3216,   -369,
-        60,    480,    276,   -423,   5102,   3325,    169,     47,
-       235,     37,     81,    -86,    -28,    -56,    -59,   -205,
-      -126,     28,    279,  -8433,    137,    -26,   -409,    -19,
-       106,   -163,    -76,    -57,    235,      7,    131,    -81,
-      -197,   -318,   1281,    310,  -2934,    972,  -1335,     35,
-      -308,    -93,   -128,    433,    527,   -193,  -1303,    162,
-       -34,    -87,   -157,    262,   4999,     25,   -311,   -349,
-        94,   -262,      0,   -219,     57,     12,     -4,     10,
-       -17,     38,   -320,     48,    156,     80,   5880,     48,
-        45,     31,  -1022,     31,    227,   -727,   -135,    261,
-       -21,   -688,    307,   3196,    565,    627,   -546,    237,
-     -2367,    -33,   1622,    -87,   1722,   -201,    720,   -539,
-      -288,  -1012,    141,   -388,    -72,    -20,    -59,  -2042,
-       -53,   -101,    208,   -233,   -835,    -16,   3092,      2,
-       310,     94,   -362,   -163,   -128,     30,    -22,   -145,
-       420,     -1,    322,   -524,   2742,   -276,    206,  -2475,
-       575,   -653,   -342,   1412,      1,     75,    -14,     54,
-       170,     66,    342,   -261,    709,    -75,   2240,   -134,
-        32,    665,    171,   -134,   1822,    109,    569,   3129,
-       168,   -356,     53,   1259,    -67,     43,    120,   -124,
-      2185,   2461,    -17,   -255,   -349,   -167,   -158,    -19,
-        84,   -732,   -972,    286,     87,   4603,   -160,      7,
-       141,      1,    286,    310,   -315,    -99,    282,    384,
-        68,     93,  -1815,     63,    -86,    121,   -293,    210,
-       115,     63,   -174,    616,  -1848,   -124,   1275,    298,
-       185,   -267,   3516,   -105,   -162,   -253,   -434,   -674,
-       -90,  -2232,     38,    168,   -261,    289,     70,   3714,
-      4096,    -81,     17,     56,     57,     68,    -20,   -146,
-        28,   -152,    -17,    -97,   -131,   2648,     71,  -3359,
-        40,   -277,    313,     85,    -26,     41,   -202,     76,
-         8,    -80,   -160,   -102,    -17,    155,    189,   1552,
-     -3498,   -446,   -103,   -232,   -205,   -574,   -132,    169,
-       206,   1689,   1043,   -736,   -178,    -93,  -2969,     26,
-      -251,   -148,    139,     70,   -325,    117,  -3073,      9,
-        43,    -11,   -380,   -190,   -314,  -3012,     50,   -330,
-       -26,    710,    153,     19,  -2943,     58,  -3052,    -56,
-         7,     40,      9,    321,    -37,   -461,    -22,   -374,
-        57,   -203,     16,    -15,    -25,    -16,    -37,     -8,
-       -41,   -116,   7964,     70,    -59,     77,    200,      0,
-       -43,    118,    -72,    -67,    104,     -6,     78,    171,
-        13,   -103,    793,     98,  -4738,   -204,     11,     30,
-       -72,     33,    -62,     47,    157,    236,   -147,   -416,
-      -726,    578,      5,   4038,    162,     -2,   2367,   -138,
-      -185,    470,   3121,     70,    185,    -22,   -205,     37,
-       -63,   -335,   -397,     43,     10,  -6557,   -112,   -254,
-       106,   -129,   -236,      0,   -250,     42,   -128,     84,
-      -531,    -27,   2259,   -282,    -21,    -70,   -408,     19,
-      -664,    945,   -196,  -1074,   1369,    -40,  -3233,     28,
-        20,  -2133,    125,    343,    113,    584,    -14,     50,
-      -130,   -464,    513,    807,  -4474,    -63,     57,   1120,
-        64,    -30,    346,    462,    129,    219,    -30,    287,
-       448,    384,    198,   -359,   1097,   -256,    828,  -2635,
-      -314,    336,    506,   -144,    194,    167,   1323,   -273,
-     -4168,   2805,   -118,     -8,    136,    -82,   -212,     53,
-      -259,    -61,     94,    214,     11,     29,   -262,    -69,
-        24,    102,     45,    -31,   -186,     58,    641,    659,
-      -172,   3628,   -192,   -423,     34,      3,     45,     19,
-       349,    117,     -5,  -4923,     99,   -148,    180,    631,
-        50,   -204,    641,    -92,    156,  -1985,   1077,    201,
-        56,   -405,    710,   -220,  -1917,   -273,   -234,    100,
-};
-
-static const int16_t cb2224sl0[] = {
-     -3113,     97,    229,    309,   -156,   -226,   -469,    582,
-     -3202,   -336,    102,     20,     96,   -960,    297,   -227,
-       592,  -3352,   2798,   -637,   -133,    191,   -407,    170,
-      -576,   -203,   -280,    808,    853,   -502,   -113,  -1704,
-     -1025,    411,   2802,    233,   -568,    360,   -616,  -1715,
-        47,    391,  -2117,   -458,   -291,   -149,    -82,     26,
-       -29,    -88,   -156,   7905,     32,    -75,   -154,    -78,
-       -44,    155,     -1,   -338,   -891,    170,    -75,    155,
-       226,   -192,   -328,   -239,   -574,    -91,     95,   -600,
-      4271,     25,    990,   -207,   4676,     59,   -324,    884,
-       363,     65,    423,   -776,   -906,    -79,     -4,   1475,
-       549,   -252,   3584,   3543,   -409,    282,    278,    125,
-      -379,    125,   -180,   -123,   -252,   -316,   -193,    347,
-        53,   2009,    195,    152,   -104,    233,    -75,   -546,
-       564,   -177,   3243,   -865,   -924,    518,   -692,   -381,
-     -1885,   -110,   -188,   1140,  -2043,   -438,  -1721,   1019,
-      1678,     13,    273,   -751,    922,   -291,    -15,     75,
-       232,   -112,     60,   2702,     88,    175,   -119,     43,
-      -549,  -1094,  -1879,    401,   1587,   1287,    -41,     41,
-      -116,    -23,    313,    168,    147,   -101,    -57,   -115,
-     -6990,     54,    -14,   -240,   -164,    127,     25,   -703,
-      -361,    769,   1555,  -2440,  -2616,   -192,     86,    769,
-       -29,   -721,    554,   -663,    327,    659,    -31,    -79,
-        91,    365,    -74,   1268,    115,    480,   3054,  -1758,
-      1704,    759,   -657,   -272,   -329,     31,   -145,   -534,
-      1265,     73,    435,    -54,    480,   -867,   2724,   2373,
-       890,   -314,   -112,  -2576,   -598,    473,    121,   2764,
-      1659,    105,    579,   -416,    -87,    158,    300,    447,
-      -281,  -6109,     35,    217,    185,     56,   -357,    151,
-       108,    -49,   -282,   -484,   -220,    -78,   -141,    256,
-     -1095,   1812,   -985,   1115,    555,  -2116,   2317,  -1141,
-      -792,   -866,   -119,    187,    615,   -194,     73,    -43,
-       268,    437,    250,    -52,    477,   -249,   -475,  -2621,
-       590,  -2987,   -603,   -652,    971,   -684,    337,   -140,
-      -336,   2342,    390,   -204,    295,     85,    -44,    321,
-       754,   2660,     61,    782,   1654,    -76,   2727,   1590,
-     -1099,    354,     49,   2784,    443,   -762,    828,   -308,
-      -493,   -755,   -370,   -336,   -207,    388,    630,   -127,
-      1955,   1929,   1270,   2054,    525,    388,    562,    942,
-      -789,   -453,    158,    995,    -99,   2258,   -317,   -493,
-       385,    -90,    -79,    199,  -1187,    519,   -254,    179,
-       573,   2803,   2341,    407,     95,    515,    332,      1,
-        -6,   -337,    142,   -316,    418,    542,   3281,     10,
-       604,   -542,  -1595,     43,     79,     10,     75,   -122,
-       100,    -55,    212,   -223,   -353,   -557,    490,   4870,
-     -3689,   3594,   -145,   -192,    -47,   -252,   -380,   -180,
-      -221,    656,     78,   -188,    120,    135,   -253,   -437,
-      -208,   -151,   -504,    217,  -3715,   -150,    528,    121,
-     -1468,    383,    823,    -55,  -1167,     -8,   -198,   -515,
-      -296,    -24,     84,    129,   -472,      7,   5071,   -114,
-      -200,    -16,   -271,     59,   -430,   -142,   -315,     90,
-       273,    -56,    370,   3342,   -159,    235,    934,   1605,
-     -1499,    207,  -1650,   1137,    396,  -2250,    276,   -320,
-      -317,    -23,    276,   -519,    163,    566,    366,     -6,
-      2262,  -2035,   -662,  -3300,   -133,  -3811,   -362,   -348,
-       113,    146,    -79,   -298,    238,    221,     99,    194,
-       326,    325,   -112,  -8160,    -59,    -15,      8,    -41,
-      -261,    -20,     -6,    -68,   -140,    -41,    167,   -125,
-       129,    337,   2404,    281,   -336,   -475,   2085,  -2646,
-       572,  -1308,    376,    114,   -506,   1062,   -575,   -529,
-      3347,   -212,    520,    274,   -163,  -3058,    -93,   -203,
-      -932,   -207,    -36,    303,   -117,    278,    287,    204,
-       205,   -228,   -242,    227,      3,    611,   -190,   -458,
-       -44,   -209,    122,   -390,  -4561,   -139,   1378,   -329,
-       440,    989,  -1782,   -348,   1241,    967,   -477,  -2312,
-       554,   -970,  -1103,    473,   -771,    -50,    150,    327,
-       394,   -267,   -648,   -680,   2376,  -2543,    276,   1220,
-       552,     10,   1399,  -1498,   -801,      9,   2351,    -55,
-       155,    327,     88,    864,    428,    179,  -3234,      6,
-       544,   -647,   -306,    132,    329,   1147,   1920,   1436,
-     -2107,  -1122,    341,   2020,   -432,    -97,    117,    793,
-       100,   -693,    174,   3639,   -570,    910,  -2771,    231,
-      -148,   -960,  -1085,     57,    188,    744,   -709,   -441,
-       533,   -295,   1287,   2939,   2987,    885,    611,    700,
-       364,   -205,   -855,   -617,     48,   -162,   -244,   -318,
-       208,    772,   -124,  -2505,    454,    330,   -220,    335,
-      -362,   -899,   -827,   2188,    -40,  -1638,    356,   -160,
-      -127,   2886,    -69,    -41,    209,   1847,   -236,   2752,
-       -24,    387,    354,   -111,    526,   -237,  -2169,   1319,
-      2211,    144,   -348,   -434,   -319,   1373,     78,    906,
-       701,    539,   -134,    414,    496,   -325,    -36,    116,
-       124,   4198,    -35,   -439,   -208,   -531,   -100,   1453,
-      -175,    723,   -908,   -461,     87,    127,    -91,   -125,
-      -140,   8012,   -186,     23,    -93,    107,    176,    218,
-        35,    193,    174,    -27,     -4,     77,   -103,   -199,
-       116,    -41,    -80,    186,  -6965,   -188,    125,    -54,
-        43,      9,    -49,   -192,     69,   -136,    -24,   -117,
-     -2244,   2289,    145,    226,  -1161,  -1950,    881,   -152,
-      1611,   1015,   -174,   -277,   -158,    369,     49,   -233,
-       221,    275,     69,    108,    136,   -124,      1,   -470,
-       376,    149,  -7596,     55,     53,    213,   -247,     80,
-      -217,    -11,    189,    125,    -17,   -141,    165,  -2890,
-        14,    201,    106,    242,   -254,   -306,  -3157,    459,
-       -10,     24,   -271,    877,    437,   -438,     18,   -126,
-        -9,   5553,     63,     22,     55,    172,     21,   -335,
-       127,    160,    208,    121,     13,   1989,    676,   -294,
-      2208,    -78,    634,  -1518,  -1037,   1309,    124,    -39,
-      -322,  -1420,   -404,    377,    -35,    -14,    178,    110,
-     -8146,     26,    -98,   -153,   -243,    145,    280,     -8,
-        29,    -57,     85,   -309,    281,    282,    -47,    -27,
-      2827,   -947,    141,    856,  -2481,    406,   -638,   -362,
-     -1031,    230,   -341,   -119,    -17,      1,    190,     41,
-       -15,   5111,     59,     74,    123,   -282,    -25,   -300,
-         4,   -460,   -216,    295,   -217,     26,    227,     62,
-       385,    748,   2923,   1946,    391,  -1676,    599,    148,
-      -456,    -96,   1066,    478,    117,    255,   -169,   -669,
-     -1939,   -656,   2676,    677,  -2020,  -1314,    425,   -525,
-       -89,   -522,   2707,    153,      5,   -207,    244,  -1045,
-       331,  -1315,    -82,    449,  -2444,    326,   -484,  -2232,
-      2380,   -591,   -999,  -2552,  -1581,    349,   -440,    217,
-       298,   -729,     -6,   -396,    -74,    110,    -70,  -3543,
-      -388,    -51,    596,    126,    295,   2075,   -123,   -693,
-     -1072,  -1779,   -420,    127,    432,  -3241,   -231,   -246,
-       105,   -437,    -67,   -119,  -2941,   -257,     47,   -969,
-       379,    618,    -93,      7,    202,   -425,    -38,    140,
-       458,   3599,    242,    -24,   -811,   -624,    -19,    524,
-      2398,   -300,    111,    376,   2015,    431,    125,    231,
-      -293,  -2379,   -634,   1842,     -1,  -1326,   -610,    -88,
-       128,     80,     75,     30,    172,   -235,     34,    206,
-       -79,    328,    128,   -283,  -6862,   -101,    260,     68,
-};
-
-static const int16_t cb2224sl1[] = {
-     -3710,   -340,   3183,    200,   -124,    423,   -417,   -432,
-       232,   -808,     85,   -145,     39,    196,   -197,    -60,
-      -154,   -213,   -320,  -2941,    993,   3044,   -508,     61,
-      -853,     75,     40,    873,   -765,   -365,   -621,  -2670,
-       188,     57,   -403,   -230,   -137,     40,    565,  -1910,
-     -1120,  -1019,   -603,  -1927,    150,  -3089,     23,   -416,
-      -199,  -3265,     15,    128,   -525,   -531,     91,    -39,
-       578,   -388,    315,     40,   2376,   1762,      2,  -1475,
-     -1774,    111,    934,   -459,    777,   -582,    114,   -218,
-       -82,   -195,    165,   2171,    632,    -67,    239,    345,
-      -257,    104,    -34,   -879,    488,   -422,  -2156,   -823,
-      1940,    699,   2911,   -233,   -125,   -218,   -111,   -335,
-     -3475,    -61,    -71,   -445,    249,   -330,    102,    376,
-      -116,   2667,   -453,     19,  -4129,     90,   -507,    236,
-       418,     43,     79,     61,    296,    181,    190,    408,
-       216,    198,     32,    -81,    245,   -157,   5555,   -162,
-       318,    179,    339,   -463,   -448,   -254,   -526,   -192,
-      -427,    575,    588,   2792,   2683,   -853,   -566,     19,
-       -26,    106,   -220,    518,    734,   -233,     68,   -604,
-      -231,    256,   -187,    -59,   -405,    206,    331,    -25,
-     -4837,   -323,    146,    541,    723,    915,   -144,    450,
-       102,   -371,     27,     88,    -80,    276,    239,    101,
-       157,    -69,    -14,    234,  -8192,    -18,   -110,    -52,
-        -8,     48,     79,    -43,    153,    187,    211,   -118,
-      -111,    238,     11,  -2006,    680,    478,   -695,   3078,
-       -30,    892,    -23,   1512,   -194,    423,    -16,   -318,
-       895,    406,    634,     47,  -3277,   -205,   -764,    297,
-      -357,    -61,   -188,  -1547,   -868,   -174,    342,    261,
-      1926,     88,    -35,  -3250,    -20,   3168,   -368,    778,
-       376,    167,    598,    442,    134,    487,    164,    -32,
-       245,    436,   2067,    595,   -578,     49,   -163,    633,
-       138,   -279,    -99,    118,   1141,  -3168,    580,    -90,
-     -3192,    551,   -663,  -2673,    -55,    147,   1307,      9,
-        15,    432,    307,    527,   1002,   -469,  -2380,   -342,
-      -293,    -73,   -259,    410,    309,     76,   -320,   -161,
-       282,  -3300,     -7,    160,    732,    484,    -65,    147,
-      2923,   2321,   -840,   1933,    268,    684,   1172,   -377,
-      -365,   -568,   -283,    492,   -538,    409,   -194,     17,
-      -297,    -52,   -123,   -270,    161,    -94,     92,   4495,
-      -396,    540,    229,    -30,   -108,     29,      1,    198,
-       492,   -572,   -394,  -2386,   2787,    885,  -1175,   -129,
-     -1137,    220,    148,    261,    -65,   -244,      1,     58,
-       195,    -49,   -290,    -94,    -21,    105,     71,   6641,
-      -200,   -407,   -496,    -75,    233,    222,    549,    363,
-       188,    739,   -869,    122,   -355,   3326,    323,  -2366,
-       115,  -3207,   2783,   2015,    148,    924,   -153,   -133,
-      -175,   -287,    400,     73,   -181,   -174,     72,     45,
-       219,    -92,    -11,     59,  -5407,   -362,   -188,   -120,
-       239,    249,    133,   -229,    158,    180,   -575,  -2386,
-      -354,    248,    532,   -590,    615,    -85,    -69,    394,
-      3052,   -877,   -320,    484,    218,   -463,   -202,   -841,
-      1729,    284,   1253,   2193,    526,  -2444,   -351,   1287,
-      -373,    387,    440,   -203,    163,   -153,    206,    -57,
-       -96,   2616,    -84,    552,     33,    705,   -731,   -843,
-     -2197,  -2138,   -570,     22,   -264,   2143,    725,   -132,
-      -392,    471,   -245,     51,    739,  -1057,   1049,   -760,
-      2701,    456,     20,    484,    595,   3248,  -1415,   -862,
-       332,   -417,    323,   -431,   2082,     78,    684,   -169,
-       596,   -228,   -219,    172,    160,   -180,   -228,  -3193,
-      -520,   -100,   -447,   -629,  -2178,   -259,   -246,  -1788,
-     -2264,    223,    115,    -74,    230,  -2515,    212,   -179,
-       456,    209,  -2379,   -246,   -345,   -102,   -559,    259,
-      -270,   -426,    333,   -358,   2866,   -589,  -1494,   -418,
-      -160,   -138,   2088,    683,  -1313,   1061,    -88,    916,
-      -148,  -2329,   -301,   -271,   -249,   2822,   -525,   -405,
-       592,   -322,  -1328,    -16,    135,   -582,   -676,   -503,
-     -2162,   -327,   -237,    361,    166,    600,   1176,   1015,
-        97,     -5,    465,   2321,  -4544,    202,   -350,    313,
-       149,    544,   -420,    552,    183,    351,  -1663,    688,
-       238,    587,    907,  -1719,   1267,  -2325,    368,    236,
-       296,  -2608,    240,    997,    496,    105,     75,   -179,
-       235,    125,    -40,     57,    -22,   -412,   -464,   -494,
-       -81,    576,  -3461,  -1037,   -744,   1358,   -856,   -284,
-      -536,    387,   -358,    184,    -85,   2150,  -1142,   -124,
-       119,   1242,    648,    711,   2161,   -591,  -1864,   -672,
-        62,   1879,    -13,     55,    285,   -167,    142,   -130,
-       322,      8,    -35,   -230,    632,   -699,   4114,   -500,
-      -189,    -48,   2746,     47,    421,  -1200,   2418,    460,
-      -306,    331,    164,  -1358,    802,    453,    458,   3594,
-      3065,    -24,   -134,   -437,   -892,   -110,    241,   -368,
-       336,    673,   -147,    130,    154,     89,     81,   -341,
-      7151,    175,    118,   -227,   -282,    262,    276,   -118,
-      -118,   -245,      7,    144,    -87,   -136,   -146,   -484,
-        70,    221,   -220,    -13,  -7638,     93,    -38,   -319,
-      -478,     26,    -28,    281,   -180,    182,   -186,     90,
-       192,     50,  -2919,    153,  -2651,    289,     47,   -783,
-       768,    384,     39,    194,  -2358,   1242,  -1679,     80,
-      1292,     28,    682,   2807,    342,    466,    299,   -380,
-       376,   4466,     12,    553,    153,   -447,    733,     99,
-         8,   -142,    606,  -2364,    168,    167,    -62,    404,
-     -3144,    352,    115,  -3734,    360,   -202,   -462,   -196,
-       464,   -412,    192,   -363,   -413,   -405,    254,    357,
-     -2801,   1054,  -1602,    642,   -254,   -430,  -2259,    -97,
-        16,   -311,    757,    -64,    412,    339,   -227,   -216,
-       -29,    219,     67,     63,     26,   -232,   -138,   -301,
-       241,    -52,  -6118,    223,   -379,   -157,   -221,   -201,
-       -93,  -5630,   -286,   -194,    133,     46,    151,    444,
-      -472,    103,   -115,   -259,    -53,    673,   1744,  -2374,
-       359,   2541,    613,   -393,   1235,    221,   -117,   -842,
-      1166,    105,   -142,   1426,      3,   -423,     36,    398,
-     -2742,    723,   -740,    985,    498,    431,  -1312,    832,
-     -1644,    146,    -69,   -110,    420,   -130,    335,    269,
-     -2865,    -67,    -88,     50,   2735,   1038,    973,    371,
-       654,   -169,   -112,    579,   -319,   2434,   -760,    710,
-       241,  -1889,     39,  -1807,    -30,   1383,  -1080,    449,
-       639,  -2478,   -760,    559,    298,     56,   -421,    818,
-      -442,   1558,  -1610,   2136,    -12,    -11,    592,     73,
-        77,   -172,     77,     92,   -113,    281,    581,   -584,
-     -4448,    507,   -195,    183,   -508,    312,   -724,   1043,
-       -18,    -10,   -776,   -534,    249,  -3178,    904,   1234,
-      -482,    382,  -1040,   -448,   -579,    227,    -82,   5628,
-      -165,    255,    109,   -141,      7,    -28,     63,     93,
-      -211,      0,    162,    581,   -153,   5844,    -66,    122,
-      -102,    -90,   -205,   -181,    243,    312,    111,   -435,
-      -105,   -343,    272,   -141,      6,    -98,    -16,    -73,
-       -26,   -125,  -7627,    -73,    -66,    108,   -175,    186,
-      -189,   -102,   -240,    -37,   -354,   -260,   -120,     30,
-        87,   2560,   3157,    369,   -662,    338,   -503,    -66,
-     -1405,    178,   1100,   -683,  -2618,   2459,  -1291,   -248,
-      -139,   -683,   -865,   1445,    165,    368,    507,   -585,
-};
-
-static const int16_t cb2224ss0[] = {
-     -6880,    657,   -621,     69,    219,   -588,    681,    229,
-       248,   -302,   -110,    734,     12,    253,   -454,   -890,
-     -3596,    778,  -2600,   -256,    529,    332,    -69,    295,
-      -455,    982,   -265,    -70,   -332,   -367,   1494,    586,
-      -158,  -1054,   2529,   -313,   -661,  -1302,  -2486,    476,
-         5,    126,    581,    361,   1618,    650,   2033,    202,
-        76,   -265,   -161,   3659,   -800,   1069,   -167,  -1792,
-       389,   -580,    597,   -268,    621,  -1035,    710,    854,
-      2004,   -785,   2714,   1659,    785,    800,    -80,      9,
-      -341,  -1032,    789,    651,   1068,   -609,    661,    747,
-      -928,   -999,  -1369,  -1173,   -416,   1596,  -2800,    330,
-       546,  -1275,   -746,   -392,   -529,   -378,   3571,  -2795,
-      -731,   -183,   -330,  -1591,    371,    866,    323,   -516,
-       -89,   2277,   1593,    960,  -1726,  -2229,    727,   -415,
-       189,    500,   -145,   -177,    550,    467,    240,   1131,
-       474,   -419,  -1236,    674,   -616,   -519,   2439,  -1213,
-      -650,    867,    974,   -908,   1229,   -512,    932,   -495,
-     -2521,   -865,   -466,      8,   -426,    912,    -77,   -236,
-      -407,    433,    128,   3653,    854,    243,    770,    191,
-       224,    -68,   -453,   -383,    279,   -701,   -691,    282,
-      -449,   1148,   -783,    241,  -5021,    643,   8113,   -345,
-        13,     90,    -57,    475,     64,   -268,   -163,   -100,
-       -95,    518,    577,    541,   2055,    358,   -157,    360,
-       280,   -840,  -1161,    500,     95,    302,   -662,   1134,
-       827,   3300,    695,    775,   -798,  -2651,  -2891,  -1123,
-       555,  -1125,    156,    328,    671,    751,   -347,   -972,
-      -392,  -1216,   2725,  -5152,   -402,    -15,    150,     31,
-      -182,   -278,    245,     81,     -3,    -46,    310,    -72,
-      -138,   1511,  -1762,  -1840,   -364,    123,   2801,    -16,
-      -543,  -1312,    562,   -262,    148,    521,   -711,     61,
-      -863,    145,    329,    761,     76,   -155,    101,  -4986,
-       192,    269,   -364,   -174,    640,   -261,    629,   3638,
-       397,  -1757,  -1177,    342,    388,   1089,    824,    115,
-       150,    125,    806,   1271,   -198,    800,   -175,   -897,
-      -649,   -837,    690,   -755,   1416,  -2347,   1179,   -781,
-       826,   1567,   -148,   -156,  -1036,  -1572,   1248,   -187,
-       464,   -260,   -749,  -1070,     85,   -466,  -2160,  -2802,
-       233,   -181,    447,   -482,    113,    548,   2957,  -1600,
-      1341,   -559,    803,   2085,   -807,   -711,  -1169,   -456,
-       657,    -76,   -147,   1932,  -1054,   -967,  -1100,    -49,
-     -2829,   1412,    929,   1207,     58,   -146,     77,   -458,
-       538,   -627,    -12,    214,  -2397,    692,   1284,    366,
-      1286,   1997,   -856,    267,   1866,   1236,     25,    254,
-     -1187,   3456,    283,    584,   2348,    604,  -1130,      7,
-       500,    232,    -51,    120,   -695,   -930,    317,     67,
-     -1346,   -500,    312,  -1060,  -2338,  -1860,  -1491,   1539,
-     -1707,    778,   -653,    -41,    401,    311,    -13,   2155,
-     -1011,   1163,    712,   2090,   1336,   -726,    574,   1200,
-     -1254,  -1567,    723,    683,   -877,   -653,   1137,  -1594,
-      1127,   2641,    465,    259,  -2095,    696,   -405,     40,
-      -259,   -808,   -942,    395,   -180,  -1119,   -966,   -230,
-      -534,   -114,     88,   -661,    757,     75,   -286,   -119,
-       924,  -2925,   2483,   1662,   1823,    590,   4307,    810,
-       447,    165,    243,   -184,   -162,    436,   -126,   -194,
-       365,    601,   -354,  -1983,   -211,   -663,    276,    155,
-      -696,  -2542,   -830,   2374,   -235,   -585,   -469,   -478,
-        21,    867,  -1633,   1949,   -949,   -330,   -546,    328,
-      -224,   1236,    266,  -1117,     36,    -61,    221,    153,
-     -3491,  -1463,   -237,   4676,   -241,    273,    268,    347,
-      -393,   -277,    168,    426,    155,    -65,   -605,   -569,
-     -1416,  -1303,   1248,    595,   -148,    512,   3622,    291,
-      -444,   -523,    616,    105,    101,   1357,    772,   -337,
-       494,    570,     15,    150,   -400,    572,    590,   1674,
-     -4106,    940,    167,   -327,   -336,    696,    591,    362,
-       279,   4489,  -1325,    608,    294,    -41,    549,    982,
-       -31,   -184,    367,     77,   -466,    398,  -1928,   -607,
-       239,     55,     15,   1031,   -486,   2788,   2151,   -519,
-     -1197,  -1144,    274,    671,   1620,   2079,  -1555,   -961,
-       543,    -11,     26,   -627,    777,   -581,  -1060,  -1177,
-      -808,    807,   2863,    607,    144,    195,   -274,     18,
-     -5656,   -355,  -1026,     56,    116,   -431,   -493,    517,
-       286,    353,    353,    199,   -651,   -863,   -276,   -556,
-      -562,   -867,   -143,   -355,   -323,    -14,    -54,  -5354,
-       -43,  -1592,      8,   -543,     24,     94,   -731,   -545,
-       705,   -171,    504,  -1078,  -3367,   1349,    452,   -148,
-      1183,  -1650,  -1400,   -246,  -1032,   -119,   -309,   -566,
-       998,  -3240,   -444,   -658,   -605,   -186,    491,    439,
-      -190,    688,    -29,   -965,   2562,   -112,   -329,    -25,
-     -2593,    355,    -53,    692,     12,   -593,   1930,   -804,
-       -82,    386,   -632,    927,   1006,   -229,  -1147,   -181,
-     -1075,   -245,  -3678,    904,   -298,   2263,     50,    563,
-       337,  -1051,    173,    310,  -3540,   -615,   -504,    749,
-       192,    -90,   -113,   -730,  -1994,    802,    -45,   2234,
-       167,    289,   1722,   -562,    682,    453,   1571,    171,
-     -2429,   -441,   -230,  -1144,    985,  -1602,    358,   -685,
-       -23,   -523,   -529,  -2438,    700,   -624,     37,  -1475,
-     -1318,   3292,    702,    394,   -798,   2563,   1057,   -335,
-       614,    270,   3135,  -1281,  -2089,   -250,   -140,     45,
-      -517,   -470,  -1429,   -172,   2637,    267,     55,  -1037,
-      -174,    912,   -865,   -786,   -406,    537,  -2805,   -642,
-     -1599,    888,  -1044,   -175,    312,     28,  -1157,   -240,
-      -181,    298,    521,   3802,    -87,     93,     48,   1336,
-     -1071,  -1870,    339,  -1106,   -944,  -1036,    361,  -3719,
-      -147,    625,    326,   -122,    407,   -217,    396,    273,
-        -2,   -315,   -262,    632,   6868,    228,   -267,    207,
-       -29,   -274,    192,     63,   -353,    588,    550,     -3,
-       156,   2115,   1580,  -2366,    306,    633,   1354,   2313,
-      -360,   -345,    270,   -499,   -976,  -3685,  -1305,    907,
-      1431,   1545,  -1334,     18,   1159,    229,   -124,    157,
-       470,   -105,    700,  -1786,  -1895,    795,  -1052,   -278,
-       745,   -111,    -45,    694,    599,  -3469,    552,    -70,
-      -222,     45,    896,   -251,      1,    250,   -769,    301,
-     -1151,   1313,   4314,    710,    680,   -169,   -663,     40,
-       399,   1171,    581,    775,    936,   -488,  -2918,    155,
-      -169,  -1560,   -862,   -473,    783,    -72,  -1791,    567,
-     -2109,   -156,   1250,  -1486,   3253,     61,    -50,   -374,
-      -277,    942,    111,    607,   -316,    197,   -748,    871,
-       612,   -242,   -296,     53,   -193,   1233,     11,   -962,
-       505,  -4492,     21,    754,   -150,    451,    183,    881,
-      -652,   -159,   6384,    170,    271,   1035,    401,     48,
-      -463,   -240,    -95,   -625,    613,    -91,  -1138,   1172,
-       542,  -1483,  -2638,  -1396,  -1173,    612,    512,   1355,
-       977,   -362,    -22,    -17,    124,  -3178,   -532,    352,
-     -2691,    610,    569,    740,  -1603,     -5,   -492,    704,
-      -436,    -96,   -595,  -1495,   2730,  -3089,   -164,    565,
-      1300,   -477,   -569,   1069,    294,   -233,   -133,    708,
-       150,    388,  -2108,  -1042,  -1603,   2275,  -1722,    561,
-       140,    507,   -899,   -281,    162,  -1297,   1504,   -158,
-       193,   -730,   -944,  -2484,    615,    -30,     32,   -354,
-      -383,     86,    329,  -3434,   -382,  -1604,   -299,    208,
-};
-
-static const int16_t cb2224ss1[] = {
-      8192,   -187,   -471,   -201,    185,   -465,    976,    257,
-        83,   -530,    310,    676,    341,     48,    265,   -351,
-       306,    280,    302,     48,    496,   -339,    424,  -5250,
-      -253,    604,   -317,   -289,    278,    573,   -579,     79,
-      3218,   -574,   -377,    276,   2831,   -287,   -254,    332,
-      -225,     42,    162,   -457,   -959,  -1421,    683,    -59,
-       -33,   3362,    393,    606,    249,   -873,   -930,   1224,
-      1469,     37,  -1592,   1665,   -582,   1729,    284,    106,
-     -4753,   -120,   -475,    867,   -444,   -203,    431,    -11,
-      -526,   -324,    732,  -1070,   -160,   -611,   1808,   -297,
-      -536,   -194,   -822,   1224,   2220,  -2330,     72,   1004,
-      -787,   -149,    557,   2925,     29,    809,   2397,  -1143,
-       648,    904,   -568,   -707,   -839,   -274,  -1322,   1177,
-      -467,   -482,  -5181,    234,    223,    354,    386,    737,
-      1273,    234,   -353,     31,     -8,   -392,     85,   -234,
-      1366,   1449,    120,   -695,    838,   -622,    -96,    382,
-     -1421,    612,   -173,  -3199,   -150,    474,   -394,   -561,
-     -1171,   2541,   -271,   2513,    670,    285,    636,   -452,
-      -202,   1319,  -2182,   -935,   -586,    243,   -813,    -41,
-       -53,  -1041,    212,     58,  -3424,    111,    268,    964,
-     -3231,   -500,    867,   -191,    207,    543,    383,  -1509,
-     -2712,  -2752,    201,    428,    721,    498,     19,   -747,
-        67,     87,    500,   1200,   2244,  -1158,    466,  -1032,
-      -153,   1197,   2737,   -324,   2002,   -338,     89,   -428,
-        78,    575,    330,   2013,    175,    305,    567,   -539,
-        17,    384,    485,    860,   3330,    173,    586,    649,
-       388,    963,   1820,  -2610,    251,  -2966,   1383,   -153,
-      -146,    564,   -718,    998,  -1283,   -566,   -619,    394,
-       459,  -1233,   2566,   -357,  -2601,     98,   -929,   -367,
-      -501,     96,   1217,  -1695,   -324,    393,    261,   1745,
-     -1095,   -751,    924,   1044,   -337,  -1243,    393,   2454,
-     -1499,   -245,    902,    925,  -2126,    167,    838,    638,
-      2296,   -294,    306,   -715,   2794,   1522,   -339,     21,
-       318,    -95,   1334,     75,   -173,    -91,  -2012,   -920,
-      -801,    334,  -3363,   -348,    550,   -911,   -261,  -1073,
-       185,   -425,    431,    515,   -339,   1817,  -1589,    241,
-       548,   -337,   -471,  -3532,  -1166,    888,    141,   -277,
-      1353,    310,   -654,    198,   -516,   2951,   2251,   -534,
-       701,    237,     20,   -597,   -301,      3,    410,   -456,
-      -581,  -1254,   1052,   1321,    165,   3108,    477,    196,
-      2716,     85,      5,    -34,    721,   -562,      4,     84,
-      -793,    744,    243,    134,   -385,   -129,   -122,   -128,
-      -333,   -483,   -604,    269,   6209,      3,    515,    -63,
-      -634,   -551,   -795,  -1696,  -2210,   2184,    348,     30,
-       413,   2531,    214,    214,   -186,    -72,   -552,    958,
-      1727,  -1639,    618,    -61,   -432,    365,   -753,     15,
-       -14,     33,    976,   -940,   -355,   3318,    677,  -1938,
-        21,    881,   -326,    -83,  -3355,   1483,  -1211,   -674,
-       166,    139,   -276,    158,   -736,   1038,  -1005,   1129,
-      1219,   1115,   -392,    558,     96,   -188,    314,    536,
-      -423,  -3262,    395,   -130,   1099,    304,   -181,    853,
-      -160,  -1272,    428,   -179,    634,    608,   -173,   2690,
-     -2191,   1385,   -518,   -416,   3239,   3250,    313,    -23,
-       200,    643,   -639,    -17,   -208,     27,   -182,    262,
-      -203,   -671,    157,  -4131,    383,   -404,    337,     51,
-       431,     92,    138,   -438,     29,    337,    488,   -252,
-       656,    509,   2037,   -635,  -1074,  -1115,  -2135,   -772,
-      -386,   -214,   -654,   -441,   1661,    542,   -383,  -1720,
-        22,   -103,  -1474,  -1288,   4361,    282,  -1252,    734,
-      -858,   -556,    294,    243,    293,    133,    848,     65,
-      -727,   -887,  -1314,    443,    -96,   -422,   4268,    672,
-       142,    608,   -442,    843,    365,   -866,   -157,    780,
-       107,   -888,   2089,   1769,     73,    739,    -15,  -1730,
-     -1235,    920,  -1713,    163,    552,   1479,   -692,   -755,
-      1430,   -193,   -276,   -264,   -690,    772,   1403,    -40,
-       679,   -260,    642,  -3562,    962,   2053,   1348,     36,
-     -2974,    155,    303,    821,   -944,   -179,   -967,    632,
-      -725,    411,   -447,   -463,    694,   -337,   -146,     59,
-        -1,   -416,     12,    524,   -497,  -4682,   -745,    625,
-      1011,     20,   -462,   -503,   2012,   -475,    -27,     85,
-     -1190,    534,   2250,     87,   2591,   1195,   1665,    423,
-      -813,   -571,   -372,   2601,  -2013,   -853,   -734,   -403,
-       793,   -549,   1243,    312,    722,  -1013,  -1434,   -749,
-      -571,    494,    -88,   -129,   1331,    806,  -1227,    326,
-     -1164,   2487,    -59,   2346,    583,    519,    368,    793,
-      1178,    661,    140,   1226,    378,   -429,  -1214,   1438,
-      -319,    -77,  -1495,   3598,    361,     21,     39,   1930,
-       198,   1050,    531,    274,     32,   -499,   -349,     -5,
-      -133,  -3324,   -379,   -742,   -250,  -1618,  -1536,   2084,
-      1369,    765,   -132,   -324,    406,  -2198,    314,    502,
-     -1431,    759,   -729,    320,  -2120,   1484,   2468,  -3283,
-         4,    272,     -2,    492,     91,   -803,     48,    691,
-       375,     87,   -508,   -725,   -632,    268,   2929,   1302,
-       -11,   -628,  -2225,    723,    533,    909,    934,    682,
-       350,   1509,   -707,  -1142,    106,  -2174,    342,   -965,
-       456,   -655,   1137,   -553,    415,   -418,  -2631,   -121,
-       237,      3,  -1123,  -1555,  -1413,  -3333,    717,    115,
-     -1030,  -1007,   -819,    130,   -851,    281,    -43,   -473,
-     -1091,    326,    869,   -377,    278,   -148,    418,  -2104,
-      -422,    623,  -1777,    633,   1033,  -2031,  -1221,   4126,
-       -60,    -16,   8025,    243,   -340,   -599,   -501,   -289,
-      -219,   -104,   -230,    464,    191,     18,    345,    -65,
-       -68,   -481,    625,   -822,  -4011,   -516,    741,    734,
-      -316,    530,    122,    945,    371,   -298,   1194,   -250,
-      -167,    392,    -95,   -151,     -1,   -486,    189,     90,
-      -140,     30,   4485,    581,     54,   1905,   -895,  -2032,
-      -174,   2473,   -688,   -104,   -315,   -376,    830,    296,
-      -548,    754,    195,   -901,  -1548,  -1931,    792,    510,
-       294,    153,    619,  -1034,  -3038,   1134,    142,    -29,
-      -806,   -118,    -29,  -2314,   -159,    770,  -2899,     23,
-     -1045,   1037,   1496,   1104,   -527,    135,   -281,   -310,
-       -59,    202,   -346,   -612,    206,     27,   -456,    758,
-        67,   3547,    867,    227,     -3,    573,   1440,    421,
-       170,   1491,   -691,    -43,     -8,    784,    307,    557,
-       618,  -2387,    566,   -396,    182,    877,  -2666,   -163,
-       553,   -155,    691,   -188,  -1584,  -1085,   1033,   -308,
-      1356,   -570,   -721,   -232,  -3145,    104,    511,   -964,
-      2783,   -685,   -168,    -51,   1554,  -1816,   2431,    327,
-      -440,   1174,   -265,    -36,    120,   -397,   1094,  -1254,
-      -973,    574,   1085,   -139,   -751,   -529,   -240,     25,
-      1137,   -467,  -3471,    338,   -806,  -2028,     94,    -98,
-      -336,   -537,   1189,   -880,  -3607,   -168,    -59,    100,
-       309,   1097,    295,    262,    106,     -8,    210,  -7461,
-       395,   -248,    461,    490,   -326,    264,    105,     13,
-      -160,    608,   -443,  -1331,    835,  -1342,   3507,    763,
-       966,    101,   1047,   -469,  -1455,  -1080,     28,     99,
-       -44,    270,   -752,    130,      2,     57,    358,   -409,
-         2,   -658,   -812,   -899,    155,    141,   2101,   3616,
-        40,  -1957,  -1028,  -4137,    212,   1580,    578,   1019,
-      -512,    167,    366,   -580,    448,    216,     79,   -149,
-};
-
-static const int16_t cb2224sm0[] = {
-     -4334,   1434,   -228,   1477,  -1329,    230,    686,   -558,
-       486,   -188,    424,   -454,   -568,   -141,   -326,   -132,
-       -39,   2488,      9,    631,    513,    460,   -417,   2656,
-       633,  -1404,    -81,   -283,   -287,    480,   2558,    -19,
-      -158,  -2699,    405,    276,   -639,   -151,    529,    241,
-      -941,   -796,   -213,   1125,   -391,   2515,     78,   -177,
-      2677,    217,    955,   -687,    867,   -485,   -121,   1023,
-     -1572,   -591,    139,    798,   1262,   -467,    722,   2643,
-      -237,  -1048,    386,   -432,    180,   -788,   -178,    234,
-       403,    267,    312,   2661,    585,  -2775,   -686,    -88,
-       -16,  -1243,   -445,   -259,    303,    298,    285,    277,
-      2355,    163,  -2399,   -416,    115,   2277,   -707,    194,
-       283,   1183,     23,    119,     97,   8192,    -40,     67,
-      -101,    151,    169,     21,   -147,   -160,     55,   -207,
-       550,    -36,   -500,    -32,    225,    206,     72,    179,
-       464,   -406,     52,    696,    -18,  -4827,   1547,   -516,
-     -2275,    855,    430,   -523,     83,  -1633,  -1898,    285,
-       202,   -645,   -167,    102,   -124,    382,     24,    236,
-       830,    324,    -84,    491,    -95,   -154,    767,     25,
-      4741,   -574,  -2576,   -297,   -250,   -346,  -2867,    -64,
-     -1119,   1007,   -883,    457,   -328,   -854,   -981,    -55,
-      6922,    569,   -307,    261,   -100,   -832,    129,    416,
-      -154,    681,   -136,   1152,   -144,    -26,  -2266,   -320,
-      -141,   -897,    544,   -206,    845,   -590,     88,    211,
-     -1761,   -574,   -653,  -2788,    252,   -266,  -4252,    295,
-        97,  -2112,    209,   -144,    655,    -89,   -369,    591,
-       205,   1137,     30,  -2907,     88,     92,   -240,  -3106,
-       -16,   -398,   -576,   -720,    421,    427,   -423,   -195,
-       -18,   2503,   -133,   -918,    104,   -512,   -489,   2623,
-      -314,    215,   -103,  -1014,    761,    382,  -1456,   1719,
-      -980,    248,     55,    644,  -1945,     42,   -162,    -35,
-      -852,   1993,   -189,    664,   -149,   3132,    -50,   3438,
-       550,   -234,   -566,    434,     64,    379,   -169,   -291,
-      -718,   -608,     31,   -207,    651,  -2567,   -790,    906,
-       518,   1740,    373,   1158,    114,  -2044,    285,  -1136,
-      -373,    932,  -2185,   -488,    148,      3,    724,    623,
-      -568,   -359,  -2748,    751,  -1098,   -858,  -1140,   -253,
-     -2377,   -402,   -312,   -398,    -47,  -2618,    816,   -568,
-      1274,   -158,    118,    107,    181,    394,   2758,     80,
-     -3057,     20,   -279,    110,    482,   1010,   -162,  -1081,
-       -56,    685,   2207,    -10,     82,    440,    593,     43,
-      1010,   -853,   -624,    288,  -3045,   -426,      9,    132,
-       104,    157,    466,   -118,    116,    226,   -214,   -219,
-       299,   6093,    122,      7,    174,    444,    200,    -42,
-        -4,   -313,     99,    218,    292,   -159,   -409,    523,
-     -1357,  -4098,    -96,    968,      8,   -172,   -444,  -1040,
-       755,   -476,    967,    175,   -100,   1689,   -813,   3175,
-       369,   1828,    248,   -161,   6693,    631,    536,   -125,
-       274,   -467,    259,   -427,    130,   -523,    361,    584,
-        27,     60,    -57,    -30,  -8192,    148,    -64,    217,
-      -308,    163,   -116,     89,    108,    191,   -129,   -149,
-       128,     60,    575,    253,   -385,  -2937,    888,  -1402,
-      -543,   -607,   2639,    156,    251,   6966,   -147,   -382,
-      -388,     39,    476,    260,  -1048,    575,    401,   -245,
-      -441,    121,    389,   -666,     95,   2919,  -2212,   -765,
-       169,   -161,    184,   -320,   -315,   -497,    136,   -470,
-       479,   -541,    712,   2966,    519,   2595,    -77,   1089,
-        18,   -697,   -616,    241,    -54,    388,    461,    368,
-       144,   -149,    181,   7699,     11,      3,   -368,     65,
-       304,    358,    -29,    255,   -162,   -169,   -470,    -16,
-       198,     92,   2137,    233,    273,    255,   4078,   -279,
-      -194,   -274,    101,     45,   -225,   -716,  -2522,   -188,
-        10,   -590,   -745,    894,   1976,    -48,   2302,     -4,
-     -4691,    -67,  -1325,   -506,    605,   -297,    317,   -271,
-      -176,   1706,    541,      1,     31,   -580,    103,    148,
-      -122,   -141,   -849,     76,  -3094,    -67,   2775,    -38,
-      -598,   -314,    793,     40,    324,   1474,   1986,   1505,
-       832,   -504,    739,  -1233,   1201,    695,  -1363,    670,
-       805,    696,   -137,  -4977,   -306,    137,   -885,    455,
-      1021,    600,  -1711,    536,    235,   -149,     31,     -5,
-     -3747,   -405,    394,    140,    102,  -1576,    190,    408,
-       663,  -2075,   -747,    466,    631,    807,   1867,   -655,
-       102,    341,    435,    551,    500,    426,   -650,    -88,
-       -26,   2672,  -1791,     34,    -86,   2963,  -3330,   -793,
-      -307,    277,   -584,   -240,   -141,    258,    708,   -242,
-      -499,    808,   -104,  -2061,   -518,    684,    889,    406,
-       259,    211,    462,    428,  -2597,  -1147,   1729,    683,
-     -2173,   -167,    392,    440,    599,   -815,   -624,   -368,
-     -2962,   -172,    845,    423,    362,    711,   2131,  -3899,
-        84,    147,    826,   -399,   -637,   1132,    108,   -480,
-       230,    265,   -423,     48,     11,    239,   -599,   -281,
-        10,    541,   -397,    142,  -4322,   1172,   -257,   -101,
-       292,   -321,   -401,     60,   -309,    468,    267,    611,
-       438,   -638,   2194,    346,   1421,  -1192,  -3109,   -170,
-     -3336,    -49,    -69,    -75,    184,   3094,    591,     82,
-      -373,    140,    -22,    848,    124,    589,    157,     -4,
-       260,   -177,    147,     73,   -284,   6253,    111,    302,
-       -74,    356,    381,   -547,    -16,   -275,   -500,     93,
-       344,   -346,  -2837,    364,    -43,   -592,   1741,   -702,
-     -2247,    848,   -203,    168,    758,   -849,  -2454,    562,
-      1104,   -169,    463,   -398,  -2759,   -299,   -903,    647,
-       -62,   -124,    301,    337,   -201,    463,    -86,   -139,
-     -2189,  -2424,   -942,   -376,  -2043,    -80,  -1791,  -1580,
-       513,     29,  -1115,   -582,   1214,   -642,    355,    240,
-       285,   1759,   1209,    862,   1707,   3353,   -223,    245,
-      -515,   -928,    794,   -190,   -282,   1097,    -32,   1675,
-       857,   -730,    -15,    102,    356,   -309,   3867,     24,
-        93,    899,   -608,   -497,   -215,  -2244,    735,   -194,
-       102,    -51,  -1939,    846,     74,   -116,      7,   1981,
-       512,    233,    574,  -2508,     83,   1966,   -251,    -96,
-       532,     97,    897,  -1120,    390,  -3192,   -652,   2045,
-       193,   -880,   -398,   -148,    548,   -281,    -19,   -987,
-       467,   -326,   2777,    195,   1560,   1034,   -828,    102,
-     -1531,   1292,   -126,    539,   -247,     36,     55,  -2487,
-      -297,   -362,    482,  -2241,  -1021,  -1535,   -244,     38,
-     -3416,    141,   3408,     35,    -67,     95,    333,   -427,
-      -235,   -128,    304,   -548,    337,   -349,   -330,     23,
-      -450,   1657,    327,  -3087,    695,   -273,  -1090,   1262,
-      -111,   -868,   1516,    269,    119,    192,     14,    200,
-       141,   -395,   7145,     48,    334,    143,   -139,    154,
-      -102,   -312,     -2,    283,    238,    -30,    626,   1328,
-       242,   -416,    442,  -3050,   1388,   -100,   1215,    817,
-};
-
-static const int16_t cb2224sm1[] = {
-      8192,    -13,    346,    -52,      5,    131,   -294,   -167,
-       -65,   -347,   -438,   -559,     57,    -86,   -223,   -224,
-      -251,    629,    -58,   5249,    127,   -464,    644,    210,
-      -154,   -480,    165,    211,     13,    318,    152,   -173,
-      5451,    235,    170,   -100,     -6,   -460,   -249,    390,
-        54,    993,  -1637,   -288,   -978,   -197,    234,  -2877,
-      -570,   -151,    -82,    772,    199,   -385,  -1899,    345,
-       -25,    527,   -477,  -2918,    385,   2784,     78,   -524,
-      -759,    795,    433,    511,    856,   -275,    511,    136,
-      -444,    151,    233,    208,   -589,   -375,    282,   2886,
-        30,  -2749,   -930,   1079,     86,  -2285,    980,   -229,
-     -1369,     93,    -80,   2314,   -170,   1224,    397,    405,
-       463,   1014,   -377,    -90,   -269,    -82,   -376,   -773,
-       684,    -94,  -2893,   -323,   -644,   -849,  -1892,  -2244,
-       417,   2165,   -164,    221,    454,  -2337,    142,     99,
-       418,    486,    -49,     97,    138,   2221,  -2301,   -156,
-      -578,   3963,    196,    140,   -374,    180,    451,    354,
-      -952,    946,   -479,   -874,   -159,    145,    290,    240,
-      -240,   -233,   -418,    226,   2878,   -571,  -2491,    741,
-     -1438,    557,    197,   -370,  -4720,    379,     32,    821,
-        39,   -545,   -141,  -1507,    192,  -1150,    905,  -1095,
-     -5028,   -169,    533,    -23,    371,    162,  -1198,    465,
-      -369,    -14,   -861,   -656,   -701,   -296,     31,    450,
-      -387,   3060,   -696,    597,     14,  -1019,  -2741,   -208,
-     -1186,   -338,    712,    -64,   -344,     41,    327,      9,
-       576,   -349,  -2808,   2428,    433,   -566,    908,   -108,
-      -145,  -1011,    201,  -3042,   -327,    210,   -368,    230,
-      -310,   -400,     12,  -1034,   1734,    992,   1842,   1022,
-      2162,    588,    366,    154,  -3078,   -587,   1096,    215,
-     -1072,   -784,    472,  -1089,     94,    487,     18,     72,
-        34,    -15,   -374,   -607,    316,    830,   -146,   4377,
-      -301,    390,    838,    121,   -110,   -143,    -93,   2988,
-      2914,   -352,   -353,   -744,   -115,     99,    495,   -343,
-       309,   1261,   -519,    101,  -2662,    -44,  -3139,   -491,
-      1142,   -323,    -50,    776,     86,    187,    480,    271,
-      -167,      1,   -267,    -99,    991,   2492,   -152,   2423,
-      -225,     34,    576,  -1486,   -236,   -375,    160,   -176,
-      -145,   2525,   -131,    194,    317,   1215,   1553,    295,
-     -1408,    130,   2279,  -1185,   2671,   -137,   -324,    -23,
-        26,   -779,   -431,     -4,    488,   -186,    174,   -119,
-      3062,   -149,   -168,    191,    169,   1124,    301,   1471,
-      -409,   -999,   -166,   2174,  -1405,    992,   -179,  -2606,
-       -71,  -3151,     92,   -976,   3091,   -322,    310,   -374,
-      -779,    599,    -55,    425,   -697,     63,     27,    -38,
-        86,    170,    -11,   -616,    -97,    525,     78,     14,
-       684,  -5556,   -308,   -444,    266,   -396,  -1665,     86,
-      -722,  -1087,   -921,   -525,      3,   -439,  -1600,    -37,
-      2038,  -2672,   -187,    361,  -8192,    425,    365,     54,
-       343,   -703,    253,    284,    -57,   -327,   -154,    392,
-        99,   -181,    213,    395,  -2412,   -303,    182,     82,
-      2311,     45,   1801,   -209,   -988,     42,  -1430,     38,
-      -721,    118,   -163,   1279,   2184,    -18,   2851,    274,
-      -363,    297,    150,   -220,   3653,   3135,   -381,    335,
-       254,    378,    -52,     52,    328,   -383,    -61,   -802,
-      -409,    -49,     49,  -8192,    362,    -48,   -430,    -54,
-       255,    243,   -525,     14,    152,     10,   -392,   -301,
-      -594,   -539,   1200,    626,  -2979,    233,  -1504,    664,
-      -728,  -1293,   -491,    394,   1317,    298,    169,    214,
-      -429,  -1083,     42,    389,   4751,    510,    299,   -542,
-       456,   -852,     30,    208,    -63,   -131,     72,   -425,
-        73,    213,   -287,   -277,     43,    128,   5528,    165,
-      -316,   -135,   -576,   -583,    217,  -1298,     47,    134,
-       103,  -1894,    148,   3406,    880,    964,   -697,    -94,
-     -1626,    223,   1256,   -514,   2079,   -529,   1917,  -1452,
-      -616,   -605,    385,   -963,    395,    105,   -154,  -1627,
-      -214,     40,    969,   -708,  -1492,   -824,   2457,    275,
-       404,    876,   -781,  -1029,     34,     72,    229,   -137,
-       264,   -387,    305,    -57,   2908,   -143,   -249,  -2473,
-       202,  -1467,   -364,   2094,   -521,    -70,    260,    132,
-       465,     71,    982,    -36,   1792,    306,   2907,    -55,
-       254,    421,    231,    140,   1727,    474,    761,   3153,
-       -18,   -356,    414,   2218,    564,   -247,   -510,     67,
-      2390,   2531,    240,    117,   -487,   -310,    261,    222,
-      -286,   -861,  -2180,    480,    -75,   4769,   -407,    248,
-       227,   -224,    302,    901,  -1200,   -728,   1025,    734,
-      -336,    115,  -1726,   -179,    131,     43,   -357,    364,
-      -681,    283,   -189,    715,  -2793,   -692,   1367,    916,
-        28,   -500,   3094,   -543,   -627,   -709,   -506,  -1094,
-        34,  -2464,    434,    257,    357,     10,   -390,   3206,
-      3483,    137,    147,    180,    231,   -260,   -707,   -818,
-       476,   -528,    656,    824,     -8,   3073,    362,  -3034,
-      -199,     47,    694,   -252,    819,   -147,   -479,    -32,
-       530,   -141,    -91,    251,   -154,    376,   -603,   2305,
-     -2853,   -622,    316,   -680,    402,   -819,    323,    471,
-       -47,   1772,   1507,  -1052,   -685,     18,  -2509,   -418,
-       377,    -31,   -412,    105,   -906,   -267,  -2806,   -189,
-       -97,    198,   -802,    -82,   -658,  -2980,    795,   -447,
-       646,   1037,    486,   -689,  -2654,     55,  -3534,    540,
-       -68,    502,    -90,    277,    -87,   -497,     24,   -246,
-       400,    392,    348,     76,   -345,   -231,    -71,    155,
-        -7,   -226,   6553,    371,    261,   -290,     88,    -44,
-       311,    470,     -5,    182,   -105,     56,   -324,    267,
-       241,    327,    966,    218,  -4695,   -968,     27,   -352,
-      -315,    202,   -204,    435,    360,   -539,   -375,   -527,
-     -1157,   1010,   -241,   4171,   -292,     66,   2343,    310,
-      -682,    595,   3040,    539,   -118,   -573,   -128,    952,
-      -172,   -547,   -285,     -1,    345,  -5701,    345,   -153,
-        77,    349,   -225,   -364,   -655,   -270,   -716,   -825,
-        27,     55,   2179,   -154,   -275,    359,   -501,   -992,
-      -665,   1538,   -218,  -1159,   2176,   -845,  -3018,    105,
-      -459,  -3146,     67,   -197,   -293,    539,    115,    -74,
-       119,   -158,    -89,   1449,  -3006,    104,    651,    886,
-      -310,   -242,   1219,   1805,    176,   2235,    579,    294,
-       634,   1345,     -1,   -454,    755,  -1030,   1760,  -2404,
-      -406,    894,    614,    -74,    113,  -1325,   1843,   -392,
-     -3239,   2440,    -54,    222,   1349,   -695,  -1009,    434,
-      -468,   -509,   -280,    462,    228,    573,    213,     55,
-       325,    557,    100,   -721,   -674,    600,    795,   1567,
-       407,   3273,    -58,  -1330,    349,   -181,    417,   -503,
-       911,    350,   -681,  -4502,   -127,    -26,    330,    618,
-       241,   -147,    284,   -226,   -127,  -2692,    484,   -146,
-       -18,   -416,    755,     85,  -3119,   -404,      0,   -478,
-};
-
-static const int16_t cb4432l0[] = {
-     -3764,   -227,    184,   -258,  -1713,    122,    410,    -32,
-      -244,  -1337,   -328,    -20,   -236,   -359,    -13,    -52,
-       -75,   -260,    426,    -96,    -37,    -38,    117,   -938,
-       487,     60,    286,    571,    368,   -551,    198,   -102,
-        15,    -11,   4535,   -127,   -241,    114,    -77,   -316,
-       302,    195,   -149,    -73,    357,   -128,    -23,     34,
-       319,    -97,    189,   5918,    -20,   -134,    -47,   -249,
-         7,      3,    116,      7,     48,     47,     92,     19,
-        14,     31,   -388,   -329,  -1878,   -944,    958,    632,
-      1973,    182,   -130,   -193,   2309,   -868,     63,    260,
-       -12,    -89,    -88,   -208,    127,   -168,    237,     74,
-      1153,    925,   2292,   2992,    -35,    204,    766,   -930,
-       -87,    341,   -101,    501,     35,   -182,    112,     91,
-       -28,     79,    193,    -73,    -71,     52,     82,   -427,
-      -147,    -69,   4722,    468,   -187,     98,   -295,    292,
-      -991,     43,     98,    225,   -555,   -595,    -66,   -181,
-        91,   -152,     -3,     89,   -219,    356,   -375,   -114,
-     -1546,   -620,    648,   1946,     39,   -608,   -942,    103,
-       179,    170,  -2350,    157,   1132,   -944,   -283,     64,
-      -393,     15,    -90,    761,   -185,    644,   -360,      5,
-     -5212,    106,   -136,    -40,   -159,    -40,   -120,    -43,
-        -8,   -195,    208,   -179,   -295,    -63,     19,     32,
-      -104,    -23,    132,    660,   -460,    237,    523,   -676,
-      -378,    -81,   -184,   2718,     64,    531,   2119,  -1564,
-       614,    933,      6,     65,    -50,     55,    243,   -539,
-      1168,    953,   -283,     45,    476,   -346,   2285,   1892,
-       615,   -521,     23,  -2079,     57,    -11,    208,   1029,
-       371,     28,    170,    -63,   -167,    184,   -217,     76,
-      -320,  -2747,    542,  -2098,   -407,    -10,   -876,  -1477,
-      -306,    565,     57,    -49,   -111,    185,   -250,    120,
-      -186,    214,   -520,    463,    792,  -2420,   2760,   -383,
-      -783,  -1097,   -441,   -535,   1070,     78,     96,    122,
-      -193,    516,    114,    100,   -413,    100,    -23,   -153,
-      1267,  -4210,   -742,    228,    659,    399,   -169,    412,
-       -81,   1056,      4,   -254,    173,    109,   -218,    196,
-        64,     26,   -113,    -60,     -8,     15,   5497,    -76,
-       169,   -294,   -394,    596,    379,     12,    -64,   -203,
-      -138,     41,   -249,    -53,    -44,    -19,     55,    -34,
-        99,     36,    -70,      8,     46,   2787,    842,   1917,
-      -693,   -424,    151,    464,  -1162,   1027,    148,  -1027,
-      -173,    328,     23,    792,   -184,    395,   -684,    229,
-      -139,     -7,   2788,    404,     43,  -1508,   -590,      6,
-      -184,    904,    475,    -37,    276,   -361,   1924,   -188,
-      -113,  -1334,   -176,     11,    -34,    -70,    -68,     95,
-      -433,    225,    437,   -451,    471,   -272,   -385,   2793,
-     -2685,    544,    881,    409,   -789,    700,     -5,   -144,
-        66,    -17,    504,   -397,    264,     74,    -81,  -1803,
-       444,   -573,    633,   -391,  -3339,    192,    484,   1126,
-      -306,    153,    303,     61,   -253,   -255,    -57,   -277,
-       -88,   -100,     32,     79,  -1320,   -857,   3080,   1178,
-       323,    353,   -149,   1316,   -399,    236,   -129,    231,
-       323,    696,     59,   1217,   -567,   -268,    642,    384,
-      -327,    -47,    466,   1530,   1092,  -1176,    612,    257,
-      -143,   -270,    487,    -62,    332,   1089,    961,   -706,
-       938,     78,     97,  -2805,  -1088,   -871,   -273,     87,
-      -345,    148,    113,    167,     97,     31,     68,    -47,
-       -53,     53,     29,  -5723,    -53,    -12,    241,     92,
-       131,    139,     48,    102,    -26,    -47,    664,   -580,
-        -7,   1287,   2531,   1061,   -710,     24,   1389,  -1742,
-       254,  -1147,    539,   -150,    -24,    495,   -204,   -171,
-       955,    202,   -111,    147,  -1458,  -3973,    421,   -416,
-      -544,    392,   1419,   -178,   -168,    -53,     50,   -537,
-        -7,   -346,   -289,    -52,    -38,   -259,   -115,   -136,
-      -138,    -89,   -205,   -661,  -4429,   -110,    380,   -721,
-      -180,    127,  -1371,    -78,    276,    319,    229,   -934,
-       267,   -353,     44,     65,    449,    -32,    159,    -11,
-       -22,   -571,    100,   -676,   2892,  -2740,    907,    511,
-       248,    441,    -62,   -517,   -347,   -235,    319,     -8,
-      -140,    309,    258,   -106,    215,      1,  -3252,    426,
-       455,  -2213,   1031,    430,    746,    367,    602,    187,
-      -147,   -200,     97,    555,   -107,   -249,    -71,    101,
-        59,    -94,    -64,    -33,    221,    184,   -791,    671,
-      -191,    284,  -1311,    402,    -29,    250,   -190,   -503,
-        38,    106,    586,   4767,    526,    147,   -182,    249,
-       146,     17,    293,  -1095,   1079,   -161,    141,     -2,
-       681,   -275,   -171,  -4504,     61,   -105,   -306,    -66,
-       229,     20,   -102,    -93,    334,   -189,      5,     -6,
-       417,   2551,    -63,   -852,   1608,   1820,    670,   1592,
-       102,    203,    147,   -767,   -147,    310,   -718,    175,
-       551,    -98,   -202,    309,     70,     81,    -55,   1518,
-       222,    338,   -356,    349,     97,     86,    495,   -233,
-      -121,   2936,    200,    935,   -381,   2474,     53,    494,
-       248,   -139,    -45,    100,  -1287,   -181,   -370,    311,
-       287,   3016,    -96,   -128,   2146,    567,   -383,   -551,
-       -96,    144,    495,    428,    -32,    137,     27,   -272,
-      -149,      9,    -61,    177,  -5236,     91,   -837,    611,
-      -279,    -74,    652,     14,   -178,    -82,    -89,    347,
-      -245,    647,    -62,     49,   -215,     29,    -55,    -27,
-       178,     79,    -19,    -59,    177,   -152,      0,    189,
-       -10,    128,   -115,     33,     61,   -106,     56,    -13,
-       135,    116,  -5772,    157,     43,     26,    -11,    102,
-        -4,    -52,    208,   -186,    198,     99,     81,    -29,
-      -103,    193,    -35,    -84,     -4,   -111,  -5251,     84,
-        71,    -85,    -77,     55,    234,     38,      0,    -35,
-        60,   5875,     98,     36,   -219,    -17,   -419,   -136,
-        47,     34,     55,    -21,    -17,     -1,     72,     94,
-        52,     -3,   -703,  -1437,   -518,    557,    121,    356,
-      -345,   -717,   -438,   -279,     13,     70,    -95,     -2,
-     -4170,     40,    136,     17,   -153,      8,   -149,    -27,
-      -559,    268,   -237,    -82,   -220,   -921,   -588,   -150,
-      3481,  -1906,    647,    675,   -455,    598,   -386,    -52,
-        -7,    222,   -201,     90,     54,     75,   -283,    118,
-      -375,   5768,     20,   -126,   -141,    -99,     64,    116,
-        16,    -58,      0,    -31,    -15,    250,   -104,    -30,
-      -144,    115,     12,    117,   -482,  -1709,   -436,    122,
-      -246,     -7,    271,   1961,    154,    149,    -86,    147,
-       258,    531,   1760,    914,  -1196,  -1800,    812,   -621,
-       125,   -161,   1361,     50,   -651,  -1307,    360,   -785,
-       205,   -156,    294,     21,  -3484,    -18,    -79,   -266,
-       770,    307,     29,   -765,   -250,    183,     55,    131,
-      1452,    260,    224,    221,   -347,    360,   -352,  -2188,
-      -664,   -503,    313,    406,   -251,   3268,    210,    -46,
-       129,   -276,    343,   -143,    104,    -55,    461,     17,
-      -576,   -287,   -289,     33,  -2500,    -85,   -428,  -1137,
-       918,   -245,   -490,   -260,   -270,   -133,   -591,    199,
-      -294,   2784,    102,     19,   -109,   -745,     91,   -524,
-       -44,     28,    252,   -511,    -80,   -146,    271,    519,
-      -216,  -2280,   -411,   3699,   -368,   -538,    427,   -158,
-       114,    -50,   -589,   -340,   -180,    703,   -186,    487,
-      -649,    668,   -916,   -436,  -3684,  -1016,    877,    -65,
-      -153,    -62,   -148,    -17,   -106,    142,    -73,     -1,
-       -68,    567,   -658,    815,   2270,   -563,   -519,   -226,
-      -223,   -282,    584,    240,  -1522,  -1935,   1169,    880,
-       127,  -1276,   -127,    399,     63,     25,  -1297,   2131,
-       592,   1652,   2609,     69,   -581,   -179,    947,    597,
-       150,     35,      0,   -255,   -232,   -728,    239,     91,
-       130,   -234,    231,     56,  -2181,   1774,  -2196,   1633,
-     -1065,   -662,    777,   -175,   -128,    267,     -7,     51,
-        27,   -133,     95,   -500,    188,   -167,     94,   -176,
-       -29,    -65,   -161,   -141,   -694,   -968,    594,   -269,
-      -422,   -472,   -731,   1210,   -816,   2142,  -1321,  -1746,
-      -149,   -983,   1310,   -839,    762,    284,     99,    -31,
-     -1169,    -84,  -1119,    -55,   -720,   -944,  -1115,   -271,
-     -1032,   1064,    187,  -1013,   2987,     26,   -209,    516,
-        -8,    107,    -24,    188,    278,    -53,    624,    460,
-      -275,  -1881,  -2001,    851,  -1740,   -407,   1643,   -352,
-       -17,   -528,   -538,   -175,    179,    416,   -297,     54,
-       132,   -491,    -76,     34,   -440,    175,   2065,  -2006,
-      -164,     38,   -403,    902,   -129,    215,   1545,   -414,
-     -1183,   -532,    578,    248,   -308,    189,   -563,   -345,
-      -949,   -279,   1693,   -959,    101,    783,      9,   1641,
-      1494,    167,   -294,   -538,    951,    115,    590,    105,
-      -847,  -1003,    464,   -368,  -1268,    641,    254,    243,
-       488,   2636,  -1209,   -272,    437,    445,    781,   -463,
-      -415,    538,   -811,    588,   1083,    206,   -547,    171,
-      -585,   -744,    343,   -604,    395,    -76,    910,   -523,
-      -108,   -449,    625,   -325,  -1079,    273,  -1473,  -1096,
-      -137,   -565,   2077,   -623,    214,   -342,   -273,    769,
-      1137,   -879,   -731,     56,  -1098,    211,    822,    579,
-      -839,    164,   -600,    -80,     61,    316,    644,   1445,
-       891,  -1796,  -1798,   -162,  -1631,   -492,   -626,    593,
-       544,     66,     63,   -857,  -1273,    406,   1665,    899,
-      -467,     87,   -117,   -469,    126,     30,   -931,   1446,
-      -190,    388,  -1608,   -316,  -2199,   -127,    484,    -51,
-        56,   -524,   1524,   -103,   1231,   -740,    717,   -861,
-       823,   -665,  -1790,    411,   -690,    303,  -1615,     63,
-      -232,     19,   1090,    -96,    137,     80,  -1027,    581,
-       -61,    672,    133,    444,   -767,    766,    -42,  -3174,
-      -270,    -23,   -126,  -1111,     67,  -1367,      4,    315,
-       -53,    -90,   -165,     48,  -1657,   -117,    392,    356,
-       792,   -610,   -618,   -219,    446,    102,    374,    207,
-      1026,   2480,   -461,   -782,   1161,  -1351,   1032,    486,
-      -308,    290,   -272,    899,   1912,     36,   -624,    286,
-      -428,   -623,   -665,     12,   -621,  -1985,    -34,    468,
-       318,   -467,    127,   -972,    -39,   -663,   2307,    -26,
-       406,   -468,   -657,  -1404,   -342,   2356,   -395,  -1422,
-     -1243,    465,     90,   -665,   -280,   -290,    -21,  -1752,
-       280,    271,    395,    240,   -402,     55,   1077,    148,
-      -309,   1818,    483,  -1293,     43,    261,    566,   -131,
-       947,   -815,   -872,  -1021,  -1001,   -395,    263,   -555,
-        78,  -2193,   -360,    -76,  -1029,   -493,   -464,   1339,
-       -53,    750,   -671,  -1349,    133,    -70,    114,    501,
-       766,   -816,    703,   -992,   -122,   -520,  -1323,  -2539,
-      -365,    -35,   -555,   -888,   1515,   -191,   1322,   1633,
-      -674,    451,  -1246,    270,   -868,    703,   -394,    106,
-      -779,    754,    650,   1066,   -417,  -1305,    149,   -165,
-};
-
-static const int16_t cb4432l1[] = {
-     -3867,   -448,   2202,    129,   -100,    393,     37,   -267,
-      -156,     23,   -274,    222,     33,   -191,    104,   -140,
-       -50,    -28,   -148,   -181,    -22,      6,    489,    993,
-     -2764,   1191,   -773,    781,   -460,    843,    -77,  -1417,
-       390,    124,   -203,    205,    662,    -16,    569,   -963,
-       609,   -155,     64,   -293,   2649,  -2533,     70,   -472,
-      -482,  -1732,    235,     -5,   -485,    116,   -177,   -104,
-       314,   -355,    118,     25,    921,    285,    130,    -94,
-        77,    121,   1068,   -435,   1407,    447,   -427,  -1096,
-      -757,    258,     19,   3236,    702,    362,   -928,   -348,
-      -150,   -784,   -687,   -388,   -176,    -38,     16,    -14,
-      1017,    879,    935,   1280,   1014,    -85,   -256,   -103,
-     -3384,   -928,   -200,   -406,   -175,    304,    -54,    195,
-       -78,    676,   -356,   -167,   -165,    -56,  -3133,    156,
-      -171,   -684,   -698,   -135,    230,    -30,     32,    542,
-      1959,   -124,    -76,    162,    182,   -174,   1011,    -97,
-       678,     10,    188,     30,   1086,   -262,   -157,    250,
-       241,    233,   -584,   3276,   2126,    -50,   -207,    637,
-      -440,    331,   -434,    251,   -267,    269,   -392,     68,
-      -244,      8,    928,    827,  -1096,   -309,   -356,   -375,
-     -3204,    422,    695,      2,    240,    595,    641,    582,
-       342,     42,      7,    539,    -64,   -116,     82,     16,
-        26,   -136,   -122,   -114,  -5814,     22,   -272,     10,
-       113,    186,   -422,    -95,    309,    308,   -118,   -208,
-        52,   -175,     12,   -106,     -6,     20,     58,   6053,
-      -101,    -20,     10,     70,    189,     57,    -11,    210,
-        83,    239,     -6,    -79,   -233,    -59,     31,    -30,
-       -62,     64,    -38,     25,    -78,   -202,   -215,   -115,
-      1477,    255,    101,  -2575,    186,   3140,    -46,    -45,
-        53,   -183,    -89,   -412,    183,   -222,     50,   -237,
-        96,     35,   1684,   -521,   -169,   -436,   -295,   1390,
-       261,     27,    163,    352,     68,  -3677,     12,    310,
-      -599,    331,    138,   -333,   -269,   -130,    -44,    -14,
-       265,   -626,    258,    -59,     31,    -17,    222,    -10,
-      -364,    280,   -183,   -235,   -217,     73,    -67,    114,
-       196,  -5132,    269,    159,     -6,    -36,   -248,    274,
-      -328,   2712,   -393,   2763,    507,   -110,   -166,    -84,
-       -72,  -1111,    -19,    370,     25,      5,    156,    -32,
-       237,    -57,   -106,    -22,    370,   -229,   1099,   4297,
-       152,     72,    -56,    347,     64,   -501,    -57,    178,
-       175,    -14,    -84,   -626,    555,    155,     20,    -75,
-        20,    -33,   -254,   -125,     -9,    150,     91,     -7,
-       -45,    239,   -109,     72,    -66,   -172,   -211,   6063,
-      -205,    171,    -75,     50,    -75,     22,    109,     21,
-       -58,     58,   -105,   -432,    310,   3782,    -18,  -1071,
-        19,     20,   1455,    337,   -257,   -288,    -52,    519,
-        43,     80,   -175,   -218,      9,    176,    -28,   -418,
-       200,   -514,    351,    119,  -5920,    -96,    -33,   -289,
-        74,     26,    120,    -37,    113,     47,   -145,    -17,
-       334,     46,     47,     19,    274,    172,    159,   -404,
-      3151,   -408,   -559,    987,   -178,    253,    -90,   -498,
-      1454,   1183,    392,    762,    220,  -1207,   -220,    -69,
-       -85,     22,   1644,   1858,    725,   1084,      0,   -257,
-       290,   1712,   -151,   -188,   -390,    638,   -327,  -2185,
-      -322,  -1116,   -150,    120,   -140,    198,    162,    -83,
-      1321,    232,    242,    -52,   -456,    778,   -288,     65,
-      2431,     37,     85,   -489,    862,   2776,    260,    -72,
-       792,    100,     17,   -210,    588,     49,    600,    246,
-      -258,    128,    -51,   -492,   -395,   -489,     50,  -5308,
-       -67,    314,    124,     46,   -188,    -64,   -101,     51,
-      -535,    108,     56,     -4,   -191,   -923,    485,    578,
-      1320,    228,   -535,    310,    227,    395,  -1441,   2660,
-       226,   -392,    221,   -686,   1749,   -175,   -904,   -571,
-      -129,    154,   2622,    609,   -247,   -240,   -893,     98,
-       291,  -2277,    411,    260,   -160,   2061,   -203,   -437,
-       359,     21,   -101,     19,     49,     15,    -98,     82,
-         3,   -555,    164,   -152,    -58,     38,    175,   -439,
-       -37,     68,    -21,   -181,  -5556,    -27,      8,     48,
-        21,   -151,    381,      3,   -152,    -74,    202,    -29,
-      1863,   1713,   -922,  -1976,    551,  -1522,    525,   -116,
-       146,  -1730,   -238,    -72,   -183,    126,    234,   -240,
-        82,    138,    -60,   -131,  -2226,    226,   -702,    183,
-       -81,    462,  -2851,  -1419,  -1005,    124,    -81,   -252,
-       -65,    147,    -58,   -179,    306,    154,    122,    -69,
-        69,     11,    115,    296,   3340,   -501,  -2580,   -804,
-         9,    591,    -86,     88,    127,    588,    183,     48,
-        79,    -38,   -199,     63,   -140,     29,     88,    -28,
-       259,     69,   1743,   -531,    110,    -18,    776,    -18,
-      -177,    112,     36,   -243,   -208,    528,    -47,   4709,
-       107,   -125,    140,     -1,     22,     15,    416,   -194,
-      -267,    -49,     43,     -3,   -308,    214,   -128,    140,
-      5372,   -123,     70,    275,    210,    182,   -147,   -131,
-       -84,     69,    116,     29,   -401,   -162,   -236,   -173,
-       378,     45,    -12,    -77,  -6209,   -103,    126,     54,
-       -19,    -20,     43,     64,     92,     -8,    -12,    118,
-      -123,     58,  -3628,   -414,  -2147,     76,     95,    -99,
-       357,    -10,    278,      4,   -608,    504,    105,    -72,
-      -109,    -92,    -55,    367,   -167,     40,    -34,     76,
-       220,   3434,   -366,    191,    248,     29,    187,   -177,
-       155,   -348,   -341,  -2466,    272,   -136,    510,    139,
-        81,    184,     33,   -299,     92,    -44,   -402,   -583,
-      -725,   -400,   -159,    751,   -225,    377,   -160,   1556,
-     -2652,    685,  -1077,   1276,    332,   -257,  -1449,   -282,
-      -231,   -145,     58,    173,    421,    271,    401,   -186,
-        79,   -258,    127,    252,    214,     96,    157,    195,
-       205,    118,  -4771,    -95,   -164,    217,    477,    -51,
-        -4,      8,   1450,    -51,    -52,    952,    675,    929,
-      -273,    475,      9,    282,   -249,    236,    746,  -1407,
-      -272,   1845,    692,   -105,   2690,    168,      1,     -1,
-       157,   -599,    305,    255,  -2252,     45,   -199,    119,
-     -3489,   -161,      6,   -263,   -259,    338,   -251,     61,
-       153,   -124,    432,     -7,    131,      5,    305,   -322,
-     -3283,    -32,   -336,   -273,   2243,    863,     -1,    681,
-      -365,   -246,   -152,    375,   -133,    -15,   -208,   -104,
-        89,    128,   -135,     44,   -255,    549,  -2751,    -48,
-       270,  -2584,   -549,   -631,    445,    182,   -198,    743,
-      -215,    -60,   -400,   1383,    167,    -65,    250,    146,
-       185,     22,   -484,   -161,     86,   1758,    964,    404,
-     -2574,   1026,      6,   -516,   -724,    315,  -1891,    311,
-         2,    339,    -39,    324,    299,   -497,    -12,    179,
-     -1242,    364,   -185,   -197,  -1474,    232,   -490,   4042,
-      -105,    887,     31,    539,    235,     75,   -112,   -200,
-       -31,     74,    -76,    -16,    -20,     38,   -159,   -143,
-       114,    -77,   -110,     28,    -18,    -84,    -27,    -53,
-       -82,   -224,     75,      0,    -46,    -64,     44,   -112,
-        84,    -85,  -6030,    -24,    661,   -474,   -178,      8,
-     -1023,   -396,    199,    -19,    -50,    -93,    385,    209,
-     -1227,   2492,   2163,    986,  -1359,    399,    848,    681,
-      -829,    211,    696,   -599,  -1398,   1951,   -113,    374,
-       -17,  -1113,  -1708,   1294,    666,   1774,    623,    259,
-       105,    961,    -87,     43,   -463,     65,    155,    -26,
-       -31,  -1477,   -508,   1091,  -1463,   -524,  -1853,   1354,
-       434,     86,    893,   -871,    151,  -1887,    205,    423,
-       857,    -55,    -11,    -39,    341,     61,   1158,   2650,
-       899,  -2491,   -593,   -843,  -1399,    -15,   -713,   -171,
-      -195,   -523,    -46,    243,    117,    241,     -8,    140,
-      -149,   -191,     70,    134,  -1158,   1933,   1135,  -2284,
-     -1049,   1717,    378,   -155,    -37,    171,   -692,   -280,
-       918,   -786,   -123,    558,    571,     39,   -315,     62,
-        27,     59,    708,   -134,   -200,   -168,   -134,    148,
-      -142,     25,    164,   -282,    284,    -95,    -35,    376,
-       165,    367,   -335,    271,    249,  -4520,    176,    -36,
-      -216,  -1303,    375,     92,    602,   -889,   -390,    284,
-        78,  -1318,   1259,   1865,   1498,   2063,   -234,   -840,
-      -391,     88,    168,   -235,    -74,     31,   -239,   1221,
-        71,  -1637,   1513,     68,   2201,   1513,  -1099,   -622,
-       426,    343,   -330,   -648,    381,   -156,     27,    -31,
-       -92,    133,    210,    103,   -155,   2061,   -366,  -1173,
-       -31,   -274,   -713,   -471,    509,   1044,    208,    403,
-       486,    -66,   -521,  -1883,   -180,   -537,   1283,    -98,
-     -1464,   -456,    508,   -619,   -546,    685,    944,    -85,
-       311,   1172,   -194,   1406,    -99,   -827,   1506,    396,
-       196,  -1534,  -1181,   1588,   1250,     47,   1034,   -171,
-     -1247,    -98,   -120,   1181,  -2195,   -384,    945,    627,
-        26,   -248,   1372,   -671,    214,   -649,    -17,    -44,
-      -500,   -559,    577,   -601,     32,    421,    531,    344,
-     -1233,    145,    348,    614,   -560,   -244,   -357,   -202,
-       814,   -494,  -2320,    308,  -2277,   -481,   -518,   -431,
-      -851,     43,   -204,    -26,   -742,   1083,   -130,   2002,
-      1642,  -1156,   1746,   -529,    937,   -544,    416,   -741,
-       763,   -232,    509,    243,   -458,     78,   -130,    143,
-      -123,     71,   -666,   -105,     31,  -1061,    441,    -48,
-       411,  -1547,    155,   -730,    439,   1624,    873,   -611,
-      -470,   2348,   -157,   1184,    678,   -174,    542,    -95,
-       -12,   -405,    237,    322,  -1194,   1903,   1496,    357,
-       -34,   -661,  -1024,   2236,    860,   -256,    617,    756,
-      -485,   -273,   -589,    536,    214,   -286,    782,    418,
-       346,   -462,    443,   1056,   -914,   -304,   -564,   -332,
-      1823,   2079,     93,   -975,   -891,  -1089,   -720,  -1127,
-       702,    300,    787,    374,    -78,   1070,    691,   1339,
-      -797,     57,    482,    432,    748,   1538,    673,   1885,
-      -504,   1913,   -190,   -135,    881,   -139,     84,    379,
-      -176,   -129,   -331,    -34,   -690,    282,   -563,     51,
-        71,   -714,   -103,   1074,   -651,   -582,   1388,   -320,
-     -1115,   1547,  -1088,    -65,  -2634,   -201,   -653,    116,
-      -238,   -218,    476,   1417,   1671,   1135,  -1025,    614,
-      -662,    127,    863,   -117,    726,   -971,   1382,   -286,
-       465,   1195,   -715,    862,  -1256,    105,     37,  -1190,
-      -442,  -1777,     50,    162,   1577,    580,    762,    253,
-        92,   -308,  -1238,   -161,    295,   -150,   1733,   1831,
-      -527,   -527,    -28,     70,   -359,  -1590,    860,   -221,
-        47,  -1201,   -254,     39,    780,   -326,   1097,  -1019,
-       834,    362,    357,     41,    693,  -1099,  -2687,    614,
-       270,   -128,   -322,  -1149,    631,    -46,   -343,   1495,
-      -896,   -864,   1545,    200,   -922,  -1133,   -637,  -1231,
-       484,   -796,   -743,   -371,    999,   1300,    173,    -19,
-};
-
-static const int16_t cb4432s0[] = {
-     -2558,   2751,   -440,   1200,   1067,   -725,   -492,    588,
-       234,   -209,   -108,   -230,    223,   -231,   -235,   -132,
-       -51,     88,   -290,   -214,    -99,    -60,    175,   2546,
-      -991,    907,    446,    635,    284,    707,    238,    220,
-      -308,    259,      8,   -435,  -2207,  -1487,  -1579,     46,
-       285,   -249,    154,   -370,     37,     42,   1524,  -1853,
-      1393,   1204,    126,   1751,     82,    136,    363,  -2411,
-      -782,   -128,   -818,   -232,    765,   -173,   -127,    732,
-       260,   -101,    868,   -249,    290,     32,    645,     55,
-     -1742,  -1077,    392,   -568,    629,   -920,   -243,    791,
-      -604,   -363,    117,  -1360,    -15,   -245,  -3655,     54,
-      -297,     10,    124,     11,  -1114,   -567,   3882,  -2042,
-     -1120,    -42,   -114,   -914,    419,    307,     44,    277,
-      -101,    429,    170,    187,   -528,   -705,    348,    -19,
-       180,    -76,     91,  -1861,   -181,   -171,    804,   -730,
-       222,   -184,    349,    191,   -125,     14,   4270,   -467,
-      -272,     29,   -216,    212,    426,   -222,     11,    -16,
-      -852,    101,    576,    178,    351,    647,     90,    179,
-      -681,   -187,     77,   4115,   -976,   -726,    711,    763,
-       572,  -1166,    -46,   -445,   -103,    135,    294,    300,
-        10,    737,    386,   -399,   -349,    -52,   5393,   -107,
-       -32,   -229,   -154,   -181,     82,    -68,    -13,    -77,
-        48,     75,    117,    -50,    254,    233,     98,     75,
-     -2218,  -2214,   1491,    832,    225,  -1057,    267,    539,
-      1963,   -245,   -353,    454,   -430,    -54,   -747,    -58,
-      -438,    -90,    -64,    277,    214,   -105,    -47,  -1301,
-      -404,  -1179,    682,  -4093,    764,   -270,   -342,   -367,
-     -1378,      6,    -83,    429,    398,     61,   -149,    180,
-        31,    169,   -218,    152,    -71,    -38,   2605,    679,
-      -175,   -533,   1787,    611,    484,   -322,    158,   -561,
-       125,    -35,    -42,   -190,    529,    449,    157,  -3105,
-       106,    168,     -8,    -66,    -80,   1463,   1136,   4793,
-       -98,   -432,    538,   -145,    241,   -158,    105,   -372,
-        39,   -160,     92,   -223,     81,    245,   -142,   -162,
-      -167,   -297,    -49,    -98,    582,  -5178,   1130,   -271,
-       567,   -251,     55,    487,   -303,     31,    -25,     87,
-       -70,    154,    -23,   -221,     70,    208,     48,   -137,
-        46,     59,     -9,  -1397,   -970,    224,    714,    161,
-        24,   -307,   1295,   1467,   -155,   -505,   -521,   -244,
-       503,    -25,   -989,   3664,   -148,     12,   -135,    218,
-      -159,   -156,   -769,   -421,    553,    715,    697,   -181,
-      1426,    425,    -39,   -103,  -4558,    171,    347,    161,
-       170,    128,   -210,    -35,     31,    125,   -264,   -135,
-      -100,   2685,   -230,   2062,   1618,    -99,   -874,    926,
-       757,    380,    404,    -73,     30,     29,    462,    725,
-      -389,   -246,     20,    150,   -234,    -58,   -183,     10,
-       156,    482,   -232,    124,    115,    180,   -615,   -395,
-       330,    -85,   -435,   3279,   1493,    686,   1157,    245,
-     -1067,  -1953,     23,    796,   -540,    175,     56,  -1931,
-        89,    705,   -342,    551,  -1999,   1951,  -2305,   -497,
-      -266,    275,  -1503,    351,   -355,   -353,    236,   -358,
-      -271,    -40,    136,    217,    -13,    -45,  -2091,   1141,
-       730,  -1888,   1131,    660,   1271,    439,   2597,     92,
-       319,    -91,     62,    316,    287,   -260,    121,    -33,
-      -117,    -22,    -79,   -170,   -164,   1486,    134,    -62,
-       -36,  -3367,   -235,   1221,   1239,     78,    -54,   -489,
-       268,   -560,   -774,    851,   -973,    -62,   -174,   -138,
-      -459,    390,    -22,    -42,     83,   1339,   1307,    462,
-     -3768,    511,    300,   -525,   -787,    -89,    675,  -2074,
-        37,    -48,    252,    598,   -332,     67,   -187,      2,
-      -106,    -35,   -148,   -186,   -542,    799,   2363,   -155,
-      -665,  -2867,   -209,   -200,    -80,   1682,   1082,      2,
-       516,   -481,    276,     -1,   -220,     54,    -12,    259,
-       161,   -148,    566,  -1489,   -731,   1262,    499,   -816,
-       115,   4057,    -71,    701,     39,   -132,   -223,    -16,
-       229,     -2,    -40,    -61,    234,    405,    108,    304,
-       -62,   -396,   1369,  -1438,  -2045,   1954,    759,    969,
-      -166,   -235,   -115,    -68,   1923,   1815,   -776,   -855,
-        34,    -63,     17,     87,    223,   -145,   -130,    -16,
-      -313,  -1704,   -458,   -332,    420,   1332,    676,    878,
-     -3847,   -360,    427,    537,    651,   -167,   -451,   -197,
-       277,    136,   -201,    517,     10,   -156,     35,   -927,
-      1250,   -173,   1004,   -169,    322,   -140,   -559,  -4656,
-      -343,   -264,    -61,    -12,    195,    -10,   -123,    -23,
-       -20,     -6,   -367,   -102,   -215,     41,    838,   1513,
-       552,  -1609,   -753,   -763,   -656,   -633,     14,     35,
-       141,    117,   -121,    857,  -1494,    578,   2546,   1034,
-      -676,    571,    817,   -218,   -111,   1424,    -51,    878,
-     -2860,   -257,    104,   -526,    782,    708,   2350,   -500,
-      -342,    219,   -406,    836,   -117,    288,   -415,    798,
-        14,   -311,   -455,      3,   -410,   -144,    -30,   -977,
-      -145,  -2466,   -957,   1370,  -3201,   -327,    -85,    149,
-      -580,    198,    350,    140,   -104,    327,   -128,   -178,
-        58,    294,     50,   1814,    581,   -909,    287,   -267,
-     -3992,     61,   -860,    258,   -271,   -223,    237,   -291,
-        -3,     66,    110,   -620,    319,    -62,    177,    364,
-       110,   -163,   -921,   -863,    251,   4922,    280,    121,
-       128,    209,   -126,    578,    -56,     41,    124,    350,
-       245,   -465,    -67,      5,    651,    147,    200,      0,
-        21,   -609,   -332,     -3,    247,   -412,    128,     42,
-     -1405,   -301,   -341,   -484,   -491,    -55,    361,   -100,
-       -30,   -405,    643,   4249,    -31,    -91,    -10,      6,
-       425,   -350,  -1501,    817,  -1348,   -201,   -345,  -3643,
-       235,    691,    332,    219,    199,   -398,    130,    -50,
-      -190,     89,    -23,    100,   1327,   -200,    146,    482,
-      -624,   -479,   -391,    188,    129,    614,   -335,   -564,
-      1021,   -107,   -199,    145,    201,    571,   1276,   4253,
-        58,    121,    295,     38,     26,     47,  -1333,   1138,
-      3125,    357,    -72,    347,    276,   -272,    120,    -77,
-       535,    247,    -71,  -2054,  -1860,    -73,    -62,    266,
-       -30,    183,     17,    -46,     -7,   -140,    997,    526,
-       -47,    -59,   1540,    373,    162,   -150,   -107,    -74,
-      -278,    -37,   4268,    -21,   -269,    359,    111,   -115,
-        -5,   -206,    -87,    -44,   -517,     54,  -2859,    189,
-      -297,   -863,   -918,   -929,   -543,     25,  -2866,    -79,
-     -1101,   -275,   -410,   -458,    -75,   -211,   -420,     96,
-       467,    -66,    -15,   -580,   -420,   -586,     -7,    109,
-       236,    227,   -488,    106,    258,     76,     78,     -8,
-      -199,  -4888,   -134,   -205,    -33,   -243,    -19,    -10,
-       157,    129,    120,   -928,    604,   -345,    -47,   -430,
-      -257,    273,     81,   1949,    490,    272,   -205,   2460,
-       -54,    103,  -2924,   -529,   -211,    -60,    279,    220,
-       -57,    342,    209,    984,  -1410,  -3363,  -1028,  -1301,
-     -1293,    227,   1142,  -1068,   -512,    758,    364,     46,
-      -358,     16,    257,   -158,   -253,   -182,     -2,    181,
-      1475,   1574,    215,   -968,    246,    369,   -273,   -717,
-       546,     74,  -3872,    293,     98,    130,   -244,     41,
-       143,    699,    -56,   -126,     67,     54,     -2,   -878,
-      2334,    883,    215,  -1979,    246,   -759,    499,    248,
-       751,   -202,    580,  -3018,    359,   -139,    210,    -47,
-      -168,     89,   -659,    259,    -54,    -40,   -490,   -169,
-      -769,    569,   -171,     64,   -845,    519,   1251,    -71,
-      -459,  -4436,    257,   -334,   -826,   -183,    115,   -408,
-       -77,    544,    173,   -258,     48,    331,   1735,   1035,
-      2793,   1154,  -1901,    275,   -109,  -1185,   -403,   1332,
-      -282,     36,   -367,     21,     27,    362,   -425,    217,
-       150,   -304,    192,     53,  -1100,     27,    628,    698,
-      -634,    -25,     84,      8,   -103,    533,   -301,    218,
-      4350,    119,   -109,    309,     24,   -352,   -147,   -274,
-       156,     85,      9,   1706,   -854,   2012,  -1573,    112,
-      -673,  -1538,    -91,    415,  -1525,    866,   1493,   -621,
-      -396,    277,   -604,   -363,    114,   -360,   -252,    -18,
-       -31,    -77,   -591,   2483,    535,  -1520,  -1057,  -2189,
-       -51,    798,    276,  -1426,     72,   -303,    402,    111,
-       327,    272,     -8,   -216,    189,   1282,    152,    -45,
-       -33,   1524,   2301,   -341,   1992,    939,   1678,   1011,
-       114,    167,    586,   -500,     40,   -473,   -274,    596,
-      1237,   -126,    205,    254,   -284,   -367,   -119,     64,
-      1915,    437,   -585,      1,    402,   -271,   -984,    530,
-       267,   3634,    495,   -219,   -728,    -67,  -1340,    983,
-       122,      6,    110,   -166,    111,    102,   -139,  -2499,
-       753,   1011,   1755,  -1252,    872,   -510,  -1844,   1388,
-      -782,    287,    461,     36,     77,    437,   -361,   -216,
-      -415,    158,    -77,   -123,     57,    -93,   3408,    504,
-      -942,    434,   -648,   -251,   -420,   -387,   1373,   -229,
-       236,   -191,      3,    204,    612,    393,   -285,    560,
-      -164,   -199,    303,    146,     93,   1248,   2425,   1001,
-      1261,   -239,   1085,  -1878,   -375,   -544,   -995,   -192,
-      -319,    542,    280,   -716,  -1323,    -67,    -34,    252,
-       -36,    206,   -126,    -28,     26,  -1135,   2799,    527,
-       -47,  -2008,    509,   -232,   -953,    332,   -386,   -108,
-       290,    507,    578,   -809,    375,    850,  -1413,    831,
-      -137,    259,     25,  -1075,    407,   1784,  -1539,   1658,
-      1450,   -969,    467,      4,    785,   -595,    912,     34,
-        91,    286,   1035,   -524,    276,   -322,     11,    651,
-       733,    243,     45,   -145,    357,    524,   -697,   -259,
-      -757,  -1057,    181,   1324,    148,   -502,    -64,   -379,
-      -746,   1385,    395,    184,   -749,   -197,  -3375,   -546,
-        -4,    532,   -270,    687,    501,    285,    401,    431,
-     -1888,   -639,    655,   -325,   1896,  -1883,     53,  -1018,
-     -1475,    802,   -486,    -68,    232,   1337,    428,    232,
-      1754,  -1687,   -518,   -372,    508,  -1269,    327,   -900,
-      -468,   1127,   1397,   1597,    837,    659,   -617,     99,
-       264,   -460,    296,     44,   -295,   -209,   -174,   1105,
-       896,   1065,   -174,      5,    845,   1311,   1370,  -2548,
-       351,   -660,    -24,  -1089,   -787,  -1312,    -22,   -585,
-      -197,    749,    293,   -112,   -169,    -23,      3,   1151,
-       529,   1173,    224,  -1517,    930,    -52,    268,  -1282,
-      -559,    466,   -528,   1506,   -231,   -337,    993,  -1314,
-      -250,  -3042,     57,     19,     15,   1812,    697,   -389,
-      -201,    647,   -723,  -1098,   -177,   -225,  -2694,   -495,
-      -431,   -238,    388,  -1731,    997,    227,   -765,   -222,
-        94,   -611,     35,    187,   -935,  -1470,   1013,   1051,
-      -378,    311,   -710,   -566,   -532,   -369,  -1599,    553,
-       167,    450,  -1068,   2834,   -125,    601,   -113,   -503,
-        40,     14,    -36,   -220,  -1543,    867,   -612,  -1834,
-       888,  -1791,   1296,   -229,   -593,   -760,   -197,    428,
-     -1290,    892,    -62,   1113,  -1228,   -965,    -90,   -300,
-       288,   -133,    779,  -1211,   -627,    268,    180,    913,
-      2230,   -413,   -146,   -217,    170,  -1157,  -1551,    877,
-        75,   1784,   -174,   -230,   -757,   1243,    625,    -49,
-       114,   -218,   -409,    195,  -1165,   1492,    213,   1100,
-      -101,   -957,   1016,    663,   -704,    817,     94,   -279,
-      -256,    469,    -75,   -123,  -2954,    948,   -407,    275,
-};
-
-static const int16_t cb4432s1[] = {
-      5416,   -223,   -123,    156,    -33,    185,   -144,   -108,
-      -199,    -68,    -36,     11,     37,    124,   -301,     58,
-       -21,    155,     99,    -10,    -78,    -26,    -70,  -3160,
-     -1037,     98,    155,   -373,    834,    652,   -277,   -429,
-      -529,   -103,   -358,    187,   1161,   -157,    147,   -400,
-       461,    156,    237,    481,    -67,     99,    939,   1179,
-      -659,   1337,    578,   -489,   -481,   -427,   -622,    131,
-      1826,   -734,   -995,     -5,   -461,    514,    -83,   -271,
-     -2928,    -86,   -382,   -205,   -133,   -386,   -195,    -67,
-       508,    586,    607,   -910,   -181,  -2046,   1212,   -179,
-        23,    408,  -1929,   2044,   2160,   -879,     74,    179,
-        72,   -164,     47,    162,   1497,    826,   2978,   -912,
-       454,   -618,  -1907,   -501,   -494,   -299,     96,   -138,
-      -114,    -51,   -171,    445,   1144,   -187,    217,    224,
-       402,     13,     42,    -58,  -1692,   4162,   1272,    970,
-      -278,    327,     88,    -31,   -182,    279,   -610,     78,
-      -432,   -147,   -142,   -725,    -17,    -95,    388,    133,
-       -61,     28,  -1365,   1441,    606,    411,    923,   -332,
-      1843,   1934,  -1451,   -514,   -283,    768,    940,   -428,
-        31,   1105,    248,    -78,  -1477,   -367,    404,     68,
-      -178,     17,    691,   -265,   -105,   1681,   -476,  -1307,
-     -3434,  -1700,   -524,   -871,    472,   -171,    237,    104,
-      -142,   -231,   -292,   -285,    266,   -259,   -166,    -97,
-      -432,   4003,   1220,   -356,   2110,   -220,   -465,    -48,
-       117,   -178,    290,    -21,    205,    -19,    321,   -343,
-      -328,    -57,    215,   -345,    304,      2,     10,  -2071,
-       185,    433,    212,  -1165,    112,    242,   -294,   -162,
-      1107,   1176,   -396,   1400,  -2600,   -434,   -640,    457,
-       100,   -268,    809,    128,   -236,    -66,    -94,   -842,
-        82,    163,    227,  -2641,   -485,    291,   -326,     42,
-       234,   -648,   1355,   3016,  -1403,    -71,    188,    792,
-        15,    -16,   -522,    -75,    106,   -824,   1133,    947,
-       477,   -642,   -531,   -808,   4100,    -34,   -407,    133,
-        33,     15,     63,     72,   -223,    -15,   -491,     38,
-        47,    258,   -236,    192,   1628,    173,  -2116,    687,
-       295,    -74,   -183,     95,    529,    149,   -372,    182,
-      1317,     21,  -1424,  -3156,   -111,    -96,    580,    284,
-      -274,     41,    145,   1314,     79,   1830,    262,   -325,
-       -16,    169,   -245,  -2038,   1959,    892,    946,    303,
-      -171,   -432,    883,     34,   -238,   2463,   -294,     25,
-        24,   -106,    -45,    509,   -154,    496,    109,    115,
-       169,    702,    396,    -97,    657,   -251,   -112,   -114,
-      -144,   -230,    517,   -190,   4885,    -45,   -152,     -9,
-      -170,  -2021,    541,   -905,  -2015,   2588,   -936,    -20,
-      -300,    384,    433,   -123,    119,   -505,   -126,    295,
-       526,  -1352,    450,    142,   -126,   -115,      1,   -140,
-      -734,    672,   -147,   -660,   -747,    652,    161,   -163,
-        51,   -616,  -1974,   1413,  -3145,    922,  -1289,    215,
-       182,   -838,   -171,    107,   -333,     34,    216,   -307,
-      -359,    496,   -343,   -325,  -2552,  -1573,    588,   -441,
-      1296,  -3075,    119,   -131,     54,    206,    278,    106,
-      -100,    112,    220,    -49,    -80,   -229,   1051,   3271,
-     -1300,    324,    -31,  -1025,   1659,   1526,   -161,    669,
-       -56,    430,    201,   -535,   -126,     -9,   -380,    222,
-       212,   -345,   -282,    195,    -41,  -1235,   -593,   -593,
-      1557,     71,   1023,   -831,    545,   -875,    161,   -772,
-        99,   -190,   1616,    338,   -251,   -201,  -3104,   -774,
-         4,   -121,    178,    -80,    652,  -1018,   -441,   -343,
-      -236,   -240,   -244,    -26,   2192,     75,  -1348,   3771,
-       -22,   -850,   -251,    316,    132,    -21,     63,    104,
-       152,    185,    -40,    275,  -1356,    482,   3081,    571,
-      -481,  -1387,    815,   1285,   -352,    -98,    -41,    573,
-      -307,  -1879,    427,    196,    169,    -26,   -232,    -98,
-      -411,   -231,  -2034,   -969,    271,   1421,  -1485,   -407,
-      1404,   -343,    861,    888,    -11,    202,   -245,   -397,
-       104,    229,    309,  -2757,    315,    416,    393,    194,
-      -176,   -663,   -166,   -229,    244,   -152,    183,     24,
-      -205,     97,   -255,   -299,    123,    -12,     53,    102,
-      -362,    371,    223,     46,    132,  -5177,    157,    -92,
-     -1114,    -28,    135,   -831,    627,   -428,  -1116,    421,
-       761,    458,   3256,   -167,    355,   2045,    113,    234,
-      -154,     20,    -39,     61,    -81,     63,     98,   -171,
-      1727,  -1193,   2103,    416,   -421,   -575,   -636,   -114,
-       700,   -260,   1610,   -336,    521,   2591,   -738,     43,
-       103,    -63,   -335,    168,    110,     41,   1995,   3554,
-      1443,    -53,   -206,    992,    767,   -372,    141,    -24,
-       173,     60,   -237,     69,   -173,    -73,    137,    167,
-      -164,   -159,    312,   -151,    -78,    619,   -192,    689,
-       -69,  -2805,   -259,   -288,   -231,     28,  -1682,   2316,
-      2298,   -336,   -131,     59,    542,   -218,   -281,   -214,
-       -41,    116,    138,      8,   -297,    -45,   -215,   -167,
-      1587,  -1061,  -1976,   -445,    401,  -2392,    -42,    581,
-      -519,   -230,   1461,    542,    113,   -634,   1776,    332,
-       191,      5,    174,   1939,    -26,   -242,    120,    230,
-      -986,   3501,  -1125,    -89,      3,   -580,   -219,   -255,
-        37,   -119,     94,    -17,   -297,   -176,   -434,   -234,
-        55,    -63,  -1167,   -492,  -1753,  -3397,    185,   -794,
-       689,    819,    -32,   -836,    335,   -133,    724,   -299,
-      -318,    424,    558,   -654,    119,   -447,    140,   -100,
-        72,   -872,  -1432,   -203,    -40,    -14,    -59,    550,
-        85,    -53,   5007,    258,    401,   -184,   -313,   -170,
-        66,   -185,    -82,    -61,    210,     48,   -204,    -96,
-       130,   -562,  -1700,  -1037,  -3926,   -884,   1115,     -6,
-      -100,    842,   -450,    877,     76,    568,   -623,     27,
-        73,   -195,    328,     41,    -24,    124,    -77,   1499,
-       540,  -1064,   4517,    -22,    -35,    839,    -48,    253,
-      -259,     96,    409,     90,     26,   -177,    365,    -48,
-      -324,    -26,    -23,    -83,    -77,    -80,   1599,   1486,
-       266,    659,    236,    231,    -16,    359,   -163,    455,
-      -999,  -1169,   2453,   -599,   -945,      4,  -2110,   -174,
-      -736,    344,    232,    142,     32,    -99,    763,    133,
-      -325,    -56,   1635,   -439,    843,      2,  -1704,    -13,
-       771,   3680,    -89,    182,      4,     42,    394,    404,
-        82,    312,     91,    141,  -1577,   1765,   3141,    625,
-      -271,  -2122,    423,    353,    489,    606,   -290,   -190,
-       486,   -131,    118,    236,    248,   -209,     -2,   -162,
-       -95,     95,    170,    278,  -2233,    549,     34,   -846,
-      3595,    445,   -400,    -65,    131,    -14,    -16,    611,
-      -116,   1293,     98,   -680,    189,    217,    -15,   -549,
-       131,      8,   -768,  -1082,    841,   -346,    129,    -33,
-      -778,    322,  -2508,  -2128,  -1895,  -2021,    -27,    -42,
-       -51,   -536,    239,     -1,     78,    105,     48,     79,
-       207,    422,   -181,     18,    -94,   -152,   -181,  -5012,
-      -187,     -3,   -118,   -397,    -84,    -49,    129,   -276,
-       188,     45,   -146,   -235,   -109,     83,     32,    -79,
-      2039,   -616,    257,  -1575,  -1756,  -2364,    222,    195,
-     -1138,   -290,     58,   -641,   -252,    -11,    402,    -31,
-     -1040,   -592,    676,   -118,   -231,     94,   -123,   1642,
-      1404,   -334,   -728,  -3425,    382,    111,   -194,    677,
-       177,   -182,    434,    860,  -1022,     84,   1214,   -733,
-       300,     -2,   -259,    140,     35,     96,   1164,  -1476,
-      -757,    -74,    239,   -203,   1796,   1207,   1732,  -3029,
-      -610,    658,    490,   -465,    136,     56,   -614,   -612,
-      -123,     93,   -151,    162,     56,    502,   1634,  -1825,
-        45,   1033,   1554,  -2380,   1615,   1317,    786,    387,
-      -255,   -423,    -44,   -246,   -213,   -149,    107,    -74,
-       -94,     45,   -204,     13,  -1959,    936,   2023,   1000,
-      1031,    112,    574,    323,    163,    947,   -657,    492,
-     -2624,    -44,    739,   -305,    -31,    247,    270,    213,
-       -46,    -90,     43,  -1504,    931,    -61,   4045,   -863,
-       389,   -386,   -130,   -374,   -583,   -800,   -900,    158,
-      -455,    169,    134,   -164,     54,   -117,   -185,    -90,
-      -203,    -41,   -811,  -2082,    169,    287,   -378,    -15,
-       231,     83,     89,   -187,    198,     18,    178,    -18,
-       527,    -40,     94,     54,     79,  -4356,    248,    162,
-       -94,  -1431,    -31,  -2048,    651,   1231,   -508,  -1089,
-     -1255,    766,   1673,    357,     13,   -813,  -2403,    179,
-      -470,     65,   -339,    154,      9,     56,    246,     66,
-     -2308,   1443,   -947,   -744,  -2473,  -1248,   -113,   1017,
-      -608,    149,   -182,     41,   -524,     16,    285,   -268,
-      -781,    -57,   -346,    194,    256,    -51,    107,   -484,
-      -190,   -125,   -645,    487,    314,     74,   -555,  -1012,
-       325,     76,    233,   -205,   -189,    -48,  -4593,   -122,
-        10,    121,    -91,    108,    -49,    254,  -1662,   2500,
-        87,  -1540,   -200,    287,   -329,    -50,   -401,    182,
-     -1300,    689,    915,   -224,   -768,    471,   -339,    133,
-       407,   -344,     99,     96,    111,   1224,  -1431,   2069,
-      -282,    127,    397,   -119,   1332,  -1299,    744,   -535,
-       800,    327,    874,    700,   -424,  -1596,   1365,   -651,
-      -151,    113,    102,    -24,    464,    125,    911,  -1583,
-      -372,    747,      2,    429,    -47,    -64,     34,   1700,
-      -741,    343,    728,   -226,   1889,     78,   -515,   2827,
-        77,    -66,    108,    515,     90,   2227,   -678,   1301,
-      -974,    122,   -983,   2357,     64,  -1479,    186,   1436,
-      -245,    204,    460,    191,   -677,   -335,   -200,   -135,
-      -106,   -101,   1112,  -2733,   -641,     73,   1265,  -1281,
-     -1332,   -743,    675,    129,  -1144,  -1169,    331,   -143,
-       -87,    809,   -891,   -848,    246,    243,     97,   -170,
-        36,  -1109,    102,   1055,  -1395,   1384,   1155,    439,
-     -1549,   -300,  -2069,   1014,    187,   -782,    980,   -971,
-      -345,   -583,    -66,   -138,   -317,   -124,     48,   -152,
-       -98,     92,   2446,    128,  -1232,   2148,   -337,   -615,
-       467,   1573,   -613,    857,    303,    422,  -1340,   -420,
-       305,   -626,     94,   -496,   -386,   -129,    243,     27,
-      -200,  -1373,   1468,  -2040,    151,   -675,     65,   1464,
-      -432,    545,    269,   -510,    584,  -1935,    970,   -319,
-      1465,    490,    263,    555,   -256,    -49,    315,   -242,
-      -394,   -312,    -88,    201,   -121,   -302,    172,     49,
-       234,     59,    327,    155,    199,   -187,    -41,    -74,
-        52,    -31,    -59,  -5574,   -121,    282,    343,   -125,
-      -200,   -575,   1328,    155,  -1928,    250,    702,     21,
-     -2718,   -153,   -102,   2131,    612,    432,  -1072,   -457,
-       222,    427,    144,    149,   -433,  -1573,   1337,   -650,
-       176,     13,  -1273,    280,   -751,   -236,    453,    204,
-     -1595,  -2896,   -272,    233,    485,     82,   -139,   -528,
-      -140,   -399,    -56,   -274,   -335,    176,   -756,    243,
-      2250,   -305,    721,   1711,      7,  -1230,  -1590,  -1872,
-      -137,   -714,    263,  -1643,    362,   -266,   -176,     64,
-       -36,    -63,    687,   -483,  -1488,    709,    929,   1349,
-     -1245,    645,  -1619,    735,   -651,   1850,   1031,    159,
-      -625,    838,    242,   -396,   -397,    -41,   1237,    304,
-        81,    -94,   -736,    578,   1279,   1064,     81,   1900,
-      -179,    224,    266,   -429,    734,    500,    995,   -882,
-      1563,   1813,   -519,    758,    532,    -27,     27,    453,
-};
-
-static const int16_t cb4432m0[] = {
-     -6132,   -262,   -273,  -1250,   -577,    984,   -430,   -410,
-      -464,    577,   -578,   -178,    -32,    369,   -624,    267,
-       -68,    474,   -480,   -225,    166,   -409,    437,   4633,
-        98,  -1560,   -464,   -869,    103,    193,    461,     72,
-       292,   -245,   1102,    417,   -325,    461,     74,     43,
-      -120,   -213,    333,    160,   -468,   -212,     31,    -81,
-      6516,    182,    201,   -212,    -66,    -49,   -266,    148,
-      -108,     98,    -46,    -11,    -59,    -20,    -20,   2332,
-      -294,   -560,    198,   -647,    -47,   -638,  -3877,     11,
-       834,    547,     47,   2541,   -126,     -5,   -366,    339,
-         3,      2,    -66,     60,   -526,    914,    321,   -658,
-      3605,     59,  -2392,   -655,    384,    775,    366,    327,
-       356,    386,    751,   -375,     38,   -205,    -15,   -442,
-      -212,  -1241,   1913,   -421,   -755,     45,  -1637,    -36,
-     -2435,   1504,  -1248,   -763,   -664,    133,   -123,    814,
-       241,   -243,   -446,     66,   -131,   -213,   2036,   1294,
-     -2138,    677,  -1042,   -771,    294,    371,    474,     85,
-      1403,  -2618,   -478,   -537,    275,   -826,    349,     84,
-       264,   -272,    -61,   -705,    175,   -972,    868,     25,
-      4183,    881,   -639,   -833,   -757,  -1063,   -991,   -257,
-      -137,   -619,   -285,   -454,     77,   -169,    316,    -45,
-      4362,   -203,  -2132,   -424,   -820,   -503,    340,    340,
-      -612,    648,      2,   -342,     81,    630,  -1518,    235,
-       216,    210,    665,    231,    130,   -879,     38,    675,
-      -136,    -48,    540,   -234,   -152,   -169,  -5745,   -294,
-       -24,      8,   -129,     -8,    308,    -14,    -16,    147,
-        62,     70,    248,  -2014,     76,   -190,   -328,  -1899,
-      -353,   -140,    836,   -365,   -112,  -3945,   -736,    467,
-      -258,    601,    617,     74,     62,    394,    180,   1151,
-      -810,     36,    457,    406,     75,     -8,  -5004,   2335,
-      -108,   -123,    299,   -335,    112,   -499,   -268,   -185,
-       461,    208,    -38,   -164,    764,   -504,    272,   4853,
-       396,    265,  -1133,   -433,    769,   -458,   1005,    645,
-        81,   -172,    385,    -56,   -130,   -393,    128,    -73,
-        31,   2038,    127,   -436,    123,  -2525,    282,   -448,
-      -489,   -295,    -14,     85,   -462,    -49,    262,    -93,
-       238,   -148,  -3953,   -414,   -259,     33,   -892,    459,
-     -2186,     60,    444,   -610,    844,   -486,   -299,    219,
-      -433,     19,  -1183,    276,    -29,    388,   3327,    102,
-      -914,   -221,    486,   -892,   -550,    190,    151,   -141,
-      -336,    194,   -242,   -224,    405,    879,   1600,    349,
-     -2082,    -38,   -514,     18,  -3574,    161,   -142,    -38,
-     -1815,    540,    228,     33,    164,   1074,      4,   -278,
-       -58,   4085,   -295,   -795,     31,    494,    555,   -250,
-        22,   -202,   -312,     92,    109,   -238,   -448,   -622,
-     -1511,  -4346,   -417,   -706,     37,   1157,    -96,   -199,
-       -59,    285,    -43,   -217,    -22,    -95,    103,   2242,
-       244,     45,    -74,     -7,    366,    -79,   -359,   -286,
-       188,    -14,     34,     49,    245,   -108,    -84,     88,
-      -333,   -216,    -79,     15,  -5710,    -36,   -102,   -552,
-      -213,     -8,   -356,    515,    212,   -265,     80,    316,
-     -1163,   -561,   -517,   -714,   -375,  -4176,     73,   -666,
-      -363,    -28,   1248,    -68,    478,   2648,    642,   -710,
-      -555,   -744,   -166,   -744,   -596,    138,    499,     59,
-       453,   -583,   -290,    -11,    -48,   4174,   -252,    -74,
-       -78,    -62,    449,   -265,   -818,   -357,    171,   -513,
-        72,    106,    -45,    649,    145,   5558,    -60,   -136,
-        69,   -172,   -134,    -66,    -68,    100,    683,   -427,
-       795,   -407,    345,   4930,   -838,    361,    279,   -190,
-       173,   -341,     -9,    722,    383,   -140,    123,   -269,
-       154,     31,    335,   -465,    311,     46,   4535,   -131,
-        90,    151,    287,    -11,   -526,   -614,  -2253,   -321,
-       -93,   -550,   -128,     25,    303,   -139,     19,      0,
-     -3255,   -161,    276,    103,   -245,   -515,    816,  -1042,
-     -1449,   1693,   -627,   1287,   -837,   -727,    -80,   -478,
-      -337,    116,      1,   -270,   -567,   -311,   -407,  -1656,
-      -216,    196,   3004,   -285,   -521,   1510,   1818,   1392,
-        42,    -44,   -244,   -349,    959,   -183,     25,     58,
-        43,   -345,   -310,  -8192,    -84,    311,    -60,   -348,
-       125,     33,    -79,   -138,     88,    138,   -121,    -37,
-      -211,   -118,   -142,    -37,   -132,    181,    162,  -1423,
-      1781,  -3453,   1261,    134,    670,   1218,    761,    292,
-      -146,   -825,    672,    737,    293,    433,    245,   -392,
-        46,    598,    257,   -234,  -1201,    718,  -4549,   -573,
-      -696,   -224,    -85,     75,   -268,    244,   1817,    341,
-      -166,    436,   -386,  -1247,     22,   -112,    -55,   -451,
-       106,    388,    -32,   -254,  -2400,   -373,    892,    334,
-     -4114,   -307,   -107,   -316,     41,   -214,   -403,    -56,
-      -469,   -246,    120,   -237,    266,     43,   3257,  -3925,
-       291,    239,    752,   -411,    162,    437,    159,    256,
-        37,     71,    -79,   -136,   -475,    124,   -208,   -216,
-      -245,     16,     40,   -459,  -4320,    340,  -1462,    914,
-        10,    490,    436,    162,    271,   -238,    -38,   2219,
-        25,   -141,    405,    107,    235,    282,    -55,     -7,
-     -3429,    565,  -1095,   -678,   1979,    233,   -874,    592,
-      -474,    680,    402,   -738,     21,    274,   -321,    655,
-      -348,   -546,    510,     62,     23,   4722,    572,    423,
-      -256,    473,   1240,   -997,   -899,    -53,    -73,    332,
-      -902,   -771,   -335,      0,    769,   -587,    592,   -703,
-      -600,    -77,    -94,   -207,    792,   -133,   -758,    500,
-       -14,    330,     22,   -281,  -5460,    152,    607,    337,
-       -39,   -118,    -80,    -51,    228,     65,     -6,    540,
-     -3515,  -1712,   -449,   -157,   -164,   -195,  -1655,  -1285,
-        90,   -517,   -116,     11,   1402,   -162,    -64,   -103,
-        46,    302,     37,     71,   2903,   2952,    780,   -487,
-      -297,   -426,   -369,    150,   -129,   -233,    813,   1639,
-       190,    310,   -311,    320,     94,   -247,   1484,    -32,
-        70,   -220,    560,    372,     54,    205,     96,  -3567,
-      -680,   1683,  -2377,     17,    548,   -266,    257,    656,
-       331,    205,   -121,   -814,    139,    326,   -370,    625,
-      2035,    818,    775,  -1165,    -41,  -4258,     41,   1109,
-       984,   -885,    -43,   -314,    204,    204,     95,    407,
-      -351,    101,    133,   -929,    899,     -6,    384,   -177,
-      -330,    240,     90,     78,   -318,   -455,     -5,   -365,
-       -61,    -80,    -72,  -4850,   -338,   -384,     30,    181,
-     -2721,   -767,   3217,    453,   -226,   -582,    283,    135,
-      -103,    265,    494,  -1444,   -120,     70,   -976,    -67,
-       -90,    660,    366,   -609,     32,    205,     73,     51,
-       346,     -6,   -120,    -10,    300,     32,    270,    139,
-       -55,    453,   5712,    353,   -145,    176,   -168,    216,
-       205,    -30,   -304,   1085,    221,    464,   -426,   1662,
-     -1397,  -1114,    301,  -1058,   3553,   -388,    743,    696,
-      -893,   -296,    -57,   -254,   -251,   -178,    417,     82,
-      -988,  -3566,   2171,  -1312,   -954,    -23,  -1349,    480,
-       566,     24,   -643,   -292,    -68,    303,     73,    -81,
-       296,      7,    371,     94,   1718,    498,   -774,    857,
-      1014,    358,    436,    210,  -3481,   -202,   -416,     59,
-      1987,    137,   -476,     32,   -627,    193,    368,     -3,
-      -290,  -3035,   -352,   -455,   -609,   -175,     -5,   -600,
-      -181,   -249,  -2551,    226,    105,   -249,   1851,    -86,
-     -1203,    214,    -57,   -505,   -522,   -247,   -154,    -40,
-       -17,   -523,    333,  -1777,   -354,  -1568,  -3492,   1032,
-      1577,     90,    153,    534,   -106,   -538,    102,      3,
-      -198,    -99,    -23,    835,   3495,  -1099,     44,    732,
-      -350,    926,   -472,    533,   1529,     54,   -844,   1295,
-       573,    414,    -23,    -71,    279,   -891,    287,    126,
-      1456,    973,    456,   1608,   -646,  -1244,    452,    651,
-       694,    855,   -235,   -503,    745,   -544,  -3512,   -138,
-       678,    473,    220,   -273,     -9,    265,  -1874,    397,
-      1196,    284,   -963,    298,    318,  -2309,   -162,    322,
-     -1250,    -16,  -1004,     -5,   2800,    -64,     72,   -482,
-      -162,   -412,  -2922,    774,   -335,    238,  -1144,   -134,
-      1428,    558,   1969,   -659,    902,  -1698,    793,   -858,
-      -613,    998,    253,   -336,   -348,    -80,   -117,   -264,
-       355,    808,    784,   -559,   2030,   1952,   -244,  -1130,
-      -986,   1883,   1171,   -493,   -326,   -880,   2588,   -243,
-      -204,    194,   -172,    -65,   2026,    424,    587,   -317,
-      2550,   -601,    203,   -669,    475,   -676,  -1492,     27,
-        41,  -1078,   -299,   -630,    177,   -164,   -429,   -246,
-      -357,   1191,   -867,  -1363,   1621,   -110,    916,    217,
-     -1269,    622,   -434,  -1113,    888,    -41,   1020,  -1774,
-        46,     80,   -483,   -892,    -61,   -472,    193,   -192,
-      2000,   -103,    740,   -223,   2493,    422,   2508,   -331,
-       470,  -1233,     47,    595,    795,   -465,   -320,   -163,
-       128,      6,   -209,    603,    536,   -416,  -1455,    -87,
-     -1191,    -98,   -281,   1003,   1421,    388,   1163,  -1146,
-       -81,   -299,   2518,  -1072,    207,   -443,    506,   -220,
-      -346,     98,   2119,   -416,  -2268,   -498,    109,  -1342,
-      -335,   1125,   -712,    156,  -1088,  -2092,   1164,   -500,
-       113,    -17,    551,   -199,    262,    -27,   -692,   -629,
-       204,  -1448,  -1606,  -1554,    289,    382,   -691,   1229,
-       414,  -1746,  -1198,   1113,   -386,    310,   1354,    -12,
-      -284,   -569,     46,   -558,   1495,    172,   -899,    617,
-       827,   -365,    100,   1008,    136,   2111,     10,   2320,
-      -291,    364,   -401,   -408,   -528,   -612,    127,   1218,
-      -384,    129,  -1603,    438,   1029,   2536,   -150,  -1432,
-      -856,   1068,    773,   -762,   -808,    676,   -693,    404,
-       145,      4,     27,   -148,   -318,  -1019,   -277,   1404,
-       880,  -1135,    861,    903,    739,    303,    139,   1918,
-      -952,    801,   -306,  -2439,     -3,    442,   -590,  -1034,
-       178,    430,    153,   1853,   1997,    742,   1745,   -608,
-      -237,    160,    523,    950,     82,  -1468,  -1592,    807,
-       719,    618,    319,     57,    235,    287,   1344,    -50,
-       324,   -182,   -365,   -381,   -377,   1989,    147,   -573,
-      1246,   1769,   -473,   -178,    961,  -1297,   -750,  -1428,
-     -1246,    789,    158,    612,     17,   -292,   -227,   -142,
-        64,     51,    -16,   -301,   -287,    -60,   -404,   -267,
-       109,   -108,    189,   -438,     48,     95,  -5059,    -42,
-};
-
-static const int16_t cb4432m1[] = {
-      7567,    273,    268,    -74,    201,    274,   -149,   -146,
-      -262,    243,   -273,     63,   -127,    135,   -160,    231,
-       120,    209,    -91,   -218,    -38,  -1206,   -468,   -159,
-       278,    536,   -995,    -60,     22,   1041,   -550,   -121,
-      -241,   -664,    427,   -416,  -1395,   -732,    152,   3247,
-       -67,   -154,  -2430,    421,   -405,   -558,    -73,  -2887,
-      -272,    -60,    365,    745,    287,   -622,  -1103,    412,
-       266,     82,     61,  -2172,   -379,    529,   -125,  -1482,
-       319,    643,    222,   -508,   2451,   -970,     71,    237,
-      -280,    202,    983,   -223,   -307,   -130,    217,   3209,
-        49,    -30,    275,    -12,   -260,  -3959,   1219,   -104,
-     -2700,   -201,     54,    851,   -590,    691,   -254,    408,
-       296,    -48,   -364,    216,     16,    220,   -415,    218,
-        83,     43,  -4032,  -1359,     25,     15,   -279,  -2092,
-       794,   -433,   -195,   -162,    606,    166,     87,   -316,
-       508,    242,   -359,    687,   -178,     14,  -2969,   -500,
-     -1041,   3234,    679,    170,   -791,   -127,   -630,    -16,
-       -19,    181,     -2,   -185,   -172,    -88,   -118,   -167,
-       128,    121,    239,    321,   -125,    217,  -7260,   -157,
-      -161,   -347,   -257,    102,  -1181,     71,   -379,   -205,
-      -268,    144,   -174,   -106,    305,     23,    -47,    202,
-      -110,    660,     54,  -2963,   -119,  -1371,  -2823,   1171,
-      -726,    690,    534,    161,   -435,    753,     58,    227,
-       241,    138,    -76,    473,    193,  -1926,  -2183,  -2526,
-     -1428,    284,  -1270,    336,  -1458,    208,     41,   -356,
-       345,    153,   -273,   -166,    500,     42,    120,    -35,
-       -81,     56,   1747,  -3050,  -2029,   -764,   -947,    888,
-       422,    374,    143,   -318,   -225,    604,    343,    -91,
-      1626,     75,   -211,    160,   -667,   -195,     38,   -446,
-     -1269,   -108,   -959,   -616,   -530,    554,   2865,   -156,
-      -358,   -429,   -261,     23,    511,    340,   -548,   2347,
-       105,     12,    -32,    164,    170,   -168,    268,   2587,
-      3511,    612,    329,    159,    456,    273,   -452,    168,
-      -394,    799,    -58,    160,   -480,   -257,    242,    167,
-        46,  -1433,  -1631,     50,    852,    509,    864,   -381,
-      -306,   -698,    261,   -702,    -19,   4113,    -38,   -153,
-       -11,    405,   -441,   -120,    139,   -265,    225,    342,
-       199,   2085,    237,    278,    252,   1537,    119,    182,
-      -174,   -193,   2486,     87,   2903,   -311,   -304,    273,
-      -217,   -256,   -264,   -675,   -819,   -188,   -615,  -1183,
-       495,   -154,   -687,   2423,    197,    -63,   -146,   1151,
-       896,  -1129,    -58,   1114,  -1644,   1219,   -648,    -71,
-      -130,  -2643,    533,   -218,   3942,    -83,    208,   -724,
-       198,   -643,    590,   -944,    -56,   -420,    115,     23,
-      -414,   -144,    295,    219,    -36,    393,   -174,     91,
-       290,  -7066,    158,   -275,    -70,   -119,     -1,    302,
-      -262,    -73,    -61,    110,   -196,    -25,     87,   -446,
-      -159,     -6,   -107,    115,  -7562,      5,    -33,    284,
-      -106,     34,   -140,    160,   -304,   -272,   -169,     25,
-        93,   -205,     28,    169,   -165,    -34,    -50,    343,
-      2204,   1440,    817,  -1921,   -590,   -527,     81,   -364,
-      -354,    163,  -1058,   1977,    244,    -75,   1201,   -207,
-       293,   -289,   -105,   -121,   3588,    925,     -2,   -201,
-      -860,    917,    100,    265,   -200,    -44,   -529,    351,
-      -579,   -103,    186,  -3622,     52,    181,   -259,   -411,
-        -4,   -328,    380,    517,    306,     57,    340,    -65,
-      -263,   -311,    494,    326,  -6136,    747,   -141,    296,
-       217,     -2,   -125,      8,    -88,    254,  -2934,   -259,
-       946,   -905,    653,    436,   3393,   -147,   -157,     27,
-       166,    299,      8,    -16,    643,    114,    217,     57,
-       -21,   -298,     19,    129,   1721,   -134,   2337,    781,
-      -483,   -748,    118,   -330,   -226,  -3762,    222,   -417,
-      -154,    -24,    -13,   1138,    210,    357,   -122,    257,
-      -369,    863,     13,   -320,   -439,   -433,   3469,   -869,
-       116,  -2772,    202,   1065,   -130,   -287,    142,   -288,
-        54,    318,    131,    -16,     84,    238,   -361,    934,
-      1341,     37,    130,   -412,    146,   -724,     -3,   -823,
-      2555,  -1263,     11,   -147,   3164,    -83,    -39,   -127,
-       258,     26,  -1181,   3339,   -676,    -30,    -56,    691,
-       867,    715,   -903,    293,   -205,   -392,    -22,    529,
-       -76,   2201,    433,    134,   1338,    -18,     85,   3128,
-        33,    924,    257,   1662,   -769,    321,   -449,   -374,
-       -58,   -597,  -1670,     97,    222,   -998,    404,   -155,
-       133,    358,   -250,   -125,    163,   6027,   -228,   -116,
-       -61,   -878,   -693,    710,   -516,   -191,    -27,    443,
-        83,   -174,   -695,   -117,   -107,    -53,   -142,     92,
-      -145,   -114,    -62,   -710,  -3192,   -872,   3284,   -521,
-       -36,   -948,    252,   -253,   -143,    260,    109,    -24,
-       262,   -169,   -196,    195,    105,     27,   -135,   1722,
-      1862,   -513,   -270,   -144,   -414,    -59,     91,   -288,
-       -96,    -56,   -204,    273,    170,   -171,    -62,  -4993,
-      -125,    -67,    -50,    226,   -275,    600,    105,   -217,
-      -450,    -87,    -20,   -353,     24,    -74,    167,   1881,
-     -4260,   -144,     48,     92,    187,    319,    341,     22,
-        -4,    405,    147,    237,   -120,    122,   -237,     56,
-      -515,   -153,    333,    834,    401,    210,  -5516,      7,
-       127,    147,   -140,   -479,    -26,  -1669,    -21,   -147,
-        60,    387,    565,   -140,  -5827,   -269,  -1119,   -324,
-       118,   -199,    -11,    105,    -49,    150,   -148,    178,
-       182,    162,    150,     68,   -227,      3,    221,   -330,
-       -23,     65,   6262,     71,     48,    -41,    -10,     -1,
-       -44,   -255,    -50,   -138,   -109,    -54,    -31,    492,
-      -214,    239,   -194,     35,  -6348,   -148,      9,     25,
-      -123,     84,   -448,    241,    148,    -35,     52,     35,
-         7,     99,    -16,     57,    -43,   -256,   3336,    373,
-       211,   -513,   2328,     86,   -274,    386,     74,   -174,
-       624,  -1037,  -1154,     36,   -209,  -1028,   -101,   -412,
-      -103,   -267,   -107,   -126,    163,   -394,  -1097,   -100,
-     -1575,   -542,   3326,  -2149,    547,    626,   -278,   -414,
-      -781,    486,   -186,   -159,    138,   -187,   -821,    419,
-       393,  -4266,    828,    431,     86,    745,   1313,   1484,
-       260,     52,    163,   -455,  -1071,    186,    522,    288,
-       421,     18,     97,   1267,    200,   2637,   -189,    729,
-       746,    203,   -639,   -843,   2164,    671,     84,  -2384,
-       430,   -161,    404,    166,    -33,    -17,    591,   -227,
-     -3849,   1579,    175,   -718,     99,   -410,   -844,   -239,
-        32,    212,    163,    480,    843,   -379,   -621,   -317,
-      -424,    113,   -262,     44,    -93,    529,    144,   -218,
-       140,   3257,   -575,  -2697,    144,    -83,   -186,    -44,
-       977,    153,   -230,  -1530,    234,    212,    212,    331,
-       412,   -125,     -3,    422,   -329,  -2181,   1406,    363,
-       -90,    -86,    329,   -267,  -4462,   -189,    -87,    154,
-        66,   -200,     37,     80,   -109,   -199,    125,   1983,
-       260,   -438,  -2417,   3259,   -974,    453,     41,    -77,
-      -538,   1123,    119,    120,    254,   -239,   -134,     33,
-      -384,   -407,     27,    465,   1810,   -910,    980,    -15,
-     -1307,   -919,   1880,   -327,   -303,   -198,    149,    413,
-      2176,   2269,   -707,    343,    360,    169,    148,    182,
-       104,    163,    857,    291,   -153,    303,   -679,   -386,
-      -868,   2283,   -320,    167,   3257,   1741,    338,    467,
-       209,    207,    834,   -226,   -479,   -120,   1674,    -61,
-       696,    -93,  -1327,   2176,    716,    402,   1688,   2219,
-      -339,    779,    366,    358,    241,   -695,   -272,   -136,
-       -48,     36,   -269,    862,   -616,   -118,  -2028,   1678,
-      1971,    115,    290,     71,   -765,     31,  -2874,    122,
-        13,   -424,   -281,   -320,    233,  -1032,     40,   -186,
-      1208,    274,  -2310,  -1594,    289,    230,   1264,    962,
-      -310,     23,   -548,     12,    -38,  -2734,    664,     37,
-       346,   -620,    266,    -98,     82,   2369,    963,  -1391,
-      -451,    833,     82,    175,    448,   1874,    345,   -440,
-       155,    130,     94,    326,   3223,    234,   -163,   -384,
-      -354,   -539,    827,     -9,    530,   -226,    -21,    332,
-     -2298,   3221,   1470,   -282,   -800,    231,    314,   -998,
-     -1051,   -648,   -434,    743,    -72,    119,     91,    414,
-       379,   1370,   -637,   -998,    851,  -2904,   -266,  -1652,
-     -1356,  -1339,  -1679,   -181,    245,    731,   -231,     -2,
-       221,   -182,   -325,   -411,    346,    246,  -2629,   1736,
-      -361,     24,    229,   1168,    747,    309,    425,   -128,
-      -320,   -496,    109,   1496,    -70,   -797,     37,   -271,
-       -39,    906,    -62,   -194,   1753,    311,    689,   1354,
-     -1035,   -973,   -438,   1166,   2197,    -99,   -380,   -274,
-     -1565,    447,    100,    349,    485,    653,    744,     50,
-      -582,   -123,  -1396,    156,    -27,    349,  -1067,  -1382,
-      1388,  -1061,   -554,    894,    -80,   -783,  -1500,   -736,
-       897,   1158,  -1386,    -40,   -280,   -819,   -672,   -895,
-       994,   -308,   -466,   -578,    455,  -1536,    879,   -448,
-       542,   1508,    850,  -2465,    816,    641,   -427,    310,
-      -168,    -41,   -908,   -302,   1513,    -29,  -1144,    588,
-     -1703,   1144,   2623,     90,    284,    866,    335,   -351,
-       419,   -745,    879,   -183,   -824,  -1713,    -34,    -15,
-      -913,     37,   -460,    778,   2130,   -145,   -153,   1761,
-      1420,   -243,    -32,   -877,    140,   -700,    612,  -2053,
-       321,    -78,   -165,    200,    526,  -1002,   2176,  -1022,
-      1436,    298,    -21,  -1378,    515,    304,    974,   1722,
-      2054,    661,    425,    282,    471,    438,     70,    169,
-      1587,  -2076,    -40,   -702,    264,   -146,  -1499,   -863,
-     -1775,  -1059,   -490,     92,    631,  -1194,  -1031,    335,
-       257,  -1299,    241,   -270,   -325,   -322,    -37,      0,
-      -685,    897,    984,   -909,   1556,   1281,   1367,  -1269,
-     -1591,    415,  -1156,   -374,   -110,   1552,   -695,     74,
-      -167,   -473,   1421,   -611,    175,   1521,   1322,    436,
-      1969,   -787,   1041,   -730,   -598,    188,   -794,   -531,
-     -2198,   -317,    -11,     -8,   -407,    198,  -1180,  -1675,
-       174,    981,    467,   -149,   -890,    263,   1030,   -121,
-      2147,   -135,   1975,   -634,    431,   -238,   -695,   1338,
-      -172,    110,    147,   -334,   -726,     65,   -873,    667,
-       997,  -1118,   -339,    144,   -700,   1303,   -207,   -609,
-     -1617,   -765,    839,    505,    -36,    -58,  -2894,    226,
-};
-
-static const int16_t cb4440sl0[] = {
-     -3624,   -495,    158,   -246,   -529,   -813,    689,    504,
-      -527,  -2216,   -198,   -323,   -690,   -591,    175,    262,
-       243,  -3676,   2648,   -986,    166,    243,    301,   -700,
-       324,   -324,     13,    362,    222,   -470,     30,     20,
-       -46,   -147,   4050,    -97,   -560,    284,    317,  -1611,
-       655,   -416,  -1582,   -675,    389,   -124,    150,    -27,
-       325,    -84,     48,   7474,     97,    105,     19,     38,
-       133,     19,     28,     25,     40,     34,    -59,     22,
-        11,     27,     21,      5,  -1596,   -428,    439,    353,
-      2288,    -18,    357,   -274,   2582,   -126,    -90,     71,
-        -9,   -704,    205,     22,     44,   -120,    -43,    517,
-       817,   1370,   2151,   2818,   -470,     90,    395,  -1243,
-      -345,    959,     19,     -1,    123,   -108,    347,     25,
-      -138,     15,    119,   -117,   -146,    142,    183,   -254,
-      -276,   -174,   5980,    283,   -317,     70,     51,    -15,
-     -2447,    -79,    234,    736,  -2600,   -641,  -1162,    376,
-       959,   -250,    701,    -40,   -102,    204,    -38,    -24,
-      -893,   -387,    339,   1338,    -91,   -655,   -864,     78,
-       299,    228,  -2732,    234,   1995,  -1321,   -139,    500,
-      -316,   -140,      2,    -80,    186,     11,     16,    -69,
-     -7534,     85,   -263,    189,     -7,     -1,    -67,    -68,
-         3,     24,    391,  -3299,  -2952,   -121,   -393,    103,
-       -60,   -113,    141,    185,   -119,    240,    270,   -392,
-      -105,      9,    -39,   2529,    -17,    353,   2966,   -855,
-      1042,   1294,    132,   -257,   -257,   -496,    112,   -179,
-       424,    486,    -63,     77,    275,   -198,   2026,   1657,
-       913,   -255,   -147,  -1748,     -5,    418,    356,   2022,
-       927,   -295,    194,    165,     28,    109,     13,    209,
-      -133,  -2802,    420,  -1873,   -648,    309,  -1172,  -1825,
-       -36,    840,    280,     44,   -118,    128,     34,    241,
-     -1005,   1160,   -303,    318,    726,  -1716,   2625,   -950,
-      -839,  -1257,   -901,   -238,   1123,    131,    252,      1,
-       440,   1455,    -14,   -274,   -461,     87,   -515,  -2299,
-       928,  -2867,   -804,   -215,    680,    147,     80,    215,
-        15,   1339,    141,    -95,    134,    -35,    122,     53,
-       429,    168,    476,    -45,    745,    236,   4229,    318,
-       247,   -201,   -372,   2289,    161,    431,    337,   -707,
-     -1024,    121,  -1773,   -795,  -1187,   -401,    394,  -1431,
-      1526,    -35,    432,   2929,     90,   1880,    628,   1298,
-      -552,   -498,    207,    -97,  -1431,   1105,     29,   -739,
-       -56,     62,     94,    537,   -732,   1255,   -766,    200,
-      -365,   2846,   2139,    435,     92,   -710,   -512,    360,
-      -339,   1021,    474,   -132,    405,   -440,   3435,     75,
-      -254,  -2443,   -880,    325,    343,    285,    230,   -431,
-      -191,    215,    201,   -443,     93,    -81,   -131,   2981,
-     -2986,   1003,    437,    434,   -386,     17,    222,     70,
-       173,   -550,    267,   -121,    -43,    114,    -11,   -795,
-       561,   -147,    187,   -198,  -4969,     50,     59,    674,
-      -853,    163,     71,   -205,   -284,    -50,    -28,  -1412,
-      -105,    262,    272,    565,   -824,   -541,   3381,    430,
-       -81,    228,   -426,    978,   -294,    422,   -538,     13,
-         9,    430,    180,   2329,   -564,  -1082,   1740,   1108,
-     -2011,     11,    343,    868,    723,   -806,    342,    339,
-      -141,   -173,    186,     50,    297,    705,    783,   -593,
-      1609,    212,    528,  -2547,   -863,  -2457,   -876,    164,
-       162,    365,     68,     30,     11,     48,     47,   -285,
-       -64,    166,    -21,  -6880,   -191,   -226,     89,     -1,
-        22,    -93,     -6,     44,    282,     52,    294,   -690,
-      -147,    372,   2247,    804,   -637,     54,   2385,  -1799,
-       315,   -929,    692,    -65,    -54,    218,   -752,   -519,
-      2171,    177,    907,     22,   -778,  -2656,     62,   -418,
-      -434,    307,   1906,   -280,    196,     76,     58,    -46,
-        70,   -367,    -67,     50,    125,     77,   -547,   -287,
-       -97,    -10,    -84,   -271,  -4856,     10,    490,   -560,
-       -21,     66,  -2469,   -322,   1021,    936,    625,  -2520,
-      1144,   -373,    270,    804,    603,    -91,    262,    659,
-         9,   -324,     50,   -712,   2705,  -3016,    594,     87,
-       -88,    697,   -205,   -799,   -128,     37,    504,     59,
-      -274,    655,    672,    -20,   1294,   -221,  -2954,    198,
-       674,  -1676,    863,    324,    968,    731,   1125,    -41,
-      -149,   -303,    223,   1370,    -67,   -194,     -1,   -194,
-       251,   -459,    -39,   4477,    113,    -74,   -386,    214,
-       -72,    -77,  -1593,    511,   -461,    752,   -559,   -476,
-       204,   -722,   1050,   2080,   2468,   -154,   -208,    964,
-       103,    -58,    390,  -1863,    910,   -307,    209,    -32,
-       663,    103,   -133,  -3137,   -423,    259,   -605,   -242,
-       139,   -391,   -488,     77,   -266,  -1694,    397,   -659,
-       237,   2068,     -3,   -867,    870,   1647,    645,   1848,
-        68,    382,    455,   -551,    -87,    -99,  -2926,    372,
-      2438,  -1166,     -6,    521,   -195,   1259,   -162,    917,
-       140,    275,   -273,    133,    318,    -25,    252,   -119,
-      -132,   3120,    397,    398,   -420,   1756,    666,   2176,
-      -141,    271,    -51,     22,   -494,    -36,     57,    308,
-       222,   3585,     16,   -265,   2628,    -24,    162,     13,
-      -240,    -96,    620,    331,   -449,    710,   -123,   -105,
-        23,   -170,     20,    256,  -5228,    398,   -186,    272,
-       129,    175,    598,    -16,   -502,     11,   -215,     28,
-      -110,   3570,     68,    199,  -2535,   -933,    781,   -762,
-       325,     18,   -438,   -319,    473,   -677,    176,    290,
-         0,     67,     -6,   -156,     31,     35,   -131,   -127,
-        24,   -100,  -6826,   -117,    -53,    -40,     99,    -50,
-       -93,     31,     34,   -251,    186,    487,   -203,   -662,
-      -182,    -96,    239,    308,    338,    -86,  -4871,    264,
-       -48,    314,    -66,    100,   -188,    151,     24,    198,
-         4,   5046,    -47,   -654,    -43,     41,    109,    103,
-      -262,     93,   -118,    -63,     58,   2088,    336,   -320,
-      2326,    548,   -810,  -1315,   -864,    461,    171,     76,
-     -1109,  -1510,   -874,   -620,     97,     88,     40,     -4,
-     -7295,   -128,    -39,     23,   -100,     -9,    -74,    112,
-      -151,     67,     21,     53,      2,    -29,    -33,     52,
-      3287,  -2178,    626,    339,   -817,    349,  -1187,   -550,
-      -390,     57,    -41,    295,    756,    185,   -215,     17,
-         3,   7502,   -134,   -122,    -31,    -53,     91,   -170,
-       -71,    133,    -34,     57,   -112,     -5,    -66,     17,
-         1,   2328,   3714,    214,   -123,   -839,      9,    -62,
-        54,     70,    -18,    817,    186,    -61,   -252,     37,
-        98,      9,   2010,    738,  -1651,  -1924,   1106,   -624,
-       143,   -548,    847,   -198,   -140,   -691,    478,   -758,
-        56,     54,     -7,    209,  -2665,    109,   -127,   -134,
-      2099,    333,   -602,  -2217,   -743,    346,     74,    216,
-       579,    223,     61,    -30,     57,     94,    224,  -2595,
-      -566,   -851,    246,    314,     65,   2857,    114,   -760,
-        77,   -611,    119,    181,      4,  -2556,    127,    138,
-      -164,   -219,   -116,    157,  -3143,    197,    -98,  -1040,
-       235,   -332,   -424,   -152,   -338,    -33,   -220,    207,
-       254,   5469,   -102,   -390,   -125,   -420,    113,   -233,
-       329,    -34,    109,   -171,    103,     50,     58,     96,
-      -500,  -2317,   -259,   2178,    109,  -2030,    759,   -780,
-       448,    678,   -384,   -271,    213,    334,   -271,     23,
-     -1121,    636,  -1103,   -482,  -3059,  -1200,   1160,    109,
-      -232,    541,   -788,    130,   -166,   -300,    664,    233,
-       -97,    -29,   -286,     33,   1272,   -298,   -382,   -242,
-      -199,     47,    479,    224,  -1761,  -1904,   1780,   1439,
-      -681,  -1973,   -118,    -90,   -148,    247,   -758,   1936,
-       182,   1373,   2346,    120,   -758,   -476,   1789,   1177,
-       611,   -394,    -14,    -39,   -994,   -674,   1049,    -41,
-       836,   -391,    942,  -1040,  -1437,   1376,  -1916,   1129,
-     -1018,   -653,   1284,    -72,   -166,    321,    194,   -142,
-      -151,    -77,    251,   -162,    732,   -790,    107,   -292,
-      -675,  -4248,    -51,    -86,   -299,   -495,    413,   -128,
-      -455,   -105,   -842,    881,   -492,   1241,  -1432,  -1296,
-       -52,   -430,   2533,  -1765,    838,     84,    -24,   -798,
-      -428,   -154,   -658,     37,   -388,   -591,   -931,   -433,
-     -1837,   1363,   -683,   -717,   3115,    104,      0,   1104,
-       208,    148,    404,    101,     18,    217,     58,     49,
-         4,    -49,   -195,    187,   -239,    -21,    294,   -138,
-};
-
-static const int16_t cb4440sl1[] = {
-     -3057,   -853,   3212,   -334,      5,    224,     63,   -250,
-      -345,   -102,   -289,   -115,     75,    -99,    206,     -8,
-        19,     96,   -254,  -2566,    334,   2773,    136,    199,
-     -1076,    347,   -187,    481,    -64,    654,     -9,  -1094,
-       196,     40,    -95,      5,    163,   -135,    253,  -1053,
-       316,   -231,     24,  -2307,   1480,  -2052,    -18,   -459,
-      -550,  -1860,    -15,     98,  -1406,    -66,   -250,     21,
-       497,   -404,    -54,   -228,   2477,   2011,   -145,  -1957,
-      -426,   -906,    608,     15,   1453,    218,    -79,   -636,
-     -1005,   -332,    304,   2338,   1356,     81,  -1201,   -170,
-      -126,  -1177,  -1644,  -1046,     16,    182,   -328,   -347,
-       346,    591,    418,    623,   -110,   -342,   -227,     10,
-     -5055,   -411,    128,   -103,     87,    -28,   -133,    196,
-       333,   1785,   -479,   -442,  -2892,    453,  -2292,    -19,
-      -383,    -44,   -435,   -193,    503,    130,      4,    144,
-      2184,   -245,     -7,    458,     82,    -76,   3052,   -375,
-      1299,    -76,    364,   -145,    372,     36,     59,    -39,
-        48,    385,   -230,   2764,   2956,   -741,   -372,    428,
-      -504,   -220,   -821,    -47,    -49,    609,    -62,     56,
-         6,    216,    376,    519,   -512,     54,   -318,   -183,
-     -4563,    297,    795,   -182,    108,    234,    404,    218,
-      -123,    -17,   -192,    170,    349,    134,    -91,     43,
-      -135,    -24,     -6,    -32,  -6681,     50,   -138,    -89,
-       -18,     15,     24,   -416,    356,    311,     83,   -267,
-        81,    209,   -155,   -368,    396,    358,    232,   4696,
-      -347,    724,    112,     10,    331,    358,    197,     54,
-       824,    646,   -214,    113,  -4425,    184,    -11,    101,
-      -313,    186,    253,    169,     78,     52,    -70,   -108,
-      1669,    -22,    -18,  -2600,    -27,   2806,    288,   -106,
-       506,    176,    616,   -299,     58,    -30,      1,   -220,
-       400,   -177,    874,     70,    -36,   -274,   -139,   1148,
-       372,     40,    236,    505,    619,  -4002,    -95,    -48,
-     -2854,    114,    -69,  -2805,   -401,     -9,    203,  -1011,
-       472,  -1066,    412,   -220,    245,   -183,    -27,     35,
-      -762,    312,   -137,   -292,   -242,    896,    172,   -345,
-       106,  -4490,    506,    569,    -11,   -352,   -108,    334,
-      -165,   2389,   -895,   2761,    467,    201,    150,   -516,
-        39,  -1105,      4,    587,   -152,   -764,   -184,    -15,
-      -137,    -30,    -12,      7,    382,   -461,   1577,   3519,
-      -173,   1370,     80,    499,    344,   -771,    123,    -13,
-       288,    233,    111,  -2472,   3952,    771,    216,   -505,
-      -446,    531,   -230,    103,    -72,     34,     61,    249,
-      -175,    353,     83,     51,    169,    -97,    -60,   7827,
-        95,     75,    -13,    201,    -27,    103,    -11,      1,
-         3,    121,    -73,    -28,      7,   2908,   -209,   -987,
-      -129,   -341,   2840,    889,   -147,   -521,    123,     95,
-      -239,    552,   -738,    279,    -66,      0,     16,    116,
-       -45,    -28,    -43,    -38,  -7627,     30,    -52,   -209,
-       281,    -46,     23,    -24,     56,    -25,    -23,  -2534,
-      -107,    -46,    -93,    -49,    238,    -25,     96,   -356,
-      3483,   -459,   -414,    205,    102,    202,   -150,   -116,
-      1785,   1399,    793,    543,    685,  -2837,    255,    362,
-       -96,    410,    926,   1068,    416,    558,   -169,    246,
-       138,   2136,     39,    -96,   -605,    279,   -130,  -2741,
-     -1101,   -935,    -20,   -227,    453,   1261,    103,    275,
-       358,     43,    197,    -23,   -251,    322,    -22,    233,
-      2560,   -214,      2,   -101,    645,   2864,    287,   -479,
-       904,    -65,     73,    224,   2418,    -95,    428,   -678,
-      -278,     71,   -545,   -571,   -566,   -181,   -212,  -2947,
-       222,    780,   -365,    124,  -2703,   -198,    -69,   -246,
-     -3056,   -184,   -598,    -75,   -145,   -690,    380,    194,
-       485,    214,   -484,     54,    163,    363,   -924,   1684,
-       201,     34,    236,   -539,   2374,   -150,   -490,  -1313,
-       -61,    317,   2123,    315,   -551,    -26,   -328,    207,
-       253,  -3015,    166,    109,   -662,   2466,   -157,   -740,
-       751,    254,   -788,   -369,     -6,    100,   -211,    107,
-      -309,    -39,    -47,    279,   -126,    -91,     97,   -705,
-       235,   -231,    182,    283,  -5097,    -68,    285,     49,
-        50,    637,    111,     39,   -386,    923,    223,    115,
-      1638,   1214,   -640,  -2168,    482,  -2228,    857,    172,
-        15,  -2207,    -89,    335,    -18,    295,    718,   -956,
-        26,    604,   -436,   2856,  -1131,     98,   -754,    243,
-         9,     29,  -4028,  -1725,  -1741,    432,   -211,    -60,
-      -535,    201,   -273,    111,    444,    607,   -250,    122,
-        98,    159,     97,    281,   3071,   -412,  -2849,   -721,
-       -14,    960,    -43,    794,   -427,    297,    478,    379,
-       -47,    -22,     69,    -60,    -30,   -732,   2456,    170,
-       142,      6,   2520,   -644,   -201,    -16,   1602,    -20,
-      -293,    542,   -451,   -167,     -9,     14,   1052,   2707,
-      2980,   -117,    479,   -202,    -92,     36,    904,    -66,
-     -1088,    -31,     75,    -62,   -110,    -29,    112,   -102,
-      5217,    -85,     14,   -191,   -202,   -175,    -71,    182,
-      -231,    275,    144,     -1,   -202,    -13,    -29,    -19,
-        70,     39,     46,     56,  -7608,    -53,   -104,    -61,
-        44,     23,      1,   -157,     42,     12,     38,     37,
-       331,   -609,  -2516,   -174,  -2491,    258,   -256,   -926,
-       983,    100,     83,    173,   -965,    650,   -304,    -97,
-        98,   -166,    534,   2570,   -611,    493,    103,    -98,
-       148,   3081,   -131,    285,     13,   -367,    205,    -53,
-        41,     29,   -154,  -2657,    -51,   -312,    134,     50,
-     -1514,    634,    411,  -2885,   -391,    365,   -373,    -54,
-       -74,   -151,     80,    152,    -91,    -64,   -209,   1134,
-     -2921,    316,   -951,   1124,    713,      2,  -2212,     31,
-       164,   -260,    103,     36,    229,    111,    -23,    -65,
-       -37,   -220,   -108,    -30,     86,     17,     87,    205,
-       163,     63,  -5763,    254,    178,    -18,   1760,   -380,
-      1453,  -3151,    710,    106,     66,    387,    235,    463,
-      -295,    688,   -124,    322,   -193,     82,   1012,  -2033,
-      -656,   1362,    805,   -747,   2527,    470,     43,  -1001,
-       100,    -83,    161,     74,  -1128,   -307,    -82,   -197,
-     -5470,    226,   -327,    137,   -131,    471,   -432,    -16,
-       243,    224,    168,   -164,    -58,    125,     23,     -2,
-     -2752,    268,    -92,   -466,   2876,    874,    182,    540,
-      -407,   -338,   -396,    562,   -376,    536,   -225,    160,
-        44,  -1501,   -246,  -1062,   -378,    446,  -2448,   -124,
-       499,  -2297,   -353,   -637,    395,    598,   -747,    418,
-      -495,      5,  -1014,   2138,    289,    -75,    301,    944,
-        66,   -457,   -459,   -253,     -2,    678,    367,    116,
-     -2901,    436,   -239,   -303,   -973,    384,  -2574,      6,
-      -225,   -164,   -440,    627,    388,  -3074,   -263,    156,
-      -805,    381,     -9,   -112,  -1481,    536,   -711,   3770,
-      -496,    908,    483,    474,    298,   -424,   -793,   -203,
-      -334,    134,    -91,    208,    -73,   5440,   -316,   -304,
-       249,     -1,    -98,   -214,    190,    242,    -57,    -38,
-       244,   -219,     30,   -224,     66,    -30,     22,     24,
-        24,   -109,  -7594,   -115,     90,   -147,    -83,     21,
-      -257,    -52,    134,    -49,     92,   -117,     30,     -8,
-      -636,   1551,   2207,    -66,  -1962,    212,    567,    969,
-     -1595,   -562,    355,   -467,   -861,    937,   -148,     15,
-       -68,  -1516,  -2118,   1477,    777,   1458,    976,    522,
-       325,    957,   -130,   -132,   -918,    448,   1088,    102,
-       142,   -644,   -284,    687,   -665,   -132,  -1870,   1387,
-       733,    -84,    920,   -508,     53,  -2183,    254,    565,
-      2056,     97,     57,    219,    688,   -344,    659,   2033,
-       963,  -1717,   -290,   -934,  -2119,     57,  -1452,     24,
-      -639,   -739,   -232,    170,     28,    359,   -312,    310,
-      -103,  -1067,   -953,   1081,   -857,   1926,   1364,  -1719,
-      -863,   1832,    786,     55,    166,    383,  -1373,   -347,
-      1710,   -908,     91,   1257,   2013,   -592,  -1337,   1431,
-       -90,    617,    549,   -356,    -68,    134,    -48,   -133,
-      -176,    -18,    -65,     23,     84,    -23,    -36,     -4,
-       230,    297,   -204,   -150,     86,  -4965,    742,     40,
-        32,  -1070,    149,     38,    302,   -329,   -386,    -57,
-        45,  -1622,   1425,   1817,   1568,   2202,      7,  -1192,
-      -201,    -42,    -62,   -170,    -32,   -117,    -38,    229,
-        44,   -226,    155,     70,    747,    259,   -261,   -120,
-};
-
-static const int16_t cb4440ss0[] = {
-     -3021,   2048,   -450,   1147,   1487,   -796,   -657,    459,
-       609,     63,   -153,  -1174,   -144,     37,   -176,   -160,
-        43,    -31,  -2577,     88,   -797,   1179,   -707,   3154,
-      -543,    875,    116,    -40,   -150,    326,    293,   -112,
-       -73,    -34,     61,      8,  -2251,  -1551,  -2507,      6,
-       -52,     -5,   -323,   -313,   1076,    920,   1116,  -1100,
-      1103,    310,   -144,    904,    149,    -59,    636,  -1508,
-      -378,    381,   -917,   -868,   1388,  -1225,    -68,   1491,
-       685,   -220,   3253,     48,   -504,    192,    114,    -11,
-     -1718,   -916,    660,   -240,    767,  -1061,    332,    591,
-      -477,   -278,     25,  -1485,     55,    216,  -3238,    -19,
-      -320,   -148,    273,   -876,     22,   -529,   3263,  -2535,
-      -756,   -133,   -481,  -1024,     34,    418,   -415,    412,
-       -92,    -90,    161,    -49,  -1699,  -2737,   2923,   -243,
-       122,     87,    984,   -377,    -37,    128,    350,   -444,
-       -98,    -52,     14,    -14,    -86,    255,   1997,  -1239,
-        42,    247,    -15,     16,    405,    302,    -17,     84,
-     -4033,    -12,    254,   -365,   -205,   -162,    329,     31,
-     -1158,   -210,   -376,   3958,  -1601,  -1128,    737,    731,
-       300,   -785,   -777,   -403,    463,   -226,   -109,   -277,
-       -70,    -53,   -856,   -785,   -997,     71,   5565,    317,
-       447,   -279,   -357,    254,     93,    -47,   -206,    133,
-        88,    272,      7,     44,   2229,   1666,    234,    519,
-     -1996,  -1195,    549,    449,    174,  -1010,    622,    425,
-      2288,     -9,   -390,    612,    -40,     32,  -1867,   -673,
-       -70,  -1174,    106,    134,    354,     61,   -144,   -290,
-        82,   -604,    202,  -3954,    248,    -76,      7,    224,
-     -1844,     99,   -146,    206,   -335,    243,     25,     60,
-       186,    117,     67,   -137,    119,     46,   4563,     45,
-       -46,     -2,    874,    533,    216,    -38,    185,   -540,
-      -191,   -163,   -126,   -108,   -184,    193,    -39,  -4768,
-       111,    -89,    -61,     17,   1064,   1678,    894,   4334,
-       139,   -892,    317,   -351,    417,    -87,    -22,    195,
-        20,    140,    234,   -197,   -268,     -5,  -1618,   -756,
-      -119,  -1749,   -704,   -943,    421,  -3488,    871,   -468,
-       656,    266,    -79,    325,   -303,     45,     -3,    -31,
-      1140,   -707,  -1578,  -1434,    290,    327,  -1365,  -2913,
-      1048,     38,   -136,   -871,   -572,    -30,    186,    343,
-       -30,   -157,   1301,   1913,   -515,   -842,   -723,    -84,
-      -340,    270,   -918,   3213,  -1530,   -394,   -184,    -60,
-      -391,    -27,   -110,     84,    104,    419,   1201,   -810,
-      1546,     39,   -914,   -334,  -4257,    427,    -95,   -426,
-       -94,    256,   -148,    246,    -80,      9,   -462,  -1125,
-       644,   3541,   -140,   2346,   1045,   -335,   -867,    809,
-       432,    386,     -6,    159,     70,    -10,    218,     43,
-     -2229,   -607,    537,   -924,  -3038,   -943,   -968,   1261,
-        28,    197,   -285,     61,    137,     69,     -2,   -251,
-       111,    -19,   -314,   2064,    960,   1529,   1056,    926,
-      -319,  -1617,   1305,   1473,   -867,    684,   1357,   -834,
-       -66,    477,     74,    -15,  -1769,   1925,  -2448,  -1777,
-      -507,    264,  -1740,    176,   -518,    -58,     32,   -108,
-       165,    -68,    189,     35,     40,    -85,  -1152,    255,
-        36,  -1922,   1500,   1415,    841,    -92,   3305,   -110,
-         3,   -219,    167,    573,    219,    310,     27,    195,
-       359,   -244,    538,  -2042,    355,    656,     51,   -199,
-      -204,  -3611,   -396,    839,    743,   -241,    -80,   -210,
-      -101,     28,  -1399,   1062,   -955,     54,   -630,   -178,
-      -376,    212,    237,   -219,     47,    805,    216,     26,
-     -4334,    455,      4,      4,  -1587,     95,   1186,  -3101,
-      -140,   -862,    916,   2063,    211,     96,    337,   -185,
-      -195,    424,   1207,    -31,   -162,    206,   2485,    -46,
-      -451,  -1778,    -40,    144,   -155,   2884,    803,    396,
-      1196,   -635,    297,    -76,   -121,   -162,   -206,   -149,
-     -2204,   1035,    232,   -815,    -49,   1006,    553,   -407,
-       161,   3650,   -264,    370,   -418,    -28,    141,   -177,
-      -113,    -90,   -315,    626,     62,   1392,  -1815,    336,
-     -1276,   -402,    486,  -1060,  -1848,   2610,    826,    485,
-      -250,     39,    208,     14,   2555,   2869,   -813,  -2074,
-       337,    601,    855,   -655,    566,   -707,    189,    -77,
-       137,   -510,   -282,     79,     42,     73,     62,    650,
-     -4732,   -486,    354,    420,    828,   -645,   -492,    388,
-       753,     18,      2,    766,   -212,    126,    -43,     45,
-       447,   -283,    607,    251,   -166,    -10,     48,  -5850,
-      -251,    128,   -205,    -95,     90,     90,     67,     24,
-       -50,    -48,   -167,  -3231,  -2926,   1831,    199,    484,
-       169,   -614,   -135,   -374,   -418,   -239,    -89,   -121,
-        45,     75,    -11,     16,  -1058,    354,   1633,    589,
-     -1223,   1218,    842,  -1146,   2186,    374,   -363,    216,
-     -2153,   -429,    429,   -597,     93,    148,   1849,   -797,
-      -162,     31,   -325,    343,   -323,    161,   -373,    684,
-      -367,   -452,  -4306,    -88,     28,    -56,    -59,     43,
-       -49,  -1998,   -956,   1331,  -4214,   -129,     30,     79,
-       -90,   -129,    109,    130,   -160,    409,    105,    298,
-       208,    178,   1724,    731,    773,    128,    817,   -425,
-     -4046,    180,   -782,   -116,    191,   -259,    181,    -31,
-       162,     43,    -41,    -69,   1463,  -1769,     -2,   -442,
-      -636,   1495,   -218,   -123,    -58,   3616,    454,   -475,
-       247,   -383,    304,    185,    155,     40,   1104,   1046,
-        -8,   -736,  -1155,   -115,   3925,   -257,    -35,   -599,
-      -437,   -135,   -256,     55,    214,    -88,    215,    -57,
-     -1097,    183,   -501,   -608,   -135,    148,    405,    295,
-        96,   -513,   1013,   4350,   -162,    -61,    427,    315,
-        24,    -77,  -1278,   -167,  -1774,   -133,   -323,  -4339,
-       732,    597,    -30,   -103,     79,   -241,    177,   -388,
-         7,     44,    175,   -143,   5030,    277,     58,     42,
-      -222,   -133,   -319,      6,    240,    217,   -238,   -198,
-       218,    -43,    439,     49,     37,    106,   1123,   2196,
-       158,    171,    458,   -932,   -435,  -2783,   -300,    444,
-      2317,   -146,   -339,   -162,    157,   -216,      1,     66,
-       987,   -190,   -728,  -3188,  -3167,    378,     -1,    158,
-       459,     78,    -42,    386,   -133,    155,    294,    359,
-       -29,     78,   1763,    780,   1019,   -330,    179,    -51,
-      -393,    338,   4422,   -296,   -392,    170,      2,     52,
-       253,    150,   -191,    139,   -371,    161,  -2202,    156,
-        37,  -1004,   -384,   -466,     23,    183,  -3701,     97,
-     -1293,   -355,    -83,    -63,    -26,     69,  -1817,    641,
-      2996,    -16,   2011,   -406,   -647,   -652,    332,    788,
-       484,    918,   -440,   1246,    165,     52,   -260,     31,
-      -255,  -7237,     14,     90,   -135,    122,     14,    154,
-         5,    -78,    111,   -254,    154,    -23,    -24,    -83,
-        -9,     49,   -426,   1657,     99,    -36,   -191,   2625,
-       655,    -20,  -2723,   -977,   -222,    -48,    155,     41,
-        20,    194,    -73,    -26,  -1206,  -3517,   -471,   -815,
-     -1144,   -371,   1353,  -1069,  -1238,    829,   -227,    487,
-      -297,   -101,    914,    100,    -17,    115,   -806,   -798,
-       585,   1097,     -1,   -792,    818,     29,   -256,   -417,
-       942,     68,  -4165,     34,   -408,   -252,     55,    -77,
-       246,   2055,     -4,   -313,   -661,   -836,    559,   -393,
-      2043,    153,    286,  -2700,     98,   -177,   1201,     99,
-       308,    -73,   1441,  -3902,    730,  -1610,    886,   -599,
-      -126,    473,     43,   -252,     45,     95,   -291,    101,
-      -307,    259,   -149,     26,   -510,    498,   1403,    -78,
-     -1039,  -2551,    773,  -1176,  -1525,   -405,   -259,   -283,
-       398,   2080,   -199,     62,    239,    -26,    960,    582,
-      2516,    799,  -2127,    325,   -253,  -1652,   -965,   1413,
-         8,   -119,    396,   -342,    277,    541,    186,   -142,
-      1210,   -732,    798,    -47,   -557,    -12,     63,    537,
-       148,   -128,    328,    290,    203,    361,   -328,    -64,
-      4004,    197,   -640,    996,    -93,  -2314,     76,   -914,
-      1437,   -964,  -1735,    984,   -578,   1389,  -1025,    -66,
-      -120,  -1211,    -32,      5,  -1215,    771,   1621,   -934,
-      -984,    148,  -1592,   -446,     19,   -976,  -1709,  -1113,
-      -218,    191,   -279,   2183,     10,    -37,   -842,  -1582,
-       -92,    558,    227,   -702,   -365,   -576,   -100,    670,
-      -305,    285,     48,   -329,    253,   3878,    156,     70,
-     -1008,    641,   1541,   -234,   1440,    421,   1088,    735,
-      -206,    -83,    460,   -139,    107,  -1160,     -6,   2087,
-      1894,   -117,    962,    113,   -990,     93,    -29,    579,
-      1217,    -52,   -342,   -451,    670,    202,  -1070,    837,
-      -132,   3507,    -59,   -114,   -691,    208,  -1170,   1089,
-       305,   -200,    603,  -1301,   -942,  -1631,   1291,  -2727,
-       414,     80,    815,   -443,     54,    -34,  -1141,   1301,
-     -1199,    372,    102,   -257,     70,    450,    -55,     80,
-      -227,    218,    264,    739,    -52,   -200,   3873,     83,
-};
-
-static const int16_t cb4440ss1[] = {
-      6875,   -104,    -66,    161,     57,     24,     -4,     76,
-      -122,   -100,     31,    188,   -119,    -50,   -244,     49,
-         1,   -100,    555,    253,    433,    633,   -163,  -5345,
-      -170,   -217,    -49,    -29,    331,    633,    -87,    -46,
-       -29,     44,   -174,    -74,   2188,    434,    660,   -593,
-      1548,    379,   1443,   1676,    -63,  -2125,    246,    534,
-      -463,    872,   -169,    -12,     33,    211,   -409,    408,
-      1514,   -189,   -277,    391,   -361,    -35,    145,   -362,
-     -4669,    212,    -97,    -65,    387,    -81,     70,     36,
-       448,    303,    332,  -1077,   -258,  -1353,   1185,    -50,
-       -12,    -74,  -2101,   2429,   1817,   -939,    393,    169,
-       -22,    -36,   1219,   3237,    816,    452,   1807,   -646,
-       407,   -447,  -1778,   -370,   -528,   -127,    104,    416,
-      -121,   -134,    -62,     20,   1751,   -640,   -222,    950,
-      1603,    555,      9,    219,  -1272,   2724,   1004,   1237,
-      -395,    356,   -453,    -98,    -24,     80,  -1621,    474,
-     -1947,   -237,  -1059,  -2091,    780,   1211,    939,    268,
-      -412,   1923,   -419,    851,    230,    567,    143,     48,
-      1506,   2228,  -1226,   -453,    246,    469,    540,   -538,
-       -96,    977,    508,    105,  -3150,   -142,    -37,    395,
-         9,    -38,      1,   -135,   -391,   1702,   -179,  -1566,
-     -3181,  -1679,    203,   -151,    387,    250,    563,    203,
-       443,   -168,     82,     61,   1604,  -1878,    229,    -82,
-       208,   2965,   1093,    251,   1592,   -432,   -532,    153,
-       407,    157,    191,   -216,     52,    -58,    935,  -2161,
-      -409,   -513,    977,   -113,   3247,  -1207,   -743,  -1178,
-       136,    206,    184,   -885,    -64,     16,    -23,    -24,
-       731,   1769,   -941,   1543,  -2386,   -669,   -958,    233,
-       105,  -1124,    948,     97,  -1949,     59,   -152,    -65,
-       114,     82,    387,  -1908,   -492,    129,   -624,     93,
-       658,   -753,   1032,   2480,  -1776,    360,    -38,   1924,
-       168,    -12,    -10,   -128,  -1712,   -446,    939,    465,
-       605,   -586,   -299,   -393,   3878,    111,   -379,    146,
-       186,    -50,   -279,    -30,     -3,     35,  -1941,    360,
-       -79,   -111,  -4287,     -6,    671,   -214,   -792,    277,
-        77,     58,      8,     16,    133,    161,     21,     33,
-      1535,   -296,  -2668,  -3198,    -28,   -386,   1156,    144,
-      -201,    256,   -411,    298,     67,    670,     11,   -227,
-        -4,   -104,     12,  -1000,   1192,    860,    813,    360,
-        25,     93,    792,   -350,     81,   4046,   -178,    122,
-       332,     28,   -112,     -8,    288,    539,    -17,    -63,
-         8,    231,     55,   -514,    105,   -344,    252,   -153,
-        59,    -10,    -21,     51,   6793,     45,    259,    384,
-       209,  -2010,    311,   -769,  -1957,   2791,   -463,   -293,
-      -218,   1026,    897,   -798,     47,   -525,     31,    -42,
-      2018,  -2767,   1658,    685,  -1947,     46,  -1468,    340,
-      -272,    318,     21,   -421,   -396,    244,    -51,    290,
-        45,      3,  -1530,   1359,  -3681,   1487,  -1689,    209,
-       438,   -785,   -220,      2,    -55,   -483,    -35,     40,
-         6,    189,   -200,      2,  -2026,  -1747,    838,   -880,
-      1128,  -3108,    184,   -671,   -261,      8,    296,   -130,
-       -78,   -268,   -100,     18,   -105,     -9,    448,   3184,
-      -570,    656,   -376,   -969,   1682,   2635,   -277,    577,
-       217,    281,    219,   -351,     31,     64,    101,     82,
-       957,  -1885,    774,  -3536,   -168,   -431,   -106,   -479,
-      1041,   -103,    774,   -142,    894,   -724,    -94,   -766,
-       -58,    112,   2028,    566,   -346,   -139,  -2671,  -1907,
-      1039,    189,    -33,   1690,    263,   -514,   -225,   -237,
-       145,   -319,     38,    116,   2891,    -77,  -2065,   2559,
-      -327,   -763,     86,   -172,   -283,   -147,    137,    245,
-      -333,    220,     92,    194,   -176,    105,   3108,    329,
-      -372,  -1188,    670,    773,   -235,     34,   -146,    876,
-      -259,  -1580,    876,    105,    582,    259,    -63,    -99,
-     -1558,   1122,  -1541,   -438,    227,   1221,  -1297,   -746,
-      2698,    -29,   1169,    995,     -2,    201,    392,   -405,
-       -22,    -36,    757,  -4039,    725,   1960,   1478,   -107,
-        67,   -367,    -97,    -88,    154,    -80,      0,   -265,
-      -163,     14,   -109,     33,    597,    115,    543,    468,
-      -757,    826,    509,   -176,   -305,  -4959,   -118,   -464,
-      -421,    -72,      1,   -187,    123,    -88,  -1086,     26,
-       368,    610,   3394,   -337,    364,   2594,    491,    759,
-      -309,    395,    152,    338,    249,    303,   -122,     63,
-      1019,   -864,   1546,    196,     75,   -633,    -93,   -631,
-       777,    -74,   1235,   -745,    377,   3113,   -174,   -282,
-       -24,     89,   -920,   2124,    620,    566,   1290,   2977,
-      1180,    278,    188,    750,    981,   -357,     80,     69,
-        77,   -151,    150,    -15,    834,   -893,    818,   1655,
-      -500,    237,    133,    243,    405,    239,     16,   -152,
-       -70,  -3692,   -110,    145,     58,    -57,  -2527,   3072,
-      2226,    218,   -824,    384,    -96,    119,   -228,   -194,
-       136,    111,   -251,   -109,   -179,    -34,    143,    109,
-      1157,   -216,  -1429,   -702,    323,  -1199,    -60,    632,
-      -585,   -340,   1040,    471,    -32,   -380,   3432,    455,
-      -138,    -39,  -2416,    652,   -253,    145,    281,    393,
-      -671,   2841,  -1616,    -46,   -385,  -1417,   -273,   -168,
-       318,   -263,     -2,    -69,   -638,   -137,  -2668,   -359,
-       -86,     79,   -777,   -404,   -560,  -3533,    122,   -113,
-       617,    497,    117,   -268,    110,     73,    752,  -1105,
-      -521,    762,    695,   -587,   -147,  -1235,   1866,  -2250,
-      -671,   -511,  -2178,   -820,   -619,    162,    -37,    102,
-      -342,   -278,   6837,   -278,    185,     10,    361,    -52,
-      -171,    246,    184,   -175,     19,    166,    -48,    -41,
-        92,   -152,  -1227,   -983,  -3985,   -703,   1143,    204,
-      -523,   1053,   -623,   1002,    231,     53,   -277,   -409,
-       -67,    -56,    -90,    -47,    448,    754,    554,    972,
-       505,   -331,   4946,   -193,     89,    530,    -24,   -172,
-       254,    244,    140,    -10,     40,    -77,   1655,   -438,
-     -2776,     51,   -553,    592,  -2902,    280,    804,    776,
-       131,     69,   -207,    131,      7,    209,     93,    -19,
-     -1148,   -733,   2674,  -1628,  -1243,   -506,  -2346,   -857,
-     -1028,    666,    365,   -353,    105,    120,    210,    -85,
-        37,    -40,   1027,     11,   1234,     -5,  -1976,    515,
-       289,   3815,   -142,   -188,   -248,   -273,   -265,    593,
-       205,    164,    -65,     70,   -992,   1586,   2130,    779,
-        92,  -3067,    421,      1,   1172,    496,   -917,   -760,
-       169,    -64,     14,    -40,   -247,    -95,   1769,   -145,
-       712,   -794,   -571,    240,  -1774,    -38,   -129,   -836,
-      3372,    887,   -451,     73,   -107,    182,    100,     14,
-      -703,   2559,    490,   -839,   -333,    134,    804,  -3549,
-        50,   -199,   -215,   -370,    453,    -86,    151,    -98,
-       -58,    128,  -2624,  -1507,  -1623,  -2186,    -89,    -55,
-      -472,   -667,      2,   -439,  -1453,   -262,    565,     56,
-      -118,    288,    -56,     87,   -398,    729,     40,  -6015,
-       219,   -212,    287,   -250,   -211,    -29,    -61,    -55,
-      -120,    -92,     30,    129,   -122,    111,   2037,   1260,
-       943,   -252,    -13,   -794,  -2570,  -1117,    297,    374,
-     -1629,     -1,   -407,   -597,   -324,   -179,    408,     58,
-      -902,  -1672,    611,   -198,    -61,    103,    366,    915,
-       811,   -280,   -401,  -3849,   -111,    221,    353,    232,
-         4,    -18,    673,   1792,  -2350,    132,   1979,  -2318,
-      -417,   -689,    326,    768,   -377,   -522,    373,   -389,
-      -105,   -103,     33,    -48,   1497,   1125,   1893,  -2744,
-     -1219,    921,    472,   -165,   -438,   -129,   -682,   -783,
-      -685,    167,   -715,    156,     64,     61,   1147,   -892,
-       -72,    579,   1191,  -2759,   1831,   1895,    663,    816,
-       -98,    -61,   -223,   -366,   -429,     31,   -129,   -121,
-      -255,   1804,    138,    180,  -1063,    598,    763,    720,
-       385,   -526,    143,     80,    168,    976,   -714,    236,
-     -3204,     93,    874,    238,   -359,   1595,    191,    568,
-      -182,     20,   -608,   -288,    602,   -224,   3874,   -308,
-       -70,   -826,   -109,    -42,   -882,  -1421,  -1603,    625,
-     -1206,     31,    782,   -106,   -700,   -246,   -571,   -124,
-      -848,   -390,   -523,  -2903,     -9,     39,   -109,   -199,
-       497,    -11,    377,      5,     25,   -115,    -61,    283,
-        27,   -131,   -193,    280,    178,  -5439,     44,    -52,
-     -1210,   -617,   -162,  -1097,     -3,    748,    -45,  -1197,
-     -1058,    909,   1607,    693,     42,   -749,  -3001,    407,
-       -62,     45,    214,   -312,  -1054,    498,   1291,   1189,
-     -1268,   1083,   -757,   -319,  -2796,   -716,    310,   1583,
-      -608,    319,    -84,   -119,  -1415,   -602,    628,    463,
-     -1213,   -794,   -474,   2682,    931,    240,   2491,     76,
-      -234,   -161,   -690,    359,     28,    -19,   -774,  -1023,
-       738,    675,    248,     52,   -348,   -545,  -2715,   -599,
-      -252,    660,   -387,   -104,   2316,    456,    -90,    100,
-};
-
-static const int16_t cb4440sm0[] = {
-     -6448,    -59,    298,   -659,    -59,    329,   -569,    397,
-      -224,    128,   -216,    153,   -100,    319,    -53,    -90,
-        50,   3313,      4,   -215,    405,   -256,     78,   2890,
-      -187,   -969,    195,  -1022,   -119,    214,    254,   -360,
-      -222,     39,   2139,     91,   -290,    529,    -73,    -16,
-      -318,    128,   -348,    565,  -1190,    202,   -185,   -234,
-      3498,     48,     68,  -1917,   1694,    212,   -477,    239,
-     -3301,   -489,    424,    418,    -82,    -61,    599,   1530,
-      -200,   -252,    162,   -243,     43,   -534,  -2695,    255,
-       317,    489,    279,   3337,    246,   -349,   -149,   -128,
-      -146,    256,   -455,    137,    -75,    836,    209,   -349,
-      3494,    255,  -1948,   -732,    367,   1373,   -211,    608,
-       345,    -17,     43,    102,     19,   -219,    173,  -2361,
-       130,   -862,    637,   -103,   -589,    219,  -1261,   -238,
-     -2528,   1643,  -1587,   -690,   -166,      7,    -57,   1221,
-       326,    103,   -830,    608,    196,  -3705,   1103,    568,
-     -1602,    543,   -153,   -416,     74,    185,    156,     34,
-      1329,   -798,   -214,   -515,    121,   -797,    749,    346,
-       629,   -609,   -877,    -60,    184,   -157,    250,    193,
-      4385,    369,   -181,   -191,   -308,   -314,   -395,   -173,
-       -88,   -388,    -43,     46,      9,   -167,    189,   -192,
-      6086,   -226,  -1795,    126,   -941,   -423,    397,    380,
-       461,    319,    364,   -194,    433,   1214,  -3715,   -274,
-         9,   -327,    212,   -375,    130,   -917,    -63,   1120,
-      -651,   -211,    149,  -1128,    265,    -73,  -4630,    493,
-       -83,    -20,   -314,    -91,    910,   -109,     -3,   -417,
-      -109,    374,    357,  -2773,    253,   -234,   -306,  -3060,
-      -762,     53,    476,   -299,    -89,  -2440,   -658,    -83,
-      -854,   3770,    374,    552,    450,     51,    346,    887,
-      -463,    189,    254,    182,     15,    -37,  -3263,   2594,
-      -647,    -83,    404,    770,    691,   -654,   -301,     81,
-       -13,    742,    371,     54,     31,    -83,    -59,   4196,
-       653,    256,  -1075,   -539,   1084,  -1077,   1238,    259,
-        20,   -191,    854,    179,    -47,  -1025,   -189,    281,
-      2556,   1765,    106,    -79,    320,  -3066,    228,   -500,
-         1,   -183,    -46,    220,   -233,    -50,    -98,   -261,
-       -84,    -25,  -4378,   -428,  -1395,   -582,   -619,    443,
-     -1456,    375,    144,    -32,    356,   -454,     28,    136,
-         5,    247,  -1057,    709,   -362,    293,   3084,    545,
-     -2804,   -625,     16,   -228,   -238,    164,   -201,   -114,
-      -149,     58,    -74,    203,    271,    462,   1037,    159,
-     -1652,   -591,   -846,   -166,  -3272,    710,    773,    824,
-     -1138,    630,    -14,    209,    348,   1476,    322,   -371,
-       241,   4133,   -877,   -476,   -391,    602,   1259,  -1204,
-       352,     90,   -473,     43,   -152,   -439,   -131,   -217,
-     -1559,  -5029,   -186,   -239,    -44,    750,     33,   -167,
-      -211,    -67,    -91,   -143,    124,     32,    -16,   8192,
-        68,   -102,    163,    -31,    458,     38,    249,     21,
-       157,    -63,     36,     49,    -22,     89,      9,    153,
-        46,     60,   -146,    -13,  -7506,   -104,    101,   -141,
-        25,    165,    -84,    219,     53,   -182,    -94,     46,
-     -1314,   -371,   -298,   -527,      6,  -1955,     52,   -714,
-      -461,    174,   1450,   -298,    107,   2965,    250,    -65,
-        46,   -171,    296,   -785,   -784,     35,     36,     29,
-       915,   -891,   -391,    168,    509,   3763,  -1267,   -138,
-       132,    424,    -53,   -669,  -1491,   -927,    712,   -638,
-      -440,   -299,    522,   1593,    445,   3234,    547,    498,
-       440,    145,   -135,   -188,   -296,   1080,    468,     77,
-       176,   -315,    221,   4784,   -666,    274,    762,    -42,
-       218,    -86,   -273,    116,    814,    -21,    402,   -266,
-      -392,   -425,   1126,    -68,    142,    357,   5143,    363,
-      -224,   -198,    115,   -221,   -262,   -736,  -2774,   -196,
-      -208,   -613,    163,    696,    789,    132,    114,    121,
-     -3138,    164,    172,   -189,    232,     53,    310,    -50,
-      -407,   1207,   -474,    249,   -806,     21,     20,     72,
-      -534,    101,    -47,   -223,  -4568,   -128,    -29,   -910,
-      -254,    105,   3163,   -119,   -135,   1745,   1744,   1105,
-       291,   -333,   -278,   -441,    660,    141,   -291,    314,
-       149,    142,   -121,  -7878,   -240,   -204,    189,    376,
-         3,   -129,     59,     46,    170,     82,   -150,    -34,
-        67,   -110,    635,    148,    256,  -2939,    157,   -509,
-      1439,  -2470,    794,   -298,    407,    980,    805,    349,
-       208,    -35,   1009,   1180,   -114,    776,   -339,   -776,
-       250,   1951,   -557,    172,   -395,    795,  -3075,   -348,
-      -106,    122,    -47,     -9,     55,     40,   3002,    421,
-       538,     -1,   -277,  -3062,    -15,    168,    461,    521,
-      -525,    413,   -196,    159,  -3314,    -85,    983,    565,
-     -3113,     38,     79,   -172,     20,   -228,   -520,    346,
-        47,    485,   -177,     51,    175,    444,   3475,  -3416,
-       -81,    118,    264,   -162,     20,   -192,   -219,   -111,
-       -57,   -225,    159,   -218,    117,    -28,   -150,  -1100,
-      -681,    444,    -54,    -11,  -4669,   -216,  -1151,    858,
-       168,    -39,     52,    387,     74,    -39,   -154,   2767,
-       307,   -132,    531,    175,    906,     14,   -129,     49,
-     -3389,    476,   -127,   -329,    479,    118,    -85,    209,
-         4,    227,    154,     -2,   -238,    263,    -24,    553,
-      -231,     78,      2,   -183,     31,   5933,    117,     86,
-       386,    359,    153,    101,   -784,   -553,    -13,    256,
-      -347,  -1311,   -936,    -64,   1718,   -444,    168,   -590,
-     -3252,   -194,   -243,   -269,   2096,   -994,  -1081,    309,
-      1003,    290,    -66,    306,  -3239,    -25,    700,    365,
-      -770,    144,      4,    259,   -185,   1493,   -158,    726,
-     -3180,  -1683,   -119,     45,   -493,   -205,  -1728,  -1226,
-      -235,    -87,    -88,    -87,   1966,      8,    142,    496,
-       239,    828,     30,   -517,   3150,   2266,    402,   -315,
-        74,   -312,   -414,    -16,    458,    381,    376,   1287,
-      1093,   -410,   -967,     80,    382,   -106,   4419,    445,
-       293,   -283,    282,    324,    -80,    -25,    115,  -1667,
-      -756,   1893,  -2772,    395,      3,   -349,    138,   1094,
-       406,    432,    214,  -1328,    632,   -132,   -100,    135,
-      1627,   1062,   1026,  -1341,     24,  -3352,   -173,   1265,
-       861,   -821,    -87,   -367,    278,    151,   -101,    -32,
-       161,    387,   5778,   -564,    492,     83,    324,     29,
-      -423,     91,   -132,    190,   -310,   -457,    -62,    -99,
-       171,   -214,   -159,  -2500,   -693,  -1538,   -311,   -784,
-     -2422,   -498,   1781,    342,   -467,    -78,    466,   -252,
-       241,    197,    186,  -1039,   -190,    346,  -1881,   -240,
-       -65,   1438,   1001,  -3009,    -52,    221,   -490,   1224,
-       -63,    -39,     53,    169,    130,     86,    -56,    -90,
-       116,      4,   7098,     -5,     61,   -172,    -65,    160,
-       -94,    -30,   -111,    270,   -653,    521,   -426,   1084,
-     -1169,  -1158,    584,  -2499,   2494,   -321,    695,    823,
-      -429,     35,    529,   -280,    -45,   -286,   2997,    207,
-      -633,  -2207,   1708,   -298,   -413,    673,  -1017,    292,
-       493,     76,   -136,   -365,    -65,    266,    852,    512,
-       791,   -129,   1364,  -1065,   1371,    383,   -524,    505,
-       943,    147,    229,     39,  -2969,     70,   -295,     66,
-      2759,    -16,   -435,   -474,  -1058,    762,     54,   -257,
-       560,  -3167,   -572,   -418,   -478,    370,     72,    -20,
-       296,     54,  -2683,    550,    -15,   -155,   2146,   -143,
-     -1144,    463,   -117,  -1690,  -1917,     42,    249,   -278,
-      -319,   -513,    544,  -2033,   -317,  -1955,  -2646,   1345,
-       759,    268,    207,   1243,    256,    -32,    -45,   -750,
-      -211,   -184,   2397,    473,   2572,   -489,    260,    389,
-      -237,    602,   -463,    569,   1673,   -176,   -227,    964,
-       203,    130,   -269,   -190,   1339,   -978,    973,   1986,
-      1145,   1258,    272,   1779,   -436,  -1306,    652,    807,
-       574,   1401,     53,   -183,   1612,   -828,  -3094,    -82,
-      1061,   1042,   -200,   -891,   -126,    181,  -1324,    549,
-       555,     -4,   -868,     79,    157,  -1533,     18,    230,
-     -1096,   -335,   -669,   -166,   1853,   -310,   -340,    249,
-      -954,   -594,  -2929,    415,      5,    135,  -1315,   -237,
-      1868,    787,   1912,  -1100,   1139,  -1103,   -217,   -382,
-      -654,   2078,    528,    133,   -115,    -56,    -41,   -207,
-        69,    461,    465,   -396,   1725,   1306,   -443,   -720,
-     -1600,   1176,    652,   -997,   -306,  -1040,   2258,    -75,
-};
-
-static const int16_t cb4440sm1[] = {
-      8192,     96,    214,   -395,   -106,    291,   -401,    305,
-      -102,    194,    -73,     31,     71,    -19,   -349,     65,
-      -183,     26,    -21,   8154,    107,   -136,    -37,    -35,
-        85,    127,   -202,     43,   -195,    225,    -51,    -69,
-       -57,   -107,    141,   -120,   -284,   -227,     28,    680,
-       218,     29,  -1800,    488,   -207,   -453,    -99,  -3680,
-      -210,     39,    279,   1406,    278,    -37,  -1596,    232,
-       376,     90,    234,  -3348,    242,   1765,    555,   -883,
-       118,    115,     48,   -116,   2166,   -292,    136,    527,
-      -236,    -18,    411,    -20,   -190,   -480,    665,   3332,
-       378,   -287,    337,    199,     -5,  -3904,    311,   -297,
-     -2720,   -193,    -17,    911,   -224,    457,    -48,    254,
-       271,    -24,    -77,    165,     23,    182,  -1122,    122,
-      -520,    309,  -3604,  -1013,   -405,   -647,   -145,  -1162,
-      1019,   -190,   -278,     69,    362,   -185,    -78,   -245,
-       472,    670,   -493,    620,     76,    717,  -2296,   -111,
-      -454,   3224,     27,     47,   -351,   -154,   -293,    187,
-       -93,     96,     87,   -453,   -132,      9,    125,   -209,
-       -26,    284,   -552,    255,     87,    227,  -5445,    112,
-       172,    -15,   -448,    475,  -5747,    367,    149,   -228,
-      -797,    371,     67,   -102,   -118,   -418,    332,     38,
-      -100,     90,   -183,  -3302,     15,  -1049,  -1560,   1299,
-      -710,   1257,    698,    316,   -283,    955,    240,    182,
-       269,     12,    -37,   1817,    649,  -1273,  -2071,  -1719,
-      -765,    977,  -1159,    351,  -1583,    -85,   -771,   -215,
-       123,    314,   -158,     32,    560,    208,    265,   -451,
-      -413,     32,   1954,  -3598,  -1680,   -832,   -646,    761,
-       272,    394,    213,    -35,    -44,    343,    309,    244,
-      3041,   -399,    -50,   -126,  -2755,   -146,    243,   -367,
-      -600,   -166,   -832,   -537,    269,    -48,   2419,   -526,
-      -309,    -17,   -235,     73,    341,    351,   -840,   3241,
-       -94,   -432,    404,   -588,    158,   -127,    -49,   3259,
-      3543,    134,   -256,   -106,    622,    -45,   -170,   -109,
-        68,    377,    -84,    210,   -250,   -267,    257,    -77,
-         6,  -1109,  -1498,   -327,   1063,    992,    632,   -245,
-      -656,  -1100,    -60,   -456,   -170,   3208,     -6,     13,
-       -95,    606,   -594,  -2039,   -369,  -1743,    275,    -93,
-       117,   2828,   -138,   -108,    206,   1819,     98,    -45,
-        45,   -163,   2962,   -398,   3536,   -183,   -259,   -581,
-        65,   -498,   -288,   -357,   -339,    -13,    -71,   -409,
-        36,    -15,   -545,   1433,    135,   -220,     99,    752,
-       177,   -455,   -251,   1172,  -1274,   1062,   -774,   -999,
-       -63,  -2756,     99,    -86,   4695,   -171,   -129,   -856,
-        26,   -543,    610,  -1350,     -2,    271,    455,   -150,
-       358,    101,    536,    125,    101,     88,    -16,    -12,
-       488,  -7479,    110,    264,    140,   -302,    110,    232,
-         0,     15,     70,    -28,    -27,   -110,    -99,    201,
-        78,    215,   -108,   -267,  -7548,     34,    312,    -86,
-       197,    125,     80,    -75,   -117,     -2,    128,   -207,
-      -131,   -513,    614,     33,  -4844,   -302,   -323,    160,
-       808,    645,    243,   -603,     68,    -70,    158,   -131,
-      -212,    -34,   -247,    625,    134,    -42,    525,    -89,
-        31,    116,     -1,    508,   5021,    395,    111,    -86,
-      -172,   1433,   -114,   -126,   -148,   -337,   -260,    233,
-      -479,    275,   -247,  -5672,    386,   -110,    -99,   -142,
-      -171,   -154,   -358,     30,   1028,    -78,    575,    523,
-      -586,   -739,   1586,   1076,  -2519,   1572,  -1448,   -201,
-       166,    -54,    137,   1268,   1157,   -411,  -2905,    195,
-       489,   -740,    154,    522,   2276,   -604,    194,  -1112,
-       192,    400,   -271,    250,    413,    273,    158,   -299,
-      -874,   -228,  -2454,    162,    819,    457,   3401,    689,
-      -208,   -298,   -461,   -360,    -70,  -2133,   -114,   -124,
-        81,   -228,    625,   3525,    909,    254,   -234,   1316,
-      -773,    531,    -30,    -16,   -164,    -84,   2360,  -1900,
-       351,  -2979,    545,    653,    416,    273,    -79,   -825,
-      -107,     71,    495,    223,   -176,    129,     40,    424,
-      1627,    207,     47,     -8,   -273,   -715,     60,  -1253,
-      1501,  -1199,   -248,     39,   2859,   -432,     89,    299,
-       948,  -2608,   -896,   3468,     84,    511,     55,    151,
-       733,    270,   -354,    470,   -219,   -115,   -105,     91,
-      -259,   1941,    775,     12,   2764,    484,    557,   2288,
-      -118,    294,    -32,    719,    -62,    -64,   -295,    -82,
-      -145,   -285,   -492,     87,   -135,    -98,    194,   -288,
-        -8,    263,   -475,    -53,   -388,   5621,     41,    -28,
-        34,   -323,    138,   1935,  -1806,   -185,    340,   1380,
-        48,   -542,  -2965,   -339,     88,    554,     41,      4,
-      -151,    182,    -39,   -193,  -3355,   -312,   3106,   -203,
-       442,   -110,    317,   -269,    225,     31,    -62,   -277,
-       163,   -766,   -408,    210,    -58,    128,    161,   3308,
-      3321,   -138,   -278,   -149,    216,    134,   -253,   -135,
-      -154,   -123,    254,    200,     -2,    133,   -307,  -6253,
-       310,     -6,    959,     26,    191,    315,    528,    -75,
-      -230,   -203,    153,   -265,    -94,    -61,     -2,   2761,
-     -4623,   -353,    -19,    102,   -139,     54,    438,    267,
-       -73,    447,    226,     71,    -19,     75,    -40,    -32,
-      -850,   -500,    422,   1237,   -688,    357,  -3158,   -468,
-      -450,   -279,   -694,  -1109,    734,  -1602,   -117,    122,
-       261,    979,    -20,    385,  -2929,    342,  -3164,   -146,
-       252,   -104,     62,    469,    289,    249,   -214,    -38,
-        73,     83,     -7,     18,   -394,     -5,   -140,   -267,
-       331,   -147,   6540,    395,   -103,   -147,   -271,    -20,
-       191,     73,   -155,    197,     71,    503,     19,    138,
-      -129,    335,    209,     75,  -6207,    140,   -176,     -5,
-        35,    -40,    -61,   -146,   1080,     58,    327,    -49,
-      -842,   1431,    595,   3461,      1,    142,   2001,    297,
-       -16,   -425,   1156,   -101,    -54,   1060,   -222,   -295,
-       938,  -1212,  -2374,     73,   -272,  -3318,     -8,   -718,
-       114,   -154,     85,     -9,     72,     86,  -1330,    226,
-     -1414,   -521,   3161,  -1856,    133,    240,   -499,   -371,
-      -745,    779,   -463,   -506,    463,   -229,   -226,    389,
-       135,  -4137,    360,    735,   -318,    777,    593,    977,
-      -174,    286,    187,    -95,  -1626,    245,     97,      9,
-       277,    299,   1568,   1066,    375,   1342,   -390,    884,
-       271,    185,   -258,  -1100,   2113,   -107,   -447,  -1917,
-       -58,    -29,   1081,   -455,   -524,   -196,   1869,   -677,
-     -3564,   1443,     29,   -425,    -28,   -370,   -342,    -28,
-        30,   -118,     58,    607,    454,     45,   -120,    232,
-        20,     21,   -175,   -112,   -236,    492,    411,     42,
-       -42,   4041,     39,  -2579,    235,   -146,    122,     24,
-      1301,    123,   -461,  -3264,    316,    -88,   -209,    140,
-       387,   -430,     78,    508,    149,  -3588,   1107,    820,
-      -140,    654,    812,   -566,  -2578,   -403,    -72,    120,
-       355,   -136,   -121,    209,    240,    116,    231,   1630,
-       208,   -178,  -3160,   2203,    -52,    451,     84,   -310,
-     -1199,    596,     69,    285,    242,     15,     49,    341,
-      -154,  -2286,   1206,   -109,   1048,   -647,   1127,     98,
-     -1264,   -808,   1744,  -1597,     13,     26,   -216,    263,
-      3276,   3192,   -105,   -390,    -31,    676,     73,    265,
-        31,    101,    479,    -69,    123,    -24,    -49,     32,
-      -653,   2253,     49,   -346,   1476,   1820,    396,    639,
-      -219,    792,   1728,    147,   -765,   -140,   1181,     98,
-       153,    -98,   -755,   2473,    452,    231,   2031,   2468,
-      -416,    587,    724,    148,    500,   -933,   -229,     55,
-       102,     74,   -164,    652,   -425,    100,  -2684,   1358,
-      1626,   -350,    544,   -301,  -1589,   -305,  -1266,     11,
-       243,   -125,   -330,    294,   1471,  -2922,   1581,   -546,
-       582,    231,  -1407,   -877,    602,    219,    350,   1130,
-       -86,    214,    -56,    201,   -181,  -2140,   1108,    493,
-       456,   -542,   -113,   -852,   1647,   1897,    840,  -1178,
-      -369,    788,    488,    256,    366,   2298,   1167,   -205,
-       256,    585,   -555,    292,   2615,    748,   -247,  -1102,
-     -1682,    226,    415,     20,     27,    100,      9,    436,
-     -1746,   2621,   1583,   -211,   -833,    441,     54,  -1183,
-      -826,   -916,   -707,    564,   -232,    -14,    147,    453,
-        70,   1094,   -903,   -337,    450,  -1546,   -662,  -1047,
-     -2345,   -811,  -1037,     96,    560,   1381,   -119,   -383,
-};
-
-static const int16_t cb4448sl0[] = {
-     -3850,  -1289,   -449,    -36,  -1178,  -1175,    705,    -97,
-        37,   -650,    426,   -477,   -145,    124,      6,    207,
-       -96,  -3145,   2917,   -260,    349,    668,    -72,      6,
-       157,    -62,   -128,     20,    -82,  -1357,   -707,   -619,
-      -313,   -229,   3010,   -169,    -27,    738,    971,  -1450,
-       246,    154,   -163,    -15,    -93,      5,    -35,    -42,
-        24,     31,    -25,   6803,     33,    -32,    -68,    -68,
-       -44,    317,     43,   -106,    608,   -999,   -699,    582,
-        46,   1631,    830,  -1570,  -2645,    992,   2126,    132,
-      2377,   1551,    247,   -247,   1508,    -34,    162,   -275,
-       -81,   -654,   -625,    125,    -33,   -210,    309,    900,
-       571,    726,   2691,   2821,   -698,     60,     46,   -483,
-        14,   -210,   -295,    102,    214,    226,   2622,    -82,
-      -390,   1436,    107,    554,    381,   1307,   2283,   -190,
-        27,    -35,   5557,    283,    103,    180,    104,    -89,
-      -186,   -319,   -225,   -141,     92,      1,  -1942,   1025,
-       906,     32,     -3,  -1089,    182,   -799,    483,   -368,
-     -1734,   -103,   1680,    474,   -133,  -1067,   -545,   -219,
-      -118,   -635,  -2559,   1002,   2554,   -640,   -505,    179,
-      -344,    -81,    107,    -61,     79,    -12,    -29,    -37,
-     -7574,    -92,     64,     92,   -164,    -20,    -61,    -35,
-      -312,   -159,    333,  -3401,  -2596,   -344,     88,    604,
-       535,    -87,    365,    -13,    -77,    131,    127,    588,
-       302,    -94,   -506,   2427,     99,    304,   2653,  -1104,
-      1380,    976,   -530,   -120,   -105,    293,      9,   -826,
-       388,    -66,    421,   -202,    605,    675,   4060,    978,
-       143,    -94,     21,  -2444,    -30,    554,    695,   2878,
-       657,   -104,   -435,   -326,    307,     20,     20,    159,
-       106,  -3473,    326,  -1029,   -304,    670,  -2109,   -431,
-       573,    704,    293,    -45,   -169,   -119,   -191,    599,
-      -910,   1976,   -165,    581,   1209,  -1689,   2365,   -370,
-      -601,   -696,    374,    202,   -114,    -61,      3,    -63,
-        30,    369,   -158,   -128,    198,     52,    -98,    -44,
-      -323,  -5118,  -1100,   -669,   2256,     32,    -66,    206,
-        65,   2801,    783,   -470,   -973,    471,   -211,    -27,
-      1879,    302,   -388,   -249,    301,    537,   2761,    321,
-       571,     20,    337,   1336,    522,    231,    368,   -363,
-     -2065,    -57,  -2565,   -584,   -611,     56,    814,   -382,
-      1671,    408,    492,     12,   1201,   1513,    247,   2165,
-      -592,  -1246,   -493,  -1012,  -1330,   1251,     75,   -100,
-       182,     52,    -47,    710,  -1137,   2420,   -559,    266,
-      -801,   2523,   1229,    736,   -409,    -49,    269,   -174,
-      -179,    -24,    348,   -661,    251,  -1039,   2647,    283,
-       728,  -1850,  -2088,    196,     39,    -72,    -35,    -94,
-      -540,    266,    340,   -450,    763,     -5,    113,   2618,
-     -2737,   1047,   -246,   -522,   -182,    376,   1068,    203,
-      1238,   -938,    211,   -308,   -395,   -629,    596,  -2634,
-      1452,  -1155,     83,    -89,  -3121,    419,     40,   2691,
-      -306,   -343,      4,   -347,   -725,   -117,   -315,    115,
-      -215,     26,    429,   1074,  -1831,  -1850,   2609,     72,
-       467,    191,    432,    857,   -186,      0,   -443,    -24,
-       500,    541,     30,   2324,  -1160,  -1153,   1783,   1282,
-     -1992,    101,   -108,   -108,    556,  -2012,    506,    691,
-       -65,   -610,    402,    610,   1941,   -121,    942,    589,
-      1879,     58,    312,  -2218,  -2056,  -2284,   -350,   -453,
-       306,     38,   -579,   -185,   -101,   -196,   -150,    156,
-       126,    -44,   -143,  -7923,    126,   -120,   -138,   -233,
-        97,    -20,   -121,   -175,     -8,    -13,   -123,   -365,
-       251,    730,   2883,    667,   -418,   -208,   2170,  -1442,
-       196,   -389,   -516,    252,    -98,    525,  -1819,   -647,
-      1575,    768,   1124,   -428,  -1010,  -2027,    411,   -473,
-       863,    210,    908,     40,    145,     37,    192,    189,
-        52,   -217,   -168,     63,     -7,    -53,   -121,     13,
-      -145,      0,    -37,     61,  -7979,   -142,     32,    118,
-       190,     -7,    -13,    113,     36,     31,   1461,  -2088,
-      2391,   -939,    -66,    822,    280,    246,   -157,   -183,
-      -433,   -356,     88,   -101,   3969,  -3388,    -84,     84,
-       130,     35,     74,     37,    181,   -195,    219,    -29,
-       -23,    -32,     69,    625,   2328,   -192,  -2617,    287,
-       543,  -1604,    823,   -547,   -277,    764,    276,    156,
-       198,     17,     84,    346,    -27,   -129,    143,    217,
-       212,   -249,     20,   6449,      7,     51,   -889,    -88,
-       265,    282,  -1956,   1327,  -1025,   1338,  -1709,  -1008,
-       372,     57,   1404,    234,   2621,    -18,    663,    301,
-         0,    167,   -372,  -2534,   1945,   -191,    198,    359,
-       -43,     92,     24,  -5498,    -63,    189,     36,   -369,
-       352,    381,   -205,   -144,   -119,   -267,    -60,    -10,
-       387,   2388,   -155,   -450,    465,   1529,   -216,   2673,
-      -146,    118,     50,    290,    147,     11,  -2912,    863,
-      2184,   -689,    -44,     59,   -663,    663,    675,    295,
-      1331,   -115,    -10,    -54,     -1,     31,   1699,    127,
-       215,   2966,    163,    416,  -1053,   1216,    356,   1428,
-      -166,   -172,     -2,   -355,   -169,   -331,    -94,    -78,
-      -123,   4875,    311,     67,   1145,    397,   -288,    212,
-      -344,   -290,    126,     16,    176,    485,    551,   -526,
-        11,    120,   -274,     83,  -5399,   -154,  -1611,    887,
-       321,   -446,   1166,   -333,    652,    310,   -895,     62,
-      -219,   2840,   -753,    -34,  -3203,  -3600,    464,   -249,
-       336,    297,    -85,    316,    144,    306,   -249,    149,
-       112,     73,    192,    -89,     18,    197,    116,     51,
-        37,    212,  -7248,    163,     31,    -52,    -31,   -101,
-     -1366,   -353,   -325,  -1335,   -440,   1193,    670,  -2635,
-       872,   1400,    733,    395,    122,    130,  -4146,      0,
-      -382,   1486,    308,   1179,   -412,    288,    701,    161,
-       147,    959,     60,     77,   -123,     17,    193,    204,
-      -226,    388,    272,   -588,   -157,   2823,    735,   -745,
-      2368,    359,  -1088,  -2004,  -1293,   2018,    483,    320,
-     -1014,   -806,   -479,    -68,    -51,    168,    873,     27,
-     -7906,     57,     19,    -23,     27,     43,    -13,    -50,
-        93,     16,     29,     31,    -26,     32,    -22,    453,
-      2922,  -2560,    138,    923,  -1245,   -405,     10,    228,
-      -270,    145,   -192,     83,     48,    101,     77,   -226,
-        36,   7792,    126,   -275,    -37,    -36,      9,     45,
-       -89,     13,    148,    125,     24,   -442,    111,    -12,
-       540,   1794,   3008,   1620,   -185,  -1394,   -161,    -25,
-      -313,   -317,    591,   2507,    134,   -369,     77,    527,
-      -619,   -236,   2681,     87,  -1060,    -34,   1894,  -1123,
-       373,   -628,   1934,  -1279,  -1689,   -609,   -472,   -598,
-       405,    229,    414,     12,  -2923,    -33,   -435,    -49,
-      2380,    -34,   -344,  -2171,   -284,    274,    226,   -287,
-       -84,    -57,     -1,   -169,    -50,    479,    707,  -2774,
-      -532,   -640,   -244,     44,    458,   2519,   -590,   -472,
-};
-
-static const int16_t cb4448sl1[] = {
-     -2878,   -714,   3098,    -76,    -51,    232,    118,   -780,
-      -691,   -267,   -309,    105,   -179,     -5,    -84,    -11,
-      -120,   -379,    458,  -3161,     65,   2994,     64,    374,
-      -440,     62,   -183,     28,   -561,     73,     59,  -2565,
-       445,   -451,  -1026,    437,     10,   -173,   1243,  -2278,
-      -481,   -395,   -154,  -2402,    945,  -2789,    117,  -1184,
-        75,   -704,    527,    478,   -589,     17,    131,   -110,
-       574,  -1055,   -628,   -277,   2798,   1483,   -657,  -1996,
-      -248,    194,   -284,    822,    225,   -170,    -10,   -302,
-      -427,  -1700,    -90,   2756,   2124,    -49,   -964,    372,
-      -637,    443,     13,    -69,    -71,    196,  -1971,    110,
-      1147,    698,   1333,   1369,    527,    165,    903,    577,
-     -2134,     56,    -33,     34,    183,    247,   -342,    974,
-      1079,   2478,    -26,     80,  -2377,    430,  -1422,    428,
-     -2187,   -469,  -1280,   -326,    -40,    188,    911,    405,
-      2772,    279,   -493,    265,    768,     45,   5778,     44,
-       121,   -257,   -135,    124,    263,     15,    197,   -114,
-         5,    -14,     -8,    -82,   3989,   -511,    197,   2446,
-      -292,   -205,   -919,    162,   -121,    145,    -40,     71,
-      -105,     72,   2035,    960,   -145,   -467,   -518,    167,
-     -2988,    421,    860,    320,     40,   -446,    319,    160,
-       140,    511,    -55,    213,   -148,   -527,   -666,    687,
-         9,     23,    344,   -156,  -4646,   -125,   -220,      9,
-       134,    -25,     16,  -1319,    763,     58,  -1586,   -438,
-       301,   -411,   -337,  -3398,    358,    -68,   -111,   5483,
-       -36,   -456,    -94,   -116,    204,     95,     84,    -73,
-      -163,     69,   -190,     64,  -3716,   -326,   1815,   -843,
-       312,   -498,    684,   -641,   -766,   -104,    606,     70,
-      2630,     51,   -170,  -3584,    167,    461,   -162,    132,
-       496,     91,    171,    255,     48,      2,   -120,  -1196,
-       534,   -431,   2669,   -403,      8,    287,   -391,   2557,
-       849,    167,   -275,   -184,    605,  -3570,    113,     22,
-     -2586,    668,    294,   -910,     67,   -141,      0,    418,
-       271,     75,     90,   -124,    446,   -142,   -635,    631,
-      -956,   1566,     25,  -1982,    790,   2770,     33,   -520,
-        23,  -7488,     67,    -73,     60,     64,    -46,    -36,
-        76,      3,     22,    149,     61,     34,    255,   -380,
-      -284,  -2531,  -1423,   1507,   -926,  -1074,   -929,  -1430,
-      -141,    165,    -80,   -268,     21,   -767,   1542,   3197,
-      -191,   2014,   -304,    595,    536,   -906,   -126,   -354,
-       -76,   -162,   -125,  -3139,   3197,    934,    366,   -923,
-      -330,    277,   -284,   -163,    -12,    402,     15,   -146,
-        20,     83,    111,    196,     23,     71,     77,   7287,
-      -175,    -13,   -227,    -59,    -56,    -28,      1,    163,
-       -50,     59,    635,    150,     95,   2750,    775,  -2057,
-       423,  -1078,   1749,     -3,   -655,   -365,   -357,    145,
-       -76,      5,    -93,    224,    150,    108,    -34,    173,
-       148,   -371,     34,     48,  -8037,     65,     50,    103,
-       -42,    -10,    -96,    -90,     -3,     60,     92,    -79,
-       -76,    386,    114,  -1947,    833,  -1279,   -484,    217,
-      3156,    226,    485,   1191,    425,     88,    -59,   -243,
-      2292,   1681,    671,     62,    899,  -2453,   -100,   1039,
-       713,   -104,    554,    219,    356,    963,    741,   -102,
-       455,   2067,   -324,    172,     28,    772,    752,  -2351,
-     -1438,   -865,  -1668,    105,   1034,   1195,     14,   -350,
-      -425,   -648,   2086,   -532,    634,   1537,    -33,   -598,
-      2888,    -85,    184,    158,   -164,   3339,    237,   -284,
-       -54,   -246,     46,   -254,    365,     55,   1928,   -346,
-      -357,    331,    139,     16,    674,   -384,    -67,  -3399,
-       165,     76,    215,    137,  -3187,   -146,   -264,   -165,
-     -3039,    235,   -541,   -630,    -32,    -33,   -211,    160,
-      -121,   -111,  -1296,    -47,   -128,    292,  -1523,   1540,
-       771,   -166,   -509,    212,   2758,   -327,   -418,   -305,
-        -9,    465,   2513,    195,    -70,   -209,    -66,    127,
-      -147,  -3161,   -192,   -541,   -555,    131,   -858,  -1609,
-       973,   -156,  -1877,     60,   1011,     66,   -348,    912,
-     -1731,  -1296,    305,   -369,   -560,    470,     46,   -863,
-      -124,    -37,     40,   -395,  -4886,    -20,    221,    228,
-       177,    182,     98,   -151,   -195,    854,   -194,   -374,
-       301,    586,     58,   -908,    -19,  -4198,   -171,    330,
-        48,  -3312,   -164,   1913,   1183,    -42,   1287,   -353,
-       757,    620,   -547,    251,   -520,     59,     43,   -179,
-      -191,   -131,  -2951,   -944,  -2479,    344,   -813,    104,
-      -697,    -44,   -270,    198,    245,   2866,    208,    178,
-      -248,     38,     19,    577,   2812,   -765,   -855,   -439,
-       -60,    -30,   -352,   1521,  -1069,    457,    415,    572,
-      -749,   -144,    100,    515,   -794,  -1554,   2507,   -270,
-        10,     62,   2507,  -1550,    -75,     70,   2530,    562,
-       132,   -141,    251,    156,    835,    102,    717,   3226,
-      3327,    172,     84,   -205,    -11,    208,   -310,    164,
-       -27,     11,    281,     37,   -518,     20,    -76,     82,
-      5436,   -543,   -301,    112,    359,   -140,    -94,     78,
-       -18,     38,   -196,    -92,     13,   -111,    -23,     30,
-       -15,    -94,    101,    142,  -6455,    321,    322,     50,
-      -216,   -321,    -10,   -465,    101,     45,   -585,   -969,
-      1248,   -456,  -2523,   -852,  -2129,   -889,     33,  -1424,
-      1462,    583,    749,    527,  -1737,   1262,   -594,    414,
-      -215,  -1184,    412,   1758,  -1836,   1248,    440,   -178,
-       784,   3591,   -227,     43,   -493,   -766,   -270,    150,
-       151,    -56,   -110,  -2832,    -73,   -166,    470,   -179,
-      -681,     71,   -114,  -2743,   -806,   -560,     63,   -244,
-       -90,    182,   -143,    995,    404,    -13,  -1343,   1524,
-     -2472,   1718,   -957,   1229,    458,   -395,  -2817,   -579,
-       -99,    340,   1538,    684,   -492,   1156,    -45,    -65,
-      -305,  -1408,   -325,   -270,   -358,   -127,     92,    -97,
-       415,     85,  -4749,    173,   -296,   -203,    331,    315,
-       184,    -46,   1315,   -146,    -55,    427,     37,    255,
-      -209,    272,    735,    506,    105,    103,    902,  -3449,
-       116,   2304,    616,  -1564,   1508,    478,    320,  -2418,
-       244,   -176,    -32,    238,     92,    290,   -168,    -78,
-     -3464,    270,  -1902,      2,    696,     92,  -1610,   -206,
-       -49,    178,    121,     27,    119,     72,   -253,   -398,
-     -2720,    -81,   -162,   -550,   2595,   1445,    249,   -104,
-       218,   -310,    -95,     18,   -473,   1908,    432,   -227,
-      -168,  -2725,   -240,  -1830,    199,    437,  -1392,    304,
-      1461,  -2394,   -603,   -540,    769,    340,   -104,   1569,
-       -21,    338,   -874,   1533,    281,    -59,    487,   2120,
-       179,   -140,   -328,    -57,     63,   -110,  -1330,   -485,
-     -2427,   1159,    355,    -26,  -2055,    154,   -563,   -132,
-        49,   -329,   -187,    -24,    -71,  -3970,    276,    158,
-        92,   -202,      7,   -422,   -578,    186,   -407,   4960,
-      -595,   1027,    417,    691,     69,    133,    123,   -147,
-};
-
-static const int16_t cb4448ss0[] = {
-     -2680,   2499,   -328,   2212,   1288,    -57,   -727,     76,
-      -210,   -218,     41,   -343,    -26,    -38,     43,    606,
-      -619,   -531,  -2082,     87,  -1127,   1282,    -23,   2272,
-     -1816,    104,    -31,     85,    -22,     60,   1293,    138,
-       382,    432,    489,   -372,  -1649,  -2809,  -2556,    -98,
-      -232,   -233,    169,    186,     79,   1157,   2113,   -942,
-       636,    877,   -601,   2277,   1411,   1165,   1029,   -613,
-      -348,    -38,    -19,     45,   1318,  -1980,     12,   2762,
-      1519,    184,   1980,    -49,   -270,    361,   -172,   -601,
-      -196,    186,    -67,   -124,   1503,  -1011,    263,    223,
-      -384,    153,    -21,  -1063,   -239,   1171,  -3501,    512,
-      -162,   -180,    139,   -680,    609,  -1919,   2969,  -2321,
-      -183,    194,   -558,     26,     91,    340,    -25,    -31,
-       127,    662,    182,    191,  -2201,  -2603,   2252,   -523,
-       277,     50,    355,    295,    -65,    355,    207,     82,
-      -489,   -143,   -218,     89,    666,   -359,   2716,  -2310,
-     -1912,    417,    400,     43,    110,    -93,   -142,     61,
-     -3000,    454,   -153,      0,   -413,    469,    339,    318,
-      -197,     75,    -80,   2894,   -129,     82,   1431,   1183,
-       429,  -1556,  -1339,  -1573,    -92,   -911,   -230,    -12,
-        -4,   -145,   -388,   -419,     -5,   -241,   7120,    165,
-      -125,   -122,    126,   -150,    109,   -146,    -61,    -49,
-        47,     70,    -43,     40,   1867,   1473,  -1278,   1229,
-     -2256,    -90,     10,   -744,   1196,   -109,    402,    258,
-       690,    -74,     26,   1294,  -1079,    142,  -2384,   -324,
-     -1696,  -2741,    321,     66,     83,   -127,   -131,    156,
-       166,    135,   1812,  -3445,     10,    535,   -547,    481,
-     -2243,    287,   -335,    218,    195,     -1,    -25,    -94,
-       195,   1433,  -1428,  -1444,    520,    219,   3363,   -388,
-      -807,   -454,    -29,    316,    125,    159,   -144,   -156,
-      -317,    752,    256,    216,    340,    488,    147,  -5662,
-        55,   -110,    387,   -102,   -211,    -66,    -26,   3688,
-      -172,  -2366,   -244,     -5,    353,     11,    503,     88,
-       227,     69,   -240,   -187,    -58,   -389,  -1783,  -1427,
-        20,   -618,    544,  -1337,    628,  -3180,    708,   -538,
-      -423,    115,     49,   -161,    184,   -682,   -223,    689,
-      1299,   -891,  -1073,  -1228,   -305,     47,  -2221,  -1559,
-       598,   -380,    166,    143,   -366,    287,   2122,    509,
-       629,    235,   1523,   2900,   -640,   -425,   -462,   -231,
-       -53,    -27,   -263,   2090,  -1892,  -1147,    -42,    866,
-     -2301,    461,  -1082,   -625,    -85,    148,    229,    -25,
-        85,     53,    259,    -81,  -4072,   2577,    -12,     -7,
-       335,   -151,   -691,   -137,     98,    372,    -37,   -192,
-       -17,   3318,   -558,   2064,    396,    258,  -1067,    229,
-      1122,    298,    -25,     40,     27,   -134,   -166,   -247,
-     -2010,   -440,   1066,  -1400,  -3454,   -289,    428,    629,
-      -158,    126,    129,    183,    -12,   -171,   -120,    421,
-      -445,     66,   -900,   3680,   1583,   1985,     25,    229,
-      -535,     -1,     45,    207,    -54,    -30,   1581,   -938,
-      -703,    405,    878,   -398,  -1069,   1748,  -2587,  -1419,
-      -375,   -441,   -487,    109,     21,  -1399,    648,   -271,
-      -701,    635,    115,   -138,   -458,   -600,  -1891,    585,
-       420,  -1916,   1135,      7,   1584,    910,   4267,   1328,
-       279,    395,    -35,    -99,   -168,    503,    216,   -126,
-       211,    212,    193,  -2205,    491,    696,     41,    283,
-       649,  -3425,   -999,    200,    625,   -261,   -378,    -47,
-       -15,    -30,  -1262,   1700,  -2191,    196,  -1773,   -251,
-        84,    498,   -261,    150,    451,     41,    336,     27,
-       -56,    562,    -86,     -1,  -1073,   1461,   2148,  -2961,
-      -326,   -257,    440,    -42,    -48,   -320,    122,     94,
-     -1267,   -830,   2810,    -94,   -201,    990,   2415,   -740,
-      -166,   -267,   -157,     68,    301,    290,     65,    931,
-      1969,   -170,      6,    149,   -272,   -105,    542,    -11,
-     -3888,    105,    305,    333,    -14,    -39,   1944,  -1164,
-        88,   3829,  -1190,   -535,   -644,   -330,    509,    -93,
-      -314,   -228,   -294,   -342,    -26,   1143,  -2371,   -400,
-        74,    101,    -68,   -583,  -1091,   3367,   1146,   -638,
-      -436,    136,     41,    -92,   1518,   2818,  -2214,  -2044,
-       636,     -2,     79,   -508,    676,   -439,   -358,   -198,
-       -69,    271,     59,   1638,    468,     97,    264,     -8,
-     -5152,   -152,    152,    252,    401,   -375,    -17,   -132,
-        51,     63,    633,   -180,    367,    111,    -18,     15,
-       -52,    128,    -54,     11,     96,   -122,    -26,  -7257,
-       -42,  -1221,   -688,    197,   -107,   -217,    141,   -289,
-       141,    269,    439,   -747,  -3743,   2098,    226,    137,
-        26,  -1645,  -1735,    -80,     43,   -216,    245,    544,
-       157,     40,    238,    237,   -989,    379,     88,    639,
-     -1335,   1542,   1147,   -510,   1008,   -134,   -626,    696,
-     -3034,    334,   -689,    115,   -168,     39,   1750,   -649,
-      -233,    -99,   -231,    515,    112,    -11,   -162,   -133,
-      -138,   -486,  -4137,    204,   -102,    867,  -1030,    219,
-      -254,  -2787,   -128,    961,  -2837,   -482,   -195,    691,
-      -170,   -178,    164,    -54,  -2008,   -116,     74,    398,
-       -96,   -472,    407,     27,    287,    628,     97,  -1425,
-     -3923,      6,    117,  -1081,    930,    396,    452,     87,
-      -441,   -155,   -738,   1089,   2128,  -3133,    -21,   -622,
-       -48,   -127,    506,    985,   -200,   3361,    184,   -522,
-        41,    503,    209,     14,    -96,    791,   1263,    289,
-      -101,  -1728,  -1073,   -517,   4156,   -685,    214,   -721,
-      -608,   -102,   -295,   -114,    126,   -340,    109,     88,
-     -1588,     82,   -549,   -376,     76,     84,   -210,     59,
-      -130,    321,    678,   4704,    564,     -1,    100,    325,
-      -296,    256,   -936,   -886,  -1088,   -191,    476,  -3684,
-      1359,     12,   -397,    -70,    -17,     58,    569,    353,
-       821,    -77,    253,    153,   5697,   -171,    181,      3,
-       -90,   -413,   -265,    142,     62,    959,    151,   -103,
-       845,   -340,   -280,   -733,   -592,   -244,   2534,   3089,
-       935,   -393,   -105,    145,   -666,  -2865,  -1532,    717,
-      2867,    206,   -800,   -125,    -34,   -189,   -138,     42,
-       189,   -141,    107,  -3030,  -3795,   -494,    108,   -149,
-       382,    760,   -142,    337,   -844,    228,    124,    232,
-       -23,     -1,   2298,    750,    636,   -353,    157,    676,
-      -191,    812,   3434,    759,    543,    -17,   -213,    -95,
-       316,   -693,   -604,  -1059,     32,   -496,  -3334,   -272,
-      -104,   -495,   -130,    627,   -376,     74,   -599,     55,
-     -2185,   -968,    517,   -343,     21,   -249,   -963,    268,
-      3339,    239,    771,   -134,     42,    231,     75,   1633,
-       331,   -125,   -414,    457,   -316,    111,   -475,    363,
-      -687,  -4105,    469,    443,    113,     72,   1498,    406,
-       915,   -229,    564,   -377,     89,    137,     39,      2,
-       -29,   -416,   -149,   3598,   -253,     12,  -1015,   3016,
-       916,   -726,  -2286,    -99,  -1085,   -238,    690,    -44,
-       -51,   -115,     25,     56,   -905,  -3050,  -1121,    -24,
-     -2160,  -1424,   1009,   -180,   -424,    188,   -417,    -66,
-       -86,     74,    -28,   -225,   -937,    -90,    251,  -1850,
-      1939,   1843,    833,  -1879,   -192,   -318,    103,   -363,
-       -22,    -57,  -2833,   -118,   -277,    -98,    -85,   -495,
-      -874,   3027,   -141,  -1490,   -172,   -266,    -32,    190,
-       -12,   -364,   -380,  -2107,    249,   -217,    662,   -584,
-        89,   -563,   1153,  -3091,   -656,    463,    144,    -26,
-};
-
-static const int16_t cb4448ss1[] = {
-      6475,    -60,    162,     42,    -71,     50,    -85,   -278,
-       -14,    -60,    -53,    132,     28,    -65,    -71,    -62,
-         6,    119,    195,   -140,     28,     37,   -603,  -4956,
-      -290,    700,   -241,     11,   -301,    297,  -1009,    468,
-       885,    192,     40,    495,    846,    -28,    201,   -255,
-       927,   -644,   2424,   2882,    -82,  -1764,   1077,    315,
-       946,    843,    399,    176,    567,    546,    377,    283,
-      2469,  -1815,    -65,     12,    422,   -368,   -639,   -493,
-     -5606,     84,    122,    241,    267,     -8,   -257,    -23,
-      -220,   -118,    139,  -1582,   -218,  -2436,   2539,   -270,
-       146,   -262,   -489,   1551,    604,   -225,    363,    234,
-      -110,   -166,   1058,   2342,   1950,     43,   2362,  -1189,
-       492,    172,   -296,    159,   -430,   -311,   -135,   -182,
-        77,   -444,  -1995,   -855,   2080,   -457,    389,    872,
-      2549,    935,   -128,    519,   -374,    310,     96,    119,
-      -263,   1981,  -1019,   -628,    212,   -173,  -2292,   1066,
-     -1985,   -426,    115,   -746,    147,      3,     94,    195,
-     -1762,   1713,   -337,   1884,   -123,   -480,     95,    777,
-      1073,   2117,   -969,     16,     11,    123,    374,   -394,
-     -1419,    829,   1657,   1294,  -2770,    286,    813,   -290,
-      -115,    111,    312,     53,     44,    896,     34,  -2288,
-     -3443,  -2053,     98,    293,    429,   -168,     74,    -58,
-       221,   -383,    100,     63,   1925,  -1207,    199,     94,
-       -94,   3060,   1825,    611,    292,   -141,    382,    141,
-       105,   -151,      0,   1448,   -267,    206,    932,   -682,
-       251,   -183,   1080,    161,   4334,   -397,    525,    -91,
-       127,   -104,    921,  -2282,   -274,  -1070,    387,   -312,
-      1380,   2769,   -554,   1501,   -921,    102,   -183,   -104,
-       -66,  -1656,   2049,    122,  -2271,     84,   -276,   -204,
-       353,    380,   -414,  -1757,  -1035,   -318,   -130,    -10,
-       163,   -471,   2425,   2864,  -1892,    294,    817,    754,
-       277,    -29,   -214,    -39,   -312,    -57,    -54,    986,
-      2286,   -574,     34,   -641,   3783,    214,   -399,   -155,
-        38,   -148,    -42,    -89,     97,    -17,  -2192,    729,
-       272,   1168,  -3593,    150,     96,   -473,    211,    -60,
-       136,    -26,    142,   -285,     93,    666,   -465,   -181,
-      2016,   -338,  -2186,  -2608,   -449,    107,    -18,     45,
-        24,    245,   -119,    244,    442,   1509,    158,    242,
-       169,    -16,   -221,    104,    115,     16,   -217,     23,
-       -25,    130,   4076,    662,   -315,   3068,    -35,     36,
-      2785,   -223,   -528,   -157,     43,    186,   -514,   -240,
-        15,   -245,    520,   -110,   -781,   -641,    294,    -20,
-        64,    -44,    400,   -109,   4756,   1334,   -421,   -195,
-       130,  -2182,     64,   -897,  -1423,   3081,   -523,    378,
-      -164,    968,    593,   -192,     71,    114,   -143,    -10,
-      1961,  -3141,   3173,    -39,   -110,    -57,    144,    -68,
-      -429,     30,    -10,    467,    159,     40,     67,    260,
-       814,   -168,   -836,   1073,  -3562,   1786,  -1205,   -148,
-      -105,     94,      5,    143,    138,     18,  -1384,     20,
-       635,   -126,    -71,    -87,   -320,   -407,    559,   -151,
-      1312,  -4395,   -755,   -263,    -77,   1657,    699,    426,
-       469,   -469,    253,    -80,    317,    -71,    268,   3592,
-     -2051,    304,    157,     43,   1872,   3794,  -1537,   1226,
-      -159,   -335,    340,   -385,   -253,   -195,     21,    106,
-       -31,   -187,    -63,  -2771,    446,   -708,    202,   -186,
-       548,    832,   1757,  -1274,   1234,   -756,   -160,     76,
-       -82,     64,   2169,     13,   -849,    244,  -2486,  -2138,
-       844,   -178,    270,    297,    150,    202,    -41,   -188,
-       121,  -1272,    371,   -319,   2848,   -469,  -2059,   1290,
-      -457,   -380,    690,    148,    -51,   -340,    113,     57,
-     -1259,   -396,  -1404,    336,   -511,    576,   4441,    124,
-       143,   -483,     85,    138,    196,     38,   -188,   1177,
-      -764,  -2067,    820,   -264,    218,   -300,   -501,   -230,
-     -2529,   1349,  -1606,   -199,     92,    -55,  -1324,   -702,
-      2078,  -1269,    414,    -50,     29,     12,     87,   -593,
-       217,    -82,     94,  -2392,    308,   2315,   2188,    768,
-     -1103,    -77,    579,   1706,   -826,   -224,   -297,    145,
-      -640,    570,    146,   -199,   1187,   -872,    327,   -310,
-      -122,    -23,    -13,    808,   -139,  -4425,   -670,    412,
-        -4,    -70,   -162,  -1056,    685,   -312,   -957,    339,
-       893,   -252,   4040,   -105,     76,    993,    281,    -79,
-      -139,    168,   -298,    795,  -1107,    395,    386,   -524,
-      1052,  -2341,   2537,    474,    726,  -1028,   -357,    -52,
-       115,     -9,   1349,  -2240,    785,   2751,     77,    922,
-       385,   -539,   -148,    410,    251,    -70,    199,     51,
-      1728,   -206,   1181,   1182,   1388,   -791,    121,     -3,
-         8,   -147,    -95,    101,    886,  -2412,     19,   2401,
-      -116,    718,   -592,   -221,    724,    -33,    690,   -180,
-       868,  -3330,    377,   -336,    128,    267,  -2075,   2848,
-      2994,   -300,      3,   -153,     41,   -456,     38,    -31,
-       309,   -106,    -92,    -14,     96,    672,    634,    207,
-      1556,    438,  -2147,    282,   2443,  -1662,    511,    457,
-      -259,   -505,    173,   -204,   -858,   -117,   2751,    852,
-       220,   -512,  -2576,   1542,    357,    -77,     -4,    165,
-       -63,    189,    302,   -699,   -764,  -1559,     25,   -233,
-       405,    173,    698,    -73,   -300,  -1442,  -2923,  -1326,
-       -25,     98,   -196,  -2915,  -1169,  -3392,    691,    353,
-      -196,     96,     41,    180,    198,    280,    207,   -158,
-       -19,   1556,    991,   -523,   -280,  -1599,   1368,  -3247,
-      -996,    159,   -136,   -469,    -48,      0,     30,     95,
-      -765,     33,   6580,   -180,    316,   -176,    105,    -21,
-        -9,    166,    148,    -52,    -49,     42,      2,    318,
-       -55,    -91,  -1461,  -1474,  -3086,   -756,   1479,    -29,
-      -668,   -255,    -51,    241,    249,   -212,    132,   -129,
-      -410,    113,     17,    301,    185,     96,     10,    188,
-        38,   -772,   5152,    -13,    -10,   1527,    806,    -23,
-       -79,   1102,    -77,    329,    -99,   -404,   2276,   -873,
-     -2681,   -765,     71,     20,  -2448,   -803,   1827,   1115,
-      -160,    -15,    288,    -46,    573,    100,   -726,   -694,
-      -406,    288,     61,  -2216,   -904,     77,  -2983,   -962,
-     -1438,    809,    -38,    -79,     95,     52,   -231,    518,
-       115,     41,    908,    780,    805,   -207,  -2161,    554,
-       968,   3111,    133,   -158,    -13,    -34,   -182,    -60,
-       105,    718,  -1245,    227,   -818,   1184,    903,    603,
-      -988,  -2647,   1847,    141,    817,   -337,    131,    393,
-      1653,    839,   -261,    466,    465,   -297,   1440,   -431,
-      2058,  -1857,  -1416,    310,   -722,    -54,    203,   -266,
-      3770,    172,   -593,    -73,   -508,    -61,   1110,   1261,
-       275,   1681,    447,   -147,    -95,     33,   1281,  -3119,
-        24,   -308,    366,   -468,    232,    358,    667,   -942,
-       696,   -924,  -2059,    -62,    151,  -2102,    332,    258,
-      -186,   -636,    685,    214,  -3174,  -1243,    573,   -276,
-         9,   -262,    -20,    158,   -174,    -21,    593,  -6198,
-      -266,   -270,    -63,   -203,     63,   -396,   -100,    191,
-       212,     85,    120,   -791,     37,    -47,   2108,    652,
-       519,    346,    106,  -1840,  -2566,   -563,     14,    266,
-        10,    214,    504,  -1269,     50,    164,    120,   -105,
-      -546,   -212,    -79,     41,   -171,    675,   -252,   4373,
-       -16,  -1697,  -1491,  -3588,   -587,    623,     67,    269,
-       484,    -25,   1067,    580,   -598,    195,     47,    -17,
-};
-
-static const int16_t cb4448sm0[] = {
-     -5114,    166,   -785,    635,   -528,   -102,    269,    492,
-      -185,   -614,    122,   -124,     85,    145,    270,   -154,
-        39,   2524,     58,    -57,    119,      5,    343,   2873,
-      -278,   -787,    137,     62,   -169,   2049,   1476,   -325,
-       130,   -702,   2882,    -19,    310,   -258,   -135,     88,
-      -268,     69,     69,    695,  -1935,    815,    678,     44,
-      3085,    278,   -587,  -1326,    360,    145,    -17,     66,
-     -2475,   -594,    132,    358,    406,   -369,   -237,   3363,
-       329,   -424,     52,     49,    291,   -236,  -2332,   -261,
-        49,    -27,    170,   3656,   -214,   -603,    264,     60,
-       -87,    145,    116,    179,    190,    679,    339,   -340,
-      3272,    641,  -2631,    484,    159,    305,    290,    208,
-       226,     68,    102,   -145,   -356,    153,    647,  -2046,
-       937,  -1666,   1093,    -29,  -1161,    749,  -2360,    171,
-     -2185,    841,  -1406,  -1057,  -1764,   -300,   -205,    452,
-      2168,   -214,   -153,    291,   -106,     79,   1717,    -20,
-     -1771,    286,   -466,    686,    167,    137,      5,     43,
-      1075,  -2601,    261,    -86,   -333,   -724,    162,    186,
-         4,   -334,   -412,   -309,    888,   -114,    531,    297,
-      4284,    297,  -1695,   -212,     75,   -263,  -2313,    102,
-      -434,    352,  -1813,   -472,    114,   -185,      6,     66,
-      8061,    414,   -577,    672,   -152,    152,      1,     38,
-       -66,     48,    -35,     62,    -98,    -19,  -3762,     98,
-       242,    114,    359,   -162,    115,  -3038,    340,    253,
-      -526,   -144,     14,   -147,     28,   -352,  -5858,     46,
-      -597,   -392,    226,    -54,    -70,    -47,    -45,     16,
-        53,    137,    172,  -3017,    -22,   -163,   -267,  -3289,
-       -31,   -174,    110,    794,    425,     67,     58,    -72,
-      -156,   3937,   -585,   2116,     99,  -1115,   -257,    801,
-       270,   -329,   -257,    -18,    122,   -369,  -2196,   1746,
-      -305,    599,    800,    749,   1466,   -299,  -1519,   -255,
-      -233,    217,   -117,   -256,    301,   -249,   -327,   5530,
-        86,    135,   -784,   -137,    610,     -7,     55,     93,
-      -106,    -50,    267,   -229,    -26,  -1070,     13,    -75,
-      1733,   2929,   -130,   -713,     15,  -2144,    104,   -318,
-       282,     -8,   -285,   -468,   -124,     59,    520,    -78,
-      -332,   -654,  -5048,    212,   -388,     97,  -1523,    227,
-     -2545,   2159,   -127,   1020,     79,   -664,    403,    -31,
-      -356,     -1,   -436,    -86,     75,    610,   3048,    235,
-     -3133,  -1189,    -44,    -23,   -324,    260,    469,   -113,
-        22,     53,    525,    427,    469,   1016,    420,    493,
-     -1229,   -238,  -2671,    361,  -2745,    193,   -253,    -59,
-        15,     53,    -57,     36,   -144,    127,     25,     11,
-       -34,   6560,    -12,    -80,    -72,     70,    654,  -1135,
-       158,    279,    298,    746,   -190,  -1382,    138,    527,
-     -1504,  -2753,   -106,    -55,    225,     54,    136,     53,
-       506,    174,    268,   -533,    -43,   -416,   -196,   6266,
-       -81,     22,   -158,    350,   1177,   -728,    594,     34,
-      -368,   -226,   -584,    247,    804,  -1141,     78,   3923,
-       -53,    309,     58,    -45,  -7634,    -73,     39,   -152,
-        55,    -77,    -45,    -62,    -25,   -247,   -161,     28,
-     -2629,   -401,   -295,   -687,    298,  -3240,      0,   -251,
-         7,    -49,    494,   -198,    202,   2201,   -301,     83,
-        45,   -964,    256,  -1499,  -2394,     24,   -267,   -599,
-        46,    161,   -370,     81,    636,   3146,  -2077,   -964,
-       322,    400,   -635,   -688,   -630,    -92,   -235,    104,
-       -77,   -541,    511,   2722,    441,   2757,    952,    739,
-      -257,   -254,   -438,   -122,   -151,     12,    578,    -92,
-      -440,    -63,     93,   4971,   -499,    419,   1374,   -165,
-      -417,     64,    -13,   -235,   1080,    -77,    536,     68,
-      -842,   -772,   1627,   -471,  -1350,   -144,   2849,    219,
-       114,     68,    -55,    350,    -11,  -1334,  -3042,   1166,
-      -147,   -891,   -483,   1461,    339,    808,    362,   -101,
-     -2807,    -24,   -377,    518,   -438,    194,   -110,    194,
-      -826,   3380,    -81,    -30,    -43,    103,    -99,   1539,
-      -614,    -13,  -1154,    196,  -3122,   -521,   1454,   -319,
-       159,   -428,    722,   -208,    162,   1871,   2534,   2287,
-       946,    261,   -483,   -645,     26,   -170,    -31,     17,
-       164,    104,    -44,  -8192,    -20,     94,   -235,     56,
-        68,    -58,    380,    -25,   -170,     17,     16,   -154,
-        63,    477,   1280,    614,   -529,  -2347,   -360,    159,
-      1967,  -2085,    485,    335,    378,    178,   1633,   -437,
-       -46,     23,    640,   1465,    -91,   1279,  -1025,  -1007,
-      -236,   2632,   -257,    262,    177,   3029,  -3149,  -1001,
-       231,   -262,     87,   -243,    -68,   -597,    109,     62,
-      -264,     37,   -463,  -3105,   -633,    881,   1026,    -86,
-       417,    705,  -1144,    -68,  -2084,     46,    124,    -36,
-     -2461,    -73,   -126,   -303,   1079,   -358,  -2764,   -761,
-     -1454,   -245,    203,      0,   -179,   -117,   2571,  -4751,
-       -20,    194,    298,    258,    390,    270,    -36,    182,
-       152,    -56,    -97,    -47,    138,   -233,   -111,  -1490,
-      -490,   -329,    662,   -320,  -4697,    443,     66,    352,
-       203,   -114,   -119,    186,    649,   -106,     -5,   2280,
-      1132,   -376,   1168,    919,   1858,    271,  -1741,   -130,
-     -3388,    264,    618,  -2375,    260,   1279,    110,    732,
-       128,   -373,     54,   -182,     99,   -131,      9,     30,
-       -83,     27,    204,    109,   -306,   6903,    130,     -7,
-      -115,     92,   -241,    119,   -640,   -871,    -40,    372,
-       -68,   -147,  -1503,    -58,    920,   -466,    311,    144,
-     -3648,   -121,   -357,      5,   1968,   -737,  -1491,    596,
-       818,    122,    688,   -137,  -2415,   -368,    236,     71,
-      -597,   -193,   -395,    795,    855,    657,    -49,    844,
-     -3320,  -1921,    846,     17,   -293,    -17,  -1676,  -1826,
-      -138,    897,   -207,     -3,   1838,   -901,     86,    275,
-       964,    230,    510,    -10,   2879,   3949,    332,    289,
-       109,   -229,     18,    238,    244,    287,     44,    103,
-       367,     21,  -1134,   -378,   1338,   -828,   3500,      5,
-      1027,    475,    208,    654,    589,    -92,    236,    -85,
-      -115,   1095,  -2504,    827,   -885,   -806,   -155,   2112,
-      -346,   1120,   -350,   -911,   -234,    231,     55,     87,
-      1957,    601,    755,  -1248,    753,  -2726,   -481,   2038,
-        96,   -363,    309,    150,    299,   -561,   -698,  -1030,
-       118,   1224,   3240,  -1523,   1476,    342,   -688,    -76,
-       192,     -8,   -319,    350,    149,   -331,    155,   -436,
-       286,   -994,    160,  -2696,   -423,  -2798,   -135,   -108,
-     -2846,   -254,   3590,    350,    130,   -810,    463,   -123,
-        59,   -256,    251,   -750,    -76,     -8,  -1633,    150,
-      -931,   1958,   1523,  -2527,    239,   -287,    172,    332,
-       -13,    486,    247,    -26,    149,     59,    130,    265,
-        19,    209,   7220,    -23,    -99,    -69,    -66,    -70,
-       -54,    -75,     60,   -264,   -102,   1079,   -535,   1587,
-      -557,  -1499,    241,  -2596,   1157,   -140,    270,     33,
-};
-
-static const int16_t cb4448sm1[] = {
-      7894,   -331,    383,   -556,     63,   -371,    -23,     73,
-        46,   -145,    105,     43,   -199,    -52,    -85,    -85,
-        13,    -21,   -230,   7379,    268,   -243,   -460,    251,
-        73,     12,    115,    -18,   -247,    433,    -90,   -518,
-       962,      0,   -960,    184,   -305,  -2003,    276,   1696,
-      2418,    270,  -2140,   -215,   -534,   -389,   -403,  -3500,
-       416,    567,   -393,   -183,    253,   -100,   -285,   -107,
-       100,    281,   -527,  -2944,    -86,   2652,    311,   -785,
-      -811,   -283,    425,    -77,    393,    136,    170,   1290,
-      -765,    108,    676,   -213,  -1226,   -470,    427,   3499,
-       616,  -1211,   -226,    -37,     88,  -2792,    351,     78,
-     -2975,     99,    192,   1390,   -338,     47,     -8,     58,
-      -255,     50,    221,    -49,   -788,   -207,  -2122,   -167,
-      -692,    379,  -3239,   -965,   -698,   -463,    -45,     34,
-      1785,   1026,  -1107,    113,    124,   -258,   -277,   -714,
-      2764,   -178,   -200,    907,    -45,   -213,  -2575,   -530,
-      -112,   3616,   -128,     76,   -366,   -135,    -22,    -51,
-       125,   -100,    -79,    142,     54,    107,     87,    493,
-       -34,   -221,   -448,   -243,    994,    845,  -4656,   -105,
-      -487,     41,   -112,    349,  -4328,    -72,    513,   -112,
-      -685,   -470,   -138,   -541,    340,  -1505,    -24,     37,
-       169,   -405,   -434,  -2994,    -42,   -416,  -1927,   1551,
-     -1488,    420,    179,    -66,     14,     92,    147,    141,
-       497,    404,   -412,   2301,    336,  -2877,  -1845,   -948,
-      -784,    262,   -211,      6,  -1678,   -434,  -1433,   -727,
-      1254,    542,  -1430,   -302,   1558,    107,    617,   -833,
-      -369,   -178,   1682,  -2569,  -1232,  -1556,    -87,   -178,
-       400,   -178,   -427,   -124,    -63,    142,   -221,     33,
-      2880,   -227,   -356,   -466,  -3362,   -398,   -167,    164,
-       126,     59,     -1,      5,    212,     25,   2062,   -462,
-       -33,    -46,     45,   -201,    823,   -268,   -302,   3623,
-       389,    382,    136,    -30,    -64,      2,   -600,   3114,
-      2720,    273,   -588,   -235,   -313,   -141,     37,    -28,
-       355,    184,   -433,   -110,   -576,    -56,    134,   -623,
-      -271,  -2529,  -2753,    947,   1319,     -2,    620,     36,
-      -412,  -1986,    221,   -404,    514,   3223,   -106,   1497,
-      -368,   -167,   -142,   -366,   -125,     16,    142,   -435,
-      -160,   2845,   -153,    470,    387,   3117,    -75,   -375,
-       658,    259,    755,     -3,   3744,   -517,  -1446,   -667,
-      1372,  -1692,    117,    -96,    195,   -201,   -134,    -76,
-       179,     97,     71,   1887,    161,    365,    228,   1177,
-       235,   -834,    -48,   1667,  -1123,   2217,   -209,    100,
-      -219,  -2778,     81,   -579,   3421,   -326,   -492,   -233,
-        78,     32,    117,    -74,    -80,     85,   -282,    453,
-       500,    721,    800,     83,   -624,   1000,    165,    -20,
-      -516,  -4193,   -334,    107,   1221,  -1507,    -10,    523,
-        85,    -44,     21,     34,    199,   -106,  -2233,    525,
-      2138,     40,    -55,    -63,  -8179,    326,    333,   -152,
-       -27,    137,    212,    130,    -10,     76,    -61,   -113,
-      -544,   -179,   -187,      0,  -5308,    322,   -326,    513,
-       415,    375,    -92,   -354,     69,     77,     65,     93,
-      -352,   -165,  -1837,   1790,    914,   -276,   2215,  -1418,
-       343,    281,      4,    283,   4398,   1695,   -248,    153,
-      -166,    751,    822,   -406,   -456,   -251,    185,   -251,
-      -222,   -169,   -266,  -6323,    249,    -40,    -45,   -203,
-        47,    -83,   -621,   -174,    327,     30,    114,    -29,
-      -505,   -224,   1804,   1582,  -2292,   2102,   -746,   -421,
-       170,    438,   -171,    153,     84,   -157,  -2937,   -123,
-       -81,   -227,    -98,    263,   3531,     36,    105,   -479,
-       -94,   -357,    -22,   -124,    279,   -116,    543,    201,
-      -393,   -226,  -2255,   -133,   1613,   -123,   2687,     70,
-       191,    240,   -996,   -676,    606,  -1245,   -306,    413,
-      -272,   -539,    485,   3583,   -224,    432,    389,     31,
-      -888,    318,   -149,   -228,    764,   -426,   1608,  -2656,
-       254,  -2193,    252,    484,    -90,   -117,   -257,  -2210,
-      -156,    553,    559,    680,    298,    -16,   -519,   1172,
-      2172,   1288,   -113,    186,   -199,  -1415,    -83,  -1984,
-       667,  -1013,    344,   -399,   2889,  -1175,   -908,    186,
-       185,    -22,   -328,   3132,  -1166,    209,   -213,    386,
-      2140,    552,   1023,    719,    529,   -169,    421,    196,
-        76,   1995,    532,    -75,   2060,   -526,    396,   2974,
-      -264,   -348,    149,    586,     22,     97,   -337,   -252,
-       357,    103,  -2308,  -2578,  -1836,   -277,    346,   -314,
-      -989,    185,   -314,    102,     56,   3779,   -265,  -1029,
-       -12,   -126,   -431,    356,  -2493,    -86,    172,    116,
-        61,   -146,  -2220,    211,   -165,    233,   -327,     73,
-        -7,   -104,   -546,    253,  -2406,    361,   2252,    486,
-       675,   -177,   2643,    603,    300,   1123,   -642,    361,
-       684,  -2151,    569,  -1014,    120,    -50,    321,   3174,
-      3080,   -733,   -427,    299,    169,   -123,   -140,    -13,
-      -315,     21,   -120,    -24,    174,   -191,   -350,  -7842,
-      -145,   -169,   -419,    -15,    150,   -130,    -73,    162,
-        -9,     38,   -287,    109,    390,    147,    151,   1907,
-     -4243,      7,   -207,   -147,   -230,   -343,   -117,   -111,
-       107,    132,   1457,    -88,     -8,   -445,   -176,   -172,
-     -1799,   -813,    486,   1150,  -3026,   -168,  -2620,   -584,
-       178,   -543,  -1868,   -359,   -113,  -1783,    214,   -663,
-       473,    866,   -136,    169,  -3324,   -129,  -3404,   -249,
-       234,    422,    251,    340,   -343,    231,    134,    -42,
-        32,     64,   -209,     12,    236,   -267,   -419,      1,
-       260,   -109,   6508,    105,      7,   -273,   -123,   -107,
-      -152,   -274,   -157,     75,     74,   -201,     46,     37,
-       338,    -21,   -180,    208,  -6417,    794,    250,    -81,
-      -585,      4,   -119,   -314,    529,    219,    159,   -132,
-      -277,     76,   -613,   4933,     15,    213,   2461,    286,
-       542,    177,   2767,    389,    136,    750,    559,   -994,
-       684,    -12,  -2081,   -546,    -89,  -3733,    548,   -620,
-       675,    118,   -121,    190,    -52,     19,    -19,     25,
-     -1224,    344,   3094,  -2067,      7,    273,  -1268,   -375,
-      -297,   -201,    271,   -191,    123,      6,   -260,   2284,
-      -308,  -3062,    242,    668,   -221,   1146,   1218,    473,
-      -133,     82,     57,    112,  -1677,     78,   -229,    354,
-      -463,    763,   1628,   2243,   1386,   1630,   -145,    255,
-       -60,    228,    195,   -864,   2539,   -466,    985,  -3075,
-         2,    118,    221,   -395,   -450,   -256,   -158,    -32,
-     -3829,   2012,    -50,   -465,    146,  -1091,   -318,    271,
-       -12,    596,    160,    120,     92,   -209,   -335,    104,
-       -28,    689,    305,   -548,   -849,   1617,    605,    185,
-      -414,   3899,   -273,     51,    182,   -192,    121,    616,
-      1219,    414,   -959,  -4219,   1319,     60,    246,   -468,
-       -32,    225,    338,    -39,   1235,  -2079,   2250,    626,
-       121,    296,   -137,   -339,  -1870,    -47,   -397,    124,
-};
-
-static const int16_t fcb8l[] = {
-     -1239,  -1310,  -1240,  -1146,  -1337,   1303,   -482,   2215,
-      2026,   2222,  -1144,  -1188,  -1209,   2535,  -1111,   -844,
-      1485,    625,   1254,   1204,   5932,  -1116,  -1235,  -1208,
-      -801,  -1020,   -558,   1387,   1513,  -1079,   3220,   -896,
-     -1083,  -1166,   2246,  -1210,   -838,   -950,   -960,    764,
-     13941,  -1307,   -817,  -1253,   1850,  -1320,  -1361,  -1218,
-      -671,    780,   -839,  -1068,   -776,   2977,   -714,   -944,
-      -823,   -580,    357,    591,    302,  -1078,   -895,  -1020,
-      3116,  -1144,   1438,   -891,    -71,   1528,   -238,  -1297,
-     -1020,   4616,  -1185,   -514,  -1154,  -1157,   1901,   2372,
-     -1131,  -1289,  -1273,  -1289,  -1311,  -1331,  -1340,    439,
-       455,   2395,   -537,  -1180,   2409,  -1084,   -580,   1937,
-       846,    -51,    615,   1099,   3854,  -1177,   -912,  -1095,
-       656,   -995,   -647,   3298,   -976,   -436,  12323,  -1291,
-     -1187,  -1341,   4779,  -1368,  -1357,  -1317,   -985,   1407,
-      -513,  -1387,  -1224,  -1069,  -1218,  -1117,   -181,  -1209,
-      5376,   4256,    -22,  -1232,  -1173,   -834,  -1054,   -947,
-      -611,   -822,   -206,   5572,   -988,   1067,   -837,    738,
-      -332,    -38,    -59,    143,    248,    386,   -447,  -1233,
-     -1258,  -1169,   3653,  -1045,   -657,   -926,   2004,   2201,
-     -1164,   7042,  -1302,  -1313,   -812,    150,   -129,    305,
-       442,    742,  -1185,  -1293,  -1220,   -872,  -1304,  -1260,
-      -853,  -1293,   2962,   3011,   -178,  -1187,  -1087,   -896,
-      -895,  -1053,   3788,     59,   -169,   1632,  -1201,  -1289,
-      5263,   -896,    331,   -852,    218,    825,   1129,   1024,
-       -39,  -1186,  -1054,   1862,  -1198,   2010,  -1075,  -1005,
-       702,   1550,   4491,  -1055,   -890,   -645,   -987,   2465,
-       529,    194,    -72,    370,   1547,   -968,   -849,  -1153,
-      6459,  -1164,  -1061,  -1020,   -838,    125,   3698,  -1168,
-     -1066,   1882,  -1159,   -439,  -1017,   -759,    744,   1302,
-      -812,   -985,  -1002,  -1029,   -871,   3690,   -170,    604,
-       623,   1272,   6135,  -1012,  -1231,  -1066,   -927,  -1082,
-      2393,   -843,   1537,   1240,   -866,  -1161,   -866,   6639,
-      -994,   -860,   -264,   -298,    469,   1184,   -868,  -1262,
-      2167,  -1177,   2132,   -987,   -563,    969,   1145,   1508,
-      -735,  -1232,  -1090,  -1204,   1507,  -1101,   -393,    755,
-       975,   1246,   1944,  -1068,  -1169,  -1040,   -987,  -1301,
-      5488,  -1057,   3150,   1890,  -1133,   2725,  -1123,   -963,
-      1901,    260,   -484,    449,    564,   1144,    679,  -1118,
-      -989,   -702,   -556,    162,    689,    712,    673,    443,
-      -695,  -1247,  -1019,  -1065,   -406,  -1143,   1750,   -743,
-      2644,   2402,  -1171,  -1157,  -1059,   -823,   -688,   1314,
-      1458,    629,    857,    856,   -875,  -1316,   3470,  -1061,
-      -846,   -761,   -712,   -955,    978,   1967,   -980,   3517,
-      -994,   -953,   -903,     56,    228,    -30,    359,    560,
-      9926,  -1178,  -1056,   -627,   -952,   -481,  -1168,   -268,
-      -701,   -555,   -887,  -1212,   1768,  -1156,   -396,   -755,
-      -119,   1594,    949,   1201,   -844,   1734,   1312,   -331,
-      -500,   -280,   -125,   -219,   -139,    496,  -1121,  -1227,
-     -1145,   -215,  -1123,   -765,   -173,   4055,   1086,   1465,
-      -714,   -904,   -901,   -713,  -1073,   1233,   -797,    645,
-        58,    897,   -518,   -624,   -441,   -554,   1139,    549,
-       147,     72,    127,    428,  -1104,   -979,   2433,   1867,
-      -237,   -745,   -280,    110,    794,    631,  -1049,   1141,
-      -974,   -920,   -849,   -392,    634,    414,    614,    797,
-     -1162,  -1344,  -1192,  -1259,  -1079,   -912,   2717,   2548,
-      1847,   1920,  -1004,  -1091,  -1006,   -692,    -85,    -24,
-      1014,   1427,    751,   -584,   6057,  -1206,  -1072,   -795,
-      -921,  -1103,  -1157,   -623,   -818,   2641,   3121,  -1084,
-     -1095,   -939,   -664,   -694,    884,    555,    144,    593,
-      -874,  -1074,    417,  -1027,     -6,   -790,   1687,     80,
-      1018,    738,   -527,   -958,   -701,   -377,     -4,    155,
-       304,   -348,   -947,   -342,   2269,  -1040,   1124,   -494,
-       -76,     76,      2,    114,   -194,    348,    904,    466,
-      -577,   -717,    107,    -39,    -29,    158,    101,    149,
-      -968,   -921,    558,   -264,   -445,    138,   -121,    -33,
-       105,    243,   -478,  -1047,   -937,   -751,   -609,   -822,
-      -709,   -976,  -1006,   2800,  -1108,  -1292,  -1055,  -1272,
-     -1295,  -1152,    305,  -1144,    635,   2067,   -584,  -1135,
-      -663,  -1130,   -754,  -1009,   -937,   -515,   1473,    841,
-     -1235,  -1338,  -1305,  -1141,  -1109,  -1217,   -238,   1915,
-      3550,   2306,   -963,   -985,   -874,    763,   -826,   -694,
-        19,    391,    379,    776,   -582,  -1216,  -1285,  -1164,
-     -1276,  -1305,  -1273,   2631,   -579,   2487,   1058,   -655,
-      -808,   -878,   -910,  -1006,  -1122,   -590,   -663,    428,
-      2185,  -1125,  -1032,  -1076,   -873,  -1139,  -1029,   -477,
-      1720,   1238,  -1111,  -1311,  -1343,   1074,  -1328,  -1181,
-      -970,   -386,   2359,   1777,  -1045,  -1189,  -1117,  -1053,
-      -942,   -329,    501,   1237,    808,   1022,   -866,  -1048,
-      -678,   1597,   1528,   -262,   -256,    231,    418,    728,
-};
-
-static const int16_t fcb8s[] = {
-     -1022,   -858,   -773,    304,   -881,   -771,   -341,    937,
-       270,    420,   -684,  -1000,   -795,   -903,   -671,   -575,
-        14,   3327,    528,    893,    965,   -541,   -947,  -1027,
-      4008,  -1081,   -743,   -991,   -808,    933,  -1406,  -1173,
-      7513,   -824,   -213,   -797,   -648,    -40,    176,    217,
-     -1298,   6743,   -755,   -232,   -440,   -680,   -269,    -60,
-       -80,    -85,   -893,  -1044,   -726,   -733,   -834,   -641,
-       231,   -779,   -501,   1832,  -1296,   2548,   2754,     19,
-      -210,   -708,   -205,    -74,     18,     55,  -1225,  -1123,
-     -1239,   6991,   -689,    272,   -290,     56,    356,    675,
-      1623,  -1134,   -607,   1426,   -872,    511,  -1060,    408,
-       253,    423,   1960,  -1337,  -1152,   -985,   -924,   2020,
-      -398,    348,   4188,   1044,   -650,   -831,   2909,   2083,
-      -457,     -5,  -1037,   -964,   -128,    -40,   6019,   -858,
-      -937,   -559,   -624,   -601,   -411,    120,   -289,    412,
-     -1271,  -1351,   3858,  -1214,   2224,   -325,   -165,    535,
-       559,    386,   1868,    649,    269,    245,   -708,   -778,
-      -179,    -12,    101,    -12,  -1235,   -892,   -829,   2570,
-      -574,   -431,    170,    167,    492,    531,   -930,  -1093,
-     -1037,  -1177,  -1151,   -912,   -466,    303,   1601,   4089,
-     -1234,   3160,   -631,  -1090,   -741,   -274,    103,     13,
-       356,    289,   2709,  -1115,  -1011,   -965,   -948,   -563,
-      1939,    870,   1187,    550,  -1028,  -1217,   -726,   -954,
-      -694,   -753,   3729,    141,    518,    854,  -1102,   1138,
-      -947,   -620,   -379,   -436,     72,    449,    432,    428,
-     -1112,   1276,    544,   -334,   -445,    179,    -32,    -37,
-         9,     28,  -1252,   2983,   -963,   1256,    419,    -10,
-        17,    211,    218,    191,    126,   -942,   -691,   -529,
-      -533,   -193,   1216,    150,    389,    152,  -1191,   -987,
-      -942,   -860,   -463,   -705,   -159,    184,   1893,   1080,
-      1753,   -694,   -609,   -699,     61,    269,   -126,     93,
-       236,    380,   -527,   -966,   -334,    163,   -662,   3295,
-      -477,    591,    259,    638,    397,    181,   -598,   -129,
-        35,    -51,   -122,     64,    -32,    -98,  -1351,  -1140,
-      3372,   -753,   -776,    718,    513,    134,    420,    354,
-     -1128,   -546,   -743,    297,   1819,    -77,    179,     17,
-       181,    206,  -1028,  -1027,   -757,   -755,   -389,   1035,
-       227,    249,    315,    395,   -931,   -881,   1207,   -777,
-      -165,   -531,   -375,     73,    346,    332,  -1159,   -788,
-      1196,    959,   -432,   -337,    243,    176,    321,     -7,
-};
-
-static const int16_t fcb8m[] = {
-     -1379,  -1331,  -1277,  -1266,   -927,      0,   2552,   2575,
-       425,     48,   2568,    -26,   -841,   -762,   -679,   -562,
-      -420,    186,     68,     69,   -743,   -193,    266,     92,
-      1714,   -241,   -357,    -93,   -252,   -222,   -884,   -385,
-      2436,   -446,   -150,   -533,   -192,    -33,    226,      8,
-      -756,  -1180,  -1238,  -1258,  -1250,  -1147,   -764,    141,
-      3075,   4136,  -1255,  -1288,  -1202,  -1188,  -1222,  -1257,
-      -500,   1989,   4062,   1328,   -300,   -186,   -399,   -329,
-      -330,   -533,   -313,   2030,    193,   -128,   -933,  -1016,
-        66,   1648,   -228,   -321,    236,    114,    356,    212,
-      -677,   -826,   -784,   -670,   -484,   -423,   -188,    215,
-      2476,    652,   3424,   1991,    940,   -576,   -942,  -1038,
-     -1097,  -1161,  -1120,   -956,   -763,   -416,   2824,   1429,
-      -693,   -755,   -455,   -670,   -535,   -225,   4814,    116,
-      -940,   -953,  -1008,   -856,   -797,   -582,   -531,   -213,
-      -412,   2479,   -156,   -218,   -319,   -168,   -236,   -248,
-      -305,   -515,   -224,   -382,   -501,   -759,    139,   1789,
-      -258,   -343,   -167,    721,  -1014,  -1092,   -975,  -1070,
-     -1126,   -778,   -178,     36,    522,   5371,   -402,  -1351,
-     -1577,  -1662,  -1642,  -1560,  -1249,   -870,    602,   8968,
-     -1126,  -1102,  -1118,  -1072,   -946,   -511,    482,   1635,
-      1108,   2471,   -935,   -748,   -302,   -445,   -810,   -359,
-      1433,    -83,    336,   1834,   -712,   -773,   -752,   -609,
-      -391,    625,   2550,    403,   -447,    -18,   -261,     91,
-      5096,   -199,   -887,  -1018,   -728,   -930,   -921,   -684,
-       -22,   2422,   2118,   -417,   -757,   -789,   -732,   -794,
-      -785,   -664,   -627,    885,    471,    798,   -429,   -684,
-      -454,   -185,    185,    -26,   -990,   -369,   1048,    -25,
-       -98,    720,     41,    -60,     -3,    -92,   -790,   -147,
-       846,   4007,   -346,   -907,   -849,   -730,   -639,   -842,
-      9096,    617,  -1164,  -1275,  -1380,  -1396,  -1391,  -1364,
-     -1342,  -1080,    655,   5687,    505,   -818,  -1134,  -1125,
-     -1136,  -1123,  -1088,   -996,      3,     36,    -48,    -28,
-       121,    -55,    172,    -43,     21,    -74,   1537,    -69,
-       378,    -38,   -113,    159,   -149,   -609,   -693,   -796,
-      -715,    588,    376,   -744,   -659,   -316,    145,    448,
-       659,    320,    787,   -315,   -956,   -682,   -595,   -327,
-       146,    348,    837,    577,  -1011,  -1014,   -647,   -159,
-       679,    158,    294,    670,    507,    540,    418,    558,
-        12,   -674,   -901,   -897,   -827,   -682,    323,   2580,
-};
-
-static const int16_t fcb8sl[] = {
-     -1269,  -1637,  -1349,  -1672,  -1421,   2750,    212,   3563,
-       -74,   1555,  -1495,  -1148,  -1172,   1351,   -484,   -473,
-      1418,    557,    899,    635,   6124,  -1140,  -1154,    783,
-     -1444,  -1509,  -1041,   1793,   4459,   1325,   2055,   -921,
-      -794,   -713,   1625,    -50,     78,   -159,    361,    855,
-     10282,  -1533,  -1105,  -1582,  -1704,  -1697,  -1440,  -1001,
-       864,   2038,  -1347,   -847,  -1419,   1474,  -1369,  -1189,
-     -1125,   -655,   -134,    950,  -1398,   -222,  -1498,  -1262,
-      2597,    729,   2521,   -544,    457,   2058,   3821,  -1568,
-     -1577,   2013,  -1717,  -1620,  -1292,   2771,   2559,   4942,
-     -1497,  -1576,  -1724,  -1550,  -1775,  -1734,  -1097,   -635,
-      1934,   2706,  -1399,   -994,   1685,  -1142,   -511,   1595,
-      -275,    861,    484,    958,  -1374,   -764,  -1105,  -1493,
-     -1678,  -1630,   -521,   5138,     53,   1331,   4909,  -1376,
-      2134,  -1638,   1562,  -1565,  -1487,  -1625,   3232,   4742,
-     -1017,  -1353,  -1212,  -1585,  -1309,  -1139,    -71,   -820,
-      5928,   2987,   -641,  -1314,  -1198,  -1182,  -1005,   -542,
-     -1287,  -1210,  -1103,   6865,  -1130,   1375,   -884,   1241,
-      -532,   -173,    -68,     15,    309,    192,  -1128,  -1107,
-      -849,  -1343,   2233,  -1281,   -535,   -679,   3878,   1865,
-     -1427,   4508,  -1022,   -747,  -1117,  -1104,    -33,    669,
-      1216,   1482,  -1360,  -1075,  -1483,  -1390,  -1366,   -754,
-     -1042,   -766,   3467,   -624,   -968,  -1101,   -393,   -890,
-      -447,   -995,   2346,   -909,   -784,    977,  -1141,  -1201,
-      5256,  -1552,   -536,  -1419,      0,    596,    556,   1654,
-     -1124,  -1225,   -830,   1267,   -719,   1791,   -546,   -297,
-       978,    378,   2674,  -1261,  -1159,   -951,  -1027,   2537,
-      -470,   -360,   -268,   1098,  -1154,  -1513,   -729,  -1455,
-      5671,  -1236,   -800,   -874,   1630,   1273,   1909,   -623,
-      -724,   1417,   -559,   -326,   -257,   -189,    265,    220,
-      -284,  -1302,  -1272,  -1223,   -842,   4338,   -934,  -1001,
-      -495,   2944,   4295,   -924,  -1004,  -1097,  -1024,   -328,
-      1736,    106,    452,    158,  -1024,   -541,  -1296,   4376,
-     -1117,  -1224,   -843,   1097,   1121,   1251,   -829,  -1374,
-      2292,  -1505,   1850,  -1153,   -943,   -979,   -534,   1444,
-     -1510,  -1494,  -1147,  -1397,   1535,   -794,    -21,   1313,
-       638,   1015,  -1072,  -1275,  -1166,  -1602,  -1618,  -1379,
-      4541,   -226,   2169,    888,  -1369,   2392,  -1087,   -948,
-      1074,    674,    384,    124,    500,    749,    398,  -1091,
-      -721,   -114,    -15,    413,    200,    135,    290,    189,
-     -1185,  -1188,  -1339,  -1549,   -871,   -574,   2333,   -346,
-       554,   3773,  -1247,  -1531,  -1408,  -1310,  -1007,   2861,
-      2465,    608,   1080,   1224,  -1103,  -1477,   1884,  -1412,
-      -904,  -1473,   -846,   -188,    782,   2049,  -1473,   1531,
-     -1530,  -1459,  -1546,  -1260,   -856,   1191,    652,    933,
-      5072,  -1456,  -1653,   3759,  -1751,   -531,  -1391,   4297,
-      -374,   -751,  -1570,  -1242,   1461,  -1286,   -913,   -621,
-      1768,   1246,   1291,    779,  -1360,   1641,   1122,   -629,
-      -328,   -197,    241,    359,    560,    536,  -1474,   -506,
-     -1523,    298,  -1551,  -1254,   -985,   3603,   4317,    958,
-      -885,   -241,  -1159,   -930,  -1249,   1490,   -825,    274,
-       347,    307,  -1060,  -1027,   -809,  -1063,   1554,   1708,
-      -242,    -23,    424,    804,  -1317,   -853,   1571,   1898,
-       239,   -556,    298,   -161,    777,    765,  -1464,   1053,
-     -1198,  -1156,   -917,      0,   1460,    447,   1178,    629,
-     -1455,  -1591,    296,  -1785,  -1694,  -1631,   3669,   3819,
-      3437,   3274,   -956,   -666,   -874,   -284,   -858,   -202,
-      -687,   1728,   -512,   -951,   4692,  -1360,  -1242,  -1188,
-     -1513,   -449,  -1566,  -1515,  -1226,   3857,   1246,  -1225,
-      -860,  -1068,   -748,    -27,    380,   1190,    591,    552,
-     -1391,    194,   -763,   -463,    331,   -265,    702,    181,
-       290,   -145,   -838,  -1359,  -1381,  -1569,  -1399,  -1088,
-     -1357,  -1295,   -486,   -612,   1638,   -586,   1458,   -774,
-      -223,   -620,   -104,    189,    344,    269,   1555,   1428,
-      -867,   -621,   -294,   -206,     32,    235,    261,    161,
-     -1021,   -105,    654,   -235,   -282,     -7,    189,   -159,
-      -218,    113,  -1096,  -1318,  -1256,  -1335,   -931,   -476,
-     -1041,  -1199,  -1134,   2781,  -1479,  -1222,  -1397,   -867,
-      -815,   -661,    740,   -240,   1158,    735,  -1435,  -1003,
-       351,   -990,   -245,    -72,   -347,    -72,   1408,    634,
-     -1697,  -1727,  -1534,  -1716,  -1436,   -102,    402,   1518,
-      1903,   1311,  -1477,   -930,   -355,    508,   -162,     21,
-       -46,    454,    387,    173,  -1312,  -1284,  -1486,  -1172,
-     -1356,   -965,  -1106,   1760,   -670,   2163,    -70,    417,
-      -559,   -667,   -545,   -945,   -429,   -363,    157,   1280,
-      2059,  -1319,  -1291,   -975,  -1354,  -1249,   -780,   -476,
-      1410,   1252,  -1193,   -927,  -1462,    871,  -1281,  -1327,
-      -900,   1540,   1531,   1227,  -1651,  -1334,  -1073,   -752,
-      -154,    710,    830,    773,    279,    307,  -1294,   -796,
-      -761,   1012,   1583,   -420,   -177,   -323,    154,    582,
-};
-
-static const int16_t fcb8ss[] = {
-     -1481,  -1069,  -1082,   -726,   -818,   -550,   -417,    343,
-       489,    275,   -814,   -510,   -712,   -933,   -558,   -236,
-        32,   3051,    451,    301,   -414,   -237,   -683,   -599,
-      3627,   -445,   -232,     56,     58,    112,  -1226,   -639,
-      4096,   -644,   -226,    -23,     90,    162,    313,    104,
-     -1385,   5607,   -428,   -860,   -447,   -265,   -145,   -132,
-       115,   -200,  -1349,  -1280,  -1216,  -1046,   -657,     43,
-      1333,    831,    675,   1174,  -1394,   2288,   1840,   -682,
-      -497,   -256,     22,     22,    261,     70,  -1369,   -826,
-      -975,   2286,   -329,   -267,    142,     36,    437,    313,
-      1570,     52,   -470,    622,   -244,   -247,   -114,     22,
-      -117,   -541,  -1167,   -596,   -809,   -929,   -669,   -327,
-       102,    516,   2790,    597,  -1317,   -870,   1327,    987,
-       -25,    391,    -48,    -82,    209,   -242,   4424,   -311,
-      -396,   -765,   -382,   -336,   -365,   -414,    -74,    -13,
-      1127,   -588,   1363,   -714,    368,   -450,   -390,   -364,
-        84,    139,   1864,   1881,    -15,   -790,   -281,   -286,
-        38,   -186,    -31,   -238,  -1249,    262,   -841,    731,
-      -414,    -61,   -274,    280,    100,    557,   -841,   -775,
-     -1007,  -1063,   -687,   -374,   -360,     31,   1048,   3471,
-     -1385,   2464,   -840,  -1105,   -714,   -400,     56,    445,
-       588,    427,   1785,  -1093,   -783,   -847,     41,    -23,
-       465,    392,    382,    428,   -518,   -249,    -58,   -791,
-      -689,   -581,   3146,   -183,    296,     66,  -1243,   1059,
-     -1076,   -874,    416,    544,    253,     66,    168,    211,
-     -1388,   1253,    138,   -727,   -509,    905,    319,   -297,
-        67,   -525,  -1470,   2237,    -87,    547,    556,   -239,
-        90,   -147,   -114,   -302,  -1017,   -824,   -585,     25,
-         0,     62,   1422,   -155,    -41,   -320,  -1125,  -1069,
-     -1134,   -783,   1129,     45,    183,     47,    716,    672,
-       409,  -1169,   -910,   -447,    -34,     79,     95,    455,
-       504,    381,    342,   -877,   -506,   -812,   -805,   3031,
-      -249,   -518,    -69,    564,    243,    261,   -332,   -434,
-      -173,    -37,     61,     45,     -5,      6,  -1433,  -1009,
-      1428,   -951,   -582,    154,    143,    625,    383,    387,
-     -1392,  -1222,   -578,    229,   1294,    218,   -142,    355,
-      -149,    201,  -1341,  -1135,   -857,   -767,   -273,   2059,
-       255,    578,    350,    315,  -1041,   -617,    254,   -504,
-      -255,    -96,   -537,   -396,    363,   1074,  -1361,    484,
-       538,   -789,   -704,   -447,    200,    521,    213,     90,
-};
-
-static const int16_t fcb8sm[] = {
-     -1183,  -1170,   -867,   -948,   -746,    492,   1531,   1412,
-       524,     82,    590,   -994,   -916,   -859,   -680,     12,
-       742,    961,    230,    255,     34,     38,   -176,     -1,
-      1880,   -240,   -769,   -531,    269,    -32,   -772,   -494,
-       757,   -583,   -677,   -281,    717,    440,    561,     91,
-     -1121,  -1054,  -1189,  -1100,   -745,   -417,    -61,    302,
-      3079,   1817,  -1384,  -1479,  -1477,  -1509,  -1077,   -323,
-       902,   2348,   1464,   1038,   -487,   -179,   -447,   -311,
-      -296,   -439,   -172,   2166,    245,    -28,  -1050,   -390,
-      -238,    633,    302,   -335,    843,    -52,    185,    230,
-      -110,   -433,   -690,    148,     63,   -289,   -404,   -469,
-      1948,    245,   2016,   1337,   -341,   -554,   -617,   -457,
-      -436,   -459,   -400,   -520,   -661,     -7,   1078,    971,
-      -326,   -332,    -23,   -749,     83,   -104,   2106,   -947,
-      -867,   -883,   -705,   -433,    -35,    164,    427,    646,
-      -924,   2196,   -656,   -798,   -282,    217,   -227,    134,
-       446,    -15,   -584,     33,    185,   -571,   -159,   1852,
-      -405,    -94,    -61,    -83,   -329,   -516,   -394,   -450,
-      -173,   -140,    -54,   -156,    226,   1850,   -752,  -1304,
-     -1378,  -1275,  -1017,   -680,   -337,    356,   1131,   4143,
-     -1120,  -1253,  -1269,   -860,     90,    973,    152,    886,
-       609,   1454,    -29,     36,   -117,   -815,   -651,   -346,
-      2085,   -414,     24,    -93,   -235,  -1103,  -1132,   -758,
-       -98,   1497,   1285,   -289,    -34,    402,   -646,    637,
-      2147,   -677,   -350,   -266,   -232,    -61,   -199,   -359,
-       167,   1546,    816,   -453,    -35,   -251,   -468,   -491,
-      -371,   -593,   -878,   1445,   -795,    651,    108,   -155,
-      -201,    -14,    250,   -271,   -732,    793,    154,   -288,
-       -86,     16,    557,    642,   -592,   -587,    -87,   -365,
-      -309,   1753,    -40,     95,   -529,    -87,   -214,   -234,
-      4999,   -466,   -755,   -800,   -785,   -722,   -532,   -703,
-      -526,   -465,    591,   3937,   -229,   -804,   -808,   -698,
-      -576,   -613,   -506,   -725,     10,     13,   -117,    -55,
-       101,     52,    125,    -76,    -25,    -28,   1469,   -245,
-         8,    -25,     65,    -53,   -262,   -282,   -411,   -588,
-      -667,   1374,    304,   -787,   -661,   -675,     55,    320,
-       720,     -4,    366,   -103,   -136,   -332,   -314,   -293,
-       -38,    127,    151,    380,  -1330,  -1338,   -618,    -40,
-      1284,   1500,    466,   -515,    105,   -161,     19,    697,
-      -417,   -559,   -317,   -712,   -756,   -567,    754,   1481,
-};
-
-static const int16_t fcb11l[] = {
-     -1291,  -1237,  -1175,  -1186,  -1139,    524,   1225,   1464,
-     -1042,   -721,   -901,     41,   -728,    822,   -657,   1078,
-      -483,   1530,   -489,   1253,    926,   -326,    404,     89,
-     -1191,  -1170,  -1237,   1633,   1493,   -465,    986,   1184,
-      -857,   -832,   -300,   -811,   -936,   -667,   -254,    492,
-      4044,  -1136,   -983,   -855,   -592,   -199,    383,    876,
-      2076,  -1042,  -1019,   -729,   1435,    -25,     64,    845,
-      -991,   -921,   -861,    916,   -402,   -551,    236,    429,
-      5253,  -1233,  -1268,   -414,   1793,   -463,   -569,   1693,
-     -1197,   6322,   -887,   -211,   -945,   -540,    626,    903,
-      -993,   1500,   -490,   1445,   -764,   -136,    321,    548,
-       462,   -228,    127,   -322,    481,   -183,     88,    155,
-      -809,   -844,   -959,   4011,   -581,   -232,    330,    986,
-      -900,   -916,  -1069,   -866,   -979,   -439,   4016,   1558,
-     -1023,   2121,   1717,   -612,   -588,   -446,    223,    430,
-      2567,   -972,   2118,  -1030,   -900,   -664,    180,    858,
-      3232,   -991,  -1132,   2119,   -446,   -548,   -258,    895,
-      -962,   -184,   2639,   1081,   -661,   -222,    292,    530,
-      -952,   1767,   -213,   -701,   1079,     37,    131,    489,
-      -875,   -749,   3167,   -776,   1247,   -109,    -83,    636,
-     -1146,  -1070,  -1001,  -1064,   -942,   2891,   1137,   1585,
-     -1314,   -632,  -1179,  -1105,   1101,     51,   2038,   2036,
-      -926,   -727,    180,   1515,   -566,   1191,    101,    595,
-      2247,   -364,   -315,   -105,   -130,    -79,    121,    210,
-      7994,  -1302,   -898,   -785,   -758,   -777,     31,    415,
-       744,   -652,    688,   1226,   -649,   -605,   -268,    314,
-       611,    662,   -240,   -411,   -698,   -434,    377,    339,
-       953,   -810,   -931,   1054,   -484,   -298,    721,    522,
-       922,  -1046,   -952,   -871,   -618,   -270,    419,    635,
-      1006,    129,   -838,   -724,    220,    481,    253,    329,
-       205,   -456,   -724,    675,    598,    332,    -14,    291,
-     -1016,   -695,    542,   1270,    498,   -456,   -113,    362,
-      -547,  -1068,  -1178,  -1261,  -1161,   -905,    390,   2204,
-     -1056,  -1102,   5611,  -1100,  -1076,   -902,    360,    978,
-      -538,   -286,   1253,   -430,   -457,   -148,     -1,    -60,
-     -1116,   -955,   2869,   -926,   -680,   1111,    706,    842,
-     -1311,  -1275,  -1150,   -236,    675,    897,    758,    912,
-      1886,  -1115,   -999,    -84,   -588,   2190,   -171,    739,
-      -737,    150,   -902,   -854,   -917,    334,    557,    534,
-      -851,    -39,    -25,    214,   -136,    -73,    263,    234,
-     -1021,   1332,   -543,   -655,   -712,   -651,     80,    479,
-      1555,   1933,   -707,   -485,   -206,    139,    312,    405,
-      2472,  -1172,   -945,   -939,   -713,    568,   1421,    684,
-        70,  -1263,  -1235,    586,   -195,  -1065,   -449,   3182,
-     -1143,    529,   -926,   -558,    419,    390,    375,    563,
-     -1090,   3370,   -688,   -528,   -346,    136,    317,    615,
-      -803,   -977,  -1082,   -806,   3607,   -443,   -156,   1130,
-     -1288,   1585,  -1218,  -1226,   -979,    359,   1555,   1402,
-      -341,   -416,   -480,   -360,   -415,    542,   -148,   -322,
-     -1095,  -1074,    762,   -864,   -634,   1770,    340,    466,
-     -1040,   -834,   1508,   -707,    143,     74,   1418,    905,
-     -1094,   -710,   -549,   -860,    373,   1492,   2024,    741,
-      -938,   -910,   2661,  -1087,  -1105,   -901,    383,    906,
-       755,   -819,    581,   -612,   -420,    305,    344,    363,
-      -356,   -991,   -845,  -1051,   2112,   1738,    554,    954,
-     -1028,   -943,   -892,   -896,   -236,   -674,   1076,    679,
-      -611,  -1099,   -859,   -914,   -444,    910,    491,    709,
-     -1063,    775,    496,   -669,   -304,    672,    261,    496,
-     -1086,   -963,   1037,   -639,   -134,   -577,     33,    607,
-     -1070,   -649,    730,   -748,   1884,    -18,    346,    627,
-     -1089,  -1118,   -955,    751,   -690,    606,   1204,   1037,
-     -1016,  -1095,    473,   -919,  -1036,   -685,   1744,   1216,
-      -834,   -916,   -920,   -634,   1086,   -474,    161,    620,
-      -997,   -899,    -25,   -499,    399,    405,    163,    401,
-};
-
-static const int16_t fcb11s[] = {
-     -1148,  -1134,  -1000,   -585,    715,    774,    626,    650,
-      2109,   -898,   -729,   -239,   -213,    847,     77,    371,
-      -902,   -790,   1853,   -871,   -816,    163,    295,    377,
-      1718,  -1070,   -840,   -791,   1612,   -129,    144,    450,
-      -830,   1909,   -539,    803,   -411,   -188,    122,    148,
-      1202,    705,   -696,   -578,   -213,    -25,    126,    142,
-      3309,  -1083,   -865,   -771,   -470,   -237,    980,    521,
-       428,   -995,  -1003,   3088,  -1000,   -455,    320,    503,
-      -615,   1746,   -751,   -734,   1092,     31,     97,    225,
-     -1175,   2287,   1278,   -421,   -315,     91,    130,    120,
-     -1203,   4211,   -970,   -878,   -228,     71,    327,    288,
-     -1012,   -850,   1471,   -732,   1228,    201,    146,    271,
-      -868,   -528,   1196,    744,   -186,     85,     38,    153,
-     -1081,   -895,   -742,   1014,   1110,     66,    237,    335,
-     -1012,  -1137,   4357,  -1062,   -569,    377,    268,    445,
-      1203,   -717,   1070,   -541,    -72,    -29,     91,    104,
-      6448,  -1148,  -1069,   -810,   -659,    118,   -284,    300,
-     -1085,   -940,   -214,   -621,   -781,   -622,   1789,    711,
-     -1165,   1643,   -890,   -809,   -533,    148,    384,    373,
-      -910,   -986,   -855,  -1032,   3647,   -478,   -132,    713,
-        -3,   -674,  -1036,   -956,   -899,   2698,    629,    665,
-      -764,  -1066,  -1173,  -1058,   -692,   -144,   1114,   3195,
-     -1012,   -643,   -670,   1547,   -576,    351,    251,    273,
-      -950,    563,   -742,    248,   -149,    514,    100,    185,
-      -193,   -616,   -655,    255,   -364,   -323,    172,    256,
-       308,    228,     16,   -187,   -243,    219,     88,     53,
-     -1024,    664,    450,   -416,   -189,   -239,     43,    102,
-       -64,   -499,   -159,   -400,    905,    -64,    -68,     46,
-     -1055,    -77,   -813,   -661,     59,    -77,    226,    321,
-      1224,   -553,   -436,    793,   -155,    -83,     -5,     72,
-      -652,   -897,   -157,   -579,   -539,    846,    181,    318,
-       782,   -967,   -802,   -569,     -6,    364,    540,    513,
-};
-
-static const int16_t fcb11m[] = {
-      -453,  -1087,  -1133,  -1125,   -852,   -158,   1152,   3313,
-      1015,   -444,   1085,   -465,   -317,   -298,   -471,   -238,
-      -647,   1426,   -241,    149,   -300,   -169,    -19,   -228,
-      3282,   -269,  -1025,  -1069,  -1097,  -1071,   -539,   1303,
-      1111,   -933,   -741,   -801,   -553,     98,    393,   1031,
-      -786,   -729,   -835,   -810,    -78,   1569,    631,    944,
-      1031,    651,   -409,   -397,   -346,   -221,    -99,   -216,
-       -88,   -211,   -419,    193,   1298,    196,   -221,   -879,
-     -1036,  -1303,  -1282,  -1052,   -575,    283,   3110,   1337,
-       489,   -463,   -640,    112,    341,   -322,    261,    266,
-      1646,   -817,  -1256,  -1273,  -1217,  -1031,   -142,   3691,
-      3012,   1564,   -289,   -830,   -970,  -1032,  -1075,   -989,
-       556,     52,   -588,   -589,   -613,   -748,   -352,   2054,
-       -69,   -785,   -718,   -499,   -141,    192,   1396,    446,
-        -3,   -514,   -612,      3,    171,   1067,   -114,   -109,
-      -812,   -893,   -776,   -342,   1428,    421,    438,    552,
-      -933,  -1143,   -207,   1312,    791,    166,   -198,    -79,
-      -632,   1122,   -537,   -620,    450,     97,    -85,    174,
-      1760,    123,   -168,    485,    -77,   -567,   -776,   -952,
-      -758,  -1176,  -1322,  -1355,  -1207,   -928,   -177,   6229,
-      -413,    261,   -327,   -848,   -725,   -395,    849,   1533,
-      -201,   -124,   2976,   -335,   -703,   -674,   -727,   -949,
-      -521,    209,   1004,    838,     56,   -477,   -751,   -603,
-      -922,   -615,   1832,   -448,   -329,   -148,     73,    467,
-      4991,    -86,   -809,   -928,   -951,   -956,   -819,   -751,
-      1841,   -790,   -712,   -116,   -113,    -91,      0,   -388,
-      -729,   -196,    758,   -377,     68,     85,    428,    -35,
-        -5,      2,     -9,     18,    -31,     53,    -23,     26,
-      -896,   -445,   -188,    818,   -347,    -44,    502,    578,
-       101,   2968,    269,   -724,   -702,   -747,   -719,   -673,
-      7587,     68,  -1171,  -1377,  -1441,  -1455,  -1473,  -1178,
-       699,    585,     15,   2257,   -503,   -940,  -1085,  -1288,
-};
-
-static const int16_t fcb11sl[] = {
-     -1502,  -1463,  -1336,  -1177,   -367,     89,    475,    867,
-       550,    820,   -805,   -580,   -803,    -89,   -817,   1691,
-      -304,    120,     36,    564,    409,   -525,   -820,    362,
-      -969,   -870,   -605,   1983,    993,    722,   1505,   1101,
-      -842,   -848,   -918,   -379,    -71,    257,    499,    607,
-      1619,   -956,  -1024,   -869,   -744,    -74,    795,    684,
-       532,    634,  -1360,   -818,     49,   -981,    111,   -473,
-      -718,   -477,    377,    710,  -1399,  -1105,  -1152,  -1024,
-      2426,   -356,   -191,   1079,    911,   1164,   -809,   -791,
-      -919,   2731,   -851,   -400,   -113,    242,    508,    847,
-     -1229,   1199,   -910,   1127,   -686,   -383,     26,    352,
-       536,    646,   -790,  -1243,  -1103,  -1170,  -1132,  -1065,
-      -788,   -521,    161,   3842,  -1098,   -883,  -1052,      8,
-     -1103,   -747,   -552,   -480,   -241,    820,   3392,   -770,
-      -770,   -724,   -588,   -426,   -153,    426,    639,    724,
-      1626,   -713,   1157,   -736,   -492,   -512,   -160,    461,
-       569,    583,  -1351,   1332,  -1222,  -1358,    240,   1541,
-      -724,    612,   1583,   1194,  -1061,   -990,   -671,   -969,
-      -952,   2368,   -442,   -413,   1933,   1023,   -144,   -283,
-      -992,   -940,    983,   -232,    818,    341,    502,    549,
-     -1420,  -1268,  -1279,  -1213,   -621,   2019,    685,   1948,
-      1264,   1200,  -1293,   -664,    392,   -848,    866,   1191,
-      -220,     95,    450,    640,  -1334,   1098,   -751,   -701,
-      1296,   -347,    -92,    233,    532,    599,   -952,   -694,
-      3085,   -908,   -256,   -494,   -177,    123,    809,    941,
-        18,  -1089,   -801,    303,   -761,     11,    632,    288,
-       476,    518,   -241,  -1138,  -1068,   -869,    292,    121,
-       -26,    -96,    457,    548,   -106,   -784,    930,   -700,
-      1842,   -812,   -617,   -307,    430,    655,   -698,   1157,
-       947,   -803,   -662,   -743,    -49,   1120,    348,    578,
-       855,  -1049,   -753,    -67,    710,   -347,    -28,    694,
-       411,    468,    -61,    239,     23,  -1072,   -757,    477,
-      -658,   -362,    239,    576,  -1479,  -1279,  -1286,   -677,
-      -939,   -722,   3217,    338,   1562,   1566,    925,    917,
-      -697,   -708,    645,   -447,   -280,    714,    503,    552,
-     -1050,  -1021,    889,   -956,   -934,    705,    457,    616,
-       556,    667,  -1331,    -51,   -256,    -48,   -234,    240,
-       757,    -74,    148,    356,  -1278,   1538,    234,   -372,
-      -472,   -221,   -424,   -494,    170,    551,    216,    294,
-      -885,    231,   -263,    334,    -64,    -54,    291,    350,
-     -1140,  -1074,  -1199,  -1374,  -1278,   -845,   -547,    667,
-      4544,   1922,   -899,   -930,   -954,  -1120,  -1092,   1156,
-      1889,   -404,    259,   1114,   -956,   -836,    881,   -316,
-      -977,   -860,    202,   -249,    121,    816,  -1188,   3644,
-      -829,   -876,   -670,   -473,   -161,    420,    851,    886,
-     -1014,   1191,   -938,   -958,   -864,    741,    241,    957,
-       288,    629,  -1155,   -898,   1104,   -789,     28,   -867,
-      -580,   2588,    836,   1234,   -953,   -749,    934,   1137,
-      -310,   -177,   -113,    244,    532,    424,   -341,   -602,
-      -880,  -1105,   -303,   -381,   -527,   1943,    126,    759,
-     -1277,  -1037,     59,   -783,    485,   -589,   1341,    737,
-       488,    709,  -1473,  -1208,  -1082,    589,    791,    735,
-       447,    322,    835,    731,  -1116,   -681,   -592,    704,
-       520,   -545,   -104,    -24,    263,    458,    632,   -721,
-     -1086,  -1223,  -1150,   -866,   1537,   2815,    123,   1097,
-     -1238,   -861,  -1217,  -1238,  -1261,   -914,   1165,    422,
-       711,    883,  -1196,   -972,   -428,   -230,    171,      8,
-      -448,   1195,    445,    440,   -413,   -139,   -375,   -568,
-      -781,   -520,    611,   -586,    881,    589,   -724,    972,
-      -907,   -794,   -819,   -641,   1650,     66,    254,    703,
-     -1380,  -1168,   -967,    676,   -765,   -537,    578,   1542,
-       687,    833,   1151,   -811,   -948,   -995,   -246,   1301,
-      -377,    262,    632,    652,   1530,   -679,   -682,    993,
-      -666,   -457,    -72,    -20,    317,    516,    861,   -528,
-        24,   -579,   -386,     53,    526,    -76,     66,    345,
-       -59,   -612,    165,   -181,    -98,    -34,    -66,    286,
-        95,    108,  -1118,   -147,    643,  -1055,   -768,   -502,
-      -587,     27,   2113,    811,  -1219,   -947,   -811,  -1188,
-      1143,   -609,   -753,     88,   2844,   1424,  -1428,  -1082,
-     -1273,   1086,  -1206,  -1171,    279,   -510,   2325,   1757,
-     -1437,    654,  -1278,  -1267,  -1117,   -950,    779,   2205,
-      1150,   1101,  -1484,  -1009,  -1199,  -1416,  -1215,    657,
-      -737,    634,   1266,   1742,  -1445,  -1193,  -1358,  -1158,
-     -1015,   -995,   -655,   4035,   1966,   1903,  -1069,    954,
-     -1099,  -1171,  -1029,   -818,   -576,   -104,   1390,   1069,
-       559,   -914,  -1034,  -1152,   -987,   -582,   -222,    394,
-      1204,    775,  -1464,    -51,   -959,  -1005,   -452,    347,
-       -94,      1,    525,    595,  -1324,  -1226,  -1102,   -825,
-      -927,   -776,   -582,    175,   1675,    632,   -859,     28,
-      -914,   -209,   -468,   -625,   -230,    646,    579,    446,
-};
-
-static const int16_t fcb11ss[] = {
-     -1351,  -1229,  -1174,   -767,   1403,    182,    532,    445,
-       415,    610,  -1095,   -771,  -1142,   3221,   -803,   -680,
-      -302,    318,    441,    438,  -1188,   1145,   1552,   -528,
-       887,   -547,   -429,    124,     99,    128,   -768,   1049,
-      -562,   1121,   -593,    -96,   -105,    105,    251,    154,
-      1684,   1598,   -635,   -685,   -177,   -211,   -268,    234,
-      -118,    -49,   -719,   -873,  -1092,   -985,   -678,   -406,
-      -234,    407,    653,   3195,    991,   -584,   -874,    -14,
-      -683,   2964,   -769,   -450,    287,    350,    853,   -803,
-      -574,   1761,   -410,    -60,   -230,    -78,    -21,     19,
-     -1271,   4435,   -673,   -790,    110,   -243,    -81,    147,
-       191,    145,   5571,   -611,   -634,   -699,   -195,   -281,
-      -249,   -302,   -272,    -67,   -893,   -656,   -745,   -697,
-      -550,   -639,   -409,   3085,    383,    798,   -311,   -340,
-      -564,   -787,   3628,   -332,   -510,   -219,    465,    351,
-      -747,  -1084,   -972,   -727,   -404,   -630,   -176,    437,
-      3352,    978,   -886,   -751,   -767,   -580,   -693,   -942,
-      -803,   -158,    -36,     -3,   -966,   -674,   3075,   -926,
-      -172,     -9,    -40,    111,    169,    212,    181,   -811,
-      -715,   -986,   -521,   -686,   3915,     18,    -58,    499,
-       210,  -1187,   -903,   -915,   -522,   1038,    477,    788,
-       290,    412,  -1010,   -791,   -700,   -710,     34,   1774,
-      -256,     96,    131,    241,  -1251,   2086,     -5,   -765,
-      -446,    141,     93,    160,     88,    129,  -1153,   1171,
-     -1192,  -1073,   -391,   -187,    206,    416,    444,    648,
-       707,   -542,   -504,   -750,   -623,   -648,    776,    692,
-       165,    330,   1112,  -1199,   -876,   -428,    949,     65,
-       250,    104,    108,    173,   2147,   -905,   -846,   -540,
-      -376,   -131,   -113,    124,    314,    485,   1253,   -515,
-      1435,   -527,     21,   -100,   -368,    -84,   -119,   -144,
-     -1375,  -1189,  -1189,   -999,   -723,   -190,    796,    639,
-       699,    816,  -1188,   -919,    683,    842,    177,    -62,
-       -25,     71,     15,     16,    157,     80,   -331,   -343,
-        12,    193,   -133,    -94,    -94,    -64,  -1306,    531,
-      -917,   -142,   1274,    102,    -15,    184,    159,    148,
-       -43,  -1103,   -581,   -419,    447,   -132,   -204,    187,
-       631,    461,  -1302,  -1162,   -927,    896,    203,    164,
-       -55,    287,    544,    485,  -1258,   -791,    677,   -945,
-      -244,   -101,    423,    362,    298,    389,   -825,   -640,
-      -646,    274,    -73,   -274,   1473,    -13,    132,    169,
-};
-
-static const int16_t fcb11sm[] = {
-      -767,  -1179,  -1188,  -1069,   -690,   -172,    787,   1389,
-      1623,    844,   -169,   -894,   -919,     51,     15,    426,
-      -326,   1579,    182,     77,    202,   -417,   -357,    -17,
-      2154,    -77,   -607,   -589,   -375,   -261,   -376,    175,
-      -829,   -801,   -579,   -290,   -244,    533,   1307,    873,
-      -877,  -1175,  -1157,   -726,    461,   1729,    433,    219,
-       246,    606,   -791,   -827,    649,    891,    820,    720,
-       407,   -641,   -727,   -708,   2498,    961,    -99,   -542,
-      -530,   -507,   -536,   -608,   -642,   -622,    316,    195,
-      -721,   -549,   -253,   1520,    171,    -81,   -372,   -333,
-      1166,  -1072,  -1230,  -1123,  -1031,   -868,   -370,    209,
-      1561,   1751,    113,   -367,    399,   -663,    -10,   -271,
-       950,    118,   -335,   -272,   -863,     60,   -875,   1850,
-      -242,   -276,    -38,   -106,    471,     30,    823,   -344,
-      -752,   -714,   -309,   -419,     86,   1604,   -250,   -185,
-      -839,   -703,   -561,   -281,   1813,    -57,    255,    266,
-       -32,     99,    400,   2520,    315,   -372,   -306,   -511,
-      -549,   -659,   -760,   -729,   -559,   -137,   -610,    174,
-       924,   -310,   -705,   -307,    885,    512,   -611,  -1097,
-     -1172,  -1072,   -758,   -527,   -192,    278,    740,   3398,
-     -1136,    409,   -230,   -353,   -137,    322,    326,    365,
-       133,    173,   2291,   -644,   -725,   -596,   -535,   -340,
-       -88,    -65,    -53,    273,   -760,   -390,   -649,    119,
-      -243,   -222,   1726,   -113,     44,    326,   -618,    311,
-      2345,   -241,   -398,   -399,   -382,   -322,   -444,   -457,
-      1873,   -454,   -505,     42,    481,    187,    -49,   -505,
-      -634,   -754,   1052,   -597,   1315,    297,   -412,   -110,
-      -205,   -552,   -682,   -524,  -1055,   -431,    971,   -363,
-      -539,   -366,     39,    995,    181,    476,    662,    229,
-      -445,   1682,   -205,   -181,   -273,   -497,   -685,   -628,
-      6135,    -21,   -834,   -934,  -1002,  -1066,   -931,   -974,
-      -902,   -643,   -820,   1891,   -706,   -288,   -252,   -231,
-       -79,    126,     35,     37,     10,    -10,    -36,     -6,
-        -9,    -47,     -7,      1,     11,     -2,    644,    315,
-       145,   -353,   -396,   -428,   -357,    -60,    275,    109,
-     -1179,   -952,   -698,    138,    286,    171,    394,    263,
-       814,    495,   -490,    110,    369,    599,      9,    599,
-      -431,   -233,   -328,    -69,    410,  -1002,   -462,     77,
-        97,    196,    133,    -91,    512,     49,    621,   -436,
-      -352,   -390,   -211,   -188,   -454,   -318,     44,   1424,
-};
-
-static const int16_t fcb16l[] = {
-       -13,   -798,   -772,    235,    515,   -181,   -120,   -509,
-      -392,  -1159,   -844,  -1041,   -881,  -1193,   1103,  -1080,
-       214,   1615,   1819,   1510,   -914,  -1190,   -273,  -1099,
-      -522,   -996,   -206,   3946,    996,   1678,  -1220,  -1201,
-      2850,  -1022,   1101,   -814,   -188,    879,   1549,   1279,
-     -1129,   1928,   1550,     38,   -356,   -574,   -157,    286,
-       481,    475,  -1079,  -1176,   -861,   -548,   -657,   -381,
-       538,    948,   -838,    779,  -1149,   -962,   1788,   -779,
-      -742,   -311,    205,    299,    472,    715,    702,   -843,
-      -931,   -790,   -624,   -332,    324,    778,    785,    670,
-     -1137,  -1205,   -103,  -1182,  -1071,   -950,    101,    527,
-      1596,   1004,    682,   -564,  -1053,   -844,  -1184,   1732,
-      -862,   1994,   -988,   1131,  -1069,  -1276,  -1053,   6414,
-     -1259,   -186,   -930,    118,    375,   1092,   6215,   -900,
-      -920,   -935,   -981,   -970,   -766,   -902,   -334,   1629,
-     -1094,  -1142,  -1155,   -779,  -1092,   1011,   -490,   1063,
-      1569,   1340,   2242,  -1313,   6027,  -1319,  -1337,   -789,
-     -1296,   -457,    819,   2276,  -1071,  -1065,   -715,    802,
-      -996,    397,   2396,    -27,   1225,    935,   1400,   -862,
-      -802,   1846,   -513,   -249,   -704,    515,    872,    662,
-     -1141,   5876,   -691,   -404,   -603,   -148,    -57,    187,
-       649,    788,  -1116,   -915,   -551,   3843,   -737,   -133,
-       498,    155,    227,    718,   1798,   1397,   -868,   -716,
-      -586,   -580,    -71,    -67,    311,    536,   2465,   -524,
-      1837,   -231,   -210,    263,    231,    -10,   -164,   -324,
-      -951,  -1130,   5206,   -525,   -603,   -401,    223,    438,
-      1011,   1077,   -726,  -1102,  -1013,   -386,   -786,   4281,
-      -329,    262,    550,   1292,   -629,   -943,   -976,    773,
-      -867,    908,   -680,   -154,    362,   1056,  -1051,   -703,
-     -1333,  -1424,  -1026,   -793,   -859,   -882,   -148,   9958,
-     -1193,  -1156,  -1077,   1241,  -1013,   -726,   -139,    551,
-      1150,   1019,   -733,   -997,   -651,   -625,    -54,    722,
-        73,    -14,    361,    435,   4013,  -1260,  -1195,   1452,
-     -1105,   1273,   -670,   1546,   1038,   1680,   -812,  -1060,
-      -853,  -1058,   2094,   -801,   -457,   -320,    683,    960,
-     -1019,  -1158,  -1118,  -1034,   -617,    404,   1376,    847,
-      1014,    951,    -12,  -1004,  -1221,  -1131,    649,  -1052,
-       442,   -167,   -859,   3868,  -1216,  -1298,  -1311,   2866,
-     -1310,   -639,  -1079,   1576,   1760,   1837,    118,  -1080,
-      -862,   -845,  -1065,  -1069,   2199,   -766,    495,   1309,
-      -996,  -1040,   -741,   1357,   1726,    382,    264,     92,
-       659,    665,   -781,  -1356,   2055,  -1198,     15,   2143,
-       631,    569,    918,   1120,   -948,  -1253,  -1234,   2442,
-     -1062,   2206,     48,    660,   1822,   1480,   -639,    627,
-      -432,   -477,    845,    216,    228,    152,    157,    295,
-      2444,   -908,   -465,   -768,    109,    251,     72,    -59,
-       169,    405,   4395,   -837,   -931,   -839,   -215,   -564,
-       655,    359,    503,    296,   3514,  -1082,  -1185,   -827,
-      2879,  -1224,   -811,   -970,    804,    911,   3028,  -1284,
-      -688,  -1226,  -1251,   -551,  -1247,   -275,   3441,   2322,
-      -630,  -1213,   -108,  -1191,   1129,   -854,   2848,   1609,
-      1048,   1535,   2784,  -1245,    772,  -1230,  -1298,   -686,
-     -1293,   -639,    278,   2455,   9975,  -1077,  -1233,  -1055,
-      -139,   -853,    -48,     24,   -720,    533,  -1191,   2809,
-     -1015,   -899,    -28,   -765,   -147,    146,    592,    814,
-     12493,  -1274,  -1072,  -1297,    877,  -1068,  -1179,  -1032,
-      1023,  -1178,   -840,    930,   -660,   1216,   -366,   -406,
-       -97,     77,    179,    340,   -973,   -993,   2280,   1775,
-      -631,    -17,   -186,    507,    459,    645,   2095,  -1019,
-     -1067,   -949,   -857,  -1202,   -904,    -48,   1156,   1273,
-     -1230,  -1245,  -1203,  -1036,  -1150,   -955,   1193,   1943,
-      1437,   1329,   -618,  -1055,   -730,  -1014,   4953,  -1125,
-      1089,   1085,   1047,   1045,    813,  -1036,   1270,   -715,
-      -684,    -96,   -131,    289,    782,    628,   -979,   1060,
-      -975,   -964,   -811,    -14,    223,    422,    563,    696,
-      -901,   -633,    496,   -136,     22,    -83,    -52,    264,
-        24,    147,   -446,  -1197,  -1258,   -687,  -1239,   -795,
-     -1066,  -1196,    147,   2653,  -1231,  -1275,  -1240,  -1041,
-     -1260,  -1159,   1961,    -34,   2937,   2128,  -1318,  -1355,
-     -1326,  -1300,  -1345,  -1326,   -870,   -298,   2014,   3890,
-      -933,  -1014,   -859,  -1074,   -506,  -1163,   -954,   -819,
-       440,    732,   -582,  -1268,  -1206,  -1037,  -1081,  -1255,
-     -1150,   -835,   2360,   1469,  -1232,  -1384,  -1388,    542,
-     -1359,   -606,  -1335,   1852,   2142,   3722,  -1218,  -1321,
-     -1268,  -1207,  -1203,  -1316,   -954,   -696,   4730,   2920,
-     -1225,  -1306,  -1131,  -1273,  -1276,  -1238,  -1040,   2079,
-      2652,   1931,  -1167,  -1302,    659,   -532,   -650,   -560,
-     -1028,    186,   1224,   2811,   -896,   -449,   -999,   -823,
-       -81,   -876,    502,   -293,    680,    733,   -836,  -1111,
-     -1132,   -865,  -1141,   -938,   -980,   1287,    581,   1438,
-};
-
-static const int16_t fcb16s[] = {
-      1260,  -1427,  -1400,   -996,   -958,  -1195,   6261,     31,
-       967,    752,   3776,   -975,   -840,   -707,   -696,   -555,
-        45,   1159,      4,    358,   4718,  -1471,  -1464,  -1291,
-     -1364,   -934,   -878,   5198,   -273,   1555,  -1438,  -1729,
-     -1579,  -1470,  -1820,  -1436,  -1255,   -631,   4287,   4025,
-      1233,   -684,   -748,   -742,   -547,   -229,    321,    126,
-       794,    670,   6689,  -1041,  -1160,   -861,  -1002,   -976,
-       147,   -668,    521,    940,  -1186,   2097,   -570,   1759,
-      -251,   -442,    -92,     46,     99,     12,  -1336,  -1061,
-      4427,   -945,   -861,   -460,   -306,    494,    481,    536,
-     -1101,  -1105,   2695,    316,   -801,   -159,   1042,   -577,
-       -78,    340,   2347,   1448,    135,   -381,   -688,   -493,
-      -254,   -234,    -74,    -80,  -1047,  -1246,   -729,   -985,
-      5399,  -1018,    643,    822,    889,    432,   -328,  -1386,
-     -1420,   -702,  -1450,   6927,  -1107,    465,   1625,   1116,
-     -1258,   2847,   -893,   -895,   -521,   -263,    112,    157,
-       556,    500,    182,   -652,   -226,    258,   -638,   -566,
-      -419,   -669,   -224,   -221,  -1197,   -227,   -582,     92,
-      1914,   -184,    -11,    -18,    270,    166,  -1294,    -62,
-      1536,   2470,   -413,   -619,   -399,     24,    106,     54,
-     -1223,   2672,   2400,    -54,   -577,   -692,   -301,     -3,
-       206,     89,  -1424,  -1491,   8425,  -1072,   -242,   -420,
-      -194,     -1,    489,    331,   -938,  -1319,   2493,  -1355,
-       551,   2297,    197,     -9,    717,    434,  -1237,   -773,
-     -1021,   3945,   -566,    116,    246,    150,    510,    370,
-     11804,   -457,  -1006,  -1231,  -1175,  -1086,  -1221,    589,
-      -679,   -757,  -1183,   6502,   -584,   -454,   -629,   -570,
-      -413,   -352,   -279,    -32,  -1236,   -946,   -760,   1535,
-      -865,   -712,   -224,    343,    647,    613,  -1348,   -938,
-      -961,   8273,  -1130,   -591,   -225,    210,    420,    140,
-     -1247,  -1166,   -966,   -986,  -1120,   -907,   -181,    470,
-      1888,   1161,  -1076,  -1298,   3479,  -1151,   2410,   -396,
-         1,    -44,    357,    594,   -896,    745,    -33,   -422,
-      -332,   -259,      0,     48,    143,    190,  -1009,   -837,
-      -876,   -371,   -370,   1520,   -150,    251,    240,    448,
-     -1024,  -1008,   -568,   -450,   -611,   -536,   1763,    -34,
-       355,    454,   -769,   -599,   -639,   -737,   -912,   -725,
-      -504,   -230,    532,   3294,  -1077,   -289,   -875,   -542,
-      -574,   -604,   -339,   2511,    479,    742,  -1218,   -946,
-      1321,   -522,   -544,   -950,   -765,    632,    639,    497,
-};
-
-static const int16_t fcb16m[] = {
-      -940,  -1197,  -1190,  -1200,  -1192,   -960,   -718,    610,
-      3300,   3253,  -1515,  -1689,  -1798,  -1798,  -1793,  -1764,
-     -1616,     33,   2377,   7778,   -668,   1745,   1501,    785,
-      -336,   -823,   -708,   -446,   -455,   -812,   8862,    159,
-     -1141,  -1261,  -1323,  -1299,  -1261,  -1227,  -1214,  -1090,
-      3584,   2092,    688,   -531,   -848,  -1000,  -1047,  -1192,
-     -1104,   -887,   5163,   -347,  -1129,  -1285,  -1336,  -1291,
-     -1249,  -1109,   -498,   2511,   -611,   -703,   -516,   -240,
-       -68,    399,   1570,    252,     -5,     43,  -1163,  -1168,
-     -1008,   -921,   -995,   -569,    925,   1511,   1001,   2023,
-     12926,    135,  -1598,  -1778,  -1847,  -1850,  -1836,  -1734,
-     -1695,  -1690,    621,   4647,    588,   -752,   -973,   -996,
-      -953,  -1081,  -1060,   -672,   -868,    259,   4940,   -117,
-      -718,   -907,   -828,   -776,   -606,   -981,  -1002,   -526,
-      -385,    527,   1501,   -239,     38,     25,    112,    -77,
-      1122,   -250,   -352,  -1113,  -1101,   -942,   -681,   5156,
-      -800,   -636,   5814,   -160,   -777,   -825,   -844,   -747,
-      -697,   -645,   -668,   -492,   -936,    491,   -280,   2573,
-      -269,   -736,   -375,   -265,    -98,   -243,   -920,   -236,
-       446,   1095,   -666,   -600,   -246,    783,    282,      0,
-     -1064,   -116,   2271,   -118,   -482,   -240,   -187,   -271,
-        36,     91,   -695,   -254,   -383,   -948,    745,   2722,
-      -129,   -799,    238,   -379,   2872,   -516,   -868,   -623,
-      -551,   -275,     22,    379,   -185,   -230,   1524,   -672,
-     -1062,  -1164,  -1177,  -1137,  -1058,   -790,      6,   4928,
-      -551,   -389,   -460,   -394,   -674,   -586,   -327,   -178,
-       615,   2868,  -1467,  -1203,  -1316,  -1120,   -996,    747,
-      -219,   2023,   1875,    254,   -871,   -992,  -1062,  -1110,
-     -1149,   -992,   -492,     40,    528,   5374,     83,   -559,
-      -862,   -760,   -541,     28,    207,    629,    502,   1260,
-      -473,  -1110,  -1336,  -1390,  -1412,  -1379,  -1329,  -1081,
-      -238,   9844,  -1332,  -1306,  -1275,   -881,  -1267,  -1249,
-      -237,   2882,   3535,    584,    -13,     52,    -50,     -4,
-         7,      5,     20,    -55,      5,     45,   1587,    350,
-       191,    617,    153,   -236,   -336,   -649,   -798,  -1063,
-      1451,    707,    253,   -733,   -923,   -859,   -621,   -738,
-      -555,   1623,   1727,   -411,   -724,   -772,   -746,   -675,
-      -688,   -209,    915,    622,  -1038,   -474,   -343,    -91,
-      -173,   -104,    255,     96,   1547,    773,   -625,   2272,
-       -90,   -509,   -527,   -247,   -147,   -234,    -45,    166,
-};
-
-static const int16_t fcb16sl[] = {
-     -1337,  -1122,  -1559,  -1452,  -1353,   -973,   3858,   1145,
-      1225,   2103,   -607,   -181,    557,   -429,     15,   -496,
-      -444,   -523,  -1866,  -1134,  -1270,   3029,  -1110,   -798,
-      -824,   -659,     44,    614,   1059,   1173,    714,   -932,
-     -1095,  -1061,   -921,  -1034,   -873,      7,   -872,    660,
-     -1335,  -1496,  -1623,  -1405,  -1070,   -680,    943,    134,
-      -190,   2837,  -1034,   -221,   -337,   -540,   -571,   -173,
-      -411,   2314,   -111,    970,  -1220,  -1036,  -1096,   -147,
-      1087,    604,   -367,     83,    461,    679,  -1333,    194,
-     -1292,  -1139,  -1097,   -570,   -508,   -109,     54,    962,
-      2592,  -1112,   -944,   -636,   -521,     12,    230,    442,
-       562,    624,  -1107,  -1190,   1554,   -981,   1507,  -1013,
-      -394,    595,    823,   1094,  -1453,  -1298,    242,  -1185,
-      -686,   -541,    858,    331,    695,   1197,  -1259,    968,
-     -1180,  -1254,   -752,   1473,    222,    342,    973,   1029,
-     -1631,  -1500,  -1619,  -1517,  -1299,   1683,   2203,   1163,
-      1225,   1497,  -1189,   -937,   -931,   3193,   -977,   -708,
-      -262,    549,    917,   1465,    704,   -565,   -708,    846,
-      -130,   -322,   -257,    221,    367,    309,  -1416,  -1123,
-     -1323,  -1260,   -405,   3303,   -210,    785,   1007,   1616,
-     -1043,   -717,     44,    824,    419,   -492,   -579,   -604,
-       -15,    676,  -1067,  -1079,   3897,  -1211,   -474,  -1020,
-      -589,    114,    593,   1504,  -1481,  -1249,  -1036,  -1012,
-      -719,    846,   -189,   -297,    -31,   1209,  -1761,  -1566,
-     -1449,  -1645,  -1464,   1422,     24,   2153,   1377,   1948,
-     -1480,    652,   -929,   -415,   -689,   -386,   1628,    489,
-       487,    756,  -1424,   -805,   1241,    228,   -697,   -316,
-       423,    660,    557,    587,   1248,   -777,   1088,   -848,
-      -498,   -399,    -60,    169,    497,    689,   5679,   -778,
-     -1109,  -1118,   -895,  -1042,   -504,    390,   1670,    469,
-       977,   -929,  -1173,  -1058,   -999,   -696,   1912,     52,
-      1297,   1081,  -1469,  -1243,  -1055,    385,   -529,    910,
-        79,    508,   1225,    753,    656,  -1307,  -1239,  -1470,
-     -1110,  -1255,   -362,   2351,    889,   1687,  -1566,  -1331,
-     -1410,  -1385,    779,   -499,   -217,    936,   2064,   1493,
-     -1499,  -1345,  -1162,    790,  -1115,   -673,   2083,   1010,
-       588,   1265,  -1439,  -1168,  -1294,    752,  -1421,  -1234,
-      -169,   -529,   1606,   2131,  -1556,  -1442,  -1444,    487,
-     -1260,  -1139,    360,   2528,   1994,   1686,  -1548,  -1473,
-      -563,  -1125,    967,   1490,   1503,    487,    991,   1024,
-     -1430,  -1151,  -1215,   -729,   -746,   -762,   -472,    778,
-       889,    774,  -1329,  -1129,   1383,  -1230,   -723,   1478,
-       379,    161,   1266,   1238,  -1467,   -843,  -1277,  -1323,
-      -715,     58,   -182,   5140,    762,   1723,  -1285,   1134,
-     -1175,  -1057,   1294,     -4,   -417,    557,    939,   1182,
-        39,    565,   -809,   -703,   -783,   -883,   -112,    412,
-      1056,    691,   -273,  -1334,   -898,  -1345,  -1069,  -1247,
-      -105,    638,   6811,   1157,    982,   -856,   -805,  -1093,
-      1267,   -747,   -650,    311,    281,   1076,   1371,   1614,
-      -891,   -886,   -396,   -246,    -65,     77,    472,    605,
-      -943,    178,   -509,    112,   -142,    512,    -66,    109,
-       144,     76,   2934,  -1203,  -1428,  -1525,  -1269,  -1618,
-     -1129,   -184,   -225,   3157,   -249,  -1276,  -1055,   -439,
-      -161,   -268,    284,    614,    778,    670,  -1243,   1682,
-       919,   -468,   -479,   -341,     31,    468,    325,    606,
-     -1081,   -723,     83,   -399,   -275,   -658,    240,    149,
-      2746,    679,  -1573,  -1287,   -494,    775,    975,   -751,
-       -47,   1758,    652,   1155,  -1465,  -1073,  -1087,  -1026,
-       289,    340,    448,   1348,    351,    682,   2065,  -1183,
-     -1313,  -1562,   -466,  -1546,  -1077,   -477,   3012,   2512,
-     -1560,  -1532,  -1441,  -1229,    861,   -421,   1515,   2195,
-      1163,   1418,  -1268,  -1103,   -804,  -1094,   3254,   -711,
-      -558,    713,   1414,   1684,    542,   -781,   -827,   -814,
-      -245,   1129,   -160,    210,    386,    618,  -1633,    488,
-     -1584,  -1571,  -1349,   -662,    711,   1516,   1661,   1673,
-     -1510,  -1530,   1013,  -1172,    425,  -1415,   -856,   2963,
-      2258,   1919,   -744,  -1208,   -863,   -634,   -729,  -1068,
-      -857,   -289,    701,   6703,  -1502,  -1353,  -1531,  -1372,
-     -1388,  -1067,   1392,    100,   2570,   1703,  -1551,  -1500,
-     -1587,  -1693,  -1753,  -1431,  -1048,   1162,   1308,   3073,
-      -998,  -1575,   -517,  -1346,  -1293,  -1493,  -1375,  -1109,
-      -803,   2972,  -1446,  -1316,  -1114,  -1405,  -1240,  -1057,
-     -1109,   -589,   2623,   1626,  -1555,  -1026,  -1346,  -1467,
-      -902,   1291,    176,    630,   4293,   1949,  -1233,  -1362,
-      -930,  -1175,  -1118,  -1375,  -1172,   -967,   4896,   4195,
-     -1744,  -1562,  -1797,  -1815,  -1577,  -1194,    371,   3326,
-      3183,   3071,  -1425,  -1773,  -1562,  -1358,   -547,   -246,
-        24,   -526,  -1502,  29376,   -860,   -614,   -857,   -795,
-       793,   -616,   1691,   -125,    156,    559,  -1643,  -1462,
-     -1523,  -1413,  -1251,   -592,   1014,   1888,    243,   1041,
-};
-
-static const int16_t fcb16ss[] = {
-       308,   -532,   -811,   -974,   -641,   -431,   3409,    258,
-       567,    641,   1315,   -723,   -738,   -502,    142,    678,
-       -67,   -170,     73,    -65,   2717,   -804,   -958,   -878,
-      -532,   -562,    238,    497,    548,    718,   -868,   -669,
-      -932,  -1004,   -518,   -502,   -286,    405,   2987,   1420,
-       174,   -779,   -748,   -575,   -153,    -40,    340,    413,
-       275,    387,    965,     82,   -550,   -744,   -592,   -591,
-      -604,   -163,    428,    843,  -1280,   1756,   -368,    777,
-       -29,   -453,    -61,     43,     50,    137,    950,   -229,
-      1504,   -491,   -353,   -167,   -285,   -158,    -94,   -185,
-     -1431,    303,    673,   -758,   -610,   -308,   1247,    348,
-        95,     31,   1631,   1963,   -624,   -770,   -466,   -150,
-      -122,   -123,     34,   -141,   -883,   -374,   -948,   -629,
-      3420,   -772,   -392,    -31,    603,    646,   -760,   -871,
-      -936,   -948,   -727,   3563,   -376,    858,    699,    561,
-     -1370,   2366,   -775,  -1241,  -1105,   -247,    177,    432,
-       414,    379,  -1360,  -1057,   -945,   -848,   -568,   -779,
-      -632,   -328,   -295,    425,   -349,    630,   -275,   -527,
-       438,     47,   -194,    -96,   -239,   -545,  -1381,   -689,
-      1644,   1165,   -437,   -153,   -193,    307,    183,     66,
-     -1335,   2590,   2169,   -447,   -435,   -317,    -82,    204,
-        45,   -145,  -1324,   -205,   4019,   -973,   -578,     28,
-       175,    506,    235,    -98,   -908,   -294,   1443,   -850,
-      -556,   1707,   -277,     58,    241,   -188,   -853,   -572,
-      -577,   1258,   1007,   -190,      1,     -3,    103,    -49,
-      5385,    137,   -707,   -834,   -510,   -517,   -392,   -390,
-      -231,   -275,  -1249,   5229,   -812,   -893,   -353,   -663,
-       -29,    187,     45,     10,  -1388,  -1171,  -1051,    412,
-      -379,   -411,    240,    574,    632,    284,   -838,   -912,
-      -924,   3062,   -695,   -409,   -224,    422,    293,    267,
-     -1436,  -1237,  -1303,  -1305,   -914,   -243,    821,    839,
-      1043,   1284,  -1178,   -496,   1594,   -736,   1752,   -601,
-      -396,    330,    231,     48,  -1253,    808,   -896,   -967,
-      -653,    -84,      4,    442,    363,    589,  -1005,   -672,
-      -687,    -93,   -274,   1376,   -232,    -52,    399,    255,
-     -1085,  -1214,  -1088,   -748,   1036,    414,    220,    509,
-       436,    499,   -648,   -765,   -931,   -983,   -758,   -543,
-      -379,   -115,    780,   3327,  -1086,   -893,   -773,   -881,
-      -683,    -11,   -322,   3418,    739,    961,  -1363,   -929,
-       899,  -1005,   -792,   -338,   -185,    702,    627,    638,
-};
-
-static const int16_t fcb16sm[] = {
-     -1125,  -1385,  -1439,  -1387,  -1120,   -681,   -135,    616,
-      3086,   2537,  -1440,  -1209,  -1027,  -1209,   -626,    173,
-       662,    899,    861,   2180,    387,   1032,    936,    140,
-      -353,   -302,   -290,   -330,   -551,  -1019,   3555,    -68,
-      -441,   -539,   -500,    -27,   -423,   -506,   -522,   -415,
-      2347,   1890,   -312,   -742,   -679,   -679,   -653,   -609,
-      -433,   -472,   2709,   -755,  -1153,  -1066,  -1028,   -862,
-      -826,   -315,     78,   1699,   -363,   -429,   -690,   -190,
-      -358,   -667,   1909,     39,     -1,    138,  -1592,  -1559,
-     -1357,  -1554,   -750,    813,   1676,   1537,    977,   -269,
-      8320,   -602,  -1140,  -1153,  -1136,  -1174,  -1004,  -1091,
-     -1388,  -1187,   -507,   3103,   -200,   -665,   -590,   -381,
-      -365,    -40,   -295,   -591,   -963,    271,   2231,   -547,
-       -65,   -270,    -64,    243,   -183,   -548,   -796,   -277,
-        -7,   -168,   1575,   -361,     35,    -19,    192,   -154,
-      -384,    144,   -426,   -528,   -598,   -778,   -297,   1847,
-       564,    218,    864,   -654,   -485,   -435,     45,    709,
-       630,    -11,   -691,   -111,   -775,   -356,   -522,   2247,
-       -79,   -433,   -620,    594,     79,     60,   -828,   -475,
-       768,    -79,   -655,    550,   -201,     77,    858,    -11,
-      -803,   1173,   1027,   -971,   -656,   -648,    -40,     17,
-       720,    176,  -1055,   -936,   -258,    550,   1086,   1065,
-         0,   -473,   -364,     30,     53,     -6,    -54,    -24,
-        21,    -81,    -88,    -45,    -14,     81,    674,  -1189,
-     -1049,   -846,   -489,    -24,    -47,    165,    658,   1909,
-      -241,   -390,   -387,   -454,   -319,   -549,   -307,   -112,
-       778,   1486,   -314,     34,    -93,   -799,   -538,   2219,
-      -445,     39,    -38,   -258,   -427,   -943,   -760,   -602,
-      -575,   -450,    376,    668,    879,   1215,  -1216,   -784,
-      -646,   -291,    275,   1019,    -77,    124,    256,   1166,
-      -410,   -993,  -1145,  -1118,   -940,   -825,   -560,   -131,
-      1006,   4878,  -1401,  -1286,  -1316,  -1394,    177,   -919,
-       162,   2292,   1792,   1242,   -762,    937,   -168,   -900,
-      -829,    203,   1225,    626,   -122,   -515,    992,   -198,
-      -782,    -25,     74,   1019,   -606,   -364,   -350,     -5,
-       451,    324,    265,  -1143,   -820,    382,   -362,     85,
-      -797,    693,   1594,   -335,   -229,   -396,   -211,   -356,
-       -97,   -115,     92,     49,   -476,  -1124,  -1084,   -594,
-      -228,    728,     16,    589,   1213,    841,   -829,   1874,
-      -907,  -1000,   1411,   -621,   -707,    356,    437,     37,
-};
-
-static const int16_t fcb22l[] = {
-      2735,  -1224,  -1198,  -1073,  -1115,  -1054,   -713,   1693,
-     -1106,  -1259,    722,  -1256,  -1223,   1686,   1589,   2003,
-      -906,   2529,   2141,   -396,   -338,    -36,     52,    476,
-       319,   -420,    561,   -492,   -526,   -359,   -221,   -254,
-      -752,  -1136,   -690,   -896,   4307,   -363,    -42,   1363,
-      -717,  -1036,   -874,   2315,   -952,   -872,    262,   1418,
-       737,   1374,   -506,   -470,   -275,   -126,    242,    428,
-      -678,   -681,   -581,   1016,   -553,   -509,   -485,   -408,
-      9595,  -1015,  -1168,   -932,   -812,   -690,   -167,    753,
-      -935,   -439,   2105,   -526,   -710,   -570,      9,    548,
-       530,  -1308,  -1060,   -351,   -974,  -1038,     93,   5579,
-      -737,  -1282,   1386,  -1284,  -1243,  -1105,    790,   2169,
-      -701,   -660,   -555,   1317,   2805,    792,   2209,   -490,
-      -758,  -1262,  -1083,  -1073,    930,   -810,   -170,   2326,
-     -1213,  -1286,   3435,  -1135,  -1051,    220,   3040,   1999,
-      -933,   -663,   -714,   -855,   -372,   -599,   -437,    373,
-      5873,   -987,  -1081,  -1003,   -747,   -271,    582,   1069,
-      -917,   -754,   5676,   -565,   -616,   -396,    177,    908,
-      3106,   1459,   -678,   -543,   -340,     47,    336,    493,
-     -1060,   1427,   -560,   -763,   -710,   -661,    193,    595,
-      -996,   2488,   -588,   -752,   1306,    114,    292,    689,
-     -1202,   2334,  -1173,  -1167,   -755,    353,   1711,   1572,
-      -932,   -751,   2099,   2025,   -417,     62,    458,    611,
-      -981,   4387,   -639,   -560,   -520,   -152,    262,    748,
-      -828,   -818,   -682,   5250,   -640,   -270,    385,   1049,
-     -1072,   -774,   1870,   -668,   1514,   -158,    283,    793,
-     -1087,  -1150,   -899,   -875,   -188,   -184,   6656,   2311,
-      -906,   1654,   -446,   1677,   -654,   -101,    364,    721,
-     -1272,   7928,   -812,   -576,   -708,   -347,    397,   1128,
-      3830,  -1034,  -1055,   2244,   -759,   -706,     79,    893,
-      -922,  -1067,   2740,   -868,   -858,   1129,     34,   1096,
-      2455,   -694,   1970,   -650,   -674,   -131,    370,    697,
-     -1069,  -1137,   -948,  -1045,  -1087,   -964,    367,   1091,
-      4096,   -960,   -921,   -870,   1397,   -511,   -190,    545,
-      -657,  -1194,   -536,   -951,  -1094,    117,   -720,   2532,
-     -1098,  -1147,  -1177,   1764,   -757,   -121,   2372,   2010,
-      3662,   -952,   -995,   -894,   -625,    464,    731,    863,
-      -607,   -505,    401,   -423,   -540,   2144,    755,   -430,
-     -1499,  -1242,  -1202,  -1190,   -626,   1249,   3388,   2379,
-      -983,  -1090,   -907,  -1021,  -1012,   -870,   2723,   1589,
-      -913,    332,   -102,     99,    226,      6,    176,    354,
-       156,    -36,   -829,   -774,   -685,    -15,    498,    503,
-      2030,   -409,   -599,   -572,   -341,     -2,    111,    302,
-       788,  -1002,   -978,   -929,  -1001,   -886,    578,    995,
-      1237,   -747,   -696,   -653,   1143,     62,    506,    571,
-       994,   -993,   -902,   -871,   -662,   1527,    370,    979,
-       980,   -466,   -484,    787,   -261,     61,    250,    377,
-      -112,   -676,   -535,   -344,    274,    363,    185,    334,
-       -48,  -1144,  -1095,  -1011,   -552,    445,   1355,   1207,
-     -1108,  -1128,  -1085,   -826,    -83,   2001,   1265,   1429,
-     -1024,   1199,   -671,   -701,   -444,   1192,    187,    673,
-     -1039,  -1056,   -953,   -732,    359,    714,    787,    935,
-     -1187,  -1133,  -1112,   -971,   2158,   1720,    801,   2016,
-     -1056,  -1068,   -889,   1808,    503,    892,    358,   1041,
-     -1180,  -1184,  -1068,   -788,   1423,   -573,   2141,   1949,
-     -1042,   -924,   -849,    512,   -629,   -272,    779,    815,
-      1939,  -1069,  -1092,  -1027,   -770,     48,   1554,   1285,
-     -1109,  -1148,  -1157,  -1033,   -934,    779,   1358,   1560,
-     -1053,    222,  -1095,  -1001,   -681,    -26,   1112,   1035,
-     -1168,  -1285,  -1169,  -1180,  -1085,  -1097,   1313,   3112,
-      -928,   -655,   -811,   -618,   1555,   -480,     71,    467,
-     -1220,  -1123,  -1008,   -577,   -845,   3854,    491,   1878,
-     -1051,   -761,    617,   -650,   -453,     51,    784,    757,
-      -993,   -883,   -905,   -708,   -869,    969,    -64,    655,
-};
-
-static const int16_t fcb22s[] = {
-      9854,   -479,  -1163,  -1147,  -1316,  -1137,   -991,   -942,
-       522,    739,  -1042,  -1306,  -1040,   -126,   1147,   3526,
-      1880,   -477,   -483,   -328,   -899,   1063,   1243,   -610,
-      -721,   -527,   -372,    171,     90,    196,   6615,  -1167,
-     -1189,  -1079,   -954,   -817,   -833,   2246,    439,   1038,
-     -1053,  -1136,   -938,   -805,  -1022,  -1041,   -717,   2021,
-       341,    935,  -1164,  -1230,   -573,   1768,  11111,  -1113,
-      -874,   -631,   -367,      7,  -1077,   -925,   1558,   -850,
-      -918,   -755,   -512,    452,    260,    400,   -787,   -966,
-      -690,   -584,   -843,   -802,   2092,    120,    103,    580,
-      -746,   -512,   -241,   -621,   2771,   -486,   -268,    258,
-       171,    232,  -1265,  -1253,  15128,  -1123,  -1037,   -885,
-     -1109,   -664,   -659,   -240,   1558,   -909,  -1160,  -1247,
-     -1223,  -1031,   -989,   -415,   3504,   1569,   -651,  -1241,
-     -1145,  -1014,  -1322,  -1000,   -354,     59,    709,   4206,
-     -1124,   -986,   -633,   -976,   -907,   -636,   -371,    255,
-      1195,    876,   -145,  -1146,  -1018,   -992,   -480,   -762,
-      6904,   -703,   -431,   1043,  -1048,   -638,   -142,    394,
-      -852,   -730,   -533,   -361,    234,    221,  -1070,   -930,
-      -764,   3210,   -780,   -256,   1777,    258,    307,    382,
-     -1224,    987,   4894,   3525,   -412,   -558,   -819,   -863,
-      -572,   -497,  -1175,  -1197,   7637,  -1109,   -748,   -116,
-      -306,     27,    386,    630,  -1334,  -1378,  -1302,  12592,
-     -1327,   -971,     89,   -731,    259,    201,  -1135,   -951,
-      -585,    -64,   3489,   2765,     43,     75,   -527,   -162,
-      2865,  -1344,  -1394,  -1391,  -1231,   -748,   -962,   5403,
-       719,   1418,   -724,  -1101,   -955,   -743,   -937,  -1064,
-     -1095,   -601,    -60,    411,  -1113,   -873,   -603,   2913,
-      2512,   -339,    -36,     26,    -39,     78,   -757,   -998,
-      -522,   -838,   5507,   -973,    796,    536,    250,    312,
-     -1363,   -944,   6021,    -58,   5313,   -690,   -549,   -485,
-       -66,   -133,  -1257,   6004,   6374,   1487,   -976,   -987,
-      -969,   -803,  -1027,   -624,   -967,   1744,   3504,      6,
-      -659,   -691,   -326,   -129,    -49,    148,  -1032,   -683,
-      1819,   1804,   -491,   -452,   -295,     33,    -20,     42,
-     -1226,  -1086,   -792,   6412,   -657,   -278,   -103,    -25,
-       -82,    207,   2450,     -6,   2417,    251,   -622,   -593,
-      -409,   -193,   -339,   -304,   -862,   -667,   2457,   -500,
-      -438,   -504,   1408,    143,    203,    265,  -1128,  -1148,
-      2791,   -373,   -951,   2129,   -842,   -278,     81,    307,
-      -787,   -822,   2655,   -604,   2028,   -787,      4,    335,
-       170,    219,    649,   -457,    972,   -607,   -359,   -470,
-      -238,     68,    -57,    107,   2285,   -526,   -490,   -604,
-       179,    -41,    230,     64,     20,     50,   -802,   1168,
-      -235,   -264,   -316,   1469,   -499,    108,    183,    150,
-     -1068,   -806,   -399,   1244,   -355,    487,    -57,    450,
-       195,    248,  -1122,  -1096,   3327,   -956,   1084,   1306,
-       247,    442,    169,    283,   3416,   -609,   -891,   -879,
-      -853,   -573,   -285,   -147,    380,    608,   1271,   -874,
-      -931,     40,   -989,   1432,   1981,    -34,    285,    190,
-      -902,   -974,   4117,   -868,   -784,   -584,   -358,    200,
-       261,    521,   -945,   -981,   -773,   3517,   -961,   2420,
-         9,    318,    187,    322,  -1006,   -779,   -526,   2972,
-      -712,   -578,   -576,    167,    156,    270,    460,    -74,
-      -237,    939,   -440,   -515,    126,     63,     82,     67,
-     -1069,  -1104,   -923,   -634,   -190,   1151,    526,   2920,
-       125,    566,  -1144,   4199,   1314,   -458,   -568,   -336,
-      -515,   -332,   -352,   -143,   -770,    283,   -770,   -785,
-      -807,   -348,     93,    427,    181,    334,   -798,   -830,
-      -300,   -509,   1257,   -554,   1341,      6,    242,    272,
-     -1030,     62,   1293,    340,    752,   -493,     -6,    -34,
-        33,     85,   -893,  -1202,    244,   -131,   -306,   7590,
-      -832,    420,     80,    423,   -799,   -870,   -930,   -720,
-      -640,   2390,   -409,   -177,     91,    370,   -864,   -949,
-       838,   -574,   -234,    555,     46,     -9,    -83,    146,
-      -825,   -478,   -664,    -57,    867,   -296,   -380,    -73,
-        70,    171,  -1124,  10522,   -228,   -609,   -958,  -1025,
-      -548,   -384,   -257,     55,   5414,    436,   -651,   -748,
-      -671,   -525,    -25,   -273,   -264,     57,  -1129,   1974,
-      -145,   1650,   -317,   -514,   -305,    -78,   -154,     59,
-      1269,   1008,   -510,   -711,   -534,   -358,    194,    117,
-       102,     57,   -837,   1260,   -126,   -494,     47,   -162,
-       924,    -72,    130,     97,    742,   -803,   -711,   -755,
-      -402,   -188,     24,    309,    187,    379,  -1092,   5862,
-      -647,   -807,   -715,   -696,   -408,    -29,    104,    353,
-      3298,   2193,   -263,   -772,   -908,   -754,   -449,   -164,
-      -157,    -44,   -986,   2313,   -596,     56,   2057,   -478,
-        74,    -51,     51,    121,   -899,   1793,   -595,   -669,
-      -743,   -689,   -546,     71,    201,    382,  -1061,   3375,
-      -776,   -876,   -648,   -407,    -44,    260,    258,    393,
-};
-
-static const int16_t fcb22m[] = {
-     11522,    868,  -1444,  -1572,  -1674,  -1745,  -1844,  -1616,
-     -1723,  -1508,     27,   -321,   -693,   -597,   -374,   -380,
-       327,    209,    611,   1182,   -548,    176,   -544,   -485,
-      -341,   -376,   -383,   1024,   1316,     -4,    192,   -649,
-      -979,   -945,   -802,   -183,   3749,    812,   -416,   -527,
-      -734,   1059,   -521,    924,   -462,   -631,    -76,    182,
-       126,    100,   -653,   -643,  -1189,  -1264,  -1312,  -1311,
-     -1212,  -1016,   -218,   8415,  -1005,    734,   1303,   -272,
-      -397,   -521,   -245,    389,    242,   -234,    458,   -912,
-     -1215,  -1228,  -1288,  -1131,   -845,   -404,    912,   5497,
-       413,   3161,   -432,   -148,   1704,   -663,   -996,  -1009,
-     -1419,   -929,    -36,   -471,   -640,   -571,   -197,   -573,
-      -462,   2586,   -179,   -382,   -757,   -895,  -1096,  -1140,
-     -1216,  -1051,   -688,    -44,   3311,   3518,   -474,   2530,
-      1475,   -676,   -702,   -777,   -380,   -316,   -538,   -468,
-      -708,    542,   -213,   -713,   -911,   -482,   -696,   -135,
-      1282,   2006,   5707,    476,   -707,   -771,   -650,   -788,
-      -778,   -853,   -962,   -926,     10,    -11,      3,      1,
-       -12,    -14,     21,      7,    -13,    -10,  -1410,  -1712,
-      1379,   5757,    218,  -1232,   -563,   -929,   -684,   -827,
-      -261,   1040,   -154,   -309,    -99,     62,    856,    199,
-      -614,   -926,   -626,   1568,   -258,    374,   1071,   -140,
-      -250,   -332,   -832,   -706,   -863,   -714,   -749,   3081,
-       498,   -695,   -395,   -600,   -279,    588,    245,   3122,
-      -329,   -677,   -262,     67,     19,   -530,   -882,   -862,
-     -1033,   -160,   1542,   1916,   -416,   -600,   -553,   -219,
-      -130,   -497,   -699,   1719,    160,   3293,   -212,   -923,
-     -1045,   -761,  -1238,  -1038,   1543,    738,   -548,   -541,
-      -403,   -281,   -115,    -95,   -313,    -19,   -292,   1136,
-      3592,    696,   -654,   -856,   -726,   -693,  -1057,  -1267,
-      -722,   -381,   -683,   1364,    -30,    589,    454,    262,
-       -57,  -1018,   -312,    846,   -139,   -587,   -127,   2482,
-      -178,   -233,   -977,   -796,     -6,    250,    220,   1577,
-      1141,   -251,   -649,   -809,  -1051,   -873,   -762,   -990,
-     -1010,   -890,   -897,   -639,   -671,   1964,    788,   2310,
-      6001,     20,  -1008,  -1159,  -1208,  -1208,  -1318,  -1227,
-      -829,   1680,  -1023,   -998,  -1224,   -945,   -769,    -41,
-      2033,    196,    917,   1615,   2026,   -654,  -1014,   -918,
-      -750,   -675,   -839,   1541,    282,    430,  -1059,   -708,
-      -507,   -522,   -169,    438,    196,    835,    778,    897,
-       420,    526,   1239,    198,   -736,   -953,   -835,   -229,
-      -348,    726,   -767,   1311,    248,   -353,   -550,   1017,
-      -250,   -732,    256,   -175,   -638,    763,   -761,   -957,
-      -554,    539,    252,    299,    431,    613,   4398,   -378,
-     -1022,  -1020,   -990,   -757,   -621,    -83,    -34,    122,
-      -476,     77,   -799,   -116,   4546,   -787,   -735,   -462,
-      -875,   -907,  -1373,  -1354,  -1355,  -1220,  -1024,    -88,
-      1298,   2844,    940,   1135,   2261,   2142,    181,   -735,
-      -924,   -941,   -799,   -715,   -662,     86,   -719,   -521,
-       115,   -576,   -699,   1052,   1295,    -57,     42,    230,
-      2876,    501,   -294,   -158,    104,   -157,   -515,   -662,
-      -987,  -1069,   -703,   -985,  -1061,   -946,   -878,   -267,
-       397,    132,    534,   3642,   1298,   -560,   -701,   -526,
-      -294,    197,    310,     75,     -3,    267,   -342,   2058,
-      -328,   -427,   -709,   -688,     14,    -43,    237,    506,
-      2822,   -337,   -900,   -818,   -638,   -192,    883,    -14,
-      -271,   -559,   2822,   -165,   -988,   -933,   -917,   -603,
-      -583,   -397,    467,   1092,  -1044,   -479,   2478,   -386,
-      -535,   -253,     63,    -49,     79,     27,   -182,   -100,
-       362,   -628,   -661,   -707,   1557,    136,    335,     89,
-      -197,   5697,    220,   -473,   -472,  -1053,  -1023,  -1087,
-     -1203,   -756,   -377,   -917,   -925,   -568,   -237,   1422,
-       197,    -98,    614,    867,   -831,   -829,   -969,   -720,
-       414,   1080,   1707,    828,   -121,   -757,  -1044,   -289,
-       816,    284,    809,    -84,    -22,   -552,     -9,    193,
-      -359,     66,   -582,   -674,   1992,    -31,     58,    427,
-      -515,   -299,    932,   -608,  -1103,  -1068,  -1016,   -770,
-       200,   1031,   1112,   1026,   -598,   -818,   -891,   -635,
-      -828,   -866,   -650,   4795,   -407,    215,   -853,    373,
-      -696,    159,    995,    465,   -509,    109,     60,     10,
-      8455,    198,   -999,  -1131,  -1111,  -1195,  -1246,  -1192,
-     -1181,   -934,   -365,   -764,   -689,   -589,   -734,   2479,
-      -960,   1279,    104,   -209,  -1012,   -824,  -1059,   -921,
-      -812,   -204,    199,    601,   3136,    637,   3021,   3851,
-      -490,    -18,   -930,  -1081,  -1133,  -1182,  -1268,   -980,
-      -864,   -945,   -278,    961,   -514,   -123,    562,    874,
-      -130,    336,   3314,   -331,  -1112,  -1162,  -1227,  -1230,
-     -1172,   -988,   -319,   3582,    890,     50,   -681,   -788,
-      -906,   -876,   -829,   -827,    -41,   3416,   -740,   -913,
-      -893,    404,   2059,   -651,   -474,    302,    516,    578,
-};
-
-static const int16_t fcb22sl[] = {
-      1098,  -1107,  -1125,   -983,   -770,   -233,    201,    823,
-     -1433,  -1294,    -17,  -1156,   -301,   1185,   1307,   1108,
-     -1247,   1829,   1353,   -537,   -457,    116,    574,    712,
-       159,   -489,    511,   -340,     54,    119,    213,    351,
-     -1489,  -1256,  -1324,  -1132,   3710,    262,   1087,   1465,
-     -1434,  -1027,  -1116,    825,   -662,   -428,   -109,   1045,
-       229,    753,   -604,   -422,    122,   -220,    279,    375,
-      -349,   -684,   -197,    490,   -160,   -116,   -120,    146,
-      5195,   -895,   -974,   -758,   -524,     21,    761,   1016,
-     -1216,    151,    864,   -602,   -715,   -591,   -347,    592,
-     -1265,  -1328,  -1375,   -878,   -660,   -549,    143,   4302,
-     -1433,  -1277,    360,  -1032,   -835,   -385,    337,   1111,
-     -1345,  -1250,  -1156,    914,   1594,     22,    912,   1012,
-     -1576,  -1411,  -1364,  -1153,    842,   -184,    240,   1302,
-     -1486,  -1162,   1246,   -880,   -830,     14,   2487,   1607,
-     -1384,   -158,   -572,   -977,     43,    -30,   -184,    572,
-      2759,   -892,   -768,   -522,   -289,    -44,    351,    575,
-     -1292,   -546,   3736,   -609,   -538,    -25,    514,    924,
-      1772,   1639,   -903,   -595,   -263,    340,    579,    670,
-     -1425,    770,  -1179,   -920,  -1158,   -675,    496,   1208,
-     -1337,   1240,  -1030,  -1044,   1840,    312,    809,    908,
-     -1457,   1410,  -1240,  -1083,   -541,    568,   2768,   1432,
-     -1249,   -890,   1078,   1278,   -558,     63,    573,    778,
-     -1285,   1932,  -1004,   -902,   -339,     59,     17,    659,
-     -1352,   -935,   -877,   3421,   -455,    160,    820,   1230,
-     -1326,   -978,    986,   -790,   1541,     41,    542,    743,
-     -1491,  -1162,  -1389,  -1265,   -928,   -139,   5045,   2259,
-     -1182,   1358,   -953,   1338,   -502,    122,    749,    839,
-     -1284,   4389,  -1001,   -813,   -421,     44,    855,   1072,
-      1658,   -881,   -821,   1409,   -299,      4,    453,    700,
-     -1144,  -1112,   1230,   -790,   -421,   1250,    -12,    655,
-      1545,   -872,   1199,   -632,   -365,     56,    415,    663,
-     -1401,  -1189,  -1403,  -1189,  -1145,   -687,   -116,   1120,
-      1768,  -1068,  -1024,   -629,   1440,     88,    578,    711,
-     -1651,  -1561,  -1564,  -1430,  -1037,   1264,    -21,   1944,
-     -1552,  -1336,  -1277,    916,   -412,     27,   2454,   1661,
-      1996,  -1087,  -1223,   -924,   -393,   1673,    794,   1017,
-     -1362,   -132,    151,    537,   -992,   1830,    777,    991,
-     -1591,  -1355,  -1494,  -1420,   -666,   2407,   3210,   2092,
-     -1114,   -624,  -1087,   -903,   -808,   -438,   1881,    654,
-     -1140,    254,   -105,    212,    386,     49,    256,    314,
-        83,     98,  -1128,   -901,   -578,    362,    702,    691,
-      1191,   -204,   -335,   -226,   -102,    -44,     -5,    120,
-        57,  -1110,   -403,   -651,   -806,   -202,    567,    690,
-       349,   -908,  -1075,   -941,   1487,    464,    763,    782,
-       387,  -1070,   -990,   -765,   -295,   1669,    341,    881,
-       232,  -1013,  -1043,    723,   -311,    294,    646,    574,
-        72,  -1191,   -546,   -183,    493,    161,    201,    465,
-      -185,  -1434,  -1368,  -1051,     64,    385,    748,    986,
-      -740,   -530,  -1199,   -562,    142,   1388,   1487,    715,
-     -1359,    873,  -1187,   -923,   -455,   1914,    403,   1016,
-     -1245,  -1223,   -624,   -495,    724,    652,    433,    585,
-     -1499,  -1277,  -1381,  -1148,   1679,   2138,    995,   1424,
-     -1345,  -1319,  -1296,    906,   -228,   1534,    506,   1024,
-     -1628,  -1410,  -1422,  -1197,   1393,    -22,   2728,   1784,
-     -1245,  -1056,   -942,      2,   -165,   -115,    840,    569,
-      1016,  -1191,  -1091,   -862,   -457,     95,   2087,   1029,
-     -1460,  -1486,  -1459,  -1104,   -571,    925,   1234,    935,
-     -1568,    -49,  -1325,  -1255,    -64,    315,    838,    962,
-     -1651,  -1562,  -1606,  -1571,  -1308,   -380,   1988,   2117,
-      -848,   -412,   -987,   -370,   1224,   -304,     10,    498,
-     -1523,  -1348,  -1373,   -959,   -772,   3767,    621,   1773,
-      -931,   -628,    169,   -513,     61,   -306,    994,    476,
-     -1116,   -879,   -875,   -484,   -795,    958,   -162,    444,
-};
-
-static const int16_t fcb22ss[] = {
-      6765,   -638,  -1108,   -977,   -679,   -446,   -325,   -432,
-      -127,     96,   -569,   -621,  -1050,   -841,   -800,   1474,
-      1170,     60,    330,    223,  -1317,    855,    307,   -931,
-      -648,   -549,   -148,    535,    642,    445,   3666,  -1146,
-     -1167,   -944,   -584,    942,   -284,     25,    573,    472,
-     -1041,  -1096,  -1209,  -1082,   -770,   -737,   -139,   2073,
-       753,    832,    507,   -828,  -1112,  -1130,   4284,   -722,
-      -261,    -57,    499,    300,  -1380,  -1130,    135,   -898,
-      -816,   -395,    195,    453,    650,    537,   -953,  -1109,
-     -1221,   -981,   -747,   -647,   2360,    467,    845,    684,
-     -1177,   -792,  -1254,  -1148,   1344,   -745,   -323,    180,
-       729,    739,  -1020,    183,   5226,   -638,   -358,    -86,
-      -268,   -143,     84,   -115,    480,   -543,  -1229,  -1097,
-      -594,   -983,   -792,   -391,   2637,   1405,   -761,   -866,
-     -1186,   -973,   -792,   -640,   -220,   -102,   1165,   3159,
-     -1241,  -1057,  -1322,  -1007,   -731,     44,    264,    668,
-      2645,   1592,   2885,  -1155,  -1347,  -1209,   -309,  -1161,
-      4216,    -64,    830,    616,   -688,   -638,   -596,    202,
-      -665,   -623,   -499,   -248,    512,    749,  -1395,   -708,
-     -1086,   1209,   -745,   -367,   1397,    279,    374,    259,
-     -1357,   -254,   2310,   1839,   -147,     36,   -402,    300,
-       -49,     47,  -1328,   -992,   3453,   -889,   -621,    135,
-       437,     70,    663,    346,  -1339,  -1136,  -1275,   6675,
-     -1309,   2285,   -869,   1154,    640,    617,   -505,  -1042,
-      -984,   -702,   1283,   1573,   -168,    135,    249,    253,
-      -783,  -1119,  -1342,   -975,  -1127,   1391,   -705,   4439,
-      1160,    845,  -1283,  -1224,  -1286,  -1142,  -1019,   -901,
-      -658,   -157,    231,    611,   -994,   -463,  -1017,   1082,
-      1831,   -459,   -164,    114,      0,    108,  -1386,  -1079,
-     -1318,  -1091,   2540,   -717,    762,   1414,    849,    576,
-     -1405,   -566,   2704,   -996,   2133,   -678,    404,    281,
-         4,    -32,  -1474,   3530,   2301,   -711,   -919,   -305,
-      -125,    184,    450,     73,  -1132,   1567,   1620,   -551,
-      -198,   -645,     19,      8,    190,    191,   -741,   -728,
-       410,   1067,   -322,   -239,     86,     11,   -137,   -220,
-      -489,   -607,   -963,   3630,   -624,   -478,    -12,    124,
-       219,     63,   2040,     75,   1338,   -293,   -333,   -336,
-      -330,   -246,   -360,   -344,   -953,   -393,   1550,   -701,
-      -616,   -254,   1908,    211,    328,    -43,  -1089,   -299,
-      1070,   -723,   -923,   2170,   -400,    -13,    -28,    108,
-      -812,   -400,    876,   -650,   1308,   -772,   -256,   -200,
-       117,    329,    649,   -639,    437,   -704,   -567,    -20,
-      -211,    197,    330,    342,   1670,   -468,   -920,   -588,
-       972,   -310,      9,    -46,     70,    -29,  -1313,   1684,
-      -794,   -979,   -752,   1864,   -173,    108,    248,    292,
-     -1247,  -1226,  -1059,    288,   -112,    189,     20,    540,
-       454,    380,  -1035,   -803,   1267,   -767,    746,   1331,
-       107,    317,    158,   -116,   2093,   -723,  -1064,   -906,
-      -713,   -789,   -518,     48,    494,   1018,   1835,  -1353,
-     -1303,  -1098,   -559,    800,    520,    662,    615,    574,
-     -1282,   -526,   1829,  -1086,   -885,   -356,   -539,    -50,
-       493,    402,   -777,   -374,   -754,   1721,   -701,   2086,
-      -348,    218,    138,    109,  -1367,  -1226,  -1041,   1949,
-      -433,   -291,   -363,    567,    613,    560,   1166,   -481,
-      -737,   1193,   -479,   -163,    -69,      2,    133,    239,
-     -1444,  -1448,  -1350,   -987,   -296,    606,    755,    543,
-       741,    806,   -851,   2437,     23,   -681,   -670,   -271,
-      -439,   -227,   -243,   -198,  -1307,    424,  -1212,   -987,
-      -745,   -369,    162,    641,    915,    611,    -24,   -728,
-     -1061,   -659,    808,   -532,   1241,   -233,    266,    353,
-       175,    210,   -262,   -328,    101,   -238,     66,   -339,
-      -472,   -415,    952,  -1490,  -1302,   -955,  -1270,   5776,
-      -792,    777,   1097,    807,  -1334,  -1172,  -1211,   -924,
-      -877,   2458,   -355,    593,    936,    699,   -336,   -700,
-      -762,   -569,   -337,    642,     97,    441,   -188,   -533,
-     -1062,    188,   -873,   -801,    418,   -167,    -57,    -29,
-        79,    241,  -1110,   6430,   -816,   -807,   -462,   -601,
-       -56,    -45,    188,     74,   2869,     43,  -1122,   -799,
-      -772,   -847,   1394,    -36,    294,     13,  -1304,   2155,
-      -534,   1545,   -315,   -325,    183,     31,    372,    187,
-       873,   1376,  -1037,   -810,   -516,   -235,    485,     99,
-       287,    327,  -1074,   1203,  -1089,   -882,   -515,   -544,
-      2041,    -40,    208,    191,    597,  -1141,  -1274,   -885,
-      -386,    106,    593,    394,    671,    678,  -1292,   3861,
-     -1085,  -1150,   -748,   -218,    500,     55,    335,    469,
-      3217,   2888,   -882,   -643,   -590,   -506,     43,   -459,
-      -210,   -222,   -965,   2453,   -830,   -779,   1808,   -588,
-       130,      4,    130,    -23,  -1269,   1374,  -1238,  -1148,
-      -523,   -659,   -170,   -302,   1055,   1389,  -1467,   2505,
-      -930,  -1181,   -842,   -516,    399,    886,    849,    738,
-};
-
-static const int16_t fcb22sm[] = {
-      5761,   -398,   -743,   -948,   -944,   -845,   -883,   -896,
-      -811,   -604,  -1142,  -1388,  -1190,   -685,   -118,   1498,
-      1590,    293,    564,    352,    124,    851,   -131,   -652,
-      -573,   -279,   -756,   -478,    833,    670,   2609,  -1138,
-     -1107,  -1024,   -739,   -646,   -387,     33,    635,   1037,
-      -717,   -990,  -1161,   -948,   -660,   -230,     69,   2510,
-      1274,    841,    -49,   -872,   -764,   -211,   3046,    -30,
-      -143,   -311,   -324,   -413,   -760,     67,    619,   -699,
-      -725,    305,   -484,   1292,    472,   -156,   -568,  -1243,
-     -1256,   -994,   -803,   -386,   1692,    596,   1325,   1290,
-      -492,  -1007,   -732,   -788,   1136,   -610,     45,   1307,
-       420,    649,   -534,  -1075,   -949,   -367,    219,    444,
-      -120,    251,    476,   1806,    902,   -927,  -1151,   -879,
-      -659,   -741,     -5,    298,   1861,    995,   -244,  -1031,
-     -1142,  -1085,   -952,   -773,   -468,     -9,   1637,   3592,
-      -971,  -1150,  -1199,   -985,   -689,   -317,    150,    540,
-      2727,   1678,   -223,   -403,    102,   -902,   -773,   -223,
-      3182,   -457,     75,   -188,   -291,   -428,   -101,   -365,
-      -442,   -336,   -128,    -33,    781,   1242,    501,   -753,
-      -846,    757,   -444,   -311,   1182,      4,     -8,   -122,
-      1866,   -528,   -142,   1598,    -15,   -219,   -557,   -804,
-      -916,   -965,    114,    130,   3672,    -19,   -873,   -280,
-      -777,   -919,   -824,   -654,   1078,     39,    -50,    119,
-      -411,   -311,   -359,    -57,   -137,      7,   -780,   -892,
-      -767,   -167,   1302,   1693,   -205,    -51,   -174,    -71,
-       838,   -220,  -1133,   -993,   -710,   -340,    650,   1341,
-       191,     -5,    743,   -543,   -125,   -567,     70,    -42,
-      -501,   -448,     47,   1151,    400,   -774,   -781,   1324,
-      1089,     32,   -256,   -415,   -352,   -214,    912,  -1141,
-      -988,   -638,   1349,    251,    124,     -4,     89,    -16,
-      -678,   -569,   1502,    146,    114,    816,    -98,   -269,
-      -622,   -808,   -634,   3319,   1218,   -323,   -750,   -548,
-      -525,   -575,   -591,   -730,     35,    764,   1423,    574,
-      -352,   -672,   -802,   -314,   -308,    -29,  -1040,   -717,
-       469,    421,   -527,   -420,    589,    195,    556,    472,
-      -626,   -864,   -133,   3531,   -667,   -460,   -523,    103,
-        23,   -309,   2381,    136,   1197,   -399,   -399,   -501,
-      -638,   -899,   -813,   -707,   -249,    719,    821,   -989,
-      -629,   -568,    642,     -4,    297,     70,  -1105,    454,
-       400,   -235,   -562,   1607,   -116,   -205,      1,   -490,
-         7,   -523,    764,    329,    992,   -240,   -249,   -275,
-      -366,   -265,    662,   -803,    393,   -567,   -501,    -32,
-       178,    371,    126,   -146,   1748,   -516,   -634,   -395,
-       268,    893,    154,    -36,   -620,   -999,    304,   1490,
-      -512,   -821,   -479,   1922,   -610,   -481,   -482,   -805,
-      -996,    -16,   -567,    542,    -22,    589,   -114,     69,
-       322,    358,   -848,   1205,    509,   -527,     25,    111,
-      -243,   -197,    -20,     62,   1500,   -977,   -974,   -391,
-      -555,    448,   -256,     79,    392,    547,   1472,  -1276,
-     -1203,   -987,   -315,    515,    855,    183,    231,     62,
-     -1176,   -397,   2831,   -527,   -575,   -435,    174,   -337,
-       723,    107,   -502,   -765,   -455,   1124,   -218,   1444,
-        53,   -201,   -135,   -267,   -510,  -1058,   -869,   1130,
-      -128,   -394,     16,    873,    597,    455,     16,      0,
-       -11,     14,    -12,      9,      6,    -14,    -11,    -23,
-      -453,  -1056,   -988,   -713,   -267,    794,    954,   1361,
-       822,   -448,    379,   1163,    336,   -724,     55,    109,
-       237,    -80,   -732,  -1017,   -264,    654,  -1043,  -1015,
-      -654,     91,     17,    548,    504,    932,  -1057,  -1151,
-      -964,   -130,   1171,   -146,    740,    134,    790,    539,
-      -591,   -577,   -388,    154,    609,    341,    657,    838,
-      -379,   -872,    711,   -665,   -818,   -549,   -151,   2501,
-       -28,   -189,   -255,   -378,   -363,  -1157,   -929,   -887,
-      -338,   1926,    -33,    -26,   1009,    765,    -79,    -98,
-       -37,   -967,   -566,   1012,    905,   -245,     41,    322,
-       194,   -148,   -220,   -171,   -239,   -242,   -147,    -14,
-       221,    575,   1754,   3059,   -246,   -713,   -696,   -636,
-      -640,   -843,   -841,   -755,   2554,   -504,   -568,   -318,
-      -324,   -171,   -294,   -238,   -288,   -174,   -289,   1273,
-      -231,   1053,   -284,   -338,   -394,   -227,   -303,   -226,
-       966,    742,   -873,   -503,   -586,   -286,    119,    -59,
-       339,    -38,   -843,    977,   -448,   -238,    227,    -77,
-       729,      6,     45,   -493,    277,  -1385,  -1289,   -846,
-      -117,    376,    763,    553,    769,    670,   -652,   3280,
-      -762,   -882,   -396,   -299,    124,   -270,    -31,   -210,
-      2413,    644,   -790,   -912,   -581,   -507,   -110,   -408,
-       -54,    -30,    632,    969,   -632,   -206,    955,    -95,
-      -578,   -337,   -377,   -467,   1264,     67,   -854,   -863,
-      -909,   -751,   -616,   -479,    563,   2070,   -972,   1478,
-      -450,   -715,   -859,   -689,    190,    736,    617,    530,
-};
-
-static const int16_t fcb44sl[] = {
-      2433,   -925,  -1015,  -1009,   -875,   -276,    378,    464,
-       694,    795,  -1044,   -601,   -658,    257,   -898,   -509,
-      -346,   2160,    694,    952,  -1302,   -619,    502,   -378,
-      -624,   -178,    349,   -100,    204,    546,  -1450,  -1127,
-     -1302,  -1297,  -1051,   -840,   3426,   1346,   1577,   1723,
-     -1267,   -710,   -872,    448,  -1023,   -728,   -521,   -134,
-       874,    936,  -1134,   -549,    203,   -932,  -1051,    755,
-      -608,   -199,    858,   1008,   1819,   -842,   -773,   -739,
-       818,   -371,    289,    293,    656,    704,    308,  -1009,
-      -959,  -1089,    466,   -468,    279,    897,    764,    797,
-     -1433,  -1276,  -1253,  -1326,  -1182,   -992,    -85,   4339,
-      2135,   2136,   1131,   -917,   -966,   -859,   -889,   1178,
-        62,    659,    771,    882,   1844,   -607,   1184,   -766,
-      -805,   -385,    -61,    502,    648,    732,  -1245,   1315,
-      -818,   -827,    621,   -588,    193,    480,    649,    776,
-     -1178,  -1202,  -1152,  -1088,   -857,   -191,    -49,    129,
-      1950,   1237,  -1461,  -1290,  -1342,  -1401,  -1338,  -1213,
-      -623,    224,   4086,   2517,  -1150,   -814,   -747,    916,
-       807,   -288,    319,    436,    560,    718,    392,   -973,
-      -988,    411,   -954,   -502,    214,    621,    856,    831,
-     -1268,   4012,   -852,  -1002,  -1014,   -577,     32,    552,
-       987,   1138,  -1205,  -1319,  -1145,   -928,     80,    371,
-       277,    779,    859,    902,  -1141,   -991,   -957,    707,
-      -892,   1098,    126,    381,    668,    870,  -1254,   -995,
-     -1163,   -926,  -1149,   2572,    -17,    747,   1456,   1509,
-     -1004,   -867,   1205,   -797,    938,   -657,    346,    520,
-       782,    872,  -1328,  -1080,  -1111,  -1067,   2227,   -892,
-       665,   1604,   1425,   1477,   1869,   -668,   -712,   1044,
-      -800,   -139,      0,    355,    609,    717,  -1192,   -632,
-      3546,   -780,   -870,   -501,    141,    504,    921,   1027,
-     -1125,  -1087,   1154,   -660,   -987,    937,     82,   1390,
-      1360,   1243,   1259,   -550,   -769,   -787,   -743,   -362,
-       -12,    177,    321,    505,  -1147,   -899,   -947,   -849,
-      1371,   -462,   -127,     16,    752,    954,  -1405,    448,
-     -1181,  -1259,  -1204,   -868,   -468,    110,   1293,   1263,
-     -1267,  -1180,  -1238,   -930,   -940,    916,   1793,    653,
-      1070,   1137,   -216,   -997,   -845,   -659,   -699,   -174,
-       758,    961,    417,    630,  -1123,   1691,   1229,   -732,
-      -937,   -491,    -78,    265,    744,    864,   4771,   -856,
-     -1005,  -1007,   -934,   -484,    -17,    579,    861,    959,
-     -1264,     70,   -961,   -864,   -860,   -302,    314,    788,
-       487,    686,  -1133,   -790,   -466,    561,   -812,   -256,
-      2078,    -58,    757,    953,  -1133,   -286,   -655,   -476,
-       -23,   -629,      7,    182,    426,    504,  -1110,    314,
-       497,   -822,   -662,   -754,   1179,   1726,    696,    955,
-      1793,  -1143,  -1268,  -1279,  -1207,   -873,   -183,   1546,
-      1440,   1305,  -1278,   1396,   -779,    558,   -840,    -32,
-       -18,    257,    616,    757,    265,   -906,    499,   -897,
-      -846,   -435,    362,    434,    752,    732,    453,    150,
-     -1029,  -1182,  -1195,   -940,   -297,    876,   1084,   1051,
-     -1377,   1354,  -1148,  -1313,  -1211,   -937,   -366,   1942,
-      1323,   1410,    311,   -270,    -81,   -159,     42,     42,
-         7,    357,    255,    285,   1973,   1386,   -752,   -873,
-      -916,   -466,    -39,    493,    638,    759,  -1338,   1107,
-     -1081,  -1165,  -1038,   -484,   1722,    534,   1038,   1102,
-     -1446,  -1212,  -1337,  -1452,  -1422,  -1291,   -690,   1634,
-      1348,   1640,  -1044,   -184,   -757,   -683,   -100,   1044,
-       369,    349,    432,    584,  -1137,   -528,   1425,   1294,
-      -842,   -257,    -32,    289,    639,    796,  -1418,  -1229,
-     -1282,  -1391,  -1421,  -1234,   -852,   -765,    737,   2076,
-     -1104,   -928,   -936,  -1088,    378,   -765,   1603,    581,
-       753,    925,  -1191,   -841,   -919,   2886,   -907,   -232,
-       180,    543,    956,   1070,  -1314,   -843,    804,  -1094,
-     -1209,  -1031,   -626,    698,   1049,   1152,    256,    831,
-      -841,   -814,   -841,    -54,    134,    347,    535,    658,
-       104,   -801,   -959,   -519,   -406,    156,     12,     13,
-       380,    494,  -1144,  -1112,   -973,   -965,   -916,   -474,
-      -225,    460,    402,    734,  -1448,  -1316,  -1278,    231,
-     -1086,   -578,    584,   1115,   1275,   1260,  -1321,   -963,
-     -1127,  -1288,     41,  -1102,    -31,   1331,   1003,   1145,
-       112,  -1270,  -1343,  -1376,  -1114,   -778,    392,   1918,
-      1165,   1246,  -1247,   -870,  -1232,  -1147,  -1075,    570,
-       181,   1983,    971,   1216,  -1309,  -1199,    260,  -1136,
-      -950,   -742,   1067,    703,   1150,   1144,  -1405,  -1533,
-     -1564,  -1549,  -1264,   -737,   1085,   1706,   1806,   1785,
-       282,  -1173,  -1128,  -1188,   -971,   -885,   -291,    254,
-       841,    987,   -142,  -1068,  -1264,  -1232,  -1058,    138,
-       546,    521,   1096,    987,    890,   -936,  -1020,  -1051,
-      -871,   -521,   1686,    625,    930,    936,  -1343,   -924,
-     -1231,  -1247,  -1052,   -951,   1110,    125,    826,   1116,
-};
-
-static const int16_t fcb44ss[] = {
-      6575,   -881,  -1291,  -1258,  -1090,   -517,   -268,    -56,
-       106,    295,   -303,  -1134,  -1113,   -650,   -508,   1843,
-      -235,   -141,    454,    832,  -1212,    856,   -404,   -620,
-      -682,   -487,    -69,    865,    341,     95,   3626,  -1037,
-     -1366,  -1349,  -1126,   -558,    187,    343,    657,    765,
-      -410,   -735,  -1046,  -1023,   -897,   -673,   -366,   3174,
-      1264,    720,   -730,   -922,   -523,   -821,   4042,   -463,
-        45,    329,    213,    -93,    301,  -1011,    277,   -840,
-      -820,   -451,    417,    470,    739,    953,  -1219,  -1286,
-     -1545,  -1426,  -1209,   -803,   1156,   1311,   1329,   1329,
-      -643,  -1136,  -1200,   -912,   1221,   -695,    342,    910,
-       905,    812,   -996,   -365,   4868,   -738,   -591,   -621,
-        17,    -42,      0,    100,   2085,  -1214,  -1434,  -1432,
-     -1243,   -577,   -626,    140,   1357,   1821,  -1064,  -1261,
-     -1629,  -1525,  -1488,  -1101,   -631,    551,   3556,   3974,
-      -635,   -846,  -1005,   -646,   -803,    123,   -151,    357,
-      2137,    953,  -1168,  -1055,  -1115,  -1061,   -823,   -651,
-      3842,    606,    491,    491,  -1297,  -1063,   -990,  -1051,
-     -1202,   -983,   -468,    -47,    163,    336,  -1131,   -446,
-      -683,    644,   -660,   -675,   1251,    373,    195,   -123,
-     -1109,   -430,   1820,   1883,   -862,   -743,   -265,    119,
-        66,    -41,  -1281,   -768,   1941,   -955,  -1054,   -856,
-       528,    363,    488,    545,   -936,   -682,   -814,   5534,
-      -826,   -347,     58,    -38,    168,     14,   1224,   -719,
-      -300,   -766,   -407,    630,    269,     39,   -230,   -701,
-      1601,   -958,   -945,   -955,   -734,   -487,    -20,   1392,
-       544,    282,   -118,  -1133,  -1161,  -1065,   -939,   -213,
-      -129,   -271,    451,   2570,   -895,   -805,   -536,   1455,
-      1496,   -647,   -199,    114,     95,    -42,   2230,   -855,
-      -715,   -819,   1762,   -699,    -50,   -109,    163,    207,
-      -334,   -759,   3297,   -645,   2561,     77,   -239,   -259,
-      -275,   -445,  -1304,   3536,   1610,   -526,   -926,   -582,
-       -12,     44,   -180,    -69,   -804,   1107,   1451,   -868,
-      -851,   -589,   -354,    -85,     88,    336,   -537,   -444,
-        40,    231,   -715,   -523,   -351,   -379,   -123,    171,
-      1223,   -328,   -567,   2182,   -291,   -352,     20,   -157,
-      -338,   -635,   2194,   -476,   1624,   -802,   -762,   -585,
-      -245,     48,     63,    -45,    -32,   -646,    847,   -556,
-      -727,   -259,   1309,    239,   -128,   -755,  -1018,   -640,
-       876,   -642,   -906,   1394,    -26,    338,    204,    148,
-      -988,   -521,    135,   -807,   1065,   -525,    -80,   -248,
-       383,    836,    521,     13,   -553,   -865,   -928,   -631,
-      -137,    -83,    446,    221,   1924,     48,   -621,   -845,
-      -782,   -544,   -531,   -418,    -79,    915,   -711,   1247,
-      -938,   -766,   -995,   1459,     31,    199,    261,    190,
-      -670,  -1207,  -1013,    108,   -670,    204,    407,    266,
-       473,    998,   -606,   -923,   1845,  -1061,    910,   -774,
-       268,    493,    178,     61,   1938,  -1237,  -1010,  -1097,
-      -780,   -368,   1125,    354,    398,    550,   1032,  -1128,
-     -1196,   -908,   -767,    529,   2326,    728,    227,    -13,
-     -1113,   -367,    382,   -939,  -1094,   -896,   -463,    446,
-       896,   1128,   -591,   -823,   -894,   3052,   -968,   2157,
-      -153,    -71,    111,    118,  -1106,   -930,   -911,   1663,
-      -905,   -691,   -226,    503,    665,    702,   2067,  -1149,
-      -828,    990,   -850,   -426,   -159,    148,    379,    512,
-     -1268,  -1390,  -1492,  -1343,  -1419,   2246,   -224,   2124,
-      1523,   1338,    522,   1613,   -344,   -694,   -487,   -325,
-       293,     96,   -374,   -679,   -364,    124,  -1201,  -1274,
-     -1078,   -513,     15,   1045,    529,    680,    131,  -1067,
-     -1030,   -888,   -806,   -122,   1002,   1302,    757,   -473,
-      -530,   -538,   -821,   -373,     72,    797,    864,    265,
-      -542,  -1090,   -241,  -1095,  -1205,   -991,  -1172,   5025,
-      -420,    728,    461,    103,   2325,   -915,  -1012,   -854,
-     -1117,   2018,   -377,    -35,    266,    443,   -949,  -1163,
-     -1064,  -1057,   -802,    721,   1278,    470,    308,    263,
-       474,   -773,  -1033,   -892,    227,    -30,     39,    101,
-       456,    476,  -1263,   7275,   -946,  -1157,  -1304,   -922,
-       248,    143,    -98,    312,   3419,   -402,   -649,   -629,
-      -554,    -48,    487,     72,   -171,   -687,  -1167,   1869,
-      -524,   1490,   -869,   -236,    111,     68,     77,    -85,
-      1481,    906,  -1189,  -1321,  -1124,   -554,    429,    321,
-       814,    699,  -1048,    486,   -858,  -1096,  -1072,   -744,
-      1676,    -73,    593,    632,    779,  -1265,  -1470,  -1379,
-     -1050,   -548,    781,    524,   1022,   1079,  -1149,   3719,
-     -1064,  -1180,  -1159,   -775,   -211,    241,    492,    555,
-      3025,   2828,   -849,  -1133,  -1063,   -567,    -70,   -142,
-      -176,    -62,   -614,   1745,   -684,   -610,   1478,   -619,
-      -235,   -361,    -84,    -44,  -1155,   1494,  -1183,  -1210,
-     -1294,  -1017,   -330,    210,    931,   1368,  -1306,   2714,
-     -1052,  -1128,  -1220,   -908,   2409,    441,    310,    318,
-};
-
-static const int16_t fcb44sm[] = {
-      5619,   -163,  -1005,   -856,   -831,   -644,   -612,   -759,
-      -770,   -456,    199,   -551,  -1348,    -80,    131,   -481,
-       334,    202,    366,   1246,  -1245,    499,  -1454,   -396,
-      -675,   -257,    525,   1001,    878,   1075,  -1004,  -1010,
-     -1127,   -947,   -976,    332,   3533,   1315,    265,   -683,
-     -1114,   1056,  -1009,   1154,   -728,   -212,    620,    169,
-       102,   -110,   -658,   -902,  -1238,  -1213,  -1238,   -926,
-      -735,   -455,   1130,   5139,  -1184,    190,   1590,   -604,
-      -800,   -373,   -366,    251,    720,    571,     -6,    304,
-     -1228,   -369,   -659,   -506,    -25,   -234,    313,   2366,
-       623,   1473,   -315,    780,   1048,   -416,   -586,   -737,
-     -1029,  -1094,    483,   -725,   -771,   -379,   -268,    -15,
-       697,   1774,     -1,   -999,   -987,   -867,  -1339,  -1255,
-     -1018,   -652,   -125,    643,   3006,   2417,   -543,   1629,
-      1557,   -684,   -568,   -474,   -132,   -291,   -338,   -321,
-     -1250,    641,   -158,   -935,   -575,   -575,    154,    415,
-       798,   1421,   3147,   1903,   -335,   -767,   -729,   -627,
-      -611,   -752,   -836,   -735,    678,    502,   -946,    556,
-      -821,    -51,   -256,     94,    151,     70,   -808,   -324,
-      -359,   3637,    286,    -90,   -365,   -613,   -782,   -871,
-        75,   1051,   -780,   -487,     47,    273,   1768,   -102,
-      -828,  -1267,  -1093,   1420,   -624,    225,   1307,     85,
-       239,   -152,   -649,   -853,  -1072,   -796,   -644,   1383,
-      1143,   -199,     94,    -25,     70,     52,  -1064,   2487,
-      -844,   -607,   -587,    148,    726,    224,   -238,   -484,
-      -957,   -729,   1517,   1334,   -475,   -317,   -253,   -186,
-         1,     17,   -832,   1450,    423,   1408,   -576,   -825,
-      -630,   -579,   -312,    314,    788,    382,  -1000,  -1060,
-      -763,    968,   -135,     56,    143,    477,   -736,     30,
-      4023,     68,   -266,   -420,   -538,   -751,   -893,   -879,
-      -935,     59,    465,    887,   -351,   1396,    176,   -250,
-      -684,  -1019,   -515,   -815,   -957,   -439,    188,   3794,
-        86,    -98,   -245,   -829,   1894,   -386,   -865,   1513,
-        24,   -506,   -281,   -615,   -476,   -364,  -1283,   -963,
-      -339,   -133,   -161,   -480,     25,    230,   1364,   1815,
-      1766,   -844,  -1423,  -1185,   -972,   -458,   -275,    138,
-      1317,   1778,  -1295,   -874,  -1211,   -792,   -601,   -500,
-      2301,    901,   1336,    842,   1355,   -426,  -1160,   -959,
-      -801,   -433,   1852,    144,    284,    169,  -1122,   -851,
-      -957,    272,   -393,    817,    862,    262,    333,    802,
-       320,   -576,   1615,   -615,   -886,   -311,    108,     13,
-         1,    320,  -1205,    962,   -483,   -791,   -749,   1158,
-       677,    -57,    166,    279,   -860,   1237,   -971,  -1057,
-      -598,   -285,    884,   1174,    657,   -303,   2254,   -706,
-     -1113,   -655,    719,    234,   -124,   -199,   -135,   -360,
-      -758,   -623,   -385,    -18,   3243,    470,   -139,   -286,
-      -520,   -953,  -1193,  -1140,  -1297,  -1137,   -764,     25,
-       235,   2217,   1501,   1369,   2024,    781,  -1353,   -835,
-      -824,   -601,   -259,   -140,    387,    671,      3,   -974,
-      -760,   -884,   -485,    709,   1505,    -95,    321,    739,
-      1610,   -156,   1515,    -76,   -420,   -369,   -189,   -506,
-      -705,   -907,  -1052,   -516,  -1048,   -996,   -471,   1195,
-       212,    184,    800,   1665,    747,  -1029,  -1013,    789,
-      -703,    559,   -139,    -98,    380,    523,   -355,   2047,
-      -766,   -991,   -809,   -566,   -257,   -242,    485,   1322,
-      1989,   -330,   -945,   -559,   -448,   1241,    811,     10,
-      -767,  -1218,   1600,   -755,    428,   -729,   -355,   -665,
-      -416,   -120,    381,    548,   -717,    -14,   1587,   -886,
-        -9,    353,    839,    201,   -454,  -1112,  -1334,   -309,
-       660,   -375,   -661,   -511,   1437,    540,    492,      0,
-        95,   3911,   -237,   -301,   -562,   -483,   -569,   -799,
-      -883,   -580,   -670,   -980,  -1056,   -896,   -797,   1551,
-       267,   1000,   1617,     75,  -1132,   -403,   -988,   -830,
-      -627,   1164,   1315,   1594,    310,   -564,  -1091,   -563,
-      1195,   -442,   1086,   -344,   -176,   -258,    175,    476,
-       923,    -37,   -629,   -919,   1278,   -610,    113,   -314,
-       -81,    192,    731,   -944,  -1297,  -1108,   -934,   -259,
-       640,   1164,   1326,    558,   -767,   -519,   -875,   -930,
-      -817,   -533,    496,   2605,   1359,   -131,  -1010,    912,
-     -1055,   -309,    768,   -198,   -166,    -76,    429,    640,
-      3283,   -895,  -1229,   -853,   -853,   -399,    147,     44,
-       237,    495,   -833,   -909,  -1004,   -811,   1039,   1627,
-      -194,    295,    738,    290,   -771,    237,   -912,   -479,
-      -648,   -518,   -226,    573,   2346,    419,   1013,   1510,
-      -865,   -873,   -982,   -557,    598,     50,     81,    -81,
-     -1150,   -640,  -1011,   1991,   -561,   -140,     42,    175,
-       521,    799,   3231,    -46,  -1004,   -994,  -1140,  -1094,
-      -957,   -860,      8,   2346,    212,   -499,    -55,   -997,
-      -623,   -588,     38,    -58,    975,   1529,   -986,   -891,
-     -1121,   -619,   1967,   -463,     -7,    632,    768,    953,
-};
-
-static const float lsp8[] = {
-     0.2702,  0.5096,  0.6437,  0.7672,  0.9639,  1.0696,  1.2625,  1.5789,
-     1.9285,  2.2383,  2.5129,  2.8470,  0.1740,  0.3677,  0.6082,  0.8387,
-     1.1084,  1.3721,  1.6362,  1.8733,  2.0640,  2.3442,  2.6087,  2.8548,
-     0.1536,  0.3279,  0.5143,  0.6859,  0.9763,  1.2744,  1.5605,  1.8566,
-     2.1007,  2.3450,  2.6075,  2.8850,  0.2075,  0.4533,  0.7709,  1.0377,
-     1.2953,  1.5132,  1.7826,  2.0351,  2.2590,  2.4996,  2.6795,  2.8748,
-     0.1393,  0.2453,  0.3754,  0.5453,  0.8148,  1.1289,  1.4389,  1.7592,
-     2.0353,  2.3215,  2.5934,  2.8588,  0.1250,  0.3627,  0.7613,  1.1380,
-     1.4163,  1.5565,  1.6920,  1.8130,  1.8678,  2.0427,  2.4318,  2.8544,
-     0.2256,  0.4223,  0.6452,  0.8599,  1.0673,  1.3118,  1.5486,  1.8366,
-     2.0759,  2.3026,  2.5284,  2.8030,  0.2304,  0.4404,  0.6891,  0.8964,
-     1.1510,  1.4202,  1.6483,  1.8580,  2.1181,  2.3686,  2.6078,  2.9128,
-     0.2230,  0.3816,  0.5520,  0.6062,  0.7909,  1.0988,  1.4330,  1.7846,
-     2.0713,  2.3457,  2.6048,  2.8708,  0.2447,  0.5800,  0.8249,  0.9905,
-     1.1721,  1.3990,  1.6694,  1.9064,  2.1307,  2.4255,  2.6815,  2.9117,
-     0.1974,  0.3812,  0.5802,  0.7759,  0.9280,  1.1547,  1.4170,  1.6369,
-     1.8890,  2.2587,  2.5626,  2.8239,  0.1209,  0.2510,  0.4841,  0.8048,
-     1.1197,  1.3563,  1.6073,  1.8926,  2.1350,  2.3669,  2.6291,  2.8985,
-     0.2352,  0.4347,  0.6582,  0.8178,  0.9548,  1.1654,  1.4942,  1.8812,
-     2.1703,  2.3779,  2.6412,  2.8871,  0.2091,  0.4084,  0.6730,  0.9151,
-     1.1259,  1.3262,  1.5937,  1.8129,  2.0237,  2.3317,  2.5778,  2.8620,
-     0.1167,  0.2406,  0.4520,  0.7298,  0.9848,  1.2448,  1.5137,  1.7874,
-     2.0280,  2.3020,  2.5914,  2.8794,  0.3003,  0.4966,  0.6520,  0.8505,
-     1.1600,  1.3981,  1.5805,  1.8346,  2.0757,  2.3102,  2.5760,  2.8499,
-     0.2451,  0.4163,  0.5960,  0.7805,  0.9507,  1.2438,  1.5587,  1.8581,
-     2.0735,  2.3198,  2.5704,  2.8220,  0.3112,  0.5517,  0.7032,  0.8528,
-     1.1489,  1.4257,  1.6848,  1.9388,  2.1577,  2.4265,  2.6678,  2.9051,
-     0.2249,  0.3897,  0.5559,  0.7473,  1.0158,  1.3581,  1.6914,  1.9930,
-     2.1843,  2.3534,  2.5512,  2.8065,  0.2600,  0.4574,  0.7349,  0.9691,
-     1.1696,  1.3848,  1.6335,  1.9021,  2.1174,  2.3481,  2.5902,  2.8390,
-     0.2246,  0.3372,  0.4560,  0.5249,  0.7056,  1.0273,  1.3810,  1.7132,
-     1.9819,  2.2574,  2.5410,  2.8491,  0.1419,  0.4834,  0.8835,  1.1453,
-     1.2839,  1.4224,  1.5593,  1.7877,  2.1285,  2.4070,  2.6043,  2.8511,
-     0.1886,  0.3677,  0.5617,  0.8099,  1.1277,  1.3841,  1.5804,  1.8136,
-     2.0307,  2.2805,  2.5399,  2.8322,  0.2351,  0.4151,  0.6675,  0.8713,
-     1.0464,  1.3292,  1.6586,  1.9281,  2.1355,  2.3495,  2.6222,  2.8782,
-     0.2700,  0.4489,  0.6206,  0.7121,  0.7737,  0.9848,  1.3658,  1.7433,
-     2.0139,  2.2243,  2.4806,  2.8175,  0.2479,  0.4425,  0.6490,  0.8745,
-     1.1161,  1.3849,  1.6773,  1.9566,  2.1491,  2.3624,  2.5685,  2.8114,
-     0.2035,  0.3701,  0.5567,  0.7953,  1.0082,  1.2758,  1.5373,  1.7822,
-     2.0175,  2.2601,  2.4759,  2.7771,  0.1856,  0.3461,  0.5998,  0.9041,
-     1.2383,  1.4612,  1.6667,  1.9305,  2.1617,  2.4107,  2.6477,  2.8656,
-     0.2107,  0.3715,  0.5289,  0.6651,  0.8420,  1.1168,  1.4401,  1.7230,
-     1.9901,  2.2687,  2.5452,  2.8655,  0.1218,  0.2999,  0.6348,  0.9482,
-     1.2745,  1.5876,  1.9129,  2.2348,  2.4020,  2.4922,  2.6351,  2.8357,
-     0.1617,  0.3483,  0.5869,  0.8163,  1.0366,  1.2344,  1.4609,  1.7029,
-     1.9476,  2.2337,  2.5258,  2.8442,  0.2505,  0.4894,  0.7510,  0.9152,
-     1.0845,  1.3657,  1.6528,  1.8346,  2.0160,  2.2811,  2.5338,  2.8136,
-     0.0947,  0.1158,  0.0578, -0.0337, -0.0066,  0.0104, -0.0447, -0.0505,
-    -0.0778, -0.0293,  0.0251, -0.0143,  0.0349, -0.0227, -0.0909,  0.0523,
-     0.0325, -0.0410, -0.1045, -0.0899, -0.0009,  0.0075, -0.0575, -0.0855,
-    -0.0129,  0.0575,  0.0597,  0.0391,  0.0371, -0.0184, -0.0083,  0.0287,
-     0.0143,  0.0167,  0.0120, -0.0168,  0.0452,  0.0223, -0.0352,  0.0119,
-    -0.0496, -0.0965, -0.0661, -0.0072,  0.1099,  0.0843, -0.0087, -0.0478,
-    -0.0128, -0.0120, -0.0004,  0.0731,  0.1047,  0.0630,  0.0196, -0.0103,
-    -0.0399, -0.0986, -0.0912, -0.0390, -0.0247, -0.0694, -0.0749, -0.0066,
-     0.0223,  0.0634,  0.0343, -0.0134,  0.0727,  0.0241,  0.0066,  0.0437,
-     0.0610,  0.0364,  0.0248, -0.0358, -0.0686, -0.0104,  0.0426,  0.0088,
-    -0.0137, -0.0165,  0.0671,  0.0815, -0.0863, -0.0644, -0.0088,  0.0023,
-     0.0482,  0.1174,  0.1270,  0.0594,  0.0165,  0.0949,  0.1098,  0.0137,
-     0.4951,  0.4999,  0.4958,  0.4907,  0.4984,  0.4965,  0.4958,  0.4996,
-     0.4987,  0.4958,  0.4986,  0.4977,  0.2841,  0.2186,  0.1474,  0.1687,
-     0.2217,  0.2632,  0.2706,  0.2624,  0.2162,  0.2453,  0.2460,  0.2531,
-};
-
-static const float lsp8s[] = {
-     0.2702,  0.5096,  0.6437,  0.7672,  0.9639,  1.0696,  1.2625,  1.5789,
-     1.9285,  2.2383,  2.5129,  2.8470,  0.1740,  0.3677,  0.6082,  0.8387,
-     1.1084,  1.3721,  1.6362,  1.8733,  2.0640,  2.3442,  2.6087,  2.8548,
-     0.1536,  0.3279,  0.5143,  0.6859,  0.9763,  1.2744,  1.5605,  1.8566,
-     2.1007,  2.3450,  2.6075,  2.8850,  0.2075,  0.4533,  0.7709,  1.0377,
-     1.2953,  1.5132,  1.7826,  2.0351,  2.2590,  2.4996,  2.6795,  2.8748,
-     0.1393,  0.2453,  0.3754,  0.5453,  0.8148,  1.1289,  1.4389,  1.7592,
-     2.0353,  2.3215,  2.5934,  2.8588,  0.1250,  0.3627,  0.7613,  1.1380,
-     1.4163,  1.5565,  1.6920,  1.8130,  1.8678,  2.0427,  2.4318,  2.8544,
-     0.2256,  0.4223,  0.6452,  0.8599,  1.0673,  1.3118,  1.5486,  1.8366,
-     2.0759,  2.3026,  2.5284,  2.8030,  0.2304,  0.4404,  0.6891,  0.8964,
-     1.1510,  1.4202,  1.6483,  1.8580,  2.1181,  2.3686,  2.6078,  2.9128,
-     0.2230,  0.3816,  0.5520,  0.6062,  0.7909,  1.0988,  1.4330,  1.7846,
-     2.0713,  2.3457,  2.6048,  2.8708,  0.2447,  0.5800,  0.8249,  0.9905,
-     1.1721,  1.3990,  1.6694,  1.9064,  2.1307,  2.4255,  2.6815,  2.9117,
-     0.1974,  0.3812,  0.5802,  0.7759,  0.9280,  1.1547,  1.4170,  1.6369,
-     1.8890,  2.2587,  2.5626,  2.8239,  0.1209,  0.2510,  0.4841,  0.8048,
-     1.1197,  1.3563,  1.6073,  1.8926,  2.1350,  2.3669,  2.6291,  2.8985,
-     0.2352,  0.4347,  0.6582,  0.8178,  0.9548,  1.1654,  1.4942,  1.8812,
-     2.1703,  2.3779,  2.6412,  2.8871,  0.2091,  0.4084,  0.6730,  0.9151,
-     1.1259,  1.3262,  1.5937,  1.8129,  2.0237,  2.3317,  2.5778,  2.8620,
-     0.1167,  0.2406,  0.4520,  0.7298,  0.9848,  1.2448,  1.5137,  1.7874,
-     2.0280,  2.3020,  2.5914,  2.8794,  0.3003,  0.4966,  0.6520,  0.8505,
-     1.1600,  1.3981,  1.5805,  1.8346,  2.0757,  2.3102,  2.5760,  2.8499,
-     0.2451,  0.4163,  0.5960,  0.7805,  0.9507,  1.2438,  1.5587,  1.8581,
-     2.0735,  2.3198,  2.5704,  2.8220,  0.3112,  0.5517,  0.7032,  0.8528,
-     1.1489,  1.4257,  1.6848,  1.9388,  2.1577,  2.4265,  2.6678,  2.9051,
-     0.2249,  0.3897,  0.5559,  0.7473,  1.0158,  1.3581,  1.6914,  1.9930,
-     2.1843,  2.3534,  2.5512,  2.8065,  0.2600,  0.4574,  0.7349,  0.9691,
-     1.1696,  1.3848,  1.6335,  1.9021,  2.1174,  2.3481,  2.5902,  2.8390,
-     0.2246,  0.3372,  0.4560,  0.5249,  0.7056,  1.0273,  1.3810,  1.7132,
-     1.9819,  2.2574,  2.5410,  2.8491,  0.1419,  0.4834,  0.8835,  1.1453,
-     1.2839,  1.4224,  1.5593,  1.7877,  2.1285,  2.4070,  2.6043,  2.8511,
-     0.1886,  0.3677,  0.5617,  0.8099,  1.1277,  1.3841,  1.5804,  1.8136,
-     2.0307,  2.2805,  2.5399,  2.8322,  0.2351,  0.4151,  0.6675,  0.8713,
-     1.0464,  1.3292,  1.6586,  1.9281,  2.1355,  2.3495,  2.6222,  2.8782,
-     0.2700,  0.4489,  0.6206,  0.7121,  0.7737,  0.9848,  1.3658,  1.7433,
-     2.0139,  2.2243,  2.4806,  2.8175,  0.2479,  0.4425,  0.6490,  0.8745,
-     1.1161,  1.3849,  1.6773,  1.9566,  2.1491,  2.3624,  2.5685,  2.8114,
-     0.2035,  0.3701,  0.5567,  0.7953,  1.0082,  1.2758,  1.5373,  1.7822,
-     2.0175,  2.2601,  2.4759,  2.7771,  0.1856,  0.3461,  0.5998,  0.9041,
-     1.2383,  1.4612,  1.6667,  1.9305,  2.1617,  2.4107,  2.6477,  2.8656,
-     0.2107,  0.3715,  0.5289,  0.6651,  0.8420,  1.1168,  1.4401,  1.7230,
-     1.9901,  2.2687,  2.5452,  2.8655,  0.1218,  0.2999,  0.6348,  0.9482,
-     1.2745,  1.5876,  1.9129,  2.2348,  2.4020,  2.4922,  2.6351,  2.8357,
-     0.1617,  0.3483,  0.5869,  0.8163,  1.0366,  1.2344,  1.4609,  1.7029,
-     1.9476,  2.2337,  2.5258,  2.8442,  0.2505,  0.4894,  0.7510,  0.9152,
-     1.0845,  1.3657,  1.6528,  1.8346,  2.0160,  2.2811,  2.5338,  2.8136,
-     0.0947,  0.1158,  0.0578, -0.0337, -0.0066,  0.0104, -0.0447, -0.0505,
-    -0.0778, -0.0293,  0.0251, -0.0143,  0.0349, -0.0227, -0.0909,  0.0523,
-     0.0325, -0.0410, -0.1045, -0.0899, -0.0009,  0.0075, -0.0575, -0.0855,
-    -0.0129,  0.0575,  0.0597,  0.0391,  0.0371, -0.0184, -0.0083,  0.0287,
-     0.0143,  0.0167,  0.0120, -0.0168,  0.0452,  0.0223, -0.0352,  0.0119,
-    -0.0496, -0.0965, -0.0661, -0.0072,  0.1099,  0.0843, -0.0087, -0.0478,
-    -0.0128, -0.0120, -0.0004,  0.0731,  0.1047,  0.0630,  0.0196, -0.0103,
-    -0.0399, -0.0986, -0.0912, -0.0390, -0.0247, -0.0694, -0.0749, -0.0066,
-     0.0223,  0.0634,  0.0343, -0.0134,  0.0727,  0.0241,  0.0066,  0.0437,
-     0.0610,  0.0364,  0.0248, -0.0358, -0.0686, -0.0104,  0.0426,  0.0088,
-    -0.0137, -0.0165,  0.0671,  0.0815, -0.0863, -0.0644, -0.0088,  0.0023,
-     0.0482,  0.1174,  0.1270,  0.0594,  0.0165,  0.0949,  0.1098,  0.0137,
-     0.4951,  0.4999,  0.4958,  0.4907,  0.4984,  0.4965,  0.4958,  0.4996,
-     0.4987,  0.4958,  0.4986,  0.4977,  0.2841,  0.2186,  0.1474,  0.1687,
-     0.2217,  0.2632,  0.2706,  0.2624,  0.2162,  0.2453,  0.2460,  0.2531,
-};
-
-static const float lsp11[] = {
-     0.1103,  0.3862,  0.6863,  0.8447,  0.9231,  1.0261,  1.1248,  1.4057,
-     1.6621,  1.8010,  1.8692,  2.0704,  2.3490,  2.6060,  2.7539,  2.8977,
-     0.1273,  0.2407,  0.3812,  0.6004,  0.7767,  0.9383,  1.1344,  1.3351,
-     1.5233,  1.7262,  1.9466,  2.1739,  2.3495,  2.5162,  2.7164,  2.9202,
-     0.2010,  0.3330,  0.4488,  0.6465,  0.8046,  0.9889,  1.1479,  1.2964,
-     1.4770,  1.6606,  1.8789,  2.1155,  2.3287,  2.5199,  2.7101,  2.9119,
-     0.1168,  0.2197,  0.3279,  0.4691,  0.6268,  0.8251,  1.0533,  1.2714,
-     1.4712,  1.6762,  1.8831,  2.1114,  2.3230,  2.5297,  2.7365,  2.9270,
-     0.1405,  0.3109,  0.4986,  0.6891,  0.8634,  1.0583,  1.2594,  1.4349,
-     1.6232,  1.8116,  1.9905,  2.1935,  2.3799,  2.5656,  2.7661,  2.9486,
-     0.1703,  0.3057,  0.4403,  0.5225,  0.5969,  0.8110,  1.0729,  1.3215,
-     1.5407,  1.7381,  1.9477,  2.1680,  2.3586,  2.5612,  2.7630,  2.9410,
-     0.1128,  0.2628,  0.4523,  0.6495,  0.8176,  0.9816,  1.1746,  1.3710,
-     1.5568,  1.7518,  1.9497,  2.1452,  2.3346,  2.5389,  2.7362,  2.9264,
-     0.1809,  0.3287,  0.5205,  0.7264,  0.9298,  1.1217,  1.2970,  1.4894,
-     1.6874,  1.8493,  2.0576,  2.2382,  2.4097,  2.6041,  2.7796,  2.9389,
-     0.2502,  0.4709,  0.6892,  0.8346,  0.9209,  1.0455,  1.2399,  1.4616,
-     1.6463,  1.8380,  2.0475,  2.2397,  2.4665,  2.6550,  2.7701,  2.8895,
-     0.1040,  0.2340,  0.3964,  0.5740,  0.7764,  0.9941,  1.2000,  1.4014,
-     1.6024,  1.7974,  1.9939,  2.1959,  2.3783,  2.5663,  2.7613,  2.9484,
-     0.1912,  0.3393,  0.4743,  0.6313,  0.8014,  0.9879,  1.1855,  1.3922,
-     1.5678,  1.7289,  1.9271,  2.1165,  2.3089,  2.5414,  2.7448,  2.9269,
-     0.0965,  0.2025,  0.3398,  0.4990,  0.6934,  0.9386,  1.1730,  1.3766,
-     1.5783,  1.7783,  1.9790,  2.1831,  2.3670,  2.5578,  2.7641,  2.9516,
-     0.2126,  0.3652,  0.5545,  0.7170,  0.8674,  1.0640,  1.2558,  1.4061,
-     1.5904,  1.8095,  1.9760,  2.1505,  2.3549,  2.5575,  2.7023,  2.8877,
-     0.1827,  0.3426,  0.4894,  0.6488,  0.7960,  0.9535,  1.1217,  1.2798,
-     1.4566,  1.6453,  1.8044,  2.0042,  2.2379,  2.4611,  2.6697,  2.8966,
-     0.2034,  0.3822,  0.5231,  0.6960,  0.9200,  1.0394,  1.1616,  1.3772,
-     1.5493,  1.7330,  1.9646,  2.1233,  2.3334,  2.5361,  2.7087,  2.9470,
-     0.1050,  0.2060,  0.3705,  0.5998,  0.8337,  1.0577,  1.2559,  1.4327,
-     1.6334,  1.8165,  1.9853,  2.2058,  2.4063,  2.5818,  2.7625,  2.9458,
-     0.1419,  0.4053,  0.6660,  0.8911,  1.0405,  1.1547,  1.2506,  1.3926,
-     1.5669,  1.7527,  1.9694,  2.2054,  2.3889,  2.5743,  2.7586,  2.9174,
-     0.1514,  0.2825,  0.4309,  0.5772,  0.7470,  0.9703,  1.1462,  1.3316,
-     1.5321,  1.7259,  1.9282,  2.1266,  2.3106,  2.5064,  2.7067,  2.9094,
-     0.1693,  0.3156,  0.4878,  0.6635,  0.8206,  0.9569,  1.1154,  1.3064,
-     1.5109,  1.7184,  1.9179,  2.1036,  2.2763,  2.4820,  2.6949,  2.9105,
-     0.1432,  0.2718,  0.4241,  0.5564,  0.6939,  0.9011,  1.1582,  1.3948,
-     1.6181,  1.8024,  1.9814,  2.1740,  2.3459,  2.5456,  2.7491,  2.9307,
-     0.2294,  0.3857,  0.5590,  0.7434,  0.9189,  1.0941,  1.2740,  1.4456,
-     1.6178,  1.7994,  1.9689,  2.1644,  2.3525,  2.5385,  2.7468,  2.9405,
-     0.1667,  0.3109,  0.4612,  0.6032,  0.7375,  0.8866,  1.0840,  1.3053,
-     1.4982,  1.7044,  1.9146,  2.1117,  2.2942,  2.4983,  2.7084,  2.9132,
-     0.1810,  0.3205,  0.4696,  0.6231,  0.7641,  0.9959,  1.2427,  1.4361,
-     1.5889,  1.7544,  1.9083,  2.0733,  2.2457,  2.4461,  2.6793,  2.9098,
-     0.1164,  0.3753,  0.6068,  0.7503,  1.0100,  1.2131,  1.3793,  1.5302,
-     1.6300,  1.7950,  1.9057,  2.1031,  2.3830,  2.5745,  2.6949,  2.8779,
-     0.1571,  0.4378,  0.6735,  0.8312,  0.8944,  0.9818,  1.1622,  1.4094,
-     1.6423,  1.8066,  1.9258,  2.1838,  2.4363,  2.6279,  2.7358,  2.8790,
-     0.1398,  0.2686,  0.4248,  0.6156,  0.7870,  1.0035,  1.2012,  1.3689,
-     1.5363,  1.7398,  1.9604,  2.1619,  2.3345,  2.5097,  2.7271,  2.9368,
-     0.1913,  0.3338,  0.4987,  0.6446,  0.7852,  1.0163,  1.1886,  1.3610,
-     1.5379,  1.7230,  1.8880,  2.0862,  2.2960,  2.4928,  2.7122,  2.9151,
-     0.0908,  0.1752,  0.2899,  0.5365,  0.7761,  1.0100,  1.2124,  1.4060,
-     1.6019,  1.8010,  1.9774,  2.1905,  2.3733,  2.5623,  2.7660,  2.9565,
-     0.1773,  0.3179,  0.4925,  0.6864,  0.8452,  0.9897,  1.1860,  1.3722,
-     1.5515,  1.7658,  1.9802,  2.1819,  2.3620,  2.5442,  2.7250,  2.9220,
-     0.1286,  0.2341,  0.3689,  0.5364,  0.7176,  0.9350,  1.1083,  1.2943,
-     1.4974,  1.7059,  1.9047,  2.1145,  2.3242,  2.5361,  2.7453,  2.9329,
-     0.2273,  0.3834,  0.5565,  0.7192,  0.8431,  0.9962,  1.1763,  1.3571,
-     1.5774,  1.7419,  1.9202,  2.1131,  2.2919,  2.4898,  2.6895,  2.9180,
-     0.1775,  0.3058,  0.4274,  0.6023,  0.8151,  1.0734,  1.3211,  1.5178,
-     1.6706,  1.8154,  1.9686,  2.1537,  2.3461,  2.5276,  2.7181,  2.9121,
-     0.1653,  0.4304,  0.6361,  0.7824,  0.9183,  1.0452,  1.2071,  1.4077,
-     1.6206,  1.8299,  2.0089,  2.1948,  2.3900,  2.5982,  2.7844,  2.9487,
-     0.1492,  0.2609,  0.3820,  0.5485,  0.7243,  0.9319,  1.1538,  1.3579,
-     1.5266,  1.7002,  1.8873,  2.1016,  2.3175,  2.5221,  2.7241,  2.9243,
-     0.2074,  0.3781,  0.5209,  0.6869,  0.8577,  0.9875,  1.1849,  1.3568,
-     1.4907,  1.7335,  1.8902,  2.1224,  2.3099,  2.4918,  2.7023,  2.8765,
-     0.1359,  0.2254,  0.3286,  0.4432,  0.6586,  0.8964,  1.1125,  1.3523,
-     1.5626,  1.7579,  1.9846,  2.1905,  2.3548,  2.5542,  2.7663,  2.9346,
-     0.1430,  0.2966,  0.4685,  0.6493,  0.8315,  1.0304,  1.2220,  1.4082,
-     1.5995,  1.7888,  1.9774,  2.1737,  2.3607,  2.5577,  2.7558,  2.9405,
-     0.1477,  0.2694,  0.4056,  0.5626,  0.7051,  0.8647,  1.0491,  1.2488,
-     1.4814,  1.7072,  1.9150,  2.1147,  2.3038,  2.5144,  2.7184,  2.9202,
-     0.1690,  0.3033,  0.4580,  0.6686,  0.8536,  1.0293,  1.2124,  1.3998,
-     1.5718,  1.7607,  1.9580,  2.1245,  2.2971,  2.4762,  2.6896,  2.9177,
-     0.1092,  0.2779,  0.4853,  0.6880,  0.9011,  1.0953,  1.2752,  1.4618,
-     1.6623,  1.8484,  2.0264,  2.2152,  2.4017,  2.5835,  2.7671,  2.9436,
-     0.1497,  0.3637,  0.6014,  0.8032,  0.9963,  1.1835,  1.3741,  1.5698,
-     1.7382,  1.9094,  2.0710,  2.2392,  2.4082,  2.5926,  2.7762,  2.9536,
-     0.1434,  0.2492,  0.3966,  0.5934,  0.8033,  1.0657,  1.2796,  1.4276,
-     1.5745,  1.7833,  1.9288,  2.1247,  2.3543,  2.5412,  2.7049,  2.8872,
-     0.1612,  0.2926,  0.4574,  0.6387,  0.8265,  1.0180,  1.1808,  1.3526,
-     1.5564,  1.7536,  1.9187,  2.1192,  2.3149,  2.5006,  2.7101,  2.9217,
-     0.0828,  0.1863,  0.3235,  0.5050,  0.7250,  0.9867,  1.2093,  1.3941,
-     1.5980,  1.7932,  1.9809,  2.1894,  2.3918,  2.5773,  2.7540,  2.9329,
-     0.2001,  0.3655,  0.5290,  0.6761,  0.8027,  0.9972,  1.2090,  1.4255,
-     1.6085,  1.7825,  1.9804,  2.1681,  2.3457,  2.5325,  2.7319,  2.9196,
-     0.1505,  0.2767,  0.4254,  0.6054,  0.7821,  0.9567,  1.1294,  1.3080,
-     1.4984,  1.6954,  1.8666,  2.0736,  2.2875,  2.4969,  2.7072,  2.9163,
-     0.1589,  0.4151,  0.5749,  0.6651,  0.8061,  1.0470,  1.2616,  1.3690,
-     1.4985,  1.7808,  1.9825,  2.1068,  2.2751,  2.5448,  2.7133,  2.8689,
-     0.0916,  0.1846,  0.3788,  0.6329,  0.8774,  1.0687,  1.2653,  1.4561,
-     1.6573,  1.8449,  2.0402,  2.2254,  2.3968,  2.5861,  2.7792,  2.9508,
-     0.2282,  0.4159,  0.5834,  0.6899,  0.8108,  1.0321,  1.2795,  1.5262,
-     1.6936,  1.8469,  2.0922,  2.2607,  2.3795,  2.5301,  2.7386,  2.9530,
-     0.1651,  0.3004,  0.4555,  0.6179,  0.7891,  0.9584,  1.1372,  1.3707,
-     1.5951,  1.7880,  1.9434,  2.1465,  2.3311,  2.5081,  2.6977,  2.8970,
-     0.1279,  0.3828,  0.6330,  0.8323,  0.9652,  1.1175,  1.2319,  1.3511,
-     1.5115,  1.6392,  1.7835,  1.9558,  2.2008,  2.4635,  2.6910,  2.9058,
-     0.1193,  0.2185,  0.3521,  0.5311,  0.7378,  0.9239,  1.1105,  1.3217,
-     1.5362,  1.7504,  1.9536,  2.1627,  2.3560,  2.5506,  2.7548,  2.9453,
-     0.1806,  0.3432,  0.4981,  0.6948,  0.8928,  1.0527,  1.2467,  1.4140,
-     1.6326,  1.7950,  1.9935,  2.1969,  2.3512,  2.5682,  2.7445,  2.9277,
-     0.1846,  0.3112,  0.4568,  0.5891,  0.7317,  0.8493,  1.0204,  1.2022,
-     1.3688,  1.6020,  1.8428,  2.0710,  2.2725,  2.4879,  2.7057,  2.9160,
-     0.0880,  0.2514,  0.5332,  0.7272,  0.8906,  1.1354,  1.3199,  1.4941,
-     1.6010,  1.7151,  1.8712,  2.0643,  2.2755,  2.5375,  2.7054,  2.8891,
-     0.1382,  0.2833,  0.4658,  0.6897,  0.9071,  1.0716,  1.2469,  1.4143,
-     1.5910,  1.7947,  1.9805,  2.1581,  2.3338,  2.5215,  2.7292,  2.9211,
-     0.1061,  0.3494,  0.6327,  0.8570,  0.9748,  1.0560,  1.1529,  1.3250,
-     1.6032,  1.8340,  1.9711,  2.1157,  2.3011,  2.5464,  2.8078,  2.9803,
-     0.1603,  0.2839,  0.4307,  0.5980,  0.7980,  1.0399,  1.1971,  1.3524,
-     1.5715,  1.7838,  1.9468,  2.1498,  2.3627,  2.5514,  2.7327,  2.9148,
-     0.1691,  0.3117,  0.4796,  0.6895,  0.8732,  1.0164,  1.1916,  1.3707,
-     1.5384,  1.7202,  1.8857,  2.0672,  2.2487,  2.4593,  2.6789,  2.8940,
-     0.0965,  0.1702,  0.3191,  0.5721,  0.8100,  1.0241,  1.2272,  1.4196,
-     1.6093,  1.8057,  1.9884,  2.2037,  2.3925,  2.5805,  2.7578,  2.9366,
-     0.1950,  0.3519,  0.5272,  0.6973,  0.8732,  1.0656,  1.2112,  1.3959,
-     1.6116,  1.7821,  1.9445,  2.1592,  2.3348,  2.5142,  2.7440,  2.9297,
-     0.1388,  0.2557,  0.4120,  0.5727,  0.7354,  0.9196,  1.0985,  1.2805,
-     1.4643,  1.6535,  1.8340,  2.0546,  2.2758,  2.4778,  2.6921,  2.9122,
-     0.1823,  0.3336,  0.4957,  0.6771,  0.8563,  1.0137,  1.2299,  1.3849,
-     1.5718,  1.7667,  1.9193,  2.1326,  2.3135,  2.5268,  2.7133,  2.8998,
-     0.0790,  0.1901,  0.4083,  0.6456,  0.8463,  1.0285,  1.2297,  1.4181,
-     1.6159,  1.8056,  1.9971,  2.1912,  2.3816,  2.5746,  2.7692,  2.9497,
-     0.0049,  0.0116,  0.0045,  0.0039, -0.0010, -0.0122, -0.0205, -0.0034,
-    -0.0140, -0.0041,  0.0191, -0.0322,  0.0002, -0.0124, -0.0269,  0.0059,
-     0.0586,  0.0339, -0.0389, -0.0319, -0.0079, -0.0205, -0.0363, -0.0211,
-     0.0241,  0.0595,  0.0469,  0.0283,  0.0176, -0.0183, -0.0173, -0.0004,
-     0.0024,  0.0145,  0.0534,  0.0197, -0.0065, -0.0067,  0.0133,  0.0358,
-    -0.0104, -0.0386, -0.0109, -0.0078,  0.0275,  0.0565,  0.0251, -0.0027,
-    -0.0053,  0.0171,  0.0088,  0.0495,  0.0141,  0.0039, -0.0445, -0.0426,
-    -0.0184, -0.0280, -0.0223,  0.0039, -0.0171, -0.0606, -0.0786, -0.0430,
-     0.0544,  0.0595,  0.0320, -0.0012,  0.0108,  0.0185,  0.0066,  0.0408,
-     0.0552, -0.0073, -0.0247, -0.0480, -0.0288,  0.0186,  0.0212, -0.0013,
-     0.0403,  0.0598,  0.0690,  0.0516, -0.0298, -0.0177,  0.0278,  0.0168,
-    -0.0106,  0.0251,  0.0386,  0.0331, -0.0052,  0.0133,  0.0291, -0.0158,
-    -0.0329, -0.0367,  0.0287,  0.0462, -0.0176,  0.0049,  0.0242, -0.0034,
-     0.0135,  0.0086, -0.0149,  0.0241,  0.0504,  0.0246, -0.0273, -0.0369,
-    -0.0108, -0.0449, -0.0625, -0.0414, -0.0292, -0.0571, -0.0440, -0.0088,
-     0.0098,  0.0009, -0.0004,  0.0007, -0.0314, -0.0208, -0.0138, -0.0277,
-    -0.0044,  0.0522,  0.0315, -0.0270, -0.0277, -0.0256, -0.0103, -0.0201,
-    -0.0287, -0.0279, -0.0182,  0.0472,  0.0613,  0.0450,  0.0413,  0.0333,
-     0.0444,  0.0223,  0.0061,  0.0316,  0.0321,  0.0501,  0.0460,  0.0250,
-     0.0227,  0.0235,  0.0099,  0.0185, -0.0347, -0.0684, -0.0189,  0.0242,
-    -0.0190, -0.0273, -0.0012, -0.0253,  0.0293, -0.0231, -0.0219, -0.0010,
-     0.0153,  0.0128, -0.0166, -0.0435, -0.0417, -0.0121, -0.0351, -0.0390,
-     0.0077, -0.0278, -0.0355,  0.0092, -0.0063,  0.0005,  0.0216,  0.0461,
-     0.0538,  0.0451,  0.0298, -0.0130,  0.0058,  0.0206,  0.0471,  0.0499,
-     0.0280,  0.0086, -0.0007, -0.0317,  0.0259,  0.0176,  0.0043,  0.0212,
-     0.0138,  0.0106,  0.0220, -0.0025,  0.0050,  0.0122, -0.0051, -0.0086,
-    -0.0472, -0.0005,  0.0193,  0.0032,  0.0246,  0.0222,  0.0090, -0.0320,
-    -0.0713, -0.0526, -0.0151, -0.0440, -0.0648, -0.0466, -0.0092,  0.0115,
-    -0.0129,  0.0053, -0.0344, -0.0385,  0.0392,  0.0599,  0.0414,  0.0165,
-    -0.0098, -0.0320, -0.0261, -0.0055, -0.0139, -0.0110,  0.0084,  0.0172,
-    -0.0492, -0.0537, -0.0320, -0.0036,  0.0265,  0.0385,  0.0064, -0.0280,
-    -0.0230,  0.0134,  0.0241,  0.0106,  0.0387,  0.0105,  0.0068,  0.0260,
-     0.4940,  0.4911,  0.4849,  0.4820,  0.4837,  0.4839,  0.4824,  0.4799,
-     0.4812,  0.4782,  0.4788,  0.4711,  0.4706,  0.4671,  0.4601,  0.4578,
-     0.2954,  0.2121,  0.1859,  0.1958,  0.1474,  0.1086,  0.1351,  0.1362,
-     0.1486,  0.1342,  0.1215,  0.1423,  0.1634,  0.1588,  0.1539,  0.1857,
-};
-
-static const float lsp11s[] = {
-     0.1103,  0.3862,  0.6863,  0.8447,  0.9231,  1.0261,  1.1248,  1.4057,
-     1.6621,  1.8010,  1.8692,  2.0704,  2.3490,  2.6060,  2.7539,  2.8977,
-     0.1273,  0.2407,  0.3812,  0.6004,  0.7767,  0.9383,  1.1344,  1.3351,
-     1.5233,  1.7262,  1.9466,  2.1739,  2.3495,  2.5162,  2.7164,  2.9202,
-     0.2010,  0.3330,  0.4488,  0.6465,  0.8046,  0.9889,  1.1479,  1.2964,
-     1.4770,  1.6606,  1.8789,  2.1155,  2.3287,  2.5199,  2.7101,  2.9119,
-     0.1168,  0.2197,  0.3279,  0.4691,  0.6268,  0.8251,  1.0533,  1.2714,
-     1.4712,  1.6762,  1.8831,  2.1114,  2.3230,  2.5297,  2.7365,  2.9270,
-     0.1405,  0.3109,  0.4986,  0.6891,  0.8634,  1.0583,  1.2594,  1.4349,
-     1.6232,  1.8116,  1.9905,  2.1935,  2.3799,  2.5656,  2.7661,  2.9486,
-     0.1703,  0.3057,  0.4403,  0.5225,  0.5969,  0.8110,  1.0729,  1.3215,
-     1.5407,  1.7381,  1.9477,  2.1680,  2.3586,  2.5612,  2.7630,  2.9410,
-     0.1128,  0.2628,  0.4523,  0.6495,  0.8176,  0.9816,  1.1746,  1.3710,
-     1.5568,  1.7518,  1.9497,  2.1452,  2.3346,  2.5389,  2.7362,  2.9264,
-     0.1809,  0.3287,  0.5205,  0.7264,  0.9298,  1.1217,  1.2970,  1.4894,
-     1.6874,  1.8493,  2.0576,  2.2382,  2.4097,  2.6041,  2.7796,  2.9389,
-     0.2502,  0.4709,  0.6892,  0.8346,  0.9209,  1.0455,  1.2399,  1.4616,
-     1.6463,  1.8380,  2.0475,  2.2397,  2.4665,  2.6550,  2.7701,  2.8895,
-     0.1040,  0.2340,  0.3964,  0.5740,  0.7764,  0.9941,  1.2000,  1.4014,
-     1.6024,  1.7974,  1.9939,  2.1959,  2.3783,  2.5663,  2.7613,  2.9484,
-     0.1912,  0.3393,  0.4743,  0.6313,  0.8014,  0.9879,  1.1855,  1.3922,
-     1.5678,  1.7289,  1.9271,  2.1165,  2.3089,  2.5414,  2.7448,  2.9269,
-     0.0965,  0.2025,  0.3398,  0.4990,  0.6934,  0.9386,  1.1730,  1.3766,
-     1.5783,  1.7783,  1.9790,  2.1831,  2.3670,  2.5578,  2.7641,  2.9516,
-     0.2126,  0.3652,  0.5545,  0.7170,  0.8674,  1.0640,  1.2558,  1.4061,
-     1.5904,  1.8095,  1.9760,  2.1505,  2.3549,  2.5575,  2.7023,  2.8877,
-     0.1827,  0.3426,  0.4894,  0.6488,  0.7960,  0.9535,  1.1217,  1.2798,
-     1.4566,  1.6453,  1.8044,  2.0042,  2.2379,  2.4611,  2.6697,  2.8966,
-     0.2034,  0.3822,  0.5231,  0.6960,  0.9200,  1.0394,  1.1616,  1.3772,
-     1.5493,  1.7330,  1.9646,  2.1233,  2.3334,  2.5361,  2.7087,  2.9470,
-     0.1050,  0.2060,  0.3705,  0.5998,  0.8337,  1.0577,  1.2559,  1.4327,
-     1.6334,  1.8165,  1.9853,  2.2058,  2.4063,  2.5818,  2.7625,  2.9458,
-     0.1419,  0.4053,  0.6660,  0.8911,  1.0405,  1.1547,  1.2506,  1.3926,
-     1.5669,  1.7527,  1.9694,  2.2054,  2.3889,  2.5743,  2.7586,  2.9174,
-     0.1514,  0.2825,  0.4309,  0.5772,  0.7470,  0.9703,  1.1462,  1.3316,
-     1.5321,  1.7259,  1.9282,  2.1266,  2.3106,  2.5064,  2.7067,  2.9094,
-     0.1693,  0.3156,  0.4878,  0.6635,  0.8206,  0.9569,  1.1154,  1.3064,
-     1.5109,  1.7184,  1.9179,  2.1036,  2.2763,  2.4820,  2.6949,  2.9105,
-     0.1432,  0.2718,  0.4241,  0.5564,  0.6939,  0.9011,  1.1582,  1.3948,
-     1.6181,  1.8024,  1.9814,  2.1740,  2.3459,  2.5456,  2.7491,  2.9307,
-     0.2294,  0.3857,  0.5590,  0.7434,  0.9189,  1.0941,  1.2740,  1.4456,
-     1.6178,  1.7994,  1.9689,  2.1644,  2.3525,  2.5385,  2.7468,  2.9405,
-     0.1667,  0.3109,  0.4612,  0.6032,  0.7375,  0.8866,  1.0840,  1.3053,
-     1.4982,  1.7044,  1.9146,  2.1117,  2.2942,  2.4983,  2.7084,  2.9132,
-     0.1810,  0.3205,  0.4696,  0.6231,  0.7641,  0.9959,  1.2427,  1.4361,
-     1.5889,  1.7544,  1.9083,  2.0733,  2.2457,  2.4461,  2.6793,  2.9098,
-     0.1164,  0.3753,  0.6068,  0.7503,  1.0100,  1.2131,  1.3793,  1.5302,
-     1.6300,  1.7950,  1.9057,  2.1031,  2.3830,  2.5745,  2.6949,  2.8779,
-     0.1571,  0.4378,  0.6735,  0.8312,  0.8944,  0.9818,  1.1622,  1.4094,
-     1.6423,  1.8066,  1.9258,  2.1838,  2.4363,  2.6279,  2.7358,  2.8790,
-     0.1398,  0.2686,  0.4248,  0.6156,  0.7870,  1.0035,  1.2012,  1.3689,
-     1.5363,  1.7398,  1.9604,  2.1619,  2.3345,  2.5097,  2.7271,  2.9368,
-     0.1913,  0.3338,  0.4987,  0.6446,  0.7852,  1.0163,  1.1886,  1.3610,
-     1.5379,  1.7230,  1.8880,  2.0862,  2.2960,  2.4928,  2.7122,  2.9151,
-     0.0908,  0.1752,  0.2899,  0.5365,  0.7761,  1.0100,  1.2124,  1.4060,
-     1.6019,  1.8010,  1.9774,  2.1905,  2.3733,  2.5623,  2.7660,  2.9565,
-     0.1773,  0.3179,  0.4925,  0.6864,  0.8452,  0.9897,  1.1860,  1.3722,
-     1.5515,  1.7658,  1.9802,  2.1819,  2.3620,  2.5442,  2.7250,  2.9220,
-     0.1286,  0.2341,  0.3689,  0.5364,  0.7176,  0.9350,  1.1083,  1.2943,
-     1.4974,  1.7059,  1.9047,  2.1145,  2.3242,  2.5361,  2.7453,  2.9329,
-     0.2273,  0.3834,  0.5565,  0.7192,  0.8431,  0.9962,  1.1763,  1.3571,
-     1.5774,  1.7419,  1.9202,  2.1131,  2.2919,  2.4898,  2.6895,  2.9180,
-     0.1775,  0.3058,  0.4274,  0.6023,  0.8151,  1.0734,  1.3211,  1.5178,
-     1.6706,  1.8154,  1.9686,  2.1537,  2.3461,  2.5276,  2.7181,  2.9121,
-     0.1653,  0.4304,  0.6361,  0.7824,  0.9183,  1.0452,  1.2071,  1.4077,
-     1.6206,  1.8299,  2.0089,  2.1948,  2.3900,  2.5982,  2.7844,  2.9487,
-     0.1492,  0.2609,  0.3820,  0.5485,  0.7243,  0.9319,  1.1538,  1.3579,
-     1.5266,  1.7002,  1.8873,  2.1016,  2.3175,  2.5221,  2.7241,  2.9243,
-     0.2074,  0.3781,  0.5209,  0.6869,  0.8577,  0.9875,  1.1849,  1.3568,
-     1.4907,  1.7335,  1.8902,  2.1224,  2.3099,  2.4918,  2.7023,  2.8765,
-     0.1359,  0.2254,  0.3286,  0.4432,  0.6586,  0.8964,  1.1125,  1.3523,
-     1.5626,  1.7579,  1.9846,  2.1905,  2.3548,  2.5542,  2.7663,  2.9346,
-     0.1430,  0.2966,  0.4685,  0.6493,  0.8315,  1.0304,  1.2220,  1.4082,
-     1.5995,  1.7888,  1.9774,  2.1737,  2.3607,  2.5577,  2.7558,  2.9405,
-     0.1477,  0.2694,  0.4056,  0.5626,  0.7051,  0.8647,  1.0491,  1.2488,
-     1.4814,  1.7072,  1.9150,  2.1147,  2.3038,  2.5144,  2.7184,  2.9202,
-     0.1690,  0.3033,  0.4580,  0.6686,  0.8536,  1.0293,  1.2124,  1.3998,
-     1.5718,  1.7607,  1.9580,  2.1245,  2.2971,  2.4762,  2.6896,  2.9177,
-     0.1092,  0.2779,  0.4853,  0.6880,  0.9011,  1.0953,  1.2752,  1.4618,
-     1.6623,  1.8484,  2.0264,  2.2152,  2.4017,  2.5835,  2.7671,  2.9436,
-     0.1497,  0.3637,  0.6014,  0.8032,  0.9963,  1.1835,  1.3741,  1.5698,
-     1.7382,  1.9094,  2.0710,  2.2392,  2.4082,  2.5926,  2.7762,  2.9536,
-     0.1434,  0.2492,  0.3966,  0.5934,  0.8033,  1.0657,  1.2796,  1.4276,
-     1.5745,  1.7833,  1.9288,  2.1247,  2.3543,  2.5412,  2.7049,  2.8872,
-     0.1612,  0.2926,  0.4574,  0.6387,  0.8265,  1.0180,  1.1808,  1.3526,
-     1.5564,  1.7536,  1.9187,  2.1192,  2.3149,  2.5006,  2.7101,  2.9217,
-     0.0828,  0.1863,  0.3235,  0.5050,  0.7250,  0.9867,  1.2093,  1.3941,
-     1.5980,  1.7932,  1.9809,  2.1894,  2.3918,  2.5773,  2.7540,  2.9329,
-     0.2001,  0.3655,  0.5290,  0.6761,  0.8027,  0.9972,  1.2090,  1.4255,
-     1.6085,  1.7825,  1.9804,  2.1681,  2.3457,  2.5325,  2.7319,  2.9196,
-     0.1505,  0.2767,  0.4254,  0.6054,  0.7821,  0.9567,  1.1294,  1.3080,
-     1.4984,  1.6954,  1.8666,  2.0736,  2.2875,  2.4969,  2.7072,  2.9163,
-     0.1589,  0.4151,  0.5749,  0.6651,  0.8061,  1.0470,  1.2616,  1.3690,
-     1.4985,  1.7808,  1.9825,  2.1068,  2.2751,  2.5448,  2.7133,  2.8689,
-     0.0916,  0.1846,  0.3788,  0.6329,  0.8774,  1.0687,  1.2653,  1.4561,
-     1.6573,  1.8449,  2.0402,  2.2254,  2.3968,  2.5861,  2.7792,  2.9508,
-     0.2282,  0.4159,  0.5834,  0.6899,  0.8108,  1.0321,  1.2795,  1.5262,
-     1.6936,  1.8469,  2.0922,  2.2607,  2.3795,  2.5301,  2.7386,  2.9530,
-     0.1651,  0.3004,  0.4555,  0.6179,  0.7891,  0.9584,  1.1372,  1.3707,
-     1.5951,  1.7880,  1.9434,  2.1465,  2.3311,  2.5081,  2.6977,  2.8970,
-     0.1279,  0.3828,  0.6330,  0.8323,  0.9652,  1.1175,  1.2319,  1.3511,
-     1.5115,  1.6392,  1.7835,  1.9558,  2.2008,  2.4635,  2.6910,  2.9058,
-     0.1193,  0.2185,  0.3521,  0.5311,  0.7378,  0.9239,  1.1105,  1.3217,
-     1.5362,  1.7504,  1.9536,  2.1627,  2.3560,  2.5506,  2.7548,  2.9453,
-     0.1806,  0.3432,  0.4981,  0.6948,  0.8928,  1.0527,  1.2467,  1.4140,
-     1.6326,  1.7950,  1.9935,  2.1969,  2.3512,  2.5682,  2.7445,  2.9277,
-     0.1846,  0.3112,  0.4568,  0.5891,  0.7317,  0.8493,  1.0204,  1.2022,
-     1.3688,  1.6020,  1.8428,  2.0710,  2.2725,  2.4879,  2.7057,  2.9160,
-     0.0880,  0.2514,  0.5332,  0.7272,  0.8906,  1.1354,  1.3199,  1.4941,
-     1.6010,  1.7151,  1.8712,  2.0643,  2.2755,  2.5375,  2.7054,  2.8891,
-     0.1382,  0.2833,  0.4658,  0.6897,  0.9071,  1.0716,  1.2469,  1.4143,
-     1.5910,  1.7947,  1.9805,  2.1581,  2.3338,  2.5215,  2.7292,  2.9211,
-     0.1061,  0.3494,  0.6327,  0.8570,  0.9748,  1.0560,  1.1529,  1.3250,
-     1.6032,  1.8340,  1.9711,  2.1157,  2.3011,  2.5464,  2.8078,  2.9803,
-     0.1603,  0.2839,  0.4307,  0.5980,  0.7980,  1.0399,  1.1971,  1.3524,
-     1.5715,  1.7838,  1.9468,  2.1498,  2.3627,  2.5514,  2.7327,  2.9148,
-     0.1691,  0.3117,  0.4796,  0.6895,  0.8732,  1.0164,  1.1916,  1.3707,
-     1.5384,  1.7202,  1.8857,  2.0672,  2.2487,  2.4593,  2.6789,  2.8940,
-     0.0965,  0.1702,  0.3191,  0.5721,  0.8100,  1.0241,  1.2272,  1.4196,
-     1.6093,  1.8057,  1.9884,  2.2037,  2.3925,  2.5805,  2.7578,  2.9366,
-     0.1950,  0.3519,  0.5272,  0.6973,  0.8732,  1.0656,  1.2112,  1.3959,
-     1.6116,  1.7821,  1.9445,  2.1592,  2.3348,  2.5142,  2.7440,  2.9297,
-     0.1388,  0.2557,  0.4120,  0.5727,  0.7354,  0.9196,  1.0985,  1.2805,
-     1.4643,  1.6535,  1.8340,  2.0546,  2.2758,  2.4778,  2.6921,  2.9122,
-     0.1823,  0.3336,  0.4957,  0.6771,  0.8563,  1.0137,  1.2299,  1.3849,
-     1.5718,  1.7667,  1.9193,  2.1326,  2.3135,  2.5268,  2.7133,  2.8998,
-     0.0790,  0.1901,  0.4083,  0.6456,  0.8463,  1.0285,  1.2297,  1.4181,
-     1.6159,  1.8056,  1.9971,  2.1912,  2.3816,  2.5746,  2.7692,  2.9497,
-     0.0049,  0.0116,  0.0045,  0.0039, -0.0010, -0.0122, -0.0205, -0.0034,
-    -0.0140, -0.0041,  0.0191, -0.0322,  0.0002, -0.0124, -0.0269,  0.0059,
-     0.0586,  0.0339, -0.0389, -0.0319, -0.0079, -0.0205, -0.0363, -0.0211,
-     0.0241,  0.0595,  0.0469,  0.0283,  0.0176, -0.0183, -0.0173, -0.0004,
-     0.0024,  0.0145,  0.0534,  0.0197, -0.0065, -0.0067,  0.0133,  0.0358,
-    -0.0104, -0.0386, -0.0109, -0.0078,  0.0275,  0.0565,  0.0251, -0.0027,
-    -0.0053,  0.0171,  0.0088,  0.0495,  0.0141,  0.0039, -0.0445, -0.0426,
-    -0.0184, -0.0280, -0.0223,  0.0039, -0.0171, -0.0606, -0.0786, -0.0430,
-     0.0544,  0.0595,  0.0320, -0.0012,  0.0108,  0.0185,  0.0066,  0.0408,
-     0.0552, -0.0073, -0.0247, -0.0480, -0.0288,  0.0186,  0.0212, -0.0013,
-     0.0403,  0.0598,  0.0690,  0.0516, -0.0298, -0.0177,  0.0278,  0.0168,
-    -0.0106,  0.0251,  0.0386,  0.0331, -0.0052,  0.0133,  0.0291, -0.0158,
-    -0.0329, -0.0367,  0.0287,  0.0462, -0.0176,  0.0049,  0.0242, -0.0034,
-     0.0135,  0.0086, -0.0149,  0.0241,  0.0504,  0.0246, -0.0273, -0.0369,
-    -0.0108, -0.0449, -0.0625, -0.0414, -0.0292, -0.0571, -0.0440, -0.0088,
-     0.0098,  0.0009, -0.0004,  0.0007, -0.0314, -0.0208, -0.0138, -0.0277,
-    -0.0044,  0.0522,  0.0315, -0.0270, -0.0277, -0.0256, -0.0103, -0.0201,
-    -0.0287, -0.0279, -0.0182,  0.0472,  0.0613,  0.0450,  0.0413,  0.0333,
-     0.0444,  0.0223,  0.0061,  0.0316,  0.0321,  0.0501,  0.0460,  0.0250,
-     0.0227,  0.0235,  0.0099,  0.0185, -0.0347, -0.0684, -0.0189,  0.0242,
-    -0.0190, -0.0273, -0.0012, -0.0253,  0.0293, -0.0231, -0.0219, -0.0010,
-     0.0153,  0.0128, -0.0166, -0.0435, -0.0417, -0.0121, -0.0351, -0.0390,
-     0.0077, -0.0278, -0.0355,  0.0092, -0.0063,  0.0005,  0.0216,  0.0461,
-     0.0538,  0.0451,  0.0298, -0.0130,  0.0058,  0.0206,  0.0471,  0.0499,
-     0.0280,  0.0086, -0.0007, -0.0317,  0.0259,  0.0176,  0.0043,  0.0212,
-     0.0138,  0.0106,  0.0220, -0.0025,  0.0050,  0.0122, -0.0051, -0.0086,
-    -0.0472, -0.0005,  0.0193,  0.0032,  0.0246,  0.0222,  0.0090, -0.0320,
-    -0.0713, -0.0526, -0.0151, -0.0440, -0.0648, -0.0466, -0.0092,  0.0115,
-    -0.0129,  0.0053, -0.0344, -0.0385,  0.0392,  0.0599,  0.0414,  0.0165,
-    -0.0098, -0.0320, -0.0261, -0.0055, -0.0139, -0.0110,  0.0084,  0.0172,
-    -0.0492, -0.0537, -0.0320, -0.0036,  0.0265,  0.0385,  0.0064, -0.0280,
-    -0.0230,  0.0134,  0.0241,  0.0106,  0.0387,  0.0105,  0.0068,  0.0260,
-     0.4940,  0.4911,  0.4849,  0.4820,  0.4837,  0.4839,  0.4824,  0.4799,
-     0.4812,  0.4782,  0.4788,  0.4711,  0.4706,  0.4671,  0.4601,  0.4578,
-     0.2954,  0.2121,  0.1859,  0.1958,  0.1474,  0.1086,  0.1351,  0.1362,
-     0.1486,  0.1342,  0.1215,  0.1423,  0.1634,  0.1588,  0.1539,  0.1857,
-};
-
-static const float lsp16[] = {
-     0.1813,  0.3911,  0.6301,  0.8012,  1.0057,  1.2041,  1.4271,  1.6943,
-     1.9402,  2.1733,  2.3521,  2.4989,  2.5839,  2.6846,  2.7634,  2.8950,
-     0.1311,  0.3183,  0.4659,  0.5601,  0.6658,  0.7828,  1.0065,  1.2717,
-     1.5185,  1.7339,  1.9530,  2.2189,  2.3739,  2.4991,  2.6984,  2.9256,
-     0.1627,  0.4519,  0.6323,  0.7012,  0.7848,  0.9801,  1.1810,  1.3222,
-     1.5413,  1.8129,  1.9338,  2.0809,  2.3180,  2.5189,  2.7066,  2.9514,
-     0.1475,  0.2447,  0.4240,  0.5669,  0.7872,  0.9838,  1.1823,  1.3814,
-     1.5358,  1.6820,  1.8794,  2.1419,  2.4132,  2.6112,  2.7911,  2.9511,
-     0.1224,  0.2876,  0.5013,  0.6985,  0.8902,  1.0901,  1.2835,  1.4768,
-     1.6596,  1.8538,  2.0467,  2.2304,  2.4124,  2.5942,  2.7729,  2.9531,
-     0.1741,  0.3034,  0.4677,  0.5879,  0.7258,  0.9648,  1.1417,  1.3220,
-     1.5081,  1.7151,  1.9212,  2.1286,  2.3208,  2.4938,  2.6765,  2.8891,
-     0.1657,  0.3174,  0.4907,  0.6559,  0.8295,  1.0254,  1.2071,  1.3880,
-     1.5737,  1.7845,  1.9027,  2.1139,  2.3323,  2.5157,  2.7323,  2.9015,
-     0.1592,  0.2758,  0.4417,  0.6315,  0.8257,  0.9873,  1.1277,  1.2830,
-     1.4337,  1.6315,  1.8899,  2.1356,  2.3572,  2.5632,  2.7468,  2.9420,
-     0.1524,  0.4325,  0.5931,  0.7036,  0.7696,  0.8923,  1.1739,  1.4773,
-     1.6609,  1.7911,  1.9666,  2.1972,  2.3754,  2.5045,  2.6613,  2.8882,
-     0.2130,  0.3013,  0.3721,  0.4257,  0.5079,  0.7015,  0.9815,  1.2554,
-     1.4648,  1.6966,  1.9138,  2.1075,  2.3318,  2.5292,  2.7453,  2.9347,
-     0.1142,  0.3748,  0.6205,  0.7642,  0.8121,  0.9022,  0.9843,  1.1558,
-     1.4467,  1.7422,  1.9574,  2.1302,  2.3812,  2.5898,  2.7720,  2.9583,
-     0.1255,  0.2339,  0.3570,  0.5323,  0.7458,  1.0003,  1.1729,  1.3567,
-     1.5217,  1.6977,  1.8924,  2.0942,  2.3145,  2.5408,  2.7553,  2.9337,
-     0.1316,  0.2289,  0.4327,  0.6663,  0.8509,  0.9994,  1.1697,  1.3804,
-     1.5609,  1.6903,  1.8572,  2.1019,  2.3687,  2.5789,  2.7715,  2.9472,
-     0.1502,  0.2546,  0.3883,  0.5333,  0.6976,  0.9163,  1.1071,  1.3364,
-     1.5420,  1.7525,  1.8948,  2.0839,  2.2819,  2.4651,  2.6875,  2.8987,
-     0.1593,  0.3014,  0.4573,  0.6354,  0.8157,  0.9805,  1.1783,  1.3747,
-     1.5678,  1.7326,  1.9286,  2.1340,  2.3253,  2.5280,  2.7180,  2.9298,
-     0.1811,  0.3167,  0.4655,  0.6507,  0.8198,  1.0075,  1.1892,  1.3743,
-     1.5227,  1.7090,  1.8849,  2.0743,  2.2750,  2.4830,  2.6896,  2.8953,
-     0.1846,  0.3577,  0.5315,  0.7290,  0.9176,  1.1016,  1.2654,  1.4525,
-     1.6315,  1.8268,  2.0238,  2.1934,  2.3868,  2.5753,  2.7682,  2.9469,
-     0.0876,  0.1439,  0.2048,  0.3654,  0.6281,  0.8853,  1.0907,  1.2992,
-     1.5227,  1.7373,  1.9395,  2.1419,  2.3488,  2.5486,  2.7466,  2.9348,
-     0.1391,  0.4170,  0.6561,  0.7953,  0.8734,  0.9986,  1.1870,  1.4520,
-     1.6042,  1.7910,  2.0135,  2.1870,  2.3358,  2.5066,  2.7409,  2.9955,
-     0.0804,  0.1355,  0.2599,  0.4998,  0.7408,  0.9474,  1.1276,  1.3428,
-     1.5556,  1.7712,  1.9699,  2.1535,  2.3605,  2.5548,  2.7489,  2.9325,
-     0.1304,  0.3087,  0.4979,  0.6584,  0.8414,  1.0329,  1.2244,  1.4189,
-     1.6118,  1.8200,  1.9985,  2.1893,  2.3915,  2.5794,  2.7647,  2.9344,
-     0.1895,  0.2849,  0.3705,  0.4126,  0.6265,  0.9207,  1.1774,  1.3762,
-     1.5757,  1.7728,  1.9568,  2.1662,  2.3615,  2.5575,  2.7561,  2.9416,
-     0.1800,  0.3078,  0.4805,  0.6796,  0.8503,  1.0046,  1.1703,  1.3269,
-     1.4862,  1.6502,  1.8454,  2.0873,  2.3175,  2.5356,  2.7516,  2.9469,
-     0.1950,  0.3233,  0.4568,  0.5940,  0.7589,  0.9978,  1.1701,  1.3383,
-     1.5017,  1.6565,  1.8243,  2.0605,  2.2938,  2.5147,  2.7419,  2.9396,
-     0.2531,  0.4391,  0.5790,  0.7170,  0.8998,  1.1430,  1.3577,  1.5326,
-     1.6328,  1.7627,  1.9726,  2.1762,  2.3563,  2.5478,  2.7385,  2.9067,
-     0.1805,  0.2788,  0.3591,  0.3881,  0.5441,  0.8055,  1.0766,  1.3165,
-     1.5316,  1.7508,  1.9477,  2.1374,  2.3438,  2.5484,  2.7501,  2.9410,
-     0.2044,  0.3671,  0.5396,  0.7042,  0.8582,  0.9831,  1.1261,  1.3194,
-     1.4769,  1.6979,  1.8717,  2.0463,  2.2620,  2.4739,  2.7054,  2.9208,
-     0.1048,  0.2175,  0.4206,  0.5923,  0.7483,  0.9400,  1.1356,  1.3799,
-     1.5958,  1.7320,  1.8984,  2.1296,  2.3594,  2.5492,  2.7387,  2.9305,
-     0.0842,  0.1729,  0.3951,  0.6447,  0.8688,  1.0605,  1.2472,  1.4330,
-     1.6232,  1.8144,  2.0216,  2.1915,  2.3878,  2.5763,  2.7685,  2.9464,
-     0.1461,  0.2593,  0.4105,  0.5677,  0.7328,  0.8919,  1.0484,  1.2302,
-     1.4386,  1.6635,  1.8873,  2.1024,  2.3116,  2.5268,  2.7273,  2.9269,
-     0.1503,  0.3108,  0.4756,  0.6731,  0.8600,  1.0233,  1.2115,  1.3971,
-     1.5915,  1.7892,  1.9517,  2.1603,  2.3487,  2.5460,  2.7308,  2.8998,
-     0.2163,  0.3669,  0.5125,  0.6709,  0.8143,  0.9930,  1.2095,  1.4205,
-     1.6176,  1.7112,  1.8398,  2.0896,  2.3513,  2.5290,  2.6667,  2.8960,
-     0.2133,  0.4382,  0.6287,  0.8702,  1.1088,  1.3749,  1.6062,  1.7446,
-     1.8333,  1.9122,  1.9614,  2.0669,  2.1789,  2.3449,  2.6038,  2.8849,
-     0.1598,  0.2719,  0.3877,  0.4815,  0.5926,  0.7795,  1.0449,  1.3045,
-     1.5210,  1.7391,  1.9462,  2.1397,  2.3553,  2.5458,  2.7540,  2.9392,
-     0.2918,  0.5607,  0.6801,  0.7404,  0.8285,  0.9431,  1.1579,  1.4080,
-     1.6332,  1.8472,  1.9738,  2.0771,  2.2890,  2.5178,  2.7445,  2.9830,
-     0.1664,  0.2842,  0.3965,  0.5463,  0.8162,  1.0346,  1.1849,  1.3446,
-     1.5122,  1.7563,  1.9960,  2.2002,  2.3796,  2.5689,  2.7712,  2.9550,
-     0.0911,  0.2397,  0.5052,  0.7868,  1.0299,  1.1311,  1.2244,  1.3333,
-     1.4395,  1.6790,  1.9369,  2.1717,  2.3689,  2.5538,  2.7340,  2.9326,
-     0.1647,  0.2931,  0.3836,  0.4978,  0.6255,  0.9243,  1.1339,  1.3001,
-     1.5269,  1.8010,  1.9715,  2.1419,  2.3784,  2.5503,  2.6719,  2.8745,
-     0.2440,  0.3802,  0.4756,  0.6613,  0.8627,  1.0292,  1.2291,  1.4060,
-     1.5198,  1.7354,  1.9044,  2.1010,  2.3147,  2.4996,  2.7171,  2.9041,
-     0.1590,  0.2876,  0.4572,  0.5996,  0.7713,  0.9490,  1.1205,  1.2815,
-     1.4516,  1.6385,  1.8179,  2.0457,  2.2759,  2.4785,  2.6861,  2.9080,
-     0.2297,  0.4309,  0.5712,  0.6717,  0.8138,  1.0463,  1.2492,  1.4560,
-     1.6796,  1.8458,  1.9642,  2.1452,  2.3636,  2.5395,  2.7456,  2.9495,
-     0.2975,  0.4678,  0.4996,  0.5809,  0.6279,  0.6884,  0.8606,  1.1386,
-     1.4412,  1.6876,  1.8760,  2.0932,  2.3178,  2.5166,  2.7345,  2.9280,
-     0.1278,  0.3737,  0.6004,  0.7069,  0.8147,  1.0180,  1.2581,  1.3812,
-     1.4855,  1.7268,  1.9970,  2.1258,  2.2936,  2.5702,  2.7563,  2.8983,
-     0.1314,  0.2508,  0.3999,  0.5680,  0.7424,  0.9367,  1.1286,  1.3175,
-     1.5336,  1.7404,  1.9317,  2.1404,  2.3514,  2.5562,  2.7510,  2.9402,
-     0.1043,  0.2367,  0.4293,  0.6376,  0.8160,  0.9836,  1.1779,  1.3850,
-     1.5835,  1.7875,  1.9765,  2.1593,  2.3654,  2.5577,  2.7465,  2.9398,
-     0.1529,  0.2515,  0.3454,  0.4374,  0.7011,  0.9015,  1.0744,  1.3532,
-     1.5699,  1.7545,  2.0021,  2.1259,  2.2278,  2.4546,  2.7264,  2.9425,
-     0.1429,  0.2808,  0.4395,  0.6334,  0.8069,  0.9705,  1.1520,  1.3250,
-     1.5109,  1.7285,  1.9356,  2.1469,  2.3479,  2.5554,  2.7512,  2.9348,
-     0.1625,  0.3022,  0.4756,  0.6315,  0.8032,  0.9924,  1.1596,  1.3204,
-     1.4994,  1.6929,  1.8955,  2.1090,  2.3025,  2.5018,  2.6908,  2.8980,
-     0.1692,  0.3427,  0.5228,  0.7756,  0.9688,  1.0950,  1.3056,  1.4360,
-     1.5675,  1.8049,  1.9376,  2.1151,  2.3407,  2.5012,  2.7192,  2.9258,
-     0.0474,  0.1251,  0.1939,  0.3841,  0.6501,  0.9231,  1.1153,  1.3240,
-     1.5478,  1.7599,  1.9651,  2.1510,  2.3645,  2.5552,  2.7542,  2.9393,
-     0.2196,  0.4656,  0.7492,  0.9922,  1.1678,  1.2489,  1.3112,  1.3657,
-     1.4223,  1.5302,  1.7212,  1.9996,  2.2523,  2.4844,  2.7036,  2.9145,
-     0.1128,  0.2368,  0.3704,  0.5476,  0.7723,  0.9968,  1.1930,  1.3992,
-     1.6013,  1.7957,  1.9888,  2.1857,  2.3825,  2.5705,  2.7616,  2.9434,
-     0.1341,  0.2768,  0.4510,  0.6359,  0.8332,  1.0335,  1.2004,  1.3952,
-     1.5762,  1.7681,  1.9815,  2.1735,  2.3657,  2.5552,  2.7514,  2.9498,
-     0.1247,  0.2559,  0.3516,  0.4726,  0.6861,  0.9483,  1.1852,  1.3858,
-     1.5851,  1.7815,  1.9778,  2.1737,  2.3729,  2.5664,  2.7620,  2.9429,
-     0.1988,  0.3320,  0.4777,  0.6737,  0.8425,  1.0265,  1.1694,  1.3655,
-     1.5463,  1.7135,  1.9385,  2.1650,  2.3529,  2.5367,  2.7545,  2.9585,
-     0.1376,  0.2620,  0.4273,  0.6169,  0.7755,  0.9441,  1.1169,  1.3157,
-     1.5179,  1.7020,  1.8931,  2.1059,  2.3112,  2.5136,  2.7169,  2.9198,
-     0.2112,  0.4385,  0.6091,  0.7618,  0.9553,  1.1543,  1.3445,  1.5396,
-     1.7153,  1.9192,  2.1263,  2.3593,  2.5958,  2.8171,  2.9394,  3.0409,
-     0.1347,  0.2099,  0.2646,  0.3453,  0.5266,  0.7869,  1.0513,  1.2795,
-     1.4880,  1.7181,  1.9294,  2.1332,  2.3362,  2.5442,  2.7433,  2.9362,
-     0.3141,  0.5935,  0.7517,  0.8313,  0.8568,  0.9570,  1.0250,  1.1275,
-     1.3422,  1.6303,  1.8577,  2.0705,  2.2957,  2.5095,  2.7244,  2.9262,
-     0.0962,  0.2116,  0.3961,  0.5641,  0.7122,  0.8883,  1.1023,  1.3481,
-     1.5623,  1.7554,  1.9618,  2.1675,  2.3706,  2.5556,  2.7430,  2.9337,
-     0.0898,  0.1510,  0.3060,  0.5820,  0.8221,  1.0388,  1.2261,  1.4289,
-     1.6054,  1.8103,  1.9941,  2.1844,  2.3742,  2.5711,  2.7632,  2.9474,
-     0.1326,  0.2316,  0.3761,  0.5177,  0.6782,  0.8761,  1.0952,  1.3175,
-     1.5078,  1.7034,  1.9051,  2.1245,  2.3424,  2.5484,  2.7444,  2.9389,
-     0.1740,  0.3293,  0.5174,  0.6824,  0.8394,  1.0372,  1.2046,  1.3723,
-     1.5656,  1.7444,  1.9442,  2.1386,  2.3139,  2.4960,  2.7071,  2.9297,
-     0.2304,  0.3775,  0.4865,  0.6182,  0.7842,  0.9208,  1.1151,  1.2843,
-     1.4641,  1.6988,  1.9209,  2.1260,  2.3099,  2.5229,  2.7414,  2.9276,
-     0.0094,  0.0261, -0.0037,  0.0041, -0.0092, -0.0044, -0.0232, -0.0073,
-    -0.0047, -0.0021,  0.0250, -0.0580, -0.0140, -0.0342, -0.0586,  0.0020,
-     0.0449,  0.0155, -0.0523, -0.0279,  0.0299, -0.0183, -0.0736, -0.0639,
-    -0.0017,  0.0336,  0.0209,  0.0046,  0.0077, -0.0148, -0.0114, -0.0120,
-     0.0115, -0.0050,  0.0445,  0.0048,  0.0188, -0.0137, -0.0080,  0.0239,
-    -0.0184, -0.0524, -0.0195, -0.0126,  0.0284,  0.0632,  0.0141, -0.0093,
-    -0.0096,  0.0196,  0.0230,  0.0379,  0.0308,  0.0237, -0.0224, -0.0600,
-    -0.0755, -0.1074, -0.0988, -0.0606, -0.1038, -0.1552, -0.1480, -0.0672,
-     0.0504,  0.0676,  0.0336, -0.0042,  0.0729,  0.1013,  0.0868,  0.0846,
-     0.0954,  0.0515, -0.0066, -0.0851, -0.0485,  0.0294,  0.0395,  0.0087,
-     0.0078,  0.0446,  0.0881,  0.0672, -0.0384, -0.0025,  0.0415,  0.0353,
-     0.0080,  0.0052,  0.0190,  0.0182,  0.0069,  0.0168,  0.0374,  0.0037,
-    -0.0292, -0.0429,  0.0302,  0.0681, -0.0233, -0.0238, -0.0003, -0.0043,
-     0.0054, -0.0029, -0.0149,  0.0642,  0.0622,  0.0341, -0.0232, -0.0461,
-    -0.0082, -0.0469, -0.0618, -0.0326, -0.0452, -0.0649, -0.0597, -0.0398,
-    -0.0318, -0.0116,  0.0011,  0.0009, -0.0384, -0.0384, -0.0156, -0.0260,
-    -0.0007,  0.0473,  0.0111, -0.0358, -0.0484, -0.0204, -0.0029, -0.0090,
-    -0.0285, -0.0495, -0.0376,  0.0917,  0.1192,  0.1026,  0.0745,  0.0397,
-     0.0463,  0.0253,  0.0025,  0.0465,  0.0100,  0.0488,  0.0416,  0.0223,
-     0.0263,  0.0072, -0.0053,  0.0595,  0.0060, -0.0518, -0.0316, -0.0043,
-    -0.0133, -0.0233, -0.0075, -0.0251,  0.0277, -0.0067, -0.0136, -0.0004,
-     0.0235,  0.0112, -0.0182, -0.0324, -0.0210, -0.0035, -0.0395, -0.0384,
-     0.0005, -0.0150, -0.0356,  0.0127, -0.0033, -0.0034,  0.0205,  0.0747,
-     0.1138,  0.1015,  0.0995, -0.0161, -0.0045,  0.0129,  0.0472,  0.0575,
-     0.0222,  0.0091,  0.0037, -0.0471,  0.0371,  0.0132,  0.0208,  0.0247,
-     0.0117,  0.0164,  0.0225,  0.0124, -0.0023,  0.0088, -0.0046,  0.0047,
-    -0.0393,  0.0018,  0.0148,  0.0020,  0.0044,  0.0165,  0.0229, -0.0208,
-    -0.0477, -0.0310, -0.0164, -0.0390, -0.0764, -0.0525, -0.0094,  0.0075,
-    -0.0102, -0.0045, -0.0504, -0.0709,  0.0822,  0.0710,  0.0426,  0.0014,
-    -0.0371, -0.0400, -0.0157, -0.0155, -0.0173, -0.0138, -0.0015,  0.0134,
-    -0.0418, -0.0682, -0.0256,  0.0050,  0.0360,  0.0354,  0.0074, -0.0396,
-    -0.0235,  0.0284,  0.0494,  0.0153,  0.0448,  0.0025, -0.0061,  0.0252,
-     0.1000,  0.2260,  0.2158,  0.2116,  0.2198,  0.2055,  0.2110,  0.1873,
-     0.1907,  0.2071,  0.2164,  0.2009,  0.2059,  0.2124,  0.2141,  0.2093,
-     0.0875,  0.0981,  0.1177,  0.1071,  0.1033,  0.1248,  0.1048,  0.1238,
-     0.1166,  0.1008,  0.1062,  0.0992,  0.0994,  0.1067,  0.0999,  0.1187,
-     0.0750,  0.0794,  0.0828,  0.0854,  0.0859,  0.0801,  0.0891,  0.0933,
-     0.0969,  0.0920,  0.0915,  0.0862,  0.0868,  0.0891,  0.0842,  0.0824,
-     0.0625,  0.0930,  0.0815,  0.0853,  0.0898,  0.0828,  0.0822,  0.0910,
-     0.0873,  0.0906,  0.0856,  0.0840,  0.0774,  0.0785,  0.0684,  0.0711,
-     0.3319,  0.4219,  0.4588,  0.4090,  0.4092,  0.4014,  0.3548,  0.3353,
-     0.3708,  0.3352,  0.3720,  0.3538,  0.4084,  0.4289,  0.4060,  0.4210,
-     0.0588,  0.0209, -0.0082, -0.0115, -0.0343, -0.0621, -0.0541, -0.0346,
-    -0.0346, -0.0366, -0.0220, -0.0265, -0.0102,  0.0374,  0.0306,  0.0404,
-     0.0306,  0.0090, -0.0054,  0.0333,  0.0047,  0.0238,  0.0141,  0.0165,
-     0.0306,  0.0420,  0.0159,  0.0124,  0.0414,  0.0158, -0.0237,  0.0141,
-     0.0765,  0.0057, -0.0260, -0.0426, -0.0395, -0.0126, -0.0579, -0.0417,
-    -0.0429, -0.0615, -0.0893, -0.0618, -0.0384, -0.0134, -0.0232, -0.0238,
-};
-
-static const float lsp16s[] = {
-     0.1813,  0.3911,  0.6301,  0.8012,  1.0057,  1.2041,  1.4271,  1.6943,
-     1.9402,  2.1733,  2.3521,  2.4989,  2.5839,  2.6846,  2.7634,  2.8950,
-     0.1311,  0.3183,  0.4659,  0.5601,  0.6658,  0.7828,  1.0065,  1.2717,
-     1.5185,  1.7339,  1.9530,  2.2189,  2.3739,  2.4991,  2.6984,  2.9256,
-     0.1627,  0.4519,  0.6323,  0.7012,  0.7848,  0.9801,  1.1810,  1.3222,
-     1.5413,  1.8129,  1.9338,  2.0809,  2.3180,  2.5189,  2.7066,  2.9514,
-     0.1475,  0.2447,  0.4240,  0.5669,  0.7872,  0.9838,  1.1823,  1.3814,
-     1.5358,  1.6820,  1.8794,  2.1419,  2.4132,  2.6112,  2.7911,  2.9511,
-     0.1224,  0.2876,  0.5013,  0.6985,  0.8902,  1.0901,  1.2835,  1.4768,
-     1.6596,  1.8538,  2.0467,  2.2304,  2.4124,  2.5942,  2.7729,  2.9531,
-     0.1741,  0.3034,  0.4677,  0.5879,  0.7258,  0.9648,  1.1417,  1.3220,
-     1.5081,  1.7151,  1.9212,  2.1286,  2.3208,  2.4938,  2.6765,  2.8891,
-     0.1657,  0.3174,  0.4907,  0.6559,  0.8295,  1.0254,  1.2071,  1.3880,
-     1.5737,  1.7845,  1.9027,  2.1139,  2.3323,  2.5157,  2.7323,  2.9015,
-     0.1592,  0.2758,  0.4417,  0.6315,  0.8257,  0.9873,  1.1277,  1.2830,
-     1.4337,  1.6315,  1.8899,  2.1356,  2.3572,  2.5632,  2.7468,  2.9420,
-     0.1524,  0.4325,  0.5931,  0.7036,  0.7696,  0.8923,  1.1739,  1.4773,
-     1.6609,  1.7911,  1.9666,  2.1972,  2.3754,  2.5045,  2.6613,  2.8882,
-     0.2130,  0.3013,  0.3721,  0.4257,  0.5079,  0.7015,  0.9815,  1.2554,
-     1.4648,  1.6966,  1.9138,  2.1075,  2.3318,  2.5292,  2.7453,  2.9347,
-     0.1142,  0.3748,  0.6205,  0.7642,  0.8121,  0.9022,  0.9843,  1.1558,
-     1.4467,  1.7422,  1.9574,  2.1302,  2.3812,  2.5898,  2.7720,  2.9583,
-     0.1255,  0.2339,  0.3570,  0.5323,  0.7458,  1.0003,  1.1729,  1.3567,
-     1.5217,  1.6977,  1.8924,  2.0942,  2.3145,  2.5408,  2.7553,  2.9337,
-     0.1316,  0.2289,  0.4327,  0.6663,  0.8509,  0.9994,  1.1697,  1.3804,
-     1.5609,  1.6903,  1.8572,  2.1019,  2.3687,  2.5789,  2.7715,  2.9472,
-     0.1502,  0.2546,  0.3883,  0.5333,  0.6976,  0.9163,  1.1071,  1.3364,
-     1.5420,  1.7525,  1.8948,  2.0839,  2.2819,  2.4651,  2.6875,  2.8987,
-     0.1593,  0.3014,  0.4573,  0.6354,  0.8157,  0.9805,  1.1783,  1.3747,
-     1.5678,  1.7326,  1.9286,  2.1340,  2.3253,  2.5280,  2.7180,  2.9298,
-     0.1811,  0.3167,  0.4655,  0.6507,  0.8198,  1.0075,  1.1892,  1.3743,
-     1.5227,  1.7090,  1.8849,  2.0743,  2.2750,  2.4830,  2.6896,  2.8953,
-     0.1846,  0.3577,  0.5315,  0.7290,  0.9176,  1.1016,  1.2654,  1.4525,
-     1.6315,  1.8268,  2.0238,  2.1934,  2.3868,  2.5753,  2.7682,  2.9469,
-     0.0876,  0.1439,  0.2048,  0.3654,  0.6281,  0.8853,  1.0907,  1.2992,
-     1.5227,  1.7373,  1.9395,  2.1419,  2.3488,  2.5486,  2.7466,  2.9348,
-     0.1391,  0.4170,  0.6561,  0.7953,  0.8734,  0.9986,  1.1870,  1.4520,
-     1.6042,  1.7910,  2.0135,  2.1870,  2.3358,  2.5066,  2.7409,  2.9955,
-     0.0804,  0.1355,  0.2599,  0.4998,  0.7408,  0.9474,  1.1276,  1.3428,
-     1.5556,  1.7712,  1.9699,  2.1535,  2.3605,  2.5548,  2.7489,  2.9325,
-     0.1304,  0.3087,  0.4979,  0.6584,  0.8414,  1.0329,  1.2244,  1.4189,
-     1.6118,  1.8200,  1.9985,  2.1893,  2.3915,  2.5794,  2.7647,  2.9344,
-     0.1895,  0.2849,  0.3705,  0.4126,  0.6265,  0.9207,  1.1774,  1.3762,
-     1.5757,  1.7728,  1.9568,  2.1662,  2.3615,  2.5575,  2.7561,  2.9416,
-     0.1800,  0.3078,  0.4805,  0.6796,  0.8503,  1.0046,  1.1703,  1.3269,
-     1.4862,  1.6502,  1.8454,  2.0873,  2.3175,  2.5356,  2.7516,  2.9469,
-     0.1950,  0.3233,  0.4568,  0.5940,  0.7589,  0.9978,  1.1701,  1.3383,
-     1.5017,  1.6565,  1.8243,  2.0605,  2.2938,  2.5147,  2.7419,  2.9396,
-     0.2531,  0.4391,  0.5790,  0.7170,  0.8998,  1.1430,  1.3577,  1.5326,
-     1.6328,  1.7627,  1.9726,  2.1762,  2.3563,  2.5478,  2.7385,  2.9067,
-     0.1805,  0.2788,  0.3591,  0.3881,  0.5441,  0.8055,  1.0766,  1.3165,
-     1.5316,  1.7508,  1.9477,  2.1374,  2.3438,  2.5484,  2.7501,  2.9410,
-     0.2044,  0.3671,  0.5396,  0.7042,  0.8582,  0.9831,  1.1261,  1.3194,
-     1.4769,  1.6979,  1.8717,  2.0463,  2.2620,  2.4739,  2.7054,  2.9208,
-     0.1048,  0.2175,  0.4206,  0.5923,  0.7483,  0.9400,  1.1356,  1.3799,
-     1.5958,  1.7320,  1.8984,  2.1296,  2.3594,  2.5492,  2.7387,  2.9305,
-     0.0842,  0.1729,  0.3951,  0.6447,  0.8688,  1.0605,  1.2472,  1.4330,
-     1.6232,  1.8144,  2.0216,  2.1915,  2.3878,  2.5763,  2.7685,  2.9464,
-     0.1461,  0.2593,  0.4105,  0.5677,  0.7328,  0.8919,  1.0484,  1.2302,
-     1.4386,  1.6635,  1.8873,  2.1024,  2.3116,  2.5268,  2.7273,  2.9269,
-     0.1503,  0.3108,  0.4756,  0.6731,  0.8600,  1.0233,  1.2115,  1.3971,
-     1.5915,  1.7892,  1.9517,  2.1603,  2.3487,  2.5460,  2.7308,  2.8998,
-     0.2163,  0.3669,  0.5125,  0.6709,  0.8143,  0.9930,  1.2095,  1.4205,
-     1.6176,  1.7112,  1.8398,  2.0896,  2.3513,  2.5290,  2.6667,  2.8960,
-     0.2133,  0.4382,  0.6287,  0.8702,  1.1088,  1.3749,  1.6062,  1.7446,
-     1.8333,  1.9122,  1.9614,  2.0669,  2.1789,  2.3449,  2.6038,  2.8849,
-     0.1598,  0.2719,  0.3877,  0.4815,  0.5926,  0.7795,  1.0449,  1.3045,
-     1.5210,  1.7391,  1.9462,  2.1397,  2.3553,  2.5458,  2.7540,  2.9392,
-     0.2918,  0.5607,  0.6801,  0.7404,  0.8285,  0.9431,  1.1579,  1.4080,
-     1.6332,  1.8472,  1.9738,  2.0771,  2.2890,  2.5178,  2.7445,  2.9830,
-     0.1664,  0.2842,  0.3965,  0.5463,  0.8162,  1.0346,  1.1849,  1.3446,
-     1.5122,  1.7563,  1.9960,  2.2002,  2.3796,  2.5689,  2.7712,  2.9550,
-     0.0911,  0.2397,  0.5052,  0.7868,  1.0299,  1.1311,  1.2244,  1.3333,
-     1.4395,  1.6790,  1.9369,  2.1717,  2.3689,  2.5538,  2.7340,  2.9326,
-     0.1647,  0.2931,  0.3836,  0.4978,  0.6255,  0.9243,  1.1339,  1.3001,
-     1.5269,  1.8010,  1.9715,  2.1419,  2.3784,  2.5503,  2.6719,  2.8745,
-     0.2440,  0.3802,  0.4756,  0.6613,  0.8627,  1.0292,  1.2291,  1.4060,
-     1.5198,  1.7354,  1.9044,  2.1010,  2.3147,  2.4996,  2.7171,  2.9041,
-     0.1590,  0.2876,  0.4572,  0.5996,  0.7713,  0.9490,  1.1205,  1.2815,
-     1.4516,  1.6385,  1.8179,  2.0457,  2.2759,  2.4785,  2.6861,  2.9080,
-     0.2297,  0.4309,  0.5712,  0.6717,  0.8138,  1.0463,  1.2492,  1.4560,
-     1.6796,  1.8458,  1.9642,  2.1452,  2.3636,  2.5395,  2.7456,  2.9495,
-     0.2975,  0.4678,  0.4996,  0.5809,  0.6279,  0.6884,  0.8606,  1.1386,
-     1.4412,  1.6876,  1.8760,  2.0932,  2.3178,  2.5166,  2.7345,  2.9280,
-     0.1278,  0.3737,  0.6004,  0.7069,  0.8147,  1.0180,  1.2581,  1.3812,
-     1.4855,  1.7268,  1.9970,  2.1258,  2.2936,  2.5702,  2.7563,  2.8983,
-     0.1314,  0.2508,  0.3999,  0.5680,  0.7424,  0.9367,  1.1286,  1.3175,
-     1.5336,  1.7404,  1.9317,  2.1404,  2.3514,  2.5562,  2.7510,  2.9402,
-     0.1043,  0.2367,  0.4293,  0.6376,  0.8160,  0.9836,  1.1779,  1.3850,
-     1.5835,  1.7875,  1.9765,  2.1593,  2.3654,  2.5577,  2.7465,  2.9398,
-     0.1529,  0.2515,  0.3454,  0.4374,  0.7011,  0.9015,  1.0744,  1.3532,
-     1.5699,  1.7545,  2.0021,  2.1259,  2.2278,  2.4546,  2.7264,  2.9425,
-     0.1429,  0.2808,  0.4395,  0.6334,  0.8069,  0.9705,  1.1520,  1.3250,
-     1.5109,  1.7285,  1.9356,  2.1469,  2.3479,  2.5554,  2.7512,  2.9348,
-     0.1625,  0.3022,  0.4756,  0.6315,  0.8032,  0.9924,  1.1596,  1.3204,
-     1.4994,  1.6929,  1.8955,  2.1090,  2.3025,  2.5018,  2.6908,  2.8980,
-     0.1692,  0.3427,  0.5228,  0.7756,  0.9688,  1.0950,  1.3056,  1.4360,
-     1.5675,  1.8049,  1.9376,  2.1151,  2.3407,  2.5012,  2.7192,  2.9258,
-     0.0474,  0.1251,  0.1939,  0.3841,  0.6501,  0.9231,  1.1153,  1.3240,
-     1.5478,  1.7599,  1.9651,  2.1510,  2.3645,  2.5552,  2.7542,  2.9393,
-     0.2196,  0.4656,  0.7492,  0.9922,  1.1678,  1.2489,  1.3112,  1.3657,
-     1.4223,  1.5302,  1.7212,  1.9996,  2.2523,  2.4844,  2.7036,  2.9145,
-     0.1128,  0.2368,  0.3704,  0.5476,  0.7723,  0.9968,  1.1930,  1.3992,
-     1.6013,  1.7957,  1.9888,  2.1857,  2.3825,  2.5705,  2.7616,  2.9434,
-     0.1341,  0.2768,  0.4510,  0.6359,  0.8332,  1.0335,  1.2004,  1.3952,
-     1.5762,  1.7681,  1.9815,  2.1735,  2.3657,  2.5552,  2.7514,  2.9498,
-     0.1247,  0.2559,  0.3516,  0.4726,  0.6861,  0.9483,  1.1852,  1.3858,
-     1.5851,  1.7815,  1.9778,  2.1737,  2.3729,  2.5664,  2.7620,  2.9429,
-     0.1988,  0.3320,  0.4777,  0.6737,  0.8425,  1.0265,  1.1694,  1.3655,
-     1.5463,  1.7135,  1.9385,  2.1650,  2.3529,  2.5367,  2.7545,  2.9585,
-     0.1376,  0.2620,  0.4273,  0.6169,  0.7755,  0.9441,  1.1169,  1.3157,
-     1.5179,  1.7020,  1.8931,  2.1059,  2.3112,  2.5136,  2.7169,  2.9198,
-     0.2112,  0.4385,  0.6091,  0.7618,  0.9553,  1.1543,  1.3445,  1.5396,
-     1.7153,  1.9192,  2.1263,  2.3593,  2.5958,  2.8171,  2.9394,  3.0409,
-     0.1347,  0.2099,  0.2646,  0.3453,  0.5266,  0.7869,  1.0513,  1.2795,
-     1.4880,  1.7181,  1.9294,  2.1332,  2.3362,  2.5442,  2.7433,  2.9362,
-     0.3141,  0.5935,  0.7517,  0.8313,  0.8568,  0.9570,  1.0250,  1.1275,
-     1.3422,  1.6303,  1.8577,  2.0705,  2.2957,  2.5095,  2.7244,  2.9262,
-     0.0962,  0.2116,  0.3961,  0.5641,  0.7122,  0.8883,  1.1023,  1.3481,
-     1.5623,  1.7554,  1.9618,  2.1675,  2.3706,  2.5556,  2.7430,  2.9337,
-     0.0898,  0.1510,  0.3060,  0.5820,  0.8221,  1.0388,  1.2261,  1.4289,
-     1.6054,  1.8103,  1.9941,  2.1844,  2.3742,  2.5711,  2.7632,  2.9474,
-     0.1326,  0.2316,  0.3761,  0.5177,  0.6782,  0.8761,  1.0952,  1.3175,
-     1.5078,  1.7034,  1.9051,  2.1245,  2.3424,  2.5484,  2.7444,  2.9389,
-     0.1740,  0.3293,  0.5174,  0.6824,  0.8394,  1.0372,  1.2046,  1.3723,
-     1.5656,  1.7444,  1.9442,  2.1386,  2.3139,  2.4960,  2.7071,  2.9297,
-     0.2304,  0.3775,  0.4865,  0.6182,  0.7842,  0.9208,  1.1151,  1.2843,
-     1.4641,  1.6988,  1.9209,  2.1260,  2.3099,  2.5229,  2.7414,  2.9276,
-     0.0094,  0.0261, -0.0037,  0.0041, -0.0092, -0.0044, -0.0232, -0.0073,
-    -0.0047, -0.0021,  0.0250, -0.0580, -0.0140, -0.0342, -0.0586,  0.0020,
-     0.0449,  0.0155, -0.0523, -0.0279,  0.0299, -0.0183, -0.0736, -0.0639,
-    -0.0017,  0.0336,  0.0209,  0.0046,  0.0077, -0.0148, -0.0114, -0.0120,
-     0.0115, -0.0050,  0.0445,  0.0048,  0.0188, -0.0137, -0.0080,  0.0239,
-    -0.0184, -0.0524, -0.0195, -0.0126,  0.0284,  0.0632,  0.0141, -0.0093,
-    -0.0096,  0.0196,  0.0230,  0.0379,  0.0308,  0.0237, -0.0224, -0.0600,
-    -0.0755, -0.1074, -0.0988, -0.0606, -0.1038, -0.1552, -0.1480, -0.0672,
-     0.0504,  0.0676,  0.0336, -0.0042,  0.0729,  0.1013,  0.0868,  0.0846,
-     0.0954,  0.0515, -0.0066, -0.0851, -0.0485,  0.0294,  0.0395,  0.0087,
-     0.0078,  0.0446,  0.0881,  0.0672, -0.0384, -0.0025,  0.0415,  0.0353,
-     0.0080,  0.0052,  0.0190,  0.0182,  0.0069,  0.0168,  0.0374,  0.0037,
-    -0.0292, -0.0429,  0.0302,  0.0681, -0.0233, -0.0238, -0.0003, -0.0043,
-     0.0054, -0.0029, -0.0149,  0.0642,  0.0622,  0.0341, -0.0232, -0.0461,
-    -0.0082, -0.0469, -0.0618, -0.0326, -0.0452, -0.0649, -0.0597, -0.0398,
-    -0.0318, -0.0116,  0.0011,  0.0009, -0.0384, -0.0384, -0.0156, -0.0260,
-    -0.0007,  0.0473,  0.0111, -0.0358, -0.0484, -0.0204, -0.0029, -0.0090,
-    -0.0285, -0.0495, -0.0376,  0.0917,  0.1192,  0.1026,  0.0745,  0.0397,
-     0.0463,  0.0253,  0.0025,  0.0465,  0.0100,  0.0488,  0.0416,  0.0223,
-     0.0263,  0.0072, -0.0053,  0.0595,  0.0060, -0.0518, -0.0316, -0.0043,
-    -0.0133, -0.0233, -0.0075, -0.0251,  0.0277, -0.0067, -0.0136, -0.0004,
-     0.0235,  0.0112, -0.0182, -0.0324, -0.0210, -0.0035, -0.0395, -0.0384,
-     0.0005, -0.0150, -0.0356,  0.0127, -0.0033, -0.0034,  0.0205,  0.0747,
-     0.1138,  0.1015,  0.0995, -0.0161, -0.0045,  0.0129,  0.0472,  0.0575,
-     0.0222,  0.0091,  0.0037, -0.0471,  0.0371,  0.0132,  0.0208,  0.0247,
-     0.0117,  0.0164,  0.0225,  0.0124, -0.0023,  0.0088, -0.0046,  0.0047,
-    -0.0393,  0.0018,  0.0148,  0.0020,  0.0044,  0.0165,  0.0229, -0.0208,
-    -0.0477, -0.0310, -0.0164, -0.0390, -0.0764, -0.0525, -0.0094,  0.0075,
-    -0.0102, -0.0045, -0.0504, -0.0709,  0.0822,  0.0710,  0.0426,  0.0014,
-    -0.0371, -0.0400, -0.0157, -0.0155, -0.0173, -0.0138, -0.0015,  0.0134,
-    -0.0418, -0.0682, -0.0256,  0.0050,  0.0360,  0.0354,  0.0074, -0.0396,
-    -0.0235,  0.0284,  0.0494,  0.0153,  0.0448,  0.0025, -0.0061,  0.0252,
-     0.1000,  0.2260,  0.2158,  0.2116,  0.2198,  0.2055,  0.2110,  0.1873,
-     0.1907,  0.2071,  0.2164,  0.2009,  0.2059,  0.2124,  0.2141,  0.2093,
-     0.0875,  0.0981,  0.1177,  0.1071,  0.1033,  0.1248,  0.1048,  0.1238,
-     0.1166,  0.1008,  0.1062,  0.0992,  0.0994,  0.1067,  0.0999,  0.1187,
-     0.0750,  0.0794,  0.0828,  0.0854,  0.0859,  0.0801,  0.0891,  0.0933,
-     0.0969,  0.0920,  0.0915,  0.0862,  0.0868,  0.0891,  0.0842,  0.0824,
-     0.0625,  0.0930,  0.0815,  0.0853,  0.0898,  0.0828,  0.0822,  0.0910,
-     0.0873,  0.0906,  0.0856,  0.0840,  0.0774,  0.0785,  0.0684,  0.0711,
-     0.3319,  0.4219,  0.4588,  0.4090,  0.4092,  0.4014,  0.3548,  0.3353,
-     0.3708,  0.3352,  0.3720,  0.3538,  0.4084,  0.4289,  0.4060,  0.4210,
-     0.0588,  0.0209, -0.0082, -0.0115, -0.0343, -0.0621, -0.0541, -0.0346,
-    -0.0346, -0.0366, -0.0220, -0.0265, -0.0102,  0.0374,  0.0306,  0.0404,
-     0.0306,  0.0090, -0.0054,  0.0333,  0.0047,  0.0238,  0.0141,  0.0165,
-     0.0306,  0.0420,  0.0159,  0.0124,  0.0414,  0.0158, -0.0237,  0.0141,
-     0.0765,  0.0057, -0.0260, -0.0426, -0.0395, -0.0126, -0.0579, -0.0417,
-    -0.0429, -0.0615, -0.0893, -0.0618, -0.0384, -0.0134, -0.0232, -0.0238,
-};
-
-static const float lsp22[] = {
-     0.0664,  0.1875,  0.4300,  0.6730,  0.8793,  1.0640,  1.2563,  1.4433,
-     1.6394,  1.8176,  2.0029,  2.1921,  2.3796,  2.5671,  2.7595,  2.9536,
-     0.2128,  0.4052,  0.5311,  0.6404,  0.7875,  0.8775,  1.0974,  1.3261,
-     1.5563,  1.6790,  1.8339,  2.1195,  2.3226,  2.4609,  2.6440,  2.8947,
-     0.2024,  0.3362,  0.4834,  0.6784,  0.9088,  1.0850,  1.2188,  1.4054,
-     1.6102,  1.7767,  1.9679,  2.1436,  2.3445,  2.5467,  2.7429,  2.9320,
-     0.1181,  0.2279,  0.4413,  0.6114,  0.7710,  0.9427,  1.1142,  1.2707,
-     1.4892,  1.7416,  1.9526,  2.1466,  2.3629,  2.5445,  2.7293,  2.9205,
-     0.1155,  0.2720,  0.4886,  0.6812,  0.8594,  1.0422,  1.2315,  1.4116,
-     1.6137,  1.8020,  1.9758,  2.1743,  2.3602,  2.5568,  2.7472,  2.9374,
-     0.1110,  0.3312,  0.4735,  0.5612,  0.7129,  0.8146,  1.0233,  1.3155,
-     1.5765,  1.7746,  1.9574,  2.1416,  2.3220,  2.5384,  2.7334,  2.9318,
-     0.1656,  0.3350,  0.4215,  0.5609,  0.6759,  0.8503,  1.1405,  1.4094,
-     1.6057,  1.6860,  1.7639,  2.0031,  2.2680,  2.5076,  2.7263,  2.9368,
-     0.1466,  0.3638,  0.4587,  0.5674,  0.7381,  0.8669,  0.9619,  1.1658,
-     1.4667,  1.7440,  1.9335,  2.1018,  2.3022,  2.5281,  2.7359,  2.9261,
-     0.1061,  0.2566,  0.4739,  0.6751,  0.8711,  1.0704,  1.2720,  1.4655,
-     1.6605,  1.8494,  2.0290,  2.2197,  2.4008,  2.5912,  2.7772,  2.9513,
-     0.1116,  0.2364,  0.3971,  0.6316,  0.8583,  1.0335,  1.1686,  1.3302,
-     1.5612,  1.7877,  1.9829,  2.2052,  2.3596,  2.5460,  2.7341,  2.9290,
-     0.2661,  0.4186,  0.5126,  0.6477,  0.8818,  1.1045,  1.2852,  1.4128,
-     1.5851,  1.7593,  1.9399,  2.1757,  2.3684,  2.5136,  2.6927,  2.9064,
-     0.1495,  0.2749,  0.4391,  0.6304,  0.8239,  1.0181,  1.1995,  1.3759,
-     1.5669,  1.7722,  1.9671,  2.1635,  2.3586,  2.5528,  2.7445,  2.9311,
-     0.0912,  0.1759,  0.3066,  0.5660,  0.8005,  0.9568,  1.1832,  1.4504,
-     1.6259,  1.7948,  2.0113,  2.2002,  2.3654,  2.5583,  2.7929,  2.9735,
-     0.1353,  0.2747,  0.4078,  0.5977,  0.7658,  0.9124,  1.1081,  1.3630,
-     1.5875,  1.7847,  1.9323,  2.1181,  2.3321,  2.5046,  2.7183,  2.9225,
-     0.1938,  0.4063,  0.4982,  0.6002,  0.7702,  0.9071,  1.1631,  1.3885,
-     1.6043,  1.8118,  1.9306,  2.0893,  2.2724,  2.4609,  2.6283,  2.8802,
-     0.1857,  0.3351,  0.4381,  0.6101,  0.7561,  0.8555,  1.0384,  1.3171,
-     1.5667,  1.6904,  1.7552,  1.9689,  2.2597,  2.5260,  2.7272,  2.9337,
-     0.1037,  0.2159,  0.4188,  0.6174,  0.8035,  1.0285,  1.2256,  1.4230,
-     1.6400,  1.8322,  2.0144,  2.1988,  2.3810,  2.5682,  2.7613,  2.9438,
-     0.1625,  0.2776,  0.4225,  0.6001,  0.7879,  0.9087,  1.0801,  1.2759,
-     1.4899,  1.7448,  1.9911,  2.1770,  2.3723,  2.5777,  2.7971,  2.9444,
-     0.2111,  0.3640,  0.5839,  0.7290,  0.8051,  1.0023,  1.2315,  1.4143,
-     1.5878,  1.7755,  1.9804,  2.1498,  2.3312,  2.5350,  2.7613,  2.9472,
-     0.1423,  0.2646,  0.4136,  0.6350,  0.8070,  0.9514,  1.1168,  1.3213,
-     1.5776,  1.7721,  1.9404,  2.1545,  2.3385,  2.5137,  2.7396,  2.9553,
-     0.1132,  0.2386,  0.4103,  0.5931,  0.7808,  0.9881,  1.1840,  1.3860,
-     1.6021,  1.7990,  1.9922,  2.1885,  2.3852,  2.5717,  2.7640,  2.9510,
-     0.1267,  0.2602,  0.3913,  0.5944,  0.7598,  0.9198,  1.0781,  1.2715,
-     1.5299,  1.7573,  1.9308,  2.1346,  2.3267,  2.5419,  2.7466,  2.9320,
-     0.2023,  0.3417,  0.4392,  0.6141,  0.7439,  0.8593,  1.1096,  1.3543,
-     1.5185,  1.6553,  1.7862,  2.0341,  2.2718,  2.4834,  2.7103,  2.9466,
-     0.1113,  0.2470,  0.3677,  0.5686,  0.7700,  0.9356,  1.0806,  1.2452,
-     1.4830,  1.7344,  1.9268,  2.1404,  2.3371,  2.5169,  2.7329,  2.9012,
-     0.1664,  0.3554,  0.5573,  0.7471,  0.9245,  1.0998,  1.2787,  1.4655,
-     1.6654,  1.8346,  2.0179,  2.2159,  2.4096,  2.5946,  2.7790,  2.9530,
-     0.1313,  0.2625,  0.4731,  0.6444,  0.8110,  0.9878,  1.1493,  1.3212,
-     1.5719,  1.8138,  1.9861,  2.1943,  2.3714,  2.5578,  2.7346,  2.9296,
-     0.1186,  0.3035,  0.5049,  0.6860,  0.8670,  0.9975,  1.1364,  1.3471,
-     1.5695,  1.7412,  1.9346,  2.1506,  2.3413,  2.5531,  2.7794,  2.9627,
-     0.1108,  0.2697,  0.4787,  0.6344,  0.7909,  0.9586,  1.1440,  1.3511,
-     1.5686,  1.7601,  1.9246,  2.1241,  2.3293,  2.5390,  2.7315,  2.9333,
-     0.0985,  0.2302,  0.3544,  0.5759,  0.7620,  0.9651,  1.1497,  1.3080,
-     1.5500,  1.7845,  1.9518,  2.1734,  2.3565,  2.5665,  2.7605,  2.9102,
-     0.1208,  0.2727,  0.4381,  0.5736,  0.7382,  0.8390,  1.0102,  1.2648,
-     1.5100,  1.7440,  1.9619,  2.1430,  2.3307,  2.5159,  2.7264,  2.9211,
-     0.1582,  0.2777,  0.4475,  0.6551,  0.8591,  1.0084,  1.1414,  1.3291,
-     1.5902,  1.7826,  1.9543,  2.1659,  2.3233,  2.5044,  2.6935,  2.9199,
-     0.1360,  0.2873,  0.4585,  0.6295,  0.7592,  0.9089,  1.0492,  1.2733,
-     1.5391,  1.7768,  1.9372,  2.1329,  2.3168,  2.5015,  2.6857,  2.8837,
-     0.0886,  0.1829,  0.3696,  0.6126,  0.8334,  1.0135,  1.2303,  1.4674,
-     1.6743,  1.8564,  2.0530,  2.2370,  2.3960,  2.5787,  2.7756,  2.9377,
-     0.2005,  0.3537,  0.4700,  0.6249,  0.7385,  0.9097,  1.1759,  1.3811,
-     1.5314,  1.6705,  1.8546,  2.1229,  2.3292,  2.5251,  2.7951,  2.9646,
-     0.1999,  0.3112,  0.4722,  0.7146,  0.8908,  1.0028,  1.1831,  1.3903,
-     1.6125,  1.7514,  1.9083,  2.1248,  2.3271,  2.5339,  2.6945,  2.8918,
-     0.1243,  0.2606,  0.4382,  0.5850,  0.7705,  0.9727,  1.1214,  1.3059,
-     1.5218,  1.7406,  1.9137,  2.1353,  2.3354,  2.5299,  2.7287,  2.9068,
-     0.1039,  0.2426,  0.4265,  0.6284,  0.8152,  0.9941,  1.2004,  1.4038,
-     1.5912,  1.7763,  1.9650,  2.1598,  2.3474,  2.5488,  2.7419,  2.9322,
-     0.1364,  0.2420,  0.3886,  0.5864,  0.7663,  0.8844,  1.0860,  1.3242,
-     1.5518,  1.7893,  2.0004,  2.1562,  2.3619,  2.5516,  2.7687,  2.9181,
-     0.1483,  0.2851,  0.4479,  0.6312,  0.7924,  0.9821,  1.1705,  1.3386,
-     1.5375,  1.7226,  1.9053,  2.0991,  2.2898,  2.4953,  2.7000,  2.9146,
-     0.2332,  0.4561,  0.5407,  0.6212,  0.7524,  0.8215,  0.9522,  1.1685,
-     1.5216,  1.7132,  1.8291,  2.0647,  2.2811,  2.4857,  2.7071,  2.9281,
-     0.1348,  0.3126,  0.5179,  0.7192,  0.9227,  1.1363,  1.3223,  1.4756,
-     1.6509,  1.8191,  1.9991,  2.1976,  2.3877,  2.5768,  2.7590,  2.9386,
-     0.1093,  0.2211,  0.4763,  0.6703,  0.8282,  0.9536,  1.1202,  1.3796,
-     1.6043,  1.8031,  1.9832,  2.1604,  2.3578,  2.5856,  2.7650,  2.9291,
-     0.1865,  0.3027,  0.4580,  0.6719,  0.8400,  1.0082,  1.1901,  1.3782,
-     1.5448,  1.6885,  1.9477,  2.1381,  2.2797,  2.5113,  2.7465,  2.9414,
-     0.1575,  0.3124,  0.4649,  0.6262,  0.8095,  0.9858,  1.1676,  1.3602,
-     1.5646,  1.7582,  1.9550,  2.1671,  2.3628,  2.5734,  2.7670,  2.9519,
-     0.1174,  0.2777,  0.4663,  0.6333,  0.8169,  1.0096,  1.1885,  1.3847,
-     1.5803,  1.7571,  1.9380,  2.1398,  2.3414,  2.5407,  2.7360,  2.9375,
-     0.1073,  0.2264,  0.4083,  0.5973,  0.7474,  0.9514,  1.1349,  1.3337,
-     1.5433,  1.7348,  1.9380,  2.1436,  2.3441,  2.5438,  2.7457,  2.9383,
-     0.1472,  0.2880,  0.4793,  0.6268,  0.8015,  1.0063,  1.1715,  1.3644,
-     1.5525,  1.7410,  1.9258,  2.1227,  2.3214,  2.5149,  2.7148,  2.9196,
-     0.1414,  0.2565,  0.4349,  0.6111,  0.7695,  0.9496,  1.1212,  1.3265,
-     1.5218,  1.7209,  1.9015,  2.0887,  2.3158,  2.5077,  2.7233,  2.9421,
-     0.1252,  0.2667,  0.4454,  0.6431,  0.8371,  1.0124,  1.2110,  1.4160,
-     1.6240,  1.8242,  2.0047,  2.1974,  2.3902,  2.5778,  2.7637,  2.9481,
-     0.1321,  0.2565,  0.3846,  0.5847,  0.7578,  0.9259,  1.0637,  1.2239,
-     1.4690,  1.7346,  1.9750,  2.1882,  2.3712,  2.5509,  2.7280,  2.8885,
-     0.1437,  0.2930,  0.4428,  0.6156,  0.8045,  0.9638,  1.1450,  1.3138,
-     1.5144,  1.7355,  1.9469,  2.1534,  2.3414,  2.5452,  2.7353,  2.9334,
-     0.1692,  0.2770,  0.3831,  0.6100,  0.7825,  0.9302,  1.0690,  1.2481,
-     1.4615,  1.6799,  1.9165,  2.1739,  2.3435,  2.5349,  2.7520,  2.9163,
-     0.1235,  0.2489,  0.4354,  0.6343,  0.8236,  1.0066,  1.1908,  1.3474,
-     1.5656,  1.8275,  2.0620,  2.2548,  2.4135,  2.5913,  2.7639,  2.9334,
-     0.1090,  0.1961,  0.3854,  0.5701,  0.7024,  0.8843,  1.1393,  1.3785,
-     1.5940,  1.7797,  1.9442,  2.1740,  2.3853,  2.5773,  2.7727,  2.9406,
-     0.1560,  0.3477,  0.5011,  0.6287,  0.7612,  0.9896,  1.1510,  1.3420,
-     1.5435,  1.6816,  1.8731,  2.0651,  2.2613,  2.4999,  2.7027,  2.8971,
-     0.1459,  0.2416,  0.3833,  0.5450,  0.7916,  0.9223,  1.0662,  1.1953,
-     1.4029,  1.6616,  1.9320,  2.1459,  2.3386,  2.5081,  2.6799,  2.9195,
-     0.1546,  0.3854,  0.6184,  0.8460,  1.0599,  1.2428,  1.3906,  1.5550,
-     1.7388,  1.8945,  2.0757,  2.2386,  2.4014,  2.5705,  2.7574,  2.9400,
-     0.1080,  0.2307,  0.4112,  0.6067,  0.7725,  0.9467,  1.1285,  1.3205,
-     1.5348,  1.7609,  1.9937,  2.1878,  2.3583,  2.5515,  2.7199,  2.9049,
-     0.1482,  0.3178,  0.4983,  0.6342,  0.7783,  0.9880,  1.2019,  1.3404,
-     1.5223,  1.7296,  1.9211,  2.0943,  2.2928,  2.5008,  2.7136,  2.9224,
-     0.1145,  0.2910,  0.4891,  0.6492,  0.8126,  0.9530,  1.1180,  1.3155,
-     1.5054,  1.6893,  1.8899,  2.1188,  2.3389,  2.5512,  2.7313,  2.9224,
-     0.0939,  0.1689,  0.3250,  0.5792,  0.7698,  0.9245,  1.1574,  1.3865,
-     1.5959,  1.7977,  1.9821,  2.1528,  2.3326,  2.5540,  2.7553,  2.9179,
-     0.1243,  0.2474,  0.3923,  0.6199,  0.7908,  0.9379,  1.1497,  1.3734,
-     1.5582,  1.7420,  1.9539,  2.1385,  2.3240,  2.5277,  2.7311,  2.9178,
-     0.1961,  0.3748,  0.5176,  0.6387,  0.8169,  1.0477,  1.2124,  1.3869,
-     1.5604,  1.7225,  1.8770,  2.0837,  2.2960,  2.5103,  2.6945,  2.8862,
-     0.1295,  0.2403,  0.4149,  0.6189,  0.7913,  0.9130,  1.0832,  1.2787,
-     1.4860,  1.7112,  1.9502,  2.1348,  2.2776,  2.4982,  2.7431,  2.9522,
-     0.0160,  0.0362,  0.0097,  0.0057, -0.0014, -0.0073, -0.0046, -0.0064,
-    -0.0121,  0.0019,  0.0149, -0.0440, -0.0479, -0.0382, -0.0480, -0.0182,
-     0.0170,  0.0114, -0.0298, -0.0175, -0.0033, -0.0354, -0.0510, -0.0025,
-     0.0307,  0.0351,  0.0338,  0.0420,  0.0138, -0.0175, -0.0102,  0.0053,
-     0.0084, -0.0003,  0.0412, -0.0027,  0.0145, -0.0039,  0.0083,  0.0400,
-     0.0001, -0.0262,  0.0055, -0.0082,  0.0348,  0.0433,  0.0137, -0.0024,
-    -0.0055,  0.0262,  0.0521,  0.0349,  0.0185,  0.0076, -0.0319, -0.0561,
-    -0.0460, -0.0253, -0.0097,  0.0163,  0.0184, -0.0037, -0.0480, -0.0371,
-     0.0628,  0.0665,  0.0296, -0.0057,  0.0253,  0.0227,  0.0350,  0.0692,
-     0.0545,  0.0218,  0.0094, -0.0449, -0.0372,  0.0005,  0.0258,  0.0118,
-     0.0285,  0.0760,  0.0822,  0.0527, -0.0299, -0.0049,  0.0170,  0.0195,
-     0.0136,  0.0286,  0.0289,  0.0139,  0.0054,  0.0152,  0.0244,  0.0028,
-    -0.0056, -0.0260,  0.0307,  0.0572, -0.0087,  0.0088,  0.0062,  0.0000,
-     0.0125,  0.0000, -0.0292,  0.0820,  0.0872,  0.0646,  0.0346,  0.0076,
-    -0.0022, -0.0253, -0.0567, -0.0188, -0.0336, -0.0673, -0.0549, -0.0166,
-    -0.0259, -0.0140,  0.0040, -0.0029, -0.0430, -0.0531, -0.0253, -0.0019,
-    -0.0071,  0.0393,  0.0072, -0.0327, -0.0236, -0.0235, -0.0177, -0.0186,
-    -0.0280, -0.0201, -0.0077,  0.0383,  0.0418,  0.0321,  0.0294,  0.0169,
-     0.0468,  0.0301,  0.0133,  0.0363,  0.0516,  0.0937,  0.1240,  0.1404,
-     0.1325,  0.1178,  0.0999,  0.0251, -0.0037, -0.0495, -0.0703, -0.0219,
-    -0.0261, -0.0304, -0.0204, -0.0372,  0.0355,  0.0131, -0.0093, -0.0099,
-    -0.0069, -0.0034, -0.0065, -0.0208, -0.0231, -0.0117, -0.0211, -0.0243,
-     0.0046, -0.0107, -0.0070,  0.0123,  0.0230,  0.0152,  0.0164,  0.0412,
-     0.0619,  0.0858,  0.0862, -0.0056,  0.0125,  0.0182,  0.0347,  0.0388,
-     0.0456,  0.0407, -0.0249, -0.0460,  0.0206,  0.0299,  0.0253,  0.0207,
-     0.0177,  0.0238,  0.0253,  0.0030,  0.0042,  0.0020, -0.0081, -0.0136,
-    -0.0290, -0.0042,  0.0122,  0.0051,  0.0107,  0.0228,  0.0211, -0.0068,
-    -0.0436, -0.0299, -0.0078, -0.0779, -0.1157, -0.0679,  0.0172,  0.0150,
-    -0.0051,  0.0081, -0.0512, -0.0616,  0.0576,  0.0799,  0.0803,  0.0336,
-     0.0001, -0.0298, -0.0747, -0.0115, -0.0101, -0.0170, -0.0050,  0.0174,
-    -0.0290, -0.0601, -0.0150,  0.0121,  0.0165,  0.0230,  0.0028, -0.0317,
-    -0.0165,  0.0356,  0.0451,  0.0120,  0.0321,  0.0084, -0.0058,  0.0122,
-     0.1935,  0.1802,  0.2195,  0.2410,  0.2201,  0.1915,  0.1840,  0.1935,
-     0.2213,  0.2079,  0.1858,  0.1974,  0.2239,  0.2173,  0.1840,  0.2120,
-     0.4912,  0.4777,  0.4607,  0.4395,  0.4426,  0.4388,  0.4416,  0.4345,
-     0.4239,  0.4331,  0.4522,  0.4423,  0.4475,  0.4387,  0.4525,  0.4446,
-};
-
-static const float lsp22s[] = {
-     0.0664,  0.1875,  0.4300,  0.6730,  0.8793,  1.0640,  1.2563,  1.4433,
-     1.6394,  1.8176,  2.0029,  2.1921,  2.3796,  2.5671,  2.7595,  2.9536,
-     0.2128,  0.4052,  0.5311,  0.6404,  0.7875,  0.8775,  1.0974,  1.3261,
-     1.5563,  1.6790,  1.8339,  2.1195,  2.3226,  2.4609,  2.6440,  2.8947,
-     0.2024,  0.3362,  0.4834,  0.6784,  0.9088,  1.0850,  1.2188,  1.4054,
-     1.6102,  1.7767,  1.9679,  2.1436,  2.3445,  2.5467,  2.7429,  2.9320,
-     0.1181,  0.2279,  0.4413,  0.6114,  0.7710,  0.9427,  1.1142,  1.2707,
-     1.4892,  1.7416,  1.9526,  2.1466,  2.3629,  2.5445,  2.7293,  2.9205,
-     0.1155,  0.2720,  0.4886,  0.6812,  0.8594,  1.0422,  1.2315,  1.4116,
-     1.6137,  1.8020,  1.9758,  2.1743,  2.3602,  2.5568,  2.7472,  2.9374,
-     0.1110,  0.3312,  0.4735,  0.5612,  0.7129,  0.8146,  1.0233,  1.3155,
-     1.5765,  1.7746,  1.9574,  2.1416,  2.3220,  2.5384,  2.7334,  2.9318,
-     0.1656,  0.3350,  0.4215,  0.5609,  0.6759,  0.8503,  1.1405,  1.4094,
-     1.6057,  1.6860,  1.7639,  2.0031,  2.2680,  2.5076,  2.7263,  2.9368,
-     0.1466,  0.3638,  0.4587,  0.5674,  0.7381,  0.8669,  0.9619,  1.1658,
-     1.4667,  1.7440,  1.9335,  2.1018,  2.3022,  2.5281,  2.7359,  2.9261,
-     0.1061,  0.2566,  0.4739,  0.6751,  0.8711,  1.0704,  1.2720,  1.4655,
-     1.6605,  1.8494,  2.0290,  2.2197,  2.4008,  2.5912,  2.7772,  2.9513,
-     0.1116,  0.2364,  0.3971,  0.6316,  0.8583,  1.0335,  1.1686,  1.3302,
-     1.5612,  1.7877,  1.9829,  2.2052,  2.3596,  2.5460,  2.7341,  2.9290,
-     0.2661,  0.4186,  0.5126,  0.6477,  0.8818,  1.1045,  1.2852,  1.4128,
-     1.5851,  1.7593,  1.9399,  2.1757,  2.3684,  2.5136,  2.6927,  2.9064,
-     0.1495,  0.2749,  0.4391,  0.6304,  0.8239,  1.0181,  1.1995,  1.3759,
-     1.5669,  1.7722,  1.9671,  2.1635,  2.3586,  2.5528,  2.7445,  2.9311,
-     0.0912,  0.1759,  0.3066,  0.5660,  0.8005,  0.9568,  1.1832,  1.4504,
-     1.6259,  1.7948,  2.0113,  2.2002,  2.3654,  2.5583,  2.7929,  2.9735,
-     0.1353,  0.2747,  0.4078,  0.5977,  0.7658,  0.9124,  1.1081,  1.3630,
-     1.5875,  1.7847,  1.9323,  2.1181,  2.3321,  2.5046,  2.7183,  2.9225,
-     0.1938,  0.4063,  0.4982,  0.6002,  0.7702,  0.9071,  1.1631,  1.3885,
-     1.6043,  1.8118,  1.9306,  2.0893,  2.2724,  2.4609,  2.6283,  2.8802,
-     0.1857,  0.3351,  0.4381,  0.6101,  0.7561,  0.8555,  1.0384,  1.3171,
-     1.5667,  1.6904,  1.7552,  1.9689,  2.2597,  2.5260,  2.7272,  2.9337,
-     0.1037,  0.2159,  0.4188,  0.6174,  0.8035,  1.0285,  1.2256,  1.4230,
-     1.6400,  1.8322,  2.0144,  2.1988,  2.3810,  2.5682,  2.7613,  2.9438,
-     0.1625,  0.2776,  0.4225,  0.6001,  0.7879,  0.9087,  1.0801,  1.2759,
-     1.4899,  1.7448,  1.9911,  2.1770,  2.3723,  2.5777,  2.7971,  2.9444,
-     0.2111,  0.3640,  0.5839,  0.7290,  0.8051,  1.0023,  1.2315,  1.4143,
-     1.5878,  1.7755,  1.9804,  2.1498,  2.3312,  2.5350,  2.7613,  2.9472,
-     0.1423,  0.2646,  0.4136,  0.6350,  0.8070,  0.9514,  1.1168,  1.3213,
-     1.5776,  1.7721,  1.9404,  2.1545,  2.3385,  2.5137,  2.7396,  2.9553,
-     0.1132,  0.2386,  0.4103,  0.5931,  0.7808,  0.9881,  1.1840,  1.3860,
-     1.6021,  1.7990,  1.9922,  2.1885,  2.3852,  2.5717,  2.7640,  2.9510,
-     0.1267,  0.2602,  0.3913,  0.5944,  0.7598,  0.9198,  1.0781,  1.2715,
-     1.5299,  1.7573,  1.9308,  2.1346,  2.3267,  2.5419,  2.7466,  2.9320,
-     0.2023,  0.3417,  0.4392,  0.6141,  0.7439,  0.8593,  1.1096,  1.3543,
-     1.5185,  1.6553,  1.7862,  2.0341,  2.2718,  2.4834,  2.7103,  2.9466,
-     0.1113,  0.2470,  0.3677,  0.5686,  0.7700,  0.9356,  1.0806,  1.2452,
-     1.4830,  1.7344,  1.9268,  2.1404,  2.3371,  2.5169,  2.7329,  2.9012,
-     0.1664,  0.3554,  0.5573,  0.7471,  0.9245,  1.0998,  1.2787,  1.4655,
-     1.6654,  1.8346,  2.0179,  2.2159,  2.4096,  2.5946,  2.7790,  2.9530,
-     0.1313,  0.2625,  0.4731,  0.6444,  0.8110,  0.9878,  1.1493,  1.3212,
-     1.5719,  1.8138,  1.9861,  2.1943,  2.3714,  2.5578,  2.7346,  2.9296,
-     0.1186,  0.3035,  0.5049,  0.6860,  0.8670,  0.9975,  1.1364,  1.3471,
-     1.5695,  1.7412,  1.9346,  2.1506,  2.3413,  2.5531,  2.7794,  2.9627,
-     0.1108,  0.2697,  0.4787,  0.6344,  0.7909,  0.9586,  1.1440,  1.3511,
-     1.5686,  1.7601,  1.9246,  2.1241,  2.3293,  2.5390,  2.7315,  2.9333,
-     0.0985,  0.2302,  0.3544,  0.5759,  0.7620,  0.9651,  1.1497,  1.3080,
-     1.5500,  1.7845,  1.9518,  2.1734,  2.3565,  2.5665,  2.7605,  2.9102,
-     0.1208,  0.2727,  0.4381,  0.5736,  0.7382,  0.8390,  1.0102,  1.2648,
-     1.5100,  1.7440,  1.9619,  2.1430,  2.3307,  2.5159,  2.7264,  2.9211,
-     0.1582,  0.2777,  0.4475,  0.6551,  0.8591,  1.0084,  1.1414,  1.3291,
-     1.5902,  1.7826,  1.9543,  2.1659,  2.3233,  2.5044,  2.6935,  2.9199,
-     0.1360,  0.2873,  0.4585,  0.6295,  0.7592,  0.9089,  1.0492,  1.2733,
-     1.5391,  1.7768,  1.9372,  2.1329,  2.3168,  2.5015,  2.6857,  2.8837,
-     0.0886,  0.1829,  0.3696,  0.6126,  0.8334,  1.0135,  1.2303,  1.4674,
-     1.6743,  1.8564,  2.0530,  2.2370,  2.3960,  2.5787,  2.7756,  2.9377,
-     0.2005,  0.3537,  0.4700,  0.6249,  0.7385,  0.9097,  1.1759,  1.3811,
-     1.5314,  1.6705,  1.8546,  2.1229,  2.3292,  2.5251,  2.7951,  2.9646,
-     0.1999,  0.3112,  0.4722,  0.7146,  0.8908,  1.0028,  1.1831,  1.3903,
-     1.6125,  1.7514,  1.9083,  2.1248,  2.3271,  2.5339,  2.6945,  2.8918,
-     0.1243,  0.2606,  0.4382,  0.5850,  0.7705,  0.9727,  1.1214,  1.3059,
-     1.5218,  1.7406,  1.9137,  2.1353,  2.3354,  2.5299,  2.7287,  2.9068,
-     0.1039,  0.2426,  0.4265,  0.6284,  0.8152,  0.9941,  1.2004,  1.4038,
-     1.5912,  1.7763,  1.9650,  2.1598,  2.3474,  2.5488,  2.7419,  2.9322,
-     0.1364,  0.2420,  0.3886,  0.5864,  0.7663,  0.8844,  1.0860,  1.3242,
-     1.5518,  1.7893,  2.0004,  2.1562,  2.3619,  2.5516,  2.7687,  2.9181,
-     0.1483,  0.2851,  0.4479,  0.6312,  0.7924,  0.9821,  1.1705,  1.3386,
-     1.5375,  1.7226,  1.9053,  2.0991,  2.2898,  2.4953,  2.7000,  2.9146,
-     0.2332,  0.4561,  0.5407,  0.6212,  0.7524,  0.8215,  0.9522,  1.1685,
-     1.5216,  1.7132,  1.8291,  2.0647,  2.2811,  2.4857,  2.7071,  2.9281,
-     0.1348,  0.3126,  0.5179,  0.7192,  0.9227,  1.1363,  1.3223,  1.4756,
-     1.6509,  1.8191,  1.9991,  2.1976,  2.3877,  2.5768,  2.7590,  2.9386,
-     0.1093,  0.2211,  0.4763,  0.6703,  0.8282,  0.9536,  1.1202,  1.3796,
-     1.6043,  1.8031,  1.9832,  2.1604,  2.3578,  2.5856,  2.7650,  2.9291,
-     0.1865,  0.3027,  0.4580,  0.6719,  0.8400,  1.0082,  1.1901,  1.3782,
-     1.5448,  1.6885,  1.9477,  2.1381,  2.2797,  2.5113,  2.7465,  2.9414,
-     0.1575,  0.3124,  0.4649,  0.6262,  0.8095,  0.9858,  1.1676,  1.3602,
-     1.5646,  1.7582,  1.9550,  2.1671,  2.3628,  2.5734,  2.7670,  2.9519,
-     0.1174,  0.2777,  0.4663,  0.6333,  0.8169,  1.0096,  1.1885,  1.3847,
-     1.5803,  1.7571,  1.9380,  2.1398,  2.3414,  2.5407,  2.7360,  2.9375,
-     0.1073,  0.2264,  0.4083,  0.5973,  0.7474,  0.9514,  1.1349,  1.3337,
-     1.5433,  1.7348,  1.9380,  2.1436,  2.3441,  2.5438,  2.7457,  2.9383,
-     0.1472,  0.2880,  0.4793,  0.6268,  0.8015,  1.0063,  1.1715,  1.3644,
-     1.5525,  1.7410,  1.9258,  2.1227,  2.3214,  2.5149,  2.7148,  2.9196,
-     0.1414,  0.2565,  0.4349,  0.6111,  0.7695,  0.9496,  1.1212,  1.3265,
-     1.5218,  1.7209,  1.9015,  2.0887,  2.3158,  2.5077,  2.7233,  2.9421,
-     0.1252,  0.2667,  0.4454,  0.6431,  0.8371,  1.0124,  1.2110,  1.4160,
-     1.6240,  1.8242,  2.0047,  2.1974,  2.3902,  2.5778,  2.7637,  2.9481,
-     0.1321,  0.2565,  0.3846,  0.5847,  0.7578,  0.9259,  1.0637,  1.2239,
-     1.4690,  1.7346,  1.9750,  2.1882,  2.3712,  2.5509,  2.7280,  2.8885,
-     0.1437,  0.2930,  0.4428,  0.6156,  0.8045,  0.9638,  1.1450,  1.3138,
-     1.5144,  1.7355,  1.9469,  2.1534,  2.3414,  2.5452,  2.7353,  2.9334,
-     0.1692,  0.2770,  0.3831,  0.6100,  0.7825,  0.9302,  1.0690,  1.2481,
-     1.4615,  1.6799,  1.9165,  2.1739,  2.3435,  2.5349,  2.7520,  2.9163,
-     0.1235,  0.2489,  0.4354,  0.6343,  0.8236,  1.0066,  1.1908,  1.3474,
-     1.5656,  1.8275,  2.0620,  2.2548,  2.4135,  2.5913,  2.7639,  2.9334,
-     0.1090,  0.1961,  0.3854,  0.5701,  0.7024,  0.8843,  1.1393,  1.3785,
-     1.5940,  1.7797,  1.9442,  2.1740,  2.3853,  2.5773,  2.7727,  2.9406,
-     0.1560,  0.3477,  0.5011,  0.6287,  0.7612,  0.9896,  1.1510,  1.3420,
-     1.5435,  1.6816,  1.8731,  2.0651,  2.2613,  2.4999,  2.7027,  2.8971,
-     0.1459,  0.2416,  0.3833,  0.5450,  0.7916,  0.9223,  1.0662,  1.1953,
-     1.4029,  1.6616,  1.9320,  2.1459,  2.3386,  2.5081,  2.6799,  2.9195,
-     0.1546,  0.3854,  0.6184,  0.8460,  1.0599,  1.2428,  1.3906,  1.5550,
-     1.7388,  1.8945,  2.0757,  2.2386,  2.4014,  2.5705,  2.7574,  2.9400,
-     0.1080,  0.2307,  0.4112,  0.6067,  0.7725,  0.9467,  1.1285,  1.3205,
-     1.5348,  1.7609,  1.9937,  2.1878,  2.3583,  2.5515,  2.7199,  2.9049,
-     0.1482,  0.3178,  0.4983,  0.6342,  0.7783,  0.9880,  1.2019,  1.3404,
-     1.5223,  1.7296,  1.9211,  2.0943,  2.2928,  2.5008,  2.7136,  2.9224,
-     0.1145,  0.2910,  0.4891,  0.6492,  0.8126,  0.9530,  1.1180,  1.3155,
-     1.5054,  1.6893,  1.8899,  2.1188,  2.3389,  2.5512,  2.7313,  2.9224,
-     0.0939,  0.1689,  0.3250,  0.5792,  0.7698,  0.9245,  1.1574,  1.3865,
-     1.5959,  1.7977,  1.9821,  2.1528,  2.3326,  2.5540,  2.7553,  2.9179,
-     0.1243,  0.2474,  0.3923,  0.6199,  0.7908,  0.9379,  1.1497,  1.3734,
-     1.5582,  1.7420,  1.9539,  2.1385,  2.3240,  2.5277,  2.7311,  2.9178,
-     0.1961,  0.3748,  0.5176,  0.6387,  0.8169,  1.0477,  1.2124,  1.3869,
-     1.5604,  1.7225,  1.8770,  2.0837,  2.2960,  2.5103,  2.6945,  2.8862,
-     0.1295,  0.2403,  0.4149,  0.6189,  0.7913,  0.9130,  1.0832,  1.2787,
-     1.4860,  1.7112,  1.9502,  2.1348,  2.2776,  2.4982,  2.7431,  2.9522,
-     0.0160,  0.0362,  0.0097,  0.0057, -0.0014, -0.0073, -0.0046, -0.0064,
-    -0.0121,  0.0019,  0.0149, -0.0440, -0.0479, -0.0382, -0.0480, -0.0182,
-     0.0170,  0.0114, -0.0298, -0.0175, -0.0033, -0.0354, -0.0510, -0.0025,
-     0.0307,  0.0351,  0.0338,  0.0420,  0.0138, -0.0175, -0.0102,  0.0053,
-     0.0084, -0.0003,  0.0412, -0.0027,  0.0145, -0.0039,  0.0083,  0.0400,
-     0.0001, -0.0262,  0.0055, -0.0082,  0.0348,  0.0433,  0.0137, -0.0024,
-    -0.0055,  0.0262,  0.0521,  0.0349,  0.0185,  0.0076, -0.0319, -0.0561,
-    -0.0460, -0.0253, -0.0097,  0.0163,  0.0184, -0.0037, -0.0480, -0.0371,
-     0.0628,  0.0665,  0.0296, -0.0057,  0.0253,  0.0227,  0.0350,  0.0692,
-     0.0545,  0.0218,  0.0094, -0.0449, -0.0372,  0.0005,  0.0258,  0.0118,
-     0.0285,  0.0760,  0.0822,  0.0527, -0.0299, -0.0049,  0.0170,  0.0195,
-     0.0136,  0.0286,  0.0289,  0.0139,  0.0054,  0.0152,  0.0244,  0.0028,
-    -0.0056, -0.0260,  0.0307,  0.0572, -0.0087,  0.0088,  0.0062,  0.0000,
-     0.0125,  0.0000, -0.0292,  0.0820,  0.0872,  0.0646,  0.0346,  0.0076,
-    -0.0022, -0.0253, -0.0567, -0.0188, -0.0336, -0.0673, -0.0549, -0.0166,
-    -0.0259, -0.0140,  0.0040, -0.0029, -0.0430, -0.0531, -0.0253, -0.0019,
-    -0.0071,  0.0393,  0.0072, -0.0327, -0.0236, -0.0235, -0.0177, -0.0186,
-    -0.0280, -0.0201, -0.0077,  0.0383,  0.0418,  0.0321,  0.0294,  0.0169,
-     0.0468,  0.0301,  0.0133,  0.0363,  0.0516,  0.0937,  0.1240,  0.1404,
-     0.1325,  0.1178,  0.0999,  0.0251, -0.0037, -0.0495, -0.0703, -0.0219,
-    -0.0261, -0.0304, -0.0204, -0.0372,  0.0355,  0.0131, -0.0093, -0.0099,
-    -0.0069, -0.0034, -0.0065, -0.0208, -0.0231, -0.0117, -0.0211, -0.0243,
-     0.0046, -0.0107, -0.0070,  0.0123,  0.0230,  0.0152,  0.0164,  0.0412,
-     0.0619,  0.0858,  0.0862, -0.0056,  0.0125,  0.0182,  0.0347,  0.0388,
-     0.0456,  0.0407, -0.0249, -0.0460,  0.0206,  0.0299,  0.0253,  0.0207,
-     0.0177,  0.0238,  0.0253,  0.0030,  0.0042,  0.0020, -0.0081, -0.0136,
-    -0.0290, -0.0042,  0.0122,  0.0051,  0.0107,  0.0228,  0.0211, -0.0068,
-    -0.0436, -0.0299, -0.0078, -0.0779, -0.1157, -0.0679,  0.0172,  0.0150,
-    -0.0051,  0.0081, -0.0512, -0.0616,  0.0576,  0.0799,  0.0803,  0.0336,
-     0.0001, -0.0298, -0.0747, -0.0115, -0.0101, -0.0170, -0.0050,  0.0174,
-    -0.0290, -0.0601, -0.0150,  0.0121,  0.0165,  0.0230,  0.0028, -0.0317,
-    -0.0165,  0.0356,  0.0451,  0.0120,  0.0321,  0.0084, -0.0058,  0.0122,
-     0.1935,  0.1802,  0.2195,  0.2410,  0.2201,  0.1915,  0.1840,  0.1935,
-     0.2213,  0.2079,  0.1858,  0.1974,  0.2239,  0.2173,  0.1840,  0.2120,
-     0.4912,  0.4777,  0.4607,  0.4395,  0.4426,  0.4388,  0.4416,  0.4345,
-     0.4239,  0.4331,  0.4522,  0.4423,  0.4475,  0.4387,  0.4525,  0.4446,
-};
-
-static const float lsp44s[] = {
-     0.0927,  0.2291,  0.4059,  0.5779,  0.7288,  0.8821,  1.0377,  1.1915,
-     1.3433,  1.4931,  1.6475,  1.7989,  1.9381,  2.0858,  2.2321,  2.3765,
-     2.5187,  2.6530,  2.7895,  2.9354,  0.0944,  0.1974,  0.3046,  0.4714,
-     0.6116,  0.7829,  0.9027,  1.0375,  1.1869,  1.3488,  1.5036,  1.6781,
-     1.8276,  1.9983,  2.1449,  2.3089,  2.4534,  2.6113,  2.7553,  2.9062,
-     0.1168,  0.2843,  0.4907,  0.6706,  0.8100,  0.9417,  1.0753,  1.2014,
-     1.3151,  1.4496,  1.5832,  1.7379,  1.8642,  2.0230,  2.1681,  2.3250,
-     2.4676,  2.6242,  2.7602,  2.9066,  0.1353,  0.2335,  0.3370,  0.4380,
-     0.5819,  0.7353,  0.8671,  1.0160,  1.1435,  1.2977,  1.4860,  1.6739,
-     1.8412,  2.0028,  2.1537,  2.3124,  2.4741,  2.6272,  2.7862,  2.9536,
-     0.1003,  0.2226,  0.3584,  0.4971,  0.6291,  0.7710,  0.9157,  1.0669,
-     1.2143,  1.3624,  1.5104,  1.6681,  1.8164,  1.9823,  2.1394,  2.3082,
-     2.4677,  2.6306,  2.7909,  2.9382,  0.1056,  0.2027,  0.2956,  0.4005,
-     0.5215,  0.6708,  0.8545,  1.0557,  1.2344,  1.4023,  1.5676,  1.7278,
-     1.8808,  2.0381,  2.1846,  2.3376,  2.4887,  2.6377,  2.7878,  2.9504,
-     0.1015,  0.2462,  0.4122,  0.5783,  0.7233,  0.8833,  1.0377,  1.1903,
-     1.3341,  1.4727,  1.6138,  1.7582,  1.8912,  2.0370,  2.1701,  2.3125,
-     2.4500,  2.6006,  2.7507,  2.9166,  0.1787,  0.2418,  0.3265,  0.5379,
-     0.6584,  0.7681,  0.9545,  1.1050,  1.2125,  1.3528,  1.4763,  1.6705,
-     1.8136,  1.9594,  2.0936,  2.2724,  2.4394,  2.5919,  2.7037,  2.8747,
-     0.0859,  0.1600,  0.2980,  0.4933,  0.6696,  0.8285,  0.9958,  1.1545,
-     1.3107,  1.4591,  1.6127,  1.7652,  1.9143,  2.0680,  2.2171,  2.3643,
-     2.5141,  2.6611,  2.8143,  2.9691,  0.0910,  0.2110,  0.3364,  0.4718,
-     0.5856,  0.7298,  0.8910,  1.0514,  1.1988,  1.3572,  1.5178,  1.6861,
-     1.8399,  2.0099,  2.1639,  2.3225,  2.4774,  2.6321,  2.7863,  2.9412,
-     0.1904,  0.2874,  0.3681,  0.4981,  0.6248,  0.7880,  0.9121,  1.0750,
-     1.2185,  1.3809,  1.5296,  1.7007,  1.8592,  2.0470,  2.1913,  2.3250,
-     2.4519,  2.5984,  2.7408,  2.9023,  0.0917,  0.2067,  0.3246,  0.4961,
-     0.6310,  0.8024,  0.9438,  1.1008,  1.2362,  1.3892,  1.5407,  1.7033,
-     1.8427,  2.0061,  2.1498,  2.3117,  2.4550,  2.6053,  2.7462,  2.9029,
-     0.0989,  0.2193,  0.3756,  0.5410,  0.6929,  0.8368,  0.9801,  1.1250,
-     1.2677,  1.4184,  1.5677,  1.7292,  1.8770,  2.0311,  2.1803,  2.3306,
-     2.4836,  2.6339,  2.7943,  2.9549,  0.0861,  0.1943,  0.3057,  0.4867,
-     0.6194,  0.7592,  0.9184,  1.1052,  1.2486,  1.4064,  1.5609,  1.7273,
-     1.8703,  2.0291,  2.1686,  2.3225,  2.4628,  2.6115,  2.7471,  2.9005,
-     0.0932,  0.2110,  0.3737,  0.5479,  0.7120,  0.8570,  0.9975,  1.1364,
-     1.2772,  1.4220,  1.5612,  1.7089,  1.8410,  1.9827,  2.1263,  2.2859,
-     2.4459,  2.6172,  2.7788,  2.9395,  0.1193,  0.2341,  0.3523,  0.5029,
-     0.6437,  0.7803,  0.9367,  1.1007,  1.2392,  1.3869,  1.5425,  1.7168,
-     1.8709,  2.0248,  2.1584,  2.2949,  2.4308,  2.5823,  2.7235,  2.9034,
-     0.0834,  0.1988,  0.3557,  0.5261,  0.6767,  0.8427,  1.0029,  1.1683,
-     1.3138,  1.4527,  1.6046,  1.7583,  1.9011,  2.0517,  2.1928,  2.3397,
-     2.4839,  2.6291,  2.7771,  2.9329,  0.0938,  0.1967,  0.3213,  0.4675,
-     0.6068,  0.7664,  0.9418,  1.1120,  1.2535,  1.3932,  1.5243,  1.6801,
-     1.8346,  1.9931,  2.1376,  2.3035,  2.4636,  2.6244,  2.7829,  2.9371,
-     0.1017,  0.2552,  0.4327,  0.6017,  0.7467,  0.8797,  1.0097,  1.1442,
-     1.2628,  1.4049,  1.5541,  1.7090,  1.8461,  1.9982,  2.1486,  2.3029,
-     2.4513,  2.6075,  2.7594,  2.9209,  0.1031,  0.2295,  0.3747,  0.5122,
-     0.6596,  0.7935,  0.9345,  1.1050,  1.2384,  1.3543,  1.4739,  1.6136,
-     1.7447,  1.8914,  2.0434,  2.1916,  2.3557,  2.5396,  2.7419,  2.9401,
-     0.1007,  0.2374,  0.3715,  0.5173,  0.6465,  0.8069,  0.9553,  1.1145,
-     1.2594,  1.4143,  1.5617,  1.7166,  1.8457,  2.0012,  2.1462,  2.2864,
-     2.4258,  2.5910,  2.7372,  2.9018,  0.0808,  0.1726,  0.2849,  0.4592,
-     0.6118,  0.7853,  0.9588,  1.1256,  1.2751,  1.4392,  1.5898,  1.7514,
-     1.8977,  2.0554,  2.1937,  2.3430,  2.4831,  2.6249,  2.7601,  2.9155,
-     0.1669,  0.2574,  0.3694,  0.5569,  0.6773,  0.8061,  1.0160,  1.1667,
-     1.2791,  1.4041,  1.5452,  1.7207,  1.8524,  2.0038,  2.1414,  2.3338,
-     2.4747,  2.6157,  2.7303,  2.8848,  0.1598,  0.2521,  0.3416,  0.5149,
-     0.6703,  0.7941,  0.9408,  1.1164,  1.2017,  1.3293,  1.4908,  1.6783,
-     1.8438,  1.9927,  2.1149,  2.2698,  2.4420,  2.6193,  2.7583,  2.9103,
-     0.0902,  0.1978,  0.3265,  0.4578,  0.5878,  0.7439,  0.9110,  1.0906,
-     1.2556,  1.4125,  1.5688,  1.7295,  1.8829,  2.0472,  2.2058,  2.3537,
-     2.5075,  2.6548,  2.8058,  2.9538,  0.0818,  0.1695,  0.2794,  0.4470,
-     0.6069,  0.7641,  0.9313,  1.0946,  1.2411,  1.4072,  1.5640,  1.7186,
-     1.8651,  2.0254,  2.1726,  2.3286,  2.4784,  2.6287,  2.7750,  2.9339,
-     0.1980,  0.3134,  0.4099,  0.4975,  0.6491,  0.8376,  0.9441,  1.0298,
-     1.1795,  1.3866,  1.5784,  1.7209,  1.8137,  1.9271,  2.0863,  2.2930,
-     2.4696,  2.6184,  2.7587,  2.9251,  0.1338,  0.2341,  0.3566,  0.4797,
-     0.6129,  0.7580,  0.9093,  1.0491,  1.1911,  1.3313,  1.4841,  1.6503,
-     1.8035,  1.9685,  2.1128,  2.2694,  2.4093,  2.5728,  2.7206,  2.8994,
-     0.0937,  0.2034,  0.3447,  0.5032,  0.6370,  0.7993,  0.9674,  1.1323,
-     1.2830,  1.4199,  1.5492,  1.7010,  1.8513,  2.0087,  2.1550,  2.3115,
-     2.4643,  2.6237,  2.7812,  2.9392,  0.1085,  0.2152,  0.3126,  0.4569,
-     0.5718,  0.7213,  0.8837,  1.0604,  1.2053,  1.3755,  1.5397,  1.7001,
-     1.8409,  2.0039,  2.1498,  2.3080,  2.4535,  2.6063,  2.7505,  2.9110,
-     0.0562,  0.2066,  0.4034,  0.5490,  0.6682,  0.7924,  0.9495,  1.0800,
-     1.1869,  1.3156,  1.4834,  1.6619,  1.8404,  2.0199,  2.1509,  2.2755,
-     2.4072,  2.5580,  2.6993,  2.8913,  0.0939,  0.2303,  0.3742,  0.5260,
-     0.6662,  0.8294,  0.9769,  1.1315,  1.2792,  1.4153,  1.5436,  1.6701,
-     1.8215,  1.9920,  2.1310,  2.3005,  2.4534,  2.5786,  2.7204,  2.9068,
-     0.1005,  0.2442,  0.3898,  0.5398,  0.6958,  0.8474,  1.0008,  1.1556,
-     1.3020,  1.4456,  1.5954,  1.7470,  1.8922,  2.0500,  2.2019,  2.3492,
-     2.4963,  2.6412,  2.7890,  2.9423,  0.1022,  0.2031,  0.3213,  0.4402,
-     0.5637,  0.7117,  0.8673,  1.0242,  1.1727,  1.3206,  1.4846,  1.6465,
-     1.8015,  1.9655,  2.1233,  2.2873,  2.4464,  2.6074,  2.7685,  2.9409,
-     0.1985,  0.3497,  0.4622,  0.5982,  0.7489,  0.8752,  0.9925,  1.1679,
-     1.3288,  1.4606,  1.5820,  1.7492,  1.8922,  2.0511,  2.1780,  2.3373,
-     2.4760,  2.6233,  2.7466,  2.8978,  0.1284,  0.2433,  0.3630,  0.4852,
-     0.6117,  0.7460,  0.8904,  1.0360,  1.1738,  1.3142,  1.4696,  1.6185,
-     1.7719,  1.9318,  2.0961,  2.2697,  2.4408,  2.6046,  2.7681,  2.9451,
-     0.1042,  0.2286,  0.3598,  0.5064,  0.6438,  0.7899,  0.9350,  1.0891,
-     1.2323,  1.3807,  1.5225,  1.6747,  1.8153,  1.9669,  2.1145,  2.2832,
-     2.4430,  2.6085,  2.7748,  2.9346,  0.0780,  0.1724,  0.2440,  0.3489,
-     0.5280,  0.7426,  0.9272,  1.0914,  1.2562,  1.4188,  1.5804,  1.7376,
-     1.8909,  2.0473,  2.1946,  2.3457,  2.4950,  2.6424,  2.7926,  2.9549,
-     0.1103,  0.2608,  0.4087,  0.5538,  0.6923,  0.8418,  0.9940,  1.1507,
-     1.2919,  1.4406,  1.5802,  1.7262,  1.8638,  2.0085,  2.1572,  2.2975,
-     2.4329,  2.5866,  2.7380,  2.9107,  0.1297,  0.2532,  0.4003,  0.5329,
-     0.6733,  0.7950,  0.9557,  1.0859,  1.2235,  1.3538,  1.5037,  1.6389,
-     1.7964,  1.9285,  2.0898,  2.2541,  2.4231,  2.5711,  2.6875,  2.8947,
-     0.0871,  0.1968,  0.3425,  0.4949,  0.6424,  0.7959,  0.9534,  1.1132,
-     1.2656,  1.4229,  1.5785,  1.7271,  1.8729,  2.0355,  2.1998,  2.3562,
-     2.5151,  2.6663,  2.8145,  2.9534,  0.1038,  0.2204,  0.3248,  0.4566,
-     0.5947,  0.7443,  0.8811,  1.0379,  1.2031,  1.3772,  1.5430,  1.7092,
-     1.8625,  2.0322,  2.1904,  2.3417,  2.4960,  2.6458,  2.7979,  2.9485,
-     0.1329,  0.2763,  0.3943,  0.5147,  0.6512,  0.8071,  0.9410,  1.0879,
-     1.2298,  1.3850,  1.5282,  1.6674,  1.8137,  1.9993,  2.1344,  2.2749,
-     2.4257,  2.5863,  2.7410,  2.9184,  0.1052,  0.2142,  0.3584,  0.5033,
-     0.6387,  0.7804,  0.9320,  1.0780,  1.2172,  1.3764,  1.5421,  1.6887,
-     1.8246,  1.9833,  2.1245,  2.2797,  2.4237,  2.5779,  2.7257,  2.9097,
-     0.1092,  0.2676,  0.4071,  0.5355,  0.6661,  0.8142,  0.9621,  1.1173,
-     1.2628,  1.4185,  1.5696,  1.7220,  1.8595,  2.0178,  2.1720,  2.3221,
-     2.4718,  2.6259,  2.7775,  2.9334,  0.0929,  0.2017,  0.3073,  0.4570,
-     0.5775,  0.7635,  0.9299,  1.0832,  1.2334,  1.3935,  1.5420,  1.7112,
-     1.8601,  2.0309,  2.1735,  2.3230,  2.4543,  2.6034,  2.7418,  2.8988,
-     0.0775,  0.2005,  0.3490,  0.5200,  0.6747,  0.8383,  0.9885,  1.1738,
-     1.3141,  1.4236,  1.5892,  1.7402,  1.8474,  2.0210,  2.1593,  2.2730,
-     2.4235,  2.5604,  2.7128,  2.9005,  0.1104,  0.2292,  0.3353,  0.4732,
-     0.6152,  0.7675,  0.9164,  1.0907,  1.2594,  1.4064,  1.5218,  1.6426,
-     1.8018,  1.9937,  2.1362,  2.2961,  2.4523,  2.6083,  2.7613,  2.9202,
-     0.0826,  0.2000,  0.3384,  0.5144,  0.6694,  0.8377,  0.9870,  1.1461,
-     1.2950,  1.4495,  1.5872,  1.7387,  1.8793,  2.0329,  2.1723,  2.3114,
-     2.4415,  2.5908,  2.7354,  2.9028,  0.1063,  0.2268,  0.3442,  0.4735,
-     0.6116,  0.7507,  0.9028,  1.0768,  1.2426,  1.4052,  1.5566,  1.7015,
-     1.8243,  1.9742,  2.1276,  2.2824,  2.4262,  2.5953,  2.7627,  2.9290,
-     0.1150,  0.2814,  0.4543,  0.6095,  0.7373,  0.8592,  0.9908,  1.1108,
-     1.2339,  1.3590,  1.4864,  1.6168,  1.7392,  1.8752,  2.0212,  2.1688,
-     2.3128,  2.4869,  2.7019,  2.9239,  0.0948,  0.2074,  0.3433,  0.4943,
-     0.6346,  0.7645,  0.8809,  1.0610,  1.2307,  1.3487,  1.4655,  1.6186,
-     1.7534,  1.8859,  2.0486,  2.2200,  2.3835,  2.5581,  2.7565,  2.9502,
-     0.1062,  0.2239,  0.3683,  0.5197,  0.6704,  0.8184,  0.9642,  1.1127,
-     1.2556,  1.3976,  1.5405,  1.6940,  1.8375,  1.9888,  2.1377,  2.2980,
-     2.4555,  2.6184,  2.7849,  2.9452,  0.0888,  0.2005,  0.2847,  0.4322,
-     0.5763,  0.7577,  0.9262,  1.1095,  1.2719,  1.4331,  1.5843,  1.7452,
-     1.8845,  2.0385,  2.1805,  2.3345,  2.4750,  2.6217,  2.7555,  2.9013,
-     0.1713,  0.2617,  0.3868,  0.5859,  0.7073,  0.8535,  1.0593,  1.1778,
-     1.3109,  1.4508,  1.5910,  1.7463,  1.8911,  2.0651,  2.2035,  2.3355,
-     2.4947,  2.6440,  2.7424,  2.8943,  0.1346,  0.2549,  0.4089,  0.5488,
-     0.6949,  0.8394,  0.9810,  1.1145,  1.2528,  1.4044,  1.5423,  1.6872,
-     1.8274,  1.9726,  2.1403,  2.2809,  2.4128,  2.5564,  2.6887,  2.8895,
-     0.0776,  0.1621,  0.2553,  0.4191,  0.5988,  0.7921,  0.9651,  1.1350,
-     1.2930,  1.4475,  1.6011,  1.7585,  1.9068,  2.0638,  2.2102,  2.3594,
-     2.5096,  2.6581,  2.8099,  2.9654,  0.0864,  0.1778,  0.2854,  0.4235,
-     0.5568,  0.7220,  0.8963,  1.0609,  1.2217,  1.3830,  1.5422,  1.7018,
-     1.8551,  2.0206,  2.1783,  2.3328,  2.4869,  2.6366,  2.7923,  2.9539,
-     0.1144,  0.2576,  0.4186,  0.5594,  0.6875,  0.8221,  0.9598,  1.0944,
-     1.2273,  1.3713,  1.5152,  1.6628,  1.8070,  1.9525,  2.0965,  2.2535,
-     2.4132,  2.5725,  2.7250,  2.9150,  0.1079,  0.2221,  0.3334,  0.4845,
-     0.6083,  0.7516,  0.9018,  1.0594,  1.2060,  1.3673,  1.5212,  1.6880,
-     1.8208,  1.9831,  2.1269,  2.2909,  2.4366,  2.6027,  2.7339,  2.8924,
-     0.0994,  0.2233,  0.3634,  0.5145,  0.6568,  0.8131,  0.9746,  1.1296,
-     1.2666,  1.4116,  1.5748,  1.7264,  1.8649,  2.0217,  2.1716,  2.3293,
-     2.4900,  2.6455,  2.7818,  2.9362,  0.1120,  0.2079,  0.3128,  0.4124,
-     0.5291,  0.6816,  0.8478,  1.0150,  1.1772,  1.3456,  1.5208,  1.6882,
-     1.8458,  2.0078,  2.1627,  2.3198,  2.4733,  2.6251,  2.7796,  2.9489,
-     0.0853,  0.2030,  0.3669,  0.5326,  0.6678,  0.8086,  0.9526,  1.1142,
-     1.2551,  1.4158,  1.5694,  1.7073,  1.8431,  1.9686,  2.1153,  2.2376,
-     2.3686,  2.5591,  2.7320,  2.9104,  0.0905,  0.2166,  0.3539,  0.5201,
-     0.6700,  0.8346,  0.9883,  1.1457,  1.2714,  1.3845,  1.5172,  1.6688,
-     1.8008,  1.9535,  2.1019,  2.2708,  2.4135,  2.5974,  2.7486,  2.9033,
-     0.0084,  0.0374,  0.0164, -0.0153,  0.0288,  0.0107, -0.0255, -0.0242,
-     0.0000, -0.0055, -0.0081, -0.0075, -0.0022, -0.0052, -0.0069, -0.0017,
-     0.0003,  0.0091,  0.0028, -0.0027,  0.0085,  0.0043, -0.0235, -0.0411,
-     0.0202,  0.0359,  0.0376,  0.0321,  0.0306, -0.0358, -0.0276, -0.0090,
-     0.0032,  0.0048,  0.0309,  0.0332,  0.0284,  0.0237,  0.0051, -0.0101,
-    -0.0233, -0.0428, -0.0585, -0.0387,  0.0039,  0.0081,  0.0029, -0.0017,
-    -0.0006, -0.0068,  0.0044,  0.0182,  0.0376,  0.0387, -0.0334, -0.0269,
-    -0.0182, -0.0069, -0.0026,  0.0035, -0.0049, -0.0212, -0.0408, -0.0245,
-     0.0186,  0.0189,  0.0153,  0.0120,  0.0157,  0.0055, -0.0046,  0.0179,
-     0.0284, -0.0032, -0.0261, -0.0205, -0.0039,  0.0174,  0.0299,  0.0207,
-     0.0012, -0.0056,  0.0010,  0.0141, -0.0119,  0.0190,  0.0315,  0.0033,
-    -0.0128,  0.0300,  0.0328,  0.0308,  0.0353,  0.0266,  0.0066, -0.0328,
-    -0.0273,  0.0054,  0.0145,  0.0175,  0.0015, -0.0171,  0.0062, -0.0164,
-     0.0045, -0.0071,  0.0025,  0.0278,  0.0283,  0.0117, -0.0026, -0.0285,
-    -0.0408, -0.0366, -0.0059, -0.0208, -0.0354, -0.0334, -0.0263, -0.0064,
-     0.0072, -0.0006, -0.0235, -0.0037, -0.0307, -0.0294, -0.0163, -0.0197,
-    -0.0235,  0.0192,  0.0013, -0.0219, -0.0123, -0.0004, -0.0081, -0.0096,
-    -0.0123, -0.0101,  0.0021,  0.0151,  0.0106,  0.0151,  0.0292,  0.0033,
-     0.0283,  0.0124,  0.0058, -0.0017, -0.0038,  0.0152,  0.0141,  0.0132,
-     0.0178,  0.0157,  0.0073,  0.0176,  0.0141,  0.0097, -0.0092, -0.0163,
-    -0.0230, -0.0134, -0.0099, -0.0147,  0.0040, -0.0183, -0.0175, -0.0080,
-    -0.0083, -0.0290, -0.0417, -0.0398, -0.0269, -0.0199, -0.0143, -0.0053,
-    -0.0099, -0.0054, -0.0199, -0.0219, -0.0170,  0.0107,  0.0194,  0.0035,
-     0.0437,  0.0406,  0.0215,  0.0120,  0.0053, -0.0028,  0.0238,  0.0337,
-     0.0217,  0.0011,  0.0227,  0.0244,  0.0327,  0.0378,  0.0437,  0.0356,
-    -0.0033,  0.0113,  0.0407,  0.0334, -0.0125, -0.0003, -0.0141, -0.0273,
-    -0.0137, -0.0079, -0.0145, -0.0071,  0.0114,  0.0181,  0.0150,  0.0085,
-    -0.0077, -0.0038, -0.0219, -0.0263, -0.0187, -0.0233,  0.0133,  0.0265,
-    -0.0156, -0.0091, -0.0110, -0.0016,  0.0143,  0.0177,  0.0240,  0.0082,
-    -0.0143, -0.0257, -0.0014,  0.0002,  0.0082,  0.0180,  0.0325,  0.0340,
-    -0.0153, -0.0389, -0.0240,  0.0082,  0.0140,  0.0046, -0.0138, -0.0378,
-    -0.0366,  0.0297,  0.0252,  0.0078,  0.0063,  0.0006,  0.0044,  0.0074,
-     0.0094,  0.0113,  0.0105,  0.0137,  0.0438,  0.0262, -0.0078, -0.0185,
-    -0.0215, -0.0407, -0.0435, -0.0208, -0.0004, -0.0144, -0.0205, -0.0248,
-    -0.0159, -0.0069, -0.0153,  0.0132,  0.0355,  0.0298,  0.0120,  0.0072,
-     0.0236,  0.0526,  0.0479,  0.0233, -0.0133, -0.0283, -0.0468, -0.0549,
-    -0.0370,  0.0032,  0.0056,  0.0023,  0.0050,  0.0024,  0.0279,  0.0116,
-    -0.0045, -0.0012,  0.0107,  0.0190,  0.0253,  0.0191,  0.0043,  0.0193,
-    -0.0348, -0.0246,  0.0123,  0.0210,  0.0135, -0.0096, -0.0109, -0.0076,
-    -0.0156, -0.0290,  0.0160,  0.0194,  0.0219,  0.0259,  0.0250,  0.0195,
-     0.4948,  0.4961,  0.4940,  0.4878,  0.4849,  0.4727,  0.4571,  0.4551,
-     0.4534,  0.4468,  0.4412,  0.4354,  0.4298,  0.4272,  0.4498,  0.4506,
-     0.4560,  0.4592,  0.4758,  0.4941,  0.2476,  0.1771,  0.1974,  0.1881,
-     0.1667,  0.1826,  0.2067,  0.2031,  0.1734,  0.1534,  0.1415,  0.1761,
-     0.1897,  0.1772,  0.1651,  0.1247,  0.1041,  0.1231,  0.1809,  0.2234,
-};
-
-static const int16_t shape8[] = {
-      2765,   1262,   6624,    867,    688,   1884,   3245,   1248,
-     -2160,    593,    182,  -1004,  -1067,    687,   1021,   -920,
-      1396,   -242,  -2817,  -1838,  -3351,   1000,   5995,   2459,
-      -283,   1909,   1452,  -4569,    556,  -2004,    -42,  -3393,
-       -50,   -385,    597,    983,    420,   6311,  -1572,  -1665,
-      6128,  -1688,  -5191,   -337,  -4199,    371,   1032,    -84,
-      2169,    931,   -392,   -250,    137,    831,   8194,   -489,
-       -92,    209,    115,   1453,    246,   -647,    936,   1097,
-      -400,    597,    392,     93,  -7709,   -711,   -724,   2051,
-       497,   1919,   -876,   -769,   -172,   2972,    952,    555,
-       151,   -617,    773,   4840,  -3671,    841,    244,   -661,
-     -3424,    958,     81,    532,   -315,    796,   5491,   -516,
-        -1,  -1371,   -531,  -5538,    313,  -1749,   2413,   -835,
-     -3143,   -244,  -3470,   -850,  -4241,   -859,    -74,   2141,
-     -1005,   4643,   -339,   4089,   -861,  -6612,    483,  -2888,
-      -580,    -45,   3662,    918,   -317,   3596,   -741,    897,
-     -2578,   -654,  -1628,  -1865,    629,   3219,    214,  -1898,
-      1173,  -4509,   1682,  -2161,    697,   -147,   9839,    751,
-     -1094,   -341,   -669,  -1322,    649,   -832,   -382,  -5467,
-       -44,   3510,   1312,   3104,   -202,   1870,   -155,    601,
-       719,    -22,   -350,    394,     81,    397,  -9185,   -174,
-       351,  -4717,  -4450,   3672,   1163,   2351,   1720,   1048,
-     -1221,   -280,    -18,    -15,    678,  -3931,   4707,    -99,
-      1823,   -535,  -1836,    138,   1166,  -3031,   5515,   1362,
-      1235,    455,    595,  -3671,   1102,   -163,     62,   1104,
-       813,    870,   -295,  -1088,   -299,  -3976,    805,  -7468,
-      -412,  -2109,    236,     46,  -5764,    615,  -1475,    853,
-       790,  -6197,    312,    637,  -3923,   -422,  -1086,  -5647,
-       878,  -1410,   2085,    -51,  -2941,   -769,    -63,    838,
-       823,    741,   2785,    450,  -7003,   -121,   -915,     60,
-       -41,      0,    -39,   8774,    647,   -521,    379,   -342,
-      -344,    818,   1316,   1056,    182,   2765,   -467,   7886,
-        45,    791,   -415,   3864,  -2428,   2255,   -661,    -64,
-      1693,    144,   1784,  -1194,    -46,  -1856,   1208,   4131,
-       914,   8028,    -17,   1939,  -1415,    533,    291,   -466,
-       186,   -705,    668,   -614,   -253,  -2190,    287,   3929,
-      1472,  -1561,      5,    889,  -2020,    158,    -14,  -1419,
-      1338,   -353,    622,    -54,     87,  -1104,  -2911,    513,
-      -632,   1533,   -267,     22,   6567,    295,    325,   6883,
-       963,   -373,   -349,    183,    896,   1845,  -1157,    351,
-      -367,   1171,   4362,    508,   5632,    704,  -1420,  -1886,
-       686,   5230,     -9,   2422,    230,    264,   3738,   -270,
-      -344,   -528,   -936,   2286,   -540,   4274,    337,   -665,
-       737,   1639,  -1307,   5827,    592,  -1372,   -412,   1419,
-      4579,    335,    223,  -1067,   -112,   -446,    149,   1375,
-      -155,   -392,  -1980,    561,    -67,    341,   6957,    475,
-     11449,     39,     81,    766,  -1880,    558,   -134,  -7940,
-      -489,    249,   -886,   -358,   6850,   2794,  -2217,   1111,
-     -1222,  -1130,   -818,   1076,  -1823,    865,  -2220,   1179,
-      4492,    224,  -2073,   -338,  -5351,   -390,    133,    496,
-       -42,    -16,     46,    437,    322,   -275,    -72,     48,
-      -325,    313,   1108,  -1044,   -851,  -5030,   1035,   4316,
-     -1281,   -913,  -1419,   -941,   1914,    960,   1242,    202,
-      5109,    475,   1254,   1725,  -1504,     -4,   -269,   -421,
-      -150,  -4409,   -610,  -1548,  -1684,   -817,   -210,     72,
-      -679,   -106,  -3809,  -1137,      4,   7220,    -95,    810,
-      2432,   -331,    492,    -81,    138,    -62,   -613,   -636,
-       106,  10908,    912,    144,    192,   1251,  -3970,   -954,
-      1145,   1175,  -1721,   5326,  -1721,   -569,  -3661,  -1166,
-      6605,   -744,  -1494,    853,    134,   3259,   -504,  -1740,
-       180,   -207,   -659,    196,    179,   -106,    118,    789,
-      -834,  10339,   -420,  -3002,   -456,    113,   6435,    949,
-       721,  -2709,  -1599,   -684,  -8068,    174,  -1416,    -58,
-       974,    308,   -726,   1237,  -1594,    519,   -131,   -198,
-     -1395,   1180,   -173,    338,  -5584,   -279,   -236,   6817,
-        89,   -220,   3967,   -107,     65,   2479,    -22,    642,
-      7179,   1179,   -229,   -202,   4948,  -5465,   1632,  -1285,
-      2188,  -2037,   1763,    636,   4247,    995,   1176,      2,
-     -2398,   1236,   -661,    382,  -1075,    130,    103,   -187,
-       604,   -306,  -2635,  -2185,    157,    775,   6373,   -924,
-      1758,  -3043,   1707,   2852,  -2148,   6779,    376,  -1018,
-     -2374,   -989,    249,  -5393,    -32,    538,   -416,  -5108,
-      -658,   1839,    419,   1153,  -3956,   -617,  -1925,   5434,
-       626,   1488,  -3824,    140,    370,  -2230,  -7031,   1989,
-      -581,    639,  -4249,   -216,   1225,   -776,   -973,   -542,
-     -2922,  -1783,  -2430,  -3251,    958,   3313,    636,  -6277,
-       119,   -866,   -406,   -156,  -4839,    966,   -469,   5559,
-       193,    376,  -4810,   -870,    163,   4130,   2596,   2203,
-      -114,   2423,   -622,   -424,   2935,    749,   2500,   4230,
-      -162,  -1489,   2169,  -5156,    751,   2748,   2240,  -1549,
-      4821,    175,   2274,    854,   2993,    838,    322,  -2663,
-      -794,   -283,    -98,   1393,   -709,    362,    285,  -1085,
-      1075,    374,   1062,   6512,  -3375,  -3138,   3939,   3628,
-      3926,  -2442,   1989,   -583,  -1282,  -1882,  -3920,  -4593,
-       540,   2667,   -155,    156,  -2428,   1229,   -436,   1754,
-      2815,  -1634,  -2299,   1155,    990,   3689,  -1242,   3145,
-      3951,     45,    186,  -1110,    257,   -335,   8929,    533,
-      -173,    813,     21,   1584,    541,    -44,   1349,    108,
-     -5163,   -684,   5522,   -868,  -5795,    769,    583,   2827,
-      -818,  -5551,   1485,     37,   -631,   -262,  -4352,   -532,
-        61,    434,   1775,   8974,   -112,   -852,  -1227,  -1645,
-       260,    298,   -430,    863,  -3860,    -97,   6467,   -328,
-     -2418,    -61,  -1253,   1575,     30,  -5683,   2113,    973,
-      -371,    -51,   5355,    471,   -584,   -492,  -2187,   2799,
-      -506,   4435,   1950,  -3415,   -363,   -404,    941,   2628,
-      -146,    434,   2853,    889,    634,   5749,    -54,    126,
-       189,  -1384,   -379,  -3205,   -540,   1720,    942,  -6300,
-      -286,    -58,  -1083,   3782,    251,   -334,   4172,    631,
-        17,     83,    707,   1322,   3273,   -573,   1024,  -6112,
-      -540,   4916,    155,  -1209,    308,   -738,  -2150,    786,
-      -168,     68,   -201,    -64,   -752,  -1595,  -9188,    320,
-      -426,    111,  -2183,    886,   -737,    193,   -837,   3219,
-      5936,   4022,    764,    -82,   3344,   -855,   3705,  -2652,
-      1533,   -206,  -3673,   1235,   1163,  -1217,   3183,   1313,
-      -745,   6554,   7019,   1302,   2129,    268,    -70,    110,
-       412,   -155,  -1703,  -4945,    105,  -1705,    412,  -6588,
-      2905,   1279,     73,  -2446,  -5635,   1168,   2974,    404,
-      -650,    265,  -1773,  -1857,   -108,   -651,    657,   -824,
-      3352,    177,    155,   1275,   2012,     31,     -7,  -1065,
-      2062,    411,  -2325,   -208,  -6306,    683,   1037,  -1060,
-       191,   -187,   -585,   6103,   -459,    571,   1640,   -693,
-       922,  -2291,    537,   1934,    263,   3847,   -202,   7060,
-       136,   4368,   2963,  -1032,     18,   1836,   -144,  -3853,
-       474,   2005,   1298,   2396,    825,  -2274,     12,   3759,
-      -394,    907,    490,   2997,   2180,  -1570,  -1000,   5982,
-      -129,   -820,  -3001,   2684,  -1132,  -2908,   1101,   5044,
-       393,  -1637,    393,   1343,  -1231,    404,   1817,   1463,
-      -443,   1053,   -584,  -7756,     45,    499,  -4109,    214,
-       535,  -3348,     54,  -1594,   6913,      0,    -94,   8772,
-       500,     13,    734,      5,    798,  -1521,    853,    -82,
-      -263,   -619,   1558,    456,   5911,  -1376,   1054,   -971,
-     -1275,   -147,   -111,   4964,    321,     67,   7024,   -525,
-       620,    883,  -1058,  -1132,  -3313,    630,    226,  -6201,
-     -1011,   1111,   -820,   -295,    580,    636,   2452,   -638,
-      6840,   -285,    655,   1502,  -1049,   -567,    329,    -33,
-      -249,    570,    186,    167,    780,   1104,     42,    197,
-     10034,  -1295,   -208,     32,  -1473,    716,    159,  -6672,
-       -45,    519,  -4300,   -246,   3692,   5062,   4305,   -748,
-      -548,    181,   -382,   -881,  -1968,    580,    964,   -420,
-      -327,  -3397,  -1584,   2770,  -3501,   1659,  -1252,   2352,
-         6,     30,      0,   -273,     27,   -204,   -485,   -432,
-        -6,    176,   -428,   1562,    104,  -6511,  -1084,   2205,
-       -11,  -5254,   -132,   -508,    -69,    373,  -1503,    208,
-       -58,   5311,     92,   -966,  -6563,   -480,    -24,   1424,
-     -1498,   -165,   4594,   -903,  -1787,   -353,  -7284,    142,
-      1008,    875,  -6109,    -16,    162,   4895,     30,   -188,
-      2099,   1581,    300,   -259,   -921,   -386,   -488,    140,
-      -482,   7135,    -77,    494,   -196,   3207,   -250,   -102,
-       318,    978,    161,   7292,     55,  -1347,  -2605,    898,
-      1833,    602,  -1988,    630,   -145,   -102,   -414,   -133,
-       417,   -603,    156,  -1151,   -395,    625,  -1676,     86,
-       680,  13321,    322,  -5816,   -292,   -223,   4205,   -361,
-       903,   -224,   1745,     95,  -6598,     79,   2323,    -24,
-       263,    778,    146,   -939,   1814,   1945,    720,    367,
-     -2987,    899,  -4409,    136,  -3185,   -342,  -3304,   1016,
-       284,   -345,   2313,   -403,    389,  -1403,   1835,    151,
-      -132,  -1702,   -339,  -5679,   2026,  -2990,     47,   -564,
-       399,  -2167,   1392,   1384,   5094,  -2954,   4467,    -22,
-       -23,    408,   1620,   1381,   2380,    805,    380,    -36,
-      -803,    765,   -778,    905,   -200,   -669,   3942,    289,
-       176,  -4767,   2015,  -3554,   1206,   6071,    180,   2057,
-       -48,    365,    -48,  -2423,    585,   -109,  -1298,   2519,
-      -525,   -589,    374,    976,   3667,   2091,  -2890,   1371,
-      -726,   -216,  -1027,   -116,   2122,   -619,  -3826,   4649,
-      1167,      0,   1237,   1538,   2505,   -548,  -3093,   1344,
-      -558,  -1927,    199,   2462,   1327,   4597,    833,  -3660,
-      -341,  -1010,    428,    148,  -1682,    130,   1569,   8785,
-      -752,  -1032,  -2407,    353,   -379,   3311,    892,    893,
-     -2596,   -217,   -835,  -2291,   1137,  -4339,    -58,   2759,
-       991,   3527,   -281,  -6050,  -1251,   1802,      8,  -3916,
-};
-
-static const int16_t shape8s[] = {
-      2639,    550,   6487,   2812,   1014,   1926,   2959,    757,
-     -1452,   -111,    -45,   -409,    401,    545,   1545,  -1677,
-        75,   -607,  -3658,   -368,  -4486,    272,   6017,   -468,
-      1108,   1056,    606,  -3288,   1003,   -830,   -336,  -2940,
-       247,    227,   1700,    338,   -161,   5694,    317,   -584,
-      6278,  -2902,  -3862,    293,  -3400,    540,    177,   -840,
-      -471,    963,   -243,   -289,     77,     39,   7626,    333,
-       577,    327,   -359,    999,   -392,    107,   1410,    509,
-      -983,     36,   -193,    -68,  -7612,   -775,   -178,   1415,
-      1069,   1534,  -1276,   1204,    615,   2065,    499,    124,
-       265,   -454,   1974,   6428,  -4028,   1102,  -1418,    -85,
-      -816,    -64,    -46,    926,   -960,     78,   4823,    -41,
-       -74,   -682,   -761,  -6598,   3084,  -1597,   2945,   -861,
-     -3203,   -669,  -3717,   -310,  -2865,  -1447,     72,   1987,
-       364,   4919,   -247,   3678,   -196,  -6807,   -127,   -965,
-       233,   -133,   4000,    -76,   -182,   3825,     67,    700,
-     -1934,    545,  -2467,  -1441,    629,   3409,    512,  -3333,
-       539,  -4896,   3413,  -2083,    554,    574,   9430,    296,
-       -88,   -533,   -321,  -1082,   2363,     42,    -50,  -5402,
-      -123,   4458,   1130,   2737,    378,   1509,  -3267,    970,
-       179,  -2114,    602,    479,   -438,    277,  -9389,   1144,
-      2453,  -3705,  -3842,   3965,    482,   1230,   2211,   -281,
-     -1833,  -1741,   1653,   -868,    485,  -3740,   5371,    989,
-      1182,     10,  -1812,    233,   1028,  -3300,   4698,   1572,
-      1580,    928,   -314,  -3452,    830,  -1511,  -1079,    554,
-       641,   1383,    105,  -1101,   1549,  -3944,    902,  -6557,
-       493,  -3117,    782,   -699,  -4806,    910,   -259,    -28,
-      1713,  -7012,    570,  -1270,  -4698,     -8,    220,  -4295,
-      1135,  -3905,    945,   -467,  -2164,   -651,    181,    212,
-       159,    587,   1587,   1101,  -7153,   -309,  -1470,  -1135,
-      -265,   -326,    172,   8840,    726,   -780,    170,  -1038,
-       466,    216,    764,    231,   -547,   2456,   -420,   8132,
-       486,    866,   -359,   3351,  -1829,   2018,   -352,  -1353,
-       711,    645,   1149,     74,   -466,   -669,   1009,   3086,
-       240,   7468,   -182,   1947,   -221,    496,   -448,    189,
-      -113,   -752,    133,   -214,  -1310,   -144,  -1034,   5235,
-     -1939,  -2664,    192,   1526,  -2320,    762,   -778,    357,
-      1251,    424,   -225,  -1008,   -229,   -352,  -3559,   -271,
-     -1069,   1274,   -175,    368,   6453,   -505,     31,   7678,
-       165,   -418,   -112,   -649,   1421,    667,   -334,   1041,
-      -353,    585,   4109,   1095,   5283,    685,   -687,  -1459,
-      1054,   5048,   -194,   2220,     81,    244,   3789,     12,
-      -923,  -1459,    319,   2378,    -53,   4097,   -662,  -1156,
-       223,   2589,   -547,   4951,   -346,  -1812,   -111,    344,
-      5247,    387,   -459,   -810,   1022,    234,    726,   1840,
-      -545,   -888,    728,    106,   1027,   -497,    349,   -248,
-     11173,   -311,    126,    479,  -2036,    265,  -1286,  -7196,
-      -511,    128,  -1833,    496,   7620,   2539,  -1809,    962,
-      -614,   -876,    857,   2178,    642,  -1180,  -2294,    911,
-      3932,    711,  -1073,  -1381,  -5317,    237,   -414,    579,
-       -78,    -27,    -78,    -14,    100,   -191,    142,     -1,
-       430,   -182,    207,    -61,    -72,  -4866,    583,   5099,
-      -704,  -1496,   1065,   -206,   2371,   1496,   1777,   -308,
-      4802,  -1415,   1178,   2650,    312,   -338,   -250,    -64,
-       -27,  -3163,   -561,  -1283,    952,   -902,    354,   1597,
-       -74,   -685,  -3266,   -873,   -744,   7079,    732,    697,
-       550,  -1362,    251,     34,   -742,      0,    105,   -608,
-        -1,  10459,    854,   -103,   -419,   2286,  -3041,  -3278,
-       -51,   -491,   -187,   4204,    857,  -1085,  -2501,  -1647,
-      6740,    605,  -2079,   1748,    519,   3462,    106,   -699,
-       220,   -615,   -406,    420,    786,    572,    679,    218,
-      -888,  10283,    129,  -2286,   -705,    -78,   5072,    634,
-       702,  -6315,   -551,   -307,  -7946,    177,  -1897,   -579,
-      1620,    125,    116,    -89,   -308,  -1018,    142,   -506,
-      -624,    917,   -779,    632,  -5103,    314,   -155,   5687,
-        77,   -144,   2957,   -176,     30,   1347,   -426,    -51,
-      7829,   1201,   -592,      1,   4617,  -5476,   2216,    414,
-      1281,    -81,   -423,   -322,   3623,    447,    863,   -375,
-      -489,    526,   -485,    159,   1090,    463,    401,   -131,
-       223,   1630,  -2462,  -2261,    623,   1019,   6385,   -595,
-      -654,  -2787,   2381,    328,  -2069,   5410,   -402,   -554,
-     -1594,   -860,     83,  -5011,   -938,   1061,    163,  -3523,
-     -1064,   1215,    761,   1604,  -4224,    904,  -2706,   4907,
-     -1838,   3287,  -3118,   -464,   -217,  -1187,  -6792,   1748,
-      -569,    613,  -3177,   -253,    164,   -845,    539,   -440,
-     -1871,  -2010,  -2322,  -3026,    478,   2297,   -560,  -5813,
-       768,  -1709,   -620,     66,  -4667,    805,   -215,   5366,
-      -442,   -233,  -6732,    345,    106,   4483,   1720,   2725,
-      -109,   2746,   -188,    204,   1905,   1225,    253,   3270,
-      1912,  -1852,   -256,  -4131,    768,   3984,    473,  -1434,
-      4380,    208,   2547,   1051,   3347,   -171,    629,  -2389,
-      -722,   -759,    166,   2192,    325,   -193,   -289,   -945,
-      -436,    931,   1352,   6918,  -2707,   -987,   2940,   3574,
-      4135,  -3205,    351,    927,    128,  -1873,  -4894,  -4816,
-      -461,    696,  -1618,    129,    -28,   2195,   2450,    585,
-      2557,  -1308,  -2204,   -590,   2345,   3699,   -312,   4436,
-      3422,   -611,   -106,  -2647,  -1752,    -73,   8914,   -673,
-      1625,    850,    720,  -1182,   -245,   -113,    882,   -223,
-     -4873,  -1009,   5643,    -97,  -4779,   -155,    444,   2894,
-      -876,  -5534,   1268,   -132,   -881,   -389,  -4250,   -153,
-       -44,    986,   1820,   8671,    662,   -344,   -198,  -1909,
-      1083,    114,   -318,   1070,  -3293,   -375,   6621,    232,
-     -2973,   -100,   -483,   -529,   -120,  -5312,   1702,    651,
-      -631,    485,   5675,     50,   1132,   -465,  -1053,   2675,
-     -1592,   5565,   1036,  -2808,    325,    999,    524,   2813,
-      -265,    337,   4226,    514,    576,   6047,    175,    204,
-      -514,   -617,    -94,  -2862,   -294,   1774,    978,  -7040,
-      -169,    835,   -829,   2258,    -37,   -319,   2750,    138,
-      -289,  -1092,     78,   1032,   4316,  -1201,    808,  -6243,
-      -940,   4136,     89,  -1076,   -647,   -255,   -207,    227,
-       -70,    -62,   -202,     66,     24,   -988,  -9542,   -225,
-      -739,    161,  -2698,    117,   -608,    173,   -629,   1770,
-      5037,   5145,   2530,  -1028,   3077,   -496,   4671,  -1859,
-      2148,    447,  -4231,    170,    713,    323,    746,   1447,
-     -1880,   5069,   7765,   -492,   -775,   -659,   -770,    -59,
-      -258,    -92,  -1683,  -4639,  -1727,  -2128,    545,  -5060,
-      2536,   1549,    492,  -1280,  -6034,    965,   3244,    475,
-     -1208,    680,   -283,    295,   -357,   -257,   1753,   -362,
-      3159,    106,   -181,   1805,    947,  -1002,   -136,    756,
-      1189,    237,  -2427,   -263,  -5746,     13,   2171,  -1197,
-      -319,   -372,  -1300,   5458,    955,   1224,    618,  -1087,
-      2661,  -2026,    -20,   2137,    342,   4076,    482,   5441,
-        -6,   2126,   -143,  -1596,    274,   1009,     94,  -3446,
-       398,   1079,    289,   2042,    883,  -2005,   -320,   3848,
-       395,    472,    615,   3245,    753,  -1881,   -216,   5670,
-       -64,   -565,  -2560,   1574,    772,  -3824,    932,   4830,
-      1182,  -1054,    390,    -40,   1833,   -350,    151,    149,
-      -966,    -62,   -713,  -8794,   -593,     87,  -3523,   -243,
-       560,  -3296,    244,   -775,   7174,    749,   -271,   8566,
-        99,   1258,   1239,   -489,   -107,  -1699,   -611,   1046,
-        65,   -509,    524,   -354,   6400,   -248,    148,   -682,
-       -93,  -1584,    -61,   4509,    479,    110,   7116,   -295,
-       480,   1545,      3,    127,  -2292,    894,   1261,  -6288,
-       -45,   -410,   -402,   -356,   2649,    649,   1652,   -643,
-      6587,    117,    876,    -33,    956,   -302,   1619,  -1023,
-       -99,    386,    -86,   -498,    684,   1189,    146,    381,
-      9832,    -97,    264,     91,  -1197,    461,    374,  -6788,
-       427,    294,  -4776,      0,   2868,   5199,   4573,   -827,
-     -1867,    623,  -1214,   -573,  -1099,  -1476,    306,   -701,
-      -224,  -4261,  -1135,   2500,  -4758,   1469,   -101,   1812,
-      -129,     15,    760,   -149,   -892,  -1417,    761,   1213,
-      -417,   1569,    -98,   1675,   -139,  -7382,   -633,   2584,
-      -519,  -5483,     29,    320,   -383,   -596,   -295,   -357,
-      -416,   4054,   -457,   -355,  -5213,   -840,   -319,   1321,
-      -424,   -129,   5225,    181,  -2696,   -174,  -7363,   -327,
-       519,    860,  -5132,    275,   -141,   4943,    204,   -200,
-      2989,    939,    390,   -461,   -333,   -394,   -174,    312,
-      -129,   7257,   -402,    860,     -1,   2677,    901,    609,
-       248,    935,   -493,   8147,   2081,  -1171,  -2145,   1560,
-      1634,     55,  -1746,    561,   -747,    931,   -712,   -544,
-       798,    -98,    580,   -829,   -546,    238,  -2052,   -197,
-       802,  13067,    373,  -6438,   1159,   -845,   4313,     19,
-       670,   -627,   -944,   1277,  -6997,   -609,   1913,    607,
-      -454,    -89,    859,    -43,    -71,    494,    169,   -713,
-     -2014,   1570,  -4712,    233,  -4113,    210,  -3689,   1019,
-       200,     49,   1800,   -611,   -472,   1234,    579,    363,
-      -134,    233,    101,  -5539,   1924,  -1734,   -982,   -928,
-      -707,  -1238,   1586,   3676,   4741,  -2770,   3105,    942,
-     -1933,   1363,    288,  -2528,    160,    485,    -38,     23,
-       113,    -19,   -518,   -110,   -173,   -170,    589,   -473,
-       296,  -3742,   1109,  -2977,   1349,   5899,     98,   3130,
-       855,    499,      3,  -3111,   -592,    572,   -890,    687,
-       697,    194,   -344,   1139,   3255,   1270,  -2451,   1958,
-      -395,    267,   -951,  -2224,   2108,    -11,  -3357,   2602,
-      2403,   1596,   -532,   2701,   2251,  -1217,  -2148,    691,
-      -757,  -2051,    373,   1964,   1493,   4756,   1246,  -4345,
-      -496,  -1333,    -20,    -84,  -1558,    305,   1183,   8148,
-      -628,   -702,  -1730,    232,   -261,   2732,    245,    353,
-     -3745,   1013,    186,  -2042,    810,  -3894,    351,   2501,
-       852,   4162,   -425,  -4941,  -1536,   2237,   1348,  -4274,
-};
-
-static const int16_t shape11[] = {
-       347,  -5391,    106,    156,   -182,    -36,    177,    401,
-       700,    524,  -1343,   -402,  -6982,     63,    194,    -14,
-        82,    -36,   -677,   -393,    187,   7364,   -507,  -1173,
-      -759,  -3759,   -728,   2970,   1334,     32,  -1322,  -2965,
-       156,   -839,    382,  -6382,   -149,    874,   1352,    -35,
-      -499,     99,   -425,  -3118,    -32,  -1596,   5608,   -822,
-       -41,   2974,   -592,    615,   1777,   2364,   5189,  -4171,
-      -581,    936,   -527,    318,  -1606,   -551,   5350,   -448,
-       -40,   7476,    189,    319,  -1390,     10,   -921,  10016,
-       573,  -1065,    829,  -1190,    -22,  -4263,     87,  -1742,
-      -325,    313,   -188,    540,  -5542,   -188,    511,   -168,
-      -518,     17,    152,   1966,  -2568,   -860,   2735,  -1210,
-       404,   -144,  -6873,   -129,    434,  -2978,   2829,    -48,
-     -9196,  -1829, -11261,   1492,  -4938,   1802,     93,    384,
-      1340,    236,  10066,    731,    861,   -195,  -7571,    -77,
-      -481,   -700,   4694,   -734,  -6317,    281,   1773,    175,
-     -5535,    532,     31,   7012,   -637,  -3586,   1096,   3596,
-      -197,  -7837,   -611,   1825,    -26,   -259,   2307,     12,
-       729,  -1958,    156,    262,   5494,     26,  -5792,  -3146,
-       450,  -1075,    297,    509,    154,    668,    191,   -268,
-     -1585,    369,   1314,   -693,    677,   1482,    198,    378,
-     11088,    -83,   2321,   -193,  -1082,  -3053,     20,   -271,
-     12975,    272,   1114,    476,   -798,   -309,   -159,   5406,
-      -109,   -675,    621,  -2564,  11190,  -1342,    -88,    428,
-      -465,  -4633,   -503,    106,  -9448,   -454,    -28,   -402,
-      1271,  -7972,    754,   -207,  -2491,    518,  -3701,   -542,
-     -1268,   -617,   -177,    467,   -130,    990,   4087,    857,
-      -524,  -5822,    145,    217,  -7703,   -275,   6647,    -81,
-       550,    887,   -433,   -802,    532,    643,    188,   1965,
-      -920,   -284,   3711,   1196,  -8896,   -357,   -626,    908,
-      -284,   -706,  -1582,    182,   7705,   -138,  -2372,   -158,
-      -888,   4247,   4381,  -6722,  -1619,  -1810,    632,  -1176,
-       -62,   4261,    -89,    265,   1405,  -1449,   -389,  -7068,
-       258,   -244,   -272,  -8149,     37,   -457,  -8839,   3243,
-     -4291,   -396,  -3935,    907,    -58,   2388,   -908,  -1209,
-      -635,   -487,  -1717,   6989,  -4834,   2136,   -822,   -699,
-      2187,    -96,  -9775,  -3464,    795,    634,   -823,   -669,
-       146,   -843,     15,   -227,    671,   -707, -10004,    198,
-        81,  -1611,    -34,  -2127,  -2385,   -689,    622,   1834,
-       -63,  -4925,   -215,  -1181,   -514,   7701,    607,   2030,
-      -264,   2479,    913,    178,   3625,   -194,    613,    877,
-      -384,  -7732,   1008,   2117,    528,   -301,    540,    -80,
-       559,     28,   7542,   -496,   1146,  -6573,  -1457,   7789,
-      -227,  -1671,    -76,   -371,   -865,   -141,     42,     96,
-       277,   -410,  -5606,    328,  -8954,   -222,  -1792,    981,
-      -120,   -650,   2269,  -1412,   1038,   -186,  -8530,   -264,
-      2284,   -727,   1511,  -4611,  -1653,   1985,    -50,  -8985,
-      -245,  -3315,    407,   -915,    -23,    -70,     30,   -669,
-      -303,    902,     84,    433,    217,  -8303,   7847,  -1865,
-      -680,    254,    -38,    364,     16,     50,     90,   -534,
-     -4649,   -800,    969,  -1081,    454,    147,    -62,   8797,
-        84,   -912,   -518,   -351,     76,   -560,  -1438,    629,
-     16384,    656,    151,    880,    396,    -90,    752,   -138,
-      -861,   9605,    258,   -440,  -6441,    434,   5765,    282,
-      1494,   -260,   -180,   -769,   7867,    -86,    536,   -262,
-      -230,  -8956,   5857,   -591,   1533,    418,   -505,   -156,
-      1165,    415,   -168,  -1504,   -336,   -667,    527,   5725,
-        42,    429,   1691,      1,     85,   -196,   3681,     36,
-       469,   -364,    559,    910,  -1848,    259,    249,  -1688,
-       261,    -36,   -592,   -156,    -69,  -5938,   -180,   -294,
-        22,   -903,   1389,   4853,    121,   5185,    970,   1210,
-       561,    926,    472,   -183,   6623,    357,    -78,  -5877,
-        91,   -188,  -6746,   -146,    342,  -5648,   3697,   1336,
-       728,    -69,    398,   2667,  -2103,   1901,   -807,    258,
-        72,   -137,    341,     71,   -169,   -104,    -83,    206,
-      -420,   1187,    744,    120,  -5151,   -574,     72,  -8553,
-      -312,    140,    -69,   6067,   5229,    202,  -1722,   -164,
-        73,   1695,  -1064,    234,     24,   4881,   -849,   -460,
-      8641,   -328,  -1217,   1666,   -283,    -76,   2772,    401,
-       843,  -4756,    297,   8593,    367,   -732,   -225,   -198,
-     -3936,    248,   -436,    473,    -19,   -441,    164,    220,
-      -266,      3,    106,   -244,  -5814,    597,   -666,   -245,
-     -9298,   -867,   -480,    280,    -40,   -139,  -6378,  -4972,
-      -886,   3062,    747,  -1991,  -1668,   -423,    534,    866,
-       -73,  -6501,   -195,    324,    -51,   -123,    298,    500,
-       193,    278,  -8503,   -297,   1034,    -16,   -209,   7451,
-       521,   -305,   -297,  -1537,  -3025,    689,    248,    319,
-      5393,   1497,   2228,   -773,   -141,   2184,   1024,  -4535,
-     -9160,   -600,   -932,  -2145,   -539,    460,  -1943,   4265,
-     -2512,   4416,   -304,   1744,    489,   -362,    898,   2236,
-     -2224,     49,   -192,    332,    366,   -143,    329,  -7747,
-        -4,   1075,    116,    551,     19,     -7,   7090,   -169,
-       837,    -71,   -371,    451,    -31,    474,    867,   -421,
-     -4544,     78,   3208,   -549,   1984,   1386,  -2208,  -1402,
-      1616,    189,    -37,  -6953,  -5733,   1589,  -1314,   1040,
-     -1480,  -5608,   2627,   3517,    250,   7930,     94,   4687,
-      1522,   5543,   -130,   -462,   7613,   -654,    647,  -6187,
-       139,    342,   5069,   -729,    128,     17,    -49,    176,
-       122,    826,    503,     76,   -196,  15583,  12884,    746,
-     -3942,    814,  -1744,   1774,   -338,   3089,  -1694,    559,
-     -5355,   2834,  -1448,    108,   -329,   -711,    350,    171,
-       297,   -123,    672,    625,  -5884,   6822,    842,    276,
-       242,  -2254,   -623,   -846,   2441,    887,  -2066,  -1019,
-      1329,    107,    -83,    826,    -67,   -352,    549,    137,
-     -1023,   -184,    -11,  13790,     48,    883,   3538,   -533,
-     -5553,    861,    738,   -436,  -5259,    -66,   -405,   3777,
-      -574,    738,    253,    363,    -76,    288,    324,   -337,
-       157,   -119,    -97,    171,    514,  -1932,  -5171,    579,
-       249,   1072,   -204,   -194,   -311,    655,  -6728,    186,
-      -178,     99,   5749,   -329,    419,    924,  -1131,    598,
-       -15,   -103,  -2277,    186,   -716,   -542,    153,   -226,
-      5689,    219,     52,   3706,   -917,    140, -10576,   -151,
-      1060,    645,    404,   1310,    331,    216,  -1413,  -6030,
-     -5069,  -3992,   1366,    932,   1559,    -87,   7799,   3854,
-      3762,  -1043,    474,   1184,    102,  -2775,  -1199,  -1079,
-       358,    -63,   9784,    141,   3947,    194,   -132,   -332,
-      -512,   -212,  -5839,   -227,   7759,    807,   -597,  -1782,
-      -148,   -352,  -1225,   -692,    147,  -1970,   3508,   -947,
-      3463,   -197,   4737,   -698,    578,   -172,   -775,   8167,
-      3102,    883,   -914,     16,    827,    114,  -1916,   -909,
-      -606,     87,   1036,   -435,    102,     96,   -370,   -204,
-    -11952,     21,    477,   1285,   6281,    855,  -7717,   1155,
-      -501,   -597,   5943,    145,   -630,  -3406,     13,  -4211,
-       679,   6570,   -231,  -6042,   -503,   -194,   1437,   5640,
-     -1222,   8181,    386,   -986,   -503,   1221,    839,    763,
-      -277,  -1787,  -1491,      5,   -206,     42,   2800,   -332,
-     -2841,   -143,   -456,    646,   -668,   -117,    883,     86,
-      7111,   -270,    624,  -1133,   -308,   -479,  -9149,  -1424,
-       242, -12048,      8,   2307,  -6530,   -529,    462,  -1346,
-      -153,   4315,   -182,   -675,    -78,   -480,    -49,    398,
-      -408,  -1440,   8196,    436,   -561,   -184,    175,   1799,
-      -154,   -439,   -721,   2170,    322,   6555,   -539,  -1672,
-      -629,  -2985,    239,    -37,   7544,  -1048,  -1241,   7241,
-      -636,   2044,   -750,   1206,   1363,   -530,  -5960,    342,
-     -7440,    616,    372,   4572,   -118,    343,   1086,    570,
-      -164,    553,   -433,    562,     33,   8225,   -235,   -234,
-      1230,    234,    906,    563,    -73,  10464,   -353,   -644,
-     -1453,   1119,    237,    670,   -112,   7083,   -451,   3410,
-      -105,   3244,  -1331,    102,    738,  -3602,     76,    413,
-      -318,     10,  -5471,   1024,   -335,    246,  -7820,   -164,
-      2515,  -1411,    673,   6022,     50,  -6715,    268,   2152,
-      -951,    -60,    234,  -2085,    342,   3002,   -169,   2473,
-      -667,  -6846,    870,   5467,    150,    -66,  -4294,   -299,
-      -612,  -3859,    177,    353,  -4726,    547,    340,  -5646,
-     -2022,    117,  -4949,   -303,    280,   -266,   -361,    673,
-      -139,     -5,  -7123,   -264,    243,  -5245,    351,    656,
-      5005,    682,   -107,    298,    -79,   1407,   -449,   -797,
-      -669,   -552,   -242,  -8013,     56,   4092,   1583,  -3981,
-       -49,  -7972,    390,    366,    -31,   1126,    272,   5120,
-       -10,   1147,  -3682,   -155,    252,    163,    455,    358,
-      -746,  -2719,   -431,    444,   -433,    432,   -357,   5370,
-       328,     -3,   1748,    514,   7198,   -527,    172,    401,
-       -59,  -3586,   1443,    534,   1029,    539,   3723,   5392,
-     -6619,  -2559,   2344,    282,   -980,     97,   -317,   -786,
-       475,  -8646,    307,    447,  -3107,    211,    -56,   3344,
-     -1549,  -9223,    454,    352,    -27,    205,    503,    260,
-      -372,   -631,  -1165,  -6543,    444,   1535,    404,  -1752,
-       -43,  -9381,    754,    -94,  -7134,   2064,    170,   8222,
-      -280,  -1250,   -347,   1688,  -1203,    239,  -1048,  -4570,
-     -4720,   -434,  -1008,  -4151,  -2211,  -1414,   -506,  -5411,
-      5379,    984,   4587,    -63,    143,    968,   -203,   5315,
-       591,   -756,   1228,   -372,    703,   6829,    -76,   6935,
-       467,   3119,     -2,  -3825,    175,  -4000,  -3012,  -7745,
-      -832,  -2582,    173,   1992,   3768,    275,     39,    603,
-      -536,   5851,    474,    254,    -72,   1286,   -836,   5576,
-      1357,   3524,    406,  -9214,   -554,   3974,   -352,   1763,
-      -482,    658,   1628,   3885,   1938,   6172,   1693,  -5183,
-       150,  -6729,   1238,   1062, -10035,   -428,     48,    421,
-      -185,    659,   -426,   -633,    131,   -741,    462,   -463,
-      -391,   -193,   -270,   -682,   -343, -12130,    -86,   -148,
-};
-
-static const int16_t shape11s[] = {
-        22,  -5296,   -415,   -206,    306,    265,    189,    376,
-       721,  -1503,   -429,   -538,  -6008,    -97,   -385,   -570,
-      -313,  -1469,   -219,  -1661,     10,   6256,  -1230,   -635,
-       -28,  -4208,   -344,    394,    138,   1174,   -170,   -822,
-       114,  -1087,   -101,  -7362,     84,    862,   1514,    341,
-      -115,    320,   -120,  -1625,     55,   -719,   1443,   -733,
-      -577,   7197,    148,     26,    120,   1969,   4940,  -3777,
-      -607,   1675,     64,   -634,    -84,    334,   6882,   -644,
-      -232,   5008,   -316,   -164,   -138,    -16,     15,   9441,
-       -74,    -65,    262,    834,   1143,   -101,    434,   -329,
-       123,   -204,    -45,    147,  -4586,   -742,    464,   1412,
-       548,  -1602,    -56,   1356,   -771,    263,    709,   -481,
-      -193,    345,  -8395,    -41,     36,  -1900,   -178,    816,
-     -7590,     31,  -3011,   -371,  -2698,   2234,    -99,      0,
-       714,   -845,   9357,    701,  -1269,   -187,  -4227,   -450,
-       -73,  -1637,   4679,   -138,  -4470,    356,   1416,   1462,
-     -3162,    453,    -61,   5243,   -241,  -2385,    438,   4919,
-      -252,  -3781,    150,    335,     58,   -185,   1870,    179,
-       192,  -2572,   -454,     77,   4819,   1891,  -4843,  -2106,
-      -472,  -3842,    167,   1092,   -671,    194,   -870,    139,
-      -115,   -455,    452,   -519,    299,   1024,    330,    -99,
-     11189,     82,     57,   -849,    167,  -4190,    639,    768,
-      7477,    626,     94,  -1259,   -303,    181,   -280,   2873,
-      -589,   -461,   1591,    -29,   6940,  -1264,    120,   -282,
-      -159,  -3755,     -4,    -61, -10172,    152,    -12,   -200,
-       111,  -8471,   -243,    400,   -842,   1661,  -3099,    500,
-      -451,   -423,   -193,    230,    423,    263,   5011,   1010,
-      1044,  -4781,    707,     84,  -6091,   -213,   5193,    434,
-       534,   1100,   -520,  -1590,     75,   -322,      2,   2008,
-      -534,    153,   2641,   1510,  -6830,   -246,      4,    271,
-        75,  -1308,  -1934,   -257,   6748,    589,   -301,    627,
-      1197,   3708,   4450,  -5582,  -1312,  -2859,    881,    429,
-       552,    738,   -882,    984,    488,   -868,   -464,  -6969,
-       721,  -2078,    417,  -6121,   -184,   -128,  -7840,   2659,
-     -2584,   -254,    176,   -790,   -727,    482,    357,    104,
-      -441,   -158,   -980,   4563,  -4098,   1086,  -1217,   -562,
-      2033,    512,  -8331,  -3506,    -73,    808,   -372,  -1602,
-       748,    911,   -599,  -1499,     58,    309, -10000,   -115,
-        70,   1603,    280,   -146,   -817,    517,     18,   1355,
-      -121,  -4134,    152,  -1300,    247,   7258,    415,    130,
-       -27,   2108,    337,   -816,   2480,    396,    533,     66,
-      -171,  -6213,     47,   3081,   -648,   -930,   1810,   -233,
-      -433,   -588,   5526,     58,    -18,  -3498,   -381,   8009,
-         7,   1229,    152,   -410,   -567,    423,   -354,    463,
-       -82,   -146,  -2868,    271,  -5773,   2694,  -1006,    150,
-      -113,   -521,   2553,   -278,    593,    -69,  -6517,   -785,
-       369,  -2483,   -216,  -3144,   -889,   1724,   -168,  -6303,
-       171,  -1895,   -798,   -137,   -172,   -746,    -54,    162,
-      -607,    409,    201,   -284,   -143, -10681,   7747,  -1148,
-       303,     58,      4,    -96,   -485,   -146,   -286,   -577,
-      -644,   -512,    236,    576,    421,     93,    293,  10284,
-        -2,   -117,   -590,   -546,    350,    445,   -301,   -300,
-     10823,   -224,    -96,   -551,   -148,   1042,   -125,    224,
-      -706,   8583,   -195,     52,  -2732,    200,   4419,    390,
-       870,    100,   -184,    233,   6179,   -317,   -472,   1964,
-      -302,  -8722,   2509,   -644,    488,  -3101,    891,   -253,
-       -38,    133,    -15,  -1365,   -779,   -612,    673,   5587,
-       834,    377,    835,  -2018,     75,   -185,   3641,    121,
-       693,     63,    503,    646,     -7,    348,    141,  -1311,
-       532,   -513,     95,   -315,    -65,  -6478,    -16,   -848,
-      -210,   -120,    676,   5125,    533,   4147,   -622,     -4,
-      -150,  -1507,   -124,   -185,   5365,    267,   1073,  -4479,
-       173,   -204,  -4164,   -952,    -23,  -4088,   1391,    205,
-       712,   -473,   -373,    547,   -685,   4542,    -49,    -71,
-        33,   -271,    132,    246,   -188,      6,   -309,    118,
-        96,   1774,    158,    -83,  -3573,   1175,   -122,  -6619,
-     -1677,  -1161,   -266,   4776,   3453,     62,   -346,   -450,
-     -1380,    103,   -457,  -1260,    -71,   4271,   -338,  -1394,
-      6462,    395,    647,   2430,   -735,    444,   1837,    403,
-       144,  -5573,    211,   4608,    -15,    804,     70,   1969,
-     -3451,   -138,   -352,   1176,   -171,   -518,   -114,    -88,
-       335,   -308,    -64,   -428,  -4115,    318,   -205,   -126,
-     -7854,   -609,    105,    144,    270,    266,  -4543,  -5246,
-      -311,    587,    305,   -115,    372,    727,   -294,    414,
-       877,  -7899,    411,   -538,    394,    535,    233,   -826,
-       329,    491,  -4848,   -650,    331,   1026,   -140,   6474,
-       194,   -457,     98,   -871,  -2293,    873,    353,    812,
-      4510,   1102,    379,    651,   -214,   -110,     20,  -2749,
-     -8040,    -96,    221,    221,    -39,    444,   -280,   2814,
-      -536,   3509,    111,    830,    594,    553,     47,   2812,
-     -1898,    203,   -353,    -60,    371,    181,    824,  -5448,
-       297,    476,     42,   -133,     97,    425,   8586,   -317,
-       121,    453,   1014,   -350,    175,    747,    -78,   -287,
-     -5832,    625,   4170,   -308,   1853,   2846,     -3,   -876,
-       535,    431,   -411,  -2139,  -6021,    374,    298,   1572,
-        19,  -4069,   1567,    144,      3,   5541,   -438,    920,
-        87,   1728,    230,    807,   5848,   -413,      7,  -6241,
-       214,    205,   1312,   -675,     70,    264,    114,    -24,
-      -482,    -72,   -296,    327,    249,  11047,  11070,     18,
-      -937,    350,     22,    362,    555,    815,    130,   -125,
-     -4545,   2662,    203,   -318,   -305,    323,    633,    416,
-      -254,    301,     99,    407,  -4951,   4766,   -790,   1334,
-       912,  -1046,   -350,   -135,   3744,     22,  -1647,   -422,
-      -151,   -113,   -130,   -345,     -2,   -263,     18,    -24,
-      -771,    -34,   -543,  10259,    183,      0,   1743,   1267,
-     -2554,    320,    611,  -1064,  -1446,    875,   -808,   4865,
-      -816,   3452,     68,    326,   -178,    177,    -10,   -138,
-       -33,    -93,     65,    264,    185,   -157,  -5749,    110,
-       407,   1240,   -698,    -61,    176,   1557,  -6012,   -606,
-      -555,    458,   3226,   -939,    933,    153,    -32,    928,
-        69,   -490,  -1543,    -87,    -20,   -196,   -327,    423,
-      7911,   -189,    178,    335,   -194,    459, -10572,   -196,
-       174,   -286,    502,  -1041,     12,     39,   -101,  -3983,
-     -1650,  -2902,    386,   -151,   1051,   -619,   6854,   3408,
-      1140,  -1854,   -755,    -40,  -1108,  -1502,    221,   -397,
-       375,   1081,  10375,    389,    270,   -239,    311,   -212,
-       384,   1237,  -2951,    199,   5281,    -56,     34,   -704,
-       942,   1169,     33,   -310,     97,  -1216,   3023,   -836,
-      3256,    404,   3951,   -257,   2139,    111,    179,   8255,
-       611,   -240,   -252,   -367,   -251,   -296,  -2282,    957,
-        61,   -265,    720,    232,     34,    146,    204,   -290,
-     -9923,    529,     65,    696,   2958,    352,  -3852,   1248,
-      -743,   -395,   5969,     92,   -132,  -1206,    314,  -4013,
-       717,   5157,   -770,  -1878,  -1201,   -958,    525,   4028,
-       116,   6772,    -45,  -1086,   -335,   5815,     51,     57,
-       -85,  -2301,   -133,   -300,      7,    227,   3429,  -1075,
-     -4353,   -832,     30,   1259,   -484,    451,    604,   -717,
-      6765,    294,    118,   -410,    299,    592,  -3845,     66,
-      -502,  -9088,    -74,    259,    450,    475,    202,  -1792,
-        23,   4719,    709,   -398,  -1676,   -351,   -898,   -622,
-       145,  -1392,   7305,   1014,    -80,    519,  -2065,   1531,
-       860,  -1448,    134,   1683,    689,   7179,   -345,   -327,
-      1004,  -2467,   -340,  -1302,   5825,    373,     50,   6796,
-       314,     13,   -270,   -426,    702,    279,  -4392,   -508,
-     -6521,     60,   -278,   2479,    847,   -360,    -68,  -1948,
-        91,    969,    421,    459,   -341,   6020,   -550,    -77,
-      -687,   -754,      5,    109,    410,  10860,   -183,   -317,
-      -734,    -87,    501,   -601,    158,   5836,  -1057,   1236,
-      -850,   2965,   -330,    547,   1249,  -2804,    127,    218,
-      -455,   -805,  -4002,    108,   -569,    660,  -5356,  -1091,
-       581,   -445,   -311,   6409,    510,  -6789,    519,   1607,
-       296,    342,    368,  -1440,   -846,   1997,   -227,   2332,
-     -2062,  -4657,   1030,   5322,    135,    131,  -3414,    320,
-      1030,  -3341,   -256,   -373,  -4565,   1222,    171,  -4972,
-     -1444,    303,  -5427,    435,    208,    251,    467,    539,
-       136,    199,  -8876,   -195,   -771,  -3096,    740,    368,
-      1047,   -490,     83,    485,    168,    531,   -635,   -801,
-      -953,      4,    -95,  -7603,    -59,   2023,    739,   -702,
-       263,  -9230,   -313,   -997,   -510,   -772,    156,   3986,
-      -113,    398,  -2602,  -1079,    195,   -211,    128,   1917,
-       221,   -965,     11,     71,   -101,    180,    -36,   7839,
-      -144,   -722,    288,    429,   5704,   -984,   -510,    775,
-       440,  -1849,  -1348,   1989,    300,     43,   1928,   4341,
-     -3840,  -2427,   2025,   -660,   -293,     23,   -249,   -177,
-      -327,  -7858,     33,    245,  -1334,    237,   -687,   2800,
-        30,  -8807,   -404,     43,    183,    289,    528,    510,
-      -197,    590,    -94,  -5423,    381,   1317,    141,  -1639,
-      -432,  -7628,   -224,     56,  -7788,    113,    134,   6981,
-      -636,    756,   -743,     97,    159,   1263,   -143,  -2941,
-     -2680,   -479,   1395,  -1667,   -472,   -992,   -451,  -5708,
-      4262,    334,   3053,     76,   -584,   -599,   -276,   3518,
-       264,  -2118,    358,   -106,    911,   5053,    480,   4538,
-       949,   5203,   -103,    -14,    177,  -3397,     55,  -6813,
-       680,  -1788,    145,   2267,   1104,   -789,     54,    261,
-       228,   5494,     15,   -224,    192,    740,      0,   7632,
-       398,   2879,    430,  -8212,   -657,    815,   -228,   -488,
-       -90,  -1296,    595,   2979,    -15,   4055,   -252,  -3883,
-      -935,  -7654,    330,     97, -10200,    462,    223,  -1017,
-      -309,   -342,   -124,  -1258,    211,    351,    316,    414,
-       -91,    -18,   -202,    -74,    410, -11127,    326,    261,
-};
-
-static const int16_t shape16[] = {
-      -855,   1549,  -4841,    629,    932,  -5896,    840,  -2041,
-      -305,  -2574,    343,    -31,   -780,   -773,   -353,    403,
-     -1907,  -2371,   -555,   -324,   -479,   6961,   -286,  -4290,
-       626,   -953,    -14,  -1681,   -443,   1504,   -366,    513,
-     -1206,    870,   9239,    112,   -213,    425,    381,   1802,
-       750,    594,     61,   -152,  -2060,  -8997,   -752,    197,
-      -493,   -176,   -389,   -591,   2988,    654,   2404,   -204,
-       304,   -279,    202,     66,   -185,    415,    159,  -1514,
-     -6775,    -37,  -2617,  -1246,  -4012,   1208,   -554,   3240,
-      -655,   -394,  -1464,  -4448,    388,   1058,   -364,  -1760,
-      1081,   -558,   -116,   -108,     99,   -925,    763,  -1301,
-      -251,    258,    -33,    311,    555,    227,   -279,   -601,
-      -135,   -675, -10615,   -937,    158,    503,  -2044,   1075,
-      -114,   4278,  -9040,     67,  -1076,   -705,   -122,   -533,
-      3299,  -1826,  -1316,    708,  -3840,   -740,   -370,  -1074,
-        87,   -462,   2177,  -1177,     57,  -6311,   -170,   -777,
-      -256,    435,    291,  10371,    -82,   -425,  -1757,   -196,
-      3824,  -6289,     62,   4506,   -519,   -783,   1155,    878,
-       295,  -2044,    305,    186,    263,  -1716,   -482,  -5678,
-       415,   2709,    213,   7531,   1376,    813,   1803,    190,
-       398,   6483,   1425,    235,   2713,    520,  -2892,  -1191,
-      6074,    654,  -6535,    320,   -736,   -478,   2563,   -309,
-     -3477,   -155,    275,   1024,    390,   -386,   -331,  14043,
-       251,   -410,   1496,     24,   1272,   -816,    549,   -238,
-     -2489,    158,    194,      1,   -306,  -3088,   -264,    200,
-       -30,   -520,   -472,    -30,   -464,   -764,    440,   -659,
-        88,    778,    -31,  -1794,  -3817,   -344,    887,   -551,
-       115,   -763,  -5338,   2906,     50,    736,   5536,  -1101,
-       330,   -405,    416,   1022,    -93,     71,  10034,   -200,
-     -1258,  -3405,    480,    141,    399,    500,    311,   -503,
-       301,   4398,    454,   -922,    975,   -101,   -775,    -81,
-     -1723,   1077,    857,  -1682,    813,    847,    342,   -276,
-      3582,   2991,   5571,    713,   1280,    596,  -1325,  -1087,
-      -681,   1411,    391,  -1728,    492,    544,   1512,   -724,
-     -7445,   -426,      6,   -534,  -3643,  -1598,   2650,   -834,
-      2096,   -333,     67,   1746,  -1584,  -1003,   1272,   1710,
-      1666,    176, -11716,    329,  -1829,    385,    802,   -382,
-      2244,     -8,   -222,  -2351,    369,  -1067,  -9354,    293,
-       -51,  -1849,   -500,  -2350,  -1824,   -826,   -450,  -2155,
-       456,    245,   1796,    320,    -73,   -306,   -122,    290,
-       118,   -298,   -675,   -180,   -828,     86,    -44,    165,
-       435,  -8249,    769,    630,  -1670,   -762,    453,   5893,
-       259,    -92,  -1003,   -358,    -32,  -1350,   -535,   -289,
-       409,   -558,   -344,   -752,   6037,   -680,   2471,    581,
-      -351,   1251,  -5827,    194,   -104,    815,   1257,   -619,
-       243,    410,   4455,   -969,     50,   1286,  -1013,   -293,
-     -7740,     73,    615,    523,   -149,   -824,   2235,   1571,
-       970,    944,   4778,   -132,  -5082,     83,    129,   -820,
-      -803,    694,   1615,   1163,    517,   -402,    -80,    762,
-      -107,   -419,    142,   -294,  11298,    301,    484,   -513,
-       105,    547,   1130,  -4253,   -742,    376,  -1545,   1076,
-      4372,   2338,  -2847,    495,   -190,  -2444,    931,   6487,
-       117,  -1273,   1488,    -75,   -322,   -487,  -2614,   -251,
-      1233,   4111,   -321,   -219,  -7961,    -11,    107,   -808,
-       450,    111,   4395,     89,    772,  -1878,  -1894,   1075,
-      -544,  -9467,   -459,    637,    842,   -956,   -738,   4452,
-       777,    -75,   -209,   -302,   -796,    785,  -7413,    321,
-       649,    -55,    114,     43,  -1026,   -223,   -611,    209,
-     -5543,   8206,    907,  -3358,   1452,   -543,  -3173,    525,
-       -95,     35,   -475,   -525,   -705,   -569,    350,    206,
-      -108,  -1523,   -680,   -283,  -2583,  -4992,    -59,   -968,
-     -1719,  -2750,   5884,    455,     29,    436,    784,   -101,
-      -216,    110,    612,   -511,    -12,     98,    -67,    177,
-     -1210,    222,   -345,    243, -12670,   -472,    282,  -2149,
-       687,  -2631,   4434,     77,   -521,   -404,   -934,    212,
-      -695,   -369,   1138,   1348,   -905,    501,    299, -10467,
-      1018,    818,   1941,     31,    257,   1219,    944,   -157,
-      1968,  -1649,   -126,   -440,   -599,     -1,   6190,   2574,
-      -332,    753,    195,   -131,   5972,   -297,    672,    -86,
-      -143,   -303,      5,   -121,   -154,   -613,   5541,  -1516,
-      -304,    962,     69,  -1857,   4142,   -134,    706,    896,
-     -1226,   -135,   -310,  -9261,   1135,  -3437,    620,    802,
-       -33,   -582,   1909,   1407,    242,   2599,  -1533,   -279,
-       836,   8070,  -1207,   5745,    200,    -77,    162,    781,
-      -466,  -1555,   3297,   -957,    225,   1290,      7,    677,
-        41,   -549,  -2778,   1400,    379,  -3367,    369,    615,
-     -6402,    527,     58,   5679,   -114,   -180,   2842,     88,
-     -2611,    -50,    371,    161,   -444,   2062,    -38,    272,
-     -8562,    769,     18,  -2593,   -226,   -503,   -959,  -1295,
-       189,   -371,   -675,  -1528,    -98,    514,  -1236,    116,
-       202,  13662,   1596,   -328,     61,   3567,   -486,  -3316,
-     -8473,   -317,   2868,   -419,    -17,    535,   -965,   -503,
-     -3848,   2222,    620,  -1740,      2,   6505,    473,   -297,
-       -70,   3043,    -51,  -1520,    993,   1046,   1965,   3240,
-      1971,    -60,   -650,    -53,   -248,  -4428,   -365,  -3723,
-      1122,  -1681,   1629,   1358,    -17,   1136,   -256,   2344,
-      -282,    156,    127,   -155,    318,  -1281,  -1066,     57,
-      -889,   -253,  -1396,   -579,   -920,  -1006,  -9202,   -703,
-       195,   5186,    241,   1742,    996,    118,   1431,   4415,
-     -2452,   6837,  -1272,   -569,   3485,    328,    441,    832,
-       553,     94,    648,     92,   -378,  11167,    775,    457,
-      1712,    -24,    941,   5433,  -1645,   2166,    249,    -55,
-     -1816,    383,    735,   -876,    443,   -568,    293,  -1266,
-      6963,   -178,   -174,  -1186,   1119,   -208,    821,   1499,
-     -1496,  -2171,   1434,    874,    133,  -7466,   -545,   2193,
-      -775,  -1405,  -1205,   -575,  -1996,   -645,   -552,   -263,
-      8861,   -517,     76,   -992,    278,   2417,  -1369,     35,
-     -1461,  -1399,    517,    185,  -2895,    347,  -3871,   3644,
-       284,   3284,    -12,   -169,  -1981,   1196,    -67,   2868,
-       910,    134,   -530,    150,  -1328,   1902,   -746,    351,
-      -222,    522,  -5702,    797,  -1900,    241,   2270,    764,
-      -335,   1348,   -349,    784,  -1586,   -537,    148,   3211,
-     -1692,     56,   1678,   -321,   -290,   7902,     69,     52,
-       310,    337,    250,    596,   9998,    336,   1037,    163,
-        64,   -441,   2894,  -1033,    730,   -718,  -1252,    459,
-      -131,   7840,   -922,   -555,   5671,    299,    689,   1115,
-      -646,   -505,   -263,    608,   -494,      0,    442,  -1802,
-      -598,   -701,  -4184,     70,  -1319,    -90,   9155,   -339,
-         0,    121,    462,    735,   -639,    481,    125,   6924,
-      3379,    683,   3053,  -1219,   -499,   1067,   -148,  -2705,
-       -11,    795,   1675,    898,    226,   1232,     49,   -572,
-     -9309,   2223,    949,    767,   -821,    -91,   1075,   -352,
-     -7829,    554,   -593,   1284,   -245,   1239,   1166,  -1157,
-     -5274,    808,    871,  -1446,   7575,   -397,   -755,    752,
-      4193,    179,   -205,    -37,   -750,  -2675,   -407,   -700,
-       220,    -77,   1604,     63,    461,  -9994,   -645,  -1629,
-       103,    576,    132,  10005,    -49,  -1005,     97,  -1608,
-       515,    -10,   -146,  -1878,    880,    429,  -1271,    996,
-      -365,     76,   -409,   2461,     29,   1159,    217,  -6240,
-      -200,   -746,    118,  -1884,    457,   -816,   -608,   3215,
-       244,    749,   2268,   -236,  -1276,   -278,   1392,  -1767,
-      1255,  -1474,  -8136,   1388,   -770,    225,   -443,     10,
-      -392,    659,  -1118,  -1651,   -514,   -935,   -111,   1112,
-       973,   -247,   -235, -13010,   -737,     40,   -141,   5167,
-      -910,    279,   -467,  -3762,    847,  -3935,   1018,   1922,
-       830,    190,    253,  -1130,   -415,    371,    718,   3833,
-      1036,  -5358,   -928,    866,   -514,   2724,   2354,    449,
-       210,   1462,    680,  -1880,    -62,  10988,    809,   -602,
-       145,   -536,    114,   -147,   -568,   3193,   -322,    892,
-      -637,  -1381,    -65,    761,   1615,   5025,   -327,   4941,
-      -631,  -5225,   1204,   3042,    998,  -1047,   -959,   -106,
-      1610,   -151,    120,  -1152,    191,     30,  11963,    101,
-        18,   -410,  -1288,    370,   -771,   1337,   -544,   -613,
-       289,   -117,   1625,  -4506,   2582,  -1690,   -105,  -5324,
-       -93,    285,  -1167,  -3564,   -729,  -4790,    595,    275,
-      -216,   -217,  -6000,    682,   -171,   -875,    224,   -164,
-      2919,    796,    -81,   1434,    186,   -375,  -4113,   -179,
-       277,   1363,   -453,   2505,    388,  -1840,   -165,  -4800,
-       -42,  -6632,     54,   -735,   -553,  -1679,    917,     -2,
-      -632,    417,   -478,   -494,   -265,     73,   -372,   -360,
-       179,   -448,    265,    299,   -152,   -211,  12730,    -77,
-      1954,   -534,    773,    524,    438,   1901,  -4413,   -358,
-      1552,   -248,  -1588,   -122,   -127,   5405,    226,   -849,
-     -7495,   -357,    -89,    185,    746,    851,    669,    305,
-      -247,   3457,   -193,   -161,    638,    600,    610,    855,
-     -1292,    398,   1528,   2250,   1651,  -8414,    763,   1529,
-      -346,   3769,   -111,  -6494,    347,   -742,   1941,   1967,
-       582,  -5499,   -765,   -818,   1850,  -1604,   -243,   -943,
-       -11,    884,  -2996,  -2375,   1010,   -374,   6605,   -287,
-     -5073,    211,   -758,    703,  -2607,    747,   -130,   -429,
-     -2481,   4894,   -457,   3225,    958,   8533,    542,   6177,
-     -1069,  -1210,   -963,  -5943,    -86,   1424,   -567,    827,
-      -510,  -6577,   -258,     -4,  -4430,    115,   5401,   1390,
-       354,   1755,   -998,    852,    993,   -481,    218,   -987,
-       779,   -417,    591,   6011,    528,    289,   -336,   -558,
-        60,   9124,   -174,    235,   -239,   -144,   -260,  -3472,
-       746,   4781,    652,  -4831,   -739,    -21,    864,  -2310,
-       652,   7147,    116,   -318,    -50,  -3485,   -325,   -345,
-     -5784,   1144,   2399,  -1443,    991,  -2318,   -785,   -281,
-      -207,  -1448,    309,   1001,    952,   1472,  -5901,   -780,
-     -2459,   1518,   9878,  -1229,    670,   -523,   1217,   -164,
-       -55,    -95,    243,   7909,     86,  -4380,   -859,   -599,
-      -183,  -2339,    774,  -1210,   -502,   -899,     53,   1039,
-        34,  -7753,   -296,  -1951,  -4559,   1182,   -150,   2878,
-     -4910,   2761,  -1481,   2048,   2600,   1808,  -2953,  -2257,
-        62,    162,   1115,    214,  -4510,    926,  -6669,   1443,
-      -124,    193,   -314,    302,    699,    -18,    745,    341,
-       895,   -615,   -295,   -181,    143,   -427,   6528,   1074,
-     -1126,    374,   -298,  -1274,     22,    887,   -511,  -1057,
-      3228,    722,    607,    624,    -95,  11085,   1006,   -788,
-      -285,    -92,   1342,   -325,   -828,     42,  -3588,   -631,
-      -576,   4559,   -668,  -1294,   1739,   1697,   -647,   2336,
-       376,   -120,   1350,    646,   -325,     95,   5974,    775,
-       199,  -8557,    931,   -336,   -651,   -561,   -433,  -2266,
-      -129,   -657,  -1184,     67,    577,    617,   1880,    552,
-        90,   -617,   -273,  -1571,  -7481,    261,    -26,    -20,
-      -459,  -1028,     57,  -8516,    -43,   2774,      1,  -4238,
-       680,  -3310,    -56,   -152,    548,  -1983,    920,    899,
-      2180,   -307,  -2230,  -1685,   -998,   2091,   -112,     21,
-     -1551,   1182,   6649,   -326,    792,   1818,  -7596,    563,
-      1076,   7422,   -908,   1524,   -223,   5798,   1318,  -3376,
-       517,   4162,    756,  -4142,   1776,    390,    334,    -44,
-       218,   5290,    792,     39,   1692,    542,    -62,   -595,
-       590,     27,   8922,    989,    182,    725,    112,    458,
-     -9170,  -1000,   1176,  -1290,  -1403,   -726,   5990,   -297,
-      1234,  -1724,   -601,    528,   1072,    184,   -146,     61,
-       685,   1208,    -88,   -211,    356,   9569,   -363,   -135,
-      -159,  -1061,   -105,   -410,    -58,    335,  -9986,   -300,
-      -211,    607,    443,   -410,  -1730,   -328,    275,    579,
-       805,    899,   -464,    -18,    296,   -446,   2396,    -13,
-       414,  -9662,   -385,   -808,  -1867,    154,   -572,   3351,
-     -1839,    -80,   1157,   -326,    481,   8815,  -1039,   1065,
-      2110,   1223,   -960,    -33,   -464,  -5660,    490,   -314,
-       346,    730,   -387,  -1102,   6656,   -719,  -1173,    -57,
-     -1186,   2394,  -1300,   -665,   -586,    -39,    -71,    155,
-      1184,      4,  -3269,   -333,   -747,    580,    279,   -583,
-      7164,   -185,    110,   2465,    428,    507,   4462,  -4461,
-       199,    337,  -3597,   -249,    -70,   -680,  -5549,   1533,
-       917,   -303,  -9230,   -431,   -124,  -1019,    369,    139,
-      1367,    151,  -1047,   6820,   -151,    222,  -2934,   -817,
-       971,  -7325,    556,   1035,  -1240,   3115,  -1326,   4012,
-      2812,   1057,   2580,   -261,   3989,   1999,   1624,   2402,
-      -310,    779,   -354,   -377,   -149,   1035,  -2363,    358,
-      3666,   -246,  -1896,    375,   3919,  -1392,    683,    624,
-     -5872,    644,    391,    288,   -198,   -237,     68,   -284,
-        88,  -1016,    250,     32,   1188,   -243,   -608,   -320,
-      -219, -11087,    543,    156,   1034,   -169,   -183,   -549,
-       -66,    716,    996,   -928,   -309,   5577,    229,    125,
-     -1328,   9027,   -698,   -485,  -1694,    839,    343,    449,
-      1655,   1005,   1053,   -408,   9106,    186,    670,    774,
-       314,    573,   3888,   -882,     26,   2518,   -533,   -195,
-       555,    337,   -246, -10779,   -231,     31,   -314,   -941,
-      1129,    333,  -7503,    168,   -551,    237,   -159,   4399,
-       421,    693,    198,   -196,   -561,   1035,   -548,   1058,
-       527,   3617,   -361,   1317,  -1975,  -2638,  -1966,   -120,
-      -324,   5678,  -2252,   -663,    181,   -273,  -3073,   -282,
-      -622,    363,     71,    184,   -776,    284,  -1516,   -430,
-         3,    937,   8587,    258,  -1060,  -1555,   -830,   -338,
-       318,  -9130,   -110,    459,   -572,     70,     93,    120,
-      -534,   1296,   -168,     29,   -914,   -332,   -997,   -818,
-       270,   -243,    523,     56, -11847,   -448,     11,   -154,
-       164,   2115,    -13,   -635,    708,   -663,     43,   -248,
-     -3244,    254,     19,  -1125,    508,    154,   8697,    191,
-       595,   4393,  -2806,   -168,  -1916,    393,   3976,    897,
-     -1716,    -35,   -180,    605,  -1057,  -1194,    100,   -384,
-       -37,   -107,   2739,   -207,   6899,    176,     81,   -901,
-      1280,  -1670,   -101,    281,   1147,     48,     21,   -151,
-     -1236,    210,     98,   -114,   -573,   7940,   -153,   -302,
-     -1331,    337,   -322,   6598,    477,    147,   -999,  -3166,
-      -232,  -5104,   -799,  -1866,    -58,  -4213,   1376,    181,
-       675,    562,    126,    235,   2260,  -5152,   -243,   -699,
-     -1476,   4135,    569,    567,    737,  -4163,    613,  -1057,
-      1778,    546,   -450,    -24,    325,    366,   2406,  -1319,
-        60,  -5126,     49,    657,  -5937,   -194,    882,   3267,
-       178,   -298,   1873,  12422,    459,    272,    195,  -1827,
-       212,   -802,    730,    471,   1556,    422,    640,    236,
-        71,    597,   5783,   5378,   -649,   1524,    829,    437,
-      -351,   -122,  -1400,   2119,   -128,     75,  -1677,   -633,
-      -322,  -6382,   -573,   -974,   1672,   -378,   -242,   3708,
-        79,  -1325,    397,   -150,   1977,    442,    747,   -127,
-};
-
-static const int16_t shape16s[] = {
-      -392,     96,  -7720,     99,    524,  -8272,    -20,    164,
-      -434,    -85,   -428,   1362,    108,    223,   1053,    -11,
-      -193,  -5140,   -191,   -159,    193,   8005,    -39,   -483,
-      1764,  -1061,   -268,   -318,   -880,    474,     49,     -8,
-      -223,    130,  11263,    165,     12,    -43,   -103,  -1145,
-      -588,    -81,    299,     73,    444,  -7243,  -1411,   -640,
-      -946,     16,   -881,    496,   2403,   -476,   1090,   -294,
-        29,   -148,    109,    145,    -52,    247,   -545,   1115,
-     -7451,   -491,  -1459,    397,  -8603,  -1022,   1494,    298,
-     -5156,   -358,  -1097,  -2911,    423,    652,   -378,  -2357,
-       -74,    415,   -367,    402,   2173,   -154,    122,    283,
-      1352,    302,   -373,   -431,   -283,   -109,    -64,   -343,
-      -108,     55, -14644,    241,     37,   -723,    -71,   -208,
-      -126,   4061,  -9887,    494,   2273,   -505,  -4040,     66,
-      -806,  -1121,  -1894,    783,  -1445,    426,   -820,  -1739,
-       -11,    650,   -282,   -518,    124,  -7266,    -21,    160,
-      -339,      5,   -208,  11712,    198,    -53,    921,     89,
-      5987,  -4806,    176,   1884,     64,   -517,   2169,    108,
-       297,   -111,   -389,   -840,    663,     75,   -485,  -4862,
-      -177,   2663,   -229,   8120,   -219,    462,   3104,    955,
-       384,   1310,    -73,   -504,    258,    170,  -1796,   -482,
-      5691,   -437,  -8474,    583,  -1685,   -827,    292,    -65,
-      1994,   -384,    105,    123,    256,    -82,   -367,  15204,
-      -128,   -260,    -10,    169,    249,  -1286,   1055,    136,
-       678,     61,   1420,   -159,    -15,   -221,   -250,    107,
-       -21,    297,     54,    242,   -111,    468,    237,    -36,
-      -159,     37,   -102,   -488,  -4577,     72,   1009,     -1,
-      1218,   2023,   -640,   -437,    766,   -299,   6144,    184,
-     -1023,    171,   -388,    884,  -1294,   -320,   8718,    896,
-      -295,   -976,   -803,   3092,   1720,   -255,  -1354,   -665,
-       -63,   4382,     41,   -121,   -157,    354,    127,    587,
-      -599,   -231,    484,   -150,   -284,   -498,   -511,     79,
-      5503,     13,   6537,    761,  -1619,   1164,  -2403,   3057,
-     -4966,    724,   1076,  -1555,    889,   -365,     60,   -440,
-     -7144,   -132,    283,   -305,   -126,  -1482,    125,    -52,
-       -33,   1284,   -961,   1355,    953,  -1012,   -227,     86,
-       731,    -14, -15977,    -56,   -875,  -1676,    127,    500,
-      3390,    -14,   -319,   -644,    143,    249, -10752,     23,
-        54,  -1075,   -111,    680,  -1714,    328,  -2092,   -852,
-       622,    949,     61,      6,    -17,    144,    190,    216,
-       130,    -65,     27,   -322,   -139,     43,     89,     76,
-       -84, -10120,    -47,    367,   -261,     38,     50,   4233,
-      -210,     14,     -1,     25,    762,   -299,   -132,    177,
-       974,   -492,   -145,    -43,   5105,   -394,   -196,    -91,
-       -25,    473,  -8358,   -476,    589,  -1372,   -254,  -2387,
-      -293,   -304,   3828,   -254,   -193,    493,     54,   -108,
-     -8789,   -262,   -233,   -821,   -222,    714,   1270,    -61,
-       892,     13,   3952,    -36,  -1567,   -620,   -126,  -1056,
-       587,    390,    -24,   2027,    267,    218,     15,    -56,
-      -130,     40,    551,    -29,  14594,    -23,    106,    -14,
-      -172,    279,    427,   -241,    303,    -20,   -748,     55,
-      5187,    598,   -217,   2026,    643,    118,    911,   8023,
-       296,    791,     39,  -2621,    655,    228,   -671,   -272,
-      -176,   6644,   -166,   -264, -10429,     91,    -83,   -684,
-      -169,   -344,   2123,   -102,   -333,   -317,   -826,    586,
-       116,  -9311,    445,    141,  -1315,   -758,    144,   5620,
-       363,     66,    142,   -161,   -684,    454,  -6584,   -205,
-       577,    205,    305,  -1536,  -4109,   -318,    121,   -323,
-     -1036,   8020,   1146,  -4004,    175,  -1568,  -1537,   -525,
-      2284,     62,     11,    640,   1243,    260,   -104,   -344,
-       102,   -624,    122,   -300,    266,  -6104,  -1149,    412,
-     -1380,     22,   7561,    360,    564,    398,   -338,    174,
-       -76,    131,     44,   -426,    -12,   -175,   -113,     78,
-       293,   -120,    -92,    331, -16163,    -74,   -101,  -1198,
-      -298,   -171,   4052,   -139,   -187,    131,    323,    370,
-      -144,   -160,    131,   -284,   -190,     83,    878, -14817,
-        14,    196,    198,    294,   -120,     40,    800,   1841,
-       393,   -168,    337,   -540,   -356,    130,   9210,    880,
-       304,  -2304,   -275,   1394,   9903,    673,    -62,  -4706,
-      -130,    274,    528,     89,   -458,    -90,   6318,   -133,
-       310,  -5953,    682,     37,   2937,   -371,    197,     77,
-      -184,   1240,     22,  -7695,   -171,  -4874,   -676,  -1121,
-      -842,   -642,   1160,  -1088,   -864,    352,   -790,    794,
-       801,  10564,  -1777,   1095,   -441,   1718,    116,    982,
-      -268,    199,  -2408,  -2042,    279,   -146,    645,  -1350,
-         5,   -150,   -932,    113,     25,   -672,    153,    158,
-     -6140,   -262,    142,   4815,     -1,   -424,    810,     63,
-        88,   -510,   -236,   3964,    -66,   1229,    -16,   -758,
-    -11023,  -1149,     48,  -1756,    167,   2308,    -96,   -654,
-      -639,    369,   -221,     47,    202,    329,   -352,    -26,
-       -19,  13198,   -383,    124,  -1211,   3879,   -344,  -1954,
-     -8702,     32,    924,    472,   7953,    692,   -216,   -415,
-     -3174,  -1959,    935,   4048,    155,   7521,    854,   -157,
-       643,   3760,   -107,  -2536,    622,   -742,   1881,   2262,
-       758,   -968,   -271,   -131,    385,  -5107,   -212,  -2548,
-        29,   -132,   -506,   -190,  -1065,    314,    202,    332,
-     -2274,    701,      4,    -22,   -439,    198,   -265,    -92,
-      -143,    460,    -32,    189,    334,     87,  -7639,     45,
-      -387,   4240,   1231,     92,   1032,   -333,   -280,   2061,
-       296,    365,   2003,   -426,    -35,     96,    -62,    882,
-      -784,    483,   -128,   -143,    474,  13740,   -166,    184,
-      -714,    142,    278,   5622,    -67,    282,    647,   -130,
-       -31,    300,    727,    728,    409,    178,   -601,     84,
-      8305,   -446,    179,    115,    209,   -273,    -47,   1932,
-      -255,  -3171,   -102,    461,   -119,  -8102,   -809,    108,
-     -1680,  -3171,   -775,    324,   -246,    132,    -27,     84,
-      8495,    -45,    153,     21,  -1384,    290,   -869,     38,
-      -440,    133,   -257,    -22,  -3046,     12,  -2797,   4517,
-       142,   1605,    423,    579,   -558,   -301,   -257,    701,
-      -246,   -468,  -1946,    120,    321,    710,   -217,   -203,
-       -50,    -44,  -5866,     80,    259,    488,    754,    124,
-      -517,    703,   -197,    146,    576,   -717,    247,   4121,
-        10,   -422,  -2686,    329,   1183,  14573,     72,    301,
-      2043,   -125,  -1420,  -1263,  10340,   -678,  -1226,    330,
-       -62,    173,   5885,    -56,   -178,  -1090,   -616,    953,
-      -216,   8277,   -124,    411,   7758,    -78,   -326,    786,
-        46,  -1365,   -555,    479,   -774,   -576,      8,    304,
-       390,   -186,   -820,     72,    -67,   -585,  11070,   -213,
-       -12,    344,   -399,   -748,   -150,   2719,    195,   5652,
-      4626,    549,   2782,     -4,   1928,    482,   1008,  -6398,
-       843,    457,   1843,    269,   1247,    350,   -661,    -35,
-     -6477,   3727,   2313,   -424,   -907,    415,   1075,   3960,
-     -1499,     61,    594,   -744,    110,   2486,    967,     27,
-     -5263,   -618,   -578,    313,   7055,  -1081,    739,   -492,
-     -2051,    317,    112,   -155,   -304,   -507,    150,    253,
-       -42,    221,     92,   -275,   -355,  -8494,   -663,    109,
-       282,   -836,   -271,   9316,    165,     63,   -171,     10,
-       -38,   -180,   -219,   -250,   -924,   -573,   -241,    566,
-      -175,     20,    454,    251,   -328,    236,   -215,  -5673,
-         0,   -265,    225,    354,    113,   -488,    174,   -132,
-       134,   -188,   1255,    -94,    -55,   -193,    404,    504,
-       784,   -377,  -5731,    333,   -447,    222,    138,     72,
-      -256,    -58,   -230,   -169,    728,   -481,     95,   -394,
-       -74,   -489,   -253, -13770,     61,    184,    -36,   5025,
-      -232,    321,    253,  -3414,    120,  -2512,    799,   -586,
-      1186,  -1135,   -955,    -54,      7,     83,      0,   5259,
-       466,  -6358,    254,    388,   -211,    207,   2449,    379,
-       430,   -219,   -442,    228,    151,  11819,     67,   -101,
-       239,   -282,    121,   -270,   1209,   -386,    553,   -108,
-       789,   -518,    237,    -48,    497,   8986,     80,   8232,
-       -89,   -359,   -803,    473,    995,   1132,    624,   1353,
-      -305,    711,    -71,    -26,     18,    254,  13079,    -72,
-       178,    -18,   -116,    293,    155,   -254,   -819,   -166,
-      -808,   -190,    150,  -4328,    -33,    -14,    272,  -6417,
-        78,     78,     67,    310,   -177,   -435,    225,    610,
-       -15,      1,  -6706,     30,      1,   -189,    270,    -21,
-       276,   -182,     77,   -231,     30,   -116,  -7713,    158,
-       344,    560,   1466,   3575,    -84,  -4583,  -1260,    372,
-      1395,  -5223,    284,  -1911,    315,  -2312,    -47,   -207,
-       414,    129,     36,     85,    317,   -125,    -63,   -212,
-       -76,    130,   -385,    157,    117,     12,  16140,   -171,
-       375,   -721,    161,   -342,    950,   -667,   1011,     15,
-       536,  -1203,   1039,   -242,   -159,   7664,   -429,   -264,
-     -8221,   -109,    867,    -74,    -79,   -414,    544,    206,
-       120,   1859,    -44,     73,    554,    121,   -160,   -127,
-       -33,     44,    -24,    285,    589, -12514,     51,    464,
-        17,    264,     58,  -6861,    367,   -672,    227,   2793,
-       782,  -6286,   -420,   -808,  -1247,    895,    950,   1533,
-     -1079,   -207,  -1927,  -4947,   -803,   -328,   7677,   -386,
-     -4608,   -329,   -485,   2365,  -1492,  -1738,   -378,   -707,
-     -1850,   9044,    314,   3530,     61,   2921,     79,   9508,
-     -1102,  -3487,    814,  -2828,    550,   -929,   -712,   -274,
-      -566,  -2521,    536,   -296,    -97,    951,  11352,   -614,
-       106,   -342,  -1017,  -1183,   -157,   -457,    266,    109,
-       545,   -313,   1015,   6961,     52,   -224,   2247,   -248,
-      -180,  12367,    311,    514,   1218,   -561,  -2546,  -3275,
-       218,   8281,    187,  -6550,    -96,  -1001,   1777,     89,
-       916,   1042,    399,   -267,    -97,  -3552,    397,   1984,
-     -6134,    784,   2136,  -1346,    619,  -1450,  -1022,  -1226,
-       185,    306,   -274,   -122,    343,    129,  -4481,   -749,
-      -759,   -496,   8785,   -178,    457,   -601,    875,   1040,
-      -268,  -1592,   -531,   9667,    360,  -4978,    525,   -436,
-       123,  -1566,    227,    820,     74,     -5,   1477,    154,
-     -1589,  -9411,    248,   -485,  -3293,   -690,    175,     53,
-       -21,    303,  -2376,    106,    515,   2688,   -401,  -1278,
-       425,    540,   -353,    662,  -7461,   -397,  -7029,   -976,
-       445,  -1648,    164,   -254,   -563,    556,    876,   -205,
-       884,    214,    -92,   -509,     96,    -53,   5734,   -295,
-      -136,    211,    168,    261,    -74,    411,     25,    -59,
-      3596,    400,    320,    -69,    -21,  14062,   -510,    142,
-      -232,   1597,     34,    240,   -476,    131,  -3836,   -186,
-      2579,   2812,  -1501,    274,   2685,   2809,  -1100,   2696,
-      -402,     67,    650,  -1804,    -11,   -216,   6751,    112,
-       455,  -7210,   -251,  -1075,   -833,   -966,   1443,   -138,
-       273,   -494,   1557,    -15,   -339,    -82,    402,    206,
-        31,    -77,    -94,     78,  -5468,   -179,    -44,    421,
-       163,   -386,   -133,  -6334,    427,    747,   -121,   -292,
-       368,  -1087,   -338,  -1534,   3740,   -881,  -2012,  -1284,
-       902,     97,  -3407,   -567,   -118,   1340,    -77,   -445,
-       642,    184,    901,   -341,    -81,    595,  -6531,   -248,
-      -167,   8740,    373,    408,     23,  10709,   -299,   -876,
-      -584,  -1067,     20,  -4556,    295,  -1956,    990,   -132,
-      -152,   4068,    -92,    142,  -1512,     23,   -815,    454,
-       330,   -331,   9042,    120,   -100,     34,     96,    152,
-    -11083,    345,   -567,   -498,    198,    -37,   9276,   -479,
-       611,  -2788,    253,   -176,    617,   -224,    248,    390,
-        39,     25,   -110,    127,    -13,   6675,    -84,    115,
-       294,     84,   -366,   -405,    -32,   -109, -10469,     99,
-        17,    -88,   -226,    316,   -133,   -203,    -60,    311,
-       -87,   -331,    357,    -11,    158,     74,    562,      8,
-       354, -10843,   -114,   -206,    699,   -617,   -141,    807,
-        87,   -149,    174,    199,    -55,  10880,   -332,    182,
-       544,    651,    -27,    261,   -190,   -655,     24,   -443,
-      -630,    204,    207,  -4174,   3557,     89,   -386,   1754,
-      -485,   -127,    -97,     40,  -1336,   -488,   -177,   -750,
-        88,  -1040,  -2215,   -507,    169,   2908,     69,    -52,
-      8458,    601,    174,   1635,    480,    181,   3004,  -3021,
-      1868,   -364,  -2100,   -256,  -3065,    -33,  -7467,   -890,
-     -1949,    -20,  -9472,   -230,   -847,   -634,   -377,    -40,
-      1184,    242,    265,   7056,     42,     16,  -5070,    -71,
-       300,  -1186,    187,    337,  -1331,     77,   -473,   3213,
-      5738,    626,   2524,    531,   1001,   -803,   1231,  -1083,
-      -564,    539,    191,   -498,    184,    603,  -1777,   -479,
-      2298,   -604,  -2077,    634,   4682,  -1387,   -875,    498,
-    -10011,   -173,    752,    109,    -70,    171,    -64,   -261,
-       -79,     37,   -233,    128,    -66,    -70,    356,   -310,
-       214, -14792,      6,    200,   -227,     59,   -241,    560,
-      -230,    479,    403,    -22,    148,   7428,    110,   -177,
-       110,   7518,  -2372,  -1277,    223,   -708,    731,    695,
-      -702,  -2906,    256,  -1160,   4941,    121,  -1148,    -68,
-      -424,  -1590,   4697,    705,    525,    684,   -451,   -246,
-      -115,    556,    543,  -6658,    384,   -589,  -1505,     12,
-       114,     82,  -5084,    164,    154,   -295,    106,   -271,
-       -40,   -394,   -437,    397,   -279,  -3825,   -286,    632,
-     -1041,   1137,    -93,     48,    192,  -5914,    -92,   -235,
-       682,   5817,   -702,    180,   -243,   -219,   -910,   -174,
-      -146,    142,     12,    -69,   -207,   -269,    -53,    567,
-      -336,    114,   9601,   -272,   -270,    459,    610,   -258,
-        97, -10950,    397,     57,     -7,    229,   1669,   -173,
-      -173,    -92,   -347,   -133,   -357,     92,    132,   -609,
-        60,   -124,    116,    -54, -15205,    142,    109,   1127,
-       268,   -220,    336,   -743,   -238,    -29,   -902,     91,
-     -3597,   -288,   1114,  -3797,  -1615,     32,  11481,     55,
-       194,   3567,  -1857,  -2561,   -237,    -15,    -48,   -232,
-       -58,    -21,     37,   -535,   -450,    857,   2001,     12,
-        48,    840,    211,    126,   4833,    275,    176,   -111,
-         9,   -112,   -403,    182,    296,    181,   -425,    -14,
-       276,    118,   -240,    384,    139,   9183,   -230,    143,
-      2412,    -70,    250,  10191,    809,    -15,   -257,  -1242,
-      -163,  -4253,   -352,   -436,    264,  -4998,    -17,   -215,
-      1412,   1592,    856,   -159,   4756,  -5032,    307,   -251,
-       194,   6414,    -56,     -7,   -503,   -261,   -646,  -1050,
-      -271,   -578,   -291,    614,    130,   -336,   -923,   -120,
-       149,  -6012,    273,   -295,  -4586,    137,    206,   1246,
-       498,    614,    991,  13776,    122,     52,   -660,    -76,
-      -211,   -477,   -224,    196,    411,    398,   -590,    820,
-      -441,    -35,   4394,   5010,   -902,    509,     45,    747,
-      1035,   -455,   -579,    105,   1103,   -496,  -1249,   -248,
-        46,  -5771,   -198,   -386,    736,     15,   -335,    -85,
-      -624,   -124,    580,   -327,   -102,    -18,    866,    381,
-};
-
-static const int16_t shape22[] = {
-      2560,   -127,   -137,   -385,  -1875,     90,   -240,    140,
-      1290,    200,  -6762,    374,   1871,   8730,   -111,   -555,
-     -1524,  -2175,  -4689,    521,   -179,    166,  -1573,   1056,
-      -346,    247,    -92,   5713,    561,    233,   -360,    480,
-      -741,  -7552,  -1508,    259,  -8746,   1604,   1385,    723,
-      5678,   2243,    403,  12370,   3526,    574,   4982,    563,
-      1713,  -1337,   1336,    -60,   -890,  -2184,   -563,   9347,
-       775,   6318,   -883,   1476,   -335,    736,   -564,    635,
-     -5557,    617,     54,    257,   -325,    -66,  -5689,   1061,
-      -897,     90,   8394,   2004,   9456,   -222,  -2026,   -969,
-        93,     -5,   -922,  -6491,   1496,  -1537,    651,   -277,
-     -1038,   6072,  -8534,  -2526,   1645,   1459,    547,   2347,
-       -85,   -761,  -7210,   -153,    414,   6096,    383,    320,
-       370,   -902,    823,   3071,    499,   -731,     38,    473,
-      1693,  -9456,    946,   1218,  -1054,     70,    367,   -469,
-     -7861,   -913,    401,    198,    -83,    877,   -308,   8633,
-       253,  -2025,   1925,   1412,   1351,   -360,   -948,  -7526,
-      1089,  -7449,   1652,    141,    -43,  -2082,     44,    130,
-     -7525, -15049,  -1345,    180,  -3009,  -4581,   -267,   2309,
-     -1397,   -112,    -63,    307,   -746,    -13,     35,  -8800,
-     -1947,  -1143,  -1096,  -2582,  -1210,   7683,   -743,  -1589,
-      5699,    -80,  -1375,    -93,   -483,    129,   6076,  -6099,
-       374,   -176,  -1150,   -416,    137,  -4309,  -1926,   3099,
-        82,   -836,    392,   -655,    108,    428,   3361,    313,
-       363,   7534,   1153,    334,   2262,   -367,    -69,   -813,
-     -9702,   3074,  -5461,      0,  -1889,   1303,  -8306,   -113,
-      -677,    692,  -2752,   1292,   -171,    430,   4609,  -2238,
-       196,   1661,    -25,   -164,  -2590,  -4919,   -615,     -7,
-      -753,   5104,   5197,    -66,   -310,    827,   -126,    615,
-        70,   -456,    238,    682,   -639,   -561,    369,    183,
-       113,    430,   -840,   -792,  -7282,  -7537,    619,   -445,
-       588,     19,  -1061,    652,     46,    861,   9641,  -1251,
-       -41,   -699,   -605,  -1389,    240, -10798,    733,    194,
-     -1230,  -1092,   -520,   -219,      7,    518,   -181, -12062,
-       651,    -40,   1128,   -390,   -220,   -438,    471,    510,
-       632,   -321,   1393,   8827,  -3241,  -6683,    350,   1953,
-      -246,   -582,  -5486,  -7576,   -157,    888,   2965,    -23,
-       762,   6867,   3697,    -43,  -7905,   -938,   2119,    377,
-       -25,    691,    136,   -725,   7643,   -730,   2024,  -6932,
-       804,     53,    392,    440,    336,   6235,  -7037,  -5584,
-     -1579,   1115,   1757,   1001,     32,   -294,   -592,    300,
-      -764,  -8879,  -1612,   -845,   1722,   6968,    384,    267,
-       862,  10830,   -364,  -1138,    -49,   1041,   -908, -14960,
-       809,    628,  -1150,  -1348,   -437,    805,    877,    -64,
-      1041,   5253,   -270,   2022,   1253,   -992,  11015,   2686,
-        17,     80,  -1463,   4229,     80,   -834,  -9286,   1179,
-        66,    -39,    -64,  -4057,   -423,    116,  -1441,  -1733,
-       752,   1674,   1443,    757,  -3149,   9057,  -3522,   4007,
-      -893,   1179,   -388,   6368,   -478,   4397,  13868,  -2996,
-       790,    704,  -2299,  -6003,    449,  -5410,   1999,    181,
-     -1807,   -362,    -57,    454,  -2371,   3658,   -485,   -212,
-     11551,   1535,    478,  -1570,   -278,    584,    608,  -5211,
-      6965,   1042,   -168,   -337,  -1071,     72,    451,   -204,
-     -1000,  -1044,    689,    186,   -166,   -375,   9426,    363,
-        93,   -717,    304,    107,   7853,  -1251,   1093,    692,
-      -742,     33,    576,    447,    678,    452,    408,  -4813,
-       711,   -595,   -516,  -1108,   1941,   3056,   -219,  -3413,
-     10946,   1513,  -2375,     48,   -408,     49,   -399,  -5608,
-       -58,    161,   4808,    436,     68,  -5675,    230,    832,
-     -1228,   6382,   -588,  -1312,    772,   4337,   -405,  -5467,
-      -222,   1382,   2158,    620,   -840,    810,  -3830,     48,
-      -101,    529,  -2670,   -249,   1035,  -7620,  -1081,  -6646,
-      1469,   1043,    743,   1553,   -556,   -274,     68,    238,
-      1078,   -110,  -5163,    562,    735,  -8317,   1202,  -1325,
-      -962,     61,   4280,    570,   7450,    265,  -1516,    696,
-     -1567,   -681,      0,  -4064,   1548,  -2521,    657,    567,
-     -8343,   1691,  -1430,   4827,    807,    905,  -2601,  -7415,
-       921,  -1741,    363,    309,    211,   -521,   3013,   -797,
-       648,  -3709,    961,    662,    403,   -386,   -719,  -5752,
-      1355,   6717,    191,    591,   -371,  -1225,  -5125,    800,
-      -252,  -5769,   1101,    657,   -141,   2377,  -1365,   -218,
-      -114,    148,    276,    358,   -354,     18,    -31,  -9413,
-     -5514,  -1458,   -220,    298,    666,    659,    359,    980,
-     -1389,    101,   1500,   4661,    472,    264,  -7590,  -1469,
-        41,     38,   -259,   -346,   -486,  -9949,    812,    422,
-     -1354,  -2461,  -2057,   -253,   1806,   -107,    -41,  16384,
-      -140,   -684,   5421,   1907,    -10,   -889,  -1877,  -6815,
-      -818,  -5854,  -3196,   -895,  -1706,   -186,   7944,    100,
-    -11260,  -4573,   -415,   4685,    395,  -6035,   5789,  -4566,
-       624,  -2146,    570,    130,   -892,   1385,   -262,   6638,
-     -2324,    348,   -288,    607,  -1574,   7119,  -1037,    -40,
-     -4955,   -946,  -5215,  -1013,  -1232,   -875,    -78,   -399,
-       231,   -173,  -5860,    189,   -755,  -8265,    745,    966,
-       202,  -1858,    -26,   -658,     55,   1131,    -56,   3030,
-       158,   3742,  -1261,    317,   6397,    521,   -508,   -522,
-     -2040,   -747,  -6906,   -868,   -110,   -719,   2602,   2570,
-     -1106,   -787,   -352,   9212,   -545,   7339, -10183,   -726,
-      1104,  -1118,  -1655,    383,   1370,   1412,    528,  -4689,
-      -398,  -3802,   -682, -11004,  -2310,   8011,   2301,  -5941,
-      -512,   3813,    210,   1379, -15209,   1143,  -2344,   2459,
-      2368,  -6484,  -2078,   -246,    383,   -204,   1449,   -453,
-     -1539,    416,    508,  -7168,  -1930,   4279,    453,   -215,
-      -296,   -346,   5691,   -200,   -855,    552,   5921,   -109,
-       588,  -3049,   1312,   6767,    -78,  -7204,   1187,   -754,
-     -1043,   -455,    412,   -490,   3124,   -273,   1468,   -546,
-       552,   -306,    835,   -263,  -7234,    324,    318,  -1224,
-       240,    198,    193,   -550,   -684, -12416,     85,  -1469,
-      -463,   -301,    180,    290,   -928,  -6399,   -931,    176,
-       310,   -692,   7964,   -204,    512,    975,  -6415,   -394,
-       -30,   -120,   1638,  -1474,   -381,   5912,    156,   -830,
-      -575,   -225,  -4079,   -787,   -957,   -801,    181,    575,
-      1116,   -795,   -743,   -981,    434,   -365,  -9780,  -1814,
-      1447,   1081,    153,    884,   8697,    259,    881,   -661,
-     -1232,   -547,    464,    898,  -3988,   -476,    790,   7589,
-      -525,   -809,  -2900,  -1271,    170,    223,  -5050,  -2554,
-      1458,   -666,    537,  -6733,    212,    448,  -1556,   1459,
-       802,  -2716,  -8785,  11020,   -258,   1229,   1138,    843,
-       508,    103,   -657,   1273,   8140,    368,   -605,   6856,
-       110,   -423,   5458,   -417,    993,    257,   5552,    -47,
-      1401,   -119,  -1320,   6193,  -1196,     56,    -93,  -1604,
-     -1491,   -897,    238,    823,   4213,    104,    145,  -1049,
-     -9286,    -26,   -813,   -139,    499, -10351,   -466,   -515,
-     -1166,   -412,   -746,    503,   1872,     17, -11941,  -3350,
-      -108,  -7296,   -411,   4811,  -1870,    162,   5595,   -658,
-       339,   -904,   6911,   -715,   -240,    -71,    377,   4747,
-       -57,  -8920,    521,    753,   -375,  -1185,   1322,   -328,
-         5,    525,   -610,    127,   1519,    791,    784, -16384,
-       116,  -1007,   -352,    486,  -7871,    202,  -3684,   -387,
-       676,  -8942,   -713,   -447,   -557,   1159,    974,   -380,
-     -1183,   1049,     -9,    838,   -932,   -139,    371,   1688,
-     -7617,   1192,   2350,   -220,  -4558,   2681,   1568,    102,
-      1274,   -446,   -351,   1551,   1101,  -8995,  -5276,  -4416,
-      3411,    221,   -429,    412,   1625,  -4575,    254,   -631,
-       310,   -378,   9743,    859,    934,    142,  -1400,  -6921,
-      6466,  -4068,   2664,    418,     70,    284,   -903,    -23,
-      -502,   4354,  -5993,    125,    -34,  -1246,  -1946,   -204,
-      1002,  -7454,    -88,  -8628,   2449,  13715,    318,  -8759,
-       294,  -2212,    138,   -761,    285,  -1686,    291,    606,
-       180,    761,   -359,  -1467,    299,   -417,   -361,   -895,
-     -5692,    127,   -951,    165,      1,    396,   -819,  -5508,
-       280,    760,   -411,  -1025,   -649,  -1688,  -6290,    272,
-       -17,  -7595,      9,    307,    128,  -3995,   -119,    481,
-     -3100,   -255,    651,    139,  -3492,     -6,  -4471,    452,
-       -71,    139,   1255,  -6128,   1191,    326,     28,   -238,
-      1374,   -334,   -457,   -836, -10390,    185,   -616,   3366,
-       -39,    183,    -21,   6240,   1141,    341,   -348,    738,
-       121,    -65,   -386,    -27,   -548,    337,     -4,   -126,
-       571,   2263,   4936,  -1093,   -397,    961,  -5886,   -734,
-      1509,   -660,    -61,    170,   -783,  -4197,  -1459,    906,
-       -31,    400,   -481,    561,      6,    489,  -5397,  -1666,
-        41,   -536,   -116,   6713,   1288,   -157,   -116,   4256,
-      1895,   6671,   1837,   -544,   1276,   2031,    345,   6471,
-       -84,   1868,  -2006,  -1304,  -7792,    702,  -1189,    105,
-     -4869,   -282,   -790,   7083,   -628,  -1273,    252,   -179,
-};
-
-static const int16_t shape22s[] = {
-       493,     -2,   -310,   -109,  -1218,   -193,   -267,    -11,
-      -466,    -34,  -2492,    287,    241,   3621,   -537,    458,
-       869,   -915,   -290,    782,     65,    -90,   -635,   1836,
-        80,    519,    868,   1359,    550,    -92,   -704,    110,
-      -210,  -4337,   -376,   -200,  -2693,      6,    381,    688,
-       556,    883,    -88,   1698,   1081,    133,   1130,    -78,
-       853,   -424,    -39,   -909,  -1579,  -2774,   -372,   3604,
-      -519,   3777,    -66,   1330,  -1055,   1135,   -995,    220,
-     -3124,    122,     83,   1045,   -701,   -120,  -6800,   -269,
-       195,   1197,   5500,   -490,   5453,   -201,    411,    823,
-      -146,     46,    252,  -2724,    606,   -924,  -1538,    394,
-      -420,   6405,  -5632,   -941,   -402,   -137,    984,    -24,
-       594,    -40,   -140,    -20,    204,   1211,    290,   -680,
-       103,   -434,   -294,   1646,   -159,  -2296,   -237,    507,
-       -67,  -8999,    -97,    403,  -1473,   -111,     22,   -257,
-     -2203,   -600,    577,   -117,     48,   2216,   -170,   1192,
-       700,   -477,   1678,    979,   2395,    -69,  -1746,  -2139,
-      -294,  -4210,    181,   -372,    320,   -180,   -503,   -550,
-     -3994,  -6315,    502,   -804,   -432,   -112,   -457,  -1016,
-       637,    297,    932,    533,    798,    229,  -1001,  -2780,
-     -4009,   1176,    189,  -1575,     21,   3512,   -348,  -1450,
-      2488,    463,    611,    -46,     85,     94,   3319,  -3041,
-      -362,   -261,  -1534,  -1900,      7,   -519,    -52,   1166,
-      -174,   -152,   -189,   -415,    641,     27,   1764,    280,
-      -301,   2976,    146,   -632,   4022,  -1994,    -84,    -61,
-     -1633,    285,   -439,    781,   -592,    399,  -4794,    203,
-      -295,     32,  -1423,    216,  -2773,     -9,   3589,  -3952,
-      -195,    161,   -223,  -2240,  -1886,  -2643,    978,    113,
-     -1019,   1645,   1493,   -851,   1417,    -74,    717,    411,
-       887,  -1384,     73,    117,    -65,     -7,    133,     18,
-        69,     11,    -98,     45,  -1751,  -2710,     11,   -140,
-        29,    185,    327,    705,     56,    152,   8202,   -117,
-       157,   -478,     36,   -564,    996,  -9359,   -707,    674,
-      1169,    270,    156,   -679,     15,    720,    -38,  -4952,
-      -196,    183,   -356,  -1004,    185,   -148,    -61,    151,
-      -229,   -161,     23,   4350,   -650,  -4384,    -21,    909,
-       105,   -271,  -2538,  -4018,  -1268,    351,    396,   -190,
-      -135,    970,   3159,   -935,  -6968,   -131,  -1031,     53,
-      -430,    242,   -219,    384,   2832,   -151,    152,  -6891,
-      1444,    -63,    -46,     72,    653,   3955,  -4187,   -321,
-      -298,    678,   -471,    664,    -42,    -30,    825,    195,
-     -1147,  -2728,   -178,  -2305,    680,   1980,   -147,    320,
-      -348,   4307,    806,   -263,    -60,   -102,      8, -10085,
-       626,   -130,    267,   -621,     45,   -157,    438,    190,
-        78,   1608,   -246,   -386,    256,   -255,   5651,   -449,
-       -13,    198,  -3193,    329,   -500,  -1368,  -6647,    609,
-      -507,    -96,    222,  -1196,    171,    -12,   -299,  -1423,
-       442,     47,     -5,   -282,    -18,   4969,  -1764,    231,
-      -471,   5044,    412,   1496,   -146,     35,   5083,   -228,
-       355,   -482,  -1063,   1265,     80,  -1278,   1225,    826,
-     -1914,    779,    439,   -511,  -4177,    425,    -38,    -55,
-      9786,   1005,   -538,   -664,   -641,    638,    125,  -2811,
-      2308,     28,  -1157,   -229,   -624,     45,    354,   -368,
-     -1661,     90,    778,   -328,    272,   -223,   9558,    822,
-      -167,    -12,  -1020,   2962,   2372,   -932,   1961,   1398,
-      2660,      3,    235,    421,    114,   -283,    371,  -1652,
-       329,   -435,   -113,  -1296,   -501,   -686,    297,   -384,
-     10328,    472,    614,    139,   -765,   -309,    180,  -2009,
-      -171,   -175,   3571,    146,     46,  -1356,   -134,    -15,
-      -166,   2046,    108,    119,   -281,    971,   -471,  -1134,
-        34,   -104,    219,    746,   -223,    245,   -181,     12,
-      -165,    216,   -792,     86,    562,  -1807,   -116,  -1324,
-       590,   -320,    -80,   1863,   -420,  -1066,   -698,  -2879,
-        -6,    182,  -2325,    575,     97,  -2616,   2938,   -673,
-      -693,   -116,   1905,   -430,   4739,    -12,  -3307,    693,
-      -227,    223,   -111,  -1498,      5,   1751,    -36,    234,
-     -4584,    838,   -370,   -296,   -818,    337,    -46,  -8921,
-       875,   -423,    496,  -1196,    -24,  -1014,    969,    294,
-       237,  -1733,     27,   2543,   1494,    190,    457,  -1391,
-      1209,   5651,    548,    504,    686,  -2889,   -151,    725,
-       486,  -3716,   -285,    830,     31,   5132,    770,    -24,
-      -482,   -369,   -126,  -1552,   -347,   -272,   -387,  -9485,
-     -1547,  -1189,    369,    812,    311,    536,    391,    361,
-     -1708,   -288,    -94,   2053,    557,   -611,  -4551,  -2368,
-       173,    472,    160,  -1849,     96,  -7569,    183,    484,
-      -393,   -346,   -309,    -13,     -7,      2,   -239,  10395,
-      -587,   -115,   1282,   -634,     81,     90,   -725,  -2685,
-     -1214,  -4455,  -1897,  -2903,   -827,    124,   2215,    696,
-     -1225,  -1353,   -371,    343,    421,   -640,   1480,  -1174,
-        76,   -835,   -716,   -625,   -547,   1250,  -2696,   2132,
-      -548,    439,   -607,    408,   -221,   5026,    352,   -344,
-     -1339,   -602,  -1650,   -404,   -458,   -502,     61,   -164,
-        53,    -26,  -2652,   -209,     64,  -4068,    713,    193,
-      -117,  -1290,     95,    -86,   -515,   1336,   -492,   1654,
-     -2963,   3663,  -4231,     -1,   3017,    371,    276,     -7,
-      -289,    -33,  -5942,    237,     30,    586,   -264,   -493,
-       435,   -388,   -165,  10434,    192,   3897,  -5414,    361,
-       845,   -259,    481,    331,    650,   -232,     23,  -1789,
-        27,  -4065,   1020,  -4261,   -651,   3174,    951,  -3363,
-       577,   -112,    642,  -1177,  -1707,    492,   -250,  -1236,
-        24,  -1394,  -1807,   -853,   1681,    -69,    851,   -959,
-     -5759,   -202,     30,  -3466,   -593,   5414,     65,    141,
-      -319,    674,   1183,   -155,   -312,    372,   2829,    -75,
-       -60,  -2618,   -240,   2944,   -631,  -4221,    -16,    467,
-       211,    -58,     55,   -527,    -51,   -160,    642,   -305,
-       388,    413,    210,    -81,  -3383,   -120,    144,   -220,
-      -672,   1352,   -630,  -2324,   -423,  -8053,   -131,   -912,
-      -260,   -380,    470,    154,  -1346,  -2417,   -426,   -403,
-      -137,   -160,   2823,    609,   -216,   -173,   -585,   -514,
-        95,   -202,    222,     16,    136,   1751,    237,  -1089,
-       957,   -144,   -518,    416,   -347,    -60,    207,    277,
-       512,  -1133,    166,   1423,   -883,   -194,  -7016,  -1938,
-       417,   2302,   -992,   -179,    738,    -74,    411,   -462,
-      -413,     67,    234,   -322,   -164,    -47,    -89,   1409,
-       390,  -1180,  -2888,    655,   1958,      0,  -1826,   -471,
-     -1247,    307,    104,  -8502,   -198,   -222,    191,    281,
-      -868,     47,  -4553,   2434,    174,    263,   2844,    -72,
-      -597,  -1183,   -374,    -93,   3348,     13,    173,   6285,
-       -32,   -213,   1882,    411,   -608,   -562,   2998,    293,
-        54,   -147,   -120,    822,    -93,    679,    206,  -3229,
-      -767,  -1603,   -259,   -310,   4306,    548,     -9,    -99,
-     -5722,   -328,   -176,    453,    338,  -9687,    -63,    844,
-       322,    615,  -1075,   -370,    159,    -33,  -6213,  -1375,
-       741,   -801,  -1319,   1513,   1331,    -69,   2702,   -458,
-      -203,    103,   4696,   -284,    465,    -62,    -40,   3184,
-       238,  -6131,    546,   1713,   -365,    -24,    116,    -33,
-       304,    807,   -231,    291,    903,    749,   -254, -12215,
-       115,    -35,    -95,   -166,  -3776,   -170,  -4517,   -151,
-        67,  -7725,    666,   -573,   -744,   -719,     37,     31,
-       373,    148,   -125,     15,   -150,   -905,    -42,    272,
-     -5223,    650,   5233,    109,  -1235,    991,    211,   1522,
-      -555,   -328,    -52,   5335,    -22,  -5476,  -3102,   -637,
-       986,    468,    -37,   -164,   -264,  -1290,    754,   -940,
-      -685,   -862,   7270,   -279,   -441,    472,   -153,  -2515,
-      3899,    -95,    360,    762,     14,    434,    619,    185,
-      -230,   1233,  -1330,   1360,   -756,    361,  -1391,   -247,
-       120,  -3573,    293,    375,    806,   5526,    536,    137,
-       486,   -484,     13,    -37,     12,     -4,     81,     43,
-        10,     43,    -38,   -371,    -64,  -1167,   -117,   -371,
-     -1958,   -166,    543,    -97,    -83,    391,    -59,  -1631,
-       302,   1077,   -128,   -641,    -64,     21,  -2562,   -235,
-       342,  -7121,   -646,    -49,   -961,   -141,   -210,   -555,
-     -1596,   -988,    723,   -209,  -3585,     10,    -35,   1051,
-         0,    138,    941,  -5002,    805,   3009,     35,    -70,
-       513,    -21,   -432,   -224, -10628,   -167,  -1045,   2603,
-       336,    360,    515,    683,    981,   3028,    492,   -543,
-     -1844,     23,    -30,     52,    -40,    447,     11,    363,
-       -95,   1609,   2613,    -13,   -400,    719,  -4513,   -676,
-      -290,    456,   -332,    -11,   -261,   -455,     89,   -301,
-       285,    287,    202,    281,     87,   -202,  -1482,   -535,
-       874,   -478,   -201,   4715,    824,   -204,    145,   2882,
-       404,   3376,    363,    -18,   -127,    764,    106,   1626,
-       178,    185,     22,   -637,  -6216,   1399,   -961,    -88,
-      -553,    -91,     98,   1831,      9,   -583,   1253,  -1741,
-};
-
-static const int16_t shape44s[] = {
-       -20,   -140,    683,   -586,  -1742,    177,   -538,   1900,
-      2193,    -17,  -2096,    261,    645,    339,     77,   1136,
-      -521,    537,   -924,   -156,   -261,    195,   1049,    -39,
-       236,   -137,      0,   3199,    225,     46,     86,   -215,
-       557,  -5394,     17,    911,  -1690,    -48,    -48,   -175,
-       -11,   -631,   -153,   4474,   -347,    -39,   1759,    154,
-       170,   -180,   -273,    603,   -590,  -5195,    -74,   1789,
-       240,   -212,    431,   2447,    368,    -76,   -313,     11,
-     -2926,     19,    -71,    208,    -51,   -728,  -6412,    -61,
-       141,   -112,   5280,    -76,   4435,   -402,    -25,     46,
-       210,   -104,    172,  -3830,   -366,    -23,    239,   -112,
-       137,   6692,  -6288,   -720,   -132,   -136,    552,  -1688,
-      -345,   -289,   -485,    149,    174,    180,    361,   -236,
-        92,    407,      6,   2373,    380,   -167,    845,    444,
-      -834,  -9358,    413,  -1302,    460,     77,     34,     56,
-     -1516,   -143,    207,    -43,    -31,   -106,    -52,    403,
-      -309,    298,    -88,   1552,   -240,   -776,    624,  -4181,
-      -342,  -4804,     57,    -23,    160,    -44,    469,    -17,
-     -3997,  -5079,   -263,     72,    181,   1085,    538,   -611,
-      -368,     59,   -204,   -195,    -40,   -201,   -803,  -5093,
-     -3216,    480,     46,   -729,    244,   3320,    185,    503,
-      2979,   -416,    110,     25,    140,   -502,   2236,  -4420,
-       -36,   -238,   -278,     60,    -82,   -597,    218,     69,
-       -95,  -2102,  -2138,  -2308,  -3796,     20,   -211,   -229,
-       297,   3665,     81,    148,   1315,  -4537,    -38,    186,
-     -3106,   -526,     90,    -35,   -193,   -302,  -5860,    276,
-      -308,    206,    645,      1,   -242,    580,   3025,  -2583,
-       -90,    511,   -315,   -137,  -2033,  -4313,    693,    485,
-      -211,   1486,   1180,    181,   -136,    204,     23,    383,
-      1479,   -213,     42,     32,    -64,   -136,    -91,   -146,
-       434,    231,     36,    -58,  -3254,  -2647,    -18,    345,
-       171,    -60,     84,    209,    246,   -587,   9447,    -67,
-      -187,   -108,   -226,   -458,   -519, -11089,   -422,   -502,
-       132,     79,    298,   -475,   -412,    196,   -164,  -7347,
-       185,   -131,    369,     18,   -500,    644,   -334,     93,
-       -77,     71,    341,   3566,   -281,  -4191,   -145,     87,
-        37,    306,  -3482,  -5739,    161,   -245,    293,    208,
-       380,   2888,     31,    -23,  -2061,   -597,    -56,    350,
-      -105,   1167,     64,    342,   3638,    -79,   -106,    148,
-      5422,   -719,   -232,      8,   -395,   3249,  -5093,   -222,
-      -707,    241,    318,    735,    376,     78,   -166,  -1614,
-        -9,  -3373,    330,  -1540,   2028,   3400,     -9,    317,
-         9,   4903,    262,     62,    222,    -95,   -208, -13376,
-      -101,    121,    298,      5,    172,    406,   -164,     79,
-       172,   1993,    235,    229,   1193,   -274,   5944,   -918,
-       -15,   1304,    307,   1150,   -385,   -794,  -3467,    660,
-      2143,    147,   -279,   -751,   -305,   1052,    205,   -108,
-       572,   -212,     29,    -50,      6,   3749,    238,  -2016,
-     -1118,  -1329,   -971,   2633,    519,    194,   3545,    -11,
-        77,    -92,   1215,   -439,    152,   -863,   1604,    180,
-      -514,    252,    308,   -131,   -938,    133,    378,     11,
-     12153,     51,    486,     71,   -476,   -599,     57,   -127,
-      2685,   -173,   -182,    468,  -3469,   -594,   -380,    265,
-      -879,   -352,   -278,   -309,    575,    124,  10814,   -765,
-       -64,    710,   -105,    296,   2562,     98,   -358,    556,
-      2921,   -133,     -5,   -406,     42,    496,  -1053,  -1957,
-       701,    266,    260,   -441,     43,   -192,     -1,  -2174,
-      9894,    -90,   -181,     29,     50,   -858,     59,   -190,
-        49,   -282,   1632,   1525,    100,  -3659,     13,    173,
-      -240,   5304,   -383,    263,   -311,   1747,    169,  -2203,
-       -29,   -106,    342,   -301,     66,     49,     23,    857,
-      -607,    698,  -1198,   -191,   -450,  -1875,   -329,  -2156,
-       156,     95,    145,    129,   -321,     88,   1049,   3980,
-       -14,    321,  -1484,    895,    -30,  -2174,    289,    933,
-      -933,     15,   2631,     68,   3054,    221,    -87,    175,
-       200,    937,    -87,  -2032,    348,    146,   -372,     60,
-     -2566,   3497,    -98,    313,    536,   -299,    -58,  -8949,
-       323,   -524,   -331,    713,    -47,    360,    155,    168,
-       687,  -1391,   1973,    670,    788,   -202,   -129,  -5113,
-        54,   1178,   1218,    172,    630,   -154,  -1047,    840,
-        71,   -337,     91,    214,   -474,    624,   -773,     16,
-      -126,    340,   -631,   -482,   -155,    419,     50, -10976,
-      -742,   -781,    169,    149,     33,   -169,     44,    354,
-        26,    129,   -179,   1401,    776,   -155,  -3996,   -813,
-       594,    238,    -61,    168,   -383,  -9261,    294,    470,
-      -322,   -190,   -956,   -290,     27,   -438,   -254,  12571,
-       344,   -393,   -568,     56,     81,    171,   -115,  -4370,
-        49,   -322,   -237,   -692,    -55,    -49,   4317,     -6,
-     -4837,   -156,    179,    247,   -338,    -48,    952,  -1061,
-       -33,   -934,    250,   -256,  -1622,   1039,   -738,   2719,
-       -20,   -190,    249,   -119,   -235,   6080,    123,   -502,
-     -1443,     86,  -1684,   -177,   -128,    -58,   -237,   -641,
-      -177,     64,  -2416,     15,   -116,  -6465,   -412,    161,
-       419,    768,     36,    113,   -944,   -241,  -1424,    -95,
-       635,   1798,  -2257,    -18,   3046,    173,    -33,   -207,
-       -52,   -831,  -5730,    -54,   -199,    194,   -255,    467,
-      -211,   -853,   -512,  11619,    148,   3681,  -4603,   -282,
-       129,   -205,   -606,    167,    306,    464,    485,   -959,
-      -203,    254,    151,  -6880,   -262,   5180,    658,  -1378,
-      1174,    -53,    -59,    -33,  -3077,   -127,   -223,    -17,
-       -31,  -2190,     23,    317,   -169,    203,   -223,   -222,
-     -5295,    116,     80,  -2757,   -666,   3377,   -476,     85,
-      -630,   -147,   1740,   -175,   -115,    207,    240,   -248,
-       -95,  -1016,   3966,   3998,   -343,  -4751,    187,   -113,
-      -250,    111,   -510,   -203,    130,     89,    311,    608,
-      -221,   -381,   -253,   -359,  -2254,     45,    224,   -141,
-        45,    -19,    480,  -5074,    797,  -4580,   -163,    110,
-      -234,    337,      6,    707,    492,  -5493,  -2750,    -94,
-      -363,    113,   2345,    344,    379,    464,  -3222,    -56,
-      -269,   -262,    -10,   -609,    324,   3043,    209,   3092,
-      -600,     42,   -615,    -17,    -53,     30,   1123,    224,
-       593,    632,    -90,    428,   1117,  -1429,  -6741,    -95,
-      -293,   -103,  -2784,    251,   1688,    621,   -349,   1059,
-     -1093,   -148,    447,    149,     88,     92,    687,   1249,
-        80,    289,  -1841,    221,    -10,    -92,  -1736,    118,
-       136,    138,   -162,  -4162,   -111,     62,     95,    166,
-      -172,   -695,  -3685,   5694,   -527,   2032,   -549,     43,
-      -101,    221,    181,   -479,   7697,   2007,   -127,    805,
-       -83,   -535,   1354,   -383,    253,   -622,   2910,   1249,
-       782,     13,     42,    994,   -545,     75,   -485,    330,
-       -16,    343,    272,   -781,    360,    -97,    -25,   -875,
-    -12689,   -623,   -307,    195,   -256, -11644,    229,    180,
-       -42,   -361,   -124,    -81,    -23,   -460,  -1993,    212,
-      -634,   -847,   1616,   -546,   -583,     99,   3800,     10,
-       177,    366,   6106,   -173,    265,   -213,     10,   1108,
-      -288,  -1690,   -237,   -312,     38,  -2272,    431,    -26,
-      -178,   -764,    507,    355,    677,   -214,   -816, -12411,
-        47,     12,    294,   -295,  -3916,   -677,  -4885,   -250,
-      -453,  -7716,    478,    231,     17,   -248,    147,   1064,
-       637,    -80,    -41,    265,   -383,    142,    116,   2991,
-     -3060,    809,   2056,   -119,   -866,    -22,   -660,    233,
-       306,  -1873,  -1141,   6995,    186,  -8678,   -109,    -39,
-      -105,    730,     18,   -846,    273,  -2922,    210,     26,
-      -174,   -142,    990,    131,   -436,   1422,   -217,  -3152,
-      3224,     35,    315,    -47,     48,   -221,    568,     44,
-       182,   1696,  -1755,   -193,    527,    158,   -555,  -3485,
-       171,  -4552,    -47,  -4680,     95,   -112,    184,     80,
-       -36,   -915,     87,     24,   -259,  -1743,     68,   -117,
-       405,     11,     40,   -320,    -17,   -158,   -134,   -186,
-     -1206,   -466,   1262,    133,   -254,   -100,    210,  -1735,
-      -636,    319,   -978,     69,    197,   -521,  -5503,    -78,
-      -544,  -1011,    101,   -489,   -371,    -79,   -196,    -18,
-      -839,   1091,    682,  -1441,  -2375,  -1127,     54,    829,
-      -306,   -255,    641,  -3665,    473,   3504,  -1035,   -160,
-      -467,   -275,   -437,     79, -13513,    326,    132,     82,
-       188,    362,    -74,   1406,    -46,   2864,    351,   -558,
-     -1277,    108,    -92,    -53,     72,    -41,    -31,    -97,
-       353,     73,   1864,   -207,    106,    -81,  -3930,    173,
-        41,   -539,   -497,    135,   -526,   -823,     69,    -10,
-       176,    648,  -1710,    564,     80,    237,  -1956,    234,
-        11,    142,   -849,   4116,   -473,    110,    129,   2137,
-      -170,   3193,     10,    245,   -953,   -827,    -30,   1235,
-       366,    -67,     54,   -567,  -7377,   2461,    582,     74,
-     -1988,    -33,   -296,   3090,    -54,    145,    564,   -295,
-};
-
-static const uint16_t bark_tab_l8_512[] = {
-    4,  5,  4,  5,  4,  5,  5,  5,  5,  6,  6,  6,  6,  8,  7,  9,
-    9, 11, 11, 14, 15, 17, 20, 24, 28, 34, 41, 51, 64, 83,
-};
-
-static const uint16_t bark_tab_m8_256[] = {
-    3, 4, 3, 4, 3, 4, 4, 5, 5, 6, 6, 8, 9, 11, 13, 17, 23, 29, 41, 58
-};
-
-static const uint16_t bark_tab_s8_64[] = {
-    2, 1, 2, 2, 3, 4, 5, 7, 13, 25
-};
-
-static const uint16_t bark_tab_l8s_512[] = {
-      7,   8,   7,   8,   8,   8,   8,   8,
-      8,   9,   9,  10,  10,  11,  11,  12,
-     12,  14,  15,  16,  18,  19,  21,  24,
-     27,  30,  35,  40,  46,  53,
-};
-
-static const uint16_t bark_tab_s8s_64[] = {
-      3,   3,   3,   3,   4,   5,   6,   8,
-     12,  17,
-};
-
-static const uint16_t bark_tab_m8s_256[] = {
-      6,   5,   6,   6,   6,   6,   7,   7,
-      8,   8,   9,  10,  11,  13,  15,  18,
-     20,  25,  31,  39,
-};
-
-static const uint16_t bark_tab_l11_512[] = {
-      4,   4,   5,   4,   5,   4,   5,   6,
-      6,   6,   7,   8,   9,  10,  12,  14,
-     17,  21,  27,  33,  44,  58,  82, 121,
-};
-
-static const uint16_t bark_tab_s11_64[] = {
-      2,   1,   2,   3,   4,   6,  13,  33,
-};
-
-static const uint16_t bark_tab_m11_256[] = {
-      3,   3,   4,   3,   4,   4,   5,   6,
-      7,   9,  11,  15,  21,  30,  48,  83,
-};
-
-static const uint16_t bark_tab_l11s_512[] = {
-      6,   6,   6,   6,   6,   6,   7,   6,
-      7,   7,   8,   8,   8,   9,  10,  10,
-     11,  13,  13,  15,  17,  18,  21,  25,
-     27,  33,  38,  45,  54,  66,
-};
-
-static const uint16_t bark_tab_s11s_64[] = {
-      2,   3,   2,   3,   3,   4,   6,   8,
-     12,  21,
-};
-
-static const uint16_t bark_tab_m11s_256[] = {
-      4,   5,   4,   5,   5,   5,   6,   5,
-      7,   7,   8,   9,  10,  12,  15,  17,
-     22,  28,  35,  47,
-};
-
-static const uint16_t bark_tab_l16_1024[] = {
-     5,  5,  5,  5,  5,  5,  5,  6,  6,  7,  7,   7,   8,   9, 10, 11,
-    12, 14, 17, 19, 22, 27, 33, 40, 51, 64, 84, 114, 164, 257
-};
-
-static const uint16_t bark_tab_m16_512[] = {
-     3,  3,  3,  3,  4,  3,  4,   4,  4,  5,  5,  6,  7,  8, 10, 12,
-    14, 18, 24, 30, 42, 59, 89, 152
-};
-
-static const uint16_t bark_tab_s16_128[] = {
-    2, 2, 2, 3, 3, 5, 7, 12, 25, 67
-};
-
-static const uint16_t bark_tab_s16_64[] = {
-    1, 1, 2, 2, 3, 6, 11, 38
-};
-
-static const uint16_t bark_tab_l16s_1024[] = {
-      9,   9,   8,   9,  10,   9,  10,  10,
-     10,  12,  11,  13,  13,  14,  16,  17,
-     19,  20,  24,  26,  30,  35,  40,  48,
-     56,  68,  83, 102, 128, 165,
-};
-
-static const uint16_t bark_tab_s16s_128[] = {
-      3,   4,   4,   4,   5,   7,  10,  16,
-     26,  49,
-};
-
-static const uint16_t bark_tab_m16s_512[] = {
-      7,   6,   7,   7,   7,   8,   9,   9,
-     10,  11,  14,  15,  18,  22,  27,  34,
-     44,  59,  81, 117,
-};
-
-static const uint16_t bark_tab_l22_1024[] = {
-      3,   4,   3,   4,   3,   4,   4,   4,
-      4,   4,   5,   5,   5,   6,   7,   7,
-      8,   9,  11,  12,  14,  16,  20,  24,
-     29,  36,  45,  60,  80, 113, 173, 302,
-};
-
-static const uint16_t bark_tab_s22_128[] = {
-      1,   2,   1,   2,   3,   4,   6,  10,
-     23,  76,
-};
-
-static const uint16_t bark_tab_m22_512[] = {
-      3,   2,   3,   3,   3,   4,   3,   5,
-      4,   6,   7,   8,  10,  14,  18,  25,
-     36,  55,  95, 208,
-};
-
-static const uint16_t bark_tab_l22s_1024[] = {
-      6,   7,   6,   6,   7,   7,   7,   7,
-      7,   8,   9,   8,  10,  10,  11,  12,
-     13,  15,  16,  18,  21,  24,  27,  33,
-     38,  46,  55,  68,  84, 107, 140, 191,
-};
-
-static const uint16_t bark_tab_s22s_128[] = {
-      3,   2,   3,   4,   4,   6,   9,  14,
-     26,  57,
-};
-
-static const uint16_t bark_tab_m22s_512[] = {
-      5,   5,   5,   6,   5,   7,   6,   7,
-      9,   9,  11,  13,  15,  20,  24,  33,
-     43,  61,  88, 140,
-};
-
-static const uint16_t bark_tab_l44_2048[] = {
-     5,  6,  5,   6,   5,   6,   6,   6,  6,  6,  7,  7,  7,  8,  8,  9,
-     9, 10, 11,  11,  13,  14,  16,  17, 19, 22, 25, 29, 33, 39, 46, 54,
-    64, 79, 98, 123, 161, 220, 320, 512,
-};
-
-static const uint16_t bark_tab_m44_512[] = {
-     3,  2,  3,   3,  3,  4,  3,  5,  4,  6,  7,  8, 10, 14, 18, 25,
-    36, 55, 95, 208,
-};
-
-static const uint16_t bark_tab_s44_128[] = {
-    1, 2, 1, 2, 3, 4, 6, 10, 23, 76
-};
-
-const TwinVQModeTab ff_metasound_mode0806 = {
-    {
-        {  8, bark_tab_s8_64,  10, fcb8s, 1, 5, cb0806ss0, cb0806ss1, 27 },
-        {  2, bark_tab_m8_256, 20, fcb8m, 2, 5, cb0806sm0, cb0806sm1, 22 },
-        {  1, bark_tab_l8_512, 30, fcb8l, 3, 6, cb0806sl0, cb0806sl1, 24 }
-    },
-    512, 12, lsp8, 1, 5, 3, 3, shape8, 8, 28, 20, 6, 200
-};
-
-const TwinVQModeTab ff_metasound_mode0806s = {
-    {
-        {  8, bark_tab_s8s_64,  10, fcb8ss, 1, 5, cb0806ss0, cb0806ss1, 27 },
-        {  2, bark_tab_m8s_256, 20, fcb8sm, 2, 5, cb0806sm0, cb0806sm1, 22 },
-        {  1, bark_tab_l8s_512, 30, fcb8sl, 3, 6, cb0806sl0, cb0806sl1, 24 }
-    },
-    512, 12, lsp8s, 1, 5, 3, 3, shape8s, 8, 28, 20, 6, 200
-};
-
-const TwinVQModeTab ff_metasound_mode0808 = {
-    {
-        { 8, bark_tab_s8_64,  10, fcb8s, 1, 5, cb0808s0, cb0808s1, 18 },
-        { 2, bark_tab_m8_256, 20, fcb8m, 2, 5, cb0808m0, cb0808m1, 16 },
-        { 1, bark_tab_l8_512, 30, fcb8l, 3, 6, cb0808l0, cb0808l1, 17 }
-    },
-    512, 12, lsp8, 1, 5, 3, 3, shape8, 8, 28, 20, 6, 200
-};
-
-const TwinVQModeTab ff_metasound_mode0808s = {
-    {
-        {  8, bark_tab_s8s_64,  10, fcb8ss, 1, 5, cb0808ss0, cb0808ss1, 18 },
-        {  2, bark_tab_m8s_256, 20, fcb8sm, 2, 5, cb0808sm0, cb0808sm1, 16 },
-        {  1, bark_tab_l8s_512, 30, fcb8sl, 3, 6, cb0808sl0, cb0808sl1, 17 }
-    },
-    512, 12, lsp8s, 1, 5, 3, 3, shape8s, 8, 28, 20, 6, 200
-};
-
-const TwinVQModeTab ff_metasound_mode1110 = {
-    {
-        {  8, bark_tab_s11_64,   8, fcb11s, 1, 5, cb1110s0, cb1110s1, 21 },
-        {  2, bark_tab_m11_256, 16, fcb11m, 2, 5, cb1110m0, cb1110m1, 18 },
-        {  1, bark_tab_l11_512, 24, fcb11l, 3, 6, cb1110l0, cb1110l1, 19 }
-    },
-    512, 16, lsp11, 1, 6, 4, 3, shape11, 9, 28, 20, 7, 200
-};
-
-const TwinVQModeTab ff_metasound_mode1110s = {
-    {
-        {  8, bark_tab_s11s_64,  10, fcb11ss, 1, 5, cb1110ss0, cb1110ss1, 21 },
-        {  2, bark_tab_m11s_256, 20, fcb11sm, 2, 5, cb1110sm0, cb1110sm1, 18 },
-        {  1, bark_tab_l11s_512, 30, fcb11sl, 3, 6, cb1110sl0, cb1110sl1, 20 }
-    },
-    512, 16, lsp11s, 1, 6, 4, 3, shape11s, 9, 36, 30, 7, 200
-};
-
-const TwinVQModeTab ff_metasound_mode1616 = {
-    {
-        { 8, bark_tab_s16_128,  10, fcb16s, 1, 5, cb1616s0, cb1616s1, 16 },
-        { 2, bark_tab_m16_512,  24, fcb16m, 2, 5, cb1616m0, cb1616m1, 15 },
-        { 1, bark_tab_l16_1024, 30, fcb16l, 3, 6, cb1616l0, cb1616l1, 16 }
-    },
-    1024, 16, lsp16, 1, 6, 4, 3, shape16, 9, 28, 30, 7, 200
-};
-
-const TwinVQModeTab ff_metasound_mode1616s = {
-    {
-        { 8, bark_tab_s16s_128,  10, fcb16ss, 1, 5, cb1616ss0, cb1616ss1, 16 },
-        { 2, bark_tab_m16s_512,  20, fcb16sm, 2, 5, cb1616sm0, cb1616sm1, 15 },
-        { 1, bark_tab_l16s_1024, 30, fcb16sl, 3, 6, cb1616sl0, cb1616sl1, 16 }
-    },
-    1024, 16, lsp16, 1, 6, 4, 3, shape16s, 9, 56, 60, 7, 200
-};
-
-const TwinVQModeTab ff_metasound_mode2224 = {
-    {
-        { 8, bark_tab_s22_128,  10, fcb22s, 1, 6, cb2224s0, cb2224s1, 15 },
-        { 2, bark_tab_m22_512,  20, fcb22m, 2, 6, cb2224m0, cb2224m1, 14 },
-        { 1, bark_tab_l22_1024, 32, fcb22l, 4, 6, cb2224l0, cb2224l1, 15 }
-    },
-    1024, 16, lsp22, 1, 6, 4, 3, shape22, 9, 56, 36, 7, 200
-};
-
-const TwinVQModeTab ff_metasound_mode2224s = {
-    {
-        { 8, bark_tab_s22s_128,  10, fcb22ss, 1, 6, cb2224ss0, cb2224ss1, 15 },
-        { 2, bark_tab_m22s_512,  20, fcb22sm, 2, 6, cb2224sm0, cb2224sm1, 14 },
-        { 1, bark_tab_l22s_1024, 32, fcb22sl, 4, 6, cb2224sl0, cb2224sl1, 15 }
-    },
-    1024, 16, lsp22s, 1, 6, 4, 3, shape22s, 9, 56, 36, 7, 200
-};
-
-const TwinVQModeTab ff_metasound_mode4432 = {
-    {
-        { 16, bark_tab_s44_128,  10, fcb44ss, 1, 6, cb4432s0, cb4432s1, 23 },
-        {  4, bark_tab_m44_512,  20, fcb44sm, 2, 6, cb4432m0, cb4432m1, 21 },
-        {  1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4432l0, cb4432l1, 22 }
-    },
-    2048, 20, lsp44s, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200,
-};
-
-const TwinVQModeTab ff_metasound_mode4432s = {
-    {
-        { 16, bark_tab_s44_128,  10, fcb44ss, 1, 6, cb4432s0, cb4432s1, 23 },
-        {  4, bark_tab_m44_512,  20, fcb44sm, 2, 6, cb4432m0, cb4432m1, 21 },
-        {  1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4432l0, cb4432l1, 22 }
-    },
-    2048, 20, lsp44s, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200,
-};
-
-const TwinVQModeTab ff_metasound_mode4440 = {
-    {
-        { 16, bark_tab_s44_128,  10, fcb44ss, 1, 6, cb4440ss0, cb4440ss1, 18 },
-        {  4, bark_tab_m44_512,  20, fcb44sm, 2, 6, cb4440sm0, cb4440sm1, 17 },
-        {  1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4440sl0, cb4440sl1, 17 }
-    },
-    2048, 20, lsp44s, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200
-};
-
-const TwinVQModeTab ff_metasound_mode4440s = {
-    {
-        { 16, bark_tab_s44_128,  10, fcb44ss, 1, 6, cb4440ss0, cb4440ss1, 18 },
-        {  4, bark_tab_m44_512,  20, fcb44sm, 2, 6, cb4440sm0, cb4440sm1, 17 },
-        {  1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4440sl0, cb4440sl1, 17 }
-    },
-    2048, 20, lsp44s, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200
-};
-
-const TwinVQModeTab ff_metasound_mode4448 = {
-    {
-        { 16, bark_tab_s44_128,  10, fcb44ss, 1, 6, cb4448ss0, cb4448ss1, 15 },
-        {  4, bark_tab_m44_512,  20, fcb44sm, 2, 6, cb4448sm0, cb4448sm1, 14 },
-        {  1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4448sl0, cb4448sl1, 14 }
-    },
-    2048, 20, lsp44s, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200
-};
-
-const TwinVQModeTab ff_metasound_mode4448s = {
-    {
-        { 16, bark_tab_s44_128,  10, fcb44ss, 1, 6, cb4448ss0, cb4448ss1, 15 },
-        {  4, bark_tab_m44_512,  20, fcb44sm, 2, 6, cb4448sm0, cb4448sm1, 14 },
-        {  1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4448sl0, cb4448sl1, 14 }
-    },
-    2048, 20, lsp44s, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200
-};
diff --git a/deps/libav/libavcodec/metasound_data.h b/deps/libav/libavcodec/metasound_data.h
deleted file mode 100644
index 4925516..0000000
--- a/deps/libav/libavcodec/metasound_data.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * MetaSound decoder
- * Copyright (c) 2013 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_METASOUND_DATA_H
-#define AVCODEC_METASOUND_DATA_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "twinvq.h"
-
-extern const TwinVQModeTab ff_metasound_mode0806;
-extern const TwinVQModeTab ff_metasound_mode0806s;
-extern const TwinVQModeTab ff_metasound_mode0808;
-extern const TwinVQModeTab ff_metasound_mode0808s;
-extern const TwinVQModeTab ff_metasound_mode1110;
-extern const TwinVQModeTab ff_metasound_mode1110s;
-extern const TwinVQModeTab ff_metasound_mode1616;
-extern const TwinVQModeTab ff_metasound_mode1616s;
-extern const TwinVQModeTab ff_metasound_mode2224;
-extern const TwinVQModeTab ff_metasound_mode2224s;
-extern const TwinVQModeTab ff_metasound_mode2232;
-extern const TwinVQModeTab ff_metasound_mode2232s;
-extern const TwinVQModeTab ff_metasound_mode4432;
-extern const TwinVQModeTab ff_metasound_mode4432s;
-extern const TwinVQModeTab ff_metasound_mode4440;
-extern const TwinVQModeTab ff_metasound_mode4440s;
-extern const TwinVQModeTab ff_metasound_mode4448;
-extern const TwinVQModeTab ff_metasound_mode4448s;
-
-#endif /* AVCODEC_METASOUND_DATA_H */
diff --git a/deps/libav/libavcodec/mimic.c b/deps/libav/libavcodec/mimic.c
deleted file mode 100644
index 264c74a..0000000
--- a/deps/libav/libavcodec/mimic.c
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * Copyright (C) 2005  Ole André Vadla Ravnås <oleavr at gmail.com>
- * Copyright (C) 2008  Ramiro Polla
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "hpeldsp.h"
-#include "thread.h"
-
-#define MIMIC_HEADER_SIZE   20
-
-typedef struct {
-    AVCodecContext *avctx;
-
-    int             num_vblocks[3];
-    int             num_hblocks[3];
-
-    void           *swap_buf;
-    int             swap_buf_size;
-
-    int             cur_index;
-    int             prev_index;
-
-    ThreadFrame     frames     [16];
-    AVPicture       flipped_ptrs[16];
-
-    DECLARE_ALIGNED(16, int16_t, dct_block)[64];
-
-    GetBitContext   gb;
-    ScanTable       scantable;
-    DSPContext      dsp;
-    HpelDSPContext  hdsp;
-    VLC             vlc;
-
-    /* Kept in the context so multithreading can have a constant to read from */
-    int             next_cur_index;
-    int             next_prev_index;
-} MimicContext;
-
-static const uint32_t huffcodes[] = {
-    0x0000000a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000b,
-    0x0000001b, 0x00000038, 0x00000078, 0x00000079, 0x0000007a, 0x000000f9,
-    0x000000fa, 0x000003fb, 0x000007f8, 0x000007f9, 0x000007fa, 0x000007fb,
-    0x00000ff8, 0x00000ff9, 0x00000001, 0x00000039, 0x0000007b, 0x000000fb,
-    0x000001f8, 0x000001f9, 0x00000ffa, 0x00000ffb, 0x00001ff8, 0x00001ff9,
-    0x00001ffa, 0x00001ffb, 0x00003ff8, 0x00003ff9, 0x00003ffa, 0x00000000,
-    0x00000004, 0x0000003a, 0x000001fa, 0x00003ffb, 0x00007ff8, 0x00007ff9,
-    0x00007ffa, 0x00007ffb, 0x0000fff8, 0x0000fff9, 0x0000fffa, 0x0000fffb,
-    0x0001fff8, 0x0001fff9, 0x0001fffa, 0x00000000, 0x0000000c, 0x000000f8,
-    0x000001fb, 0x0001fffb, 0x0003fff8, 0x0003fff9, 0x0003fffa, 0x0003fffb,
-    0x0007fff8, 0x0007fff9, 0x0007fffa, 0x0007fffb, 0x000ffff8, 0x000ffff9,
-    0x000ffffa, 0x00000000, 0x0000001a, 0x000003f8, 0x000ffffb, 0x001ffff8,
-    0x001ffff9, 0x001ffffa, 0x001ffffb, 0x003ffff8, 0x003ffff9, 0x003ffffa,
-    0x003ffffb, 0x007ffff8, 0x007ffff9, 0x007ffffa, 0x007ffffb, 0x00000000,
-    0x0000003b, 0x000003f9, 0x00fffff8, 0x00fffff9, 0x00fffffa, 0x00fffffb,
-    0x01fffff8, 0x01fffff9, 0x01fffffa, 0x01fffffb, 0x03fffff8, 0x03fffff9,
-    0x03fffffa, 0x03fffffb, 0x07fffff8, 0x00000000, 0x000003fa, 0x07fffff9,
-    0x07fffffa, 0x07fffffb, 0x0ffffff8, 0x0ffffff9, 0x0ffffffa, 0x0ffffffb,
-    0x1ffffff8, 0x1ffffff9, 0x1ffffffa, 0x1ffffffb, 0x3ffffff8, 0x3ffffff9,
-    0x3ffffffa,
-};
-
-static const uint8_t huffbits[] = {
-     4,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  2,  4,  5,  6,  7,  7,  7,  8,
-     8, 10, 11, 11, 11, 11, 12, 12,  2,  6,  7,  8,
-     9,  9, 12, 12, 13, 13, 13, 13, 14, 14, 14,  0,
-     3,  6,  9, 14, 15, 15, 15, 15, 16, 16, 16, 16,
-    17, 17, 17,  0,  4,  8,  9, 17, 18, 18, 18, 18,
-    19, 19, 19, 19, 20, 20, 20,  0,  5, 10, 20, 21,
-    21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23,  0,
-     6, 10, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26,
-    26, 26, 27,  0, 10, 27, 27, 27, 28, 28, 28, 28,
-    29, 29, 29, 29, 30, 30, 30,
-};
-
-static const uint8_t col_zag[64] = {
-     0,  8,  1,  2,  9, 16, 24, 17,
-    10,  3,  4, 11, 18, 25, 32, 40,
-    33, 26, 19, 12,  5,  6, 13, 20,
-    27, 34, 41, 48, 56, 49, 42, 35,
-    28, 21, 14,  7, 15, 22, 29, 36,
-    43, 50, 57, 58, 51, 44, 37, 30,
-    23, 31, 38, 45, 52, 59, 39, 46,
-    53, 60, 61, 54, 47, 55, 62, 63,
-};
-
-static av_cold int mimic_decode_end(AVCodecContext *avctx)
-{
-    MimicContext *ctx = avctx->priv_data;
-    int i;
-
-    av_free(ctx->swap_buf);
-
-    for (i = 0; i < FF_ARRAY_ELEMS(ctx->frames); i++) {
-        if (ctx->frames[i].f)
-            ff_thread_release_buffer(avctx, &ctx->frames[i]);
-        av_frame_free(&ctx->frames[i].f);
-    }
-
-    if (!avctx->internal->is_copy)
-        ff_free_vlc(&ctx->vlc);
-
-    return 0;
-}
-
-static av_cold int mimic_decode_init(AVCodecContext *avctx)
-{
-    MimicContext *ctx = avctx->priv_data;
-    int ret, i;
-
-    avctx->internal->allocate_progress = 1;
-
-    ctx->prev_index = 0;
-    ctx->cur_index  = 15;
-
-    if ((ret = init_vlc(&ctx->vlc, 11, FF_ARRAY_ELEMS(huffbits),
-                        huffbits, 1, 1, huffcodes, 4, 4, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n");
-        return ret;
-    }
-    ff_dsputil_init(&ctx->dsp, avctx);
-    ff_hpeldsp_init(&ctx->hdsp, avctx->flags);
-    ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, col_zag);
-
-    for (i = 0; i < FF_ARRAY_ELEMS(ctx->frames); i++) {
-        ctx->frames[i].f = av_frame_alloc();
-        if (!ctx->frames[i].f) {
-            mimic_decode_end(avctx);
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    return 0;
-}
-
-static int mimic_decode_update_thread_context(AVCodecContext *avctx, const AVCodecContext *avctx_from)
-{
-    MimicContext *dst = avctx->priv_data, *src = avctx_from->priv_data;
-    int i, ret;
-
-    if (avctx == avctx_from)
-        return 0;
-
-    dst->cur_index  = src->next_cur_index;
-    dst->prev_index = src->next_prev_index;
-
-    memcpy(dst->flipped_ptrs, src->flipped_ptrs, sizeof(src->flipped_ptrs));
-
-    for (i = 0; i < FF_ARRAY_ELEMS(dst->frames); i++) {
-        ff_thread_release_buffer(avctx, &dst->frames[i]);
-        if (src->frames[i].f->data[0]) {
-            ret = ff_thread_ref_frame(&dst->frames[i], &src->frames[i]);
-            if (ret < 0)
-                return ret;
-        }
-    }
-
-    return 0;
-}
-
-static const int8_t vlcdec_lookup[9][64] = {
-    {    0, },
-    {   -1,   1, },
-    {   -3,   3,   -2,   2, },
-    {   -7,   7,   -6,   6,   -5,   5,   -4,   4, },
-    {  -15,  15,  -14,  14,  -13,  13,  -12,  12,
-       -11,  11,  -10,  10,   -9,   9,   -8,   8, },
-    {  -31,  31,  -30,  30,  -29,  29,  -28,  28,
-       -27,  27,  -26,  26,  -25,  25,  -24,  24,
-       -23,  23,  -22,  22,  -21,  21,  -20,  20,
-       -19,  19,  -18,  18,  -17,  17,  -16,  16, },
-    {  -63,  63,  -62,  62,  -61,  61,  -60,  60,
-       -59,  59,  -58,  58,  -57,  57,  -56,  56,
-       -55,  55,  -54,  54,  -53,  53,  -52,  52,
-       -51,  51,  -50,  50,  -49,  49,  -48,  48,
-       -47,  47,  -46,  46,  -45,  45,  -44,  44,
-       -43,  43,  -42,  42,  -41,  41,  -40,  40,
-       -39,  39,  -38,  38,  -37,  37,  -36,  36,
-       -35,  35,  -34,  34,  -33,  33,  -32,  32, },
-    { -127, 127, -126, 126, -125, 125, -124, 124,
-      -123, 123, -122, 122, -121, 121, -120, 120,
-      -119, 119, -118, 118, -117, 117, -116, 116,
-      -115, 115, -114, 114, -113, 113, -112, 112,
-      -111, 111, -110, 110, -109, 109, -108, 108,
-      -107, 107, -106, 106, -105, 105, -104, 104,
-      -103, 103, -102, 102, -101, 101, -100, 100,
-       -99,  99,  -98,  98,  -97,  97,  -96,  96, },
-    {  -95,  95,  -94,  94,  -93,  93,  -92,  92,
-       -91,  91,  -90,  90,  -89,  89,  -88,  88,
-       -87,  87,  -86,  86,  -85,  85,  -84,  84,
-       -83,  83,  -82,  82,  -81,  81,  -80,  80,
-       -79,  79,  -78,  78,  -77,  77,  -76,  76,
-       -75,  75,  -74,  74,  -73,  73,  -72,  72,
-       -71,  71,  -70,  70,  -69,  69,  -68,  68,
-       -67,  67,  -66,  66,  -65,  65,  -64,  64, },
-};
-
-static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale)
-{
-    int16_t *block = ctx->dct_block;
-    unsigned int pos;
-
-    ctx->dsp.clear_block(block);
-
-    block[0] = get_bits(&ctx->gb, 8) << 3;
-
-    for (pos = 1; pos < num_coeffs; pos++) {
-        uint32_t vlc, num_bits;
-        int value;
-        int coeff;
-
-        vlc = get_vlc2(&ctx->gb, ctx->vlc.table, ctx->vlc.bits, 3);
-        if (!vlc) /* end-of-block code */
-            return 0;
-        if (vlc == -1)
-            return AVERROR_INVALIDDATA;
-
-        /* pos_add and num_bits are coded in the vlc code */
-        pos     += vlc & 15; // pos_add
-        num_bits = vlc >> 4; // num_bits
-
-        if (pos >= 64)
-            return AVERROR_INVALIDDATA;
-
-        value = get_bits(&ctx->gb, num_bits);
-
-        /* Libav's IDCT behaves somewhat different from the original code, so
-         * a factor of 4 was added to the input */
-
-        coeff = vlcdec_lookup[num_bits][value];
-        if (pos < 3)
-            coeff <<= 4;
-        else /* TODO Use >> 10 instead of / 1001 */
-            coeff = (coeff * qscale) / 1001;
-
-        block[ctx->scantable.permutated[pos]] = coeff;
-    }
-
-    return 0;
-}
-
-static int decode(MimicContext *ctx, int quality, int num_coeffs,
-                  int is_iframe)
-{
-    int ret, y, x, plane, cur_row = 0;
-
-    for (plane = 0; plane < 3; plane++) {
-        const int is_chroma = !!plane;
-        const int qscale    = av_clip(10000 - quality, is_chroma ? 1000 : 2000,
-                                      10000) << 2;
-        const int stride    = ctx->flipped_ptrs[ctx->cur_index ].linesize[plane];
-        const uint8_t *src  = ctx->flipped_ptrs[ctx->prev_index].data[plane];
-        uint8_t       *dst  = ctx->flipped_ptrs[ctx->cur_index ].data[plane];
-
-        for (y = 0; y < ctx->num_vblocks[plane]; y++) {
-            for (x = 0; x < ctx->num_hblocks[plane]; x++) {
-                /* Check for a change condition in the current block.
-                 * - iframes always change.
-                 * - Luma plane changes on get_bits1 == 0
-                 * - Chroma planes change on get_bits1 == 1 */
-                if (is_iframe || get_bits1(&ctx->gb) == is_chroma) {
-                    /* Luma planes may use a backreference from the 15 last
-                     * frames preceding the previous. (get_bits1 == 1)
-                     * Chroma planes don't use backreferences. */
-                    if (is_chroma || is_iframe || !get_bits1(&ctx->gb)) {
-                        if ((ret = vlc_decode_block(ctx, num_coeffs,
-                                                    qscale)) < 0) {
-                            av_log(ctx->avctx, AV_LOG_ERROR, "Error decoding "
-                                   "block.\n");
-                            return ret;
-                        }
-                        ctx->dsp.idct_put(dst, stride, ctx->dct_block);
-                    } else {
-                        unsigned int backref = get_bits(&ctx->gb, 4);
-                        int index            = (ctx->cur_index + backref) & 15;
-                        uint8_t *p           = ctx->flipped_ptrs[index].data[0];
-
-                        if (index != ctx->cur_index && p) {
-                            ff_thread_await_progress(&ctx->frames[index],
-                                                     cur_row, 0);
-                            p += src -
-                                 ctx->flipped_ptrs[ctx->prev_index].data[plane];
-                            ctx->hdsp.put_pixels_tab[1][0](dst, p, stride, 8);
-                        } else {
-                            av_log(ctx->avctx, AV_LOG_ERROR,
-                                     "No such backreference! Buggy sample.\n");
-                        }
-                    }
-                } else {
-                    ff_thread_await_progress(&ctx->frames[ctx->prev_index],
-                                             cur_row, 0);
-                    ctx->hdsp.put_pixels_tab[1][0](dst, src, stride, 8);
-                }
-                src += 8;
-                dst += 8;
-            }
-            src += (stride - ctx->num_hblocks[plane]) << 3;
-            dst += (stride - ctx->num_hblocks[plane]) << 3;
-
-            ff_thread_report_progress(&ctx->frames[ctx->cur_index],
-                                      cur_row++, 0);
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Flip the buffer upside-down and put it in the YVU order to match the
- * way Mimic encodes frames.
- */
-static void prepare_avpic(MimicContext *ctx, AVPicture *dst, AVFrame *src)
-{
-    int i;
-    dst->data[0] = src->data[0] + ( ctx->avctx->height       - 1) * src->linesize[0];
-    dst->data[1] = src->data[2] + ((ctx->avctx->height >> 1) - 1) * src->linesize[2];
-    dst->data[2] = src->data[1] + ((ctx->avctx->height >> 1) - 1) * src->linesize[1];
-    for (i = 0; i < 3; i++)
-        dst->linesize[i] = -src->linesize[i];
-}
-
-static int mimic_decode_frame(AVCodecContext *avctx, void *data,
-                              int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    int swap_buf_size  = buf_size - MIMIC_HEADER_SIZE;
-    MimicContext *ctx  = avctx->priv_data;
-    GetByteContext gb;
-    int is_pframe;
-    int width, height;
-    int quality, num_coeffs;
-    int res;
-
-    if (buf_size <= MIMIC_HEADER_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "insufficient data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    bytestream2_init(&gb, buf, MIMIC_HEADER_SIZE);
-    bytestream2_skip(&gb, 2); /* some constant (always 256) */
-    quality    = bytestream2_get_le16u(&gb);
-    width      = bytestream2_get_le16u(&gb);
-    height     = bytestream2_get_le16u(&gb);
-    bytestream2_skip(&gb, 4); /* some constant */
-    is_pframe  = bytestream2_get_le32u(&gb);
-    num_coeffs = bytestream2_get_byteu(&gb);
-    bytestream2_skip(&gb, 3); /* some constant */
-
-    if (!ctx->avctx) {
-        int i;
-
-        if (!(width == 160 && height == 120) &&
-            !(width == 320 && height == 240)) {
-            av_log(avctx, AV_LOG_ERROR, "invalid width/height!\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        ctx->avctx     = avctx;
-        avctx->width   = width;
-        avctx->height  = height;
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-        for (i = 0; i < 3; i++) {
-            ctx->num_vblocks[i] = -((-height) >> (3 + !!i));
-            ctx->num_hblocks[i] =     width   >> (3 + !!i);
-        }
-    } else if (width != ctx->avctx->width || height != ctx->avctx->height) {
-        avpriv_request_sample(avctx, "Resolution changing");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (is_pframe && !ctx->frames[ctx->prev_index].f->data[0]) {
-        av_log(avctx, AV_LOG_ERROR, "decoding must start with keyframe\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ff_thread_release_buffer(avctx, &ctx->frames[ctx->cur_index]);
-    ctx->frames[ctx->cur_index].f->pict_type = is_pframe ? AV_PICTURE_TYPE_P :
-                                                           AV_PICTURE_TYPE_I;
-    if ((res = ff_thread_get_buffer(avctx, &ctx->frames[ctx->cur_index],
-                                    AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return res;
-    }
-
-    ctx->next_prev_index = ctx->cur_index;
-    ctx->next_cur_index  = (ctx->cur_index - 1) & 15;
-
-    prepare_avpic(ctx, &ctx->flipped_ptrs[ctx->cur_index],
-                  ctx->frames[ctx->cur_index].f);
-
-    ff_thread_finish_setup(avctx);
-
-    av_fast_padded_malloc(&ctx->swap_buf, &ctx->swap_buf_size, swap_buf_size);
-    if (!ctx->swap_buf)
-        return AVERROR(ENOMEM);
-
-    ctx->dsp.bswap_buf(ctx->swap_buf,
-                       (const uint32_t*) (buf + MIMIC_HEADER_SIZE),
-                       swap_buf_size >> 2);
-    init_get_bits(&ctx->gb, ctx->swap_buf, swap_buf_size << 3);
-
-    res = decode(ctx, quality, num_coeffs, !is_pframe);
-    ff_thread_report_progress(&ctx->frames[ctx->cur_index], INT_MAX, 0);
-    if (res < 0) {
-        if (!(avctx->active_thread_type & FF_THREAD_FRAME)) {
-            ff_thread_release_buffer(avctx, &ctx->frames[ctx->cur_index]);
-            return res;
-        }
-    }
-
-    if ((res = av_frame_ref(data, ctx->frames[ctx->cur_index].f)) < 0)
-        return res;
-    *got_frame      = 1;
-
-    ctx->prev_index = ctx->next_prev_index;
-    ctx->cur_index  = ctx->next_cur_index;
-
-    /* Only release frames that aren't used for backreferences anymore */
-    ff_thread_release_buffer(avctx, &ctx->frames[ctx->cur_index]);
-
-    return buf_size;
-}
-
-static av_cold int mimic_init_thread_copy(AVCodecContext *avctx)
-{
-    MimicContext *ctx = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(ctx->frames); i++) {
-        ctx->frames[i].f = av_frame_alloc();
-        if (!ctx->frames[i].f) {
-            mimic_decode_end(avctx);
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    return 0;
-}
-
-AVCodec ff_mimic_decoder = {
-    .name                  = "mimic",
-    .long_name             = NULL_IF_CONFIG_SMALL("Mimic"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_MIMIC,
-    .priv_data_size        = sizeof(MimicContext),
-    .init                  = mimic_decode_init,
-    .close                 = mimic_decode_end,
-    .decode                = mimic_decode_frame,
-    .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context),
-    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(mimic_init_thread_copy),
-};
diff --git a/deps/libav/libavcodec/mips/mathops.h b/deps/libav/libavcodec/mips/mathops.h
deleted file mode 100644
index dd80f68..0000000
--- a/deps/libav/libavcodec/mips/mathops.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MIPS_MATHOPS_H
-#define AVCODEC_MIPS_MATHOPS_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/common.h"
-
-#if HAVE_INLINE_ASM
-
-#if HAVE_LOONGSON
-
-static inline av_const int64_t MAC64(int64_t d, int a, int b)
-{
-    int64_t m;
-    __asm__ ("dmult.g %1, %2, %3 \n\t"
-             "daddu   %0, %0, %1 \n\t"
-             : "+r"(d), "=&r"(m) : "r"(a), "r"(b));
-    return d;
-}
-#define MAC64(d, a, b) ((d) = MAC64(d, a, b))
-
-static inline av_const int64_t MLS64(int64_t d, int a, int b)
-{
-    int64_t m;
-    __asm__ ("dmult.g %1, %2, %3 \n\t"
-             "dsubu   %0, %0, %1 \n\t"
-             : "+r"(d), "=&r"(m) : "r"(a), "r"(b));
-    return d;
-}
-#define MLS64(d, a, b) ((d) = MLS64(d, a, b))
-
-#elif ARCH_MIPS64
-
-static inline av_const int64_t MAC64(int64_t d, int a, int b)
-{
-    int64_t m;
-    __asm__ ("dmult %2, %3     \n\t"
-             "mflo  %1         \n\t"
-             "daddu %0, %0, %1 \n\t"
-             : "+r"(d), "=&r"(m) : "r"(a), "r"(b)
-             : "hi", "lo");
-    return d;
-}
-#define MAC64(d, a, b) ((d) = MAC64(d, a, b))
-
-static inline av_const int64_t MLS64(int64_t d, int a, int b)
-{
-    int64_t m;
-    __asm__ ("dmult %2, %3     \n\t"
-             "mflo  %1         \n\t"
-             "dsubu %0, %0, %1 \n\t"
-             : "+r"(d), "=&r"(m) : "r"(a), "r"(b)
-             : "hi", "lo");
-    return d;
-}
-#define MLS64(d, a, b) ((d) = MLS64(d, a, b))
-
-#endif
-
-#endif /* HAVE_INLINE_ASM */
-
-#endif /* AVCODEC_MIPS_MATHOPS_H */
diff --git a/deps/libav/libavcodec/mjpeg.c b/deps/libav/libavcodec/mjpeg.c
deleted file mode 100644
index a353851..0000000
--- a/deps/libav/libavcodec/mjpeg.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * MJPEG encoder and decoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003 Alex Beregszaszi
- * Copyright (c) 2003-2004 Michael Niedermayer
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- *                                  by Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MJPEG encoder and decoder.
- */
-
-#include "mjpeg.h"
-
-
-#if 0
-/* These are the sample quantization tables given in JPEG spec section K.1.
- * The spec says that the values given produce "good" quality, and
- * when divided by 2, "very good" quality.
- */
-const unsigned char std_luminance_quant_tbl[64] = {
-    16,  11,  10,  16,  24,  40,  51,  61,
-    12,  12,  14,  19,  26,  58,  60,  55,
-    14,  13,  16,  24,  40,  57,  69,  56,
-    14,  17,  22,  29,  51,  87,  80,  62,
-    18,  22,  37,  56,  68, 109, 103,  77,
-    24,  35,  55,  64,  81, 104, 113,  92,
-    49,  64,  78,  87, 103, 121, 120, 101,
-    72,  92,  95,  98, 112, 100, 103,  99
-};
-const unsigned char std_chrominance_quant_tbl[64] = {
-    17,  18,  24,  47,  99,  99,  99,  99,
-    18,  21,  26,  66,  99,  99,  99,  99,
-    24,  26,  56,  99,  99,  99,  99,  99,
-    47,  66,  99,  99,  99,  99,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99
-};
-#endif
-
-/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
-/* IMPORTANT: these are only valid for 8-bit data precision! */
-const uint8_t avpriv_mjpeg_bits_dc_luminance[17] =
-{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
-const uint8_t avpriv_mjpeg_val_dc[12] =
-{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-
-const uint8_t avpriv_mjpeg_bits_dc_chrominance[17] =
-{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
-
-const uint8_t avpriv_mjpeg_bits_ac_luminance[17] =
-{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
-const uint8_t avpriv_mjpeg_val_ac_luminance[] =
-{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
-  0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
-  0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
-  0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
-  0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
-  0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
-  0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
-  0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
-  0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
-  0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
-  0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
-  0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
-  0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
-  0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
-  0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
-  0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
-  0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
-  0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
-  0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
-  0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
-  0xf9, 0xfa
-};
-
-const uint8_t avpriv_mjpeg_bits_ac_chrominance[17] =
-{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
-
-const uint8_t avpriv_mjpeg_val_ac_chrominance[] =
-{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
-  0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
-  0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
-  0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
-  0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
-  0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
-  0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
-  0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
-  0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
-  0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
-  0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
-  0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-  0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
-  0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
-  0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
-  0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
-  0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
-  0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
-  0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
-  0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
-  0xf9, 0xfa
-};
-
-/* isn't this function nicer than the one in the libjpeg ? */
-void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
-                                  const uint8_t *bits_table,
-                                  const uint8_t *val_table)
-{
-    int i, j, k,nb, code, sym;
-
-    code = 0;
-    k = 0;
-    for(i=1;i<=16;i++) {
-        nb = bits_table[i];
-        for(j=0;j<nb;j++) {
-            sym = val_table[k++];
-            huff_size[sym] = i;
-            huff_code[sym] = code;
-            code++;
-        }
-        code <<= 1;
-    }
-}
diff --git a/deps/libav/libavcodec/mjpeg.h b/deps/libav/libavcodec/mjpeg.h
deleted file mode 100644
index a69b519..0000000
--- a/deps/libav/libavcodec/mjpeg.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * MJPEG encoder and decoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003 Alex Beregszaszi
- * Copyright (c) 2003-2004 Michael Niedermayer
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- *                                  by Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MJPEG encoder and decoder.
- */
-
-#ifndef AVCODEC_MJPEG_H
-#define AVCODEC_MJPEG_H
-
-#include "avcodec.h"
-#include "put_bits.h"
-
-
-/* JPEG marker codes */
-typedef enum {
-    /* start of frame */
-    SOF0  = 0xc0,       /* baseline */
-    SOF1  = 0xc1,       /* extended sequential, huffman */
-    SOF2  = 0xc2,       /* progressive, huffman */
-    SOF3  = 0xc3,       /* lossless, huffman */
-
-    SOF5  = 0xc5,       /* differential sequential, huffman */
-    SOF6  = 0xc6,       /* differential progressive, huffman */
-    SOF7  = 0xc7,       /* differential lossless, huffman */
-    JPG   = 0xc8,       /* reserved for JPEG extension */
-    SOF9  = 0xc9,       /* extended sequential, arithmetic */
-    SOF10 = 0xca,       /* progressive, arithmetic */
-    SOF11 = 0xcb,       /* lossless, arithmetic */
-
-    SOF13 = 0xcd,       /* differential sequential, arithmetic */
-    SOF14 = 0xce,       /* differential progressive, arithmetic */
-    SOF15 = 0xcf,       /* differential lossless, arithmetic */
-
-    DHT   = 0xc4,       /* define huffman tables */
-
-    DAC   = 0xcc,       /* define arithmetic-coding conditioning */
-
-    /* restart with modulo 8 count "m" */
-    RST0  = 0xd0,
-    RST1  = 0xd1,
-    RST2  = 0xd2,
-    RST3  = 0xd3,
-    RST4  = 0xd4,
-    RST5  = 0xd5,
-    RST6  = 0xd6,
-    RST7  = 0xd7,
-
-    SOI   = 0xd8,       /* start of image */
-    EOI   = 0xd9,       /* end of image */
-    SOS   = 0xda,       /* start of scan */
-    DQT   = 0xdb,       /* define quantization tables */
-    DNL   = 0xdc,       /* define number of lines */
-    DRI   = 0xdd,       /* define restart interval */
-    DHP   = 0xde,       /* define hierarchical progression */
-    EXP   = 0xdf,       /* expand reference components */
-
-    APP0  = 0xe0,
-    APP1  = 0xe1,
-    APP2  = 0xe2,
-    APP3  = 0xe3,
-    APP4  = 0xe4,
-    APP5  = 0xe5,
-    APP6  = 0xe6,
-    APP7  = 0xe7,
-    APP8  = 0xe8,
-    APP9  = 0xe9,
-    APP10 = 0xea,
-    APP11 = 0xeb,
-    APP12 = 0xec,
-    APP13 = 0xed,
-    APP14 = 0xee,
-    APP15 = 0xef,
-
-    JPG0  = 0xf0,
-    JPG1  = 0xf1,
-    JPG2  = 0xf2,
-    JPG3  = 0xf3,
-    JPG4  = 0xf4,
-    JPG5  = 0xf5,
-    JPG6  = 0xf6,
-    SOF48 = 0xf7,       ///< JPEG-LS
-    LSE   = 0xf8,       ///< JPEG-LS extension parameters
-    JPG9  = 0xf9,
-    JPG10 = 0xfa,
-    JPG11 = 0xfb,
-    JPG12 = 0xfc,
-    JPG13 = 0xfd,
-
-    COM   = 0xfe,       /* comment */
-
-    TEM   = 0x01,       /* temporary private use for arithmetic coding */
-
-    /* 0x02 -> 0xbf reserved */
-} JPEG_MARKER;
-
-static inline void put_marker(PutBitContext *p, int code)
-{
-    put_bits(p, 8, 0xff);
-    put_bits(p, 8, code);
-}
-
-#define PREDICT(ret, topleft, top, left, predictor)\
-    switch(predictor){\
-        case 1: ret= left; break;\
-        case 2: ret= top; break;\
-        case 3: ret= topleft; break;\
-        case 4: ret= left   +   top - topleft; break;\
-        case 5: ret= left   + ((top - topleft)>>1); break;\
-        case 6: ret= top + ((left   - topleft)>>1); break;\
-        default:\
-        case 7: ret= (left + top)>>1; break;\
-    }
-
-extern av_export const uint8_t avpriv_mjpeg_bits_dc_luminance[];
-extern av_export const uint8_t avpriv_mjpeg_val_dc[];
-
-extern av_export const uint8_t avpriv_mjpeg_bits_dc_chrominance[];
-
-extern av_export const uint8_t avpriv_mjpeg_bits_ac_luminance[];
-extern av_export const uint8_t avpriv_mjpeg_val_ac_luminance[];
-
-extern av_export const uint8_t avpriv_mjpeg_bits_ac_chrominance[];
-extern av_export const uint8_t avpriv_mjpeg_val_ac_chrominance[];
-
-void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
-                                  const uint8_t *bits_table,
-                                  const uint8_t *val_table);
-
-#endif /* AVCODEC_MJPEG_H */
diff --git a/deps/libav/libavcodec/mjpeg2jpeg_bsf.c b/deps/libav/libavcodec/mjpeg2jpeg_bsf.c
deleted file mode 100644
index ec36589..0000000
--- a/deps/libav/libavcodec/mjpeg2jpeg_bsf.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * MJPEG/AVI1 to JPEG/JFIF bitstream format filter
- * Copyright (c) 2010 Adrian Daerr and Nicolas George
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Adapted from mjpeg2jpeg.c, with original copyright:
- * Paris 2010 Adrian Daerr, public domain
- */
-
-#include <string.h>
-#include "avcodec.h"
-#include "mjpeg.h"
-
-static const uint8_t jpeg_header[] = {
-    0xff, 0xd8,                     // SOI
-    0xff, 0xe0,                     // APP0
-    0x00, 0x10,                     // APP0 header size (including
-                                    // this field, but excluding preceding)
-    0x4a, 0x46, 0x49, 0x46, 0x00,   // ID string 'JFIF\0'
-    0x01, 0x01,                     // version
-    0x00,                           // bits per type
-    0x00, 0x00,                     // X density
-    0x00, 0x00,                     // Y density
-    0x00,                           // X thumbnail size
-    0x00,                           // Y thumbnail size
-};
-
-static const int dht_segment_size = 420;
-static const uint8_t dht_segment_head[] = { 0xFF, 0xC4, 0x01, 0xA2, 0x00 };
-static const uint8_t dht_segment_frag[] = {
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
-    0x0a, 0x0b, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01,
-    0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static uint8_t *append(uint8_t *buf, const uint8_t *src, int size)
-{
-    memcpy(buf, src, size);
-    return buf + size;
-}
-
-static uint8_t *append_dht_segment(uint8_t *buf)
-{
-    buf = append(buf, dht_segment_head, sizeof(dht_segment_head));
-    buf = append(buf, avpriv_mjpeg_bits_dc_luminance + 1, 16);
-    buf = append(buf, dht_segment_frag, sizeof(dht_segment_frag));
-    buf = append(buf, avpriv_mjpeg_val_dc, 12);
-    *(buf++) = 0x10;
-    buf = append(buf, avpriv_mjpeg_bits_ac_luminance + 1, 16);
-    buf = append(buf, avpriv_mjpeg_val_ac_luminance, 162);
-    *(buf++) = 0x11;
-    buf = append(buf, avpriv_mjpeg_bits_ac_chrominance + 1, 16);
-    buf = append(buf, avpriv_mjpeg_val_ac_chrominance, 162);
-    return buf;
-}
-
-static int mjpeg2jpeg_filter(AVBitStreamFilterContext *bsfc,
-                             AVCodecContext *avctx, const char *args,
-                             uint8_t **poutbuf, int *poutbuf_size,
-                             const uint8_t *buf, int buf_size,
-                             int keyframe)
-{
-    int input_skip, output_size;
-    uint8_t *output, *out;
-
-    if (buf_size < 12) {
-        av_log(avctx, AV_LOG_ERROR, "input is truncated\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (memcmp("AVI1", buf + 6, 4)) {
-        av_log(avctx, AV_LOG_ERROR, "input is not MJPEG/AVI1\n");
-        return AVERROR_INVALIDDATA;
-    }
-    input_skip = (buf[4] << 8) + buf[5] + 4;
-    if (buf_size < input_skip) {
-        av_log(avctx, AV_LOG_ERROR, "input is truncated\n");
-        return AVERROR_INVALIDDATA;
-    }
-    output_size = buf_size - input_skip +
-                  sizeof(jpeg_header) + dht_segment_size;
-    output = out = av_malloc(output_size);
-    if (!output)
-        return AVERROR(ENOMEM);
-    out = append(out, jpeg_header, sizeof(jpeg_header));
-    out = append_dht_segment(out);
-    out = append(out, buf + input_skip, buf_size - input_skip);
-    *poutbuf = output;
-    *poutbuf_size = output_size;
-    return 1;
-}
-
-AVBitStreamFilter ff_mjpeg2jpeg_bsf = {
-    .name           = "mjpeg2jpeg",
-    .filter         = mjpeg2jpeg_filter,
-};
diff --git a/deps/libav/libavcodec/mjpeg_parser.c b/deps/libav/libavcodec/mjpeg_parser.c
deleted file mode 100644
index ab65461..0000000
--- a/deps/libav/libavcodec/mjpeg_parser.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * MJPEG parser
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003 Alex Beregszaszi
- * Copyright (c) 2003-2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MJPEG parser.
- */
-
-#include "parser.h"
-
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
-    int vop_found, i;
-    uint16_t state;
-
-    vop_found= pc->frame_start_found;
-    state= pc->state;
-
-    i=0;
-    if(!vop_found){
-        for(i=0; i<buf_size; i++){
-            state= (state<<8) | buf[i];
-            if(state == 0xFFD8){
-                i++;
-                vop_found=1;
-                break;
-            }
-        }
-    }
-
-    if(vop_found){
-        /* EOF considered as end of frame */
-        if (buf_size == 0)
-            return 0;
-        for(; i<buf_size; i++){
-            state= (state<<8) | buf[i];
-            if(state == 0xFFD8){
-                pc->frame_start_found=0;
-                pc->state=0;
-                return i-1;
-            }
-        }
-    }
-    pc->frame_start_found= vop_found;
-    pc->state= state;
-    return END_NOT_FOUND;
-}
-
-static int jpeg_parse(AVCodecParserContext *s,
-                      AVCodecContext *avctx,
-                      const uint8_t **poutbuf, int *poutbuf_size,
-                      const uint8_t *buf, int buf_size)
-{
-    ParseContext *pc = s->priv_data;
-    int next;
-
-    if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
-        next= buf_size;
-    }else{
-        next= find_frame_end(pc, buf, buf_size);
-
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-    }
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-
-AVCodecParser ff_mjpeg_parser = {
-    .codec_ids      = { AV_CODEC_ID_MJPEG },
-    .priv_data_size = sizeof(ParseContext),
-    .parser_parse   = jpeg_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/mjpega_dump_header_bsf.c b/deps/libav/libavcodec/mjpega_dump_header_bsf.c
deleted file mode 100644
index ed32d5a..0000000
--- a/deps/libav/libavcodec/mjpega_dump_header_bsf.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * MJPEG A dump header bitstream filter
- * Copyright (c) 2006 Baptiste Coudurier
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MJPEG A dump header bitstream filter
- * modifies bitstream to be decoded by quicktime
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "mjpeg.h"
-
-
-static int mjpega_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
-                              uint8_t **poutbuf, int *poutbuf_size,
-                              const uint8_t *buf, int buf_size, int keyframe)
-{
-    uint8_t *poutbufp;
-    unsigned dqt = 0, dht = 0, sof0 = 0;
-    int i;
-
-    if (avctx->codec_id != AV_CODEC_ID_MJPEG) {
-        av_log(avctx, AV_LOG_ERROR, "mjpega bitstream filter only applies to mjpeg codec\n");
-        return 0;
-    }
-
-    *poutbuf_size = 0;
-    *poutbuf = av_malloc(buf_size + 44 + FF_INPUT_BUFFER_PADDING_SIZE);
-    poutbufp = *poutbuf;
-    bytestream_put_byte(&poutbufp, 0xff);
-    bytestream_put_byte(&poutbufp, SOI);
-    bytestream_put_byte(&poutbufp, 0xff);
-    bytestream_put_byte(&poutbufp, APP1);
-    bytestream_put_be16(&poutbufp, 42); /* size */
-    bytestream_put_be32(&poutbufp, 0);
-    bytestream_put_buffer(&poutbufp, "mjpg", 4);
-    bytestream_put_be32(&poutbufp, buf_size + 44); /* field size */
-    bytestream_put_be32(&poutbufp, buf_size + 44); /* pad field size */
-    bytestream_put_be32(&poutbufp, 0);             /* next ptr */
-
-    for (i = 0; i < buf_size - 1; i++) {
-        if (buf[i] == 0xff) {
-            switch (buf[i + 1]) {
-            case DQT:  dqt  = i + 46; break;
-            case DHT:  dht  = i + 46; break;
-            case SOF0: sof0 = i + 46; break;
-            case SOS:
-                bytestream_put_be32(&poutbufp, dqt); /* quant off */
-                bytestream_put_be32(&poutbufp, dht); /* huff off */
-                bytestream_put_be32(&poutbufp, sof0); /* image off */
-                bytestream_put_be32(&poutbufp, i + 46); /* scan off */
-                bytestream_put_be32(&poutbufp, i + 46 + AV_RB16(buf + i + 2)); /* data off */
-                bytestream_put_buffer(&poutbufp, buf + 2, buf_size - 2); /* skip already written SOI */
-                *poutbuf_size = poutbufp - *poutbuf;
-                return 1;
-            case APP1:
-                if (i + 8 < buf_size && AV_RL32(buf + i + 8) == AV_RL32("mjpg")) {
-                    av_log(avctx, AV_LOG_ERROR, "bitstream already formatted\n");
-                    memcpy(*poutbuf, buf, buf_size);
-                    *poutbuf_size = buf_size;
-                    return 1;
-                }
-            }
-        }
-    }
-    av_freep(poutbuf);
-    av_log(avctx, AV_LOG_ERROR, "could not find SOS marker in bitstream\n");
-    return 0;
-}
-
-AVBitStreamFilter ff_mjpega_dump_header_bsf = {
-    "mjpegadump",
-    0,
-    mjpega_dump_header,
-};
diff --git a/deps/libav/libavcodec/mjpegbdec.c b/deps/libav/libavcodec/mjpegbdec.c
deleted file mode 100644
index a5f32a6..0000000
--- a/deps/libav/libavcodec/mjpegbdec.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Apple MJPEG-B decoder
- * Copyright (c) 2002 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Apple MJPEG-B decoder.
- */
-
-#include "avcodec.h"
-#include "mjpeg.h"
-#include "mjpegdec.h"
-
-static uint32_t read_offs(AVCodecContext *avctx, GetBitContext *gb, uint32_t size, const char *err_msg){
-    uint32_t offs= get_bits_long(gb, 32);
-    if(offs >= size){
-        av_log(avctx, AV_LOG_WARNING, err_msg, offs, size);
-        return 0;
-    }
-    return offs;
-}
-
-static int mjpegb_decode_frame(AVCodecContext *avctx,
-                              void *data, int *got_frame,
-                              AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MJpegDecodeContext *s = avctx->priv_data;
-    const uint8_t *buf_end, *buf_ptr;
-    GetBitContext hgb; /* for the header */
-    uint32_t dqt_offs, dht_offs, sof_offs, sos_offs, second_field_offs;
-    uint32_t field_size, sod_offs;
-    int ret;
-
-    buf_ptr = buf;
-    buf_end = buf + buf_size;
-
-read_header:
-    /* reset on every SOI */
-    s->restart_interval = 0;
-    s->restart_count = 0;
-    s->mjpb_skiptosod = 0;
-
-    if (buf_end - buf_ptr >= 1 << 28)
-        return AVERROR_INVALIDDATA;
-
-    init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8);
-
-    skip_bits(&hgb, 32); /* reserved zeros */
-
-    if (get_bits_long(&hgb, 32) != MKBETAG('m','j','p','g'))
-    {
-        av_log(avctx, AV_LOG_WARNING, "not mjpeg-b (bad fourcc)\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    field_size = get_bits_long(&hgb, 32); /* field size */
-    av_log(avctx, AV_LOG_DEBUG, "field size: 0x%x\n", field_size);
-    skip_bits(&hgb, 32); /* padded field size */
-    second_field_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "second_field_offs is %d and size is %d\n");
-    av_log(avctx, AV_LOG_DEBUG, "second field offs: 0x%x\n", second_field_offs);
-
-    dqt_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dqt is %d and size is %d\n");
-    av_log(avctx, AV_LOG_DEBUG, "dqt offs: 0x%x\n", dqt_offs);
-    if (dqt_offs)
-    {
-        init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - (buf_ptr+dqt_offs))*8);
-        s->start_code = DQT;
-        if (ff_mjpeg_decode_dqt(s) < 0 &&
-            (avctx->err_recognition & AV_EF_EXPLODE))
-          return AVERROR_INVALIDDATA;
-    }
-
-    dht_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dht is %d and size is %d\n");
-    av_log(avctx, AV_LOG_DEBUG, "dht offs: 0x%x\n", dht_offs);
-    if (dht_offs)
-    {
-        init_get_bits(&s->gb, buf_ptr+dht_offs, (buf_end - (buf_ptr+dht_offs))*8);
-        s->start_code = DHT;
-        ff_mjpeg_decode_dht(s);
-    }
-
-    sof_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sof is %d and size is %d\n");
-    av_log(avctx, AV_LOG_DEBUG, "sof offs: 0x%x\n", sof_offs);
-    if (sof_offs)
-    {
-        init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - (buf_ptr+sof_offs))*8);
-        s->start_code = SOF0;
-        if (ff_mjpeg_decode_sof(s) < 0)
-            return -1;
-    }
-
-    sos_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sos is %d and size is %d\n");
-    av_log(avctx, AV_LOG_DEBUG, "sos offs: 0x%x\n", sos_offs);
-    sod_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sof is %d and size is %d\n");
-    av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%x\n", sod_offs);
-    if (sos_offs)
-    {
-        init_get_bits(&s->gb, buf_ptr + sos_offs,
-                      8 * FFMIN(field_size, buf_end - buf_ptr - sos_offs));
-        s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
-        s->start_code = SOS;
-        if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 &&
-            (avctx->err_recognition & AV_EF_EXPLODE))
-          return AVERROR_INVALIDDATA;
-    }
-
-    if (s->interlaced) {
-        s->bottom_field ^= 1;
-        /* if not bottom field, do not output image yet */
-        if (s->bottom_field != s->interlace_polarity && second_field_offs)
-        {
-            buf_ptr = buf + second_field_offs;
-            second_field_offs = 0;
-            goto read_header;
-            }
-    }
-
-    //XXX FIXME factorize, this looks very similar to the EOI code
-
-    if ((ret = av_frame_ref(data, s->picture_ptr)) < 0)
-        return ret;
-    *got_frame = 1;
-
-    if (!s->lossless && avctx->debug & FF_DEBUG_QP) {
-        av_log(avctx, AV_LOG_DEBUG, "QP: %d\n",
-               FFMAX3(s->qscale[0], s->qscale[1], s->qscale[2]));
-    }
-
-    return buf_size;
-}
-
-AVCodec ff_mjpegb_decoder = {
-    .name           = "mjpegb",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple MJPEG-B"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MJPEGB,
-    .priv_data_size = sizeof(MJpegDecodeContext),
-    .init           = ff_mjpeg_decode_init,
-    .close          = ff_mjpeg_decode_end,
-    .decode         = mjpegb_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/mjpegdec.c b/deps/libav/libavcodec/mjpegdec.c
deleted file mode 100644
index 8210fd3..0000000
--- a/deps/libav/libavcodec/mjpegdec.c
+++ /dev/null
@@ -1,1719 +0,0 @@
-/*
- * MJPEG decoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003 Alex Beregszaszi
- * Copyright (c) 2003-2004 Michael Niedermayer
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- *                                  by Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MJPEG decoder.
- */
-
-#include <assert.h>
-
-#include "libavutil/imgutils.h"
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "mjpeg.h"
-#include "mjpegdec.h"
-#include "jpeglsdec.h"
-
-
-static int build_vlc(VLC *vlc, const uint8_t *bits_table,
-                     const uint8_t *val_table, int nb_codes,
-                     int use_static, int is_ac)
-{
-    uint8_t huff_size[256] = { 0 };
-    uint16_t huff_code[256];
-    uint16_t huff_sym[256];
-    int i;
-
-    assert(nb_codes <= 256);
-
-    ff_mjpeg_build_huffman_codes(huff_size, huff_code, bits_table, val_table);
-
-    for (i = 0; i < 256; i++)
-        huff_sym[i] = i + 16 * is_ac;
-
-    if (is_ac)
-        huff_sym[0] = 16 * 256;
-
-    return ff_init_vlc_sparse(vlc, 9, nb_codes, huff_size, 1, 1,
-                              huff_code, 2, 2, huff_sym, 2, 2, use_static);
-}
-
-static void build_basic_mjpeg_vlc(MJpegDecodeContext *s)
-{
-    build_vlc(&s->vlcs[0][0], avpriv_mjpeg_bits_dc_luminance,
-              avpriv_mjpeg_val_dc, 12, 0, 0);
-    build_vlc(&s->vlcs[0][1], avpriv_mjpeg_bits_dc_chrominance,
-              avpriv_mjpeg_val_dc, 12, 0, 0);
-    build_vlc(&s->vlcs[1][0], avpriv_mjpeg_bits_ac_luminance,
-              avpriv_mjpeg_val_ac_luminance, 251, 0, 1);
-    build_vlc(&s->vlcs[1][1], avpriv_mjpeg_bits_ac_chrominance,
-              avpriv_mjpeg_val_ac_chrominance, 251, 0, 1);
-    build_vlc(&s->vlcs[2][0], avpriv_mjpeg_bits_ac_luminance,
-              avpriv_mjpeg_val_ac_luminance, 251, 0, 0);
-    build_vlc(&s->vlcs[2][1], avpriv_mjpeg_bits_ac_chrominance,
-              avpriv_mjpeg_val_ac_chrominance, 251, 0, 0);
-}
-
-av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
-{
-    MJpegDecodeContext *s = avctx->priv_data;
-
-    if (!s->picture_ptr) {
-        s->picture = av_frame_alloc();
-        if (!s->picture)
-            return AVERROR(ENOMEM);
-        s->picture_ptr = s->picture;
-    }
-
-    s->avctx = avctx;
-    ff_hpeldsp_init(&s->hdsp, avctx->flags);
-    ff_dsputil_init(&s->dsp, avctx);
-    ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
-    s->buffer_size   = 0;
-    s->buffer        = NULL;
-    s->start_code    = -1;
-    s->first_picture = 1;
-    s->org_height    = avctx->coded_height;
-    avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
-
-    build_basic_mjpeg_vlc(s);
-
-    if (s->extern_huff) {
-        int ret;
-        av_log(avctx, AV_LOG_INFO, "mjpeg: using external huffman table\n");
-        init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size * 8);
-        if ((ret = ff_mjpeg_decode_dht(s))) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "mjpeg: error using external huffman table\n");
-            return ret;
-        }
-    }
-    if (avctx->field_order == AV_FIELD_BB) { /* quicktime icefloe 019 */
-        s->interlace_polarity = 1;           /* bottom field first */
-        av_log(avctx, AV_LOG_DEBUG, "mjpeg bottom field first\n");
-    }
-    if (avctx->codec->id == AV_CODEC_ID_AMV)
-        s->flipped = 1;
-
-    return 0;
-}
-
-
-/* quantize tables */
-int ff_mjpeg_decode_dqt(MJpegDecodeContext *s)
-{
-    int len, index, i, j;
-
-    len = get_bits(&s->gb, 16) - 2;
-
-    while (len >= 65) {
-        /* only 8 bit precision handled */
-        if (get_bits(&s->gb, 4) != 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "dqt: 16bit precision\n");
-            return -1;
-        }
-        index = get_bits(&s->gb, 4);
-        if (index >= 4)
-            return -1;
-        av_log(s->avctx, AV_LOG_DEBUG, "index=%d\n", index);
-        /* read quant table */
-        for (i = 0; i < 64; i++) {
-            j = s->scantable.permutated[i];
-            s->quant_matrixes[index][j] = get_bits(&s->gb, 8);
-        }
-
-        // XXX FIXME finetune, and perhaps add dc too
-        s->qscale[index] = FFMAX(s->quant_matrixes[index][s->scantable.permutated[1]],
-                                 s->quant_matrixes[index][s->scantable.permutated[8]]) >> 1;
-        av_log(s->avctx, AV_LOG_DEBUG, "qscale[%d]: %d\n",
-               index, s->qscale[index]);
-        len -= 65;
-    }
-    return 0;
-}
-
-/* decode huffman tables and build VLC decoders */
-int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
-{
-    int len, index, i, class, n, v, code_max;
-    uint8_t bits_table[17];
-    uint8_t val_table[256];
-    int ret = 0;
-
-    len = get_bits(&s->gb, 16) - 2;
-
-    while (len > 0) {
-        if (len < 17)
-            return AVERROR_INVALIDDATA;
-        class = get_bits(&s->gb, 4);
-        if (class >= 2)
-            return AVERROR_INVALIDDATA;
-        index = get_bits(&s->gb, 4);
-        if (index >= 4)
-            return AVERROR_INVALIDDATA;
-        n = 0;
-        for (i = 1; i <= 16; i++) {
-            bits_table[i] = get_bits(&s->gb, 8);
-            n += bits_table[i];
-        }
-        len -= 17;
-        if (len < n || n > 256)
-            return AVERROR_INVALIDDATA;
-
-        code_max = 0;
-        for (i = 0; i < n; i++) {
-            v = get_bits(&s->gb, 8);
-            if (v > code_max)
-                code_max = v;
-            val_table[i] = v;
-        }
-        len -= n;
-
-        /* build VLC and flush previous vlc if present */
-        ff_free_vlc(&s->vlcs[class][index]);
-        av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n",
-               class, index, code_max + 1);
-        if ((ret = build_vlc(&s->vlcs[class][index], bits_table, val_table,
-                             code_max + 1, 0, class > 0)) < 0)
-            return ret;
-
-        if (class > 0) {
-            ff_free_vlc(&s->vlcs[2][index]);
-            if ((ret = build_vlc(&s->vlcs[2][index], bits_table, val_table,
-                                 code_max + 1, 0, 0)) < 0)
-                return ret;
-        }
-    }
-    return 0;
-}
-
-int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
-{
-    int len, nb_components, i, width, height, pix_fmt_id, ret;
-
-    /* XXX: verify len field validity */
-    len     = get_bits(&s->gb, 16);
-    s->bits = get_bits(&s->gb, 8);
-
-    if (s->pegasus_rct)
-        s->bits = 9;
-    if (s->bits == 9 && !s->pegasus_rct)
-        s->rct  = 1;    // FIXME ugly
-
-    if (s->bits != 8 && !s->lossless) {
-        av_log(s->avctx, AV_LOG_ERROR, "only 8 bits/component accepted\n");
-        return -1;
-    }
-
-    height = get_bits(&s->gb, 16);
-    width  = get_bits(&s->gb, 16);
-
-    // HACK for odd_height.mov
-    if (s->interlaced && s->width == width && s->height == height + 1)
-        height= s->height;
-
-    av_log(s->avctx, AV_LOG_DEBUG, "sof0: picture: %dx%d\n", width, height);
-    if (av_image_check_size(width, height, 0, s->avctx))
-        return AVERROR_INVALIDDATA;
-
-    nb_components = get_bits(&s->gb, 8);
-    if (nb_components <= 0 ||
-        nb_components > MAX_COMPONENTS)
-        return -1;
-    if (s->interlaced && (s->bottom_field == !s->interlace_polarity)) {
-        if (nb_components != s->nb_components) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "nb_components changing in interlaced picture\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    if (s->ls && !(s->bits <= 8 || nb_components == 1)) {
-        avpriv_report_missing_feature(s->avctx,
-                                      "JPEG-LS that is not <= 8 "
-                                      "bits/component or 16-bit gray");
-        return AVERROR_PATCHWELCOME;
-    }
-    s->nb_components = nb_components;
-    s->h_max         = 1;
-    s->v_max         = 1;
-    for (i = 0; i < nb_components; i++) {
-        /* component id */
-        s->component_id[i] = get_bits(&s->gb, 8) - 1;
-        s->h_count[i]      = get_bits(&s->gb, 4);
-        s->v_count[i]      = get_bits(&s->gb, 4);
-        /* compute hmax and vmax (only used in interleaved case) */
-        if (s->h_count[i] > s->h_max)
-            s->h_max = s->h_count[i];
-        if (s->v_count[i] > s->v_max)
-            s->v_max = s->v_count[i];
-        s->quant_index[i] = get_bits(&s->gb, 8);
-        if (s->quant_index[i] >= 4)
-            return AVERROR_INVALIDDATA;
-        if (!s->h_count[i] || !s->v_count[i]) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Invalid sampling factor in component %d %d:%d\n",
-                   i, s->h_count[i], s->v_count[i]);
-            return AVERROR_INVALIDDATA;
-        }
-
-        av_log(s->avctx, AV_LOG_DEBUG, "component %d %d:%d id: %d quant:%d\n",
-               i, s->h_count[i], s->v_count[i],
-               s->component_id[i], s->quant_index[i]);
-    }
-
-    if (s->ls && (s->h_max > 1 || s->v_max > 1)) {
-        avpriv_report_missing_feature(s->avctx, "Subsampling in JPEG-LS");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (s->v_max == 1 && s->h_max == 1 && s->lossless == 1)
-        s->rgb = 1;
-
-    /* if different size, realloc/alloc picture */
-    /* XXX: also check h_count and v_count */
-    if (width != s->width || height != s->height) {
-        s->width      = width;
-        s->height     = height;
-        s->interlaced = 0;
-
-        /* test interlaced mode */
-        if (s->first_picture   &&
-            s->org_height != 0 &&
-            s->height < ((s->org_height * 3) / 4)) {
-            s->interlaced                    = 1;
-            s->bottom_field                  = s->interlace_polarity;
-            s->picture_ptr->interlaced_frame = 1;
-            s->picture_ptr->top_field_first  = !s->interlace_polarity;
-            height *= 2;
-        }
-
-        ret = ff_set_dimensions(s->avctx, width, height);
-        if (ret < 0)
-            return ret;
-
-        s->first_picture = 0;
-    }
-
-    if (!(s->interlaced && (s->bottom_field == !s->interlace_polarity))) {
-    /* XXX: not complete test ! */
-    pix_fmt_id = (s->h_count[0] << 28) | (s->v_count[0] << 24) |
-                 (s->h_count[1] << 20) | (s->v_count[1] << 16) |
-                 (s->h_count[2] << 12) | (s->v_count[2] <<  8) |
-                 (s->h_count[3] <<  4) |  s->v_count[3];
-    av_log(s->avctx, AV_LOG_DEBUG, "pix fmt id %x\n", pix_fmt_id);
-    /* NOTE we do not allocate pictures large enough for the possible
-     * padding of h/v_count being 4 */
-    if (!(pix_fmt_id & 0xD0D0D0D0))
-        pix_fmt_id -= (pix_fmt_id & 0xF0F0F0F0) >> 1;
-    if (!(pix_fmt_id & 0x0D0D0D0D))
-        pix_fmt_id -= (pix_fmt_id & 0x0F0F0F0F) >> 1;
-
-    switch (pix_fmt_id) {
-    case 0x11111100:
-        if (s->rgb)
-            s->avctx->pix_fmt = AV_PIX_FMT_BGRA;
-        else
-            s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
-        assert(s->nb_components == 3);
-        break;
-    case 0x11000000:
-        s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-        break;
-    case 0x12111100:
-        s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
-        break;
-    case 0x21111100:
-        s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
-        break;
-    case 0x22111100:
-        s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
-        break;
-    default:
-        av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id);
-        return AVERROR_PATCHWELCOME;
-    }
-    if (s->ls) {
-        if (s->nb_components > 1)
-            s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
-        else if (s->bits <= 8)
-            s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-        else
-            s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
-    }
-
-    s->pix_desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
-    if (!s->pix_desc) {
-        av_log(s->avctx, AV_LOG_ERROR, "Could not get a pixel format descriptor.\n");
-        return AVERROR_BUG;
-    }
-
-    av_frame_unref(s->picture_ptr);
-    if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
-    s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
-    s->picture_ptr->key_frame = 1;
-    s->got_picture            = 1;
-
-    for (i = 0; i < 3; i++)
-        s->linesize[i] = s->picture_ptr->linesize[i] << s->interlaced;
-
-    av_dlog(s->avctx, "%d %d %d %d %d %d\n",
-            s->width, s->height, s->linesize[0], s->linesize[1],
-            s->interlaced, s->avctx->height);
-
-    if (len != (8 + (3 * nb_components)))
-        av_log(s->avctx, AV_LOG_DEBUG, "decode_sof0: error, len(%d) mismatch\n", len);
-    }
-
-    /* totally blank picture as progressive JPEG will only add details to it */
-    if (s->progressive) {
-        int bw = (width  + s->h_max * 8 - 1) / (s->h_max * 8);
-        int bh = (height + s->v_max * 8 - 1) / (s->v_max * 8);
-        for (i = 0; i < s->nb_components; i++) {
-            int size = bw * bh * s->h_count[i] * s->v_count[i];
-            av_freep(&s->blocks[i]);
-            av_freep(&s->last_nnz[i]);
-            s->blocks[i]       = av_malloc(size * sizeof(**s->blocks));
-            s->last_nnz[i]     = av_mallocz(size * sizeof(**s->last_nnz));
-            s->block_stride[i] = bw * s->h_count[i];
-        }
-        memset(s->coefs_finished, 0, sizeof(s->coefs_finished));
-    }
-    return 0;
-}
-
-static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index)
-{
-    int code;
-    code = get_vlc2(&s->gb, s->vlcs[0][dc_index].table, 9, 2);
-    if (code < 0) {
-        av_log(s->avctx, AV_LOG_WARNING,
-               "mjpeg_decode_dc: bad vlc: %d:%d (%p)\n",
-               0, dc_index, &s->vlcs[0][dc_index]);
-        return 0xffff;
-    }
-
-    if (code)
-        return get_xbits(&s->gb, code);
-    else
-        return 0;
-}
-
-/* decode block and dequantize */
-static int decode_block(MJpegDecodeContext *s, int16_t *block, int component,
-                        int dc_index, int ac_index, int16_t *quant_matrix)
-{
-    int code, i, j, level, val;
-
-    /* DC coef */
-    val = mjpeg_decode_dc(s, dc_index);
-    if (val == 0xffff) {
-        av_log(s->avctx, AV_LOG_ERROR, "error dc\n");
-        return AVERROR_INVALIDDATA;
-    }
-    val = val * quant_matrix[0] + s->last_dc[component];
-    s->last_dc[component] = val;
-    block[0] = val;
-    /* AC coefs */
-    i = 0;
-    {OPEN_READER(re, &s->gb);
-    do {
-        UPDATE_CACHE(re, &s->gb);
-        GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2);
-
-        i += ((unsigned)code) >> 4;
-            code &= 0xf;
-        if (code) {
-            if (code > MIN_CACHE_BITS - 16)
-                UPDATE_CACHE(re, &s->gb);
-
-            {
-                int cache = GET_CACHE(re, &s->gb);
-                int sign  = (~cache) >> 31;
-                level     = (NEG_USR32(sign ^ cache,code) ^ sign) - sign;
-            }
-
-            LAST_SKIP_BITS(re, &s->gb, code);
-
-            if (i > 63) {
-                av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i);
-                return AVERROR_INVALIDDATA;
-            }
-            j        = s->scantable.permutated[i];
-            block[j] = level * quant_matrix[j];
-        }
-    } while (i < 63);
-    CLOSE_READER(re, &s->gb);}
-
-    return 0;
-}
-
-static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block,
-                                 int component, int dc_index,
-                                 int16_t *quant_matrix, int Al)
-{
-    int val;
-    s->dsp.clear_block(block);
-    val = mjpeg_decode_dc(s, dc_index);
-    if (val == 0xffff) {
-        av_log(s->avctx, AV_LOG_ERROR, "error dc\n");
-        return AVERROR_INVALIDDATA;
-    }
-    val = (val * quant_matrix[0] << Al) + s->last_dc[component];
-    s->last_dc[component] = val;
-    block[0] = val;
-    return 0;
-}
-
-/* decode block and dequantize - progressive JPEG version */
-static int decode_block_progressive(MJpegDecodeContext *s, int16_t *block,
-                                    uint8_t *last_nnz, int ac_index,
-                                    int16_t *quant_matrix,
-                                    int ss, int se, int Al, int *EOBRUN)
-{
-    int code, i, j, level, val, run;
-
-    if (*EOBRUN) {
-        (*EOBRUN)--;
-        return 0;
-    }
-
-    {
-        OPEN_READER(re, &s->gb);
-        for (i = ss; ; i++) {
-            UPDATE_CACHE(re, &s->gb);
-            GET_VLC(code, re, &s->gb, s->vlcs[2][ac_index].table, 9, 2);
-
-            run = ((unsigned) code) >> 4;
-            code &= 0xF;
-            if (code) {
-                i += run;
-                if (code > MIN_CACHE_BITS - 16)
-                    UPDATE_CACHE(re, &s->gb);
-
-                {
-                    int cache = GET_CACHE(re, &s->gb);
-                    int sign  = (~cache) >> 31;
-                    level     = (NEG_USR32(sign ^ cache,code) ^ sign) - sign;
-                }
-
-                LAST_SKIP_BITS(re, &s->gb, code);
-
-                if (i >= se) {
-                    if (i == se) {
-                        j = s->scantable.permutated[se];
-                        block[j] = level * quant_matrix[j] << Al;
-                        break;
-                    }
-                    av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i);
-                    return AVERROR_INVALIDDATA;
-                }
-                j = s->scantable.permutated[i];
-                block[j] = level * quant_matrix[j] << Al;
-            } else {
-                if (run == 0xF) {// ZRL - skip 15 coefficients
-                    i += 15;
-                    if (i >= se) {
-                        av_log(s->avctx, AV_LOG_ERROR, "ZRL overflow: %d\n", i);
-                        return AVERROR_INVALIDDATA;
-                    }
-                } else {
-                    val = (1 << run);
-                    if (run) {
-                        UPDATE_CACHE(re, &s->gb);
-                        val += NEG_USR32(GET_CACHE(re, &s->gb), run);
-                        LAST_SKIP_BITS(re, &s->gb, run);
-                    }
-                    *EOBRUN = val - 1;
-                    break;
-                }
-            }
-        }
-        CLOSE_READER(re, &s->gb);
-    }
-
-    if (i > *last_nnz)
-        *last_nnz = i;
-
-    return 0;
-}
-
-#define REFINE_BIT(j) {                                             \
-    UPDATE_CACHE(re, &s->gb);                                       \
-    sign = block[j] >> 15;                                          \
-    block[j] += SHOW_UBITS(re, &s->gb, 1) *                         \
-                ((quant_matrix[j] ^ sign) - sign) << Al;            \
-    LAST_SKIP_BITS(re, &s->gb, 1);                                  \
-}
-
-#define ZERO_RUN                                                    \
-for (; ; i++) {                                                     \
-    if (i > last) {                                                 \
-        i += run;                                                   \
-        if (i > se) {                                               \
-            av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i); \
-            return -1;                                              \
-        }                                                           \
-        break;                                                      \
-    }                                                               \
-    j = s->scantable.permutated[i];                                 \
-    if (block[j])                                                   \
-        REFINE_BIT(j)                                               \
-    else if (run-- == 0)                                            \
-        break;                                                      \
-}
-
-/* decode block and dequantize - progressive JPEG refinement pass */
-static int decode_block_refinement(MJpegDecodeContext *s, int16_t *block,
-                                   uint8_t *last_nnz,
-                                   int ac_index, int16_t *quant_matrix,
-                                   int ss, int se, int Al, int *EOBRUN)
-{
-    int code, i = ss, j, sign, val, run;
-    int last    = FFMIN(se, *last_nnz);
-
-    OPEN_READER(re, &s->gb);
-    if (*EOBRUN) {
-        (*EOBRUN)--;
-    } else {
-        for (; ; i++) {
-            UPDATE_CACHE(re, &s->gb);
-            GET_VLC(code, re, &s->gb, s->vlcs[2][ac_index].table, 9, 2);
-
-            if (code & 0xF) {
-                run = ((unsigned) code) >> 4;
-                UPDATE_CACHE(re, &s->gb);
-                val = SHOW_UBITS(re, &s->gb, 1);
-                LAST_SKIP_BITS(re, &s->gb, 1);
-                ZERO_RUN;
-                j = s->scantable.permutated[i];
-                val--;
-                block[j] = ((quant_matrix[j]^val) - val) << Al;
-                if (i == se) {
-                    if (i > *last_nnz)
-                        *last_nnz = i;
-                    CLOSE_READER(re, &s->gb);
-                    return 0;
-                }
-            } else {
-                run = ((unsigned) code) >> 4;
-                if (run == 0xF) {
-                    ZERO_RUN;
-                } else {
-                    val = run;
-                    run = (1 << run);
-                    if (val) {
-                        UPDATE_CACHE(re, &s->gb);
-                        run += SHOW_UBITS(re, &s->gb, val);
-                        LAST_SKIP_BITS(re, &s->gb, val);
-                    }
-                    *EOBRUN = run - 1;
-                    break;
-                }
-            }
-        }
-
-        if (i > *last_nnz)
-            *last_nnz = i;
-    }
-
-    for (; i <= last; i++) {
-        j = s->scantable.permutated[i];
-        if (block[j])
-            REFINE_BIT(j)
-    }
-    CLOSE_READER(re, &s->gb);
-
-    return 0;
-}
-#undef REFINE_BIT
-#undef ZERO_RUN
-
-static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor,
-                                 int point_transform)
-{
-    int i, mb_x, mb_y;
-    uint16_t (*buffer)[4];
-    int left[3], top[3], topleft[3];
-    const int linesize = s->linesize[0];
-    const int mask     = (1 << s->bits) - 1;
-
-    av_fast_malloc(&s->ljpeg_buffer, &s->ljpeg_buffer_size,
-                   (unsigned)s->mb_width * 4 * sizeof(s->ljpeg_buffer[0][0]));
-    buffer = s->ljpeg_buffer;
-
-    for (i = 0; i < 3; i++)
-        buffer[0][i] = 1 << (s->bits + point_transform - 1);
-
-    for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-        const int modified_predictor = mb_y ? predictor : 1;
-        uint8_t *ptr = s->picture_ptr->data[0] + (linesize * mb_y);
-
-        if (s->interlaced && s->bottom_field)
-            ptr += linesize >> 1;
-
-        for (i = 0; i < 3; i++)
-            top[i] = left[i] = topleft[i] = buffer[0][i];
-
-        for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-            if (s->restart_interval && !s->restart_count)
-                s->restart_count = s->restart_interval;
-
-            for (i = 0; i < 3; i++) {
-                int pred;
-
-                topleft[i] = top[i];
-                top[i]     = buffer[mb_x][i];
-
-                PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
-
-                left[i] = buffer[mb_x][i] =
-                    mask & (pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform));
-            }
-
-            if (s->restart_interval && !--s->restart_count) {
-                align_get_bits(&s->gb);
-                skip_bits(&s->gb, 16); /* skip RSTn */
-            }
-        }
-
-        if (s->rct) {
-            for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-                ptr[4 * mb_x + 1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200) >> 2);
-                ptr[4 * mb_x + 0] = buffer[mb_x][1] + ptr[4 * mb_x + 1];
-                ptr[4 * mb_x + 2] = buffer[mb_x][2] + ptr[4 * mb_x + 1];
-            }
-        } else if (s->pegasus_rct) {
-            for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-                ptr[4 * mb_x + 1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2]) >> 2);
-                ptr[4 * mb_x + 0] = buffer[mb_x][1] + ptr[4 * mb_x + 1];
-                ptr[4 * mb_x + 2] = buffer[mb_x][2] + ptr[4 * mb_x + 1];
-            }
-        } else {
-            for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-                ptr[4 * mb_x + 0] = buffer[mb_x][2];
-                ptr[4 * mb_x + 1] = buffer[mb_x][1];
-                ptr[4 * mb_x + 2] = buffer[mb_x][0];
-            }
-        }
-    }
-    return 0;
-}
-
-static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
-                                 int point_transform, int nb_components)
-{
-    int i, mb_x, mb_y;
-
-    for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-        for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-            if (s->restart_interval && !s->restart_count)
-                s->restart_count = s->restart_interval;
-
-            if (mb_x == 0 || mb_y == 0 || s->interlaced) {
-                for (i = 0; i < nb_components; i++) {
-                    uint8_t *ptr;
-                    int n, h, v, x, y, c, j, linesize;
-                    n        = s->nb_blocks[i];
-                    c        = s->comp_index[i];
-                    h        = s->h_scount[i];
-                    v        = s->v_scount[i];
-                    x        = 0;
-                    y        = 0;
-                    linesize = s->linesize[c];
-
-                    for (j = 0; j < n; j++) {
-                        int pred;
-                        // FIXME optimize this crap
-                        ptr = s->picture_ptr->data[c] +
-                              (linesize * (v * mb_y + y)) +
-                              (h * mb_x + x);
-                        if (y == 0 && mb_y == 0) {
-                            if (x == 0 && mb_x == 0)
-                                pred = 128 << point_transform;
-                            else
-                                pred = ptr[-1];
-                        } else {
-                            if (x == 0 && mb_x == 0)
-                                pred = ptr[-linesize];
-                            else
-                                PREDICT(pred, ptr[-linesize - 1],
-                                        ptr[-linesize], ptr[-1], predictor);
-                       }
-
-                        if (s->interlaced && s->bottom_field)
-                            ptr += linesize >> 1;
-                        *ptr = pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform);
-
-                        if (++x == h) {
-                            x = 0;
-                            y++;
-                        }
-                    }
-                }
-            } else {
-                for (i = 0; i < nb_components; i++) {
-                    uint8_t *ptr;
-                    int n, h, v, x, y, c, j, linesize;
-                    n        = s->nb_blocks[i];
-                    c        = s->comp_index[i];
-                    h        = s->h_scount[i];
-                    v        = s->v_scount[i];
-                    x        = 0;
-                    y        = 0;
-                    linesize = s->linesize[c];
-
-                    for (j = 0; j < n; j++) {
-                        int pred;
-
-                        // FIXME optimize this crap
-                        ptr = s->picture_ptr->data[c] +
-                              (linesize * (v * mb_y + y)) +
-                              (h * mb_x + x);
-                        PREDICT(pred, ptr[-linesize - 1],
-                                ptr[-linesize], ptr[-1], predictor);
-                        *ptr = pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform);
-                        if (++x == h) {
-                            x = 0;
-                            y++;
-                        }
-                    }
-                }
-            }
-            if (s->restart_interval && !--s->restart_count) {
-                align_get_bits(&s->gb);
-                skip_bits(&s->gb, 16); /* skip RSTn */
-            }
-        }
-    }
-    return 0;
-}
-
-static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
-                             int Al, const uint8_t *mb_bitmask,
-                             const AVFrame *reference)
-{
-    int i, mb_x, mb_y;
-    uint8_t *data[MAX_COMPONENTS];
-    const uint8_t *reference_data[MAX_COMPONENTS];
-    int linesize[MAX_COMPONENTS];
-    GetBitContext mb_bitmask_gb;
-
-    if (mb_bitmask)
-        init_get_bits(&mb_bitmask_gb, mb_bitmask, s->mb_width * s->mb_height);
-
-    for (i = 0; i < nb_components; i++) {
-        int c   = s->comp_index[i];
-        data[c] = s->picture_ptr->data[c];
-        reference_data[c] = reference ? reference->data[c] : NULL;
-        linesize[c] = s->linesize[c];
-        s->coefs_finished[c] |= 1;
-    }
-
-    for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-        for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
-            const int copy_mb = mb_bitmask && !get_bits1(&mb_bitmask_gb);
-
-            if (s->restart_interval && !s->restart_count)
-                s->restart_count = s->restart_interval;
-
-            if (get_bits_left(&s->gb) < 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "overread %d\n",
-                       -get_bits_left(&s->gb));
-                return AVERROR_INVALIDDATA;
-            }
-            for (i = 0; i < nb_components; i++) {
-                uint8_t *ptr;
-                int n, h, v, x, y, c, j;
-                int block_offset;
-                n = s->nb_blocks[i];
-                c = s->comp_index[i];
-                h = s->h_scount[i];
-                v = s->v_scount[i];
-                x = 0;
-                y = 0;
-                for (j = 0; j < n; j++) {
-                    block_offset = ((linesize[c] * (v * mb_y + y) * 8) +
-                                    (h * mb_x + x) * 8);
-
-                    if (s->interlaced && s->bottom_field)
-                        block_offset += linesize[c] >> 1;
-                    ptr = data[c] + block_offset;
-                    if (!s->progressive) {
-                        if (copy_mb)
-                            s->hdsp.put_pixels_tab[1][0](ptr,
-                                reference_data[c] + block_offset,
-                                linesize[c], 8);
-                        else {
-                            s->dsp.clear_block(s->block);
-                            if (decode_block(s, s->block, i,
-                                             s->dc_index[i], s->ac_index[i],
-                                             s->quant_matrixes[s->quant_index[c]]) < 0) {
-                                av_log(s->avctx, AV_LOG_ERROR,
-                                       "error y=%d x=%d\n", mb_y, mb_x);
-                                return AVERROR_INVALIDDATA;
-                            }
-                            s->dsp.idct_put(ptr, linesize[c], s->block);
-                        }
-                    } else {
-                        int block_idx  = s->block_stride[c] * (v * mb_y + y) +
-                                         (h * mb_x + x);
-                        int16_t *block = s->blocks[c][block_idx];
-                        if (Ah)
-                            block[0] += get_bits1(&s->gb) *
-                                        s->quant_matrixes[s->quant_index[c]][0] << Al;
-                        else if (decode_dc_progressive(s, block, i, s->dc_index[i],
-                                                       s->quant_matrixes[s->quant_index[c]],
-                                                       Al) < 0) {
-                            av_log(s->avctx, AV_LOG_ERROR,
-                                   "error y=%d x=%d\n", mb_y, mb_x);
-                            return AVERROR_INVALIDDATA;
-                        }
-                    }
-                    av_dlog(s->avctx, "mb: %d %d processed\n", mb_y, mb_x);
-                    av_dlog(s->avctx, "%d %d %d %d %d %d %d %d \n",
-                            mb_x, mb_y, x, y, c, s->bottom_field,
-                            (v * mb_y + y) * 8, (h * mb_x + x) * 8);
-                    if (++x == h) {
-                        x = 0;
-                        y++;
-                    }
-                }
-            }
-
-            if (s->restart_interval) {
-                s->restart_count--;
-                i = 8 + ((-get_bits_count(&s->gb)) & 7);
-                /* skip RSTn */
-                if (show_bits(&s->gb, i) == (1 << i) - 1) {
-                    int pos = get_bits_count(&s->gb);
-                    align_get_bits(&s->gb);
-                    while (get_bits_left(&s->gb) >= 8 && show_bits(&s->gb, 8) == 0xFF)
-                        skip_bits(&s->gb, 8);
-                    if ((get_bits(&s->gb, 8) & 0xF8) == 0xD0) {
-                        for (i = 0; i < nb_components; i++) /* reset dc */
-                            s->last_dc[i] = 1024;
-                    } else
-                        skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
-                                            int se, int Ah, int Al,
-                                            const uint8_t *mb_bitmask,
-                                            const AVFrame *reference)
-{
-    int mb_x, mb_y;
-    int EOBRUN = 0;
-    int c = s->comp_index[0];
-    uint8_t *data = s->picture_ptr->data[c];
-    const uint8_t *reference_data = reference ? reference->data[c] : NULL;
-    int linesize  = s->linesize[c];
-    int last_scan = 0;
-    int16_t *quant_matrix = s->quant_matrixes[s->quant_index[c]];
-    GetBitContext mb_bitmask_gb;
-
-    if (ss < 0  || ss >= 64 ||
-        se < ss || se >= 64 ||
-        Ah < 0  || Al < 0)
-        return AVERROR_INVALIDDATA;
-
-    if (mb_bitmask)
-        init_get_bits(&mb_bitmask_gb, mb_bitmask, s->mb_width * s->mb_height);
-
-    if (!Al) {
-        s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss);
-        last_scan = !~s->coefs_finished[c];
-    }
-
-    if (s->interlaced && s->bottom_field) {
-        int offset      = linesize >> 1;
-        data           += offset;
-        reference_data += offset;
-    }
-
-    for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-        int block_offset = mb_y * linesize * 8;
-        uint8_t *ptr     = data + block_offset;
-        int block_idx    = mb_y * s->block_stride[c];
-        int16_t (*block)[64] = &s->blocks[c][block_idx];
-        uint8_t *last_nnz    = &s->last_nnz[c][block_idx];
-        for (mb_x = 0; mb_x < s->mb_width; mb_x++, block++, last_nnz++) {
-            const int copy_mb = mb_bitmask && !get_bits1(&mb_bitmask_gb);
-
-            if (!copy_mb) {
-                int ret;
-                if (Ah)
-                    ret = decode_block_refinement(s, *block, last_nnz, s->ac_index[0],
-                                                  quant_matrix, ss, se, Al, &EOBRUN);
-                else
-                    ret = decode_block_progressive(s, *block, last_nnz, s->ac_index[0],
-                                                   quant_matrix, ss, se, Al, &EOBRUN);
-                if (ret < 0) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "error y=%d x=%d\n", mb_y, mb_x);
-                    return AVERROR_INVALIDDATA;
-                }
-            }
-
-            if (last_scan) {
-                if (copy_mb) {
-                    s->hdsp.put_pixels_tab[1][0](ptr,
-                                                 reference_data + block_offset,
-                                                 linesize, 8);
-                } else {
-                    s->dsp.idct_put(ptr, linesize, *block);
-                    ptr += 8;
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
-                        const AVFrame *reference)
-{
-    int len, nb_components, i, h, v, predictor, point_transform;
-    int index, id, ret;
-    const int block_size = s->lossless ? 1 : 8;
-    int ilv, prev_shift;
-
-    /* XXX: verify len field validity */
-    len = get_bits(&s->gb, 16);
-    nb_components = get_bits(&s->gb, 8);
-    if (nb_components == 0 || nb_components > MAX_COMPONENTS) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "decode_sos: nb_components (%d) unsupported\n", nb_components);
-        return AVERROR_PATCHWELCOME;
-    }
-    if (len != 6 + 2 * nb_components) {
-        av_log(s->avctx, AV_LOG_ERROR, "decode_sos: invalid len (%d)\n", len);
-        return AVERROR_INVALIDDATA;
-    }
-    for (i = 0; i < nb_components; i++) {
-        id = get_bits(&s->gb, 8) - 1;
-        av_log(s->avctx, AV_LOG_DEBUG, "component: %d\n", id);
-        /* find component index */
-        for (index = 0; index < s->nb_components; index++)
-            if (id == s->component_id[index])
-                break;
-        if (index == s->nb_components) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "decode_sos: index(%d) out of components\n", index);
-            return AVERROR_INVALIDDATA;
-        }
-        /* Metasoft MJPEG codec has Cb and Cr swapped */
-        if (s->avctx->codec_tag == MKTAG('M', 'T', 'S', 'J')
-            && nb_components == 3 && s->nb_components == 3 && i)
-            index = 3 - i;
-
-        s->comp_index[i] = index;
-
-        s->nb_blocks[i] = s->h_count[index] * s->v_count[index];
-        s->h_scount[i]  = s->h_count[index];
-        s->v_scount[i]  = s->v_count[index];
-
-        s->dc_index[i] = get_bits(&s->gb, 4);
-        s->ac_index[i] = get_bits(&s->gb, 4);
-
-        if (s->dc_index[i] <  0 || s->ac_index[i] < 0 ||
-            s->dc_index[i] >= 4 || s->ac_index[i] >= 4)
-            goto out_of_range;
-        if (!s->vlcs[0][s->dc_index[i]].table ||
-            !s->vlcs[1][s->ac_index[i]].table)
-            goto out_of_range;
-    }
-
-    predictor = get_bits(&s->gb, 8);       /* JPEG Ss / lossless JPEG predictor /JPEG-LS NEAR */
-    ilv = get_bits(&s->gb, 8);             /* JPEG Se / JPEG-LS ILV */
-    prev_shift      = get_bits(&s->gb, 4); /* Ah */
-    point_transform = get_bits(&s->gb, 4); /* Al */
-
-    if (nb_components > 1) {
-        /* interleaved stream */
-        s->mb_width  = (s->width  + s->h_max * block_size - 1) / (s->h_max * block_size);
-        s->mb_height = (s->height + s->v_max * block_size - 1) / (s->v_max * block_size);
-    } else if (!s->ls) { /* skip this for JPEG-LS */
-        h = s->h_max / s->h_scount[0];
-        v = s->v_max / s->v_scount[0];
-        s->mb_width     = (s->width  + h * block_size - 1) / (h * block_size);
-        s->mb_height    = (s->height + v * block_size - 1) / (v * block_size);
-        s->nb_blocks[0] = 1;
-        s->h_scount[0]  = 1;
-        s->v_scount[0]  = 1;
-    }
-
-    if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(s->avctx, AV_LOG_DEBUG, "%s %s p:%d >>:%d ilv:%d bits:%d %s\n",
-               s->lossless ? "lossless" : "sequential DCT", s->rgb ? "RGB" : "",
-               predictor, point_transform, ilv, s->bits,
-               s->pegasus_rct ? "PRCT" : (s->rct ? "RCT" : ""));
-
-
-    /* mjpeg-b can have padding bytes between sos and image data, skip them */
-    for (i = s->mjpb_skiptosod; i > 0; i--)
-        skip_bits(&s->gb, 8);
-
-next_field:
-    for (i = 0; i < nb_components; i++)
-        s->last_dc[i] = 1024;
-
-    if (s->lossless) {
-        if (CONFIG_JPEGLS_DECODER && s->ls) {
-//            for () {
-//            reset_ls_coding_parameters(s, 0);
-
-            if ((ret = ff_jpegls_decode_picture(s, predictor,
-                                                point_transform, ilv)) < 0)
-                return ret;
-        } else {
-            if (s->rgb) {
-                if ((ret = ljpeg_decode_rgb_scan(s, predictor,
-                                                 point_transform)) < 0)
-                    return ret;
-            } else {
-                if ((ret = ljpeg_decode_yuv_scan(s, predictor,
-                                                 point_transform,
-                                                 nb_components)) < 0)
-                    return ret;
-            }
-        }
-    } else {
-        if (s->progressive && predictor) {
-            if ((ret = mjpeg_decode_scan_progressive_ac(s, predictor,
-                                                        ilv, prev_shift,
-                                                        point_transform,
-                                                        mb_bitmask,
-                                                        reference)) < 0)
-                return ret;
-        } else {
-            if ((ret = mjpeg_decode_scan(s, nb_components,
-                                         prev_shift, point_transform,
-                                         mb_bitmask, reference)) < 0)
-                return ret;
-        }
-    }
-
-    if (s->interlaced &&
-        get_bits_left(&s->gb) > 32 &&
-        show_bits(&s->gb, 8) == 0xFF) {
-        GetBitContext bak = s->gb;
-        align_get_bits(&bak);
-        if (show_bits(&bak, 16) == 0xFFD1) {
-            av_dlog(s->avctx, "AVRn interlaced picture marker found\n");
-            s->gb = bak;
-            skip_bits(&s->gb, 16);
-            s->bottom_field ^= 1;
-
-            goto next_field;
-        }
-    }
-
-    emms_c();
-    return 0;
- out_of_range:
-    av_log(s->avctx, AV_LOG_ERROR, "decode_sos: ac/dc index out of range\n");
-    return AVERROR_INVALIDDATA;
-}
-
-static int mjpeg_decode_dri(MJpegDecodeContext *s)
-{
-    if (get_bits(&s->gb, 16) != 4)
-        return AVERROR_INVALIDDATA;
-    s->restart_interval = get_bits(&s->gb, 16);
-    s->restart_count    = 0;
-    av_log(s->avctx, AV_LOG_DEBUG, "restart interval: %d\n",
-           s->restart_interval);
-
-    return 0;
-}
-
-static int mjpeg_decode_app(MJpegDecodeContext *s)
-{
-    int len, id, i;
-
-    len = get_bits(&s->gb, 16);
-    if (len < 5)
-        return AVERROR_INVALIDDATA;
-    if (8 * len > get_bits_left(&s->gb))
-        return AVERROR_INVALIDDATA;
-
-    id   = get_bits_long(&s->gb, 32);
-    id   = av_be2ne32(id);
-    len -= 6;
-
-    if (s->avctx->debug & FF_DEBUG_STARTCODE)
-        av_log(s->avctx, AV_LOG_DEBUG, "APPx %8X\n", id);
-
-    /* Buggy AVID, it puts EOI only at every 10th frame. */
-    /* Also, this fourcc is used by non-avid files too, it holds some
-       information, but it's always present in AVID-created files. */
-    if (id == AV_RL32("AVI1")) {
-        /* structure:
-            4bytes      AVI1
-            1bytes      polarity
-            1bytes      always zero
-            4bytes      field_size
-            4bytes      field_size_less_padding
-        */
-        s->buggy_avid = 1;
-        i = get_bits(&s->gb, 8);
-        if (i == 2)
-            s->bottom_field = 1;
-        else if (i == 1)
-            s->bottom_field = 0;
-#if 0
-        skip_bits(&s->gb, 8);
-        skip_bits(&s->gb, 32);
-        skip_bits(&s->gb, 32);
-        len -= 10;
-#endif
-        goto out;
-    }
-
-//    len -= 2;
-
-    if (id == AV_RL32("JFIF")) {
-        int t_w, t_h, v1, v2;
-        skip_bits(&s->gb, 8); /* the trailing zero-byte */
-        v1 = get_bits(&s->gb, 8);
-        v2 = get_bits(&s->gb, 8);
-        skip_bits(&s->gb, 8);
-
-        s->avctx->sample_aspect_ratio.num = get_bits(&s->gb, 16);
-        s->avctx->sample_aspect_ratio.den = get_bits(&s->gb, 16);
-
-        if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-            av_log(s->avctx, AV_LOG_INFO,
-                   "mjpeg: JFIF header found (version: %x.%x) SAR=%d/%d\n",
-                   v1, v2,
-                   s->avctx->sample_aspect_ratio.num,
-                   s->avctx->sample_aspect_ratio.den);
-
-        t_w = get_bits(&s->gb, 8);
-        t_h = get_bits(&s->gb, 8);
-        if (t_w && t_h) {
-            /* skip thumbnail */
-            if (len -10 - (t_w * t_h * 3) > 0)
-                len -= t_w * t_h * 3;
-        }
-        len -= 10;
-        goto out;
-    }
-
-    if (id == AV_RL32("Adob") && (get_bits(&s->gb, 8) == 'e')) {
-        if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-            av_log(s->avctx, AV_LOG_INFO, "mjpeg: Adobe header found\n");
-        skip_bits(&s->gb, 16); /* version */
-        skip_bits(&s->gb, 16); /* flags0 */
-        skip_bits(&s->gb, 16); /* flags1 */
-        skip_bits(&s->gb,  8); /* transform */
-        len -= 7;
-        goto out;
-    }
-
-    if (id == AV_RL32("LJIF")) {
-        if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-            av_log(s->avctx, AV_LOG_INFO,
-                   "Pegasus lossless jpeg header found\n");
-        skip_bits(&s->gb, 16); /* version ? */
-        skip_bits(&s->gb, 16); /* unknwon always 0? */
-        skip_bits(&s->gb, 16); /* unknwon always 0? */
-        skip_bits(&s->gb, 16); /* unknwon always 0? */
-        switch (get_bits(&s->gb, 8)) {
-        case 1:
-            s->rgb         = 1;
-            s->pegasus_rct = 0;
-            break;
-        case 2:
-            s->rgb         = 1;
-            s->pegasus_rct = 1;
-            break;
-        default:
-            av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace\n");
-        }
-        len -= 9;
-        goto out;
-    }
-
-    /* Apple MJPEG-A */
-    if ((s->start_code == APP1) && (len > (0x28 - 8))) {
-        id   = get_bits_long(&s->gb, 32);
-        id   = av_be2ne32(id);
-        len -= 4;
-        /* Apple MJPEG-A */
-        if (id == AV_RL32("mjpg")) {
-#if 0
-            skip_bits(&s->gb, 32); /* field size */
-            skip_bits(&s->gb, 32); /* pad field size */
-            skip_bits(&s->gb, 32); /* next off */
-            skip_bits(&s->gb, 32); /* quant off */
-            skip_bits(&s->gb, 32); /* huff off */
-            skip_bits(&s->gb, 32); /* image off */
-            skip_bits(&s->gb, 32); /* scan off */
-            skip_bits(&s->gb, 32); /* data off */
-#endif
-            if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-                av_log(s->avctx, AV_LOG_INFO, "mjpeg: Apple MJPEG-A header found\n");
-        }
-    }
-
-out:
-    /* slow but needed for extreme adobe jpegs */
-    if (len < 0)
-        av_log(s->avctx, AV_LOG_ERROR,
-               "mjpeg: error, decode_app parser read over the end\n");
-    while (--len > 0)
-        skip_bits(&s->gb, 8);
-
-    return 0;
-}
-
-static int mjpeg_decode_com(MJpegDecodeContext *s)
-{
-    int len = get_bits(&s->gb, 16);
-    if (len >= 2 && 8 * len - 16 <= get_bits_left(&s->gb)) {
-        char *cbuf = av_malloc(len - 1);
-        if (cbuf) {
-            int i;
-            for (i = 0; i < len - 2; i++)
-                cbuf[i] = get_bits(&s->gb, 8);
-            if (i > 0 && cbuf[i - 1] == '\n')
-                cbuf[i - 1] = 0;
-            else
-                cbuf[i] = 0;
-
-            if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-                av_log(s->avctx, AV_LOG_INFO, "mjpeg comment: '%s'\n", cbuf);
-
-            /* buggy avid, it puts EOI only at every 10th frame */
-            if (!strcmp(cbuf, "AVID")) {
-                s->buggy_avid = 1;
-            } else if (!strcmp(cbuf, "CS=ITU601"))
-                s->cs_itu601 = 1;
-            else if ((len > 20 && !strncmp(cbuf, "Intel(R) JPEG Library", 21)) ||
-                     (len > 19 && !strncmp(cbuf, "Metasoft MJPEG Codec", 20)))
-                s->flipped = 1;
-
-            av_free(cbuf);
-        }
-    }
-
-    return 0;
-}
-
-/* return the 8 bit start code value and update the search
-   state. Return -1 if no start code found */
-static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
-{
-    const uint8_t *buf_ptr;
-    unsigned int v, v2;
-    int val;
-#ifdef DEBUG
-    int skipped = 0;
-#endif
-
-    buf_ptr = *pbuf_ptr;
-    while (buf_ptr < buf_end) {
-        v  = *buf_ptr++;
-        v2 = *buf_ptr;
-        if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe) && buf_ptr < buf_end) {
-            val = *buf_ptr++;
-            goto found;
-        }
-#ifdef DEBUG
-        skipped++;
-#endif
-    }
-    val = -1;
-found:
-    av_dlog(NULL, "find_marker skipped %d bytes\n", skipped);
-    *pbuf_ptr = buf_ptr;
-    return val;
-}
-
-int ff_mjpeg_find_marker(MJpegDecodeContext *s,
-                         const uint8_t **buf_ptr, const uint8_t *buf_end,
-                         const uint8_t **unescaped_buf_ptr,
-                         int *unescaped_buf_size)
-{
-    int start_code;
-    start_code = find_marker(buf_ptr, buf_end);
-
-    av_fast_padded_malloc(&s->buffer, &s->buffer_size, buf_end - *buf_ptr);
-    if (!s->buffer)
-        return AVERROR(ENOMEM);
-
-    /* unescape buffer of SOS, use special treatment for JPEG-LS */
-    if (start_code == SOS && !s->ls) {
-        const uint8_t *src = *buf_ptr;
-        uint8_t *dst = s->buffer;
-
-        while (src < buf_end) {
-            uint8_t x = *(src++);
-
-            *(dst++) = x;
-            if (s->avctx->codec_id != AV_CODEC_ID_THP) {
-                if (x == 0xff) {
-                    while (src < buf_end && x == 0xff)
-                        x = *(src++);
-
-                    if (x >= 0xd0 && x <= 0xd7)
-                        *(dst++) = x;
-                    else if (x)
-                        break;
-                }
-            }
-        }
-        *unescaped_buf_ptr  = s->buffer;
-        *unescaped_buf_size = dst - s->buffer;
-        memset(s->buffer + *unescaped_buf_size, 0,
-               FF_INPUT_BUFFER_PADDING_SIZE);
-
-        av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %td bytes\n",
-               (buf_end - *buf_ptr) - (dst - s->buffer));
-    } else if (start_code == SOS && s->ls) {
-        const uint8_t *src = *buf_ptr;
-        uint8_t *dst  = s->buffer;
-        int bit_count = 0;
-        int t = 0, b = 0;
-        PutBitContext pb;
-
-        s->cur_scan++;
-
-        /* find marker */
-        while (src + t < buf_end) {
-            uint8_t x = src[t++];
-            if (x == 0xff) {
-                while ((src + t < buf_end) && x == 0xff)
-                    x = src[t++];
-                if (x & 0x80) {
-                    t -= 2;
-                    break;
-                }
-            }
-        }
-        bit_count = t * 8;
-        init_put_bits(&pb, dst, t);
-
-        /* unescape bitstream */
-        while (b < t) {
-            uint8_t x = src[b++];
-            put_bits(&pb, 8, x);
-            if (x == 0xFF) {
-                x = src[b++];
-                put_bits(&pb, 7, x);
-                bit_count--;
-            }
-        }
-        flush_put_bits(&pb);
-
-        *unescaped_buf_ptr  = dst;
-        *unescaped_buf_size = (bit_count + 7) >> 3;
-        memset(s->buffer + *unescaped_buf_size, 0,
-               FF_INPUT_BUFFER_PADDING_SIZE);
-    } else {
-        *unescaped_buf_ptr  = *buf_ptr;
-        *unescaped_buf_size = buf_end - *buf_ptr;
-    }
-
-    return start_code;
-}
-
-int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                          AVPacket *avpkt)
-{
-    AVFrame     *frame = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    MJpegDecodeContext *s = avctx->priv_data;
-    const uint8_t *buf_end, *buf_ptr;
-    const uint8_t *unescaped_buf_ptr;
-    int unescaped_buf_size;
-    int start_code;
-    int ret = 0;
-
-    s->got_picture = 0; // picture from previous image can not be reused
-    buf_ptr = buf;
-    buf_end = buf + buf_size;
-    while (buf_ptr < buf_end) {
-        /* find start next marker */
-        start_code = ff_mjpeg_find_marker(s, &buf_ptr, buf_end,
-                                          &unescaped_buf_ptr,
-                                          &unescaped_buf_size);
-        /* EOF */
-        if (start_code < 0) {
-            goto the_end;
-        } else if (unescaped_buf_size > INT_MAX / 8) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "MJPEG packet 0x%x too big (%d/%d), corrupt data?\n",
-                   start_code, unescaped_buf_size, buf_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%td\n",
-               start_code, buf_end - buf_ptr);
-
-        ret = init_get_bits(&s->gb, unescaped_buf_ptr,
-                            unescaped_buf_size * 8);
-        if (ret < 0)
-            return ret;
-
-        s->start_code = start_code;
-        if (s->avctx->debug & FF_DEBUG_STARTCODE)
-            av_log(avctx, AV_LOG_DEBUG, "startcode: %X\n", start_code);
-
-        /* process markers */
-        if (start_code >= 0xd0 && start_code <= 0xd7)
-            av_log(avctx, AV_LOG_DEBUG,
-                   "restart marker: %d\n", start_code & 0x0f);
-            /* APP fields */
-        else if (start_code >= APP0 && start_code <= APP15)
-            mjpeg_decode_app(s);
-            /* Comment */
-        else if (start_code == COM)
-            mjpeg_decode_com(s);
-
-        if (!CONFIG_JPEGLS_DECODER &&
-            (start_code == SOF48 || start_code == LSE)) {
-            av_log(avctx, AV_LOG_ERROR, "JPEG-LS support not enabled.\n");
-            return AVERROR(ENOSYS);
-        }
-
-        switch (start_code) {
-        case SOI:
-            s->restart_interval = 0;
-            s->restart_count    = 0;
-            /* nothing to do on SOI */
-            break;
-        case DQT:
-            ff_mjpeg_decode_dqt(s);
-            break;
-        case DHT:
-            if ((ret = ff_mjpeg_decode_dht(s)) < 0) {
-                av_log(avctx, AV_LOG_ERROR, "huffman table decode error\n");
-                return ret;
-            }
-            break;
-        case SOF0:
-        case SOF1:
-            s->lossless    = 0;
-            s->ls          = 0;
-            s->progressive = 0;
-            if ((ret = ff_mjpeg_decode_sof(s)) < 0)
-                return ret;
-            break;
-        case SOF2:
-            s->lossless    = 0;
-            s->ls          = 0;
-            s->progressive = 1;
-            if ((ret = ff_mjpeg_decode_sof(s)) < 0)
-                return ret;
-            break;
-        case SOF3:
-            s->lossless    = 1;
-            s->ls          = 0;
-            s->progressive = 0;
-            if ((ret = ff_mjpeg_decode_sof(s)) < 0)
-                return ret;
-            break;
-        case SOF48:
-            s->lossless    = 1;
-            s->ls          = 1;
-            s->progressive = 0;
-            if ((ret = ff_mjpeg_decode_sof(s)) < 0)
-                return ret;
-            break;
-        case LSE:
-            if (!CONFIG_JPEGLS_DECODER ||
-                (ret = ff_jpegls_decode_lse(s)) < 0)
-                return ret;
-            break;
-        case EOI:
-            s->cur_scan = 0;
-            if ((s->buggy_avid && !s->interlaced) || s->restart_interval)
-                break;
-eoi_parser:
-            if (!s->got_picture) {
-                av_log(avctx, AV_LOG_WARNING,
-                       "Found EOI before any SOF, ignoring\n");
-                break;
-            }
-            if (s->interlaced) {
-                s->bottom_field ^= 1;
-                /* if not bottom field, do not output image yet */
-                if (s->bottom_field == !s->interlace_polarity)
-                    goto not_the_end;
-            }
-            if ((ret = av_frame_ref(frame, s->picture_ptr)) < 0)
-                return ret;
-            if (s->flipped) {
-                int i;
-                for (i = 0; frame->data[i]; i++) {
-                    int h = frame->height >> ((i == 1 || i == 2) ?
-                                              s->pix_desc->log2_chroma_h : 0);
-                    frame->data[i] += frame->linesize[i] * (h - 1);
-                    frame->linesize[i] *= -1;
-                }
-            }
-            *got_frame = 1;
-
-            if (!s->lossless &&
-                avctx->debug & FF_DEBUG_QP) {
-                av_log(avctx, AV_LOG_DEBUG,
-                       "QP: %d\n", FFMAX3(s->qscale[0],
-                                          s->qscale[1],
-                                          s->qscale[2]));
-            }
-
-            goto the_end;
-        case SOS:
-            if (!s->got_picture) {
-                av_log(avctx, AV_LOG_WARNING,
-                       "Can not process SOS before SOF, skipping\n");
-                break;
-                }
-            if ((ret = ff_mjpeg_decode_sos(s, NULL, NULL)) < 0 &&
-                (avctx->err_recognition & AV_EF_EXPLODE))
-                return ret;
-            /* buggy avid puts EOI every 10-20th frame */
-            /* if restart period is over process EOI */
-            if ((s->buggy_avid && !s->interlaced) || s->restart_interval)
-                goto eoi_parser;
-            break;
-        case DRI:
-            mjpeg_decode_dri(s);
-            break;
-        case SOF5:
-        case SOF6:
-        case SOF7:
-        case SOF9:
-        case SOF10:
-        case SOF11:
-        case SOF13:
-        case SOF14:
-        case SOF15:
-        case JPG:
-            av_log(avctx, AV_LOG_ERROR,
-                   "mjpeg: unsupported coding type (%x)\n", start_code);
-            break;
-        }
-
-not_the_end:
-        /* eof process start code */
-        buf_ptr += (get_bits_count(&s->gb) + 7) / 8;
-        av_log(avctx, AV_LOG_DEBUG,
-               "marker parser used %d bytes (%d bits)\n",
-               (get_bits_count(&s->gb) + 7) / 8, get_bits_count(&s->gb));
-    }
-    if (s->got_picture) {
-        av_log(avctx, AV_LOG_WARNING, "EOI missing, emulating\n");
-        goto eoi_parser;
-    }
-    av_log(avctx, AV_LOG_FATAL, "No JPEG data found in image\n");
-    return AVERROR_INVALIDDATA;
-the_end:
-    av_log(avctx, AV_LOG_DEBUG, "mjpeg decode frame unused %td bytes\n",
-           buf_end - buf_ptr);
-//  return buf_end - buf_ptr;
-    return buf_ptr - buf;
-}
-
-av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
-{
-    MJpegDecodeContext *s = avctx->priv_data;
-    int i, j;
-
-    if (s->picture) {
-        av_frame_free(&s->picture);
-        s->picture_ptr = NULL;
-    } else if (s->picture_ptr)
-        av_frame_unref(s->picture_ptr);
-
-    av_free(s->buffer);
-    av_freep(&s->ljpeg_buffer);
-    s->ljpeg_buffer_size = 0;
-
-    for (i = 0; i < 3; i++) {
-        for (j = 0; j < 4; j++)
-            ff_free_vlc(&s->vlcs[i][j]);
-    }
-    for (i = 0; i < MAX_COMPONENTS; i++) {
-        av_freep(&s->blocks[i]);
-        av_freep(&s->last_nnz[i]);
-    }
-    return 0;
-}
-
-#define OFFSET(x) offsetof(MJpegDecodeContext, x)
-#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "extern_huff", "Use external huffman table.",
-      OFFSET(extern_huff), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VD },
-    { NULL },
-};
-
-static const AVClass mjpegdec_class = {
-    .class_name = "MJPEG decoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_mjpeg_decoder = {
-    .name           = "mjpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MJPEG,
-    .priv_data_size = sizeof(MJpegDecodeContext),
-    .init           = ff_mjpeg_decode_init,
-    .close          = ff_mjpeg_decode_end,
-    .decode         = ff_mjpeg_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .priv_class     = &mjpegdec_class,
-};
-
-AVCodec ff_thp_decoder = {
-    .name           = "thp",
-    .long_name      = NULL_IF_CONFIG_SMALL("Nintendo Gamecube THP video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_THP,
-    .priv_data_size = sizeof(MJpegDecodeContext),
-    .init           = ff_mjpeg_decode_init,
-    .close          = ff_mjpeg_decode_end,
-    .decode         = ff_mjpeg_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/mjpegdec.h b/deps/libav/libavcodec/mjpegdec.h
deleted file mode 100644
index 344d2cb..0000000
--- a/deps/libav/libavcodec/mjpegdec.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * MJPEG decoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003 Alex Beregszaszi
- * Copyright (c) 2003-2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MJPEG decoder.
- */
-
-#ifndef AVCODEC_MJPEGDEC_H
-#define AVCODEC_MJPEGDEC_H
-
-#include "libavutil/log.h"
-#include "libavutil/pixdesc.h"
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "hpeldsp.h"
-
-#define MAX_COMPONENTS 4
-
-typedef struct MJpegDecodeContext {
-    AVClass *class;
-    AVCodecContext *avctx;
-    GetBitContext gb;
-
-    int start_code; /* current start code */
-    int buffer_size;
-    uint8_t *buffer;
-
-    int16_t quant_matrixes[4][64];
-    VLC vlcs[3][4];
-    int qscale[4];      ///< quantizer scale calculated from quant_matrixes
-
-    int org_height;  /* size given at codec init */
-    int first_picture;    /* true if decoding first picture */
-    int interlaced;     /* true if interlaced */
-    int bottom_field;   /* true if bottom field */
-    int lossless;
-    int ls;
-    int progressive;
-    int rgb;
-    int rct;            /* standard rct */
-    int pegasus_rct;    /* pegasus reversible colorspace transform */
-    int bits;           /* bits per component */
-
-    int maxval;
-    int near;         ///< near lossless bound (si 0 for lossless)
-    int t1,t2,t3;
-    int reset;        ///< context halfing intervall ?rename
-
-    int width, height;
-    int mb_width, mb_height;
-    int nb_components;
-    int block_stride[MAX_COMPONENTS];
-    int component_id[MAX_COMPONENTS];
-    int h_count[MAX_COMPONENTS]; /* horizontal and vertical count for each component */
-    int v_count[MAX_COMPONENTS];
-    int comp_index[MAX_COMPONENTS];
-    int dc_index[MAX_COMPONENTS];
-    int ac_index[MAX_COMPONENTS];
-    int nb_blocks[MAX_COMPONENTS];
-    int h_scount[MAX_COMPONENTS];
-    int v_scount[MAX_COMPONENTS];
-    int h_max, v_max; /* maximum h and v counts */
-    int quant_index[4];   /* quant table index for each component */
-    int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */
-    AVFrame *picture; /* picture structure */
-    AVFrame *picture_ptr; /* pointer to picture structure */
-    int got_picture;                                ///< we found a SOF and picture is valid, too.
-    int linesize[MAX_COMPONENTS];                   ///< linesize << interlaced
-    int8_t *qscale_table;
-    DECLARE_ALIGNED(16, int16_t, block)[64];
-    int16_t (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode)
-    uint8_t *last_nnz[MAX_COMPONENTS];
-    uint64_t coefs_finished[MAX_COMPONENTS]; ///< bitmask of which coefs have been completely decoded (progressive mode)
-    ScanTable scantable;
-    DSPContext dsp;
-    HpelDSPContext hdsp;
-
-    int restart_interval;
-    int restart_count;
-
-    int buggy_avid;
-    int cs_itu601;
-    int interlace_polarity;
-
-    int mjpb_skiptosod;
-
-    int cur_scan; /* current scan, used by JPEG-LS */
-    int flipped; /* true if picture is flipped */
-
-    uint16_t (*ljpeg_buffer)[4];
-    unsigned int ljpeg_buffer_size;
-
-    int extern_huff;
-
-    const AVPixFmtDescriptor *pix_desc;
-} MJpegDecodeContext;
-
-int ff_mjpeg_decode_init(AVCodecContext *avctx);
-int ff_mjpeg_decode_end(AVCodecContext *avctx);
-int ff_mjpeg_decode_frame(AVCodecContext *avctx,
-                          void *data, int *got_frame,
-                          AVPacket *avpkt);
-int ff_mjpeg_decode_dqt(MJpegDecodeContext *s);
-int ff_mjpeg_decode_dht(MJpegDecodeContext *s);
-int ff_mjpeg_decode_sof(MJpegDecodeContext *s);
-int ff_mjpeg_decode_sos(MJpegDecodeContext *s,
-                        const uint8_t *mb_bitmask, const AVFrame *reference);
-int ff_mjpeg_find_marker(MJpegDecodeContext *s,
-                         const uint8_t **buf_ptr, const uint8_t *buf_end,
-                         const uint8_t **unescaped_buf_ptr, int *unescaped_buf_size);
-
-#endif /* AVCODEC_MJPEGDEC_H */
diff --git a/deps/libav/libavcodec/mjpegenc.c b/deps/libav/libavcodec/mjpegenc.c
deleted file mode 100644
index 30433c3..0000000
--- a/deps/libav/libavcodec/mjpegenc.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * MJPEG encoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003 Alex Beregszaszi
- * Copyright (c) 2003-2004 Michael Niedermayer
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- *                                  by Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MJPEG encoder.
- */
-
-#include <assert.h>
-
-#include "libavutil/pixdesc.h"
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "mjpeg.h"
-#include "mjpegenc.h"
-
-av_cold int ff_mjpeg_encode_init(MpegEncContext *s)
-{
-    MJpegContext *m;
-
-    m = av_malloc(sizeof(MJpegContext));
-    if (!m)
-        return -1;
-
-    s->min_qcoeff=-1023;
-    s->max_qcoeff= 1023;
-
-    /* build all the huffman tables */
-    ff_mjpeg_build_huffman_codes(m->huff_size_dc_luminance,
-                                 m->huff_code_dc_luminance,
-                                 avpriv_mjpeg_bits_dc_luminance,
-                                 avpriv_mjpeg_val_dc);
-    ff_mjpeg_build_huffman_codes(m->huff_size_dc_chrominance,
-                                 m->huff_code_dc_chrominance,
-                                 avpriv_mjpeg_bits_dc_chrominance,
-                                 avpriv_mjpeg_val_dc);
-    ff_mjpeg_build_huffman_codes(m->huff_size_ac_luminance,
-                                 m->huff_code_ac_luminance,
-                                 avpriv_mjpeg_bits_ac_luminance,
-                                 avpriv_mjpeg_val_ac_luminance);
-    ff_mjpeg_build_huffman_codes(m->huff_size_ac_chrominance,
-                                 m->huff_code_ac_chrominance,
-                                 avpriv_mjpeg_bits_ac_chrominance,
-                                 avpriv_mjpeg_val_ac_chrominance);
-
-    s->mjpeg_ctx = m;
-    return 0;
-}
-
-void ff_mjpeg_encode_close(MpegEncContext *s)
-{
-    av_free(s->mjpeg_ctx);
-}
-
-/* table_class: 0 = DC coef, 1 = AC coefs */
-static int put_huffman_table(PutBitContext *p, int table_class, int table_id,
-                             const uint8_t *bits_table, const uint8_t *value_table)
-{
-    int n, i;
-
-    put_bits(p, 4, table_class);
-    put_bits(p, 4, table_id);
-
-    n = 0;
-    for(i=1;i<=16;i++) {
-        n += bits_table[i];
-        put_bits(p, 8, bits_table[i]);
-    }
-
-    for(i=0;i<n;i++)
-        put_bits(p, 8, value_table[i]);
-
-    return n + 17;
-}
-
-static void jpeg_table_header(PutBitContext *p, ScanTable *intra_scantable,
-                              uint16_t intra_matrix[64])
-{
-    int i, j, size;
-    uint8_t *ptr;
-
-    /* quant matrixes */
-    put_marker(p, DQT);
-    put_bits(p, 16, 2 + 1 * (1 + 64));
-    put_bits(p, 4, 0); /* 8 bit precision */
-    put_bits(p, 4, 0); /* table 0 */
-    for(i=0;i<64;i++) {
-        j = intra_scantable->permutated[i];
-        put_bits(p, 8, intra_matrix[j]);
-    }
-
-    /* huffman table */
-    put_marker(p, DHT);
-    flush_put_bits(p);
-    ptr = put_bits_ptr(p);
-    put_bits(p, 16, 0); /* patched later */
-    size = 2;
-    size += put_huffman_table(p, 0, 0, avpriv_mjpeg_bits_dc_luminance,
-                              avpriv_mjpeg_val_dc);
-    size += put_huffman_table(p, 0, 1, avpriv_mjpeg_bits_dc_chrominance,
-                              avpriv_mjpeg_val_dc);
-
-    size += put_huffman_table(p, 1, 0, avpriv_mjpeg_bits_ac_luminance,
-                              avpriv_mjpeg_val_ac_luminance);
-    size += put_huffman_table(p, 1, 1, avpriv_mjpeg_bits_ac_chrominance,
-                              avpriv_mjpeg_val_ac_chrominance);
-    AV_WB16(ptr, size);
-}
-
-static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
-{
-    int size;
-    uint8_t *ptr;
-
-    if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
-        /* JFIF header */
-        put_marker(p, APP0);
-        put_bits(p, 16, 16);
-        avpriv_put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */
-        put_bits(p, 16, 0x0201);         /* v 1.02 */
-        put_bits(p,  8, 0);              /* units type: 0 - aspect ratio */
-        put_bits(p, 16, avctx->sample_aspect_ratio.num);
-        put_bits(p, 16, avctx->sample_aspect_ratio.den);
-        put_bits(p, 8, 0); /* thumbnail width */
-        put_bits(p, 8, 0); /* thumbnail height */
-    }
-
-    /* comment */
-    if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
-        put_marker(p, COM);
-        flush_put_bits(p);
-        ptr = put_bits_ptr(p);
-        put_bits(p, 16, 0); /* patched later */
-        avpriv_put_string(p, LIBAVCODEC_IDENT, 1);
-        size = strlen(LIBAVCODEC_IDENT)+3;
-        AV_WB16(ptr, size);
-    }
-
-    if (avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
-        avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
-        avctx->pix_fmt == AV_PIX_FMT_YUV444P) {
-        put_marker(p, COM);
-        flush_put_bits(p);
-        ptr = put_bits_ptr(p);
-        put_bits(p, 16, 0); /* patched later */
-        avpriv_put_string(p, "CS=ITU601", 1);
-        size = strlen("CS=ITU601")+3;
-        AV_WB16(ptr, size);
-    }
-}
-
-void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
-                                    ScanTable *intra_scantable,
-                                    uint16_t intra_matrix[64])
-{
-    int chroma_h_shift, chroma_v_shift;
-    const int lossless = avctx->codec_id != AV_CODEC_ID_MJPEG;
-    int hsample[3], vsample[3];
-
-    av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift,
-                                     &chroma_v_shift);
-
-    if (avctx->codec->id == AV_CODEC_ID_LJPEG &&
-        avctx->pix_fmt   == AV_PIX_FMT_BGR24) {
-        vsample[0] = hsample[0] =
-        vsample[1] = hsample[1] =
-        vsample[2] = hsample[2] = 1;
-    } else {
-        vsample[0] = 2;
-        vsample[1] = 2 >> chroma_v_shift;
-        vsample[2] = 2 >> chroma_v_shift;
-        hsample[0] = 2;
-        hsample[1] = 2 >> chroma_h_shift;
-        hsample[2] = 2 >> chroma_h_shift;
-    }
-
-    put_marker(pb, SOI);
-
-    jpeg_put_comments(avctx, pb);
-
-    jpeg_table_header(pb, intra_scantable, intra_matrix);
-
-    switch (avctx->codec_id) {
-    case AV_CODEC_ID_MJPEG:  put_marker(pb, SOF0 ); break;
-    case AV_CODEC_ID_LJPEG:  put_marker(pb, SOF3 ); break;
-    default: assert(0);
-    }
-
-    put_bits(pb, 16, 17);
-    if (lossless && avctx->pix_fmt == AV_PIX_FMT_BGR24)
-        put_bits(pb, 8, 9); /* 9 bits/component RCT */
-    else
-        put_bits(pb, 8, 8); /* 8 bits/component */
-    put_bits(pb, 16, avctx->height);
-    put_bits(pb, 16, avctx->width);
-    put_bits(pb, 8, 3); /* 3 components */
-
-    /* Y component */
-    put_bits(pb, 8, 1); /* component number */
-    put_bits(pb, 4, hsample[0]); /* H factor */
-    put_bits(pb, 4, vsample[0]); /* V factor */
-    put_bits(pb, 8, 0); /* select matrix */
-
-    /* Cb component */
-    put_bits(pb, 8, 2); /* component number */
-    put_bits(pb, 4, hsample[1]); /* H factor */
-    put_bits(pb, 4, vsample[1]); /* V factor */
-    put_bits(pb, 8, 0); /* select matrix */
-
-    /* Cr component */
-    put_bits(pb, 8, 3); /* component number */
-    put_bits(pb, 4, hsample[2]); /* H factor */
-    put_bits(pb, 4, vsample[2]); /* V factor */
-    put_bits(pb, 8, 0); /* select matrix */
-
-    /* scan header */
-    put_marker(pb, SOS);
-    put_bits(pb, 16, 12); /* length */
-    put_bits(pb, 8, 3); /* 3 components */
-
-    /* Y component */
-    put_bits(pb, 8, 1); /* index */
-    put_bits(pb, 4, 0); /* DC huffman table index */
-    put_bits(pb, 4, 0); /* AC huffman table index */
-
-    /* Cb component */
-    put_bits(pb, 8, 2); /* index */
-    put_bits(pb, 4, 1); /* DC huffman table index */
-    put_bits(pb, 4, lossless ? 0 : 1); /* AC huffman table index */
-
-    /* Cr component */
-    put_bits(pb, 8, 3); /* index */
-    put_bits(pb, 4, 1); /* DC huffman table index */
-    put_bits(pb, 4, lossless ? 0 : 1); /* AC huffman table index */
-
-    put_bits(pb, 8, lossless ? avctx->prediction_method + 1 : 0); /* Ss (not used) */
-
-    switch (avctx->codec_id) {
-    case AV_CODEC_ID_MJPEG:  put_bits(pb, 8, 63); break; /* Se (not used) */
-    case AV_CODEC_ID_LJPEG:  put_bits(pb, 8,  0); break; /* not used */
-    default: assert(0);
-    }
-
-    put_bits(pb, 8, 0); /* Ah/Al (not used) */
-}
-
-static void escape_FF(PutBitContext *pb, int start)
-{
-    int size = put_bits_count(pb) - start * 8;
-    int i, ff_count;
-    uint8_t *buf = pb->buf + start;
-    int align= (-(size_t)(buf))&3;
-
-    assert((size&7) == 0);
-    size >>= 3;
-
-    ff_count=0;
-    for(i=0; i<size && i<align; i++){
-        if(buf[i]==0xFF) ff_count++;
-    }
-    for(; i<size-15; i+=16){
-        int acc, v;
-
-        v= *(uint32_t*)(&buf[i]);
-        acc= (((v & (v>>4))&0x0F0F0F0F)+0x01010101)&0x10101010;
-        v= *(uint32_t*)(&buf[i+4]);
-        acc+=(((v & (v>>4))&0x0F0F0F0F)+0x01010101)&0x10101010;
-        v= *(uint32_t*)(&buf[i+8]);
-        acc+=(((v & (v>>4))&0x0F0F0F0F)+0x01010101)&0x10101010;
-        v= *(uint32_t*)(&buf[i+12]);
-        acc+=(((v & (v>>4))&0x0F0F0F0F)+0x01010101)&0x10101010;
-
-        acc>>=4;
-        acc+= (acc>>16);
-        acc+= (acc>>8);
-        ff_count+= acc&0xFF;
-    }
-    for(; i<size; i++){
-        if(buf[i]==0xFF) ff_count++;
-    }
-
-    if(ff_count==0) return;
-
-    flush_put_bits(pb);
-    skip_put_bytes(pb, ff_count);
-
-    for(i=size-1; ff_count; i--){
-        int v= buf[i];
-
-        if(v==0xFF){
-            buf[i+ff_count]= 0;
-            ff_count--;
-        }
-
-        buf[i+ff_count]= v;
-    }
-}
-
-void ff_mjpeg_encode_stuffing(PutBitContext * pbc)
-{
-    int length;
-    length= (-put_bits_count(pbc))&7;
-    if(length) put_bits(pbc, length, (1<<length)-1);
-}
-
-void ff_mjpeg_encode_picture_trailer(PutBitContext *pb, int header_bits)
-{
-    ff_mjpeg_encode_stuffing(pb);
-    flush_put_bits(pb);
-
-    assert((header_bits & 7) == 0);
-
-    escape_FF(pb, header_bits >> 3);
-
-    put_marker(pb, EOI);
-}
-
-void ff_mjpeg_encode_dc(PutBitContext *pb, int val,
-                        uint8_t *huff_size, uint16_t *huff_code)
-{
-    int mant, nbits;
-
-    if (val == 0) {
-        put_bits(pb, huff_size[0], huff_code[0]);
-    } else {
-        mant = val;
-        if (val < 0) {
-            val = -val;
-            mant--;
-        }
-
-        nbits= av_log2_16bit(val) + 1;
-
-        put_bits(pb, huff_size[nbits], huff_code[nbits]);
-
-        put_sbits(pb, nbits, mant);
-    }
-}
-
-static void encode_block(MpegEncContext *s, int16_t *block, int n)
-{
-    int mant, nbits, code, i, j;
-    int component, dc, run, last_index, val;
-    MJpegContext *m = s->mjpeg_ctx;
-    uint8_t *huff_size_ac;
-    uint16_t *huff_code_ac;
-
-    /* DC coef */
-    component = (n <= 3 ? 0 : (n&1) + 1);
-    dc = block[0]; /* overflow is impossible */
-    val = dc - s->last_dc[component];
-    if (n < 4) {
-        ff_mjpeg_encode_dc(&s->pb, val, m->huff_size_dc_luminance, m->huff_code_dc_luminance);
-        huff_size_ac = m->huff_size_ac_luminance;
-        huff_code_ac = m->huff_code_ac_luminance;
-    } else {
-        ff_mjpeg_encode_dc(&s->pb, val, m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
-        huff_size_ac = m->huff_size_ac_chrominance;
-        huff_code_ac = m->huff_code_ac_chrominance;
-    }
-    s->last_dc[component] = dc;
-
-    /* AC coefs */
-
-    run = 0;
-    last_index = s->block_last_index[n];
-    for(i=1;i<=last_index;i++) {
-        j = s->intra_scantable.permutated[i];
-        val = block[j];
-        if (val == 0) {
-            run++;
-        } else {
-            while (run >= 16) {
-                put_bits(&s->pb, huff_size_ac[0xf0], huff_code_ac[0xf0]);
-                run -= 16;
-            }
-            mant = val;
-            if (val < 0) {
-                val = -val;
-                mant--;
-            }
-
-            nbits= av_log2(val) + 1;
-            code = (run << 4) | nbits;
-
-            put_bits(&s->pb, huff_size_ac[code], huff_code_ac[code]);
-
-            put_sbits(&s->pb, nbits, mant);
-            run = 0;
-        }
-    }
-
-    /* output EOB only if not already 64 values */
-    if (last_index < 63 || run != 0)
-        put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
-}
-
-void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64])
-{
-    int i;
-    for(i=0;i<5;i++) {
-        encode_block(s, block[i], i);
-    }
-    if (s->chroma_format == CHROMA_420) {
-        encode_block(s, block[5], 5);
-    } else {
-        encode_block(s, block[6], 6);
-        encode_block(s, block[5], 5);
-        encode_block(s, block[7], 7);
-    }
-
-    s->i_tex_bits += get_bits_diff(s);
-}
-
-AVCodec ff_mjpeg_encoder = {
-    .name           = "mjpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MJPEG,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/mjpegenc.h b/deps/libav/libavcodec/mjpegenc.h
deleted file mode 100644
index 2ad55f2..0000000
--- a/deps/libav/libavcodec/mjpegenc.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * MJPEG encoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003 Alex Beregszaszi
- * Copyright (c) 2003-2004 Michael Niedermayer
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- *                                  by Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MJPEG encoder.
- */
-
-#ifndef AVCODEC_MJPEGENC_H
-#define AVCODEC_MJPEGENC_H
-
-#include <stdint.h>
-
-#include "mpegvideo.h"
-
-typedef struct MJpegContext {
-    uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing
-    uint16_t huff_code_dc_luminance[12];
-    uint8_t huff_size_dc_chrominance[12];
-    uint16_t huff_code_dc_chrominance[12];
-
-    uint8_t huff_size_ac_luminance[256];
-    uint16_t huff_code_ac_luminance[256];
-    uint8_t huff_size_ac_chrominance[256];
-    uint16_t huff_code_ac_chrominance[256];
-} MJpegContext;
-
-int  ff_mjpeg_encode_init(MpegEncContext *s);
-void ff_mjpeg_encode_close(MpegEncContext *s);
-void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
-                                    ScanTable *intra_scantable,
-                                    uint16_t intra_matrix[64]);
-void ff_mjpeg_encode_picture_trailer(PutBitContext *pb, int header_bits);
-void ff_mjpeg_encode_stuffing(PutBitContext *pbc);
-void ff_mjpeg_encode_dc(PutBitContext *pb, int val,
-                        uint8_t *huff_size, uint16_t *huff_code);
-void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]);
-
-#endif /* AVCODEC_MJPEGENC_H */
diff --git a/deps/libav/libavcodec/mlp.c b/deps/libav/libavcodec/mlp.c
deleted file mode 100644
index 9615b66..0000000
--- a/deps/libav/libavcodec/mlp.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * MLP codec common code
- * Copyright (c) 2007-2008 Ian Caulfield
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/crc.h"
-#include "libavutil/intreadwrite.h"
-#include "mlp.h"
-
-const uint8_t ff_mlp_huffman_tables[3][18][2] = {
-    {    /* Huffman table 0, -7 - +10 */
-        {0x01, 9}, {0x01, 8}, {0x01, 7}, {0x01, 6}, {0x01, 5}, {0x01, 4}, {0x01, 3},
-        {0x04, 3}, {0x05, 3}, {0x06, 3}, {0x07, 3},
-        {0x03, 3}, {0x05, 4}, {0x09, 5}, {0x11, 6}, {0x21, 7}, {0x41, 8}, {0x81, 9},
-    }, { /* Huffman table 1, -7 - +8 */
-        {0x01, 9}, {0x01, 8}, {0x01, 7}, {0x01, 6}, {0x01, 5}, {0x01, 4}, {0x01, 3},
-        {0x02, 2}, {0x03, 2},
-        {0x03, 3}, {0x05, 4}, {0x09, 5}, {0x11, 6}, {0x21, 7}, {0x41, 8}, {0x81, 9},
-    }, { /* Huffman table 2, -7 - +7 */
-        {0x01, 9}, {0x01, 8}, {0x01, 7}, {0x01, 6}, {0x01, 5}, {0x01, 4}, {0x01, 3},
-        {0x01, 1},
-        {0x03, 3}, {0x05, 4}, {0x09, 5}, {0x11, 6}, {0x21, 7}, {0x41, 8}, {0x81, 9},
-    }
-};
-
-static int crc_init = 0;
-#if CONFIG_SMALL
-#define CRC_TABLE_SIZE 257
-#else
-#define CRC_TABLE_SIZE 1024
-#endif
-static AVCRC crc_63[CRC_TABLE_SIZE];
-static AVCRC crc_1D[CRC_TABLE_SIZE];
-static AVCRC crc_2D[CRC_TABLE_SIZE];
-
-av_cold void ff_mlp_init_crc(void)
-{
-    if (!crc_init) {
-        av_crc_init(crc_63, 0,  8,   0x63, sizeof(crc_63));
-        av_crc_init(crc_1D, 0,  8,   0x1D, sizeof(crc_1D));
-        av_crc_init(crc_2D, 0, 16, 0x002D, sizeof(crc_2D));
-        crc_init = 1;
-    }
-}
-
-uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size)
-{
-    uint16_t crc;
-
-    crc = av_crc(crc_2D, 0, buf, buf_size - 2);
-    crc ^= AV_RL16(buf + buf_size - 2);
-    return crc;
-}
-
-uint8_t ff_mlp_checksum8(const uint8_t *buf, unsigned int buf_size)
-{
-    uint8_t checksum = av_crc(crc_63, 0x3c, buf, buf_size - 1); // crc_63[0xa2] == 0x3c
-    checksum ^= buf[buf_size-1];
-    return checksum;
-}
-
-uint8_t ff_mlp_restart_checksum(const uint8_t *buf, unsigned int bit_size)
-{
-    int i;
-    int num_bytes = (bit_size + 2) / 8;
-
-    int crc = crc_1D[buf[0] & 0x3f];
-    crc = av_crc(crc_1D, crc, buf + 1, num_bytes - 2);
-    crc ^= buf[num_bytes - 1];
-
-    for (i = 0; i < ((bit_size + 2) & 7); i++) {
-        crc <<= 1;
-        if (crc & 0x100)
-            crc ^= 0x11D;
-        crc ^= (buf[num_bytes] >> (7 - i)) & 1;
-    }
-
-    return crc;
-}
-
-uint8_t ff_mlp_calculate_parity(const uint8_t *buf, unsigned int buf_size)
-{
-    uint32_t scratch = 0;
-    const uint8_t *buf_end = buf + buf_size;
-
-    for (; ((intptr_t) buf & 3) && buf < buf_end; buf++)
-        scratch ^= *buf;
-    for (; buf < buf_end - 3; buf += 4)
-        scratch ^= *((const uint32_t*)buf);
-
-    scratch = xor_32_to_8(scratch);
-
-    for (; buf < buf_end; buf++)
-        scratch ^= *buf;
-
-    return scratch;
-}
diff --git a/deps/libav/libavcodec/mlp.h b/deps/libav/libavcodec/mlp.h
deleted file mode 100644
index 5a4ee5f..0000000
--- a/deps/libav/libavcodec/mlp.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * MLP codec common header file
- * Copyright (c) 2007-2008 Ian Caulfield
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MLP_H
-#define AVCODEC_MLP_H
-
-#include <stdint.h>
-
-#include "avcodec.h"
-
-/** Last possible matrix channel for each codec */
-#define MAX_MATRIX_CHANNEL_MLP      5
-#define MAX_MATRIX_CHANNEL_TRUEHD   7
-/** Maximum number of channels in a valid stream.
- *  MLP   : 5.1 + 2 noise channels -> 8 channels
- *  TrueHD: 7.1                    -> 8 channels
- */
-#define MAX_CHANNELS                8
-
-/** Maximum number of matrices used in decoding; most streams have one matrix
- *  per output channel, but some rematrix a channel (usually 0) more than once.
- */
-#define MAX_MATRICES_MLP            6
-#define MAX_MATRICES_TRUEHD         8
-#define MAX_MATRICES                8
-
-/** Maximum number of substreams that can be decoded.
- *  MLP's limit is 2. TrueHD supports at least up to 3.
- */
-#define MAX_SUBSTREAMS      3
-
-/** which multiple of 48000 the maximum sample rate is */
-#define MAX_RATEFACTOR      4
-/** maximum sample frequency seen in files */
-#define MAX_SAMPLERATE      (MAX_RATEFACTOR * 48000)
-
-/** maximum number of audio samples within one access unit */
-#define MAX_BLOCKSIZE       (40 * MAX_RATEFACTOR)
-/** next power of two greater than MAX_BLOCKSIZE */
-#define MAX_BLOCKSIZE_POW2  (64 * MAX_RATEFACTOR)
-
-/** number of allowed filters */
-#define NUM_FILTERS         2
-
-/** The maximum number of taps in IIR and FIR filters. */
-#define MAX_FIR_ORDER       8
-#define MAX_IIR_ORDER       4
-
-/** Code that signals end of a stream. */
-#define END_OF_STREAM       0xd234d234
-
-#define FIR 0
-#define IIR 1
-
-/** filter data */
-typedef struct FilterParams {
-    uint8_t     order; ///< number of taps in filter
-    uint8_t     shift; ///< Right shift to apply to output of filter.
-
-    int32_t     state[MAX_FIR_ORDER];
-} FilterParams;
-
-/** sample data coding information */
-typedef struct ChannelParams {
-    FilterParams filter_params[NUM_FILTERS];
-    int32_t     coeff[NUM_FILTERS][MAX_FIR_ORDER];
-
-    int16_t     huff_offset;      ///< Offset to apply to residual values.
-    int32_t     sign_huff_offset; ///< sign/rounding-corrected version of huff_offset
-    uint8_t     codebook;         ///< Which VLC codebook to use to read residuals.
-    uint8_t     huff_lsbs;        ///< Size of residual suffix not encoded using VLC.
-} ChannelParams;
-
-/** Tables defining the Huffman codes.
- *  There are three entropy coding methods used in MLP (four if you count
- *  "none" as a method). These use the same sequences for codes starting with
- *  00 or 01, but have different codes starting with 1.
- */
-extern const uint8_t ff_mlp_huffman_tables[3][18][2];
-
-/** MLP uses checksums that seem to be based on the standard CRC algorithm, but
- *  are not (in implementation terms, the table lookup and XOR are reversed).
- *  We can implement this behavior using a standard av_crc on all but the
- *  last element, then XOR that with the last element.
- */
-uint8_t  ff_mlp_checksum8 (const uint8_t *buf, unsigned int buf_size);
-uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size);
-
-/** Calculate an 8-bit checksum over a restart header -- a non-multiple-of-8
- *  number of bits, starting two bits into the first byte of buf.
- */
-uint8_t ff_mlp_restart_checksum(const uint8_t *buf, unsigned int bit_size);
-
-/** XOR together all the bytes of a buffer.
- *  Does this belong in dspcontext?
- */
-uint8_t ff_mlp_calculate_parity(const uint8_t *buf, unsigned int buf_size);
-
-void ff_mlp_init_crc(void);
-
-/** XOR four bytes into one. */
-static inline uint8_t xor_32_to_8(uint32_t value)
-{
-    value ^= value >> 16;
-    value ^= value >>  8;
-    return value;
-}
-
-typedef enum THDChannelModifier {
-    THD_CH_MODIFIER_NOTINDICATED  = 0x0,
-    THD_CH_MODIFIER_STEREO        = 0x0, // Stereo (not Dolby Surround)
-    THD_CH_MODIFIER_LTRT          = 0x1, // Dolby Surround
-    THD_CH_MODIFIER_LBINRBIN      = 0x2, // Dolby Headphone
-    THD_CH_MODIFIER_MONO          = 0x3, // Mono or Dual Mono
-    THD_CH_MODIFIER_NOTSURROUNDEX = 0x1, // Not Dolby Digital EX
-    THD_CH_MODIFIER_SURROUNDEX    = 0x2, // Dolby Digital EX
-} THDChannelModifier;
-
-#endif /* AVCODEC_MLP_H */
diff --git a/deps/libav/libavcodec/mlp_parser.c b/deps/libav/libavcodec/mlp_parser.c
deleted file mode 100644
index 075227f..0000000
--- a/deps/libav/libavcodec/mlp_parser.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * MLP parser
- * Copyright (c) 2007 Ian Caulfield
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MLP parser
- */
-
-#include <stdint.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/crc.h"
-#include "libavutil/internal.h"
-#include "get_bits.h"
-#include "parser.h"
-#include "mlp_parser.h"
-#include "mlp.h"
-
-static const uint8_t mlp_quants[16] = {
-    16, 20, 24, 0, 0, 0, 0, 0,
-     0,  0,  0, 0, 0, 0, 0, 0,
-};
-
-static const uint8_t mlp_channels[32] = {
-    1, 2, 3, 4, 3, 4, 5, 3, 4, 5, 4, 5, 6, 4, 5, 4,
-    5, 6, 5, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const uint64_t mlp_layout[32] = {
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_2_1,
-    AV_CH_LAYOUT_2_2,
-    AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY,
-    AV_CH_LAYOUT_2_1|AV_CH_LOW_FREQUENCY,
-    AV_CH_LAYOUT_2_2|AV_CH_LOW_FREQUENCY,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_5POINT0,
-    AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
-    AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
-    AV_CH_LAYOUT_5POINT1,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_5POINT0,
-    AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
-    AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
-    AV_CH_LAYOUT_5POINT1,
-    AV_CH_LAYOUT_2_2|AV_CH_LOW_FREQUENCY,
-    AV_CH_LAYOUT_5POINT0,
-    AV_CH_LAYOUT_5POINT1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const uint8_t thd_chancount[13] = {
-//  LR    C   LFE  LRs LRvh  LRc LRrs  Cs   Ts  LRsd  LRw  Cvh  LFE2
-     2,   1,   1,   2,   2,   2,   2,   1,   1,   2,   2,   1,   1
-};
-
-static const uint64_t thd_layout[13] = {
-    AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT,                     // LR
-    AV_CH_FRONT_CENTER,                                     // C
-    AV_CH_LOW_FREQUENCY,                                    // LFE
-    AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,                       // LRs
-    AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT,             // LRvh
-    AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER, // LRc
-    AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT,                       // LRrs
-    AV_CH_BACK_CENTER,                                      // Cs
-    AV_CH_TOP_CENTER,                                       // Ts
-    AV_CH_SURROUND_DIRECT_LEFT|AV_CH_SURROUND_DIRECT_RIGHT, // LRsd
-    AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT,                       // LRw
-    AV_CH_TOP_FRONT_CENTER,                                 // Cvh
-    AV_CH_LOW_FREQUENCY_2,                                  // LFE2
-};
-
-static int mlp_samplerate(int in)
-{
-    if (in == 0xF)
-        return 0;
-
-    return (in & 8 ? 44100 : 48000) << (in & 7) ;
-}
-
-static int truehd_channels(int chanmap)
-{
-    int channels = 0, i;
-
-    for (i = 0; i < 13; i++)
-        channels += thd_chancount[i] * ((chanmap >> i) & 1);
-
-    return channels;
-}
-
-static uint64_t truehd_layout(int chanmap)
-{
-    int i;
-    uint64_t layout = 0;
-
-    for (i = 0; i < 13; i++)
-        layout |= thd_layout[i] * ((chanmap >> i) & 1);
-
-    return layout;
-}
-
-/** Read a major sync info header - contains high level information about
- *  the stream - sample rate, channel arrangement etc. Most of this
- *  information is not actually necessary for decoding, only for playback.
- *  gb must be a freshly initialized GetBitContext with no bits read.
- */
-
-int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
-{
-    int ratebits, channel_arrangement;
-    uint16_t checksum;
-
-    assert(get_bits_count(gb) == 0);
-
-    if (gb->size_in_bits < 28 << 3) {
-        av_log(log, AV_LOG_ERROR, "packet too short, unable to read major sync\n");
-        return -1;
-    }
-
-    checksum = ff_mlp_checksum16(gb->buffer, 26);
-    if (checksum != AV_RL16(gb->buffer+26)) {
-        av_log(log, AV_LOG_ERROR, "major sync info header checksum error\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (get_bits_long(gb, 24) != 0xf8726f) /* Sync words */
-        return AVERROR_INVALIDDATA;
-
-    mh->stream_type = get_bits(gb, 8);
-
-    if (mh->stream_type == 0xbb) {
-        mh->group1_bits = mlp_quants[get_bits(gb, 4)];
-        mh->group2_bits = mlp_quants[get_bits(gb, 4)];
-
-        ratebits = get_bits(gb, 4);
-        mh->group1_samplerate = mlp_samplerate(ratebits);
-        mh->group2_samplerate = mlp_samplerate(get_bits(gb, 4));
-
-        skip_bits(gb, 11);
-
-        channel_arrangement    = get_bits(gb, 5);
-        mh->channels_mlp       = mlp_channels[channel_arrangement];
-        mh->channel_layout_mlp = mlp_layout[channel_arrangement];
-    } else if (mh->stream_type == 0xba) {
-        mh->group1_bits = 24; // TODO: Is this information actually conveyed anywhere?
-        mh->group2_bits = 0;
-
-        ratebits = get_bits(gb, 4);
-        mh->group1_samplerate = mlp_samplerate(ratebits);
-        mh->group2_samplerate = 0;
-
-        skip_bits(gb, 4);
-
-        mh->channel_modifier_thd_stream0 = get_bits(gb, 2);
-        mh->channel_modifier_thd_stream1 = get_bits(gb, 2);
-
-        channel_arrangement            = get_bits(gb, 5);
-        mh->channels_thd_stream1       = truehd_channels(channel_arrangement);
-        mh->channel_layout_thd_stream1 = truehd_layout(channel_arrangement);
-
-        mh->channel_modifier_thd_stream2 = get_bits(gb, 2);
-
-        channel_arrangement            = get_bits(gb, 13);
-        mh->channels_thd_stream2       = truehd_channels(channel_arrangement);
-        mh->channel_layout_thd_stream2 = truehd_layout(channel_arrangement);
-    } else
-        return AVERROR_INVALIDDATA;
-
-    mh->access_unit_size = 40 << (ratebits & 7);
-    mh->access_unit_size_pow2 = 64 << (ratebits & 7);
-
-    skip_bits_long(gb, 48);
-
-    mh->is_vbr = get_bits1(gb);
-
-    mh->peak_bitrate = (get_bits(gb, 15) * mh->group1_samplerate + 8) >> 4;
-
-    mh->num_substreams = get_bits(gb, 4);
-
-    skip_bits_long(gb, 4 + 11 * 8);
-
-    return 0;
-}
-
-typedef struct MLPParseContext
-{
-    ParseContext pc;
-
-    int bytes_left;
-
-    int in_sync;
-
-    int num_substreams;
-} MLPParseContext;
-
-static av_cold int mlp_init(AVCodecParserContext *s)
-{
-    ff_mlp_init_crc();
-    return 0;
-}
-
-static int mlp_parse(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     const uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size)
-{
-    MLPParseContext *mp = s->priv_data;
-    int sync_present;
-    uint8_t parity_bits;
-    int next;
-    int i, p = 0;
-
-    *poutbuf_size = 0;
-    if (buf_size == 0)
-        return 0;
-
-    if (!mp->in_sync) {
-        // Not in sync - find a major sync header
-
-        for (i = 0; i < buf_size; i++) {
-            mp->pc.state = (mp->pc.state << 8) | buf[i];
-            if ((mp->pc.state & 0xfffffffe) == 0xf8726fba &&
-                // ignore if we do not have the data for the start of header
-                mp->pc.index + i >= 7) {
-                mp->in_sync = 1;
-                mp->bytes_left = 0;
-                break;
-            }
-        }
-
-        if (!mp->in_sync) {
-            ff_combine_frame(&mp->pc, END_NOT_FOUND, &buf, &buf_size);
-            return buf_size;
-        }
-
-        ff_combine_frame(&mp->pc, i - 7, &buf, &buf_size);
-
-        return i - 7;
-    }
-
-    if (mp->bytes_left == 0) {
-        // Find length of this packet
-
-        /* Copy overread bytes from last frame into buffer. */
-        for(; mp->pc.overread>0; mp->pc.overread--) {
-            mp->pc.buffer[mp->pc.index++]= mp->pc.buffer[mp->pc.overread_index++];
-        }
-
-        if (mp->pc.index + buf_size < 2) {
-            ff_combine_frame(&mp->pc, END_NOT_FOUND, &buf, &buf_size);
-            return buf_size;
-        }
-
-        mp->bytes_left = ((mp->pc.index > 0 ? mp->pc.buffer[0] : buf[0]) << 8)
-                       |  (mp->pc.index > 1 ? mp->pc.buffer[1] : buf[1-mp->pc.index]);
-        mp->bytes_left = (mp->bytes_left & 0xfff) * 2;
-        mp->bytes_left -= mp->pc.index;
-    }
-
-    next = (mp->bytes_left > buf_size) ? END_NOT_FOUND : mp->bytes_left;
-
-    if (ff_combine_frame(&mp->pc, next, &buf, &buf_size) < 0) {
-        mp->bytes_left -= buf_size;
-        return buf_size;
-    }
-
-    mp->bytes_left = 0;
-
-    sync_present = (AV_RB32(buf + 4) & 0xfffffffe) == 0xf8726fba;
-
-    if (!sync_present) {
-        /* The first nibble of a frame is a parity check of the 4-byte
-         * access unit header and all the 2- or 4-byte substream headers. */
-        // Only check when this isn't a sync frame - syncs have a checksum.
-
-        parity_bits = 0;
-        for (i = -1; i < mp->num_substreams; i++) {
-            parity_bits ^= buf[p++];
-            parity_bits ^= buf[p++];
-
-            if (i < 0 || buf[p-2] & 0x80) {
-                parity_bits ^= buf[p++];
-                parity_bits ^= buf[p++];
-            }
-        }
-
-        if ((((parity_bits >> 4) ^ parity_bits) & 0xF) != 0xF) {
-            av_log(avctx, AV_LOG_INFO, "mlpparse: Parity check failed.\n");
-            goto lost_sync;
-        }
-    } else {
-        GetBitContext gb;
-        MLPHeaderInfo mh;
-
-        init_get_bits(&gb, buf + 4, (buf_size - 4) << 3);
-        if (ff_mlp_read_major_sync(avctx, &mh, &gb) < 0)
-            goto lost_sync;
-
-        avctx->bits_per_raw_sample = mh.group1_bits;
-        if (avctx->bits_per_raw_sample > 16)
-            avctx->sample_fmt = AV_SAMPLE_FMT_S32;
-        else
-            avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-        avctx->sample_rate = mh.group1_samplerate;
-        s->duration = mh.access_unit_size;
-
-        if (mh.stream_type == 0xbb) {
-            /* MLP stream */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
-            if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
-                mh.num_substreams > 1) {
-                avctx->channels       = 2;
-                avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-            } else
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-            if (avctx->request_channel_layout &&
-                (avctx->request_channel_layout & AV_CH_LAYOUT_STEREO) ==
-                avctx->request_channel_layout &&
-                mh.num_substreams > 1) {
-                avctx->channels       = 2;
-                avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-            } else {
-                avctx->channels       = mh.channels_mlp;
-                avctx->channel_layout = mh.channel_layout_mlp;
-            }
-        } else { /* mh.stream_type == 0xba */
-            /* TrueHD stream */
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
-            if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
-                mh.num_substreams > 1) {
-                avctx->channels       = 2;
-                avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-            } else if (avctx->request_channels > 0 &&
-                       avctx->request_channels <= mh.channels_thd_stream1) {
-                avctx->channels       = mh.channels_thd_stream1;
-                avctx->channel_layout = mh.channel_layout_thd_stream1;
-            } else
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-                if (avctx->request_channel_layout &&
-                    (avctx->request_channel_layout & AV_CH_LAYOUT_STEREO) ==
-                    avctx->request_channel_layout &&
-                    mh.num_substreams > 1) {
-                avctx->channels       = 2;
-                avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-            } else if (!mh.channels_thd_stream2 ||
-                       (avctx->request_channel_layout &&
-                        (avctx->request_channel_layout & mh.channel_layout_thd_stream1) ==
-                        avctx->request_channel_layout)) {
-                avctx->channels       = mh.channels_thd_stream1;
-                avctx->channel_layout = mh.channel_layout_thd_stream1;
-            } else {
-                avctx->channels       = mh.channels_thd_stream2;
-                avctx->channel_layout = mh.channel_layout_thd_stream2;
-            }
-        }
-
-        if (!mh.is_vbr) /* Stream is CBR */
-            avctx->bit_rate = mh.peak_bitrate;
-
-        mp->num_substreams = mh.num_substreams;
-    }
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-
-    return next;
-
-lost_sync:
-    mp->in_sync = 0;
-    return 1;
-}
-
-AVCodecParser ff_mlp_parser = {
-    .codec_ids      = { AV_CODEC_ID_MLP, AV_CODEC_ID_TRUEHD },
-    .priv_data_size = sizeof(MLPParseContext),
-    .parser_init    = mlp_init,
-    .parser_parse   = mlp_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/mlp_parser.h b/deps/libav/libavcodec/mlp_parser.h
deleted file mode 100644
index 7530fac..0000000
--- a/deps/libav/libavcodec/mlp_parser.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * MLP parser prototypes
- * Copyright (c) 2007 Ian Caulfield
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MLP parser prototypes
- */
-
-#ifndef AVCODEC_MLP_PARSER_H
-#define AVCODEC_MLP_PARSER_H
-
-#include "get_bits.h"
-
-typedef struct MLPHeaderInfo
-{
-    int stream_type;                        ///< 0xBB for MLP, 0xBA for TrueHD
-
-    int group1_bits;                        ///< The bit depth of the first substream
-    int group2_bits;                        ///< Bit depth of the second substream (MLP only)
-
-    int group1_samplerate;                  ///< Sample rate of first substream
-    int group2_samplerate;                  ///< Sample rate of second substream (MLP only)
-
-    int channel_modifier_thd_stream0;       ///< Channel modifier for substream 0 of TrueHD sreams ("2-channel presentation")
-    int channel_modifier_thd_stream1;       ///< Channel modifier for substream 1 of TrueHD sreams ("6-channel presentation")
-    int channel_modifier_thd_stream2;       ///< Channel modifier for substream 2 of TrueHD sreams ("8-channel presentation")
-
-    int channels_mlp;                       ///< Channel count for MLP streams
-    int channels_thd_stream1;               ///< Channel count for substream 1 of TrueHD streams ("6-channel presentation")
-    int channels_thd_stream2;               ///< Channel count for substream 2 of TrueHD streams ("8-channel presentation")
-    uint64_t channel_layout_mlp;            ///< Channel layout for MLP streams
-    uint64_t channel_layout_thd_stream1;    ///< Channel layout for substream 1 of TrueHD streams ("6-channel presentation")
-    uint64_t channel_layout_thd_stream2;    ///< Channel layout for substream 2 of TrueHD streams ("8-channel presentation")
-
-    int access_unit_size;                   ///< Number of samples per coded frame
-    int access_unit_size_pow2;              ///< Next power of two above number of samples per frame
-
-    int is_vbr;                             ///< Stream is VBR instead of CBR
-    int peak_bitrate;                       ///< Peak bitrate for VBR, actual bitrate (==peak) for CBR
-
-    int num_substreams;                     ///< Number of substreams within stream
-} MLPHeaderInfo;
-
-
-int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb);
-
-#endif /* AVCODEC_MLP_PARSER_H */
diff --git a/deps/libav/libavcodec/mlpdec.c b/deps/libav/libavcodec/mlpdec.c
deleted file mode 100644
index ed5a6ac..0000000
--- a/deps/libav/libavcodec/mlpdec.c
+++ /dev/null
@@ -1,1295 +0,0 @@
-/*
- * MLP decoder
- * Copyright (c) 2007-2008 Ian Caulfield
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MLP decoder
- */
-
-#include <stdint.h>
-
-#include "avcodec.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/channel_layout.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "libavutil/crc.h"
-#include "parser.h"
-#include "mlp_parser.h"
-#include "mlpdsp.h"
-#include "mlp.h"
-
-/** number of bits used for VLC lookup - longest Huffman code is 9 */
-#define VLC_BITS            9
-
-typedef struct SubStream {
-    /// Set if a valid restart header has been read. Otherwise the substream cannot be decoded.
-    uint8_t     restart_seen;
-
-    //@{
-    /** restart header data */
-    /// The type of noise to be used in the rematrix stage.
-    uint16_t    noise_type;
-
-    /// The index of the first channel coded in this substream.
-    uint8_t     min_channel;
-    /// The index of the last channel coded in this substream.
-    uint8_t     max_channel;
-    /// The number of channels input into the rematrix stage.
-    uint8_t     max_matrix_channel;
-    /// For each channel output by the matrix, the output channel to map it to
-    uint8_t     ch_assign[MAX_CHANNELS];
-    /// The channel layout for this substream
-    uint64_t    ch_layout;
-    /// The matrix encoding mode for this substream
-    enum AVMatrixEncoding matrix_encoding;
-
-    /// Channel coding parameters for channels in the substream
-    ChannelParams channel_params[MAX_CHANNELS];
-
-    /// The left shift applied to random noise in 0x31ea substreams.
-    uint8_t     noise_shift;
-    /// The current seed value for the pseudorandom noise generator(s).
-    uint32_t    noisegen_seed;
-
-    /// Set if the substream contains extra info to check the size of VLC blocks.
-    uint8_t     data_check_present;
-
-    /// Bitmask of which parameter sets are conveyed in a decoding parameter block.
-    uint8_t     param_presence_flags;
-#define PARAM_BLOCKSIZE     (1 << 7)
-#define PARAM_MATRIX        (1 << 6)
-#define PARAM_OUTSHIFT      (1 << 5)
-#define PARAM_QUANTSTEP     (1 << 4)
-#define PARAM_FIR           (1 << 3)
-#define PARAM_IIR           (1 << 2)
-#define PARAM_HUFFOFFSET    (1 << 1)
-#define PARAM_PRESENCE      (1 << 0)
-    //@}
-
-    //@{
-    /** matrix data */
-
-    /// Number of matrices to be applied.
-    uint8_t     num_primitive_matrices;
-
-    /// matrix output channel
-    uint8_t     matrix_out_ch[MAX_MATRICES];
-
-    /// Whether the LSBs of the matrix output are encoded in the bitstream.
-    uint8_t     lsb_bypass[MAX_MATRICES];
-    /// Matrix coefficients, stored as 2.14 fixed point.
-    int32_t     matrix_coeff[MAX_MATRICES][MAX_CHANNELS];
-    /// Left shift to apply to noise values in 0x31eb substreams.
-    uint8_t     matrix_noise_shift[MAX_MATRICES];
-    //@}
-
-    /// Left shift to apply to Huffman-decoded residuals.
-    uint8_t     quant_step_size[MAX_CHANNELS];
-
-    /// number of PCM samples in current audio block
-    uint16_t    blocksize;
-    /// Number of PCM samples decoded so far in this frame.
-    uint16_t    blockpos;
-
-    /// Left shift to apply to decoded PCM values to get final 24-bit output.
-    int8_t      output_shift[MAX_CHANNELS];
-
-    /// Running XOR of all output samples.
-    int32_t     lossless_check_data;
-
-} SubStream;
-
-typedef struct MLPDecodeContext {
-    AVCodecContext *avctx;
-
-    /// Current access unit being read has a major sync.
-    int         is_major_sync_unit;
-
-    /// Set if a valid major sync block has been read. Otherwise no decoding is possible.
-    uint8_t     params_valid;
-
-    /// Number of substreams contained within this stream.
-    uint8_t     num_substreams;
-
-    /// Index of the last substream to decode - further substreams are skipped.
-    uint8_t     max_decoded_substream;
-
-    /// number of PCM samples contained in each frame
-    int         access_unit_size;
-    /// next power of two above the number of samples in each frame
-    int         access_unit_size_pow2;
-
-    SubStream   substream[MAX_SUBSTREAMS];
-
-    int         matrix_changed;
-    int         filter_changed[MAX_CHANNELS][NUM_FILTERS];
-
-    int8_t      noise_buffer[MAX_BLOCKSIZE_POW2];
-    int8_t      bypassed_lsbs[MAX_BLOCKSIZE][MAX_CHANNELS];
-    int32_t     sample_buffer[MAX_BLOCKSIZE][MAX_CHANNELS];
-
-    MLPDSPContext dsp;
-} MLPDecodeContext;
-
-static const uint64_t thd_channel_order[] = {
-    AV_CH_FRONT_LEFT, AV_CH_FRONT_RIGHT,                     // LR
-    AV_CH_FRONT_CENTER,                                      // C
-    AV_CH_LOW_FREQUENCY,                                     // LFE
-    AV_CH_SIDE_LEFT, AV_CH_SIDE_RIGHT,                       // LRs
-    AV_CH_TOP_FRONT_LEFT, AV_CH_TOP_FRONT_RIGHT,             // LRvh
-    AV_CH_FRONT_LEFT_OF_CENTER, AV_CH_FRONT_RIGHT_OF_CENTER, // LRc
-    AV_CH_BACK_LEFT, AV_CH_BACK_RIGHT,                       // LRrs
-    AV_CH_BACK_CENTER,                                       // Cs
-    AV_CH_TOP_CENTER,                                        // Ts
-    AV_CH_SURROUND_DIRECT_LEFT, AV_CH_SURROUND_DIRECT_RIGHT, // LRsd
-    AV_CH_WIDE_LEFT, AV_CH_WIDE_RIGHT,                       // LRw
-    AV_CH_TOP_FRONT_CENTER,                                  // Cvh
-    AV_CH_LOW_FREQUENCY_2,                                   // LFE2
-};
-
-static uint64_t thd_channel_layout_extract_channel(uint64_t channel_layout,
-                                                   int index)
-{
-    int i;
-
-    if (av_get_channel_layout_nb_channels(channel_layout) <= index)
-        return 0;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(thd_channel_order); i++)
-        if (channel_layout & thd_channel_order[i] && !index--)
-            return thd_channel_order[i];
-    return 0;
-}
-
-static VLC huff_vlc[3];
-
-/** Initialize static data, constant between all invocations of the codec. */
-
-static av_cold void init_static(void)
-{
-    if (!huff_vlc[0].bits) {
-        INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,
-                    &ff_mlp_huffman_tables[0][0][1], 2, 1,
-                    &ff_mlp_huffman_tables[0][0][0], 2, 1, 512);
-        INIT_VLC_STATIC(&huff_vlc[1], VLC_BITS, 16,
-                    &ff_mlp_huffman_tables[1][0][1], 2, 1,
-                    &ff_mlp_huffman_tables[1][0][0], 2, 1, 512);
-        INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,
-                    &ff_mlp_huffman_tables[2][0][1], 2, 1,
-                    &ff_mlp_huffman_tables[2][0][0], 2, 1, 512);
-    }
-
-    ff_mlp_init_crc();
-}
-
-static inline int32_t calculate_sign_huff(MLPDecodeContext *m,
-                                          unsigned int substr, unsigned int ch)
-{
-    SubStream *s = &m->substream[substr];
-    ChannelParams *cp = &s->channel_params[ch];
-    int lsb_bits = cp->huff_lsbs - s->quant_step_size[ch];
-    int sign_shift = lsb_bits + (cp->codebook ? 2 - cp->codebook : -1);
-    int32_t sign_huff_offset = cp->huff_offset;
-
-    if (cp->codebook > 0)
-        sign_huff_offset -= 7 << lsb_bits;
-
-    if (sign_shift >= 0)
-        sign_huff_offset -= 1 << sign_shift;
-
-    return sign_huff_offset;
-}
-
-/** Read a sample, consisting of either, both or neither of entropy-coded MSBs
- *  and plain LSBs. */
-
-static inline int read_huff_channels(MLPDecodeContext *m, GetBitContext *gbp,
-                                     unsigned int substr, unsigned int pos)
-{
-    SubStream *s = &m->substream[substr];
-    unsigned int mat, channel;
-
-    for (mat = 0; mat < s->num_primitive_matrices; mat++)
-        if (s->lsb_bypass[mat])
-            m->bypassed_lsbs[pos + s->blockpos][mat] = get_bits1(gbp);
-
-    for (channel = s->min_channel; channel <= s->max_channel; channel++) {
-        ChannelParams *cp = &s->channel_params[channel];
-        int codebook = cp->codebook;
-        int quant_step_size = s->quant_step_size[channel];
-        int lsb_bits = cp->huff_lsbs - quant_step_size;
-        int result = 0;
-
-        if (codebook > 0)
-            result = get_vlc2(gbp, huff_vlc[codebook-1].table,
-                            VLC_BITS, (9 + VLC_BITS - 1) / VLC_BITS);
-
-        if (result < 0)
-            return AVERROR_INVALIDDATA;
-
-        if (lsb_bits > 0)
-            result = (result << lsb_bits) + get_bits(gbp, lsb_bits);
-
-        result  += cp->sign_huff_offset;
-        result <<= quant_step_size;
-
-        m->sample_buffer[pos + s->blockpos][channel] = result;
-    }
-
-    return 0;
-}
-
-static av_cold int mlp_decode_init(AVCodecContext *avctx)
-{
-    MLPDecodeContext *m = avctx->priv_data;
-    int substr;
-
-    init_static();
-    m->avctx = avctx;
-    for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
-        m->substream[substr].lossless_check_data = 0xffffffff;
-    ff_mlpdsp_init(&m->dsp);
-
-    return 0;
-}
-
-/** Read a major sync info header - contains high level information about
- *  the stream - sample rate, channel arrangement etc. Most of this
- *  information is not actually necessary for decoding, only for playback.
- */
-
-static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
-{
-    MLPHeaderInfo mh;
-    int substr, ret;
-
-    if ((ret = ff_mlp_read_major_sync(m->avctx, &mh, gb)) != 0)
-        return ret;
-
-    if (mh.group1_bits == 0) {
-        av_log(m->avctx, AV_LOG_ERROR, "invalid/unknown bits per sample\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (mh.group2_bits > mh.group1_bits) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "Channel group 2 cannot have more bits per sample than group 1.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (mh.group2_samplerate && mh.group2_samplerate != mh.group1_samplerate) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "Channel groups with differing sample rates are not currently supported.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (mh.group1_samplerate == 0) {
-        av_log(m->avctx, AV_LOG_ERROR, "invalid/unknown sampling rate\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (mh.group1_samplerate > MAX_SAMPLERATE) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "Sampling rate %d is greater than the supported maximum (%d).\n",
-               mh.group1_samplerate, MAX_SAMPLERATE);
-        return AVERROR_INVALIDDATA;
-    }
-    if (mh.access_unit_size > MAX_BLOCKSIZE) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "Block size %d is greater than the supported maximum (%d).\n",
-               mh.access_unit_size, MAX_BLOCKSIZE);
-        return AVERROR_INVALIDDATA;
-    }
-    if (mh.access_unit_size_pow2 > MAX_BLOCKSIZE_POW2) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "Block size pow2 %d is greater than the supported maximum (%d).\n",
-               mh.access_unit_size_pow2, MAX_BLOCKSIZE_POW2);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (mh.num_substreams == 0)
-        return AVERROR_INVALIDDATA;
-    if (m->avctx->codec_id == AV_CODEC_ID_MLP && mh.num_substreams > 2) {
-        av_log(m->avctx, AV_LOG_ERROR, "MLP only supports up to 2 substreams.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (mh.num_substreams > MAX_SUBSTREAMS) {
-        avpriv_request_sample(m->avctx,
-                              "%d substreams (more than the "
-                              "maximum supported by the decoder)",
-                              mh.num_substreams);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    m->access_unit_size      = mh.access_unit_size;
-    m->access_unit_size_pow2 = mh.access_unit_size_pow2;
-
-    m->num_substreams        = mh.num_substreams;
-    m->max_decoded_substream = m->num_substreams - 1;
-
-    m->avctx->sample_rate    = mh.group1_samplerate;
-    m->avctx->frame_size     = mh.access_unit_size;
-
-    m->avctx->bits_per_raw_sample = mh.group1_bits;
-    if (mh.group1_bits > 16)
-        m->avctx->sample_fmt = AV_SAMPLE_FMT_S32;
-    else
-        m->avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-
-    m->params_valid = 1;
-    for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
-        m->substream[substr].restart_seen = 0;
-
-    /* Set the layout for each substream. When there's more than one, the first
-     * substream is Stereo. Subsequent substreams' layouts are indicated in the
-     * major sync. */
-    if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
-        if ((substr = (mh.num_substreams > 1)))
-            m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
-        m->substream[substr].ch_layout = mh.channel_layout_mlp;
-    } else {
-        if ((substr = (mh.num_substreams > 1)))
-            m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
-        if (mh.num_substreams > 2)
-            if (mh.channel_layout_thd_stream2)
-                m->substream[2].ch_layout = mh.channel_layout_thd_stream2;
-            else
-                m->substream[2].ch_layout = mh.channel_layout_thd_stream1;
-        m->substream[substr].ch_layout = mh.channel_layout_thd_stream1;
-    }
-
-    /* Parse the TrueHD decoder channel modifiers and set each substream's
-     * AVMatrixEncoding accordingly.
-     *
-     * The meaning of the modifiers depends on the channel layout:
-     *
-     * - THD_CH_MODIFIER_LTRT, THD_CH_MODIFIER_LBINRBIN only apply to 2-channel
-     *
-     * - THD_CH_MODIFIER_MONO applies to 1-channel or 2-channel (dual mono)
-     *
-     * - THD_CH_MODIFIER_SURROUNDEX, THD_CH_MODIFIER_NOTSURROUNDEX only apply to
-     *   layouts with an Ls/Rs channel pair
-     */
-    for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
-        m->substream[substr].matrix_encoding = AV_MATRIX_ENCODING_NONE;
-    if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
-        if (mh.num_substreams > 2 &&
-            mh.channel_layout_thd_stream2 & AV_CH_SIDE_LEFT &&
-            mh.channel_layout_thd_stream2 & AV_CH_SIDE_RIGHT &&
-            mh.channel_modifier_thd_stream2 == THD_CH_MODIFIER_SURROUNDEX)
-            m->substream[2].matrix_encoding = AV_MATRIX_ENCODING_DOLBYEX;
-
-        if (mh.num_substreams > 1 &&
-            mh.channel_layout_thd_stream1 & AV_CH_SIDE_LEFT &&
-            mh.channel_layout_thd_stream1 & AV_CH_SIDE_RIGHT &&
-            mh.channel_modifier_thd_stream1 == THD_CH_MODIFIER_SURROUNDEX)
-            m->substream[1].matrix_encoding = AV_MATRIX_ENCODING_DOLBYEX;
-
-        if (mh.num_substreams > 0)
-            switch (mh.channel_modifier_thd_stream0) {
-            case THD_CH_MODIFIER_LTRT:
-                m->substream[0].matrix_encoding = AV_MATRIX_ENCODING_DOLBY;
-                break;
-            case THD_CH_MODIFIER_LBINRBIN:
-                m->substream[0].matrix_encoding = AV_MATRIX_ENCODING_DOLBYHEADPHONE;
-                break;
-            default:
-                break;
-            }
-    }
-
-    return 0;
-}
-
-/** Read a restart header from a block in a substream. This contains parameters
- *  required to decode the audio that do not change very often. Generally
- *  (always) present only in blocks following a major sync. */
-
-static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
-                               const uint8_t *buf, unsigned int substr)
-{
-    SubStream *s = &m->substream[substr];
-    unsigned int ch;
-    int sync_word, tmp;
-    uint8_t checksum;
-    uint8_t lossless_check;
-    int start_count = get_bits_count(gbp);
-    int min_channel, max_channel, max_matrix_channel;
-    const int std_max_matrix_channel = m->avctx->codec_id == AV_CODEC_ID_MLP
-                                     ? MAX_MATRIX_CHANNEL_MLP
-                                     : MAX_MATRIX_CHANNEL_TRUEHD;
-
-    sync_word = get_bits(gbp, 13);
-
-    if (sync_word != 0x31ea >> 1) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "restart header sync incorrect (got 0x%04x)\n", sync_word);
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->noise_type = get_bits1(gbp);
-
-    if (m->avctx->codec_id == AV_CODEC_ID_MLP && s->noise_type) {
-        av_log(m->avctx, AV_LOG_ERROR, "MLP must have 0x31ea sync word.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    skip_bits(gbp, 16); /* Output timestamp */
-
-    min_channel        = get_bits(gbp, 4);
-    max_channel        = get_bits(gbp, 4);
-    max_matrix_channel = get_bits(gbp, 4);
-
-    if (max_matrix_channel > std_max_matrix_channel) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "Max matrix channel cannot be greater than %d.\n",
-               max_matrix_channel);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (max_channel != max_matrix_channel) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "Max channel must be equal max matrix channel.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* This should happen for TrueHD streams with >6 channels and MLP's noise
-     * type. It is not yet known if this is allowed. */
-    if (s->max_channel > MAX_MATRIX_CHANNEL_MLP && !s->noise_type) {
-        avpriv_request_sample(m->avctx,
-                              "%d channels (more than the "
-                              "maximum supported by the decoder)",
-                              s->max_channel + 2);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (min_channel > max_channel) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "Substream min channel cannot be greater than max channel.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->min_channel        = min_channel;
-    s->max_channel        = max_channel;
-    s->max_matrix_channel = max_matrix_channel;
-
-#if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
-    if (m->avctx->request_channels > 0 &&
-        m->avctx->request_channels <= s->max_channel + 1 &&
-        m->max_decoded_substream > substr) {
-        av_log(m->avctx, AV_LOG_DEBUG,
-               "Extracting %d-channel downmix from substream %d. "
-               "Further substreams will be skipped.\n",
-               s->max_channel + 1, substr);
-        m->max_decoded_substream = substr;
-    } else
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-    if (m->avctx->request_channel_layout && (s->ch_layout & m->avctx->request_channel_layout) ==
-        m->avctx->request_channel_layout && m->max_decoded_substream > substr) {
-        av_log(m->avctx, AV_LOG_DEBUG,
-               "Extracting %d-channel downmix (0x%"PRIx64") from substream %d. "
-               "Further substreams will be skipped.\n",
-               s->max_channel + 1, s->ch_layout, substr);
-        m->max_decoded_substream = substr;
-    }
-
-    s->noise_shift   = get_bits(gbp,  4);
-    s->noisegen_seed = get_bits(gbp, 23);
-
-    skip_bits(gbp, 19);
-
-    s->data_check_present = get_bits1(gbp);
-    lossless_check = get_bits(gbp, 8);
-    if (substr == m->max_decoded_substream
-        && s->lossless_check_data != 0xffffffff) {
-        tmp = xor_32_to_8(s->lossless_check_data);
-        if (tmp != lossless_check)
-            av_log(m->avctx, AV_LOG_WARNING,
-                   "Lossless check failed - expected %02x, calculated %02x.\n",
-                   lossless_check, tmp);
-    }
-
-    skip_bits(gbp, 16);
-
-    memset(s->ch_assign, 0, sizeof(s->ch_assign));
-
-    for (ch = 0; ch <= s->max_matrix_channel; ch++) {
-        int ch_assign = get_bits(gbp, 6);
-        if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
-            uint64_t channel = thd_channel_layout_extract_channel(s->ch_layout,
-                                                                  ch_assign);
-            ch_assign = av_get_channel_layout_channel_index(s->ch_layout,
-                                                            channel);
-        }
-        if (ch_assign > s->max_matrix_channel) {
-            avpriv_request_sample(m->avctx,
-                                  "Assignment of matrix channel %d to invalid output channel %d",
-                                  ch, ch_assign);
-            return AVERROR_PATCHWELCOME;
-        }
-        s->ch_assign[ch_assign] = ch;
-    }
-
-    checksum = ff_mlp_restart_checksum(buf, get_bits_count(gbp) - start_count);
-
-    if (checksum != get_bits(gbp, 8))
-        av_log(m->avctx, AV_LOG_ERROR, "restart header checksum error\n");
-
-    /* Set default decoding parameters. */
-    s->param_presence_flags   = 0xff;
-    s->num_primitive_matrices = 0;
-    s->blocksize              = 8;
-    s->lossless_check_data    = 0;
-
-    memset(s->output_shift   , 0, sizeof(s->output_shift   ));
-    memset(s->quant_step_size, 0, sizeof(s->quant_step_size));
-
-    for (ch = s->min_channel; ch <= s->max_channel; ch++) {
-        ChannelParams *cp = &s->channel_params[ch];
-        cp->filter_params[FIR].order = 0;
-        cp->filter_params[IIR].order = 0;
-        cp->filter_params[FIR].shift = 0;
-        cp->filter_params[IIR].shift = 0;
-
-        /* Default audio coding is 24-bit raw PCM. */
-        cp->huff_offset      = 0;
-        cp->sign_huff_offset = (-1) << 23;
-        cp->codebook         = 0;
-        cp->huff_lsbs        = 24;
-    }
-
-    if (substr == m->max_decoded_substream) {
-        m->avctx->channels       = s->max_matrix_channel + 1;
-        m->avctx->channel_layout = s->ch_layout;
-    }
-
-    return 0;
-}
-
-/** Read parameters for one of the prediction filters. */
-
-static int read_filter_params(MLPDecodeContext *m, GetBitContext *gbp,
-                              unsigned int substr, unsigned int channel,
-                              unsigned int filter)
-{
-    SubStream *s = &m->substream[substr];
-    FilterParams *fp = &s->channel_params[channel].filter_params[filter];
-    const int max_order = filter ? MAX_IIR_ORDER : MAX_FIR_ORDER;
-    const char fchar = filter ? 'I' : 'F';
-    int i, order;
-
-    // Filter is 0 for FIR, 1 for IIR.
-    assert(filter < 2);
-
-    if (m->filter_changed[channel][filter]++ > 1) {
-        av_log(m->avctx, AV_LOG_ERROR, "Filters may change only once per access unit.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    order = get_bits(gbp, 4);
-    if (order > max_order) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "%cIR filter order %d is greater than maximum %d.\n",
-               fchar, order, max_order);
-        return AVERROR_INVALIDDATA;
-    }
-    fp->order = order;
-
-    if (order > 0) {
-        int32_t *fcoeff = s->channel_params[channel].coeff[filter];
-        int coeff_bits, coeff_shift;
-
-        fp->shift = get_bits(gbp, 4);
-
-        coeff_bits  = get_bits(gbp, 5);
-        coeff_shift = get_bits(gbp, 3);
-        if (coeff_bits < 1 || coeff_bits > 16) {
-            av_log(m->avctx, AV_LOG_ERROR,
-                   "%cIR filter coeff_bits must be between 1 and 16.\n",
-                   fchar);
-            return AVERROR_INVALIDDATA;
-        }
-        if (coeff_bits + coeff_shift > 16) {
-            av_log(m->avctx, AV_LOG_ERROR,
-                   "Sum of coeff_bits and coeff_shift for %cIR filter must be 16 or less.\n",
-                   fchar);
-            return AVERROR_INVALIDDATA;
-        }
-
-        for (i = 0; i < order; i++)
-            fcoeff[i] = get_sbits(gbp, coeff_bits) << coeff_shift;
-
-        if (get_bits1(gbp)) {
-            int state_bits, state_shift;
-
-            if (filter == FIR) {
-                av_log(m->avctx, AV_LOG_ERROR,
-                       "FIR filter has state data specified.\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            state_bits  = get_bits(gbp, 4);
-            state_shift = get_bits(gbp, 4);
-
-            /* TODO: Check validity of state data. */
-
-            for (i = 0; i < order; i++)
-                fp->state[i] = get_sbits(gbp, state_bits) << state_shift;
-        }
-    }
-
-    return 0;
-}
-
-/** Read parameters for primitive matrices. */
-
-static int read_matrix_params(MLPDecodeContext *m, unsigned int substr, GetBitContext *gbp)
-{
-    SubStream *s = &m->substream[substr];
-    unsigned int mat, ch;
-    const int max_primitive_matrices = m->avctx->codec_id == AV_CODEC_ID_MLP
-                                     ? MAX_MATRICES_MLP
-                                     : MAX_MATRICES_TRUEHD;
-
-    if (m->matrix_changed++ > 1) {
-        av_log(m->avctx, AV_LOG_ERROR, "Matrices may change only once per access unit.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->num_primitive_matrices = get_bits(gbp, 4);
-
-    if (s->num_primitive_matrices > max_primitive_matrices) {
-        av_log(m->avctx, AV_LOG_ERROR,
-               "Number of primitive matrices cannot be greater than %d.\n",
-               max_primitive_matrices);
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (mat = 0; mat < s->num_primitive_matrices; mat++) {
-        int frac_bits, max_chan;
-        s->matrix_out_ch[mat] = get_bits(gbp, 4);
-        frac_bits             = get_bits(gbp, 4);
-        s->lsb_bypass   [mat] = get_bits1(gbp);
-
-        if (s->matrix_out_ch[mat] > s->max_matrix_channel) {
-            av_log(m->avctx, AV_LOG_ERROR,
-                    "Invalid channel %d specified as output from matrix.\n",
-                    s->matrix_out_ch[mat]);
-            return AVERROR_INVALIDDATA;
-        }
-        if (frac_bits > 14) {
-            av_log(m->avctx, AV_LOG_ERROR,
-                    "Too many fractional bits specified.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        max_chan = s->max_matrix_channel;
-        if (!s->noise_type)
-            max_chan+=2;
-
-        for (ch = 0; ch <= max_chan; ch++) {
-            int coeff_val = 0;
-            if (get_bits1(gbp))
-                coeff_val = get_sbits(gbp, frac_bits + 2);
-
-            s->matrix_coeff[mat][ch] = coeff_val << (14 - frac_bits);
-        }
-
-        if (s->noise_type)
-            s->matrix_noise_shift[mat] = get_bits(gbp, 4);
-        else
-            s->matrix_noise_shift[mat] = 0;
-    }
-
-    return 0;
-}
-
-/** Read channel parameters. */
-
-static int read_channel_params(MLPDecodeContext *m, unsigned int substr,
-                               GetBitContext *gbp, unsigned int ch)
-{
-    SubStream *s = &m->substream[substr];
-    ChannelParams *cp = &s->channel_params[ch];
-    FilterParams *fir = &cp->filter_params[FIR];
-    FilterParams *iir = &cp->filter_params[IIR];
-    int ret;
-
-    if (s->param_presence_flags & PARAM_FIR)
-        if (get_bits1(gbp))
-            if ((ret = read_filter_params(m, gbp, substr, ch, FIR)) < 0)
-                return ret;
-
-    if (s->param_presence_flags & PARAM_IIR)
-        if (get_bits1(gbp))
-            if ((ret = read_filter_params(m, gbp, substr, ch, IIR)) < 0)
-                return ret;
-
-    if (fir->order + iir->order > 8) {
-        av_log(m->avctx, AV_LOG_ERROR, "Total filter orders too high.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (fir->order && iir->order &&
-        fir->shift != iir->shift) {
-        av_log(m->avctx, AV_LOG_ERROR,
-                "FIR and IIR filters must use the same precision.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    /* The FIR and IIR filters must have the same precision.
-     * To simplify the filtering code, only the precision of the
-     * FIR filter is considered. If only the IIR filter is employed,
-     * the FIR filter precision is set to that of the IIR filter, so
-     * that the filtering code can use it. */
-    if (!fir->order && iir->order)
-        fir->shift = iir->shift;
-
-    if (s->param_presence_flags & PARAM_HUFFOFFSET)
-        if (get_bits1(gbp))
-            cp->huff_offset = get_sbits(gbp, 15);
-
-    cp->codebook  = get_bits(gbp, 2);
-    cp->huff_lsbs = get_bits(gbp, 5);
-
-    if (cp->huff_lsbs > 24) {
-        av_log(m->avctx, AV_LOG_ERROR, "Invalid huff_lsbs.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    cp->sign_huff_offset = calculate_sign_huff(m, substr, ch);
-
-    return 0;
-}
-
-/** Read decoding parameters that change more often than those in the restart
- *  header. */
-
-static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,
-                                unsigned int substr)
-{
-    SubStream *s = &m->substream[substr];
-    unsigned int ch;
-    int ret;
-
-    if (s->param_presence_flags & PARAM_PRESENCE)
-        if (get_bits1(gbp))
-            s->param_presence_flags = get_bits(gbp, 8);
-
-    if (s->param_presence_flags & PARAM_BLOCKSIZE)
-        if (get_bits1(gbp)) {
-            s->blocksize = get_bits(gbp, 9);
-            if (s->blocksize < 8 || s->blocksize > m->access_unit_size) {
-                av_log(m->avctx, AV_LOG_ERROR, "Invalid blocksize.");
-                s->blocksize = 0;
-                return AVERROR_INVALIDDATA;
-            }
-        }
-
-    if (s->param_presence_flags & PARAM_MATRIX)
-        if (get_bits1(gbp))
-            if ((ret = read_matrix_params(m, substr, gbp)) < 0)
-                return ret;
-
-    if (s->param_presence_flags & PARAM_OUTSHIFT)
-        if (get_bits1(gbp))
-            for (ch = 0; ch <= s->max_matrix_channel; ch++)
-                s->output_shift[ch] = get_sbits(gbp, 4);
-
-    if (s->param_presence_flags & PARAM_QUANTSTEP)
-        if (get_bits1(gbp))
-            for (ch = 0; ch <= s->max_channel; ch++) {
-                ChannelParams *cp = &s->channel_params[ch];
-
-                s->quant_step_size[ch] = get_bits(gbp, 4);
-
-                cp->sign_huff_offset = calculate_sign_huff(m, substr, ch);
-            }
-
-    for (ch = s->min_channel; ch <= s->max_channel; ch++)
-        if (get_bits1(gbp))
-            if ((ret = read_channel_params(m, substr, gbp, ch)) < 0)
-                return ret;
-
-    return 0;
-}
-
-#define MSB_MASK(bits)  (-1u << bits)
-
-/** Generate PCM samples using the prediction filters and residual values
- *  read from the data stream, and update the filter state. */
-
-static void filter_channel(MLPDecodeContext *m, unsigned int substr,
-                           unsigned int channel)
-{
-    SubStream *s = &m->substream[substr];
-    const int32_t *fircoeff = s->channel_params[channel].coeff[FIR];
-    int32_t state_buffer[NUM_FILTERS][MAX_BLOCKSIZE + MAX_FIR_ORDER];
-    int32_t *firbuf = state_buffer[FIR] + MAX_BLOCKSIZE;
-    int32_t *iirbuf = state_buffer[IIR] + MAX_BLOCKSIZE;
-    FilterParams *fir = &s->channel_params[channel].filter_params[FIR];
-    FilterParams *iir = &s->channel_params[channel].filter_params[IIR];
-    unsigned int filter_shift = fir->shift;
-    int32_t mask = MSB_MASK(s->quant_step_size[channel]);
-
-    memcpy(firbuf, fir->state, MAX_FIR_ORDER * sizeof(int32_t));
-    memcpy(iirbuf, iir->state, MAX_IIR_ORDER * sizeof(int32_t));
-
-    m->dsp.mlp_filter_channel(firbuf, fircoeff,
-                              fir->order, iir->order,
-                              filter_shift, mask, s->blocksize,
-                              &m->sample_buffer[s->blockpos][channel]);
-
-    memcpy(fir->state, firbuf - s->blocksize, MAX_FIR_ORDER * sizeof(int32_t));
-    memcpy(iir->state, iirbuf - s->blocksize, MAX_IIR_ORDER * sizeof(int32_t));
-}
-
-/** Read a block of PCM residual data (or actual if no filtering active). */
-
-static int read_block_data(MLPDecodeContext *m, GetBitContext *gbp,
-                           unsigned int substr)
-{
-    SubStream *s = &m->substream[substr];
-    unsigned int i, ch, expected_stream_pos = 0;
-    int ret;
-
-    if (s->data_check_present) {
-        expected_stream_pos  = get_bits_count(gbp);
-        expected_stream_pos += get_bits(gbp, 16);
-        avpriv_request_sample(m->avctx,
-                              "Substreams with VLC block size check info");
-    }
-
-    if (s->blockpos + s->blocksize > m->access_unit_size) {
-        av_log(m->avctx, AV_LOG_ERROR, "too many audio samples in frame\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    memset(&m->bypassed_lsbs[s->blockpos][0], 0,
-           s->blocksize * sizeof(m->bypassed_lsbs[0]));
-
-    for (i = 0; i < s->blocksize; i++)
-        if ((ret = read_huff_channels(m, gbp, substr, i)) < 0)
-            return ret;
-
-    for (ch = s->min_channel; ch <= s->max_channel; ch++)
-        filter_channel(m, substr, ch);
-
-    s->blockpos += s->blocksize;
-
-    if (s->data_check_present) {
-        if (get_bits_count(gbp) != expected_stream_pos)
-            av_log(m->avctx, AV_LOG_ERROR, "block data length mismatch\n");
-        skip_bits(gbp, 8);
-    }
-
-    return 0;
-}
-
-/** Data table used for TrueHD noise generation function. */
-
-static const int8_t noise_table[256] = {
-     30,  51,  22,  54,   3,   7,  -4,  38,  14,  55,  46,  81,  22,  58,  -3,   2,
-     52,  31,  -7,  51,  15,  44,  74,  30,  85, -17,  10,  33,  18,  80,  28,  62,
-     10,  32,  23,  69,  72,  26,  35,  17,  73,  60,   8,  56,   2,   6,  -2,  -5,
-     51,   4,  11,  50,  66,  76,  21,  44,  33,  47,   1,  26,  64,  48,  57,  40,
-     38,  16, -10, -28,  92,  22, -18,  29, -10,   5, -13,  49,  19,  24,  70,  34,
-     61,  48,  30,  14,  -6,  25,  58,  33,  42,  60,  67,  17,  54,  17,  22,  30,
-     67,  44,  -9,  50, -11,  43,  40,  32,  59,  82,  13,  49, -14,  55,  60,  36,
-     48,  49,  31,  47,  15,  12,   4,  65,   1,  23,  29,  39,  45,  -2,  84,  69,
-      0,  72,  37,  57,  27,  41, -15, -16,  35,  31,  14,  61,  24,   0,  27,  24,
-     16,  41,  55,  34,  53,   9,  56,  12,  25,  29,  53,   5,  20, -20,  -8,  20,
-     13,  28,  -3,  78,  38,  16,  11,  62,  46,  29,  21,  24,  46,  65,  43, -23,
-     89,  18,  74,  21,  38, -12,  19,  12, -19,   8,  15,  33,   4,  57,   9,  -8,
-     36,  35,  26,  28,   7,  83,  63,  79,  75,  11,   3,  87,  37,  47,  34,  40,
-     39,  19,  20,  42,  27,  34,  39,  77,  13,  42,  59,  64,  45,  -1,  32,  37,
-     45,  -5,  53,  -6,   7,  36,  50,  23,   6,  32,   9, -21,  18,  71,  27,  52,
-    -25,  31,  35,  42,  -1,  68,  63,  52,  26,  43,  66,  37,  41,  25,  40,  70,
-};
-
-/** Noise generation functions.
- *  I'm not sure what these are for - they seem to be some kind of pseudorandom
- *  sequence generators, used to generate noise data which is used when the
- *  channels are rematrixed. I'm not sure if they provide a practical benefit
- *  to compression, or just obfuscate the decoder. Are they for some kind of
- *  dithering? */
-
-/** Generate two channels of noise, used in the matrix when
- *  restart sync word == 0x31ea. */
-
-static void generate_2_noise_channels(MLPDecodeContext *m, unsigned int substr)
-{
-    SubStream *s = &m->substream[substr];
-    unsigned int i;
-    uint32_t seed = s->noisegen_seed;
-    unsigned int maxchan = s->max_matrix_channel;
-
-    for (i = 0; i < s->blockpos; i++) {
-        uint16_t seed_shr7 = seed >> 7;
-        m->sample_buffer[i][maxchan+1] = ((int8_t)(seed >> 15)) << s->noise_shift;
-        m->sample_buffer[i][maxchan+2] = ((int8_t) seed_shr7)   << s->noise_shift;
-
-        seed = (seed << 16) ^ seed_shr7 ^ (seed_shr7 << 5);
-    }
-
-    s->noisegen_seed = seed;
-}
-
-/** Generate a block of noise, used when restart sync word == 0x31eb. */
-
-static void fill_noise_buffer(MLPDecodeContext *m, unsigned int substr)
-{
-    SubStream *s = &m->substream[substr];
-    unsigned int i;
-    uint32_t seed = s->noisegen_seed;
-
-    for (i = 0; i < m->access_unit_size_pow2; i++) {
-        uint8_t seed_shr15 = seed >> 15;
-        m->noise_buffer[i] = noise_table[seed_shr15];
-        seed = (seed << 8) ^ seed_shr15 ^ (seed_shr15 << 5);
-    }
-
-    s->noisegen_seed = seed;
-}
-
-
-/** Apply the channel matrices in turn to reconstruct the original audio
- *  samples. */
-
-static void rematrix_channels(MLPDecodeContext *m, unsigned int substr)
-{
-    SubStream *s = &m->substream[substr];
-    unsigned int mat, src_ch, i;
-    unsigned int maxchan;
-
-    maxchan = s->max_matrix_channel;
-    if (!s->noise_type) {
-        generate_2_noise_channels(m, substr);
-        maxchan += 2;
-    } else {
-        fill_noise_buffer(m, substr);
-    }
-
-    for (mat = 0; mat < s->num_primitive_matrices; mat++) {
-        int matrix_noise_shift = s->matrix_noise_shift[mat];
-        unsigned int dest_ch = s->matrix_out_ch[mat];
-        int32_t mask = MSB_MASK(s->quant_step_size[dest_ch]);
-        int32_t *coeffs = s->matrix_coeff[mat];
-        int index  = s->num_primitive_matrices - mat;
-        int index2 = 2 * index + 1;
-
-        /* TODO: DSPContext? */
-
-        for (i = 0; i < s->blockpos; i++) {
-            int32_t bypassed_lsb = m->bypassed_lsbs[i][mat];
-            int32_t *samples = m->sample_buffer[i];
-            int64_t accum = 0;
-
-            for (src_ch = 0; src_ch <= maxchan; src_ch++)
-                accum += (int64_t) samples[src_ch] * coeffs[src_ch];
-
-            if (matrix_noise_shift) {
-                index &= m->access_unit_size_pow2 - 1;
-                accum += m->noise_buffer[index] << (matrix_noise_shift + 7);
-                index += index2;
-            }
-
-            samples[dest_ch] = ((accum >> 14) & mask) + bypassed_lsb;
-        }
-    }
-}
-
-/** Write the audio data into the output buffer. */
-
-static int output_data(MLPDecodeContext *m, unsigned int substr,
-                       AVFrame *frame, int *got_frame_ptr)
-{
-    AVCodecContext *avctx = m->avctx;
-    SubStream *s = &m->substream[substr];
-    unsigned int i, out_ch = 0;
-    int32_t *data_32;
-    int16_t *data_16;
-    int ret;
-    int is32 = (m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
-
-    if (m->avctx->channels != s->max_matrix_channel + 1) {
-        av_log(m->avctx, AV_LOG_ERROR, "channel count mismatch\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!s->blockpos) {
-        av_log(avctx, AV_LOG_ERROR, "No samples to output.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = s->blockpos;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    data_32 = (int32_t *)frame->data[0];
-    data_16 = (int16_t *)frame->data[0];
-
-    for (i = 0; i < s->blockpos; i++) {
-        for (out_ch = 0; out_ch <= s->max_matrix_channel; out_ch++) {
-            int mat_ch = s->ch_assign[out_ch];
-            int32_t sample = m->sample_buffer[i][mat_ch]
-                          << s->output_shift[mat_ch];
-            s->lossless_check_data ^= (sample & 0xffffff) << mat_ch;
-            if (is32) *data_32++ = sample << 8;
-            else      *data_16++ = sample >> 8;
-        }
-    }
-
-    /* Update matrix encoding side data */
-    if ((ret = ff_side_data_update_matrix_encoding(frame, s->matrix_encoding)) < 0)
-        return ret;
-
-    *got_frame_ptr = 1;
-
-    return 0;
-}
-
-/** Read an access unit from the stream.
- *  @return negative on error, 0 if not enough data is present in the input stream,
- *  otherwise the number of bytes consumed. */
-
-static int read_access_unit(AVCodecContext *avctx, void* data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MLPDecodeContext *m = avctx->priv_data;
-    GetBitContext gb;
-    unsigned int length, substr;
-    unsigned int substream_start;
-    unsigned int header_size = 4;
-    unsigned int substr_header_size = 0;
-    uint8_t substream_parity_present[MAX_SUBSTREAMS];
-    uint16_t substream_data_len[MAX_SUBSTREAMS];
-    uint8_t parity_bits;
-    int ret;
-
-    if (buf_size < 4)
-        return 0;
-
-    length = (AV_RB16(buf) & 0xfff) * 2;
-
-    if (length < 4 || length > buf_size)
-        return AVERROR_INVALIDDATA;
-
-    init_get_bits(&gb, (buf + 4), (length - 4) * 8);
-
-    m->is_major_sync_unit = 0;
-    if (show_bits_long(&gb, 31) == (0xf8726fba >> 1)) {
-        if (read_major_sync(m, &gb) < 0)
-            goto error;
-        m->is_major_sync_unit = 1;
-        header_size += 28;
-    }
-
-    if (!m->params_valid) {
-        av_log(m->avctx, AV_LOG_WARNING,
-               "Stream parameters not seen; skipping frame.\n");
-        *got_frame_ptr = 0;
-        return length;
-    }
-
-    substream_start = 0;
-
-    for (substr = 0; substr < m->num_substreams; substr++) {
-        int extraword_present, checkdata_present, end, nonrestart_substr;
-
-        extraword_present = get_bits1(&gb);
-        nonrestart_substr = get_bits1(&gb);
-        checkdata_present = get_bits1(&gb);
-        skip_bits1(&gb);
-
-        end = get_bits(&gb, 12) * 2;
-
-        substr_header_size += 2;
-
-        if (extraword_present) {
-            if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
-                av_log(m->avctx, AV_LOG_ERROR, "There must be no extraword for MLP.\n");
-                goto error;
-            }
-            skip_bits(&gb, 16);
-            substr_header_size += 2;
-        }
-
-        if (!(nonrestart_substr ^ m->is_major_sync_unit)) {
-            av_log(m->avctx, AV_LOG_ERROR, "Invalid nonrestart_substr.\n");
-            goto error;
-        }
-
-        if (end + header_size + substr_header_size > length) {
-            av_log(m->avctx, AV_LOG_ERROR,
-                   "Indicated length of substream %d data goes off end of "
-                   "packet.\n", substr);
-            end = length - header_size - substr_header_size;
-        }
-
-        if (end < substream_start) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Indicated end offset of substream %d data "
-                   "is smaller than calculated start offset.\n",
-                   substr);
-            goto error;
-        }
-
-        if (substr > m->max_decoded_substream)
-            continue;
-
-        substream_parity_present[substr] = checkdata_present;
-        substream_data_len[substr] = end - substream_start;
-        substream_start = end;
-    }
-
-    parity_bits  = ff_mlp_calculate_parity(buf, 4);
-    parity_bits ^= ff_mlp_calculate_parity(buf + header_size, substr_header_size);
-
-    if ((((parity_bits >> 4) ^ parity_bits) & 0xF) != 0xF) {
-        av_log(avctx, AV_LOG_ERROR, "Parity check failed.\n");
-        goto error;
-    }
-
-    buf += header_size + substr_header_size;
-
-    for (substr = 0; substr <= m->max_decoded_substream; substr++) {
-        SubStream *s = &m->substream[substr];
-        init_get_bits(&gb, buf, substream_data_len[substr] * 8);
-
-        m->matrix_changed = 0;
-        memset(m->filter_changed, 0, sizeof(m->filter_changed));
-
-        s->blockpos = 0;
-        do {
-            if (get_bits1(&gb)) {
-                if (get_bits1(&gb)) {
-                    /* A restart header should be present. */
-                    if (read_restart_header(m, &gb, buf, substr) < 0)
-                        goto next_substr;
-                    s->restart_seen = 1;
-                }
-
-                if (!s->restart_seen)
-                    goto next_substr;
-                if (read_decoding_params(m, &gb, substr) < 0)
-                    goto next_substr;
-            }
-
-            if (!s->restart_seen)
-                goto next_substr;
-
-            if ((ret = read_block_data(m, &gb, substr)) < 0)
-                return ret;
-
-            if (get_bits_count(&gb) >= substream_data_len[substr] * 8)
-                goto substream_length_mismatch;
-
-        } while (!get_bits1(&gb));
-
-        skip_bits(&gb, (-get_bits_count(&gb)) & 15);
-
-        if (substream_data_len[substr] * 8 - get_bits_count(&gb) >= 32) {
-            int shorten_by;
-
-            if (get_bits(&gb, 16) != 0xD234)
-                return AVERROR_INVALIDDATA;
-
-            shorten_by = get_bits(&gb, 16);
-            if      (m->avctx->codec_id == AV_CODEC_ID_TRUEHD && shorten_by  & 0x2000)
-                s->blockpos -= FFMIN(shorten_by & 0x1FFF, s->blockpos);
-            else if (m->avctx->codec_id == AV_CODEC_ID_MLP    && shorten_by != 0xD234)
-                return AVERROR_INVALIDDATA;
-
-            if (substr == m->max_decoded_substream)
-                av_log(m->avctx, AV_LOG_INFO, "End of stream indicated.\n");
-        }
-
-        if (substream_parity_present[substr]) {
-            uint8_t parity, checksum;
-
-            if (substream_data_len[substr] * 8 - get_bits_count(&gb) != 16)
-                goto substream_length_mismatch;
-
-            parity   = ff_mlp_calculate_parity(buf, substream_data_len[substr] - 2);
-            checksum = ff_mlp_checksum8       (buf, substream_data_len[substr] - 2);
-
-            if ((get_bits(&gb, 8) ^ parity) != 0xa9    )
-                av_log(m->avctx, AV_LOG_ERROR, "Substream %d parity check failed.\n", substr);
-            if ( get_bits(&gb, 8)           != checksum)
-                av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n"    , substr);
-        }
-
-        if (substream_data_len[substr] * 8 != get_bits_count(&gb))
-            goto substream_length_mismatch;
-
-next_substr:
-        if (!s->restart_seen)
-            av_log(m->avctx, AV_LOG_ERROR,
-                   "No restart header present in substream %d.\n", substr);
-
-        buf += substream_data_len[substr];
-    }
-
-    rematrix_channels(m, m->max_decoded_substream);
-
-    if ((ret = output_data(m, m->max_decoded_substream, data, got_frame_ptr)) < 0)
-        return ret;
-
-    return length;
-
-substream_length_mismatch:
-    av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n", substr);
-    return AVERROR_INVALIDDATA;
-
-error:
-    m->params_valid = 0;
-    return AVERROR_INVALIDDATA;
-}
-
-AVCodec ff_mlp_decoder = {
-    .name           = "mlp",
-    .long_name      = NULL_IF_CONFIG_SMALL("MLP (Meridian Lossless Packing)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MLP,
-    .priv_data_size = sizeof(MLPDecodeContext),
-    .init           = mlp_decode_init,
-    .decode         = read_access_unit,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-#if CONFIG_TRUEHD_DECODER
-AVCodec ff_truehd_decoder = {
-    .name           = "truehd",
-    .long_name      = NULL_IF_CONFIG_SMALL("TrueHD"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_TRUEHD,
-    .priv_data_size = sizeof(MLPDecodeContext),
-    .init           = mlp_decode_init,
-    .decode         = read_access_unit,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif /* CONFIG_TRUEHD_DECODER */
diff --git a/deps/libav/libavcodec/mlpdsp.c b/deps/libav/libavcodec/mlpdsp.c
deleted file mode 100644
index b96200e..0000000
--- a/deps/libav/libavcodec/mlpdsp.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Ian Caulfield
- *               2009 Ramiro Polla
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "mlpdsp.h"
-#include "mlp.h"
-
-static void mlp_filter_channel(int32_t *state, const int32_t *coeff,
-                               int firorder, int iirorder,
-                               unsigned int filter_shift, int32_t mask,
-                               int blocksize, int32_t *sample_buffer)
-{
-    int32_t *firbuf = state;
-    int32_t *iirbuf = state + MAX_BLOCKSIZE + MAX_FIR_ORDER;
-    const int32_t *fircoeff = coeff;
-    const int32_t *iircoeff = coeff + MAX_FIR_ORDER;
-    int i;
-
-    for (i = 0; i < blocksize; i++) {
-        int32_t residual = *sample_buffer;
-        unsigned int order;
-        int64_t accum = 0;
-        int32_t result;
-
-        for (order = 0; order < firorder; order++)
-            accum += (int64_t) firbuf[order] * fircoeff[order];
-        for (order = 0; order < iirorder; order++)
-            accum += (int64_t) iirbuf[order] * iircoeff[order];
-
-        accum  = accum >> filter_shift;
-        result = (accum + residual) & mask;
-
-        *--firbuf = result;
-        *--iirbuf = result - accum;
-
-        *sample_buffer = result;
-        sample_buffer += MAX_CHANNELS;
-    }
-}
-
-av_cold void ff_mlpdsp_init(MLPDSPContext *c)
-{
-    c->mlp_filter_channel = mlp_filter_channel;
-    if (ARCH_X86)
-        ff_mlpdsp_init_x86(c);
-}
diff --git a/deps/libav/libavcodec/mlpdsp.h b/deps/libav/libavcodec/mlpdsp.h
deleted file mode 100644
index 995f72a..0000000
--- a/deps/libav/libavcodec/mlpdsp.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * MLP codec common header file
- * Copyright (c) 2007-2008 Ian Caulfield
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MLPDSP_H
-#define AVCODEC_MLPDSP_H
-
-#include <stdint.h>
-
-typedef struct MLPDSPContext {
-    void (*mlp_filter_channel)(int32_t *state, const int32_t *coeff,
-                               int firorder, int iirorder,
-                               unsigned int filter_shift, int32_t mask,
-                               int blocksize, int32_t *sample_buffer);
-} MLPDSPContext;
-
-void ff_mlpdsp_init(MLPDSPContext *c);
-void ff_mlpdsp_init_x86(MLPDSPContext *c);
-
-#endif /* AVCODEC_MLPDSP_H */
diff --git a/deps/libav/libavcodec/mmvideo.c b/deps/libav/libavcodec/mmvideo.c
deleted file mode 100644
index abec2e8..0000000
--- a/deps/libav/libavcodec/mmvideo.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * American Laser Games MM Video Decoder
- * Copyright (c) 2006,2008 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * American Laser Games MM Video Decoder
- * by Peter Ross (pross at xvid.org)
- *
- * The MM format was used by IBM-PC ports of ALG's "arcade shooter" games,
- * including Mad Dog McCree and Crime Patrol.
- *
- * Technical details here:
- *  http://wiki.multimedia.cx/index.php?title=American_Laser_Games_MM
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-#define MM_PREAMBLE_SIZE    6
-
-#define MM_TYPE_INTER       0x5
-#define MM_TYPE_INTRA       0x8
-#define MM_TYPE_INTRA_HH    0xc
-#define MM_TYPE_INTER_HH    0xd
-#define MM_TYPE_INTRA_HHV   0xe
-#define MM_TYPE_INTER_HHV   0xf
-#define MM_TYPE_PALETTE     0x31
-
-typedef struct MmContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-    int palette[AVPALETTE_COUNT];
-    GetByteContext gb;
-} MmContext;
-
-static av_cold int mm_decode_init(AVCodecContext *avctx)
-{
-    MmContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int mm_decode_pal(MmContext *s)
-{
-    int i;
-
-    bytestream2_skip(&s->gb, 4);
-    for (i = 0; i < 128; i++) {
-        s->palette[i] = bytestream2_get_be24(&s->gb);
-        s->palette[i+128] = s->palette[i]<<2;
-    }
-
-    return 0;
-}
-
-/**
- * @param half_horiz Half horizontal resolution (0 or 1)
- * @param half_vert Half vertical resolution (0 or 1)
- */
-static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
-{
-    int x = 0, y = 0;
-
-    while (bytestream2_get_bytes_left(&s->gb) > 0) {
-        int run_length, color;
-
-        if (y >= s->avctx->height)
-            return 0;
-
-        color = bytestream2_get_byte(&s->gb);
-        if (color & 0x80) {
-            run_length = 1;
-        }else{
-            run_length = (color & 0x7f) + 2;
-            color = bytestream2_get_byte(&s->gb);
-        }
-
-        if (half_horiz)
-            run_length *=2;
-
-        if (color) {
-            memset(s->frame->data[0] + y*s->frame->linesize[0] + x, color, run_length);
-            if (half_vert)
-                memset(s->frame->data[0] + (y+1)*s->frame->linesize[0] + x, color, run_length);
-        }
-        x+= run_length;
-
-        if (x >= s->avctx->width) {
-            x=0;
-            y += 1 + half_vert;
-        }
-    }
-
-    return 0;
-}
-
-/*
- * @param half_horiz Half horizontal resolution (0 or 1)
- * @param half_vert Half vertical resolution (0 or 1)
- */
-static int mm_decode_inter(MmContext * s, int half_horiz, int half_vert)
-{
-    int data_off = bytestream2_get_le16(&s->gb);
-    int y = 0;
-    GetByteContext data_ptr;
-
-    if (bytestream2_get_bytes_left(&s->gb) < data_off)
-        return AVERROR_INVALIDDATA;
-
-    bytestream2_init(&data_ptr, s->gb.buffer + data_off, bytestream2_get_bytes_left(&s->gb) - data_off);
-    while (s->gb.buffer < data_ptr.buffer_start) {
-        int i, j;
-        int length = bytestream2_get_byte(&s->gb);
-        int x = bytestream2_get_byte(&s->gb) + ((length & 0x80) << 1);
-        length &= 0x7F;
-
-        if (length==0) {
-            y += x;
-            continue;
-        }
-
-        if (y + half_vert >= s->avctx->height)
-            return 0;
-
-        for(i=0; i<length; i++) {
-            int replace_array = bytestream2_get_byte(&s->gb);
-            for(j=0; j<8; j++) {
-                int replace = (replace_array >> (7-j)) & 1;
-                if (replace) {
-                    int color = bytestream2_get_byte(&data_ptr);
-                    s->frame->data[0][y*s->frame->linesize[0] + x] = color;
-                    if (half_horiz)
-                        s->frame->data[0][y*s->frame->linesize[0] + x + 1] = color;
-                    if (half_vert) {
-                        s->frame->data[0][(y+1)*s->frame->linesize[0] + x] = color;
-                        if (half_horiz)
-                            s->frame->data[0][(y+1)*s->frame->linesize[0] + x + 1] = color;
-                    }
-                }
-                x += 1 + half_horiz;
-            }
-        }
-
-        y += 1 + half_vert;
-    }
-
-    return 0;
-}
-
-static int mm_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MmContext *s = avctx->priv_data;
-    int type, res;
-
-    if (buf_size < MM_PREAMBLE_SIZE)
-        return AVERROR_INVALIDDATA;
-    type = AV_RL16(&buf[0]);
-    buf += MM_PREAMBLE_SIZE;
-    buf_size -= MM_PREAMBLE_SIZE;
-    bytestream2_init(&s->gb, buf, buf_size);
-
-    if ((res = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return res;
-    }
-
-    switch(type) {
-    case MM_TYPE_PALETTE   : res = mm_decode_pal(s); return buf_size;
-    case MM_TYPE_INTRA     : res = mm_decode_intra(s, 0, 0); break;
-    case MM_TYPE_INTRA_HH  : res = mm_decode_intra(s, 1, 0); break;
-    case MM_TYPE_INTRA_HHV : res = mm_decode_intra(s, 1, 1); break;
-    case MM_TYPE_INTER     : res = mm_decode_inter(s, 0, 0); break;
-    case MM_TYPE_INTER_HH  : res = mm_decode_inter(s, 1, 0); break;
-    case MM_TYPE_INTER_HHV : res = mm_decode_inter(s, 1, 1); break;
-    default:
-        res = AVERROR_INVALIDDATA;
-        break;
-    }
-    if (res < 0)
-        return res;
-
-    memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE);
-
-    if ((res = av_frame_ref(data, s->frame)) < 0)
-        return res;
-
-    *got_frame      = 1;
-
-    return buf_size;
-}
-
-static av_cold int mm_decode_end(AVCodecContext *avctx)
-{
-    MmContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_mmvideo_decoder = {
-    .name           = "mmvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("American Laser Games MM Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MMVIDEO,
-    .priv_data_size = sizeof(MmContext),
-    .init           = mm_decode_init,
-    .close          = mm_decode_end,
-    .decode         = mm_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/motion_est.c b/deps/libav/libavcodec/motion_est.c
deleted file mode 100644
index 04ae49e..0000000
--- a/deps/libav/libavcodec/motion_est.c
+++ /dev/null
@@ -1,1744 +0,0 @@
-/*
- * Motion estimation
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * new motion estimation (X1/EPZS) by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Motion estimation.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <limits.h>
-
-#include "avcodec.h"
-#include "mathops.h"
-#include "mpegvideo.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-#define P_LEFT P[1]
-#define P_TOP P[2]
-#define P_TOPRIGHT P[3]
-#define P_MEDIAN P[4]
-#define P_MV1 P[9]
-
-static int sad_hpel_motion_search(MpegEncContext * s,
-                                  int *mx_ptr, int *my_ptr, int dmin,
-                                  int src_index, int ref_index,
-                                  int size, int h);
-
-static inline unsigned update_map_generation(MotionEstContext *c)
-{
-    c->map_generation+= 1<<(ME_MAP_MV_BITS*2);
-    if(c->map_generation==0){
-        c->map_generation= 1<<(ME_MAP_MV_BITS*2);
-        memset(c->map, 0, sizeof(uint32_t)*ME_MAP_SIZE);
-    }
-    return c->map_generation;
-}
-
-/* shape adaptive search stuff */
-typedef struct Minima{
-    int height;
-    int x, y;
-    int checked;
-}Minima;
-
-static int minima_cmp(const void *a, const void *b){
-    const Minima *da = (const Minima *) a;
-    const Minima *db = (const Minima *) b;
-
-    return da->height - db->height;
-}
-
-#define FLAG_QPEL   1 //must be 1
-#define FLAG_CHROMA 2
-#define FLAG_DIRECT 4
-
-static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index){
-    const int offset[3]= {
-          y*c->  stride + x,
-        ((y*c->uvstride + x)>>1),
-        ((y*c->uvstride + x)>>1),
-    };
-    int i;
-    for(i=0; i<3; i++){
-        c->src[0][i]= src [i] + offset[i];
-        c->ref[0][i]= ref [i] + offset[i];
-    }
-    if(ref_index){
-        for(i=0; i<3; i++){
-            c->ref[ref_index][i]= ref2[i] + offset[i];
-        }
-    }
-}
-
-static int get_flags(MotionEstContext *c, int direct, int chroma){
-    return   ((c->avctx->flags&CODEC_FLAG_QPEL) ? FLAG_QPEL : 0)
-           + (direct ? FLAG_DIRECT : 0)
-           + (chroma ? FLAG_CHROMA : 0);
-}
-
-static av_always_inline int cmp_direct_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
-                      const int size, const int h, int ref_index, int src_index,
-                      me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel){
-    MotionEstContext * const c= &s->me;
-    const int stride= c->stride;
-    const int hx= subx + (x<<(1+qpel));
-    const int hy= suby + (y<<(1+qpel));
-    uint8_t * const * const ref= c->ref[ref_index];
-    uint8_t * const * const src= c->src[src_index];
-    int d;
-    //FIXME check chroma 4mv, (no crashes ...)
-        assert(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1));
-        if(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)){
-            const int time_pp= s->pp_time;
-            const int time_pb= s->pb_time;
-            const int mask= 2*qpel+1;
-            if(s->mv_type==MV_TYPE_8X8){
-                int i;
-                for(i=0; i<4; i++){
-                    int fx = c->direct_basis_mv[i][0] + hx;
-                    int fy = c->direct_basis_mv[i][1] + hy;
-                    int bx = hx ? fx - c->co_located_mv[i][0] : c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(qpel+4));
-                    int by = hy ? fy - c->co_located_mv[i][1] : c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(qpel+4));
-                    int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
-                    int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
-
-                    uint8_t *dst= c->temp + 8*(i&1) + 8*stride*(i>>1);
-                    if(qpel){
-                        c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride);
-                        c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride);
-                    }else{
-                        c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8);
-                        c->hpel_avg[1][bxy](dst, ref[8] + (bx>>1) + (by>>1)*stride, stride, 8);
-                    }
-                }
-            }else{
-                int fx = c->direct_basis_mv[0][0] + hx;
-                int fy = c->direct_basis_mv[0][1] + hy;
-                int bx = hx ? fx - c->co_located_mv[0][0] : (c->co_located_mv[0][0]*(time_pb - time_pp)/time_pp);
-                int by = hy ? fy - c->co_located_mv[0][1] : (c->co_located_mv[0][1]*(time_pb - time_pp)/time_pp);
-                int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
-                int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
-
-                if(qpel){
-                    c->qpel_put[1][fxy](c->temp               , ref[0] + (fx>>2) + (fy>>2)*stride               , stride);
-                    c->qpel_put[1][fxy](c->temp + 8           , ref[0] + (fx>>2) + (fy>>2)*stride + 8           , stride);
-                    c->qpel_put[1][fxy](c->temp     + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride     + 8*stride, stride);
-                    c->qpel_put[1][fxy](c->temp + 8 + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8 + 8*stride, stride);
-                    c->qpel_avg[1][bxy](c->temp               , ref[8] + (bx>>2) + (by>>2)*stride               , stride);
-                    c->qpel_avg[1][bxy](c->temp + 8           , ref[8] + (bx>>2) + (by>>2)*stride + 8           , stride);
-                    c->qpel_avg[1][bxy](c->temp     + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride     + 8*stride, stride);
-                    c->qpel_avg[1][bxy](c->temp + 8 + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8 + 8*stride, stride);
-                }else{
-                    assert((fx>>1) + 16*s->mb_x >= -16);
-                    assert((fy>>1) + 16*s->mb_y >= -16);
-                    assert((fx>>1) + 16*s->mb_x <= s->width);
-                    assert((fy>>1) + 16*s->mb_y <= s->height);
-                    assert((bx>>1) + 16*s->mb_x >= -16);
-                    assert((by>>1) + 16*s->mb_y >= -16);
-                    assert((bx>>1) + 16*s->mb_x <= s->width);
-                    assert((by>>1) + 16*s->mb_y <= s->height);
-
-                    c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16);
-                    c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16);
-                }
-            }
-            d = cmp_func(s, c->temp, src[0], stride, 16);
-        }else
-            d= 256*256*256*32;
-    return d;
-}
-
-static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
-                      const int size, const int h, int ref_index, int src_index,
-                      me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel, int chroma){
-    MotionEstContext * const c= &s->me;
-    const int stride= c->stride;
-    const int uvstride= c->uvstride;
-    const int dxy= subx + (suby<<(1+qpel)); //FIXME log2_subpel?
-    const int hx= subx + (x<<(1+qpel));
-    const int hy= suby + (y<<(1+qpel));
-    uint8_t * const * const ref= c->ref[ref_index];
-    uint8_t * const * const src= c->src[src_index];
-    int d;
-    //FIXME check chroma 4mv, (no crashes ...)
-        int uvdxy;              /* no, it might not be used uninitialized */
-        if(dxy){
-            if(qpel){
-                c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); //FIXME prototype (add h)
-                if(chroma){
-                    int cx= hx/2;
-                    int cy= hy/2;
-                    cx= (cx>>1)|(cx&1);
-                    cy= (cy>>1)|(cy&1);
-                    uvdxy= (cx&1) + 2*(cy&1);
-                    //FIXME x/y wrong, but mpeg4 qpel is sick anyway, we should drop as much of it as possible in favor for h264
-                }
-            }else{
-                c->hpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride, h);
-                if(chroma)
-                    uvdxy= dxy | (x&1) | (2*(y&1));
-            }
-            d = cmp_func(s, c->temp, src[0], stride, h);
-        }else{
-            d = cmp_func(s, src[0], ref[0] + x + y*stride, stride, h);
-            if(chroma)
-                uvdxy= (x&1) + 2*(y&1);
-        }
-        if(chroma){
-            uint8_t * const uvtemp= c->temp + 16*stride;
-            c->hpel_put[size+1][uvdxy](uvtemp  , ref[1] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
-            c->hpel_put[size+1][uvdxy](uvtemp+8, ref[2] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
-            d += chroma_cmp_func(s, uvtemp  , src[1], uvstride, h>>1);
-            d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1);
-        }
-    return d;
-}
-
-static int cmp_simple(MpegEncContext *s, const int x, const int y,
-                      int ref_index, int src_index,
-                      me_cmp_func cmp_func, me_cmp_func chroma_cmp_func){
-    return cmp_inline(s,x,y,0,0,0,16,ref_index,src_index, cmp_func, chroma_cmp_func, 0, 0);
-}
-
-static int cmp_fpel_internal(MpegEncContext *s, const int x, const int y,
-                      const int size, const int h, int ref_index, int src_index,
-                      me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
-    if(flags&FLAG_DIRECT){
-        return cmp_direct_inline(s,x,y,0,0,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags&FLAG_QPEL);
-    }else{
-        return cmp_inline(s,x,y,0,0,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, 0, flags&FLAG_CHROMA);
-    }
-}
-
-static int cmp_internal(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
-                      const int size, const int h, int ref_index, int src_index,
-                      me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
-    if(flags&FLAG_DIRECT){
-        return cmp_direct_inline(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags&FLAG_QPEL);
-    }else{
-        return cmp_inline(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags&FLAG_QPEL, flags&FLAG_CHROMA);
-    }
-}
-
-/** @brief compares a block (either a full macroblock or a partition thereof)
-    against a proposed motion-compensated prediction of that block
- */
-static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
-                      const int size, const int h, int ref_index, int src_index,
-                      me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
-    if(av_builtin_constant_p(flags) && av_builtin_constant_p(h) && av_builtin_constant_p(size)
-       && av_builtin_constant_p(subx) && av_builtin_constant_p(suby)
-       && flags==0 && h==16 && size==0 && subx==0 && suby==0){
-        return cmp_simple(s,x,y,ref_index,src_index, cmp_func, chroma_cmp_func);
-    }else if(av_builtin_constant_p(subx) && av_builtin_constant_p(suby)
-       && subx==0 && suby==0){
-        return cmp_fpel_internal(s,x,y,size,h,ref_index,src_index, cmp_func, chroma_cmp_func,flags);
-    }else{
-        return cmp_internal(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags);
-    }
-}
-
-static int cmp_hpel(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
-                      const int size, const int h, int ref_index, int src_index,
-                      me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
-    if(flags&FLAG_DIRECT){
-        return cmp_direct_inline(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, 0);
-    }else{
-        return cmp_inline(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, 0, flags&FLAG_CHROMA);
-    }
-}
-
-static int cmp_qpel(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
-                      const int size, const int h, int ref_index, int src_index,
-                      me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
-    if(flags&FLAG_DIRECT){
-        return cmp_direct_inline(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, 1);
-    }else{
-        return cmp_inline(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, 1, flags&FLAG_CHROMA);
-    }
-}
-
-#include "motion_est_template.c"
-
-static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h){
-    return 0;
-}
-
-static void zero_hpel(uint8_t *a, const uint8_t *b, ptrdiff_t stride, int h){
-}
-
-int ff_init_me(MpegEncContext *s){
-    MotionEstContext * const c= &s->me;
-    int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT);
-    int dia_size= FFMAX(FFABS(s->avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255);
-
-    if(FFMIN(s->avctx->dia_size, s->avctx->pre_dia_size) < -ME_MAP_SIZE){
-        av_log(s->avctx, AV_LOG_ERROR, "ME_MAP size is too small for SAB diamond\n");
-        return -1;
-    }
-    if (s->me_method != ME_ZERO &&
-        s->me_method != ME_EPZS &&
-        s->me_method != ME_X1) {
-        av_log(s->avctx, AV_LOG_ERROR, "me_method is only allowed to be set to zero and epzs; for hex,umh,full and others see dia_size\n");
-        return -1;
-    }
-
-    c->avctx= s->avctx;
-
-    if(cache_size < 2*dia_size && !c->stride){
-        av_log(s->avctx, AV_LOG_INFO, "ME_MAP size may be a little small for the selected diamond size\n");
-    }
-
-    ff_set_cmp(&s->dsp, s->dsp.me_pre_cmp, c->avctx->me_pre_cmp);
-    ff_set_cmp(&s->dsp, s->dsp.me_cmp, c->avctx->me_cmp);
-    ff_set_cmp(&s->dsp, s->dsp.me_sub_cmp, c->avctx->me_sub_cmp);
-    ff_set_cmp(&s->dsp, s->dsp.mb_cmp, c->avctx->mb_cmp);
-
-    c->flags    = get_flags(c, 0, c->avctx->me_cmp    &FF_CMP_CHROMA);
-    c->sub_flags= get_flags(c, 0, c->avctx->me_sub_cmp&FF_CMP_CHROMA);
-    c->mb_flags = get_flags(c, 0, c->avctx->mb_cmp    &FF_CMP_CHROMA);
-
-/*FIXME s->no_rounding b_type*/
-    if(s->flags&CODEC_FLAG_QPEL){
-        c->sub_motion_search= qpel_motion_search;
-        c->qpel_avg= s->dsp.avg_qpel_pixels_tab;
-        if(s->no_rounding) c->qpel_put= s->dsp.put_no_rnd_qpel_pixels_tab;
-        else               c->qpel_put= s->dsp.put_qpel_pixels_tab;
-    }else{
-        if(c->avctx->me_sub_cmp&FF_CMP_CHROMA)
-            c->sub_motion_search= hpel_motion_search;
-        else if(   c->avctx->me_sub_cmp == FF_CMP_SAD
-                && c->avctx->    me_cmp == FF_CMP_SAD
-                && c->avctx->    mb_cmp == FF_CMP_SAD)
-            c->sub_motion_search= sad_hpel_motion_search; // 2050 vs. 2450 cycles
-        else
-            c->sub_motion_search= hpel_motion_search;
-    }
-    c->hpel_avg = s->hdsp.avg_pixels_tab;
-    if (s->no_rounding)
-        c->hpel_put = s->hdsp.put_no_rnd_pixels_tab;
-    else
-        c->hpel_put = s->hdsp.put_pixels_tab;
-
-    if(s->linesize){
-        c->stride  = s->linesize;
-        c->uvstride= s->uvlinesize;
-    }else{
-        c->stride  = 16*s->mb_width + 32;
-        c->uvstride=  8*s->mb_width + 16;
-    }
-
-    /* 8x8 fullpel search would need a 4x4 chroma compare, which we do
-     * not have yet, and even if we had, the motion estimation code
-     * does not expect it. */
-    if((c->avctx->me_cmp&FF_CMP_CHROMA)/* && !s->dsp.me_cmp[2]*/){
-        s->dsp.me_cmp[2]= zero_cmp;
-    }
-    if((c->avctx->me_sub_cmp&FF_CMP_CHROMA) && !s->dsp.me_sub_cmp[2]){
-        s->dsp.me_sub_cmp[2]= zero_cmp;
-    }
-    c->hpel_put[2][0]= c->hpel_put[2][1]=
-    c->hpel_put[2][2]= c->hpel_put[2][3]= zero_hpel;
-
-    if(s->codec_id == AV_CODEC_ID_H261){
-        c->sub_motion_search= no_sub_motion_search;
-    }
-
-    return 0;
-}
-
-#define CHECK_SAD_HALF_MV(suffix, x, y) \
-{\
-    d= s->dsp.pix_abs[size][(x?1:0)+(y?2:0)](NULL, pix, ptr+((x)>>1), stride, h);\
-    d += (mv_penalty[pen_x + x] + mv_penalty[pen_y + y])*penalty_factor;\
-    COPY3_IF_LT(dminh, d, dx, x, dy, y)\
-}
-
-static int sad_hpel_motion_search(MpegEncContext * s,
-                                  int *mx_ptr, int *my_ptr, int dmin,
-                                  int src_index, int ref_index,
-                                  int size, int h)
-{
-    MotionEstContext * const c= &s->me;
-    const int penalty_factor= c->sub_penalty_factor;
-    int mx, my, dminh;
-    uint8_t *pix, *ptr;
-    int stride= c->stride;
-    const int flags= c->sub_flags;
-    LOAD_COMMON
-
-    assert(flags == 0);
-
-    if(c->skip){
-        *mx_ptr = 0;
-        *my_ptr = 0;
-        return dmin;
-    }
-
-    pix = c->src[src_index][0];
-
-    mx = *mx_ptr;
-    my = *my_ptr;
-    ptr = c->ref[ref_index][0] + (my * stride) + mx;
-
-    dminh = dmin;
-
-    if (mx > xmin && mx < xmax &&
-        my > ymin && my < ymax) {
-        int dx=0, dy=0;
-        int d, pen_x, pen_y;
-        const int index= (my<<ME_MAP_SHIFT) + mx;
-        const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)];
-        const int l= score_map[(index- 1               )&(ME_MAP_SIZE-1)];
-        const int r= score_map[(index+ 1               )&(ME_MAP_SIZE-1)];
-        const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)];
-        mx<<=1;
-        my<<=1;
-
-
-        pen_x= pred_x + mx;
-        pen_y= pred_y + my;
-
-        ptr-= stride;
-        if(t<=b){
-            CHECK_SAD_HALF_MV(y2 , 0, -1)
-            if(l<=r){
-                CHECK_SAD_HALF_MV(xy2, -1, -1)
-                if(t+r<=b+l){
-                    CHECK_SAD_HALF_MV(xy2, +1, -1)
-                    ptr+= stride;
-                }else{
-                    ptr+= stride;
-                    CHECK_SAD_HALF_MV(xy2, -1, +1)
-                }
-                CHECK_SAD_HALF_MV(x2 , -1,  0)
-            }else{
-                CHECK_SAD_HALF_MV(xy2, +1, -1)
-                if(t+l<=b+r){
-                    CHECK_SAD_HALF_MV(xy2, -1, -1)
-                    ptr+= stride;
-                }else{
-                    ptr+= stride;
-                    CHECK_SAD_HALF_MV(xy2, +1, +1)
-                }
-                CHECK_SAD_HALF_MV(x2 , +1,  0)
-            }
-        }else{
-            if(l<=r){
-                if(t+l<=b+r){
-                    CHECK_SAD_HALF_MV(xy2, -1, -1)
-                    ptr+= stride;
-                }else{
-                    ptr+= stride;
-                    CHECK_SAD_HALF_MV(xy2, +1, +1)
-                }
-                CHECK_SAD_HALF_MV(x2 , -1,  0)
-                CHECK_SAD_HALF_MV(xy2, -1, +1)
-            }else{
-                if(t+r<=b+l){
-                    CHECK_SAD_HALF_MV(xy2, +1, -1)
-                    ptr+= stride;
-                }else{
-                    ptr+= stride;
-                    CHECK_SAD_HALF_MV(xy2, -1, +1)
-                }
-                CHECK_SAD_HALF_MV(x2 , +1,  0)
-                CHECK_SAD_HALF_MV(xy2, +1, +1)
-            }
-            CHECK_SAD_HALF_MV(y2 ,  0, +1)
-        }
-        mx+=dx;
-        my+=dy;
-
-    }else{
-        mx<<=1;
-        my<<=1;
-    }
-
-    *mx_ptr = mx;
-    *my_ptr = my;
-    return dminh;
-}
-
-static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my, int mv4)
-{
-    const int xy= s->mb_x + s->mb_y*s->mb_stride;
-
-    s->p_mv_table[xy][0] = mx;
-    s->p_mv_table[xy][1] = my;
-
-    /* has already been set to the 4 MV if 4MV is done */
-    if(mv4){
-        int mot_xy= s->block_index[0];
-
-        s->current_picture.motion_val[0][mot_xy    ][0] = mx;
-        s->current_picture.motion_val[0][mot_xy    ][1] = my;
-        s->current_picture.motion_val[0][mot_xy + 1][0] = mx;
-        s->current_picture.motion_val[0][mot_xy + 1][1] = my;
-
-        mot_xy += s->b8_stride;
-        s->current_picture.motion_val[0][mot_xy    ][0] = mx;
-        s->current_picture.motion_val[0][mot_xy    ][1] = my;
-        s->current_picture.motion_val[0][mot_xy + 1][0] = mx;
-        s->current_picture.motion_val[0][mot_xy + 1][1] = my;
-    }
-}
-
-/**
- * get fullpel ME search limits.
- */
-static inline void get_limits(MpegEncContext *s, int x, int y)
-{
-    MotionEstContext * const c= &s->me;
-    int range= c->avctx->me_range >> (1 + !!(c->flags&FLAG_QPEL));
-/*
-    if(c->avctx->me_range) c->range= c->avctx->me_range >> 1;
-    else                   c->range= 16;
-*/
-    if (s->unrestricted_mv) {
-        c->xmin = - x - 16;
-        c->ymin = - y - 16;
-        c->xmax = - x + s->mb_width *16;
-        c->ymax = - y + s->mb_height*16;
-    } else if (s->out_format == FMT_H261){
-        // Search range of H261 is different from other codec standards
-        c->xmin = (x > 15) ? - 15 : 0;
-        c->ymin = (y > 15) ? - 15 : 0;
-        c->xmax = (x < s->mb_width * 16 - 16) ? 15 : 0;
-        c->ymax = (y < s->mb_height * 16 - 16) ? 15 : 0;
-    } else {
-        c->xmin = - x;
-        c->ymin = - y;
-        c->xmax = - x + s->mb_width *16 - 16;
-        c->ymax = - y + s->mb_height*16 - 16;
-    }
-    if(range){
-        c->xmin = FFMAX(c->xmin,-range);
-        c->xmax = FFMIN(c->xmax, range);
-        c->ymin = FFMAX(c->ymin,-range);
-        c->ymax = FFMIN(c->ymax, range);
-    }
-}
-
-static inline void init_mv4_ref(MotionEstContext *c){
-    const int stride= c->stride;
-
-    c->ref[1][0] = c->ref[0][0] + 8;
-    c->ref[2][0] = c->ref[0][0] + 8*stride;
-    c->ref[3][0] = c->ref[2][0] + 8;
-    c->src[1][0] = c->src[0][0] + 8;
-    c->src[2][0] = c->src[0][0] + 8*stride;
-    c->src[3][0] = c->src[2][0] + 8;
-}
-
-static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift)
-{
-    MotionEstContext * const c= &s->me;
-    const int size= 1;
-    const int h=8;
-    int block;
-    int P[10][2];
-    int dmin_sum=0, mx4_sum=0, my4_sum=0;
-    int same=1;
-    const int stride= c->stride;
-    uint8_t *mv_penalty= c->current_mv_penalty;
-
-    init_mv4_ref(c);
-
-    for(block=0; block<4; block++){
-        int mx4, my4;
-        int pred_x4, pred_y4;
-        int dmin4;
-        static const int off[4]= {2, 1, 1, -1};
-        const int mot_stride = s->b8_stride;
-        const int mot_xy = s->block_index[block];
-
-        P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0];
-        P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1];
-
-        if(P_LEFT[0]       > (c->xmax<<shift)) P_LEFT[0]       = (c->xmax<<shift);
-
-        /* special case for first line */
-        if (s->first_slice_line && block<2) {
-            c->pred_x= pred_x4= P_LEFT[0];
-            c->pred_y= pred_y4= P_LEFT[1];
-        } else {
-            P_TOP[0]      = s->current_picture.motion_val[0][mot_xy - mot_stride             ][0];
-            P_TOP[1]      = s->current_picture.motion_val[0][mot_xy - mot_stride             ][1];
-            P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + off[block]][0];
-            P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + off[block]][1];
-            if(P_TOP[1]      > (c->ymax<<shift)) P_TOP[1]     = (c->ymax<<shift);
-            if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
-            if(P_TOPRIGHT[0] > (c->xmax<<shift)) P_TOPRIGHT[0]= (c->xmax<<shift);
-            if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
-
-            P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
-            P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-
-            c->pred_x= pred_x4 = P_MEDIAN[0];
-            c->pred_y= pred_y4 = P_MEDIAN[1];
-        }
-        P_MV1[0]= mx;
-        P_MV1[1]= my;
-
-        dmin4 = epzs_motion_search4(s, &mx4, &my4, P, block, block, s->p_mv_table, (1<<16)>>shift);
-
-        dmin4= c->sub_motion_search(s, &mx4, &my4, dmin4, block, block, size, h);
-
-        if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
-            int dxy;
-            const int offset= ((block&1) + (block>>1)*stride)*8;
-            uint8_t *dest_y = c->scratchpad + offset;
-            if(s->quarter_sample){
-                uint8_t *ref= c->ref[block][0] + (mx4>>2) + (my4>>2)*stride;
-                dxy = ((my4 & 3) << 2) | (mx4 & 3);
-
-                if(s->no_rounding)
-                    s->dsp.put_no_rnd_qpel_pixels_tab[1][dxy](dest_y   , ref    , stride);
-                else
-                    s->dsp.put_qpel_pixels_tab       [1][dxy](dest_y   , ref    , stride);
-            }else{
-                uint8_t *ref= c->ref[block][0] + (mx4>>1) + (my4>>1)*stride;
-                dxy = ((my4 & 1) << 1) | (mx4 & 1);
-
-                if(s->no_rounding)
-                    s->hdsp.put_no_rnd_pixels_tab[1][dxy](dest_y    , ref    , stride, h);
-                else
-                    s->hdsp.put_pixels_tab       [1][dxy](dest_y    , ref    , stride, h);
-            }
-            dmin_sum+= (mv_penalty[mx4-pred_x4] + mv_penalty[my4-pred_y4])*c->mb_penalty_factor;
-        }else
-            dmin_sum+= dmin4;
-
-        if(s->quarter_sample){
-            mx4_sum+= mx4/2;
-            my4_sum+= my4/2;
-        }else{
-            mx4_sum+= mx4;
-            my4_sum+= my4;
-        }
-
-        s->current_picture.motion_val[0][s->block_index[block]][0] = mx4;
-        s->current_picture.motion_val[0][s->block_index[block]][1] = my4;
-
-        if(mx4 != mx || my4 != my) same=0;
-    }
-
-    if(same)
-        return INT_MAX;
-
-    if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
-        dmin_sum += s->dsp.mb_cmp[0](s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*16*stride, c->scratchpad, stride, 16);
-    }
-
-    if(c->avctx->mb_cmp&FF_CMP_CHROMA){
-        int dxy;
-        int mx, my;
-        int offset;
-
-        mx= ff_h263_round_chroma(mx4_sum);
-        my= ff_h263_round_chroma(my4_sum);
-        dxy = ((my & 1) << 1) | (mx & 1);
-
-        offset= (s->mb_x*8 + (mx>>1)) + (s->mb_y*8 + (my>>1))*s->uvlinesize;
-
-        if(s->no_rounding){
-            s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad    , s->last_picture.f.data[1] + offset, s->uvlinesize, 8);
-            s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad + 8, s->last_picture.f.data[2] + offset, s->uvlinesize, 8);
-        }else{
-            s->hdsp.put_pixels_tab       [1][dxy](c->scratchpad    , s->last_picture.f.data[1] + offset, s->uvlinesize, 8);
-            s->hdsp.put_pixels_tab       [1][dxy](c->scratchpad + 8, s->last_picture.f.data[2] + offset, s->uvlinesize, 8);
-        }
-
-        dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.f.data[1] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad  , s->uvlinesize, 8);
-        dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.f.data[2] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad+8, s->uvlinesize, 8);
-    }
-
-    c->pred_x= mx;
-    c->pred_y= my;
-
-    switch(c->avctx->mb_cmp&0xFF){
-    /*case FF_CMP_SSE:
-        return dmin_sum+ 32*s->qscale*s->qscale;*/
-    case FF_CMP_RD:
-        return dmin_sum;
-    default:
-        return dmin_sum+ 11*c->mb_penalty_factor;
-    }
-}
-
-static inline void init_interlaced_ref(MpegEncContext *s, int ref_index){
-    MotionEstContext * const c= &s->me;
-
-    c->ref[1+ref_index][0] = c->ref[0+ref_index][0] + s->linesize;
-    c->src[1][0] = c->src[0][0] + s->linesize;
-    if(c->flags & FLAG_CHROMA){
-        c->ref[1+ref_index][1] = c->ref[0+ref_index][1] + s->uvlinesize;
-        c->ref[1+ref_index][2] = c->ref[0+ref_index][2] + s->uvlinesize;
-        c->src[1][1] = c->src[0][1] + s->uvlinesize;
-        c->src[1][2] = c->src[0][2] + s->uvlinesize;
-    }
-}
-
-static int interlaced_search(MpegEncContext *s, int ref_index,
-                             int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select)
-{
-    MotionEstContext * const c= &s->me;
-    const int size=0;
-    const int h=8;
-    int block;
-    int P[10][2];
-    uint8_t * const mv_penalty= c->current_mv_penalty;
-    int same=1;
-    const int stride= 2*s->linesize;
-    int dmin_sum= 0;
-    const int mot_stride= s->mb_stride;
-    const int xy= s->mb_x + s->mb_y*mot_stride;
-
-    c->ymin>>=1;
-    c->ymax>>=1;
-    c->stride<<=1;
-    c->uvstride<<=1;
-    init_interlaced_ref(s, ref_index);
-
-    for(block=0; block<2; block++){
-        int field_select;
-        int best_dmin= INT_MAX;
-        int best_field= -1;
-
-        for(field_select=0; field_select<2; field_select++){
-            int dmin, mx_i, my_i;
-            int16_t (*mv_table)[2]= mv_tables[block][field_select];
-
-            if(user_field_select){
-                assert(field_select==0 || field_select==1);
-                assert(field_select_tables[block][xy]==0 || field_select_tables[block][xy]==1);
-                if(field_select_tables[block][xy] != field_select)
-                    continue;
-            }
-
-            P_LEFT[0] = mv_table[xy - 1][0];
-            P_LEFT[1] = mv_table[xy - 1][1];
-            if(P_LEFT[0]       > (c->xmax<<1)) P_LEFT[0]       = (c->xmax<<1);
-
-            c->pred_x= P_LEFT[0];
-            c->pred_y= P_LEFT[1];
-
-            if(!s->first_slice_line){
-                P_TOP[0]      = mv_table[xy - mot_stride][0];
-                P_TOP[1]      = mv_table[xy - mot_stride][1];
-                P_TOPRIGHT[0] = mv_table[xy - mot_stride + 1][0];
-                P_TOPRIGHT[1] = mv_table[xy - mot_stride + 1][1];
-                if(P_TOP[1]      > (c->ymax<<1)) P_TOP[1]     = (c->ymax<<1);
-                if(P_TOPRIGHT[0] < (c->xmin<<1)) P_TOPRIGHT[0]= (c->xmin<<1);
-                if(P_TOPRIGHT[0] > (c->xmax<<1)) P_TOPRIGHT[0]= (c->xmax<<1);
-                if(P_TOPRIGHT[1] > (c->ymax<<1)) P_TOPRIGHT[1]= (c->ymax<<1);
-
-                P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
-                P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-            }
-            P_MV1[0]= mx; //FIXME not correct if block != field_select
-            P_MV1[1]= my / 2;
-
-            dmin = epzs_motion_search2(s, &mx_i, &my_i, P, block, field_select+ref_index, mv_table, (1<<16)>>1);
-
-            dmin= c->sub_motion_search(s, &mx_i, &my_i, dmin, block, field_select+ref_index, size, h);
-
-            mv_table[xy][0]= mx_i;
-            mv_table[xy][1]= my_i;
-
-            if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
-                int dxy;
-
-                //FIXME chroma ME
-                uint8_t *ref= c->ref[field_select+ref_index][0] + (mx_i>>1) + (my_i>>1)*stride;
-                dxy = ((my_i & 1) << 1) | (mx_i & 1);
-
-                if(s->no_rounding){
-                    s->hdsp.put_no_rnd_pixels_tab[size][dxy](c->scratchpad, ref    , stride, h);
-                }else{
-                    s->hdsp.put_pixels_tab       [size][dxy](c->scratchpad, ref    , stride, h);
-                }
-                dmin= s->dsp.mb_cmp[size](s, c->src[block][0], c->scratchpad, stride, h);
-                dmin+= (mv_penalty[mx_i-c->pred_x] + mv_penalty[my_i-c->pred_y] + 1)*c->mb_penalty_factor;
-            }else
-                dmin+= c->mb_penalty_factor; //field_select bits
-
-            dmin += field_select != block; //slightly prefer same field
-
-            if(dmin < best_dmin){
-                best_dmin= dmin;
-                best_field= field_select;
-            }
-        }
-        {
-            int16_t (*mv_table)[2]= mv_tables[block][best_field];
-
-            if(mv_table[xy][0] != mx) same=0; //FIXME check if these checks work and are any good at all
-            if(mv_table[xy][1]&1) same=0;
-            if(mv_table[xy][1]*2 != my) same=0;
-            if(best_field != block) same=0;
-        }
-
-        field_select_tables[block][xy]= best_field;
-        dmin_sum += best_dmin;
-    }
-
-    c->ymin<<=1;
-    c->ymax<<=1;
-    c->stride>>=1;
-    c->uvstride>>=1;
-
-    if(same)
-        return INT_MAX;
-
-    switch(c->avctx->mb_cmp&0xFF){
-    /*case FF_CMP_SSE:
-        return dmin_sum+ 32*s->qscale*s->qscale;*/
-    case FF_CMP_RD:
-        return dmin_sum;
-    default:
-        return dmin_sum+ 11*c->mb_penalty_factor;
-    }
-}
-
-static inline int get_penalty_factor(int lambda, int lambda2, int type){
-    switch(type&0xFF){
-    default:
-    case FF_CMP_SAD:
-        return lambda>>FF_LAMBDA_SHIFT;
-    case FF_CMP_DCT:
-        return (3*lambda)>>(FF_LAMBDA_SHIFT+1);
-    case FF_CMP_SATD:
-    case FF_CMP_DCT264:
-        return (2*lambda)>>FF_LAMBDA_SHIFT;
-    case FF_CMP_RD:
-    case FF_CMP_PSNR:
-    case FF_CMP_SSE:
-    case FF_CMP_NSSE:
-        return lambda2>>FF_LAMBDA_SHIFT;
-    case FF_CMP_BIT:
-        return 1;
-    }
-}
-
-void ff_estimate_p_frame_motion(MpegEncContext * s,
-                                int mb_x, int mb_y)
-{
-    MotionEstContext * const c= &s->me;
-    uint8_t *pix, *ppix;
-    int sum, mx, my, dmin;
-    int varc;            ///< the variance of the block (sum of squared (p[y][x]-average))
-    int vard;            ///< sum of squared differences with the estimated motion vector
-    int P[10][2];
-    const int shift= 1+s->quarter_sample;
-    int mb_type=0;
-    Picture * const pic= &s->current_picture;
-
-    init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);
-
-    assert(s->quarter_sample==0 || s->quarter_sample==1);
-    assert(s->linesize == c->stride);
-    assert(s->uvlinesize == c->uvstride);
-
-    c->penalty_factor    = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
-    c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
-    c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
-    c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
-
-    get_limits(s, 16*mb_x, 16*mb_y);
-    c->skip=0;
-
-    /* intra / predictive decision */
-    pix = c->src[0][0];
-    sum = s->dsp.pix_sum(pix, s->linesize);
-    varc = s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)sum*sum)>>8) + 500;
-
-    pic->mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
-    pic->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8;
-    c->mb_var_sum_temp += (varc+128)>>8;
-
-    switch(s->me_method) {
-    case ME_ZERO:
-    default:
-        mx   = 0;
-        my   = 0;
-        dmin = 0;
-        break;
-    case ME_X1:
-    case ME_EPZS:
-       {
-            const int mot_stride = s->b8_stride;
-            const int mot_xy = s->block_index[0];
-
-            P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0];
-            P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1];
-
-            if(P_LEFT[0]       > (c->xmax<<shift)) P_LEFT[0]       = (c->xmax<<shift);
-
-            if(!s->first_slice_line) {
-                P_TOP[0]      = s->current_picture.motion_val[0][mot_xy - mot_stride    ][0];
-                P_TOP[1]      = s->current_picture.motion_val[0][mot_xy - mot_stride    ][1];
-                P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][0];
-                P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][1];
-                if(P_TOP[1]      > (c->ymax<<shift)) P_TOP[1]     = (c->ymax<<shift);
-                if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
-                if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
-
-                P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
-                P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-
-                if(s->out_format == FMT_H263){
-                    c->pred_x = P_MEDIAN[0];
-                    c->pred_y = P_MEDIAN[1];
-                }else { /* mpeg1 at least */
-                    c->pred_x= P_LEFT[0];
-                    c->pred_y= P_LEFT[1];
-                }
-            }else{
-                c->pred_x= P_LEFT[0];
-                c->pred_y= P_LEFT[1];
-            }
-
-        }
-        dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
-
-        break;
-    }
-
-    /* At this point (mx,my) are full-pell and the relative displacement */
-    ppix = c->ref[0][0] + (my * s->linesize) + mx;
-
-    vard = s->dsp.sse[0](NULL, pix, ppix, s->linesize, 16);
-
-    pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8;
-    c->mc_mb_var_sum_temp += (vard+128)>>8;
-
-    if(mb_type){
-        int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
-        int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
-        c->scene_change_score+= ff_sqrt(p_score) - ff_sqrt(i_score);
-
-        if(mb_type == CANDIDATE_MB_TYPE_INTER){
-            c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
-            set_p_mv_tables(s, mx, my, 1);
-        }else{
-            mx <<=shift;
-            my <<=shift;
-        }
-        if(mb_type == CANDIDATE_MB_TYPE_INTER4V){
-            h263_mv4_search(s, mx, my, shift);
-
-            set_p_mv_tables(s, mx, my, 0);
-        }
-        if(mb_type == CANDIDATE_MB_TYPE_INTER_I){
-            interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 1);
-        }
-    }else if(c->avctx->mb_decision > FF_MB_DECISION_SIMPLE){
-        int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
-        int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
-        c->scene_change_score+= ff_sqrt(p_score) - ff_sqrt(i_score);
-
-        if (vard*2 + 200*256 > varc)
-            mb_type|= CANDIDATE_MB_TYPE_INTRA;
-        if (varc*2 + 200*256 > vard || s->qscale > 24){
-//        if (varc*2 + 200*256 + 50*(s->lambda2>>FF_LAMBDA_SHIFT) > vard){
-            mb_type|= CANDIDATE_MB_TYPE_INTER;
-            c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
-            if(s->flags&CODEC_FLAG_MV0)
-                if(mx || my)
-                    mb_type |= CANDIDATE_MB_TYPE_SKIPPED; //FIXME check difference
-        }else{
-            mx <<=shift;
-            my <<=shift;
-        }
-        if((s->flags&CODEC_FLAG_4MV)
-           && !c->skip && varc>50<<8 && vard>10<<8){
-            if(h263_mv4_search(s, mx, my, shift) < INT_MAX)
-                mb_type|=CANDIDATE_MB_TYPE_INTER4V;
-
-            set_p_mv_tables(s, mx, my, 0);
-        }else
-            set_p_mv_tables(s, mx, my, 1);
-        if((s->flags&CODEC_FLAG_INTERLACED_ME)
-           && !c->skip){ //FIXME varc/d checks
-            if(interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 0) < INT_MAX)
-                mb_type |= CANDIDATE_MB_TYPE_INTER_I;
-        }
-    }else{
-        int intra_score, i;
-        mb_type= CANDIDATE_MB_TYPE_INTER;
-
-        dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
-        if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
-            dmin= get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
-
-        if((s->flags&CODEC_FLAG_4MV)
-           && !c->skip && varc>50<<8 && vard>10<<8){
-            int dmin4= h263_mv4_search(s, mx, my, shift);
-            if(dmin4 < dmin){
-                mb_type= CANDIDATE_MB_TYPE_INTER4V;
-                dmin=dmin4;
-            }
-        }
-        if((s->flags&CODEC_FLAG_INTERLACED_ME)
-           && !c->skip){ //FIXME varc/d checks
-            int dmin_i= interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 0);
-            if(dmin_i < dmin){
-                mb_type = CANDIDATE_MB_TYPE_INTER_I;
-                dmin= dmin_i;
-            }
-        }
-
-        set_p_mv_tables(s, mx, my, mb_type!=CANDIDATE_MB_TYPE_INTER4V);
-
-        /* get intra luma score */
-        if((c->avctx->mb_cmp&0xFF)==FF_CMP_SSE){
-            intra_score= varc - 500;
-        }else{
-            unsigned mean = (sum+128)>>8;
-            mean*= 0x01010101;
-
-            for(i=0; i<16; i++){
-                *(uint32_t*)(&c->scratchpad[i*s->linesize+ 0]) = mean;
-                *(uint32_t*)(&c->scratchpad[i*s->linesize+ 4]) = mean;
-                *(uint32_t*)(&c->scratchpad[i*s->linesize+ 8]) = mean;
-                *(uint32_t*)(&c->scratchpad[i*s->linesize+12]) = mean;
-            }
-
-            intra_score= s->dsp.mb_cmp[0](s, c->scratchpad, pix, s->linesize, 16);
-        }
-        intra_score += c->mb_penalty_factor*16;
-
-        if(intra_score < dmin){
-            mb_type= CANDIDATE_MB_TYPE_INTRA;
-            s->current_picture.mb_type[mb_y*s->mb_stride + mb_x] = CANDIDATE_MB_TYPE_INTRA; //FIXME cleanup
-        }else
-            s->current_picture.mb_type[mb_y*s->mb_stride + mb_x] = 0;
-
-        {
-            int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
-            int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
-            c->scene_change_score+= ff_sqrt(p_score) - ff_sqrt(i_score);
-        }
-    }
-
-    s->mb_type[mb_y*s->mb_stride + mb_x]= mb_type;
-}
-
-int ff_pre_estimate_p_frame_motion(MpegEncContext * s,
-                                    int mb_x, int mb_y)
-{
-    MotionEstContext * const c= &s->me;
-    int mx, my, dmin;
-    int P[10][2];
-    const int shift= 1+s->quarter_sample;
-    const int xy= mb_x + mb_y*s->mb_stride;
-    init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);
-
-    assert(s->quarter_sample==0 || s->quarter_sample==1);
-
-    c->pre_penalty_factor    = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_pre_cmp);
-    c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
-
-    get_limits(s, 16*mb_x, 16*mb_y);
-    c->skip=0;
-
-    P_LEFT[0]       = s->p_mv_table[xy + 1][0];
-    P_LEFT[1]       = s->p_mv_table[xy + 1][1];
-
-    if(P_LEFT[0]       < (c->xmin<<shift)) P_LEFT[0]       = (c->xmin<<shift);
-
-    /* special case for first line */
-    if (s->first_slice_line) {
-        c->pred_x= P_LEFT[0];
-        c->pred_y= P_LEFT[1];
-        P_TOP[0]= P_TOPRIGHT[0]= P_MEDIAN[0]=
-        P_TOP[1]= P_TOPRIGHT[1]= P_MEDIAN[1]= 0; //FIXME
-    } else {
-        P_TOP[0]      = s->p_mv_table[xy + s->mb_stride    ][0];
-        P_TOP[1]      = s->p_mv_table[xy + s->mb_stride    ][1];
-        P_TOPRIGHT[0] = s->p_mv_table[xy + s->mb_stride - 1][0];
-        P_TOPRIGHT[1] = s->p_mv_table[xy + s->mb_stride - 1][1];
-        if(P_TOP[1]      < (c->ymin<<shift)) P_TOP[1]     = (c->ymin<<shift);
-        if(P_TOPRIGHT[0] > (c->xmax<<shift)) P_TOPRIGHT[0]= (c->xmax<<shift);
-        if(P_TOPRIGHT[1] < (c->ymin<<shift)) P_TOPRIGHT[1]= (c->ymin<<shift);
-
-        P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
-        P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-
-        c->pred_x = P_MEDIAN[0];
-        c->pred_y = P_MEDIAN[1];
-    }
-
-    dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
-
-    s->p_mv_table[xy][0] = mx<<shift;
-    s->p_mv_table[xy][1] = my<<shift;
-
-    return dmin;
-}
-
-static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y,
-                             int16_t (*mv_table)[2], int ref_index, int f_code)
-{
-    MotionEstContext * const c= &s->me;
-    int mx, my, dmin;
-    int P[10][2];
-    const int shift= 1+s->quarter_sample;
-    const int mot_stride = s->mb_stride;
-    const int mot_xy = mb_y*mot_stride + mb_x;
-    uint8_t * const mv_penalty= c->mv_penalty[f_code] + MAX_MV;
-    int mv_scale;
-
-    c->penalty_factor    = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
-    c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
-    c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
-    c->current_mv_penalty= mv_penalty;
-
-    get_limits(s, 16*mb_x, 16*mb_y);
-
-    switch(s->me_method) {
-    case ME_ZERO:
-    default:
-        mx   = 0;
-        my   = 0;
-        dmin = 0;
-        break;
-    case ME_X1:
-    case ME_EPZS:
-        P_LEFT[0] = mv_table[mot_xy - 1][0];
-        P_LEFT[1] = mv_table[mot_xy - 1][1];
-
-        if (P_LEFT[0] > (c->xmax << shift)) P_LEFT[0] = (c->xmax << shift);
-
-        /* special case for first line */
-        if (!s->first_slice_line) {
-            P_TOP[0]      = mv_table[mot_xy - mot_stride    ][0];
-            P_TOP[1]      = mv_table[mot_xy - mot_stride    ][1];
-            P_TOPRIGHT[0] = mv_table[mot_xy - mot_stride + 1][0];
-            P_TOPRIGHT[1] = mv_table[mot_xy - mot_stride + 1][1];
-            if (P_TOP[1] > (c->ymax << shift)) P_TOP[1] = (c->ymax << shift);
-            if (P_TOPRIGHT[0] < (c->xmin << shift)) P_TOPRIGHT[0] = (c->xmin << shift);
-            if (P_TOPRIGHT[1] > (c->ymax << shift)) P_TOPRIGHT[1] = (c->ymax << shift);
-
-            P_MEDIAN[0] = mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
-            P_MEDIAN[1] = mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-        }
-        c->pred_x = P_LEFT[0];
-        c->pred_y = P_LEFT[1];
-
-        if(mv_table == s->b_forw_mv_table){
-            mv_scale= (s->pb_time<<16) / (s->pp_time<<shift);
-        }else{
-            mv_scale= ((s->pb_time - s->pp_time)<<16) / (s->pp_time<<shift);
-        }
-
-        dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, ref_index, s->p_mv_table, mv_scale, 0, 16);
-
-        break;
-    }
-
-    dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, ref_index, 0, 16);
-
-    if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
-        dmin= get_mb_score(s, mx, my, 0, ref_index, 0, 16, 1);
-
-//    s->mb_type[mb_y*s->mb_width + mb_x]= mb_type;
-    mv_table[mot_xy][0]= mx;
-    mv_table[mot_xy][1]= my;
-
-    return dmin;
-}
-
-static inline int check_bidir_mv(MpegEncContext * s,
-                   int motion_fx, int motion_fy,
-                   int motion_bx, int motion_by,
-                   int pred_fx, int pred_fy,
-                   int pred_bx, int pred_by,
-                   int size, int h)
-{
-    //FIXME optimize?
-    //FIXME better f_code prediction (max mv & distance)
-    //FIXME pointers
-    MotionEstContext * const c= &s->me;
-    uint8_t * const mv_penalty_f= c->mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
-    uint8_t * const mv_penalty_b= c->mv_penalty[s->b_code] + MAX_MV; // f_code of the prev frame
-    int stride= c->stride;
-    uint8_t *dest_y = c->scratchpad;
-    uint8_t *ptr;
-    int dxy;
-    int src_x, src_y;
-    int fbmin;
-    uint8_t **src_data= c->src[0];
-    uint8_t **ref_data= c->ref[0];
-    uint8_t **ref2_data= c->ref[2];
-
-    if(s->quarter_sample){
-        dxy = ((motion_fy & 3) << 2) | (motion_fx & 3);
-        src_x = motion_fx >> 2;
-        src_y = motion_fy >> 2;
-
-        ptr = ref_data[0] + (src_y * stride) + src_x;
-        s->dsp.put_qpel_pixels_tab[0][dxy](dest_y    , ptr    , stride);
-
-        dxy = ((motion_by & 3) << 2) | (motion_bx & 3);
-        src_x = motion_bx >> 2;
-        src_y = motion_by >> 2;
-
-        ptr = ref2_data[0] + (src_y * stride) + src_x;
-        s->dsp.avg_qpel_pixels_tab[size][dxy](dest_y    , ptr    , stride);
-    }else{
-        dxy = ((motion_fy & 1) << 1) | (motion_fx & 1);
-        src_x = motion_fx >> 1;
-        src_y = motion_fy >> 1;
-
-        ptr = ref_data[0] + (src_y * stride) + src_x;
-        s->hdsp.put_pixels_tab[size][dxy](dest_y    , ptr    , stride, h);
-
-        dxy = ((motion_by & 1) << 1) | (motion_bx & 1);
-        src_x = motion_bx >> 1;
-        src_y = motion_by >> 1;
-
-        ptr = ref2_data[0] + (src_y * stride) + src_x;
-        s->hdsp.avg_pixels_tab[size][dxy](dest_y    , ptr    , stride, h);
-    }
-
-    fbmin = (mv_penalty_f[motion_fx-pred_fx] + mv_penalty_f[motion_fy-pred_fy])*c->mb_penalty_factor
-           +(mv_penalty_b[motion_bx-pred_bx] + mv_penalty_b[motion_by-pred_by])*c->mb_penalty_factor
-           + s->dsp.mb_cmp[size](s, src_data[0], dest_y, stride, h); //FIXME new_pic
-
-    if(c->avctx->mb_cmp&FF_CMP_CHROMA){
-    }
-    //FIXME CHROMA !!!
-
-    return fbmin;
-}
-
-/* refine the bidir vectors in hq mode and return the score in both lq & hq mode*/
-static inline int bidir_refine(MpegEncContext * s, int mb_x, int mb_y)
-{
-    MotionEstContext * const c= &s->me;
-    const int mot_stride = s->mb_stride;
-    const int xy = mb_y *mot_stride + mb_x;
-    int fbmin;
-    int pred_fx= s->b_bidir_forw_mv_table[xy-1][0];
-    int pred_fy= s->b_bidir_forw_mv_table[xy-1][1];
-    int pred_bx= s->b_bidir_back_mv_table[xy-1][0];
-    int pred_by= s->b_bidir_back_mv_table[xy-1][1];
-    int motion_fx= s->b_bidir_forw_mv_table[xy][0]= s->b_forw_mv_table[xy][0];
-    int motion_fy= s->b_bidir_forw_mv_table[xy][1]= s->b_forw_mv_table[xy][1];
-    int motion_bx= s->b_bidir_back_mv_table[xy][0]= s->b_back_mv_table[xy][0];
-    int motion_by= s->b_bidir_back_mv_table[xy][1]= s->b_back_mv_table[xy][1];
-    const int flags= c->sub_flags;
-    const int qpel= flags&FLAG_QPEL;
-    const int shift= 1+qpel;
-    const int xmin= c->xmin<<shift;
-    const int ymin= c->ymin<<shift;
-    const int xmax= c->xmax<<shift;
-    const int ymax= c->ymax<<shift;
-#define HASH(fx,fy,bx,by) ((fx)+17*(fy)+63*(bx)+117*(by))
-#define HASH8(fx,fy,bx,by) ((uint8_t)HASH(fx,fy,bx,by))
-    int hashidx= HASH(motion_fx,motion_fy, motion_bx, motion_by);
-    uint8_t map[256] = { 0 };
-
-    map[hashidx&255] = 1;
-
-    fbmin= check_bidir_mv(s, motion_fx, motion_fy,
-                          motion_bx, motion_by,
-                          pred_fx, pred_fy,
-                          pred_bx, pred_by,
-                          0, 16);
-
-    if(s->avctx->bidir_refine){
-        int end;
-        static const uint8_t limittab[5]={0,8,32,64,80};
-        const int limit= limittab[s->avctx->bidir_refine];
-        static const int8_t vect[][4]={
-{ 0, 0, 0, 1}, { 0, 0, 0,-1}, { 0, 0, 1, 0}, { 0, 0,-1, 0}, { 0, 1, 0, 0}, { 0,-1, 0, 0}, { 1, 0, 0, 0}, {-1, 0, 0, 0},
-
-{ 0, 0, 1, 1}, { 0, 0,-1,-1}, { 0, 1, 1, 0}, { 0,-1,-1, 0}, { 1, 1, 0, 0}, {-1,-1, 0, 0}, { 1, 0, 0, 1}, {-1, 0, 0,-1},
-{ 0, 1, 0, 1}, { 0,-1, 0,-1}, { 1, 0, 1, 0}, {-1, 0,-1, 0},
-{ 0, 0,-1, 1}, { 0, 0, 1,-1}, { 0,-1, 1, 0}, { 0, 1,-1, 0}, {-1, 1, 0, 0}, { 1,-1, 0, 0}, { 1, 0, 0,-1}, {-1, 0, 0, 1},
-{ 0,-1, 0, 1}, { 0, 1, 0,-1}, {-1, 0, 1, 0}, { 1, 0,-1, 0},
-
-{ 0, 1, 1, 1}, { 0,-1,-1,-1}, { 1, 1, 1, 0}, {-1,-1,-1, 0}, { 1, 1, 0, 1}, {-1,-1, 0,-1}, { 1, 0, 1, 1}, {-1, 0,-1,-1},
-{ 0,-1, 1, 1}, { 0, 1,-1,-1}, {-1, 1, 1, 0}, { 1,-1,-1, 0}, { 1, 1, 0,-1}, {-1,-1, 0, 1}, { 1, 0,-1, 1}, {-1, 0, 1,-1},
-{ 0, 1,-1, 1}, { 0,-1, 1,-1}, { 1,-1, 1, 0}, {-1, 1,-1, 0}, {-1, 1, 0, 1}, { 1,-1, 0,-1}, { 1, 0, 1,-1}, {-1, 0,-1, 1},
-{ 0, 1, 1,-1}, { 0,-1,-1, 1}, { 1, 1,-1, 0}, {-1,-1, 1, 0}, { 1,-1, 0, 1}, {-1, 1, 0,-1}, {-1, 0, 1, 1}, { 1, 0,-1,-1},
-
-{ 1, 1, 1, 1}, {-1,-1,-1,-1},
-{ 1, 1, 1,-1}, {-1,-1,-1, 1}, { 1, 1,-1, 1}, {-1,-1, 1,-1}, { 1,-1, 1, 1}, {-1, 1,-1,-1}, {-1, 1, 1, 1}, { 1,-1,-1,-1},
-{ 1, 1,-1,-1}, {-1,-1, 1, 1}, { 1,-1,-1, 1}, {-1, 1, 1,-1}, { 1,-1, 1,-1}, {-1, 1,-1, 1},
-        };
-        static const uint8_t hash[]={
-HASH8( 0, 0, 0, 1), HASH8( 0, 0, 0,-1), HASH8( 0, 0, 1, 0), HASH8( 0, 0,-1, 0), HASH8( 0, 1, 0, 0), HASH8( 0,-1, 0, 0), HASH8( 1, 0, 0, 0), HASH8(-1, 0, 0, 0),
-
-HASH8( 0, 0, 1, 1), HASH8( 0, 0,-1,-1), HASH8( 0, 1, 1, 0), HASH8( 0,-1,-1, 0), HASH8( 1, 1, 0, 0), HASH8(-1,-1, 0, 0), HASH8( 1, 0, 0, 1), HASH8(-1, 0, 0,-1),
-HASH8( 0, 1, 0, 1), HASH8( 0,-1, 0,-1), HASH8( 1, 0, 1, 0), HASH8(-1, 0,-1, 0),
-HASH8( 0, 0,-1, 1), HASH8( 0, 0, 1,-1), HASH8( 0,-1, 1, 0), HASH8( 0, 1,-1, 0), HASH8(-1, 1, 0, 0), HASH8( 1,-1, 0, 0), HASH8( 1, 0, 0,-1), HASH8(-1, 0, 0, 1),
-HASH8( 0,-1, 0, 1), HASH8( 0, 1, 0,-1), HASH8(-1, 0, 1, 0), HASH8( 1, 0,-1, 0),
-
-HASH8( 0, 1, 1, 1), HASH8( 0,-1,-1,-1), HASH8( 1, 1, 1, 0), HASH8(-1,-1,-1, 0), HASH8( 1, 1, 0, 1), HASH8(-1,-1, 0,-1), HASH8( 1, 0, 1, 1), HASH8(-1, 0,-1,-1),
-HASH8( 0,-1, 1, 1), HASH8( 0, 1,-1,-1), HASH8(-1, 1, 1, 0), HASH8( 1,-1,-1, 0), HASH8( 1, 1, 0,-1), HASH8(-1,-1, 0, 1), HASH8( 1, 0,-1, 1), HASH8(-1, 0, 1,-1),
-HASH8( 0, 1,-1, 1), HASH8( 0,-1, 1,-1), HASH8( 1,-1, 1, 0), HASH8(-1, 1,-1, 0), HASH8(-1, 1, 0, 1), HASH8( 1,-1, 0,-1), HASH8( 1, 0, 1,-1), HASH8(-1, 0,-1, 1),
-HASH8( 0, 1, 1,-1), HASH8( 0,-1,-1, 1), HASH8( 1, 1,-1, 0), HASH8(-1,-1, 1, 0), HASH8( 1,-1, 0, 1), HASH8(-1, 1, 0,-1), HASH8(-1, 0, 1, 1), HASH8( 1, 0,-1,-1),
-
-HASH8( 1, 1, 1, 1), HASH8(-1,-1,-1,-1),
-HASH8( 1, 1, 1,-1), HASH8(-1,-1,-1, 1), HASH8( 1, 1,-1, 1), HASH8(-1,-1, 1,-1), HASH8( 1,-1, 1, 1), HASH8(-1, 1,-1,-1), HASH8(-1, 1, 1, 1), HASH8( 1,-1,-1,-1),
-HASH8( 1, 1,-1,-1), HASH8(-1,-1, 1, 1), HASH8( 1,-1,-1, 1), HASH8(-1, 1, 1,-1), HASH8( 1,-1, 1,-1), HASH8(-1, 1,-1, 1),
-};
-
-#define CHECK_BIDIR(fx,fy,bx,by)\
-    if( !map[(hashidx+HASH(fx,fy,bx,by))&255]\
-       &&(fx<=0 || motion_fx+fx<=xmax) && (fy<=0 || motion_fy+fy<=ymax) && (bx<=0 || motion_bx+bx<=xmax) && (by<=0 || motion_by+by<=ymax)\
-       &&(fx>=0 || motion_fx+fx>=xmin) && (fy>=0 || motion_fy+fy>=ymin) && (bx>=0 || motion_bx+bx>=xmin) && (by>=0 || motion_by+by>=ymin)){\
-        int score;\
-        map[(hashidx+HASH(fx,fy,bx,by))&255] = 1;\
-        score= check_bidir_mv(s, motion_fx+fx, motion_fy+fy, motion_bx+bx, motion_by+by, pred_fx, pred_fy, pred_bx, pred_by, 0, 16);\
-        if(score < fbmin){\
-            hashidx += HASH(fx,fy,bx,by);\
-            fbmin= score;\
-            motion_fx+=fx;\
-            motion_fy+=fy;\
-            motion_bx+=bx;\
-            motion_by+=by;\
-            end=0;\
-        }\
-    }
-#define CHECK_BIDIR2(a,b,c,d)\
-CHECK_BIDIR(a,b,c,d)\
-CHECK_BIDIR(-(a),-(b),-(c),-(d))
-
-        do{
-            int i;
-            int borderdist=0;
-            end=1;
-
-            CHECK_BIDIR2(0,0,0,1)
-            CHECK_BIDIR2(0,0,1,0)
-            CHECK_BIDIR2(0,1,0,0)
-            CHECK_BIDIR2(1,0,0,0)
-
-            for(i=8; i<limit; i++){
-                int fx= motion_fx+vect[i][0];
-                int fy= motion_fy+vect[i][1];
-                int bx= motion_bx+vect[i][2];
-                int by= motion_by+vect[i][3];
-                if(borderdist<=0){
-                    int a= (xmax - FFMAX(fx,bx))|(FFMIN(fx,bx) - xmin);
-                    int b= (ymax - FFMAX(fy,by))|(FFMIN(fy,by) - ymin);
-                    if((a|b) < 0)
-                        map[(hashidx+hash[i])&255] = 1;
-                }
-                if(!map[(hashidx+hash[i])&255]){
-                    int score;
-                    map[(hashidx+hash[i])&255] = 1;
-                    score= check_bidir_mv(s, fx, fy, bx, by, pred_fx, pred_fy, pred_bx, pred_by, 0, 16);
-                    if(score < fbmin){
-                        hashidx += hash[i];
-                        fbmin= score;
-                        motion_fx=fx;
-                        motion_fy=fy;
-                        motion_bx=bx;
-                        motion_by=by;
-                        end=0;
-                        borderdist--;
-                        if(borderdist<=0){
-                            int a= FFMIN(xmax - FFMAX(fx,bx), FFMIN(fx,bx) - xmin);
-                            int b= FFMIN(ymax - FFMAX(fy,by), FFMIN(fy,by) - ymin);
-                            borderdist= FFMIN(a,b);
-                        }
-                    }
-                }
-            }
-        }while(!end);
-    }
-
-    s->b_bidir_forw_mv_table[xy][0]= motion_fx;
-    s->b_bidir_forw_mv_table[xy][1]= motion_fy;
-    s->b_bidir_back_mv_table[xy][0]= motion_bx;
-    s->b_bidir_back_mv_table[xy][1]= motion_by;
-
-    return fbmin;
-}
-
-static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y)
-{
-    MotionEstContext * const c= &s->me;
-    int P[10][2];
-    const int mot_stride = s->mb_stride;
-    const int mot_xy = mb_y*mot_stride + mb_x;
-    const int shift= 1+s->quarter_sample;
-    int dmin, i;
-    const int time_pp= s->pp_time;
-    const int time_pb= s->pb_time;
-    int mx, my, xmin, xmax, ymin, ymax;
-    int16_t (*mv_table)[2]= s->b_direct_mv_table;
-
-    c->current_mv_penalty= c->mv_penalty[1] + MAX_MV;
-    ymin= xmin=(-32)>>shift;
-    ymax= xmax=   31>>shift;
-
-    if (IS_8X8(s->next_picture.mb_type[mot_xy])) {
-        s->mv_type= MV_TYPE_8X8;
-    }else{
-        s->mv_type= MV_TYPE_16X16;
-    }
-
-    for(i=0; i<4; i++){
-        int index= s->block_index[i];
-        int min, max;
-
-        c->co_located_mv[i][0] = s->next_picture.motion_val[0][index][0];
-        c->co_located_mv[i][1] = s->next_picture.motion_val[0][index][1];
-        c->direct_basis_mv[i][0]= c->co_located_mv[i][0]*time_pb/time_pp + ((i& 1)<<(shift+3));
-        c->direct_basis_mv[i][1]= c->co_located_mv[i][1]*time_pb/time_pp + ((i>>1)<<(shift+3));
-//        c->direct_basis_mv[1][i][0]= c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(shift+3);
-//        c->direct_basis_mv[1][i][1]= c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(shift+3);
-
-        max= FFMAX(c->direct_basis_mv[i][0], c->direct_basis_mv[i][0] - c->co_located_mv[i][0])>>shift;
-        min= FFMIN(c->direct_basis_mv[i][0], c->direct_basis_mv[i][0] - c->co_located_mv[i][0])>>shift;
-        max+= 16*mb_x + 1; // +-1 is for the simpler rounding
-        min+= 16*mb_x - 1;
-        xmax= FFMIN(xmax, s->width - max);
-        xmin= FFMAX(xmin, - 16     - min);
-
-        max= FFMAX(c->direct_basis_mv[i][1], c->direct_basis_mv[i][1] - c->co_located_mv[i][1])>>shift;
-        min= FFMIN(c->direct_basis_mv[i][1], c->direct_basis_mv[i][1] - c->co_located_mv[i][1])>>shift;
-        max+= 16*mb_y + 1; // +-1 is for the simpler rounding
-        min+= 16*mb_y - 1;
-        ymax= FFMIN(ymax, s->height - max);
-        ymin= FFMAX(ymin, - 16      - min);
-
-        if(s->mv_type == MV_TYPE_16X16) break;
-    }
-
-    assert(xmax <= 15 && ymax <= 15 && xmin >= -16 && ymin >= -16);
-
-    if(xmax < 0 || xmin >0 || ymax < 0 || ymin > 0){
-        s->b_direct_mv_table[mot_xy][0]= 0;
-        s->b_direct_mv_table[mot_xy][1]= 0;
-
-        return 256*256*256*64;
-    }
-
-    c->xmin= xmin;
-    c->ymin= ymin;
-    c->xmax= xmax;
-    c->ymax= ymax;
-    c->flags     |= FLAG_DIRECT;
-    c->sub_flags |= FLAG_DIRECT;
-    c->pred_x=0;
-    c->pred_y=0;
-
-    P_LEFT[0]        = av_clip(mv_table[mot_xy - 1][0], xmin<<shift, xmax<<shift);
-    P_LEFT[1]        = av_clip(mv_table[mot_xy - 1][1], ymin<<shift, ymax<<shift);
-
-    /* special case for first line */
-    if (!s->first_slice_line) { //FIXME maybe allow this over thread boundary as it is clipped
-        P_TOP[0]      = av_clip(mv_table[mot_xy - mot_stride             ][0], xmin<<shift, xmax<<shift);
-        P_TOP[1]      = av_clip(mv_table[mot_xy - mot_stride             ][1], ymin<<shift, ymax<<shift);
-        P_TOPRIGHT[0] = av_clip(mv_table[mot_xy - mot_stride + 1         ][0], xmin<<shift, xmax<<shift);
-        P_TOPRIGHT[1] = av_clip(mv_table[mot_xy - mot_stride + 1         ][1], ymin<<shift, ymax<<shift);
-
-        P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
-        P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-    }
-
-    dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, mv_table, 1<<(16-shift), 0, 16);
-    if(c->sub_flags&FLAG_QPEL)
-        dmin = qpel_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
-    else
-        dmin = hpel_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
-
-    if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
-        dmin= get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
-
-    get_limits(s, 16*mb_x, 16*mb_y); //restore c->?min/max, maybe not needed
-
-    mv_table[mot_xy][0]= mx;
-    mv_table[mot_xy][1]= my;
-    c->flags     &= ~FLAG_DIRECT;
-    c->sub_flags &= ~FLAG_DIRECT;
-
-    return dmin;
-}
-
-void ff_estimate_b_frame_motion(MpegEncContext * s,
-                             int mb_x, int mb_y)
-{
-    MotionEstContext * const c= &s->me;
-    const int penalty_factor= c->mb_penalty_factor;
-    int fmin, bmin, dmin, fbmin, bimin, fimin;
-    int type=0;
-    const int xy = mb_y*s->mb_stride + mb_x;
-    init_ref(c, s->new_picture.f.data, s->last_picture.f.data,
-             s->next_picture.f.data, 16 * mb_x, 16 * mb_y, 2);
-
-    get_limits(s, 16*mb_x, 16*mb_y);
-
-    c->skip=0;
-
-    if (s->codec_id == AV_CODEC_ID_MPEG4 && s->next_picture.mbskip_table[xy]) {
-        int score= direct_search(s, mb_x, mb_y); //FIXME just check 0,0
-
-        score= ((unsigned)(score*score + 128*256))>>16;
-        c->mc_mb_var_sum_temp += score;
-        s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
-        s->mb_type[mb_y*s->mb_stride + mb_x]= CANDIDATE_MB_TYPE_DIRECT0;
-
-        return;
-    }
-
-    if (s->codec_id == AV_CODEC_ID_MPEG4)
-        dmin= direct_search(s, mb_x, mb_y);
-    else
-        dmin= INT_MAX;
-//FIXME penalty stuff for non mpeg4
-    c->skip=0;
-    fmin = estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, 0, s->f_code) +
-           3 * penalty_factor;
-
-    c->skip=0;
-    bmin = estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, 2, s->b_code) +
-           2 * penalty_factor;
-    av_dlog(s, " %d %d ", s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1]);
-
-    c->skip=0;
-    fbmin= bidir_refine(s, mb_x, mb_y) + penalty_factor;
-    av_dlog(s, "%d %d %d %d\n", dmin, fmin, bmin, fbmin);
-
-    if(s->flags & CODEC_FLAG_INTERLACED_ME){
-//FIXME mb type penalty
-        c->skip=0;
-        c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
-        fimin= interlaced_search(s, 0,
-                                 s->b_field_mv_table[0], s->b_field_select_table[0],
-                                 s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1], 0);
-        c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_MV;
-        bimin= interlaced_search(s, 2,
-                                 s->b_field_mv_table[1], s->b_field_select_table[1],
-                                 s->b_back_mv_table[xy][0], s->b_back_mv_table[xy][1], 0);
-    }else
-        fimin= bimin= INT_MAX;
-
-    {
-        int score= fmin;
-        type = CANDIDATE_MB_TYPE_FORWARD;
-
-        if (dmin <= score){
-            score = dmin;
-            type = CANDIDATE_MB_TYPE_DIRECT;
-        }
-        if(bmin<score){
-            score=bmin;
-            type= CANDIDATE_MB_TYPE_BACKWARD;
-        }
-        if(fbmin<score){
-            score=fbmin;
-            type= CANDIDATE_MB_TYPE_BIDIR;
-        }
-        if(fimin<score){
-            score=fimin;
-            type= CANDIDATE_MB_TYPE_FORWARD_I;
-        }
-        if(bimin<score){
-            score=bimin;
-            type= CANDIDATE_MB_TYPE_BACKWARD_I;
-        }
-
-        score= ((unsigned)(score*score + 128*256))>>16;
-        c->mc_mb_var_sum_temp += score;
-        s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
-    }
-
-    if(c->avctx->mb_decision > FF_MB_DECISION_SIMPLE){
-        type= CANDIDATE_MB_TYPE_FORWARD | CANDIDATE_MB_TYPE_BACKWARD | CANDIDATE_MB_TYPE_BIDIR | CANDIDATE_MB_TYPE_DIRECT;
-        if(fimin < INT_MAX)
-            type |= CANDIDATE_MB_TYPE_FORWARD_I;
-        if(bimin < INT_MAX)
-            type |= CANDIDATE_MB_TYPE_BACKWARD_I;
-        if(fimin < INT_MAX && bimin < INT_MAX){
-            type |= CANDIDATE_MB_TYPE_BIDIR_I;
-        }
-         //FIXME something smarter
-        if(dmin>256*256*16) type&= ~CANDIDATE_MB_TYPE_DIRECT; //do not try direct mode if it is invalid for this MB
-        if(s->codec_id == AV_CODEC_ID_MPEG4 && type&CANDIDATE_MB_TYPE_DIRECT && s->flags&CODEC_FLAG_MV0 && *(uint32_t*)s->b_direct_mv_table[xy])
-            type |= CANDIDATE_MB_TYPE_DIRECT0;
-    }
-
-    s->mb_type[mb_y*s->mb_stride + mb_x]= type;
-}
-
-/* find best f_code for ME which do unlimited searches */
-int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
-{
-    if(s->me_method>=ME_EPZS){
-        int score[8];
-        int i, y, range= s->avctx->me_range ? s->avctx->me_range : (INT_MAX/2);
-        uint8_t * fcode_tab= s->fcode_tab;
-        int best_fcode=-1;
-        int best_score=-10000000;
-
-        if(s->msmpeg4_version)
-            range= FFMIN(range, 16);
-        else if(s->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL)
-            range= FFMIN(range, 256);
-
-        for(i=0; i<8; i++) score[i]= s->mb_num*(8-i);
-
-        for(y=0; y<s->mb_height; y++){
-            int x;
-            int xy= y*s->mb_stride;
-            for(x=0; x<s->mb_width; x++){
-                if(s->mb_type[xy] & type){
-                    int mx= mv_table[xy][0];
-                    int my= mv_table[xy][1];
-                    int fcode= FFMAX(fcode_tab[mx + MAX_MV],
-                                     fcode_tab[my + MAX_MV]);
-                    int j;
-
-                        if(mx >= range || mx < -range ||
-                           my >= range || my < -range)
-                            continue;
-
-                    for(j=0; j<fcode && j<8; j++){
-                        if(s->pict_type==AV_PICTURE_TYPE_B || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy])
-                            score[j]-= 170;
-                    }
-                }
-                xy++;
-            }
-        }
-
-        for(i=1; i<8; i++){
-            if(score[i] > best_score){
-                best_score= score[i];
-                best_fcode= i;
-            }
-        }
-
-        return best_fcode;
-    }else{
-        return 1;
-    }
-}
-
-void ff_fix_long_p_mvs(MpegEncContext * s)
-{
-    MotionEstContext * const c= &s->me;
-    const int f_code= s->f_code;
-    int y, range;
-    assert(s->pict_type==AV_PICTURE_TYPE_P);
-
-    range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code);
-
-    assert(range <= 16 || !s->msmpeg4_version);
-    assert(range <=256 || !(s->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL));
-
-    if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range;
-
-    if(s->flags&CODEC_FLAG_4MV){
-        const int wrap= s->b8_stride;
-
-        /* clip / convert to intra 8x8 type MVs */
-        for(y=0; y<s->mb_height; y++){
-            int xy= y*2*wrap;
-            int i= y*s->mb_stride;
-            int x;
-
-            for(x=0; x<s->mb_width; x++){
-                if(s->mb_type[i]&CANDIDATE_MB_TYPE_INTER4V){
-                    int block;
-                    for(block=0; block<4; block++){
-                        int off= (block& 1) + (block>>1)*wrap;
-                        int mx = s->current_picture.motion_val[0][ xy + off ][0];
-                        int my = s->current_picture.motion_val[0][ xy + off ][1];
-
-                        if(   mx >=range || mx <-range
-                           || my >=range || my <-range){
-                            s->mb_type[i] &= ~CANDIDATE_MB_TYPE_INTER4V;
-                            s->mb_type[i] |= CANDIDATE_MB_TYPE_INTRA;
-                            s->current_picture.mb_type[i] = CANDIDATE_MB_TYPE_INTRA;
-                        }
-                    }
-                }
-                xy+=2;
-                i++;
-            }
-        }
-    }
-}
-
-/**
- *
- * @param truncate 1 for truncation, 0 for using intra
- */
-void ff_fix_long_mvs(MpegEncContext * s, uint8_t *field_select_table, int field_select,
-                     int16_t (*mv_table)[2], int f_code, int type, int truncate)
-{
-    MotionEstContext * const c= &s->me;
-    int y, h_range, v_range;
-
-    // RAL: 8 in MPEG-1, 16 in MPEG-4
-    int range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code);
-
-    if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range;
-
-    h_range= range;
-    v_range= field_select_table ? range>>1 : range;
-
-    /* clip / convert to intra 16x16 type MVs */
-    for(y=0; y<s->mb_height; y++){
-        int x;
-        int xy= y*s->mb_stride;
-        for(x=0; x<s->mb_width; x++){
-            if (s->mb_type[xy] & type){    // RAL: "type" test added...
-                if(field_select_table==NULL || field_select_table[xy] == field_select){
-                    if(   mv_table[xy][0] >=h_range || mv_table[xy][0] <-h_range
-                       || mv_table[xy][1] >=v_range || mv_table[xy][1] <-v_range){
-
-                        if(truncate){
-                            if     (mv_table[xy][0] > h_range-1) mv_table[xy][0]=  h_range-1;
-                            else if(mv_table[xy][0] < -h_range ) mv_table[xy][0]= -h_range;
-                            if     (mv_table[xy][1] > v_range-1) mv_table[xy][1]=  v_range-1;
-                            else if(mv_table[xy][1] < -v_range ) mv_table[xy][1]= -v_range;
-                        }else{
-                            s->mb_type[xy] &= ~type;
-                            s->mb_type[xy] |= CANDIDATE_MB_TYPE_INTRA;
-                            mv_table[xy][0]=
-                            mv_table[xy][1]= 0;
-                        }
-                    }
-                }
-            }
-            xy++;
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/motion_est_template.c b/deps/libav/libavcodec/motion_est_template.c
deleted file mode 100644
index 7228744..0000000
--- a/deps/libav/libavcodec/motion_est_template.c
+++ /dev/null
@@ -1,1105 +0,0 @@
-/*
- * Motion estimation
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Motion estimation template.
- */
-
-//Let us hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...)
-#define LOAD_COMMON\
-    uint32_t av_unused * const score_map= c->score_map;\
-    const int av_unused xmin= c->xmin;\
-    const int av_unused ymin= c->ymin;\
-    const int av_unused xmax= c->xmax;\
-    const int av_unused ymax= c->ymax;\
-    uint8_t *mv_penalty= c->current_mv_penalty;\
-    const int pred_x= c->pred_x;\
-    const int pred_y= c->pred_y;\
-
-#define CHECK_HALF_MV(dx, dy, x, y)\
-{\
-    const int hx= 2*(x)+(dx);\
-    const int hy= 2*(y)+(dy);\
-    d= cmp_hpel(s, x, y, dx, dy, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);\
-    d += (mv_penalty[hx - pred_x] + mv_penalty[hy - pred_y])*penalty_factor;\
-    COPY3_IF_LT(dmin, d, bx, hx, by, hy)\
-}
-
-static int hpel_motion_search(MpegEncContext * s,
-                                  int *mx_ptr, int *my_ptr, int dmin,
-                                  int src_index, int ref_index,
-                                  int size, int h)
-{
-    MotionEstContext * const c= &s->me;
-    const int mx = *mx_ptr;
-    const int my = *my_ptr;
-    const int penalty_factor= c->sub_penalty_factor;
-    me_cmp_func cmp_sub, chroma_cmp_sub;
-    int bx=2*mx, by=2*my;
-
-    LOAD_COMMON
-    int flags= c->sub_flags;
-
- //FIXME factorize
-
-    cmp_sub= s->dsp.me_sub_cmp[size];
-    chroma_cmp_sub= s->dsp.me_sub_cmp[size+1];
-
-    if(c->skip){ //FIXME move out of hpel?
-        *mx_ptr = 0;
-        *my_ptr = 0;
-        return dmin;
-    }
-
-    if(c->avctx->me_cmp != c->avctx->me_sub_cmp){
-        dmin= cmp(s, mx, my, 0, 0, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
-        if(mx || my || size>0)
-            dmin += (mv_penalty[2*mx - pred_x] + mv_penalty[2*my - pred_y])*penalty_factor;
-    }
-
-    if (mx > xmin && mx < xmax &&
-        my > ymin && my < ymax) {
-        int d= dmin;
-        const int index= (my<<ME_MAP_SHIFT) + mx;
-        const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
-                     + (mv_penalty[bx   - pred_x] + mv_penalty[by-2 - pred_y])*c->penalty_factor;
-        const int l= score_map[(index- 1               )&(ME_MAP_SIZE-1)]
-                     + (mv_penalty[bx-2 - pred_x] + mv_penalty[by   - pred_y])*c->penalty_factor;
-        const int r= score_map[(index+ 1               )&(ME_MAP_SIZE-1)]
-                     + (mv_penalty[bx+2 - pred_x] + mv_penalty[by   - pred_y])*c->penalty_factor;
-        const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
-                     + (mv_penalty[bx   - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor;
-
-        unsigned key;
-        unsigned map_generation= c->map_generation;
-#ifndef NDEBUG
-        uint32_t *map= c->map;
-#endif
-        key= ((my-1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
-        assert(map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
-        key= ((my+1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
-        assert(map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
-        key= ((my)<<ME_MAP_MV_BITS) + (mx+1) + map_generation;
-        assert(map[(index+1)&(ME_MAP_SIZE-1)] == key);
-        key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;
-        assert(map[(index-1)&(ME_MAP_SIZE-1)] == key);
-        if(t<=b){
-            CHECK_HALF_MV(0, 1, mx  ,my-1)
-            if(l<=r){
-                CHECK_HALF_MV(1, 1, mx-1, my-1)
-                if(t+r<=b+l){
-                    CHECK_HALF_MV(1, 1, mx  , my-1)
-                }else{
-                    CHECK_HALF_MV(1, 1, mx-1, my  )
-                }
-                CHECK_HALF_MV(1, 0, mx-1, my  )
-            }else{
-                CHECK_HALF_MV(1, 1, mx  , my-1)
-                if(t+l<=b+r){
-                    CHECK_HALF_MV(1, 1, mx-1, my-1)
-                }else{
-                    CHECK_HALF_MV(1, 1, mx  , my  )
-                }
-                CHECK_HALF_MV(1, 0, mx  , my  )
-            }
-        }else{
-            if(l<=r){
-                if(t+l<=b+r){
-                    CHECK_HALF_MV(1, 1, mx-1, my-1)
-                }else{
-                    CHECK_HALF_MV(1, 1, mx  , my  )
-                }
-                CHECK_HALF_MV(1, 0, mx-1, my)
-                CHECK_HALF_MV(1, 1, mx-1, my)
-            }else{
-                if(t+r<=b+l){
-                    CHECK_HALF_MV(1, 1, mx  , my-1)
-                }else{
-                    CHECK_HALF_MV(1, 1, mx-1, my)
-                }
-                CHECK_HALF_MV(1, 0, mx  , my)
-                CHECK_HALF_MV(1, 1, mx  , my)
-            }
-            CHECK_HALF_MV(0, 1, mx  , my)
-        }
-        assert(bx >= xmin*2 && bx <= xmax*2 && by >= ymin*2 && by <= ymax*2);
-    }
-
-    *mx_ptr = bx;
-    *my_ptr = by;
-
-    return dmin;
-}
-
-static int no_sub_motion_search(MpegEncContext * s,
-          int *mx_ptr, int *my_ptr, int dmin,
-                                  int src_index, int ref_index,
-                                  int size, int h)
-{
-    (*mx_ptr)<<=1;
-    (*my_ptr)<<=1;
-    return dmin;
-}
-
-static inline int get_mb_score(MpegEncContext *s, int mx, int my,
-                               int src_index, int ref_index, int size,
-                               int h, int add_rate)
-{
-//    const int check_luma= s->dsp.me_sub_cmp != s->dsp.mb_cmp;
-    MotionEstContext * const c= &s->me;
-    const int penalty_factor= c->mb_penalty_factor;
-    const int flags= c->mb_flags;
-    const int qpel= flags & FLAG_QPEL;
-    const int mask= 1+2*qpel;
-    me_cmp_func cmp_sub, chroma_cmp_sub;
-    int d;
-
-    LOAD_COMMON
-
- //FIXME factorize
-
-    cmp_sub= s->dsp.mb_cmp[size];
-    chroma_cmp_sub= s->dsp.mb_cmp[size+1];
-
-//    assert(!c->skip);
-//    assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);
-
-    d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
-    //FIXME check cbp before adding penalty for (0,0) vector
-    if(add_rate && (mx || my || size>0))
-        d += (mv_penalty[mx - pred_x] + mv_penalty[my - pred_y])*penalty_factor;
-
-    return d;
-}
-
-int ff_get_mb_score(MpegEncContext *s, int mx, int my, int src_index,
-                    int ref_index, int size, int h, int add_rate)
-{
-    return get_mb_score(s, mx, my, src_index, ref_index, size, h, add_rate);
-}
-
-#define CHECK_QUARTER_MV(dx, dy, x, y)\
-{\
-    const int hx= 4*(x)+(dx);\
-    const int hy= 4*(y)+(dy);\
-    d= cmp_qpel(s, x, y, dx, dy, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
-    d += (mv_penalty[hx - pred_x] + mv_penalty[hy - pred_y])*penalty_factor;\
-    COPY3_IF_LT(dmin, d, bx, hx, by, hy)\
-}
-
-static int qpel_motion_search(MpegEncContext * s,
-                                  int *mx_ptr, int *my_ptr, int dmin,
-                                  int src_index, int ref_index,
-                                  int size, int h)
-{
-    MotionEstContext * const c= &s->me;
-    const int mx = *mx_ptr;
-    const int my = *my_ptr;
-    const int penalty_factor= c->sub_penalty_factor;
-    const unsigned map_generation = c->map_generation;
-    const int subpel_quality= c->avctx->me_subpel_quality;
-    uint32_t *map= c->map;
-    me_cmp_func cmpf, chroma_cmpf;
-    me_cmp_func cmp_sub, chroma_cmp_sub;
-
-    LOAD_COMMON
-    int flags= c->sub_flags;
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1]; //factorize FIXME
- //FIXME factorize
-
-    cmp_sub= s->dsp.me_sub_cmp[size];
-    chroma_cmp_sub= s->dsp.me_sub_cmp[size+1];
-
-    if(c->skip){ //FIXME somehow move up (benchmark)
-        *mx_ptr = 0;
-        *my_ptr = 0;
-        return dmin;
-    }
-
-    if(c->avctx->me_cmp != c->avctx->me_sub_cmp){
-        dmin= cmp(s, mx, my, 0, 0, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
-        if(mx || my || size>0)
-            dmin += (mv_penalty[4*mx - pred_x] + mv_penalty[4*my - pred_y])*penalty_factor;
-    }
-
-    if (mx > xmin && mx < xmax &&
-        my > ymin && my < ymax) {
-        int bx=4*mx, by=4*my;
-        int d= dmin;
-        int i, nx, ny;
-        const int index= (my<<ME_MAP_SHIFT) + mx;
-        const int t= score_map[(index-(1<<ME_MAP_SHIFT)  )&(ME_MAP_SIZE-1)];
-        const int l= score_map[(index- 1                 )&(ME_MAP_SIZE-1)];
-        const int r= score_map[(index+ 1                 )&(ME_MAP_SIZE-1)];
-        const int b= score_map[(index+(1<<ME_MAP_SHIFT)  )&(ME_MAP_SIZE-1)];
-        const int c= score_map[(index                    )&(ME_MAP_SIZE-1)];
-        int best[8];
-        int best_pos[8][2];
-
-        memset(best, 64, sizeof(int)*8);
-        if(s->me.dia_size>=2){
-            const int tl= score_map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
-            const int bl= score_map[(index+(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
-            const int tr= score_map[(index-(1<<ME_MAP_SHIFT)+1)&(ME_MAP_SIZE-1)];
-            const int br= score_map[(index+(1<<ME_MAP_SHIFT)+1)&(ME_MAP_SIZE-1)];
-
-            for(ny= -3; ny <= 3; ny++){
-                for(nx= -3; nx <= 3; nx++){
-                    //FIXME this could overflow (unlikely though)
-                    const int64_t t2= nx*nx*(tr + tl - 2*t) + 4*nx*(tr-tl) + 32*t;
-                    const int64_t c2= nx*nx*( r +  l - 2*c) + 4*nx*( r- l) + 32*c;
-                    const int64_t b2= nx*nx*(br + bl - 2*b) + 4*nx*(br-bl) + 32*b;
-                    int score= (ny*ny*(b2 + t2 - 2*c2) + 4*ny*(b2 - t2) + 32*c2 + 512)>>10;
-                    int i;
-
-                    if((nx&3)==0 && (ny&3)==0) continue;
-
-                    score += (mv_penalty[4*mx + nx - pred_x] + mv_penalty[4*my + ny - pred_y])*penalty_factor;
-
-//                    if(nx&1) score-=1024*c->penalty_factor;
-//                    if(ny&1) score-=1024*c->penalty_factor;
-
-                    for(i=0; i<8; i++){
-                        if(score < best[i]){
-                            memmove(&best[i+1], &best[i], sizeof(int)*(7-i));
-                            memmove(&best_pos[i+1][0], &best_pos[i][0], sizeof(int)*2*(7-i));
-                            best[i]= score;
-                            best_pos[i][0]= nx + 4*mx;
-                            best_pos[i][1]= ny + 4*my;
-                            break;
-                        }
-                    }
-                }
-            }
-        }else{
-            int tl;
-            //FIXME this could overflow (unlikely though)
-            const int cx = 4*(r - l);
-            const int cx2= r + l - 2*c;
-            const int cy = 4*(b - t);
-            const int cy2= b + t - 2*c;
-            int cxy;
-
-            if(map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)] == (my<<ME_MAP_MV_BITS) + mx + map_generation && 0){ //FIXME
-                tl= score_map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
-            }else{
-                tl= cmp(s, mx-1, my-1, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);//FIXME wrong if chroma me is different
-            }
-
-            cxy= 2*tl + (cx + cy)/4 - (cx2 + cy2) - 2*c;
-
-            assert(16*cx2 + 4*cx + 32*c == 32*r);
-            assert(16*cx2 - 4*cx + 32*c == 32*l);
-            assert(16*cy2 + 4*cy + 32*c == 32*b);
-            assert(16*cy2 - 4*cy + 32*c == 32*t);
-            assert(16*cxy + 16*cy2 + 16*cx2 - 4*cy - 4*cx + 32*c == 32*tl);
-
-            for(ny= -3; ny <= 3; ny++){
-                for(nx= -3; nx <= 3; nx++){
-                    //FIXME this could overflow (unlikely though)
-                    int score= ny*nx*cxy + nx*nx*cx2 + ny*ny*cy2 + nx*cx + ny*cy + 32*c; //FIXME factor
-                    int i;
-
-                    if((nx&3)==0 && (ny&3)==0) continue;
-
-                    score += 32*(mv_penalty[4*mx + nx - pred_x] + mv_penalty[4*my + ny - pred_y])*penalty_factor;
-//                    if(nx&1) score-=32*c->penalty_factor;
-  //                  if(ny&1) score-=32*c->penalty_factor;
-
-                    for(i=0; i<8; i++){
-                        if(score < best[i]){
-                            memmove(&best[i+1], &best[i], sizeof(int)*(7-i));
-                            memmove(&best_pos[i+1][0], &best_pos[i][0], sizeof(int)*2*(7-i));
-                            best[i]= score;
-                            best_pos[i][0]= nx + 4*mx;
-                            best_pos[i][1]= ny + 4*my;
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-        for(i=0; i<subpel_quality; i++){
-            nx= best_pos[i][0];
-            ny= best_pos[i][1];
-            CHECK_QUARTER_MV(nx&3, ny&3, nx>>2, ny>>2)
-        }
-
-        assert(bx >= xmin*4 && bx <= xmax*4 && by >= ymin*4 && by <= ymax*4);
-
-        *mx_ptr = bx;
-        *my_ptr = by;
-    }else{
-        *mx_ptr =4*mx;
-        *my_ptr =4*my;
-    }
-
-    return dmin;
-}
-
-
-#define CHECK_MV(x,y)\
-{\
-    const unsigned key = ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
-    const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
-    assert((x) >= xmin);\
-    assert((x) <= xmax);\
-    assert((y) >= ymin);\
-    assert((y) <= ymax);\
-    if(map[index]!=key){\
-        d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
-        map[index]= key;\
-        score_map[index]= d;\
-        d += (mv_penalty[((x)<<shift)-pred_x] + mv_penalty[((y)<<shift)-pred_y])*penalty_factor;\
-        COPY3_IF_LT(dmin, d, best[0], x, best[1], y)\
-    }\
-}
-
-#define CHECK_CLIPPED_MV(ax,ay)\
-{\
-    const int Lx= ax;\
-    const int Ly= ay;\
-    const int Lx2= FFMAX(xmin, FFMIN(Lx, xmax));\
-    const int Ly2= FFMAX(ymin, FFMIN(Ly, ymax));\
-    CHECK_MV(Lx2, Ly2)\
-}
-
-#define CHECK_MV_DIR(x,y,new_dir)\
-{\
-    const unsigned key = ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
-    const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
-    if(map[index]!=key){\
-        d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
-        map[index]= key;\
-        score_map[index]= d;\
-        d += (mv_penalty[((x)<<shift)-pred_x] + mv_penalty[((y)<<shift)-pred_y])*penalty_factor;\
-        if(d<dmin){\
-            best[0]=x;\
-            best[1]=y;\
-            dmin=d;\
-            next_dir= new_dir;\
-        }\
-    }\
-}
-
-#define check(x,y,S,v)\
-if( (x)<(xmin<<(S)) ) printf("%d %d %d %d %d xmin" #v, xmin, (x), (y), s->mb_x, s->mb_y);\
-if( (x)>(xmax<<(S)) ) printf("%d %d %d %d %d xmax" #v, xmax, (x), (y), s->mb_x, s->mb_y);\
-if( (y)<(ymin<<(S)) ) printf("%d %d %d %d %d ymin" #v, ymin, (x), (y), s->mb_x, s->mb_y);\
-if( (y)>(ymax<<(S)) ) printf("%d %d %d %d %d ymax" #v, ymax, (x), (y), s->mb_x, s->mb_y);\
-
-#define LOAD_COMMON2\
-    uint32_t *map= c->map;\
-    const int qpel= flags&FLAG_QPEL;\
-    const int shift= 1+qpel;\
-
-static av_always_inline int small_diamond_search(MpegEncContext * s, int *best, int dmin,
-                                       int src_index, int ref_index, int const penalty_factor,
-                                       int size, int h, int flags)
-{
-    MotionEstContext * const c= &s->me;
-    me_cmp_func cmpf, chroma_cmpf;
-    int next_dir=-1;
-    LOAD_COMMON
-    LOAD_COMMON2
-    unsigned map_generation = c->map_generation;
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    { /* ensure that the best point is in the MAP as h/qpel refinement needs it */
-        const unsigned key = (best[1]<<ME_MAP_MV_BITS) + best[0] + map_generation;
-        const int index= ((best[1]<<ME_MAP_SHIFT) + best[0])&(ME_MAP_SIZE-1);
-        if(map[index]!=key){ //this will be executed only very rarey
-            score_map[index]= cmp(s, best[0], best[1], 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
-            map[index]= key;
-        }
-    }
-
-    for(;;){
-        int d;
-        const int dir= next_dir;
-        const int x= best[0];
-        const int y= best[1];
-        next_dir=-1;
-
-        if(dir!=2 && x>xmin) CHECK_MV_DIR(x-1, y  , 0)
-        if(dir!=3 && y>ymin) CHECK_MV_DIR(x  , y-1, 1)
-        if(dir!=0 && x<xmax) CHECK_MV_DIR(x+1, y  , 2)
-        if(dir!=1 && y<ymax) CHECK_MV_DIR(x  , y+1, 3)
-
-        if(next_dir==-1){
-            return dmin;
-        }
-    }
-}
-
-static int funny_diamond_search(MpegEncContext * s, int *best, int dmin,
-                                       int src_index, int ref_index, int const penalty_factor,
-                                       int size, int h, int flags)
-{
-    MotionEstContext * const c= &s->me;
-    me_cmp_func cmpf, chroma_cmpf;
-    int dia_size;
-    LOAD_COMMON
-    LOAD_COMMON2
-    unsigned map_generation = c->map_generation;
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    for(dia_size=1; dia_size<=4; dia_size++){
-        int dir;
-        const int x= best[0];
-        const int y= best[1];
-
-        if(dia_size&(dia_size-1)) continue;
-
-        if(   x + dia_size > xmax
-           || x - dia_size < xmin
-           || y + dia_size > ymax
-           || y - dia_size < ymin)
-           continue;
-
-        for(dir= 0; dir<dia_size; dir+=2){
-            int d;
-
-            CHECK_MV(x + dir           , y + dia_size - dir);
-            CHECK_MV(x + dia_size - dir, y - dir           );
-            CHECK_MV(x - dir           , y - dia_size + dir);
-            CHECK_MV(x - dia_size + dir, y + dir           );
-        }
-
-        if(x!=best[0] || y!=best[1])
-            dia_size=0;
-    }
-    return dmin;
-}
-
-static int hex_search(MpegEncContext * s, int *best, int dmin,
-                                       int src_index, int ref_index, int const penalty_factor,
-                                       int size, int h, int flags, int dia_size)
-{
-    MotionEstContext * const c= &s->me;
-    me_cmp_func cmpf, chroma_cmpf;
-    LOAD_COMMON
-    LOAD_COMMON2
-    unsigned map_generation = c->map_generation;
-    int x,y,d;
-    const int dec= dia_size & (dia_size-1);
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    for(;dia_size; dia_size= dec ? dia_size-1 : dia_size>>1){
-        do{
-            x= best[0];
-            y= best[1];
-
-            CHECK_CLIPPED_MV(x  -dia_size    , y);
-            CHECK_CLIPPED_MV(x+  dia_size    , y);
-            CHECK_CLIPPED_MV(x+( dia_size>>1), y+dia_size);
-            CHECK_CLIPPED_MV(x+( dia_size>>1), y-dia_size);
-            if(dia_size>1){
-                CHECK_CLIPPED_MV(x+(-dia_size>>1), y+dia_size);
-                CHECK_CLIPPED_MV(x+(-dia_size>>1), y-dia_size);
-            }
-        }while(best[0] != x || best[1] != y);
-    }
-
-    return dmin;
-}
-
-static int l2s_dia_search(MpegEncContext * s, int *best, int dmin,
-                                       int src_index, int ref_index, int const penalty_factor,
-                                       int size, int h, int flags)
-{
-    MotionEstContext * const c= &s->me;
-    me_cmp_func cmpf, chroma_cmpf;
-    LOAD_COMMON
-    LOAD_COMMON2
-    unsigned map_generation = c->map_generation;
-    int x,y,i,d;
-    int dia_size= c->dia_size&0xFF;
-    const int dec= dia_size & (dia_size-1);
-    static const int hex[8][2]={{-2, 0}, {-1,-1}, { 0,-2}, { 1,-1},
-                                { 2, 0}, { 1, 1}, { 0, 2}, {-1, 1}};
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    for(; dia_size; dia_size= dec ? dia_size-1 : dia_size>>1){
-        do{
-            x= best[0];
-            y= best[1];
-            for(i=0; i<8; i++){
-                CHECK_CLIPPED_MV(x+hex[i][0]*dia_size, y+hex[i][1]*dia_size);
-            }
-        }while(best[0] != x || best[1] != y);
-    }
-
-    x= best[0];
-    y= best[1];
-    CHECK_CLIPPED_MV(x+1, y);
-    CHECK_CLIPPED_MV(x, y+1);
-    CHECK_CLIPPED_MV(x-1, y);
-    CHECK_CLIPPED_MV(x, y-1);
-
-    return dmin;
-}
-
-static int umh_search(MpegEncContext * s, int *best, int dmin,
-                                       int src_index, int ref_index, int const penalty_factor,
-                                       int size, int h, int flags)
-{
-    MotionEstContext * const c= &s->me;
-    me_cmp_func cmpf, chroma_cmpf;
-    LOAD_COMMON
-    LOAD_COMMON2
-    unsigned map_generation = c->map_generation;
-    int x,y,x2,y2, i, j, d;
-    const int dia_size= c->dia_size&0xFE;
-    static const int hex[16][2]={{-4,-2}, {-4,-1}, {-4, 0}, {-4, 1}, {-4, 2},
-                                 { 4,-2}, { 4,-1}, { 4, 0}, { 4, 1}, { 4, 2},
-                                 {-2, 3}, { 0, 4}, { 2, 3},
-                                 {-2,-3}, { 0,-4}, { 2,-3},};
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    x= best[0];
-    y= best[1];
-    for(x2=FFMAX(x-dia_size+1, xmin); x2<=FFMIN(x+dia_size-1,xmax); x2+=2){
-        CHECK_MV(x2, y);
-    }
-    for(y2=FFMAX(y-dia_size/2+1, ymin); y2<=FFMIN(y+dia_size/2-1,ymax); y2+=2){
-        CHECK_MV(x, y2);
-    }
-
-    x= best[0];
-    y= best[1];
-    for(y2=FFMAX(y-2, ymin); y2<=FFMIN(y+2,ymax); y2++){
-        for(x2=FFMAX(x-2, xmin); x2<=FFMIN(x+2,xmax); x2++){
-            CHECK_MV(x2, y2);
-        }
-    }
-
-//FIXME prevent the CLIP stuff
-
-    for(j=1; j<=dia_size/4; j++){
-        for(i=0; i<16; i++){
-            CHECK_CLIPPED_MV(x+hex[i][0]*j, y+hex[i][1]*j);
-        }
-    }
-
-    return hex_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags, 2);
-}
-
-static int full_search(MpegEncContext * s, int *best, int dmin,
-                                       int src_index, int ref_index, int const penalty_factor,
-                                       int size, int h, int flags)
-{
-    MotionEstContext * const c= &s->me;
-    me_cmp_func cmpf, chroma_cmpf;
-    LOAD_COMMON
-    LOAD_COMMON2
-    unsigned map_generation = c->map_generation;
-    int x,y, d;
-    const int dia_size= c->dia_size&0xFF;
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    for(y=FFMAX(-dia_size, ymin); y<=FFMIN(dia_size,ymax); y++){
-        for(x=FFMAX(-dia_size, xmin); x<=FFMIN(dia_size,xmax); x++){
-            CHECK_MV(x, y);
-        }
-    }
-
-    x= best[0];
-    y= best[1];
-    d= dmin;
-    CHECK_CLIPPED_MV(x  , y);
-    CHECK_CLIPPED_MV(x+1, y);
-    CHECK_CLIPPED_MV(x, y+1);
-    CHECK_CLIPPED_MV(x-1, y);
-    CHECK_CLIPPED_MV(x, y-1);
-    best[0]= x;
-    best[1]= y;
-
-    return d;
-}
-
-#define SAB_CHECK_MV(ax,ay)\
-{\
-    const unsigned key = ((ay)<<ME_MAP_MV_BITS) + (ax) + map_generation;\
-    const int index= (((ay)<<ME_MAP_SHIFT) + (ax))&(ME_MAP_SIZE-1);\
-    if(map[index]!=key){\
-        d= cmp(s, ax, ay, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
-        map[index]= key;\
-        score_map[index]= d;\
-        d += (mv_penalty[((ax)<<shift)-pred_x] + mv_penalty[((ay)<<shift)-pred_y])*penalty_factor;\
-        if(d < minima[minima_count-1].height){\
-            int j=0;\
-            \
-            while(d >= minima[j].height) j++;\
-\
-            memmove(&minima [j+1], &minima [j], (minima_count - j - 1)*sizeof(Minima));\
-\
-            minima[j].checked= 0;\
-            minima[j].height= d;\
-            minima[j].x= ax;\
-            minima[j].y= ay;\
-            \
-            i=-1;\
-            continue;\
-        }\
-    }\
-}
-
-#define MAX_SAB_SIZE ME_MAP_SIZE
-static int sab_diamond_search(MpegEncContext * s, int *best, int dmin,
-                                       int src_index, int ref_index, int const penalty_factor,
-                                       int size, int h, int flags)
-{
-    MotionEstContext * const c= &s->me;
-    me_cmp_func cmpf, chroma_cmpf;
-    Minima minima[MAX_SAB_SIZE];
-    const int minima_count= FFABS(c->dia_size);
-    int i, j;
-    LOAD_COMMON
-    LOAD_COMMON2
-    unsigned map_generation = c->map_generation;
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    /*Note j<MAX_SAB_SIZE is needed if MAX_SAB_SIZE < ME_MAP_SIZE as j can
-      become larger due to MVs overflowing their ME_MAP_MV_BITS bits space in map
-     */
-    for(j=i=0; i<ME_MAP_SIZE && j<MAX_SAB_SIZE; i++){
-        uint32_t key= map[i];
-
-        key += (1<<(ME_MAP_MV_BITS-1)) + (1<<(2*ME_MAP_MV_BITS-1));
-
-        if((key&((-1)<<(2*ME_MAP_MV_BITS))) != map_generation) continue;
-
-        minima[j].height= score_map[i];
-        minima[j].x= key & ((1<<ME_MAP_MV_BITS)-1); key>>=ME_MAP_MV_BITS;
-        minima[j].y= key & ((1<<ME_MAP_MV_BITS)-1);
-        minima[j].x-= (1<<(ME_MAP_MV_BITS-1));
-        minima[j].y-= (1<<(ME_MAP_MV_BITS-1));
-
-        // all entries in map should be in range except if the mv overflows their ME_MAP_MV_BITS bits space
-        if(   minima[j].x > xmax || minima[j].x < xmin
-           || minima[j].y > ymax || minima[j].y < ymin)
-            continue;
-
-        minima[j].checked=0;
-        if(minima[j].x || minima[j].y)
-            minima[j].height+= (mv_penalty[((minima[j].x)<<shift)-pred_x] + mv_penalty[((minima[j].y)<<shift)-pred_y])*penalty_factor;
-
-        j++;
-    }
-
-    qsort(minima, j, sizeof(Minima), minima_cmp);
-
-    for(; j<minima_count; j++){
-        minima[j].height=256*256*256*64;
-        minima[j].checked=0;
-        minima[j].x= minima[j].y=0;
-    }
-
-    for(i=0; i<minima_count; i++){
-        const int x= minima[i].x;
-        const int y= minima[i].y;
-        int d;
-
-        if(minima[i].checked) continue;
-
-        if(   x >= xmax || x <= xmin
-           || y >= ymax || y <= ymin)
-           continue;
-
-        SAB_CHECK_MV(x-1, y)
-        SAB_CHECK_MV(x+1, y)
-        SAB_CHECK_MV(x  , y-1)
-        SAB_CHECK_MV(x  , y+1)
-
-        minima[i].checked= 1;
-    }
-
-    best[0]= minima[0].x;
-    best[1]= minima[0].y;
-    dmin= minima[0].height;
-
-    if(   best[0] < xmax && best[0] > xmin
-       && best[1] < ymax && best[1] > ymin){
-        int d;
-        //ensure that the refernece samples for hpel refinement are in the map
-        CHECK_MV(best[0]-1, best[1])
-        CHECK_MV(best[0]+1, best[1])
-        CHECK_MV(best[0], best[1]-1)
-        CHECK_MV(best[0], best[1]+1)
-    }
-    return dmin;
-}
-
-static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
-                                       int src_index, int ref_index, int const penalty_factor,
-                                       int size, int h, int flags)
-{
-    MotionEstContext * const c= &s->me;
-    me_cmp_func cmpf, chroma_cmpf;
-    int dia_size;
-    LOAD_COMMON
-    LOAD_COMMON2
-    unsigned map_generation = c->map_generation;
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    for(dia_size=1; dia_size<=c->dia_size; dia_size++){
-        int dir, start, end;
-        const int x= best[0];
-        const int y= best[1];
-
-        start= FFMAX(0, y + dia_size - ymax);
-        end  = FFMIN(dia_size, xmax - x + 1);
-        for(dir= start; dir<end; dir++){
-            int d;
-
-//check(x + dir,y + dia_size - dir,0, a0)
-            CHECK_MV(x + dir           , y + dia_size - dir);
-        }
-
-        start= FFMAX(0, x + dia_size - xmax);
-        end  = FFMIN(dia_size, y - ymin + 1);
-        for(dir= start; dir<end; dir++){
-            int d;
-
-//check(x + dia_size - dir, y - dir,0, a1)
-            CHECK_MV(x + dia_size - dir, y - dir           );
-        }
-
-        start= FFMAX(0, -y + dia_size + ymin );
-        end  = FFMIN(dia_size, x - xmin + 1);
-        for(dir= start; dir<end; dir++){
-            int d;
-
-//check(x - dir,y - dia_size + dir,0, a2)
-            CHECK_MV(x - dir           , y - dia_size + dir);
-        }
-
-        start= FFMAX(0, -x + dia_size + xmin );
-        end  = FFMIN(dia_size, ymax - y + 1);
-        for(dir= start; dir<end; dir++){
-            int d;
-
-//check(x - dia_size + dir, y + dir,0, a3)
-            CHECK_MV(x - dia_size + dir, y + dir           );
-        }
-
-        if(x!=best[0] || y!=best[1])
-            dia_size=0;
-    }
-    return dmin;
-}
-
-static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin,
-                                       int src_index, int ref_index, int const penalty_factor,
-                                       int size, int h, int flags){
-    MotionEstContext * const c= &s->me;
-    if(c->dia_size==-1)
-        return funny_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-    else if(c->dia_size<-1)
-        return   sab_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-    else if(c->dia_size<2)
-        return small_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-    else if(c->dia_size>1024)
-        return          full_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-    else if(c->dia_size>768)
-        return           umh_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-    else if(c->dia_size>512)
-        return           hex_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags, c->dia_size&0xFF);
-    else if(c->dia_size>256)
-        return       l2s_dia_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-    else
-        return   var_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-}
-
-/**
-   @param P a list of candidate mvs to check before starting the
-   iterative search. If one of the candidates is close to the optimal mv, then
-   it takes fewer iterations. And it increases the chance that we find the
-   optimal mv.
- */
-static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
-                             int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
-                             int ref_mv_scale, int flags, int size, int h)
-{
-    MotionEstContext * const c= &s->me;
-    int best[2]={0, 0};      /**< x and y coordinates of the best motion vector.
-                               i.e. the difference between the position of the
-                               block currently being encoded and the position of
-                               the block chosen to predict it from. */
-    int d;                   ///< the score (cmp + penalty) of any given mv
-    int dmin;                /**< the best value of d, i.e. the score
-                               corresponding to the mv stored in best[]. */
-    unsigned map_generation;
-    int penalty_factor;
-    const int ref_mv_stride= s->mb_stride; //pass as arg  FIXME
-    const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride; //add to last_mv beforepassing FIXME
-    me_cmp_func cmpf, chroma_cmpf;
-
-    LOAD_COMMON
-    LOAD_COMMON2
-
-    if(c->pre_pass){
-        penalty_factor= c->pre_penalty_factor;
-        cmpf= s->dsp.me_pre_cmp[size];
-        chroma_cmpf= s->dsp.me_pre_cmp[size+1];
-    }else{
-        penalty_factor= c->penalty_factor;
-        cmpf= s->dsp.me_cmp[size];
-        chroma_cmpf= s->dsp.me_cmp[size+1];
-    }
-
-    map_generation= update_map_generation(c);
-
-    assert(cmpf);
-    dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
-    map[0]= map_generation;
-    score_map[0]= dmin;
-
-    //FIXME precalc first term below?
-    if((s->pict_type == AV_PICTURE_TYPE_B && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
-        dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
-
-    /* first line */
-    if (s->first_slice_line) {
-        CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
-        CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
-                        (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
-    }else{
-        if(dmin<((h*h*s->avctx->mv0_threshold)>>8)
-                    && ( P_LEFT[0]    |P_LEFT[1]
-                        |P_TOP[0]     |P_TOP[1]
-                        |P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){
-            *mx_ptr= 0;
-            *my_ptr= 0;
-            c->skip=1;
-            return dmin;
-        }
-        CHECK_MV(    P_MEDIAN[0] >>shift ,    P_MEDIAN[1] >>shift)
-        CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)  , (P_MEDIAN[1]>>shift)-1)
-        CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)  , (P_MEDIAN[1]>>shift)+1)
-        CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift)  )
-        CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift)  )
-        CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
-                        (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
-        CHECK_MV(P_LEFT[0]    >>shift, P_LEFT[1]    >>shift)
-        CHECK_MV(P_TOP[0]     >>shift, P_TOP[1]     >>shift)
-        CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
-    }
-    if(dmin>h*h*4){
-        if(c->pre_pass){
-            CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
-                            (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
-            if(!s->first_slice_line)
-                CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
-                                (last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
-        }else{
-            CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
-                            (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
-            if(s->mb_y+1<s->end_mb_y)  //FIXME replace at least with last_slice_line
-                CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
-                                (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
-        }
-    }
-
-    if(c->avctx->last_predictor_count){
-        const int count= c->avctx->last_predictor_count;
-        const int xstart= FFMAX(0, s->mb_x - count);
-        const int ystart= FFMAX(0, s->mb_y - count);
-        const int xend= FFMIN(s->mb_width , s->mb_x + count + 1);
-        const int yend= FFMIN(s->mb_height, s->mb_y + count + 1);
-        int mb_y;
-
-        for(mb_y=ystart; mb_y<yend; mb_y++){
-            int mb_x;
-            for(mb_x=xstart; mb_x<xend; mb_x++){
-                const int xy= mb_x + 1 + (mb_y + 1)*ref_mv_stride;
-                int mx= (last_mv[xy][0]*ref_mv_scale + (1<<15))>>16;
-                int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16;
-
-                if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue;
-                CHECK_MV(mx,my)
-            }
-        }
-    }
-
-//check(best[0],best[1],0, b0)
-    dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-
-//check(best[0],best[1],0, b1)
-    *mx_ptr= best[0];
-    *my_ptr= best[1];
-
-    return dmin;
-}
-
-//this function is dedicated to the braindamaged gcc
-int ff_epzs_motion_search(MpegEncContext *s, int *mx_ptr, int *my_ptr,
-                          int P[10][2], int src_index, int ref_index,
-                          int16_t (*last_mv)[2], int ref_mv_scale,
-                          int size, int h)
-{
-    MotionEstContext * const c= &s->me;
-//FIXME convert other functions in the same way if faster
-    if(c->flags==0 && h==16 && size==0){
-        return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, 0, 0, 16);
-//    case FLAG_QPEL:
-//        return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, FLAG_QPEL);
-    }else{
-        return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, c->flags, size, h);
-    }
-}
-
-static int epzs_motion_search4(MpegEncContext * s,
-                             int *mx_ptr, int *my_ptr, int P[10][2],
-                             int src_index, int ref_index, int16_t (*last_mv)[2],
-                             int ref_mv_scale)
-{
-    MotionEstContext * const c= &s->me;
-    int best[2]={0, 0};
-    int d, dmin;
-    unsigned map_generation;
-    const int penalty_factor= c->penalty_factor;
-    const int size=1;
-    const int h=8;
-    const int ref_mv_stride= s->mb_stride;
-    const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
-    me_cmp_func cmpf, chroma_cmpf;
-    LOAD_COMMON
-    int flags= c->flags;
-    LOAD_COMMON2
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    map_generation= update_map_generation(c);
-
-    dmin = 1000000;
-
-    /* first line */
-    if (s->first_slice_line) {
-        CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
-        CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
-                        (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
-        CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
-    }else{
-        CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
-        //FIXME try some early stop
-        CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
-        CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
-        CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
-        CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
-        CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
-                        (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
-    }
-    if(dmin>64*4){
-        CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
-                        (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
-        if(s->mb_y+1<s->end_mb_y)  //FIXME replace at least with last_slice_line
-            CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
-                            (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
-    }
-
-    dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-
-    *mx_ptr= best[0];
-    *my_ptr= best[1];
-
-    return dmin;
-}
-
-//try to merge with above FIXME (needs PSNR test)
-static int epzs_motion_search2(MpegEncContext * s,
-                             int *mx_ptr, int *my_ptr, int P[10][2],
-                             int src_index, int ref_index, int16_t (*last_mv)[2],
-                             int ref_mv_scale)
-{
-    MotionEstContext * const c= &s->me;
-    int best[2]={0, 0};
-    int d, dmin;
-    unsigned map_generation;
-    const int penalty_factor= c->penalty_factor;
-    const int size=0; //FIXME pass as arg
-    const int h=8;
-    const int ref_mv_stride= s->mb_stride;
-    const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
-    me_cmp_func cmpf, chroma_cmpf;
-    LOAD_COMMON
-    int flags= c->flags;
-    LOAD_COMMON2
-
-    cmpf= s->dsp.me_cmp[size];
-    chroma_cmpf= s->dsp.me_cmp[size+1];
-
-    map_generation= update_map_generation(c);
-
-    dmin = 1000000;
-
-    /* first line */
-    if (s->first_slice_line) {
-        CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
-        CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
-                        (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
-        CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
-    }else{
-        CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
-        //FIXME try some early stop
-        CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
-        CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
-        CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
-        CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
-        CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
-                        (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
-    }
-    if(dmin>64*4){
-        CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
-                        (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
-        if(s->mb_y+1<s->end_mb_y)  //FIXME replace at least with last_slice_line
-            CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
-                            (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
-    }
-
-    dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-
-    *mx_ptr= best[0];
-    *my_ptr= best[1];
-
-    return dmin;
-}
diff --git a/deps/libav/libavcodec/motionpixels.c b/deps/libav/libavcodec/motionpixels.c
deleted file mode 100644
index 6c1efad..0000000
--- a/deps/libav/libavcodec/motionpixels.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Motion Pixels Video Decoder
- * Copyright (c) 2008 Gregory Montoir (cyx at users.sourceforge.net)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "internal.h"
-
-#define MAX_HUFF_CODES 16
-
-#include "motionpixels_tablegen.h"
-
-typedef struct HuffCode {
-    int code;
-    uint8_t size;
-    uint8_t delta;
-} HuffCode;
-
-typedef struct MotionPixelsContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-    DSPContext dsp;
-    uint8_t *changes_map;
-    int offset_bits_len;
-    int codes_count, current_codes_count;
-    int max_codes_bits;
-    HuffCode codes[MAX_HUFF_CODES];
-    VLC vlc;
-    YuvPixel *vpt, *hpt;
-    uint8_t gradient_scale[3];
-    uint8_t *bswapbuf;
-    int bswapbuf_size;
-} MotionPixelsContext;
-
-static av_cold int mp_decode_end(AVCodecContext *avctx)
-{
-    MotionPixelsContext *mp = avctx->priv_data;
-
-    av_freep(&mp->changes_map);
-    av_freep(&mp->vpt);
-    av_freep(&mp->hpt);
-    av_freep(&mp->bswapbuf);
-    av_frame_free(&mp->frame);
-
-    return 0;
-}
-
-static av_cold int mp_decode_init(AVCodecContext *avctx)
-{
-    MotionPixelsContext *mp = avctx->priv_data;
-    int w4 = (avctx->width  + 3) & ~3;
-    int h4 = (avctx->height + 3) & ~3;
-
-    motionpixels_tableinit();
-    mp->avctx = avctx;
-    ff_dsputil_init(&mp->dsp, avctx);
-    mp->changes_map = av_mallocz(avctx->width * h4);
-    mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1;
-    mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
-    mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel));
-    avctx->pix_fmt = AV_PIX_FMT_RGB555;
-
-    mp->frame = av_frame_alloc();
-    if (!mp->frame) {
-        mp_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static void mp_read_changes_map(MotionPixelsContext *mp, GetBitContext *gb, int count, int bits_len, int read_color)
-{
-    uint16_t *pixels;
-    int offset, w, h, color = 0, x, y, i;
-
-    while (count--) {
-        offset = get_bits_long(gb, mp->offset_bits_len);
-        w      = get_bits(gb, bits_len) + 1;
-        h      = get_bits(gb, bits_len) + 1;
-        if (read_color)
-            color = get_bits(gb, 15);
-        x = offset % mp->avctx->width;
-        y = offset / mp->avctx->width;
-        if (y >= mp->avctx->height)
-            continue;
-        w = FFMIN(w, mp->avctx->width  - x);
-        h = FFMIN(h, mp->avctx->height - y);
-        pixels = (uint16_t *)&mp->frame->data[0][y * mp->frame->linesize[0] + x * 2];
-        while (h--) {
-            mp->changes_map[offset] = w;
-            if (read_color)
-                for (i = 0; i < w; ++i)
-                    pixels[i] = color;
-            offset += mp->avctx->width;
-            pixels += mp->frame->linesize[0] / 2;
-        }
-    }
-}
-
-static void mp_get_code(MotionPixelsContext *mp, GetBitContext *gb, int size, int code)
-{
-    while (get_bits1(gb)) {
-        ++size;
-        if (size > mp->max_codes_bits) {
-            av_log(mp->avctx, AV_LOG_ERROR, "invalid code size %d/%d\n", size, mp->max_codes_bits);
-            return;
-        }
-        code <<= 1;
-        mp_get_code(mp, gb, size, code + 1);
-    }
-    if (mp->current_codes_count >= MAX_HUFF_CODES) {
-        av_log(mp->avctx, AV_LOG_ERROR, "too many codes\n");
-        return;
-    }
-    mp->codes[mp->current_codes_count  ].code = code;
-    mp->codes[mp->current_codes_count++].size = size;
-}
-
-static void mp_read_codes_table(MotionPixelsContext *mp, GetBitContext *gb)
-{
-    if (mp->codes_count == 1) {
-        mp->codes[0].delta = get_bits(gb, 4);
-    } else {
-        int i;
-
-        mp->max_codes_bits = get_bits(gb, 4);
-        for (i = 0; i < mp->codes_count; ++i)
-            mp->codes[i].delta = get_bits(gb, 4);
-        mp->current_codes_count = 0;
-        mp_get_code(mp, gb, 0, 0);
-   }
-}
-
-static int mp_gradient(MotionPixelsContext *mp, int component, int v)
-{
-    int delta;
-
-    delta = (v - 7) * mp->gradient_scale[component];
-    mp->gradient_scale[component] = (v == 0 || v == 14) ? 2 : 1;
-    return delta;
-}
-
-static YuvPixel mp_get_yuv_from_rgb(MotionPixelsContext *mp, int x, int y)
-{
-    int color;
-
-    color = *(uint16_t *)&mp->frame->data[0][y * mp->frame->linesize[0] + x * 2];
-    return mp_rgb_yuv_table[color];
-}
-
-static void mp_set_rgb_from_yuv(MotionPixelsContext *mp, int x, int y, const YuvPixel *p)
-{
-    int color;
-
-    color = mp_yuv_to_rgb(p->y, p->v, p->u, 1);
-    *(uint16_t *)&mp->frame->data[0][y * mp->frame->linesize[0] + x * 2] = color;
-}
-
-static int mp_get_vlc(MotionPixelsContext *mp, GetBitContext *gb)
-{
-    int i;
-
-    i = (mp->codes_count == 1) ? 0 : get_vlc2(gb, mp->vlc.table, mp->max_codes_bits, 1);
-    i = FFMIN(i, FF_ARRAY_ELEMS(mp->codes) - 1);
-    return mp->codes[i].delta;
-}
-
-static void mp_decode_line(MotionPixelsContext *mp, GetBitContext *gb, int y)
-{
-    YuvPixel p;
-    const int y0 = y * mp->avctx->width;
-    int w, i, x = 0;
-
-    p = mp->vpt[y];
-    if (mp->changes_map[y0 + x] == 0) {
-        memset(mp->gradient_scale, 1, sizeof(mp->gradient_scale));
-        ++x;
-    }
-    while (x < mp->avctx->width) {
-        w = mp->changes_map[y0 + x];
-        if (w != 0) {
-            if ((y & 3) == 0) {
-                if (mp->changes_map[y0 + x + mp->avctx->width] < w ||
-                    mp->changes_map[y0 + x + mp->avctx->width * 2] < w ||
-                    mp->changes_map[y0 + x + mp->avctx->width * 3] < w) {
-                    for (i = (x + 3) & ~3; i < x + w; i += 4) {
-                        mp->hpt[((y / 4) * mp->avctx->width + i) / 4] = mp_get_yuv_from_rgb(mp, i, y);
-                    }
-                }
-            }
-            x += w;
-            memset(mp->gradient_scale, 1, sizeof(mp->gradient_scale));
-            p = mp_get_yuv_from_rgb(mp, x - 1, y);
-        } else {
-            p.y += mp_gradient(mp, 0, mp_get_vlc(mp, gb));
-            p.y = av_clip(p.y, 0, 31);
-            if ((x & 3) == 0) {
-                if ((y & 3) == 0) {
-                    p.v += mp_gradient(mp, 1, mp_get_vlc(mp, gb));
-                    p.v = av_clip(p.v, -32, 31);
-                    p.u += mp_gradient(mp, 2, mp_get_vlc(mp, gb));
-                    p.u = av_clip(p.u, -32, 31);
-                    mp->hpt[((y / 4) * mp->avctx->width + x) / 4] = p;
-                } else {
-                    p.v = mp->hpt[((y / 4) * mp->avctx->width + x) / 4].v;
-                    p.u = mp->hpt[((y / 4) * mp->avctx->width + x) / 4].u;
-                }
-            }
-            mp_set_rgb_from_yuv(mp, x, y, &p);
-            ++x;
-        }
-    }
-}
-
-static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb)
-{
-    YuvPixel p;
-    int y, y0;
-
-    for (y = 0; y < mp->avctx->height; ++y) {
-        if (mp->changes_map[y * mp->avctx->width] != 0) {
-            memset(mp->gradient_scale, 1, sizeof(mp->gradient_scale));
-            p = mp_get_yuv_from_rgb(mp, 0, y);
-        } else {
-            p.y += mp_gradient(mp, 0, mp_get_vlc(mp, gb));
-            p.y = av_clip(p.y, 0, 31);
-            if ((y & 3) == 0) {
-                p.v += mp_gradient(mp, 1, mp_get_vlc(mp, gb));
-                p.v = av_clip(p.v, -32, 31);
-                p.u += mp_gradient(mp, 2, mp_get_vlc(mp, gb));
-                p.u = av_clip(p.u, -32, 31);
-            }
-            mp->vpt[y] = p;
-            mp_set_rgb_from_yuv(mp, 0, y, &p);
-        }
-    }
-    for (y0 = 0; y0 < 2; ++y0)
-        for (y = y0; y < mp->avctx->height; y += 2)
-            mp_decode_line(mp, gb, y);
-}
-
-static int mp_decode_frame(AVCodecContext *avctx,
-                                 void *data, int *got_frame,
-                                 AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MotionPixelsContext *mp = avctx->priv_data;
-    GetBitContext gb;
-    int i, count1, count2, sz, ret;
-
-    if ((ret = ff_reget_buffer(avctx, mp->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    /* le32 bitstream msb first */
-    av_fast_malloc(&mp->bswapbuf, &mp->bswapbuf_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!mp->bswapbuf)
-        return AVERROR(ENOMEM);
-    mp->dsp.bswap_buf((uint32_t *)mp->bswapbuf, (const uint32_t *)buf, buf_size / 4);
-    if (buf_size & 3)
-        memcpy(mp->bswapbuf + (buf_size & ~3), buf + (buf_size & ~3), buf_size & 3);
-    memset(mp->bswapbuf + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    init_get_bits(&gb, mp->bswapbuf, buf_size * 8);
-
-    memset(mp->changes_map, 0, avctx->width * avctx->height);
-    for (i = !(avctx->extradata[1] & 2); i < 2; ++i) {
-        count1 = get_bits(&gb, 12);
-        count2 = get_bits(&gb, 12);
-        mp_read_changes_map(mp, &gb, count1, 8, i);
-        mp_read_changes_map(mp, &gb, count2, 4, i);
-    }
-
-    mp->codes_count = get_bits(&gb, 4);
-    if (mp->codes_count == 0)
-        goto end;
-
-    if (mp->changes_map[0] == 0) {
-        *(uint16_t *)mp->frame->data[0] = get_bits(&gb, 15);
-        mp->changes_map[0] = 1;
-    }
-    mp_read_codes_table(mp, &gb);
-
-    sz = get_bits(&gb, 18);
-    if (avctx->extradata[0] != 5)
-        sz += get_bits(&gb, 18);
-    if (sz == 0)
-        goto end;
-
-    if (mp->max_codes_bits <= 0)
-        goto end;
-    if (init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0))
-        goto end;
-    mp_decode_frame_helper(mp, &gb);
-    ff_free_vlc(&mp->vlc);
-
-end:
-    if ((ret = av_frame_ref(data, mp->frame)) < 0)
-        return ret;
-    *got_frame       = 1;
-    return buf_size;
-}
-
-AVCodec ff_motionpixels_decoder = {
-    .name           = "motionpixels",
-    .long_name      = NULL_IF_CONFIG_SMALL("Motion Pixels video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MOTIONPIXELS,
-    .priv_data_size = sizeof(MotionPixelsContext),
-    .init           = mp_decode_init,
-    .close          = mp_decode_end,
-    .decode         = mp_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/motionpixels_tablegen.c b/deps/libav/libavcodec/motionpixels_tablegen.c
deleted file mode 100644
index ad8e0d9..0000000
--- a/deps/libav/libavcodec/motionpixels_tablegen.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Generate a header file for hardcoded motionpixels RGB to YUV table
- *
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#define MAX_NEG_CROP 0
-#define ff_cropTbl ((uint8_t *)NULL)
-#include "motionpixels_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
-    motionpixels_tableinit();
-
-    write_fileheader();
-
-    printf("static const YuvPixel mp_rgb_yuv_table[1 << 15] = {\n");
-    write_int8_t_2d_array(mp_rgb_yuv_table, 1 << 15, 3);
-    printf("};\n");
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/motionpixels_tablegen.h b/deps/libav/libavcodec/motionpixels_tablegen.h
deleted file mode 100644
index cbf56c8..0000000
--- a/deps/libav/libavcodec/motionpixels_tablegen.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Header file for hardcoded motionpixels RGB to YUV table
- *
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MOTIONPIXELS_TABLEGEN_H
-#define AVCODEC_MOTIONPIXELS_TABLEGEN_H
-
-#include <stdint.h>
-
-typedef struct YuvPixel {
-    int8_t y, v, u;
-} YuvPixel;
-
-static int mp_yuv_to_rgb(int y, int v, int u, int clip_rgb) {
-    static const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    int r, g, b;
-
-    r = (1000 * y + 701 * v) / 1000;
-    g = (1000 * y - 357 * v - 172 * u) / 1000;
-    b = (1000 * y + 886 * u) / 1000;
-    if (clip_rgb)
-        return ((cm[r * 8] & 0xF8) << 7) | ((cm[g * 8] & 0xF8) << 2) | (cm[b * 8] >> 3);
-    if ((unsigned)r < 32 && (unsigned)g < 32 && (unsigned)b < 32)
-        return (r << 10) | (g << 5) | b;
-    return 1 << 15;
-}
-
-#if CONFIG_HARDCODED_TABLES
-#define motionpixels_tableinit()
-#include "libavcodec/motionpixels_tables.h"
-#else
-static YuvPixel mp_rgb_yuv_table[1 << 15];
-
-static void mp_set_zero_yuv(YuvPixel *p)
-{
-    int i, j;
-
-    for (i = 0; i < 31; ++i) {
-        for (j = 31; j > i; --j)
-            if (!(p[j].u | p[j].v | p[j].y))
-                p[j] = p[j - 1];
-        for (j = 0; j < 31 - i; ++j)
-            if (!(p[j].u | p[j].v | p[j].y))
-                p[j] = p[j + 1];
-    }
-}
-
-static void mp_build_rgb_yuv_table(YuvPixel *p)
-{
-    int y, v, u, i;
-
-    for (y = 0; y <= 31; ++y)
-        for (v = -31; v <= 31; ++v)
-            for (u = -31; u <= 31; ++u) {
-                i = mp_yuv_to_rgb(y, v, u, 0);
-                if (i < (1 << 15) && !(p[i].u | p[i].v | p[i].y)) {
-                    p[i].y = y;
-                    p[i].v = v;
-                    p[i].u = u;
-                }
-            }
-    for (i = 0; i < 1024; ++i)
-        mp_set_zero_yuv(p + i * 32);
-}
-
-static void motionpixels_tableinit(void)
-{
-    if (!mp_rgb_yuv_table[0].u)
-        mp_build_rgb_yuv_table(mp_rgb_yuv_table);
-}
-#endif /* CONFIG_HARDCODED_TABLES */
-
-#endif /* AVCODEC_MOTIONPIXELS_TABLEGEN_H */
diff --git a/deps/libav/libavcodec/movsub_bsf.c b/deps/libav/libavcodec/movsub_bsf.c
deleted file mode 100644
index 506750f..0000000
--- a/deps/libav/libavcodec/movsub_bsf.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2008 Reimar Döffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-
-
-static int text2movsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe){
-    if (buf_size > 0xffff) return 0;
-    *poutbuf_size = buf_size + 2;
-    *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    AV_WB16(*poutbuf, buf_size);
-    memcpy(*poutbuf + 2, buf, buf_size);
-    return 1;
-}
-
-AVBitStreamFilter ff_text2movsub_bsf={
-    "text2movsub",
-    0,
-    text2movsub,
-};
-
-static int mov2textsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe){
-    if (buf_size < 2) return 0;
-    *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
-    *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    memcpy(*poutbuf, buf + 2, *poutbuf_size);
-    return 1;
-}
-
-AVBitStreamFilter ff_mov2textsub_bsf={
-    "mov2textsub",
-    0,
-    mov2textsub,
-};
diff --git a/deps/libav/libavcodec/mpc.c b/deps/libav/libavcodec/mpc.c
deleted file mode 100644
index 763ea2c..0000000
--- a/deps/libav/libavcodec/mpc.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Musepack decoder core
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Musepack decoder core
- * MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
- * divided into 32 subbands.
- */
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "mpegaudiodsp.h"
-#include "mpegaudio.h"
-
-#include "mpc.h"
-#include "mpcdata.h"
-
-av_cold void ff_mpc_init(void)
-{
-    ff_mpa_synth_init_fixed(ff_mpa_synth_window_fixed);
-}
-
-/**
- * Process decoded Musepack data and produce PCM
- */
-static void mpc_synth(MPCContext *c, int16_t **out, int channels)
-{
-    int dither_state = 0;
-    int i, ch;
-
-    for(ch = 0;  ch < channels; ch++){
-        for(i = 0; i < SAMPLES_PER_BAND; i++) {
-            ff_mpa_synth_filter_fixed(&c->mpadsp,
-                                c->synth_buf[ch], &(c->synth_buf_offset[ch]),
-                                ff_mpa_synth_window_fixed, &dither_state,
-                                out[ch] + 32 * i, 1,
-                                c->sb_samples[ch][i]);
-        }
-    }
-}
-
-void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, int16_t **out,
-                                 int channels)
-{
-    int i, j, ch;
-    Band *bands = c->bands;
-    int off;
-    float mul;
-
-    /* dequantize */
-    memset(c->sb_samples, 0, sizeof(c->sb_samples));
-    off = 0;
-    for(i = 0; i <= maxband; i++, off += SAMPLES_PER_BAND){
-        for(ch = 0; ch < 2; ch++){
-            if(bands[i].res[ch]){
-                j = 0;
-                mul = mpc_CC[bands[i].res[ch] + 1] * mpc_SCF[bands[i].scf_idx[ch][0]+6];
-                for(; j < 12; j++)
-                    c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
-                mul = mpc_CC[bands[i].res[ch] + 1] * mpc_SCF[bands[i].scf_idx[ch][1]+6];
-                for(; j < 24; j++)
-                    c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
-                mul = mpc_CC[bands[i].res[ch] + 1] * mpc_SCF[bands[i].scf_idx[ch][2]+6];
-                for(; j < 36; j++)
-                    c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
-            }
-        }
-        if(bands[i].msf){
-            int t1, t2;
-            for(j = 0; j < SAMPLES_PER_BAND; j++){
-                t1 = c->sb_samples[0][j][i];
-                t2 = c->sb_samples[1][j][i];
-                c->sb_samples[0][j][i] = t1 + t2;
-                c->sb_samples[1][j][i] = t1 - t2;
-            }
-        }
-    }
-
-    mpc_synth(c, out, channels);
-}
diff --git a/deps/libav/libavcodec/mpc.h b/deps/libav/libavcodec/mpc.h
deleted file mode 100644
index cbb121e..0000000
--- a/deps/libav/libavcodec/mpc.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Musepack decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Musepack decoder
- * MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
- * divided into 32 subbands.
- */
-
-#ifndef AVCODEC_MPC_H
-#define AVCODEC_MPC_H
-
-#include "libavutil/lfg.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "mpegaudio.h"
-#include "mpegaudiodsp.h"
-
-#define BANDS            32
-#define SAMPLES_PER_BAND 36
-#define MPC_FRAME_SIZE   (BANDS * SAMPLES_PER_BAND)
-
-/** Subband structure - hold all variables for each subband */
-typedef struct Band {
-    int msf; ///< mid-stereo flag
-    int res[2];
-    int scfi[2];
-    int scf_idx[2][3];
-    int Q[2];
-}Band;
-
-typedef struct MPCContext {
-    DSPContext dsp;
-    MPADSPContext mpadsp;
-    GetBitContext gb;
-    int IS, MSS, gapless;
-    int lastframelen;
-    int maxbands, last_max_band;
-    int last_bits_used;
-    int oldDSCF[2][BANDS];
-    Band bands[BANDS];
-    int Q[2][MPC_FRAME_SIZE];
-    int cur_frame, frames;
-    uint8_t *bits;
-    int buf_size;
-    AVLFG rnd;
-    int frames_to_skip;
-    /* for synthesis */
-    DECLARE_ALIGNED(16, MPA_INT, synth_buf)[MPA_MAX_CHANNELS][512*2];
-    int synth_buf_offset[MPA_MAX_CHANNELS];
-    DECLARE_ALIGNED(16, int32_t, sb_samples)[MPA_MAX_CHANNELS][36][SBLIMIT];
-} MPCContext;
-
-void ff_mpc_init(void);
-void ff_mpc_dequantize_and_synth(MPCContext *c, int maxband, int16_t **out, int channels);
-
-#endif /* AVCODEC_MPC_H */
diff --git a/deps/libav/libavcodec/mpc7.c b/deps/libav/libavcodec/mpc7.c
deleted file mode 100644
index a38b0ea..0000000
--- a/deps/libav/libavcodec/mpc7.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Musepack SV7 decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
- * divided into 32 subbands.
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/internal.h"
-#include "libavutil/lfg.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "mpegaudiodsp.h"
-
-#include "mpc.h"
-#include "mpc7data.h"
-
-#define BANDS            32
-#define SAMPLES_PER_BAND 36
-#define MPC_FRAME_SIZE   (BANDS * SAMPLES_PER_BAND)
-
-static VLC scfi_vlc, dscf_vlc, hdr_vlc, quant_vlc[MPC7_QUANT_VLC_TABLES][2];
-
-static const uint16_t quant_offsets[MPC7_QUANT_VLC_TABLES*2 + 1] =
-{
-       0, 512, 1024, 1536, 2052, 2564, 3076, 3588, 4100, 4612, 5124,
-       5636, 6164, 6676, 7224
-};
-
-
-static av_cold int mpc7_decode_init(AVCodecContext * avctx)
-{
-    int i, j;
-    MPCContext *c = avctx->priv_data;
-    GetBitContext gb;
-    LOCAL_ALIGNED_16(uint8_t, buf, [16]);
-    static int vlc_initialized = 0;
-
-    static VLC_TYPE scfi_table[1 << MPC7_SCFI_BITS][2];
-    static VLC_TYPE dscf_table[1 << MPC7_DSCF_BITS][2];
-    static VLC_TYPE hdr_table[1 << MPC7_HDR_BITS][2];
-    static VLC_TYPE quant_tables[7224][2];
-
-    /* Musepack SV7 is always stereo */
-    if (avctx->channels != 2) {
-        avpriv_request_sample(avctx, "%d channels", avctx->channels);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if(avctx->extradata_size < 16){
-        av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size);
-        return -1;
-    }
-    memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
-    av_lfg_init(&c->rnd, 0xDEADBEEF);
-    ff_dsputil_init(&c->dsp, avctx);
-    ff_mpadsp_init(&c->mpadsp);
-    c->dsp.bswap_buf((uint32_t*)buf, (const uint32_t*)avctx->extradata, 4);
-    ff_mpc_init();
-    init_get_bits(&gb, buf, 128);
-
-    c->IS = get_bits1(&gb);
-    c->MSS = get_bits1(&gb);
-    c->maxbands = get_bits(&gb, 6);
-    if(c->maxbands >= BANDS){
-        av_log(avctx, AV_LOG_ERROR, "Too many bands: %i\n", c->maxbands);
-        return -1;
-    }
-    skip_bits_long(&gb, 88);
-    c->gapless = get_bits1(&gb);
-    c->lastframelen = get_bits(&gb, 11);
-    av_log(avctx, AV_LOG_DEBUG, "IS: %d, MSS: %d, TG: %d, LFL: %d, bands: %d\n",
-            c->IS, c->MSS, c->gapless, c->lastframelen, c->maxbands);
-    c->frames_to_skip = 0;
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-    avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-
-    if(vlc_initialized) return 0;
-    av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
-    scfi_vlc.table = scfi_table;
-    scfi_vlc.table_allocated = 1 << MPC7_SCFI_BITS;
-    if(init_vlc(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE,
-                &mpc7_scfi[1], 2, 1,
-                &mpc7_scfi[0], 2, 1, INIT_VLC_USE_NEW_STATIC)){
-        av_log(avctx, AV_LOG_ERROR, "Cannot init SCFI VLC\n");
-        return -1;
-    }
-    dscf_vlc.table = dscf_table;
-    dscf_vlc.table_allocated = 1 << MPC7_DSCF_BITS;
-    if(init_vlc(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE,
-                &mpc7_dscf[1], 2, 1,
-                &mpc7_dscf[0], 2, 1, INIT_VLC_USE_NEW_STATIC)){
-        av_log(avctx, AV_LOG_ERROR, "Cannot init DSCF VLC\n");
-        return -1;
-    }
-    hdr_vlc.table = hdr_table;
-    hdr_vlc.table_allocated = 1 << MPC7_HDR_BITS;
-    if(init_vlc(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE,
-                &mpc7_hdr[1], 2, 1,
-                &mpc7_hdr[0], 2, 1, INIT_VLC_USE_NEW_STATIC)){
-        av_log(avctx, AV_LOG_ERROR, "Cannot init HDR VLC\n");
-        return -1;
-    }
-    for(i = 0; i < MPC7_QUANT_VLC_TABLES; i++){
-        for(j = 0; j < 2; j++){
-            quant_vlc[i][j].table = &quant_tables[quant_offsets[i*2 + j]];
-            quant_vlc[i][j].table_allocated = quant_offsets[i*2 + j + 1] - quant_offsets[i*2 + j];
-            if(init_vlc(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i],
-                        &mpc7_quant_vlc[i][j][1], 4, 2,
-                        &mpc7_quant_vlc[i][j][0], 4, 2, INIT_VLC_USE_NEW_STATIC)){
-                av_log(avctx, AV_LOG_ERROR, "Cannot init QUANT VLC %i,%i\n",i,j);
-                return -1;
-            }
-        }
-    }
-    vlc_initialized = 1;
-
-    return 0;
-}
-
-/**
- * Fill samples for given subband
- */
-static inline void idx_to_quant(MPCContext *c, GetBitContext *gb, int idx, int *dst)
-{
-    int i, i1, t;
-    switch(idx){
-    case -1:
-        for(i = 0; i < SAMPLES_PER_BAND; i++){
-            *dst++ = (av_lfg_get(&c->rnd) & 0x3FC) - 510;
-        }
-        break;
-    case 1:
-        i1 = get_bits1(gb);
-        for(i = 0; i < SAMPLES_PER_BAND/3; i++){
-            t = get_vlc2(gb, quant_vlc[0][i1].table, 9, 2);
-            *dst++ = mpc7_idx30[t];
-            *dst++ = mpc7_idx31[t];
-            *dst++ = mpc7_idx32[t];
-        }
-        break;
-    case 2:
-        i1 = get_bits1(gb);
-        for(i = 0; i < SAMPLES_PER_BAND/2; i++){
-            t = get_vlc2(gb, quant_vlc[1][i1].table, 9, 2);
-            *dst++ = mpc7_idx50[t];
-            *dst++ = mpc7_idx51[t];
-        }
-        break;
-    case  3: case  4: case  5: case  6: case  7:
-        i1 = get_bits1(gb);
-        for(i = 0; i < SAMPLES_PER_BAND; i++)
-            *dst++ = get_vlc2(gb, quant_vlc[idx-1][i1].table, 9, 2) - mpc7_quant_vlc_off[idx-1];
-        break;
-    case  8: case  9: case 10: case 11: case 12:
-    case 13: case 14: case 15: case 16: case 17:
-        t = (1 << (idx - 2)) - 1;
-        for(i = 0; i < SAMPLES_PER_BAND; i++)
-            *dst++ = get_bits(gb, idx - 1) - t;
-        break;
-    default: // case 0 and -2..-17
-        return;
-    }
-}
-
-static int get_scale_idx(GetBitContext *gb, int ref)
-{
-    int t = get_vlc2(gb, dscf_vlc.table, MPC7_DSCF_BITS, 1) - 7;
-    if (t == 8)
-        return get_bits(gb, 6);
-    return av_clip_uintp2(ref + t, 7);
-}
-
-static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size;
-    MPCContext *c = avctx->priv_data;
-    GetBitContext gb;
-    int i, ch;
-    int mb = -1;
-    Band *bands = c->bands;
-    int off, ret, last_frame, skip;
-    int bits_used, bits_avail;
-
-    memset(bands, 0, sizeof(*bands) * (c->maxbands + 1));
-
-    buf_size = avpkt->size & ~3;
-    if (buf_size <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "packet size is too small (%i bytes)\n",
-               avpkt->size);
-        return AVERROR_INVALIDDATA;
-    }
-    if (buf_size != avpkt->size) {
-        av_log(avctx, AV_LOG_WARNING, "packet size is not a multiple of 4. "
-               "extra bytes at the end will be skipped.\n");
-    }
-
-    skip       = buf[0];
-    last_frame = buf[1];
-    buf       += 4;
-    buf_size  -= 4;
-
-    /* get output buffer */
-    frame->nb_samples = last_frame ? c->lastframelen : MPC_FRAME_SIZE;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    av_fast_padded_malloc(&c->bits, &c->buf_size, buf_size);
-    if (!c->bits)
-        return AVERROR(ENOMEM);
-    c->dsp.bswap_buf((uint32_t *)c->bits, (const uint32_t *)buf, buf_size >> 2);
-    init_get_bits(&gb, c->bits, buf_size * 8);
-    skip_bits_long(&gb, skip);
-
-    /* read subband indexes */
-    for(i = 0; i <= c->maxbands; i++){
-        for(ch = 0; ch < 2; ch++){
-            int t = 4;
-            if(i) t = get_vlc2(&gb, hdr_vlc.table, MPC7_HDR_BITS, 1) - 5;
-            if(t == 4) bands[i].res[ch] = get_bits(&gb, 4);
-            else bands[i].res[ch] = av_clip(bands[i-1].res[ch] + t, 0, 17);
-        }
-
-        if(bands[i].res[0] || bands[i].res[1]){
-            mb = i;
-            if(c->MSS) bands[i].msf = get_bits1(&gb);
-        }
-    }
-    /* get scale indexes coding method */
-    for(i = 0; i <= mb; i++)
-        for(ch = 0; ch < 2; ch++)
-            if(bands[i].res[ch]) bands[i].scfi[ch] = get_vlc2(&gb, scfi_vlc.table, MPC7_SCFI_BITS, 1);
-    /* get scale indexes */
-    for(i = 0; i <= mb; i++){
-        for(ch = 0; ch < 2; ch++){
-            if(bands[i].res[ch]){
-                bands[i].scf_idx[ch][2] = c->oldDSCF[ch][i];
-                bands[i].scf_idx[ch][0] = get_scale_idx(&gb, bands[i].scf_idx[ch][2]);
-                switch(bands[i].scfi[ch]){
-                case 0:
-                    bands[i].scf_idx[ch][1] = get_scale_idx(&gb, bands[i].scf_idx[ch][0]);
-                    bands[i].scf_idx[ch][2] = get_scale_idx(&gb, bands[i].scf_idx[ch][1]);
-                    break;
-                case 1:
-                    bands[i].scf_idx[ch][1] = get_scale_idx(&gb, bands[i].scf_idx[ch][0]);
-                    bands[i].scf_idx[ch][2] = bands[i].scf_idx[ch][1];
-                    break;
-                case 2:
-                    bands[i].scf_idx[ch][1] = bands[i].scf_idx[ch][0];
-                    bands[i].scf_idx[ch][2] = get_scale_idx(&gb, bands[i].scf_idx[ch][1]);
-                    break;
-                case 3:
-                    bands[i].scf_idx[ch][2] = bands[i].scf_idx[ch][1] = bands[i].scf_idx[ch][0];
-                    break;
-                }
-                c->oldDSCF[ch][i] = bands[i].scf_idx[ch][2];
-            }
-        }
-    }
-    /* get quantizers */
-    memset(c->Q, 0, sizeof(c->Q));
-    off = 0;
-    for(i = 0; i < BANDS; i++, off += SAMPLES_PER_BAND)
-        for(ch = 0; ch < 2; ch++)
-            idx_to_quant(c, &gb, bands[i].res[ch], c->Q[ch] + off);
-
-    ff_mpc_dequantize_and_synth(c, mb, (int16_t **)frame->extended_data, 2);
-
-    bits_used = get_bits_count(&gb);
-    bits_avail = buf_size * 8;
-    if (!last_frame && ((bits_avail < bits_used) || (bits_used + 32 <= bits_avail))) {
-        av_log(avctx, AV_LOG_ERROR, "Error decoding frame: used %i of %i bits\n", bits_used, bits_avail);
-        return -1;
-    }
-    if(c->frames_to_skip){
-        c->frames_to_skip--;
-        *got_frame_ptr = 0;
-        return avpkt->size;
-    }
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-static void mpc7_decode_flush(AVCodecContext *avctx)
-{
-    MPCContext *c = avctx->priv_data;
-
-    memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
-    c->frames_to_skip = 32;
-}
-
-static av_cold int mpc7_decode_close(AVCodecContext *avctx)
-{
-    MPCContext *c = avctx->priv_data;
-    av_freep(&c->bits);
-    c->buf_size = 0;
-    return 0;
-}
-
-AVCodec ff_mpc7_decoder = {
-    .name           = "mpc7",
-    .long_name      = NULL_IF_CONFIG_SMALL("Musepack SV7"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MUSEPACK7,
-    .priv_data_size = sizeof(MPCContext),
-    .init           = mpc7_decode_init,
-    .close          = mpc7_decode_close,
-    .decode         = mpc7_decode_frame,
-    .flush          = mpc7_decode_flush,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/mpc7data.h b/deps/libav/libavcodec/mpc7data.h
deleted file mode 100644
index f205ffe..0000000
--- a/deps/libav/libavcodec/mpc7data.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Musepack decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPC7DATA_H
-#define AVCODEC_MPC7DATA_H
-
-#include <stdint.h>
-
-static const int8_t mpc7_idx30[] = { -1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1};
-static const int8_t mpc7_idx31[] = { -1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1};
-static const int8_t mpc7_idx32[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1};
-static const int8_t mpc7_idx50[] = { -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2};
-static const int8_t mpc7_idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
-
-#define MPC7_SCFI_SIZE  4
-#define MPC7_SCFI_BITS  3
-static const uint8_t mpc7_scfi[MPC7_SCFI_SIZE * 2] = {
-    0x2, 3, 0x1, 1, 0x3, 3, 0x0, 2
-};
-
-#define MPC7_DSCF_SIZE 16
-#define MPC7_DSCF_BITS  6
-static const uint8_t mpc7_dscf[MPC7_DSCF_SIZE * 2] = {
-    0x20, 6, 0x04, 5, 0x11, 5, 0x1E, 5, 0x0D, 4, 0x00, 3, 0x03, 3, 0x09, 4,
-    0x05, 3, 0x02, 3, 0x0E, 4, 0x03, 4, 0x1F, 5, 0x05, 5, 0x21, 6, 0x0C, 4
-};
-
-#define MPC7_HDR_SIZE  10
-#define MPC7_HDR_BITS   9
-static const uint8_t mpc7_hdr[MPC7_HDR_SIZE * 2] = {
-    0x5C, 8, 0x2F, 7, 0x0A, 5, 0x04, 4, 0x00, 2,
-    0x01, 1, 0x03, 3, 0x16, 6, 0xBB, 9, 0xBA, 9
-};
-
-#define MPC7_QUANT_VLC_TABLES 7
-static const uint8_t mpc7_quant_vlc_sizes[MPC7_QUANT_VLC_TABLES * 2] = {
-    27, 25, 7, 9, 15, 31, 63
-};
-
-static const uint8_t mpc7_quant_vlc_off[MPC7_QUANT_VLC_TABLES] = {
-    0, 0, 3, 4, 7, 15, 31
-};
-
-static const uint16_t mpc7_quant_vlc[MPC7_QUANT_VLC_TABLES][2][64 * 2] = {
-{
-    {
-        0x0036,  6, 0x0009,  5, 0x0020,  6, 0x0005,  5, 0x000A,  4, 0x0007,  5,
-        0x0034,  6, 0x0000,  5, 0x0023,  6, 0x000A,  5, 0x0006,  4, 0x0004,  5,
-        0x000B,  4, 0x0007,  3, 0x000C,  4, 0x0003,  5, 0x0007,  4, 0x000B,  5,
-        0x0022,  6, 0x0001,  5, 0x0035,  6, 0x0006,  5, 0x0009,  4, 0x0002,  5,
-        0x0021,  6, 0x0008,  5, 0x0037,  6
-    },
-    {
-        0x0067,  8, 0x003E,  7, 0x00E1,  9, 0x0037,  7, 0x0003,  4, 0x0034,  7,
-        0x0065,  8, 0x003C,  7, 0x00E3,  9, 0x0018,  6, 0x0000,  4, 0x003D,  7,
-        0x0004,  4, 0x0001,  1, 0x0005,  4, 0x003F,  7, 0x0001,  4, 0x003B,  7,
-        0x00E2,  9, 0x0039,  7, 0x0064,  8, 0x0035,  7, 0x0002,  4, 0x0036,  7,
-        0x00E0,  9, 0x003A,  7, 0x0066,  8
-    }
-},
-{
-    {
-        0x0059,  7, 0x002F,  6, 0x000F,  5, 0x0000,  5, 0x005B,  7, 0x0004,  5,
-        0x0006,  4, 0x000D,  4, 0x0004,  4, 0x0005,  5, 0x0014,  5, 0x000C,  4,
-        0x0004,  3, 0x000F,  4, 0x000E,  5, 0x0003,  5, 0x0003,  4, 0x000E,  4,
-        0x0005,  4, 0x0001,  5, 0x005A,  7, 0x0002,  5, 0x0015,  5, 0x002E,  6,
-        0x0058,  7
-    },
-    {
-        0x0399, 10, 0x0071,  7, 0x0033,  6, 0x00E7,  8, 0x039A, 10, 0x0068,  7,
-        0x001E,  5, 0x0000,  3, 0x001D,  5, 0x0069,  7, 0x0032,  6, 0x0001,  3,
-        0x0002,  2, 0x0003,  3, 0x0031,  6, 0x006B,  7, 0x001B,  5, 0x0002,  3,
-        0x001F,  5, 0x0070,  7, 0x0398, 10, 0x006A,  7, 0x0030,  6, 0x0072,  7,
-        0x039B, 10
-    }
-},
-{
-    {
-        0x000C,  4, 0x0004,  3, 0x0000,  2, 0x0001,  2, 0x0007,  3, 0x0005,  3, 0x000D,  4
-    },
-    {
-        0x0004,  5, 0x0003,  4, 0x0002,  2, 0x0003,  2, 0x0001,  2, 0x0000,  3, 0x0005,  5
-    }
-},
-{
-    {
-        0x0005,  4, 0x0000,  3, 0x0004,  3, 0x0006,  3, 0x0007,  3, 0x0005,  3, 0x0003,  3, 0x0001,  3, 0x0004,  4
-    },
-    {
-        0x0009,  5, 0x000C,  4, 0x0003,  3, 0x0000,  2, 0x0002,  2, 0x0007,  3, 0x000D,  4, 0x0005,  4, 0x0008,  5
-    }
-},
-{
-    {
-        0x0039,  6, 0x0017,  5, 0x0008,  4, 0x000A,  4, 0x000D,  4, 0x0000,  3,
-        0x0002,  3, 0x0003,  3, 0x0001,  3, 0x000F,  4, 0x000C,  4, 0x0009,  4,
-        0x001D,  5, 0x0016,  5, 0x0038,  6,
-    },
-    {
-        0x00E5,  8, 0x0038,  6, 0x0007,  5, 0x0002,  4, 0x0000,  3, 0x0003,  3,
-        0x0005,  3, 0x0006,  3, 0x0004,  3, 0x0002,  3, 0x000F,  4, 0x001D,  5,
-        0x0006,  5, 0x0073,  7, 0x00E4,  8,
-    },
-},
-{
-    {
-        0x0041,  7, 0x0006,  6, 0x002C,  6, 0x002D,  6, 0x003B,  6, 0x000D,  5,
-        0x0011,  5, 0x0013,  5, 0x0017,  5, 0x0015,  5, 0x001A,  5, 0x001E,  5,
-        0x0000,  4, 0x0002,  4, 0x0005,  4, 0x0007,  4, 0x0003,  4, 0x0004,  4,
-        0x001F,  5, 0x001C,  5, 0x0019,  5, 0x001B,  5, 0x0018,  5, 0x0014,  5,
-        0x0012,  5, 0x000C,  5, 0x0002,  5, 0x003A,  6, 0x0021,  6, 0x0007,  6,
-        0x0040,  7
-    },
-    {
-        0x1948, 13, 0x194A, 13, 0x0328, 10, 0x0195,  9, 0x00CB,  8, 0x0066,  7,
-        0x0031,  6, 0x0009,  5, 0x000F,  5, 0x001F,  5, 0x0002,  4, 0x0006,  4,
-        0x0008,  4, 0x000B,  4, 0x000D,  4, 0x0000,  3, 0x000E,  4, 0x000A,  4,
-        0x0009,  4, 0x0005,  4, 0x0003,  4, 0x001E,  5, 0x000E,  5, 0x0008,  5,
-        0x0030,  6, 0x0067,  7, 0x00C9,  8, 0x00C8,  8, 0x0653, 11, 0x1949, 13,
-        0x194B, 13
-    }
-},
-{
-    {
-        0x0067,  8, 0x0099,  8, 0x00B5,  8, 0x00E9,  8, 0x0040,  7, 0x0041,  7,
-        0x004D,  7, 0x0051,  7, 0x005B,  7, 0x0071,  7, 0x0070,  7, 0x0018,  6,
-        0x001D,  6, 0x0023,  6, 0x0025,  6, 0x0029,  6, 0x002C,  6, 0x002E,  6,
-        0x0033,  6, 0x0031,  6, 0x0036,  6, 0x0037,  6, 0x0039,  6, 0x003C,  6,
-        0x0000,  5, 0x0002,  5, 0x000A,  5, 0x0005,  5, 0x0009,  5, 0x0006,  5,
-        0x000D,  5, 0x0007,  5, 0x000B,  5, 0x000F,  5, 0x0008,  5, 0x0004,  5,
-        0x0003,  5, 0x0001,  5, 0x003F,  6, 0x003E,  6, 0x003D,  6, 0x0035,  6,
-        0x003B,  6, 0x0034,  6, 0x0030,  6, 0x002F,  6, 0x002B,  6, 0x002A,  6,
-        0x0027,  6, 0x0024,  6, 0x0021,  6, 0x001C,  6, 0x0075,  7, 0x0065,  7,
-        0x0064,  7, 0x0050,  7, 0x0045,  7, 0x0044,  7, 0x0032,  7, 0x00E8,  8,
-        0x00B4,  8, 0x0098,  8, 0x0066,  8
-    },
-    {
-        0x37A4, 14, 0x37AD, 14, 0x37A6, 14, 0x37AE, 14, 0x0DEA, 12, 0x02F0, 10,
-        0x02F1, 10, 0x00A0,  9, 0x00A2,  9, 0x01BC,  9, 0x007A,  8, 0x00DF,  8,
-        0x003C,  7, 0x0049,  7, 0x006E,  7, 0x000E,  6, 0x0018,  6, 0x0019,  6,
-        0x0022,  6, 0x0025,  6, 0x0036,  6, 0x0003,  5, 0x0009,  5, 0x000B,  5,
-        0x0010,  5, 0x0013,  5, 0x0015,  5, 0x0018,  5, 0x001A,  5, 0x001D,  5,
-        0x001F,  5, 0x0002,  4, 0x0000,  4, 0x001E,  5, 0x001C,  5, 0x0019,  5,
-        0x0016,  5, 0x0014,  5, 0x000E,  5, 0x000D,  5, 0x0008,  5, 0x0006,  5,
-        0x0002,  5, 0x002E,  6, 0x0023,  6, 0x001F,  6, 0x0015,  6, 0x000F,  6,
-        0x005F,  7, 0x0048,  7, 0x0029,  7, 0x00BD,  8, 0x007B,  8, 0x0179,  9,
-        0x00A1,  9, 0x037B, 10, 0x0147, 10, 0x0146, 10, 0x0DE8, 12, 0x37AF, 14,
-        0x37A7, 14, 0x37AC, 14, 0x37A5, 14
-    }
-}
-};
-
-#endif /* AVCODEC_MPC7DATA_H */
diff --git a/deps/libav/libavcodec/mpc8.c b/deps/libav/libavcodec/mpc8.c
deleted file mode 100644
index b6e0cfd..0000000
--- a/deps/libav/libavcodec/mpc8.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * Musepack SV8 decoder
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
- * divided into 32 subbands.
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/lfg.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "mpegaudiodsp.h"
-
-#include "mpc.h"
-#include "mpc8data.h"
-#include "mpc8huff.h"
-
-static VLC band_vlc, scfi_vlc[2], dscf_vlc[2], res_vlc[2];
-static VLC q1_vlc, q2_vlc[2], q3_vlc[2], quant_vlc[4][2], q9up_vlc;
-
-static const int q3_offsets[2] = { MPC8_Q3_OFFSET, MPC8_Q4_OFFSET };
-static const int quant_offsets[6] = { MPC8_Q5_OFFSET, MPC8_Q6_OFFSET, MPC8_Q7_OFFSET, MPC8_Q8_OFFSET };
-
-static inline int mpc8_dec_base(GetBitContext *gb, int k, int n)
-{
-    int len = mpc8_cnk_len[k-1][n-1] - 1;
-    int code = len ? get_bits_long(gb, len) : 0;
-
-    if (code >= mpc8_cnk_lost[k-1][n-1])
-        code = ((code << 1) | get_bits1(gb)) - mpc8_cnk_lost[k-1][n-1];
-
-    return code;
-}
-
-static inline int mpc8_dec_enum(GetBitContext *gb, int k, int n)
-{
-    int bits = 0;
-    const uint32_t * C = mpc8_cnk[k-1];
-    int code = mpc8_dec_base(gb, k, n);
-
-    do {
-        n--;
-        if (code >= C[n]) {
-            bits |= 1 << n;
-            code -= C[n];
-            C -= 32;
-            k--;
-        }
-    } while(k > 0);
-
-    return bits;
-}
-
-static inline int mpc8_get_mod_golomb(GetBitContext *gb, int m)
-{
-    if(mpc8_cnk_len[0][m] < 1) return 0;
-    return mpc8_dec_base(gb, 1, m+1);
-}
-
-static int mpc8_get_mask(GetBitContext *gb, int size, int t)
-{
-    int mask = 0;
-
-    if(t && t != size)
-         mask = mpc8_dec_enum(gb, FFMIN(t, size - t), size);
-    if((t << 1) > size) mask = ~mask;
-
-    return mask;
-}
-
-static const uint16_t vlc_offsets[13] = {
-    0, 640, 1184, 1748, 2298, 2426, 2554, 3066, 3578, 4106, 4618, 5196, 5708
-};
-
-static av_cold int mpc8_decode_init(AVCodecContext * avctx)
-{
-    int i;
-    MPCContext *c = avctx->priv_data;
-    GetBitContext gb;
-    static int vlc_initialized = 0;
-    int channels;
-
-    static VLC_TYPE band_table[542][2];
-    static VLC_TYPE q1_table[520][2];
-    static VLC_TYPE q9up_table[524][2];
-    static VLC_TYPE scfi0_table[1 << MPC8_SCFI0_BITS][2];
-    static VLC_TYPE scfi1_table[1 << MPC8_SCFI1_BITS][2];
-    static VLC_TYPE dscf0_table[560][2];
-    static VLC_TYPE dscf1_table[598][2];
-    static VLC_TYPE q3_0_table[512][2];
-    static VLC_TYPE q3_1_table[516][2];
-    static VLC_TYPE codes_table[5708][2];
-
-    if(avctx->extradata_size < 2){
-        av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size);
-        return -1;
-    }
-    memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
-    av_lfg_init(&c->rnd, 0xDEADBEEF);
-    ff_dsputil_init(&c->dsp, avctx);
-    ff_mpadsp_init(&c->mpadsp);
-
-    ff_mpc_init();
-
-    init_get_bits(&gb, avctx->extradata, 16);
-
-    skip_bits(&gb, 3);//sample rate
-    c->maxbands = get_bits(&gb, 5) + 1;
-    channels = get_bits(&gb, 4) + 1;
-    if (channels > 2) {
-        avpriv_request_sample(avctx, "Multichannel MPC SV8");
-        return AVERROR_PATCHWELCOME;
-    }
-    c->MSS = get_bits1(&gb);
-    c->frames = 1 << (get_bits(&gb, 3) * 2);
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
-
-    if(vlc_initialized) return 0;
-    av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
-
-    band_vlc.table = band_table;
-    band_vlc.table_allocated = 542;
-    init_vlc(&band_vlc, MPC8_BANDS_BITS, MPC8_BANDS_SIZE,
-             mpc8_bands_bits,  1, 1,
-             mpc8_bands_codes, 1, 1, INIT_VLC_USE_NEW_STATIC);
-
-    q1_vlc.table = q1_table;
-    q1_vlc.table_allocated = 520;
-    init_vlc(&q1_vlc, MPC8_Q1_BITS, MPC8_Q1_SIZE,
-             mpc8_q1_bits,  1, 1,
-             mpc8_q1_codes, 1, 1, INIT_VLC_USE_NEW_STATIC);
-    q9up_vlc.table = q9up_table;
-    q9up_vlc.table_allocated = 524;
-    init_vlc(&q9up_vlc, MPC8_Q9UP_BITS, MPC8_Q9UP_SIZE,
-             mpc8_q9up_bits,  1, 1,
-             mpc8_q9up_codes, 1, 1, INIT_VLC_USE_NEW_STATIC);
-
-    scfi_vlc[0].table = scfi0_table;
-    scfi_vlc[0].table_allocated = 1 << MPC8_SCFI0_BITS;
-    init_vlc(&scfi_vlc[0], MPC8_SCFI0_BITS, MPC8_SCFI0_SIZE,
-             mpc8_scfi0_bits,  1, 1,
-             mpc8_scfi0_codes, 1, 1, INIT_VLC_USE_NEW_STATIC);
-    scfi_vlc[1].table = scfi1_table;
-    scfi_vlc[1].table_allocated = 1 << MPC8_SCFI1_BITS;
-    init_vlc(&scfi_vlc[1], MPC8_SCFI1_BITS, MPC8_SCFI1_SIZE,
-             mpc8_scfi1_bits,  1, 1,
-             mpc8_scfi1_codes, 1, 1, INIT_VLC_USE_NEW_STATIC);
-
-    dscf_vlc[0].table = dscf0_table;
-    dscf_vlc[0].table_allocated = 560;
-    init_vlc(&dscf_vlc[0], MPC8_DSCF0_BITS, MPC8_DSCF0_SIZE,
-             mpc8_dscf0_bits,  1, 1,
-             mpc8_dscf0_codes, 1, 1, INIT_VLC_USE_NEW_STATIC);
-    dscf_vlc[1].table = dscf1_table;
-    dscf_vlc[1].table_allocated = 598;
-    init_vlc(&dscf_vlc[1], MPC8_DSCF1_BITS, MPC8_DSCF1_SIZE,
-             mpc8_dscf1_bits,  1, 1,
-             mpc8_dscf1_codes, 1, 1, INIT_VLC_USE_NEW_STATIC);
-
-    q3_vlc[0].table = q3_0_table;
-    q3_vlc[0].table_allocated = 512;
-    ff_init_vlc_sparse(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE,
-             mpc8_q3_bits,  1, 1,
-             mpc8_q3_codes, 1, 1,
-             mpc8_q3_syms,  1, 1, INIT_VLC_USE_NEW_STATIC);
-    q3_vlc[1].table = q3_1_table;
-    q3_vlc[1].table_allocated = 516;
-    ff_init_vlc_sparse(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE,
-             mpc8_q4_bits,  1, 1,
-             mpc8_q4_codes, 1, 1,
-             mpc8_q4_syms,  1, 1, INIT_VLC_USE_NEW_STATIC);
-
-    for(i = 0; i < 2; i++){
-        res_vlc[i].table = &codes_table[vlc_offsets[0+i]];
-        res_vlc[i].table_allocated = vlc_offsets[1+i] - vlc_offsets[0+i];
-        init_vlc(&res_vlc[i], MPC8_RES_BITS, MPC8_RES_SIZE,
-                 &mpc8_res_bits[i],  1, 1,
-                 &mpc8_res_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-
-        q2_vlc[i].table = &codes_table[vlc_offsets[2+i]];
-        q2_vlc[i].table_allocated = vlc_offsets[3+i] - vlc_offsets[2+i];
-        init_vlc(&q2_vlc[i], MPC8_Q2_BITS, MPC8_Q2_SIZE,
-                 &mpc8_q2_bits[i],  1, 1,
-                 &mpc8_q2_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-
-        quant_vlc[0][i].table = &codes_table[vlc_offsets[4+i]];
-        quant_vlc[0][i].table_allocated = vlc_offsets[5+i] - vlc_offsets[4+i];
-        init_vlc(&quant_vlc[0][i], MPC8_Q5_BITS, MPC8_Q5_SIZE,
-                 &mpc8_q5_bits[i],  1, 1,
-                 &mpc8_q5_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-        quant_vlc[1][i].table = &codes_table[vlc_offsets[6+i]];
-        quant_vlc[1][i].table_allocated = vlc_offsets[7+i] - vlc_offsets[6+i];
-        init_vlc(&quant_vlc[1][i], MPC8_Q6_BITS, MPC8_Q6_SIZE,
-                 &mpc8_q6_bits[i],  1, 1,
-                 &mpc8_q6_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-        quant_vlc[2][i].table = &codes_table[vlc_offsets[8+i]];
-        quant_vlc[2][i].table_allocated = vlc_offsets[9+i] - vlc_offsets[8+i];
-        init_vlc(&quant_vlc[2][i], MPC8_Q7_BITS, MPC8_Q7_SIZE,
-                 &mpc8_q7_bits[i],  1, 1,
-                 &mpc8_q7_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-        quant_vlc[3][i].table = &codes_table[vlc_offsets[10+i]];
-        quant_vlc[3][i].table_allocated = vlc_offsets[11+i] - vlc_offsets[10+i];
-        init_vlc(&quant_vlc[3][i], MPC8_Q8_BITS, MPC8_Q8_SIZE,
-                 &mpc8_q8_bits[i],  1, 1,
-                 &mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-    }
-    vlc_initialized = 1;
-
-    return 0;
-}
-
-static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MPCContext *c = avctx->priv_data;
-    GetBitContext gb2, *gb = &gb2;
-    int i, j, k, ch, cnt, res, t;
-    Band *bands = c->bands;
-    int off;
-    int maxband, keyframe;
-    int last[2];
-
-    /* get output buffer */
-    frame->nb_samples = MPC_FRAME_SIZE;
-    if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return res;
-    }
-
-    keyframe = c->cur_frame == 0;
-
-    if(keyframe){
-        memset(c->Q, 0, sizeof(c->Q));
-        c->last_bits_used = 0;
-    }
-    init_get_bits(gb, buf, buf_size * 8);
-    skip_bits(gb, c->last_bits_used & 7);
-
-    if(keyframe)
-        maxband = mpc8_get_mod_golomb(gb, c->maxbands + 1);
-    else{
-        maxband = c->last_max_band + get_vlc2(gb, band_vlc.table, MPC8_BANDS_BITS, 2);
-        if(maxband > 32) maxband -= 33;
-    }
-    if(maxband > c->maxbands + 1)
-        return AVERROR_INVALIDDATA;
-    c->last_max_band = maxband;
-
-    /* read subband indexes */
-    if(maxband){
-        last[0] = last[1] = 0;
-        for(i = maxband - 1; i >= 0; i--){
-            for(ch = 0; ch < 2; ch++){
-                last[ch] = get_vlc2(gb, res_vlc[last[ch] > 2].table, MPC8_RES_BITS, 2) + last[ch];
-                if(last[ch] > 15) last[ch] -= 17;
-                bands[i].res[ch] = last[ch];
-            }
-        }
-        if(c->MSS){
-            int mask;
-
-            cnt = 0;
-            for(i = 0; i < maxband; i++)
-                if(bands[i].res[0] || bands[i].res[1])
-                    cnt++;
-            t = mpc8_get_mod_golomb(gb, cnt);
-            mask = mpc8_get_mask(gb, cnt, t);
-            for(i = maxband - 1; i >= 0; i--)
-                if(bands[i].res[0] || bands[i].res[1]){
-                    bands[i].msf = mask & 1;
-                    mask >>= 1;
-                }
-        }
-    }
-    for(i = maxband; i < c->maxbands; i++)
-        bands[i].res[0] = bands[i].res[1] = 0;
-
-    if(keyframe){
-        for(i = 0; i < 32; i++)
-            c->oldDSCF[0][i] = c->oldDSCF[1][i] = 1;
-    }
-
-    for(i = 0; i < maxband; i++){
-        if(bands[i].res[0] || bands[i].res[1]){
-            cnt = !!bands[i].res[0] + !!bands[i].res[1] - 1;
-            if(cnt >= 0){
-                t = get_vlc2(gb, scfi_vlc[cnt].table, scfi_vlc[cnt].bits, 1);
-                if(bands[i].res[0]) bands[i].scfi[0] = t >> (2 * cnt);
-                if(bands[i].res[1]) bands[i].scfi[1] = t & 3;
-            }
-        }
-    }
-
-    for(i = 0; i < maxband; i++){
-        for(ch = 0; ch < 2; ch++){
-            if(!bands[i].res[ch]) continue;
-
-            if(c->oldDSCF[ch][i]){
-                bands[i].scf_idx[ch][0] = get_bits(gb, 7) - 6;
-                c->oldDSCF[ch][i] = 0;
-            }else{
-                t = get_vlc2(gb, dscf_vlc[1].table, MPC8_DSCF1_BITS, 2);
-                if(t == 64)
-                    t += get_bits(gb, 6);
-                bands[i].scf_idx[ch][0] = ((bands[i].scf_idx[ch][2] + t - 25) & 0x7F) - 6;
-            }
-            for(j = 0; j < 2; j++){
-                if((bands[i].scfi[ch] << j) & 2)
-                    bands[i].scf_idx[ch][j + 1] = bands[i].scf_idx[ch][j];
-                else{
-                    t = get_vlc2(gb, dscf_vlc[0].table, MPC8_DSCF0_BITS, 2);
-                    if(t == 31)
-                        t = 64 + get_bits(gb, 6);
-                    bands[i].scf_idx[ch][j + 1] = ((bands[i].scf_idx[ch][j] + t - 25) & 0x7F) - 6;
-                }
-            }
-        }
-    }
-
-    for(i = 0, off = 0; i < maxband; i++, off += SAMPLES_PER_BAND){
-        for(ch = 0; ch < 2; ch++){
-            res = bands[i].res[ch];
-            switch(res){
-            case -1:
-                for(j = 0; j < SAMPLES_PER_BAND; j++)
-                    c->Q[ch][off + j] = (av_lfg_get(&c->rnd) & 0x3FC) - 510;
-                break;
-            case 0:
-                break;
-            case 1:
-                for(j = 0; j < SAMPLES_PER_BAND; j += SAMPLES_PER_BAND / 2){
-                    cnt = get_vlc2(gb, q1_vlc.table, MPC8_Q1_BITS, 2);
-                    t = mpc8_get_mask(gb, 18, cnt);
-                    for(k = 0; k < SAMPLES_PER_BAND / 2; k++, t <<= 1)
-                        c->Q[ch][off + j + k] = (t & 0x20000) ? (get_bits1(gb) << 1) - 1 : 0;
-                }
-                break;
-            case 2:
-                cnt = 6;//2*mpc8_thres[res]
-                for(j = 0; j < SAMPLES_PER_BAND; j += 3){
-                    t = get_vlc2(gb, q2_vlc[cnt > 3].table, MPC8_Q2_BITS, 2);
-                    c->Q[ch][off + j + 0] = mpc8_idx50[t];
-                    c->Q[ch][off + j + 1] = mpc8_idx51[t];
-                    c->Q[ch][off + j + 2] = mpc8_idx52[t];
-                    cnt = (cnt >> 1) + mpc8_huffq2[t];
-                }
-                break;
-            case 3:
-            case 4:
-                for(j = 0; j < SAMPLES_PER_BAND; j += 2){
-                    t = get_vlc2(gb, q3_vlc[res - 3].table, MPC8_Q3_BITS, 2) + q3_offsets[res - 3];
-                    c->Q[ch][off + j + 1] = t >> 4;
-                    c->Q[ch][off + j + 0] = (t & 8) ? (t & 0xF) - 16 : (t & 0xF);
-                }
-                break;
-            case 5:
-            case 6:
-            case 7:
-            case 8:
-                cnt = 2 * mpc8_thres[res];
-                for(j = 0; j < SAMPLES_PER_BAND; j++){
-                    t = get_vlc2(gb, quant_vlc[res - 5][cnt > mpc8_thres[res]].table, quant_vlc[res - 5][cnt > mpc8_thres[res]].bits, 2) + quant_offsets[res - 5];
-                    c->Q[ch][off + j] = t;
-                    cnt = (cnt >> 1) + FFABS(c->Q[ch][off + j]);
-                }
-                break;
-            default:
-                for(j = 0; j < SAMPLES_PER_BAND; j++){
-                    c->Q[ch][off + j] = get_vlc2(gb, q9up_vlc.table, MPC8_Q9UP_BITS, 2);
-                    if(res != 9){
-                        c->Q[ch][off + j] <<= res - 9;
-                        c->Q[ch][off + j] |= get_bits(gb, res - 9);
-                    }
-                    c->Q[ch][off + j] -= (1 << (res - 2)) - 1;
-                }
-            }
-        }
-    }
-
-    ff_mpc_dequantize_and_synth(c, maxband - 1,
-                                (int16_t **)frame->extended_data,
-                                avctx->channels);
-
-    c->cur_frame++;
-
-    c->last_bits_used = get_bits_count(gb);
-    if(get_bits_left(gb) < 8) // we have only padding left
-        c->last_bits_used = buf_size << 3;
-    if(c->cur_frame >= c->frames)
-        c->cur_frame = 0;
-
-    *got_frame_ptr = 1;
-
-    return c->cur_frame ? c->last_bits_used >> 3 : buf_size;
-}
-
-static av_cold void mpc8_decode_flush(AVCodecContext *avctx)
-{
-    MPCContext *c = avctx->priv_data;
-    c->cur_frame = 0;
-}
-
-AVCodec ff_mpc8_decoder = {
-    .name           = "mpc8",
-    .long_name      = NULL_IF_CONFIG_SMALL("Musepack SV8"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MUSEPACK8,
-    .priv_data_size = sizeof(MPCContext),
-    .init           = mpc8_decode_init,
-    .decode         = mpc8_decode_frame,
-    .flush          = mpc8_decode_flush,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/mpc8data.h b/deps/libav/libavcodec/mpc8data.h
deleted file mode 100644
index 2940b30..0000000
--- a/deps/libav/libavcodec/mpc8data.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Musepack SV8 decoder
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPC8DATA_H
-#define AVCODEC_MPC8DATA_H
-
-#include <stdint.h>
-
-static const int8_t mpc8_idx50[125] = {
-    -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2,
-    -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2,
-    -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2,
-    -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2,
-    -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2
-};
-static const int8_t mpc8_idx51[125] = {
-    -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-    -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-    -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-    -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
-    -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2
-};
-static const int8_t mpc8_idx52[125] = {
-    -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
-};
-
-static const unsigned int mpc8_thres[] = {0, 0, 3, 0, 0, 1, 3, 4, 8};
-static const int8_t mpc8_huffq2[5*5*5] = {
-    6, 5, 4, 5, 6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 5,
-    6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3,
-    4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 2, 3, 4, 3,
-    2, 3, 4, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5,
-    4, 3, 4, 5, 6, 5, 4, 5, 6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5,
-    6, 5, 4, 5, 6
-};
-
-
-static const uint32_t mpc8_cnk[16][32] =
-{
-    {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31},
-    {0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465},
-    {0, 0, 0, 1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364, 455, 560, 680, 816, 969, 1140, 1330, 1540, 1771, 2024, 2300, 2600, 2925, 3276, 3654, 4060, 4495},
-    {0, 0, 0, 0, 1, 5, 15, 35, 70, 126, 210, 330, 495, 715, 1001, 1365, 1820, 2380, 3060, 3876, 4845, 5985, 7315, 8855, 10626, 12650, 14950, 17550, 20475, 23751, 27405, 31465},
-    {0, 0, 0, 0, 0, 1, 6, 21, 56, 126, 252, 462, 792, 1287, 2002, 3003, 4368, 6188, 8568, 11628, 15504, 20349, 26334, 33649, 42504, 53130, 65780, 80730, 98280, 118755, 142506, 169911},
-    {0, 0, 0, 0, 0, 0, 1, 7, 28, 84, 210, 462, 924, 1716, 3003, 5005, 8008, 12376, 18564, 27132, 38760, 54264, 74613, 100947, 134596, 177100, 230230, 296010, 376740, 475020, 593775, 736281},
-    {0, 0, 0, 0, 0, 0, 0, 1, 8, 36, 120, 330, 792, 1716, 3432, 6435, 11440, 19448, 31824, 50388, 77520, 116280, 170544, 245157, 346104, 480700, 657800, 888030, 1184040, 1560780, 2035800, 2629575},
-    {0, 0, 0, 0, 0, 0, 0, 0, 1, 9, 45, 165, 495, 1287, 3003, 6435, 12870, 24310, 43758, 75582, 125970, 203490, 319770, 490314, 735471, 1081575, 1562275, 2220075, 3108105, 4292145, 5852925, 7888725},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10, 55, 220, 715, 2002, 5005, 11440, 24310, 48620, 92378, 167960, 293930, 497420, 817190, 1307504, 2042975, 3124550, 4686825, 6906900, 10015005, 14307150, 20160075},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11, 66, 286, 1001, 3003, 8008, 19448, 43758, 92378, 184756, 352716, 646646, 1144066, 1961256, 3268760, 5311735, 8436285, 13123110, 20030010, 30045015, 44352165},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 78, 364, 1365, 4368, 12376, 31824, 75582, 167960, 352716, 705432, 1352078, 2496144, 4457400, 7726160, 13037895, 21474180, 34597290, 54627300, 84672315},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 13, 91, 455, 1820, 6188, 18564, 50388, 125970, 293930, 646646, 1352078, 2704156, 5200300, 9657700, 17383860, 30421755, 51895935, 86493225, 141120525},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 14, 105, 560, 2380, 8568, 27132, 77520, 203490, 497420, 1144066, 2496144, 5200300, 10400600, 20058300, 37442160, 67863915, 119759850, 206253075},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 15, 120, 680, 3060, 11628, 38760, 116280, 319770, 817190, 1961256, 4457400, 9657700, 20058300, 40116600, 77558760, 145422675, 265182525},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 136, 816, 3876, 15504, 54264, 170544, 490314, 1307504, 3268760, 7726160, 17383860, 37442160, 77558760, 155117520, 300540195},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 153, 969, 4845, 20349, 74613, 245157, 735471, 2042975, 5311735, 13037895, 30421755, 67863915, 145422675, 300540195}
-};
-
-static const uint8_t mpc8_cnk_len[16][33] =
-{
-    {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6},
-    {0, 0, 2, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0},
-    {0, 0, 0, 2, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 0},
-    {0, 0, 0, 0, 3, 4, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 0},
-    {0, 0, 0, 0, 0, 3, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 0},
-    {0, 0, 0, 0, 0, 0, 3, 5, 7, 8, 9, 10, 11, 12, 13, 13, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 0},
-    {0, 0, 0, 0, 0, 0, 0, 3, 6, 7, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 8, 9, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23, 23, 23, 24, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 8, 10, 11, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 24, 25, 25, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 9, 10, 12, 13, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 25, 26, 26, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 9, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 27, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 9, 11, 13, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 28, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 10, 12, 14, 15, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 10, 12, 14, 16, 17, 19, 20, 21, 23, 24, 25, 26, 27, 28, 28, 29, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 10, 12, 14, 16, 18, 19, 21, 22, 23, 25, 26, 27, 28, 29, 30, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 10, 13, 15, 17, 18, 20, 21, 23, 24, 25, 27, 28, 29, 30, 0}
-
-};
-
-static const uint32_t mpc8_cnk_lost[16][33] =
-{
-    {0, 0, 1, 0, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 31},
-    {0, 0, 1, 2, 6, 1, 11, 4, 28, 19, 9, 62, 50, 37, 23, 8, 120, 103, 85, 66, 46, 25, 3, 236, 212, 187, 161, 134, 106, 77, 47, 16, 0},
-    {0, 0, 0, 0, 6, 12, 29, 8, 44, 8, 91, 36, 226, 148, 57, 464, 344, 208, 55, 908, 718, 508, 277, 24, 1796, 1496, 1171, 820, 442, 36, 3697, 3232, 0},
-    {0, 0, 0, 0, 3, 1, 29, 58, 2, 46, 182, 17, 309, 23, 683, 228, 1716, 1036, 220, 3347, 2207, 877, 7529, 5758, 3734, 1434, 15218, 12293, 9017, 5363, 1303, 29576, 0},
-    {0, 0, 0, 0, 0, 2, 11, 8, 2, 4, 50, 232, 761, 46, 1093, 3824, 2004, 7816, 4756, 880, 12419, 6434, 31887, 23032, 12406, 65292, 50342, 32792, 12317, 119638, 92233, 60768, 0},
-    {0, 0, 0, 0, 0, 0, 1, 4, 44, 46, 50, 100, 332, 1093, 3187, 184, 4008, 14204, 5636, 26776, 11272, 56459, 30125, 127548, 85044, 31914, 228278, 147548, 49268, 454801, 312295, 142384, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 28, 8, 182, 232, 332, 664, 1757, 4944, 13320, 944, 15148, 53552, 14792, 91600, 16987, 178184, 43588, 390776, 160546, 913112, 536372, 61352, 1564729, 828448, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 7, 19, 91, 17, 761, 1093, 1757, 3514, 8458, 21778, 55490, 5102, 58654, 204518, 33974, 313105, 1015577, 534877, 1974229, 1086199, 4096463, 2535683, 499883, 6258916, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 9, 36, 309, 46, 3187, 4944, 8458, 16916, 38694, 94184, 230358, 26868, 231386, 789648, 54177, 1069754, 3701783, 1481708, 6762211, 2470066, 13394357, 5505632, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 62, 226, 23, 1093, 184, 13320, 21778, 38694, 77388, 171572, 401930, 953086, 135896, 925544, 3076873, 8340931, 3654106, 13524422, 3509417, 22756699, 2596624, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 50, 148, 683, 3824, 4008, 944, 55490, 94184, 171572, 343144, 745074, 1698160, 3931208, 662448, 3739321, 12080252, 32511574, 12481564, 49545413, 5193248, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 37, 57, 228, 2004, 14204, 15148, 5102, 230358, 401930, 745074, 1490148, 3188308, 7119516, 16170572, 3132677, 15212929, 47724503, 127314931, 42642616, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 23, 464, 1716, 7816, 5636, 53552, 58654, 26868, 953086, 1698160, 3188308, 6376616, 13496132, 29666704, 66353813, 14457878, 62182381, 189497312, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 344, 1036, 4756, 26776, 14792, 204518, 231386, 135896, 3931208, 7119516, 13496132, 26992264, 56658968, 123012781, 3252931, 65435312, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 208, 220, 880, 11272, 91600, 33974, 789648, 925544, 662448, 16170572, 29666704, 56658968, 113317936, 236330717, 508019104, 0},
-    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 103, 55, 3347, 12419, 56459, 16987, 313105, 54177, 3076873, 3739321, 3132677, 66353813, 123012781, 236330717, 0}
-};
-
-#endif /* AVCODEC_MPC8DATA_H */
diff --git a/deps/libav/libavcodec/mpc8huff.h b/deps/libav/libavcodec/mpc8huff.h
deleted file mode 100644
index 6005e21..0000000
--- a/deps/libav/libavcodec/mpc8huff.h
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- * Musepack SV8 decoder
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPC8HUFF_H
-#define AVCODEC_MPC8HUFF_H
-
-#include <stdint.h>
-
-#define MPC8_BANDS_SIZE 33
-#define MPC8_BANDS_BITS 9
-
-static const uint8_t mpc8_bands_codes[MPC8_BANDS_SIZE] = {
- 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04,
- 0x05, 0x06, 0x01, 0x02, 0x03, 0x00, 0x04, 0x05,
- 0x06, 0x07, 0x08, 0x01, 0x09, 0x0A, 0x0B, 0x07,
- 0x08, 0x09, 0x06, 0x07, 0x05, 0x05, 0x03, 0x03,
- 0x01,
-};
-static const int8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = {
-  1,  3,  5,  6,  7,  8,  8,  9,
- 10, 11, 12, 12, 12, 13, 12, 12,
- 12, 12, 12, 13, 12, 12, 12, 11,
- 11, 11, 10, 10,  9,  8,  6,  5,
-  2,
-};
-
-#define MPC8_SCFI0_SIZE 4
-#define MPC8_SCFI0_BITS 3
-
-static const uint8_t mpc8_scfi0_codes[MPC8_SCFI0_SIZE] = {
- 0x00, 0x01, 0x01, 0x01,
-};
-static const int8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = {
-  3,  3,  1,  2,
-};
-
-#define MPC8_SCFI1_SIZE 16
-#define MPC8_SCFI1_BITS 7
-
-static const uint8_t mpc8_scfi1_codes[MPC8_SCFI1_SIZE] = {
- 0x01, 0x00, 0x02, 0x03, 0x01, 0x03, 0x04, 0x05,
- 0x04, 0x06, 0x02, 0x02, 0x05, 0x07, 0x03, 0x03,
-
-};
-static const int8_t mpc8_scfi1_bits[MPC8_SCFI1_SIZE] = {
-  6,  7,  6,  6,  7,  5,  5,  5,
-  6,  5,  2,  3,  6,  5,  3,  2,
-
-};
-
-#define MPC8_DSCF0_SIZE 64
-#define MPC8_DSCF0_BITS 9
-
-static const uint8_t mpc8_dscf0_codes[MPC8_DSCF0_SIZE] = {
- 0x03, 0x04, 0x05, 0x04, 0x05, 0x06, 0x05, 0x06,
- 0x07, 0x08, 0x09, 0x07, 0x08, 0x09, 0x0A, 0x07,
- 0x08, 0x09, 0x0A, 0x07, 0x08, 0x09, 0x0A, 0x06,
- 0x07, 0x05, 0x04, 0x05, 0x06, 0x06, 0x07, 0x0A,
- 0x08, 0x05, 0x06, 0x07, 0x09, 0x07, 0x08, 0x09,
- 0x0B, 0x0B, 0x0C, 0x0D, 0x0B, 0x0C, 0x0D, 0x0B,
- 0x0C, 0x0D, 0x07, 0x08, 0x09, 0x06, 0x07, 0x03,
- 0x04, 0x05, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
-};
-static const int8_t mpc8_dscf0_bits[MPC8_DSCF0_SIZE] = {
- 12, 12, 12, 11, 11, 11, 10, 10,
- 10, 10, 10,  9,  9,  9,  9,  8,
-  8,  8,  8,  7,  7,  7,  7,  6,
-  6,  5,  4,  4,  5,  4,  4, 10,
-  4,  3,  3,  3,  4,  5,  6,  6,
-  7,  8,  8,  8,  9,  9,  9, 10,
- 10, 10, 11, 11, 11, 12, 12, 13,
- 13, 13, 14, 14, 14, 14, 14, 14,
-
-};
-
-#define MPC8_DSCF1_SIZE 65
-#define MPC8_DSCF1_BITS 9
-
-static const uint8_t mpc8_dscf1_codes[MPC8_DSCF1_SIZE] = {
- 0x00, 0x03, 0x04, 0x04, 0x05, 0x06, 0x05, 0x06,
- 0x07, 0x08, 0x07, 0x08, 0x09, 0x0A, 0x07, 0x08,
- 0x09, 0x0A, 0x07, 0x08, 0x09, 0x06, 0x07, 0x05,
- 0x06, 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x05,
- 0x06, 0x07, 0x05, 0x04, 0x05, 0x05, 0x07, 0x08,
- 0x09, 0x0A, 0x0B, 0x0B, 0x0C, 0x0D, 0x0B, 0x0C,
- 0x0D, 0x09, 0x0A, 0x0B, 0x0C, 0x07, 0x08, 0x09,
- 0x05, 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05,
- 0x0D,
-};
-static const int8_t mpc8_dscf1_bits[MPC8_DSCF1_SIZE] = {
- 15, 14, 14, 13, 13, 13, 12, 12,
- 12, 12, 11, 11, 11, 11, 10, 10,
- 10, 10,  9,  9,  9,  8,  8,  7,
-  7,  6,  5,  4,  4,  3,  3,  3,
-  3,  3,  4,  5,  5,  6,  7,  8,
-  8,  9,  9, 10, 10, 10, 11, 11,
- 11, 12, 12, 12, 12, 13, 13, 13,
- 14, 14, 14, 15, 15, 15, 15, 15,
- 12,
-};
-
-#define MPC8_RES_SIZE 17
-#define MPC8_RES_BITS 9
-
-static const uint8_t mpc8_res_codes[2][MPC8_RES_SIZE] = {
-  {
-    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-    0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01,
-    0x01,
-  },
-  {
-    0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-    0x00, 0x01, 0x02, 0x03, 0x01, 0x01, 0x01, 0x01,
-    0x03,
-  }
-};
-static const int8_t mpc8_res_bits[2][MPC8_RES_SIZE] = {
-  {
-     1,  2,  4,  5,  6,  7,  9, 10,
-    11, 12, 13, 14, 15, 16, 16,  8,
-     3,
-  },
-  {
-     2,  2,  3,  5,  7,  8, 10, 12,
-    14, 14, 14, 14, 11,  9,  6,  4,
-     2,
-  }
-};
-
-#define MPC8_Q1_SIZE 19
-#define MPC8_Q1_BITS 9
-
-static const uint8_t mpc8_q1_codes[MPC8_Q1_SIZE] = {
- 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x00, 0x01,
-};
-static const int8_t mpc8_q1_bits[MPC8_Q1_SIZE] = {
-  6,  4,  4,  3,  3,  3,  3,  3,
-  4,  4,  4,  5,  7,  8,  9, 10,
- 11, 12, 12,
-};
-
-#define MPC8_Q9UP_SIZE 256
-#define MPC8_Q9UP_BITS 9
-
-static const uint8_t mpc8_q9up_codes[MPC8_Q9UP_SIZE] = {
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x12, 0x26, 0x27, 0x13, 0x14, 0x15,
- 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,
- 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
- 0x28, 0x26, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E,
- 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
- 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E,
- 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
- 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E,
- 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56,
- 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E,
- 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
- 0x67, 0x68, 0x69, 0x6A, 0x56, 0x57, 0x58, 0x59,
- 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61,
- 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x3E,
- 0x3F, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
- 0x78, 0x79, 0x7A, 0x6B, 0x7B, 0x6C, 0x6D, 0x6E,
- 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
- 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E,
- 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86,
- 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E,
- 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
- 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E,
- 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,
- 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0x27, 0x28, 0x29,
- 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31,
- 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
- 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41,
- 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
- 0x4A, 0x4B, 0x06, 0x07, 0x08, 0x09, 0x00, 0x01,
-};
-static const int8_t mpc8_q9up_bits[MPC8_Q9UP_SIZE] = {
- 10, 10, 10, 10, 10,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  8,  8,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  8,  9,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  7,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  6,
-  6,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  7,  8,  7,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9, 10, 10, 10, 10, 11, 11,
-};
-
-#define MPC8_Q2_SIZE 125
-#define MPC8_Q2_BITS 9
-
-static const uint8_t mpc8_q2_codes[2][MPC8_Q2_SIZE] = {
-{
- 0x02, 0x03, 0x0F, 0x04, 0x00, 0x05, 0x0C, 0x12,
- 0x0D, 0x06, 0x07, 0x13, 0x15, 0x14, 0x08, 0x09,
- 0x0E, 0x15, 0x0F, 0x0A, 0x03, 0x0B, 0x10, 0x0C,
- 0x01, 0x0D, 0x10, 0x16, 0x11, 0x0E, 0x12, 0x0F,
- 0x10, 0x16, 0x13, 0x17, 0x11, 0x08, 0x12, 0x18,
- 0x14, 0x13, 0x14, 0x17, 0x15, 0x0F, 0x16, 0x19,
- 0x17, 0x10, 0x11, 0x1A, 0x18, 0x1B, 0x12, 0x1C,
- 0x15, 0x09, 0x16, 0x1D, 0x19, 0x0A, 0x07, 0x0B,
- 0x1A, 0x1E, 0x17, 0x0C, 0x18, 0x1F, 0x13, 0x20,
- 0x1B, 0x21, 0x14, 0x11, 0x18, 0x22, 0x19, 0x12,
- 0x1A, 0x19, 0x1A, 0x1B, 0x1B, 0x23, 0x1C, 0x0D,
- 0x1D, 0x24, 0x1C, 0x1C, 0x1E, 0x1F, 0x1D, 0x13,
- 0x1E, 0x25, 0x1F, 0x14, 0x02, 0x15, 0x15, 0x16,
- 0x04, 0x17, 0x20, 0x26, 0x21, 0x18, 0x16, 0x27,
- 0x1D, 0x28, 0x19, 0x1A, 0x22, 0x29, 0x23, 0x1B,
- 0x03, 0x1C, 0x17, 0x1D, 0x05,
-},
-{
- 0x02, 0x03, 0x0F, 0x04, 0x00, 0x05, 0x0C, 0x0D,
- 0x0E, 0x06, 0x07, 0x0F, 0x1E, 0x10, 0x10, 0x08,
- 0x11, 0x12, 0x13, 0x09, 0x03, 0x0A, 0x11, 0x0B,
- 0x01, 0x0C, 0x14, 0x15, 0x16, 0x0D, 0x17, 0x12,
- 0x0E, 0x13, 0x18, 0x19, 0x14, 0x0F, 0x10, 0x1A,
- 0x1B, 0x15, 0x11, 0x16, 0x1C, 0x0E, 0x1D, 0x1E,
- 0x1F, 0x0F, 0x12, 0x20, 0x1F, 0x21, 0x13, 0x22,
- 0x12, 0x13, 0x14, 0x23, 0x20, 0x15, 0x0F, 0x16,
- 0x21, 0x24, 0x17, 0x18, 0x19, 0x25, 0x14, 0x26,
- 0x22, 0x27, 0x15, 0x10, 0x28, 0x29, 0x2A, 0x11,
- 0x2B, 0x17, 0x1A, 0x18, 0x2C, 0x2D, 0x1B, 0x1C,
- 0x19, 0x2E, 0x2F, 0x1A, 0x1D, 0x1B, 0x30, 0x12,
- 0x31, 0x32, 0x33, 0x13, 0x02, 0x14, 0x15, 0x16,
- 0x04, 0x17, 0x34, 0x35, 0x36, 0x18, 0x16, 0x37,
- 0x23, 0x38, 0x19, 0x1A, 0x39, 0x3A, 0x3B, 0x1B,
- 0x03, 0x1C, 0x17, 0x1D, 0x05,
-}
-};
-static const int8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = {
-{
- 12, 11, 10, 11, 13, 11,  9,  8,
-  9, 11, 11,  8,  7,  8, 11, 11,
-  9,  8,  9, 11, 12, 11, 10, 11,
- 13, 11,  9,  8,  9, 11,  9,  6,
-  6,  7,  9,  8,  6,  4,  6,  8,
-  9,  6,  6,  7,  9, 11,  9,  8,
-  9, 11, 10,  8,  7,  8, 10,  8,
-  6,  4,  6,  8,  7,  4,  3,  4,
-  7,  8,  6,  4,  6,  8, 10,  8,
-  7,  8, 10, 11,  9,  8,  9, 11,
-  9,  6,  6,  6,  9,  8,  6,  4,
-  6,  8,  9,  7,  6,  6,  9, 11,
-  9,  8,  9, 11, 13, 11, 10, 11,
- 12, 11,  9,  8,  9, 11, 10,  8,
-  7,  8, 11, 11,  9,  8,  9, 11,
- 13, 11, 10, 11, 12,
-},
-{
- 11, 10,  9, 10, 12, 10,  8,  8,
-  8, 10, 10,  8,  7,  8,  9, 10,
-  8,  8,  8, 10, 11, 10,  9, 10,
- 12, 10,  8,  8,  8, 10,  8,  6,
-  5,  6,  8,  8,  6,  5,  5,  8,
-  8,  6,  5,  6,  8, 10,  8,  8,
-  8, 10,  9,  8,  7,  8,  9,  8,
-  5,  5,  5,  8,  7,  5,  4,  5,
-  7,  8,  5,  5,  5,  8,  9,  8,
-  7,  8,  9, 10,  8,  8,  8, 10,
-  8,  6,  5,  6,  8,  8,  5,  5,
-  6,  8,  8,  6,  5,  6,  8, 10,
-  8,  8,  8, 10, 12, 10, 10, 10,
- 11, 10,  8,  8,  8, 10,  9,  8,
-  7,  8, 10, 10,  8,  8,  8, 10,
- 12, 10,  9, 10, 11,
-}
-};
-
-#define MPC8_Q3_SIZE 49
-#define MPC8_Q3_BITS 9
-#define MPC8_Q3_OFFSET -48
-
-static const uint8_t mpc8_q3_codes[MPC8_Q3_SIZE] = {
- 0x07, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x0F,
- 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x13, 0x12, 0x11,
- 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09,
- 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A,
- 0x09, 0x08, 0x07, 0x06, 0x05, 0x09, 0x08, 0x07,
- 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01,
- 0x00,
-};
-static const int8_t mpc8_q3_bits[MPC8_Q3_SIZE] = {
-  3,  4,  4,  4,  4,  4,  4,  5,
-  5,  5,  5,  5,  5,  6,  6,  6,
-  6,  6,  6,  6,  6,  6,  6,  6,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  7,  7,  7,  8,  8,  8,
-  8,  8,  8,  8,  8,  9,  9,  9,
-  9,
-};
-static const int8_t mpc8_q3_syms[MPC8_Q3_SIZE] = {
-   48,    65,    64,    49,    63,    32,    47,    80,
-   79,    50,    62,    33,    16,    82,    81,    95,
-   94,    66,    78,    34,    46,    17,    31,    30,
-   97,    96,   111,    67,    77,    51,    61,    35,
-   45,    18,     1,     0,    15,    98,   110,    83,
-   93,    19,    29,     2,    14,    99,   109,     3,
-   13,
-};
-
-#define MPC8_Q4_SIZE 81
-#define MPC8_Q4_BITS 9
-#define MPC8_Q4_OFFSET -64
-
-static const uint8_t mpc8_q4_codes[MPC8_Q4_SIZE] = {
- 0x0F, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17,
- 0x16, 0x15, 0x14, 0x13, 0x12, 0x23, 0x22, 0x21,
- 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19,
- 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11,
- 0x10, 0x0F, 0x0E, 0x0D, 0x19, 0x18, 0x17, 0x16,
- 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E,
- 0x0D, 0x0C, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12,
- 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A,
- 0x09, 0x08, 0x07, 0x06, 0x05, 0x09, 0x08, 0x07,
- 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01,
- 0x00,
-};
-static const int8_t mpc8_q4_bits[MPC8_Q4_SIZE] = {
-  4,  5,  5,  5,  5,  5,  5,  5,
-  5,  5,  5,  5,  5,  6,  6,  6,
-  6,  6,  6,  6,  6,  6,  6,  6,
-  6,  6,  6,  6,  6,  6,  6,  6,
-  6,  6,  6,  6,  7,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  9,  9,  9,
-  9,  9,  9,  9,  9, 10, 10, 10,
- 10,
-};
-static const int8_t mpc8_q4_syms[MPC8_Q4_SIZE] = {
-   64,    96,    81,    80,    95,    66,    65,    79,
-   78,    49,    48,    63,    32,   113,   112,    98,
-   97,   111,   110,    83,    82,    94,    93,    67,
-   77,    51,    50,    62,    61,    34,    33,    47,
-   46,    17,    16,    31,   128,   114,   127,   126,
-   99,   109,    68,    76,    35,    45,    18,    30,
-    0,    15,   130,   129,   143,   142,   115,   125,
-  100,   108,    84,    92,    52,    60,    36,    44,
-   19,    29,     2,     1,    14,   131,   141,   116,
-  124,    20,    28,     3,    13,   132,   140,     4,
-   12,
-};
-
-#define MPC8_Q5_SIZE 15
-#define MPC8_Q5_BITS 7
-#define MPC8_Q5_OFFSET -7
-
-static const uint8_t mpc8_q5_codes[2][MPC8_Q5_SIZE] = {
-{
- 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03,
- 0x04, 0x05, 0x03, 0x03, 0x03, 0x02, 0x03,
-},
-{
- 0x00, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05,
- 0x06, 0x07, 0x04, 0x05, 0x03, 0x02, 0x03,
-}
-};
-static const int8_t mpc8_q5_bits[2][MPC8_Q5_SIZE] = {
-{
-  7,  7,  6,  5,  4,  3,  3,  2,
-  3,  3,  4,  5,  6,  7,  7,
-},
-{
-  6,  6,  5,  4,  4,  3,  3,  3,
-  3,  3,  4,  4,  5,  6,  6,
-}
-};
-
-#define MPC8_Q6_SIZE 31
-#define MPC8_Q6_BITS 9
-#define MPC8_Q6_OFFSET -15
-
-static const uint8_t mpc8_q6_codes[2][MPC8_Q6_SIZE] = {
-{
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x03,
- 0x04, 0x05, 0x05, 0x06, 0x04, 0x05, 0x04, 0x03,
- 0x05, 0x06, 0x07, 0x07, 0x06, 0x07, 0x08, 0x09,
- 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07,
-},
-{
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x04,
- 0x05, 0x06, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
- 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x07, 0x08, 0x09,
- 0x06, 0x07, 0x05, 0x06, 0x07, 0x02, 0x03,
-}
-};
-static const int8_t mpc8_q6_bits[2][MPC8_Q6_SIZE] = {
-{
-  9,  9,  9,  9,  8,  8,  7,  6,
-  6,  6,  5,  5,  4,  4,  3,  2,
-  3,  4,  4,  5,  6,  6,  6,  6,
-  7,  8,  8,  9,  9,  9,  9,
-},
-{
-  8,  8,  7,  7,  7,  6,  6,  5,
-  5,  5,  4,  4,  4,  4,  4,  4,
-  4,  4,  4,  4,  4,  5,  5,  5,
-  6,  6,  7,  7,  7,  8,  8,
-}
-};
-
-#define MPC8_Q7_SIZE 63
-#define MPC8_Q7_BITS 9
-#define MPC8_Q7_OFFSET -31
-
-static const uint8_t mpc8_q7_codes[2][MPC8_Q7_SIZE] = {
-{
- 0x00, 0x01, 0x02, 0x08, 0x09, 0x03, 0x04, 0x05,
- 0x06, 0x07, 0x0A, 0x0B, 0x0C, 0x0D, 0x0A, 0x0B,
- 0x0C, 0x0D, 0x0E, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
- 0x0A, 0x0B, 0x0C, 0x08, 0x09, 0x06, 0x04, 0x03,
- 0x05, 0x07, 0x0A, 0x0B, 0x0D, 0x0E, 0x0F, 0x0F,
- 0x10, 0x11, 0x12, 0x0F, 0x13, 0x10, 0x11, 0x12,
- 0x13, 0x0E, 0x0F, 0x10, 0x11, 0x08, 0x09, 0x0A,
- 0x0B, 0x0C, 0x12, 0x13, 0x0D, 0x0E, 0x0F,
-},
-{
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x09, 0x0A,
- 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x0C, 0x0D,
- 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
- 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,
- 0x1E, 0x1F, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
- 0x17, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x09, 0x0A,
- 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x02, 0x03,
-}
-};
-static const int8_t mpc8_q7_bits[2][MPC8_Q7_SIZE] = {
-{
- 10, 10, 10,  9,  9, 10, 10, 10,
- 10, 10,  9,  9,  9,  9,  8,  8,
-  8,  8,  8,  7,  7,  7,  7,  7,
-  6,  6,  6,  5,  5,  4,  3,  2,
-  3,  4,  5,  5,  6,  6,  6,  7,
-  7,  7,  7,  8,  7,  8,  8,  8,
-  8,  9,  9,  9,  9, 10, 10, 10,
- 10, 10,  9,  9, 10, 10, 10,
-},
-{
-  9,  9,  8,  8,  8,  8,  8,  8,
-  8,  7,  7,  7,  7,  7,  6,  6,
-  6,  6,  6,  6,  6,  6,  5,  5,
-  5,  5,  5,  5,  5,  5,  5,  5,
-  5,  5,  5,  5,  5,  5,  5,  5,
-  5,  5,  6,  6,  6,  6,  6,  6,
-  6,  7,  7,  7,  7,  7,  8,  8,
-  8,  8,  8,  8,  8,  9,  9,
-}
-};
-
-#define MPC8_Q8_SIZE 127
-#define MPC8_Q8_BITS 9
-#define MPC8_Q8_OFFSET -63
-
-static const uint8_t mpc8_q8_codes[2][MPC8_Q8_SIZE] = {
-{
- 0x03, 0x04, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x1A,
- 0x0F, 0x1B, 0x10, 0x00, 0x01, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x11, 0x0C, 0x12, 0x13,
- 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1C, 0x1A,
- 0x1B, 0x1C, 0x1D, 0x1E, 0x1D, 0x1E, 0x1F, 0x20,
- 0x21, 0x22, 0x23, 0x24, 0x19, 0x25, 0x1A, 0x1B,
- 0x1C, 0x1D, 0x1E, 0x1F, 0x14, 0x15, 0x16, 0x17,
- 0x0E, 0x0F, 0x10, 0x11, 0x0B, 0x07, 0x04, 0x03,
- 0x05, 0x0C, 0x0D, 0x12, 0x13, 0x14, 0x15, 0x18,
- 0x19, 0x1A, 0x1B, 0x20, 0x21, 0x22, 0x23, 0x24,
- 0x25, 0x26, 0x27, 0x26, 0x27, 0x28, 0x29, 0x2A,
- 0x2B, 0x2C, 0x2D, 0x2E, 0x1F, 0x20, 0x2F, 0x21,
- 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
- 0x0D, 0x0E, 0x2A, 0x0F, 0x10, 0x11, 0x12, 0x02,
- 0x13, 0x03, 0x04, 0x05, 0x2B, 0x2C, 0x30, 0x31,
- 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33,
-},
-{
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x15, 0x16,
- 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E,
- 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
- 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E,
- 0x2F, 0x30, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B,
- 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33,
- 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
- 0x3C, 0x3D, 0x3E, 0x31, 0x3F, 0x32, 0x33, 0x34,
- 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C,
- 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44,
- 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x16,
- 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E,
- 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
- 0x27, 0x28, 0x29, 0x04, 0x05, 0x06, 0x07,
-}
-};
-static const int8_t mpc8_q8_bits[2][MPC8_Q8_SIZE] = {
-{
- 11, 11, 10, 10, 10, 10, 10,  9,
- 10,  9, 10, 12, 12, 11, 11, 11,
- 11, 11, 11, 11, 10, 11, 10, 10,
- 10, 10, 10, 10, 10, 10,  9, 10,
- 10, 10, 10, 10,  9,  9,  9,  9,
-  9,  9,  9,  9,  8,  9,  8,  8,
-  8,  8,  8,  8,  7,  7,  7,  7,
-  6,  6,  6,  6,  5,  4,  3,  2,
-  3,  5,  5,  6,  6,  6,  6,  7,
-  7,  7,  7,  8,  8,  8,  8,  8,
-  8,  8,  8,  9,  9,  9,  9,  9,
-  9,  9,  9,  9, 10, 10,  9, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 11, 11, 10, 11, 11, 11, 11, 12,
- 11, 12, 12, 12, 10, 10,  9,  9,
- 10, 10, 10, 10, 10, 10, 10,
-},
-{
-  9,  9,  9,  9,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  6,  6,  6,  6,  6,  6,
-  6,  6,  6,  6,  6,  6,  6,  6,
-  6,  6,  6,  6,  6,  6,  6,  6,
-  6,  6,  6,  7,  6,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  9,  9,  9,  9,
-}
-};
-
-#endif /* AVCODEC_MPC8HUFF_H */
diff --git a/deps/libav/libavcodec/mpcdata.h b/deps/libav/libavcodec/mpcdata.h
deleted file mode 100644
index 15724f3..0000000
--- a/deps/libav/libavcodec/mpcdata.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Musepack decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPCDATA_H
-#define AVCODEC_MPCDATA_H
-
-static const float mpc_CC[18+1] = {
-    111.285962475327f, // 32768/2/255*sqrt(3)
-    65536.0000 /* this value is never used */,
-    21845.3333, 13107.2000, 9362.2857, 7281.7778, 4369.0667, 2114.0645,
-    1040.2539, 516.0315, 257.0039, 128.2505, 64.0626, 32.0156, 16.0039, 8.0010,
-    4.0002, 2.0001, 1.0000
-};
-
-static const float mpc_SCF[128+6] = {
-    920.016296386718750000, 766.355773925781250000, 638.359558105468750000,
-    531.741149902343750000, 442.930114746093750000, 368.952209472656250000,
-    307.330047607421875000, 255.999984741210937500, 213.243041992187500000, 177.627334594726562500,
-    147.960128784179687500, 123.247924804687500000, 102.663139343261718750, 85.516410827636718750,
-    71.233520507812500000, 59.336143493652343750, 49.425861358642578125, 41.170787811279296875,
-    34.294471740722656250, 28.566631317138671875, 23.795452117919921875, 19.821151733398437500,
-    16.510635375976562500, 13.753040313720703125, 11.456016540527343750, 9.542640686035156250,
-    7.948835372924804688, 6.621226310729980469, 5.515353679656982422, 4.594182968139648438,
-    3.826865673065185547, 3.187705039978027344, 2.655296564102172852, 2.211810588836669922,
-    1.842395424842834473, 1.534679770469665527, 1.278358578681945801, 1.064847946166992188,
-    0.886997759342193604, 0.738851964473724365, 0.615449428558349609, 0.512657463550567627,
-    0.427033752202987671, 0.355710864067077637, 0.296300262212753296, 0.246812388300895691,
-    0.205589950084686279, 0.171252459287643433, 0.142649993300437927, 0.118824683129787445,
-    0.098978661000728607, 0.082447312772274017, 0.068677015602588654, 0.057206626981496811,
-    0.047652013599872589, 0.039693206548690796, 0.033063672482967377, 0.027541399002075195,
-    0.022941453382372856, 0.019109787419438362, 0.015918083488941193, 0.013259455561637878,
-    0.011044870130717754, 0.009200163185596466, 0.007663558237254620, 0.006383595988154411,
-    0.005317411851137877, 0.004429301247000694, 0.003689522389322519, 0.003073300700634718,
-    0.002560000168159604, 0.002132430672645569, 0.001776273478753865, 0.001479601487517357,
-    0.001232479466125369, 0.001026631565764546, 0.000855164253152907, 0.000712335284333676,
-    0.000593361502978951, 0.000494258652906865, 0.000411707907915115, 0.000342944724252447,
-    0.000285666319541633, 0.000237954518524930, 0.000198211506358348, 0.000165106350323185,
-    0.000137530398205854, 0.000114560163638089, 0.000095426403277088, 0.000079488345363643,
-    0.000066212254751008, 0.000055153526773211, 0.000045941822463647, 0.000038268648495432,
-    0.000031877043511486, 0.000026552961571724, 0.000022118103515822, 0.000018423952496960,
-    0.000015346795407822, 0.000012783583770215, 0.000010648477655195, 0.000008869976227288,
-    0.000007388518497464, 0.000006154492893984, 0.000005126573796588, 0.000004270336830814,
-    0.000003557107902452, 0.000002963002089018, 0.000002468123511790, 0.000002055899130937,
-    0.000001712524181130, 0.000001426499579793, 0.000001188246528727, 0.000000989786371974,
-    0.000000824472920158, 0.000000686770022185, 0.000000572066142013, 0.000000476520028769,
-    0.000000396931966407, 0.000000330636652279, 0.000000275413924555, 0.000000229414467867,
-    0.000000191097811353, 0.000000159180785886, 0.000000132594522029, 0.000000110448674207,
-    0.000000092001613439, 0.000000076635565449, 0.000000063835940978, 0.000000053174105119,
-    0.000000044293003043, 0.000000036895215771, 0.000000030733001921, 0.000000025599996789
-};
-
-#endif /* AVCODEC_MPCDATA_H */
diff --git a/deps/libav/libavcodec/mpeg12.c b/deps/libav/libavcodec/mpeg12.c
deleted file mode 100644
index 5797d27..0000000
--- a/deps/libav/libavcodec/mpeg12.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * MPEG-1/2 decoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG-1/2 decoder
- */
-
-#include "libavutil/attributes.h"
-#include "internal.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "error_resilience.h"
-#include "mpeg12.h"
-#include "mpeg12data.h"
-#include "bytestream.h"
-#include "thread.h"
-
-uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
-
-static const uint8_t table_mb_ptype[7][2] = {
-    { 3, 5 }, // 0x01 MB_INTRA
-    { 1, 2 }, // 0x02 MB_PAT
-    { 1, 3 }, // 0x08 MB_FOR
-    { 1, 1 }, // 0x0A MB_FOR|MB_PAT
-    { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA
-    { 1, 5 }, // 0x12 MB_QUANT|MB_PAT
-    { 2, 5 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT
-};
-
-static const uint8_t table_mb_btype[11][2] = {
-    { 3, 5 }, // 0x01 MB_INTRA
-    { 2, 3 }, // 0x04 MB_BACK
-    { 3, 3 }, // 0x06 MB_BACK|MB_PAT
-    { 2, 4 }, // 0x08 MB_FOR
-    { 3, 4 }, // 0x0A MB_FOR|MB_PAT
-    { 2, 2 }, // 0x0C MB_FOR|MB_BACK
-    { 3, 2 }, // 0x0E MB_FOR|MB_BACK|MB_PAT
-    { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA
-    { 2, 6 }, // 0x16 MB_QUANT|MB_BACK|MB_PAT
-    { 3, 6 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT
-    { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT
-};
-
-#define INIT_2D_VLC_RL(rl, static_size)\
-{\
-    static RL_VLC_ELEM rl_vlc_table[static_size];\
-    INIT_VLC_STATIC(&rl.vlc, TEX_VLC_BITS, rl.n + 2,\
-                    &rl.table_vlc[0][1], 4, 2,\
-                    &rl.table_vlc[0][0], 4, 2, static_size);\
-\
-    rl.rl_vlc[0] = rl_vlc_table;\
-    init_2d_vlc_rl(&rl);\
-}
-
-static av_cold void init_2d_vlc_rl(RLTable *rl)
-{
-    int i;
-
-    for (i = 0; i < rl->vlc.table_size; i++) {
-        int code = rl->vlc.table[i][0];
-        int len  = rl->vlc.table[i][1];
-        int level, run;
-
-        if (len == 0) { // illegal code
-            run   = 65;
-            level = MAX_LEVEL;
-        } else if (len<0) { //more bits needed
-            run   = 0;
-            level = code;
-        } else {
-            if (code == rl->n) { //esc
-                run   = 65;
-                level = 0;
-            } else if (code == rl->n+1) { //eob
-                run   = 0;
-                level = 127;
-            } else {
-                run   = rl->table_run  [code] + 1;
-                level = rl->table_level[code];
-            }
-        }
-        rl->rl_vlc[0][i].len   = len;
-        rl->rl_vlc[0][i].level = level;
-        rl->rl_vlc[0][i].run   = run;
-    }
-}
-
-av_cold void ff_mpeg12_common_init(MpegEncContext *s)
-{
-
-    s->y_dc_scale_table =
-    s->c_dc_scale_table = ff_mpeg2_dc_scale_table[s->intra_dc_precision];
-
-}
-
-void ff_mpeg1_clean_buffers(MpegEncContext *s)
-{
-    s->last_dc[0] = 1 << (7 + s->intra_dc_precision);
-    s->last_dc[1] = s->last_dc[0];
-    s->last_dc[2] = s->last_dc[0];
-    memset(s->last_mv, 0, sizeof(s->last_mv));
-}
-
-
-/******************************************/
-/* decoding */
-
-VLC ff_mv_vlc;
-
-VLC ff_dc_lum_vlc;
-VLC ff_dc_chroma_vlc;
-
-VLC ff_mbincr_vlc;
-VLC ff_mb_ptype_vlc;
-VLC ff_mb_btype_vlc;
-VLC ff_mb_pat_vlc;
-
-av_cold void ff_mpeg12_init_vlcs(void)
-{
-    static int done = 0;
-
-    if (!done) {
-        done = 1;
-
-        INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12,
-                        ff_mpeg12_vlc_dc_lum_bits, 1, 1,
-                        ff_mpeg12_vlc_dc_lum_code, 2, 2, 512);
-        INIT_VLC_STATIC(&ff_dc_chroma_vlc,  DC_VLC_BITS, 12,
-                        ff_mpeg12_vlc_dc_chroma_bits, 1, 1,
-                        ff_mpeg12_vlc_dc_chroma_code, 2, 2, 514);
-        INIT_VLC_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17,
-                        &ff_mpeg12_mbMotionVectorTable[0][1], 2, 1,
-                        &ff_mpeg12_mbMotionVectorTable[0][0], 2, 1, 518);
-        INIT_VLC_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36,
-                        &ff_mpeg12_mbAddrIncrTable[0][1], 2, 1,
-                        &ff_mpeg12_mbAddrIncrTable[0][0], 2, 1, 538);
-        INIT_VLC_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64,
-                        &ff_mpeg12_mbPatTable[0][1], 2, 1,
-                        &ff_mpeg12_mbPatTable[0][0], 2, 1, 512);
-
-        INIT_VLC_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7,
-                        &table_mb_ptype[0][1], 2, 1,
-                        &table_mb_ptype[0][0], 2, 1, 64);
-        INIT_VLC_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11,
-                        &table_mb_btype[0][1], 2, 1,
-                        &table_mb_btype[0][0], 2, 1, 64);
-        ff_init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]);
-        ff_init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]);
-
-        INIT_2D_VLC_RL(ff_rl_mpeg1, 680);
-        INIT_2D_VLC_RL(ff_rl_mpeg2, 674);
-    }
-}
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s)
-{
-    int i;
-    uint32_t state = pc->state;
-
-    /* EOF considered as end of frame */
-    if (buf_size == 0)
-        return 0;
-
-/*
- 0  frame start         -> 1/4
- 1  first_SEQEXT        -> 0/2
- 2  first field start   -> 3/0
- 3  second_SEQEXT       -> 2/0
- 4  searching end
-*/
-
-    for (i = 0; i < buf_size; i++) {
-        assert(pc->frame_start_found >= 0 && pc->frame_start_found <= 4);
-        if (pc->frame_start_found & 1) {
-            if (state == EXT_START_CODE && (buf[i] & 0xF0) != 0x80)
-                pc->frame_start_found--;
-            else if (state == EXT_START_CODE + 2) {
-                if ((buf[i] & 3) == 3)
-                    pc->frame_start_found = 0;
-                else
-                    pc->frame_start_found = (pc->frame_start_found + 1) & 3;
-            }
-            state++;
-        } else {
-            i = avpriv_find_start_code(buf + i, buf + buf_size, &state) - buf - 1;
-            if (pc->frame_start_found == 0 && state >= SLICE_MIN_START_CODE && state <= SLICE_MAX_START_CODE) {
-                i++;
-                pc->frame_start_found = 4;
-            }
-            if (state == SEQ_END_CODE) {
-                pc->frame_start_found = 0;
-                pc->state=-1;
-                return i+1;
-            }
-            if (pc->frame_start_found == 2 && state == SEQ_START_CODE)
-                pc->frame_start_found = 0;
-            if (pc->frame_start_found  < 4 && state == EXT_START_CODE)
-                pc->frame_start_found++;
-            if (pc->frame_start_found == 4 && (state & 0xFFFFFF00) == 0x100) {
-                if (state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE) {
-                    pc->frame_start_found = 0;
-                    pc->state             = -1;
-                    return i - 3;
-                }
-            }
-            if (pc->frame_start_found == 0 && s && state == PICTURE_START_CODE) {
-                ff_fetch_timestamp(s, i - 3, 1);
-            }
-        }
-    }
-    pc->state = state;
-    return END_NOT_FOUND;
-}
diff --git a/deps/libav/libavcodec/mpeg12.h b/deps/libav/libavcodec/mpeg12.h
deleted file mode 100644
index 9132dc3..0000000
--- a/deps/libav/libavcodec/mpeg12.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * MPEG1/2 common code
- * Copyright (c) 2007 Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPEG12_H
-#define AVCODEC_MPEG12_H
-
-#include "mpegvideo.h"
-
-#define DC_VLC_BITS 9
-#define MV_VLC_BITS 9
-#define TEX_VLC_BITS 9
-
-#define MBINCR_VLC_BITS 9
-#define MB_PAT_VLC_BITS 9
-#define MB_PTYPE_VLC_BITS 6
-#define MB_BTYPE_VLC_BITS 6
-
-extern VLC ff_dc_lum_vlc;
-extern VLC ff_dc_chroma_vlc;
-extern VLC ff_mbincr_vlc;
-extern VLC ff_mb_ptype_vlc;
-extern VLC ff_mb_btype_vlc;
-extern VLC ff_mb_pat_vlc;
-extern VLC ff_mv_vlc;
-
-extern uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
-
-void ff_mpeg12_common_init(MpegEncContext *s);
-void ff_mpeg12_init_vlcs(void);
-
-static inline int decode_dc(GetBitContext *gb, int component)
-{
-    int code, diff;
-
-    if (component == 0) {
-        code = get_vlc2(gb, ff_dc_lum_vlc.table, DC_VLC_BITS, 2);
-    } else {
-        code = get_vlc2(gb, ff_dc_chroma_vlc.table, DC_VLC_BITS, 2);
-    }
-    if (code < 0){
-        av_log(NULL, AV_LOG_ERROR, "invalid dc code at\n");
-        return 0xffff;
-    }
-    if (code == 0) {
-        diff = 0;
-    } else {
-        diff = get_xbits(gb, code);
-    }
-    return diff;
-}
-
-int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n);
-void ff_mpeg1_clean_buffers(MpegEncContext *s);
-int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s);
-
-#endif /* AVCODEC_MPEG12_H */
diff --git a/deps/libav/libavcodec/mpeg12data.c b/deps/libav/libavcodec/mpeg12data.c
deleted file mode 100644
index ccc3d2d..0000000
--- a/deps/libav/libavcodec/mpeg12data.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * MPEG1/2 tables
- * copyright (c) 2000,2001 Fabrice Bellard
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG1/2 tables.
- */
-
-#include "mpeg12data.h"
-
-const uint16_t ff_mpeg1_default_intra_matrix[64] = {
-        8, 16, 19, 22, 26, 27, 29, 34,
-        16, 16, 22, 24, 27, 29, 34, 37,
-        19, 22, 26, 27, 29, 34, 34, 38,
-        22, 22, 26, 27, 29, 34, 37, 40,
-        22, 26, 27, 29, 32, 35, 40, 48,
-        26, 27, 29, 32, 35, 40, 48, 58,
-        26, 27, 29, 34, 38, 46, 56, 69,
-        27, 29, 35, 38, 46, 56, 69, 83
-};
-
-const uint16_t ff_mpeg1_default_non_intra_matrix[64] = {
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-};
-
-const uint16_t ff_mpeg12_vlc_dc_lum_code[12] = {
-    0x4, 0x0, 0x1, 0x5, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x1ff,
-};
-const unsigned char ff_mpeg12_vlc_dc_lum_bits[12] = {
-    3, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9,
-};
-
-const uint16_t ff_mpeg12_vlc_dc_chroma_code[12] = {
-    0x0, 0x1, 0x2, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x3fe, 0x3ff,
-};
-const unsigned char ff_mpeg12_vlc_dc_chroma_bits[12] = {
-    2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10,
-};
-
-static const uint16_t mpeg1_vlc[113][2] = {
- { 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 },
- { 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 },
- { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, { 0x1a, 13 },
- { 0x19, 13 }, { 0x18, 13 }, { 0x17, 13 }, { 0x1f, 14 },
- { 0x1e, 14 }, { 0x1d, 14 }, { 0x1c, 14 }, { 0x1b, 14 },
- { 0x1a, 14 }, { 0x19, 14 }, { 0x18, 14 }, { 0x17, 14 },
- { 0x16, 14 }, { 0x15, 14 }, { 0x14, 14 }, { 0x13, 14 },
- { 0x12, 14 }, { 0x11, 14 }, { 0x10, 14 }, { 0x18, 15 },
- { 0x17, 15 }, { 0x16, 15 }, { 0x15, 15 }, { 0x14, 15 },
- { 0x13, 15 }, { 0x12, 15 }, { 0x11, 15 }, { 0x10, 15 },
- { 0x3, 3 }, { 0x6, 6 }, { 0x25, 8 }, { 0xc, 10 },
- { 0x1b, 12 }, { 0x16, 13 }, { 0x15, 13 }, { 0x1f, 15 },
- { 0x1e, 15 }, { 0x1d, 15 }, { 0x1c, 15 }, { 0x1b, 15 },
- { 0x1a, 15 }, { 0x19, 15 }, { 0x13, 16 }, { 0x12, 16 },
- { 0x11, 16 }, { 0x10, 16 }, { 0x5, 4 }, { 0x4, 7 },
- { 0xb, 10 }, { 0x14, 12 }, { 0x14, 13 }, { 0x7, 5 },
- { 0x24, 8 }, { 0x1c, 12 }, { 0x13, 13 }, { 0x6, 5 },
- { 0xf, 10 }, { 0x12, 12 }, { 0x7, 6 }, { 0x9, 10 },
- { 0x12, 13 }, { 0x5, 6 }, { 0x1e, 12 }, { 0x14, 16 },
- { 0x4, 6 }, { 0x15, 12 }, { 0x7, 7 }, { 0x11, 12 },
- { 0x5, 7 }, { 0x11, 13 }, { 0x27, 8 }, { 0x10, 13 },
- { 0x23, 8 }, { 0x1a, 16 }, { 0x22, 8 }, { 0x19, 16 },
- { 0x20, 8 }, { 0x18, 16 }, { 0xe, 10 }, { 0x17, 16 },
- { 0xd, 10 }, { 0x16, 16 }, { 0x8, 10 }, { 0x15, 16 },
- { 0x1f, 12 }, { 0x1a, 12 }, { 0x19, 12 }, { 0x17, 12 },
- { 0x16, 12 }, { 0x1f, 13 }, { 0x1e, 13 }, { 0x1d, 13 },
- { 0x1c, 13 }, { 0x1b, 13 }, { 0x1f, 16 }, { 0x1e, 16 },
- { 0x1d, 16 }, { 0x1c, 16 }, { 0x1b, 16 },
- { 0x1, 6 }, /* escape */
- { 0x2, 2 }, /* EOB */
-};
-
-static const uint16_t mpeg2_vlc[113][2] = {
-  {0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5},
-  {0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7},
-  {0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8},
-  {0xfb, 8}, {0xfe, 8}, {0xff, 8}, {0x1f,14},
-  {0x1e,14}, {0x1d,14}, {0x1c,14}, {0x1b,14},
-  {0x1a,14}, {0x19,14}, {0x18,14}, {0x17,14},
-  {0x16,14}, {0x15,14}, {0x14,14}, {0x13,14},
-  {0x12,14}, {0x11,14}, {0x10,14}, {0x18,15},
-  {0x17,15}, {0x16,15}, {0x15,15}, {0x14,15},
-  {0x13,15}, {0x12,15}, {0x11,15}, {0x10,15},
-  {0x02, 3}, {0x06, 5}, {0x79, 7}, {0x27, 8},
-  {0x20, 8}, {0x16,13}, {0x15,13}, {0x1f,15},
-  {0x1e,15}, {0x1d,15}, {0x1c,15}, {0x1b,15},
-  {0x1a,15}, {0x19,15}, {0x13,16}, {0x12,16},
-  {0x11,16}, {0x10,16}, {0x05, 5}, {0x07, 7},
-  {0xfc, 8}, {0x0c,10}, {0x14,13}, {0x07, 5},
-  {0x26, 8}, {0x1c,12}, {0x13,13}, {0x06, 6},
-  {0xfd, 8}, {0x12,12}, {0x07, 6}, {0x04, 9},
-  {0x12,13}, {0x06, 7}, {0x1e,12}, {0x14,16},
-  {0x04, 7}, {0x15,12}, {0x05, 7}, {0x11,12},
-  {0x78, 7}, {0x11,13}, {0x7a, 7}, {0x10,13},
-  {0x21, 8}, {0x1a,16}, {0x25, 8}, {0x19,16},
-  {0x24, 8}, {0x18,16}, {0x05, 9}, {0x17,16},
-  {0x07, 9}, {0x16,16}, {0x0d,10}, {0x15,16},
-  {0x1f,12}, {0x1a,12}, {0x19,12}, {0x17,12},
-  {0x16,12}, {0x1f,13}, {0x1e,13}, {0x1d,13},
-  {0x1c,13}, {0x1b,13}, {0x1f,16}, {0x1e,16},
-  {0x1d,16}, {0x1c,16}, {0x1b,16},
-  {0x01,6}, /* escape */
-  {0x06,4}, /* EOB */
-};
-
-static const int8_t mpeg1_level[111] = {
-  1,  2,  3,  4,  5,  6,  7,  8,
-  9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40,
-  1,  2,  3,  4,  5,  6,  7,  8,
-  9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18,  1,  2,  3,  4,  5,  1,
-  2,  3,  4,  1,  2,  3,  1,  2,
-  3,  1,  2,  3,  1,  2,  1,  2,
-  1,  2,  1,  2,  1,  2,  1,  2,
-  1,  2,  1,  2,  1,  2,  1,  2,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,
-};
-
-static const int8_t mpeg1_run[111] = {
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  2,  2,  2,  2,  2,  3,
-  3,  3,  3,  4,  4,  4,  5,  5,
-  5,  6,  6,  6,  7,  7,  8,  8,
-  9,  9, 10, 10, 11, 11, 12, 12,
- 13, 13, 14, 14, 15, 15, 16, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31,
-};
-
-RLTable ff_rl_mpeg1 = {
-    111,
-    111,
-    mpeg1_vlc,
-    mpeg1_run,
-    mpeg1_level,
-};
-
-RLTable ff_rl_mpeg2 = {
-    111,
-    111,
-    mpeg2_vlc,
-    mpeg1_run,
-    mpeg1_level,
-};
-
-const uint8_t ff_mpeg12_mbAddrIncrTable[36][2] = {
-    {0x1, 1},
-    {0x3, 3},
-    {0x2, 3},
-    {0x3, 4},
-    {0x2, 4},
-    {0x3, 5},
-    {0x2, 5},
-    {0x7, 7},
-    {0x6, 7},
-    {0xb, 8},
-    {0xa, 8},
-    {0x9, 8},
-    {0x8, 8},
-    {0x7, 8},
-    {0x6, 8},
-    {0x17, 10},
-    {0x16, 10},
-    {0x15, 10},
-    {0x14, 10},
-    {0x13, 10},
-    {0x12, 10},
-    {0x23, 11},
-    {0x22, 11},
-    {0x21, 11},
-    {0x20, 11},
-    {0x1f, 11},
-    {0x1e, 11},
-    {0x1d, 11},
-    {0x1c, 11},
-    {0x1b, 11},
-    {0x1a, 11},
-    {0x19, 11},
-    {0x18, 11},
-    {0x8, 11}, /* escape */
-    {0xf, 11}, /* stuffing */
-    {0x0, 8}, /* end (and 15 more 0 bits should follow) */
-};
-
-const uint8_t ff_mpeg12_mbPatTable[64][2] = {
-    {0x1, 9},
-    {0xb, 5},
-    {0x9, 5},
-    {0xd, 6},
-    {0xd, 4},
-    {0x17, 7},
-    {0x13, 7},
-    {0x1f, 8},
-    {0xc, 4},
-    {0x16, 7},
-    {0x12, 7},
-    {0x1e, 8},
-    {0x13, 5},
-    {0x1b, 8},
-    {0x17, 8},
-    {0x13, 8},
-    {0xb, 4},
-    {0x15, 7},
-    {0x11, 7},
-    {0x1d, 8},
-    {0x11, 5},
-    {0x19, 8},
-    {0x15, 8},
-    {0x11, 8},
-    {0xf, 6},
-    {0xf, 8},
-    {0xd, 8},
-    {0x3, 9},
-    {0xf, 5},
-    {0xb, 8},
-    {0x7, 8},
-    {0x7, 9},
-    {0xa, 4},
-    {0x14, 7},
-    {0x10, 7},
-    {0x1c, 8},
-    {0xe, 6},
-    {0xe, 8},
-    {0xc, 8},
-    {0x2, 9},
-    {0x10, 5},
-    {0x18, 8},
-    {0x14, 8},
-    {0x10, 8},
-    {0xe, 5},
-    {0xa, 8},
-    {0x6, 8},
-    {0x6, 9},
-    {0x12, 5},
-    {0x1a, 8},
-    {0x16, 8},
-    {0x12, 8},
-    {0xd, 5},
-    {0x9, 8},
-    {0x5, 8},
-    {0x5, 9},
-    {0xc, 5},
-    {0x8, 8},
-    {0x4, 8},
-    {0x4, 9},
-    {0x7, 3},
-    {0xa, 5},
-    {0x8, 5},
-    {0xc, 6}
-};
-
-const uint8_t ff_mpeg12_mbMotionVectorTable[17][2] = {
-{ 0x1, 1 },
-{ 0x1, 2 },
-{ 0x1, 3 },
-{ 0x1, 4 },
-{ 0x3, 6 },
-{ 0x5, 7 },
-{ 0x4, 7 },
-{ 0x3, 7 },
-{ 0xb, 9 },
-{ 0xa, 9 },
-{ 0x9, 9 },
-{ 0x11, 10 },
-{ 0x10, 10 },
-{ 0xf, 10 },
-{ 0xe, 10 },
-{ 0xd, 10 },
-{ 0xc, 10 },
-};
-
-const AVRational ff_mpeg12_frame_rate_tab[16] = {
-    {    0,    0},
-    {24000, 1001},
-    {   24,    1},
-    {   25,    1},
-    {30000, 1001},
-    {   30,    1},
-    {   50,    1},
-    {60000, 1001},
-    {   60,    1},
-  // Xing's 15fps: (9)
-    {   15,    1},
-  // libmpeg3's "Unofficial economy rates": (10-13)
-    {    5,    1},
-    {   10,    1},
-    {   12,    1},
-    {   15,    1},
-    {    0,    0},
-};
-
-const float ff_mpeg1_aspect[16]={
-    0.0000,
-    1.0000,
-    0.6735,
-    0.7031,
-
-    0.7615,
-    0.8055,
-    0.8437,
-    0.8935,
-
-    0.9157,
-    0.9815,
-    1.0255,
-    1.0695,
-
-    1.0950,
-    1.1575,
-    1.2015,
-};
-
-const AVRational ff_mpeg2_aspect[16]={
-    {0,1},
-    {1,1},
-    {4,3},
-    {16,9},
-    {221,100},
-    {0,1},
-    {0,1},
-    {0,1},
-    {0,1},
-    {0,1},
-    {0,1},
-    {0,1},
-    {0,1},
-    {0,1},
-    {0,1},
-    {0,1},
-};
diff --git a/deps/libav/libavcodec/mpeg12data.h b/deps/libav/libavcodec/mpeg12data.h
deleted file mode 100644
index 633a291..0000000
--- a/deps/libav/libavcodec/mpeg12data.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * MPEG1/2 tables
- * copyright (c) 2000,2001 Fabrice Bellard
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG1/2 tables.
- */
-
-#ifndef AVCODEC_MPEG12DATA_H
-#define AVCODEC_MPEG12DATA_H
-
-#include <stdint.h>
-#include "libavutil/rational.h"
-#include "rl.h"
-
-extern const uint16_t ff_mpeg1_default_intra_matrix[64];
-extern const uint16_t ff_mpeg1_default_non_intra_matrix[64];
-
-extern const uint16_t ff_mpeg12_vlc_dc_lum_code[12];
-extern const unsigned char ff_mpeg12_vlc_dc_lum_bits[12];
-extern const uint16_t ff_mpeg12_vlc_dc_chroma_code[12];
-extern const unsigned char ff_mpeg12_vlc_dc_chroma_bits[12];
-
-extern RLTable ff_rl_mpeg1;
-extern RLTable ff_rl_mpeg2;
-
-extern const uint8_t ff_mpeg12_mbAddrIncrTable[36][2];
-extern const uint8_t ff_mpeg12_mbPatTable[64][2];
-
-extern const uint8_t ff_mpeg12_mbMotionVectorTable[17][2];
-
-extern const AVRational ff_mpeg12_frame_rate_tab[];
-
-extern const float ff_mpeg1_aspect[16];
-extern const AVRational ff_mpeg2_aspect[16];
-
-#endif /* AVCODEC_MPEG12DATA_H */
diff --git a/deps/libav/libavcodec/mpeg12dec.c b/deps/libav/libavcodec/mpeg12dec.c
deleted file mode 100644
index cb713fd..0000000
--- a/deps/libav/libavcodec/mpeg12dec.c
+++ /dev/null
@@ -1,2714 +0,0 @@
-/*
- * MPEG-1/2 decoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG-1/2 decoder
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/internal.h"
-#include "libavutil/stereo3d.h"
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "error_resilience.h"
-#include "internal.h"
-#include "mpeg12.h"
-#include "mpeg12data.h"
-#include "mpegvideo.h"
-#include "thread.h"
-#include "version.h"
-#include "xvmc_internal.h"
-
-typedef struct Mpeg1Context {
-    MpegEncContext mpeg_enc_ctx;
-    int mpeg_enc_ctx_allocated; /* true if decoding context allocated */
-    int repeat_field;           /* true if we must repeat the field */
-    AVPanScan pan_scan;         /* some temporary storage for the panscan */
-    AVStereo3D stereo3d;
-    int has_stereo3d;
-    uint8_t *a53_caption;
-    int a53_caption_size;
-    int slice_count;
-    int save_aspect_info;
-    int save_width, save_height, save_progressive_seq;
-    AVRational frame_rate_ext;  /* MPEG-2 specific framerate modificator */
-    int sync;                   /* Did we reach a sync point like a GOP/SEQ/KEYFrame? */
-    int closed_gop;             /* GOP is closed */
-    int first_slice;
-    int extradata_decoded;
-} Mpeg1Context;
-
-#define MB_TYPE_ZERO_MV   0x20000000
-
-static const uint32_t ptype2mb_type[7] = {
-                    MB_TYPE_INTRA,
-                    MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16,
-                    MB_TYPE_L0,
-                    MB_TYPE_L0 | MB_TYPE_CBP,
-    MB_TYPE_QUANT | MB_TYPE_INTRA,
-    MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16,
-    MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP,
-};
-
-static const uint32_t btype2mb_type[11] = {
-                    MB_TYPE_INTRA,
-                    MB_TYPE_L1,
-                    MB_TYPE_L1   | MB_TYPE_CBP,
-                    MB_TYPE_L0,
-                    MB_TYPE_L0   | MB_TYPE_CBP,
-                    MB_TYPE_L0L1,
-                    MB_TYPE_L0L1 | MB_TYPE_CBP,
-    MB_TYPE_QUANT | MB_TYPE_INTRA,
-    MB_TYPE_QUANT | MB_TYPE_L1   | MB_TYPE_CBP,
-    MB_TYPE_QUANT | MB_TYPE_L0   | MB_TYPE_CBP,
-    MB_TYPE_QUANT | MB_TYPE_L0L1 | MB_TYPE_CBP,
-};
-
-static const uint8_t non_linear_qscale[32] = {
-     0,  1,  2,  3,  4,  5,   6,   7,
-     8, 10, 12, 14, 16, 18,  20,  22,
-    24, 28, 32, 36, 40, 44,  48,  52,
-    56, 64, 72, 80, 88, 96, 104, 112,
-};
-
-/* as H.263, but only 17 codes */
-static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred)
-{
-    int code, sign, val, shift;
-
-    code = get_vlc2(&s->gb, ff_mv_vlc.table, MV_VLC_BITS, 2);
-    if (code == 0)
-        return pred;
-    if (code < 0)
-        return 0xffff;
-
-    sign  = get_bits1(&s->gb);
-    shift = fcode - 1;
-    val   = code;
-    if (shift) {
-        val  = (val - 1) << shift;
-        val |= get_bits(&s->gb, shift);
-        val++;
-    }
-    if (sign)
-        val = -val;
-    val += pred;
-
-    /* modulo decoding */
-    return sign_extend(val, 5 + shift);
-}
-
-#define check_scantable_index(ctx, x)                                         \
-    do {                                                                      \
-        if ((x) > 63) {                                                       \
-            av_log(ctx->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n",     \
-                   ctx->mb_x, ctx->mb_y);                                     \
-            return AVERROR_INVALIDDATA;                                       \
-        }                                                                     \
-    } while (0)
-
-static inline int mpeg1_decode_block_intra(MpegEncContext *s,
-                                           int16_t *block, int n)
-{
-    int level, dc, diff, i, j, run;
-    int component;
-    RLTable *rl                  = &ff_rl_mpeg1;
-    uint8_t *const scantable     = s->intra_scantable.permutated;
-    const uint16_t *quant_matrix = s->intra_matrix;
-    const int qscale             = s->qscale;
-
-    /* DC coefficient */
-    component = (n <= 3 ? 0 : n - 4 + 1);
-    diff = decode_dc(&s->gb, component);
-    if (diff >= 0xffff)
-        return -1;
-    dc  = s->last_dc[component];
-    dc += diff;
-    s->last_dc[component] = dc;
-    block[0] = dc * quant_matrix[0];
-    av_dlog(s->avctx, "dc=%d diff=%d\n", dc, diff);
-    i = 0;
-    {
-        OPEN_READER(re, &s->gb);
-        /* now quantify & encode AC coefficients */
-        for (;;) {
-            UPDATE_CACHE(re, &s->gb);
-            GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
-                       TEX_VLC_BITS, 2, 0);
-
-            if (level == 127) {
-                break;
-            } else if (level != 0) {
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                level = (level * qscale * quant_matrix[j]) >> 4;
-                level = (level - 1) | 1;
-                level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
-                        SHOW_SBITS(re, &s->gb, 1);
-                LAST_SKIP_BITS(re, &s->gb, 1);
-            } else {
-                /* escape */
-                run = SHOW_UBITS(re, &s->gb, 6) + 1;
-                LAST_SKIP_BITS(re, &s->gb, 6);
-                UPDATE_CACHE(re, &s->gb);
-                level = SHOW_SBITS(re, &s->gb, 8);
-                SKIP_BITS(re, &s->gb, 8);
-                if (level == -128) {
-                    level = SHOW_UBITS(re, &s->gb, 8) - 256;
-                    LAST_SKIP_BITS(re, &s->gb, 8);
-                } else if (level == 0) {
-                    level = SHOW_UBITS(re, &s->gb, 8);
-                    LAST_SKIP_BITS(re, &s->gb, 8);
-                }
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                if (level < 0) {
-                    level = -level;
-                    level = (level * qscale * quant_matrix[j]) >> 4;
-                    level = (level - 1) | 1;
-                    level = -level;
-                } else {
-                    level = (level * qscale * quant_matrix[j]) >> 4;
-                    level = (level - 1) | 1;
-                }
-            }
-
-            block[j] = level;
-        }
-        CLOSE_READER(re, &s->gb);
-    }
-    s->block_last_index[n] = i;
-    return 0;
-}
-
-int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
-{
-    return mpeg1_decode_block_intra(s, block, n);
-}
-
-static inline int mpeg1_decode_block_inter(MpegEncContext *s,
-                                           int16_t *block, int n)
-{
-    int level, i, j, run;
-    RLTable *rl                  = &ff_rl_mpeg1;
-    uint8_t *const scantable     = s->intra_scantable.permutated;
-    const uint16_t *quant_matrix = s->inter_matrix;
-    const int qscale             = s->qscale;
-
-    {
-        OPEN_READER(re, &s->gb);
-        i = -1;
-        // special case for first coefficient, no need to add second VLC table
-        UPDATE_CACHE(re, &s->gb);
-        if (((int32_t) GET_CACHE(re, &s->gb)) < 0) {
-            level = (3 * qscale * quant_matrix[0]) >> 5;
-            level = (level - 1) | 1;
-            if (GET_CACHE(re, &s->gb) & 0x40000000)
-                level = -level;
-            block[0] = level;
-            i++;
-            SKIP_BITS(re, &s->gb, 2);
-            if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
-                goto end;
-        }
-        /* now quantify & encode AC coefficients */
-        for (;;) {
-            GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
-                       TEX_VLC_BITS, 2, 0);
-
-            if (level != 0) {
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                level = ((level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
-                level = (level - 1) | 1;
-                level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
-                        SHOW_SBITS(re, &s->gb, 1);
-                SKIP_BITS(re, &s->gb, 1);
-            } else {
-                /* escape */
-                run = SHOW_UBITS(re, &s->gb, 6) + 1;
-                LAST_SKIP_BITS(re, &s->gb, 6);
-                UPDATE_CACHE(re, &s->gb);
-                level = SHOW_SBITS(re, &s->gb, 8);
-                SKIP_BITS(re, &s->gb, 8);
-                if (level == -128) {
-                    level = SHOW_UBITS(re, &s->gb, 8) - 256;
-                    SKIP_BITS(re, &s->gb, 8);
-                } else if (level == 0) {
-                    level = SHOW_UBITS(re, &s->gb, 8);
-                    SKIP_BITS(re, &s->gb, 8);
-                }
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                if (level < 0) {
-                    level = -level;
-                    level = ((level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
-                    level = (level - 1) | 1;
-                    level = -level;
-                } else {
-                    level = ((level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
-                    level = (level - 1) | 1;
-                }
-            }
-
-            block[j] = level;
-            if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
-                break;
-            UPDATE_CACHE(re, &s->gb);
-        }
-end:
-        LAST_SKIP_BITS(re, &s->gb, 2);
-        CLOSE_READER(re, &s->gb);
-    }
-    s->block_last_index[n] = i;
-    return 0;
-}
-
-static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s,
-                                                int16_t *block, int n)
-{
-    int level, i, j, run;
-    RLTable *rl              = &ff_rl_mpeg1;
-    uint8_t *const scantable = s->intra_scantable.permutated;
-    const int qscale         = s->qscale;
-
-    {
-        OPEN_READER(re, &s->gb);
-        i = -1;
-        // Special case for first coefficient, no need to add second VLC table.
-        UPDATE_CACHE(re, &s->gb);
-        if (((int32_t) GET_CACHE(re, &s->gb)) < 0) {
-            level = (3 * qscale) >> 1;
-            level = (level - 1) | 1;
-            if (GET_CACHE(re, &s->gb) & 0x40000000)
-                level = -level;
-            block[0] = level;
-            i++;
-            SKIP_BITS(re, &s->gb, 2);
-            if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
-                goto end;
-        }
-
-        /* now quantify & encode AC coefficients */
-        for (;;) {
-            GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
-                       TEX_VLC_BITS, 2, 0);
-
-            if (level != 0) {
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                level = ((level * 2 + 1) * qscale) >> 1;
-                level = (level - 1) | 1;
-                level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
-                        SHOW_SBITS(re, &s->gb, 1);
-                SKIP_BITS(re, &s->gb, 1);
-            } else {
-                /* escape */
-                run = SHOW_UBITS(re, &s->gb, 6) + 1;
-                LAST_SKIP_BITS(re, &s->gb, 6);
-                UPDATE_CACHE(re, &s->gb);
-                level = SHOW_SBITS(re, &s->gb, 8);
-                SKIP_BITS(re, &s->gb, 8);
-                if (level == -128) {
-                    level = SHOW_UBITS(re, &s->gb, 8) - 256;
-                    SKIP_BITS(re, &s->gb, 8);
-                } else if (level == 0) {
-                    level = SHOW_UBITS(re, &s->gb, 8);
-                    SKIP_BITS(re, &s->gb, 8);
-                }
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                if (level < 0) {
-                    level = -level;
-                    level = ((level * 2 + 1) * qscale) >> 1;
-                    level = (level - 1) | 1;
-                    level = -level;
-                } else {
-                    level = ((level * 2 + 1) * qscale) >> 1;
-                    level = (level - 1) | 1;
-                }
-            }
-
-            block[j] = level;
-            if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
-                break;
-            UPDATE_CACHE(re, &s->gb);
-        }
-end:
-        LAST_SKIP_BITS(re, &s->gb, 2);
-        CLOSE_READER(re, &s->gb);
-    }
-    s->block_last_index[n] = i;
-    return 0;
-}
-
-static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
-                                               int16_t *block, int n)
-{
-    int level, i, j, run;
-    RLTable *rl = &ff_rl_mpeg1;
-    uint8_t *const scantable = s->intra_scantable.permutated;
-    const uint16_t *quant_matrix;
-    const int qscale = s->qscale;
-    int mismatch;
-
-    mismatch = 1;
-
-    {
-        OPEN_READER(re, &s->gb);
-        i = -1;
-        if (n < 4)
-            quant_matrix = s->inter_matrix;
-        else
-            quant_matrix = s->chroma_inter_matrix;
-
-        // Special case for first coefficient, no need to add second VLC table.
-        UPDATE_CACHE(re, &s->gb);
-        if (((int32_t) GET_CACHE(re, &s->gb)) < 0) {
-            level = (3 * qscale * quant_matrix[0]) >> 5;
-            if (GET_CACHE(re, &s->gb) & 0x40000000)
-                level = -level;
-            block[0]  = level;
-            mismatch ^= level;
-            i++;
-            SKIP_BITS(re, &s->gb, 2);
-            if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
-                goto end;
-        }
-
-        /* now quantify & encode AC coefficients */
-        for (;;) {
-            GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
-                       TEX_VLC_BITS, 2, 0);
-
-            if (level != 0) {
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                level = ((level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
-                level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
-                        SHOW_SBITS(re, &s->gb, 1);
-                SKIP_BITS(re, &s->gb, 1);
-            } else {
-                /* escape */
-                run = SHOW_UBITS(re, &s->gb, 6) + 1;
-                LAST_SKIP_BITS(re, &s->gb, 6);
-                UPDATE_CACHE(re, &s->gb);
-                level = SHOW_SBITS(re, &s->gb, 12);
-                SKIP_BITS(re, &s->gb, 12);
-
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                if (level < 0) {
-                    level = ((-level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
-                    level = -level;
-                } else {
-                    level = ((level * 2 + 1) * qscale * quant_matrix[j]) >> 5;
-                }
-            }
-
-            mismatch ^= level;
-            block[j]  = level;
-            if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
-                break;
-            UPDATE_CACHE(re, &s->gb);
-        }
-end:
-        LAST_SKIP_BITS(re, &s->gb, 2);
-        CLOSE_READER(re, &s->gb);
-    }
-    block[63] ^= (mismatch & 1);
-
-    s->block_last_index[n] = i;
-    return 0;
-}
-
-static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
-                                                    int16_t *block, int n)
-{
-    int level, i, j, run;
-    RLTable *rl              = &ff_rl_mpeg1;
-    uint8_t *const scantable = s->intra_scantable.permutated;
-    const int qscale         = s->qscale;
-    OPEN_READER(re, &s->gb);
-    i = -1;
-
-    // special case for first coefficient, no need to add second VLC table
-    UPDATE_CACHE(re, &s->gb);
-    if (((int32_t) GET_CACHE(re, &s->gb)) < 0) {
-        level = (3 * qscale) >> 1;
-        if (GET_CACHE(re, &s->gb) & 0x40000000)
-            level = -level;
-        block[0] = level;
-        i++;
-        SKIP_BITS(re, &s->gb, 2);
-        if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
-            goto end;
-    }
-
-    /* now quantify & encode AC coefficients */
-    for (;;) {
-        GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
-        if (level != 0) {
-            i += run;
-            check_scantable_index(s, i);
-            j = scantable[i];
-            level = ((level * 2 + 1) * qscale) >> 1;
-            level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
-                    SHOW_SBITS(re, &s->gb, 1);
-            SKIP_BITS(re, &s->gb, 1);
-        } else {
-            /* escape */
-            run = SHOW_UBITS(re, &s->gb, 6) + 1;
-            LAST_SKIP_BITS(re, &s->gb, 6);
-            UPDATE_CACHE(re, &s->gb);
-            level = SHOW_SBITS(re, &s->gb, 12);
-            SKIP_BITS(re, &s->gb, 12);
-
-            i += run;
-            check_scantable_index(s, i);
-            j = scantable[i];
-            if (level < 0) {
-                level = ((-level * 2 + 1) * qscale) >> 1;
-                level = -level;
-            } else {
-                level = ((level * 2 + 1) * qscale) >> 1;
-            }
-        }
-
-        block[j] = level;
-        if (((int32_t) GET_CACHE(re, &s->gb)) <= (int32_t) 0xBFFFFFFF)
-            break;
-        UPDATE_CACHE(re, &s->gb);
-    }
-end:
-    LAST_SKIP_BITS(re, &s->gb, 2);
-    CLOSE_READER(re, &s->gb);
-    s->block_last_index[n] = i;
-    return 0;
-}
-
-static inline int mpeg2_decode_block_intra(MpegEncContext *s,
-                                           int16_t *block, int n)
-{
-    int level, dc, diff, i, j, run;
-    int component;
-    RLTable *rl;
-    uint8_t *const scantable = s->intra_scantable.permutated;
-    const uint16_t *quant_matrix;
-    const int qscale = s->qscale;
-    int mismatch;
-
-    /* DC coefficient */
-    if (n < 4) {
-        quant_matrix = s->intra_matrix;
-        component    = 0;
-    } else {
-        quant_matrix = s->chroma_intra_matrix;
-        component    = (n & 1) + 1;
-    }
-    diff = decode_dc(&s->gb, component);
-    if (diff >= 0xffff)
-        return -1;
-    dc  = s->last_dc[component];
-    dc += diff;
-    s->last_dc[component] = dc;
-    block[0] = dc << (3 - s->intra_dc_precision);
-    av_dlog(s->avctx, "dc=%d\n", block[0]);
-    mismatch = block[0] ^ 1;
-    i = 0;
-    if (s->intra_vlc_format)
-        rl = &ff_rl_mpeg2;
-    else
-        rl = &ff_rl_mpeg1;
-
-    {
-        OPEN_READER(re, &s->gb);
-        /* now quantify & encode AC coefficients */
-        for (;;) {
-            UPDATE_CACHE(re, &s->gb);
-            GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
-                       TEX_VLC_BITS, 2, 0);
-
-            if (level == 127) {
-                break;
-            } else if (level != 0) {
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                level = (level * qscale * quant_matrix[j]) >> 4;
-                level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
-                        SHOW_SBITS(re, &s->gb, 1);
-                LAST_SKIP_BITS(re, &s->gb, 1);
-            } else {
-                /* escape */
-                run = SHOW_UBITS(re, &s->gb, 6) + 1;
-                LAST_SKIP_BITS(re, &s->gb, 6);
-                UPDATE_CACHE(re, &s->gb);
-                level = SHOW_SBITS(re, &s->gb, 12);
-                SKIP_BITS(re, &s->gb, 12);
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                if (level < 0) {
-                    level = (-level * qscale * quant_matrix[j]) >> 4;
-                    level = -level;
-                } else {
-                    level = (level * qscale * quant_matrix[j]) >> 4;
-                }
-            }
-
-            mismatch ^= level;
-            block[j]  = level;
-        }
-        CLOSE_READER(re, &s->gb);
-    }
-    block[63] ^= mismatch & 1;
-
-    s->block_last_index[n] = i;
-    return 0;
-}
-
-static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s,
-                                                int16_t *block, int n)
-{
-    int level, dc, diff, i, j, run;
-    int component;
-    RLTable *rl;
-    uint8_t *const scantable = s->intra_scantable.permutated;
-    const uint16_t *quant_matrix;
-    const int qscale = s->qscale;
-
-    /* DC coefficient */
-    if (n < 4) {
-        quant_matrix = s->intra_matrix;
-        component    = 0;
-    } else {
-        quant_matrix = s->chroma_intra_matrix;
-        component    = (n & 1) + 1;
-    }
-    diff = decode_dc(&s->gb, component);
-    if (diff >= 0xffff)
-        return -1;
-    dc = s->last_dc[component];
-    dc += diff;
-    s->last_dc[component] = dc;
-    block[0] = dc << (3 - s->intra_dc_precision);
-    i = 0;
-    if (s->intra_vlc_format)
-        rl = &ff_rl_mpeg2;
-    else
-        rl = &ff_rl_mpeg1;
-
-    {
-        OPEN_READER(re, &s->gb);
-        /* now quantify & encode AC coefficients */
-        for (;;) {
-            UPDATE_CACHE(re, &s->gb);
-            GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0],
-                       TEX_VLC_BITS, 2, 0);
-
-            if (level == 127) {
-                break;
-            } else if (level != 0) {
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                level = (level * qscale * quant_matrix[j]) >> 4;
-                level = (level ^ SHOW_SBITS(re, &s->gb, 1)) -
-                        SHOW_SBITS(re, &s->gb, 1);
-                LAST_SKIP_BITS(re, &s->gb, 1);
-            } else {
-                /* escape */
-                run = SHOW_UBITS(re, &s->gb, 6) + 1;
-                LAST_SKIP_BITS(re, &s->gb, 6);
-                UPDATE_CACHE(re, &s->gb);
-                level = SHOW_SBITS(re, &s->gb, 12);
-                SKIP_BITS(re, &s->gb, 12);
-                i += run;
-                check_scantable_index(s, i);
-                j = scantable[i];
-                if (level < 0) {
-                    level = (-level * qscale * quant_matrix[j]) >> 4;
-                    level = -level;
-                } else {
-                    level = (level * qscale * quant_matrix[j]) >> 4;
-                }
-            }
-
-            block[j] = level;
-        }
-        CLOSE_READER(re, &s->gb);
-    }
-
-    s->block_last_index[n] = i;
-    return 0;
-}
-
-/******************************************/
-/* decoding */
-
-static inline int get_dmv(MpegEncContext *s)
-{
-    if (get_bits1(&s->gb))
-        return 1 - (get_bits1(&s->gb) << 1);
-    else
-        return 0;
-}
-
-static inline int get_qscale(MpegEncContext *s)
-{
-    int qscale = get_bits(&s->gb, 5);
-    if (s->q_scale_type)
-        return non_linear_qscale[qscale];
-    else
-        return qscale << 1;
-}
-
-/* motion type (for MPEG-2) */
-#define MT_FIELD 1
-#define MT_FRAME 2
-#define MT_16X8  2
-#define MT_DMV   3
-
-static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
-{
-    int i, j, k, cbp, val, mb_type, motion_type;
-    const int mb_block_count = 4 + (1 << s->chroma_format);
-
-    av_dlog(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
-
-    assert(s->mb_skipped == 0);
-
-    if (s->mb_skip_run-- != 0) {
-        if (s->pict_type == AV_PICTURE_TYPE_P) {
-            s->mb_skipped = 1;
-            s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] =
-                MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16;
-        } else {
-            int mb_type;
-
-            if (s->mb_x)
-                mb_type = s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride - 1];
-            else
-                // FIXME not sure if this is allowed in MPEG at all
-                mb_type = s->current_picture.mb_type[s->mb_width + (s->mb_y - 1) * s->mb_stride - 1];
-            if (IS_INTRA(mb_type))
-                return -1;
-            s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] =
-                mb_type | MB_TYPE_SKIP;
-//            assert(s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride - 1] & (MB_TYPE_16x16 | MB_TYPE_16x8));
-
-            if ((s->mv[0][0][0] | s->mv[0][0][1] | s->mv[1][0][0] | s->mv[1][0][1]) == 0)
-                s->mb_skipped = 1;
-        }
-
-        return 0;
-    }
-
-    switch (s->pict_type) {
-    default:
-    case AV_PICTURE_TYPE_I:
-        if (get_bits1(&s->gb) == 0) {
-            if (get_bits1(&s->gb) == 0) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "invalid mb type in I Frame at %d %d\n",
-                       s->mb_x, s->mb_y);
-                return -1;
-            }
-            mb_type = MB_TYPE_QUANT | MB_TYPE_INTRA;
-        } else {
-            mb_type = MB_TYPE_INTRA;
-        }
-        break;
-    case AV_PICTURE_TYPE_P:
-        mb_type = get_vlc2(&s->gb, ff_mb_ptype_vlc.table, MB_PTYPE_VLC_BITS, 1);
-        if (mb_type < 0) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "invalid mb type in P Frame at %d %d\n", s->mb_x, s->mb_y);
-            return -1;
-        }
-        mb_type = ptype2mb_type[mb_type];
-        break;
-    case AV_PICTURE_TYPE_B:
-        mb_type = get_vlc2(&s->gb, ff_mb_btype_vlc.table, MB_BTYPE_VLC_BITS, 1);
-        if (mb_type < 0) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "invalid mb type in B Frame at %d %d\n", s->mb_x, s->mb_y);
-            return -1;
-        }
-        mb_type = btype2mb_type[mb_type];
-        break;
-    }
-    av_dlog(s->avctx, "mb_type=%x\n", mb_type);
-//    motion_type = 0; /* avoid warning */
-    if (IS_INTRA(mb_type)) {
-        s->dsp.clear_blocks(s->block[0]);
-
-        if (!s->chroma_y_shift)
-            s->dsp.clear_blocks(s->block[6]);
-
-        /* compute DCT type */
-        // FIXME: add an interlaced_dct coded var?
-        if (s->picture_structure == PICT_FRAME &&
-            !s->frame_pred_frame_dct)
-            s->interlaced_dct = get_bits1(&s->gb);
-
-        if (IS_QUANT(mb_type))
-            s->qscale = get_qscale(s);
-
-        if (s->concealment_motion_vectors) {
-            /* just parse them */
-            if (s->picture_structure != PICT_FRAME)
-                skip_bits1(&s->gb);  /* field select */
-
-            s->mv[0][0][0]      =
-            s->last_mv[0][0][0] =
-            s->last_mv[0][1][0] = mpeg_decode_motion(s, s->mpeg_f_code[0][0],
-                                                     s->last_mv[0][0][0]);
-            s->mv[0][0][1]      =
-            s->last_mv[0][0][1] =
-            s->last_mv[0][1][1] = mpeg_decode_motion(s, s->mpeg_f_code[0][1],
-                                                     s->last_mv[0][0][1]);
-
-            skip_bits1(&s->gb); /* marker */
-        } else {
-            /* reset mv prediction */
-            memset(s->last_mv, 0, sizeof(s->last_mv));
-        }
-        s->mb_intra = 1;
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-        // if 1, we memcpy blocks in xvmcvideo
-        if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1)
-            ff_xvmc_pack_pblocks(s, -1); // inter are always full blocks
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-        if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-            if (s->flags2 & CODEC_FLAG2_FAST) {
-                for (i = 0; i < 6; i++)
-                    mpeg2_fast_decode_block_intra(s, *s->pblocks[i], i);
-            } else {
-                for (i = 0; i < mb_block_count; i++)
-                    if (mpeg2_decode_block_intra(s, *s->pblocks[i], i) < 0)
-                        return -1;
-            }
-        } else {
-            for (i = 0; i < 6; i++)
-                if (mpeg1_decode_block_intra(s, *s->pblocks[i], i) < 0)
-                    return -1;
-        }
-    } else {
-        if (mb_type & MB_TYPE_ZERO_MV) {
-            assert(mb_type & MB_TYPE_CBP);
-
-            s->mv_dir = MV_DIR_FORWARD;
-            if (s->picture_structure == PICT_FRAME) {
-                if (!s->frame_pred_frame_dct)
-                    s->interlaced_dct = get_bits1(&s->gb);
-                s->mv_type = MV_TYPE_16X16;
-            } else {
-                s->mv_type            = MV_TYPE_FIELD;
-                mb_type              |= MB_TYPE_INTERLACED;
-                s->field_select[0][0] = s->picture_structure - 1;
-            }
-
-            if (IS_QUANT(mb_type))
-                s->qscale = get_qscale(s);
-
-            s->last_mv[0][0][0] = 0;
-            s->last_mv[0][0][1] = 0;
-            s->last_mv[0][1][0] = 0;
-            s->last_mv[0][1][1] = 0;
-            s->mv[0][0][0]      = 0;
-            s->mv[0][0][1]      = 0;
-        } else {
-            assert(mb_type & MB_TYPE_L0L1);
-            // FIXME decide if MBs in field pictures are MB_TYPE_INTERLACED
-            /* get additional motion vector type */
-            if (s->frame_pred_frame_dct) {
-                motion_type = MT_FRAME;
-            } else {
-                motion_type = get_bits(&s->gb, 2);
-                if (s->picture_structure == PICT_FRAME && HAS_CBP(mb_type))
-                    s->interlaced_dct = get_bits1(&s->gb);
-            }
-
-            if (IS_QUANT(mb_type))
-                s->qscale = get_qscale(s);
-
-            /* motion vectors */
-            s->mv_dir = (mb_type >> 13) & 3;
-            av_dlog(s->avctx, "motion_type=%d\n", motion_type);
-            switch (motion_type) {
-            case MT_FRAME: /* or MT_16X8 */
-                if (s->picture_structure == PICT_FRAME) {
-                    mb_type   |= MB_TYPE_16x16;
-                    s->mv_type = MV_TYPE_16X16;
-                    for (i = 0; i < 2; i++) {
-                        if (USES_LIST(mb_type, i)) {
-                            /* MT_FRAME */
-                            s->mv[i][0][0]      =
-                            s->last_mv[i][0][0] =
-                            s->last_mv[i][1][0] =
-                                mpeg_decode_motion(s, s->mpeg_f_code[i][0],
-                                                   s->last_mv[i][0][0]);
-                            s->mv[i][0][1]      =
-                            s->last_mv[i][0][1] =
-                            s->last_mv[i][1][1] =
-                                mpeg_decode_motion(s, s->mpeg_f_code[i][1],
-                                                   s->last_mv[i][0][1]);
-                            /* full_pel: only for MPEG-1 */
-                            if (s->full_pel[i]) {
-                                s->mv[i][0][0] <<= 1;
-                                s->mv[i][0][1] <<= 1;
-                            }
-                        }
-                    }
-                } else {
-                    mb_type   |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
-                    s->mv_type = MV_TYPE_16X8;
-                    for (i = 0; i < 2; i++) {
-                        if (USES_LIST(mb_type, i)) {
-                            /* MT_16X8 */
-                            for (j = 0; j < 2; j++) {
-                                s->field_select[i][j] = get_bits1(&s->gb);
-                                for (k = 0; k < 2; k++) {
-                                    val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
-                                                             s->last_mv[i][j][k]);
-                                    s->last_mv[i][j][k] = val;
-                                    s->mv[i][j][k]      = val;
-                                }
-                            }
-                        }
-                    }
-                }
-                break;
-            case MT_FIELD:
-                s->mv_type = MV_TYPE_FIELD;
-                if (s->picture_structure == PICT_FRAME) {
-                    mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
-                    for (i = 0; i < 2; i++) {
-                        if (USES_LIST(mb_type, i)) {
-                            for (j = 0; j < 2; j++) {
-                                s->field_select[i][j] = get_bits1(&s->gb);
-                                val = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
-                                                         s->last_mv[i][j][0]);
-                                s->last_mv[i][j][0] = val;
-                                s->mv[i][j][0]      = val;
-                                av_dlog(s->avctx, "fmx=%d\n", val);
-                                val = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
-                                                         s->last_mv[i][j][1] >> 1);
-                                s->last_mv[i][j][1] = val << 1;
-                                s->mv[i][j][1]      = val;
-                                av_dlog(s->avctx, "fmy=%d\n", val);
-                            }
-                        }
-                    }
-                } else {
-                    mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
-                    for (i = 0; i < 2; i++) {
-                        if (USES_LIST(mb_type, i)) {
-                            s->field_select[i][0] = get_bits1(&s->gb);
-                            for (k = 0; k < 2; k++) {
-                                val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
-                                                         s->last_mv[i][0][k]);
-                                s->last_mv[i][0][k] = val;
-                                s->last_mv[i][1][k] = val;
-                                s->mv[i][0][k]      = val;
-                            }
-                        }
-                    }
-                }
-                break;
-            case MT_DMV:
-                s->mv_type = MV_TYPE_DMV;
-                for (i = 0; i < 2; i++) {
-                    if (USES_LIST(mb_type, i)) {
-                        int dmx, dmy, mx, my, m;
-                        const int my_shift = s->picture_structure == PICT_FRAME;
-
-                        mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
-                                                s->last_mv[i][0][0]);
-                        s->last_mv[i][0][0] = mx;
-                        s->last_mv[i][1][0] = mx;
-                        dmx = get_dmv(s);
-                        my  = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
-                                                 s->last_mv[i][0][1] >> my_shift);
-                        dmy = get_dmv(s);
-
-
-                        s->last_mv[i][0][1] = my << my_shift;
-                        s->last_mv[i][1][1] = my << my_shift;
-
-                        s->mv[i][0][0] = mx;
-                        s->mv[i][0][1] = my;
-                        s->mv[i][1][0] = mx; // not used
-                        s->mv[i][1][1] = my; // not used
-
-                        if (s->picture_structure == PICT_FRAME) {
-                            mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
-
-                            // m = 1 + 2 * s->top_field_first;
-                            m = s->top_field_first ? 1 : 3;
-
-                            /* top -> top pred */
-                            s->mv[i][2][0] = ((mx * m + (mx > 0)) >> 1) + dmx;
-                            s->mv[i][2][1] = ((my * m + (my > 0)) >> 1) + dmy - 1;
-                            m = 4 - m;
-                            s->mv[i][3][0] = ((mx * m + (mx > 0)) >> 1) + dmx;
-                            s->mv[i][3][1] = ((my * m + (my > 0)) >> 1) + dmy + 1;
-                        } else {
-                            mb_type |= MB_TYPE_16x16;
-
-                            s->mv[i][2][0] = ((mx + (mx > 0)) >> 1) + dmx;
-                            s->mv[i][2][1] = ((my + (my > 0)) >> 1) + dmy;
-                            if (s->picture_structure == PICT_TOP_FIELD)
-                                s->mv[i][2][1]--;
-                            else
-                                s->mv[i][2][1]++;
-                        }
-                    }
-                }
-                break;
-            default:
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "00 motion_type at %d %d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-        }
-
-        s->mb_intra = 0;
-        if (HAS_CBP(mb_type)) {
-            s->dsp.clear_blocks(s->block[0]);
-
-            cbp = get_vlc2(&s->gb, ff_mb_pat_vlc.table, MB_PAT_VLC_BITS, 1);
-            if (mb_block_count > 6) {
-                cbp <<= mb_block_count - 6;
-                cbp  |= get_bits(&s->gb, mb_block_count - 6);
-                s->dsp.clear_blocks(s->block[6]);
-            }
-            if (cbp <= 0) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "invalid cbp at %d %d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-            // if 1, we memcpy blocks in xvmcvideo
-            if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1)
-                ff_xvmc_pack_pblocks(s, cbp);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-            if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-                if (s->flags2 & CODEC_FLAG2_FAST) {
-                    for (i = 0; i < 6; i++) {
-                        if (cbp & 32)
-                            mpeg2_fast_decode_block_non_intra(s, *s->pblocks[i], i);
-                        else
-                            s->block_last_index[i] = -1;
-                        cbp += cbp;
-                    }
-                } else {
-                    cbp <<= 12 - mb_block_count;
-
-                    for (i = 0; i < mb_block_count; i++) {
-                        if (cbp & (1 << 11)) {
-                            if (mpeg2_decode_block_non_intra(s, *s->pblocks[i], i) < 0)
-                                return -1;
-                        } else {
-                            s->block_last_index[i] = -1;
-                        }
-                        cbp += cbp;
-                    }
-                }
-            } else {
-                if (s->flags2 & CODEC_FLAG2_FAST) {
-                    for (i = 0; i < 6; i++) {
-                        if (cbp & 32)
-                            mpeg1_fast_decode_block_inter(s, *s->pblocks[i], i);
-                        else
-                            s->block_last_index[i] = -1;
-                        cbp += cbp;
-                    }
-                } else {
-                    for (i = 0; i < 6; i++) {
-                        if (cbp & 32) {
-                            if (mpeg1_decode_block_inter(s, *s->pblocks[i], i) < 0)
-                                return -1;
-                        } else {
-                            s->block_last_index[i] = -1;
-                        }
-                        cbp += cbp;
-                    }
-                }
-            }
-        } else {
-            for (i = 0; i < 12; i++)
-                s->block_last_index[i] = -1;
-        }
-    }
-
-    s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] = mb_type;
-
-    return 0;
-}
-
-static av_cold int mpeg_decode_init(AVCodecContext *avctx)
-{
-    Mpeg1Context *s    = avctx->priv_data;
-    MpegEncContext *s2 = &s->mpeg_enc_ctx;
-    int i;
-
-    /* we need some permutation to store matrices,
-     * until MPV_common_init() sets the real permutation. */
-    for (i = 0; i < 64; i++)
-        s2->dsp.idct_permutation[i] = i;
-
-    ff_MPV_decode_defaults(s2);
-
-    s->mpeg_enc_ctx.avctx  = avctx;
-    s->mpeg_enc_ctx.flags  = avctx->flags;
-    s->mpeg_enc_ctx.flags2 = avctx->flags2;
-    ff_mpeg12_common_init(&s->mpeg_enc_ctx);
-    ff_mpeg12_init_vlcs();
-
-    s->mpeg_enc_ctx_allocated      = 0;
-    s->mpeg_enc_ctx.picture_number = 0;
-    s->repeat_field                = 0;
-    s->mpeg_enc_ctx.codec_id       = avctx->codec->id;
-    avctx->color_range             = AVCOL_RANGE_MPEG;
-    if (avctx->codec->id == AV_CODEC_ID_MPEG1VIDEO)
-        avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
-    else
-        avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
-    return 0;
-}
-
-static int mpeg_decode_update_thread_context(AVCodecContext *avctx,
-                                             const AVCodecContext *avctx_from)
-{
-    Mpeg1Context *ctx = avctx->priv_data, *ctx_from = avctx_from->priv_data;
-    MpegEncContext *s = &ctx->mpeg_enc_ctx, *s1 = &ctx_from->mpeg_enc_ctx;
-    int err;
-
-    if (avctx == avctx_from               ||
-        !ctx_from->mpeg_enc_ctx_allocated ||
-        !s1->context_initialized)
-        return 0;
-
-    err = ff_mpeg_update_thread_context(avctx, avctx_from);
-    if (err)
-        return err;
-
-    if (!ctx->mpeg_enc_ctx_allocated)
-        memcpy(s + 1, s1 + 1, sizeof(Mpeg1Context) - sizeof(MpegEncContext));
-
-    if (!(s->pict_type == AV_PICTURE_TYPE_B || s->low_delay))
-        s->picture_number++;
-
-    return 0;
-}
-
-static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm,
-                                 const uint8_t *new_perm)
-{
-    uint16_t temp_matrix[64];
-    int i;
-
-    memcpy(temp_matrix, matrix, 64 * sizeof(uint16_t));
-
-    for (i = 0; i < 64; i++)
-        matrix[new_perm[i]] = temp_matrix[old_perm[i]];
-}
-
-#if FF_API_XVMC
-static const enum AVPixelFormat pixfmt_xvmc_mpg2_420[] = {
-    AV_PIX_FMT_XVMC_MPEG2_IDCT,
-    AV_PIX_FMT_XVMC_MPEG2_MC,
-    AV_PIX_FMT_NONE
-};
-#endif /* FF_API_XVMC */
-
-static const enum AVPixelFormat mpeg12_hwaccel_pixfmt_list_420[] = {
-#if CONFIG_MPEG2_DXVA2_HWACCEL
-    AV_PIX_FMT_DXVA2_VLD,
-#endif
-#if CONFIG_MPEG2_VAAPI_HWACCEL
-    AV_PIX_FMT_VAAPI_VLD,
-#endif
-#if CONFIG_MPEG1_VDPAU_HWACCEL | CONFIG_MPEG2_VDPAU_HWACCEL
-    AV_PIX_FMT_VDPAU,
-#endif
-    AV_PIX_FMT_YUV420P,
-    AV_PIX_FMT_NONE
-};
-
-static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
-{
-    Mpeg1Context *s1  = avctx->priv_data;
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-    if (avctx->xvmc_acceleration)
-        return avctx->get_format(avctx, pixfmt_xvmc_mpg2_420);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-    if (s->chroma_format < 2)
-        return avctx->get_format(avctx, mpeg12_hwaccel_pixfmt_list_420);
-    else if (s->chroma_format == 2)
-        return AV_PIX_FMT_YUV422P;
-    else
-        return AV_PIX_FMT_YUV444P;
-}
-
-/* Call this function when we know all parameters.
- * It may be called in different places for MPEG-1 and MPEG-2. */
-static int mpeg_decode_postinit(AVCodecContext *avctx)
-{
-    Mpeg1Context *s1  = avctx->priv_data;
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-    uint8_t old_permutation[64];
-    int ret;
-
-    if ((s1->mpeg_enc_ctx_allocated == 0)                   ||
-        avctx->coded_width       != s->width                ||
-        avctx->coded_height      != s->height               ||
-        s1->save_width           != s->width                ||
-        s1->save_height          != s->height               ||
-        s1->save_aspect_info     != s->aspect_ratio_info    ||
-        s1->save_progressive_seq != s->progressive_sequence ||
-        0) {
-        if (s1->mpeg_enc_ctx_allocated) {
-            ParseContext pc = s->parse_context;
-            s->parse_context.buffer = 0;
-            ff_MPV_common_end(s);
-            s->parse_context = pc;
-        }
-
-        if ((s->width == 0) || (s->height == 0))
-            return -2;
-
-        ret = ff_set_dimensions(avctx, s->width, s->height);
-        if (ret < 0)
-            return ret;
-
-        avctx->bit_rate          = s->bit_rate;
-        s1->save_aspect_info     = s->aspect_ratio_info;
-        s1->save_width           = s->width;
-        s1->save_height          = s->height;
-        s1->save_progressive_seq = s->progressive_sequence;
-
-        /* low_delay may be forced, in this case we will have B-frames
-         * that behave like P-frames. */
-        avctx->has_b_frames = !s->low_delay;
-
-        if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
-            // MPEG-1 fps
-            avctx->time_base.den = ff_mpeg12_frame_rate_tab[s->frame_rate_index].num;
-            avctx->time_base.num = ff_mpeg12_frame_rate_tab[s->frame_rate_index].den;
-            // MPEG-1 aspect
-            avctx->sample_aspect_ratio = av_d2q(1.0 / ff_mpeg1_aspect[s->aspect_ratio_info], 255);
-            avctx->ticks_per_frame     = 1;
-        } else { // MPEG-2
-            // MPEG-2 fps
-            av_reduce(&s->avctx->time_base.den,
-                      &s->avctx->time_base.num,
-                      ff_mpeg12_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num * 2,
-                      ff_mpeg12_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den,
-                      1 << 30);
-            avctx->ticks_per_frame = 2;
-            // MPEG-2 aspect
-            if (s->aspect_ratio_info > 1) {
-                AVRational dar =
-                    av_mul_q(av_div_q(ff_mpeg2_aspect[s->aspect_ratio_info],
-                                      (AVRational) { s1->pan_scan.width,
-                                                     s1->pan_scan.height }),
-                             (AVRational) { s->width, s->height });
-
-                /* We ignore the spec here and guess a bit as reality does not
-                 * match the spec, see for example res_change_ffmpeg_aspect.ts
-                 * and sequence-display-aspect.mpg.
-                 * issue1613, 621, 562 */
-                if ((s1->pan_scan.width == 0) || (s1->pan_scan.height == 0) ||
-                    (av_cmp_q(dar, (AVRational) { 4, 3 }) &&
-                     av_cmp_q(dar, (AVRational) { 16, 9 }))) {
-                    s->avctx->sample_aspect_ratio =
-                        av_div_q(ff_mpeg2_aspect[s->aspect_ratio_info],
-                                 (AVRational) { s->width, s->height });
-                } else {
-                    s->avctx->sample_aspect_ratio =
-                        av_div_q(ff_mpeg2_aspect[s->aspect_ratio_info],
-                                 (AVRational) { s1->pan_scan.width, s1->pan_scan.height });
-// issue1613 4/3 16/9 -> 16/9
-// res_change_ffmpeg_aspect.ts 4/3 225/44 ->4/3
-// widescreen-issue562.mpg 4/3 16/9 -> 16/9
-//                    s->avctx->sample_aspect_ratio = av_mul_q(s->avctx->sample_aspect_ratio, (AVRational) {s->width, s->height});
-                    av_dlog(avctx, "A %d/%d\n",
-                            ff_mpeg2_aspect[s->aspect_ratio_info].num,
-                            ff_mpeg2_aspect[s->aspect_ratio_info].den);
-                    av_dlog(avctx, "B %d/%d\n", s->avctx->sample_aspect_ratio.num,
-                            s->avctx->sample_aspect_ratio.den);
-                }
-            } else {
-                s->avctx->sample_aspect_ratio =
-                    ff_mpeg2_aspect[s->aspect_ratio_info];
-            }
-        } // MPEG-2
-
-        avctx->pix_fmt = mpeg_get_pixelformat(avctx);
-        avctx->hwaccel = ff_find_hwaccel(avctx);
-        // until then pix_fmt may be changed right after codec init
-#if FF_API_XVMC
-        if ((avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT ||
-             avctx->hwaccel) && avctx->idct_algo == FF_IDCT_AUTO)
-#else
-        if (avctx->hwaccel && avctx->idct_algo == FF_IDCT_AUTO)
-#endif /* FF_API_XVMC */
-            avctx->idct_algo = FF_IDCT_SIMPLE;
-
-        /* Quantization matrices may need reordering
-         * if DCT permutation is changed. */
-        memcpy(old_permutation, s->dsp.idct_permutation, 64 * sizeof(uint8_t));
-
-        if (ff_MPV_common_init(s) < 0)
-            return -2;
-
-        quant_matrix_rebuild(s->intra_matrix,        old_permutation, s->dsp.idct_permutation);
-        quant_matrix_rebuild(s->inter_matrix,        old_permutation, s->dsp.idct_permutation);
-        quant_matrix_rebuild(s->chroma_intra_matrix, old_permutation, s->dsp.idct_permutation);
-        quant_matrix_rebuild(s->chroma_inter_matrix, old_permutation, s->dsp.idct_permutation);
-
-        s1->mpeg_enc_ctx_allocated = 1;
-    }
-    return 0;
-}
-
-static int mpeg1_decode_picture(AVCodecContext *avctx, const uint8_t *buf,
-                                int buf_size)
-{
-    Mpeg1Context *s1  = avctx->priv_data;
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-    int ref, f_code, vbv_delay;
-
-    init_get_bits(&s->gb, buf, buf_size * 8);
-
-    ref = get_bits(&s->gb, 10); /* temporal ref */
-    s->pict_type = get_bits(&s->gb, 3);
-    if (s->pict_type == 0 || s->pict_type > 3)
-        return -1;
-
-    vbv_delay = get_bits(&s->gb, 16);
-    if (s->pict_type == AV_PICTURE_TYPE_P ||
-        s->pict_type == AV_PICTURE_TYPE_B) {
-        s->full_pel[0] = get_bits1(&s->gb);
-        f_code = get_bits(&s->gb, 3);
-        if (f_code == 0 && (avctx->err_recognition & AV_EF_BITSTREAM))
-            return -1;
-        s->mpeg_f_code[0][0] = f_code;
-        s->mpeg_f_code[0][1] = f_code;
-    }
-    if (s->pict_type == AV_PICTURE_TYPE_B) {
-        s->full_pel[1] = get_bits1(&s->gb);
-        f_code = get_bits(&s->gb, 3);
-        if (f_code == 0 && (avctx->err_recognition & AV_EF_BITSTREAM))
-            return -1;
-        s->mpeg_f_code[1][0] = f_code;
-        s->mpeg_f_code[1][1] = f_code;
-    }
-    s->current_picture.f.pict_type = s->pict_type;
-    s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
-
-    if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(avctx, AV_LOG_DEBUG,
-               "vbv_delay %d, ref %d type:%d\n", vbv_delay, ref, s->pict_type);
-
-    s->y_dc_scale = 8;
-    s->c_dc_scale = 8;
-    return 0;
-}
-
-static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
-{
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-    int horiz_size_ext, vert_size_ext;
-    int bit_rate_ext;
-
-    skip_bits(&s->gb, 1); /* profile and level esc*/
-    s->avctx->profile       = get_bits(&s->gb, 3);
-    s->avctx->level         = get_bits(&s->gb, 4);
-    s->progressive_sequence = get_bits1(&s->gb);   /* progressive_sequence */
-    s->chroma_format        = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */
-    horiz_size_ext          = get_bits(&s->gb, 2);
-    vert_size_ext           = get_bits(&s->gb, 2);
-    s->width  |= (horiz_size_ext << 12);
-    s->height |= (vert_size_ext  << 12);
-    bit_rate_ext = get_bits(&s->gb, 12);  /* XXX: handle it */
-    s->bit_rate += (bit_rate_ext << 18) * 400;
-    skip_bits1(&s->gb); /* marker */
-    s->avctx->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10;
-
-    s->low_delay = get_bits1(&s->gb);
-    if (s->flags & CODEC_FLAG_LOW_DELAY)
-        s->low_delay = 1;
-
-    s1->frame_rate_ext.num = get_bits(&s->gb, 2) + 1;
-    s1->frame_rate_ext.den = get_bits(&s->gb, 5) + 1;
-
-    av_dlog(s->avctx, "sequence extension\n");
-    s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
-
-    if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(s->avctx, AV_LOG_DEBUG,
-               "profile: %d, level: %d vbv buffer: %d, bitrate:%d\n",
-               s->avctx->profile, s->avctx->level,
-               s->avctx->rc_buffer_size, s->bit_rate);
-}
-
-static void mpeg_decode_sequence_display_extension(Mpeg1Context *s1)
-{
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-    int color_description, w, h;
-
-    skip_bits(&s->gb, 3); /* video format */
-    color_description = get_bits1(&s->gb);
-    if (color_description) {
-        s->avctx->color_primaries = get_bits(&s->gb, 8);
-        s->avctx->color_trc       = get_bits(&s->gb, 8);
-        s->avctx->colorspace      = get_bits(&s->gb, 8);
-    }
-    w = get_bits(&s->gb, 14);
-    skip_bits(&s->gb, 1); // marker
-    h = get_bits(&s->gb, 14);
-    // remaining 3 bits are zero padding
-
-    s1->pan_scan.width  = 16 * w;
-    s1->pan_scan.height = 16 * h;
-
-    if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(s->avctx, AV_LOG_DEBUG, "sde w:%d, h:%d\n", w, h);
-}
-
-static void mpeg_decode_picture_display_extension(Mpeg1Context *s1)
-{
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-    int i, nofco;
-
-    nofco = 1;
-    if (s->progressive_sequence) {
-        if (s->repeat_first_field) {
-            nofco++;
-            if (s->top_field_first)
-                nofco++;
-        }
-    } else {
-        if (s->picture_structure == PICT_FRAME) {
-            nofco++;
-            if (s->repeat_first_field)
-                nofco++;
-        }
-    }
-    for (i = 0; i < nofco; i++) {
-        s1->pan_scan.position[i][0] = get_sbits(&s->gb, 16);
-        skip_bits(&s->gb, 1); // marker
-        s1->pan_scan.position[i][1] = get_sbits(&s->gb, 16);
-        skip_bits(&s->gb, 1); // marker
-    }
-
-    if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(s->avctx, AV_LOG_DEBUG, "pde (%d,%d) (%d,%d) (%d,%d)\n",
-               s1->pan_scan.position[0][0], s1->pan_scan.position[0][1],
-               s1->pan_scan.position[1][0], s1->pan_scan.position[1][1],
-               s1->pan_scan.position[2][0], s1->pan_scan.position[2][1]);
-}
-
-static int load_matrix(MpegEncContext *s, uint16_t matrix0[64],
-                       uint16_t matrix1[64], int intra)
-{
-    int i;
-
-    for (i = 0; i < 64; i++) {
-        int j = s->dsp.idct_permutation[ff_zigzag_direct[i]];
-        int v = get_bits(&s->gb, 8);
-        if (v == 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "matrix damaged\n");
-            return -1;
-        }
-        if (intra && i == 0 && v != 8) {
-            av_log(s->avctx, AV_LOG_ERROR, "intra matrix invalid, ignoring\n");
-            v = 8; // needed by pink.mpg / issue1046
-        }
-        matrix0[j] = v;
-        if (matrix1)
-            matrix1[j] = v;
-    }
-    return 0;
-}
-
-static void mpeg_decode_quant_matrix_extension(MpegEncContext *s)
-{
-    av_dlog(s->avctx, "matrix extension\n");
-
-    if (get_bits1(&s->gb))
-        load_matrix(s, s->chroma_intra_matrix, s->intra_matrix, 1);
-    if (get_bits1(&s->gb))
-        load_matrix(s, s->chroma_inter_matrix, s->inter_matrix, 0);
-    if (get_bits1(&s->gb))
-        load_matrix(s, s->chroma_intra_matrix, NULL, 1);
-    if (get_bits1(&s->gb))
-        load_matrix(s, s->chroma_inter_matrix, NULL, 0);
-}
-
-static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
-{
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-
-    s->full_pel[0]       = s->full_pel[1] = 0;
-    s->mpeg_f_code[0][0] = get_bits(&s->gb, 4);
-    s->mpeg_f_code[0][1] = get_bits(&s->gb, 4);
-    s->mpeg_f_code[1][0] = get_bits(&s->gb, 4);
-    s->mpeg_f_code[1][1] = get_bits(&s->gb, 4);
-    if (!s->pict_type && s1->mpeg_enc_ctx_allocated) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Missing picture start code, guessing missing values\n");
-        if (s->mpeg_f_code[1][0] == 15 && s->mpeg_f_code[1][1] == 15) {
-            if (s->mpeg_f_code[0][0] == 15 && s->mpeg_f_code[0][1] == 15)
-                s->pict_type = AV_PICTURE_TYPE_I;
-            else
-                s->pict_type = AV_PICTURE_TYPE_P;
-        } else
-            s->pict_type = AV_PICTURE_TYPE_B;
-        s->current_picture.f.pict_type = s->pict_type;
-        s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
-    }
-    s->intra_dc_precision         = get_bits(&s->gb, 2);
-    s->picture_structure          = get_bits(&s->gb, 2);
-    s->top_field_first            = get_bits1(&s->gb);
-    s->frame_pred_frame_dct       = get_bits1(&s->gb);
-    s->concealment_motion_vectors = get_bits1(&s->gb);
-    s->q_scale_type               = get_bits1(&s->gb);
-    s->intra_vlc_format           = get_bits1(&s->gb);
-    s->alternate_scan             = get_bits1(&s->gb);
-    s->repeat_first_field         = get_bits1(&s->gb);
-    s->chroma_420_type            = get_bits1(&s->gb);
-    s->progressive_frame          = get_bits1(&s->gb);
-
-    if (s->progressive_sequence && !s->progressive_frame) {
-        s->progressive_frame = 1;
-        av_log(s->avctx, AV_LOG_ERROR,
-               "interlaced frame in progressive sequence, ignoring\n");
-    }
-
-    if (s->picture_structure == 0 ||
-        (s->progressive_frame && s->picture_structure != PICT_FRAME)) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "picture_structure %d invalid, ignoring\n",
-               s->picture_structure);
-        s->picture_structure = PICT_FRAME;
-    }
-
-    if (s->progressive_sequence && !s->frame_pred_frame_dct)
-        av_log(s->avctx, AV_LOG_WARNING, "invalid frame_pred_frame_dct\n");
-
-    if (s->picture_structure == PICT_FRAME) {
-        s->first_field = 0;
-        s->v_edge_pos  = 16 * s->mb_height;
-    } else {
-        s->first_field ^= 1;
-        s->v_edge_pos   = 8 * s->mb_height;
-        memset(s->mbskip_table, 0, s->mb_stride * s->mb_height);
-    }
-
-    if (s->alternate_scan) {
-        ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan);
-    } else {
-        ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
-    }
-
-    /* composite display not parsed */
-    av_dlog(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision);
-    av_dlog(s->avctx, "picture_structure=%d\n", s->picture_structure);
-    av_dlog(s->avctx, "top field first=%d\n", s->top_field_first);
-    av_dlog(s->avctx, "repeat first field=%d\n", s->repeat_first_field);
-    av_dlog(s->avctx, "conceal=%d\n", s->concealment_motion_vectors);
-    av_dlog(s->avctx, "intra_vlc_format=%d\n", s->intra_vlc_format);
-    av_dlog(s->avctx, "alternate_scan=%d\n", s->alternate_scan);
-    av_dlog(s->avctx, "frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct);
-    av_dlog(s->avctx, "progressive_frame=%d\n", s->progressive_frame);
-}
-
-static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
-{
-    AVCodecContext *avctx = s->avctx;
-    Mpeg1Context *s1      = (Mpeg1Context *) s;
-
-    /* start frame decoding */
-    if (s->first_field || s->picture_structure == PICT_FRAME) {
-        AVFrameSideData *pan_scan;
-
-        if (ff_MPV_frame_start(s, avctx) < 0)
-            return -1;
-
-        ff_mpeg_er_frame_start(s);
-
-        /* first check if we must repeat the frame */
-        s->current_picture_ptr->f.repeat_pict = 0;
-        if (s->repeat_first_field) {
-            if (s->progressive_sequence) {
-                if (s->top_field_first)
-                    s->current_picture_ptr->f.repeat_pict = 4;
-                else
-                    s->current_picture_ptr->f.repeat_pict = 2;
-            } else if (s->progressive_frame) {
-                s->current_picture_ptr->f.repeat_pict = 1;
-            }
-        }
-
-        pan_scan = av_frame_new_side_data(&s->current_picture_ptr->f,
-                                          AV_FRAME_DATA_PANSCAN,
-                                          sizeof(s1->pan_scan));
-        if (!pan_scan)
-            return AVERROR(ENOMEM);
-        memcpy(pan_scan->data, &s1->pan_scan, sizeof(s1->pan_scan));
-
-        if (s1->a53_caption) {
-            AVFrameSideData *sd = av_frame_new_side_data(
-                &s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC,
-                s1->a53_caption_size);
-            if (sd)
-                memcpy(sd->data, s1->a53_caption, s1->a53_caption_size);
-            av_freep(&s1->a53_caption);
-        }
-
-        if (s1->has_stereo3d) {
-            AVStereo3D *stereo = av_stereo3d_create_side_data(&s->current_picture_ptr->f);
-            if (!stereo)
-                return AVERROR(ENOMEM);
-
-            *stereo = s1->stereo3d;
-            s1->has_stereo3d = 0;
-        }
-        if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME))
-            ff_thread_finish_setup(avctx);
-    } else { // second field
-        int i;
-
-        if (!s->current_picture_ptr) {
-            av_log(s->avctx, AV_LOG_ERROR, "first field missing\n");
-            return -1;
-        }
-
-        if (s->avctx->hwaccel &&
-            (s->avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) {
-            if (s->avctx->hwaccel->end_frame(s->avctx) < 0)
-                av_log(avctx, AV_LOG_ERROR,
-                       "hardware accelerator failed to decode first field\n");
-        }
-
-        for (i = 0; i < 4; i++) {
-            s->current_picture.f.data[i] = s->current_picture_ptr->f.data[i];
-            if (s->picture_structure == PICT_BOTTOM_FIELD)
-                s->current_picture.f.data[i] +=
-                    s->current_picture_ptr->f.linesize[i];
-        }
-    }
-
-    if (avctx->hwaccel) {
-        if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
-            return -1;
-    }
-
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-// MPV_frame_start will call this function too,
-// but we need to call it on every field
-    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
-        if (ff_xvmc_field_start(s, avctx) < 0)
-            return -1;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-    return 0;
-}
-
-#define DECODE_SLICE_ERROR -1
-#define DECODE_SLICE_OK     0
-
-/**
- * Decode a slice.
- * MpegEncContext.mb_y must be set to the MB row from the startcode.
- * @return DECODE_SLICE_ERROR if the slice is damaged,
- *         DECODE_SLICE_OK if this slice is OK
- */
-static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
-                             const uint8_t **buf, int buf_size)
-{
-    AVCodecContext *avctx = s->avctx;
-    const int field_pic   = s->picture_structure != PICT_FRAME;
-
-    s->resync_mb_x =
-    s->resync_mb_y = -1;
-
-    assert(mb_y < s->mb_height);
-
-    init_get_bits(&s->gb, *buf, buf_size * 8);
-
-    ff_mpeg1_clean_buffers(s);
-    s->interlaced_dct = 0;
-
-    s->qscale = get_qscale(s);
-
-    if (s->qscale == 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "qscale == 0\n");
-        return -1;
-    }
-
-    /* extra slice info */
-    while (get_bits1(&s->gb) != 0)
-        skip_bits(&s->gb, 8);
-
-    s->mb_x = 0;
-
-    if (mb_y == 0 && s->codec_tag == AV_RL32("SLIF")) {
-        skip_bits1(&s->gb);
-    } else {
-        while (get_bits_left(&s->gb) > 0) {
-            int code = get_vlc2(&s->gb, ff_mbincr_vlc.table,
-                                MBINCR_VLC_BITS, 2);
-            if (code < 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "first mb_incr damaged\n");
-                return -1;
-            }
-            if (code >= 33) {
-                if (code == 33)
-                    s->mb_x += 33;
-                /* otherwise, stuffing, nothing to do */
-            } else {
-                s->mb_x += code;
-                break;
-            }
-        }
-    }
-
-    if (s->mb_x >= (unsigned) s->mb_width) {
-        av_log(s->avctx, AV_LOG_ERROR, "initial skip overflow\n");
-        return -1;
-    }
-
-    if (avctx->hwaccel) {
-        const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
-        int start_code = -1;
-        buf_end = avpriv_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
-        if (buf_end < *buf + buf_size)
-            buf_end -= 4;
-        s->mb_y = mb_y;
-        if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0)
-            return DECODE_SLICE_ERROR;
-        *buf = buf_end;
-        return DECODE_SLICE_OK;
-    }
-
-    s->resync_mb_x = s->mb_x;
-    s->resync_mb_y = s->mb_y = mb_y;
-    s->mb_skip_run = 0;
-    ff_init_block_index(s);
-
-    if (s->mb_y == 0 && s->mb_x == 0 && (s->first_field || s->picture_structure == PICT_FRAME)) {
-        if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
-            av_log(s->avctx, AV_LOG_DEBUG,
-                   "qp:%d fc:%2d%2d%2d%2d %s %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n",
-                   s->qscale,
-                   s->mpeg_f_code[0][0], s->mpeg_f_code[0][1],
-                   s->mpeg_f_code[1][0], s->mpeg_f_code[1][1],
-                   s->pict_type  == AV_PICTURE_TYPE_I ? "I" :
-                   (s->pict_type == AV_PICTURE_TYPE_P ? "P" :
-                   (s->pict_type == AV_PICTURE_TYPE_B ? "B" : "S")),
-                   s->progressive_sequence ? "ps"  : "",
-                   s->progressive_frame    ? "pf"  : "",
-                   s->alternate_scan       ? "alt" : "",
-                   s->top_field_first      ? "top" : "",
-                   s->intra_dc_precision, s->picture_structure,
-                   s->frame_pred_frame_dct, s->concealment_motion_vectors,
-                   s->q_scale_type, s->intra_vlc_format,
-                   s->repeat_first_field, s->chroma_420_type ? "420" : "");
-        }
-    }
-
-    for (;;) {
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-        // If 1, we memcpy blocks in xvmcvideo.
-        if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1)
-            ff_xvmc_init_block(s); // set s->block
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-        if (mpeg_decode_mb(s, s->block) < 0)
-            return -1;
-
-        // Note motion_val is normally NULL unless we want to extract the MVs.
-        if (s->current_picture.motion_val[0] && !s->encoding) {
-            const int wrap = s->b8_stride;
-            int xy         = s->mb_x * 2 + s->mb_y * 2 * wrap;
-            int b8_xy      = 4 * (s->mb_x + s->mb_y * s->mb_stride);
-            int motion_x, motion_y, dir, i;
-
-            for (i = 0; i < 2; i++) {
-                for (dir = 0; dir < 2; dir++) {
-                    if (s->mb_intra ||
-                        (dir == 1 && s->pict_type != AV_PICTURE_TYPE_B)) {
-                        motion_x = motion_y = 0;
-                    } else if (s->mv_type == MV_TYPE_16X16 ||
-                               (s->mv_type == MV_TYPE_FIELD && field_pic)) {
-                        motion_x = s->mv[dir][0][0];
-                        motion_y = s->mv[dir][0][1];
-                    } else { /* if ((s->mv_type == MV_TYPE_FIELD) || (s->mv_type == MV_TYPE_16X8)) */
-                        motion_x = s->mv[dir][i][0];
-                        motion_y = s->mv[dir][i][1];
-                    }
-
-                    s->current_picture.motion_val[dir][xy][0]     = motion_x;
-                    s->current_picture.motion_val[dir][xy][1]     = motion_y;
-                    s->current_picture.motion_val[dir][xy + 1][0] = motion_x;
-                    s->current_picture.motion_val[dir][xy + 1][1] = motion_y;
-                    s->current_picture.ref_index [dir][b8_xy]     =
-                    s->current_picture.ref_index [dir][b8_xy + 1] = s->field_select[dir][i];
-                    assert(s->field_select[dir][i] == 0 ||
-                           s->field_select[dir][i] == 1);
-                }
-                xy    += wrap;
-                b8_xy += 2;
-            }
-        }
-
-        s->dest[0] += 16;
-        s->dest[1] += 16 >> s->chroma_x_shift;
-        s->dest[2] += 16 >> s->chroma_x_shift;
-
-        ff_MPV_decode_mb(s, s->block);
-
-        if (++s->mb_x >= s->mb_width) {
-            const int mb_size = 16;
-
-            ff_mpeg_draw_horiz_band(s, mb_size * (s->mb_y >> field_pic), mb_size);
-            ff_MPV_report_decode_progress(s);
-
-            s->mb_x  = 0;
-            s->mb_y += 1 << field_pic;
-
-            if (s->mb_y >= s->mb_height) {
-                int left   = get_bits_left(&s->gb);
-                int is_d10 = s->chroma_format == 2 &&
-                             s->pict_type == AV_PICTURE_TYPE_I &&
-                             avctx->profile == 0 && avctx->level == 5 &&
-                             s->intra_dc_precision == 2 &&
-                             s->q_scale_type == 1 && s->alternate_scan == 0 &&
-                             s->progressive_frame == 0
-                             /* vbv_delay == 0xBBB || 0xE10 */;
-
-                if (left < 0 ||
-                    (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10) ||
-                    ((avctx->err_recognition & AV_EF_BUFFER) && left > 8)) {
-                    av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n",
-                           left, show_bits(&s->gb, FFMIN(left, 23)));
-                    return -1;
-                } else
-                    goto eos;
-            }
-
-            ff_init_block_index(s);
-        }
-
-        /* skip mb handling */
-        if (s->mb_skip_run == -1) {
-            /* read increment again */
-            s->mb_skip_run = 0;
-            for (;;) {
-                int code = get_vlc2(&s->gb, ff_mbincr_vlc.table,
-                                    MBINCR_VLC_BITS, 2);
-                if (code < 0) {
-                    av_log(s->avctx, AV_LOG_ERROR, "mb incr damaged\n");
-                    return -1;
-                }
-                if (code >= 33) {
-                    if (code == 33) {
-                        s->mb_skip_run += 33;
-                    } else if (code == 35) {
-                        if (s->mb_skip_run != 0 || show_bits(&s->gb, 15) != 0) {
-                            av_log(s->avctx, AV_LOG_ERROR, "slice mismatch\n");
-                            return -1;
-                        }
-                        goto eos; /* end of slice */
-                    }
-                    /* otherwise, stuffing, nothing to do */
-                } else {
-                    s->mb_skip_run += code;
-                    break;
-                }
-            }
-            if (s->mb_skip_run) {
-                int i;
-                if (s->pict_type == AV_PICTURE_TYPE_I) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y);
-                    return -1;
-                }
-
-                /* skip mb */
-                s->mb_intra = 0;
-                for (i = 0; i < 12; i++)
-                    s->block_last_index[i] = -1;
-                if (s->picture_structure == PICT_FRAME)
-                    s->mv_type = MV_TYPE_16X16;
-                else
-                    s->mv_type = MV_TYPE_FIELD;
-                if (s->pict_type == AV_PICTURE_TYPE_P) {
-                    /* if P type, zero motion vector is implied */
-                    s->mv_dir             = MV_DIR_FORWARD;
-                    s->mv[0][0][0]        = s->mv[0][0][1]      = 0;
-                    s->last_mv[0][0][0]   = s->last_mv[0][0][1] = 0;
-                    s->last_mv[0][1][0]   = s->last_mv[0][1][1] = 0;
-                    s->field_select[0][0] = (s->picture_structure - 1) & 1;
-                } else {
-                    /* if B type, reuse previous vectors and directions */
-                    s->mv[0][0][0] = s->last_mv[0][0][0];
-                    s->mv[0][0][1] = s->last_mv[0][0][1];
-                    s->mv[1][0][0] = s->last_mv[1][0][0];
-                    s->mv[1][0][1] = s->last_mv[1][0][1];
-                }
-            }
-        }
-    }
-eos: // end of slice
-    *buf += (get_bits_count(&s->gb) - 1) / 8;
-    av_dlog(s, "y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
-    return 0;
-}
-
-static int slice_decode_thread(AVCodecContext *c, void *arg)
-{
-    MpegEncContext *s   = *(void **) arg;
-    const uint8_t *buf  = s->gb.buffer;
-    int mb_y            = s->start_mb_y;
-    const int field_pic = s->picture_structure != PICT_FRAME;
-
-    s->er.error_count = (3 * (s->end_mb_y - s->start_mb_y) * s->mb_width) >> field_pic;
-
-    for (;;) {
-        uint32_t start_code;
-        int ret;
-
-        ret = mpeg_decode_slice(s, mb_y, &buf, s->gb.buffer_end - buf);
-        emms_c();
-        av_dlog(c, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
-                ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y,
-                s->start_mb_y, s->end_mb_y, s->er.error_count);
-        if (ret < 0) {
-            if (c->err_recognition & AV_EF_EXPLODE)
-                return ret;
-            if (s->resync_mb_x >= 0 && s->resync_mb_y >= 0)
-                ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                                s->mb_x, s->mb_y,
-                                ER_AC_ERROR | ER_DC_ERROR | ER_MV_ERROR);
-        } else {
-            ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                            s->mb_x - 1, s->mb_y,
-                            ER_AC_END | ER_DC_END | ER_MV_END);
-        }
-
-        if (s->mb_y == s->end_mb_y)
-            return 0;
-
-        start_code = -1;
-        buf        = avpriv_find_start_code(buf, s->gb.buffer_end, &start_code);
-        mb_y       = (start_code - SLICE_MIN_START_CODE) << field_pic;
-        if (s->picture_structure == PICT_BOTTOM_FIELD)
-            mb_y++;
-        if (mb_y < 0 || mb_y >= s->end_mb_y)
-            return -1;
-    }
-}
-
-/**
- * Handle slice ends.
- * @return 1 if it seems to be the last slice
- */
-static int slice_end(AVCodecContext *avctx, AVFrame *pict)
-{
-    Mpeg1Context *s1  = avctx->priv_data;
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-
-    if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr)
-        return 0;
-
-    if (s->avctx->hwaccel) {
-        if (s->avctx->hwaccel->end_frame(s->avctx) < 0)
-            av_log(avctx, AV_LOG_ERROR,
-                   "hardware accelerator failed to decode picture\n");
-    }
-
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
-        ff_xvmc_field_end(s);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-    /* end of slice reached */
-    if (/* s->mb_y << field_pic == s->mb_height && */ !s->first_field) {
-        /* end of image */
-
-        ff_er_frame_end(&s->er);
-
-        ff_MPV_frame_end(s);
-
-        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
-            int ret = av_frame_ref(pict, &s->current_picture_ptr->f);
-            if (ret < 0)
-                return ret;
-            ff_print_debug_info(s, s->current_picture_ptr);
-        } else {
-            if (avctx->active_thread_type & FF_THREAD_FRAME)
-                s->picture_number++;
-            /* latency of 1 frame for I- and P-frames */
-            /* XXX: use another variable than picture_number */
-            if (s->last_picture_ptr != NULL) {
-                int ret = av_frame_ref(pict, &s->last_picture_ptr->f);
-                if (ret < 0)
-                    return ret;
-                ff_print_debug_info(s, s->last_picture_ptr);
-            }
-        }
-
-        return 1;
-    } else {
-        return 0;
-    }
-}
-
-static int mpeg1_decode_sequence(AVCodecContext *avctx,
-                                 const uint8_t *buf, int buf_size)
-{
-    Mpeg1Context *s1  = avctx->priv_data;
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-    int width, height;
-    int i, v, j;
-
-    init_get_bits(&s->gb, buf, buf_size * 8);
-
-    width  = get_bits(&s->gb, 12);
-    height = get_bits(&s->gb, 12);
-    if (width == 0 || height == 0) {
-        av_log(avctx, AV_LOG_WARNING,
-               "Invalid horizontal or vertical size value.\n");
-        if (avctx->err_recognition & AV_EF_BITSTREAM)
-            return AVERROR_INVALIDDATA;
-    }
-    s->aspect_ratio_info = get_bits(&s->gb, 4);
-    if (s->aspect_ratio_info == 0) {
-        av_log(avctx, AV_LOG_ERROR, "aspect ratio has forbidden 0 value\n");
-        if (avctx->err_recognition & AV_EF_BITSTREAM)
-            return -1;
-    }
-    s->frame_rate_index = get_bits(&s->gb, 4);
-    if (s->frame_rate_index == 0 || s->frame_rate_index > 13)
-        return -1;
-    s->bit_rate = get_bits(&s->gb, 18) * 400;
-    if (get_bits1(&s->gb) == 0) /* marker */
-        return -1;
-    s->width  = width;
-    s->height = height;
-
-    s->avctx->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16;
-    skip_bits(&s->gb, 1);
-
-    /* get matrix */
-    if (get_bits1(&s->gb)) {
-        load_matrix(s, s->chroma_intra_matrix, s->intra_matrix, 1);
-    } else {
-        for (i = 0; i < 64; i++) {
-            j = s->dsp.idct_permutation[i];
-            v = ff_mpeg1_default_intra_matrix[i];
-            s->intra_matrix[j]        = v;
-            s->chroma_intra_matrix[j] = v;
-        }
-    }
-    if (get_bits1(&s->gb)) {
-        load_matrix(s, s->chroma_inter_matrix, s->inter_matrix, 0);
-    } else {
-        for (i = 0; i < 64; i++) {
-            int j = s->dsp.idct_permutation[i];
-            v = ff_mpeg1_default_non_intra_matrix[i];
-            s->inter_matrix[j]        = v;
-            s->chroma_inter_matrix[j] = v;
-        }
-    }
-
-    if (show_bits(&s->gb, 23) != 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "sequence header damaged\n");
-        return -1;
-    }
-
-    /* We set MPEG-2 parameters so that it emulates MPEG-1. */
-    s->progressive_sequence = 1;
-    s->progressive_frame    = 1;
-    s->picture_structure    = PICT_FRAME;
-    s->frame_pred_frame_dct = 1;
-    s->chroma_format        = 1;
-    s->codec_id             =
-    s->avctx->codec_id      = AV_CODEC_ID_MPEG1VIDEO;
-    s->out_format           = FMT_MPEG1;
-    if (s->flags & CODEC_FLAG_LOW_DELAY)
-        s->low_delay = 1;
-
-    if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%d\n",
-               s->avctx->rc_buffer_size, s->bit_rate);
-
-    return 0;
-}
-
-static int vcr2_init_sequence(AVCodecContext *avctx)
-{
-    Mpeg1Context *s1  = avctx->priv_data;
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-    int i, v;
-
-    /* start new MPEG-1 context decoding */
-    s->out_format = FMT_MPEG1;
-    if (s1->mpeg_enc_ctx_allocated) {
-        ff_MPV_common_end(s);
-    }
-    s->width            = avctx->coded_width;
-    s->height           = avctx->coded_height;
-    avctx->has_b_frames = 0; // true?
-    s->low_delay        = 1;
-
-    avctx->pix_fmt = mpeg_get_pixelformat(avctx);
-    avctx->hwaccel = ff_find_hwaccel(avctx);
-
-#if FF_API_XVMC
-    if ((avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT || avctx->hwaccel) &&
-        avctx->idct_algo == FF_IDCT_AUTO)
-#else
-    if (avctx->hwaccel && avctx->idct_algo == FF_IDCT_AUTO)
-#endif /* FF_API_XVMC */
-        avctx->idct_algo = FF_IDCT_SIMPLE;
-
-    if (ff_MPV_common_init(s) < 0)
-        return -1;
-    s1->mpeg_enc_ctx_allocated = 1;
-
-    for (i = 0; i < 64; i++) {
-        int j = s->dsp.idct_permutation[i];
-        v = ff_mpeg1_default_intra_matrix[i];
-        s->intra_matrix[j]        = v;
-        s->chroma_intra_matrix[j] = v;
-
-        v = ff_mpeg1_default_non_intra_matrix[i];
-        s->inter_matrix[j]        = v;
-        s->chroma_inter_matrix[j] = v;
-    }
-
-    s->progressive_sequence  = 1;
-    s->progressive_frame     = 1;
-    s->picture_structure     = PICT_FRAME;
-    s->frame_pred_frame_dct  = 1;
-    s->chroma_format         = 1;
-    s->codec_id              = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
-    s1->save_width           = s->width;
-    s1->save_height          = s->height;
-    s1->save_progressive_seq = s->progressive_sequence;
-    return 0;
-}
-
-static int mpeg_decode_a53_cc(AVCodecContext *avctx,
-                              const uint8_t *p, int buf_size)
-{
-    Mpeg1Context *s1 = avctx->priv_data;
-
-    if (buf_size >= 6 &&
-        p[0] == 'G' && p[1] == 'A' && p[2] == '9' && p[3] == '4' &&
-        p[4] == 3 && (p[5] & 0x40)) {
-        /* extract A53 Part 4 CC data */
-        int cc_count = p[5] & 0x1f;
-        if (cc_count > 0 && buf_size >= 7 + cc_count * 3) {
-            av_freep(&s1->a53_caption);
-            s1->a53_caption_size = cc_count * 3;
-            s1->a53_caption      = av_malloc(s1->a53_caption_size);
-            if (s1->a53_caption)
-                memcpy(s1->a53_caption, p + 7, s1->a53_caption_size);
-        }
-        return 1;
-    } else if (buf_size >= 11 &&
-               p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 0xf8) {
-        /* extract DVD CC data */
-        int cc_count = 0;
-        int i;
-        // There is a caption count field in the data, but it is often
-        // incorect.  So count the number of captions present.
-        for (i = 5; i + 6 <= buf_size && ((p[i] & 0xfe) == 0xfe); i += 6)
-            cc_count++;
-        // Transform the DVD format into A53 Part 4 format
-        if (cc_count > 0) {
-            av_freep(&s1->a53_caption);
-            s1->a53_caption_size = cc_count * 6;
-            s1->a53_caption      = av_malloc(s1->a53_caption_size);
-            if (s1->a53_caption) {
-                uint8_t field1 = !!(p[4] & 0x80);
-                uint8_t *cap = s1->a53_caption;
-                p += 5;
-                for (i = 0; i < cc_count; i++) {
-                    cap[0] = (p[0] == 0xff && field1) ? 0xfc : 0xfd;
-                    cap[1] = p[1];
-                    cap[2] = p[2];
-                    cap[3] = (p[3] == 0xff && !field1) ? 0xfc : 0xfd;
-                    cap[4] = p[4];
-                    cap[5] = p[5];
-                    cap += 6;
-                    p += 6;
-                }
-            }
-        }
-        return 1;
-    }
-    return 0;
-}
-
-static void mpeg_decode_user_data(AVCodecContext *avctx,
-                                  const uint8_t *p, int buf_size)
-{
-    const uint8_t *buf_end = p + buf_size;
-
-    /* we parse the DTG active format information */
-    if (buf_end - p >= 5 &&
-        p[0] == 'D' && p[1] == 'T' && p[2] == 'G' && p[3] == '1') {
-        int flags = p[4];
-        p += 5;
-        if (flags & 0x80) {
-            /* skip event id */
-            p += 2;
-        }
-        if (flags & 0x40) {
-            if (buf_end - p < 1)
-                return;
-            avctx->dtg_active_format = p[0] & 0x0f;
-        }
-    } else if (buf_end - p >= 6 &&
-               p[0] == 'J' && p[1] == 'P' && p[2] == '3' && p[3] == 'D' &&
-               p[4] == 0x03) { // S3D_video_format_length
-        // the 0x7F mask ignores the reserved_bit value
-        const uint8_t S3D_video_format_type = p[5] & 0x7F;
-
-        if (S3D_video_format_type == 0x03 ||
-            S3D_video_format_type == 0x04 ||
-            S3D_video_format_type == 0x08 ||
-            S3D_video_format_type == 0x23) {
-            Mpeg1Context *s1   = avctx->priv_data;
-
-            s1->has_stereo3d = 1;
-
-            switch (S3D_video_format_type) {
-            case 0x03:
-                s1->stereo3d.type = AV_STEREO3D_SIDEBYSIDE;
-                break;
-            case 0x04:
-                s1->stereo3d.type = AV_STEREO3D_TOPBOTTOM;
-                break;
-            case 0x08:
-                s1->stereo3d.type = AV_STEREO3D_2D;
-                break;
-            case 0x23:
-                s1->stereo3d.type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX;
-                break;
-            }
-        }
-    } else if (mpeg_decode_a53_cc(avctx, p, buf_size)) {
-        return;
-    }
-}
-
-static void mpeg_decode_gop(AVCodecContext *avctx,
-                            const uint8_t *buf, int buf_size)
-{
-    Mpeg1Context *s1  = avctx->priv_data;
-    MpegEncContext *s = &s1->mpeg_enc_ctx;
-
-    int time_code_hours, time_code_minutes;
-    int time_code_seconds, time_code_pictures;
-    int broken_link;
-
-    init_get_bits(&s->gb, buf, buf_size * 8);
-
-    skip_bits1(&s->gb); /* drop_frame_flag */
-
-    time_code_hours   = get_bits(&s->gb, 5);
-    time_code_minutes = get_bits(&s->gb, 6);
-    skip_bits1(&s->gb); // marker bit
-    time_code_seconds  = get_bits(&s->gb, 6);
-    time_code_pictures = get_bits(&s->gb, 6);
-
-    s1->closed_gop = get_bits1(&s->gb);
-    /* broken_link indicate that after editing the
-     * reference frames of the first B-Frames after GOP I-Frame
-     * are missing (open gop) */
-    broken_link = get_bits1(&s->gb);
-
-    if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(s->avctx, AV_LOG_DEBUG,
-               "GOP (%2d:%02d:%02d.[%02d]) closed_gop=%d broken_link=%d\n",
-               time_code_hours, time_code_minutes, time_code_seconds,
-               time_code_pictures, s1->closed_gop, broken_link);
-}
-
-static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
-                         int *got_output, const uint8_t *buf, int buf_size)
-{
-    Mpeg1Context *s = avctx->priv_data;
-    MpegEncContext *s2 = &s->mpeg_enc_ctx;
-    const uint8_t *buf_ptr = buf;
-    const uint8_t *buf_end = buf + buf_size;
-    int ret, input_size;
-    int last_code = 0, skip_frame = 0;
-
-    for (;;) {
-        /* find next start code */
-        uint32_t start_code = -1;
-        buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &start_code);
-        if (start_code > 0x1ff) {
-            if (!skip_frame) {
-                if (HAVE_THREADS &&
-                    (avctx->active_thread_type & FF_THREAD_SLICE) &&
-                    !avctx->hwaccel) {
-                    int i;
-
-                    avctx->execute(avctx, slice_decode_thread,
-                                   &s2->thread_context[0], NULL,
-                                   s->slice_count, sizeof(void *));
-                    for (i = 0; i < s->slice_count; i++)
-                        s2->er.error_count += s2->thread_context[i]->er.error_count;
-                }
-
-                ret = slice_end(avctx, picture);
-                if (ret < 0)
-                    return ret;
-                else if (ret) {
-                    // FIXME: merge with the stuff in mpeg_decode_slice
-                    if (s2->last_picture_ptr || s2->low_delay)
-                        *got_output = 1;
-                }
-            }
-            s2->pict_type = 0;
-            return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);
-        }
-
-        input_size = buf_end - buf_ptr;
-
-        if (avctx->debug & FF_DEBUG_STARTCODE)
-            av_log(avctx, AV_LOG_DEBUG, "%3X at %td left %d\n",
-                   start_code, buf_ptr - buf, input_size);
-
-        /* prepare data for next start code */
-        switch (start_code) {
-        case SEQ_START_CODE:
-            if (last_code == 0) {
-                mpeg1_decode_sequence(avctx, buf_ptr, input_size);
-                s->sync = 1;
-            } else {
-                av_log(avctx, AV_LOG_ERROR,
-                       "ignoring SEQ_START_CODE after %X\n", last_code);
-                if (avctx->err_recognition & AV_EF_EXPLODE)
-                    return AVERROR_INVALIDDATA;
-            }
-            break;
-
-        case PICTURE_START_CODE:
-            if (s2->width <= 0 || s2->height <= 0) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid frame dimensions %dx%d.\n",
-                       s2->width, s2->height);
-                return AVERROR_INVALIDDATA;
-            }
-
-            if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
-                !avctx->hwaccel && s->slice_count) {
-                int i;
-
-                avctx->execute(avctx, slice_decode_thread,
-                               s2->thread_context, NULL,
-                               s->slice_count, sizeof(void *));
-                for (i = 0; i < s->slice_count; i++)
-                    s2->er.error_count += s2->thread_context[i]->er.error_count;
-                s->slice_count = 0;
-            }
-            if (last_code == 0 || last_code == SLICE_MIN_START_CODE) {
-                ret = mpeg_decode_postinit(avctx);
-                if (ret < 0) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "mpeg_decode_postinit() failure\n");
-                    return ret;
-                }
-
-                /* We have a complete image: we try to decompress it. */
-                if (mpeg1_decode_picture(avctx, buf_ptr, input_size) < 0)
-                    s2->pict_type = 0;
-                s->first_slice = 1;
-                last_code      = PICTURE_START_CODE;
-            } else {
-                av_log(avctx, AV_LOG_ERROR,
-                       "ignoring pic after %X\n", last_code);
-                if (avctx->err_recognition & AV_EF_EXPLODE)
-                    return AVERROR_INVALIDDATA;
-            }
-            break;
-        case EXT_START_CODE:
-            init_get_bits(&s2->gb, buf_ptr, input_size * 8);
-
-            switch (get_bits(&s2->gb, 4)) {
-            case 0x1:
-                if (last_code == 0) {
-                    mpeg_decode_sequence_extension(s);
-                } else {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "ignoring seq ext after %X\n", last_code);
-                    if (avctx->err_recognition & AV_EF_EXPLODE)
-                        return AVERROR_INVALIDDATA;
-                }
-                break;
-            case 0x2:
-                mpeg_decode_sequence_display_extension(s);
-                break;
-            case 0x3:
-                mpeg_decode_quant_matrix_extension(s2);
-                break;
-            case 0x7:
-                mpeg_decode_picture_display_extension(s);
-                break;
-            case 0x8:
-                if (last_code == PICTURE_START_CODE) {
-                    mpeg_decode_picture_coding_extension(s);
-                } else {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "ignoring pic cod ext after %X\n", last_code);
-                    if (avctx->err_recognition & AV_EF_EXPLODE)
-                        return AVERROR_INVALIDDATA;
-                }
-                break;
-            }
-            break;
-        case USER_START_CODE:
-            mpeg_decode_user_data(avctx, buf_ptr, input_size);
-            break;
-        case GOP_START_CODE:
-            if (last_code == 0) {
-                s2->first_field = 0;
-                mpeg_decode_gop(avctx, buf_ptr, input_size);
-                s->sync = 1;
-            } else {
-                av_log(avctx, AV_LOG_ERROR,
-                       "ignoring GOP_START_CODE after %X\n", last_code);
-                if (avctx->err_recognition & AV_EF_EXPLODE)
-                    return AVERROR_INVALIDDATA;
-            }
-            break;
-        default:
-            if (start_code >= SLICE_MIN_START_CODE &&
-                start_code <= SLICE_MAX_START_CODE && last_code != 0) {
-                const int field_pic = s2->picture_structure != PICT_FRAME;
-                int mb_y = (start_code - SLICE_MIN_START_CODE) << field_pic;
-                last_code = SLICE_MIN_START_CODE;
-
-                if (s2->picture_structure == PICT_BOTTOM_FIELD)
-                    mb_y++;
-
-                if (mb_y >= s2->mb_height) {
-                    av_log(s2->avctx, AV_LOG_ERROR,
-                           "slice below image (%d >= %d)\n", mb_y, s2->mb_height);
-                    return -1;
-                }
-
-                if (s2->last_picture_ptr == NULL) {
-                    /* Skip B-frames if we do not have reference frames and
-                     * GOP is not closed. */
-                    if (s2->pict_type == AV_PICTURE_TYPE_B) {
-                        if (!s->closed_gop) {
-                            skip_frame = 1;
-                            break;
-                        }
-                    }
-                }
-                if (s2->pict_type == AV_PICTURE_TYPE_I)
-                    s->sync = 1;
-                if (s2->next_picture_ptr == NULL) {
-                    /* Skip P-frames if we do not have a reference frame or
-                     * we have an invalid header. */
-                    if (s2->pict_type == AV_PICTURE_TYPE_P && !s->sync) {
-                        skip_frame = 1;
-                        break;
-                    }
-                }
-                if ((avctx->skip_frame >= AVDISCARD_NONREF &&
-                     s2->pict_type == AV_PICTURE_TYPE_B) ||
-                    (avctx->skip_frame >= AVDISCARD_NONKEY &&
-                     s2->pict_type != AV_PICTURE_TYPE_I) ||
-                    avctx->skip_frame >= AVDISCARD_ALL) {
-                    skip_frame = 1;
-                    break;
-                }
-
-                if (!s->mpeg_enc_ctx_allocated)
-                    break;
-
-                if (s2->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-                    if (mb_y < avctx->skip_top ||
-                        mb_y >= s2->mb_height - avctx->skip_bottom)
-                        break;
-                }
-
-                if (!s2->pict_type) {
-                    av_log(avctx, AV_LOG_ERROR, "Missing picture start code\n");
-                    if (avctx->err_recognition & AV_EF_EXPLODE)
-                        return AVERROR_INVALIDDATA;
-                    break;
-                }
-
-                if (s->first_slice) {
-                    skip_frame     = 0;
-                    s->first_slice = 0;
-                    if (mpeg_field_start(s2, buf, buf_size) < 0)
-                        return -1;
-                }
-                if (!s2->current_picture_ptr) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "current_picture not initialized\n");
-                    return AVERROR_INVALIDDATA;
-                }
-
-                if (HAVE_THREADS &&
-                    (avctx->active_thread_type & FF_THREAD_SLICE) &&
-                    !avctx->hwaccel) {
-                    int threshold = (s2->mb_height * s->slice_count +
-                                     s2->slice_context_count / 2) /
-                                    s2->slice_context_count;
-                    if (threshold <= mb_y) {
-                        MpegEncContext *thread_context = s2->thread_context[s->slice_count];
-
-                        thread_context->start_mb_y = mb_y;
-                        thread_context->end_mb_y   = s2->mb_height;
-                        if (s->slice_count) {
-                            s2->thread_context[s->slice_count - 1]->end_mb_y = mb_y;
-                            ret = ff_update_duplicate_context(thread_context, s2);
-                            if (ret < 0)
-                                return ret;
-                        }
-                        init_get_bits(&thread_context->gb, buf_ptr, input_size * 8);
-                        s->slice_count++;
-                    }
-                    buf_ptr += 2; // FIXME add minimum number of bytes per slice
-                } else {
-                    ret = mpeg_decode_slice(s2, mb_y, &buf_ptr, input_size);
-                    emms_c();
-
-                    if (ret < 0) {
-                        if (avctx->err_recognition & AV_EF_EXPLODE)
-                            return ret;
-                        if (s2->resync_mb_x >= 0 && s2->resync_mb_y >= 0)
-                            ff_er_add_slice(&s2->er, s2->resync_mb_x,
-                                            s2->resync_mb_y, s2->mb_x, s2->mb_y,
-                                            ER_AC_ERROR | ER_DC_ERROR | ER_MV_ERROR);
-                    } else {
-                        ff_er_add_slice(&s2->er, s2->resync_mb_x,
-                                        s2->resync_mb_y, s2->mb_x - 1, s2->mb_y,
-                                        ER_AC_END | ER_DC_END | ER_MV_END);
-                    }
-                }
-            }
-            break;
-        }
-    }
-}
-
-static int mpeg_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_output, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    Mpeg1Context *s = avctx->priv_data;
-    AVFrame *picture = data;
-    MpegEncContext *s2 = &s->mpeg_enc_ctx;
-    av_dlog(avctx, "fill_buffer\n");
-
-    if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) {
-        /* special case for last picture */
-        if (s2->low_delay == 0 && s2->next_picture_ptr) {
-            int ret = av_frame_ref(picture, &s2->next_picture_ptr->f);
-            if (ret < 0)
-                return ret;
-
-            s2->next_picture_ptr = NULL;
-
-            *got_output = 1;
-        }
-        return buf_size;
-    }
-
-    if (s2->flags & CODEC_FLAG_TRUNCATED) {
-        int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf,
-                                           buf_size, NULL);
-
-        if (ff_combine_frame(&s2->parse_context, next,
-                             (const uint8_t **) &buf, &buf_size) < 0)
-            return buf_size;
-    }
-
-    if (s->mpeg_enc_ctx_allocated == 0 && avctx->codec_tag == AV_RL32("VCR2"))
-        vcr2_init_sequence(avctx);
-
-    s->slice_count = 0;
-
-    if (avctx->extradata && !s->extradata_decoded) {
-        int ret = decode_chunks(avctx, picture, got_output,
-                                avctx->extradata, avctx->extradata_size);
-        s->extradata_decoded = 1;
-        if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
-            return ret;
-    }
-
-    return decode_chunks(avctx, picture, got_output, buf, buf_size);
-}
-
-static void flush(AVCodecContext *avctx)
-{
-    Mpeg1Context *s = avctx->priv_data;
-
-    s->sync       = 0;
-    s->closed_gop = 0;
-
-    ff_mpeg_flush(avctx);
-}
-
-static av_cold int mpeg_decode_end(AVCodecContext *avctx)
-{
-    Mpeg1Context *s = avctx->priv_data;
-
-    if (s->mpeg_enc_ctx_allocated)
-        ff_MPV_common_end(&s->mpeg_enc_ctx);
-    av_freep(&s->a53_caption);
-    return 0;
-}
-
-static const AVProfile mpeg2_video_profiles[] = {
-    { FF_PROFILE_MPEG2_422,          "4:2:2"              },
-    { FF_PROFILE_MPEG2_HIGH,         "High"               },
-    { FF_PROFILE_MPEG2_SS,           "Spatially Scalable" },
-    { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable"       },
-    { FF_PROFILE_MPEG2_MAIN,         "Main"               },
-    { FF_PROFILE_MPEG2_SIMPLE,       "Simple"             },
-    { FF_PROFILE_RESERVED,           "Reserved"           },
-    { FF_PROFILE_RESERVED,           "Reserved"           },
-    { FF_PROFILE_UNKNOWN                                  },
-};
-
-AVCodec ff_mpeg1video_decoder = {
-    .name                  = "mpeg1video",
-    .long_name             = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_MPEG1VIDEO,
-    .priv_data_size        = sizeof(Mpeg1Context),
-    .init                  = mpeg_decode_init,
-    .close                 = mpeg_decode_end,
-    .decode                = mpeg_decode_frame,
-    .capabilities          = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
-                             CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
-                             CODEC_CAP_SLICE_THREADS,
-    .flush                 = flush,
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg_decode_update_thread_context)
-};
-
-AVCodec ff_mpeg2video_decoder = {
-    .name           = "mpeg2video",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-2 video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG2VIDEO,
-    .priv_data_size = sizeof(Mpeg1Context),
-    .init           = mpeg_decode_init,
-    .close          = mpeg_decode_end,
-    .decode         = mpeg_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
-                      CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
-                      CODEC_CAP_SLICE_THREADS,
-    .flush          = flush,
-    .profiles       = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles),
-};
-
-#if FF_API_XVMC
-#if CONFIG_MPEG_XVMC_DECODER
-static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx)
-{
-    if (avctx->active_thread_type & FF_THREAD_SLICE)
-        return -1;
-    if (!(avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
-        return -1;
-    if (!(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) {
-        av_dlog(avctx, "mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n");
-    }
-    mpeg_decode_init(avctx);
-
-    avctx->pix_fmt           = AV_PIX_FMT_XVMC_MPEG2_IDCT;
-    avctx->xvmc_acceleration = 2; // 2 - the blocks are packed!
-
-    return 0;
-}
-
-AVCodec ff_mpeg_xvmc_decoder = {
-    .name           = "mpegvideo_xvmc",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-1/2 video XvMC (X-Video Motion Compensation)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG2VIDEO_XVMC,
-    .priv_data_size = sizeof(Mpeg1Context),
-    .init           = mpeg_mc_decode_init,
-    .close          = mpeg_decode_end,
-    .decode         = mpeg_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
-                      CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL | CODEC_CAP_DELAY,
-    .flush          = flush,
-};
-
-#endif
-#endif /* FF_API_XVMC */
diff --git a/deps/libav/libavcodec/mpeg12enc.c b/deps/libav/libavcodec/mpeg12enc.c
deleted file mode 100644
index 6c4ef6d..0000000
--- a/deps/libav/libavcodec/mpeg12enc.c
+++ /dev/null
@@ -1,1097 +0,0 @@
-/*
- * MPEG1/2 encoder
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG1/2 encoder
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/stereo3d.h"
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "mathops.h"
-#include "mpeg12.h"
-#include "mpeg12data.h"
-#include "mpegvideo.h"
-
-
-static const uint8_t inv_non_linear_qscale[] = {
-    0, 2, 4, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16,
-};
-
-static const uint8_t svcd_scan_offset_placeholder[] = {
-    0x10, 0x0E, 0x00, 0x80, 0x81, 0x00, 0x80,
-    0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-};
-
-static uint8_t mv_penalty[MAX_FCODE + 1][MAX_MV * 2 + 1];
-static uint8_t fcode_tab[MAX_MV * 2 + 1];
-
-static uint8_t uni_mpeg1_ac_vlc_len[64 * 64 * 2];
-static uint8_t uni_mpeg2_ac_vlc_len[64 * 64 * 2];
-
-/* simple include everything table for dc, first byte is bits
- * number next 3 are code */
-static uint32_t mpeg1_lum_dc_uni[512];
-static uint32_t mpeg1_chr_dc_uni[512];
-
-static uint8_t mpeg1_index_run[2][64];
-static int8_t  mpeg1_max_level[2][64];
-
-static av_cold void init_uni_ac_vlc(RLTable *rl, uint8_t *uni_ac_vlc_len)
-{
-    int i;
-
-    for (i = 0; i < 128; i++) {
-        int level = i - 64;
-        int run;
-        if (!level)
-            continue;
-        for (run = 0; run < 64; run++) {
-            int len, code;
-            int alevel = FFABS(level);
-
-            if (alevel > rl->max_level[0][run])
-                code = 111;                         /* rl->n */
-            else
-                code = rl->index_run[0][run] + alevel - 1;
-
-            if (code < 111) {                       /* rl->n */
-                /* length of VLC and sign */
-                len = rl->table_vlc[code][1] + 1;
-            } else {
-                len = rl->table_vlc[111][1] + 6;    /* rl->n */
-
-                if (alevel < 128)
-                    len += 8;
-                else
-                    len += 16;
-            }
-
-            uni_ac_vlc_len[UNI_AC_ENC_INDEX(run, i)] = len;
-        }
-    }
-}
-
-static int find_frame_rate_index(MpegEncContext *s)
-{
-    int i;
-    int64_t dmin = INT64_MAX;
-    int64_t d;
-
-    for (i = 1; i < 14; i++) {
-        int64_t n0 = 1001LL / ff_mpeg12_frame_rate_tab[i].den *
-                     ff_mpeg12_frame_rate_tab[i].num * s->avctx->time_base.num;
-        int64_t n1 = 1001LL * s->avctx->time_base.den;
-
-        if (s->avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL &&
-            i >= 9)
-            break;
-
-        d = FFABS(n0 - n1);
-        if (d < dmin) {
-            dmin                = d;
-            s->frame_rate_index = i;
-        }
-    }
-
-    if (dmin)
-        return -1;
-    else
-        return 0;
-}
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    MpegEncContext *s = avctx->priv_data;
-
-    if (ff_MPV_encode_init(avctx) < 0)
-        return -1;
-
-    if (find_frame_rate_index(s) < 0) {
-        if (s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
-            av_log(avctx, AV_LOG_ERROR, "MPEG1/2 does not support %d/%d fps\n",
-                   avctx->time_base.den, avctx->time_base.num);
-            return -1;
-        } else {
-            av_log(avctx, AV_LOG_INFO,
-                   "MPEG1/2 does not support %d/%d fps, there may be AV sync issues\n",
-                   avctx->time_base.den, avctx->time_base.num);
-        }
-    }
-
-    if (avctx->profile == FF_PROFILE_UNKNOWN) {
-        if (avctx->level != FF_LEVEL_UNKNOWN) {
-            av_log(avctx, AV_LOG_ERROR, "Set profile and level\n");
-            return -1;
-        }
-        /* Main or 4:2:2 */
-        avctx->profile = s->chroma_format == CHROMA_420 ? 4 : 0;
-    }
-
-    if (avctx->level == FF_LEVEL_UNKNOWN) {
-        if (avctx->profile == 0) {                  /* 4:2:2 */
-            if (avctx->width <= 720 && avctx->height <= 608)
-                avctx->level = 5;                   /* Main */
-            else
-                avctx->level = 2;                   /* High */
-        } else {
-            if (avctx->profile != 1 && s->chroma_format != CHROMA_420) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Only High(1) and 4:2:2(0) profiles support 4:2:2 color sampling\n");
-                return -1;
-            }
-            if (avctx->width <= 720 && avctx->height <= 576)
-                avctx->level = 8;                   /* Main */
-            else if (avctx->width <= 1440)
-                avctx->level = 6;                   /* High 1440 */
-            else
-                avctx->level = 4;                   /* High */
-        }
-    }
-
-    if (s->drop_frame_timecode && s->frame_rate_index != 4) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Drop frame time code only allowed with 1001/30000 fps\n");
-        return -1;
-    }
-
-    return 0;
-}
-
-static void put_header(MpegEncContext *s, int header)
-{
-    avpriv_align_put_bits(&s->pb);
-    put_bits(&s->pb, 16, header >> 16);
-    put_sbits(&s->pb, 16, header);
-}
-
-/* put sequence header if needed */
-static void mpeg1_encode_sequence_header(MpegEncContext *s)
-{
-    unsigned int vbv_buffer_size, fps, v;
-    int i, constraint_parameter_flag;
-    uint64_t time_code;
-    float best_aspect_error = 1E10;
-    float aspect_ratio      = av_q2d(s->avctx->sample_aspect_ratio);
-
-    if (aspect_ratio == 0.0)
-        aspect_ratio = 1.0;             // pixel aspect 1.1 (VGA)
-
-    if (s->current_picture.f.key_frame) {
-        AVRational framerate = ff_mpeg12_frame_rate_tab[s->frame_rate_index];
-
-        /* mpeg1 header repeated every gop */
-        put_header(s, SEQ_START_CODE);
-
-        put_sbits(&s->pb, 12, s->width);
-        put_sbits(&s->pb, 12, s->height);
-
-        for (i = 1; i < 15; i++) {
-            float error = aspect_ratio;
-            if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO || i <= 1)
-                error -= 1.0 / ff_mpeg1_aspect[i];
-            else
-                error -= av_q2d(ff_mpeg2_aspect[i]) * s->height / s->width;
-
-            error = FFABS(error);
-
-            if (error < best_aspect_error) {
-                best_aspect_error    = error;
-                s->aspect_ratio_info = i;
-            }
-        }
-
-        put_bits(&s->pb, 4, s->aspect_ratio_info);
-        put_bits(&s->pb, 4, s->frame_rate_index);
-
-        if (s->avctx->rc_max_rate) {
-            v = (s->avctx->rc_max_rate + 399) / 400;
-            if (v > 0x3ffff && s->codec_id == AV_CODEC_ID_MPEG1VIDEO)
-                v = 0x3ffff;
-        } else {
-            v = 0x3FFFF;
-        }
-
-        if (s->avctx->rc_buffer_size)
-            vbv_buffer_size = s->avctx->rc_buffer_size;
-        else
-            /* VBV calculation: Scaled so that a VCD has the proper
-             * VBV size of 40 kilobytes */
-            vbv_buffer_size = ((20 * s->bit_rate) / (1151929 / 2)) * 8 * 1024;
-        vbv_buffer_size = (vbv_buffer_size + 16383) / 16384;
-
-        put_sbits(&s->pb, 18, v);
-        put_bits(&s->pb, 1, 1);         // marker
-        put_sbits(&s->pb, 10, vbv_buffer_size);
-
-        constraint_parameter_flag =
-            s->width  <= 768                                    &&
-            s->height <= 576                                    &&
-            s->mb_width * s->mb_height                 <= 396   &&
-            s->mb_width * s->mb_height * framerate.num <= 396 * 25 * framerate.den &&
-            framerate.num <= framerate.den * 30                 &&
-            s->avctx->me_range                                  &&
-            s->avctx->me_range < 128                            &&
-            vbv_buffer_size <= 20                               &&
-            v <= 1856000 / 400                                  &&
-            s->codec_id == AV_CODEC_ID_MPEG1VIDEO;
-
-        put_bits(&s->pb, 1, constraint_parameter_flag);
-
-        ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix);
-        ff_write_quant_matrix(&s->pb, s->avctx->inter_matrix);
-
-        if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-            put_header(s, EXT_START_CODE);
-            put_bits(&s->pb, 4, 1);                 // seq ext
-
-            put_bits(&s->pb, 1, s->avctx->profile == 0); // escx 1 for 4:2:2 profile
-
-            put_bits(&s->pb, 3, s->avctx->profile); // profile
-            put_bits(&s->pb, 4, s->avctx->level);   // level
-
-            put_bits(&s->pb, 1, s->progressive_sequence);
-            put_bits(&s->pb, 2, s->chroma_format);
-            put_bits(&s->pb, 2, s->width  >> 12);
-            put_bits(&s->pb, 2, s->height >> 12);
-            put_bits(&s->pb, 12, v >> 18);          // bitrate ext
-            put_bits(&s->pb, 1, 1);                 // marker
-            put_bits(&s->pb, 8, vbv_buffer_size >> 10); // vbv buffer ext
-            put_bits(&s->pb, 1, s->low_delay);
-            put_bits(&s->pb, 2, 0);                 // frame_rate_ext_n
-            put_bits(&s->pb, 5, 0);                 // frame_rate_ext_d
-        }
-
-        put_header(s, GOP_START_CODE);
-        put_bits(&s->pb, 1, s->drop_frame_timecode);    // drop frame flag
-        /* time code: we must convert from the real frame rate to a
-         * fake MPEG frame rate in case of low frame rate */
-        fps       = (framerate.num + framerate.den / 2) / framerate.den;
-        time_code = s->current_picture_ptr->f.coded_picture_number +
-                    s->avctx->timecode_frame_start;
-
-        s->gop_picture_number = s->current_picture_ptr->f.coded_picture_number;
-        if (s->drop_frame_timecode) {
-            /* only works for NTSC 29.97 */
-            int d = time_code / 17982;
-            int m = time_code % 17982;
-            /* not needed since -2,-1 / 1798 in C returns 0 */
-            // if (m < 2)
-            //     m += 2;
-            time_code += 18 * d + 2 * ((m - 2) / 1798);
-        }
-        put_bits(&s->pb, 5, (uint32_t)((time_code / (fps * 3600)) % 24));
-        put_bits(&s->pb, 6, (uint32_t)((time_code / (fps *   60)) % 60));
-        put_bits(&s->pb, 1, 1);
-        put_bits(&s->pb, 6, (uint32_t)((time_code / fps) % 60));
-        put_bits(&s->pb, 6, (uint32_t)((time_code % fps)));
-        put_bits(&s->pb, 1, !!(s->flags & CODEC_FLAG_CLOSED_GOP));
-        put_bits(&s->pb, 1, 0);                     // broken link
-    }
-}
-
-static inline void encode_mb_skip_run(MpegEncContext *s, int run)
-{
-    while (run >= 33) {
-        put_bits(&s->pb, 11, 0x008);
-        run -= 33;
-    }
-    put_bits(&s->pb, ff_mpeg12_mbAddrIncrTable[run][1],
-             ff_mpeg12_mbAddrIncrTable[run][0]);
-}
-
-static av_always_inline void put_qscale(MpegEncContext *s)
-{
-    if (s->q_scale_type) {
-        assert(s->qscale >= 1 && s->qscale <= 12);
-        put_bits(&s->pb, 5, inv_non_linear_qscale[s->qscale]);
-    } else {
-        put_bits(&s->pb, 5, s->qscale);
-    }
-}
-
-void ff_mpeg1_encode_slice_header(MpegEncContext *s)
-{
-    if (s->height > 2800) {
-        put_header(s, SLICE_MIN_START_CODE + (s->mb_y & 127));
-        /* slice_vertical_position_extension */
-        put_bits(&s->pb, 3, s->mb_y >> 7);
-    } else {
-        put_header(s, SLICE_MIN_START_CODE + s->mb_y);
-    }
-    put_qscale(s);
-    /* slice extra information */
-    put_bits(&s->pb, 1, 0);
-}
-
-void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
-{
-    AVFrameSideData *side_data;
-    mpeg1_encode_sequence_header(s);
-
-    /* mpeg1 picture header */
-    put_header(s, PICTURE_START_CODE);
-    /* temporal reference */
-
-    // RAL: s->picture_number instead of s->fake_picture_number
-    put_bits(&s->pb, 10,
-             (s->picture_number - s->gop_picture_number) & 0x3ff);
-    put_bits(&s->pb, 3, s->pict_type);
-
-    s->vbv_delay_ptr = s->pb.buf + put_bits_count(&s->pb) / 8;
-    put_bits(&s->pb, 16, 0xFFFF);               /* vbv_delay */
-
-    // RAL: Forward f_code also needed for B-frames
-    if (s->pict_type == AV_PICTURE_TYPE_P ||
-        s->pict_type == AV_PICTURE_TYPE_B) {
-        put_bits(&s->pb, 1, 0);                 /* half pel coordinates */
-        if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO)
-            put_bits(&s->pb, 3, s->f_code);     /* forward_f_code */
-        else
-            put_bits(&s->pb, 3, 7);             /* forward_f_code */
-    }
-
-    // RAL: Backward f_code necessary for B-frames
-    if (s->pict_type == AV_PICTURE_TYPE_B) {
-        put_bits(&s->pb, 1, 0);                 /* half pel coordinates */
-        if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO)
-            put_bits(&s->pb, 3, s->b_code);     /* backward_f_code */
-        else
-            put_bits(&s->pb, 3, 7);             /* backward_f_code */
-    }
-
-    put_bits(&s->pb, 1, 0);                     /* extra bit picture */
-
-    s->frame_pred_frame_dct = 1;
-    if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-        put_header(s, EXT_START_CODE);
-        put_bits(&s->pb, 4, 8);                 /* pic ext */
-        if (s->pict_type == AV_PICTURE_TYPE_P ||
-            s->pict_type == AV_PICTURE_TYPE_B) {
-            put_bits(&s->pb, 4, s->f_code);
-            put_bits(&s->pb, 4, s->f_code);
-        } else {
-            put_bits(&s->pb, 8, 255);
-        }
-        if (s->pict_type == AV_PICTURE_TYPE_B) {
-            put_bits(&s->pb, 4, s->b_code);
-            put_bits(&s->pb, 4, s->b_code);
-        } else {
-            put_bits(&s->pb, 8, 255);
-        }
-        put_bits(&s->pb, 2, s->intra_dc_precision);
-
-        assert(s->picture_structure == PICT_FRAME);
-        put_bits(&s->pb, 2, s->picture_structure);
-        if (s->progressive_sequence)
-            put_bits(&s->pb, 1, 0);             /* no repeat */
-        else
-            put_bits(&s->pb, 1, s->current_picture_ptr->f.top_field_first);
-        /* XXX: optimize the generation of this flag with entropy measures */
-        s->frame_pred_frame_dct = s->progressive_sequence;
-
-        put_bits(&s->pb, 1, s->frame_pred_frame_dct);
-        put_bits(&s->pb, 1, s->concealment_motion_vectors);
-        put_bits(&s->pb, 1, s->q_scale_type);
-        put_bits(&s->pb, 1, s->intra_vlc_format);
-        put_bits(&s->pb, 1, s->alternate_scan);
-        put_bits(&s->pb, 1, s->repeat_first_field);
-        s->progressive_frame = s->progressive_sequence;
-        /* chroma_420_type */
-        put_bits(&s->pb, 1, s->chroma_format ==
-                            CHROMA_420 ? s->progressive_frame : 0);
-        put_bits(&s->pb, 1, s->progressive_frame);
-        put_bits(&s->pb, 1, 0);                 /* composite_display_flag */
-    }
-    if (s->scan_offset) {
-        int i;
-
-        put_header(s, USER_START_CODE);
-        for (i = 0; i < sizeof(svcd_scan_offset_placeholder); i++)
-            put_bits(&s->pb, 8, svcd_scan_offset_placeholder[i]);
-    }
-    side_data = av_frame_get_side_data(&s->current_picture_ptr->f,
-                                       AV_FRAME_DATA_STEREO3D);
-    if (side_data) {
-        AVStereo3D *stereo = (AVStereo3D *)side_data->data;
-        uint8_t fpa_type;
-
-        switch (stereo->type) {
-        case AV_STEREO3D_SIDEBYSIDE:
-            fpa_type = 0x03;
-            break;
-        case AV_STEREO3D_TOPBOTTOM:
-            fpa_type = 0x04;
-            break;
-        case AV_STEREO3D_2D:
-            fpa_type = 0x08;
-            break;
-        case AV_STEREO3D_SIDEBYSIDE_QUINCUNX:
-            fpa_type = 0x23;
-            break;
-        default:
-            fpa_type = 0;
-            break;
-        }
-
-        if (fpa_type != 0) {
-            put_header(s, USER_START_CODE);
-            put_bits(&s->pb, 8, 'J');   // S3D_video_format_signaling_identifier
-            put_bits(&s->pb, 8, 'P');
-            put_bits(&s->pb, 8, '3');
-            put_bits(&s->pb, 8, 'D');
-            put_bits(&s->pb, 8, 0x03);  // S3D_video_format_length
-
-            put_bits(&s->pb, 1, 1);     // reserved_bit
-            put_bits(&s->pb, 7, fpa_type); // S3D_video_format_type
-            put_bits(&s->pb, 8, 0x04);  // reserved_data[0]
-            put_bits(&s->pb, 8, 0xFF);  // reserved_data[1]
-        }
-    }
-
-    s->mb_y = 0;
-    ff_mpeg1_encode_slice_header(s);
-}
-
-static inline void put_mb_modes(MpegEncContext *s, int n, int bits,
-                                int has_mv, int field_motion)
-{
-    put_bits(&s->pb, n, bits);
-    if (!s->frame_pred_frame_dct) {
-        if (has_mv)
-            /* motion_type: frame/field */
-            put_bits(&s->pb, 2, 2 - field_motion);
-        put_bits(&s->pb, 1, s->interlaced_dct);
-    }
-}
-
-// RAL: Parameter added: f_or_b_code
-static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code)
-{
-    if (val == 0) {
-        /* zero vector */
-        put_bits(&s->pb,
-                 ff_mpeg12_mbMotionVectorTable[0][1],
-                 ff_mpeg12_mbMotionVectorTable[0][0]);
-    } else {
-        int code, sign, bits;
-        int bit_size = f_or_b_code - 1;
-        int range    = 1 << bit_size;
-        /* modulo encoding */
-        val = sign_extend(val, 5 + bit_size);
-
-        if (val >= 0) {
-            val--;
-            code = (val >> bit_size) + 1;
-            bits = val & (range - 1);
-            sign = 0;
-        } else {
-            val = -val;
-            val--;
-            code = (val >> bit_size) + 1;
-            bits = val & (range - 1);
-            sign = 1;
-        }
-
-        assert(code > 0 && code <= 16);
-
-        put_bits(&s->pb,
-                 ff_mpeg12_mbMotionVectorTable[code][1],
-                 ff_mpeg12_mbMotionVectorTable[code][0]);
-
-        put_bits(&s->pb, 1, sign);
-        if (bit_size > 0)
-            put_bits(&s->pb, bit_size, bits);
-    }
-}
-
-static inline void encode_dc(MpegEncContext *s, int diff, int component)
-{
-    if (((unsigned) (diff + 255)) >= 511) {
-        int index;
-
-        if (diff < 0) {
-            index = av_log2_16bit(-2 * diff);
-            diff--;
-        } else {
-            index = av_log2_16bit(2 * diff);
-        }
-        if (component == 0)
-            put_bits(&s->pb,
-                     ff_mpeg12_vlc_dc_lum_bits[index] + index,
-                     (ff_mpeg12_vlc_dc_lum_code[index] << index) +
-                     (diff & ((1 << index) - 1)));
-        else
-            put_bits(&s->pb,
-                     ff_mpeg12_vlc_dc_chroma_bits[index] + index,
-                     (ff_mpeg12_vlc_dc_chroma_code[index] << index) +
-                     (diff & ((1 << index) - 1)));
-    } else {
-        if (component == 0)
-            put_bits(&s->pb,
-                     mpeg1_lum_dc_uni[diff + 255] & 0xFF,
-                     mpeg1_lum_dc_uni[diff + 255] >> 8);
-        else
-            put_bits(&s->pb,
-                     mpeg1_chr_dc_uni[diff + 255] & 0xFF,
-                     mpeg1_chr_dc_uni[diff + 255] >> 8);
-    }
-}
-
-static void mpeg1_encode_block(MpegEncContext *s, int16_t *block, int n)
-{
-    int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign;
-    int code, component;
-    const uint16_t (*table_vlc)[2] = ff_rl_mpeg1.table_vlc;
-
-    last_index = s->block_last_index[n];
-
-    /* DC coef */
-    if (s->mb_intra) {
-        component = (n <= 3 ? 0 : (n & 1) + 1);
-        dc        = block[0];                   /* overflow is impossible */
-        diff      = dc - s->last_dc[component];
-        encode_dc(s, diff, component);
-        s->last_dc[component] = dc;
-        i = 1;
-        if (s->intra_vlc_format)
-            table_vlc = ff_rl_mpeg2.table_vlc;
-    } else {
-        /* encode the first coefficient: needs to be done here because
-         * it is handled slightly differently */
-        level = block[0];
-        if (abs(level) == 1) {
-            code = ((uint32_t)level >> 31);     /* the sign bit */
-            put_bits(&s->pb, 2, code | 0x02);
-            i = 1;
-        } else {
-            i             = 0;
-            last_non_zero = -1;
-            goto next_coef;
-        }
-    }
-
-    /* now quantify & encode AC coefs */
-    last_non_zero = i - 1;
-
-    for (; i <= last_index; i++) {
-        j     = s->intra_scantable.permutated[i];
-        level = block[j];
-
-next_coef:
-        /* encode using VLC */
-        if (level != 0) {
-            run = i - last_non_zero - 1;
-
-            alevel = level;
-            MASK_ABS(sign, alevel);
-            sign &= 1;
-
-            if (alevel <= mpeg1_max_level[0][run]) {
-                code = mpeg1_index_run[0][run] + alevel - 1;
-                /* store the VLC & sign at once */
-                put_bits(&s->pb, table_vlc[code][1] + 1,
-                         (table_vlc[code][0] << 1) + sign);
-            } else {
-                /* escape seems to be pretty rare <5% so I do not optimize it */
-                put_bits(&s->pb, table_vlc[111][1], table_vlc[111][0]);
-                /* escape: only clip in this case */
-                put_bits(&s->pb, 6, run);
-                if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
-                    if (alevel < 128) {
-                        put_sbits(&s->pb, 8, level);
-                    } else {
-                        if (level < 0)
-                            put_bits(&s->pb, 16, 0x8001 + level + 255);
-                        else
-                            put_sbits(&s->pb, 16, level);
-                    }
-                } else {
-                    put_sbits(&s->pb, 12, level);
-                }
-            }
-            last_non_zero = i;
-        }
-    }
-    /* end of block */
-    put_bits(&s->pb, table_vlc[112][1], table_vlc[112][0]);
-}
-
-static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
-                                                      int16_t block[6][64],
-                                                      int motion_x, int motion_y,
-                                                      int mb_block_count)
-{
-    int i, cbp;
-    const int mb_x     = s->mb_x;
-    const int mb_y     = s->mb_y;
-    const int first_mb = mb_x == s->resync_mb_x && mb_y == s->resync_mb_y;
-
-    /* compute cbp */
-    cbp = 0;
-    for (i = 0; i < mb_block_count; i++)
-        if (s->block_last_index[i] >= 0)
-            cbp |= 1 << (mb_block_count - 1 - i);
-
-    if (cbp == 0 && !first_mb && s->mv_type == MV_TYPE_16X16 &&
-        (mb_x != s->mb_width - 1 ||
-         (mb_y != s->mb_height - 1 && s->codec_id == AV_CODEC_ID_MPEG1VIDEO)) &&
-        ((s->pict_type == AV_PICTURE_TYPE_P && (motion_x | motion_y) == 0) ||
-         (s->pict_type == AV_PICTURE_TYPE_B && s->mv_dir == s->last_mv_dir &&
-          (((s->mv_dir & MV_DIR_FORWARD)
-            ? ((s->mv[0][0][0] - s->last_mv[0][0][0]) |
-               (s->mv[0][0][1] - s->last_mv[0][0][1])) : 0) |
-           ((s->mv_dir & MV_DIR_BACKWARD)
-            ? ((s->mv[1][0][0] - s->last_mv[1][0][0]) |
-               (s->mv[1][0][1] - s->last_mv[1][0][1])) : 0)) == 0))) {
-        s->mb_skip_run++;
-        s->qscale -= s->dquant;
-        s->skip_count++;
-        s->misc_bits++;
-        s->last_bits++;
-        if (s->pict_type == AV_PICTURE_TYPE_P) {
-            s->last_mv[0][0][0] =
-            s->last_mv[0][0][1] =
-            s->last_mv[0][1][0] =
-            s->last_mv[0][1][1] = 0;
-        }
-    } else {
-        if (first_mb) {
-            assert(s->mb_skip_run == 0);
-            encode_mb_skip_run(s, s->mb_x);
-        } else {
-            encode_mb_skip_run(s, s->mb_skip_run);
-        }
-
-        if (s->pict_type == AV_PICTURE_TYPE_I) {
-            if (s->dquant && cbp) {
-                /* macroblock_type: macroblock_quant = 1 */
-                put_mb_modes(s, 2, 1, 0, 0);
-                put_qscale(s);
-            } else {
-                /* macroblock_type: macroblock_quant = 0 */
-                put_mb_modes(s, 1, 1, 0, 0);
-                s->qscale -= s->dquant;
-            }
-            s->misc_bits += get_bits_diff(s);
-            s->i_count++;
-        } else if (s->mb_intra) {
-            if (s->dquant && cbp) {
-                put_mb_modes(s, 6, 0x01, 0, 0);
-                put_qscale(s);
-            } else {
-                put_mb_modes(s, 5, 0x03, 0, 0);
-                s->qscale -= s->dquant;
-            }
-            s->misc_bits += get_bits_diff(s);
-            s->i_count++;
-            memset(s->last_mv, 0, sizeof(s->last_mv));
-        } else if (s->pict_type == AV_PICTURE_TYPE_P) {
-            if (s->mv_type == MV_TYPE_16X16) {
-                if (cbp != 0) {
-                    if ((motion_x | motion_y) == 0) {
-                        if (s->dquant) {
-                            /* macroblock_pattern & quant */
-                            put_mb_modes(s, 5, 1, 0, 0);
-                            put_qscale(s);
-                        } else {
-                            /* macroblock_pattern only */
-                            put_mb_modes(s, 2, 1, 0, 0);
-                        }
-                        s->misc_bits += get_bits_diff(s);
-                    } else {
-                        if (s->dquant) {
-                            put_mb_modes(s, 5, 2, 1, 0);    /* motion + cbp */
-                            put_qscale(s);
-                        } else {
-                            put_mb_modes(s, 1, 1, 1, 0);    /* motion + cbp */
-                        }
-                        s->misc_bits += get_bits_diff(s);
-                        // RAL: f_code parameter added
-                        mpeg1_encode_motion(s,
-                                            motion_x - s->last_mv[0][0][0],
-                                            s->f_code);
-                        // RAL: f_code parameter added
-                        mpeg1_encode_motion(s,
-                                            motion_y - s->last_mv[0][0][1],
-                                            s->f_code);
-                        s->mv_bits += get_bits_diff(s);
-                    }
-                } else {
-                    put_bits(&s->pb, 3, 1);         /* motion only */
-                    if (!s->frame_pred_frame_dct)
-                        put_bits(&s->pb, 2, 2);     /* motion_type: frame */
-                    s->misc_bits += get_bits_diff(s);
-                    // RAL: f_code parameter added
-                    mpeg1_encode_motion(s,
-                                        motion_x - s->last_mv[0][0][0],
-                                        s->f_code);
-                    // RAL: f_code parameter added
-                    mpeg1_encode_motion(s,
-                                        motion_y - s->last_mv[0][0][1],
-                                        s->f_code);
-                    s->qscale  -= s->dquant;
-                    s->mv_bits += get_bits_diff(s);
-                }
-                s->last_mv[0][1][0] = s->last_mv[0][0][0] = motion_x;
-                s->last_mv[0][1][1] = s->last_mv[0][0][1] = motion_y;
-            } else {
-                assert(!s->frame_pred_frame_dct && s->mv_type == MV_TYPE_FIELD);
-
-                if (cbp) {
-                    if (s->dquant) {
-                        put_mb_modes(s, 5, 2, 1, 1);    /* motion + cbp */
-                        put_qscale(s);
-                    } else {
-                        put_mb_modes(s, 1, 1, 1, 1);    /* motion + cbp */
-                    }
-                } else {
-                    put_bits(&s->pb, 3, 1);             /* motion only */
-                    put_bits(&s->pb, 2, 1);             /* motion_type: field */
-                    s->qscale -= s->dquant;
-                }
-                s->misc_bits += get_bits_diff(s);
-                for (i = 0; i < 2; i++) {
-                    put_bits(&s->pb, 1, s->field_select[0][i]);
-                    mpeg1_encode_motion(s,
-                                        s->mv[0][i][0] - s->last_mv[0][i][0],
-                                        s->f_code);
-                    mpeg1_encode_motion(s,
-                                        s->mv[0][i][1] - (s->last_mv[0][i][1] >> 1),
-                                        s->f_code);
-                    s->last_mv[0][i][0] = s->mv[0][i][0];
-                    s->last_mv[0][i][1] = 2 * s->mv[0][i][1];
-                }
-                s->mv_bits += get_bits_diff(s);
-            }
-            if (cbp) {
-                if (s->chroma_y_shift) {
-                    put_bits(&s->pb,
-                             ff_mpeg12_mbPatTable[cbp][1],
-                             ff_mpeg12_mbPatTable[cbp][0]);
-                } else {
-                    put_bits(&s->pb,
-                             ff_mpeg12_mbPatTable[cbp >> 2][1],
-                             ff_mpeg12_mbPatTable[cbp >> 2][0]);
-                    put_sbits(&s->pb, 2, cbp);
-                }
-            }
-            s->f_count++;
-        } else {
-            if (s->mv_type == MV_TYPE_16X16) {
-                if (cbp) {                      // With coded bloc pattern
-                    if (s->dquant) {
-                        if (s->mv_dir == MV_DIR_FORWARD)
-                            put_mb_modes(s, 6, 3, 1, 0);
-                        else
-                            put_mb_modes(s, 8 - s->mv_dir, 2, 1, 0);
-                        put_qscale(s);
-                    } else {
-                        put_mb_modes(s, 5 - s->mv_dir, 3, 1, 0);
-                    }
-                } else {                        // No coded bloc pattern
-                    put_bits(&s->pb, 5 - s->mv_dir, 2);
-                    if (!s->frame_pred_frame_dct)
-                        put_bits(&s->pb, 2, 2); /* motion_type: frame */
-                    s->qscale -= s->dquant;
-                }
-                s->misc_bits += get_bits_diff(s);
-                if (s->mv_dir & MV_DIR_FORWARD) {
-                    mpeg1_encode_motion(s,
-                                        s->mv[0][0][0] - s->last_mv[0][0][0],
-                                        s->f_code);
-                    mpeg1_encode_motion(s,
-                                        s->mv[0][0][1] - s->last_mv[0][0][1],
-                                        s->f_code);
-                    s->last_mv[0][0][0] =
-                    s->last_mv[0][1][0] = s->mv[0][0][0];
-                    s->last_mv[0][0][1] =
-                    s->last_mv[0][1][1] = s->mv[0][0][1];
-                    s->f_count++;
-                }
-                if (s->mv_dir & MV_DIR_BACKWARD) {
-                    mpeg1_encode_motion(s,
-                                        s->mv[1][0][0] - s->last_mv[1][0][0],
-                                        s->b_code);
-                    mpeg1_encode_motion(s,
-                                        s->mv[1][0][1] - s->last_mv[1][0][1],
-                                        s->b_code);
-                    s->last_mv[1][0][0] =
-                    s->last_mv[1][1][0] = s->mv[1][0][0];
-                    s->last_mv[1][0][1] =
-                    s->last_mv[1][1][1] = s->mv[1][0][1];
-                    s->b_count++;
-                }
-            } else {
-                assert(s->mv_type == MV_TYPE_FIELD);
-                assert(!s->frame_pred_frame_dct);
-                if (cbp) {                      // With coded bloc pattern
-                    if (s->dquant) {
-                        if (s->mv_dir == MV_DIR_FORWARD)
-                            put_mb_modes(s, 6, 3, 1, 1);
-                        else
-                            put_mb_modes(s, 8 - s->mv_dir, 2, 1, 1);
-                        put_qscale(s);
-                    } else {
-                        put_mb_modes(s, 5 - s->mv_dir, 3, 1, 1);
-                    }
-                } else {                        // No coded bloc pattern
-                    put_bits(&s->pb, 5 - s->mv_dir, 2);
-                    put_bits(&s->pb, 2, 1);     /* motion_type: field */
-                    s->qscale -= s->dquant;
-                }
-                s->misc_bits += get_bits_diff(s);
-                if (s->mv_dir & MV_DIR_FORWARD) {
-                    for (i = 0; i < 2; i++) {
-                        put_bits(&s->pb, 1, s->field_select[0][i]);
-                        mpeg1_encode_motion(s,
-                                            s->mv[0][i][0] - s->last_mv[0][i][0],
-                                            s->f_code);
-                        mpeg1_encode_motion(s,
-                                            s->mv[0][i][1] - (s->last_mv[0][i][1] >> 1),
-                                            s->f_code);
-                        s->last_mv[0][i][0] = s->mv[0][i][0];
-                        s->last_mv[0][i][1] = s->mv[0][i][1] * 2;
-                    }
-                    s->f_count++;
-                }
-                if (s->mv_dir & MV_DIR_BACKWARD) {
-                    for (i = 0; i < 2; i++) {
-                        put_bits(&s->pb, 1, s->field_select[1][i]);
-                        mpeg1_encode_motion(s,
-                                            s->mv[1][i][0] - s->last_mv[1][i][0],
-                                            s->b_code);
-                        mpeg1_encode_motion(s,
-                                            s->mv[1][i][1] - (s->last_mv[1][i][1] >> 1),
-                                            s->b_code);
-                        s->last_mv[1][i][0] = s->mv[1][i][0];
-                        s->last_mv[1][i][1] = s->mv[1][i][1] * 2;
-                    }
-                    s->b_count++;
-                }
-            }
-            s->mv_bits += get_bits_diff(s);
-            if (cbp) {
-                if (s->chroma_y_shift) {
-                    put_bits(&s->pb,
-                             ff_mpeg12_mbPatTable[cbp][1],
-                             ff_mpeg12_mbPatTable[cbp][0]);
-                } else {
-                    put_bits(&s->pb,
-                             ff_mpeg12_mbPatTable[cbp >> 2][1],
-                             ff_mpeg12_mbPatTable[cbp >> 2][0]);
-                    put_sbits(&s->pb, 2, cbp);
-                }
-            }
-        }
-        for (i = 0; i < mb_block_count; i++)
-            if (cbp & (1 << (mb_block_count - 1 - i)))
-                mpeg1_encode_block(s, block[i], i);
-        s->mb_skip_run = 0;
-        if (s->mb_intra)
-            s->i_tex_bits += get_bits_diff(s);
-        else
-            s->p_tex_bits += get_bits_diff(s);
-    }
-}
-
-void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[6][64],
-                        int motion_x, int motion_y)
-{
-    if (s->chroma_format == CHROMA_420)
-        mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6);
-    else
-        mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8);
-}
-
-av_cold void ff_mpeg1_encode_init(MpegEncContext *s)
-{
-    static int done = 0;
-
-    ff_mpeg12_common_init(s);
-
-    if (!done) {
-        int f_code;
-        int mv;
-        int i;
-
-        done = 1;
-        ff_init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]);
-        ff_init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]);
-
-        for (i = 0; i < 64; i++) {
-            mpeg1_max_level[0][i] = ff_rl_mpeg1.max_level[0][i];
-            mpeg1_index_run[0][i] = ff_rl_mpeg1.index_run[0][i];
-        }
-
-        init_uni_ac_vlc(&ff_rl_mpeg1, uni_mpeg1_ac_vlc_len);
-        if (s->intra_vlc_format)
-            init_uni_ac_vlc(&ff_rl_mpeg2, uni_mpeg2_ac_vlc_len);
-
-        /* build unified dc encoding tables */
-        for (i = -255; i < 256; i++) {
-            int adiff, index;
-            int bits, code;
-            int diff = i;
-
-            adiff = FFABS(diff);
-            if (diff < 0)
-                diff--;
-            index = av_log2(2 * adiff);
-
-            bits = ff_mpeg12_vlc_dc_lum_bits[index] + index;
-            code = (ff_mpeg12_vlc_dc_lum_code[index] << index) +
-                   (diff & ((1 << index) - 1));
-            mpeg1_lum_dc_uni[i + 255] = bits + (code << 8);
-
-            bits = ff_mpeg12_vlc_dc_chroma_bits[index] + index;
-            code = (ff_mpeg12_vlc_dc_chroma_code[index] << index) +
-                   (diff & ((1 << index) - 1));
-            mpeg1_chr_dc_uni[i + 255] = bits + (code << 8);
-        }
-
-        for (f_code = 1; f_code <= MAX_FCODE; f_code++)
-            for (mv = -MAX_MV; mv <= MAX_MV; mv++) {
-                int len;
-
-                if (mv == 0) {
-                    len = ff_mpeg12_mbMotionVectorTable[0][1];
-                } else {
-                    int val, bit_size, code;
-
-                    bit_size = f_code - 1;
-
-                    val = mv;
-                    if (val < 0)
-                        val = -val;
-                    val--;
-                    code = (val >> bit_size) + 1;
-                    if (code < 17)
-                        len = ff_mpeg12_mbMotionVectorTable[code][1] +
-                              1 + bit_size;
-                    else
-                        len = ff_mpeg12_mbMotionVectorTable[16][1] +
-                              2 + bit_size;
-                }
-
-                mv_penalty[f_code][mv + MAX_MV] = len;
-            }
-
-
-        for (f_code = MAX_FCODE; f_code > 0; f_code--)
-            for (mv = -(8 << f_code); mv < (8 << f_code); mv++)
-                fcode_tab[mv + MAX_MV] = f_code;
-    }
-    s->me.mv_penalty = mv_penalty;
-    s->fcode_tab     = fcode_tab;
-    if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
-        s->min_qcoeff = -255;
-        s->max_qcoeff = 255;
-    } else {
-        s->min_qcoeff = -2047;
-        s->max_qcoeff = 2047;
-    }
-    if (s->intra_vlc_format) {
-        s->intra_ac_vlc_length      =
-        s->intra_ac_vlc_last_length = uni_mpeg2_ac_vlc_len;
-    } else {
-        s->intra_ac_vlc_length      =
-        s->intra_ac_vlc_last_length = uni_mpeg1_ac_vlc_len;
-    }
-    s->inter_ac_vlc_length      =
-    s->inter_ac_vlc_last_length = uni_mpeg1_ac_vlc_len;
-}
-
-#define OFFSET(x) offsetof(MpegEncContext, x)
-#define VE AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
-#define COMMON_OPTS                                                           \
-    { "intra_vlc",           "Use MPEG-2 intra VLC table.",                   \
-      OFFSET(intra_vlc_format),    AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, \
-    { "drop_frame_timecode", "Timecode is in drop frame format.",             \
-      OFFSET(drop_frame_timecode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, \
-    { "scan_offset",         "Reserve space for SVCD scan offset user data.", \
-      OFFSET(scan_offset),         AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
-
-static const AVOption mpeg1_options[] = {
-    COMMON_OPTS
-    FF_MPV_COMMON_OPTS
-    { NULL },
-};
-
-static const AVOption mpeg2_options[] = {
-    COMMON_OPTS
-    { "non_linear_quant", "Use nonlinear quantizer.",    OFFSET(q_scale_type),   AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
-    { "alternate_scan",   "Enable alternate scantable.", OFFSET(alternate_scan), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
-    FF_MPV_COMMON_OPTS
-    { NULL },
-};
-
-#define mpeg12_class(x)                                 \
-static const AVClass mpeg ## x ## _class = {            \
-    .class_name = "mpeg" # x "video encoder",           \
-    .item_name  = av_default_item_name,                 \
-    .option     = mpeg ## x ## _options,                \
-    .version    = LIBAVUTIL_VERSION_INT,                \
-};
-
-mpeg12_class(1)
-mpeg12_class(2)
-
-AVCodec ff_mpeg1video_encoder = {
-    .name                 = "mpeg1video",
-    .long_name            = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
-    .type                 = AVMEDIA_TYPE_VIDEO,
-    .id                   = AV_CODEC_ID_MPEG1VIDEO,
-    .priv_data_size       = sizeof(MpegEncContext),
-    .init                 = encode_init,
-    .encode2              = ff_MPV_encode_picture,
-    .close                = ff_MPV_encode_end,
-    .supported_framerates = ff_mpeg12_frame_rate_tab + 1,
-    .pix_fmts             = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
-                                                           AV_PIX_FMT_NONE },
-    .capabilities         = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
-    .priv_class           = &mpeg1_class,
-};
-
-AVCodec ff_mpeg2video_encoder = {
-    .name                 = "mpeg2video",
-    .long_name            = NULL_IF_CONFIG_SMALL("MPEG-2 video"),
-    .type                 = AVMEDIA_TYPE_VIDEO,
-    .id                   = AV_CODEC_ID_MPEG2VIDEO,
-    .priv_data_size       = sizeof(MpegEncContext),
-    .init                 = encode_init,
-    .encode2              = ff_MPV_encode_picture,
-    .close                = ff_MPV_encode_end,
-    .supported_framerates = ff_mpeg12_frame_rate_tab + 1,
-    .pix_fmts             = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
-                                                           AV_PIX_FMT_YUV422P,
-                                                           AV_PIX_FMT_NONE },
-    .capabilities         = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
-    .priv_class           = &mpeg2_class,
-};
diff --git a/deps/libav/libavcodec/mpeg4audio.c b/deps/libav/libavcodec/mpeg4audio.c
deleted file mode 100644
index 0fb9b96..0000000
--- a/deps/libav/libavcodec/mpeg4audio.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * MPEG-4 Audio common code
- * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier at free.fr>
- * Copyright (c) 2009 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "get_bits.h"
-#include "put_bits.h"
-#include "mpeg4audio.h"
-
-/**
- * Parse MPEG-4 audio configuration for ALS object type.
- * @param[in] gb       bit reader context
- * @param[in] c        MPEG4AudioConfig structure to fill
- * @return on success 0 is returned, otherwise a value < 0
- */
-static int parse_config_ALS(GetBitContext *gb, MPEG4AudioConfig *c)
-{
-    if (get_bits_left(gb) < 112)
-        return -1;
-
-    if (get_bits_long(gb, 32) != MKBETAG('A','L','S','\0'))
-        return -1;
-
-    // override AudioSpecificConfig channel configuration and sample rate
-    // which are buggy in old ALS conformance files
-    c->sample_rate = get_bits_long(gb, 32);
-
-    // skip number of samples
-    skip_bits_long(gb, 32);
-
-    // read number of channels
-    c->chan_config = 0;
-    c->channels    = get_bits(gb, 16) + 1;
-
-    return 0;
-}
-
-const int avpriv_mpeg4audio_sample_rates[16] = {
-    96000, 88200, 64000, 48000, 44100, 32000,
-    24000, 22050, 16000, 12000, 11025, 8000, 7350
-};
-
-const uint8_t ff_mpeg4audio_channels[8] = {
-    0, 1, 2, 3, 4, 5, 6, 8
-};
-
-static inline int get_object_type(GetBitContext *gb)
-{
-    int object_type = get_bits(gb, 5);
-    if (object_type == AOT_ESCAPE)
-        object_type = 32 + get_bits(gb, 6);
-    return object_type;
-}
-
-static inline int get_sample_rate(GetBitContext *gb, int *index)
-{
-    *index = get_bits(gb, 4);
-    return *index == 0x0f ? get_bits(gb, 24) :
-        avpriv_mpeg4audio_sample_rates[*index];
-}
-
-int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
-                                 int bit_size, int sync_extension)
-{
-    GetBitContext gb;
-    int specific_config_bitindex;
-
-    init_get_bits(&gb, buf, bit_size);
-    c->object_type = get_object_type(&gb);
-    c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
-    c->chan_config = get_bits(&gb, 4);
-    if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
-        c->channels = ff_mpeg4audio_channels[c->chan_config];
-    c->sbr = -1;
-    c->ps  = -1;
-    if (c->object_type == AOT_SBR || (c->object_type == AOT_PS &&
-        // check for W6132 Annex YYYY draft MP3onMP4
-        !(show_bits(&gb, 3) & 0x03 && !(show_bits(&gb, 9) & 0x3F)))) {
-        if (c->object_type == AOT_PS)
-            c->ps = 1;
-        c->ext_object_type = AOT_SBR;
-        c->sbr = 1;
-        c->ext_sample_rate = get_sample_rate(&gb, &c->ext_sampling_index);
-        c->object_type = get_object_type(&gb);
-        if (c->object_type == AOT_ER_BSAC)
-            c->ext_chan_config = get_bits(&gb, 4);
-    } else {
-        c->ext_object_type = AOT_NULL;
-        c->ext_sample_rate = 0;
-    }
-    specific_config_bitindex = get_bits_count(&gb);
-
-    if (c->object_type == AOT_ALS) {
-        skip_bits(&gb, 5);
-        if (show_bits_long(&gb, 24) != MKBETAG('\0','A','L','S'))
-            skip_bits_long(&gb, 24);
-
-        specific_config_bitindex = get_bits_count(&gb);
-
-        if (parse_config_ALS(&gb, c))
-            return -1;
-    }
-
-    if (c->ext_object_type != AOT_SBR && sync_extension) {
-        while (get_bits_left(&gb) > 15) {
-            if (show_bits(&gb, 11) == 0x2b7) { // sync extension
-                get_bits(&gb, 11);
-                c->ext_object_type = get_object_type(&gb);
-                if (c->ext_object_type == AOT_SBR && (c->sbr = get_bits1(&gb)) == 1)
-                    c->ext_sample_rate = get_sample_rate(&gb, &c->ext_sampling_index);
-                if (get_bits_left(&gb) > 11 && get_bits(&gb, 11) == 0x548)
-                    c->ps = get_bits1(&gb);
-                break;
-            } else
-                get_bits1(&gb); // skip 1 bit
-        }
-    }
-
-    //PS requires SBR
-    if (!c->sbr)
-        c->ps = 0;
-    //Limit implicit PS to the HE-AACv2 Profile
-    if ((c->ps == -1 && c->object_type != AOT_AAC_LC) || c->channels & ~0x01)
-        c->ps = 0;
-
-    return specific_config_bitindex;
-}
-
-static av_always_inline unsigned int copy_bits(PutBitContext *pb,
-                                               GetBitContext *gb,
-                                               int bits)
-{
-    unsigned int el = get_bits(gb, bits);
-    put_bits(pb, bits, el);
-    return el;
-}
-
-int avpriv_copy_pce_data(PutBitContext *pb, GetBitContext *gb)
-{
-    int five_bit_ch, four_bit_ch, comment_size, bits;
-    int offset = put_bits_count(pb);
-
-    copy_bits(pb, gb, 10);                  //Tag, Object Type, Frequency
-    five_bit_ch  = copy_bits(pb, gb, 4);    //Front
-    five_bit_ch += copy_bits(pb, gb, 4);    //Side
-    five_bit_ch += copy_bits(pb, gb, 4);    //Back
-    four_bit_ch  = copy_bits(pb, gb, 2);    //LFE
-    four_bit_ch += copy_bits(pb, gb, 3);    //Data
-    five_bit_ch += copy_bits(pb, gb, 4);    //Coupling
-    if (copy_bits(pb, gb, 1))               //Mono Mixdown
-        copy_bits(pb, gb, 4);
-    if (copy_bits(pb, gb, 1))               //Stereo Mixdown
-        copy_bits(pb, gb, 4);
-    if (copy_bits(pb, gb, 1))               //Matrix Mixdown
-        copy_bits(pb, gb, 3);
-    for (bits = five_bit_ch*5+four_bit_ch*4; bits > 16; bits -= 16)
-        copy_bits(pb, gb, 16);
-    if (bits)
-        copy_bits(pb, gb, bits);
-    avpriv_align_put_bits(pb);
-    align_get_bits(gb);
-    comment_size = copy_bits(pb, gb, 8);
-    for (; comment_size > 0; comment_size--)
-        copy_bits(pb, gb, 8);
-
-    return put_bits_count(pb) - offset;
-}
diff --git a/deps/libav/libavcodec/mpeg4audio.h b/deps/libav/libavcodec/mpeg4audio.h
deleted file mode 100644
index e71122d..0000000
--- a/deps/libav/libavcodec/mpeg4audio.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * MPEG-4 Audio common header
- * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier at free.fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPEG4AUDIO_H
-#define AVCODEC_MPEG4AUDIO_H
-
-#include <stdint.h>
-#include "get_bits.h"
-#include "put_bits.h"
-
-typedef struct MPEG4AudioConfig {
-    int object_type;
-    int sampling_index;
-    int sample_rate;
-    int chan_config;
-    int sbr; ///< -1 implicit, 1 presence
-    int ext_object_type;
-    int ext_sampling_index;
-    int ext_sample_rate;
-    int ext_chan_config;
-    int channels;
-    int ps;  ///< -1 implicit, 1 presence
-} MPEG4AudioConfig;
-
-extern av_export const int avpriv_mpeg4audio_sample_rates[16];
-extern const uint8_t ff_mpeg4audio_channels[8];
-
-/**
- * Parse MPEG-4 systems extradata to retrieve audio configuration.
- * @param[in] c        MPEG4AudioConfig structure to fill.
- * @param[in] buf      Extradata from container.
- * @param[in] bit_size Extradata size in bits.
- * @param[in] sync_extension look for a sync extension after config if true.
- * @return On error -1 is returned, on success AudioSpecificConfig bit index in extradata.
- */
-int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
-                                 int bit_size, int sync_extension);
-
-enum AudioObjectType {
-    AOT_NULL,
-                               // Support?                Name
-    AOT_AAC_MAIN,              ///< Y                       Main
-    AOT_AAC_LC,                ///< Y                       Low Complexity
-    AOT_AAC_SSR,               ///< N (code in SoC repo)    Scalable Sample Rate
-    AOT_AAC_LTP,               ///< Y                       Long Term Prediction
-    AOT_SBR,                   ///< Y                       Spectral Band Replication
-    AOT_AAC_SCALABLE,          ///< N                       Scalable
-    AOT_TWINVQ,                ///< N                       Twin Vector Quantizer
-    AOT_CELP,                  ///< N                       Code Excited Linear Prediction
-    AOT_HVXC,                  ///< N                       Harmonic Vector eXcitation Coding
-    AOT_TTSI             = 12, ///< N                       Text-To-Speech Interface
-    AOT_MAINSYNTH,             ///< N                       Main Synthesis
-    AOT_WAVESYNTH,             ///< N                       Wavetable Synthesis
-    AOT_MIDI,                  ///< N                       General MIDI
-    AOT_SAFX,                  ///< N                       Algorithmic Synthesis and Audio Effects
-    AOT_ER_AAC_LC,             ///< N                       Error Resilient Low Complexity
-    AOT_ER_AAC_LTP       = 19, ///< N                       Error Resilient Long Term Prediction
-    AOT_ER_AAC_SCALABLE,       ///< N                       Error Resilient Scalable
-    AOT_ER_TWINVQ,             ///< N                       Error Resilient Twin Vector Quantizer
-    AOT_ER_BSAC,               ///< N                       Error Resilient Bit-Sliced Arithmetic Coding
-    AOT_ER_AAC_LD,             ///< N                       Error Resilient Low Delay
-    AOT_ER_CELP,               ///< N                       Error Resilient Code Excited Linear Prediction
-    AOT_ER_HVXC,               ///< N                       Error Resilient Harmonic Vector eXcitation Coding
-    AOT_ER_HILN,               ///< N                       Error Resilient Harmonic and Individual Lines plus Noise
-    AOT_ER_PARAM,              ///< N                       Error Resilient Parametric
-    AOT_SSC,                   ///< N                       SinuSoidal Coding
-    AOT_PS,                    ///< N                       Parametric Stereo
-    AOT_SURROUND,              ///< N                       MPEG Surround
-    AOT_ESCAPE,                ///< Y                       Escape Value
-    AOT_L1,                    ///< Y                       Layer 1
-    AOT_L2,                    ///< Y                       Layer 2
-    AOT_L3,                    ///< Y                       Layer 3
-    AOT_DST,                   ///< N                       Direct Stream Transfer
-    AOT_ALS,                   ///< Y                       Audio LosslesS
-    AOT_SLS,                   ///< N                       Scalable LosslesS
-    AOT_SLS_NON_CORE,          ///< N                       Scalable LosslesS (non core)
-    AOT_ER_AAC_ELD,            ///< N                       Error Resilient Enhanced Low Delay
-    AOT_SMR_SIMPLE,            ///< N                       Symbolic Music Representation Simple
-    AOT_SMR_MAIN,              ///< N                       Symbolic Music Representation Main
-    AOT_USAC_NOSBR,            ///< N                       Unified Speech and Audio Coding (no SBR)
-    AOT_SAOC,                  ///< N                       Spatial Audio Object Coding
-    AOT_LD_SURROUND,           ///< N                       Low Delay MPEG Surround
-    AOT_USAC,                  ///< N                       Unified Speech and Audio Coding
-};
-
-#define MAX_PCE_SIZE 304 ///<Maximum size of a PCE including the 3-bit ID_PCE
-                         ///<marker and the comment
-
-int avpriv_copy_pce_data(PutBitContext *pb, GetBitContext *gb);
-
-#endif /* AVCODEC_MPEG4AUDIO_H */
diff --git a/deps/libav/libavcodec/mpeg4data.h b/deps/libav/libavcodec/mpeg4data.h
deleted file mode 100644
index 87bb539..0000000
--- a/deps/libav/libavcodec/mpeg4data.h
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * mpeg4 tables.
- */
-
-#ifndef AVCODEC_MPEG4DATA_H
-#define AVCODEC_MPEG4DATA_H
-
-#include <stdint.h>
-#include "mpegvideo.h"
-
-/* dc encoding for mpeg4 */
-const uint8_t ff_mpeg4_DCtab_lum[13][2] =
-{
-    {3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7},
-    {1,8}, {1,9}, {1,10}, {1,11},
-};
-
-const uint8_t ff_mpeg4_DCtab_chrom[13][2] =
-{
-    {3,2}, {2,2}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, {1,8},
-    {1,9}, {1,10}, {1,11}, {1,12},
-};
-
-const uint16_t ff_mpeg4_intra_vlc[103][2] = {
-{ 0x2, 2 },
-{ 0x6, 3 },{ 0xf, 4 },{ 0xd, 5 },{ 0xc, 5 },
-{ 0x15, 6 },{ 0x13, 6 },{ 0x12, 6 },{ 0x17, 7 },
-{ 0x1f, 8 },{ 0x1e, 8 },{ 0x1d, 8 },{ 0x25, 9 },
-{ 0x24, 9 },{ 0x23, 9 },{ 0x21, 9 },{ 0x21, 10 },
-{ 0x20, 10 },{ 0xf, 10 },{ 0xe, 10 },{ 0x7, 11 },
-{ 0x6, 11 },{ 0x20, 11 },{ 0x21, 11 },{ 0x50, 12 },
-{ 0x51, 12 },{ 0x52, 12 },{ 0xe, 4 },{ 0x14, 6 },
-{ 0x16, 7 },{ 0x1c, 8 },{ 0x20, 9 },{ 0x1f, 9 },
-{ 0xd, 10 },{ 0x22, 11 },{ 0x53, 12 },{ 0x55, 12 },
-{ 0xb, 5 },{ 0x15, 7 },{ 0x1e, 9 },{ 0xc, 10 },
-{ 0x56, 12 },{ 0x11, 6 },{ 0x1b, 8 },{ 0x1d, 9 },
-{ 0xb, 10 },{ 0x10, 6 },{ 0x22, 9 },{ 0xa, 10 },
-{ 0xd, 6 },{ 0x1c, 9 },{ 0x8, 10 },{ 0x12, 7 },
-{ 0x1b, 9 },{ 0x54, 12 },{ 0x14, 7 },{ 0x1a, 9 },
-{ 0x57, 12 },{ 0x19, 8 },{ 0x9, 10 },{ 0x18, 8 },
-{ 0x23, 11 },{ 0x17, 8 },{ 0x19, 9 },{ 0x18, 9 },
-{ 0x7, 10 },{ 0x58, 12 },{ 0x7, 4 },{ 0xc, 6 },
-{ 0x16, 8 },{ 0x17, 9 },{ 0x6, 10 },{ 0x5, 11 },
-{ 0x4, 11 },{ 0x59, 12 },{ 0xf, 6 },{ 0x16, 9 },
-{ 0x5, 10 },{ 0xe, 6 },{ 0x4, 10 },{ 0x11, 7 },
-{ 0x24, 11 },{ 0x10, 7 },{ 0x25, 11 },{ 0x13, 7 },
-{ 0x5a, 12 },{ 0x15, 8 },{ 0x5b, 12 },{ 0x14, 8 },
-{ 0x13, 8 },{ 0x1a, 8 },{ 0x15, 9 },{ 0x14, 9 },
-{ 0x13, 9 },{ 0x12, 9 },{ 0x11, 9 },{ 0x26, 11 },
-{ 0x27, 11 },{ 0x5c, 12 },{ 0x5d, 12 },{ 0x5e, 12 },
-{ 0x5f, 12 },{ 0x3, 7 },
-};
-
-const int8_t ff_mpeg4_intra_level[102] = {
-  1,  2,  3,  4,  5,  6,  7,  8,
-  9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27,  1,  2,  3,  4,  5,
-  6,  7,  8,  9, 10,  1,  2,  3,
-  4,  5,  1,  2,  3,  4,  1,  2,
-  3,  1,  2,  3,  1,  2,  3,  1,
-  2,  3,  1,  2,  1,  2,  1,  1,
-  1,  1,  1,  1,  2,  3,  4,  5,
-  6,  7,  8,  1,  2,  3,  1,  2,
-  1,  2,  1,  2,  1,  2,  1,  2,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,
-};
-
-const int8_t ff_mpeg4_intra_run[102] = {
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  2,  2,  2,
-  2,  2,  3,  3,  3,  3,  4,  4,
-  4,  5,  5,  5,  6,  6,  6,  7,
-  7,  7,  8,  8,  9,  9, 10, 11,
- 12, 13, 14,  0,  0,  0,  0,  0,
-  0,  0,  0,  1,  1,  1,  2,  2,
-  3,  3,  4,  4,  5,  5,  6,  6,
-  7,  8,  9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20,
-};
-
-RLTable ff_mpeg4_rl_intra = {
-    102,
-    67,
-    ff_mpeg4_intra_vlc,
-    ff_mpeg4_intra_run,
-    ff_mpeg4_intra_level,
-};
-
-/* Note this is identical to the intra rvlc except that it is reordered. */
-static const uint16_t inter_rvlc[170][2]={
-{0x0006,  3},{0x0001,  4},{0x0004,  5},{0x001C,  7},
-{0x003C,  8},{0x003D,  8},{0x007C,  9},{0x00FC, 10},
-{0x00FD, 10},{0x01FC, 11},{0x01FD, 11},{0x03FC, 12},
-{0x07FC, 13},{0x07FD, 13},{0x0BFC, 13},{0x0BFD, 13},
-{0x0FFC, 14},{0x0FFD, 14},{0x1FFC, 15},{0x0007,  3},
-{0x000C,  6},{0x005C,  8},{0x007D,  9},{0x017C, 10},
-{0x02FC, 11},{0x03FD, 12},{0x0DFC, 13},{0x17FC, 14},
-{0x17FD, 14},{0x000A,  4},{0x001D,  7},{0x00BC,  9},
-{0x02FD, 11},{0x05FC, 12},{0x1BFC, 14},{0x1BFD, 14},
-{0x0005,  5},{0x005D,  8},{0x017D, 10},{0x05FD, 12},
-{0x0DFD, 13},{0x1DFC, 14},{0x1FFD, 15},{0x0008,  5},
-{0x006C,  8},{0x037C, 11},{0x0EFC, 13},{0x2FFC, 15},
-{0x0009,  5},{0x00BD,  9},{0x037D, 11},{0x0EFD, 13},
-{0x000D,  6},{0x01BC, 10},{0x06FC, 12},{0x1DFD, 14},
-{0x0014,  6},{0x01BD, 10},{0x06FD, 12},{0x2FFD, 15},
-{0x0015,  6},{0x01DC, 10},{0x0F7C, 13},{0x002C,  7},
-{0x01DD, 10},{0x1EFC, 14},{0x002D,  7},{0x03BC, 11},
-{0x0034,  7},{0x077C, 12},{0x006D,  8},{0x0F7D, 13},
-{0x0074,  8},{0x1EFD, 14},{0x0075,  8},{0x1F7C, 14},
-{0x00DC,  9},{0x1F7D, 14},{0x00DD,  9},{0x1FBC, 14},
-{0x00EC,  9},{0x37FC, 15},{0x01EC, 10},{0x01ED, 10},
-{0x01F4, 10},{0x03BD, 11},{0x03DC, 11},{0x03DD, 11},
-{0x03EC, 11},{0x03ED, 11},{0x03F4, 11},{0x077D, 12},
-{0x07BC, 12},{0x07BD, 12},{0x0FBC, 13},{0x0FBD, 13},
-{0x0FDC, 13},{0x0FDD, 13},{0x1FBD, 14},{0x1FDC, 14},
-{0x1FDD, 14},{0x37FD, 15},{0x3BFC, 15},
-{0x000B,  4},{0x0078,  8},{0x03F5, 11},{0x0FEC, 13},
-{0x1FEC, 14},{0x0012,  5},{0x00ED,  9},{0x07DC, 12},
-{0x1FED, 14},{0x3BFD, 15},{0x0013,  5},{0x03F8, 11},
-{0x3DFC, 15},{0x0018,  6},{0x07DD, 12},{0x0019,  6},
-{0x07EC, 12},{0x0022,  6},{0x0FED, 13},{0x0023,  6},
-{0x0FF4, 13},{0x0035,  7},{0x0FF5, 13},{0x0038,  7},
-{0x0FF8, 13},{0x0039,  7},{0x0FF9, 13},{0x0042,  7},
-{0x1FF4, 14},{0x0043,  7},{0x1FF5, 14},{0x0079,  8},
-{0x1FF8, 14},{0x0082,  8},{0x3DFD, 15},{0x0083,  8},
-{0x00F4,  9},{0x00F5,  9},{0x00F8,  9},{0x00F9,  9},
-{0x0102,  9},{0x0103,  9},{0x01F5, 10},{0x01F8, 10},
-{0x01F9, 10},{0x0202, 10},{0x0203, 10},{0x03F9, 11},
-{0x0402, 11},{0x0403, 11},{0x07ED, 12},{0x07F4, 12},
-{0x07F5, 12},{0x07F8, 12},{0x07F9, 12},{0x0802, 12},
-{0x0803, 12},{0x1002, 13},{0x1003, 13},{0x1FF9, 14},
-{0x2002, 14},{0x2003, 14},{0x3EFC, 15},{0x3EFD, 15},
-{0x3F7C, 15},{0x3F7D, 15},{0x0000, 4}
-};
-
-static const int8_t inter_rvlc_run[169]={
- 0,  0,  0,  0,  0,  0,  0,  0,
- 0,  0,  0,  0,  0,  0,  0,  0,
- 0,  0,  0,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  2,  2,  2,
- 2,  2,  2,  2,  3,  3,  3,  3,
- 3,  3,  3,  4,  4,  4,  4,  4,
- 5,  5,  5,  5,  6,  6,  6,  6,
- 7,  7,  7,  7,  8,  8,  8,  9,
- 9,  9, 10, 10, 11, 11, 12, 12,
-13, 13, 14, 14, 15, 15, 16, 16,
-17, 17, 18, 19, 20, 21, 22, 23,
-24, 25, 26, 27, 28, 29, 30, 31,
-32, 33, 34, 35, 36, 37, 38,
- 0,  0,  0,  0,  0,  1,  1,  1,
- 1,  1,  2,  2,  2,  3,  3,  4,
- 4,  5,  5,  6,  6,  7,  7,  8,
- 8,  9,  9, 10, 10, 11, 11, 12,
-12, 13, 13, 14, 15, 16, 17, 18,
-19, 20, 21, 22, 23, 24, 25, 26,
-27, 28, 29, 30, 31, 32, 33, 34,
-35, 36, 37, 38, 39, 40, 41, 42,
-43, 44,
-};
-
-static const int8_t inter_rvlc_level[169]={
- 1,  2,  3,  4,  5,  6,  7,  8,
- 9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19,  1,  2,  3,  4,  5,
- 6,  7,  8,  9, 10,  1,  2,  3,
- 4,  5,  6,  7,  1,  2,  3,  4,
- 5,  6,  7,  1,  2,  3,  4,  5,
- 1,  2,  3,  4,  1,  2,  3,  4,
- 1,  2,  3,  4,  1,  2,  3,  1,
- 2,  3,  1,  2,  1,  2,  1,  2,
- 1,  2,  1,  2,  1,  2,  1,  2,
- 1,  2,  1,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,
- 1,  2,  3,  4,  5,  1,  2,  3,
- 4,  5,  1,  2,  3,  1,  2,  1,
- 2,  1,  2,  1,  2,  1,  2,  1,
- 2,  1,  2,  1,  2,  1,  2,  1,
- 2,  1,  2,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,  1,
- 1,  1,
-};
-
-RLTable ff_rvlc_rl_inter = {
-    169,
-    103,
-    inter_rvlc,
-    inter_rvlc_run,
-    inter_rvlc_level,
-};
-
-static const uint16_t intra_rvlc[170][2]={
-{0x0006,  3},{0x0007,  3},{0x000A,  4},{0x0009,  5},
-{0x0014,  6},{0x0015,  6},{0x0034,  7},{0x0074,  8},
-{0x0075,  8},{0x00DD,  9},{0x00EC,  9},{0x01EC, 10},
-{0x01ED, 10},{0x01F4, 10},{0x03EC, 11},{0x03ED, 11},
-{0x03F4, 11},{0x077D, 12},{0x07BC, 12},{0x0FBD, 13},
-{0x0FDC, 13},{0x07BD, 12},{0x0FDD, 13},{0x1FBD, 14},
-{0x1FDC, 14},{0x1FDD, 14},{0x1FFC, 15},{0x0001,  4},
-{0x0008,  5},{0x002D,  7},{0x006C,  8},{0x006D,  8},
-{0x00DC,  9},{0x01DD, 10},{0x03DC, 11},{0x03DD, 11},
-{0x077C, 12},{0x0FBC, 13},{0x1F7D, 14},{0x1FBC, 14},
-{0x0004,  5},{0x002C,  7},{0x00BC,  9},{0x01DC, 10},
-{0x03BC, 11},{0x03BD, 11},{0x0EFD, 13},{0x0F7C, 13},
-{0x0F7D, 13},{0x1EFD, 14},{0x1F7C, 14},{0x0005,  5},
-{0x005C,  8},{0x00BD,  9},{0x037D, 11},{0x06FC, 12},
-{0x0EFC, 13},{0x1DFD, 14},{0x1EFC, 14},{0x1FFD, 15},
-{0x000C,  6},{0x005D,  8},{0x01BD, 10},{0x03FD, 12},
-{0x06FD, 12},{0x1BFD, 14},{0x000D,  6},{0x007D,  9},
-{0x02FC, 11},{0x05FC, 12},{0x1BFC, 14},{0x1DFC, 14},
-{0x001C,  7},{0x017C, 10},{0x02FD, 11},{0x05FD, 12},
-{0x2FFC, 15},{0x001D,  7},{0x017D, 10},{0x037C, 11},
-{0x0DFD, 13},{0x2FFD, 15},{0x003C,  8},{0x01BC, 10},
-{0x0BFD, 13},{0x17FD, 14},{0x003D,  8},{0x01FD, 11},
-{0x0DFC, 13},{0x37FC, 15},{0x007C,  9},{0x03FC, 12},
-{0x00FC, 10},{0x0BFC, 13},{0x00FD, 10},{0x37FD, 15},
-{0x01FC, 11},{0x07FC, 13},{0x07FD, 13},{0x0FFC, 14},
-{0x0FFD, 14},{0x17FC, 14},{0x3BFC, 15},
-{0x000B,  4},{0x0078,  8},{0x03F5, 11},{0x0FEC, 13},
-{0x1FEC, 14},{0x0012,  5},{0x00ED,  9},{0x07DC, 12},
-{0x1FED, 14},{0x3BFD, 15},{0x0013,  5},{0x03F8, 11},
-{0x3DFC, 15},{0x0018,  6},{0x07DD, 12},{0x0019,  6},
-{0x07EC, 12},{0x0022,  6},{0x0FED, 13},{0x0023,  6},
-{0x0FF4, 13},{0x0035,  7},{0x0FF5, 13},{0x0038,  7},
-{0x0FF8, 13},{0x0039,  7},{0x0FF9, 13},{0x0042,  7},
-{0x1FF4, 14},{0x0043,  7},{0x1FF5, 14},{0x0079,  8},
-{0x1FF8, 14},{0x0082,  8},{0x3DFD, 15},{0x0083,  8},
-{0x00F4,  9},{0x00F5,  9},{0x00F8,  9},{0x00F9,  9},
-{0x0102,  9},{0x0103,  9},{0x01F5, 10},{0x01F8, 10},
-{0x01F9, 10},{0x0202, 10},{0x0203, 10},{0x03F9, 11},
-{0x0402, 11},{0x0403, 11},{0x07ED, 12},{0x07F4, 12},
-{0x07F5, 12},{0x07F8, 12},{0x07F9, 12},{0x0802, 12},
-{0x0803, 12},{0x1002, 13},{0x1003, 13},{0x1FF9, 14},
-{0x2002, 14},{0x2003, 14},{0x3EFC, 15},{0x3EFD, 15},
-{0x3F7C, 15},{0x3F7D, 15},{0x0000,  4}
-};
-
-static const int8_t intra_rvlc_run[169]={
- 0,  0,  0,  0,  0,  0,  0,  0,
- 0,  0,  0,  0,  0,  0,  0,  0,
- 0,  0,  0,  0,  0,  0,  0,  0,
- 0,  0,  0,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,  1,
- 2,  2,  2,  2,  2,  2,  2,  2,
- 2,  2,  2,  3,  3,  3,  3,  3,
- 3,  3,  3,  3,  4,  4,  4,  4,
- 4,  4,  5,  5,  5,  5,  5,  5,
- 6,  6,  6,  6,  6,  7,  7,  7,
- 7,  7,  8,  8,  8,  8,  9,  9,
- 9,  9, 10, 10, 11, 11, 12, 12,
-13, 14, 15, 16, 17, 18, 19,
- 0,  0,  0,  0,  0,  1,  1,  1,
- 1,  1,  2,  2,  2,  3,  3,  4,
- 4,  5,  5,  6,  6,  7,  7,  8,
- 8,  9,  9, 10, 10, 11, 11, 12,
-12, 13, 13, 14, 15, 16, 17, 18,
-19, 20, 21, 22, 23, 24, 25, 26,
-27, 28, 29, 30, 31, 32, 33, 34,
-35, 36, 37, 38, 39, 40, 41, 42,
-43, 44,
-};
-
-static const int8_t intra_rvlc_level[169]={
- 1,  2,  3,  4,  5,  6,  7,  8,
- 9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19, 20, 21, 22, 23, 24,
-25, 26, 27,  1,  2,  3,  4,  5,
- 6,  7,  8,  9, 10, 11, 12, 13,
- 1,  2,  3,  4,  5,  6,  7,  8,
- 9, 10, 11,  1,  2,  3,  4,  5,
- 6,  7,  8,  9,  1,  2,  3,  4,
- 5,  6,  1,  2,  3,  4,  5,  6,
- 1,  2,  3,  4,  5,  1,  2,  3,
- 4,  5,  1,  2,  3,  4,  1,  2,
- 3,  4,  1,  2,  1,  2,  1,  2,
- 1,  1,  1,  1,  1,  1,  1,
- 1,  2,  3,  4,  5,  1,  2,  3,
- 4,  5,  1,  2,  3,  1,  2,  1,
- 2,  1,  2,  1,  2,  1,  2,  1,
- 2,  1,  2,  1,  2,  1,  2,  1,
- 2,  1,  2,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,  1,
- 1,  1,  1,  1,  1,  1,  1,  1,
- 1,  1,
-};
-
-RLTable ff_rvlc_rl_intra = {
-    169,
-    103,
-    intra_rvlc,
-    intra_rvlc_run,
-    intra_rvlc_level,
-};
-
-const uint16_t ff_sprite_trajectory_tab[15][2] = {
- {0x00, 2}, {0x02, 3},  {0x03, 3},  {0x04, 3}, {0x05, 3}, {0x06, 3},
- {0x0E, 4}, {0x1E, 5},  {0x3E, 6},  {0x7E, 7}, {0xFE, 8},
- {0x1FE, 9},{0x3FE, 10},{0x7FE, 11},{0xFFE, 12},
-};
-
-const uint8_t ff_mb_type_b_tab[4][2] = {
- {1, 1}, {1, 2}, {1, 3}, {1, 4},
-};
-
-/* these matrixes will be permuted for the idct */
-const int16_t ff_mpeg4_default_intra_matrix[64] = {
-  8, 17, 18, 19, 21, 23, 25, 27,
- 17, 18, 19, 21, 23, 25, 27, 28,
- 20, 21, 22, 23, 24, 26, 28, 30,
- 21, 22, 23, 24, 26, 28, 30, 32,
- 22, 23, 24, 26, 28, 30, 32, 35,
- 23, 24, 26, 28, 30, 32, 35, 38,
- 25, 26, 28, 30, 32, 35, 38, 41,
- 27, 28, 30, 32, 35, 38, 41, 45,
-};
-
-const int16_t ff_mpeg4_default_non_intra_matrix[64] = {
- 16, 17, 18, 19, 20, 21, 22, 23,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 18, 19, 20, 21, 22, 23, 24, 25,
- 19, 20, 21, 22, 23, 24, 26, 27,
- 20, 21, 22, 23, 25, 26, 27, 28,
- 21, 22, 23, 24, 26, 27, 28, 30,
- 22, 23, 24, 26, 27, 28, 30, 31,
- 23, 24, 25, 27, 28, 30, 31, 33,
-};
-
-const uint8_t ff_mpeg4_y_dc_scale_table[32]={
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-    0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,36,38,40,42,44,46
-};
-const uint8_t ff_mpeg4_c_dc_scale_table[32]={
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-    0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,21,22,23,24,25
-};
-
-const uint16_t ff_mpeg4_resync_prefix[8]={
-    0x7F00, 0x7E00, 0x7C00, 0x7800, 0x7000, 0x6000, 0x4000, 0x0000
-};
-
-const uint8_t ff_mpeg4_dc_threshold[8]={
-    99, 13, 15, 17, 19, 21, 23, 0
-};
-
-#endif /* AVCODEC_MPEG4DATA_H */
diff --git a/deps/libav/libavcodec/mpeg4video.c b/deps/libav/libavcodec/mpeg4video.c
deleted file mode 100644
index 979904f..0000000
--- a/deps/libav/libavcodec/mpeg4video.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * MPEG4 decoder / encoder common code.
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "mpegvideo.h"
-#include "mpeg4video.h"
-#include "mpeg4data.h"
-
-uint8_t ff_mpeg4_static_rl_table_store[3][2][2 * MAX_RUN + MAX_LEVEL + 3];
-
-int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s)
-{
-    switch (s->pict_type) {
-    case AV_PICTURE_TYPE_I:
-        return 16;
-    case AV_PICTURE_TYPE_P:
-    case AV_PICTURE_TYPE_S:
-        return s->f_code + 15;
-    case AV_PICTURE_TYPE_B:
-        return FFMAX3(s->f_code, s->b_code, 2) + 15;
-    default:
-        return -1;
-    }
-}
-
-void ff_mpeg4_clean_buffers(MpegEncContext *s)
-{
-    int c_wrap, c_xy, l_wrap, l_xy;
-
-    l_wrap = s->b8_stride;
-    l_xy   = (2 * s->mb_y - 1) * l_wrap + s->mb_x * 2 - 1;
-    c_wrap = s->mb_stride;
-    c_xy   = (s->mb_y - 1) * c_wrap + s->mb_x - 1;
-
-#if 0
-    /* clean DC */
-    memsetw(s->dc_val[0] + l_xy, 1024, l_wrap * 2 + 1);
-    memsetw(s->dc_val[1] + c_xy, 1024, c_wrap + 1);
-    memsetw(s->dc_val[2] + c_xy, 1024, c_wrap + 1);
-#endif
-
-    /* clean AC */
-    memset(s->ac_val[0] + l_xy, 0, (l_wrap * 2 + 1) * 16 * sizeof(int16_t));
-    memset(s->ac_val[1] + c_xy, 0, (c_wrap     + 1) * 16 * sizeof(int16_t));
-    memset(s->ac_val[2] + c_xy, 0, (c_wrap     + 1) * 16 * sizeof(int16_t));
-
-    /* clean MV */
-    // we can't clear the MVs as they might be needed by a b frame
-//    memset(s->motion_val + l_xy, 0, (l_wrap * 2 + 1) * 2 * sizeof(int16_t));
-//    memset(s->motion_val, 0, 2 * sizeof(int16_t) * (2 + s->mb_width * 2) *
-//           (2 + s->mb_height * 2));
-    s->last_mv[0][0][0] =
-    s->last_mv[0][0][1] =
-    s->last_mv[1][0][0] =
-    s->last_mv[1][0][1] = 0;
-}
-
-#define tab_size ((signed)FF_ARRAY_ELEMS(s->direct_scale_mv[0]))
-#define tab_bias (tab_size / 2)
-
-// used by mpeg4 and rv10 decoder
-void ff_mpeg4_init_direct_mv(MpegEncContext *s)
-{
-    int i;
-    for (i = 0; i < tab_size; i++) {
-        s->direct_scale_mv[0][i] = (i - tab_bias) * s->pb_time / s->pp_time;
-        s->direct_scale_mv[1][i] = (i - tab_bias) * (s->pb_time - s->pp_time) /
-                                   s->pp_time;
-    }
-}
-
-static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx,
-                                              int my, int i)
-{
-    int xy           = s->block_index[i];
-    uint16_t time_pp = s->pp_time;
-    uint16_t time_pb = s->pb_time;
-    int p_mx, p_my;
-
-    p_mx = s->next_picture.motion_val[0][xy][0];
-    if ((unsigned)(p_mx + tab_bias) < tab_size) {
-        s->mv[0][i][0] = s->direct_scale_mv[0][p_mx + tab_bias] + mx;
-        s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx
-                            : s->direct_scale_mv[1][p_mx + tab_bias];
-    } else {
-        s->mv[0][i][0] = p_mx * time_pb / time_pp + mx;
-        s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx
-                            : p_mx * (time_pb - time_pp) / time_pp;
-    }
-    p_my = s->next_picture.motion_val[0][xy][1];
-    if ((unsigned)(p_my + tab_bias) < tab_size) {
-        s->mv[0][i][1] = s->direct_scale_mv[0][p_my + tab_bias] + my;
-        s->mv[1][i][1] = my ? s->mv[0][i][1] - p_my
-                            : s->direct_scale_mv[1][p_my + tab_bias];
-    } else {
-        s->mv[0][i][1] = p_my * time_pb / time_pp + my;
-        s->mv[1][i][1] = my ? s->mv[0][i][1] - p_my
-                            : p_my * (time_pb - time_pp) / time_pp;
-    }
-}
-
-#undef tab_size
-#undef tab_bias
-
-/**
- * @return the mb_type
- */
-int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my)
-{
-    const int mb_index          = s->mb_x + s->mb_y * s->mb_stride;
-    const int colocated_mb_type = s->next_picture.mb_type[mb_index];
-    uint16_t time_pp;
-    uint16_t time_pb;
-    int i;
-
-    // FIXME avoid divides
-    // try special case with shifts for 1 and 3 B-frames?
-
-    if (IS_8X8(colocated_mb_type)) {
-        s->mv_type = MV_TYPE_8X8;
-        for (i = 0; i < 4; i++)
-            ff_mpeg4_set_one_direct_mv(s, mx, my, i);
-        return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_L0L1;
-    } else if (IS_INTERLACED(colocated_mb_type)) {
-        s->mv_type = MV_TYPE_FIELD;
-        for (i = 0; i < 2; i++) {
-            int field_select = s->next_picture.ref_index[0][4 * mb_index + 2 * i];
-            s->field_select[0][i] = field_select;
-            s->field_select[1][i] = i;
-            if (s->top_field_first) {
-                time_pp = s->pp_field_time - field_select + i;
-                time_pb = s->pb_field_time - field_select + i;
-            } else {
-                time_pp = s->pp_field_time + field_select - i;
-                time_pb = s->pb_field_time + field_select - i;
-            }
-            s->mv[0][i][0] = s->p_field_mv_table[i][0][mb_index][0] *
-                             time_pb / time_pp + mx;
-            s->mv[0][i][1] = s->p_field_mv_table[i][0][mb_index][1] *
-                             time_pb / time_pp + my;
-            s->mv[1][i][0] = mx ? s->mv[0][i][0] -
-                                  s->p_field_mv_table[i][0][mb_index][0]
-                                : s->p_field_mv_table[i][0][mb_index][0] *
-                                  (time_pb - time_pp) / time_pp;
-            s->mv[1][i][1] = my ? s->mv[0][i][1] -
-                                  s->p_field_mv_table[i][0][mb_index][1]
-                                : s->p_field_mv_table[i][0][mb_index][1] *
-                                  (time_pb - time_pp) / time_pp;
-        }
-        return MB_TYPE_DIRECT2 | MB_TYPE_16x8 |
-               MB_TYPE_L0L1    | MB_TYPE_INTERLACED;
-    } else {
-        ff_mpeg4_set_one_direct_mv(s, mx, my, 0);
-        s->mv[0][1][0] =
-        s->mv[0][2][0] =
-        s->mv[0][3][0] = s->mv[0][0][0];
-        s->mv[0][1][1] =
-        s->mv[0][2][1] =
-        s->mv[0][3][1] = s->mv[0][0][1];
-        s->mv[1][1][0] =
-        s->mv[1][2][0] =
-        s->mv[1][3][0] = s->mv[1][0][0];
-        s->mv[1][1][1] =
-        s->mv[1][2][1] =
-        s->mv[1][3][1] = s->mv[1][0][1];
-        if ((s->avctx->workaround_bugs & FF_BUG_DIRECT_BLOCKSIZE) ||
-            !s->quarter_sample)
-            s->mv_type = MV_TYPE_16X16;
-        else
-            s->mv_type = MV_TYPE_8X8;
-        // Note see prev line
-        return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1;
-    }
-}
diff --git a/deps/libav/libavcodec/mpeg4video.h b/deps/libav/libavcodec/mpeg4video.h
deleted file mode 100644
index 59358eb..0000000
--- a/deps/libav/libavcodec/mpeg4video.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * MPEG4 encoder/decoder internal header.
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPEG4VIDEO_H
-#define AVCODEC_MPEG4VIDEO_H
-
-#include <stdint.h>
-
-#include "get_bits.h"
-#include "mpegvideo.h"
-#include "rl.h"
-
-// shapes
-#define RECT_SHAPE       0
-#define BIN_SHAPE        1
-#define BIN_ONLY_SHAPE   2
-#define GRAY_SHAPE       3
-
-#define SIMPLE_VO_TYPE           1
-#define CORE_VO_TYPE             3
-#define MAIN_VO_TYPE             4
-#define NBIT_VO_TYPE             5
-#define ARTS_VO_TYPE            10
-#define ACE_VO_TYPE             12
-#define ADV_SIMPLE_VO_TYPE      17
-
-// aspect_ratio_info
-#define EXTENDED_PAR 15
-
-//vol_sprite_usage / sprite_enable
-#define STATIC_SPRITE 1
-#define GMC_SPRITE 2
-
-#define MOTION_MARKER 0x1F001
-#define DC_MARKER     0x6B001
-
-#define VOS_STARTCODE        0x1B0
-#define USER_DATA_STARTCODE  0x1B2
-#define GOP_STARTCODE        0x1B3
-#define VISUAL_OBJ_STARTCODE 0x1B5
-#define VOP_STARTCODE        0x1B6
-
-typedef struct Mpeg4DecContext {
-    MpegEncContext m;
-
-    ///< number of bits to represent the fractional part of time
-    int time_increment_bits;
-    int shape;
-    int vol_sprite_usage;
-    int sprite_brightness_change;
-    int num_sprite_warping_points;
-    ///< sprite trajectory points
-    uint16_t sprite_traj[4][2];
-    ///< sprite shift [isChroma]
-    int sprite_shift[2];
-
-    // reversible vlc
-    int rvlc;
-    ///< could this stream contain resync markers
-    int resync_marker;
-    ///< time distance of first I -> B, used for interlaced b frames
-    int t_frame;
-
-    int new_pred;
-    int enhancement_type;
-    int scalability;
-    int use_intra_dc_vlc;
-    ///< QP above whch the ac VLC should be used for intra dc
-    int intra_dc_threshold;
-
-    /* bug workarounds */
-    int divx_version;
-    int divx_build;
-    int xvid_build;
-    int lavc_build;
-    ///< flag for having shown the warning about divxs invalid b frames
-    int showed_packed_warning;
-
-    int cplx_estimation_trash_i;
-    int cplx_estimation_trash_p;
-    int cplx_estimation_trash_b;
-} Mpeg4DecContext;
-
-/* dc encoding for mpeg4 */
-extern const uint8_t ff_mpeg4_DCtab_lum[13][2];
-extern const uint8_t ff_mpeg4_DCtab_chrom[13][2];
-
-extern const uint16_t ff_mpeg4_intra_vlc[103][2];
-extern const int8_t ff_mpeg4_intra_level[102];
-extern const int8_t ff_mpeg4_intra_run[102];
-
-extern RLTable ff_mpeg4_rl_intra;
-
-/* Note this is identical to the intra rvlc except that it is reordered. */
-extern RLTable ff_rvlc_rl_inter;
-extern RLTable ff_rvlc_rl_intra;
-
-extern const uint16_t ff_sprite_trajectory_tab[15][2];
-extern const uint8_t ff_mb_type_b_tab[4][2];
-
-/* these matrixes will be permuted for the idct */
-extern const int16_t ff_mpeg4_default_intra_matrix[64];
-extern const int16_t ff_mpeg4_default_non_intra_matrix[64];
-
-extern const uint8_t ff_mpeg4_y_dc_scale_table[32];
-extern const uint8_t ff_mpeg4_c_dc_scale_table[32];
-extern const uint16_t ff_mpeg4_resync_prefix[8];
-
-extern const uint8_t ff_mpeg4_dc_threshold[8];
-
-void ff_mpeg4_encode_mb(MpegEncContext *s,
-                        int16_t block[6][64],
-                        int motion_x, int motion_y);
-void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n,
-                      int dir);
-void ff_set_mpeg4_time(MpegEncContext *s);
-void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
-
-int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb);
-void ff_mpeg4_encode_video_packet_header(MpegEncContext *s);
-void ff_mpeg4_clean_buffers(MpegEncContext *s);
-void ff_mpeg4_stuffing(PutBitContext *pbc);
-void ff_mpeg4_init_partitions(MpegEncContext *s);
-void ff_mpeg4_merge_partitions(MpegEncContext *s);
-void ff_clean_mpeg4_qscales(MpegEncContext *s);
-int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx);
-int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s);
-int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx);
-void ff_mpeg4_init_direct_mv(MpegEncContext *s);
-int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
-
-/**
- *
- * @return the mb_type
- */
-int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my);
-
-extern uint8_t ff_mpeg4_static_rl_table_store[3][2][2 * MAX_RUN + MAX_LEVEL + 3];
-
-#if 0 //3IV1 is quite rare and it slows things down a tiny bit
-#define IS_3IV1 s->codec_tag == AV_RL32("3IV1")
-#else
-#define IS_3IV1 0
-#endif
-
-/**
- * Predict the dc.
- * encoding quantized level -> quantized diff
- * decoding quantized diff -> quantized level
- * @param n block index (0-3 are luma, 4-5 are chroma)
- * @param dir_ptr pointer to an integer where the prediction direction will be stored
- */
-static inline int ff_mpeg4_pred_dc(MpegEncContext *s, int n, int level,
-                                   int *dir_ptr, int encoding)
-{
-    int a, b, c, wrap, pred, scale, ret;
-    int16_t *dc_val;
-
-    /* find prediction */
-    if (n < 4)
-        scale = s->y_dc_scale;
-    else
-        scale = s->c_dc_scale;
-    if (IS_3IV1)
-        scale = 8;
-
-    wrap   = s->block_wrap[n];
-    dc_val = s->dc_val[0] + s->block_index[n];
-
-    /* B C
-     * A X
-     */
-    a = dc_val[-1];
-    b = dc_val[-1 - wrap];
-    c = dc_val[-wrap];
-
-    /* outside slice handling (we can't do that by memset as we need the
-     * dc for error resilience) */
-    if (s->first_slice_line && n != 3) {
-        if (n != 2)
-            b = c = 1024;
-        if (n != 1 && s->mb_x == s->resync_mb_x)
-            b = a = 1024;
-    }
-    if (s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y + 1) {
-        if (n == 0 || n == 4 || n == 5)
-            b = 1024;
-    }
-
-    if (abs(a - b) < abs(b - c)) {
-        pred     = c;
-        *dir_ptr = 1; /* top */
-    } else {
-        pred     = a;
-        *dir_ptr = 0; /* left */
-    }
-    /* we assume pred is positive */
-    pred = FASTDIV((pred + (scale >> 1)), scale);
-
-    if (encoding) {
-        ret = level - pred;
-    } else {
-        level += pred;
-        ret    = level;
-        if (s->err_recognition & AV_EF_BITSTREAM) {
-            if (level < 0) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "dc<0 at %dx%d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-            if (level * scale > 2048 + scale) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "dc overflow at %dx%d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-        }
-    }
-    level *= scale;
-    if (level & (~2047)) {
-        if (level < 0)
-            level = 0;
-        else if (!(s->workaround_bugs & FF_BUG_DC_CLIP))
-            level = 2047;
-    }
-    dc_val[0] = level;
-
-    return ret;
-}
-
-#endif /* AVCODEC_MPEG4VIDEO_H */
diff --git a/deps/libav/libavcodec/mpeg4video_parser.c b/deps/libav/libavcodec/mpeg4video_parser.c
deleted file mode 100644
index a5689aa..0000000
--- a/deps/libav/libavcodec/mpeg4video_parser.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * MPEG4 Video frame extraction
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "internal.h"
-#include "parser.h"
-#include "mpegvideo.h"
-#include "mpeg4video.h"
-#include "mpeg4video_parser.h"
-
-struct Mp4vParseContext {
-    ParseContext pc;
-    Mpeg4DecContext dec_ctx;
-    int first_picture;
-};
-
-int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
-{
-    int vop_found, i;
-    uint32_t state;
-
-    vop_found = pc->frame_start_found;
-    state     = pc->state;
-
-    i = 0;
-    if (!vop_found) {
-        for (i = 0; i < buf_size; i++) {
-            state = (state << 8) | buf[i];
-            if (state == 0x1B6) {
-                i++;
-                vop_found = 1;
-                break;
-            }
-        }
-    }
-
-    if (vop_found) {
-        /* EOF considered as end of frame */
-        if (buf_size == 0)
-            return 0;
-        for (; i < buf_size; i++) {
-            state = (state << 8) | buf[i];
-            if ((state & 0xFFFFFF00) == 0x100) {
-                pc->frame_start_found = 0;
-                pc->state             = -1;
-                return i - 3;
-            }
-        }
-    }
-    pc->frame_start_found = vop_found;
-    pc->state             = state;
-    return END_NOT_FOUND;
-}
-
-/* XXX: make it use less memory */
-static int av_mpeg4_decode_header(AVCodecParserContext *s1,
-                                  AVCodecContext *avctx,
-                                  const uint8_t *buf, int buf_size)
-{
-    struct Mp4vParseContext *pc = s1->priv_data;
-    Mpeg4DecContext *dec_ctx = &pc->dec_ctx;
-    MpegEncContext *s = &dec_ctx->m;
-    GetBitContext gb1, *gb = &gb1;
-    int ret;
-
-    s->avctx               = avctx;
-    s->current_picture_ptr = &s->current_picture;
-
-    if (avctx->extradata_size && pc->first_picture) {
-        init_get_bits(gb, avctx->extradata, avctx->extradata_size * 8);
-        ret = ff_mpeg4_decode_picture_header(dec_ctx, gb);
-    }
-
-    init_get_bits(gb, buf, 8 * buf_size);
-    ret = ff_mpeg4_decode_picture_header(dec_ctx, gb);
-    if (s->width && (!avctx->width || !avctx->height ||
-                     !avctx->coded_width || !avctx->coded_height)) {
-        ret = ff_set_dimensions(avctx, s->width, s->height);
-        if (ret < 0)
-            return ret;
-    }
-    s1->pict_type     = s->pict_type;
-    pc->first_picture = 0;
-    return ret;
-}
-
-static av_cold int mpeg4video_parse_init(AVCodecParserContext *s)
-{
-    struct Mp4vParseContext *pc = s->priv_data;
-
-    pc->first_picture           = 1;
-    pc->dec_ctx.m.slice_context_count = 1;
-    return 0;
-}
-
-static int mpeg4video_parse(AVCodecParserContext *s,
-                            AVCodecContext *avctx,
-                            const uint8_t **poutbuf, int *poutbuf_size,
-                            const uint8_t *buf, int buf_size)
-{
-    ParseContext *pc = s->priv_data;
-    int next;
-
-    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
-        next = buf_size;
-    } else {
-        next = ff_mpeg4_find_frame_end(pc, buf, buf_size);
-
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf      = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-    }
-    av_mpeg4_decode_header(s, avctx, buf, buf_size);
-
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_mpeg4video_parser = {
-    .codec_ids      = { AV_CODEC_ID_MPEG4 },
-    .priv_data_size = sizeof(struct Mp4vParseContext),
-    .parser_init    = mpeg4video_parse_init,
-    .parser_parse   = mpeg4video_parse,
-    .parser_close   = ff_parse_close,
-    .split          = ff_mpeg4video_split,
-};
diff --git a/deps/libav/libavcodec/mpeg4video_parser.h b/deps/libav/libavcodec/mpeg4video_parser.h
deleted file mode 100644
index 0f56e7f..0000000
--- a/deps/libav/libavcodec/mpeg4video_parser.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * MPEG4 video parser prototypes
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPEG4VIDEO_PARSER_H
-#define AVCODEC_MPEG4VIDEO_PARSER_H
-
-#include "parser.h"
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
-
-#endif /* AVCODEC_MPEG4VIDEO_PARSER_H */
diff --git a/deps/libav/libavcodec/mpeg4videodec.c b/deps/libav/libavcodec/mpeg4videodec.c
deleted file mode 100644
index b6925ac..0000000
--- a/deps/libav/libavcodec/mpeg4videodec.c
+++ /dev/null
@@ -1,2641 +0,0 @@
-/*
- * MPEG4 decoder.
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "error_resilience.h"
-#include "internal.h"
-#include "mpegvideo.h"
-#include "mpeg4video.h"
-#include "h263.h"
-#include "thread.h"
-
-/* The defines below define the number of bits that are read at once for
- * reading vlc values. Changing these may improve speed and data cache needs
- * be aware though that decreasing them may need the number of stages that is
- * passed to get_vlc* to be increased. */
-#define SPRITE_TRAJ_VLC_BITS 6
-#define DC_VLC_BITS 9
-#define MB_TYPE_B_VLC_BITS 4
-
-static VLC dc_lum, dc_chrom;
-static VLC sprite_trajectory;
-static VLC mb_type_b_vlc;
-
-static const int mb_type_b_map[4] = {
-    MB_TYPE_DIRECT2 | MB_TYPE_L0L1,
-    MB_TYPE_L0L1    | MB_TYPE_16x16,
-    MB_TYPE_L1      | MB_TYPE_16x16,
-    MB_TYPE_L0      | MB_TYPE_16x16,
-};
-
-/**
- * Predict the ac.
- * @param n block index (0-3 are luma, 4-5 are chroma)
- * @param dir the ac prediction direction
- */
-void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n, int dir)
-{
-    int i;
-    int16_t *ac_val, *ac_val1;
-    int8_t *const qscale_table = s->current_picture.qscale_table;
-
-    /* find prediction */
-    ac_val  = s->ac_val[0][0] + s->block_index[n] * 16;
-    ac_val1 = ac_val;
-    if (s->ac_pred) {
-        if (dir == 0) {
-            const int xy = s->mb_x - 1 + s->mb_y * s->mb_stride;
-            /* left prediction */
-            ac_val -= 16;
-
-            if (s->mb_x == 0 || s->qscale == qscale_table[xy] ||
-                n == 1 || n == 3) {
-                /* same qscale */
-                for (i = 1; i < 8; i++)
-                    block[s->dsp.idct_permutation[i << 3]] += ac_val[i];
-            } else {
-                /* different qscale, we must rescale */
-                for (i = 1; i < 8; i++)
-                    block[s->dsp.idct_permutation[i << 3]] += ROUNDED_DIV(ac_val[i] * qscale_table[xy], s->qscale);
-            }
-        } else {
-            const int xy = s->mb_x + s->mb_y * s->mb_stride - s->mb_stride;
-            /* top prediction */
-            ac_val -= 16 * s->block_wrap[n];
-
-            if (s->mb_y == 0 || s->qscale == qscale_table[xy] ||
-                n == 2 || n == 3) {
-                /* same qscale */
-                for (i = 1; i < 8; i++)
-                    block[s->dsp.idct_permutation[i]] += ac_val[i + 8];
-            } else {
-                /* different qscale, we must rescale */
-                for (i = 1; i < 8; i++)
-                    block[s->dsp.idct_permutation[i]] += ROUNDED_DIV(ac_val[i + 8] * qscale_table[xy], s->qscale);
-            }
-        }
-    }
-    /* left copy */
-    for (i = 1; i < 8; i++)
-        ac_val1[i] = block[s->dsp.idct_permutation[i << 3]];
-
-    /* top copy */
-    for (i = 1; i < 8; i++)
-        ac_val1[8 + i] = block[s->dsp.idct_permutation[i]];
-}
-
-/**
- * check if the next stuff is a resync marker or the end.
- * @return 0 if not
- */
-static inline int mpeg4_is_resync(MpegEncContext *s)
-{
-    int bits_count = get_bits_count(&s->gb);
-    int v          = show_bits(&s->gb, 16);
-
-    if (s->workaround_bugs & FF_BUG_NO_PADDING)
-        return 0;
-
-    while (v <= 0xFF) {
-        if (s->pict_type == AV_PICTURE_TYPE_B ||
-            (v >> (8 - s->pict_type) != 1) || s->partitioned_frame)
-            break;
-        skip_bits(&s->gb, 8 + s->pict_type);
-        bits_count += 8 + s->pict_type;
-        v = show_bits(&s->gb, 16);
-    }
-
-    if (bits_count + 8 >= s->gb.size_in_bits) {
-        v >>= 8;
-        v  |= 0x7F >> (7 - (bits_count & 7));
-
-        if (v == 0x7F)
-            return 1;
-    } else {
-        if (v == ff_mpeg4_resync_prefix[bits_count & 7]) {
-            int len;
-            GetBitContext gb = s->gb;
-
-            skip_bits(&s->gb, 1);
-            align_get_bits(&s->gb);
-
-            for (len = 0; len < 32; len++)
-                if (get_bits1(&s->gb))
-                    break;
-
-            s->gb = gb;
-
-            if (len >= ff_mpeg4_get_video_packet_prefix_length(s))
-                return 1;
-        }
-    }
-    return 0;
-}
-
-static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *gb)
-{
-    MpegEncContext *s = &ctx->m;
-    int a     = 2 << s->sprite_warping_accuracy;
-    int rho   = 3  - s->sprite_warping_accuracy;
-    int r     = 16 / a;
-    int alpha = 0;
-    int beta  = 0;
-    int w     = s->width;
-    int h     = s->height;
-    int min_ab, i, w2, h2, w3, h3;
-    int sprite_ref[4][2];
-    int virtual_ref[2][2];
-
-    // only true for rectangle shapes
-    const int vop_ref[4][2] = { { 0, 0 },         { s->width, 0 },
-                                { 0, s->height }, { s->width, s->height } };
-    int d[4][2]             = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
-
-    if (w <= 0 || h <= 0)
-        return AVERROR_INVALIDDATA;
-
-    for (i = 0; i < ctx->num_sprite_warping_points; i++) {
-        int length;
-        int x = 0, y = 0;
-
-        length = get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);
-        if (length)
-            x = get_xbits(gb, length);
-
-        if (!(ctx->divx_version == 500 && ctx->divx_build == 413))
-            skip_bits1(gb);     /* marker bit */
-
-        length = get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);
-        if (length)
-            y = get_xbits(gb, length);
-
-        skip_bits1(gb);         /* marker bit */
-        ctx->sprite_traj[i][0] = d[i][0] = x;
-        ctx->sprite_traj[i][1] = d[i][1] = y;
-    }
-    for (; i < 4; i++)
-        ctx->sprite_traj[i][0] = ctx->sprite_traj[i][1] = 0;
-
-    while ((1 << alpha) < w)
-        alpha++;
-    while ((1 << beta) < h)
-        beta++;  /* typo in the mpeg4 std for the definition of w' and h' */
-    w2 = 1 << alpha;
-    h2 = 1 << beta;
-
-    // Note, the 4th point isn't used for GMC
-    if (ctx->divx_version == 500 && ctx->divx_build == 413) {
-        sprite_ref[0][0] = a * vop_ref[0][0] + d[0][0];
-        sprite_ref[0][1] = a * vop_ref[0][1] + d[0][1];
-        sprite_ref[1][0] = a * vop_ref[1][0] + d[0][0] + d[1][0];
-        sprite_ref[1][1] = a * vop_ref[1][1] + d[0][1] + d[1][1];
-        sprite_ref[2][0] = a * vop_ref[2][0] + d[0][0] + d[2][0];
-        sprite_ref[2][1] = a * vop_ref[2][1] + d[0][1] + d[2][1];
-    } else {
-        sprite_ref[0][0] = (a >> 1) * (2 * vop_ref[0][0] + d[0][0]);
-        sprite_ref[0][1] = (a >> 1) * (2 * vop_ref[0][1] + d[0][1]);
-        sprite_ref[1][0] = (a >> 1) * (2 * vop_ref[1][0] + d[0][0] + d[1][0]);
-        sprite_ref[1][1] = (a >> 1) * (2 * vop_ref[1][1] + d[0][1] + d[1][1]);
-        sprite_ref[2][0] = (a >> 1) * (2 * vop_ref[2][0] + d[0][0] + d[2][0]);
-        sprite_ref[2][1] = (a >> 1) * (2 * vop_ref[2][1] + d[0][1] + d[2][1]);
-    }
-    /* sprite_ref[3][0] = (a >> 1) * (2 * vop_ref[3][0] + d[0][0] + d[1][0] + d[2][0] + d[3][0]);
-     * sprite_ref[3][1] = (a >> 1) * (2 * vop_ref[3][1] + d[0][1] + d[1][1] + d[2][1] + d[3][1]); */
-
-    /* this is mostly identical to the mpeg4 std (and is totally unreadable
-     * because of that...). Perhaps it should be reordered to be more readable.
-     * The idea behind this virtual_ref mess is to be able to use shifts later
-     * per pixel instead of divides so the distance between points is converted
-     * from w&h based to w2&h2 based which are of the 2^x form. */
-    virtual_ref[0][0] = 16 * (vop_ref[0][0] + w2) +
-                         ROUNDED_DIV(((w - w2) *
-                                      (r * sprite_ref[0][0] - 16 * vop_ref[0][0]) +
-                                      w2 * (r * sprite_ref[1][0] - 16 * vop_ref[1][0])), w);
-    virtual_ref[0][1] = 16 * vop_ref[0][1] +
-                        ROUNDED_DIV(((w - w2) *
-                                     (r * sprite_ref[0][1] - 16 * vop_ref[0][1]) +
-                                     w2 * (r * sprite_ref[1][1] - 16 * vop_ref[1][1])), w);
-    virtual_ref[1][0] = 16 * vop_ref[0][0] +
-                        ROUNDED_DIV(((h - h2) * (r * sprite_ref[0][0] - 16 * vop_ref[0][0]) +
-                                     h2 * (r * sprite_ref[2][0] - 16 * vop_ref[2][0])), h);
-    virtual_ref[1][1] = 16 * (vop_ref[0][1] + h2) +
-                        ROUNDED_DIV(((h - h2) * (r * sprite_ref[0][1] - 16 * vop_ref[0][1]) +
-                                     h2 * (r * sprite_ref[2][1] - 16 * vop_ref[2][1])), h);
-
-    switch (ctx->num_sprite_warping_points) {
-    case 0:
-        s->sprite_offset[0][0] =
-        s->sprite_offset[0][1] =
-        s->sprite_offset[1][0] =
-        s->sprite_offset[1][1] = 0;
-        s->sprite_delta[0][0]  = a;
-        s->sprite_delta[0][1]  =
-        s->sprite_delta[1][0]  = 0;
-        s->sprite_delta[1][1]  = a;
-        ctx->sprite_shift[0]   =
-        ctx->sprite_shift[1]   = 0;
-        break;
-    case 1:     // GMC only
-        s->sprite_offset[0][0] = sprite_ref[0][0] - a * vop_ref[0][0];
-        s->sprite_offset[0][1] = sprite_ref[0][1] - a * vop_ref[0][1];
-        s->sprite_offset[1][0] = ((sprite_ref[0][0] >> 1) | (sprite_ref[0][0] & 1)) -
-                                 a * (vop_ref[0][0] / 2);
-        s->sprite_offset[1][1] = ((sprite_ref[0][1] >> 1) | (sprite_ref[0][1] & 1)) -
-                                 a * (vop_ref[0][1] / 2);
-        s->sprite_delta[0][0]  = a;
-        s->sprite_delta[0][1]  =
-        s->sprite_delta[1][0]  = 0;
-        s->sprite_delta[1][1]  = a;
-        ctx->sprite_shift[0]   =
-        ctx->sprite_shift[1]   = 0;
-        break;
-    case 2:
-        s->sprite_offset[0][0] = (sprite_ref[0][0] << (alpha + rho)) +
-                                 (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
-                                 (-vop_ref[0][0]) +
-                                 (r * sprite_ref[0][1] - virtual_ref[0][1]) *
-                                 (-vop_ref[0][1]) + (1 << (alpha + rho - 1));
-        s->sprite_offset[0][1] = (sprite_ref[0][1] << (alpha + rho)) +
-                                 (-r * sprite_ref[0][1] + virtual_ref[0][1]) *
-                                 (-vop_ref[0][0]) +
-                                 (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
-                                 (-vop_ref[0][1]) + (1 << (alpha + rho - 1));
-        s->sprite_offset[1][0] = ((-r * sprite_ref[0][0] + virtual_ref[0][0]) *
-                                  (-2 * vop_ref[0][0] + 1) +
-                                  (r * sprite_ref[0][1] - virtual_ref[0][1]) *
-                                  (-2 * vop_ref[0][1] + 1) + 2 * w2 * r *
-                                  sprite_ref[0][0] - 16 * w2 + (1 << (alpha + rho + 1)));
-        s->sprite_offset[1][1] = ((-r * sprite_ref[0][1] + virtual_ref[0][1]) *
-                                  (-2 * vop_ref[0][0] + 1) +
-                                  (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
-                                  (-2 * vop_ref[0][1] + 1) + 2 * w2 * r *
-                                  sprite_ref[0][1] - 16 * w2 + (1 << (alpha + rho + 1)));
-        s->sprite_delta[0][0] = (-r * sprite_ref[0][0] + virtual_ref[0][0]);
-        s->sprite_delta[0][1] = (+r * sprite_ref[0][1] - virtual_ref[0][1]);
-        s->sprite_delta[1][0] = (-r * sprite_ref[0][1] + virtual_ref[0][1]);
-        s->sprite_delta[1][1] = (-r * sprite_ref[0][0] + virtual_ref[0][0]);
-
-        ctx->sprite_shift[0]  = alpha + rho;
-        ctx->sprite_shift[1]  = alpha + rho + 2;
-        break;
-    case 3:
-        min_ab = FFMIN(alpha, beta);
-        w3     = w2 >> min_ab;
-        h3     = h2 >> min_ab;
-        s->sprite_offset[0][0] = (sprite_ref[0][0] << (alpha + beta + rho - min_ab)) +
-                                 (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
-                                 h3 * (-vop_ref[0][0]) +
-                                 (-r * sprite_ref[0][0] + virtual_ref[1][0]) *
-                                 w3 * (-vop_ref[0][1]) +
-                                 (1 << (alpha + beta + rho - min_ab - 1));
-        s->sprite_offset[0][1] = (sprite_ref[0][1] << (alpha + beta + rho - min_ab)) +
-                                 (-r * sprite_ref[0][1] + virtual_ref[0][1]) *
-                                 h3 * (-vop_ref[0][0]) +
-                                 (-r * sprite_ref[0][1] + virtual_ref[1][1]) *
-                                 w3 * (-vop_ref[0][1]) +
-                                 (1 << (alpha + beta + rho - min_ab - 1));
-        s->sprite_offset[1][0] = (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
-                                 h3 * (-2 * vop_ref[0][0] + 1) +
-                                 (-r * sprite_ref[0][0] + virtual_ref[1][0]) *
-                                 w3 * (-2 * vop_ref[0][1] + 1) + 2 * w2 * h3 *
-                                 r * sprite_ref[0][0] - 16 * w2 * h3 +
-                                 (1 << (alpha + beta + rho - min_ab + 1));
-        s->sprite_offset[1][1] = (-r * sprite_ref[0][1] + virtual_ref[0][1]) *
-                                 h3 * (-2 * vop_ref[0][0] + 1) +
-                                 (-r * sprite_ref[0][1] + virtual_ref[1][1]) *
-                                 w3 * (-2 * vop_ref[0][1] + 1) + 2 * w2 * h3 *
-                                 r * sprite_ref[0][1] - 16 * w2 * h3 +
-                                 (1 << (alpha + beta + rho - min_ab + 1));
-        s->sprite_delta[0][0] = (-r * sprite_ref[0][0] + virtual_ref[0][0]) * h3;
-        s->sprite_delta[0][1] = (-r * sprite_ref[0][0] + virtual_ref[1][0]) * w3;
-        s->sprite_delta[1][0] = (-r * sprite_ref[0][1] + virtual_ref[0][1]) * h3;
-        s->sprite_delta[1][1] = (-r * sprite_ref[0][1] + virtual_ref[1][1]) * w3;
-
-        ctx->sprite_shift[0]  = alpha + beta + rho - min_ab;
-        ctx->sprite_shift[1]  = alpha + beta + rho - min_ab + 2;
-        break;
-    }
-    /* try to simplify the situation */
-    if (s->sprite_delta[0][0] == a << ctx->sprite_shift[0] &&
-        s->sprite_delta[0][1] == 0 &&
-        s->sprite_delta[1][0] == 0 &&
-        s->sprite_delta[1][1] == a << ctx->sprite_shift[0]) {
-        s->sprite_offset[0][0] >>= ctx->sprite_shift[0];
-        s->sprite_offset[0][1] >>= ctx->sprite_shift[0];
-        s->sprite_offset[1][0] >>= ctx->sprite_shift[1];
-        s->sprite_offset[1][1] >>= ctx->sprite_shift[1];
-        s->sprite_delta[0][0] = a;
-        s->sprite_delta[0][1] = 0;
-        s->sprite_delta[1][0] = 0;
-        s->sprite_delta[1][1] = a;
-        ctx->sprite_shift[0] = 0;
-        ctx->sprite_shift[1] = 0;
-        s->real_sprite_warping_points = 1;
-    } else {
-        int shift_y = 16 - ctx->sprite_shift[0];
-        int shift_c = 16 - ctx->sprite_shift[1];
-        for (i = 0; i < 2; i++) {
-            s->sprite_offset[0][i] <<= shift_y;
-            s->sprite_offset[1][i] <<= shift_c;
-            s->sprite_delta[0][i]  <<= shift_y;
-            s->sprite_delta[1][i]  <<= shift_y;
-            ctx->sprite_shift[i]     = 16;
-        }
-        s->real_sprite_warping_points = ctx->num_sprite_warping_points;
-    }
-
-    return 0;
-}
-
-/**
- * Decode the next video packet.
- * @return <0 if something went wrong
- */
-int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx)
-{
-    MpegEncContext *s = &ctx->m;
-
-    int mb_num_bits      = av_log2(s->mb_num - 1) + 1;
-    int header_extension = 0, mb_num, len;
-
-    /* is there enough space left for a video packet + header */
-    if (get_bits_count(&s->gb) > s->gb.size_in_bits - 20)
-        return -1;
-
-    for (len = 0; len < 32; len++)
-        if (get_bits1(&s->gb))
-            break;
-
-    if (len != ff_mpeg4_get_video_packet_prefix_length(s)) {
-        av_log(s->avctx, AV_LOG_ERROR, "marker does not match f_code\n");
-        return -1;
-    }
-
-    if (ctx->shape != RECT_SHAPE) {
-        header_extension = get_bits1(&s->gb);
-        // FIXME more stuff here
-    }
-
-    mb_num = get_bits(&s->gb, mb_num_bits);
-    if (mb_num >= s->mb_num) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "illegal mb_num in video packet (%d %d) \n", mb_num, s->mb_num);
-        return -1;
-    }
-    if (s->pict_type == AV_PICTURE_TYPE_B) {
-        int mb_x = 0, mb_y = 0;
-
-        while (s->next_picture.mbskip_table[s->mb_index2xy[mb_num]]) {
-            if (!mb_x)
-                ff_thread_await_progress(&s->next_picture_ptr->tf, mb_y++, 0);
-            mb_num++;
-            if (++mb_x == s->mb_width)
-                mb_x = 0;
-        }
-        if (mb_num >= s->mb_num)
-            return -1;  // slice contains just skipped MBs (already decoded)
-    }
-
-    s->mb_x = mb_num % s->mb_width;
-    s->mb_y = mb_num / s->mb_width;
-
-    if (ctx->shape != BIN_ONLY_SHAPE) {
-        int qscale = get_bits(&s->gb, s->quant_precision);
-        if (qscale)
-            s->chroma_qscale = s->qscale = qscale;
-    }
-
-    if (ctx->shape == RECT_SHAPE)
-        header_extension = get_bits1(&s->gb);
-
-    if (header_extension) {
-        int time_incr = 0;
-
-        while (get_bits1(&s->gb) != 0)
-            time_incr++;
-
-        check_marker(&s->gb, "before time_increment in video packed header");
-        skip_bits(&s->gb, ctx->time_increment_bits);      /* time_increment */
-        check_marker(&s->gb, "before vop_coding_type in video packed header");
-
-        skip_bits(&s->gb, 2); /* vop coding type */
-        // FIXME not rect stuff here
-
-        if (ctx->shape != BIN_ONLY_SHAPE) {
-            skip_bits(&s->gb, 3); /* intra dc vlc threshold */
-            // FIXME don't just ignore everything
-            if (s->pict_type == AV_PICTURE_TYPE_S &&
-                ctx->vol_sprite_usage == GMC_SPRITE) {
-                if (mpeg4_decode_sprite_trajectory(ctx, &s->gb) < 0)
-                    return AVERROR_INVALIDDATA;
-                av_log(s->avctx, AV_LOG_ERROR, "untested\n");
-            }
-
-            // FIXME reduced res stuff here
-
-            if (s->pict_type != AV_PICTURE_TYPE_I) {
-                int f_code = get_bits(&s->gb, 3);       /* fcode_for */
-                if (f_code == 0)
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "Error, video packet header damaged (f_code=0)\n");
-            }
-            if (s->pict_type == AV_PICTURE_TYPE_B) {
-                int b_code = get_bits(&s->gb, 3);
-                if (b_code == 0)
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "Error, video packet header damaged (b_code=0)\n");
-            }
-        }
-    }
-    // FIXME new-pred stuff
-
-    return 0;
-}
-
-/**
- * Get the average motion vector for a GMC MB.
- * @param n either 0 for the x component or 1 for y
- * @return the average MV for a GMC MB
- */
-static inline int get_amv(Mpeg4DecContext *ctx, int n)
-{
-    MpegEncContext *s = &ctx->m;
-    int x, y, mb_v, sum, dx, dy, shift;
-    int len     = 1 << (s->f_code + 4);
-    const int a = s->sprite_warping_accuracy;
-
-    if (s->workaround_bugs & FF_BUG_AMV)
-        len >>= s->quarter_sample;
-
-    if (s->real_sprite_warping_points == 1) {
-        if (ctx->divx_version == 500 && ctx->divx_build == 413)
-            sum = s->sprite_offset[0][n] / (1 << (a - s->quarter_sample));
-        else
-            sum = RSHIFT(s->sprite_offset[0][n] << s->quarter_sample, a);
-    } else {
-        dx    = s->sprite_delta[n][0];
-        dy    = s->sprite_delta[n][1];
-        shift = ctx->sprite_shift[0];
-        if (n)
-            dy -= 1 << (shift + a + 1);
-        else
-            dx -= 1 << (shift + a + 1);
-        mb_v = s->sprite_offset[0][n] + dx * s->mb_x * 16 + dy * s->mb_y * 16;
-
-        sum = 0;
-        for (y = 0; y < 16; y++) {
-            int v;
-
-            v = mb_v + dy * y;
-            // FIXME optimize
-            for (x = 0; x < 16; x++) {
-                sum += v >> shift;
-                v   += dx;
-            }
-        }
-        sum = RSHIFT(sum, a + 8 - s->quarter_sample);
-    }
-
-    if (sum < -len)
-        sum = -len;
-    else if (sum >= len)
-        sum = len - 1;
-
-    return sum;
-}
-
-/**
- * Decode the dc value.
- * @param n block index (0-3 are luma, 4-5 are chroma)
- * @param dir_ptr the prediction direction will be stored here
- * @return the quantized dc
- */
-static inline int mpeg4_decode_dc(MpegEncContext *s, int n, int *dir_ptr)
-{
-    int level, code;
-
-    if (n < 4)
-        code = get_vlc2(&s->gb, dc_lum.table, DC_VLC_BITS, 1);
-    else
-        code = get_vlc2(&s->gb, dc_chrom.table, DC_VLC_BITS, 1);
-
-    if (code < 0 || code > 9 /* && s->nbit < 9 */) {
-        av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
-        return -1;
-    }
-
-    if (code == 0) {
-        level = 0;
-    } else {
-        if (IS_3IV1) {
-            if (code == 1)
-                level = 2 * get_bits1(&s->gb) - 1;
-            else {
-                if (get_bits1(&s->gb))
-                    level = get_bits(&s->gb, code - 1) + (1 << (code - 1));
-                else
-                    level = -get_bits(&s->gb, code - 1) - (1 << (code - 1));
-            }
-        } else {
-            level = get_xbits(&s->gb, code);
-        }
-
-        if (code > 8) {
-            if (get_bits1(&s->gb) == 0) { /* marker */
-                if (s->err_recognition & AV_EF_BITSTREAM) {
-                    av_log(s->avctx, AV_LOG_ERROR, "dc marker bit missing\n");
-                    return -1;
-                }
-            }
-        }
-    }
-
-    return ff_mpeg4_pred_dc(s, n, level, dir_ptr, 0);
-}
-
-/**
- * Decode first partition.
- * @return number of MBs decoded or <0 if an error occurred
- */
-static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx)
-{
-    MpegEncContext *s = &ctx->m;
-    int mb_num = 0;
-    static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
-
-    /* decode first partition */
-    s->first_slice_line = 1;
-    for (; s->mb_y < s->mb_height; s->mb_y++) {
-        ff_init_block_index(s);
-        for (; s->mb_x < s->mb_width; s->mb_x++) {
-            const int xy = s->mb_x + s->mb_y * s->mb_stride;
-            int cbpc;
-            int dir = 0;
-
-            mb_num++;
-            ff_update_block_index(s);
-            if (s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y + 1)
-                s->first_slice_line = 0;
-
-            if (s->pict_type == AV_PICTURE_TYPE_I) {
-                int i;
-
-                do {
-                    if (show_bits_long(&s->gb, 19) == DC_MARKER)
-                        return mb_num - 1;
-
-                    cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
-                    if (cbpc < 0) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
-                        return -1;
-                    }
-                } while (cbpc == 8);
-
-                s->cbp_table[xy]               = cbpc & 3;
-                s->current_picture.mb_type[xy] = MB_TYPE_INTRA;
-                s->mb_intra                    = 1;
-
-                if (cbpc & 4)
-                    ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
-
-                s->current_picture.qscale_table[xy] = s->qscale;
-
-                s->mbintra_table[xy] = 1;
-                for (i = 0; i < 6; i++) {
-                    int dc_pred_dir;
-                    int dc = mpeg4_decode_dc(s, i, &dc_pred_dir);
-                    if (dc < 0) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "DC corrupted at %d %d\n", s->mb_x, s->mb_y);
-                        return -1;
-                    }
-                    dir <<= 1;
-                    if (dc_pred_dir)
-                        dir |= 1;
-                }
-                s->pred_dir_table[xy] = dir;
-            } else { /* P/S_TYPE */
-                int mx, my, pred_x, pred_y, bits;
-                int16_t *const mot_val = s->current_picture.motion_val[0][s->block_index[0]];
-                const int stride       = s->b8_stride * 2;
-
-try_again:
-                bits = show_bits(&s->gb, 17);
-                if (bits == MOTION_MARKER)
-                    return mb_num - 1;
-
-                skip_bits1(&s->gb);
-                if (bits & 0x10000) {
-                    /* skip mb */
-                    if (s->pict_type == AV_PICTURE_TYPE_S &&
-                        ctx->vol_sprite_usage == GMC_SPRITE) {
-                        s->current_picture.mb_type[xy] = MB_TYPE_SKIP  |
-                                                         MB_TYPE_16x16 |
-                                                         MB_TYPE_GMC   |
-                                                         MB_TYPE_L0;
-                        mx = get_amv(ctx, 0);
-                        my = get_amv(ctx, 1);
-                    } else {
-                        s->current_picture.mb_type[xy] = MB_TYPE_SKIP  |
-                                                         MB_TYPE_16x16 |
-                                                         MB_TYPE_L0;
-                        mx = my = 0;
-                    }
-                    mot_val[0]          =
-                    mot_val[2]          =
-                    mot_val[0 + stride] =
-                    mot_val[2 + stride] = mx;
-                    mot_val[1]          =
-                    mot_val[3]          =
-                    mot_val[1 + stride] =
-                    mot_val[3 + stride] = my;
-
-                    if (s->mbintra_table[xy])
-                        ff_clean_intra_table_entries(s);
-                    continue;
-                }
-
-                cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
-                if (cbpc < 0) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
-                    return -1;
-                }
-                if (cbpc == 20)
-                    goto try_again;
-
-                s->cbp_table[xy] = cbpc & (8 + 3);  // 8 is dquant
-
-                s->mb_intra = ((cbpc & 4) != 0);
-
-                if (s->mb_intra) {
-                    s->current_picture.mb_type[xy] = MB_TYPE_INTRA;
-                    s->mbintra_table[xy] = 1;
-                    mot_val[0]          =
-                    mot_val[2]          =
-                    mot_val[0 + stride] =
-                    mot_val[2 + stride] = 0;
-                    mot_val[1]          =
-                    mot_val[3]          =
-                    mot_val[1 + stride] =
-                    mot_val[3 + stride] = 0;
-                } else {
-                    if (s->mbintra_table[xy])
-                        ff_clean_intra_table_entries(s);
-
-                    if (s->pict_type == AV_PICTURE_TYPE_S &&
-                        ctx->vol_sprite_usage == GMC_SPRITE &&
-                        (cbpc & 16) == 0)
-                        s->mcsel = get_bits1(&s->gb);
-                    else
-                        s->mcsel = 0;
-
-                    if ((cbpc & 16) == 0) {
-                        /* 16x16 motion prediction */
-
-                        ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-                        if (!s->mcsel) {
-                            mx = ff_h263_decode_motion(s, pred_x, s->f_code);
-                            if (mx >= 0xffff)
-                                return -1;
-
-                            my = ff_h263_decode_motion(s, pred_y, s->f_code);
-                            if (my >= 0xffff)
-                                return -1;
-                            s->current_picture.mb_type[xy] = MB_TYPE_16x16 |
-                                                             MB_TYPE_L0;
-                        } else {
-                            mx = get_amv(ctx, 0);
-                            my = get_amv(ctx, 1);
-                            s->current_picture.mb_type[xy] = MB_TYPE_16x16 |
-                                                             MB_TYPE_GMC   |
-                                                             MB_TYPE_L0;
-                        }
-
-                        mot_val[0]          =
-                        mot_val[2]          =
-                        mot_val[0 + stride] =
-                        mot_val[2 + stride] = mx;
-                        mot_val[1]          =
-                        mot_val[3]          =
-                        mot_val[1 + stride] =
-                        mot_val[3 + stride] = my;
-                    } else {
-                        int i;
-                        s->current_picture.mb_type[xy] = MB_TYPE_8x8 |
-                                                         MB_TYPE_L0;
-                        for (i = 0; i < 4; i++) {
-                            int16_t *mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
-                            mx = ff_h263_decode_motion(s, pred_x, s->f_code);
-                            if (mx >= 0xffff)
-                                return -1;
-
-                            my = ff_h263_decode_motion(s, pred_y, s->f_code);
-                            if (my >= 0xffff)
-                                return -1;
-                            mot_val[0] = mx;
-                            mot_val[1] = my;
-                        }
-                    }
-                }
-            }
-        }
-        s->mb_x = 0;
-    }
-
-    return mb_num;
-}
-
-/**
- * decode second partition.
- * @return <0 if an error occurred
- */
-static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count)
-{
-    int mb_num = 0;
-    static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
-
-    s->mb_x = s->resync_mb_x;
-    s->first_slice_line = 1;
-    for (s->mb_y = s->resync_mb_y; mb_num < mb_count; s->mb_y++) {
-        ff_init_block_index(s);
-        for (; mb_num < mb_count && s->mb_x < s->mb_width; s->mb_x++) {
-            const int xy = s->mb_x + s->mb_y * s->mb_stride;
-
-            mb_num++;
-            ff_update_block_index(s);
-            if (s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y + 1)
-                s->first_slice_line = 0;
-
-            if (s->pict_type == AV_PICTURE_TYPE_I) {
-                int ac_pred = get_bits1(&s->gb);
-                int cbpy    = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
-                if (cbpy < 0) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
-                    return -1;
-                }
-
-                s->cbp_table[xy]               |= cbpy << 2;
-                s->current_picture.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED;
-            } else { /* P || S_TYPE */
-                if (IS_INTRA(s->current_picture.mb_type[xy])) {
-                    int i;
-                    int dir     = 0;
-                    int ac_pred = get_bits1(&s->gb);
-                    int cbpy    = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
-
-                    if (cbpy < 0) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "I cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
-                        return -1;
-                    }
-
-                    if (s->cbp_table[xy] & 8)
-                        ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
-                    s->current_picture.qscale_table[xy] = s->qscale;
-
-                    for (i = 0; i < 6; i++) {
-                        int dc_pred_dir;
-                        int dc = mpeg4_decode_dc(s, i, &dc_pred_dir);
-                        if (dc < 0) {
-                            av_log(s->avctx, AV_LOG_ERROR,
-                                   "DC corrupted at %d %d\n", s->mb_x, s->mb_y);
-                            return -1;
-                        }
-                        dir <<= 1;
-                        if (dc_pred_dir)
-                            dir |= 1;
-                    }
-                    s->cbp_table[xy]               &= 3;  // remove dquant
-                    s->cbp_table[xy]               |= cbpy << 2;
-                    s->current_picture.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED;
-                    s->pred_dir_table[xy]           = dir;
-                } else if (IS_SKIP(s->current_picture.mb_type[xy])) {
-                    s->current_picture.qscale_table[xy] = s->qscale;
-                    s->cbp_table[xy]                    = 0;
-                } else {
-                    int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
-
-                    if (cbpy < 0) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "P cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
-                        return -1;
-                    }
-
-                    if (s->cbp_table[xy] & 8)
-                        ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
-                    s->current_picture.qscale_table[xy] = s->qscale;
-
-                    s->cbp_table[xy] &= 3;  // remove dquant
-                    s->cbp_table[xy] |= (cbpy ^ 0xf) << 2;
-                }
-            }
-        }
-        if (mb_num >= mb_count)
-            return 0;
-        s->mb_x = 0;
-    }
-    return 0;
-}
-
-/**
- * Decode the first and second partition.
- * @return <0 if error (and sets error type in the error_status_table)
- */
-int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx)
-{
-    MpegEncContext *s = &ctx->m;
-    int mb_num;
-    const int part_a_error = s->pict_type == AV_PICTURE_TYPE_I ? (ER_DC_ERROR | ER_MV_ERROR) : ER_MV_ERROR;
-    const int part_a_end   = s->pict_type == AV_PICTURE_TYPE_I ? (ER_DC_END   | ER_MV_END)   : ER_MV_END;
-
-    mb_num = mpeg4_decode_partition_a(ctx);
-    if (mb_num < 0) {
-        ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                        s->mb_x, s->mb_y, part_a_error);
-        return -1;
-    }
-
-    if (s->resync_mb_x + s->resync_mb_y * s->mb_width + mb_num > s->mb_num) {
-        av_log(s->avctx, AV_LOG_ERROR, "slice below monitor ...\n");
-        ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                        s->mb_x, s->mb_y, part_a_error);
-        return -1;
-    }
-
-    s->mb_num_left = mb_num;
-
-    if (s->pict_type == AV_PICTURE_TYPE_I) {
-        while (show_bits(&s->gb, 9) == 1)
-            skip_bits(&s->gb, 9);
-        if (get_bits_long(&s->gb, 19) != DC_MARKER) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "marker missing after first I partition at %d %d\n",
-                   s->mb_x, s->mb_y);
-            return -1;
-        }
-    } else {
-        while (show_bits(&s->gb, 10) == 1)
-            skip_bits(&s->gb, 10);
-        if (get_bits(&s->gb, 17) != MOTION_MARKER) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "marker missing after first P partition at %d %d\n",
-                   s->mb_x, s->mb_y);
-            return -1;
-        }
-    }
-    ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                    s->mb_x - 1, s->mb_y, part_a_end);
-
-    if (mpeg4_decode_partition_b(s, mb_num) < 0) {
-        if (s->pict_type == AV_PICTURE_TYPE_P)
-            ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                            s->mb_x, s->mb_y, ER_DC_ERROR);
-        return -1;
-    } else {
-        if (s->pict_type == AV_PICTURE_TYPE_P)
-            ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
-                            s->mb_x - 1, s->mb_y, ER_DC_END);
-    }
-
-    return 0;
-}
-
-/**
- * Decode a block.
- * @return <0 if an error occurred
- */
-static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
-                                     int n, int coded, int intra, int rvlc)
-{
-    MpegEncContext *s = &ctx->m;
-    int level, i, last, run, qmul, qadd, dc_pred_dir;
-    RLTable *rl;
-    RL_VLC_ELEM *rl_vlc;
-    const uint8_t *scan_table;
-
-    // Note intra & rvlc should be optimized away if this is inlined
-
-    if (intra) {
-        if (ctx->use_intra_dc_vlc) {
-            /* DC coef */
-            if (s->partitioned_frame) {
-                level = s->dc_val[0][s->block_index[n]];
-                if (n < 4)
-                    level = FASTDIV((level + (s->y_dc_scale >> 1)), s->y_dc_scale);
-                else
-                    level = FASTDIV((level + (s->c_dc_scale >> 1)), s->c_dc_scale);
-                dc_pred_dir = (s->pred_dir_table[s->mb_x + s->mb_y * s->mb_stride] << n) & 32;
-            } else {
-                level = mpeg4_decode_dc(s, n, &dc_pred_dir);
-                if (level < 0)
-                    return -1;
-            }
-            block[0] = level;
-            i        = 0;
-        } else {
-            i = -1;
-            ff_mpeg4_pred_dc(s, n, 0, &dc_pred_dir, 0);
-        }
-        if (!coded)
-            goto not_coded;
-
-        if (rvlc) {
-            rl     = &ff_rvlc_rl_intra;
-            rl_vlc = ff_rvlc_rl_intra.rl_vlc[0];
-        } else {
-            rl     = &ff_mpeg4_rl_intra;
-            rl_vlc = ff_mpeg4_rl_intra.rl_vlc[0];
-        }
-        if (s->ac_pred) {
-            if (dc_pred_dir == 0)
-                scan_table = s->intra_v_scantable.permutated;  /* left */
-            else
-                scan_table = s->intra_h_scantable.permutated;  /* top */
-        } else {
-            scan_table = s->intra_scantable.permutated;
-        }
-        qmul = 1;
-        qadd = 0;
-    } else {
-        i = -1;
-        if (!coded) {
-            s->block_last_index[n] = i;
-            return 0;
-        }
-        if (rvlc)
-            rl = &ff_rvlc_rl_inter;
-        else
-            rl = &ff_h263_rl_inter;
-
-        scan_table = s->intra_scantable.permutated;
-
-        if (s->mpeg_quant) {
-            qmul = 1;
-            qadd = 0;
-            if (rvlc)
-                rl_vlc = ff_rvlc_rl_inter.rl_vlc[0];
-            else
-                rl_vlc = ff_h263_rl_inter.rl_vlc[0];
-        } else {
-            qmul = s->qscale << 1;
-            qadd = (s->qscale - 1) | 1;
-            if (rvlc)
-                rl_vlc = ff_rvlc_rl_inter.rl_vlc[s->qscale];
-            else
-                rl_vlc = ff_h263_rl_inter.rl_vlc[s->qscale];
-        }
-    }
-    {
-        OPEN_READER(re, &s->gb);
-        for (;;) {
-            UPDATE_CACHE(re, &s->gb);
-            GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0);
-            if (level == 0) {
-                /* escape */
-                if (rvlc) {
-                    if (SHOW_UBITS(re, &s->gb, 1) == 0) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "1. marker bit missing in rvlc esc\n");
-                        return -1;
-                    }
-                    SKIP_CACHE(re, &s->gb, 1);
-
-                    last = SHOW_UBITS(re, &s->gb, 1);
-                    SKIP_CACHE(re, &s->gb, 1);
-                    run = SHOW_UBITS(re, &s->gb, 6);
-                    SKIP_COUNTER(re, &s->gb, 1 + 1 + 6);
-                    UPDATE_CACHE(re, &s->gb);
-
-                    if (SHOW_UBITS(re, &s->gb, 1) == 0) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "2. marker bit missing in rvlc esc\n");
-                        return -1;
-                    }
-                    SKIP_CACHE(re, &s->gb, 1);
-
-                    level = SHOW_UBITS(re, &s->gb, 11);
-                    SKIP_CACHE(re, &s->gb, 11);
-
-                    if (SHOW_UBITS(re, &s->gb, 5) != 0x10) {
-                        av_log(s->avctx, AV_LOG_ERROR, "reverse esc missing\n");
-                        return -1;
-                    }
-                    SKIP_CACHE(re, &s->gb, 5);
-
-                    level = level * qmul + qadd;
-                    level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
-                    SKIP_COUNTER(re, &s->gb, 1 + 11 + 5 + 1);
-
-                    i += run + 1;
-                    if (last)
-                        i += 192;
-                } else {
-                    int cache;
-                    cache = GET_CACHE(re, &s->gb);
-
-                    if (IS_3IV1)
-                        cache ^= 0xC0000000;
-
-                    if (cache & 0x80000000) {
-                        if (cache & 0x40000000) {
-                            /* third escape */
-                            SKIP_CACHE(re, &s->gb, 2);
-                            last = SHOW_UBITS(re, &s->gb, 1);
-                            SKIP_CACHE(re, &s->gb, 1);
-                            run = SHOW_UBITS(re, &s->gb, 6);
-                            SKIP_COUNTER(re, &s->gb, 2 + 1 + 6);
-                            UPDATE_CACHE(re, &s->gb);
-
-                            if (IS_3IV1) {
-                                level = SHOW_SBITS(re, &s->gb, 12);
-                                LAST_SKIP_BITS(re, &s->gb, 12);
-                            } else {
-                                if (SHOW_UBITS(re, &s->gb, 1) == 0) {
-                                    av_log(s->avctx, AV_LOG_ERROR,
-                                           "1. marker bit missing in 3. esc\n");
-                                    return -1;
-                                }
-                                SKIP_CACHE(re, &s->gb, 1);
-
-                                level = SHOW_SBITS(re, &s->gb, 12);
-                                SKIP_CACHE(re, &s->gb, 12);
-
-                                if (SHOW_UBITS(re, &s->gb, 1) == 0) {
-                                    av_log(s->avctx, AV_LOG_ERROR,
-                                           "2. marker bit missing in 3. esc\n");
-                                    return -1;
-                                }
-
-                                SKIP_COUNTER(re, &s->gb, 1 + 12 + 1);
-                            }
-
-                            if (level > 0)
-                                level = level * qmul + qadd;
-                            else
-                                level = level * qmul - qadd;
-
-                            if ((unsigned)(level + 2048) > 4095) {
-                                if (s->err_recognition & AV_EF_BITSTREAM) {
-                                    if (level > 2560 || level < -2560) {
-                                        av_log(s->avctx, AV_LOG_ERROR,
-                                               "|level| overflow in 3. esc, qp=%d\n",
-                                               s->qscale);
-                                        return -1;
-                                    }
-                                }
-                                level = level < 0 ? -2048 : 2047;
-                            }
-
-                            i += run + 1;
-                            if (last)
-                                i += 192;
-                        } else {
-                            /* second escape */
-                            SKIP_BITS(re, &s->gb, 2);
-                            GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
-                            i    += run + rl->max_run[run >> 7][level / qmul] + 1;  // FIXME opt indexing
-                            level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
-                            LAST_SKIP_BITS(re, &s->gb, 1);
-                        }
-                    } else {
-                        /* first escape */
-                        SKIP_BITS(re, &s->gb, 1);
-                        GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
-                        i    += run;
-                        level = level + rl->max_level[run >> 7][(run - 1) & 63] * qmul;  // FIXME opt indexing
-                        level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
-                        LAST_SKIP_BITS(re, &s->gb, 1);
-                    }
-                }
-            } else {
-                i    += run;
-                level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
-                LAST_SKIP_BITS(re, &s->gb, 1);
-            }
-            if (i > 62) {
-                i -= 192;
-                if (i & (~63)) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
-                    return -1;
-                }
-
-                block[scan_table[i]] = level;
-                break;
-            }
-
-            block[scan_table[i]] = level;
-        }
-        CLOSE_READER(re, &s->gb);
-    }
-
-not_coded:
-    if (intra) {
-        if (!ctx->use_intra_dc_vlc) {
-            block[0] = ff_mpeg4_pred_dc(s, n, block[0], &dc_pred_dir, 0);
-
-            i -= i >> 31;  // if (i == -1) i = 0;
-        }
-
-        ff_mpeg4_pred_ac(s, block, n, dc_pred_dir);
-        if (s->ac_pred)
-            i = 63;  // FIXME not optimal
-    }
-    s->block_last_index[n] = i;
-    return 0;
-}
-
-/**
- * decode partition C of one MB.
- * @return <0 if an error occurred
- */
-static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
-{
-    Mpeg4DecContext *ctx = (Mpeg4DecContext *)s;
-    int cbp, mb_type;
-    const int xy = s->mb_x + s->mb_y * s->mb_stride;
-
-    mb_type = s->current_picture.mb_type[xy];
-    cbp     = s->cbp_table[xy];
-
-    ctx->use_intra_dc_vlc = s->qscale < ctx->intra_dc_threshold;
-
-    if (s->current_picture.qscale_table[xy] != s->qscale)
-        ff_set_qscale(s, s->current_picture.qscale_table[xy]);
-
-    if (s->pict_type == AV_PICTURE_TYPE_P ||
-        s->pict_type == AV_PICTURE_TYPE_S) {
-        int i;
-        for (i = 0; i < 4; i++) {
-            s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0];
-            s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1];
-        }
-        s->mb_intra = IS_INTRA(mb_type);
-
-        if (IS_SKIP(mb_type)) {
-            /* skip mb */
-            for (i = 0; i < 6; i++)
-                s->block_last_index[i] = -1;
-            s->mv_dir  = MV_DIR_FORWARD;
-            s->mv_type = MV_TYPE_16X16;
-            if (s->pict_type == AV_PICTURE_TYPE_S
-                && ctx->vol_sprite_usage == GMC_SPRITE) {
-                s->mcsel      = 1;
-                s->mb_skipped = 0;
-            } else {
-                s->mcsel      = 0;
-                s->mb_skipped = 1;
-            }
-        } else if (s->mb_intra) {
-            s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]);
-        } else if (!s->mb_intra) {
-            // s->mcsel = 0;  // FIXME do we need to init that?
-
-            s->mv_dir = MV_DIR_FORWARD;
-            if (IS_8X8(mb_type)) {
-                s->mv_type = MV_TYPE_8X8;
-            } else {
-                s->mv_type = MV_TYPE_16X16;
-            }
-        }
-    } else { /* I-Frame */
-        s->mb_intra = 1;
-        s->ac_pred  = IS_ACPRED(s->current_picture.mb_type[xy]);
-    }
-
-    if (!IS_SKIP(mb_type)) {
-        int i;
-        s->dsp.clear_blocks(s->block[0]);
-        /* decode each block */
-        for (i = 0; i < 6; i++) {
-            if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, s->mb_intra, ctx->rvlc) < 0) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "texture corrupted at %d %d %d\n",
-                       s->mb_x, s->mb_y, s->mb_intra);
-                return -1;
-            }
-            cbp += cbp;
-        }
-    }
-
-    /* per-MB end of slice check */
-    if (--s->mb_num_left <= 0) {
-        if (mpeg4_is_resync(s))
-            return SLICE_END;
-        else
-            return SLICE_NOEND;
-    } else {
-        if (mpeg4_is_resync(s)) {
-            const int delta = s->mb_x + 1 == s->mb_width ? 2 : 1;
-            if (s->cbp_table[xy + delta])
-                return SLICE_END;
-        }
-        return SLICE_OK;
-    }
-}
-
-static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64])
-{
-    Mpeg4DecContext *ctx = (Mpeg4DecContext *)s;
-    int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
-    int16_t *mot_val;
-    static int8_t quant_tab[4] = { -1, -2, 1, 2 };
-    const int xy = s->mb_x + s->mb_y * s->mb_stride;
-
-    assert(s->h263_pred);
-
-    if (s->pict_type == AV_PICTURE_TYPE_P ||
-        s->pict_type == AV_PICTURE_TYPE_S) {
-        do {
-            if (get_bits1(&s->gb)) {
-                /* skip mb */
-                s->mb_intra = 0;
-                for (i = 0; i < 6; i++)
-                    s->block_last_index[i] = -1;
-                s->mv_dir  = MV_DIR_FORWARD;
-                s->mv_type = MV_TYPE_16X16;
-                if (s->pict_type == AV_PICTURE_TYPE_S &&
-                    ctx->vol_sprite_usage == GMC_SPRITE) {
-                    s->current_picture.mb_type[xy] = MB_TYPE_SKIP  |
-                                                     MB_TYPE_GMC   |
-                                                     MB_TYPE_16x16 |
-                                                     MB_TYPE_L0;
-                    s->mcsel       = 1;
-                    s->mv[0][0][0] = get_amv(ctx, 0);
-                    s->mv[0][0][1] = get_amv(ctx, 1);
-                    s->mb_skipped  = 0;
-                } else {
-                    s->current_picture.mb_type[xy] = MB_TYPE_SKIP  |
-                                                     MB_TYPE_16x16 |
-                                                     MB_TYPE_L0;
-                    s->mcsel       = 0;
-                    s->mv[0][0][0] = 0;
-                    s->mv[0][0][1] = 0;
-                    s->mb_skipped  = 1;
-                }
-                goto end;
-            }
-            cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
-            if (cbpc < 0) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-        } while (cbpc == 20);
-
-        s->dsp.clear_blocks(s->block[0]);
-        dquant      = cbpc & 8;
-        s->mb_intra = ((cbpc & 4) != 0);
-        if (s->mb_intra)
-            goto intra;
-
-        if (s->pict_type == AV_PICTURE_TYPE_S &&
-            ctx->vol_sprite_usage == GMC_SPRITE && (cbpc & 16) == 0)
-            s->mcsel = get_bits1(&s->gb);
-        else
-            s->mcsel = 0;
-        cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F;
-
-        cbp = (cbpc & 3) | (cbpy << 2);
-        if (dquant)
-            ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
-        if ((!s->progressive_sequence) &&
-            (cbp || (s->workaround_bugs & FF_BUG_XVID_ILACE)))
-            s->interlaced_dct = get_bits1(&s->gb);
-
-        s->mv_dir = MV_DIR_FORWARD;
-        if ((cbpc & 16) == 0) {
-            if (s->mcsel) {
-                s->current_picture.mb_type[xy] = MB_TYPE_GMC   |
-                                                 MB_TYPE_16x16 |
-                                                 MB_TYPE_L0;
-                /* 16x16 global motion prediction */
-                s->mv_type     = MV_TYPE_16X16;
-                mx             = get_amv(ctx, 0);
-                my             = get_amv(ctx, 1);
-                s->mv[0][0][0] = mx;
-                s->mv[0][0][1] = my;
-            } else if ((!s->progressive_sequence) && get_bits1(&s->gb)) {
-                s->current_picture.mb_type[xy] = MB_TYPE_16x8 |
-                                                 MB_TYPE_L0   |
-                                                 MB_TYPE_INTERLACED;
-                /* 16x8 field motion prediction */
-                s->mv_type = MV_TYPE_FIELD;
-
-                s->field_select[0][0] = get_bits1(&s->gb);
-                s->field_select[0][1] = get_bits1(&s->gb);
-
-                ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-
-                for (i = 0; i < 2; i++) {
-                    mx = ff_h263_decode_motion(s, pred_x, s->f_code);
-                    if (mx >= 0xffff)
-                        return -1;
-
-                    my = ff_h263_decode_motion(s, pred_y / 2, s->f_code);
-                    if (my >= 0xffff)
-                        return -1;
-
-                    s->mv[0][i][0] = mx;
-                    s->mv[0][i][1] = my;
-                }
-            } else {
-                s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
-                /* 16x16 motion prediction */
-                s->mv_type = MV_TYPE_16X16;
-                ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-                mx = ff_h263_decode_motion(s, pred_x, s->f_code);
-
-                if (mx >= 0xffff)
-                    return -1;
-
-                my = ff_h263_decode_motion(s, pred_y, s->f_code);
-
-                if (my >= 0xffff)
-                    return -1;
-                s->mv[0][0][0] = mx;
-                s->mv[0][0][1] = my;
-            }
-        } else {
-            s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
-            s->mv_type                     = MV_TYPE_8X8;
-            for (i = 0; i < 4; i++) {
-                mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
-                mx      = ff_h263_decode_motion(s, pred_x, s->f_code);
-                if (mx >= 0xffff)
-                    return -1;
-
-                my = ff_h263_decode_motion(s, pred_y, s->f_code);
-                if (my >= 0xffff)
-                    return -1;
-                s->mv[0][i][0] = mx;
-                s->mv[0][i][1] = my;
-                mot_val[0]     = mx;
-                mot_val[1]     = my;
-            }
-        }
-    } else if (s->pict_type == AV_PICTURE_TYPE_B) {
-        int modb1;   // first bit of modb
-        int modb2;   // second bit of modb
-        int mb_type;
-
-        s->mb_intra = 0;  // B-frames never contain intra blocks
-        s->mcsel    = 0;  //      ...               true gmc blocks
-
-        if (s->mb_x == 0) {
-            for (i = 0; i < 2; i++) {
-                s->last_mv[i][0][0] =
-                s->last_mv[i][0][1] =
-                s->last_mv[i][1][0] =
-                s->last_mv[i][1][1] = 0;
-            }
-
-            ff_thread_await_progress(&s->next_picture_ptr->tf, s->mb_y, 0);
-        }
-
-        /* if we skipped it in the future P Frame than skip it now too */
-        s->mb_skipped = s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x];  // Note, skiptab=0 if last was GMC
-
-        if (s->mb_skipped) {
-            /* skip mb */
-            for (i = 0; i < 6; i++)
-                s->block_last_index[i] = -1;
-
-            s->mv_dir      = MV_DIR_FORWARD;
-            s->mv_type     = MV_TYPE_16X16;
-            s->mv[0][0][0] =
-            s->mv[0][0][1] =
-            s->mv[1][0][0] =
-            s->mv[1][0][1] = 0;
-            s->current_picture.mb_type[xy] = MB_TYPE_SKIP  |
-                                             MB_TYPE_16x16 |
-                                             MB_TYPE_L0;
-            goto end;
-        }
-
-        modb1 = get_bits1(&s->gb);
-        if (modb1) {
-            // like MB_TYPE_B_DIRECT but no vectors coded
-            mb_type = MB_TYPE_DIRECT2 | MB_TYPE_SKIP | MB_TYPE_L0L1;
-            cbp     = 0;
-        } else {
-            modb2   = get_bits1(&s->gb);
-            mb_type = get_vlc2(&s->gb, mb_type_b_vlc.table, MB_TYPE_B_VLC_BITS, 1);
-            if (mb_type < 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "illegal MB_type\n");
-                return -1;
-            }
-            mb_type = mb_type_b_map[mb_type];
-            if (modb2) {
-                cbp = 0;
-            } else {
-                s->dsp.clear_blocks(s->block[0]);
-                cbp = get_bits(&s->gb, 6);
-            }
-
-            if ((!IS_DIRECT(mb_type)) && cbp) {
-                if (get_bits1(&s->gb))
-                    ff_set_qscale(s, s->qscale + get_bits1(&s->gb) * 4 - 2);
-            }
-
-            if (!s->progressive_sequence) {
-                if (cbp)
-                    s->interlaced_dct = get_bits1(&s->gb);
-
-                if (!IS_DIRECT(mb_type) && get_bits1(&s->gb)) {
-                    mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
-                    mb_type &= ~MB_TYPE_16x16;
-
-                    if (USES_LIST(mb_type, 0)) {
-                        s->field_select[0][0] = get_bits1(&s->gb);
-                        s->field_select[0][1] = get_bits1(&s->gb);
-                    }
-                    if (USES_LIST(mb_type, 1)) {
-                        s->field_select[1][0] = get_bits1(&s->gb);
-                        s->field_select[1][1] = get_bits1(&s->gb);
-                    }
-                }
-            }
-
-            s->mv_dir = 0;
-            if ((mb_type & (MB_TYPE_DIRECT2 | MB_TYPE_INTERLACED)) == 0) {
-                s->mv_type = MV_TYPE_16X16;
-
-                if (USES_LIST(mb_type, 0)) {
-                    s->mv_dir = MV_DIR_FORWARD;
-
-                    mx = ff_h263_decode_motion(s, s->last_mv[0][0][0], s->f_code);
-                    my = ff_h263_decode_motion(s, s->last_mv[0][0][1], s->f_code);
-                    s->last_mv[0][1][0] =
-                    s->last_mv[0][0][0] =
-                    s->mv[0][0][0]      = mx;
-                    s->last_mv[0][1][1] =
-                    s->last_mv[0][0][1] =
-                    s->mv[0][0][1]      = my;
-                }
-
-                if (USES_LIST(mb_type, 1)) {
-                    s->mv_dir |= MV_DIR_BACKWARD;
-
-                    mx = ff_h263_decode_motion(s, s->last_mv[1][0][0], s->b_code);
-                    my = ff_h263_decode_motion(s, s->last_mv[1][0][1], s->b_code);
-                    s->last_mv[1][1][0] =
-                    s->last_mv[1][0][0] =
-                    s->mv[1][0][0]      = mx;
-                    s->last_mv[1][1][1] =
-                    s->last_mv[1][0][1] =
-                    s->mv[1][0][1]      = my;
-                }
-            } else if (!IS_DIRECT(mb_type)) {
-                s->mv_type = MV_TYPE_FIELD;
-
-                if (USES_LIST(mb_type, 0)) {
-                    s->mv_dir = MV_DIR_FORWARD;
-
-                    for (i = 0; i < 2; i++) {
-                        mx = ff_h263_decode_motion(s, s->last_mv[0][i][0], s->f_code);
-                        my = ff_h263_decode_motion(s, s->last_mv[0][i][1] / 2, s->f_code);
-                        s->last_mv[0][i][0] =
-                        s->mv[0][i][0]      = mx;
-                        s->last_mv[0][i][1] = (s->mv[0][i][1] = my) * 2;
-                    }
-                }
-
-                if (USES_LIST(mb_type, 1)) {
-                    s->mv_dir |= MV_DIR_BACKWARD;
-
-                    for (i = 0; i < 2; i++) {
-                        mx = ff_h263_decode_motion(s, s->last_mv[1][i][0], s->b_code);
-                        my = ff_h263_decode_motion(s, s->last_mv[1][i][1] / 2, s->b_code);
-                        s->last_mv[1][i][0] =
-                        s->mv[1][i][0]      = mx;
-                        s->last_mv[1][i][1] = (s->mv[1][i][1] = my) * 2;
-                    }
-                }
-            }
-        }
-
-        if (IS_DIRECT(mb_type)) {
-            if (IS_SKIP(mb_type)) {
-                mx =
-                my = 0;
-            } else {
-                mx = ff_h263_decode_motion(s, 0, 1);
-                my = ff_h263_decode_motion(s, 0, 1);
-            }
-
-            s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
-            mb_type  |= ff_mpeg4_set_direct_mv(s, mx, my);
-        }
-        s->current_picture.mb_type[xy] = mb_type;
-    } else { /* I-Frame */
-        do {
-            cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
-            if (cbpc < 0) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
-                return -1;
-            }
-        } while (cbpc == 8);
-
-        dquant = cbpc & 4;
-        s->mb_intra = 1;
-
-intra:
-        s->ac_pred = get_bits1(&s->gb);
-        if (s->ac_pred)
-            s->current_picture.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED;
-        else
-            s->current_picture.mb_type[xy] = MB_TYPE_INTRA;
-
-        cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
-        if (cbpy < 0) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
-            return -1;
-        }
-        cbp = (cbpc & 3) | (cbpy << 2);
-
-        ctx->use_intra_dc_vlc = s->qscale < ctx->intra_dc_threshold;
-
-        if (dquant)
-            ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
-
-        if (!s->progressive_sequence)
-            s->interlaced_dct = get_bits1(&s->gb);
-
-        s->dsp.clear_blocks(s->block[0]);
-        /* decode each block */
-        for (i = 0; i < 6; i++) {
-            if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, 1, 0) < 0)
-                return -1;
-            cbp += cbp;
-        }
-        goto end;
-    }
-
-    /* decode each block */
-    for (i = 0; i < 6; i++) {
-        if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, 0, 0) < 0)
-            return -1;
-        cbp += cbp;
-    }
-
-end:
-    /* per-MB end of slice check */
-    if (s->codec_id == AV_CODEC_ID_MPEG4) {
-        if (mpeg4_is_resync(s)) {
-            const int delta = s->mb_x + 1 == s->mb_width ? 2 : 1;
-
-            if (s->pict_type == AV_PICTURE_TYPE_B &&
-                s->next_picture.mbskip_table[xy + delta]) {
-                ff_thread_await_progress(&s->next_picture_ptr->tf,
-                                         (s->mb_x + delta >= s->mb_width)
-                                         ? FFMIN(s->mb_y + 1, s->mb_height - 1)
-                                         : s->mb_y, 0);
-            }
-
-            if (s->pict_type == AV_PICTURE_TYPE_B &&
-                s->next_picture.mbskip_table[xy + delta])
-                return SLICE_OK;
-            return SLICE_END;
-        }
-    }
-
-    return SLICE_OK;
-}
-
-static int mpeg4_decode_gop_header(MpegEncContext *s, GetBitContext *gb)
-{
-    int hours, minutes, seconds;
-    unsigned time_code = show_bits(gb, 18);
-
-    if (time_code & 0x40) {     /* marker_bit */
-        hours   = time_code >> 13;
-        minutes = time_code >> 7 & 0x3f;
-        seconds = time_code & 0x3f;
-        s->time_base = seconds + 60 * (minutes + 60 * hours);
-        skip_bits(gb, 20);      /* time_code, closed_gov, broken_link */
-    } else {
-        av_log(s->avctx, AV_LOG_WARNING, "GOP header missing marker_bit\n");
-    }
-
-    return 0;
-}
-
-static int mpeg4_decode_profile_level(MpegEncContext *s, GetBitContext *gb)
-{
-    int profile_and_level_indication;
-
-    profile_and_level_indication = get_bits(gb, 8);
-
-    s->avctx->profile = (profile_and_level_indication & 0xf0) >> 4;
-    s->avctx->level   = (profile_and_level_indication & 0x0f);
-
-    // for Simple profile, level 0
-    if (s->avctx->profile == 0 && s->avctx->level == 8) {
-        s->avctx->level = 0;
-    }
-
-    return 0;
-}
-
-static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
-{
-    MpegEncContext *s = &ctx->m;
-    int width, height, vo_ver_id;
-
-    /* vol header */
-    skip_bits(gb, 1);                   /* random access */
-    s->vo_type = get_bits(gb, 8);
-    if (get_bits1(gb) != 0) {           /* is_ol_id */
-        vo_ver_id = get_bits(gb, 4);    /* vo_ver_id */
-        skip_bits(gb, 3);               /* vo_priority */
-    } else {
-        vo_ver_id = 1;
-    }
-    s->aspect_ratio_info = get_bits(gb, 4);
-    if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
-        s->avctx->sample_aspect_ratio.num = get_bits(gb, 8);  // par_width
-        s->avctx->sample_aspect_ratio.den = get_bits(gb, 8);  // par_height
-    } else {
-        s->avctx->sample_aspect_ratio = ff_h263_pixel_aspect[s->aspect_ratio_info];
-    }
-
-    if ((s->vol_control_parameters = get_bits1(gb))) { /* vol control parameter */
-        int chroma_format = get_bits(gb, 2);
-        if (chroma_format != CHROMA_420)
-            av_log(s->avctx, AV_LOG_ERROR, "illegal chroma format\n");
-
-        s->low_delay = get_bits1(gb);
-        if (get_bits1(gb)) {    /* vbv parameters */
-            get_bits(gb, 15);   /* first_half_bitrate */
-            skip_bits1(gb);     /* marker */
-            get_bits(gb, 15);   /* latter_half_bitrate */
-            skip_bits1(gb);     /* marker */
-            get_bits(gb, 15);   /* first_half_vbv_buffer_size */
-            skip_bits1(gb);     /* marker */
-            get_bits(gb, 3);    /* latter_half_vbv_buffer_size */
-            get_bits(gb, 11);   /* first_half_vbv_occupancy */
-            skip_bits1(gb);     /* marker */
-            get_bits(gb, 15);   /* latter_half_vbv_occupancy */
-            skip_bits1(gb);     /* marker */
-        }
-    } else {
-        /* is setting low delay flag only once the smartest thing to do?
-         * low delay detection won't be overriden. */
-        if (s->picture_number == 0)
-            s->low_delay = 0;
-    }
-
-    ctx->shape = get_bits(gb, 2); /* vol shape */
-    if (ctx->shape != RECT_SHAPE)
-        av_log(s->avctx, AV_LOG_ERROR, "only rectangular vol supported\n");
-    if (ctx->shape == GRAY_SHAPE && vo_ver_id != 1) {
-        av_log(s->avctx, AV_LOG_ERROR, "Gray shape not supported\n");
-        skip_bits(gb, 4);  /* video_object_layer_shape_extension */
-    }
-
-    check_marker(gb, "before time_increment_resolution");
-
-    s->avctx->time_base.den = get_bits(gb, 16);
-    if (!s->avctx->time_base.den) {
-        av_log(s->avctx, AV_LOG_ERROR, "time_base.den==0\n");
-        s->avctx->time_base.num = 0;
-        return -1;
-    }
-
-    ctx->time_increment_bits = av_log2(s->avctx->time_base.den - 1) + 1;
-    if (ctx->time_increment_bits < 1)
-        ctx->time_increment_bits = 1;
-
-    check_marker(gb, "before fixed_vop_rate");
-
-    if (get_bits1(gb) != 0)     /* fixed_vop_rate  */
-        s->avctx->time_base.num = get_bits(gb, ctx->time_increment_bits);
-    else
-        s->avctx->time_base.num = 1;
-
-    ctx->t_frame = 0;
-
-    if (ctx->shape != BIN_ONLY_SHAPE) {
-        if (ctx->shape == RECT_SHAPE) {
-            skip_bits1(gb);   /* marker */
-            width = get_bits(gb, 13);
-            skip_bits1(gb);   /* marker */
-            height = get_bits(gb, 13);
-            skip_bits1(gb);   /* marker */
-            if (width && height &&  /* they should be non zero but who knows */
-                !(s->width && s->codec_tag == AV_RL32("MP4S"))) {
-                if (s->width && s->height &&
-                    (s->width != width || s->height != height))
-                    s->context_reinit = 1;
-                s->width  = width;
-                s->height = height;
-            }
-        }
-
-        s->progressive_sequence  =
-        s->progressive_frame     = get_bits1(gb) ^ 1;
-        s->interlaced_dct        = 0;
-        if (!get_bits1(gb) && (s->avctx->debug & FF_DEBUG_PICT_INFO))
-            av_log(s->avctx, AV_LOG_INFO,           /* OBMC Disable */
-                   "MPEG4 OBMC not supported (very likely buggy encoder)\n");
-        if (vo_ver_id == 1)
-            ctx->vol_sprite_usage = get_bits1(gb);    /* vol_sprite_usage */
-        else
-            ctx->vol_sprite_usage = get_bits(gb, 2);  /* vol_sprite_usage */
-
-        if (ctx->vol_sprite_usage == STATIC_SPRITE)
-            av_log(s->avctx, AV_LOG_ERROR, "Static Sprites not supported\n");
-        if (ctx->vol_sprite_usage == STATIC_SPRITE ||
-            ctx->vol_sprite_usage == GMC_SPRITE) {
-            if (ctx->vol_sprite_usage == STATIC_SPRITE) {
-                skip_bits(gb, 13); // sprite_width
-                skip_bits1(gb); /* marker */
-                skip_bits(gb, 13); // sprite_height
-                skip_bits1(gb); /* marker */
-                skip_bits(gb, 13); // sprite_left
-                skip_bits1(gb); /* marker */
-                skip_bits(gb, 13); // sprite_top
-                skip_bits1(gb); /* marker */
-            }
-            ctx->num_sprite_warping_points = get_bits(gb, 6);
-            if (ctx->num_sprite_warping_points > 3) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "%d sprite_warping_points\n",
-                       ctx->num_sprite_warping_points);
-                ctx->num_sprite_warping_points = 0;
-                return -1;
-            }
-            s->sprite_warping_accuracy  = get_bits(gb, 2);
-            ctx->sprite_brightness_change = get_bits1(gb);
-            if (ctx->vol_sprite_usage == STATIC_SPRITE)
-                skip_bits1(gb); // low_latency_sprite
-        }
-        // FIXME sadct disable bit if verid!=1 && shape not rect
-
-        if (get_bits1(gb) == 1) {                   /* not_8_bit */
-            s->quant_precision = get_bits(gb, 4);   /* quant_precision */
-            if (get_bits(gb, 4) != 8)               /* bits_per_pixel */
-                av_log(s->avctx, AV_LOG_ERROR, "N-bit not supported\n");
-            if (s->quant_precision != 5)
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "quant precision %d\n", s->quant_precision);
-        } else {
-            s->quant_precision = 5;
-        }
-
-        // FIXME a bunch of grayscale shape things
-
-        if ((s->mpeg_quant = get_bits1(gb))) { /* vol_quant_type */
-            int i, v;
-
-            /* load default matrixes */
-            for (i = 0; i < 64; i++) {
-                int j = s->dsp.idct_permutation[i];
-                v = ff_mpeg4_default_intra_matrix[i];
-                s->intra_matrix[j]        = v;
-                s->chroma_intra_matrix[j] = v;
-
-                v = ff_mpeg4_default_non_intra_matrix[i];
-                s->inter_matrix[j]        = v;
-                s->chroma_inter_matrix[j] = v;
-            }
-
-            /* load custom intra matrix */
-            if (get_bits1(gb)) {
-                int last = 0;
-                for (i = 0; i < 64; i++) {
-                    int j;
-                    v = get_bits(gb, 8);
-                    if (v == 0)
-                        break;
-
-                    last = v;
-                    j = s->dsp.idct_permutation[ff_zigzag_direct[i]];
-                    s->intra_matrix[j]        = last;
-                    s->chroma_intra_matrix[j] = last;
-                }
-
-                /* replicate last value */
-                for (; i < 64; i++) {
-                    int j = s->dsp.idct_permutation[ff_zigzag_direct[i]];
-                    s->intra_matrix[j]        = last;
-                    s->chroma_intra_matrix[j] = last;
-                }
-            }
-
-            /* load custom non intra matrix */
-            if (get_bits1(gb)) {
-                int last = 0;
-                for (i = 0; i < 64; i++) {
-                    int j;
-                    v = get_bits(gb, 8);
-                    if (v == 0)
-                        break;
-
-                    last = v;
-                    j = s->dsp.idct_permutation[ff_zigzag_direct[i]];
-                    s->inter_matrix[j]        = v;
-                    s->chroma_inter_matrix[j] = v;
-                }
-
-                /* replicate last value */
-                for (; i < 64; i++) {
-                    int j = s->dsp.idct_permutation[ff_zigzag_direct[i]];
-                    s->inter_matrix[j]        = last;
-                    s->chroma_inter_matrix[j] = last;
-                }
-            }
-
-            // FIXME a bunch of grayscale shape things
-        }
-
-        if (vo_ver_id != 1)
-            s->quarter_sample = get_bits1(gb);
-        else
-            s->quarter_sample = 0;
-
-        if (!get_bits1(gb)) {
-            int pos               = get_bits_count(gb);
-            int estimation_method = get_bits(gb, 2);
-            if (estimation_method < 2) {
-                if (!get_bits1(gb)) {
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* opaque */
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* transparent */
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* intra_cae */
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* inter_cae */
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* no_update */
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* upampling */
-                }
-                if (!get_bits1(gb)) {
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* intra_blocks */
-                    ctx->cplx_estimation_trash_p += 8 * get_bits1(gb);  /* inter_blocks */
-                    ctx->cplx_estimation_trash_p += 8 * get_bits1(gb);  /* inter4v_blocks */
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* not coded blocks */
-                }
-                if (!check_marker(gb, "in complexity estimation part 1")) {
-                    skip_bits_long(gb, pos - get_bits_count(gb));
-                    goto no_cplx_est;
-                }
-                if (!get_bits1(gb)) {
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* dct_coeffs */
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* dct_lines */
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* vlc_syms */
-                    ctx->cplx_estimation_trash_i += 4 * get_bits1(gb);  /* vlc_bits */
-                }
-                if (!get_bits1(gb)) {
-                    ctx->cplx_estimation_trash_p += 8 * get_bits1(gb);  /* apm */
-                    ctx->cplx_estimation_trash_p += 8 * get_bits1(gb);  /* npm */
-                    ctx->cplx_estimation_trash_b += 8 * get_bits1(gb);  /* interpolate_mc_q */
-                    ctx->cplx_estimation_trash_p += 8 * get_bits1(gb);  /* forwback_mc_q */
-                    ctx->cplx_estimation_trash_p += 8 * get_bits1(gb);  /* halfpel2 */
-                    ctx->cplx_estimation_trash_p += 8 * get_bits1(gb);  /* halfpel4 */
-                }
-                if (!check_marker(gb, "in complexity estimation part 2")) {
-                    skip_bits_long(gb, pos - get_bits_count(gb));
-                    goto no_cplx_est;
-                }
-                if (estimation_method == 1) {
-                    ctx->cplx_estimation_trash_i += 8 * get_bits1(gb);  /* sadct */
-                    ctx->cplx_estimation_trash_p += 8 * get_bits1(gb);  /* qpel */
-                }
-            } else
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "Invalid Complexity estimation method %d\n",
-                       estimation_method);
-        } else {
-
-no_cplx_est:
-            ctx->cplx_estimation_trash_i =
-            ctx->cplx_estimation_trash_p =
-            ctx->cplx_estimation_trash_b = 0;
-        }
-
-        ctx->resync_marker = !get_bits1(gb); /* resync_marker_disabled */
-
-        s->data_partitioning = get_bits1(gb);
-        if (s->data_partitioning)
-            ctx->rvlc = get_bits1(gb);
-
-        if (vo_ver_id != 1) {
-            ctx->new_pred = get_bits1(gb);
-            if (ctx->new_pred) {
-                av_log(s->avctx, AV_LOG_ERROR, "new pred not supported\n");
-                skip_bits(gb, 2); /* requested upstream message type */
-                skip_bits1(gb);   /* newpred segment type */
-            }
-            if (get_bits1(gb)) // reduced_res_vop
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "reduced resolution VOP not supported\n");
-        } else {
-            ctx->new_pred = 0;
-        }
-
-        ctx->scalability = get_bits1(gb);
-
-        if (ctx->scalability) {
-            GetBitContext bak = *gb;
-            int h_sampling_factor_n;
-            int h_sampling_factor_m;
-            int v_sampling_factor_n;
-            int v_sampling_factor_m;
-
-            skip_bits1(gb);    // hierarchy_type
-            skip_bits(gb, 4);  /* ref_layer_id */
-            skip_bits1(gb);    /* ref_layer_sampling_dir */
-            h_sampling_factor_n = get_bits(gb, 5);
-            h_sampling_factor_m = get_bits(gb, 5);
-            v_sampling_factor_n = get_bits(gb, 5);
-            v_sampling_factor_m = get_bits(gb, 5);
-            ctx->enhancement_type = get_bits1(gb);
-
-            if (h_sampling_factor_n == 0 || h_sampling_factor_m == 0 ||
-                v_sampling_factor_n == 0 || v_sampling_factor_m == 0) {
-                /* illegal scalability header (VERY broken encoder),
-                 * trying to workaround */
-                ctx->scalability = 0;
-                *gb            = bak;
-            } else
-                av_log(s->avctx, AV_LOG_ERROR, "scalability not supported\n");
-
-            // bin shape stuff FIXME
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Decode the user data stuff in the header.
- * Also initializes divx/xvid/lavc_version/build.
- */
-static int decode_user_data(Mpeg4DecContext *ctx, GetBitContext *gb)
-{
-    MpegEncContext *s = &ctx->m;
-    char buf[256];
-    int i;
-    int e;
-    int ver = 0, build = 0, ver2 = 0, ver3 = 0;
-    char last;
-
-    for (i = 0; i < 255 && get_bits_count(gb) < gb->size_in_bits; i++) {
-        if (show_bits(gb, 23) == 0)
-            break;
-        buf[i] = get_bits(gb, 8);
-    }
-    buf[i] = 0;
-
-    /* divx detection */
-    e = sscanf(buf, "DivX%dBuild%d%c", &ver, &build, &last);
-    if (e < 2)
-        e = sscanf(buf, "DivX%db%d%c", &ver, &build, &last);
-    if (e >= 2) {
-        ctx->divx_version = ver;
-        ctx->divx_build   = build;
-        s->divx_packed  = e == 3 && last == 'p';
-        if (s->divx_packed && !ctx->showed_packed_warning) {
-            av_log(s->avctx, AV_LOG_WARNING,
-                   "Invalid and inefficient vfw-avi packed B frames detected\n");
-            ctx->showed_packed_warning = 1;
-        }
-    }
-
-    /* libavcodec detection */
-    e = sscanf(buf, "FFmpe%*[^b]b%d", &build) + 3;
-    if (e != 4)
-        e = sscanf(buf, "FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);
-    if (e != 4) {
-        e = sscanf(buf, "Lavc%d.%d.%d", &ver, &ver2, &ver3) + 1;
-        if (e > 1)
-            build = (ver << 16) + (ver2 << 8) + ver3;
-    }
-    if (e != 4) {
-        if (strcmp(buf, "ffmpeg") == 0)
-            ctx->lavc_build = 4600;
-    }
-    if (e == 4)
-        ctx->lavc_build = build;
-
-    /* Xvid detection */
-    e = sscanf(buf, "XviD%d", &build);
-    if (e == 1)
-        ctx->xvid_build = build;
-
-    if (ctx->xvid_build == -1 && ctx->divx_version == -1 && ctx->lavc_build == -1) {
-        if (s->stream_codec_tag == AV_RL32("XVID") ||
-            s->codec_tag        == AV_RL32("XVID") ||
-            s->codec_tag        == AV_RL32("XVIX") ||
-            s->codec_tag        == AV_RL32("RMP4") ||
-            s->codec_tag        == AV_RL32("ZMP4") ||
-            s->codec_tag        == AV_RL32("SIPP"))
-            ctx->xvid_build = 0;
-    }
-
-    if (ctx->xvid_build == -1 && ctx->divx_version == -1 && ctx->lavc_build == -1)
-        if (s->codec_tag == AV_RL32("DIVX") && s->vo_type == 0 &&
-            s->vol_control_parameters == 0)
-            ctx->divx_version = 400;  // divx 4
-
-    if (ctx->xvid_build >= 0 && ctx->divx_version >= 0) {
-        ctx->divx_version =
-        ctx->divx_build   = -1;
-    }
-
-#if HAVE_MMX
-    if (ctx->xvid_build >= 0                &&
-        s->avctx->idct_algo == FF_IDCT_AUTO &&
-        (av_get_cpu_flags() & AV_CPU_FLAG_MMX)) {
-        s->avctx->idct_algo = FF_IDCT_XVIDMMX;
-        ff_dct_common_init(s);
-    }
-#endif
-
-    return 0;
-}
-
-static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
-{
-    MpegEncContext *s = &ctx->m;
-    int time_incr, time_increment;
-
-    s->pict_type = get_bits(gb, 2) + AV_PICTURE_TYPE_I;        /* pict type: I = 0 , P = 1 */
-    if (s->pict_type == AV_PICTURE_TYPE_B && s->low_delay &&
-        s->vol_control_parameters == 0 && !(s->flags & CODEC_FLAG_LOW_DELAY)) {
-        av_log(s->avctx, AV_LOG_ERROR, "low_delay flag incorrectly, clearing it\n");
-        s->low_delay = 0;
-    }
-
-    s->partitioned_frame = s->data_partitioning && s->pict_type != AV_PICTURE_TYPE_B;
-    if (s->partitioned_frame)
-        s->decode_mb = mpeg4_decode_partitioned_mb;
-    else
-        s->decode_mb = mpeg4_decode_mb;
-
-    time_incr = 0;
-    while (get_bits1(gb) != 0)
-        time_incr++;
-
-    check_marker(gb, "before time_increment");
-
-    if (ctx->time_increment_bits == 0 ||
-        !(show_bits(gb, ctx->time_increment_bits + 1) & 1)) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "hmm, seems the headers are not complete, trying to guess time_increment_bits\n");
-
-        for (ctx->time_increment_bits = 1;
-             ctx->time_increment_bits < 16;
-             ctx->time_increment_bits++) {
-            if (s->pict_type == AV_PICTURE_TYPE_P ||
-                (s->pict_type == AV_PICTURE_TYPE_S &&
-                 ctx->vol_sprite_usage == GMC_SPRITE)) {
-                if ((show_bits(gb, ctx->time_increment_bits + 6) & 0x37) == 0x30)
-                    break;
-            } else if ((show_bits(gb, ctx->time_increment_bits + 5) & 0x1F) == 0x18)
-                break;
-        }
-
-        av_log(s->avctx, AV_LOG_ERROR,
-               "my guess is %d bits ;)\n", ctx->time_increment_bits);
-    }
-
-    if (IS_3IV1)
-        time_increment = get_bits1(gb);        // FIXME investigate further
-    else
-        time_increment = get_bits(gb, ctx->time_increment_bits);
-
-    if (s->pict_type != AV_PICTURE_TYPE_B) {
-        s->last_time_base = s->time_base;
-        s->time_base     += time_incr;
-        s->time = s->time_base * s->avctx->time_base.den + time_increment;
-        if (s->workaround_bugs & FF_BUG_UMP4) {
-            if (s->time < s->last_non_b_time) {
-                /* header is not mpeg-4-compatible, broken encoder,
-                 * trying to workaround */
-                s->time_base++;
-                s->time += s->avctx->time_base.den;
-            }
-        }
-        s->pp_time         = s->time - s->last_non_b_time;
-        s->last_non_b_time = s->time;
-    } else {
-        s->time    = (s->last_time_base + time_incr) * s->avctx->time_base.den + time_increment;
-        s->pb_time = s->pp_time - (s->last_non_b_time - s->time);
-        if (s->pp_time <= s->pb_time ||
-            s->pp_time <= s->pp_time - s->pb_time ||
-            s->pp_time <= 0) {
-            /* messed up order, maybe after seeking? skipping current b-frame */
-            return FRAME_SKIPPED;
-        }
-        ff_mpeg4_init_direct_mv(s);
-
-        if (ctx->t_frame == 0)
-            ctx->t_frame = s->pb_time;
-        if (ctx->t_frame == 0)
-            ctx->t_frame = 1;  // 1/0 protection
-        s->pp_field_time = (ROUNDED_DIV(s->last_non_b_time, ctx->t_frame) -
-                            ROUNDED_DIV(s->last_non_b_time - s->pp_time, ctx->t_frame)) * 2;
-        s->pb_field_time = (ROUNDED_DIV(s->time, ctx->t_frame) -
-                            ROUNDED_DIV(s->last_non_b_time - s->pp_time, ctx->t_frame)) * 2;
-        if (!s->progressive_sequence) {
-            if (s->pp_field_time <= s->pb_field_time || s->pb_field_time <= 1)
-                return FRAME_SKIPPED;
-        }
-    }
-
-    check_marker(gb, "before vop_coded");
-
-    /* vop coded */
-    if (get_bits1(gb) != 1) {
-        if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-            av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n");
-        return FRAME_SKIPPED;
-    }
-    if (ctx->shape != BIN_ONLY_SHAPE &&
-                    (s->pict_type == AV_PICTURE_TYPE_P ||
-                     (s->pict_type == AV_PICTURE_TYPE_S &&
-                      ctx->vol_sprite_usage == GMC_SPRITE))) {
-        /* rounding type for motion estimation */
-        s->no_rounding = get_bits1(gb);
-    } else {
-        s->no_rounding = 0;
-    }
-    // FIXME reduced res stuff
-
-    if (ctx->shape != RECT_SHAPE) {
-        if (ctx->vol_sprite_usage != 1 || s->pict_type != AV_PICTURE_TYPE_I) {
-            skip_bits(gb, 13);  /* width */
-            skip_bits1(gb);     /* marker */
-            skip_bits(gb, 13);  /* height */
-            skip_bits1(gb);     /* marker */
-            skip_bits(gb, 13);  /* hor_spat_ref */
-            skip_bits1(gb);     /* marker */
-            skip_bits(gb, 13);  /* ver_spat_ref */
-        }
-        skip_bits1(gb);         /* change_CR_disable */
-
-        if (get_bits1(gb) != 0)
-            skip_bits(gb, 8);   /* constant_alpha_value */
-    }
-
-    // FIXME complexity estimation stuff
-
-    if (ctx->shape != BIN_ONLY_SHAPE) {
-        skip_bits_long(gb, ctx->cplx_estimation_trash_i);
-        if (s->pict_type != AV_PICTURE_TYPE_I)
-            skip_bits_long(gb, ctx->cplx_estimation_trash_p);
-        if (s->pict_type == AV_PICTURE_TYPE_B)
-            skip_bits_long(gb, ctx->cplx_estimation_trash_b);
-
-        ctx->intra_dc_threshold = ff_mpeg4_dc_threshold[get_bits(gb, 3)];
-        if (!s->progressive_sequence) {
-            s->top_field_first = get_bits1(gb);
-            s->alternate_scan  = get_bits1(gb);
-        } else
-            s->alternate_scan = 0;
-    }
-
-    if (s->alternate_scan) {
-        ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable,   ff_alternate_vertical_scan);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable,   ff_alternate_vertical_scan);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
-    } else {
-        ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable,   ff_zigzag_direct);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable,   ff_zigzag_direct);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
-    }
-
-    if (s->pict_type == AV_PICTURE_TYPE_S &&
-        (ctx->vol_sprite_usage == STATIC_SPRITE ||
-         ctx->vol_sprite_usage == GMC_SPRITE)) {
-        if (mpeg4_decode_sprite_trajectory(ctx, gb) < 0)
-            return AVERROR_INVALIDDATA;
-        if (ctx->sprite_brightness_change)
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "sprite_brightness_change not supported\n");
-        if (ctx->vol_sprite_usage == STATIC_SPRITE)
-            av_log(s->avctx, AV_LOG_ERROR, "static sprite not supported\n");
-    }
-
-    if (ctx->shape != BIN_ONLY_SHAPE) {
-        s->chroma_qscale = s->qscale = get_bits(gb, s->quant_precision);
-        if (s->qscale == 0) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Error, header damaged or not MPEG4 header (qscale=0)\n");
-            return -1;  // makes no sense to continue, as there is nothing left from the image then
-        }
-
-        if (s->pict_type != AV_PICTURE_TYPE_I) {
-            s->f_code = get_bits(gb, 3);        /* fcode_for */
-            if (s->f_code == 0) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "Error, header damaged or not MPEG4 header (f_code=0)\n");
-                return -1;  // makes no sense to continue, as there is nothing left from the image then
-            }
-        } else
-            s->f_code = 1;
-
-        if (s->pict_type == AV_PICTURE_TYPE_B) {
-            s->b_code = get_bits(gb, 3);
-        } else
-            s->b_code = 1;
-
-        if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
-            av_log(s->avctx, AV_LOG_DEBUG,
-                   "qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s dc:%d ce:%d/%d/%d\n",
-                   s->qscale, s->f_code, s->b_code,
-                   s->pict_type == AV_PICTURE_TYPE_I ? "I" : (s->pict_type == AV_PICTURE_TYPE_P ? "P" : (s->pict_type == AV_PICTURE_TYPE_B ? "B" : "S")),
-                   gb->size_in_bits, s->progressive_sequence, s->alternate_scan,
-                   s->top_field_first, s->quarter_sample ? "q" : "h",
-                   s->data_partitioning, ctx->resync_marker,
-                   ctx->num_sprite_warping_points, s->sprite_warping_accuracy,
-                   1 - s->no_rounding, s->vo_type,
-                   s->vol_control_parameters ? " VOLC" : " ", ctx->intra_dc_threshold,
-                   ctx->cplx_estimation_trash_i, ctx->cplx_estimation_trash_p,
-                   ctx->cplx_estimation_trash_b);
-        }
-
-        if (!ctx->scalability) {
-            if (ctx->shape != RECT_SHAPE && s->pict_type != AV_PICTURE_TYPE_I)
-                skip_bits1(gb);  // vop shape coding type
-        } else {
-            if (ctx->enhancement_type) {
-                int load_backward_shape = get_bits1(gb);
-                if (load_backward_shape)
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "load backward shape isn't supported\n");
-            }
-            skip_bits(gb, 2);  // ref_select_code
-        }
-    }
-    /* detect buggy encoders which don't set the low_delay flag
-     * (divx4/xvid/opendivx). Note we cannot detect divx5 without b-frames
-     * easily (although it's buggy too) */
-    if (s->vo_type == 0 && s->vol_control_parameters == 0 &&
-        ctx->divx_version == -1 && s->picture_number == 0) {
-        av_log(s->avctx, AV_LOG_WARNING,
-               "looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n");
-        s->low_delay = 1;
-    }
-
-    s->picture_number++;  // better than pic number==0 always ;)
-
-    // FIXME add short header support
-    s->y_dc_scale_table = ff_mpeg4_y_dc_scale_table;
-    s->c_dc_scale_table = ff_mpeg4_c_dc_scale_table;
-
-    if (s->workaround_bugs & FF_BUG_EDGE) {
-        s->h_edge_pos = s->width;
-        s->v_edge_pos = s->height;
-    }
-    return 0;
-}
-
-/**
- * Decode mpeg4 headers.
- * @return <0 if no VOP found (or a damaged one)
- *         FRAME_SKIPPED if a not coded VOP is found
- *         0 if a VOP is found
- */
-int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
-{
-    MpegEncContext *s = &ctx->m;
-    unsigned startcode, v;
-
-    /* search next start code */
-    align_get_bits(gb);
-
-    if (s->codec_tag == AV_RL32("WV1F") && show_bits(gb, 24) == 0x575630) {
-        skip_bits(gb, 24);
-        if (get_bits(gb, 8) == 0xF0)
-            goto end;
-    }
-
-    startcode = 0xff;
-    for (;;) {
-        if (get_bits_count(gb) >= gb->size_in_bits) {
-            if (gb->size_in_bits == 8 &&
-                (ctx->divx_version >= 0 || ctx->xvid_build >= 0)) {
-                av_log(s->avctx, AV_LOG_WARNING, "frame skip %d\n", gb->size_in_bits);
-                return FRAME_SKIPPED;  // divx bug
-            } else
-                return -1;  // end of stream
-        }
-
-        /* use the bits after the test */
-        v = get_bits(gb, 8);
-        startcode = ((startcode << 8) | v) & 0xffffffff;
-
-        if ((startcode & 0xFFFFFF00) != 0x100)
-            continue;  // no startcode
-
-        if (s->avctx->debug & FF_DEBUG_STARTCODE) {
-            av_log(s->avctx, AV_LOG_DEBUG, "startcode: %3X ", startcode);
-            if (startcode <= 0x11F)
-                av_log(s->avctx, AV_LOG_DEBUG, "Video Object Start");
-            else if (startcode <= 0x12F)
-                av_log(s->avctx, AV_LOG_DEBUG, "Video Object Layer Start");
-            else if (startcode <= 0x13F)
-                av_log(s->avctx, AV_LOG_DEBUG, "Reserved");
-            else if (startcode <= 0x15F)
-                av_log(s->avctx, AV_LOG_DEBUG, "FGS bp start");
-            else if (startcode <= 0x1AF)
-                av_log(s->avctx, AV_LOG_DEBUG, "Reserved");
-            else if (startcode == 0x1B0)
-                av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq Start");
-            else if (startcode == 0x1B1)
-                av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq End");
-            else if (startcode == 0x1B2)
-                av_log(s->avctx, AV_LOG_DEBUG, "User Data");
-            else if (startcode == 0x1B3)
-                av_log(s->avctx, AV_LOG_DEBUG, "Group of VOP start");
-            else if (startcode == 0x1B4)
-                av_log(s->avctx, AV_LOG_DEBUG, "Video Session Error");
-            else if (startcode == 0x1B5)
-                av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Start");
-            else if (startcode == 0x1B6)
-                av_log(s->avctx, AV_LOG_DEBUG, "Video Object Plane start");
-            else if (startcode == 0x1B7)
-                av_log(s->avctx, AV_LOG_DEBUG, "slice start");
-            else if (startcode == 0x1B8)
-                av_log(s->avctx, AV_LOG_DEBUG, "extension start");
-            else if (startcode == 0x1B9)
-                av_log(s->avctx, AV_LOG_DEBUG, "fgs start");
-            else if (startcode == 0x1BA)
-                av_log(s->avctx, AV_LOG_DEBUG, "FBA Object start");
-            else if (startcode == 0x1BB)
-                av_log(s->avctx, AV_LOG_DEBUG, "FBA Object Plane start");
-            else if (startcode == 0x1BC)
-                av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object start");
-            else if (startcode == 0x1BD)
-                av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object Plane start");
-            else if (startcode == 0x1BE)
-                av_log(s->avctx, AV_LOG_DEBUG, "Still Texture Object start");
-            else if (startcode == 0x1BF)
-                av_log(s->avctx, AV_LOG_DEBUG, "Texture Spatial Layer start");
-            else if (startcode == 0x1C0)
-                av_log(s->avctx, AV_LOG_DEBUG, "Texture SNR Layer start");
-            else if (startcode == 0x1C1)
-                av_log(s->avctx, AV_LOG_DEBUG, "Texture Tile start");
-            else if (startcode == 0x1C2)
-                av_log(s->avctx, AV_LOG_DEBUG, "Texture Shape Layer start");
-            else if (startcode == 0x1C3)
-                av_log(s->avctx, AV_LOG_DEBUG, "stuffing start");
-            else if (startcode <= 0x1C5)
-                av_log(s->avctx, AV_LOG_DEBUG, "reserved");
-            else if (startcode <= 0x1FF)
-                av_log(s->avctx, AV_LOG_DEBUG, "System start");
-            av_log(s->avctx, AV_LOG_DEBUG, " at %d\n", get_bits_count(gb));
-        }
-
-        if (startcode >= 0x120 && startcode <= 0x12F) {
-            if (decode_vol_header(ctx, gb) < 0)
-                return -1;
-        } else if (startcode == USER_DATA_STARTCODE) {
-            decode_user_data(ctx, gb);
-        } else if (startcode == GOP_STARTCODE) {
-            mpeg4_decode_gop_header(s, gb);
-        } else if (startcode == VOS_STARTCODE) {
-            mpeg4_decode_profile_level(s, gb);
-        } else if (startcode == VOP_STARTCODE) {
-            break;
-        }
-
-        align_get_bits(gb);
-        startcode = 0xff;
-    }
-
-end:
-    if (s->flags & CODEC_FLAG_LOW_DELAY)
-        s->low_delay = 1;
-    s->avctx->has_b_frames = !s->low_delay;
-
-    if (s->workaround_bugs & FF_BUG_AUTODETECT) {
-        if (s->codec_tag == AV_RL32("XVIX"))
-            s->workaround_bugs |= FF_BUG_XVID_ILACE;
-
-        if (s->codec_tag == AV_RL32("UMP4"))
-            s->workaround_bugs |= FF_BUG_UMP4;
-
-        if (ctx->divx_version >= 500 && ctx->divx_build < 1814)
-            s->workaround_bugs |= FF_BUG_QPEL_CHROMA;
-
-        if (ctx->divx_version > 502 && ctx->divx_build < 1814)
-            s->workaround_bugs |= FF_BUG_QPEL_CHROMA2;
-
-        if (ctx->xvid_build <= 3U)
-            s->padding_bug_score = 256 * 256 * 256 * 64;
-
-        if (ctx->xvid_build <= 1U)
-            s->workaround_bugs |= FF_BUG_QPEL_CHROMA;
-
-        if (ctx->xvid_build <= 12U)
-            s->workaround_bugs |= FF_BUG_EDGE;
-
-        if (ctx->xvid_build <= 32U)
-            s->workaround_bugs |= FF_BUG_DC_CLIP;
-
-        if (ctx->lavc_build < 4653U)
-            s->workaround_bugs |= FF_BUG_STD_QPEL;
-
-        if (ctx->lavc_build < 4655U)
-            s->workaround_bugs |= FF_BUG_DIRECT_BLOCKSIZE;
-
-        if (ctx->lavc_build < 4670U)
-            s->workaround_bugs |= FF_BUG_EDGE;
-
-        if (ctx->lavc_build <= 4712U)
-            s->workaround_bugs |= FF_BUG_DC_CLIP;
-
-        if (ctx->divx_version >= 0)
-            s->workaround_bugs |= FF_BUG_DIRECT_BLOCKSIZE;
-
-        if (ctx->divx_version == 501 && ctx->divx_build == 20020416)
-            s->padding_bug_score = 256 * 256 * 256 * 64;
-
-        if (ctx->divx_version < 500U)
-            s->workaround_bugs |= FF_BUG_EDGE;
-
-        if (ctx->divx_version >= 0)
-            s->workaround_bugs |= FF_BUG_HPEL_CHROMA;
-    }
-
-
-    if (s->avctx->debug & FF_DEBUG_BUGS)
-        av_log(s->avctx, AV_LOG_DEBUG,
-               "bugs: %X lavc_build:%d xvid_build:%d divx_version:%d divx_build:%d %s\n",
-               s->workaround_bugs, ctx->lavc_build, ctx->xvid_build,
-               ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : "");
-
-    return decode_vop_header(ctx, gb);
-}
-
-int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
-{
-    Mpeg4DecContext *ctx = avctx->priv_data;
-    MpegEncContext    *s = &ctx->m;
-
-    /* divx 5.01+ bistream reorder stuff */
-    if (s->divx_packed) {
-        int current_pos     = get_bits_count(&s->gb) >> 3;
-        int startcode_found = 0;
-
-        if (buf_size - current_pos > 5) {
-            int i;
-            for (i = current_pos; i < buf_size - 3; i++)
-                if (buf[i]     == 0 &&
-                    buf[i + 1] == 0 &&
-                    buf[i + 2] == 1 &&
-                    buf[i + 3] == 0xB6) {
-                    startcode_found = 1;
-                    break;
-                }
-        }
-        if (s->gb.buffer == s->bitstream_buffer && buf_size > 7 &&
-            ctx->xvid_build >= 0) {       // xvid style
-            startcode_found = 1;
-            current_pos     = 0;
-        }
-
-        if (startcode_found) {
-            av_fast_malloc(&s->bitstream_buffer,
-                           &s->allocated_bitstream_buffer_size,
-                           buf_size - current_pos +
-                           FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!s->bitstream_buffer)
-                return AVERROR(ENOMEM);
-            memcpy(s->bitstream_buffer, buf + current_pos,
-                   buf_size - current_pos);
-            s->bitstream_buffer_size = buf_size - current_pos;
-        }
-    }
-
-    return 0;
-}
-
-static int mpeg4_update_thread_context(AVCodecContext *dst,
-                                       const AVCodecContext *src)
-{
-    Mpeg4DecContext *s = dst->priv_data;
-    const Mpeg4DecContext *s1 = src->priv_data;
-
-    int ret = ff_mpeg_update_thread_context(dst, src);
-
-    if (ret < 0)
-        return ret;
-
-    s->shape               = s1->shape;
-    s->time_increment_bits = s1->time_increment_bits;
-
-    return 0;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    Mpeg4DecContext *ctx = avctx->priv_data;
-    MpegEncContext *s = &ctx->m;
-    int ret;
-    static int done = 0;
-
-    ctx->divx_version =
-    ctx->divx_build   =
-    ctx->xvid_build   =
-    ctx->lavc_build   = -1;
-
-    if ((ret = ff_h263_decode_init(avctx)) < 0)
-        return ret;
-
-    if (!done) {
-        done = 1;
-
-        ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
-        ff_init_rl(&ff_rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]);
-        ff_init_rl(&ff_rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]);
-        INIT_VLC_RL(ff_mpeg4_rl_intra, 554);
-        INIT_VLC_RL(ff_rvlc_rl_inter, 1072);
-        INIT_VLC_RL(ff_rvlc_rl_intra, 1072);
-        INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
-                        &ff_mpeg4_DCtab_lum[0][1], 2, 1,
-                        &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512);
-        INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */,
-                        &ff_mpeg4_DCtab_chrom[0][1], 2, 1,
-                        &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512);
-        INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
-                        &ff_sprite_trajectory_tab[0][1], 4, 2,
-                        &ff_sprite_trajectory_tab[0][0], 4, 2, 128);
-        INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
-                        &ff_mb_type_b_tab[0][1], 2, 1,
-                        &ff_mb_type_b_tab[0][0], 2, 1, 16);
-    }
-
-    s->h263_pred = 1;
-    s->low_delay = 0; /* default, might be overriden in the vol header during header parsing */
-    s->decode_mb = mpeg4_decode_mb;
-    ctx->time_increment_bits = 4; /* default value for broken headers */
-
-    avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
-    avctx->internal->allocate_progress = 1;
-
-    return 0;
-}
-
-static const AVProfile mpeg4_video_profiles[] = {
-    { FF_PROFILE_MPEG4_SIMPLE,                    "Simple Profile" },
-    { FF_PROFILE_MPEG4_SIMPLE_SCALABLE,           "Simple Scalable Profile" },
-    { FF_PROFILE_MPEG4_CORE,                      "Core Profile" },
-    { FF_PROFILE_MPEG4_MAIN,                      "Main Profile" },
-    { FF_PROFILE_MPEG4_N_BIT,                     "N-bit Profile" },
-    { FF_PROFILE_MPEG4_SCALABLE_TEXTURE,          "Scalable Texture Profile" },
-    { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION,     "Simple Face Animation Profile" },
-    { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE,    "Basic Animated Texture Profile" },
-    { FF_PROFILE_MPEG4_HYBRID,                    "Hybrid Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME,        "Advanced Real Time Simple Profile" },
-    { FF_PROFILE_MPEG4_CORE_SCALABLE,             "Code Scalable Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_CODING,           "Advanced Coding Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_CORE,             "Advanced Core Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
-    { FF_PROFILE_MPEG4_SIMPLE_STUDIO,             "Simple Studio Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_SIMPLE,           "Advanced Simple Profile" },
-};
-
-AVCodec ff_mpeg4_decoder = {
-    .name                  = "mpeg4",
-    .long_name             = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_MPEG4,
-    .priv_data_size        = sizeof(Mpeg4DecContext),
-    .init                  = decode_init,
-    .close                 = ff_h263_decode_end,
-    .decode                = ff_h263_decode_frame,
-    .capabilities          = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
-                             CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
-                             CODEC_CAP_FRAME_THREADS,
-    .flush                 = ff_mpeg_flush,
-    .pix_fmts              = ff_h263_hwaccel_pixfmt_list_420,
-    .profiles              = NULL_IF_CONFIG_SMALL(mpeg4_video_profiles),
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context),
-};
diff --git a/deps/libav/libavcodec/mpeg4videoenc.c b/deps/libav/libavcodec/mpeg4videoenc.c
deleted file mode 100644
index 0063f58..0000000
--- a/deps/libav/libavcodec/mpeg4videoenc.c
+++ /dev/null
@@ -1,1408 +0,0 @@
-/*
- * MPEG4 encoder.
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "mpegvideo.h"
-#include "h263.h"
-#include "mpeg4video.h"
-
-/* The uni_DCtab_* tables below contain unified bits+length tables to encode DC
- * differences in mpeg4. Unified in the sense that the specification specifies
- * this encoding in several steps. */
-static uint8_t  uni_DCtab_lum_len[512];
-static uint8_t  uni_DCtab_chrom_len[512];
-static uint16_t uni_DCtab_lum_bits[512];
-static uint16_t uni_DCtab_chrom_bits[512];
-
-/* Unified encoding tables for run length encoding of coefficients.
- * Unified in the sense that the specification specifies the encoding in several steps. */
-static uint32_t uni_mpeg4_intra_rl_bits[64 * 64 * 2 * 2];
-static uint8_t  uni_mpeg4_intra_rl_len[64 * 64 * 2 * 2];
-static uint32_t uni_mpeg4_inter_rl_bits[64 * 64 * 2 * 2];
-static uint8_t  uni_mpeg4_inter_rl_len[64 * 64 * 2 * 2];
-
-//#define UNI_MPEG4_ENC_INDEX(last, run, level) ((last) * 128 + (run) * 256 + (level))
-//#define UNI_MPEG4_ENC_INDEX(last, run, level) ((last) * 128 * 64 + (run) + (level) * 64)
-#define UNI_MPEG4_ENC_INDEX(last, run, level) ((last) * 128 * 64 + (run) * 128 + (level))
-
-/* mpeg4
- * inter
- * max level: 24/6
- * max run: 53/63
- *
- * intra
- * max level: 53/16
- * max run: 29/41
- */
-
-/**
- * Return the number of bits that encoding the 8x8 block in block would need.
- * @param[in]  block_last_index last index in scantable order that refers to a non zero element in block.
- */
-static inline int get_block_rate(MpegEncContext *s, int16_t block[64],
-                                 int block_last_index, uint8_t scantable[64])
-{
-    int last = 0;
-    int j;
-    int rate = 0;
-
-    for (j = 1; j <= block_last_index; j++) {
-        const int index = scantable[j];
-        int level = block[index];
-        if (level) {
-            level += 64;
-            if ((level & (~127)) == 0) {
-                if (j < block_last_index)
-                    rate += s->intra_ac_vlc_length[UNI_AC_ENC_INDEX(j - last - 1, level)];
-                else
-                    rate += s->intra_ac_vlc_last_length[UNI_AC_ENC_INDEX(j - last - 1, level)];
-            } else
-                rate += s->ac_esc_length;
-
-            last = j;
-        }
-    }
-
-    return rate;
-}
-
-/**
- * Restore the ac coefficients in block that have been changed by decide_ac_pred().
- * This function also restores s->block_last_index.
- * @param[in,out] block MB coefficients, these will be restored
- * @param[in] dir ac prediction direction for each 8x8 block
- * @param[out] st scantable for each 8x8 block
- * @param[in] zigzag_last_index index referring to the last non zero coefficient in zigzag order
- */
-static inline void restore_ac_coeffs(MpegEncContext *s, int16_t block[6][64],
-                                     const int dir[6], uint8_t *st[6],
-                                     const int zigzag_last_index[6])
-{
-    int i, n;
-    memcpy(s->block_last_index, zigzag_last_index, sizeof(int) * 6);
-
-    for (n = 0; n < 6; n++) {
-        int16_t *ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
-
-        st[n] = s->intra_scantable.permutated;
-        if (dir[n]) {
-            /* top prediction */
-            for (i = 1; i < 8; i++)
-                block[n][s->dsp.idct_permutation[i]] = ac_val[i + 8];
-        } else {
-            /* left prediction */
-            for (i = 1; i < 8; i++)
-                block[n][s->dsp.idct_permutation[i << 3]] = ac_val[i];
-        }
-    }
-}
-
-/**
- * Return the optimal value (0 or 1) for the ac_pred element for the given MB in mpeg4.
- * This function will also update s->block_last_index and s->ac_val.
- * @param[in,out] block MB coefficients, these will be updated if 1 is returned
- * @param[in] dir ac prediction direction for each 8x8 block
- * @param[out] st scantable for each 8x8 block
- * @param[out] zigzag_last_index index referring to the last non zero coefficient in zigzag order
- */
-static inline int decide_ac_pred(MpegEncContext *s, int16_t block[6][64],
-                                 const int dir[6], uint8_t *st[6],
-                                 int zigzag_last_index[6])
-{
-    int score = 0;
-    int i, n;
-    int8_t *const qscale_table = s->current_picture.qscale_table;
-
-    memcpy(zigzag_last_index, s->block_last_index, sizeof(int) * 6);
-
-    for (n = 0; n < 6; n++) {
-        int16_t *ac_val, *ac_val1;
-
-        score -= get_block_rate(s, block[n], s->block_last_index[n],
-                                s->intra_scantable.permutated);
-
-        ac_val  = s->ac_val[0][0] + s->block_index[n] * 16;
-        ac_val1 = ac_val;
-        if (dir[n]) {
-            const int xy = s->mb_x + s->mb_y * s->mb_stride - s->mb_stride;
-            /* top prediction */
-            ac_val -= s->block_wrap[n] * 16;
-            if (s->mb_y == 0 || s->qscale == qscale_table[xy] || n == 2 || n == 3) {
-                /* same qscale */
-                for (i = 1; i < 8; i++) {
-                    const int level = block[n][s->dsp.idct_permutation[i]];
-                    block[n][s->dsp.idct_permutation[i]] = level - ac_val[i + 8];
-                    ac_val1[i]     = block[n][s->dsp.idct_permutation[i << 3]];
-                    ac_val1[i + 8] = level;
-                }
-            } else {
-                /* different qscale, we must rescale */
-                for (i = 1; i < 8; i++) {
-                    const int level = block[n][s->dsp.idct_permutation[i]];
-                    block[n][s->dsp.idct_permutation[i]] = level - ROUNDED_DIV(ac_val[i + 8] * qscale_table[xy], s->qscale);
-                    ac_val1[i]     = block[n][s->dsp.idct_permutation[i << 3]];
-                    ac_val1[i + 8] = level;
-                }
-            }
-            st[n] = s->intra_h_scantable.permutated;
-        } else {
-            const int xy = s->mb_x - 1 + s->mb_y * s->mb_stride;
-            /* left prediction */
-            ac_val -= 16;
-            if (s->mb_x == 0 || s->qscale == qscale_table[xy] || n == 1 || n == 3) {
-                /* same qscale */
-                for (i = 1; i < 8; i++) {
-                    const int level = block[n][s->dsp.idct_permutation[i << 3]];
-                    block[n][s->dsp.idct_permutation[i << 3]] = level - ac_val[i];
-                    ac_val1[i]     = level;
-                    ac_val1[i + 8] = block[n][s->dsp.idct_permutation[i]];
-                }
-            } else {
-                /* different qscale, we must rescale */
-                for (i = 1; i < 8; i++) {
-                    const int level = block[n][s->dsp.idct_permutation[i << 3]];
-                    block[n][s->dsp.idct_permutation[i << 3]] = level - ROUNDED_DIV(ac_val[i] * qscale_table[xy], s->qscale);
-                    ac_val1[i]     = level;
-                    ac_val1[i + 8] = block[n][s->dsp.idct_permutation[i]];
-                }
-            }
-            st[n] = s->intra_v_scantable.permutated;
-        }
-
-        for (i = 63; i > 0; i--)  // FIXME optimize
-            if (block[n][st[n][i]])
-                break;
-        s->block_last_index[n] = i;
-
-        score += get_block_rate(s, block[n], s->block_last_index[n], st[n]);
-    }
-
-    if (score < 0) {
-        return 1;
-    } else {
-        restore_ac_coeffs(s, block, dir, st, zigzag_last_index);
-        return 0;
-    }
-}
-
-/**
- * modify mb_type & qscale so that encoding is acually possible in mpeg4
- */
-void ff_clean_mpeg4_qscales(MpegEncContext *s)
-{
-    int i;
-    int8_t *const qscale_table = s->current_picture.qscale_table;
-
-    ff_clean_h263_qscales(s);
-
-    if (s->pict_type == AV_PICTURE_TYPE_B) {
-        int odd = 0;
-        /* ok, come on, this isn't funny anymore, there's more code for
-         * handling this mpeg4 mess than for the actual adaptive quantization */
-
-        for (i = 0; i < s->mb_num; i++) {
-            int mb_xy = s->mb_index2xy[i];
-            odd += qscale_table[mb_xy] & 1;
-        }
-
-        if (2 * odd > s->mb_num)
-            odd = 1;
-        else
-            odd = 0;
-
-        for (i = 0; i < s->mb_num; i++) {
-            int mb_xy = s->mb_index2xy[i];
-            if ((qscale_table[mb_xy] & 1) != odd)
-                qscale_table[mb_xy]++;
-            if (qscale_table[mb_xy] > 31)
-                qscale_table[mb_xy] = 31;
-        }
-
-        for (i = 1; i < s->mb_num; i++) {
-            int mb_xy = s->mb_index2xy[i];
-            if (qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i - 1]] &&
-                (s->mb_type[mb_xy] & CANDIDATE_MB_TYPE_DIRECT)) {
-                s->mb_type[mb_xy] |= CANDIDATE_MB_TYPE_BIDIR;
-            }
-        }
-    }
-}
-
-/**
- * Encode the dc value.
- * @param n block index (0-3 are luma, 4-5 are chroma)
- */
-static inline void mpeg4_encode_dc(PutBitContext *s, int level, int n)
-{
-#if 1
-    /* DC will overflow if level is outside the [-255,255] range. */
-    level += 256;
-    if (n < 4) {
-        /* luminance */
-        put_bits(s, uni_DCtab_lum_len[level], uni_DCtab_lum_bits[level]);
-    } else {
-        /* chrominance */
-        put_bits(s, uni_DCtab_chrom_len[level], uni_DCtab_chrom_bits[level]);
-    }
-#else
-    int size, v;
-    /* find number of bits */
-    size = 0;
-    v    = abs(level);
-    while (v) {
-        v >>= 1;
-        size++;
-    }
-
-    if (n < 4) {
-        /* luminance */
-        put_bits(&s->pb, ff_mpeg4_DCtab_lum[size][1], ff_mpeg4_DCtab_lum[size][0]);
-    } else {
-        /* chrominance */
-        put_bits(&s->pb, ff_mpeg4_DCtab_chrom[size][1], ff_mpeg4_DCtab_chrom[size][0]);
-    }
-
-    /* encode remaining bits */
-    if (size > 0) {
-        if (level < 0)
-            level = (-level) ^ ((1 << size) - 1);
-        put_bits(&s->pb, size, level);
-        if (size > 8)
-            put_bits(&s->pb, 1, 1);
-    }
-#endif
-}
-
-static inline int mpeg4_get_dc_length(int level, int n)
-{
-    if (n < 4)
-        return uni_DCtab_lum_len[level + 256];
-    else
-        return uni_DCtab_chrom_len[level + 256];
-}
-
-/**
- * Encode an 8x8 block.
- * @param n block index (0-3 are luma, 4-5 are chroma)
- */
-static inline void mpeg4_encode_block(MpegEncContext *s,
-                                      int16_t *block, int n, int intra_dc,
-                                      uint8_t *scan_table, PutBitContext *dc_pb,
-                                      PutBitContext *ac_pb)
-{
-    int i, last_non_zero;
-    uint32_t *bits_tab;
-    uint8_t *len_tab;
-    const int last_index = s->block_last_index[n];
-
-    if (s->mb_intra) {  // Note gcc (3.2.1 at least) will optimize this away
-        /* mpeg4 based DC predictor */
-        mpeg4_encode_dc(dc_pb, intra_dc, n);
-        if (last_index < 1)
-            return;
-        i = 1;
-        bits_tab = uni_mpeg4_intra_rl_bits;
-        len_tab  = uni_mpeg4_intra_rl_len;
-    } else {
-        if (last_index < 0)
-            return;
-        i = 0;
-        bits_tab = uni_mpeg4_inter_rl_bits;
-        len_tab  = uni_mpeg4_inter_rl_len;
-    }
-
-    /* AC coefs */
-    last_non_zero = i - 1;
-    for (; i < last_index; i++) {
-        int level = block[scan_table[i]];
-        if (level) {
-            int run = i - last_non_zero - 1;
-            level += 64;
-            if ((level & (~127)) == 0) {
-                const int index = UNI_MPEG4_ENC_INDEX(0, run, level);
-                put_bits(ac_pb, len_tab[index], bits_tab[index]);
-            } else {  // ESC3
-                put_bits(ac_pb,
-                         7 + 2 + 1 + 6 + 1 + 12 + 1,
-                         (3 << 23) + (3 << 21) + (0 << 20) + (run << 14) +
-                         (1 << 13) + (((level - 64) & 0xfff) << 1) + 1);
-            }
-            last_non_zero = i;
-        }
-    }
-    /* if (i <= last_index) */ {
-        int level = block[scan_table[i]];
-        int run   = i - last_non_zero - 1;
-        level += 64;
-        if ((level & (~127)) == 0) {
-            const int index = UNI_MPEG4_ENC_INDEX(1, run, level);
-            put_bits(ac_pb, len_tab[index], bits_tab[index]);
-        } else {  // ESC3
-            put_bits(ac_pb,
-                     7 + 2 + 1 + 6 + 1 + 12 + 1,
-                     (3 << 23) + (3 << 21) + (1 << 20) + (run << 14) +
-                     (1 << 13) + (((level - 64) & 0xfff) << 1) + 1);
-        }
-    }
-}
-
-static int mpeg4_get_block_length(MpegEncContext *s,
-                                  int16_t *block, int n,
-                                  int intra_dc, uint8_t *scan_table)
-{
-    int i, last_non_zero;
-    uint8_t *len_tab;
-    const int last_index = s->block_last_index[n];
-    int len = 0;
-
-    if (s->mb_intra) {  // Note gcc (3.2.1 at least) will optimize this away
-        /* mpeg4 based DC predictor */
-        len += mpeg4_get_dc_length(intra_dc, n);
-        if (last_index < 1)
-            return len;
-        i = 1;
-        len_tab = uni_mpeg4_intra_rl_len;
-    } else {
-        if (last_index < 0)
-            return 0;
-        i = 0;
-        len_tab = uni_mpeg4_inter_rl_len;
-    }
-
-    /* AC coefs */
-    last_non_zero = i - 1;
-    for (; i < last_index; i++) {
-        int level = block[scan_table[i]];
-        if (level) {
-            int run = i - last_non_zero - 1;
-            level += 64;
-            if ((level & (~127)) == 0) {
-                const int index = UNI_MPEG4_ENC_INDEX(0, run, level);
-                len += len_tab[index];
-            } else {  // ESC3
-                len += 7 + 2 + 1 + 6 + 1 + 12 + 1;
-            }
-            last_non_zero = i;
-        }
-    }
-    /* if (i <= last_index) */ {
-        int level = block[scan_table[i]];
-        int run   = i - last_non_zero - 1;
-        level += 64;
-        if ((level & (~127)) == 0) {
-            const int index = UNI_MPEG4_ENC_INDEX(1, run, level);
-            len += len_tab[index];
-        } else {  // ESC3
-            len += 7 + 2 + 1 + 6 + 1 + 12 + 1;
-        }
-    }
-
-    return len;
-}
-
-static inline void mpeg4_encode_blocks(MpegEncContext *s, int16_t block[6][64],
-                                       int intra_dc[6], uint8_t **scan_table,
-                                       PutBitContext *dc_pb,
-                                       PutBitContext *ac_pb)
-{
-    int i;
-
-    if (scan_table) {
-        if (s->flags2 & CODEC_FLAG2_NO_OUTPUT) {
-            for (i = 0; i < 6; i++)
-                skip_put_bits(&s->pb,
-                              mpeg4_get_block_length(s, block[i], i,
-                                                     intra_dc[i], scan_table[i]));
-        } else {
-            /* encode each block */
-            for (i = 0; i < 6; i++)
-                mpeg4_encode_block(s, block[i], i,
-                                   intra_dc[i], scan_table[i], dc_pb, ac_pb);
-        }
-    } else {
-        if (s->flags2 & CODEC_FLAG2_NO_OUTPUT) {
-            for (i = 0; i < 6; i++)
-                skip_put_bits(&s->pb,
-                              mpeg4_get_block_length(s, block[i], i, 0,
-                                                     s->intra_scantable.permutated));
-        } else {
-            /* encode each block */
-            for (i = 0; i < 6; i++)
-                mpeg4_encode_block(s, block[i], i, 0,
-                                   s->intra_scantable.permutated, dc_pb, ac_pb);
-        }
-    }
-}
-
-static inline int get_b_cbp(MpegEncContext *s, int16_t block[6][64],
-                            int motion_x, int motion_y, int mb_type)
-{
-    int cbp = 0, i;
-
-    if (s->mpv_flags & FF_MPV_FLAG_CBP_RD) {
-        int score        = 0;
-        const int lambda = s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
-
-        for (i = 0; i < 6; i++) {
-            if (s->coded_score[i] < 0) {
-                score += s->coded_score[i];
-                cbp   |= 1 << (5 - i);
-            }
-        }
-
-        if (cbp) {
-            int zero_score = -6;
-            if ((motion_x | motion_y | s->dquant | mb_type) == 0)
-                zero_score -= 4;  // 2 * MV + mb_type + cbp bit
-
-            zero_score *= lambda;
-            if (zero_score <= score)
-                cbp = 0;
-        }
-
-        for (i = 0; i < 6; i++) {
-            if (s->block_last_index[i] >= 0 && ((cbp >> (5 - i)) & 1) == 0) {
-                s->block_last_index[i] = -1;
-                s->dsp.clear_block(s->block[i]);
-            }
-        }
-    } else {
-        for (i = 0; i < 6; i++) {
-            if (s->block_last_index[i] >= 0)
-                cbp |= 1 << (5 - i);
-        }
-    }
-    return cbp;
-}
-
-// FIXME this is duplicated to h263.c
-static const int dquant_code[5] = { 1, 0, 9, 2, 3 };
-
-void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64],
-                        int motion_x, int motion_y)
-{
-    int cbpc, cbpy, pred_x, pred_y;
-    PutBitContext *const pb2    = s->data_partitioning ? &s->pb2 : &s->pb;
-    PutBitContext *const tex_pb = s->data_partitioning && s->pict_type != AV_PICTURE_TYPE_B ? &s->tex_pb : &s->pb;
-    PutBitContext *const dc_pb  = s->data_partitioning && s->pict_type != AV_PICTURE_TYPE_I ? &s->pb2 : &s->pb;
-    const int interleaved_stats = (s->flags & CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0;
-
-    if (!s->mb_intra) {
-        int i, cbp;
-
-        if (s->pict_type == AV_PICTURE_TYPE_B) {
-            /* convert from mv_dir to type */
-            static const int mb_type_table[8] = { -1, 3, 2, 1, -1, -1, -1, 0 };
-            int mb_type = mb_type_table[s->mv_dir];
-
-            if (s->mb_x == 0) {
-                for (i = 0; i < 2; i++)
-                    s->last_mv[i][0][0] =
-                    s->last_mv[i][0][1] =
-                    s->last_mv[i][1][0] =
-                    s->last_mv[i][1][1] = 0;
-            }
-
-            assert(s->dquant >= -2 && s->dquant <= 2);
-            assert((s->dquant & 1) == 0);
-            assert(mb_type >= 0);
-
-            /* nothing to do if this MB was skipped in the next P Frame */
-            if (s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]) {  // FIXME avoid DCT & ...
-                s->skip_count++;
-                s->mv[0][0][0] =
-                s->mv[0][0][1] =
-                s->mv[1][0][0] =
-                s->mv[1][0][1] = 0;
-                s->mv_dir  = MV_DIR_FORWARD;  // doesn't matter
-                s->qscale -= s->dquant;
-//                s->mb_skipped = 1;
-
-                return;
-            }
-
-            cbp = get_b_cbp(s, block, motion_x, motion_y, mb_type);
-
-            if ((cbp | motion_x | motion_y | mb_type) == 0) {
-                /* direct MB with MV={0,0} */
-                assert(s->dquant == 0);
-
-                put_bits(&s->pb, 1, 1); /* mb not coded modb1=1 */
-
-                if (interleaved_stats) {
-                    s->misc_bits++;
-                    s->last_bits++;
-                }
-                s->skip_count++;
-                return;
-            }
-
-            put_bits(&s->pb, 1, 0);            /* mb coded modb1=0 */
-            put_bits(&s->pb, 1, cbp ? 0 : 1);  /* modb2 */ // FIXME merge
-            put_bits(&s->pb, mb_type + 1, 1);  // this table is so simple that we don't need it :)
-            if (cbp)
-                put_bits(&s->pb, 6, cbp);
-
-            if (cbp && mb_type) {
-                if (s->dquant)
-                    put_bits(&s->pb, 2, (s->dquant >> 2) + 3);
-                else
-                    put_bits(&s->pb, 1, 0);
-            } else
-                s->qscale -= s->dquant;
-
-            if (!s->progressive_sequence) {
-                if (cbp)
-                    put_bits(&s->pb, 1, s->interlaced_dct);
-                if (mb_type)                  // not direct mode
-                    put_bits(&s->pb, 1, s->mv_type == MV_TYPE_FIELD);
-            }
-
-            if (interleaved_stats)
-                s->misc_bits += get_bits_diff(s);
-
-            if (!mb_type) {
-                assert(s->mv_dir & MV_DIRECT);
-                ff_h263_encode_motion_vector(s, motion_x, motion_y, 1);
-                s->b_count++;
-                s->f_count++;
-            } else {
-                assert(mb_type > 0 && mb_type < 4);
-                if (s->mv_type != MV_TYPE_FIELD) {
-                    if (s->mv_dir & MV_DIR_FORWARD) {
-                        ff_h263_encode_motion_vector(s,
-                                                     s->mv[0][0][0] - s->last_mv[0][0][0],
-                                                     s->mv[0][0][1] - s->last_mv[0][0][1],
-                                                     s->f_code);
-                        s->last_mv[0][0][0] =
-                        s->last_mv[0][1][0] = s->mv[0][0][0];
-                        s->last_mv[0][0][1] =
-                        s->last_mv[0][1][1] = s->mv[0][0][1];
-                        s->f_count++;
-                    }
-                    if (s->mv_dir & MV_DIR_BACKWARD) {
-                        ff_h263_encode_motion_vector(s,
-                                                     s->mv[1][0][0] - s->last_mv[1][0][0],
-                                                     s->mv[1][0][1] - s->last_mv[1][0][1],
-                                                     s->b_code);
-                        s->last_mv[1][0][0] =
-                        s->last_mv[1][1][0] = s->mv[1][0][0];
-                        s->last_mv[1][0][1] =
-                        s->last_mv[1][1][1] = s->mv[1][0][1];
-                        s->b_count++;
-                    }
-                } else {
-                    if (s->mv_dir & MV_DIR_FORWARD) {
-                        put_bits(&s->pb, 1, s->field_select[0][0]);
-                        put_bits(&s->pb, 1, s->field_select[0][1]);
-                    }
-                    if (s->mv_dir & MV_DIR_BACKWARD) {
-                        put_bits(&s->pb, 1, s->field_select[1][0]);
-                        put_bits(&s->pb, 1, s->field_select[1][1]);
-                    }
-                    if (s->mv_dir & MV_DIR_FORWARD) {
-                        for (i = 0; i < 2; i++) {
-                            ff_h263_encode_motion_vector(s,
-                                                         s->mv[0][i][0] - s->last_mv[0][i][0],
-                                                         s->mv[0][i][1] - s->last_mv[0][i][1] / 2,
-                                                         s->f_code);
-                            s->last_mv[0][i][0] = s->mv[0][i][0];
-                            s->last_mv[0][i][1] = s->mv[0][i][1] * 2;
-                        }
-                        s->f_count++;
-                    }
-                    if (s->mv_dir & MV_DIR_BACKWARD) {
-                        for (i = 0; i < 2; i++) {
-                            ff_h263_encode_motion_vector(s,
-                                                         s->mv[1][i][0] - s->last_mv[1][i][0],
-                                                         s->mv[1][i][1] - s->last_mv[1][i][1] / 2,
-                                                         s->b_code);
-                            s->last_mv[1][i][0] = s->mv[1][i][0];
-                            s->last_mv[1][i][1] = s->mv[1][i][1] * 2;
-                        }
-                        s->b_count++;
-                    }
-                }
-            }
-
-            if (interleaved_stats)
-                s->mv_bits += get_bits_diff(s);
-
-            mpeg4_encode_blocks(s, block, NULL, NULL, NULL, &s->pb);
-
-            if (interleaved_stats)
-                s->p_tex_bits += get_bits_diff(s);
-        } else { /* s->pict_type==AV_PICTURE_TYPE_B */
-            cbp = get_p_cbp(s, block, motion_x, motion_y);
-
-            if ((cbp | motion_x | motion_y | s->dquant) == 0 &&
-                s->mv_type == MV_TYPE_16X16) {
-                /* check if the B frames can skip it too, as we must skip it
-                 * if we skip here why didn't they just compress
-                 * the skip-mb bits instead of reusing them ?! */
-                if (s->max_b_frames > 0) {
-                    int i;
-                    int x, y, offset;
-                    uint8_t *p_pic;
-
-                    x = s->mb_x * 16;
-                    y = s->mb_y * 16;
-                    if (x + 16 > s->width)
-                        x = s->width - 16;
-                    if (y + 16 > s->height)
-                        y = s->height - 16;
-
-                    offset = x + y * s->linesize;
-                    p_pic  = s->new_picture.f.data[0] + offset;
-
-                    s->mb_skipped = 1;
-                    for (i = 0; i < s->max_b_frames; i++) {
-                        uint8_t *b_pic;
-                        int diff;
-                        Picture *pic = s->reordered_input_picture[i + 1];
-
-                        if (!pic || pic->f.pict_type != AV_PICTURE_TYPE_B)
-                            break;
-
-                        b_pic = pic->f.data[0] + offset;
-                        if (!pic->shared)
-                            b_pic += INPLACE_OFFSET;
-                        diff = s->dsp.sad[0](NULL, p_pic, b_pic, s->linesize, 16);
-                        if (diff > s->qscale * 70) {  // FIXME check that 70 is optimal
-                            s->mb_skipped = 0;
-                            break;
-                        }
-                    }
-                } else
-                    s->mb_skipped = 1;
-
-                if (s->mb_skipped == 1) {
-                    /* skip macroblock */
-                    put_bits(&s->pb, 1, 1);
-
-                    if (interleaved_stats) {
-                        s->misc_bits++;
-                        s->last_bits++;
-                    }
-                    s->skip_count++;
-
-                    return;
-                }
-            }
-
-            put_bits(&s->pb, 1, 0);     /* mb coded */
-            cbpc  = cbp & 3;
-            cbpy  = cbp >> 2;
-            cbpy ^= 0xf;
-            if (s->mv_type == MV_TYPE_16X16) {
-                if (s->dquant)
-                    cbpc += 8;
-                put_bits(&s->pb,
-                         ff_h263_inter_MCBPC_bits[cbpc],
-                         ff_h263_inter_MCBPC_code[cbpc]);
-
-                put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
-                if (s->dquant)
-                    put_bits(pb2, 2, dquant_code[s->dquant + 2]);
-
-                if (!s->progressive_sequence) {
-                    if (cbp)
-                        put_bits(pb2, 1, s->interlaced_dct);
-                    put_bits(pb2, 1, 0);
-                }
-
-                if (interleaved_stats)
-                    s->misc_bits += get_bits_diff(s);
-
-                /* motion vectors: 16x16 mode */
-                ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-
-                ff_h263_encode_motion_vector(s,
-                                             motion_x - pred_x,
-                                             motion_y - pred_y,
-                                             s->f_code);
-            } else if (s->mv_type == MV_TYPE_FIELD) {
-                if (s->dquant)
-                    cbpc += 8;
-                put_bits(&s->pb,
-                         ff_h263_inter_MCBPC_bits[cbpc],
-                         ff_h263_inter_MCBPC_code[cbpc]);
-
-                put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
-                if (s->dquant)
-                    put_bits(pb2, 2, dquant_code[s->dquant + 2]);
-
-                assert(!s->progressive_sequence);
-                if (cbp)
-                    put_bits(pb2, 1, s->interlaced_dct);
-                put_bits(pb2, 1, 1);
-
-                if (interleaved_stats)
-                    s->misc_bits += get_bits_diff(s);
-
-                /* motion vectors: 16x8 interlaced mode */
-                ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-                pred_y /= 2;
-
-                put_bits(&s->pb, 1, s->field_select[0][0]);
-                put_bits(&s->pb, 1, s->field_select[0][1]);
-
-                ff_h263_encode_motion_vector(s,
-                                             s->mv[0][0][0] - pred_x,
-                                             s->mv[0][0][1] - pred_y,
-                                             s->f_code);
-                ff_h263_encode_motion_vector(s,
-                                             s->mv[0][1][0] - pred_x,
-                                             s->mv[0][1][1] - pred_y,
-                                             s->f_code);
-            } else {
-                assert(s->mv_type == MV_TYPE_8X8);
-                put_bits(&s->pb,
-                         ff_h263_inter_MCBPC_bits[cbpc + 16],
-                         ff_h263_inter_MCBPC_code[cbpc + 16]);
-                put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
-
-                if (!s->progressive_sequence && cbp)
-                    put_bits(pb2, 1, s->interlaced_dct);
-
-                if (interleaved_stats)
-                    s->misc_bits += get_bits_diff(s);
-
-                for (i = 0; i < 4; i++) {
-                    /* motion vectors: 8x8 mode*/
-                    ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
-
-                    ff_h263_encode_motion_vector(s,
-                                                 s->current_picture.motion_val[0][s->block_index[i]][0] - pred_x,
-                                                 s->current_picture.motion_val[0][s->block_index[i]][1] - pred_y,
-                                                 s->f_code);
-                }
-            }
-
-            if (interleaved_stats)
-                s->mv_bits += get_bits_diff(s);
-
-            mpeg4_encode_blocks(s, block, NULL, NULL, NULL, tex_pb);
-
-            if (interleaved_stats)
-                s->p_tex_bits += get_bits_diff(s);
-
-            s->f_count++;
-        }
-    } else {
-        int cbp;
-        int dc_diff[6];  // dc values with the dc prediction subtracted
-        int dir[6];      // prediction direction
-        int zigzag_last_index[6];
-        uint8_t *scan_table[6];
-        int i;
-
-        for (i = 0; i < 6; i++)
-            dc_diff[i] = ff_mpeg4_pred_dc(s, i, block[i][0], &dir[i], 1);
-
-        if (s->flags & CODEC_FLAG_AC_PRED) {
-            s->ac_pred = decide_ac_pred(s, block, dir, scan_table, zigzag_last_index);
-        } else {
-            for (i = 0; i < 6; i++)
-                scan_table[i] = s->intra_scantable.permutated;
-        }
-
-        /* compute cbp */
-        cbp = 0;
-        for (i = 0; i < 6; i++)
-            if (s->block_last_index[i] >= 1)
-                cbp |= 1 << (5 - i);
-
-        cbpc = cbp & 3;
-        if (s->pict_type == AV_PICTURE_TYPE_I) {
-            if (s->dquant)
-                cbpc += 4;
-            put_bits(&s->pb,
-                     ff_h263_intra_MCBPC_bits[cbpc],
-                     ff_h263_intra_MCBPC_code[cbpc]);
-        } else {
-            if (s->dquant)
-                cbpc += 8;
-            put_bits(&s->pb, 1, 0);     /* mb coded */
-            put_bits(&s->pb,
-                     ff_h263_inter_MCBPC_bits[cbpc + 4],
-                     ff_h263_inter_MCBPC_code[cbpc + 4]);
-        }
-        put_bits(pb2, 1, s->ac_pred);
-        cbpy = cbp >> 2;
-        put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
-        if (s->dquant)
-            put_bits(dc_pb, 2, dquant_code[s->dquant + 2]);
-
-        if (!s->progressive_sequence)
-            put_bits(dc_pb, 1, s->interlaced_dct);
-
-        if (interleaved_stats)
-            s->misc_bits += get_bits_diff(s);
-
-        mpeg4_encode_blocks(s, block, dc_diff, scan_table, dc_pb, tex_pb);
-
-        if (interleaved_stats)
-            s->i_tex_bits += get_bits_diff(s);
-        s->i_count++;
-
-        /* restore ac coeffs & last_index stuff
-         * if we messed them up with the prediction */
-        if (s->ac_pred)
-            restore_ac_coeffs(s, block, dir, scan_table, zigzag_last_index);
-    }
-}
-
-/**
- * add mpeg4 stuffing bits (01...1)
- */
-void ff_mpeg4_stuffing(PutBitContext *pbc)
-{
-    int length;
-    put_bits(pbc, 1, 0);
-    length = (-put_bits_count(pbc)) & 7;
-    if (length)
-        put_bits(pbc, length, (1 << length) - 1);
-}
-
-/* must be called before writing the header */
-void ff_set_mpeg4_time(MpegEncContext *s)
-{
-    if (s->pict_type == AV_PICTURE_TYPE_B) {
-        ff_mpeg4_init_direct_mv(s);
-    } else {
-        s->last_time_base = s->time_base;
-        s->time_base      = s->time / s->avctx->time_base.den;
-    }
-}
-
-static void mpeg4_encode_gop_header(MpegEncContext *s)
-{
-    int hours, minutes, seconds;
-    int64_t time;
-
-    put_bits(&s->pb, 16, 0);
-    put_bits(&s->pb, 16, GOP_STARTCODE);
-
-    time = s->current_picture_ptr->f.pts;
-    if (s->reordered_input_picture[1])
-        time = FFMIN(time, s->reordered_input_picture[1]->f.pts);
-    time = time * s->avctx->time_base.num;
-
-    seconds  = time / s->avctx->time_base.den;
-    minutes  = seconds / 60;
-    seconds %= 60;
-    hours    = minutes / 60;
-    minutes %= 60;
-    hours   %= 24;
-
-    put_bits(&s->pb, 5, hours);
-    put_bits(&s->pb, 6, minutes);
-    put_bits(&s->pb, 1, 1);
-    put_bits(&s->pb, 6, seconds);
-
-    put_bits(&s->pb, 1, !!(s->flags & CODEC_FLAG_CLOSED_GOP));
-    put_bits(&s->pb, 1, 0);  // broken link == NO
-
-    s->last_time_base = time / s->avctx->time_base.den;
-
-    ff_mpeg4_stuffing(&s->pb);
-}
-
-static void mpeg4_encode_visual_object_header(MpegEncContext *s)
-{
-    int profile_and_level_indication;
-    int vo_ver_id;
-
-    if (s->avctx->profile != FF_PROFILE_UNKNOWN) {
-        profile_and_level_indication = s->avctx->profile << 4;
-    } else if (s->max_b_frames || s->quarter_sample) {
-        profile_and_level_indication = 0xF0;  // adv simple
-    } else {
-        profile_and_level_indication = 0x00;  // simple
-    }
-
-    if (s->avctx->level != FF_LEVEL_UNKNOWN)
-        profile_and_level_indication |= s->avctx->level;
-    else
-        profile_and_level_indication |= 1;   // level 1
-
-    if (profile_and_level_indication >> 4 == 0xF)
-        vo_ver_id = 5;
-    else
-        vo_ver_id = 1;
-
-    // FIXME levels
-
-    put_bits(&s->pb, 16, 0);
-    put_bits(&s->pb, 16, VOS_STARTCODE);
-
-    put_bits(&s->pb, 8, profile_and_level_indication);
-
-    put_bits(&s->pb, 16, 0);
-    put_bits(&s->pb, 16, VISUAL_OBJ_STARTCODE);
-
-    put_bits(&s->pb, 1, 1);
-    put_bits(&s->pb, 4, vo_ver_id);
-    put_bits(&s->pb, 3, 1);     // priority
-
-    put_bits(&s->pb, 4, 1);     // visual obj type== video obj
-
-    put_bits(&s->pb, 1, 0);     // video signal type == no clue // FIXME
-
-    ff_mpeg4_stuffing(&s->pb);
-}
-
-static void mpeg4_encode_vol_header(MpegEncContext *s,
-                                    int vo_number,
-                                    int vol_number)
-{
-    int vo_ver_id;
-
-    if (!CONFIG_MPEG4_ENCODER)
-        return;
-
-    if (s->max_b_frames || s->quarter_sample) {
-        vo_ver_id  = 5;
-        s->vo_type = ADV_SIMPLE_VO_TYPE;
-    } else {
-        vo_ver_id  = 1;
-        s->vo_type = SIMPLE_VO_TYPE;
-    }
-
-    put_bits(&s->pb, 16, 0);
-    put_bits(&s->pb, 16, 0x100 + vo_number);        /* video obj */
-    put_bits(&s->pb, 16, 0);
-    put_bits(&s->pb, 16, 0x120 + vol_number);       /* video obj layer */
-
-    put_bits(&s->pb, 1, 0);             /* random access vol */
-    put_bits(&s->pb, 8, s->vo_type);    /* video obj type indication */
-    if (s->workaround_bugs & FF_BUG_MS) {
-        put_bits(&s->pb, 1, 0);         /* is obj layer id= no */
-    } else {
-        put_bits(&s->pb, 1, 1);         /* is obj layer id= yes */
-        put_bits(&s->pb, 4, vo_ver_id); /* is obj layer ver id */
-        put_bits(&s->pb, 3, 1);         /* is obj layer priority */
-    }
-
-    s->aspect_ratio_info = ff_h263_aspect_to_info(s->avctx->sample_aspect_ratio);
-
-    put_bits(&s->pb, 4, s->aspect_ratio_info); /* aspect ratio info */
-    if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
-        put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num);
-        put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den);
-    }
-
-    if (s->workaround_bugs & FF_BUG_MS) {
-        put_bits(&s->pb, 1, 0);         /* vol control parameters= no @@@ */
-    } else {
-        put_bits(&s->pb, 1, 1);         /* vol control parameters= yes */
-        put_bits(&s->pb, 2, 1);         /* chroma format YUV 420/YV12 */
-        put_bits(&s->pb, 1, s->low_delay);
-        put_bits(&s->pb, 1, 0);         /* vbv parameters= no */
-    }
-
-    put_bits(&s->pb, 2, RECT_SHAPE);    /* vol shape= rectangle */
-    put_bits(&s->pb, 1, 1);             /* marker bit */
-
-    put_bits(&s->pb, 16, s->avctx->time_base.den);
-    if (s->time_increment_bits < 1)
-        s->time_increment_bits = 1;
-    put_bits(&s->pb, 1, 1);             /* marker bit */
-    put_bits(&s->pb, 1, 0);             /* fixed vop rate=no */
-    put_bits(&s->pb, 1, 1);             /* marker bit */
-    put_bits(&s->pb, 13, s->width);     /* vol width */
-    put_bits(&s->pb, 1, 1);             /* marker bit */
-    put_bits(&s->pb, 13, s->height);    /* vol height */
-    put_bits(&s->pb, 1, 1);             /* marker bit */
-    put_bits(&s->pb, 1, s->progressive_sequence ? 0 : 1);
-    put_bits(&s->pb, 1, 1);             /* obmc disable */
-    if (vo_ver_id == 1)
-        put_bits(&s->pb, 1, 0);       /* sprite enable */
-    else
-        put_bits(&s->pb, 2, 0);       /* sprite enable */
-
-    put_bits(&s->pb, 1, 0);             /* not 8 bit == false */
-    put_bits(&s->pb, 1, s->mpeg_quant); /* quant type= (0=h263 style)*/
-
-    if (s->mpeg_quant) {
-        ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix);
-        ff_write_quant_matrix(&s->pb, s->avctx->inter_matrix);
-    }
-
-    if (vo_ver_id != 1)
-        put_bits(&s->pb, 1, s->quarter_sample);
-    put_bits(&s->pb, 1, 1);             /* complexity estimation disable */
-    put_bits(&s->pb, 1, s->rtp_mode ? 0 : 1); /* resync marker disable */
-    put_bits(&s->pb, 1, s->data_partitioning ? 1 : 0);
-    if (s->data_partitioning)
-        put_bits(&s->pb, 1, 0);         /* no rvlc */
-
-    if (vo_ver_id != 1) {
-        put_bits(&s->pb, 1, 0);         /* newpred */
-        put_bits(&s->pb, 1, 0);         /* reduced res vop */
-    }
-    put_bits(&s->pb, 1, 0);             /* scalability */
-
-    ff_mpeg4_stuffing(&s->pb);
-
-    /* user data */
-    if (!(s->flags & CODEC_FLAG_BITEXACT)) {
-        put_bits(&s->pb, 16, 0);
-        put_bits(&s->pb, 16, 0x1B2);    /* user_data */
-        avpriv_put_string(&s->pb, LIBAVCODEC_IDENT, 0);
-    }
-}
-
-/* write mpeg4 VOP header */
-void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number)
-{
-    int time_incr;
-    int time_div, time_mod;
-
-    if (s->pict_type == AV_PICTURE_TYPE_I) {
-        if (!(s->flags & CODEC_FLAG_GLOBAL_HEADER)) {
-            if (s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT)  // HACK, the reference sw is buggy
-                mpeg4_encode_visual_object_header(s);
-            if (s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT || picture_number == 0)  // HACK, the reference sw is buggy
-                mpeg4_encode_vol_header(s, 0, 0);
-        }
-        if (!(s->workaround_bugs & FF_BUG_MS))
-            mpeg4_encode_gop_header(s);
-    }
-
-    s->partitioned_frame = s->data_partitioning && s->pict_type != AV_PICTURE_TYPE_B;
-
-    put_bits(&s->pb, 16, 0);                /* vop header */
-    put_bits(&s->pb, 16, VOP_STARTCODE);    /* vop header */
-    put_bits(&s->pb, 2, s->pict_type - 1);  /* pict type: I = 0 , P = 1 */
-
-    assert(s->time >= 0);
-    time_div  = s->time / s->avctx->time_base.den;
-    time_mod  = s->time % s->avctx->time_base.den;
-    time_incr = time_div - s->last_time_base;
-    assert(time_incr >= 0);
-    while (time_incr--)
-        put_bits(&s->pb, 1, 1);
-
-    put_bits(&s->pb, 1, 0);
-
-    put_bits(&s->pb, 1, 1);                             /* marker */
-    put_bits(&s->pb, s->time_increment_bits, time_mod); /* time increment */
-    put_bits(&s->pb, 1, 1);                             /* marker */
-    put_bits(&s->pb, 1, 1);                             /* vop coded */
-    if (s->pict_type == AV_PICTURE_TYPE_P) {
-        put_bits(&s->pb, 1, s->no_rounding);    /* rounding type */
-    }
-    put_bits(&s->pb, 3, 0);     /* intra dc VLC threshold */
-    if (!s->progressive_sequence) {
-        put_bits(&s->pb, 1, s->current_picture_ptr->f.top_field_first);
-        put_bits(&s->pb, 1, s->alternate_scan);
-    }
-    // FIXME sprite stuff
-
-    put_bits(&s->pb, 5, s->qscale);
-
-    if (s->pict_type != AV_PICTURE_TYPE_I)
-        put_bits(&s->pb, 3, s->f_code);  /* fcode_for */
-    if (s->pict_type == AV_PICTURE_TYPE_B)
-        put_bits(&s->pb, 3, s->b_code);  /* fcode_back */
-}
-
-static av_cold void init_uni_dc_tab(void)
-{
-    int level, uni_code, uni_len;
-
-    for (level = -256; level < 256; level++) {
-        int size, v, l;
-        /* find number of bits */
-        size = 0;
-        v    = abs(level);
-        while (v) {
-            v >>= 1;
-            size++;
-        }
-
-        if (level < 0)
-            l = (-level) ^ ((1 << size) - 1);
-        else
-            l = level;
-
-        /* luminance */
-        uni_code = ff_mpeg4_DCtab_lum[size][0];
-        uni_len  = ff_mpeg4_DCtab_lum[size][1];
-
-        if (size > 0) {
-            uni_code <<= size;
-            uni_code  |= l;
-            uni_len   += size;
-            if (size > 8) {
-                uni_code <<= 1;
-                uni_code  |= 1;
-                uni_len++;
-            }
-        }
-        uni_DCtab_lum_bits[level + 256] = uni_code;
-        uni_DCtab_lum_len[level + 256]  = uni_len;
-
-        /* chrominance */
-        uni_code = ff_mpeg4_DCtab_chrom[size][0];
-        uni_len  = ff_mpeg4_DCtab_chrom[size][1];
-
-        if (size > 0) {
-            uni_code <<= size;
-            uni_code  |= l;
-            uni_len   += size;
-            if (size > 8) {
-                uni_code <<= 1;
-                uni_code  |= 1;
-                uni_len++;
-            }
-        }
-        uni_DCtab_chrom_bits[level + 256] = uni_code;
-        uni_DCtab_chrom_len[level + 256]  = uni_len;
-    }
-}
-
-static av_cold void init_uni_mpeg4_rl_tab(RLTable *rl, uint32_t *bits_tab,
-                                          uint8_t *len_tab)
-{
-    int slevel, run, last;
-
-    assert(MAX_LEVEL >= 64);
-    assert(MAX_RUN >= 63);
-
-    for (slevel = -64; slevel < 64; slevel++) {
-        if (slevel == 0)
-            continue;
-        for (run = 0; run < 64; run++) {
-            for (last = 0; last <= 1; last++) {
-                const int index = UNI_MPEG4_ENC_INDEX(last, run, slevel + 64);
-                int level       = slevel < 0 ? -slevel : slevel;
-                int sign        = slevel < 0 ? 1 : 0;
-                int bits, len, code;
-                int level1, run1;
-
-                len_tab[index] = 100;
-
-                /* ESC0 */
-                code = get_rl_index(rl, last, run, level);
-                bits = rl->table_vlc[code][0];
-                len  = rl->table_vlc[code][1];
-                bits = bits * 2 + sign;
-                len++;
-
-                if (code != rl->n && len < len_tab[index]) {
-                    bits_tab[index] = bits;
-                    len_tab[index]  = len;
-                }
-                /* ESC1 */
-                bits = rl->table_vlc[rl->n][0];
-                len  = rl->table_vlc[rl->n][1];
-                bits = bits * 2;
-                len++;                 // esc1
-                level1 = level - rl->max_level[last][run];
-                if (level1 > 0) {
-                    code   = get_rl_index(rl, last, run, level1);
-                    bits <<= rl->table_vlc[code][1];
-                    len   += rl->table_vlc[code][1];
-                    bits  += rl->table_vlc[code][0];
-                    bits   = bits * 2 + sign;
-                    len++;
-
-                    if (code != rl->n && len < len_tab[index]) {
-                        bits_tab[index] = bits;
-                        len_tab[index]  = len;
-                    }
-                }
-                /* ESC2 */
-                bits = rl->table_vlc[rl->n][0];
-                len  = rl->table_vlc[rl->n][1];
-                bits = bits * 4 + 2;
-                len += 2;                 // esc2
-                run1 = run - rl->max_run[last][level] - 1;
-                if (run1 >= 0) {
-                    code   = get_rl_index(rl, last, run1, level);
-                    bits <<= rl->table_vlc[code][1];
-                    len   += rl->table_vlc[code][1];
-                    bits  += rl->table_vlc[code][0];
-                    bits   = bits * 2 + sign;
-                    len++;
-
-                    if (code != rl->n && len < len_tab[index]) {
-                        bits_tab[index] = bits;
-                        len_tab[index]  = len;
-                    }
-                }
-                /* ESC3 */
-                bits = rl->table_vlc[rl->n][0];
-                len  = rl->table_vlc[rl->n][1];
-                bits = bits * 4 + 3;
-                len += 2;                 // esc3
-                bits = bits * 2 + last;
-                len++;
-                bits = bits * 64 + run;
-                len += 6;
-                bits = bits * 2 + 1;
-                len++;                    // marker
-                bits = bits * 4096 + (slevel & 0xfff);
-                len += 12;
-                bits = bits * 2 + 1;
-                len++;                    // marker
-
-                if (len < len_tab[index]) {
-                    bits_tab[index] = bits;
-                    len_tab[index]  = len;
-                }
-            }
-        }
-    }
-}
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    MpegEncContext *s = avctx->priv_data;
-    int ret;
-    static int done = 0;
-
-    if ((ret = ff_MPV_encode_init(avctx)) < 0)
-        return ret;
-
-    if (!done) {
-        done = 1;
-
-        init_uni_dc_tab();
-
-        ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
-
-        init_uni_mpeg4_rl_tab(&ff_mpeg4_rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len);
-        init_uni_mpeg4_rl_tab(&ff_h263_rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len);
-    }
-
-    s->min_qcoeff               = -2048;
-    s->max_qcoeff               = 2047;
-    s->intra_ac_vlc_length      = uni_mpeg4_intra_rl_len;
-    s->intra_ac_vlc_last_length = uni_mpeg4_intra_rl_len + 128 * 64;
-    s->inter_ac_vlc_length      = uni_mpeg4_inter_rl_len;
-    s->inter_ac_vlc_last_length = uni_mpeg4_inter_rl_len + 128 * 64;
-    s->luma_dc_vlc_length       = uni_DCtab_lum_len;
-    s->ac_esc_length            = 7 + 2 + 1 + 6 + 1 + 12 + 1;
-    s->y_dc_scale_table         = ff_mpeg4_y_dc_scale_table;
-    s->c_dc_scale_table         = ff_mpeg4_c_dc_scale_table;
-
-    if (s->flags & CODEC_FLAG_GLOBAL_HEADER) {
-        s->avctx->extradata = av_malloc(1024);
-        init_put_bits(&s->pb, s->avctx->extradata, 1024);
-
-        if (!(s->workaround_bugs & FF_BUG_MS))
-            mpeg4_encode_visual_object_header(s);
-        mpeg4_encode_vol_header(s, 0, 0);
-
-//            ff_mpeg4_stuffing(&s->pb); ?
-        flush_put_bits(&s->pb);
-        s->avctx->extradata_size = (put_bits_count(&s->pb) + 7) >> 3;
-    }
-    return 0;
-}
-
-void ff_mpeg4_init_partitions(MpegEncContext *s)
-{
-    uint8_t *start = put_bits_ptr(&s->pb);
-    uint8_t *end   = s->pb.buf_end;
-    int size       = end - start;
-    int pb_size    = (((intptr_t)start + size / 3) & (~3)) - (intptr_t)start;
-    int tex_size   = (size - 2 * pb_size) & (~3);
-
-    set_put_bits_buffer_size(&s->pb, pb_size);
-    init_put_bits(&s->tex_pb, start + pb_size, tex_size);
-    init_put_bits(&s->pb2, start + pb_size + tex_size, pb_size);
-}
-
-void ff_mpeg4_merge_partitions(MpegEncContext *s)
-{
-    const int pb2_len    = put_bits_count(&s->pb2);
-    const int tex_pb_len = put_bits_count(&s->tex_pb);
-    const int bits       = put_bits_count(&s->pb);
-
-    if (s->pict_type == AV_PICTURE_TYPE_I) {
-        put_bits(&s->pb, 19, DC_MARKER);
-        s->misc_bits  += 19 + pb2_len + bits - s->last_bits;
-        s->i_tex_bits += tex_pb_len;
-    } else {
-        put_bits(&s->pb, 17, MOTION_MARKER);
-        s->misc_bits  += 17 + pb2_len;
-        s->mv_bits    += bits - s->last_bits;
-        s->p_tex_bits += tex_pb_len;
-    }
-
-    flush_put_bits(&s->pb2);
-    flush_put_bits(&s->tex_pb);
-
-    set_put_bits_buffer_size(&s->pb, s->pb2.buf_end - s->pb.buf);
-    avpriv_copy_bits(&s->pb, s->pb2.buf, pb2_len);
-    avpriv_copy_bits(&s->pb, s->tex_pb.buf, tex_pb_len);
-    s->last_bits = put_bits_count(&s->pb);
-}
-
-void ff_mpeg4_encode_video_packet_header(MpegEncContext *s)
-{
-    int mb_num_bits = av_log2(s->mb_num - 1) + 1;
-
-    put_bits(&s->pb, ff_mpeg4_get_video_packet_prefix_length(s), 0);
-    put_bits(&s->pb, 1, 1);
-
-    put_bits(&s->pb, mb_num_bits, s->mb_x + s->mb_y * s->mb_width);
-    put_bits(&s->pb, s->quant_precision, s->qscale);
-    put_bits(&s->pb, 1, 0); /* no HEC */
-}
-
-#define OFFSET(x) offsetof(MpegEncContext, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "data_partitioning", "Use data partitioning.",      OFFSET(data_partitioning), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
-    { "alternate_scan",    "Enable alternate scantable.", OFFSET(alternate_scan),    AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
-    FF_MPV_COMMON_OPTS
-    { NULL },
-};
-
-static const AVClass mpeg4enc_class = {
-    .class_name = "MPEG4 encoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_mpeg4_encoder = {
-    .name           = "mpeg4",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG4,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
-    .priv_class     = &mpeg4enc_class,
-};
diff --git a/deps/libav/libavcodec/mpegaudio.c b/deps/libav/libavcodec/mpegaudio.c
deleted file mode 100644
index 1a83635..0000000
--- a/deps/libav/libavcodec/mpegaudio.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * MPEG Audio common code
- * Copyright (c) 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG Audio common code.
- */
-
-#include "mpegaudio.h"
-
-
-/* bitrate is in kb/s */
-int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf)
-{
-    int ch_bitrate, table;
-
-    ch_bitrate = bitrate / nb_channels;
-    if (!lsf) {
-        if ((freq == 48000 && ch_bitrate >= 56) ||
-            (ch_bitrate >= 56 && ch_bitrate <= 80))
-            table = 0;
-        else if (freq != 48000 && ch_bitrate >= 96)
-            table = 1;
-        else if (freq != 32000 && ch_bitrate <= 48)
-            table = 2;
-        else
-            table = 3;
-    } else {
-        table = 4;
-    }
-    return table;
-}
diff --git a/deps/libav/libavcodec/mpegaudio.h b/deps/libav/libavcodec/mpegaudio.h
deleted file mode 100644
index b556801..0000000
--- a/deps/libav/libavcodec/mpegaudio.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * mpeg audio declarations for both encoder and decoder.
- */
-
-#ifndef AVCODEC_MPEGAUDIO_H
-#define AVCODEC_MPEGAUDIO_H
-
-#ifndef CONFIG_FLOAT
-#   define CONFIG_FLOAT 0
-#endif
-
-#include <stdint.h>
-
-/* max frame size, in samples */
-#define MPA_FRAME_SIZE 1152
-
-/* max compressed frame size */
-#define MPA_MAX_CODED_FRAME_SIZE 1792
-
-#define MPA_MAX_CHANNELS 2
-
-#define SBLIMIT 32 /* number of subbands */
-
-#define MPA_STEREO  0
-#define MPA_JSTEREO 1
-#define MPA_DUAL    2
-#define MPA_MONO    3
-
-#ifndef FRAC_BITS
-#define FRAC_BITS   23   /* fractional bits for sb_samples and dct */
-#define WFRAC_BITS  16   /* fractional bits for window */
-#endif
-
-#define FRAC_ONE    (1 << FRAC_BITS)
-
-#define FIX(a)   ((int)((a) * FRAC_ONE))
-
-#if CONFIG_FLOAT
-#   define INTFLOAT float
-typedef float MPA_INT;
-typedef float OUT_INT;
-#elif FRAC_BITS <= 15
-#   define INTFLOAT int
-typedef int16_t MPA_INT;
-typedef int16_t OUT_INT;
-#else
-#   define INTFLOAT int
-typedef int32_t MPA_INT;
-typedef int16_t OUT_INT;
-#endif
-
-int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
-
-#endif /* AVCODEC_MPEGAUDIO_H */
diff --git a/deps/libav/libavcodec/mpegaudio_parser.c b/deps/libav/libavcodec/mpegaudio_parser.c
deleted file mode 100644
index 58ea452..0000000
--- a/deps/libav/libavcodec/mpegaudio_parser.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * MPEG Audio parser
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "parser.h"
-#include "mpegaudiodecheader.h"
-#include "libavutil/common.h"
-
-
-typedef struct MpegAudioParseContext {
-    ParseContext pc;
-    int frame_size;
-    uint32_t header;
-    int header_count;
-    int no_bitrate;
-} MpegAudioParseContext;
-
-#define MPA_HEADER_SIZE 4
-
-/* header + layer + bitrate + freq + lsf/mpeg25 */
-#define SAME_HEADER_MASK \
-   (0xffe00000 | (3 << 17) | (3 << 10) | (3 << 19))
-
-static int mpegaudio_parse(AVCodecParserContext *s1,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
-{
-    MpegAudioParseContext *s = s1->priv_data;
-    ParseContext *pc = &s->pc;
-    uint32_t state= pc->state;
-    int i;
-    int next= END_NOT_FOUND;
-
-    for(i=0; i<buf_size; ){
-        if(s->frame_size){
-            int inc= FFMIN(buf_size - i, s->frame_size);
-            i += inc;
-            s->frame_size -= inc;
-
-            if(!s->frame_size){
-                next= i;
-                break;
-            }
-        }else{
-            while(i<buf_size){
-                int ret, sr, channels, bit_rate, frame_size;
-
-                state= (state<<8) + buf[i++];
-
-                ret = avpriv_mpa_decode_header(avctx, state, &sr, &channels, &frame_size, &bit_rate);
-                if (ret < 4) {
-                    if (i > 4)
-                        s->header_count = -2;
-                } else {
-                    if((state&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header)
-                        s->header_count= -3;
-                    s->header= state;
-                    s->header_count++;
-                    s->frame_size = ret-4;
-
-                    if (s->header_count > 0) {
-                        avctx->sample_rate= sr;
-                        avctx->channels   = channels;
-                        s1->duration      = frame_size;
-                        if (s->no_bitrate || !avctx->bit_rate) {
-                            s->no_bitrate = 1;
-                            avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count;
-                        }
-                    }
-                    break;
-                }
-            }
-        }
-    }
-
-    pc->state= state;
-    if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-        *poutbuf = NULL;
-        *poutbuf_size = 0;
-        return buf_size;
-    }
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-
-AVCodecParser ff_mpegaudio_parser = {
-    .codec_ids      = { AV_CODEC_ID_MP1, AV_CODEC_ID_MP2, AV_CODEC_ID_MP3 },
-    .priv_data_size = sizeof(MpegAudioParseContext),
-    .parser_parse   = mpegaudio_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/mpegaudio_tablegen.c b/deps/libav/libavcodec/mpegaudio_tablegen.c
deleted file mode 100644
index b4c240b..0000000
--- a/deps/libav/libavcodec/mpegaudio_tablegen.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Generate a header file for hardcoded mpegaudiodec tables
- *
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#include "mpegaudio_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
-    mpegaudio_tableinit();
-
-    write_fileheader();
-
-    WRITE_ARRAY("static const", int8_t, table_4_3_exp);
-    WRITE_ARRAY("static const", uint32_t, table_4_3_value);
-    WRITE_ARRAY("static const", uint32_t, exp_table_fixed);
-    WRITE_ARRAY("static const", float, exp_table_float);
-    WRITE_2D_ARRAY("static const", uint32_t, expval_table_fixed);
-    WRITE_2D_ARRAY("static const", float, expval_table_float);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/mpegaudio_tablegen.h b/deps/libav/libavcodec/mpegaudio_tablegen.h
deleted file mode 100644
index 8a3e51a..0000000
--- a/deps/libav/libavcodec/mpegaudio_tablegen.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Header file for hardcoded mpegaudiodec tables
- *
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPEGAUDIO_TABLEGEN_H
-#define AVCODEC_MPEGAUDIO_TABLEGEN_H
-
-#include <stdint.h>
-#include <math.h>
-
-#define TABLE_4_3_SIZE (8191 + 16)*4
-#if CONFIG_HARDCODED_TABLES
-#define mpegaudio_tableinit()
-#include "libavcodec/mpegaudio_tables.h"
-#else
-static int8_t   table_4_3_exp[TABLE_4_3_SIZE];
-static uint32_t table_4_3_value[TABLE_4_3_SIZE];
-static uint32_t exp_table_fixed[512];
-static uint32_t expval_table_fixed[512][16];
-static float exp_table_float[512];
-static float expval_table_float[512][16];
-
-#define FRAC_BITS 23
-
-static void mpegaudio_tableinit(void)
-{
-    int i, value, exponent;
-    for (i = 1; i < TABLE_4_3_SIZE; i++) {
-        double value = i / 4;
-        double f, fm;
-        int e, m;
-        /* cbrtf() isn't available on all systems, so we use powf(). */
-        f  = value * powf(value, 1.0 / 3.0) * pow(2, (i & 3) * 0.25);
-        fm = frexp(f, &e);
-        m  = (uint32_t)(fm * (1LL << 31) + 0.5);
-        e += FRAC_BITS - 31 + 5 - 100;
-
-        /* normalized to FRAC_BITS */
-        table_4_3_value[i] =  m;
-        table_4_3_exp[i]   = -e;
-    }
-    for (exponent = 0; exponent < 512; exponent++) {
-        for (value = 0; value < 16; value++) {
-            /* cbrtf() isn't available on all systems, so we use powf(). */
-            double f = (double)value * powf(value, 1.0 / 3.0) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5);
-            /* llrint() isn't always available, so round and cast manually. */
-            expval_table_fixed[exponent][value] = (long long int) (f >= 0 ? floor(f + 0.5) : ceil(f - 0.5));
-            expval_table_float[exponent][value] = f;
-        }
-        exp_table_fixed[exponent] = expval_table_fixed[exponent][1];
-        exp_table_float[exponent] = expval_table_float[exponent][1];
-    }
-}
-#endif /* CONFIG_HARDCODED_TABLES */
-
-#endif /* AVCODEC_MPEGAUDIO_TABLEGEN_H */
diff --git a/deps/libav/libavcodec/mpegaudiodata.c b/deps/libav/libavcodec/mpegaudiodata.c
deleted file mode 100644
index 009a02a..0000000
--- a/deps/libav/libavcodec/mpegaudiodata.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * MPEG Audio common tables
- * copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * mpeg audio layer common tables.
- */
-
-#include "mpegaudiodata.h"
-
-
-const uint16_t avpriv_mpa_bitrate_tab[2][3][15] = {
-    { {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 },
-      {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 },
-      {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 } },
-    { {0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256},
-      {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160},
-      {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160}
-    }
-};
-
-const uint16_t avpriv_mpa_freq_tab[3] = { 44100, 48000, 32000 };
-
-/*******************************************************/
-/* layer 2 tables */
-
-const int ff_mpa_sblimit_table[5] = { 27 , 30 , 8, 12 , 30 };
-
-const int ff_mpa_quant_steps[17] = {
-    3,     5,    7,    9,    15,
-    31,    63,  127,  255,   511,
-    1023,  2047, 4095, 8191, 16383,
-    32767, 65535
-};
-
-/* we use a negative value if grouped */
-const int ff_mpa_quant_bits[17] = {
-    -5,  -7,  3, -10, 4,
-     5,  6,  7,  8,  9,
-    10, 11, 12, 13, 14,
-    15, 16
-};
-
-/* encoding tables which give the quantization index. Note how it is
-   possible to store them efficiently ! */
-static const unsigned char alloc_table_1[] = {
- 4,  0,  2,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
- 4,  0,  2,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
- 4,  0,  2,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 16,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 16,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 16,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 16,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 16,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 16,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 16,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 3,  0,  1,  2,  3,  4,  5, 16,
- 2,  0,  1, 16,
- 2,  0,  1, 16,
- 2,  0,  1, 16,
- 2,  0,  1, 16,
- 2,  0,  1, 16,
- 2,  0,  1, 16,
- 2,  0,  1, 16,
-};
-
-static const unsigned char alloc_table_3[] = {
- 4,  0,  1,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
- 4,  0,  1,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
-};
-
-static const unsigned char alloc_table_4[] = {
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
- 4,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 3,  0,  1,  3,  4,  5,  6,  7,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
- 2,  0,  1,  3,
-};
-
-const unsigned char * const ff_mpa_alloc_tables[5] =
-{ alloc_table_1, alloc_table_1, alloc_table_3, alloc_table_3, alloc_table_4, };
diff --git a/deps/libav/libavcodec/mpegaudiodata.h b/deps/libav/libavcodec/mpegaudiodata.h
deleted file mode 100644
index 2b8ff65..0000000
--- a/deps/libav/libavcodec/mpegaudiodata.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * MPEG Audio common tables
- * copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * mpeg audio layer common tables.
- */
-
-#ifndef AVCODEC_MPEGAUDIODATA_H
-#define AVCODEC_MPEGAUDIODATA_H
-
-#include <stdint.h>
-
-#include "libavutil/internal.h"
-
-#define MODE_EXT_MS_STEREO 2
-#define MODE_EXT_I_STEREO  1
-
-extern av_export const uint16_t avpriv_mpa_bitrate_tab[2][3][15];
-extern av_export const uint16_t avpriv_mpa_freq_tab[3];
-extern const int ff_mpa_sblimit_table[5];
-extern const int ff_mpa_quant_steps[17];
-extern const int ff_mpa_quant_bits[17];
-extern const unsigned char * const ff_mpa_alloc_tables[5];
-
-#endif /* AVCODEC_MPEGAUDIODATA_H */
diff --git a/deps/libav/libavcodec/mpegaudiodec_fixed.c b/deps/libav/libavcodec/mpegaudiodec_fixed.c
deleted file mode 100644
index 6f21b0c..0000000
--- a/deps/libav/libavcodec/mpegaudiodec_fixed.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Fixed-point MPEG audio decoder
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/samplefmt.h"
-
-#define CONFIG_FLOAT 0
-
-#include "mpegaudio.h"
-
-#define SHR(a,b)       ((a)>>(b))
-/* WARNING: only correct for positive numbers */
-#define FIXR_OLD(a)    ((int)((a) * FRAC_ONE + 0.5))
-#define FIXR(a)        ((int)((a) * FRAC_ONE + 0.5))
-#define FIXHR(a)       ((int)((a) * (1LL<<32) + 0.5))
-#define MULH3(x, y, s) MULH((s)*(x), y)
-#define MULLx(x, y, s) MULL(x,y,s)
-#define RENAME(a)      a ## _fixed
-#define OUT_FMT   AV_SAMPLE_FMT_S16
-#define OUT_FMT_P AV_SAMPLE_FMT_S16P
-
-#include "mpegaudiodec_template.c"
-
-#if CONFIG_MP1_DECODER
-AVCodec ff_mp1_decoder = {
-    .name           = "mp1",
-    .long_name      = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP1,
-    .priv_data_size = sizeof(MPADecodeContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_S16,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
-#if CONFIG_MP2_DECODER
-AVCodec ff_mp2_decoder = {
-    .name           = "mp2",
-    .long_name      = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP2,
-    .priv_data_size = sizeof(MPADecodeContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_S16,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
-#if CONFIG_MP3_DECODER
-AVCodec ff_mp3_decoder = {
-    .name           = "mp3",
-    .long_name      = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP3,
-    .priv_data_size = sizeof(MPADecodeContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_S16,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
-#if CONFIG_MP3ADU_DECODER
-AVCodec ff_mp3adu_decoder = {
-    .name           = "mp3adu",
-    .long_name      = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP3ADU,
-    .priv_data_size = sizeof(MPADecodeContext),
-    .init           = decode_init,
-    .decode         = decode_frame_adu,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_S16,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
-#if CONFIG_MP3ON4_DECODER
-AVCodec ff_mp3on4_decoder = {
-    .name           = "mp3on4",
-    .long_name      = NULL_IF_CONFIG_SMALL("MP3onMP4"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP3ON4,
-    .priv_data_size = sizeof(MP3On4DecodeContext),
-    .init           = decode_init_mp3on4,
-    .close          = decode_close_mp3on4,
-    .decode         = decode_frame_mp3on4,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush_mp3on4,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
diff --git a/deps/libav/libavcodec/mpegaudiodec_float.c b/deps/libav/libavcodec/mpegaudiodec_float.c
deleted file mode 100644
index 3a76055..0000000
--- a/deps/libav/libavcodec/mpegaudiodec_float.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Float MPEG Audio decoder
- * Copyright (c) 2010 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/samplefmt.h"
-
-#define CONFIG_FLOAT 1
-
-#include "mpegaudio.h"
-
-#define SHR(a,b)       ((a)*(1.0f/(1<<(b))))
-#define FIXR_OLD(a)    ((int)((a) * FRAC_ONE + 0.5))
-#define FIXR(x)        ((float)(x))
-#define FIXHR(x)       ((float)(x))
-#define MULH3(x, y, s) ((s)*(y)*(x))
-#define MULLx(x, y, s) ((y)*(x))
-#define RENAME(a) a ## _float
-#define OUT_FMT   AV_SAMPLE_FMT_FLT
-#define OUT_FMT_P AV_SAMPLE_FMT_FLTP
-
-#include "mpegaudiodec_template.c"
-
-#if CONFIG_MP1FLOAT_DECODER
-AVCodec ff_mp1float_decoder = {
-    .name           = "mp1float",
-    .long_name      = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP1,
-    .priv_data_size = sizeof(MPADecodeContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_FLT,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
-#if CONFIG_MP2FLOAT_DECODER
-AVCodec ff_mp2float_decoder = {
-    .name           = "mp2float",
-    .long_name      = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP2,
-    .priv_data_size = sizeof(MPADecodeContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_FLT,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
-#if CONFIG_MP3FLOAT_DECODER
-AVCodec ff_mp3float_decoder = {
-    .name           = "mp3float",
-    .long_name      = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP3,
-    .priv_data_size = sizeof(MPADecodeContext),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_FLT,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
-#if CONFIG_MP3ADUFLOAT_DECODER
-AVCodec ff_mp3adufloat_decoder = {
-    .name           = "mp3adufloat",
-    .long_name      = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP3ADU,
-    .priv_data_size = sizeof(MPADecodeContext),
-    .init           = decode_init,
-    .decode         = decode_frame_adu,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_FLT,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
-#if CONFIG_MP3ON4FLOAT_DECODER
-AVCodec ff_mp3on4float_decoder = {
-    .name           = "mp3on4float",
-    .long_name      = NULL_IF_CONFIG_SMALL("MP3onMP4"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_MP3ON4,
-    .priv_data_size = sizeof(MP3On4DecodeContext),
-    .init           = decode_init_mp3on4,
-    .close          = decode_close_mp3on4,
-    .decode         = decode_frame_mp3on4,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = flush_mp3on4,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-#endif
diff --git a/deps/libav/libavcodec/mpegaudiodec_template.c b/deps/libav/libavcodec/mpegaudiodec_template.c
deleted file mode 100644
index 9ce03ef..0000000
--- a/deps/libav/libavcodec/mpegaudiodec_template.c
+++ /dev/null
@@ -1,1948 +0,0 @@
-/*
- * MPEG Audio decoder
- * Copyright (c) 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG Audio decoder
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "mathops.h"
-#include "mpegaudiodsp.h"
-
-/*
- * TODO:
- *  - test lsf / mpeg25 extensively.
- */
-
-#include "mpegaudio.h"
-#include "mpegaudiodecheader.h"
-
-#define BACKSTEP_SIZE 512
-#define EXTRABYTES 24
-#define LAST_BUF_SIZE 2 * BACKSTEP_SIZE + EXTRABYTES
-
-/* layer 3 "granule" */
-typedef struct GranuleDef {
-    uint8_t scfsi;
-    int part2_3_length;
-    int big_values;
-    int global_gain;
-    int scalefac_compress;
-    uint8_t block_type;
-    uint8_t switch_point;
-    int table_select[3];
-    int subblock_gain[3];
-    uint8_t scalefac_scale;
-    uint8_t count1table_select;
-    int region_size[3]; /* number of huffman codes in each region */
-    int preflag;
-    int short_start, long_end; /* long/short band indexes */
-    uint8_t scale_factors[40];
-    DECLARE_ALIGNED(16, INTFLOAT, sb_hybrid)[SBLIMIT * 18]; /* 576 samples */
-} GranuleDef;
-
-typedef struct MPADecodeContext {
-    MPA_DECODE_HEADER
-    uint8_t last_buf[LAST_BUF_SIZE];
-    int last_buf_size;
-    /* next header (used in free format parsing) */
-    uint32_t free_format_next_header;
-    GetBitContext gb;
-    GetBitContext in_gb;
-    DECLARE_ALIGNED(32, MPA_INT, synth_buf)[MPA_MAX_CHANNELS][512 * 2];
-    int synth_buf_offset[MPA_MAX_CHANNELS];
-    DECLARE_ALIGNED(32, INTFLOAT, sb_samples)[MPA_MAX_CHANNELS][36][SBLIMIT];
-    INTFLOAT mdct_buf[MPA_MAX_CHANNELS][SBLIMIT * 18]; /* previous samples, for layer 3 MDCT */
-    GranuleDef granules[2][2]; /* Used in Layer 3 */
-    int adu_mode; ///< 0 for standard mp3, 1 for adu formatted mp3
-    int dither_state;
-    int err_recognition;
-    AVCodecContext* avctx;
-    MPADSPContext mpadsp;
-    AVFloatDSPContext fdsp;
-    AVFrame *frame;
-} MPADecodeContext;
-
-#define HEADER_SIZE 4
-
-#include "mpegaudiodata.h"
-#include "mpegaudiodectab.h"
-
-/* vlc structure for decoding layer 3 huffman tables */
-static VLC huff_vlc[16];
-static VLC_TYPE huff_vlc_tables[
-    0 + 128 + 128 + 128 + 130 + 128 + 154 + 166 +
-  142 + 204 + 190 + 170 + 542 + 460 + 662 + 414
-  ][2];
-static const int huff_vlc_tables_sizes[16] = {
-    0,  128,  128,  128,  130,  128,  154,  166,
-  142,  204,  190,  170,  542,  460,  662,  414
-};
-static VLC huff_quad_vlc[2];
-static VLC_TYPE  huff_quad_vlc_tables[128+16][2];
-static const int huff_quad_vlc_tables_sizes[2] = { 128, 16 };
-/* computed from band_size_long */
-static uint16_t band_index_long[9][23];
-#include "mpegaudio_tablegen.h"
-/* intensity stereo coef table */
-static INTFLOAT is_table[2][16];
-static INTFLOAT is_table_lsf[2][2][16];
-static INTFLOAT csa_table[8][4];
-
-static int16_t division_tab3[1<<6 ];
-static int16_t division_tab5[1<<8 ];
-static int16_t division_tab9[1<<11];
-
-static int16_t * const division_tabs[4] = {
-    division_tab3, division_tab5, NULL, division_tab9
-};
-
-/* lower 2 bits: modulo 3, higher bits: shift */
-static uint16_t scale_factor_modshift[64];
-/* [i][j]:  2^(-j/3) * FRAC_ONE * 2^(i+2) / (2^(i+2) - 1) */
-static int32_t scale_factor_mult[15][3];
-/* mult table for layer 2 group quantization */
-
-#define SCALE_GEN(v) \
-{ FIXR_OLD(1.0 * (v)), FIXR_OLD(0.7937005259 * (v)), FIXR_OLD(0.6299605249 * (v)) }
-
-static const int32_t scale_factor_mult2[3][3] = {
-    SCALE_GEN(4.0 / 3.0), /* 3 steps */
-    SCALE_GEN(4.0 / 5.0), /* 5 steps */
-    SCALE_GEN(4.0 / 9.0), /* 9 steps */
-};
-
-/**
- * Convert region offsets to region sizes and truncate
- * size to big_values.
- */
-static void region_offset2size(GranuleDef *g)
-{
-    int i, k, j = 0;
-    g->region_size[2] = 576 / 2;
-    for (i = 0; i < 3; i++) {
-        k = FFMIN(g->region_size[i], g->big_values);
-        g->region_size[i] = k - j;
-        j = k;
-    }
-}
-
-static void init_short_region(MPADecodeContext *s, GranuleDef *g)
-{
-    if (g->block_type == 2) {
-        if (s->sample_rate_index != 8)
-            g->region_size[0] = (36 / 2);
-        else
-            g->region_size[0] = (72 / 2);
-    } else {
-        if (s->sample_rate_index <= 2)
-            g->region_size[0] = (36 / 2);
-        else if (s->sample_rate_index != 8)
-            g->region_size[0] = (54 / 2);
-        else
-            g->region_size[0] = (108 / 2);
-    }
-    g->region_size[1] = (576 / 2);
-}
-
-static void init_long_region(MPADecodeContext *s, GranuleDef *g,
-                             int ra1, int ra2)
-{
-    int l;
-    g->region_size[0] = band_index_long[s->sample_rate_index][ra1 + 1] >> 1;
-    /* should not overflow */
-    l = FFMIN(ra1 + ra2 + 2, 22);
-    g->region_size[1] = band_index_long[s->sample_rate_index][      l] >> 1;
-}
-
-static void compute_band_indexes(MPADecodeContext *s, GranuleDef *g)
-{
-    if (g->block_type == 2) {
-        if (g->switch_point) {
-            /* if switched mode, we handle the 36 first samples as
-                long blocks.  For 8000Hz, we handle the 72 first
-                exponents as long blocks */
-            if (s->sample_rate_index <= 2)
-                g->long_end = 8;
-            else
-                g->long_end = 6;
-
-            g->short_start = 3;
-        } else {
-            g->long_end    = 0;
-            g->short_start = 0;
-        }
-    } else {
-        g->short_start = 13;
-        g->long_end    = 22;
-    }
-}
-
-/* layer 1 unscaling */
-/* n = number of bits of the mantissa minus 1 */
-static inline int l1_unscale(int n, int mant, int scale_factor)
-{
-    int shift, mod;
-    int64_t val;
-
-    shift   = scale_factor_modshift[scale_factor];
-    mod     = shift & 3;
-    shift >>= 2;
-    val     = MUL64(mant + (-1 << n) + 1, scale_factor_mult[n-1][mod]);
-    shift  += n;
-    /* NOTE: at this point, 1 <= shift >= 21 + 15 */
-    return (int)((val + (1LL << (shift - 1))) >> shift);
-}
-
-static inline int l2_unscale_group(int steps, int mant, int scale_factor)
-{
-    int shift, mod, val;
-
-    shift   = scale_factor_modshift[scale_factor];
-    mod     = shift & 3;
-    shift >>= 2;
-
-    val = (mant - (steps >> 1)) * scale_factor_mult2[steps >> 2][mod];
-    /* NOTE: at this point, 0 <= shift <= 21 */
-    if (shift > 0)
-        val = (val + (1 << (shift - 1))) >> shift;
-    return val;
-}
-
-/* compute value^(4/3) * 2^(exponent/4). It normalized to FRAC_BITS */
-static inline int l3_unscale(int value, int exponent)
-{
-    unsigned int m;
-    int e;
-
-    e  = table_4_3_exp  [4 * value + (exponent & 3)];
-    m  = table_4_3_value[4 * value + (exponent & 3)];
-    e -= exponent >> 2;
-    assert(e >= 1);
-    if (e > 31)
-        return 0;
-    m = (m + (1 << (e - 1))) >> e;
-
-    return m;
-}
-
-static av_cold void decode_init_static(void)
-{
-    int i, j, k;
-    int offset;
-
-    /* scale factors table for layer 1/2 */
-    for (i = 0; i < 64; i++) {
-        int shift, mod;
-        /* 1.0 (i = 3) is normalized to 2 ^ FRAC_BITS */
-        shift = i / 3;
-        mod   = i % 3;
-        scale_factor_modshift[i] = mod | (shift << 2);
-    }
-
-    /* scale factor multiply for layer 1 */
-    for (i = 0; i < 15; i++) {
-        int n, norm;
-        n = i + 2;
-        norm = ((INT64_C(1) << n) * FRAC_ONE) / ((1 << n) - 1);
-        scale_factor_mult[i][0] = MULLx(norm, FIXR(1.0          * 2.0), FRAC_BITS);
-        scale_factor_mult[i][1] = MULLx(norm, FIXR(0.7937005259 * 2.0), FRAC_BITS);
-        scale_factor_mult[i][2] = MULLx(norm, FIXR(0.6299605249 * 2.0), FRAC_BITS);
-        av_dlog(NULL, "%d: norm=%x s=%x %x %x\n", i, norm,
-                scale_factor_mult[i][0],
-                scale_factor_mult[i][1],
-                scale_factor_mult[i][2]);
-    }
-
-    RENAME(ff_mpa_synth_init)(RENAME(ff_mpa_synth_window));
-
-    /* huffman decode tables */
-    offset = 0;
-    for (i = 1; i < 16; i++) {
-        const HuffTable *h = &mpa_huff_tables[i];
-        int xsize, x, y;
-        uint8_t  tmp_bits [512] = { 0 };
-        uint16_t tmp_codes[512] = { 0 };
-
-        xsize = h->xsize;
-
-        j = 0;
-        for (x = 0; x < xsize; x++) {
-            for (y = 0; y < xsize; y++) {
-                tmp_bits [(x << 5) | y | ((x&&y)<<4)]= h->bits [j  ];
-                tmp_codes[(x << 5) | y | ((x&&y)<<4)]= h->codes[j++];
-            }
-        }
-
-        /* XXX: fail test */
-        huff_vlc[i].table = huff_vlc_tables+offset;
-        huff_vlc[i].table_allocated = huff_vlc_tables_sizes[i];
-        init_vlc(&huff_vlc[i], 7, 512,
-                 tmp_bits, 1, 1, tmp_codes, 2, 2,
-                 INIT_VLC_USE_NEW_STATIC);
-        offset += huff_vlc_tables_sizes[i];
-    }
-    assert(offset == FF_ARRAY_ELEMS(huff_vlc_tables));
-
-    offset = 0;
-    for (i = 0; i < 2; i++) {
-        huff_quad_vlc[i].table = huff_quad_vlc_tables+offset;
-        huff_quad_vlc[i].table_allocated = huff_quad_vlc_tables_sizes[i];
-        init_vlc(&huff_quad_vlc[i], i == 0 ? 7 : 4, 16,
-                 mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1,
-                 INIT_VLC_USE_NEW_STATIC);
-        offset += huff_quad_vlc_tables_sizes[i];
-    }
-    assert(offset == FF_ARRAY_ELEMS(huff_quad_vlc_tables));
-
-    for (i = 0; i < 9; i++) {
-        k = 0;
-        for (j = 0; j < 22; j++) {
-            band_index_long[i][j] = k;
-            k += band_size_long[i][j];
-        }
-        band_index_long[i][22] = k;
-    }
-
-    /* compute n ^ (4/3) and store it in mantissa/exp format */
-
-    mpegaudio_tableinit();
-
-    for (i = 0; i < 4; i++) {
-        if (ff_mpa_quant_bits[i] < 0) {
-            for (j = 0; j < (1 << (-ff_mpa_quant_bits[i]+1)); j++) {
-                int val1, val2, val3, steps;
-                int val = j;
-                steps   = ff_mpa_quant_steps[i];
-                val1    = val % steps;
-                val    /= steps;
-                val2    = val % steps;
-                val3    = val / steps;
-                division_tabs[i][j] = val1 + (val2 << 4) + (val3 << 8);
-            }
-        }
-    }
-
-
-    for (i = 0; i < 7; i++) {
-        float f;
-        INTFLOAT v;
-        if (i != 6) {
-            f = tan((double)i * M_PI / 12.0);
-            v = FIXR(f / (1.0 + f));
-        } else {
-            v = FIXR(1.0);
-        }
-        is_table[0][    i] = v;
-        is_table[1][6 - i] = v;
-    }
-    /* invalid values */
-    for (i = 7; i < 16; i++)
-        is_table[0][i] = is_table[1][i] = 0.0;
-
-    for (i = 0; i < 16; i++) {
-        double f;
-        int e, k;
-
-        for (j = 0; j < 2; j++) {
-            e = -(j + 1) * ((i + 1) >> 1);
-            f = pow(2.0, e / 4.0);
-            k = i & 1;
-            is_table_lsf[j][k ^ 1][i] = FIXR(f);
-            is_table_lsf[j][k    ][i] = FIXR(1.0);
-            av_dlog(NULL, "is_table_lsf %d %d: %f %f\n",
-                    i, j, (float) is_table_lsf[j][0][i],
-                    (float) is_table_lsf[j][1][i]);
-        }
-    }
-
-    for (i = 0; i < 8; i++) {
-        float ci, cs, ca;
-        ci = ci_table[i];
-        cs = 1.0 / sqrt(1.0 + ci * ci);
-        ca = cs * ci;
-#if !CONFIG_FLOAT
-        csa_table[i][0] = FIXHR(cs/4);
-        csa_table[i][1] = FIXHR(ca/4);
-        csa_table[i][2] = FIXHR(ca/4) + FIXHR(cs/4);
-        csa_table[i][3] = FIXHR(ca/4) - FIXHR(cs/4);
-#else
-        csa_table[i][0] = cs;
-        csa_table[i][1] = ca;
-        csa_table[i][2] = ca + cs;
-        csa_table[i][3] = ca - cs;
-#endif
-    }
-}
-
-static av_cold int decode_init(AVCodecContext * avctx)
-{
-    static int initialized_tables = 0;
-    MPADecodeContext *s = avctx->priv_data;
-
-    if (!initialized_tables) {
-        decode_init_static();
-        initialized_tables = 1;
-    }
-
-    s->avctx = avctx;
-
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-    ff_mpadsp_init(&s->mpadsp);
-
-    if (avctx->request_sample_fmt == OUT_FMT &&
-        avctx->codec_id != AV_CODEC_ID_MP3ON4)
-        avctx->sample_fmt = OUT_FMT;
-    else
-        avctx->sample_fmt = OUT_FMT_P;
-    s->err_recognition = avctx->err_recognition;
-
-    if (avctx->codec_id == AV_CODEC_ID_MP3ADU)
-        s->adu_mode = 1;
-
-    return 0;
-}
-
-#define C3 FIXHR(0.86602540378443864676/2)
-#define C4 FIXHR(0.70710678118654752439/2) //0.5 / cos(pi*(9)/36)
-#define C5 FIXHR(0.51763809020504152469/2) //0.5 / cos(pi*(5)/36)
-#define C6 FIXHR(1.93185165257813657349/4) //0.5 / cos(pi*(15)/36)
-
-/* 12 points IMDCT. We compute it "by hand" by factorizing obvious
-   cases. */
-static void imdct12(INTFLOAT *out, INTFLOAT *in)
-{
-    INTFLOAT in0, in1, in2, in3, in4, in5, t1, t2;
-
-    in0  = in[0*3];
-    in1  = in[1*3] + in[0*3];
-    in2  = in[2*3] + in[1*3];
-    in3  = in[3*3] + in[2*3];
-    in4  = in[4*3] + in[3*3];
-    in5  = in[5*3] + in[4*3];
-    in5 += in3;
-    in3 += in1;
-
-    in2  = MULH3(in2, C3, 2);
-    in3  = MULH3(in3, C3, 4);
-
-    t1   = in0 - in4;
-    t2   = MULH3(in1 - in5, C4, 2);
-
-    out[ 7] =
-    out[10] = t1 + t2;
-    out[ 1] =
-    out[ 4] = t1 - t2;
-
-    in0    += SHR(in4, 1);
-    in4     = in0 + in2;
-    in5    += 2*in1;
-    in1     = MULH3(in5 + in3, C5, 1);
-    out[ 8] =
-    out[ 9] = in4 + in1;
-    out[ 2] =
-    out[ 3] = in4 - in1;
-
-    in0    -= in2;
-    in5     = MULH3(in5 - in3, C6, 2);
-    out[ 0] =
-    out[ 5] = in0 - in5;
-    out[ 6] =
-    out[11] = in0 + in5;
-}
-
-/* return the number of decoded frames */
-static int mp_decode_layer1(MPADecodeContext *s)
-{
-    int bound, i, v, n, ch, j, mant;
-    uint8_t allocation[MPA_MAX_CHANNELS][SBLIMIT];
-    uint8_t scale_factors[MPA_MAX_CHANNELS][SBLIMIT];
-
-    if (s->mode == MPA_JSTEREO)
-        bound = (s->mode_ext + 1) * 4;
-    else
-        bound = SBLIMIT;
-
-    /* allocation bits */
-    for (i = 0; i < bound; i++) {
-        for (ch = 0; ch < s->nb_channels; ch++) {
-            allocation[ch][i] = get_bits(&s->gb, 4);
-        }
-    }
-    for (i = bound; i < SBLIMIT; i++)
-        allocation[0][i] = get_bits(&s->gb, 4);
-
-    /* scale factors */
-    for (i = 0; i < bound; i++) {
-        for (ch = 0; ch < s->nb_channels; ch++) {
-            if (allocation[ch][i])
-                scale_factors[ch][i] = get_bits(&s->gb, 6);
-        }
-    }
-    for (i = bound; i < SBLIMIT; i++) {
-        if (allocation[0][i]) {
-            scale_factors[0][i] = get_bits(&s->gb, 6);
-            scale_factors[1][i] = get_bits(&s->gb, 6);
-        }
-    }
-
-    /* compute samples */
-    for (j = 0; j < 12; j++) {
-        for (i = 0; i < bound; i++) {
-            for (ch = 0; ch < s->nb_channels; ch++) {
-                n = allocation[ch][i];
-                if (n) {
-                    mant = get_bits(&s->gb, n + 1);
-                    v = l1_unscale(n, mant, scale_factors[ch][i]);
-                } else {
-                    v = 0;
-                }
-                s->sb_samples[ch][j][i] = v;
-            }
-        }
-        for (i = bound; i < SBLIMIT; i++) {
-            n = allocation[0][i];
-            if (n) {
-                mant = get_bits(&s->gb, n + 1);
-                v = l1_unscale(n, mant, scale_factors[0][i]);
-                s->sb_samples[0][j][i] = v;
-                v = l1_unscale(n, mant, scale_factors[1][i]);
-                s->sb_samples[1][j][i] = v;
-            } else {
-                s->sb_samples[0][j][i] = 0;
-                s->sb_samples[1][j][i] = 0;
-            }
-        }
-    }
-    return 12;
-}
-
-static int mp_decode_layer2(MPADecodeContext *s)
-{
-    int sblimit; /* number of used subbands */
-    const unsigned char *alloc_table;
-    int table, bit_alloc_bits, i, j, ch, bound, v;
-    unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT];
-    unsigned char scale_code[MPA_MAX_CHANNELS][SBLIMIT];
-    unsigned char scale_factors[MPA_MAX_CHANNELS][SBLIMIT][3], *sf;
-    int scale, qindex, bits, steps, k, l, m, b;
-
-    /* select decoding table */
-    table = ff_mpa_l2_select_table(s->bit_rate / 1000, s->nb_channels,
-                                   s->sample_rate, s->lsf);
-    sblimit     = ff_mpa_sblimit_table[table];
-    alloc_table = ff_mpa_alloc_tables[table];
-
-    if (s->mode == MPA_JSTEREO)
-        bound = (s->mode_ext + 1) * 4;
-    else
-        bound = sblimit;
-
-    av_dlog(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
-
-    /* sanity check */
-    if (bound > sblimit)
-        bound = sblimit;
-
-    /* parse bit allocation */
-    j = 0;
-    for (i = 0; i < bound; i++) {
-        bit_alloc_bits = alloc_table[j];
-        for (ch = 0; ch < s->nb_channels; ch++)
-            bit_alloc[ch][i] = get_bits(&s->gb, bit_alloc_bits);
-        j += 1 << bit_alloc_bits;
-    }
-    for (i = bound; i < sblimit; i++) {
-        bit_alloc_bits = alloc_table[j];
-        v = get_bits(&s->gb, bit_alloc_bits);
-        bit_alloc[0][i] = v;
-        bit_alloc[1][i] = v;
-        j += 1 << bit_alloc_bits;
-    }
-
-    /* scale codes */
-    for (i = 0; i < sblimit; i++) {
-        for (ch = 0; ch < s->nb_channels; ch++) {
-            if (bit_alloc[ch][i])
-                scale_code[ch][i] = get_bits(&s->gb, 2);
-        }
-    }
-
-    /* scale factors */
-    for (i = 0; i < sblimit; i++) {
-        for (ch = 0; ch < s->nb_channels; ch++) {
-            if (bit_alloc[ch][i]) {
-                sf = scale_factors[ch][i];
-                switch (scale_code[ch][i]) {
-                default:
-                case 0:
-                    sf[0] = get_bits(&s->gb, 6);
-                    sf[1] = get_bits(&s->gb, 6);
-                    sf[2] = get_bits(&s->gb, 6);
-                    break;
-                case 2:
-                    sf[0] = get_bits(&s->gb, 6);
-                    sf[1] = sf[0];
-                    sf[2] = sf[0];
-                    break;
-                case 1:
-                    sf[0] = get_bits(&s->gb, 6);
-                    sf[2] = get_bits(&s->gb, 6);
-                    sf[1] = sf[0];
-                    break;
-                case 3:
-                    sf[0] = get_bits(&s->gb, 6);
-                    sf[2] = get_bits(&s->gb, 6);
-                    sf[1] = sf[2];
-                    break;
-                }
-            }
-        }
-    }
-
-    /* samples */
-    for (k = 0; k < 3; k++) {
-        for (l = 0; l < 12; l += 3) {
-            j = 0;
-            for (i = 0; i < bound; i++) {
-                bit_alloc_bits = alloc_table[j];
-                for (ch = 0; ch < s->nb_channels; ch++) {
-                    b = bit_alloc[ch][i];
-                    if (b) {
-                        scale = scale_factors[ch][i][k];
-                        qindex = alloc_table[j+b];
-                        bits = ff_mpa_quant_bits[qindex];
-                        if (bits < 0) {
-                            int v2;
-                            /* 3 values at the same time */
-                            v = get_bits(&s->gb, -bits);
-                            v2 = division_tabs[qindex][v];
-                            steps  = ff_mpa_quant_steps[qindex];
-
-                            s->sb_samples[ch][k * 12 + l + 0][i] =
-                                l2_unscale_group(steps,  v2       & 15, scale);
-                            s->sb_samples[ch][k * 12 + l + 1][i] =
-                                l2_unscale_group(steps, (v2 >> 4) & 15, scale);
-                            s->sb_samples[ch][k * 12 + l + 2][i] =
-                                l2_unscale_group(steps,  v2 >> 8      , scale);
-                        } else {
-                            for (m = 0; m < 3; m++) {
-                                v = get_bits(&s->gb, bits);
-                                v = l1_unscale(bits - 1, v, scale);
-                                s->sb_samples[ch][k * 12 + l + m][i] = v;
-                            }
-                        }
-                    } else {
-                        s->sb_samples[ch][k * 12 + l + 0][i] = 0;
-                        s->sb_samples[ch][k * 12 + l + 1][i] = 0;
-                        s->sb_samples[ch][k * 12 + l + 2][i] = 0;
-                    }
-                }
-                /* next subband in alloc table */
-                j += 1 << bit_alloc_bits;
-            }
-            /* XXX: find a way to avoid this duplication of code */
-            for (i = bound; i < sblimit; i++) {
-                bit_alloc_bits = alloc_table[j];
-                b = bit_alloc[0][i];
-                if (b) {
-                    int mant, scale0, scale1;
-                    scale0 = scale_factors[0][i][k];
-                    scale1 = scale_factors[1][i][k];
-                    qindex = alloc_table[j+b];
-                    bits = ff_mpa_quant_bits[qindex];
-                    if (bits < 0) {
-                        /* 3 values at the same time */
-                        v = get_bits(&s->gb, -bits);
-                        steps = ff_mpa_quant_steps[qindex];
-                        mant = v % steps;
-                        v = v / steps;
-                        s->sb_samples[0][k * 12 + l + 0][i] =
-                            l2_unscale_group(steps, mant, scale0);
-                        s->sb_samples[1][k * 12 + l + 0][i] =
-                            l2_unscale_group(steps, mant, scale1);
-                        mant = v % steps;
-                        v = v / steps;
-                        s->sb_samples[0][k * 12 + l + 1][i] =
-                            l2_unscale_group(steps, mant, scale0);
-                        s->sb_samples[1][k * 12 + l + 1][i] =
-                            l2_unscale_group(steps, mant, scale1);
-                        s->sb_samples[0][k * 12 + l + 2][i] =
-                            l2_unscale_group(steps, v, scale0);
-                        s->sb_samples[1][k * 12 + l + 2][i] =
-                            l2_unscale_group(steps, v, scale1);
-                    } else {
-                        for (m = 0; m < 3; m++) {
-                            mant = get_bits(&s->gb, bits);
-                            s->sb_samples[0][k * 12 + l + m][i] =
-                                l1_unscale(bits - 1, mant, scale0);
-                            s->sb_samples[1][k * 12 + l + m][i] =
-                                l1_unscale(bits - 1, mant, scale1);
-                        }
-                    }
-                } else {
-                    s->sb_samples[0][k * 12 + l + 0][i] = 0;
-                    s->sb_samples[0][k * 12 + l + 1][i] = 0;
-                    s->sb_samples[0][k * 12 + l + 2][i] = 0;
-                    s->sb_samples[1][k * 12 + l + 0][i] = 0;
-                    s->sb_samples[1][k * 12 + l + 1][i] = 0;
-                    s->sb_samples[1][k * 12 + l + 2][i] = 0;
-                }
-                /* next subband in alloc table */
-                j += 1 << bit_alloc_bits;
-            }
-            /* fill remaining samples to zero */
-            for (i = sblimit; i < SBLIMIT; i++) {
-                for (ch = 0; ch < s->nb_channels; ch++) {
-                    s->sb_samples[ch][k * 12 + l + 0][i] = 0;
-                    s->sb_samples[ch][k * 12 + l + 1][i] = 0;
-                    s->sb_samples[ch][k * 12 + l + 2][i] = 0;
-                }
-            }
-        }
-    }
-    return 3 * 12;
-}
-
-#define SPLIT(dst,sf,n)             \
-    if (n == 3) {                   \
-        int m = (sf * 171) >> 9;    \
-        dst   = sf - 3 * m;         \
-        sf    = m;                  \
-    } else if (n == 4) {            \
-        dst  = sf & 3;              \
-        sf >>= 2;                   \
-    } else if (n == 5) {            \
-        int m = (sf * 205) >> 10;   \
-        dst   = sf - 5 * m;         \
-        sf    = m;                  \
-    } else if (n == 6) {            \
-        int m = (sf * 171) >> 10;   \
-        dst   = sf - 6 * m;         \
-        sf    = m;                  \
-    } else {                        \
-        dst = 0;                    \
-    }
-
-static av_always_inline void lsf_sf_expand(int *slen, int sf, int n1, int n2,
-                                           int n3)
-{
-    SPLIT(slen[3], sf, n3)
-    SPLIT(slen[2], sf, n2)
-    SPLIT(slen[1], sf, n1)
-    slen[0] = sf;
-}
-
-static void exponents_from_scale_factors(MPADecodeContext *s, GranuleDef *g,
-                                         int16_t *exponents)
-{
-    const uint8_t *bstab, *pretab;
-    int len, i, j, k, l, v0, shift, gain, gains[3];
-    int16_t *exp_ptr;
-
-    exp_ptr = exponents;
-    gain    = g->global_gain - 210;
-    shift   = g->scalefac_scale + 1;
-
-    bstab  = band_size_long[s->sample_rate_index];
-    pretab = mpa_pretab[g->preflag];
-    for (i = 0; i < g->long_end; i++) {
-        v0 = gain - ((g->scale_factors[i] + pretab[i]) << shift) + 400;
-        len = bstab[i];
-        for (j = len; j > 0; j--)
-            *exp_ptr++ = v0;
-    }
-
-    if (g->short_start < 13) {
-        bstab    = band_size_short[s->sample_rate_index];
-        gains[0] = gain - (g->subblock_gain[0] << 3);
-        gains[1] = gain - (g->subblock_gain[1] << 3);
-        gains[2] = gain - (g->subblock_gain[2] << 3);
-        k        = g->long_end;
-        for (i = g->short_start; i < 13; i++) {
-            len = bstab[i];
-            for (l = 0; l < 3; l++) {
-                v0 = gains[l] - (g->scale_factors[k++] << shift) + 400;
-                for (j = len; j > 0; j--)
-                    *exp_ptr++ = v0;
-            }
-        }
-    }
-}
-
-/* handle n = 0 too */
-static inline int get_bitsz(GetBitContext *s, int n)
-{
-    return n ? get_bits(s, n) : 0;
-}
-
-
-static void switch_buffer(MPADecodeContext *s, int *pos, int *end_pos,
-                          int *end_pos2)
-{
-    if (s->in_gb.buffer && *pos >= s->gb.size_in_bits) {
-        s->gb           = s->in_gb;
-        s->in_gb.buffer = NULL;
-        assert((get_bits_count(&s->gb) & 7) == 0);
-        skip_bits_long(&s->gb, *pos - *end_pos);
-        *end_pos2 =
-        *end_pos  = *end_pos2 + get_bits_count(&s->gb) - *pos;
-        *pos      = get_bits_count(&s->gb);
-    }
-}
-
-/* Following is a optimized code for
-            INTFLOAT v = *src
-            if(get_bits1(&s->gb))
-                v = -v;
-            *dst = v;
-*/
-#if CONFIG_FLOAT
-#define READ_FLIP_SIGN(dst,src)                     \
-    v = AV_RN32A(src) ^ (get_bits1(&s->gb) << 31);  \
-    AV_WN32A(dst, v);
-#else
-#define READ_FLIP_SIGN(dst,src)     \
-    v      = -get_bits1(&s->gb);    \
-    *(dst) = (*(src) ^ v) - v;
-#endif
-
-static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
-                          int16_t *exponents, int end_pos2)
-{
-    int s_index;
-    int i;
-    int last_pos, bits_left;
-    VLC *vlc;
-    int end_pos = FFMIN(end_pos2, s->gb.size_in_bits);
-
-    /* low frequencies (called big values) */
-    s_index = 0;
-    for (i = 0; i < 3; i++) {
-        int j, k, l, linbits;
-        j = g->region_size[i];
-        if (j == 0)
-            continue;
-        /* select vlc table */
-        k       = g->table_select[i];
-        l       = mpa_huff_data[k][0];
-        linbits = mpa_huff_data[k][1];
-        vlc     = &huff_vlc[l];
-
-        if (!l) {
-            memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid) * 2 * j);
-            s_index += 2 * j;
-            continue;
-        }
-
-        /* read huffcode and compute each couple */
-        for (; j > 0; j--) {
-            int exponent, x, y;
-            int v;
-            int pos = get_bits_count(&s->gb);
-
-            if (pos >= end_pos){
-                switch_buffer(s, &pos, &end_pos, &end_pos2);
-                if (pos >= end_pos)
-                    break;
-            }
-            y = get_vlc2(&s->gb, vlc->table, 7, 3);
-
-            if (!y) {
-                g->sb_hybrid[s_index  ] =
-                g->sb_hybrid[s_index+1] = 0;
-                s_index += 2;
-                continue;
-            }
-
-            exponent= exponents[s_index];
-
-            av_dlog(s->avctx, "region=%d n=%d x=%d y=%d exp=%d\n",
-                    i, g->region_size[i] - j, x, y, exponent);
-            if (y & 16) {
-                x = y >> 5;
-                y = y & 0x0f;
-                if (x < 15) {
-                    READ_FLIP_SIGN(g->sb_hybrid + s_index, RENAME(expval_table)[exponent] + x)
-                } else {
-                    x += get_bitsz(&s->gb, linbits);
-                    v  = l3_unscale(x, exponent);
-                    if (get_bits1(&s->gb))
-                        v = -v;
-                    g->sb_hybrid[s_index] = v;
-                }
-                if (y < 15) {
-                    READ_FLIP_SIGN(g->sb_hybrid + s_index + 1, RENAME(expval_table)[exponent] + y)
-                } else {
-                    y += get_bitsz(&s->gb, linbits);
-                    v  = l3_unscale(y, exponent);
-                    if (get_bits1(&s->gb))
-                        v = -v;
-                    g->sb_hybrid[s_index+1] = v;
-                }
-            } else {
-                x = y >> 5;
-                y = y & 0x0f;
-                x += y;
-                if (x < 15) {
-                    READ_FLIP_SIGN(g->sb_hybrid + s_index + !!y, RENAME(expval_table)[exponent] + x)
-                } else {
-                    x += get_bitsz(&s->gb, linbits);
-                    v  = l3_unscale(x, exponent);
-                    if (get_bits1(&s->gb))
-                        v = -v;
-                    g->sb_hybrid[s_index+!!y] = v;
-                }
-                g->sb_hybrid[s_index + !y] = 0;
-            }
-            s_index += 2;
-        }
-    }
-
-    /* high frequencies */
-    vlc = &huff_quad_vlc[g->count1table_select];
-    last_pos = 0;
-    while (s_index <= 572) {
-        int pos, code;
-        pos = get_bits_count(&s->gb);
-        if (pos >= end_pos) {
-            if (pos > end_pos2 && last_pos) {
-                /* some encoders generate an incorrect size for this
-                   part. We must go back into the data */
-                s_index -= 4;
-                skip_bits_long(&s->gb, last_pos - pos);
-                av_log(s->avctx, AV_LOG_INFO, "overread, skip %d enddists: %d %d\n", last_pos - pos, end_pos-pos, end_pos2-pos);
-                if(s->err_recognition & AV_EF_BITSTREAM)
-                    s_index=0;
-                break;
-            }
-            switch_buffer(s, &pos, &end_pos, &end_pos2);
-            if (pos >= end_pos)
-                break;
-        }
-        last_pos = pos;
-
-        code = get_vlc2(&s->gb, vlc->table, vlc->bits, 1);
-        av_dlog(s->avctx, "t=%d code=%d\n", g->count1table_select, code);
-        g->sb_hybrid[s_index+0] =
-        g->sb_hybrid[s_index+1] =
-        g->sb_hybrid[s_index+2] =
-        g->sb_hybrid[s_index+3] = 0;
-        while (code) {
-            static const int idxtab[16] = { 3,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0 };
-            int v;
-            int pos = s_index + idxtab[code];
-            code   ^= 8 >> idxtab[code];
-            READ_FLIP_SIGN(g->sb_hybrid + pos, RENAME(exp_table)+exponents[pos])
-        }
-        s_index += 4;
-    }
-    /* skip extension bits */
-    bits_left = end_pos2 - get_bits_count(&s->gb);
-    if (bits_left < 0 && (s->err_recognition & AV_EF_BUFFER)) {
-        av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
-        s_index=0;
-    } else if (bits_left > 0 && (s->err_recognition & AV_EF_BUFFER)) {
-        av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
-        s_index = 0;
-    }
-    memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid) * (576 - s_index));
-    skip_bits_long(&s->gb, bits_left);
-
-    i = get_bits_count(&s->gb);
-    switch_buffer(s, &i, &end_pos, &end_pos2);
-
-    return 0;
-}
-
-/* Reorder short blocks from bitstream order to interleaved order. It
-   would be faster to do it in parsing, but the code would be far more
-   complicated */
-static void reorder_block(MPADecodeContext *s, GranuleDef *g)
-{
-    int i, j, len;
-    INTFLOAT *ptr, *dst, *ptr1;
-    INTFLOAT tmp[576];
-
-    if (g->block_type != 2)
-        return;
-
-    if (g->switch_point) {
-        if (s->sample_rate_index != 8)
-            ptr = g->sb_hybrid + 36;
-        else
-            ptr = g->sb_hybrid + 72;
-    } else {
-        ptr = g->sb_hybrid;
-    }
-
-    for (i = g->short_start; i < 13; i++) {
-        len  = band_size_short[s->sample_rate_index][i];
-        ptr1 = ptr;
-        dst  = tmp;
-        for (j = len; j > 0; j--) {
-            *dst++ = ptr[0*len];
-            *dst++ = ptr[1*len];
-            *dst++ = ptr[2*len];
-            ptr++;
-        }
-        ptr += 2 * len;
-        memcpy(ptr1, tmp, len * 3 * sizeof(*ptr1));
-    }
-}
-
-#define ISQRT2 FIXR(0.70710678118654752440)
-
-static void compute_stereo(MPADecodeContext *s, GranuleDef *g0, GranuleDef *g1)
-{
-    int i, j, k, l;
-    int sf_max, sf, len, non_zero_found;
-    INTFLOAT (*is_tab)[16], *tab0, *tab1, tmp0, tmp1, v1, v2;
-    int non_zero_found_short[3];
-
-    /* intensity stereo */
-    if (s->mode_ext & MODE_EXT_I_STEREO) {
-        if (!s->lsf) {
-            is_tab = is_table;
-            sf_max = 7;
-        } else {
-            is_tab = is_table_lsf[g1->scalefac_compress & 1];
-            sf_max = 16;
-        }
-
-        tab0 = g0->sb_hybrid + 576;
-        tab1 = g1->sb_hybrid + 576;
-
-        non_zero_found_short[0] = 0;
-        non_zero_found_short[1] = 0;
-        non_zero_found_short[2] = 0;
-        k = (13 - g1->short_start) * 3 + g1->long_end - 3;
-        for (i = 12; i >= g1->short_start; i--) {
-            /* for last band, use previous scale factor */
-            if (i != 11)
-                k -= 3;
-            len = band_size_short[s->sample_rate_index][i];
-            for (l = 2; l >= 0; l--) {
-                tab0 -= len;
-                tab1 -= len;
-                if (!non_zero_found_short[l]) {
-                    /* test if non zero band. if so, stop doing i-stereo */
-                    for (j = 0; j < len; j++) {
-                        if (tab1[j] != 0) {
-                            non_zero_found_short[l] = 1;
-                            goto found1;
-                        }
-                    }
-                    sf = g1->scale_factors[k + l];
-                    if (sf >= sf_max)
-                        goto found1;
-
-                    v1 = is_tab[0][sf];
-                    v2 = is_tab[1][sf];
-                    for (j = 0; j < len; j++) {
-                        tmp0    = tab0[j];
-                        tab0[j] = MULLx(tmp0, v1, FRAC_BITS);
-                        tab1[j] = MULLx(tmp0, v2, FRAC_BITS);
-                    }
-                } else {
-found1:
-                    if (s->mode_ext & MODE_EXT_MS_STEREO) {
-                        /* lower part of the spectrum : do ms stereo
-                           if enabled */
-                        for (j = 0; j < len; j++) {
-                            tmp0    = tab0[j];
-                            tmp1    = tab1[j];
-                            tab0[j] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS);
-                            tab1[j] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS);
-                        }
-                    }
-                }
-            }
-        }
-
-        non_zero_found = non_zero_found_short[0] |
-                         non_zero_found_short[1] |
-                         non_zero_found_short[2];
-
-        for (i = g1->long_end - 1;i >= 0;i--) {
-            len   = band_size_long[s->sample_rate_index][i];
-            tab0 -= len;
-            tab1 -= len;
-            /* test if non zero band. if so, stop doing i-stereo */
-            if (!non_zero_found) {
-                for (j = 0; j < len; j++) {
-                    if (tab1[j] != 0) {
-                        non_zero_found = 1;
-                        goto found2;
-                    }
-                }
-                /* for last band, use previous scale factor */
-                k  = (i == 21) ? 20 : i;
-                sf = g1->scale_factors[k];
-                if (sf >= sf_max)
-                    goto found2;
-                v1 = is_tab[0][sf];
-                v2 = is_tab[1][sf];
-                for (j = 0; j < len; j++) {
-                    tmp0    = tab0[j];
-                    tab0[j] = MULLx(tmp0, v1, FRAC_BITS);
-                    tab1[j] = MULLx(tmp0, v2, FRAC_BITS);
-                }
-            } else {
-found2:
-                if (s->mode_ext & MODE_EXT_MS_STEREO) {
-                    /* lower part of the spectrum : do ms stereo
-                       if enabled */
-                    for (j = 0; j < len; j++) {
-                        tmp0    = tab0[j];
-                        tmp1    = tab1[j];
-                        tab0[j] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS);
-                        tab1[j] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS);
-                    }
-                }
-            }
-        }
-    } else if (s->mode_ext & MODE_EXT_MS_STEREO) {
-        /* ms stereo ONLY */
-        /* NOTE: the 1/sqrt(2) normalization factor is included in the
-           global gain */
-#if CONFIG_FLOAT
-       s->fdsp.butterflies_float(g0->sb_hybrid, g1->sb_hybrid, 576);
-#else
-        tab0 = g0->sb_hybrid;
-        tab1 = g1->sb_hybrid;
-        for (i = 0; i < 576; i++) {
-            tmp0    = tab0[i];
-            tmp1    = tab1[i];
-            tab0[i] = tmp0 + tmp1;
-            tab1[i] = tmp0 - tmp1;
-        }
-#endif
-    }
-}
-
-#if CONFIG_FLOAT
-#define AA(j) do {                                                      \
-        float tmp0 = ptr[-1-j];                                         \
-        float tmp1 = ptr[   j];                                         \
-        ptr[-1-j] = tmp0 * csa_table[j][0] - tmp1 * csa_table[j][1];    \
-        ptr[   j] = tmp0 * csa_table[j][1] + tmp1 * csa_table[j][0];    \
-    } while (0)
-#else
-#define AA(j) do {                                              \
-        int tmp0 = ptr[-1-j];                                   \
-        int tmp1 = ptr[   j];                                   \
-        int tmp2 = MULH(tmp0 + tmp1, csa_table[j][0]);          \
-        ptr[-1-j] = 4 * (tmp2 - MULH(tmp1, csa_table[j][2]));   \
-        ptr[   j] = 4 * (tmp2 + MULH(tmp0, csa_table[j][3]));   \
-    } while (0)
-#endif
-
-static void compute_antialias(MPADecodeContext *s, GranuleDef *g)
-{
-    INTFLOAT *ptr;
-    int n, i;
-
-    /* we antialias only "long" bands */
-    if (g->block_type == 2) {
-        if (!g->switch_point)
-            return;
-        /* XXX: check this for 8000Hz case */
-        n = 1;
-    } else {
-        n = SBLIMIT - 1;
-    }
-
-    ptr = g->sb_hybrid + 18;
-    for (i = n; i > 0; i--) {
-        AA(0);
-        AA(1);
-        AA(2);
-        AA(3);
-        AA(4);
-        AA(5);
-        AA(6);
-        AA(7);
-
-        ptr += 18;
-    }
-}
-
-static void compute_imdct(MPADecodeContext *s, GranuleDef *g,
-                          INTFLOAT *sb_samples, INTFLOAT *mdct_buf)
-{
-    INTFLOAT *win, *out_ptr, *ptr, *buf, *ptr1;
-    INTFLOAT out2[12];
-    int i, j, mdct_long_end, sblimit;
-
-    /* find last non zero block */
-    ptr  = g->sb_hybrid + 576;
-    ptr1 = g->sb_hybrid + 2 * 18;
-    while (ptr >= ptr1) {
-        int32_t *p;
-        ptr -= 6;
-        p    = (int32_t*)ptr;
-        if (p[0] | p[1] | p[2] | p[3] | p[4] | p[5])
-            break;
-    }
-    sblimit = ((ptr - g->sb_hybrid) / 18) + 1;
-
-    if (g->block_type == 2) {
-        /* XXX: check for 8000 Hz */
-        if (g->switch_point)
-            mdct_long_end = 2;
-        else
-            mdct_long_end = 0;
-    } else {
-        mdct_long_end = sblimit;
-    }
-
-    s->mpadsp.RENAME(imdct36_blocks)(sb_samples, mdct_buf, g->sb_hybrid,
-                                     mdct_long_end, g->switch_point,
-                                     g->block_type);
-
-    buf = mdct_buf + 4*18*(mdct_long_end >> 2) + (mdct_long_end & 3);
-    ptr = g->sb_hybrid + 18 * mdct_long_end;
-
-    for (j = mdct_long_end; j < sblimit; j++) {
-        /* select frequency inversion */
-        win     = RENAME(ff_mdct_win)[2 + (4  & -(j & 1))];
-        out_ptr = sb_samples + j;
-
-        for (i = 0; i < 6; i++) {
-            *out_ptr = buf[4*i];
-            out_ptr += SBLIMIT;
-        }
-        imdct12(out2, ptr + 0);
-        for (i = 0; i < 6; i++) {
-            *out_ptr     = MULH3(out2[i    ], win[i    ], 1) + buf[4*(i + 6*1)];
-            buf[4*(i + 6*2)] = MULH3(out2[i + 6], win[i + 6], 1);
-            out_ptr += SBLIMIT;
-        }
-        imdct12(out2, ptr + 1);
-        for (i = 0; i < 6; i++) {
-            *out_ptr     = MULH3(out2[i    ], win[i    ], 1) + buf[4*(i + 6*2)];
-            buf[4*(i + 6*0)] = MULH3(out2[i + 6], win[i + 6], 1);
-            out_ptr += SBLIMIT;
-        }
-        imdct12(out2, ptr + 2);
-        for (i = 0; i < 6; i++) {
-            buf[4*(i + 6*0)] = MULH3(out2[i    ], win[i    ], 1) + buf[4*(i + 6*0)];
-            buf[4*(i + 6*1)] = MULH3(out2[i + 6], win[i + 6], 1);
-            buf[4*(i + 6*2)] = 0;
-        }
-        ptr += 18;
-        buf += (j&3) != 3 ? 1 : (4*18-3);
-    }
-    /* zero bands */
-    for (j = sblimit; j < SBLIMIT; j++) {
-        /* overlap */
-        out_ptr = sb_samples + j;
-        for (i = 0; i < 18; i++) {
-            *out_ptr = buf[4*i];
-            buf[4*i]   = 0;
-            out_ptr += SBLIMIT;
-        }
-        buf += (j&3) != 3 ? 1 : (4*18-3);
-    }
-}
-
-/* main layer3 decoding function */
-static int mp_decode_layer3(MPADecodeContext *s)
-{
-    int nb_granules, main_data_begin;
-    int gr, ch, blocksplit_flag, i, j, k, n, bits_pos;
-    GranuleDef *g;
-    int16_t exponents[576]; //FIXME try INTFLOAT
-
-    /* read side info */
-    if (s->lsf) {
-        main_data_begin = get_bits(&s->gb, 8);
-        skip_bits(&s->gb, s->nb_channels);
-        nb_granules = 1;
-    } else {
-        main_data_begin = get_bits(&s->gb, 9);
-        if (s->nb_channels == 2)
-            skip_bits(&s->gb, 3);
-        else
-            skip_bits(&s->gb, 5);
-        nb_granules = 2;
-        for (ch = 0; ch < s->nb_channels; ch++) {
-            s->granules[ch][0].scfsi = 0;/* all scale factors are transmitted */
-            s->granules[ch][1].scfsi = get_bits(&s->gb, 4);
-        }
-    }
-
-    for (gr = 0; gr < nb_granules; gr++) {
-        for (ch = 0; ch < s->nb_channels; ch++) {
-            av_dlog(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
-            g = &s->granules[ch][gr];
-            g->part2_3_length = get_bits(&s->gb, 12);
-            g->big_values     = get_bits(&s->gb,  9);
-            if (g->big_values > 288) {
-                av_log(s->avctx, AV_LOG_ERROR, "big_values too big\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            g->global_gain = get_bits(&s->gb, 8);
-            /* if MS stereo only is selected, we precompute the
-               1/sqrt(2) renormalization factor */
-            if ((s->mode_ext & (MODE_EXT_MS_STEREO | MODE_EXT_I_STEREO)) ==
-                MODE_EXT_MS_STEREO)
-                g->global_gain -= 2;
-            if (s->lsf)
-                g->scalefac_compress = get_bits(&s->gb, 9);
-            else
-                g->scalefac_compress = get_bits(&s->gb, 4);
-            blocksplit_flag = get_bits1(&s->gb);
-            if (blocksplit_flag) {
-                g->block_type = get_bits(&s->gb, 2);
-                if (g->block_type == 0) {
-                    av_log(s->avctx, AV_LOG_ERROR, "invalid block type\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                g->switch_point = get_bits1(&s->gb);
-                for (i = 0; i < 2; i++)
-                    g->table_select[i] = get_bits(&s->gb, 5);
-                for (i = 0; i < 3; i++)
-                    g->subblock_gain[i] = get_bits(&s->gb, 3);
-                init_short_region(s, g);
-            } else {
-                int region_address1, region_address2;
-                g->block_type = 0;
-                g->switch_point = 0;
-                for (i = 0; i < 3; i++)
-                    g->table_select[i] = get_bits(&s->gb, 5);
-                /* compute huffman coded region sizes */
-                region_address1 = get_bits(&s->gb, 4);
-                region_address2 = get_bits(&s->gb, 3);
-                av_dlog(s->avctx, "region1=%d region2=%d\n",
-                        region_address1, region_address2);
-                init_long_region(s, g, region_address1, region_address2);
-            }
-            region_offset2size(g);
-            compute_band_indexes(s, g);
-
-            g->preflag = 0;
-            if (!s->lsf)
-                g->preflag = get_bits1(&s->gb);
-            g->scalefac_scale     = get_bits1(&s->gb);
-            g->count1table_select = get_bits1(&s->gb);
-            av_dlog(s->avctx, "block_type=%d switch_point=%d\n",
-                    g->block_type, g->switch_point);
-        }
-    }
-
-    if (!s->adu_mode) {
-        int skip;
-        const uint8_t *ptr = s->gb.buffer + (get_bits_count(&s->gb)>>3);
-        int extrasize = av_clip(get_bits_left(&s->gb) >> 3, 0,
-                                FFMAX(0, LAST_BUF_SIZE - s->last_buf_size));
-        assert((get_bits_count(&s->gb) & 7) == 0);
-        /* now we get bits from the main_data_begin offset */
-        av_dlog(s->avctx, "seekback:%d, lastbuf:%d\n",
-                main_data_begin, s->last_buf_size);
-
-        memcpy(s->last_buf + s->last_buf_size, ptr, extrasize);
-        s->in_gb = s->gb;
-        init_get_bits(&s->gb, s->last_buf, s->last_buf_size*8);
-#if !UNCHECKED_BITSTREAM_READER
-        s->gb.size_in_bits_plus8 += extrasize * 8;
-#endif
-        s->last_buf_size <<= 3;
-        for (gr = 0; gr < nb_granules && (s->last_buf_size >> 3) < main_data_begin; gr++) {
-            for (ch = 0; ch < s->nb_channels; ch++) {
-                g = &s->granules[ch][gr];
-                s->last_buf_size += g->part2_3_length;
-                memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid));
-                compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]);
-            }
-        }
-        skip = s->last_buf_size - 8 * main_data_begin;
-        if (skip >= s->gb.size_in_bits && s->in_gb.buffer) {
-            skip_bits_long(&s->in_gb, skip - s->gb.size_in_bits);
-            s->gb           = s->in_gb;
-            s->in_gb.buffer = NULL;
-        } else {
-            skip_bits_long(&s->gb, skip);
-        }
-    } else {
-        gr = 0;
-    }
-
-    for (; gr < nb_granules; gr++) {
-        for (ch = 0; ch < s->nb_channels; ch++) {
-            g = &s->granules[ch][gr];
-            bits_pos = get_bits_count(&s->gb);
-
-            if (!s->lsf) {
-                uint8_t *sc;
-                int slen, slen1, slen2;
-
-                /* MPEG1 scale factors */
-                slen1 = slen_table[0][g->scalefac_compress];
-                slen2 = slen_table[1][g->scalefac_compress];
-                av_dlog(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
-                if (g->block_type == 2) {
-                    n = g->switch_point ? 17 : 18;
-                    j = 0;
-                    if (slen1) {
-                        for (i = 0; i < n; i++)
-                            g->scale_factors[j++] = get_bits(&s->gb, slen1);
-                    } else {
-                        for (i = 0; i < n; i++)
-                            g->scale_factors[j++] = 0;
-                    }
-                    if (slen2) {
-                        for (i = 0; i < 18; i++)
-                            g->scale_factors[j++] = get_bits(&s->gb, slen2);
-                        for (i = 0; i < 3; i++)
-                            g->scale_factors[j++] = 0;
-                    } else {
-                        for (i = 0; i < 21; i++)
-                            g->scale_factors[j++] = 0;
-                    }
-                } else {
-                    sc = s->granules[ch][0].scale_factors;
-                    j = 0;
-                    for (k = 0; k < 4; k++) {
-                        n = k == 0 ? 6 : 5;
-                        if ((g->scfsi & (0x8 >> k)) == 0) {
-                            slen = (k < 2) ? slen1 : slen2;
-                            if (slen) {
-                                for (i = 0; i < n; i++)
-                                    g->scale_factors[j++] = get_bits(&s->gb, slen);
-                            } else {
-                                for (i = 0; i < n; i++)
-                                    g->scale_factors[j++] = 0;
-                            }
-                        } else {
-                            /* simply copy from last granule */
-                            for (i = 0; i < n; i++) {
-                                g->scale_factors[j] = sc[j];
-                                j++;
-                            }
-                        }
-                    }
-                    g->scale_factors[j++] = 0;
-                }
-            } else {
-                int tindex, tindex2, slen[4], sl, sf;
-
-                /* LSF scale factors */
-                if (g->block_type == 2)
-                    tindex = g->switch_point ? 2 : 1;
-                else
-                    tindex = 0;
-
-                sf = g->scalefac_compress;
-                if ((s->mode_ext & MODE_EXT_I_STEREO) && ch == 1) {
-                    /* intensity stereo case */
-                    sf >>= 1;
-                    if (sf < 180) {
-                        lsf_sf_expand(slen, sf, 6, 6, 0);
-                        tindex2 = 3;
-                    } else if (sf < 244) {
-                        lsf_sf_expand(slen, sf - 180, 4, 4, 0);
-                        tindex2 = 4;
-                    } else {
-                        lsf_sf_expand(slen, sf - 244, 3, 0, 0);
-                        tindex2 = 5;
-                    }
-                } else {
-                    /* normal case */
-                    if (sf < 400) {
-                        lsf_sf_expand(slen, sf, 5, 4, 4);
-                        tindex2 = 0;
-                    } else if (sf < 500) {
-                        lsf_sf_expand(slen, sf - 400, 5, 4, 0);
-                        tindex2 = 1;
-                    } else {
-                        lsf_sf_expand(slen, sf - 500, 3, 0, 0);
-                        tindex2 = 2;
-                        g->preflag = 1;
-                    }
-                }
-
-                j = 0;
-                for (k = 0; k < 4; k++) {
-                    n  = lsf_nsf_table[tindex2][tindex][k];
-                    sl = slen[k];
-                    if (sl) {
-                        for (i = 0; i < n; i++)
-                            g->scale_factors[j++] = get_bits(&s->gb, sl);
-                    } else {
-                        for (i = 0; i < n; i++)
-                            g->scale_factors[j++] = 0;
-                    }
-                }
-                /* XXX: should compute exact size */
-                for (; j < 40; j++)
-                    g->scale_factors[j] = 0;
-            }
-
-            exponents_from_scale_factors(s, g, exponents);
-
-            /* read Huffman coded residue */
-            huffman_decode(s, g, exponents, bits_pos + g->part2_3_length);
-        } /* ch */
-
-        if (s->mode == MPA_JSTEREO)
-            compute_stereo(s, &s->granules[0][gr], &s->granules[1][gr]);
-
-        for (ch = 0; ch < s->nb_channels; ch++) {
-            g = &s->granules[ch][gr];
-
-            reorder_block(s, g);
-            compute_antialias(s, g);
-            compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]);
-        }
-    } /* gr */
-    if (get_bits_count(&s->gb) < 0)
-        skip_bits_long(&s->gb, -get_bits_count(&s->gb));
-    return nb_granules * 18;
-}
-
-static int mp_decode_frame(MPADecodeContext *s, OUT_INT **samples,
-                           const uint8_t *buf, int buf_size)
-{
-    int i, nb_frames, ch, ret;
-    OUT_INT *samples_ptr;
-
-    init_get_bits(&s->gb, buf + HEADER_SIZE, (buf_size - HEADER_SIZE) * 8);
-
-    /* skip error protection field */
-    if (s->error_protection)
-        skip_bits(&s->gb, 16);
-
-    switch(s->layer) {
-    case 1:
-        s->avctx->frame_size = 384;
-        nb_frames = mp_decode_layer1(s);
-        break;
-    case 2:
-        s->avctx->frame_size = 1152;
-        nb_frames = mp_decode_layer2(s);
-        break;
-    case 3:
-        s->avctx->frame_size = s->lsf ? 576 : 1152;
-    default:
-        nb_frames = mp_decode_layer3(s);
-
-        if (nb_frames < 0)
-            return nb_frames;
-
-        s->last_buf_size=0;
-        if (s->in_gb.buffer) {
-            align_get_bits(&s->gb);
-            i = get_bits_left(&s->gb)>>3;
-            if (i >= 0 && i <= BACKSTEP_SIZE) {
-                memmove(s->last_buf, s->gb.buffer + (get_bits_count(&s->gb)>>3), i);
-                s->last_buf_size=i;
-            } else
-                av_log(s->avctx, AV_LOG_ERROR, "invalid old backstep %d\n", i);
-            s->gb           = s->in_gb;
-            s->in_gb.buffer = NULL;
-        }
-
-        align_get_bits(&s->gb);
-        assert((get_bits_count(&s->gb) & 7) == 0);
-        i = get_bits_left(&s->gb) >> 3;
-
-        if (i < 0 || i > BACKSTEP_SIZE || nb_frames < 0) {
-            if (i < 0)
-                av_log(s->avctx, AV_LOG_ERROR, "invalid new backstep %d\n", i);
-            i = FFMIN(BACKSTEP_SIZE, buf_size - HEADER_SIZE);
-        }
-        assert(i <= buf_size - HEADER_SIZE && i >= 0);
-        memcpy(s->last_buf + s->last_buf_size, s->gb.buffer + buf_size - HEADER_SIZE - i, i);
-        s->last_buf_size += i;
-    }
-
-    /* get output buffer */
-    if (!samples) {
-        av_assert0(s->frame != NULL);
-        s->frame->nb_samples = s->avctx->frame_size;
-        if ((ret = ff_get_buffer(s->avctx, s->frame, 0)) < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-        samples = (OUT_INT **)s->frame->extended_data;
-    }
-
-    /* apply the synthesis filter */
-    for (ch = 0; ch < s->nb_channels; ch++) {
-        int sample_stride;
-        if (s->avctx->sample_fmt == OUT_FMT_P) {
-            samples_ptr   = samples[ch];
-            sample_stride = 1;
-        } else {
-            samples_ptr   = samples[0] + ch;
-            sample_stride = s->nb_channels;
-        }
-        for (i = 0; i < nb_frames; i++) {
-            RENAME(ff_mpa_synth_filter)(&s->mpadsp, s->synth_buf[ch],
-                                        &(s->synth_buf_offset[ch]),
-                                        RENAME(ff_mpa_synth_window),
-                                        &s->dither_state, samples_ptr,
-                                        sample_stride, s->sb_samples[ch][i]);
-            samples_ptr += 32 * sample_stride;
-        }
-    }
-
-    return nb_frames * 32 * sizeof(OUT_INT) * s->nb_channels;
-}
-
-static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf  = avpkt->data;
-    int buf_size        = avpkt->size;
-    MPADecodeContext *s = avctx->priv_data;
-    uint32_t header;
-    int ret;
-
-    if (buf_size < HEADER_SIZE)
-        return AVERROR_INVALIDDATA;
-
-    header = AV_RB32(buf);
-    if (ff_mpa_check_header(header) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Header missing\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avpriv_mpegaudio_decode_header((MPADecodeHeader *)s, header) == 1) {
-        /* free format: prepare to compute frame size */
-        s->frame_size = -1;
-        return AVERROR_INVALIDDATA;
-    }
-    /* update codec info */
-    avctx->channels       = s->nb_channels;
-    avctx->channel_layout = s->nb_channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
-    if (!avctx->bit_rate)
-        avctx->bit_rate = s->bit_rate;
-
-    if (s->frame_size <= 0 || s->frame_size > buf_size) {
-        av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
-        return AVERROR_INVALIDDATA;
-    } else if (s->frame_size < buf_size) {
-        buf_size= s->frame_size;
-    }
-
-    s->frame = data;
-
-    ret = mp_decode_frame(s, NULL, buf, buf_size);
-    if (ret >= 0) {
-        s->frame->nb_samples = avctx->frame_size;
-        *got_frame_ptr       = 1;
-        avctx->sample_rate   = s->sample_rate;
-        //FIXME maybe move the other codec info stuff from above here too
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "Error while decoding MPEG audio frame.\n");
-        /* Only return an error if the bad frame makes up the whole packet or
-         * the error is related to buffer management.
-         * If there is more data in the packet, just consume the bad frame
-         * instead of returning an error, which would discard the whole
-         * packet. */
-        *got_frame_ptr = 0;
-        if (buf_size == avpkt->size || ret != AVERROR_INVALIDDATA)
-            return ret;
-    }
-    s->frame_size = 0;
-    return buf_size;
-}
-
-static void mp_flush(MPADecodeContext *ctx)
-{
-    memset(ctx->synth_buf, 0, sizeof(ctx->synth_buf));
-    ctx->last_buf_size = 0;
-}
-
-static void flush(AVCodecContext *avctx)
-{
-    mp_flush(avctx->priv_data);
-}
-
-#if CONFIG_MP3ADU_DECODER || CONFIG_MP3ADUFLOAT_DECODER
-static int decode_frame_adu(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    const uint8_t *buf  = avpkt->data;
-    int buf_size        = avpkt->size;
-    MPADecodeContext *s = avctx->priv_data;
-    uint32_t header;
-    int len, ret;
-
-    len = buf_size;
-
-    // Discard too short frames
-    if (buf_size < HEADER_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-
-    if (len > MPA_MAX_CODED_FRAME_SIZE)
-        len = MPA_MAX_CODED_FRAME_SIZE;
-
-    // Get header and restore sync word
-    header = AV_RB32(buf) | 0xffe00000;
-
-    if (ff_mpa_check_header(header) < 0) { // Bad header, discard frame
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avpriv_mpegaudio_decode_header((MPADecodeHeader *)s, header);
-    /* update codec info */
-    avctx->sample_rate = s->sample_rate;
-    avctx->channels    = s->nb_channels;
-    avctx->channel_layout = s->nb_channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
-    if (!avctx->bit_rate)
-        avctx->bit_rate = s->bit_rate;
-
-    s->frame_size = len;
-
-    s->frame = data;
-
-    ret = mp_decode_frame(s, NULL, buf, buf_size);
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error while decoding MPEG audio frame.\n");
-        return ret;
-    }
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-#endif /* CONFIG_MP3ADU_DECODER || CONFIG_MP3ADUFLOAT_DECODER */
-
-#if CONFIG_MP3ON4_DECODER || CONFIG_MP3ON4FLOAT_DECODER
-
-/**
- * Context for MP3On4 decoder
- */
-typedef struct MP3On4DecodeContext {
-    int frames;                     ///< number of mp3 frames per block (number of mp3 decoder instances)
-    int syncword;                   ///< syncword patch
-    const uint8_t *coff;            ///< channel offsets in output buffer
-    MPADecodeContext *mp3decctx[5]; ///< MPADecodeContext for every decoder instance
-} MP3On4DecodeContext;
-
-#include "mpeg4audio.h"
-
-/* Next 3 arrays are indexed by channel config number (passed via codecdata) */
-
-/* number of mp3 decoder instances */
-static const uint8_t mp3Frames[8] = { 0, 1, 1, 2, 3, 3, 4, 5 };
-
-/* offsets into output buffer, assume output order is FL FR C LFE BL BR SL SR */
-static const uint8_t chan_offset[8][5] = {
-    { 0             },
-    { 0             },  // C
-    { 0             },  // FLR
-    { 2, 0          },  // C FLR
-    { 2, 0, 3       },  // C FLR BS
-    { 2, 0, 3       },  // C FLR BLRS
-    { 2, 0, 4, 3    },  // C FLR BLRS LFE
-    { 2, 0, 6, 4, 3 },  // C FLR BLRS BLR LFE
-};
-
-/* mp3on4 channel layouts */
-static const int16_t chan_layout[8] = {
-    0,
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_5POINT0,
-    AV_CH_LAYOUT_5POINT1,
-    AV_CH_LAYOUT_7POINT1
-};
-
-static av_cold int decode_close_mp3on4(AVCodecContext * avctx)
-{
-    MP3On4DecodeContext *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < s->frames; i++)
-        av_free(s->mp3decctx[i]);
-
-    return 0;
-}
-
-
-static av_cold int decode_init_mp3on4(AVCodecContext * avctx)
-{
-    MP3On4DecodeContext *s = avctx->priv_data;
-    MPEG4AudioConfig cfg;
-    int i;
-
-    if ((avctx->extradata_size < 2) || (avctx->extradata == NULL)) {
-        av_log(avctx, AV_LOG_ERROR, "Codec extradata missing or too short.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avpriv_mpeg4audio_get_config(&cfg, avctx->extradata,
-                                 avctx->extradata_size * 8, 1);
-    if (!cfg.chan_config || cfg.chan_config > 7) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid channel config number.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    s->frames             = mp3Frames[cfg.chan_config];
-    s->coff               = chan_offset[cfg.chan_config];
-    avctx->channels       = ff_mpeg4audio_channels[cfg.chan_config];
-    avctx->channel_layout = chan_layout[cfg.chan_config];
-
-    if (cfg.sample_rate < 16000)
-        s->syncword = 0xffe00000;
-    else
-        s->syncword = 0xfff00000;
-
-    /* Init the first mp3 decoder in standard way, so that all tables get builded
-     * We replace avctx->priv_data with the context of the first decoder so that
-     * decode_init() does not have to be changed.
-     * Other decoders will be initialized here copying data from the first context
-     */
-    // Allocate zeroed memory for the first decoder context
-    s->mp3decctx[0] = av_mallocz(sizeof(MPADecodeContext));
-    if (!s->mp3decctx[0])
-        goto alloc_fail;
-    // Put decoder context in place to make init_decode() happy
-    avctx->priv_data = s->mp3decctx[0];
-    decode_init(avctx);
-    // Restore mp3on4 context pointer
-    avctx->priv_data = s;
-    s->mp3decctx[0]->adu_mode = 1; // Set adu mode
-
-    /* Create a separate codec/context for each frame (first is already ok).
-     * Each frame is 1 or 2 channels - up to 5 frames allowed
-     */
-    for (i = 1; i < s->frames; i++) {
-        s->mp3decctx[i] = av_mallocz(sizeof(MPADecodeContext));
-        if (!s->mp3decctx[i])
-            goto alloc_fail;
-        s->mp3decctx[i]->adu_mode = 1;
-        s->mp3decctx[i]->avctx = avctx;
-        s->mp3decctx[i]->mpadsp = s->mp3decctx[0]->mpadsp;
-    }
-
-    return 0;
-alloc_fail:
-    decode_close_mp3on4(avctx);
-    return AVERROR(ENOMEM);
-}
-
-
-static void flush_mp3on4(AVCodecContext *avctx)
-{
-    int i;
-    MP3On4DecodeContext *s = avctx->priv_data;
-
-    for (i = 0; i < s->frames; i++)
-        mp_flush(s->mp3decctx[i]);
-}
-
-
-static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame         = data;
-    const uint8_t *buf     = avpkt->data;
-    int buf_size           = avpkt->size;
-    MP3On4DecodeContext *s = avctx->priv_data;
-    MPADecodeContext *m;
-    int fsize, len = buf_size, out_size = 0;
-    uint32_t header;
-    OUT_INT **out_samples;
-    OUT_INT *outptr[2];
-    int fr, ch, ret;
-
-    /* get output buffer */
-    frame->nb_samples = MPA_FRAME_SIZE;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    out_samples = (OUT_INT **)frame->extended_data;
-
-    // Discard too short frames
-    if (buf_size < HEADER_SIZE)
-        return AVERROR_INVALIDDATA;
-
-    avctx->bit_rate = 0;
-
-    ch = 0;
-    for (fr = 0; fr < s->frames; fr++) {
-        fsize = AV_RB16(buf) >> 4;
-        fsize = FFMIN3(fsize, len, MPA_MAX_CODED_FRAME_SIZE);
-        m     = s->mp3decctx[fr];
-        assert(m != NULL);
-
-        if (fsize < HEADER_SIZE) {
-            av_log(avctx, AV_LOG_ERROR, "Frame size smaller than header size\n");
-            return AVERROR_INVALIDDATA;
-        }
-        header = (AV_RB32(buf) & 0x000fffff) | s->syncword; // patch header
-
-        if (ff_mpa_check_header(header) < 0) // Bad header, discard block
-            break;
-
-        avpriv_mpegaudio_decode_header((MPADecodeHeader *)m, header);
-
-        if (ch + m->nb_channels > avctx->channels ||
-            s->coff[fr] + m->nb_channels > avctx->channels) {
-            av_log(avctx, AV_LOG_ERROR, "frame channel count exceeds codec "
-                                        "channel count\n");
-            return AVERROR_INVALIDDATA;
-        }
-        ch += m->nb_channels;
-
-        outptr[0] = out_samples[s->coff[fr]];
-        if (m->nb_channels > 1)
-            outptr[1] = out_samples[s->coff[fr] + 1];
-
-        if ((ret = mp_decode_frame(m, outptr, buf, fsize)) < 0)
-            return ret;
-
-        out_size += ret;
-        buf      += fsize;
-        len      -= fsize;
-
-        avctx->bit_rate += m->bit_rate;
-    }
-
-    /* update codec info */
-    avctx->sample_rate = s->mp3decctx[0]->sample_rate;
-
-    frame->nb_samples = out_size / (avctx->channels * sizeof(OUT_INT));
-    *got_frame_ptr    = 1;
-
-    return buf_size;
-}
-#endif /* CONFIG_MP3ON4_DECODER || CONFIG_MP3ON4FLOAT_DECODER */
diff --git a/deps/libav/libavcodec/mpegaudiodecheader.c b/deps/libav/libavcodec/mpegaudiodecheader.c
deleted file mode 100644
index 69dda45..0000000
--- a/deps/libav/libavcodec/mpegaudiodecheader.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * MPEG Audio header decoder
- * Copyright (c) 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG Audio header decoder.
- */
-
-#include "avcodec.h"
-#include "mpegaudio.h"
-#include "mpegaudiodata.h"
-#include "mpegaudiodecheader.h"
-
-
-int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header)
-{
-    int sample_rate, frame_size, mpeg25, padding;
-    int sample_rate_index, bitrate_index;
-    if (header & (1<<20)) {
-        s->lsf = (header & (1<<19)) ? 0 : 1;
-        mpeg25 = 0;
-    } else {
-        s->lsf = 1;
-        mpeg25 = 1;
-    }
-
-    s->layer = 4 - ((header >> 17) & 3);
-    /* extract frequency */
-    sample_rate_index = (header >> 10) & 3;
-    sample_rate = avpriv_mpa_freq_tab[sample_rate_index] >> (s->lsf + mpeg25);
-    sample_rate_index += 3 * (s->lsf + mpeg25);
-    s->sample_rate_index = sample_rate_index;
-    s->error_protection = ((header >> 16) & 1) ^ 1;
-    s->sample_rate = sample_rate;
-
-    bitrate_index = (header >> 12) & 0xf;
-    padding = (header >> 9) & 1;
-    //extension = (header >> 8) & 1;
-    s->mode = (header >> 6) & 3;
-    s->mode_ext = (header >> 4) & 3;
-    //copyright = (header >> 3) & 1;
-    //original = (header >> 2) & 1;
-    //emphasis = header & 3;
-
-    if (s->mode == MPA_MONO)
-        s->nb_channels = 1;
-    else
-        s->nb_channels = 2;
-
-    if (bitrate_index != 0) {
-        frame_size = avpriv_mpa_bitrate_tab[s->lsf][s->layer - 1][bitrate_index];
-        s->bit_rate = frame_size * 1000;
-        switch(s->layer) {
-        case 1:
-            frame_size = (frame_size * 12000) / sample_rate;
-            frame_size = (frame_size + padding) * 4;
-            break;
-        case 2:
-            frame_size = (frame_size * 144000) / sample_rate;
-            frame_size += padding;
-            break;
-        default:
-        case 3:
-            frame_size = (frame_size * 144000) / (sample_rate << s->lsf);
-            frame_size += padding;
-            break;
-        }
-        s->frame_size = frame_size;
-    } else {
-        /* if no frame size computed, signal it */
-        return 1;
-    }
-
-#if defined(DEBUG)
-    av_dlog(NULL, "layer%d, %d Hz, %d kbits/s, ",
-           s->layer, s->sample_rate, s->bit_rate);
-    if (s->nb_channels == 2) {
-        if (s->layer == 3) {
-            if (s->mode_ext & MODE_EXT_MS_STEREO)
-                av_dlog(NULL, "ms-");
-            if (s->mode_ext & MODE_EXT_I_STEREO)
-                av_dlog(NULL, "i-");
-        }
-        av_dlog(NULL, "stereo");
-    } else {
-        av_dlog(NULL, "mono");
-    }
-    av_dlog(NULL, "\n");
-#endif
-    return 0;
-}
-
-int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate)
-{
-    MPADecodeHeader s1, *s = &s1;
-
-    if (ff_mpa_check_header(head) != 0)
-        return -1;
-
-    if (avpriv_mpegaudio_decode_header(s, head) != 0) {
-        return -1;
-    }
-
-    switch(s->layer) {
-    case 1:
-        avctx->codec_id = AV_CODEC_ID_MP1;
-        *frame_size = 384;
-        break;
-    case 2:
-        avctx->codec_id = AV_CODEC_ID_MP2;
-        *frame_size = 1152;
-        break;
-    default:
-    case 3:
-        avctx->codec_id = AV_CODEC_ID_MP3;
-        if (s->lsf)
-            *frame_size = 576;
-        else
-            *frame_size = 1152;
-        break;
-    }
-
-    *sample_rate = s->sample_rate;
-    *channels = s->nb_channels;
-    *bit_rate = s->bit_rate;
-    return s->frame_size;
-}
diff --git a/deps/libav/libavcodec/mpegaudiodecheader.h b/deps/libav/libavcodec/mpegaudiodecheader.h
deleted file mode 100644
index 764e8ab..0000000
--- a/deps/libav/libavcodec/mpegaudiodecheader.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * MPEG Audio header decoder
- * Copyright (c) 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MPEG Audio header decoder.
- */
-
-#ifndef AVCODEC_MPEGAUDIODECHEADER_H
-#define AVCODEC_MPEGAUDIODECHEADER_H
-
-#include "avcodec.h"
-
-#define MP3_MASK 0xFFFE0CCF
-
-#define MPA_DECODE_HEADER \
-    int frame_size; \
-    int error_protection; \
-    int layer; \
-    int sample_rate; \
-    int sample_rate_index; /* between 0 and 8 */ \
-    int bit_rate; \
-    int nb_channels; \
-    int mode; \
-    int mode_ext; \
-    int lsf;
-
-typedef struct MPADecodeHeader {
-  MPA_DECODE_HEADER
-} MPADecodeHeader;
-
-/* header decoding. MUST check the header before because no
-   consistency check is done there. Return 1 if free format found and
-   that the frame size must be computed externally */
-int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header);
-
-/* useful helper to get mpeg audio stream infos. Return -1 if error in
-   header, otherwise the coded frame size in bytes */
-int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate);
-
-/* fast header check for resync */
-static inline int ff_mpa_check_header(uint32_t header){
-    /* header */
-    if ((header & 0xffe00000) != 0xffe00000)
-        return -1;
-    /* layer check */
-    if ((header & (3<<17)) == 0)
-        return -1;
-    /* bit rate */
-    if ((header & (0xf<<12)) == 0xf<<12)
-        return -1;
-    /* frequency */
-    if ((header & (3<<10)) == 3<<10)
-        return -1;
-    return 0;
-}
-
-#endif /* AVCODEC_MPEGAUDIODECHEADER_H */
diff --git a/deps/libav/libavcodec/mpegaudiodectab.h b/deps/libav/libavcodec/mpegaudiodectab.h
deleted file mode 100644
index 1221657..0000000
--- a/deps/libav/libavcodec/mpegaudiodectab.h
+++ /dev/null
@@ -1,615 +0,0 @@
-/*
- * MPEG Audio decoder
- * copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * mpeg audio layer decoder tables.
- */
-
-#ifndef AVCODEC_MPEGAUDIODECTAB_H
-#define AVCODEC_MPEGAUDIODECTAB_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "mpegaudio.h"
-
-/*******************************************************/
-/* layer 3 tables */
-
-/* layer 3 huffman tables */
-typedef struct HuffTable {
-    int xsize;
-    const uint8_t *bits;
-    const uint16_t *codes;
-} HuffTable;
-
-/* layer3 scale factor size */
-static const uint8_t slen_table[2][16] = {
-    { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
-    { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 },
-};
-
-/* number of lsf scale factors for a given size */
-static const uint8_t lsf_nsf_table[6][3][4] = {
-    { {  6,  5,  5, 5 }, {  9,  9,  9, 9 }, {  6,  9,  9, 9 } },
-    { {  6,  5,  7, 3 }, {  9,  9, 12, 6 }, {  6,  9, 12, 6 } },
-    { { 11, 10,  0, 0 }, { 18, 18,  0, 0 }, { 15, 18,  0, 0 } },
-    { {  7,  7,  7, 0 }, { 12, 12, 12, 0 }, {  6, 15, 12, 0 } },
-    { {  6,  6,  6, 3 }, { 12,  9,  9, 6 }, {  6, 12,  9, 6 } },
-    { {  8,  8,  5, 0 }, { 15, 12,  9, 0 }, {  6, 18,  9, 0 } },
-};
-
-/* mpegaudio layer 3 huffman tables */
-
-static const uint16_t mpa_huffcodes_1[4] = {
- 0x0001, 0x0001, 0x0001, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_1[4] = {
-  1,  3,  2,  3,
-};
-
-static const uint16_t mpa_huffcodes_2[9] = {
- 0x0001, 0x0002, 0x0001, 0x0003, 0x0001, 0x0001, 0x0003, 0x0002,
- 0x0000,
-};
-
-static const uint8_t mpa_huffbits_2[9] = {
-  1,  3,  6,  3,  3,  5,  5,  5,
-  6,
-};
-
-static const uint16_t mpa_huffcodes_3[9] = {
- 0x0003, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0003, 0x0002,
- 0x0000,
-};
-
-static const uint8_t mpa_huffbits_3[9] = {
-  2,  2,  6,  3,  2,  5,  5,  5,
-  6,
-};
-
-static const uint16_t mpa_huffcodes_5[16] = {
- 0x0001, 0x0002, 0x0006, 0x0005, 0x0003, 0x0001, 0x0004, 0x0004,
- 0x0007, 0x0005, 0x0007, 0x0001, 0x0006, 0x0001, 0x0001, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_5[16] = {
-  1,  3,  6,  7,  3,  3,  6,  7,
-  6,  6,  7,  8,  7,  6,  7,  8,
-};
-
-static const uint16_t mpa_huffcodes_6[16] = {
- 0x0007, 0x0003, 0x0005, 0x0001, 0x0006, 0x0002, 0x0003, 0x0002,
- 0x0005, 0x0004, 0x0004, 0x0001, 0x0003, 0x0003, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_6[16] = {
-  3,  3,  5,  7,  3,  2,  4,  5,
-  4,  4,  5,  6,  6,  5,  6,  7,
-};
-
-static const uint16_t mpa_huffcodes_7[36] = {
- 0x0001, 0x0002, 0x000a, 0x0013, 0x0010, 0x000a, 0x0003, 0x0003,
- 0x0007, 0x000a, 0x0005, 0x0003, 0x000b, 0x0004, 0x000d, 0x0011,
- 0x0008, 0x0004, 0x000c, 0x000b, 0x0012, 0x000f, 0x000b, 0x0002,
- 0x0007, 0x0006, 0x0009, 0x000e, 0x0003, 0x0001, 0x0006, 0x0004,
- 0x0005, 0x0003, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_7[36] = {
-  1,  3,  6,  8,  8,  9,  3,  4,
-  6,  7,  7,  8,  6,  5,  7,  8,
-  8,  9,  7,  7,  8,  9,  9,  9,
-  7,  7,  8,  9,  9, 10,  8,  8,
-  9, 10, 10, 10,
-};
-
-static const uint16_t mpa_huffcodes_8[36] = {
- 0x0003, 0x0004, 0x0006, 0x0012, 0x000c, 0x0005, 0x0005, 0x0001,
- 0x0002, 0x0010, 0x0009, 0x0003, 0x0007, 0x0003, 0x0005, 0x000e,
- 0x0007, 0x0003, 0x0013, 0x0011, 0x000f, 0x000d, 0x000a, 0x0004,
- 0x000d, 0x0005, 0x0008, 0x000b, 0x0005, 0x0001, 0x000c, 0x0004,
- 0x0004, 0x0001, 0x0001, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_8[36] = {
-  2,  3,  6,  8,  8,  9,  3,  2,
-  4,  8,  8,  8,  6,  4,  6,  8,
-  8,  9,  8,  8,  8,  9,  9, 10,
-  8,  7,  8,  9, 10, 10,  9,  8,
-  9,  9, 11, 11,
-};
-
-static const uint16_t mpa_huffcodes_9[36] = {
- 0x0007, 0x0005, 0x0009, 0x000e, 0x000f, 0x0007, 0x0006, 0x0004,
- 0x0005, 0x0005, 0x0006, 0x0007, 0x0007, 0x0006, 0x0008, 0x0008,
- 0x0008, 0x0005, 0x000f, 0x0006, 0x0009, 0x000a, 0x0005, 0x0001,
- 0x000b, 0x0007, 0x0009, 0x0006, 0x0004, 0x0001, 0x000e, 0x0004,
- 0x0006, 0x0002, 0x0006, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_9[36] = {
-  3,  3,  5,  6,  8,  9,  3,  3,
-  4,  5,  6,  8,  4,  4,  5,  6,
-  7,  8,  6,  5,  6,  7,  7,  8,
-  7,  6,  7,  7,  8,  9,  8,  7,
-  8,  8,  9,  9,
-};
-
-static const uint16_t mpa_huffcodes_10[64] = {
- 0x0001, 0x0002, 0x000a, 0x0017, 0x0023, 0x001e, 0x000c, 0x0011,
- 0x0003, 0x0003, 0x0008, 0x000c, 0x0012, 0x0015, 0x000c, 0x0007,
- 0x000b, 0x0009, 0x000f, 0x0015, 0x0020, 0x0028, 0x0013, 0x0006,
- 0x000e, 0x000d, 0x0016, 0x0022, 0x002e, 0x0017, 0x0012, 0x0007,
- 0x0014, 0x0013, 0x0021, 0x002f, 0x001b, 0x0016, 0x0009, 0x0003,
- 0x001f, 0x0016, 0x0029, 0x001a, 0x0015, 0x0014, 0x0005, 0x0003,
- 0x000e, 0x000d, 0x000a, 0x000b, 0x0010, 0x0006, 0x0005, 0x0001,
- 0x0009, 0x0008, 0x0007, 0x0008, 0x0004, 0x0004, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_10[64] = {
-  1,  3,  6,  8,  9,  9,  9, 10,
-  3,  4,  6,  7,  8,  9,  8,  8,
-  6,  6,  7,  8,  9, 10,  9,  9,
-  7,  7,  8,  9, 10, 10,  9, 10,
-  8,  8,  9, 10, 10, 10, 10, 10,
-  9,  9, 10, 10, 11, 11, 10, 11,
-  8,  8,  9, 10, 10, 10, 11, 11,
-  9,  8,  9, 10, 10, 11, 11, 11,
-};
-
-static const uint16_t mpa_huffcodes_11[64] = {
- 0x0003, 0x0004, 0x000a, 0x0018, 0x0022, 0x0021, 0x0015, 0x000f,
- 0x0005, 0x0003, 0x0004, 0x000a, 0x0020, 0x0011, 0x000b, 0x000a,
- 0x000b, 0x0007, 0x000d, 0x0012, 0x001e, 0x001f, 0x0014, 0x0005,
- 0x0019, 0x000b, 0x0013, 0x003b, 0x001b, 0x0012, 0x000c, 0x0005,
- 0x0023, 0x0021, 0x001f, 0x003a, 0x001e, 0x0010, 0x0007, 0x0005,
- 0x001c, 0x001a, 0x0020, 0x0013, 0x0011, 0x000f, 0x0008, 0x000e,
- 0x000e, 0x000c, 0x0009, 0x000d, 0x000e, 0x0009, 0x0004, 0x0001,
- 0x000b, 0x0004, 0x0006, 0x0006, 0x0006, 0x0003, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_11[64] = {
-  2,  3,  5,  7,  8,  9,  8,  9,
-  3,  3,  4,  6,  8,  8,  7,  8,
-  5,  5,  6,  7,  8,  9,  8,  8,
-  7,  6,  7,  9,  8, 10,  8,  9,
-  8,  8,  8,  9,  9, 10,  9, 10,
-  8,  8,  9, 10, 10, 11, 10, 11,
-  8,  7,  7,  8,  9, 10, 10, 10,
-  8,  7,  8,  9, 10, 10, 10, 10,
-};
-
-static const uint16_t mpa_huffcodes_12[64] = {
- 0x0009, 0x0006, 0x0010, 0x0021, 0x0029, 0x0027, 0x0026, 0x001a,
- 0x0007, 0x0005, 0x0006, 0x0009, 0x0017, 0x0010, 0x001a, 0x000b,
- 0x0011, 0x0007, 0x000b, 0x000e, 0x0015, 0x001e, 0x000a, 0x0007,
- 0x0011, 0x000a, 0x000f, 0x000c, 0x0012, 0x001c, 0x000e, 0x0005,
- 0x0020, 0x000d, 0x0016, 0x0013, 0x0012, 0x0010, 0x0009, 0x0005,
- 0x0028, 0x0011, 0x001f, 0x001d, 0x0011, 0x000d, 0x0004, 0x0002,
- 0x001b, 0x000c, 0x000b, 0x000f, 0x000a, 0x0007, 0x0004, 0x0001,
- 0x001b, 0x000c, 0x0008, 0x000c, 0x0006, 0x0003, 0x0001, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_12[64] = {
-  4,  3,  5,  7,  8,  9,  9,  9,
-  3,  3,  4,  5,  7,  7,  8,  8,
-  5,  4,  5,  6,  7,  8,  7,  8,
-  6,  5,  6,  6,  7,  8,  8,  8,
-  7,  6,  7,  7,  8,  8,  8,  9,
-  8,  7,  8,  8,  8,  9,  8,  9,
-  8,  7,  7,  8,  8,  9,  9, 10,
-  9,  8,  8,  9,  9,  9,  9, 10,
-};
-
-static const uint16_t mpa_huffcodes_13[256] = {
- 0x0001, 0x0005, 0x000e, 0x0015, 0x0022, 0x0033, 0x002e, 0x0047,
- 0x002a, 0x0034, 0x0044, 0x0034, 0x0043, 0x002c, 0x002b, 0x0013,
- 0x0003, 0x0004, 0x000c, 0x0013, 0x001f, 0x001a, 0x002c, 0x0021,
- 0x001f, 0x0018, 0x0020, 0x0018, 0x001f, 0x0023, 0x0016, 0x000e,
- 0x000f, 0x000d, 0x0017, 0x0024, 0x003b, 0x0031, 0x004d, 0x0041,
- 0x001d, 0x0028, 0x001e, 0x0028, 0x001b, 0x0021, 0x002a, 0x0010,
- 0x0016, 0x0014, 0x0025, 0x003d, 0x0038, 0x004f, 0x0049, 0x0040,
- 0x002b, 0x004c, 0x0038, 0x0025, 0x001a, 0x001f, 0x0019, 0x000e,
- 0x0023, 0x0010, 0x003c, 0x0039, 0x0061, 0x004b, 0x0072, 0x005b,
- 0x0036, 0x0049, 0x0037, 0x0029, 0x0030, 0x0035, 0x0017, 0x0018,
- 0x003a, 0x001b, 0x0032, 0x0060, 0x004c, 0x0046, 0x005d, 0x0054,
- 0x004d, 0x003a, 0x004f, 0x001d, 0x004a, 0x0031, 0x0029, 0x0011,
- 0x002f, 0x002d, 0x004e, 0x004a, 0x0073, 0x005e, 0x005a, 0x004f,
- 0x0045, 0x0053, 0x0047, 0x0032, 0x003b, 0x0026, 0x0024, 0x000f,
- 0x0048, 0x0022, 0x0038, 0x005f, 0x005c, 0x0055, 0x005b, 0x005a,
- 0x0056, 0x0049, 0x004d, 0x0041, 0x0033, 0x002c, 0x002b, 0x002a,
- 0x002b, 0x0014, 0x001e, 0x002c, 0x0037, 0x004e, 0x0048, 0x0057,
- 0x004e, 0x003d, 0x002e, 0x0036, 0x0025, 0x001e, 0x0014, 0x0010,
- 0x0035, 0x0019, 0x0029, 0x0025, 0x002c, 0x003b, 0x0036, 0x0051,
- 0x0042, 0x004c, 0x0039, 0x0036, 0x0025, 0x0012, 0x0027, 0x000b,
- 0x0023, 0x0021, 0x001f, 0x0039, 0x002a, 0x0052, 0x0048, 0x0050,
- 0x002f, 0x003a, 0x0037, 0x0015, 0x0016, 0x001a, 0x0026, 0x0016,
- 0x0035, 0x0019, 0x0017, 0x0026, 0x0046, 0x003c, 0x0033, 0x0024,
- 0x0037, 0x001a, 0x0022, 0x0017, 0x001b, 0x000e, 0x0009, 0x0007,
- 0x0022, 0x0020, 0x001c, 0x0027, 0x0031, 0x004b, 0x001e, 0x0034,
- 0x0030, 0x0028, 0x0034, 0x001c, 0x0012, 0x0011, 0x0009, 0x0005,
- 0x002d, 0x0015, 0x0022, 0x0040, 0x0038, 0x0032, 0x0031, 0x002d,
- 0x001f, 0x0013, 0x000c, 0x000f, 0x000a, 0x0007, 0x0006, 0x0003,
- 0x0030, 0x0017, 0x0014, 0x0027, 0x0024, 0x0023, 0x0035, 0x0015,
- 0x0010, 0x0017, 0x000d, 0x000a, 0x0006, 0x0001, 0x0004, 0x0002,
- 0x0010, 0x000f, 0x0011, 0x001b, 0x0019, 0x0014, 0x001d, 0x000b,
- 0x0011, 0x000c, 0x0010, 0x0008, 0x0001, 0x0001, 0x0000, 0x0001,
-};
-
-static const uint8_t mpa_huffbits_13[256] = {
-  1,  4,  6,  7,  8,  9,  9, 10,
-  9, 10, 11, 11, 12, 12, 13, 13,
-  3,  4,  6,  7,  8,  8,  9,  9,
-  9,  9, 10, 10, 11, 12, 12, 12,
-  6,  6,  7,  8,  9,  9, 10, 10,
-  9, 10, 10, 11, 11, 12, 13, 13,
-  7,  7,  8,  9,  9, 10, 10, 10,
- 10, 11, 11, 11, 11, 12, 13, 13,
-  8,  7,  9,  9, 10, 10, 11, 11,
- 10, 11, 11, 12, 12, 13, 13, 14,
-  9,  8,  9, 10, 10, 10, 11, 11,
- 11, 11, 12, 11, 13, 13, 14, 14,
-  9,  9, 10, 10, 11, 11, 11, 11,
- 11, 12, 12, 12, 13, 13, 14, 14,
- 10,  9, 10, 11, 11, 11, 12, 12,
- 12, 12, 13, 13, 13, 14, 16, 16,
-  9,  8,  9, 10, 10, 11, 11, 12,
- 12, 12, 12, 13, 13, 14, 15, 15,
- 10,  9, 10, 10, 11, 11, 11, 13,
- 12, 13, 13, 14, 14, 14, 16, 15,
- 10, 10, 10, 11, 11, 12, 12, 13,
- 12, 13, 14, 13, 14, 15, 16, 17,
- 11, 10, 10, 11, 12, 12, 12, 12,
- 13, 13, 13, 14, 15, 15, 15, 16,
- 11, 11, 11, 12, 12, 13, 12, 13,
- 14, 14, 15, 15, 15, 16, 16, 16,
- 12, 11, 12, 13, 13, 13, 14, 14,
- 14, 14, 14, 15, 16, 15, 16, 16,
- 13, 12, 12, 13, 13, 13, 15, 14,
- 14, 17, 15, 15, 15, 17, 16, 16,
- 12, 12, 13, 14, 14, 14, 15, 14,
- 15, 15, 16, 16, 19, 18, 19, 16,
-};
-
-static const uint16_t mpa_huffcodes_15[256] = {
- 0x0007, 0x000c, 0x0012, 0x0035, 0x002f, 0x004c, 0x007c, 0x006c,
- 0x0059, 0x007b, 0x006c, 0x0077, 0x006b, 0x0051, 0x007a, 0x003f,
- 0x000d, 0x0005, 0x0010, 0x001b, 0x002e, 0x0024, 0x003d, 0x0033,
- 0x002a, 0x0046, 0x0034, 0x0053, 0x0041, 0x0029, 0x003b, 0x0024,
- 0x0013, 0x0011, 0x000f, 0x0018, 0x0029, 0x0022, 0x003b, 0x0030,
- 0x0028, 0x0040, 0x0032, 0x004e, 0x003e, 0x0050, 0x0038, 0x0021,
- 0x001d, 0x001c, 0x0019, 0x002b, 0x0027, 0x003f, 0x0037, 0x005d,
- 0x004c, 0x003b, 0x005d, 0x0048, 0x0036, 0x004b, 0x0032, 0x001d,
- 0x0034, 0x0016, 0x002a, 0x0028, 0x0043, 0x0039, 0x005f, 0x004f,
- 0x0048, 0x0039, 0x0059, 0x0045, 0x0031, 0x0042, 0x002e, 0x001b,
- 0x004d, 0x0025, 0x0023, 0x0042, 0x003a, 0x0034, 0x005b, 0x004a,
- 0x003e, 0x0030, 0x004f, 0x003f, 0x005a, 0x003e, 0x0028, 0x0026,
- 0x007d, 0x0020, 0x003c, 0x0038, 0x0032, 0x005c, 0x004e, 0x0041,
- 0x0037, 0x0057, 0x0047, 0x0033, 0x0049, 0x0033, 0x0046, 0x001e,
- 0x006d, 0x0035, 0x0031, 0x005e, 0x0058, 0x004b, 0x0042, 0x007a,
- 0x005b, 0x0049, 0x0038, 0x002a, 0x0040, 0x002c, 0x0015, 0x0019,
- 0x005a, 0x002b, 0x0029, 0x004d, 0x0049, 0x003f, 0x0038, 0x005c,
- 0x004d, 0x0042, 0x002f, 0x0043, 0x0030, 0x0035, 0x0024, 0x0014,
- 0x0047, 0x0022, 0x0043, 0x003c, 0x003a, 0x0031, 0x0058, 0x004c,
- 0x0043, 0x006a, 0x0047, 0x0036, 0x0026, 0x0027, 0x0017, 0x000f,
- 0x006d, 0x0035, 0x0033, 0x002f, 0x005a, 0x0052, 0x003a, 0x0039,
- 0x0030, 0x0048, 0x0039, 0x0029, 0x0017, 0x001b, 0x003e, 0x0009,
- 0x0056, 0x002a, 0x0028, 0x0025, 0x0046, 0x0040, 0x0034, 0x002b,
- 0x0046, 0x0037, 0x002a, 0x0019, 0x001d, 0x0012, 0x000b, 0x000b,
- 0x0076, 0x0044, 0x001e, 0x0037, 0x0032, 0x002e, 0x004a, 0x0041,
- 0x0031, 0x0027, 0x0018, 0x0010, 0x0016, 0x000d, 0x000e, 0x0007,
- 0x005b, 0x002c, 0x0027, 0x0026, 0x0022, 0x003f, 0x0034, 0x002d,
- 0x001f, 0x0034, 0x001c, 0x0013, 0x000e, 0x0008, 0x0009, 0x0003,
- 0x007b, 0x003c, 0x003a, 0x0035, 0x002f, 0x002b, 0x0020, 0x0016,
- 0x0025, 0x0018, 0x0011, 0x000c, 0x000f, 0x000a, 0x0002, 0x0001,
- 0x0047, 0x0025, 0x0022, 0x001e, 0x001c, 0x0014, 0x0011, 0x001a,
- 0x0015, 0x0010, 0x000a, 0x0006, 0x0008, 0x0006, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_15[256] = {
-  3,  4,  5,  7,  7,  8,  9,  9,
-  9, 10, 10, 11, 11, 11, 12, 13,
-  4,  3,  5,  6,  7,  7,  8,  8,
-  8,  9,  9, 10, 10, 10, 11, 11,
-  5,  5,  5,  6,  7,  7,  8,  8,
-  8,  9,  9, 10, 10, 11, 11, 11,
-  6,  6,  6,  7,  7,  8,  8,  9,
-  9,  9, 10, 10, 10, 11, 11, 11,
-  7,  6,  7,  7,  8,  8,  9,  9,
-  9,  9, 10, 10, 10, 11, 11, 11,
-  8,  7,  7,  8,  8,  8,  9,  9,
-  9,  9, 10, 10, 11, 11, 11, 12,
-  9,  7,  8,  8,  8,  9,  9,  9,
-  9, 10, 10, 10, 11, 11, 12, 12,
-  9,  8,  8,  9,  9,  9,  9, 10,
- 10, 10, 10, 10, 11, 11, 11, 12,
-  9,  8,  8,  9,  9,  9,  9, 10,
- 10, 10, 10, 11, 11, 12, 12, 12,
-  9,  8,  9,  9,  9,  9, 10, 10,
- 10, 11, 11, 11, 11, 12, 12, 12,
- 10,  9,  9,  9, 10, 10, 10, 10,
- 10, 11, 11, 11, 11, 12, 13, 12,
- 10,  9,  9,  9, 10, 10, 10, 10,
- 11, 11, 11, 11, 12, 12, 12, 13,
- 11, 10,  9, 10, 10, 10, 11, 11,
- 11, 11, 11, 11, 12, 12, 13, 13,
- 11, 10, 10, 10, 10, 11, 11, 11,
- 11, 12, 12, 12, 12, 12, 13, 13,
- 12, 11, 11, 11, 11, 11, 11, 11,
- 12, 12, 12, 12, 13, 13, 12, 13,
- 12, 11, 11, 11, 11, 11, 11, 12,
- 12, 12, 12, 12, 13, 13, 13, 13,
-};
-
-static const uint16_t mpa_huffcodes_16[256] = {
- 0x0001, 0x0005, 0x000e, 0x002c, 0x004a, 0x003f, 0x006e, 0x005d,
- 0x00ac, 0x0095, 0x008a, 0x00f2, 0x00e1, 0x00c3, 0x0178, 0x0011,
- 0x0003, 0x0004, 0x000c, 0x0014, 0x0023, 0x003e, 0x0035, 0x002f,
- 0x0053, 0x004b, 0x0044, 0x0077, 0x00c9, 0x006b, 0x00cf, 0x0009,
- 0x000f, 0x000d, 0x0017, 0x0026, 0x0043, 0x003a, 0x0067, 0x005a,
- 0x00a1, 0x0048, 0x007f, 0x0075, 0x006e, 0x00d1, 0x00ce, 0x0010,
- 0x002d, 0x0015, 0x0027, 0x0045, 0x0040, 0x0072, 0x0063, 0x0057,
- 0x009e, 0x008c, 0x00fc, 0x00d4, 0x00c7, 0x0183, 0x016d, 0x001a,
- 0x004b, 0x0024, 0x0044, 0x0041, 0x0073, 0x0065, 0x00b3, 0x00a4,
- 0x009b, 0x0108, 0x00f6, 0x00e2, 0x018b, 0x017e, 0x016a, 0x0009,
- 0x0042, 0x001e, 0x003b, 0x0038, 0x0066, 0x00b9, 0x00ad, 0x0109,
- 0x008e, 0x00fd, 0x00e8, 0x0190, 0x0184, 0x017a, 0x01bd, 0x0010,
- 0x006f, 0x0036, 0x0034, 0x0064, 0x00b8, 0x00b2, 0x00a0, 0x0085,
- 0x0101, 0x00f4, 0x00e4, 0x00d9, 0x0181, 0x016e, 0x02cb, 0x000a,
- 0x0062, 0x0030, 0x005b, 0x0058, 0x00a5, 0x009d, 0x0094, 0x0105,
- 0x00f8, 0x0197, 0x018d, 0x0174, 0x017c, 0x0379, 0x0374, 0x0008,
- 0x0055, 0x0054, 0x0051, 0x009f, 0x009c, 0x008f, 0x0104, 0x00f9,
- 0x01ab, 0x0191, 0x0188, 0x017f, 0x02d7, 0x02c9, 0x02c4, 0x0007,
- 0x009a, 0x004c, 0x0049, 0x008d, 0x0083, 0x0100, 0x00f5, 0x01aa,
- 0x0196, 0x018a, 0x0180, 0x02df, 0x0167, 0x02c6, 0x0160, 0x000b,
- 0x008b, 0x0081, 0x0043, 0x007d, 0x00f7, 0x00e9, 0x00e5, 0x00db,
- 0x0189, 0x02e7, 0x02e1, 0x02d0, 0x0375, 0x0372, 0x01b7, 0x0004,
- 0x00f3, 0x0078, 0x0076, 0x0073, 0x00e3, 0x00df, 0x018c, 0x02ea,
- 0x02e6, 0x02e0, 0x02d1, 0x02c8, 0x02c2, 0x00df, 0x01b4, 0x0006,
- 0x00ca, 0x00e0, 0x00de, 0x00da, 0x00d8, 0x0185, 0x0182, 0x017d,
- 0x016c, 0x0378, 0x01bb, 0x02c3, 0x01b8, 0x01b5, 0x06c0, 0x0004,
- 0x02eb, 0x00d3, 0x00d2, 0x00d0, 0x0172, 0x017b, 0x02de, 0x02d3,
- 0x02ca, 0x06c7, 0x0373, 0x036d, 0x036c, 0x0d83, 0x0361, 0x0002,
- 0x0179, 0x0171, 0x0066, 0x00bb, 0x02d6, 0x02d2, 0x0166, 0x02c7,
- 0x02c5, 0x0362, 0x06c6, 0x0367, 0x0d82, 0x0366, 0x01b2, 0x0000,
- 0x000c, 0x000a, 0x0007, 0x000b, 0x000a, 0x0011, 0x000b, 0x0009,
- 0x000d, 0x000c, 0x000a, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003,
-};
-
-static const uint8_t mpa_huffbits_16[256] = {
-  1,  4,  6,  8,  9,  9, 10, 10,
- 11, 11, 11, 12, 12, 12, 13,  9,
-  3,  4,  6,  7,  8,  9,  9,  9,
- 10, 10, 10, 11, 12, 11, 12,  8,
-  6,  6,  7,  8,  9,  9, 10, 10,
- 11, 10, 11, 11, 11, 12, 12,  9,
-  8,  7,  8,  9,  9, 10, 10, 10,
- 11, 11, 12, 12, 12, 13, 13, 10,
-  9,  8,  9,  9, 10, 10, 11, 11,
- 11, 12, 12, 12, 13, 13, 13,  9,
-  9,  8,  9,  9, 10, 11, 11, 12,
- 11, 12, 12, 13, 13, 13, 14, 10,
- 10,  9,  9, 10, 11, 11, 11, 11,
- 12, 12, 12, 12, 13, 13, 14, 10,
- 10,  9, 10, 10, 11, 11, 11, 12,
- 12, 13, 13, 13, 13, 15, 15, 10,
- 10, 10, 10, 11, 11, 11, 12, 12,
- 13, 13, 13, 13, 14, 14, 14, 10,
- 11, 10, 10, 11, 11, 12, 12, 13,
- 13, 13, 13, 14, 13, 14, 13, 11,
- 11, 11, 10, 11, 12, 12, 12, 12,
- 13, 14, 14, 14, 15, 15, 14, 10,
- 12, 11, 11, 11, 12, 12, 13, 14,
- 14, 14, 14, 14, 14, 13, 14, 11,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 15, 14, 14, 14, 14, 16, 11,
- 14, 12, 12, 12, 13, 13, 14, 14,
- 14, 16, 15, 15, 15, 17, 15, 11,
- 13, 13, 11, 12, 14, 14, 13, 14,
- 14, 15, 16, 15, 17, 15, 14, 11,
-  9,  8,  8,  9,  9, 10, 10, 10,
- 11, 11, 11, 11, 11, 11, 11,  8,
-};
-
-static const uint16_t mpa_huffcodes_24[256] = {
- 0x000f, 0x000d, 0x002e, 0x0050, 0x0092, 0x0106, 0x00f8, 0x01b2,
- 0x01aa, 0x029d, 0x028d, 0x0289, 0x026d, 0x0205, 0x0408, 0x0058,
- 0x000e, 0x000c, 0x0015, 0x0026, 0x0047, 0x0082, 0x007a, 0x00d8,
- 0x00d1, 0x00c6, 0x0147, 0x0159, 0x013f, 0x0129, 0x0117, 0x002a,
- 0x002f, 0x0016, 0x0029, 0x004a, 0x0044, 0x0080, 0x0078, 0x00dd,
- 0x00cf, 0x00c2, 0x00b6, 0x0154, 0x013b, 0x0127, 0x021d, 0x0012,
- 0x0051, 0x0027, 0x004b, 0x0046, 0x0086, 0x007d, 0x0074, 0x00dc,
- 0x00cc, 0x00be, 0x00b2, 0x0145, 0x0137, 0x0125, 0x010f, 0x0010,
- 0x0093, 0x0048, 0x0045, 0x0087, 0x007f, 0x0076, 0x0070, 0x00d2,
- 0x00c8, 0x00bc, 0x0160, 0x0143, 0x0132, 0x011d, 0x021c, 0x000e,
- 0x0107, 0x0042, 0x0081, 0x007e, 0x0077, 0x0072, 0x00d6, 0x00ca,
- 0x00c0, 0x00b4, 0x0155, 0x013d, 0x012d, 0x0119, 0x0106, 0x000c,
- 0x00f9, 0x007b, 0x0079, 0x0075, 0x0071, 0x00d7, 0x00ce, 0x00c3,
- 0x00b9, 0x015b, 0x014a, 0x0134, 0x0123, 0x0110, 0x0208, 0x000a,
- 0x01b3, 0x0073, 0x006f, 0x006d, 0x00d3, 0x00cb, 0x00c4, 0x00bb,
- 0x0161, 0x014c, 0x0139, 0x012a, 0x011b, 0x0213, 0x017d, 0x0011,
- 0x01ab, 0x00d4, 0x00d0, 0x00cd, 0x00c9, 0x00c1, 0x00ba, 0x00b1,
- 0x00a9, 0x0140, 0x012f, 0x011e, 0x010c, 0x0202, 0x0179, 0x0010,
- 0x014f, 0x00c7, 0x00c5, 0x00bf, 0x00bd, 0x00b5, 0x00ae, 0x014d,
- 0x0141, 0x0131, 0x0121, 0x0113, 0x0209, 0x017b, 0x0173, 0x000b,
- 0x029c, 0x00b8, 0x00b7, 0x00b3, 0x00af, 0x0158, 0x014b, 0x013a,
- 0x0130, 0x0122, 0x0115, 0x0212, 0x017f, 0x0175, 0x016e, 0x000a,
- 0x028c, 0x015a, 0x00ab, 0x00a8, 0x00a4, 0x013e, 0x0135, 0x012b,
- 0x011f, 0x0114, 0x0107, 0x0201, 0x0177, 0x0170, 0x016a, 0x0006,
- 0x0288, 0x0142, 0x013c, 0x0138, 0x0133, 0x012e, 0x0124, 0x011c,
- 0x010d, 0x0105, 0x0200, 0x0178, 0x0172, 0x016c, 0x0167, 0x0004,
- 0x026c, 0x012c, 0x0128, 0x0126, 0x0120, 0x011a, 0x0111, 0x010a,
- 0x0203, 0x017c, 0x0176, 0x0171, 0x016d, 0x0169, 0x0165, 0x0002,
- 0x0409, 0x0118, 0x0116, 0x0112, 0x010b, 0x0108, 0x0103, 0x017e,
- 0x017a, 0x0174, 0x016f, 0x016b, 0x0168, 0x0166, 0x0164, 0x0000,
- 0x002b, 0x0014, 0x0013, 0x0011, 0x000f, 0x000d, 0x000b, 0x0009,
- 0x0007, 0x0006, 0x0004, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003,
-};
-
-static const uint8_t mpa_huffbits_24[256] = {
-  4,  4,  6,  7,  8,  9,  9, 10,
- 10, 11, 11, 11, 11, 11, 12,  9,
-  4,  4,  5,  6,  7,  8,  8,  9,
-  9,  9, 10, 10, 10, 10, 10,  8,
-  6,  5,  6,  7,  7,  8,  8,  9,
-  9,  9,  9, 10, 10, 10, 11,  7,
-  7,  6,  7,  7,  8,  8,  8,  9,
-  9,  9,  9, 10, 10, 10, 10,  7,
-  8,  7,  7,  8,  8,  8,  8,  9,
-  9,  9, 10, 10, 10, 10, 11,  7,
-  9,  7,  8,  8,  8,  8,  9,  9,
-  9,  9, 10, 10, 10, 10, 10,  7,
-  9,  8,  8,  8,  8,  9,  9,  9,
-  9, 10, 10, 10, 10, 10, 11,  7,
- 10,  8,  8,  8,  9,  9,  9,  9,
- 10, 10, 10, 10, 10, 11, 11,  8,
- 10,  9,  9,  9,  9,  9,  9,  9,
-  9, 10, 10, 10, 10, 11, 11,  8,
- 10,  9,  9,  9,  9,  9,  9, 10,
- 10, 10, 10, 10, 11, 11, 11,  8,
- 11,  9,  9,  9,  9, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 11,  8,
- 11, 10,  9,  9,  9, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 11,  8,
- 11, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 11, 11, 11, 11, 11,  8,
- 11, 10, 10, 10, 10, 10, 10, 10,
- 11, 11, 11, 11, 11, 11, 11,  8,
- 12, 10, 10, 10, 10, 10, 10, 11,
- 11, 11, 11, 11, 11, 11, 11,  8,
-  8,  7,  7,  7,  7,  7,  7,  7,
-  7,  7,  7,  8,  8,  8,  8,  4,
-};
-
-static const HuffTable mpa_huff_tables[16] = {
-{ 1, NULL, NULL },
-{ 2, mpa_huffbits_1, mpa_huffcodes_1 },
-{ 3, mpa_huffbits_2, mpa_huffcodes_2 },
-{ 3, mpa_huffbits_3, mpa_huffcodes_3 },
-{ 4, mpa_huffbits_5, mpa_huffcodes_5 },
-{ 4, mpa_huffbits_6, mpa_huffcodes_6 },
-{ 6, mpa_huffbits_7, mpa_huffcodes_7 },
-{ 6, mpa_huffbits_8, mpa_huffcodes_8 },
-{ 6, mpa_huffbits_9, mpa_huffcodes_9 },
-{ 8, mpa_huffbits_10, mpa_huffcodes_10 },
-{ 8, mpa_huffbits_11, mpa_huffcodes_11 },
-{ 8, mpa_huffbits_12, mpa_huffcodes_12 },
-{ 16, mpa_huffbits_13, mpa_huffcodes_13 },
-{ 16, mpa_huffbits_15, mpa_huffcodes_15 },
-{ 16, mpa_huffbits_16, mpa_huffcodes_16 },
-{ 16, mpa_huffbits_24, mpa_huffcodes_24 },
-};
-
-static const uint8_t mpa_huff_data[32][2] = {
-{ 0, 0 },
-{ 1, 0 },
-{ 2, 0 },
-{ 3, 0 },
-{ 0, 0 },
-{ 4, 0 },
-{ 5, 0 },
-{ 6, 0 },
-{ 7, 0 },
-{ 8, 0 },
-{ 9, 0 },
-{ 10, 0 },
-{ 11, 0 },
-{ 12, 0 },
-{ 0, 0 },
-{ 13, 0 },
-{ 14, 1 },
-{ 14, 2 },
-{ 14, 3 },
-{ 14, 4 },
-{ 14, 6 },
-{ 14, 8 },
-{ 14, 10 },
-{ 14, 13 },
-{ 15, 4 },
-{ 15, 5 },
-{ 15, 6 },
-{ 15, 7 },
-{ 15, 8 },
-{ 15, 9 },
-{ 15, 11 },
-{ 15, 13 },
-};
-
-
-/* huffman tables for quadrules */
-static const uint8_t mpa_quad_codes[2][16] = {
-    {  1,  5,  4,  5,  6,  5,  4,  4, 7,  3,  6,  0,  7,  2,  3,  1, },
-    { 15, 14, 13, 12, 11, 10,  9,  8, 7,  6,  5,  4,  3,  2,  1,  0, },
-};
-
-static const uint8_t mpa_quad_bits[2][16] = {
-    { 1, 4, 4, 5, 4, 6, 5, 6, 4, 5, 5, 6, 5, 6, 6, 6, },
-    { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
-};
-
-/* band size tables */
-static const uint8_t band_size_long[9][22] = {
-{ 4, 4, 4, 4, 4, 4, 6, 6, 8, 8, 10,
-  12, 16, 20, 24, 28, 34, 42, 50, 54, 76, 158, }, /* 44100 */
-{ 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 10,
-  12, 16, 18, 22, 28, 34, 40, 46, 54, 54, 192, }, /* 48000 */
-{ 4, 4, 4, 4, 4, 4, 6, 6, 8, 10, 12,
-  16, 20, 24, 30, 38, 46, 56, 68, 84, 102, 26, }, /* 32000 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
-  20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 22050 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
-  18, 22, 26, 32, 38, 46, 52, 64, 70, 76, 36, }, /* 24000 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
-  20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 16000 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
-  20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 11025 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
-  20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 12000 */
-{ 12, 12, 12, 12, 12, 12, 16, 20, 24, 28, 32,
-  40, 48, 56, 64, 76, 90, 2, 2, 2, 2, 2, }, /* 8000 */
-};
-
-static const uint8_t band_size_short[9][13] = {
-{ 4, 4, 4, 4, 6, 8, 10, 12, 14, 18, 22, 30, 56, }, /* 44100 */
-{ 4, 4, 4, 4, 6, 6, 10, 12, 14, 16, 20, 26, 66, }, /* 48000 */
-{ 4, 4, 4, 4, 6, 8, 12, 16, 20, 26, 34, 42, 12, }, /* 32000 */
-{ 4, 4, 4, 6, 6, 8, 10, 14, 18, 26, 32, 42, 18, }, /* 22050 */
-{ 4, 4, 4, 6, 8, 10, 12, 14, 18, 24, 32, 44, 12, }, /* 24000 */
-{ 4, 4, 4, 6, 8, 10, 12, 14, 18, 24, 30, 40, 18, }, /* 16000 */
-{ 4, 4, 4, 6, 8, 10, 12, 14, 18, 24, 30, 40, 18, }, /* 11025 */
-{ 4, 4, 4, 6, 8, 10, 12, 14, 18, 24, 30, 40, 18, }, /* 12000 */
-{ 8, 8, 8, 12, 16, 20, 24, 28, 36, 2, 2, 2, 26, }, /* 8000 */
-};
-
-static const uint8_t mpa_pretab[2][22] = {
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0 },
-};
-
-/* table for alias reduction (XXX: store it as integer !) */
-static const float ci_table[8] = {
-    -0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, -0.0037,
-};
-
-#endif /* AVCODEC_MPEGAUDIODECTAB_H */
diff --git a/deps/libav/libavcodec/mpegaudiodsp.c b/deps/libav/libavcodec/mpegaudiodsp.c
deleted file mode 100644
index 342ed16..0000000
--- a/deps/libav/libavcodec/mpegaudiodsp.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "mpegaudiodsp.h"
-#include "dct.h"
-#include "dct32.h"
-
-av_cold void ff_mpadsp_init(MPADSPContext *s)
-{
-    DCTContext dct;
-
-    ff_dct_init(&dct, 5, DCT_II);
-    ff_init_mpadsp_tabs_float();
-    ff_init_mpadsp_tabs_fixed();
-
-    s->apply_window_float = ff_mpadsp_apply_window_float;
-    s->apply_window_fixed = ff_mpadsp_apply_window_fixed;
-
-    s->dct32_float = dct.dct32;
-    s->dct32_fixed = ff_dct32_fixed;
-
-    s->imdct36_blocks_float = ff_imdct36_blocks_float;
-    s->imdct36_blocks_fixed = ff_imdct36_blocks_fixed;
-
-    if (ARCH_ARM)     ff_mpadsp_init_arm(s);
-    if (ARCH_PPC)     ff_mpadsp_init_ppc(s);
-    if (ARCH_X86)     ff_mpadsp_init_x86(s);
-}
diff --git a/deps/libav/libavcodec/mpegaudiodsp.h b/deps/libav/libavcodec/mpegaudiodsp.h
deleted file mode 100644
index d6aa3f5..0000000
--- a/deps/libav/libavcodec/mpegaudiodsp.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MPEGAUDIODSP_H
-#define AVCODEC_MPEGAUDIODSP_H
-
-#include <stdint.h>
-#include "libavutil/common.h"
-
-typedef struct MPADSPContext {
-    void (*apply_window_float)(float *synth_buf, float *window,
-                               int *dither_state, float *samples, int incr);
-    void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
-                               int *dither_state, int16_t *samples, int incr);
-    void (*dct32_float)(float *dst, const float *src);
-    void (*dct32_fixed)(int *dst, const int *src);
-    void (*imdct36_blocks_float)(float *out, float *buf, float *in,
-                                 int count, int switch_point, int block_type);
-    void (*imdct36_blocks_fixed)(int *out, int *buf, int *in,
-                                 int count, int switch_point, int block_type);
-} MPADSPContext;
-
-void ff_mpadsp_init(MPADSPContext *s);
-
-extern int32_t ff_mpa_synth_window_fixed[];
-extern float   ff_mpa_synth_window_float[];
-
-extern const int32_t ff_mpa_enwindow[257];
-
-void ff_mpa_synth_filter_fixed(MPADSPContext *s,
-                               int32_t *synth_buf_ptr, int *synth_buf_offset,
-                               int32_t *window, int *dither_state,
-                               int16_t *samples, int incr,
-                               int32_t *sb_samples);
-
-void ff_mpa_synth_filter_float(MPADSPContext *s,
-                               float *synth_buf_ptr, int *synth_buf_offset,
-                               float *window, int *dither_state,
-                               float *samples, int incr,
-                               float *sb_samples);
-
-void ff_mpadsp_init_arm(MPADSPContext *s);
-void ff_mpadsp_init_ppc(MPADSPContext *s);
-void ff_mpadsp_init_x86(MPADSPContext *s);
-
-void ff_mpa_synth_init_float(float *window);
-void ff_mpa_synth_init_fixed(int32_t *window);
-
-void ff_mpadsp_apply_window_float(float *synth_buf, float *window,
-                                  int *dither_state, float *samples,
-                                  int incr);
-void ff_mpadsp_apply_window_fixed(int32_t *synth_buf, int32_t *window,
-                                  int *dither_state, int16_t *samples,
-                                  int incr);
-
-void ff_imdct36_blocks_float(float *out, float *buf, float *in,
-                             int count, int switch_point, int block_type);
-
-void ff_imdct36_blocks_fixed(int *out, int *buf, int *in,
-                             int count, int switch_point, int block_type);
-
-void ff_init_mpadsp_tabs_float(void);
-void ff_init_mpadsp_tabs_fixed(void);
-
-/** For SSE implementation, MDCT_BUF_SIZE/2 should be 128-bit aligned */
-#define MDCT_BUF_SIZE FFALIGN(36, 2*4)
-
-extern int ff_mdct_win_fixed[8][MDCT_BUF_SIZE];
-extern float ff_mdct_win_float[8][MDCT_BUF_SIZE];
-
-#endif /* AVCODEC_MPEGAUDIODSP_H */
diff --git a/deps/libav/libavcodec/mpegaudiodsp_data.c b/deps/libav/libavcodec/mpegaudiodsp_data.c
deleted file mode 100644
index 5cf86b8..0000000
--- a/deps/libav/libavcodec/mpegaudiodsp_data.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "mpegaudiodsp.h"
-
-/* half mpeg encoding window (full precision) */
-const int32_t ff_mpa_enwindow[257] = {
-     0,    -1,    -1,    -1,    -1,    -1,    -1,    -2,
-    -2,    -2,    -2,    -3,    -3,    -4,    -4,    -5,
-    -5,    -6,    -7,    -7,    -8,    -9,   -10,   -11,
-   -13,   -14,   -16,   -17,   -19,   -21,   -24,   -26,
-   -29,   -31,   -35,   -38,   -41,   -45,   -49,   -53,
-   -58,   -63,   -68,   -73,   -79,   -85,   -91,   -97,
-  -104,  -111,  -117,  -125,  -132,  -139,  -147,  -154,
-  -161,  -169,  -176,  -183,  -190,  -196,  -202,  -208,
-   213,   218,   222,   225,   227,   228,   228,   227,
-   224,   221,   215,   208,   200,   189,   177,   163,
-   146,   127,   106,    83,    57,    29,    -2,   -36,
-   -72,  -111,  -153,  -197,  -244,  -294,  -347,  -401,
-  -459,  -519,  -581,  -645,  -711,  -779,  -848,  -919,
-  -991, -1064, -1137, -1210, -1283, -1356, -1428, -1498,
- -1567, -1634, -1698, -1759, -1817, -1870, -1919, -1962,
- -2001, -2032, -2057, -2075, -2085, -2087, -2080, -2063,
-  2037,  2000,  1952,  1893,  1822,  1739,  1644,  1535,
-  1414,  1280,  1131,   970,   794,   605,   402,   185,
-   -45,  -288,  -545,  -814, -1095, -1388, -1692, -2006,
- -2330, -2663, -3004, -3351, -3705, -4063, -4425, -4788,
- -5153, -5517, -5879, -6237, -6589, -6935, -7271, -7597,
- -7910, -8209, -8491, -8755, -8998, -9219, -9416, -9585,
- -9727, -9838, -9916, -9959, -9966, -9935, -9863, -9750,
- -9592, -9389, -9139, -8840, -8492, -8092, -7640, -7134,
-  6574,  5959,  5288,  4561,  3776,  2935,  2037,  1082,
-    70,  -998, -2122, -3300, -4533, -5818, -7154, -8540,
- -9975,-11455,-12980,-14548,-16155,-17799,-19478,-21189,
--22929,-24694,-26482,-28289,-30112,-31947,-33791,-35640,
--37489,-39336,-41176,-43006,-44821,-46617,-48390,-50137,
--51853,-53534,-55178,-56778,-58333,-59838,-61289,-62684,
--64019,-65290,-66494,-67629,-68692,-69679,-70590,-71420,
--72169,-72835,-73415,-73908,-74313,-74630,-74856,-74992,
- 75038,
-};
diff --git a/deps/libav/libavcodec/mpegaudiodsp_fixed.c b/deps/libav/libavcodec/mpegaudiodsp_fixed.c
deleted file mode 100644
index 3c49a56..0000000
--- a/deps/libav/libavcodec/mpegaudiodsp_fixed.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define CONFIG_FLOAT 0
-#include "mpegaudiodsp_template.c"
diff --git a/deps/libav/libavcodec/mpegaudiodsp_float.c b/deps/libav/libavcodec/mpegaudiodsp_float.c
deleted file mode 100644
index 2d8d53e..0000000
--- a/deps/libav/libavcodec/mpegaudiodsp_float.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define CONFIG_FLOAT 1
-#include "mpegaudiodsp_template.c"
diff --git a/deps/libav/libavcodec/mpegaudiodsp_template.c b/deps/libav/libavcodec/mpegaudiodsp_template.c
deleted file mode 100644
index 621bbd4..0000000
--- a/deps/libav/libavcodec/mpegaudiodsp_template.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * Copyright (c) 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-#include "dct32.h"
-#include "mathops.h"
-#include "mpegaudiodsp.h"
-#include "mpegaudio.h"
-
-#if CONFIG_FLOAT
-#define RENAME(n) n##_float
-
-static inline float round_sample(float *sum)
-{
-    float sum1=*sum;
-    *sum = 0;
-    return sum1;
-}
-
-#define MACS(rt, ra, rb) rt+=(ra)*(rb)
-#define MULS(ra, rb) ((ra)*(rb))
-#define MULH3(x, y, s) ((s)*(y)*(x))
-#define MLSS(rt, ra, rb) rt-=(ra)*(rb)
-#define MULLx(x, y, s) ((y)*(x))
-#define FIXHR(x)        ((float)(x))
-#define FIXR(x)        ((float)(x))
-#define SHR(a,b)       ((a)*(1.0f/(1<<(b))))
-
-#else
-
-#define RENAME(n) n##_fixed
-#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15)
-
-static inline int round_sample(int64_t *sum)
-{
-    int sum1;
-    sum1 = (int)((*sum) >> OUT_SHIFT);
-    *sum &= (1<<OUT_SHIFT)-1;
-    return av_clip_int16(sum1);
-}
-
-#   define MULS(ra, rb) MUL64(ra, rb)
-#   define MACS(rt, ra, rb) MAC64(rt, ra, rb)
-#   define MLSS(rt, ra, rb) MLS64(rt, ra, rb)
-#   define MULH3(x, y, s) MULH((s)*(x), y)
-#   define MULLx(x, y, s) MULL(x,y,s)
-#   define SHR(a,b)       ((a)>>(b))
-#   define FIXR(a)        ((int)((a) * FRAC_ONE + 0.5))
-#   define FIXHR(a)       ((int)((a) * (1LL<<32) + 0.5))
-#endif
-
-/** Window for MDCT. Actually only the elements in [0,17] and
-    [MDCT_BUF_SIZE/2, MDCT_BUF_SIZE/2 + 17] are actually used. The rest
-    is just to preserve alignment for SIMD implementations.
-*/
-DECLARE_ALIGNED(16, INTFLOAT, RENAME(ff_mdct_win))[8][MDCT_BUF_SIZE];
-
-DECLARE_ALIGNED(16, MPA_INT, RENAME(ff_mpa_synth_window))[512+256];
-
-#define SUM8(op, sum, w, p)               \
-{                                         \
-    op(sum, (w)[0 * 64], (p)[0 * 64]);    \
-    op(sum, (w)[1 * 64], (p)[1 * 64]);    \
-    op(sum, (w)[2 * 64], (p)[2 * 64]);    \
-    op(sum, (w)[3 * 64], (p)[3 * 64]);    \
-    op(sum, (w)[4 * 64], (p)[4 * 64]);    \
-    op(sum, (w)[5 * 64], (p)[5 * 64]);    \
-    op(sum, (w)[6 * 64], (p)[6 * 64]);    \
-    op(sum, (w)[7 * 64], (p)[7 * 64]);    \
-}
-
-#define SUM8P2(sum1, op1, sum2, op2, w1, w2, p) \
-{                                               \
-    INTFLOAT tmp;\
-    tmp = p[0 * 64];\
-    op1(sum1, (w1)[0 * 64], tmp);\
-    op2(sum2, (w2)[0 * 64], tmp);\
-    tmp = p[1 * 64];\
-    op1(sum1, (w1)[1 * 64], tmp);\
-    op2(sum2, (w2)[1 * 64], tmp);\
-    tmp = p[2 * 64];\
-    op1(sum1, (w1)[2 * 64], tmp);\
-    op2(sum2, (w2)[2 * 64], tmp);\
-    tmp = p[3 * 64];\
-    op1(sum1, (w1)[3 * 64], tmp);\
-    op2(sum2, (w2)[3 * 64], tmp);\
-    tmp = p[4 * 64];\
-    op1(sum1, (w1)[4 * 64], tmp);\
-    op2(sum2, (w2)[4 * 64], tmp);\
-    tmp = p[5 * 64];\
-    op1(sum1, (w1)[5 * 64], tmp);\
-    op2(sum2, (w2)[5 * 64], tmp);\
-    tmp = p[6 * 64];\
-    op1(sum1, (w1)[6 * 64], tmp);\
-    op2(sum2, (w2)[6 * 64], tmp);\
-    tmp = p[7 * 64];\
-    op1(sum1, (w1)[7 * 64], tmp);\
-    op2(sum2, (w2)[7 * 64], tmp);\
-}
-
-void RENAME(ff_mpadsp_apply_window)(MPA_INT *synth_buf, MPA_INT *window,
-                                  int *dither_state, OUT_INT *samples,
-                                  int incr)
-{
-    register const MPA_INT *w, *w2, *p;
-    int j;
-    OUT_INT *samples2;
-#if CONFIG_FLOAT
-    float sum, sum2;
-#else
-    int64_t sum, sum2;
-#endif
-
-    /* copy to avoid wrap */
-    memcpy(synth_buf + 512, synth_buf, 32 * sizeof(*synth_buf));
-
-    samples2 = samples + 31 * incr;
-    w = window;
-    w2 = window + 31;
-
-    sum = *dither_state;
-    p = synth_buf + 16;
-    SUM8(MACS, sum, w, p);
-    p = synth_buf + 48;
-    SUM8(MLSS, sum, w + 32, p);
-    *samples = round_sample(&sum);
-    samples += incr;
-    w++;
-
-    /* we calculate two samples at the same time to avoid one memory
-       access per two sample */
-    for(j=1;j<16;j++) {
-        sum2 = 0;
-        p = synth_buf + 16 + j;
-        SUM8P2(sum, MACS, sum2, MLSS, w, w2, p);
-        p = synth_buf + 48 - j;
-        SUM8P2(sum, MLSS, sum2, MLSS, w + 32, w2 + 32, p);
-
-        *samples = round_sample(&sum);
-        samples += incr;
-        sum += sum2;
-        *samples2 = round_sample(&sum);
-        samples2 -= incr;
-        w++;
-        w2--;
-    }
-
-    p = synth_buf + 32;
-    SUM8(MLSS, sum, w + 32, p);
-    *samples = round_sample(&sum);
-    *dither_state= sum;
-}
-
-/* 32 sub band synthesis filter. Input: 32 sub band samples, Output:
-   32 samples. */
-void RENAME(ff_mpa_synth_filter)(MPADSPContext *s, MPA_INT *synth_buf_ptr,
-                                 int *synth_buf_offset,
-                                 MPA_INT *window, int *dither_state,
-                                 OUT_INT *samples, int incr,
-                                 MPA_INT *sb_samples)
-{
-    MPA_INT *synth_buf;
-    int offset;
-
-    offset = *synth_buf_offset;
-    synth_buf = synth_buf_ptr + offset;
-
-    s->RENAME(dct32)(synth_buf, sb_samples);
-    s->RENAME(apply_window)(synth_buf, window, dither_state, samples, incr);
-
-    offset = (offset - 32) & 511;
-    *synth_buf_offset = offset;
-}
-
-av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window)
-{
-    int i, j;
-
-    /* max = 18760, max sum over all 16 coefs : 44736 */
-    for(i=0;i<257;i++) {
-        INTFLOAT v;
-        v = ff_mpa_enwindow[i];
-#if CONFIG_FLOAT
-        v *= 1.0 / (1LL<<(16 + FRAC_BITS));
-#endif
-        window[i] = v;
-        if ((i & 63) != 0)
-            v = -v;
-        if (i != 0)
-            window[512 - i] = v;
-    }
-
-
-    // Needed for avoiding shuffles in ASM implementations
-    for(i=0; i < 8; i++)
-        for(j=0; j < 16; j++)
-            window[512+16*i+j] = window[64*i+32-j];
-
-    for(i=0; i < 8; i++)
-        for(j=0; j < 16; j++)
-            window[512+128+16*i+j] = window[64*i+48-j];
-}
-
-av_cold void RENAME(ff_init_mpadsp_tabs)(void)
-{
-    int i, j;
-    /* compute mdct windows */
-    for (i = 0; i < 36; i++) {
-        for (j = 0; j < 4; j++) {
-            double d;
-
-            if (j == 2 && i % 3 != 1)
-                continue;
-
-            d = sin(M_PI * (i + 0.5) / 36.0);
-            if (j == 1) {
-                if      (i >= 30) d = 0;
-                else if (i >= 24) d = sin(M_PI * (i - 18 + 0.5) / 12.0);
-                else if (i >= 18) d = 1;
-            } else if (j == 3) {
-                if      (i <   6) d = 0;
-                else if (i <  12) d = sin(M_PI * (i -  6 + 0.5) / 12.0);
-                else if (i <  18) d = 1;
-            }
-            //merge last stage of imdct into the window coefficients
-            d *= 0.5 / cos(M_PI * (2 * i + 19) / 72);
-
-            if (j == 2)
-                RENAME(ff_mdct_win)[j][i/3] = FIXHR((d / (1<<5)));
-            else {
-                int idx = i < 18 ? i : i + (MDCT_BUF_SIZE/2 - 18);
-                RENAME(ff_mdct_win)[j][idx] = FIXHR((d / (1<<5)));
-            }
-        }
-    }
-
-    /* NOTE: we do frequency inversion adter the MDCT by changing
-        the sign of the right window coefs */
-    for (j = 0; j < 4; j++) {
-        for (i = 0; i < MDCT_BUF_SIZE; i += 2) {
-            RENAME(ff_mdct_win)[j + 4][i    ] =  RENAME(ff_mdct_win)[j][i    ];
-            RENAME(ff_mdct_win)[j + 4][i + 1] = -RENAME(ff_mdct_win)[j][i + 1];
-        }
-    }
-}
-/* cos(pi*i/18) */
-#define C1 FIXHR(0.98480775301220805936/2)
-#define C2 FIXHR(0.93969262078590838405/2)
-#define C3 FIXHR(0.86602540378443864676/2)
-#define C4 FIXHR(0.76604444311897803520/2)
-#define C5 FIXHR(0.64278760968653932632/2)
-#define C6 FIXHR(0.5/2)
-#define C7 FIXHR(0.34202014332566873304/2)
-#define C8 FIXHR(0.17364817766693034885/2)
-
-/* 0.5 / cos(pi*(2*i+1)/36) */
-static const INTFLOAT icos36[9] = {
-    FIXR(0.50190991877167369479),
-    FIXR(0.51763809020504152469), //0
-    FIXR(0.55168895948124587824),
-    FIXR(0.61038729438072803416),
-    FIXR(0.70710678118654752439), //1
-    FIXR(0.87172339781054900991),
-    FIXR(1.18310079157624925896),
-    FIXR(1.93185165257813657349), //2
-    FIXR(5.73685662283492756461),
-};
-
-/* 0.5 / cos(pi*(2*i+1)/36) */
-static const INTFLOAT icos36h[9] = {
-    FIXHR(0.50190991877167369479/2),
-    FIXHR(0.51763809020504152469/2), //0
-    FIXHR(0.55168895948124587824/2),
-    FIXHR(0.61038729438072803416/2),
-    FIXHR(0.70710678118654752439/2), //1
-    FIXHR(0.87172339781054900991/2),
-    FIXHR(1.18310079157624925896/4),
-    FIXHR(1.93185165257813657349/4), //2
-//    FIXHR(5.73685662283492756461),
-};
-
-/* using Lee like decomposition followed by hand coded 9 points DCT */
-static void imdct36(INTFLOAT *out, INTFLOAT *buf, INTFLOAT *in, INTFLOAT *win)
-{
-    int i, j;
-    INTFLOAT t0, t1, t2, t3, s0, s1, s2, s3;
-    INTFLOAT tmp[18], *tmp1, *in1;
-
-    for (i = 17; i >= 1; i--)
-        in[i] += in[i-1];
-    for (i = 17; i >= 3; i -= 2)
-        in[i] += in[i-2];
-
-    for (j = 0; j < 2; j++) {
-        tmp1 = tmp + j;
-        in1 = in + j;
-
-        t2 = in1[2*4] + in1[2*8] - in1[2*2];
-
-        t3 = in1[2*0] + SHR(in1[2*6],1);
-        t1 = in1[2*0] - in1[2*6];
-        tmp1[ 6] = t1 - SHR(t2,1);
-        tmp1[16] = t1 + t2;
-
-        t0 = MULH3(in1[2*2] + in1[2*4] ,    C2, 2);
-        t1 = MULH3(in1[2*4] - in1[2*8] , -2*C8, 1);
-        t2 = MULH3(in1[2*2] + in1[2*8] ,   -C4, 2);
-
-        tmp1[10] = t3 - t0 - t2;
-        tmp1[ 2] = t3 + t0 + t1;
-        tmp1[14] = t3 + t2 - t1;
-
-        tmp1[ 4] = MULH3(in1[2*5] + in1[2*7] - in1[2*1], -C3, 2);
-        t2 = MULH3(in1[2*1] + in1[2*5],    C1, 2);
-        t3 = MULH3(in1[2*5] - in1[2*7], -2*C7, 1);
-        t0 = MULH3(in1[2*3], C3, 2);
-
-        t1 = MULH3(in1[2*1] + in1[2*7],   -C5, 2);
-
-        tmp1[ 0] = t2 + t3 + t0;
-        tmp1[12] = t2 + t1 - t0;
-        tmp1[ 8] = t3 - t1 - t0;
-    }
-
-    i = 0;
-    for (j = 0; j < 4; j++) {
-        t0 = tmp[i];
-        t1 = tmp[i + 2];
-        s0 = t1 + t0;
-        s2 = t1 - t0;
-
-        t2 = tmp[i + 1];
-        t3 = tmp[i + 3];
-        s1 = MULH3(t3 + t2, icos36h[    j], 2);
-        s3 = MULLx(t3 - t2, icos36 [8 - j], FRAC_BITS);
-
-        t0 = s0 + s1;
-        t1 = s0 - s1;
-        out[(9 + j) * SBLIMIT] = MULH3(t1, win[     9 + j], 1) + buf[4*(9 + j)];
-        out[(8 - j) * SBLIMIT] = MULH3(t1, win[     8 - j], 1) + buf[4*(8 - j)];
-        buf[4 * ( 9 + j     )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 9 + j], 1);
-        buf[4 * ( 8 - j     )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 8 - j], 1);
-
-        t0 = s2 + s3;
-        t1 = s2 - s3;
-        out[(9 + 8 - j) * SBLIMIT] = MULH3(t1, win[     9 + 8 - j], 1) + buf[4*(9 + 8 - j)];
-        out[         j  * SBLIMIT] = MULH3(t1, win[             j], 1) + buf[4*(        j)];
-        buf[4 * ( 9 + 8 - j     )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 9 + 8 - j], 1);
-        buf[4 * (         j     )] = MULH3(t0, win[MDCT_BUF_SIZE/2         + j], 1);
-        i += 4;
-    }
-
-    s0 = tmp[16];
-    s1 = MULH3(tmp[17], icos36h[4], 2);
-    t0 = s0 + s1;
-    t1 = s0 - s1;
-    out[(9 + 4) * SBLIMIT] = MULH3(t1, win[     9 + 4], 1) + buf[4*(9 + 4)];
-    out[(8 - 4) * SBLIMIT] = MULH3(t1, win[     8 - 4], 1) + buf[4*(8 - 4)];
-    buf[4 * ( 9 + 4     )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 9 + 4], 1);
-    buf[4 * ( 8 - 4     )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 8 - 4], 1);
-}
-
-void RENAME(ff_imdct36_blocks)(INTFLOAT *out, INTFLOAT *buf, INTFLOAT *in,
-                               int count, int switch_point, int block_type)
-{
-    int j;
-    for (j=0 ; j < count; j++) {
-        /* apply window & overlap with previous buffer */
-
-        /* select window */
-        int win_idx = (switch_point && j < 2) ? 0 : block_type;
-        INTFLOAT *win = RENAME(ff_mdct_win)[win_idx + (4 & -(j & 1))];
-
-        imdct36(out, buf, in, win);
-
-        in  += 18;
-        buf += ((j&3) != 3 ? 1 : (72-3));
-        out++;
-    }
-}
diff --git a/deps/libav/libavcodec/mpegaudioenc.c b/deps/libav/libavcodec/mpegaudioenc.c
deleted file mode 100644
index a940c0d..0000000
--- a/deps/libav/libavcodec/mpegaudioenc.c
+++ /dev/null
@@ -1,767 +0,0 @@
-/*
- * The simplest mpeg audio layer 2 encoder
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * The simplest mpeg audio layer 2 encoder.
- */
-
-#include "libavutil/channel_layout.h"
-
-#include "avcodec.h"
-#include "internal.h"
-#include "put_bits.h"
-
-#define FRAC_BITS   15   /* fractional bits for sb_samples and dct */
-#define WFRAC_BITS  14   /* fractional bits for window */
-
-#include "mpegaudio.h"
-#include "mpegaudiodsp.h"
-#include "mpegaudiodata.h"
-#include "mpegaudiotab.h"
-
-/* currently, cannot change these constants (need to modify
-   quantization stage) */
-#define MUL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
-
-#define SAMPLES_BUF_SIZE 4096
-
-typedef struct MpegAudioContext {
-    PutBitContext pb;
-    int nb_channels;
-    int lsf;           /* 1 if mpeg2 low bitrate selected */
-    int bitrate_index; /* bit rate */
-    int freq_index;
-    int frame_size; /* frame size, in bits, without padding */
-    /* padding computation */
-    int frame_frac, frame_frac_incr, do_padding;
-    short samples_buf[MPA_MAX_CHANNELS][SAMPLES_BUF_SIZE]; /* buffer for filter */
-    int samples_offset[MPA_MAX_CHANNELS];       /* offset in samples_buf */
-    int sb_samples[MPA_MAX_CHANNELS][3][12][SBLIMIT];
-    unsigned char scale_factors[MPA_MAX_CHANNELS][SBLIMIT][3]; /* scale factors */
-    /* code to group 3 scale factors */
-    unsigned char scale_code[MPA_MAX_CHANNELS][SBLIMIT];
-    int sblimit; /* number of used subbands */
-    const unsigned char *alloc_table;
-    int16_t filter_bank[512];
-    int scale_factor_table[64];
-    unsigned char scale_diff_table[128];
-    float scale_factor_inv_table[64];
-    unsigned short total_quant_bits[17]; /* total number of bits per allocation group */
-} MpegAudioContext;
-
-static av_cold int MPA_encode_init(AVCodecContext *avctx)
-{
-    MpegAudioContext *s = avctx->priv_data;
-    int freq = avctx->sample_rate;
-    int bitrate = avctx->bit_rate;
-    int channels = avctx->channels;
-    int i, v, table;
-    float a;
-
-    if (channels <= 0 || channels > 2){
-        av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed in mp2\n", channels);
-        return AVERROR(EINVAL);
-    }
-    bitrate = bitrate / 1000;
-    s->nb_channels = channels;
-    avctx->frame_size = MPA_FRAME_SIZE;
-    avctx->delay      = 512 - 32 + 1;
-
-    /* encoding freq */
-    s->lsf = 0;
-    for(i=0;i<3;i++) {
-        if (avpriv_mpa_freq_tab[i] == freq)
-            break;
-        if ((avpriv_mpa_freq_tab[i] / 2) == freq) {
-            s->lsf = 1;
-            break;
-        }
-    }
-    if (i == 3){
-        av_log(avctx, AV_LOG_ERROR, "Sampling rate %d is not allowed in mp2\n", freq);
-        return AVERROR(EINVAL);
-    }
-    s->freq_index = i;
-
-    /* encoding bitrate & frequency */
-    for(i=0;i<15;i++) {
-        if (avpriv_mpa_bitrate_tab[s->lsf][1][i] == bitrate)
-            break;
-    }
-    if (i == 15){
-        av_log(avctx, AV_LOG_ERROR, "bitrate %d is not allowed in mp2\n", bitrate);
-        return AVERROR(EINVAL);
-    }
-    s->bitrate_index = i;
-
-    /* compute total header size & pad bit */
-
-    a = (float)(bitrate * 1000 * MPA_FRAME_SIZE) / (freq * 8.0);
-    s->frame_size = ((int)a) * 8;
-
-    /* frame fractional size to compute padding */
-    s->frame_frac = 0;
-    s->frame_frac_incr = (int)((a - floor(a)) * 65536.0);
-
-    /* select the right allocation table */
-    table = ff_mpa_l2_select_table(bitrate, s->nb_channels, freq, s->lsf);
-
-    /* number of used subbands */
-    s->sblimit = ff_mpa_sblimit_table[table];
-    s->alloc_table = ff_mpa_alloc_tables[table];
-
-    av_dlog(avctx, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
-            bitrate, freq, s->frame_size, table, s->frame_frac_incr);
-
-    for(i=0;i<s->nb_channels;i++)
-        s->samples_offset[i] = 0;
-
-    for(i=0;i<257;i++) {
-        int v;
-        v = ff_mpa_enwindow[i];
-#if WFRAC_BITS != 16
-        v = (v + (1 << (16 - WFRAC_BITS - 1))) >> (16 - WFRAC_BITS);
-#endif
-        s->filter_bank[i] = v;
-        if ((i & 63) != 0)
-            v = -v;
-        if (i != 0)
-            s->filter_bank[512 - i] = v;
-    }
-
-    for(i=0;i<64;i++) {
-        v = (int)(pow(2.0, (3 - i) / 3.0) * (1 << 20));
-        if (v <= 0)
-            v = 1;
-        s->scale_factor_table[i] = v;
-        s->scale_factor_inv_table[i] = pow(2.0, -(3 - i) / 3.0) / (float)(1 << 20);
-    }
-    for(i=0;i<128;i++) {
-        v = i - 64;
-        if (v <= -3)
-            v = 0;
-        else if (v < 0)
-            v = 1;
-        else if (v == 0)
-            v = 2;
-        else if (v < 3)
-            v = 3;
-        else
-            v = 4;
-        s->scale_diff_table[i] = v;
-    }
-
-    for(i=0;i<17;i++) {
-        v = ff_mpa_quant_bits[i];
-        if (v < 0)
-            v = -v;
-        else
-            v = v * 3;
-        s->total_quant_bits[i] = 12 * v;
-    }
-
-    return 0;
-}
-
-/* 32 point floating point IDCT without 1/sqrt(2) coef zero scaling */
-static void idct32(int *out, int *tab)
-{
-    int i, j;
-    int *t, *t1, xr;
-    const int *xp = costab32;
-
-    for(j=31;j>=3;j-=2) tab[j] += tab[j - 2];
-
-    t = tab + 30;
-    t1 = tab + 2;
-    do {
-        t[0] += t[-4];
-        t[1] += t[1 - 4];
-        t -= 4;
-    } while (t != t1);
-
-    t = tab + 28;
-    t1 = tab + 4;
-    do {
-        t[0] += t[-8];
-        t[1] += t[1-8];
-        t[2] += t[2-8];
-        t[3] += t[3-8];
-        t -= 8;
-    } while (t != t1);
-
-    t = tab;
-    t1 = tab + 32;
-    do {
-        t[ 3] = -t[ 3];
-        t[ 6] = -t[ 6];
-
-        t[11] = -t[11];
-        t[12] = -t[12];
-        t[13] = -t[13];
-        t[15] = -t[15];
-        t += 16;
-    } while (t != t1);
-
-
-    t = tab;
-    t1 = tab + 8;
-    do {
-        int x1, x2, x3, x4;
-
-        x3 = MUL(t[16], FIX(SQRT2*0.5));
-        x4 = t[0] - x3;
-        x3 = t[0] + x3;
-
-        x2 = MUL(-(t[24] + t[8]), FIX(SQRT2*0.5));
-        x1 = MUL((t[8] - x2), xp[0]);
-        x2 = MUL((t[8] + x2), xp[1]);
-
-        t[ 0] = x3 + x1;
-        t[ 8] = x4 - x2;
-        t[16] = x4 + x2;
-        t[24] = x3 - x1;
-        t++;
-    } while (t != t1);
-
-    xp += 2;
-    t = tab;
-    t1 = tab + 4;
-    do {
-        xr = MUL(t[28],xp[0]);
-        t[28] = (t[0] - xr);
-        t[0] = (t[0] + xr);
-
-        xr = MUL(t[4],xp[1]);
-        t[ 4] = (t[24] - xr);
-        t[24] = (t[24] + xr);
-
-        xr = MUL(t[20],xp[2]);
-        t[20] = (t[8] - xr);
-        t[ 8] = (t[8] + xr);
-
-        xr = MUL(t[12],xp[3]);
-        t[12] = (t[16] - xr);
-        t[16] = (t[16] + xr);
-        t++;
-    } while (t != t1);
-    xp += 4;
-
-    for (i = 0; i < 4; i++) {
-        xr = MUL(tab[30-i*4],xp[0]);
-        tab[30-i*4] = (tab[i*4] - xr);
-        tab[   i*4] = (tab[i*4] + xr);
-
-        xr = MUL(tab[ 2+i*4],xp[1]);
-        tab[ 2+i*4] = (tab[28-i*4] - xr);
-        tab[28-i*4] = (tab[28-i*4] + xr);
-
-        xr = MUL(tab[31-i*4],xp[0]);
-        tab[31-i*4] = (tab[1+i*4] - xr);
-        tab[ 1+i*4] = (tab[1+i*4] + xr);
-
-        xr = MUL(tab[ 3+i*4],xp[1]);
-        tab[ 3+i*4] = (tab[29-i*4] - xr);
-        tab[29-i*4] = (tab[29-i*4] + xr);
-
-        xp += 2;
-    }
-
-    t = tab + 30;
-    t1 = tab + 1;
-    do {
-        xr = MUL(t1[0], *xp);
-        t1[0] = (t[0] - xr);
-        t[0] = (t[0] + xr);
-        t -= 2;
-        t1 += 2;
-        xp++;
-    } while (t >= tab);
-
-    for(i=0;i<32;i++) {
-        out[i] = tab[bitinv32[i]];
-    }
-}
-
-#define WSHIFT (WFRAC_BITS + 15 - FRAC_BITS)
-
-static void filter(MpegAudioContext *s, int ch, const short *samples, int incr)
-{
-    short *p, *q;
-    int sum, offset, i, j;
-    int tmp[64];
-    int tmp1[32];
-    int *out;
-
-    offset = s->samples_offset[ch];
-    out = &s->sb_samples[ch][0][0][0];
-    for(j=0;j<36;j++) {
-        /* 32 samples at once */
-        for(i=0;i<32;i++) {
-            s->samples_buf[ch][offset + (31 - i)] = samples[0];
-            samples += incr;
-        }
-
-        /* filter */
-        p = s->samples_buf[ch] + offset;
-        q = s->filter_bank;
-        /* maxsum = 23169 */
-        for(i=0;i<64;i++) {
-            sum = p[0*64] * q[0*64];
-            sum += p[1*64] * q[1*64];
-            sum += p[2*64] * q[2*64];
-            sum += p[3*64] * q[3*64];
-            sum += p[4*64] * q[4*64];
-            sum += p[5*64] * q[5*64];
-            sum += p[6*64] * q[6*64];
-            sum += p[7*64] * q[7*64];
-            tmp[i] = sum;
-            p++;
-            q++;
-        }
-        tmp1[0] = tmp[16] >> WSHIFT;
-        for( i=1; i<=16; i++ ) tmp1[i] = (tmp[i+16]+tmp[16-i]) >> WSHIFT;
-        for( i=17; i<=31; i++ ) tmp1[i] = (tmp[i+16]-tmp[80-i]) >> WSHIFT;
-
-        idct32(out, tmp1);
-
-        /* advance of 32 samples */
-        offset -= 32;
-        out += 32;
-        /* handle the wrap around */
-        if (offset < 0) {
-            memmove(s->samples_buf[ch] + SAMPLES_BUF_SIZE - (512 - 32),
-                    s->samples_buf[ch], (512 - 32) * 2);
-            offset = SAMPLES_BUF_SIZE - 512;
-        }
-    }
-    s->samples_offset[ch] = offset;
-}
-
-static void compute_scale_factors(MpegAudioContext *s,
-                                  unsigned char scale_code[SBLIMIT],
-                                  unsigned char scale_factors[SBLIMIT][3],
-                                  int sb_samples[3][12][SBLIMIT],
-                                  int sblimit)
-{
-    int *p, vmax, v, n, i, j, k, code;
-    int index, d1, d2;
-    unsigned char *sf = &scale_factors[0][0];
-
-    for(j=0;j<sblimit;j++) {
-        for(i=0;i<3;i++) {
-            /* find the max absolute value */
-            p = &sb_samples[i][0][j];
-            vmax = abs(*p);
-            for(k=1;k<12;k++) {
-                p += SBLIMIT;
-                v = abs(*p);
-                if (v > vmax)
-                    vmax = v;
-            }
-            /* compute the scale factor index using log 2 computations */
-            if (vmax > 1) {
-                n = av_log2(vmax);
-                /* n is the position of the MSB of vmax. now
-                   use at most 2 compares to find the index */
-                index = (21 - n) * 3 - 3;
-                if (index >= 0) {
-                    while (vmax <= s->scale_factor_table[index+1])
-                        index++;
-                } else {
-                    index = 0; /* very unlikely case of overflow */
-                }
-            } else {
-                index = 62; /* value 63 is not allowed */
-            }
-
-            av_dlog(NULL, "%2d:%d in=%x %x %d\n",
-                    j, i, vmax, s->scale_factor_table[index], index);
-            /* store the scale factor */
-            assert(index >=0 && index <= 63);
-            sf[i] = index;
-        }
-
-        /* compute the transmission factor : look if the scale factors
-           are close enough to each other */
-        d1 = s->scale_diff_table[sf[0] - sf[1] + 64];
-        d2 = s->scale_diff_table[sf[1] - sf[2] + 64];
-
-        /* handle the 25 cases */
-        switch(d1 * 5 + d2) {
-        case 0*5+0:
-        case 0*5+4:
-        case 3*5+4:
-        case 4*5+0:
-        case 4*5+4:
-            code = 0;
-            break;
-        case 0*5+1:
-        case 0*5+2:
-        case 4*5+1:
-        case 4*5+2:
-            code = 3;
-            sf[2] = sf[1];
-            break;
-        case 0*5+3:
-        case 4*5+3:
-            code = 3;
-            sf[1] = sf[2];
-            break;
-        case 1*5+0:
-        case 1*5+4:
-        case 2*5+4:
-            code = 1;
-            sf[1] = sf[0];
-            break;
-        case 1*5+1:
-        case 1*5+2:
-        case 2*5+0:
-        case 2*5+1:
-        case 2*5+2:
-            code = 2;
-            sf[1] = sf[2] = sf[0];
-            break;
-        case 2*5+3:
-        case 3*5+3:
-            code = 2;
-            sf[0] = sf[1] = sf[2];
-            break;
-        case 3*5+0:
-        case 3*5+1:
-        case 3*5+2:
-            code = 2;
-            sf[0] = sf[2] = sf[1];
-            break;
-        case 1*5+3:
-            code = 2;
-            if (sf[0] > sf[2])
-              sf[0] = sf[2];
-            sf[1] = sf[2] = sf[0];
-            break;
-        default:
-            assert(0); //cannot happen
-            code = 0;           /* kill warning */
-        }
-
-        av_dlog(NULL, "%d: %2d %2d %2d %d %d -> %d\n", j,
-                sf[0], sf[1], sf[2], d1, d2, code);
-        scale_code[j] = code;
-        sf += 3;
-    }
-}
-
-/* The most important function : psycho acoustic module. In this
-   encoder there is basically none, so this is the worst you can do,
-   but also this is the simpler. */
-static void psycho_acoustic_model(MpegAudioContext *s, short smr[SBLIMIT])
-{
-    int i;
-
-    for(i=0;i<s->sblimit;i++) {
-        smr[i] = (int)(fixed_smr[i] * 10);
-    }
-}
-
-
-#define SB_NOTALLOCATED  0
-#define SB_ALLOCATED     1
-#define SB_NOMORE        2
-
-/* Try to maximize the smr while using a number of bits inferior to
-   the frame size. I tried to make the code simpler, faster and
-   smaller than other encoders :-) */
-static void compute_bit_allocation(MpegAudioContext *s,
-                                   short smr1[MPA_MAX_CHANNELS][SBLIMIT],
-                                   unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT],
-                                   int *padding)
-{
-    int i, ch, b, max_smr, max_ch, max_sb, current_frame_size, max_frame_size;
-    int incr;
-    short smr[MPA_MAX_CHANNELS][SBLIMIT];
-    unsigned char subband_status[MPA_MAX_CHANNELS][SBLIMIT];
-    const unsigned char *alloc;
-
-    memcpy(smr, smr1, s->nb_channels * sizeof(short) * SBLIMIT);
-    memset(subband_status, SB_NOTALLOCATED, s->nb_channels * SBLIMIT);
-    memset(bit_alloc, 0, s->nb_channels * SBLIMIT);
-
-    /* compute frame size and padding */
-    max_frame_size = s->frame_size;
-    s->frame_frac += s->frame_frac_incr;
-    if (s->frame_frac >= 65536) {
-        s->frame_frac -= 65536;
-        s->do_padding = 1;
-        max_frame_size += 8;
-    } else {
-        s->do_padding = 0;
-    }
-
-    /* compute the header + bit alloc size */
-    current_frame_size = 32;
-    alloc = s->alloc_table;
-    for(i=0;i<s->sblimit;i++) {
-        incr = alloc[0];
-        current_frame_size += incr * s->nb_channels;
-        alloc += 1 << incr;
-    }
-    for(;;) {
-        /* look for the subband with the largest signal to mask ratio */
-        max_sb = -1;
-        max_ch = -1;
-        max_smr = INT_MIN;
-        for(ch=0;ch<s->nb_channels;ch++) {
-            for(i=0;i<s->sblimit;i++) {
-                if (smr[ch][i] > max_smr && subband_status[ch][i] != SB_NOMORE) {
-                    max_smr = smr[ch][i];
-                    max_sb = i;
-                    max_ch = ch;
-                }
-            }
-        }
-        if (max_sb < 0)
-            break;
-        av_dlog(NULL, "current=%d max=%d max_sb=%d max_ch=%d alloc=%d\n",
-                current_frame_size, max_frame_size, max_sb, max_ch,
-                bit_alloc[max_ch][max_sb]);
-
-        /* find alloc table entry (XXX: not optimal, should use
-           pointer table) */
-        alloc = s->alloc_table;
-        for(i=0;i<max_sb;i++) {
-            alloc += 1 << alloc[0];
-        }
-
-        if (subband_status[max_ch][max_sb] == SB_NOTALLOCATED) {
-            /* nothing was coded for this band: add the necessary bits */
-            incr = 2 + nb_scale_factors[s->scale_code[max_ch][max_sb]] * 6;
-            incr += s->total_quant_bits[alloc[1]];
-        } else {
-            /* increments bit allocation */
-            b = bit_alloc[max_ch][max_sb];
-            incr = s->total_quant_bits[alloc[b + 1]] -
-                s->total_quant_bits[alloc[b]];
-        }
-
-        if (current_frame_size + incr <= max_frame_size) {
-            /* can increase size */
-            b = ++bit_alloc[max_ch][max_sb];
-            current_frame_size += incr;
-            /* decrease smr by the resolution we added */
-            smr[max_ch][max_sb] = smr1[max_ch][max_sb] - quant_snr[alloc[b]];
-            /* max allocation size reached ? */
-            if (b == ((1 << alloc[0]) - 1))
-                subband_status[max_ch][max_sb] = SB_NOMORE;
-            else
-                subband_status[max_ch][max_sb] = SB_ALLOCATED;
-        } else {
-            /* cannot increase the size of this subband */
-            subband_status[max_ch][max_sb] = SB_NOMORE;
-        }
-    }
-    *padding = max_frame_size - current_frame_size;
-    assert(*padding >= 0);
-}
-
-/*
- * Output the mpeg audio layer 2 frame. Note how the code is small
- * compared to other encoders :-)
- */
-static void encode_frame(MpegAudioContext *s,
-                         unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT],
-                         int padding)
-{
-    int i, j, k, l, bit_alloc_bits, b, ch;
-    unsigned char *sf;
-    int q[3];
-    PutBitContext *p = &s->pb;
-
-    /* header */
-
-    put_bits(p, 12, 0xfff);
-    put_bits(p, 1, 1 - s->lsf); /* 1 = mpeg1 ID, 0 = mpeg2 lsf ID */
-    put_bits(p, 2, 4-2);  /* layer 2 */
-    put_bits(p, 1, 1); /* no error protection */
-    put_bits(p, 4, s->bitrate_index);
-    put_bits(p, 2, s->freq_index);
-    put_bits(p, 1, s->do_padding); /* use padding */
-    put_bits(p, 1, 0);             /* private_bit */
-    put_bits(p, 2, s->nb_channels == 2 ? MPA_STEREO : MPA_MONO);
-    put_bits(p, 2, 0); /* mode_ext */
-    put_bits(p, 1, 0); /* no copyright */
-    put_bits(p, 1, 1); /* original */
-    put_bits(p, 2, 0); /* no emphasis */
-
-    /* bit allocation */
-    j = 0;
-    for(i=0;i<s->sblimit;i++) {
-        bit_alloc_bits = s->alloc_table[j];
-        for(ch=0;ch<s->nb_channels;ch++) {
-            put_bits(p, bit_alloc_bits, bit_alloc[ch][i]);
-        }
-        j += 1 << bit_alloc_bits;
-    }
-
-    /* scale codes */
-    for(i=0;i<s->sblimit;i++) {
-        for(ch=0;ch<s->nb_channels;ch++) {
-            if (bit_alloc[ch][i])
-                put_bits(p, 2, s->scale_code[ch][i]);
-        }
-    }
-
-    /* scale factors */
-    for(i=0;i<s->sblimit;i++) {
-        for(ch=0;ch<s->nb_channels;ch++) {
-            if (bit_alloc[ch][i]) {
-                sf = &s->scale_factors[ch][i][0];
-                switch(s->scale_code[ch][i]) {
-                case 0:
-                    put_bits(p, 6, sf[0]);
-                    put_bits(p, 6, sf[1]);
-                    put_bits(p, 6, sf[2]);
-                    break;
-                case 3:
-                case 1:
-                    put_bits(p, 6, sf[0]);
-                    put_bits(p, 6, sf[2]);
-                    break;
-                case 2:
-                    put_bits(p, 6, sf[0]);
-                    break;
-                }
-            }
-        }
-    }
-
-    /* quantization & write sub band samples */
-
-    for(k=0;k<3;k++) {
-        for(l=0;l<12;l+=3) {
-            j = 0;
-            for(i=0;i<s->sblimit;i++) {
-                bit_alloc_bits = s->alloc_table[j];
-                for(ch=0;ch<s->nb_channels;ch++) {
-                    b = bit_alloc[ch][i];
-                    if (b) {
-                        int qindex, steps, m, sample, bits;
-                        /* we encode 3 sub band samples of the same sub band at a time */
-                        qindex = s->alloc_table[j+b];
-                        steps = ff_mpa_quant_steps[qindex];
-                        for(m=0;m<3;m++) {
-                            float a;
-                            sample = s->sb_samples[ch][k][l + m][i];
-                            /* divide by scale factor */
-                            a = (float)sample * s->scale_factor_inv_table[s->scale_factors[ch][i][k]];
-                            q[m] = (int)((a + 1.0) * steps * 0.5);
-                            if (q[m] >= steps)
-                                q[m] = steps - 1;
-                            assert(q[m] >= 0 && q[m] < steps);
-                        }
-                        bits = ff_mpa_quant_bits[qindex];
-                        if (bits < 0) {
-                            /* group the 3 values to save bits */
-                            put_bits(p, -bits,
-                                     q[0] + steps * (q[1] + steps * q[2]));
-                        } else {
-                            put_bits(p, bits, q[0]);
-                            put_bits(p, bits, q[1]);
-                            put_bits(p, bits, q[2]);
-                        }
-                    }
-                }
-                /* next subband in alloc table */
-                j += 1 << bit_alloc_bits;
-            }
-        }
-    }
-
-    /* padding */
-    for(i=0;i<padding;i++)
-        put_bits(p, 1, 0);
-
-    /* flush */
-    flush_put_bits(p);
-}
-
-static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                            const AVFrame *frame, int *got_packet_ptr)
-{
-    MpegAudioContext *s = avctx->priv_data;
-    const int16_t *samples = (const int16_t *)frame->data[0];
-    short smr[MPA_MAX_CHANNELS][SBLIMIT];
-    unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT];
-    int padding, i, ret;
-
-    for(i=0;i<s->nb_channels;i++) {
-        filter(s, i, samples + i, s->nb_channels);
-    }
-
-    for(i=0;i<s->nb_channels;i++) {
-        compute_scale_factors(s, s->scale_code[i], s->scale_factors[i],
-                              s->sb_samples[i], s->sblimit);
-    }
-    for(i=0;i<s->nb_channels;i++) {
-        psycho_acoustic_model(s, smr[i]);
-    }
-    compute_bit_allocation(s, smr, bit_alloc, &padding);
-
-    if ((ret = ff_alloc_packet(avpkt, MPA_MAX_CODED_FRAME_SIZE))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    init_put_bits(&s->pb, avpkt->data, avpkt->size);
-
-    encode_frame(s, bit_alloc, padding);
-
-    if (frame->pts != AV_NOPTS_VALUE)
-        avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
-
-    avpkt->size = put_bits_count(&s->pb) / 8;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-static const AVCodecDefault mp2_defaults[] = {
-    { "b",    "128k" },
-    { NULL },
-};
-
-AVCodec ff_mp2_encoder = {
-    .name                  = "mp2",
-    .long_name             = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
-    .type                  = AVMEDIA_TYPE_AUDIO,
-    .id                    = AV_CODEC_ID_MP2,
-    .priv_data_size        = sizeof(MpegAudioContext),
-    .init                  = MPA_encode_init,
-    .encode2               = MPA_encode_frame,
-    .sample_fmts           = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                            AV_SAMPLE_FMT_NONE },
-    .supported_samplerates = (const int[]){
-        44100, 48000,  32000, 22050, 24000, 16000, 0
-    },
-    .channel_layouts       = (const uint64_t[]){ AV_CH_LAYOUT_MONO,
-                                                 AV_CH_LAYOUT_STEREO,
-                                                 0 },
-    .defaults              = mp2_defaults,
-};
diff --git a/deps/libav/libavcodec/mpegaudiotab.h b/deps/libav/libavcodec/mpegaudiotab.h
deleted file mode 100644
index d30ef1b..0000000
--- a/deps/libav/libavcodec/mpegaudiotab.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * mpeg audio layer 2 tables. Most of them come from the mpeg audio
- * specification.
- *
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * mpeg audio layer 2 tables.
- * Most of them come from the mpeg audio specification.
- */
-
-#ifndef AVCODEC_MPEGAUDIOTAB_H
-#define AVCODEC_MPEGAUDIOTAB_H
-
-#include <stdint.h>
-#include "mpegaudio.h"
-
-#define SQRT2 1.41421356237309514547
-
-static const int costab32[30] = {
-    FIX(0.54119610014619701222),
-    FIX(1.3065629648763763537),
-
-    FIX(0.50979557910415917998),
-    FIX(2.5629154477415054814),
-    FIX(0.89997622313641556513),
-    FIX(0.60134488693504528634),
-
-    FIX(0.5024192861881556782),
-    FIX(5.1011486186891552563),
-    FIX(0.78815462345125020249),
-    FIX(0.64682178335999007679),
-    FIX(0.56694403481635768927),
-    FIX(1.0606776859903470633),
-    FIX(1.7224470982383341955),
-    FIX(0.52249861493968885462),
-
-    FIX(10.19000812354803287),
-    FIX(0.674808341455005678),
-    FIX(1.1694399334328846596),
-    FIX(0.53104259108978413284),
-    FIX(2.0577810099534108446),
-    FIX(0.58293496820613388554),
-    FIX(0.83934964541552681272),
-    FIX(0.50547095989754364798),
-    FIX(3.4076084184687189804),
-    FIX(0.62250412303566482475),
-    FIX(0.97256823786196078263),
-    FIX(0.51544730992262455249),
-    FIX(1.4841646163141661852),
-    FIX(0.5531038960344445421),
-    FIX(0.74453627100229857749),
-    FIX(0.5006029982351962726),
-};
-
-static const int bitinv32[32] = {
-    0,  16,  8, 24,  4,  20,  12,  28,
-    2,  18, 10, 26,  6,  22,  14,  30,
-    1,  17,  9, 25,  5,  21,  13,  29,
-    3,  19, 11, 27,  7,  23,  15,  31
-};
-
-
-/* signal to noise ratio of each quantification step (could be
-   computed from quant_steps[]). The values are dB multiplied by 10
-*/
-static const unsigned short quant_snr[17] = {
-     70, 110, 160, 208,
-    253, 316, 378, 439,
-    499, 559, 620, 680,
-    740, 800, 861, 920,
-    980
-};
-
-/* fixed psycho acoustic model. Values of SNR taken from the 'toolame'
-   project */
-static const float fixed_smr[SBLIMIT] =  {
-    30, 17, 16, 10, 3, 12, 8, 2.5,
-    5, 5, 6, 6, 5, 6, 10, 6,
-    -4, -10, -21, -30, -42, -55, -68, -75,
-    -75, -75, -75, -75, -91, -107, -110, -108
-};
-
-static const unsigned char nb_scale_factors[4] = { 3, 2, 1, 2 };
-
-#endif /* AVCODEC_MPEGAUDIOTAB_H */
diff --git a/deps/libav/libavcodec/mpegvideo.c b/deps/libav/libavcodec/mpegvideo.c
deleted file mode 100644
index 73778f5..0000000
--- a/deps/libav/libavcodec/mpegvideo.c
+++ /dev/null
@@ -1,2499 +0,0 @@
-/*
- * The simplest mpeg encoder (well, it was the simplest!)
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * 4MV & hq & B-frame encoding stuff by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * The simplest mpeg encoder (well, it was the simplest!).
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/timer.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "mathops.h"
-#include "mpegvideo.h"
-#include "mjpegenc.h"
-#include "msmpeg4.h"
-#include "xvmc_internal.h"
-#include "thread.h"
-#include <limits.h>
-
-static const uint8_t ff_default_chroma_qscale_table[32] = {
-//   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
-     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
-};
-
-const uint8_t ff_mpeg1_dc_scale_table[128] = {
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-};
-
-static const uint8_t mpeg2_dc_scale_table1[128] = {
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-};
-
-static const uint8_t mpeg2_dc_scale_table2[128] = {
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-};
-
-static const uint8_t mpeg2_dc_scale_table3[128] = {
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-};
-
-const uint8_t *const ff_mpeg2_dc_scale_table[4] = {
-    ff_mpeg1_dc_scale_table,
-    mpeg2_dc_scale_table1,
-    mpeg2_dc_scale_table2,
-    mpeg2_dc_scale_table3,
-};
-
-const enum AVPixelFormat ff_pixfmt_list_420[] = {
-    AV_PIX_FMT_YUV420P,
-    AV_PIX_FMT_NONE
-};
-
-static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
-                                   int16_t *block, int n, int qscale)
-{
-    int i, level, nCoeffs;
-    const uint16_t *quant_matrix;
-
-    nCoeffs= s->block_last_index[n];
-
-    if (n < 4)
-        block[0] = block[0] * s->y_dc_scale;
-    else
-        block[0] = block[0] * s->c_dc_scale;
-    /* XXX: only mpeg1 */
-    quant_matrix = s->intra_matrix;
-    for(i=1;i<=nCoeffs;i++) {
-        int j= s->intra_scantable.permutated[i];
-        level = block[j];
-        if (level) {
-            if (level < 0) {
-                level = -level;
-                level = (int)(level * qscale * quant_matrix[j]) >> 3;
-                level = (level - 1) | 1;
-                level = -level;
-            } else {
-                level = (int)(level * qscale * quant_matrix[j]) >> 3;
-                level = (level - 1) | 1;
-            }
-            block[j] = level;
-        }
-    }
-}
-
-static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
-                                   int16_t *block, int n, int qscale)
-{
-    int i, level, nCoeffs;
-    const uint16_t *quant_matrix;
-
-    nCoeffs= s->block_last_index[n];
-
-    quant_matrix = s->inter_matrix;
-    for(i=0; i<=nCoeffs; i++) {
-        int j= s->intra_scantable.permutated[i];
-        level = block[j];
-        if (level) {
-            if (level < 0) {
-                level = -level;
-                level = (((level << 1) + 1) * qscale *
-                         ((int) (quant_matrix[j]))) >> 4;
-                level = (level - 1) | 1;
-                level = -level;
-            } else {
-                level = (((level << 1) + 1) * qscale *
-                         ((int) (quant_matrix[j]))) >> 4;
-                level = (level - 1) | 1;
-            }
-            block[j] = level;
-        }
-    }
-}
-
-static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
-                                   int16_t *block, int n, int qscale)
-{
-    int i, level, nCoeffs;
-    const uint16_t *quant_matrix;
-
-    if(s->alternate_scan) nCoeffs= 63;
-    else nCoeffs= s->block_last_index[n];
-
-    if (n < 4)
-        block[0] = block[0] * s->y_dc_scale;
-    else
-        block[0] = block[0] * s->c_dc_scale;
-    quant_matrix = s->intra_matrix;
-    for(i=1;i<=nCoeffs;i++) {
-        int j= s->intra_scantable.permutated[i];
-        level = block[j];
-        if (level) {
-            if (level < 0) {
-                level = -level;
-                level = (int)(level * qscale * quant_matrix[j]) >> 3;
-                level = -level;
-            } else {
-                level = (int)(level * qscale * quant_matrix[j]) >> 3;
-            }
-            block[j] = level;
-        }
-    }
-}
-
-static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
-                                   int16_t *block, int n, int qscale)
-{
-    int i, level, nCoeffs;
-    const uint16_t *quant_matrix;
-    int sum=-1;
-
-    if(s->alternate_scan) nCoeffs= 63;
-    else nCoeffs= s->block_last_index[n];
-
-    if (n < 4)
-        block[0] = block[0] * s->y_dc_scale;
-    else
-        block[0] = block[0] * s->c_dc_scale;
-    quant_matrix = s->intra_matrix;
-    for(i=1;i<=nCoeffs;i++) {
-        int j= s->intra_scantable.permutated[i];
-        level = block[j];
-        if (level) {
-            if (level < 0) {
-                level = -level;
-                level = (int)(level * qscale * quant_matrix[j]) >> 3;
-                level = -level;
-            } else {
-                level = (int)(level * qscale * quant_matrix[j]) >> 3;
-            }
-            block[j] = level;
-            sum+=level;
-        }
-    }
-    block[63]^=sum&1;
-}
-
-static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
-                                   int16_t *block, int n, int qscale)
-{
-    int i, level, nCoeffs;
-    const uint16_t *quant_matrix;
-    int sum=-1;
-
-    if(s->alternate_scan) nCoeffs= 63;
-    else nCoeffs= s->block_last_index[n];
-
-    quant_matrix = s->inter_matrix;
-    for(i=0; i<=nCoeffs; i++) {
-        int j= s->intra_scantable.permutated[i];
-        level = block[j];
-        if (level) {
-            if (level < 0) {
-                level = -level;
-                level = (((level << 1) + 1) * qscale *
-                         ((int) (quant_matrix[j]))) >> 4;
-                level = -level;
-            } else {
-                level = (((level << 1) + 1) * qscale *
-                         ((int) (quant_matrix[j]))) >> 4;
-            }
-            block[j] = level;
-            sum+=level;
-        }
-    }
-    block[63]^=sum&1;
-}
-
-static void dct_unquantize_h263_intra_c(MpegEncContext *s,
-                                  int16_t *block, int n, int qscale)
-{
-    int i, level, qmul, qadd;
-    int nCoeffs;
-
-    assert(s->block_last_index[n]>=0);
-
-    qmul = qscale << 1;
-
-    if (!s->h263_aic) {
-        if (n < 4)
-            block[0] = block[0] * s->y_dc_scale;
-        else
-            block[0] = block[0] * s->c_dc_scale;
-        qadd = (qscale - 1) | 1;
-    }else{
-        qadd = 0;
-    }
-    if(s->ac_pred)
-        nCoeffs=63;
-    else
-        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
-    for(i=1; i<=nCoeffs; i++) {
-        level = block[i];
-        if (level) {
-            if (level < 0) {
-                level = level * qmul - qadd;
-            } else {
-                level = level * qmul + qadd;
-            }
-            block[i] = level;
-        }
-    }
-}
-
-static void dct_unquantize_h263_inter_c(MpegEncContext *s,
-                                  int16_t *block, int n, int qscale)
-{
-    int i, level, qmul, qadd;
-    int nCoeffs;
-
-    assert(s->block_last_index[n]>=0);
-
-    qadd = (qscale - 1) | 1;
-    qmul = qscale << 1;
-
-    nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
-    for(i=0; i<=nCoeffs; i++) {
-        level = block[i];
-        if (level) {
-            if (level < 0) {
-                level = level * qmul - qadd;
-            } else {
-                level = level * qmul + qadd;
-            }
-            block[i] = level;
-        }
-    }
-}
-
-static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
-                              int (*mv)[2][4][2],
-                              int mb_x, int mb_y, int mb_intra, int mb_skipped)
-{
-    MpegEncContext *s = opaque;
-
-    s->mv_dir     = mv_dir;
-    s->mv_type    = mv_type;
-    s->mb_intra   = mb_intra;
-    s->mb_skipped = mb_skipped;
-    s->mb_x       = mb_x;
-    s->mb_y       = mb_y;
-    memcpy(s->mv, mv, sizeof(*mv));
-
-    ff_init_block_index(s);
-    ff_update_block_index(s);
-
-    s->dsp.clear_blocks(s->block[0]);
-
-    s->dest[0] = s->current_picture.f.data[0] + (s->mb_y *  16                       * s->linesize)   + s->mb_x *  16;
-    s->dest[1] = s->current_picture.f.data[1] + (s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16 >> s->chroma_x_shift);
-    s->dest[2] = s->current_picture.f.data[2] + (s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16 >> s->chroma_x_shift);
-
-    assert(ref == 0);
-    ff_MPV_decode_mb(s, s->block);
-}
-
-/* init common dct for both encoder and decoder */
-av_cold int ff_dct_common_init(MpegEncContext *s)
-{
-    ff_dsputil_init(&s->dsp, s->avctx);
-    ff_hpeldsp_init(&s->hdsp, s->avctx->flags);
-    ff_videodsp_init(&s->vdsp, s->avctx->bits_per_raw_sample);
-
-    s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_c;
-    s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_c;
-    s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_c;
-    s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_c;
-    s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_c;
-    if (s->flags & CODEC_FLAG_BITEXACT)
-        s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact;
-    s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c;
-
-    if (ARCH_ARM)
-        ff_MPV_common_init_arm(s);
-    if (ARCH_PPC)
-        ff_MPV_common_init_ppc(s);
-    if (ARCH_X86)
-        ff_MPV_common_init_x86(s);
-
-    /* load & permutate scantables
-     * note: only wmv uses different ones
-     */
-    if (s->alternate_scan) {
-        ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable  , ff_alternate_vertical_scan);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable  , ff_alternate_vertical_scan);
-    } else {
-        ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable  , ff_zigzag_direct);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable  , ff_zigzag_direct);
-    }
-    ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan);
-    ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
-
-    return 0;
-}
-
-static int frame_size_alloc(MpegEncContext *s, int linesize)
-{
-    int alloc_size = FFALIGN(FFABS(linesize) + 32, 32);
-
-    // edge emu needs blocksize + filter length - 1
-    // (= 17x17 for  halfpel / 21x21 for  h264)
-    // VC1 computes luma and chroma simultaneously and needs 19X19 + 9x9
-    // at uvlinesize. It supports only YUV420 so 24x24 is enough
-    // linesize * interlaced * MBsize
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->edge_emu_buffer, alloc_size * 2 * 24,
-                      fail);
-
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad, alloc_size * 2 * 16 * 3,
-                      fail)
-    s->me.temp         = s->me.scratchpad;
-    s->rd_scratchpad   = s->me.scratchpad;
-    s->b_scratchpad    = s->me.scratchpad;
-    s->obmc_scratchpad = s->me.scratchpad + 16;
-
-    return 0;
-fail:
-    av_freep(&s->edge_emu_buffer);
-    return AVERROR(ENOMEM);
-}
-
-/**
- * Allocate a frame buffer
- */
-static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
-{
-    int edges_needed = av_codec_is_encoder(s->avctx->codec);
-    int r, ret;
-
-    pic->tf.f = &pic->f;
-    if (s->codec_id != AV_CODEC_ID_WMV3IMAGE &&
-        s->codec_id != AV_CODEC_ID_VC1IMAGE  &&
-        s->codec_id != AV_CODEC_ID_MSS2) {
-        if (edges_needed) {
-            pic->f.width  = s->avctx->width  + 2 * EDGE_WIDTH;
-            pic->f.height = s->avctx->height + 2 * EDGE_WIDTH;
-        }
-
-        r = ff_thread_get_buffer(s->avctx, &pic->tf,
-                                 pic->reference ? AV_GET_BUFFER_FLAG_REF : 0);
-    } else {
-        pic->f.width  = s->avctx->width;
-        pic->f.height = s->avctx->height;
-        pic->f.format = s->avctx->pix_fmt;
-        r = avcodec_default_get_buffer2(s->avctx, &pic->f, 0);
-    }
-
-    if (r < 0 || !pic->f.buf[0]) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (%d %p)\n",
-               r, pic->f.data[0]);
-        return -1;
-    }
-
-    if (edges_needed) {
-        int i;
-        for (i = 0; pic->f.data[i]; i++) {
-            int offset = (EDGE_WIDTH >> (i ? s->chroma_y_shift : 0)) *
-                         pic->f.linesize[i] +
-                         (EDGE_WIDTH >> (i ? s->chroma_x_shift : 0));
-            pic->f.data[i] += offset;
-        }
-        pic->f.width  = s->avctx->width;
-        pic->f.height = s->avctx->height;
-    }
-
-    if (s->avctx->hwaccel) {
-        assert(!pic->hwaccel_picture_private);
-        if (s->avctx->hwaccel->priv_data_size) {
-            pic->hwaccel_priv_buf = av_buffer_allocz(s->avctx->hwaccel->priv_data_size);
-            if (!pic->hwaccel_priv_buf) {
-                av_log(s->avctx, AV_LOG_ERROR, "alloc_frame_buffer() failed (hwaccel private data allocation)\n");
-                return -1;
-            }
-            pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data;
-        }
-    }
-
-    if (s->linesize && (s->linesize   != pic->f.linesize[0] ||
-                        s->uvlinesize != pic->f.linesize[1])) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "get_buffer() failed (stride changed)\n");
-        ff_mpeg_unref_picture(s, pic);
-        return -1;
-    }
-
-    if (pic->f.linesize[1] != pic->f.linesize[2]) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "get_buffer() failed (uv stride mismatch)\n");
-        ff_mpeg_unref_picture(s, pic);
-        return -1;
-    }
-
-    if (!s->edge_emu_buffer &&
-        (ret = frame_size_alloc(s, pic->f.linesize[0])) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "get_buffer() failed to allocate context scratch buffers.\n");
-        ff_mpeg_unref_picture(s, pic);
-        return ret;
-    }
-
-    return 0;
-}
-
-void ff_free_picture_tables(Picture *pic)
-{
-    int i;
-
-    av_buffer_unref(&pic->mb_var_buf);
-    av_buffer_unref(&pic->mc_mb_var_buf);
-    av_buffer_unref(&pic->mb_mean_buf);
-    av_buffer_unref(&pic->mbskip_table_buf);
-    av_buffer_unref(&pic->qscale_table_buf);
-    av_buffer_unref(&pic->mb_type_buf);
-
-    for (i = 0; i < 2; i++) {
-        av_buffer_unref(&pic->motion_val_buf[i]);
-        av_buffer_unref(&pic->ref_index_buf[i]);
-    }
-}
-
-static int alloc_picture_tables(MpegEncContext *s, Picture *pic)
-{
-    const int big_mb_num    = s->mb_stride * (s->mb_height + 1) + 1;
-    const int mb_array_size = s->mb_stride * s->mb_height;
-    const int b8_array_size = s->b8_stride * s->mb_height * 2;
-    int i;
-
-
-    pic->mbskip_table_buf = av_buffer_allocz(mb_array_size + 2);
-    pic->qscale_table_buf = av_buffer_allocz(big_mb_num + s->mb_stride);
-    pic->mb_type_buf      = av_buffer_allocz((big_mb_num + s->mb_stride) *
-                                             sizeof(uint32_t));
-    if (!pic->mbskip_table_buf || !pic->qscale_table_buf || !pic->mb_type_buf)
-        return AVERROR(ENOMEM);
-
-    if (s->encoding) {
-        pic->mb_var_buf    = av_buffer_allocz(mb_array_size * sizeof(int16_t));
-        pic->mc_mb_var_buf = av_buffer_allocz(mb_array_size * sizeof(int16_t));
-        pic->mb_mean_buf   = av_buffer_allocz(mb_array_size);
-        if (!pic->mb_var_buf || !pic->mc_mb_var_buf || !pic->mb_mean_buf)
-            return AVERROR(ENOMEM);
-    }
-
-    if (s->out_format == FMT_H263 || s->encoding) {
-        int mv_size        = 2 * (b8_array_size + 4) * sizeof(int16_t);
-        int ref_index_size = 4 * mb_array_size;
-
-        for (i = 0; mv_size && i < 2; i++) {
-            pic->motion_val_buf[i] = av_buffer_allocz(mv_size);
-            pic->ref_index_buf[i]  = av_buffer_allocz(ref_index_size);
-            if (!pic->motion_val_buf[i] || !pic->ref_index_buf[i])
-                return AVERROR(ENOMEM);
-        }
-    }
-
-    return 0;
-}
-
-static int make_tables_writable(Picture *pic)
-{
-    int ret, i;
-#define MAKE_WRITABLE(table) \
-do {\
-    if (pic->table &&\
-       (ret = av_buffer_make_writable(&pic->table)) < 0)\
-    return ret;\
-} while (0)
-
-    MAKE_WRITABLE(mb_var_buf);
-    MAKE_WRITABLE(mc_mb_var_buf);
-    MAKE_WRITABLE(mb_mean_buf);
-    MAKE_WRITABLE(mbskip_table_buf);
-    MAKE_WRITABLE(qscale_table_buf);
-    MAKE_WRITABLE(mb_type_buf);
-
-    for (i = 0; i < 2; i++) {
-        MAKE_WRITABLE(motion_val_buf[i]);
-        MAKE_WRITABLE(ref_index_buf[i]);
-    }
-
-    return 0;
-}
-
-/**
- * Allocate a Picture.
- * The pixels are allocated/set by calling get_buffer() if shared = 0
- */
-int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared)
-{
-    int i, ret;
-
-    if (shared) {
-        assert(pic->f.data[0]);
-        pic->shared = 1;
-    } else {
-        assert(!pic->f.buf[0]);
-
-        if (alloc_frame_buffer(s, pic) < 0)
-            return -1;
-
-        s->linesize   = pic->f.linesize[0];
-        s->uvlinesize = pic->f.linesize[1];
-    }
-
-    if (!pic->qscale_table_buf)
-        ret = alloc_picture_tables(s, pic);
-    else
-        ret = make_tables_writable(pic);
-    if (ret < 0)
-        goto fail;
-
-    if (s->encoding) {
-        pic->mb_var    = (uint16_t*)pic->mb_var_buf->data;
-        pic->mc_mb_var = (uint16_t*)pic->mc_mb_var_buf->data;
-        pic->mb_mean   = pic->mb_mean_buf->data;
-    }
-
-    pic->mbskip_table = pic->mbskip_table_buf->data;
-    pic->qscale_table = pic->qscale_table_buf->data + 2 * s->mb_stride + 1;
-    pic->mb_type      = (uint32_t*)pic->mb_type_buf->data + 2 * s->mb_stride + 1;
-
-    if (pic->motion_val_buf[0]) {
-        for (i = 0; i < 2; i++) {
-            pic->motion_val[i] = (int16_t (*)[2])pic->motion_val_buf[i]->data + 4;
-            pic->ref_index[i]  = pic->ref_index_buf[i]->data;
-        }
-    }
-
-    return 0;
-fail:
-    av_log(s->avctx, AV_LOG_ERROR, "Error allocating a picture.\n");
-    ff_mpeg_unref_picture(s, pic);
-    ff_free_picture_tables(pic);
-    return AVERROR(ENOMEM);
-}
-
-/**
- * Deallocate a picture.
- */
-void ff_mpeg_unref_picture(MpegEncContext *s, Picture *pic)
-{
-    int off = offsetof(Picture, mb_mean) + sizeof(pic->mb_mean);
-
-    pic->tf.f = &pic->f;
-    /* WM Image / Screen codecs allocate internal buffers with different
-     * dimensions / colorspaces; ignore user-defined callbacks for these. */
-    if (s->codec_id != AV_CODEC_ID_WMV3IMAGE &&
-        s->codec_id != AV_CODEC_ID_VC1IMAGE  &&
-        s->codec_id != AV_CODEC_ID_MSS2)
-        ff_thread_release_buffer(s->avctx, &pic->tf);
-    else
-        av_frame_unref(&pic->f);
-
-    av_buffer_unref(&pic->hwaccel_priv_buf);
-
-    if (pic->needs_realloc)
-        ff_free_picture_tables(pic);
-
-    memset((uint8_t*)pic + off, 0, sizeof(*pic) - off);
-}
-
-static int update_picture_tables(Picture *dst, Picture *src)
-{
-     int i;
-
-#define UPDATE_TABLE(table)\
-do {\
-    if (src->table &&\
-        (!dst->table || dst->table->buffer != src->table->buffer)) {\
-        av_buffer_unref(&dst->table);\
-        dst->table = av_buffer_ref(src->table);\
-        if (!dst->table) {\
-            ff_free_picture_tables(dst);\
-            return AVERROR(ENOMEM);\
-        }\
-    }\
-} while (0)
-
-    UPDATE_TABLE(mb_var_buf);
-    UPDATE_TABLE(mc_mb_var_buf);
-    UPDATE_TABLE(mb_mean_buf);
-    UPDATE_TABLE(mbskip_table_buf);
-    UPDATE_TABLE(qscale_table_buf);
-    UPDATE_TABLE(mb_type_buf);
-    for (i = 0; i < 2; i++) {
-        UPDATE_TABLE(motion_val_buf[i]);
-        UPDATE_TABLE(ref_index_buf[i]);
-    }
-
-    dst->mb_var        = src->mb_var;
-    dst->mc_mb_var     = src->mc_mb_var;
-    dst->mb_mean       = src->mb_mean;
-    dst->mbskip_table  = src->mbskip_table;
-    dst->qscale_table  = src->qscale_table;
-    dst->mb_type       = src->mb_type;
-    for (i = 0; i < 2; i++) {
-        dst->motion_val[i] = src->motion_val[i];
-        dst->ref_index[i]  = src->ref_index[i];
-    }
-
-    return 0;
-}
-
-int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src)
-{
-    int ret;
-
-    av_assert0(!dst->f.buf[0]);
-    av_assert0(src->f.buf[0]);
-
-    src->tf.f = &src->f;
-    dst->tf.f = &dst->f;
-    ret = ff_thread_ref_frame(&dst->tf, &src->tf);
-    if (ret < 0)
-        goto fail;
-
-    ret = update_picture_tables(dst, src);
-    if (ret < 0)
-        goto fail;
-
-    if (src->hwaccel_picture_private) {
-        dst->hwaccel_priv_buf = av_buffer_ref(src->hwaccel_priv_buf);
-        if (!dst->hwaccel_priv_buf)
-            goto fail;
-        dst->hwaccel_picture_private = dst->hwaccel_priv_buf->data;
-    }
-
-    dst->field_picture           = src->field_picture;
-    dst->mb_var_sum              = src->mb_var_sum;
-    dst->mc_mb_var_sum           = src->mc_mb_var_sum;
-    dst->b_frame_score           = src->b_frame_score;
-    dst->needs_realloc           = src->needs_realloc;
-    dst->reference               = src->reference;
-    dst->shared                  = src->shared;
-
-    return 0;
-fail:
-    ff_mpeg_unref_picture(s, dst);
-    return ret;
-}
-
-static void exchange_uv(MpegEncContext *s)
-{
-    int16_t (*tmp)[64];
-
-    tmp           = s->pblocks[4];
-    s->pblocks[4] = s->pblocks[5];
-    s->pblocks[5] = tmp;
-}
-
-static int init_duplicate_context(MpegEncContext *s)
-{
-    int y_size = s->b8_stride * (2 * s->mb_height + 1);
-    int c_size = s->mb_stride * (s->mb_height + 1);
-    int yc_size = y_size + 2 * c_size;
-    int i;
-
-    s->edge_emu_buffer =
-    s->me.scratchpad   =
-    s->me.temp         =
-    s->rd_scratchpad   =
-    s->b_scratchpad    =
-    s->obmc_scratchpad = NULL;
-
-    if (s->encoding) {
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->me.map,
-                          ME_MAP_SIZE * sizeof(uint32_t), fail)
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->me.score_map,
-                          ME_MAP_SIZE * sizeof(uint32_t), fail)
-        if (s->avctx->noise_reduction) {
-            FF_ALLOCZ_OR_GOTO(s->avctx, s->dct_error_sum,
-                              2 * 64 * sizeof(int), fail)
-        }
-    }
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->blocks, 64 * 12 * 2 * sizeof(int16_t), fail)
-    s->block = s->blocks[0];
-
-    for (i = 0; i < 12; i++) {
-        s->pblocks[i] = &s->block[i];
-    }
-    if (s->avctx->codec_tag == AV_RL32("VCR2"))
-        exchange_uv(s);
-
-    if (s->out_format == FMT_H263) {
-        /* ac values */
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->ac_val_base,
-                          yc_size * sizeof(int16_t) * 16, fail);
-        s->ac_val[0] = s->ac_val_base + s->b8_stride + 1;
-        s->ac_val[1] = s->ac_val_base + y_size + s->mb_stride + 1;
-        s->ac_val[2] = s->ac_val[1] + c_size;
-    }
-
-    return 0;
-fail:
-    return -1; // free() through ff_MPV_common_end()
-}
-
-static void free_duplicate_context(MpegEncContext *s)
-{
-    if (s == NULL)
-        return;
-
-    av_freep(&s->edge_emu_buffer);
-    av_freep(&s->me.scratchpad);
-    s->me.temp =
-    s->rd_scratchpad =
-    s->b_scratchpad =
-    s->obmc_scratchpad = NULL;
-
-    av_freep(&s->dct_error_sum);
-    av_freep(&s->me.map);
-    av_freep(&s->me.score_map);
-    av_freep(&s->blocks);
-    av_freep(&s->ac_val_base);
-    s->block = NULL;
-}
-
-static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src)
-{
-#define COPY(a) bak->a = src->a
-    COPY(edge_emu_buffer);
-    COPY(me.scratchpad);
-    COPY(me.temp);
-    COPY(rd_scratchpad);
-    COPY(b_scratchpad);
-    COPY(obmc_scratchpad);
-    COPY(me.map);
-    COPY(me.score_map);
-    COPY(blocks);
-    COPY(block);
-    COPY(start_mb_y);
-    COPY(end_mb_y);
-    COPY(me.map_generation);
-    COPY(pb);
-    COPY(dct_error_sum);
-    COPY(dct_count[0]);
-    COPY(dct_count[1]);
-    COPY(ac_val_base);
-    COPY(ac_val[0]);
-    COPY(ac_val[1]);
-    COPY(ac_val[2]);
-#undef COPY
-}
-
-int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src)
-{
-    MpegEncContext bak;
-    int i, ret;
-    // FIXME copy only needed parts
-    // START_TIMER
-    backup_duplicate_context(&bak, dst);
-    memcpy(dst, src, sizeof(MpegEncContext));
-    backup_duplicate_context(dst, &bak);
-    for (i = 0; i < 12; i++) {
-        dst->pblocks[i] = &dst->block[i];
-    }
-    if (dst->avctx->codec_tag == AV_RL32("VCR2"))
-        exchange_uv(dst);
-    if (!dst->edge_emu_buffer &&
-        (ret = frame_size_alloc(dst, dst->linesize)) < 0) {
-        av_log(dst->avctx, AV_LOG_ERROR, "failed to allocate context "
-               "scratch buffers.\n");
-        return ret;
-    }
-    // STOP_TIMER("update_duplicate_context")
-    // about 10k cycles / 0.01 sec for  1000frames on 1ghz with 2 threads
-    return 0;
-}
-
-int ff_mpeg_update_thread_context(AVCodecContext *dst,
-                                  const AVCodecContext *src)
-{
-    int i, ret;
-    MpegEncContext *s = dst->priv_data, *s1 = src->priv_data;
-
-    if (dst == src || !s1->context_initialized)
-        return 0;
-
-    // FIXME can parameters change on I-frames?
-    // in that case dst may need a reinit
-    if (!s->context_initialized) {
-        memcpy(s, s1, sizeof(MpegEncContext));
-
-        s->avctx                 = dst;
-        s->bitstream_buffer      = NULL;
-        s->bitstream_buffer_size = s->allocated_bitstream_buffer_size = 0;
-
-        ff_MPV_common_init(s);
-    }
-
-    if (s->height != s1->height || s->width != s1->width || s->context_reinit) {
-        int err;
-        s->context_reinit = 0;
-        s->height = s1->height;
-        s->width  = s1->width;
-        if ((err = ff_MPV_common_frame_size_change(s)) < 0)
-            return err;
-    }
-
-    s->avctx->coded_height  = s1->avctx->coded_height;
-    s->avctx->coded_width   = s1->avctx->coded_width;
-    s->avctx->width         = s1->avctx->width;
-    s->avctx->height        = s1->avctx->height;
-
-    s->coded_picture_number = s1->coded_picture_number;
-    s->picture_number       = s1->picture_number;
-
-    for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-        ff_mpeg_unref_picture(s, &s->picture[i]);
-        if (s1->picture[i].f.buf[0] &&
-            (ret = ff_mpeg_ref_picture(s, &s->picture[i], &s1->picture[i])) < 0)
-            return ret;
-    }
-
-#define UPDATE_PICTURE(pic)\
-do {\
-    ff_mpeg_unref_picture(s, &s->pic);\
-    if (s1->pic.f.buf[0])\
-        ret = ff_mpeg_ref_picture(s, &s->pic, &s1->pic);\
-    else\
-        ret = update_picture_tables(&s->pic, &s1->pic);\
-    if (ret < 0)\
-        return ret;\
-} while (0)
-
-    UPDATE_PICTURE(current_picture);
-    UPDATE_PICTURE(last_picture);
-    UPDATE_PICTURE(next_picture);
-
-    s->last_picture_ptr    = REBASE_PICTURE(s1->last_picture_ptr,    s, s1);
-    s->current_picture_ptr = REBASE_PICTURE(s1->current_picture_ptr, s, s1);
-    s->next_picture_ptr    = REBASE_PICTURE(s1->next_picture_ptr,    s, s1);
-
-    // Error/bug resilience
-    s->next_p_frame_damaged = s1->next_p_frame_damaged;
-    s->workaround_bugs      = s1->workaround_bugs;
-
-    // MPEG4 timing info
-    memcpy(&s->last_time_base, &s1->last_time_base,
-           (char *) &s1->pb_field_time + sizeof(s1->pb_field_time) -
-           (char *) &s1->last_time_base);
-
-    // B-frame info
-    s->max_b_frames = s1->max_b_frames;
-    s->low_delay    = s1->low_delay;
-    s->droppable    = s1->droppable;
-
-    // DivX handling (doesn't work)
-    s->divx_packed  = s1->divx_packed;
-
-    if (s1->bitstream_buffer) {
-        if (s1->bitstream_buffer_size +
-            FF_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size)
-            av_fast_malloc(&s->bitstream_buffer,
-                           &s->allocated_bitstream_buffer_size,
-                           s1->allocated_bitstream_buffer_size);
-            s->bitstream_buffer_size = s1->bitstream_buffer_size;
-        memcpy(s->bitstream_buffer, s1->bitstream_buffer,
-               s1->bitstream_buffer_size);
-        memset(s->bitstream_buffer + s->bitstream_buffer_size, 0,
-               FF_INPUT_BUFFER_PADDING_SIZE);
-    }
-
-    // linesize dependend scratch buffer allocation
-    if (!s->edge_emu_buffer)
-        if (s1->linesize) {
-            if (frame_size_alloc(s, s1->linesize) < 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "Failed to allocate context "
-                       "scratch buffers.\n");
-                return AVERROR(ENOMEM);
-            }
-        } else {
-            av_log(s->avctx, AV_LOG_ERROR, "Context scratch buffers could not "
-                   "be allocated due to unknown size.\n");
-            return AVERROR_BUG;
-        }
-
-    // MPEG2/interlacing info
-    memcpy(&s->progressive_sequence, &s1->progressive_sequence,
-           (char *) &s1->rtp_mode - (char *) &s1->progressive_sequence);
-
-    if (!s1->first_field) {
-        s->last_pict_type = s1->pict_type;
-        if (s1->current_picture_ptr)
-            s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->f.quality;
-    }
-
-    return 0;
-}
-
-/**
- * Set the given MpegEncContext to common defaults
- * (same for encoding and decoding).
- * The changed fields will not depend upon the
- * prior state of the MpegEncContext.
- */
-void ff_MPV_common_defaults(MpegEncContext *s)
-{
-    s->y_dc_scale_table      =
-    s->c_dc_scale_table      = ff_mpeg1_dc_scale_table;
-    s->chroma_qscale_table   = ff_default_chroma_qscale_table;
-    s->progressive_frame     = 1;
-    s->progressive_sequence  = 1;
-    s->picture_structure     = PICT_FRAME;
-
-    s->coded_picture_number  = 0;
-    s->picture_number        = 0;
-
-    s->f_code                = 1;
-    s->b_code                = 1;
-
-    s->slice_context_count   = 1;
-}
-
-/**
- * Set the given MpegEncContext to defaults for decoding.
- * the changed fields will not depend upon
- * the prior state of the MpegEncContext.
- */
-void ff_MPV_decode_defaults(MpegEncContext *s)
-{
-    ff_MPV_common_defaults(s);
-}
-
-static int init_er(MpegEncContext *s)
-{
-    ERContext *er = &s->er;
-    int mb_array_size = s->mb_height * s->mb_stride;
-    int i;
-
-    er->avctx       = s->avctx;
-    er->dsp         = &s->dsp;
-
-    er->mb_index2xy = s->mb_index2xy;
-    er->mb_num      = s->mb_num;
-    er->mb_width    = s->mb_width;
-    er->mb_height   = s->mb_height;
-    er->mb_stride   = s->mb_stride;
-    er->b8_stride   = s->b8_stride;
-
-    er->er_temp_buffer     = av_malloc(s->mb_height * s->mb_stride);
-    er->error_status_table = av_mallocz(mb_array_size);
-    if (!er->er_temp_buffer || !er->error_status_table)
-        goto fail;
-
-    er->mbskip_table  = s->mbskip_table;
-    er->mbintra_table = s->mbintra_table;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->dc_val); i++)
-        er->dc_val[i] = s->dc_val[i];
-
-    er->decode_mb = mpeg_er_decode_mb;
-    er->opaque    = s;
-
-    return 0;
-fail:
-    av_freep(&er->er_temp_buffer);
-    av_freep(&er->error_status_table);
-    return AVERROR(ENOMEM);
-}
-
-/**
- * Initialize and allocates MpegEncContext fields dependent on the resolution.
- */
-static int init_context_frame(MpegEncContext *s)
-{
-    int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y;
-
-    s->mb_width   = (s->width + 15) / 16;
-    s->mb_stride  = s->mb_width + 1;
-    s->b8_stride  = s->mb_width * 2 + 1;
-    s->b4_stride  = s->mb_width * 4 + 1;
-    mb_array_size = s->mb_height * s->mb_stride;
-    mv_table_size = (s->mb_height + 2) * s->mb_stride + 1;
-
-    /* set default edge pos, will be overriden
-     * in decode_header if needed */
-    s->h_edge_pos = s->mb_width * 16;
-    s->v_edge_pos = s->mb_height * 16;
-
-    s->mb_num     = s->mb_width * s->mb_height;
-
-    s->block_wrap[0] =
-    s->block_wrap[1] =
-    s->block_wrap[2] =
-    s->block_wrap[3] = s->b8_stride;
-    s->block_wrap[4] =
-    s->block_wrap[5] = s->mb_stride;
-
-    y_size  = s->b8_stride * (2 * s->mb_height + 1);
-    c_size  = s->mb_stride * (s->mb_height + 1);
-    yc_size = y_size + 2   * c_size;
-
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int),
-                      fail); // error ressilience code looks cleaner with this
-    for (y = 0; y < s->mb_height; y++)
-        for (x = 0; x < s->mb_width; x++)
-            s->mb_index2xy[x + y * s->mb_width] = x + y * s->mb_stride;
-
-    s->mb_index2xy[s->mb_height * s->mb_width] =
-        (s->mb_height - 1) * s->mb_stride + s->mb_width; // FIXME really needed?
-
-    if (s->encoding) {
-        /* Allocate MV tables */
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->p_mv_table_base,
-                          mv_table_size * 2 * sizeof(int16_t), fail);
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->b_forw_mv_table_base,
-                          mv_table_size * 2 * sizeof(int16_t), fail);
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->b_back_mv_table_base,
-                          mv_table_size * 2 * sizeof(int16_t), fail);
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->b_bidir_forw_mv_table_base,
-                          mv_table_size * 2 * sizeof(int16_t), fail);
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->b_bidir_back_mv_table_base,
-                          mv_table_size * 2 * sizeof(int16_t), fail);
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->b_direct_mv_table_base,
-                          mv_table_size * 2 * sizeof(int16_t), fail);
-        s->p_mv_table            = s->p_mv_table_base + s->mb_stride + 1;
-        s->b_forw_mv_table       = s->b_forw_mv_table_base + s->mb_stride + 1;
-        s->b_back_mv_table       = s->b_back_mv_table_base + s->mb_stride + 1;
-        s->b_bidir_forw_mv_table = s->b_bidir_forw_mv_table_base +
-                                   s->mb_stride + 1;
-        s->b_bidir_back_mv_table = s->b_bidir_back_mv_table_base +
-                                   s->mb_stride + 1;
-        s->b_direct_mv_table     = s->b_direct_mv_table_base + s->mb_stride + 1;
-
-        /* Allocate MB type table */
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_type, mb_array_size *
-                          sizeof(uint16_t), fail); // needed for encoding
-
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->lambda_table, mb_array_size *
-                          sizeof(int), fail);
-
-        FF_ALLOC_OR_GOTO(s->avctx, s->cplx_tab,
-                         mb_array_size * sizeof(float), fail);
-        FF_ALLOC_OR_GOTO(s->avctx, s->bits_tab,
-                         mb_array_size * sizeof(float), fail);
-
-    }
-
-    if (s->codec_id == AV_CODEC_ID_MPEG4 ||
-        (s->flags & CODEC_FLAG_INTERLACED_ME)) {
-        /* interlaced direct mode decoding tables */
-        for (i = 0; i < 2; i++) {
-            int j, k;
-            for (j = 0; j < 2; j++) {
-                for (k = 0; k < 2; k++) {
-                    FF_ALLOCZ_OR_GOTO(s->avctx,
-                                      s->b_field_mv_table_base[i][j][k],
-                                      mv_table_size * 2 * sizeof(int16_t),
-                                      fail);
-                    s->b_field_mv_table[i][j][k] = s->b_field_mv_table_base[i][j][k] +
-                                                   s->mb_stride + 1;
-                }
-                FF_ALLOCZ_OR_GOTO(s->avctx, s->b_field_select_table [i][j],
-                                  mb_array_size * 2 * sizeof(uint8_t), fail);
-                FF_ALLOCZ_OR_GOTO(s->avctx, s->p_field_mv_table_base[i][j],
-                                  mv_table_size * 2 * sizeof(int16_t), fail);
-                s->p_field_mv_table[i][j] = s->p_field_mv_table_base[i][j]
-                                            + s->mb_stride + 1;
-            }
-            FF_ALLOCZ_OR_GOTO(s->avctx, s->p_field_select_table[i],
-                              mb_array_size * 2 * sizeof(uint8_t), fail);
-        }
-    }
-    if (s->out_format == FMT_H263) {
-        /* cbp values */
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->coded_block_base, y_size, fail);
-        s->coded_block = s->coded_block_base + s->b8_stride + 1;
-
-        /* cbp, ac_pred, pred_dir */
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->cbp_table,
-                          mb_array_size * sizeof(uint8_t), fail);
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->pred_dir_table,
-                          mb_array_size * sizeof(uint8_t), fail);
-    }
-
-    if (s->h263_pred || s->h263_plus || !s->encoding) {
-        /* dc values */
-        // MN: we need these for  error resilience of intra-frames
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->dc_val_base,
-                          yc_size * sizeof(int16_t), fail);
-        s->dc_val[0] = s->dc_val_base + s->b8_stride + 1;
-        s->dc_val[1] = s->dc_val_base + y_size + s->mb_stride + 1;
-        s->dc_val[2] = s->dc_val[1] + c_size;
-        for (i = 0; i < yc_size; i++)
-            s->dc_val_base[i] = 1024;
-    }
-
-    /* which mb is a intra block */
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->mbintra_table, mb_array_size, fail);
-    memset(s->mbintra_table, 1, mb_array_size);
-
-    /* init macroblock skip table */
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->mbskip_table, mb_array_size + 2, fail);
-    // Note the + 1 is for  a quicker mpeg4 slice_end detection
-
-    return init_er(s);
-fail:
-    return AVERROR(ENOMEM);
-}
-
-/**
- * init common structure for both encoder and decoder.
- * this assumes that some variables like width/height are already set
- */
-av_cold int ff_MPV_common_init(MpegEncContext *s)
-{
-    int i;
-    int nb_slices = (HAVE_THREADS &&
-                     s->avctx->active_thread_type & FF_THREAD_SLICE) ?
-                    s->avctx->thread_count : 1;
-
-    if (s->encoding && s->avctx->slices)
-        nb_slices = s->avctx->slices;
-
-    if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO && !s->progressive_sequence)
-        s->mb_height = (s->height + 31) / 32 * 2;
-    else
-        s->mb_height = (s->height + 15) / 16;
-
-    if (s->avctx->pix_fmt == AV_PIX_FMT_NONE) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "decoding to AV_PIX_FMT_NONE is not supported.\n");
-        return -1;
-    }
-
-    if (nb_slices > MAX_THREADS || (nb_slices > s->mb_height && s->mb_height)) {
-        int max_slices;
-        if (s->mb_height)
-            max_slices = FFMIN(MAX_THREADS, s->mb_height);
-        else
-            max_slices = MAX_THREADS;
-        av_log(s->avctx, AV_LOG_WARNING, "too many threads/slices (%d),"
-               " reducing to %d\n", nb_slices, max_slices);
-        nb_slices = max_slices;
-    }
-
-    if ((s->width || s->height) &&
-        av_image_check_size(s->width, s->height, 0, s->avctx))
-        return -1;
-
-    ff_dct_common_init(s);
-
-    s->flags  = s->avctx->flags;
-    s->flags2 = s->avctx->flags2;
-
-    /* set chroma shifts */
-    av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
-                                     &s->chroma_x_shift,
-                                     &s->chroma_y_shift);
-
-    /* convert fourcc to upper case */
-    s->codec_tag          = avpriv_toupper4(s->avctx->codec_tag);
-
-    s->stream_codec_tag   = avpriv_toupper4(s->avctx->stream_codec_tag);
-
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->picture,
-                      MAX_PICTURE_COUNT * sizeof(Picture), fail);
-    for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-        av_frame_unref(&s->picture[i].f);
-    }
-    memset(&s->next_picture, 0, sizeof(s->next_picture));
-    memset(&s->last_picture, 0, sizeof(s->last_picture));
-    memset(&s->current_picture, 0, sizeof(s->current_picture));
-    av_frame_unref(&s->next_picture.f);
-    av_frame_unref(&s->last_picture.f);
-    av_frame_unref(&s->current_picture.f);
-
-    if (s->width && s->height) {
-        if (init_context_frame(s))
-            goto fail;
-
-        s->parse_context.state = -1;
-    }
-
-    s->context_initialized = 1;
-    s->thread_context[0]   = s;
-
-    if (s->width && s->height) {
-        if (nb_slices > 1) {
-            for (i = 1; i < nb_slices; i++) {
-                s->thread_context[i] = av_malloc(sizeof(MpegEncContext));
-                memcpy(s->thread_context[i], s, sizeof(MpegEncContext));
-            }
-
-            for (i = 0; i < nb_slices; i++) {
-                if (init_duplicate_context(s->thread_context[i]) < 0)
-                    goto fail;
-                    s->thread_context[i]->start_mb_y =
-                        (s->mb_height * (i) + nb_slices / 2) / nb_slices;
-                    s->thread_context[i]->end_mb_y   =
-                        (s->mb_height * (i + 1) + nb_slices / 2) / nb_slices;
-            }
-        } else {
-            if (init_duplicate_context(s) < 0)
-                goto fail;
-            s->start_mb_y = 0;
-            s->end_mb_y   = s->mb_height;
-        }
-        s->slice_context_count = nb_slices;
-    }
-
-    return 0;
- fail:
-    ff_MPV_common_end(s);
-    return -1;
-}
-
-/**
- * Frees and resets MpegEncContext fields depending on the resolution.
- * Is used during resolution changes to avoid a full reinitialization of the
- * codec.
- */
-static int free_context_frame(MpegEncContext *s)
-{
-    int i, j, k;
-
-    av_freep(&s->mb_type);
-    av_freep(&s->p_mv_table_base);
-    av_freep(&s->b_forw_mv_table_base);
-    av_freep(&s->b_back_mv_table_base);
-    av_freep(&s->b_bidir_forw_mv_table_base);
-    av_freep(&s->b_bidir_back_mv_table_base);
-    av_freep(&s->b_direct_mv_table_base);
-    s->p_mv_table            = NULL;
-    s->b_forw_mv_table       = NULL;
-    s->b_back_mv_table       = NULL;
-    s->b_bidir_forw_mv_table = NULL;
-    s->b_bidir_back_mv_table = NULL;
-    s->b_direct_mv_table     = NULL;
-    for (i = 0; i < 2; i++) {
-        for (j = 0; j < 2; j++) {
-            for (k = 0; k < 2; k++) {
-                av_freep(&s->b_field_mv_table_base[i][j][k]);
-                s->b_field_mv_table[i][j][k] = NULL;
-            }
-            av_freep(&s->b_field_select_table[i][j]);
-            av_freep(&s->p_field_mv_table_base[i][j]);
-            s->p_field_mv_table[i][j] = NULL;
-        }
-        av_freep(&s->p_field_select_table[i]);
-    }
-
-    av_freep(&s->dc_val_base);
-    av_freep(&s->coded_block_base);
-    av_freep(&s->mbintra_table);
-    av_freep(&s->cbp_table);
-    av_freep(&s->pred_dir_table);
-
-    av_freep(&s->mbskip_table);
-
-    av_freep(&s->er.error_status_table);
-    av_freep(&s->er.er_temp_buffer);
-    av_freep(&s->mb_index2xy);
-    av_freep(&s->lambda_table);
-    av_freep(&s->cplx_tab);
-    av_freep(&s->bits_tab);
-
-    s->linesize = s->uvlinesize = 0;
-
-    return 0;
-}
-
-int ff_MPV_common_frame_size_change(MpegEncContext *s)
-{
-    int i, err = 0;
-
-    if (s->slice_context_count > 1) {
-        for (i = 0; i < s->slice_context_count; i++) {
-            free_duplicate_context(s->thread_context[i]);
-        }
-        for (i = 1; i < s->slice_context_count; i++) {
-            av_freep(&s->thread_context[i]);
-        }
-    } else
-        free_duplicate_context(s);
-
-    if ((err = free_context_frame(s)) < 0)
-        return err;
-
-    if (s->picture)
-        for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-                s->picture[i].needs_realloc = 1;
-        }
-
-    s->last_picture_ptr         =
-    s->next_picture_ptr         =
-    s->current_picture_ptr      = NULL;
-
-    // init
-    if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO && !s->progressive_sequence)
-        s->mb_height = (s->height + 31) / 32 * 2;
-    else
-        s->mb_height = (s->height + 15) / 16;
-
-    if ((s->width || s->height) &&
-        av_image_check_size(s->width, s->height, 0, s->avctx))
-        return AVERROR_INVALIDDATA;
-
-    if ((err = init_context_frame(s)))
-        goto fail;
-
-    s->thread_context[0]   = s;
-
-    if (s->width && s->height) {
-        int nb_slices = s->slice_context_count;
-        if (nb_slices > 1) {
-            for (i = 1; i < nb_slices; i++) {
-                s->thread_context[i] = av_malloc(sizeof(MpegEncContext));
-                memcpy(s->thread_context[i], s, sizeof(MpegEncContext));
-            }
-
-            for (i = 0; i < nb_slices; i++) {
-                if (init_duplicate_context(s->thread_context[i]) < 0)
-                    goto fail;
-                    s->thread_context[i]->start_mb_y =
-                        (s->mb_height * (i) + nb_slices / 2) / nb_slices;
-                    s->thread_context[i]->end_mb_y   =
-                        (s->mb_height * (i + 1) + nb_slices / 2) / nb_slices;
-            }
-        } else {
-            if (init_duplicate_context(s) < 0)
-                goto fail;
-            s->start_mb_y = 0;
-            s->end_mb_y   = s->mb_height;
-        }
-        s->slice_context_count = nb_slices;
-    }
-
-    return 0;
- fail:
-    ff_MPV_common_end(s);
-    return err;
-}
-
-/* init common structure for both encoder and decoder */
-void ff_MPV_common_end(MpegEncContext *s)
-{
-    int i;
-
-    if (s->slice_context_count > 1) {
-        for (i = 0; i < s->slice_context_count; i++) {
-            free_duplicate_context(s->thread_context[i]);
-        }
-        for (i = 1; i < s->slice_context_count; i++) {
-            av_freep(&s->thread_context[i]);
-        }
-        s->slice_context_count = 1;
-    } else free_duplicate_context(s);
-
-    av_freep(&s->parse_context.buffer);
-    s->parse_context.buffer_size = 0;
-
-    av_freep(&s->bitstream_buffer);
-    s->allocated_bitstream_buffer_size = 0;
-
-    if (s->picture) {
-        for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-            ff_free_picture_tables(&s->picture[i]);
-            ff_mpeg_unref_picture(s, &s->picture[i]);
-        }
-    }
-    av_freep(&s->picture);
-    ff_free_picture_tables(&s->last_picture);
-    ff_mpeg_unref_picture(s, &s->last_picture);
-    ff_free_picture_tables(&s->current_picture);
-    ff_mpeg_unref_picture(s, &s->current_picture);
-    ff_free_picture_tables(&s->next_picture);
-    ff_mpeg_unref_picture(s, &s->next_picture);
-
-    free_context_frame(s);
-
-    s->context_initialized      = 0;
-    s->last_picture_ptr         =
-    s->next_picture_ptr         =
-    s->current_picture_ptr      = NULL;
-    s->linesize = s->uvlinesize = 0;
-}
-
-av_cold void ff_init_rl(RLTable *rl,
-                        uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3])
-{
-    int8_t  max_level[MAX_RUN + 1], max_run[MAX_LEVEL + 1];
-    uint8_t index_run[MAX_RUN + 1];
-    int last, run, level, start, end, i;
-
-    /* If table is static, we can quit if rl->max_level[0] is not NULL */
-    if (static_store && rl->max_level[0])
-        return;
-
-    /* compute max_level[], max_run[] and index_run[] */
-    for (last = 0; last < 2; last++) {
-        if (last == 0) {
-            start = 0;
-            end = rl->last;
-        } else {
-            start = rl->last;
-            end = rl->n;
-        }
-
-        memset(max_level, 0, MAX_RUN + 1);
-        memset(max_run, 0, MAX_LEVEL + 1);
-        memset(index_run, rl->n, MAX_RUN + 1);
-        for (i = start; i < end; i++) {
-            run   = rl->table_run[i];
-            level = rl->table_level[i];
-            if (index_run[run] == rl->n)
-                index_run[run] = i;
-            if (level > max_level[run])
-                max_level[run] = level;
-            if (run > max_run[level])
-                max_run[level] = run;
-        }
-        if (static_store)
-            rl->max_level[last] = static_store[last];
-        else
-            rl->max_level[last] = av_malloc(MAX_RUN + 1);
-        memcpy(rl->max_level[last], max_level, MAX_RUN + 1);
-        if (static_store)
-            rl->max_run[last]   = static_store[last] + MAX_RUN + 1;
-        else
-            rl->max_run[last]   = av_malloc(MAX_LEVEL + 1);
-        memcpy(rl->max_run[last], max_run, MAX_LEVEL + 1);
-        if (static_store)
-            rl->index_run[last] = static_store[last] + MAX_RUN + MAX_LEVEL + 2;
-        else
-            rl->index_run[last] = av_malloc(MAX_RUN + 1);
-        memcpy(rl->index_run[last], index_run, MAX_RUN + 1);
-    }
-}
-
-av_cold void ff_init_vlc_rl(RLTable *rl)
-{
-    int i, q;
-
-    for (q = 0; q < 32; q++) {
-        int qmul = q * 2;
-        int qadd = (q - 1) | 1;
-
-        if (q == 0) {
-            qmul = 1;
-            qadd = 0;
-        }
-        for (i = 0; i < rl->vlc.table_size; i++) {
-            int code = rl->vlc.table[i][0];
-            int len  = rl->vlc.table[i][1];
-            int level, run;
-
-            if (len == 0) { // illegal code
-                run   = 66;
-                level = MAX_LEVEL;
-            } else if (len < 0) { // more bits needed
-                run   = 0;
-                level = code;
-            } else {
-                if (code == rl->n) { // esc
-                    run   = 66;
-                    level =  0;
-                } else {
-                    run   = rl->table_run[code] + 1;
-                    level = rl->table_level[code] * qmul + qadd;
-                    if (code >= rl->last) run += 192;
-                }
-            }
-            rl->rl_vlc[q][i].len   = len;
-            rl->rl_vlc[q][i].level = level;
-            rl->rl_vlc[q][i].run   = run;
-        }
-    }
-}
-
-static void release_unused_pictures(MpegEncContext *s)
-{
-    int i;
-
-    /* release non reference frames */
-    for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-        if (!s->picture[i].reference)
-            ff_mpeg_unref_picture(s, &s->picture[i]);
-    }
-}
-
-static inline int pic_is_unused(MpegEncContext *s, Picture *pic)
-{
-    if (pic->f.buf[0] == NULL)
-        return 1;
-    if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF))
-        return 1;
-    return 0;
-}
-
-static int find_unused_picture(MpegEncContext *s, int shared)
-{
-    int i;
-
-    if (shared) {
-        for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-            if (s->picture[i].f.buf[0] == NULL)
-                return i;
-        }
-    } else {
-        for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-            if (pic_is_unused(s, &s->picture[i]))
-                return i;
-        }
-    }
-
-    return AVERROR_INVALIDDATA;
-}
-
-int ff_find_unused_picture(MpegEncContext *s, int shared)
-{
-    int ret = find_unused_picture(s, shared);
-
-    if (ret >= 0 && ret < MAX_PICTURE_COUNT) {
-        if (s->picture[ret].needs_realloc) {
-            s->picture[ret].needs_realloc = 0;
-            ff_free_picture_tables(&s->picture[ret]);
-            ff_mpeg_unref_picture(s, &s->picture[ret]);
-        }
-    }
-    return ret;
-}
-
-/**
- * generic function called after decoding
- * the header and before a frame is decoded.
- */
-int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
-{
-    int i, ret;
-    Picture *pic;
-    s->mb_skipped = 0;
-
-    /* mark & release old frames */
-    if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr &&
-        s->last_picture_ptr != s->next_picture_ptr &&
-        s->last_picture_ptr->f.buf[0]) {
-        ff_mpeg_unref_picture(s, s->last_picture_ptr);
-    }
-
-    /* release forgotten pictures */
-    /* if (mpeg124/h263) */
-    for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-        if (&s->picture[i] != s->last_picture_ptr &&
-            &s->picture[i] != s->next_picture_ptr &&
-            s->picture[i].reference && !s->picture[i].needs_realloc) {
-            if (!(avctx->active_thread_type & FF_THREAD_FRAME))
-                av_log(avctx, AV_LOG_ERROR,
-                       "releasing zombie picture\n");
-            ff_mpeg_unref_picture(s, &s->picture[i]);
-        }
-    }
-
-    ff_mpeg_unref_picture(s, &s->current_picture);
-
-    release_unused_pictures(s);
-
-    if (s->current_picture_ptr &&
-        s->current_picture_ptr->f.buf[0] == NULL) {
-        // we already have a unused image
-        // (maybe it was set before reading the header)
-        pic = s->current_picture_ptr;
-    } else {
-        i   = ff_find_unused_picture(s, 0);
-        if (i < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "no frame buffer available\n");
-            return i;
-        }
-        pic = &s->picture[i];
-    }
-
-    pic->reference = 0;
-    if (!s->droppable) {
-        if (s->pict_type != AV_PICTURE_TYPE_B)
-            pic->reference = 3;
-    }
-
-    pic->f.coded_picture_number = s->coded_picture_number++;
-
-    if (ff_alloc_picture(s, pic, 0) < 0)
-        return -1;
-
-    s->current_picture_ptr = pic;
-    // FIXME use only the vars from current_pic
-    s->current_picture_ptr->f.top_field_first = s->top_field_first;
-    if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
-        s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-        if (s->picture_structure != PICT_FRAME)
-            s->current_picture_ptr->f.top_field_first =
-                (s->picture_structure == PICT_TOP_FIELD) == s->first_field;
-    }
-    s->current_picture_ptr->f.interlaced_frame = !s->progressive_frame &&
-                                                 !s->progressive_sequence;
-    s->current_picture_ptr->field_picture      =  s->picture_structure != PICT_FRAME;
-
-    s->current_picture_ptr->f.pict_type = s->pict_type;
-    // if (s->flags && CODEC_FLAG_QSCALE)
-    //     s->current_picture_ptr->quality = s->new_picture_ptr->quality;
-    s->current_picture_ptr->f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
-
-    if ((ret = ff_mpeg_ref_picture(s, &s->current_picture,
-                                   s->current_picture_ptr)) < 0)
-        return ret;
-
-    if (s->pict_type != AV_PICTURE_TYPE_B) {
-        s->last_picture_ptr = s->next_picture_ptr;
-        if (!s->droppable)
-            s->next_picture_ptr = s->current_picture_ptr;
-    }
-    av_dlog(s->avctx, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n",
-            s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr,
-            s->last_picture_ptr    ? s->last_picture_ptr->f.data[0]    : NULL,
-            s->next_picture_ptr    ? s->next_picture_ptr->f.data[0]    : NULL,
-            s->current_picture_ptr ? s->current_picture_ptr->f.data[0] : NULL,
-            s->pict_type, s->droppable);
-
-    if ((s->last_picture_ptr == NULL ||
-         s->last_picture_ptr->f.buf[0] == NULL) &&
-        (s->pict_type != AV_PICTURE_TYPE_I ||
-         s->picture_structure != PICT_FRAME)) {
-        int h_chroma_shift, v_chroma_shift;
-        av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
-                                         &h_chroma_shift, &v_chroma_shift);
-        if (s->pict_type != AV_PICTURE_TYPE_I)
-            av_log(avctx, AV_LOG_ERROR,
-                   "warning: first frame is no keyframe\n");
-        else if (s->picture_structure != PICT_FRAME)
-            av_log(avctx, AV_LOG_INFO,
-                   "allocate dummy last picture for field based first keyframe\n");
-
-        /* Allocate a dummy frame */
-        i = ff_find_unused_picture(s, 0);
-        if (i < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "no frame buffer available\n");
-            return i;
-        }
-        s->last_picture_ptr = &s->picture[i];
-
-        s->last_picture_ptr->reference   = 3;
-        s->last_picture_ptr->f.pict_type = AV_PICTURE_TYPE_I;
-
-        if (ff_alloc_picture(s, s->last_picture_ptr, 0) < 0) {
-            s->last_picture_ptr = NULL;
-            return -1;
-        }
-
-        memset(s->last_picture_ptr->f.data[0], 0,
-               avctx->height * s->last_picture_ptr->f.linesize[0]);
-        memset(s->last_picture_ptr->f.data[1], 0x80,
-               (avctx->height >> v_chroma_shift) *
-               s->last_picture_ptr->f.linesize[1]);
-        memset(s->last_picture_ptr->f.data[2], 0x80,
-               (avctx->height >> v_chroma_shift) *
-               s->last_picture_ptr->f.linesize[2]);
-
-        ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 0);
-        ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 1);
-    }
-    if ((s->next_picture_ptr == NULL ||
-         s->next_picture_ptr->f.buf[0] == NULL) &&
-        s->pict_type == AV_PICTURE_TYPE_B) {
-        /* Allocate a dummy frame */
-        i = ff_find_unused_picture(s, 0);
-        if (i < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "no frame buffer available\n");
-            return i;
-        }
-        s->next_picture_ptr = &s->picture[i];
-
-        s->next_picture_ptr->reference   = 3;
-        s->next_picture_ptr->f.pict_type = AV_PICTURE_TYPE_I;
-
-        if (ff_alloc_picture(s, s->next_picture_ptr, 0) < 0) {
-            s->next_picture_ptr = NULL;
-            return -1;
-        }
-        ff_thread_report_progress(&s->next_picture_ptr->tf, INT_MAX, 0);
-        ff_thread_report_progress(&s->next_picture_ptr->tf, INT_MAX, 1);
-    }
-
-    if (s->last_picture_ptr) {
-        ff_mpeg_unref_picture(s, &s->last_picture);
-        if (s->last_picture_ptr->f.buf[0] &&
-            (ret = ff_mpeg_ref_picture(s, &s->last_picture,
-                                       s->last_picture_ptr)) < 0)
-            return ret;
-    }
-    if (s->next_picture_ptr) {
-        ff_mpeg_unref_picture(s, &s->next_picture);
-        if (s->next_picture_ptr->f.buf[0] &&
-            (ret = ff_mpeg_ref_picture(s, &s->next_picture,
-                                       s->next_picture_ptr)) < 0)
-            return ret;
-    }
-
-    if (s->pict_type != AV_PICTURE_TYPE_I &&
-        !(s->last_picture_ptr && s->last_picture_ptr->f.buf[0])) {
-        av_log(s, AV_LOG_ERROR,
-               "Non-reference picture received and no reference available\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->picture_structure!= PICT_FRAME) {
-        int i;
-        for (i = 0; i < 4; i++) {
-            if (s->picture_structure == PICT_BOTTOM_FIELD) {
-                s->current_picture.f.data[i] +=
-                    s->current_picture.f.linesize[i];
-            }
-            s->current_picture.f.linesize[i] *= 2;
-            s->last_picture.f.linesize[i]    *= 2;
-            s->next_picture.f.linesize[i]    *= 2;
-        }
-    }
-
-    s->err_recognition = avctx->err_recognition;
-
-    /* set dequantizer, we can't do it during init as
-     * it might change for mpeg4 and we can't do it in the header
-     * decode as init is not called for mpeg4 there yet */
-    if (s->mpeg_quant || s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-        s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra;
-        s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter;
-    } else if (s->out_format == FMT_H263 || s->out_format == FMT_H261) {
-        s->dct_unquantize_intra = s->dct_unquantize_h263_intra;
-        s->dct_unquantize_inter = s->dct_unquantize_h263_inter;
-    } else {
-        s->dct_unquantize_intra = s->dct_unquantize_mpeg1_intra;
-        s->dct_unquantize_inter = s->dct_unquantize_mpeg1_inter;
-    }
-
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
-        return ff_xvmc_field_start(s, avctx);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-    return 0;
-}
-
-/* called after a frame has been decoded. */
-void ff_MPV_frame_end(MpegEncContext *s)
-{
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-    /* redraw edges for the frame if decoding didn't complete */
-    // just to make sure that all data is rendered.
-    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {
-        ff_xvmc_field_end(s);
-    } else
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-    emms_c();
-
-    if (s->current_picture.reference)
-        ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0);
-}
-
-/**
- * Print debugging info for the given picture.
- */
-void ff_print_debug_info(MpegEncContext *s, Picture *p)
-{
-    AVFrame *pict;
-    if (s->avctx->hwaccel || !p || !p->mb_type)
-        return;
-    pict = &p->f;
-
-    if (s->avctx->debug & (FF_DEBUG_SKIP | FF_DEBUG_QP | FF_DEBUG_MB_TYPE)) {
-        int x,y;
-
-        av_log(s->avctx,AV_LOG_DEBUG,"New frame, type: ");
-        switch (pict->pict_type) {
-        case AV_PICTURE_TYPE_I:
-            av_log(s->avctx,AV_LOG_DEBUG,"I\n");
-            break;
-        case AV_PICTURE_TYPE_P:
-            av_log(s->avctx,AV_LOG_DEBUG,"P\n");
-            break;
-        case AV_PICTURE_TYPE_B:
-            av_log(s->avctx,AV_LOG_DEBUG,"B\n");
-            break;
-        case AV_PICTURE_TYPE_S:
-            av_log(s->avctx,AV_LOG_DEBUG,"S\n");
-            break;
-        case AV_PICTURE_TYPE_SI:
-            av_log(s->avctx,AV_LOG_DEBUG,"SI\n");
-            break;
-        case AV_PICTURE_TYPE_SP:
-            av_log(s->avctx,AV_LOG_DEBUG,"SP\n");
-            break;
-        }
-        for (y = 0; y < s->mb_height; y++) {
-            for (x = 0; x < s->mb_width; x++) {
-                if (s->avctx->debug & FF_DEBUG_SKIP) {
-                    int count = s->mbskip_table[x + y * s->mb_stride];
-                    if (count > 9)
-                        count = 9;
-                    av_log(s->avctx, AV_LOG_DEBUG, "%1d", count);
-                }
-                if (s->avctx->debug & FF_DEBUG_QP) {
-                    av_log(s->avctx, AV_LOG_DEBUG, "%2d",
-                           p->qscale_table[x + y * s->mb_stride]);
-                }
-                if (s->avctx->debug & FF_DEBUG_MB_TYPE) {
-                    int mb_type = p->mb_type[x + y * s->mb_stride];
-                    // Type & MV direction
-                    if (IS_PCM(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "P");
-                    else if (IS_INTRA(mb_type) && IS_ACPRED(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "A");
-                    else if (IS_INTRA4x4(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "i");
-                    else if (IS_INTRA16x16(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "I");
-                    else if (IS_DIRECT(mb_type) && IS_SKIP(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "d");
-                    else if (IS_DIRECT(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "D");
-                    else if (IS_GMC(mb_type) && IS_SKIP(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "g");
-                    else if (IS_GMC(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "G");
-                    else if (IS_SKIP(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "S");
-                    else if (!USES_LIST(mb_type, 1))
-                        av_log(s->avctx, AV_LOG_DEBUG, ">");
-                    else if (!USES_LIST(mb_type, 0))
-                        av_log(s->avctx, AV_LOG_DEBUG, "<");
-                    else {
-                        assert(USES_LIST(mb_type, 0) && USES_LIST(mb_type, 1));
-                        av_log(s->avctx, AV_LOG_DEBUG, "X");
-                    }
-
-                    // segmentation
-                    if (IS_8X8(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "+");
-                    else if (IS_16X8(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "-");
-                    else if (IS_8X16(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "|");
-                    else if (IS_INTRA(mb_type) || IS_16X16(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, " ");
-                    else
-                        av_log(s->avctx, AV_LOG_DEBUG, "?");
-
-
-                    if (IS_INTERLACED(mb_type))
-                        av_log(s->avctx, AV_LOG_DEBUG, "=");
-                    else
-                        av_log(s->avctx, AV_LOG_DEBUG, " ");
-                }
-            }
-            av_log(s->avctx, AV_LOG_DEBUG, "\n");
-        }
-    }
-}
-
-/**
- * find the lowest MB row referenced in the MVs
- */
-int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir)
-{
-    int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample;
-    int my, off, i, mvs;
-
-    if (s->picture_structure != PICT_FRAME || s->mcsel)
-        goto unhandled;
-
-    switch (s->mv_type) {
-        case MV_TYPE_16X16:
-            mvs = 1;
-            break;
-        case MV_TYPE_16X8:
-            mvs = 2;
-            break;
-        case MV_TYPE_8X8:
-            mvs = 4;
-            break;
-        default:
-            goto unhandled;
-    }
-
-    for (i = 0; i < mvs; i++) {
-        my = s->mv[dir][i][1]<<qpel_shift;
-        my_max = FFMAX(my_max, my);
-        my_min = FFMIN(my_min, my);
-    }
-
-    off = (FFMAX(-my_min, my_max) + 63) >> 6;
-
-    return FFMIN(FFMAX(s->mb_y + off, 0), s->mb_height-1);
-unhandled:
-    return s->mb_height-1;
-}
-
-/* put block[] to dest[] */
-static inline void put_dct(MpegEncContext *s,
-                           int16_t *block, int i, uint8_t *dest, int line_size, int qscale)
-{
-    s->dct_unquantize_intra(s, block, i, qscale);
-    s->dsp.idct_put (dest, line_size, block);
-}
-
-/* add block[] to dest[] */
-static inline void add_dct(MpegEncContext *s,
-                           int16_t *block, int i, uint8_t *dest, int line_size)
-{
-    if (s->block_last_index[i] >= 0) {
-        s->dsp.idct_add (dest, line_size, block);
-    }
-}
-
-static inline void add_dequant_dct(MpegEncContext *s,
-                           int16_t *block, int i, uint8_t *dest, int line_size, int qscale)
-{
-    if (s->block_last_index[i] >= 0) {
-        s->dct_unquantize_inter(s, block, i, qscale);
-
-        s->dsp.idct_add (dest, line_size, block);
-    }
-}
-
-/**
- * Clean dc, ac, coded_block for the current non-intra MB.
- */
-void ff_clean_intra_table_entries(MpegEncContext *s)
-{
-    int wrap = s->b8_stride;
-    int xy = s->block_index[0];
-
-    s->dc_val[0][xy           ] =
-    s->dc_val[0][xy + 1       ] =
-    s->dc_val[0][xy     + wrap] =
-    s->dc_val[0][xy + 1 + wrap] = 1024;
-    /* ac pred */
-    memset(s->ac_val[0][xy       ], 0, 32 * sizeof(int16_t));
-    memset(s->ac_val[0][xy + wrap], 0, 32 * sizeof(int16_t));
-    if (s->msmpeg4_version>=3) {
-        s->coded_block[xy           ] =
-        s->coded_block[xy + 1       ] =
-        s->coded_block[xy     + wrap] =
-        s->coded_block[xy + 1 + wrap] = 0;
-    }
-    /* chroma */
-    wrap = s->mb_stride;
-    xy = s->mb_x + s->mb_y * wrap;
-    s->dc_val[1][xy] =
-    s->dc_val[2][xy] = 1024;
-    /* ac pred */
-    memset(s->ac_val[1][xy], 0, 16 * sizeof(int16_t));
-    memset(s->ac_val[2][xy], 0, 16 * sizeof(int16_t));
-
-    s->mbintra_table[xy]= 0;
-}
-
-/* generic function called after a macroblock has been parsed by the
-   decoder or after it has been encoded by the encoder.
-
-   Important variables used:
-   s->mb_intra : true if intra macroblock
-   s->mv_dir   : motion vector direction
-   s->mv_type  : motion vector type
-   s->mv       : motion vector
-   s->interlaced_dct : true if interlaced dct used (mpeg2)
- */
-static av_always_inline
-void MPV_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
-                            int is_mpeg12)
-{
-    const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
-
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){
-        ff_xvmc_decode_mb(s);//xvmc uses pblocks
-        return;
-    }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-    if(s->avctx->debug&FF_DEBUG_DCT_COEFF) {
-       /* print DCT coefficients */
-       int i,j;
-       av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y);
-       for(i=0; i<6; i++){
-           for(j=0; j<64; j++){
-               av_log(s->avctx, AV_LOG_DEBUG, "%5d", block[i][s->dsp.idct_permutation[j]]);
-           }
-           av_log(s->avctx, AV_LOG_DEBUG, "\n");
-       }
-    }
-
-    s->current_picture.qscale_table[mb_xy] = s->qscale;
-
-    /* update DC predictors for P macroblocks */
-    if (!s->mb_intra) {
-        if (!is_mpeg12 && (s->h263_pred || s->h263_aic)) {
-            if(s->mbintra_table[mb_xy])
-                ff_clean_intra_table_entries(s);
-        } else {
-            s->last_dc[0] =
-            s->last_dc[1] =
-            s->last_dc[2] = 128 << s->intra_dc_precision;
-        }
-    }
-    else if (!is_mpeg12 && (s->h263_pred || s->h263_aic))
-        s->mbintra_table[mb_xy]=1;
-
-    if ((s->flags&CODEC_FLAG_PSNR) || !(s->encoding && (s->intra_only || s->pict_type==AV_PICTURE_TYPE_B) && s->avctx->mb_decision != FF_MB_DECISION_RD)) { //FIXME precalc
-        uint8_t *dest_y, *dest_cb, *dest_cr;
-        int dct_linesize, dct_offset;
-        op_pixels_func (*op_pix)[4];
-        qpel_mc_func (*op_qpix)[16];
-        const int linesize   = s->current_picture.f.linesize[0]; //not s->linesize as this would be wrong for field pics
-        const int uvlinesize = s->current_picture.f.linesize[1];
-        const int readable= s->pict_type != AV_PICTURE_TYPE_B || s->encoding || s->avctx->draw_horiz_band;
-        const int block_size = 8;
-
-        /* avoid copy if macroblock skipped in last frame too */
-        /* skip only during decoding as we might trash the buffers during encoding a bit */
-        if(!s->encoding){
-            uint8_t *mbskip_ptr = &s->mbskip_table[mb_xy];
-
-            if (s->mb_skipped) {
-                s->mb_skipped= 0;
-                assert(s->pict_type!=AV_PICTURE_TYPE_I);
-                *mbskip_ptr = 1;
-            } else if(!s->current_picture.reference) {
-                *mbskip_ptr = 1;
-            } else{
-                *mbskip_ptr = 0; /* not skipped */
-            }
-        }
-
-        dct_linesize = linesize << s->interlaced_dct;
-        dct_offset   = s->interlaced_dct ? linesize : linesize * block_size;
-
-        if(readable){
-            dest_y=  s->dest[0];
-            dest_cb= s->dest[1];
-            dest_cr= s->dest[2];
-        }else{
-            dest_y = s->b_scratchpad;
-            dest_cb= s->b_scratchpad+16*linesize;
-            dest_cr= s->b_scratchpad+32*linesize;
-        }
-
-        if (!s->mb_intra) {
-            /* motion handling */
-            /* decoding or more than one mb_type (MC was already done otherwise) */
-            if(!s->encoding){
-
-                if(HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) {
-                    if (s->mv_dir & MV_DIR_FORWARD) {
-                        ff_thread_await_progress(&s->last_picture_ptr->tf,
-                                                 ff_MPV_lowest_referenced_row(s, 0),
-                                                 0);
-                    }
-                    if (s->mv_dir & MV_DIR_BACKWARD) {
-                        ff_thread_await_progress(&s->next_picture_ptr->tf,
-                                                 ff_MPV_lowest_referenced_row(s, 1),
-                                                 0);
-                    }
-                }
-
-                op_qpix= s->me.qpel_put;
-                if ((!s->no_rounding) || s->pict_type==AV_PICTURE_TYPE_B){
-                    op_pix = s->hdsp.put_pixels_tab;
-                }else{
-                    op_pix = s->hdsp.put_no_rnd_pixels_tab;
-                }
-                if (s->mv_dir & MV_DIR_FORWARD) {
-                    ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f.data, op_pix, op_qpix);
-                    op_pix = s->hdsp.avg_pixels_tab;
-                    op_qpix= s->me.qpel_avg;
-                }
-                if (s->mv_dir & MV_DIR_BACKWARD) {
-                    ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f.data, op_pix, op_qpix);
-                }
-            }
-
-            /* skip dequant / idct if we are really late ;) */
-            if(s->avctx->skip_idct){
-                if(  (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B)
-                   ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I)
-                   || s->avctx->skip_idct >= AVDISCARD_ALL)
-                    goto skip_idct;
-            }
-
-            /* add dct residue */
-            if(s->encoding || !(   s->msmpeg4_version || s->codec_id==AV_CODEC_ID_MPEG1VIDEO || s->codec_id==AV_CODEC_ID_MPEG2VIDEO
-                                || (s->codec_id==AV_CODEC_ID_MPEG4 && !s->mpeg_quant))){
-                add_dequant_dct(s, block[0], 0, dest_y                          , dct_linesize, s->qscale);
-                add_dequant_dct(s, block[1], 1, dest_y              + block_size, dct_linesize, s->qscale);
-                add_dequant_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize, s->qscale);
-                add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
-
-                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
-                    if (s->chroma_y_shift){
-                        add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
-                        add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
-                    }else{
-                        dct_linesize >>= 1;
-                        dct_offset >>=1;
-                        add_dequant_dct(s, block[4], 4, dest_cb,              dct_linesize, s->chroma_qscale);
-                        add_dequant_dct(s, block[5], 5, dest_cr,              dct_linesize, s->chroma_qscale);
-                        add_dequant_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale);
-                        add_dequant_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale);
-                    }
-                }
-            } else if(is_mpeg12 || (s->codec_id != AV_CODEC_ID_WMV2)){
-                add_dct(s, block[0], 0, dest_y                          , dct_linesize);
-                add_dct(s, block[1], 1, dest_y              + block_size, dct_linesize);
-                add_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize);
-                add_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize);
-
-                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
-                    if(s->chroma_y_shift){//Chroma420
-                        add_dct(s, block[4], 4, dest_cb, uvlinesize);
-                        add_dct(s, block[5], 5, dest_cr, uvlinesize);
-                    }else{
-                        //chroma422
-                        dct_linesize = uvlinesize << s->interlaced_dct;
-                        dct_offset   = s->interlaced_dct ? uvlinesize : uvlinesize * 8;
-
-                        add_dct(s, block[4], 4, dest_cb, dct_linesize);
-                        add_dct(s, block[5], 5, dest_cr, dct_linesize);
-                        add_dct(s, block[6], 6, dest_cb+dct_offset, dct_linesize);
-                        add_dct(s, block[7], 7, dest_cr+dct_offset, dct_linesize);
-                        if(!s->chroma_x_shift){//Chroma444
-                            add_dct(s, block[8], 8, dest_cb+8, dct_linesize);
-                            add_dct(s, block[9], 9, dest_cr+8, dct_linesize);
-                            add_dct(s, block[10], 10, dest_cb+8+dct_offset, dct_linesize);
-                            add_dct(s, block[11], 11, dest_cr+8+dct_offset, dct_linesize);
-                        }
-                    }
-                }//fi gray
-            }
-            else if (CONFIG_WMV2_DECODER || CONFIG_WMV2_ENCODER) {
-                ff_wmv2_add_mb(s, block, dest_y, dest_cb, dest_cr);
-            }
-        } else {
-            /* dct only in intra block */
-            if(s->encoding || !(s->codec_id==AV_CODEC_ID_MPEG1VIDEO || s->codec_id==AV_CODEC_ID_MPEG2VIDEO)){
-                put_dct(s, block[0], 0, dest_y                          , dct_linesize, s->qscale);
-                put_dct(s, block[1], 1, dest_y              + block_size, dct_linesize, s->qscale);
-                put_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize, s->qscale);
-                put_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
-
-                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
-                    if(s->chroma_y_shift){
-                        put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
-                        put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
-                    }else{
-                        dct_offset >>=1;
-                        dct_linesize >>=1;
-                        put_dct(s, block[4], 4, dest_cb,              dct_linesize, s->chroma_qscale);
-                        put_dct(s, block[5], 5, dest_cr,              dct_linesize, s->chroma_qscale);
-                        put_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale);
-                        put_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale);
-                    }
-                }
-            }else{
-                s->dsp.idct_put(dest_y                          , dct_linesize, block[0]);
-                s->dsp.idct_put(dest_y              + block_size, dct_linesize, block[1]);
-                s->dsp.idct_put(dest_y + dct_offset             , dct_linesize, block[2]);
-                s->dsp.idct_put(dest_y + dct_offset + block_size, dct_linesize, block[3]);
-
-                if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
-                    if(s->chroma_y_shift){
-                        s->dsp.idct_put(dest_cb, uvlinesize, block[4]);
-                        s->dsp.idct_put(dest_cr, uvlinesize, block[5]);
-                    }else{
-
-                        dct_linesize = uvlinesize << s->interlaced_dct;
-                        dct_offset   = s->interlaced_dct ? uvlinesize : uvlinesize * 8;
-
-                        s->dsp.idct_put(dest_cb,              dct_linesize, block[4]);
-                        s->dsp.idct_put(dest_cr,              dct_linesize, block[5]);
-                        s->dsp.idct_put(dest_cb + dct_offset, dct_linesize, block[6]);
-                        s->dsp.idct_put(dest_cr + dct_offset, dct_linesize, block[7]);
-                        if(!s->chroma_x_shift){//Chroma444
-                            s->dsp.idct_put(dest_cb + 8,              dct_linesize, block[8]);
-                            s->dsp.idct_put(dest_cr + 8,              dct_linesize, block[9]);
-                            s->dsp.idct_put(dest_cb + 8 + dct_offset, dct_linesize, block[10]);
-                            s->dsp.idct_put(dest_cr + 8 + dct_offset, dct_linesize, block[11]);
-                        }
-                    }
-                }//gray
-            }
-        }
-skip_idct:
-        if(!readable){
-            s->hdsp.put_pixels_tab[0][0](s->dest[0], dest_y ,   linesize,16);
-            s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize,16 >> s->chroma_y_shift);
-            s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[2], dest_cr, uvlinesize,16 >> s->chroma_y_shift);
-        }
-    }
-}
-
-void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]){
-#if !CONFIG_SMALL
-    if(s->out_format == FMT_MPEG1) {
-        MPV_decode_mb_internal(s, block, 1);
-    } else
-#endif
-        MPV_decode_mb_internal(s, block, 0);
-}
-
-/**
- * @param h is the normal height, this will be reduced automatically if needed for the last row
- */
-void ff_draw_horiz_band(AVCodecContext *avctx, Picture *cur,
-                        Picture *last, int y, int h, int picture_structure,
-                        int first_field, int low_delay)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-    int vshift = desc->log2_chroma_h;
-    const int field_pic = picture_structure != PICT_FRAME;
-    if(field_pic){
-        h <<= 1;
-        y <<= 1;
-    }
-
-    h = FFMIN(h, avctx->height - y);
-
-    if(field_pic && first_field && !(avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
-
-    if (avctx->draw_horiz_band) {
-        AVFrame *src;
-        int offset[AV_NUM_DATA_POINTERS];
-        int i;
-
-        if(cur->f.pict_type == AV_PICTURE_TYPE_B || low_delay ||
-           (avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
-            src = &cur->f;
-        else if (last)
-            src = &last->f;
-        else
-            return;
-
-        if (cur->f.pict_type == AV_PICTURE_TYPE_B &&
-            picture_structure == PICT_FRAME &&
-            avctx->codec_id != AV_CODEC_ID_SVQ3) {
-            for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
-                offset[i] = 0;
-        }else{
-            offset[0]= y * src->linesize[0];
-            offset[1]=
-            offset[2]= (y >> vshift) * src->linesize[1];
-            for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
-                offset[i] = 0;
-        }
-
-        emms_c();
-
-        avctx->draw_horiz_band(avctx, src, offset,
-                               y, picture_structure, h);
-    }
-}
-
-void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
-{
-    ff_draw_horiz_band(s->avctx, &s->current_picture,
-                       &s->last_picture, y, h, s->picture_structure,
-                       s->first_field, s->low_delay);
-}
-
-void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
-    const int linesize   = s->current_picture.f.linesize[0]; //not s->linesize as this would be wrong for field pics
-    const int uvlinesize = s->current_picture.f.linesize[1];
-    const int mb_size= 4;
-
-    s->block_index[0]= s->b8_stride*(s->mb_y*2    ) - 2 + s->mb_x*2;
-    s->block_index[1]= s->b8_stride*(s->mb_y*2    ) - 1 + s->mb_x*2;
-    s->block_index[2]= s->b8_stride*(s->mb_y*2 + 1) - 2 + s->mb_x*2;
-    s->block_index[3]= s->b8_stride*(s->mb_y*2 + 1) - 1 + s->mb_x*2;
-    s->block_index[4]= s->mb_stride*(s->mb_y + 1)                + s->b8_stride*s->mb_height*2 + s->mb_x - 1;
-    s->block_index[5]= s->mb_stride*(s->mb_y + s->mb_height + 2) + s->b8_stride*s->mb_height*2 + s->mb_x - 1;
-    //block_index is not used by mpeg2, so it is not affected by chroma_format
-
-    s->dest[0] = s->current_picture.f.data[0] + ((s->mb_x - 1) <<  mb_size);
-    s->dest[1] = s->current_picture.f.data[1] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
-    s->dest[2] = s->current_picture.f.data[2] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
-
-    if(!(s->pict_type==AV_PICTURE_TYPE_B && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME))
-    {
-        if(s->picture_structure==PICT_FRAME){
-        s->dest[0] += s->mb_y *   linesize << mb_size;
-        s->dest[1] += s->mb_y * uvlinesize << (mb_size - s->chroma_y_shift);
-        s->dest[2] += s->mb_y * uvlinesize << (mb_size - s->chroma_y_shift);
-        }else{
-            s->dest[0] += (s->mb_y>>1) *   linesize << mb_size;
-            s->dest[1] += (s->mb_y>>1) * uvlinesize << (mb_size - s->chroma_y_shift);
-            s->dest[2] += (s->mb_y>>1) * uvlinesize << (mb_size - s->chroma_y_shift);
-            assert((s->mb_y&1) == (s->picture_structure == PICT_BOTTOM_FIELD));
-        }
-    }
-}
-
-/**
- * Permute an 8x8 block.
- * @param block the block which will be permuted according to the given permutation vector
- * @param permutation the permutation vector
- * @param last the last non zero coefficient in scantable order, used to speed the permutation up
- * @param scantable the used scantable, this is only used to speed the permutation up, the block is not
- *                  (inverse) permutated to scantable order!
- */
-void ff_block_permute(int16_t *block, uint8_t *permutation, const uint8_t *scantable, int last)
-{
-    int i;
-    int16_t temp[64];
-
-    if(last<=0) return;
-    //if(permutation[1]==1) return; //FIXME it is ok but not clean and might fail for some permutations
-
-    for(i=0; i<=last; i++){
-        const int j= scantable[i];
-        temp[j]= block[j];
-        block[j]=0;
-    }
-
-    for(i=0; i<=last; i++){
-        const int j= scantable[i];
-        const int perm_j= permutation[j];
-        block[perm_j]= temp[j];
-    }
-}
-
-void ff_mpeg_flush(AVCodecContext *avctx){
-    int i;
-    MpegEncContext *s = avctx->priv_data;
-
-    if(s==NULL || s->picture==NULL)
-        return;
-
-    for (i = 0; i < MAX_PICTURE_COUNT; i++)
-        ff_mpeg_unref_picture(s, &s->picture[i]);
-    s->current_picture_ptr = s->last_picture_ptr = s->next_picture_ptr = NULL;
-
-    ff_mpeg_unref_picture(s, &s->current_picture);
-    ff_mpeg_unref_picture(s, &s->last_picture);
-    ff_mpeg_unref_picture(s, &s->next_picture);
-
-    s->mb_x= s->mb_y= 0;
-
-    s->parse_context.state= -1;
-    s->parse_context.frame_start_found= 0;
-    s->parse_context.overread= 0;
-    s->parse_context.overread_index= 0;
-    s->parse_context.index= 0;
-    s->parse_context.last_index= 0;
-    s->bitstream_buffer_size=0;
-    s->pp_time=0;
-}
-
-/**
- * set qscale and update qscale dependent variables.
- */
-void ff_set_qscale(MpegEncContext * s, int qscale)
-{
-    if (qscale < 1)
-        qscale = 1;
-    else if (qscale > 31)
-        qscale = 31;
-
-    s->qscale = qscale;
-    s->chroma_qscale= s->chroma_qscale_table[qscale];
-
-    s->y_dc_scale= s->y_dc_scale_table[ qscale ];
-    s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ];
-}
-
-void ff_MPV_report_decode_progress(MpegEncContext *s)
-{
-    if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred)
-        ff_thread_report_progress(&s->current_picture_ptr->tf, s->mb_y, 0);
-}
-
-#if CONFIG_ERROR_RESILIENCE
-void ff_mpeg_er_frame_start(MpegEncContext *s)
-{
-    ERContext *er = &s->er;
-
-    er->cur_pic  = s->current_picture_ptr;
-    er->last_pic = s->last_picture_ptr;
-    er->next_pic = s->next_picture_ptr;
-
-    er->pp_time           = s->pp_time;
-    er->pb_time           = s->pb_time;
-    er->quarter_sample    = s->quarter_sample;
-    er->partitioned_frame = s->partitioned_frame;
-
-    ff_er_frame_start(er);
-}
-#endif /* CONFIG_ERROR_RESILIENCE */
diff --git a/deps/libav/libavcodec/mpegvideo.h b/deps/libav/libavcodec/mpegvideo.h
deleted file mode 100644
index f888700..0000000
--- a/deps/libav/libavcodec/mpegvideo.h
+++ /dev/null
@@ -1,926 +0,0 @@
-/*
- * Generic DCT based hybrid video encoder
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * mpegvideo header.
- */
-
-#ifndef AVCODEC_MPEGVIDEO_H
-#define AVCODEC_MPEGVIDEO_H
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "error_resilience.h"
-#include "get_bits.h"
-#include "h263dsp.h"
-#include "hpeldsp.h"
-#include "put_bits.h"
-#include "ratecontrol.h"
-#include "parser.h"
-#include "mpeg12data.h"
-#include "rl.h"
-#include "thread.h"
-#include "videodsp.h"
-
-#include "libavutil/opt.h"
-
-#define FRAME_SKIPPED 100 ///< return value for header parsers if frame is not coded
-
-enum OutputFormat {
-    FMT_MPEG1,
-    FMT_H261,
-    FMT_H263,
-    FMT_MJPEG,
-};
-
-#define MPEG_BUF_SIZE (16 * 1024)
-
-#define QMAT_SHIFT_MMX 16
-#define QMAT_SHIFT 22
-
-#define MAX_FCODE 7
-#define MAX_MV 2048
-
-#define MAX_THREADS 16
-
-#define MAX_PICTURE_COUNT 32
-
-#define MAX_B_FRAMES 16
-
-#define ME_MAP_SIZE 64
-#define ME_MAP_SHIFT 3
-#define ME_MAP_MV_BITS 11
-
-#define MAX_MB_BYTES (30*16*16*3/8 + 120)
-
-#define INPLACE_OFFSET 16
-
-/* Start codes. */
-#define SEQ_END_CODE            0x000001b7
-#define SEQ_START_CODE          0x000001b3
-#define GOP_START_CODE          0x000001b8
-#define PICTURE_START_CODE      0x00000100
-#define SLICE_MIN_START_CODE    0x00000101
-#define SLICE_MAX_START_CODE    0x000001af
-#define EXT_START_CODE          0x000001b5
-#define USER_START_CODE         0x000001b2
-
-/**
- * Value of Picture.reference when Picture is not a reference picture, but
- * is held for delayed output.
- */
-#define DELAYED_PIC_REF 4
-
-struct MpegEncContext;
-
-/**
- * Picture.
- */
-typedef struct Picture{
-    struct AVFrame f;
-    ThreadFrame tf;
-
-    AVBufferRef *qscale_table_buf;
-    int8_t *qscale_table;
-
-    AVBufferRef *motion_val_buf[2];
-    int16_t (*motion_val[2])[2];
-
-    AVBufferRef *mb_type_buf;
-    uint32_t *mb_type;
-
-#if !FF_API_MB_TYPE
-#define MB_TYPE_INTRA4x4   0x0001
-#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
-#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
-#define MB_TYPE_16x16      0x0008
-#define MB_TYPE_16x8       0x0010
-#define MB_TYPE_8x16       0x0020
-#define MB_TYPE_8x8        0x0040
-#define MB_TYPE_INTERLACED 0x0080
-#define MB_TYPE_DIRECT2    0x0100 //FIXME
-#define MB_TYPE_ACPRED     0x0200
-#define MB_TYPE_GMC        0x0400
-#define MB_TYPE_SKIP       0x0800
-#define MB_TYPE_P0L0       0x1000
-#define MB_TYPE_P1L0       0x2000
-#define MB_TYPE_P0L1       0x4000
-#define MB_TYPE_P1L1       0x8000
-#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
-#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
-#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
-#define MB_TYPE_QUANT      0x00010000
-#define MB_TYPE_CBP        0x00020000
-#endif
-
-    AVBufferRef *mbskip_table_buf;
-    uint8_t *mbskip_table;
-
-    AVBufferRef *ref_index_buf[2];
-    int8_t *ref_index[2];
-
-    AVBufferRef *mb_var_buf;
-    uint16_t *mb_var;           ///< Table for MB variances
-
-    AVBufferRef *mc_mb_var_buf;
-    uint16_t *mc_mb_var;        ///< Table for motion compensated MB variances
-
-    AVBufferRef *mb_mean_buf;
-    uint8_t *mb_mean;           ///< Table for MB luminance
-
-    AVBufferRef *hwaccel_priv_buf;
-    /**
-     * hardware accelerator private data
-     */
-    void *hwaccel_picture_private;
-
-#define MB_TYPE_INTRA MB_TYPE_INTRA4x4 //default mb_type if there is just one type
-#define IS_INTRA4x4(a)   ((a)&MB_TYPE_INTRA4x4)
-#define IS_INTRA16x16(a) ((a)&MB_TYPE_INTRA16x16)
-#define IS_PCM(a)        ((a)&MB_TYPE_INTRA_PCM)
-#define IS_INTRA(a)      ((a)&7)
-#define IS_INTER(a)      ((a)&(MB_TYPE_16x16|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8))
-#define IS_SKIP(a)       ((a)&MB_TYPE_SKIP)
-#define IS_INTRA_PCM(a)  ((a)&MB_TYPE_INTRA_PCM)
-#define IS_INTERLACED(a) ((a)&MB_TYPE_INTERLACED)
-#define IS_DIRECT(a)     ((a)&MB_TYPE_DIRECT2)
-#define IS_GMC(a)        ((a)&MB_TYPE_GMC)
-#define IS_16X16(a)      ((a)&MB_TYPE_16x16)
-#define IS_16X8(a)       ((a)&MB_TYPE_16x8)
-#define IS_8X16(a)       ((a)&MB_TYPE_8x16)
-#define IS_8X8(a)        ((a)&MB_TYPE_8x8)
-#define IS_SUB_8X8(a)    ((a)&MB_TYPE_16x16) //note reused
-#define IS_SUB_8X4(a)    ((a)&MB_TYPE_16x8)  //note reused
-#define IS_SUB_4X8(a)    ((a)&MB_TYPE_8x16)  //note reused
-#define IS_SUB_4X4(a)    ((a)&MB_TYPE_8x8)   //note reused
-#define IS_ACPRED(a)     ((a)&MB_TYPE_ACPRED)
-#define IS_QUANT(a)      ((a)&MB_TYPE_QUANT)
-#define IS_DIR(a, part, list) ((a) & (MB_TYPE_P0L0<<((part)+2*(list))))
-#define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0|MB_TYPE_P1L0)<<(2*(list)))) ///< does this mb use listX, note does not work if subMBs
-#define HAS_CBP(a)        ((a)&MB_TYPE_CBP)
-
-    int field_poc[2];           ///< h264 top/bottom POC
-    int poc;                    ///< h264 frame POC
-    int frame_num;              ///< h264 frame_num (raw frame_num from slice header)
-    int mmco_reset;             ///< h264 MMCO_RESET set this 1. Reordering code must not mix pictures before and after MMCO_RESET.
-    int pic_id;                 /**< h264 pic_num (short -> no wrap version of pic_num,
-                                     pic_num & max_pic_num; long -> long_pic_num) */
-    int long_ref;               ///< 1->long term reference 0->short term reference
-    int ref_poc[2][2][32];      ///< h264 POCs of the frames used as reference (FIXME need per slice)
-    int ref_count[2][2];        ///< number of entries in ref_poc              (FIXME need per slice)
-    int mbaff;                  ///< h264 1 -> MBAFF frame 0-> not MBAFF
-    int field_picture;          ///< whether or not the picture was encoded in separate fields
-
-    int mb_var_sum;             ///< sum of MB variance for current frame
-    int mc_mb_var_sum;          ///< motion compensated MB variance for current frame
-
-    int b_frame_score;          /* */
-    int needs_realloc;          ///< Picture needs to be reallocated (eg due to a frame size change)
-
-    int reference;
-    int shared;
-    int recovered;              ///< Picture at IDR or recovery point + recovery count
-} Picture;
-
-/**
- * Motion estimation context.
- */
-typedef struct MotionEstContext{
-    AVCodecContext *avctx;
-    int skip;                          ///< set if ME is skipped for the current MB
-    int co_located_mv[4][2];           ///< mv from last P-frame for direct mode ME
-    int direct_basis_mv[4][2];
-    uint8_t *scratchpad;               ///< data area for the ME algo, so that the ME does not need to malloc/free
-    uint8_t *best_mb;
-    uint8_t *temp_mb[2];
-    uint8_t *temp;
-    int best_bits;
-    uint32_t *map;                     ///< map to avoid duplicate evaluations
-    uint32_t *score_map;               ///< map to store the scores
-    unsigned map_generation;
-    int pre_penalty_factor;
-    int penalty_factor;                /**< an estimate of the bits required to
-                                        code a given mv value, e.g. (1,0) takes
-                                        more bits than (0,0). We have to
-                                        estimate whether any reduction in
-                                        residual is worth the extra bits. */
-    int sub_penalty_factor;
-    int mb_penalty_factor;
-    int flags;
-    int sub_flags;
-    int mb_flags;
-    int pre_pass;                      ///< = 1 for the pre pass
-    int dia_size;
-    int xmin;
-    int xmax;
-    int ymin;
-    int ymax;
-    int pred_x;
-    int pred_y;
-    uint8_t *src[4][4];
-    uint8_t *ref[4][4];
-    int stride;
-    int uvstride;
-    /* temp variables for picture complexity calculation */
-    int mc_mb_var_sum_temp;
-    int mb_var_sum_temp;
-    int scene_change_score;
-/*    cmp, chroma_cmp;*/
-    op_pixels_func (*hpel_put)[4];
-    op_pixels_func (*hpel_avg)[4];
-    qpel_mc_func (*qpel_put)[16];
-    qpel_mc_func (*qpel_avg)[16];
-    uint8_t (*mv_penalty)[MAX_MV*2+1];  ///< amount of bits needed to encode a MV
-    uint8_t *current_mv_penalty;
-    int (*sub_motion_search)(struct MpegEncContext * s,
-                                  int *mx_ptr, int *my_ptr, int dmin,
-                                  int src_index, int ref_index,
-                                  int size, int h);
-}MotionEstContext;
-
-/**
- * MpegEncContext.
- */
-typedef struct MpegEncContext {
-    AVClass *class;
-    struct AVCodecContext *avctx;
-    /* the following parameters must be initialized before encoding */
-    int width, height;///< picture size. must be a multiple of 16
-    int gop_size;
-    int intra_only;   ///< if true, only intra pictures are generated
-    int bit_rate;     ///< wanted bit rate
-    enum OutputFormat out_format; ///< output format
-    int h263_pred;    ///< use mpeg4/h263 ac/dc predictions
-    int pb_frame;     ///< PB frame mode (0 = none, 1 = base, 2 = improved)
-
-/* the following codec id fields are deprecated in favor of codec_id */
-    int h263_plus;    ///< h263 plus headers
-    int h263_flv;     ///< use flv h263 header
-
-    enum AVCodecID codec_id;     /* see AV_CODEC_ID_xxx */
-    int fixed_qscale; ///< fixed qscale if non zero
-    int encoding;     ///< true if we are encoding (vs decoding)
-    int flags;        ///< AVCodecContext.flags (HQ, MV4, ...)
-    int flags2;       ///< AVCodecContext.flags2
-    int max_b_frames; ///< max number of b-frames for encoding
-    int luma_elim_threshold;
-    int chroma_elim_threshold;
-    int strict_std_compliance; ///< strictly follow the std (MPEG4, ...)
-    int workaround_bugs;       ///< workaround bugs in encoders which cannot be detected automatically
-    int codec_tag;             ///< internal codec_tag upper case converted from avctx codec_tag
-    int stream_codec_tag;      ///< internal stream_codec_tag upper case converted from avctx stream_codec_tag
-    /* the following fields are managed internally by the encoder */
-
-    /* sequence parameters */
-    int context_initialized;
-    int input_picture_number;  ///< used to set pic->display_picture_number, should not be used for/by anything else
-    int coded_picture_number;  ///< used to set pic->coded_picture_number, should not be used for/by anything else
-    int picture_number;       //FIXME remove, unclear definition
-    int picture_in_gop_number; ///< 0-> first pic in gop, ...
-    int mb_width, mb_height;   ///< number of MBs horizontally & vertically
-    int mb_stride;             ///< mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11
-    int b8_stride;             ///< 2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
-    int b4_stride;             ///< 4*mb_width+1 used for some 4x4 block arrays to allow simple addressing
-    int h_edge_pos, v_edge_pos;///< horizontal / vertical position of the right/bottom edge (pixel replication)
-    int mb_num;                ///< number of MBs of a picture
-    ptrdiff_t linesize;        ///< line size, in bytes, may be different from width
-    ptrdiff_t uvlinesize;      ///< line size, for chroma in bytes, may be different from width
-    Picture *picture;          ///< main picture buffer
-    Picture **input_picture;   ///< next pictures on display order for encoding
-    Picture **reordered_input_picture; ///< pointer to the next pictures in codedorder for encoding
-
-    int y_dc_scale, c_dc_scale;
-    int ac_pred;
-    int block_last_index[12];  ///< last non zero coefficient in block
-    int h263_aic;              ///< Advanded INTRA Coding (AIC)
-
-    /* scantables */
-    ScanTable inter_scantable; ///< if inter == intra then intra should be used to reduce tha cache usage
-    ScanTable intra_scantable;
-    ScanTable intra_h_scantable;
-    ScanTable intra_v_scantable;
-
-    /* WARNING: changes above this line require updates to hardcoded
-     *          offsets used in asm. */
-
-    int64_t user_specified_pts; ///< last non-zero pts from AVFrame which was passed into avcodec_encode_video2()
-    /**
-     * pts difference between the first and second input frame, used for
-     * calculating dts of the first frame when there's a delay */
-    int64_t dts_delta;
-    /**
-     * reordered pts to be used as dts for the next output frame when there's
-     * a delay */
-    int64_t reordered_pts;
-
-    /** bit output */
-    PutBitContext pb;
-
-    int start_mb_y;            ///< start mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
-    int end_mb_y;              ///< end   mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
-    struct MpegEncContext *thread_context[MAX_THREADS];
-    int slice_context_count;   ///< number of used thread_contexts
-
-    /**
-     * copy of the previous picture structure.
-     * note, linesize & data, might not match the previous picture (for field pictures)
-     */
-    Picture last_picture;
-
-    /**
-     * copy of the next picture structure.
-     * note, linesize & data, might not match the next picture (for field pictures)
-     */
-    Picture next_picture;
-
-    /**
-     * copy of the source picture structure for encoding.
-     * note, linesize & data, might not match the source picture (for field pictures)
-     */
-    Picture new_picture;
-
-    /**
-     * copy of the current picture structure.
-     * note, linesize & data, might not match the current picture (for field pictures)
-     */
-    Picture current_picture;    ///< buffer to store the decompressed current picture
-
-    Picture *last_picture_ptr;     ///< pointer to the previous picture.
-    Picture *next_picture_ptr;     ///< pointer to the next picture (for bidir pred)
-    Picture *current_picture_ptr;  ///< pointer to the current picture
-    int last_dc[3];                ///< last DC values for MPEG1
-    int16_t *dc_val_base;
-    int16_t *dc_val[3];            ///< used for mpeg4 DC prediction, all 3 arrays must be continuous
-    const uint8_t *y_dc_scale_table;     ///< qscale -> y_dc_scale table
-    const uint8_t *c_dc_scale_table;     ///< qscale -> c_dc_scale table
-    const uint8_t *chroma_qscale_table;  ///< qscale -> chroma_qscale (h263)
-    uint8_t *coded_block_base;
-    uint8_t *coded_block;          ///< used for coded block pattern prediction (msmpeg4v3, wmv1)
-    int16_t (*ac_val_base)[16];
-    int16_t (*ac_val[3])[16];      ///< used for for mpeg4 AC prediction, all 3 arrays must be continuous
-    int mb_skipped;                ///< MUST BE SET only during DECODING
-    uint8_t *mbskip_table;        /**< used to avoid copy if macroblock skipped (for black regions for example)
-                                   and used for b-frame encoding & decoding (contains skip table of next P Frame) */
-    uint8_t *mbintra_table;       ///< used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding
-    uint8_t *cbp_table;           ///< used to store cbp, ac_pred for partitioned decoding
-    uint8_t *pred_dir_table;      ///< used to store pred_dir for partitioned decoding
-    uint8_t *edge_emu_buffer;     ///< temporary buffer for if MVs point to out-of-frame data
-    uint8_t *rd_scratchpad;       ///< scratchpad for rate distortion mb decision
-    uint8_t *obmc_scratchpad;
-    uint8_t *b_scratchpad;        ///< scratchpad used for writing into write only buffers
-
-    int qscale;                 ///< QP
-    int chroma_qscale;          ///< chroma QP
-    unsigned int lambda;        ///< lagrange multipler used in rate distortion
-    unsigned int lambda2;       ///< (lambda*lambda) >> FF_LAMBDA_SHIFT
-    int *lambda_table;
-    int adaptive_quant;         ///< use adaptive quantization
-    int dquant;                 ///< qscale difference to prev qscale
-    int pict_type;              ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
-    int last_pict_type; //FIXME removes
-    int last_non_b_pict_type;   ///< used for mpeg4 gmc b-frames & ratecontrol
-    int droppable;
-    int frame_rate_index;
-    int last_lambda_for[5];     ///< last lambda for a specific pict type
-    int skipdct;                ///< skip dct and code zero residual
-
-    /* motion compensation */
-    int unrestricted_mv;        ///< mv can point outside of the coded picture
-    int h263_long_vectors;      ///< use horrible h263v1 long vector mode
-
-    DSPContext dsp;             ///< pointers for accelerated dsp functions
-    HpelDSPContext hdsp;
-    VideoDSPContext vdsp;
-    H263DSPContext h263dsp;
-    int f_code;                 ///< forward MV resolution
-    int b_code;                 ///< backward MV resolution for B Frames (mpeg4)
-    int16_t (*p_mv_table_base)[2];
-    int16_t (*b_forw_mv_table_base)[2];
-    int16_t (*b_back_mv_table_base)[2];
-    int16_t (*b_bidir_forw_mv_table_base)[2];
-    int16_t (*b_bidir_back_mv_table_base)[2];
-    int16_t (*b_direct_mv_table_base)[2];
-    int16_t (*p_field_mv_table_base[2][2])[2];
-    int16_t (*b_field_mv_table_base[2][2][2])[2];
-    int16_t (*p_mv_table)[2];            ///< MV table (1MV per MB) p-frame encoding
-    int16_t (*b_forw_mv_table)[2];       ///< MV table (1MV per MB) forward mode b-frame encoding
-    int16_t (*b_back_mv_table)[2];       ///< MV table (1MV per MB) backward mode b-frame encoding
-    int16_t (*b_bidir_forw_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
-    int16_t (*b_bidir_back_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
-    int16_t (*b_direct_mv_table)[2];     ///< MV table (1MV per MB) direct mode b-frame encoding
-    int16_t (*p_field_mv_table[2][2])[2];   ///< MV table (2MV per MB) interlaced p-frame encoding
-    int16_t (*b_field_mv_table[2][2][2])[2];///< MV table (4MV per MB) interlaced b-frame encoding
-    uint8_t (*p_field_select_table[2]);
-    uint8_t (*b_field_select_table[2][2]);
-    int me_method;                       ///< ME algorithm
-    int mv_dir;
-#define MV_DIR_FORWARD   1
-#define MV_DIR_BACKWARD  2
-#define MV_DIRECT        4 ///< bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4)
-    int mv_type;
-#define MV_TYPE_16X16       0   ///< 1 vector for the whole mb
-#define MV_TYPE_8X8         1   ///< 4 vectors (h263, mpeg4 4MV)
-#define MV_TYPE_16X8        2   ///< 2 vectors, one per 16x8 block
-#define MV_TYPE_FIELD       3   ///< 2 vectors, one per field
-#define MV_TYPE_DMV         4   ///< 2 vectors, special mpeg2 Dual Prime Vectors
-    /**motion vectors for a macroblock
-       first coordinate : 0 = forward 1 = backward
-       second "         : depend on type
-       third  "         : 0 = x, 1 = y
-    */
-    int mv[2][4][2];
-    int field_select[2][2];
-    int last_mv[2][2][2];             ///< last MV, used for MV prediction in MPEG1 & B-frame MPEG4
-    uint8_t *fcode_tab;               ///< smallest fcode needed for each MV
-    int16_t direct_scale_mv[2][64];   ///< precomputed to avoid divisions in ff_mpeg4_set_direct_mv
-
-    MotionEstContext me;
-
-    int no_rounding;  /**< apply no rounding to motion compensation (MPEG4, msmpeg4, ...)
-                        for b-frames rounding mode is always 0 */
-
-    /* macroblock layer */
-    int mb_x, mb_y;
-    int mb_skip_run;
-    int mb_intra;
-    uint16_t *mb_type;           ///< Table for candidate MB types for encoding
-#define CANDIDATE_MB_TYPE_INTRA    0x01
-#define CANDIDATE_MB_TYPE_INTER    0x02
-#define CANDIDATE_MB_TYPE_INTER4V  0x04
-#define CANDIDATE_MB_TYPE_SKIPPED   0x08
-//#define MB_TYPE_GMC      0x10
-
-#define CANDIDATE_MB_TYPE_DIRECT   0x10
-#define CANDIDATE_MB_TYPE_FORWARD  0x20
-#define CANDIDATE_MB_TYPE_BACKWARD 0x40
-#define CANDIDATE_MB_TYPE_BIDIR    0x80
-
-#define CANDIDATE_MB_TYPE_INTER_I    0x100
-#define CANDIDATE_MB_TYPE_FORWARD_I  0x200
-#define CANDIDATE_MB_TYPE_BACKWARD_I 0x400
-#define CANDIDATE_MB_TYPE_BIDIR_I    0x800
-
-#define CANDIDATE_MB_TYPE_DIRECT0    0x1000
-
-    int block_index[6]; ///< index to current MB in block based arrays with edges
-    int block_wrap[6];
-    uint8_t *dest[3];
-
-    int *mb_index2xy;        ///< mb_index -> mb_x + mb_y*mb_stride
-
-    /** matrix transmitted in the bitstream */
-    uint16_t intra_matrix[64];
-    uint16_t chroma_intra_matrix[64];
-    uint16_t inter_matrix[64];
-    uint16_t chroma_inter_matrix[64];
-#define QUANT_BIAS_SHIFT 8
-    int intra_quant_bias;    ///< bias for the quantizer
-    int inter_quant_bias;    ///< bias for the quantizer
-    int min_qcoeff;          ///< minimum encodable coefficient
-    int max_qcoeff;          ///< maximum encodable coefficient
-    int ac_esc_length;       ///< num of bits needed to encode the longest esc
-    uint8_t *intra_ac_vlc_length;
-    uint8_t *intra_ac_vlc_last_length;
-    uint8_t *inter_ac_vlc_length;
-    uint8_t *inter_ac_vlc_last_length;
-    uint8_t *luma_dc_vlc_length;
-#define UNI_AC_ENC_INDEX(run,level) ((run)*128 + (level))
-
-    int coded_score[8];
-
-    /** precomputed matrix (combine qscale and DCT renorm) */
-    int (*q_intra_matrix)[64];
-    int (*q_inter_matrix)[64];
-    /** identical to the above but for MMX & these are not permutated, second 64 entries are bias*/
-    uint16_t (*q_intra_matrix16)[2][64];
-    uint16_t (*q_inter_matrix16)[2][64];
-
-    /* noise reduction */
-    int (*dct_error_sum)[64];
-    int dct_count[2];
-    uint16_t (*dct_offset)[64];
-
-    void *opaque;              ///< private data for the user
-
-    /* bit rate control */
-    int64_t total_bits;
-    int frame_bits;                ///< bits used for the current frame
-    int next_lambda;               ///< next lambda used for retrying to encode a frame
-    RateControlContext rc_context; ///< contains stuff only accessed in ratecontrol.c
-
-    /* statistics, used for 2-pass encoding */
-    int mv_bits;
-    int header_bits;
-    int i_tex_bits;
-    int p_tex_bits;
-    int i_count;
-    int f_count;
-    int b_count;
-    int skip_count;
-    int misc_bits; ///< cbp, mb_type
-    int last_bits; ///< temp var used for calculating the above vars
-
-    /* error concealment / resync */
-    int resync_mb_x;                 ///< x position of last resync marker
-    int resync_mb_y;                 ///< y position of last resync marker
-    GetBitContext last_resync_gb;    ///< used to search for the next resync marker
-    int mb_num_left;                 ///< number of MBs left in this video packet (for partitioned Slices only)
-    int next_p_frame_damaged;        ///< set if the next p frame is damaged, to avoid showing trashed b frames
-    int err_recognition;
-
-    ParseContext parse_context;
-
-    /* H.263 specific */
-    int gob_index;
-    int obmc;                       ///< overlapped block motion compensation
-    int mb_info;                    ///< interval for outputting info about mb offsets as side data
-    int prev_mb_info, last_mb_info;
-    uint8_t *mb_info_ptr;
-    int mb_info_size;
-
-    /* H.263+ specific */
-    int umvplus;                    ///< == H263+ && unrestricted_mv
-    int h263_aic_dir;               ///< AIC direction: 0 = left, 1 = top
-    int h263_slice_structured;
-    int alt_inter_vlc;              ///< alternative inter vlc
-    int modified_quant;
-    int loop_filter;
-    int custom_pcf;
-
-    /* mpeg4 specific */
-    ///< number of bits to represent the fractional part of time (encoder only)
-    int time_increment_bits;
-    int last_time_base;
-    int time_base;                  ///< time in seconds of last I,P,S Frame
-    int64_t time;                   ///< time of current frame
-    int64_t last_non_b_time;
-    uint16_t pp_time;               ///< time distance between the last 2 p,s,i frames
-    uint16_t pb_time;               ///< time distance between the last b and p,s,i frame
-    uint16_t pp_field_time;
-    uint16_t pb_field_time;         ///< like above, just for interlaced
-    int real_sprite_warping_points;
-    int sprite_offset[2][2];         ///< sprite offset[isChroma][isMVY]
-    int sprite_delta[2][2];          ///< sprite_delta [isY][isMVY]
-    int mcsel;
-    int quant_precision;
-    int quarter_sample;              ///< 1->qpel, 0->half pel ME/MC
-    int aspect_ratio_info; //FIXME remove
-    int sprite_warping_accuracy;
-    int data_partitioning;           ///< data partitioning flag from header
-    int partitioned_frame;           ///< is current frame partitioned
-    int low_delay;                   ///< no reordering needed / has no b-frames
-    int vo_type;
-    int vol_control_parameters;      ///< does the stream contain the low_delay flag, used to workaround buggy encoders
-    PutBitContext tex_pb;            ///< used for data partitioned VOPs
-    PutBitContext pb2;               ///< used for data partitioned VOPs
-    int mpeg_quant;
-    int padding_bug_score;             ///< used to detect the VERY common padding bug in MPEG4
-
-    /* divx specific, used to workaround (many) bugs in divx5 */
-    int divx_packed;
-    uint8_t *bitstream_buffer; //Divx 5.01 puts several frames in a single one, this is used to reorder them
-    int bitstream_buffer_size;
-    unsigned int allocated_bitstream_buffer_size;
-
-    /* RV10 specific */
-    int rv10_version; ///< RV10 version: 0 or 3
-    int rv10_first_dc_coded[3];
-    int orig_width, orig_height;
-
-    /* MJPEG specific */
-    struct MJpegContext *mjpeg_ctx;
-
-    /* MSMPEG4 specific */
-    int mv_table_index;
-    int rl_table_index;
-    int rl_chroma_table_index;
-    int dc_table_index;
-    int use_skip_mb_code;
-    int slice_height;      ///< in macroblocks
-    int first_slice_line;  ///< used in mpeg4 too to handle resync markers
-    int flipflop_rounding;
-    int msmpeg4_version;   ///< 0=not msmpeg4, 1=mp41, 2=mp42, 3=mp43/divx3 4=wmv1/7 5=wmv2/8
-    int per_mb_rl_table;
-    int esc3_level_length;
-    int esc3_run_length;
-    /** [mb_intra][isChroma][level][run][last] */
-    int (*ac_stats)[2][MAX_LEVEL+1][MAX_RUN+1][2];
-    int inter_intra_pred;
-    int mspel;
-
-    /* decompression specific */
-    GetBitContext gb;
-
-    /* Mpeg1 specific */
-    int gop_picture_number;  ///< index of the first picture of a GOP based on fake_pic_num & mpeg1 specific
-    int last_mv_dir;         ///< last mv_dir, used for b frame encoding
-    uint8_t *vbv_delay_ptr;  ///< pointer to vbv_delay in the bitstream
-
-    /* MPEG-2-specific - I wished not to have to support this mess. */
-    int progressive_sequence;
-    int mpeg_f_code[2][2];
-    int picture_structure;
-/* picture type */
-#define PICT_TOP_FIELD     1
-#define PICT_BOTTOM_FIELD  2
-#define PICT_FRAME         3
-
-    int intra_dc_precision;
-    int frame_pred_frame_dct;
-    int top_field_first;
-    int concealment_motion_vectors;
-    int q_scale_type;
-    int intra_vlc_format;
-    int alternate_scan;
-    int repeat_first_field;
-    int chroma_420_type;
-    int chroma_format;
-#define CHROMA_420 1
-#define CHROMA_422 2
-#define CHROMA_444 3
-    int chroma_x_shift;//depend on pix_format, that depend on chroma_format
-    int chroma_y_shift;
-
-    int progressive_frame;
-    int full_pel[2];
-    int interlaced_dct;
-    int first_field;         ///< is 1 for the first field of a field picture 0 otherwise
-    int drop_frame_timecode; ///< timecode is in drop frame format.
-    int scan_offset;         ///< reserve space for SVCD scan offset user data.
-
-    /* RTP specific */
-    int rtp_mode;
-
-    uint8_t *ptr_lastgob;
-    int16_t (*pblocks[12])[64];
-
-    int16_t (*block)[64]; ///< points to one of the following blocks
-    int16_t (*blocks)[8][64]; // for HQ mode we need to keep the best block
-    int (*decode_mb)(struct MpegEncContext *s, int16_t block[6][64]); // used by some codecs to avoid a switch()
-#define SLICE_OK         0
-#define SLICE_ERROR     -1
-#define SLICE_END       -2 ///<end marker found
-#define SLICE_NOEND     -3 ///<no end marker or error found but mb count exceeded
-
-    void (*dct_unquantize_mpeg1_intra)(struct MpegEncContext *s,
-                           int16_t *block/*align 16*/, int n, int qscale);
-    void (*dct_unquantize_mpeg1_inter)(struct MpegEncContext *s,
-                           int16_t *block/*align 16*/, int n, int qscale);
-    void (*dct_unquantize_mpeg2_intra)(struct MpegEncContext *s,
-                           int16_t *block/*align 16*/, int n, int qscale);
-    void (*dct_unquantize_mpeg2_inter)(struct MpegEncContext *s,
-                           int16_t *block/*align 16*/, int n, int qscale);
-    void (*dct_unquantize_h263_intra)(struct MpegEncContext *s,
-                           int16_t *block/*align 16*/, int n, int qscale);
-    void (*dct_unquantize_h263_inter)(struct MpegEncContext *s,
-                           int16_t *block/*align 16*/, int n, int qscale);
-    void (*dct_unquantize_h261_intra)(struct MpegEncContext *s,
-                           int16_t *block/*align 16*/, int n, int qscale);
-    void (*dct_unquantize_h261_inter)(struct MpegEncContext *s,
-                           int16_t *block/*align 16*/, int n, int qscale);
-    void (*dct_unquantize_intra)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
-                           int16_t *block/*align 16*/, int n, int qscale);
-    void (*dct_unquantize_inter)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
-                           int16_t *block/*align 16*/, int n, int qscale);
-    int (*dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow);
-    int (*fast_dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow);
-    void (*denoise_dct)(struct MpegEncContext *s, int16_t *block);
-
-    int mpv_flags;      ///< flags set by private options
-    int quantizer_noise_shaping;
-
-    /* temp buffers for rate control */
-    float *cplx_tab, *bits_tab;
-
-    /* flag to indicate a reinitialization is required, e.g. after
-     * a frame size change */
-    int context_reinit;
-
-    ERContext er;
-
-    int error_rate;
-
-    /* temporary frames used by b_frame_strategy = 2 */
-    AVFrame *tmp_frames[MAX_B_FRAMES + 2];
-} MpegEncContext;
-
-#define REBASE_PICTURE(pic, new_ctx, old_ctx)             \
-    ((pic && pic >= old_ctx->picture &&                   \
-      pic < old_ctx->picture + MAX_PICTURE_COUNT) ?  \
-        &new_ctx->picture[pic - old_ctx->picture] : NULL)
-
-/* mpegvideo_enc common options */
-#define FF_MPV_FLAG_SKIP_RD      0x0001
-#define FF_MPV_FLAG_STRICT_GOP   0x0002
-#define FF_MPV_FLAG_QP_RD        0x0004
-#define FF_MPV_FLAG_CBP_RD       0x0008
-
-#define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
-#define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
-#define FF_MPV_COMMON_OPTS \
-{ "mpv_flags",      "Flags common for all mpegvideo-based encoders.", FF_MPV_OFFSET(mpv_flags), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, "mpv_flags" },\
-{ "skip_rd",        "RD optimal MB level residual skipping", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_SKIP_RD },    0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
-{ "strict_gop",     "Strictly enforce gop size",             0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_STRICT_GOP }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
-{ "qp_rd",          "Use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_QP_RD },  0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
-{ "cbp_rd",         "use rate distortion optimization for CBP",          0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_CBP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
-{ "luma_elim_threshold",   "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)",\
-                                                                      FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
-{ "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\
-                                                                      FF_MPV_OFFSET(chroma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
-{ "quantizer_noise_shaping", NULL,                                  FF_MPV_OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, { .i64 = 0 },       0, INT_MAX, FF_MPV_OPT_FLAGS },\
-{ "error_rate", "Simulate errors in the bitstream to test error concealment.",                                                                                                  \
-                                                                    FF_MPV_OFFSET(error_rate),              AV_OPT_TYPE_INT, { .i64 = 0 },       0, INT_MAX, FF_MPV_OPT_FLAGS },
-
-extern const AVOption ff_mpv_generic_options[];
-
-#define FF_MPV_GENERIC_CLASS(name) \
-static const AVClass name ## _class = {\
-    .class_name = #name " encoder",\
-    .item_name  = av_default_item_name,\
-    .option     = ff_mpv_generic_options,\
-    .version    = LIBAVUTIL_VERSION_INT,\
-};
-
-/**
- * Set the given MpegEncContext to common defaults (same for encoding
- * and decoding).  The changed fields will not depend upon the prior
- * state of the MpegEncContext.
- */
-void ff_MPV_common_defaults(MpegEncContext *s);
-
-void ff_MPV_decode_defaults(MpegEncContext *s);
-int ff_MPV_common_init(MpegEncContext *s);
-int ff_MPV_common_frame_size_change(MpegEncContext *s);
-void ff_MPV_common_end(MpegEncContext *s);
-void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]);
-int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx);
-void ff_MPV_frame_end(MpegEncContext *s);
-int ff_MPV_encode_init(AVCodecContext *avctx);
-int ff_MPV_encode_end(AVCodecContext *avctx);
-int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
-                          const AVFrame *frame, int *got_packet);
-void ff_MPV_encode_init_x86(MpegEncContext *s);
-void ff_MPV_common_init_x86(MpegEncContext *s);
-void ff_MPV_common_init_arm(MpegEncContext *s);
-void ff_MPV_common_init_ppc(MpegEncContext *s);
-void ff_clean_intra_table_entries(MpegEncContext *s);
-void ff_draw_horiz_band(AVCodecContext *avctx, Picture *cur, Picture *last,
-                        int y, int h, int picture_structure, int first_field,
-                        int low_delay);
-void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h);
-void ff_mpeg_flush(AVCodecContext *avctx);
-void ff_print_debug_info(MpegEncContext *s, Picture *p);
-void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix);
-int ff_find_unused_picture(MpegEncContext *s, int shared);
-void ff_denoise_dct(MpegEncContext *s, int16_t *block);
-int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src);
-int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir);
-void ff_MPV_report_decode_progress(MpegEncContext *s);
-int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src);
-void ff_set_qscale(MpegEncContext * s, int qscale);
-
-void ff_mpeg_er_frame_start(MpegEncContext *s);
-
-int ff_dct_common_init(MpegEncContext *s);
-void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64],
-                       const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra);
-int ff_dct_quantize_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow);
-
-void ff_init_block_index(MpegEncContext *s);
-
-void ff_MPV_motion(MpegEncContext *s,
-                   uint8_t *dest_y, uint8_t *dest_cb,
-                   uint8_t *dest_cr, int dir,
-                   uint8_t **ref_picture,
-                   op_pixels_func (*pix_op)[4],
-                   qpel_mc_func (*qpix_op)[16]);
-
-/**
- * Allocate a Picture.
- * The pixels are allocated/set by calling get_buffer() if shared = 0.
- */
-int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared);
-
-extern const enum AVPixelFormat ff_pixfmt_list_420[];
-
-/**
- * permute block according to permuatation.
- * @param last last non zero element in scantable order
- */
-void ff_block_permute(int16_t *block, uint8_t *permutation, const uint8_t *scantable, int last);
-
-static inline void ff_update_block_index(MpegEncContext *s){
-    const int block_size = 8;
-
-    s->block_index[0]+=2;
-    s->block_index[1]+=2;
-    s->block_index[2]+=2;
-    s->block_index[3]+=2;
-    s->block_index[4]++;
-    s->block_index[5]++;
-    s->dest[0]+= 2*block_size;
-    s->dest[1]+= block_size;
-    s->dest[2]+= block_size;
-}
-
-static inline int get_bits_diff(MpegEncContext *s){
-    const int bits= put_bits_count(&s->pb);
-    const int last= s->last_bits;
-
-    s->last_bits = bits;
-
-    return bits - last;
-}
-
-static inline int ff_h263_round_chroma(int x){
-    static const uint8_t h263_chroma_roundtab[16] = {
-    //  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-        0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1,
-    };
-    return h263_chroma_roundtab[x & 0xf] + (x >> 3);
-}
-
-/* motion_est.c */
-void ff_estimate_p_frame_motion(MpegEncContext * s,
-                             int mb_x, int mb_y);
-void ff_estimate_b_frame_motion(MpegEncContext * s,
-                             int mb_x, int mb_y);
-int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type);
-void ff_fix_long_p_mvs(MpegEncContext * s);
-void ff_fix_long_mvs(MpegEncContext * s, uint8_t *field_select_table, int field_select,
-                     int16_t (*mv_table)[2], int f_code, int type, int truncate);
-int ff_init_me(MpegEncContext *s);
-int ff_pre_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y);
-int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr,
-                             int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
-                             int ref_mv_scale, int size, int h);
-int ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index,
-                               int ref_index, int size, int h, int add_rate);
-
-/* mpeg12.c */
-extern const uint8_t ff_mpeg1_dc_scale_table[128];
-extern const uint8_t * const ff_mpeg2_dc_scale_table[4];
-
-void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
-void ff_mpeg1_encode_mb(MpegEncContext *s,
-                        int16_t block[6][64],
-                        int motion_x, int motion_y);
-void ff_mpeg1_encode_init(MpegEncContext *s);
-void ff_mpeg1_encode_slice_header(MpegEncContext *s);
-
-extern const uint8_t ff_aic_dc_scale_table[32];
-extern const uint8_t ff_h263_chroma_qscale_table[32];
-
-/* rv10.c */
-void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number);
-int ff_rv_decode_dc(MpegEncContext *s, int n);
-void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number);
-
-
-/* msmpeg4.c */
-void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number);
-void ff_msmpeg4_encode_ext_header(MpegEncContext * s);
-void ff_msmpeg4_encode_mb(MpegEncContext * s,
-                          int16_t block[6][64],
-                          int motion_x, int motion_y);
-int ff_msmpeg4_decode_picture_header(MpegEncContext * s);
-int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size);
-int ff_msmpeg4_decode_init(AVCodecContext *avctx);
-void ff_msmpeg4_encode_init(MpegEncContext *s);
-int ff_wmv2_decode_picture_header(MpegEncContext * s);
-int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s);
-void ff_wmv2_add_mb(MpegEncContext *s, int16_t block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr);
-void ff_mspel_motion(MpegEncContext *s,
-                               uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
-                               uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
-                               int motion_x, int motion_y, int h);
-int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number);
-void ff_wmv2_encode_mb(MpegEncContext * s,
-                       int16_t block[6][64],
-                       int motion_x, int motion_y);
-
-int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src);
-void ff_mpeg_unref_picture(MpegEncContext *s, Picture *picture);
-void ff_free_picture_tables(Picture *pic);
-
-#endif /* AVCODEC_MPEGVIDEO_H */
diff --git a/deps/libav/libavcodec/mpegvideo_enc.c b/deps/libav/libavcodec/mpegvideo_enc.c
deleted file mode 100644
index 091bee3..0000000
--- a/deps/libav/libavcodec/mpegvideo_enc.c
+++ /dev/null
@@ -1,4302 +0,0 @@
-/*
- * The simplest mpeg encoder (well, it was the simplest!)
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * 4MV & hq & B-frame encoding stuff by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * The simplest mpeg encoder (well, it was the simplest!).
- */
-
-#include <stdint.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/intmath.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/opt.h"
-#include "libavutil/timer.h"
-#include "avcodec.h"
-#include "dct.h"
-#include "dsputil.h"
-#include "mpeg12.h"
-#include "mpegvideo.h"
-#include "h261.h"
-#include "h263.h"
-#include "mathops.h"
-#include "mjpegenc.h"
-#include "msmpeg4.h"
-#include "faandct.h"
-#include "thread.h"
-#include "aandcttab.h"
-#include "flv.h"
-#include "mpeg4video.h"
-#include "internal.h"
-#include "bytestream.h"
-#include <limits.h>
-
-static int encode_picture(MpegEncContext *s, int picture_number);
-static int dct_quantize_refine(MpegEncContext *s, int16_t *block, int16_t *weight, int16_t *orig, int n, int qscale);
-static int sse_mb(MpegEncContext *s);
-static void denoise_dct_c(MpegEncContext *s, int16_t *block);
-static int dct_quantize_trellis_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow);
-
-static uint8_t default_mv_penalty[MAX_FCODE + 1][MAX_MV * 2 + 1];
-static uint8_t default_fcode_tab[MAX_MV * 2 + 1];
-
-const AVOption ff_mpv_generic_options[] = {
-    FF_MPV_COMMON_OPTS
-    { NULL },
-};
-
-void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
-                       uint16_t (*qmat16)[2][64],
-                       const uint16_t *quant_matrix,
-                       int bias, int qmin, int qmax, int intra)
-{
-    int qscale;
-    int shift = 0;
-
-    for (qscale = qmin; qscale <= qmax; qscale++) {
-        int i;
-        if (dsp->fdct == ff_jpeg_fdct_islow_8 ||
-            dsp->fdct == ff_jpeg_fdct_islow_10 ||
-            dsp->fdct == ff_faandct) {
-            for (i = 0; i < 64; i++) {
-                const int j = dsp->idct_permutation[i];
-                /* 16 <= qscale * quant_matrix[i] <= 7905
-                 * Assume x = ff_aanscales[i] * qscale * quant_matrix[i]
-                 *             19952 <=              x  <= 249205026
-                 * (1 << 36) / 19952 >= (1 << 36) / (x) >= (1 << 36) / 249205026
-                 *           3444240 >= (1 << 36) / (x) >= 275 */
-
-                qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
-                                        (qscale * quant_matrix[j]));
-            }
-        } else if (dsp->fdct == ff_fdct_ifast) {
-            for (i = 0; i < 64; i++) {
-                const int j = dsp->idct_permutation[i];
-                /* 16 <= qscale * quant_matrix[i] <= 7905
-                 * Assume x = ff_aanscales[i] * qscale * quant_matrix[i]
-                 *             19952 <=              x  <= 249205026
-                 * (1 << 36) / 19952 >= (1 << 36) / (x) >= (1 << 36) / 249205026
-                 *           3444240 >= (1 << 36) / (x) >= 275 */
-
-                qmat[qscale][i] = (int)((UINT64_C(1) << (QMAT_SHIFT + 14)) /
-                                        (ff_aanscales[i] * qscale *
-                                         quant_matrix[j]));
-            }
-        } else {
-            for (i = 0; i < 64; i++) {
-                const int j = dsp->idct_permutation[i];
-                /* We can safely suppose that 16 <= quant_matrix[i] <= 255
-                 * Assume x = qscale * quant_matrix[i]
-                 * So             16 <=              x  <= 7905
-                 * so (1 << 19) / 16 >= (1 << 19) / (x) >= (1 << 19) / 7905
-                 * so          32768 >= (1 << 19) / (x) >= 67 */
-                qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
-                                        (qscale * quant_matrix[j]));
-                //qmat  [qscale][i] = (1 << QMAT_SHIFT_MMX) /
-                //                    (qscale * quant_matrix[i]);
-                qmat16[qscale][0][i] = (1 << QMAT_SHIFT_MMX) /
-                                       (qscale * quant_matrix[j]);
-
-                if (qmat16[qscale][0][i] == 0 ||
-                    qmat16[qscale][0][i] == 128 * 256)
-                    qmat16[qscale][0][i] = 128 * 256 - 1;
-                qmat16[qscale][1][i] =
-                    ROUNDED_DIV(bias << (16 - QUANT_BIAS_SHIFT),
-                                qmat16[qscale][0][i]);
-            }
-        }
-
-        for (i = intra; i < 64; i++) {
-            int64_t max = 8191;
-            if (dsp->fdct == ff_fdct_ifast) {
-                max = (8191LL * ff_aanscales[i]) >> 14;
-            }
-            while (((max * qmat[qscale][i]) >> shift) > INT_MAX) {
-                shift++;
-            }
-        }
-    }
-    if (shift) {
-        av_log(NULL, AV_LOG_INFO,
-               "Warning, QMAT_SHIFT is larger than %d, overflows possible\n",
-               QMAT_SHIFT - shift);
-    }
-}
-
-static inline void update_qscale(MpegEncContext *s)
-{
-    s->qscale = (s->lambda * 139 + FF_LAMBDA_SCALE * 64) >>
-                (FF_LAMBDA_SHIFT + 7);
-    s->qscale = av_clip(s->qscale, s->avctx->qmin, s->avctx->qmax);
-
-    s->lambda2 = (s->lambda * s->lambda + FF_LAMBDA_SCALE / 2) >>
-                 FF_LAMBDA_SHIFT;
-}
-
-void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix)
-{
-    int i;
-
-    if (matrix) {
-        put_bits(pb, 1, 1);
-        for (i = 0; i < 64; i++) {
-            put_bits(pb, 8, matrix[ff_zigzag_direct[i]]);
-        }
-    } else
-        put_bits(pb, 1, 0);
-}
-
-/**
- * init s->current_picture.qscale_table from s->lambda_table
- */
-void ff_init_qscale_tab(MpegEncContext *s)
-{
-    int8_t * const qscale_table = s->current_picture.qscale_table;
-    int i;
-
-    for (i = 0; i < s->mb_num; i++) {
-        unsigned int lam = s->lambda_table[s->mb_index2xy[i]];
-        int qp = (lam * 139 + FF_LAMBDA_SCALE * 64) >> (FF_LAMBDA_SHIFT + 7);
-        qscale_table[s->mb_index2xy[i]] = av_clip(qp, s->avctx->qmin,
-                                                  s->avctx->qmax);
-    }
-}
-
-static void update_duplicate_context_after_me(MpegEncContext *dst,
-                                              MpegEncContext *src)
-{
-#define COPY(a) dst->a= src->a
-    COPY(pict_type);
-    COPY(current_picture);
-    COPY(f_code);
-    COPY(b_code);
-    COPY(qscale);
-    COPY(lambda);
-    COPY(lambda2);
-    COPY(picture_in_gop_number);
-    COPY(gop_picture_number);
-    COPY(frame_pred_frame_dct); // FIXME don't set in encode_header
-    COPY(progressive_frame);    // FIXME don't set in encode_header
-    COPY(partitioned_frame);    // FIXME don't set in encode_header
-#undef COPY
-}
-
-/**
- * Set the given MpegEncContext to defaults for encoding.
- * the changed fields will not depend upon the prior state of the MpegEncContext.
- */
-static void MPV_encode_defaults(MpegEncContext *s)
-{
-    int i;
-    ff_MPV_common_defaults(s);
-
-    for (i = -16; i < 16; i++) {
-        default_fcode_tab[i + MAX_MV] = 1;
-    }
-    s->me.mv_penalty = default_mv_penalty;
-    s->fcode_tab     = default_fcode_tab;
-
-    s->input_picture_number  = 0;
-    s->picture_in_gop_number = 0;
-}
-
-/* init video encoder */
-av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
-{
-    MpegEncContext *s = avctx->priv_data;
-    int i, ret;
-
-    MPV_encode_defaults(s);
-
-    switch (avctx->codec_id) {
-    case AV_CODEC_ID_MPEG2VIDEO:
-        if (avctx->pix_fmt != AV_PIX_FMT_YUV420P &&
-            avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "only YUV420 and YUV422 are supported\n");
-            return -1;
-        }
-        break;
-    case AV_CODEC_ID_MJPEG:
-        if (avctx->pix_fmt != AV_PIX_FMT_YUVJ420P &&
-            avctx->pix_fmt != AV_PIX_FMT_YUVJ422P &&
-            ((avctx->pix_fmt != AV_PIX_FMT_YUV420P &&
-              avctx->pix_fmt != AV_PIX_FMT_YUV422P) ||
-             avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)) {
-            av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n");
-            return -1;
-        }
-        break;
-    default:
-        if (avctx->pix_fmt != AV_PIX_FMT_YUV420P) {
-            av_log(avctx, AV_LOG_ERROR, "only YUV420 is supported\n");
-            return -1;
-        }
-    }
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_YUVJ422P:
-    case AV_PIX_FMT_YUV422P:
-        s->chroma_format = CHROMA_422;
-        break;
-    case AV_PIX_FMT_YUVJ420P:
-    case AV_PIX_FMT_YUV420P:
-    default:
-        s->chroma_format = CHROMA_420;
-        break;
-    }
-
-    s->bit_rate = avctx->bit_rate;
-    s->width    = avctx->width;
-    s->height   = avctx->height;
-    if (avctx->gop_size > 600 &&
-        avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Warning keyframe interval too large! reducing it ...\n");
-        avctx->gop_size = 600;
-    }
-    s->gop_size     = avctx->gop_size;
-    s->avctx        = avctx;
-    s->flags        = avctx->flags;
-    s->flags2       = avctx->flags2;
-    if (avctx->max_b_frames > MAX_B_FRAMES) {
-        av_log(avctx, AV_LOG_ERROR, "Too many B-frames requested, maximum "
-               "is %d.\n", MAX_B_FRAMES);
-    }
-    s->max_b_frames = avctx->max_b_frames;
-    s->codec_id     = avctx->codec->id;
-    s->strict_std_compliance = avctx->strict_std_compliance;
-    s->quarter_sample     = (avctx->flags & CODEC_FLAG_QPEL) != 0;
-    s->mpeg_quant         = avctx->mpeg_quant;
-    s->rtp_mode           = !!avctx->rtp_payload_size;
-    s->intra_dc_precision = avctx->intra_dc_precision;
-    s->user_specified_pts = AV_NOPTS_VALUE;
-
-    if (s->gop_size <= 1) {
-        s->intra_only = 1;
-        s->gop_size   = 12;
-    } else {
-        s->intra_only = 0;
-    }
-
-    s->me_method = avctx->me_method;
-
-    /* Fixed QSCALE */
-    s->fixed_qscale = !!(avctx->flags & CODEC_FLAG_QSCALE);
-
-    s->adaptive_quant = (s->avctx->lumi_masking ||
-                         s->avctx->dark_masking ||
-                         s->avctx->temporal_cplx_masking ||
-                         s->avctx->spatial_cplx_masking  ||
-                         s->avctx->p_masking      ||
-                         s->avctx->border_masking ||
-                         (s->mpv_flags & FF_MPV_FLAG_QP_RD)) &&
-                        !s->fixed_qscale;
-
-    s->loop_filter      = !!(s->flags & CODEC_FLAG_LOOP_FILTER);
-
-    if (avctx->rc_max_rate && !avctx->rc_buffer_size) {
-        av_log(avctx, AV_LOG_ERROR,
-               "a vbv buffer size is needed, "
-               "for encoding with a maximum bitrate\n");
-        return -1;
-    }
-
-    if (avctx->rc_min_rate && avctx->rc_max_rate != avctx->rc_min_rate) {
-        av_log(avctx, AV_LOG_INFO,
-               "Warning min_rate > 0 but min_rate != max_rate isn't recommended!\n");
-    }
-
-    if (avctx->rc_min_rate && avctx->rc_min_rate > avctx->bit_rate) {
-        av_log(avctx, AV_LOG_ERROR, "bitrate below min bitrate\n");
-        return -1;
-    }
-
-    if (avctx->rc_max_rate && avctx->rc_max_rate < avctx->bit_rate) {
-        av_log(avctx, AV_LOG_INFO, "bitrate above max bitrate\n");
-        return -1;
-    }
-
-    if (avctx->rc_max_rate &&
-        avctx->rc_max_rate == avctx->bit_rate &&
-        avctx->rc_max_rate != avctx->rc_min_rate) {
-        av_log(avctx, AV_LOG_INFO,
-               "impossible bitrate constraints, this will fail\n");
-    }
-
-    if (avctx->rc_buffer_size &&
-        avctx->bit_rate * (int64_t)avctx->time_base.num >
-            avctx->rc_buffer_size * (int64_t)avctx->time_base.den) {
-        av_log(avctx, AV_LOG_ERROR, "VBV buffer too small for bitrate\n");
-        return -1;
-    }
-
-    if (!s->fixed_qscale &&
-        avctx->bit_rate * av_q2d(avctx->time_base) >
-            avctx->bit_rate_tolerance) {
-        av_log(avctx, AV_LOG_ERROR,
-               "bitrate tolerance too small for bitrate\n");
-        return -1;
-    }
-
-    if (s->avctx->rc_max_rate &&
-        s->avctx->rc_min_rate == s->avctx->rc_max_rate &&
-        (s->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
-         s->codec_id == AV_CODEC_ID_MPEG2VIDEO) &&
-        90000LL * (avctx->rc_buffer_size - 1) >
-            s->avctx->rc_max_rate * 0xFFFFLL) {
-        av_log(avctx, AV_LOG_INFO,
-               "Warning vbv_delay will be set to 0xFFFF (=VBR) as the "
-               "specified vbv buffer is too large for the given bitrate!\n");
-    }
-
-    if ((s->flags & CODEC_FLAG_4MV)  && s->codec_id != AV_CODEC_ID_MPEG4 &&
-        s->codec_id != AV_CODEC_ID_H263 && s->codec_id != AV_CODEC_ID_H263P &&
-        s->codec_id != AV_CODEC_ID_FLV1) {
-        av_log(avctx, AV_LOG_ERROR, "4MV not supported by codec\n");
-        return -1;
-    }
-
-    if (s->obmc && s->avctx->mb_decision != FF_MB_DECISION_SIMPLE) {
-        av_log(avctx, AV_LOG_ERROR,
-               "OBMC is only supported with simple mb decision\n");
-        return -1;
-    }
-
-    if (s->quarter_sample && s->codec_id != AV_CODEC_ID_MPEG4) {
-        av_log(avctx, AV_LOG_ERROR, "qpel not supported by codec\n");
-        return -1;
-    }
-
-    if (s->max_b_frames                    &&
-        s->codec_id != AV_CODEC_ID_MPEG4      &&
-        s->codec_id != AV_CODEC_ID_MPEG1VIDEO &&
-        s->codec_id != AV_CODEC_ID_MPEG2VIDEO) {
-        av_log(avctx, AV_LOG_ERROR, "b frames not supported by codec\n");
-        return -1;
-    }
-
-    if ((s->codec_id == AV_CODEC_ID_MPEG4 ||
-         s->codec_id == AV_CODEC_ID_H263  ||
-         s->codec_id == AV_CODEC_ID_H263P) &&
-        (avctx->sample_aspect_ratio.num > 255 ||
-         avctx->sample_aspect_ratio.den > 255)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Invalid pixel aspect ratio %i/%i, limit is 255/255\n",
-               avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den);
-        return -1;
-    }
-
-    if ((s->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME)) &&
-        s->codec_id != AV_CODEC_ID_MPEG4 && s->codec_id != AV_CODEC_ID_MPEG2VIDEO) {
-        av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n");
-        return -1;
-    }
-
-    // FIXME mpeg2 uses that too
-    if (s->mpeg_quant && s->codec_id != AV_CODEC_ID_MPEG4) {
-        av_log(avctx, AV_LOG_ERROR,
-               "mpeg2 style quantization not supported by codec\n");
-        return -1;
-    }
-
-    if ((s->mpv_flags & FF_MPV_FLAG_CBP_RD) && !avctx->trellis) {
-        av_log(avctx, AV_LOG_ERROR, "CBP RD needs trellis quant\n");
-        return -1;
-    }
-
-    if ((s->mpv_flags & FF_MPV_FLAG_QP_RD) &&
-        s->avctx->mb_decision != FF_MB_DECISION_RD) {
-        av_log(avctx, AV_LOG_ERROR, "QP RD needs mbd=2\n");
-        return -1;
-    }
-
-    if (s->avctx->scenechange_threshold < 1000000000 &&
-        (s->flags & CODEC_FLAG_CLOSED_GOP)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "closed gop with scene change detection are not supported yet, "
-               "set threshold to 1000000000\n");
-        return -1;
-    }
-
-    if (s->flags & CODEC_FLAG_LOW_DELAY) {
-        if (s->codec_id != AV_CODEC_ID_MPEG2VIDEO) {
-            av_log(avctx, AV_LOG_ERROR,
-                  "low delay forcing is only available for mpeg2\n");
-            return -1;
-        }
-        if (s->max_b_frames != 0) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "b frames cannot be used with low delay\n");
-            return -1;
-        }
-    }
-
-    if (s->q_scale_type == 1) {
-        if (avctx->qmax > 12) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "non linear quant only supports qmax <= 12 currently\n");
-            return -1;
-        }
-    }
-
-    if (s->avctx->thread_count > 1         &&
-        s->codec_id != AV_CODEC_ID_MPEG4      &&
-        s->codec_id != AV_CODEC_ID_MPEG1VIDEO &&
-        s->codec_id != AV_CODEC_ID_MPEG2VIDEO &&
-        (s->codec_id != AV_CODEC_ID_H263P)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "multi threaded encoding not supported by codec\n");
-        return -1;
-    }
-
-    if (s->avctx->thread_count < 1) {
-        av_log(avctx, AV_LOG_ERROR,
-               "automatic thread number detection not supported by codec,"
-               "patch welcome\n");
-        return -1;
-    }
-
-    if (s->avctx->thread_count > 1)
-        s->rtp_mode = 1;
-
-    if (!avctx->time_base.den || !avctx->time_base.num) {
-        av_log(avctx, AV_LOG_ERROR, "framerate not set\n");
-        return -1;
-    }
-
-    i = (INT_MAX / 2 + 128) >> 8;
-    if (avctx->mb_threshold >= i) {
-        av_log(avctx, AV_LOG_ERROR, "mb_threshold too large, max is %d\n",
-               i - 1);
-        return -1;
-    }
-
-    if (avctx->b_frame_strategy && (avctx->flags & CODEC_FLAG_PASS2)) {
-        av_log(avctx, AV_LOG_INFO,
-               "notice: b_frame_strategy only affects the first pass\n");
-        avctx->b_frame_strategy = 0;
-    }
-
-    i = av_gcd(avctx->time_base.den, avctx->time_base.num);
-    if (i > 1) {
-        av_log(avctx, AV_LOG_INFO, "removing common factors from framerate\n");
-        avctx->time_base.den /= i;
-        avctx->time_base.num /= i;
-        //return -1;
-    }
-
-    if (s->mpeg_quant || s->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
-        s->codec_id == AV_CODEC_ID_MPEG2VIDEO || s->codec_id == AV_CODEC_ID_MJPEG) {
-        // (a + x * 3 / 8) / x
-        s->intra_quant_bias = 3 << (QUANT_BIAS_SHIFT - 3);
-        s->inter_quant_bias = 0;
-    } else {
-        s->intra_quant_bias = 0;
-        // (a - x / 4) / x
-        s->inter_quant_bias = -(1 << (QUANT_BIAS_SHIFT - 2));
-    }
-
-    if (avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
-        s->intra_quant_bias = avctx->intra_quant_bias;
-    if (avctx->inter_quant_bias != FF_DEFAULT_QUANT_BIAS)
-        s->inter_quant_bias = avctx->inter_quant_bias;
-
-    if (avctx->codec_id == AV_CODEC_ID_MPEG4 &&
-        s->avctx->time_base.den > (1 << 16) - 1) {
-        av_log(avctx, AV_LOG_ERROR,
-               "timebase %d/%d not supported by MPEG 4 standard, "
-               "the maximum admitted value for the timebase denominator "
-               "is %d\n", s->avctx->time_base.num, s->avctx->time_base.den,
-               (1 << 16) - 1);
-        return -1;
-    }
-    s->time_increment_bits = av_log2(s->avctx->time_base.den - 1) + 1;
-
-    switch (avctx->codec->id) {
-    case AV_CODEC_ID_MPEG1VIDEO:
-        s->out_format = FMT_MPEG1;
-        s->low_delay  = !!(s->flags & CODEC_FLAG_LOW_DELAY);
-        avctx->delay  = s->low_delay ? 0 : (s->max_b_frames + 1);
-        break;
-    case AV_CODEC_ID_MPEG2VIDEO:
-        s->out_format = FMT_MPEG1;
-        s->low_delay  = !!(s->flags & CODEC_FLAG_LOW_DELAY);
-        avctx->delay  = s->low_delay ? 0 : (s->max_b_frames + 1);
-        s->rtp_mode   = 1;
-        break;
-    case AV_CODEC_ID_MJPEG:
-        s->out_format = FMT_MJPEG;
-        s->intra_only = 1; /* force intra only for jpeg */
-        if (!CONFIG_MJPEG_ENCODER ||
-            ff_mjpeg_encode_init(s) < 0)
-            return -1;
-        avctx->delay = 0;
-        s->low_delay = 1;
-        break;
-    case AV_CODEC_ID_H261:
-        if (!CONFIG_H261_ENCODER)
-            return -1;
-        if (ff_h261_get_picture_format(s->width, s->height) < 0) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "The specified picture size of %dx%d is not valid for the "
-                   "H.261 codec.\nValid sizes are 176x144, 352x288\n",
-                    s->width, s->height);
-            return -1;
-        }
-        s->out_format = FMT_H261;
-        avctx->delay  = 0;
-        s->low_delay  = 1;
-        break;
-    case AV_CODEC_ID_H263:
-        if (!CONFIG_H263_ENCODER)
-        return -1;
-        if (ff_match_2uint16(ff_h263_format, FF_ARRAY_ELEMS(ff_h263_format),
-                             s->width, s->height) == 8) {
-            av_log(avctx, AV_LOG_INFO,
-                   "The specified picture size of %dx%d is not valid for "
-                   "the H.263 codec.\nValid sizes are 128x96, 176x144, "
-                   "352x288, 704x576, and 1408x1152."
-                   "Try H.263+.\n", s->width, s->height);
-            return -1;
-        }
-        s->out_format = FMT_H263;
-        avctx->delay  = 0;
-        s->low_delay  = 1;
-        break;
-    case AV_CODEC_ID_H263P:
-        s->out_format = FMT_H263;
-        s->h263_plus  = 1;
-        /* Fx */
-        s->h263_aic        = (avctx->flags & CODEC_FLAG_AC_PRED) ? 1 : 0;
-        s->modified_quant  = s->h263_aic;
-        s->loop_filter     = (avctx->flags & CODEC_FLAG_LOOP_FILTER) ? 1 : 0;
-        s->unrestricted_mv = s->obmc || s->loop_filter || s->umvplus;
-
-        /* /Fx */
-        /* These are just to be sure */
-        avctx->delay = 0;
-        s->low_delay = 1;
-        break;
-    case AV_CODEC_ID_FLV1:
-        s->out_format      = FMT_H263;
-        s->h263_flv        = 2; /* format = 1; 11-bit codes */
-        s->unrestricted_mv = 1;
-        s->rtp_mode  = 0; /* don't allow GOB */
-        avctx->delay = 0;
-        s->low_delay = 1;
-        break;
-    case AV_CODEC_ID_RV10:
-        s->out_format = FMT_H263;
-        avctx->delay  = 0;
-        s->low_delay  = 1;
-        break;
-    case AV_CODEC_ID_RV20:
-        s->out_format      = FMT_H263;
-        avctx->delay       = 0;
-        s->low_delay       = 1;
-        s->modified_quant  = 1;
-        s->h263_aic        = 1;
-        s->h263_plus       = 1;
-        s->loop_filter     = 1;
-        s->unrestricted_mv = 0;
-        break;
-    case AV_CODEC_ID_MPEG4:
-        s->out_format      = FMT_H263;
-        s->h263_pred       = 1;
-        s->unrestricted_mv = 1;
-        s->low_delay       = s->max_b_frames ? 0 : 1;
-        avctx->delay       = s->low_delay ? 0 : (s->max_b_frames + 1);
-        break;
-    case AV_CODEC_ID_MSMPEG4V2:
-        s->out_format      = FMT_H263;
-        s->h263_pred       = 1;
-        s->unrestricted_mv = 1;
-        s->msmpeg4_version = 2;
-        avctx->delay       = 0;
-        s->low_delay       = 1;
-        break;
-    case AV_CODEC_ID_MSMPEG4V3:
-        s->out_format        = FMT_H263;
-        s->h263_pred         = 1;
-        s->unrestricted_mv   = 1;
-        s->msmpeg4_version   = 3;
-        s->flipflop_rounding = 1;
-        avctx->delay         = 0;
-        s->low_delay         = 1;
-        break;
-    case AV_CODEC_ID_WMV1:
-        s->out_format        = FMT_H263;
-        s->h263_pred         = 1;
-        s->unrestricted_mv   = 1;
-        s->msmpeg4_version   = 4;
-        s->flipflop_rounding = 1;
-        avctx->delay         = 0;
-        s->low_delay         = 1;
-        break;
-    case AV_CODEC_ID_WMV2:
-        s->out_format        = FMT_H263;
-        s->h263_pred         = 1;
-        s->unrestricted_mv   = 1;
-        s->msmpeg4_version   = 5;
-        s->flipflop_rounding = 1;
-        avctx->delay         = 0;
-        s->low_delay         = 1;
-        break;
-    default:
-        return -1;
-    }
-
-    avctx->has_b_frames = !s->low_delay;
-
-    s->encoding = 1;
-
-    s->progressive_frame    =
-    s->progressive_sequence = !(avctx->flags & (CODEC_FLAG_INTERLACED_DCT |
-                                                CODEC_FLAG_INTERLACED_ME) ||
-                                s->alternate_scan);
-
-    /* init */
-    if (ff_MPV_common_init(s) < 0)
-        return -1;
-
-    if (ARCH_X86)
-        ff_MPV_encode_init_x86(s);
-
-    s->avctx->coded_frame = &s->current_picture.f;
-
-    if (s->msmpeg4_version) {
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->ac_stats,
-                          2 * 2 * (MAX_LEVEL + 1) *
-                          (MAX_RUN + 1) * 2 * sizeof(int), fail);
-    }
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->avctx->stats_out, 256, fail);
-
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->q_intra_matrix,   64 * 32 * sizeof(int), fail);
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->q_inter_matrix,   64 * 32 * sizeof(int), fail);
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->q_intra_matrix16, 64 * 32 * 2 * sizeof(uint16_t), fail);
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->q_inter_matrix16, 64 * 32 * 2 * sizeof(uint16_t), fail);
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->input_picture,
-                      MAX_PICTURE_COUNT * sizeof(Picture *), fail);
-    FF_ALLOCZ_OR_GOTO(s->avctx, s->reordered_input_picture,
-                      MAX_PICTURE_COUNT * sizeof(Picture *), fail);
-
-    if (s->avctx->noise_reduction) {
-        FF_ALLOCZ_OR_GOTO(s->avctx, s->dct_offset,
-                          2 * 64 * sizeof(uint16_t), fail);
-    }
-
-    if (CONFIG_H263_ENCODER)
-        ff_h263dsp_init(&s->h263dsp);
-    if (!s->dct_quantize)
-        s->dct_quantize = ff_dct_quantize_c;
-    if (!s->denoise_dct)
-        s->denoise_dct  = denoise_dct_c;
-    s->fast_dct_quantize = s->dct_quantize;
-    if (avctx->trellis)
-        s->dct_quantize  = dct_quantize_trellis_c;
-
-    if ((CONFIG_H263P_ENCODER || CONFIG_RV20_ENCODER) && s->modified_quant)
-        s->chroma_qscale_table = ff_h263_chroma_qscale_table;
-
-    s->quant_precision = 5;
-
-    ff_set_cmp(&s->dsp, s->dsp.ildct_cmp, s->avctx->ildct_cmp);
-    ff_set_cmp(&s->dsp, s->dsp.frame_skip_cmp, s->avctx->frame_skip_cmp);
-
-    if (CONFIG_H261_ENCODER && s->out_format == FMT_H261)
-        ff_h261_encode_init(s);
-    if (CONFIG_H263_ENCODER && s->out_format == FMT_H263)
-        ff_h263_encode_init(s);
-    if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version)
-        ff_msmpeg4_encode_init(s);
-    if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
-        && s->out_format == FMT_MPEG1)
-        ff_mpeg1_encode_init(s);
-
-    /* init q matrix */
-    for (i = 0; i < 64; i++) {
-        int j = s->dsp.idct_permutation[i];
-        if (CONFIG_MPEG4_ENCODER && s->codec_id == AV_CODEC_ID_MPEG4 &&
-            s->mpeg_quant) {
-            s->intra_matrix[j] = ff_mpeg4_default_intra_matrix[i];
-            s->inter_matrix[j] = ff_mpeg4_default_non_intra_matrix[i];
-        } else if (s->out_format == FMT_H263 || s->out_format == FMT_H261) {
-            s->intra_matrix[j] =
-            s->inter_matrix[j] = ff_mpeg1_default_non_intra_matrix[i];
-        } else {
-            /* mpeg1/2 */
-            s->intra_matrix[j] = ff_mpeg1_default_intra_matrix[i];
-            s->inter_matrix[j] = ff_mpeg1_default_non_intra_matrix[i];
-        }
-        if (s->avctx->intra_matrix)
-            s->intra_matrix[j] = s->avctx->intra_matrix[i];
-        if (s->avctx->inter_matrix)
-            s->inter_matrix[j] = s->avctx->inter_matrix[i];
-    }
-
-    /* precompute matrix */
-    /* for mjpeg, we do include qscale in the matrix */
-    if (s->out_format != FMT_MJPEG) {
-        ff_convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
-                          s->intra_matrix, s->intra_quant_bias, avctx->qmin,
-                          31, 1);
-        ff_convert_matrix(&s->dsp, s->q_inter_matrix, s->q_inter_matrix16,
-                          s->inter_matrix, s->inter_quant_bias, avctx->qmin,
-                          31, 0);
-    }
-
-    if (ff_rate_control_init(s) < 0)
-        return -1;
-
-#if FF_API_ERROR_RATE
-    FF_DISABLE_DEPRECATION_WARNINGS
-    if (avctx->error_rate)
-        s->error_rate = avctx->error_rate;
-    FF_ENABLE_DEPRECATION_WARNINGS;
-#endif
-
-    if (avctx->b_frame_strategy == 2) {
-        for (i = 0; i < s->max_b_frames + 2; i++) {
-            s->tmp_frames[i] = av_frame_alloc();
-            if (!s->tmp_frames[i])
-                return AVERROR(ENOMEM);
-
-            s->tmp_frames[i]->format = AV_PIX_FMT_YUV420P;
-            s->tmp_frames[i]->width  = s->width  >> avctx->brd_scale;
-            s->tmp_frames[i]->height = s->height >> avctx->brd_scale;
-
-            ret = av_frame_get_buffer(s->tmp_frames[i], 32);
-            if (ret < 0)
-                return ret;
-        }
-    }
-
-    return 0;
-fail:
-    ff_MPV_encode_end(avctx);
-    return AVERROR_UNKNOWN;
-}
-
-av_cold int ff_MPV_encode_end(AVCodecContext *avctx)
-{
-    MpegEncContext *s = avctx->priv_data;
-    int i;
-
-    ff_rate_control_uninit(s);
-
-    ff_MPV_common_end(s);
-    if (CONFIG_MJPEG_ENCODER &&
-        s->out_format == FMT_MJPEG)
-        ff_mjpeg_encode_close(s);
-
-    av_freep(&avctx->extradata);
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->tmp_frames); i++)
-        av_frame_free(&s->tmp_frames[i]);
-
-    ff_free_picture_tables(&s->new_picture);
-    ff_mpeg_unref_picture(s, &s->new_picture);
-
-    av_freep(&s->avctx->stats_out);
-    av_freep(&s->ac_stats);
-
-    av_freep(&s->q_intra_matrix);
-    av_freep(&s->q_inter_matrix);
-    av_freep(&s->q_intra_matrix16);
-    av_freep(&s->q_inter_matrix16);
-    av_freep(&s->input_picture);
-    av_freep(&s->reordered_input_picture);
-    av_freep(&s->dct_offset);
-
-    return 0;
-}
-
-static int get_sae(uint8_t *src, int ref, int stride)
-{
-    int x,y;
-    int acc = 0;
-
-    for (y = 0; y < 16; y++) {
-        for (x = 0; x < 16; x++) {
-            acc += FFABS(src[x + y * stride] - ref);
-        }
-    }
-
-    return acc;
-}
-
-static int get_intra_count(MpegEncContext *s, uint8_t *src,
-                           uint8_t *ref, int stride)
-{
-    int x, y, w, h;
-    int acc = 0;
-
-    w = s->width  & ~15;
-    h = s->height & ~15;
-
-    for (y = 0; y < h; y += 16) {
-        for (x = 0; x < w; x += 16) {
-            int offset = x + y * stride;
-            int sad  = s->dsp.sad[0](NULL, src + offset, ref + offset, stride,
-                                     16);
-            int mean = (s->dsp.pix_sum(src + offset, stride) + 128) >> 8;
-            int sae  = get_sae(src + offset, mean, stride);
-
-            acc += sae + 500 < sad;
-        }
-    }
-    return acc;
-}
-
-
-static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
-{
-    Picture *pic = NULL;
-    int64_t pts;
-    int i, display_picture_number = 0, ret;
-    const int encoding_delay = s->max_b_frames ? s->max_b_frames :
-                                                 (s->low_delay ? 0 : 1);
-    int direct = 1;
-
-    if (pic_arg) {
-        pts = pic_arg->pts;
-        display_picture_number = s->input_picture_number++;
-
-        if (pts != AV_NOPTS_VALUE) {
-            if (s->user_specified_pts != AV_NOPTS_VALUE) {
-                int64_t time = pts;
-                int64_t last = s->user_specified_pts;
-
-                if (time <= last) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "Error, Invalid timestamp=%"PRId64", "
-                           "last=%"PRId64"\n", pts, s->user_specified_pts);
-                    return -1;
-                }
-
-                if (!s->low_delay && display_picture_number == 1)
-                    s->dts_delta = time - last;
-            }
-            s->user_specified_pts = pts;
-        } else {
-            if (s->user_specified_pts != AV_NOPTS_VALUE) {
-                s->user_specified_pts =
-                pts = s->user_specified_pts + 1;
-                av_log(s->avctx, AV_LOG_INFO,
-                       "Warning: AVFrame.pts=? trying to guess (%"PRId64")\n",
-                       pts);
-            } else {
-                pts = display_picture_number;
-            }
-        }
-    }
-
-    if (pic_arg) {
-        if (!pic_arg->buf[0]);
-            direct = 0;
-        if (pic_arg->linesize[0] != s->linesize)
-            direct = 0;
-        if (pic_arg->linesize[1] != s->uvlinesize)
-            direct = 0;
-        if (pic_arg->linesize[2] != s->uvlinesize)
-            direct = 0;
-
-        av_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0],
-                pic_arg->linesize[1], s->linesize, s->uvlinesize);
-
-        if (direct) {
-            i = ff_find_unused_picture(s, 1);
-            if (i < 0)
-                return i;
-
-            pic = &s->picture[i];
-            pic->reference = 3;
-
-            if ((ret = av_frame_ref(&pic->f, pic_arg)) < 0)
-                return ret;
-            if (ff_alloc_picture(s, pic, 1) < 0) {
-                return -1;
-            }
-        } else {
-            i = ff_find_unused_picture(s, 0);
-            if (i < 0)
-                return i;
-
-            pic = &s->picture[i];
-            pic->reference = 3;
-
-            if (ff_alloc_picture(s, pic, 0) < 0) {
-                return -1;
-            }
-
-            if (pic->f.data[0] + INPLACE_OFFSET == pic_arg->data[0] &&
-                pic->f.data[1] + INPLACE_OFFSET == pic_arg->data[1] &&
-                pic->f.data[2] + INPLACE_OFFSET == pic_arg->data[2]) {
-                // empty
-            } else {
-                int h_chroma_shift, v_chroma_shift;
-                av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
-                                                 &h_chroma_shift,
-                                                 &v_chroma_shift);
-
-                for (i = 0; i < 3; i++) {
-                    int src_stride = pic_arg->linesize[i];
-                    int dst_stride = i ? s->uvlinesize : s->linesize;
-                    int h_shift = i ? h_chroma_shift : 0;
-                    int v_shift = i ? v_chroma_shift : 0;
-                    int w = s->width  >> h_shift;
-                    int h = s->height >> v_shift;
-                    uint8_t *src = pic_arg->data[i];
-                    uint8_t *dst = pic->f.data[i];
-
-                    if (!s->avctx->rc_buffer_size)
-                        dst += INPLACE_OFFSET;
-
-                    if (src_stride == dst_stride)
-                        memcpy(dst, src, src_stride * h);
-                    else {
-                        while (h--) {
-                            memcpy(dst, src, w);
-                            dst += dst_stride;
-                            src += src_stride;
-                        }
-                    }
-                }
-            }
-        }
-        ret = av_frame_copy_props(&pic->f, pic_arg);
-        if (ret < 0)
-            return ret;
-
-        pic->f.display_picture_number = display_picture_number;
-        pic->f.pts = pts; // we set this here to avoid modifiying pic_arg
-    }
-
-    /* shift buffer entries */
-    for (i = 1; i < MAX_PICTURE_COUNT /*s->encoding_delay + 1*/; i++)
-        s->input_picture[i - 1] = s->input_picture[i];
-
-    s->input_picture[encoding_delay] = (Picture*) pic;
-
-    return 0;
-}
-
-static int skip_check(MpegEncContext *s, Picture *p, Picture *ref)
-{
-    int x, y, plane;
-    int score = 0;
-    int64_t score64 = 0;
-
-    for (plane = 0; plane < 3; plane++) {
-        const int stride = p->f.linesize[plane];
-        const int bw = plane ? 1 : 2;
-        for (y = 0; y < s->mb_height * bw; y++) {
-            for (x = 0; x < s->mb_width * bw; x++) {
-                int off = p->shared ? 0 : 16;
-                uint8_t *dptr = p->f.data[plane] + 8 * (x + y * stride) + off;
-                uint8_t *rptr = ref->f.data[plane] + 8 * (x + y * stride);
-                int v   = s->dsp.frame_skip_cmp[1](s, dptr, rptr, stride, 8);
-
-                switch (s->avctx->frame_skip_exp) {
-                case 0: score    =  FFMAX(score, v);          break;
-                case 1: score   += FFABS(v);                  break;
-                case 2: score   += v * v;                     break;
-                case 3: score64 += FFABS(v * v * (int64_t)v); break;
-                case 4: score64 += v * v * (int64_t)(v * v);  break;
-                }
-            }
-        }
-    }
-
-    if (score)
-        score64 = score;
-
-    if (score64 < s->avctx->frame_skip_threshold)
-        return 1;
-    if (score64 < ((s->avctx->frame_skip_factor * (int64_t)s->lambda) >> 8))
-        return 1;
-    return 0;
-}
-
-static int encode_frame(AVCodecContext *c, AVFrame *frame)
-{
-    AVPacket pkt = { 0 };
-    int ret, got_output;
-
-    av_init_packet(&pkt);
-    ret = avcodec_encode_video2(c, &pkt, frame, &got_output);
-    if (ret < 0)
-        return ret;
-
-    ret = pkt.size;
-    av_free_packet(&pkt);
-    return ret;
-}
-
-static int estimate_best_b_count(MpegEncContext *s)
-{
-    AVCodec *codec    = avcodec_find_encoder(s->avctx->codec_id);
-    AVCodecContext *c = avcodec_alloc_context3(NULL);
-    const int scale = s->avctx->brd_scale;
-    int i, j, out_size, p_lambda, b_lambda, lambda2;
-    int64_t best_rd  = INT64_MAX;
-    int best_b_count = -1;
-
-    assert(scale >= 0 && scale <= 3);
-
-    //emms_c();
-    //s->next_picture_ptr->quality;
-    p_lambda = s->last_lambda_for[AV_PICTURE_TYPE_P];
-    //p_lambda * FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset;
-    b_lambda = s->last_lambda_for[AV_PICTURE_TYPE_B];
-    if (!b_lambda) // FIXME we should do this somewhere else
-        b_lambda = p_lambda;
-    lambda2  = (b_lambda * b_lambda + (1 << FF_LAMBDA_SHIFT) / 2) >>
-               FF_LAMBDA_SHIFT;
-
-    c->width        = s->width  >> scale;
-    c->height       = s->height >> scale;
-    c->flags        = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR |
-                      CODEC_FLAG_INPUT_PRESERVED;
-    c->flags       |= s->avctx->flags & CODEC_FLAG_QPEL;
-    c->mb_decision  = s->avctx->mb_decision;
-    c->me_cmp       = s->avctx->me_cmp;
-    c->mb_cmp       = s->avctx->mb_cmp;
-    c->me_sub_cmp   = s->avctx->me_sub_cmp;
-    c->pix_fmt      = AV_PIX_FMT_YUV420P;
-    c->time_base    = s->avctx->time_base;
-    c->max_b_frames = s->max_b_frames;
-
-    if (avcodec_open2(c, codec, NULL) < 0)
-        return -1;
-
-    for (i = 0; i < s->max_b_frames + 2; i++) {
-        Picture pre_input, *pre_input_ptr = i ? s->input_picture[i - 1] :
-                                                s->next_picture_ptr;
-
-        if (pre_input_ptr && (!i || s->input_picture[i - 1])) {
-            pre_input = *pre_input_ptr;
-
-            if (!pre_input.shared && i) {
-                pre_input.f.data[0] += INPLACE_OFFSET;
-                pre_input.f.data[1] += INPLACE_OFFSET;
-                pre_input.f.data[2] += INPLACE_OFFSET;
-            }
-
-            s->dsp.shrink[scale](s->tmp_frames[i]->data[0], s->tmp_frames[i]->linesize[0],
-                                 pre_input.f.data[0], pre_input.f.linesize[0],
-                                 c->width,      c->height);
-            s->dsp.shrink[scale](s->tmp_frames[i]->data[1], s->tmp_frames[i]->linesize[1],
-                                 pre_input.f.data[1], pre_input.f.linesize[1],
-                                 c->width >> 1, c->height >> 1);
-            s->dsp.shrink[scale](s->tmp_frames[i]->data[2], s->tmp_frames[i]->linesize[2],
-                                 pre_input.f.data[2], pre_input.f.linesize[2],
-                                 c->width >> 1, c->height >> 1);
-        }
-    }
-
-    for (j = 0; j < s->max_b_frames + 1; j++) {
-        int64_t rd = 0;
-
-        if (!s->input_picture[j])
-            break;
-
-        c->error[0] = c->error[1] = c->error[2] = 0;
-
-        s->tmp_frames[0]->pict_type = AV_PICTURE_TYPE_I;
-        s->tmp_frames[0]->quality   = 1 * FF_QP2LAMBDA;
-
-        out_size = encode_frame(c, s->tmp_frames[0]);
-
-        //rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT;
-
-        for (i = 0; i < s->max_b_frames + 1; i++) {
-            int is_p = i % (j + 1) == j || i == s->max_b_frames;
-
-            s->tmp_frames[i + 1]->pict_type = is_p ?
-                                     AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_B;
-            s->tmp_frames[i + 1]->quality   = is_p ? p_lambda : b_lambda;
-
-            out_size = encode_frame(c, s->tmp_frames[i + 1]);
-
-            rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
-        }
-
-        /* get the delayed frames */
-        while (out_size) {
-            out_size = encode_frame(c, NULL);
-            rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
-        }
-
-        rd += c->error[0] + c->error[1] + c->error[2];
-
-        if (rd < best_rd) {
-            best_rd = rd;
-            best_b_count = j;
-        }
-    }
-
-    avcodec_close(c);
-    av_freep(&c);
-
-    return best_b_count;
-}
-
-static int select_input_picture(MpegEncContext *s)
-{
-    int i, ret;
-
-    for (i = 1; i < MAX_PICTURE_COUNT; i++)
-        s->reordered_input_picture[i - 1] = s->reordered_input_picture[i];
-    s->reordered_input_picture[MAX_PICTURE_COUNT - 1] = NULL;
-
-    /* set next picture type & ordering */
-    if (s->reordered_input_picture[0] == NULL && s->input_picture[0]) {
-        if (/*s->picture_in_gop_number >= s->gop_size ||*/
-            s->next_picture_ptr == NULL || s->intra_only) {
-            s->reordered_input_picture[0] = s->input_picture[0];
-            s->reordered_input_picture[0]->f.pict_type = AV_PICTURE_TYPE_I;
-            s->reordered_input_picture[0]->f.coded_picture_number =
-                s->coded_picture_number++;
-        } else {
-            int b_frames;
-
-            if (s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor) {
-                if (s->picture_in_gop_number < s->gop_size &&
-                    skip_check(s, s->input_picture[0], s->next_picture_ptr)) {
-                    // FIXME check that te gop check above is +-1 correct
-                    av_frame_unref(&s->input_picture[0]->f);
-
-                    emms_c();
-                    ff_vbv_update(s, 0);
-
-                    goto no_output_pic;
-                }
-            }
-
-            if (s->flags & CODEC_FLAG_PASS2) {
-                for (i = 0; i < s->max_b_frames + 1; i++) {
-                    int pict_num = s->input_picture[0]->f.display_picture_number + i;
-
-                    if (pict_num >= s->rc_context.num_entries)
-                        break;
-                    if (!s->input_picture[i]) {
-                        s->rc_context.entry[pict_num - 1].new_pict_type = AV_PICTURE_TYPE_P;
-                        break;
-                    }
-
-                    s->input_picture[i]->f.pict_type =
-                        s->rc_context.entry[pict_num].new_pict_type;
-                }
-            }
-
-            if (s->avctx->b_frame_strategy == 0) {
-                b_frames = s->max_b_frames;
-                while (b_frames && !s->input_picture[b_frames])
-                    b_frames--;
-            } else if (s->avctx->b_frame_strategy == 1) {
-                for (i = 1; i < s->max_b_frames + 1; i++) {
-                    if (s->input_picture[i] &&
-                        s->input_picture[i]->b_frame_score == 0) {
-                        s->input_picture[i]->b_frame_score =
-                            get_intra_count(s,
-                                            s->input_picture[i    ]->f.data[0],
-                                            s->input_picture[i - 1]->f.data[0],
-                                            s->linesize) + 1;
-                    }
-                }
-                for (i = 0; i < s->max_b_frames + 1; i++) {
-                    if (s->input_picture[i] == NULL ||
-                        s->input_picture[i]->b_frame_score - 1 >
-                            s->mb_num / s->avctx->b_sensitivity)
-                        break;
-                }
-
-                b_frames = FFMAX(0, i - 1);
-
-                /* reset scores */
-                for (i = 0; i < b_frames + 1; i++) {
-                    s->input_picture[i]->b_frame_score = 0;
-                }
-            } else if (s->avctx->b_frame_strategy == 2) {
-                b_frames = estimate_best_b_count(s);
-            } else {
-                av_log(s->avctx, AV_LOG_ERROR, "illegal b frame strategy\n");
-                b_frames = 0;
-            }
-
-            emms_c();
-
-            for (i = b_frames - 1; i >= 0; i--) {
-                int type = s->input_picture[i]->f.pict_type;
-                if (type && type != AV_PICTURE_TYPE_B)
-                    b_frames = i;
-            }
-            if (s->input_picture[b_frames]->f.pict_type == AV_PICTURE_TYPE_B &&
-                b_frames == s->max_b_frames) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "warning, too many b frames in a row\n");
-            }
-
-            if (s->picture_in_gop_number + b_frames >= s->gop_size) {
-                if ((s->mpv_flags & FF_MPV_FLAG_STRICT_GOP) &&
-                    s->gop_size > s->picture_in_gop_number) {
-                    b_frames = s->gop_size - s->picture_in_gop_number - 1;
-                } else {
-                    if (s->flags & CODEC_FLAG_CLOSED_GOP)
-                        b_frames = 0;
-                    s->input_picture[b_frames]->f.pict_type = AV_PICTURE_TYPE_I;
-                }
-            }
-
-            if ((s->flags & CODEC_FLAG_CLOSED_GOP) && b_frames &&
-                s->input_picture[b_frames]->f.pict_type == AV_PICTURE_TYPE_I)
-                b_frames--;
-
-            s->reordered_input_picture[0] = s->input_picture[b_frames];
-            if (s->reordered_input_picture[0]->f.pict_type != AV_PICTURE_TYPE_I)
-                s->reordered_input_picture[0]->f.pict_type = AV_PICTURE_TYPE_P;
-            s->reordered_input_picture[0]->f.coded_picture_number =
-                s->coded_picture_number++;
-            for (i = 0; i < b_frames; i++) {
-                s->reordered_input_picture[i + 1] = s->input_picture[i];
-                s->reordered_input_picture[i + 1]->f.pict_type =
-                    AV_PICTURE_TYPE_B;
-                s->reordered_input_picture[i + 1]->f.coded_picture_number =
-                    s->coded_picture_number++;
-            }
-        }
-    }
-no_output_pic:
-    if (s->reordered_input_picture[0]) {
-        s->reordered_input_picture[0]->reference =
-           s->reordered_input_picture[0]->f.pict_type !=
-               AV_PICTURE_TYPE_B ? 3 : 0;
-
-        ff_mpeg_unref_picture(s, &s->new_picture);
-        if ((ret = ff_mpeg_ref_picture(s, &s->new_picture, s->reordered_input_picture[0])))
-            return ret;
-
-        if (s->reordered_input_picture[0]->shared || s->avctx->rc_buffer_size) {
-            // input is a shared pix, so we can't modifiy it -> alloc a new
-            // one & ensure that the shared one is reuseable
-
-            Picture *pic;
-            int i = ff_find_unused_picture(s, 0);
-            if (i < 0)
-                return i;
-            pic = &s->picture[i];
-
-            pic->reference = s->reordered_input_picture[0]->reference;
-            if (ff_alloc_picture(s, pic, 0) < 0) {
-                return -1;
-            }
-
-            ret = av_frame_copy_props(&pic->f, &s->reordered_input_picture[0]->f);
-            if (ret < 0)
-                return ret;
-
-            /* mark us unused / free shared pic */
-            av_frame_unref(&s->reordered_input_picture[0]->f);
-            s->reordered_input_picture[0]->shared = 0;
-
-            s->current_picture_ptr = pic;
-        } else {
-            // input is not a shared pix -> reuse buffer for current_pix
-            s->current_picture_ptr = s->reordered_input_picture[0];
-            for (i = 0; i < 4; i++) {
-                s->new_picture.f.data[i] += INPLACE_OFFSET;
-            }
-        }
-        ff_mpeg_unref_picture(s, &s->current_picture);
-        if ((ret = ff_mpeg_ref_picture(s, &s->current_picture,
-                                       s->current_picture_ptr)) < 0)
-            return ret;
-
-        s->picture_number = s->new_picture.f.display_picture_number;
-    } else {
-        ff_mpeg_unref_picture(s, &s->new_picture);
-    }
-    return 0;
-}
-
-static void frame_end(MpegEncContext *s)
-{
-    int i;
-
-    if (s->unrestricted_mv &&
-        s->current_picture.reference &&
-        !s->intra_only) {
-        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
-        int hshift = desc->log2_chroma_w;
-        int vshift = desc->log2_chroma_h;
-        s->dsp.draw_edges(s->current_picture.f.data[0], s->linesize,
-                          s->h_edge_pos, s->v_edge_pos,
-                          EDGE_WIDTH, EDGE_WIDTH,
-                          EDGE_TOP | EDGE_BOTTOM);
-        s->dsp.draw_edges(s->current_picture.f.data[1], s->uvlinesize,
-                          s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
-                          EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
-                          EDGE_TOP | EDGE_BOTTOM);
-        s->dsp.draw_edges(s->current_picture.f.data[2], s->uvlinesize,
-                          s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
-                          EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
-                          EDGE_TOP | EDGE_BOTTOM);
-    }
-
-    emms_c();
-
-    s->last_pict_type                 = s->pict_type;
-    s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f.quality;
-    if (s->pict_type!= AV_PICTURE_TYPE_B)
-        s->last_non_b_pict_type = s->pict_type;
-
-    if (s->encoding) {
-        /* release non-reference frames */
-        for (i = 0; i < MAX_PICTURE_COUNT; i++) {
-            if (!s->picture[i].reference)
-                ff_mpeg_unref_picture(s, &s->picture[i]);
-        }
-    }
-
-    s->avctx->coded_frame = &s->current_picture_ptr->f;
-
-}
-
-static void update_noise_reduction(MpegEncContext *s)
-{
-    int intra, i;
-
-    for (intra = 0; intra < 2; intra++) {
-        if (s->dct_count[intra] > (1 << 16)) {
-            for (i = 0; i < 64; i++) {
-                s->dct_error_sum[intra][i] >>= 1;
-            }
-            s->dct_count[intra] >>= 1;
-        }
-
-        for (i = 0; i < 64; i++) {
-            s->dct_offset[intra][i] = (s->avctx->noise_reduction *
-                                       s->dct_count[intra] +
-                                       s->dct_error_sum[intra][i] / 2) /
-                                      (s->dct_error_sum[intra][i] + 1);
-        }
-    }
-}
-
-static int frame_start(MpegEncContext *s)
-{
-    int ret;
-
-    /* mark & release old frames */
-    if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr &&
-        s->last_picture_ptr != s->next_picture_ptr &&
-        s->last_picture_ptr->f.buf[0]) {
-        ff_mpeg_unref_picture(s, s->last_picture_ptr);
-    }
-
-    s->current_picture_ptr->f.pict_type = s->pict_type;
-    s->current_picture_ptr->f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
-
-    ff_mpeg_unref_picture(s, &s->current_picture);
-    if ((ret = ff_mpeg_ref_picture(s, &s->current_picture,
-                                   s->current_picture_ptr)) < 0)
-        return ret;
-
-    if (s->pict_type != AV_PICTURE_TYPE_B) {
-        s->last_picture_ptr = s->next_picture_ptr;
-        if (!s->droppable)
-            s->next_picture_ptr = s->current_picture_ptr;
-    }
-
-    if (s->last_picture_ptr) {
-        ff_mpeg_unref_picture(s, &s->last_picture);
-        if (s->last_picture_ptr->f.buf[0] &&
-            (ret = ff_mpeg_ref_picture(s, &s->last_picture,
-                                       s->last_picture_ptr)) < 0)
-            return ret;
-    }
-    if (s->next_picture_ptr) {
-        ff_mpeg_unref_picture(s, &s->next_picture);
-        if (s->next_picture_ptr->f.buf[0] &&
-            (ret = ff_mpeg_ref_picture(s, &s->next_picture,
-                                       s->next_picture_ptr)) < 0)
-            return ret;
-    }
-
-    if (s->picture_structure!= PICT_FRAME) {
-        int i;
-        for (i = 0; i < 4; i++) {
-            if (s->picture_structure == PICT_BOTTOM_FIELD) {
-                s->current_picture.f.data[i] +=
-                    s->current_picture.f.linesize[i];
-            }
-            s->current_picture.f.linesize[i] *= 2;
-            s->last_picture.f.linesize[i]    *= 2;
-            s->next_picture.f.linesize[i]    *= 2;
-        }
-    }
-
-    if (s->mpeg_quant || s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-        s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra;
-        s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter;
-    } else if (s->out_format == FMT_H263 || s->out_format == FMT_H261) {
-        s->dct_unquantize_intra = s->dct_unquantize_h263_intra;
-        s->dct_unquantize_inter = s->dct_unquantize_h263_inter;
-    } else {
-        s->dct_unquantize_intra = s->dct_unquantize_mpeg1_intra;
-        s->dct_unquantize_inter = s->dct_unquantize_mpeg1_inter;
-    }
-
-    if (s->dct_error_sum) {
-        assert(s->avctx->noise_reduction && s->encoding);
-        update_noise_reduction(s);
-    }
-
-    return 0;
-}
-
-int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
-                          const AVFrame *pic_arg, int *got_packet)
-{
-    MpegEncContext *s = avctx->priv_data;
-    int i, stuffing_count, ret;
-    int context_count = s->slice_context_count;
-
-    s->picture_in_gop_number++;
-
-    if (load_input_picture(s, pic_arg) < 0)
-        return -1;
-
-    if (select_input_picture(s) < 0) {
-        return -1;
-    }
-
-    /* output? */
-    if (s->new_picture.f.data[0]) {
-        if (!pkt->data &&
-            (ret = ff_alloc_packet(pkt, s->mb_width*s->mb_height*MAX_MB_BYTES)) < 0)
-            return ret;
-        if (s->mb_info) {
-            s->mb_info_ptr = av_packet_new_side_data(pkt,
-                                 AV_PKT_DATA_H263_MB_INFO,
-                                 s->mb_width*s->mb_height*12);
-            s->prev_mb_info = s->last_mb_info = s->mb_info_size = 0;
-        }
-
-        for (i = 0; i < context_count; i++) {
-            int start_y = s->thread_context[i]->start_mb_y;
-            int   end_y = s->thread_context[i]->  end_mb_y;
-            int h       = s->mb_height;
-            uint8_t *start = pkt->data + (size_t)(((int64_t) pkt->size) * start_y / h);
-            uint8_t *end   = pkt->data + (size_t)(((int64_t) pkt->size) *   end_y / h);
-
-            init_put_bits(&s->thread_context[i]->pb, start, end - start);
-        }
-
-        s->pict_type = s->new_picture.f.pict_type;
-        //emms_c();
-        ret = frame_start(s);
-        if (ret < 0)
-            return ret;
-vbv_retry:
-        if (encode_picture(s, s->picture_number) < 0)
-            return -1;
-
-        avctx->header_bits = s->header_bits;
-        avctx->mv_bits     = s->mv_bits;
-        avctx->misc_bits   = s->misc_bits;
-        avctx->i_tex_bits  = s->i_tex_bits;
-        avctx->p_tex_bits  = s->p_tex_bits;
-        avctx->i_count     = s->i_count;
-        // FIXME f/b_count in avctx
-        avctx->p_count     = s->mb_num - s->i_count - s->skip_count;
-        avctx->skip_count  = s->skip_count;
-
-        frame_end(s);
-
-        if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG)
-            ff_mjpeg_encode_picture_trailer(&s->pb, s->header_bits);
-
-        if (avctx->rc_buffer_size) {
-            RateControlContext *rcc = &s->rc_context;
-            int max_size = rcc->buffer_index * avctx->rc_max_available_vbv_use;
-
-            if (put_bits_count(&s->pb) > max_size &&
-                s->lambda < s->avctx->lmax) {
-                s->next_lambda = FFMAX(s->lambda + 1, s->lambda *
-                                       (s->qscale + 1) / s->qscale);
-                if (s->adaptive_quant) {
-                    int i;
-                    for (i = 0; i < s->mb_height * s->mb_stride; i++)
-                        s->lambda_table[i] =
-                            FFMAX(s->lambda_table[i] + 1,
-                                  s->lambda_table[i] * (s->qscale + 1) /
-                                  s->qscale);
-                }
-                s->mb_skipped = 0;        // done in frame_start()
-                // done in encode_picture() so we must undo it
-                if (s->pict_type == AV_PICTURE_TYPE_P) {
-                    if (s->flipflop_rounding          ||
-                        s->codec_id == AV_CODEC_ID_H263P ||
-                        s->codec_id == AV_CODEC_ID_MPEG4)
-                        s->no_rounding ^= 1;
-                }
-                if (s->pict_type != AV_PICTURE_TYPE_B) {
-                    s->time_base       = s->last_time_base;
-                    s->last_non_b_time = s->time - s->pp_time;
-                }
-                for (i = 0; i < context_count; i++) {
-                    PutBitContext *pb = &s->thread_context[i]->pb;
-                    init_put_bits(pb, pb->buf, pb->buf_end - pb->buf);
-                }
-                goto vbv_retry;
-            }
-
-            assert(s->avctx->rc_max_rate);
-        }
-
-        if (s->flags & CODEC_FLAG_PASS1)
-            ff_write_pass1_stats(s);
-
-        for (i = 0; i < 4; i++) {
-            s->current_picture_ptr->f.error[i] = s->current_picture.f.error[i];
-            avctx->error[i] += s->current_picture_ptr->f.error[i];
-        }
-
-        if (s->flags & CODEC_FLAG_PASS1)
-            assert(avctx->header_bits + avctx->mv_bits + avctx->misc_bits +
-                   avctx->i_tex_bits + avctx->p_tex_bits ==
-                       put_bits_count(&s->pb));
-        flush_put_bits(&s->pb);
-        s->frame_bits  = put_bits_count(&s->pb);
-
-        stuffing_count = ff_vbv_update(s, s->frame_bits);
-        if (stuffing_count) {
-            if (s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb) >> 3) <
-                    stuffing_count + 50) {
-                av_log(s->avctx, AV_LOG_ERROR, "stuffing too large\n");
-                return -1;
-            }
-
-            switch (s->codec_id) {
-            case AV_CODEC_ID_MPEG1VIDEO:
-            case AV_CODEC_ID_MPEG2VIDEO:
-                while (stuffing_count--) {
-                    put_bits(&s->pb, 8, 0);
-                }
-            break;
-            case AV_CODEC_ID_MPEG4:
-                put_bits(&s->pb, 16, 0);
-                put_bits(&s->pb, 16, 0x1C3);
-                stuffing_count -= 4;
-                while (stuffing_count--) {
-                    put_bits(&s->pb, 8, 0xFF);
-                }
-            break;
-            default:
-                av_log(s->avctx, AV_LOG_ERROR, "vbv buffer overflow\n");
-            }
-            flush_put_bits(&s->pb);
-            s->frame_bits  = put_bits_count(&s->pb);
-        }
-
-        /* update mpeg1/2 vbv_delay for CBR */
-        if (s->avctx->rc_max_rate                          &&
-            s->avctx->rc_min_rate == s->avctx->rc_max_rate &&
-            s->out_format == FMT_MPEG1                     &&
-            90000LL * (avctx->rc_buffer_size - 1) <=
-                s->avctx->rc_max_rate * 0xFFFFLL) {
-            int vbv_delay, min_delay;
-            double inbits  = s->avctx->rc_max_rate *
-                             av_q2d(s->avctx->time_base);
-            int    minbits = s->frame_bits - 8 *
-                             (s->vbv_delay_ptr - s->pb.buf - 1);
-            double bits    = s->rc_context.buffer_index + minbits - inbits;
-
-            if (bits < 0)
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "Internal error, negative bits\n");
-
-            assert(s->repeat_first_field == 0);
-
-            vbv_delay = bits * 90000 / s->avctx->rc_max_rate;
-            min_delay = (minbits * 90000LL + s->avctx->rc_max_rate - 1) /
-                        s->avctx->rc_max_rate;
-
-            vbv_delay = FFMAX(vbv_delay, min_delay);
-
-            assert(vbv_delay < 0xFFFF);
-
-            s->vbv_delay_ptr[0] &= 0xF8;
-            s->vbv_delay_ptr[0] |= vbv_delay >> 13;
-            s->vbv_delay_ptr[1]  = vbv_delay >> 5;
-            s->vbv_delay_ptr[2] &= 0x07;
-            s->vbv_delay_ptr[2] |= vbv_delay << 3;
-            avctx->vbv_delay     = vbv_delay * 300;
-        }
-        s->total_bits     += s->frame_bits;
-        avctx->frame_bits  = s->frame_bits;
-
-        pkt->pts = s->current_picture.f.pts;
-        if (!s->low_delay) {
-            if (!s->current_picture.f.coded_picture_number)
-                pkt->dts = pkt->pts - s->dts_delta;
-            else
-                pkt->dts = s->reordered_pts;
-            s->reordered_pts = s->input_picture[0]->f.pts;
-        } else
-            pkt->dts = pkt->pts;
-        if (s->current_picture.f.key_frame)
-            pkt->flags |= AV_PKT_FLAG_KEY;
-        if (s->mb_info)
-            av_packet_shrink_side_data(pkt, AV_PKT_DATA_H263_MB_INFO, s->mb_info_size);
-    } else {
-        s->frame_bits = 0;
-    }
-    assert((s->frame_bits & 7) == 0);
-
-    pkt->size = s->frame_bits / 8;
-    *got_packet = !!pkt->size;
-    return 0;
-}
-
-static inline void dct_single_coeff_elimination(MpegEncContext *s,
-                                                int n, int threshold)
-{
-    static const char tab[64] = {
-        3, 2, 2, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 1, 1, 1,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0
-    };
-    int score = 0;
-    int run = 0;
-    int i;
-    int16_t *block = s->block[n];
-    const int last_index = s->block_last_index[n];
-    int skip_dc;
-
-    if (threshold < 0) {
-        skip_dc = 0;
-        threshold = -threshold;
-    } else
-        skip_dc = 1;
-
-    /* Are all we could set to zero already zero? */
-    if (last_index <= skip_dc - 1)
-        return;
-
-    for (i = 0; i <= last_index; i++) {
-        const int j = s->intra_scantable.permutated[i];
-        const int level = FFABS(block[j]);
-        if (level == 1) {
-            if (skip_dc && i == 0)
-                continue;
-            score += tab[run];
-            run = 0;
-        } else if (level > 1) {
-            return;
-        } else {
-            run++;
-        }
-    }
-    if (score >= threshold)
-        return;
-    for (i = skip_dc; i <= last_index; i++) {
-        const int j = s->intra_scantable.permutated[i];
-        block[j] = 0;
-    }
-    if (block[0])
-        s->block_last_index[n] = 0;
-    else
-        s->block_last_index[n] = -1;
-}
-
-static inline void clip_coeffs(MpegEncContext *s, int16_t *block,
-                               int last_index)
-{
-    int i;
-    const int maxlevel = s->max_qcoeff;
-    const int minlevel = s->min_qcoeff;
-    int overflow = 0;
-
-    if (s->mb_intra) {
-        i = 1; // skip clipping of intra dc
-    } else
-        i = 0;
-
-    for (; i <= last_index; i++) {
-        const int j = s->intra_scantable.permutated[i];
-        int level = block[j];
-
-        if (level > maxlevel) {
-            level = maxlevel;
-            overflow++;
-        } else if (level < minlevel) {
-            level = minlevel;
-            overflow++;
-        }
-
-        block[j] = level;
-    }
-
-    if (overflow && s->avctx->mb_decision == FF_MB_DECISION_SIMPLE)
-        av_log(s->avctx, AV_LOG_INFO,
-               "warning, clipping %d dct coefficients to %d..%d\n",
-               overflow, minlevel, maxlevel);
-}
-
-static void get_visual_weight(int16_t *weight, uint8_t *ptr, int stride)
-{
-    int x, y;
-    // FIXME optimize
-    for (y = 0; y < 8; y++) {
-        for (x = 0; x < 8; x++) {
-            int x2, y2;
-            int sum = 0;
-            int sqr = 0;
-            int count = 0;
-
-            for (y2 = FFMAX(y - 1, 0); y2 < FFMIN(8, y + 2); y2++) {
-                for (x2= FFMAX(x - 1, 0); x2 < FFMIN(8, x + 2); x2++) {
-                    int v = ptr[x2 + y2 * stride];
-                    sum += v;
-                    sqr += v * v;
-                    count++;
-                }
-            }
-            weight[x + 8 * y]= (36 * ff_sqrt(count * sqr - sum * sum)) / count;
-        }
-    }
-}
-
-static av_always_inline void encode_mb_internal(MpegEncContext *s,
-                                                int motion_x, int motion_y,
-                                                int mb_block_height,
-                                                int mb_block_count)
-{
-    int16_t weight[8][64];
-    int16_t orig[8][64];
-    const int mb_x = s->mb_x;
-    const int mb_y = s->mb_y;
-    int i;
-    int skip_dct[8];
-    int dct_offset = s->linesize * 8; // default for progressive frames
-    uint8_t *ptr_y, *ptr_cb, *ptr_cr;
-    ptrdiff_t wrap_y, wrap_c;
-
-    for (i = 0; i < mb_block_count; i++)
-        skip_dct[i] = s->skipdct;
-
-    if (s->adaptive_quant) {
-        const int last_qp = s->qscale;
-        const int mb_xy = mb_x + mb_y * s->mb_stride;
-
-        s->lambda = s->lambda_table[mb_xy];
-        update_qscale(s);
-
-        if (!(s->mpv_flags & FF_MPV_FLAG_QP_RD)) {
-            s->qscale = s->current_picture_ptr->qscale_table[mb_xy];
-            s->dquant = s->qscale - last_qp;
-
-            if (s->out_format == FMT_H263) {
-                s->dquant = av_clip(s->dquant, -2, 2);
-
-                if (s->codec_id == AV_CODEC_ID_MPEG4) {
-                    if (!s->mb_intra) {
-                        if (s->pict_type == AV_PICTURE_TYPE_B) {
-                            if (s->dquant & 1 || s->mv_dir & MV_DIRECT)
-                                s->dquant = 0;
-                        }
-                        if (s->mv_type == MV_TYPE_8X8)
-                            s->dquant = 0;
-                    }
-                }
-            }
-        }
-        ff_set_qscale(s, last_qp + s->dquant);
-    } else if (s->mpv_flags & FF_MPV_FLAG_QP_RD)
-        ff_set_qscale(s, s->qscale + s->dquant);
-
-    wrap_y = s->linesize;
-    wrap_c = s->uvlinesize;
-    ptr_y  = s->new_picture.f.data[0] +
-             (mb_y * 16 * wrap_y)              + mb_x * 16;
-    ptr_cb = s->new_picture.f.data[1] +
-             (mb_y * mb_block_height * wrap_c) + mb_x * 8;
-    ptr_cr = s->new_picture.f.data[2] +
-             (mb_y * mb_block_height * wrap_c) + mb_x * 8;
-
-    if (mb_x * 16 + 16 > s->width || mb_y * 16 + 16 > s->height) {
-        uint8_t *ebuf = s->edge_emu_buffer + 32;
-        s->vdsp.emulated_edge_mc(ebuf, ptr_y,
-                                 wrap_y, wrap_y,
-                                 16, 16, mb_x * 16, mb_y * 16,
-                                 s->width, s->height);
-        ptr_y = ebuf;
-        s->vdsp.emulated_edge_mc(ebuf + 18 * wrap_y, ptr_cb,
-                                 wrap_c, wrap_c,
-                                 8, mb_block_height, mb_x * 8, mb_y * 8,
-                                 s->width >> 1, s->height >> 1);
-        ptr_cb = ebuf + 18 * wrap_y;
-        s->vdsp.emulated_edge_mc(ebuf + 18 * wrap_y + 8, ptr_cr,
-                                 wrap_c, wrap_c,
-                                 8, mb_block_height, mb_x * 8, mb_y * 8,
-                                 s->width >> 1, s->height >> 1);
-        ptr_cr = ebuf + 18 * wrap_y + 8;
-    }
-
-    if (s->mb_intra) {
-        if (s->flags & CODEC_FLAG_INTERLACED_DCT) {
-            int progressive_score, interlaced_score;
-
-            s->interlaced_dct = 0;
-            progressive_score = s->dsp.ildct_cmp[4](s, ptr_y,
-                                                    NULL, wrap_y, 8) +
-                                s->dsp.ildct_cmp[4](s, ptr_y + wrap_y * 8,
-                                                    NULL, wrap_y, 8) - 400;
-
-            if (progressive_score > 0) {
-                interlaced_score = s->dsp.ildct_cmp[4](s, ptr_y,
-                                                       NULL, wrap_y * 2, 8) +
-                                   s->dsp.ildct_cmp[4](s, ptr_y + wrap_y,
-                                                       NULL, wrap_y * 2, 8);
-                if (progressive_score > interlaced_score) {
-                    s->interlaced_dct = 1;
-
-                    dct_offset = wrap_y;
-                    wrap_y <<= 1;
-                    if (s->chroma_format == CHROMA_422)
-                        wrap_c <<= 1;
-                }
-            }
-        }
-
-        s->dsp.get_pixels(s->block[0], ptr_y                  , wrap_y);
-        s->dsp.get_pixels(s->block[1], ptr_y              + 8 , wrap_y);
-        s->dsp.get_pixels(s->block[2], ptr_y + dct_offset     , wrap_y);
-        s->dsp.get_pixels(s->block[3], ptr_y + dct_offset + 8 , wrap_y);
-
-        if (s->flags & CODEC_FLAG_GRAY) {
-            skip_dct[4] = 1;
-            skip_dct[5] = 1;
-        } else {
-            s->dsp.get_pixels(s->block[4], ptr_cb, wrap_c);
-            s->dsp.get_pixels(s->block[5], ptr_cr, wrap_c);
-            if (!s->chroma_y_shift) { /* 422 */
-                s->dsp.get_pixels(s->block[6],
-                                  ptr_cb + (dct_offset >> 1), wrap_c);
-                s->dsp.get_pixels(s->block[7],
-                                  ptr_cr + (dct_offset >> 1), wrap_c);
-            }
-        }
-    } else {
-        op_pixels_func (*op_pix)[4];
-        qpel_mc_func (*op_qpix)[16];
-        uint8_t *dest_y, *dest_cb, *dest_cr;
-
-        dest_y  = s->dest[0];
-        dest_cb = s->dest[1];
-        dest_cr = s->dest[2];
-
-        if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) {
-            op_pix  = s->hdsp.put_pixels_tab;
-            op_qpix = s->dsp.put_qpel_pixels_tab;
-        } else {
-            op_pix  = s->hdsp.put_no_rnd_pixels_tab;
-            op_qpix = s->dsp.put_no_rnd_qpel_pixels_tab;
-        }
-
-        if (s->mv_dir & MV_DIR_FORWARD) {
-            ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 0,
-                          s->last_picture.f.data,
-                          op_pix, op_qpix);
-            op_pix  = s->hdsp.avg_pixels_tab;
-            op_qpix = s->dsp.avg_qpel_pixels_tab;
-        }
-        if (s->mv_dir & MV_DIR_BACKWARD) {
-            ff_MPV_motion(s, dest_y, dest_cb, dest_cr, 1,
-                          s->next_picture.f.data,
-                          op_pix, op_qpix);
-        }
-
-        if (s->flags & CODEC_FLAG_INTERLACED_DCT) {
-            int progressive_score, interlaced_score;
-
-            s->interlaced_dct = 0;
-            progressive_score = s->dsp.ildct_cmp[0](s, dest_y,
-                                                    ptr_y,              wrap_y,
-                                                    8) +
-                                s->dsp.ildct_cmp[0](s, dest_y + wrap_y * 8,
-                                                    ptr_y + wrap_y * 8, wrap_y,
-                                                    8) - 400;
-
-            if (s->avctx->ildct_cmp == FF_CMP_VSSE)
-                progressive_score -= 400;
-
-            if (progressive_score > 0) {
-                interlaced_score = s->dsp.ildct_cmp[0](s, dest_y,
-                                                       ptr_y,
-                                                       wrap_y * 2, 8) +
-                                   s->dsp.ildct_cmp[0](s, dest_y + wrap_y,
-                                                       ptr_y + wrap_y,
-                                                       wrap_y * 2, 8);
-
-                if (progressive_score > interlaced_score) {
-                    s->interlaced_dct = 1;
-
-                    dct_offset = wrap_y;
-                    wrap_y <<= 1;
-                    if (s->chroma_format == CHROMA_422)
-                        wrap_c <<= 1;
-                }
-            }
-        }
-
-        s->dsp.diff_pixels(s->block[0], ptr_y, dest_y, wrap_y);
-        s->dsp.diff_pixels(s->block[1], ptr_y + 8, dest_y + 8, wrap_y);
-        s->dsp.diff_pixels(s->block[2], ptr_y + dct_offset,
-                           dest_y + dct_offset, wrap_y);
-        s->dsp.diff_pixels(s->block[3], ptr_y + dct_offset + 8,
-                           dest_y + dct_offset + 8, wrap_y);
-
-        if (s->flags & CODEC_FLAG_GRAY) {
-            skip_dct[4] = 1;
-            skip_dct[5] = 1;
-        } else {
-            s->dsp.diff_pixels(s->block[4], ptr_cb, dest_cb, wrap_c);
-            s->dsp.diff_pixels(s->block[5], ptr_cr, dest_cr, wrap_c);
-            if (!s->chroma_y_shift) { /* 422 */
-                s->dsp.diff_pixels(s->block[6], ptr_cb + (dct_offset >> 1),
-                                   dest_cb + (dct_offset >> 1), wrap_c);
-                s->dsp.diff_pixels(s->block[7], ptr_cr + (dct_offset >> 1),
-                                   dest_cr + (dct_offset >> 1), wrap_c);
-            }
-        }
-        /* pre quantization */
-        if (s->current_picture.mc_mb_var[s->mb_stride * mb_y + mb_x] <
-                2 * s->qscale * s->qscale) {
-            // FIXME optimize
-            if (s->dsp.sad[1](NULL, ptr_y , dest_y,
-                              wrap_y, 8) < 20 * s->qscale)
-                skip_dct[0] = 1;
-            if (s->dsp.sad[1](NULL, ptr_y + 8,
-                              dest_y + 8, wrap_y, 8) < 20 * s->qscale)
-                skip_dct[1] = 1;
-            if (s->dsp.sad[1](NULL, ptr_y + dct_offset,
-                              dest_y + dct_offset, wrap_y, 8) < 20 * s->qscale)
-                skip_dct[2] = 1;
-            if (s->dsp.sad[1](NULL, ptr_y + dct_offset + 8,
-                              dest_y + dct_offset + 8,
-                              wrap_y, 8) < 20 * s->qscale)
-                skip_dct[3] = 1;
-            if (s->dsp.sad[1](NULL, ptr_cb, dest_cb,
-                              wrap_c, 8) < 20 * s->qscale)
-                skip_dct[4] = 1;
-            if (s->dsp.sad[1](NULL, ptr_cr, dest_cr,
-                              wrap_c, 8) < 20 * s->qscale)
-                skip_dct[5] = 1;
-            if (!s->chroma_y_shift) { /* 422 */
-                if (s->dsp.sad[1](NULL, ptr_cb + (dct_offset >> 1),
-                                  dest_cb + (dct_offset >> 1),
-                                  wrap_c, 8) < 20 * s->qscale)
-                    skip_dct[6] = 1;
-                if (s->dsp.sad[1](NULL, ptr_cr + (dct_offset >> 1),
-                                  dest_cr + (dct_offset >> 1),
-                                  wrap_c, 8) < 20 * s->qscale)
-                    skip_dct[7] = 1;
-            }
-        }
-    }
-
-    if (s->quantizer_noise_shaping) {
-        if (!skip_dct[0])
-            get_visual_weight(weight[0], ptr_y                 , wrap_y);
-        if (!skip_dct[1])
-            get_visual_weight(weight[1], ptr_y              + 8, wrap_y);
-        if (!skip_dct[2])
-            get_visual_weight(weight[2], ptr_y + dct_offset    , wrap_y);
-        if (!skip_dct[3])
-            get_visual_weight(weight[3], ptr_y + dct_offset + 8, wrap_y);
-        if (!skip_dct[4])
-            get_visual_weight(weight[4], ptr_cb                , wrap_c);
-        if (!skip_dct[5])
-            get_visual_weight(weight[5], ptr_cr                , wrap_c);
-        if (!s->chroma_y_shift) { /* 422 */
-            if (!skip_dct[6])
-                get_visual_weight(weight[6], ptr_cb + (dct_offset >> 1),
-                                  wrap_c);
-            if (!skip_dct[7])
-                get_visual_weight(weight[7], ptr_cr + (dct_offset >> 1),
-                                  wrap_c);
-        }
-        memcpy(orig[0], s->block[0], sizeof(int16_t) * 64 * mb_block_count);
-    }
-
-    /* DCT & quantize */
-    assert(s->out_format != FMT_MJPEG || s->qscale == 8);
-    {
-        for (i = 0; i < mb_block_count; i++) {
-            if (!skip_dct[i]) {
-                int overflow;
-                s->block_last_index[i] = s->dct_quantize(s, s->block[i], i, s->qscale, &overflow);
-                // FIXME we could decide to change to quantizer instead of
-                // clipping
-                // JS: I don't think that would be a good idea it could lower
-                //     quality instead of improve it. Just INTRADC clipping
-                //     deserves changes in quantizer
-                if (overflow)
-                    clip_coeffs(s, s->block[i], s->block_last_index[i]);
-            } else
-                s->block_last_index[i] = -1;
-        }
-        if (s->quantizer_noise_shaping) {
-            for (i = 0; i < mb_block_count; i++) {
-                if (!skip_dct[i]) {
-                    s->block_last_index[i] =
-                        dct_quantize_refine(s, s->block[i], weight[i],
-                                            orig[i], i, s->qscale);
-                }
-            }
-        }
-
-        if (s->luma_elim_threshold && !s->mb_intra)
-            for (i = 0; i < 4; i++)
-                dct_single_coeff_elimination(s, i, s->luma_elim_threshold);
-        if (s->chroma_elim_threshold && !s->mb_intra)
-            for (i = 4; i < mb_block_count; i++)
-                dct_single_coeff_elimination(s, i, s->chroma_elim_threshold);
-
-        if (s->mpv_flags & FF_MPV_FLAG_CBP_RD) {
-            for (i = 0; i < mb_block_count; i++) {
-                if (s->block_last_index[i] == -1)
-                    s->coded_score[i] = INT_MAX / 256;
-            }
-        }
-    }
-
-    if ((s->flags & CODEC_FLAG_GRAY) && s->mb_intra) {
-        s->block_last_index[4] =
-        s->block_last_index[5] = 0;
-        s->block[4][0] =
-        s->block[5][0] = (1024 + s->c_dc_scale / 2) / s->c_dc_scale;
-    }
-
-    // non c quantize code returns incorrect block_last_index FIXME
-    if (s->alternate_scan && s->dct_quantize != ff_dct_quantize_c) {
-        for (i = 0; i < mb_block_count; i++) {
-            int j;
-            if (s->block_last_index[i] > 0) {
-                for (j = 63; j > 0; j--) {
-                    if (s->block[i][s->intra_scantable.permutated[j]])
-                        break;
-                }
-                s->block_last_index[i] = j;
-            }
-        }
-    }
-
-    /* huffman encode */
-    switch(s->codec_id){ //FIXME funct ptr could be slightly faster
-    case AV_CODEC_ID_MPEG1VIDEO:
-    case AV_CODEC_ID_MPEG2VIDEO:
-        if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
-            ff_mpeg1_encode_mb(s, s->block, motion_x, motion_y);
-        break;
-    case AV_CODEC_ID_MPEG4:
-        if (CONFIG_MPEG4_ENCODER)
-            ff_mpeg4_encode_mb(s, s->block, motion_x, motion_y);
-        break;
-    case AV_CODEC_ID_MSMPEG4V2:
-    case AV_CODEC_ID_MSMPEG4V3:
-    case AV_CODEC_ID_WMV1:
-        if (CONFIG_MSMPEG4_ENCODER)
-            ff_msmpeg4_encode_mb(s, s->block, motion_x, motion_y);
-        break;
-    case AV_CODEC_ID_WMV2:
-        if (CONFIG_WMV2_ENCODER)
-            ff_wmv2_encode_mb(s, s->block, motion_x, motion_y);
-        break;
-    case AV_CODEC_ID_H261:
-        if (CONFIG_H261_ENCODER)
-            ff_h261_encode_mb(s, s->block, motion_x, motion_y);
-        break;
-    case AV_CODEC_ID_H263:
-    case AV_CODEC_ID_H263P:
-    case AV_CODEC_ID_FLV1:
-    case AV_CODEC_ID_RV10:
-    case AV_CODEC_ID_RV20:
-        if (CONFIG_H263_ENCODER)
-            ff_h263_encode_mb(s, s->block, motion_x, motion_y);
-        break;
-    case AV_CODEC_ID_MJPEG:
-        if (CONFIG_MJPEG_ENCODER)
-            ff_mjpeg_encode_mb(s, s->block);
-        break;
-    default:
-        assert(0);
-    }
-}
-
-static av_always_inline void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
-{
-    if (s->chroma_format == CHROMA_420) encode_mb_internal(s, motion_x, motion_y,  8, 6);
-    else                                encode_mb_internal(s, motion_x, motion_y, 16, 8);
-}
-
-static inline void copy_context_before_encode(MpegEncContext *d, MpegEncContext *s, int type){
-    int i;
-
-    memcpy(d->last_mv, s->last_mv, 2*2*2*sizeof(int)); //FIXME is memcpy faster than a loop?
-
-    /* mpeg1 */
-    d->mb_skip_run= s->mb_skip_run;
-    for(i=0; i<3; i++)
-        d->last_dc[i] = s->last_dc[i];
-
-    /* statistics */
-    d->mv_bits= s->mv_bits;
-    d->i_tex_bits= s->i_tex_bits;
-    d->p_tex_bits= s->p_tex_bits;
-    d->i_count= s->i_count;
-    d->f_count= s->f_count;
-    d->b_count= s->b_count;
-    d->skip_count= s->skip_count;
-    d->misc_bits= s->misc_bits;
-    d->last_bits= 0;
-
-    d->mb_skipped= 0;
-    d->qscale= s->qscale;
-    d->dquant= s->dquant;
-
-    d->esc3_level_length= s->esc3_level_length;
-}
-
-static inline void copy_context_after_encode(MpegEncContext *d, MpegEncContext *s, int type){
-    int i;
-
-    memcpy(d->mv, s->mv, 2*4*2*sizeof(int));
-    memcpy(d->last_mv, s->last_mv, 2*2*2*sizeof(int)); //FIXME is memcpy faster than a loop?
-
-    /* mpeg1 */
-    d->mb_skip_run= s->mb_skip_run;
-    for(i=0; i<3; i++)
-        d->last_dc[i] = s->last_dc[i];
-
-    /* statistics */
-    d->mv_bits= s->mv_bits;
-    d->i_tex_bits= s->i_tex_bits;
-    d->p_tex_bits= s->p_tex_bits;
-    d->i_count= s->i_count;
-    d->f_count= s->f_count;
-    d->b_count= s->b_count;
-    d->skip_count= s->skip_count;
-    d->misc_bits= s->misc_bits;
-
-    d->mb_intra= s->mb_intra;
-    d->mb_skipped= s->mb_skipped;
-    d->mv_type= s->mv_type;
-    d->mv_dir= s->mv_dir;
-    d->pb= s->pb;
-    if(s->data_partitioning){
-        d->pb2= s->pb2;
-        d->tex_pb= s->tex_pb;
-    }
-    d->block= s->block;
-    for(i=0; i<8; i++)
-        d->block_last_index[i]= s->block_last_index[i];
-    d->interlaced_dct= s->interlaced_dct;
-    d->qscale= s->qscale;
-
-    d->esc3_level_length= s->esc3_level_length;
-}
-
-static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegEncContext *best, int type,
-                           PutBitContext pb[2], PutBitContext pb2[2], PutBitContext tex_pb[2],
-                           int *dmin, int *next_block, int motion_x, int motion_y)
-{
-    int score;
-    uint8_t *dest_backup[3];
-
-    copy_context_before_encode(s, backup, type);
-
-    s->block= s->blocks[*next_block];
-    s->pb= pb[*next_block];
-    if(s->data_partitioning){
-        s->pb2   = pb2   [*next_block];
-        s->tex_pb= tex_pb[*next_block];
-    }
-
-    if(*next_block){
-        memcpy(dest_backup, s->dest, sizeof(s->dest));
-        s->dest[0] = s->rd_scratchpad;
-        s->dest[1] = s->rd_scratchpad + 16*s->linesize;
-        s->dest[2] = s->rd_scratchpad + 16*s->linesize + 8;
-        assert(s->linesize >= 32); //FIXME
-    }
-
-    encode_mb(s, motion_x, motion_y);
-
-    score= put_bits_count(&s->pb);
-    if(s->data_partitioning){
-        score+= put_bits_count(&s->pb2);
-        score+= put_bits_count(&s->tex_pb);
-    }
-
-    if(s->avctx->mb_decision == FF_MB_DECISION_RD){
-        ff_MPV_decode_mb(s, s->block);
-
-        score *= s->lambda2;
-        score += sse_mb(s) << FF_LAMBDA_SHIFT;
-    }
-
-    if(*next_block){
-        memcpy(s->dest, dest_backup, sizeof(s->dest));
-    }
-
-    if(score<*dmin){
-        *dmin= score;
-        *next_block^=1;
-
-        copy_context_after_encode(best, s, type);
-    }
-}
-
-static int sse(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int w, int h, int stride){
-    uint32_t *sq = ff_squareTbl + 256;
-    int acc=0;
-    int x,y;
-
-    if(w==16 && h==16)
-        return s->dsp.sse[0](NULL, src1, src2, stride, 16);
-    else if(w==8 && h==8)
-        return s->dsp.sse[1](NULL, src1, src2, stride, 8);
-
-    for(y=0; y<h; y++){
-        for(x=0; x<w; x++){
-            acc+= sq[src1[x + y*stride] - src2[x + y*stride]];
-        }
-    }
-
-    assert(acc>=0);
-
-    return acc;
-}
-
-static int sse_mb(MpegEncContext *s){
-    int w= 16;
-    int h= 16;
-
-    if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16;
-    if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16;
-
-    if(w==16 && h==16)
-      if(s->avctx->mb_cmp == FF_CMP_NSSE){
-        return  s->dsp.nsse[0](s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
-               +s->dsp.nsse[1](s, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
-               +s->dsp.nsse[1](s, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
-      }else{
-        return  s->dsp.sse[0](NULL, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
-               +s->dsp.sse[1](NULL, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
-               +s->dsp.sse[1](NULL, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
-      }
-    else
-        return  sse(s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], w, h, s->linesize)
-               +sse(s, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], w>>1, h>>1, s->uvlinesize)
-               +sse(s, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], w>>1, h>>1, s->uvlinesize);
-}
-
-static int pre_estimate_motion_thread(AVCodecContext *c, void *arg){
-    MpegEncContext *s= *(void**)arg;
-
-
-    s->me.pre_pass=1;
-    s->me.dia_size= s->avctx->pre_dia_size;
-    s->first_slice_line=1;
-    for(s->mb_y= s->end_mb_y-1; s->mb_y >= s->start_mb_y; s->mb_y--) {
-        for(s->mb_x=s->mb_width-1; s->mb_x >=0 ;s->mb_x--) {
-            ff_pre_estimate_p_frame_motion(s, s->mb_x, s->mb_y);
-        }
-        s->first_slice_line=0;
-    }
-
-    s->me.pre_pass=0;
-
-    return 0;
-}
-
-static int estimate_motion_thread(AVCodecContext *c, void *arg){
-    MpegEncContext *s= *(void**)arg;
-
-    ff_check_alignment();
-
-    s->me.dia_size= s->avctx->dia_size;
-    s->first_slice_line=1;
-    for(s->mb_y= s->start_mb_y; s->mb_y < s->end_mb_y; s->mb_y++) {
-        s->mb_x=0; //for block init below
-        ff_init_block_index(s);
-        for(s->mb_x=0; s->mb_x < s->mb_width; s->mb_x++) {
-            s->block_index[0]+=2;
-            s->block_index[1]+=2;
-            s->block_index[2]+=2;
-            s->block_index[3]+=2;
-
-            /* compute motion vector & mb_type and store in context */
-            if(s->pict_type==AV_PICTURE_TYPE_B)
-                ff_estimate_b_frame_motion(s, s->mb_x, s->mb_y);
-            else
-                ff_estimate_p_frame_motion(s, s->mb_x, s->mb_y);
-        }
-        s->first_slice_line=0;
-    }
-    return 0;
-}
-
-static int mb_var_thread(AVCodecContext *c, void *arg){
-    MpegEncContext *s= *(void**)arg;
-    int mb_x, mb_y;
-
-    ff_check_alignment();
-
-    for(mb_y=s->start_mb_y; mb_y < s->end_mb_y; mb_y++) {
-        for(mb_x=0; mb_x < s->mb_width; mb_x++) {
-            int xx = mb_x * 16;
-            int yy = mb_y * 16;
-            uint8_t *pix = s->new_picture.f.data[0] + (yy * s->linesize) + xx;
-            int varc;
-            int sum = s->dsp.pix_sum(pix, s->linesize);
-
-            varc = (s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)sum*sum)>>8) + 500 + 128)>>8;
-
-            s->current_picture.mb_var [s->mb_stride * mb_y + mb_x] = varc;
-            s->current_picture.mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
-            s->me.mb_var_sum_temp    += varc;
-        }
-    }
-    return 0;
-}
-
-static void write_slice_end(MpegEncContext *s){
-    if(CONFIG_MPEG4_ENCODER && s->codec_id==AV_CODEC_ID_MPEG4){
-        if(s->partitioned_frame){
-            ff_mpeg4_merge_partitions(s);
-        }
-
-        ff_mpeg4_stuffing(&s->pb);
-    }else if(CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG){
-        ff_mjpeg_encode_stuffing(&s->pb);
-    }
-
-    avpriv_align_put_bits(&s->pb);
-    flush_put_bits(&s->pb);
-
-    if((s->flags&CODEC_FLAG_PASS1) && !s->partitioned_frame)
-        s->misc_bits+= get_bits_diff(s);
-}
-
-static void write_mb_info(MpegEncContext *s)
-{
-    uint8_t *ptr = s->mb_info_ptr + s->mb_info_size - 12;
-    int offset = put_bits_count(&s->pb);
-    int mba  = s->mb_x + s->mb_width * (s->mb_y % s->gob_index);
-    int gobn = s->mb_y / s->gob_index;
-    int pred_x, pred_y;
-    if (CONFIG_H263_ENCODER)
-        ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-    bytestream_put_le32(&ptr, offset);
-    bytestream_put_byte(&ptr, s->qscale);
-    bytestream_put_byte(&ptr, gobn);
-    bytestream_put_le16(&ptr, mba);
-    bytestream_put_byte(&ptr, pred_x); /* hmv1 */
-    bytestream_put_byte(&ptr, pred_y); /* vmv1 */
-    /* 4MV not implemented */
-    bytestream_put_byte(&ptr, 0); /* hmv2 */
-    bytestream_put_byte(&ptr, 0); /* vmv2 */
-}
-
-static void update_mb_info(MpegEncContext *s, int startcode)
-{
-    if (!s->mb_info)
-        return;
-    if (put_bits_count(&s->pb) - s->prev_mb_info*8 >= s->mb_info*8) {
-        s->mb_info_size += 12;
-        s->prev_mb_info = s->last_mb_info;
-    }
-    if (startcode) {
-        s->prev_mb_info = put_bits_count(&s->pb)/8;
-        /* This might have incremented mb_info_size above, and we return without
-         * actually writing any info into that slot yet. But in that case,
-         * this will be called again at the start of the after writing the
-         * start code, actually writing the mb info. */
-        return;
-    }
-
-    s->last_mb_info = put_bits_count(&s->pb)/8;
-    if (!s->mb_info_size)
-        s->mb_info_size += 12;
-    write_mb_info(s);
-}
-
-static int encode_thread(AVCodecContext *c, void *arg){
-    MpegEncContext *s= *(void**)arg;
-    int mb_x, mb_y, pdif = 0;
-    int chr_h= 16>>s->chroma_y_shift;
-    int i, j;
-    MpegEncContext best_s, backup_s;
-    uint8_t bit_buf[2][MAX_MB_BYTES];
-    uint8_t bit_buf2[2][MAX_MB_BYTES];
-    uint8_t bit_buf_tex[2][MAX_MB_BYTES];
-    PutBitContext pb[2], pb2[2], tex_pb[2];
-
-    ff_check_alignment();
-
-    for(i=0; i<2; i++){
-        init_put_bits(&pb    [i], bit_buf    [i], MAX_MB_BYTES);
-        init_put_bits(&pb2   [i], bit_buf2   [i], MAX_MB_BYTES);
-        init_put_bits(&tex_pb[i], bit_buf_tex[i], MAX_MB_BYTES);
-    }
-
-    s->last_bits= put_bits_count(&s->pb);
-    s->mv_bits=0;
-    s->misc_bits=0;
-    s->i_tex_bits=0;
-    s->p_tex_bits=0;
-    s->i_count=0;
-    s->f_count=0;
-    s->b_count=0;
-    s->skip_count=0;
-
-    for(i=0; i<3; i++){
-        /* init last dc values */
-        /* note: quant matrix value (8) is implied here */
-        s->last_dc[i] = 128 << s->intra_dc_precision;
-
-        s->current_picture.f.error[i] = 0;
-    }
-    s->mb_skip_run = 0;
-    memset(s->last_mv, 0, sizeof(s->last_mv));
-
-    s->last_mv_dir = 0;
-
-    switch(s->codec_id){
-    case AV_CODEC_ID_H263:
-    case AV_CODEC_ID_H263P:
-    case AV_CODEC_ID_FLV1:
-        if (CONFIG_H263_ENCODER)
-            s->gob_index = ff_h263_get_gob_height(s);
-        break;
-    case AV_CODEC_ID_MPEG4:
-        if(CONFIG_MPEG4_ENCODER && s->partitioned_frame)
-            ff_mpeg4_init_partitions(s);
-        break;
-    }
-
-    s->resync_mb_x=0;
-    s->resync_mb_y=0;
-    s->first_slice_line = 1;
-    s->ptr_lastgob = s->pb.buf;
-    for(mb_y= s->start_mb_y; mb_y < s->end_mb_y; mb_y++) {
-        s->mb_x=0;
-        s->mb_y= mb_y;
-
-        ff_set_qscale(s, s->qscale);
-        ff_init_block_index(s);
-
-        for(mb_x=0; mb_x < s->mb_width; mb_x++) {
-            int xy= mb_y*s->mb_stride + mb_x; // removed const, H261 needs to adjust this
-            int mb_type= s->mb_type[xy];
-//            int d;
-            int dmin= INT_MAX;
-            int dir;
-
-            if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < MAX_MB_BYTES){
-                av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
-                return -1;
-            }
-            if(s->data_partitioning){
-                if(   s->pb2   .buf_end - s->pb2   .buf - (put_bits_count(&s->    pb2)>>3) < MAX_MB_BYTES
-                   || s->tex_pb.buf_end - s->tex_pb.buf - (put_bits_count(&s->tex_pb )>>3) < MAX_MB_BYTES){
-                    av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
-                    return -1;
-                }
-            }
-
-            s->mb_x = mb_x;
-            s->mb_y = mb_y;  // moved into loop, can get changed by H.261
-            ff_update_block_index(s);
-
-            if(CONFIG_H261_ENCODER && s->codec_id == AV_CODEC_ID_H261){
-                ff_h261_reorder_mb_index(s);
-                xy= s->mb_y*s->mb_stride + s->mb_x;
-                mb_type= s->mb_type[xy];
-            }
-
-            /* write gob / video packet header  */
-            if(s->rtp_mode){
-                int current_packet_size, is_gob_start;
-
-                current_packet_size= ((put_bits_count(&s->pb)+7)>>3) - (s->ptr_lastgob - s->pb.buf);
-
-                is_gob_start= s->avctx->rtp_payload_size && current_packet_size >= s->avctx->rtp_payload_size && mb_y + mb_x>0;
-
-                if(s->start_mb_y == mb_y && mb_y > 0 && mb_x==0) is_gob_start=1;
-
-                switch(s->codec_id){
-                case AV_CODEC_ID_H263:
-                case AV_CODEC_ID_H263P:
-                    if(!s->h263_slice_structured)
-                        if(s->mb_x || s->mb_y%s->gob_index) is_gob_start=0;
-                    break;
-                case AV_CODEC_ID_MPEG2VIDEO:
-                    if(s->mb_x==0 && s->mb_y!=0) is_gob_start=1;
-                case AV_CODEC_ID_MPEG1VIDEO:
-                    if(s->mb_skip_run) is_gob_start=0;
-                    break;
-                }
-
-                if(is_gob_start){
-                    if(s->start_mb_y != mb_y || mb_x!=0){
-                        write_slice_end(s);
-
-                        if(CONFIG_MPEG4_ENCODER && s->codec_id==AV_CODEC_ID_MPEG4 && s->partitioned_frame){
-                            ff_mpeg4_init_partitions(s);
-                        }
-                    }
-
-                    assert((put_bits_count(&s->pb)&7) == 0);
-                    current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob;
-
-                    if (s->error_rate && s->resync_mb_x + s->resync_mb_y > 0) {
-                        int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
-                        int d = 100 / s->error_rate;
-                        if(r % d == 0){
-                            current_packet_size=0;
-                            s->pb.buf_ptr= s->ptr_lastgob;
-                            assert(put_bits_ptr(&s->pb) == s->ptr_lastgob);
-                        }
-                    }
-
-                    if (s->avctx->rtp_callback){
-                        int number_mb = (mb_y - s->resync_mb_y)*s->mb_width + mb_x - s->resync_mb_x;
-                        s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, current_packet_size, number_mb);
-                    }
-                    update_mb_info(s, 1);
-
-                    switch(s->codec_id){
-                    case AV_CODEC_ID_MPEG4:
-                        if (CONFIG_MPEG4_ENCODER) {
-                            ff_mpeg4_encode_video_packet_header(s);
-                            ff_mpeg4_clean_buffers(s);
-                        }
-                    break;
-                    case AV_CODEC_ID_MPEG1VIDEO:
-                    case AV_CODEC_ID_MPEG2VIDEO:
-                        if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) {
-                            ff_mpeg1_encode_slice_header(s);
-                            ff_mpeg1_clean_buffers(s);
-                        }
-                    break;
-                    case AV_CODEC_ID_H263:
-                    case AV_CODEC_ID_H263P:
-                        if (CONFIG_H263_ENCODER)
-                            ff_h263_encode_gob_header(s, mb_y);
-                    break;
-                    }
-
-                    if(s->flags&CODEC_FLAG_PASS1){
-                        int bits= put_bits_count(&s->pb);
-                        s->misc_bits+= bits - s->last_bits;
-                        s->last_bits= bits;
-                    }
-
-                    s->ptr_lastgob += current_packet_size;
-                    s->first_slice_line=1;
-                    s->resync_mb_x=mb_x;
-                    s->resync_mb_y=mb_y;
-                }
-            }
-
-            if(  (s->resync_mb_x   == s->mb_x)
-               && s->resync_mb_y+1 == s->mb_y){
-                s->first_slice_line=0;
-            }
-
-            s->mb_skipped=0;
-            s->dquant=0; //only for QP_RD
-
-            update_mb_info(s, 0);
-
-            if (mb_type & (mb_type-1) || (s->mpv_flags & FF_MPV_FLAG_QP_RD)) { // more than 1 MB type possible or FF_MPV_FLAG_QP_RD
-                int next_block=0;
-                int pb_bits_count, pb2_bits_count, tex_pb_bits_count;
-
-                copy_context_before_encode(&backup_s, s, -1);
-                backup_s.pb= s->pb;
-                best_s.data_partitioning= s->data_partitioning;
-                best_s.partitioned_frame= s->partitioned_frame;
-                if(s->data_partitioning){
-                    backup_s.pb2= s->pb2;
-                    backup_s.tex_pb= s->tex_pb;
-                }
-
-                if(mb_type&CANDIDATE_MB_TYPE_INTER){
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mv_type = MV_TYPE_16X16;
-                    s->mb_intra= 0;
-                    s->mv[0][0][0] = s->p_mv_table[xy][0];
-                    s->mv[0][0][1] = s->p_mv_table[xy][1];
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER, pb, pb2, tex_pb,
-                                 &dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_INTER_I){
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mv_type = MV_TYPE_FIELD;
-                    s->mb_intra= 0;
-                    for(i=0; i<2; i++){
-                        j= s->field_select[0][i] = s->p_field_select_table[i][xy];
-                        s->mv[0][i][0] = s->p_field_mv_table[i][j][xy][0];
-                        s->mv[0][i][1] = s->p_field_mv_table[i][j][xy][1];
-                    }
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER_I, pb, pb2, tex_pb,
-                                 &dmin, &next_block, 0, 0);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_SKIPPED){
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mv_type = MV_TYPE_16X16;
-                    s->mb_intra= 0;
-                    s->mv[0][0][0] = 0;
-                    s->mv[0][0][1] = 0;
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_SKIPPED, pb, pb2, tex_pb,
-                                 &dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_INTER4V){
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mv_type = MV_TYPE_8X8;
-                    s->mb_intra= 0;
-                    for(i=0; i<4; i++){
-                        s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0];
-                        s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1];
-                    }
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER4V, pb, pb2, tex_pb,
-                                 &dmin, &next_block, 0, 0);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_FORWARD){
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mv_type = MV_TYPE_16X16;
-                    s->mb_intra= 0;
-                    s->mv[0][0][0] = s->b_forw_mv_table[xy][0];
-                    s->mv[0][0][1] = s->b_forw_mv_table[xy][1];
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD, pb, pb2, tex_pb,
-                                 &dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_BACKWARD){
-                    s->mv_dir = MV_DIR_BACKWARD;
-                    s->mv_type = MV_TYPE_16X16;
-                    s->mb_intra= 0;
-                    s->mv[1][0][0] = s->b_back_mv_table[xy][0];
-                    s->mv[1][0][1] = s->b_back_mv_table[xy][1];
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD, pb, pb2, tex_pb,
-                                 &dmin, &next_block, s->mv[1][0][0], s->mv[1][0][1]);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_BIDIR){
-                    s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
-                    s->mv_type = MV_TYPE_16X16;
-                    s->mb_intra= 0;
-                    s->mv[0][0][0] = s->b_bidir_forw_mv_table[xy][0];
-                    s->mv[0][0][1] = s->b_bidir_forw_mv_table[xy][1];
-                    s->mv[1][0][0] = s->b_bidir_back_mv_table[xy][0];
-                    s->mv[1][0][1] = s->b_bidir_back_mv_table[xy][1];
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR, pb, pb2, tex_pb,
-                                 &dmin, &next_block, 0, 0);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_FORWARD_I){
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mv_type = MV_TYPE_FIELD;
-                    s->mb_intra= 0;
-                    for(i=0; i<2; i++){
-                        j= s->field_select[0][i] = s->b_field_select_table[0][i][xy];
-                        s->mv[0][i][0] = s->b_field_mv_table[0][i][j][xy][0];
-                        s->mv[0][i][1] = s->b_field_mv_table[0][i][j][xy][1];
-                    }
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD_I, pb, pb2, tex_pb,
-                                 &dmin, &next_block, 0, 0);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_BACKWARD_I){
-                    s->mv_dir = MV_DIR_BACKWARD;
-                    s->mv_type = MV_TYPE_FIELD;
-                    s->mb_intra= 0;
-                    for(i=0; i<2; i++){
-                        j= s->field_select[1][i] = s->b_field_select_table[1][i][xy];
-                        s->mv[1][i][0] = s->b_field_mv_table[1][i][j][xy][0];
-                        s->mv[1][i][1] = s->b_field_mv_table[1][i][j][xy][1];
-                    }
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD_I, pb, pb2, tex_pb,
-                                 &dmin, &next_block, 0, 0);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_BIDIR_I){
-                    s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
-                    s->mv_type = MV_TYPE_FIELD;
-                    s->mb_intra= 0;
-                    for(dir=0; dir<2; dir++){
-                        for(i=0; i<2; i++){
-                            j= s->field_select[dir][i] = s->b_field_select_table[dir][i][xy];
-                            s->mv[dir][i][0] = s->b_field_mv_table[dir][i][j][xy][0];
-                            s->mv[dir][i][1] = s->b_field_mv_table[dir][i][j][xy][1];
-                        }
-                    }
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR_I, pb, pb2, tex_pb,
-                                 &dmin, &next_block, 0, 0);
-                }
-                if(mb_type&CANDIDATE_MB_TYPE_INTRA){
-                    s->mv_dir = 0;
-                    s->mv_type = MV_TYPE_16X16;
-                    s->mb_intra= 1;
-                    s->mv[0][0][0] = 0;
-                    s->mv[0][0][1] = 0;
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTRA, pb, pb2, tex_pb,
-                                 &dmin, &next_block, 0, 0);
-                    if(s->h263_pred || s->h263_aic){
-                        if(best_s.mb_intra)
-                            s->mbintra_table[mb_x + mb_y*s->mb_stride]=1;
-                        else
-                            ff_clean_intra_table_entries(s); //old mode?
-                    }
-                }
-
-                if ((s->mpv_flags & FF_MPV_FLAG_QP_RD) && dmin < INT_MAX) {
-                    if(best_s.mv_type==MV_TYPE_16X16){ //FIXME move 4mv after QPRD
-                        const int last_qp= backup_s.qscale;
-                        int qpi, qp, dc[6];
-                        int16_t ac[6][16];
-                        const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0;
-                        static const int dquant_tab[4]={-1,1,-2,2};
-
-                        assert(backup_s.dquant == 0);
-
-                        //FIXME intra
-                        s->mv_dir= best_s.mv_dir;
-                        s->mv_type = MV_TYPE_16X16;
-                        s->mb_intra= best_s.mb_intra;
-                        s->mv[0][0][0] = best_s.mv[0][0][0];
-                        s->mv[0][0][1] = best_s.mv[0][0][1];
-                        s->mv[1][0][0] = best_s.mv[1][0][0];
-                        s->mv[1][0][1] = best_s.mv[1][0][1];
-
-                        qpi = s->pict_type == AV_PICTURE_TYPE_B ? 2 : 0;
-                        for(; qpi<4; qpi++){
-                            int dquant= dquant_tab[qpi];
-                            qp= last_qp + dquant;
-                            if(qp < s->avctx->qmin || qp > s->avctx->qmax)
-                                continue;
-                            backup_s.dquant= dquant;
-                            if(s->mb_intra && s->dc_val[0]){
-                                for(i=0; i<6; i++){
-                                    dc[i]= s->dc_val[0][ s->block_index[i] ];
-                                    memcpy(ac[i], s->ac_val[0][s->block_index[i]], sizeof(int16_t)*16);
-                                }
-                            }
-
-                            encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER /* wrong but unused */, pb, pb2, tex_pb,
-                                         &dmin, &next_block, s->mv[mvdir][0][0], s->mv[mvdir][0][1]);
-                            if(best_s.qscale != qp){
-                                if(s->mb_intra && s->dc_val[0]){
-                                    for(i=0; i<6; i++){
-                                        s->dc_val[0][ s->block_index[i] ]= dc[i];
-                                        memcpy(s->ac_val[0][s->block_index[i]], ac[i], sizeof(int16_t)*16);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-                if(CONFIG_MPEG4_ENCODER && mb_type&CANDIDATE_MB_TYPE_DIRECT){
-                    int mx= s->b_direct_mv_table[xy][0];
-                    int my= s->b_direct_mv_table[xy][1];
-
-                    backup_s.dquant = 0;
-                    s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
-                    s->mb_intra= 0;
-                    ff_mpeg4_set_direct_mv(s, mx, my);
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
-                                 &dmin, &next_block, mx, my);
-                }
-                if(CONFIG_MPEG4_ENCODER && mb_type&CANDIDATE_MB_TYPE_DIRECT0){
-                    backup_s.dquant = 0;
-                    s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
-                    s->mb_intra= 0;
-                    ff_mpeg4_set_direct_mv(s, 0, 0);
-                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
-                                 &dmin, &next_block, 0, 0);
-                }
-                if (!best_s.mb_intra && s->mpv_flags & FF_MPV_FLAG_SKIP_RD) {
-                    int coded=0;
-                    for(i=0; i<6; i++)
-                        coded |= s->block_last_index[i];
-                    if(coded){
-                        int mx,my;
-                        memcpy(s->mv, best_s.mv, sizeof(s->mv));
-                        if(CONFIG_MPEG4_ENCODER && best_s.mv_dir & MV_DIRECT){
-                            mx=my=0; //FIXME find the one we actually used
-                            ff_mpeg4_set_direct_mv(s, mx, my);
-                        }else if(best_s.mv_dir&MV_DIR_BACKWARD){
-                            mx= s->mv[1][0][0];
-                            my= s->mv[1][0][1];
-                        }else{
-                            mx= s->mv[0][0][0];
-                            my= s->mv[0][0][1];
-                        }
-
-                        s->mv_dir= best_s.mv_dir;
-                        s->mv_type = best_s.mv_type;
-                        s->mb_intra= 0;
-/*                        s->mv[0][0][0] = best_s.mv[0][0][0];
-                        s->mv[0][0][1] = best_s.mv[0][0][1];
-                        s->mv[1][0][0] = best_s.mv[1][0][0];
-                        s->mv[1][0][1] = best_s.mv[1][0][1];*/
-                        backup_s.dquant= 0;
-                        s->skipdct=1;
-                        encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER /* wrong but unused */, pb, pb2, tex_pb,
-                                        &dmin, &next_block, mx, my);
-                        s->skipdct=0;
-                    }
-                }
-
-                s->current_picture.qscale_table[xy] = best_s.qscale;
-
-                copy_context_after_encode(s, &best_s, -1);
-
-                pb_bits_count= put_bits_count(&s->pb);
-                flush_put_bits(&s->pb);
-                avpriv_copy_bits(&backup_s.pb, bit_buf[next_block^1], pb_bits_count);
-                s->pb= backup_s.pb;
-
-                if(s->data_partitioning){
-                    pb2_bits_count= put_bits_count(&s->pb2);
-                    flush_put_bits(&s->pb2);
-                    avpriv_copy_bits(&backup_s.pb2, bit_buf2[next_block^1], pb2_bits_count);
-                    s->pb2= backup_s.pb2;
-
-                    tex_pb_bits_count= put_bits_count(&s->tex_pb);
-                    flush_put_bits(&s->tex_pb);
-                    avpriv_copy_bits(&backup_s.tex_pb, bit_buf_tex[next_block^1], tex_pb_bits_count);
-                    s->tex_pb= backup_s.tex_pb;
-                }
-                s->last_bits= put_bits_count(&s->pb);
-
-                if (CONFIG_H263_ENCODER &&
-                    s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B)
-                    ff_h263_update_motion_val(s);
-
-                if(next_block==0){ //FIXME 16 vs linesize16
-                    s->hdsp.put_pixels_tab[0][0](s->dest[0], s->rd_scratchpad                     , s->linesize  ,16);
-                    s->hdsp.put_pixels_tab[1][0](s->dest[1], s->rd_scratchpad + 16*s->linesize    , s->uvlinesize, 8);
-                    s->hdsp.put_pixels_tab[1][0](s->dest[2], s->rd_scratchpad + 16*s->linesize + 8, s->uvlinesize, 8);
-                }
-
-                if(s->avctx->mb_decision == FF_MB_DECISION_BITS)
-                    ff_MPV_decode_mb(s, s->block);
-            } else {
-                int motion_x = 0, motion_y = 0;
-                s->mv_type=MV_TYPE_16X16;
-                // only one MB-Type possible
-
-                switch(mb_type){
-                case CANDIDATE_MB_TYPE_INTRA:
-                    s->mv_dir = 0;
-                    s->mb_intra= 1;
-                    motion_x= s->mv[0][0][0] = 0;
-                    motion_y= s->mv[0][0][1] = 0;
-                    break;
-                case CANDIDATE_MB_TYPE_INTER:
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mb_intra= 0;
-                    motion_x= s->mv[0][0][0] = s->p_mv_table[xy][0];
-                    motion_y= s->mv[0][0][1] = s->p_mv_table[xy][1];
-                    break;
-                case CANDIDATE_MB_TYPE_INTER_I:
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mv_type = MV_TYPE_FIELD;
-                    s->mb_intra= 0;
-                    for(i=0; i<2; i++){
-                        j= s->field_select[0][i] = s->p_field_select_table[i][xy];
-                        s->mv[0][i][0] = s->p_field_mv_table[i][j][xy][0];
-                        s->mv[0][i][1] = s->p_field_mv_table[i][j][xy][1];
-                    }
-                    break;
-                case CANDIDATE_MB_TYPE_INTER4V:
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mv_type = MV_TYPE_8X8;
-                    s->mb_intra= 0;
-                    for(i=0; i<4; i++){
-                        s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0];
-                        s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1];
-                    }
-                    break;
-                case CANDIDATE_MB_TYPE_DIRECT:
-                    if (CONFIG_MPEG4_ENCODER) {
-                        s->mv_dir = MV_DIR_FORWARD|MV_DIR_BACKWARD|MV_DIRECT;
-                        s->mb_intra= 0;
-                        motion_x=s->b_direct_mv_table[xy][0];
-                        motion_y=s->b_direct_mv_table[xy][1];
-                        ff_mpeg4_set_direct_mv(s, motion_x, motion_y);
-                    }
-                    break;
-                case CANDIDATE_MB_TYPE_DIRECT0:
-                    if (CONFIG_MPEG4_ENCODER) {
-                        s->mv_dir = MV_DIR_FORWARD|MV_DIR_BACKWARD|MV_DIRECT;
-                        s->mb_intra= 0;
-                        ff_mpeg4_set_direct_mv(s, 0, 0);
-                    }
-                    break;
-                case CANDIDATE_MB_TYPE_BIDIR:
-                    s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
-                    s->mb_intra= 0;
-                    s->mv[0][0][0] = s->b_bidir_forw_mv_table[xy][0];
-                    s->mv[0][0][1] = s->b_bidir_forw_mv_table[xy][1];
-                    s->mv[1][0][0] = s->b_bidir_back_mv_table[xy][0];
-                    s->mv[1][0][1] = s->b_bidir_back_mv_table[xy][1];
-                    break;
-                case CANDIDATE_MB_TYPE_BACKWARD:
-                    s->mv_dir = MV_DIR_BACKWARD;
-                    s->mb_intra= 0;
-                    motion_x= s->mv[1][0][0] = s->b_back_mv_table[xy][0];
-                    motion_y= s->mv[1][0][1] = s->b_back_mv_table[xy][1];
-                    break;
-                case CANDIDATE_MB_TYPE_FORWARD:
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mb_intra= 0;
-                    motion_x= s->mv[0][0][0] = s->b_forw_mv_table[xy][0];
-                    motion_y= s->mv[0][0][1] = s->b_forw_mv_table[xy][1];
-                    break;
-                case CANDIDATE_MB_TYPE_FORWARD_I:
-                    s->mv_dir = MV_DIR_FORWARD;
-                    s->mv_type = MV_TYPE_FIELD;
-                    s->mb_intra= 0;
-                    for(i=0; i<2; i++){
-                        j= s->field_select[0][i] = s->b_field_select_table[0][i][xy];
-                        s->mv[0][i][0] = s->b_field_mv_table[0][i][j][xy][0];
-                        s->mv[0][i][1] = s->b_field_mv_table[0][i][j][xy][1];
-                    }
-                    break;
-                case CANDIDATE_MB_TYPE_BACKWARD_I:
-                    s->mv_dir = MV_DIR_BACKWARD;
-                    s->mv_type = MV_TYPE_FIELD;
-                    s->mb_intra= 0;
-                    for(i=0; i<2; i++){
-                        j= s->field_select[1][i] = s->b_field_select_table[1][i][xy];
-                        s->mv[1][i][0] = s->b_field_mv_table[1][i][j][xy][0];
-                        s->mv[1][i][1] = s->b_field_mv_table[1][i][j][xy][1];
-                    }
-                    break;
-                case CANDIDATE_MB_TYPE_BIDIR_I:
-                    s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
-                    s->mv_type = MV_TYPE_FIELD;
-                    s->mb_intra= 0;
-                    for(dir=0; dir<2; dir++){
-                        for(i=0; i<2; i++){
-                            j= s->field_select[dir][i] = s->b_field_select_table[dir][i][xy];
-                            s->mv[dir][i][0] = s->b_field_mv_table[dir][i][j][xy][0];
-                            s->mv[dir][i][1] = s->b_field_mv_table[dir][i][j][xy][1];
-                        }
-                    }
-                    break;
-                default:
-                    av_log(s->avctx, AV_LOG_ERROR, "illegal MB type\n");
-                }
-
-                encode_mb(s, motion_x, motion_y);
-
-                // RAL: Update last macroblock type
-                s->last_mv_dir = s->mv_dir;
-
-                if (CONFIG_H263_ENCODER &&
-                    s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B)
-                    ff_h263_update_motion_val(s);
-
-                ff_MPV_decode_mb(s, s->block);
-            }
-
-            /* clean the MV table in IPS frames for direct mode in B frames */
-            if(s->mb_intra /* && I,P,S_TYPE */){
-                s->p_mv_table[xy][0]=0;
-                s->p_mv_table[xy][1]=0;
-            }
-
-            if(s->flags&CODEC_FLAG_PSNR){
-                int w= 16;
-                int h= 16;
-
-                if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16;
-                if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16;
-
-                s->current_picture.f.error[0] += sse(
-                    s, s->new_picture.f.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16,
-                    s->dest[0], w, h, s->linesize);
-                s->current_picture.f.error[1] += sse(
-                    s, s->new_picture.f.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*chr_h,
-                    s->dest[1], w>>1, h>>s->chroma_y_shift, s->uvlinesize);
-                s->current_picture.f.error[2] += sse(
-                    s, s->new_picture.f.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*chr_h,
-                    s->dest[2], w>>1, h>>s->chroma_y_shift, s->uvlinesize);
-            }
-            if(s->loop_filter){
-                if(CONFIG_H263_ENCODER && s->out_format == FMT_H263)
-                    ff_h263_loop_filter(s);
-            }
-            av_dlog(s->avctx, "MB %d %d bits\n",
-                    s->mb_x + s->mb_y * s->mb_stride, put_bits_count(&s->pb));
-        }
-    }
-
-    //not beautiful here but we must write it before flushing so it has to be here
-    if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == AV_PICTURE_TYPE_I)
-        ff_msmpeg4_encode_ext_header(s);
-
-    write_slice_end(s);
-
-    /* Send the last GOB if RTP */
-    if (s->avctx->rtp_callback) {
-        int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x;
-        pdif = put_bits_ptr(&s->pb) - s->ptr_lastgob;
-        /* Call the RTP callback to send the last GOB */
-        emms_c();
-        s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb);
-    }
-
-    return 0;
-}
-
-#define MERGE(field) dst->field += src->field; src->field=0
-static void merge_context_after_me(MpegEncContext *dst, MpegEncContext *src){
-    MERGE(me.scene_change_score);
-    MERGE(me.mc_mb_var_sum_temp);
-    MERGE(me.mb_var_sum_temp);
-}
-
-static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src){
-    int i;
-
-    MERGE(dct_count[0]); //note, the other dct vars are not part of the context
-    MERGE(dct_count[1]);
-    MERGE(mv_bits);
-    MERGE(i_tex_bits);
-    MERGE(p_tex_bits);
-    MERGE(i_count);
-    MERGE(f_count);
-    MERGE(b_count);
-    MERGE(skip_count);
-    MERGE(misc_bits);
-    MERGE(er.error_count);
-    MERGE(padding_bug_score);
-    MERGE(current_picture.f.error[0]);
-    MERGE(current_picture.f.error[1]);
-    MERGE(current_picture.f.error[2]);
-
-    if(dst->avctx->noise_reduction){
-        for(i=0; i<64; i++){
-            MERGE(dct_error_sum[0][i]);
-            MERGE(dct_error_sum[1][i]);
-        }
-    }
-
-    assert(put_bits_count(&src->pb) % 8 ==0);
-    assert(put_bits_count(&dst->pb) % 8 ==0);
-    avpriv_copy_bits(&dst->pb, src->pb.buf, put_bits_count(&src->pb));
-    flush_put_bits(&dst->pb);
-}
-
-static int estimate_qp(MpegEncContext *s, int dry_run){
-    if (s->next_lambda){
-        s->current_picture_ptr->f.quality =
-        s->current_picture.f.quality = s->next_lambda;
-        if(!dry_run) s->next_lambda= 0;
-    } else if (!s->fixed_qscale) {
-        s->current_picture_ptr->f.quality =
-        s->current_picture.f.quality = ff_rate_estimate_qscale(s, dry_run);
-        if (s->current_picture.f.quality < 0)
-            return -1;
-    }
-
-    if(s->adaptive_quant){
-        switch(s->codec_id){
-        case AV_CODEC_ID_MPEG4:
-            if (CONFIG_MPEG4_ENCODER)
-                ff_clean_mpeg4_qscales(s);
-            break;
-        case AV_CODEC_ID_H263:
-        case AV_CODEC_ID_H263P:
-        case AV_CODEC_ID_FLV1:
-            if (CONFIG_H263_ENCODER)
-                ff_clean_h263_qscales(s);
-            break;
-        default:
-            ff_init_qscale_tab(s);
-        }
-
-        s->lambda= s->lambda_table[0];
-        //FIXME broken
-    }else
-        s->lambda = s->current_picture.f.quality;
-    update_qscale(s);
-    return 0;
-}
-
-/* must be called before writing the header */
-static void set_frame_distances(MpegEncContext * s){
-    assert(s->current_picture_ptr->f.pts != AV_NOPTS_VALUE);
-    s->time = s->current_picture_ptr->f.pts * s->avctx->time_base.num;
-
-    if(s->pict_type==AV_PICTURE_TYPE_B){
-        s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
-        assert(s->pb_time > 0 && s->pb_time < s->pp_time);
-    }else{
-        s->pp_time= s->time - s->last_non_b_time;
-        s->last_non_b_time= s->time;
-        assert(s->picture_number==0 || s->pp_time > 0);
-    }
-}
-
-static int encode_picture(MpegEncContext *s, int picture_number)
-{
-    int i, ret;
-    int bits;
-    int context_count = s->slice_context_count;
-
-    s->picture_number = picture_number;
-
-    /* Reset the average MB variance */
-    s->me.mb_var_sum_temp    =
-    s->me.mc_mb_var_sum_temp = 0;
-
-    /* we need to initialize some time vars before we can encode b-frames */
-    // RAL: Condition added for MPEG1VIDEO
-    if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO || s->codec_id == AV_CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->msmpeg4_version))
-        set_frame_distances(s);
-    if(CONFIG_MPEG4_ENCODER && s->codec_id == AV_CODEC_ID_MPEG4)
-        ff_set_mpeg4_time(s);
-
-    s->me.scene_change_score=0;
-
-//    s->lambda= s->current_picture_ptr->quality; //FIXME qscale / ... stuff for ME rate distortion
-
-    if(s->pict_type==AV_PICTURE_TYPE_I){
-        if(s->msmpeg4_version >= 3) s->no_rounding=1;
-        else                        s->no_rounding=0;
-    }else if(s->pict_type!=AV_PICTURE_TYPE_B){
-        if(s->flipflop_rounding || s->codec_id == AV_CODEC_ID_H263P || s->codec_id == AV_CODEC_ID_MPEG4)
-            s->no_rounding ^= 1;
-    }
-
-    if(s->flags & CODEC_FLAG_PASS2){
-        if (estimate_qp(s,1) < 0)
-            return -1;
-        ff_get_2pass_fcode(s);
-    }else if(!(s->flags & CODEC_FLAG_QSCALE)){
-        if(s->pict_type==AV_PICTURE_TYPE_B)
-            s->lambda= s->last_lambda_for[s->pict_type];
-        else
-            s->lambda= s->last_lambda_for[s->last_non_b_pict_type];
-        update_qscale(s);
-    }
-
-    s->mb_intra=0; //for the rate distortion & bit compare functions
-    for(i=1; i<context_count; i++){
-        ret = ff_update_duplicate_context(s->thread_context[i], s);
-        if (ret < 0)
-            return ret;
-    }
-
-    if(ff_init_me(s)<0)
-        return -1;
-
-    /* Estimate motion for every MB */
-    if(s->pict_type != AV_PICTURE_TYPE_I){
-        s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8;
-        s->lambda2= (s->lambda2* (int64_t)s->avctx->me_penalty_compensation + 128)>>8;
-        if (s->pict_type != AV_PICTURE_TYPE_B) {
-            if((s->avctx->pre_me && s->last_non_b_pict_type==AV_PICTURE_TYPE_I) || s->avctx->pre_me==2){
-                s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
-            }
-        }
-
-        s->avctx->execute(s->avctx, estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
-    }else /* if(s->pict_type == AV_PICTURE_TYPE_I) */{
-        /* I-Frame */
-        for(i=0; i<s->mb_stride*s->mb_height; i++)
-            s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
-
-        if(!s->fixed_qscale){
-            /* finding spatial complexity for I-frame rate control */
-            s->avctx->execute(s->avctx, mb_var_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
-        }
-    }
-    for(i=1; i<context_count; i++){
-        merge_context_after_me(s, s->thread_context[i]);
-    }
-    s->current_picture.mc_mb_var_sum= s->current_picture_ptr->mc_mb_var_sum= s->me.mc_mb_var_sum_temp;
-    s->current_picture.   mb_var_sum= s->current_picture_ptr->   mb_var_sum= s->me.   mb_var_sum_temp;
-    emms_c();
-
-    if(s->me.scene_change_score > s->avctx->scenechange_threshold && s->pict_type == AV_PICTURE_TYPE_P){
-        s->pict_type= AV_PICTURE_TYPE_I;
-        for(i=0; i<s->mb_stride*s->mb_height; i++)
-            s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
-        av_dlog(s, "Scene change detected, encoding as I Frame %d %d\n",
-                s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
-    }
-
-    if(!s->umvplus){
-        if(s->pict_type==AV_PICTURE_TYPE_P || s->pict_type==AV_PICTURE_TYPE_S) {
-            s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER);
-
-            if(s->flags & CODEC_FLAG_INTERLACED_ME){
-                int a,b;
-                a= ff_get_best_fcode(s, s->p_field_mv_table[0][0], CANDIDATE_MB_TYPE_INTER_I); //FIXME field_select
-                b= ff_get_best_fcode(s, s->p_field_mv_table[1][1], CANDIDATE_MB_TYPE_INTER_I);
-                s->f_code= FFMAX3(s->f_code, a, b);
-            }
-
-            ff_fix_long_p_mvs(s);
-            ff_fix_long_mvs(s, NULL, 0, s->p_mv_table, s->f_code, CANDIDATE_MB_TYPE_INTER, 0);
-            if(s->flags & CODEC_FLAG_INTERLACED_ME){
-                int j;
-                for(i=0; i<2; i++){
-                    for(j=0; j<2; j++)
-                        ff_fix_long_mvs(s, s->p_field_select_table[i], j,
-                                        s->p_field_mv_table[i][j], s->f_code, CANDIDATE_MB_TYPE_INTER_I, 0);
-                }
-            }
-        }
-
-        if(s->pict_type==AV_PICTURE_TYPE_B){
-            int a, b;
-
-            a = ff_get_best_fcode(s, s->b_forw_mv_table, CANDIDATE_MB_TYPE_FORWARD);
-            b = ff_get_best_fcode(s, s->b_bidir_forw_mv_table, CANDIDATE_MB_TYPE_BIDIR);
-            s->f_code = FFMAX(a, b);
-
-            a = ff_get_best_fcode(s, s->b_back_mv_table, CANDIDATE_MB_TYPE_BACKWARD);
-            b = ff_get_best_fcode(s, s->b_bidir_back_mv_table, CANDIDATE_MB_TYPE_BIDIR);
-            s->b_code = FFMAX(a, b);
-
-            ff_fix_long_mvs(s, NULL, 0, s->b_forw_mv_table, s->f_code, CANDIDATE_MB_TYPE_FORWARD, 1);
-            ff_fix_long_mvs(s, NULL, 0, s->b_back_mv_table, s->b_code, CANDIDATE_MB_TYPE_BACKWARD, 1);
-            ff_fix_long_mvs(s, NULL, 0, s->b_bidir_forw_mv_table, s->f_code, CANDIDATE_MB_TYPE_BIDIR, 1);
-            ff_fix_long_mvs(s, NULL, 0, s->b_bidir_back_mv_table, s->b_code, CANDIDATE_MB_TYPE_BIDIR, 1);
-            if(s->flags & CODEC_FLAG_INTERLACED_ME){
-                int dir, j;
-                for(dir=0; dir<2; dir++){
-                    for(i=0; i<2; i++){
-                        for(j=0; j<2; j++){
-                            int type= dir ? (CANDIDATE_MB_TYPE_BACKWARD_I|CANDIDATE_MB_TYPE_BIDIR_I)
-                                          : (CANDIDATE_MB_TYPE_FORWARD_I |CANDIDATE_MB_TYPE_BIDIR_I);
-                            ff_fix_long_mvs(s, s->b_field_select_table[dir][i], j,
-                                            s->b_field_mv_table[dir][i][j], dir ? s->b_code : s->f_code, type, 1);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    if (estimate_qp(s, 0) < 0)
-        return -1;
-
-    if(s->qscale < 3 && s->max_qcoeff<=128 && s->pict_type==AV_PICTURE_TYPE_I && !(s->flags & CODEC_FLAG_QSCALE))
-        s->qscale= 3; //reduce clipping problems
-
-    if (s->out_format == FMT_MJPEG) {
-        /* for mjpeg, we do include qscale in the matrix */
-        for(i=1;i<64;i++){
-            int j= s->dsp.idct_permutation[i];
-
-            s->intra_matrix[j] = av_clip_uint8((ff_mpeg1_default_intra_matrix[i] * s->qscale) >> 3);
-        }
-        s->y_dc_scale_table=
-        s->c_dc_scale_table= ff_mpeg2_dc_scale_table[s->intra_dc_precision];
-        s->intra_matrix[0] = ff_mpeg2_dc_scale_table[s->intra_dc_precision][8];
-        ff_convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
-                       s->intra_matrix, s->intra_quant_bias, 8, 8, 1);
-        s->qscale= 8;
-    }
-
-    //FIXME var duplication
-    s->current_picture_ptr->f.key_frame =
-    s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I; //FIXME pic_ptr
-    s->current_picture_ptr->f.pict_type =
-    s->current_picture.f.pict_type = s->pict_type;
-
-    if (s->current_picture.f.key_frame)
-        s->picture_in_gop_number=0;
-
-    s->last_bits= put_bits_count(&s->pb);
-    switch(s->out_format) {
-    case FMT_MJPEG:
-        if (CONFIG_MJPEG_ENCODER)
-            ff_mjpeg_encode_picture_header(s->avctx, &s->pb, &s->intra_scantable,
-                                           s->intra_matrix);
-        break;
-    case FMT_H261:
-        if (CONFIG_H261_ENCODER)
-            ff_h261_encode_picture_header(s, picture_number);
-        break;
-    case FMT_H263:
-        if (CONFIG_WMV2_ENCODER && s->codec_id == AV_CODEC_ID_WMV2)
-            ff_wmv2_encode_picture_header(s, picture_number);
-        else if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version)
-            ff_msmpeg4_encode_picture_header(s, picture_number);
-        else if (CONFIG_MPEG4_ENCODER && s->h263_pred)
-            ff_mpeg4_encode_picture_header(s, picture_number);
-        else if (CONFIG_RV10_ENCODER && s->codec_id == AV_CODEC_ID_RV10)
-            ff_rv10_encode_picture_header(s, picture_number);
-        else if (CONFIG_RV20_ENCODER && s->codec_id == AV_CODEC_ID_RV20)
-            ff_rv20_encode_picture_header(s, picture_number);
-        else if (CONFIG_FLV_ENCODER && s->codec_id == AV_CODEC_ID_FLV1)
-            ff_flv_encode_picture_header(s, picture_number);
-        else if (CONFIG_H263_ENCODER)
-            ff_h263_encode_picture_header(s, picture_number);
-        break;
-    case FMT_MPEG1:
-        if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
-            ff_mpeg1_encode_picture_header(s, picture_number);
-        break;
-    default:
-        assert(0);
-    }
-    bits= put_bits_count(&s->pb);
-    s->header_bits= bits - s->last_bits;
-
-    for(i=1; i<context_count; i++){
-        update_duplicate_context_after_me(s->thread_context[i], s);
-    }
-    s->avctx->execute(s->avctx, encode_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
-    for(i=1; i<context_count; i++){
-        merge_context_after_encode(s, s->thread_context[i]);
-    }
-    emms_c();
-    return 0;
-}
-
-static void denoise_dct_c(MpegEncContext *s, int16_t *block){
-    const int intra= s->mb_intra;
-    int i;
-
-    s->dct_count[intra]++;
-
-    for(i=0; i<64; i++){
-        int level= block[i];
-
-        if(level){
-            if(level>0){
-                s->dct_error_sum[intra][i] += level;
-                level -= s->dct_offset[intra][i];
-                if(level<0) level=0;
-            }else{
-                s->dct_error_sum[intra][i] -= level;
-                level += s->dct_offset[intra][i];
-                if(level>0) level=0;
-            }
-            block[i]= level;
-        }
-    }
-}
-
-static int dct_quantize_trellis_c(MpegEncContext *s,
-                                  int16_t *block, int n,
-                                  int qscale, int *overflow){
-    const int *qmat;
-    const uint8_t *scantable= s->intra_scantable.scantable;
-    const uint8_t *perm_scantable= s->intra_scantable.permutated;
-    int max=0;
-    unsigned int threshold1, threshold2;
-    int bias=0;
-    int run_tab[65];
-    int level_tab[65];
-    int score_tab[65];
-    int survivor[65];
-    int survivor_count;
-    int last_run=0;
-    int last_level=0;
-    int last_score= 0;
-    int last_i;
-    int coeff[2][64];
-    int coeff_count[64];
-    int qmul, qadd, start_i, last_non_zero, i, dc;
-    const int esc_length= s->ac_esc_length;
-    uint8_t * length;
-    uint8_t * last_length;
-    const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
-
-    s->dsp.fdct (block);
-
-    if(s->dct_error_sum)
-        s->denoise_dct(s, block);
-    qmul= qscale*16;
-    qadd= ((qscale-1)|1)*8;
-
-    if (s->mb_intra) {
-        int q;
-        if (!s->h263_aic) {
-            if (n < 4)
-                q = s->y_dc_scale;
-            else
-                q = s->c_dc_scale;
-            q = q << 3;
-        } else{
-            /* For AIC we skip quant/dequant of INTRADC */
-            q = 1 << 3;
-            qadd=0;
-        }
-
-        /* note: block[0] is assumed to be positive */
-        block[0] = (block[0] + (q >> 1)) / q;
-        start_i = 1;
-        last_non_zero = 0;
-        qmat = s->q_intra_matrix[qscale];
-        if(s->mpeg_quant || s->out_format == FMT_MPEG1)
-            bias= 1<<(QMAT_SHIFT-1);
-        length     = s->intra_ac_vlc_length;
-        last_length= s->intra_ac_vlc_last_length;
-    } else {
-        start_i = 0;
-        last_non_zero = -1;
-        qmat = s->q_inter_matrix[qscale];
-        length     = s->inter_ac_vlc_length;
-        last_length= s->inter_ac_vlc_last_length;
-    }
-    last_i= start_i;
-
-    threshold1= (1<<QMAT_SHIFT) - bias - 1;
-    threshold2= (threshold1<<1);
-
-    for(i=63; i>=start_i; i--) {
-        const int j = scantable[i];
-        int level = block[j] * qmat[j];
-
-        if(((unsigned)(level+threshold1))>threshold2){
-            last_non_zero = i;
-            break;
-        }
-    }
-
-    for(i=start_i; i<=last_non_zero; i++) {
-        const int j = scantable[i];
-        int level = block[j] * qmat[j];
-
-//        if(   bias+level >= (1<<(QMAT_SHIFT - 3))
-//           || bias-level >= (1<<(QMAT_SHIFT - 3))){
-        if(((unsigned)(level+threshold1))>threshold2){
-            if(level>0){
-                level= (bias + level)>>QMAT_SHIFT;
-                coeff[0][i]= level;
-                coeff[1][i]= level-1;
-//                coeff[2][k]= level-2;
-            }else{
-                level= (bias - level)>>QMAT_SHIFT;
-                coeff[0][i]= -level;
-                coeff[1][i]= -level+1;
-//                coeff[2][k]= -level+2;
-            }
-            coeff_count[i]= FFMIN(level, 2);
-            assert(coeff_count[i]);
-            max |=level;
-        }else{
-            coeff[0][i]= (level>>31)|1;
-            coeff_count[i]= 1;
-        }
-    }
-
-    *overflow= s->max_qcoeff < max; //overflow might have happened
-
-    if(last_non_zero < start_i){
-        memset(block + start_i, 0, (64-start_i)*sizeof(int16_t));
-        return last_non_zero;
-    }
-
-    score_tab[start_i]= 0;
-    survivor[0]= start_i;
-    survivor_count= 1;
-
-    for(i=start_i; i<=last_non_zero; i++){
-        int level_index, j, zero_distortion;
-        int dct_coeff= FFABS(block[ scantable[i] ]);
-        int best_score=256*256*256*120;
-
-        if (s->dsp.fdct == ff_fdct_ifast)
-            dct_coeff= (dct_coeff*ff_inv_aanscales[ scantable[i] ]) >> 12;
-        zero_distortion= dct_coeff*dct_coeff;
-
-        for(level_index=0; level_index < coeff_count[i]; level_index++){
-            int distortion;
-            int level= coeff[level_index][i];
-            const int alevel= FFABS(level);
-            int unquant_coeff;
-
-            assert(level);
-
-            if(s->out_format == FMT_H263){
-                unquant_coeff= alevel*qmul + qadd;
-            }else{ //MPEG1
-                j= s->dsp.idct_permutation[ scantable[i] ]; //FIXME optimize
-                if(s->mb_intra){
-                        unquant_coeff = (int)(  alevel  * qscale * s->intra_matrix[j]) >> 3;
-                        unquant_coeff =   (unquant_coeff - 1) | 1;
-                }else{
-                        unquant_coeff = (((  alevel  << 1) + 1) * qscale * ((int) s->inter_matrix[j])) >> 4;
-                        unquant_coeff =   (unquant_coeff - 1) | 1;
-                }
-                unquant_coeff<<= 3;
-            }
-
-            distortion= (unquant_coeff - dct_coeff) * (unquant_coeff - dct_coeff) - zero_distortion;
-            level+=64;
-            if((level&(~127)) == 0){
-                for(j=survivor_count-1; j>=0; j--){
-                    int run= i - survivor[j];
-                    int score= distortion + length[UNI_AC_ENC_INDEX(run, level)]*lambda;
-                    score += score_tab[i-run];
-
-                    if(score < best_score){
-                        best_score= score;
-                        run_tab[i+1]= run;
-                        level_tab[i+1]= level-64;
-                    }
-                }
-
-                if(s->out_format == FMT_H263){
-                    for(j=survivor_count-1; j>=0; j--){
-                        int run= i - survivor[j];
-                        int score= distortion + last_length[UNI_AC_ENC_INDEX(run, level)]*lambda;
-                        score += score_tab[i-run];
-                        if(score < last_score){
-                            last_score= score;
-                            last_run= run;
-                            last_level= level-64;
-                            last_i= i+1;
-                        }
-                    }
-                }
-            }else{
-                distortion += esc_length*lambda;
-                for(j=survivor_count-1; j>=0; j--){
-                    int run= i - survivor[j];
-                    int score= distortion + score_tab[i-run];
-
-                    if(score < best_score){
-                        best_score= score;
-                        run_tab[i+1]= run;
-                        level_tab[i+1]= level-64;
-                    }
-                }
-
-                if(s->out_format == FMT_H263){
-                  for(j=survivor_count-1; j>=0; j--){
-                        int run= i - survivor[j];
-                        int score= distortion + score_tab[i-run];
-                        if(score < last_score){
-                            last_score= score;
-                            last_run= run;
-                            last_level= level-64;
-                            last_i= i+1;
-                        }
-                    }
-                }
-            }
-        }
-
-        score_tab[i+1]= best_score;
-
-        //Note: there is a vlc code in mpeg4 which is 1 bit shorter then another one with a shorter run and the same level
-        if(last_non_zero <= 27){
-            for(; survivor_count; survivor_count--){
-                if(score_tab[ survivor[survivor_count-1] ] <= best_score)
-                    break;
-            }
-        }else{
-            for(; survivor_count; survivor_count--){
-                if(score_tab[ survivor[survivor_count-1] ] <= best_score + lambda)
-                    break;
-            }
-        }
-
-        survivor[ survivor_count++ ]= i+1;
-    }
-
-    if(s->out_format != FMT_H263){
-        last_score= 256*256*256*120;
-        for(i= survivor[0]; i<=last_non_zero + 1; i++){
-            int score= score_tab[i];
-            if(i) score += lambda*2; //FIXME exacter?
-
-            if(score < last_score){
-                last_score= score;
-                last_i= i;
-                last_level= level_tab[i];
-                last_run= run_tab[i];
-            }
-        }
-    }
-
-    s->coded_score[n] = last_score;
-
-    dc= FFABS(block[0]);
-    last_non_zero= last_i - 1;
-    memset(block + start_i, 0, (64-start_i)*sizeof(int16_t));
-
-    if(last_non_zero < start_i)
-        return last_non_zero;
-
-    if(last_non_zero == 0 && start_i == 0){
-        int best_level= 0;
-        int best_score= dc * dc;
-
-        for(i=0; i<coeff_count[0]; i++){
-            int level= coeff[i][0];
-            int alevel= FFABS(level);
-            int unquant_coeff, score, distortion;
-
-            if(s->out_format == FMT_H263){
-                    unquant_coeff= (alevel*qmul + qadd)>>3;
-            }else{ //MPEG1
-                    unquant_coeff = (((  alevel  << 1) + 1) * qscale * ((int) s->inter_matrix[0])) >> 4;
-                    unquant_coeff =   (unquant_coeff - 1) | 1;
-            }
-            unquant_coeff = (unquant_coeff + 4) >> 3;
-            unquant_coeff<<= 3 + 3;
-
-            distortion= (unquant_coeff - dc) * (unquant_coeff - dc);
-            level+=64;
-            if((level&(~127)) == 0) score= distortion + last_length[UNI_AC_ENC_INDEX(0, level)]*lambda;
-            else                    score= distortion + esc_length*lambda;
-
-            if(score < best_score){
-                best_score= score;
-                best_level= level - 64;
-            }
-        }
-        block[0]= best_level;
-        s->coded_score[n] = best_score - dc*dc;
-        if(best_level == 0) return -1;
-        else                return last_non_zero;
-    }
-
-    i= last_i;
-    assert(last_level);
-
-    block[ perm_scantable[last_non_zero] ]= last_level;
-    i -= last_run + 1;
-
-    for(; i>start_i; i -= run_tab[i] + 1){
-        block[ perm_scantable[i-1] ]= level_tab[i];
-    }
-
-    return last_non_zero;
-}
-
-//#define REFINE_STATS 1
-static int16_t basis[64][64];
-
-static void build_basis(uint8_t *perm){
-    int i, j, x, y;
-    emms_c();
-    for(i=0; i<8; i++){
-        for(j=0; j<8; j++){
-            for(y=0; y<8; y++){
-                for(x=0; x<8; x++){
-                    double s= 0.25*(1<<BASIS_SHIFT);
-                    int index= 8*i + j;
-                    int perm_index= perm[index];
-                    if(i==0) s*= sqrt(0.5);
-                    if(j==0) s*= sqrt(0.5);
-                    basis[perm_index][8*x + y]= lrintf(s * cos((M_PI/8.0)*i*(x+0.5)) * cos((M_PI/8.0)*j*(y+0.5)));
-                }
-            }
-        }
-    }
-}
-
-static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise?
-                        int16_t *block, int16_t *weight, int16_t *orig,
-                        int n, int qscale){
-    int16_t rem[64];
-    LOCAL_ALIGNED_16(int16_t, d1, [64]);
-    const uint8_t *scantable= s->intra_scantable.scantable;
-    const uint8_t *perm_scantable= s->intra_scantable.permutated;
-//    unsigned int threshold1, threshold2;
-//    int bias=0;
-    int run_tab[65];
-    int prev_run=0;
-    int prev_level=0;
-    int qmul, qadd, start_i, last_non_zero, i, dc;
-    uint8_t * length;
-    uint8_t * last_length;
-    int lambda;
-    int rle_index, run, q = 1, sum; //q is only used when s->mb_intra is true
-#ifdef REFINE_STATS
-static int count=0;
-static int after_last=0;
-static int to_zero=0;
-static int from_zero=0;
-static int raise=0;
-static int lower=0;
-static int messed_sign=0;
-#endif
-
-    if(basis[0][0] == 0)
-        build_basis(s->dsp.idct_permutation);
-
-    qmul= qscale*2;
-    qadd= (qscale-1)|1;
-    if (s->mb_intra) {
-        if (!s->h263_aic) {
-            if (n < 4)
-                q = s->y_dc_scale;
-            else
-                q = s->c_dc_scale;
-        } else{
-            /* For AIC we skip quant/dequant of INTRADC */
-            q = 1;
-            qadd=0;
-        }
-        q <<= RECON_SHIFT-3;
-        /* note: block[0] is assumed to be positive */
-        dc= block[0]*q;
-//        block[0] = (block[0] + (q >> 1)) / q;
-        start_i = 1;
-//        if(s->mpeg_quant || s->out_format == FMT_MPEG1)
-//            bias= 1<<(QMAT_SHIFT-1);
-        length     = s->intra_ac_vlc_length;
-        last_length= s->intra_ac_vlc_last_length;
-    } else {
-        dc= 0;
-        start_i = 0;
-        length     = s->inter_ac_vlc_length;
-        last_length= s->inter_ac_vlc_last_length;
-    }
-    last_non_zero = s->block_last_index[n];
-
-#ifdef REFINE_STATS
-{START_TIMER
-#endif
-    dc += (1<<(RECON_SHIFT-1));
-    for(i=0; i<64; i++){
-        rem[i]= dc - (orig[i]<<RECON_SHIFT); //FIXME  use orig dirrectly instead of copying to rem[]
-    }
-#ifdef REFINE_STATS
-STOP_TIMER("memset rem[]")}
-#endif
-    sum=0;
-    for(i=0; i<64; i++){
-        int one= 36;
-        int qns=4;
-        int w;
-
-        w= FFABS(weight[i]) + qns*one;
-        w= 15 + (48*qns*one + w/2)/w; // 16 .. 63
-
-        weight[i] = w;
-//        w=weight[i] = (63*qns + (w/2)) / w;
-
-        assert(w>0);
-        assert(w<(1<<6));
-        sum += w*w;
-    }
-    lambda= sum*(uint64_t)s->lambda2 >> (FF_LAMBDA_SHIFT - 6 + 6 + 6 + 6);
-#ifdef REFINE_STATS
-{START_TIMER
-#endif
-    run=0;
-    rle_index=0;
-    for(i=start_i; i<=last_non_zero; i++){
-        int j= perm_scantable[i];
-        const int level= block[j];
-        int coeff;
-
-        if(level){
-            if(level<0) coeff= qmul*level - qadd;
-            else        coeff= qmul*level + qadd;
-            run_tab[rle_index++]=run;
-            run=0;
-
-            s->dsp.add_8x8basis(rem, basis[j], coeff);
-        }else{
-            run++;
-        }
-    }
-#ifdef REFINE_STATS
-if(last_non_zero>0){
-STOP_TIMER("init rem[]")
-}
-}
-
-{START_TIMER
-#endif
-    for(;;){
-        int best_score=s->dsp.try_8x8basis(rem, weight, basis[0], 0);
-        int best_coeff=0;
-        int best_change=0;
-        int run2, best_unquant_change=0, analyze_gradient;
-#ifdef REFINE_STATS
-{START_TIMER
-#endif
-        analyze_gradient = last_non_zero > 2 || s->quantizer_noise_shaping >= 3;
-
-        if(analyze_gradient){
-#ifdef REFINE_STATS
-{START_TIMER
-#endif
-            for(i=0; i<64; i++){
-                int w= weight[i];
-
-                d1[i] = (rem[i]*w*w + (1<<(RECON_SHIFT+12-1)))>>(RECON_SHIFT+12);
-            }
-#ifdef REFINE_STATS
-STOP_TIMER("rem*w*w")}
-{START_TIMER
-#endif
-            s->dsp.fdct(d1);
-#ifdef REFINE_STATS
-STOP_TIMER("dct")}
-#endif
-        }
-
-        if(start_i){
-            const int level= block[0];
-            int change, old_coeff;
-
-            assert(s->mb_intra);
-
-            old_coeff= q*level;
-
-            for(change=-1; change<=1; change+=2){
-                int new_level= level + change;
-                int score, new_coeff;
-
-                new_coeff= q*new_level;
-                if(new_coeff >= 2048 || new_coeff < 0)
-                    continue;
-
-                score= s->dsp.try_8x8basis(rem, weight, basis[0], new_coeff - old_coeff);
-                if(score<best_score){
-                    best_score= score;
-                    best_coeff= 0;
-                    best_change= change;
-                    best_unquant_change= new_coeff - old_coeff;
-                }
-            }
-        }
-
-        run=0;
-        rle_index=0;
-        run2= run_tab[rle_index++];
-        prev_level=0;
-        prev_run=0;
-
-        for(i=start_i; i<64; i++){
-            int j= perm_scantable[i];
-            const int level= block[j];
-            int change, old_coeff;
-
-            if(s->quantizer_noise_shaping < 3 && i > last_non_zero + 1)
-                break;
-
-            if(level){
-                if(level<0) old_coeff= qmul*level - qadd;
-                else        old_coeff= qmul*level + qadd;
-                run2= run_tab[rle_index++]; //FIXME ! maybe after last
-            }else{
-                old_coeff=0;
-                run2--;
-                assert(run2>=0 || i >= last_non_zero );
-            }
-
-            for(change=-1; change<=1; change+=2){
-                int new_level= level + change;
-                int score, new_coeff, unquant_change;
-
-                score=0;
-                if(s->quantizer_noise_shaping < 2 && FFABS(new_level) > FFABS(level))
-                   continue;
-
-                if(new_level){
-                    if(new_level<0) new_coeff= qmul*new_level - qadd;
-                    else            new_coeff= qmul*new_level + qadd;
-                    if(new_coeff >= 2048 || new_coeff <= -2048)
-                        continue;
-                    //FIXME check for overflow
-
-                    if(level){
-                        if(level < 63 && level > -63){
-                            if(i < last_non_zero)
-                                score +=   length[UNI_AC_ENC_INDEX(run, new_level+64)]
-                                         - length[UNI_AC_ENC_INDEX(run, level+64)];
-                            else
-                                score +=   last_length[UNI_AC_ENC_INDEX(run, new_level+64)]
-                                         - last_length[UNI_AC_ENC_INDEX(run, level+64)];
-                        }
-                    }else{
-                        assert(FFABS(new_level)==1);
-
-                        if(analyze_gradient){
-                            int g= d1[ scantable[i] ];
-                            if(g && (g^new_level) >= 0)
-                                continue;
-                        }
-
-                        if(i < last_non_zero){
-                            int next_i= i + run2 + 1;
-                            int next_level= block[ perm_scantable[next_i] ] + 64;
-
-                            if(next_level&(~127))
-                                next_level= 0;
-
-                            if(next_i < last_non_zero)
-                                score +=   length[UNI_AC_ENC_INDEX(run, 65)]
-                                         + length[UNI_AC_ENC_INDEX(run2, next_level)]
-                                         - length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)];
-                            else
-                                score +=  length[UNI_AC_ENC_INDEX(run, 65)]
-                                        + last_length[UNI_AC_ENC_INDEX(run2, next_level)]
-                                        - last_length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)];
-                        }else{
-                            score += last_length[UNI_AC_ENC_INDEX(run, 65)];
-                            if(prev_level){
-                                score +=  length[UNI_AC_ENC_INDEX(prev_run, prev_level)]
-                                        - last_length[UNI_AC_ENC_INDEX(prev_run, prev_level)];
-                            }
-                        }
-                    }
-                }else{
-                    new_coeff=0;
-                    assert(FFABS(level)==1);
-
-                    if(i < last_non_zero){
-                        int next_i= i + run2 + 1;
-                        int next_level= block[ perm_scantable[next_i] ] + 64;
-
-                        if(next_level&(~127))
-                            next_level= 0;
-
-                        if(next_i < last_non_zero)
-                            score +=   length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)]
-                                     - length[UNI_AC_ENC_INDEX(run2, next_level)]
-                                     - length[UNI_AC_ENC_INDEX(run, 65)];
-                        else
-                            score +=   last_length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)]
-                                     - last_length[UNI_AC_ENC_INDEX(run2, next_level)]
-                                     - length[UNI_AC_ENC_INDEX(run, 65)];
-                    }else{
-                        score += -last_length[UNI_AC_ENC_INDEX(run, 65)];
-                        if(prev_level){
-                            score +=  last_length[UNI_AC_ENC_INDEX(prev_run, prev_level)]
-                                    - length[UNI_AC_ENC_INDEX(prev_run, prev_level)];
-                        }
-                    }
-                }
-
-                score *= lambda;
-
-                unquant_change= new_coeff - old_coeff;
-                assert((score < 100*lambda && score > -100*lambda) || lambda==0);
-
-                score+= s->dsp.try_8x8basis(rem, weight, basis[j], unquant_change);
-                if(score<best_score){
-                    best_score= score;
-                    best_coeff= i;
-                    best_change= change;
-                    best_unquant_change= unquant_change;
-                }
-            }
-            if(level){
-                prev_level= level + 64;
-                if(prev_level&(~127))
-                    prev_level= 0;
-                prev_run= run;
-                run=0;
-            }else{
-                run++;
-            }
-        }
-#ifdef REFINE_STATS
-STOP_TIMER("iterative step")}
-#endif
-
-        if(best_change){
-            int j= perm_scantable[ best_coeff ];
-
-            block[j] += best_change;
-
-            if(best_coeff > last_non_zero){
-                last_non_zero= best_coeff;
-                assert(block[j]);
-#ifdef REFINE_STATS
-after_last++;
-#endif
-            }else{
-#ifdef REFINE_STATS
-if(block[j]){
-    if(block[j] - best_change){
-        if(FFABS(block[j]) > FFABS(block[j] - best_change)){
-            raise++;
-        }else{
-            lower++;
-        }
-    }else{
-        from_zero++;
-    }
-}else{
-    to_zero++;
-}
-#endif
-                for(; last_non_zero>=start_i; last_non_zero--){
-                    if(block[perm_scantable[last_non_zero]])
-                        break;
-                }
-            }
-#ifdef REFINE_STATS
-count++;
-if(256*256*256*64 % count == 0){
-    printf("after_last:%d to_zero:%d from_zero:%d raise:%d lower:%d sign:%d xyp:%d/%d/%d\n", after_last, to_zero, from_zero, raise, lower, messed_sign, s->mb_x, s->mb_y, s->picture_number);
-}
-#endif
-            run=0;
-            rle_index=0;
-            for(i=start_i; i<=last_non_zero; i++){
-                int j= perm_scantable[i];
-                const int level= block[j];
-
-                 if(level){
-                     run_tab[rle_index++]=run;
-                     run=0;
-                 }else{
-                     run++;
-                 }
-            }
-
-            s->dsp.add_8x8basis(rem, basis[j], best_unquant_change);
-        }else{
-            break;
-        }
-    }
-#ifdef REFINE_STATS
-if(last_non_zero>0){
-STOP_TIMER("iterative search")
-}
-}
-#endif
-
-    return last_non_zero;
-}
-
-int ff_dct_quantize_c(MpegEncContext *s,
-                        int16_t *block, int n,
-                        int qscale, int *overflow)
-{
-    int i, j, level, last_non_zero, q, start_i;
-    const int *qmat;
-    const uint8_t *scantable= s->intra_scantable.scantable;
-    int bias;
-    int max=0;
-    unsigned int threshold1, threshold2;
-
-    s->dsp.fdct (block);
-
-    if(s->dct_error_sum)
-        s->denoise_dct(s, block);
-
-    if (s->mb_intra) {
-        if (!s->h263_aic) {
-            if (n < 4)
-                q = s->y_dc_scale;
-            else
-                q = s->c_dc_scale;
-            q = q << 3;
-        } else
-            /* For AIC we skip quant/dequant of INTRADC */
-            q = 1 << 3;
-
-        /* note: block[0] is assumed to be positive */
-        block[0] = (block[0] + (q >> 1)) / q;
-        start_i = 1;
-        last_non_zero = 0;
-        qmat = s->q_intra_matrix[qscale];
-        bias= s->intra_quant_bias<<(QMAT_SHIFT - QUANT_BIAS_SHIFT);
-    } else {
-        start_i = 0;
-        last_non_zero = -1;
-        qmat = s->q_inter_matrix[qscale];
-        bias= s->inter_quant_bias<<(QMAT_SHIFT - QUANT_BIAS_SHIFT);
-    }
-    threshold1= (1<<QMAT_SHIFT) - bias - 1;
-    threshold2= (threshold1<<1);
-    for(i=63;i>=start_i;i--) {
-        j = scantable[i];
-        level = block[j] * qmat[j];
-
-        if(((unsigned)(level+threshold1))>threshold2){
-            last_non_zero = i;
-            break;
-        }else{
-            block[j]=0;
-        }
-    }
-    for(i=start_i; i<=last_non_zero; i++) {
-        j = scantable[i];
-        level = block[j] * qmat[j];
-
-//        if(   bias+level >= (1<<QMAT_SHIFT)
-//           || bias-level >= (1<<QMAT_SHIFT)){
-        if(((unsigned)(level+threshold1))>threshold2){
-            if(level>0){
-                level= (bias + level)>>QMAT_SHIFT;
-                block[j]= level;
-            }else{
-                level= (bias - level)>>QMAT_SHIFT;
-                block[j]= -level;
-            }
-            max |=level;
-        }else{
-            block[j]=0;
-        }
-    }
-    *overflow= s->max_qcoeff < max; //overflow might have happened
-
-    /* we need this permutation so that we correct the IDCT, we only permute the !=0 elements */
-    if (s->dsp.idct_permutation_type != FF_NO_IDCT_PERM)
-        ff_block_permute(block, s->dsp.idct_permutation, scantable, last_non_zero);
-
-    return last_non_zero;
-}
-
-#define OFFSET(x) offsetof(MpegEncContext, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption h263_options[] = {
-    { "obmc",         "use overlapped block motion compensation.", OFFSET(obmc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
-    { "structured_slices","Write slice start position at every GOB header instead of just GOB number.", OFFSET(h263_slice_structured), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE},
-    { "mb_info",      "emit macroblock info for RFC 2190 packetization, the parameter value is the maximum payload size", OFFSET(mb_info), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
-    FF_MPV_COMMON_OPTS
-    { NULL },
-};
-
-static const AVClass h263_class = {
-    .class_name = "H.263 encoder",
-    .item_name  = av_default_item_name,
-    .option     = h263_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_h263_encoder = {
-    .name           = "h263",
-    .long_name      = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H263,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts= (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE},
-    .priv_class     = &h263_class,
-};
-
-static const AVOption h263p_options[] = {
-    { "umv",        "Use unlimited motion vectors.",    OFFSET(umvplus), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
-    { "aiv",        "Use alternative inter VLC.",       OFFSET(alt_inter_vlc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
-    { "obmc",       "use overlapped block motion compensation.", OFFSET(obmc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
-    { "structured_slices", "Write slice start position at every GOB header instead of just GOB number.", OFFSET(h263_slice_structured), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE},
-    FF_MPV_COMMON_OPTS
-    { NULL },
-};
-static const AVClass h263p_class = {
-    .class_name = "H.263p encoder",
-    .item_name  = av_default_item_name,
-    .option     = h263p_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_h263p_encoder = {
-    .name           = "h263p",
-    .long_name      = NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H263P,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .capabilities   = CODEC_CAP_SLICE_THREADS,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &h263p_class,
-};
-
-FF_MPV_GENERIC_CLASS(msmpeg4v2)
-
-AVCodec ff_msmpeg4v2_encoder = {
-    .name           = "msmpeg4v2",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSMPEG4V2,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &msmpeg4v2_class,
-};
-
-FF_MPV_GENERIC_CLASS(msmpeg4v3)
-
-AVCodec ff_msmpeg4v3_encoder = {
-    .name           = "msmpeg4",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSMPEG4V3,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &msmpeg4v3_class,
-};
-
-FF_MPV_GENERIC_CLASS(wmv1)
-
-AVCodec ff_wmv1_encoder = {
-    .name           = "wmv1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Video 7"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WMV1,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &wmv1_class,
-};
diff --git a/deps/libav/libavcodec/mpegvideo_motion.c b/deps/libav/libavcodec/mpegvideo_motion.c
deleted file mode 100644
index 42def5e..0000000
--- a/deps/libav/libavcodec/mpegvideo_motion.c
+++ /dev/null
@@ -1,982 +0,0 @@
-/*
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * 4MV & hq & B-frame encoding stuff by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/internal.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "h261.h"
-#include "mpegvideo.h"
-#include "mjpegenc.h"
-#include "msmpeg4.h"
-#include <limits.h>
-
-static void gmc1_motion(MpegEncContext *s,
-                        uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
-                        uint8_t **ref_picture)
-{
-    uint8_t *ptr;
-    int src_x, src_y, motion_x, motion_y;
-    ptrdiff_t offset, linesize, uvlinesize;
-    int emu = 0;
-
-    motion_x   = s->sprite_offset[0][0];
-    motion_y   = s->sprite_offset[0][1];
-    src_x      = s->mb_x * 16 + (motion_x >> (s->sprite_warping_accuracy + 1));
-    src_y      = s->mb_y * 16 + (motion_y >> (s->sprite_warping_accuracy + 1));
-    motion_x <<= (3 - s->sprite_warping_accuracy);
-    motion_y <<= (3 - s->sprite_warping_accuracy);
-    src_x      = av_clip(src_x, -16, s->width);
-    if (src_x == s->width)
-        motion_x = 0;
-    src_y = av_clip(src_y, -16, s->height);
-    if (src_y == s->height)
-        motion_y = 0;
-
-    linesize   = s->linesize;
-    uvlinesize = s->uvlinesize;
-
-    ptr = ref_picture[0] + src_y * linesize + src_x;
-
-    if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) ||
-        (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
-                                 linesize, linesize,
-                                 17, 17,
-                                 src_x, src_y,
-                                 s->h_edge_pos, s->v_edge_pos);
-        ptr = s->edge_emu_buffer;
-    }
-
-    if ((motion_x | motion_y) & 7) {
-        s->dsp.gmc1(dest_y, ptr, linesize, 16,
-                    motion_x & 15, motion_y & 15, 128 - s->no_rounding);
-        s->dsp.gmc1(dest_y + 8, ptr + 8, linesize, 16,
-                    motion_x & 15, motion_y & 15, 128 - s->no_rounding);
-    } else {
-        int dxy;
-
-        dxy = ((motion_x >> 3) & 1) | ((motion_y >> 2) & 2);
-        if (s->no_rounding) {
-            s->hdsp.put_no_rnd_pixels_tab[0][dxy](dest_y, ptr, linesize, 16);
-        } else {
-            s->hdsp.put_pixels_tab[0][dxy](dest_y, ptr, linesize, 16);
-        }
-    }
-
-    if (CONFIG_GRAY && s->flags & CODEC_FLAG_GRAY)
-        return;
-
-    motion_x   = s->sprite_offset[1][0];
-    motion_y   = s->sprite_offset[1][1];
-    src_x      = s->mb_x * 8 + (motion_x >> (s->sprite_warping_accuracy + 1));
-    src_y      = s->mb_y * 8 + (motion_y >> (s->sprite_warping_accuracy + 1));
-    motion_x <<= (3 - s->sprite_warping_accuracy);
-    motion_y <<= (3 - s->sprite_warping_accuracy);
-    src_x      = av_clip(src_x, -8, s->width >> 1);
-    if (src_x == s->width >> 1)
-        motion_x = 0;
-    src_y = av_clip(src_y, -8, s->height >> 1);
-    if (src_y == s->height >> 1)
-        motion_y = 0;
-
-    offset = (src_y * uvlinesize) + src_x;
-    ptr    = ref_picture[1] + offset;
-    if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) ||
-        (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
-                                 uvlinesize, uvlinesize,
-                                 9, 9,
-                                 src_x, src_y,
-                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-        ptr = s->edge_emu_buffer;
-        emu = 1;
-    }
-    s->dsp.gmc1(dest_cb, ptr, uvlinesize, 8,
-                motion_x & 15, motion_y & 15, 128 - s->no_rounding);
-
-    ptr = ref_picture[2] + offset;
-    if (emu) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
-                                 uvlinesize, uvlinesize,
-                                 9, 9,
-                                 src_x, src_y,
-                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-        ptr = s->edge_emu_buffer;
-    }
-    s->dsp.gmc1(dest_cr, ptr, uvlinesize, 8,
-                motion_x & 15, motion_y & 15, 128 - s->no_rounding);
-}
-
-static void gmc_motion(MpegEncContext *s,
-                       uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
-                       uint8_t **ref_picture)
-{
-    uint8_t *ptr;
-    int linesize, uvlinesize;
-    const int a = s->sprite_warping_accuracy;
-    int ox, oy;
-
-    linesize   = s->linesize;
-    uvlinesize = s->uvlinesize;
-
-    ptr = ref_picture[0];
-
-    ox = s->sprite_offset[0][0] + s->sprite_delta[0][0] * s->mb_x * 16 +
-         s->sprite_delta[0][1] * s->mb_y * 16;
-    oy = s->sprite_offset[0][1] + s->sprite_delta[1][0] * s->mb_x * 16 +
-         s->sprite_delta[1][1] * s->mb_y * 16;
-
-    s->dsp.gmc(dest_y, ptr, linesize, 16,
-               ox, oy,
-               s->sprite_delta[0][0], s->sprite_delta[0][1],
-               s->sprite_delta[1][0], s->sprite_delta[1][1],
-               a + 1, (1 << (2 * a + 1)) - s->no_rounding,
-               s->h_edge_pos, s->v_edge_pos);
-    s->dsp.gmc(dest_y + 8, ptr, linesize, 16,
-               ox + s->sprite_delta[0][0] * 8,
-               oy + s->sprite_delta[1][0] * 8,
-               s->sprite_delta[0][0], s->sprite_delta[0][1],
-               s->sprite_delta[1][0], s->sprite_delta[1][1],
-               a + 1, (1 << (2 * a + 1)) - s->no_rounding,
-               s->h_edge_pos, s->v_edge_pos);
-
-    if (CONFIG_GRAY && s->flags & CODEC_FLAG_GRAY)
-        return;
-
-    ox = s->sprite_offset[1][0] + s->sprite_delta[0][0] * s->mb_x * 8 +
-         s->sprite_delta[0][1] * s->mb_y * 8;
-    oy = s->sprite_offset[1][1] + s->sprite_delta[1][0] * s->mb_x * 8 +
-         s->sprite_delta[1][1] * s->mb_y * 8;
-
-    ptr = ref_picture[1];
-    s->dsp.gmc(dest_cb, ptr, uvlinesize, 8,
-               ox, oy,
-               s->sprite_delta[0][0], s->sprite_delta[0][1],
-               s->sprite_delta[1][0], s->sprite_delta[1][1],
-               a + 1, (1 << (2 * a + 1)) - s->no_rounding,
-               s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-
-    ptr = ref_picture[2];
-    s->dsp.gmc(dest_cr, ptr, uvlinesize, 8,
-               ox, oy,
-               s->sprite_delta[0][0], s->sprite_delta[0][1],
-               s->sprite_delta[1][0], s->sprite_delta[1][1],
-               a + 1, (1 << (2 * a + 1)) - s->no_rounding,
-               s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-}
-
-static inline int hpel_motion(MpegEncContext *s,
-                              uint8_t *dest, uint8_t *src,
-                              int src_x, int src_y,
-                              op_pixels_func *pix_op,
-                              int motion_x, int motion_y)
-{
-    int dxy = 0;
-    int emu = 0;
-
-    src_x += motion_x >> 1;
-    src_y += motion_y >> 1;
-
-    /* WARNING: do no forget half pels */
-    src_x = av_clip(src_x, -16, s->width); // FIXME unneeded for emu?
-    if (src_x != s->width)
-        dxy |= motion_x & 1;
-    src_y = av_clip(src_y, -16, s->height);
-    if (src_y != s->height)
-        dxy |= (motion_y & 1) << 1;
-    src += src_y * s->linesize + src_x;
-
-    if (s->unrestricted_mv) {
-        if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 1) - 8, 0) ||
-            (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 1) - 8, 0)) {
-            s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src,
-                                     s->linesize, s->linesize,
-                                     9, 9,
-                                     src_x, src_y, s->h_edge_pos,
-                                     s->v_edge_pos);
-            src = s->edge_emu_buffer;
-            emu = 1;
-        }
-    }
-    pix_op[dxy](dest, src, s->linesize, 8);
-    return emu;
-}
-
-static av_always_inline
-void mpeg_motion_internal(MpegEncContext *s,
-                          uint8_t *dest_y,
-                          uint8_t *dest_cb,
-                          uint8_t *dest_cr,
-                          int field_based,
-                          int bottom_field,
-                          int field_select,
-                          uint8_t **ref_picture,
-                          op_pixels_func (*pix_op)[4],
-                          int motion_x,
-                          int motion_y,
-                          int h,
-                          int is_mpeg12,
-                          int mb_y)
-{
-    uint8_t *ptr_y, *ptr_cb, *ptr_cr;
-    int dxy, uvdxy, mx, my, src_x, src_y,
-        uvsrc_x, uvsrc_y, v_edge_pos;
-    ptrdiff_t uvlinesize, linesize;
-
-#if 0
-    if (s->quarter_sample) {
-        motion_x >>= 1;
-        motion_y >>= 1;
-    }
-#endif
-
-    v_edge_pos = s->v_edge_pos >> field_based;
-    linesize   = s->current_picture.f.linesize[0] << field_based;
-    uvlinesize = s->current_picture.f.linesize[1] << field_based;
-
-    dxy   = ((motion_y & 1) << 1) | (motion_x & 1);
-    src_x = s->mb_x * 16 + (motion_x >> 1);
-    src_y = (mb_y << (4 - field_based)) + (motion_y >> 1);
-
-    if (!is_mpeg12 && s->out_format == FMT_H263) {
-        if ((s->workaround_bugs & FF_BUG_HPEL_CHROMA) && field_based) {
-            mx      = (motion_x >> 1) | (motion_x & 1);
-            my      = motion_y >> 1;
-            uvdxy   = ((my & 1) << 1) | (mx & 1);
-            uvsrc_x = s->mb_x * 8 + (mx >> 1);
-            uvsrc_y = (mb_y << (3 - field_based)) + (my >> 1);
-        } else {
-            uvdxy   = dxy | (motion_y & 2) | ((motion_x & 2) >> 1);
-            uvsrc_x = src_x >> 1;
-            uvsrc_y = src_y >> 1;
-        }
-    // Even chroma mv's are full pel in H261
-    } else if (!is_mpeg12 && s->out_format == FMT_H261) {
-        mx      = motion_x / 4;
-        my      = motion_y / 4;
-        uvdxy   = 0;
-        uvsrc_x = s->mb_x * 8 + mx;
-        uvsrc_y = mb_y * 8 + my;
-    } else {
-        if (s->chroma_y_shift) {
-            mx      = motion_x / 2;
-            my      = motion_y / 2;
-            uvdxy   = ((my & 1) << 1) | (mx & 1);
-            uvsrc_x = s->mb_x * 8 + (mx >> 1);
-            uvsrc_y = (mb_y << (3 - field_based)) + (my >> 1);
-        } else {
-            if (s->chroma_x_shift) {
-                // Chroma422
-                mx      = motion_x / 2;
-                uvdxy   = ((motion_y & 1) << 1) | (mx & 1);
-                uvsrc_x = s->mb_x * 8 + (mx >> 1);
-                uvsrc_y = src_y;
-            } else {
-                // Chroma444
-                uvdxy   = dxy;
-                uvsrc_x = src_x;
-                uvsrc_y = src_y;
-            }
-        }
-    }
-
-    ptr_y  = ref_picture[0] + src_y * linesize + src_x;
-    ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
-    ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
-
-    if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 1) - 16, 0) ||
-        (unsigned)src_y > FFMAX(v_edge_pos - (motion_y & 1) - h, 0)) {
-        if (is_mpeg12 ||
-            s->codec_id == AV_CODEC_ID_MPEG2VIDEO ||
-            s->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
-            av_log(s->avctx, AV_LOG_DEBUG,
-                   "MPEG motion vector out of boundary (%d %d)\n", src_x,
-                   src_y);
-            return;
-        }
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,
-                                 s->linesize, s->linesize,
-                                 17, 17 + field_based,
-                                 src_x, src_y << field_based,
-                                 s->h_edge_pos, s->v_edge_pos);
-        ptr_y = s->edge_emu_buffer;
-        if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
-            uint8_t *uvbuf = s->edge_emu_buffer + 18 * s->linesize;
-            s->vdsp.emulated_edge_mc(uvbuf, ptr_cb,
-                                     s->uvlinesize, s->uvlinesize,
-                                     9, 9 + field_based,
-                                     uvsrc_x, uvsrc_y << field_based,
-                                     s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-            s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr,
-                                     s->uvlinesize, s->uvlinesize,
-                                     9, 9 + field_based,
-                                     uvsrc_x, uvsrc_y << field_based,
-                                     s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-            ptr_cb = uvbuf;
-            ptr_cr = uvbuf + 16;
-        }
-    }
-
-    /* FIXME use this for field pix too instead of the obnoxious hack which
-     * changes picture.data */
-    if (bottom_field) {
-        dest_y  += s->linesize;
-        dest_cb += s->uvlinesize;
-        dest_cr += s->uvlinesize;
-    }
-
-    if (field_select) {
-        ptr_y  += s->linesize;
-        ptr_cb += s->uvlinesize;
-        ptr_cr += s->uvlinesize;
-    }
-
-    pix_op[0][dxy](dest_y, ptr_y, linesize, h);
-
-    if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
-        pix_op[s->chroma_x_shift][uvdxy]
-            (dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift);
-        pix_op[s->chroma_x_shift][uvdxy]
-            (dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift);
-    }
-    if (!is_mpeg12 && (CONFIG_H261_ENCODER || CONFIG_H261_DECODER) &&
-        s->out_format == FMT_H261) {
-        ff_h261_loop_filter(s);
-    }
-}
-/* apply one mpeg motion vector to the three components */
-static void mpeg_motion(MpegEncContext *s,
-                        uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
-                        int field_select, uint8_t **ref_picture,
-                        op_pixels_func (*pix_op)[4],
-                        int motion_x, int motion_y, int h, int mb_y)
-{
-#if !CONFIG_SMALL
-    if (s->out_format == FMT_MPEG1)
-        mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 0, 0,
-                             field_select, ref_picture, pix_op,
-                             motion_x, motion_y, h, 1, mb_y);
-    else
-#endif
-        mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 0, 0,
-                             field_select, ref_picture, pix_op,
-                             motion_x, motion_y, h, 0, mb_y);
-}
-
-static void mpeg_motion_field(MpegEncContext *s, uint8_t *dest_y,
-                              uint8_t *dest_cb, uint8_t *dest_cr,
-                              int bottom_field, int field_select,
-                              uint8_t **ref_picture,
-                              op_pixels_func (*pix_op)[4],
-                              int motion_x, int motion_y, int h, int mb_y)
-{
-#if !CONFIG_SMALL
-    if(s->out_format == FMT_MPEG1)
-        mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 1,
-                             bottom_field, field_select, ref_picture, pix_op,
-                             motion_x, motion_y, h, 1, mb_y);
-    else
-#endif
-        mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 1,
-                             bottom_field, field_select, ref_picture, pix_op,
-                             motion_x, motion_y, h, 0, mb_y);
-}
-
-// FIXME move to dsputil, avg variant, 16x16 version
-static inline void put_obmc(uint8_t *dst, uint8_t *src[5], int stride)
-{
-    int x;
-    uint8_t *const top    = src[1];
-    uint8_t *const left   = src[2];
-    uint8_t *const mid    = src[0];
-    uint8_t *const right  = src[3];
-    uint8_t *const bottom = src[4];
-#define OBMC_FILTER(x, t, l, m, r, b)\
-    dst[x]= (t*top[x] + l*left[x] + m*mid[x] + r*right[x] + b*bottom[x] + 4)>>3
-#define OBMC_FILTER4(x, t, l, m, r, b)\
-    OBMC_FILTER(x         , t, l, m, r, b);\
-    OBMC_FILTER(x+1       , t, l, m, r, b);\
-    OBMC_FILTER(x  +stride, t, l, m, r, b);\
-    OBMC_FILTER(x+1+stride, t, l, m, r, b);
-
-    x = 0;
-    OBMC_FILTER (x    , 2, 2, 4, 0, 0);
-    OBMC_FILTER (x + 1, 2, 1, 5, 0, 0);
-    OBMC_FILTER4(x + 2, 2, 1, 5, 0, 0);
-    OBMC_FILTER4(x + 4, 2, 0, 5, 1, 0);
-    OBMC_FILTER (x + 6, 2, 0, 5, 1, 0);
-    OBMC_FILTER (x + 7, 2, 0, 4, 2, 0);
-    x += stride;
-    OBMC_FILTER (x    , 1, 2, 5, 0, 0);
-    OBMC_FILTER (x + 1, 1, 2, 5, 0, 0);
-    OBMC_FILTER (x + 6, 1, 0, 5, 2, 0);
-    OBMC_FILTER (x + 7, 1, 0, 5, 2, 0);
-    x += stride;
-    OBMC_FILTER4(x    , 1, 2, 5, 0, 0);
-    OBMC_FILTER4(x + 2, 1, 1, 6, 0, 0);
-    OBMC_FILTER4(x + 4, 1, 0, 6, 1, 0);
-    OBMC_FILTER4(x + 6, 1, 0, 5, 2, 0);
-    x += 2 * stride;
-    OBMC_FILTER4(x    , 0, 2, 5, 0, 1);
-    OBMC_FILTER4(x + 2, 0, 1, 6, 0, 1);
-    OBMC_FILTER4(x + 4, 0, 0, 6, 1, 1);
-    OBMC_FILTER4(x + 6, 0, 0, 5, 2, 1);
-    x += 2*stride;
-    OBMC_FILTER (x    , 0, 2, 5, 0, 1);
-    OBMC_FILTER (x + 1, 0, 2, 5, 0, 1);
-    OBMC_FILTER4(x + 2, 0, 1, 5, 0, 2);
-    OBMC_FILTER4(x + 4, 0, 0, 5, 1, 2);
-    OBMC_FILTER (x + 6, 0, 0, 5, 2, 1);
-    OBMC_FILTER (x + 7, 0, 0, 5, 2, 1);
-    x += stride;
-    OBMC_FILTER (x    , 0, 2, 4, 0, 2);
-    OBMC_FILTER (x + 1, 0, 1, 5, 0, 2);
-    OBMC_FILTER (x + 6, 0, 0, 5, 1, 2);
-    OBMC_FILTER (x + 7, 0, 0, 4, 2, 2);
-}
-
-/* obmc for 1 8x8 luma block */
-static inline void obmc_motion(MpegEncContext *s,
-                               uint8_t *dest, uint8_t *src,
-                               int src_x, int src_y,
-                               op_pixels_func *pix_op,
-                               int16_t mv[5][2] /* mid top left right bottom */)
-#define MID    0
-{
-    int i;
-    uint8_t *ptr[5];
-
-    assert(s->quarter_sample == 0);
-
-    for (i = 0; i < 5; i++) {
-        if (i && mv[i][0] == mv[MID][0] && mv[i][1] == mv[MID][1]) {
-            ptr[i] = ptr[MID];
-        } else {
-            ptr[i] = s->obmc_scratchpad + 8 * (i & 1) +
-                     s->linesize * 8 * (i >> 1);
-            hpel_motion(s, ptr[i], src, src_x, src_y, pix_op,
-                        mv[i][0], mv[i][1]);
-        }
-    }
-
-    put_obmc(dest, ptr, s->linesize);
-}
-
-static inline void qpel_motion(MpegEncContext *s,
-                               uint8_t *dest_y,
-                               uint8_t *dest_cb,
-                               uint8_t *dest_cr,
-                               int field_based, int bottom_field,
-                               int field_select, uint8_t **ref_picture,
-                               op_pixels_func (*pix_op)[4],
-                               qpel_mc_func (*qpix_op)[16],
-                               int motion_x, int motion_y, int h)
-{
-    uint8_t *ptr_y, *ptr_cb, *ptr_cr;
-    int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos;
-    ptrdiff_t linesize, uvlinesize;
-
-    dxy   = ((motion_y & 3) << 2) | (motion_x & 3);
-
-    src_x = s->mb_x *  16                 + (motion_x >> 2);
-    src_y = s->mb_y * (16 >> field_based) + (motion_y >> 2);
-
-    v_edge_pos = s->v_edge_pos >> field_based;
-    linesize   = s->linesize   << field_based;
-    uvlinesize = s->uvlinesize << field_based;
-
-    if (field_based) {
-        mx = motion_x / 2;
-        my = motion_y >> 1;
-    } else if (s->workaround_bugs & FF_BUG_QPEL_CHROMA2) {
-        static const int rtab[8] = { 0, 0, 1, 1, 0, 0, 0, 1 };
-        mx = (motion_x >> 1) + rtab[motion_x & 7];
-        my = (motion_y >> 1) + rtab[motion_y & 7];
-    } else if (s->workaround_bugs & FF_BUG_QPEL_CHROMA) {
-        mx = (motion_x >> 1) | (motion_x & 1);
-        my = (motion_y >> 1) | (motion_y & 1);
-    } else {
-        mx = motion_x / 2;
-        my = motion_y / 2;
-    }
-    mx = (mx >> 1) | (mx & 1);
-    my = (my >> 1) | (my & 1);
-
-    uvdxy = (mx & 1) | ((my & 1) << 1);
-    mx  >>= 1;
-    my  >>= 1;
-
-    uvsrc_x = s->mb_x *  8                 + mx;
-    uvsrc_y = s->mb_y * (8 >> field_based) + my;
-
-    ptr_y  = ref_picture[0] + src_y   * linesize   + src_x;
-    ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
-    ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
-
-    if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 3) - 16, 0) ||
-        (unsigned)src_y > FFMAX(v_edge_pos - (motion_y & 3) - h, 0)) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,
-                                 s->linesize, s->linesize,
-                                 17, 17 + field_based,
-                                 src_x, src_y << field_based,
-                                 s->h_edge_pos, s->v_edge_pos);
-        ptr_y = s->edge_emu_buffer;
-        if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
-            uint8_t *uvbuf = s->edge_emu_buffer + 18 * s->linesize;
-            s->vdsp.emulated_edge_mc(uvbuf, ptr_cb,
-                                     s->uvlinesize, s->uvlinesize,
-                                     9, 9 + field_based,
-                                     uvsrc_x, uvsrc_y << field_based,
-                                     s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-            s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr,
-                                     s->uvlinesize, s->uvlinesize,
-                                     9, 9 + field_based,
-                                     uvsrc_x, uvsrc_y << field_based,
-                                     s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-            ptr_cb = uvbuf;
-            ptr_cr = uvbuf + 16;
-        }
-    }
-
-    if (!field_based)
-        qpix_op[0][dxy](dest_y, ptr_y, linesize);
-    else {
-        if (bottom_field) {
-            dest_y  += s->linesize;
-            dest_cb += s->uvlinesize;
-            dest_cr += s->uvlinesize;
-        }
-
-        if (field_select) {
-            ptr_y  += s->linesize;
-            ptr_cb += s->uvlinesize;
-            ptr_cr += s->uvlinesize;
-        }
-        // damn interlaced mode
-        // FIXME boundary mirroring is not exactly correct here
-        qpix_op[1][dxy](dest_y, ptr_y, linesize);
-        qpix_op[1][dxy](dest_y + 8, ptr_y + 8, linesize);
-    }
-    if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
-        pix_op[1][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> 1);
-        pix_op[1][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> 1);
-    }
-}
-
-/**
- * h263 chroma 4mv motion compensation.
- */
-static void chroma_4mv_motion(MpegEncContext *s,
-                              uint8_t *dest_cb, uint8_t *dest_cr,
-                              uint8_t **ref_picture,
-                              op_pixels_func *pix_op,
-                              int mx, int my)
-{
-    uint8_t *ptr;
-    int src_x, src_y, dxy, emu = 0;
-    ptrdiff_t offset;
-
-    /* In case of 8X8, we construct a single chroma motion vector
-     * with a special rounding */
-    mx = ff_h263_round_chroma(mx);
-    my = ff_h263_round_chroma(my);
-
-    dxy  = ((my & 1) << 1) | (mx & 1);
-    mx >>= 1;
-    my >>= 1;
-
-    src_x = s->mb_x * 8 + mx;
-    src_y = s->mb_y * 8 + my;
-    src_x = av_clip(src_x, -8, (s->width >> 1));
-    if (src_x == (s->width >> 1))
-        dxy &= ~1;
-    src_y = av_clip(src_y, -8, (s->height >> 1));
-    if (src_y == (s->height >> 1))
-        dxy &= ~2;
-
-    offset = src_y * s->uvlinesize + src_x;
-    ptr    = ref_picture[1] + offset;
-    if ((unsigned)src_x > FFMAX((s->h_edge_pos >> 1) - (dxy & 1) - 8, 0) ||
-        (unsigned)src_y > FFMAX((s->v_edge_pos >> 1) - (dxy >> 1) - 8, 0)) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
-                                 s->uvlinesize, s->uvlinesize,
-                                 9, 9, src_x, src_y,
-                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-        ptr = s->edge_emu_buffer;
-        emu = 1;
-    }
-    pix_op[dxy](dest_cb, ptr, s->uvlinesize, 8);
-
-    ptr = ref_picture[2] + offset;
-    if (emu) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
-                                 s->uvlinesize, s->uvlinesize,
-                                 9, 9, src_x, src_y,
-                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-        ptr = s->edge_emu_buffer;
-    }
-    pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8);
-}
-
-static inline void prefetch_motion(MpegEncContext *s, uint8_t **pix, int dir)
-{
-    /* fetch pixels for estimated mv 4 macroblocks ahead
-     * optimized for 64byte cache lines */
-    const int shift = s->quarter_sample ? 2 : 1;
-    const int mx    = (s->mv[dir][0][0] >> shift) + 16 * s->mb_x + 8;
-    const int my    = (s->mv[dir][0][1] >> shift) + 16 * s->mb_y;
-    int off         = mx + (my + (s->mb_x & 3) * 4) * s->linesize + 64;
-
-    s->vdsp.prefetch(pix[0] + off, s->linesize, 4);
-    off = (mx >> 1) + ((my >> 1) + (s->mb_x & 7)) * s->uvlinesize + 64;
-    s->vdsp.prefetch(pix[1] + off, pix[2] - pix[1], 2);
-}
-
-static inline void apply_obmc(MpegEncContext *s,
-                              uint8_t *dest_y,
-                              uint8_t *dest_cb,
-                              uint8_t *dest_cr,
-                              uint8_t **ref_picture,
-                              op_pixels_func (*pix_op)[4])
-{
-    LOCAL_ALIGNED_8(int16_t, mv_cache, [4], [4][2]);
-    Picture *cur_frame   = &s->current_picture;
-    int mb_x = s->mb_x;
-    int mb_y = s->mb_y;
-    const int xy         = mb_x + mb_y * s->mb_stride;
-    const int mot_stride = s->b8_stride;
-    const int mot_xy     = mb_x * 2 + mb_y * 2 * mot_stride;
-    int mx, my, i;
-
-    assert(!s->mb_skipped);
-
-    AV_COPY32(mv_cache[1][1], cur_frame->motion_val[0][mot_xy]);
-    AV_COPY32(mv_cache[1][2], cur_frame->motion_val[0][mot_xy + 1]);
-
-    AV_COPY32(mv_cache[2][1],
-              cur_frame->motion_val[0][mot_xy + mot_stride]);
-    AV_COPY32(mv_cache[2][2],
-              cur_frame->motion_val[0][mot_xy + mot_stride + 1]);
-
-    AV_COPY32(mv_cache[3][1],
-              cur_frame->motion_val[0][mot_xy + mot_stride]);
-    AV_COPY32(mv_cache[3][2],
-              cur_frame->motion_val[0][mot_xy + mot_stride + 1]);
-
-    if (mb_y == 0 || IS_INTRA(cur_frame->mb_type[xy - s->mb_stride])) {
-        AV_COPY32(mv_cache[0][1], mv_cache[1][1]);
-        AV_COPY32(mv_cache[0][2], mv_cache[1][2]);
-    } else {
-        AV_COPY32(mv_cache[0][1],
-                  cur_frame->motion_val[0][mot_xy - mot_stride]);
-        AV_COPY32(mv_cache[0][2],
-                  cur_frame->motion_val[0][mot_xy - mot_stride + 1]);
-    }
-
-    if (mb_x == 0 || IS_INTRA(cur_frame->mb_type[xy - 1])) {
-        AV_COPY32(mv_cache[1][0], mv_cache[1][1]);
-        AV_COPY32(mv_cache[2][0], mv_cache[2][1]);
-    } else {
-        AV_COPY32(mv_cache[1][0], cur_frame->motion_val[0][mot_xy - 1]);
-        AV_COPY32(mv_cache[2][0],
-                  cur_frame->motion_val[0][mot_xy - 1 + mot_stride]);
-    }
-
-    if (mb_x + 1 >= s->mb_width || IS_INTRA(cur_frame->mb_type[xy + 1])) {
-        AV_COPY32(mv_cache[1][3], mv_cache[1][2]);
-        AV_COPY32(mv_cache[2][3], mv_cache[2][2]);
-    } else {
-        AV_COPY32(mv_cache[1][3], cur_frame->motion_val[0][mot_xy + 2]);
-        AV_COPY32(mv_cache[2][3],
-                  cur_frame->motion_val[0][mot_xy + 2 + mot_stride]);
-    }
-
-    mx = 0;
-    my = 0;
-    for (i = 0; i < 4; i++) {
-        const int x      = (i & 1) + 1;
-        const int y      = (i >> 1) + 1;
-        int16_t mv[5][2] = {
-            { mv_cache[y][x][0],     mv_cache[y][x][1]         },
-            { mv_cache[y - 1][x][0], mv_cache[y - 1][x][1]     },
-            { mv_cache[y][x - 1][0], mv_cache[y][x - 1][1]     },
-            { mv_cache[y][x + 1][0], mv_cache[y][x + 1][1]     },
-            { mv_cache[y + 1][x][0], mv_cache[y + 1][x][1]     }
-        };
-        // FIXME cleanup
-        obmc_motion(s, dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize,
-                    ref_picture[0],
-                    mb_x * 16 + (i & 1) * 8, mb_y * 16 + (i >> 1) * 8,
-                    pix_op[1],
-                    mv);
-
-        mx += mv[0][0];
-        my += mv[0][1];
-    }
-    if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY))
-        chroma_4mv_motion(s, dest_cb, dest_cr,
-                          ref_picture, pix_op[1],
-                          mx, my);
-}
-
-static inline void apply_8x8(MpegEncContext *s,
-                             uint8_t *dest_y,
-                             uint8_t *dest_cb,
-                             uint8_t *dest_cr,
-                             int dir,
-                             uint8_t **ref_picture,
-                             qpel_mc_func (*qpix_op)[16],
-                             op_pixels_func (*pix_op)[4])
-{
-    int dxy, mx, my, src_x, src_y;
-    int i;
-    int mb_x = s->mb_x;
-    int mb_y = s->mb_y;
-    uint8_t *ptr, *dest;
-
-    mx = 0;
-    my = 0;
-    if (s->quarter_sample) {
-        for (i = 0; i < 4; i++) {
-            int motion_x = s->mv[dir][i][0];
-            int motion_y = s->mv[dir][i][1];
-
-            dxy   = ((motion_y & 3) << 2) | (motion_x & 3);
-            src_x = mb_x * 16 + (motion_x >> 2) + (i & 1) * 8;
-            src_y = mb_y * 16 + (motion_y >> 2) + (i >> 1) * 8;
-
-            /* WARNING: do no forget half pels */
-            src_x = av_clip(src_x, -16, s->width);
-            if (src_x == s->width)
-                dxy &= ~3;
-            src_y = av_clip(src_y, -16, s->height);
-            if (src_y == s->height)
-                dxy &= ~12;
-
-            ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);
-            if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 3) - 8, 0) ||
-                (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 3) - 8, 0)) {
-                s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
-                                         s->linesize, s->linesize,
-                                         9, 9,
-                                         src_x, src_y,
-                                         s->h_edge_pos,
-                                         s->v_edge_pos);
-                ptr = s->edge_emu_buffer;
-            }
-            dest = dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize;
-            qpix_op[1][dxy](dest, ptr, s->linesize);
-
-            mx += s->mv[dir][i][0] / 2;
-            my += s->mv[dir][i][1] / 2;
-        }
-    } else {
-        for (i = 0; i < 4; i++) {
-            hpel_motion(s,
-                        dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize,
-                        ref_picture[0],
-                        mb_x * 16 + (i & 1) * 8,
-                        mb_y * 16 + (i >> 1) * 8,
-                        pix_op[1],
-                        s->mv[dir][i][0],
-                        s->mv[dir][i][1]);
-
-            mx += s->mv[dir][i][0];
-            my += s->mv[dir][i][1];
-        }
-    }
-
-    if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY))
-        chroma_4mv_motion(s, dest_cb, dest_cr,
-                          ref_picture, pix_op[1], mx, my);
-}
-
-/**
- * motion compensation of a single macroblock
- * @param s context
- * @param dest_y luma destination pointer
- * @param dest_cb chroma cb/u destination pointer
- * @param dest_cr chroma cr/v destination pointer
- * @param dir direction (0->forward, 1->backward)
- * @param ref_picture array[3] of pointers to the 3 planes of the reference picture
- * @param pix_op halfpel motion compensation function (average or put normally)
- * @param qpix_op qpel motion compensation function (average or put normally)
- * the motion vectors are taken from s->mv and the MV type from s->mv_type
- */
-static av_always_inline void MPV_motion_internal(MpegEncContext *s,
-                                                 uint8_t *dest_y,
-                                                 uint8_t *dest_cb,
-                                                 uint8_t *dest_cr,
-                                                 int dir,
-                                                 uint8_t **ref_picture,
-                                                 op_pixels_func (*pix_op)[4],
-                                                 qpel_mc_func (*qpix_op)[16],
-                                                 int is_mpeg12)
-{
-    int i;
-    int mb_y = s->mb_y;
-
-    prefetch_motion(s, ref_picture, dir);
-
-    if (!is_mpeg12 && s->obmc && s->pict_type != AV_PICTURE_TYPE_B) {
-        apply_obmc(s, dest_y, dest_cb, dest_cr, ref_picture, pix_op);
-        return;
-    }
-
-    switch (s->mv_type) {
-    case MV_TYPE_16X16:
-        if (s->mcsel) {
-            if (s->real_sprite_warping_points == 1) {
-                gmc1_motion(s, dest_y, dest_cb, dest_cr,
-                            ref_picture);
-            } else {
-                gmc_motion(s, dest_y, dest_cb, dest_cr,
-                           ref_picture);
-            }
-        } else if (!is_mpeg12 && s->quarter_sample) {
-            qpel_motion(s, dest_y, dest_cb, dest_cr,
-                        0, 0, 0,
-                        ref_picture, pix_op, qpix_op,
-                        s->mv[dir][0][0], s->mv[dir][0][1], 16);
-        } else if (!is_mpeg12 && (CONFIG_WMV2_DECODER || CONFIG_WMV2_ENCODER) &&
-                   s->mspel && s->codec_id == AV_CODEC_ID_WMV2) {
-            ff_mspel_motion(s, dest_y, dest_cb, dest_cr,
-                            ref_picture, pix_op,
-                            s->mv[dir][0][0], s->mv[dir][0][1], 16);
-        } else {
-            mpeg_motion(s, dest_y, dest_cb, dest_cr, 0,
-                        ref_picture, pix_op,
-                        s->mv[dir][0][0], s->mv[dir][0][1], 16, mb_y);
-        }
-        break;
-    case MV_TYPE_8X8:
-        if (!is_mpeg12)
-            apply_8x8(s, dest_y, dest_cb, dest_cr,
-                      dir, ref_picture, qpix_op, pix_op);
-        break;
-    case MV_TYPE_FIELD:
-        if (s->picture_structure == PICT_FRAME) {
-            if (!is_mpeg12 && s->quarter_sample) {
-                for (i = 0; i < 2; i++)
-                    qpel_motion(s, dest_y, dest_cb, dest_cr,
-                                1, i, s->field_select[dir][i],
-                                ref_picture, pix_op, qpix_op,
-                                s->mv[dir][i][0], s->mv[dir][i][1], 8);
-            } else {
-                /* top field */
-                mpeg_motion_field(s, dest_y, dest_cb, dest_cr,
-                                  0, s->field_select[dir][0],
-                                  ref_picture, pix_op,
-                                  s->mv[dir][0][0], s->mv[dir][0][1], 8, mb_y);
-                /* bottom field */
-                mpeg_motion_field(s, dest_y, dest_cb, dest_cr,
-                                  1, s->field_select[dir][1],
-                                  ref_picture, pix_op,
-                                  s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y);
-            }
-        } else {
-            if (s->picture_structure != s->field_select[dir][0] + 1 &&
-                s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) {
-                ref_picture = s->current_picture_ptr->f.data;
-            }
-
-            mpeg_motion(s, dest_y, dest_cb, dest_cr,
-                        s->field_select[dir][0],
-                        ref_picture, pix_op,
-                        s->mv[dir][0][0], s->mv[dir][0][1], 16, mb_y >> 1);
-        }
-        break;
-    case MV_TYPE_16X8:
-        for (i = 0; i < 2; i++) {
-            uint8_t **ref2picture;
-
-            if (s->picture_structure == s->field_select[dir][i] + 1
-                || s->pict_type == AV_PICTURE_TYPE_B || s->first_field) {
-                ref2picture = ref_picture;
-            } else {
-                ref2picture = s->current_picture_ptr->f.data;
-            }
-
-            mpeg_motion(s, dest_y, dest_cb, dest_cr,
-                        s->field_select[dir][i],
-                        ref2picture, pix_op,
-                        s->mv[dir][i][0], s->mv[dir][i][1] + 16 * i,
-                        8, mb_y >> 1);
-
-            dest_y  += 16 * s->linesize;
-            dest_cb += (16 >> s->chroma_y_shift) * s->uvlinesize;
-            dest_cr += (16 >> s->chroma_y_shift) * s->uvlinesize;
-        }
-        break;
-    case MV_TYPE_DMV:
-        if (s->picture_structure == PICT_FRAME) {
-            for (i = 0; i < 2; i++) {
-                int j;
-                for (j = 0; j < 2; j++)
-                    mpeg_motion_field(s, dest_y, dest_cb, dest_cr,
-                                      j, j ^ i, ref_picture, pix_op,
-                                      s->mv[dir][2 * i + j][0],
-                                      s->mv[dir][2 * i + j][1], 8, mb_y);
-                pix_op = s->hdsp.avg_pixels_tab;
-            }
-        } else {
-            for (i = 0; i < 2; i++) {
-                mpeg_motion(s, dest_y, dest_cb, dest_cr,
-                            s->picture_structure != i + 1,
-                            ref_picture, pix_op,
-                            s->mv[dir][2 * i][0], s->mv[dir][2 * i][1],
-                            16, mb_y >> 1);
-
-                // after put we make avg of the same block
-                pix_op = s->hdsp.avg_pixels_tab;
-
-                /* opposite parity is always in the same frame if this is
-                 * second field */
-                if (!s->first_field) {
-                    ref_picture = s->current_picture_ptr->f.data;
-                }
-            }
-        }
-        break;
-    default: assert(0);
-    }
-}
-
-void ff_MPV_motion(MpegEncContext *s,
-                   uint8_t *dest_y, uint8_t *dest_cb,
-                   uint8_t *dest_cr, int dir,
-                   uint8_t **ref_picture,
-                   op_pixels_func (*pix_op)[4],
-                   qpel_mc_func (*qpix_op)[16])
-{
-#if !CONFIG_SMALL
-    if (s->out_format == FMT_MPEG1)
-        MPV_motion_internal(s, dest_y, dest_cb, dest_cr, dir,
-                            ref_picture, pix_op, qpix_op, 1);
-    else
-#endif
-        MPV_motion_internal(s, dest_y, dest_cb, dest_cr, dir,
-                            ref_picture, pix_op, qpix_op, 0);
-}
diff --git a/deps/libav/libavcodec/mpegvideo_parser.c b/deps/libav/libavcodec/mpegvideo_parser.c
deleted file mode 100644
index bec1b36..0000000
--- a/deps/libav/libavcodec/mpegvideo_parser.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * MPEG1 / MPEG2 video parser
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "parser.h"
-#include "mpeg12.h"
-#include "internal.h"
-
-struct MpvParseContext {
-    ParseContext pc;
-    AVRational frame_rate;
-    int progressive_sequence;
-    int width, height;
-};
-
-
-static void mpegvideo_extract_headers(AVCodecParserContext *s,
-                                      AVCodecContext *avctx,
-                                      const uint8_t *buf, int buf_size)
-{
-    struct MpvParseContext *pc = s->priv_data;
-    const uint8_t *buf_end = buf + buf_size;
-    uint32_t start_code;
-    int frame_rate_index, ext_type, bytes_left;
-    int frame_rate_ext_n, frame_rate_ext_d;
-    int top_field_first, repeat_first_field, progressive_frame;
-    int horiz_size_ext, vert_size_ext, bit_rate_ext;
-    int did_set_size=0;
-//FIXME replace the crap with get_bits()
-    s->repeat_pict = 0;
-
-    while (buf < buf_end) {
-        start_code= -1;
-        buf= avpriv_find_start_code(buf, buf_end, &start_code);
-        bytes_left = buf_end - buf;
-        switch(start_code) {
-        case PICTURE_START_CODE:
-            if (bytes_left >= 2) {
-                s->pict_type = (buf[1] >> 3) & 7;
-            }
-            break;
-        case SEQ_START_CODE:
-            if (bytes_left >= 7) {
-                pc->width  = (buf[0] << 4) | (buf[1] >> 4);
-                pc->height = ((buf[1] & 0x0f) << 8) | buf[2];
-                if(!avctx->width || !avctx->height || !avctx->coded_width || !avctx->coded_height){
-                    ff_set_dimensions(avctx, pc->width, pc->height);
-                    did_set_size=1;
-                }
-                frame_rate_index = buf[3] & 0xf;
-                pc->frame_rate.den = avctx->time_base.den = ff_mpeg12_frame_rate_tab[frame_rate_index].num;
-                pc->frame_rate.num = avctx->time_base.num = ff_mpeg12_frame_rate_tab[frame_rate_index].den;
-                avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6))*400;
-                avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO;
-            }
-            break;
-        case EXT_START_CODE:
-            if (bytes_left >= 1) {
-                ext_type = (buf[0] >> 4);
-                switch(ext_type) {
-                case 0x1: /* sequence extension */
-                    if (bytes_left >= 6) {
-                        horiz_size_ext = ((buf[1] & 1) << 1) | (buf[2] >> 7);
-                        vert_size_ext = (buf[2] >> 5) & 3;
-                        bit_rate_ext = ((buf[2] & 0x1F)<<7) | (buf[3]>>1);
-                        frame_rate_ext_n = (buf[5] >> 5) & 3;
-                        frame_rate_ext_d = (buf[5] & 0x1f);
-                        pc->progressive_sequence = buf[1] & (1 << 3);
-                        avctx->has_b_frames= !(buf[5] >> 7);
-
-                        pc->width  |=(horiz_size_ext << 12);
-                        pc->height |=( vert_size_ext << 12);
-                        avctx->bit_rate += (bit_rate_ext << 18) * 400;
-                        if(did_set_size)
-                            ff_set_dimensions(avctx, pc->width, pc->height);
-                        avctx->time_base.den = pc->frame_rate.den * (frame_rate_ext_n + 1) * 2;
-                        avctx->time_base.num = pc->frame_rate.num * (frame_rate_ext_d + 1);
-                        avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
-                    }
-                    break;
-                case 0x8: /* picture coding extension */
-                    if (bytes_left >= 5) {
-                        top_field_first = buf[3] & (1 << 7);
-                        repeat_first_field = buf[3] & (1 << 1);
-                        progressive_frame = buf[4] & (1 << 7);
-
-                        /* check if we must repeat the frame */
-                        s->repeat_pict = 1;
-                        if (repeat_first_field) {
-                            if (pc->progressive_sequence) {
-                                if (top_field_first)
-                                    s->repeat_pict = 5;
-                                else
-                                    s->repeat_pict = 3;
-                            } else if (progressive_frame) {
-                                s->repeat_pict = 2;
-                            }
-                        }
-
-                        if (!pc->progressive_sequence) {
-                            if (top_field_first)
-                                s->field_order = AV_FIELD_TT;
-                            else
-                                s->field_order = AV_FIELD_BB;
-                        } else
-                            s->field_order = AV_FIELD_PROGRESSIVE;
-                    }
-                    break;
-                }
-            }
-            break;
-        case -1:
-            goto the_end;
-        default:
-            /* we stop parsing when we encounter a slice. It ensures
-               that this function takes a negligible amount of time */
-            if (start_code >= SLICE_MIN_START_CODE &&
-                start_code <= SLICE_MAX_START_CODE)
-                goto the_end;
-            break;
-        }
-    }
- the_end: ;
-}
-
-static int mpegvideo_parse(AVCodecParserContext *s,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
-{
-    struct MpvParseContext *pc1 = s->priv_data;
-    ParseContext *pc= &pc1->pc;
-    int next;
-
-    if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
-        next= buf_size;
-    }else{
-        next= ff_mpeg1_find_frame_end(pc, buf, buf_size, s);
-
-        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-            *poutbuf = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-
-    }
-    /* we have a full frame : we just parse the first few MPEG headers
-       to have the full timing information. The time take by this
-       function should be negligible for uncorrupted streams */
-    mpegvideo_extract_headers(s, avctx, buf, buf_size);
-    av_dlog(NULL, "pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",
-            s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict);
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-static int mpegvideo_split(AVCodecContext *avctx,
-                           const uint8_t *buf, int buf_size)
-{
-    int i;
-    uint32_t state= -1;
-
-    for(i=0; i<buf_size; i++){
-        state= (state<<8) | buf[i];
-        if(state != 0x1B3 && state != 0x1B5 && state < 0x200 && state >= 0x100)
-            return i-3;
-    }
-    return 0;
-}
-
-AVCodecParser ff_mpegvideo_parser = {
-    .codec_ids      = { AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO },
-    .priv_data_size = sizeof(struct MpvParseContext),
-    .parser_parse   = mpegvideo_parse,
-    .parser_close   = ff_parse_close,
-    .split          = mpegvideo_split,
-};
diff --git a/deps/libav/libavcodec/mpegvideo_xvmc.c b/deps/libav/libavcodec/mpegvideo_xvmc.c
deleted file mode 100644
index ec218c2..0000000
--- a/deps/libav/libavcodec/mpegvideo_xvmc.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * XVideo Motion Compensation
- * Copyright (c) 2003 Ivan Kalvachev
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <limits.h>
-#include <X11/extensions/XvMC.h>
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-#include "xvmc.h"
-#include "xvmc_internal.h"
-#include "version.h"
-
-#if FF_API_XVMC
-
-/**
- * Initialize the block field of the MpegEncContext pointer passed as
- * parameter after making sure that the data is not corrupted.
- * In order to implement something like direct rendering instead of decoding
- * coefficients in s->blocks and then copying them, copy them directly
- * into the data_blocks array provided by xvmc.
- */
-void ff_xvmc_init_block(MpegEncContext *s)
-{
-    struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
-    assert(render && render->xvmc_id == AV_XVMC_ID);
-
-    s->block = (int16_t (*)[64])(render->data_blocks + render->next_free_data_block_num * 64);
-}
-
-/**
- * Fill individual block pointers, so there are no gaps in the data_block array
- * in case not all blocks in the macroblock are coded.
- */
-void ff_xvmc_pack_pblocks(MpegEncContext *s, int cbp)
-{
-    int i, j = 0;
-    const int mb_block_count = 4 + (1 << s->chroma_format);
-
-    cbp <<= 12-mb_block_count;
-    for (i = 0; i < mb_block_count; i++) {
-        if (cbp & (1 << 11))
-            s->pblocks[i] = &s->block[j++];
-        else
-            s->pblocks[i] = NULL;
-        cbp += cbp;
-    }
-}
-
-/**
- * Find and store the surfaces that are used as reference frames.
- * This function should be called for every new field and/or frame.
- * It should be safe to call the function a few times for the same field.
- */
-int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx)
-{
-    struct xvmc_pix_fmt *last, *next, *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
-    const int mb_block_count = 4 + (1 << s->chroma_format);
-
-    assert(avctx);
-    if (!render || render->xvmc_id != AV_XVMC_ID ||
-        !render->data_blocks || !render->mv_blocks ||
-        (unsigned int)render->allocated_mv_blocks   > INT_MAX/(64*6) ||
-        (unsigned int)render->allocated_data_blocks > INT_MAX/64     ||
-        !render->p_surface) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Render token doesn't look as expected.\n");
-        return -1; // make sure that this is a render packet
-    }
-
-    if (render->filled_mv_blocks_num) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Rendering surface contains %i unprocessed blocks.\n",
-               render->filled_mv_blocks_num);
-        return -1;
-    }
-    if (render->allocated_mv_blocks   < 1 ||
-        render->allocated_data_blocks <  render->allocated_mv_blocks*mb_block_count ||
-        render->start_mv_blocks_num   >= render->allocated_mv_blocks                ||
-        render->next_free_data_block_num >
-                        render->allocated_data_blocks -
-                        mb_block_count*(render->allocated_mv_blocks-render->start_mv_blocks_num)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Rendering surface doesn't provide enough block structures to work with.\n");
-        return -1;
-    }
-
-    render->picture_structure = s->picture_structure;
-    render->flags             = s->first_field ? 0 : XVMC_SECOND_FIELD;
-    render->p_future_surface  = NULL;
-    render->p_past_surface    = NULL;
-
-    switch(s->pict_type) {
-        case  AV_PICTURE_TYPE_I:
-            return 0; // no prediction from other frames
-        case  AV_PICTURE_TYPE_B:
-            next = (struct xvmc_pix_fmt*)s->next_picture.f.data[2];
-            if (!next)
-                return -1;
-            if (next->xvmc_id != AV_XVMC_ID)
-                return -1;
-            render->p_future_surface = next->p_surface;
-            // no return here, going to set forward prediction
-        case  AV_PICTURE_TYPE_P:
-            last = (struct xvmc_pix_fmt*)s->last_picture.f.data[2];
-            if (!last)
-                last = render; // predict second field from the first
-            if (last->xvmc_id != AV_XVMC_ID)
-                return -1;
-            render->p_past_surface = last->p_surface;
-            return 0;
-    }
-
-return -1;
-}
-
-/**
- * Complete frame/field rendering by passing any remaining blocks.
- * Normally ff_draw_horiz_band() is called for each slice, however,
- * some leftover blocks, for example from error_resilience(), may remain.
- * It should be safe to call the function a few times for the same field.
- */
-void ff_xvmc_field_end(MpegEncContext *s)
-{
-    struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
-    assert(render);
-
-    if (render->filled_mv_blocks_num > 0)
-        ff_mpeg_draw_horiz_band(s, 0, 0);
-}
-
-/**
- * Synthesize the data needed by XvMC to render one macroblock of data.
- * Fill all relevant fields, if necessary do IDCT.
- */
-void ff_xvmc_decode_mb(MpegEncContext *s)
-{
-    XvMCMacroBlock *mv_block;
-    struct xvmc_pix_fmt *render;
-    int i, cbp, blocks_per_mb;
-
-    const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
-
-
-    if (s->encoding) {
-        av_log(s->avctx, AV_LOG_ERROR, "XVMC doesn't support encoding!!!\n");
-        return;
-    }
-
-    // from MPV_decode_mb(), update DC predictors for P macroblocks
-    if (!s->mb_intra) {
-        s->last_dc[0] =
-        s->last_dc[1] =
-        s->last_dc[2] =  128 << s->intra_dc_precision;
-    }
-
-    // MC doesn't skip blocks
-    s->mb_skipped = 0;
-
-
-    // Do I need to export quant when I could not perform postprocessing?
-    // Anyway, it doesn't hurt.
-    s->current_picture.qscale_table[mb_xy] = s->qscale;
-
-    // start of XVMC-specific code
-    render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
-    assert(render);
-    assert(render->xvmc_id == AV_XVMC_ID);
-    assert(render->mv_blocks);
-
-    // take the next free macroblock
-    mv_block = &render->mv_blocks[render->start_mv_blocks_num +
-                                  render->filled_mv_blocks_num];
-
-    mv_block->x        = s->mb_x;
-    mv_block->y        = s->mb_y;
-    mv_block->dct_type = s->interlaced_dct; // XVMC_DCT_TYPE_FRAME/FIELD;
-    if (s->mb_intra) {
-        mv_block->macroblock_type = XVMC_MB_TYPE_INTRA; // no MC, all done
-    } else {
-        mv_block->macroblock_type = XVMC_MB_TYPE_PATTERN;
-
-        if (s->mv_dir & MV_DIR_FORWARD) {
-            mv_block->macroblock_type |= XVMC_MB_TYPE_MOTION_FORWARD;
-            // PMV[n][dir][xy] = mv[dir][n][xy]
-            mv_block->PMV[0][0][0] = s->mv[0][0][0];
-            mv_block->PMV[0][0][1] = s->mv[0][0][1];
-            mv_block->PMV[1][0][0] = s->mv[0][1][0];
-            mv_block->PMV[1][0][1] = s->mv[0][1][1];
-        }
-        if (s->mv_dir & MV_DIR_BACKWARD) {
-            mv_block->macroblock_type |= XVMC_MB_TYPE_MOTION_BACKWARD;
-            mv_block->PMV[0][1][0] = s->mv[1][0][0];
-            mv_block->PMV[0][1][1] = s->mv[1][0][1];
-            mv_block->PMV[1][1][0] = s->mv[1][1][0];
-            mv_block->PMV[1][1][1] = s->mv[1][1][1];
-        }
-
-        switch(s->mv_type) {
-            case  MV_TYPE_16X16:
-                mv_block->motion_type = XVMC_PREDICTION_FRAME;
-                break;
-            case  MV_TYPE_16X8:
-                mv_block->motion_type = XVMC_PREDICTION_16x8;
-                break;
-            case  MV_TYPE_FIELD:
-                mv_block->motion_type = XVMC_PREDICTION_FIELD;
-                if (s->picture_structure == PICT_FRAME) {
-                    mv_block->PMV[0][0][1] <<= 1;
-                    mv_block->PMV[1][0][1] <<= 1;
-                    mv_block->PMV[0][1][1] <<= 1;
-                    mv_block->PMV[1][1][1] <<= 1;
-                }
-                break;
-            case  MV_TYPE_DMV:
-                mv_block->motion_type = XVMC_PREDICTION_DUAL_PRIME;
-                if (s->picture_structure == PICT_FRAME) {
-
-                    mv_block->PMV[0][0][0] = s->mv[0][0][0];      // top from top
-                    mv_block->PMV[0][0][1] = s->mv[0][0][1] << 1;
-
-                    mv_block->PMV[0][1][0] = s->mv[0][0][0];      // bottom from bottom
-                    mv_block->PMV[0][1][1] = s->mv[0][0][1] << 1;
-
-                    mv_block->PMV[1][0][0] = s->mv[0][2][0];      // dmv00, top from bottom
-                    mv_block->PMV[1][0][1] = s->mv[0][2][1] << 1; // dmv01
-
-                    mv_block->PMV[1][1][0] = s->mv[0][3][0];      // dmv10, bottom from top
-                    mv_block->PMV[1][1][1] = s->mv[0][3][1] << 1; // dmv11
-
-                } else {
-                    mv_block->PMV[0][1][0] = s->mv[0][2][0];      // dmv00
-                    mv_block->PMV[0][1][1] = s->mv[0][2][1];      // dmv01
-                }
-                break;
-            default:
-                assert(0);
-        }
-
-        mv_block->motion_vertical_field_select = 0;
-
-        // set correct field references
-        if (s->mv_type == MV_TYPE_FIELD || s->mv_type == MV_TYPE_16X8) {
-            mv_block->motion_vertical_field_select |= s->field_select[0][0];
-            mv_block->motion_vertical_field_select |= s->field_select[1][0] << 1;
-            mv_block->motion_vertical_field_select |= s->field_select[0][1] << 2;
-            mv_block->motion_vertical_field_select |= s->field_select[1][1] << 3;
-        }
-    } // !intra
-    // time to handle data blocks
-    mv_block->index = render->next_free_data_block_num;
-
-    blocks_per_mb = 6;
-    if (s->chroma_format >= 2) {
-        blocks_per_mb = 4 + (1 << s->chroma_format);
-    }
-
-    // calculate cbp
-    cbp = 0;
-    for (i = 0; i < blocks_per_mb; i++) {
-        cbp += cbp;
-        if (s->block_last_index[i] >= 0)
-            cbp++;
-    }
-
-    if (s->flags & CODEC_FLAG_GRAY) {
-        if (s->mb_intra) {                                   // intra frames are always full chroma blocks
-            for (i = 4; i < blocks_per_mb; i++) {
-                memset(s->pblocks[i], 0, sizeof(*s->pblocks[i]));  // so we need to clear them
-                if (!render->unsigned_intra)
-                    *s->pblocks[i][0] = 1 << 10;
-            }
-        } else {
-            cbp &= 0xf << (blocks_per_mb - 4);
-            blocks_per_mb = 4;                               // luminance blocks only
-        }
-    }
-    mv_block->coded_block_pattern = cbp;
-    if (cbp == 0)
-        mv_block->macroblock_type &= ~XVMC_MB_TYPE_PATTERN;
-
-    for (i = 0; i < blocks_per_mb; i++) {
-        if (s->block_last_index[i] >= 0) {
-            // I do not have unsigned_intra MOCO to test, hope it is OK.
-            if (s->mb_intra && (render->idct || !render->unsigned_intra))
-                *s->pblocks[i][0] -= 1 << 10;
-            if (!render->idct) {
-                s->dsp.idct(*s->pblocks[i]);
-                /* It is unclear if MC hardware requires pixel diff values to be
-                 * in the range [-255;255]. TODO: Clipping if such hardware is
-                 * ever found. As of now it would only be an unnecessary
-                 * slowdown. */
-            }
-            // copy blocks only if the codec doesn't support pblocks reordering
-            if (s->avctx->xvmc_acceleration == 1) {
-                memcpy(&render->data_blocks[render->next_free_data_block_num*64],
-                       s->pblocks[i], sizeof(*s->pblocks[i]));
-            }
-            render->next_free_data_block_num++;
-        }
-    }
-    render->filled_mv_blocks_num++;
-
-    assert(render->filled_mv_blocks_num     <= render->allocated_mv_blocks);
-    assert(render->next_free_data_block_num <= render->allocated_data_blocks);
-    /* The above conditions should not be able to fail as long as this function
-     * is used and the following 'if ()' automatically calls a callback to free
-     * blocks. */
-
-
-    if (render->filled_mv_blocks_num == render->allocated_mv_blocks)
-        ff_mpeg_draw_horiz_band(s, 0, 0);
-}
-
-#endif /* FF_API_XVMC */
diff --git a/deps/libav/libavcodec/mqc.c b/deps/libav/libavcodec/mqc.c
deleted file mode 100644
index 60d87ba..0000000
--- a/deps/libav/libavcodec/mqc.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * MQ-coder encoder and decoder common functions
- * Copyright (c) 2007 Kamil Nowosad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * MQ-coder common (decoder/encoder) functions
- * @file
- * @author Kamil Nowosad
- */
-
-#include <string.h>
-#include <stdint.h>
-
-#include "mqc.h"
-
-/* MQ coder context state structure */
-typedef struct MqcCxState {
-    uint16_t qe;
-    uint8_t  nmps;
-    uint8_t  nlps;
-    uint8_t  sw;
-} MqcCxState;
-
-static const MqcCxState cx_states[47] = {
-    { 0x5601,  1,  1, 1 },
-    { 0x3401,  2,  6, 0 },
-    { 0x1801,  3,  9, 0 },
-    { 0x0AC1,  4, 12, 0 },
-    { 0x0521,  5, 29, 0 },
-    { 0x0221, 38, 33, 0 },
-    { 0x5601,  7,  6, 1 },
-    { 0x5401,  8, 14, 0 },
-    { 0x4801,  9, 14, 0 },
-    { 0x3801, 10, 14, 0 },
-    { 0x3001, 11, 17, 0 },
-    { 0x2401, 12, 18, 0 },
-    { 0x1C01, 13, 20, 0 },
-    { 0x1601, 29, 21, 0 },
-    { 0x5601, 15, 14, 1 },
-    { 0x5401, 16, 14, 0 },
-    { 0x5101, 17, 15, 0 },
-    { 0x4801, 18, 16, 0 },
-    { 0x3801, 19, 17, 0 },
-    { 0x3401, 20, 18, 0 },
-    { 0x3001, 21, 19, 0 },
-    { 0x2801, 22, 19, 0 },
-    { 0x2401, 23, 20, 0 },
-    { 0x2201, 24, 21, 0 },
-    { 0x1C01, 25, 22, 0 },
-    { 0x1801, 26, 23, 0 },
-    { 0x1601, 27, 24, 0 },
-    { 0x1401, 28, 25, 0 },
-    { 0x1201, 29, 26, 0 },
-    { 0x1101, 30, 27, 0 },
-    { 0x0AC1, 31, 28, 0 },
-    { 0x09C1, 32, 29, 0 },
-    { 0x08A1, 33, 30, 0 },
-    { 0x0521, 34, 31, 0 },
-    { 0x0441, 35, 32, 0 },
-    { 0x02A1, 36, 33, 0 },
-    { 0x0221, 37, 34, 0 },
-    { 0x0141, 38, 35, 0 },
-    { 0x0111, 39, 36, 0 },
-    { 0x0085, 40, 37, 0 },
-    { 0x0049, 41, 38, 0 },
-    { 0x0025, 42, 39, 0 },
-    { 0x0015, 43, 40, 0 },
-    { 0x0009, 44, 41, 0 },
-    { 0x0005, 45, 42, 0 },
-    { 0x0001, 45, 43, 0 },
-    { 0x5601, 46, 46, 0 }
-};
-
-uint16_t ff_mqc_qe [2 * 47];
-uint8_t ff_mqc_nlps[2 * 47];
-uint8_t ff_mqc_nmps[2 * 47];
-
-void ff_mqc_init_context_tables(void)
-{
-    int i;
-    for (i = 0; i < 47; i++) {
-        ff_mqc_qe[2 * i]     =
-        ff_mqc_qe[2 * i + 1] = cx_states[i].qe;
-
-        ff_mqc_nlps[2 * i]     = 2 * cx_states[i].nlps + cx_states[i].sw;
-        ff_mqc_nlps[2 * i + 1] = 2 * cx_states[i].nlps + 1 - cx_states[i].sw;
-        ff_mqc_nmps[2 * i]     = 2 * cx_states[i].nmps;
-        ff_mqc_nmps[2 * i + 1] = 2 * cx_states[i].nmps + 1;
-    }
-}
-
-void ff_mqc_init_contexts(MqcState *mqc)
-{
-    memset(mqc->cx_states, 0, sizeof(mqc->cx_states));
-    mqc->cx_states[MQC_CX_UNI] = 2 * 46;
-    mqc->cx_states[MQC_CX_RL]  = 2 * 3;
-    mqc->cx_states[0]          = 2 * 4;
-}
diff --git a/deps/libav/libavcodec/mqc.h b/deps/libav/libavcodec/mqc.h
deleted file mode 100644
index a65433e..0000000
--- a/deps/libav/libavcodec/mqc.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * MQ-coder: structures, common and decoder functions
- * Copyright (c) 2007 Kamil Nowosad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MQC_H
-#define AVCODEC_MQC_H
-
-/**
- * MQ-coder
- * @file
- * @author Kamil Nowosad
- */
-
-#include <stdint.h>
-
-#define MQC_CX_UNI 17
-#define MQC_CX_RL  18
-
-extern uint16_t ff_mqc_qe[2 * 47];
-extern uint8_t  ff_mqc_nlps[2 * 47];
-extern uint8_t  ff_mqc_nmps[2 * 47];
-
-typedef struct MqcState {
-    uint8_t *bp, *bpstart;
-    unsigned int a;
-    unsigned int c;
-    unsigned int ct;
-    uint8_t cx_states[19];
-} MqcState;
-
-/* decoder */
-
-/**
- * Initialize MQ-decoder.
- * @param mqc   MQ decoder state
- * @param bp    byte poiter
- */
-void ff_mqc_initdec(MqcState *mqc, uint8_t *bp);
-
-/**
- * MQ decoder.
- * @param mqc       MQ decoder state
- * @param cxstate   Context
- * @return          Decision (0 ot 1)
- */
-int ff_mqc_decode(MqcState *mqc, uint8_t *cxstate);
-
-/* common */
-
-/**
- * MQ-coder Initialize context tables (QE, NLPS, NMPS)
- */
-void ff_mqc_init_context_tables(void);
-
-/**
- * MQ-coder context initialisations.
- * @param mqc       MQ-coder context
- */
-void ff_mqc_init_contexts(MqcState *mqc);
-
-#endif /* AVCODEC_MQC_H */
diff --git a/deps/libav/libavcodec/mqcdec.c b/deps/libav/libavcodec/mqcdec.c
deleted file mode 100644
index 889763a..0000000
--- a/deps/libav/libavcodec/mqcdec.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * MQ-coder decoder
- * Copyright (c) 2007 Kamil Nowosad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * MQ-coder decoder
- * @file
- * @author Kamil Nowosad
- */
-
-#include "mqc.h"
-
-static void bytein(MqcState *mqc)
-{
-    if (*mqc->bp == 0xff) {
-        if (*(mqc->bp + 1) > 0x8f)
-            mqc->c++;
-        else {
-            mqc->bp++;
-            mqc->c += 2 + 0xfe00 - (*mqc->bp << 9);
-        }
-    } else {
-        mqc->bp++;
-        mqc->c += 1 + 0xff00 - (*mqc->bp << 8);
-    }
-}
-
-static int exchange(MqcState *mqc, uint8_t *cxstate, int lps)
-{
-    int d;
-    if ((mqc->a < ff_mqc_qe[*cxstate]) ^ (!lps)) {
-        if (lps)
-            mqc->a = ff_mqc_qe[*cxstate];
-        d = *cxstate & 1;
-        *cxstate = ff_mqc_nmps[*cxstate];
-    } else {
-        if (lps)
-            mqc->a = ff_mqc_qe[*cxstate];
-        d = 1 - (*cxstate & 1);
-        *cxstate = ff_mqc_nlps[*cxstate];
-    }
-    // do RENORMD: see ISO/IEC 15444-1:2002 §C.3.3
-    do {
-        if (!(mqc->c & 0xff)) {
-            mqc->c -= 0x100;
-            bytein(mqc);
-        }
-        mqc->a += mqc->a;
-        mqc->c += mqc->c;
-    } while (!(mqc->a & 0x8000));
-    return d;
-}
-
-void ff_mqc_initdec(MqcState *mqc, uint8_t *bp)
-{
-    ff_mqc_init_contexts(mqc);
-    mqc->bp = bp;
-    mqc->c  = (*mqc->bp ^ 0xff) << 16;
-    bytein(mqc);
-    mqc->c = mqc->c << 7;
-    mqc->a = 0x8000;
-}
-
-int ff_mqc_decode(MqcState *mqc, uint8_t *cxstate)
-{
-    mqc->a -= ff_mqc_qe[*cxstate];
-    if ((mqc->c >> 16) < mqc->a) {
-        if (mqc->a & 0x8000)
-            return *cxstate & 1;
-        else
-            return exchange(mqc, cxstate, 0);
-    } else {
-        mqc->c -= mqc->a << 16;
-        return exchange(mqc, cxstate, 1);
-    }
-}
diff --git a/deps/libav/libavcodec/msgsmdec.c b/deps/libav/libavcodec/msgsmdec.c
deleted file mode 100644
index be5062a..0000000
--- a/deps/libav/libavcodec/msgsmdec.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * gsm 06.10 decoder, Microsoft variant
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "msgsmdec.h"
-#include "gsm.h"
-#include "gsmdec_template.c"
-
-int ff_msgsm_decode_block(AVCodecContext *avctx, int16_t *samples,
-                          const uint8_t *buf, int mode)
-{
-    int res;
-    GetBitContext gb;
-    init_get_bits(&gb, buf, GSM_MS_BLOCK_SIZE * 8);
-    res = gsm_decode_block(avctx, samples, &gb, mode);
-    if (res < 0)
-        return res;
-    return gsm_decode_block(avctx, samples + GSM_FRAME_SIZE, &gb, mode);
-}
diff --git a/deps/libav/libavcodec/msgsmdec.h b/deps/libav/libavcodec/msgsmdec.h
deleted file mode 100644
index adbda9a..0000000
--- a/deps/libav/libavcodec/msgsmdec.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * gsm 06.10 decoder, Microsoft variant
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MSGSMDEC_H
-#define AVCODEC_MSGSMDEC_H
-
-#include "avcodec.h"
-
-int ff_msgsm_decode_block(AVCodecContext *avctx, int16_t *samples,
-                          const uint8_t *buf, int mode);
-
-#endif /* AVCODEC_MSGSMDEC_H */
diff --git a/deps/libav/libavcodec/msmpeg4.c b/deps/libav/libavcodec/msmpeg4.c
deleted file mode 100644
index c76a14b..0000000
--- a/deps/libav/libavcodec/msmpeg4.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * MSMPEG4 backend for encoder and decoder
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MSMPEG4 backend for encoder and decoder
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "msmpeg4.h"
-#include "libavutil/x86/asm.h"
-#include "h263.h"
-#include "mpeg4video.h"
-#include "msmpeg4data.h"
-#include "vc1data.h"
-
-/*
- * You can also call this codec : MPEG4 with a twist !
- *
- * TODO:
- *        - (encoding) select best mv table (two choices)
- *        - (encoding) select best vlc/dc table
- */
-
-/* This table is practically identical to the one from h263
- * except that it is inverted. */
-static av_cold void init_h263_dc_for_msmpeg4(void)
-{
-        int level, uni_code, uni_len;
-
-        for(level=-256; level<256; level++){
-            int size, v, l;
-            /* find number of bits */
-            size = 0;
-            v = abs(level);
-            while (v) {
-                v >>= 1;
-                    size++;
-            }
-
-            if (level < 0)
-                l= (-level) ^ ((1 << size) - 1);
-            else
-                l= level;
-
-            /* luminance h263 */
-            uni_code= ff_mpeg4_DCtab_lum[size][0];
-            uni_len = ff_mpeg4_DCtab_lum[size][1];
-            uni_code ^= (1<<uni_len)-1; //M$ does not like compatibility
-
-            if (size > 0) {
-                uni_code<<=size; uni_code|=l;
-                uni_len+=size;
-                if (size > 8){
-                    uni_code<<=1; uni_code|=1;
-                    uni_len++;
-                }
-            }
-            ff_v2_dc_lum_table[level + 256][0] = uni_code;
-            ff_v2_dc_lum_table[level + 256][1] = uni_len;
-
-            /* chrominance h263 */
-            uni_code= ff_mpeg4_DCtab_chrom[size][0];
-            uni_len = ff_mpeg4_DCtab_chrom[size][1];
-            uni_code ^= (1<<uni_len)-1; //M$ does not like compatibility
-
-            if (size > 0) {
-                uni_code<<=size; uni_code|=l;
-                uni_len+=size;
-                if (size > 8){
-                    uni_code<<=1; uni_code|=1;
-                    uni_len++;
-                }
-            }
-            ff_v2_dc_chroma_table[level + 256][0] = uni_code;
-            ff_v2_dc_chroma_table[level + 256][1] = uni_len;
-
-        }
-}
-
-av_cold void ff_msmpeg4_common_init(MpegEncContext *s)
-{
-    static int initialized=0;
-
-    switch(s->msmpeg4_version){
-    case 1:
-    case 2:
-        s->y_dc_scale_table=
-        s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-        break;
-    case 3:
-        if(s->workaround_bugs){
-            s->y_dc_scale_table= ff_old_ff_y_dc_scale_table;
-            s->c_dc_scale_table= ff_wmv1_c_dc_scale_table;
-        } else{
-            s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table;
-            s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table;
-        }
-        break;
-    case 4:
-    case 5:
-        s->y_dc_scale_table= ff_wmv1_y_dc_scale_table;
-        s->c_dc_scale_table= ff_wmv1_c_dc_scale_table;
-        break;
-#if CONFIG_VC1_DECODER
-    case 6:
-        s->y_dc_scale_table= ff_wmv3_dc_scale_table;
-        s->c_dc_scale_table= ff_wmv3_dc_scale_table;
-        break;
-#endif
-
-    }
-
-
-    if(s->msmpeg4_version>=4){
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable  , ff_wmv1_scantable[1]);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_wmv1_scantable[2]);
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_wmv1_scantable[3]);
-        ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable  , ff_wmv1_scantable[0]);
-    }
-    //Note the default tables are set in common_init in mpegvideo.c
-
-    if(!initialized){
-        initialized=1;
-
-        init_h263_dc_for_msmpeg4();
-    }
-}
-
-/* predict coded block */
-int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n, uint8_t **coded_block_ptr)
-{
-    int xy, wrap, pred, a, b, c;
-
-    xy = s->block_index[n];
-    wrap = s->b8_stride;
-
-    /* B C
-     * A X
-     */
-    a = s->coded_block[xy - 1       ];
-    b = s->coded_block[xy - 1 - wrap];
-    c = s->coded_block[xy     - wrap];
-
-    if (b == c) {
-        pred = a;
-    } else {
-        pred = c;
-    }
-
-    /* store value */
-    *coded_block_ptr = &s->coded_block[xy];
-
-    return pred;
-}
-
-static int get_dc(uint8_t *src, int stride, int scale)
-{
-    int y;
-    int sum=0;
-    for(y=0; y<8; y++){
-        int x;
-        for(x=0; x<8; x++){
-            sum+=src[x + y*stride];
-        }
-    }
-    return FASTDIV((sum + (scale>>1)), scale);
-}
-
-/* dir = 0: left, dir = 1: top prediction */
-int ff_msmpeg4_pred_dc(MpegEncContext *s, int n,
-                       int16_t **dc_val_ptr, int *dir_ptr)
-{
-    int a, b, c, wrap, pred, scale;
-    int16_t *dc_val;
-
-    /* find prediction */
-    if (n < 4) {
-        scale = s->y_dc_scale;
-    } else {
-        scale = s->c_dc_scale;
-    }
-
-    wrap = s->block_wrap[n];
-    dc_val= s->dc_val[0] + s->block_index[n];
-
-    /* B C
-     * A X
-     */
-    a = dc_val[ - 1];
-    b = dc_val[ - 1 - wrap];
-    c = dc_val[ - wrap];
-
-    if(s->first_slice_line && (n&2)==0 && s->msmpeg4_version<4){
-        b=c=1024;
-    }
-
-    /* XXX: the following solution consumes divisions, but it does not
-       necessitate to modify mpegvideo.c. The problem comes from the
-       fact they decided to store the quantized DC (which would lead
-       to problems if Q could vary !) */
-#if ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE
-    __asm__ volatile(
-        "movl %3, %%eax         \n\t"
-        "shrl $1, %%eax         \n\t"
-        "addl %%eax, %2         \n\t"
-        "addl %%eax, %1         \n\t"
-        "addl %0, %%eax         \n\t"
-        "mull %4                \n\t"
-        "movl %%edx, %0         \n\t"
-        "movl %1, %%eax         \n\t"
-        "mull %4                \n\t"
-        "movl %%edx, %1         \n\t"
-        "movl %2, %%eax         \n\t"
-        "mull %4                \n\t"
-        "movl %%edx, %2         \n\t"
-        : "+b" (a), "+c" (b), "+D" (c)
-        : "g" (scale), "S" (ff_inverse[scale])
-        : "%eax", "%edx"
-    );
-#else
-    /* Divisions are costly everywhere; optimize the most common case. */
-    if (scale == 8) {
-        a = (a + (8 >> 1)) / 8;
-        b = (b + (8 >> 1)) / 8;
-        c = (c + (8 >> 1)) / 8;
-    } else {
-        a = FASTDIV((a + (scale >> 1)), scale);
-        b = FASTDIV((b + (scale >> 1)), scale);
-        c = FASTDIV((c + (scale >> 1)), scale);
-    }
-#endif
-    /* XXX: WARNING: they did not choose the same test as MPEG4. This
-       is very important ! */
-    if(s->msmpeg4_version>3){
-        if(s->inter_intra_pred){
-            uint8_t *dest;
-            int wrap;
-
-            if(n==1){
-                pred=a;
-                *dir_ptr = 0;
-            }else if(n==2){
-                pred=c;
-                *dir_ptr = 1;
-            }else if(n==3){
-                if (abs(a - b) < abs(b - c)) {
-                    pred = c;
-                    *dir_ptr = 1;
-                } else {
-                    pred = a;
-                    *dir_ptr = 0;
-                }
-            }else{
-                if(n<4){
-                    wrap= s->linesize;
-                    dest= s->current_picture.f.data[0] + (((n >> 1) + 2*s->mb_y) * 8*  wrap ) + ((n & 1) + 2*s->mb_x) * 8;
-                }else{
-                    wrap= s->uvlinesize;
-                    dest= s->current_picture.f.data[n - 3] + (s->mb_y * 8 * wrap) + s->mb_x * 8;
-                }
-                if(s->mb_x==0) a= (1024 + (scale>>1))/scale;
-                else           a= get_dc(dest-8, wrap, scale*8);
-                if(s->mb_y==0) c= (1024 + (scale>>1))/scale;
-                else           c= get_dc(dest-8*wrap, wrap, scale*8);
-
-                if (s->h263_aic_dir==0) {
-                    pred= a;
-                    *dir_ptr = 0;
-                }else if (s->h263_aic_dir==1) {
-                    if(n==0){
-                        pred= c;
-                        *dir_ptr = 1;
-                    }else{
-                        pred= a;
-                        *dir_ptr = 0;
-                    }
-                }else if (s->h263_aic_dir==2) {
-                    if(n==0){
-                        pred= a;
-                        *dir_ptr = 0;
-                    }else{
-                        pred= c;
-                        *dir_ptr = 1;
-                    }
-                } else {
-                    pred= c;
-                    *dir_ptr = 1;
-                }
-            }
-        }else{
-            if (abs(a - b) < abs(b - c)) {
-                pred = c;
-                *dir_ptr = 1;
-            } else {
-                pred = a;
-                *dir_ptr = 0;
-            }
-        }
-    }else{
-        if (abs(a - b) <= abs(b - c)) {
-            pred = c;
-            *dir_ptr = 1;
-        } else {
-            pred = a;
-            *dir_ptr = 0;
-        }
-    }
-
-    /* update predictor */
-    *dc_val_ptr = &dc_val[0];
-    return pred;
-}
-
diff --git a/deps/libav/libavcodec/msmpeg4.h b/deps/libav/libavcodec/msmpeg4.h
deleted file mode 100644
index 0a8ecd9..0000000
--- a/deps/libav/libavcodec/msmpeg4.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * MSMPEG4 backend for encoder and decoder
- * copyright (c) 2007 Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MSMPEG4_H
-#define AVCODEC_MSMPEG4_H
-
-#include <stdint.h>
-
-#include "config.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "msmpeg4data.h"
-#include "put_bits.h"
-
-#define INTER_INTRA_VLC_BITS 3
-#define MB_NON_INTRA_VLC_BITS 9
-#define MB_INTRA_VLC_BITS 9
-
-#define II_BITRATE 128*1024
-#define MBAC_BITRATE 50*1024
-
-#define DC_MAX 119
-
-extern VLC ff_mb_non_intra_vlc[4];
-extern VLC ff_inter_intra_vlc;
-
-void ff_msmpeg4_code012(PutBitContext *pb, int n);
-void ff_msmpeg4_common_init(MpegEncContext *s);
-void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n);
-void ff_msmpeg4_handle_slices(MpegEncContext *s);
-void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my);
-int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n,
-                                uint8_t **coded_block_ptr);
-int ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr);
-int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
-                            int n, int coded, const uint8_t *scan_table);
-int ff_msmpeg4_pred_dc(MpegEncContext *s, int n,
-                       int16_t **dc_val_ptr, int *dir_ptr);
-int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]);
-
-#define CONFIG_MSMPEG4_DECODER (CONFIG_MSMPEG4V1_DECODER || \
-                                CONFIG_MSMPEG4V2_DECODER || \
-                                CONFIG_MSMPEG4V3_DECODER || \
-                                CONFIG_WMV2_DECODER      || \
-                                CONFIG_VC1_DECODER)
-#define CONFIG_MSMPEG4_ENCODER (CONFIG_MSMPEG4V2_ENCODER || \
-                                CONFIG_MSMPEG4V3_ENCODER || \
-                                CONFIG_WMV2_ENCODER)
-
-#endif /* AVCODEC_MSMPEG4_H */
diff --git a/deps/libav/libavcodec/msmpeg4data.c b/deps/libav/libavcodec/msmpeg4data.c
deleted file mode 100644
index cf291af..0000000
--- a/deps/libav/libavcodec/msmpeg4data.c
+++ /dev/null
@@ -1,1999 +0,0 @@
-/*
- * MSMPEG4 backend for encoder and decoder
- * copyright (c) 2001 Fabrice Bellard
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MSMPEG4 data tables.
- */
-
-#include "h263.h"
-#include "mpeg4video.h"
-#include "msmpeg4data.h"
-
-uint32_t ff_v2_dc_lum_table[512][2];
-uint32_t ff_v2_dc_chroma_table[512][2];
-uint8_t  ff_static_rl_table_store[NB_RL_TABLES][2][2 * MAX_RUN + MAX_LEVEL + 3];
-
-VLC ff_msmp4_mb_i_vlc;
-VLC ff_msmp4_dc_luma_vlc[2];
-VLC ff_msmp4_dc_chroma_vlc[2];
-
-/* intra picture macroblock coded block pattern */
-const uint16_t ff_msmp4_mb_i_table[64][2] = {
-{  0x1, 1 },{  0x17,  6 },{   0x9,  5 },{   0x5,  5 },
-{  0x6, 5 },{  0x47,  9 },{  0x20,  7 },{  0x10,  7 },
-{  0x2, 5 },{  0x7c,  9 },{  0x3a,  7 },{  0x1d,  7 },
-{  0x2, 6 },{  0xec,  9 },{  0x77,  8 },{   0x0,  8 },
-{  0x3, 5 },{  0xb7,  9 },{  0x2c,  7 },{  0x13,  7 },
-{  0x1, 6 },{ 0x168, 10 },{  0x46,  8 },{  0x3f,  8 },
-{ 0x1e, 6 },{ 0x712, 13 },{  0xb5,  9 },{  0x42,  8 },
-{ 0x22, 7 },{ 0x1c5, 11 },{ 0x11e, 10 },{  0x87,  9 },
-{  0x6, 4 },{   0x3,  9 },{  0x1e,  7 },{  0x1c,  6 },
-{ 0x12, 7 },{ 0x388, 12 },{  0x44,  9 },{  0x70,  9 },
-{ 0x1f, 6 },{ 0x23e, 11 },{  0x39,  8 },{  0x8e,  9 },
-{  0x1, 7 },{ 0x1c6, 11 },{  0xb6,  9 },{  0x45,  9 },
-{ 0x14, 6 },{ 0x23f, 11 },{  0x7d,  9 },{  0x18,  9 },
-{  0x7, 7 },{ 0x1c7, 11 },{  0x86,  9 },{  0x19,  9 },
-{ 0x15, 6 },{ 0x1db, 10 },{   0x2,  9 },{  0x46,  9 },
-{  0xd, 8 },{ 0x713, 13 },{ 0x1da, 10 },{ 0x169, 10 },
-};
-
-/* non intra picture macroblock coded block pattern + mb type */
-const uint32_t ff_table_mb_non_intra[128][2] = {
-{   0x40,  7 },{   0x13c9, 13 },{   0x9fd, 12 },{   0x1fc, 15 },
-{  0x9fc, 12 },{    0xa83, 18 },{ 0x12d34, 17 },{  0x83bc, 16 },
-{  0x83a, 12 },{    0x7f8, 17 },{   0x3fd, 16 },{   0x3ff, 16 },
-{   0x79, 13 },{    0xa82, 18 },{  0x969d, 16 },{   0x2a4, 16 },
-{  0x978, 12 },{    0x543, 17 },{  0x41df, 15 },{   0x7f9, 17 },
-{ 0x12f3, 13 },{  0x25a6b, 18 },{ 0x25ef9, 18 },{   0x3fa, 16 },
-{ 0x20ee, 14 },{  0x969ab, 20 },{  0x969c, 16 },{ 0x25ef8, 18 },
-{ 0x12d2, 13 },{    0xa85, 18 },{  0x969e, 16 },{  0x4bc8, 15 },
-{   0x3d, 12 },{  0x12f7f, 17 },{   0x2a2, 16 },{  0x969f, 16 },
-{ 0x25ee, 14 },{ 0x12d355, 21 },{ 0x12f7d, 17 },{ 0x12f7e, 17 },
-{  0x9e5, 12 },{    0xa81, 18 },{ 0x4b4d4, 19 },{  0x83bd, 16 },
-{   0x78, 13 },{   0x969b, 16 },{   0x3fe, 16 },{   0x2a5, 16 },
-{   0x7e, 13 },{    0xa80, 18 },{   0x2a3, 16 },{   0x3fb, 16 },
-{ 0x1076, 13 },{    0xa84, 18 },{   0x153, 15 },{  0x4bc9, 15 },
-{   0x55, 13 },{ 0x12d354, 21 },{  0x4bde, 15 },{  0x25e5, 14 },
-{  0x25b, 10 },{   0x4b4c, 15 },{   0x96b, 12 },{   0x96a, 12 },
-{    0x1,  2 },{      0x0,  7 },{    0x26,  6 },{   0x12b,  9 },
-{    0x7,  3 },{    0x20f, 10 },{     0x4,  9 },{    0x28, 12 },
-{    0x6,  3 },{    0x20a, 10 },{   0x128,  9 },{    0x2b, 12 },
-{   0x11,  5 },{     0x1b, 11 },{   0x13a,  9 },{   0x4ff, 11 },
-{    0x3,  4 },{    0x277, 10 },{   0x106,  9 },{   0x839, 12 },
-{    0xb,  4 },{    0x27b, 10 },{   0x12c,  9 },{   0x4bf, 11 },
-{    0x9,  6 },{     0x35, 12 },{   0x27e, 10 },{  0x13c8, 13 },
-{    0x1,  6 },{    0x4aa, 11 },{   0x208, 10 },{    0x29, 12 },
-{    0x1,  4 },{    0x254, 10 },{   0x12e,  9 },{   0x838, 12 },
-{   0x24,  6 },{    0x4f3, 11 },{   0x276, 10 },{  0x12f6, 13 },
-{    0x1,  5 },{    0x27a, 10 },{   0x13e,  9 },{    0x3e, 12 },
-{    0x8,  6 },{    0x413, 11 },{     0xc, 10 },{   0x4be, 11 },
-{   0x14,  5 },{    0x412, 11 },{   0x253, 10 },{   0x97a, 12 },
-{   0x21,  6 },{    0x4ab, 11 },{   0x20b, 10 },{    0x34, 12 },
-{   0x15,  5 },{    0x278, 10 },{   0x252, 10 },{   0x968, 12 },
-{    0x5,  5 },{      0xb, 10 },{    0x9c,  8 },{     0xe, 10 },
-};
-
-/* dc table 0 */
-
-const uint32_t ff_table0_dc_lum[120][2] = {
-{     0x1,  1 },{      0x1, 2 },{     0x1,  4 },{     0x1,  5 },
-{     0x5,  5 },{      0x7, 5 },{     0x8,  6 },{     0xc,  6 },
-{     0x0,  7 },{      0x2, 7 },{    0x12,  7 },{    0x1a,  7 },
-{     0x3,  8 },{      0x7, 8 },{    0x27,  8 },{    0x37,  8 },
-{     0x5,  9 },{     0x4c, 9 },{    0x6c,  9 },{    0x6d,  9 },
-{     0x8, 10 },{    0x19, 10 },{    0x9b, 10 },{    0x1b, 10 },
-{    0x9a, 10 },{    0x13, 11 },{    0x34, 11 },{    0x35, 11 },
-{    0x61, 12 },{    0x48, 13 },{    0xc4, 13 },{    0x4a, 13 },
-{    0xc6, 13 },{    0xc7, 13 },{    0x92, 14 },{   0x18b, 14 },
-{    0x93, 14 },{   0x183, 14 },{   0x182, 14 },{    0x96, 14 },
-{    0x97, 14 },{   0x180, 14 },{   0x314, 15 },{   0x315, 15 },
-{   0x605, 16 },{   0x604, 16 },{   0x606, 16 },{   0xc0e, 17 },
-{ 0x303cd, 23 },{ 0x303c9, 23 },{ 0x303c8, 23 },{ 0x303ca, 23 },
-{ 0x303cb, 23 },{ 0x303cc, 23 },{ 0x303ce, 23 },{ 0x303cf, 23 },
-{ 0x303d0, 23 },{ 0x303d1, 23 },{ 0x303d2, 23 },{ 0x303d3, 23 },
-{ 0x303d4, 23 },{ 0x303d5, 23 },{ 0x303d6, 23 },{ 0x303d7, 23 },
-{ 0x303d8, 23 },{ 0x303d9, 23 },{ 0x303da, 23 },{ 0x303db, 23 },
-{ 0x303dc, 23 },{ 0x303dd, 23 },{ 0x303de, 23 },{ 0x303df, 23 },
-{ 0x303e0, 23 },{ 0x303e1, 23 },{ 0x303e2, 23 },{ 0x303e3, 23 },
-{ 0x303e4, 23 },{ 0x303e5, 23 },{ 0x303e6, 23 },{ 0x303e7, 23 },
-{ 0x303e8, 23 },{ 0x303e9, 23 },{ 0x303ea, 23 },{ 0x303eb, 23 },
-{ 0x303ec, 23 },{ 0x303ed, 23 },{ 0x303ee, 23 },{ 0x303ef, 23 },
-{ 0x303f0, 23 },{ 0x303f1, 23 },{ 0x303f2, 23 },{ 0x303f3, 23 },
-{ 0x303f4, 23 },{ 0x303f5, 23 },{ 0x303f6, 23 },{ 0x303f7, 23 },
-{ 0x303f8, 23 },{ 0x303f9, 23 },{ 0x303fa, 23 },{ 0x303fb, 23 },
-{ 0x303fc, 23 },{ 0x303fd, 23 },{ 0x303fe, 23 },{ 0x303ff, 23 },
-{ 0x60780, 24 },{ 0x60781, 24 },{ 0x60782, 24 },{ 0x60783, 24 },
-{ 0x60784, 24 },{ 0x60785, 24 },{ 0x60786, 24 },{ 0x60787, 24 },
-{ 0x60788, 24 },{ 0x60789, 24 },{ 0x6078a, 24 },{ 0x6078b, 24 },
-{ 0x6078c, 24 },{ 0x6078d, 24 },{ 0x6078e, 24 },{ 0x6078f, 24 },
-};
-
-const uint32_t ff_table0_dc_chroma[120][2] = {
-{      0x0,  2 },{      0x1,  2 },{      0x5,  3 },{      0x9,  4 },
-{      0xd,  4 },{     0x11,  5 },{     0x1d,  5 },{     0x1f,  5 },
-{     0x21,  6 },{     0x31,  6 },{     0x38,  6 },{     0x33,  6 },
-{     0x39,  6 },{     0x3d,  6 },{     0x61,  7 },{     0x79,  7 },
-{     0x80,  8 },{     0xc8,  8 },{     0xca,  8 },{     0xf0,  8 },
-{     0x81,  8 },{     0xc0,  8 },{     0xc9,  8 },{    0x107,  9 },
-{    0x106,  9 },{    0x196,  9 },{    0x183,  9 },{    0x1e3,  9 },
-{    0x1e2,  9 },{    0x20a, 10 },{    0x20b, 10 },{    0x609, 11 },
-{    0x412, 11 },{    0x413, 11 },{    0x60b, 11 },{    0x411, 11 },
-{    0x60a, 11 },{    0x65f, 11 },{    0x410, 11 },{    0x65d, 11 },
-{    0x65e, 11 },{    0xcb8, 12 },{    0xc10, 12 },{    0xcb9, 12 },
-{   0x1823, 13 },{   0x3045, 14 },{   0x6089, 15 },{   0xc110, 16 },
-{ 0x304448, 22 },{ 0x304449, 22 },{ 0x30444a, 22 },{ 0x30444b, 22 },
-{ 0x30444c, 22 },{ 0x30444d, 22 },{ 0x30444e, 22 },{ 0x30444f, 22 },
-{ 0x304450, 22 },{ 0x304451, 22 },{ 0x304452, 22 },{ 0x304453, 22 },
-{ 0x304454, 22 },{ 0x304455, 22 },{ 0x304456, 22 },{ 0x304457, 22 },
-{ 0x304458, 22 },{ 0x304459, 22 },{ 0x30445a, 22 },{ 0x30445b, 22 },
-{ 0x30445c, 22 },{ 0x30445d, 22 },{ 0x30445e, 22 },{ 0x30445f, 22 },
-{ 0x304460, 22 },{ 0x304461, 22 },{ 0x304462, 22 },{ 0x304463, 22 },
-{ 0x304464, 22 },{ 0x304465, 22 },{ 0x304466, 22 },{ 0x304467, 22 },
-{ 0x304468, 22 },{ 0x304469, 22 },{ 0x30446a, 22 },{ 0x30446b, 22 },
-{ 0x30446c, 22 },{ 0x30446d, 22 },{ 0x30446e, 22 },{ 0x30446f, 22 },
-{ 0x304470, 22 },{ 0x304471, 22 },{ 0x304472, 22 },{ 0x304473, 22 },
-{ 0x304474, 22 },{ 0x304475, 22 },{ 0x304476, 22 },{ 0x304477, 22 },
-{ 0x304478, 22 },{ 0x304479, 22 },{ 0x30447a, 22 },{ 0x30447b, 22 },
-{ 0x30447c, 22 },{ 0x30447d, 22 },{ 0x30447e, 22 },{ 0x30447f, 22 },
-{ 0x608880, 23 },{ 0x608881, 23 },{ 0x608882, 23 },{ 0x608883, 23 },
-{ 0x608884, 23 },{ 0x608885, 23 },{ 0x608886, 23 },{ 0x608887, 23 },
-{ 0x608888, 23 },{ 0x608889, 23 },{ 0x60888a, 23 },{ 0x60888b, 23 },
-{ 0x60888c, 23 },{ 0x60888d, 23 },{ 0x60888e, 23 },{ 0x60888f, 23 },
-};
-
-/* dc table 1 */
-
-const uint32_t ff_table1_dc_lum[120][2] = {
-{      0x2,  2 },{      0x3,  2 },{      0x3,  3 },{      0x2,  4 },
-{      0x5,  4 },{      0x1,  5 },{      0x3,  5 },{      0x8,  5 },
-{      0x0,  6 },{      0x5,  6 },{      0xd,  6 },{      0xf,  6 },
-{     0x13,  6 },{      0x8,  7 },{     0x18,  7 },{     0x1c,  7 },
-{     0x24,  7 },{      0x4,  8 },{      0x6,  8 },{     0x12,  8 },
-{     0x32,  8 },{     0x3b,  8 },{     0x4a,  8 },{     0x4b,  8 },
-{      0xb,  9 },{     0x26,  9 },{     0x27,  9 },{     0x66,  9 },
-{     0x74,  9 },{     0x75,  9 },{     0x14, 10 },{     0x1c, 10 },
-{     0x1f, 10 },{     0x1d, 10 },{     0x2b, 11 },{     0x3d, 11 },
-{    0x19d, 11 },{    0x19f, 11 },{     0x54, 12 },{    0x339, 12 },
-{    0x338, 12 },{    0x33d, 12 },{     0xab, 13 },{     0xf1, 13 },
-{    0x678, 13 },{     0xf2, 13 },{    0x1e0, 14 },{    0x1e1, 14 },
-{    0x154, 14 },{    0xcf2, 14 },{    0x3cc, 15 },{    0x2ab, 15 },
-{   0x19e7, 15 },{    0x3ce, 15 },{   0x19e6, 15 },{    0x554, 16 },
-{    0x79f, 16 },{    0x555, 16 },{    0xf3d, 17 },{    0xf37, 17 },
-{    0xf3c, 17 },{    0xf35, 17 },{   0x1e6d, 18 },{   0x1e68, 18 },
-{   0x3cd8, 19 },{   0x3cd3, 19 },{   0x3cd9, 19 },{   0x79a4, 20 },
-{  0xf34ba, 25 },{  0xf34b4, 25 },{  0xf34b5, 25 },{  0xf34b6, 25 },
-{  0xf34b7, 25 },{  0xf34b8, 25 },{  0xf34b9, 25 },{  0xf34bb, 25 },
-{  0xf34bc, 25 },{  0xf34bd, 25 },{  0xf34be, 25 },{  0xf34bf, 25 },
-{ 0x1e6940, 26 },{ 0x1e6941, 26 },{ 0x1e6942, 26 },{ 0x1e6943, 26 },
-{ 0x1e6944, 26 },{ 0x1e6945, 26 },{ 0x1e6946, 26 },{ 0x1e6947, 26 },
-{ 0x1e6948, 26 },{ 0x1e6949, 26 },{ 0x1e694a, 26 },{ 0x1e694b, 26 },
-{ 0x1e694c, 26 },{ 0x1e694d, 26 },{ 0x1e694e, 26 },{ 0x1e694f, 26 },
-{ 0x1e6950, 26 },{ 0x1e6951, 26 },{ 0x1e6952, 26 },{ 0x1e6953, 26 },
-{ 0x1e6954, 26 },{ 0x1e6955, 26 },{ 0x1e6956, 26 },{ 0x1e6957, 26 },
-{ 0x1e6958, 26 },{ 0x1e6959, 26 },{ 0x1e695a, 26 },{ 0x1e695b, 26 },
-{ 0x1e695c, 26 },{ 0x1e695d, 26 },{ 0x1e695e, 26 },{ 0x1e695f, 26 },
-{ 0x1e6960, 26 },{ 0x1e6961, 26 },{ 0x1e6962, 26 },{ 0x1e6963, 26 },
-{ 0x1e6964, 26 },{ 0x1e6965, 26 },{ 0x1e6966, 26 },{ 0x1e6967, 26 },
-};
-
-const uint32_t ff_table1_dc_chroma[120][2] = {
-{       0x0,  2 },{       0x1,  2 },{       0x4,  3 },{       0x7,  3 },
-{       0xb,  4 },{       0xd,  4 },{      0x15,  5 },{      0x28,  6 },
-{      0x30,  6 },{      0x32,  6 },{      0x52,  7 },{      0x62,  7 },
-{      0x66,  7 },{      0xa6,  8 },{      0xc6,  8 },{      0xcf,  8 },
-{     0x14f,  9 },{     0x18e,  9 },{     0x19c,  9 },{     0x29d, 10 },
-{     0x33a, 10 },{     0x538, 11 },{     0x63c, 11 },{     0x63e, 11 },
-{     0x63f, 11 },{     0x676, 11 },{     0xa73, 12 },{     0xc7a, 12 },
-{     0xcef, 12 },{    0x14e5, 13 },{    0x19dd, 13 },{    0x29c8, 14 },
-{    0x29c9, 14 },{    0x63dd, 15 },{    0x33b8, 14 },{    0x33b9, 14 },
-{    0xc7b6, 16 },{    0x63d8, 15 },{    0x63df, 15 },{    0xc7b3, 16 },
-{    0xc7b4, 16 },{    0xc7b5, 16 },{    0x63de, 15 },{    0xc7b7, 16 },
-{    0xc7b8, 16 },{    0xc7b9, 16 },{   0x18f65, 17 },{   0x31ec8, 18 },
-{  0xc7b248, 24 },{  0xc7b249, 24 },{  0xc7b24a, 24 },{  0xc7b24b, 24 },
-{  0xc7b24c, 24 },{  0xc7b24d, 24 },{  0xc7b24e, 24 },{  0xc7b24f, 24 },
-{  0xc7b250, 24 },{  0xc7b251, 24 },{  0xc7b252, 24 },{  0xc7b253, 24 },
-{  0xc7b254, 24 },{  0xc7b255, 24 },{  0xc7b256, 24 },{  0xc7b257, 24 },
-{  0xc7b258, 24 },{  0xc7b259, 24 },{  0xc7b25a, 24 },{  0xc7b25b, 24 },
-{  0xc7b25c, 24 },{  0xc7b25d, 24 },{  0xc7b25e, 24 },{  0xc7b25f, 24 },
-{  0xc7b260, 24 },{  0xc7b261, 24 },{  0xc7b262, 24 },{  0xc7b263, 24 },
-{  0xc7b264, 24 },{  0xc7b265, 24 },{  0xc7b266, 24 },{  0xc7b267, 24 },
-{  0xc7b268, 24 },{  0xc7b269, 24 },{  0xc7b26a, 24 },{  0xc7b26b, 24 },
-{  0xc7b26c, 24 },{  0xc7b26d, 24 },{  0xc7b26e, 24 },{  0xc7b26f, 24 },
-{  0xc7b270, 24 },{  0xc7b271, 24 },{  0xc7b272, 24 },{  0xc7b273, 24 },
-{  0xc7b274, 24 },{  0xc7b275, 24 },{  0xc7b276, 24 },{  0xc7b277, 24 },
-{  0xc7b278, 24 },{  0xc7b279, 24 },{  0xc7b27a, 24 },{  0xc7b27b, 24 },
-{  0xc7b27c, 24 },{  0xc7b27d, 24 },{  0xc7b27e, 24 },{  0xc7b27f, 24 },
-{ 0x18f6480, 25 },{ 0x18f6481, 25 },{ 0x18f6482, 25 },{ 0x18f6483, 25 },
-{ 0x18f6484, 25 },{ 0x18f6485, 25 },{ 0x18f6486, 25 },{ 0x18f6487, 25 },
-{ 0x18f6488, 25 },{ 0x18f6489, 25 },{ 0x18f648a, 25 },{ 0x18f648b, 25 },
-{ 0x18f648c, 25 },{ 0x18f648d, 25 },{ 0x18f648e, 25 },{ 0x18f648f, 25 },
-};
-
-/* vlc table 0, for intra luma */
-
-static const uint16_t table0_vlc[133][2] = {
-{   0x1,  2 },{   0x6,  3 },{   0xf,  4 },{  0x16,  5 },
-{  0x20,  6 },{  0x18,  7 },{   0x8,  8 },{  0x9a,  8 },
-{  0x56,  9 },{ 0x13e,  9 },{  0xf0, 10 },{ 0x3a5, 10 },
-{  0x77, 11 },{ 0x1ef, 11 },{  0x9a, 12 },{  0x5d, 13 },
-{   0x1,  4 },{  0x11,  5 },{   0x2,  7 },{   0xb,  8 },
-{  0x12,  9 },{ 0x1d6,  9 },{ 0x27e, 10 },{ 0x191, 11 },
-{  0xea, 12 },{ 0x3dc, 12 },{ 0x13b, 13 },{   0x4,  5 },
-{  0x14,  7 },{  0x9e,  8 },{   0x9, 10 },{ 0x1ac, 11 },
-{ 0x1e2, 11 },{ 0x3ca, 12 },{  0x5f, 13 },{  0x17,  5 },
-{  0x4e,  7 },{  0x5e,  9 },{  0xf3, 10 },{ 0x1ad, 11 },
-{  0xec, 12 },{ 0x5f0, 13 },{   0xe,  6 },{  0xe1,  8 },
-{ 0x3a4, 10 },{  0x9c, 12 },{ 0x13d, 13 },{  0x3b,  6 },
-{  0x1c,  9 },{  0x14, 11 },{ 0x9be, 12 },{   0x6,  7 },
-{  0x7a,  9 },{ 0x190, 11 },{ 0x137, 13 },{  0x1b,  7 },
-{   0x8, 10 },{ 0x75c, 11 },{  0x71,  7 },{  0xd7, 10 },
-{ 0x9bf, 12 },{   0x7,  8 },{  0xaf, 10 },{ 0x4cc, 11 },
-{  0x34,  8 },{ 0x265, 10 },{  0x9f, 12 },{  0xe0,  8 },
-{  0x16, 11 },{ 0x327, 12 },{  0x15,  9 },{ 0x17d, 11 },
-{ 0xebb, 12 },{  0x14,  9 },{  0xf6, 10 },{ 0x1e4, 11 },
-{  0xcb, 10 },{ 0x99d, 12 },{  0xca, 10 },{ 0x2fc, 12 },
-{ 0x17f, 11 },{ 0x4cd, 11 },{ 0x2fd, 12 },{ 0x4fe, 11 },
-{ 0x13a, 13 },{   0xa,  4 },{  0x42,  7 },{ 0x1d3,  9 },
-{ 0x4dd, 11 },{  0x12,  5 },{  0xe8,  8 },{  0x4c, 11 },
-{ 0x136, 13 },{  0x39,  6 },{ 0x264, 10 },{ 0xeba, 12 },
-{   0x0,  7 },{  0xae, 10 },{ 0x99c, 12 },{  0x1f,  7 },
-{ 0x4de, 11 },{  0x43,  7 },{ 0x4dc, 11 },{   0x3,  8 },
-{ 0x3cb, 12 },{   0x6,  8 },{ 0x99e, 12 },{  0x2a,  8 },
-{ 0x5f1, 13 },{   0xf,  8 },{ 0x9fe, 12 },{  0x33,  8 },
-{ 0x9ff, 12 },{  0x98,  8 },{ 0x99f, 12 },{  0xea,  8 },
-{ 0x13c, 13 },{  0x2e,  8 },{ 0x192, 11 },{ 0x136,  9 },
-{  0x6a,  9 },{  0x15, 11 },{ 0x3af, 10 },{ 0x1e3, 11 },
-{  0x74, 11 },{  0xeb, 12 },{ 0x2f9, 12 },{  0x5c, 13 },
-{  0xed, 12 },{ 0x3dd, 12 },{ 0x326, 12 },{  0x5e, 13 },
-{  0x16,  7 },
-};
-
-static const int8_t table0_level[132] = {
-  1,  2,  3,  4,  5,  6,  7,  8,
-  9, 10, 11, 12, 13, 14, 15, 16,
-  1,  2,  3,  4,  5,  6,  7,  8,
-  9, 10, 11,  1,  2,  3,  4,  5,
-  6,  7,  8,  1,  2,  3,  4,  5,
-  6,  7,  1,  2,  3,  4,  5,  1,
-  2,  3,  4,  1,  2,  3,  4,  1,
-  2,  3,  1,  2,  3,  1,  2,  3,
-  1,  2,  3,  1,  2,  3,  1,  2,
-  3,  1,  2,  3,  1,  2,  1,  2,
-  1,  1,  1,  1,  1,  1,  2,  3,
-  4,  1,  2,  3,  4,  1,  2,  3,
-  1,  2,  3,  1,  2,  1,  2,  1,
-  2,  1,  2,  1,  2,  1,  2,  1,
-  2,  1,  2,  1,  2,  1,  2,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,
-};
-
-static const int8_t table0_run[132] = {
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  2,  2,  2,  2,  2,
-  2,  2,  2,  3,  3,  3,  3,  3,
-  3,  3,  4,  4,  4,  4,  4,  5,
-  5,  5,  5,  6,  6,  6,  6,  7,
-  7,  7,  8,  8,  8,  9,  9,  9,
- 10, 10, 10, 11, 11, 11, 12, 12,
- 12, 13, 13, 13, 14, 14, 15, 15,
- 16, 17, 18, 19, 20,  0,  0,  0,
-  0,  1,  1,  1,  1,  2,  2,  2,
-  3,  3,  3,  4,  4,  5,  5,  6,
-  6,  7,  7,  8,  8,  9,  9, 10,
- 10, 11, 11, 12, 12, 13, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26,
-};
-
-/* vlc table 1, for intra chroma and P macroblocks */
-
-static const uint16_t table1_vlc[149][2] = {
-{    0x4,  3 },{   0x14,  5 },{   0x17,  7 },{   0x7f,  8 },
-{  0x154,  9 },{  0x1f2, 10 },{   0xbf, 11 },{   0x65, 12 },
-{  0xaaa, 12 },{  0x630, 13 },{ 0x1597, 13 },{  0x3b7, 14 },
-{ 0x2b22, 14 },{  0xbe6, 15 },{    0xb,  4 },{   0x37,  7 },
-{   0x62,  9 },{    0x7, 11 },{  0x166, 12 },{   0xce, 13 },
-{ 0x1590, 13 },{  0x5f6, 14 },{  0xbe7, 15 },{    0x7,  5 },
-{   0x6d,  8 },{    0x3, 11 },{  0x31f, 12 },{  0x5f2, 14 },
-{    0x2,  6 },{   0x61,  9 },{   0x55, 12 },{  0x1df, 14 },
-{   0x1a,  6 },{   0x1e, 10 },{  0xac9, 12 },{ 0x2b23, 14 },
-{   0x1e,  6 },{   0x1f, 10 },{  0xac3, 12 },{ 0x2b2b, 14 },
-{    0x6,  7 },{    0x4, 11 },{  0x2f8, 13 },{   0x19,  7 },
-{    0x6, 11 },{  0x63d, 13 },{   0x57,  7 },{  0x182, 11 },
-{ 0x2aa2, 14 },{    0x4,  8 },{  0x180, 11 },{  0x59c, 14 },
-{   0x7d,  8 },{  0x164, 12 },{  0x76d, 15 },{    0x2,  9 },
-{  0x18d, 11 },{ 0x1581, 13 },{   0xad,  8 },{   0x60, 12 },
-{  0xc67, 14 },{   0x1c,  9 },{   0xee, 13 },{    0x3,  9 },
-{  0x2cf, 13 },{   0xd9,  9 },{ 0x1580, 13 },{    0x2, 11 },
-{  0x183, 11 },{   0x57, 12 },{   0x61, 12 },{   0x31, 11 },
-{   0x66, 12 },{  0x631, 13 },{  0x632, 13 },{   0xac, 13 },
-{  0x31d, 12 },{   0x76, 12 },{   0x3a, 11 },{  0x165, 12 },
-{  0xc66, 14 },{    0x3,  2 },{   0x54,  7 },{  0x2ab, 10 },
-{   0x16, 13 },{  0x5f7, 14 },{    0x5,  4 },{   0xf8,  9 },
-{  0xaa9, 12 },{   0x5f, 15 },{    0x4,  4 },{   0x1c, 10 },
-{ 0x1550, 13 },{    0x4,  5 },{   0x77, 11 },{  0x76c, 15 },
-{    0xe,  5 },{    0xa, 12 },{    0xc,  5 },{  0x562, 11 },
-{    0x4,  6 },{  0x31c, 12 },{    0x6,  6 },{   0xc8, 13 },
-{    0xd,  6 },{  0x1da, 13 },{    0x7,  6 },{   0xc9, 13 },
-{    0x1,  7 },{   0x2e, 14 },{   0x14,  7 },{ 0x1596, 13 },
-{    0xa,  7 },{  0xac2, 12 },{   0x16,  7 },{  0x15b, 14 },
-{   0x15,  7 },{  0x15a, 14 },{    0xf,  8 },{   0x5e, 15 },
-{   0x7e,  8 },{   0xab,  8 },{   0x2d,  9 },{   0xd8,  9 },
-{    0xb,  9 },{   0x14, 10 },{  0x2b3, 10 },{  0x1f3, 10 },
-{   0x3a, 10 },{    0x0, 10 },{   0x58, 10 },{   0x2e,  9 },
-{   0x5e, 10 },{  0x563, 11 },{   0xec, 12 },{   0x54, 12 },
-{  0xac1, 12 },{ 0x1556, 13 },{  0x2fa, 13 },{  0x181, 11 },
-{ 0x1557, 13 },{  0x59d, 14 },{ 0x2aa3, 14 },{ 0x2b2a, 14 },
-{  0x1de, 14 },{  0x63c, 13 },{   0xcf, 13 },{ 0x1594, 13 },
-{    0xd,  9 },
-};
-
-static const int8_t table1_level[148] = {
-  1,  2,  3,  4,  5,  6,  7,  8,
-  9, 10, 11, 12, 13, 14,  1,  2,
-  3,  4,  5,  6,  7,  8,  9,  1,
-  2,  3,  4,  5,  1,  2,  3,  4,
-  1,  2,  3,  4,  1,  2,  3,  4,
-  1,  2,  3,  1,  2,  3,  1,  2,
-  3,  1,  2,  3,  1,  2,  3,  1,
-  2,  3,  1,  2,  3,  1,  2,  1,
-  2,  1,  2,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  2,  3,  4,  5,  1,  2,
-  3,  4,  1,  2,  3,  1,  2,  3,
-  1,  2,  1,  2,  1,  2,  1,  2,
-  1,  2,  1,  2,  1,  2,  1,  2,
-  1,  2,  1,  2,  1,  2,  1,  2,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,
-};
-
-static const int8_t table1_run[148] = {
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  2,
-  2,  2,  2,  2,  3,  3,  3,  3,
-  4,  4,  4,  4,  5,  5,  5,  5,
-  6,  6,  6,  7,  7,  7,  8,  8,
-  8,  9,  9,  9, 10, 10, 10, 11,
- 11, 11, 12, 12, 12, 13, 13, 14,
- 14, 15, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29,  0,  0,  0,  0,  0,  1,  1,
-  1,  1,  2,  2,  2,  3,  3,  3,
-  4,  4,  5,  5,  6,  6,  7,  7,
-  8,  8,  9,  9, 10, 10, 11, 11,
- 12, 12, 13, 13, 14, 14, 15, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43,
-};
-
-/* third vlc table */
-
-static const uint16_t table2_vlc[186][2] = {
-{    0x1,  2 },{    0x5,  3 },{    0xd,  4 },{   0x12,  5 },
-{    0xe,  6 },{   0x15,  7 },{   0x13,  8 },{   0x3f,  8 },
-{   0x4b,  9 },{  0x11f,  9 },{   0xb8, 10 },{  0x3e3, 10 },
-{  0x172, 11 },{  0x24d, 12 },{  0x3da, 12 },{  0x2dd, 13 },
-{ 0x1f55, 13 },{  0x5b9, 14 },{ 0x3eae, 14 },{    0x0,  4 },
-{   0x10,  5 },{    0x8,  7 },{   0x20,  8 },{   0x29,  9 },
-{  0x1f4,  9 },{  0x233, 10 },{  0x1e0, 11 },{  0x12a, 12 },
-{  0x3dd, 12 },{  0x50a, 13 },{ 0x1f29, 13 },{  0xa42, 14 },
-{ 0x1272, 15 },{ 0x1737, 15 },{    0x3,  5 },{   0x11,  7 },
-{   0xc4,  8 },{   0x4b, 10 },{   0xb4, 11 },{  0x7d4, 11 },
-{  0x345, 12 },{  0x2d7, 13 },{  0x7bf, 13 },{  0x938, 14 },
-{  0xbbb, 14 },{  0x95e, 15 },{   0x13,  5 },{   0x78,  7 },
-{   0x69,  9 },{  0x232, 10 },{  0x461, 11 },{  0x3ec, 12 },
-{  0x520, 13 },{ 0x1f2a, 13 },{ 0x3e50, 14 },{ 0x3e51, 14 },
-{ 0x1486, 15 },{    0xc,  6 },{   0x24,  9 },{   0x94, 11 },
-{  0x8c0, 12 },{  0xf09, 14 },{ 0x1ef0, 15 },{   0x3d,  6 },
-{   0x53,  9 },{  0x1a0, 11 },{  0x2d6, 13 },{  0xf08, 14 },
-{   0x13,  7 },{   0x7c,  9 },{  0x7c1, 11 },{  0x4ac, 14 },
-{   0x1b,  7 },{   0xa0, 10 },{  0x344, 12 },{  0xf79, 14 },
-{   0x79,  7 },{  0x3e1, 10 },{  0x2d4, 13 },{ 0x2306, 14 },
-{   0x21,  8 },{  0x23c, 10 },{  0xfae, 12 },{ 0x23de, 14 },
-{   0x35,  8 },{  0x175, 11 },{  0x7b3, 13 },{   0xc5,  8 },
-{  0x174, 11 },{  0x785, 13 },{   0x48,  9 },{  0x1a3, 11 },
-{  0x49e, 13 },{   0x2c,  9 },{   0xfa, 10 },{  0x7d6, 11 },
-{   0x92, 10 },{  0x5cc, 13 },{ 0x1ef1, 15 },{   0xa3, 10 },
-{  0x3ed, 12 },{  0x93e, 14 },{  0x1e2, 11 },{ 0x1273, 15 },
-{  0x7c4, 11 },{ 0x1487, 15 },{  0x291, 12 },{  0x293, 12 },
-{  0xf8a, 12 },{  0x509, 13 },{  0x508, 13 },{  0x78d, 13 },
-{  0x7be, 13 },{  0x78c, 13 },{  0x4ae, 14 },{  0xbba, 14 },
-{ 0x2307, 14 },{  0xb9a, 14 },{ 0x1736, 15 },{    0xe,  4 },
-{   0x45,  7 },{  0x1f3,  9 },{  0x47a, 11 },{  0x5dc, 13 },
-{ 0x23df, 14 },{   0x19,  5 },{   0x28,  9 },{  0x176, 11 },
-{  0x49d, 13 },{ 0x23dd, 14 },{   0x30,  6 },{   0xa2, 10 },
-{  0x2ef, 12 },{  0x5b8, 14 },{   0x3f,  6 },{   0xa5, 10 },
-{  0x3db, 12 },{  0x93f, 14 },{   0x44,  7 },{  0x7cb, 11 },
-{  0x95f, 15 },{   0x63,  7 },{  0x3c3, 12 },{   0x15,  8 },
-{  0x8f6, 12 },{   0x17,  8 },{  0x498, 13 },{   0x2c,  8 },
-{  0x7b2, 13 },{   0x2f,  8 },{ 0x1f54, 13 },{   0x8d,  8 },
-{  0x7bd, 13 },{   0x8e,  8 },{ 0x1182, 13 },{   0xfb,  8 },
-{  0x50b, 13 },{   0x2d,  8 },{  0x7c0, 11 },{   0x79,  9 },
-{ 0x1f5f, 13 },{   0x7a,  9 },{ 0x1f56, 13 },{  0x231, 10 },
-{  0x3e4, 10 },{  0x1a1, 11 },{  0x143, 11 },{  0x1f7, 11 },
-{  0x16f, 12 },{  0x292, 12 },{  0x2e7, 12 },{  0x16c, 12 },
-{  0x16d, 12 },{  0x3dc, 12 },{  0xf8b, 12 },{  0x499, 13 },
-{  0x3d8, 12 },{  0x78e, 13 },{  0x2d5, 13 },{ 0x1f5e, 13 },
-{ 0x1f2b, 13 },{  0x78f, 13 },{  0x4ad, 14 },{ 0x3eaf, 14 },
-{ 0x23dc, 14 },{   0x4a,  9 },
-};
-
-static const int8_t table2_level[185] = {
-  1,  2,  3,  4,  5,  6,  7,  8,
-  9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19,  1,  2,  3,  4,  5,
-  6,  7,  8,  9, 10, 11, 12, 13,
- 14, 15,  1,  2,  3,  4,  5,  6,
-  7,  8,  9, 10, 11, 12,  1,  2,
-  3,  4,  5,  6,  7,  8,  9, 10,
- 11,  1,  2,  3,  4,  5,  6,  1,
-  2,  3,  4,  5,  1,  2,  3,  4,
-  1,  2,  3,  4,  1,  2,  3,  4,
-  1,  2,  3,  4,  1,  2,  3,  1,
-  2,  3,  1,  2,  3,  1,  2,  3,
-  1,  2,  3,  1,  2,  3,  1,  2,
-  1,  2,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  2,  3,  4,  5,  6,  1,  2,  3,
-  4,  5,  1,  2,  3,  4,  1,  2,
-  3,  4,  1,  2,  3,  1,  2,  1,
-  2,  1,  2,  1,  2,  1,  2,  1,
-  2,  1,  2,  1,  2,  1,  2,  1,
-  2,  1,  2,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,
-};
-
-static const int8_t table2_run[185] = {
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  2,  2,  2,  2,  2,  2,
-  2,  2,  2,  2,  2,  2,  3,  3,
-  3,  3,  3,  3,  3,  3,  3,  3,
-  3,  4,  4,  4,  4,  4,  4,  5,
-  5,  5,  5,  5,  6,  6,  6,  6,
-  7,  7,  7,  7,  8,  8,  8,  8,
-  9,  9,  9,  9, 10, 10, 10, 11,
- 11, 11, 12, 12, 12, 13, 13, 13,
- 14, 14, 14, 15, 15, 15, 16, 16,
- 17, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30,  0,
-  0,  0,  0,  0,  0,  1,  1,  1,
-  1,  1,  2,  2,  2,  2,  3,  3,
-  3,  3,  4,  4,  4,  5,  5,  6,
-  6,  7,  7,  8,  8,  9,  9, 10,
- 10, 11, 11, 12, 12, 13, 13, 14,
- 14, 15, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36,
- 37,
-};
-
-/* second non intra vlc table */
-static const uint16_t table4_vlc[169][2] = {
-{    0x0,  3 },{    0x3,  4 },{    0xb,  5 },{   0x14,  6 },
-{   0x3f,  6 },{   0x5d,  7 },{   0xa2,  8 },{   0xac,  9 },
-{  0x16e,  9 },{  0x20a, 10 },{  0x2e2, 10 },{  0x432, 11 },
-{  0x5c9, 11 },{  0x827, 12 },{  0xb54, 12 },{  0x4e6, 13 },
-{ 0x105f, 13 },{ 0x172a, 13 },{ 0x20b2, 14 },{ 0x2d4e, 14 },
-{ 0x39f0, 14 },{ 0x4175, 15 },{ 0x5a9e, 15 },{    0x4,  4 },
-{   0x1e,  5 },{   0x42,  7 },{   0xb6,  8 },{  0x173,  9 },
-{  0x395, 10 },{  0x72e, 11 },{  0xb94, 12 },{ 0x16a4, 13 },
-{ 0x20b3, 14 },{ 0x2e45, 14 },{    0x5,  5 },{   0x40,  7 },
-{   0x49,  9 },{  0x28f, 10 },{  0x5cb, 11 },{  0x48a, 13 },
-{  0x9dd, 14 },{ 0x73e2, 15 },{   0x18,  5 },{   0x25,  8 },
-{   0x8a, 10 },{  0x51b, 11 },{  0xe5f, 12 },{  0x9c9, 14 },
-{ 0x139c, 15 },{   0x29,  6 },{   0x4f,  9 },{  0x412, 11 },
-{  0x48d, 13 },{ 0x2e41, 14 },{   0x38,  6 },{  0x10e,  9 },
-{  0x5a8, 11 },{ 0x105c, 13 },{ 0x39f2, 14 },{   0x58,  7 },
-{  0x21f, 10 },{  0xe7e, 12 },{ 0x39ff, 14 },{   0x23,  8 },
-{  0x2e3, 10 },{  0x4e5, 13 },{ 0x2e40, 14 },{   0xa1,  8 },
-{  0x5be, 11 },{  0x9c8, 14 },{   0x83,  8 },{  0x13a, 11 },
-{ 0x1721, 13 },{   0x44,  9 },{  0x276, 12 },{ 0x39f6, 14 },
-{   0x8b, 10 },{  0x4ef, 13 },{ 0x5a9b, 15 },{  0x208, 10 },
-{ 0x1cfe, 13 },{  0x399, 10 },{ 0x1cb4, 13 },{  0x39e, 10 },
-{ 0x39f3, 14 },{  0x5ab, 11 },{ 0x73e3, 15 },{  0x737, 11 },
-{ 0x5a9f, 15 },{  0x82d, 12 },{  0xe69, 12 },{  0xe68, 12 },
-{  0x433, 11 },{  0xb7b, 12 },{ 0x2df8, 14 },{ 0x2e56, 14 },
-{ 0x2e57, 14 },{ 0x39f7, 14 },{ 0x51a5, 15 },{    0x3,  3 },
-{   0x2a,  6 },{   0xe4,  8 },{  0x28e, 10 },{  0x735, 11 },
-{ 0x1058, 13 },{ 0x1cfa, 13 },{ 0x2df9, 14 },{ 0x4174, 15 },
-{    0x9,  4 },{   0x54,  8 },{  0x398, 10 },{  0x48b, 13 },
-{ 0x139d, 15 },{    0xd,  4 },{   0xad,  9 },{  0x826, 12 },
-{ 0x2d4c, 14 },{   0x11,  5 },{  0x16b,  9 },{  0xb7f, 12 },
-{ 0x51a4, 15 },{   0x19,  5 },{  0x21b, 10 },{ 0x16fd, 13 },
-{   0x1d,  5 },{  0x394, 10 },{ 0x28d3, 14 },{   0x2b,  6 },
-{  0x5bc, 11 },{ 0x5a9a, 15 },{   0x2f,  6 },{  0x247, 12 },
-{   0x10,  7 },{  0xa35, 12 },{   0x3e,  6 },{  0xb7a, 12 },
-{   0x59,  7 },{ 0x105e, 13 },{   0x26,  8 },{  0x9cf, 14 },
-{   0x55,  8 },{ 0x1cb5, 13 },{   0x57,  8 },{  0xe5b, 12 },
-{   0xa0,  8 },{ 0x1468, 13 },{  0x170,  9 },{   0x90, 10 },
-{  0x1ce,  9 },{  0x21a, 10 },{  0x218, 10 },{  0x168,  9 },
-{  0x21e, 10 },{  0x244, 12 },{  0x736, 11 },{  0x138, 11 },
-{  0x519, 11 },{  0xe5e, 12 },{  0x72c, 11 },{  0xb55, 12 },
-{  0x9dc, 14 },{ 0x20bb, 14 },{  0x48c, 13 },{ 0x1723, 13 },
-{ 0x2e44, 14 },{ 0x16a5, 13 },{  0x518, 11 },{ 0x39fe, 14 },
-{  0x169,  9 },
-};
-
-static const int8_t table4_level[168] = {
-  1,  2,  3,  4,  5,  6,  7,  8,
-  9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23,  1,
-  2,  3,  4,  5,  6,  7,  8,  9,
- 10, 11,  1,  2,  3,  4,  5,  6,
-  7,  8,  1,  2,  3,  4,  5,  6,
-  7,  1,  2,  3,  4,  5,  1,  2,
-  3,  4,  5,  1,  2,  3,  4,  1,
-  2,  3,  4,  1,  2,  3,  1,  2,
-  3,  1,  2,  3,  1,  2,  3,  1,
-  2,  1,  2,  1,  2,  1,  2,  1,
-  2,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  2,  3,  4,  5,
-  6,  7,  8,  9,  1,  2,  3,  4,
-  5,  1,  2,  3,  4,  1,  2,  3,
-  4,  1,  2,  3,  1,  2,  3,  1,
-  2,  3,  1,  2,  1,  2,  1,  2,
-  1,  2,  1,  2,  1,  2,  1,  2,
-  1,  2,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-};
-
-static const int8_t table4_run[168] = {
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  2,  2,  2,  2,  2,  2,
-  2,  2,  3,  3,  3,  3,  3,  3,
-  3,  4,  4,  4,  4,  4,  5,  5,
-  5,  5,  5,  6,  6,  6,  6,  7,
-  7,  7,  7,  8,  8,  8,  9,  9,
-  9, 10, 10, 10, 11, 11, 11, 12,
- 12, 13, 13, 14, 14, 15, 15, 16,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26,  0,  0,  0,  0,  0,
-  0,  0,  0,  0,  1,  1,  1,  1,
-  1,  2,  2,  2,  2,  3,  3,  3,
-  3,  4,  4,  4,  5,  5,  5,  6,
-  6,  6,  7,  7,  8,  8,  9,  9,
- 10, 10, 11, 11, 12, 12, 13, 13,
- 14, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36,
-};
-
-RLTable ff_rl_table[NB_RL_TABLES] = {
-    /* intra luminance tables */
-    /* low motion  */
-    {
-        132,
-        85,
-        table0_vlc,
-        table0_run,
-        table0_level,
-    },
-    /* high motion */
-    {
-        185,
-        119,
-        table2_vlc,
-        table2_run,
-        table2_level,
-    },
-    /* mid-rate */
-    {
-        102,
-        67,
-        ff_mpeg4_intra_vlc,
-        ff_mpeg4_intra_run,
-        ff_mpeg4_intra_level,
-    },
-    /* intra chrominance / non intra tables */
-    /* low motion inter */
-    {
-        148,
-        81,
-        table1_vlc,
-        table1_run,
-        table1_level,
-    },
-    /* high motion inter */
-    {
-        168,
-        99,
-        table4_vlc,
-        table4_run,
-        table4_level,
-    },
-    /* mid rate inter */
-    {
-        102,
-        58,
-        ff_inter_vlc,
-        ff_inter_run,
-        ff_inter_level,
-    },
-};
-
-/* motion vector table 0 */
-
-static const uint16_t table0_mv_code[1100] = {
- 0x0001, 0x0003, 0x0005, 0x0007, 0x0003, 0x0008, 0x000c, 0x0001,
- 0x0002, 0x001b, 0x0006, 0x000b, 0x0015, 0x0002, 0x000e, 0x000f,
- 0x0014, 0x0020, 0x0022, 0x0025, 0x0027, 0x0029, 0x002d, 0x004b,
- 0x004d, 0x0003, 0x0022, 0x0023, 0x0025, 0x0027, 0x0042, 0x0048,
- 0x0049, 0x0050, 0x005c, 0x0091, 0x009f, 0x000e, 0x0043, 0x004c,
- 0x0054, 0x0056, 0x008c, 0x0098, 0x009a, 0x009b, 0x00b1, 0x00b2,
- 0x0120, 0x0121, 0x0126, 0x0133, 0x0139, 0x01a1, 0x01a4, 0x01a5,
- 0x01a6, 0x01a7, 0x01ae, 0x01af, 0x000b, 0x0019, 0x0085, 0x0090,
- 0x009b, 0x00aa, 0x00af, 0x010c, 0x010e, 0x011c, 0x011e, 0x0133,
- 0x0144, 0x0160, 0x0174, 0x0175, 0x0177, 0x0178, 0x0249, 0x024b,
- 0x0252, 0x0261, 0x0265, 0x0270, 0x0352, 0x0353, 0x0355, 0x0359,
- 0x0010, 0x0011, 0x0013, 0x0034, 0x0035, 0x0036, 0x0037, 0x003d,
- 0x003e, 0x0109, 0x0126, 0x0156, 0x021a, 0x021e, 0x023a, 0x023e,
- 0x028e, 0x028f, 0x02cf, 0x0491, 0x0494, 0x049f, 0x04a0, 0x04a3,
- 0x04a6, 0x04a7, 0x04ad, 0x04ae, 0x04c0, 0x04c4, 0x04c6, 0x04c8,
- 0x04c9, 0x04f5, 0x04f6, 0x04f7, 0x0680, 0x0682, 0x0683, 0x0688,
- 0x0689, 0x068d, 0x068e, 0x068f, 0x06a2, 0x06a3, 0x06a9, 0x06b0,
- 0x06b1, 0x06b4, 0x06b5, 0x0024, 0x0060, 0x0063, 0x0078, 0x0079,
- 0x0211, 0x0244, 0x0245, 0x0247, 0x0248, 0x0249, 0x024a, 0x024b,
- 0x026b, 0x02af, 0x02b8, 0x02bb, 0x0436, 0x0476, 0x0477, 0x047e,
- 0x04c8, 0x04c9, 0x04ca, 0x0514, 0x0586, 0x0587, 0x0598, 0x059d,
- 0x05d9, 0x05da, 0x0920, 0x0921, 0x093b, 0x093c, 0x093d, 0x0942,
- 0x0943, 0x0944, 0x0945, 0x0959, 0x095e, 0x095f, 0x0982, 0x0983,
- 0x098e, 0x098f, 0x09c4, 0x09e7, 0x09e8, 0x09e9, 0x0d02, 0x0d17,
- 0x0d18, 0x0d19, 0x0d41, 0x0d42, 0x0d43, 0x0d50, 0x0d5f, 0x0d6d,
- 0x0d6e, 0x0d6f, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
- 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x041e, 0x041f, 0x0420, 0x0421,
- 0x048c, 0x048d, 0x04d3, 0x04d4, 0x04d5, 0x055c, 0x055d, 0x0572,
- 0x0573, 0x0574, 0x0575, 0x08de, 0x08df, 0x08fe, 0x08ff, 0x0996,
- 0x0a36, 0x0a37, 0x0b08, 0x0b09, 0x0b0a, 0x0b0b, 0x0b32, 0x0b33,
- 0x0b34, 0x0b35, 0x0b36, 0x0b37, 0x0b38, 0x0b39, 0x0bb0, 0x0bf7,
- 0x0bf8, 0x0bf9, 0x0bfa, 0x0bfb, 0x0bfc, 0x0bfd, 0x0bfe, 0x0bff,
- 0x1254, 0x1255, 0x1256, 0x1257, 0x1270, 0x1271, 0x1272, 0x1273,
- 0x1274, 0x1275, 0x12ab, 0x12ac, 0x12ad, 0x12ae, 0x12af, 0x12b0,
- 0x12b1, 0x1315, 0x1316, 0x1317, 0x13bf, 0x13c0, 0x13c1, 0x13c2,
- 0x13c3, 0x13c4, 0x13c5, 0x13c6, 0x13c7, 0x13c8, 0x13c9, 0x13ca,
- 0x13cb, 0x13cc, 0x13cd, 0x1a06, 0x1a07, 0x1a28, 0x1a29, 0x1a2a,
- 0x1a2b, 0x1a2c, 0x1a2d, 0x1a80, 0x1abb, 0x1abc, 0x1abd, 0x1ad8,
- 0x1ad9, 0x0094, 0x0095, 0x0096, 0x0097, 0x00a0, 0x00a1, 0x00a2,
- 0x00a3, 0x0831, 0x0832, 0x0833, 0x0834, 0x0835, 0x0836, 0x0837,
- 0x0838, 0x0839, 0x083a, 0x083b, 0x0939, 0x093a, 0x093b, 0x093c,
- 0x093d, 0x093e, 0x093f, 0x09a0, 0x09a1, 0x09a2, 0x09a3, 0x09a4,
- 0x09a5, 0x11ac, 0x11ad, 0x11ae, 0x11af, 0x11b0, 0x11b1, 0x11b2,
- 0x11b3, 0x11b4, 0x11b5, 0x11b6, 0x11b7, 0x11b8, 0x11b9, 0x11ba,
- 0x11bb, 0x132f, 0x1454, 0x1455, 0x1456, 0x1457, 0x1458, 0x1459,
- 0x145a, 0x145b, 0x145c, 0x145d, 0x145e, 0x145f, 0x1460, 0x1461,
- 0x1462, 0x1463, 0x1464, 0x1465, 0x1466, 0x1467, 0x1468, 0x1469,
- 0x146a, 0x146b, 0x17de, 0x17df, 0x17e0, 0x17e1, 0x17e2, 0x17e3,
- 0x17e4, 0x17e5, 0x17e6, 0x17e7, 0x17e8, 0x17e9, 0x17ea, 0x17eb,
- 0x17ec, 0x17ed, 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545,
- 0x2546, 0x2547, 0x2548, 0x2549, 0x254a, 0x254b, 0x254c, 0x254d,
- 0x254e, 0x254f, 0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555,
- 0x2628, 0x2766, 0x2767, 0x2768, 0x2769, 0x276a, 0x276b, 0x276c,
- 0x276d, 0x276e, 0x276f, 0x2770, 0x2771, 0x2772, 0x2773, 0x2774,
- 0x2775, 0x2776, 0x2777, 0x2778, 0x2779, 0x277a, 0x277b, 0x277c,
- 0x277d, 0x3503, 0x3544, 0x3545, 0x3546, 0x3547, 0x3560, 0x3561,
- 0x3562, 0x3563, 0x3564, 0x3565, 0x3566, 0x3567, 0x3568, 0x3569,
- 0x356a, 0x356b, 0x356c, 0x356d, 0x356e, 0x356f, 0x3570, 0x3571,
- 0x3572, 0x3573, 0x3574, 0x3575, 0x03f0, 0x103d, 0x103e, 0x103f,
- 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047,
- 0x1048, 0x1049, 0x104a, 0x104b, 0x104c, 0x104d, 0x104e, 0x104f,
- 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057,
- 0x1058, 0x1059, 0x105a, 0x105b, 0x105c, 0x105d, 0x105e, 0x105f,
- 0x1060, 0x1061, 0x1270, 0x1271, 0x21b8, 0x21b9, 0x21ba, 0x21bb,
- 0x21bc, 0x21bd, 0x21be, 0x21bf, 0x21f0, 0x21f1, 0x21f2, 0x21f3,
- 0x21f4, 0x21f5, 0x21f6, 0x21f7, 0x21f8, 0x21f9, 0x21fa, 0x21fb,
- 0x21fc, 0x21fd, 0x21fe, 0x21ff, 0x2340, 0x2341, 0x2342, 0x2343,
- 0x2344, 0x2345, 0x2346, 0x2347, 0x2348, 0x2349, 0x234a, 0x234b,
- 0x234c, 0x234d, 0x234e, 0x234f, 0x2350, 0x2351, 0x2352, 0x2353,
- 0x2354, 0x2355, 0x2356, 0x2357, 0x265c, 0x2f88, 0x2f89, 0x2f8a,
- 0x2f8b, 0x2f8c, 0x2f8d, 0x2f8e, 0x2f8f, 0x2f90, 0x2f91, 0x2f92,
- 0x2f93, 0x2f94, 0x2f95, 0x2f96, 0x2f97, 0x2f98, 0x2f99, 0x2f9a,
- 0x2f9b, 0x2f9c, 0x2f9d, 0x2f9e, 0x2f9f, 0x2fa0, 0x2fa1, 0x2fa2,
- 0x2fa3, 0x2fa4, 0x2fa5, 0x2fa6, 0x2fa7, 0x2fa8, 0x2fa9, 0x2faa,
- 0x2fab, 0x2fac, 0x2fad, 0x2fae, 0x2faf, 0x2fb0, 0x2fb1, 0x2fb2,
- 0x2fb3, 0x2fb4, 0x2fb5, 0x2fb6, 0x2fb7, 0x2fb8, 0x2fb9, 0x2fba,
- 0x2fbb, 0x4c52, 0x4c53, 0x4e28, 0x4e29, 0x4e2a, 0x4e2b, 0x4e2c,
- 0x4e2d, 0x4e2e, 0x4e2f, 0x4e30, 0x4e31, 0x4e32, 0x4e33, 0x4e34,
- 0x4e35, 0x4e36, 0x4e37, 0x4e38, 0x4e39, 0x4e3a, 0x4e3b, 0x4e3c,
- 0x4e3d, 0x4e3e, 0x4e3f, 0x4e80, 0x4e81, 0x4e82, 0x4e83, 0x4e84,
- 0x4e85, 0x4e86, 0x4e87, 0x4e88, 0x4e89, 0x4e8a, 0x4e8b, 0x4e8c,
- 0x4e8d, 0x4e8e, 0x4e8f, 0x4e90, 0x4e91, 0x4e92, 0x4e93, 0x4e94,
- 0x4e95, 0x4e96, 0x4e97, 0x4e98, 0x4e99, 0x4e9a, 0x4e9b, 0x4e9c,
- 0x4e9d, 0x4e9e, 0x4e9f, 0x4ea0, 0x4ea1, 0x4ea2, 0x4ea3, 0x4ea4,
- 0x4ea5, 0x4ea6, 0x4ea7, 0x4ea8, 0x4ea9, 0x4eaa, 0x4eab, 0x4eac,
- 0x4ead, 0x4eae, 0x4eaf, 0x4eb0, 0x4eb1, 0x4eb2, 0x4eb3, 0x4eb4,
- 0x4eb5, 0x4eb6, 0x4eb7, 0x4eb8, 0x4eb9, 0x4eba, 0x4ebb, 0x4ebc,
- 0x4ebd, 0x4ebe, 0x4ebf, 0x4ec0, 0x4ec1, 0x4ec2, 0x4ec3, 0x4ec4,
- 0x4ec5, 0x4ec6, 0x4ec7, 0x4ec8, 0x4ec9, 0x4eca, 0x4ecb, 0x6a04,
- 0x6a05, 0x07e2, 0x07e3, 0x07e4, 0x07e5, 0x07e6, 0x07e7, 0x07e8,
- 0x07e9, 0x07ea, 0x07eb, 0x07ec, 0x07ed, 0x07ee, 0x07ef, 0x07f0,
- 0x07f1, 0x07f2, 0x07f3, 0x07f4, 0x07f5, 0x07f6, 0x07f7, 0x07f8,
- 0x07f9, 0x07fa, 0x07fb, 0x07fc, 0x07fd, 0x07fe, 0x07ff, 0x2000,
- 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008,
- 0x2009, 0x200a, 0x200b, 0x200c, 0x200d, 0x200e, 0x200f, 0x2010,
- 0x2011, 0x2012, 0x2013, 0x2014, 0x2015, 0x2016, 0x2017, 0x2018,
- 0x2019, 0x201a, 0x201b, 0x201c, 0x201d, 0x201e, 0x201f, 0x2020,
- 0x2021, 0x2022, 0x2023, 0x2024, 0x2025, 0x2026, 0x2027, 0x2028,
- 0x2029, 0x202a, 0x202b, 0x202c, 0x202d, 0x202e, 0x202f, 0x2030,
- 0x2031, 0x2032, 0x2033, 0x2034, 0x2035, 0x2036, 0x2037, 0x2038,
- 0x2039, 0x203a, 0x203b, 0x203c, 0x203d, 0x203e, 0x203f, 0x2040,
- 0x2041, 0x2042, 0x2043, 0x2044, 0x2045, 0x2046, 0x2047, 0x2048,
- 0x2049, 0x204a, 0x204b, 0x204c, 0x204d, 0x204e, 0x204f, 0x2050,
- 0x2051, 0x2052, 0x2053, 0x2054, 0x2055, 0x2056, 0x2057, 0x2058,
- 0x2059, 0x205a, 0x205b, 0x205c, 0x205d, 0x205e, 0x205f, 0x2060,
- 0x2061, 0x2062, 0x2063, 0x2064, 0x2065, 0x2066, 0x2067, 0x2068,
- 0x2069, 0x206a, 0x206b, 0x206c, 0x206d, 0x206e, 0x206f, 0x2070,
- 0x2071, 0x2072, 0x2073, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078,
- 0x2079, 0x4cba, 0x4cbb, 0x5d88, 0x5d89, 0x5d8a, 0x5d8b, 0x5d8c,
- 0x5d8d, 0x5d8e, 0x5d8f, 0x5db0, 0x5db1, 0x5db2, 0x5db3, 0x5db4,
- 0x5db5, 0x5db6, 0x5db7, 0x5db8, 0x5db9, 0x5dba, 0x5dbb, 0x5dbc,
- 0x5dbd, 0x5dbe, 0x5dbf, 0x5e40, 0x5e41, 0x5e42, 0x5e43, 0x5e44,
- 0x5e45, 0x5e46, 0x5e47, 0x5e48, 0x5e49, 0x5e4a, 0x5e4b, 0x5e4c,
- 0x5e4d, 0x5e4e, 0x5e4f, 0x5e50, 0x5e51, 0x5e52, 0x5e53, 0x5e54,
- 0x5e55, 0x5e56, 0x5e57, 0x5e58, 0x5e59, 0x5e5a, 0x5e5b, 0x5e5c,
- 0x5e5d, 0x5e5e, 0x5e5f, 0x5e60, 0x5e61, 0x5e62, 0x5e63, 0x5e64,
- 0x5e65, 0x5e66, 0x5e67, 0x5e68, 0x5e69, 0x5e6a, 0x5e6b, 0x5e6c,
- 0x5e6d, 0x5e6e, 0x5e6f, 0x5e70, 0x5e71, 0x5e72, 0x5e73, 0x5e74,
- 0x5e75, 0x5e76, 0x5e77, 0x5e78, 0x5e79, 0x5e7a, 0x5e7b, 0x5e7c,
- 0x5e7d, 0x5e7e, 0x5e7f, 0x5e80, 0x5e81, 0x5e82, 0x5e83, 0x5e84,
- 0x5e85, 0x5e86, 0x5e87, 0x5e88, 0x5e89, 0x5e8a, 0x5e8b, 0x5e8c,
- 0x5e8d, 0x5e8e, 0x5e8f, 0x5e90, 0x5e91, 0x5e92, 0x5e93, 0x5e94,
- 0x5e95, 0x5e96, 0x5e97, 0x5e98, 0x5e99, 0x5e9a, 0x5e9b, 0x5e9c,
- 0x5e9d, 0x5e9e, 0x5e9f, 0x5ea0, 0x5ea1, 0x5ea2, 0x5ea3, 0x5ea4,
- 0x5ea5, 0x5ea6, 0x5ea7, 0x5ea8, 0x5ea9, 0x5eaa, 0x5eab, 0x5eac,
- 0x5ead, 0x5eae, 0x5eaf, 0x5eb0, 0x5eb1, 0x5eb2, 0x5eb3, 0x5eb4,
- 0x5eb5, 0x5eb6, 0x5eb7, 0x5eb8, 0x5eb9, 0x5eba, 0x5ebb, 0x5ebc,
- 0x5ebd, 0x5ebe, 0x5ebf, 0x5ec0, 0x5ec1, 0x5ec2, 0x5ec3, 0x5ec4,
- 0x5ec5, 0x5ec6, 0x5ec7, 0x5ec8, 0x5ec9, 0x5eca, 0x5ecb, 0x5ecc,
- 0x5ecd, 0x5ece, 0x5ecf, 0x5ed0, 0x5ed1, 0x5ed2, 0x5ed3, 0x5ed4,
- 0x5ed5, 0x5ed6, 0x5ed7, 0x5ed8, 0x5ed9, 0x5eda, 0x5edb, 0x5edc,
- 0x5edd, 0x5ede, 0x5edf, 0x5ee0, 0x5ee1, 0x5ee2, 0x5ee3, 0x5ee4,
- 0x5ee5, 0x5ee6, 0x5ee7, 0x5ee8, 0x5ee9, 0x5eea, 0x5eeb, 0x5eec,
- 0x5eed, 0x5eee, 0x5eef, 0x5ef0, 0x5ef1, 0x5ef2, 0x5ef3, 0x5ef4,
- 0x5ef5, 0x5ef6, 0x5ef7, 0x5ef8, 0x5ef9, 0x5efa, 0x5efb, 0x5efc,
- 0x5efd, 0x5efe, 0x5eff, 0x5f00, 0x5f01, 0x5f02, 0x5f03, 0x5f04,
- 0x5f05, 0x5f06, 0x5f07, 0x5f08, 0x5f09, 0x5f0a, 0x5f0b, 0x5f0c,
- 0x5f0d, 0x5f0e, 0x5f0f, 0x0000,
-};
-
-static const uint8_t table0_mv_bits[1100] = {
-  1,  4,  4,  4,  5,  5,  5,  6,
-  6,  6,  7,  7,  7,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  9,  9, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17,  8,
-};
-
-static const uint8_t table0_mvx[1099] = {
- 32, 32, 31, 32, 33, 31, 33, 31,
- 33, 32, 34, 32, 30, 32, 31, 34,
- 35, 32, 34, 33, 29, 33, 30, 30,
- 31, 31, 35, 29, 33, 35, 33, 34,
- 31, 29, 30, 34, 30, 36, 28, 32,
- 34, 37, 30, 27, 32, 25, 39, 32,
- 34, 32, 35, 35, 35, 31, 35, 29,
- 32, 29, 30, 29, 37, 27, 36, 38,
- 37, 33, 32, 31, 29, 31, 28, 36,
- 33, 30, 34, 33, 33, 28, 27, 25,
- 31, 26, 39, 32, 32, 31, 33, 39,
- 31, 38, 28, 36, 21, 23, 43, 36,
- 34, 41, 30, 25, 28, 31, 30, 34,
- 38, 35, 61, 34, 28, 30, 37, 37,
- 35, 27, 36,  3, 59, 38, 37, 32,
- 31, 29, 26, 33, 37, 33, 27, 27,
- 35, 34, 34, 40, 42, 33, 32, 29,
-  4,  5, 28, 24, 25, 35, 39, 38,
- 32, 23, 27, 32, 30, 35, 26, 34,
- 60, 36, 29, 22, 26, 41,  7, 30,
- 38, 30, 36, 29, 30, 41, 26, 25,
- 32, 34, 24, 39,  1, 25, 39, 32,
- 28, 29, 32, 38, 26, 36, 28, 63,
- 28, 39, 23, 21, 26, 35, 31, 35,
- 57, 31, 29, 29, 28, 30, 27, 35,
-  2, 38, 40, 34, 37, 29, 38, 43,
- 26, 32, 33, 42, 24, 40, 28, 32,
- 32, 32, 36, 32, 43, 25, 21, 31,
- 30, 31, 41, 29, 33, 37, 26, 37,
- 27, 59, 23, 33, 35, 31, 31, 37,
- 38, 39, 32, 23, 32, 27, 37, 36,
- 31, 40, 25, 27, 38, 31, 36, 28,
- 31, 36, 25, 45,  3, 34, 38, 39,
- 40, 38, 30, 32, 19, 24, 25, 26,
- 45, 20, 24, 33, 33, 31, 41, 34,
- 39, 47, 40, 58, 59, 41, 33,  3,
- 17, 61, 42, 30, 26, 29, 36, 61,
- 33, 37, 62, 28, 25, 38, 25, 38,
- 17, 23, 34, 33, 21, 33, 49, 27,
- 32, 23, 27, 22, 24, 22, 39, 43,
- 27, 37,  6, 42, 47, 26, 30, 31,
- 41, 39, 33, 22, 45, 36, 32, 45,
- 19, 22, 30,  5,  5, 17, 29, 22,
- 31, 31, 43, 37, 27, 32, 32, 32,
- 33, 34, 43, 35, 29, 26, 22, 32,
- 19, 32, 25, 31, 41, 49, 28, 34,
- 28, 39, 34, 19, 37, 38, 29, 21,
- 36, 42, 24, 48, 16, 28, 49, 22,
- 34, 31, 38, 39, 44, 11, 35, 30,
- 33, 33, 23, 28, 33, 46, 15, 13,
- 24, 41, 24, 34, 34, 30, 26, 24,
- 14, 60, 21, 29, 39, 23, 35, 37,
- 63, 45, 33, 34, 47, 41, 22, 42,
- 35, 35, 23, 32, 35, 43, 32,  7,
- 31, 41, 20, 31, 16, 13, 63, 25,
- 30, 32, 35, 30, 30, 31, 42, 47,
- 39, 38, 40, 40, 51, 55, 56, 18,
- 21, 39, 39, 33, 17, 41, 23, 24,
- 43, 25, 31, 20, 19, 45,  1, 34,
- 31, 22, 35, 15, 46, 46, 35, 31,
- 28, 29, 29, 23, 41, 27, 14, 53,
- 53, 27, 24, 32, 57, 32, 17, 42,
- 37, 29, 33,  1, 25, 32, 32, 63,
- 26, 40, 44, 36, 31, 39, 20, 20,
- 44, 23, 33, 34, 35, 33, 33, 28,
- 41, 23, 41, 41, 29, 25, 26, 49,
- 29, 24, 37, 49, 50, 51, 51, 26,
- 39, 25, 26, 15, 39, 18, 42, 17,
-  4, 31, 32, 32, 60,  1, 42, 32,
-  0, 12, 19, 35, 21, 41, 17, 26,
- 20, 45, 46, 32, 37, 22, 47, 29,
- 31, 27, 29, 30, 21, 33, 35, 18,
- 25, 33, 50, 51, 42,  2, 15, 51,
- 53, 33, 25, 29, 55, 37, 38, 33,
- 38, 59, 38, 33, 39, 13, 32, 40,
- 61, 61, 32,  9, 44,  3, 31, 29,
- 25, 31, 27, 23,  9, 25,  9, 29,
- 20, 30, 30, 42, 18, 28, 25, 28,
- 28, 21, 29, 43, 29, 43, 26, 44,
- 44, 21, 38, 21, 24, 45, 45, 35,
- 39, 22, 35, 36, 34, 34, 45, 34,
- 29, 31, 46, 25, 46, 16, 17, 31,
- 20, 32, 47, 47, 47, 32, 49, 49,
- 49, 31,  1, 27, 28, 39, 39, 21,
- 36, 23, 51,  2, 40, 51, 32, 53,
- 24, 30, 24, 30, 21, 40, 57, 57,
- 31, 41, 58, 32, 12,  4, 32, 34,
- 59, 31, 32, 13,  9, 35, 26, 35,
- 37, 61, 37, 63, 26, 29, 41, 38,
- 23, 20, 41, 26, 41, 42, 42, 42,
- 26, 26, 26, 26,  1, 26, 37, 37,
- 37, 23, 34, 42, 27, 43, 34, 27,
- 31, 24, 33, 16,  3, 31, 24, 33,
- 24,  4, 44, 44, 11, 44, 31, 13,
- 13, 44, 45, 13, 25, 22, 38, 26,
- 38, 38, 39, 32, 30, 39, 30, 22,
- 32, 26, 30, 47, 47, 47, 19, 47,
- 30, 31, 35,  8, 23, 47, 47, 27,
- 35, 47, 31, 48, 35, 19, 36, 49,
- 49, 33, 31, 39, 27, 39, 49, 49,
- 50, 50, 50, 39, 31, 51, 51, 39,
- 28, 33, 33, 21, 40, 31, 52, 53,
- 40, 53,  9, 33, 31, 53, 54, 54,
- 54, 55, 55, 34, 15, 56, 25, 56,
- 21, 21, 40, 40, 25, 40, 58, 36,
-  5, 41, 41, 12, 60, 41, 41, 37,
- 22, 61, 18, 29, 29, 30, 61, 30,
- 61, 62, 62, 30, 30, 63, 18, 13,
- 30, 23, 19, 20, 20, 41, 13,  2,
-  5,  5,  1,  5, 32,  6, 32, 35,
- 20, 35, 27, 35, 35, 36, 36, 13,
- 36, 41, 41, 41,  3, 30, 42, 27,
- 20, 30, 27, 28, 30, 21, 33, 33,
- 14, 24, 30, 42, 24, 33, 25, 42,
- 43, 14, 43, 43, 14, 43,  7, 36,
- 37, 37, 37, 37,  7, 14, 25, 43,
- 43, 44, 15, 37,  7,  7,  3,  1,
-  8, 15, 15,  8, 44, 44, 44, 45,
- 45, 45, 45,  8,  8, 45, 21, 45,
- 28, 28, 28, 21, 28, 28, 22, 37,
- 46, 46, 37,  8, 29, 37, 29, 22,
- 46, 37, 22, 29, 47, 47, 38, 38,
- 16, 38, 38, 33, 38, 22, 47, 47,
- 29, 25, 16,  0, 48,  1, 34, 48,
- 48, 34, 25, 26, 26, 49, 49, 26,
-  1, 49,  4, 26,  4, 49,  1,  9,
- 49, 49, 49, 10, 49, 17, 38, 17,
- 17, 50, 38, 50, 50, 22, 38, 51,
- 38, 38, 51, 39, 39, 18, 22, 39,
- 51, 22, 52, 52, 52, 39, 53, 53,
- 10, 23, 18, 29, 10, 53, 29, 54,
- 11, 54, 11, 11, 55,  1, 18, 55,
- 55, 55, 55, 55, 55, 29, 34, 18,
- 29, 56, 56, 34, 57, 34, 34, 29,
- 29, 57, 57, 35, 35, 35, 35, 35,
- 39, 35, 59, 59, 18, 59, 39, 30,
- 18, 40, 60, 60, 61, 30, 18, 61,
- 61, 19, 19,
-};
-
-static const uint8_t table0_mvy[1099] = {
- 32, 31, 32, 33, 32, 31, 31, 33,
- 33, 34, 32, 30, 32, 35, 34, 31,
- 32, 29, 33, 30, 32, 34, 33, 31,
- 30, 35, 31, 31, 29, 33, 35, 30,
- 29, 33, 34, 34, 30, 32, 32, 36,
- 29, 32, 35, 32, 28, 32, 32, 27,
- 35, 37, 34, 29, 30, 36, 35, 34,
- 25, 30, 29, 35, 33, 31, 31, 32,
- 31, 28, 39, 28, 29, 37, 31, 33,
- 27, 36, 28, 36, 37, 33, 33, 31,
- 27, 32, 31, 38, 26, 25, 25, 33,
- 39, 31, 34, 30, 32, 32, 32, 34,
- 36, 32, 28, 33, 30, 38, 37, 27,
- 33, 28, 32, 37, 35, 38, 29, 34,
- 27, 29, 29, 32, 32, 34, 35,  3,
- 26, 36, 31, 38, 30, 26, 35, 34,
- 37, 26, 25, 32, 32, 39, 23, 37,
- 32, 32, 29, 32, 29, 36, 29, 30,
- 41, 31, 30, 21, 39, 25, 34, 38,
- 32, 35, 39, 32, 33, 33, 32, 27,
- 29, 25, 28, 27, 26, 31, 30, 35,
- 24, 24, 31, 34, 32, 30, 35, 40,
- 28, 38,  5, 35, 29, 36, 36, 32,
- 38, 30, 33, 31, 35, 26, 23, 38,
- 32, 41, 28, 25, 37, 40, 37, 39,
- 32, 36, 33, 39, 25, 26, 28, 31,
- 28, 42, 23, 31, 33, 31, 39,  1,
- 59, 22, 27,  4, 33, 34, 33, 24,
- 41,  3, 35, 41, 41, 28, 36, 36,
- 28, 33, 35, 21, 23, 21, 22, 37,
- 27, 27, 43, 29, 60, 39, 27, 25,
- 59, 34, 27, 27, 26, 40, 37, 27,
- 61, 26, 39, 33, 31, 22, 37, 25,
- 30, 25, 24, 61, 31, 34, 25, 38,
- 32, 32, 30,  3, 61, 43, 29, 23,
- 28, 32, 28, 32, 31, 34,  5, 33,
- 32, 33, 33, 42, 37, 23, 38, 31,
- 40, 26, 32, 26, 37, 38, 36, 24,
- 29, 30, 20, 22, 29, 24, 32, 41,
-  2, 34, 25, 33, 29, 31, 39, 35,
- 36, 24, 32, 30, 33, 27, 44, 60,
- 30, 36, 19, 34, 31, 24, 16, 35,
- 32, 38, 21, 33, 31, 31, 21, 35,
-  5, 17, 29, 38, 38, 18, 58, 19,
- 43, 41, 30, 41, 43, 39, 29,  7,
- 29, 17, 28, 19, 28, 31, 25, 19,
- 40, 26, 21, 33, 39, 23, 40, 30,
- 39, 34, 35, 32, 32, 24, 33, 30,
- 40, 47, 39, 37, 32, 33, 24, 23,
- 45, 47, 27, 23, 42, 32, 32, 33,
- 36, 37, 37, 17, 18, 22, 40, 38,
- 32, 31, 35, 24, 17, 25, 17, 23,
- 33, 34, 51, 42, 31, 36, 36, 29,
- 21, 22, 37, 44, 43, 25, 47, 33,
- 45, 27, 31, 58, 31, 32, 31, 38,
- 43, 20, 47, 45, 54,  1, 26, 34,
- 38, 14, 22, 24, 33, 34, 32, 32,
- 37, 21, 23, 49, 35, 23, 28, 39,
- 39, 23, 55, 33, 30, 30, 63, 16,
- 42, 28, 13, 33, 33, 35, 19, 46,
- 43, 17, 19, 36, 39, 24, 31, 32,
- 33, 26, 28, 62, 33, 63, 33, 39,
- 19, 49, 17, 31, 43, 13, 15, 29,
- 25, 35, 33, 23, 49, 41, 28, 29,
- 34, 38,  7, 61, 11, 50, 13, 41,
- 19, 47, 25, 26, 15, 42, 41, 29,
- 45, 27, 17, 35, 32, 29, 32, 24,
- 13, 26, 26, 31, 24, 33, 28, 30,
- 31, 11, 45, 46, 33, 33, 35, 57,
- 32, 32, 35, 45, 34, 11, 37, 42,
- 39, 37, 31, 49, 21, 27, 29, 47,
- 53, 40, 51, 16, 26,  1, 40, 30,
- 41, 44, 34, 25, 27, 31, 35, 35,
- 31, 15, 49,  1, 35, 40,  5, 58,
- 21, 29, 22, 59, 45, 31,  9, 26,
-  9, 29, 11, 32, 30,  3, 13, 20,
- 18, 20, 11,  3, 29, 40, 31, 53,
- 30, 17, 20, 37, 31, 42, 47, 47,
- 54, 38,  9, 34, 13, 37, 21, 25,
- 27, 43, 42, 45, 40, 25, 27, 46,
- 22, 25, 53, 20,  2, 14, 39, 15,
- 22, 44, 34, 21, 38, 33, 27, 48,
- 34, 52, 35, 47, 49, 54,  2, 13,
- 23, 52, 29, 45, 22, 49, 54, 21,
- 40, 42, 31, 30, 29, 34,  0, 25,
- 23, 51, 24, 59, 28, 38, 29, 31,
-  2, 13, 31,  8, 31, 33, 12, 45,
- 41,  7, 14, 30, 25, 18, 43, 20,
- 43, 35, 44,  1, 49, 42, 42, 18,
- 41, 38, 41, 44, 53, 11, 20, 25,
- 45, 46, 47, 48, 39, 52, 46, 49,
- 63, 55, 44, 38, 13, 13, 57, 22,
- 51, 16, 12, 28, 35, 57, 25, 20,
- 26, 28, 28, 29, 32, 31, 62, 34,
- 35, 35, 19, 49, 48, 39, 40, 18,
- 43, 46, 11,  6, 48, 19, 49, 41,
- 10, 23, 58, 17, 21, 23, 34, 30,
- 60,  0, 44, 34, 26, 37, 46, 43,
- 49, 59,  4, 34, 59, 37, 22, 25,
- 28, 46,  6, 40, 59, 42, 36, 61,
- 28, 30, 31, 43, 10, 22, 23, 47,
- 20, 52, 55, 36, 25, 16,  1, 11,
- 27, 29,  5, 63, 18, 41, 31, 34,
- 38,  1,  5, 13, 28, 31, 17, 38,
- 39, 41, 36, 37, 22, 39, 33, 43,
- 43, 15, 17, 49, 30, 21, 22, 20,
- 10, 17, 25, 54, 57,  3, 34,  8,
- 36, 25, 31, 14, 15, 19, 29, 25,
- 18, 39, 53, 22, 27, 20, 29, 33,
- 41, 42, 35, 62, 50, 29, 53, 50,
- 35, 55, 42, 61, 63,  4,  7, 42,
- 21, 46, 47, 49, 27, 46, 17, 55,
- 41, 50, 63,  4, 56, 18,  8, 10,
- 18, 51, 63, 36, 55, 18,  5, 55,
-  9, 29, 17, 21, 30, 27,  1, 59,
-  7, 11, 12, 15,  5, 42, 24, 41,
- 43,  7, 27, 22, 25, 31, 30, 37,
- 22, 39, 53, 29, 36, 37, 48,  0,
-  5, 13, 17, 31, 32, 26, 46, 28,
- 44, 45, 46, 53, 49, 51,  3, 41,
-  3, 22, 42, 33,  5, 45,  7, 22,
- 40, 53, 24, 14, 25, 27, 10, 12,
- 34, 16, 17, 53, 20, 26, 39, 45,
- 18, 45, 35, 33, 31, 49,  4, 39,
- 42, 11, 51,  5, 13, 26, 27, 17,
- 52, 30,  0, 22, 12, 34, 62, 36,
- 38, 41, 47, 30, 63, 38, 41, 43,
- 59, 33, 45, 37, 38, 40, 47, 24,
- 48, 49, 30,  1, 10, 22, 49, 15,
- 39, 59, 31, 32, 33, 18, 13, 15,
- 31, 21, 27, 44, 42, 39, 46, 17,
- 26, 32, 30, 31,  0, 30, 34,  9,
- 12, 13, 25, 31, 32, 55, 43, 35,
- 61, 33, 35, 46, 25, 47, 48, 62,
- 63, 38, 61,  1,  2,  5,  7,  9,
- 46, 10, 34, 35, 36, 55, 51,  7,
- 40, 23, 34, 37,  5, 13, 42, 18,
- 25, 27, 28,
-};
-
-/* motion vector table 1 */
-static const uint16_t table1_mv_code[1100] = {
- 0x0000, 0x0007, 0x0009, 0x000f, 0x000a, 0x0011, 0x001a, 0x001c,
- 0x0011, 0x0031, 0x0025, 0x002d, 0x002f, 0x006f, 0x0075, 0x0041,
- 0x004c, 0x004e, 0x005c, 0x0060, 0x0062, 0x0066, 0x0068, 0x0069,
- 0x006b, 0x00a6, 0x00c1, 0x00cb, 0x00cc, 0x00ce, 0x00da, 0x00e8,
- 0x00ee, 0x0087, 0x0090, 0x009e, 0x009f, 0x00ba, 0x00ca, 0x00d8,
- 0x00db, 0x00df, 0x0104, 0x0109, 0x010c, 0x0143, 0x0145, 0x014a,
- 0x0156, 0x015c, 0x01b3, 0x01d3, 0x01da, 0x0103, 0x0109, 0x010b,
- 0x0122, 0x0127, 0x0134, 0x0161, 0x0164, 0x0176, 0x0184, 0x018d,
- 0x018e, 0x018f, 0x0190, 0x0193, 0x0196, 0x019d, 0x019e, 0x019f,
- 0x01a9, 0x01b2, 0x01b4, 0x01ba, 0x01bb, 0x01bc, 0x0201, 0x0202,
- 0x0205, 0x0207, 0x020d, 0x0210, 0x0211, 0x0215, 0x021b, 0x021f,
- 0x0281, 0x0285, 0x0290, 0x029c, 0x029d, 0x02a2, 0x02a7, 0x02a8,
- 0x02aa, 0x02b0, 0x02b1, 0x02b4, 0x02bc, 0x02bf, 0x0320, 0x0326,
- 0x0327, 0x0329, 0x032a, 0x0336, 0x0360, 0x0362, 0x0363, 0x0372,
- 0x03b2, 0x03bc, 0x03bd, 0x0203, 0x0205, 0x021a, 0x0249, 0x024a,
- 0x024c, 0x02c7, 0x02ca, 0x02ce, 0x02ef, 0x030d, 0x0322, 0x0325,
- 0x0338, 0x0373, 0x037a, 0x0409, 0x0415, 0x0416, 0x0418, 0x0428,
- 0x042d, 0x042f, 0x0434, 0x0508, 0x0509, 0x0510, 0x0511, 0x051c,
- 0x051e, 0x0524, 0x0541, 0x0543, 0x0546, 0x0547, 0x054d, 0x0557,
- 0x055f, 0x056a, 0x056c, 0x056d, 0x056f, 0x0576, 0x0577, 0x057a,
- 0x057b, 0x057c, 0x057d, 0x0600, 0x0601, 0x0603, 0x0614, 0x0616,
- 0x0617, 0x061c, 0x061f, 0x0642, 0x0648, 0x0649, 0x064a, 0x064b,
- 0x0657, 0x0668, 0x0669, 0x066b, 0x066e, 0x067f, 0x06c2, 0x06c8,
- 0x06cb, 0x06de, 0x06df, 0x06e2, 0x06e3, 0x06ef, 0x0748, 0x074b,
- 0x076e, 0x076f, 0x077c, 0x0409, 0x0423, 0x0428, 0x0429, 0x042a,
- 0x042b, 0x0432, 0x0433, 0x0496, 0x049a, 0x04d5, 0x04db, 0x0581,
- 0x0582, 0x058b, 0x058c, 0x058d, 0x0598, 0x0599, 0x059a, 0x059e,
- 0x05dd, 0x0619, 0x0632, 0x0633, 0x0648, 0x0672, 0x06a1, 0x06a2,
- 0x06a3, 0x06af, 0x06e2, 0x06e3, 0x06e4, 0x0800, 0x0801, 0x0802,
- 0x0803, 0x081a, 0x081b, 0x0829, 0x082f, 0x0832, 0x083e, 0x083f,
- 0x0852, 0x0853, 0x0858, 0x086b, 0x0877, 0x0878, 0x0879, 0x087a,
- 0x087b, 0x0a00, 0x0a01, 0x0a0d, 0x0a0e, 0x0a0f, 0x0a24, 0x0a37,
- 0x0a3a, 0x0a3b, 0x0a3e, 0x0a46, 0x0a47, 0x0a4a, 0x0a4b, 0x0a5f,
- 0x0a79, 0x0a7a, 0x0a7b, 0x0a80, 0x0a81, 0x0a84, 0x0a85, 0x0a99,
- 0x0aa5, 0x0aa6, 0x0ab8, 0x0aba, 0x0abb, 0x0abc, 0x0abd, 0x0ac8,
- 0x0ace, 0x0acf, 0x0ad7, 0x0adc, 0x0aeb, 0x0c04, 0x0c25, 0x0c26,
- 0x0c27, 0x0c2a, 0x0c2b, 0x0c3a, 0x0c3b, 0x0c3c, 0x0c3d, 0x0ca0,
- 0x0cad, 0x0cd4, 0x0cd5, 0x0cfc, 0x0cfd, 0x0d86, 0x0d92, 0x0d93,
- 0x0d94, 0x0d95, 0x0db0, 0x0db8, 0x0db9, 0x0dba, 0x0dbb, 0x0dc0,
- 0x0dc2, 0x0dc3, 0x0dda, 0x0ddb, 0x0ddc, 0x0ddd, 0x0e92, 0x0e93,
- 0x0e94, 0x0e95, 0x0ec7, 0x0ecc, 0x0ece, 0x0ecf, 0x0ed8, 0x0ed9,
- 0x0eda, 0x0edb, 0x0808, 0x0809, 0x080a, 0x0810, 0x0811, 0x0844,
- 0x0845, 0x0861, 0x0862, 0x0863, 0x086c, 0x0922, 0x0923, 0x092e,
- 0x092f, 0x0936, 0x0937, 0x09b1, 0x09b2, 0x09b3, 0x09b4, 0x09b5,
- 0x09b8, 0x09b9, 0x09ba, 0x09bb, 0x09bc, 0x09bd, 0x09be, 0x09bf,
- 0x0b00, 0x0b15, 0x0b2c, 0x0b2d, 0x0b2e, 0x0b2f, 0x0b36, 0x0bb9,
- 0x0c28, 0x0c2a, 0x0c2b, 0x0c2c, 0x0c2d, 0x0c2e, 0x0c2f, 0x0c30,
- 0x0c31, 0x0c38, 0x0c60, 0x0c61, 0x0c62, 0x0c63, 0x0c8d, 0x0c8e,
- 0x0c8f, 0x0c92, 0x0cbe, 0x0cbf, 0x0ce6, 0x0ce7, 0x0d40, 0x0d41,
- 0x0d57, 0x0d58, 0x0d59, 0x0d5a, 0x0d5b, 0x0d5c, 0x0d5d, 0x0d98,
- 0x0d99, 0x0d9a, 0x0d9b, 0x0d9c, 0x0d9d, 0x0dad, 0x0dae, 0x0daf,
- 0x0dc0, 0x0dc1, 0x0dc2, 0x0dc3, 0x0dca, 0x0dcb, 0x0dec, 0x0ded,
- 0x0dee, 0x0def, 0x1018, 0x1022, 0x1023, 0x1030, 0x1031, 0x1032,
- 0x1033, 0x1050, 0x1051, 0x105c, 0x1074, 0x1075, 0x1076, 0x1077,
- 0x1078, 0x1079, 0x107a, 0x107b, 0x10b2, 0x10b3, 0x10b8, 0x10b9,
- 0x10ba, 0x10bb, 0x10d4, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x1404,
- 0x1405, 0x1406, 0x1407, 0x1410, 0x1411, 0x1412, 0x1413, 0x1414,
- 0x1415, 0x1416, 0x1417, 0x1418, 0x1419, 0x1466, 0x1467, 0x1468,
- 0x1469, 0x146a, 0x146b, 0x146c, 0x146d, 0x147e, 0x147f, 0x1488,
- 0x1489, 0x148a, 0x148b, 0x14b6, 0x14b7, 0x14b8, 0x14b9, 0x14ba,
- 0x14bb, 0x14bc, 0x14bd, 0x14f0, 0x14f1, 0x14f8, 0x14f9, 0x14fa,
- 0x14fb, 0x14fc, 0x14fd, 0x14fe, 0x14ff, 0x152a, 0x152b, 0x152c,
- 0x152d, 0x152e, 0x152f, 0x1530, 0x1531, 0x1548, 0x1549, 0x154e,
- 0x154f, 0x1558, 0x1559, 0x155a, 0x155b, 0x1572, 0x159a, 0x159b,
- 0x15ac, 0x15ba, 0x15bb, 0x15d0, 0x15d1, 0x15d2, 0x15d3, 0x15d4,
- 0x15d5, 0x181d, 0x181e, 0x181f, 0x1840, 0x1841, 0x1842, 0x1843,
- 0x1844, 0x1845, 0x1846, 0x1847, 0x1848, 0x1849, 0x1861, 0x1862,
- 0x1863, 0x1864, 0x1865, 0x1866, 0x1867, 0x1868, 0x1869, 0x186a,
- 0x186b, 0x186c, 0x186d, 0x186e, 0x191b, 0x191c, 0x191d, 0x191e,
- 0x191f, 0x1942, 0x1943, 0x1944, 0x1945, 0x1946, 0x1947, 0x1958,
- 0x1959, 0x19ed, 0x19ee, 0x19ef, 0x19f0, 0x19f1, 0x19f2, 0x19f3,
- 0x19f4, 0x19f5, 0x19f6, 0x19f7, 0x1b0e, 0x1b0f, 0x1b62, 0x1b63,
- 0x1b64, 0x1b65, 0x1b66, 0x1b67, 0x1b68, 0x1b69, 0x1b6a, 0x1b6b,
- 0x1b6c, 0x1b6d, 0x1b6e, 0x1b6f, 0x1b82, 0x1ba8, 0x1ba9, 0x1baa,
- 0x1bab, 0x1bac, 0x1bad, 0x1bae, 0x1baf, 0x1bb0, 0x1bb1, 0x1bb2,
- 0x1bb3, 0x1d80, 0x1d81, 0x1d82, 0x1d83, 0x1d84, 0x1d85, 0x1d86,
- 0x1d87, 0x1d88, 0x1d89, 0x1d8a, 0x1d8b, 0x1d8c, 0x1d8d, 0x1007,
- 0x1008, 0x1009, 0x100a, 0x100b, 0x100c, 0x100d, 0x100e, 0x100f,
- 0x1016, 0x1080, 0x1081, 0x1082, 0x1083, 0x1084, 0x1085, 0x1086,
- 0x1087, 0x10c0, 0x123a, 0x123b, 0x123c, 0x123d, 0x123e, 0x123f,
- 0x1240, 0x1241, 0x1242, 0x1243, 0x1350, 0x1352, 0x1353, 0x1358,
- 0x1359, 0x135a, 0x135b, 0x135c, 0x135d, 0x135e, 0x135f, 0x1360,
- 0x1361, 0x1602, 0x1603, 0x160c, 0x160d, 0x160e, 0x160f, 0x1620,
- 0x1621, 0x1622, 0x1623, 0x1624, 0x1625, 0x1626, 0x1627, 0x1628,
- 0x1629, 0x166e, 0x166f, 0x167c, 0x167d, 0x167e, 0x167f, 0x1770,
- 0x1771, 0x1852, 0x1853, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876,
- 0x1877, 0x1878, 0x1879, 0x187a, 0x187b, 0x187c, 0x187d, 0x187e,
- 0x187f, 0x1918, 0x1919, 0x1926, 0x1927, 0x1970, 0x1971, 0x1972,
- 0x1973, 0x1974, 0x1975, 0x1976, 0x1977, 0x1978, 0x1979, 0x197a,
- 0x197b, 0x1aa0, 0x1aa1, 0x1aa2, 0x1aa3, 0x1aa4, 0x1aa5, 0x1aa6,
- 0x1aa7, 0x1aa8, 0x1aa9, 0x1aaa, 0x1aab, 0x1aac, 0x1aad, 0x1b3c,
- 0x1b3d, 0x1b3e, 0x1b3f, 0x1b50, 0x1b51, 0x1b52, 0x1b53, 0x1b54,
- 0x1b55, 0x1b56, 0x1b57, 0x1b58, 0x1b59, 0x2032, 0x2033, 0x2034,
- 0x2035, 0x2036, 0x2037, 0x2038, 0x2039, 0x203a, 0x203b, 0x203c,
- 0x203d, 0x203e, 0x203f, 0x2040, 0x2041, 0x2042, 0x2043, 0x20ba,
- 0x20bb, 0x20cc, 0x20cd, 0x20ce, 0x20cf, 0x20e0, 0x20e1, 0x20e2,
- 0x20e3, 0x20e4, 0x20e5, 0x20e6, 0x20e7, 0x21aa, 0x21ab, 0x21c0,
- 0x21c1, 0x21c2, 0x21c3, 0x21c4, 0x21c5, 0x21c6, 0x21c7, 0x21c8,
- 0x21c9, 0x21ca, 0x21cb, 0x21cc, 0x21cd, 0x21ce, 0x21cf, 0x21d0,
- 0x21d1, 0x21d2, 0x21d3, 0x2894, 0x2895, 0x2896, 0x2897, 0x2898,
- 0x2899, 0x289a, 0x289b, 0x289c, 0x289d, 0x289e, 0x289f, 0x28c0,
- 0x28c1, 0x28c2, 0x28c3, 0x28c4, 0x28c5, 0x28c6, 0x28c7, 0x28c8,
- 0x28c9, 0x28ca, 0x28cb, 0x2930, 0x2931, 0x2932, 0x2933, 0x2934,
- 0x2935, 0x2936, 0x2937, 0x2938, 0x2939, 0x293a, 0x293b, 0x293c,
- 0x293d, 0x293e, 0x293f, 0x2960, 0x2961, 0x2962, 0x2963, 0x2964,
- 0x2965, 0x2966, 0x2967, 0x2968, 0x2969, 0x296a, 0x296b, 0x2a40,
- 0x2a41, 0x2a42, 0x2a43, 0x2a44, 0x2a45, 0x2a46, 0x2a47, 0x2a48,
- 0x2a49, 0x2a4a, 0x2a4b, 0x2a4c, 0x2a4d, 0x2a4e, 0x2a4f, 0x2a50,
- 0x2a51, 0x2a52, 0x2a53, 0x2ae6, 0x2ae7, 0x2b24, 0x2b25, 0x2b26,
- 0x2b27, 0x2b28, 0x2b29, 0x2b2a, 0x2b2b, 0x2b2c, 0x2b2d, 0x2b2e,
- 0x2b2f, 0x2b30, 0x2b31, 0x2b32, 0x2b33, 0x2b5a, 0x2b5b, 0x3014,
- 0x3015, 0x3016, 0x3017, 0x3020, 0x3021, 0x3022, 0x3023, 0x3024,
- 0x3025, 0x3026, 0x3027, 0x3028, 0x3029, 0x302a, 0x302b, 0x302c,
- 0x302d, 0x302e, 0x302f, 0x3030, 0x3031, 0x3032, 0x3033, 0x3034,
- 0x3035, 0x3036, 0x3037, 0x3038, 0x3039, 0x30c0, 0x30c1, 0x30de,
- 0x30df, 0x3218, 0x3219, 0x321a, 0x321b, 0x321c, 0x321d, 0x321e,
- 0x321f, 0x3220, 0x3221, 0x3222, 0x3223, 0x3224, 0x3225, 0x3226,
- 0x3227, 0x3228, 0x3229, 0x322a, 0x322b, 0x322c, 0x322d, 0x322e,
- 0x322f, 0x3230, 0x3231, 0x3232, 0x3233, 0x3234, 0x3235, 0x3378,
- 0x3379, 0x337a, 0x337b, 0x337c, 0x337d, 0x337e, 0x337f, 0x33c0,
- 0x33c1, 0x33c2, 0x33c3, 0x33c4, 0x33c5, 0x33c6, 0x33c7, 0x33c8,
- 0x33c9, 0x33ca, 0x33cb, 0x33cc, 0x33cd, 0x33ce, 0x33cf, 0x33d0,
- 0x33d1, 0x33d2, 0x33d3, 0x33d4, 0x33d5, 0x33d6, 0x33d7, 0x33d8,
- 0x33d9, 0x3706, 0x3707, 0x3730, 0x3731, 0x3732, 0x3733, 0x3734,
- 0x3735, 0x3736, 0x3737, 0x3738, 0x3739, 0x373a, 0x373b, 0x373c,
- 0x373d, 0x373e, 0x373f, 0x3740, 0x3741, 0x3742, 0x3743, 0x3744,
- 0x3745, 0x3746, 0x3747, 0x3748, 0x3749, 0x374a, 0x374b, 0x374c,
- 0x374d, 0x374e, 0x374f, 0x3b34, 0x3b35, 0x3b36, 0x3b37, 0x3be8,
- 0x3be9, 0x3bea, 0x3beb, 0x3bec, 0x3bed, 0x3bee, 0x3bef, 0x3bf0,
- 0x3bf1, 0x3bf2, 0x3bf3, 0x3bf4, 0x3bf5, 0x3bf6, 0x3bf7, 0x3bf8,
- 0x3bf9, 0x3bfa, 0x3bfb, 0x3bfc, 0x3bfd, 0x3bfe, 0x3bff, 0x2000,
- 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008,
- 0x2009, 0x200a, 0x200b, 0x200c, 0x200d, 0x202e, 0x202f, 0x2182,
- 0x2183, 0x21b4, 0x21b5, 0x21b6, 0x21b7, 0x21b8, 0x21b9, 0x21ba,
- 0x21bb, 0x21bc, 0x21bd, 0x21be, 0x21bf, 0x2460, 0x2461, 0x2462,
- 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x246a,
- 0x246b, 0x246c, 0x246d, 0x246e, 0x246f, 0x2470, 0x2471, 0x2472,
- 0x2473, 0x26a2, 0x26a3, 0x000b,
-};
-
-static const uint8_t table1_mv_bits[1100] = {
-  2,  4,  4,  4,  5,  5,  5,  5,
-  6,  6,  7,  7,  7,  7,  7,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  9,  9, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15,  4,
-};
-
-static const uint8_t table1_mvx[1099] = {
- 32, 31, 32, 31, 33, 32, 33, 33,
- 31, 34, 30, 32, 32, 34, 35, 32,
- 34, 33, 29, 30, 30, 32, 31, 31,
- 33, 35, 35, 33, 31, 29, 29, 33,
- 34, 30, 31, 28, 36, 30, 34, 32,
- 32, 37, 32, 32, 25, 27, 39, 32,
- 32, 32, 38, 35, 36, 32, 37, 61,
- 26, 32, 34, 35,  3, 35, 27, 28,
- 29, 34, 28, 37, 31, 36, 32, 27,
- 31, 30, 29, 39, 33, 29, 33, 35,
- 25, 25, 29, 33, 31, 31, 31, 33,
- 32, 30, 32, 32, 41, 39, 33, 36,
- 32, 28, 34, 36, 38, 24, 60, 31,
- 23, 28, 32, 33, 59, 32, 40, 30,
-  5, 34, 32, 38, 32, 30, 43,  4,
- 32, 32, 42, 31, 31, 32, 26, 38,
- 26, 22, 21, 37, 61, 63, 37, 31,
- 32, 33,  2,  1, 23, 33, 41, 27,
- 35, 30, 38, 23, 33,  3, 28, 34,
- 34, 27, 41, 29, 39, 35, 36, 29,
- 32, 27, 30, 32, 24, 61, 37, 26,
- 59, 25, 35, 27, 36, 37, 30, 31,
- 34, 40,  3, 28, 34, 39, 32, 31,
- 32, 30, 24, 28, 35, 36, 26, 32,
- 31, 33, 29, 33, 39, 25, 30, 24,
- 35, 59, 29, 34, 25, 30, 21, 35,
- 43, 40, 32, 29,  5, 28, 31, 62,
- 33, 33, 25, 31, 21, 31, 43, 31,
- 34, 33, 20, 40, 39, 31, 31, 57,
- 38, 32, 42, 33, 32, 31, 32, 29,
- 30, 44,  5, 31, 22, 34, 36, 17,
- 38, 58, 38, 35, 32, 60, 35, 24,
- 32, 38, 16, 45, 42, 32, 31, 29,
-  4, 30, 17, 40, 46, 48, 63, 32,
- 42, 19, 41, 22, 28, 36, 45, 33,
- 33, 32, 29,  7, 41, 42, 18, 33,
- 33, 32, 22, 37,  1, 26, 22, 23,
- 49, 28, 26, 27, 32, 33, 27, 23,
- 28, 36, 15,  6, 34, 27, 31, 26,
- 23,  2, 33, 32, 34, 41, 28, 32,
- 41,  0, 36, 38, 34, 31, 47, 32,
- 17, 31, 39, 33, 37, 51, 30, 47,
- 32, 50, 32, 19, 63, 30, 25, 27,
- 33, 62, 24, 31, 27, 30, 37, 31,
- 45, 32, 39, 20, 46, 47, 35, 19,
- 34,  1, 49, 21, 21, 14, 51, 26,
- 23, 31, 36, 35, 58, 29, 29, 21,
- 20, 42, 13, 28, 12, 40, 31, 33,
- 39, 60, 32, 44, 33, 31, 28, 37,
- 29, 32, 30, 49, 43, 28, 39, 25,
- 32, 48,  2, 15, 20, 25, 31, 28,
- 21, 24, 25, 15, 31, 17, 37, 43,
- 18, 32, 33, 24, 33, 36, 13, 33,
- 31, 39, 11, 31, 33, 32, 39, 37,
- 32, 32, 29, 17, 44, 46, 36, 35,
- 26, 37, 58, 32, 34, 38,  8, 38,
- 38, 22, 29, 25, 16, 35, 32, 35,
- 33, 43, 18, 46, 38, 50, 33, 18,
- 53, 60, 13, 32, 36, 33, 51, 36,
- 43, 45, 27, 42, 29, 24, 30, 25,
- 31, 52, 31, 35, 38,  9, 22, 34,
-  4, 17, 28, 55, 42, 25, 17, 20,
- 47, 34, 33, 16, 40, 25, 16, 30,
- 53, 29, 10, 11, 14, 26, 33,  4,
- 35, 44, 26, 16, 31, 26, 34, 38,
- 29, 31, 30, 24, 22, 61, 32,  9,
- 45, 34, 31, 19,  9, 31, 46, 31,
- 35, 54, 29, 57, 30, 50,  3, 31,
- 63, 34, 47, 41, 51, 18, 31, 14,
- 37, 38, 31, 24, 32, 31, 50, 33,
- 31, 54, 27,  9, 33, 23, 19, 32,
- 29, 29, 33, 28, 47, 49, 30, 47,
- 33, 27, 25, 54, 44, 45, 50, 58,
- 51, 48, 33, 59, 33, 34, 57, 13,
- 26, 33, 13, 48, 30, 11,  7, 56,
- 34, 55, 26,  0, 26, 35,  1, 51,
- 33, 53, 31, 45, 12, 29, 29, 51,
- 31, 48,  2,  6, 34, 30, 28, 33,
- 60, 40, 27, 46, 31,  9, 35, 29,
- 31, 39, 55, 46, 19, 37, 62, 34,
- 30, 16, 19, 49, 41, 41, 39, 37,
- 14,  5, 13, 35, 55, 30, 40, 40,
- 42,  8, 20, 25, 45, 35, 33, 36,
- 54, 38, 27, 37, 62, 40, 15, 59,
- 49, 31, 29, 34, 34, 39, 24, 29,
- 25, 29, 21, 29, 10, 61, 33, 49,
- 35, 34,  3, 38, 39, 29,  7, 41,
-  1, 35,  4, 23, 15, 23, 11, 37,
- 28, 35, 30, 30, 24,  1, 43, 56,
-  8, 34, 42, 24, 45, 30, 20, 23,
-  8, 38, 22, 33, 17, 52, 34, 22,
- 53, 43, 44,  1, 27, 31, 41, 43,
- 41, 30, 31, 36, 30,  5, 55, 31,
- 33, 30, 40, 23, 15, 29, 34, 34,
- 59, 34, 30, 11, 13, 38,  5,  0,
- 30, 42,  5, 30, 29, 34, 10, 44,
- 30, 63, 35, 12,  3, 26, 15, 17,
- 25, 34, 43, 39, 34, 56, 29, 23,
- 30, 12, 30, 10, 35,  9, 24, 58,
- 10, 12, 54, 33, 37, 20, 41, 35,
- 29, 18, 61, 30, 40, 24, 39, 53,
- 62, 26, 29, 33, 34, 53, 49, 21,
- 27, 11, 63, 20, 26, 23,  7, 13,
-  6, 47, 29, 30,  9, 51, 22, 34,
- 21, 25, 33, 56, 57, 30, 38, 51,
- 51, 38, 63, 28, 40, 35, 33, 18,
- 33, 33, 24, 58, 58, 34, 49, 29,
- 43,  4,  1,  4, 42, 35, 35, 30,
- 17,  5, 56, 61, 25, 37, 36, 55,
- 28, 35, 29, 50, 48, 52,  2, 42,
- 34, 40, 46, 46, 43, 35, 29, 48,
- 20, 29, 31, 41,  7, 30, 35, 19,
- 14, 21,  8, 39, 39, 40, 46, 55,
- 34,  6, 30, 34, 37, 25, 37, 33,
- 22, 44, 52, 17, 35, 29, 36, 35,
- 40, 37, 28, 30, 50, 14, 28, 55,
-  6, 23, 19, 14, 30,  3, 30, 28,
- 28, 61, 61, 47, 45, 48, 40, 40,
- 34, 34, 25, 30, 29, 35,  4, 26,
- 53, 50, 26, 41, 27, 59, 27, 38,
- 39,  3, 50, 43, 47, 23, 33, 55,
- 35, 21, 23, 35, 61, 33, 46, 52,
- 35, 34, 24, 30, 43, 16, 37, 21,
-  2, 24, 45, 34, 30, 55, 55,  1,
- 29, 29, 26, 28, 25, 31, 36, 22,
- 17, 30, 52,  2, 44, 44, 57, 26,
- 62, 41, 39, 57, 26, 46, 49, 11,
- 16, 19,  5, 59, 38, 39, 58, 38,
- 25, 49, 50, 22, 28, 59,  9, 59,
-  7, 28, 55, 17,  4, 35, 50, 21,
- 29, 44, 47, 18, 24, 19, 25, 42,
- 35,  3, 51, 35, 16, 35, 30, 63,
- 57, 39, 39, 25, 35, 38,  9, 16,
- 36, 45, 31, 60, 14, 34, 42, 24,
-  0, 37, 18, 61, 57, 37, 28, 53,
- 20, 46, 14, 47, 38, 38, 38,  9,
- 34, 39, 43, 17, 39, 59,  5, 27,
-  0, 12, 27,
-};
-
-static const uint8_t table1_mvy[1099] = {
- 32, 32, 31, 31, 32, 33, 31, 33,
- 33, 32, 32, 30, 34, 31, 32, 29,
- 33, 30, 32, 33, 31, 35, 34, 30,
- 34, 31, 33, 29, 29, 31, 33, 35,
- 30, 30, 35, 32, 32, 34, 34, 28,
- 25, 32, 36, 27, 32, 32, 32, 37,
- 39,  3, 32, 30, 31, 26, 31, 32,
- 32, 38, 29, 29, 32, 34, 31, 31,
- 34, 35, 33, 33, 28, 33,  1, 33,
- 27, 29, 30, 31, 28, 29, 37, 35,
- 31, 33, 35, 27, 36, 37, 25, 25,
- 61, 35,  4,  5, 32, 33, 36, 30,
- 23, 30, 28, 34, 31, 32, 32, 39,
- 32, 34, 21, 39, 32, 59, 32, 28,
- 32, 36, 60, 33, 24, 36, 32, 32,
- 41,  2, 32, 38, 26, 22, 33, 30,
- 31, 32, 32, 30, 31, 32, 29,  3,
- 40, 38, 32, 32, 33, 26, 31, 34,
- 28, 38, 34, 31,  3, 31, 35, 38,
- 27, 35, 33, 28, 29, 27, 29, 27,
- 43, 29, 37, 63, 31, 33, 34, 30,
- 31, 30, 37, 30, 35, 35, 26, 41,
- 37, 31, 33, 28, 26, 30, 42, 24,
-  7, 27, 33, 29, 36, 28, 34, 57,
- 23, 41, 36, 23, 35, 34, 25, 30,
- 25, 33, 25, 25, 29, 24, 33, 39,
- 33, 33,  0, 37, 31, 36, 21, 32,
- 61, 24, 35, 61, 31,  5, 31, 59,
- 39, 21, 32, 30, 34, 22, 40, 32,
- 29, 16, 31,  5, 62,  2, 20, 39,
- 39, 32, 33,  1, 31, 24, 36, 32,
- 36, 32, 28, 26,  6, 31, 38, 34,
- 58, 35, 32, 33, 33, 17, 43, 26,
- 31, 40, 31, 34, 32, 32, 31, 19,
- 30, 32, 29, 33, 38, 38, 32, 59,
- 40, 18, 38, 32, 35, 34, 32, 17,
-  1, 15, 30, 28, 31, 28, 34, 29,
- 32, 27, 35, 27, 49, 22, 37, 34,
- 37, 26, 32, 32, 22, 28, 45, 29,
- 30, 31, 43, 46, 41, 30, 26, 13,
- 34, 32, 27, 38, 42, 42, 33, 47,
- 33, 60, 27, 42, 25, 32, 22, 32,
- 48, 32, 45, 33, 33, 41, 27, 25,
- 19, 31, 35, 19, 36, 42, 27, 17,
- 31, 44, 28, 33, 33, 31, 23, 31,
- 40, 33, 31, 34, 30, 32, 33, 36,
- 35, 47, 37, 41, 31, 23, 41, 29,
- 30, 35, 32, 25, 32, 28, 58,  2,
- 37, 33, 14, 33, 49, 20, 39, 36,
- 21,  9, 23, 33, 35, 24, 39, 37,
- 11, 33, 30, 31, 31, 28, 51, 40,
- 35, 29, 25, 33, 46, 35, 37, 30,
- 30,  8, 63, 28, 15, 40, 33, 45,
- 49, 25, 32,  4, 47, 51, 36, 39,
- 53, 10, 24, 29, 30, 31, 25, 40,
- 38, 38, 33, 56, 23, 27, 32, 37,
- 26, 29, 43, 36, 33, 24, 55, 43,
-  9, 29, 34, 34, 24, 33, 18, 33,
- 33, 30, 31, 50, 24, 60, 30, 39,
- 34, 30, 39, 28, 22, 38,  2, 26,
- 63, 32, 57, 21, 39, 33, 28, 18,
- 30, 34, 22, 33, 29, 41, 30, 34,
- 35, 21, 13, 34, 35, 39, 30, 46,
- 32, 42, 32, 31, 33, 26, 11, 33,
- 22, 31, 25, 31, 53, 27, 43, 25,
- 40, 50, 21, 36, 38, 30, 12, 31,
- 34, 20, 15, 29, 32, 62, 30, 13,
- 17, 32, 19, 31, 20, 31, 30,  7,
-  1, 17, 34, 37, 31, 31, 44, 34,
- 26, 40, 16, 37, 52, 48, 30, 20,
- 18, 33, 38, 29,  7, 25, 30, 54,
- 45, 47, 46, 41, 29, 29, 16, 30,
- 14, 26, 38, 34, 34, 29, 34, 30,
- 29, 30, 57, 30,  4, 46, 33, 29,
- 39, 44, 30, 31, 50, 33, 31, 32,
- 19, 32, 40, 31, 37, 47,  1, 35,
- 16, 31,  0, 35, 33,  1, 17, 34,
-  9, 34, 33, 31, 49, 43, 42, 51,
- 34, 29, 23, 29, 14, 30, 45, 49,
- 11, 24, 31, 28, 35, 41, 30, 44,
- 18, 29, 34, 35, 36, 25, 26, 21,
- 31, 30, 34, 19, 34, 44, 36, 38,
- 25, 31, 28, 23, 37,  3, 55, 41,
- 30, 22, 41, 24, 33, 26, 35, 35,
- 30, 55, 51, 47, 48, 38, 24, 15,
- 21, 50, 25, 46, 30, 29, 10, 34,
- 42, 45, 29, 42, 22,  3, 33, 27,
- 34,  1, 34, 28, 34, 36, 35, 23,
- 23, 13, 58,  3, 26, 63, 25, 31,
- 34, 61, 38, 39, 25, 61, 29, 37,
- 30, 41, 26, 48, 28, 33, 50, 35,
- 30, 37, 29, 29, 40,  6, 39, 28,
- 28, 19,  8, 22, 45, 34, 35, 10,
- 58, 17, 37, 39, 30, 18, 54, 14,
- 29, 16, 59, 30, 35, 23, 35, 30,
- 47, 36, 29, 55, 20, 12, 31, 35,
- 14, 29, 18, 34, 34, 24, 29, 26,
- 22,  2, 27, 23,  8, 30, 55, 38,
- 60, 31,  4, 34, 49, 34, 27, 34,
- 33, 30, 31, 54, 42, 35, 38, 46,
- 44, 26, 27,  9, 39, 25, 21, 29,
- 28, 42, 13,  0,  5, 34, 37, 28,
- 24, 29, 63, 26, 22, 27, 29, 25,
- 33, 25, 61,  0, 35, 25, 36, 15,
- 27, 40, 53, 33,  3, 10, 16, 37,
- 38, 18, 30, 46, 27,  9,  6, 29,
- 62,  8, 42, 28, 29,  3, 25, 16,
- 26, 29, 35, 28, 27, 51, 61, 48,
- 37,  9, 34,  7, 49, 45, 20, 29,
- 21,  5,  5, 29, 28, 34, 29, 24,
- 10, 24, 35, 36, 38, 55, 11, 36,
- 38, 53, 54, 26, 30, 49, 20, 27,
- 30, 39, 33, 41, 49, 22, 38, 38,
-  4, 30,  8,  9,  3, 24, 22, 50,
- 37, 36, 31, 27,  2,  9, 42, 63,
- 25, 19, 44,  1, 28, 28, 48, 30,
- 34, 41, 41, 38, 12, 27, 15,  0,
- 16, 34, 35, 38, 28, 29, 40, 42,
- 51, 52, 45, 54, 59, 59, 42, 44,
- 37, 26, 46, 24, 15, 39, 22, 46,
- 19, 35, 38, 17, 37, 23, 52, 55,
- 50, 37, 26, 11, 37, 12, 24, 30,
- 16, 13, 22, 13, 36, 35, 40, 41,
- 34, 41, 26, 53, 51,  5, 21, 30,
-  2, 63, 41, 20,  1, 56, 21, 24,
- 25,  5, 28, 35, 26, 28, 30, 18,
- 29, 23, 40, 34, 20, 42, 39, 34,
- 28, 61, 38, 27, 62,  9, 36, 17,
-  9, 49, 24, 25, 54, 34, 39, 37,
-  3,  1, 25, 38, 38, 44, 35, 36,
- 12, 60, 36, 38, 40, 25, 43, 39,
- 53, 28, 39, 57, 46, 10, 52, 27,
- 35, 42, 45, 59, 15, 60, 38, 24,
- 23, 39, 12, 29, 24,  0, 20, 16,
- 28, 43, 35, 28,  1, 49,  4, 21,
- 42, 39, 29,  3, 44, 21, 53, 55,
- 11,  5,  3, 39, 53, 28, 25, 19,
- 34, 28, 21,
-};
-
-MVTable ff_mv_tables[2] = {
-    {
-        1099,
-        table0_mv_code,
-        table0_mv_bits,
-        table0_mvx,
-        table0_mvy,
-    },
-    {
-        1099,
-        table1_mv_code,
-        table1_mv_bits,
-        table1_mvx,
-        table1_mvy,
-    }
-};
-
-const uint8_t ff_v2_mb_type[8][2] = {
- {1, 1}, {0   , 2}, {3   , 3}, {9   , 5},
- {5, 4}, {0x21, 7}, {0x20, 7}, {0x11, 6},
-};
-
-const uint8_t ff_v2_intra_cbpc[4][2] = {
- {1, 1}, {0, 3}, {1, 3}, {1, 2},
-};
-
-const uint8_t ff_wmv1_y_dc_scale_table[32]={
-//  0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
-    0, 8, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21
-};
-const uint8_t ff_wmv1_c_dc_scale_table[32]={
-//  0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
-    0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22
-};
-
-const uint8_t ff_old_ff_y_dc_scale_table[32]={
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-    0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
-};
-
-const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]={
-  {
-    0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
-    0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
-    0x30, 0x38, 0x29, 0x21, 0x1A, 0x13, 0x0C, 0x05,
-    0x06, 0x0D, 0x14, 0x1B, 0x22, 0x31, 0x39, 0x3A,
-    0x32, 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F,
-    0x16, 0x1D, 0x24, 0x2B, 0x33, 0x3B, 0x3C, 0x34,
-    0x2C, 0x25, 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x35,
-    0x3D, 0x3E, 0x36, 0x2E, 0x27, 0x2F, 0x37, 0x3F,
-  },
-  {
-    0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
-    0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
-    0x21, 0x30, 0x1A, 0x13, 0x0C, 0x05, 0x06, 0x0D,
-    0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, 0x2A,
-    0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, 0x16, 0x1D,
-    0x24, 0x2B, 0x32, 0x3A, 0x33, 0x3B, 0x2C, 0x25,
-    0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3C, 0x35,
-    0x3D, 0x2E, 0x27, 0x2F, 0x36, 0x3E, 0x37, 0x3F,
-  },
-  {
-    0x00, 0x01, 0x08, 0x02, 0x03, 0x09, 0x10, 0x18,
-    0x11, 0x0A, 0x04, 0x05, 0x0B, 0x12, 0x19, 0x20,
-    0x28, 0x30, 0x21, 0x1A, 0x13, 0x0C, 0x06, 0x07,
-    0x0D, 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39,
-    0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x0F, 0x16, 0x1D,
-    0x24, 0x2B, 0x32, 0x3A, 0x33, 0x2C, 0x25, 0x1E,
-    0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3B, 0x3C, 0x35,
-    0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
-  },
-  {
-    0x00, 0x08, 0x10, 0x01, 0x18, 0x20, 0x28, 0x09,
-    0x02, 0x03, 0x0A, 0x11, 0x19, 0x30, 0x38, 0x29,
-    0x21, 0x1A, 0x12, 0x0B, 0x04, 0x05, 0x0C, 0x13,
-    0x1B, 0x22, 0x31, 0x39, 0x32, 0x2A, 0x23, 0x1C,
-    0x14, 0x0D, 0x06, 0x07, 0x0E, 0x15, 0x1D, 0x24,
-    0x2B, 0x33, 0x3A, 0x3B, 0x34, 0x2C, 0x25, 0x1E,
-    0x16, 0x0F, 0x17, 0x1F, 0x26, 0x2D, 0x3C, 0x35,
-    0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
-  }
-};
-
-const uint8_t ff_table_inter_intra[4][2]={
-    {0,1} /*Luma-Left Chroma-Left*/,
-    {2,2} /*Luma-Top  Chroma-Left*/,
-    {6,3} /*luma-Left Chroma-Top */,
-    {7,3} /*luma-Top  Chroma-Top */
-};
-
-static const uint32_t table_mb_non_intra2[128][2] = {
-{0x0000A7, 14}, {0x01B2B8, 18}, {0x01B28E, 18}, {0x036575, 19},
-{0x006CAC, 16}, {0x000A69, 18}, {0x002934, 20}, {0x00526B, 21},
-{0x006CA1, 16}, {0x01B2B9, 18}, {0x0029AD, 20}, {0x029353, 24},
-{0x006CA7, 16}, {0x006CAB, 16}, {0x01B2BB, 18}, {0x00029B, 16},
-{0x00D944, 17}, {0x000A6A, 18}, {0x0149A8, 23}, {0x03651F, 19},
-{0x006CAF, 16}, {0x000A4C, 18}, {0x03651E, 19}, {0x000A48, 18},
-{0x00299C, 20}, {0x00299F, 20}, {0x029352, 24}, {0x0029AC, 20},
-{0x000296, 16}, {0x00D946, 17}, {0x000A68, 18}, {0x000298, 16},
-{0x000527, 17}, {0x00D94D, 17}, {0x0014D7, 19}, {0x036574, 19},
-{0x000A5C, 18}, {0x01B299, 18}, {0x00299D, 20}, {0x00299E, 20},
-{0x000525, 17}, {0x000A66, 18}, {0x00A4D5, 22}, {0x00149B, 19},
-{0x000295, 16}, {0x006CAD, 16}, {0x000A49, 18}, {0x000521, 17},
-{0x006CAA, 16}, {0x00D945, 17}, {0x01B298, 18}, {0x00052F, 17},
-{0x003654, 15}, {0x006CA0, 16}, {0x000532, 17}, {0x000291, 16},
-{0x003652, 15}, {0x000520, 17}, {0x000A5D, 18}, {0x000294, 16},
-{0x00009B, 11}, {0x0006E2, 12}, {0x000028, 12}, {0x0001B0, 10},
-{0x000001,  3}, {0x000010,  8}, {0x00002F,  6}, {0x00004C, 10},
-{0x00000D,  4}, {0x000000, 10}, {0x000006,  9}, {0x000134, 12},
-{0x00000C,  4}, {0x000007, 10}, {0x000007,  9}, {0x0006E1, 12},
-{0x00000E,  5}, {0x0000DA,  9}, {0x000022,  9}, {0x000364, 11},
-{0x00000F,  4}, {0x000006, 10}, {0x00000F,  9}, {0x000135, 12},
-{0x000014,  5}, {0x0000DD,  9}, {0x000004,  9}, {0x000015, 11},
-{0x00001A,  6}, {0x0001B3, 10}, {0x000005, 10}, {0x0006E3, 12},
-{0x00000C,  5}, {0x0000B9,  8}, {0x000004,  8}, {0x0000DB,  9},
-{0x00000E,  4}, {0x00000B, 10}, {0x000023,  9}, {0x0006CB, 12},
-{0x000005,  6}, {0x0001B1, 10}, {0x000001, 10}, {0x0006E0, 12},
-{0x000011,  5}, {0x0000DF,  9}, {0x00000E,  9}, {0x000373, 11},
-{0x000003,  5}, {0x0000B8,  8}, {0x000006,  8}, {0x000175,  9},
-{0x000015,  5}, {0x000174,  9}, {0x000027,  9}, {0x000372, 11},
-{0x000010,  5}, {0x0000BB,  8}, {0x000005,  8}, {0x0000DE,  9},
-{0x00000F,  5}, {0x000001,  9}, {0x000012,  8}, {0x000004, 10},
-{0x000002,  3}, {0x000016,  5}, {0x000009,  4}, {0x000001,  5},
-};
-
-static const uint32_t table_mb_non_intra3[128][2] = {
-{0x0002A1, 10}, {0x005740, 15}, {0x01A0BF, 18}, {0x015D19, 17},
-{0x001514, 13}, {0x00461E, 15}, {0x015176, 17}, {0x015177, 17},
-{0x0011AD, 13}, {0x00682E, 16}, {0x0682F9, 20}, {0x03417D, 19},
-{0x001A36, 14}, {0x002A2D, 14}, {0x00D05E, 17}, {0x006824, 16},
-{0x001515, 13}, {0x00545C, 15}, {0x0230E9, 18}, {0x011AFA, 17},
-{0x0015D7, 13}, {0x005747, 15}, {0x008D79, 16}, {0x006825, 16},
-{0x002BA2, 14}, {0x00A8BA, 16}, {0x0235F6, 18}, {0x015D18, 17},
-{0x0011AE, 13}, {0x00346F, 15}, {0x008C3B, 16}, {0x00346E, 15},
-{0x000D1A, 13}, {0x00461F, 15}, {0x0682F8, 20}, {0x011875, 17},
-{0x002BA1, 14}, {0x008D61, 16}, {0x0235F7, 18}, {0x0230E8, 18},
-{0x001513, 13}, {0x008D7B, 16}, {0x011AF4, 17}, {0x011AF5, 17},
-{0x001185, 13}, {0x0046BF, 15}, {0x008D60, 16}, {0x008D7C, 16},
-{0x001512, 13}, {0x00461C, 15}, {0x00AE8D, 16}, {0x008D78, 16},
-{0x000D0E, 13}, {0x003413, 15}, {0x0046B1, 15}, {0x003416, 15},
-{0x000AEA, 12}, {0x002A2C, 14}, {0x005741, 15}, {0x002A2F, 14},
-{0x000158,  9}, {0x0008D2, 12}, {0x00054C, 11}, {0x000686, 12},
-{0x000000,  2}, {0x000069,  8}, {0x00006B,  8}, {0x00068C, 12},
-{0x000007,  3}, {0x00015E,  9}, {0x0002A3, 10}, {0x000AE9, 12},
-{0x000006,  3}, {0x000231, 10}, {0x0002B8, 10}, {0x001A08, 14},
-{0x000010,  5}, {0x0001A9, 10}, {0x000342, 11}, {0x000A88, 12},
-{0x000004,  4}, {0x0001A2, 10}, {0x0002A4, 10}, {0x001184, 13},
-{0x000012,  5}, {0x000232, 10}, {0x0002B2, 10}, {0x000680, 12},
-{0x00001B,  6}, {0x00046A, 11}, {0x00068E, 12}, {0x002359, 14},
-{0x000016,  5}, {0x00015F,  9}, {0x0002A0, 10}, {0x00054D, 11},
-{0x000005,  4}, {0x000233, 10}, {0x0002B9, 10}, {0x0015D6, 13},
-{0x000022,  6}, {0x000468, 11}, {0x000683, 12}, {0x001A0A, 14},
-{0x000013,  5}, {0x000236, 10}, {0x0002BB, 10}, {0x001186, 13},
-{0x000017,  5}, {0x0001AB, 10}, {0x0002A7, 10}, {0x0008D3, 12},
-{0x000014,  5}, {0x000237, 10}, {0x000460, 11}, {0x000D0F, 13},
-{0x000019,  6}, {0x0001AA, 10}, {0x0002B3, 10}, {0x000681, 12},
-{0x000018,  6}, {0x0001A8, 10}, {0x0002A5, 10}, {0x00068F, 12},
-{0x000007,  4}, {0x000055,  7}, {0x000047,  7}, {0x0000AD,  8},
-};
-
-static const uint32_t table_mb_non_intra4[128][2] = {
-{0x0000D4,  8}, {0x0021C5, 14}, {0x00F18A, 16}, {0x00D5BC, 16},
-{0x000879, 12}, {0x00354D, 14}, {0x010E3F, 17}, {0x010F54, 17},
-{0x000866, 12}, {0x00356E, 14}, {0x010F55, 17}, {0x010E3E, 17},
-{0x0010CE, 13}, {0x003C84, 14}, {0x00D5BD, 16}, {0x00F18B, 16},
-{0x000868, 12}, {0x00438C, 15}, {0x0087AB, 16}, {0x00790B, 15},
-{0x000F10, 12}, {0x00433D, 15}, {0x006AD3, 15}, {0x00790A, 15},
-{0x001AA7, 13}, {0x0043D4, 15}, {0x00871E, 16}, {0x006ADF, 15},
-{0x000D7C, 12}, {0x003C94, 14}, {0x00438D, 15}, {0x006AD2, 15},
-{0x0006BC, 11}, {0x0021E9, 14}, {0x006ADA, 15}, {0x006A99, 15},
-{0x0010F7, 13}, {0x004389, 15}, {0x006ADB, 15}, {0x0078C4, 15},
-{0x000D56, 12}, {0x0035F7, 14}, {0x00438E, 15}, {0x006A98, 15},
-{0x000D52, 12}, {0x003C95, 14}, {0x004388, 15}, {0x00433C, 15},
-{0x000D54, 12}, {0x001E4B, 13}, {0x003C63, 14}, {0x003C83, 14},
-{0x000861, 12}, {0x0021EB, 14}, {0x00356C, 14}, {0x0035F6, 14},
-{0x000863, 12}, {0x00219F, 14}, {0x003568, 14}, {0x003C82, 14},
-{0x0001AE,  9}, {0x0010C0, 13}, {0x000F11, 12}, {0x001AFA, 13},
-{0x000000,  1}, {0x0000F0,  8}, {0x0001AD,  9}, {0x0010C1, 13},
-{0x00000A,  4}, {0x0003C5, 10}, {0x000789, 11}, {0x001AB5, 13},
-{0x000009,  4}, {0x000435, 11}, {0x000793, 11}, {0x001E40, 13},
-{0x00001D,  5}, {0x0003CB, 10}, {0x000878, 12}, {0x001AAF, 13},
-{0x00000B,  4}, {0x0003C7, 10}, {0x000791, 11}, {0x001AAB, 13},
-{0x00001F,  5}, {0x000436, 11}, {0x0006BF, 11}, {0x000F19, 12},
-{0x00003D,  6}, {0x000D51, 12}, {0x0010C4, 13}, {0x0021E8, 14},
-{0x000036,  6}, {0x000437, 11}, {0x0006AF, 11}, {0x0010C5, 13},
-{0x00000C,  4}, {0x000432, 11}, {0x000794, 11}, {0x001E30, 13},
-{0x000042,  7}, {0x000870, 12}, {0x000F24, 12}, {0x001E43, 13},
-{0x000020,  6}, {0x00043E, 11}, {0x000795, 11}, {0x001AAA, 13},
-{0x000037,  6}, {0x0006AC, 11}, {0x0006AE, 11}, {0x0010F6, 13},
-{0x000034,  6}, {0x00043A, 11}, {0x000D50, 12}, {0x001AAE, 13},
-{0x000039,  6}, {0x00043F, 11}, {0x00078D, 11}, {0x0010D2, 13},
-{0x000038,  6}, {0x00043B, 11}, {0x0006BD, 11}, {0x0010D3, 13},
-{0x000011,  5}, {0x0001AC,  9}, {0x0000F3,  8}, {0x000439, 11},
-};
-
-const uint32_t (* const ff_wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]={
-    table_mb_non_intra2,
-    table_mb_non_intra3,
-    table_mb_non_intra4,
-    ff_table_mb_non_intra,
-};
-
-const uint8_t ff_wmv2_scantableA[64]={
-0x00, 0x01, 0x02, 0x08, 0x03, 0x09, 0x0A, 0x10,
-0x04, 0x0B, 0x11, 0x18, 0x12, 0x0C, 0x05, 0x13,
-0x19, 0x0D, 0x14, 0x1A, 0x1B, 0x06, 0x15, 0x1C,
-0x0E, 0x16, 0x1D, 0x07, 0x1E, 0x0F, 0x17, 0x1F,
-};
-
-const uint8_t ff_wmv2_scantableB[64]={
-0x00, 0x08, 0x01, 0x10, 0x09, 0x18, 0x11, 0x02,
-0x20, 0x0A, 0x19, 0x28, 0x12, 0x30, 0x21, 0x1A,
-0x38, 0x29, 0x22, 0x03, 0x31, 0x39, 0x0B, 0x2A,
-0x13, 0x32, 0x1B, 0x3A, 0x23, 0x2B, 0x33, 0x3B,
-};
diff --git a/deps/libav/libavcodec/msmpeg4data.h b/deps/libav/libavcodec/msmpeg4data.h
deleted file mode 100644
index ca2dac1..0000000
--- a/deps/libav/libavcodec/msmpeg4data.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * MSMPEG4 backend for encoder and decoder
- * copyright (c) 2001 Fabrice Bellard
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MSMPEG4 data tables.
- */
-
-#ifndef AVCODEC_MSMPEG4DATA_H
-#define AVCODEC_MSMPEG4DATA_H
-
-#include "libavutil/common.h"
-#include "get_bits.h"
-#include "rl.h"
-
-/* motion vector table */
-typedef struct MVTable {
-    int n;
-    const uint16_t *table_mv_code;
-    const uint8_t *table_mv_bits;
-    const uint8_t *table_mvx;
-    const uint8_t *table_mvy;
-    uint16_t *table_mv_index; /* encoding: convert mv to index in table_mv */
-    VLC vlc;                /* decoding: vlc */
-} MVTable;
-
-extern VLC ff_msmp4_mb_i_vlc;
-extern VLC ff_msmp4_dc_luma_vlc[2];
-extern VLC ff_msmp4_dc_chroma_vlc[2];
-
-/* intra picture macroblock coded block pattern */
-extern const uint16_t ff_msmp4_mb_i_table[64][2];
-
-#define WMV1_SCANTABLE_COUNT 4
-
-extern const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64];
-
-#define NB_RL_TABLES  6
-
-extern RLTable ff_rl_table[NB_RL_TABLES];
-extern uint8_t ff_static_rl_table_store[NB_RL_TABLES][2][2 * MAX_RUN + MAX_LEVEL + 3];
-
-extern uint32_t ff_v2_dc_lum_table[512][2];
-extern uint32_t ff_v2_dc_chroma_table[512][2];
-
-extern const uint8_t ff_wmv1_y_dc_scale_table[32];
-extern const uint8_t ff_wmv1_c_dc_scale_table[32];
-extern const uint8_t ff_old_ff_y_dc_scale_table[32];
-
-extern MVTable ff_mv_tables[2];
-
-extern const uint8_t ff_v2_mb_type[8][2];
-extern const uint8_t ff_v2_intra_cbpc[4][2];
-
-extern const uint32_t ff_table_mb_non_intra[128][2];
-extern const uint8_t  ff_table_inter_intra[4][2];
-
-extern const uint32_t ff_table0_dc_lum[120][2];
-extern const uint32_t ff_table1_dc_lum[120][2];
-extern const uint32_t ff_table0_dc_chroma[120][2];
-extern const uint32_t ff_table1_dc_chroma[120][2];
-
-#define WMV2_INTER_CBP_TABLE_COUNT 4
-extern const uint32_t (* const ff_wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2];
-
-extern const uint8_t ff_wmv2_scantableA[64];
-extern const uint8_t ff_wmv2_scantableB[64];
-
-#endif /* AVCODEC_MSMPEG4DATA_H */
diff --git a/deps/libav/libavcodec/msmpeg4dec.c b/deps/libav/libavcodec/msmpeg4dec.c
deleted file mode 100644
index 9a12633..0000000
--- a/deps/libav/libavcodec/msmpeg4dec.c
+++ /dev/null
@@ -1,953 +0,0 @@
-/*
- * MSMPEG4 backend for encoder and decoder
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "msmpeg4.h"
-#include "libavutil/x86/asm.h"
-#include "h263.h"
-#include "mpeg4video.h"
-#include "msmpeg4data.h"
-#include "vc1data.h"
-
-#define DC_VLC_BITS 9
-#define V2_INTRA_CBPC_VLC_BITS 3
-#define V2_MB_TYPE_VLC_BITS 7
-#define MV_VLC_BITS 9
-#define V2_MV_VLC_BITS 9
-#define TEX_VLC_BITS 9
-
-#define DEFAULT_INTER_INDEX 3
-
-static inline int msmpeg4v1_pred_dc(MpegEncContext * s, int n,
-                                    int32_t **dc_val_ptr)
-{
-    int i;
-
-    if (n < 4) {
-        i= 0;
-    } else {
-        i= n-3;
-    }
-
-    *dc_val_ptr= &s->last_dc[i];
-    return s->last_dc[i];
-}
-
-/****************************************/
-/* decoding stuff */
-
-VLC ff_mb_non_intra_vlc[4];
-static VLC v2_dc_lum_vlc;
-static VLC v2_dc_chroma_vlc;
-static VLC v2_intra_cbpc_vlc;
-static VLC v2_mb_type_vlc;
-static VLC v2_mv_vlc;
-VLC ff_inter_intra_vlc;
-
-/* This is identical to h263 except that its range is multiplied by 2. */
-static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code)
-{
-    int code, val, sign, shift;
-
-    code = get_vlc2(&s->gb, v2_mv_vlc.table, V2_MV_VLC_BITS, 2);
-    av_dlog(s, "MV code %d at %d %d pred: %d\n", code, s->mb_x,s->mb_y, pred);
-    if (code < 0)
-        return 0xffff;
-
-    if (code == 0)
-        return pred;
-    sign = get_bits1(&s->gb);
-    shift = f_code - 1;
-    val = code;
-    if (shift) {
-        val = (val - 1) << shift;
-        val |= get_bits(&s->gb, shift);
-        val++;
-    }
-    if (sign)
-        val = -val;
-
-    val += pred;
-    if (val <= -64)
-        val += 64;
-    else if (val >= 64)
-        val -= 64;
-
-    return val;
-}
-
-static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64])
-{
-    int cbp, code, i;
-
-    if (s->pict_type == AV_PICTURE_TYPE_P) {
-        if (s->use_skip_mb_code) {
-            if (get_bits1(&s->gb)) {
-                /* skip mb */
-                s->mb_intra = 0;
-                for(i=0;i<6;i++)
-                    s->block_last_index[i] = -1;
-                s->mv_dir = MV_DIR_FORWARD;
-                s->mv_type = MV_TYPE_16X16;
-                s->mv[0][0][0] = 0;
-                s->mv[0][0][1] = 0;
-                s->mb_skipped = 1;
-                return 0;
-            }
-        }
-
-        if(s->msmpeg4_version==2)
-            code = get_vlc2(&s->gb, v2_mb_type_vlc.table, V2_MB_TYPE_VLC_BITS, 1);
-        else
-            code = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
-        if(code<0 || code>7){
-            av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", code, s->mb_x, s->mb_y);
-            return -1;
-        }
-
-        s->mb_intra = code >>2;
-
-        cbp = code & 0x3;
-    } else {
-        s->mb_intra = 1;
-        if(s->msmpeg4_version==2)
-            cbp= get_vlc2(&s->gb, v2_intra_cbpc_vlc.table, V2_INTRA_CBPC_VLC_BITS, 1);
-        else
-            cbp= get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 1);
-        if(cbp<0 || cbp>3){
-            av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);
-            return -1;
-        }
-    }
-
-    if (!s->mb_intra) {
-        int mx, my, cbpy;
-
-        cbpy= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
-        if(cbpy<0){
-            av_log(s->avctx, AV_LOG_ERROR, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);
-            return -1;
-        }
-
-        cbp|= cbpy<<2;
-        if(s->msmpeg4_version==1 || (cbp&3) != 3) cbp^= 0x3C;
-
-        ff_h263_pred_motion(s, 0, 0, &mx, &my);
-        mx= msmpeg4v2_decode_motion(s, mx, 1);
-        my= msmpeg4v2_decode_motion(s, my, 1);
-
-        s->mv_dir = MV_DIR_FORWARD;
-        s->mv_type = MV_TYPE_16X16;
-        s->mv[0][0][0] = mx;
-        s->mv[0][0][1] = my;
-    } else {
-        if(s->msmpeg4_version==2){
-            s->ac_pred = get_bits1(&s->gb);
-            cbp|= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors
-        } else{
-            s->ac_pred = 0;
-            cbp|= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors
-            if(s->pict_type==AV_PICTURE_TYPE_P) cbp^=0x3C;
-        }
-    }
-
-    s->dsp.clear_blocks(s->block[0]);
-    for (i = 0; i < 6; i++) {
-        if (ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
-        {
-             av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
-             return -1;
-        }
-    }
-    return 0;
-}
-
-static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64])
-{
-    int cbp, code, i;
-    uint8_t *coded_val;
-    uint32_t * const mb_type_ptr = &s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride];
-
-    if (s->pict_type == AV_PICTURE_TYPE_P) {
-        if (s->use_skip_mb_code) {
-            if (get_bits1(&s->gb)) {
-                /* skip mb */
-                s->mb_intra = 0;
-                for(i=0;i<6;i++)
-                    s->block_last_index[i] = -1;
-                s->mv_dir = MV_DIR_FORWARD;
-                s->mv_type = MV_TYPE_16X16;
-                s->mv[0][0][0] = 0;
-                s->mv[0][0][1] = 0;
-                s->mb_skipped = 1;
-                *mb_type_ptr = MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16;
-
-                return 0;
-            }
-        }
-
-        code = get_vlc2(&s->gb, ff_mb_non_intra_vlc[DEFAULT_INTER_INDEX].table, MB_NON_INTRA_VLC_BITS, 3);
-        if (code < 0)
-            return -1;
-        //s->mb_intra = (code & 0x40) ? 0 : 1;
-        s->mb_intra = (~code & 0x40) >> 6;
-
-        cbp = code & 0x3f;
-    } else {
-        s->mb_intra = 1;
-        code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
-        if (code < 0)
-            return -1;
-        /* predict coded block pattern */
-        cbp = 0;
-        for(i=0;i<6;i++) {
-            int val = ((code >> (5 - i)) & 1);
-            if (i < 4) {
-                int pred = ff_msmpeg4_coded_block_pred(s, i, &coded_val);
-                val = val ^ pred;
-                *coded_val = val;
-            }
-            cbp |= val << (5 - i);
-        }
-    }
-
-    if (!s->mb_intra) {
-        int mx, my;
-        if(s->per_mb_rl_table && cbp){
-            s->rl_table_index = decode012(&s->gb);
-            s->rl_chroma_table_index = s->rl_table_index;
-        }
-        ff_h263_pred_motion(s, 0, 0, &mx, &my);
-        if (ff_msmpeg4_decode_motion(s, &mx, &my) < 0)
-            return -1;
-        s->mv_dir = MV_DIR_FORWARD;
-        s->mv_type = MV_TYPE_16X16;
-        s->mv[0][0][0] = mx;
-        s->mv[0][0][1] = my;
-        *mb_type_ptr = MB_TYPE_L0 | MB_TYPE_16x16;
-    } else {
-        av_dlog(s, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
-                ((cbp & 3) ? 1 : 0) +((cbp & 0x3C)? 2 : 0),
-                show_bits(&s->gb, 24));
-        s->ac_pred = get_bits1(&s->gb);
-        *mb_type_ptr = MB_TYPE_INTRA;
-        if(s->inter_intra_pred){
-            s->h263_aic_dir= get_vlc2(&s->gb, ff_inter_intra_vlc.table, INTER_INTRA_VLC_BITS, 1);
-            av_dlog(s, "%d%d %d %d/",
-                    s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
-        }
-        if(s->per_mb_rl_table && cbp){
-            s->rl_table_index = decode012(&s->gb);
-            s->rl_chroma_table_index = s->rl_table_index;
-        }
-    }
-
-    s->dsp.clear_blocks(s->block[0]);
-    for (i = 0; i < 6; i++) {
-        if (ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
-        {
-            av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
-            return -1;
-        }
-    }
-
-    return 0;
-}
-
-/* init all vlc decoding tables */
-av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
-{
-    MpegEncContext *s = avctx->priv_data;
-    static int done = 0;
-    int i;
-    MVTable *mv;
-
-    if (ff_h263_decode_init(avctx) < 0)
-        return -1;
-
-    ff_msmpeg4_common_init(s);
-
-    if (!done) {
-        done = 1;
-
-        for(i=0;i<NB_RL_TABLES;i++) {
-            ff_init_rl(&ff_rl_table[i], ff_static_rl_table_store[i]);
-        }
-        INIT_VLC_RL(ff_rl_table[0], 642);
-        INIT_VLC_RL(ff_rl_table[1], 1104);
-        INIT_VLC_RL(ff_rl_table[2], 554);
-        INIT_VLC_RL(ff_rl_table[3], 940);
-        INIT_VLC_RL(ff_rl_table[4], 962);
-        INIT_VLC_RL(ff_rl_table[5], 554);
-
-        mv = &ff_mv_tables[0];
-        INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, mv->n + 1,
-                    mv->table_mv_bits, 1, 1,
-                    mv->table_mv_code, 2, 2, 3714);
-        mv = &ff_mv_tables[1];
-        INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, mv->n + 1,
-                    mv->table_mv_bits, 1, 1,
-                    mv->table_mv_code, 2, 2, 2694);
-
-        INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], DC_VLC_BITS, 120,
-                 &ff_table0_dc_lum[0][1], 8, 4,
-                 &ff_table0_dc_lum[0][0], 8, 4, 1158);
-        INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], DC_VLC_BITS, 120,
-                 &ff_table0_dc_chroma[0][1], 8, 4,
-                 &ff_table0_dc_chroma[0][0], 8, 4, 1118);
-        INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], DC_VLC_BITS, 120,
-                 &ff_table1_dc_lum[0][1], 8, 4,
-                 &ff_table1_dc_lum[0][0], 8, 4, 1476);
-        INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], DC_VLC_BITS, 120,
-                 &ff_table1_dc_chroma[0][1], 8, 4,
-                 &ff_table1_dc_chroma[0][0], 8, 4, 1216);
-
-        INIT_VLC_STATIC(&v2_dc_lum_vlc, DC_VLC_BITS, 512,
-                 &ff_v2_dc_lum_table[0][1], 8, 4,
-                 &ff_v2_dc_lum_table[0][0], 8, 4, 1472);
-        INIT_VLC_STATIC(&v2_dc_chroma_vlc, DC_VLC_BITS, 512,
-                 &ff_v2_dc_chroma_table[0][1], 8, 4,
-                 &ff_v2_dc_chroma_table[0][0], 8, 4, 1506);
-
-        INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4,
-                 &ff_v2_intra_cbpc[0][1], 2, 1,
-                 &ff_v2_intra_cbpc[0][0], 2, 1, 8);
-        INIT_VLC_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8,
-                 &ff_v2_mb_type[0][1], 2, 1,
-                 &ff_v2_mb_type[0][0], 2, 1, 128);
-        INIT_VLC_STATIC(&v2_mv_vlc, V2_MV_VLC_BITS, 33,
-                 &ff_mvtab[0][1], 2, 1,
-                 &ff_mvtab[0][0], 2, 1, 538);
-
-        INIT_VLC_STATIC(&ff_mb_non_intra_vlc[0], MB_NON_INTRA_VLC_BITS, 128,
-                     &ff_wmv2_inter_table[0][0][1], 8, 4,
-                     &ff_wmv2_inter_table[0][0][0], 8, 4, 1636);
-        INIT_VLC_STATIC(&ff_mb_non_intra_vlc[1], MB_NON_INTRA_VLC_BITS, 128,
-                     &ff_wmv2_inter_table[1][0][1], 8, 4,
-                     &ff_wmv2_inter_table[1][0][0], 8, 4, 2648);
-        INIT_VLC_STATIC(&ff_mb_non_intra_vlc[2], MB_NON_INTRA_VLC_BITS, 128,
-                     &ff_wmv2_inter_table[2][0][1], 8, 4,
-                     &ff_wmv2_inter_table[2][0][0], 8, 4, 1532);
-        INIT_VLC_STATIC(&ff_mb_non_intra_vlc[3], MB_NON_INTRA_VLC_BITS, 128,
-                     &ff_wmv2_inter_table[3][0][1], 8, 4,
-                     &ff_wmv2_inter_table[3][0][0], 8, 4, 2488);
-
-        INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64,
-                 &ff_msmp4_mb_i_table[0][1], 4, 2,
-                 &ff_msmp4_mb_i_table[0][0], 4, 2, 536);
-
-        INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4,
-                 &ff_table_inter_intra[0][1], 2, 1,
-                 &ff_table_inter_intra[0][0], 2, 1, 8);
-    }
-
-    switch(s->msmpeg4_version){
-    case 1:
-    case 2:
-        s->decode_mb= msmpeg4v12_decode_mb;
-        break;
-    case 3:
-    case 4:
-        s->decode_mb= msmpeg4v34_decode_mb;
-        break;
-    case 5:
-        if (CONFIG_WMV2_DECODER)
-            s->decode_mb= ff_wmv2_decode_mb;
-    case 6:
-        //FIXME + TODO VC1 decode mb
-        break;
-    }
-
-    s->slice_height= s->mb_height; //to avoid 1/0 if the first frame is not a keyframe
-
-    return 0;
-}
-
-int ff_msmpeg4_decode_picture_header(MpegEncContext * s)
-{
-    int code;
-
-    if(s->msmpeg4_version==1){
-        int start_code = get_bits_long(&s->gb, 32);
-        if(start_code!=0x00000100){
-            av_log(s->avctx, AV_LOG_ERROR, "invalid startcode\n");
-            return -1;
-        }
-
-        skip_bits(&s->gb, 5); // frame number */
-    }
-
-    s->pict_type = get_bits(&s->gb, 2) + 1;
-    if (s->pict_type != AV_PICTURE_TYPE_I &&
-        s->pict_type != AV_PICTURE_TYPE_P){
-        av_log(s->avctx, AV_LOG_ERROR, "invalid picture type\n");
-        return -1;
-    }
-#if 0
-{
-    static int had_i=0;
-    if(s->pict_type == AV_PICTURE_TYPE_I) had_i=1;
-    if(!had_i) return -1;
-}
-#endif
-    s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
-    if(s->qscale==0){
-        av_log(s->avctx, AV_LOG_ERROR, "invalid qscale\n");
-        return -1;
-    }
-
-    if (s->pict_type == AV_PICTURE_TYPE_I) {
-        code = get_bits(&s->gb, 5);
-        if(s->msmpeg4_version==1){
-            if(code==0 || code>s->mb_height){
-                av_log(s->avctx, AV_LOG_ERROR, "invalid slice height %d\n", code);
-                return -1;
-            }
-
-            s->slice_height = code;
-        }else{
-            /* 0x17: one slice, 0x18: two slices, ... */
-            if (code < 0x17){
-                av_log(s->avctx, AV_LOG_ERROR, "error, slice code was %X\n", code);
-                return -1;
-            }
-
-            s->slice_height = s->mb_height / (code - 0x16);
-        }
-
-        switch(s->msmpeg4_version){
-        case 1:
-        case 2:
-            s->rl_chroma_table_index = 2;
-            s->rl_table_index = 2;
-
-            s->dc_table_index = 0; //not used
-            break;
-        case 3:
-            s->rl_chroma_table_index = decode012(&s->gb);
-            s->rl_table_index = decode012(&s->gb);
-
-            s->dc_table_index = get_bits1(&s->gb);
-            break;
-        case 4:
-            ff_msmpeg4_decode_ext_header(s, (2+5+5+17+7)/8);
-
-            if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb);
-            else                           s->per_mb_rl_table= 0;
-
-            if(!s->per_mb_rl_table){
-                s->rl_chroma_table_index = decode012(&s->gb);
-                s->rl_table_index = decode012(&s->gb);
-            }
-
-            s->dc_table_index = get_bits1(&s->gb);
-            s->inter_intra_pred= 0;
-            break;
-        }
-        s->no_rounding = 1;
-        if(s->avctx->debug&FF_DEBUG_PICT_INFO)
-            av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d slice:%d   \n",
-                s->qscale,
-                s->rl_chroma_table_index,
-                s->rl_table_index,
-                s->dc_table_index,
-                s->per_mb_rl_table,
-                s->slice_height);
-    } else {
-        switch(s->msmpeg4_version){
-        case 1:
-        case 2:
-            if(s->msmpeg4_version==1)
-                s->use_skip_mb_code = 1;
-            else
-                s->use_skip_mb_code = get_bits1(&s->gb);
-            s->rl_table_index = 2;
-            s->rl_chroma_table_index = s->rl_table_index;
-            s->dc_table_index = 0; //not used
-            s->mv_table_index = 0;
-            break;
-        case 3:
-            s->use_skip_mb_code = get_bits1(&s->gb);
-            s->rl_table_index = decode012(&s->gb);
-            s->rl_chroma_table_index = s->rl_table_index;
-
-            s->dc_table_index = get_bits1(&s->gb);
-
-            s->mv_table_index = get_bits1(&s->gb);
-            break;
-        case 4:
-            s->use_skip_mb_code = get_bits1(&s->gb);
-
-            if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb);
-            else                           s->per_mb_rl_table= 0;
-
-            if(!s->per_mb_rl_table){
-                s->rl_table_index = decode012(&s->gb);
-                s->rl_chroma_table_index = s->rl_table_index;
-            }
-
-            s->dc_table_index = get_bits1(&s->gb);
-
-            s->mv_table_index = get_bits1(&s->gb);
-            s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
-            break;
-        }
-
-        if(s->avctx->debug&FF_DEBUG_PICT_INFO)
-            av_log(s->avctx, AV_LOG_DEBUG, "skip:%d rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d   \n",
-                s->use_skip_mb_code,
-                s->rl_table_index,
-                s->rl_chroma_table_index,
-                s->dc_table_index,
-                s->mv_table_index,
-                s->per_mb_rl_table,
-                s->qscale);
-
-        if(s->flipflop_rounding){
-            s->no_rounding ^= 1;
-        }else{
-            s->no_rounding = 0;
-        }
-    }
-    av_dlog(s->avctx, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
-            s->inter_intra_pred, s->width, s->height);
-
-    s->esc3_level_length= 0;
-    s->esc3_run_length= 0;
-
-    return 0;
-}
-
-int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size)
-{
-    int left= buf_size*8 - get_bits_count(&s->gb);
-    int length= s->msmpeg4_version>=3 ? 17 : 16;
-    /* the alt_bitstream reader could read over the end so we need to check it */
-    if(left>=length && left<length+8)
-    {
-        skip_bits(&s->gb, 5); /* fps */
-        s->bit_rate= get_bits(&s->gb, 11)*1024;
-        if(s->msmpeg4_version>=3)
-            s->flipflop_rounding= get_bits1(&s->gb);
-        else
-            s->flipflop_rounding= 0;
-    }
-    else if(left<length+8)
-    {
-        s->flipflop_rounding= 0;
-        if(s->msmpeg4_version != 2)
-            av_log(s->avctx, AV_LOG_ERROR, "ext header missing, %d left\n", left);
-    }
-    else
-    {
-        av_log(s->avctx, AV_LOG_ERROR, "I frame too long, ignoring ext header\n");
-    }
-
-    return 0;
-}
-
-static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
-{
-    int level, pred;
-
-    if(s->msmpeg4_version<=2){
-        if (n < 4) {
-            level = get_vlc2(&s->gb, v2_dc_lum_vlc.table, DC_VLC_BITS, 3);
-        } else {
-            level = get_vlc2(&s->gb, v2_dc_chroma_vlc.table, DC_VLC_BITS, 3);
-        }
-        if (level < 0)
-            return -1;
-        level-=256;
-    }else{  //FIXME optimize use unified tables & index
-        if (n < 4) {
-            level = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
-        } else {
-            level = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
-        }
-        if (level < 0){
-            av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
-            return -1;
-        }
-
-        if (level == DC_MAX) {
-            level = get_bits(&s->gb, 8);
-            if (get_bits1(&s->gb))
-                level = -level;
-        } else if (level != 0) {
-            if (get_bits1(&s->gb))
-                level = -level;
-        }
-    }
-
-    if(s->msmpeg4_version==1){
-        int32_t *dc_val;
-        pred = msmpeg4v1_pred_dc(s, n, &dc_val);
-        level += pred;
-
-        /* update predictor */
-        *dc_val= level;
-    }else{
-        int16_t *dc_val;
-        pred   = ff_msmpeg4_pred_dc(s, n, &dc_val, dir_ptr);
-        level += pred;
-
-        /* update predictor */
-        if (n < 4) {
-            *dc_val = level * s->y_dc_scale;
-        } else {
-            *dc_val = level * s->c_dc_scale;
-        }
-    }
-
-    return level;
-}
-
-//#define ERROR_DETAILS
-int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
-                              int n, int coded, const uint8_t *scan_table)
-{
-    int level, i, last, run, run_diff;
-    int av_uninit(dc_pred_dir);
-    RLTable *rl;
-    RL_VLC_ELEM *rl_vlc;
-    int qmul, qadd;
-
-    if (s->mb_intra) {
-        qmul=1;
-        qadd=0;
-
-        /* DC coef */
-        level = msmpeg4_decode_dc(s, n, &dc_pred_dir);
-
-        if (level < 0){
-            av_log(s->avctx, AV_LOG_ERROR, "dc overflow- block: %d qscale: %d//\n", n, s->qscale);
-            if(s->inter_intra_pred) level=0;
-            else                    return -1;
-        }
-        if (n < 4) {
-            rl = &ff_rl_table[s->rl_table_index];
-            if(level > 256*s->y_dc_scale){
-                av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ L qscale: %d//\n", s->qscale);
-                if(!s->inter_intra_pred) return -1;
-            }
-        } else {
-            rl = &ff_rl_table[3 + s->rl_chroma_table_index];
-            if(level > 256*s->c_dc_scale){
-                av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ C qscale: %d//\n", s->qscale);
-                if(!s->inter_intra_pred) return -1;
-            }
-        }
-        block[0] = level;
-
-        run_diff = s->msmpeg4_version >= 4;
-        i = 0;
-        if (!coded) {
-            goto not_coded;
-        }
-        if (s->ac_pred) {
-            if (dc_pred_dir == 0)
-                scan_table = s->intra_v_scantable.permutated; /* left */
-            else
-                scan_table = s->intra_h_scantable.permutated; /* top */
-        } else {
-            scan_table = s->intra_scantable.permutated;
-        }
-        rl_vlc= rl->rl_vlc[0];
-    } else {
-        qmul = s->qscale << 1;
-        qadd = (s->qscale - 1) | 1;
-        i = -1;
-        rl = &ff_rl_table[3 + s->rl_table_index];
-
-        if(s->msmpeg4_version==2)
-            run_diff = 0;
-        else
-            run_diff = 1;
-
-        if (!coded) {
-            s->block_last_index[n] = i;
-            return 0;
-        }
-        if(!scan_table)
-            scan_table = s->inter_scantable.permutated;
-        rl_vlc= rl->rl_vlc[s->qscale];
-    }
-  {
-    OPEN_READER(re, &s->gb);
-    for(;;) {
-        UPDATE_CACHE(re, &s->gb);
-        GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0);
-        if (level==0) {
-            int cache;
-            cache= GET_CACHE(re, &s->gb);
-            /* escape */
-            if (s->msmpeg4_version==1 || (cache&0x80000000)==0) {
-                if (s->msmpeg4_version==1 || (cache&0x40000000)==0) {
-                    /* third escape */
-                    if(s->msmpeg4_version!=1) LAST_SKIP_BITS(re, &s->gb, 2);
-                    UPDATE_CACHE(re, &s->gb);
-                    if(s->msmpeg4_version<=3){
-                        last=  SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1);
-                        run=   SHOW_UBITS(re, &s->gb, 6); SKIP_CACHE(re, &s->gb, 6);
-                        level= SHOW_SBITS(re, &s->gb, 8);
-                        SKIP_COUNTER(re, &s->gb, 1+6+8);
-                    }else{
-                        int sign;
-                        last=  SHOW_UBITS(re, &s->gb, 1); SKIP_BITS(re, &s->gb, 1);
-                        if(!s->esc3_level_length){
-                            int ll;
-                            av_dlog(s->avctx, "ESC-3 %X at %d %d\n",
-                                    show_bits(&s->gb, 24), s->mb_x, s->mb_y);
-                            if(s->qscale<8){
-                                ll= SHOW_UBITS(re, &s->gb, 3); SKIP_BITS(re, &s->gb, 3);
-                                if(ll==0){
-                                    ll= 8+SHOW_UBITS(re, &s->gb, 1); SKIP_BITS(re, &s->gb, 1);
-                                }
-                            }else{
-                                ll=2;
-                                while(ll<8 && SHOW_UBITS(re, &s->gb, 1)==0){
-                                    ll++;
-                                    SKIP_BITS(re, &s->gb, 1);
-                                }
-                                if(ll<8) SKIP_BITS(re, &s->gb, 1);
-                            }
-
-                            s->esc3_level_length= ll;
-                            s->esc3_run_length= SHOW_UBITS(re, &s->gb, 2) + 3; SKIP_BITS(re, &s->gb, 2);
-                            UPDATE_CACHE(re, &s->gb);
-                        }
-                        run=   SHOW_UBITS(re, &s->gb, s->esc3_run_length);
-                        SKIP_BITS(re, &s->gb, s->esc3_run_length);
-
-                        sign=  SHOW_UBITS(re, &s->gb, 1);
-                        SKIP_BITS(re, &s->gb, 1);
-
-                        level= SHOW_UBITS(re, &s->gb, s->esc3_level_length);
-                        SKIP_BITS(re, &s->gb, s->esc3_level_length);
-                        if(sign) level= -level;
-                    }
-
-#if 0 // waste of time / this will detect very few errors
-                    {
-                        const int abs_level= FFABS(level);
-                        const int run1= run - rl->max_run[last][abs_level] - run_diff;
-                        if(abs_level<=MAX_LEVEL && run<=MAX_RUN){
-                            if(abs_level <= rl->max_level[last][run]){
-                                av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, vlc encoding possible\n");
-                                return DECODING_AC_LOST;
-                            }
-                            if(abs_level <= rl->max_level[last][run]*2){
-                                av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 1 encoding possible\n");
-                                return DECODING_AC_LOST;
-                            }
-                            if(run1>=0 && abs_level <= rl->max_level[last][run1]){
-                                av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 2 encoding possible\n");
-                                return DECODING_AC_LOST;
-                            }
-                        }
-                    }
-#endif
-                    //level = level * qmul + (level>0) * qadd - (level<=0) * qadd ;
-                    if (level>0) level= level * qmul + qadd;
-                    else         level= level * qmul - qadd;
-#if 0 // waste of time too :(
-                    if(level>2048 || level<-2048){
-                        av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. esc\n");
-                        return DECODING_AC_LOST;
-                    }
-#endif
-                    i+= run + 1;
-                    if(last) i+=192;
-#ifdef ERROR_DETAILS
-                if(run==66)
-                    av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC3 level=%d\n", level);
-                else if((i>62 && i<192) || i>192+63)
-                    av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC3 i=%d run=%d level=%d\n", i, run, level);
-#endif
-                } else {
-                    /* second escape */
-                    SKIP_BITS(re, &s->gb, 2);
-                    GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
-                    i+= run + rl->max_run[run>>7][level/qmul] + run_diff; //FIXME opt indexing
-                    level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
-                    LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
-                if(run==66)
-                    av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC2 level=%d\n", level);
-                else if((i>62 && i<192) || i>192+63)
-                    av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC2 i=%d run=%d level=%d\n", i, run, level);
-#endif
-                }
-            } else {
-                /* first escape */
-                SKIP_BITS(re, &s->gb, 1);
-                GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
-                i+= run;
-                level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing
-                level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
-                LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
-                if(run==66)
-                    av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC1 level=%d\n", level);
-                else if((i>62 && i<192) || i>192+63)
-                    av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC1 i=%d run=%d level=%d\n", i, run, level);
-#endif
-            }
-        } else {
-            i+= run;
-            level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
-            LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
-                if(run==66)
-                    av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code level=%d\n", level);
-                else if((i>62 && i<192) || i>192+63)
-                    av_log(s->avctx, AV_LOG_ERROR, "run overflow i=%d run=%d level=%d\n", i, run, level);
-#endif
-        }
-        if (i > 62){
-            i-= 192;
-            if(i&(~63)){
-                const int left= get_bits_left(&s->gb);
-                if(((i+192 == 64 && level/qmul==-1) || !(s->err_recognition&AV_EF_BITSTREAM)) && left>=0){
-                    av_log(s->avctx, AV_LOG_ERROR, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y);
-                    break;
-                }else{
-                    av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
-                    return -1;
-                }
-            }
-
-            block[scan_table[i]] = level;
-            break;
-        }
-
-        block[scan_table[i]] = level;
-    }
-    CLOSE_READER(re, &s->gb);
-  }
- not_coded:
-    if (s->mb_intra) {
-        ff_mpeg4_pred_ac(s, block, n, dc_pred_dir);
-        if (s->ac_pred) {
-            i = 63; /* XXX: not optimal */
-        }
-    }
-    if(s->msmpeg4_version>=4 && i>0) i=63; //FIXME/XXX optimize
-    s->block_last_index[n] = i;
-
-    return 0;
-}
-
-int ff_msmpeg4_decode_motion(MpegEncContext * s,
-                                 int *mx_ptr, int *my_ptr)
-{
-    MVTable *mv;
-    int code, mx, my;
-
-    mv = &ff_mv_tables[s->mv_table_index];
-
-    code = get_vlc2(&s->gb, mv->vlc.table, MV_VLC_BITS, 2);
-    if (code < 0){
-        av_log(s->avctx, AV_LOG_ERROR, "illegal MV code at %d %d\n", s->mb_x, s->mb_y);
-        return -1;
-    }
-    if (code == mv->n) {
-        mx = get_bits(&s->gb, 6);
-        my = get_bits(&s->gb, 6);
-    } else {
-        mx = mv->table_mvx[code];
-        my = mv->table_mvy[code];
-    }
-
-    mx += *mx_ptr - 32;
-    my += *my_ptr - 32;
-    /* WARNING : they do not do exactly modulo encoding */
-    if (mx <= -64)
-        mx += 64;
-    else if (mx >= 64)
-        mx -= 64;
-
-    if (my <= -64)
-        my += 64;
-    else if (my >= 64)
-        my -= 64;
-    *mx_ptr = mx;
-    *my_ptr = my;
-    return 0;
-}
-
-AVCodec ff_msmpeg4v1_decoder = {
-    .name           = "msmpeg4v1",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSMPEG4V1,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_msmpeg4_decode_init,
-    .close          = ff_h263_decode_end,
-    .decode         = ff_h263_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .pix_fmts       = ff_pixfmt_list_420,
-};
-
-AVCodec ff_msmpeg4v2_decoder = {
-    .name           = "msmpeg4v2",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSMPEG4V2,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_msmpeg4_decode_init,
-    .close          = ff_h263_decode_end,
-    .decode         = ff_h263_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .pix_fmts       = ff_pixfmt_list_420,
-};
-
-AVCodec ff_msmpeg4v3_decoder = {
-    .name           = "msmpeg4",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSMPEG4V3,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_msmpeg4_decode_init,
-    .close          = ff_h263_decode_end,
-    .decode         = ff_h263_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .pix_fmts       = ff_pixfmt_list_420,
-};
-
-AVCodec ff_wmv1_decoder = {
-    .name           = "wmv1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Video 7"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WMV1,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_msmpeg4_decode_init,
-    .close          = ff_h263_decode_end,
-    .decode         = ff_h263_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .pix_fmts       = ff_pixfmt_list_420,
-};
diff --git a/deps/libav/libavcodec/msmpeg4enc.c b/deps/libav/libavcodec/msmpeg4enc.c
deleted file mode 100644
index 45ef208..0000000
--- a/deps/libav/libavcodec/msmpeg4enc.c
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- * MSMPEG4 encoder backend
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MSMPEG4 encoder backend
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/avutil.h"
-#include "libavutil/mem.h"
-#include "mpegvideo.h"
-#include "msmpeg4.h"
-#include "h263.h"
-#include "mpeg4video.h"
-#include "msmpeg4.h"
-#include "msmpeg4data.h"
-#include "put_bits.h"
-#include "rl.h"
-#include "vc1data.h"
-
-static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
-
-/* build the table which associate a (x,y) motion vector to a vlc */
-static av_cold void init_mv_table(MVTable *tab)
-{
-    int i, x, y;
-
-    tab->table_mv_index = av_malloc(sizeof(uint16_t) * 4096);
-    /* mark all entries as not used */
-    for(i=0;i<4096;i++)
-        tab->table_mv_index[i] = tab->n;
-
-    for(i=0;i<tab->n;i++) {
-        x = tab->table_mvx[i];
-        y = tab->table_mvy[i];
-        tab->table_mv_index[(x << 6) | y] = i;
-    }
-}
-
-void ff_msmpeg4_code012(PutBitContext *pb, int n)
-{
-    if (n == 0) {
-        put_bits(pb, 1, 0);
-    } else {
-        put_bits(pb, 1, 1);
-        put_bits(pb, 1, (n >= 2));
-    }
-}
-
-static int get_size_of_code(MpegEncContext * s, RLTable *rl, int last, int run, int level, int intra){
-    int size=0;
-    int code;
-    int run_diff= intra ? 0 : 1;
-
-    code = get_rl_index(rl, last, run, level);
-    size+= rl->table_vlc[code][1];
-    if (code == rl->n) {
-        int level1, run1;
-
-        level1 = level - rl->max_level[last][run];
-        if (level1 < 1)
-            goto esc2;
-        code = get_rl_index(rl, last, run, level1);
-        if (code == rl->n) {
-            esc2:
-            size++;
-            if (level > MAX_LEVEL)
-                goto esc3;
-            run1 = run - rl->max_run[last][level] - run_diff;
-            if (run1 < 0)
-                goto esc3;
-            code = get_rl_index(rl, last, run1, level);
-            if (code == rl->n) {
-            esc3:
-                /* third escape */
-                size+=1+1+6+8;
-            } else {
-                /* second escape */
-                size+= 1+1+ rl->table_vlc[code][1];
-            }
-        } else {
-            /* first escape */
-            size+= 1+1+ rl->table_vlc[code][1];
-        }
-    } else {
-        size++;
-    }
-    return size;
-}
-
-av_cold void ff_msmpeg4_encode_init(MpegEncContext *s)
-{
-    static int init_done=0;
-    int i;
-
-    ff_msmpeg4_common_init(s);
-    if(s->msmpeg4_version>=4){
-        s->min_qcoeff= -255;
-        s->max_qcoeff=  255;
-    }
-
-    if (!init_done) {
-        /* init various encoding tables */
-        init_done = 1;
-        init_mv_table(&ff_mv_tables[0]);
-        init_mv_table(&ff_mv_tables[1]);
-        for(i=0;i<NB_RL_TABLES;i++)
-            ff_init_rl(&ff_rl_table[i], ff_static_rl_table_store[i]);
-
-        for(i=0; i<NB_RL_TABLES; i++){
-            int level;
-            for (level = 1; level <= MAX_LEVEL; level++) {
-                int run;
-                for(run=0; run<=MAX_RUN; run++){
-                    int last;
-                    for(last=0; last<2; last++){
-                        rl_length[i][level][run][last]= get_size_of_code(s, &ff_rl_table[  i], last, run, level, 0);
-                    }
-                }
-            }
-        }
-    }
-}
-
-static void find_best_tables(MpegEncContext * s)
-{
-    int i;
-    int best       =-1, best_size       =9999999;
-    int chroma_best=-1, best_chroma_size=9999999;
-
-    for(i=0; i<3; i++){
-        int level;
-        int chroma_size=0;
-        int size=0;
-
-        if(i>0){// ;)
-            size++;
-            chroma_size++;
-        }
-        for(level=0; level<=MAX_LEVEL; level++){
-            int run;
-            for(run=0; run<=MAX_RUN; run++){
-                int last;
-                const int last_size= size + chroma_size;
-                for(last=0; last<2; last++){
-                    int inter_count       = s->ac_stats[0][0][level][run][last] + s->ac_stats[0][1][level][run][last];
-                    int intra_luma_count  = s->ac_stats[1][0][level][run][last];
-                    int intra_chroma_count= s->ac_stats[1][1][level][run][last];
-
-                    if(s->pict_type==AV_PICTURE_TYPE_I){
-                        size       += intra_luma_count  *rl_length[i  ][level][run][last];
-                        chroma_size+= intra_chroma_count*rl_length[i+3][level][run][last];
-                    }else{
-                        size+=        intra_luma_count  *rl_length[i  ][level][run][last]
-                                     +intra_chroma_count*rl_length[i+3][level][run][last]
-                                     +inter_count       *rl_length[i+3][level][run][last];
-                    }
-                }
-                if(last_size == size+chroma_size) break;
-            }
-        }
-        if(size<best_size){
-            best_size= size;
-            best= i;
-        }
-        if(chroma_size<best_chroma_size){
-            best_chroma_size= chroma_size;
-            chroma_best= i;
-        }
-    }
-
-    if(s->pict_type==AV_PICTURE_TYPE_P) chroma_best= best;
-
-    memset(s->ac_stats, 0, sizeof(int)*(MAX_LEVEL+1)*(MAX_RUN+1)*2*2*2);
-
-    s->rl_table_index       =        best;
-    s->rl_chroma_table_index= chroma_best;
-
-    if(s->pict_type != s->last_non_b_pict_type){
-        s->rl_table_index= 2;
-        if(s->pict_type==AV_PICTURE_TYPE_I)
-            s->rl_chroma_table_index= 1;
-        else
-            s->rl_chroma_table_index= 2;
-    }
-
-}
-
-/* write MSMPEG4 compatible frame header */
-void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
-{
-    find_best_tables(s);
-
-    avpriv_align_put_bits(&s->pb);
-    put_bits(&s->pb, 2, s->pict_type - 1);
-
-    put_bits(&s->pb, 5, s->qscale);
-    if(s->msmpeg4_version<=2){
-        s->rl_table_index = 2;
-        s->rl_chroma_table_index = 2;
-    }
-
-    s->dc_table_index = 1;
-    s->mv_table_index = 1; /* only if P frame */
-    s->use_skip_mb_code = 1; /* only if P frame */
-    s->per_mb_rl_table = 0;
-    if(s->msmpeg4_version==4)
-        s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==AV_PICTURE_TYPE_P);
-    av_dlog(s, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
-            s->inter_intra_pred, s->width, s->height);
-
-    if (s->pict_type == AV_PICTURE_TYPE_I) {
-        s->slice_height= s->mb_height/1;
-        put_bits(&s->pb, 5, 0x16 + s->mb_height/s->slice_height);
-
-        if(s->msmpeg4_version==4){
-            ff_msmpeg4_encode_ext_header(s);
-            if(s->bit_rate>MBAC_BITRATE)
-                put_bits(&s->pb, 1, s->per_mb_rl_table);
-        }
-
-        if(s->msmpeg4_version>2){
-            if(!s->per_mb_rl_table){
-                ff_msmpeg4_code012(&s->pb, s->rl_chroma_table_index);
-                ff_msmpeg4_code012(&s->pb, s->rl_table_index);
-            }
-
-            put_bits(&s->pb, 1, s->dc_table_index);
-        }
-    } else {
-        put_bits(&s->pb, 1, s->use_skip_mb_code);
-
-        if(s->msmpeg4_version==4 && s->bit_rate>MBAC_BITRATE)
-            put_bits(&s->pb, 1, s->per_mb_rl_table);
-
-        if(s->msmpeg4_version>2){
-            if(!s->per_mb_rl_table)
-                ff_msmpeg4_code012(&s->pb, s->rl_table_index);
-
-            put_bits(&s->pb, 1, s->dc_table_index);
-
-            put_bits(&s->pb, 1, s->mv_table_index);
-        }
-    }
-
-    s->esc3_level_length= 0;
-    s->esc3_run_length= 0;
-}
-
-void ff_msmpeg4_encode_ext_header(MpegEncContext * s)
-{
-        put_bits(&s->pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); //yes 29.97 -> 29
-
-        put_bits(&s->pb, 11, FFMIN(s->bit_rate/1024, 2047));
-
-        if(s->msmpeg4_version>=3)
-            put_bits(&s->pb, 1, s->flipflop_rounding);
-        else
-            assert(s->flipflop_rounding==0);
-}
-
-void ff_msmpeg4_encode_motion(MpegEncContext * s,
-                                  int mx, int my)
-{
-    int code;
-    MVTable *mv;
-
-    /* modulo encoding */
-    /* WARNING : you cannot reach all the MVs even with the modulo
-       encoding. This is a somewhat strange compromise they took !!!  */
-    if (mx <= -64)
-        mx += 64;
-    else if (mx >= 64)
-        mx -= 64;
-    if (my <= -64)
-        my += 64;
-    else if (my >= 64)
-        my -= 64;
-
-    mx += 32;
-    my += 32;
-#if 0
-    if ((unsigned)mx >= 64 ||
-        (unsigned)my >= 64)
-        av_log(s->avctx, AV_LOG_ERROR, "error mx=%d my=%d\n", mx, my);
-#endif
-    mv = &ff_mv_tables[s->mv_table_index];
-
-    code = mv->table_mv_index[(mx << 6) | my];
-    put_bits(&s->pb,
-             mv->table_mv_bits[code],
-             mv->table_mv_code[code]);
-    if (code == mv->n) {
-        /* escape : code literally */
-        put_bits(&s->pb, 6, mx);
-        put_bits(&s->pb, 6, my);
-    }
-}
-
-void ff_msmpeg4_handle_slices(MpegEncContext *s){
-    if (s->mb_x == 0) {
-        if (s->slice_height && (s->mb_y % s->slice_height) == 0) {
-            if(s->msmpeg4_version < 4){
-                ff_mpeg4_clean_buffers(s);
-            }
-            s->first_slice_line = 1;
-        } else {
-            s->first_slice_line = 0;
-        }
-    }
-}
-
-static void msmpeg4v2_encode_motion(MpegEncContext * s, int val)
-{
-    int range, bit_size, sign, code, bits;
-
-    if (val == 0) {
-        /* zero vector */
-        code = 0;
-        put_bits(&s->pb, ff_mvtab[code][1], ff_mvtab[code][0]);
-    } else {
-        bit_size = s->f_code - 1;
-        range = 1 << bit_size;
-        if (val <= -64)
-            val += 64;
-        else if (val >= 64)
-            val -= 64;
-
-        if (val >= 0) {
-            sign = 0;
-        } else {
-            val = -val;
-            sign = 1;
-        }
-        val--;
-        code = (val >> bit_size) + 1;
-        bits = val & (range - 1);
-
-        put_bits(&s->pb, ff_mvtab[code][1] + 1, (ff_mvtab[code][0] << 1) | sign);
-        if (bit_size > 0) {
-            put_bits(&s->pb, bit_size, bits);
-        }
-    }
-}
-
-void ff_msmpeg4_encode_mb(MpegEncContext * s,
-                          int16_t block[6][64],
-                          int motion_x, int motion_y)
-{
-    int cbp, coded_cbp, i;
-    int pred_x, pred_y;
-    uint8_t *coded_block;
-
-    ff_msmpeg4_handle_slices(s);
-
-    if (!s->mb_intra) {
-        /* compute cbp */
-        cbp = 0;
-        for (i = 0; i < 6; i++) {
-            if (s->block_last_index[i] >= 0)
-                cbp |= 1 << (5 - i);
-        }
-        if (s->use_skip_mb_code && (cbp | motion_x | motion_y) == 0) {
-            /* skip macroblock */
-            put_bits(&s->pb, 1, 1);
-            s->last_bits++;
-            s->misc_bits++;
-            s->skip_count++;
-
-            return;
-        }
-        if (s->use_skip_mb_code)
-            put_bits(&s->pb, 1, 0);     /* mb coded */
-
-        if(s->msmpeg4_version<=2){
-            put_bits(&s->pb,
-                     ff_v2_mb_type[cbp&3][1],
-                     ff_v2_mb_type[cbp&3][0]);
-            if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C;
-            else             coded_cbp= cbp;
-
-            put_bits(&s->pb,
-                     ff_h263_cbpy_tab[coded_cbp>>2][1],
-                     ff_h263_cbpy_tab[coded_cbp>>2][0]);
-
-            s->misc_bits += get_bits_diff(s);
-
-            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-            msmpeg4v2_encode_motion(s, motion_x - pred_x);
-            msmpeg4v2_encode_motion(s, motion_y - pred_y);
-        }else{
-            put_bits(&s->pb,
-                     ff_table_mb_non_intra[cbp + 64][1],
-                     ff_table_mb_non_intra[cbp + 64][0]);
-
-            s->misc_bits += get_bits_diff(s);
-
-            /* motion vector */
-            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-            ff_msmpeg4_encode_motion(s, motion_x - pred_x,
-                                  motion_y - pred_y);
-        }
-
-        s->mv_bits += get_bits_diff(s);
-
-        for (i = 0; i < 6; i++) {
-            ff_msmpeg4_encode_block(s, block[i], i);
-        }
-        s->p_tex_bits += get_bits_diff(s);
-    } else {
-        /* compute cbp */
-        cbp = 0;
-        coded_cbp = 0;
-        for (i = 0; i < 6; i++) {
-            int val, pred;
-            val = (s->block_last_index[i] >= 1);
-            cbp |= val << (5 - i);
-            if (i < 4) {
-                /* predict value for close blocks only for luma */
-                pred = ff_msmpeg4_coded_block_pred(s, i, &coded_block);
-                *coded_block = val;
-                val = val ^ pred;
-            }
-            coded_cbp |= val << (5 - i);
-        }
-
-        if(s->msmpeg4_version<=2){
-            if (s->pict_type == AV_PICTURE_TYPE_I) {
-                put_bits(&s->pb,
-                         ff_v2_intra_cbpc[cbp&3][1], ff_v2_intra_cbpc[cbp&3][0]);
-            } else {
-                if (s->use_skip_mb_code)
-                    put_bits(&s->pb, 1, 0);     /* mb coded */
-                put_bits(&s->pb,
-                         ff_v2_mb_type[(cbp&3) + 4][1],
-                         ff_v2_mb_type[(cbp&3) + 4][0]);
-            }
-            put_bits(&s->pb, 1, 0);             /* no AC prediction yet */
-            put_bits(&s->pb,
-                     ff_h263_cbpy_tab[cbp>>2][1],
-                     ff_h263_cbpy_tab[cbp>>2][0]);
-        }else{
-            if (s->pict_type == AV_PICTURE_TYPE_I) {
-                put_bits(&s->pb,
-                         ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
-            } else {
-                if (s->use_skip_mb_code)
-                    put_bits(&s->pb, 1, 0);     /* mb coded */
-                put_bits(&s->pb,
-                         ff_table_mb_non_intra[cbp][1],
-                         ff_table_mb_non_intra[cbp][0]);
-            }
-            put_bits(&s->pb, 1, 0);             /* no AC prediction yet */
-            if(s->inter_intra_pred){
-                s->h263_aic_dir=0;
-                put_bits(&s->pb, ff_table_inter_intra[s->h263_aic_dir][1], ff_table_inter_intra[s->h263_aic_dir][0]);
-            }
-        }
-        s->misc_bits += get_bits_diff(s);
-
-        for (i = 0; i < 6; i++) {
-            ff_msmpeg4_encode_block(s, block[i], i);
-        }
-        s->i_tex_bits += get_bits_diff(s);
-        s->i_count++;
-    }
-}
-
-static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr)
-{
-    int sign, code;
-    int pred, extquant;
-    int extrabits = 0;
-
-    int16_t *dc_val;
-    pred = ff_msmpeg4_pred_dc(s, n, &dc_val, dir_ptr);
-
-    /* update predictor */
-    if (n < 4) {
-        *dc_val = level * s->y_dc_scale;
-    } else {
-        *dc_val = level * s->c_dc_scale;
-    }
-
-    /* do the prediction */
-    level -= pred;
-
-    if(s->msmpeg4_version<=2){
-        if (n < 4) {
-            put_bits(&s->pb,
-                     ff_v2_dc_lum_table[level + 256][1],
-                     ff_v2_dc_lum_table[level + 256][0]);
-        }else{
-            put_bits(&s->pb,
-                     ff_v2_dc_chroma_table[level + 256][1],
-                     ff_v2_dc_chroma_table[level + 256][0]);
-        }
-    }else{
-        sign = 0;
-        if (level < 0) {
-            level = -level;
-            sign = 1;
-        }
-        code = level;
-        if (code > DC_MAX)
-            code = DC_MAX;
-        else if( s->msmpeg4_version>=6 ) {
-            if( s->qscale == 1 ) {
-                extquant = (level + 3) & 0x3;
-                code  = ((level+3)>>2);
-            } else if( s->qscale == 2 ) {
-                extquant = (level + 1) & 0x1;
-                code  = ((level+1)>>1);
-            }
-        }
-
-        if (s->dc_table_index == 0) {
-            if (n < 4) {
-                put_bits(&s->pb, ff_table0_dc_lum[code][1], ff_table0_dc_lum[code][0]);
-            } else {
-                put_bits(&s->pb, ff_table0_dc_chroma[code][1], ff_table0_dc_chroma[code][0]);
-            }
-        } else {
-            if (n < 4) {
-                put_bits(&s->pb, ff_table1_dc_lum[code][1], ff_table1_dc_lum[code][0]);
-            } else {
-                put_bits(&s->pb, ff_table1_dc_chroma[code][1], ff_table1_dc_chroma[code][0]);
-            }
-        }
-
-        if(s->msmpeg4_version>=6 && s->qscale<=2)
-            extrabits = 3 - s->qscale;
-
-        if (code == DC_MAX)
-            put_bits(&s->pb, 8 + extrabits, level);
-        else if(extrabits > 0)//== VC1 && s->qscale<=2
-            put_bits(&s->pb, extrabits, extquant);
-
-        if (level != 0) {
-            put_bits(&s->pb, 1, sign);
-        }
-    }
-}
-
-/* Encoding of a block. Very similar to MPEG4 except for a different
-   escape coding (same as H263) and more vlc tables.
- */
-void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n)
-{
-    int level, run, last, i, j, last_index;
-    int last_non_zero, sign, slevel;
-    int code, run_diff, dc_pred_dir;
-    const RLTable *rl;
-    const uint8_t *scantable;
-
-    if (s->mb_intra) {
-        msmpeg4_encode_dc(s, block[0], n, &dc_pred_dir);
-        i = 1;
-        if (n < 4) {
-            rl = &ff_rl_table[s->rl_table_index];
-        } else {
-            rl = &ff_rl_table[3 + s->rl_chroma_table_index];
-        }
-        run_diff = s->msmpeg4_version>=4;
-        scantable= s->intra_scantable.permutated;
-    } else {
-        i = 0;
-        rl = &ff_rl_table[3 + s->rl_table_index];
-        if(s->msmpeg4_version<=2)
-            run_diff = 0;
-        else
-            run_diff = 1;
-        scantable= s->inter_scantable.permutated;
-    }
-
-    /* recalculate block_last_index for M$ wmv1 */
-    if(s->msmpeg4_version>=4 && s->msmpeg4_version<6 && s->block_last_index[n]>0){
-        for(last_index=63; last_index>=0; last_index--){
-            if(block[scantable[last_index]]) break;
-        }
-        s->block_last_index[n]= last_index;
-    }else
-        last_index = s->block_last_index[n];
-    /* AC coefs */
-    last_non_zero = i - 1;
-    for (; i <= last_index; i++) {
-        j = scantable[i];
-        level = block[j];
-        if (level) {
-            run = i - last_non_zero - 1;
-            last = (i == last_index);
-            sign = 0;
-            slevel = level;
-            if (level < 0) {
-                sign = 1;
-                level = -level;
-            }
-
-            if(level<=MAX_LEVEL && run<=MAX_RUN){
-                s->ac_stats[s->mb_intra][n>3][level][run][last]++;
-            }
-
-            s->ac_stats[s->mb_intra][n > 3][40][63][0]++; //esc3 like
-
-            code = get_rl_index(rl, last, run, level);
-            put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
-            if (code == rl->n) {
-                int level1, run1;
-
-                level1 = level - rl->max_level[last][run];
-                if (level1 < 1)
-                    goto esc2;
-                code = get_rl_index(rl, last, run, level1);
-                if (code == rl->n) {
-                esc2:
-                    put_bits(&s->pb, 1, 0);
-                    if (level > MAX_LEVEL)
-                        goto esc3;
-                    run1 = run - rl->max_run[last][level] - run_diff;
-                    if (run1 < 0)
-                        goto esc3;
-                    code = get_rl_index(rl, last, run1+1, level);
-                    if (s->msmpeg4_version == 4 && code == rl->n)
-                        goto esc3;
-                    code = get_rl_index(rl, last, run1, level);
-                    if (code == rl->n) {
-                    esc3:
-                        /* third escape */
-                        put_bits(&s->pb, 1, 0);
-                        put_bits(&s->pb, 1, last);
-                        if(s->msmpeg4_version>=4){
-                            if(s->esc3_level_length==0){
-                                s->esc3_level_length=8;
-                                s->esc3_run_length= 6;
-                                //ESCLVLSZ + ESCRUNSZ
-                                if(s->qscale<8)
-                                    put_bits(&s->pb, 6 + (s->msmpeg4_version>=6), 3);
-                                else
-                                    put_bits(&s->pb, 8, 3);
-                            }
-                            put_bits(&s->pb, s->esc3_run_length, run);
-                            put_bits(&s->pb, 1, sign);
-                            put_bits(&s->pb, s->esc3_level_length, level);
-                        }else{
-                            put_bits(&s->pb, 6, run);
-                            put_sbits(&s->pb, 8, slevel);
-                        }
-                    } else {
-                        /* second escape */
-                        put_bits(&s->pb, 1, 1);
-                        put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
-                        put_bits(&s->pb, 1, sign);
-                    }
-                } else {
-                    /* first escape */
-                    put_bits(&s->pb, 1, 1);
-                    put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
-                    put_bits(&s->pb, 1, sign);
-                }
-            } else {
-                put_bits(&s->pb, 1, sign);
-            }
-            last_non_zero = i;
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/msrle.c b/deps/libav/libavcodec/msrle.c
deleted file mode 100644
index 4b39c92..0000000
--- a/deps/libav/libavcodec/msrle.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Microsoft RLE video decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MS RLE video decoder by Mike Melanson (melanson at pcisys.net)
- * For more information about the MS RLE format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *
- * The MS RLE decoder outputs PAL8 colorspace data.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "msrledec.h"
-
-typedef struct MsrleContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    GetByteContext gb;
-    const unsigned char *buf;
-    int size;
-
-    uint32_t pal[256];
-} MsrleContext;
-
-static av_cold int msrle_decode_init(AVCodecContext *avctx)
-{
-    MsrleContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    switch (avctx->bits_per_coded_sample) {
-    case 4:
-    case 8:
-        avctx->pix_fmt = AV_PIX_FMT_PAL8;
-        break;
-    case 24:
-        avctx->pix_fmt = AV_PIX_FMT_BGR24;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "unsupported bits per sample\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int msrle_decode_frame(AVCodecContext *avctx,
-                              void *data, int *got_frame,
-                              AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MsrleContext *s = avctx->priv_data;
-    int istride = FFALIGN(avctx->width*avctx->bits_per_coded_sample, 32) / 8;
-    int ret;
-
-    s->buf = buf;
-    s->size = buf_size;
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    if (avctx->bits_per_coded_sample <= 8) {
-        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-
-        if (pal) {
-            s->frame->palette_has_changed = 1;
-            memcpy(s->pal, pal, AVPALETTE_SIZE);
-        }
-
-        /* make the palette available */
-        memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
-    }
-
-    /* FIXME how to correctly detect RLE ??? */
-    if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
-        int linesize = avctx->width * avctx->bits_per_coded_sample / 8;
-        uint8_t *ptr = s->frame->data[0];
-        uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
-        int i, j;
-
-        for (i = 0; i < avctx->height; i++) {
-            if (avctx->bits_per_coded_sample == 4) {
-                for (j = 0; j < avctx->width - 1; j += 2) {
-                    ptr[j+0] = buf[j>>1] >> 4;
-                    ptr[j+1] = buf[j>>1] & 0xF;
-                }
-                if (avctx->width & 1)
-                    ptr[j+0] = buf[j>>1] >> 4;
-            } else {
-                memcpy(ptr, buf, linesize);
-            }
-            buf -= istride;
-            ptr += s->frame->linesize[0];
-        }
-    } else {
-        bytestream2_init(&s->gb, buf, buf_size);
-        ff_msrle_decode(avctx, (AVPicture*)s->frame, avctx->bits_per_coded_sample, &s->gb);
-    }
-
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    *got_frame      = 1;
-
-    /* report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int msrle_decode_end(AVCodecContext *avctx)
-{
-    MsrleContext *s = avctx->priv_data;
-
-    /* release the last frame */
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_msrle_decoder = {
-    .name           = "msrle",
-    .long_name      = NULL_IF_CONFIG_SMALL("Microsoft RLE"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSRLE,
-    .priv_data_size = sizeof(MsrleContext),
-    .init           = msrle_decode_init,
-    .close          = msrle_decode_end,
-    .decode         = msrle_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/msrledec.c b/deps/libav/libavcodec/msrledec.c
deleted file mode 100644
index af2a247..0000000
--- a/deps/libav/libavcodec/msrledec.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Microsoft RLE decoder
- * Copyright (C) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MS RLE decoder based on decoder by Mike Melanson and my own for TSCC
- * For more information about the MS RLE format, visit:
- *   http://www.multimedia.cx/msrle.txt
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "msrledec.h"
-
-static int msrle_decode_pal4(AVCodecContext *avctx, AVPicture *pic,
-                             GetByteContext *gb)
-{
-    unsigned char rle_code;
-    unsigned char extra_byte, odd_pixel;
-    unsigned char stream_byte;
-    unsigned int pixel_ptr = 0;
-    int row_dec = pic->linesize[0];
-    int row_ptr = (avctx->height - 1) * row_dec;
-    int frame_size = row_dec * avctx->height;
-    int i;
-
-    while (row_ptr >= 0) {
-        if (bytestream2_get_bytes_left(gb) <= 0) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "MS RLE: bytestream overrun, %d rows left\n",
-                   row_ptr);
-            return AVERROR_INVALIDDATA;
-        }
-        rle_code = stream_byte = bytestream2_get_byteu(gb);
-        if (rle_code == 0) {
-            /* fetch the next byte to see how to handle escape code */
-            stream_byte = bytestream2_get_byte(gb);
-            if (stream_byte == 0) {
-                /* line is done, goto the next one */
-                row_ptr -= row_dec;
-                pixel_ptr = 0;
-            } else if (stream_byte == 1) {
-                /* decode is done */
-                return 0;
-            } else if (stream_byte == 2) {
-                /* reposition frame decode coordinates */
-                stream_byte = bytestream2_get_byte(gb);
-                pixel_ptr += stream_byte;
-                stream_byte = bytestream2_get_byte(gb);
-                row_ptr -= stream_byte * row_dec;
-            } else {
-                // copy pixels from encoded stream
-                odd_pixel =  stream_byte & 1;
-                rle_code = (stream_byte + 1) / 2;
-                extra_byte = rle_code & 0x01;
-                if (row_ptr + pixel_ptr + stream_byte > frame_size ||
-                    bytestream2_get_bytes_left(gb) < rle_code) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "MS RLE: frame/stream ptr just went out of bounds (copy)\n");
-                    return AVERROR_INVALIDDATA;
-                }
-
-                for (i = 0; i < rle_code; i++) {
-                    if (pixel_ptr >= avctx->width)
-                        break;
-                    stream_byte = bytestream2_get_byteu(gb);
-                    pic->data[0][row_ptr + pixel_ptr] = stream_byte >> 4;
-                    pixel_ptr++;
-                    if (i + 1 == rle_code && odd_pixel)
-                        break;
-                    if (pixel_ptr >= avctx->width)
-                        break;
-                    pic->data[0][row_ptr + pixel_ptr] = stream_byte & 0x0F;
-                    pixel_ptr++;
-                }
-
-                // if the RLE code is odd, skip a byte in the stream
-                if (extra_byte)
-                    bytestream2_skip(gb, 1);
-            }
-        } else {
-            // decode a run of data
-            if (row_ptr + pixel_ptr + stream_byte > frame_size) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "MS RLE: frame ptr just went out of bounds (run)\n");
-                return AVERROR_INVALIDDATA;
-            }
-            stream_byte = bytestream2_get_byte(gb);
-            for (i = 0; i < rle_code; i++) {
-                if (pixel_ptr >= avctx->width)
-                    break;
-                if ((i & 1) == 0)
-                    pic->data[0][row_ptr + pixel_ptr] = stream_byte >> 4;
-                else
-                    pic->data[0][row_ptr + pixel_ptr] = stream_byte & 0x0F;
-                pixel_ptr++;
-            }
-        }
-    }
-
-    /* one last sanity check on the way out */
-    if (bytestream2_get_bytes_left(gb)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "MS RLE: ended frame decode with %d bytes left over\n",
-               bytestream2_get_bytes_left(gb));
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-
-static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
-                                   int depth, GetByteContext *gb)
-{
-    uint8_t *output, *output_end;
-    int p1, p2, line=avctx->height - 1, pos=0, i;
-    uint16_t pix16;
-    uint32_t pix32;
-    unsigned int width= FFABS(pic->linesize[0]) / (depth >> 3);
-
-    output     = pic->data[0] + (avctx->height - 1) * pic->linesize[0];
-    output_end = pic->data[0] +  avctx->height      * pic->linesize[0];
-    while (bytestream2_get_bytes_left(gb) > 0) {
-        p1 = bytestream2_get_byteu(gb);
-        if(p1 == 0) { //Escape code
-            p2 = bytestream2_get_byte(gb);
-            if(p2 == 0) { //End-of-line
-                if (--line < 0) {
-                    if (bytestream2_get_be16(gb) == 1) { // end-of-picture
-                        return 0;
-                    } else {
-                        av_log(avctx, AV_LOG_ERROR,
-                               "Next line is beyond picture bounds (%d bytes left)\n",
-                               bytestream2_get_bytes_left(gb));
-                        return AVERROR_INVALIDDATA;
-                    }
-                }
-                output = pic->data[0] + line * pic->linesize[0];
-                pos = 0;
-                continue;
-            } else if(p2 == 1) { //End-of-picture
-                return 0;
-            } else if(p2 == 2) { //Skip
-                p1 = bytestream2_get_byte(gb);
-                p2 = bytestream2_get_byte(gb);
-                line -= p2;
-                pos += p1;
-                if (line < 0 || pos >= width){
-                    av_log(avctx, AV_LOG_ERROR, "Skip beyond picture bounds\n");
-                    return -1;
-                }
-                output = pic->data[0] + line * pic->linesize[0] + pos * (depth >> 3);
-                continue;
-            }
-            // Copy data
-            if ((pic->linesize[0] > 0 && output + p2 * (depth >> 3) > output_end) ||
-                (pic->linesize[0] < 0 && output + p2 * (depth >> 3) < output_end)) {
-                bytestream2_skip(gb, 2 * (depth >> 3));
-                continue;
-            } else if (bytestream2_get_bytes_left(gb) < p2 * (depth >> 3)) {
-                av_log(avctx, AV_LOG_ERROR, "bytestream overrun\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            if ((depth == 8) || (depth == 24)) {
-                for(i = 0; i < p2 * (depth >> 3); i++) {
-                    *output++ = bytestream2_get_byteu(gb);
-                }
-                // RLE8 copy is actually padded - and runs are not!
-                if(depth == 8 && (p2 & 1)) {
-                    bytestream2_skip(gb, 1);
-                }
-            } else if (depth == 16) {
-                for(i = 0; i < p2; i++) {
-                    *(uint16_t*)output = bytestream2_get_le16u(gb);
-                    output += 2;
-                }
-            } else if (depth == 32) {
-                for(i = 0; i < p2; i++) {
-                    *(uint32_t*)output = bytestream2_get_le32u(gb);
-                    output += 4;
-                }
-            }
-            pos += p2;
-        } else { //run of pixels
-            uint8_t pix[3]; //original pixel
-            switch(depth){
-            case  8: pix[0] = bytestream2_get_byte(gb);
-                     break;
-            case 16: pix16  = bytestream2_get_le16(gb);
-                     break;
-            case 24: pix[0] = bytestream2_get_byte(gb);
-                     pix[1] = bytestream2_get_byte(gb);
-                     pix[2] = bytestream2_get_byte(gb);
-                     break;
-            case 32: pix32  = bytestream2_get_le32(gb);
-                     break;
-            }
-            if ((pic->linesize[0] > 0 && output + p1 * (depth >> 3) > output_end) ||
-                (pic->linesize[0] < 0 && output + p1 * (depth >> 3) < output_end))
-                continue;
-            for(i = 0; i < p1; i++) {
-                switch(depth){
-                case  8: *output++ = pix[0];
-                         break;
-                case 16: *(uint16_t*)output = pix16;
-                         output += 2;
-                         break;
-                case 24: *output++ = pix[0];
-                         *output++ = pix[1];
-                         *output++ = pix[2];
-                         break;
-                case 32: *(uint32_t*)output = pix32;
-                         output += 4;
-                         break;
-                }
-            }
-            pos += p1;
-        }
-    }
-
-    av_log(avctx, AV_LOG_WARNING, "MS RLE warning: no end-of-picture code\n");
-    return 0;
-}
-
-
-int ff_msrle_decode(AVCodecContext *avctx, AVPicture *pic,
-                    int depth, GetByteContext *gb)
-{
-    switch(depth){
-    case  4:
-        return msrle_decode_pal4(avctx, pic, gb);
-    case  8:
-    case 16:
-    case 24:
-    case 32:
-        return msrle_decode_8_16_24_32(avctx, pic, depth, gb);
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown depth %d\n", depth);
-        return -1;
-    }
-}
diff --git a/deps/libav/libavcodec/msrledec.h b/deps/libav/libavcodec/msrledec.h
deleted file mode 100644
index a594de3..0000000
--- a/deps/libav/libavcodec/msrledec.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Microsoft RLE decoder
- * Copyright (C) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MSRLEDEC_H
-#define AVCODEC_MSRLEDEC_H
-
-#include "avcodec.h"
-#include "bytestream.h"
-
-/**
- * Decode stream in MS RLE format into frame.
- *
- * @param avctx     codec context
- * @param pic       destination frame
- * @param depth     bit depth
- * @param gb        input bytestream context
- */
-int ff_msrle_decode(AVCodecContext *avctx, AVPicture *pic,
-                    int depth, GetByteContext *gb);
-
-#endif /* AVCODEC_MSRLEDEC_H */
diff --git a/deps/libav/libavcodec/mss1.c b/deps/libav/libavcodec/mss1.c
deleted file mode 100644
index a67a942..0000000
--- a/deps/libav/libavcodec/mss1.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Microsoft Screen 1 (aka Windows Media Video V7 Screen) decoder
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Microsoft Screen 1 (aka Windows Media Video V7 Screen) decoder
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "mss12.h"
-
-typedef struct MSS1Context {
-    MSS12Context   ctx;
-    AVFrame       *pic;
-    SliceContext   sc;
-} MSS1Context;
-
-static void arith_normalise(ArithCoder *c)
-{
-    for (;;) {
-        if (c->high >= 0x8000) {
-            if (c->low < 0x8000) {
-                if (c->low >= 0x4000 && c->high < 0xC000) {
-                    c->value -= 0x4000;
-                    c->low   -= 0x4000;
-                    c->high  -= 0x4000;
-                } else {
-                    return;
-                }
-            } else {
-                c->value -= 0x8000;
-                c->low   -= 0x8000;
-                c->high  -= 0x8000;
-            }
-        }
-        c->value <<= 1;
-        c->low   <<= 1;
-        c->high  <<= 1;
-        c->high   |= 1;
-        c->value  |= get_bits1(c->gbc.gb);
-    }
-}
-
-ARITH_GET_BIT()
-
-static int arith_get_bits(ArithCoder *c, int bits)
-{
-    int range = c->high - c->low + 1;
-    int val   = (((c->value - c->low + 1) << bits) - 1) / range;
-    int prob  = range * val;
-
-    c->high   = ((prob + range) >> bits) + c->low - 1;
-    c->low   += prob >> bits;
-
-    arith_normalise(c);
-
-    return val;
-}
-
-static int arith_get_number(ArithCoder *c, int mod_val)
-{
-    int range = c->high - c->low + 1;
-    int val   = ((c->value - c->low + 1) * mod_val - 1) / range;
-    int prob  = range * val;
-
-    c->high   = (prob + range) / mod_val + c->low - 1;
-    c->low   += prob / mod_val;
-
-    arith_normalise(c);
-
-    return val;
-}
-
-static int arith_get_prob(ArithCoder *c, int16_t *probs)
-{
-    int range = c->high - c->low + 1;
-    int val   = ((c->value - c->low + 1) * probs[0] - 1) / range;
-    int sym   = 1;
-
-    while (probs[sym] > val)
-        sym++;
-
-    c->high = range * probs[sym - 1] / probs[0] + c->low - 1;
-    c->low += range * probs[sym]     / probs[0];
-
-    return sym;
-}
-
-ARITH_GET_MODEL_SYM()
-
-static void arith_init(ArithCoder *c, GetBitContext *gb)
-{
-    c->low           = 0;
-    c->high          = 0xFFFF;
-    c->value         = get_bits(gb, 16);
-    c->gbc.gb        = gb;
-    c->get_model_sym = arith_get_model_sym;
-    c->get_number    = arith_get_number;
-}
-
-static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)
-{
-    int i, ncol, r, g, b;
-    uint32_t *pal = ctx->pal + 256 - ctx->free_colours;
-
-    if (!ctx->free_colours)
-        return 0;
-
-    ncol = arith_get_number(acoder, ctx->free_colours + 1);
-    for (i = 0; i < ncol; i++) {
-        r = arith_get_bits(acoder, 8);
-        g = arith_get_bits(acoder, 8);
-        b = arith_get_bits(acoder, 8);
-        *pal++ = (r << 16) | (g << 8) | b;
-    }
-
-    return !!ncol;
-}
-
-static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MSS1Context *ctx = avctx->priv_data;
-    MSS12Context *c = &ctx->ctx;
-    GetBitContext gb;
-    ArithCoder acoder;
-    int pal_changed = 0;
-    int ret;
-
-    init_get_bits(&gb, buf, buf_size * 8);
-    arith_init(&acoder, &gb);
-
-    if ((ret = ff_reget_buffer(avctx, ctx->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    c->pal_pic    =  ctx->pic->data[0] + ctx->pic->linesize[0] * (avctx->height - 1);
-    c->pal_stride = -ctx->pic->linesize[0];
-    c->keyframe   = !arith_get_bit(&acoder);
-    if (c->keyframe) {
-        c->corrupted = 0;
-        ff_mss12_slicecontext_reset(&ctx->sc);
-        pal_changed        = decode_pal(c, &acoder);
-        ctx->pic->key_frame = 1;
-        ctx->pic->pict_type = AV_PICTURE_TYPE_I;
-    } else {
-        if (c->corrupted)
-            return AVERROR_INVALIDDATA;
-        ctx->pic->key_frame = 0;
-        ctx->pic->pict_type = AV_PICTURE_TYPE_P;
-    }
-    c->corrupted = ff_mss12_decode_rect(&ctx->sc, &acoder, 0, 0,
-                                        avctx->width, avctx->height);
-    if (c->corrupted)
-        return AVERROR_INVALIDDATA;
-    memcpy(ctx->pic->data[1], c->pal, AVPALETTE_SIZE);
-    ctx->pic->palette_has_changed = pal_changed;
-
-    if ((ret = av_frame_ref(data, ctx->pic)) < 0)
-        return ret;
-
-    *got_frame      = 1;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int mss1_decode_init(AVCodecContext *avctx)
-{
-    MSS1Context * const c = avctx->priv_data;
-    int ret;
-
-    c->ctx.avctx       = avctx;
-
-    c->pic = av_frame_alloc();
-    if (!c->pic)
-        return AVERROR(ENOMEM);
-
-    ret = ff_mss12_decode_init(&c->ctx, 0, &c->sc, NULL);
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    return ret;
-}
-
-static av_cold int mss1_decode_end(AVCodecContext *avctx)
-{
-    MSS1Context * const ctx = avctx->priv_data;
-
-    av_frame_free(&ctx->pic);
-    ff_mss12_decode_end(&ctx->ctx);
-
-    return 0;
-}
-
-AVCodec ff_mss1_decoder = {
-    .name           = "mss1",
-    .long_name      = NULL_IF_CONFIG_SMALL("MS Screen 1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSS1,
-    .priv_data_size = sizeof(MSS1Context),
-    .init           = mss1_decode_init,
-    .close          = mss1_decode_end,
-    .decode         = mss1_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/mss12.c b/deps/libav/libavcodec/mss12.c
deleted file mode 100644
index 3601978..0000000
--- a/deps/libav/libavcodec/mss12.c
+++ /dev/null
@@ -1,674 +0,0 @@
-/*
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Common functions for Microsoft Screen 1 and 2
- */
-
-#include "libavutil/intfloat.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "mss12.h"
-
-enum SplitMode {
-    SPLIT_VERT = 0,
-    SPLIT_HOR,
-    SPLIT_NONE
-};
-
-static const int sec_order_sizes[4] = { 1, 7, 6, 1 };
-
-enum ContextDirection {
-    TOP_LEFT = 0,
-    TOP,
-    TOP_RIGHT,
-    LEFT
-};
-
-static int model_calc_threshold(Model *m)
-{
-    int thr;
-
-    thr = 2 * m->weights[m->num_syms] - 1;
-    thr = ((thr >> 1) + 4 * m->cum_prob[0]) / thr;
-
-    return FFMIN(thr, 0x3FFF);
-}
-
-static void model_reset(Model *m)
-{
-    int i;
-
-    for (i = 0; i <= m->num_syms; i++) {
-        m->weights[i]  = 1;
-        m->cum_prob[i] = m->num_syms - i;
-    }
-    m->weights[0] = 0;
-    for (i = 0; i < m->num_syms; i++)
-        m->idx2sym[i + 1] = i;
-}
-
-static av_cold void model_init(Model *m, int num_syms, int thr_weight)
-{
-    m->num_syms   = num_syms;
-    m->thr_weight = thr_weight;
-    m->threshold  = num_syms * thr_weight;
-}
-
-static void model_rescale_weights(Model *m)
-{
-    int i;
-    int cum_prob;
-
-    if (m->thr_weight == THRESH_ADAPTIVE)
-        m->threshold = model_calc_threshold(m);
-    while (m->cum_prob[0] > m->threshold) {
-        cum_prob = 0;
-        for (i = m->num_syms; i >= 0; i--) {
-            m->cum_prob[i] = cum_prob;
-            m->weights[i]  = (m->weights[i] + 1) >> 1;
-            cum_prob      += m->weights[i];
-        }
-    }
-}
-
-void ff_mss12_model_update(Model *m, int val)
-{
-    int i;
-
-    if (m->weights[val] == m->weights[val - 1]) {
-        for (i = val; m->weights[i - 1] == m->weights[val]; i--);
-        if (i != val) {
-            int sym1, sym2;
-
-            sym1 = m->idx2sym[val];
-            sym2 = m->idx2sym[i];
-
-            m->idx2sym[val]  = sym2;
-            m->idx2sym[i]    = sym1;
-
-            val = i;
-        }
-    }
-    m->weights[val]++;
-    for (i = val - 1; i >= 0; i--)
-        m->cum_prob[i]++;
-    model_rescale_weights(m);
-}
-
-static void pixctx_reset(PixContext *ctx)
-{
-    int i, j;
-
-    if (!ctx->special_initial_cache)
-        for (i = 0; i < ctx->cache_size; i++)
-            ctx->cache[i] = i;
-    else {
-        ctx->cache[0] = 1;
-        ctx->cache[1] = 2;
-        ctx->cache[2] = 4;
-    }
-
-    model_reset(&ctx->cache_model);
-    model_reset(&ctx->full_model);
-
-    for (i = 0; i < 15; i++)
-        for (j = 0; j < 4; j++)
-            model_reset(&ctx->sec_models[i][j]);
-}
-
-static av_cold void pixctx_init(PixContext *ctx, int cache_size,
-                                int full_model_syms, int special_initial_cache)
-{
-    int i, j, k, idx;
-
-    ctx->cache_size            = cache_size + 4;
-    ctx->num_syms              = cache_size;
-    ctx->special_initial_cache = special_initial_cache;
-
-    model_init(&ctx->cache_model, ctx->num_syms + 1, THRESH_LOW);
-    model_init(&ctx->full_model, full_model_syms, THRESH_HIGH);
-
-    for (i = 0, idx = 0; i < 4; i++)
-        for (j = 0; j < sec_order_sizes[i]; j++, idx++)
-            for (k = 0; k < 4; k++)
-                model_init(&ctx->sec_models[idx][k], 2 + i,
-                           i ? THRESH_LOW : THRESH_ADAPTIVE);
-}
-
-static av_always_inline int decode_pixel(ArithCoder *acoder, PixContext *pctx,
-                                         uint8_t *ngb, int num_ngb, int any_ngb)
-{
-    int i, val, pix;
-
-    val = acoder->get_model_sym(acoder, &pctx->cache_model);
-    if (val < pctx->num_syms) {
-        if (any_ngb) {
-            int idx, j;
-
-            idx = 0;
-            for (i = 0; i < pctx->cache_size; i++) {
-                for (j = 0; j < num_ngb; j++)
-                    if (pctx->cache[i] == ngb[j])
-                        break;
-                if (j == num_ngb) {
-                    if (idx == val)
-                        break;
-                    idx++;
-                }
-            }
-            val = FFMIN(i, pctx->cache_size - 1);
-        }
-        pix = pctx->cache[val];
-    } else {
-        pix = acoder->get_model_sym(acoder, &pctx->full_model);
-        for (i = 0; i < pctx->cache_size - 1; i++)
-            if (pctx->cache[i] == pix)
-                break;
-        val = i;
-    }
-    if (val) {
-        for (i = val; i > 0; i--)
-            pctx->cache[i] = pctx->cache[i - 1];
-        pctx->cache[0] = pix;
-    }
-
-    return pix;
-}
-
-static int decode_pixel_in_context(ArithCoder *acoder, PixContext *pctx,
-                                   uint8_t *src, int stride, int x, int y,
-                                   int has_right)
-{
-    uint8_t neighbours[4];
-    uint8_t ref_pix[4];
-    int nlen;
-    int layer = 0, sub;
-    int pix;
-    int i, j;
-
-    if (!y) {
-        memset(neighbours, src[-1], 4);
-    } else {
-        neighbours[TOP] = src[-stride];
-        if (!x) {
-            neighbours[TOP_LEFT] = neighbours[LEFT] = neighbours[TOP];
-        } else {
-            neighbours[TOP_LEFT] = src[-stride - 1];
-            neighbours[    LEFT] = src[-1];
-        }
-        if (has_right)
-            neighbours[TOP_RIGHT] = src[-stride + 1];
-        else
-            neighbours[TOP_RIGHT] = neighbours[TOP];
-    }
-
-    sub = 0;
-    if (x >= 2 && src[-2] == neighbours[LEFT])
-        sub  = 1;
-    if (y >= 2 && src[-2 * stride] == neighbours[TOP])
-        sub |= 2;
-
-    nlen = 1;
-    ref_pix[0] = neighbours[0];
-    for (i = 1; i < 4; i++) {
-        for (j = 0; j < nlen; j++)
-            if (ref_pix[j] == neighbours[i])
-                break;
-        if (j == nlen)
-            ref_pix[nlen++] = neighbours[i];
-    }
-
-    switch (nlen) {
-    case 1:
-        layer = 0;
-        break;
-    case 2:
-        if (neighbours[TOP] == neighbours[TOP_LEFT]) {
-            if (neighbours[TOP_RIGHT] == neighbours[TOP_LEFT])
-                layer = 1;
-            else if (neighbours[LEFT] == neighbours[TOP_LEFT])
-                layer = 2;
-            else
-                layer = 3;
-        } else if (neighbours[TOP_RIGHT] == neighbours[TOP_LEFT]) {
-            if (neighbours[LEFT] == neighbours[TOP_LEFT])
-                layer = 4;
-            else
-                layer = 5;
-        } else if (neighbours[LEFT] == neighbours[TOP_LEFT]) {
-            layer = 6;
-        } else {
-            layer = 7;
-        }
-        break;
-    case 3:
-        if (neighbours[TOP] == neighbours[TOP_LEFT])
-            layer = 8;
-        else if (neighbours[TOP_RIGHT] == neighbours[TOP_LEFT])
-            layer = 9;
-        else if (neighbours[LEFT] == neighbours[TOP_LEFT])
-            layer = 10;
-        else if (neighbours[TOP_RIGHT] == neighbours[TOP])
-            layer = 11;
-        else if (neighbours[TOP] == neighbours[LEFT])
-            layer = 12;
-        else
-            layer = 13;
-        break;
-    case 4:
-        layer = 14;
-        break;
-    }
-
-    pix = acoder->get_model_sym(acoder,
-                                &pctx->sec_models[layer][sub]);
-    if (pix < nlen)
-        return ref_pix[pix];
-    else
-        return decode_pixel(acoder, pctx, ref_pix, nlen, 1);
-}
-
-static int decode_region(ArithCoder *acoder, uint8_t *dst, uint8_t *rgb_pic,
-                         int x, int y, int width, int height, int stride,
-                         int rgb_stride, PixContext *pctx, const uint32_t *pal)
-{
-    int i, j, p;
-    uint8_t *rgb_dst = rgb_pic + x * 3 + y * rgb_stride;
-
-    dst += x + y * stride;
-
-    for (j = 0; j < height; j++) {
-        for (i = 0; i < width; i++) {
-            if (!i && !j)
-                p = decode_pixel(acoder, pctx, NULL, 0, 0);
-            else
-                p = decode_pixel_in_context(acoder, pctx, dst + i, stride,
-                                            i, j, width - i - 1);
-            dst[i] = p;
-
-            if (rgb_pic)
-                AV_WB24(rgb_dst + i * 3, pal[p]);
-        }
-        dst     += stride;
-        rgb_dst += rgb_stride;
-    }
-
-    return 0;
-}
-
-static void copy_rectangles(MSS12Context const *c,
-                            int x, int y, int width, int height)
-{
-    int j;
-
-    if (c->last_rgb_pic)
-        for (j = y; j < y + height; j++) {
-            memcpy(c->rgb_pic      + j * c->rgb_stride + x * 3,
-                   c->last_rgb_pic + j * c->rgb_stride + x * 3,
-                   width * 3);
-            memcpy(c->pal_pic      + j * c->pal_stride + x,
-                   c->last_pal_pic + j * c->pal_stride + x,
-                   width);
-        }
-}
-
-static int motion_compensation(MSS12Context const *c,
-                               int x, int y, int width, int height)
-{
-    if (x + c->mvX < 0 || x + c->mvX + width  > c->avctx->width  ||
-        y + c->mvY < 0 || y + c->mvY + height > c->avctx->height ||
-        !c->rgb_pic)
-        return -1;
-    else {
-        uint8_t *dst     = c->pal_pic + x     + y * c->pal_stride;
-        uint8_t *rgb_dst = c->rgb_pic + x * 3 + y * c->rgb_stride;
-        uint8_t *src;
-        uint8_t *rgb_src;
-        int j;
-        x += c->mvX;
-        y += c->mvY;
-        if (c->last_rgb_pic) {
-            src     = c->last_pal_pic + x +     y * c->pal_stride;
-            rgb_src = c->last_rgb_pic + x * 3 + y * c->rgb_stride;
-        } else {
-            src     = c->pal_pic + x     + y * c->pal_stride;
-            rgb_src = c->rgb_pic + x * 3 + y * c->rgb_stride;
-        }
-        for (j = 0; j < height; j++) {
-            memmove(dst, src, width);
-            memmove(rgb_dst, rgb_src, width * 3);
-            dst     += c->pal_stride;
-            src     += c->pal_stride;
-            rgb_dst += c->rgb_stride;
-            rgb_src += c->rgb_stride;
-        }
-    }
-    return 0;
-}
-
-static int decode_region_masked(MSS12Context const *c, ArithCoder *acoder,
-                                uint8_t *dst, int stride, uint8_t *mask,
-                                int mask_stride, int x, int y,
-                                int width, int height,
-                                PixContext *pctx)
-{
-    int i, j, p;
-    uint8_t *rgb_dst = c->rgb_pic + x * 3 + y * c->rgb_stride;
-
-    dst  += x + y * stride;
-    mask += x + y * mask_stride;
-
-    for (j = 0; j < height; j++) {
-        for (i = 0; i < width; i++) {
-            if (c->avctx->err_recognition & AV_EF_EXPLODE &&
-                ( c->rgb_pic && mask[i] != 0x01 && mask[i] != 0x02 && mask[i] != 0x04 ||
-                 !c->rgb_pic && mask[i] != 0x80 && mask[i] != 0xFF))
-                return -1;
-
-            if (mask[i] == 0x02) {
-                copy_rectangles(c, x + i, y + j, 1, 1);
-            } else if (mask[i] == 0x04) {
-                if (motion_compensation(c, x + i, y + j, 1, 1))
-                    return -1;
-            } else if (mask[i] != 0x80) {
-                if (!i && !j)
-                    p = decode_pixel(acoder, pctx, NULL, 0, 0);
-                else
-                    p = decode_pixel_in_context(acoder, pctx, dst + i, stride,
-                                                i, j, width - i - 1);
-                dst[i] = p;
-                if (c->rgb_pic)
-                    AV_WB24(rgb_dst + i * 3, c->pal[p]);
-            }
-        }
-        dst     += stride;
-        mask    += mask_stride;
-        rgb_dst += c->rgb_stride;
-    }
-
-    return 0;
-}
-
-static av_cold void slicecontext_init(SliceContext *sc,
-                                      int version, int full_model_syms)
-{
-    model_init(&sc->intra_region, 2, THRESH_ADAPTIVE);
-    model_init(&sc->inter_region, 2, THRESH_ADAPTIVE);
-    model_init(&sc->split_mode,   3, THRESH_HIGH);
-    model_init(&sc->edge_mode,    2, THRESH_HIGH);
-    model_init(&sc->pivot,        3, THRESH_LOW);
-
-    pixctx_init(&sc->intra_pix_ctx, 8, full_model_syms, 0);
-
-    pixctx_init(&sc->inter_pix_ctx, version ? 3 : 2,
-                full_model_syms, version ? 1 : 0);
-}
-
-void ff_mss12_slicecontext_reset(SliceContext *sc)
-{
-    model_reset(&sc->intra_region);
-    model_reset(&sc->inter_region);
-    model_reset(&sc->split_mode);
-    model_reset(&sc->edge_mode);
-    model_reset(&sc->pivot);
-    pixctx_reset(&sc->intra_pix_ctx);
-    pixctx_reset(&sc->inter_pix_ctx);
-}
-
-static int decode_pivot(SliceContext *sc, ArithCoder *acoder, int base)
-{
-    int val, inv;
-
-    inv = acoder->get_model_sym(acoder, &sc->edge_mode);
-    val = acoder->get_model_sym(acoder, &sc->pivot) + 1;
-
-    if (val > 2) {
-        if ((base + 1) / 2 - 2 <= 0)
-            return -1;
-
-        val = acoder->get_number(acoder, (base + 1) / 2 - 2) + 3;
-    }
-
-    if (val >= base)
-        return -1;
-
-    return inv ? base - val : val;
-}
-
-static int decode_region_intra(SliceContext *sc, ArithCoder *acoder,
-                               int x, int y, int width, int height)
-{
-    MSS12Context const *c = sc->c;
-    int mode;
-
-    mode = acoder->get_model_sym(acoder, &sc->intra_region);
-
-    if (!mode) {
-        int i, j, pix, rgb_pix;
-        int stride       = c->pal_stride;
-        int rgb_stride   = c->rgb_stride;
-        uint8_t *dst     = c->pal_pic + x     + y * stride;
-        uint8_t *rgb_dst = c->rgb_pic + x * 3 + y * rgb_stride;
-
-        pix     = decode_pixel(acoder, &sc->intra_pix_ctx, NULL, 0, 0);
-        rgb_pix = c->pal[pix];
-        for (i = 0; i < height; i++, dst += stride, rgb_dst += rgb_stride) {
-            memset(dst, pix, width);
-            if (c->rgb_pic)
-                for (j = 0; j < width * 3; j += 3)
-                    AV_WB24(rgb_dst + j, rgb_pix);
-        }
-    } else {
-        return decode_region(acoder, c->pal_pic, c->rgb_pic,
-                             x, y, width, height, c->pal_stride, c->rgb_stride,
-                             &sc->intra_pix_ctx, &c->pal[0]);
-    }
-
-    return 0;
-}
-
-static int decode_region_inter(SliceContext *sc, ArithCoder *acoder,
-                               int x, int y, int width, int height)
-{
-    MSS12Context const *c = sc->c;
-    int mode;
-
-    mode = acoder->get_model_sym(acoder, &sc->inter_region);
-
-    if (!mode) {
-        mode = decode_pixel(acoder, &sc->inter_pix_ctx, NULL, 0, 0);
-
-        if (c->avctx->err_recognition & AV_EF_EXPLODE &&
-            ( c->rgb_pic && mode != 0x01 && mode != 0x02 && mode != 0x04 ||
-             !c->rgb_pic && mode != 0x80 && mode != 0xFF))
-            return -1;
-
-        if (mode == 0x02)
-            copy_rectangles(c, x, y, width, height);
-        else if (mode == 0x04)
-            return motion_compensation(c, x, y, width, height);
-        else if (mode != 0x80)
-            return decode_region_intra(sc, acoder, x, y, width, height);
-    } else {
-        if (decode_region(acoder, c->mask, NULL,
-                          x, y, width, height, c->mask_stride, 0,
-                          &sc->inter_pix_ctx, &c->pal[0]) < 0)
-            return -1;
-        return decode_region_masked(c, acoder, c->pal_pic,
-                                    c->pal_stride, c->mask,
-                                    c->mask_stride,
-                                    x, y, width, height,
-                                    &sc->intra_pix_ctx);
-    }
-
-    return 0;
-}
-
-int ff_mss12_decode_rect(SliceContext *sc, ArithCoder *acoder,
-                         int x, int y, int width, int height)
-{
-    int mode, pivot;
-
-    mode = acoder->get_model_sym(acoder, &sc->split_mode);
-
-    switch (mode) {
-    case SPLIT_VERT:
-        if ((pivot = decode_pivot(sc, acoder, height)) < 1)
-            return -1;
-        if (ff_mss12_decode_rect(sc, acoder, x, y, width, pivot))
-            return -1;
-        if (ff_mss12_decode_rect(sc, acoder, x, y + pivot, width, height - pivot))
-            return -1;
-        break;
-    case SPLIT_HOR:
-        if ((pivot = decode_pivot(sc, acoder, width)) < 1)
-            return -1;
-        if (ff_mss12_decode_rect(sc, acoder, x, y, pivot, height))
-            return -1;
-        if (ff_mss12_decode_rect(sc, acoder, x + pivot, y, width - pivot, height))
-            return -1;
-        break;
-    case SPLIT_NONE:
-        if (sc->c->keyframe)
-            return decode_region_intra(sc, acoder, x, y, width, height);
-        else
-            return decode_region_inter(sc, acoder, x, y, width, height);
-    default:
-        return -1;
-    }
-
-    return 0;
-}
-
-av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
-                                 SliceContext* sc1, SliceContext *sc2)
-{
-    AVCodecContext *avctx = c->avctx;
-    int i;
-
-    if (avctx->extradata_size < 52 + 256 * 3) {
-        av_log(avctx, AV_LOG_ERROR, "Insufficient extradata size %d\n",
-               avctx->extradata_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (AV_RB32(avctx->extradata) < avctx->extradata_size) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Insufficient extradata size: expected %d got %d\n",
-               AV_RB32(avctx->extradata),
-               avctx->extradata_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    avctx->coded_width  = AV_RB32(avctx->extradata + 20);
-    avctx->coded_height = AV_RB32(avctx->extradata + 24);
-    if (avctx->coded_width > 4096 || avctx->coded_height > 4096) {
-        av_log(avctx, AV_LOG_ERROR, "Frame dimensions %dx%d too large",
-               avctx->coded_width, avctx->coded_height);
-        return AVERROR_INVALIDDATA;
-    }
-
-    av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d\n",
-           AV_RB32(avctx->extradata + 4), AV_RB32(avctx->extradata + 8));
-    if (version != AV_RB32(avctx->extradata + 4) > 1) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Header version doesn't match codec tag\n");
-        return -1;
-    }
-
-    c->free_colours = AV_RB32(avctx->extradata + 48);
-    if ((unsigned)c->free_colours > 256) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Incorrect number of changeable palette entries: %d\n",
-               c->free_colours);
-        return AVERROR_INVALIDDATA;
-    }
-    av_log(avctx, AV_LOG_DEBUG, "%d free colour(s)\n", c->free_colours);
-
-    av_log(avctx, AV_LOG_DEBUG, "Display dimensions %dx%d\n",
-           AV_RB32(avctx->extradata + 12), AV_RB32(avctx->extradata + 16));
-    av_log(avctx, AV_LOG_DEBUG, "Coded dimensions %dx%d\n",
-           avctx->coded_width, avctx->coded_height);
-    av_log(avctx, AV_LOG_DEBUG, "%g frames per second\n",
-           av_int2float(AV_RB32(avctx->extradata + 28)));
-    av_log(avctx, AV_LOG_DEBUG, "Bitrate %d bps\n",
-           AV_RB32(avctx->extradata + 32));
-    av_log(avctx, AV_LOG_DEBUG, "Max. lead time %g ms\n",
-           av_int2float(AV_RB32(avctx->extradata + 36)));
-    av_log(avctx, AV_LOG_DEBUG, "Max. lag time %g ms\n",
-           av_int2float(AV_RB32(avctx->extradata + 40)));
-    av_log(avctx, AV_LOG_DEBUG, "Max. seek time %g ms\n",
-           av_int2float(AV_RB32(avctx->extradata + 44)));
-
-    if (version) {
-        if (avctx->extradata_size < 60 + 256 * 3) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Insufficient extradata size %d for v2\n",
-                   avctx->extradata_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        c->slice_split = AV_RB32(avctx->extradata + 52);
-        av_log(avctx, AV_LOG_DEBUG, "Slice split %d\n", c->slice_split);
-
-        c->full_model_syms = AV_RB32(avctx->extradata + 56);
-        if (c->full_model_syms < 2 || c->full_model_syms > 256) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Incorrect number of used colours %d\n",
-                   c->full_model_syms);
-            return AVERROR_INVALIDDATA;
-        }
-        av_log(avctx, AV_LOG_DEBUG, "Used colours %d\n",
-               c->full_model_syms);
-    } else {
-        c->slice_split     = 0;
-        c->full_model_syms = 256;
-    }
-
-    for (i = 0; i < 256; i++)
-        c->pal[i] = AV_RB24(avctx->extradata + 52 +
-                            (version ? 8 : 0) + i * 3);
-
-    c->mask_stride = FFALIGN(avctx->width, 16);
-    c->mask        = av_malloc(c->mask_stride * avctx->height);
-    if (!c->mask) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot allocate mask plane\n");
-        return AVERROR(ENOMEM);
-    }
-
-    sc1->c = c;
-    slicecontext_init(sc1, version, c->full_model_syms);
-    if (c->slice_split) {
-        sc2->c = c;
-        slicecontext_init(sc2, version, c->full_model_syms);
-    }
-    c->corrupted = 1;
-
-    return 0;
-}
-
-av_cold int ff_mss12_decode_end(MSS12Context *c)
-{
-    av_freep(&c->mask);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/mss12.h b/deps/libav/libavcodec/mss12.h
deleted file mode 100644
index 5b1fee8..0000000
--- a/deps/libav/libavcodec/mss12.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Common header for Microsoft Screen 1 and 2
- */
-
-#ifndef AVCODEC_MSS12_H
-#define AVCODEC_MSS12_H
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "bytestream.h"
-
-#define MODEL_MIN_SYMS    2
-#define MODEL_MAX_SYMS  256
-#define THRESH_ADAPTIVE  -1
-#define THRESH_LOW       15
-#define THRESH_HIGH      50
-
-typedef struct Model {
-    int16_t cum_prob[MODEL_MAX_SYMS + 1];
-    int16_t weights[MODEL_MAX_SYMS + 1];
-    uint8_t idx2sym[MODEL_MAX_SYMS + 1];
-    int num_syms;
-    int thr_weight, threshold;
-} Model;
-
-typedef struct ArithCoder {
-    int low, high, value;
-    union {
-        GetBitContext *gb;
-        GetByteContext *gB;
-    } gbc;
-    int (*get_model_sym)(struct ArithCoder *c, Model *m);
-    int (*get_number)   (struct ArithCoder *c, int n);
-} ArithCoder;
-
-typedef struct PixContext {
-    int cache_size, num_syms;
-    uint8_t cache[12];
-    Model cache_model, full_model;
-    Model sec_models[15][4];
-    int special_initial_cache;
-} PixContext;
-
-struct MSS12Context;
-
-typedef struct SliceContext {
-    struct MSS12Context *c;
-    Model      intra_region, inter_region;
-    Model      pivot, edge_mode, split_mode;
-    PixContext intra_pix_ctx, inter_pix_ctx;
-} SliceContext;
-
-typedef struct MSS12Context {
-    AVCodecContext *avctx;
-    uint32_t       pal[256];
-    uint8_t        *pal_pic;
-    uint8_t        *last_pal_pic;
-    int            pal_stride;
-    uint8_t        *mask;
-    int            mask_stride;
-    uint8_t        *rgb_pic;
-    uint8_t        *last_rgb_pic;
-    int            rgb_stride;
-    int            free_colours;
-    int            keyframe;
-    int            mvX, mvY;
-    int            corrupted;
-    int            slice_split;
-    int            full_model_syms;
-} MSS12Context;
-
-int ff_mss12_decode_rect(SliceContext *ctx, ArithCoder *acoder,
-                         int x, int y, int width, int height);
-void ff_mss12_model_update(Model *m, int val);
-void ff_mss12_slicecontext_reset(SliceContext *sc);
-int ff_mss12_decode_init(MSS12Context *c, int version,
-                         SliceContext *sc1, SliceContext *sc2);
-int ff_mss12_decode_end(MSS12Context *ctx);
-
-#define ARITH_GET_BIT(VERSION)                                          \
-static int arith ## VERSION ## _get_bit(ArithCoder *c)                  \
-{                                                                       \
-    int range = c->high - c->low + 1;                                   \
-    int bit   = 2 * c->value - c->low >= c->high;                       \
-                                                                        \
-    if (bit)                                                            \
-        c->low += range >> 1;                                           \
-    else                                                                \
-        c->high = c->low + (range >> 1) - 1;                            \
-                                                                        \
-    arith ## VERSION ## _normalise(c);                                  \
-                                                                        \
-    return bit;                                                         \
-}
-
-#define ARITH_GET_MODEL_SYM(VERSION)                                    \
-static int arith ## VERSION ## _get_model_sym(ArithCoder *c, Model *m)  \
-{                                                                       \
-    int idx, val;                                                       \
-                                                                        \
-    idx = arith ## VERSION ## _get_prob(c, m->cum_prob);                \
-                                                                        \
-    val = m->idx2sym[idx];                                              \
-    ff_mss12_model_update(m, idx);                                      \
-                                                                        \
-    arith ## VERSION ## _normalise(c);                                  \
-                                                                        \
-    return val;                                                         \
-}
-
-#endif /* AVCODEC_MSS12_H */
diff --git a/deps/libav/libavcodec/mss2.c b/deps/libav/libavcodec/mss2.c
deleted file mode 100644
index 025c229..0000000
--- a/deps/libav/libavcodec/mss2.c
+++ /dev/null
@@ -1,853 +0,0 @@
-/*
- * Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder
- */
-
-#include "libavutil/avassert.h"
-#include "error_resilience.h"
-#include "internal.h"
-#include "msmpeg4data.h"
-#include "vc1.h"
-#include "mss12.h"
-#include "mss2dsp.h"
-
-typedef struct MSS2Context {
-    VC1Context     v;
-    int            split_position;
-    AVFrame       *last_pic;
-    MSS12Context   c;
-    MSS2DSPContext dsp;
-    SliceContext   sc[2];
-} MSS2Context;
-
-static void arith2_normalise(ArithCoder *c)
-{
-    while ((c->high >> 15) - (c->low >> 15) < 2) {
-        if ((c->low ^ c->high) & 0x10000) {
-            c->high  ^= 0x8000;
-            c->value ^= 0x8000;
-            c->low   ^= 0x8000;
-        }
-        c->high  = c->high  << 8 & 0xFFFFFF | 0xFF;
-        c->value = c->value << 8 & 0xFFFFFF | bytestream2_get_byte(c->gbc.gB);
-        c->low   = c->low   << 8 & 0xFFFFFF;
-    }
-}
-
-ARITH_GET_BIT(2)
-
-/* L. Stuiver and A. Moffat: "Piecewise Integer Mapping for Arithmetic Coding."
- * In Proc. 8th Data Compression Conference (DCC '98), pp. 3-12, Mar. 1998 */
-
-static int arith2_get_scaled_value(int value, int n, int range)
-{
-    int split = (n << 1) - range;
-
-    if (value > split)
-        return split + (value - split >> 1);
-    else
-        return value;
-}
-
-static void arith2_rescale_interval(ArithCoder *c, int range,
-                                    int low, int high, int n)
-{
-    int split = (n << 1) - range;
-
-    if (high > split)
-        c->high = split + (high - split << 1);
-    else
-        c->high = high;
-
-    c->high += c->low - 1;
-
-    if (low > split)
-        c->low += split + (low - split << 1);
-    else
-        c->low += low;
-}
-
-static int arith2_get_number(ArithCoder *c, int n)
-{
-    int range = c->high - c->low + 1;
-    int scale = av_log2(range) - av_log2(n);
-    int val;
-
-    if (n << scale > range)
-        scale--;
-
-    n <<= scale;
-
-    val = arith2_get_scaled_value(c->value - c->low, n, range) >> scale;
-
-    arith2_rescale_interval(c, range, val << scale, (val + 1) << scale, n);
-
-    arith2_normalise(c);
-
-    return val;
-}
-
-static int arith2_get_prob(ArithCoder *c, int16_t *probs)
-{
-    int range = c->high - c->low + 1, n = *probs;
-    int scale = av_log2(range) - av_log2(n);
-    int i     = 0, val;
-
-    if (n << scale > range)
-        scale--;
-
-    n <<= scale;
-
-    val = arith2_get_scaled_value(c->value - c->low, n, range) >> scale;
-    while (probs[++i] > val) ;
-
-    arith2_rescale_interval(c, range,
-                            probs[i] << scale, probs[i - 1] << scale, n);
-
-    return i;
-}
-
-ARITH_GET_MODEL_SYM(2)
-
-static int arith2_get_consumed_bytes(ArithCoder *c)
-{
-    int diff = (c->high >> 16) - (c->low >> 16);
-    int bp   = bytestream2_tell(c->gbc.gB) - 3 << 3;
-    int bits = 1;
-
-    while (!(diff & 0x80)) {
-        bits++;
-        diff <<= 1;
-    }
-
-    return (bits + bp + 7 >> 3) + ((c->low >> 16) + 1 == c->high >> 16);
-}
-
-static void arith2_init(ArithCoder *c, GetByteContext *gB)
-{
-    c->low           = 0;
-    c->high          = 0xFFFFFF;
-    c->value         = bytestream2_get_be24(gB);
-    c->gbc.gB        = gB;
-    c->get_model_sym = arith2_get_model_sym;
-    c->get_number    = arith2_get_number;
-}
-
-static int decode_pal_v2(MSS12Context *ctx, const uint8_t *buf, int buf_size)
-{
-    int i, ncol;
-    uint32_t *pal = ctx->pal + 256 - ctx->free_colours;
-
-    if (!ctx->free_colours)
-        return 0;
-
-    ncol = *buf++;
-    if (ncol > ctx->free_colours || buf_size < 2 + ncol * 3)
-        return AVERROR_INVALIDDATA;
-    for (i = 0; i < ncol; i++)
-        *pal++ = AV_RB24(buf + 3 * i);
-
-    return 1 + ncol * 3;
-}
-
-static int decode_555(GetByteContext *gB, uint16_t *dst, int stride,
-                      int keyframe, int w, int h)
-{
-    int last_symbol = 0, repeat = 0, prev_avail = 0;
-
-    if (!keyframe) {
-        int x, y, endx, endy, t;
-
-#define READ_PAIR(a, b)                 \
-    a  = bytestream2_get_byte(gB) << 4; \
-    t  = bytestream2_get_byte(gB);      \
-    a |= t >> 4;                        \
-    b  = (t & 0xF) << 8;                \
-    b |= bytestream2_get_byte(gB);      \
-
-        READ_PAIR(x, endx)
-        READ_PAIR(y, endy)
-
-        if (endx >= w || endy >= h || x > endx || y > endy)
-            return AVERROR_INVALIDDATA;
-        dst += x + stride * y;
-        w    = endx - x + 1;
-        h    = endy - y + 1;
-        if (y)
-            prev_avail = 1;
-    }
-
-    do {
-        uint16_t *p = dst;
-        do {
-            if (repeat-- < 1) {
-                int b = bytestream2_get_byte(gB);
-                if (b < 128)
-                    last_symbol = b << 8 | bytestream2_get_byte(gB);
-                else if (b > 129) {
-                    repeat = 0;
-                    while (b-- > 130)
-                        repeat = (repeat << 8) + bytestream2_get_byte(gB) + 1;
-                    if (last_symbol == -2) {
-                        int skip = FFMIN((unsigned)repeat, dst + w - p);
-                        repeat -= skip;
-                        p      += skip;
-                    }
-                } else
-                    last_symbol = 127 - b;
-            }
-            if (last_symbol >= 0)
-                *p = last_symbol;
-            else if (last_symbol == -1 && prev_avail)
-                *p = *(p - stride);
-        } while (++p < dst + w);
-        dst       += stride;
-        prev_avail = 1;
-    } while (--h);
-
-    return 0;
-}
-
-static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, int pal_stride,
-                      uint8_t *rgb_dst, int rgb_stride, uint32_t *pal,
-                      int keyframe, int kf_slipt, int slice, int w, int h)
-{
-    uint8_t bits[270] = { 0 };
-    uint32_t codes[270];
-    VLC vlc;
-
-    int current_length = 0, read_codes = 0, next_code = 0, current_codes = 0;
-    int remaining_codes, surplus_codes, i;
-
-    const int alphabet_size = 270 - keyframe;
-
-    int last_symbol = 0, repeat = 0, prev_avail = 0;
-
-    if (!keyframe) {
-        int x, y, clipw, cliph;
-
-        x     = get_bits(gb, 12);
-        y     = get_bits(gb, 12);
-        clipw = get_bits(gb, 12) + 1;
-        cliph = get_bits(gb, 12) + 1;
-
-        if (x + clipw > w || y + cliph > h)
-            return AVERROR_INVALIDDATA;
-        pal_dst += pal_stride * y + x;
-        rgb_dst += rgb_stride * y + x * 3;
-        w        = clipw;
-        h        = cliph;
-        if (y)
-            prev_avail = 1;
-    } else {
-        if (slice > 0) {
-            pal_dst   += pal_stride * kf_slipt;
-            rgb_dst   += rgb_stride * kf_slipt;
-            prev_avail = 1;
-            h         -= kf_slipt;
-        } else
-            h = kf_slipt;
-    }
-
-    /* read explicit codes */
-    do {
-        while (current_codes--) {
-            int symbol = get_bits(gb, 8);
-            if (symbol >= 204 - keyframe)
-                symbol += 14 - keyframe;
-            else if (symbol > 189)
-                symbol = get_bits1(gb) + (symbol << 1) - 190;
-            if (bits[symbol])
-                return AVERROR_INVALIDDATA;
-            bits[symbol]  = current_length;
-            codes[symbol] = next_code++;
-            read_codes++;
-        }
-        current_length++;
-        next_code     <<= 1;
-        remaining_codes = (1 << current_length) - next_code;
-        current_codes   = get_bits(gb, av_ceil_log2(remaining_codes + 1));
-        if (current_length > 22 || current_codes > remaining_codes)
-            return AVERROR_INVALIDDATA;
-    } while (current_codes != remaining_codes);
-
-    remaining_codes = alphabet_size - read_codes;
-
-    /* determine the minimum length to fit the rest of the alphabet */
-    while ((surplus_codes = (2 << current_length) -
-                            (next_code << 1) - remaining_codes) < 0) {
-        current_length++;
-        next_code <<= 1;
-    }
-
-    /* add the rest of the symbols lexicographically */
-    for (i = 0; i < alphabet_size; i++)
-        if (!bits[i]) {
-            if (surplus_codes-- == 0) {
-                current_length++;
-                next_code <<= 1;
-            }
-            bits[i]  = current_length;
-            codes[i] = next_code++;
-        }
-
-    if (next_code != 1 << current_length)
-        return AVERROR_INVALIDDATA;
-
-    if (i = init_vlc(&vlc, 9, alphabet_size, bits, 1, 1, codes, 4, 4, 0))
-        return i;
-
-    /* frame decode */
-    do {
-        uint8_t *pp = pal_dst;
-        uint8_t *rp = rgb_dst;
-        do {
-            if (repeat-- < 1) {
-                int b = get_vlc2(gb, vlc.table, 9, 3);
-                if (b < 256)
-                    last_symbol = b;
-                else if (b < 268) {
-                    b -= 256;
-                    if (b == 11)
-                        b = get_bits(gb, 4) + 10;
-
-                    if (!b)
-                        repeat = 0;
-                    else
-                        repeat = get_bits(gb, b);
-
-                    repeat += (1 << b) - 1;
-
-                    if (last_symbol == -2) {
-                        int skip = FFMIN(repeat, pal_dst + w - pp);
-                        repeat -= skip;
-                        pp     += skip;
-                        rp     += skip * 3;
-                    }
-                } else
-                    last_symbol = 267 - b;
-            }
-            if (last_symbol >= 0) {
-                *pp = last_symbol;
-                AV_WB24(rp, pal[last_symbol]);
-            } else if (last_symbol == -1 && prev_avail) {
-                *pp = *(pp - pal_stride);
-                memcpy(rp, rp - rgb_stride, 3);
-            }
-            rp += 3;
-        } while (++pp < pal_dst + w);
-        pal_dst   += pal_stride;
-        rgb_dst   += rgb_stride;
-        prev_avail = 1;
-    } while (--h);
-
-    ff_free_vlc(&vlc);
-    return 0;
-}
-
-static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size,
-                       int x, int y, int w, int h, int wmv9_mask)
-{
-    MSS2Context *ctx  = avctx->priv_data;
-    MSS12Context *c   = &ctx->c;
-    VC1Context *v     = avctx->priv_data;
-    MpegEncContext *s = &v->s;
-    AVFrame *f;
-    int ret;
-
-    ff_mpeg_flush(avctx);
-
-    init_get_bits(&s->gb, buf, buf_size * 8);
-
-    s->loop_filter = avctx->skip_loop_filter < AVDISCARD_ALL;
-
-    if (ff_vc1_parse_frame_header(v, &s->gb) < 0) {
-        av_log(v->s.avctx, AV_LOG_ERROR, "header error\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->pict_type != AV_PICTURE_TYPE_I) {
-        av_log(v->s.avctx, AV_LOG_ERROR, "expected I-frame\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    if ((ret = ff_MPV_frame_start(s, avctx)) < 0) {
-        av_log(v->s.avctx, AV_LOG_ERROR, "ff_MPV_frame_start error\n");
-        avctx->pix_fmt = AV_PIX_FMT_RGB24;
-        return ret;
-    }
-
-    ff_mpeg_er_frame_start(s);
-
-    v->bits = buf_size * 8;
-
-    v->end_mb_x = (w + 15) >> 4;
-    s->end_mb_y = (h + 15) >> 4;
-    if (v->respic & 1)
-        v->end_mb_x = v->end_mb_x + 1 >> 1;
-    if (v->respic & 2)
-        s->end_mb_y = s->end_mb_y + 1 >> 1;
-
-    ff_vc1_decode_blocks(v);
-
-    ff_er_frame_end(&s->er);
-
-    ff_MPV_frame_end(s);
-
-    f = &s->current_picture.f;
-
-    if (v->respic == 3) {
-        ctx->dsp.upsample_plane(f->data[0], f->linesize[0], w,      h);
-        ctx->dsp.upsample_plane(f->data[1], f->linesize[1], w >> 1, h >> 1);
-        ctx->dsp.upsample_plane(f->data[2], f->linesize[2], w >> 1, h >> 1);
-    } else if (v->respic)
-        avpriv_request_sample(v->s.avctx,
-                              "Asymmetric WMV9 rectangle subsampling");
-
-    av_assert0(f->linesize[1] == f->linesize[2]);
-
-    if (wmv9_mask != -1)
-        ctx->dsp.mss2_blit_wmv9_masked(c->rgb_pic + y * c->rgb_stride + x * 3,
-                                       c->rgb_stride, wmv9_mask,
-                                       c->pal_pic + y * c->pal_stride + x,
-                                       c->pal_stride,
-                                       f->data[0], f->linesize[0],
-                                       f->data[1], f->data[2], f->linesize[1],
-                                       w, h);
-    else
-        ctx->dsp.mss2_blit_wmv9(c->rgb_pic + y * c->rgb_stride + x * 3,
-                                c->rgb_stride,
-                                f->data[0], f->linesize[0],
-                                f->data[1], f->data[2], f->linesize[1],
-                                w, h);
-
-    avctx->pix_fmt = AV_PIX_FMT_RGB24;
-
-    return 0;
-}
-
-typedef struct Rectangle {
-    int coded, x, y, w, h;
-} Rectangle;
-
-#define MAX_WMV9_RECTANGLES 20
-#define ARITH2_PADDING 2
-
-static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    MSS2Context *ctx = avctx->priv_data;
-    MSS12Context *c  = &ctx->c;
-    AVFrame *frame   = data;
-    GetBitContext gb;
-    GetByteContext gB;
-    ArithCoder acoder;
-
-    int keyframe, has_wmv9, has_mv, is_rle, is_555, ret;
-
-    Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r;
-    int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
-
-    av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
-               ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
-
-    init_get_bits(&gb, buf, buf_size * 8);
-
-    if (keyframe = get_bits1(&gb))
-        skip_bits(&gb, 7);
-    has_wmv9 = get_bits1(&gb);
-    has_mv   = keyframe ? 0 : get_bits1(&gb);
-    is_rle   = get_bits1(&gb);
-    is_555   = is_rle && get_bits1(&gb);
-    if (c->slice_split > 0)
-        ctx->split_position = c->slice_split;
-    else if (c->slice_split < 0) {
-        if (get_bits1(&gb)) {
-            if (get_bits1(&gb)) {
-                if (get_bits1(&gb))
-                    ctx->split_position = get_bits(&gb, 16);
-                else
-                    ctx->split_position = get_bits(&gb, 12);
-            } else
-                ctx->split_position = get_bits(&gb, 8) << 4;
-        } else {
-            if (keyframe)
-                ctx->split_position = avctx->height / 2;
-        }
-    } else
-        ctx->split_position = avctx->height;
-
-    if (c->slice_split && (ctx->split_position < 1 - is_555 ||
-                           ctx->split_position > avctx->height - 1))
-        return AVERROR_INVALIDDATA;
-
-    align_get_bits(&gb);
-    buf      += get_bits_count(&gb) >> 3;
-    buf_size -= get_bits_count(&gb) >> 3;
-
-    if (buf_size < 1)
-        return AVERROR_INVALIDDATA;
-
-    if (is_555 && (has_wmv9 || has_mv || c->slice_split && ctx->split_position))
-        return AVERROR_INVALIDDATA;
-
-    avctx->pix_fmt = is_555 ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_RGB24;
-    if (ctx->last_pic->format != avctx->pix_fmt)
-        av_frame_unref(ctx->last_pic);
-
-    if (has_wmv9) {
-        bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
-        arith2_init(&acoder, &gB);
-
-        implicit_rect = !arith2_get_bit(&acoder);
-
-        while (arith2_get_bit(&acoder)) {
-            if (used_rects == MAX_WMV9_RECTANGLES)
-                return AVERROR_INVALIDDATA;
-            r = &wmv9rects[used_rects];
-            if (!used_rects)
-                r->x = arith2_get_number(&acoder, avctx->width);
-            else
-                r->x = arith2_get_number(&acoder, avctx->width -
-                                         wmv9rects[used_rects - 1].x) +
-                       wmv9rects[used_rects - 1].x;
-            r->y = arith2_get_number(&acoder, avctx->height);
-            r->w = arith2_get_number(&acoder, avctx->width  - r->x) + 1;
-            r->h = arith2_get_number(&acoder, avctx->height - r->y) + 1;
-            used_rects++;
-        }
-
-        if (implicit_rect && used_rects) {
-            av_log(avctx, AV_LOG_ERROR, "implicit_rect && used_rects > 0\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (implicit_rect) {
-            wmv9rects[0].x = 0;
-            wmv9rects[0].y = 0;
-            wmv9rects[0].w = avctx->width;
-            wmv9rects[0].h = avctx->height;
-
-            used_rects = 1;
-        }
-        for (i = 0; i < used_rects; i++) {
-            if (!implicit_rect && arith2_get_bit(&acoder)) {
-                av_log(avctx, AV_LOG_ERROR, "Unexpected grandchildren\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (!i) {
-                wmv9_mask = arith2_get_bit(&acoder) - 1;
-                if (!wmv9_mask)
-                    wmv9_mask = arith2_get_number(&acoder, 256);
-            }
-            wmv9rects[i].coded = arith2_get_number(&acoder, 2);
-        }
-
-        buf      += arith2_get_consumed_bytes(&acoder);
-        buf_size -= arith2_get_consumed_bytes(&acoder);
-        if (buf_size < 1)
-            return AVERROR_INVALIDDATA;
-    }
-
-    c->mvX = c->mvY = 0;
-    if (keyframe && !is_555) {
-        if ((i = decode_pal_v2(c, buf, buf_size)) < 0)
-            return AVERROR_INVALIDDATA;
-        buf      += i;
-        buf_size -= i;
-    } else if (has_mv) {
-        buf      += 4;
-        buf_size -= 4;
-        if (buf_size < 1)
-            return AVERROR_INVALIDDATA;
-        c->mvX = AV_RB16(buf - 4) - avctx->width;
-        c->mvY = AV_RB16(buf - 2) - avctx->height;
-    }
-
-    if (c->mvX < 0 || c->mvY < 0) {
-        FFSWAP(uint8_t *, c->pal_pic, c->last_pal_pic);
-
-        if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-
-        if (ctx->last_pic->data[0]) {
-            av_assert0(frame->linesize[0] == ctx->last_pic->linesize[0]);
-            c->last_rgb_pic = ctx->last_pic->data[0] +
-                              ctx->last_pic->linesize[0] * (avctx->height - 1);
-        } else {
-            av_log(avctx, AV_LOG_ERROR, "Missing keyframe\n");
-            return AVERROR_INVALIDDATA;
-        }
-    } else {
-        if ((ret = ff_reget_buffer(avctx, ctx->last_pic)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-            return ret;
-        }
-        if ((ret = av_frame_ref(frame, ctx->last_pic)) < 0)
-            return ret;
-
-        c->last_rgb_pic = NULL;
-    }
-    c->rgb_pic    = frame->data[0] +
-                    frame->linesize[0] * (avctx->height - 1);
-    c->rgb_stride = -frame->linesize[0];
-
-    frame->key_frame = keyframe;
-    frame->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
-
-    if (is_555) {
-        bytestream2_init(&gB, buf, buf_size);
-
-        if (decode_555(&gB, (uint16_t *)c->rgb_pic, c->rgb_stride >> 1,
-                       keyframe, avctx->width, avctx->height))
-            return AVERROR_INVALIDDATA;
-
-        buf_size -= bytestream2_tell(&gB);
-    } else {
-        if (keyframe) {
-            c->corrupted = 0;
-            ff_mss12_slicecontext_reset(&ctx->sc[0]);
-            if (c->slice_split)
-                ff_mss12_slicecontext_reset(&ctx->sc[1]);
-        }
-        if (is_rle) {
-            init_get_bits(&gb, buf, buf_size * 8);
-            if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
-                                 c->rgb_pic, c->rgb_stride, c->pal, keyframe,
-                                 ctx->split_position, 0,
-                                 avctx->width, avctx->height))
-                return ret;
-            align_get_bits(&gb);
-
-            if (c->slice_split)
-                if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
-                                     c->rgb_pic, c->rgb_stride, c->pal, keyframe,
-                                     ctx->split_position, 1,
-                                     avctx->width, avctx->height))
-                    return ret;
-
-            align_get_bits(&gb);
-            buf      += get_bits_count(&gb) >> 3;
-            buf_size -= get_bits_count(&gb) >> 3;
-        } else if (!implicit_rect || wmv9_mask != -1) {
-            if (c->corrupted)
-                return AVERROR_INVALIDDATA;
-            bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
-            arith2_init(&acoder, &gB);
-            c->keyframe = keyframe;
-            if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, 0, 0,
-                                                    avctx->width,
-                                                    ctx->split_position))
-                return AVERROR_INVALIDDATA;
-
-            buf      += arith2_get_consumed_bytes(&acoder);
-            buf_size -= arith2_get_consumed_bytes(&acoder);
-            if (c->slice_split) {
-                if (buf_size < 1)
-                    return AVERROR_INVALIDDATA;
-                bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
-                arith2_init(&acoder, &gB);
-                if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[1], &acoder, 0,
-                                                        ctx->split_position,
-                                                        avctx->width,
-                                                        avctx->height - ctx->split_position))
-                    return AVERROR_INVALIDDATA;
-
-                buf      += arith2_get_consumed_bytes(&acoder);
-                buf_size -= arith2_get_consumed_bytes(&acoder);
-            }
-        } else
-            memset(c->pal_pic, 0, c->pal_stride * avctx->height);
-    }
-
-    if (has_wmv9) {
-        for (i = 0; i < used_rects; i++) {
-            int x = wmv9rects[i].x;
-            int y = wmv9rects[i].y;
-            int w = wmv9rects[i].w;
-            int h = wmv9rects[i].h;
-            if (wmv9rects[i].coded) {
-                int WMV9codedFrameSize;
-                if (buf_size < 4 || !(WMV9codedFrameSize = AV_RL24(buf)))
-                    return AVERROR_INVALIDDATA;
-                if (ret = decode_wmv9(avctx, buf + 3, buf_size - 3,
-                                      x, y, w, h, wmv9_mask))
-                    return ret;
-                buf      += WMV9codedFrameSize + 3;
-                buf_size -= WMV9codedFrameSize + 3;
-            } else {
-                uint8_t *dst = c->rgb_pic + y * c->rgb_stride + x * 3;
-                if (wmv9_mask != -1) {
-                    ctx->dsp.mss2_gray_fill_masked(dst, c->rgb_stride,
-                                                   wmv9_mask,
-                                                   c->pal_pic + y * c->pal_stride + x,
-                                                   c->pal_stride,
-                                                   w, h);
-                } else {
-                    do {
-                        memset(dst, 0x80, w * 3);
-                        dst += c->rgb_stride;
-                    } while (--h);
-                }
-            }
-        }
-    }
-
-    if (buf_size)
-        av_log(avctx, AV_LOG_WARNING, "buffer not fully consumed\n");
-
-    if (c->mvX < 0 || c->mvY < 0) {
-        av_frame_unref(ctx->last_pic);
-        ret = av_frame_ref(ctx->last_pic, frame);
-        if (ret < 0)
-            return ret;
-    }
-
-    *got_frame       = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int wmv9_init(AVCodecContext *avctx)
-{
-    VC1Context *v = avctx->priv_data;
-    int ret;
-
-    v->s.avctx    = avctx;
-
-    if ((ret = ff_vc1_init_common(v)) < 0)
-        return ret;
-    ff_vc1dsp_init(&v->vc1dsp);
-
-    v->profile = PROFILE_MAIN;
-
-    v->zz_8x4     = ff_wmv2_scantableA;
-    v->zz_4x8     = ff_wmv2_scantableB;
-    v->res_y411   = 0;
-    v->res_sprite = 0;
-
-    v->frmrtq_postproc = 7;
-    v->bitrtq_postproc = 31;
-
-    v->res_x8          = 0;
-    v->multires        = 0;
-    v->res_fasttx      = 1;
-
-    v->fastuvmc        = 0;
-
-    v->extended_mv     = 0;
-
-    v->dquant          = 1;
-    v->vstransform     = 1;
-
-    v->res_transtab    = 0;
-
-    v->overlap         = 0;
-
-    v->resync_marker   = 0;
-    v->rangered        = 0;
-
-    v->s.max_b_frames = avctx->max_b_frames = 0;
-    v->quantizer_mode = 0;
-
-    v->finterpflag = 0;
-
-    v->res_rtm_flag = 1;
-
-    ff_vc1_init_transposed_scantables(v);
-
-    if ((ret = ff_msmpeg4_decode_init(avctx)) < 0 ||
-        (ret = ff_vc1_decode_init_alloc_tables(v)) < 0)
-        return ret;
-
-    /* error concealment */
-    v->s.me.qpel_put = v->s.dsp.put_qpel_pixels_tab;
-    v->s.me.qpel_avg = v->s.dsp.avg_qpel_pixels_tab;
-
-    return 0;
-}
-
-static av_cold int mss2_decode_end(AVCodecContext *avctx)
-{
-    MSS2Context *const ctx = avctx->priv_data;
-
-    av_frame_free(&ctx->last_pic);
-
-    ff_mss12_decode_end(&ctx->c);
-    av_freep(&ctx->c.pal_pic);
-    av_freep(&ctx->c.last_pal_pic);
-    ff_vc1_decode_end(avctx);
-
-    return 0;
-}
-
-static av_cold int mss2_decode_init(AVCodecContext *avctx)
-{
-    MSS2Context * const ctx = avctx->priv_data;
-    MSS12Context *c = &ctx->c;
-    int ret;
-    c->avctx = avctx;
-    if (ret = ff_mss12_decode_init(c, 1, &ctx->sc[0], &ctx->sc[1]))
-        return ret;
-    c->pal_stride   = c->mask_stride;
-    c->pal_pic      = av_mallocz(c->pal_stride * avctx->height);
-    c->last_pal_pic = av_mallocz(c->pal_stride * avctx->height);
-    if (!c->pal_pic || !c->last_pal_pic) {
-        mss2_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-    if (ret = wmv9_init(avctx)) {
-        mss2_decode_end(avctx);
-        return ret;
-    }
-    ff_mss2dsp_init(&ctx->dsp);
-
-    avctx->pix_fmt = c->free_colours == 127 ? AV_PIX_FMT_RGB555
-                                            : AV_PIX_FMT_RGB24;
-
-    ctx->last_pic = av_frame_alloc();
-    if (!ctx->last_pic) {
-        mss2_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-AVCodec ff_mss2_decoder = {
-    .name           = "mss2",
-    .long_name      = NULL_IF_CONFIG_SMALL("MS Windows Media Video V9 Screen"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSS2,
-    .priv_data_size = sizeof(MSS2Context),
-    .init           = mss2_decode_init,
-    .close          = mss2_decode_end,
-    .decode         = mss2_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/mss2dsp.c b/deps/libav/libavcodec/mss2dsp.c
deleted file mode 100644
index aa13577..0000000
--- a/deps/libav/libavcodec/mss2dsp.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder DSP routines
- */
-
-#include "mss2dsp.h"
-#include "libavutil/common.h"
-
-static av_always_inline void mss2_blit_wmv9_template(uint8_t *dst,
-                                                     int dst_stride,
-                                                     int gray,
-                                                     int use_mask,
-                                                     int maskcolor,
-                                                     const uint8_t *mask,
-                                                     int mask_stride,
-                                                     const uint8_t *srcy,
-                                                     int srcy_stride,
-                                                     const uint8_t *srcu,
-                                                     const uint8_t *srcv,
-                                                     int srcuv_stride,
-                                                     int w, int h)
-{
-    int i, j, k, r = -1;
-    while (++r < h) {
-        for (i = 0, j = 0, k = 0; i < w; j += (i & 1), i++, k += 3) {
-            if (!use_mask || mask[i] == maskcolor) {
-                if (gray) {
-                    dst[k] = dst[k + 1] = dst[k + 2] = 0x80;
-                } else {
-                    int y = srcy[i];
-                    int u = srcu[j] - 128;
-                    int v = srcv[j] - 128;
-                    dst[k]     = av_clip_uint8(y + (             91881 * v + 32768 >> 16));
-                    dst[k + 1] = av_clip_uint8(y + (-22554 * u - 46802 * v + 32768 >> 16));
-                    dst[k + 2] = av_clip_uint8(y + (116130 * u             + 32768 >> 16));
-                }
-            }
-        }
-        mask +=  mask_stride;
-        dst  +=   dst_stride;
-        srcy +=  srcy_stride;
-        srcu += srcuv_stride * (r & 1);
-        srcv += srcuv_stride * (r & 1);
-    }
-}
-
-static void mss2_blit_wmv9_c(uint8_t *dst, int dst_stride,
-                             const uint8_t *srcy, int srcy_stride,
-                             const uint8_t *srcu, const uint8_t *srcv,
-                             int srcuv_stride, int w, int h)
-{
-    mss2_blit_wmv9_template(dst, dst_stride, 0, 0,
-                            0, NULL, 0,
-                            srcy, srcy_stride,
-                            srcu, srcv, srcuv_stride,
-                            w, h);
-}
-
-static void mss2_blit_wmv9_masked_c(uint8_t *dst, int dst_stride,
-                                    int maskcolor, const uint8_t *mask,
-                                    int mask_stride,
-                                    const uint8_t *srcy, int srcy_stride,
-                                    const uint8_t *srcu, const uint8_t *srcv,
-                                    int srcuv_stride, int w, int h)
-{
-    mss2_blit_wmv9_template(dst, dst_stride, 0, 1,
-                            maskcolor, mask, mask_stride,
-                            srcy, srcy_stride,
-                            srcu, srcv, srcuv_stride,
-                            w, h);
-}
-
-static void mss2_gray_fill_masked_c(uint8_t *dst, int dst_stride,
-                                    int maskcolor, const uint8_t *mask,
-                                    int mask_stride, int w, int h)
-{
-    mss2_blit_wmv9_template(dst, dst_stride, 1, 1,
-                            maskcolor, mask, mask_stride,
-                            NULL, 0,
-                            NULL, NULL, 0,
-                            w, h);
-}
-
-static void upsample_plane_c(uint8_t *plane, int plane_stride, int w, int h)
-{
-    uint8_t *src1, *src2, *dst1, *dst2, *p, a, b;
-    int i, j;
-
-    w += (w & 1);
-    h += (h & 1);
-
-    j = h - 1;
-
-    memcpy(plane + plane_stride *  j,
-           plane + plane_stride * (j >> 1),
-           w);
-
-    while ((j -= 2) > 0) {
-        dst1 = plane + plane_stride *  (j + 1);
-        dst2 = plane + plane_stride *   j;
-        src1 = plane + plane_stride * ((j + 1) >> 1);
-        src2 = plane + plane_stride * ( j      >> 1);
-
-        for (i = (w - 1) >> 1; i >= 0; i--) {
-            a = src1[i];
-            b = src2[i];
-            dst1[i] = (3 * a + b + 2) >> 2;
-            dst2[i] = (a + 3 * b + 2) >> 2;
-        }
-    }
-
-    for (j = h - 1; j >= 0; j--) {
-        p = plane + plane_stride * j;
-        i = w - 1;
-
-        p[i] = p[i >> 1];
-
-        while ((i -= 2) > 0) {
-            a = p[ i      >> 1];
-            b = p[(i + 1) >> 1];
-            p[i]     = (3 * a + b + 1) >> 2;
-            p[i + 1] = (a + 3 * b + 1) >> 2;
-        }
-    }
-}
-
-av_cold void ff_mss2dsp_init(MSS2DSPContext* dsp)
-{
-    dsp->mss2_blit_wmv9        = mss2_blit_wmv9_c;
-    dsp->mss2_blit_wmv9_masked = mss2_blit_wmv9_masked_c;
-    dsp->mss2_gray_fill_masked = mss2_gray_fill_masked_c;
-    dsp->upsample_plane        = upsample_plane_c;
-}
diff --git a/deps/libav/libavcodec/mss2dsp.h b/deps/libav/libavcodec/mss2dsp.h
deleted file mode 100644
index 61c3a04..0000000
--- a/deps/libav/libavcodec/mss2dsp.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder DSP routines
- */
-
-#ifndef AVCODEC_MSS2DSP_H
-#define AVCODEC_MSS2DSP_H
-
-#include <stdint.h>
-
-typedef struct MSS2DSPContext {
-    void (*mss2_blit_wmv9)(uint8_t *dst, int dst_stride,
-                           const uint8_t *srcy, int srcy_stride,
-                           const uint8_t *srcu, const uint8_t *srcv,
-                           int srcuv_stride, int w, int h);
-    void (*mss2_blit_wmv9_masked)(uint8_t *dst, int dst_stride,
-                                  int maskcolor, const uint8_t *mask,
-                                  int mask_stride,
-                                  const uint8_t *srcy, int srcy_stride,
-                                  const uint8_t *srcu, const uint8_t *srcv,
-                                  int srcuv_stride, int w, int h);
-    void (*mss2_gray_fill_masked)(uint8_t *dst, int dst_stride,
-                                  int maskcolor, const uint8_t *mask,
-                                  int mask_stride, int w, int h);
-    void (*upsample_plane)(uint8_t *plane, int plane_stride, int w, int h);
-} MSS2DSPContext;
-
-void ff_mss2dsp_init(MSS2DSPContext *dsp);
-
-#endif /* AVCODEC_MSS2DSP_H */
diff --git a/deps/libav/libavcodec/mss3.c b/deps/libav/libavcodec/mss3.c
deleted file mode 100644
index c5e29a3..0000000
--- a/deps/libav/libavcodec/mss3.c
+++ /dev/null
@@ -1,874 +0,0 @@
-/*
- * Microsoft Screen 3 (aka Microsoft ATC Screen) decoder
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Microsoft Screen 3 (aka Microsoft ATC Screen) decoder
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "mss34dsp.h"
-
-#define HEADER_SIZE 27
-
-#define MODEL2_SCALE       13
-#define MODEL_SCALE        15
-#define MODEL256_SEC_SCALE  9
-
-typedef struct Model2 {
-    int      upd_val, till_rescale;
-    unsigned zero_freq,  zero_weight;
-    unsigned total_freq, total_weight;
-} Model2;
-
-typedef struct Model {
-    int weights[16], freqs[16];
-    int num_syms;
-    int tot_weight;
-    int upd_val, max_upd_val, till_rescale;
-} Model;
-
-typedef struct Model256 {
-    int weights[256], freqs[256];
-    int tot_weight;
-    int secondary[68];
-    int sec_size;
-    int upd_val, max_upd_val, till_rescale;
-} Model256;
-
-#define RAC_BOTTOM 0x01000000
-typedef struct RangeCoder {
-    const uint8_t *src, *src_end;
-
-    uint32_t range, low;
-    int got_error;
-} RangeCoder;
-
-enum BlockType {
-    FILL_BLOCK = 0,
-    IMAGE_BLOCK,
-    DCT_BLOCK,
-    HAAR_BLOCK,
-    SKIP_BLOCK
-};
-
-typedef struct BlockTypeContext {
-    int      last_type;
-    Model    bt_model[5];
-} BlockTypeContext;
-
-typedef struct FillBlockCoder {
-    int      fill_val;
-    Model    coef_model;
-} FillBlockCoder;
-
-typedef struct ImageBlockCoder {
-    Model256 esc_model, vec_entry_model;
-    Model    vec_size_model;
-    Model    vq_model[125];
-} ImageBlockCoder;
-
-typedef struct DCTBlockCoder {
-    int      *prev_dc;
-    int      prev_dc_stride;
-    int      prev_dc_height;
-    int      quality;
-    uint16_t qmat[64];
-    Model    dc_model;
-    Model2   sign_model;
-    Model256 ac_model;
-} DCTBlockCoder;
-
-typedef struct HaarBlockCoder {
-    int      quality, scale;
-    Model256 coef_model;
-    Model    coef_hi_model;
-} HaarBlockCoder;
-
-typedef struct MSS3Context {
-    AVCodecContext   *avctx;
-    AVFrame          *pic;
-
-    int              got_error;
-    RangeCoder       coder;
-    BlockTypeContext btype[3];
-    FillBlockCoder   fill_coder[3];
-    ImageBlockCoder  image_coder[3];
-    DCTBlockCoder    dct_coder[3];
-    HaarBlockCoder   haar_coder[3];
-
-    int              dctblock[64];
-    int              hblock[16 * 16];
-} MSS3Context;
-
-
-static void model2_reset(Model2 *m)
-{
-    m->zero_weight  = 1;
-    m->total_weight = 2;
-    m->zero_freq    = 0x1000;
-    m->total_freq   = 0x2000;
-    m->upd_val      = 4;
-    m->till_rescale = 4;
-}
-
-static void model2_update(Model2 *m, int bit)
-{
-    unsigned scale;
-
-    if (!bit)
-        m->zero_weight++;
-    m->till_rescale--;
-    if (m->till_rescale)
-        return;
-
-    m->total_weight += m->upd_val;
-    if (m->total_weight > 0x2000) {
-        m->total_weight = (m->total_weight + 1) >> 1;
-        m->zero_weight  = (m->zero_weight  + 1) >> 1;
-        if (m->total_weight == m->zero_weight)
-            m->total_weight = m->zero_weight + 1;
-    }
-    m->upd_val = m->upd_val * 5 >> 2;
-    if (m->upd_val > 64)
-        m->upd_val = 64;
-    scale = 0x80000000u / m->total_weight;
-    m->zero_freq    = m->zero_weight  * scale >> 18;
-    m->total_freq   = m->total_weight * scale >> 18;
-    m->till_rescale = m->upd_val;
-}
-
-static void model_update(Model *m, int val)
-{
-    int i, sum = 0;
-    unsigned scale;
-
-    m->weights[val]++;
-    m->till_rescale--;
-    if (m->till_rescale)
-        return;
-    m->tot_weight += m->upd_val;
-
-    if (m->tot_weight > 0x8000) {
-        m->tot_weight = 0;
-        for (i = 0; i < m->num_syms; i++) {
-            m->weights[i]  = (m->weights[i] + 1) >> 1;
-            m->tot_weight +=  m->weights[i];
-        }
-    }
-    scale = 0x80000000u / m->tot_weight;
-    for (i = 0; i < m->num_syms; i++) {
-        m->freqs[i] = sum * scale >> 16;
-        sum += m->weights[i];
-    }
-
-    m->upd_val = m->upd_val * 5 >> 2;
-    if (m->upd_val > m->max_upd_val)
-        m->upd_val = m->max_upd_val;
-    m->till_rescale = m->upd_val;
-}
-
-static void model_reset(Model *m)
-{
-    int i;
-
-    m->tot_weight   = 0;
-    for (i = 0; i < m->num_syms - 1; i++)
-        m->weights[i] = 1;
-    m->weights[m->num_syms - 1] = 0;
-
-    m->upd_val      = m->num_syms;
-    m->till_rescale = 1;
-    model_update(m, m->num_syms - 1);
-    m->till_rescale =
-    m->upd_val      = (m->num_syms + 6) >> 1;
-}
-
-static av_cold void model_init(Model *m, int num_syms)
-{
-    m->num_syms    = num_syms;
-    m->max_upd_val = 8 * num_syms + 48;
-
-    model_reset(m);
-}
-
-static void model256_update(Model256 *m, int val)
-{
-    int i, sum = 0;
-    unsigned scale;
-    int send, sidx = 1;
-
-    m->weights[val]++;
-    m->till_rescale--;
-    if (m->till_rescale)
-        return;
-    m->tot_weight += m->upd_val;
-
-    if (m->tot_weight > 0x8000) {
-        m->tot_weight = 0;
-        for (i = 0; i < 256; i++) {
-            m->weights[i]  = (m->weights[i] + 1) >> 1;
-            m->tot_weight +=  m->weights[i];
-        }
-    }
-    scale = 0x80000000u / m->tot_weight;
-    m->secondary[0] = 0;
-    for (i = 0; i < 256; i++) {
-        m->freqs[i] = sum * scale >> 16;
-        sum += m->weights[i];
-        send = m->freqs[i] >> MODEL256_SEC_SCALE;
-        while (sidx <= send)
-            m->secondary[sidx++] = i - 1;
-    }
-    while (sidx < m->sec_size)
-        m->secondary[sidx++] = 255;
-
-    m->upd_val = m->upd_val * 5 >> 2;
-    if (m->upd_val > m->max_upd_val)
-        m->upd_val = m->max_upd_val;
-    m->till_rescale = m->upd_val;
-}
-
-static void model256_reset(Model256 *m)
-{
-    int i;
-
-    for (i = 0; i < 255; i++)
-        m->weights[i] = 1;
-    m->weights[255] = 0;
-
-    m->tot_weight   = 0;
-    m->upd_val      = 256;
-    m->till_rescale = 1;
-    model256_update(m, 255);
-    m->till_rescale =
-    m->upd_val      = (256 + 6) >> 1;
-}
-
-static av_cold void model256_init(Model256 *m)
-{
-    m->max_upd_val = 8 * 256 + 48;
-    m->sec_size    = (1 << 6) + 2;
-
-    model256_reset(m);
-}
-
-static void rac_init(RangeCoder *c, const uint8_t *src, int size)
-{
-    int i;
-
-    c->src       = src;
-    c->src_end   = src + size;
-    c->low       = 0;
-    for (i = 0; i < FFMIN(size, 4); i++)
-        c->low = (c->low << 8) | *c->src++;
-    c->range     = 0xFFFFFFFF;
-    c->got_error = 0;
-}
-
-static void rac_normalise(RangeCoder *c)
-{
-    for (;;) {
-        c->range <<= 8;
-        c->low   <<= 8;
-        if (c->src < c->src_end) {
-            c->low |= *c->src++;
-        } else if (!c->low) {
-            c->got_error = 1;
-            return;
-        }
-        if (c->range >= RAC_BOTTOM)
-            return;
-    }
-}
-
-static int rac_get_bit(RangeCoder *c)
-{
-    int bit;
-
-    c->range >>= 1;
-
-    bit = (c->range <= c->low);
-    if (bit)
-        c->low -= c->range;
-
-    if (c->range < RAC_BOTTOM)
-        rac_normalise(c);
-
-    return bit;
-}
-
-static int rac_get_bits(RangeCoder *c, int nbits)
-{
-    int val;
-
-    c->range >>= nbits;
-    val = c->low / c->range;
-    c->low -= c->range * val;
-
-    if (c->range < RAC_BOTTOM)
-        rac_normalise(c);
-
-    return val;
-}
-
-static int rac_get_model2_sym(RangeCoder *c, Model2 *m)
-{
-    int bit, helper;
-
-    helper = m->zero_freq * (c->range >> MODEL2_SCALE);
-    bit    = (c->low >= helper);
-    if (bit) {
-        c->low   -= helper;
-        c->range -= helper;
-    } else {
-        c->range  = helper;
-    }
-
-    if (c->range < RAC_BOTTOM)
-        rac_normalise(c);
-
-    model2_update(m, bit);
-
-    return bit;
-}
-
-static int rac_get_model_sym(RangeCoder *c, Model *m)
-{
-    int prob, prob2, helper, val;
-    int end, end2;
-
-    prob       = 0;
-    prob2      = c->range;
-    c->range >>= MODEL_SCALE;
-    val        = 0;
-    end        = m->num_syms >> 1;
-    end2       = m->num_syms;
-    do {
-        helper = m->freqs[end] * c->range;
-        if (helper <= c->low) {
-            val   = end;
-            prob  = helper;
-        } else {
-            end2  = end;
-            prob2 = helper;
-        }
-        end = (end2 + val) >> 1;
-    } while (end != val);
-    c->low  -= prob;
-    c->range = prob2 - prob;
-    if (c->range < RAC_BOTTOM)
-        rac_normalise(c);
-
-    model_update(m, val);
-
-    return val;
-}
-
-static int rac_get_model256_sym(RangeCoder *c, Model256 *m)
-{
-    int prob, prob2, helper, val;
-    int start, end;
-    int ssym;
-
-    prob2      = c->range;
-    c->range >>= MODEL_SCALE;
-
-    helper     = c->low / c->range;
-    ssym       = helper >> MODEL256_SEC_SCALE;
-    val        = m->secondary[ssym];
-
-    end = start = m->secondary[ssym + 1] + 1;
-    while (end > val + 1) {
-        ssym = (end + val) >> 1;
-        if (m->freqs[ssym] <= helper) {
-            end = start;
-            val = ssym;
-        } else {
-            end   = (end + val) >> 1;
-            start = ssym;
-        }
-    }
-    prob = m->freqs[val] * c->range;
-    if (val != 255)
-        prob2 = m->freqs[val + 1] * c->range;
-
-    c->low  -= prob;
-    c->range = prob2 - prob;
-    if (c->range < RAC_BOTTOM)
-        rac_normalise(c);
-
-    model256_update(m, val);
-
-    return val;
-}
-
-static int decode_block_type(RangeCoder *c, BlockTypeContext *bt)
-{
-    bt->last_type = rac_get_model_sym(c, &bt->bt_model[bt->last_type]);
-
-    return bt->last_type;
-}
-
-static int decode_coeff(RangeCoder *c, Model *m)
-{
-    int val, sign;
-
-    val = rac_get_model_sym(c, m);
-    if (val) {
-        sign = rac_get_bit(c);
-        if (val > 1) {
-            val--;
-            val = (1 << val) + rac_get_bits(c, val);
-        }
-        if (!sign)
-            val = -val;
-    }
-
-    return val;
-}
-
-static void decode_fill_block(RangeCoder *c, FillBlockCoder *fc,
-                              uint8_t *dst, int stride, int block_size)
-{
-    int i;
-
-    fc->fill_val += decode_coeff(c, &fc->coef_model);
-
-    for (i = 0; i < block_size; i++, dst += stride)
-        memset(dst, fc->fill_val, block_size);
-}
-
-static void decode_image_block(RangeCoder *c, ImageBlockCoder *ic,
-                               uint8_t *dst, int stride, int block_size)
-{
-    int i, j;
-    int vec_size;
-    int vec[4];
-    int prev_line[16];
-    int A, B, C;
-
-    vec_size = rac_get_model_sym(c, &ic->vec_size_model) + 2;
-    for (i = 0; i < vec_size; i++)
-        vec[i] = rac_get_model256_sym(c, &ic->vec_entry_model);
-    for (; i < 4; i++)
-        vec[i] = 0;
-    memset(prev_line, 0, sizeof(prev_line));
-
-    for (j = 0; j < block_size; j++) {
-        A = 0;
-        B = 0;
-        for (i = 0; i < block_size; i++) {
-            C = B;
-            B = prev_line[i];
-            A = rac_get_model_sym(c, &ic->vq_model[A + B * 5 + C * 25]);
-
-            prev_line[i] = A;
-            if (A < 4)
-               dst[i] = vec[A];
-            else
-               dst[i] = rac_get_model256_sym(c, &ic->esc_model);
-        }
-        dst += stride;
-    }
-}
-
-static int decode_dct(RangeCoder *c, DCTBlockCoder *bc, int *block,
-                      int bx, int by)
-{
-    int skip, val, sign, pos = 1, zz_pos, dc;
-    int blk_pos = bx + by * bc->prev_dc_stride;
-
-    memset(block, 0, sizeof(*block) * 64);
-
-    dc = decode_coeff(c, &bc->dc_model);
-    if (by) {
-        if (bx) {
-            int l, tl, t;
-
-            l  = bc->prev_dc[blk_pos - 1];
-            tl = bc->prev_dc[blk_pos - 1 - bc->prev_dc_stride];
-            t  = bc->prev_dc[blk_pos     - bc->prev_dc_stride];
-
-            if (FFABS(t - tl) <= FFABS(l - tl))
-                dc += l;
-            else
-                dc += t;
-        } else {
-            dc += bc->prev_dc[blk_pos - bc->prev_dc_stride];
-        }
-    } else if (bx) {
-        dc += bc->prev_dc[bx - 1];
-    }
-    bc->prev_dc[blk_pos] = dc;
-    block[0]             = dc * bc->qmat[0];
-
-    while (pos < 64) {
-        val = rac_get_model256_sym(c, &bc->ac_model);
-        if (!val)
-            return 0;
-        if (val == 0xF0) {
-            pos += 16;
-            continue;
-        }
-        skip = val >> 4;
-        val  = val & 0xF;
-        if (!val)
-            return -1;
-        pos += skip;
-        if (pos >= 64)
-            return -1;
-
-        sign = rac_get_model2_sym(c, &bc->sign_model);
-        if (val > 1) {
-            val--;
-            val = (1 << val) + rac_get_bits(c, val);
-        }
-        if (!sign)
-            val = -val;
-
-        zz_pos = ff_zigzag_direct[pos];
-        block[zz_pos] = val * bc->qmat[zz_pos];
-        pos++;
-    }
-
-    return pos == 64 ? 0 : -1;
-}
-
-static void decode_dct_block(RangeCoder *c, DCTBlockCoder *bc,
-                             uint8_t *dst, int stride, int block_size,
-                             int *block, int mb_x, int mb_y)
-{
-    int i, j;
-    int bx, by;
-    int nblocks = block_size >> 3;
-
-    bx = mb_x * nblocks;
-    by = mb_y * nblocks;
-
-    for (j = 0; j < nblocks; j++) {
-        for (i = 0; i < nblocks; i++) {
-            if (decode_dct(c, bc, block, bx + i, by + j)) {
-                c->got_error = 1;
-                return;
-            }
-            ff_mss34_dct_put(dst + i * 8, stride, block);
-        }
-        dst += 8 * stride;
-    }
-}
-
-static void decode_haar_block(RangeCoder *c, HaarBlockCoder *hc,
-                              uint8_t *dst, int stride, int block_size,
-                              int *block)
-{
-    const int hsize = block_size >> 1;
-    int A, B, C, D, t1, t2, t3, t4;
-    int i, j;
-
-    for (j = 0; j < block_size; j++) {
-        for (i = 0; i < block_size; i++) {
-            if (i < hsize && j < hsize)
-                block[i] = rac_get_model256_sym(c, &hc->coef_model);
-            else
-                block[i] = decode_coeff(c, &hc->coef_hi_model);
-            block[i] *= hc->scale;
-        }
-        block += block_size;
-    }
-    block -= block_size * block_size;
-
-    for (j = 0; j < hsize; j++) {
-        for (i = 0; i < hsize; i++) {
-            A = block[i];
-            B = block[i + hsize];
-            C = block[i + hsize * block_size];
-            D = block[i + hsize * block_size + hsize];
-
-            t1 = A - B;
-            t2 = C - D;
-            t3 = A + B;
-            t4 = C + D;
-            dst[i * 2]              = av_clip_uint8(t1 - t2);
-            dst[i * 2 + stride]     = av_clip_uint8(t1 + t2);
-            dst[i * 2 + 1]          = av_clip_uint8(t3 - t4);
-            dst[i * 2 + 1 + stride] = av_clip_uint8(t3 + t4);
-        }
-        block += block_size;
-        dst   += stride * 2;
-    }
-}
-
-static void reset_coders(MSS3Context *ctx, int quality)
-{
-    int i, j;
-
-    for (i = 0; i < 3; i++) {
-        ctx->btype[i].last_type = SKIP_BLOCK;
-        for (j = 0; j < 5; j++)
-            model_reset(&ctx->btype[i].bt_model[j]);
-        ctx->fill_coder[i].fill_val = 0;
-        model_reset(&ctx->fill_coder[i].coef_model);
-        model256_reset(&ctx->image_coder[i].esc_model);
-        model256_reset(&ctx->image_coder[i].vec_entry_model);
-        model_reset(&ctx->image_coder[i].vec_size_model);
-        for (j = 0; j < 125; j++)
-            model_reset(&ctx->image_coder[i].vq_model[j]);
-        if (ctx->dct_coder[i].quality != quality) {
-            ctx->dct_coder[i].quality = quality;
-            ff_mss34_gen_quant_mat(ctx->dct_coder[i].qmat, quality, !i);
-        }
-        memset(ctx->dct_coder[i].prev_dc, 0,
-               sizeof(*ctx->dct_coder[i].prev_dc) *
-               ctx->dct_coder[i].prev_dc_stride *
-               ctx->dct_coder[i].prev_dc_height);
-        model_reset(&ctx->dct_coder[i].dc_model);
-        model2_reset(&ctx->dct_coder[i].sign_model);
-        model256_reset(&ctx->dct_coder[i].ac_model);
-        if (ctx->haar_coder[i].quality != quality) {
-            ctx->haar_coder[i].quality = quality;
-            ctx->haar_coder[i].scale   = 17 - 7 * quality / 50;
-        }
-        model_reset(&ctx->haar_coder[i].coef_hi_model);
-        model256_reset(&ctx->haar_coder[i].coef_model);
-    }
-}
-
-static av_cold void init_coders(MSS3Context *ctx)
-{
-    int i, j;
-
-    for (i = 0; i < 3; i++) {
-        for (j = 0; j < 5; j++)
-            model_init(&ctx->btype[i].bt_model[j], 5);
-        model_init(&ctx->fill_coder[i].coef_model, 12);
-        model256_init(&ctx->image_coder[i].esc_model);
-        model256_init(&ctx->image_coder[i].vec_entry_model);
-        model_init(&ctx->image_coder[i].vec_size_model, 3);
-        for (j = 0; j < 125; j++)
-            model_init(&ctx->image_coder[i].vq_model[j], 5);
-        model_init(&ctx->dct_coder[i].dc_model, 12);
-        model256_init(&ctx->dct_coder[i].ac_model);
-        model_init(&ctx->haar_coder[i].coef_hi_model, 12);
-        model256_init(&ctx->haar_coder[i].coef_model);
-    }
-}
-
-static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MSS3Context *c = avctx->priv_data;
-    RangeCoder *acoder = &c->coder;
-    GetByteContext gb;
-    uint8_t *dst[3];
-    int dec_width, dec_height, dec_x, dec_y, quality, keyframe;
-    int x, y, i, mb_width, mb_height, blk_size, btype;
-    int ret;
-
-    if (buf_size < HEADER_SIZE) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Frame should have at least %d bytes, got %d instead\n",
-               HEADER_SIZE, buf_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    bytestream2_init(&gb, buf, buf_size);
-    keyframe   = bytestream2_get_be32(&gb);
-    if (keyframe & ~0x301) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame type %X\n", keyframe);
-        return AVERROR_INVALIDDATA;
-    }
-    keyframe   = !(keyframe & 1);
-    bytestream2_skip(&gb, 6);
-    dec_x      = bytestream2_get_be16(&gb);
-    dec_y      = bytestream2_get_be16(&gb);
-    dec_width  = bytestream2_get_be16(&gb);
-    dec_height = bytestream2_get_be16(&gb);
-
-    if (dec_x + dec_width > avctx->width ||
-        dec_y + dec_height > avctx->height ||
-        (dec_width | dec_height) & 0xF) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame dimensions %dx%d +%d,%d\n",
-               dec_width, dec_height, dec_x, dec_y);
-        return AVERROR_INVALIDDATA;
-    }
-    bytestream2_skip(&gb, 4);
-    quality    = bytestream2_get_byte(&gb);
-    if (quality < 1 || quality > 100) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid quality setting %d\n", quality);
-        return AVERROR_INVALIDDATA;
-    }
-    bytestream2_skip(&gb, 4);
-
-    if (keyframe && !bytestream2_get_bytes_left(&gb)) {
-        av_log(avctx, AV_LOG_ERROR, "Keyframe without data found\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (!keyframe && c->got_error)
-        return buf_size;
-    c->got_error = 0;
-
-    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-    c->pic->key_frame = keyframe;
-    c->pic->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
-    if (!bytestream2_get_bytes_left(&gb)) {
-        if ((ret = av_frame_ref(data, c->pic)) < 0)
-            return ret;
-        *got_frame      = 1;
-
-        return buf_size;
-    }
-
-    reset_coders(c, quality);
-
-    rac_init(acoder, buf + HEADER_SIZE, buf_size - HEADER_SIZE);
-
-    mb_width  = dec_width  >> 4;
-    mb_height = dec_height >> 4;
-    dst[0] = c->pic->data[0] + dec_x     +  dec_y      * c->pic->linesize[0];
-    dst[1] = c->pic->data[1] + dec_x / 2 + (dec_y / 2) * c->pic->linesize[1];
-    dst[2] = c->pic->data[2] + dec_x / 2 + (dec_y / 2) * c->pic->linesize[2];
-    for (y = 0; y < mb_height; y++) {
-        for (x = 0; x < mb_width; x++) {
-            for (i = 0; i < 3; i++) {
-                blk_size = 8 << !i;
-
-                btype = decode_block_type(acoder, c->btype + i);
-                switch (btype) {
-                case FILL_BLOCK:
-                    decode_fill_block(acoder, c->fill_coder + i,
-                                      dst[i] + x * blk_size,
-                                      c->pic->linesize[i], blk_size);
-                    break;
-                case IMAGE_BLOCK:
-                    decode_image_block(acoder, c->image_coder + i,
-                                       dst[i] + x * blk_size,
-                                       c->pic->linesize[i], blk_size);
-                    break;
-                case DCT_BLOCK:
-                    decode_dct_block(acoder, c->dct_coder + i,
-                                     dst[i] + x * blk_size,
-                                     c->pic->linesize[i], blk_size,
-                                     c->dctblock, x, y);
-                    break;
-                case HAAR_BLOCK:
-                    decode_haar_block(acoder, c->haar_coder + i,
-                                      dst[i] + x * blk_size,
-                                      c->pic->linesize[i], blk_size,
-                                      c->hblock);
-                    break;
-                }
-                if (c->got_error || acoder->got_error) {
-                    av_log(avctx, AV_LOG_ERROR, "Error decoding block %d,%d\n",
-                           x, y);
-                    c->got_error = 1;
-                    return AVERROR_INVALIDDATA;
-                }
-            }
-        }
-        dst[0] += c->pic->linesize[0] * 16;
-        dst[1] += c->pic->linesize[1] * 8;
-        dst[2] += c->pic->linesize[2] * 8;
-    }
-
-    if ((ret = av_frame_ref(data, c->pic)) < 0)
-        return ret;
-
-    *got_frame      = 1;
-
-    return buf_size;
-}
-
-static av_cold int mss3_decode_end(AVCodecContext *avctx)
-{
-    MSS3Context * const c = avctx->priv_data;
-    int i;
-
-    av_frame_free(&c->pic);
-    for (i = 0; i < 3; i++)
-        av_freep(&c->dct_coder[i].prev_dc);
-
-    return 0;
-}
-
-static av_cold int mss3_decode_init(AVCodecContext *avctx)
-{
-    MSS3Context * const c = avctx->priv_data;
-    int i;
-
-    c->avctx = avctx;
-
-    if ((avctx->width & 0xF) || (avctx->height & 0xF)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Image dimensions should be a multiple of 16.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    c->got_error = 0;
-    for (i = 0; i < 3; i++) {
-        int b_width  = avctx->width  >> (2 + !!i);
-        int b_height = avctx->height >> (2 + !!i);
-        c->dct_coder[i].prev_dc_stride = b_width;
-        c->dct_coder[i].prev_dc_height = b_height;
-        c->dct_coder[i].prev_dc = av_malloc(sizeof(*c->dct_coder[i].prev_dc) *
-                                            b_width * b_height);
-        if (!c->dct_coder[i].prev_dc) {
-            av_log(avctx, AV_LOG_ERROR, "Cannot allocate buffer\n");
-            while (i >= 0) {
-                av_freep(&c->dct_coder[i].prev_dc);
-                i--;
-            }
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    c->pic = av_frame_alloc();
-    if (!c->pic) {
-        mss3_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    avctx->pix_fmt     = AV_PIX_FMT_YUV420P;
-
-    init_coders(c);
-
-    return 0;
-}
-
-AVCodec ff_msa1_decoder = {
-    .name           = "msa1",
-    .long_name      = NULL_IF_CONFIG_SMALL("MS ATC Screen"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSA1,
-    .priv_data_size = sizeof(MSS3Context),
-    .init           = mss3_decode_init,
-    .close          = mss3_decode_end,
-    .decode         = mss3_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/mss34dsp.c b/deps/libav/libavcodec/mss34dsp.c
deleted file mode 100644
index 11abb2d..0000000
--- a/deps/libav/libavcodec/mss34dsp.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Common stuff for some Microsoft Screen codecs
- * Copyright (C) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include "libavutil/common.h"
-#include "mss34dsp.h"
-
-static const uint8_t luma_quant[64] = {
-    16,  11,  10,  16,  24,  40,  51,  61,
-    12,  12,  14,  19,  26,  58,  60,  55,
-    14,  13,  16,  24,  40,  57,  69,  56,
-    14,  17,  22,  29,  51,  87,  80,  62,
-    18,  22,  37,  56,  68, 109, 103,  77,
-    24,  35,  55,  64,  81, 104, 113,  92,
-    49,  64,  78,  87, 103, 121, 120, 101,
-    72,  92,  95,  98, 112, 100, 103,  99
-};
-
-static const uint8_t chroma_quant[64] = {
-    17, 18, 24, 47, 99, 99, 99, 99,
-    18, 21, 26, 66, 99, 99, 99, 99,
-    24, 26, 56, 99, 99, 99, 99, 99,
-    47, 66, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99
-};
-
-void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma)
-{
-    int i;
-    const uint8_t *qsrc = luma ? luma_quant : chroma_quant;
-
-    if (quality >= 50) {
-        int scale = 200 - 2 * quality;
-
-        for (i = 0; i < 64; i++)
-            qmat[i] = (qsrc[i] * scale + 50) / 100;
-    } else {
-        for (i = 0; i < 64; i++)
-            qmat[i] = (5000 * qsrc[i] / quality + 50) / 100;
-    }
-}
-
-#define DCT_TEMPLATE(blk, step, SOP, shift)                         \
-    const int t0 = -39409 * blk[7 * step] -  58980 * blk[1 * step]; \
-    const int t1 =  39410 * blk[1 * step] -  58980 * blk[7 * step]; \
-    const int t2 = -33410 * blk[5 * step] - 167963 * blk[3 * step]; \
-    const int t3 =  33410 * blk[3 * step] - 167963 * blk[5 * step]; \
-    const int t4 =          blk[3 * step] +          blk[7 * step]; \
-    const int t5 =          blk[1 * step] +          blk[5 * step]; \
-    const int t6 =  77062 * t4            +  51491 * t5;            \
-    const int t7 =  77062 * t5            -  51491 * t4;            \
-    const int t8 =  35470 * blk[2 * step] -  85623 * blk[6 * step]; \
-    const int t9 =  35470 * blk[6 * step] +  85623 * blk[2 * step]; \
-    const int tA = SOP(blk[0 * step] - blk[4 * step]);              \
-    const int tB = SOP(blk[0 * step] + blk[4 * step]);              \
-                                                                    \
-    blk[0 * step] = (  t1 + t6  + t9 + tB) >> shift;                \
-    blk[1 * step] = (  t3 + t7  + t8 + tA) >> shift;                \
-    blk[2 * step] = (  t2 + t6  - t8 + tA) >> shift;                \
-    blk[3 * step] = (  t0 + t7  - t9 + tB) >> shift;                \
-    blk[4 * step] = (-(t0 + t7) - t9 + tB) >> shift;                \
-    blk[5 * step] = (-(t2 + t6) - t8 + tA) >> shift;                \
-    blk[6 * step] = (-(t3 + t7) + t8 + tA) >> shift;                \
-    blk[7 * step] = (-(t1 + t6) + t9 + tB) >> shift;                \
-
-#define SOP_ROW(a) ((a) << 16) + 0x2000
-#define SOP_COL(a) ((a + 32) << 16)
-
-void ff_mss34_dct_put(uint8_t *dst, int stride, int *block)
-{
-    int i, j;
-    int *ptr;
-
-    ptr = block;
-    for (i = 0; i < 8; i++) {
-        DCT_TEMPLATE(ptr, 1, SOP_ROW, 13);
-        ptr += 8;
-    }
-
-    ptr = block;
-    for (i = 0; i < 8; i++) {
-        DCT_TEMPLATE(ptr, 8, SOP_COL, 22);
-        ptr++;
-    }
-
-    ptr = block;
-    for (j = 0; j < 8; j++) {
-        for (i = 0; i < 8; i++)
-            dst[i] = av_clip_uint8(ptr[i] + 128);
-        dst += stride;
-        ptr += 8;
-    }
-}
diff --git a/deps/libav/libavcodec/mss34dsp.h b/deps/libav/libavcodec/mss34dsp.h
deleted file mode 100644
index b2cc550..0000000
--- a/deps/libav/libavcodec/mss34dsp.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Common stuff for some Microsoft Screen codecs
- * Copyright (C) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_MSS34DSP_H
-#define AVCODEC_MSS34DSP_H
-
-#include <stdint.h>
-
-/**
- * Generate quantisation matrix for given quality.
- *
- * @param qmat    destination matrix
- * @param quality quality setting (1-100)
- * @param luma    generate quantisation matrix for luma or chroma
- */
-void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma);
-
-/**
- * Transform and output DCT block.
- *
- * @param dst     output plane
- * @param stride  output plane stride
- * @param block   block to transform and output
- */
-void ff_mss34_dct_put(uint8_t *dst, int stride, int *block);
-
-#endif /* AVCODEC_MSS34DSP_H */
diff --git a/deps/libav/libavcodec/mss4.c b/deps/libav/libavcodec/mss4.c
deleted file mode 100644
index fa85258..0000000
--- a/deps/libav/libavcodec/mss4.c
+++ /dev/null
@@ -1,685 +0,0 @@
-/*
- * Microsoft Screen 4 (aka Microsoft Expression Encoder Screen) decoder
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Microsoft Screen 4 (aka Microsoft Titanium Screen 2,
- * aka Microsoft Expression Encoder Screen) decoder
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "mss34dsp.h"
-#include "unary.h"
-
-#define HEADER_SIZE 8
-
-enum FrameType {
-    INTRA_FRAME = 0,
-    INTER_FRAME,
-    SKIP_FRAME
-};
-
-enum BlockType {
-    SKIP_BLOCK = 0,
-    DCT_BLOCK,
-    IMAGE_BLOCK,
-};
-
-enum CachePos {
-    LEFT = 0,
-    TOP_LEFT,
-    TOP,
-};
-
-static const uint8_t mss4_dc_vlc_lens[2][16] = {
-    { 0, 1, 5, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 0, 3, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0 }
-};
-
-static const uint8_t mss4_ac_vlc_lens[2][16] = {
-    { 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125 },
-    { 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119 }
-};
-
-static const uint8_t mss4_ac_vlc_syms[2][162] = {
-  { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
-    0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
-    0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08,
-    0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0,
-    0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16,
-    0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28,
-    0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
-    0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
-    0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
-    0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
-    0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
-    0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
-    0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
-    0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
-    0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6,
-    0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5,
-    0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4,
-    0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2,
-    0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA,
-    0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8,
-    0xF9, 0xFA  },
-  { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
-    0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
-    0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
-    0xA1, 0xB1, 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0,
-    0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34,
-    0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26,
-    0x27, 0x28, 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38,
-    0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
-    0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
-    0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
-    0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
-    0x79, 0x7A, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-    0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96,
-    0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5,
-    0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4,
-    0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3,
-    0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2,
-    0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA,
-    0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9,
-    0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8,
-    0xF9, 0xFA  }
-};
-
-static const uint8_t vec_len_syms[2][4] = {
-    { 4, 2, 3, 1 },
-    { 4, 1, 2, 3 }
-};
-
-static const uint8_t mss4_vec_entry_vlc_lens[2][16] = {
-    { 0, 2, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 0, 1, 5, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-static const uint8_t mss4_vec_entry_vlc_syms[2][9] = {
-    { 0, 7, 6, 5, 8, 4, 3, 1, 2 },
-    { 0, 2, 3, 4, 5, 6, 7, 1, 8 }
-};
-
-#define MAX_ENTRIES  162
-
-typedef struct MSS4Context {
-    AVFrame   *pic;
-
-    VLC        dc_vlc[2], ac_vlc[2];
-    VLC        vec_entry_vlc[2];
-    int        block[64];
-    uint8_t    imgbuf[3][16 * 16];
-
-    int        quality;
-    uint16_t   quant_mat[2][64];
-
-    int        *prev_dc[3];
-    int        dc_stride[3];
-    int        dc_cache[4][4];
-
-    int        prev_vec[3][4];
-} MSS4Context;
-
-static av_cold int mss4_init_vlc(VLC *vlc, const uint8_t *lens,
-                                 const uint8_t *syms, int num_syms)
-{
-    uint8_t  bits[MAX_ENTRIES];
-    uint16_t codes[MAX_ENTRIES];
-    int i, j;
-    int prefix = 0, max_bits = 0, idx = 0;
-
-    for (i = 0; i < 16; i++) {
-        for (j = 0; j < lens[i]; j++) {
-            bits[idx]  = i + 1;
-            codes[idx] = prefix++;
-            max_bits   = i + 1;
-            idx++;
-        }
-        prefix <<= 1;
-    }
-
-    return ff_init_vlc_sparse(vlc, FFMIN(max_bits, 9), num_syms, bits, 1, 1,
-                              codes, 2, 2, syms, 1, 1, 0);
-}
-
-static av_cold int mss4_init_vlcs(MSS4Context *ctx)
-{
-    int ret, i;
-
-    for (i = 0; i < 2; i++) {
-        ret = mss4_init_vlc(&ctx->dc_vlc[i], mss4_dc_vlc_lens[i], NULL, 12);
-        if (ret)
-            return ret;
-        ret = mss4_init_vlc(&ctx->ac_vlc[i], mss4_ac_vlc_lens[i],
-                            mss4_ac_vlc_syms[i], 162);
-        if (ret)
-            return ret;
-        ret = mss4_init_vlc(&ctx->vec_entry_vlc[i], mss4_vec_entry_vlc_lens[i],
-                            mss4_vec_entry_vlc_syms[i], 9);
-        if (ret)
-            return ret;
-    }
-    return 0;
-}
-
-static av_cold void mss4_free_vlcs(MSS4Context *ctx)
-{
-    int i;
-
-    for (i = 0; i < 2; i++) {
-        ff_free_vlc(&ctx->dc_vlc[i]);
-        ff_free_vlc(&ctx->ac_vlc[i]);
-        ff_free_vlc(&ctx->vec_entry_vlc[i]);
-    }
-}
-
-/* This function returns values in the range
- * (-range + 1; -range/2] U [range/2; range - 1)
- * i.e.
- * nbits = 0 -> 0
- * nbits = 1 -> -1, 1
- * nbits = 2 -> -3, -2, 2, 3
- */
-static av_always_inline int get_coeff_bits(GetBitContext *gb, int nbits)
-{
-    int val;
-
-    if (!nbits)
-        return 0;
-
-    val = get_bits(gb, nbits);
-    if (val < (1 << (nbits - 1)))
-        val -= (1 << nbits) - 1;
-
-    return val;
-}
-
-static inline int get_coeff(GetBitContext *gb, VLC *vlc)
-{
-    int val = get_vlc2(gb, vlc->table, vlc->bits, 2);
-
-    return get_coeff_bits(gb, val);
-}
-
-static int mss4_decode_dct(GetBitContext *gb, VLC *dc_vlc, VLC *ac_vlc,
-                           int *block, int *dc_cache,
-                           int bx, int by, uint16_t *quant_mat)
-{
-    int skip, val, pos = 1, zz_pos, dc;
-
-    memset(block, 0, sizeof(*block) * 64);
-
-    dc = get_coeff(gb, dc_vlc);
-    // DC prediction is the same as in MSS3
-    if (by) {
-        if (bx) {
-            int l, tl, t;
-
-            l  = dc_cache[LEFT];
-            tl = dc_cache[TOP_LEFT];
-            t  = dc_cache[TOP];
-
-            if (FFABS(t - tl) <= FFABS(l - tl))
-                dc += l;
-            else
-                dc += t;
-        } else {
-            dc += dc_cache[TOP];
-        }
-    } else if (bx) {
-        dc += dc_cache[LEFT];
-    }
-    dc_cache[LEFT] = dc;
-    block[0]       = dc * quant_mat[0];
-
-    while (pos < 64) {
-        val = get_vlc2(gb, ac_vlc->table, 9, 2);
-        if (!val)
-            return 0;
-        if (val == -1)
-            return -1;
-        if (val == 0xF0) {
-            pos += 16;
-            continue;
-        }
-        skip = val >> 4;
-        val  = get_coeff_bits(gb, val & 0xF);
-        pos += skip;
-        if (pos >= 64)
-            return -1;
-
-        zz_pos = ff_zigzag_direct[pos];
-        block[zz_pos] = val * quant_mat[zz_pos];
-        pos++;
-    }
-
-    return pos == 64 ? 0 : -1;
-}
-
-static int mss4_decode_dct_block(MSS4Context *c, GetBitContext *gb,
-                                 uint8_t *dst[3], int mb_x, int mb_y)
-{
-    int i, j, k, ret;
-    uint8_t *out = dst[0];
-
-    for (j = 0; j < 2; j++) {
-        for (i = 0; i < 2; i++) {
-            int xpos = mb_x * 2 + i;
-            c->dc_cache[j][TOP_LEFT] = c->dc_cache[j][TOP];
-            c->dc_cache[j][TOP]      = c->prev_dc[0][mb_x * 2 + i];
-            ret = mss4_decode_dct(gb, c->dc_vlc, c->ac_vlc, c->block,
-                                  c->dc_cache[j],
-                                  xpos, mb_y * 2 + j, c->quant_mat[0]);
-            if (ret)
-                return ret;
-            c->prev_dc[0][mb_x * 2 + i] = c->dc_cache[j][LEFT];
-
-            ff_mss34_dct_put(out + xpos * 8, c->pic->linesize[0],
-                             c->block);
-        }
-        out += 8 * c->pic->linesize[0];
-    }
-
-    for (i = 1; i < 3; i++) {
-        c->dc_cache[i + 1][TOP_LEFT] = c->dc_cache[i + 1][TOP];
-        c->dc_cache[i + 1][TOP]      = c->prev_dc[i][mb_x];
-        ret = mss4_decode_dct(gb, c->dc_vlc + 1, c->ac_vlc + 1,
-                              c->block, c->dc_cache[i + 1], mb_x, mb_y,
-                              c->quant_mat[1]);
-        if (ret)
-            return ret;
-        c->prev_dc[i][mb_x] = c->dc_cache[i + 1][LEFT];
-
-        ff_mss34_dct_put(c->imgbuf[i], 8, c->block);
-        out = dst[i] + mb_x * 16;
-        // Since the DCT block is coded as YUV420 and the whole frame as YUV444,
-        // we need to scale chroma.
-        for (j = 0; j < 16; j++) {
-            for (k = 0; k < 8; k++)
-                AV_WN16A(out + k * 2, c->imgbuf[i][k + (j & ~1) * 4] * 0x101);
-            out += c->pic->linesize[i];
-        }
-    }
-
-    return 0;
-}
-
-static void read_vec_pos(GetBitContext *gb, int *vec_pos, int *sel_flag,
-                         int *sel_len, int *prev)
-{
-    int i, y_flag = 0;
-
-    for (i = 2; i >= 0; i--) {
-        if (!sel_flag[i]) {
-            vec_pos[i] = 0;
-            continue;
-        }
-        if ((!i && !y_flag) || get_bits1(gb)) {
-            if (sel_len[i] > 0) {
-                int pval = prev[i];
-                vec_pos[i] = get_bits(gb, sel_len[i]);
-                if (vec_pos[i] >= pval)
-                    vec_pos[i]++;
-            } else {
-                vec_pos[i] = !prev[i];
-            }
-            y_flag = 1;
-        } else {
-            vec_pos[i] = prev[i];
-        }
-    }
-}
-
-static int get_value_cached(GetBitContext *gb, int vec_pos, uint8_t *vec,
-                            int vec_size, int component, int shift, int *prev)
-{
-    if (vec_pos < vec_size)
-        return vec[vec_pos];
-    if (!get_bits1(gb))
-        return prev[component];
-    prev[component] = get_bits(gb, 8 - shift) << shift;
-    return prev[component];
-}
-
-#define MKVAL(vals)  (vals[0] | (vals[1] << 3) | (vals[2] << 6))
-
-/* Image mode - the hardest to comprehend MSS4 coding mode.
- *
- * In this mode all three 16x16 blocks are coded together with a method
- * remotely similar to the methods employed in MSS1-MSS3.
- * The idea is that every component has a vector of 1-4 most common symbols
- * and an escape mode for reading new value from the bitstream. Decoding
- * consists of retrieving pixel values from the vector or reading new ones
- * from the bitstream; depending on flags read from the bitstream, these vector
- * positions can be updated or reused from the state of the previous line
- * or previous pixel.
- */
-static int mss4_decode_image_block(MSS4Context *ctx, GetBitContext *gb,
-                                   uint8_t *picdst[3], int mb_x, int mb_y)
-{
-    uint8_t vec[3][4];
-    int     vec_len[3];
-    int     sel_len[3], sel_flag[3];
-    int     i, j, k, mode, split;
-    int     prev_vec1 = 0, prev_split = 0;
-    int     vals[3] = { 0 };
-    int     prev_pix[3] = { 0 };
-    int     prev_mode[16] = { 0 };
-    uint8_t *dst[3];
-
-    const int val_shift = ctx->quality == 100 ? 0 : 2;
-
-    for (i = 0; i < 3; i++)
-        dst[i] = ctx->imgbuf[i];
-
-    for (i = 0; i < 3; i++) {
-        vec_len[i] = vec_len_syms[!!i][get_unary(gb, 0, 3)];
-        for (j = 0; j < vec_len[i]; j++) {
-            vec[i][j]  = get_coeff(gb, &ctx->vec_entry_vlc[!!i]);
-            vec[i][j] += ctx->prev_vec[i][j];
-            ctx->prev_vec[i][j] = vec[i][j];
-        }
-        sel_flag[i] = vec_len[i] > 1;
-        sel_len[i]  = vec_len[i] > 2 ? vec_len[i] - 2 : 0;
-    }
-
-    for (j = 0; j < 16; j++) {
-        if (get_bits1(gb)) {
-            split = 0;
-            if (get_bits1(gb)) {
-                prev_mode[0] = 0;
-                vals[0] = vals[1] = vals[2] = 0;
-                mode = 2;
-            } else {
-                mode = get_bits1(gb);
-                if (mode)
-                    split = get_bits(gb, 4);
-            }
-            for (i = 0; i < 16; i++) {
-                if (mode <= 1) {
-                    vals[0] =  prev_mode[i]       & 7;
-                    vals[1] = (prev_mode[i] >> 3) & 7;
-                    vals[2] =  prev_mode[i] >> 6;
-                    if (mode == 1 && i == split) {
-                        read_vec_pos(gb, vals, sel_flag, sel_len, vals);
-                    }
-                } else if (mode == 2) {
-                    if (get_bits1(gb))
-                        read_vec_pos(gb, vals, sel_flag, sel_len, vals);
-                }
-                for (k = 0; k < 3; k++)
-                    *dst[k]++ = get_value_cached(gb, vals[k], vec[k],
-                                                 vec_len[k], k,
-                                                 val_shift, prev_pix);
-                prev_mode[i] = MKVAL(vals);
-            }
-        } else {
-            if (get_bits1(gb)) {
-                split = get_bits(gb, 4);
-                if (split >= prev_split)
-                    split++;
-                prev_split = split;
-            } else {
-                split = prev_split;
-            }
-            if (split) {
-                vals[0] =  prev_mode[0]       & 7;
-                vals[1] = (prev_mode[0] >> 3) & 7;
-                vals[2] =  prev_mode[0] >> 6;
-                for (i = 0; i < 3; i++) {
-                    for (k = 0; k < split; k++) {
-                        *dst[i]++ = get_value_cached(gb, vals[i], vec[i],
-                                                     vec_len[i], i, val_shift,
-                                                     prev_pix);
-                        prev_mode[k] = MKVAL(vals);
-                    }
-                }
-            }
-
-            if (split != 16) {
-                vals[0] =  prev_vec1       & 7;
-                vals[1] = (prev_vec1 >> 3) & 7;
-                vals[2] =  prev_vec1 >> 6;
-                if (get_bits1(gb)) {
-                    read_vec_pos(gb, vals, sel_flag, sel_len, vals);
-                    prev_vec1 = MKVAL(vals);
-                }
-                for (i = 0; i < 3; i++) {
-                    for (k = 0; k < 16 - split; k++) {
-                        *dst[i]++ = get_value_cached(gb, vals[i], vec[i],
-                                                     vec_len[i], i, val_shift,
-                                                     prev_pix);
-                        prev_mode[split + k] = MKVAL(vals);
-                    }
-                }
-            }
-        }
-    }
-
-    for (i = 0; i < 3; i++)
-        for (j = 0; j < 16; j++)
-            memcpy(picdst[i] + mb_x * 16 + j * ctx->pic->linesize[i],
-                   ctx->imgbuf[i] + j * 16, 16);
-
-    return 0;
-}
-
-static inline void mss4_update_dc_cache(MSS4Context *c, int mb_x)
-{
-    int i;
-
-    c->dc_cache[0][TOP]  = c->prev_dc[0][mb_x * 2 + 1];
-    c->dc_cache[0][LEFT] = 0;
-    c->dc_cache[1][TOP]  = 0;
-    c->dc_cache[1][LEFT] = 0;
-
-    for (i = 0; i < 2; i++)
-        c->prev_dc[0][mb_x * 2 + i] = 0;
-
-    for (i = 1; i < 3; i++) {
-        c->dc_cache[i + 1][TOP]  = c->prev_dc[i][mb_x];
-        c->dc_cache[i + 1][LEFT] = 0;
-        c->prev_dc[i][mb_x]      = 0;
-    }
-}
-
-static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MSS4Context *c = avctx->priv_data;
-    GetBitContext gb;
-    GetByteContext bc;
-    uint8_t *dst[3];
-    int width, height, quality, frame_type;
-    int x, y, i, mb_width, mb_height, blk_type;
-    int ret;
-
-    if (buf_size < HEADER_SIZE) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Frame should have at least %d bytes, got %d instead\n",
-               HEADER_SIZE, buf_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    bytestream2_init(&bc, buf, buf_size);
-    width      = bytestream2_get_be16(&bc);
-    height     = bytestream2_get_be16(&bc);
-    bytestream2_skip(&bc, 2);
-    quality    = bytestream2_get_byte(&bc);
-    frame_type = bytestream2_get_byte(&bc);
-
-    if (width > avctx->width ||
-        height != avctx->height) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame dimensions %dx%d\n",
-               width, height);
-        return AVERROR_INVALIDDATA;
-    }
-    if (quality < 1 || quality > 100) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid quality setting %d\n", quality);
-        return AVERROR_INVALIDDATA;
-    }
-    if ((frame_type & ~3) || frame_type == 3) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame type %d\n", frame_type);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (frame_type != SKIP_FRAME && !bytestream2_get_bytes_left(&bc)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Empty frame found but it is not a skip frame.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-    c->pic->key_frame = (frame_type == INTRA_FRAME);
-    c->pic->pict_type = (frame_type == INTRA_FRAME) ? AV_PICTURE_TYPE_I
-                                                   : AV_PICTURE_TYPE_P;
-    if (frame_type == SKIP_FRAME) {
-        *got_frame      = 1;
-        if ((ret = av_frame_ref(data, c->pic)) < 0)
-            return ret;
-
-        return buf_size;
-    }
-
-    if (c->quality != quality) {
-        c->quality = quality;
-        for (i = 0; i < 2; i++)
-            ff_mss34_gen_quant_mat(c->quant_mat[i], quality, !i);
-    }
-
-    init_get_bits(&gb, buf + HEADER_SIZE, (buf_size - HEADER_SIZE) * 8);
-
-    mb_width  = FFALIGN(width,  16) >> 4;
-    mb_height = FFALIGN(height, 16) >> 4;
-    dst[0] = c->pic->data[0];
-    dst[1] = c->pic->data[1];
-    dst[2] = c->pic->data[2];
-
-    memset(c->prev_vec, 0, sizeof(c->prev_vec));
-    for (y = 0; y < mb_height; y++) {
-        memset(c->dc_cache, 0, sizeof(c->dc_cache));
-        for (x = 0; x < mb_width; x++) {
-            blk_type = decode012(&gb);
-            switch (blk_type) {
-            case DCT_BLOCK:
-                if (mss4_decode_dct_block(c, &gb, dst, x, y) < 0) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Error decoding DCT block %d,%d\n",
-                           x, y);
-                    return AVERROR_INVALIDDATA;
-                }
-                break;
-            case IMAGE_BLOCK:
-                if (mss4_decode_image_block(c, &gb, dst, x, y) < 0) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Error decoding VQ block %d,%d\n",
-                           x, y);
-                    return AVERROR_INVALIDDATA;
-                }
-                break;
-            case SKIP_BLOCK:
-                if (frame_type == INTRA_FRAME) {
-                    av_log(avctx, AV_LOG_ERROR, "Skip block in intra frame\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                break;
-            }
-            if (blk_type != DCT_BLOCK)
-                mss4_update_dc_cache(c, x);
-        }
-        dst[0] += c->pic->linesize[0] * 16;
-        dst[1] += c->pic->linesize[1] * 16;
-        dst[2] += c->pic->linesize[2] * 16;
-    }
-
-    if ((ret = av_frame_ref(data, c->pic)) < 0)
-        return ret;
-
-    *got_frame      = 1;
-
-    return buf_size;
-}
-
-static av_cold int mss4_decode_end(AVCodecContext *avctx)
-{
-    MSS4Context * const c = avctx->priv_data;
-    int i;
-
-    av_frame_free(&c->pic);
-    for (i = 0; i < 3; i++)
-        av_freep(&c->prev_dc[i]);
-    mss4_free_vlcs(c);
-
-    return 0;
-}
-
-static av_cold int mss4_decode_init(AVCodecContext *avctx)
-{
-    MSS4Context * const c = avctx->priv_data;
-    int i;
-
-    if (mss4_init_vlcs(c)) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n");
-        mss4_free_vlcs(c);
-        return AVERROR(ENOMEM);
-    }
-    for (i = 0; i < 3; i++) {
-        c->dc_stride[i] = FFALIGN(avctx->width, 16) >> (2 + !!i);
-        c->prev_dc[i]   = av_malloc(sizeof(**c->prev_dc) * c->dc_stride[i]);
-        if (!c->prev_dc[i]) {
-            av_log(avctx, AV_LOG_ERROR, "Cannot allocate buffer\n");
-            mss4_free_vlcs(c);
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    c->pic = av_frame_alloc();
-    if (!c->pic) {
-        mss4_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    avctx->pix_fmt     = AV_PIX_FMT_YUV444P;
-
-    return 0;
-}
-
-AVCodec ff_mts2_decoder = {
-    .name           = "mts2",
-    .long_name      = NULL_IF_CONFIG_SMALL("MS Expression Encoder Screen"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MTS2,
-    .priv_data_size = sizeof(MSS4Context),
-    .init           = mss4_decode_init,
-    .close          = mss4_decode_end,
-    .decode         = mss4_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/msvideo1.c b/deps/libav/libavcodec/msvideo1.c
deleted file mode 100644
index 7fd8633..0000000
--- a/deps/libav/libavcodec/msvideo1.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Microsoft Video-1 Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Microsoft Video-1 Decoder by Mike Melanson (melanson at pcisys.net)
- * For more information about the MS Video-1 format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-#define PALETTE_COUNT 256
-#define CHECK_STREAM_PTR(n) \
-  if ((stream_ptr + n) > s->size ) { \
-    av_log(s->avctx, AV_LOG_ERROR, " MS Video-1 warning: stream_ptr out of bounds (%d >= %d)\n", \
-      stream_ptr + n, s->size); \
-    return; \
-  }
-
-typedef struct Msvideo1Context {
-
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    const unsigned char *buf;
-    int size;
-
-    int mode_8bit;  /* if it's not 8-bit, it's 16-bit */
-
-    uint32_t pal[256];
-} Msvideo1Context;
-
-static av_cold int msvideo1_decode_init(AVCodecContext *avctx)
-{
-    Msvideo1Context *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    /* figure out the colorspace based on the presence of a palette */
-    if (s->avctx->bits_per_coded_sample == 8) {
-        s->mode_8bit = 1;
-        avctx->pix_fmt = AV_PIX_FMT_PAL8;
-    } else {
-        s->mode_8bit = 0;
-        avctx->pix_fmt = AV_PIX_FMT_RGB555;
-    }
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static void msvideo1_decode_8bit(Msvideo1Context *s)
-{
-    int block_ptr, pixel_ptr;
-    int total_blocks;
-    int pixel_x, pixel_y;  /* pixel width and height iterators */
-    int block_x, block_y;  /* block width and height iterators */
-    int blocks_wide, blocks_high;  /* width and height in 4x4 blocks */
-    int block_inc;
-    int row_dec;
-
-    /* decoding parameters */
-    int stream_ptr;
-    unsigned char byte_a, byte_b;
-    unsigned short flags;
-    int skip_blocks;
-    unsigned char colors[8];
-    unsigned char *pixels = s->frame->data[0];
-    int stride = s->frame->linesize[0];
-
-    stream_ptr = 0;
-    skip_blocks = 0;
-    blocks_wide = s->avctx->width / 4;
-    blocks_high = s->avctx->height / 4;
-    total_blocks = blocks_wide * blocks_high;
-    block_inc = 4;
-    row_dec = stride + 4;
-
-    for (block_y = blocks_high; block_y > 0; block_y--) {
-        block_ptr = ((block_y * 4) - 1) * stride;
-        for (block_x = blocks_wide; block_x > 0; block_x--) {
-            /* check if this block should be skipped */
-            if (skip_blocks) {
-                block_ptr += block_inc;
-                skip_blocks--;
-                total_blocks--;
-                continue;
-            }
-
-            pixel_ptr = block_ptr;
-
-            /* get the next two bytes in the encoded data stream */
-            CHECK_STREAM_PTR(2);
-            byte_a = s->buf[stream_ptr++];
-            byte_b = s->buf[stream_ptr++];
-
-            /* check if the decode is finished */
-            if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0))
-                return;
-            else if ((byte_b & 0xFC) == 0x84) {
-                /* skip code, but don't count the current block */
-                skip_blocks = ((byte_b - 0x84) << 8) + byte_a - 1;
-            } else if (byte_b < 0x80) {
-                /* 2-color encoding */
-                flags = (byte_b << 8) | byte_a;
-
-                CHECK_STREAM_PTR(2);
-                colors[0] = s->buf[stream_ptr++];
-                colors[1] = s->buf[stream_ptr++];
-
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
-                        pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1];
-                    pixel_ptr -= row_dec;
-                }
-            } else if (byte_b >= 0x90) {
-                /* 8-color encoding */
-                flags = (byte_b << 8) | byte_a;
-
-                CHECK_STREAM_PTR(8);
-                memcpy(colors, &s->buf[stream_ptr], 8);
-                stream_ptr += 8;
-
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
-                        pixels[pixel_ptr++] =
-                            colors[((pixel_y & 0x2) << 1) +
-                                (pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
-                    pixel_ptr -= row_dec;
-                }
-            } else {
-                /* 1-color encoding */
-                colors[0] = byte_a;
-
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++)
-                        pixels[pixel_ptr++] = colors[0];
-                    pixel_ptr -= row_dec;
-                }
-            }
-
-            block_ptr += block_inc;
-            total_blocks--;
-        }
-    }
-
-    /* make the palette available on the way out */
-    if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8)
-        memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
-}
-
-static void msvideo1_decode_16bit(Msvideo1Context *s)
-{
-    int block_ptr, pixel_ptr;
-    int total_blocks;
-    int pixel_x, pixel_y;  /* pixel width and height iterators */
-    int block_x, block_y;  /* block width and height iterators */
-    int blocks_wide, blocks_high;  /* width and height in 4x4 blocks */
-    int block_inc;
-    int row_dec;
-
-    /* decoding parameters */
-    int stream_ptr;
-    unsigned char byte_a, byte_b;
-    unsigned short flags;
-    int skip_blocks;
-    unsigned short colors[8];
-    unsigned short *pixels = (unsigned short *)s->frame->data[0];
-    int stride = s->frame->linesize[0] / 2;
-
-    stream_ptr = 0;
-    skip_blocks = 0;
-    blocks_wide = s->avctx->width / 4;
-    blocks_high = s->avctx->height / 4;
-    total_blocks = blocks_wide * blocks_high;
-    block_inc = 4;
-    row_dec = stride + 4;
-
-    for (block_y = blocks_high; block_y > 0; block_y--) {
-        block_ptr = ((block_y * 4) - 1) * stride;
-        for (block_x = blocks_wide; block_x > 0; block_x--) {
-            /* check if this block should be skipped */
-            if (skip_blocks) {
-                block_ptr += block_inc;
-                skip_blocks--;
-                total_blocks--;
-                continue;
-            }
-
-            pixel_ptr = block_ptr;
-
-            /* get the next two bytes in the encoded data stream */
-            CHECK_STREAM_PTR(2);
-            byte_a = s->buf[stream_ptr++];
-            byte_b = s->buf[stream_ptr++];
-
-            /* check if the decode is finished */
-            if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0)) {
-                return;
-            } else if ((byte_b & 0xFC) == 0x84) {
-                /* skip code, but don't count the current block */
-                skip_blocks = ((byte_b - 0x84) << 8) + byte_a - 1;
-            } else if (byte_b < 0x80) {
-                /* 2- or 8-color encoding modes */
-                flags = (byte_b << 8) | byte_a;
-
-                CHECK_STREAM_PTR(4);
-                colors[0] = AV_RL16(&s->buf[stream_ptr]);
-                stream_ptr += 2;
-                colors[1] = AV_RL16(&s->buf[stream_ptr]);
-                stream_ptr += 2;
-
-                if (colors[0] & 0x8000) {
-                    /* 8-color encoding */
-                    CHECK_STREAM_PTR(12);
-                    colors[2] = AV_RL16(&s->buf[stream_ptr]);
-                    stream_ptr += 2;
-                    colors[3] = AV_RL16(&s->buf[stream_ptr]);
-                    stream_ptr += 2;
-                    colors[4] = AV_RL16(&s->buf[stream_ptr]);
-                    stream_ptr += 2;
-                    colors[5] = AV_RL16(&s->buf[stream_ptr]);
-                    stream_ptr += 2;
-                    colors[6] = AV_RL16(&s->buf[stream_ptr]);
-                    stream_ptr += 2;
-                    colors[7] = AV_RL16(&s->buf[stream_ptr]);
-                    stream_ptr += 2;
-
-                    for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                        for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
-                            pixels[pixel_ptr++] =
-                                colors[((pixel_y & 0x2) << 1) +
-                                    (pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
-                        pixel_ptr -= row_dec;
-                    }
-                } else {
-                    /* 2-color encoding */
-                    for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                        for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
-                            pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1];
-                        pixel_ptr -= row_dec;
-                    }
-                }
-            } else {
-                /* otherwise, it's a 1-color block */
-                colors[0] = (byte_b << 8) | byte_a;
-
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++)
-                        pixels[pixel_ptr++] = colors[0];
-                    pixel_ptr -= row_dec;
-                }
-            }
-
-            block_ptr += block_inc;
-            total_blocks--;
-        }
-    }
-}
-
-static int msvideo1_decode_frame(AVCodecContext *avctx,
-                                void *data, int *got_frame,
-                                AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    Msvideo1Context *s = avctx->priv_data;
-    int ret;
-
-    s->buf = buf;
-    s->size = buf_size;
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    if (s->mode_8bit) {
-        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-
-        if (pal) {
-            memcpy(s->pal, pal, AVPALETTE_SIZE);
-            s->frame->palette_has_changed = 1;
-        }
-    }
-
-    if (s->mode_8bit)
-        msvideo1_decode_8bit(s);
-    else
-        msvideo1_decode_16bit(s);
-
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    *got_frame      = 1;
-
-    /* report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int msvideo1_decode_end(AVCodecContext *avctx)
-{
-    Msvideo1Context *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_msvideo1_decoder = {
-    .name           = "msvideo1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Microsoft Video 1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MSVIDEO1,
-    .priv_data_size = sizeof(Msvideo1Context),
-    .init           = msvideo1_decode_init,
-    .close          = msvideo1_decode_end,
-    .decode         = msvideo1_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/mxpegdec.c b/deps/libav/libavcodec/mxpegdec.c
deleted file mode 100644
index bfaae34..0000000
--- a/deps/libav/libavcodec/mxpegdec.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * MxPEG decoder
- * Copyright (c) 2011 Anatoly Nenashev
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-/**
- * @file
- * MxPEG decoder
- */
-
-#include "internal.h"
-#include "mjpeg.h"
-#include "mjpegdec.h"
-
-typedef struct MXpegDecodeContext {
-    MJpegDecodeContext jpg;
-    AVFrame *picture[2]; /* pictures array */
-    int picture_index; /* index of current picture */
-    int got_sof_data; /* true if SOF data successfully parsed */
-    int got_mxm_bitmask; /* true if MXM bitmask available */
-    uint8_t *mxm_bitmask; /* bitmask buffer */
-    unsigned bitmask_size; /* size of bitmask */
-    int has_complete_frame; /* true if has complete frame */
-    uint8_t *completion_bitmask; /* completion bitmask of macroblocks */
-    unsigned mb_width, mb_height; /* size of picture in MB's from MXM header */
-} MXpegDecodeContext;
-
-static av_cold int mxpeg_decode_end(AVCodecContext *avctx)
-{
-    MXpegDecodeContext *s = avctx->priv_data;
-    MJpegDecodeContext *jpg = &s->jpg;
-    int i;
-
-    jpg->picture_ptr = NULL;
-    ff_mjpeg_decode_end(avctx);
-
-    for (i = 0; i < 2; ++i)
-        av_frame_free(&s->picture[i]);
-
-    av_freep(&s->mxm_bitmask);
-    av_freep(&s->completion_bitmask);
-
-    return 0;
-}
-
-static av_cold int mxpeg_decode_init(AVCodecContext *avctx)
-{
-    MXpegDecodeContext *s = avctx->priv_data;
-
-    s->picture[0] = av_frame_alloc();
-    s->picture[1] = av_frame_alloc();
-    if (!s->picture[0] || !s->picture[1]) {
-        mxpeg_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    s->jpg.picture_ptr      = s->picture[0];
-    return ff_mjpeg_decode_init(avctx);
-}
-
-static int mxpeg_decode_app(MXpegDecodeContext *s,
-                            const uint8_t *buf_ptr, int buf_size)
-{
-    int len;
-    if (buf_size < 2)
-        return 0;
-    len = AV_RB16(buf_ptr);
-    skip_bits(&s->jpg.gb, 8*FFMIN(len,buf_size));
-
-    return 0;
-}
-
-static int mxpeg_decode_mxm(MXpegDecodeContext *s,
-                            const uint8_t *buf_ptr, int buf_size)
-{
-    unsigned bitmask_size, mb_count;
-    int i;
-
-    s->mb_width  = AV_RL16(buf_ptr+4);
-    s->mb_height = AV_RL16(buf_ptr+6);
-    mb_count = s->mb_width * s->mb_height;
-
-    bitmask_size = (mb_count + 7) >> 3;
-    if (bitmask_size > buf_size - 12) {
-        av_log(s->jpg.avctx, AV_LOG_ERROR,
-               "MXM bitmask is not complete\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (s->bitmask_size != bitmask_size) {
-        av_freep(&s->mxm_bitmask);
-        s->mxm_bitmask = av_malloc(bitmask_size);
-        if (!s->mxm_bitmask) {
-            av_log(s->jpg.avctx, AV_LOG_ERROR,
-                   "MXM bitmask memory allocation error\n");
-            return AVERROR(ENOMEM);
-        }
-
-        av_freep(&s->completion_bitmask);
-        s->completion_bitmask = av_mallocz(bitmask_size);
-        if (!s->completion_bitmask) {
-            av_log(s->jpg.avctx, AV_LOG_ERROR,
-                   "Completion bitmask memory allocation error\n");
-            return AVERROR(ENOMEM);
-        }
-
-        s->bitmask_size = bitmask_size;
-    }
-
-    memcpy(s->mxm_bitmask, buf_ptr + 12, bitmask_size);
-    s->got_mxm_bitmask = 1;
-
-    if (!s->has_complete_frame) {
-        uint8_t completion_check = 0xFF;
-        for (i = 0; i < bitmask_size; ++i) {
-            s->completion_bitmask[i] |= s->mxm_bitmask[i];
-            completion_check &= s->completion_bitmask[i];
-        }
-        s->has_complete_frame = !(completion_check ^ 0xFF);
-    }
-
-    return 0;
-}
-
-static int mxpeg_decode_com(MXpegDecodeContext *s,
-                            const uint8_t *buf_ptr, int buf_size)
-{
-    int len, ret = 0;
-    if (buf_size < 2)
-        return 0;
-    len = AV_RB16(buf_ptr);
-    if (len > 14 && len <= buf_size && !strncmp(buf_ptr + 2, "MXM", 3)) {
-        ret = mxpeg_decode_mxm(s, buf_ptr + 2, len - 2);
-    }
-    skip_bits(&s->jpg.gb, 8*FFMIN(len,buf_size));
-
-    return ret;
-}
-
-static int mxpeg_check_dimensions(MXpegDecodeContext *s, MJpegDecodeContext *jpg,
-                                  AVFrame *reference_ptr)
-{
-    if ((jpg->width + 0x0F)>>4 != s->mb_width ||
-        (jpg->height + 0x0F)>>4 != s->mb_height) {
-        av_log(jpg->avctx, AV_LOG_ERROR,
-               "Picture dimensions stored in SOF and MXM mismatch\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (reference_ptr->data[0]) {
-        int i;
-        for (i = 0; i < MAX_COMPONENTS; ++i) {
-            if ( (!reference_ptr->data[i] ^ !jpg->picture_ptr->data[i]) ||
-                 reference_ptr->linesize[i] != jpg->picture_ptr->linesize[i]) {
-                av_log(jpg->avctx, AV_LOG_ERROR,
-                       "Dimensions of current and reference picture mismatch\n");
-                return AVERROR(EINVAL);
-            }
-        }
-    }
-
-    return 0;
-}
-
-static int mxpeg_decode_frame(AVCodecContext *avctx,
-                          void *data, int *got_frame,
-                          AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    MXpegDecodeContext *s = avctx->priv_data;
-    MJpegDecodeContext *jpg = &s->jpg;
-    const uint8_t *buf_end, *buf_ptr;
-    const uint8_t *unescaped_buf_ptr;
-    int unescaped_buf_size;
-    int start_code;
-    int ret;
-
-    buf_ptr = buf;
-    buf_end = buf + buf_size;
-    jpg->got_picture = 0;
-    s->got_mxm_bitmask = 0;
-    while (buf_ptr < buf_end) {
-        start_code = ff_mjpeg_find_marker(jpg, &buf_ptr, buf_end,
-                                          &unescaped_buf_ptr, &unescaped_buf_size);
-        if (start_code < 0)
-            goto the_end;
-        {
-            init_get_bits(&jpg->gb, unescaped_buf_ptr, unescaped_buf_size*8);
-
-            if (start_code >= APP0 && start_code <= APP15) {
-                mxpeg_decode_app(s, unescaped_buf_ptr, unescaped_buf_size);
-            }
-
-            switch (start_code) {
-            case SOI:
-                if (jpg->got_picture) //emulating EOI
-                    goto the_end;
-                break;
-            case EOI:
-                goto the_end;
-            case DQT:
-                ret = ff_mjpeg_decode_dqt(jpg);
-                if (ret < 0) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "quantization table decode error\n");
-                    return ret;
-                }
-                break;
-            case DHT:
-                ret = ff_mjpeg_decode_dht(jpg);
-                if (ret < 0) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "huffman table decode error\n");
-                    return ret;
-                }
-                break;
-            case COM:
-                ret = mxpeg_decode_com(s, unescaped_buf_ptr,
-                                       unescaped_buf_size);
-                if (ret < 0)
-                    return ret;
-                break;
-            case SOF0:
-                s->got_sof_data = 0;
-                ret = ff_mjpeg_decode_sof(jpg);
-                if (ret < 0) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "SOF data decode error\n");
-                    return ret;
-                }
-                if (jpg->interlaced) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Interlaced mode not supported in MxPEG\n");
-                    return AVERROR(EINVAL);
-                }
-                s->got_sof_data = 1;
-                break;
-            case SOS:
-                if (!s->got_sof_data) {
-                    av_log(avctx, AV_LOG_WARNING,
-                           "Can not process SOS without SOF data, skipping\n");
-                    break;
-                }
-                if (!jpg->got_picture) {
-                    if (jpg->first_picture) {
-                        av_log(avctx, AV_LOG_WARNING,
-                               "First picture has no SOF, skipping\n");
-                        break;
-                    }
-                    if (!s->got_mxm_bitmask){
-                        av_log(avctx, AV_LOG_WARNING,
-                               "Non-key frame has no MXM, skipping\n");
-                        break;
-                    }
-                    /* use stored SOF data to allocate current picture */
-                    av_frame_unref(jpg->picture_ptr);
-                    if (ff_get_buffer(avctx, jpg->picture_ptr,
-                                      AV_GET_BUFFER_FLAG_REF) < 0) {
-                        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                        return AVERROR(ENOMEM);
-                    }
-                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_P;
-                    jpg->picture_ptr->key_frame = 0;
-                    jpg->got_picture = 1;
-                } else {
-                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
-                    jpg->picture_ptr->key_frame = 1;
-                }
-
-                if (s->got_mxm_bitmask) {
-                    AVFrame *reference_ptr = s->picture[s->picture_index ^ 1];
-                    if (mxpeg_check_dimensions(s, jpg, reference_ptr) < 0)
-                        break;
-
-                    /* allocate dummy reference picture if needed */
-                    if (!reference_ptr->data[0] &&
-                        ff_get_buffer(avctx, reference_ptr,
-                                      AV_GET_BUFFER_FLAG_REF) < 0) {
-                        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                        return AVERROR(ENOMEM);
-                    }
-
-                    ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, reference_ptr);
-                    if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
-                        return ret;
-                } else {
-                    ret = ff_mjpeg_decode_sos(jpg, NULL, NULL);
-                    if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
-                        return ret;
-                }
-
-                break;
-            }
-
-            buf_ptr += (get_bits_count(&jpg->gb)+7) >> 3;
-        }
-
-    }
-
-the_end:
-    if (jpg->got_picture) {
-        int ret = av_frame_ref(data, jpg->picture_ptr);
-        if (ret < 0)
-            return ret;
-        *got_frame = 1;
-
-        s->picture_index ^= 1;
-        jpg->picture_ptr = s->picture[s->picture_index];
-
-        if (!s->has_complete_frame) {
-            if (!s->got_mxm_bitmask)
-                s->has_complete_frame = 1;
-            else
-                *got_frame = 0;
-        }
-    }
-
-    return buf_ptr - buf;
-}
-
-AVCodec ff_mxpeg_decoder = {
-    .name           = "mxpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("Mobotix MxPEG video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MXPEG,
-    .priv_data_size = sizeof(MXpegDecodeContext),
-    .init           = mxpeg_decode_init,
-    .close          = mxpeg_decode_end,
-    .decode         = mxpeg_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/nellymoser.c b/deps/libav/libavcodec/nellymoser.c
deleted file mode 100644
index 0740c75..0000000
--- a/deps/libav/libavcodec/nellymoser.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Common code between Nellymoser encoder and decoder
- * Copyright (c) 2007 a840bda5870ba11f19698ff6eb9581dfb0f95fa5,
- *                    539459aeb7d425140b62a3ec7dbf6dc8e408a306, and
- *                    520e17cd55896441042b14df2566a6eb610ed444
- * Copyright (c) 2007 Loic Minier <lool at dooz.org>
- *                    Benjamin Larsson
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * @file
- * The 3 alphanumeric copyright notices are md5summed they are from the original
- * implementors. The original code is available from http://code.google.com/p/nelly2pcm/
- */
-
-#include "nellymoser.h"
-#include "avcodec.h"
-
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-
-const float ff_nelly_dequantization_table[127] = {
- 0.0000000000,
-
--0.8472560048, 0.7224709988,
-
--1.5247479677,-0.4531480074, 0.3753609955, 1.4717899561,
-
--1.9822579622,-1.1929379702,-0.5829370022,-0.0693780035, 0.3909569979, 0.9069200158, 1.4862740040, 2.2215409279,
-
--2.3887870312,-1.8067539930,-1.4105420113,-1.0773609877,-0.7995010018,-0.5558109879,-0.3334020078,-0.1324490011,
- 0.0568020009, 0.2548770010, 0.4773550034, 0.7386850119, 1.0443060398, 1.3954459429, 1.8098750114, 2.3918759823,
-
--2.3893830776,-1.9884680510,-1.7514040470,-1.5643119812,-1.3922129869,-1.2164649963,-1.0469499826,-0.8905100226,
--0.7645580173,-0.6454579830,-0.5259280205,-0.4059549868,-0.3029719889,-0.2096900046,-0.1239869967,-0.0479229987,
- 0.0257730000, 0.1001340002, 0.1737180054, 0.2585540116, 0.3522900045, 0.4569880068, 0.5767750144, 0.7003160119,
- 0.8425520062, 1.0093879700, 1.1821349859, 1.3534560204, 1.5320819616, 1.7332619429, 1.9722349644, 2.3978140354,
-
--2.5756309032,-2.0573320389,-1.8984919786,-1.7727810144,-1.6662600040,-1.5742180347,-1.4993319511,-1.4316639900,
--1.3652280569,-1.3000990152,-1.2280930281,-1.1588579416,-1.0921250582,-1.0135740042,-0.9202849865,-0.8287050128,
--0.7374889851,-0.6447759867,-0.5590940118,-0.4857139885,-0.4110319912,-0.3459700048,-0.2851159871,-0.2341620028,
--0.1870580018,-0.1442500055,-0.1107169986,-0.0739680007,-0.0365610011,-0.0073290002, 0.0203610007, 0.0479039997,
- 0.0751969963, 0.0980999991, 0.1220389977, 0.1458999962, 0.1694349945, 0.1970459968, 0.2252430022, 0.2556869984,
- 0.2870100141, 0.3197099864, 0.3525829911, 0.3889069855, 0.4334920049, 0.4769459963, 0.5204820037, 0.5644530058,
- 0.6122040153, 0.6685929894, 0.7341650128, 0.8032159805, 0.8784040213, 0.9566209912, 1.0397069454, 1.1293770075,
- 1.2211159468, 1.3080279827, 1.4024800062, 1.5056819916, 1.6227730513, 1.7724959850, 1.9430880547, 2.2903931141
-};
-
-const uint8_t ff_nelly_band_sizes_table[NELLY_BANDS] = {
-2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 9, 10, 12, 14, 15
-};
-
-const uint16_t ff_nelly_init_table[64] = {
-3134, 5342, 6870, 7792, 8569, 9185, 9744, 10191, 10631, 11061, 11434, 11770,
-12116, 12513, 12925, 13300, 13674, 14027, 14352, 14716, 15117, 15477, 15824,
-16157, 16513, 16804, 17090, 17401, 17679, 17948, 18238, 18520, 18764, 19078,
-19381, 19640, 19921, 20205, 20500, 20813, 21162, 21465, 21794, 22137, 22453,
-22756, 23067, 23350, 23636, 23926, 24227, 24521, 24819, 25107, 25414, 25730,
-26120, 26497, 26895, 27344, 27877, 28463, 29426, 31355
-};
-
-const int16_t ff_nelly_delta_table[32] = {
--11725, -9420, -7910, -6801, -5948, -5233, -4599, -4039, -3507, -3030, -2596,
--2170, -1774, -1383, -1016, -660, -329, -1, 337, 696, 1085, 1512, 1962, 2433,
-2968, 3569, 4314, 5279, 6622, 8154, 10076, 12975
-};
-
-static inline int signed_shift(int i, int shift) {
-    if (shift > 0)
-        return i << shift;
-    return i >> -shift;
-}
-
-static int sum_bits(short *buf, short shift, short off)
-{
-    int i, ret = 0;
-
-    for (i = 0; i < NELLY_FILL_LEN; i++) {
-        int b = buf[i]-off;
-        b = ((b>>(shift-1))+1)>>1;
-        ret += av_clip(b, 0, NELLY_BIT_CAP);
-    }
-
-    return ret;
-}
-
-static int headroom(int *la)
-{
-    int l;
-    if (*la == 0) {
-        return 31;
-    }
-    l = 30 - av_log2(FFABS(*la));
-    *la <<= l;
-    return l;
-}
-
-
-void ff_nelly_get_sample_bits(const float *buf, int *bits)
-{
-    int i, j;
-    short sbuf[128];
-    int bitsum = 0, last_bitsum, small_bitsum, big_bitsum;
-    short shift, shift_saved;
-    int max, sum, last_off, tmp;
-    int big_off, small_off;
-    int off;
-
-    max = 0;
-    for (i = 0; i < NELLY_FILL_LEN; i++) {
-        max = FFMAX(max, buf[i]);
-    }
-    shift = -16;
-    shift += headroom(&max);
-
-    sum = 0;
-    for (i = 0; i < NELLY_FILL_LEN; i++) {
-        sbuf[i] = signed_shift(buf[i], shift);
-        sbuf[i] = (3*sbuf[i])>>2;
-        sum += sbuf[i];
-    }
-
-    shift += 11;
-    shift_saved = shift;
-    sum -= NELLY_DETAIL_BITS << shift;
-    shift += headroom(&sum);
-    small_off = (NELLY_BASE_OFF * (sum>>16)) >> 15;
-    shift = shift_saved - (NELLY_BASE_SHIFT+shift-31);
-
-    small_off = signed_shift(small_off, shift);
-
-    bitsum = sum_bits(sbuf, shift_saved, small_off);
-
-    if (bitsum != NELLY_DETAIL_BITS) {
-        off = bitsum - NELLY_DETAIL_BITS;
-
-        for(shift=0; FFABS(off) <= 16383; shift++)
-            off *= 2;
-
-        off = (off * NELLY_BASE_OFF) >> 15;
-        shift = shift_saved-(NELLY_BASE_SHIFT+shift-15);
-
-        off = signed_shift(off, shift);
-
-        for (j = 1; j < 20; j++) {
-            last_off = small_off;
-            small_off += off;
-            last_bitsum = bitsum;
-
-            bitsum = sum_bits(sbuf, shift_saved, small_off);
-
-            if ((bitsum-NELLY_DETAIL_BITS) * (last_bitsum-NELLY_DETAIL_BITS) <= 0)
-                break;
-        }
-
-        if (bitsum > NELLY_DETAIL_BITS) {
-            big_off = small_off;
-            small_off = last_off;
-            big_bitsum=bitsum;
-            small_bitsum=last_bitsum;
-        } else {
-            big_off = last_off;
-            big_bitsum=last_bitsum;
-            small_bitsum=bitsum;
-        }
-
-        while (bitsum != NELLY_DETAIL_BITS && j <= 19) {
-            off = (big_off+small_off)>>1;
-            bitsum = sum_bits(sbuf, shift_saved, off);
-            if (bitsum > NELLY_DETAIL_BITS) {
-                big_off=off;
-                big_bitsum=bitsum;
-            } else {
-                small_off = off;
-                small_bitsum=bitsum;
-            }
-            j++;
-        }
-
-        if (abs(big_bitsum-NELLY_DETAIL_BITS) >=
-            abs(small_bitsum-NELLY_DETAIL_BITS)) {
-            bitsum = small_bitsum;
-        } else {
-            small_off = big_off;
-            bitsum = big_bitsum;
-        }
-    }
-
-    for (i = 0; i < NELLY_FILL_LEN; i++) {
-        tmp = sbuf[i]-small_off;
-        tmp = ((tmp>>(shift_saved-1))+1)>>1;
-        bits[i] = av_clip(tmp, 0, NELLY_BIT_CAP);
-    }
-
-    if (bitsum > NELLY_DETAIL_BITS) {
-        tmp = i = 0;
-        while (tmp < NELLY_DETAIL_BITS) {
-            tmp += bits[i];
-            i++;
-        }
-
-        bits[i-1] -= tmp - NELLY_DETAIL_BITS;
-        for(; i < NELLY_FILL_LEN; i++)
-            bits[i] = 0;
-    }
-}
diff --git a/deps/libav/libavcodec/nellymoser.h b/deps/libav/libavcodec/nellymoser.h
deleted file mode 100644
index 027fc7e..0000000
--- a/deps/libav/libavcodec/nellymoser.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Common code between Nellymoser encoder and decoder
- * Copyright (c) 2007 a840bda5870ba11f19698ff6eb9581dfb0f95fa5,
- *                    539459aeb7d425140b62a3ec7dbf6dc8e408a306, and
- *                    520e17cd55896441042b14df2566a6eb610ed444
- * Copyright (c) 2007 Loic Minier <lool at dooz.org>
- *                    Benjamin Larsson
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * @file
- * The 3 alphanumeric copyright notices are md5summed they are from the original
- * implementors. The original code is available from http://code.google.com/p/nelly2pcm/
- */
-
-#ifndef AVCODEC_NELLYMOSER_H
-#define AVCODEC_NELLYMOSER_H
-
-#include "avcodec.h"
-
-#define NELLY_BANDS       23
-#define NELLY_BLOCK_LEN   64
-#define NELLY_HEADER_BITS 116
-#define NELLY_DETAIL_BITS 198
-#define NELLY_BUF_LEN     128
-#define NELLY_FILL_LEN    124
-#define NELLY_BIT_CAP     6
-#define NELLY_BASE_OFF    4228
-#define NELLY_BASE_SHIFT  19
-#define NELLY_SAMPLES     (2 * NELLY_BUF_LEN)
-
-extern const float    ff_nelly_dequantization_table[127];
-extern const uint8_t  ff_nelly_band_sizes_table[NELLY_BANDS];
-extern const uint16_t ff_nelly_init_table[64];
-extern const int16_t  ff_nelly_delta_table[32];
-
-void ff_nelly_get_sample_bits(const float *buf, int *bits);
-
-#endif /* AVCODEC_NELLYMOSER_H */
diff --git a/deps/libav/libavcodec/nellymoserdec.c b/deps/libav/libavcodec/nellymoserdec.c
deleted file mode 100644
index 3b9b77c..0000000
--- a/deps/libav/libavcodec/nellymoserdec.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * NellyMoser audio decoder
- * Copyright (c) 2007 a840bda5870ba11f19698ff6eb9581dfb0f95fa5,
- *                    539459aeb7d425140b62a3ec7dbf6dc8e408a306, and
- *                    520e17cd55896441042b14df2566a6eb610ed444
- * Copyright (c) 2007 Loic Minier <lool at dooz.org>
- *                    Benjamin Larsson
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * @file
- * The 3 alphanumeric copyright notices are md5summed they are from the original
- * implementors. The original code is available from http://code.google.com/p/nelly2pcm/
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/lfg.h"
-#include "libavutil/random_seed.h"
-#include "avcodec.h"
-#include "fft.h"
-#include "fmtconvert.h"
-#include "internal.h"
-#include "nellymoser.h"
-#include "sinewin.h"
-
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-
-
-typedef struct NellyMoserDecodeContext {
-    AVCodecContext* avctx;
-    AVLFG           random_state;
-    GetBitContext   gb;
-    float           scale_bias;
-    AVFloatDSPContext fdsp;
-    FFTContext      imdct_ctx;
-    DECLARE_ALIGNED(32, float, imdct_buf)[2][NELLY_BUF_LEN];
-    float          *imdct_out;
-    float          *imdct_prev;
-} NellyMoserDecodeContext;
-
-static void nelly_decode_block(NellyMoserDecodeContext *s,
-                               const unsigned char block[NELLY_BLOCK_LEN],
-                               float audio[NELLY_SAMPLES])
-{
-    int i,j;
-    float buf[NELLY_FILL_LEN], pows[NELLY_FILL_LEN];
-    float *aptr, *bptr, *pptr, val, pval;
-    int bits[NELLY_BUF_LEN];
-    unsigned char v;
-
-    init_get_bits(&s->gb, block, NELLY_BLOCK_LEN * 8);
-
-    bptr = buf;
-    pptr = pows;
-    val = ff_nelly_init_table[get_bits(&s->gb, 6)];
-    for (i=0 ; i<NELLY_BANDS ; i++) {
-        if (i > 0)
-            val += ff_nelly_delta_table[get_bits(&s->gb, 5)];
-        pval = -pow(2, val/2048) * s->scale_bias;
-        for (j = 0; j < ff_nelly_band_sizes_table[i]; j++) {
-            *bptr++ = val;
-            *pptr++ = pval;
-        }
-
-    }
-
-    ff_nelly_get_sample_bits(buf, bits);
-
-    for (i = 0; i < 2; i++) {
-        aptr = audio + i * NELLY_BUF_LEN;
-
-        init_get_bits(&s->gb, block, NELLY_BLOCK_LEN * 8);
-        skip_bits_long(&s->gb, NELLY_HEADER_BITS + i*NELLY_DETAIL_BITS);
-
-        for (j = 0; j < NELLY_FILL_LEN; j++) {
-            if (bits[j] <= 0) {
-                aptr[j] = M_SQRT1_2*pows[j];
-                if (av_lfg_get(&s->random_state) & 1)
-                    aptr[j] *= -1.0;
-            } else {
-                v = get_bits(&s->gb, bits[j]);
-                aptr[j] = ff_nelly_dequantization_table[(1<<bits[j])-1+v]*pows[j];
-            }
-        }
-        memset(&aptr[NELLY_FILL_LEN], 0,
-               (NELLY_BUF_LEN - NELLY_FILL_LEN) * sizeof(float));
-
-        s->imdct_ctx.imdct_half(&s->imdct_ctx, s->imdct_out, aptr);
-        s->fdsp.vector_fmul_window(aptr, s->imdct_prev + NELLY_BUF_LEN / 2,
-                                   s->imdct_out, ff_sine_128,
-                                   NELLY_BUF_LEN / 2);
-        FFSWAP(float *, s->imdct_out, s->imdct_prev);
-    }
-}
-
-static av_cold int decode_init(AVCodecContext * avctx) {
-    NellyMoserDecodeContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    s->imdct_out = s->imdct_buf[0];
-    s->imdct_prev = s->imdct_buf[1];
-    av_lfg_init(&s->random_state, 0);
-    ff_mdct_init(&s->imdct_ctx, 8, 1, 1.0);
-
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    s->scale_bias = 1.0/(32768*8);
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
-
-    /* Generate overlap window */
-    if (!ff_sine_128[127])
-        ff_init_ff_sine_windows(7);
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-
-    return 0;
-}
-
-static int decode_tag(AVCodecContext *avctx, void *data,
-                      int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    NellyMoserDecodeContext *s = avctx->priv_data;
-    int blocks, i, ret;
-    float   *samples_flt;
-
-    blocks     = buf_size / NELLY_BLOCK_LEN;
-    if (blocks <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (buf_size % NELLY_BLOCK_LEN) {
-        av_log(avctx, AV_LOG_WARNING, "Leftover bytes: %d.\n",
-               buf_size % NELLY_BLOCK_LEN);
-    }
-    /* Normal numbers of blocks for sample rates:
-     *  8000 Hz - 1
-     * 11025 Hz - 2
-     * 16000 Hz - 3
-     * 22050 Hz - 4
-     * 44100 Hz - 8
-     */
-
-    /* get output buffer */
-    frame->nb_samples = NELLY_SAMPLES * blocks;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples_flt = (float *)frame->data[0];
-
-    for (i=0 ; i<blocks ; i++) {
-        nelly_decode_block(s, buf, samples_flt);
-        samples_flt += NELLY_SAMPLES;
-        buf += NELLY_BLOCK_LEN;
-    }
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-
-static av_cold int decode_end(AVCodecContext * avctx) {
-    NellyMoserDecodeContext *s = avctx->priv_data;
-
-    ff_mdct_end(&s->imdct_ctx);
-
-    return 0;
-}
-
-AVCodec ff_nellymoser_decoder = {
-    .name           = "nellymoser",
-    .long_name      = NULL_IF_CONFIG_SMALL("Nellymoser Asao"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_NELLYMOSER,
-    .priv_data_size = sizeof(NellyMoserDecodeContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_tag,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_PARAM_CHANGE,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/nellymoserenc.c b/deps/libav/libavcodec/nellymoserenc.c
deleted file mode 100644
index fc803a2..0000000
--- a/deps/libav/libavcodec/nellymoserenc.c
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * Nellymoser encoder
- * This code is developed as part of Google Summer of Code 2008 Program.
- *
- * Copyright (c) 2008 Bartlomiej Wolowiec
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Nellymoser encoder
- * by Bartlomiej Wolowiec
- *
- * Generic codec information: libavcodec/nellymoserdec.c
- *
- * Some information also from: http://samples.libav.org/A-codecs/Nelly_Moser/ASAO/ASAO.zip
- *                             (Copyright Joseph Artsimovich and UAB "DKD")
- *
- * for more information about nellymoser format, visit:
- * http://wiki.multimedia.cx/index.php?title=Nellymoser
- */
-
-#include "libavutil/float_dsp.h"
-#include "libavutil/mathematics.h"
-#include "nellymoser.h"
-#include "avcodec.h"
-#include "audio_frame_queue.h"
-#include "fft.h"
-#include "internal.h"
-#include "sinewin.h"
-
-#define BITSTREAM_WRITER_LE
-#include "put_bits.h"
-
-#define POW_TABLE_SIZE (1<<11)
-#define POW_TABLE_OFFSET 3
-#define OPT_SIZE ((1<<15) + 3000)
-
-typedef struct NellyMoserEncodeContext {
-    AVCodecContext  *avctx;
-    int             last_frame;
-    AVFloatDSPContext fdsp;
-    FFTContext      mdct_ctx;
-    AudioFrameQueue afq;
-    DECLARE_ALIGNED(32, float, mdct_out)[NELLY_SAMPLES];
-    DECLARE_ALIGNED(32, float, in_buff)[NELLY_SAMPLES];
-    DECLARE_ALIGNED(32, float, buf)[3 * NELLY_BUF_LEN];     ///< sample buffer
-    float           (*opt )[NELLY_BANDS];
-    uint8_t         (*path)[NELLY_BANDS];
-} NellyMoserEncodeContext;
-
-static float pow_table[POW_TABLE_SIZE];     ///< -pow(2, -i / 2048.0 - 3.0);
-
-static const uint8_t sf_lut[96] = {
-     0,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  3,  3,  3,  4,  4,
-     5,  5,  5,  6,  7,  7,  8,  8,  9, 10, 11, 11, 12, 13, 13, 14,
-    15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 26,
-    27, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40,
-    41, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 52, 52, 53,
-    54, 55, 55, 56, 57, 57, 58, 59, 59, 60, 60, 60, 61, 61, 61, 62,
-};
-
-static const uint8_t sf_delta_lut[78] = {
-     0,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  3,  3,  3,  4,  4,
-     4,  5,  5,  5,  6,  6,  7,  7,  8,  8,  9, 10, 10, 11, 11, 12,
-    13, 13, 14, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23,
-    23, 24, 24, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28,
-    28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 30,
-};
-
-static const uint8_t quant_lut[230] = {
-     0,
-
-     0,  1,  2,
-
-     0,  1,  2,  3,  4,  5,  6,
-
-     0,  1,  1,  2,  2,  3,  3,  4,  5,  6,  7,  8,  9, 10, 11, 11,
-    12, 13, 13, 13, 14,
-
-     0,  1,  1,  2,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7,  8,
-     8,  9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
-    22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 29,
-    30,
-
-     0,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  3,  3,  3,  3,
-     4,  4,  4,  5,  5,  5,  6,  6,  7,  7,  7,  8,  8,  9,  9,  9,
-    10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15,
-    15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20,
-    21, 21, 22, 22, 23, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 32,
-    33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 42, 43, 44, 44, 45, 45,
-    46, 47, 47, 48, 48, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52,
-    53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57,
-    58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 60, 61, 61, 61,
-    61, 61, 61, 61, 62,
-};
-
-static const float quant_lut_mul[7] = { 0.0,  0.0,  2.0,  2.0,  5.0, 12.0,  36.6 };
-static const float quant_lut_add[7] = { 0.0,  0.0,  2.0,  7.0, 21.0, 56.0, 157.0 };
-static const uint8_t quant_lut_offset[8] = { 0, 0, 1, 4, 11, 32, 81, 230 };
-
-static void apply_mdct(NellyMoserEncodeContext *s)
-{
-    float *in0 = s->buf;
-    float *in1 = s->buf + NELLY_BUF_LEN;
-    float *in2 = s->buf + 2 * NELLY_BUF_LEN;
-
-    s->fdsp.vector_fmul        (s->in_buff,                 in0, ff_sine_128, NELLY_BUF_LEN);
-    s->fdsp.vector_fmul_reverse(s->in_buff + NELLY_BUF_LEN, in1, ff_sine_128, NELLY_BUF_LEN);
-    s->mdct_ctx.mdct_calc(&s->mdct_ctx, s->mdct_out, s->in_buff);
-
-    s->fdsp.vector_fmul        (s->in_buff,                 in1, ff_sine_128, NELLY_BUF_LEN);
-    s->fdsp.vector_fmul_reverse(s->in_buff + NELLY_BUF_LEN, in2, ff_sine_128, NELLY_BUF_LEN);
-    s->mdct_ctx.mdct_calc(&s->mdct_ctx, s->mdct_out + NELLY_BUF_LEN, s->in_buff);
-}
-
-static av_cold int encode_end(AVCodecContext *avctx)
-{
-    NellyMoserEncodeContext *s = avctx->priv_data;
-
-    ff_mdct_end(&s->mdct_ctx);
-
-    if (s->avctx->trellis) {
-        av_free(s->opt);
-        av_free(s->path);
-    }
-    ff_af_queue_close(&s->afq);
-
-    return 0;
-}
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    NellyMoserEncodeContext *s = avctx->priv_data;
-    int i, ret;
-
-    if (avctx->channels != 1) {
-        av_log(avctx, AV_LOG_ERROR, "Nellymoser supports only 1 channel\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (avctx->sample_rate != 8000 && avctx->sample_rate != 16000 &&
-        avctx->sample_rate != 11025 &&
-        avctx->sample_rate != 22050 && avctx->sample_rate != 44100 &&
-        avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL) {
-        av_log(avctx, AV_LOG_ERROR, "Nellymoser works only with 8000, 16000, 11025, 22050 and 44100 sample rate\n");
-        return AVERROR(EINVAL);
-    }
-
-    avctx->frame_size = NELLY_SAMPLES;
-    avctx->delay      = NELLY_BUF_LEN;
-    ff_af_queue_init(avctx, &s->afq);
-    s->avctx = avctx;
-    if ((ret = ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0)) < 0)
-        goto error;
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    /* Generate overlap window */
-    ff_sine_window_init(ff_sine_128, 128);
-    for (i = 0; i < POW_TABLE_SIZE; i++)
-        pow_table[i] = -pow(2, -i / 2048.0 - 3.0 + POW_TABLE_OFFSET);
-
-    if (s->avctx->trellis) {
-        s->opt  = av_malloc(NELLY_BANDS * OPT_SIZE * sizeof(float  ));
-        s->path = av_malloc(NELLY_BANDS * OPT_SIZE * sizeof(uint8_t));
-        if (!s->opt || !s->path) {
-            ret = AVERROR(ENOMEM);
-            goto error;
-        }
-    }
-
-    return 0;
-error:
-    encode_end(avctx);
-    return ret;
-}
-
-#define find_best(val, table, LUT, LUT_add, LUT_size) \
-    best_idx = \
-        LUT[av_clip ((lrintf(val) >> 8) + LUT_add, 0, LUT_size - 1)]; \
-    if (fabs(val - table[best_idx]) > fabs(val - table[best_idx + 1])) \
-        best_idx++;
-
-static void get_exponent_greedy(NellyMoserEncodeContext *s, float *cand, int *idx_table)
-{
-    int band, best_idx, power_idx = 0;
-    float power_candidate;
-
-    //base exponent
-    find_best(cand[0], ff_nelly_init_table, sf_lut, -20, 96);
-    idx_table[0] = best_idx;
-    power_idx = ff_nelly_init_table[best_idx];
-
-    for (band = 1; band < NELLY_BANDS; band++) {
-        power_candidate = cand[band] - power_idx;
-        find_best(power_candidate, ff_nelly_delta_table, sf_delta_lut, 37, 78);
-        idx_table[band] = best_idx;
-        power_idx += ff_nelly_delta_table[best_idx];
-    }
-}
-
-static inline float distance(float x, float y, int band)
-{
-    //return pow(fabs(x-y), 2.0);
-    float tmp = x - y;
-    return tmp * tmp;
-}
-
-static void get_exponent_dynamic(NellyMoserEncodeContext *s, float *cand, int *idx_table)
-{
-    int i, j, band, best_idx;
-    float power_candidate, best_val;
-
-    float  (*opt )[NELLY_BANDS] = s->opt ;
-    uint8_t(*path)[NELLY_BANDS] = s->path;
-
-    for (i = 0; i < NELLY_BANDS * OPT_SIZE; i++) {
-        opt[0][i] = INFINITY;
-    }
-
-    for (i = 0; i < 64; i++) {
-        opt[0][ff_nelly_init_table[i]] = distance(cand[0], ff_nelly_init_table[i], 0);
-        path[0][ff_nelly_init_table[i]] = i;
-    }
-
-    for (band = 1; band < NELLY_BANDS; band++) {
-        int q, c = 0;
-        float tmp;
-        int idx_min, idx_max, idx;
-        power_candidate = cand[band];
-        for (q = 1000; !c && q < OPT_SIZE; q <<= 2) {
-            idx_min = FFMAX(0, cand[band] - q);
-            idx_max = FFMIN(OPT_SIZE, cand[band - 1] + q);
-            for (i = FFMAX(0, cand[band - 1] - q); i < FFMIN(OPT_SIZE, cand[band - 1] + q); i++) {
-                if ( isinf(opt[band - 1][i]) )
-                    continue;
-                for (j = 0; j < 32; j++) {
-                    idx = i + ff_nelly_delta_table[j];
-                    if (idx > idx_max)
-                        break;
-                    if (idx >= idx_min) {
-                        tmp = opt[band - 1][i] + distance(idx, power_candidate, band);
-                        if (opt[band][idx] > tmp) {
-                            opt[band][idx] = tmp;
-                            path[band][idx] = j;
-                            c = 1;
-                        }
-                    }
-                }
-            }
-        }
-        assert(c); //FIXME
-    }
-
-    best_val = INFINITY;
-    best_idx = -1;
-    band = NELLY_BANDS - 1;
-    for (i = 0; i < OPT_SIZE; i++) {
-        if (best_val > opt[band][i]) {
-            best_val = opt[band][i];
-            best_idx = i;
-        }
-    }
-    for (band = NELLY_BANDS - 1; band >= 0; band--) {
-        idx_table[band] = path[band][best_idx];
-        if (band) {
-            best_idx -= ff_nelly_delta_table[path[band][best_idx]];
-        }
-    }
-}
-
-/**
- * Encode NELLY_SAMPLES samples. It assumes, that samples contains 3 * NELLY_BUF_LEN values
- *  @param s               encoder context
- *  @param output          output buffer
- *  @param output_size     size of output buffer
- */
-static void encode_block(NellyMoserEncodeContext *s, unsigned char *output, int output_size)
-{
-    PutBitContext pb;
-    int i, j, band, block, best_idx, power_idx = 0;
-    float power_val, coeff, coeff_sum;
-    float pows[NELLY_FILL_LEN];
-    int bits[NELLY_BUF_LEN], idx_table[NELLY_BANDS];
-    float cand[NELLY_BANDS];
-
-    apply_mdct(s);
-
-    init_put_bits(&pb, output, output_size * 8);
-
-    i = 0;
-    for (band = 0; band < NELLY_BANDS; band++) {
-        coeff_sum = 0;
-        for (j = 0; j < ff_nelly_band_sizes_table[band]; i++, j++) {
-            coeff_sum += s->mdct_out[i                ] * s->mdct_out[i                ]
-                       + s->mdct_out[i + NELLY_BUF_LEN] * s->mdct_out[i + NELLY_BUF_LEN];
-        }
-        cand[band] =
-            log(FFMAX(1.0, coeff_sum / (ff_nelly_band_sizes_table[band] << 7))) * 1024.0 / M_LN2;
-    }
-
-    if (s->avctx->trellis) {
-        get_exponent_dynamic(s, cand, idx_table);
-    } else {
-        get_exponent_greedy(s, cand, idx_table);
-    }
-
-    i = 0;
-    for (band = 0; band < NELLY_BANDS; band++) {
-        if (band) {
-            power_idx += ff_nelly_delta_table[idx_table[band]];
-            put_bits(&pb, 5, idx_table[band]);
-        } else {
-            power_idx = ff_nelly_init_table[idx_table[0]];
-            put_bits(&pb, 6, idx_table[0]);
-        }
-        power_val = pow_table[power_idx & 0x7FF] / (1 << ((power_idx >> 11) + POW_TABLE_OFFSET));
-        for (j = 0; j < ff_nelly_band_sizes_table[band]; i++, j++) {
-            s->mdct_out[i] *= power_val;
-            s->mdct_out[i + NELLY_BUF_LEN] *= power_val;
-            pows[i] = power_idx;
-        }
-    }
-
-    ff_nelly_get_sample_bits(pows, bits);
-
-    for (block = 0; block < 2; block++) {
-        for (i = 0; i < NELLY_FILL_LEN; i++) {
-            if (bits[i] > 0) {
-                const float *table = ff_nelly_dequantization_table + (1 << bits[i]) - 1;
-                coeff = s->mdct_out[block * NELLY_BUF_LEN + i];
-                best_idx =
-                    quant_lut[av_clip (
-                            coeff * quant_lut_mul[bits[i]] + quant_lut_add[bits[i]],
-                            quant_lut_offset[bits[i]],
-                            quant_lut_offset[bits[i]+1] - 1
-                            )];
-                if (fabs(coeff - table[best_idx]) > fabs(coeff - table[best_idx + 1]))
-                    best_idx++;
-
-                put_bits(&pb, bits[i], best_idx);
-            }
-        }
-        if (!block)
-            put_bits(&pb, NELLY_HEADER_BITS + NELLY_DETAIL_BITS - put_bits_count(&pb), 0);
-    }
-
-    flush_put_bits(&pb);
-    memset(put_bits_ptr(&pb), 0, output + output_size - put_bits_ptr(&pb));
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                        const AVFrame *frame, int *got_packet_ptr)
-{
-    NellyMoserEncodeContext *s = avctx->priv_data;
-    int ret;
-
-    if (s->last_frame)
-        return 0;
-
-    memcpy(s->buf, s->buf + NELLY_SAMPLES, NELLY_BUF_LEN * sizeof(*s->buf));
-    if (frame) {
-        memcpy(s->buf + NELLY_BUF_LEN, frame->data[0],
-               frame->nb_samples * sizeof(*s->buf));
-        if (frame->nb_samples < NELLY_SAMPLES) {
-            memset(s->buf + NELLY_BUF_LEN + frame->nb_samples, 0,
-                   (NELLY_SAMPLES - frame->nb_samples) * sizeof(*s->buf));
-            if (frame->nb_samples >= NELLY_BUF_LEN)
-                s->last_frame = 1;
-        }
-        if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
-            return ret;
-    } else {
-        memset(s->buf + NELLY_BUF_LEN, 0, NELLY_SAMPLES * sizeof(*s->buf));
-        s->last_frame = 1;
-    }
-
-    if ((ret = ff_alloc_packet(avpkt, NELLY_BLOCK_LEN))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-    encode_block(s, avpkt->data, avpkt->size);
-
-    /* Get the next frame pts/duration */
-    ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
-                       &avpkt->duration);
-
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-AVCodec ff_nellymoser_encoder = {
-    .name           = "nellymoser",
-    .long_name      = NULL_IF_CONFIG_SMALL("Nellymoser Asao"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_NELLYMOSER,
-    .priv_data_size = sizeof(NellyMoserEncodeContext),
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = encode_end,
-    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/noise_bsf.c b/deps/libav/libavcodec/noise_bsf.c
deleted file mode 100644
index 3e552e2..0000000
--- a/deps/libav/libavcodec/noise_bsf.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "libavutil/mem.h"
-
-
-static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe){
-    unsigned int *state= bsfc->priv_data;
-    int amount= args ? atoi(args) : (*state % 10001+1);
-    int i;
-
-    *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
-    memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    for(i=0; i<buf_size; i++){
-        (*state) += (*poutbuf)[i] + 1;
-        if(*state % amount == 0)
-            (*poutbuf)[i] = *state;
-    }
-    return 1;
-}
-
-AVBitStreamFilter ff_noise_bsf={
-    "noise",
-    sizeof(int),
-    noise,
-};
diff --git a/deps/libav/libavcodec/nuv.c b/deps/libav/libavcodec/nuv.c
deleted file mode 100644
index 4d244bd..0000000
--- a/deps/libav/libavcodec/nuv.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * NuppelVideo decoder
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/bswap.h"
-#include "libavutil/common.h"
-#include "libavutil/lzo.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "rtjpeg.h"
-
-typedef struct {
-    AVFrame *pic;
-    int codec_frameheader;
-    int quality;
-    int width, height;
-    unsigned int decomp_size;
-    unsigned char *decomp_buf;
-    uint32_t lq[64], cq[64];
-    RTJpegContext rtj;
-    DSPContext dsp;
-} NuvContext;
-
-static const uint8_t fallback_lquant[] = {
-    16,  11,  10,  16,  24,  40,  51,  61,
-    12,  12,  14,  19,  26,  58,  60,  55,
-    14,  13,  16,  24,  40,  57,  69,  56,
-    14,  17,  22,  29,  51,  87,  80,  62,
-    18,  22,  37,  56,  68, 109, 103,  77,
-    24,  35,  55,  64,  81, 104, 113,  92,
-    49,  64,  78,  87, 103, 121, 120, 101,
-    72,  92,  95,  98, 112, 100, 103,  99
-};
-
-static const uint8_t fallback_cquant[] = {
-    17, 18, 24, 47, 99, 99, 99, 99,
-    18, 21, 26, 66, 99, 99, 99, 99,
-    24, 26, 56, 99, 99, 99, 99, 99,
-    47, 66, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99
-};
-
-/**
- * @brief copy frame data from buffer to AVFrame, handling stride.
- * @param f destination AVFrame
- * @param src source buffer, does not use any line-stride
- * @param width width of the video frame
- * @param height height of the video frame
- */
-static void copy_frame(AVFrame *f, const uint8_t *src, int width, int height)
-{
-    AVPicture pic;
-    avpicture_fill(&pic, src, AV_PIX_FMT_YUV420P, width, height);
-    av_picture_copy((AVPicture *)f, &pic, AV_PIX_FMT_YUV420P, width, height);
-}
-
-/**
- * @brief extract quantization tables from codec data into our context
- */
-static int get_quant(AVCodecContext *avctx, NuvContext *c, const uint8_t *buf,
-                     int size)
-{
-    int i;
-    if (size < 2 * 64 * 4) {
-        av_log(avctx, AV_LOG_ERROR, "insufficient rtjpeg quant data\n");
-        return AVERROR_INVALIDDATA;
-    }
-    for (i = 0; i < 64; i++, buf += 4)
-        c->lq[i] = AV_RL32(buf);
-    for (i = 0; i < 64; i++, buf += 4)
-        c->cq[i] = AV_RL32(buf);
-    return 0;
-}
-
-/**
- * @brief set quantization tables from a quality value
- */
-static void get_quant_quality(NuvContext *c, int quality)
-{
-    int i;
-    quality = FFMAX(quality, 1);
-    for (i = 0; i < 64; i++) {
-        c->lq[i] = (fallback_lquant[i] << 7) / quality;
-        c->cq[i] = (fallback_cquant[i] << 7) / quality;
-    }
-}
-
-static int codec_reinit(AVCodecContext *avctx, int width, int height,
-                        int quality)
-{
-    NuvContext *c = avctx->priv_data;
-    int ret;
-
-    width  = FFALIGN(width,  2);
-    height = FFALIGN(height, 2);
-    if (quality >= 0)
-        get_quant_quality(c, quality);
-    if (width != c->width || height != c->height) {
-        void *ptr;
-        if ((ret = av_image_check_size(height, width, 0, avctx)) < 0)
-            return ret;
-        avctx->width  = c->width  = width;
-        avctx->height = c->height = height;
-        ptr = av_fast_realloc(c->decomp_buf, &c->decomp_size,
-                              c->height * c->width * 3 / 2 +
-                              FF_INPUT_BUFFER_PADDING_SIZE +
-                              RTJPEG_HEADER_SIZE);
-        if (!ptr) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Can't allocate decompression buffer.\n");
-            return AVERROR(ENOMEM);
-        } else
-            c->decomp_buf = ptr;
-        ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height,
-                              c->lq, c->cq);
-        av_frame_unref(c->pic);
-    } else if (quality != c->quality)
-        ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height,
-                              c->lq, c->cq);
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    NuvContext *c      = avctx->priv_data;
-    AVFrame *picture   = data;
-    int orig_size      = buf_size;
-    int keyframe, ret;
-    int result, init_frame = !avctx->frame_number;
-    enum {
-        NUV_UNCOMPRESSED  = '0',
-        NUV_RTJPEG        = '1',
-        NUV_RTJPEG_IN_LZO = '2',
-        NUV_LZO           = '3',
-        NUV_BLACK         = 'N',
-        NUV_COPY_LAST     = 'L'
-    } comptype;
-
-    if (buf_size < 12) {
-        av_log(avctx, AV_LOG_ERROR, "coded frame too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    // codec data (rtjpeg quant tables)
-    if (buf[0] == 'D' && buf[1] == 'R') {
-        int ret;
-        // skip rest of the frameheader.
-        buf       = &buf[12];
-        buf_size -= 12;
-        ret       = get_quant(avctx, c, buf, buf_size);
-        if (ret < 0)
-            return ret;
-        ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq,
-                              c->cq);
-        return orig_size;
-    }
-
-    if (buf[0] != 'V' || buf_size < 12) {
-        av_log(avctx, AV_LOG_ERROR, "not a nuv video frame\n");
-        return AVERROR_INVALIDDATA;
-    }
-    comptype = buf[1];
-    switch (comptype) {
-    case NUV_RTJPEG_IN_LZO:
-    case NUV_RTJPEG:
-        keyframe = !buf[2];
-        break;
-    case NUV_COPY_LAST:
-        keyframe = 0;
-        break;
-    default:
-        keyframe = 1;
-        break;
-    }
-    // skip rest of the frameheader.
-    buf       = &buf[12];
-    buf_size -= 12;
-    if (comptype == NUV_RTJPEG_IN_LZO || comptype == NUV_LZO) {
-        int outlen = c->decomp_size - FF_INPUT_BUFFER_PADDING_SIZE;
-        int inlen  = buf_size;
-        if (av_lzo1x_decode(c->decomp_buf, &outlen, buf, &inlen)) {
-            av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
-            return AVERROR_INVALIDDATA;
-        }
-        buf      = c->decomp_buf;
-        buf_size = outlen;
-    }
-    if (c->codec_frameheader) {
-        int w, h, q;
-        if (buf_size < RTJPEG_HEADER_SIZE || buf[4] != RTJPEG_HEADER_SIZE ||
-            buf[5] != RTJPEG_FILE_VERSION) {
-            av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n");
-            return AVERROR_INVALIDDATA;
-        }
-        w = AV_RL16(&buf[6]);
-        h = AV_RL16(&buf[8]);
-        q = buf[10];
-        if ((result = codec_reinit(avctx, w, h, q)) < 0)
-            return result;
-        if (comptype == NUV_RTJPEG_IN_LZO || comptype == NUV_LZO)
-            buf = c->decomp_buf;
-        buf       = &buf[RTJPEG_HEADER_SIZE];
-        buf_size -= RTJPEG_HEADER_SIZE;
-    }
-
-    if (keyframe) {
-        av_frame_unref(c->pic);
-        init_frame = 1;
-    }
-
-    result = ff_reget_buffer(avctx, c->pic);
-    if (result < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return result;
-    }
-    if (init_frame) {
-        memset(c->pic->data[0], 0,    avctx->height * c->pic->linesize[0]);
-        memset(c->pic->data[1], 0x80, avctx->height * c->pic->linesize[1] / 2);
-        memset(c->pic->data[2], 0x80, avctx->height * c->pic->linesize[2] / 2);
-    }
-
-    c->pic->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
-    c->pic->key_frame = keyframe;
-    // decompress/copy/whatever data
-    switch (comptype) {
-    case NUV_LZO:
-    case NUV_UNCOMPRESSED: {
-        int height = c->height;
-        if (buf_size < c->width * height * 3 / 2) {
-            av_log(avctx, AV_LOG_ERROR, "uncompressed frame too short\n");
-            height = buf_size / c->width / 3 * 2;
-        }
-        copy_frame(c->pic, buf, c->width, height);
-        break;
-    }
-    case NUV_RTJPEG_IN_LZO:
-    case NUV_RTJPEG:
-        ret = ff_rtjpeg_decode_frame_yuv420(&c->rtj, c->pic, buf, buf_size);
-        if (ret < 0)
-            return ret;
-        break;
-    case NUV_BLACK:
-        memset(c->pic->data[0], 0, c->width * c->height);
-        memset(c->pic->data[1], 128, c->width * c->height / 4);
-        memset(c->pic->data[2], 128, c->width * c->height / 4);
-        break;
-    case NUV_COPY_LAST:
-        /* nothing more to do here */
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "unknown compression\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((result = av_frame_ref(picture, c->pic)) < 0)
-        return result;
-
-    *got_frame = 1;
-    return orig_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    NuvContext *c  = avctx->priv_data;
-    int ret;
-
-    c->pic = av_frame_alloc();
-    if (!c->pic)
-        return AVERROR(ENOMEM);
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    c->decomp_buf  = NULL;
-    c->quality     = -1;
-    c->width       = 0;
-    c->height      = 0;
-
-    c->codec_frameheader = avctx->codec_tag == MKTAG('R', 'J', 'P', 'G');
-
-    if (avctx->extradata_size)
-        get_quant(avctx, c, avctx->extradata, avctx->extradata_size);
-
-    ff_dsputil_init(&c->dsp, avctx);
-
-    if ((ret = codec_reinit(avctx, avctx->width, avctx->height, -1)) < 0)
-        return ret;
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    NuvContext *c = avctx->priv_data;
-
-    av_freep(&c->decomp_buf);
-    av_frame_free(&c->pic);
-
-    return 0;
-}
-
-AVCodec ff_nuv_decoder = {
-    .name           = "nuv",
-    .long_name      = NULL_IF_CONFIG_SMALL("NuppelVideo/RTJPEG"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_NUV,
-    .priv_data_size = sizeof(NuvContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/options.c b/deps/libav/libavcodec/options.c
deleted file mode 100644
index 2e41ce4..0000000
--- a/deps/libav/libavcodec/options.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Options definition for AVCodecContext.
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/avassert.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include <float.h>              /* FLT_MIN, FLT_MAX */
-#include <string.h>
-
-#include "options_table.h"
-
-static const char* context_to_name(void* ptr) {
-    AVCodecContext *avc= ptr;
-
-    if(avc && avc->codec && avc->codec->name)
-        return avc->codec->name;
-    else
-        return "NULL";
-}
-
-static void *codec_child_next(void *obj, void *prev)
-{
-    AVCodecContext *s = obj;
-    if (!prev && s->codec && s->codec->priv_class && s->priv_data)
-        return s->priv_data;
-    return NULL;
-}
-
-static const AVClass *codec_child_class_next(const AVClass *prev)
-{
-    AVCodec *c = NULL;
-
-    /* find the codec that corresponds to prev */
-    while (prev && (c = av_codec_next(c)))
-        if (c->priv_class == prev)
-            break;
-
-    /* find next codec with priv options */
-    while (c = av_codec_next(c))
-        if (c->priv_class)
-            return c->priv_class;
-    return NULL;
-}
-
-static const AVClass av_codec_context_class = {
-    .class_name              = "AVCodecContext",
-    .item_name               = context_to_name,
-    .option                  = avcodec_options,
-    .version                 = LIBAVUTIL_VERSION_INT,
-    .log_level_offset_offset = offsetof(AVCodecContext, log_level_offset),
-    .child_next              = codec_child_next,
-    .child_class_next        = codec_child_class_next,
-};
-
-int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
-{
-    memset(s, 0, sizeof(AVCodecContext));
-
-    s->av_class = &av_codec_context_class;
-
-    s->codec_type = codec ? codec->type : AVMEDIA_TYPE_UNKNOWN;
-    s->codec      = codec;
-    av_opt_set_defaults(s);
-
-    s->time_base           = (AVRational){0,1};
-    s->get_buffer2         = avcodec_default_get_buffer2;
-    s->get_format          = avcodec_default_get_format;
-    s->execute             = avcodec_default_execute;
-    s->execute2            = avcodec_default_execute2;
-    s->sample_aspect_ratio = (AVRational){0,1};
-    s->pix_fmt             = AV_PIX_FMT_NONE;
-    s->sample_fmt          = AV_SAMPLE_FMT_NONE;
-
-    s->reordered_opaque    = AV_NOPTS_VALUE;
-    if(codec && codec->priv_data_size){
-        if(!s->priv_data){
-            s->priv_data= av_mallocz(codec->priv_data_size);
-            if (!s->priv_data) {
-                return AVERROR(ENOMEM);
-            }
-        }
-        if(codec->priv_class){
-            *(const AVClass**)s->priv_data = codec->priv_class;
-            av_opt_set_defaults(s->priv_data);
-        }
-    }
-    if (codec && codec->defaults) {
-        int ret;
-        const AVCodecDefault *d = codec->defaults;
-        while (d->key) {
-            ret = av_opt_set(s, d->key, d->value, 0);
-            av_assert0(ret >= 0);
-            d++;
-        }
-    }
-    return 0;
-}
-
-AVCodecContext *avcodec_alloc_context3(const AVCodec *codec)
-{
-    AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
-
-    if(avctx==NULL) return NULL;
-
-    if(avcodec_get_context_defaults3(avctx, codec) < 0){
-        av_free(avctx);
-        return NULL;
-    }
-
-    return avctx;
-}
-
-int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
-{
-    if (avcodec_is_open(dest)) { // check that the dest context is uninitialized
-        av_log(dest, AV_LOG_ERROR,
-               "Tried to copy AVCodecContext %p into already-initialized %p\n",
-               src, dest);
-        return AVERROR(EINVAL);
-    }
-    memcpy(dest, src, sizeof(*dest));
-
-    /* set values specific to opened codecs back to their default state */
-    dest->priv_data       = NULL;
-    dest->codec           = NULL;
-    dest->slice_offset    = NULL;
-    dest->hwaccel         = NULL;
-    dest->internal        = NULL;
-
-    /* reallocate values that should be allocated separately */
-    dest->rc_eq           = NULL;
-    dest->extradata       = NULL;
-    dest->intra_matrix    = NULL;
-    dest->inter_matrix    = NULL;
-    dest->rc_override     = NULL;
-    if (src->rc_eq) {
-        dest->rc_eq = av_strdup(src->rc_eq);
-        if (!dest->rc_eq)
-            return AVERROR(ENOMEM);
-    }
-
-#define alloc_and_copy_or_fail(obj, size, pad) \
-    if (src->obj && size > 0) { \
-        dest->obj = av_malloc(size + pad); \
-        if (!dest->obj) \
-            goto fail; \
-        memcpy(dest->obj, src->obj, size); \
-        if (pad) \
-            memset(((uint8_t *) dest->obj) + size, 0, pad); \
-    }
-    alloc_and_copy_or_fail(extradata,    src->extradata_size,
-                           FF_INPUT_BUFFER_PADDING_SIZE);
-    alloc_and_copy_or_fail(intra_matrix, 64 * sizeof(int16_t), 0);
-    alloc_and_copy_or_fail(inter_matrix, 64 * sizeof(int16_t), 0);
-    alloc_and_copy_or_fail(rc_override,  src->rc_override_count * sizeof(*src->rc_override), 0);
-#undef alloc_and_copy_or_fail
-
-    return 0;
-
-fail:
-    av_freep(&dest->rc_override);
-    av_freep(&dest->intra_matrix);
-    av_freep(&dest->inter_matrix);
-    av_freep(&dest->extradata);
-    av_freep(&dest->rc_eq);
-    return AVERROR(ENOMEM);
-}
-
-const AVClass *avcodec_get_class(void)
-{
-    return &av_codec_context_class;
-}
diff --git a/deps/libav/libavcodec/options_table.h b/deps/libav/libavcodec/options_table.h
deleted file mode 100644
index 8b3a4b6..0000000
--- a/deps/libav/libavcodec/options_table.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_OPTIONS_TABLE_H
-#define AVCODEC_OPTIONS_TABLE_H
-
-#include <float.h>
-#include <limits.h>
-#include <stdint.h>
-
-#include "libavutil/opt.h"
-#include "avcodec.h"
-#include "version.h"
-#include "config.h"
-
-#define OFFSET(x) offsetof(AVCodecContext,x)
-#define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C
-//these names are too long to be readable
-#define V AV_OPT_FLAG_VIDEO_PARAM
-#define A AV_OPT_FLAG_AUDIO_PARAM
-#define S AV_OPT_FLAG_SUBTITLE_PARAM
-#define E AV_OPT_FLAG_ENCODING_PARAM
-#define D AV_OPT_FLAG_DECODING_PARAM
-
-#define AV_CODEC_DEFAULT_BITRATE 200*1000
-
-static const AVOption avcodec_options[] = {
-{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = AV_CODEC_DEFAULT_BITRATE }, INT_MIN, INT_MAX, V|A|E},
-{"bt", "Set video bitrate tolerance (in bits/s). 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 minimum/maximum bitrate. Lowering tolerance too much has an adverse effect on quality.",
-       OFFSET(bit_rate_tolerance), AV_OPT_TYPE_INT, {.i64 = AV_CODEC_DEFAULT_BITRATE*20 }, 1, INT_MAX, V|E},
-{"flags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, 0, UINT_MAX, V|A|E|D, "flags"},
-{"unaligned", "allow decoders to produce unaligned output", 0, AV_OPT_TYPE_CONST, { .i64 = CODEC_FLAG_UNALIGNED }, INT_MIN, INT_MAX, V | D, "flags" },
-{"mv4", "use four motion vectors per macroblock (MPEG-4)", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_4MV }, INT_MIN, INT_MAX, V|E, "flags"},
-{"qpel", "use 1/4-pel motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, "flags"},
-{"loop", "use loop filter", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, "flags"},
-{"qscale", "use fixed qscale", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, "flags"},
-{"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"},
-{"mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_MV0 }, INT_MIN, INT_MAX, V|E, "flags"},
-{"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"},
-{"pass1", "use internal 2-pass ratecontrol in first  pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"},
-{"pass2", "use internal 2-pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"},
-{"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"},
-{"emu_edge", "do not draw edges", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_EMU_EDGE }, INT_MIN, INT_MAX, 0, "flags"},
-{"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"},
-{"truncated", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, 0, "flags"},
-{"naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_NORMALIZE_AQP }, INT_MIN, INT_MAX, V|E, "flags"},
-{"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"},
-{"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"},
-{"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
-{"bitexact", "use only bitexact functions (except (I)DCT)", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, "flags"},
-{"aic", "H.263 advanced intra coding / MPEG-4 AC prediction", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, "flags"},
-{"ilme", "interlaced motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, "flags"},
-{"cgop", "closed GOP", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"},
-{"output_corrupt", "Output even potentially corrupted frames", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_OUTPUT_CORRUPT }, INT_MIN, INT_MAX, V|D, "flags"},
-{"fast", "allow non-spec-compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"},
-{"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},
-{"ignorecrop", "ignore cropping information from sps", 1, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"},
-{"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"},
-{"me_method", "set motion estimation method", OFFSET(me_method), AV_OPT_TYPE_INT, {.i64 = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method"},
-{"zero", "zero motion estimation (fastest)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ZERO }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"full", "full motion estimation (slowest)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"epzs", "EPZS motion estimation (default)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"esa", "esa motion estimation (alias for full)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"tesa", "tesa motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_TESA }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"dia", "diamond motion estimation (alias for EPZS)", 0, AV_OPT_TYPE_CONST, {.i64 = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"log", "log motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_LOG }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"phods", "phods motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_PHODS }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"x1", "X1 motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_X1 }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"hex", "hex motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_HEX }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_UMH }, INT_MIN, INT_MAX, V|E, "me_method" },
-{"extradata_size", NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, INT_MIN, INT_MAX},
-{"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
-{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
-{"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
-{"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
-{"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
-{"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"delay", NULL, OFFSET(delay), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"qcomp", "video quantizer scale compression (VBR). Constant of ratecontrol equation. "
-          "Recommended range for default rc_eq: 0.0-1.0",
-          OFFSET(qcompress), AV_OPT_TYPE_FLOAT, {.dbl = 0.5 }, -FLT_MAX, FLT_MAX, V|E},
-{"qblur", "video quantizer scale blur (VBR)", OFFSET(qblur), AV_OPT_TYPE_FLOAT, {.dbl = 0.5 }, -1, FLT_MAX, V|E},
-{"qmin", "minimum video quantizer scale (VBR)", OFFSET(qmin), AV_OPT_TYPE_INT, {.i64 = 2 }, -1, 69, V|E},
-{"qmax", "maximum video quantizer scale (VBR)", OFFSET(qmax), AV_OPT_TYPE_INT, {.i64 = 31 }, -1, 69, V|E},
-{"qdiff", "maximum difference between the quantizer scales (VBR)", OFFSET(max_qdiff), AV_OPT_TYPE_INT, {.i64 = 3 }, INT_MIN, INT_MAX, V|E},
-{"bf", "use 'frames' B frames", OFFSET(max_b_frames), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, -1, INT_MAX, V|E},
-{"b_qfactor", "QP factor between P- and B-frames", OFFSET(b_quant_factor), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E},
-{"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, V|E},
-{"ps", "RTP payload size in bytes", OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"mv_bits", NULL, OFFSET(mv_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"header_bits", NULL, OFFSET(header_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"i_tex_bits", NULL, OFFSET(i_tex_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"p_tex_bits", NULL, OFFSET(p_tex_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"i_count", NULL, OFFSET(i_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"p_count", NULL, OFFSET(p_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"skip_count", NULL, OFFSET(skip_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"misc_bits", NULL, OFFSET(misc_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"frame_bits", NULL, OFFSET(frame_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"codec_tag", NULL, OFFSET(codec_tag), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"bug", "work around not autodetected encoder bugs", OFFSET(workaround_bugs), AV_OPT_TYPE_FLAGS, {.i64 = FF_BUG_AUTODETECT }, INT_MIN, INT_MAX, V|D, "bug"},
-{"autodetect", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_AUTODETECT }, INT_MIN, INT_MAX, V|D, "bug"},
-#if FF_API_OLD_MSMPEG4
-{"old_msmpeg4", "some old lavc-generated MSMPEG4v3 files (no autodetection)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_OLD_MSMPEG4 }, INT_MIN, INT_MAX, V|D, "bug"},
-#endif
-{"xvid_ilace", "Xvid interlacing bug (autodetected if FOURCC == XVIX)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_XVID_ILACE }, INT_MIN, INT_MAX, V|D, "bug"},
-{"ump4", "(autodetected if FOURCC == UMP4)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_UMP4 }, INT_MIN, INT_MAX, V|D, "bug"},
-{"no_padding", "padding bug (autodetected)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_NO_PADDING }, INT_MIN, INT_MAX, V|D, "bug"},
-{"amv", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_AMV }, INT_MIN, INT_MAX, V|D, "bug"},
-#if FF_API_AC_VLC
-{"ac_vlc", "illegal VLC bug (autodetected per FOURCC)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_AC_VLC }, INT_MIN, INT_MAX, V|D, "bug"},
-#endif
-{"qpel_chroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_QPEL_CHROMA }, INT_MIN, INT_MAX, V|D, "bug"},
-{"std_qpel", "old standard qpel (autodetected per FOURCC/version)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_STD_QPEL }, INT_MIN, INT_MAX, V|D, "bug"},
-{"qpel_chroma2", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_QPEL_CHROMA2 }, INT_MIN, INT_MAX, V|D, "bug"},
-{"direct_blocksize", "direct-qpel-blocksize bug (autodetected per FOURCC/version)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_DIRECT_BLOCKSIZE }, INT_MIN, INT_MAX, V|D, "bug"},
-{"edge", "edge padding bug (autodetected per FOURCC/version)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_EDGE }, INT_MIN, INT_MAX, V|D, "bug"},
-{"hpel_chroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_HPEL_CHROMA }, INT_MIN, INT_MAX, V|D, "bug"},
-{"dc_clip", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_DC_CLIP }, INT_MIN, INT_MAX, V|D, "bug"},
-{"ms", "work around various bugs in Microsoft's broken decoders", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_MS }, INT_MIN, INT_MAX, V|D, "bug"},
-{"trunc", "truncated frames", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_TRUNCATED}, INT_MIN, INT_MAX, V|D, "bug"},
-{"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|V|D|E, "strict"},
-{"very", "strictly conform to a older more strict version of the spec or reference software", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_VERY_STRICT }, INT_MIN, INT_MAX, V|D|E, "strict"},
-{"strict", "strictly conform to all the things in the spec no matter what the consequences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, V|D|E, "strict"},
-{"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, V|D|E, "strict"},
-{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, V|D|E, "strict"},
-{"experimental", "allow non-standardized experimental things", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, V|D|E, "strict"},
-{"b_qoffset", "QP offset between P- and B-frames", OFFSET(b_quant_offset), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E},
-{"err_detect", "set error detection flags", OFFSET(err_recognition), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, A|V|D, "err_detect"},
-{"crccheck", "verify embedded CRCs", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, V|D, "err_detect"},
-{"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, V|D, "err_detect"},
-{"buffer", "detect improper bitstream length", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BUFFER }, INT_MIN, INT_MAX, V|D, "err_detect"},
-{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, V|D, "err_detect"},
-{"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"qsquish", "how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function)", OFFSET(rc_qsquish), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 99, V|E},
-{"rc_qmod_amp", "experimental quantizer modulation", OFFSET(rc_qmod_amp), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E},
-{"rc_qmod_freq", "experimental quantizer modulation", OFFSET(rc_qmod_freq), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"rc_override_count", NULL, OFFSET(rc_override_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"rc_eq", "Set rate control equation. When computing the expression, besides the standard functions "
-          "defined in the section 'Expression Evaluation', the following functions are available: "
-          "bits2qp(bits), qp2bits(qp). Also the following constants are available: iTex pTex tex mv "
-          "fCode iCount mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex avgTex.",
-          OFFSET(rc_eq), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, V|E},
-{"maxrate", "Set maximum bitrate tolerance (in bits/s). Requires bufsize to be set.", OFFSET(rc_max_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
-{"minrate", "Set minimum bitrate tolerance (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise.",
-            OFFSET(rc_min_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
-{"bufsize", "set ratecontrol buffer size (in bits)", OFFSET(rc_buffer_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|V|E},
-{"rc_buf_aggressivity", "currently useless", OFFSET(rc_buffer_aggressivity), AV_OPT_TYPE_FLOAT, {.dbl = 1.0 }, -FLT_MAX, FLT_MAX, V|E},
-{"i_qfactor", "QP factor between P- and I-frames", OFFSET(i_quant_factor), AV_OPT_TYPE_FLOAT, {.dbl = -0.8 }, -FLT_MAX, FLT_MAX, V|E},
-{"i_qoffset", "QP offset between P- and I-frames", OFFSET(i_quant_offset), AV_OPT_TYPE_FLOAT, {.dbl = 0.0 }, -FLT_MAX, FLT_MAX, V|E},
-{"rc_init_cplx", "initial complexity for 1-pass encoding", OFFSET(rc_initial_cplx), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E},
-{"dct", "DCT algorithm", OFFSET(dct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|E, "dct"},
-{"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, "dct"},
-{"fastint", "fast integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FASTINT }, INT_MIN, INT_MAX, V|E, "dct"},
-{"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_INT }, INT_MIN, INT_MAX, V|E, "dct"},
-{"mmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_MMX }, INT_MIN, INT_MAX, V|E, "dct"},
-{"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_ALTIVEC }, INT_MIN, INT_MAX, V|E, "dct"},
-{"faan", "floating point AAN DCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FAAN }, INT_MIN, INT_MAX, V|E, "dct"},
-{"lumi_mask", "compresses bright areas stronger than medium ones", OFFSET(lumi_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
-{"tcplx_mask", "temporal complexity masking", OFFSET(temporal_cplx_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
-{"scplx_mask", "spatial complexity masking", OFFSET(spatial_cplx_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
-{"p_mask", "inter masking", OFFSET(p_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
-{"dark_mask", "compresses dark areas stronger than medium ones", OFFSET(dark_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
-{"idct", "select IDCT implementation", OFFSET(idct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|E|D, "idct"},
-{"auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_AUTO }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"int", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_INT }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simple", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLE }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simplemmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"arm", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"sh4", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SH4 }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simplearm", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simplearmv5te", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV5TE }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simplearmv6", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV6 }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simpleneon", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLENEON }, INT_MIN, INT_MAX, V|E|D, "idct"},
-#if FF_API_ARCH_ALPHA
-{"simplealpha", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEALPHA }, INT_MIN, INT_MAX, V|E|D, "idct"},
-#endif
-{"ipp", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"xvidmmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVIDMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"faani", "floating point AAN IDCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
-{"slice_count", NULL, OFFSET(slice_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"ec", "set error concealment strategy", OFFSET(error_concealment), AV_OPT_TYPE_FLAGS, {.i64 = 3 }, INT_MIN, INT_MAX, V|D, "ec"},
-{"guess_mvs", "iterative motion vector (MV) search (slow)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_GUESS_MVS }, INT_MIN, INT_MAX, V|D, "ec"},
-{"deblock", "use strong deblock filter for damaged MBs", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_DEBLOCK }, INT_MIN, INT_MAX, V|D, "ec"},
-{"bits_per_coded_sample", NULL, OFFSET(bits_per_coded_sample), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"pred", "prediction method", OFFSET(prediction_method), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "pred"},
-{"left", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PRED_LEFT }, INT_MIN, INT_MAX, V|E, "pred"},
-{"plane", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PRED_PLANE }, INT_MIN, INT_MAX, V|E, "pred"},
-{"median", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PRED_MEDIAN }, INT_MIN, INT_MAX, V|E, "pred"},
-{"aspect", "sample aspect ratio", OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, 10, V|E},
-{"debug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, 0, INT_MAX, V|A|S|E|D, "debug"},
-{"pict", "picture info", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_PICT_INFO }, INT_MIN, INT_MAX, V|D, "debug"},
-{"rc", "rate control", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_RC }, INT_MIN, INT_MAX, V|E, "debug"},
-{"bitstream", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BITSTREAM }, INT_MIN, INT_MAX, V|D, "debug"},
-{"mb_type", "macroblock (MB) type", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_MB_TYPE }, INT_MIN, INT_MAX, V|D, "debug"},
-{"qp", "per-block quantization parameter (QP)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_QP }, INT_MIN, INT_MAX, V|D, "debug"},
-#if FF_API_DEBUG_MV
-{"mv", "motion vector", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_MV }, INT_MIN, INT_MAX, V|D, "debug"},
-#endif
-{"dct_coeff", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_DCT_COEFF }, INT_MIN, INT_MAX, V|D, "debug"},
-{"skip", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_SKIP }, INT_MIN, INT_MAX, V|D, "debug"},
-{"startcode", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_STARTCODE }, INT_MIN, INT_MAX, V|D, "debug"},
-{"pts", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_PTS }, INT_MIN, INT_MAX, V|D, "debug"},
-{"er", "error recognition", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_ER }, INT_MIN, INT_MAX, V|D, "debug"},
-{"mmco", "memory management control operations (H.264)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_MMCO }, INT_MIN, INT_MAX, V|D, "debug"},
-{"bugs", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BUGS }, INT_MIN, INT_MAX, V|D, "debug"},
-#if FF_API_DEBUG_MV
-{"vis_qp", "visualize quantization parameter (QP), lower QP are tinted greener", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_QP }, INT_MIN, INT_MAX, V|D, "debug"},
-{"vis_mb_type", "visualize block types", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_MB_TYPE }, INT_MIN, INT_MAX, V|D, "debug"},
-#endif
-{"buffers", "picture buffer allocations", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BUFFERS }, INT_MIN, INT_MAX, V|D, "debug"},
-{"thread_ops", "threading operations", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_THREADS }, INT_MIN, INT_MAX, V|D, "debug"},
-#if FF_API_DEBUG_MV
-{"vismv", "visualize motion vectors (MVs)", OFFSET(debug_mv), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|D, "debug_mv"},
-{"pf", "forward predicted MVs of P-frames", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_MV_P_FOR }, INT_MIN, INT_MAX, V|D, "debug_mv"},
-{"bf", "forward predicted MVs of B-frames", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_MV_B_FOR }, INT_MIN, INT_MAX, V|D, "debug_mv"},
-{"bb", "backward predicted MVs of B-frames", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_MV_B_BACK }, INT_MIN, INT_MAX, V|D, "debug_mv"},
-#endif
-{"cmp", "full-pel ME compare function", OFFSET(me_cmp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"subcmp", "sub-pel ME compare function", OFFSET(me_sub_cmp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"mbcmp", "macroblock compare function", OFFSET(mb_cmp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"ildctcmp", "interlaced DCT compare function", OFFSET(ildct_cmp), AV_OPT_TYPE_INT, {.i64 = FF_CMP_VSAD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"dia_size", "diamond type & size for motion estimation", OFFSET(dia_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"last_pred", "amount of motion predictors from the previous frame", OFFSET(last_predictor_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"preme", "pre motion estimation", OFFSET(pre_me), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"precmp", "pre motion estimation compare function", OFFSET(me_pre_cmp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"sad", "sum of absolute differences, fast (default)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SAD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"sse", "sum of squared errors", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SSE }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"satd", "sum of absolute Hadamard transformed differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SATD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"dct", "sum of absolute DCT transformed differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_DCT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"psnr", "sum of squared quantization errors (avoid, low quality)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_PSNR }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"bit", "number of bits needed for the block", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_BIT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"rd", "rate distortion optimal, slow", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_RD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"zero", "0", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_ZERO }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"vsad", "sum of absolute vertical differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_VSAD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"vsse", "sum of squared vertical differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_VSSE }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"nsse", "noise preserving sum of squared differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_NSSE }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"dctmax", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"chroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_CHROMA }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"pre_dia_size", "diamond type & size for motion estimation pre-pass", OFFSET(pre_dia_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"subq", "sub-pel motion estimation quality", OFFSET(me_subpel_quality), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E},
-{"dtg_active_format", NULL, OFFSET(dtg_active_format), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"me_range", "limit motion vectors range (1023 for DivX player)", OFFSET(me_range), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"ibias", "intra quant bias", OFFSET(intra_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
-{"pbias", "inter quant bias", OFFSET(inter_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
-{"global_quality", NULL, OFFSET(global_quality), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
-{"coder", NULL, OFFSET(coder_type), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "coder"},
-{"vlc", "variable length coder / Huffman coder", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CODER_TYPE_VLC }, INT_MIN, INT_MAX, V|E, "coder"},
-{"ac", "arithmetic coder", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CODER_TYPE_AC }, INT_MIN, INT_MAX, V|E, "coder"},
-{"raw", "raw (no encoding)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CODER_TYPE_RAW }, INT_MIN, INT_MAX, V|E, "coder"},
-{"rle", "run-length coder", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CODER_TYPE_RLE }, INT_MIN, INT_MAX, V|E, "coder"},
-{"deflate", "deflate-based coder", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CODER_TYPE_DEFLATE }, INT_MIN, INT_MAX, V|E, "coder"},
-{"context", "context model", OFFSET(context_model), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-#if FF_API_XVMC
-{"xvmc_acceleration", NULL, OFFSET(xvmc_acceleration), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-#endif /* FF_API_XVMC */
-{"mbd", "macroblock decision algorithm (high quality mode)", OFFSET(mb_decision), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "mbd"},
-{"simple", "use mbcmp (default)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MB_DECISION_SIMPLE }, INT_MIN, INT_MAX, V|E, "mbd"},
-{"bits", "use fewest bits", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MB_DECISION_BITS }, INT_MIN, INT_MAX, V|E, "mbd"},
-{"rd", "use best rate distortion", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MB_DECISION_RD }, INT_MIN, INT_MAX, V|E, "mbd"},
-{"stream_codec_tag", NULL, OFFSET(stream_codec_tag), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"sc_threshold", "scene change threshold", OFFSET(scenechange_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"lmin", "minimum Lagrange factor (VBR)", OFFSET(lmin), AV_OPT_TYPE_INT, {.i64 =  2*FF_QP2LAMBDA }, 0, INT_MAX, V|E},
-{"lmax", "maximum Lagrange factor (VBR)", OFFSET(lmax), AV_OPT_TYPE_INT, {.i64 = 31*FF_QP2LAMBDA }, 0, INT_MAX, V|E},
-{"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"},
-#if FF_API_ERROR_RATE
-{"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-#endif
-{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|E|D, "threads"},
-{"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},
-{"me_threshold", "motion estimation threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"mb_threshold", "macroblock threshold", OFFSET(mb_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"dc", "intra_dc_precision", OFFSET(intra_dc_precision), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, V|E},
-{"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E},
-{"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D},
-{"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D},
-{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "profile"},
-{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "profile"},
-{"aac_main", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_AAC_MAIN }, INT_MIN, INT_MAX, A|E, "profile"},
-{"aac_low", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_AAC_LOW }, INT_MIN, INT_MAX, A|E, "profile"},
-{"aac_ssr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_AAC_SSR }, INT_MIN, INT_MAX, A|E, "profile"},
-{"aac_ltp", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_AAC_LTP }, INT_MIN, INT_MAX, A|E, "profile"},
-{"aac_he", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_AAC_HE }, INT_MIN, INT_MAX, A|E, "profile"},
-{"aac_he_v2", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_AAC_HE_V2 }, INT_MIN, INT_MAX, A|E, "profile"},
-{"aac_ld", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_AAC_LD }, INT_MIN, INT_MAX, A|E, "profile"},
-{"aac_eld", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_AAC_ELD }, INT_MIN, INT_MAX, A|E, "profile"},
-{"mpeg2_aac_low", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_MPEG2_AAC_LOW }, INT_MIN, INT_MAX, A|E, "profile"},
-{"mpeg2_aac_he", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_MPEG2_AAC_HE }, INT_MIN, INT_MAX, A|E, "profile"},
-{"dts", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_DTS }, INT_MIN, INT_MAX, A|E, "profile"},
-{"dts_es", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_DTS_ES }, INT_MIN, INT_MAX, A|E, "profile"},
-{"dts_96_24", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_DTS_96_24 }, INT_MIN, INT_MAX, A|E, "profile"},
-{"dts_hd_hra", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_DTS_HD_HRA }, INT_MIN, INT_MAX, A|E, "profile"},
-{"dts_hd_ma", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_DTS_HD_MA }, INT_MIN, INT_MAX, A|E, "profile"},
-{"level", NULL, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "level"},
-{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "level"},
-{"skip_threshold", "frame skip threshold", OFFSET(frame_skip_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"skip_factor", "frame skip factor", OFFSET(frame_skip_factor), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"skip_exp", "frame skip exponent", OFFSET(frame_skip_exp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"skipcmp", "frame skip compare function", OFFSET(frame_skip_cmp), AV_OPT_TYPE_INT, {.i64 = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"border_mask", "increase the quantizer for macroblocks close to borders", OFFSET(border_masking), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E},
-{"mblmin", "minimum macroblock Lagrange factor (VBR)", OFFSET(mb_lmin), AV_OPT_TYPE_INT, {.i64 = FF_QP2LAMBDA * 2 }, 1, FF_LAMBDA_MAX, V|E},
-{"mblmax", "maximum macroblock Lagrange factor (VBR)", OFFSET(mb_lmax), AV_OPT_TYPE_INT, {.i64 = FF_QP2LAMBDA * 31 }, 1, FF_LAMBDA_MAX, V|E},
-{"mepc", "motion estimation bitrate penalty compensation (1.0 = 256)", OFFSET(me_penalty_compensation), AV_OPT_TYPE_INT, {.i64 = 256 }, INT_MIN, INT_MAX, V|E},
-{"skip_loop_filter", NULL, OFFSET(skip_loop_filter), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
-{"skip_idct"       , NULL, OFFSET(skip_idct)       , AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
-{"skip_frame"      , NULL, OFFSET(skip_frame)      , AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
-{"none"            , NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONE    }, INT_MIN, INT_MAX, V|D, "avdiscard"},
-{"default"         , NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
-{"noref"           , NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONREF  }, INT_MIN, INT_MAX, V|D, "avdiscard"},
-{"bidir"           , NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_BIDIR   }, INT_MIN, INT_MAX, V|D, "avdiscard"},
-{"nokey"           , NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONKEY  }, INT_MIN, INT_MAX, V|D, "avdiscard"},
-{"all"             , NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_ALL     }, INT_MIN, INT_MAX, V|D, "avdiscard"},
-{"bidir_refine", "refine the two motion vectors used in bidirectional macroblocks", OFFSET(bidir_refine), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, 4, V|E},
-{"brd_scale", "downscale frames for dynamic B-frame decision", OFFSET(brd_scale), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, 10, V|E},
-{"keyint_min", "minimum interval between IDR-frames (x264)", OFFSET(keyint_min), AV_OPT_TYPE_INT, {.i64 = 25 }, INT_MIN, INT_MAX, V|E},
-{"refs", "reference frames to consider for motion compensation", OFFSET(refs), AV_OPT_TYPE_INT, {.i64 = 1 }, INT_MIN, INT_MAX, V|E},
-{"chromaoffset", "chroma QP offset from luma", OFFSET(chromaoffset), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"trellis", "rate-distortion optimal quantization", OFFSET(trellis), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
-{"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), AV_OPT_TYPE_INT, {.i64 = 6 }, 0, INT_MAX, V|E},
-{"mv0_threshold", NULL, OFFSET(mv0_threshold), AV_OPT_TYPE_INT, {.i64 = 256 }, 0, INT_MAX, V|E},
-{"b_sensitivity", "adjust sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.i64 = 40 }, 1, INT_MAX, V|E},
-{"compression_level", NULL, OFFSET(compression_level), AV_OPT_TYPE_INT, {.i64 = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E},
-{"min_prediction_order", NULL, OFFSET(min_prediction_order), AV_OPT_TYPE_INT, {.i64 = -1 }, INT_MIN, INT_MAX, A|E},
-{"max_prediction_order", NULL, OFFSET(max_prediction_order), AV_OPT_TYPE_INT, {.i64 = -1 }, INT_MIN, INT_MAX, A|E},
-{"timecode_frame_start", "GOP timecode frame start number, in non-drop-frame format", OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, V|E},
-#if FF_API_REQUEST_CHANNELS
-{"request_channels", "set desired number of audio channels", OFFSET(request_channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D},
-#endif
-{"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
-{"channel_layout", NULL, OFFSET(channel_layout), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, 0, INT64_MAX, A|E|D, "channel_layout"},
-{"request_channel_layout", NULL, OFFSET(request_channel_layout), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, 0, INT64_MAX, A|D, "request_channel_layout"},
-{"rc_max_vbv_use", NULL, OFFSET(rc_max_available_vbv_use), AV_OPT_TYPE_FLOAT, {.dbl = 1.0/3 }, 0.0, FLT_MAX, V|E},
-{"rc_min_vbv_use", NULL, OFFSET(rc_min_vbv_overflow_use),  AV_OPT_TYPE_FLOAT, {.dbl = 3 },     0.0, FLT_MAX, V|E},
-{"ticks_per_frame", NULL, OFFSET(ticks_per_frame), AV_OPT_TYPE_INT, {.i64 = 1 }, 1, INT_MAX, A|V|E|D},
-{"color_primaries", NULL, OFFSET(color_primaries), AV_OPT_TYPE_INT, {.i64 = AVCOL_PRI_UNSPECIFIED }, 1, AVCOL_PRI_NB-1, V|E|D},
-{"color_trc", NULL, OFFSET(color_trc), AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D},
-{"colorspace", NULL, OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = AVCOL_SPC_UNSPECIFIED }, 1, AVCOL_SPC_NB-1, V|E|D},
-{"color_range", NULL, OFFSET(color_range), AV_OPT_TYPE_INT, {.i64 = AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D},
-{"chroma_sample_location", NULL, OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, 0, AVCHROMA_LOC_NB-1, V|E|D},
-{"log_level_offset", "set the log level offset", OFFSET(log_level_offset), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX },
-{"slices", "number of slices, used in parallelized encoding", OFFSET(slices), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|E},
-{"thread_type", "select multithreading type", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, {.i64 = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|E|D, "thread_type"},
-{"slice", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_THREAD_SLICE }, INT_MIN, INT_MAX, V|E|D, "thread_type"},
-{"frame", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_THREAD_FRAME }, INT_MIN, INT_MAX, V|E|D, "thread_type"},
-{"audio_service_type", "audio service type", OFFSET(audio_service_type), AV_OPT_TYPE_INT, {.i64 = AV_AUDIO_SERVICE_TYPE_MAIN }, 0, AV_AUDIO_SERVICE_TYPE_NB-1, A|E, "audio_service_type"},
-{"ma", "Main Audio Service", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_MAIN },              INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"ef", "Effects",            0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_EFFECTS },           INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"vi", "Visually Impaired",  0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"hi", "Hearing Impaired",   0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED },  INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"di", "Dialogue",           0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_DIALOGUE },          INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"co", "Commentary",         0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_COMMENTARY },        INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"em", "Emergency",          0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_EMERGENCY },         INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"vo", "Voice Over",         0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_VOICE_OVER },        INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"ka", "Karaoke",            0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_KARAOKE },           INT_MIN, INT_MAX, A|E, "audio_service_type"},
-{"request_sample_fmt", NULL, OFFSET(request_sample_fmt), AV_OPT_TYPE_INT, {.i64 = AV_SAMPLE_FMT_NONE }, AV_SAMPLE_FMT_NONE, AV_SAMPLE_FMT_NB-1, A|D, "request_sample_fmt"},
-{"u8" , "8-bit unsigned integer", 0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_U8  }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"s16", "16-bit signed integer",  0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_S16 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"s32", "32-bit signed integer",  0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_S32 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"flt", "32-bit float",           0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_FLT }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"dbl", "64-bit double",          0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_DBL }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"u8p" , "8-bit unsigned integer planar", 0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_U8P  }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"s16p", "16-bit signed integer planar",  0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_S16P }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"s32p", "32-bit signed integer planar",  0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_S32P }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"fltp", "32-bit float planar",           0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_FLTP }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"dblp", "64-bit double planar",          0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_DBLP }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
-{"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, A|V|D },
-{NULL},
-};
-
-#undef A
-#undef V
-#undef S
-#undef E
-#undef D
-#undef DEFAULT
-#undef OFFSET
-
-#endif /* AVCODEC_OPTIONS_TABLE_H */
diff --git a/deps/libav/libavcodec/pamenc.c b/deps/libav/libavcodec/pamenc.c
deleted file mode 100644
index 8535d3d..0000000
--- a/deps/libav/libavcodec/pamenc.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * PAM image format
- * Copyright (c) 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                            const AVFrame *pict, int *got_packet)
-{
-    uint8_t *bytestream_start, *bytestream, *bytestream_end;
-    const AVFrame * const p = pict;
-    int i, h, w, n, linesize, depth, maxval, ret;
-    const char *tuple_type;
-    uint8_t *ptr;
-
-    if ((ret = ff_alloc_packet(pkt, avpicture_get_size(avctx->pix_fmt,
-                                                       avctx->width,
-                                                       avctx->height) + 200)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
-        return ret;
-    }
-
-    bytestream_start =
-    bytestream       = pkt->data;
-    bytestream_end   = pkt->data + pkt->size;
-
-    h = avctx->height;
-    w = avctx->width;
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_MONOWHITE:
-        n          = (w + 7) >> 3;
-        depth      = 1;
-        maxval     = 1;
-        tuple_type = "BLACKANDWHITE";
-        break;
-    case AV_PIX_FMT_GRAY8:
-        n          = w;
-        depth      = 1;
-        maxval     = 255;
-        tuple_type = "GRAYSCALE";
-        break;
-    case AV_PIX_FMT_RGB24:
-        n          = w * 3;
-        depth      = 3;
-        maxval     = 255;
-        tuple_type = "RGB";
-        break;
-    case AV_PIX_FMT_RGB32:
-        n          = w * 4;
-        depth      = 4;
-        maxval     = 255;
-        tuple_type = "RGB_ALPHA";
-        break;
-    default:
-        return -1;
-    }
-    snprintf(bytestream, bytestream_end - bytestream,
-             "P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLTYPE %s\nENDHDR\n",
-             w, h, depth, maxval, tuple_type);
-    bytestream += strlen(bytestream);
-
-    ptr      = p->data[0];
-    linesize = p->linesize[0];
-
-    if (avctx->pix_fmt == AV_PIX_FMT_RGB32) {
-        int j;
-        unsigned int v;
-
-        for (i = 0; i < h; i++) {
-            for (j = 0; j < w; j++) {
-                v = ((uint32_t *)ptr)[j];
-                bytestream_put_be24(&bytestream, v);
-                *bytestream++ = v >> 24;
-            }
-            ptr += linesize;
-        }
-    } else {
-        for (i = 0; i < h; i++) {
-            memcpy(bytestream, ptr, n);
-            bytestream += n;
-            ptr        += linesize;
-        }
-    }
-
-    pkt->size   = bytestream - bytestream_start;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-static av_cold int pam_encode_init(AVCodecContext *avctx)
-{
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    return 0;
-}
-
-static av_cold int pam_encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-AVCodec ff_pam_encoder = {
-    .name           = "pam",
-    .long_name      = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PAM,
-    .init           = pam_encode_init,
-    .close          = pam_encode_close,
-    .encode2        = pam_encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_GRAY8, AV_PIX_FMT_MONOWHITE,
-        AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/parser.c b/deps/libav/libavcodec/parser.c
deleted file mode 100644
index 080bbc3..0000000
--- a/deps/libav/libavcodec/parser.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Audio and Video frame extraction
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include "libavutil/mem.h"
-
-#include "parser.h"
-
-static AVCodecParser *av_first_parser = NULL;
-
-AVCodecParser *av_parser_next(AVCodecParser *p)
-{
-    if (p)
-        return p->next;
-    else
-        return av_first_parser;
-}
-
-void av_register_codec_parser(AVCodecParser *parser)
-{
-    parser->next = av_first_parser;
-    av_first_parser = parser;
-}
-
-AVCodecParserContext *av_parser_init(int codec_id)
-{
-    AVCodecParserContext *s;
-    AVCodecParser *parser;
-    int ret;
-
-    if (codec_id == AV_CODEC_ID_NONE)
-        return NULL;
-
-    for (parser = av_first_parser; parser != NULL; parser = parser->next) {
-        if (parser->codec_ids[0] == codec_id ||
-            parser->codec_ids[1] == codec_id ||
-            parser->codec_ids[2] == codec_id ||
-            parser->codec_ids[3] == codec_id ||
-            parser->codec_ids[4] == codec_id)
-            goto found;
-    }
-    return NULL;
-
-found:
-    s = av_mallocz(sizeof(AVCodecParserContext));
-    if (!s)
-        return NULL;
-    s->parser = parser;
-    if (parser->priv_data_size) {
-        s->priv_data = av_mallocz(parser->priv_data_size);
-        if (!s->priv_data) {
-            av_free(s);
-            return NULL;
-        }
-    }
-    if (parser->parser_init) {
-        ret = parser->parser_init(s);
-        if (ret != 0) {
-            av_free(s->priv_data);
-            av_free(s);
-            return NULL;
-        }
-    }
-    s->fetch_timestamp      = 1;
-    s->pict_type            = AV_PICTURE_TYPE_I;
-    s->key_frame            = -1;
-    s->convergence_duration = 0;
-    s->dts_sync_point       = INT_MIN;
-    s->dts_ref_dts_delta    = INT_MIN;
-    s->pts_dts_delta        = INT_MIN;
-    return s;
-}
-
-void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove)
-{
-    int i;
-
-    s->dts    =
-    s->pts    = AV_NOPTS_VALUE;
-    s->pos    = -1;
-    s->offset = 0;
-    for (i = 0; i < AV_PARSER_PTS_NB; i++) {
-        if (s->cur_offset + off >= s->cur_frame_offset[i] &&
-            (s->frame_offset < s->cur_frame_offset[i] ||
-             (!s->frame_offset && !s->next_frame_offset)) &&
-            s->cur_frame_end[i]) {
-            s->dts    = s->cur_frame_dts[i];
-            s->pts    = s->cur_frame_pts[i];
-            s->pos    = s->cur_frame_pos[i];
-            s->offset = s->next_frame_offset - s->cur_frame_offset[i];
-            if (remove)
-                s->cur_frame_offset[i] = INT64_MAX;
-            if (s->cur_offset + off < s->cur_frame_end[i])
-                break;
-        }
-    }
-}
-
-int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size,
-                     int64_t pts, int64_t dts, int64_t pos)
-{
-    int index, i;
-    uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE];
-
-    if (!(s->flags & PARSER_FLAG_FETCHED_OFFSET)) {
-        s->next_frame_offset =
-        s->cur_offset        = pos;
-        s->flags            |= PARSER_FLAG_FETCHED_OFFSET;
-    }
-
-    if (buf_size == 0) {
-        /* padding is always necessary even if EOF, so we add it here */
-        memset(dummy_buf, 0, sizeof(dummy_buf));
-        buf = dummy_buf;
-    } else if (s->cur_offset + buf_size != s->cur_frame_end[s->cur_frame_start_index]) { /* skip remainder packets */
-        /* add a new packet descriptor */
-        i = (s->cur_frame_start_index + 1) & (AV_PARSER_PTS_NB - 1);
-        s->cur_frame_start_index = i;
-        s->cur_frame_offset[i]   = s->cur_offset;
-        s->cur_frame_end[i]      = s->cur_offset + buf_size;
-        s->cur_frame_pts[i]      = pts;
-        s->cur_frame_dts[i]      = dts;
-        s->cur_frame_pos[i]      = pos;
-    }
-
-    if (s->fetch_timestamp) {
-        s->fetch_timestamp = 0;
-        s->last_pts        = s->pts;
-        s->last_dts        = s->dts;
-        s->last_pos        = s->pos;
-        ff_fetch_timestamp(s, 0, 0);
-    }
-    /* WARNING: the returned index can be negative */
-    index = s->parser->parser_parse(s, avctx, (const uint8_t **) poutbuf,
-                                    poutbuf_size, buf, buf_size);
-    /* update the file pointer */
-    if (*poutbuf_size) {
-        /* fill the data for the current frame */
-        s->frame_offset = s->next_frame_offset;
-
-        /* offset of the next frame */
-        s->next_frame_offset = s->cur_offset + index;
-        s->fetch_timestamp   = 1;
-    }
-    if (index < 0)
-        index = 0;
-    s->cur_offset += index;
-    return index;
-}
-
-int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe)
-{
-    if (s && s->parser->split) {
-        if (avctx->flags  & CODEC_FLAG_GLOBAL_HEADER ||
-            avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER) {
-            int i = s->parser->split(avctx, buf, buf_size);
-            buf      += i;
-            buf_size -= i;
-        }
-    }
-
-    /* cast to avoid warning about discarding qualifiers */
-    *poutbuf      = (uint8_t *) buf;
-    *poutbuf_size = buf_size;
-    if (avctx->extradata) {
-        if (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)) {
-            int size = buf_size + avctx->extradata_size;
-
-            *poutbuf_size = size;
-            *poutbuf      = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-
-            memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
-            memcpy(*poutbuf + avctx->extradata_size, buf,
-                   buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-            return 1;
-        }
-    }
-
-    return 0;
-}
-
-void av_parser_close(AVCodecParserContext *s)
-{
-    if (s) {
-        if (s->parser->parser_close)
-            s->parser->parser_close(s);
-        av_free(s->priv_data);
-        av_free(s);
-    }
-}
-
-int ff_combine_frame(ParseContext *pc, int next,
-                     const uint8_t **buf, int *buf_size)
-{
-    if (pc->overread) {
-        av_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
-                pc->overread, pc->state, next, pc->index, pc->overread_index);
-        av_dlog(NULL, "%X %X %X %X\n",
-                (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);
-    }
-
-    /* Copy overread bytes from last frame into buffer. */
-    for (; pc->overread > 0; pc->overread--)
-        pc->buffer[pc->index++] = pc->buffer[pc->overread_index++];
-
-    /* flush remaining if EOF */
-    if (!*buf_size && next == END_NOT_FOUND)
-        next = 0;
-
-    pc->last_index = pc->index;
-
-    /* copy into buffer end return */
-    if (next == END_NOT_FOUND) {
-        void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
-                                           *buf_size + pc->index +
-                                           FF_INPUT_BUFFER_PADDING_SIZE);
-
-        if (!new_buffer)
-            return AVERROR(ENOMEM);
-        pc->buffer = new_buffer;
-        memcpy(&pc->buffer[pc->index], *buf, *buf_size);
-        pc->index += *buf_size;
-        return -1;
-    }
-
-    *buf_size          =
-    pc->overread_index = pc->index + next;
-
-    /* append to buffer */
-    if (pc->index) {
-        void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
-                                           next + pc->index +
-                                           FF_INPUT_BUFFER_PADDING_SIZE);
-
-        if (!new_buffer)
-            return AVERROR(ENOMEM);
-        pc->buffer = new_buffer;
-        if (next > -FF_INPUT_BUFFER_PADDING_SIZE)
-            memcpy(&pc->buffer[pc->index], *buf,
-                   next + FF_INPUT_BUFFER_PADDING_SIZE);
-        pc->index = 0;
-        *buf      = pc->buffer;
-    }
-
-    /* store overread bytes */
-    for (; next < 0; next++) {
-        pc->state   = pc->state   << 8 | pc->buffer[pc->last_index + next];
-        pc->state64 = pc->state64 << 8 | pc->buffer[pc->last_index + next];
-        pc->overread++;
-    }
-
-    if (pc->overread) {
-        av_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
-                pc->overread, pc->state, next, pc->index, pc->overread_index);
-        av_dlog(NULL, "%X %X %X %X\n",
-                (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);
-    }
-
-    return 0;
-}
-
-void ff_parse_close(AVCodecParserContext *s)
-{
-    ParseContext *pc = s->priv_data;
-
-    av_freep(&pc->buffer);
-}
-
-int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
-{
-    int i;
-    uint32_t state = -1;
-
-    for (i = 0; i < buf_size; i++) {
-        state = state << 8 | buf[i];
-        if (state == 0x1B3 || state == 0x1B6)
-            return i - 3;
-    }
-    return 0;
-}
diff --git a/deps/libav/libavcodec/parser.h b/deps/libav/libavcodec/parser.h
deleted file mode 100644
index ea1cae2..0000000
--- a/deps/libav/libavcodec/parser.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * AVCodecParser prototypes and definitions
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PARSER_H
-#define AVCODEC_PARSER_H
-
-#include "avcodec.h"
-
-typedef struct ParseContext{
-    uint8_t *buffer;
-    int index;
-    int last_index;
-    unsigned int buffer_size;
-    uint32_t state;             ///< contains the last few bytes in MSB order
-    int frame_start_found;
-    int overread;               ///< the number of bytes which where irreversibly read from the next frame
-    int overread_index;         ///< the index into ParseContext.buffer of the overread bytes
-    uint64_t state64;           ///< contains the last 8 bytes in MSB order
-} ParseContext;
-
-#define END_NOT_FOUND (-100)
-
-/**
- * Combine the (truncated) bitstream to a complete frame.
- * @return -1 if no complete frame could be created,
- *         AVERROR(ENOMEM) if there was a memory allocation error
- */
-int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size);
-int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf,
-                        int buf_size);
-void ff_parse_close(AVCodecParserContext *s);
-
-/**
- * Fetch timestamps for a specific byte within the current access unit.
- * @param off byte position within the access unit
- * @param remove Found timestamps will be removed if set to 1, kept if set to 0.
- */
-void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove);
-
-#endif /* AVCODEC_PARSER_H */
diff --git a/deps/libav/libavcodec/pcm-bluray.c b/deps/libav/libavcodec/pcm-bluray.c
deleted file mode 100644
index 7e4dcf8..0000000
--- a/deps/libav/libavcodec/pcm-bluray.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * LPCM codecs for PCM format found in Blu-ray PCM streams
- * Copyright (c) 2009, 2013 Christian Schmidt
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * PCM codec for Blu-ray PCM audio tracks
- */
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-/*
- * Channel Mapping according to
- * Blu-ray Disc Read-Only Format Version 1
- * Part 3: Audio Visual Basic Specifications
- * mono     M1    X
- * stereo   L     R
- * 3/0      L     R    C    X
- * 2/1      L     R    S    X
- * 3/1      L     R    C    S
- * 2/2      L     R    LS   RS
- * 3/2      L     R    C    LS    RS    X
- * 3/2+lfe  L     R    C    LS    RS    lfe
- * 3/4      L     R    C    LS    Rls   Rrs  RS   X
- * 3/4+lfe  L     R    C    LS    Rls   Rrs  RS   lfe
- */
-
-/**
- * Parse the header of a LPCM frame read from a Blu-ray MPEG-TS stream
- * @param avctx the codec context
- * @param header pointer to the first four bytes of the data packet
- */
-static int pcm_bluray_parse_header(AVCodecContext *avctx,
-                                   const uint8_t *header)
-{
-    static const uint8_t bits_per_samples[4] = { 0, 16, 20, 24 };
-    static const uint32_t channel_layouts[16] = {
-        0, AV_CH_LAYOUT_MONO, 0, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND,
-        AV_CH_LAYOUT_2_1, AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_2_2,
-        AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT0,
-        AV_CH_LAYOUT_7POINT1, 0, 0, 0, 0
-    };
-    static const uint8_t channels[16] = {
-        0, 1, 0, 2, 3, 3, 4, 4, 5, 6, 7, 8, 0, 0, 0, 0
-    };
-    uint8_t channel_layout = header[2] >> 4;
-
-    if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_dlog(avctx, "pcm_bluray_parse_header: header = %02x%02x%02x%02x\n",
-                header[0], header[1], header[2], header[3]);
-
-    /* get the sample depth and derive the sample format from it */
-    avctx->bits_per_coded_sample = bits_per_samples[header[3] >> 6];
-    if (!avctx->bits_per_coded_sample) {
-        av_log(avctx, AV_LOG_ERROR, "reserved sample depth (0)\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->sample_fmt = avctx->bits_per_coded_sample == 16 ? AV_SAMPLE_FMT_S16
-                                                           : AV_SAMPLE_FMT_S32;
-    avctx->bits_per_raw_sample = avctx->bits_per_coded_sample;
-
-    /* get the sample rate. Not all values are used. */
-    switch (header[2] & 0x0f) {
-    case 1:
-        avctx->sample_rate = 48000;
-        break;
-    case 4:
-        avctx->sample_rate = 96000;
-        break;
-    case 5:
-        avctx->sample_rate = 192000;
-        break;
-    default:
-        avctx->sample_rate = 0;
-        av_log(avctx, AV_LOG_ERROR, "reserved sample rate (%d)\n",
-               header[2] & 0x0f);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /*
-     * get the channel number (and mapping). Not all values are used.
-     * It must be noted that the number of channels in the MPEG stream can
-     * differ from the actual meaningful number, e.g. mono audio still has two
-     * channels, one being empty.
-     */
-    avctx->channel_layout  = channel_layouts[channel_layout];
-    avctx->channels        =        channels[channel_layout];
-    if (!avctx->channels) {
-        av_log(avctx, AV_LOG_ERROR, "reserved channel configuration (%d)\n",
-               channel_layout);
-        return AVERROR_INVALIDDATA;
-    }
-
-    avctx->bit_rate = FFALIGN(avctx->channels, 2) * avctx->sample_rate *
-                      avctx->bits_per_coded_sample;
-
-    if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_dlog(avctx,
-                "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n",
-                avctx->channels, avctx->bits_per_coded_sample,
-                avctx->sample_rate, avctx->bit_rate);
-    return 0;
-}
-
-static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data,
-                                   int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *src = avpkt->data;
-    int buf_size = avpkt->size;
-    GetByteContext gb;
-    int num_source_channels, channel, retval;
-    int sample_size, samples;
-    int16_t *dst16;
-    int32_t *dst32;
-
-    if (buf_size < 4) {
-        av_log(avctx, AV_LOG_ERROR, "PCM packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((retval = pcm_bluray_parse_header(avctx, src)))
-        return retval;
-    src += 4;
-    buf_size -= 4;
-
-    bytestream2_init(&gb, src, buf_size);
-
-    /* There's always an even number of channels in the source */
-    num_source_channels = FFALIGN(avctx->channels, 2);
-    sample_size = (num_source_channels *
-                   (avctx->sample_fmt == AV_SAMPLE_FMT_S16 ? 16 : 24)) >> 3;
-    samples = buf_size / sample_size;
-
-    /* get output buffer */
-    frame->nb_samples = samples;
-    if ((retval = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return retval;
-    }
-    dst16 = (int16_t *)frame->data[0];
-    dst32 = (int32_t *)frame->data[0];
-
-    if (samples) {
-        switch (avctx->channel_layout) {
-            /* cases with same number of source and coded channels */
-        case AV_CH_LAYOUT_STEREO:
-        case AV_CH_LAYOUT_4POINT0:
-        case AV_CH_LAYOUT_2_2:
-            samples *= num_source_channels;
-            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
-#if HAVE_BIGENDIAN
-                bytestream2_get_buffer(&gb, dst16, buf_size);
-#else
-                do {
-                    *dst16++ = bytestream2_get_be16u(&gb);
-                } while (--samples);
-#endif
-            } else {
-                do {
-                    *dst32++ = bytestream2_get_be24u(&gb) << 8;
-                } while (--samples);
-            }
-            break;
-        /* cases where number of source channels = coded channels + 1 */
-        case AV_CH_LAYOUT_MONO:
-        case AV_CH_LAYOUT_SURROUND:
-        case AV_CH_LAYOUT_2_1:
-        case AV_CH_LAYOUT_5POINT0:
-            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
-                do {
-#if HAVE_BIGENDIAN
-                    bytestream2_get_buffer(&gb, dst16, avctx->channels * 2);
-                    dst16 += avctx->channels;
-#else
-                    channel = avctx->channels;
-                    do {
-                        *dst16++ = bytestream2_get_be16u(&gb);
-                    } while (--channel);
-#endif
-                    bytestream2_skip(&gb, 2);
-                } while (--samples);
-            } else {
-                do {
-                    channel = avctx->channels;
-                    do {
-                        *dst32++ = bytestream2_get_be24u(&gb) << 8;
-                    } while (--channel);
-                    bytestream2_skip(&gb, 3);
-                } while (--samples);
-            }
-            break;
-            /* remapping: L, R, C, LBack, RBack, LF */
-        case AV_CH_LAYOUT_5POINT1:
-            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
-                do {
-                    dst16[0] = bytestream2_get_be16u(&gb);
-                    dst16[1] = bytestream2_get_be16u(&gb);
-                    dst16[2] = bytestream2_get_be16u(&gb);
-                    dst16[4] = bytestream2_get_be16u(&gb);
-                    dst16[5] = bytestream2_get_be16u(&gb);
-                    dst16[3] = bytestream2_get_be16u(&gb);
-                    dst16 += 6;
-                } while (--samples);
-            } else {
-                do {
-                    dst32[0] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[1] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[2] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[4] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[5] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[3] = bytestream2_get_be24u(&gb) << 8;
-                    dst32 += 6;
-                } while (--samples);
-            }
-            break;
-            /* remapping: L, R, C, LSide, LBack, RBack, RSide, <unused> */
-        case AV_CH_LAYOUT_7POINT0:
-            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
-                do {
-                    dst16[0] = bytestream2_get_be16u(&gb);
-                    dst16[1] = bytestream2_get_be16u(&gb);
-                    dst16[2] = bytestream2_get_be16u(&gb);
-                    dst16[5] = bytestream2_get_be16u(&gb);
-                    dst16[3] = bytestream2_get_be16u(&gb);
-                    dst16[4] = bytestream2_get_be16u(&gb);
-                    dst16[6] = bytestream2_get_be16u(&gb);
-                    dst16 += 7;
-                    bytestream2_skip(&gb, 2);
-                } while (--samples);
-            } else {
-                do {
-                    dst32[0] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[1] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[2] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[5] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[3] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[4] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[6] = bytestream2_get_be24u(&gb) << 8;
-                    dst32 += 7;
-                    bytestream2_skip(&gb, 3);
-                } while (--samples);
-            }
-            break;
-            /* remapping: L, R, C, LSide, LBack, RBack, RSide, LF */
-        case AV_CH_LAYOUT_7POINT1:
-            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
-                do {
-                    dst16[0] = bytestream2_get_be16u(&gb);
-                    dst16[1] = bytestream2_get_be16u(&gb);
-                    dst16[2] = bytestream2_get_be16u(&gb);
-                    dst16[6] = bytestream2_get_be16u(&gb);
-                    dst16[4] = bytestream2_get_be16u(&gb);
-                    dst16[5] = bytestream2_get_be16u(&gb);
-                    dst16[7] = bytestream2_get_be16u(&gb);
-                    dst16[3] = bytestream2_get_be16u(&gb);
-                    dst16 += 8;
-                } while (--samples);
-            } else {
-                do {
-                    dst32[0] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[1] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[2] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[6] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[4] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[5] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[7] = bytestream2_get_be24u(&gb) << 8;
-                    dst32[3] = bytestream2_get_be24u(&gb) << 8;
-                    dst32 += 8;
-                } while (--samples);
-            }
-            break;
-        }
-    }
-
-    *got_frame_ptr = 1;
-
-    retval = bytestream2_tell(&gb);
-    if (avctx->debug & FF_DEBUG_BITSTREAM)
-        av_dlog(avctx, "pcm_bluray_decode_frame: decoded %d -> %d bytes\n",
-                retval, buf_size);
-    return retval + 4;
-}
-
-AVCodec ff_pcm_bluray_decoder = {
-    .name           = "pcm_bluray",
-    .long_name      = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_PCM_BLURAY,
-    .decode         = pcm_bluray_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]){
-        AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/pcm-dvd.c b/deps/libav/libavcodec/pcm-dvd.c
deleted file mode 100644
index 0872d29..0000000
--- a/deps/libav/libavcodec/pcm-dvd.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * LPCM codecs for PCM formats found in Video DVD streams
- * Copyright (c) 2013 Christian Schmidt
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * LPCM codecs for PCM formats found in Video DVD streams
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-typedef struct PCMDVDContext {
-    uint32_t last_header;    // Cached header to see if parsing is needed
-    int block_size;          // Size of a block of samples in bytes
-    int samples_per_block;   // Number of samples per channel per block
-    int groups_per_block;    // Number of 20/24bit sample groups per block
-    uint8_t *extra_samples;  // Pointer to leftover samples from a frame
-    int extra_sample_count;  // Number of leftover samples in the buffer
-} PCMDVDContext;
-
-static av_cold int pcm_dvd_decode_init(AVCodecContext *avctx)
-{
-    PCMDVDContext *s = avctx->priv_data;
-
-    /* Invalid header to force parsing of the first header */
-    s->last_header = -1;
-    /* reserve space for 8 channels, 3 bytes/sample, 4 samples/block */
-    if (!(s->extra_samples = av_malloc(8 * 3 * 4)))
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static av_cold int pcm_dvd_decode_uninit(AVCodecContext *avctx)
-{
-    PCMDVDContext *s = avctx->priv_data;
-
-    av_freep(&s->extra_samples);
-
-    return 0;
-}
-
-static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header)
-{
-    /* no traces of 44100 and 32000Hz in any commercial software or player */
-    static const uint32_t frequencies[4] = { 48000, 96000, 44100, 32000 };
-    PCMDVDContext *s = avctx->priv_data;
-    int header_int = (header[0] & 0xe0) | (header[1] << 8) | (header[2] << 16);
-
-    /* early exit if the header didn't change apart from the frame number */
-    if (s->last_header == header_int)
-        return 0;
-
-    if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_dlog(avctx, "pcm_dvd_parse_header: header = %02x%02x%02x\n",
-                header[0], header[1], header[2]);
-    /*
-     * header[0] emphasis (1), muse(1), reserved(1), frame number(5)
-     * header[1] quant (2), freq(2), reserved(1), channels(3)
-     * header[2] dynamic range control (0x80 = off)
-     */
-
-    /* Discard potentially existing leftover samples from old channel layout */
-    s->extra_sample_count = 0;
-
-    /* get the sample depth and derive the sample format from it */
-    avctx->bits_per_coded_sample = 16 + (header[1] >> 6 & 3) * 4;
-    if (avctx->bits_per_coded_sample == 28) {
-        av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->sample_fmt = avctx->bits_per_coded_sample == 16 ? AV_SAMPLE_FMT_S16
-                                                           : AV_SAMPLE_FMT_S32;
-    avctx->bits_per_raw_sample = avctx->bits_per_coded_sample;
-
-    /* get the sample rate */
-    avctx->sample_rate = frequencies[header[1] >> 4 & 3];
-
-    /* get the number of channels */
-    avctx->channels = 1 + (header[1] & 7);
-    /* calculate the bitrate */
-    avctx->bit_rate = avctx->channels *
-                      avctx->sample_rate *
-                      avctx->bits_per_coded_sample;
-
-    /* 4 samples form a group in 20/24bit PCM on DVD Video.
-     * A block is formed by the number of groups that are
-     * needed to complete a set of samples for each channel. */
-    if (avctx->bits_per_coded_sample == 16) {
-        s->samples_per_block = 1;
-        s->block_size        = avctx->channels * 2;
-    } else {
-        switch (avctx->channels) {
-        case 1:
-        case 2:
-        case 4:
-            /* one group has all the samples needed */
-            s->block_size        = 4 * avctx->bits_per_coded_sample / 8;
-            s->samples_per_block = 4 / avctx->channels;
-            s->groups_per_block  = 1;
-            break;
-        case 8:
-            /* two groups have all the samples needed */
-            s->block_size        = 8 * avctx->bits_per_coded_sample / 8;
-            s->samples_per_block = 1;
-            s->groups_per_block  = 2;
-            break;
-        default:
-            /* need avctx->channels groups */
-            s->block_size        = 4 * avctx->channels *
-                                   avctx->bits_per_coded_sample / 8;
-            s->samples_per_block = 4;
-            s->groups_per_block  = avctx->channels;
-            break;
-        }
-    }
-
-    if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_dlog(avctx,
-                "pcm_dvd_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n",
-                avctx->channels, avctx->bits_per_coded_sample,
-                avctx->sample_rate, avctx->bit_rate);
-
-    s->last_header = header_int;
-
-    return 0;
-}
-
-static void *pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src,
-                                    void *dst, int blocks)
-{
-    PCMDVDContext *s = avctx->priv_data;
-    int16_t *dst16   = dst;
-    int32_t *dst32   = dst;
-    GetByteContext gb;
-    int i;
-    uint8_t t;
-    int samples;
-
-    bytestream2_init(&gb, src, blocks * s->block_size);
-    switch (avctx->bits_per_coded_sample) {
-    case 16:
-#if HAVE_BIGENDIAN
-        bytestream2_get_buffer(&gb, dst16, blocks * s->block_size);
-        dst16 += blocks * s->block_size / 2;
-#else
-        samples = blocks * avctx->channels;
-        do {
-            *dst16++ = bytestream2_get_be16u(&gb);
-        } while (--samples);
-#endif
-        return dst16;
-    case 20:
-        do {
-            for (i = s->groups_per_block; i; i--) {
-                dst32[0] = bytestream2_get_be16u(&gb) << 16;
-                dst32[1] = bytestream2_get_be16u(&gb) << 16;
-                dst32[2] = bytestream2_get_be16u(&gb) << 16;
-                dst32[3] = bytestream2_get_be16u(&gb) << 16;
-                t = bytestream2_get_byteu(&gb);
-                *dst32++ += (t & 0xf0) << 8;
-                *dst32++ += (t & 0x0f) << 12;
-                t = bytestream2_get_byteu(&gb);
-                *dst32++ += (t & 0xf0) << 8;
-                *dst32++ += (t & 0x0f) << 12;
-            }
-        } while (--blocks);
-        return dst32;
-    case 24:
-        do {
-            for (i = s->groups_per_block; i; i--) {
-                dst32[0] = bytestream2_get_be16u(&gb) << 16;
-                dst32[1] = bytestream2_get_be16u(&gb) << 16;
-                dst32[2] = bytestream2_get_be16u(&gb) << 16;
-                dst32[3] = bytestream2_get_be16u(&gb) << 16;
-                *dst32++ += bytestream2_get_byteu(&gb) << 8;
-                *dst32++ += bytestream2_get_byteu(&gb) << 8;
-                *dst32++ += bytestream2_get_byteu(&gb) << 8;
-                *dst32++ += bytestream2_get_byteu(&gb) << 8;
-            }
-        } while (--blocks);
-        return dst32;
-    default:
-        return NULL;
-    }
-}
-
-static int pcm_dvd_decode_frame(AVCodecContext *avctx, void *data,
-                                int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *src = avpkt->data;
-    int buf_size       = avpkt->size;
-    PCMDVDContext *s   = avctx->priv_data;
-    int retval;
-    int blocks;
-    void *dst;
-
-    if (buf_size < 3) {
-        av_log(avctx, AV_LOG_ERROR, "PCM packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((retval = pcm_dvd_parse_header(avctx, src)))
-        return retval;
-    src      += 3;
-    buf_size -= 3;
-
-    blocks = (buf_size + s->extra_sample_count) / s->block_size;
-
-    /* get output buffer */
-    frame->nb_samples = blocks * s->samples_per_block;
-    if ((retval = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return retval;
-    }
-    dst = frame->data[0];
-
-    /* consume leftover samples from last packet */
-    if (s->extra_sample_count) {
-        int missing_samples = s->block_size - s->extra_sample_count;
-        if (buf_size >= missing_samples) {
-            memcpy(s->extra_samples + s->extra_sample_count, src,
-                   missing_samples);
-            dst = pcm_dvd_decode_samples(avctx, s->extra_samples, dst, 1);
-            src += missing_samples;
-            buf_size -= missing_samples;
-            s->extra_sample_count = 0;
-            blocks--;
-        } else {
-            /* new packet still doesn't have enough samples */
-            memcpy(s->extra_samples + s->extra_sample_count, src, buf_size);
-            s->extra_sample_count += buf_size;
-            return avpkt->size;
-        }
-    }
-
-    /* decode remaining complete samples */
-    if (blocks) {
-        pcm_dvd_decode_samples(avctx, src, dst, blocks);
-        buf_size -= blocks * s->block_size;
-    }
-
-    /* store leftover samples */
-    if (buf_size) {
-        src += blocks * s->block_size;
-        memcpy(s->extra_samples, src, buf_size);
-        s->extra_sample_count = buf_size;
-    }
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_pcm_dvd_decoder = {
-    .name           = "pcm_dvd",
-    .long_name      = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for DVD media"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_PCM_DVD,
-    .priv_data_size = sizeof(PCMDVDContext),
-    .init           = pcm_dvd_decode_init,
-    .decode         = pcm_dvd_decode_frame,
-    .close          = pcm_dvd_decode_uninit,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) {
-        AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE
-    }
-};
diff --git a/deps/libav/libavcodec/pcm.c b/deps/libav/libavcodec/pcm.c
deleted file mode 100644
index 9fadcb7..0000000
--- a/deps/libav/libavcodec/pcm.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/*
- * PCM codecs
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * PCM codecs
- */
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "mathops.h"
-#include "pcm_tablegen.h"
-
-static av_cold int pcm_encode_init(AVCodecContext *avctx)
-{
-    avctx->frame_size = 0;
-    switch (avctx->codec->id) {
-    case AV_CODEC_ID_PCM_ALAW:
-        pcm_alaw_tableinit();
-        break;
-    case AV_CODEC_ID_PCM_MULAW:
-        pcm_ulaw_tableinit();
-        break;
-    default:
-        break;
-    }
-
-    avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
-    avctx->block_align           = avctx->channels * avctx->bits_per_coded_sample / 8;
-    avctx->bit_rate              = avctx->block_align * avctx->sample_rate * 8;
-    avctx->coded_frame           = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static av_cold int pcm_encode_close(AVCodecContext *avctx)
-{
-    av_freep(&avctx->coded_frame);
-
-    return 0;
-}
-
-/**
- * Write PCM samples macro
- * @param type   Datatype of native machine format
- * @param endian bytestream_put_xxx() suffix
- * @param src    Source pointer (variable name)
- * @param dst    Destination pointer (variable name)
- * @param n      Total number of samples (variable name)
- * @param shift  Bitshift (bits)
- * @param offset Sample value offset
- */
-#define ENCODE(type, endian, src, dst, n, shift, offset)                \
-    samples_ ## type = (const type *) src;                              \
-    for (; n > 0; n--) {                                                \
-        register type v = (*samples_ ## type++ >> shift) + offset;      \
-        bytestream_put_ ## endian(&dst, v);                             \
-    }
-
-static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                            const AVFrame *frame, int *got_packet_ptr)
-{
-    int n, sample_size, v, ret;
-    const short *samples;
-    unsigned char *dst;
-    const uint8_t *srcu8;
-    const int16_t *samples_int16_t;
-    const int32_t *samples_int32_t;
-    const int64_t *samples_int64_t;
-    const uint16_t *samples_uint16_t;
-    const uint32_t *samples_uint32_t;
-
-    sample_size = av_get_bits_per_sample(avctx->codec->id) / 8;
-    n           = frame->nb_samples * avctx->channels;
-    samples     = (const short *)frame->data[0];
-
-    if ((ret = ff_alloc_packet(avpkt, n * sample_size))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-    dst = avpkt->data;
-
-    switch (avctx->codec->id) {
-    case AV_CODEC_ID_PCM_U32LE:
-        ENCODE(uint32_t, le32, samples, dst, n, 0, 0x80000000)
-        break;
-    case AV_CODEC_ID_PCM_U32BE:
-        ENCODE(uint32_t, be32, samples, dst, n, 0, 0x80000000)
-        break;
-    case AV_CODEC_ID_PCM_S24LE:
-        ENCODE(int32_t, le24, samples, dst, n, 8, 0)
-        break;
-    case AV_CODEC_ID_PCM_S24BE:
-        ENCODE(int32_t, be24, samples, dst, n, 8, 0)
-        break;
-    case AV_CODEC_ID_PCM_U24LE:
-        ENCODE(uint32_t, le24, samples, dst, n, 8, 0x800000)
-        break;
-    case AV_CODEC_ID_PCM_U24BE:
-        ENCODE(uint32_t, be24, samples, dst, n, 8, 0x800000)
-        break;
-    case AV_CODEC_ID_PCM_S24DAUD:
-        for (; n > 0; n--) {
-            uint32_t tmp = ff_reverse[(*samples >> 8) & 0xff] +
-                           (ff_reverse[*samples & 0xff] << 8);
-            tmp <<= 4; // sync flags would go here
-            bytestream_put_be24(&dst, tmp);
-            samples++;
-        }
-        break;
-    case AV_CODEC_ID_PCM_U16LE:
-        ENCODE(uint16_t, le16, samples, dst, n, 0, 0x8000)
-        break;
-    case AV_CODEC_ID_PCM_U16BE:
-        ENCODE(uint16_t, be16, samples, dst, n, 0, 0x8000)
-        break;
-    case AV_CODEC_ID_PCM_S8:
-        srcu8 = frame->data[0];
-        for (; n > 0; n--) {
-            v      = *srcu8++;
-            *dst++ = v - 128;
-        }
-        break;
-#if HAVE_BIGENDIAN
-    case AV_CODEC_ID_PCM_F64LE:
-        ENCODE(int64_t, le64, samples, dst, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_S32LE:
-    case AV_CODEC_ID_PCM_F32LE:
-        ENCODE(int32_t, le32, samples, dst, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_S16LE:
-        ENCODE(int16_t, le16, samples, dst, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_F64BE:
-    case AV_CODEC_ID_PCM_F32BE:
-    case AV_CODEC_ID_PCM_S32BE:
-    case AV_CODEC_ID_PCM_S16BE:
-#else
-    case AV_CODEC_ID_PCM_F64BE:
-        ENCODE(int64_t, be64, samples, dst, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_F32BE:
-    case AV_CODEC_ID_PCM_S32BE:
-        ENCODE(int32_t, be32, samples, dst, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_S16BE:
-        ENCODE(int16_t, be16, samples, dst, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_F64LE:
-    case AV_CODEC_ID_PCM_F32LE:
-    case AV_CODEC_ID_PCM_S32LE:
-    case AV_CODEC_ID_PCM_S16LE:
-#endif /* HAVE_BIGENDIAN */
-    case AV_CODEC_ID_PCM_U8:
-        memcpy(dst, samples, n * sample_size);
-        dst += n * sample_size;
-        break;
-    case AV_CODEC_ID_PCM_ALAW:
-        for (; n > 0; n--) {
-            v      = *samples++;
-            *dst++ = linear_to_alaw[(v + 32768) >> 2];
-        }
-        break;
-    case AV_CODEC_ID_PCM_MULAW:
-        for (; n > 0; n--) {
-            v      = *samples++;
-            *dst++ = linear_to_ulaw[(v + 32768) >> 2];
-        }
-        break;
-    default:
-        return -1;
-    }
-
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-typedef struct PCMDecode {
-    short   table[256];
-} PCMDecode;
-
-static av_cold int pcm_decode_init(AVCodecContext *avctx)
-{
-    PCMDecode *s = avctx->priv_data;
-    int i;
-
-    if (avctx->channels <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
-        return AVERROR(EINVAL);
-    }
-
-    switch (avctx->codec->id) {
-    case AV_CODEC_ID_PCM_ALAW:
-        for (i = 0; i < 256; i++)
-            s->table[i] = alaw2linear(i);
-        break;
-    case AV_CODEC_ID_PCM_MULAW:
-        for (i = 0; i < 256; i++)
-            s->table[i] = ulaw2linear(i);
-        break;
-    default:
-        break;
-    }
-
-    avctx->sample_fmt = avctx->codec->sample_fmts[0];
-
-    if (avctx->sample_fmt == AV_SAMPLE_FMT_S32)
-        avctx->bits_per_raw_sample = av_get_bits_per_sample(avctx->codec->id);
-
-    return 0;
-}
-
-/**
- * Read PCM samples macro
- * @param size   Data size of native machine format
- * @param endian bytestream_get_xxx() endian suffix
- * @param src    Source pointer (variable name)
- * @param dst    Destination pointer (variable name)
- * @param n      Total number of samples (variable name)
- * @param shift  Bitshift (bits)
- * @param offset Sample value offset
- */
-#define DECODE(size, endian, src, dst, n, shift, offset)                \
-    for (; n > 0; n--) {                                                \
-        uint ## size ## _t v = bytestream_get_ ## endian(&src);         \
-        AV_WN ## size ## A(dst, (v - offset) << shift);                 \
-        dst += size / 8;                                                \
-    }
-
-#if HAVE_BIGENDIAN
-#define DECODE_PLANAR(size, endian, src, dst, n, shift, offset)         \
-    {                                                                   \
-        int av_unused n2;                                               \
-        n /= avctx->channels;                                           \
-        for (c = 0; c < avctx->channels; c++) {                         \
-            samples = frame->extended_data[c];                          \
-            n2 = n;                                                     \
-            DECODE(size, endian, src, samples, n2, 0, 0)                \
-        }                                                               \
-    }
-#else
-#define DECODE_PLANAR(size, endian, src, dst, n, shift, offset)         \
-    {                                                                   \
-        int av_unused n2;                                               \
-        n /= avctx->channels;                                           \
-        for (c = 0; c < avctx->channels; c++) {                         \
-            samples = frame->extended_data[c];                          \
-            memcpy(samples, src, n * size / 8);                         \
-            src += n * size / 8;                                        \
-        }                                                               \
-    }
-#endif /* HAVE_BIGENDIAN */
-
-static int pcm_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    const uint8_t *src = avpkt->data;
-    int buf_size       = avpkt->size;
-    PCMDecode *s       = avctx->priv_data;
-    AVFrame *frame     = data;
-    int sample_size, c, n, ret, samples_per_block;
-    uint8_t *samples;
-    int32_t *dst_int32_t;
-
-    sample_size = av_get_bits_per_sample(avctx->codec_id) / 8;
-
-    /* av_get_bits_per_sample returns 0 for AV_CODEC_ID_PCM_DVD */
-    samples_per_block = 1;
-    if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) {
-        /* we process 40-bit blocks per channel for LXF */
-        samples_per_block = 2;
-        sample_size       = 5;
-    }
-
-    if (sample_size == 0) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n");
-        return AVERROR(EINVAL);
-    }
-
-    n = avctx->channels * sample_size;
-
-    if (n && buf_size % n) {
-        if (buf_size < n) {
-            av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
-            return -1;
-        } else
-            buf_size -= buf_size % n;
-    }
-
-    n = buf_size / sample_size;
-
-    /* get output buffer */
-    frame->nb_samples = n * samples_per_block / avctx->channels;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = frame->data[0];
-
-    switch (avctx->codec->id) {
-    case AV_CODEC_ID_PCM_U32LE:
-        DECODE(32, le32, src, samples, n, 0, 0x80000000)
-        break;
-    case AV_CODEC_ID_PCM_U32BE:
-        DECODE(32, be32, src, samples, n, 0, 0x80000000)
-        break;
-    case AV_CODEC_ID_PCM_S24LE:
-        DECODE(32, le24, src, samples, n, 8, 0)
-        break;
-    case AV_CODEC_ID_PCM_S24BE:
-        DECODE(32, be24, src, samples, n, 8, 0)
-        break;
-    case AV_CODEC_ID_PCM_U24LE:
-        DECODE(32, le24, src, samples, n, 8, 0x800000)
-        break;
-    case AV_CODEC_ID_PCM_U24BE:
-        DECODE(32, be24, src, samples, n, 8, 0x800000)
-        break;
-    case AV_CODEC_ID_PCM_S24DAUD:
-        for (; n > 0; n--) {
-            uint32_t v = bytestream_get_be24(&src);
-            v >>= 4; // sync flags are here
-            AV_WN16A(samples, ff_reverse[(v >> 8) & 0xff] +
-                             (ff_reverse[v        & 0xff] << 8));
-            samples += 2;
-        }
-        break;
-    case AV_CODEC_ID_PCM_S16LE_PLANAR:
-        DECODE_PLANAR(16, le16, src, samples, n, 0, 0);
-        break;
-    case AV_CODEC_ID_PCM_S24LE_PLANAR:
-        DECODE_PLANAR(32, le24, src, samples, n, 8, 0);
-        break;
-    case AV_CODEC_ID_PCM_S32LE_PLANAR:
-        DECODE_PLANAR(32, le32, src, samples, n, 0, 0);
-        break;
-    case AV_CODEC_ID_PCM_U16LE:
-        DECODE(16, le16, src, samples, n, 0, 0x8000)
-        break;
-    case AV_CODEC_ID_PCM_U16BE:
-        DECODE(16, be16, src, samples, n, 0, 0x8000)
-        break;
-    case AV_CODEC_ID_PCM_S8:
-        for (; n > 0; n--)
-            *samples++ = *src++ + 128;
-        break;
-#if HAVE_BIGENDIAN
-    case AV_CODEC_ID_PCM_F64LE:
-        DECODE(64, le64, src, samples, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_S32LE:
-    case AV_CODEC_ID_PCM_F32LE:
-        DECODE(32, le32, src, samples, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_S16LE:
-        DECODE(16, le16, src, samples, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_F64BE:
-    case AV_CODEC_ID_PCM_F32BE:
-    case AV_CODEC_ID_PCM_S32BE:
-    case AV_CODEC_ID_PCM_S16BE:
-#else
-    case AV_CODEC_ID_PCM_F64BE:
-        DECODE(64, be64, src, samples, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_F32BE:
-    case AV_CODEC_ID_PCM_S32BE:
-        DECODE(32, be32, src, samples, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_S16BE:
-        DECODE(16, be16, src, samples, n, 0, 0)
-        break;
-    case AV_CODEC_ID_PCM_F64LE:
-    case AV_CODEC_ID_PCM_F32LE:
-    case AV_CODEC_ID_PCM_S32LE:
-    case AV_CODEC_ID_PCM_S16LE:
-#endif /* HAVE_BIGENDIAN */
-    case AV_CODEC_ID_PCM_U8:
-        memcpy(samples, src, n * sample_size);
-        break;
-    case AV_CODEC_ID_PCM_ZORK:
-        for (; n > 0; n--) {
-            int v = *src++;
-            if (v < 128)
-                v = 128 - v;
-            *samples++ = v;
-        }
-        break;
-    case AV_CODEC_ID_PCM_ALAW:
-    case AV_CODEC_ID_PCM_MULAW:
-        for (; n > 0; n--) {
-            AV_WN16A(samples, s->table[*src++]);
-            samples += 2;
-        }
-        break;
-    case AV_CODEC_ID_PCM_LXF:
-    {
-        int i;
-        n /= avctx->channels;
-        for (c = 0; c < avctx->channels; c++) {
-            dst_int32_t = (int32_t *)frame->extended_data[c];
-            for (i = 0; i < n; i++) {
-                // extract low 20 bits and expand to 32 bits
-                *dst_int32_t++ =  (src[2]         << 28) |
-                                  (src[1]         << 20) |
-                                  (src[0]         << 12) |
-                                 ((src[2] & 0x0F) <<  8) |
-                                   src[1];
-                // extract high 20 bits and expand to 32 bits
-                *dst_int32_t++ =  (src[4]         << 24) |
-                                  (src[3]         << 16) |
-                                 ((src[2] & 0xF0) <<  8) |
-                                  (src[4]         <<  4) |
-                                  (src[3]         >>  4);
-                src += 5;
-            }
-        }
-        break;
-    }
-    default:
-        return -1;
-    }
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-
-#define PCM_ENCODER_0(id_, sample_fmt_, name_, long_name_)
-#define PCM_ENCODER_1(id_, sample_fmt_, name_, long_name_)                  \
-AVCodec ff_ ## name_ ## _encoder = {                                        \
-    .name         = #name_,                                                 \
-    .long_name    = NULL_IF_CONFIG_SMALL(long_name_),                       \
-    .type         = AVMEDIA_TYPE_AUDIO,                                     \
-    .id           = AV_CODEC_ID_ ## id_,                                    \
-    .init         = pcm_encode_init,                                        \
-    .encode2      = pcm_encode_frame,                                       \
-    .close        = pcm_encode_close,                                       \
-    .capabilities = CODEC_CAP_VARIABLE_FRAME_SIZE,                          \
-    .sample_fmts  = (const enum AVSampleFormat[]){ sample_fmt_,             \
-                                                   AV_SAMPLE_FMT_NONE },    \
-}
-
-#define PCM_ENCODER_2(cf, id, sample_fmt, name, long_name)                  \
-    PCM_ENCODER_ ## cf(id, sample_fmt, name, long_name)
-#define PCM_ENCODER_3(cf, id, sample_fmt, name, long_name)                  \
-    PCM_ENCODER_2(cf, id, sample_fmt, name, long_name)
-#define PCM_ENCODER(id, sample_fmt, name, long_name)                        \
-    PCM_ENCODER_3(CONFIG_ ## id ## _ENCODER, id, sample_fmt, name, long_name)
-
-#define PCM_DECODER_0(id, sample_fmt, name, long_name)
-#define PCM_DECODER_1(id_, sample_fmt_, name_, long_name_)                  \
-AVCodec ff_ ## name_ ## _decoder = {                                        \
-    .name           = #name_,                                               \
-    .long_name      = NULL_IF_CONFIG_SMALL(long_name_),                     \
-    .type           = AVMEDIA_TYPE_AUDIO,                                   \
-    .id             = AV_CODEC_ID_ ## id_,                                  \
-    .priv_data_size = sizeof(PCMDecode),                                    \
-    .init           = pcm_decode_init,                                      \
-    .decode         = pcm_decode_frame,                                     \
-    .capabilities   = CODEC_CAP_DR1,                                        \
-    .sample_fmts    = (const enum AVSampleFormat[]){ sample_fmt_,           \
-                                                     AV_SAMPLE_FMT_NONE },  \
-}
-
-#define PCM_DECODER_2(cf, id, sample_fmt, name, long_name)                  \
-    PCM_DECODER_ ## cf(id, sample_fmt, name, long_name)
-#define PCM_DECODER_3(cf, id, sample_fmt, name, long_name)                  \
-    PCM_DECODER_2(cf, id, sample_fmt, name, long_name)
-#define PCM_DECODER(id, sample_fmt, name, long_name)                        \
-    PCM_DECODER_3(CONFIG_ ## id ## _DECODER, id, sample_fmt, name, long_name)
-
-#define PCM_CODEC(id, sample_fmt_, name, long_name_)                    \
-    PCM_ENCODER(id, sample_fmt_, name, long_name_);                     \
-    PCM_DECODER(id, sample_fmt_, name, long_name_)
-
-/* Note: Do not forget to add new entries to the Makefile as well. */
-PCM_CODEC  (PCM_ALAW,         AV_SAMPLE_FMT_S16, pcm_alaw,         "PCM A-law");
-PCM_CODEC  (PCM_F32BE,        AV_SAMPLE_FMT_FLT, pcm_f32be,        "PCM 32-bit floating point big-endian");
-PCM_CODEC  (PCM_F32LE,        AV_SAMPLE_FMT_FLT, pcm_f32le,        "PCM 32-bit floating point little-endian");
-PCM_CODEC  (PCM_F64BE,        AV_SAMPLE_FMT_DBL, pcm_f64be,        "PCM 64-bit floating point big-endian");
-PCM_CODEC  (PCM_F64LE,        AV_SAMPLE_FMT_DBL, pcm_f64le,        "PCM 64-bit floating point little-endian");
-PCM_DECODER(PCM_LXF,          AV_SAMPLE_FMT_S32P, pcm_lxf,          "PCM signed 20-bit little-endian planar");
-PCM_CODEC  (PCM_MULAW,        AV_SAMPLE_FMT_S16, pcm_mulaw,        "PCM mu-law");
-PCM_CODEC  (PCM_S8,           AV_SAMPLE_FMT_U8,  pcm_s8,           "PCM signed 8-bit");
-PCM_CODEC  (PCM_S16BE,        AV_SAMPLE_FMT_S16, pcm_s16be,        "PCM signed 16-bit big-endian");
-PCM_CODEC  (PCM_S16LE,        AV_SAMPLE_FMT_S16, pcm_s16le,        "PCM signed 16-bit little-endian");
-PCM_DECODER(PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16P, pcm_s16le_planar, "PCM 16-bit little-endian planar");
-PCM_CODEC  (PCM_S24BE,        AV_SAMPLE_FMT_S32, pcm_s24be,        "PCM signed 24-bit big-endian");
-PCM_CODEC  (PCM_S24DAUD,      AV_SAMPLE_FMT_S16, pcm_s24daud,      "PCM D-Cinema audio signed 24-bit");
-PCM_CODEC  (PCM_S24LE,        AV_SAMPLE_FMT_S32, pcm_s24le,        "PCM signed 24-bit little-endian");
-PCM_DECODER(PCM_S24LE_PLANAR, AV_SAMPLE_FMT_S32P,pcm_s24le_planar, "PCM signed 24-bit little-endian planar");
-PCM_CODEC  (PCM_S32BE,        AV_SAMPLE_FMT_S32, pcm_s32be,        "PCM signed 32-bit big-endian");
-PCM_CODEC  (PCM_S32LE,        AV_SAMPLE_FMT_S32, pcm_s32le,        "PCM signed 32-bit little-endian");
-PCM_DECODER(PCM_S32LE_PLANAR, AV_SAMPLE_FMT_S32P,pcm_s32le_planar, "PCM signed 32-bit little-endian planar");
-PCM_CODEC  (PCM_U8,           AV_SAMPLE_FMT_U8,  pcm_u8,           "PCM unsigned 8-bit");
-PCM_CODEC  (PCM_U16BE,        AV_SAMPLE_FMT_S16, pcm_u16be,        "PCM unsigned 16-bit big-endian");
-PCM_CODEC  (PCM_U16LE,        AV_SAMPLE_FMT_S16, pcm_u16le,        "PCM unsigned 16-bit little-endian");
-PCM_CODEC  (PCM_U24BE,        AV_SAMPLE_FMT_S32, pcm_u24be,        "PCM unsigned 24-bit big-endian");
-PCM_CODEC  (PCM_U24LE,        AV_SAMPLE_FMT_S32, pcm_u24le,        "PCM unsigned 24-bit little-endian");
-PCM_CODEC  (PCM_U32BE,        AV_SAMPLE_FMT_S32, pcm_u32be,        "PCM unsigned 32-bit big-endian");
-PCM_CODEC  (PCM_U32LE,        AV_SAMPLE_FMT_S32, pcm_u32le,        "PCM unsigned 32-bit little-endian");
-PCM_DECODER(PCM_ZORK,         AV_SAMPLE_FMT_U8,  pcm_zork,         "PCM Zork");
diff --git a/deps/libav/libavcodec/pcm_tablegen.c b/deps/libav/libavcodec/pcm_tablegen.c
deleted file mode 100644
index 7b4bc8c..0000000
--- a/deps/libav/libavcodec/pcm_tablegen.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Generate a header file for hardcoded PCM tables
- *
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#include "pcm_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
-    pcm_alaw_tableinit();
-    pcm_ulaw_tableinit();
-
-    write_fileheader();
-
-    WRITE_ARRAY("static const", uint8_t, linear_to_alaw);
-    WRITE_ARRAY("static const", uint8_t, linear_to_ulaw);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/pcm_tablegen.h b/deps/libav/libavcodec/pcm_tablegen.h
deleted file mode 100644
index 79d6561..0000000
--- a/deps/libav/libavcodec/pcm_tablegen.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Header file for hardcoded PCM tables
- *
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PCM_TABLEGEN_H
-#define AVCODEC_PCM_TABLEGEN_H
-
-#include <stdint.h>
-#include "libavutil/attributes.h"
-
-/* from g711.c by SUN microsystems (unrestricted use) */
-
-#define         SIGN_BIT        (0x80)      /* Sign bit for a A-law byte. */
-#define         QUANT_MASK      (0xf)       /* Quantization field mask. */
-#define         NSEGS           (8)         /* Number of A-law segments. */
-#define         SEG_SHIFT       (4)         /* Left shift for segment number. */
-#define         SEG_MASK        (0x70)      /* Segment field mask. */
-
-#define         BIAS            (0x84)      /* Bias for linear code. */
-
-/*
- * alaw2linear() - Convert an A-law value to 16-bit linear PCM
- *
- */
-static av_cold int alaw2linear(unsigned char a_val)
-{
-        int t;
-        int seg;
-
-        a_val ^= 0x55;
-
-        t = a_val & QUANT_MASK;
-        seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
-        if(seg) t= (t + t + 1 + 32) << (seg + 2);
-        else    t= (t + t + 1     ) << 3;
-
-        return (a_val & SIGN_BIT) ? t : -t;
-}
-
-static av_cold int ulaw2linear(unsigned char u_val)
-{
-        int t;
-
-        /* Complement to obtain normal u-law value. */
-        u_val = ~u_val;
-
-        /*
-         * Extract and bias the quantization bits. Then
-         * shift up by the segment number and subtract out the bias.
-         */
-        t = ((u_val & QUANT_MASK) << 3) + BIAS;
-        t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT;
-
-        return (u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS);
-}
-
-#if CONFIG_HARDCODED_TABLES
-#define pcm_alaw_tableinit()
-#define pcm_ulaw_tableinit()
-#include "libavcodec/pcm_tables.h"
-#else
-/* 16384 entries per table */
-static uint8_t linear_to_alaw[16384];
-static uint8_t linear_to_ulaw[16384];
-
-static av_cold void build_xlaw_table(uint8_t *linear_to_xlaw,
-                             int (*xlaw2linear)(unsigned char),
-                             int mask)
-{
-    int i, j, v, v1, v2;
-
-    j = 0;
-    for(i=0;i<128;i++) {
-        if (i != 127) {
-            v1 = xlaw2linear(i ^ mask);
-            v2 = xlaw2linear((i + 1) ^ mask);
-            v = (v1 + v2 + 4) >> 3;
-        } else {
-            v = 8192;
-        }
-        for(;j<v;j++) {
-            linear_to_xlaw[8192 + j] = (i ^ mask);
-            if (j > 0)
-                linear_to_xlaw[8192 - j] = (i ^ (mask ^ 0x80));
-        }
-    }
-    linear_to_xlaw[0] = linear_to_xlaw[1];
-}
-
-static void pcm_alaw_tableinit(void)
-{
-    build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);
-}
-
-static void pcm_ulaw_tableinit(void)
-{
-    build_xlaw_table(linear_to_ulaw, ulaw2linear, 0xff);
-}
-#endif /* CONFIG_HARDCODED_TABLES */
-
-#endif /* AVCODEC_PCM_TABLEGEN_H */
diff --git a/deps/libav/libavcodec/pcx.c b/deps/libav/libavcodec/pcx.c
deleted file mode 100644
index 61c971e..0000000
--- a/deps/libav/libavcodec/pcx.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * PC Paintbrush PCX (.pcx) image decoder
- * Copyright (c) 2007, 2008 Ivo van Poorten
- *
- * This decoder does not support CGA palettes. I am unable to find samples
- * and Netpbm cannot generate them.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "get_bits.h"
-#include "internal.h"
-
-/**
- * @return advanced src pointer
- */
-static const uint8_t *pcx_rle_decode(const uint8_t *src,
-                                     const uint8_t *end,
-                                     uint8_t *dst,
-                                     unsigned int bytes_per_scanline,
-                                     int compressed)
-{
-    unsigned int i = 0;
-    unsigned char run, value;
-
-    if (compressed) {
-        while (i < bytes_per_scanline && src < end) {
-            run   = 1;
-            value = *src++;
-            if (value >= 0xc0 && src < end) {
-                run   = value & 0x3f;
-                value = *src++;
-            }
-            while (i < bytes_per_scanline && run--)
-                dst[i++] = value;
-        }
-    } else {
-        memcpy(dst, src, bytes_per_scanline);
-        src += bytes_per_scanline;
-    }
-
-    return src;
-}
-
-static void pcx_palette(const uint8_t **src, uint32_t *dst,
-                        unsigned int pallen)
-{
-    unsigned int i;
-
-    for (i = 0; i < pallen; i++)
-        *dst++ = bytestream_get_be24(src);
-    if (pallen < 256)
-        memset(dst, 0, (256 - pallen) * sizeof(*dst));
-}
-
-static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    AVFrame *const p   = data;
-    int compressed, xmin, ymin, xmax, ymax;
-    unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes, stride, y, x,
-                 bytes_per_scanline;
-    uint8_t *ptr;
-    const uint8_t *buf_end = buf + buf_size;
-    uint8_t const *bufstart = buf;
-    uint8_t *scanline;
-    int ret = -1;
-
-    if (buf[0] != 0x0a || buf[1] > 5) {
-        av_log(avctx, AV_LOG_ERROR, "this is not PCX encoded data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    compressed = buf[2];
-    xmin       = AV_RL16(buf + 4);
-    ymin       = AV_RL16(buf + 6);
-    xmax       = AV_RL16(buf + 8);
-    ymax       = AV_RL16(buf + 10);
-
-    if (xmax < xmin || ymax < ymin) {
-        av_log(avctx, AV_LOG_ERROR, "invalid image dimensions\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    w = xmax - xmin + 1;
-    h = ymax - ymin + 1;
-
-    bits_per_pixel     = buf[3];
-    bytes_per_line     = AV_RL16(buf + 66);
-    nplanes            = buf[65];
-    bytes_per_scanline = nplanes * bytes_per_line;
-
-    if (bytes_per_scanline < (w * bits_per_pixel * nplanes + 7) / 8 ||
-        (!compressed && bytes_per_scanline > buf_size / h)) {
-        av_log(avctx, AV_LOG_ERROR, "PCX data is corrupted\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    switch ((nplanes << 8) + bits_per_pixel) {
-    case 0x0308:
-        avctx->pix_fmt = AV_PIX_FMT_RGB24;
-        break;
-    case 0x0108:
-    case 0x0104:
-    case 0x0102:
-    case 0x0101:
-    case 0x0401:
-    case 0x0301:
-    case 0x0201:
-        avctx->pix_fmt = AV_PIX_FMT_PAL8;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "invalid PCX file\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    buf += 128;
-
-    if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    p->pict_type = AV_PICTURE_TYPE_I;
-
-    ptr    = p->data[0];
-    stride = p->linesize[0];
-
-    scanline = av_malloc(bytes_per_scanline);
-    if (!scanline)
-        return AVERROR(ENOMEM);
-
-    if (nplanes == 3 && bits_per_pixel == 8) {
-        for (y = 0; y < h; y++) {
-            buf = pcx_rle_decode(buf, buf_end,
-                                 scanline, bytes_per_scanline, compressed);
-
-            for (x = 0; x < w; x++) {
-                ptr[3 * x]     = scanline[x];
-                ptr[3 * x + 1] = scanline[x + bytes_per_line];
-                ptr[3 * x + 2] = scanline[x + (bytes_per_line << 1)];
-            }
-
-            ptr += stride;
-        }
-    } else if (nplanes == 1 && bits_per_pixel == 8) {
-        const uint8_t *palstart = bufstart + buf_size - 769;
-
-        if (buf_size < 769) {
-            av_log(avctx, AV_LOG_ERROR, "File is too short\n");
-            ret = avctx->err_recognition & AV_EF_EXPLODE ?
-                  AVERROR_INVALIDDATA : buf_size;
-            goto end;
-        }
-
-        for (y = 0; y < h; y++, ptr += stride) {
-            buf = pcx_rle_decode(buf, buf_end,
-                                 scanline, bytes_per_scanline, compressed);
-            memcpy(ptr, scanline, w);
-        }
-
-        if (buf != palstart) {
-            av_log(avctx, AV_LOG_WARNING, "image data possibly corrupted\n");
-            buf = palstart;
-        }
-        if (*buf++ != 12) {
-            av_log(avctx, AV_LOG_ERROR, "expected palette after image data\n");
-            ret = avctx->err_recognition & AV_EF_EXPLODE ?
-                  AVERROR_INVALIDDATA : buf_size;
-            goto end;
-        }
-    } else if (nplanes == 1) {   /* all packed formats, max. 16 colors */
-        GetBitContext s;
-
-        for (y = 0; y < h; y++) {
-            init_get_bits(&s, scanline, bytes_per_scanline << 3);
-
-            buf = pcx_rle_decode(buf, buf_end,
-                                 scanline, bytes_per_scanline, compressed);
-
-            for (x = 0; x < w; x++)
-                ptr[x] = get_bits(&s, bits_per_pixel);
-            ptr += stride;
-        }
-    } else {    /* planar, 4, 8 or 16 colors */
-        int i;
-
-        for (y = 0; y < h; y++) {
-            buf = pcx_rle_decode(buf, buf_end,
-                                 scanline, bytes_per_scanline, compressed);
-
-            for (x = 0; x < w; x++) {
-                int m = 0x80 >> (x & 7), v = 0;
-                for (i = nplanes - 1; i >= 0; i--) {
-                    v <<= 1;
-                    v  += !!(scanline[i * bytes_per_line + (x >> 3)] & m);
-                }
-                ptr[x] = v;
-            }
-            ptr += stride;
-        }
-    }
-
-    if (nplanes == 1 && bits_per_pixel == 8) {
-        pcx_palette(&buf, (uint32_t *)p->data[1], 256);
-    } else if (bits_per_pixel < 8) {
-        const uint8_t *palette = bufstart + 16;
-        pcx_palette(&palette, (uint32_t *)p->data[1], 16);
-    }
-
-    *got_frame = 1;
-
-    ret = buf - bufstart;
-end:
-    av_free(scanline);
-    return ret;
-}
-
-AVCodec ff_pcx_decoder = {
-    .name         = "pcx",
-    .long_name    = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
-    .type         = AVMEDIA_TYPE_VIDEO,
-    .id           = AV_CODEC_ID_PCX,
-    .decode       = pcx_decode_frame,
-    .capabilities = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/pcxenc.c b/deps/libav/libavcodec/pcxenc.c
deleted file mode 100644
index 4bf7377..0000000
--- a/deps/libav/libavcodec/pcxenc.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * PC Paintbrush PCX (.pcx) image encoder
- * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * PCX image encoder
- * @author Daniel Verkamp
- * @see http://www.qzx.com/pc-gpe/pcx.txt
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-static const uint32_t monoblack_pal[16] = { 0x000000, 0xFFFFFF };
-
-static av_cold int pcx_encode_init(AVCodecContext *avctx)
-{
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    return 0;
-}
-
-static av_cold int pcx_encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-/**
- * PCX run-length encoder
- * @param dst output buffer
- * @param dst_size size of output buffer
- * @param src input buffer
- * @param src_plane_size size of one plane of input buffer in bytes
- * @param nplanes number of planes in input buffer
- * @return number of bytes written to dst or -1 on error
- * @bug will not work for nplanes != 1 && bpp != 8
- */
-static int pcx_rle_encode(      uint8_t *dst, int dst_size,
-                          const uint8_t *src, int src_plane_size, int nplanes)
-{
-    int p;
-    const uint8_t *dst_start = dst;
-
-    // check worst-case upper bound on dst_size
-    if (dst_size < 2LL * src_plane_size * nplanes || src_plane_size <= 0)
-        return -1;
-
-    for (p = 0; p < nplanes; p++) {
-        int count = 1;
-        const uint8_t *src_plane = src + p;
-        const uint8_t *src_plane_end = src_plane + src_plane_size * nplanes;
-        uint8_t prev = *src_plane;
-        src_plane += nplanes;
-
-        for (; ; src_plane += nplanes) {
-            if (src_plane < src_plane_end && *src_plane == prev && count < 0x3F) {
-                // current byte is same as prev
-                ++count;
-            } else {
-                // output prev * count
-                if (count != 1 || prev >= 0xC0)
-                    *dst++ = 0xC0 | count;
-                *dst++ = prev;
-
-                if (src_plane == src_plane_end)
-                    break;
-
-                // start new run
-                count = 1;
-                prev = *src_plane;
-            }
-        }
-    }
-
-    return dst - dst_start;
-}
-
-static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                            const AVFrame *frame, int *got_packet)
-{
-    const uint8_t *buf_end;
-    uint8_t *buf;
-
-    int bpp, nplanes, i, y, line_bytes, written, ret, max_pkt_size;
-    const uint32_t *pal = NULL;
-    const uint8_t *src;
-
-    if (avctx->width > 65535 || avctx->height > 65535) {
-        av_log(avctx, AV_LOG_ERROR, "image dimensions do not fit in 16 bits\n");
-        return -1;
-    }
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB24:
-        bpp = 8;
-        nplanes = 3;
-        break;
-    case AV_PIX_FMT_RGB8:
-    case AV_PIX_FMT_BGR8:
-    case AV_PIX_FMT_RGB4_BYTE:
-    case AV_PIX_FMT_BGR4_BYTE:
-    case AV_PIX_FMT_GRAY8:
-    case AV_PIX_FMT_PAL8:
-        bpp = 8;
-        nplanes = 1;
-        pal = (uint32_t *)frame->data[1];
-        break;
-    case AV_PIX_FMT_MONOBLACK:
-        bpp = 1;
-        nplanes = 1;
-        pal = monoblack_pal;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "unsupported pixfmt\n");
-        return -1;
-    }
-
-    line_bytes = (avctx->width * bpp + 7) >> 3;
-    line_bytes = (line_bytes + 1) & ~1;
-
-    max_pkt_size = 128 + avctx->height * 2 * line_bytes * nplanes + (pal ? 256*3 + 1 : 0);
-    if ((ret = ff_alloc_packet(pkt, max_pkt_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", max_pkt_size);
-        return ret;
-    }
-    buf     = pkt->data;
-    buf_end = pkt->data + pkt->size;
-
-    bytestream_put_byte(&buf, 10);                  // manufacturer
-    bytestream_put_byte(&buf, 5);                   // version
-    bytestream_put_byte(&buf, 1);                   // encoding
-    bytestream_put_byte(&buf, bpp);                 // bits per pixel per plane
-    bytestream_put_le16(&buf, 0);                   // x min
-    bytestream_put_le16(&buf, 0);                   // y min
-    bytestream_put_le16(&buf, avctx->width - 1);    // x max
-    bytestream_put_le16(&buf, avctx->height - 1);   // y max
-    bytestream_put_le16(&buf, 0);                   // horizontal DPI
-    bytestream_put_le16(&buf, 0);                   // vertical DPI
-    for (i = 0; i < 16; i++)
-        bytestream_put_be24(&buf, pal ? pal[i] : 0);// palette (<= 16 color only)
-    bytestream_put_byte(&buf, 0);                   // reserved
-    bytestream_put_byte(&buf, nplanes);             // number of planes
-    bytestream_put_le16(&buf, line_bytes);          // scanline plane size in bytes
-
-    while (buf - pkt->data < 128)
-        *buf++= 0;
-
-    src = frame->data[0];
-
-    for (y = 0; y < avctx->height; y++) {
-        if ((written = pcx_rle_encode(buf, buf_end - buf,
-                                      src, line_bytes, nplanes)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "buffer too small\n");
-            return -1;
-        }
-        buf += written;
-        src += frame->linesize[0];
-    }
-
-    if (nplanes == 1 && bpp == 8) {
-        if (buf_end - buf < 257) {
-            av_log(avctx, AV_LOG_ERROR, "buffer too small\n");
-            return -1;
-        }
-        bytestream_put_byte(&buf, 12);
-        for (i = 0; i < 256; i++) {
-            bytestream_put_be24(&buf, pal[i]);
-        }
-    }
-
-    pkt->size   = buf - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-AVCodec ff_pcx_encoder = {
-    .name           = "pcx",
-    .long_name      = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PCX,
-    .init           = pcx_encode_init,
-    .close          = pcx_encode_close,
-    .encode2        = pcx_encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_RGB24,
-        AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE,
-        AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8,
-        AV_PIX_FMT_MONOBLACK,
-        AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/pgssubdec.c b/deps/libav/libavcodec/pgssubdec.c
deleted file mode 100644
index 2102a51..0000000
--- a/deps/libav/libavcodec/pgssubdec.c
+++ /dev/null
@@ -1,498 +0,0 @@
-/*
- * PGS subtitle decoder
- * Copyright (c) 2009 Stephen Backway
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * PGS subtitle decoder
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "bytestream.h"
-#include "internal.h"
-
-#include "libavutil/colorspace.h"
-#include "libavutil/imgutils.h"
-
-#define RGBA(r,g,b,a) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-
-enum SegmentType {
-    PALETTE_SEGMENT      = 0x14,
-    PICTURE_SEGMENT      = 0x15,
-    PRESENTATION_SEGMENT = 0x16,
-    WINDOW_SEGMENT       = 0x17,
-    DISPLAY_SEGMENT      = 0x80,
-};
-
-typedef struct PGSSubPresentation {
-    int x;
-    int y;
-    int id_number;
-    int object_number;
-    uint8_t composition_flag;
-    int64_t pts;
-} PGSSubPresentation;
-
-typedef struct PGSSubPicture {
-    int          w;
-    int          h;
-    uint8_t      *rle;
-    unsigned int rle_buffer_size, rle_data_len;
-    unsigned int rle_remaining_len;
-} PGSSubPicture;
-
-typedef struct PGSSubContext {
-    PGSSubPresentation presentation;
-    uint32_t           clut[256];
-    PGSSubPicture      picture;
-} PGSSubContext;
-
-static av_cold int init_decoder(AVCodecContext *avctx)
-{
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    return 0;
-}
-
-static av_cold int close_decoder(AVCodecContext *avctx)
-{
-    PGSSubContext *ctx = avctx->priv_data;
-
-    av_freep(&ctx->picture.rle);
-    ctx->picture.rle_buffer_size  = 0;
-
-    return 0;
-}
-
-/**
- * Decode the RLE data.
- *
- * The subtitle is stored as an Run Length Encoded image.
- *
- * @param avctx contains the current codec context
- * @param sub pointer to the processed subtitle data
- * @param buf pointer to the RLE data to process
- * @param buf_size size of the RLE data to process
- */
-static int decode_rle(AVCodecContext *avctx, AVSubtitle *sub,
-                      const uint8_t *buf, unsigned int buf_size)
-{
-    const uint8_t *rle_bitmap_end;
-    int pixel_count, line_count;
-
-    rle_bitmap_end = buf + buf_size;
-
-    sub->rects[0]->pict.data[0] = av_malloc(sub->rects[0]->w * sub->rects[0]->h);
-
-    if (!sub->rects[0]->pict.data[0])
-        return -1;
-
-    pixel_count = 0;
-    line_count  = 0;
-
-    while (buf < rle_bitmap_end && line_count < sub->rects[0]->h) {
-        uint8_t flags, color;
-        int run;
-
-        color = bytestream_get_byte(&buf);
-        run   = 1;
-
-        if (color == 0x00) {
-            flags = bytestream_get_byte(&buf);
-            run   = flags & 0x3f;
-            if (flags & 0x40)
-                run = (run << 8) + bytestream_get_byte(&buf);
-            color = flags & 0x80 ? bytestream_get_byte(&buf) : 0;
-        }
-
-        if (run > 0 && pixel_count + run <= sub->rects[0]->w * sub->rects[0]->h) {
-            memset(sub->rects[0]->pict.data[0] + pixel_count, color, run);
-            pixel_count += run;
-        } else if (!run) {
-            /*
-             * New Line. Check if correct pixels decoded, if not display warning
-             * and adjust bitmap pointer to correct new line position.
-             */
-            if (pixel_count % sub->rects[0]->w > 0)
-                av_log(avctx, AV_LOG_ERROR, "Decoded %d pixels, when line should be %d pixels\n",
-                       pixel_count % sub->rects[0]->w, sub->rects[0]->w);
-            line_count++;
-        }
-    }
-
-    if (pixel_count < sub->rects[0]->w * sub->rects[0]->h) {
-        av_log(avctx, AV_LOG_ERROR, "Insufficient RLE data for subtitle\n");
-        return -1;
-    }
-
-    av_dlog(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, sub->rects[0]->w * sub->rects[0]->h);
-
-    return 0;
-}
-
-/**
- * Parse the picture segment packet.
- *
- * The picture segment contains details on the sequence id,
- * width, height and Run Length Encoded (RLE) bitmap data.
- *
- * @param avctx contains the current codec context
- * @param buf pointer to the packet to process
- * @param buf_size size of packet to process
- * @todo TODO: Enable support for RLE data over multiple packets
- */
-static int parse_picture_segment(AVCodecContext *avctx,
-                                  const uint8_t *buf, int buf_size)
-{
-    PGSSubContext *ctx = avctx->priv_data;
-
-    uint8_t sequence_desc;
-    unsigned int rle_bitmap_len, width, height;
-
-    if (buf_size <= 4)
-        return -1;
-    buf_size -= 4;
-
-    /* skip 3 unknown bytes: Object ID (2 bytes), Version Number */
-    buf += 3;
-
-    /* Read the Sequence Description to determine if start of RLE data or appended to previous RLE */
-    sequence_desc = bytestream_get_byte(&buf);
-
-    if (!(sequence_desc & 0x80)) {
-        /* Additional RLE data */
-        if (buf_size > ctx->picture.rle_remaining_len)
-            return -1;
-
-        memcpy(ctx->picture.rle + ctx->picture.rle_data_len, buf, buf_size);
-        ctx->picture.rle_data_len += buf_size;
-        ctx->picture.rle_remaining_len -= buf_size;
-
-        return 0;
-    }
-
-    if (buf_size <= 7)
-        return -1;
-    buf_size -= 7;
-
-    /* Decode rle bitmap length, stored size includes width/height data */
-    rle_bitmap_len = bytestream_get_be24(&buf) - 2*2;
-
-    /* Get bitmap dimensions from data */
-    width  = bytestream_get_be16(&buf);
-    height = bytestream_get_be16(&buf);
-
-    /* Make sure the bitmap is not too large */
-    if (avctx->width < width || avctx->height < height) {
-        av_log(avctx, AV_LOG_ERROR, "Bitmap dimensions larger than video.\n");
-        return -1;
-    }
-
-    ctx->picture.w = width;
-    ctx->picture.h = height;
-
-    av_fast_malloc(&ctx->picture.rle, &ctx->picture.rle_buffer_size, rle_bitmap_len);
-
-    if (!ctx->picture.rle)
-        return -1;
-
-    memcpy(ctx->picture.rle, buf, buf_size);
-    ctx->picture.rle_data_len = buf_size;
-    ctx->picture.rle_remaining_len = rle_bitmap_len - buf_size;
-
-    return 0;
-}
-
-/**
- * Parse the palette segment packet.
- *
- * The palette segment contains details of the palette,
- * a maximum of 256 colors can be defined.
- *
- * @param avctx contains the current codec context
- * @param buf pointer to the packet to process
- * @param buf_size size of packet to process
- */
-static void parse_palette_segment(AVCodecContext *avctx,
-                                  const uint8_t *buf, int buf_size)
-{
-    PGSSubContext *ctx = avctx->priv_data;
-
-    const uint8_t *buf_end = buf + buf_size;
-    const uint8_t *cm      = ff_cropTbl + MAX_NEG_CROP;
-    int color_id;
-    int y, cb, cr, alpha;
-    int r, g, b, r_add, g_add, b_add;
-
-    /* Skip two null bytes */
-    buf += 2;
-
-    while (buf < buf_end) {
-        color_id  = bytestream_get_byte(&buf);
-        y         = bytestream_get_byte(&buf);
-        cr        = bytestream_get_byte(&buf);
-        cb        = bytestream_get_byte(&buf);
-        alpha     = bytestream_get_byte(&buf);
-
-        YUV_TO_RGB1(cb, cr);
-        YUV_TO_RGB2(r, g, b, y);
-
-        av_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);
-
-        /* Store color in palette */
-        ctx->clut[color_id] = RGBA(r,g,b,alpha);
-    }
-}
-
-/**
- * Parse the presentation segment packet.
- *
- * The presentation segment contains details on the video
- * width, video height, x & y subtitle position.
- *
- * @param avctx contains the current codec context
- * @param buf pointer to the packet to process
- * @param buf_size size of packet to process
- * @todo TODO: Implement cropping
- * @todo TODO: Implement forcing of subtitles
- */
-static int parse_presentation_segment(AVCodecContext *avctx,
-                                      const uint8_t *buf, int buf_size,
-                                      int64_t pts)
-{
-    PGSSubContext *ctx = avctx->priv_data;
-
-    int x, y, ret;
-
-    int w = bytestream_get_be16(&buf);
-    int h = bytestream_get_be16(&buf);
-
-    ctx->presentation.pts = pts;
-
-    av_dlog(avctx, "Video Dimensions %dx%d\n",
-            w, h);
-    ret = ff_set_dimensions(avctx, w, h);
-    if (ret < 0)
-        return ret;
-
-    /* Skip 1 bytes of unknown, frame rate? */
-    buf++;
-
-    ctx->presentation.id_number = bytestream_get_be16(&buf);
-
-    /*
-     * Skip 3 bytes of unknown:
-     *     state
-     *     palette_update_flag (0x80),
-     *     palette_id_to_use,
-     */
-    buf += 3;
-
-    ctx->presentation.object_number = bytestream_get_byte(&buf);
-    ctx->presentation.composition_flag = 0;
-    if (!ctx->presentation.object_number)
-        return 0;
-
-    /*
-     * Skip 3 bytes of unknown:
-     *     object_id_ref (2 bytes),
-     *     window_id_ref,
-     */
-    buf += 3;
-    ctx->presentation.composition_flag = bytestream_get_byte(&buf);
-
-    x = bytestream_get_be16(&buf);
-    y = bytestream_get_be16(&buf);
-
-    /* TODO If cropping, cropping_x, cropping_y, cropping_width, cropping_height (all 2 bytes).*/
-
-    av_dlog(avctx, "Subtitle Placement x=%d, y=%d\n", x, y);
-
-    if (x > avctx->width || y > avctx->height) {
-        av_log(avctx, AV_LOG_ERROR, "Subtitle out of video bounds. x = %d, y = %d, video width = %d, video height = %d.\n",
-               x, y, avctx->width, avctx->height);
-        x = 0; y = 0;
-    }
-
-    /* Fill in dimensions */
-    ctx->presentation.x = x;
-    ctx->presentation.y = y;
-
-    return 0;
-}
-
-/**
- * Parse the display segment packet.
- *
- * The display segment controls the updating of the display.
- *
- * @param avctx contains the current codec context
- * @param data pointer to the data pertaining the subtitle to display
- * @param buf pointer to the packet to process
- * @param buf_size size of packet to process
- * @todo TODO: Fix start time, relies on correct PTS, currently too late
- *
- * @todo TODO: Fix end time, normally cleared by a second display
- * @todo       segment, which is currently ignored as it clears
- * @todo       the subtitle too early.
- */
-static int display_end_segment(AVCodecContext *avctx, void *data,
-                               const uint8_t *buf, int buf_size)
-{
-    AVSubtitle    *sub = data;
-    PGSSubContext *ctx = avctx->priv_data;
-
-    /*
-     *      The end display time is a timeout value and is only reached
-     *      if the next subtitle is later then timeout or subtitle has
-     *      not been cleared by a subsequent empty display command.
-     */
-
-    memset(sub, 0, sizeof(*sub));
-    sub->pts = ctx->presentation.pts;
-
-    // Blank if last object_number was 0.
-    // Note that this may be wrong for more complex subtitles.
-    if (!ctx->presentation.object_number)
-        return 1;
-    sub->start_display_time = 0;
-    sub->end_display_time   = 20000;
-    sub->format             = 0;
-
-    sub->rects     = av_mallocz(sizeof(*sub->rects));
-    sub->rects[0]  = av_mallocz(sizeof(*sub->rects[0]));
-    sub->num_rects = 1;
-
-    if (ctx->presentation.composition_flag & 0x40)
-        sub->rects[0]->flags |= AV_SUBTITLE_FLAG_FORCED;
-
-    sub->rects[0]->x    = ctx->presentation.x;
-    sub->rects[0]->y    = ctx->presentation.y;
-    sub->rects[0]->w    = ctx->picture.w;
-    sub->rects[0]->h    = ctx->picture.h;
-    sub->rects[0]->type = SUBTITLE_BITMAP;
-
-    /* Process bitmap */
-    sub->rects[0]->pict.linesize[0] = ctx->picture.w;
-
-    if (ctx->picture.rle) {
-        if (ctx->picture.rle_remaining_len)
-            av_log(avctx, AV_LOG_ERROR, "RLE data length %u is %u bytes shorter than expected\n",
-                   ctx->picture.rle_data_len, ctx->picture.rle_remaining_len);
-        if(decode_rle(avctx, sub, ctx->picture.rle, ctx->picture.rle_data_len) < 0)
-            return 0;
-    }
-    /* Allocate memory for colors */
-    sub->rects[0]->nb_colors    = 256;
-    sub->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
-
-    memcpy(sub->rects[0]->pict.data[1], ctx->clut, sub->rects[0]->nb_colors * sizeof(uint32_t));
-
-    return 1;
-}
-
-static int decode(AVCodecContext *avctx, void *data, int *data_size,
-                  AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-
-    const uint8_t *buf_end;
-    uint8_t       segment_type;
-    int           segment_length;
-    int i, ret;
-
-    av_dlog(avctx, "PGS sub packet:\n");
-
-    for (i = 0; i < buf_size; i++) {
-        av_dlog(avctx, "%02x ", buf[i]);
-        if (i % 16 == 15)
-            av_dlog(avctx, "\n");
-    }
-
-    if (i & 15)
-        av_dlog(avctx, "\n");
-
-    *data_size = 0;
-
-    /* Ensure that we have received at a least a segment code and segment length */
-    if (buf_size < 3)
-        return -1;
-
-    buf_end = buf + buf_size;
-
-    /* Step through buffer to identify segments */
-    while (buf < buf_end) {
-        segment_type   = bytestream_get_byte(&buf);
-        segment_length = bytestream_get_be16(&buf);
-
-        av_dlog(avctx, "Segment Length %d, Segment Type %x\n", segment_length, segment_type);
-
-        if (segment_type != DISPLAY_SEGMENT && segment_length > buf_end - buf)
-            break;
-
-        switch (segment_type) {
-        case PALETTE_SEGMENT:
-            parse_palette_segment(avctx, buf, segment_length);
-            break;
-        case PICTURE_SEGMENT:
-            parse_picture_segment(avctx, buf, segment_length);
-            break;
-        case PRESENTATION_SEGMENT:
-            ret = parse_presentation_segment(avctx, buf, segment_length, avpkt->pts);
-            if (ret < 0)
-                return ret;
-            break;
-        case WINDOW_SEGMENT:
-            /*
-             * Window Segment Structure (No new information provided):
-             *     2 bytes: Unknown,
-             *     2 bytes: X position of subtitle,
-             *     2 bytes: Y position of subtitle,
-             *     2 bytes: Width of subtitle,
-             *     2 bytes: Height of subtitle.
-             */
-            break;
-        case DISPLAY_SEGMENT:
-            *data_size = display_end_segment(avctx, data, buf, segment_length);
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unknown subtitle segment type 0x%x, length %d\n",
-                   segment_type, segment_length);
-            break;
-        }
-
-        buf += segment_length;
-    }
-
-    return buf_size;
-}
-
-AVCodec ff_pgssub_decoder = {
-    .name           = "pgssub",
-    .long_name      = NULL_IF_CONFIG_SMALL("HDMV Presentation Graphic Stream subtitles"),
-    .type           = AVMEDIA_TYPE_SUBTITLE,
-    .id             = AV_CODEC_ID_HDMV_PGS_SUBTITLE,
-    .priv_data_size = sizeof(PGSSubContext),
-    .init           = init_decoder,
-    .close          = close_decoder,
-    .decode         = decode,
-};
diff --git a/deps/libav/libavcodec/pictordec.c b/deps/libav/libavcodec/pictordec.c
deleted file mode 100644
index 33c4545..0000000
--- a/deps/libav/libavcodec/pictordec.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Pictor/PC Paint decoder
- * Copyright (c) 2010 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Pictor/PC Paint decoder
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "cga_data.h"
-#include "internal.h"
-
-typedef struct PicContext {
-    int width, height;
-    int nb_planes;
-    GetByteContext g;
-} PicContext;
-
-static void picmemset_8bpp(PicContext *s, AVFrame *frame, int value, int run,
-                           int *x, int *y)
-{
-    while (run > 0) {
-        uint8_t *d = frame->data[0] + *y * frame->linesize[0];
-        if (*x + run >= s->width) {
-            int n = s->width - *x;
-            memset(d + *x, value, n);
-            run -= n;
-            *x = 0;
-            *y -= 1;
-            if (*y < 0)
-                break;
-        } else {
-            memset(d + *x, value, run);
-            *x += run;
-            break;
-        }
-    }
-}
-
-static void picmemset(PicContext *s, AVFrame *frame, int value, int run,
-                      int *x, int *y, int *plane, int bits_per_plane)
-{
-    uint8_t *d;
-    int shift = *plane * bits_per_plane;
-    int mask  = ((1 << bits_per_plane) - 1) << shift;
-    value   <<= shift;
-
-    while (run > 0) {
-        int j;
-        for (j = 8-bits_per_plane; j >= 0; j -= bits_per_plane) {
-            d = frame->data[0] + *y * frame->linesize[0];
-            d[*x] |= (value >> j) & mask;
-            *x += 1;
-            if (*x == s->width) {
-                *y -= 1;
-                *x = 0;
-                if (*y < 0) {
-                   *y = s->height - 1;
-                   *plane += 1;
-                   value <<= bits_per_plane;
-                   mask  <<= bits_per_plane;
-                   if (*plane >= s->nb_planes)
-                       break;
-                }
-            }
-        }
-        run--;
-    }
-}
-
-static const uint8_t cga_mode45_index[6][4] = {
-    [0] = { 0, 3,  5,   7 }, // mode4, palette#1, low intensity
-    [1] = { 0, 2,  4,   6 }, // mode4, palette#2, low intensity
-    [2] = { 0, 3,  4,   7 }, // mode5, low intensity
-    [3] = { 0, 11, 13, 15 }, // mode4, palette#1, high intensity
-    [4] = { 0, 10, 12, 14 }, // mode4, palette#2, high intensity
-    [5] = { 0, 11, 12, 15 }, // mode5, high intensity
-};
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    PicContext *s = avctx->priv_data;
-    AVFrame *frame = data;
-    uint32_t *palette;
-    int bits_per_plane, bpp, etype, esize, npal, pos_after_pal;
-    int i, x, y, plane, tmp, ret;
-
-    bytestream2_init(&s->g, avpkt->data, avpkt->size);
-
-    if (bytestream2_get_bytes_left(&s->g) < 11)
-        return AVERROR_INVALIDDATA;
-
-    if (bytestream2_get_le16u(&s->g) != 0x1234)
-        return AVERROR_INVALIDDATA;
-
-    s->width       = bytestream2_get_le16u(&s->g);
-    s->height      = bytestream2_get_le16u(&s->g);
-    bytestream2_skip(&s->g, 4);
-    tmp            = bytestream2_get_byteu(&s->g);
-    bits_per_plane = tmp & 0xF;
-    s->nb_planes   = (tmp >> 4) + 1;
-    bpp            = bits_per_plane * s->nb_planes;
-    if (bits_per_plane > 8 || bpp < 1 || bpp > 32) {
-        avpriv_request_sample(avctx, "Unsupported bit depth");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (bytestream2_peek_byte(&s->g) == 0xFF) {
-        bytestream2_skip(&s->g, 2);
-        etype = bytestream2_get_le16(&s->g);
-        esize = bytestream2_get_le16(&s->g);
-        if (bytestream2_get_bytes_left(&s->g) < esize)
-            return AVERROR_INVALIDDATA;
-    } else {
-        etype = -1;
-        esize = 0;
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    if (s->width != avctx->width && s->height != avctx->height) {
-        ret = ff_set_dimensions(avctx, s->width, s->height);
-        if (ret < 0)
-            return ret;
-    }
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    memset(frame->data[0], 0, s->height * frame->linesize[0]);
-    frame->pict_type           = AV_PICTURE_TYPE_I;
-    frame->palette_has_changed = 1;
-
-    pos_after_pal = bytestream2_tell(&s->g) + esize;
-    palette = (uint32_t*)frame->data[1];
-    if (etype == 1 && esize > 1 && bytestream2_peek_byte(&s->g) < 6) {
-        int idx = bytestream2_get_byte(&s->g);
-        npal = 4;
-        for (i = 0; i < npal; i++)
-            palette[i] = ff_cga_palette[ cga_mode45_index[idx][i] ];
-    } else if (etype == 2) {
-        npal = FFMIN(esize, 16);
-        for (i = 0; i < npal; i++) {
-            int pal_idx = bytestream2_get_byte(&s->g);
-            palette[i]  = ff_cga_palette[FFMIN(pal_idx, 16)];
-        }
-    } else if (etype == 3) {
-        npal = FFMIN(esize, 16);
-        for (i = 0; i < npal; i++) {
-            int pal_idx = bytestream2_get_byte(&s->g);
-            palette[i]  = ff_ega_palette[FFMIN(pal_idx, 63)];
-        }
-    } else if (etype == 4 || etype == 5) {
-        npal = FFMIN(esize / 3, 256);
-        for (i = 0; i < npal; i++)
-            palette[i] = bytestream2_get_be24(&s->g) << 2;
-    } else {
-        if (bpp == 1) {
-            npal = 2;
-            palette[0] = 0x000000;
-            palette[1] = 0xFFFFFF;
-        } else if (bpp == 2) {
-            npal = 4;
-            for (i = 0; i < npal; i++)
-                palette[i] = ff_cga_palette[ cga_mode45_index[0][i] ];
-        } else {
-            npal = 16;
-            memcpy(palette, ff_cga_palette, npal * 4);
-        }
-    }
-    // fill remaining palette entries
-    memset(palette + npal, 0, AVPALETTE_SIZE - npal * 4);
-    // skip remaining palette bytes
-    bytestream2_seek(&s->g, pos_after_pal, SEEK_SET);
-
-    x = 0;
-    y = s->height - 1;
-    plane = 0;
-    if (bytestream2_get_le16(&s->g)) {
-        while (bytestream2_get_bytes_left(&s->g) >= 6) {
-            int stop_size, marker, t1, t2;
-
-            t1        = bytestream2_get_bytes_left(&s->g);
-            t2        = bytestream2_get_le16(&s->g);
-            stop_size = t1 - FFMIN(t1, t2);
-            // ignore uncompressed block size
-            bytestream2_skip(&s->g, 2);
-            marker    = bytestream2_get_byte(&s->g);
-
-            while (plane < s->nb_planes &&
-                   bytestream2_get_bytes_left(&s->g) > stop_size) {
-                int run = 1;
-                int val = bytestream2_get_byte(&s->g);
-                if (val == marker) {
-                    run = bytestream2_get_byte(&s->g);
-                    if (run == 0)
-                        run = bytestream2_get_le16(&s->g);
-                    val = bytestream2_get_byte(&s->g);
-                }
-                if (!bytestream2_get_bytes_left(&s->g))
-                    break;
-
-                if (bits_per_plane == 8) {
-                    picmemset_8bpp(s, frame, val, run, &x, &y);
-                    if (y < 0)
-                        goto finish;
-                } else {
-                    picmemset(s, frame, val, run, &x, &y, &plane, bits_per_plane);
-                }
-            }
-        }
-    } else {
-        avpriv_request_sample(avctx, "Uncompressed image");
-        return avpkt->size;
-    }
-finish:
-
-    *got_frame      = 1;
-    return avpkt->size;
-}
-
-AVCodec ff_pictor_decoder = {
-    .name           = "pictor",
-    .long_name      = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PICTOR,
-    .priv_data_size = sizeof(PicContext),
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/png.c b/deps/libav/libavcodec/png.c
deleted file mode 100644
index 65d6964..0000000
--- a/deps/libav/libavcodec/png.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * PNG image format
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "bytestream.h"
-#include "png.h"
-
-const uint8_t ff_pngsig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
-const uint8_t ff_mngsig[8] = {138, 77, 78, 71, 13, 10, 26, 10};
-
-/* Mask to determine which y pixels are valid in a pass */
-const uint8_t ff_png_pass_ymask[NB_PASSES] = {
-    0x80, 0x80, 0x08, 0x88, 0x22, 0xaa, 0x55,
-};
-
-/* minimum x value */
-static const uint8_t ff_png_pass_xmin[NB_PASSES] = {
-    0, 4, 0, 2, 0, 1, 0
-};
-
-/* x shift to get row width */
-static const uint8_t ff_png_pass_xshift[NB_PASSES] = {
-    3, 3, 2, 2, 1, 1, 0
-};
-
-/* Mask to determine which pixels are valid in a pass */
-const uint8_t ff_png_pass_mask[NB_PASSES] = {
-    0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff
-};
-
-void *ff_png_zalloc(void *opaque, unsigned int items, unsigned int size)
-{
-    return av_mallocz_array(items, size);
-}
-
-void ff_png_zfree(void *opaque, void *ptr)
-{
-    av_free(ptr);
-}
-
-int ff_png_get_nb_channels(int color_type)
-{
-    int channels;
-    channels = 1;
-    if ((color_type & (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)) ==
-        PNG_COLOR_MASK_COLOR)
-        channels = 3;
-    if (color_type & PNG_COLOR_MASK_ALPHA)
-        channels++;
-    return channels;
-}
-
-/* compute the row size of an interleaved pass */
-int ff_png_pass_row_size(int pass, int bits_per_pixel, int width)
-{
-    int shift, xmin, pass_width;
-
-    xmin = ff_png_pass_xmin[pass];
-    if (width <= xmin)
-        return 0;
-    shift = ff_png_pass_xshift[pass];
-    pass_width = (width - xmin + (1 << shift) - 1) >> shift;
-    return (pass_width * bits_per_pixel + 7) >> 3;
-}
diff --git a/deps/libav/libavcodec/png.h b/deps/libav/libavcodec/png.h
deleted file mode 100644
index b8c72ee..0000000
--- a/deps/libav/libavcodec/png.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * PNG image format
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PNG_H
-#define AVCODEC_PNG_H
-
-#include <stdint.h>
-
-#define PNG_COLOR_MASK_PALETTE    1
-#define PNG_COLOR_MASK_COLOR      2
-#define PNG_COLOR_MASK_ALPHA      4
-
-#define PNG_COLOR_TYPE_GRAY 0
-#define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)
-#define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)
-#define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
-#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)
-
-#define PNG_FILTER_TYPE_LOCO   64
-#define PNG_FILTER_VALUE_NONE  0
-#define PNG_FILTER_VALUE_SUB   1
-#define PNG_FILTER_VALUE_UP    2
-#define PNG_FILTER_VALUE_AVG   3
-#define PNG_FILTER_VALUE_PAETH 4
-#define PNG_FILTER_VALUE_MIXED 5
-
-#define PNG_IHDR      0x0001
-#define PNG_IDAT      0x0002
-#define PNG_ALLIMAGE  0x0004
-#define PNG_PLTE      0x0008
-
-#define NB_PASSES 7
-
-extern const uint8_t ff_pngsig[8];
-extern const uint8_t ff_mngsig[8];
-
-/* Mask to determine which y pixels are valid in a pass */
-extern const uint8_t ff_png_pass_ymask[NB_PASSES];
-
-/* Mask to determine which pixels are valid in a pass */
-extern const uint8_t ff_png_pass_mask[NB_PASSES];
-
-void *ff_png_zalloc(void *opaque, unsigned int items, unsigned int size);
-
-void ff_png_zfree(void *opaque, void *ptr);
-
-int ff_png_get_nb_channels(int color_type);
-
-/* compute the row size of an interleaved pass */
-int ff_png_pass_row_size(int pass, int bits_per_pixel, int width);
-
-void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp);
-
-#endif /* AVCODEC_PNG_H */
diff --git a/deps/libav/libavcodec/png_parser.c b/deps/libav/libavcodec/png_parser.c
deleted file mode 100644
index d07f288..0000000
--- a/deps/libav/libavcodec/png_parser.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * PNG parser
- * Copyright (c) 2009 Peter Holik
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * PNG parser
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/common.h"
-
-#include "parser.h"
-
-#define PNG_SIGNATURE UINT64_C(0x89504e470d0a1a0a)
-#define MNG_SIGNATURE UINT64_C(0x8a4d4e470d0a1a0a)
-
-typedef struct PNGParseContext {
-    ParseContext pc;
-
-    int chunk_pos;          ///< position inside current chunk
-    int chunk_length;       ///< length of the current chunk
-    int remaining_size;     ///< remaining size of the current chunk
-} PNGParseContext;
-
-static int png_parse(AVCodecParserContext *s, AVCodecContext *avctx,
-                     const uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size)
-{
-    PNGParseContext *ppc = s->priv_data;
-    int next = END_NOT_FOUND;
-    int i = 0;
-
-    *poutbuf_size = 0;
-    if (buf_size == 0)
-        return 0;
-
-    if (!ppc->pc.frame_start_found) {
-        uint64_t state64 = ppc->pc.state64;
-        for (; i < buf_size; i++) {
-            state64 = (state64 << 8) | buf[i];
-            if (state64 == PNG_SIGNATURE ||
-                state64 == MNG_SIGNATURE) {
-                i++;
-                ppc->pc.frame_start_found = 1;
-                break;
-            }
-        }
-        ppc->pc.state64 = state64;
-    } else if (ppc->remaining_size) {
-        i = FFMIN(ppc->remaining_size, buf_size);
-        ppc->remaining_size -= i;
-        if (ppc->remaining_size)
-            goto flush;
-        if (ppc->chunk_pos == -1) {
-            next = i;
-            goto flush;
-        }
-    }
-
-    for (; ppc->pc.frame_start_found && i < buf_size; i++) {
-        ppc->pc.state = (ppc->pc.state << 8) | buf[i];
-        if (ppc->chunk_pos == 3) {
-            ppc->chunk_length = ppc->pc.state;
-            if (ppc->chunk_length > 0x7fffffff) {
-                ppc->chunk_pos = ppc->pc.frame_start_found = 0;
-                goto flush;
-            }
-            ppc->chunk_length += 4;
-        } else if (ppc->chunk_pos == 7) {
-            if (ppc->chunk_length >= buf_size - i)
-                ppc->remaining_size = ppc->chunk_length - buf_size + i + 1;
-            if (ppc->pc.state == MKBETAG('I', 'E', 'N', 'D')) {
-                if (ppc->remaining_size)
-                    ppc->chunk_pos = -1;
-                else
-                    next = ppc->chunk_length + i + 1;
-                break;
-            } else {
-                ppc->chunk_pos = 0;
-                if (ppc->remaining_size)
-                    break;
-                else
-                    i += ppc->chunk_length;
-                continue;
-            }
-        }
-        ppc->chunk_pos++;
-    }
-
-flush:
-    if (ff_combine_frame(&ppc->pc, next, &buf, &buf_size) < 0)
-        return buf_size;
-
-    ppc->chunk_pos = ppc->pc.frame_start_found = 0;
-
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_png_parser = {
-    .codec_ids      = { AV_CODEC_ID_PNG },
-    .priv_data_size = sizeof(PNGParseContext),
-    .parser_parse   = png_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/pngdec.c b/deps/libav/libavcodec/pngdec.c
deleted file mode 100644
index e646296..0000000
--- a/deps/libav/libavcodec/pngdec.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- * PNG image format
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "png.h"
-#include "pngdsp.h"
-
-/* TODO:
- * - add 2, 4 and 16 bit depth support
- */
-
-#include <zlib.h>
-
-typedef struct PNGDecContext {
-    PNGDSPContext dsp;
-
-    GetByteContext gb;
-    AVFrame *prev;
-
-    int state;
-    int width, height;
-    int bit_depth;
-    int color_type;
-    int compression_type;
-    int interlace_type;
-    int filter_type;
-    int channels;
-    int bits_per_pixel;
-    int bpp;
-
-    uint8_t *image_buf;
-    int image_linesize;
-    uint32_t palette[256];
-    uint8_t *crow_buf;
-    uint8_t *last_row;
-    uint8_t *tmp_row;
-    int pass;
-    int crow_size; /* compressed row size (include filter type) */
-    int row_size; /* decompressed row size */
-    int pass_row_size; /* decompress row size of the current pass */
-    int y;
-    z_stream zstream;
-} PNGDecContext;
-
-/* Mask to determine which y pixels can be written in a pass */
-static const uint8_t png_pass_dsp_ymask[NB_PASSES] = {
-    0xff, 0xff, 0x0f, 0xcc, 0x33, 0xff, 0x55,
-};
-
-/* Mask to determine which pixels to overwrite while displaying */
-static const uint8_t png_pass_dsp_mask[NB_PASSES] = {
-    0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff
-};
-
-/* NOTE: we try to construct a good looking image at each pass. width
-   is the original image width. We also do pixel format conversion at
-   this stage */
-static void png_put_interlaced_row(uint8_t *dst, int width,
-                                   int bits_per_pixel, int pass,
-                                   int color_type, const uint8_t *src)
-{
-    int x, mask, dsp_mask, j, src_x, b, bpp;
-    uint8_t *d;
-    const uint8_t *s;
-
-    mask     = ff_png_pass_mask[pass];
-    dsp_mask = png_pass_dsp_mask[pass];
-
-    switch (bits_per_pixel) {
-    case 1:
-        /* we must initialize the line to zero before writing to it */
-        if (pass == 0)
-            memset(dst, 0, (width + 7) >> 3);
-        src_x = 0;
-        for (x = 0; x < width; x++) {
-            j = (x & 7);
-            if ((dsp_mask << j) & 0x80) {
-                b = (src[src_x >> 3] >> (7 - (src_x & 7))) & 1;
-                dst[x >> 3] |= b << (7 - j);
-            }
-            if ((mask << j) & 0x80)
-                src_x++;
-        }
-        break;
-    default:
-        bpp = bits_per_pixel >> 3;
-        d   = dst;
-        s   = src;
-        if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
-            for (x = 0; x < width; x++) {
-                j = x & 7;
-                if ((dsp_mask << j) & 0x80) {
-                    *(uint32_t *)d = (s[3] << 24) | (s[0] << 16) | (s[1] << 8) | s[2];
-                }
-                d += bpp;
-                if ((mask << j) & 0x80)
-                    s += bpp;
-            }
-        } else {
-            for(x = 0; x < width; x++) {
-                j = x & 7;
-                if ((dsp_mask << j) & 0x80) {
-                    memcpy(d, s, bpp);
-                }
-                d += bpp;
-                if ((mask << j) & 0x80)
-                    s += bpp;
-            }
-        }
-        break;
-    }
-}
-
-void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp)
-{
-    int i;
-    for (i = 0; i < w; i++) {
-        int a, b, c, p, pa, pb, pc;
-
-        a = dst[i - bpp];
-        b = top[i];
-        c = top[i - bpp];
-
-        p  = b - c;
-        pc = a - c;
-
-        pa = abs(p);
-        pb = abs(pc);
-        pc = abs(p + pc);
-
-        if (pa <= pb && pa <= pc)
-            p = a;
-        else if (pb <= pc)
-            p = b;
-        else
-            p = c;
-        dst[i] = p + src[i];
-    }
-}
-
-#define UNROLL1(bpp, op) {\
-                 r = dst[0];\
-    if(bpp >= 2) g = dst[1];\
-    if(bpp >= 3) b = dst[2];\
-    if(bpp >= 4) a = dst[3];\
-    for(; i < size; i+=bpp) {\
-        dst[i+0] = r = op(r, src[i+0], last[i+0]);\
-        if(bpp == 1) continue;\
-        dst[i+1] = g = op(g, src[i+1], last[i+1]);\
-        if(bpp == 2) continue;\
-        dst[i+2] = b = op(b, src[i+2], last[i+2]);\
-        if(bpp == 3) continue;\
-        dst[i+3] = a = op(a, src[i+3], last[i+3]);\
-    }\
-}
-
-#define UNROLL_FILTER(op)\
-         if(bpp == 1) UNROLL1(1, op)\
-    else if(bpp == 2) UNROLL1(2, op)\
-    else if(bpp == 3) UNROLL1(3, op)\
-    else if(bpp == 4) UNROLL1(4, op)\
-    else {\
-        for (; i < size; i += bpp) {\
-            int j;\
-            for (j = 0; j < bpp; j++)\
-                dst[i+j] = op(dst[i+j-bpp], src[i+j], last[i+j]);\
-        }\
-    }
-
-/* NOTE: 'dst' can be equal to 'last' */
-static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
-                           uint8_t *src, uint8_t *last, int size, int bpp)
-{
-    int i, p, r, g, b, a;
-
-    switch (filter_type) {
-    case PNG_FILTER_VALUE_NONE:
-        memcpy(dst, src, size);
-        break;
-    case PNG_FILTER_VALUE_SUB:
-        for (i = 0; i < bpp; i++) {
-            dst[i] = src[i];
-        }
-        if (bpp == 4) {
-            p = *(int*)dst;
-            for (; i < size; i += bpp) {
-                int s = *(int*)(src + i);
-                p = ((s & 0x7f7f7f7f) + (p & 0x7f7f7f7f)) ^ ((s ^ p) & 0x80808080);
-                *(int*)(dst + i) = p;
-            }
-        } else {
-#define OP_SUB(x,s,l) x+s
-            UNROLL_FILTER(OP_SUB);
-        }
-        break;
-    case PNG_FILTER_VALUE_UP:
-        dsp->add_bytes_l2(dst, src, last, size);
-        break;
-    case PNG_FILTER_VALUE_AVG:
-        for (i = 0; i < bpp; i++) {
-            p = (last[i] >> 1);
-            dst[i] = p + src[i];
-        }
-#define OP_AVG(x,s,l) (((x + l) >> 1) + s) & 0xff
-        UNROLL_FILTER(OP_AVG);
-        break;
-    case PNG_FILTER_VALUE_PAETH:
-        for (i = 0; i < bpp; i++) {
-            p = last[i];
-            dst[i] = p + src[i];
-        }
-        if (bpp > 1 && size > 4) {
-            // would write off the end of the array if we let it process the last pixel with bpp=3
-            int w = bpp == 4 ? size : size - 3;
-            dsp->add_paeth_prediction(dst + i, src + i, last + i, w - i, bpp);
-            i = w;
-        }
-        ff_add_png_paeth_prediction(dst + i, src + i, last + i, size - i, bpp);
-        break;
-    }
-}
-
-static av_always_inline void convert_to_rgb32_loco(uint8_t *dst,
-                                                   const uint8_t *src,
-                                                   int width, int loco)
-{
-    int j;
-    unsigned int r, g, b, a;
-
-    for (j = 0; j < width; j++) {
-        r = src[0];
-        g = src[1];
-        b = src[2];
-        a = src[3];
-        if (loco) {
-            r = (r + g) & 0xff;
-            b = (b + g) & 0xff;
-        }
-        *(uint32_t *)dst = (a << 24) | (r << 16) | (g << 8) | b;
-        dst += 4;
-        src += 4;
-    }
-}
-
-static void convert_to_rgb32(uint8_t *dst, const uint8_t *src, int width, int loco)
-{
-    if (loco)
-        convert_to_rgb32_loco(dst, src, width, 1);
-    else
-        convert_to_rgb32_loco(dst, src, width, 0);
-}
-
-static void deloco_rgb24(uint8_t *dst, int size)
-{
-    int i;
-    for (i = 0; i < size; i += 3) {
-        int g = dst[i + 1];
-        dst[i + 0] += g;
-        dst[i + 2] += g;
-    }
-}
-
-/* process exactly one decompressed row */
-static void png_handle_row(PNGDecContext *s)
-{
-    uint8_t *ptr, *last_row;
-    int got_line;
-
-    if (!s->interlace_type) {
-        ptr = s->image_buf + s->image_linesize * s->y;
-        /* need to swap bytes correctly for RGB_ALPHA */
-        if (s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
-            png_filter_row(&s->dsp, s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
-                           s->last_row, s->row_size, s->bpp);
-            convert_to_rgb32(ptr, s->tmp_row, s->width, s->filter_type == PNG_FILTER_TYPE_LOCO);
-            FFSWAP(uint8_t*, s->last_row, s->tmp_row);
-        } else {
-            /* in normal case, we avoid one copy */
-            if (s->y == 0)
-                last_row = s->last_row;
-            else
-                last_row = ptr - s->image_linesize;
-
-            png_filter_row(&s->dsp, ptr, s->crow_buf[0], s->crow_buf + 1,
-                           last_row, s->row_size, s->bpp);
-        }
-        /* loco lags by 1 row so that it doesn't interfere with top prediction */
-        if (s->filter_type == PNG_FILTER_TYPE_LOCO &&
-            s->color_type == PNG_COLOR_TYPE_RGB && s->y > 0)
-            deloco_rgb24(ptr - s->image_linesize, s->row_size);
-        s->y++;
-        if (s->y == s->height) {
-            s->state |= PNG_ALLIMAGE;
-            if (s->filter_type == PNG_FILTER_TYPE_LOCO &&
-                s->color_type == PNG_COLOR_TYPE_RGB)
-                deloco_rgb24(ptr, s->row_size);
-        }
-    } else {
-        got_line = 0;
-        for (;;) {
-            ptr = s->image_buf + s->image_linesize * s->y;
-            if ((ff_png_pass_ymask[s->pass] << (s->y & 7)) & 0x80) {
-                /* if we already read one row, it is time to stop to
-                   wait for the next one */
-                if (got_line)
-                    break;
-                png_filter_row(&s->dsp, s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
-                               s->last_row, s->pass_row_size, s->bpp);
-                FFSWAP(uint8_t*, s->last_row, s->tmp_row);
-                got_line = 1;
-            }
-            if ((png_pass_dsp_ymask[s->pass] << (s->y & 7)) & 0x80) {
-                /* NOTE: RGB32 is handled directly in png_put_interlaced_row */
-                png_put_interlaced_row(ptr, s->width, s->bits_per_pixel, s->pass,
-                                       s->color_type, s->last_row);
-            }
-            s->y++;
-            if (s->y == s->height) {
-                for (;;) {
-                    if (s->pass == NB_PASSES - 1) {
-                        s->state |= PNG_ALLIMAGE;
-                        goto the_end;
-                    } else {
-                        s->pass++;
-                        s->y = 0;
-                        s->pass_row_size = ff_png_pass_row_size(s->pass,
-                                                             s->bits_per_pixel,
-                                                             s->width);
-                        s->crow_size = s->pass_row_size + 1;
-                        if (s->pass_row_size != 0)
-                            break;
-                        /* skip pass if empty row */
-                    }
-                }
-            }
-        }
-    the_end: ;
-    }
-}
-
-static int png_decode_idat(PNGDecContext *s, int length)
-{
-    int ret;
-    s->zstream.avail_in = FFMIN(length, bytestream2_get_bytes_left(&s->gb));
-    s->zstream.next_in  = s->gb.buffer;
-    bytestream2_skip(&s->gb, length);
-
-    /* decode one line if possible */
-    while (s->zstream.avail_in > 0) {
-        ret = inflate(&s->zstream, Z_PARTIAL_FLUSH);
-        if (ret != Z_OK && ret != Z_STREAM_END) {
-            return -1;
-        }
-        if (s->zstream.avail_out == 0) {
-            if (!(s->state & PNG_ALLIMAGE)) {
-                png_handle_row(s);
-            }
-            s->zstream.avail_out = s->crow_size;
-            s->zstream.next_out  = s->crow_buf;
-        }
-        if (ret == Z_STREAM_END && s->zstream.avail_in > 0) {
-            av_log(NULL, AV_LOG_WARNING, "%d undecompressed bytes left in buffer\n", s->zstream.avail_in);
-            return 0;
-        }
-    }
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    PNGDecContext * const s = avctx->priv_data;
-    const uint8_t *buf      = avpkt->data;
-    int buf_size            = avpkt->size;
-    AVFrame *p              = data;
-    uint8_t *crow_buf_base  = NULL;
-    uint32_t tag, length;
-    int ret;
-
-    /* check signature */
-    if (buf_size < 8 ||
-        memcmp(buf, ff_pngsig, 8) != 0 &&
-        memcmp(buf, ff_mngsig, 8) != 0)
-        return -1;
-
-    bytestream2_init(&s->gb, buf + 8, buf_size - 8);
-    s->y = s->state = 0;
-
-    /* init the zlib */
-    s->zstream.zalloc = ff_png_zalloc;
-    s->zstream.zfree  = ff_png_zfree;
-    s->zstream.opaque = NULL;
-    ret = inflateInit(&s->zstream);
-    if (ret != Z_OK)
-        return -1;
-    for (;;) {
-        if (bytestream2_get_bytes_left(&s->gb) <= 0)
-            goto fail;
-        length = bytestream2_get_be32(&s->gb);
-        if (length > 0x7fffffff)
-            goto fail;
-        tag = bytestream2_get_le32(&s->gb);
-        av_dlog(avctx, "png: tag=%c%c%c%c length=%u\n",
-                (tag & 0xff),
-                ((tag >> 8) & 0xff),
-                ((tag >> 16) & 0xff),
-                ((tag >> 24) & 0xff), length);
-        switch (tag) {
-        case MKTAG('I', 'H', 'D', 'R'):
-            if (length != 13)
-                goto fail;
-            s->width  = bytestream2_get_be32(&s->gb);
-            s->height = bytestream2_get_be32(&s->gb);
-            if (av_image_check_size(s->width, s->height, 0, avctx)) {
-                s->width = s->height = 0;
-                goto fail;
-            }
-            s->bit_depth        = bytestream2_get_byte(&s->gb);
-            s->color_type       = bytestream2_get_byte(&s->gb);
-            s->compression_type = bytestream2_get_byte(&s->gb);
-            s->filter_type      = bytestream2_get_byte(&s->gb);
-            s->interlace_type   = bytestream2_get_byte(&s->gb);
-            bytestream2_skip(&s->gb, 4); /* crc */
-            s->state |= PNG_IHDR;
-            av_dlog(avctx, "width=%d height=%d depth=%d color_type=%d "
-                    "compression_type=%d filter_type=%d interlace_type=%d\n",
-                    s->width, s->height, s->bit_depth, s->color_type,
-                    s->compression_type, s->filter_type, s->interlace_type);
-            break;
-        case MKTAG('I', 'D', 'A', 'T'):
-            if (!(s->state & PNG_IHDR))
-                goto fail;
-            if (!(s->state & PNG_IDAT)) {
-                /* init image info */
-                avctx->width  = s->width;
-                avctx->height = s->height;
-
-                s->channels       = ff_png_get_nb_channels(s->color_type);
-                s->bits_per_pixel = s->bit_depth * s->channels;
-                s->bpp            = (s->bits_per_pixel + 7) >> 3;
-                s->row_size       = (avctx->width * s->bits_per_pixel + 7) >> 3;
-
-                if (s->bit_depth == 8 &&
-                    s->color_type == PNG_COLOR_TYPE_RGB) {
-                    avctx->pix_fmt = AV_PIX_FMT_RGB24;
-                } else if (s->bit_depth == 8 &&
-                           s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
-                    avctx->pix_fmt = AV_PIX_FMT_RGB32;
-                } else if (s->bit_depth == 8 &&
-                           s->color_type == PNG_COLOR_TYPE_GRAY) {
-                    avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-                } else if (s->bit_depth == 16 &&
-                           s->color_type == PNG_COLOR_TYPE_GRAY) {
-                    avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;
-                } else if (s->bit_depth == 16 &&
-                           s->color_type == PNG_COLOR_TYPE_RGB) {
-                    avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
-                } else if (s->bit_depth == 1 &&
-                           s->color_type == PNG_COLOR_TYPE_GRAY) {
-                    avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
-                } else if (s->bit_depth == 8 &&
-                           s->color_type == PNG_COLOR_TYPE_PALETTE) {
-                    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-                } else if (s->bit_depth == 8 &&
-                           s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
-                    avctx->pix_fmt = AV_PIX_FMT_Y400A;
-                } else {
-                    goto fail;
-                }
-
-                if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0) {
-                    av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                    goto fail;
-                }
-                p->pict_type        = AV_PICTURE_TYPE_I;
-                p->key_frame        = 1;
-                p->interlaced_frame = !!s->interlace_type;
-
-                /* compute the compressed row size */
-                if (!s->interlace_type) {
-                    s->crow_size = s->row_size + 1;
-                } else {
-                    s->pass = 0;
-                    s->pass_row_size = ff_png_pass_row_size(s->pass,
-                                                         s->bits_per_pixel,
-                                                         s->width);
-                    s->crow_size = s->pass_row_size + 1;
-                }
-                av_dlog(avctx, "row_size=%d crow_size =%d\n",
-                        s->row_size, s->crow_size);
-                s->image_buf      = p->data[0];
-                s->image_linesize = p->linesize[0];
-                /* copy the palette if needed */
-                if (s->color_type == PNG_COLOR_TYPE_PALETTE)
-                    memcpy(p->data[1], s->palette, 256 * sizeof(uint32_t));
-                /* empty row is used if differencing to the first row */
-                s->last_row = av_mallocz(s->row_size);
-                if (!s->last_row)
-                    goto fail;
-                if (s->interlace_type ||
-                    s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
-                    s->tmp_row = av_malloc(s->row_size);
-                    if (!s->tmp_row)
-                        goto fail;
-                }
-                /* compressed row */
-                crow_buf_base = av_malloc(s->row_size + 16);
-                if (!crow_buf_base)
-                    goto fail;
-
-                /* we want crow_buf+1 to be 16-byte aligned */
-                s->crow_buf          = crow_buf_base + 15;
-                s->zstream.avail_out = s->crow_size;
-                s->zstream.next_out  = s->crow_buf;
-            }
-            s->state |= PNG_IDAT;
-            if (png_decode_idat(s, length) < 0)
-                goto fail;
-            bytestream2_skip(&s->gb, 4); /* crc */
-            break;
-        case MKTAG('P', 'L', 'T', 'E'):
-            {
-                int n, i, r, g, b;
-
-                if ((length % 3) != 0 || length > 256 * 3)
-                    goto skip_tag;
-                /* read the palette */
-                n = length / 3;
-                for (i = 0; i < n; i++) {
-                    r = bytestream2_get_byte(&s->gb);
-                    g = bytestream2_get_byte(&s->gb);
-                    b = bytestream2_get_byte(&s->gb);
-                    s->palette[i] = (0xff << 24) | (r << 16) | (g << 8) | b;
-                }
-                for (; i < 256; i++) {
-                    s->palette[i] = (0xff << 24);
-                }
-                s->state |= PNG_PLTE;
-                bytestream2_skip(&s->gb, 4); /* crc */
-            }
-            break;
-        case MKTAG('t', 'R', 'N', 'S'):
-            {
-                int v, i;
-
-                /* read the transparency. XXX: Only palette mode supported */
-                if (s->color_type != PNG_COLOR_TYPE_PALETTE ||
-                    length > 256 ||
-                    !(s->state & PNG_PLTE))
-                    goto skip_tag;
-                for (i = 0; i < length; i++) {
-                    v = bytestream2_get_byte(&s->gb);
-                    s->palette[i] = (s->palette[i] & 0x00ffffff) | (v << 24);
-                }
-                bytestream2_skip(&s->gb, 4); /* crc */
-            }
-            break;
-        case MKTAG('I', 'E', 'N', 'D'):
-            if (!(s->state & PNG_ALLIMAGE))
-                goto fail;
-            bytestream2_skip(&s->gb, 4); /* crc */
-            goto exit_loop;
-        default:
-            /* skip tag */
-        skip_tag:
-            bytestream2_skip(&s->gb, length + 4);
-            break;
-        }
-    }
- exit_loop:
-     /* handle p-frames only if a predecessor frame is available */
-     if (s->prev->data[0]) {
-         if (!(avpkt->flags & AV_PKT_FLAG_KEY)) {
-            int i, j;
-            uint8_t *pd      = p->data[0];
-            uint8_t *pd_last = s->prev->data[0];
-
-            for (j = 0; j < s->height; j++) {
-                for (i = 0; i < s->width * s->bpp; i++) {
-                    pd[i] += pd_last[i];
-                }
-                pd      += s->image_linesize;
-                pd_last += s->image_linesize;
-            }
-        }
-    }
-
-     av_frame_unref(s->prev);
-     if ((ret = av_frame_ref(s->prev, p)) < 0)
-         goto fail;
-
-    *got_frame = 1;
-
-    ret = bytestream2_tell(&s->gb);
- the_end:
-    inflateEnd(&s->zstream);
-    av_free(crow_buf_base);
-    s->crow_buf = NULL;
-    av_freep(&s->last_row);
-    av_freep(&s->tmp_row);
-    return ret;
- fail:
-    ret = -1;
-    goto the_end;
-}
-
-static av_cold int png_dec_init(AVCodecContext *avctx)
-{
-    PNGDecContext *s = avctx->priv_data;
-
-    s->prev = av_frame_alloc();
-    if (!s->prev)
-        return AVERROR(ENOMEM);
-
-    ff_pngdsp_init(&s->dsp);
-
-    return 0;
-}
-
-static av_cold int png_dec_end(AVCodecContext *avctx)
-{
-    PNGDecContext *s = avctx->priv_data;
-
-    av_frame_free(&s->prev);
-
-    return 0;
-}
-
-AVCodec ff_png_decoder = {
-    .name           = "png",
-    .long_name      = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PNG,
-    .priv_data_size = sizeof(PNGDecContext),
-    .init           = png_dec_init,
-    .close          = png_dec_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
-};
diff --git a/deps/libav/libavcodec/pngdsp.c b/deps/libav/libavcodec/pngdsp.c
deleted file mode 100644
index 5cc41c4..0000000
--- a/deps/libav/libavcodec/pngdsp.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * PNG image format
- * Copyright (c) 2008 Loren Merrit <lorenm at u.washington.edu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "png.h"
-#include "pngdsp.h"
-
-// 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size
-#define pb_7f (~0UL/255 * 0x7f)
-#define pb_80 (~0UL/255 * 0x80)
-
-static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w)
-{
-    long i;
-    for (i = 0; i <= w - (int)sizeof(long); i += sizeof(long)) {
-        long a = *(long *)(src1 + i);
-        long b = *(long *)(src2 + i);
-        *(long *)(dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);
-    }
-    for (; i < w; i++)
-        dst[i] = src1[i] + src2[i];
-}
-
-av_cold void ff_pngdsp_init(PNGDSPContext *dsp)
-{
-    dsp->add_bytes_l2         = add_bytes_l2_c;
-    dsp->add_paeth_prediction = ff_add_png_paeth_prediction;
-
-    if (ARCH_X86) ff_pngdsp_init_x86(dsp);
-}
diff --git a/deps/libav/libavcodec/pngdsp.h b/deps/libav/libavcodec/pngdsp.h
deleted file mode 100644
index 98d29a8..0000000
--- a/deps/libav/libavcodec/pngdsp.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * PNG image format
- * Copyright (c) 2008 Loren Merrit <lorenm at u.washington.edu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PNGDSP_H
-#define AVCODEC_PNGDSP_H
-
-#include <stdint.h>
-
-typedef struct PNGDSPContext {
-    void (*add_bytes_l2)(uint8_t *dst  /* align 16 */,
-                         uint8_t *src1 /* align 16 */,
-                         uint8_t *src2 /* align 16 */, int w);
-
-    /* this might write to dst[w] */
-    void (*add_paeth_prediction)(uint8_t *dst, uint8_t *src,
-                                 uint8_t *top, int w, int bpp);
-} PNGDSPContext;
-
-void ff_pngdsp_init(PNGDSPContext *dsp);
-void ff_pngdsp_init_x86(PNGDSPContext *dsp);
-
-#endif /* AVCDODEC_PNGDSP_H */
diff --git a/deps/libav/libavcodec/pngenc.c b/deps/libav/libavcodec/pngenc.c
deleted file mode 100644
index f58f715..0000000
--- a/deps/libav/libavcodec/pngenc.c
+++ /dev/null
@@ -1,478 +0,0 @@
-/*
- * PNG image format
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "bytestream.h"
-#include "dsputil.h"
-#include "png.h"
-
-/* TODO:
- * - add 2, 4 and 16 bit depth support
- */
-
-#include <zlib.h>
-
-#define IOBUF_SIZE 4096
-
-typedef struct PNGEncContext {
-    DSPContext dsp;
-
-    uint8_t *bytestream;
-    uint8_t *bytestream_start;
-    uint8_t *bytestream_end;
-
-    int filter_type;
-
-    z_stream zstream;
-    uint8_t buf[IOBUF_SIZE];
-} PNGEncContext;
-
-static void png_get_interlaced_row(uint8_t *dst, int row_size,
-                                   int bits_per_pixel, int pass,
-                                   const uint8_t *src, int width)
-{
-    int x, mask, dst_x, j, b, bpp;
-    uint8_t *d;
-    const uint8_t *s;
-
-    mask = ff_png_pass_mask[pass];
-    switch(bits_per_pixel) {
-    case 1:
-        memset(dst, 0, row_size);
-        dst_x = 0;
-        for(x = 0; x < width; x++) {
-            j = (x & 7);
-            if ((mask << j) & 0x80) {
-                b = (src[x >> 3] >> (7 - j)) & 1;
-                dst[dst_x >> 3] |= b << (7 - (dst_x & 7));
-                dst_x++;
-            }
-        }
-        break;
-    default:
-        bpp = bits_per_pixel >> 3;
-        d = dst;
-        s = src;
-        for(x = 0; x < width; x++) {
-            j = x & 7;
-            if ((mask << j) & 0x80) {
-                memcpy(d, s, bpp);
-                d += bpp;
-            }
-            s += bpp;
-        }
-        break;
-    }
-}
-
-static void sub_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp)
-{
-    int i;
-    for(i = 0; i < w; i++) {
-        int a, b, c, p, pa, pb, pc;
-
-        a = src[i - bpp];
-        b = top[i];
-        c = top[i - bpp];
-
-        p = b - c;
-        pc = a - c;
-
-        pa = abs(p);
-        pb = abs(pc);
-        pc = abs(p + pc);
-
-        if (pa <= pb && pa <= pc)
-            p = a;
-        else if (pb <= pc)
-            p = b;
-        else
-            p = c;
-        dst[i] = src[i] - p;
-    }
-}
-
-static void png_filter_row(DSPContext *dsp, uint8_t *dst, int filter_type,
-                           uint8_t *src, uint8_t *top, int size, int bpp)
-{
-    int i;
-
-    switch(filter_type) {
-    case PNG_FILTER_VALUE_NONE:
-        memcpy(dst, src, size);
-        break;
-    case PNG_FILTER_VALUE_SUB:
-        dsp->diff_bytes(dst, src, src-bpp, size);
-        memcpy(dst, src, bpp);
-        break;
-    case PNG_FILTER_VALUE_UP:
-        dsp->diff_bytes(dst, src, top, size);
-        break;
-    case PNG_FILTER_VALUE_AVG:
-        for(i = 0; i < bpp; i++)
-            dst[i] = src[i] - (top[i] >> 1);
-        for(; i < size; i++)
-            dst[i] = src[i] - ((src[i-bpp] + top[i]) >> 1);
-        break;
-    case PNG_FILTER_VALUE_PAETH:
-        for(i = 0; i < bpp; i++)
-            dst[i] = src[i] - top[i];
-        sub_png_paeth_prediction(dst+i, src+i, top+i, size-i, bpp);
-        break;
-    }
-}
-
-static uint8_t *png_choose_filter(PNGEncContext *s, uint8_t *dst,
-                                  uint8_t *src, uint8_t *top, int size, int bpp)
-{
-    int pred = s->filter_type;
-    assert(bpp || !pred);
-    if(!top && pred)
-        pred = PNG_FILTER_VALUE_SUB;
-    if(pred == PNG_FILTER_VALUE_MIXED) {
-        int i;
-        int cost, bcost = INT_MAX;
-        uint8_t *buf1 = dst, *buf2 = dst + size + 16;
-        for(pred=0; pred<5; pred++) {
-            png_filter_row(&s->dsp, buf1+1, pred, src, top, size, bpp);
-            buf1[0] = pred;
-            cost = 0;
-            for(i=0; i<=size; i++)
-                cost += abs((int8_t)buf1[i]);
-            if(cost < bcost) {
-                bcost = cost;
-                FFSWAP(uint8_t*, buf1, buf2);
-            }
-        }
-        return buf2;
-    } else {
-        png_filter_row(&s->dsp, dst+1, pred, src, top, size, bpp);
-        dst[0] = pred;
-        return dst;
-    }
-}
-
-static void convert_from_rgb32(uint8_t *dst, const uint8_t *src, int width)
-{
-    uint8_t *d;
-    int j;
-    unsigned int v;
-
-    d = dst;
-    for(j = 0; j < width; j++) {
-        v = ((const uint32_t *)src)[j];
-        d[0] = v >> 16;
-        d[1] = v >> 8;
-        d[2] = v;
-        d[3] = v >> 24;
-        d += 4;
-    }
-}
-
-static void png_write_chunk(uint8_t **f, uint32_t tag,
-                            const uint8_t *buf, int length)
-{
-    uint32_t crc;
-    uint8_t tagbuf[4];
-
-    bytestream_put_be32(f, length);
-    crc = crc32(0, Z_NULL, 0);
-    AV_WL32(tagbuf, tag);
-    crc = crc32(crc, tagbuf, 4);
-    bytestream_put_be32(f, av_bswap32(tag));
-    if (length > 0) {
-        crc = crc32(crc, buf, length);
-        memcpy(*f, buf, length);
-        *f += length;
-    }
-    bytestream_put_be32(f, crc);
-}
-
-/* XXX: do filtering */
-static int png_write_row(PNGEncContext *s, const uint8_t *data, int size)
-{
-    int ret;
-
-    s->zstream.avail_in = size;
-    s->zstream.next_in = (uint8_t *)data;
-    while (s->zstream.avail_in > 0) {
-        ret = deflate(&s->zstream, Z_NO_FLUSH);
-        if (ret != Z_OK)
-            return -1;
-        if (s->zstream.avail_out == 0) {
-            if(s->bytestream_end - s->bytestream > IOBUF_SIZE + 100)
-                png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), s->buf, IOBUF_SIZE);
-            s->zstream.avail_out = IOBUF_SIZE;
-            s->zstream.next_out = s->buf;
-        }
-    }
-    return 0;
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *pict, int *got_packet)
-{
-    PNGEncContext *s = avctx->priv_data;
-    const AVFrame * const p = pict;
-    int bit_depth, color_type, y, len, row_size, ret, is_progressive;
-    int bits_per_pixel, pass_row_size, enc_row_size, max_packet_size;
-    int compression_level;
-    uint8_t *ptr, *top;
-    uint8_t *crow_base = NULL, *crow_buf, *crow;
-    uint8_t *progressive_buf = NULL;
-    uint8_t *rgba_buf = NULL;
-    uint8_t *top_buf = NULL;
-
-    is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
-    switch(avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB32:
-        bit_depth = 8;
-        color_type = PNG_COLOR_TYPE_RGB_ALPHA;
-        break;
-    case AV_PIX_FMT_RGB24:
-        bit_depth = 8;
-        color_type = PNG_COLOR_TYPE_RGB;
-        break;
-    case AV_PIX_FMT_GRAY16BE:
-        bit_depth = 16;
-        color_type = PNG_COLOR_TYPE_GRAY;
-        break;
-    case AV_PIX_FMT_GRAY8:
-        bit_depth = 8;
-        color_type = PNG_COLOR_TYPE_GRAY;
-        break;
-    case AV_PIX_FMT_MONOBLACK:
-        bit_depth = 1;
-        color_type = PNG_COLOR_TYPE_GRAY;
-        break;
-    case AV_PIX_FMT_PAL8:
-        bit_depth = 8;
-        color_type = PNG_COLOR_TYPE_PALETTE;
-        break;
-    default:
-        return -1;
-    }
-    bits_per_pixel = ff_png_get_nb_channels(color_type) * bit_depth;
-    row_size = (avctx->width * bits_per_pixel + 7) >> 3;
-
-    s->zstream.zalloc = ff_png_zalloc;
-    s->zstream.zfree = ff_png_zfree;
-    s->zstream.opaque = NULL;
-    compression_level = avctx->compression_level == FF_COMPRESSION_DEFAULT ?
-                            Z_DEFAULT_COMPRESSION :
-                            av_clip(avctx->compression_level, 0, 9);
-    ret = deflateInit2(&s->zstream, compression_level,
-                       Z_DEFLATED, 15, 8, Z_DEFAULT_STRATEGY);
-    if (ret != Z_OK)
-        return -1;
-
-    enc_row_size    = deflateBound(&s->zstream, row_size);
-    max_packet_size = avctx->height * (enc_row_size +
-                                       ((enc_row_size + IOBUF_SIZE - 1) / IOBUF_SIZE) * 12)
-                      + FF_MIN_BUFFER_SIZE;
-    if (!pkt->data &&
-        (ret = av_new_packet(pkt, max_packet_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate output packet of size %d.\n",
-               max_packet_size);
-        return ret;
-    }
-
-    s->bytestream_start =
-    s->bytestream       = pkt->data;
-    s->bytestream_end   = pkt->data + pkt->size;
-
-    crow_base = av_malloc((row_size + 32) << (s->filter_type == PNG_FILTER_VALUE_MIXED));
-    if (!crow_base)
-        goto fail;
-    crow_buf = crow_base + 15; // pixel data should be aligned, but there's a control byte before it
-    if (is_progressive) {
-        progressive_buf = av_malloc(row_size + 1);
-        if (!progressive_buf)
-            goto fail;
-    }
-    if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
-        rgba_buf = av_malloc(row_size + 1);
-        if (!rgba_buf)
-            goto fail;
-    }
-    if (is_progressive || color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
-        top_buf = av_malloc(row_size + 1);
-        if (!top_buf)
-            goto fail;
-    }
-
-    /* write png header */
-    memcpy(s->bytestream, ff_pngsig, 8);
-    s->bytestream += 8;
-
-    AV_WB32(s->buf, avctx->width);
-    AV_WB32(s->buf + 4, avctx->height);
-    s->buf[8] = bit_depth;
-    s->buf[9] = color_type;
-    s->buf[10] = 0; /* compression type */
-    s->buf[11] = 0; /* filter type */
-    s->buf[12] = is_progressive; /* interlace type */
-
-    png_write_chunk(&s->bytestream, MKTAG('I', 'H', 'D', 'R'), s->buf, 13);
-
-    /* put the palette if needed */
-    if (color_type == PNG_COLOR_TYPE_PALETTE) {
-        int has_alpha, alpha, i;
-        unsigned int v;
-        uint32_t *palette;
-        uint8_t *alpha_ptr;
-
-        palette = (uint32_t *)p->data[1];
-        ptr = s->buf;
-        alpha_ptr = s->buf + 256 * 3;
-        has_alpha = 0;
-        for(i = 0; i < 256; i++) {
-            v = palette[i];
-            alpha = v >> 24;
-            if (alpha && alpha != 0xff)
-                has_alpha = 1;
-            *alpha_ptr++ = alpha;
-            bytestream_put_be24(&ptr, v);
-        }
-        png_write_chunk(&s->bytestream, MKTAG('P', 'L', 'T', 'E'), s->buf, 256 * 3);
-        if (has_alpha) {
-            png_write_chunk(&s->bytestream, MKTAG('t', 'R', 'N', 'S'), s->buf + 256 * 3, 256);
-        }
-    }
-
-    /* now put each row */
-    s->zstream.avail_out = IOBUF_SIZE;
-    s->zstream.next_out = s->buf;
-    if (is_progressive) {
-        int pass;
-
-        for(pass = 0; pass < NB_PASSES; pass++) {
-            /* NOTE: a pass is completely omitted if no pixels would be
-               output */
-            pass_row_size = ff_png_pass_row_size(pass, bits_per_pixel, avctx->width);
-            if (pass_row_size > 0) {
-                top = NULL;
-                for(y = 0; y < avctx->height; y++) {
-                    if ((ff_png_pass_ymask[pass] << (y & 7)) & 0x80) {
-                        ptr = p->data[0] + y * p->linesize[0];
-                        FFSWAP(uint8_t*, progressive_buf, top_buf);
-                        if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
-                            convert_from_rgb32(rgba_buf, ptr, avctx->width);
-                            ptr = rgba_buf;
-                        }
-                        png_get_interlaced_row(progressive_buf, pass_row_size,
-                                               bits_per_pixel, pass,
-                                               ptr, avctx->width);
-                        crow = png_choose_filter(s, crow_buf, progressive_buf, top, pass_row_size, bits_per_pixel>>3);
-                        png_write_row(s, crow, pass_row_size + 1);
-                        top = progressive_buf;
-                    }
-                }
-            }
-        }
-    } else {
-        top = NULL;
-        for(y = 0; y < avctx->height; y++) {
-            ptr = p->data[0] + y * p->linesize[0];
-            if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
-                FFSWAP(uint8_t*, rgba_buf, top_buf);
-                convert_from_rgb32(rgba_buf, ptr, avctx->width);
-                ptr = rgba_buf;
-            }
-            crow = png_choose_filter(s, crow_buf, ptr, top, row_size, bits_per_pixel>>3);
-            png_write_row(s, crow, row_size + 1);
-            top = ptr;
-        }
-    }
-    /* compress last bytes */
-    for(;;) {
-        ret = deflate(&s->zstream, Z_FINISH);
-        if (ret == Z_OK || ret == Z_STREAM_END) {
-            len = IOBUF_SIZE - s->zstream.avail_out;
-            if (len > 0 && s->bytestream_end - s->bytestream > len + 100) {
-                png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), s->buf, len);
-            }
-            s->zstream.avail_out = IOBUF_SIZE;
-            s->zstream.next_out = s->buf;
-            if (ret == Z_STREAM_END)
-                break;
-        } else {
-            goto fail;
-        }
-    }
-    png_write_chunk(&s->bytestream, MKTAG('I', 'E', 'N', 'D'), NULL, 0);
-
-    pkt->size   = s->bytestream - s->bytestream_start;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    ret         = 0;
-
- the_end:
-    av_free(crow_base);
-    av_free(progressive_buf);
-    av_free(rgba_buf);
-    av_free(top_buf);
-    deflateEnd(&s->zstream);
-    return ret;
- fail:
-    ret = -1;
-    goto the_end;
-}
-
-static av_cold int png_enc_init(AVCodecContext *avctx){
-    PNGEncContext *s = avctx->priv_data;
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    ff_dsputil_init(&s->dsp, avctx);
-
-    s->filter_type = av_clip(avctx->prediction_method, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED);
-    if(avctx->pix_fmt == AV_PIX_FMT_MONOBLACK)
-        s->filter_type = PNG_FILTER_VALUE_NONE;
-
-    return 0;
-}
-
-static av_cold int png_enc_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-AVCodec ff_png_encoder = {
-    .name           = "png",
-    .long_name      = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PNG,
-    .priv_data_size = sizeof(PNGEncContext),
-    .init           = png_enc_init,
-    .close          = png_enc_close,
-    .encode2        = encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_GRAY16BE,
-        AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/pnm.c b/deps/libav/libavcodec/pnm.c
deleted file mode 100644
index 1c380b0..0000000
--- a/deps/libav/libavcodec/pnm.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * PNM image format
- * Copyright (c) 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "pnm.h"
-
-static inline int pnm_space(int c)
-{
-    return c == ' ' || c == '\n' || c == '\r' || c == '\t';
-}
-
-static void pnm_get(PNMContext *sc, char *str, int buf_size)
-{
-    char *s;
-    int c;
-
-    /* skip spaces and comments */
-    for (;;) {
-        c = *sc->bytestream++;
-        if (c == '#')  {
-            do {
-                c = *sc->bytestream++;
-            } while (c != '\n' && sc->bytestream < sc->bytestream_end);
-        } else if (!pnm_space(c)) {
-            break;
-        }
-    }
-
-    s = str;
-    while (sc->bytestream < sc->bytestream_end && !pnm_space(c)) {
-        if ((s - str)  < buf_size - 1)
-            *s++ = c;
-        c = *sc->bytestream++;
-    }
-    *s = '\0';
-}
-
-int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
-{
-    char buf1[32], tuple_type[32];
-    int h, w, depth, maxval;
-
-    pnm_get(s, buf1, sizeof(buf1));
-    s->type= buf1[1]-'0';
-    if(buf1[0] != 'P')
-        return AVERROR_INVALIDDATA;
-
-    if (s->type==1 || s->type==4) {
-        avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
-    } else if (s->type==2 || s->type==5) {
-        if (avctx->codec_id == AV_CODEC_ID_PGMYUV)
-            avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-        else
-            avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-    } else if (s->type==3 || s->type==6) {
-        avctx->pix_fmt = AV_PIX_FMT_RGB24;
-    } else if (s->type==7) {
-        w      = -1;
-        h      = -1;
-        maxval = -1;
-        depth  = -1;
-        tuple_type[0] = '\0';
-        for (;;) {
-            pnm_get(s, buf1, sizeof(buf1));
-            if (!strcmp(buf1, "WIDTH")) {
-                pnm_get(s, buf1, sizeof(buf1));
-                w = strtol(buf1, NULL, 10);
-            } else if (!strcmp(buf1, "HEIGHT")) {
-                pnm_get(s, buf1, sizeof(buf1));
-                h = strtol(buf1, NULL, 10);
-            } else if (!strcmp(buf1, "DEPTH")) {
-                pnm_get(s, buf1, sizeof(buf1));
-                depth = strtol(buf1, NULL, 10);
-            } else if (!strcmp(buf1, "MAXVAL")) {
-                pnm_get(s, buf1, sizeof(buf1));
-                maxval = strtol(buf1, NULL, 10);
-            } else if (!strcmp(buf1, "TUPLTYPE") ||
-                       /* libavcodec used to write invalid files */
-                       !strcmp(buf1, "TUPLETYPE")) {
-                pnm_get(s, tuple_type, sizeof(tuple_type));
-            } else if (!strcmp(buf1, "ENDHDR")) {
-                break;
-            } else {
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        /* check that all tags are present */
-        if (w <= 0 || h <= 0 || maxval <= 0 || depth <= 0 || tuple_type[0] == '\0' || av_image_check_size(w, h, 0, avctx))
-            return AVERROR_INVALIDDATA;
-
-        avctx->width  = w;
-        avctx->height = h;
-        if (depth == 1) {
-            if (maxval == 1)
-                avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
-            else
-                avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-        } else if (depth == 3) {
-            if (maxval < 256) {
-            avctx->pix_fmt = AV_PIX_FMT_RGB24;
-            } else {
-                av_log(avctx, AV_LOG_ERROR, "16-bit components are only supported for grayscale\n");
-                avctx->pix_fmt = AV_PIX_FMT_NONE;
-                return AVERROR_INVALIDDATA;
-            }
-        } else if (depth == 4) {
-            avctx->pix_fmt = AV_PIX_FMT_RGB32;
-        } else {
-            return AVERROR_INVALIDDATA;
-        }
-        return 0;
-    } else {
-        return AVERROR_INVALIDDATA;
-    }
-    pnm_get(s, buf1, sizeof(buf1));
-    avctx->width = atoi(buf1);
-    if (avctx->width <= 0)
-        return AVERROR_INVALIDDATA;
-    pnm_get(s, buf1, sizeof(buf1));
-    avctx->height = atoi(buf1);
-    if(av_image_check_size(avctx->width, avctx->height, 0, avctx))
-        return AVERROR_INVALIDDATA;
-    if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE) {
-        pnm_get(s, buf1, sizeof(buf1));
-        s->maxval = atoi(buf1);
-        if (s->maxval <= 0) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid maxval: %d\n", s->maxval);
-            s->maxval = 255;
-        }
-        if (s->maxval >= 256) {
-            if (avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
-                avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;
-                if (s->maxval != 65535)
-                    avctx->pix_fmt = AV_PIX_FMT_GRAY16;
-            } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) {
-                if (s->maxval > 255)
-                    avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
-            } else if (avctx->pix_fmt == AV_PIX_FMT_YUV420P && s->maxval < 65536) {
-                if (s->maxval < 512)
-                    avctx->pix_fmt = AV_PIX_FMT_YUV420P9BE;
-                else if (s->maxval < 1024)
-                    avctx->pix_fmt = AV_PIX_FMT_YUV420P10BE;
-                else
-                    avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
-            } else {
-                av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n");
-                avctx->pix_fmt = AV_PIX_FMT_NONE;
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }else
-        s->maxval=1;
-    /* more check if YUV420 */
-    if (av_pix_fmt_desc_get(avctx->pix_fmt)->flags & AV_PIX_FMT_FLAG_PLANAR) {
-        if ((avctx->width & 1) != 0)
-            return AVERROR_INVALIDDATA;
-        h = (avctx->height * 2);
-        if ((h % 3) != 0)
-            return AVERROR_INVALIDDATA;
-        h /= 3;
-        avctx->height = h;
-    }
-    return 0;
-}
diff --git a/deps/libav/libavcodec/pnm.h b/deps/libav/libavcodec/pnm.h
deleted file mode 100644
index 5fc6513..0000000
--- a/deps/libav/libavcodec/pnm.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * PNM image format
- * Copyright (c) 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PNM_H
-#define AVCODEC_PNM_H
-
-#include "avcodec.h"
-
-typedef struct PNMContext {
-    uint8_t *bytestream;
-    uint8_t *bytestream_start;
-    uint8_t *bytestream_end;
-    int maxval;                 ///< maximum value of a pixel
-    int type;
-} PNMContext;
-
-int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s);
-
-#endif /* AVCODEC_PNM_H */
diff --git a/deps/libav/libavcodec/pnm_parser.c b/deps/libav/libavcodec/pnm_parser.c
deleted file mode 100644
index 2e00c0a..0000000
--- a/deps/libav/libavcodec/pnm_parser.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * PNM image parser
- * Copyright (c) 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "parser.h" //for ParseContext
-#include "pnm.h"
-
-
-static int pnm_parse(AVCodecParserContext *s, AVCodecContext *avctx,
-                     const uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size)
-{
-    ParseContext *pc = s->priv_data;
-    PNMContext pnmctx;
-    int next;
-
-    for (; pc->overread > 0; pc->overread--) {
-        pc->buffer[pc->index++]= pc->buffer[pc->overread_index++];
-    }
-retry:
-    if (pc->index) {
-        pnmctx.bytestream_start =
-        pnmctx.bytestream       = pc->buffer;
-        pnmctx.bytestream_end   = pc->buffer + pc->index;
-    } else {
-        pnmctx.bytestream_start =
-        pnmctx.bytestream       = (uint8_t *) buf; /* casts avoid warnings */
-        pnmctx.bytestream_end   = (uint8_t *) buf + buf_size;
-    }
-    if (ff_pnm_decode_header(avctx, &pnmctx) < 0) {
-        if (pnmctx.bytestream < pnmctx.bytestream_end) {
-            if (pc->index) {
-                pc->index = 0;
-            } else {
-                buf++;
-                buf_size--;
-            }
-            goto retry;
-        }
-#if 0
-        if (pc->index && pc->index * 2 + FF_INPUT_BUFFER_PADDING_SIZE < pc->buffer_size && buf_size > pc->index) {
-            memcpy(pc->buffer + pc->index, buf, pc->index);
-            pc->index += pc->index;
-            buf       += pc->index;
-            buf_size  -= pc->index;
-            goto retry;
-        }
-#endif
-        next = END_NOT_FOUND;
-    } else {
-        next = pnmctx.bytestream - pnmctx.bytestream_start
-               + avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
-        if (pnmctx.bytestream_start != buf)
-            next -= pc->index;
-        if (next > buf_size)
-            next = END_NOT_FOUND;
-    }
-
-    if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-        *poutbuf      = NULL;
-        *poutbuf_size = 0;
-        return buf_size;
-    }
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_pnm_parser = {
-    .codec_ids      = { AV_CODEC_ID_PGM, AV_CODEC_ID_PGMYUV, AV_CODEC_ID_PPM,
-                        AV_CODEC_ID_PBM, AV_CODEC_ID_PAM },
-    .priv_data_size = sizeof(ParseContext),
-    .parser_parse   = pnm_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/pnmdec.c b/deps/libav/libavcodec/pnmdec.c
deleted file mode 100644
index 9074d9b..0000000
--- a/deps/libav/libavcodec/pnmdec.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * PNM image format
- * Copyright (c) 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "put_bits.h"
-#include "pnm.h"
-
-
-static int pnm_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf   = avpkt->data;
-    int buf_size         = avpkt->size;
-    PNMContext * const s = avctx->priv_data;
-    AVFrame * const p    = data;
-    int i, j, n, linesize, h, upgrade = 0;
-    unsigned char *ptr;
-    int components, sample_len, ret;
-
-    s->bytestream_start =
-    s->bytestream       = buf;
-    s->bytestream_end   = buf + buf_size;
-
-    if ((ret = ff_pnm_decode_header(avctx, s)) < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->key_frame = 1;
-
-    switch (avctx->pix_fmt) {
-    default:
-        return AVERROR(EINVAL);
-    case AV_PIX_FMT_RGB48BE:
-        n = avctx->width * 6;
-        components=3;
-        sample_len=16;
-        goto do_read;
-    case AV_PIX_FMT_RGB24:
-        n = avctx->width * 3;
-        components=3;
-        sample_len=8;
-        goto do_read;
-    case AV_PIX_FMT_GRAY8:
-        n = avctx->width;
-        components=1;
-        sample_len=8;
-        if (s->maxval < 255)
-            upgrade = 1;
-        goto do_read;
-    case AV_PIX_FMT_GRAY16BE:
-    case AV_PIX_FMT_GRAY16LE:
-        n = avctx->width * 2;
-        components=1;
-        sample_len=16;
-        if (s->maxval < 65535)
-            upgrade = 2;
-        goto do_read;
-    case AV_PIX_FMT_MONOWHITE:
-    case AV_PIX_FMT_MONOBLACK:
-        n = (avctx->width + 7) >> 3;
-        components=1;
-        sample_len=1;
-    do_read:
-        ptr      = p->data[0];
-        linesize = p->linesize[0];
-        if (s->bytestream + n * avctx->height > s->bytestream_end)
-            return AVERROR_INVALIDDATA;
-        if(s->type < 4){
-            for (i=0; i<avctx->height; i++) {
-                PutBitContext pb;
-                init_put_bits(&pb, ptr, linesize);
-                for(j=0; j<avctx->width * components; j++){
-                    unsigned int c=0;
-                    int v=0;
-                    while(s->bytestream < s->bytestream_end && (*s->bytestream < '0' || *s->bytestream > '9' ))
-                        s->bytestream++;
-                    if(s->bytestream >= s->bytestream_end)
-                        return AVERROR_INVALIDDATA;
-                    do{
-                        v= 10*v + c;
-                        c= (*s->bytestream++) - '0';
-                    }while(c <= 9);
-                    put_bits(&pb, sample_len, (((1<<sample_len)-1)*v + (s->maxval>>1))/s->maxval);
-                }
-                flush_put_bits(&pb);
-                ptr+= linesize;
-            }
-        }else{
-        for (i = 0; i < avctx->height; i++) {
-            if (!upgrade)
-                memcpy(ptr, s->bytestream, n);
-            else if (upgrade == 1) {
-                unsigned int j, f = (255 * 128 + s->maxval / 2) / s->maxval;
-                for (j = 0; j < n; j++)
-                    ptr[j] = (s->bytestream[j] * f + 64) >> 7;
-            } else if (upgrade == 2) {
-                unsigned int j, v, f = (65535 * 32768 + s->maxval / 2) / s->maxval;
-                for (j = 0; j < n / 2; j++) {
-                    v = av_be2ne16(((uint16_t *)s->bytestream)[j]);
-                    ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
-                }
-            }
-            s->bytestream += n;
-            ptr           += linesize;
-        }
-        }
-        break;
-    case AV_PIX_FMT_YUV420P:
-    case AV_PIX_FMT_YUV420P9BE:
-    case AV_PIX_FMT_YUV420P10BE:
-        {
-            unsigned char *ptr1, *ptr2;
-
-            n        = avctx->width;
-            ptr      = p->data[0];
-            linesize = p->linesize[0];
-            if (s->maxval >= 256)
-                n *= 2;
-            if (s->bytestream + n * avctx->height * 3 / 2 > s->bytestream_end)
-                return AVERROR_INVALIDDATA;
-            for (i = 0; i < avctx->height; i++) {
-                memcpy(ptr, s->bytestream, n);
-                s->bytestream += n;
-                ptr           += linesize;
-            }
-            ptr1 = p->data[1];
-            ptr2 = p->data[2];
-            n >>= 1;
-            h = avctx->height >> 1;
-            for (i = 0; i < h; i++) {
-                memcpy(ptr1, s->bytestream, n);
-                s->bytestream += n;
-                memcpy(ptr2, s->bytestream, n);
-                s->bytestream += n;
-                ptr1 += p->linesize[1];
-                ptr2 += p->linesize[2];
-            }
-        }
-        break;
-    case AV_PIX_FMT_YUV420P16:
-        {
-            uint16_t *ptr1, *ptr2;
-            const int f = (65535 * 32768 + s->maxval / 2) / s->maxval;
-            unsigned int j, v;
-
-            n        = avctx->width * 2;
-            ptr      = p->data[0];
-            linesize = p->linesize[0];
-            if (s->bytestream + n * avctx->height * 3 / 2 > s->bytestream_end)
-                return AVERROR_INVALIDDATA;
-            for (i = 0; i < avctx->height; i++) {
-                for (j = 0; j < n / 2; j++) {
-                    v = av_be2ne16(((uint16_t *)s->bytestream)[j]);
-                    ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
-                }
-                s->bytestream += n;
-                ptr           += linesize;
-            }
-            ptr1 = (uint16_t*)p->data[1];
-            ptr2 = (uint16_t*)p->data[2];
-            n >>= 1;
-            h = avctx->height >> 1;
-            for (i = 0; i < h; i++) {
-                for (j = 0; j < n / 2; j++) {
-                    v = av_be2ne16(((uint16_t *)s->bytestream)[j]);
-                    ptr1[j] = (v * f + 16384) >> 15;
-                }
-                s->bytestream += n;
-
-                for (j = 0; j < n / 2; j++) {
-                    v = av_be2ne16(((uint16_t *)s->bytestream)[j]);
-                    ptr2[j] = (v * f + 16384) >> 15;
-                }
-                s->bytestream += n;
-
-                ptr1 += p->linesize[1] / 2;
-                ptr2 += p->linesize[2] / 2;
-            }
-        }
-        break;
-    case AV_PIX_FMT_RGB32:
-        ptr      = p->data[0];
-        linesize = p->linesize[0];
-        if (s->bytestream + avctx->width * avctx->height * 4 > s->bytestream_end)
-            return AVERROR_INVALIDDATA;
-        for (i = 0; i < avctx->height; i++) {
-            int j, r, g, b, a;
-
-            for (j = 0; j < avctx->width; j++) {
-                r = *s->bytestream++;
-                g = *s->bytestream++;
-                b = *s->bytestream++;
-                a = *s->bytestream++;
-                ((uint32_t *)ptr)[j] = (a << 24) | (r << 16) | (g << 8) | b;
-            }
-            ptr += linesize;
-        }
-        break;
-    }
-    *got_frame = 1;
-
-    return s->bytestream - s->bytestream_start;
-}
-
-
-#if CONFIG_PGM_DECODER
-AVCodec ff_pgm_decoder = {
-    .name           = "pgm",
-    .long_name      = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PGM,
-    .priv_data_size = sizeof(PNMContext),
-    .decode         = pnm_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
-
-#if CONFIG_PGMYUV_DECODER
-AVCodec ff_pgmyuv_decoder = {
-    .name           = "pgmyuv",
-    .long_name      = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PGMYUV,
-    .priv_data_size = sizeof(PNMContext),
-    .decode         = pnm_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
-
-#if CONFIG_PPM_DECODER
-AVCodec ff_ppm_decoder = {
-    .name           = "ppm",
-    .long_name      = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PPM,
-    .priv_data_size = sizeof(PNMContext),
-    .decode         = pnm_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
-
-#if CONFIG_PBM_DECODER
-AVCodec ff_pbm_decoder = {
-    .name           = "pbm",
-    .long_name      = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PBM,
-    .priv_data_size = sizeof(PNMContext),
-    .decode         = pnm_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
-
-#if CONFIG_PAM_DECODER
-AVCodec ff_pam_decoder = {
-    .name           = "pam",
-    .long_name      = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PAM,
-    .priv_data_size = sizeof(PNMContext),
-    .decode         = pnm_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
diff --git a/deps/libav/libavcodec/pnmenc.c b/deps/libav/libavcodec/pnmenc.c
deleted file mode 100644
index 7513552..0000000
--- a/deps/libav/libavcodec/pnmenc.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * PNM image format
- * Copyright (c) 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/pixdesc.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                            const AVFrame *pict, int *got_packet)
-{
-    uint8_t *bytestream, *bytestream_start, *bytestream_end;
-    const AVFrame * const p = pict;
-    int i, h, h1, c, n, linesize, ret;
-    uint8_t *ptr, *ptr1, *ptr2;
-
-    if ((ret = ff_alloc_packet(pkt, avpicture_get_size(avctx->pix_fmt,
-                                                       avctx->width,
-                                                       avctx->height) + 200)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
-        return ret;
-    }
-
-    bytestream_start =
-    bytestream       = pkt->data;
-    bytestream_end   = pkt->data + pkt->size;
-
-    h  = avctx->height;
-    h1 = h;
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_MONOWHITE:
-        c  = '4';
-        n  = (avctx->width + 7) >> 3;
-        break;
-    case AV_PIX_FMT_GRAY8:
-        c  = '5';
-        n  = avctx->width;
-        break;
-    case AV_PIX_FMT_GRAY16BE:
-        c  = '5';
-        n  = avctx->width * 2;
-        break;
-    case AV_PIX_FMT_RGB24:
-        c  = '6';
-        n  = avctx->width * 3;
-        break;
-    case AV_PIX_FMT_RGB48BE:
-        c  = '6';
-        n  = avctx->width * 6;
-        break;
-    case AV_PIX_FMT_YUV420P:
-        c  = '5';
-        n  = avctx->width;
-        h1 = (h * 3) / 2;
-        break;
-    case AV_PIX_FMT_YUV420P16BE:
-        c  = '5';
-        n  = avctx->width * 2;
-        h1 = (h * 3) / 2;
-        break;
-    default:
-        return -1;
-    }
-    snprintf(bytestream, bytestream_end - bytestream,
-             "P%c\n%d %d\n", c, avctx->width, h1);
-    bytestream += strlen(bytestream);
-    if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE) {
-        int maxdepth = (1 << (av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1)) - 1;
-        snprintf(bytestream, bytestream_end - bytestream,
-                 "%d\n", maxdepth);
-        bytestream += strlen(bytestream);
-    }
-
-    ptr      = p->data[0];
-    linesize = p->linesize[0];
-    for (i = 0; i < h; i++) {
-        memcpy(bytestream, ptr, n);
-        bytestream += n;
-        ptr        += linesize;
-    }
-
-    if (avctx->pix_fmt == AV_PIX_FMT_YUV420P || avctx->pix_fmt == AV_PIX_FMT_YUV420P16BE) {
-        h >>= 1;
-        n >>= 1;
-        ptr1 = p->data[1];
-        ptr2 = p->data[2];
-        for (i = 0; i < h; i++) {
-            memcpy(bytestream, ptr1, n);
-            bytestream += n;
-            memcpy(bytestream, ptr2, n);
-            bytestream += n;
-                ptr1 += p->linesize[1];
-                ptr2 += p->linesize[2];
-        }
-    }
-    pkt->size   = bytestream - bytestream_start;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int pnm_encode_init(AVCodecContext *avctx)
-{
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    return 0;
-}
-
-static av_cold int pnm_encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-#if CONFIG_PGM_ENCODER
-AVCodec ff_pgm_encoder = {
-    .name           = "pgm",
-    .long_name      = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PGM,
-    .init           = pnm_encode_init,
-    .close          = pnm_encode_close,
-    .encode2        = pnm_encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE
-    },
-};
-#endif
-
-#if CONFIG_PGMYUV_ENCODER
-AVCodec ff_pgmyuv_encoder = {
-    .name           = "pgmyuv",
-    .long_name      = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PGMYUV,
-    .init           = pnm_encode_init,
-    .close          = pnm_encode_close,
-    .encode2        = pnm_encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE
-    },
-};
-#endif
-
-#if CONFIG_PPM_ENCODER
-AVCodec ff_ppm_encoder = {
-    .name           = "ppm",
-    .long_name      = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PPM,
-    .init           = pnm_encode_init,
-    .close          = pnm_encode_close,
-    .encode2        = pnm_encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE
-    },
-};
-#endif
-
-#if CONFIG_PBM_ENCODER
-AVCodec ff_pbm_encoder = {
-    .name           = "pbm",
-    .long_name      = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PBM,
-    .init           = pnm_encode_init,
-    .close          = pnm_encode_close,
-    .encode2        = pnm_encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE,
-                                                  AV_PIX_FMT_NONE },
-};
-#endif
diff --git a/deps/libav/libavcodec/ppc/Makefile b/deps/libav/libavcodec/ppc/Makefile
deleted file mode 100644
index 71b23da..0000000
--- a/deps/libav/libavcodec/ppc/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-OBJS                                   += ppc/dsputil_ppc.o             \
-                                          ppc/fmtconvert_altivec.o      \
-                                          ppc/videodsp_ppc.o            \
-
-OBJS-$(CONFIG_FFT)                     += ppc/fft_altivec.o
-OBJS-$(CONFIG_H264CHROMA)              += ppc/h264chroma_init.o
-OBJS-$(CONFIG_H264DSP)                 += ppc/h264dsp.o
-OBJS-$(CONFIG_H264QPEL)                += ppc/h264qpel.o
-OBJS-$(CONFIG_HPELDSP)                 += ppc/hpeldsp_altivec.o
-OBJS-$(CONFIG_MPEGAUDIODSP)            += ppc/mpegaudiodsp_altivec.o
-OBJS-$(CONFIG_MPEGVIDEO)               += ppc/mpegvideo_altivec.o
-OBJS-$(CONFIG_VC1_DECODER)             += ppc/vc1dsp_altivec.o
-OBJS-$(CONFIG_VORBIS_DECODER)          += ppc/vorbisdsp_altivec.o
-OBJS-$(CONFIG_VP3DSP)                  += ppc/vp3dsp_altivec.o
-OBJS-$(CONFIG_VP8_DECODER)             += ppc/vp8dsp_altivec.o
-
-ALTIVEC-OBJS                           += ppc/dsputil_altivec.o         \
-                                          ppc/fdct_altivec.o            \
-                                          ppc/gmc_altivec.o             \
-                                          ppc/idct_altivec.o            \
-                                          ppc/int_altivec.o             \
-
-FFT-OBJS-$(HAVE_GNU_AS)                += ppc/fft_altivec_s.o
-ALTIVEC-OBJS-$(CONFIG_FFT)             += $(FFT-OBJS-yes)
diff --git a/deps/libav/libavcodec/ppc/asm.S b/deps/libav/libavcodec/ppc/asm.S
deleted file mode 100644
index 4d4285b..0000000
--- a/deps/libav/libavcodec/ppc/asm.S
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2009 Loren Merritt
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#define GLUE(a, b) a ## b
-#define JOIN(a, b) GLUE(a, b)
-#define X(s) JOIN(EXTERN_ASM, s)
-
-#if ARCH_PPC64
-
-#define PTR  .quad
-#define lp   ld
-#define lpx  ldx
-#define stp  std
-#define stpu stdu
-#define PS   8
-#define L(s) JOIN(., s)
-
-.macro extfunc name
-    .global X(\name)
-    .section .opd, "aw"
-X(\name):
-    .quad L(\name), .TOC. at tocbase, 0
-    .previous
-    .type X(\name), STT_FUNC
-L(\name):
-.endm
-
-.macro movrel rd, sym, gp
-    ld      \rd, \sym at got(r2)
-.endm
-
-.macro get_got rd
-.endm
-
-#else /* ARCH_PPC64 */
-
-#define PTR  .int
-#define lp   lwz
-#define lpx  lwzx
-#define stp  stw
-#define stpu stwu
-#define PS   4
-#define L(s) s
-
-.macro extfunc name
-    .global X(\name)
-    .type   X(\name), STT_FUNC
-X(\name):
-\name:
-.endm
-
-.macro movrel rd, sym, gp
-#if CONFIG_PIC
-    lwz     \rd, \sym at got(\gp)
-#else
-    lis     \rd, \sym at ha
-    la      \rd, \sym at l(\rd)
-#endif
-.endm
-
-.macro get_got rd
-#if CONFIG_PIC
-    bcl     20, 31, .Lgot\@
-.Lgot\@:
-    mflr    \rd
-    addis   \rd, \rd, _GLOBAL_OFFSET_TABLE_ - .Lgot\@@ha
-    addi    \rd, \rd, _GLOBAL_OFFSET_TABLE_ - .Lgot\@@l
-#endif
-.endm
-
-#endif /* ARCH_PPC64 */
-
-#if HAVE_IBM_ASM
-
-.macro DEFINE_REG n
-    .equiv r\n, \n
-    .equiv f\n, \n
-    .equiv v\n, \n
-.endm
-
-DEFINE_REG 0
-DEFINE_REG 1
-DEFINE_REG 2
-DEFINE_REG 3
-DEFINE_REG 4
-DEFINE_REG 5
-DEFINE_REG 6
-DEFINE_REG 7
-DEFINE_REG 8
-DEFINE_REG 9
-DEFINE_REG 10
-DEFINE_REG 11
-DEFINE_REG 12
-DEFINE_REG 13
-DEFINE_REG 14
-DEFINE_REG 15
-DEFINE_REG 16
-DEFINE_REG 17
-DEFINE_REG 18
-DEFINE_REG 19
-DEFINE_REG 20
-DEFINE_REG 21
-DEFINE_REG 22
-DEFINE_REG 23
-DEFINE_REG 24
-DEFINE_REG 25
-DEFINE_REG 26
-DEFINE_REG 27
-DEFINE_REG 28
-DEFINE_REG 29
-DEFINE_REG 30
-DEFINE_REG 31
-
-#endif /* HAVE_IBM_ASM */
diff --git a/deps/libav/libavcodec/ppc/dsputil_altivec.c b/deps/libav/libavcodec/ppc/dsputil_altivec.c
deleted file mode 100644
index 6f6c5f3..0000000
--- a/deps/libav/libavcodec/ppc/dsputil_altivec.c
+++ /dev/null
@@ -1,963 +0,0 @@
-/*
- * Copyright (c) 2002 Brian Foley
- * Copyright (c) 2002 Dieter Shirley
- * Copyright (c) 2003-2004 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#if HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-#include "libavutil/attributes.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_altivec.h"
-
-static int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int i;
-    int s;
-    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
-    vector unsigned char perm1 = vec_lvsl(0, pix2);
-    vector unsigned char perm2 = vec_add(perm1, vec_splat_u8(1));
-    vector unsigned char pix2l, pix2r;
-    vector unsigned char pix1v, pix2v, pix2iv, avgv, t5;
-    vector unsigned int sad;
-    vector signed int sumdiffs;
-
-    s = 0;
-    sad = (vector unsigned int)vec_splat_u32(0);
-    for (i = 0; i < h; i++) {
-        /* Read unaligned pixels into our vectors. The vectors are as follows:
-           pix1v: pix1[0]-pix1[15]
-           pix2v: pix2[0]-pix2[15]      pix2iv: pix2[1]-pix2[16] */
-        pix1v  = vec_ld( 0, pix1);
-        pix2l  = vec_ld( 0, pix2);
-        pix2r  = vec_ld(16, pix2);
-        pix2v  = vec_perm(pix2l, pix2r, perm1);
-        pix2iv = vec_perm(pix2l, pix2r, perm2);
-
-        /* Calculate the average vector */
-        avgv = vec_avg(pix2v, pix2iv);
-
-        /* Calculate a sum of abs differences vector */
-        t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));
-
-        /* Add each 4 pixel group together and put 4 results into sad */
-        sad = vec_sum4s(t5, sad);
-
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-    /* Sum up the four partial sums, and put the result into s */
-    sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
-    sumdiffs = vec_splat(sumdiffs, 3);
-    vec_ste(sumdiffs, 0, &s);
-
-    return s;
-}
-
-static int sad16_y2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int i;
-    int s;
-    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
-    vector unsigned char perm = vec_lvsl(0, pix2);
-    vector unsigned char pix2l, pix2r;
-    vector unsigned char pix1v, pix2v, pix3v, avgv, t5;
-    vector unsigned int sad;
-    vector signed int sumdiffs;
-    uint8_t *pix3 = pix2 + line_size;
-
-    s = 0;
-    sad = (vector unsigned int)vec_splat_u32(0);
-
-    /* Due to the fact that pix3 = pix2 + line_size, the pix3 of one
-       iteration becomes pix2 in the next iteration. We can use this
-       fact to avoid a potentially expensive unaligned read, each
-       time around the loop.
-       Read unaligned pixels into our vectors. The vectors are as follows:
-       pix2v: pix2[0]-pix2[15]
-       Split the pixel vectors into shorts */
-    pix2l = vec_ld( 0, pix2);
-    pix2r = vec_ld(15, pix2);
-    pix2v = vec_perm(pix2l, pix2r, perm);
-
-    for (i = 0; i < h; i++) {
-        /* Read unaligned pixels into our vectors. The vectors are as follows:
-           pix1v: pix1[0]-pix1[15]
-           pix3v: pix3[0]-pix3[15] */
-        pix1v = vec_ld(0, pix1);
-
-        pix2l = vec_ld( 0, pix3);
-        pix2r = vec_ld(15, pix3);
-        pix3v = vec_perm(pix2l, pix2r, perm);
-
-        /* Calculate the average vector */
-        avgv = vec_avg(pix2v, pix3v);
-
-        /* Calculate a sum of abs differences vector */
-        t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));
-
-        /* Add each 4 pixel group together and put 4 results into sad */
-        sad = vec_sum4s(t5, sad);
-
-        pix1 += line_size;
-        pix2v = pix3v;
-        pix3 += line_size;
-
-    }
-
-    /* Sum up the four partial sums, and put the result into s */
-    sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
-    sumdiffs = vec_splat(sumdiffs, 3);
-    vec_ste(sumdiffs, 0, &s);
-    return s;
-}
-
-static int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int i;
-    int s;
-    uint8_t *pix3 = pix2 + line_size;
-    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
-    const vector unsigned short two = (const vector unsigned short)vec_splat_u16(2);
-    vector unsigned char avgv, t5;
-    vector unsigned char perm1 = vec_lvsl(0, pix2);
-    vector unsigned char perm2 = vec_add(perm1, vec_splat_u8(1));
-    vector unsigned char pix2l, pix2r;
-    vector unsigned char pix1v, pix2v, pix3v, pix2iv, pix3iv;
-    vector unsigned short pix2lv, pix2hv, pix2ilv, pix2ihv;
-    vector unsigned short pix3lv, pix3hv, pix3ilv, pix3ihv;
-    vector unsigned short avghv, avglv;
-    vector unsigned short t1, t2, t3, t4;
-    vector unsigned int sad;
-    vector signed int sumdiffs;
-
-    sad = (vector unsigned int)vec_splat_u32(0);
-
-    s = 0;
-
-    /* Due to the fact that pix3 = pix2 + line_size, the pix3 of one
-       iteration becomes pix2 in the next iteration. We can use this
-       fact to avoid a potentially expensive unaligned read, as well
-       as some splitting, and vector addition each time around the loop.
-       Read unaligned pixels into our vectors. The vectors are as follows:
-       pix2v: pix2[0]-pix2[15]  pix2iv: pix2[1]-pix2[16]
-       Split the pixel vectors into shorts */
-    pix2l  = vec_ld( 0, pix2);
-    pix2r  = vec_ld(16, pix2);
-    pix2v  = vec_perm(pix2l, pix2r, perm1);
-    pix2iv = vec_perm(pix2l, pix2r, perm2);
-
-    pix2hv  = (vector unsigned short) vec_mergeh(zero, pix2v);
-    pix2lv  = (vector unsigned short) vec_mergel(zero, pix2v);
-    pix2ihv = (vector unsigned short) vec_mergeh(zero, pix2iv);
-    pix2ilv = (vector unsigned short) vec_mergel(zero, pix2iv);
-    t1 = vec_add(pix2hv, pix2ihv);
-    t2 = vec_add(pix2lv, pix2ilv);
-
-    for (i = 0; i < h; i++) {
-        /* Read unaligned pixels into our vectors. The vectors are as follows:
-           pix1v: pix1[0]-pix1[15]
-           pix3v: pix3[0]-pix3[15]      pix3iv: pix3[1]-pix3[16] */
-        pix1v = vec_ld(0, pix1);
-
-        pix2l  = vec_ld( 0, pix3);
-        pix2r  = vec_ld(16, pix3);
-        pix3v  = vec_perm(pix2l, pix2r, perm1);
-        pix3iv = vec_perm(pix2l, pix2r, perm2);
-
-        /* Note that AltiVec does have vec_avg, but this works on vector pairs
-           and rounds up. We could do avg(avg(a,b),avg(c,d)), but the rounding
-           would mean that, for example, avg(3,0,0,1) = 2, when it should be 1.
-           Instead, we have to split the pixel vectors into vectors of shorts,
-           and do the averaging by hand. */
-
-        /* Split the pixel vectors into shorts */
-        pix3hv  = (vector unsigned short) vec_mergeh(zero, pix3v);
-        pix3lv  = (vector unsigned short) vec_mergel(zero, pix3v);
-        pix3ihv = (vector unsigned short) vec_mergeh(zero, pix3iv);
-        pix3ilv = (vector unsigned short) vec_mergel(zero, pix3iv);
-
-        /* Do the averaging on them */
-        t3 = vec_add(pix3hv, pix3ihv);
-        t4 = vec_add(pix3lv, pix3ilv);
-
-        avghv = vec_sr(vec_add(vec_add(t1, t3), two), two);
-        avglv = vec_sr(vec_add(vec_add(t2, t4), two), two);
-
-        /* Pack the shorts back into a result */
-        avgv = vec_pack(avghv, avglv);
-
-        /* Calculate a sum of abs differences vector */
-        t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));
-
-        /* Add each 4 pixel group together and put 4 results into sad */
-        sad = vec_sum4s(t5, sad);
-
-        pix1 += line_size;
-        pix3 += line_size;
-        /* Transfer the calculated values for pix3 into pix2 */
-        t1 = t3;
-        t2 = t4;
-    }
-    /* Sum up the four partial sums, and put the result into s */
-    sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
-    sumdiffs = vec_splat(sumdiffs, 3);
-    vec_ste(sumdiffs, 0, &s);
-
-    return s;
-}
-
-static int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int i;
-    int s;
-    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
-    vector unsigned char perm = vec_lvsl(0, pix2);
-    vector unsigned char t1, t2, t3,t4, t5;
-    vector unsigned int sad;
-    vector signed int sumdiffs;
-
-    sad = (vector unsigned int)vec_splat_u32(0);
-
-
-    for (i = 0; i < h; i++) {
-        /* Read potentially unaligned pixels into t1 and t2 */
-        vector unsigned char pix2l = vec_ld( 0, pix2);
-        vector unsigned char pix2r = vec_ld(15, pix2);
-        t1 = vec_ld(0, pix1);
-        t2 = vec_perm(pix2l, pix2r, perm);
-
-        /* Calculate a sum of abs differences vector */
-        t3 = vec_max(t1, t2);
-        t4 = vec_min(t1, t2);
-        t5 = vec_sub(t3, t4);
-
-        /* Add each 4 pixel group together and put 4 results into sad */
-        sad = vec_sum4s(t5, sad);
-
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-
-    /* Sum up the four partial sums, and put the result into s */
-    sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
-    sumdiffs = vec_splat(sumdiffs, 3);
-    vec_ste(sumdiffs, 0, &s);
-
-    return s;
-}
-
-static int sad8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int i;
-    int s;
-    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
-    const vector unsigned char permclear = (vector unsigned char){255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0};
-    vector unsigned char perm1 = vec_lvsl(0, pix1);
-    vector unsigned char perm2 = vec_lvsl(0, pix2);
-    vector unsigned char t1, t2, t3,t4, t5;
-    vector unsigned int sad;
-    vector signed int sumdiffs;
-
-    sad = (vector unsigned int)vec_splat_u32(0);
-
-    for (i = 0; i < h; i++) {
-        /* Read potentially unaligned pixels into t1 and t2
-           Since we're reading 16 pixels, and actually only want 8,
-           mask out the last 8 pixels. The 0s don't change the sum. */
-        vector unsigned char pix1l = vec_ld(0, pix1);
-        vector unsigned char pix1r = vec_ld(7, pix1);
-        vector unsigned char pix2l = vec_ld(0, pix2);
-        vector unsigned char pix2r = vec_ld(7, pix2);
-        t1 = vec_and(vec_perm(pix1l, pix1r, perm1), permclear);
-        t2 = vec_and(vec_perm(pix2l, pix2r, perm2), permclear);
-
-        /* Calculate a sum of abs differences vector */
-        t3 = vec_max(t1, t2);
-        t4 = vec_min(t1, t2);
-        t5 = vec_sub(t3, t4);
-
-        /* Add each 4 pixel group together and put 4 results into sad */
-        sad = vec_sum4s(t5, sad);
-
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-
-    /* Sum up the four partial sums, and put the result into s */
-    sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
-    sumdiffs = vec_splat(sumdiffs, 3);
-    vec_ste(sumdiffs, 0, &s);
-
-    return s;
-}
-
-static int pix_norm1_altivec(uint8_t *pix, int line_size)
-{
-    int i;
-    int s;
-    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
-    vector unsigned char perm = vec_lvsl(0, pix);
-    vector unsigned char pixv;
-    vector unsigned int sv;
-    vector signed int sum;
-
-    sv = (vector unsigned int)vec_splat_u32(0);
-
-    s = 0;
-    for (i = 0; i < 16; i++) {
-        /* Read in the potentially unaligned pixels */
-        vector unsigned char pixl = vec_ld( 0, pix);
-        vector unsigned char pixr = vec_ld(15, pix);
-        pixv = vec_perm(pixl, pixr, perm);
-
-        /* Square the values, and add them to our sum */
-        sv = vec_msum(pixv, pixv, sv);
-
-        pix += line_size;
-    }
-    /* Sum up the four partial sums, and put the result into s */
-    sum = vec_sums((vector signed int) sv, (vector signed int) zero);
-    sum = vec_splat(sum, 3);
-    vec_ste(sum, 0, &s);
-
-    return s;
-}
-
-/**
- * Sum of Squared Errors for a 8x8 block.
- * AltiVec-enhanced.
- * It's the sad8_altivec code above w/ squaring added.
- */
-static int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int i;
-    int s;
-    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
-    const vector unsigned char permclear = (vector unsigned char){255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0};
-    vector unsigned char perm1 = vec_lvsl(0, pix1);
-    vector unsigned char perm2 = vec_lvsl(0, pix2);
-    vector unsigned char t1, t2, t3,t4, t5;
-    vector unsigned int sum;
-    vector signed int sumsqr;
-
-    sum = (vector unsigned int)vec_splat_u32(0);
-
-    for (i = 0; i < h; i++) {
-        /* Read potentially unaligned pixels into t1 and t2
-           Since we're reading 16 pixels, and actually only want 8,
-           mask out the last 8 pixels. The 0s don't change the sum. */
-        vector unsigned char pix1l = vec_ld(0, pix1);
-        vector unsigned char pix1r = vec_ld(7, pix1);
-        vector unsigned char pix2l = vec_ld(0, pix2);
-        vector unsigned char pix2r = vec_ld(7, pix2);
-        t1 = vec_and(vec_perm(pix1l, pix1r, perm1), permclear);
-        t2 = vec_and(vec_perm(pix2l, pix2r, perm2), permclear);
-
-        /* Since we want to use unsigned chars, we can take advantage
-           of the fact that abs(a-b)^2 = (a-b)^2. */
-
-        /* Calculate abs differences vector */
-        t3 = vec_max(t1, t2);
-        t4 = vec_min(t1, t2);
-        t5 = vec_sub(t3, t4);
-
-        /* Square the values and add them to our sum */
-        sum = vec_msum(t5, t5, sum);
-
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-
-    /* Sum up the four partial sums, and put the result into s */
-    sumsqr = vec_sums((vector signed int) sum, (vector signed int) zero);
-    sumsqr = vec_splat(sumsqr, 3);
-    vec_ste(sumsqr, 0, &s);
-
-    return s;
-}
-
-/**
- * Sum of Squared Errors for a 16x16 block.
- * AltiVec-enhanced.
- * It's the sad16_altivec code above w/ squaring added.
- */
-static int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
-    int i;
-    int s;
-    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
-    vector unsigned char perm = vec_lvsl(0, pix2);
-    vector unsigned char t1, t2, t3,t4, t5;
-    vector unsigned int sum;
-    vector signed int sumsqr;
-
-    sum = (vector unsigned int)vec_splat_u32(0);
-
-    for (i = 0; i < h; i++) {
-        /* Read potentially unaligned pixels into t1 and t2 */
-        vector unsigned char pix2l = vec_ld( 0, pix2);
-        vector unsigned char pix2r = vec_ld(15, pix2);
-        t1 = vec_ld(0, pix1);
-        t2 = vec_perm(pix2l, pix2r, perm);
-
-        /* Since we want to use unsigned chars, we can take advantage
-           of the fact that abs(a-b)^2 = (a-b)^2. */
-
-        /* Calculate abs differences vector */
-        t3 = vec_max(t1, t2);
-        t4 = vec_min(t1, t2);
-        t5 = vec_sub(t3, t4);
-
-        /* Square the values and add them to our sum */
-        sum = vec_msum(t5, t5, sum);
-
-        pix1 += line_size;
-        pix2 += line_size;
-    }
-
-    /* Sum up the four partial sums, and put the result into s */
-    sumsqr = vec_sums((vector signed int) sum, (vector signed int) zero);
-    sumsqr = vec_splat(sumsqr, 3);
-    vec_ste(sumsqr, 0, &s);
-
-    return s;
-}
-
-static int pix_sum_altivec(uint8_t * pix, int line_size)
-{
-    const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
-    vector unsigned char perm = vec_lvsl(0, pix);
-    vector unsigned char t1;
-    vector unsigned int sad;
-    vector signed int sumdiffs;
-
-    int i;
-    int s;
-
-    sad = (vector unsigned int)vec_splat_u32(0);
-
-    for (i = 0; i < 16; i++) {
-        /* Read the potentially unaligned 16 pixels into t1 */
-        vector unsigned char pixl = vec_ld( 0, pix);
-        vector unsigned char pixr = vec_ld(15, pix);
-        t1 = vec_perm(pixl, pixr, perm);
-
-        /* Add each 4 pixel group together and put 4 results into sad */
-        sad = vec_sum4s(t1, sad);
-
-        pix += line_size;
-    }
-
-    /* Sum up the four partial sums, and put the result into s */
-    sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
-    sumdiffs = vec_splat(sumdiffs, 3);
-    vec_ste(sumdiffs, 0, &s);
-
-    return s;
-}
-
-static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, int line_size)
-{
-    int i;
-    vector unsigned char perm = vec_lvsl(0, pixels);
-    vector unsigned char bytes;
-    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
-    vector signed short shorts;
-
-    for (i = 0; i < 8; i++) {
-        // Read potentially unaligned pixels.
-        // We're reading 16 pixels, and actually only want 8,
-        // but we simply ignore the extras.
-        vector unsigned char pixl = vec_ld(0, pixels);
-        vector unsigned char pixr = vec_ld(7, pixels);
-        bytes = vec_perm(pixl, pixr, perm);
-
-        // convert the bytes into shorts
-        shorts = (vector signed short)vec_mergeh(zero, bytes);
-
-        // save the data to the block, we assume the block is 16-byte aligned
-        vec_st(shorts, i*16, (vector signed short*)block);
-
-        pixels += line_size;
-    }
-}
-
-static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
-        const uint8_t *s2, int stride)
-{
-    int i;
-    vector unsigned char perm1 = vec_lvsl(0, s1);
-    vector unsigned char perm2 = vec_lvsl(0, s2);
-    vector unsigned char bytes, pixl, pixr;
-    const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
-    vector signed short shorts1, shorts2;
-
-    for (i = 0; i < 4; i++) {
-        // Read potentially unaligned pixels
-        // We're reading 16 pixels, and actually only want 8,
-        // but we simply ignore the extras.
-        pixl = vec_ld( 0, s1);
-        pixr = vec_ld(15, s1);
-        bytes = vec_perm(pixl, pixr, perm1);
-
-        // convert the bytes into shorts
-        shorts1 = (vector signed short)vec_mergeh(zero, bytes);
-
-        // Do the same for the second block of pixels
-        pixl = vec_ld( 0, s2);
-        pixr = vec_ld(15, s2);
-        bytes = vec_perm(pixl, pixr, perm2);
-
-        // convert the bytes into shorts
-        shorts2 = (vector signed short)vec_mergeh(zero, bytes);
-
-        // Do the subtraction
-        shorts1 = vec_sub(shorts1, shorts2);
-
-        // save the data to the block, we assume the block is 16-byte aligned
-        vec_st(shorts1, 0, (vector signed short*)block);
-
-        s1 += stride;
-        s2 += stride;
-        block += 8;
-
-
-        // The code below is a copy of the code above... This is a manual
-        // unroll.
-
-        // Read potentially unaligned pixels
-        // We're reading 16 pixels, and actually only want 8,
-        // but we simply ignore the extras.
-        pixl = vec_ld( 0, s1);
-        pixr = vec_ld(15, s1);
-        bytes = vec_perm(pixl, pixr, perm1);
-
-        // convert the bytes into shorts
-        shorts1 = (vector signed short)vec_mergeh(zero, bytes);
-
-        // Do the same for the second block of pixels
-        pixl = vec_ld( 0, s2);
-        pixr = vec_ld(15, s2);
-        bytes = vec_perm(pixl, pixr, perm2);
-
-        // convert the bytes into shorts
-        shorts2 = (vector signed short)vec_mergeh(zero, bytes);
-
-        // Do the subtraction
-        shorts1 = vec_sub(shorts1, shorts2);
-
-        // save the data to the block, we assume the block is 16-byte aligned
-        vec_st(shorts1, 0, (vector signed short*)block);
-
-        s1 += stride;
-        s2 += stride;
-        block += 8;
-    }
-}
-
-
-static void clear_block_altivec(int16_t *block) {
-    LOAD_ZERO;
-    vec_st(zero_s16v,   0, block);
-    vec_st(zero_s16v,  16, block);
-    vec_st(zero_s16v,  32, block);
-    vec_st(zero_s16v,  48, block);
-    vec_st(zero_s16v,  64, block);
-    vec_st(zero_s16v,  80, block);
-    vec_st(zero_s16v,  96, block);
-    vec_st(zero_s16v, 112, block);
-}
-
-
-static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) {
-    register int i;
-    register vector unsigned char vdst, vsrc;
-
-    /* dst and src are 16 bytes-aligned (guaranteed) */
-    for (i = 0 ; (i + 15) < w ; i+=16) {
-        vdst = vec_ld(i, (unsigned char*)dst);
-        vsrc = vec_ld(i, (unsigned char*)src);
-        vdst = vec_add(vsrc, vdst);
-        vec_st(vdst, i, (unsigned char*)dst);
-    }
-    /* if w is not a multiple of 16 */
-    for (; (i < w) ; i++) {
-        dst[i] = src[i];
-    }
-}
-
-static int hadamard8_diff8x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
-    int sum;
-    register const vector unsigned char vzero =
-                            (const vector unsigned char)vec_splat_u8(0);
-    register vector signed short temp0, temp1, temp2, temp3, temp4,
-                                 temp5, temp6, temp7;
-    {
-    register const vector signed short vprod1 =(const vector signed short)
-                                               { 1,-1, 1,-1, 1,-1, 1,-1 };
-    register const vector signed short vprod2 =(const vector signed short)
-                                               { 1, 1,-1,-1, 1, 1,-1,-1 };
-    register const vector signed short vprod3 =(const vector signed short)
-                                               { 1, 1, 1, 1,-1,-1,-1,-1 };
-    register const vector unsigned char perm1 = (const vector unsigned char)
-        {0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
-         0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D};
-    register const vector unsigned char perm2 = (const vector unsigned char)
-        {0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
-         0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B};
-    register const vector unsigned char perm3 = (const vector unsigned char)
-        {0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-         0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-#define ONEITERBUTTERFLY(i, res)                                          \
-    {                                                                     \
-    register vector unsigned char src1, src2, srcO;                   \
-    register vector unsigned char dst1, dst2, dstO;                   \
-    register vector signed short srcV, dstV;                          \
-    register vector signed short but0, but1, but2, op1, op2, op3;     \
-    src1 = vec_ld(stride * i, src);                                   \
-    src2 = vec_ld((stride * i) + 15, src);                            \
-    srcO = vec_perm(src1, src2, vec_lvsl(stride * i, src));           \
-    dst1 = vec_ld(stride * i, dst);                                   \
-    dst2 = vec_ld((stride * i) + 15, dst);                            \
-    dstO = vec_perm(dst1, dst2, vec_lvsl(stride * i, dst));           \
-    /* promote the unsigned chars to signed shorts */                 \
-    /* we're in the 8x8 function, we only care for the first 8 */     \
-    srcV = (vector signed short)vec_mergeh((vector signed char)vzero, \
-           (vector signed char)srcO);                                 \
-    dstV = (vector signed short)vec_mergeh((vector signed char)vzero, \
-           (vector signed char)dstO);                                 \
-    /* subtractions inside the first butterfly */                     \
-    but0 = vec_sub(srcV, dstV);                                       \
-    op1  = vec_perm(but0, but0, perm1);                               \
-    but1 = vec_mladd(but0, vprod1, op1);                              \
-    op2  = vec_perm(but1, but1, perm2);                               \
-    but2 = vec_mladd(but1, vprod2, op2);                              \
-    op3  = vec_perm(but2, but2, perm3);                               \
-    res  = vec_mladd(but2, vprod3, op3);                              \
-    }
-    ONEITERBUTTERFLY(0, temp0);
-    ONEITERBUTTERFLY(1, temp1);
-    ONEITERBUTTERFLY(2, temp2);
-    ONEITERBUTTERFLY(3, temp3);
-    ONEITERBUTTERFLY(4, temp4);
-    ONEITERBUTTERFLY(5, temp5);
-    ONEITERBUTTERFLY(6, temp6);
-    ONEITERBUTTERFLY(7, temp7);
-    }
-#undef ONEITERBUTTERFLY
-    {
-    register vector signed int vsum;
-    register vector signed short line0 = vec_add(temp0, temp1);
-    register vector signed short line1 = vec_sub(temp0, temp1);
-    register vector signed short line2 = vec_add(temp2, temp3);
-    register vector signed short line3 = vec_sub(temp2, temp3);
-    register vector signed short line4 = vec_add(temp4, temp5);
-    register vector signed short line5 = vec_sub(temp4, temp5);
-    register vector signed short line6 = vec_add(temp6, temp7);
-    register vector signed short line7 = vec_sub(temp6, temp7);
-
-    register vector signed short line0B = vec_add(line0, line2);
-    register vector signed short line2B = vec_sub(line0, line2);
-    register vector signed short line1B = vec_add(line1, line3);
-    register vector signed short line3B = vec_sub(line1, line3);
-    register vector signed short line4B = vec_add(line4, line6);
-    register vector signed short line6B = vec_sub(line4, line6);
-    register vector signed short line5B = vec_add(line5, line7);
-    register vector signed short line7B = vec_sub(line5, line7);
-
-    register vector signed short line0C = vec_add(line0B, line4B);
-    register vector signed short line4C = vec_sub(line0B, line4B);
-    register vector signed short line1C = vec_add(line1B, line5B);
-    register vector signed short line5C = vec_sub(line1B, line5B);
-    register vector signed short line2C = vec_add(line2B, line6B);
-    register vector signed short line6C = vec_sub(line2B, line6B);
-    register vector signed short line3C = vec_add(line3B, line7B);
-    register vector signed short line7C = vec_sub(line3B, line7B);
-
-    vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
-    vsum = vec_sum4s(vec_abs(line1C), vsum);
-    vsum = vec_sum4s(vec_abs(line2C), vsum);
-    vsum = vec_sum4s(vec_abs(line3C), vsum);
-    vsum = vec_sum4s(vec_abs(line4C), vsum);
-    vsum = vec_sum4s(vec_abs(line5C), vsum);
-    vsum = vec_sum4s(vec_abs(line6C), vsum);
-    vsum = vec_sum4s(vec_abs(line7C), vsum);
-    vsum = vec_sums(vsum, (vector signed int)vzero);
-    vsum = vec_splat(vsum, 3);
-    vec_ste(vsum, 0, &sum);
-    }
-    return sum;
-}
-
-/*
-16x8 works with 16 elements; it allows to avoid replicating loads, and
-give the compiler more rooms for scheduling.  It's only used from
-inside hadamard8_diff16_altivec.
-
-Unfortunately, it seems gcc-3.3 is a bit dumb, and the compiled code has a LOT
-of spill code, it seems gcc (unlike xlc) cannot keep everything in registers
-by itself. The following code include hand-made registers allocation. It's not
-clean, but on a 7450 the resulting code is much faster (best case fall from
-700+ cycles to 550).
-
-xlc doesn't add spill code, but it doesn't know how to schedule for the 7450,
-and its code isn't much faster than gcc-3.3 on the 7450 (but uses 25% less
-instructions...)
-
-On the 970, the hand-made RA is still a win (around 690 vs. around 780), but
-xlc goes to around 660 on the regular C code...
-*/
-
-static int hadamard8_diff16x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h) {
-    int sum;
-    register vector signed short
-        temp0 __asm__ ("v0"),
-        temp1 __asm__ ("v1"),
-        temp2 __asm__ ("v2"),
-        temp3 __asm__ ("v3"),
-        temp4 __asm__ ("v4"),
-        temp5 __asm__ ("v5"),
-        temp6 __asm__ ("v6"),
-        temp7 __asm__ ("v7");
-    register vector signed short
-        temp0S __asm__ ("v8"),
-        temp1S __asm__ ("v9"),
-        temp2S __asm__ ("v10"),
-        temp3S __asm__ ("v11"),
-        temp4S __asm__ ("v12"),
-        temp5S __asm__ ("v13"),
-        temp6S __asm__ ("v14"),
-        temp7S __asm__ ("v15");
-    register const vector unsigned char vzero __asm__ ("v31") =
-        (const vector unsigned char)vec_splat_u8(0);
-    {
-    register const vector signed short vprod1 __asm__ ("v16") =
-        (const vector signed short){ 1,-1, 1,-1, 1,-1, 1,-1 };
-    register const vector signed short vprod2 __asm__ ("v17") =
-        (const vector signed short){ 1, 1,-1,-1, 1, 1,-1,-1 };
-    register const vector signed short vprod3 __asm__ ("v18") =
-        (const vector signed short){ 1, 1, 1, 1,-1,-1,-1,-1 };
-    register const vector unsigned char perm1 __asm__ ("v19") =
-        (const vector unsigned char)
-        {0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
-         0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D};
-    register const vector unsigned char perm2 __asm__ ("v20") =
-        (const vector unsigned char)
-        {0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
-         0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B};
-    register const vector unsigned char perm3 __asm__ ("v21") =
-        (const vector unsigned char)
-        {0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-         0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-#define ONEITERBUTTERFLY(i, res1, res2)                               \
-    {                                                                 \
-    register vector unsigned char src1 __asm__ ("v22"),               \
-                                  src2 __asm__ ("v23"),               \
-                                  dst1 __asm__ ("v24"),               \
-                                  dst2 __asm__ ("v25"),               \
-                                  srcO __asm__ ("v22"),               \
-                                  dstO __asm__ ("v23");               \
-                                                                      \
-    register vector signed short  srcV  __asm__ ("v24"),              \
-                                  dstV  __asm__ ("v25"),              \
-                                  srcW  __asm__ ("v26"),              \
-                                  dstW  __asm__ ("v27"),              \
-                                  but0  __asm__ ("v28"),              \
-                                  but0S __asm__ ("v29"),              \
-                                  op1   __asm__ ("v30"),              \
-                                  but1  __asm__ ("v22"),              \
-                                  op1S  __asm__ ("v23"),              \
-                                  but1S __asm__ ("v24"),              \
-                                  op2   __asm__ ("v25"),              \
-                                  but2  __asm__ ("v26"),              \
-                                  op2S  __asm__ ("v27"),              \
-                                  but2S __asm__ ("v28"),              \
-                                  op3   __asm__ ("v29"),              \
-                                  op3S  __asm__ ("v30");              \
-                                                                      \
-    src1 = vec_ld(stride * i, src);                                   \
-    src2 = vec_ld((stride * i) + 16, src);                            \
-    srcO = vec_perm(src1, src2, vec_lvsl(stride * i, src));           \
-    dst1 = vec_ld(stride * i, dst);                                   \
-    dst2 = vec_ld((stride * i) + 16, dst);                            \
-    dstO = vec_perm(dst1, dst2, vec_lvsl(stride * i, dst));           \
-    /* promote the unsigned chars to signed shorts */                 \
-    srcV = (vector signed short)vec_mergeh((vector signed char)vzero, \
-           (vector signed char)srcO);                                 \
-    dstV = (vector signed short)vec_mergeh((vector signed char)vzero, \
-           (vector signed char)dstO);                                 \
-    srcW = (vector signed short)vec_mergel((vector signed char)vzero, \
-           (vector signed char)srcO);                                 \
-    dstW = (vector signed short)vec_mergel((vector signed char)vzero, \
-           (vector signed char)dstO);                                 \
-    /* subtractions inside the first butterfly */                     \
-    but0 = vec_sub(srcV, dstV);                                       \
-    but0S = vec_sub(srcW, dstW);                                      \
-    op1 = vec_perm(but0, but0, perm1);                                \
-    but1 = vec_mladd(but0, vprod1, op1);                              \
-    op1S = vec_perm(but0S, but0S, perm1);                             \
-    but1S = vec_mladd(but0S, vprod1, op1S);                           \
-    op2 = vec_perm(but1, but1, perm2);                                \
-    but2 = vec_mladd(but1, vprod2, op2);                              \
-    op2S = vec_perm(but1S, but1S, perm2);                             \
-    but2S = vec_mladd(but1S, vprod2, op2S);                           \
-    op3 = vec_perm(but2, but2, perm3);                                \
-    res1 = vec_mladd(but2, vprod3, op3);                              \
-    op3S = vec_perm(but2S, but2S, perm3);                             \
-    res2 = vec_mladd(but2S, vprod3, op3S);                            \
-    }
-    ONEITERBUTTERFLY(0, temp0, temp0S);
-    ONEITERBUTTERFLY(1, temp1, temp1S);
-    ONEITERBUTTERFLY(2, temp2, temp2S);
-    ONEITERBUTTERFLY(3, temp3, temp3S);
-    ONEITERBUTTERFLY(4, temp4, temp4S);
-    ONEITERBUTTERFLY(5, temp5, temp5S);
-    ONEITERBUTTERFLY(6, temp6, temp6S);
-    ONEITERBUTTERFLY(7, temp7, temp7S);
-    }
-#undef ONEITERBUTTERFLY
-    {
-    register vector signed int vsum;
-    register vector signed short line0S, line1S, line2S, line3S, line4S,
-                                 line5S, line6S, line7S, line0BS,line2BS,
-                                 line1BS,line3BS,line4BS,line6BS,line5BS,
-                                 line7BS,line0CS,line4CS,line1CS,line5CS,
-                                 line2CS,line6CS,line3CS,line7CS;
-
-    register vector signed short line0 = vec_add(temp0, temp1);
-    register vector signed short line1 = vec_sub(temp0, temp1);
-    register vector signed short line2 = vec_add(temp2, temp3);
-    register vector signed short line3 = vec_sub(temp2, temp3);
-    register vector signed short line4 = vec_add(temp4, temp5);
-    register vector signed short line5 = vec_sub(temp4, temp5);
-    register vector signed short line6 = vec_add(temp6, temp7);
-    register vector signed short line7 = vec_sub(temp6, temp7);
-
-    register vector signed short line0B = vec_add(line0, line2);
-    register vector signed short line2B = vec_sub(line0, line2);
-    register vector signed short line1B = vec_add(line1, line3);
-    register vector signed short line3B = vec_sub(line1, line3);
-    register vector signed short line4B = vec_add(line4, line6);
-    register vector signed short line6B = vec_sub(line4, line6);
-    register vector signed short line5B = vec_add(line5, line7);
-    register vector signed short line7B = vec_sub(line5, line7);
-
-    register vector signed short line0C = vec_add(line0B, line4B);
-    register vector signed short line4C = vec_sub(line0B, line4B);
-    register vector signed short line1C = vec_add(line1B, line5B);
-    register vector signed short line5C = vec_sub(line1B, line5B);
-    register vector signed short line2C = vec_add(line2B, line6B);
-    register vector signed short line6C = vec_sub(line2B, line6B);
-    register vector signed short line3C = vec_add(line3B, line7B);
-    register vector signed short line7C = vec_sub(line3B, line7B);
-
-    vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
-    vsum = vec_sum4s(vec_abs(line1C), vsum);
-    vsum = vec_sum4s(vec_abs(line2C), vsum);
-    vsum = vec_sum4s(vec_abs(line3C), vsum);
-    vsum = vec_sum4s(vec_abs(line4C), vsum);
-    vsum = vec_sum4s(vec_abs(line5C), vsum);
-    vsum = vec_sum4s(vec_abs(line6C), vsum);
-    vsum = vec_sum4s(vec_abs(line7C), vsum);
-
-    line0S = vec_add(temp0S, temp1S);
-    line1S = vec_sub(temp0S, temp1S);
-    line2S = vec_add(temp2S, temp3S);
-    line3S = vec_sub(temp2S, temp3S);
-    line4S = vec_add(temp4S, temp5S);
-    line5S = vec_sub(temp4S, temp5S);
-    line6S = vec_add(temp6S, temp7S);
-    line7S = vec_sub(temp6S, temp7S);
-
-    line0BS = vec_add(line0S, line2S);
-    line2BS = vec_sub(line0S, line2S);
-    line1BS = vec_add(line1S, line3S);
-    line3BS = vec_sub(line1S, line3S);
-    line4BS = vec_add(line4S, line6S);
-    line6BS = vec_sub(line4S, line6S);
-    line5BS = vec_add(line5S, line7S);
-    line7BS = vec_sub(line5S, line7S);
-
-    line0CS = vec_add(line0BS, line4BS);
-    line4CS = vec_sub(line0BS, line4BS);
-    line1CS = vec_add(line1BS, line5BS);
-    line5CS = vec_sub(line1BS, line5BS);
-    line2CS = vec_add(line2BS, line6BS);
-    line6CS = vec_sub(line2BS, line6BS);
-    line3CS = vec_add(line3BS, line7BS);
-    line7CS = vec_sub(line3BS, line7BS);
-
-    vsum = vec_sum4s(vec_abs(line0CS), vsum);
-    vsum = vec_sum4s(vec_abs(line1CS), vsum);
-    vsum = vec_sum4s(vec_abs(line2CS), vsum);
-    vsum = vec_sum4s(vec_abs(line3CS), vsum);
-    vsum = vec_sum4s(vec_abs(line4CS), vsum);
-    vsum = vec_sum4s(vec_abs(line5CS), vsum);
-    vsum = vec_sum4s(vec_abs(line6CS), vsum);
-    vsum = vec_sum4s(vec_abs(line7CS), vsum);
-    vsum = vec_sums(vsum, (vector signed int)vzero);
-    vsum = vec_splat(vsum, 3);
-    vec_ste(vsum, 0, &sum);
-    }
-    return sum;
-}
-
-static int hadamard8_diff16_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
-    int score;
-    score = hadamard8_diff16x8_altivec(s, dst, src, stride, 8);
-    if (h==16) {
-        dst += 8*stride;
-        src += 8*stride;
-        score += hadamard8_diff16x8_altivec(s, dst, src, stride, 8);
-    }
-    return score;
-}
-
-av_cold void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx)
-{
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    c->pix_abs[0][1] = sad16_x2_altivec;
-    c->pix_abs[0][2] = sad16_y2_altivec;
-    c->pix_abs[0][3] = sad16_xy2_altivec;
-    c->pix_abs[0][0] = sad16_altivec;
-    c->pix_abs[1][0] = sad8_altivec;
-    c->sad[0]= sad16_altivec;
-    c->sad[1]= sad8_altivec;
-    c->pix_norm1 = pix_norm1_altivec;
-    c->sse[1]= sse8_altivec;
-    c->sse[0]= sse16_altivec;
-    c->pix_sum = pix_sum_altivec;
-    c->diff_pixels = diff_pixels_altivec;
-    c->add_bytes= add_bytes_altivec;
-    if (!high_bit_depth) {
-    c->get_pixels = get_pixels_altivec;
-    c->clear_block = clear_block_altivec;
-    }
-
-    c->hadamard8_diff[0] = hadamard8_diff16_altivec;
-    c->hadamard8_diff[1] = hadamard8_diff8x8_altivec;
-}
diff --git a/deps/libav/libavcodec/ppc/dsputil_altivec.h b/deps/libav/libavcodec/ppc/dsputil_altivec.h
deleted file mode 100644
index de5054b..0000000
--- a/deps/libav/libavcodec/ppc/dsputil_altivec.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002 Brian Foley
- * Copyright (c) 2002 Dieter Shirley
- * Copyright (c) 2003-2004 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PPC_DSPUTIL_ALTIVEC_H
-#define AVCODEC_PPC_DSPUTIL_ALTIVEC_H
-
-#include <stdint.h>
-#include "libavcodec/dsputil.h"
-
-void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-
-void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-
-void ff_fdct_altivec(int16_t *block);
-void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
-                     int x16, int y16, int rounder);
-void ff_idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
-void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
-
-void ff_dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx);
-void ff_float_init_altivec(DSPContext* c, AVCodecContext *avctx);
-void ff_int_init_altivec(DSPContext* c, AVCodecContext *avctx);
-
-#endif /* AVCODEC_PPC_DSPUTIL_ALTIVEC_H */
diff --git a/deps/libav/libavcodec/ppc/dsputil_ppc.c b/deps/libav/libavcodec/ppc/dsputil_ppc.c
deleted file mode 100644
index 6ae6e3f..0000000
--- a/deps/libav/libavcodec/ppc/dsputil_ppc.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 2002 Brian Foley
- * Copyright (c) 2002 Dieter Shirley
- * Copyright (c) 2003-2004 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/mem.h"
-#include "libavutil/ppc/cpu.h"
-#include "dsputil_altivec.h"
-
-/* ***** WARNING ***** WARNING ***** WARNING ***** */
-/*
-clear_blocks_dcbz32_ppc will not work properly on PowerPC processors with a
-cache line size not equal to 32 bytes.
-Fortunately all processor used by Apple up to at least the 7450 (aka second
-generation G4) use 32 bytes cache line.
-This is due to the use of the 'dcbz' instruction. It simply clear to zero a
-single cache line, so you need to know the cache line size to use it !
-It's absurd, but it's fast...
-
-update 24/06/2003 : Apple released yesterday the G5, with a PPC970. cache line
-size: 128 bytes. Oups.
-The semantic of dcbz was changed, it always clear 32 bytes. so the function
-below will work, but will be slow. So I fixed check_dcbz_effect to use dcbzl,
-which is defined to clear a cache line (as dcbz before). So we still can
-distinguish, and use dcbz (32 bytes) or dcbzl (one cache line) as required.
-
-see <http://developer.apple.com/technotes/tn/tn2087.html>
-and <http://developer.apple.com/technotes/tn/tn2086.html>
-*/
-static void clear_blocks_dcbz32_ppc(int16_t *blocks)
-{
-    register int misal = ((unsigned long)blocks & 0x00000010);
-    register int i = 0;
-    if (misal) {
-        ((unsigned long*)blocks)[0] = 0L;
-        ((unsigned long*)blocks)[1] = 0L;
-        ((unsigned long*)blocks)[2] = 0L;
-        ((unsigned long*)blocks)[3] = 0L;
-        i += 16;
-    }
-    for ( ; i < sizeof(int16_t)*6*64-31 ; i += 32) {
-        __asm__ volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory");
-    }
-    if (misal) {
-        ((unsigned long*)blocks)[188] = 0L;
-        ((unsigned long*)blocks)[189] = 0L;
-        ((unsigned long*)blocks)[190] = 0L;
-        ((unsigned long*)blocks)[191] = 0L;
-        i += 16;
-    }
-}
-
-/* same as above, when dcbzl clear a whole 128B cache line
-   i.e. the PPC970 aka G5 */
-#if HAVE_DCBZL
-static void clear_blocks_dcbz128_ppc(int16_t *blocks)
-{
-    register int misal = ((unsigned long)blocks & 0x0000007f);
-    register int i = 0;
-    if (misal) {
-        // we could probably also optimize this case,
-        // but there's not much point as the machines
-        // aren't available yet (2003-06-26)
-        memset(blocks, 0, sizeof(int16_t)*6*64);
-    }
-    else
-        for ( ; i < sizeof(int16_t)*6*64 ; i += 128) {
-            __asm__ volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory");
-        }
-}
-#else
-static void clear_blocks_dcbz128_ppc(int16_t *blocks)
-{
-    memset(blocks, 0, sizeof(int16_t)*6*64);
-}
-#endif
-
-#if HAVE_DCBZL
-/* check dcbz report how many bytes are set to 0 by dcbz */
-/* update 24/06/2003 : replace dcbz by dcbzl to get
-   the intended effect (Apple "fixed" dcbz)
-   unfortunately this cannot be used unless the assembler
-   knows about dcbzl ... */
-static long check_dcbzl_effect(void)
-{
-    register char *fakedata = av_malloc(1024);
-    register char *fakedata_middle;
-    register long zero = 0;
-    register long i = 0;
-    long count = 0;
-
-    if (!fakedata) {
-        return 0L;
-    }
-
-    fakedata_middle = (fakedata + 512);
-
-    memset(fakedata, 0xFF, 1024);
-
-    /* below the constraint "b" seems to mean "Address base register"
-       in gcc-3.3 / RS/6000 speaks. seems to avoid using r0, so.... */
-    __asm__ volatile("dcbzl %0, %1" : : "b" (fakedata_middle), "r" (zero));
-
-    for (i = 0; i < 1024 ; i ++) {
-        if (fakedata[i] == (char)0)
-            count++;
-    }
-
-    av_free(fakedata);
-
-    return count;
-}
-#else
-static long check_dcbzl_effect(void)
-{
-  return 0;
-}
-#endif
-
-av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx)
-{
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    // Common optimizations whether AltiVec is available or not
-    if (!high_bit_depth) {
-    switch (check_dcbzl_effect()) {
-        case 32:
-            c->clear_blocks = clear_blocks_dcbz32_ppc;
-            break;
-        case 128:
-            c->clear_blocks = clear_blocks_dcbz128_ppc;
-            break;
-        default:
-            break;
-    }
-    }
-
-    if (PPC_ALTIVEC(av_get_cpu_flags())) {
-        ff_dsputil_init_altivec(c, avctx);
-        ff_int_init_altivec(c, avctx);
-        c->gmc1 = ff_gmc1_altivec;
-
-#if CONFIG_ENCODERS
-        if (avctx->bits_per_raw_sample <= 8 &&
-            (avctx->dct_algo == FF_DCT_AUTO ||
-             avctx->dct_algo == FF_DCT_ALTIVEC)) {
-            c->fdct = ff_fdct_altivec;
-        }
-#endif //CONFIG_ENCODERS
-
-        if (avctx->bits_per_raw_sample <= 8) {
-            if ((avctx->idct_algo == FF_IDCT_AUTO) ||
-                (avctx->idct_algo == FF_IDCT_ALTIVEC)) {
-                c->idct_put = ff_idct_put_altivec;
-                c->idct_add = ff_idct_add_altivec;
-                c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
-            }
-        }
-
-    }
-}
diff --git a/deps/libav/libavcodec/ppc/fdct_altivec.c b/deps/libav/libavcodec/ppc/fdct_altivec.c
deleted file mode 100644
index 355a697..0000000
--- a/deps/libav/libavcodec/ppc/fdct_altivec.c
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * Copyright (C) 2003  James Klicman <james at klicman.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#if HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-#include "libavutil/common.h"
-#include "dsputil_altivec.h"
-
-#define vs16(v) ((vector signed short)(v))
-#define vs32(v) ((vector signed int)(v))
-#define vu8(v)  ((vector unsigned char)(v))
-#define vu16(v) ((vector unsigned short)(v))
-#define vu32(v) ((vector unsigned int)(v))
-
-
-#define C1     0.98078525066375732421875000 /* cos(1*PI/16) */
-#define C2     0.92387950420379638671875000 /* cos(2*PI/16) */
-#define C3     0.83146959543228149414062500 /* cos(3*PI/16) */
-#define C4     0.70710676908493041992187500 /* cos(4*PI/16) */
-#define C5     0.55557024478912353515625000 /* cos(5*PI/16) */
-#define C6     0.38268342614173889160156250 /* cos(6*PI/16) */
-#define C7     0.19509032368659973144531250 /* cos(7*PI/16) */
-#define SQRT_2 1.41421353816986083984375000 /* sqrt(2)      */
-
-
-#define W0 -(2 * C2)
-#define W1 (2 * C6)
-#define W2 (SQRT_2 * C6)
-#define W3 (SQRT_2 * C3)
-#define W4 (SQRT_2 * (-C1 + C3 + C5 - C7))
-#define W5 (SQRT_2 * ( C1 + C3 - C5 + C7))
-#define W6 (SQRT_2 * ( C1 + C3 + C5 - C7))
-#define W7 (SQRT_2 * ( C1 + C3 - C5 - C7))
-#define W8 (SQRT_2 * ( C7 - C3))
-#define W9 (SQRT_2 * (-C1 - C3))
-#define WA (SQRT_2 * (-C3 - C5))
-#define WB (SQRT_2 * ( C5 - C3))
-
-
-static vector float fdctconsts[3] = {
-    { W0, W1, W2, W3 },
-    { W4, W5, W6, W7 },
-    { W8, W9, WA, WB }
-};
-
-#define LD_W0 vec_splat(cnsts0, 0)
-#define LD_W1 vec_splat(cnsts0, 1)
-#define LD_W2 vec_splat(cnsts0, 2)
-#define LD_W3 vec_splat(cnsts0, 3)
-#define LD_W4 vec_splat(cnsts1, 0)
-#define LD_W5 vec_splat(cnsts1, 1)
-#define LD_W6 vec_splat(cnsts1, 2)
-#define LD_W7 vec_splat(cnsts1, 3)
-#define LD_W8 vec_splat(cnsts2, 0)
-#define LD_W9 vec_splat(cnsts2, 1)
-#define LD_WA vec_splat(cnsts2, 2)
-#define LD_WB vec_splat(cnsts2, 3)
-
-
-#define FDCTROW(b0,b1,b2,b3,b4,b5,b6,b7) /* {{{ */                  \
-    x0 = vec_add(b0, b7);               /* x0 = b0 + b7; */         \
-    x7 = vec_sub(b0, b7);               /* x7 = b0 - b7; */         \
-    x1 = vec_add(b1, b6);               /* x1 = b1 + b6; */         \
-    x6 = vec_sub(b1, b6);               /* x6 = b1 - b6; */         \
-    x2 = vec_add(b2, b5);               /* x2 = b2 + b5; */         \
-    x5 = vec_sub(b2, b5);               /* x5 = b2 - b5; */         \
-    x3 = vec_add(b3, b4);               /* x3 = b3 + b4; */         \
-    x4 = vec_sub(b3, b4);               /* x4 = b3 - b4; */         \
-                                                                    \
-    b7 = vec_add(x0, x3);               /* b7 = x0 + x3; */         \
-    b1 = vec_add(x1, x2);               /* b1 = x1 + x2; */         \
-    b0 = vec_add(b7, b1);               /* b0 = b7 + b1; */         \
-    b4 = vec_sub(b7, b1);               /* b4 = b7 - b1; */         \
-                                                                    \
-    b2 = vec_sub(x0, x3);               /* b2 = x0 - x3; */         \
-    b6 = vec_sub(x1, x2);               /* b6 = x1 - x2; */         \
-    b5 = vec_add(b6, b2);               /* b5 = b6 + b2; */         \
-    cnst = LD_W2;                                                   \
-    b5 = vec_madd(cnst, b5, mzero);     /* b5 = b5 * W2; */         \
-    cnst = LD_W1;                                                   \
-    b2 = vec_madd(cnst, b2, b5);        /* b2 = b5 + b2 * W1; */    \
-    cnst = LD_W0;                                                   \
-    b6 = vec_madd(cnst, b6, b5);        /* b6 = b5 + b6 * W0; */    \
-                                                                    \
-    x0 = vec_add(x4, x7);               /* x0 = x4 + x7; */         \
-    x1 = vec_add(x5, x6);               /* x1 = x5 + x6; */         \
-    x2 = vec_add(x4, x6);               /* x2 = x4 + x6; */         \
-    x3 = vec_add(x5, x7);               /* x3 = x5 + x7; */         \
-    x8 = vec_add(x2, x3);               /* x8 = x2 + x3; */         \
-    cnst = LD_W3;                                                   \
-    x8 = vec_madd(cnst, x8, mzero);     /* x8 = x8 * W3; */         \
-                                                                    \
-    cnst = LD_W8;                                                   \
-    x0 = vec_madd(cnst, x0, mzero);     /* x0 *= W8; */             \
-    cnst = LD_W9;                                                   \
-    x1 = vec_madd(cnst, x1, mzero);     /* x1 *= W9; */             \
-    cnst = LD_WA;                                                   \
-    x2 = vec_madd(cnst, x2, x8);        /* x2 = x2 * WA + x8; */    \
-    cnst = LD_WB;                                                   \
-    x3 = vec_madd(cnst, x3, x8);        /* x3 = x3 * WB + x8; */    \
-                                                                    \
-    cnst = LD_W4;                                                   \
-    b7 = vec_madd(cnst, x4, x0);        /* b7 = x4 * W4 + x0; */    \
-    cnst = LD_W5;                                                   \
-    b5 = vec_madd(cnst, x5, x1);        /* b5 = x5 * W5 + x1; */    \
-    cnst = LD_W6;                                                   \
-    b3 = vec_madd(cnst, x6, x1);        /* b3 = x6 * W6 + x1; */    \
-    cnst = LD_W7;                                                   \
-    b1 = vec_madd(cnst, x7, x0);        /* b1 = x7 * W7 + x0; */    \
-                                                                    \
-    b7 = vec_add(b7, x2);               /* b7 = b7 + x2; */         \
-    b5 = vec_add(b5, x3);               /* b5 = b5 + x3; */         \
-    b3 = vec_add(b3, x2);               /* b3 = b3 + x2; */         \
-    b1 = vec_add(b1, x3);               /* b1 = b1 + x3; */         \
-    /* }}} */
-
-#define FDCTCOL(b0,b1,b2,b3,b4,b5,b6,b7) /* {{{ */                  \
-    x0 = vec_add(b0, b7);               /* x0 = b0 + b7; */         \
-    x7 = vec_sub(b0, b7);               /* x7 = b0 - b7; */         \
-    x1 = vec_add(b1, b6);               /* x1 = b1 + b6; */         \
-    x6 = vec_sub(b1, b6);               /* x6 = b1 - b6; */         \
-    x2 = vec_add(b2, b5);               /* x2 = b2 + b5; */         \
-    x5 = vec_sub(b2, b5);               /* x5 = b2 - b5; */         \
-    x3 = vec_add(b3, b4);               /* x3 = b3 + b4; */         \
-    x4 = vec_sub(b3, b4);               /* x4 = b3 - b4; */         \
-                                                                    \
-    b7 = vec_add(x0, x3);               /* b7 = x0 + x3; */         \
-    b1 = vec_add(x1, x2);               /* b1 = x1 + x2; */         \
-    b0 = vec_add(b7, b1);               /* b0 = b7 + b1; */         \
-    b4 = vec_sub(b7, b1);               /* b4 = b7 - b1; */         \
-                                                                    \
-    b2 = vec_sub(x0, x3);               /* b2 = x0 - x3; */         \
-    b6 = vec_sub(x1, x2);               /* b6 = x1 - x2; */         \
-    b5 = vec_add(b6, b2);               /* b5 = b6 + b2; */         \
-    cnst = LD_W2;                                                   \
-    b5 = vec_madd(cnst, b5, mzero);     /* b5 = b5 * W2; */         \
-    cnst = LD_W1;                                                   \
-    b2 = vec_madd(cnst, b2, b5);        /* b2 = b5 + b2 * W1; */    \
-    cnst = LD_W0;                                                   \
-    b6 = vec_madd(cnst, b6, b5);        /* b6 = b5 + b6 * W0; */    \
-                                                                    \
-    x0 = vec_add(x4, x7);               /* x0 = x4 + x7; */         \
-    x1 = vec_add(x5, x6);               /* x1 = x5 + x6; */         \
-    x2 = vec_add(x4, x6);               /* x2 = x4 + x6; */         \
-    x3 = vec_add(x5, x7);               /* x3 = x5 + x7; */         \
-    x8 = vec_add(x2, x3);               /* x8 = x2 + x3; */         \
-    cnst = LD_W3;                                                   \
-    x8 = vec_madd(cnst, x8, mzero);     /* x8 = x8 * W3; */         \
-                                                                    \
-    cnst = LD_W8;                                                   \
-    x0 = vec_madd(cnst, x0, mzero);     /* x0 *= W8; */             \
-    cnst = LD_W9;                                                   \
-    x1 = vec_madd(cnst, x1, mzero);     /* x1 *= W9; */             \
-    cnst = LD_WA;                                                   \
-    x2 = vec_madd(cnst, x2, x8);        /* x2 = x2 * WA + x8; */    \
-    cnst = LD_WB;                                                   \
-    x3 = vec_madd(cnst, x3, x8);        /* x3 = x3 * WB + x8; */    \
-                                                                    \
-    cnst = LD_W4;                                                   \
-    b7 = vec_madd(cnst, x4, x0);        /* b7 = x4 * W4 + x0; */    \
-    cnst = LD_W5;                                                   \
-    b5 = vec_madd(cnst, x5, x1);        /* b5 = x5 * W5 + x1; */    \
-    cnst = LD_W6;                                                   \
-    b3 = vec_madd(cnst, x6, x1);        /* b3 = x6 * W6 + x1; */    \
-    cnst = LD_W7;                                                   \
-    b1 = vec_madd(cnst, x7, x0);        /* b1 = x7 * W7 + x0; */    \
-                                                                    \
-    b7 = vec_add(b7, x2);               /* b7 += x2; */             \
-    b5 = vec_add(b5, x3);               /* b5 += x3; */             \
-    b3 = vec_add(b3, x2);               /* b3 += x2; */             \
-    b1 = vec_add(b1, x3);               /* b1 += x3; */             \
-    /* }}} */
-
-
-
-/* two dimensional discrete cosine transform */
-
-void ff_fdct_altivec(int16_t *block)
-{
-    vector signed short *bp;
-    vector float *cp;
-    vector float b00, b10, b20, b30, b40, b50, b60, b70;
-    vector float b01, b11, b21, b31, b41, b51, b61, b71;
-    vector float mzero, cnst, cnsts0, cnsts1, cnsts2;
-    vector float x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
-    /* setup constants {{{ */
-    /* mzero = -0.0 */
-    mzero = ((vector float)vec_splat_u32(-1));
-    mzero = ((vector float)vec_sl(vu32(mzero), vu32(mzero)));
-    cp = fdctconsts;
-    cnsts0 = vec_ld(0, cp); cp++;
-    cnsts1 = vec_ld(0, cp); cp++;
-    cnsts2 = vec_ld(0, cp);
-    /* }}} */
-
-
-    /* 8x8 matrix transpose (vector short[8]) {{{ */
-#define MERGE_S16(hl,a,b) vec_merge##hl(vs16(a), vs16(b))
-
-    bp = (vector signed short*)block;
-    b00 = ((vector float)vec_ld(0,    bp));
-    b40 = ((vector float)vec_ld(16*4, bp));
-    b01 = ((vector float)MERGE_S16(h, b00, b40));
-    b11 = ((vector float)MERGE_S16(l, b00, b40));
-    bp++;
-    b10 = ((vector float)vec_ld(0,    bp));
-    b50 = ((vector float)vec_ld(16*4, bp));
-    b21 = ((vector float)MERGE_S16(h, b10, b50));
-    b31 = ((vector float)MERGE_S16(l, b10, b50));
-    bp++;
-    b20 = ((vector float)vec_ld(0,    bp));
-    b60 = ((vector float)vec_ld(16*4, bp));
-    b41 = ((vector float)MERGE_S16(h, b20, b60));
-    b51 = ((vector float)MERGE_S16(l, b20, b60));
-    bp++;
-    b30 = ((vector float)vec_ld(0,    bp));
-    b70 = ((vector float)vec_ld(16*4, bp));
-    b61 = ((vector float)MERGE_S16(h, b30, b70));
-    b71 = ((vector float)MERGE_S16(l, b30, b70));
-
-    x0 = ((vector float)MERGE_S16(h, b01, b41));
-    x1 = ((vector float)MERGE_S16(l, b01, b41));
-    x2 = ((vector float)MERGE_S16(h, b11, b51));
-    x3 = ((vector float)MERGE_S16(l, b11, b51));
-    x4 = ((vector float)MERGE_S16(h, b21, b61));
-    x5 = ((vector float)MERGE_S16(l, b21, b61));
-    x6 = ((vector float)MERGE_S16(h, b31, b71));
-    x7 = ((vector float)MERGE_S16(l, b31, b71));
-
-    b00 = ((vector float)MERGE_S16(h, x0, x4));
-    b10 = ((vector float)MERGE_S16(l, x0, x4));
-    b20 = ((vector float)MERGE_S16(h, x1, x5));
-    b30 = ((vector float)MERGE_S16(l, x1, x5));
-    b40 = ((vector float)MERGE_S16(h, x2, x6));
-    b50 = ((vector float)MERGE_S16(l, x2, x6));
-    b60 = ((vector float)MERGE_S16(h, x3, x7));
-    b70 = ((vector float)MERGE_S16(l, x3, x7));
-
-#undef MERGE_S16
-    /* }}} */
-
-
-/* Some of the initial calculations can be done as vector short before
- * conversion to vector float.  The following code section takes advantage
- * of this.
- */
-    /* fdct rows {{{ */
-    x0 = ((vector float)vec_add(vs16(b00), vs16(b70)));
-    x7 = ((vector float)vec_sub(vs16(b00), vs16(b70)));
-    x1 = ((vector float)vec_add(vs16(b10), vs16(b60)));
-    x6 = ((vector float)vec_sub(vs16(b10), vs16(b60)));
-    x2 = ((vector float)vec_add(vs16(b20), vs16(b50)));
-    x5 = ((vector float)vec_sub(vs16(b20), vs16(b50)));
-    x3 = ((vector float)vec_add(vs16(b30), vs16(b40)));
-    x4 = ((vector float)vec_sub(vs16(b30), vs16(b40)));
-
-    b70 = ((vector float)vec_add(vs16(x0), vs16(x3)));
-    b10 = ((vector float)vec_add(vs16(x1), vs16(x2)));
-
-    b00 = ((vector float)vec_add(vs16(b70), vs16(b10)));
-    b40 = ((vector float)vec_sub(vs16(b70), vs16(b10)));
-
-#define CTF0(n) \
-    b##n##1 = ((vector float)vec_unpackl(vs16(b##n##0))); \
-    b##n##0 = ((vector float)vec_unpackh(vs16(b##n##0))); \
-    b##n##1 = vec_ctf(vs32(b##n##1), 0); \
-    b##n##0 = vec_ctf(vs32(b##n##0), 0);
-
-    CTF0(0);
-    CTF0(4);
-
-    b20 = ((vector float)vec_sub(vs16(x0), vs16(x3)));
-    b60 = ((vector float)vec_sub(vs16(x1), vs16(x2)));
-
-    CTF0(2);
-    CTF0(6);
-
-#undef CTF0
-
-    x0 = vec_add(b60, b20);
-    x1 = vec_add(b61, b21);
-
-    cnst = LD_W2;
-    x0 = vec_madd(cnst, x0, mzero);
-    x1 = vec_madd(cnst, x1, mzero);
-    cnst = LD_W1;
-    b20 = vec_madd(cnst, b20, x0);
-    b21 = vec_madd(cnst, b21, x1);
-    cnst = LD_W0;
-    b60 = vec_madd(cnst, b60, x0);
-    b61 = vec_madd(cnst, b61, x1);
-
-#define CTFX(x,b) \
-    b##0 = ((vector float)vec_unpackh(vs16(x))); \
-    b##1 = ((vector float)vec_unpackl(vs16(x))); \
-    b##0 = vec_ctf(vs32(b##0), 0); \
-    b##1 = vec_ctf(vs32(b##1), 0); \
-
-    CTFX(x4, b7);
-    CTFX(x5, b5);
-    CTFX(x6, b3);
-    CTFX(x7, b1);
-
-#undef CTFX
-
-
-    x0 = vec_add(b70, b10);
-    x1 = vec_add(b50, b30);
-    x2 = vec_add(b70, b30);
-    x3 = vec_add(b50, b10);
-    x8 = vec_add(x2, x3);
-    cnst = LD_W3;
-    x8 = vec_madd(cnst, x8, mzero);
-
-    cnst = LD_W8;
-    x0 = vec_madd(cnst, x0, mzero);
-    cnst = LD_W9;
-    x1 = vec_madd(cnst, x1, mzero);
-    cnst = LD_WA;
-    x2 = vec_madd(cnst, x2, x8);
-    cnst = LD_WB;
-    x3 = vec_madd(cnst, x3, x8);
-
-    cnst = LD_W4;
-    b70 = vec_madd(cnst, b70, x0);
-    cnst = LD_W5;
-    b50 = vec_madd(cnst, b50, x1);
-    cnst = LD_W6;
-    b30 = vec_madd(cnst, b30, x1);
-    cnst = LD_W7;
-    b10 = vec_madd(cnst, b10, x0);
-
-    b70 = vec_add(b70, x2);
-    b50 = vec_add(b50, x3);
-    b30 = vec_add(b30, x2);
-    b10 = vec_add(b10, x3);
-
-
-    x0 = vec_add(b71, b11);
-    x1 = vec_add(b51, b31);
-    x2 = vec_add(b71, b31);
-    x3 = vec_add(b51, b11);
-    x8 = vec_add(x2, x3);
-    cnst = LD_W3;
-    x8 = vec_madd(cnst, x8, mzero);
-
-    cnst = LD_W8;
-    x0 = vec_madd(cnst, x0, mzero);
-    cnst = LD_W9;
-    x1 = vec_madd(cnst, x1, mzero);
-    cnst = LD_WA;
-    x2 = vec_madd(cnst, x2, x8);
-    cnst = LD_WB;
-    x3 = vec_madd(cnst, x3, x8);
-
-    cnst = LD_W4;
-    b71 = vec_madd(cnst, b71, x0);
-    cnst = LD_W5;
-    b51 = vec_madd(cnst, b51, x1);
-    cnst = LD_W6;
-    b31 = vec_madd(cnst, b31, x1);
-    cnst = LD_W7;
-    b11 = vec_madd(cnst, b11, x0);
-
-    b71 = vec_add(b71, x2);
-    b51 = vec_add(b51, x3);
-    b31 = vec_add(b31, x2);
-    b11 = vec_add(b11, x3);
-    /* }}} */
-
-
-    /* 8x8 matrix transpose (vector float[8][2]) {{{ */
-    x0 = vec_mergel(b00, b20);
-    x1 = vec_mergeh(b00, b20);
-    x2 = vec_mergel(b10, b30);
-    x3 = vec_mergeh(b10, b30);
-
-    b00 = vec_mergeh(x1, x3);
-    b10 = vec_mergel(x1, x3);
-    b20 = vec_mergeh(x0, x2);
-    b30 = vec_mergel(x0, x2);
-
-    x4 = vec_mergel(b41, b61);
-    x5 = vec_mergeh(b41, b61);
-    x6 = vec_mergel(b51, b71);
-    x7 = vec_mergeh(b51, b71);
-
-    b41 = vec_mergeh(x5, x7);
-    b51 = vec_mergel(x5, x7);
-    b61 = vec_mergeh(x4, x6);
-    b71 = vec_mergel(x4, x6);
-
-    x0 = vec_mergel(b01, b21);
-    x1 = vec_mergeh(b01, b21);
-    x2 = vec_mergel(b11, b31);
-    x3 = vec_mergeh(b11, b31);
-
-    x4 = vec_mergel(b40, b60);
-    x5 = vec_mergeh(b40, b60);
-    x6 = vec_mergel(b50, b70);
-    x7 = vec_mergeh(b50, b70);
-
-    b40 = vec_mergeh(x1, x3);
-    b50 = vec_mergel(x1, x3);
-    b60 = vec_mergeh(x0, x2);
-    b70 = vec_mergel(x0, x2);
-
-    b01 = vec_mergeh(x5, x7);
-    b11 = vec_mergel(x5, x7);
-    b21 = vec_mergeh(x4, x6);
-    b31 = vec_mergel(x4, x6);
-    /* }}} */
-
-
-    FDCTCOL(b00, b10, b20, b30, b40, b50, b60, b70);
-    FDCTCOL(b01, b11, b21, b31, b41, b51, b61, b71);
-
-
-    /* round, convert back to short {{{ */
-#define CTS(n) \
-    b##n##0 = vec_round(b##n##0); \
-    b##n##1 = vec_round(b##n##1); \
-    b##n##0 = ((vector float)vec_cts(b##n##0, 0)); \
-    b##n##1 = ((vector float)vec_cts(b##n##1, 0)); \
-    b##n##0 = ((vector float)vec_pack(vs32(b##n##0), vs32(b##n##1))); \
-    vec_st(vs16(b##n##0), 0, bp);
-
-    bp = (vector signed short*)block;
-    CTS(0); bp++;
-    CTS(1); bp++;
-    CTS(2); bp++;
-    CTS(3); bp++;
-    CTS(4); bp++;
-    CTS(5); bp++;
-    CTS(6); bp++;
-    CTS(7);
-
-#undef CTS
-    /* }}} */
-}
diff --git a/deps/libav/libavcodec/ppc/fft_altivec.c b/deps/libav/libavcodec/ppc/fft_altivec.c
deleted file mode 100644
index 2885d3f..0000000
--- a/deps/libav/libavcodec/ppc/fft_altivec.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * FFT/IFFT transforms
- * AltiVec-enabled
- * Copyright (c) 2009 Loren Merritt
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/fft.h"
-
-/**
- * Do a complex FFT with the parameters defined in ff_fft_init(). The
- * input data must be permuted before with s->revtab table. No
- * 1.0/sqrt(n) normalization is done.
- * AltiVec-enabled
- * This code assumes that the 'z' pointer is 16 bytes-aligned
- * It also assumes all FFTComplex are 8 bytes-aligned pair of float
- */
-
-void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_interleave_altivec(FFTContext *s, FFTComplex *z);
-
-#if HAVE_GNU_AS && HAVE_ALTIVEC
-static void imdct_half_altivec(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    int j, k;
-    int n = 1 << s->mdct_bits;
-    int n4 = n >> 2;
-    int n8 = n >> 3;
-    int n32 = n >> 5;
-    const uint16_t *revtabj = s->revtab;
-    const uint16_t *revtabk = s->revtab+n4;
-    const vec_f *tcos = (const vec_f*)(s->tcos+n8);
-    const vec_f *tsin = (const vec_f*)(s->tsin+n8);
-    const vec_f *pin = (const vec_f*)(input+n4);
-    vec_f *pout = (vec_f*)(output+n4);
-
-    /* pre rotation */
-    k = n32-1;
-    do {
-        vec_f cos,sin,cos0,sin0,cos1,sin1,re,im,r0,i0,r1,i1,a,b,c,d;
-#define CMULA(p,o0,o1,o2,o3)\
-        a = pin[ k*2+p];                       /* { z[k].re,    z[k].im,    z[k+1].re,  z[k+1].im  } */\
-        b = pin[-k*2-p-1];                     /* { z[-k-2].re, z[-k-2].im, z[-k-1].re, z[-k-1].im } */\
-        re = vec_perm(a, b, vcprm(0,2,s0,s2)); /* { z[k].re,    z[k+1].re,  z[-k-2].re, z[-k-1].re } */\
-        im = vec_perm(a, b, vcprm(s3,s1,3,1)); /* { z[-k-1].im, z[-k-2].im, z[k+1].im,  z[k].im    } */\
-        cos = vec_perm(cos0, cos1, vcprm(o0,o1,s##o2,s##o3)); /* { cos[k], cos[k+1], cos[-k-2], cos[-k-1] } */\
-        sin = vec_perm(sin0, sin1, vcprm(o0,o1,s##o2,s##o3));\
-        r##p = im*cos - re*sin;\
-        i##p = re*cos + im*sin;
-#define STORE2(v,dst)\
-        j = dst;\
-        vec_ste(v, 0, output+j*2);\
-        vec_ste(v, 4, output+j*2);
-#define STORE8(p)\
-        a = vec_perm(r##p, i##p, vcprm(0,s0,0,s0));\
-        b = vec_perm(r##p, i##p, vcprm(1,s1,1,s1));\
-        c = vec_perm(r##p, i##p, vcprm(2,s2,2,s2));\
-        d = vec_perm(r##p, i##p, vcprm(3,s3,3,s3));\
-        STORE2(a, revtabk[ p*2-4]);\
-        STORE2(b, revtabk[ p*2-3]);\
-        STORE2(c, revtabj[-p*2+2]);\
-        STORE2(d, revtabj[-p*2+3]);
-
-        cos0 = tcos[k];
-        sin0 = tsin[k];
-        cos1 = tcos[-k-1];
-        sin1 = tsin[-k-1];
-        CMULA(0, 0,1,2,3);
-        CMULA(1, 2,3,0,1);
-        STORE8(0);
-        STORE8(1);
-        revtabj += 4;
-        revtabk -= 4;
-        k--;
-    } while(k >= 0);
-
-    ff_fft_calc_altivec(s, (FFTComplex*)output);
-
-    /* post rotation + reordering */
-    j = -n32;
-    k = n32-1;
-    do {
-        vec_f cos,sin,re,im,a,b,c,d;
-#define CMULB(d0,d1,o)\
-        re = pout[o*2];\
-        im = pout[o*2+1];\
-        cos = tcos[o];\
-        sin = tsin[o];\
-        d0 = im*sin - re*cos;\
-        d1 = re*sin + im*cos;
-
-        CMULB(a,b,j);
-        CMULB(c,d,k);
-        pout[2*j]   = vec_perm(a, d, vcprm(0,s3,1,s2));
-        pout[2*j+1] = vec_perm(a, d, vcprm(2,s1,3,s0));
-        pout[2*k]   = vec_perm(c, b, vcprm(0,s3,1,s2));
-        pout[2*k+1] = vec_perm(c, b, vcprm(2,s1,3,s0));
-        j++;
-        k--;
-    } while(k >= 0);
-}
-
-static void imdct_calc_altivec(FFTContext *s, FFTSample *output, const FFTSample *input)
-{
-    int k;
-    int n = 1 << s->mdct_bits;
-    int n4 = n >> 2;
-    int n16 = n >> 4;
-    vec_u32 sign = {1U<<31,1U<<31,1U<<31,1U<<31};
-    vec_u32 *p0 = (vec_u32*)(output+n4);
-    vec_u32 *p1 = (vec_u32*)(output+n4*3);
-
-    imdct_half_altivec(s, output + n4, input);
-
-    for (k = 0; k < n16; k++) {
-        vec_u32 a = p0[k] ^ sign;
-        vec_u32 b = p1[-k-1];
-        p0[-k-1] = vec_perm(a, a, vcprm(3,2,1,0));
-        p1[k]    = vec_perm(b, b, vcprm(3,2,1,0));
-    }
-}
-#endif /* HAVE_GNU_AS && HAVE_ALTIVEC */
-
-av_cold void ff_fft_init_ppc(FFTContext *s)
-{
-#if HAVE_GNU_AS && HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    s->fft_calc   = ff_fft_calc_interleave_altivec;
-    if (s->mdct_bits >= 5) {
-        s->imdct_calc = imdct_calc_altivec;
-        s->imdct_half = imdct_half_altivec;
-    }
-#endif /* HAVE_GNU_AS && HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/fft_altivec_s.S b/deps/libav/libavcodec/ppc/fft_altivec_s.S
deleted file mode 100644
index 958d7df..0000000
--- a/deps/libav/libavcodec/ppc/fft_altivec_s.S
+++ /dev/null
@@ -1,449 +0,0 @@
-/*
- * FFT transform with Altivec optimizations
- * Copyright (c) 2009 Loren Merritt
- *
- * This algorithm (though not any of the implementation details) is
- * based on libdjbfft by D. J. Bernstein.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * These functions are not individually interchangeable with the C versions.
- * While C takes arrays of FFTComplex, Altivec leaves intermediate results
- * in blocks as convenient to the vector size.
- * i.e. {4x real, 4x imaginary, 4x real, ...}
- *
- * I ignore standard calling convention.
- * Instead, the following registers are treated as global constants:
- * v14: zero
- * v15..v18: cosines
- * v19..v29: permutations
- * r9: 16
- * r12: ff_cos_tabs
- * and the rest are free for local use.
- */
-
-#include "config.h"
-#include "asm.S"
-
-.text
-
-.macro addi2 ra, imm // add 32-bit immediate
-.if \imm & 0xffff
-    addi \ra, \ra, \imm at l
-.endif
-.if (\imm+0x8000)>>16
-    addis \ra, \ra, \imm at ha
-.endif
-.endm
-
-.macro FFT4 a0, a1, a2, a3 // in:0-1 out:2-3
-    vperm   \a2,\a0,\a1,v20 // vcprm(0,1,s2,s1) // {r0,i0,r3,i2}
-    vperm   \a3,\a0,\a1,v21 // vcprm(2,3,s0,s3) // {r1,i1,r2,i3}
-    vaddfp  \a0,\a2,\a3                         // {t1,t2,t6,t5}
-    vsubfp  \a1,\a2,\a3                         // {t3,t4,t8,t7}
-    vmrghw  \a2,\a0,\a1     // vcprm(0,s0,1,s1) // {t1,t3,t2,t4}
-    vperm   \a3,\a0,\a1,v22 // vcprm(2,s3,3,s2) // {t6,t7,t5,t8}
-    vaddfp  \a0,\a2,\a3                         // {r0,r1,i0,i1}
-    vsubfp  \a1,\a2,\a3                         // {r2,r3,i2,i3}
-    vperm   \a2,\a0,\a1,v23 // vcprm(0,1,s0,s1) // {r0,r1,r2,r3}
-    vperm   \a3,\a0,\a1,v24 // vcprm(2,3,s2,s3) // {i0,i1,i2,i3}
-.endm
-
-.macro FFT4x2 a0, a1, b0, b1, a2, a3, b2, b3
-    vperm   \a2,\a0,\a1,v20 // vcprm(0,1,s2,s1) // {r0,i0,r3,i2}
-    vperm   \a3,\a0,\a1,v21 // vcprm(2,3,s0,s3) // {r1,i1,r2,i3}
-    vperm   \b2,\b0,\b1,v20
-    vperm   \b3,\b0,\b1,v21
-    vaddfp  \a0,\a2,\a3                         // {t1,t2,t6,t5}
-    vsubfp  \a1,\a2,\a3                         // {t3,t4,t8,t7}
-    vaddfp  \b0,\b2,\b3
-    vsubfp  \b1,\b2,\b3
-    vmrghw  \a2,\a0,\a1     // vcprm(0,s0,1,s1) // {t1,t3,t2,t4}
-    vperm   \a3,\a0,\a1,v22 // vcprm(2,s3,3,s2) // {t6,t7,t5,t8}
-    vmrghw  \b2,\b0,\b1
-    vperm   \b3,\b0,\b1,v22
-    vaddfp  \a0,\a2,\a3                         // {r0,r1,i0,i1}
-    vsubfp  \a1,\a2,\a3                         // {r2,r3,i2,i3}
-    vaddfp  \b0,\b2,\b3
-    vsubfp  \b1,\b2,\b3
-    vperm   \a2,\a0,\a1,v23 // vcprm(0,1,s0,s1) // {r0,r1,r2,r3}
-    vperm   \a3,\a0,\a1,v24 // vcprm(2,3,s2,s3) // {i0,i1,i2,i3}
-    vperm   \b2,\b0,\b1,v23
-    vperm   \b3,\b0,\b1,v24
-.endm
-
-.macro FFT8 a0, a1, b0, b1, a2, a3, b2, b3, b4 // in,out:a0-b1
-    vmrghw  \b2,\b0,\b1     // vcprm(0,s0,1,s1) // {r4,r6,i4,i6}
-    vmrglw  \b3,\b0,\b1     // vcprm(2,s2,3,s3) // {r5,r7,i5,i7}
-    vperm   \a2,\a0,\a1,v20         // FFT4 ...
-    vperm   \a3,\a0,\a1,v21
-    vaddfp  \b0,\b2,\b3                         // {t1,t3,t2,t4}
-    vsubfp  \b1,\b2,\b3                         // {r5,r7,i5,i7}
-    vperm   \b4,\b1,\b1,v25 // vcprm(2,3,0,1)   // {i5,i7,r5,r7}
-    vaddfp  \a0,\a2,\a3
-    vsubfp  \a1,\a2,\a3
-    vmaddfp \b1,\b1,v17,v14 // * {-1,1,1,-1}/sqrt(2)
-    vmaddfp \b1,\b4,v18,\b1 // * { 1,1,1,1 }/sqrt(2) // {t8,ta,t7,t9}
-    vmrghw  \a2,\a0,\a1
-    vperm   \a3,\a0,\a1,v22
-    vperm   \b2,\b0,\b1,v26 // vcprm(1,2,s3,s0) // {t3,t2,t9,t8}
-    vperm   \b3,\b0,\b1,v27 // vcprm(0,3,s2,s1) // {t1,t4,t7,ta}
-    vaddfp  \a0,\a2,\a3
-    vsubfp  \a1,\a2,\a3
-    vaddfp  \b0,\b2,\b3                         // {t1,t2,t9,ta}
-    vsubfp  \b1,\b2,\b3                         // {t6,t5,tc,tb}
-    vperm   \a2,\a0,\a1,v23
-    vperm   \a3,\a0,\a1,v24
-    vperm   \b2,\b0,\b1,v28 // vcprm(0,2,s1,s3) // {t1,t9,t5,tb}
-    vperm   \b3,\b0,\b1,v29 // vcprm(1,3,s0,s2) // {t2,ta,t6,tc}
-    vsubfp  \b0,\a2,\b2                         // {r4,r5,r6,r7}
-    vsubfp  \b1,\a3,\b3                         // {i4,i5,i6,i7}
-    vaddfp  \a0,\a2,\b2                         // {r0,r1,r2,r3}
-    vaddfp  \a1,\a3,\b3                         // {i0,i1,i2,i3}
-.endm
-
-.macro BF d0,d1,s0,s1
-    vsubfp  \d1,\s0,\s1
-    vaddfp  \d0,\s0,\s1
-.endm
-
-.macro zip d0,d1,s0,s1
-    vmrghw  \d0,\s0,\s1
-    vmrglw  \d1,\s0,\s1
-.endm
-
-.macro def_fft4 interleave
-fft4\interleave\()_altivec:
-    lvx    v0, 0,r3
-    lvx    v1,r9,r3
-    FFT4   v0,v1,v2,v3
-.ifnb \interleave
-    zip    v0,v1,v2,v3
-    stvx   v0, 0,r3
-    stvx   v1,r9,r3
-.else
-    stvx   v2, 0,r3
-    stvx   v3,r9,r3
-.endif
-    blr
-.endm
-
-.macro def_fft8 interleave
-fft8\interleave\()_altivec:
-    addi   r4,r3,32
-    lvx    v0, 0,r3
-    lvx    v1,r9,r3
-    lvx    v2, 0,r4
-    lvx    v3,r9,r4
-    FFT8   v0,v1,v2,v3,v4,v5,v6,v7,v8
-.ifnb \interleave
-    zip    v4,v5,v0,v1
-    zip    v6,v7,v2,v3
-    stvx   v4, 0,r3
-    stvx   v5,r9,r3
-    stvx   v6, 0,r4
-    stvx   v7,r9,r4
-.else
-    stvx   v0, 0,r3
-    stvx   v1,r9,r3
-    stvx   v2, 0,r4
-    stvx   v3,r9,r4
-.endif
-    blr
-.endm
-
-.macro def_fft16 interleave
-fft16\interleave\()_altivec:
-    addi   r5,r3,64
-    addi   r6,r3,96
-    addi   r4,r3,32
-    lvx    v0, 0,r5
-    lvx    v1,r9,r5
-    lvx    v2, 0,r6
-    lvx    v3,r9,r6
-    FFT4x2 v0,v1,v2,v3,v4,v5,v6,v7
-    lvx    v0, 0,r3
-    lvx    v1,r9,r3
-    lvx    v2, 0,r4
-    lvx    v3,r9,r4
-    FFT8   v0,v1,v2,v3,v8,v9,v10,v11,v12
-    vmaddfp   v8,v4,v15,v14 // r2*wre
-    vmaddfp   v9,v5,v15,v14 // i2*wre
-    vmaddfp  v10,v6,v15,v14 // r3*wre
-    vmaddfp  v11,v7,v15,v14 // i3*wre
-    vmaddfp   v8,v5,v16,v8  // i2*wim
-    vnmsubfp  v9,v4,v16,v9  // r2*wim
-    vnmsubfp v10,v7,v16,v10 // i3*wim
-    vmaddfp  v11,v6,v16,v11 // r3*wim
-    BF     v10,v12,v10,v8
-    BF     v11,v13,v9,v11
-    BF     v0,v4,v0,v10
-    BF     v3,v7,v3,v12
-    BF     v1,v5,v1,v11
-    BF     v2,v6,v2,v13
-.ifnb \interleave
-    zip     v8, v9,v0,v1
-    zip    v10,v11,v2,v3
-    zip    v12,v13,v4,v5
-    zip    v14,v15,v6,v7
-    stvx    v8, 0,r3
-    stvx    v9,r9,r3
-    stvx   v10, 0,r4
-    stvx   v11,r9,r4
-    stvx   v12, 0,r5
-    stvx   v13,r9,r5
-    stvx   v14, 0,r6
-    stvx   v15,r9,r6
-.else
-    stvx   v0, 0,r3
-    stvx   v4, 0,r5
-    stvx   v3,r9,r4
-    stvx   v7,r9,r6
-    stvx   v1,r9,r3
-    stvx   v5,r9,r5
-    stvx   v2, 0,r4
-    stvx   v6, 0,r6
-.endif
-    blr
-.endm
-
-// void pass(float *z, float *wre, int n)
-.macro PASS interleave, suffix
-fft_pass\suffix\()_altivec:
-    mtctr  r5
-    slwi   r0,r5,4
-    slwi   r7,r5,6   // o2
-    slwi   r5,r5,5   // o1
-    add   r10,r5,r7  // o3
-    add    r0,r4,r0  // wim
-    addi   r6,r5,16  // o1+16
-    addi   r8,r7,16  // o2+16
-    addi  r11,r10,16 // o3+16
-1:
-    lvx    v8, 0,r4  // wre
-    lvx   v10, 0,r0  // wim
-    sub    r0,r0,r9
-    lvx    v9, 0,r0
-    vperm  v9,v9,v10,v19   // vcprm(s0,3,2,1) => wim[0 .. -3]
-    lvx    v4,r3,r7        // r2 = z[o2]
-    lvx    v5,r3,r8        // i2 = z[o2+16]
-    lvx    v6,r3,r10       // r3 = z[o3]
-    lvx    v7,r3,r11       // i3 = z[o3+16]
-    vmaddfp  v10,v4,v8,v14 // r2*wre
-    vmaddfp  v11,v5,v8,v14 // i2*wre
-    vmaddfp  v12,v6,v8,v14 // r3*wre
-    vmaddfp  v13,v7,v8,v14 // i3*wre
-    lvx    v0, 0,r3        // r0 = z[0]
-    lvx    v3,r3,r6        // i1 = z[o1+16]
-    vmaddfp  v10,v5,v9,v10 // i2*wim
-    vnmsubfp v11,v4,v9,v11 // r2*wim
-    vnmsubfp v12,v7,v9,v12 // i3*wim
-    vmaddfp  v13,v6,v9,v13 // r3*wim
-    lvx    v1,r3,r9        // i0 = z[16]
-    lvx    v2,r3,r5        // r1 = z[o1]
-    BF     v12,v8,v12,v10
-    BF     v13,v9,v11,v13
-    BF     v0,v4,v0,v12
-    BF     v3,v7,v3,v8
-.if !\interleave
-    stvx   v0, 0,r3
-    stvx   v4,r3,r7
-    stvx   v3,r3,r6
-    stvx   v7,r3,r11
-.endif
-    BF     v1,v5,v1,v13
-    BF     v2,v6,v2,v9
-.if !\interleave
-    stvx   v1,r3,r9
-    stvx   v2,r3,r5
-    stvx   v5,r3,r8
-    stvx   v6,r3,r10
-.else
-    vmrghw v8,v0,v1
-    vmrglw v9,v0,v1
-    stvx   v8, 0,r3
-    stvx   v9,r3,r9
-    vmrghw v8,v2,v3
-    vmrglw v9,v2,v3
-    stvx   v8,r3,r5
-    stvx   v9,r3,r6
-    vmrghw v8,v4,v5
-    vmrglw v9,v4,v5
-    stvx   v8,r3,r7
-    stvx   v9,r3,r8
-    vmrghw v8,v6,v7
-    vmrglw v9,v6,v7
-    stvx   v8,r3,r10
-    stvx   v9,r3,r11
-.endif
-    addi   r3,r3,32
-    addi   r4,r4,16
-    bdnz 1b
-    sub    r3,r3,r5
-    blr
-.endm
-
-#define M_SQRT1_2      0.70710678118654752440  /* 1/sqrt(2) */
-
-#define WORD_0  0x00,0x01,0x02,0x03
-#define WORD_1  0x04,0x05,0x06,0x07
-#define WORD_2  0x08,0x09,0x0a,0x0b
-#define WORD_3  0x0c,0x0d,0x0e,0x0f
-#define WORD_s0 0x10,0x11,0x12,0x13
-#define WORD_s1 0x14,0x15,0x16,0x17
-#define WORD_s2 0x18,0x19,0x1a,0x1b
-#define WORD_s3 0x1c,0x1d,0x1e,0x1f
-
-#define vcprm(a, b, c, d) .byte WORD_##a, WORD_##b, WORD_##c, WORD_##d
-
-    .rodata
-    .align 4
-fft_data:
-    .float  0, 0, 0, 0
-    .float  1, 0.92387953, M_SQRT1_2, 0.38268343
-    .float  0, 0.38268343, M_SQRT1_2, 0.92387953
-    .float  -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2,-M_SQRT1_2
-    .float   M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2
-    vcprm(s0,3,2,1)
-    vcprm(0,1,s2,s1)
-    vcprm(2,3,s0,s3)
-    vcprm(2,s3,3,s2)
-    vcprm(0,1,s0,s1)
-    vcprm(2,3,s2,s3)
-    vcprm(2,3,0,1)
-    vcprm(1,2,s3,s0)
-    vcprm(0,3,s2,s1)
-    vcprm(0,2,s1,s3)
-    vcprm(1,3,s0,s2)
-
-.macro lvm  b, r, regs:vararg
-    lvx     \r, 0, \b
-    addi    \b, \b, 16
-  .ifnb \regs
-    lvm     \b, \regs
-  .endif
-.endm
-
-.macro stvm b, r, regs:vararg
-    stvx    \r, 0, \b
-    addi    \b, \b, 16
-  .ifnb \regs
-    stvm    \b, \regs
-  .endif
-.endm
-
-.macro fft_calc interleave
-extfunc ff_fft_calc\interleave\()_altivec
-    mflr    r0
-    stp     r0, 2*PS(r1)
-    stpu    r1, -(160+16*PS)(r1)
-    get_got r11
-    addi    r6, r1, 16*PS
-    stvm    r6, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29
-    mfvrsave r0
-    stw     r0, 15*PS(r1)
-    li      r6, 0xfffffffc
-    mtvrsave r6
-
-    movrel  r6, fft_data, r11
-    lvm     r6, v14, v15, v16, v17, v18, v19, v20, v21
-    lvm     r6, v22, v23, v24, v25, v26, v27, v28, v29
-
-    li      r9, 16
-    movrel  r12, X(ff_cos_tabs), r11
-
-    movrel  r6, fft_dispatch_tab\interleave\()_altivec, r11
-    lwz     r3, 0(r3)
-    subi    r3, r3, 2
-    slwi    r3, r3, 2+ARCH_PPC64
-    lpx     r3, r3, r6
-    mtctr   r3
-    mr      r3, r4
-    bctrl
-
-    addi    r6, r1, 16*PS
-    lvm     r6, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29
-    lwz     r6, 15*PS(r1)
-    mtvrsave r6
-    lp      r1, 0(r1)
-    lp      r0, 2*PS(r1)
-    mtlr    r0
-    blr
-.endm
-
-.macro DECL_FFT suffix, bits, n, n2, n4
-fft\n\suffix\()_altivec:
-    mflr  r0
-    stp   r0,PS*(\bits-3)(r1)
-    bl    fft\n2\()_altivec
-    addi2 r3,\n*4
-    bl    fft\n4\()_altivec
-    addi2 r3,\n*2
-    bl    fft\n4\()_altivec
-    addi2 r3,\n*-6
-    lp    r0,PS*(\bits-3)(r1)
-    lp    r4,\bits*PS(r12)
-    mtlr  r0
-    li    r5,\n/16
-    b     fft_pass\suffix\()_altivec
-.endm
-
-.macro DECL_FFTS interleave, suffix
-    .text
-    def_fft4  \suffix
-    def_fft8  \suffix
-    def_fft16 \suffix
-    PASS \interleave, \suffix
-    DECL_FFT \suffix, 5,   32,   16,    8
-    DECL_FFT \suffix, 6,   64,   32,   16
-    DECL_FFT \suffix, 7,  128,   64,   32
-    DECL_FFT \suffix, 8,  256,  128,   64
-    DECL_FFT \suffix, 9,  512,  256,  128
-    DECL_FFT \suffix,10, 1024,  512,  256
-    DECL_FFT \suffix,11, 2048, 1024,  512
-    DECL_FFT \suffix,12, 4096, 2048, 1024
-    DECL_FFT \suffix,13, 8192, 4096, 2048
-    DECL_FFT \suffix,14,16384, 8192, 4096
-    DECL_FFT \suffix,15,32768,16384, 8192
-    DECL_FFT \suffix,16,65536,32768,16384
-
-    fft_calc \suffix
-
-    .rodata
-    .align 3
-fft_dispatch_tab\suffix\()_altivec:
-    PTR fft4\suffix\()_altivec
-    PTR fft8\suffix\()_altivec
-    PTR fft16\suffix\()_altivec
-    PTR fft32\suffix\()_altivec
-    PTR fft64\suffix\()_altivec
-    PTR fft128\suffix\()_altivec
-    PTR fft256\suffix\()_altivec
-    PTR fft512\suffix\()_altivec
-    PTR fft1024\suffix\()_altivec
-    PTR fft2048\suffix\()_altivec
-    PTR fft4096\suffix\()_altivec
-    PTR fft8192\suffix\()_altivec
-    PTR fft16384\suffix\()_altivec
-    PTR fft32768\suffix\()_altivec
-    PTR fft65536\suffix\()_altivec
-.endm
-
-DECL_FFTS 0
-DECL_FFTS 1, _interleave
diff --git a/deps/libav/libavcodec/ppc/fmtconvert_altivec.c b/deps/libav/libavcodec/ppc/fmtconvert_altivec.c
deleted file mode 100644
index 1359259..0000000
--- a/deps/libav/libavcodec/ppc/fmtconvert_altivec.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2006 Luca Barbato <lu_zero at gentoo.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/mem.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/fmtconvert.h"
-#include "dsputil_altivec.h"
-
-#if HAVE_ALTIVEC
-
-static void int32_to_float_fmul_scalar_altivec(float *dst, const int32_t *src,
-                                               float mul, int len)
-{
-    union {
-        vector float v;
-        float s[4];
-    } mul_u;
-    int i;
-    vector float src1, src2, dst1, dst2, mul_v, zero;
-
-    zero = (vector float)vec_splat_u32(0);
-    mul_u.s[0] = mul;
-    mul_v = vec_splat(mul_u.v, 0);
-
-    for (i = 0; i < len; i += 8) {
-        src1 = vec_ctf(vec_ld(0,  src+i), 0);
-        src2 = vec_ctf(vec_ld(16, src+i), 0);
-        dst1 = vec_madd(src1, mul_v, zero);
-        dst2 = vec_madd(src2, mul_v, zero);
-        vec_st(dst1,  0, dst+i);
-        vec_st(dst2, 16, dst+i);
-    }
-}
-
-
-static vector signed short float_to_int16_one_altivec(const float *src)
-{
-    vector float s0 = vec_ld(0, src);
-    vector float s1 = vec_ld(16, src);
-    vector signed int t0 = vec_cts(s0, 0);
-    vector signed int t1 = vec_cts(s1, 0);
-    return vec_packs(t0,t1);
-}
-
-static void float_to_int16_altivec(int16_t *dst, const float *src, long len)
-{
-    int i;
-    vector signed short d0, d1, d;
-    vector unsigned char align;
-    if (((long)dst) & 15) { //FIXME
-        for (i = 0; i < len - 7; i += 8) {
-            d0 = vec_ld(0, dst+i);
-            d  = float_to_int16_one_altivec(src + i);
-            d1 = vec_ld(15, dst+i);
-            d1 = vec_perm(d1, d0, vec_lvsl(0, dst + i));
-            align = vec_lvsr(0, dst + i);
-            d0 = vec_perm(d1, d, align);
-            d1 = vec_perm(d, d1, align);
-            vec_st(d0,  0, dst + i);
-            vec_st(d1, 15, dst + i);
-        }
-    } else {
-        for (i = 0; i < len - 7; i += 8) {
-            d = float_to_int16_one_altivec(src + i);
-            vec_st(d, 0, dst + i);
-        }
-    }
-}
-
-#define VSTE_INC(dst, v, elem, inc) do {                \
-        vector signed short s = vec_splat(v, elem);     \
-        vec_ste(s, 0, dst);                             \
-        dst += inc;                                     \
-    } while (0)
-
-static void float_to_int16_stride_altivec(int16_t *dst, const float *src,
-                                          long len, int stride)
-{
-    int i;
-    vector signed short d;
-
-    for (i = 0; i < len - 7; i += 8) {
-        d = float_to_int16_one_altivec(src + i);
-        VSTE_INC(dst, d, 0, stride);
-        VSTE_INC(dst, d, 1, stride);
-        VSTE_INC(dst, d, 2, stride);
-        VSTE_INC(dst, d, 3, stride);
-        VSTE_INC(dst, d, 4, stride);
-        VSTE_INC(dst, d, 5, stride);
-        VSTE_INC(dst, d, 6, stride);
-        VSTE_INC(dst, d, 7, stride);
-    }
-}
-
-static void float_to_int16_interleave_altivec(int16_t *dst, const float **src,
-                                              long len, int channels)
-{
-    int i;
-    vector signed short d0, d1, d2, c0, c1, t0, t1;
-    vector unsigned char align;
-
-    if (channels == 1)
-        float_to_int16_altivec(dst, src[0], len);
-    else {
-        if (channels == 2) {
-            if (((long)dst) & 15) {
-                for (i = 0; i < len - 7; i += 8) {
-                    d0 = vec_ld(0,  dst + i);
-                    t0 = float_to_int16_one_altivec(src[0] + i);
-                    d1 = vec_ld(31, dst + i);
-                    t1 = float_to_int16_one_altivec(src[1] + i);
-                    c0 = vec_mergeh(t0, t1);
-                    c1 = vec_mergel(t0, t1);
-                    d2 = vec_perm(d1, d0, vec_lvsl(0, dst + i));
-                    align = vec_lvsr(0, dst + i);
-                    d0 = vec_perm(d2, c0, align);
-                    d1 = vec_perm(c0, c1, align);
-                    vec_st(d0,  0, dst + i);
-                    d0 = vec_perm(c1, d2, align);
-                    vec_st(d1, 15, dst + i);
-                    vec_st(d0, 31, dst + i);
-                    dst += 8;
-                }
-            } else {
-                for (i = 0; i < len - 7; i += 8) {
-                    t0 = float_to_int16_one_altivec(src[0] + i);
-                    t1 = float_to_int16_one_altivec(src[1] + i);
-                    d0 = vec_mergeh(t0, t1);
-                    d1 = vec_mergel(t0, t1);
-                    vec_st(d0,  0, dst + i);
-                    vec_st(d1, 16, dst + i);
-                    dst += 8;
-                }
-            }
-        } else {
-            for (i = 0; i < channels; i++)
-                float_to_int16_stride_altivec(dst + i, src[i], len, channels);
-        }
-    }
-}
-
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_fmt_convert_init_ppc(FmtConvertContext *c,
-                                     AVCodecContext *avctx)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_altivec;
-    if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
-        c->float_to_int16 = float_to_int16_altivec;
-        c->float_to_int16_interleave = float_to_int16_interleave_altivec;
-    }
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/gmc_altivec.c b/deps/libav/libavcodec/ppc/gmc_altivec.c
deleted file mode 100644
index 38968dd..0000000
--- a/deps/libav/libavcodec/ppc/gmc_altivec.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * GMC (Global Motion Compensation)
- * AltiVec-enabled
- * Copyright (c) 2003 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mem.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "dsputil_altivec.h"
-
-/*
-  altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8,
-  to preserve proper dst alignment.
-*/
-void ff_gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder)
-{
-    const DECLARE_ALIGNED(16, unsigned short, rounder_a) = rounder;
-    const DECLARE_ALIGNED(16, unsigned short, ABCD)[8] =
-        {
-            (16-x16)*(16-y16), /* A */
-            (   x16)*(16-y16), /* B */
-            (16-x16)*(   y16), /* C */
-            (   x16)*(   y16), /* D */
-            0, 0, 0, 0         /* padding */
-        };
-    register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
-    register const vector unsigned short vcsr8 = (const vector unsigned short)vec_splat_u16(8);
-    register vector unsigned char dstv, dstv2, src_0, src_1, srcvA, srcvB, srcvC, srcvD;
-    register vector unsigned short Av, Bv, Cv, Dv, rounderV, tempA, tempB, tempC, tempD;
-    int i;
-    unsigned long dst_odd = (unsigned long)dst & 0x0000000F;
-    unsigned long src_really_odd = (unsigned long)src & 0x0000000F;
-
-    tempA = vec_ld(0, (const unsigned short*)ABCD);
-    Av = vec_splat(tempA, 0);
-    Bv = vec_splat(tempA, 1);
-    Cv = vec_splat(tempA, 2);
-    Dv = vec_splat(tempA, 3);
-
-    rounderV = vec_splat((vec_u16)vec_lde(0, &rounder_a), 0);
-
-    // we'll be able to pick-up our 9 char elements
-    // at src from those 32 bytes
-    // we load the first batch here, as inside the loop
-    // we can re-use 'src+stride' from one iteration
-    // as the 'src' of the next.
-    src_0 = vec_ld(0, src);
-    src_1 = vec_ld(16, src);
-    srcvA = vec_perm(src_0, src_1, vec_lvsl(0, src));
-
-    if (src_really_odd != 0x0000000F) {
-        // if src & 0xF == 0xF, then (src+1) is properly aligned
-        // on the second vector.
-        srcvB = vec_perm(src_0, src_1, vec_lvsl(1, src));
-    } else {
-        srcvB = src_1;
-    }
-    srcvA = vec_mergeh(vczero, srcvA);
-    srcvB = vec_mergeh(vczero, srcvB);
-
-    for(i=0; i<h; i++) {
-        dst_odd = (unsigned long)dst & 0x0000000F;
-        src_really_odd = (((unsigned long)src) + stride) & 0x0000000F;
-
-        dstv = vec_ld(0, dst);
-
-        // we we'll be able to pick-up our 9 char elements
-        // at src + stride from those 32 bytes
-        // then reuse the resulting 2 vectors srvcC and srcvD
-        // as the next srcvA and srcvB
-        src_0 = vec_ld(stride + 0, src);
-        src_1 = vec_ld(stride + 16, src);
-        srcvC = vec_perm(src_0, src_1, vec_lvsl(stride + 0, src));
-
-        if (src_really_odd != 0x0000000F) {
-            // if src & 0xF == 0xF, then (src+1) is properly aligned
-            // on the second vector.
-            srcvD = vec_perm(src_0, src_1, vec_lvsl(stride + 1, src));
-        } else {
-            srcvD = src_1;
-        }
-
-        srcvC = vec_mergeh(vczero, srcvC);
-        srcvD = vec_mergeh(vczero, srcvD);
-
-
-        // OK, now we (finally) do the math :-)
-        // those four instructions replaces 32 int muls & 32 int adds.
-        // isn't AltiVec nice ?
-        tempA = vec_mladd((vector unsigned short)srcvA, Av, rounderV);
-        tempB = vec_mladd((vector unsigned short)srcvB, Bv, tempA);
-        tempC = vec_mladd((vector unsigned short)srcvC, Cv, tempB);
-        tempD = vec_mladd((vector unsigned short)srcvD, Dv, tempC);
-
-        srcvA = srcvC;
-        srcvB = srcvD;
-
-        tempD = vec_sr(tempD, vcsr8);
-
-        dstv2 = vec_pack(tempD, (vector unsigned short)vczero);
-
-        if (dst_odd) {
-            dstv2 = vec_perm(dstv, dstv2, vcprm(0,1,s0,s1));
-        } else {
-            dstv2 = vec_perm(dstv, dstv2, vcprm(s0,s1,2,3));
-        }
-
-        vec_st(dstv2, 0, dst);
-
-        dst += stride;
-        src += stride;
-    }
-}
diff --git a/deps/libav/libavcodec/ppc/h264chroma_init.c b/deps/libav/libavcodec/ppc/h264chroma_init.c
deleted file mode 100644
index 415a8df..0000000
--- a/deps/libav/libavcodec/ppc/h264chroma_init.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2004 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/h264chroma.h"
-#include "dsputil_altivec.h"
-
-#if HAVE_ALTIVEC
-#define PUT_OP_U8_ALTIVEC(d, s, dst) d = s
-#define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s)
-
-#define OP_U8_ALTIVEC                          PUT_OP_U8_ALTIVEC
-#define PREFIX_h264_chroma_mc8_altivec         put_h264_chroma_mc8_altivec
-#define PREFIX_h264_chroma_mc8_num             altivec_put_h264_chroma_mc8_num
-#include "h264chroma_template.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_h264_chroma_mc8_altivec
-#undef PREFIX_h264_chroma_mc8_num
-
-#define OP_U8_ALTIVEC                          AVG_OP_U8_ALTIVEC
-#define PREFIX_h264_chroma_mc8_altivec         avg_h264_chroma_mc8_altivec
-#define PREFIX_h264_chroma_mc8_num             altivec_avg_h264_chroma_mc8_num
-#include "h264chroma_template.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_h264_chroma_mc8_altivec
-#undef PREFIX_h264_chroma_mc8_num
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_h264chroma_init_ppc(H264ChromaContext *c, int bit_depth)
-{
-#if HAVE_ALTIVEC
-    const int high_bit_depth = bit_depth > 8;
-
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    if (!high_bit_depth) {
-        c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
-        c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec;
-    }
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/h264chroma_template.c b/deps/libav/libavcodec/ppc/h264chroma_template.c
deleted file mode 100644
index 293fef5..0000000
--- a/deps/libav/libavcodec/ppc/h264chroma_template.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright (c) 2004 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mem.h"
-
-/* this code assume that stride % 16 == 0 */
-
-#define CHROMA_MC8_ALTIVEC_CORE(BIAS1, BIAS2) \
-        vsrc2ssH = (vec_s16)vec_mergeh(zero_u8v,(vec_u8)vsrc2uc);\
-        vsrc3ssH = (vec_s16)vec_mergeh(zero_u8v,(vec_u8)vsrc3uc);\
-\
-        psum = vec_mladd(vA, vsrc0ssH, BIAS1);\
-        psum = vec_mladd(vB, vsrc1ssH, psum);\
-        psum = vec_mladd(vC, vsrc2ssH, psum);\
-        psum = vec_mladd(vD, vsrc3ssH, psum);\
-        psum = BIAS2(psum);\
-        psum = vec_sr(psum, v6us);\
-\
-        vdst = vec_ld(0, dst);\
-        ppsum = (vec_u8)vec_pack(psum, psum);\
-        vfdst = vec_perm(vdst, ppsum, fperm);\
-\
-        OP_U8_ALTIVEC(fsum, vfdst, vdst);\
-\
-        vec_st(fsum, 0, dst);\
-\
-        vsrc0ssH = vsrc2ssH;\
-        vsrc1ssH = vsrc3ssH;\
-\
-        dst += stride;\
-        src += stride;
-
-#define CHROMA_MC8_ALTIVEC_CORE_SIMPLE \
-\
-        vsrc0ssH = (vec_s16)vec_mergeh(zero_u8v,(vec_u8)vsrc0uc);\
-        vsrc1ssH = (vec_s16)vec_mergeh(zero_u8v,(vec_u8)vsrc1uc);\
-\
-        psum = vec_mladd(vA, vsrc0ssH, v32ss);\
-        psum = vec_mladd(vE, vsrc1ssH, psum);\
-        psum = vec_sr(psum, v6us);\
-\
-        vdst = vec_ld(0, dst);\
-        ppsum = (vec_u8)vec_pack(psum, psum);\
-        vfdst = vec_perm(vdst, ppsum, fperm);\
-\
-        OP_U8_ALTIVEC(fsum, vfdst, vdst);\
-\
-        vec_st(fsum, 0, dst);\
-\
-        dst += stride;\
-        src += stride;
-
-#define noop(a) a
-#define add28(a) vec_add(v28ss, a)
-
-#ifdef PREFIX_h264_chroma_mc8_altivec
-static void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src,
-                                    int stride, int h, int x, int y) {
-    DECLARE_ALIGNED(16, signed int, ABCD)[4] =
-                        {((8 - x) * (8 - y)),
-                         ((    x) * (8 - y)),
-                         ((8 - x) * (    y)),
-                         ((    x) * (    y))};
-    register int i;
-    vec_u8 fperm;
-    const vec_s32 vABCD = vec_ld(0, ABCD);
-    const vec_s16 vA = vec_splat((vec_s16)vABCD, 1);
-    const vec_s16 vB = vec_splat((vec_s16)vABCD, 3);
-    const vec_s16 vC = vec_splat((vec_s16)vABCD, 5);
-    const vec_s16 vD = vec_splat((vec_s16)vABCD, 7);
-    LOAD_ZERO;
-    const vec_s16 v32ss = vec_sl(vec_splat_s16(1),vec_splat_u16(5));
-    const vec_u16 v6us = vec_splat_u16(6);
-    register int loadSecond = (((unsigned long)src) % 16) <= 7 ? 0 : 1;
-    register int reallyBadAlign = (((unsigned long)src) % 16) == 15 ? 1 : 0;
-
-    vec_u8 vsrcAuc, av_uninit(vsrcBuc), vsrcperm0, vsrcperm1;
-    vec_u8 vsrc0uc, vsrc1uc;
-    vec_s16 vsrc0ssH, vsrc1ssH;
-    vec_u8 vsrcCuc, vsrc2uc, vsrc3uc;
-    vec_s16 vsrc2ssH, vsrc3ssH, psum;
-    vec_u8 vdst, ppsum, vfdst, fsum;
-
-    if (((unsigned long)dst) % 16 == 0) {
-        fperm = (vec_u8){0x10, 0x11, 0x12, 0x13,
-                         0x14, 0x15, 0x16, 0x17,
-                         0x08, 0x09, 0x0A, 0x0B,
-                         0x0C, 0x0D, 0x0E, 0x0F};
-    } else {
-        fperm = (vec_u8){0x00, 0x01, 0x02, 0x03,
-                         0x04, 0x05, 0x06, 0x07,
-                         0x18, 0x19, 0x1A, 0x1B,
-                         0x1C, 0x1D, 0x1E, 0x1F};
-    }
-
-    vsrcAuc = vec_ld(0, src);
-
-    if (loadSecond)
-        vsrcBuc = vec_ld(16, src);
-    vsrcperm0 = vec_lvsl(0, src);
-    vsrcperm1 = vec_lvsl(1, src);
-
-    vsrc0uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm0);
-    if (reallyBadAlign)
-        vsrc1uc = vsrcBuc;
-    else
-        vsrc1uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm1);
-
-    vsrc0ssH = (vec_s16)vec_mergeh(zero_u8v,(vec_u8)vsrc0uc);
-    vsrc1ssH = (vec_s16)vec_mergeh(zero_u8v,(vec_u8)vsrc1uc);
-
-    if (ABCD[3]) {
-        if (!loadSecond) {// -> !reallyBadAlign
-            for (i = 0 ; i < h ; i++) {
-                vsrcCuc = vec_ld(stride + 0, src);
-                vsrc2uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm0);
-                vsrc3uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm1);
-
-                CHROMA_MC8_ALTIVEC_CORE(v32ss, noop)
-            }
-        } else {
-            vec_u8 vsrcDuc;
-            for (i = 0 ; i < h ; i++) {
-                vsrcCuc = vec_ld(stride + 0, src);
-                vsrcDuc = vec_ld(stride + 16, src);
-                vsrc2uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm0);
-                if (reallyBadAlign)
-                    vsrc3uc = vsrcDuc;
-                else
-                    vsrc3uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm1);
-
-                CHROMA_MC8_ALTIVEC_CORE(v32ss, noop)
-            }
-        }
-    } else {
-        const vec_s16 vE = vec_add(vB, vC);
-        if (ABCD[2]) { // x == 0 B == 0
-            if (!loadSecond) {// -> !reallyBadAlign
-                for (i = 0 ; i < h ; i++) {
-                    vsrcCuc = vec_ld(stride + 0, src);
-                    vsrc1uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm0);
-                    CHROMA_MC8_ALTIVEC_CORE_SIMPLE
-
-                    vsrc0uc = vsrc1uc;
-                }
-            } else {
-                vec_u8 vsrcDuc;
-                for (i = 0 ; i < h ; i++) {
-                    vsrcCuc = vec_ld(stride + 0, src);
-                    vsrcDuc = vec_ld(stride + 15, src);
-                    vsrc1uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm0);
-                    CHROMA_MC8_ALTIVEC_CORE_SIMPLE
-
-                    vsrc0uc = vsrc1uc;
-                }
-            }
-        } else { // y == 0 C == 0
-            if (!loadSecond) {// -> !reallyBadAlign
-                for (i = 0 ; i < h ; i++) {
-                    vsrcCuc = vec_ld(0, src);
-                    vsrc0uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm0);
-                    vsrc1uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm1);
-
-                    CHROMA_MC8_ALTIVEC_CORE_SIMPLE
-                }
-            } else {
-                vec_u8 vsrcDuc;
-                for (i = 0 ; i < h ; i++) {
-                    vsrcCuc = vec_ld(0, src);
-                    vsrcDuc = vec_ld(15, src);
-                    vsrc0uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm0);
-                    if (reallyBadAlign)
-                        vsrc1uc = vsrcDuc;
-                    else
-                        vsrc1uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm1);
-
-                    CHROMA_MC8_ALTIVEC_CORE_SIMPLE
-                }
-            }
-        }
-    }
-}
-#endif
-
-/* this code assume that stride % 16 == 0 */
-#ifdef PREFIX_no_rnd_vc1_chroma_mc8_altivec
-static void PREFIX_no_rnd_vc1_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, int stride, int h, int x, int y) {
-   DECLARE_ALIGNED(16, signed int, ABCD)[4] =
-                        {((8 - x) * (8 - y)),
-                         ((    x) * (8 - y)),
-                         ((8 - x) * (    y)),
-                         ((    x) * (    y))};
-    register int i;
-    vec_u8 fperm;
-    const vec_s32 vABCD = vec_ld(0, ABCD);
-    const vec_s16 vA = vec_splat((vec_s16)vABCD, 1);
-    const vec_s16 vB = vec_splat((vec_s16)vABCD, 3);
-    const vec_s16 vC = vec_splat((vec_s16)vABCD, 5);
-    const vec_s16 vD = vec_splat((vec_s16)vABCD, 7);
-    LOAD_ZERO;
-    const vec_s16 v28ss = vec_sub(vec_sl(vec_splat_s16(1),vec_splat_u16(5)),vec_splat_s16(4));
-    const vec_u16 v6us  = vec_splat_u16(6);
-    register int loadSecond     = (((unsigned long)src) % 16) <= 7 ? 0 : 1;
-    register int reallyBadAlign = (((unsigned long)src) % 16) == 15 ? 1 : 0;
-
-    vec_u8 vsrcAuc, av_uninit(vsrcBuc), vsrcperm0, vsrcperm1;
-    vec_u8 vsrc0uc, vsrc1uc;
-    vec_s16 vsrc0ssH, vsrc1ssH;
-    vec_u8 vsrcCuc, vsrc2uc, vsrc3uc;
-    vec_s16 vsrc2ssH, vsrc3ssH, psum;
-    vec_u8 vdst, ppsum, vfdst, fsum;
-
-    if (((unsigned long)dst) % 16 == 0) {
-        fperm = (vec_u8){0x10, 0x11, 0x12, 0x13,
-                         0x14, 0x15, 0x16, 0x17,
-                         0x08, 0x09, 0x0A, 0x0B,
-                         0x0C, 0x0D, 0x0E, 0x0F};
-    } else {
-        fperm = (vec_u8){0x00, 0x01, 0x02, 0x03,
-                         0x04, 0x05, 0x06, 0x07,
-                         0x18, 0x19, 0x1A, 0x1B,
-                         0x1C, 0x1D, 0x1E, 0x1F};
-    }
-
-    vsrcAuc = vec_ld(0, src);
-
-    if (loadSecond)
-        vsrcBuc = vec_ld(16, src);
-    vsrcperm0 = vec_lvsl(0, src);
-    vsrcperm1 = vec_lvsl(1, src);
-
-    vsrc0uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm0);
-    if (reallyBadAlign)
-        vsrc1uc = vsrcBuc;
-    else
-        vsrc1uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm1);
-
-    vsrc0ssH = (vec_s16)vec_mergeh(zero_u8v, (vec_u8)vsrc0uc);
-    vsrc1ssH = (vec_s16)vec_mergeh(zero_u8v, (vec_u8)vsrc1uc);
-
-    if (!loadSecond) {// -> !reallyBadAlign
-        for (i = 0 ; i < h ; i++) {
-
-
-            vsrcCuc = vec_ld(stride + 0, src);
-
-            vsrc2uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm0);
-            vsrc3uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm1);
-
-            CHROMA_MC8_ALTIVEC_CORE(vec_splat_s16(0), add28)
-        }
-    } else {
-        vec_u8 vsrcDuc;
-        for (i = 0 ; i < h ; i++) {
-            vsrcCuc = vec_ld(stride + 0, src);
-            vsrcDuc = vec_ld(stride + 16, src);
-
-            vsrc2uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm0);
-            if (reallyBadAlign)
-                vsrc3uc = vsrcDuc;
-            else
-                vsrc3uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm1);
-
-            CHROMA_MC8_ALTIVEC_CORE(vec_splat_s16(0), add28)
-        }
-    }
-}
-#endif
-
-#undef noop
-#undef add28
-#undef CHROMA_MC8_ALTIVEC_CORE
diff --git a/deps/libav/libavcodec/ppc/h264dsp.c b/deps/libav/libavcodec/ppc/h264dsp.c
deleted file mode 100644
index 93ad436..0000000
--- a/deps/libav/libavcodec/ppc/h264dsp.c
+++ /dev/null
@@ -1,770 +0,0 @@
-/*
- * Copyright (c) 2004 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/h264data.h"
-#include "libavcodec/h264dsp.h"
-
-#if HAVE_ALTIVEC
-
-/****************************************************************************
- * IDCT transform:
- ****************************************************************************/
-
-#define VEC_1D_DCT(vb0,vb1,vb2,vb3,va0,va1,va2,va3)               \
-    /* 1st stage */                                               \
-    vz0 = vec_add(vb0,vb2);       /* temp[0] = Y[0] + Y[2] */     \
-    vz1 = vec_sub(vb0,vb2);       /* temp[1] = Y[0] - Y[2] */     \
-    vz2 = vec_sra(vb1,vec_splat_u16(1));                          \
-    vz2 = vec_sub(vz2,vb3);       /* temp[2] = Y[1].1/2 - Y[3] */ \
-    vz3 = vec_sra(vb3,vec_splat_u16(1));                          \
-    vz3 = vec_add(vb1,vz3);       /* temp[3] = Y[1] + Y[3].1/2 */ \
-    /* 2nd stage: output */                                       \
-    va0 = vec_add(vz0,vz3);       /* x[0] = temp[0] + temp[3] */  \
-    va1 = vec_add(vz1,vz2);       /* x[1] = temp[1] + temp[2] */  \
-    va2 = vec_sub(vz1,vz2);       /* x[2] = temp[1] - temp[2] */  \
-    va3 = vec_sub(vz0,vz3)        /* x[3] = temp[0] - temp[3] */
-
-#define VEC_TRANSPOSE_4(a0,a1,a2,a3,b0,b1,b2,b3) \
-    b0 = vec_mergeh( a0, a0 ); \
-    b1 = vec_mergeh( a1, a0 ); \
-    b2 = vec_mergeh( a2, a0 ); \
-    b3 = vec_mergeh( a3, a0 ); \
-    a0 = vec_mergeh( b0, b2 ); \
-    a1 = vec_mergel( b0, b2 ); \
-    a2 = vec_mergeh( b1, b3 ); \
-    a3 = vec_mergel( b1, b3 ); \
-    b0 = vec_mergeh( a0, a2 ); \
-    b1 = vec_mergel( a0, a2 ); \
-    b2 = vec_mergeh( a1, a3 ); \
-    b3 = vec_mergel( a1, a3 )
-
-#define VEC_LOAD_U8_ADD_S16_STORE_U8(va)                      \
-    vdst_orig = vec_ld(0, dst);                               \
-    vdst = vec_perm(vdst_orig, zero_u8v, vdst_mask);          \
-    vdst_ss = (vec_s16) vec_mergeh(zero_u8v, vdst);         \
-    va = vec_add(va, vdst_ss);                                \
-    va_u8 = vec_packsu(va, zero_s16v);                        \
-    va_u32 = vec_splat((vec_u32)va_u8, 0);                  \
-    vec_ste(va_u32, element, (uint32_t*)dst);
-
-static void h264_idct_add_altivec(uint8_t *dst, int16_t *block, int stride)
-{
-    vec_s16 va0, va1, va2, va3;
-    vec_s16 vz0, vz1, vz2, vz3;
-    vec_s16 vtmp0, vtmp1, vtmp2, vtmp3;
-    vec_u8 va_u8;
-    vec_u32 va_u32;
-    vec_s16 vdst_ss;
-    const vec_u16 v6us = vec_splat_u16(6);
-    vec_u8 vdst, vdst_orig;
-    vec_u8 vdst_mask = vec_lvsl(0, dst);
-    int element = ((unsigned long)dst & 0xf) >> 2;
-    LOAD_ZERO;
-
-    block[0] += 32;  /* add 32 as a DC-level for rounding */
-
-    vtmp0 = vec_ld(0,block);
-    vtmp1 = vec_sld(vtmp0, vtmp0, 8);
-    vtmp2 = vec_ld(16,block);
-    vtmp3 = vec_sld(vtmp2, vtmp2, 8);
-    memset(block, 0, 16 * sizeof(int16_t));
-
-    VEC_1D_DCT(vtmp0,vtmp1,vtmp2,vtmp3,va0,va1,va2,va3);
-    VEC_TRANSPOSE_4(va0,va1,va2,va3,vtmp0,vtmp1,vtmp2,vtmp3);
-    VEC_1D_DCT(vtmp0,vtmp1,vtmp2,vtmp3,va0,va1,va2,va3);
-
-    va0 = vec_sra(va0,v6us);
-    va1 = vec_sra(va1,v6us);
-    va2 = vec_sra(va2,v6us);
-    va3 = vec_sra(va3,v6us);
-
-    VEC_LOAD_U8_ADD_S16_STORE_U8(va0);
-    dst += stride;
-    VEC_LOAD_U8_ADD_S16_STORE_U8(va1);
-    dst += stride;
-    VEC_LOAD_U8_ADD_S16_STORE_U8(va2);
-    dst += stride;
-    VEC_LOAD_U8_ADD_S16_STORE_U8(va3);
-}
-
-#define IDCT8_1D_ALTIVEC(s0, s1, s2, s3, s4, s5, s6, s7,  d0, d1, d2, d3, d4, d5, d6, d7) {\
-    /*        a0  = SRC(0) + SRC(4); */ \
-    vec_s16 a0v = vec_add(s0, s4);    \
-    /*        a2  = SRC(0) - SRC(4); */ \
-    vec_s16 a2v = vec_sub(s0, s4);    \
-    /*        a4  =           (SRC(2)>>1) - SRC(6); */ \
-    vec_s16 a4v = vec_sub(vec_sra(s2, onev), s6);    \
-    /*        a6  =           (SRC(6)>>1) + SRC(2); */ \
-    vec_s16 a6v = vec_add(vec_sra(s6, onev), s2);    \
-    /*        b0  =         a0 + a6; */ \
-    vec_s16 b0v = vec_add(a0v, a6v);  \
-    /*        b2  =         a2 + a4; */ \
-    vec_s16 b2v = vec_add(a2v, a4v);  \
-    /*        b4  =         a2 - a4; */ \
-    vec_s16 b4v = vec_sub(a2v, a4v);  \
-    /*        b6  =         a0 - a6; */ \
-    vec_s16 b6v = vec_sub(a0v, a6v);  \
-    /* a1 =  SRC(5) - SRC(3) - SRC(7) - (SRC(7)>>1); */ \
-    /*        a1 =             (SRC(5)-SRC(3)) -  (SRC(7)  +  (SRC(7)>>1)); */ \
-    vec_s16 a1v = vec_sub( vec_sub(s5, s3), vec_add(s7, vec_sra(s7, onev)) ); \
-    /* a3 =  SRC(7) + SRC(1) - SRC(3) - (SRC(3)>>1); */ \
-    /*        a3 =             (SRC(7)+SRC(1)) -  (SRC(3)  +  (SRC(3)>>1)); */ \
-    vec_s16 a3v = vec_sub( vec_add(s7, s1), vec_add(s3, vec_sra(s3, onev)) );\
-    /* a5 =  SRC(7) - SRC(1) + SRC(5) + (SRC(5)>>1); */ \
-    /*        a5 =             (SRC(7)-SRC(1)) +   SRC(5) +   (SRC(5)>>1); */ \
-    vec_s16 a5v = vec_add( vec_sub(s7, s1), vec_add(s5, vec_sra(s5, onev)) );\
-    /*        a7 =                SRC(5)+SRC(3) +  SRC(1) +   (SRC(1)>>1); */ \
-    vec_s16 a7v = vec_add( vec_add(s5, s3), vec_add(s1, vec_sra(s1, onev)) );\
-    /*        b1 =                  (a7>>2)  +  a1; */ \
-    vec_s16 b1v = vec_add( vec_sra(a7v, twov), a1v); \
-    /*        b3 =          a3 +        (a5>>2); */ \
-    vec_s16 b3v = vec_add(a3v, vec_sra(a5v, twov)); \
-    /*        b5 =                  (a3>>2)  -   a5; */ \
-    vec_s16 b5v = vec_sub( vec_sra(a3v, twov), a5v); \
-    /*        b7 =           a7 -        (a1>>2); */ \
-    vec_s16 b7v = vec_sub( a7v, vec_sra(a1v, twov)); \
-    /* DST(0,    b0 + b7); */ \
-    d0 = vec_add(b0v, b7v); \
-    /* DST(1,    b2 + b5); */ \
-    d1 = vec_add(b2v, b5v); \
-    /* DST(2,    b4 + b3); */ \
-    d2 = vec_add(b4v, b3v); \
-    /* DST(3,    b6 + b1); */ \
-    d3 = vec_add(b6v, b1v); \
-    /* DST(4,    b6 - b1); */ \
-    d4 = vec_sub(b6v, b1v); \
-    /* DST(5,    b4 - b3); */ \
-    d5 = vec_sub(b4v, b3v); \
-    /* DST(6,    b2 - b5); */ \
-    d6 = vec_sub(b2v, b5v); \
-    /* DST(7,    b0 - b7); */ \
-    d7 = vec_sub(b0v, b7v); \
-}
-
-#define ALTIVEC_STORE_SUM_CLIP(dest, idctv, perm_ldv, perm_stv, sel) { \
-    /* unaligned load */                                       \
-    vec_u8 hv = vec_ld( 0, dest );                           \
-    vec_u8 lv = vec_ld( 7, dest );                           \
-    vec_u8 dstv   = vec_perm( hv, lv, (vec_u8)perm_ldv );  \
-    vec_s16 idct_sh6 = vec_sra(idctv, sixv);                 \
-    vec_u16 dst16 = (vec_u16)vec_mergeh(zero_u8v, dstv);   \
-    vec_s16 idstsum = vec_adds(idct_sh6, (vec_s16)dst16);  \
-    vec_u8 idstsum8 = vec_packsu(zero_s16v, idstsum);        \
-    vec_u8 edgehv;                                           \
-    /* unaligned store */                                      \
-    vec_u8 bodyv  = vec_perm( idstsum8, idstsum8, perm_stv );\
-    vec_u8 edgelv = vec_perm( sel, zero_u8v, perm_stv );     \
-    lv    = vec_sel( lv, bodyv, edgelv );                      \
-    vec_st( lv, 7, dest );                                     \
-    hv    = vec_ld( 0, dest );                                 \
-    edgehv = vec_perm( zero_u8v, sel, perm_stv );              \
-    hv    = vec_sel( hv, bodyv, edgehv );                      \
-    vec_st( hv, 0, dest );                                     \
- }
-
-static void h264_idct8_add_altivec(uint8_t *dst, int16_t *dct, int stride)
-{
-    vec_s16 s0, s1, s2, s3, s4, s5, s6, s7;
-    vec_s16 d0, d1, d2, d3, d4, d5, d6, d7;
-    vec_s16 idct0, idct1, idct2, idct3, idct4, idct5, idct6, idct7;
-
-    vec_u8 perm_ldv = vec_lvsl(0, dst);
-    vec_u8 perm_stv = vec_lvsr(8, dst);
-
-    const vec_u16 onev = vec_splat_u16(1);
-    const vec_u16 twov = vec_splat_u16(2);
-    const vec_u16 sixv = vec_splat_u16(6);
-
-    const vec_u8 sel = (vec_u8) {0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1};
-    LOAD_ZERO;
-
-    dct[0] += 32; // rounding for the >>6 at the end
-
-    s0 = vec_ld(0x00, (int16_t*)dct);
-    s1 = vec_ld(0x10, (int16_t*)dct);
-    s2 = vec_ld(0x20, (int16_t*)dct);
-    s3 = vec_ld(0x30, (int16_t*)dct);
-    s4 = vec_ld(0x40, (int16_t*)dct);
-    s5 = vec_ld(0x50, (int16_t*)dct);
-    s6 = vec_ld(0x60, (int16_t*)dct);
-    s7 = vec_ld(0x70, (int16_t*)dct);
-    memset(dct, 0, 64 * sizeof(int16_t));
-
-    IDCT8_1D_ALTIVEC(s0, s1, s2, s3, s4, s5, s6, s7,
-                     d0, d1, d2, d3, d4, d5, d6, d7);
-
-    TRANSPOSE8( d0,  d1,  d2,  d3,  d4,  d5,  d6, d7 );
-
-    IDCT8_1D_ALTIVEC(d0,  d1,  d2,  d3,  d4,  d5,  d6, d7,
-                     idct0, idct1, idct2, idct3, idct4, idct5, idct6, idct7);
-
-    ALTIVEC_STORE_SUM_CLIP(&dst[0*stride], idct0, perm_ldv, perm_stv, sel);
-    ALTIVEC_STORE_SUM_CLIP(&dst[1*stride], idct1, perm_ldv, perm_stv, sel);
-    ALTIVEC_STORE_SUM_CLIP(&dst[2*stride], idct2, perm_ldv, perm_stv, sel);
-    ALTIVEC_STORE_SUM_CLIP(&dst[3*stride], idct3, perm_ldv, perm_stv, sel);
-    ALTIVEC_STORE_SUM_CLIP(&dst[4*stride], idct4, perm_ldv, perm_stv, sel);
-    ALTIVEC_STORE_SUM_CLIP(&dst[5*stride], idct5, perm_ldv, perm_stv, sel);
-    ALTIVEC_STORE_SUM_CLIP(&dst[6*stride], idct6, perm_ldv, perm_stv, sel);
-    ALTIVEC_STORE_SUM_CLIP(&dst[7*stride], idct7, perm_ldv, perm_stv, sel);
-}
-
-static av_always_inline void h264_idct_dc_add_internal(uint8_t *dst, int16_t *block, int stride, int size)
-{
-    vec_s16 dc16;
-    vec_u8 dcplus, dcminus, v0, v1, v2, v3, aligner;
-    LOAD_ZERO;
-    DECLARE_ALIGNED(16, int, dc);
-    int i;
-
-    dc = (block[0] + 32) >> 6;
-    block[0] = 0;
-    dc16 = vec_splat((vec_s16) vec_lde(0, &dc), 1);
-
-    if (size == 4)
-        dc16 = vec_sld(dc16, zero_s16v, 8);
-    dcplus = vec_packsu(dc16, zero_s16v);
-    dcminus = vec_packsu(vec_sub(zero_s16v, dc16), zero_s16v);
-
-    aligner = vec_lvsr(0, dst);
-    dcplus = vec_perm(dcplus, dcplus, aligner);
-    dcminus = vec_perm(dcminus, dcminus, aligner);
-
-    for (i = 0; i < size; i += 4) {
-        v0 = vec_ld(0, dst+0*stride);
-        v1 = vec_ld(0, dst+1*stride);
-        v2 = vec_ld(0, dst+2*stride);
-        v3 = vec_ld(0, dst+3*stride);
-
-        v0 = vec_adds(v0, dcplus);
-        v1 = vec_adds(v1, dcplus);
-        v2 = vec_adds(v2, dcplus);
-        v3 = vec_adds(v3, dcplus);
-
-        v0 = vec_subs(v0, dcminus);
-        v1 = vec_subs(v1, dcminus);
-        v2 = vec_subs(v2, dcminus);
-        v3 = vec_subs(v3, dcminus);
-
-        vec_st(v0, 0, dst+0*stride);
-        vec_st(v1, 0, dst+1*stride);
-        vec_st(v2, 0, dst+2*stride);
-        vec_st(v3, 0, dst+3*stride);
-
-        dst += 4*stride;
-    }
-}
-
-static void h264_idct_dc_add_altivec(uint8_t *dst, int16_t *block, int stride)
-{
-    h264_idct_dc_add_internal(dst, block, stride, 4);
-}
-
-static void h264_idct8_dc_add_altivec(uint8_t *dst, int16_t *block, int stride)
-{
-    h264_idct_dc_add_internal(dst, block, stride, 8);
-}
-
-static void h264_idct_add16_altivec(uint8_t *dst, const int *block_offset,
-                                    int16_t *block, int stride,
-                                    const uint8_t nnzc[15 * 8])
-{
-    int i;
-    for(i=0; i<16; i++){
-        int nnz = nnzc[ scan8[i] ];
-        if(nnz){
-            if(nnz==1 && block[i*16]) h264_idct_dc_add_altivec(dst + block_offset[i], block + i*16, stride);
-            else                      h264_idct_add_altivec(dst + block_offset[i], block + i*16, stride);
-        }
-    }
-}
-
-static void h264_idct_add16intra_altivec(uint8_t *dst, const int *block_offset,
-                                         int16_t *block, int stride,
-                                         const uint8_t nnzc[15 * 8])
-{
-    int i;
-    for(i=0; i<16; i++){
-        if(nnzc[ scan8[i] ]) h264_idct_add_altivec(dst + block_offset[i], block + i*16, stride);
-        else if(block[i*16]) h264_idct_dc_add_altivec(dst + block_offset[i], block + i*16, stride);
-    }
-}
-
-static void h264_idct8_add4_altivec(uint8_t *dst, const int *block_offset,
-                                    int16_t *block, int stride,
-                                    const uint8_t nnzc[15 * 8])
-{
-    int i;
-    for(i=0; i<16; i+=4){
-        int nnz = nnzc[ scan8[i] ];
-        if(nnz){
-            if(nnz==1 && block[i*16]) h264_idct8_dc_add_altivec(dst + block_offset[i], block + i*16, stride);
-            else                      h264_idct8_add_altivec(dst + block_offset[i], block + i*16, stride);
-        }
-    }
-}
-
-static void h264_idct_add8_altivec(uint8_t **dest, const int *block_offset,
-                                   int16_t *block, int stride,
-                                   const uint8_t nnzc[15 * 8])
-{
-    int i, j;
-    for (j = 1; j < 3; j++) {
-        for(i = j * 16; i < j * 16 + 4; i++){
-            if(nnzc[ scan8[i] ])
-                h264_idct_add_altivec(dest[j-1] + block_offset[i], block + i*16, stride);
-            else if(block[i*16])
-                h264_idct_dc_add_altivec(dest[j-1] + block_offset[i], block + i*16, stride);
-        }
-    }
-}
-
-#define transpose4x16(r0, r1, r2, r3) {      \
-    register vec_u8 r4;                    \
-    register vec_u8 r5;                    \
-    register vec_u8 r6;                    \
-    register vec_u8 r7;                    \
-                                             \
-    r4 = vec_mergeh(r0, r2);  /*0, 2 set 0*/ \
-    r5 = vec_mergel(r0, r2);  /*0, 2 set 1*/ \
-    r6 = vec_mergeh(r1, r3);  /*1, 3 set 0*/ \
-    r7 = vec_mergel(r1, r3);  /*1, 3 set 1*/ \
-                                             \
-    r0 = vec_mergeh(r4, r6);  /*all set 0*/  \
-    r1 = vec_mergel(r4, r6);  /*all set 1*/  \
-    r2 = vec_mergeh(r5, r7);  /*all set 2*/  \
-    r3 = vec_mergel(r5, r7);  /*all set 3*/  \
-}
-
-static inline void write16x4(uint8_t *dst, int dst_stride,
-                             register vec_u8 r0, register vec_u8 r1,
-                             register vec_u8 r2, register vec_u8 r3) {
-    DECLARE_ALIGNED(16, unsigned char, result)[64];
-    uint32_t *src_int = (uint32_t *)result, *dst_int = (uint32_t *)dst;
-    int int_dst_stride = dst_stride/4;
-
-    vec_st(r0, 0, result);
-    vec_st(r1, 16, result);
-    vec_st(r2, 32, result);
-    vec_st(r3, 48, result);
-    /* FIXME: there has to be a better way!!!! */
-    *dst_int = *src_int;
-    *(dst_int+   int_dst_stride) = *(src_int + 1);
-    *(dst_int+ 2*int_dst_stride) = *(src_int + 2);
-    *(dst_int+ 3*int_dst_stride) = *(src_int + 3);
-    *(dst_int+ 4*int_dst_stride) = *(src_int + 4);
-    *(dst_int+ 5*int_dst_stride) = *(src_int + 5);
-    *(dst_int+ 6*int_dst_stride) = *(src_int + 6);
-    *(dst_int+ 7*int_dst_stride) = *(src_int + 7);
-    *(dst_int+ 8*int_dst_stride) = *(src_int + 8);
-    *(dst_int+ 9*int_dst_stride) = *(src_int + 9);
-    *(dst_int+10*int_dst_stride) = *(src_int + 10);
-    *(dst_int+11*int_dst_stride) = *(src_int + 11);
-    *(dst_int+12*int_dst_stride) = *(src_int + 12);
-    *(dst_int+13*int_dst_stride) = *(src_int + 13);
-    *(dst_int+14*int_dst_stride) = *(src_int + 14);
-    *(dst_int+15*int_dst_stride) = *(src_int + 15);
-}
-
-/** @brief performs a 6x16 transpose of data in src, and stores it to dst
-    @todo FIXME: see if we can't spare some vec_lvsl() by them factorizing
-    out of unaligned_load() */
-#define readAndTranspose16x6(src, src_stride, r8, r9, r10, r11, r12, r13) {\
-    register vec_u8 r0  = unaligned_load(0,             src);            \
-    register vec_u8 r1  = unaligned_load(   src_stride, src);            \
-    register vec_u8 r2  = unaligned_load(2* src_stride, src);            \
-    register vec_u8 r3  = unaligned_load(3* src_stride, src);            \
-    register vec_u8 r4  = unaligned_load(4* src_stride, src);            \
-    register vec_u8 r5  = unaligned_load(5* src_stride, src);            \
-    register vec_u8 r6  = unaligned_load(6* src_stride, src);            \
-    register vec_u8 r7  = unaligned_load(7* src_stride, src);            \
-    register vec_u8 r14 = unaligned_load(14*src_stride, src);            \
-    register vec_u8 r15 = unaligned_load(15*src_stride, src);            \
-                                                                           \
-    r8  = unaligned_load( 8*src_stride, src);                              \
-    r9  = unaligned_load( 9*src_stride, src);                              \
-    r10 = unaligned_load(10*src_stride, src);                              \
-    r11 = unaligned_load(11*src_stride, src);                              \
-    r12 = unaligned_load(12*src_stride, src);                              \
-    r13 = unaligned_load(13*src_stride, src);                              \
-                                                                           \
-    /*Merge first pairs*/                                                  \
-    r0 = vec_mergeh(r0, r8);    /*0, 8*/                                   \
-    r1 = vec_mergeh(r1, r9);    /*1, 9*/                                   \
-    r2 = vec_mergeh(r2, r10);   /*2,10*/                                   \
-    r3 = vec_mergeh(r3, r11);   /*3,11*/                                   \
-    r4 = vec_mergeh(r4, r12);   /*4,12*/                                   \
-    r5 = vec_mergeh(r5, r13);   /*5,13*/                                   \
-    r6 = vec_mergeh(r6, r14);   /*6,14*/                                   \
-    r7 = vec_mergeh(r7, r15);   /*7,15*/                                   \
-                                                                           \
-    /*Merge second pairs*/                                                 \
-    r8  = vec_mergeh(r0, r4);   /*0,4, 8,12 set 0*/                        \
-    r9  = vec_mergel(r0, r4);   /*0,4, 8,12 set 1*/                        \
-    r10 = vec_mergeh(r1, r5);   /*1,5, 9,13 set 0*/                        \
-    r11 = vec_mergel(r1, r5);   /*1,5, 9,13 set 1*/                        \
-    r12 = vec_mergeh(r2, r6);   /*2,6,10,14 set 0*/                        \
-    r13 = vec_mergel(r2, r6);   /*2,6,10,14 set 1*/                        \
-    r14 = vec_mergeh(r3, r7);   /*3,7,11,15 set 0*/                        \
-    r15 = vec_mergel(r3, r7);   /*3,7,11,15 set 1*/                        \
-                                                                           \
-    /*Third merge*/                                                        \
-    r0 = vec_mergeh(r8,  r12);  /*0,2,4,6,8,10,12,14 set 0*/               \
-    r1 = vec_mergel(r8,  r12);  /*0,2,4,6,8,10,12,14 set 1*/               \
-    r2 = vec_mergeh(r9,  r13);  /*0,2,4,6,8,10,12,14 set 2*/               \
-    r4 = vec_mergeh(r10, r14);  /*1,3,5,7,9,11,13,15 set 0*/               \
-    r5 = vec_mergel(r10, r14);  /*1,3,5,7,9,11,13,15 set 1*/               \
-    r6 = vec_mergeh(r11, r15);  /*1,3,5,7,9,11,13,15 set 2*/               \
-    /* Don't need to compute 3 and 7*/                                     \
-                                                                           \
-    /*Final merge*/                                                        \
-    r8  = vec_mergeh(r0, r4);   /*all set 0*/                              \
-    r9  = vec_mergel(r0, r4);   /*all set 1*/                              \
-    r10 = vec_mergeh(r1, r5);   /*all set 2*/                              \
-    r11 = vec_mergel(r1, r5);   /*all set 3*/                              \
-    r12 = vec_mergeh(r2, r6);   /*all set 4*/                              \
-    r13 = vec_mergel(r2, r6);   /*all set 5*/                              \
-    /* Don't need to compute 14 and 15*/                                   \
-                                                                           \
-}
-
-// out: o = |x-y| < a
-static inline vec_u8 diff_lt_altivec ( register vec_u8 x,
-                                         register vec_u8 y,
-                                         register vec_u8 a) {
-
-    register vec_u8 diff = vec_subs(x, y);
-    register vec_u8 diffneg = vec_subs(y, x);
-    register vec_u8 o = vec_or(diff, diffneg); /* |x-y| */
-    o = (vec_u8)vec_cmplt(o, a);
-    return o;
-}
-
-static inline vec_u8 h264_deblock_mask ( register vec_u8 p0,
-                                           register vec_u8 p1,
-                                           register vec_u8 q0,
-                                           register vec_u8 q1,
-                                           register vec_u8 alpha,
-                                           register vec_u8 beta) {
-
-    register vec_u8 mask;
-    register vec_u8 tempmask;
-
-    mask = diff_lt_altivec(p0, q0, alpha);
-    tempmask = diff_lt_altivec(p1, p0, beta);
-    mask = vec_and(mask, tempmask);
-    tempmask = diff_lt_altivec(q1, q0, beta);
-    mask = vec_and(mask, tempmask);
-
-    return mask;
-}
-
-// out: newp1 = clip((p2 + ((p0 + q0 + 1) >> 1)) >> 1, p1-tc0, p1+tc0)
-static inline vec_u8 h264_deblock_q1(register vec_u8 p0,
-                                       register vec_u8 p1,
-                                       register vec_u8 p2,
-                                       register vec_u8 q0,
-                                       register vec_u8 tc0) {
-
-    register vec_u8 average = vec_avg(p0, q0);
-    register vec_u8 temp;
-    register vec_u8 uncliped;
-    register vec_u8 ones;
-    register vec_u8 max;
-    register vec_u8 min;
-    register vec_u8 newp1;
-
-    temp = vec_xor(average, p2);
-    average = vec_avg(average, p2);     /*avg(p2, avg(p0, q0)) */
-    ones = vec_splat_u8(1);
-    temp = vec_and(temp, ones);         /*(p2^avg(p0, q0)) & 1 */
-    uncliped = vec_subs(average, temp); /*(p2+((p0+q0+1)>>1))>>1 */
-    max = vec_adds(p1, tc0);
-    min = vec_subs(p1, tc0);
-    newp1 = vec_max(min, uncliped);
-    newp1 = vec_min(max, newp1);
-    return newp1;
-}
-
-#define h264_deblock_p0_q0(p0, p1, q0, q1, tc0masked) {                                           \
-                                                                                                  \
-    const vec_u8 A0v = vec_sl(vec_splat_u8(10), vec_splat_u8(4));                               \
-                                                                                                  \
-    register vec_u8 pq0bit = vec_xor(p0,q0);                                                    \
-    register vec_u8 q1minus;                                                                    \
-    register vec_u8 p0minus;                                                                    \
-    register vec_u8 stage1;                                                                     \
-    register vec_u8 stage2;                                                                     \
-    register vec_u8 vec160;                                                                     \
-    register vec_u8 delta;                                                                      \
-    register vec_u8 deltaneg;                                                                   \
-                                                                                                  \
-    q1minus = vec_nor(q1, q1);                 /* 255 - q1 */                                     \
-    stage1 = vec_avg(p1, q1minus);             /* (p1 - q1 + 256)>>1 */                           \
-    stage2 = vec_sr(stage1, vec_splat_u8(1));  /* (p1 - q1 + 256)>>2 = 64 + (p1 - q1) >> 2 */     \
-    p0minus = vec_nor(p0, p0);                 /* 255 - p0 */                                     \
-    stage1 = vec_avg(q0, p0minus);             /* (q0 - p0 + 256)>>1 */                           \
-    pq0bit = vec_and(pq0bit, vec_splat_u8(1));                                                    \
-    stage2 = vec_avg(stage2, pq0bit);          /* 32 + ((q0 - p0)&1 + (p1 - q1) >> 2 + 1) >> 1 */ \
-    stage2 = vec_adds(stage2, stage1);         /* 160 + ((p0 - q0) + (p1 - q1) >> 2 + 1) >> 1 */  \
-    vec160 = vec_ld(0, &A0v);                                                                     \
-    deltaneg = vec_subs(vec160, stage2);       /* -d */                                           \
-    delta = vec_subs(stage2, vec160);          /* d */                                            \
-    deltaneg = vec_min(tc0masked, deltaneg);                                                      \
-    delta = vec_min(tc0masked, delta);                                                            \
-    p0 = vec_subs(p0, deltaneg);                                                                  \
-    q0 = vec_subs(q0, delta);                                                                     \
-    p0 = vec_adds(p0, delta);                                                                     \
-    q0 = vec_adds(q0, deltaneg);                                                                  \
-}
-
-#define h264_loop_filter_luma_altivec(p2, p1, p0, q0, q1, q2, alpha, beta, tc0) {            \
-    DECLARE_ALIGNED(16, unsigned char, temp)[16];                                             \
-    register vec_u8 alphavec;                                                              \
-    register vec_u8 betavec;                                                               \
-    register vec_u8 mask;                                                                  \
-    register vec_u8 p1mask;                                                                \
-    register vec_u8 q1mask;                                                                \
-    register vector signed   char tc0vec;                                                    \
-    register vec_u8 finaltc0;                                                              \
-    register vec_u8 tc0masked;                                                             \
-    register vec_u8 newp1;                                                                 \
-    register vec_u8 newq1;                                                                 \
-                                                                                             \
-    temp[0] = alpha;                                                                         \
-    temp[1] = beta;                                                                          \
-    alphavec = vec_ld(0, temp);                                                              \
-    betavec = vec_splat(alphavec, 0x1);                                                      \
-    alphavec = vec_splat(alphavec, 0x0);                                                     \
-    mask = h264_deblock_mask(p0, p1, q0, q1, alphavec, betavec); /*if in block */            \
-                                                                                             \
-    AV_COPY32(temp, tc0);                                                                    \
-    tc0vec = vec_ld(0, (signed char*)temp);                                                  \
-    tc0vec = vec_mergeh(tc0vec, tc0vec);                                                     \
-    tc0vec = vec_mergeh(tc0vec, tc0vec);                                                     \
-    mask = vec_and(mask, vec_cmpgt(tc0vec, vec_splat_s8(-1)));  /* if tc0[i] >= 0 */         \
-    finaltc0 = vec_and((vec_u8)tc0vec, mask);     /* tc = tc0 */                           \
-                                                                                             \
-    p1mask = diff_lt_altivec(p2, p0, betavec);                                               \
-    p1mask = vec_and(p1mask, mask);                             /* if ( |p2 - p0| < beta) */ \
-    tc0masked = vec_and(p1mask, (vec_u8)tc0vec);                                           \
-    finaltc0 = vec_sub(finaltc0, p1mask);                       /* tc++ */                   \
-    newp1 = h264_deblock_q1(p0, p1, p2, q0, tc0masked);                                      \
-    /*end if*/                                                                               \
-                                                                                             \
-    q1mask = diff_lt_altivec(q2, q0, betavec);                                               \
-    q1mask = vec_and(q1mask, mask);                             /* if ( |q2 - q0| < beta ) */\
-    tc0masked = vec_and(q1mask, (vec_u8)tc0vec);                                           \
-    finaltc0 = vec_sub(finaltc0, q1mask);                       /* tc++ */                   \
-    newq1 = h264_deblock_q1(p0, q1, q2, q0, tc0masked);                                      \
-    /*end if*/                                                                               \
-                                                                                             \
-    h264_deblock_p0_q0(p0, p1, q0, q1, finaltc0);                                            \
-    p1 = newp1;                                                                              \
-    q1 = newq1;                                                                              \
-}
-
-static void h264_v_loop_filter_luma_altivec(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0) {
-
-    if ((tc0[0] & tc0[1] & tc0[2] & tc0[3]) >= 0) {
-        register vec_u8 p2 = vec_ld(-3*stride, pix);
-        register vec_u8 p1 = vec_ld(-2*stride, pix);
-        register vec_u8 p0 = vec_ld(-1*stride, pix);
-        register vec_u8 q0 = vec_ld(0, pix);
-        register vec_u8 q1 = vec_ld(stride, pix);
-        register vec_u8 q2 = vec_ld(2*stride, pix);
-        h264_loop_filter_luma_altivec(p2, p1, p0, q0, q1, q2, alpha, beta, tc0);
-        vec_st(p1, -2*stride, pix);
-        vec_st(p0, -1*stride, pix);
-        vec_st(q0, 0, pix);
-        vec_st(q1, stride, pix);
-    }
-}
-
-static void h264_h_loop_filter_luma_altivec(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0) {
-
-    register vec_u8 line0, line1, line2, line3, line4, line5;
-    if ((tc0[0] & tc0[1] & tc0[2] & tc0[3]) < 0)
-        return;
-    readAndTranspose16x6(pix-3, stride, line0, line1, line2, line3, line4, line5);
-    h264_loop_filter_luma_altivec(line0, line1, line2, line3, line4, line5, alpha, beta, tc0);
-    transpose4x16(line1, line2, line3, line4);
-    write16x4(pix-2, stride, line1, line2, line3, line4);
-}
-
-static av_always_inline
-void weight_h264_W_altivec(uint8_t *block, int stride, int height,
-                           int log2_denom, int weight, int offset, int w)
-{
-    int y, aligned;
-    vec_u8 vblock;
-    vec_s16 vtemp, vweight, voffset, v0, v1;
-    vec_u16 vlog2_denom;
-    DECLARE_ALIGNED(16, int32_t, temp)[4];
-    LOAD_ZERO;
-
-    offset <<= log2_denom;
-    if(log2_denom) offset += 1<<(log2_denom-1);
-    temp[0] = log2_denom;
-    temp[1] = weight;
-    temp[2] = offset;
-
-    vtemp = (vec_s16)vec_ld(0, temp);
-    vlog2_denom = (vec_u16)vec_splat(vtemp, 1);
-    vweight = vec_splat(vtemp, 3);
-    voffset = vec_splat(vtemp, 5);
-    aligned = !((unsigned long)block & 0xf);
-
-    for (y = 0; y < height; y++) {
-        vblock = vec_ld(0, block);
-
-        v0 = (vec_s16)vec_mergeh(zero_u8v, vblock);
-        v1 = (vec_s16)vec_mergel(zero_u8v, vblock);
-
-        if (w == 16 || aligned) {
-            v0 = vec_mladd(v0, vweight, zero_s16v);
-            v0 = vec_adds(v0, voffset);
-            v0 = vec_sra(v0, vlog2_denom);
-        }
-        if (w == 16 || !aligned) {
-            v1 = vec_mladd(v1, vweight, zero_s16v);
-            v1 = vec_adds(v1, voffset);
-            v1 = vec_sra(v1, vlog2_denom);
-        }
-        vblock = vec_packsu(v0, v1);
-        vec_st(vblock, 0, block);
-
-        block += stride;
-    }
-}
-
-static av_always_inline
-void biweight_h264_W_altivec(uint8_t *dst, uint8_t *src, int stride, int height,
-                             int log2_denom, int weightd, int weights, int offset, int w)
-{
-    int y, dst_aligned, src_aligned;
-    vec_u8 vsrc, vdst;
-    vec_s16 vtemp, vweights, vweightd, voffset, v0, v1, v2, v3;
-    vec_u16 vlog2_denom;
-    DECLARE_ALIGNED(16, int32_t, temp)[4];
-    LOAD_ZERO;
-
-    offset = ((offset + 1) | 1) << log2_denom;
-    temp[0] = log2_denom+1;
-    temp[1] = weights;
-    temp[2] = weightd;
-    temp[3] = offset;
-
-    vtemp = (vec_s16)vec_ld(0, temp);
-    vlog2_denom = (vec_u16)vec_splat(vtemp, 1);
-    vweights = vec_splat(vtemp, 3);
-    vweightd = vec_splat(vtemp, 5);
-    voffset = vec_splat(vtemp, 7);
-    dst_aligned = !((unsigned long)dst & 0xf);
-    src_aligned = !((unsigned long)src & 0xf);
-
-    for (y = 0; y < height; y++) {
-        vdst = vec_ld(0, dst);
-        vsrc = vec_ld(0, src);
-
-        v0 = (vec_s16)vec_mergeh(zero_u8v, vdst);
-        v1 = (vec_s16)vec_mergel(zero_u8v, vdst);
-        v2 = (vec_s16)vec_mergeh(zero_u8v, vsrc);
-        v3 = (vec_s16)vec_mergel(zero_u8v, vsrc);
-
-        if (w == 8) {
-            if (src_aligned)
-                v3 = v2;
-            else
-                v2 = v3;
-        }
-
-        if (w == 16 || dst_aligned) {
-            v0 = vec_mladd(v0, vweightd, zero_s16v);
-            v2 = vec_mladd(v2, vweights, zero_s16v);
-
-            v0 = vec_adds(v0, voffset);
-            v0 = vec_adds(v0, v2);
-            v0 = vec_sra(v0, vlog2_denom);
-        }
-        if (w == 16 || !dst_aligned) {
-            v1 = vec_mladd(v1, vweightd, zero_s16v);
-            v3 = vec_mladd(v3, vweights, zero_s16v);
-
-            v1 = vec_adds(v1, voffset);
-            v1 = vec_adds(v1, v3);
-            v1 = vec_sra(v1, vlog2_denom);
-        }
-        vdst = vec_packsu(v0, v1);
-        vec_st(vdst, 0, dst);
-
-        dst += stride;
-        src += stride;
-    }
-}
-
-#define H264_WEIGHT(W) \
-static void weight_h264_pixels ## W ## _altivec(uint8_t *block, int stride, int height, \
-                                                int log2_denom, int weight, int offset) \
-{ \
-    weight_h264_W_altivec(block, stride, height, log2_denom, weight, offset, W); \
-}\
-static void biweight_h264_pixels ## W ## _altivec(uint8_t *dst, uint8_t *src, int stride, int height, \
-                                                  int log2_denom, int weightd, int weights, int offset) \
-{ \
-    biweight_h264_W_altivec(dst, src, stride, height, log2_denom, weightd, weights, offset, W); \
-}
-
-H264_WEIGHT(16)
-H264_WEIGHT( 8)
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_h264dsp_init_ppc(H264DSPContext *c, const int bit_depth,
-                                 const int chroma_format_idc)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    if (bit_depth == 8) {
-        c->h264_idct_add = h264_idct_add_altivec;
-        if (chroma_format_idc <= 1)
-            c->h264_idct_add8 = h264_idct_add8_altivec;
-        c->h264_idct_add16      = h264_idct_add16_altivec;
-        c->h264_idct_add16intra = h264_idct_add16intra_altivec;
-        c->h264_idct_dc_add= h264_idct_dc_add_altivec;
-        c->h264_idct8_dc_add = h264_idct8_dc_add_altivec;
-        c->h264_idct8_add    = h264_idct8_add_altivec;
-        c->h264_idct8_add4   = h264_idct8_add4_altivec;
-        c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_altivec;
-        c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_altivec;
-
-        c->weight_h264_pixels_tab[0]   = weight_h264_pixels16_altivec;
-        c->weight_h264_pixels_tab[1]   = weight_h264_pixels8_altivec;
-        c->biweight_h264_pixels_tab[0] = biweight_h264_pixels16_altivec;
-        c->biweight_h264_pixels_tab[1] = biweight_h264_pixels8_altivec;
-    }
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/h264qpel.c b/deps/libav/libavcodec/ppc/h264qpel.c
deleted file mode 100644
index f99c8f8..0000000
--- a/deps/libav/libavcodec/ppc/h264qpel.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (c) 2004 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/h264qpel.h"
-#include "dsputil_altivec.h"
-
-#if HAVE_ALTIVEC
-
-#define PUT_OP_U8_ALTIVEC(d, s, dst) d = s
-#define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s)
-
-#define OP_U8_ALTIVEC                          PUT_OP_U8_ALTIVEC
-#define PREFIX_h264_qpel16_h_lowpass_altivec   put_h264_qpel16_h_lowpass_altivec
-#define PREFIX_h264_qpel16_h_lowpass_num       altivec_put_h264_qpel16_h_lowpass_num
-#define PREFIX_h264_qpel16_v_lowpass_altivec   put_h264_qpel16_v_lowpass_altivec
-#define PREFIX_h264_qpel16_v_lowpass_num       altivec_put_h264_qpel16_v_lowpass_num
-#define PREFIX_h264_qpel16_hv_lowpass_altivec  put_h264_qpel16_hv_lowpass_altivec
-#define PREFIX_h264_qpel16_hv_lowpass_num      altivec_put_h264_qpel16_hv_lowpass_num
-#include "h264qpel_template.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_h264_qpel16_h_lowpass_altivec
-#undef PREFIX_h264_qpel16_h_lowpass_num
-#undef PREFIX_h264_qpel16_v_lowpass_altivec
-#undef PREFIX_h264_qpel16_v_lowpass_num
-#undef PREFIX_h264_qpel16_hv_lowpass_altivec
-#undef PREFIX_h264_qpel16_hv_lowpass_num
-
-#define OP_U8_ALTIVEC                          AVG_OP_U8_ALTIVEC
-#define PREFIX_h264_qpel16_h_lowpass_altivec   avg_h264_qpel16_h_lowpass_altivec
-#define PREFIX_h264_qpel16_h_lowpass_num       altivec_avg_h264_qpel16_h_lowpass_num
-#define PREFIX_h264_qpel16_v_lowpass_altivec   avg_h264_qpel16_v_lowpass_altivec
-#define PREFIX_h264_qpel16_v_lowpass_num       altivec_avg_h264_qpel16_v_lowpass_num
-#define PREFIX_h264_qpel16_hv_lowpass_altivec  avg_h264_qpel16_hv_lowpass_altivec
-#define PREFIX_h264_qpel16_hv_lowpass_num      altivec_avg_h264_qpel16_hv_lowpass_num
-#include "h264qpel_template.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_h264_qpel16_h_lowpass_altivec
-#undef PREFIX_h264_qpel16_h_lowpass_num
-#undef PREFIX_h264_qpel16_v_lowpass_altivec
-#undef PREFIX_h264_qpel16_v_lowpass_num
-#undef PREFIX_h264_qpel16_hv_lowpass_altivec
-#undef PREFIX_h264_qpel16_hv_lowpass_num
-
-#define H264_MC(OPNAME, SIZE, CODETYPE) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    ff_ ## OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{ \
-    DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
-    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
-    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
-    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
-    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+stride, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
-    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
-    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
-    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
-    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
-    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
-    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
-    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
-    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, int16_t, tmp)[SIZE*(SIZE+8)];\
-    OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(dst, tmp, src, stride, SIZE, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, uint8_t, halfHV)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, int16_t, tmp)[SIZE*(SIZE+8)];\
-    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
-    put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, uint8_t, halfHV)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, int16_t, tmp)[SIZE*(SIZE+8)];\
-    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
-    put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, uint8_t, halfHV)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, int16_t, tmp)[SIZE*(SIZE+8)];\
-    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
-    put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, uint8_t, halfHV)[SIZE*SIZE];\
-    DECLARE_ALIGNED(16, int16_t, tmp)[SIZE*(SIZE+8)];\
-    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
-    put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
-    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
-}\
-
-static inline void put_pixels16_l2_altivec( uint8_t * dst, const uint8_t * src1,
-                                    const uint8_t * src2, int dst_stride,
-                                    int src_stride1, int h)
-{
-    int i;
-    vec_u8 a, b, d, tmp1, tmp2, mask, mask_, edges, align;
-
-    mask_ = vec_lvsl(0, src2);
-
-    for (i = 0; i < h; i++) {
-
-        tmp1 = vec_ld(i * src_stride1, src1);
-        mask = vec_lvsl(i * src_stride1, src1);
-        tmp2 = vec_ld(i * src_stride1 + 15, src1);
-
-        a = vec_perm(tmp1, tmp2, mask);
-
-        tmp1 = vec_ld(i * 16, src2);
-        tmp2 = vec_ld(i * 16 + 15, src2);
-
-        b = vec_perm(tmp1, tmp2, mask_);
-
-        tmp1 = vec_ld(0, dst);
-        mask = vec_lvsl(0, dst);
-        tmp2 = vec_ld(15, dst);
-
-        d = vec_avg(a, b);
-
-        edges = vec_perm(tmp2, tmp1, mask);
-
-        align = vec_lvsr(0, dst);
-
-        tmp2 = vec_perm(d, edges, align);
-        tmp1 = vec_perm(edges, d, align);
-
-        vec_st(tmp2, 15, dst);
-        vec_st(tmp1, 0 , dst);
-
-        dst += dst_stride;
-    }
-}
-
-static inline void avg_pixels16_l2_altivec( uint8_t * dst, const uint8_t * src1,
-                                    const uint8_t * src2, int dst_stride,
-                                    int src_stride1, int h)
-{
-    int i;
-    vec_u8 a, b, d, tmp1, tmp2, mask, mask_, edges, align;
-
-    mask_ = vec_lvsl(0, src2);
-
-    for (i = 0; i < h; i++) {
-
-        tmp1 = vec_ld(i * src_stride1, src1);
-        mask = vec_lvsl(i * src_stride1, src1);
-        tmp2 = vec_ld(i * src_stride1 + 15, src1);
-
-        a = vec_perm(tmp1, tmp2, mask);
-
-        tmp1 = vec_ld(i * 16, src2);
-        tmp2 = vec_ld(i * 16 + 15, src2);
-
-        b = vec_perm(tmp1, tmp2, mask_);
-
-        tmp1 = vec_ld(0, dst);
-        mask = vec_lvsl(0, dst);
-        tmp2 = vec_ld(15, dst);
-
-        d = vec_avg(vec_perm(tmp1, tmp2, mask), vec_avg(a, b));
-
-        edges = vec_perm(tmp2, tmp1, mask);
-
-        align = vec_lvsr(0, dst);
-
-        tmp2 = vec_perm(d, edges, align);
-        tmp1 = vec_perm(edges, d, align);
-
-        vec_st(tmp2, 15, dst);
-        vec_st(tmp1, 0 , dst);
-
-        dst += dst_stride;
-    }
-}
-
-/* Implemented but could be faster
-#define put_pixels16_l2_altivec(d,s1,s2,ds,s1s,h) put_pixels16_l2(d,s1,s2,ds,s1s,16,h)
-#define avg_pixels16_l2_altivec(d,s1,s2,ds,s1s,h) avg_pixels16_l2(d,s1,s2,ds,s1s,16,h)
- */
-
-H264_MC(put_, 16, altivec)
-H264_MC(avg_, 16, altivec)
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_h264qpel_init_ppc(H264QpelContext *c, int bit_depth)
-{
-#if HAVE_ALTIVEC
-    const int high_bit_depth = bit_depth > 8;
-
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    if (!high_bit_depth) {
-#define dspfunc(PFX, IDX, NUM) \
-        c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \
-        c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_altivec; \
-        c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_altivec; \
-        c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_altivec; \
-        c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_altivec; \
-        c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_altivec; \
-        c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_altivec; \
-        c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_altivec; \
-        c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_altivec; \
-        c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_altivec; \
-        c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_altivec; \
-        c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_altivec; \
-        c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_altivec; \
-        c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_altivec; \
-        c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_altivec; \
-        c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec
-
-        dspfunc(put_h264_qpel, 0, 16);
-        dspfunc(avg_h264_qpel, 0, 16);
-#undef dspfunc
-    }
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/h264qpel_template.c b/deps/libav/libavcodec/ppc/h264qpel_template.c
deleted file mode 100644
index 4df1d09..0000000
--- a/deps/libav/libavcodec/ppc/h264qpel_template.c
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- * Copyright (c) 2004 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mem.h"
-
-#ifdef DEBUG
-#define ASSERT_ALIGNED(ptr) assert(((unsigned long)ptr&0x0000000F));
-#else
-#define ASSERT_ALIGNED(ptr) ;
-#endif
-
-/* this code assume stride % 16 == 0 */
-#ifdef PREFIX_h264_qpel16_h_lowpass_altivec
-static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
-    register int i;
-
-    LOAD_ZERO;
-    const vec_u8 permM2 = vec_lvsl(-2, src);
-    const vec_u8 permM1 = vec_lvsl(-1, src);
-    const vec_u8 permP0 = vec_lvsl(+0, src);
-    const vec_u8 permP1 = vec_lvsl(+1, src);
-    const vec_u8 permP2 = vec_lvsl(+2, src);
-    const vec_u8 permP3 = vec_lvsl(+3, src);
-    const vec_s16 v5ss = vec_splat_s16(5);
-    const vec_u16 v5us = vec_splat_u16(5);
-    const vec_s16 v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
-    const vec_s16 v16ss = vec_sl(vec_splat_s16(1),vec_splat_u16(4));
-
-    vec_u8 srcM2, srcM1, srcP0, srcP1, srcP2, srcP3;
-
-    register int align = ((((unsigned long)src) - 2) % 16);
-
-    vec_s16 srcP0A, srcP0B, srcP1A, srcP1B,
-              srcP2A, srcP2B, srcP3A, srcP3B,
-              srcM1A, srcM1B, srcM2A, srcM2B,
-              sum1A, sum1B, sum2A, sum2B, sum3A, sum3B,
-              pp1A, pp1B, pp2A, pp2B, pp3A, pp3B,
-              psumA, psumB, sumA, sumB;
-
-    vec_u8 sum, fsum;
-
-    for (i = 0 ; i < 16 ; i ++) {
-        vec_u8 srcR1 = vec_ld(-2, src);
-        vec_u8 srcR2 = vec_ld(14, src);
-
-        switch (align) {
-        default: {
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = vec_perm(srcR1, srcR2, permP0);
-            srcP1 = vec_perm(srcR1, srcR2, permP1);
-            srcP2 = vec_perm(srcR1, srcR2, permP2);
-            srcP3 = vec_perm(srcR1, srcR2, permP3);
-        } break;
-        case 11: {
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = vec_perm(srcR1, srcR2, permP0);
-            srcP1 = vec_perm(srcR1, srcR2, permP1);
-            srcP2 = vec_perm(srcR1, srcR2, permP2);
-            srcP3 = srcR2;
-        } break;
-        case 12: {
-            vec_u8 srcR3 = vec_ld(30, src);
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = vec_perm(srcR1, srcR2, permP0);
-            srcP1 = vec_perm(srcR1, srcR2, permP1);
-            srcP2 = srcR2;
-            srcP3 = vec_perm(srcR2, srcR3, permP3);
-        } break;
-        case 13: {
-            vec_u8 srcR3 = vec_ld(30, src);
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = vec_perm(srcR1, srcR2, permP0);
-            srcP1 = srcR2;
-            srcP2 = vec_perm(srcR2, srcR3, permP2);
-            srcP3 = vec_perm(srcR2, srcR3, permP3);
-        } break;
-        case 14: {
-            vec_u8 srcR3 = vec_ld(30, src);
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = srcR2;
-            srcP1 = vec_perm(srcR2, srcR3, permP1);
-            srcP2 = vec_perm(srcR2, srcR3, permP2);
-            srcP3 = vec_perm(srcR2, srcR3, permP3);
-        } break;
-        case 15: {
-            vec_u8 srcR3 = vec_ld(30, src);
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = srcR2;
-            srcP0 = vec_perm(srcR2, srcR3, permP0);
-            srcP1 = vec_perm(srcR2, srcR3, permP1);
-            srcP2 = vec_perm(srcR2, srcR3, permP2);
-            srcP3 = vec_perm(srcR2, srcR3, permP3);
-        } break;
-        }
-
-        srcP0A = (vec_s16) vec_mergeh(zero_u8v, srcP0);
-        srcP0B = (vec_s16) vec_mergel(zero_u8v, srcP0);
-        srcP1A = (vec_s16) vec_mergeh(zero_u8v, srcP1);
-        srcP1B = (vec_s16) vec_mergel(zero_u8v, srcP1);
-
-        srcP2A = (vec_s16) vec_mergeh(zero_u8v, srcP2);
-        srcP2B = (vec_s16) vec_mergel(zero_u8v, srcP2);
-        srcP3A = (vec_s16) vec_mergeh(zero_u8v, srcP3);
-        srcP3B = (vec_s16) vec_mergel(zero_u8v, srcP3);
-
-        srcM1A = (vec_s16) vec_mergeh(zero_u8v, srcM1);
-        srcM1B = (vec_s16) vec_mergel(zero_u8v, srcM1);
-        srcM2A = (vec_s16) vec_mergeh(zero_u8v, srcM2);
-        srcM2B = (vec_s16) vec_mergel(zero_u8v, srcM2);
-
-        sum1A = vec_adds(srcP0A, srcP1A);
-        sum1B = vec_adds(srcP0B, srcP1B);
-        sum2A = vec_adds(srcM1A, srcP2A);
-        sum2B = vec_adds(srcM1B, srcP2B);
-        sum3A = vec_adds(srcM2A, srcP3A);
-        sum3B = vec_adds(srcM2B, srcP3B);
-
-        pp1A = vec_mladd(sum1A, v20ss, v16ss);
-        pp1B = vec_mladd(sum1B, v20ss, v16ss);
-
-        pp2A = vec_mladd(sum2A, v5ss, zero_s16v);
-        pp2B = vec_mladd(sum2B, v5ss, zero_s16v);
-
-        pp3A = vec_add(sum3A, pp1A);
-        pp3B = vec_add(sum3B, pp1B);
-
-        psumA = vec_sub(pp3A, pp2A);
-        psumB = vec_sub(pp3B, pp2B);
-
-        sumA = vec_sra(psumA, v5us);
-        sumB = vec_sra(psumB, v5us);
-
-        sum = vec_packsu(sumA, sumB);
-
-        ASSERT_ALIGNED(dst);
-
-        OP_U8_ALTIVEC(fsum, sum, vec_ld(0, dst));
-
-        vec_st(fsum, 0, dst);
-
-        src += srcStride;
-        dst += dstStride;
-    }
-}
-#endif
-
-/* this code assume stride % 16 == 0 */
-#ifdef PREFIX_h264_qpel16_v_lowpass_altivec
-static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
-    register int i;
-
-    LOAD_ZERO;
-    const vec_u8 perm = vec_lvsl(0, src);
-    const vec_s16 v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
-    const vec_u16 v5us = vec_splat_u16(5);
-    const vec_s16 v5ss = vec_splat_s16(5);
-    const vec_s16 v16ss = vec_sl(vec_splat_s16(1),vec_splat_u16(4));
-
-    uint8_t *srcbis = src - (srcStride * 2);
-
-    const vec_u8 srcM2a = vec_ld(0, srcbis);
-    const vec_u8 srcM2b = vec_ld(16, srcbis);
-    const vec_u8 srcM2 = vec_perm(srcM2a, srcM2b, perm);
-    //srcbis += srcStride;
-    const vec_u8 srcM1a = vec_ld(0, srcbis += srcStride);
-    const vec_u8 srcM1b = vec_ld(16, srcbis);
-    const vec_u8 srcM1 = vec_perm(srcM1a, srcM1b, perm);
-    //srcbis += srcStride;
-    const vec_u8 srcP0a = vec_ld(0, srcbis += srcStride);
-    const vec_u8 srcP0b = vec_ld(16, srcbis);
-    const vec_u8 srcP0 = vec_perm(srcP0a, srcP0b, perm);
-    //srcbis += srcStride;
-    const vec_u8 srcP1a = vec_ld(0, srcbis += srcStride);
-    const vec_u8 srcP1b = vec_ld(16, srcbis);
-    const vec_u8 srcP1 = vec_perm(srcP1a, srcP1b, perm);
-    //srcbis += srcStride;
-    const vec_u8 srcP2a = vec_ld(0, srcbis += srcStride);
-    const vec_u8 srcP2b = vec_ld(16, srcbis);
-    const vec_u8 srcP2 = vec_perm(srcP2a, srcP2b, perm);
-    //srcbis += srcStride;
-
-    vec_s16 srcM2ssA = (vec_s16) vec_mergeh(zero_u8v, srcM2);
-    vec_s16 srcM2ssB = (vec_s16) vec_mergel(zero_u8v, srcM2);
-    vec_s16 srcM1ssA = (vec_s16) vec_mergeh(zero_u8v, srcM1);
-    vec_s16 srcM1ssB = (vec_s16) vec_mergel(zero_u8v, srcM1);
-    vec_s16 srcP0ssA = (vec_s16) vec_mergeh(zero_u8v, srcP0);
-    vec_s16 srcP0ssB = (vec_s16) vec_mergel(zero_u8v, srcP0);
-    vec_s16 srcP1ssA = (vec_s16) vec_mergeh(zero_u8v, srcP1);
-    vec_s16 srcP1ssB = (vec_s16) vec_mergel(zero_u8v, srcP1);
-    vec_s16 srcP2ssA = (vec_s16) vec_mergeh(zero_u8v, srcP2);
-    vec_s16 srcP2ssB = (vec_s16) vec_mergel(zero_u8v, srcP2);
-
-    vec_s16 pp1A, pp1B, pp2A, pp2B, pp3A, pp3B,
-              psumA, psumB, sumA, sumB,
-              srcP3ssA, srcP3ssB,
-              sum1A, sum1B, sum2A, sum2B, sum3A, sum3B;
-
-    vec_u8 sum, fsum, srcP3a, srcP3b, srcP3;
-
-    for (i = 0 ; i < 16 ; i++) {
-        srcP3a = vec_ld(0, srcbis += srcStride);
-        srcP3b = vec_ld(16, srcbis);
-        srcP3 = vec_perm(srcP3a, srcP3b, perm);
-        srcP3ssA = (vec_s16) vec_mergeh(zero_u8v, srcP3);
-        srcP3ssB = (vec_s16) vec_mergel(zero_u8v, srcP3);
-        //srcbis += srcStride;
-
-        sum1A = vec_adds(srcP0ssA, srcP1ssA);
-        sum1B = vec_adds(srcP0ssB, srcP1ssB);
-        sum2A = vec_adds(srcM1ssA, srcP2ssA);
-        sum2B = vec_adds(srcM1ssB, srcP2ssB);
-        sum3A = vec_adds(srcM2ssA, srcP3ssA);
-        sum3B = vec_adds(srcM2ssB, srcP3ssB);
-
-        srcM2ssA = srcM1ssA;
-        srcM2ssB = srcM1ssB;
-        srcM1ssA = srcP0ssA;
-        srcM1ssB = srcP0ssB;
-        srcP0ssA = srcP1ssA;
-        srcP0ssB = srcP1ssB;
-        srcP1ssA = srcP2ssA;
-        srcP1ssB = srcP2ssB;
-        srcP2ssA = srcP3ssA;
-        srcP2ssB = srcP3ssB;
-
-        pp1A = vec_mladd(sum1A, v20ss, v16ss);
-        pp1B = vec_mladd(sum1B, v20ss, v16ss);
-
-        pp2A = vec_mladd(sum2A, v5ss, zero_s16v);
-        pp2B = vec_mladd(sum2B, v5ss, zero_s16v);
-
-        pp3A = vec_add(sum3A, pp1A);
-        pp3B = vec_add(sum3B, pp1B);
-
-        psumA = vec_sub(pp3A, pp2A);
-        psumB = vec_sub(pp3B, pp2B);
-
-        sumA = vec_sra(psumA, v5us);
-        sumB = vec_sra(psumB, v5us);
-
-        sum = vec_packsu(sumA, sumB);
-
-        ASSERT_ALIGNED(dst);
-
-        OP_U8_ALTIVEC(fsum, sum, vec_ld(0, dst));
-
-        vec_st(fsum, 0, dst);
-
-        dst += dstStride;
-    }
-}
-#endif
-
-/* this code assume stride % 16 == 0 *and* tmp is properly aligned */
-#ifdef PREFIX_h264_qpel16_hv_lowpass_altivec
-static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, uint8_t * src, int dstStride, int tmpStride, int srcStride) {
-    register int i;
-    LOAD_ZERO;
-    const vec_u8 permM2 = vec_lvsl(-2, src);
-    const vec_u8 permM1 = vec_lvsl(-1, src);
-    const vec_u8 permP0 = vec_lvsl(+0, src);
-    const vec_u8 permP1 = vec_lvsl(+1, src);
-    const vec_u8 permP2 = vec_lvsl(+2, src);
-    const vec_u8 permP3 = vec_lvsl(+3, src);
-    const vec_s16 v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
-    const vec_u32 v10ui = vec_splat_u32(10);
-    const vec_s16 v5ss = vec_splat_s16(5);
-    const vec_s16 v1ss = vec_splat_s16(1);
-    const vec_s32 v512si = vec_sl(vec_splat_s32(1),vec_splat_u32(9));
-    const vec_u32 v16ui = vec_sl(vec_splat_u32(1),vec_splat_u32(4));
-
-    register int align = ((((unsigned long)src) - 2) % 16);
-
-    vec_s16 srcP0A, srcP0B, srcP1A, srcP1B,
-              srcP2A, srcP2B, srcP3A, srcP3B,
-              srcM1A, srcM1B, srcM2A, srcM2B,
-              sum1A, sum1B, sum2A, sum2B, sum3A, sum3B,
-              pp1A, pp1B, pp2A, pp2B, psumA, psumB;
-
-    const vec_u8 mperm = (const vec_u8)
-        {0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B,
-         0x04, 0x0C, 0x05, 0x0D, 0x06, 0x0E, 0x07, 0x0F};
-    int16_t *tmpbis = tmp;
-
-    vec_s16 tmpM1ssA, tmpM1ssB, tmpM2ssA, tmpM2ssB,
-              tmpP0ssA, tmpP0ssB, tmpP1ssA, tmpP1ssB,
-              tmpP2ssA, tmpP2ssB;
-
-    vec_s32 pp1Ae, pp1Ao, pp1Be, pp1Bo, pp2Ae, pp2Ao, pp2Be, pp2Bo,
-              pp3Ae, pp3Ao, pp3Be, pp3Bo, pp1cAe, pp1cAo, pp1cBe, pp1cBo,
-              pp32Ae, pp32Ao, pp32Be, pp32Bo, sumAe, sumAo, sumBe, sumBo,
-              ssumAe, ssumAo, ssumBe, ssumBo;
-    vec_u8 fsum, sumv, sum;
-    vec_s16 ssume, ssumo;
-
-    src -= (2 * srcStride);
-    for (i = 0 ; i < 21 ; i ++) {
-        vec_u8 srcM2, srcM1, srcP0, srcP1, srcP2, srcP3;
-        vec_u8 srcR1 = vec_ld(-2, src);
-        vec_u8 srcR2 = vec_ld(14, src);
-
-        switch (align) {
-        default: {
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = vec_perm(srcR1, srcR2, permP0);
-            srcP1 = vec_perm(srcR1, srcR2, permP1);
-            srcP2 = vec_perm(srcR1, srcR2, permP2);
-            srcP3 = vec_perm(srcR1, srcR2, permP3);
-        } break;
-        case 11: {
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = vec_perm(srcR1, srcR2, permP0);
-            srcP1 = vec_perm(srcR1, srcR2, permP1);
-            srcP2 = vec_perm(srcR1, srcR2, permP2);
-            srcP3 = srcR2;
-        } break;
-        case 12: {
-            vec_u8 srcR3 = vec_ld(30, src);
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = vec_perm(srcR1, srcR2, permP0);
-            srcP1 = vec_perm(srcR1, srcR2, permP1);
-            srcP2 = srcR2;
-            srcP3 = vec_perm(srcR2, srcR3, permP3);
-        } break;
-        case 13: {
-            vec_u8 srcR3 = vec_ld(30, src);
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = vec_perm(srcR1, srcR2, permP0);
-            srcP1 = srcR2;
-            srcP2 = vec_perm(srcR2, srcR3, permP2);
-            srcP3 = vec_perm(srcR2, srcR3, permP3);
-        } break;
-        case 14: {
-            vec_u8 srcR3 = vec_ld(30, src);
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = vec_perm(srcR1, srcR2, permM1);
-            srcP0 = srcR2;
-            srcP1 = vec_perm(srcR2, srcR3, permP1);
-            srcP2 = vec_perm(srcR2, srcR3, permP2);
-            srcP3 = vec_perm(srcR2, srcR3, permP3);
-        } break;
-        case 15: {
-            vec_u8 srcR3 = vec_ld(30, src);
-            srcM2 = vec_perm(srcR1, srcR2, permM2);
-            srcM1 = srcR2;
-            srcP0 = vec_perm(srcR2, srcR3, permP0);
-            srcP1 = vec_perm(srcR2, srcR3, permP1);
-            srcP2 = vec_perm(srcR2, srcR3, permP2);
-            srcP3 = vec_perm(srcR2, srcR3, permP3);
-        } break;
-        }
-
-        srcP0A = (vec_s16) vec_mergeh(zero_u8v, srcP0);
-        srcP0B = (vec_s16) vec_mergel(zero_u8v, srcP0);
-        srcP1A = (vec_s16) vec_mergeh(zero_u8v, srcP1);
-        srcP1B = (vec_s16) vec_mergel(zero_u8v, srcP1);
-
-        srcP2A = (vec_s16) vec_mergeh(zero_u8v, srcP2);
-        srcP2B = (vec_s16) vec_mergel(zero_u8v, srcP2);
-        srcP3A = (vec_s16) vec_mergeh(zero_u8v, srcP3);
-        srcP3B = (vec_s16) vec_mergel(zero_u8v, srcP3);
-
-        srcM1A = (vec_s16) vec_mergeh(zero_u8v, srcM1);
-        srcM1B = (vec_s16) vec_mergel(zero_u8v, srcM1);
-        srcM2A = (vec_s16) vec_mergeh(zero_u8v, srcM2);
-        srcM2B = (vec_s16) vec_mergel(zero_u8v, srcM2);
-
-        sum1A = vec_adds(srcP0A, srcP1A);
-        sum1B = vec_adds(srcP0B, srcP1B);
-        sum2A = vec_adds(srcM1A, srcP2A);
-        sum2B = vec_adds(srcM1B, srcP2B);
-        sum3A = vec_adds(srcM2A, srcP3A);
-        sum3B = vec_adds(srcM2B, srcP3B);
-
-        pp1A = vec_mladd(sum1A, v20ss, sum3A);
-        pp1B = vec_mladd(sum1B, v20ss, sum3B);
-
-        pp2A = vec_mladd(sum2A, v5ss, zero_s16v);
-        pp2B = vec_mladd(sum2B, v5ss, zero_s16v);
-
-        psumA = vec_sub(pp1A, pp2A);
-        psumB = vec_sub(pp1B, pp2B);
-
-        vec_st(psumA, 0, tmp);
-        vec_st(psumB, 16, tmp);
-
-        src += srcStride;
-        tmp += tmpStride; /* int16_t*, and stride is 16, so it's OK here */
-    }
-
-    tmpM2ssA = vec_ld(0, tmpbis);
-    tmpM2ssB = vec_ld(16, tmpbis);
-    tmpbis += tmpStride;
-    tmpM1ssA = vec_ld(0, tmpbis);
-    tmpM1ssB = vec_ld(16, tmpbis);
-    tmpbis += tmpStride;
-    tmpP0ssA = vec_ld(0, tmpbis);
-    tmpP0ssB = vec_ld(16, tmpbis);
-    tmpbis += tmpStride;
-    tmpP1ssA = vec_ld(0, tmpbis);
-    tmpP1ssB = vec_ld(16, tmpbis);
-    tmpbis += tmpStride;
-    tmpP2ssA = vec_ld(0, tmpbis);
-    tmpP2ssB = vec_ld(16, tmpbis);
-    tmpbis += tmpStride;
-
-    for (i = 0 ; i < 16 ; i++) {
-        const vec_s16 tmpP3ssA = vec_ld(0, tmpbis);
-        const vec_s16 tmpP3ssB = vec_ld(16, tmpbis);
-
-        const vec_s16 sum1A = vec_adds(tmpP0ssA, tmpP1ssA);
-        const vec_s16 sum1B = vec_adds(tmpP0ssB, tmpP1ssB);
-        const vec_s16 sum2A = vec_adds(tmpM1ssA, tmpP2ssA);
-        const vec_s16 sum2B = vec_adds(tmpM1ssB, tmpP2ssB);
-        const vec_s16 sum3A = vec_adds(tmpM2ssA, tmpP3ssA);
-        const vec_s16 sum3B = vec_adds(tmpM2ssB, tmpP3ssB);
-
-        tmpbis += tmpStride;
-
-        tmpM2ssA = tmpM1ssA;
-        tmpM2ssB = tmpM1ssB;
-        tmpM1ssA = tmpP0ssA;
-        tmpM1ssB = tmpP0ssB;
-        tmpP0ssA = tmpP1ssA;
-        tmpP0ssB = tmpP1ssB;
-        tmpP1ssA = tmpP2ssA;
-        tmpP1ssB = tmpP2ssB;
-        tmpP2ssA = tmpP3ssA;
-        tmpP2ssB = tmpP3ssB;
-
-        pp1Ae = vec_mule(sum1A, v20ss);
-        pp1Ao = vec_mulo(sum1A, v20ss);
-        pp1Be = vec_mule(sum1B, v20ss);
-        pp1Bo = vec_mulo(sum1B, v20ss);
-
-        pp2Ae = vec_mule(sum2A, v5ss);
-        pp2Ao = vec_mulo(sum2A, v5ss);
-        pp2Be = vec_mule(sum2B, v5ss);
-        pp2Bo = vec_mulo(sum2B, v5ss);
-
-        pp3Ae = vec_sra((vec_s32)sum3A, v16ui);
-        pp3Ao = vec_mulo(sum3A, v1ss);
-        pp3Be = vec_sra((vec_s32)sum3B, v16ui);
-        pp3Bo = vec_mulo(sum3B, v1ss);
-
-        pp1cAe = vec_add(pp1Ae, v512si);
-        pp1cAo = vec_add(pp1Ao, v512si);
-        pp1cBe = vec_add(pp1Be, v512si);
-        pp1cBo = vec_add(pp1Bo, v512si);
-
-        pp32Ae = vec_sub(pp3Ae, pp2Ae);
-        pp32Ao = vec_sub(pp3Ao, pp2Ao);
-        pp32Be = vec_sub(pp3Be, pp2Be);
-        pp32Bo = vec_sub(pp3Bo, pp2Bo);
-
-        sumAe = vec_add(pp1cAe, pp32Ae);
-        sumAo = vec_add(pp1cAo, pp32Ao);
-        sumBe = vec_add(pp1cBe, pp32Be);
-        sumBo = vec_add(pp1cBo, pp32Bo);
-
-        ssumAe = vec_sra(sumAe, v10ui);
-        ssumAo = vec_sra(sumAo, v10ui);
-        ssumBe = vec_sra(sumBe, v10ui);
-        ssumBo = vec_sra(sumBo, v10ui);
-
-        ssume = vec_packs(ssumAe, ssumBe);
-        ssumo = vec_packs(ssumAo, ssumBo);
-
-        sumv = vec_packsu(ssume, ssumo);
-        sum = vec_perm(sumv, sumv, mperm);
-
-        ASSERT_ALIGNED(dst);
-
-        OP_U8_ALTIVEC(fsum, sum, vec_ld(0, dst));
-
-        vec_st(fsum, 0, dst);
-
-        dst += dstStride;
-    }
-}
-#endif
diff --git a/deps/libav/libavcodec/ppc/hpeldsp_altivec.c b/deps/libav/libavcodec/ppc/hpeldsp_altivec.c
deleted file mode 100644
index d40c5d8..0000000
--- a/deps/libav/libavcodec/ppc/hpeldsp_altivec.c
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 2002 Brian Foley
- * Copyright (c) 2002 Dieter Shirley
- * Copyright (c) 2003-2004 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#if HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/hpeldsp.h"
-#include "dsputil_altivec.h"
-
-#if HAVE_ALTIVEC
-/* next one assumes that ((line_size % 16) == 0) */
-void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    register vector unsigned char pixelsv1, pixelsv2;
-    register vector unsigned char pixelsv1B, pixelsv2B;
-    register vector unsigned char pixelsv1C, pixelsv2C;
-    register vector unsigned char pixelsv1D, pixelsv2D;
-
-    register vector unsigned char perm = vec_lvsl(0, pixels);
-    int i;
-    register ptrdiff_t line_size_2 = line_size << 1;
-    register ptrdiff_t line_size_3 = line_size + line_size_2;
-    register ptrdiff_t line_size_4 = line_size << 2;
-
-// hand-unrolling the loop by 4 gains about 15%
-// mininum execution time goes from 74 to 60 cycles
-// it's faster than -funroll-loops, but using
-// -funroll-loops w/ this is bad - 74 cycles again.
-// all this is on a 7450, tuning for the 7450
-    for (i = 0; i < h; i += 4) {
-        pixelsv1  = vec_ld( 0, pixels);
-        pixelsv2  = vec_ld(15, pixels);
-        pixelsv1B = vec_ld(line_size, pixels);
-        pixelsv2B = vec_ld(15 + line_size, pixels);
-        pixelsv1C = vec_ld(line_size_2, pixels);
-        pixelsv2C = vec_ld(15 + line_size_2, pixels);
-        pixelsv1D = vec_ld(line_size_3, pixels);
-        pixelsv2D = vec_ld(15 + line_size_3, pixels);
-        vec_st(vec_perm(pixelsv1, pixelsv2, perm),
-               0, (unsigned char*)block);
-        vec_st(vec_perm(pixelsv1B, pixelsv2B, perm),
-               line_size, (unsigned char*)block);
-        vec_st(vec_perm(pixelsv1C, pixelsv2C, perm),
-               line_size_2, (unsigned char*)block);
-        vec_st(vec_perm(pixelsv1D, pixelsv2D, perm),
-               line_size_3, (unsigned char*)block);
-        pixels+=line_size_4;
-        block +=line_size_4;
-    }
-}
-
-/* next one assumes that ((line_size % 16) == 0) */
-#define op_avg(a,b)  a = ( ((a)|(b)) - ((((a)^(b))&0xFEFEFEFEUL)>>1) )
-void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv;
-    register vector unsigned char perm = vec_lvsl(0, pixels);
-    int i;
-
-    for (i = 0; i < h; i++) {
-        pixelsv1 = vec_ld( 0, pixels);
-        pixelsv2 = vec_ld(16,pixels);
-        blockv = vec_ld(0, block);
-        pixelsv = vec_perm(pixelsv1, pixelsv2, perm);
-        blockv = vec_avg(blockv,pixelsv);
-        vec_st(blockv, 0, (unsigned char*)block);
-        pixels+=line_size;
-        block +=line_size;
-    }
-}
-
-/* next one assumes that ((line_size % 8) == 0) */
-static void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, ptrdiff_t line_size, int h)
-{
-    register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv;
-    int i;
-
-   for (i = 0; i < h; i++) {
-       /* block is 8 bytes-aligned, so we're either in the
-          left block (16 bytes-aligned) or in the right block (not) */
-       int rightside = ((unsigned long)block & 0x0000000F);
-
-       blockv = vec_ld(0, block);
-       pixelsv1 = vec_ld( 0, pixels);
-       pixelsv2 = vec_ld(16, pixels);
-       pixelsv = vec_perm(pixelsv1, pixelsv2, vec_lvsl(0, pixels));
-
-       if (rightside) {
-           pixelsv = vec_perm(blockv, pixelsv, vcprm(0,1,s0,s1));
-       } else {
-           pixelsv = vec_perm(blockv, pixelsv, vcprm(s0,s1,2,3));
-       }
-
-       blockv = vec_avg(blockv, pixelsv);
-
-       vec_st(blockv, 0, block);
-
-       pixels += line_size;
-       block += line_size;
-   }
-}
-
-/* next one assumes that ((line_size % 8) == 0) */
-static void put_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    register int i;
-    register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
-    register vector unsigned char blockv, temp1, temp2;
-    register vector unsigned short pixelssum1, pixelssum2, temp3;
-    register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
-    register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
-
-    temp1 = vec_ld(0, pixels);
-    temp2 = vec_ld(16, pixels);
-    pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
-    if ((((unsigned long)pixels) & 0x0000000F) ==  0x0000000F) {
-        pixelsv2 = temp2;
-    } else {
-        pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
-    }
-    pixelsv1 = vec_mergeh(vczero, pixelsv1);
-    pixelsv2 = vec_mergeh(vczero, pixelsv2);
-    pixelssum1 = vec_add((vector unsigned short)pixelsv1,
-                         (vector unsigned short)pixelsv2);
-    pixelssum1 = vec_add(pixelssum1, vctwo);
-
-    for (i = 0; i < h ; i++) {
-        int rightside = ((unsigned long)block & 0x0000000F);
-        blockv = vec_ld(0, block);
-
-        temp1 = vec_ld(line_size, pixels);
-        temp2 = vec_ld(line_size + 16, pixels);
-        pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
-        if (((((unsigned long)pixels) + line_size) & 0x0000000F) ==  0x0000000F) {
-            pixelsv2 = temp2;
-        } else {
-            pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
-        }
-
-        pixelsv1 = vec_mergeh(vczero, pixelsv1);
-        pixelsv2 = vec_mergeh(vczero, pixelsv2);
-        pixelssum2 = vec_add((vector unsigned short)pixelsv1,
-                             (vector unsigned short)pixelsv2);
-        temp3 = vec_add(pixelssum1, pixelssum2);
-        temp3 = vec_sra(temp3, vctwo);
-        pixelssum1 = vec_add(pixelssum2, vctwo);
-        pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
-
-        if (rightside) {
-            blockv = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
-        } else {
-            blockv = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
-        }
-
-        vec_st(blockv, 0, block);
-
-        block += line_size;
-        pixels += line_size;
-    }
-}
-
-/* next one assumes that ((line_size % 8) == 0) */
-static void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    register int i;
-    register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
-    register vector unsigned char blockv, temp1, temp2;
-    register vector unsigned short pixelssum1, pixelssum2, temp3;
-    register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
-    register const vector unsigned short vcone = (const vector unsigned short)vec_splat_u16(1);
-    register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
-
-    temp1 = vec_ld(0, pixels);
-    temp2 = vec_ld(16, pixels);
-    pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
-    if ((((unsigned long)pixels) & 0x0000000F) ==  0x0000000F) {
-        pixelsv2 = temp2;
-    } else {
-        pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
-    }
-    pixelsv1 = vec_mergeh(vczero, pixelsv1);
-    pixelsv2 = vec_mergeh(vczero, pixelsv2);
-    pixelssum1 = vec_add((vector unsigned short)pixelsv1,
-                         (vector unsigned short)pixelsv2);
-    pixelssum1 = vec_add(pixelssum1, vcone);
-
-    for (i = 0; i < h ; i++) {
-        int rightside = ((unsigned long)block & 0x0000000F);
-        blockv = vec_ld(0, block);
-
-        temp1 = vec_ld(line_size, pixels);
-        temp2 = vec_ld(line_size + 16, pixels);
-        pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
-        if (((((unsigned long)pixels) + line_size) & 0x0000000F) ==  0x0000000F) {
-            pixelsv2 = temp2;
-        } else {
-            pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
-        }
-
-        pixelsv1 = vec_mergeh(vczero, pixelsv1);
-        pixelsv2 = vec_mergeh(vczero, pixelsv2);
-        pixelssum2 = vec_add((vector unsigned short)pixelsv1,
-                             (vector unsigned short)pixelsv2);
-        temp3 = vec_add(pixelssum1, pixelssum2);
-        temp3 = vec_sra(temp3, vctwo);
-        pixelssum1 = vec_add(pixelssum2, vcone);
-        pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
-
-        if (rightside) {
-            blockv = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
-        } else {
-            blockv = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
-        }
-
-        vec_st(blockv, 0, block);
-
-        block += line_size;
-        pixels += line_size;
-    }
-}
-
-/* next one assumes that ((line_size % 16) == 0) */
-static void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, ptrdiff_t line_size, int h)
-{
-    register int i;
-    register vector unsigned char pixelsv1, pixelsv2, pixelsv3, pixelsv4;
-    register vector unsigned char blockv, temp1, temp2;
-    register vector unsigned short temp3, temp4,
-        pixelssum1, pixelssum2, pixelssum3, pixelssum4;
-    register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
-    register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
-
-    temp1 = vec_ld(0, pixels);
-    temp2 = vec_ld(16, pixels);
-    pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
-    if ((((unsigned long)pixels) & 0x0000000F) ==  0x0000000F) {
-        pixelsv2 = temp2;
-    } else {
-        pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
-    }
-    pixelsv3 = vec_mergel(vczero, pixelsv1);
-    pixelsv4 = vec_mergel(vczero, pixelsv2);
-    pixelsv1 = vec_mergeh(vczero, pixelsv1);
-    pixelsv2 = vec_mergeh(vczero, pixelsv2);
-    pixelssum3 = vec_add((vector unsigned short)pixelsv3,
-                         (vector unsigned short)pixelsv4);
-    pixelssum3 = vec_add(pixelssum3, vctwo);
-    pixelssum1 = vec_add((vector unsigned short)pixelsv1,
-                         (vector unsigned short)pixelsv2);
-    pixelssum1 = vec_add(pixelssum1, vctwo);
-
-    for (i = 0; i < h ; i++) {
-        blockv = vec_ld(0, block);
-
-        temp1 = vec_ld(line_size, pixels);
-        temp2 = vec_ld(line_size + 16, pixels);
-        pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
-        if (((((unsigned long)pixels) + line_size) & 0x0000000F) ==  0x0000000F) {
-            pixelsv2 = temp2;
-        } else {
-            pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
-        }
-
-        pixelsv3 = vec_mergel(vczero, pixelsv1);
-        pixelsv4 = vec_mergel(vczero, pixelsv2);
-        pixelsv1 = vec_mergeh(vczero, pixelsv1);
-        pixelsv2 = vec_mergeh(vczero, pixelsv2);
-
-        pixelssum4 = vec_add((vector unsigned short)pixelsv3,
-                             (vector unsigned short)pixelsv4);
-        pixelssum2 = vec_add((vector unsigned short)pixelsv1,
-                             (vector unsigned short)pixelsv2);
-        temp4 = vec_add(pixelssum3, pixelssum4);
-        temp4 = vec_sra(temp4, vctwo);
-        temp3 = vec_add(pixelssum1, pixelssum2);
-        temp3 = vec_sra(temp3, vctwo);
-
-        pixelssum3 = vec_add(pixelssum4, vctwo);
-        pixelssum1 = vec_add(pixelssum2, vctwo);
-
-        blockv = vec_packsu(temp3, temp4);
-
-        vec_st(blockv, 0, block);
-
-        block += line_size;
-        pixels += line_size;
-    }
-}
-
-/* next one assumes that ((line_size % 16) == 0) */
-static void put_no_rnd_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, ptrdiff_t line_size, int h)
-{
-    register int i;
-    register vector unsigned char pixelsv1, pixelsv2, pixelsv3, pixelsv4;
-    register vector unsigned char blockv, temp1, temp2;
-    register vector unsigned short temp3, temp4,
-        pixelssum1, pixelssum2, pixelssum3, pixelssum4;
-    register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0);
-    register const vector unsigned short vcone = (const vector unsigned short)vec_splat_u16(1);
-    register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2);
-
-    temp1 = vec_ld(0, pixels);
-    temp2 = vec_ld(16, pixels);
-    pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
-    if ((((unsigned long)pixels) & 0x0000000F) ==  0x0000000F) {
-        pixelsv2 = temp2;
-    } else {
-        pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
-    }
-    pixelsv3 = vec_mergel(vczero, pixelsv1);
-    pixelsv4 = vec_mergel(vczero, pixelsv2);
-    pixelsv1 = vec_mergeh(vczero, pixelsv1);
-    pixelsv2 = vec_mergeh(vczero, pixelsv2);
-    pixelssum3 = vec_add((vector unsigned short)pixelsv3,
-                         (vector unsigned short)pixelsv4);
-    pixelssum3 = vec_add(pixelssum3, vcone);
-    pixelssum1 = vec_add((vector unsigned short)pixelsv1,
-                         (vector unsigned short)pixelsv2);
-    pixelssum1 = vec_add(pixelssum1, vcone);
-
-    for (i = 0; i < h ; i++) {
-        blockv = vec_ld(0, block);
-
-        temp1 = vec_ld(line_size, pixels);
-        temp2 = vec_ld(line_size + 16, pixels);
-        pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
-        if (((((unsigned long)pixels) + line_size) & 0x0000000F) ==  0x0000000F) {
-            pixelsv2 = temp2;
-        } else {
-            pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
-        }
-
-        pixelsv3 = vec_mergel(vczero, pixelsv1);
-        pixelsv4 = vec_mergel(vczero, pixelsv2);
-        pixelsv1 = vec_mergeh(vczero, pixelsv1);
-        pixelsv2 = vec_mergeh(vczero, pixelsv2);
-
-        pixelssum4 = vec_add((vector unsigned short)pixelsv3,
-                             (vector unsigned short)pixelsv4);
-        pixelssum2 = vec_add((vector unsigned short)pixelsv1,
-                             (vector unsigned short)pixelsv2);
-        temp4 = vec_add(pixelssum3, pixelssum4);
-        temp4 = vec_sra(temp4, vctwo);
-        temp3 = vec_add(pixelssum1, pixelssum2);
-        temp3 = vec_sra(temp3, vctwo);
-
-        pixelssum3 = vec_add(pixelssum4, vcone);
-        pixelssum1 = vec_add(pixelssum2, vcone);
-
-        blockv = vec_packsu(temp3, temp4);
-
-        vec_st(blockv, 0, block);
-
-        block += line_size;
-        pixels += line_size;
-    }
-}
-
-/* next one assumes that ((line_size % 8) == 0) */
-static void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    register int i;
-    register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
-    register vector unsigned char blockv, temp1, temp2, blocktemp;
-    register vector unsigned short pixelssum1, pixelssum2, temp3;
-
-    register const vector unsigned char vczero = (const vector unsigned char)
-                                        vec_splat_u8(0);
-    register const vector unsigned short vctwo = (const vector unsigned short)
-                                        vec_splat_u16(2);
-
-    temp1 = vec_ld(0, pixels);
-    temp2 = vec_ld(16, pixels);
-    pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
-    if ((((unsigned long)pixels) & 0x0000000F) ==  0x0000000F) {
-        pixelsv2 = temp2;
-    } else {
-        pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
-    }
-    pixelsv1 = vec_mergeh(vczero, pixelsv1);
-    pixelsv2 = vec_mergeh(vczero, pixelsv2);
-    pixelssum1 = vec_add((vector unsigned short)pixelsv1,
-                         (vector unsigned short)pixelsv2);
-    pixelssum1 = vec_add(pixelssum1, vctwo);
-
-    for (i = 0; i < h ; i++) {
-        int rightside = ((unsigned long)block & 0x0000000F);
-        blockv = vec_ld(0, block);
-
-        temp1 = vec_ld(line_size, pixels);
-        temp2 = vec_ld(line_size + 16, pixels);
-        pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
-        if (((((unsigned long)pixels) + line_size) & 0x0000000F) ==  0x0000000F) {
-            pixelsv2 = temp2;
-        } else {
-            pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
-        }
-
-        pixelsv1 = vec_mergeh(vczero, pixelsv1);
-        pixelsv2 = vec_mergeh(vczero, pixelsv2);
-        pixelssum2 = vec_add((vector unsigned short)pixelsv1,
-                             (vector unsigned short)pixelsv2);
-        temp3 = vec_add(pixelssum1, pixelssum2);
-        temp3 = vec_sra(temp3, vctwo);
-        pixelssum1 = vec_add(pixelssum2, vctwo);
-        pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
-
-        if (rightside) {
-            blocktemp = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
-        } else {
-            blocktemp = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
-        }
-
-        blockv = vec_avg(blocktemp, blockv);
-        vec_st(blockv, 0, block);
-
-        block += line_size;
-        pixels += line_size;
-    }
-}
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    c->avg_pixels_tab[0][0]        = ff_avg_pixels16_altivec;
-    c->avg_pixels_tab[1][0]        = avg_pixels8_altivec;
-    c->avg_pixels_tab[1][3]        = avg_pixels8_xy2_altivec;
-
-    c->put_pixels_tab[0][0]        = ff_put_pixels16_altivec;
-    c->put_pixels_tab[1][3]        = put_pixels8_xy2_altivec;
-    c->put_pixels_tab[0][3]        = put_pixels16_xy2_altivec;
-
-    c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_altivec;
-    c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec;
-    c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec;
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/idct_altivec.c b/deps/libav/libavcodec/ppc/idct_altivec.c
deleted file mode 100644
index f68a61d..0000000
--- a/deps/libav/libavcodec/ppc/idct_altivec.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2001 Michel Lespinasse
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * NOTE: This code is based on GPL code from the libmpeg2 project.  The
- * author, Michel Lespinasses, has given explicit permission to release
- * under LGPL as part of Libav.
- */
-
-/*
- * Libav integration by Dieter Shirley
- *
- * This file is a direct copy of the AltiVec IDCT module from the libmpeg2
- * project.  I've deleted all of the libmpeg2-specific code, renamed the
- * functions and reordered the function parameters.  The only change to the
- * IDCT function itself was to factor out the partial transposition, and to
- * perform a full transpose at the end of the function.
- */
-
-
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>
-#include "config.h"
-#if HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-#include "libavutil/ppc/types_altivec.h"
-#include "dsputil_altivec.h"
-
-#define IDCT_HALF                                       \
-    /* 1st stage */                                     \
-    t1 = vec_mradds (a1, vx7, vx1 );                    \
-    t8 = vec_mradds (a1, vx1, vec_subs (zero, vx7));    \
-    t7 = vec_mradds (a2, vx5, vx3);                     \
-    t3 = vec_mradds (ma2, vx3, vx5);                    \
-                                                        \
-    /* 2nd stage */                                     \
-    t5 = vec_adds (vx0, vx4);                           \
-    t0 = vec_subs (vx0, vx4);                           \
-    t2 = vec_mradds (a0, vx6, vx2);                     \
-    t4 = vec_mradds (a0, vx2, vec_subs (zero, vx6));    \
-    t6 = vec_adds (t8, t3);                             \
-    t3 = vec_subs (t8, t3);                             \
-    t8 = vec_subs (t1, t7);                             \
-    t1 = vec_adds (t1, t7);                             \
-                                                        \
-    /* 3rd stage */                                     \
-    t7 = vec_adds (t5, t2);                             \
-    t2 = vec_subs (t5, t2);                             \
-    t5 = vec_adds (t0, t4);                             \
-    t0 = vec_subs (t0, t4);                             \
-    t4 = vec_subs (t8, t3);                             \
-    t3 = vec_adds (t8, t3);                             \
-                                                        \
-    /* 4th stage */                                     \
-    vy0 = vec_adds (t7, t1);                            \
-    vy7 = vec_subs (t7, t1);                            \
-    vy1 = vec_mradds (c4, t3, t5);                      \
-    vy6 = vec_mradds (mc4, t3, t5);                     \
-    vy2 = vec_mradds (c4, t4, t0);                      \
-    vy5 = vec_mradds (mc4, t4, t0);                     \
-    vy3 = vec_adds (t2, t6);                            \
-    vy4 = vec_subs (t2, t6);
-
-
-#define IDCT                                                            \
-    vec_s16 vx0, vx1, vx2, vx3, vx4, vx5, vx6, vx7;                \
-    vec_s16 vy0, vy1, vy2, vy3, vy4, vy5, vy6, vy7;                \
-    vec_s16 a0, a1, a2, ma2, c4, mc4, zero, bias;                  \
-    vec_s16 t0, t1, t2, t3, t4, t5, t6, t7, t8;                    \
-    vec_u16 shift;                                                 \
-                                                                        \
-    c4 = vec_splat (constants[0], 0);                                   \
-    a0 = vec_splat (constants[0], 1);                                   \
-    a1 = vec_splat (constants[0], 2);                                   \
-    a2 = vec_splat (constants[0], 3);                                   \
-    mc4 = vec_splat (constants[0], 4);                                  \
-    ma2 = vec_splat (constants[0], 5);                                  \
-    bias = (vec_s16)vec_splat ((vec_s32)constants[0], 3);     \
-                                                                        \
-    zero = vec_splat_s16 (0);                                           \
-    shift = vec_splat_u16 (4);                                          \
-                                                                        \
-    vx0 = vec_mradds (vec_sl (block[0], shift), constants[1], zero);    \
-    vx1 = vec_mradds (vec_sl (block[1], shift), constants[2], zero);    \
-    vx2 = vec_mradds (vec_sl (block[2], shift), constants[3], zero);    \
-    vx3 = vec_mradds (vec_sl (block[3], shift), constants[4], zero);    \
-    vx4 = vec_mradds (vec_sl (block[4], shift), constants[1], zero);    \
-    vx5 = vec_mradds (vec_sl (block[5], shift), constants[4], zero);    \
-    vx6 = vec_mradds (vec_sl (block[6], shift), constants[3], zero);    \
-    vx7 = vec_mradds (vec_sl (block[7], shift), constants[2], zero);    \
-                                                                        \
-    IDCT_HALF                                                           \
-                                                                        \
-    vx0 = vec_mergeh (vy0, vy4);                                        \
-    vx1 = vec_mergel (vy0, vy4);                                        \
-    vx2 = vec_mergeh (vy1, vy5);                                        \
-    vx3 = vec_mergel (vy1, vy5);                                        \
-    vx4 = vec_mergeh (vy2, vy6);                                        \
-    vx5 = vec_mergel (vy2, vy6);                                        \
-    vx6 = vec_mergeh (vy3, vy7);                                        \
-    vx7 = vec_mergel (vy3, vy7);                                        \
-                                                                        \
-    vy0 = vec_mergeh (vx0, vx4);                                        \
-    vy1 = vec_mergel (vx0, vx4);                                        \
-    vy2 = vec_mergeh (vx1, vx5);                                        \
-    vy3 = vec_mergel (vx1, vx5);                                        \
-    vy4 = vec_mergeh (vx2, vx6);                                        \
-    vy5 = vec_mergel (vx2, vx6);                                        \
-    vy6 = vec_mergeh (vx3, vx7);                                        \
-    vy7 = vec_mergel (vx3, vx7);                                        \
-                                                                        \
-    vx0 = vec_adds (vec_mergeh (vy0, vy4), bias);                       \
-    vx1 = vec_mergel (vy0, vy4);                                        \
-    vx2 = vec_mergeh (vy1, vy5);                                        \
-    vx3 = vec_mergel (vy1, vy5);                                        \
-    vx4 = vec_mergeh (vy2, vy6);                                        \
-    vx5 = vec_mergel (vy2, vy6);                                        \
-    vx6 = vec_mergeh (vy3, vy7);                                        \
-    vx7 = vec_mergel (vy3, vy7);                                        \
-                                                                        \
-    IDCT_HALF                                                           \
-                                                                        \
-    shift = vec_splat_u16 (6);                                          \
-    vx0 = vec_sra (vy0, shift);                                         \
-    vx1 = vec_sra (vy1, shift);                                         \
-    vx2 = vec_sra (vy2, shift);                                         \
-    vx3 = vec_sra (vy3, shift);                                         \
-    vx4 = vec_sra (vy4, shift);                                         \
-    vx5 = vec_sra (vy5, shift);                                         \
-    vx6 = vec_sra (vy6, shift);                                         \
-    vx7 = vec_sra (vy7, shift);
-
-
-static const vec_s16 constants[5] = {
-    {23170, 13573,  6518, 21895, -23170, -21895,    32,    31},
-    {16384, 22725, 21407, 19266,  16384,  19266, 21407, 22725},
-    {22725, 31521, 29692, 26722,  22725,  26722, 29692, 31521},
-    {21407, 29692, 27969, 25172,  21407,  25172, 27969, 29692},
-    {19266, 26722, 25172, 22654,  19266,  22654, 25172, 26722}
-};
-
-void ff_idct_put_altivec(uint8_t* dest, int stride, int16_t *blk)
-{
-    vec_s16 *block = (vec_s16*)blk;
-    vec_u8 tmp;
-
-    IDCT
-
-#define COPY(dest,src)                                          \
-    tmp = vec_packsu (src, src);                                \
-    vec_ste ((vec_u32)tmp, 0, (unsigned int *)dest);       \
-    vec_ste ((vec_u32)tmp, 4, (unsigned int *)dest);
-
-    COPY (dest, vx0)    dest += stride;
-    COPY (dest, vx1)    dest += stride;
-    COPY (dest, vx2)    dest += stride;
-    COPY (dest, vx3)    dest += stride;
-    COPY (dest, vx4)    dest += stride;
-    COPY (dest, vx5)    dest += stride;
-    COPY (dest, vx6)    dest += stride;
-    COPY (dest, vx7)
-}
-
-void ff_idct_add_altivec(uint8_t* dest, int stride, int16_t *blk)
-{
-    vec_s16 *block = (vec_s16*)blk;
-    vec_u8 tmp;
-    vec_s16 tmp2, tmp3;
-    vec_u8 perm0;
-    vec_u8 perm1;
-    vec_u8 p0, p1, p;
-
-    IDCT
-
-    p0 = vec_lvsl (0, dest);
-    p1 = vec_lvsl (stride, dest);
-    p = vec_splat_u8 (-1);
-    perm0 = vec_mergeh (p, p0);
-    perm1 = vec_mergeh (p, p1);
-
-#define ADD(dest,src,perm)                                              \
-    /* *(uint64_t *)&tmp = *(uint64_t *)dest; */                        \
-    tmp = vec_ld (0, dest);                                             \
-    tmp2 = (vec_s16)vec_perm (tmp, (vec_u8)zero, perm);       \
-    tmp3 = vec_adds (tmp2, src);                                        \
-    tmp = vec_packsu (tmp3, tmp3);                                      \
-    vec_ste ((vec_u32)tmp, 0, (unsigned int *)dest);               \
-    vec_ste ((vec_u32)tmp, 4, (unsigned int *)dest);
-
-    ADD (dest, vx0, perm0)      dest += stride;
-    ADD (dest, vx1, perm1)      dest += stride;
-    ADD (dest, vx2, perm0)      dest += stride;
-    ADD (dest, vx3, perm1)      dest += stride;
-    ADD (dest, vx4, perm0)      dest += stride;
-    ADD (dest, vx5, perm1)      dest += stride;
-    ADD (dest, vx6, perm0)      dest += stride;
-    ADD (dest, vx7, perm1)
-}
diff --git a/deps/libav/libavcodec/ppc/int_altivec.c b/deps/libav/libavcodec/ppc/int_altivec.c
deleted file mode 100644
index 38ec99b..0000000
--- a/deps/libav/libavcodec/ppc/int_altivec.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2007 Luca Barbato <lu_zero at gentoo.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- ** @file
- ** integer misc ops.
- **/
-
-#include "config.h"
-#if HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-
-#include "libavutil/attributes.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavcodec/dsputil.h"
-
-#include "dsputil_altivec.h"
-
-static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2,
-                                     int size) {
-    int i, size16;
-    vector signed char vpix1;
-    vector signed short vpix2, vdiff, vpix1l,vpix1h;
-    union { vector signed int vscore;
-            int32_t score[4];
-          } u;
-    u.vscore = vec_splat_s32(0);
-//
-//XXX lazy way, fix it later
-
-#define vec_unaligned_load(b) \
-    vec_perm(vec_ld(0,b),vec_ld(15,b),vec_lvsl(0, b));
-
-    size16 = size >> 4;
-    while(size16) {
-//        score += (pix1[i]-pix2[i])*(pix1[i]-pix2[i]);
-        //load pix1 and the first batch of pix2
-
-        vpix1 = vec_unaligned_load(pix1);
-        vpix2 = vec_unaligned_load(pix2);
-        pix2 += 8;
-        //unpack
-        vpix1h = vec_unpackh(vpix1);
-        vdiff  = vec_sub(vpix1h, vpix2);
-        vpix1l = vec_unpackl(vpix1);
-        // load another batch from pix2
-        vpix2 = vec_unaligned_load(pix2);
-        u.vscore = vec_msum(vdiff, vdiff, u.vscore);
-        vdiff  = vec_sub(vpix1l, vpix2);
-        u.vscore = vec_msum(vdiff, vdiff, u.vscore);
-        pix1 += 16;
-        pix2 += 8;
-        size16--;
-    }
-    u.vscore = vec_sums(u.vscore, vec_splat_s32(0));
-
-    size %= 16;
-    for (i = 0; i < size; i++) {
-        u.score[3] += (pix1[i]-pix2[i])*(pix1[i]-pix2[i]);
-    }
-    return u.score[3];
-}
-
-static int32_t scalarproduct_int16_altivec(const int16_t *v1, const int16_t *v2,
-                                           int order)
-{
-    int i;
-    LOAD_ZERO;
-    register vec_s16 vec1;
-    register vec_s32 res = vec_splat_s32(0), t;
-    int32_t ires;
-
-    for(i = 0; i < order; i += 8){
-        vec1 = vec_unaligned_load(v1);
-        t = vec_msum(vec1, vec_ld(0, v2), zero_s32v);
-        res = vec_sums(t, res);
-        v1 += 8;
-        v2 += 8;
-    }
-    res = vec_splat(res, 3);
-    vec_ste(res, 0, &ires);
-    return ires;
-}
-
-static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1, const int16_t *v2, const int16_t *v3, int order, int mul)
-{
-    LOAD_ZERO;
-    vec_s16 *pv1 = (vec_s16*)v1;
-    register vec_s16 muls = {mul,mul,mul,mul,mul,mul,mul,mul};
-    register vec_s16 t0, t1, i0, i1, i4;
-    register vec_s16 i2 = vec_ld(0, v2), i3 = vec_ld(0, v3);
-    register vec_s32 res = zero_s32v;
-    register vec_u8 align = vec_lvsl(0, v2);
-    int32_t ires;
-    order >>= 4;
-    do {
-        i1 = vec_ld(16, v2);
-        t0 = vec_perm(i2, i1, align);
-        i2 = vec_ld(32, v2);
-        t1 = vec_perm(i1, i2, align);
-        i0 = pv1[0];
-        i1 = pv1[1];
-        res = vec_msum(t0, i0, res);
-        res = vec_msum(t1, i1, res);
-        i4 = vec_ld(16, v3);
-        t0 = vec_perm(i3, i4, align);
-        i3 = vec_ld(32, v3);
-        t1 = vec_perm(i4, i3, align);
-        pv1[0] = vec_mladd(t0, muls, i0);
-        pv1[1] = vec_mladd(t1, muls, i1);
-        pv1 += 2;
-        v2  += 16;
-        v3  += 16;
-    } while(--order);
-    res = vec_splat(vec_sums(res, zero_s32v), 3);
-    vec_ste(res, 0, &ires);
-    return ires;
-}
-
-av_cold void ff_int_init_altivec(DSPContext *c, AVCodecContext *avctx)
-{
-    c->ssd_int8_vs_int16 = ssd_int8_vs_int16_altivec;
-    c->scalarproduct_int16 = scalarproduct_int16_altivec;
-    c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_altivec;
-}
diff --git a/deps/libav/libavcodec/ppc/mathops.h b/deps/libav/libavcodec/ppc/mathops.h
deleted file mode 100644
index 34ddb11..0000000
--- a/deps/libav/libavcodec/ppc/mathops.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * simple math operations
- * Copyright (c) 2001, 2002 Fabrice Bellard
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at> et al
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PPC_MATHOPS_H
-#define AVCODEC_PPC_MATHOPS_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/common.h"
-
-#if HAVE_PPC4XX
-/* signed 16x16 -> 32 multiply add accumulate */
-#define MAC16(rt, ra, rb) \
-    __asm__ ("maclhw %0, %2, %3" : "=r" (rt) : "0" (rt), "r" (ra), "r" (rb));
-
-/* signed 16x16 -> 32 multiply */
-#define MUL16(ra, rb) \
-    ({ int __rt; \
-    __asm__ ("mullhw %0, %1, %2" : "=r" (__rt) : "r" (ra), "r" (rb)); \
-    __rt; })
-#endif
-
-#define MULH MULH
-static inline av_const int MULH(int a, int b){
-    int r;
-    __asm__ ("mulhw %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
-    return r;
-}
-
-#if !ARCH_PPC64
-static inline av_const int64_t MAC64(int64_t d, int a, int b)
-{
-    union { uint64_t x; unsigned hl[2]; } x = { d };
-    int h, l;
-    __asm__ ("mullw %3, %4, %5   \n\t"
-             "mulhw %2, %4, %5   \n\t"
-             "addc  %1, %1, %3   \n\t"
-             "adde  %0, %0, %2   \n\t"
-             : "+r"(x.hl[0]), "+r"(x.hl[1]), "=&r"(h), "=&r"(l)
-             : "r"(a), "r"(b));
-    return x.x;
-}
-#define MAC64(d, a, b) ((d) = MAC64(d, a, b))
-
-static inline av_const int64_t MLS64(int64_t d, int a, int b)
-{
-    union { uint64_t x; unsigned hl[2]; } x = { d };
-    int h, l;
-    __asm__ ("mullw %3, %4, %5   \n\t"
-             "mulhw %2, %4, %5   \n\t"
-             "subfc %1, %3, %1   \n\t"
-             "subfe %0, %2, %0   \n\t"
-             : "+r"(x.hl[0]), "+r"(x.hl[1]), "=&r"(h), "=&r"(l)
-             : "r"(a), "r"(b));
-    return x.x;
-}
-#define MLS64(d, a, b) ((d) = MLS64(d, a, b))
-#endif
-
-#endif /* AVCODEC_PPC_MATHOPS_H */
diff --git a/deps/libav/libavcodec/ppc/mpegaudiodsp_altivec.c b/deps/libav/libavcodec/ppc/mpegaudiodsp_altivec.c
deleted file mode 100644
index 6855c0b..0000000
--- a/deps/libav/libavcodec/ppc/mpegaudiodsp_altivec.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Altivec optimized MP3 decoding functions
- * Copyright (c) 2010 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/internal.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/mpegaudiodsp.h"
-#include "dsputil_altivec.h"
-
-#if HAVE_ALTIVEC
-
-#define MACS(rt, ra, rb) rt+=(ra)*(rb)
-#define MLSS(rt, ra, rb) rt-=(ra)*(rb)
-
-#define SUM8(op, sum, w, p)               \
-{                                         \
-    op(sum, (w)[0 * 64], (p)[0 * 64]);    \
-    op(sum, (w)[1 * 64], (p)[1 * 64]);    \
-    op(sum, (w)[2 * 64], (p)[2 * 64]);    \
-    op(sum, (w)[3 * 64], (p)[3 * 64]);    \
-    op(sum, (w)[4 * 64], (p)[4 * 64]);    \
-    op(sum, (w)[5 * 64], (p)[5 * 64]);    \
-    op(sum, (w)[6 * 64], (p)[6 * 64]);    \
-    op(sum, (w)[7 * 64], (p)[7 * 64]);    \
-}
-
-static void apply_window(const float *buf, const float *win1,
-                         const float *win2, float *sum1, float *sum2, int len)
-{
-    const vector float *win1a = (const vector float *) win1;
-    const vector float *win2a = (const vector float *) win2;
-    const vector float *bufa  = (const vector float *) buf;
-    vector float *sum1a = (vector float *) sum1;
-    vector float *sum2a = (vector float *) sum2;
-    vector float av_uninit(v0), av_uninit(v4);
-    vector float v1, v2, v3;
-
-    len = len >> 2;
-
-#define MULT(a, b)                         \
-    {                                      \
-        v1 = vec_ld(a, win1a);             \
-        v2 = vec_ld(b, win2a);             \
-        v3 = vec_ld(a, bufa);              \
-        v0 = vec_madd(v3, v1, v0);         \
-        v4 = vec_madd(v2, v3, v4);         \
-    }
-
-    while (len--) {
-        v0 = vec_xor(v0, v0);
-        v4 = vec_xor(v4, v4);
-
-        MULT(   0,   0);
-        MULT( 256,  64);
-        MULT( 512, 128);
-        MULT( 768, 192);
-        MULT(1024, 256);
-        MULT(1280, 320);
-        MULT(1536, 384);
-        MULT(1792, 448);
-
-        vec_st(v0, 0, sum1a);
-        vec_st(v4, 0, sum2a);
-        sum1a++;
-        sum2a++;
-        win1a++;
-        win2a++;
-        bufa++;
-    }
-}
-
-static void apply_window_mp3(float *in, float *win, int *unused, float *out,
-                             int incr)
-{
-    LOCAL_ALIGNED_16(float, suma, [17]);
-    LOCAL_ALIGNED_16(float, sumb, [17]);
-    LOCAL_ALIGNED_16(float, sumc, [17]);
-    LOCAL_ALIGNED_16(float, sumd, [17]);
-
-    float sum;
-    int j;
-    float *out2 = out + 32 * incr;
-
-    /* copy to avoid wrap */
-    memcpy(in + 512, in, 32 * sizeof(*in));
-
-    apply_window(in + 16, win     , win + 512, suma, sumc, 16);
-    apply_window(in + 32, win + 48, win + 640, sumb, sumd, 16);
-
-    SUM8(MLSS, suma[0], win + 32, in + 48);
-
-    sumc[ 0] = 0;
-    sumb[16] = 0;
-    sumd[16] = 0;
-
-    out[0  ]  = suma[   0];
-    out += incr;
-    out2 -= incr;
-    for(j=1;j<16;j++) {
-        *out  =  suma[   j] - sumd[16-j];
-        *out2 = -sumb[16-j] - sumc[   j];
-        out  += incr;
-        out2 -= incr;
-    }
-
-    sum = 0;
-    SUM8(MLSS, sum, win + 16 + 32, in + 32);
-    *out = sum;
-}
-
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_mpadsp_init_ppc(MPADSPContext *s)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    s->apply_window_float = apply_window_mp3;
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/mpegvideo_altivec.c b/deps/libav/libavcodec/ppc/mpegvideo_altivec.c
deleted file mode 100644
index 3d74029..0000000
--- a/deps/libav/libavcodec/ppc/mpegvideo_altivec.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2002 Dieter Shirley
- *
- * dct_unquantize_h263_altivec:
- * Copyright (c) 2003 Romain Dolbeau <romain at dolbeau.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/mpegvideo.h"
-#include "dsputil_altivec.h"
-
-#if HAVE_ALTIVEC
-
-/* AltiVec version of dct_unquantize_h263
-   this code assumes `block' is 16 bytes-aligned */
-static void dct_unquantize_h263_altivec(MpegEncContext *s,
-                                 int16_t *block, int n, int qscale)
-{
-    int i, level, qmul, qadd;
-    int nCoeffs;
-
-    assert(s->block_last_index[n]>=0);
-
-    qadd = (qscale - 1) | 1;
-    qmul = qscale << 1;
-
-    if (s->mb_intra) {
-        if (!s->h263_aic) {
-            if (n < 4)
-                block[0] = block[0] * s->y_dc_scale;
-            else
-                block[0] = block[0] * s->c_dc_scale;
-        }else
-            qadd = 0;
-        i = 1;
-        nCoeffs= 63; //does not always use zigzag table
-    } else {
-        i = 0;
-        nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
-    }
-
-    {
-        register const vector signed short vczero = (const vector signed short)vec_splat_s16(0);
-        DECLARE_ALIGNED(16, short, qmul8) = qmul;
-        DECLARE_ALIGNED(16, short, qadd8) = qadd;
-        register vector signed short blockv, qmulv, qaddv, nqaddv, temp1;
-        register vector bool short blockv_null, blockv_neg;
-        register short backup_0 = block[0];
-        register int j = 0;
-
-        qmulv = vec_splat((vec_s16)vec_lde(0, &qmul8), 0);
-        qaddv = vec_splat((vec_s16)vec_lde(0, &qadd8), 0);
-        nqaddv = vec_sub(vczero, qaddv);
-
-        // vectorize all the 16 bytes-aligned blocks
-        // of 8 elements
-        for(; (j + 7) <= nCoeffs ; j+=8) {
-            blockv = vec_ld(j << 1, block);
-            blockv_neg = vec_cmplt(blockv, vczero);
-            blockv_null = vec_cmpeq(blockv, vczero);
-            // choose between +qadd or -qadd as the third operand
-            temp1 = vec_sel(qaddv, nqaddv, blockv_neg);
-            // multiply & add (block{i,i+7} * qmul [+-] qadd)
-            temp1 = vec_mladd(blockv, qmulv, temp1);
-            // put 0 where block[{i,i+7} used to have 0
-            blockv = vec_sel(temp1, blockv, blockv_null);
-            vec_st(blockv, j << 1, block);
-        }
-
-        // if nCoeffs isn't a multiple of 8, finish the job
-        // using good old scalar units.
-        // (we could do it using a truncated vector,
-        // but I'm not sure it's worth the hassle)
-        for(; j <= nCoeffs ; j++) {
-            level = block[j];
-            if (level) {
-                if (level < 0) {
-                    level = level * qmul - qadd;
-                } else {
-                    level = level * qmul + qadd;
-                }
-                block[j] = level;
-            }
-        }
-
-        if (i == 1) {
-            // cheat. this avoid special-casing the first iteration
-            block[0] = backup_0;
-        }
-    }
-}
-
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_MPV_common_init_ppc(MpegEncContext *s)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    if ((s->avctx->dct_algo == FF_DCT_AUTO) ||
-        (s->avctx->dct_algo == FF_DCT_ALTIVEC)) {
-        s->dct_unquantize_h263_intra = dct_unquantize_h263_altivec;
-        s->dct_unquantize_h263_inter = dct_unquantize_h263_altivec;
-    }
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/vc1dsp_altivec.c b/deps/libav/libavcodec/ppc/vc1dsp_altivec.c
deleted file mode 100644
index 4695b1c..0000000
--- a/deps/libav/libavcodec/ppc/vc1dsp_altivec.c
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * VC-1 and WMV3 decoder - DSP functions AltiVec-optimized
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/vc1dsp.h"
-
-#if HAVE_ALTIVEC
-
-// main steps of 8x8 transform
-#define STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_rnd) \
-do { \
-    t0 = vec_sl(vec_add(s0, s4), vec_2); \
-    t0 = vec_add(vec_sl(t0, vec_1), t0); \
-    t0 = vec_add(t0, vec_rnd); \
-    t1 = vec_sl(vec_sub(s0, s4), vec_2); \
-    t1 = vec_add(vec_sl(t1, vec_1), t1); \
-    t1 = vec_add(t1, vec_rnd); \
-    t2 = vec_add(vec_sl(s6, vec_2), vec_sl(s6, vec_1)); \
-    t2 = vec_add(t2, vec_sl(s2, vec_4)); \
-    t3 = vec_add(vec_sl(s2, vec_2), vec_sl(s2, vec_1)); \
-    t3 = vec_sub(t3, vec_sl(s6, vec_4)); \
-    t4 = vec_add(t0, t2); \
-    t5 = vec_add(t1, t3); \
-    t6 = vec_sub(t1, t3); \
-    t7 = vec_sub(t0, t2); \
-\
-    t0 = vec_sl(vec_add(s1, s3), vec_4); \
-    t0 = vec_add(t0, vec_sl(s5, vec_3)); \
-    t0 = vec_add(t0, vec_sl(s7, vec_2)); \
-    t0 = vec_add(t0, vec_sub(s5, s3)); \
-\
-    t1 = vec_sl(vec_sub(s1, s5), vec_4); \
-    t1 = vec_sub(t1, vec_sl(s7, vec_3)); \
-    t1 = vec_sub(t1, vec_sl(s3, vec_2)); \
-    t1 = vec_sub(t1, vec_add(s1, s7)); \
-\
-    t2 = vec_sl(vec_sub(s7, s3), vec_4); \
-    t2 = vec_add(t2, vec_sl(s1, vec_3)); \
-    t2 = vec_add(t2, vec_sl(s5, vec_2)); \
-    t2 = vec_add(t2, vec_sub(s1, s7)); \
-\
-    t3 = vec_sl(vec_sub(s5, s7), vec_4); \
-    t3 = vec_sub(t3, vec_sl(s3, vec_3)); \
-    t3 = vec_add(t3, vec_sl(s1, vec_2)); \
-    t3 = vec_sub(t3, vec_add(s3, s5)); \
-\
-    s0 = vec_add(t4, t0); \
-    s1 = vec_add(t5, t1); \
-    s2 = vec_add(t6, t2); \
-    s3 = vec_add(t7, t3); \
-    s4 = vec_sub(t7, t3); \
-    s5 = vec_sub(t6, t2); \
-    s6 = vec_sub(t5, t1); \
-    s7 = vec_sub(t4, t0); \
-}while(0)
-
-#define SHIFT_HOR8(s0, s1, s2, s3, s4, s5, s6, s7) \
-do { \
-    s0 = vec_sra(s0, vec_3); \
-    s1 = vec_sra(s1, vec_3); \
-    s2 = vec_sra(s2, vec_3); \
-    s3 = vec_sra(s3, vec_3); \
-    s4 = vec_sra(s4, vec_3); \
-    s5 = vec_sra(s5, vec_3); \
-    s6 = vec_sra(s6, vec_3); \
-    s7 = vec_sra(s7, vec_3); \
-}while(0)
-
-#define SHIFT_VERT8(s0, s1, s2, s3, s4, s5, s6, s7) \
-do { \
-    s0 = vec_sra(s0, vec_7); \
-    s1 = vec_sra(s1, vec_7); \
-    s2 = vec_sra(s2, vec_7); \
-    s3 = vec_sra(s3, vec_7); \
-    s4 = vec_sra(vec_add(s4, vec_1s), vec_7); \
-    s5 = vec_sra(vec_add(s5, vec_1s), vec_7); \
-    s6 = vec_sra(vec_add(s6, vec_1s), vec_7); \
-    s7 = vec_sra(vec_add(s7, vec_1s), vec_7); \
-}while(0)
-
-/* main steps of 4x4 transform */
-#define STEP4(s0, s1, s2, s3, vec_rnd) \
-do { \
-    t1 = vec_add(vec_sl(s0, vec_4), s0); \
-    t1 = vec_add(t1, vec_rnd); \
-    t2 = vec_add(vec_sl(s2, vec_4), s2); \
-    t0 = vec_add(t1, t2); \
-    t1 = vec_sub(t1, t2); \
-    t3 = vec_sl(vec_sub(s3, s1), vec_1); \
-    t3 = vec_add(t3, vec_sl(t3, vec_2)); \
-    t2 = vec_add(t3, vec_sl(s1, vec_5)); \
-    t3 = vec_add(t3, vec_sl(s3, vec_3)); \
-    t3 = vec_add(t3, vec_sl(s3, vec_2)); \
-    s0 = vec_add(t0, t2); \
-    s1 = vec_sub(t1, t3); \
-    s2 = vec_add(t1, t3); \
-    s3 = vec_sub(t0, t2); \
-}while (0)
-
-#define SHIFT_HOR4(s0, s1, s2, s3) \
-    s0 = vec_sra(s0, vec_3); \
-    s1 = vec_sra(s1, vec_3); \
-    s2 = vec_sra(s2, vec_3); \
-    s3 = vec_sra(s3, vec_3);
-
-#define SHIFT_VERT4(s0, s1, s2, s3) \
-    s0 = vec_sra(s0, vec_7); \
-    s1 = vec_sra(s1, vec_7); \
-    s2 = vec_sra(s2, vec_7); \
-    s3 = vec_sra(s3, vec_7);
-
-/** Do inverse transform on 8x8 block
-*/
-static void vc1_inv_trans_8x8_altivec(int16_t block[64])
-{
-    vector signed short src0, src1, src2, src3, src4, src5, src6, src7;
-    vector signed int s0, s1, s2, s3, s4, s5, s6, s7;
-    vector signed int s8, s9, sA, sB, sC, sD, sE, sF;
-    vector signed int t0, t1, t2, t3, t4, t5, t6, t7;
-    const vector signed int vec_64 = vec_sl(vec_splat_s32(4), vec_splat_u32(4));
-    const vector unsigned int vec_7 = vec_splat_u32(7);
-    const vector unsigned int vec_4 = vec_splat_u32(4);
-    const vector  signed int vec_4s = vec_splat_s32(4);
-    const vector unsigned int vec_3 = vec_splat_u32(3);
-    const vector unsigned int vec_2 = vec_splat_u32(2);
-    const vector  signed int vec_1s = vec_splat_s32(1);
-    const vector unsigned int vec_1 = vec_splat_u32(1);
-
-    src0 = vec_ld(  0, block);
-    src1 = vec_ld( 16, block);
-    src2 = vec_ld( 32, block);
-    src3 = vec_ld( 48, block);
-    src4 = vec_ld( 64, block);
-    src5 = vec_ld( 80, block);
-    src6 = vec_ld( 96, block);
-    src7 = vec_ld(112, block);
-
-    s0 = vec_unpackl(src0);
-    s1 = vec_unpackl(src1);
-    s2 = vec_unpackl(src2);
-    s3 = vec_unpackl(src3);
-    s4 = vec_unpackl(src4);
-    s5 = vec_unpackl(src5);
-    s6 = vec_unpackl(src6);
-    s7 = vec_unpackl(src7);
-    s8 = vec_unpackh(src0);
-    s9 = vec_unpackh(src1);
-    sA = vec_unpackh(src2);
-    sB = vec_unpackh(src3);
-    sC = vec_unpackh(src4);
-    sD = vec_unpackh(src5);
-    sE = vec_unpackh(src6);
-    sF = vec_unpackh(src7);
-    STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_4s);
-    SHIFT_HOR8(s0, s1, s2, s3, s4, s5, s6, s7);
-    STEP8(s8, s9, sA, sB, sC, sD, sE, sF, vec_4s);
-    SHIFT_HOR8(s8, s9, sA, sB, sC, sD, sE, sF);
-    src0 = vec_pack(s8, s0);
-    src1 = vec_pack(s9, s1);
-    src2 = vec_pack(sA, s2);
-    src3 = vec_pack(sB, s3);
-    src4 = vec_pack(sC, s4);
-    src5 = vec_pack(sD, s5);
-    src6 = vec_pack(sE, s6);
-    src7 = vec_pack(sF, s7);
-    TRANSPOSE8(src0, src1, src2, src3, src4, src5, src6, src7);
-
-    s0 = vec_unpackl(src0);
-    s1 = vec_unpackl(src1);
-    s2 = vec_unpackl(src2);
-    s3 = vec_unpackl(src3);
-    s4 = vec_unpackl(src4);
-    s5 = vec_unpackl(src5);
-    s6 = vec_unpackl(src6);
-    s7 = vec_unpackl(src7);
-    s8 = vec_unpackh(src0);
-    s9 = vec_unpackh(src1);
-    sA = vec_unpackh(src2);
-    sB = vec_unpackh(src3);
-    sC = vec_unpackh(src4);
-    sD = vec_unpackh(src5);
-    sE = vec_unpackh(src6);
-    sF = vec_unpackh(src7);
-    STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_64);
-    SHIFT_VERT8(s0, s1, s2, s3, s4, s5, s6, s7);
-    STEP8(s8, s9, sA, sB, sC, sD, sE, sF, vec_64);
-    SHIFT_VERT8(s8, s9, sA, sB, sC, sD, sE, sF);
-    src0 = vec_pack(s8, s0);
-    src1 = vec_pack(s9, s1);
-    src2 = vec_pack(sA, s2);
-    src3 = vec_pack(sB, s3);
-    src4 = vec_pack(sC, s4);
-    src5 = vec_pack(sD, s5);
-    src6 = vec_pack(sE, s6);
-    src7 = vec_pack(sF, s7);
-
-    vec_st(src0,  0, block);
-    vec_st(src1, 16, block);
-    vec_st(src2, 32, block);
-    vec_st(src3, 48, block);
-    vec_st(src4, 64, block);
-    vec_st(src5, 80, block);
-    vec_st(src6, 96, block);
-    vec_st(src7,112, block);
-}
-
-/** Do inverse transform on 8x4 part of block
-*/
-static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, int16_t *block)
-{
-    vector signed short src0, src1, src2, src3, src4, src5, src6, src7;
-    vector signed int s0, s1, s2, s3, s4, s5, s6, s7;
-    vector signed int s8, s9, sA, sB, sC, sD, sE, sF;
-    vector signed int t0, t1, t2, t3, t4, t5, t6, t7;
-    const vector signed int vec_64 = vec_sl(vec_splat_s32(4), vec_splat_u32(4));
-    const vector unsigned int vec_7 = vec_splat_u32(7);
-    const vector unsigned int vec_5 = vec_splat_u32(5);
-    const vector unsigned int vec_4 = vec_splat_u32(4);
-    const vector  signed int vec_4s = vec_splat_s32(4);
-    const vector unsigned int vec_3 = vec_splat_u32(3);
-    const vector unsigned int vec_2 = vec_splat_u32(2);
-    const vector unsigned int vec_1 = vec_splat_u32(1);
-    vector unsigned char tmp;
-    vector signed short tmp2, tmp3;
-    vector unsigned char perm0, perm1, p0, p1, p;
-
-    src0 = vec_ld(  0, block);
-    src1 = vec_ld( 16, block);
-    src2 = vec_ld( 32, block);
-    src3 = vec_ld( 48, block);
-    src4 = vec_ld( 64, block);
-    src5 = vec_ld( 80, block);
-    src6 = vec_ld( 96, block);
-    src7 = vec_ld(112, block);
-
-    TRANSPOSE8(src0, src1, src2, src3, src4, src5, src6, src7);
-    s0 = vec_unpackl(src0);
-    s1 = vec_unpackl(src1);
-    s2 = vec_unpackl(src2);
-    s3 = vec_unpackl(src3);
-    s4 = vec_unpackl(src4);
-    s5 = vec_unpackl(src5);
-    s6 = vec_unpackl(src6);
-    s7 = vec_unpackl(src7);
-    s8 = vec_unpackh(src0);
-    s9 = vec_unpackh(src1);
-    sA = vec_unpackh(src2);
-    sB = vec_unpackh(src3);
-    sC = vec_unpackh(src4);
-    sD = vec_unpackh(src5);
-    sE = vec_unpackh(src6);
-    sF = vec_unpackh(src7);
-    STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_4s);
-    SHIFT_HOR8(s0, s1, s2, s3, s4, s5, s6, s7);
-    STEP8(s8, s9, sA, sB, sC, sD, sE, sF, vec_4s);
-    SHIFT_HOR8(s8, s9, sA, sB, sC, sD, sE, sF);
-    src0 = vec_pack(s8, s0);
-    src1 = vec_pack(s9, s1);
-    src2 = vec_pack(sA, s2);
-    src3 = vec_pack(sB, s3);
-    src4 = vec_pack(sC, s4);
-    src5 = vec_pack(sD, s5);
-    src6 = vec_pack(sE, s6);
-    src7 = vec_pack(sF, s7);
-    TRANSPOSE8(src0, src1, src2, src3, src4, src5, src6, src7);
-
-    s0 = vec_unpackh(src0);
-    s1 = vec_unpackh(src1);
-    s2 = vec_unpackh(src2);
-    s3 = vec_unpackh(src3);
-    s8 = vec_unpackl(src0);
-    s9 = vec_unpackl(src1);
-    sA = vec_unpackl(src2);
-    sB = vec_unpackl(src3);
-    STEP4(s0, s1, s2, s3, vec_64);
-    SHIFT_VERT4(s0, s1, s2, s3);
-    STEP4(s8, s9, sA, sB, vec_64);
-    SHIFT_VERT4(s8, s9, sA, sB);
-    src0 = vec_pack(s0, s8);
-    src1 = vec_pack(s1, s9);
-    src2 = vec_pack(s2, sA);
-    src3 = vec_pack(s3, sB);
-
-    p0 = vec_lvsl (0, dest);
-    p1 = vec_lvsl (stride, dest);
-    p = vec_splat_u8 (-1);
-    perm0 = vec_mergeh (p, p0);
-    perm1 = vec_mergeh (p, p1);
-
-#define ADD(dest,src,perm)                                              \
-    /* *(uint64_t *)&tmp = *(uint64_t *)dest; */                        \
-    tmp = vec_ld (0, dest);                                             \
-    tmp2 = (vector signed short)vec_perm (tmp, vec_splat_u8(0), perm);  \
-    tmp3 = vec_adds (tmp2, src);                                        \
-    tmp = vec_packsu (tmp3, tmp3);                                      \
-    vec_ste ((vector unsigned int)tmp, 0, (unsigned int *)dest);        \
-    vec_ste ((vector unsigned int)tmp, 4, (unsigned int *)dest);
-
-    ADD (dest, src0, perm0)      dest += stride;
-    ADD (dest, src1, perm1)      dest += stride;
-    ADD (dest, src2, perm0)      dest += stride;
-    ADD (dest, src3, perm1)
-}
-
-#define PUT_OP_U8_ALTIVEC(d, s, dst) d = s
-#define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s)
-
-#define OP_U8_ALTIVEC                          PUT_OP_U8_ALTIVEC
-#define PREFIX_no_rnd_vc1_chroma_mc8_altivec   put_no_rnd_vc1_chroma_mc8_altivec
-#include "h264chroma_template.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_no_rnd_vc1_chroma_mc8_altivec
-
-#define OP_U8_ALTIVEC                          AVG_OP_U8_ALTIVEC
-#define PREFIX_no_rnd_vc1_chroma_mc8_altivec   avg_no_rnd_vc1_chroma_mc8_altivec
-#include "h264chroma_template.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_no_rnd_vc1_chroma_mc8_altivec
-
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_vc1dsp_init_ppc(VC1DSPContext *dsp)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_altivec;
-    dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_altivec;
-    dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_altivec;
-    dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_altivec;
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/videodsp_ppc.c b/deps/libav/libavcodec/ppc/videodsp_ppc.c
deleted file mode 100644
index b9e003b..0000000
--- a/deps/libav/libavcodec/ppc/videodsp_ppc.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2003-2004 Romain Dolbeau
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavcodec/videodsp.h"
-
-static void prefetch_ppc(uint8_t *mem, ptrdiff_t stride, int h)
-{
-    register const uint8_t *p = mem;
-    do {
-        __asm__ volatile ("dcbt 0,%0" : : "r" (p));
-        p += stride;
-    } while(--h);
-}
-
-av_cold void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc)
-{
-    ctx->prefetch = prefetch_ppc;
-}
diff --git a/deps/libav/libavcodec/ppc/vorbisdsp_altivec.c b/deps/libav/libavcodec/ppc/vorbisdsp_altivec.c
deleted file mode 100644
index 56a865d..0000000
--- a/deps/libav/libavcodec/ppc/vorbisdsp_altivec.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2006 Luca Barbato <lu_zero at gentoo.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#if HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavcodec/vorbisdsp.h"
-
-#if HAVE_ALTIVEC
-static void vorbis_inverse_coupling_altivec(float *mag, float *ang,
-                                            intptr_t blocksize)
-{
-    int i;
-    vector float m, a;
-    vector bool int t0, t1;
-    const vector unsigned int v_31 = //XXX
-        vec_add(vec_add(vec_splat_u32(15),vec_splat_u32(15)),vec_splat_u32(1));
-    for (i = 0; i < blocksize; i += 4) {
-        m = vec_ld(0, mag+i);
-        a = vec_ld(0, ang+i);
-        t0 = vec_cmple(m, (vector float)vec_splat_u32(0));
-        t1 = vec_cmple(a, (vector float)vec_splat_u32(0));
-        a = vec_xor(a, (vector float) vec_sl((vector unsigned int)t0, v_31));
-        t0 = (vector bool int)vec_and(a, t1);
-        t1 = (vector bool int)vec_andc(a, t1);
-        a = vec_sub(m, (vector float)t1);
-        m = vec_add(m, (vector float)t0);
-        vec_stl(a, 0, ang+i);
-        vec_stl(m, 0, mag+i);
-    }
-}
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_vorbisdsp_init_ppc(VorbisDSPContext *c)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    c->vorbis_inverse_coupling = vorbis_inverse_coupling_altivec;
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/ppc/vp3dsp_altivec.c b/deps/libav/libavcodec/ppc/vp3dsp_altivec.c
deleted file mode 100644
index bf50c02..0000000
--- a/deps/libav/libavcodec/ppc/vp3dsp_altivec.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2009 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/vp3dsp.h"
-#include "dsputil_altivec.h"
-
-#if HAVE_ALTIVEC
-
-static const vec_s16 constants =
-    {0, 64277, 60547, 54491, 46341, 36410, 25080, 12785};
-static const vec_u8 interleave_high =
-    {0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29};
-
-#define IDCT_START \
-    vec_s16 A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H;\
-    vec_s16 Ed, Gd, Add, Bdd, Fd, Hd;\
-    vec_s16 eight = vec_splat_s16(8);\
-    vec_u16 four = vec_splat_u16(4);\
-\
-    vec_s16 C1 = vec_splat(constants, 1);\
-    vec_s16 C2 = vec_splat(constants, 2);\
-    vec_s16 C3 = vec_splat(constants, 3);\
-    vec_s16 C4 = vec_splat(constants, 4);\
-    vec_s16 C5 = vec_splat(constants, 5);\
-    vec_s16 C6 = vec_splat(constants, 6);\
-    vec_s16 C7 = vec_splat(constants, 7);\
-\
-    vec_s16 b0 = vec_ld(0x00, block);\
-    vec_s16 b1 = vec_ld(0x10, block);\
-    vec_s16 b2 = vec_ld(0x20, block);\
-    vec_s16 b3 = vec_ld(0x30, block);\
-    vec_s16 b4 = vec_ld(0x40, block);\
-    vec_s16 b5 = vec_ld(0x50, block);\
-    vec_s16 b6 = vec_ld(0x60, block);\
-    vec_s16 b7 = vec_ld(0x70, block);
-
-// these functions do (a*C)>>16
-// things are tricky because a is signed, but C unsigned.
-// M15 is used if C fits in 15 bit unsigned (C6,C7)
-// M16 is used if C requires 16 bits unsigned
-static inline vec_s16 M15(vec_s16 a, vec_s16 C)
-{
-    return (vec_s16)vec_perm(vec_mule(a,C), vec_mulo(a,C), interleave_high);
-}
-static inline vec_s16 M16(vec_s16 a, vec_s16 C)
-{
-    return vec_add(a, M15(a, C));
-}
-
-#define IDCT_1D(ADD, SHIFT)\
-    A = vec_add(M16(b1, C1), M15(b7, C7));\
-    B = vec_sub(M15(b1, C7), M16(b7, C1));\
-    C = vec_add(M16(b3, C3), M16(b5, C5));\
-    D = vec_sub(M16(b5, C3), M16(b3, C5));\
-\
-    Ad = M16(vec_sub(A, C), C4);\
-    Bd = M16(vec_sub(B, D), C4);\
-\
-    Cd = vec_add(A, C);\
-    Dd = vec_add(B, D);\
-\
-    E = ADD(M16(vec_add(b0, b4), C4));\
-    F = ADD(M16(vec_sub(b0, b4), C4));\
-\
-    G = vec_add(M16(b2, C2), M15(b6, C6));\
-    H = vec_sub(M15(b2, C6), M16(b6, C2));\
-\
-    Ed = vec_sub(E, G);\
-    Gd = vec_add(E, G);\
-\
-    Add = vec_add(F, Ad);\
-    Bdd = vec_sub(Bd, H);\
-\
-    Fd = vec_sub(F, Ad);\
-    Hd = vec_add(Bd, H);\
-\
-    b0 = SHIFT(vec_add(Gd, Cd));\
-    b7 = SHIFT(vec_sub(Gd, Cd));\
-\
-    b1 = SHIFT(vec_add(Add, Hd));\
-    b2 = SHIFT(vec_sub(Add, Hd));\
-\
-    b3 = SHIFT(vec_add(Ed, Dd));\
-    b4 = SHIFT(vec_sub(Ed, Dd));\
-\
-    b5 = SHIFT(vec_add(Fd, Bdd));\
-    b6 = SHIFT(vec_sub(Fd, Bdd));
-
-#define NOP(a) a
-#define ADD8(a) vec_add(a, eight)
-#define SHIFT4(a) vec_sra(a, four)
-
-static void vp3_idct_put_altivec(uint8_t *dst, int stride, int16_t block[64])
-{
-    vec_u8 t;
-    IDCT_START
-
-    // pixels are signed; so add 128*16 in addition to the normal 8
-    vec_s16 v2048 = vec_sl(vec_splat_s16(1), vec_splat_u16(11));
-    eight = vec_add(eight, v2048);
-
-    IDCT_1D(NOP, NOP)
-    TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7);
-    IDCT_1D(ADD8, SHIFT4)
-
-#define PUT(a)\
-    t = vec_packsu(a, a);\
-    vec_ste((vec_u32)t, 0, (unsigned int *)dst);\
-    vec_ste((vec_u32)t, 4, (unsigned int *)dst);
-
-    PUT(b0)     dst += stride;
-    PUT(b1)     dst += stride;
-    PUT(b2)     dst += stride;
-    PUT(b3)     dst += stride;
-    PUT(b4)     dst += stride;
-    PUT(b5)     dst += stride;
-    PUT(b6)     dst += stride;
-    PUT(b7)
-    memset(block, 0, sizeof(*block) * 64);
-}
-
-static void vp3_idct_add_altivec(uint8_t *dst, int stride, int16_t block[64])
-{
-    LOAD_ZERO;
-    vec_u8 t, vdst;
-    vec_s16 vdst_16;
-    vec_u8 vdst_mask = vec_mergeh(vec_splat_u8(-1), vec_lvsl(0, dst));
-
-    IDCT_START
-
-    IDCT_1D(NOP, NOP)
-    TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7);
-    IDCT_1D(ADD8, SHIFT4)
-
-#define ADD(a)\
-    vdst = vec_ld(0, dst);\
-    vdst_16 = (vec_s16)vec_perm(vdst, zero_u8v, vdst_mask);\
-    vdst_16 = vec_adds(a, vdst_16);\
-    t = vec_packsu(vdst_16, vdst_16);\
-    vec_ste((vec_u32)t, 0, (unsigned int *)dst);\
-    vec_ste((vec_u32)t, 4, (unsigned int *)dst);
-
-    ADD(b0)     dst += stride;
-    ADD(b1)     dst += stride;
-    ADD(b2)     dst += stride;
-    ADD(b3)     dst += stride;
-    ADD(b4)     dst += stride;
-    ADD(b5)     dst += stride;
-    ADD(b6)     dst += stride;
-    ADD(b7)
-    memset(block, 0, sizeof(*block) * 64);
-}
-
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    c->idct_put = vp3_idct_put_altivec;
-    c->idct_add = vp3_idct_add_altivec;
-#endif
-}
diff --git a/deps/libav/libavcodec/ppc/vp8dsp_altivec.c b/deps/libav/libavcodec/ppc/vp8dsp_altivec.c
deleted file mode 100644
index 2e6d0fa..0000000
--- a/deps/libav/libavcodec/ppc/vp8dsp_altivec.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * VP8 compatible video decoder
- *
- * Copyright (C) 2010 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/mem.h"
-#include "libavutil/ppc/types_altivec.h"
-#include "libavutil/ppc/util_altivec.h"
-#include "libavcodec/vp8dsp.h"
-#include "dsputil_altivec.h"
-
-#if HAVE_ALTIVEC
-#define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ }
-
-// h subpel filter uses msum to multiply+add 4 pixel taps at once
-static const vec_s8 h_subpel_filters_inner[7] =
-{
-    REPT4( -6, 123,  12,  -1),
-    REPT4(-11, 108,  36,  -8),
-    REPT4( -9,  93,  50,  -6),
-    REPT4(-16,  77,  77, -16),
-    REPT4( -6,  50,  93,  -9),
-    REPT4( -8,  36, 108, -11),
-    REPT4( -1,  12, 123,  -6),
-};
-
-// for 6tap filters, these are the outer two taps
-// The zeros mask off pixels 4-7 when filtering 0-3
-// and vice-versa
-static const vec_s8 h_subpel_filters_outer[3] =
-{
-    REPT4(0, 0, 2, 1),
-    REPT4(0, 0, 3, 3),
-    REPT4(0, 0, 1, 2),
-};
-
-#define LOAD_H_SUBPEL_FILTER(i) \
-    vec_s8 filter_inner  = h_subpel_filters_inner[i]; \
-    vec_s8 filter_outerh = h_subpel_filters_outer[(i)>>1]; \
-    vec_s8 filter_outerl = vec_sld(filter_outerh, filter_outerh, 2)
-
-#define FILTER_H(dstv, off) \
-    a = vec_ld((off)-is6tap-1,    src); \
-    b = vec_ld((off)-is6tap-1+15, src); \
-\
-    pixh  = vec_perm(a, b, permh##off); \
-    pixl  = vec_perm(a, b, perml##off); \
-    filth = vec_msum(filter_inner, pixh, c64); \
-    filtl = vec_msum(filter_inner, pixl, c64); \
-\
-    if (is6tap) { \
-        outer = vec_perm(a, b, perm_6tap##off); \
-        filth = vec_msum(filter_outerh, outer, filth); \
-        filtl = vec_msum(filter_outerl, outer, filtl); \
-    } \
-    if (w == 4) \
-        filtl = filth; /* discard pixels 4-7 */ \
-    dstv = vec_packs(filth, filtl); \
-    dstv = vec_sra(dstv, c7)
-
-static av_always_inline
-void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
-                                 uint8_t *src, ptrdiff_t src_stride,
-                                 int h, int mx, int w, int is6tap)
-{
-    LOAD_H_SUBPEL_FILTER(mx-1);
-    vec_u8 align_vec0, align_vec8, permh0, permh8, filt;
-    vec_u8 perm_6tap0, perm_6tap8, perml0, perml8;
-    vec_u8 a, b, pixh, pixl, outer;
-    vec_s16 f16h, f16l;
-    vec_s32 filth, filtl;
-
-    vec_u8 perm_inner6 = { 1,2,3,4, 2,3,4,5, 3,4,5,6, 4,5,6,7 };
-    vec_u8 perm_inner4 = { 0,1,2,3, 1,2,3,4, 2,3,4,5, 3,4,5,6 };
-    vec_u8 perm_inner  = is6tap ? perm_inner6 : perm_inner4;
-    vec_u8 perm_outer = { 4,9, 0,5, 5,10, 1,6, 6,11, 2,7, 7,12, 3,8 };
-    vec_s32 c64 = vec_sl(vec_splat_s32(1), vec_splat_u32(6));
-    vec_u16 c7  = vec_splat_u16(7);
-
-    align_vec0 = vec_lvsl( -is6tap-1, src);
-    align_vec8 = vec_lvsl(8-is6tap-1, src);
-
-    permh0     = vec_perm(align_vec0, align_vec0, perm_inner);
-    permh8     = vec_perm(align_vec8, align_vec8, perm_inner);
-    perm_inner = vec_add(perm_inner, vec_splat_u8(4));
-    perml0     = vec_perm(align_vec0, align_vec0, perm_inner);
-    perml8     = vec_perm(align_vec8, align_vec8, perm_inner);
-    perm_6tap0 = vec_perm(align_vec0, align_vec0, perm_outer);
-    perm_6tap8 = vec_perm(align_vec8, align_vec8, perm_outer);
-
-    while (h --> 0) {
-        FILTER_H(f16h, 0);
-
-        if (w == 16) {
-            FILTER_H(f16l, 8);
-            filt = vec_packsu(f16h, f16l);
-            vec_st(filt, 0, dst);
-        } else {
-            filt = vec_packsu(f16h, f16h);
-            vec_ste((vec_u32)filt, 0, (uint32_t*)dst);
-            if (w == 8)
-                vec_ste((vec_u32)filt, 4, (uint32_t*)dst);
-        }
-        src += src_stride;
-        dst += dst_stride;
-    }
-}
-
-// v subpel filter does a simple vertical multiply + add
-static const vec_u8 v_subpel_filters[7] =
-{
-    { 0,   6, 123,  12,   1,   0 },
-    { 2,  11, 108,  36,   8,   1 },
-    { 0,   9,  93,  50,   6,   0 },
-    { 3,  16,  77,  77,  16,   3 },
-    { 0,   6,  50,  93,   9,   0 },
-    { 1,   8,  36, 108,  11,   2 },
-    { 0,   1,  12, 123,   6,   0 },
-};
-
-#define LOAD_V_SUBPEL_FILTER(i) \
-    vec_u8 subpel_filter = v_subpel_filters[i]; \
-    vec_u8 f0 = vec_splat(subpel_filter, 0); \
-    vec_u8 f1 = vec_splat(subpel_filter, 1); \
-    vec_u8 f2 = vec_splat(subpel_filter, 2); \
-    vec_u8 f3 = vec_splat(subpel_filter, 3); \
-    vec_u8 f4 = vec_splat(subpel_filter, 4); \
-    vec_u8 f5 = vec_splat(subpel_filter, 5)
-
-#define FILTER_V(dstv, vec_mul) \
-    s1f = (vec_s16)vec_mul(s1, f1); \
-    s2f = (vec_s16)vec_mul(s2, f2); \
-    s3f = (vec_s16)vec_mul(s3, f3); \
-    s4f = (vec_s16)vec_mul(s4, f4); \
-    s2f = vec_subs(s2f, s1f); \
-    s3f = vec_subs(s3f, s4f); \
-    if (is6tap) { \
-        s0f = (vec_s16)vec_mul(s0, f0); \
-        s5f = (vec_s16)vec_mul(s5, f5); \
-        s2f = vec_adds(s2f, s0f); \
-        s3f = vec_adds(s3f, s5f); \
-    } \
-    dstv = vec_adds(s2f, s3f); \
-    dstv = vec_adds(dstv, c64); \
-    dstv = vec_sra(dstv, c7)
-
-static av_always_inline
-void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
-                                 uint8_t *src, ptrdiff_t src_stride,
-                                 int h, int my, int w, int is6tap)
-{
-    LOAD_V_SUBPEL_FILTER(my-1);
-    vec_u8 s0, s1, s2, s3, s4, s5, filt, align_vech, perm_vec, align_vecl;
-    vec_s16 s0f, s1f, s2f, s3f, s4f, s5f, f16h, f16l;
-    vec_s16 c64 = vec_sl(vec_splat_s16(1), vec_splat_u16(6));
-    vec_u16 c7  = vec_splat_u16(7);
-
-    // we want pixels 0-7 to be in the even positions and 8-15 in the odd,
-    // so combine this permute with the alignment permute vector
-    align_vech = vec_lvsl(0, src);
-    align_vecl = vec_sld(align_vech, align_vech, 8);
-    if (w ==16)
-        perm_vec = vec_mergeh(align_vech, align_vecl);
-    else
-        perm_vec = vec_mergeh(align_vech, align_vech);
-
-    if (is6tap)
-        s0 = load_with_perm_vec(-2*src_stride, src, perm_vec);
-    s1 = load_with_perm_vec(-1*src_stride, src, perm_vec);
-    s2 = load_with_perm_vec( 0*src_stride, src, perm_vec);
-    s3 = load_with_perm_vec( 1*src_stride, src, perm_vec);
-    if (is6tap)
-        s4 = load_with_perm_vec( 2*src_stride, src, perm_vec);
-
-    src += (2+is6tap)*src_stride;
-
-    while (h --> 0) {
-        if (is6tap)
-            s5 = load_with_perm_vec(0, src, perm_vec);
-        else
-            s4 = load_with_perm_vec(0, src, perm_vec);
-
-        FILTER_V(f16h, vec_mule);
-
-        if (w == 16) {
-            FILTER_V(f16l, vec_mulo);
-            filt = vec_packsu(f16h, f16l);
-            vec_st(filt, 0, dst);
-        } else {
-            filt = vec_packsu(f16h, f16h);
-            if (w == 4)
-                filt = (vec_u8)vec_splat((vec_u32)filt, 0);
-            else
-                vec_ste((vec_u32)filt, 4, (uint32_t*)dst);
-            vec_ste((vec_u32)filt, 0, (uint32_t*)dst);
-        }
-
-        if (is6tap)
-            s0 = s1;
-        s1 = s2;
-        s2 = s3;
-        s3 = s4;
-        if (is6tap)
-            s4 = s5;
-
-        dst += dst_stride;
-        src += src_stride;
-    }
-}
-
-#define EPEL_FUNCS(WIDTH, TAPS) \
-static av_noinline \
-void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
-{ \
-    put_vp8_epel_h_altivec_core(dst, dst_stride, src, src_stride, h, mx, WIDTH, TAPS == 6); \
-} \
-\
-static av_noinline \
-void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
-{ \
-    put_vp8_epel_v_altivec_core(dst, dst_stride, src, src_stride, h, my, WIDTH, TAPS == 6); \
-}
-
-#define EPEL_HV(WIDTH, HTAPS, VTAPS) \
-static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
-{ \
-    DECLARE_ALIGNED(16, uint8_t, tmp)[(2*WIDTH+5)*16]; \
-    if (VTAPS == 6) { \
-        put_vp8_epel ## WIDTH ## _h ## HTAPS ## _altivec(tmp, 16,      src-2*sstride, sstride, h+5, mx, my); \
-        put_vp8_epel ## WIDTH ## _v ## VTAPS ## _altivec(dst, dstride, tmp+2*16,      16,      h,   mx, my); \
-    } else { \
-        put_vp8_epel ## WIDTH ## _h ## HTAPS ## _altivec(tmp, 16,      src-sstride, sstride, h+4, mx, my); \
-        put_vp8_epel ## WIDTH ## _v ## VTAPS ## _altivec(dst, dstride, tmp+16,      16,      h,   mx, my); \
-    } \
-}
-
-EPEL_FUNCS(16,6)
-EPEL_FUNCS(8, 6)
-EPEL_FUNCS(8, 4)
-EPEL_FUNCS(4, 6)
-EPEL_FUNCS(4, 4)
-
-EPEL_HV(16, 6,6)
-EPEL_HV(8,  6,6)
-EPEL_HV(8,  4,6)
-EPEL_HV(8,  6,4)
-EPEL_HV(8,  4,4)
-EPEL_HV(4,  6,6)
-EPEL_HV(4,  4,6)
-EPEL_HV(4,  6,4)
-EPEL_HV(4,  4,4)
-
-static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my)
-{
-    register vector unsigned char pixelsv1, pixelsv2;
-    register vector unsigned char pixelsv1B, pixelsv2B;
-    register vector unsigned char pixelsv1C, pixelsv2C;
-    register vector unsigned char pixelsv1D, pixelsv2D;
-
-    register vector unsigned char perm = vec_lvsl(0, src);
-    int i;
-    register ptrdiff_t dstride2 = dstride << 1, sstride2 = sstride << 1;
-    register ptrdiff_t dstride3 = dstride2 + dstride, sstride3 = sstride + sstride2;
-    register ptrdiff_t dstride4 = dstride << 2, sstride4 = sstride << 2;
-
-// hand-unrolling the loop by 4 gains about 15%
-// mininum execution time goes from 74 to 60 cycles
-// it's faster than -funroll-loops, but using
-// -funroll-loops w/ this is bad - 74 cycles again.
-// all this is on a 7450, tuning for the 7450
-    for (i = 0; i < h; i += 4) {
-        pixelsv1  = vec_ld( 0, src);
-        pixelsv2  = vec_ld(15, src);
-        pixelsv1B = vec_ld(sstride, src);
-        pixelsv2B = vec_ld(15 + sstride, src);
-        pixelsv1C = vec_ld(sstride2, src);
-        pixelsv2C = vec_ld(15 + sstride2, src);
-        pixelsv1D = vec_ld(sstride3, src);
-        pixelsv2D = vec_ld(15 + sstride3, src);
-        vec_st(vec_perm(pixelsv1, pixelsv2, perm),
-               0, (unsigned char*)dst);
-        vec_st(vec_perm(pixelsv1B, pixelsv2B, perm),
-               dstride, (unsigned char*)dst);
-        vec_st(vec_perm(pixelsv1C, pixelsv2C, perm),
-               dstride2, (unsigned char*)dst);
-        vec_st(vec_perm(pixelsv1D, pixelsv2D, perm),
-               dstride3, (unsigned char*)dst);
-        src += sstride4;
-        dst += dstride4;
-    }
-}
-
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_vp8dsp_init_ppc(VP8DSPContext *c)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    c->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_altivec;
-    c->put_vp8_epel_pixels_tab[0][0][2] = put_vp8_epel16_h6_altivec;
-    c->put_vp8_epel_pixels_tab[0][2][0] = put_vp8_epel16_v6_altivec;
-    c->put_vp8_epel_pixels_tab[0][2][2] = put_vp8_epel16_h6v6_altivec;
-
-    c->put_vp8_epel_pixels_tab[1][0][2] = put_vp8_epel8_h6_altivec;
-    c->put_vp8_epel_pixels_tab[1][2][0] = put_vp8_epel8_v6_altivec;
-    c->put_vp8_epel_pixels_tab[1][0][1] = put_vp8_epel8_h4_altivec;
-    c->put_vp8_epel_pixels_tab[1][1][0] = put_vp8_epel8_v4_altivec;
-
-    c->put_vp8_epel_pixels_tab[1][2][2] = put_vp8_epel8_h6v6_altivec;
-    c->put_vp8_epel_pixels_tab[1][1][1] = put_vp8_epel8_h4v4_altivec;
-    c->put_vp8_epel_pixels_tab[1][1][2] = put_vp8_epel8_h6v4_altivec;
-    c->put_vp8_epel_pixels_tab[1][2][1] = put_vp8_epel8_h4v6_altivec;
-
-    c->put_vp8_epel_pixels_tab[2][0][2] = put_vp8_epel4_h6_altivec;
-    c->put_vp8_epel_pixels_tab[2][2][0] = put_vp8_epel4_v6_altivec;
-    c->put_vp8_epel_pixels_tab[2][0][1] = put_vp8_epel4_h4_altivec;
-    c->put_vp8_epel_pixels_tab[2][1][0] = put_vp8_epel4_v4_altivec;
-
-    c->put_vp8_epel_pixels_tab[2][2][2] = put_vp8_epel4_h6v6_altivec;
-    c->put_vp8_epel_pixels_tab[2][1][1] = put_vp8_epel4_h4v4_altivec;
-    c->put_vp8_epel_pixels_tab[2][1][2] = put_vp8_epel4_h6v4_altivec;
-    c->put_vp8_epel_pixels_tab[2][2][1] = put_vp8_epel4_h4v6_altivec;
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libavcodec/proresdata.c b/deps/libav/libavcodec/proresdata.c
deleted file mode 100644
index fcaf32a..0000000
--- a/deps/libav/libavcodec/proresdata.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Apple ProRes compatible decoder
- *
- * Copyright (c) 2010-2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "proresdata.h"
-
-const uint8_t ff_prores_progressive_scan[64] = {
-     0,  1,  8,  9,  2,  3, 10, 11,
-    16, 17, 24, 25, 18, 19, 26, 27,
-     4,  5, 12, 20, 13,  6,  7, 14,
-    21, 28, 29, 22, 15, 23, 30, 31,
-    32, 33, 40, 48, 41, 34, 35, 42,
-    49, 56, 57, 50, 43, 36, 37, 44,
-    51, 58, 59, 52, 45, 38, 39, 46,
-    53, 60, 61, 54, 47, 55, 62, 63
-};
-
-const uint8_t ff_prores_interlaced_scan[64] = {
-     0,  8,  1,  9, 16, 24, 17, 25,
-     2, 10,  3, 11, 18, 26, 19, 27,
-    32, 40, 33, 34, 41, 48, 56, 49,
-    42, 35, 43, 50, 57, 58, 51, 59,
-     4, 12,  5,  6, 13, 20, 28, 21,
-    14,  7, 15, 22, 29, 36, 44, 37,
-    30, 23, 31, 38, 45, 52, 60, 53,
-    46, 39, 47, 54, 61, 62, 55, 63
-};
-
-
-const uint8_t ff_prores_dc_codebook[4] = {
-    0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0
-    0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0
-    0x4D, // rice_order = 2, exp_golomb_order = 3, switch_bits = 1
-    0x70  // rice_order = 3, exp_golomb_order = 4, switch_bits = 0
-};
-
-const uint8_t ff_prores_ac_codebook[7] = {
-    0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0
-    0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0
-    0x4C, // rice_order = 2, exp_golomb_order = 3, switch_bits = 0
-    0x05, // rice_order = 0, exp_golomb_order = 1, switch_bits = 1
-    0x29, // rice_order = 1, exp_golomb_order = 2, switch_bits = 1
-    0x06, // rice_order = 0, exp_golomb_order = 1, switch_bits = 2
-    0x0A, // rice_order = 0, exp_golomb_order = 2, switch_bits = 2
-};
-
-/**
- * Lookup tables for adaptive switching between codebooks
- * according with previous run/level value.
- */
-const uint8_t ff_prores_run_to_cb_index[16] =
-    { 5, 5, 3, 3, 0, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 2 };
-
-const uint8_t ff_prores_lev_to_cb_index[10] = { 0, 6, 3, 5, 0, 1, 1, 1, 1, 2 };
diff --git a/deps/libav/libavcodec/proresdata.h b/deps/libav/libavcodec/proresdata.h
deleted file mode 100644
index 1e5d05e..0000000
--- a/deps/libav/libavcodec/proresdata.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Apple ProRes compatible decoder
- *
- * Copyright (c) 2010-2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PRORESDATA_H
-#define AVCODEC_PRORESDATA_H
-
-#include <stdint.h>
-
-#define FRAME_ID MKBETAG('i', 'c', 'p', 'f')
-
-extern const uint8_t ff_prores_progressive_scan[64];
-extern const uint8_t ff_prores_interlaced_scan[64];
-
-#define FIRST_DC_CB 0xB8 // rice_order = 5, exp_golomb_order = 6, switch_bits = 0
-extern const uint8_t ff_prores_dc_codebook[4];
-extern const uint8_t ff_prores_ac_codebook[7];
-extern const uint8_t ff_prores_run_to_cb_index[16];
-extern const uint8_t ff_prores_lev_to_cb_index[10];
-
-#endif /* AVCODEC_PRORESDATA_H */
diff --git a/deps/libav/libavcodec/proresdec.c b/deps/libav/libavcodec/proresdec.c
deleted file mode 100644
index 144fa26..0000000
--- a/deps/libav/libavcodec/proresdec.c
+++ /dev/null
@@ -1,781 +0,0 @@
-/*
- * Apple ProRes compatible decoder
- *
- * Copyright (c) 2010-2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This is a decoder for Apple ProRes 422 SD/HQ/LT/Proxy and ProRes 4444.
- * It is used for storing and editing high definition video data in Apple's Final Cut Pro.
- *
- * @see http://wiki.multimedia.cx/index.php?title=Apple_ProRes
- */
-
-#define LONG_BITSTREAM_READER // some ProRes vlc codes require up to 28 bits to be read at once
-
-#include <stdint.h>
-
-#include "libavutil/intmath.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "proresdata.h"
-#include "proresdsp.h"
-#include "get_bits.h"
-
-typedef struct {
-    const uint8_t *index;            ///< pointers to the data of this slice
-    int slice_num;
-    int x_pos, y_pos;
-    int slice_width;
-    int prev_slice_sf;               ///< scalefactor of the previous decoded slice
-    DECLARE_ALIGNED(16, int16_t, blocks)[8 * 4 * 64];
-    DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled)[64];
-    DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled)[64];
-} ProresThreadData;
-
-typedef struct {
-    ProresDSPContext dsp;
-    AVFrame    *frame;
-    ScanTable  scantable;
-    int        scantable_type;           ///< -1 = uninitialized, 0 = progressive, 1/2 = interlaced
-
-    int        frame_type;               ///< 0 = progressive, 1 = top-field first, 2 = bottom-field first
-    int        pic_format;               ///< 2 = 422, 3 = 444
-    uint8_t    qmat_luma[64];            ///< dequantization matrix for luma
-    uint8_t    qmat_chroma[64];          ///< dequantization matrix for chroma
-    int        qmat_changed;             ///< 1 - global quantization matrices changed
-    int        total_slices;            ///< total number of slices in a picture
-    ProresThreadData *slice_data;
-    int        pic_num;
-    int        chroma_factor;
-    int        mb_chroma_factor;
-    int        num_chroma_blocks;       ///< number of chrominance blocks in a macroblock
-    int        num_x_slices;
-    int        num_y_slices;
-    int        slice_width_factor;
-    int        slice_height_factor;
-    int        num_x_mbs;
-    int        num_y_mbs;
-    int        alpha_info;
-} ProresContext;
-
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    ProresContext *ctx = avctx->priv_data;
-
-    ctx->total_slices     = 0;
-    ctx->slice_data       = NULL;
-
-    avctx->bits_per_raw_sample = PRORES_BITS_PER_SAMPLE;
-    ff_proresdsp_init(&ctx->dsp);
-
-    ctx->scantable_type = -1;   // set scantable type to uninitialized
-    memset(ctx->qmat_luma, 4, 64);
-    memset(ctx->qmat_chroma, 4, 64);
-
-    return 0;
-}
-
-
-static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
-                               const int data_size, AVCodecContext *avctx)
-{
-    int hdr_size, version, width, height, flags;
-    const uint8_t *ptr;
-
-    hdr_size = AV_RB16(buf);
-    if (hdr_size > data_size) {
-        av_log(avctx, AV_LOG_ERROR, "frame data too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    version = AV_RB16(buf + 2);
-    if (version >= 2) {
-        av_log(avctx, AV_LOG_ERROR,
-               "unsupported header version: %d\n", version);
-        return AVERROR_INVALIDDATA;
-    }
-
-    width  = AV_RB16(buf + 8);
-    height = AV_RB16(buf + 10);
-    if (width != avctx->width || height != avctx->height) {
-        av_log(avctx, AV_LOG_ERROR,
-               "picture dimension changed: old: %d x %d, new: %d x %d\n",
-               avctx->width, avctx->height, width, height);
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->frame_type = (buf[12] >> 2) & 3;
-    if (ctx->frame_type > 2) {
-        av_log(avctx, AV_LOG_ERROR,
-               "unsupported frame type: %d\n", ctx->frame_type);
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->chroma_factor     = (buf[12] >> 6) & 3;
-    ctx->mb_chroma_factor  = ctx->chroma_factor + 2;
-    ctx->num_chroma_blocks = (1 << ctx->chroma_factor) >> 1;
-    ctx->alpha_info        = buf[17] & 0xf;
-
-    if (ctx->alpha_info > 2) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid alpha mode %d\n", ctx->alpha_info);
-        return AVERROR_INVALIDDATA;
-    }
-
-    switch (ctx->chroma_factor) {
-    case 2:
-        avctx->pix_fmt = ctx->alpha_info ? AV_PIX_FMT_YUVA422P10
-                                         : AV_PIX_FMT_YUV422P10;
-        break;
-    case 3:
-        avctx->pix_fmt = ctx->alpha_info ? AV_PIX_FMT_YUVA444P10
-                                         : AV_PIX_FMT_YUV444P10;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR,
-               "unsupported picture format: %d\n", ctx->pic_format);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (ctx->scantable_type != ctx->frame_type) {
-        if (!ctx->frame_type)
-            ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable,
-                              ff_prores_progressive_scan);
-        else
-            ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable,
-                              ff_prores_interlaced_scan);
-        ctx->scantable_type = ctx->frame_type;
-    }
-
-    if (ctx->frame_type) {      /* if interlaced */
-        ctx->frame->interlaced_frame = 1;
-        ctx->frame->top_field_first  = ctx->frame_type & 1;
-    } else {
-        ctx->frame->interlaced_frame = 0;
-    }
-
-    avctx->color_primaries = buf[14];
-    avctx->color_trc       = buf[15];
-    avctx->colorspace      = buf[16];
-
-    ctx->qmat_changed = 0;
-    ptr   = buf + 20;
-    flags = buf[19];
-    if (flags & 2) {
-        if (ptr - buf > hdr_size - 64) {
-            av_log(avctx, AV_LOG_ERROR, "header data too small\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (memcmp(ctx->qmat_luma, ptr, 64)) {
-            memcpy(ctx->qmat_luma, ptr, 64);
-            ctx->qmat_changed = 1;
-        }
-        ptr += 64;
-    } else {
-        memset(ctx->qmat_luma, 4, 64);
-        ctx->qmat_changed = 1;
-    }
-
-    if (flags & 1) {
-        if (ptr - buf > hdr_size - 64) {
-            av_log(avctx, AV_LOG_ERROR, "header data too small\n");
-            return -1;
-        }
-        if (memcmp(ctx->qmat_chroma, ptr, 64)) {
-            memcpy(ctx->qmat_chroma, ptr, 64);
-            ctx->qmat_changed = 1;
-        }
-    } else {
-        memset(ctx->qmat_chroma, 4, 64);
-        ctx->qmat_changed = 1;
-    }
-
-    return hdr_size;
-}
-
-
-static int decode_picture_header(ProresContext *ctx, const uint8_t *buf,
-                                 const int data_size, AVCodecContext *avctx)
-{
-    int   i, hdr_size, pic_data_size, num_slices;
-    int   slice_width_factor, slice_height_factor;
-    int   remainder, num_x_slices;
-    const uint8_t *data_ptr, *index_ptr;
-
-    hdr_size = data_size > 0 ? buf[0] >> 3 : 0;
-    if (hdr_size < 8 || hdr_size > data_size) {
-        av_log(avctx, AV_LOG_ERROR, "picture header too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    pic_data_size = AV_RB32(buf + 1);
-    if (pic_data_size > data_size) {
-        av_log(avctx, AV_LOG_ERROR, "picture data too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    slice_width_factor  = buf[7] >> 4;
-    slice_height_factor = buf[7] & 0xF;
-    if (slice_width_factor > 3 || slice_height_factor) {
-        av_log(avctx, AV_LOG_ERROR,
-               "unsupported slice dimension: %d x %d\n",
-               1 << slice_width_factor, 1 << slice_height_factor);
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->slice_width_factor  = slice_width_factor;
-    ctx->slice_height_factor = slice_height_factor;
-
-    ctx->num_x_mbs = (avctx->width + 15) >> 4;
-    ctx->num_y_mbs = (avctx->height +
-                      (1 << (4 + ctx->frame->interlaced_frame)) - 1) >>
-                     (4 + ctx->frame->interlaced_frame);
-
-    remainder    = ctx->num_x_mbs & ((1 << slice_width_factor) - 1);
-    num_x_slices = (ctx->num_x_mbs >> slice_width_factor) + (remainder & 1) +
-                   ((remainder >> 1) & 1) + ((remainder >> 2) & 1);
-
-    num_slices = num_x_slices * ctx->num_y_mbs;
-    if (num_slices != AV_RB16(buf + 5)) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of slices\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (ctx->total_slices != num_slices) {
-        av_freep(&ctx->slice_data);
-        ctx->slice_data = av_malloc((num_slices + 1) * sizeof(ctx->slice_data[0]));
-        if (!ctx->slice_data)
-            return AVERROR(ENOMEM);
-        ctx->total_slices = num_slices;
-    }
-
-    if (hdr_size + num_slices * 2 > data_size) {
-        av_log(avctx, AV_LOG_ERROR, "slice table too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* parse slice table allowing quick access to the slice data */
-    index_ptr = buf + hdr_size;
-    data_ptr = index_ptr + num_slices * 2;
-
-    for (i = 0; i < num_slices; i++) {
-        ctx->slice_data[i].index = data_ptr;
-        ctx->slice_data[i].prev_slice_sf = 0;
-        data_ptr += AV_RB16(index_ptr + i * 2);
-    }
-    ctx->slice_data[i].index = data_ptr;
-    ctx->slice_data[i].prev_slice_sf = 0;
-
-    if (data_ptr > buf + data_size) {
-        av_log(avctx, AV_LOG_ERROR, "out of slice data\n");
-        return -1;
-    }
-
-    return pic_data_size;
-}
-
-
-/**
- * Read an unsigned rice/exp golomb codeword.
- */
-static inline int decode_vlc_codeword(GetBitContext *gb, unsigned codebook)
-{
-    unsigned int rice_order, exp_order, switch_bits;
-    unsigned int buf, code;
-    int log, prefix_len, len;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-    buf = GET_CACHE(re, gb);
-
-    /* number of prefix bits to switch between Rice and expGolomb */
-    switch_bits = (codebook & 3) + 1;
-    rice_order  = codebook >> 5;        /* rice code order */
-    exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */
-
-    log = 31 - av_log2(buf); /* count prefix bits (zeroes) */
-
-    if (log < switch_bits) { /* ok, we got a rice code */
-        if (!rice_order) {
-            /* shortcut for faster decoding of rice codes without remainder */
-            code = log;
-            LAST_SKIP_BITS(re, gb, log + 1);
-        } else {
-            prefix_len = log + 1;
-            code = (log << rice_order) + NEG_USR32(buf << prefix_len, rice_order);
-            LAST_SKIP_BITS(re, gb, prefix_len + rice_order);
-        }
-    } else { /* otherwise we got a exp golomb code */
-        len  = (log << 1) - switch_bits + exp_order + 1;
-        code = NEG_USR32(buf, len) - (1 << exp_order) + (switch_bits << rice_order);
-        LAST_SKIP_BITS(re, gb, len);
-    }
-
-    CLOSE_READER(re, gb);
-
-    return code;
-}
-
-#define LSB2SIGN(x) (-((x) & 1))
-#define TOSIGNED(x) (((x) >> 1) ^ LSB2SIGN(x))
-
-/**
- * Decode DC coefficients for all blocks in a slice.
- */
-static inline void decode_dc_coeffs(GetBitContext *gb, int16_t *out,
-                                    int nblocks)
-{
-    int16_t prev_dc;
-    int     i, sign;
-    int16_t delta;
-    unsigned int code;
-
-    code   = decode_vlc_codeword(gb, FIRST_DC_CB);
-    out[0] = prev_dc = TOSIGNED(code);
-
-    out   += 64; /* move to the DC coeff of the next block */
-    delta  = 3;
-
-    for (i = 1; i < nblocks; i++, out += 64) {
-        code = decode_vlc_codeword(gb, ff_prores_dc_codebook[FFMIN(FFABS(delta), 3)]);
-
-        sign     = -(((delta >> 15) & 1) ^ (code & 1));
-        delta    = (((code + 1) >> 1) ^ sign) - sign;
-        prev_dc += delta;
-        out[0]   = prev_dc;
-    }
-}
-
-
-/**
- * Decode AC coefficients for all blocks in a slice.
- */
-static inline int decode_ac_coeffs(GetBitContext *gb, int16_t *out,
-                                   int blocks_per_slice,
-                                   int plane_size_factor,
-                                   const uint8_t *scan)
-{
-    int pos, block_mask, run, level, sign, run_cb_index, lev_cb_index;
-    int max_coeffs, bits_left;
-
-    /* set initial prediction values */
-    run   = 4;
-    level = 2;
-
-    max_coeffs = blocks_per_slice << 6;
-    block_mask = blocks_per_slice - 1;
-
-    for (pos = blocks_per_slice - 1; pos < max_coeffs;) {
-        run_cb_index = ff_prores_run_to_cb_index[FFMIN(run, 15)];
-        lev_cb_index = ff_prores_lev_to_cb_index[FFMIN(level, 9)];
-
-        bits_left = get_bits_left(gb);
-        if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left)))
-            return 0;
-
-        run = decode_vlc_codeword(gb, ff_prores_ac_codebook[run_cb_index]);
-        if (run < 0)
-            return AVERROR_INVALIDDATA;
-
-        bits_left = get_bits_left(gb);
-        if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left)))
-            return AVERROR_INVALIDDATA;
-
-        level = decode_vlc_codeword(gb, ff_prores_ac_codebook[lev_cb_index]) + 1;
-        if (level < 0)
-            return AVERROR_INVALIDDATA;
-
-        pos += run + 1;
-        if (pos >= max_coeffs)
-            break;
-
-        sign = get_sbits(gb, 1);
-        out[((pos & block_mask) << 6) + scan[pos >> plane_size_factor]] =
-            (level ^ sign) - sign;
-    }
-
-    return 0;
-}
-
-
-/**
- * Decode a slice plane (luma or chroma).
- */
-static int decode_slice_plane(ProresContext *ctx, ProresThreadData *td,
-                              const uint8_t *buf,
-                              int data_size, uint16_t *out_ptr,
-                              int linesize, int mbs_per_slice,
-                              int blocks_per_mb, int plane_size_factor,
-                              const int16_t *qmat, int is_chroma)
-{
-    GetBitContext gb;
-    int16_t *block_ptr;
-    int mb_num, blocks_per_slice, ret;
-
-    blocks_per_slice = mbs_per_slice * blocks_per_mb;
-
-    memset(td->blocks, 0, 8 * 4 * 64 * sizeof(*td->blocks));
-
-    init_get_bits(&gb, buf, data_size << 3);
-
-    decode_dc_coeffs(&gb, td->blocks, blocks_per_slice);
-
-    ret = decode_ac_coeffs(&gb, td->blocks, blocks_per_slice,
-                           plane_size_factor, ctx->scantable.permutated);
-    if (ret < 0)
-        return ret;
-
-    /* inverse quantization, inverse transform and output */
-    block_ptr = td->blocks;
-
-    if (!is_chroma) {
-        for (mb_num = 0; mb_num < mbs_per_slice; mb_num++, out_ptr += blocks_per_mb * 4) {
-            ctx->dsp.idct_put(out_ptr,                    linesize, block_ptr, qmat);
-            block_ptr += 64;
-            if (blocks_per_mb > 2) {
-                ctx->dsp.idct_put(out_ptr + 8,            linesize, block_ptr, qmat);
-                block_ptr += 64;
-            }
-            ctx->dsp.idct_put(out_ptr + linesize * 4,     linesize, block_ptr, qmat);
-            block_ptr += 64;
-            if (blocks_per_mb > 2) {
-                ctx->dsp.idct_put(out_ptr + linesize * 4 + 8, linesize, block_ptr, qmat);
-                block_ptr += 64;
-            }
-        }
-    } else {
-        for (mb_num = 0; mb_num < mbs_per_slice; mb_num++, out_ptr += blocks_per_mb * 4) {
-            ctx->dsp.idct_put(out_ptr,                    linesize, block_ptr, qmat);
-            block_ptr += 64;
-            ctx->dsp.idct_put(out_ptr + linesize * 4,     linesize, block_ptr, qmat);
-            block_ptr += 64;
-            if (blocks_per_mb > 2) {
-                ctx->dsp.idct_put(out_ptr + 8,            linesize, block_ptr, qmat);
-                block_ptr += 64;
-                ctx->dsp.idct_put(out_ptr + linesize * 4 + 8, linesize, block_ptr, qmat);
-                block_ptr += 64;
-            }
-        }
-    }
-    return 0;
-}
-
-
-static void unpack_alpha(GetBitContext *gb, uint16_t *dst, int num_coeffs,
-                         const int num_bits)
-{
-    const int mask = (1 << num_bits) - 1;
-    int i, idx, val, alpha_val;
-
-    idx       = 0;
-    alpha_val = mask;
-    do {
-        do {
-            if (get_bits1(gb))
-                val = get_bits(gb, num_bits);
-            else {
-                int sign;
-                val  = get_bits(gb, num_bits == 16 ? 7 : 4);
-                sign = val & 1;
-                val  = (val + 2) >> 1;
-                if (sign)
-                    val = -val;
-            }
-            alpha_val = (alpha_val + val) & mask;
-            if (num_bits == 16)
-                dst[idx++] = alpha_val >> 6;
-            else
-                dst[idx++] = (alpha_val << 2) | (alpha_val >> 6);
-            if (idx >= num_coeffs - 1)
-                break;
-        } while (get_bits1(gb));
-        val = get_bits(gb, 4);
-        if (!val)
-            val = get_bits(gb, 11);
-        if (idx + val > num_coeffs)
-            val = num_coeffs - idx;
-        if (num_bits == 16)
-            for (i = 0; i < val; i++)
-                dst[idx++] = alpha_val >> 6;
-        else
-            for (i = 0; i < val; i++)
-                dst[idx++] = (alpha_val << 2) | (alpha_val >> 6);
-    } while (idx < num_coeffs);
-}
-
-/**
- * Decode alpha slice plane.
- */
-static void decode_alpha_plane(ProresContext *ctx, ProresThreadData *td,
-                               const uint8_t *buf, int data_size,
-                               uint16_t *out_ptr, int linesize,
-                               int mbs_per_slice)
-{
-    GetBitContext gb;
-    int i;
-    uint16_t *block_ptr;
-
-    memset(td->blocks, 0, 8 * 4 * 64 * sizeof(*td->blocks));
-
-    init_get_bits(&gb, buf, data_size << 3);
-
-    if (ctx->alpha_info == 2)
-        unpack_alpha(&gb, td->blocks, mbs_per_slice * 4 * 64, 16);
-    else
-        unpack_alpha(&gb, td->blocks, mbs_per_slice * 4 * 64, 8);
-
-    block_ptr = td->blocks;
-
-    for (i = 0; i < 16; i++) {
-        memcpy(out_ptr, block_ptr, 16 * mbs_per_slice * sizeof(*out_ptr));
-        out_ptr   += linesize >> 1;
-        block_ptr += 16 * mbs_per_slice;
-    }
-}
-
-static int decode_slice(AVCodecContext *avctx, void *tdata)
-{
-    ProresThreadData *td = tdata;
-    ProresContext *ctx = avctx->priv_data;
-    int mb_x_pos  = td->x_pos;
-    int mb_y_pos  = td->y_pos;
-    int pic_num   = ctx->pic_num;
-    int slice_num = td->slice_num;
-    int mbs_per_slice = td->slice_width;
-    const uint8_t *buf;
-    uint8_t *y_data, *u_data, *v_data, *a_data;
-    AVFrame *pic = ctx->frame;
-    int i, sf, slice_width_factor;
-    int slice_data_size, hdr_size;
-    int y_data_size, u_data_size, v_data_size, a_data_size;
-    int y_linesize, u_linesize, v_linesize, a_linesize;
-    int coff[4];
-    int ret;
-
-    buf             = ctx->slice_data[slice_num].index;
-    slice_data_size = ctx->slice_data[slice_num + 1].index - buf;
-
-    slice_width_factor = av_log2(mbs_per_slice);
-
-    y_data     = pic->data[0];
-    u_data     = pic->data[1];
-    v_data     = pic->data[2];
-    a_data     = pic->data[3];
-    y_linesize = pic->linesize[0];
-    u_linesize = pic->linesize[1];
-    v_linesize = pic->linesize[2];
-    a_linesize = pic->linesize[3];
-
-    if (pic->interlaced_frame) {
-        if (!(pic_num ^ pic->top_field_first)) {
-            y_data += y_linesize;
-            u_data += u_linesize;
-            v_data += v_linesize;
-            if (a_data)
-                a_data += a_linesize;
-        }
-        y_linesize <<= 1;
-        u_linesize <<= 1;
-        v_linesize <<= 1;
-        a_linesize <<= 1;
-    }
-    y_data += (mb_y_pos << 4) * y_linesize + (mb_x_pos << 5);
-    u_data += (mb_y_pos << 4) * u_linesize + (mb_x_pos << ctx->mb_chroma_factor);
-    v_data += (mb_y_pos << 4) * v_linesize + (mb_x_pos << ctx->mb_chroma_factor);
-    if (a_data)
-        a_data += (mb_y_pos << 4) * a_linesize + (mb_x_pos << 5);
-
-    if (slice_data_size < 6) {
-        av_log(avctx, AV_LOG_ERROR, "slice data too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* parse slice header */
-    hdr_size    = buf[0] >> 3;
-    coff[0]     = hdr_size;
-    y_data_size = AV_RB16(buf + 2);
-    coff[1]     = coff[0] + y_data_size;
-    u_data_size = AV_RB16(buf + 4);
-    coff[2]     = coff[1] + u_data_size;
-    v_data_size = hdr_size > 7 ? AV_RB16(buf + 6) : slice_data_size - coff[2];
-    coff[3]     = coff[2] + v_data_size;
-    a_data_size = slice_data_size - coff[3];
-
-    /* if V or alpha component size is negative that means that previous
-       component sizes are too large */
-    if (v_data_size < 0 || a_data_size < 0 || hdr_size < 6) {
-        av_log(avctx, AV_LOG_ERROR, "invalid data size\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    sf = av_clip(buf[1], 1, 224);
-    sf = sf > 128 ? (sf - 96) << 2 : sf;
-
-    /* scale quantization matrixes according with slice's scale factor */
-    /* TODO: this can be SIMD-optimized a lot */
-    if (ctx->qmat_changed || sf != td->prev_slice_sf) {
-        td->prev_slice_sf = sf;
-        for (i = 0; i < 64; i++) {
-            td->qmat_luma_scaled[ctx->dsp.idct_permutation[i]]   = ctx->qmat_luma[i]   * sf;
-            td->qmat_chroma_scaled[ctx->dsp.idct_permutation[i]] = ctx->qmat_chroma[i] * sf;
-        }
-    }
-
-    /* decode luma plane */
-    ret = decode_slice_plane(ctx, td, buf + coff[0], y_data_size,
-                             (uint16_t*) y_data, y_linesize,
-                             mbs_per_slice, 4, slice_width_factor + 2,
-                             td->qmat_luma_scaled, 0);
-
-    if (ret < 0)
-        return ret;
-
-    /* decode U chroma plane */
-    ret = decode_slice_plane(ctx, td, buf + coff[1], u_data_size,
-                             (uint16_t*) u_data, u_linesize,
-                             mbs_per_slice, ctx->num_chroma_blocks,
-                             slice_width_factor + ctx->chroma_factor - 1,
-                             td->qmat_chroma_scaled, 1);
-    if (ret < 0)
-        return ret;
-
-    /* decode V chroma plane */
-    ret = decode_slice_plane(ctx, td, buf + coff[2], v_data_size,
-                             (uint16_t*) v_data, v_linesize,
-                             mbs_per_slice, ctx->num_chroma_blocks,
-                             slice_width_factor + ctx->chroma_factor - 1,
-                             td->qmat_chroma_scaled, 1);
-    if (ret < 0)
-        return ret;
-
-    /* decode alpha plane if available */
-    if (a_data && a_data_size)
-        decode_alpha_plane(ctx, td, buf + coff[3], a_data_size,
-                           (uint16_t*) a_data, a_linesize,
-                           mbs_per_slice);
-
-    return 0;
-}
-
-
-static int decode_picture(ProresContext *ctx, int pic_num,
-                          AVCodecContext *avctx)
-{
-    int slice_num, slice_width, x_pos, y_pos;
-
-    slice_num = 0;
-
-    ctx->pic_num = pic_num;
-    for (y_pos = 0; y_pos < ctx->num_y_mbs; y_pos++) {
-        slice_width = 1 << ctx->slice_width_factor;
-
-        for (x_pos = 0; x_pos < ctx->num_x_mbs && slice_width;
-             x_pos += slice_width) {
-            while (ctx->num_x_mbs - x_pos < slice_width)
-                slice_width >>= 1;
-
-            ctx->slice_data[slice_num].slice_num   = slice_num;
-            ctx->slice_data[slice_num].x_pos       = x_pos;
-            ctx->slice_data[slice_num].y_pos       = y_pos;
-            ctx->slice_data[slice_num].slice_width = slice_width;
-
-            slice_num++;
-        }
-    }
-
-    return avctx->execute(avctx, decode_slice,
-                          ctx->slice_data, NULL, slice_num,
-                          sizeof(ctx->slice_data[0]));
-}
-
-
-#define MOVE_DATA_PTR(nbytes) buf += (nbytes); buf_size -= (nbytes)
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    ProresContext *ctx = avctx->priv_data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    int frame_hdr_size, pic_num, pic_data_size;
-
-    ctx->frame            = data;
-    ctx->frame->pict_type = AV_PICTURE_TYPE_I;
-    ctx->frame->key_frame = 1;
-
-    /* check frame atom container */
-    if (buf_size < 28 || buf_size < AV_RB32(buf) ||
-        AV_RB32(buf + 4) != FRAME_ID) {
-        av_log(avctx, AV_LOG_ERROR, "invalid frame\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    MOVE_DATA_PTR(8);
-
-    frame_hdr_size = decode_frame_header(ctx, buf, buf_size, avctx);
-    if (frame_hdr_size < 0)
-        return AVERROR_INVALIDDATA;
-
-    MOVE_DATA_PTR(frame_hdr_size);
-
-    if (ff_get_buffer(avctx, ctx->frame, 0) < 0)
-        return -1;
-
-    for (pic_num = 0; ctx->frame->interlaced_frame - pic_num + 1; pic_num++) {
-        pic_data_size = decode_picture_header(ctx, buf, buf_size, avctx);
-        if (pic_data_size < 0)
-            return AVERROR_INVALIDDATA;
-
-        if (decode_picture(ctx, pic_num, avctx))
-            return -1;
-
-        MOVE_DATA_PTR(pic_data_size);
-    }
-
-    ctx->frame = NULL;
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-
-static av_cold int decode_close(AVCodecContext *avctx)
-{
-    ProresContext *ctx = avctx->priv_data;
-
-    av_freep(&ctx->slice_data);
-
-    return 0;
-}
-
-
-AVCodec ff_prores_decoder = {
-    .name           = "prores",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PRORES,
-    .priv_data_size = sizeof(ProresContext),
-    .init           = decode_init,
-    .close          = decode_close,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
-};
diff --git a/deps/libav/libavcodec/proresdsp.c b/deps/libav/libavcodec/proresdsp.c
deleted file mode 100644
index 1c0f391..0000000
--- a/deps/libav/libavcodec/proresdsp.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Apple ProRes compatible decoder
- *
- * Copyright (c) 2010-2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "dct.h"
-#include "dsputil.h"
-#include "proresdsp.h"
-#include "simple_idct.h"
-
-#define BIAS     (1 << (PRORES_BITS_PER_SAMPLE - 1))           ///< bias value for converting signed pixels into unsigned ones
-#define CLIP_MIN (1 << (PRORES_BITS_PER_SAMPLE - 8))           ///< minimum value for clipping resulting pixels
-#define CLIP_MAX (1 << PRORES_BITS_PER_SAMPLE) - CLIP_MIN - 1  ///< maximum value for clipping resulting pixels
-
-#define CLIP_AND_BIAS(x) (av_clip((x) + BIAS, CLIP_MIN, CLIP_MAX))
-
-#if CONFIG_PRORES_DECODER
-/**
- * Add bias value, clamp and output pixels of a slice
- */
-static void put_pixels(uint16_t *dst, int stride, const int16_t *in)
-{
-    int x, y, src_offset, dst_offset;
-
-    for (y = 0, dst_offset = 0; y < 8; y++, dst_offset += stride) {
-        for (x = 0; x < 8; x++) {
-            src_offset = (y << 3) + x;
-
-            dst[dst_offset + x] = CLIP_AND_BIAS(in[src_offset]);
-        }
-    }
-}
-
-static void prores_idct_put_c(uint16_t *out, int linesize, int16_t *block, const int16_t *qmat)
-{
-    ff_prores_idct(block, qmat);
-    put_pixels(out, linesize >> 1, block);
-}
-#endif
-
-#if CONFIG_PRORES_ENCODER
-static void prores_fdct_c(const uint16_t *src, int linesize, int16_t *block)
-{
-    int x, y;
-    const uint16_t *tsrc = src;
-
-    for (y = 0; y < 8; y++) {
-        for (x = 0; x < 8; x++)
-            block[y * 8 + x] = tsrc[x];
-        tsrc += linesize >> 1;
-    }
-    ff_jpeg_fdct_islow_10(block);
-}
-#endif
-
-av_cold void ff_proresdsp_init(ProresDSPContext *dsp)
-{
-#if CONFIG_PRORES_DECODER
-    dsp->idct_put = prores_idct_put_c;
-    dsp->idct_permutation_type = FF_NO_IDCT_PERM;
-
-    if (ARCH_X86) ff_proresdsp_x86_init(dsp);
-
-    ff_init_scantable_permutation(dsp->idct_permutation,
-                                  dsp->idct_permutation_type);
-#endif
-#if CONFIG_PRORES_ENCODER
-    dsp->fdct                 = prores_fdct_c;
-    dsp->dct_permutation_type = FF_NO_IDCT_PERM;
-    ff_init_scantable_permutation(dsp->dct_permutation,
-                                  dsp->dct_permutation_type);
-#endif
-}
diff --git a/deps/libav/libavcodec/proresdsp.h b/deps/libav/libavcodec/proresdsp.h
deleted file mode 100644
index 5e35140..0000000
--- a/deps/libav/libavcodec/proresdsp.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Apple ProRes compatible decoder
- *
- * Copyright (c) 2010-2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PRORESDSP_H
-#define AVCODEC_PRORESDSP_H
-
-#include <stdint.h>
-
-#define PRORES_BITS_PER_SAMPLE 10 ///< output precision of prores decoder
-
-typedef struct ProresDSPContext {
-    int idct_permutation_type;
-    uint8_t idct_permutation[64];
-    int dct_permutation_type;
-    uint8_t dct_permutation[64];
-    void (* idct_put) (uint16_t *out, int linesize, int16_t *block, const int16_t *qmat);
-    void (* fdct) (const uint16_t *src, int linesize, int16_t *block);
-} ProresDSPContext;
-
-void ff_proresdsp_init(ProresDSPContext *dsp);
-
-void ff_proresdsp_x86_init(ProresDSPContext *dsp);
-
-#endif /* AVCODEC_PRORESDSP_H */
diff --git a/deps/libav/libavcodec/proresenc.c b/deps/libav/libavcodec/proresenc.c
deleted file mode 100644
index 7e9ce54..0000000
--- a/deps/libav/libavcodec/proresenc.c
+++ /dev/null
@@ -1,1278 +0,0 @@
-/*
- * Apple ProRes encoder
- *
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "put_bits.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "proresdsp.h"
-#include "proresdata.h"
-
-#define CFACTOR_Y422 2
-#define CFACTOR_Y444 3
-
-#define MAX_MBS_PER_SLICE 8
-
-#define MAX_PLANES 4
-
-enum {
-    PRORES_PROFILE_PROXY = 0,
-    PRORES_PROFILE_LT,
-    PRORES_PROFILE_STANDARD,
-    PRORES_PROFILE_HQ,
-    PRORES_PROFILE_4444,
-};
-
-enum {
-    QUANT_MAT_PROXY = 0,
-    QUANT_MAT_LT,
-    QUANT_MAT_STANDARD,
-    QUANT_MAT_HQ,
-    QUANT_MAT_DEFAULT,
-};
-
-static const uint8_t prores_quant_matrices[][64] = {
-    { // proxy
-         4,  7,  9, 11, 13, 14, 15, 63,
-         7,  7, 11, 12, 14, 15, 63, 63,
-         9, 11, 13, 14, 15, 63, 63, 63,
-        11, 11, 13, 14, 63, 63, 63, 63,
-        11, 13, 14, 63, 63, 63, 63, 63,
-        13, 14, 63, 63, 63, 63, 63, 63,
-        13, 63, 63, 63, 63, 63, 63, 63,
-        63, 63, 63, 63, 63, 63, 63, 63,
-    },
-    { // LT
-         4,  5,  6,  7,  9, 11, 13, 15,
-         5,  5,  7,  8, 11, 13, 15, 17,
-         6,  7,  9, 11, 13, 15, 15, 17,
-         7,  7,  9, 11, 13, 15, 17, 19,
-         7,  9, 11, 13, 14, 16, 19, 23,
-         9, 11, 13, 14, 16, 19, 23, 29,
-         9, 11, 13, 15, 17, 21, 28, 35,
-        11, 13, 16, 17, 21, 28, 35, 41,
-    },
-    { // standard
-         4,  4,  5,  5,  6,  7,  7,  9,
-         4,  4,  5,  6,  7,  7,  9,  9,
-         5,  5,  6,  7,  7,  9,  9, 10,
-         5,  5,  6,  7,  7,  9,  9, 10,
-         5,  6,  7,  7,  8,  9, 10, 12,
-         6,  7,  7,  8,  9, 10, 12, 15,
-         6,  7,  7,  9, 10, 11, 14, 17,
-         7,  7,  9, 10, 11, 14, 17, 21,
-    },
-    { // high quality
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  5,
-         4,  4,  4,  4,  4,  4,  5,  5,
-         4,  4,  4,  4,  4,  5,  5,  6,
-         4,  4,  4,  4,  5,  5,  6,  7,
-         4,  4,  4,  4,  5,  6,  7,  7,
-    },
-    { // codec default
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  4,
-         4,  4,  4,  4,  4,  4,  4,  4,
-    },
-};
-
-#define NUM_MB_LIMITS 4
-static const int prores_mb_limits[NUM_MB_LIMITS] = {
-    1620, // up to 720x576
-    2700, // up to 960x720
-    6075, // up to 1440x1080
-    9216, // up to 2048x1152
-};
-
-static const struct prores_profile {
-    const char *full_name;
-    uint32_t    tag;
-    int         min_quant;
-    int         max_quant;
-    int         br_tab[NUM_MB_LIMITS];
-    int         quant;
-} prores_profile_info[5] = {
-    {
-        .full_name = "proxy",
-        .tag       = MKTAG('a', 'p', 'c', 'o'),
-        .min_quant = 4,
-        .max_quant = 8,
-        .br_tab    = { 300, 242, 220, 194 },
-        .quant     = QUANT_MAT_PROXY,
-    },
-    {
-        .full_name = "LT",
-        .tag       = MKTAG('a', 'p', 'c', 's'),
-        .min_quant = 1,
-        .max_quant = 9,
-        .br_tab    = { 720, 560, 490, 440 },
-        .quant     = QUANT_MAT_LT,
-    },
-    {
-        .full_name = "standard",
-        .tag       = MKTAG('a', 'p', 'c', 'n'),
-        .min_quant = 1,
-        .max_quant = 6,
-        .br_tab    = { 1050, 808, 710, 632 },
-        .quant     = QUANT_MAT_STANDARD,
-    },
-    {
-        .full_name = "high quality",
-        .tag       = MKTAG('a', 'p', 'c', 'h'),
-        .min_quant = 1,
-        .max_quant = 6,
-        .br_tab    = { 1566, 1216, 1070, 950 },
-        .quant     = QUANT_MAT_HQ,
-    },
-    {
-        .full_name = "4444",
-        .tag       = MKTAG('a', 'p', '4', 'h'),
-        .min_quant = 1,
-        .max_quant = 6,
-        .br_tab    = { 2350, 1828, 1600, 1425 },
-        .quant     = QUANT_MAT_HQ,
-    }
-};
-
-#define TRELLIS_WIDTH 16
-#define SCORE_LIMIT   INT_MAX / 2
-
-struct TrellisNode {
-    int prev_node;
-    int quant;
-    int bits;
-    int score;
-};
-
-#define MAX_STORED_Q 16
-
-typedef struct ProresThreadData {
-    DECLARE_ALIGNED(16, int16_t, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE];
-    DECLARE_ALIGNED(16, uint16_t, emu_buf)[16 * 16];
-    int16_t custom_q[64];
-    struct TrellisNode *nodes;
-} ProresThreadData;
-
-typedef struct ProresContext {
-    AVClass *class;
-    DECLARE_ALIGNED(16, int16_t, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE];
-    DECLARE_ALIGNED(16, uint16_t, emu_buf)[16*16];
-    int16_t quants[MAX_STORED_Q][64];
-    int16_t custom_q[64];
-    const uint8_t *quant_mat;
-
-    ProresDSPContext dsp;
-    ScanTable  scantable;
-
-    int mb_width, mb_height;
-    int mbs_per_slice;
-    int num_chroma_blocks, chroma_factor;
-    int slices_width;
-    int slices_per_picture;
-    int pictures_per_frame; // 1 for progressive, 2 for interlaced
-    int cur_picture_idx;
-    int num_planes;
-    int bits_per_mb;
-    int force_quant;
-    int alpha_bits;
-
-    char *vendor;
-    int quant_sel;
-
-    int frame_size_upper_bound;
-
-    int profile;
-    const struct prores_profile *profile_info;
-
-    int *slice_q;
-
-    ProresThreadData *tdata;
-} ProresContext;
-
-static void get_slice_data(ProresContext *ctx, const uint16_t *src,
-                           int linesize, int x, int y, int w, int h,
-                           int16_t *blocks, uint16_t *emu_buf,
-                           int mbs_per_slice, int blocks_per_mb, int is_chroma)
-{
-    const uint16_t *esrc;
-    const int mb_width = 4 * blocks_per_mb;
-    int elinesize;
-    int i, j, k;
-
-    for (i = 0; i < mbs_per_slice; i++, src += mb_width) {
-        if (x >= w) {
-            memset(blocks, 0, 64 * (mbs_per_slice - i) * blocks_per_mb
-                              * sizeof(*blocks));
-            return;
-        }
-        if (x + mb_width <= w && y + 16 <= h) {
-            esrc      = src;
-            elinesize = linesize;
-        } else {
-            int bw, bh, pix;
-
-            esrc      = emu_buf;
-            elinesize = 16 * sizeof(*emu_buf);
-
-            bw = FFMIN(w - x, mb_width);
-            bh = FFMIN(h - y, 16);
-
-            for (j = 0; j < bh; j++) {
-                memcpy(emu_buf + j * 16,
-                       (const uint8_t*)src + j * linesize,
-                       bw * sizeof(*src));
-                pix = emu_buf[j * 16 + bw - 1];
-                for (k = bw; k < mb_width; k++)
-                    emu_buf[j * 16 + k] = pix;
-            }
-            for (; j < 16; j++)
-                memcpy(emu_buf + j * 16,
-                       emu_buf + (bh - 1) * 16,
-                       mb_width * sizeof(*emu_buf));
-        }
-        if (!is_chroma) {
-            ctx->dsp.fdct(esrc, elinesize, blocks);
-            blocks += 64;
-            if (blocks_per_mb > 2) {
-                ctx->dsp.fdct(esrc + 8, elinesize, blocks);
-                blocks += 64;
-            }
-            ctx->dsp.fdct(esrc + elinesize * 4, elinesize, blocks);
-            blocks += 64;
-            if (blocks_per_mb > 2) {
-                ctx->dsp.fdct(esrc + elinesize * 4 + 8, elinesize, blocks);
-                blocks += 64;
-            }
-        } else {
-            ctx->dsp.fdct(esrc, elinesize, blocks);
-            blocks += 64;
-            ctx->dsp.fdct(esrc + elinesize * 4, elinesize, blocks);
-            blocks += 64;
-            if (blocks_per_mb > 2) {
-                ctx->dsp.fdct(esrc + 8, elinesize, blocks);
-                blocks += 64;
-                ctx->dsp.fdct(esrc + elinesize * 4 + 8, elinesize, blocks);
-                blocks += 64;
-            }
-        }
-
-        x += mb_width;
-    }
-}
-
-static void get_alpha_data(ProresContext *ctx, const uint16_t *src,
-                           int linesize, int x, int y, int w, int h,
-                           int16_t *blocks, int mbs_per_slice, int abits)
-{
-    const int slice_width = 16 * mbs_per_slice;
-    int i, j, copy_w, copy_h;
-
-    copy_w = FFMIN(w - x, slice_width);
-    copy_h = FFMIN(h - y, 16);
-    for (i = 0; i < copy_h; i++) {
-        memcpy(blocks, src, copy_w * sizeof(*src));
-        if (abits == 8)
-            for (j = 0; j < copy_w; j++)
-                blocks[j] >>= 2;
-        else
-            for (j = 0; j < copy_w; j++)
-                blocks[j] = (blocks[j] << 6) | (blocks[j] >> 4);
-        for (j = copy_w; j < slice_width; j++)
-            blocks[j] = blocks[copy_w - 1];
-        blocks += slice_width;
-        src    += linesize >> 1;
-    }
-    for (; i < 16; i++) {
-        memcpy(blocks, blocks - slice_width, slice_width * sizeof(*blocks));
-        blocks += slice_width;
-    }
-}
-
-/**
- * Write an unsigned rice/exp golomb codeword.
- */
-static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
-{
-    unsigned int rice_order, exp_order, switch_bits, switch_val;
-    int exponent;
-
-    /* number of prefix bits to switch between Rice and expGolomb */
-    switch_bits = (codebook & 3) + 1;
-    rice_order  =  codebook >> 5;       /* rice code order */
-    exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */
-
-    switch_val  = switch_bits << rice_order;
-
-    if (val >= switch_val) {
-        val -= switch_val - (1 << exp_order);
-        exponent = av_log2(val);
-
-        put_bits(pb, exponent - exp_order + switch_bits, 0);
-        put_bits(pb, exponent + 1, val);
-    } else {
-        exponent = val >> rice_order;
-
-        if (exponent)
-            put_bits(pb, exponent, 0);
-        put_bits(pb, 1, 1);
-        if (rice_order)
-            put_sbits(pb, rice_order, val);
-    }
-}
-
-#define GET_SIGN(x)  ((x) >> 31)
-#define MAKE_CODE(x) (((x) << 1) ^ GET_SIGN(x))
-
-static void encode_dcs(PutBitContext *pb, int16_t *blocks,
-                       int blocks_per_slice, int scale)
-{
-    int i;
-    int codebook = 3, code, dc, prev_dc, delta, sign, new_sign;
-
-    prev_dc = (blocks[0] - 0x4000) / scale;
-    encode_vlc_codeword(pb, FIRST_DC_CB, MAKE_CODE(prev_dc));
-    sign     = 0;
-    codebook = 3;
-    blocks  += 64;
-
-    for (i = 1; i < blocks_per_slice; i++, blocks += 64) {
-        dc       = (blocks[0] - 0x4000) / scale;
-        delta    = dc - prev_dc;
-        new_sign = GET_SIGN(delta);
-        delta    = (delta ^ sign) - sign;
-        code     = MAKE_CODE(delta);
-        encode_vlc_codeword(pb, ff_prores_dc_codebook[codebook], code);
-        codebook = (code + (code & 1)) >> 1;
-        codebook = FFMIN(codebook, 3);
-        sign     = new_sign;
-        prev_dc  = dc;
-    }
-}
-
-static void encode_acs(PutBitContext *pb, int16_t *blocks,
-                       int blocks_per_slice,
-                       int plane_size_factor,
-                       const uint8_t *scan, const int16_t *qmat)
-{
-    int idx, i;
-    int run, level, run_cb, lev_cb;
-    int max_coeffs, abs_level;
-
-    max_coeffs = blocks_per_slice << 6;
-    run_cb     = ff_prores_run_to_cb_index[4];
-    lev_cb     = ff_prores_lev_to_cb_index[2];
-    run        = 0;
-
-    for (i = 1; i < 64; i++) {
-        for (idx = scan[i]; idx < max_coeffs; idx += 64) {
-            level = blocks[idx] / qmat[scan[i]];
-            if (level) {
-                abs_level = FFABS(level);
-                encode_vlc_codeword(pb, ff_prores_ac_codebook[run_cb], run);
-                encode_vlc_codeword(pb, ff_prores_ac_codebook[lev_cb],
-                                    abs_level - 1);
-                put_sbits(pb, 1, GET_SIGN(level));
-
-                run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)];
-                lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)];
-                run    = 0;
-            } else {
-                run++;
-            }
-        }
-    }
-}
-
-static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb,
-                              const uint16_t *src, int linesize,
-                              int mbs_per_slice, int16_t *blocks,
-                              int blocks_per_mb, int plane_size_factor,
-                              const int16_t *qmat)
-{
-    int blocks_per_slice, saved_pos;
-
-    saved_pos = put_bits_count(pb);
-    blocks_per_slice = mbs_per_slice * blocks_per_mb;
-
-    encode_dcs(pb, blocks, blocks_per_slice, qmat[0]);
-    encode_acs(pb, blocks, blocks_per_slice, plane_size_factor,
-               ctx->scantable.permutated, qmat);
-    flush_put_bits(pb);
-
-    return (put_bits_count(pb) - saved_pos) >> 3;
-}
-
-static void put_alpha_diff(PutBitContext *pb, int cur, int prev, int abits)
-{
-    const int mask  = (1 << abits) - 1;
-    const int dbits = (abits == 8) ? 4 : 7;
-    const int dsize = 1 << dbits - 1;
-    int diff = cur - prev;
-
-    diff &= mask;
-    if (diff >= (1 << abits) - dsize)
-        diff -= 1 << abits;
-    if (diff < -dsize || diff > dsize || !diff) {
-        put_bits(pb, 1, 1);
-        put_bits(pb, abits, diff);
-    } else {
-        put_bits(pb, 1, 0);
-        put_bits(pb, dbits - 1, FFABS(diff) - 1);
-        put_bits(pb, 1, diff < 0);
-    }
-}
-
-static void put_alpha_run(PutBitContext *pb, int run)
-{
-    if (run) {
-        put_bits(pb, 1, 0);
-        if (run < 0x10)
-            put_bits(pb, 4, run);
-        else
-            put_bits(pb, 15, run);
-    } else {
-        put_bits(pb, 1, 1);
-    }
-}
-
-// todo alpha quantisation for high quants
-static int encode_alpha_plane(ProresContext *ctx, PutBitContext *pb,
-                              const uint16_t *src, int linesize,
-                              int mbs_per_slice, uint16_t *blocks,
-                              int quant)
-{
-    const int abits = ctx->alpha_bits;
-    const int mask  = (1 << abits) - 1;
-    const int num_coeffs = mbs_per_slice * 256;
-    int saved_pos = put_bits_count(pb);
-    int prev = mask, cur;
-    int idx = 0;
-    int run = 0;
-
-    cur = blocks[idx++];
-    put_alpha_diff(pb, cur, prev, abits);
-    prev = cur;
-    do {
-        cur = blocks[idx++];
-        if (cur != prev) {
-            put_alpha_run (pb, run);
-            put_alpha_diff(pb, cur, prev, abits);
-            prev = cur;
-            run  = 0;
-        } else {
-            run++;
-        }
-    } while (idx < num_coeffs);
-    if (run)
-        put_alpha_run(pb, run);
-    flush_put_bits(pb);
-    return (put_bits_count(pb) - saved_pos) >> 3;
-}
-
-static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
-                        PutBitContext *pb,
-                        int sizes[4], int x, int y, int quant,
-                        int mbs_per_slice)
-{
-    ProresContext *ctx = avctx->priv_data;
-    int i, xp, yp;
-    int total_size = 0;
-    const uint16_t *src;
-    int slice_width_factor = av_log2(mbs_per_slice);
-    int num_cblocks, pwidth, linesize, line_add;
-    int plane_factor, is_chroma;
-    uint16_t *qmat;
-
-    if (ctx->pictures_per_frame == 1)
-        line_add = 0;
-    else
-        line_add = ctx->cur_picture_idx ^ !pic->top_field_first;
-
-    if (ctx->force_quant) {
-        qmat = ctx->quants[0];
-    } else if (quant < MAX_STORED_Q) {
-        qmat = ctx->quants[quant];
-    } else {
-        qmat = ctx->custom_q;
-        for (i = 0; i < 64; i++)
-            qmat[i] = ctx->quant_mat[i] * quant;
-    }
-
-    for (i = 0; i < ctx->num_planes; i++) {
-        is_chroma    = (i == 1 || i == 2);
-        plane_factor = slice_width_factor + 2;
-        if (is_chroma)
-            plane_factor += ctx->chroma_factor - 3;
-        if (!is_chroma || ctx->chroma_factor == CFACTOR_Y444) {
-            xp          = x << 4;
-            yp          = y << 4;
-            num_cblocks = 4;
-            pwidth      = avctx->width;
-        } else {
-            xp          = x << 3;
-            yp          = y << 4;
-            num_cblocks = 2;
-            pwidth      = avctx->width >> 1;
-        }
-
-        linesize = pic->linesize[i] * ctx->pictures_per_frame;
-        src = (const uint16_t*)(pic->data[i] + yp * linesize +
-                                line_add * pic->linesize[i]) + xp;
-
-        if (i < 3) {
-            get_slice_data(ctx, src, linesize, xp, yp,
-                           pwidth, avctx->height / ctx->pictures_per_frame,
-                           ctx->blocks[0], ctx->emu_buf,
-                           mbs_per_slice, num_cblocks, is_chroma);
-            sizes[i] = encode_slice_plane(ctx, pb, src, linesize,
-                                          mbs_per_slice, ctx->blocks[0],
-                                          num_cblocks, plane_factor,
-                                          qmat);
-        } else {
-            get_alpha_data(ctx, src, linesize, xp, yp,
-                           pwidth, avctx->height / ctx->pictures_per_frame,
-                           ctx->blocks[0], mbs_per_slice, ctx->alpha_bits);
-            sizes[i] = encode_alpha_plane(ctx, pb, src, linesize,
-                                          mbs_per_slice, ctx->blocks[0],
-                                          quant);
-        }
-        total_size += sizes[i];
-    }
-    return total_size;
-}
-
-static inline int estimate_vlc(unsigned codebook, int val)
-{
-    unsigned int rice_order, exp_order, switch_bits, switch_val;
-    int exponent;
-
-    /* number of prefix bits to switch between Rice and expGolomb */
-    switch_bits = (codebook & 3) + 1;
-    rice_order  =  codebook >> 5;       /* rice code order */
-    exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */
-
-    switch_val  = switch_bits << rice_order;
-
-    if (val >= switch_val) {
-        val -= switch_val - (1 << exp_order);
-        exponent = av_log2(val);
-
-        return exponent * 2 - exp_order + switch_bits + 1;
-    } else {
-        return (val >> rice_order) + rice_order + 1;
-    }
-}
-
-static int estimate_dcs(int *error, int16_t *blocks, int blocks_per_slice,
-                        int scale)
-{
-    int i;
-    int codebook = 3, code, dc, prev_dc, delta, sign, new_sign;
-    int bits;
-
-    prev_dc  = (blocks[0] - 0x4000) / scale;
-    bits     = estimate_vlc(FIRST_DC_CB, MAKE_CODE(prev_dc));
-    sign     = 0;
-    codebook = 3;
-    blocks  += 64;
-    *error  += FFABS(blocks[0] - 0x4000) % scale;
-
-    for (i = 1; i < blocks_per_slice; i++, blocks += 64) {
-        dc       = (blocks[0] - 0x4000) / scale;
-        *error  += FFABS(blocks[0] - 0x4000) % scale;
-        delta    = dc - prev_dc;
-        new_sign = GET_SIGN(delta);
-        delta    = (delta ^ sign) - sign;
-        code     = MAKE_CODE(delta);
-        bits    += estimate_vlc(ff_prores_dc_codebook[codebook], code);
-        codebook = (code + (code & 1)) >> 1;
-        codebook = FFMIN(codebook, 3);
-        sign     = new_sign;
-        prev_dc  = dc;
-    }
-
-    return bits;
-}
-
-static int estimate_acs(int *error, int16_t *blocks, int blocks_per_slice,
-                        int plane_size_factor,
-                        const uint8_t *scan, const int16_t *qmat)
-{
-    int idx, i;
-    int run, level, run_cb, lev_cb;
-    int max_coeffs, abs_level;
-    int bits = 0;
-
-    max_coeffs = blocks_per_slice << 6;
-    run_cb     = ff_prores_run_to_cb_index[4];
-    lev_cb     = ff_prores_lev_to_cb_index[2];
-    run        = 0;
-
-    for (i = 1; i < 64; i++) {
-        for (idx = scan[i]; idx < max_coeffs; idx += 64) {
-            level   = blocks[idx] / qmat[scan[i]];
-            *error += FFABS(blocks[idx]) % qmat[scan[i]];
-            if (level) {
-                abs_level = FFABS(level);
-                bits += estimate_vlc(ff_prores_ac_codebook[run_cb], run);
-                bits += estimate_vlc(ff_prores_ac_codebook[lev_cb],
-                                     abs_level - 1) + 1;
-
-                run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)];
-                lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)];
-                run    = 0;
-            } else {
-                run++;
-            }
-        }
-    }
-
-    return bits;
-}
-
-static int estimate_slice_plane(ProresContext *ctx, int *error, int plane,
-                                const uint16_t *src, int linesize,
-                                int mbs_per_slice,
-                                int blocks_per_mb, int plane_size_factor,
-                                const int16_t *qmat, ProresThreadData *td)
-{
-    int blocks_per_slice;
-    int bits;
-
-    blocks_per_slice = mbs_per_slice * blocks_per_mb;
-
-    bits  = estimate_dcs(error, td->blocks[plane], blocks_per_slice, qmat[0]);
-    bits += estimate_acs(error, td->blocks[plane], blocks_per_slice,
-                         plane_size_factor, ctx->scantable.permutated, qmat);
-
-    return FFALIGN(bits, 8);
-}
-
-static int est_alpha_diff(int cur, int prev, int abits)
-{
-    const int mask  = (1 << abits) - 1;
-    const int dbits = (abits == 8) ? 4 : 7;
-    const int dsize = 1 << dbits - 1;
-    int diff = cur - prev;
-
-    diff &= mask;
-    if (diff >= (1 << abits) - dsize)
-        diff -= 1 << abits;
-    if (diff < -dsize || diff > dsize || !diff)
-        return abits + 1;
-    else
-        return dbits + 1;
-}
-
-static int estimate_alpha_plane(ProresContext *ctx, int *error,
-                                const uint16_t *src, int linesize,
-                                int mbs_per_slice, int quant,
-                                int16_t *blocks)
-{
-    const int abits = ctx->alpha_bits;
-    const int mask  = (1 << abits) - 1;
-    const int num_coeffs = mbs_per_slice * 256;
-    int prev = mask, cur;
-    int idx = 0;
-    int run = 0;
-    int bits;
-
-    *error = 0;
-    cur = blocks[idx++];
-    bits = est_alpha_diff(cur, prev, abits);
-    prev = cur;
-    do {
-        cur = blocks[idx++];
-        if (cur != prev) {
-            if (!run)
-                bits++;
-            else if (run < 0x10)
-                bits += 4;
-            else
-                bits += 15;
-            bits += est_alpha_diff(cur, prev, abits);
-            prev = cur;
-            run  = 0;
-        } else {
-            run++;
-        }
-    } while (idx < num_coeffs);
-
-    if (run) {
-        if (run < 0x10)
-            bits += 4;
-        else
-            bits += 15;
-    }
-
-    return bits;
-}
-
-static int find_slice_quant(AVCodecContext *avctx, const AVFrame *pic,
-                            int trellis_node, int x, int y, int mbs_per_slice,
-                            ProresThreadData *td)
-{
-    ProresContext *ctx = avctx->priv_data;
-    int i, q, pq, xp, yp;
-    const uint16_t *src;
-    int slice_width_factor = av_log2(mbs_per_slice);
-    int num_cblocks[MAX_PLANES], pwidth;
-    int plane_factor[MAX_PLANES], is_chroma[MAX_PLANES];
-    const int min_quant = ctx->profile_info->min_quant;
-    const int max_quant = ctx->profile_info->max_quant;
-    int error, bits, bits_limit;
-    int mbs, prev, cur, new_score;
-    int slice_bits[TRELLIS_WIDTH], slice_score[TRELLIS_WIDTH];
-    int overquant;
-    uint16_t *qmat;
-    int linesize[4], line_add;
-
-    if (ctx->pictures_per_frame == 1)
-        line_add = 0;
-    else
-        line_add = ctx->cur_picture_idx ^ !pic->top_field_first;
-    mbs = x + mbs_per_slice;
-
-    for (i = 0; i < ctx->num_planes; i++) {
-        is_chroma[i]    = (i == 1 || i == 2);
-        plane_factor[i] = slice_width_factor + 2;
-        if (is_chroma[i])
-            plane_factor[i] += ctx->chroma_factor - 3;
-        if (!is_chroma[i] || ctx->chroma_factor == CFACTOR_Y444) {
-            xp             = x << 4;
-            yp             = y << 4;
-            num_cblocks[i] = 4;
-            pwidth         = avctx->width;
-        } else {
-            xp             = x << 3;
-            yp             = y << 4;
-            num_cblocks[i] = 2;
-            pwidth         = avctx->width >> 1;
-        }
-
-        linesize[i] = pic->linesize[i] * ctx->pictures_per_frame;
-        src = (const uint16_t*)(pic->data[i] + yp * linesize[i] +
-                                line_add * pic->linesize[i]) + xp;
-
-        if (i < 3) {
-            get_slice_data(ctx, src, linesize[i], xp, yp,
-                           pwidth, avctx->height / ctx->pictures_per_frame,
-                           td->blocks[i], td->emu_buf,
-                           mbs_per_slice, num_cblocks[i], is_chroma[i]);
-        } else {
-            get_alpha_data(ctx, src, linesize[i], xp, yp,
-                           pwidth, avctx->height / ctx->pictures_per_frame,
-                           td->blocks[i], mbs_per_slice, ctx->alpha_bits);
-        }
-    }
-
-    for (q = min_quant; q < max_quant + 2; q++) {
-        td->nodes[trellis_node + q].prev_node = -1;
-        td->nodes[trellis_node + q].quant     = q;
-    }
-
-    // todo: maybe perform coarser quantising to fit into frame size when needed
-    for (q = min_quant; q <= max_quant; q++) {
-        bits  = 0;
-        error = 0;
-        for (i = 0; i < ctx->num_planes - !!ctx->alpha_bits; i++) {
-            bits += estimate_slice_plane(ctx, &error, i,
-                                         src, linesize[i],
-                                         mbs_per_slice,
-                                         num_cblocks[i], plane_factor[i],
-                                         ctx->quants[q], td);
-        }
-        if (ctx->alpha_bits)
-            bits += estimate_alpha_plane(ctx, &error, src, linesize[3],
-                                         mbs_per_slice, q, td->blocks[3]);
-        if (bits > 65000 * 8) {
-            error = SCORE_LIMIT;
-            break;
-        }
-        slice_bits[q]  = bits;
-        slice_score[q] = error;
-    }
-    if (slice_bits[max_quant] <= ctx->bits_per_mb * mbs_per_slice) {
-        slice_bits[max_quant + 1]  = slice_bits[max_quant];
-        slice_score[max_quant + 1] = slice_score[max_quant] + 1;
-        overquant = max_quant;
-    } else {
-        for (q = max_quant + 1; q < 128; q++) {
-            bits  = 0;
-            error = 0;
-            if (q < MAX_STORED_Q) {
-                qmat = ctx->quants[q];
-            } else {
-                qmat = td->custom_q;
-                for (i = 0; i < 64; i++)
-                    qmat[i] = ctx->quant_mat[i] * q;
-            }
-            for (i = 0; i < ctx->num_planes - !!ctx->alpha_bits; i++) {
-                bits += estimate_slice_plane(ctx, &error, i,
-                                             src, linesize[i],
-                                             mbs_per_slice,
-                                             num_cblocks[i], plane_factor[i],
-                                             qmat, td);
-            }
-            if (ctx->alpha_bits)
-                bits += estimate_alpha_plane(ctx, &error, src, linesize[3],
-                                             mbs_per_slice, q, td->blocks[3]);
-            if (bits <= ctx->bits_per_mb * mbs_per_slice)
-                break;
-        }
-
-        slice_bits[max_quant + 1]  = bits;
-        slice_score[max_quant + 1] = error;
-        overquant = q;
-    }
-    td->nodes[trellis_node + max_quant + 1].quant = overquant;
-
-    bits_limit = mbs * ctx->bits_per_mb;
-    for (pq = min_quant; pq < max_quant + 2; pq++) {
-        prev = trellis_node - TRELLIS_WIDTH + pq;
-
-        for (q = min_quant; q < max_quant + 2; q++) {
-            cur = trellis_node + q;
-
-            bits  = td->nodes[prev].bits + slice_bits[q];
-            error = slice_score[q];
-            if (bits > bits_limit)
-                error = SCORE_LIMIT;
-
-            if (td->nodes[prev].score < SCORE_LIMIT && error < SCORE_LIMIT)
-                new_score = td->nodes[prev].score + error;
-            else
-                new_score = SCORE_LIMIT;
-            if (td->nodes[cur].prev_node == -1 ||
-                td->nodes[cur].score >= new_score) {
-
-                td->nodes[cur].bits      = bits;
-                td->nodes[cur].score     = new_score;
-                td->nodes[cur].prev_node = prev;
-            }
-        }
-    }
-
-    error = td->nodes[trellis_node + min_quant].score;
-    pq    = trellis_node + min_quant;
-    for (q = min_quant + 1; q < max_quant + 2; q++) {
-        if (td->nodes[trellis_node + q].score <= error) {
-            error = td->nodes[trellis_node + q].score;
-            pq    = trellis_node + q;
-        }
-    }
-
-    return pq;
-}
-
-static int find_quant_thread(AVCodecContext *avctx, void *arg,
-                             int jobnr, int threadnr)
-{
-    ProresContext *ctx = avctx->priv_data;
-    ProresThreadData *td = ctx->tdata + threadnr;
-    int mbs_per_slice = ctx->mbs_per_slice;
-    int x, y = jobnr, mb, q = 0;
-
-    for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
-        while (ctx->mb_width - x < mbs_per_slice)
-            mbs_per_slice >>= 1;
-        q = find_slice_quant(avctx, avctx->coded_frame,
-                             (mb + 1) * TRELLIS_WIDTH, x, y,
-                             mbs_per_slice, td);
-    }
-
-    for (x = ctx->slices_width - 1; x >= 0; x--) {
-        ctx->slice_q[x + y * ctx->slices_width] = td->nodes[q].quant;
-        q = td->nodes[q].prev_node;
-    }
-
-    return 0;
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *pic, int *got_packet)
-{
-    ProresContext *ctx = avctx->priv_data;
-    uint8_t *orig_buf, *buf, *slice_hdr, *slice_sizes, *tmp;
-    uint8_t *picture_size_pos;
-    PutBitContext pb;
-    int x, y, i, mb, q = 0;
-    int sizes[4] = { 0 };
-    int slice_hdr_size = 2 + 2 * (ctx->num_planes - 1);
-    int frame_size, picture_size, slice_size;
-    int pkt_size, ret;
-    uint8_t frame_flags;
-
-    *avctx->coded_frame           = *pic;
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    pkt_size = ctx->frame_size_upper_bound + FF_MIN_BUFFER_SIZE;
-
-    if ((ret = ff_alloc_packet(pkt, pkt_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    orig_buf = pkt->data;
-
-    // frame atom
-    orig_buf += 4;                              // frame size
-    bytestream_put_be32  (&orig_buf, FRAME_ID); // frame container ID
-    buf = orig_buf;
-
-    // frame header
-    tmp = buf;
-    buf += 2;                                   // frame header size will be stored here
-    bytestream_put_be16  (&buf, 0);             // version 1
-    bytestream_put_buffer(&buf, ctx->vendor, 4);
-    bytestream_put_be16  (&buf, avctx->width);
-    bytestream_put_be16  (&buf, avctx->height);
-
-    frame_flags = ctx->chroma_factor << 6;
-    if (avctx->flags & CODEC_FLAG_INTERLACED_DCT)
-        frame_flags |= pic->top_field_first ? 0x04 : 0x08;
-    bytestream_put_byte  (&buf, frame_flags);
-
-    bytestream_put_byte  (&buf, 0);             // reserved
-    bytestream_put_byte  (&buf, avctx->color_primaries);
-    bytestream_put_byte  (&buf, avctx->color_trc);
-    bytestream_put_byte  (&buf, avctx->colorspace);
-    bytestream_put_byte  (&buf, 0x40 | (ctx->alpha_bits >> 3));
-    bytestream_put_byte  (&buf, 0);             // reserved
-    if (ctx->quant_sel != QUANT_MAT_DEFAULT) {
-        bytestream_put_byte  (&buf, 0x03);      // matrix flags - both matrices are present
-        // luma quantisation matrix
-        for (i = 0; i < 64; i++)
-            bytestream_put_byte(&buf, ctx->quant_mat[i]);
-        // chroma quantisation matrix
-        for (i = 0; i < 64; i++)
-            bytestream_put_byte(&buf, ctx->quant_mat[i]);
-    } else {
-        bytestream_put_byte  (&buf, 0x00);      // matrix flags - default matrices are used
-    }
-    bytestream_put_be16  (&tmp, buf - orig_buf); // write back frame header size
-
-    for (ctx->cur_picture_idx = 0;
-         ctx->cur_picture_idx < ctx->pictures_per_frame;
-         ctx->cur_picture_idx++) {
-        // picture header
-        picture_size_pos = buf + 1;
-        bytestream_put_byte  (&buf, 0x40);          // picture header size (in bits)
-        buf += 4;                                   // picture data size will be stored here
-        bytestream_put_be16  (&buf, ctx->slices_per_picture);
-        bytestream_put_byte  (&buf, av_log2(ctx->mbs_per_slice) << 4); // slice width and height in MBs
-
-        // seek table - will be filled during slice encoding
-        slice_sizes = buf;
-        buf += ctx->slices_per_picture * 2;
-
-        // slices
-        if (!ctx->force_quant) {
-            ret = avctx->execute2(avctx, find_quant_thread, NULL, NULL,
-                                  ctx->mb_height);
-            if (ret)
-                return ret;
-        }
-
-        for (y = 0; y < ctx->mb_height; y++) {
-            int mbs_per_slice = ctx->mbs_per_slice;
-            for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
-                q = ctx->force_quant ? ctx->force_quant
-                                     : ctx->slice_q[mb + y * ctx->slices_width];
-
-                while (ctx->mb_width - x < mbs_per_slice)
-                    mbs_per_slice >>= 1;
-
-                bytestream_put_byte(&buf, slice_hdr_size << 3);
-                slice_hdr = buf;
-                buf += slice_hdr_size - 1;
-                init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8);
-                encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice);
-
-                bytestream_put_byte(&slice_hdr, q);
-                slice_size = slice_hdr_size + sizes[ctx->num_planes - 1];
-                for (i = 0; i < ctx->num_planes - 1; i++) {
-                    bytestream_put_be16(&slice_hdr, sizes[i]);
-                    slice_size += sizes[i];
-                }
-                bytestream_put_be16(&slice_sizes, slice_size);
-                buf += slice_size - slice_hdr_size;
-            }
-        }
-
-        if (ctx->pictures_per_frame == 1)
-            picture_size = buf - picture_size_pos - 6;
-        else
-            picture_size = buf - picture_size_pos + 1;
-        bytestream_put_be32(&picture_size_pos, picture_size);
-    }
-
-    orig_buf -= 8;
-    frame_size = buf - orig_buf;
-    bytestream_put_be32(&orig_buf, frame_size);
-
-    pkt->size   = frame_size;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int encode_close(AVCodecContext *avctx)
-{
-    ProresContext *ctx = avctx->priv_data;
-    int i;
-
-    av_freep(&avctx->coded_frame);
-
-    if (ctx->tdata) {
-        for (i = 0; i < avctx->thread_count; i++)
-            av_free(ctx->tdata[i].nodes);
-    }
-    av_freep(&ctx->tdata);
-    av_freep(&ctx->slice_q);
-
-    return 0;
-}
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    ProresContext *ctx = avctx->priv_data;
-    int mps;
-    int i, j;
-    int min_quant, max_quant;
-    int interlaced = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
-
-    avctx->bits_per_raw_sample = 10;
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    ff_proresdsp_init(&ctx->dsp);
-    ff_init_scantable(ctx->dsp.dct_permutation, &ctx->scantable,
-                      interlaced ? ff_prores_interlaced_scan
-                                 : ff_prores_progressive_scan);
-
-    mps = ctx->mbs_per_slice;
-    if (mps & (mps - 1)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "there should be an integer power of two MBs per slice\n");
-        return AVERROR(EINVAL);
-    }
-    if (av_pix_fmt_desc_get(avctx->pix_fmt)->flags & AV_PIX_FMT_FLAG_ALPHA) {
-        if (ctx->alpha_bits & 7) {
-            av_log(avctx, AV_LOG_ERROR, "alpha bits should be 0, 8 or 16\n");
-            return AVERROR(EINVAL);
-        }
-    } else {
-        ctx->alpha_bits = 0;
-    }
-
-    ctx->chroma_factor = avctx->pix_fmt == AV_PIX_FMT_YUV422P10
-                         ? CFACTOR_Y422
-                         : CFACTOR_Y444;
-    ctx->profile_info  = prores_profile_info + ctx->profile;
-    ctx->num_planes    = 3 + !!ctx->alpha_bits;
-
-    ctx->mb_width      = FFALIGN(avctx->width,  16) >> 4;
-
-    if (interlaced)
-        ctx->mb_height = FFALIGN(avctx->height, 32) >> 5;
-    else
-        ctx->mb_height = FFALIGN(avctx->height, 16) >> 4;
-
-    ctx->slices_width  = ctx->mb_width / mps;
-    ctx->slices_width += av_popcount(ctx->mb_width - ctx->slices_width * mps);
-    ctx->slices_per_picture = ctx->mb_height * ctx->slices_width;
-    ctx->pictures_per_frame = 1 + interlaced;
-
-    if (ctx->quant_sel == -1)
-        ctx->quant_mat = prores_quant_matrices[ctx->profile_info->quant];
-    else
-        ctx->quant_mat = prores_quant_matrices[ctx->quant_sel];
-
-    if (strlen(ctx->vendor) != 4) {
-        av_log(avctx, AV_LOG_ERROR, "vendor ID should be 4 bytes\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->force_quant = avctx->global_quality / FF_QP2LAMBDA;
-    if (!ctx->force_quant) {
-        if (!ctx->bits_per_mb) {
-            for (i = 0; i < NUM_MB_LIMITS - 1; i++)
-                if (prores_mb_limits[i] >= ctx->mb_width * ctx->mb_height *
-                                           ctx->pictures_per_frame)
-                    break;
-            ctx->bits_per_mb   = ctx->profile_info->br_tab[i];
-        } else if (ctx->bits_per_mb < 128) {
-            av_log(avctx, AV_LOG_ERROR, "too few bits per MB, please set at least 128\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        min_quant = ctx->profile_info->min_quant;
-        max_quant = ctx->profile_info->max_quant;
-        for (i = min_quant; i < MAX_STORED_Q; i++) {
-            for (j = 0; j < 64; j++)
-                ctx->quants[i][j] = ctx->quant_mat[j] * i;
-        }
-
-        ctx->slice_q = av_malloc(ctx->slices_per_picture * sizeof(*ctx->slice_q));
-        if (!ctx->slice_q) {
-            encode_close(avctx);
-            return AVERROR(ENOMEM);
-        }
-
-        ctx->tdata = av_mallocz(avctx->thread_count * sizeof(*ctx->tdata));
-        if (!ctx->tdata) {
-            encode_close(avctx);
-            return AVERROR(ENOMEM);
-        }
-
-        for (j = 0; j < avctx->thread_count; j++) {
-            ctx->tdata[j].nodes = av_malloc((ctx->slices_width + 1)
-                                            * TRELLIS_WIDTH
-                                            * sizeof(*ctx->tdata->nodes));
-            if (!ctx->tdata[j].nodes) {
-                encode_close(avctx);
-                return AVERROR(ENOMEM);
-            }
-            for (i = min_quant; i < max_quant + 2; i++) {
-                ctx->tdata[j].nodes[i].prev_node = -1;
-                ctx->tdata[j].nodes[i].bits      = 0;
-                ctx->tdata[j].nodes[i].score     = 0;
-            }
-        }
-    } else {
-        int ls = 0;
-
-        if (ctx->force_quant > 64) {
-            av_log(avctx, AV_LOG_ERROR, "too large quantiser, maximum is 64\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        for (j = 0; j < 64; j++) {
-            ctx->quants[0][j] = ctx->quant_mat[j] * ctx->force_quant;
-            ls += av_log2((1 << 11)  / ctx->quants[0][j]) * 2 + 1;
-        }
-
-        ctx->bits_per_mb = ls * 8;
-        if (ctx->chroma_factor == CFACTOR_Y444)
-            ctx->bits_per_mb += ls * 4;
-        if (ctx->num_planes == 4)
-            ctx->bits_per_mb += ls * 4;
-    }
-
-    ctx->frame_size_upper_bound = ctx->pictures_per_frame *
-                                  ctx->slices_per_picture *
-                                  (2 + 2 * ctx->num_planes +
-                                   (mps * ctx->bits_per_mb) / 8)
-                                  + 200;
-
-    avctx->codec_tag   = ctx->profile_info->tag;
-
-    av_log(avctx, AV_LOG_DEBUG,
-           "profile %d, %d slices, interlacing: %s, %d bits per MB\n",
-           ctx->profile, ctx->slices_per_picture * ctx->pictures_per_frame,
-           interlaced ? "yes" : "no", ctx->bits_per_mb);
-    av_log(avctx, AV_LOG_DEBUG, "frame size upper bound: %d\n",
-           ctx->frame_size_upper_bound);
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(ProresContext, x)
-#define VE     AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-
-static const AVOption options[] = {
-    { "mbs_per_slice", "macroblocks per slice", OFFSET(mbs_per_slice),
-        AV_OPT_TYPE_INT, { .i64 = 8 }, 1, MAX_MBS_PER_SLICE, VE },
-    { "profile",       NULL, OFFSET(profile), AV_OPT_TYPE_INT,
-        { .i64 = PRORES_PROFILE_STANDARD },
-        PRORES_PROFILE_PROXY, PRORES_PROFILE_4444, VE, "profile" },
-    { "proxy",         NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_PROXY },
-        0, 0, VE, "profile" },
-    { "lt",            NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_LT },
-        0, 0, VE, "profile" },
-    { "standard",      NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_STANDARD },
-        0, 0, VE, "profile" },
-    { "hq",            NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_HQ },
-        0, 0, VE, "profile" },
-    { "4444",          NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_4444 },
-        0, 0, VE, "profile" },
-    { "vendor", "vendor ID", OFFSET(vendor),
-        AV_OPT_TYPE_STRING, { .str = "Lavc" }, CHAR_MIN, CHAR_MAX, VE },
-    { "bits_per_mb", "desired bits per macroblock", OFFSET(bits_per_mb),
-        AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 8192, VE },
-    { "quant_mat", "quantiser matrix", OFFSET(quant_sel), AV_OPT_TYPE_INT,
-        { .i64 = -1 }, -1, QUANT_MAT_DEFAULT, VE, "quant_mat" },
-    { "auto",          NULL, 0, AV_OPT_TYPE_CONST, { .i64 = -1 },
-        0, 0, VE, "quant_mat" },
-    { "proxy",         NULL, 0, AV_OPT_TYPE_CONST, { .i64 = QUANT_MAT_PROXY },
-        0, 0, VE, "quant_mat" },
-    { "lt",            NULL, 0, AV_OPT_TYPE_CONST, { .i64 = QUANT_MAT_LT },
-        0, 0, VE, "quant_mat" },
-    { "standard",      NULL, 0, AV_OPT_TYPE_CONST, { .i64 = QUANT_MAT_STANDARD },
-        0, 0, VE, "quant_mat" },
-    { "hq",            NULL, 0, AV_OPT_TYPE_CONST, { .i64 = QUANT_MAT_HQ },
-        0, 0, VE, "quant_mat" },
-    { "default",       NULL, 0, AV_OPT_TYPE_CONST, { .i64 = QUANT_MAT_DEFAULT },
-        0, 0, VE, "quant_mat" },
-    { "alpha_bits", "bits for alpha plane", OFFSET(alpha_bits), AV_OPT_TYPE_INT,
-        { .i64 = 16 }, 0, 16, VE },
-    { NULL }
-};
-
-static const AVClass proresenc_class = {
-    .class_name = "ProRes encoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_prores_encoder = {
-    .name           = "prores",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PRORES,
-    .priv_data_size = sizeof(ProresContext),
-    .init           = encode_init,
-    .close          = encode_close,
-    .encode2        = encode_frame,
-    .capabilities   = CODEC_CAP_SLICE_THREADS,
-    .pix_fmts       = (const enum AVPixelFormat[]) {
-                          AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
-                          AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE
-                      },
-    .priv_class     = &proresenc_class,
-};
diff --git a/deps/libav/libavcodec/psymodel.c b/deps/libav/libavcodec/psymodel.c
deleted file mode 100644
index a2af611..0000000
--- a/deps/libav/libavcodec/psymodel.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * audio encoder psychoacoustic model
- * Copyright (C) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "avcodec.h"
-#include "psymodel.h"
-#include "iirfilter.h"
-#include "libavutil/mem.h"
-
-extern const FFPsyModel ff_aac_psy_model;
-
-av_cold int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx, int num_lens,
-                        const uint8_t **bands, const int* num_bands,
-                        int num_groups, const uint8_t *group_map)
-{
-    int i, j, k = 0;
-
-    ctx->avctx = avctx;
-    ctx->ch        = av_mallocz(sizeof(ctx->ch[0]) * avctx->channels * 2);
-    ctx->group     = av_mallocz(sizeof(ctx->group[0]) * num_groups);
-    ctx->bands     = av_malloc (sizeof(ctx->bands[0])     * num_lens);
-    ctx->num_bands = av_malloc (sizeof(ctx->num_bands[0]) * num_lens);
-    memcpy(ctx->bands,     bands,     sizeof(ctx->bands[0])     *  num_lens);
-    memcpy(ctx->num_bands, num_bands, sizeof(ctx->num_bands[0]) *  num_lens);
-
-    /* assign channels to groups (with virtual channels for coupling) */
-    for (i = 0; i < num_groups; i++) {
-        /* NOTE: Add 1 to handle the AAC chan_config without modification.
-         *       This has the side effect of allowing an array of 0s to map
-         *       to one channel per group.
-         */
-        ctx->group[i].num_ch = group_map[i] + 1;
-        for (j = 0; j < ctx->group[i].num_ch * 2; j++)
-            ctx->group[i].ch[j]  = &ctx->ch[k++];
-    }
-
-    switch (ctx->avctx->codec_id) {
-    case AV_CODEC_ID_AAC:
-        ctx->model = &ff_aac_psy_model;
-        break;
-    }
-    if (ctx->model->init)
-        return ctx->model->init(ctx);
-    return 0;
-}
-
-FFPsyChannelGroup *ff_psy_find_group(FFPsyContext *ctx, int channel)
-{
-    int i = 0, ch = 0;
-
-    while (ch <= channel)
-        ch += ctx->group[i++].num_ch;
-
-    return &ctx->group[i-1];
-}
-
-av_cold void ff_psy_end(FFPsyContext *ctx)
-{
-    if (ctx->model->end)
-        ctx->model->end(ctx);
-    av_freep(&ctx->bands);
-    av_freep(&ctx->num_bands);
-    av_freep(&ctx->group);
-    av_freep(&ctx->ch);
-}
-
-typedef struct FFPsyPreprocessContext{
-    AVCodecContext *avctx;
-    float stereo_att;
-    struct FFIIRFilterCoeffs *fcoeffs;
-    struct FFIIRFilterState **fstate;
-}FFPsyPreprocessContext;
-
-#define FILT_ORDER 4
-
-av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *avctx)
-{
-    FFPsyPreprocessContext *ctx;
-    int i;
-    float cutoff_coeff = 0;
-    ctx        = av_mallocz(sizeof(FFPsyPreprocessContext));
-    ctx->avctx = avctx;
-
-    if (avctx->cutoff > 0)
-        cutoff_coeff = 2.0 * avctx->cutoff / avctx->sample_rate;
-
-    if (cutoff_coeff)
-    ctx->fcoeffs = ff_iir_filter_init_coeffs(avctx, FF_FILTER_TYPE_BUTTERWORTH,
-                                             FF_FILTER_MODE_LOWPASS, FILT_ORDER,
-                                             cutoff_coeff, 0.0, 0.0);
-    if (ctx->fcoeffs) {
-        ctx->fstate = av_mallocz(sizeof(ctx->fstate[0]) * avctx->channels);
-        for (i = 0; i < avctx->channels; i++)
-            ctx->fstate[i] = ff_iir_filter_init_state(FILT_ORDER);
-    }
-    return ctx;
-}
-
-void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, float **audio, int channels)
-{
-    int ch;
-    int frame_size = ctx->avctx->frame_size;
-
-    if (ctx->fstate) {
-        for (ch = 0; ch < channels; ch++)
-            ff_iir_filter_flt(ctx->fcoeffs, ctx->fstate[ch], frame_size,
-                              &audio[ch][frame_size], 1, &audio[ch][frame_size], 1);
-    }
-}
-
-av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)
-{
-    int i;
-    ff_iir_filter_free_coeffs(ctx->fcoeffs);
-    if (ctx->fstate)
-        for (i = 0; i < ctx->avctx->channels; i++)
-            ff_iir_filter_free_state(ctx->fstate[i]);
-    av_freep(&ctx->fstate);
-    av_free(ctx);
-}
diff --git a/deps/libav/libavcodec/psymodel.h b/deps/libav/libavcodec/psymodel.h
deleted file mode 100644
index 1cc3066..0000000
--- a/deps/libav/libavcodec/psymodel.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * audio encoder psychoacoustic model
- * Copyright (C) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PSYMODEL_H
-#define AVCODEC_PSYMODEL_H
-
-#include "avcodec.h"
-
-/** maximum possible number of bands */
-#define PSY_MAX_BANDS 128
-/** maximum number of channels */
-#define PSY_MAX_CHANS 20
-
-/**
- * single band psychoacoustic information
- */
-typedef struct FFPsyBand {
-    int   bits;
-    float energy;
-    float threshold;
-    float distortion;
-    float perceptual_weight;
-} FFPsyBand;
-
-/**
- * single channel psychoacoustic information
- */
-typedef struct FFPsyChannel {
-    FFPsyBand psy_bands[PSY_MAX_BANDS]; ///< channel bands information
-    float     entropy;                  ///< total PE for this channel
-} FFPsyChannel;
-
-/**
- * psychoacoustic information for an arbitrary group of channels
- */
-typedef struct FFPsyChannelGroup {
-    FFPsyChannel *ch[PSY_MAX_CHANS];  ///< pointers to the individual channels in the group
-    uint8_t num_ch;                   ///< number of channels in this group
-    uint8_t coupling[PSY_MAX_BANDS];  ///< allow coupling for this band in the group
-} FFPsyChannelGroup;
-
-/**
- * windowing related information
- */
-typedef struct FFPsyWindowInfo {
-    int window_type[3];               ///< window type (short/long/transitional, etc.) - current, previous and next
-    int window_shape;                 ///< window shape (sine/KBD/whatever)
-    int num_windows;                  ///< number of windows in a frame
-    int grouping[8];                  ///< window grouping (for e.g. AAC)
-    int *window_sizes;                ///< sequence of window sizes inside one frame (for eg. WMA)
-} FFPsyWindowInfo;
-
-/**
- * context used by psychoacoustic model
- */
-typedef struct FFPsyContext {
-    AVCodecContext *avctx;            ///< encoder context
-    const struct FFPsyModel *model;   ///< encoder-specific model functions
-
-    FFPsyChannel      *ch;            ///< single channel information
-    FFPsyChannelGroup *group;         ///< channel group information
-    int num_groups;                   ///< number of channel groups
-
-    uint8_t **bands;                  ///< scalefactor band sizes for possible frame sizes
-    int     *num_bands;               ///< number of scalefactor bands for possible frame sizes
-    int num_lens;                     ///< number of scalefactor band sets
-
-    struct {
-        int size;                     ///< size of the bitresevoir in bits
-        int bits;                     ///< number of bits used in the bitresevoir
-    } bitres;
-
-    void* model_priv_data;            ///< psychoacoustic model implementation private data
-} FFPsyContext;
-
-/**
- * codec-specific psychoacoustic model implementation
- */
-typedef struct FFPsyModel {
-    const char *name;
-    int  (*init)   (FFPsyContext *apc);
-
-    /**
-     * Suggest window sequence for channel.
-     *
-     * @param ctx       model context
-     * @param audio     samples for the current frame
-     * @param la        lookahead samples (NULL when unavailable)
-     * @param channel   number of channel element to analyze
-     * @param prev_type previous window type
-     *
-     * @return suggested window information in a structure
-     */
-    FFPsyWindowInfo (*window)(FFPsyContext *ctx, const float *audio, const float *la, int channel, int prev_type);
-
-    /**
-     * Perform psychoacoustic analysis and set band info (threshold, energy) for a group of channels.
-     *
-     * @param ctx      model context
-     * @param channel  channel number of the first channel in the group to perform analysis on
-     * @param coeffs   array of pointers to the transformed coefficients
-     * @param wi       window information for the channels in the group
-     */
-    void (*analyze)(FFPsyContext *ctx, int channel, const float **coeffs, const FFPsyWindowInfo *wi);
-
-    void (*end)    (FFPsyContext *apc);
-} FFPsyModel;
-
-/**
- * Initialize psychoacoustic model.
- *
- * @param ctx        model context
- * @param avctx      codec context
- * @param num_lens   number of possible frame lengths
- * @param bands      scalefactor band lengths for all frame lengths
- * @param num_bands  number of scalefactor bands for all frame lengths
- * @param num_groups number of channel groups
- * @param group_map  array with # of channels in group - 1, for each group
- *
- * @return zero if successful, a negative value if not
- */
-int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx, int num_lens,
-                const uint8_t **bands, const int *num_bands,
-                int num_groups, const uint8_t *group_map);
-
-/**
- * Determine what group a channel belongs to.
- *
- * @param ctx     psymodel context
- * @param channel channel to locate the group for
- *
- * @return pointer to the FFPsyChannelGroup this channel belongs to
- */
-FFPsyChannelGroup *ff_psy_find_group(FFPsyContext *ctx, int channel);
-
-/**
- * Cleanup model context at the end.
- *
- * @param ctx model context
- */
-void ff_psy_end(FFPsyContext *ctx);
-
-
-/**************************************************************************
- *                       Audio preprocessing stuff.                       *
- *       This should be moved into some audio filter eventually.          *
- **************************************************************************/
-struct FFPsyPreprocessContext;
-
-/**
- * psychoacoustic model audio preprocessing initialization
- */
-struct FFPsyPreprocessContext *ff_psy_preprocess_init(AVCodecContext *avctx);
-
-/**
- * Preprocess several channel in audio frame in order to compress it better.
- *
- * @param ctx      preprocessing context
- * @param audio    samples to be filtered (in place)
- * @param channels number of channel to preprocess
- */
-void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, float **audio, int channels);
-
-/**
- * Cleanup audio preprocessing module.
- */
-void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx);
-
-#endif /* AVCODEC_PSYMODEL_H */
diff --git a/deps/libav/libavcodec/pthread.c b/deps/libav/libavcodec/pthread.c
deleted file mode 100644
index 682fd05..0000000
--- a/deps/libav/libavcodec/pthread.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2004 Roman Shaposhnik
- * Copyright (c) 2008 Alexander Strange (astrange at ithinksw.com)
- *
- * Many thanks to Steven M. Schultz for providing clever ideas and
- * to Michael Niedermayer <michaelni at gmx.at> for writing initial
- * implementation.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Multithreading support functions
- * @see doc/multithreading.txt
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "pthread_internal.h"
-#include "thread.h"
-
-/**
- * Set the threading algorithms used.
- *
- * Threading requires more than one thread.
- * Frame threading requires entire frames to be passed to the codec,
- * and introduces extra decoding delay, so is incompatible with low_delay.
- *
- * @param avctx The context.
- */
-static void validate_thread_parameters(AVCodecContext *avctx)
-{
-    int frame_threading_supported = (avctx->codec->capabilities & CODEC_CAP_FRAME_THREADS)
-                                && !(avctx->flags & CODEC_FLAG_TRUNCATED)
-                                && !(avctx->flags & CODEC_FLAG_LOW_DELAY)
-                                && !(avctx->flags2 & CODEC_FLAG2_CHUNKS);
-    if (avctx->thread_count == 1) {
-        avctx->active_thread_type = 0;
-    } else if (frame_threading_supported && (avctx->thread_type & FF_THREAD_FRAME)) {
-        avctx->active_thread_type = FF_THREAD_FRAME;
-    } else if (avctx->codec->capabilities & CODEC_CAP_SLICE_THREADS &&
-               avctx->thread_type & FF_THREAD_SLICE) {
-        avctx->active_thread_type = FF_THREAD_SLICE;
-    } else if (!(avctx->codec->capabilities & CODEC_CAP_AUTO_THREADS)) {
-        avctx->thread_count       = 1;
-        avctx->active_thread_type = 0;
-    }
-
-    if (avctx->thread_count > MAX_AUTO_THREADS)
-        av_log(avctx, AV_LOG_WARNING,
-               "Application has requested %d threads. Using a thread count greater than %d is not recommended.\n",
-               avctx->thread_count, MAX_AUTO_THREADS);
-}
-
-int ff_thread_init(AVCodecContext *avctx)
-{
-    validate_thread_parameters(avctx);
-
-    if (avctx->active_thread_type&FF_THREAD_SLICE)
-        return ff_slice_thread_init(avctx);
-    else if (avctx->active_thread_type&FF_THREAD_FRAME)
-        return ff_frame_thread_init(avctx);
-
-    return 0;
-}
-
-void ff_thread_free(AVCodecContext *avctx)
-{
-    if (avctx->active_thread_type&FF_THREAD_FRAME)
-        ff_frame_thread_free(avctx, avctx->thread_count);
-    else
-        ff_slice_thread_free(avctx);
-}
diff --git a/deps/libav/libavcodec/pthread_frame.c b/deps/libav/libavcodec/pthread_frame.c
deleted file mode 100644
index 1af8ff5..0000000
--- a/deps/libav/libavcodec/pthread_frame.c
+++ /dev/null
@@ -1,803 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Frame multithreading support functions
- * @see doc/multithreading.txt
- */
-
-#include "config.h"
-
-#include <stdint.h>
-
-#if HAVE_PTHREADS
-#include <pthread.h>
-#elif HAVE_W32THREADS
-#include "compat/w32pthreads.h"
-#endif
-
-#include "avcodec.h"
-#include "internal.h"
-#include "pthread_internal.h"
-#include "thread.h"
-
-#include "libavutil/avassert.h"
-#include "libavutil/buffer.h"
-#include "libavutil/common.h"
-#include "libavutil/cpu.h"
-#include "libavutil/frame.h"
-#include "libavutil/log.h"
-#include "libavutil/mem.h"
-
-/**
- * Context used by codec threads and stored in their AVCodecInternal thread_ctx.
- */
-typedef struct PerThreadContext {
-    struct FrameThreadContext *parent;
-
-    pthread_t      thread;
-    int            thread_init;
-    pthread_cond_t input_cond;      ///< Used to wait for a new packet from the main thread.
-    pthread_cond_t progress_cond;   ///< Used by child threads to wait for progress to change.
-    pthread_cond_t output_cond;     ///< Used by the main thread to wait for frames to finish.
-
-    pthread_mutex_t mutex;          ///< Mutex used to protect the contents of the PerThreadContext.
-    pthread_mutex_t progress_mutex; ///< Mutex used to protect frame progress values and progress_cond.
-
-    AVCodecContext *avctx;          ///< Context used to decode packets passed to this thread.
-
-    AVPacket       avpkt;           ///< Input packet (for decoding) or output (for encoding).
-    uint8_t       *buf;             ///< backup storage for packet data when the input packet is not refcounted
-    int            allocated_buf_size; ///< Size allocated for buf
-
-    AVFrame *frame;                 ///< Output frame (for decoding) or input (for encoding).
-    int     got_frame;              ///< The output of got_picture_ptr from the last avcodec_decode_video() call.
-    int     result;                 ///< The result of the last codec decode/encode() call.
-
-    enum {
-        STATE_INPUT_READY,          ///< Set when the thread is awaiting a packet.
-        STATE_SETTING_UP,           ///< Set before the codec has called ff_thread_finish_setup().
-        STATE_GET_BUFFER,           /**<
-                                     * Set when the codec calls get_buffer().
-                                     * State is returned to STATE_SETTING_UP afterwards.
-                                     */
-        STATE_SETUP_FINISHED        ///< Set after the codec has called ff_thread_finish_setup().
-    } state;
-
-    /**
-     * Array of frames passed to ff_thread_release_buffer().
-     * Frames are released after all threads referencing them are finished.
-     */
-    AVFrame *released_buffers;
-    int  num_released_buffers;
-    int      released_buffers_allocated;
-
-    AVFrame *requested_frame;       ///< AVFrame the codec passed to get_buffer()
-    int      requested_flags;       ///< flags passed to get_buffer() for requested_frame
-} PerThreadContext;
-
-/**
- * Context stored in the client AVCodecInternal thread_ctx.
- */
-typedef struct FrameThreadContext {
-    PerThreadContext *threads;     ///< The contexts for each thread.
-    PerThreadContext *prev_thread; ///< The last thread submit_packet() was called on.
-
-    pthread_mutex_t buffer_mutex;  ///< Mutex used to protect get/release_buffer().
-
-    int next_decoding;             ///< The next context to submit a packet to.
-    int next_finished;             ///< The next context to return output from.
-
-    int delaying;                  /**<
-                                    * Set for the first N packets, where N is the number of threads.
-                                    * While it is set, ff_thread_en/decode_frame won't return any results.
-                                    */
-
-    int die;                       ///< Set when threads should exit.
-} FrameThreadContext;
-
-/**
- * Codec worker thread.
- *
- * Automatically calls ff_thread_finish_setup() if the codec does
- * not provide an update_thread_context method, or if the codec returns
- * before calling it.
- */
-static attribute_align_arg void *frame_worker_thread(void *arg)
-{
-    PerThreadContext *p = arg;
-    FrameThreadContext *fctx = p->parent;
-    AVCodecContext *avctx = p->avctx;
-    const AVCodec *codec = avctx->codec;
-
-    while (1) {
-        if (p->state == STATE_INPUT_READY && !fctx->die) {
-            pthread_mutex_lock(&p->mutex);
-            while (p->state == STATE_INPUT_READY && !fctx->die)
-                pthread_cond_wait(&p->input_cond, &p->mutex);
-            pthread_mutex_unlock(&p->mutex);
-        }
-
-        if (fctx->die) break;
-
-        if (!codec->update_thread_context && avctx->thread_safe_callbacks)
-            ff_thread_finish_setup(avctx);
-
-        pthread_mutex_lock(&p->mutex);
-        av_frame_unref(p->frame);
-        p->got_frame = 0;
-        p->result = codec->decode(avctx, p->frame, &p->got_frame, &p->avpkt);
-
-        if ((p->result < 0 || !p->got_frame) && p->frame->buf[0]) {
-            if (avctx->internal->allocate_progress)
-                av_log(avctx, AV_LOG_ERROR, "A frame threaded decoder did not "
-                       "free the frame on failure. This is a bug, please report it.\n");
-            av_frame_unref(p->frame);
-        }
-
-        if (p->state == STATE_SETTING_UP) ff_thread_finish_setup(avctx);
-
-        p->state = STATE_INPUT_READY;
-
-        pthread_mutex_lock(&p->progress_mutex);
-        pthread_cond_signal(&p->output_cond);
-        pthread_mutex_unlock(&p->progress_mutex);
-
-        pthread_mutex_unlock(&p->mutex);
-    }
-
-    return NULL;
-}
-
-/**
- * Update the next thread's AVCodecContext with values from the reference thread's context.
- *
- * @param dst The destination context.
- * @param src The source context.
- * @param for_user 0 if the destination is a codec thread, 1 if the destination is the user's thread
- */
-static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, int for_user)
-{
-    int err = 0;
-
-    if (dst != src) {
-        dst->time_base = src->time_base;
-        dst->width     = src->width;
-        dst->height    = src->height;
-        dst->pix_fmt   = src->pix_fmt;
-
-        dst->coded_width  = src->coded_width;
-        dst->coded_height = src->coded_height;
-
-        dst->has_b_frames = src->has_b_frames;
-        dst->idct_algo    = src->idct_algo;
-
-        dst->bits_per_coded_sample = src->bits_per_coded_sample;
-        dst->sample_aspect_ratio   = src->sample_aspect_ratio;
-        dst->dtg_active_format     = src->dtg_active_format;
-
-        dst->profile = src->profile;
-        dst->level   = src->level;
-
-        dst->bits_per_raw_sample = src->bits_per_raw_sample;
-        dst->ticks_per_frame     = src->ticks_per_frame;
-        dst->color_primaries     = src->color_primaries;
-
-        dst->color_trc   = src->color_trc;
-        dst->colorspace  = src->colorspace;
-        dst->color_range = src->color_range;
-        dst->chroma_sample_location = src->chroma_sample_location;
-
-        dst->hwaccel = src->hwaccel;
-        dst->hwaccel_context = src->hwaccel_context;
-    }
-
-    if (for_user) {
-        dst->coded_frame = src->coded_frame;
-    } else {
-        if (dst->codec->update_thread_context)
-            err = dst->codec->update_thread_context(dst, src);
-    }
-
-    return err;
-}
-
-/**
- * Update the next thread's AVCodecContext with values set by the user.
- *
- * @param dst The destination context.
- * @param src The source context.
- * @return 0 on success, negative error code on failure
- */
-static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
-{
-#define copy_fields(s, e) memcpy(&dst->s, &src->s, (char*)&dst->e - (char*)&dst->s);
-    dst->flags          = src->flags;
-
-    dst->draw_horiz_band= src->draw_horiz_band;
-    dst->get_buffer2    = src->get_buffer2;
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-    dst->get_buffer     = src->get_buffer;
-    dst->release_buffer = src->release_buffer;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-    dst->opaque   = src->opaque;
-    dst->debug    = src->debug;
-
-    dst->slice_flags = src->slice_flags;
-    dst->flags2      = src->flags2;
-
-    copy_fields(skip_loop_filter, subtitle_header);
-
-    dst->frame_number     = src->frame_number;
-    dst->reordered_opaque = src->reordered_opaque;
-
-    if (src->slice_count && src->slice_offset) {
-        if (dst->slice_count < src->slice_count) {
-            int *tmp = av_realloc(dst->slice_offset, src->slice_count *
-                                  sizeof(*dst->slice_offset));
-            if (!tmp) {
-                av_free(dst->slice_offset);
-                return AVERROR(ENOMEM);
-            }
-            dst->slice_offset = tmp;
-        }
-        memcpy(dst->slice_offset, src->slice_offset,
-               src->slice_count * sizeof(*dst->slice_offset));
-    }
-    dst->slice_count = src->slice_count;
-    return 0;
-#undef copy_fields
-}
-
-/// Releases the buffers that this decoding thread was the last user of.
-static void release_delayed_buffers(PerThreadContext *p)
-{
-    FrameThreadContext *fctx = p->parent;
-
-    while (p->num_released_buffers > 0) {
-        AVFrame *f;
-
-        pthread_mutex_lock(&fctx->buffer_mutex);
-
-        // fix extended data in case the caller screwed it up
-        av_assert0(p->avctx->codec_type == AVMEDIA_TYPE_VIDEO);
-        f = &p->released_buffers[--p->num_released_buffers];
-        f->extended_data = f->data;
-        av_frame_unref(f);
-
-        pthread_mutex_unlock(&fctx->buffer_mutex);
-    }
-}
-
-static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
-{
-    FrameThreadContext *fctx = p->parent;
-    PerThreadContext *prev_thread = fctx->prev_thread;
-    const AVCodec *codec = p->avctx->codec;
-
-    if (!avpkt->size && !(codec->capabilities & CODEC_CAP_DELAY)) return 0;
-
-    pthread_mutex_lock(&p->mutex);
-
-    release_delayed_buffers(p);
-
-    if (prev_thread) {
-        int err;
-        if (prev_thread->state == STATE_SETTING_UP) {
-            pthread_mutex_lock(&prev_thread->progress_mutex);
-            while (prev_thread->state == STATE_SETTING_UP)
-                pthread_cond_wait(&prev_thread->progress_cond, &prev_thread->progress_mutex);
-            pthread_mutex_unlock(&prev_thread->progress_mutex);
-        }
-
-        err = update_context_from_thread(p->avctx, prev_thread->avctx, 0);
-        if (err) {
-            pthread_mutex_unlock(&p->mutex);
-            return err;
-        }
-    }
-
-    av_buffer_unref(&p->avpkt.buf);
-    p->avpkt = *avpkt;
-    if (avpkt->buf)
-        p->avpkt.buf = av_buffer_ref(avpkt->buf);
-    else {
-        av_fast_malloc(&p->buf, &p->allocated_buf_size, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
-        p->avpkt.data = p->buf;
-        memcpy(p->buf, avpkt->data, avpkt->size);
-        memset(p->buf + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    }
-
-    p->state = STATE_SETTING_UP;
-    pthread_cond_signal(&p->input_cond);
-    pthread_mutex_unlock(&p->mutex);
-
-    /*
-     * If the client doesn't have a thread-safe get_buffer(),
-     * then decoding threads call back to the main thread,
-     * and it calls back to the client here.
-     */
-
-FF_DISABLE_DEPRECATION_WARNINGS
-    if (!p->avctx->thread_safe_callbacks && (
-#if FF_API_GET_BUFFER
-         p->avctx->get_buffer ||
-#endif
-         p->avctx->get_buffer2 != avcodec_default_get_buffer2)) {
-FF_ENABLE_DEPRECATION_WARNINGS
-        while (p->state != STATE_SETUP_FINISHED && p->state != STATE_INPUT_READY) {
-            pthread_mutex_lock(&p->progress_mutex);
-            while (p->state == STATE_SETTING_UP)
-                pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
-
-            if (p->state == STATE_GET_BUFFER) {
-                p->result = ff_get_buffer(p->avctx, p->requested_frame, p->requested_flags);
-                p->state  = STATE_SETTING_UP;
-                pthread_cond_signal(&p->progress_cond);
-            }
-            pthread_mutex_unlock(&p->progress_mutex);
-        }
-    }
-
-    fctx->prev_thread = p;
-    fctx->next_decoding++;
-
-    return 0;
-}
-
-int ff_thread_decode_frame(AVCodecContext *avctx,
-                           AVFrame *picture, int *got_picture_ptr,
-                           AVPacket *avpkt)
-{
-    FrameThreadContext *fctx = avctx->internal->thread_ctx;
-    int finished = fctx->next_finished;
-    PerThreadContext *p;
-    int err;
-
-    /*
-     * Submit a packet to the next decoding thread.
-     */
-
-    p = &fctx->threads[fctx->next_decoding];
-    err = update_context_from_user(p->avctx, avctx);
-    if (err) return err;
-    err = submit_packet(p, avpkt);
-    if (err) return err;
-
-    /*
-     * If we're still receiving the initial packets, don't return a frame.
-     */
-
-    if (fctx->delaying) {
-        if (fctx->next_decoding >= (avctx->thread_count-1)) fctx->delaying = 0;
-
-        *got_picture_ptr=0;
-        if (avpkt->size)
-            return avpkt->size;
-    }
-
-    /*
-     * Return the next available frame from the oldest thread.
-     * If we're at the end of the stream, then we have to skip threads that
-     * didn't output a frame, because we don't want to accidentally signal
-     * EOF (avpkt->size == 0 && *got_picture_ptr == 0).
-     */
-
-    do {
-        p = &fctx->threads[finished++];
-
-        if (p->state != STATE_INPUT_READY) {
-            pthread_mutex_lock(&p->progress_mutex);
-            while (p->state != STATE_INPUT_READY)
-                pthread_cond_wait(&p->output_cond, &p->progress_mutex);
-            pthread_mutex_unlock(&p->progress_mutex);
-        }
-
-        av_frame_move_ref(picture, p->frame);
-        *got_picture_ptr = p->got_frame;
-        picture->pkt_dts = p->avpkt.dts;
-
-        /*
-         * A later call with avkpt->size == 0 may loop over all threads,
-         * including this one, searching for a frame to return before being
-         * stopped by the "finished != fctx->next_finished" condition.
-         * Make sure we don't mistakenly return the same frame again.
-         */
-        p->got_frame = 0;
-
-        if (finished >= avctx->thread_count) finished = 0;
-    } while (!avpkt->size && !*got_picture_ptr && finished != fctx->next_finished);
-
-    update_context_from_thread(avctx, p->avctx, 1);
-
-    if (fctx->next_decoding >= avctx->thread_count) fctx->next_decoding = 0;
-
-    fctx->next_finished = finished;
-
-    /* return the size of the consumed packet if no error occurred */
-    return (p->result >= 0) ? avpkt->size : p->result;
-}
-
-void ff_thread_report_progress(ThreadFrame *f, int n, int field)
-{
-    PerThreadContext *p;
-    int *progress = f->progress ? (int*)f->progress->data : NULL;
-
-    if (!progress || progress[field] >= n) return;
-
-    p = f->owner->internal->thread_ctx;
-
-    if (f->owner->debug&FF_DEBUG_THREADS)
-        av_log(f->owner, AV_LOG_DEBUG, "%p finished %d field %d\n", progress, n, field);
-
-    pthread_mutex_lock(&p->progress_mutex);
-    progress[field] = n;
-    pthread_cond_broadcast(&p->progress_cond);
-    pthread_mutex_unlock(&p->progress_mutex);
-}
-
-void ff_thread_await_progress(ThreadFrame *f, int n, int field)
-{
-    PerThreadContext *p;
-    int *progress = f->progress ? (int*)f->progress->data : NULL;
-
-    if (!progress || progress[field] >= n) return;
-
-    p = f->owner->internal->thread_ctx;
-
-    if (f->owner->debug&FF_DEBUG_THREADS)
-        av_log(f->owner, AV_LOG_DEBUG, "thread awaiting %d field %d from %p\n", n, field, progress);
-
-    pthread_mutex_lock(&p->progress_mutex);
-    while (progress[field] < n)
-        pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
-    pthread_mutex_unlock(&p->progress_mutex);
-}
-
-void ff_thread_finish_setup(AVCodecContext *avctx) {
-    PerThreadContext *p = avctx->internal->thread_ctx;
-
-    if (!(avctx->active_thread_type&FF_THREAD_FRAME)) return;
-
-    pthread_mutex_lock(&p->progress_mutex);
-    p->state = STATE_SETUP_FINISHED;
-    pthread_cond_broadcast(&p->progress_cond);
-    pthread_mutex_unlock(&p->progress_mutex);
-}
-
-/// Waits for all threads to finish.
-static void park_frame_worker_threads(FrameThreadContext *fctx, int thread_count)
-{
-    int i;
-
-    for (i = 0; i < thread_count; i++) {
-        PerThreadContext *p = &fctx->threads[i];
-
-        if (p->state != STATE_INPUT_READY) {
-            pthread_mutex_lock(&p->progress_mutex);
-            while (p->state != STATE_INPUT_READY)
-                pthread_cond_wait(&p->output_cond, &p->progress_mutex);
-            pthread_mutex_unlock(&p->progress_mutex);
-        }
-    }
-}
-
-void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
-{
-    FrameThreadContext *fctx = avctx->internal->thread_ctx;
-    const AVCodec *codec = avctx->codec;
-    int i;
-
-    park_frame_worker_threads(fctx, thread_count);
-
-    if (fctx->prev_thread && fctx->prev_thread != fctx->threads)
-        update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, 0);
-
-    fctx->die = 1;
-
-    for (i = 0; i < thread_count; i++) {
-        PerThreadContext *p = &fctx->threads[i];
-
-        pthread_mutex_lock(&p->mutex);
-        pthread_cond_signal(&p->input_cond);
-        pthread_mutex_unlock(&p->mutex);
-
-        if (p->thread_init)
-            pthread_join(p->thread, NULL);
-
-        if (codec->close)
-            codec->close(p->avctx);
-
-        avctx->codec = NULL;
-
-        release_delayed_buffers(p);
-        av_frame_free(&p->frame);
-    }
-
-    for (i = 0; i < thread_count; i++) {
-        PerThreadContext *p = &fctx->threads[i];
-
-        pthread_mutex_destroy(&p->mutex);
-        pthread_mutex_destroy(&p->progress_mutex);
-        pthread_cond_destroy(&p->input_cond);
-        pthread_cond_destroy(&p->progress_cond);
-        pthread_cond_destroy(&p->output_cond);
-        av_buffer_unref(&p->avpkt.buf);
-        av_freep(&p->buf);
-        av_freep(&p->released_buffers);
-
-        if (i) {
-            av_freep(&p->avctx->priv_data);
-            av_freep(&p->avctx->slice_offset);
-        }
-
-        av_freep(&p->avctx->internal);
-        av_freep(&p->avctx);
-    }
-
-    av_freep(&fctx->threads);
-    pthread_mutex_destroy(&fctx->buffer_mutex);
-    av_freep(&avctx->internal->thread_ctx);
-}
-
-int ff_frame_thread_init(AVCodecContext *avctx)
-{
-    int thread_count = avctx->thread_count;
-    const AVCodec *codec = avctx->codec;
-    AVCodecContext *src = avctx;
-    FrameThreadContext *fctx;
-    int i, err = 0;
-
-#if HAVE_W32THREADS
-    w32thread_init();
-#endif
-
-    if (!thread_count) {
-        int nb_cpus = av_cpu_count();
-        av_log(avctx, AV_LOG_DEBUG, "detected %d logical cores\n", nb_cpus);
-        // use number of cores + 1 as thread count if there is more than one
-        if (nb_cpus > 1)
-            thread_count = avctx->thread_count = FFMIN(nb_cpus + 1, MAX_AUTO_THREADS);
-        else
-            thread_count = avctx->thread_count = 1;
-    }
-
-    if (thread_count <= 1) {
-        avctx->active_thread_type = 0;
-        return 0;
-    }
-
-    avctx->internal->thread_ctx = fctx = av_mallocz(sizeof(FrameThreadContext));
-
-    fctx->threads = av_mallocz(sizeof(PerThreadContext) * thread_count);
-    pthread_mutex_init(&fctx->buffer_mutex, NULL);
-    fctx->delaying = 1;
-
-    for (i = 0; i < thread_count; i++) {
-        AVCodecContext *copy = av_malloc(sizeof(AVCodecContext));
-        PerThreadContext *p  = &fctx->threads[i];
-
-        pthread_mutex_init(&p->mutex, NULL);
-        pthread_mutex_init(&p->progress_mutex, NULL);
-        pthread_cond_init(&p->input_cond, NULL);
-        pthread_cond_init(&p->progress_cond, NULL);
-        pthread_cond_init(&p->output_cond, NULL);
-
-        p->frame = av_frame_alloc();
-        if (!p->frame) {
-            err = AVERROR(ENOMEM);
-            goto error;
-        }
-
-        p->parent = fctx;
-        p->avctx  = copy;
-
-        if (!copy) {
-            err = AVERROR(ENOMEM);
-            goto error;
-        }
-
-        *copy = *src;
-
-        copy->internal = av_malloc(sizeof(AVCodecInternal));
-        if (!copy->internal) {
-            err = AVERROR(ENOMEM);
-            goto error;
-        }
-        *copy->internal = *src->internal;
-        copy->internal->thread_ctx = p;
-        copy->internal->pkt = &p->avpkt;
-
-        if (!i) {
-            src = copy;
-
-            if (codec->init)
-                err = codec->init(copy);
-
-            update_context_from_thread(avctx, copy, 1);
-        } else {
-            copy->priv_data = av_malloc(codec->priv_data_size);
-            if (!copy->priv_data) {
-                err = AVERROR(ENOMEM);
-                goto error;
-            }
-            memcpy(copy->priv_data, src->priv_data, codec->priv_data_size);
-            copy->internal->is_copy = 1;
-
-            if (codec->init_thread_copy)
-                err = codec->init_thread_copy(copy);
-        }
-
-        if (err) goto error;
-
-        if (!pthread_create(&p->thread, NULL, frame_worker_thread, p))
-            p->thread_init = 1;
-    }
-
-    return 0;
-
-error:
-    ff_frame_thread_free(avctx, i+1);
-
-    return err;
-}
-
-void ff_thread_flush(AVCodecContext *avctx)
-{
-    int i;
-    FrameThreadContext *fctx = avctx->internal->thread_ctx;
-
-    if (!fctx) return;
-
-    park_frame_worker_threads(fctx, avctx->thread_count);
-    if (fctx->prev_thread) {
-        if (fctx->prev_thread != &fctx->threads[0])
-            update_context_from_thread(fctx->threads[0].avctx, fctx->prev_thread->avctx, 0);
-    }
-
-    fctx->next_decoding = fctx->next_finished = 0;
-    fctx->delaying = 1;
-    fctx->prev_thread = NULL;
-    for (i = 0; i < avctx->thread_count; i++) {
-        PerThreadContext *p = &fctx->threads[i];
-        // Make sure decode flush calls with size=0 won't return old frames
-        p->got_frame = 0;
-        av_frame_unref(p->frame);
-
-        release_delayed_buffers(p);
-
-        if (avctx->codec->flush)
-            avctx->codec->flush(p->avctx);
-    }
-}
-
-int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
-{
-    PerThreadContext *p = avctx->internal->thread_ctx;
-    int err;
-
-    f->owner = avctx;
-
-    if (!(avctx->active_thread_type & FF_THREAD_FRAME))
-        return ff_get_buffer(avctx, f->f, flags);
-
-    if (p->state != STATE_SETTING_UP &&
-        (avctx->codec->update_thread_context || !avctx->thread_safe_callbacks)) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() cannot be called after ff_thread_finish_setup()\n");
-        return -1;
-    }
-
-    if (avctx->internal->allocate_progress) {
-        int *progress;
-        f->progress = av_buffer_alloc(2 * sizeof(int));
-        if (!f->progress) {
-            return AVERROR(ENOMEM);
-        }
-        progress = (int*)f->progress->data;
-
-        progress[0] = progress[1] = -1;
-    }
-
-    pthread_mutex_lock(&p->parent->buffer_mutex);
-FF_DISABLE_DEPRECATION_WARNINGS
-    if (avctx->thread_safe_callbacks || (
-#if FF_API_GET_BUFFER
-        !avctx->get_buffer &&
-#endif
-        avctx->get_buffer2 == avcodec_default_get_buffer2)) {
-FF_ENABLE_DEPRECATION_WARNINGS
-        err = ff_get_buffer(avctx, f->f, flags);
-    } else {
-        p->requested_frame = f->f;
-        p->requested_flags = flags;
-        p->state = STATE_GET_BUFFER;
-        pthread_mutex_lock(&p->progress_mutex);
-        pthread_cond_signal(&p->progress_cond);
-
-        while (p->state != STATE_SETTING_UP)
-            pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
-
-        err = p->result;
-
-        pthread_mutex_unlock(&p->progress_mutex);
-
-    }
-    if (!avctx->thread_safe_callbacks && !avctx->codec->update_thread_context)
-        ff_thread_finish_setup(avctx);
-
-    if (err)
-        av_buffer_unref(&f->progress);
-
-    pthread_mutex_unlock(&p->parent->buffer_mutex);
-
-    return err;
-}
-
-void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
-{
-    PerThreadContext *p = avctx->internal->thread_ctx;
-    FrameThreadContext *fctx;
-    AVFrame *dst, *tmp;
-FF_DISABLE_DEPRECATION_WARNINGS
-    int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) ||
-                          avctx->thread_safe_callbacks                   ||
-                          (
-#if FF_API_GET_BUFFER
-                           !avctx->get_buffer &&
-#endif
-                           avctx->get_buffer2 == avcodec_default_get_buffer2);
-FF_ENABLE_DEPRECATION_WARNINGS
-
-    if (!f->f->buf[0])
-        return;
-
-    if (avctx->debug & FF_DEBUG_BUFFERS)
-        av_log(avctx, AV_LOG_DEBUG, "thread_release_buffer called on pic %p\n", f);
-
-    av_buffer_unref(&f->progress);
-    f->owner    = NULL;
-
-    if (can_direct_free) {
-        av_frame_unref(f->f);
-        return;
-    }
-
-    fctx = p->parent;
-    pthread_mutex_lock(&fctx->buffer_mutex);
-
-    if (p->num_released_buffers + 1 >= INT_MAX / sizeof(*p->released_buffers))
-        goto fail;
-    tmp = av_fast_realloc(p->released_buffers, &p->released_buffers_allocated,
-                          (p->num_released_buffers + 1) *
-                          sizeof(*p->released_buffers));
-    if (!tmp)
-        goto fail;
-    p->released_buffers = tmp;
-
-    dst = &p->released_buffers[p->num_released_buffers];
-    av_frame_move_ref(dst, f->f);
-
-    p->num_released_buffers++;
-
-fail:
-    pthread_mutex_unlock(&fctx->buffer_mutex);
-}
diff --git a/deps/libav/libavcodec/pthread_internal.h b/deps/libav/libavcodec/pthread_internal.h
deleted file mode 100644
index 5dfd0b2..0000000
--- a/deps/libav/libavcodec/pthread_internal.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_PTHREAD_INTERNAL_H
-#define AVCODEC_PTHREAD_INTERNAL_H
-
-#include "avcodec.h"
-
-/* H264 slice threading seems to be buggy with more than 16 threads,
- * limit the number of threads to 16 for automatic detection */
-#define MAX_AUTO_THREADS 16
-
-int ff_slice_thread_init(AVCodecContext *avctx);
-void ff_slice_thread_free(AVCodecContext *avctx);
-
-int ff_frame_thread_init(AVCodecContext *avctx);
-void ff_frame_thread_free(AVCodecContext *avctx, int thread_count);
-
-#endif // AVCODEC_PTHREAD_INTERNAL_H
diff --git a/deps/libav/libavcodec/pthread_slice.c b/deps/libav/libavcodec/pthread_slice.c
deleted file mode 100644
index d7c73f0..0000000
--- a/deps/libav/libavcodec/pthread_slice.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Slice multithreading support functions
- * @see doc/multithreading.txt
- */
-
-#include "config.h"
-
-#if HAVE_PTHREADS
-#include <pthread.h>
-#elif HAVE_W32THREADS
-#include "compat/w32pthreads.h"
-#endif
-
-#include "avcodec.h"
-#include "internal.h"
-#include "pthread_internal.h"
-#include "thread.h"
-
-#include "libavutil/common.h"
-#include "libavutil/cpu.h"
-#include "libavutil/mem.h"
-
-typedef int (action_func)(AVCodecContext *c, void *arg);
-typedef int (action_func2)(AVCodecContext *c, void *arg, int jobnr, int threadnr);
-
-typedef struct SliceThreadContext {
-    pthread_t *workers;
-    action_func *func;
-    action_func2 *func2;
-    void *args;
-    int *rets;
-    int rets_count;
-    int job_count;
-    int job_size;
-
-    pthread_cond_t last_job_cond;
-    pthread_cond_t current_job_cond;
-    pthread_mutex_t current_job_lock;
-    unsigned current_execute;
-    int current_job;
-    int done;
-} SliceThreadContext;
-
-static void* attribute_align_arg worker(void *v)
-{
-    AVCodecContext *avctx = v;
-    SliceThreadContext *c = avctx->internal->thread_ctx;
-    unsigned last_execute = 0;
-    int our_job = c->job_count;
-    int thread_count = avctx->thread_count;
-    int self_id;
-
-    pthread_mutex_lock(&c->current_job_lock);
-    self_id = c->current_job++;
-    for (;;){
-        while (our_job >= c->job_count) {
-            if (c->current_job == thread_count + c->job_count)
-                pthread_cond_signal(&c->last_job_cond);
-
-            while (last_execute == c->current_execute && !c->done)
-                pthread_cond_wait(&c->current_job_cond, &c->current_job_lock);
-            last_execute = c->current_execute;
-            our_job = self_id;
-
-            if (c->done) {
-                pthread_mutex_unlock(&c->current_job_lock);
-                return NULL;
-            }
-        }
-        pthread_mutex_unlock(&c->current_job_lock);
-
-        c->rets[our_job%c->rets_count] = c->func ? c->func(avctx, (char*)c->args + our_job*c->job_size):
-                                                   c->func2(avctx, c->args, our_job, self_id);
-
-        pthread_mutex_lock(&c->current_job_lock);
-        our_job = c->current_job++;
-    }
-}
-
-void ff_slice_thread_free(AVCodecContext *avctx)
-{
-    SliceThreadContext *c = avctx->internal->thread_ctx;
-    int i;
-
-    pthread_mutex_lock(&c->current_job_lock);
-    c->done = 1;
-    pthread_cond_broadcast(&c->current_job_cond);
-    pthread_mutex_unlock(&c->current_job_lock);
-
-    for (i=0; i<avctx->thread_count; i++)
-         pthread_join(c->workers[i], NULL);
-
-    pthread_mutex_destroy(&c->current_job_lock);
-    pthread_cond_destroy(&c->current_job_cond);
-    pthread_cond_destroy(&c->last_job_cond);
-    av_free(c->workers);
-    av_freep(&avctx->internal->thread_ctx);
-}
-
-static av_always_inline void thread_park_workers(SliceThreadContext *c, int thread_count)
-{
-    while (c->current_job != thread_count + c->job_count)
-        pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);
-    pthread_mutex_unlock(&c->current_job_lock);
-}
-
-static int thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size)
-{
-    SliceThreadContext *c = avctx->internal->thread_ctx;
-    int dummy_ret;
-
-    if (!(avctx->active_thread_type&FF_THREAD_SLICE) || avctx->thread_count <= 1)
-        return avcodec_default_execute(avctx, func, arg, ret, job_count, job_size);
-
-    if (job_count <= 0)
-        return 0;
-
-    pthread_mutex_lock(&c->current_job_lock);
-
-    c->current_job = avctx->thread_count;
-    c->job_count = job_count;
-    c->job_size = job_size;
-    c->args = arg;
-    c->func = func;
-    if (ret) {
-        c->rets = ret;
-        c->rets_count = job_count;
-    } else {
-        c->rets = &dummy_ret;
-        c->rets_count = 1;
-    }
-    c->current_execute++;
-    pthread_cond_broadcast(&c->current_job_cond);
-
-    thread_park_workers(c, avctx->thread_count);
-
-    return 0;
-}
-
-static int thread_execute2(AVCodecContext *avctx, action_func2* func2, void *arg, int *ret, int job_count)
-{
-    SliceThreadContext *c = avctx->internal->thread_ctx;
-    c->func2 = func2;
-    return thread_execute(avctx, NULL, arg, ret, job_count, 0);
-}
-
-int ff_slice_thread_init(AVCodecContext *avctx)
-{
-    int i;
-    SliceThreadContext *c;
-    int thread_count = avctx->thread_count;
-
-#if HAVE_W32THREADS
-    w32thread_init();
-#endif
-
-    if (!thread_count) {
-        int nb_cpus = av_cpu_count();
-        av_log(avctx, AV_LOG_DEBUG, "detected %d logical cores\n", nb_cpus);
-        // use number of cores + 1 as thread count if there is more than one
-        if (nb_cpus > 1)
-            thread_count = avctx->thread_count = FFMIN(nb_cpus + 1, MAX_AUTO_THREADS);
-        else
-            thread_count = avctx->thread_count = 1;
-    }
-
-    if (thread_count <= 1) {
-        avctx->active_thread_type = 0;
-        return 0;
-    }
-
-    c = av_mallocz(sizeof(SliceThreadContext));
-    if (!c)
-        return -1;
-
-    c->workers = av_mallocz(sizeof(pthread_t)*thread_count);
-    if (!c->workers) {
-        av_free(c);
-        return -1;
-    }
-
-    avctx->internal->thread_ctx = c;
-    c->current_job = 0;
-    c->job_count = 0;
-    c->job_size = 0;
-    c->done = 0;
-    pthread_cond_init(&c->current_job_cond, NULL);
-    pthread_cond_init(&c->last_job_cond, NULL);
-    pthread_mutex_init(&c->current_job_lock, NULL);
-    pthread_mutex_lock(&c->current_job_lock);
-    for (i=0; i<thread_count; i++) {
-        if(pthread_create(&c->workers[i], NULL, worker, avctx)) {
-           avctx->thread_count = i;
-           pthread_mutex_unlock(&c->current_job_lock);
-           ff_thread_free(avctx);
-           return -1;
-        }
-    }
-
-    thread_park_workers(c, thread_count);
-
-    avctx->execute = thread_execute;
-    avctx->execute2 = thread_execute2;
-    return 0;
-}
diff --git a/deps/libav/libavcodec/ptx.c b/deps/libav/libavcodec/ptx.c
deleted file mode 100644
index 76fff26..0000000
--- a/deps/libav/libavcodec/ptx.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * V.Flash PTX (.ptx) image decoder
- * Copyright (c) 2007 Ivo van Poorten
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-
-static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                            AVPacket *avpkt) {
-    const uint8_t *buf = avpkt->data;
-    const uint8_t *buf_end = avpkt->data + avpkt->size;
-    AVFrame * const p = data;
-    unsigned int offset, w, h, y, stride, bytes_per_pixel;
-    int ret;
-    uint8_t *ptr;
-
-    if (buf_end - buf < 14)
-        return AVERROR_INVALIDDATA;
-    offset          = AV_RL16(buf);
-    w               = AV_RL16(buf+8);
-    h               = AV_RL16(buf+10);
-    bytes_per_pixel = AV_RL16(buf+12) >> 3;
-
-    if (bytes_per_pixel != 2) {
-        avpriv_request_sample(avctx, "Image format not RGB15");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_RGB555;
-
-    if (buf_end - buf < offset)
-        return AVERROR_INVALIDDATA;
-    if (offset != 0x2c)
-        avpriv_request_sample(avctx, "offset != 0x2c");
-
-    buf += offset;
-
-    if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    p->pict_type = AV_PICTURE_TYPE_I;
-
-    ptr    = p->data[0];
-    stride = p->linesize[0];
-
-    for (y = 0; y < h && buf_end - buf >= w * bytes_per_pixel; y++) {
-#if HAVE_BIGENDIAN
-        unsigned int x;
-        for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel)
-            AV_WN16(ptr+x, AV_RL16(buf+x));
-#else
-        memcpy(ptr, buf, w*bytes_per_pixel);
-#endif
-        ptr += stride;
-        buf += w*bytes_per_pixel;
-    }
-
-    *got_frame = 1;
-
-    if (y < h) {
-        av_log(avctx, AV_LOG_WARNING, "incomplete packet\n");
-        return avpkt->size;
-    }
-
-    return offset + w*h*bytes_per_pixel;
-}
-
-AVCodec ff_ptx_decoder = {
-    .name           = "ptx",
-    .long_name      = NULL_IF_CONFIG_SMALL("V.Flash PTX image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_PTX,
-    .decode         = ptx_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/put_bits.h b/deps/libav/libavcodec/put_bits.h
deleted file mode 100644
index e3412cb..0000000
--- a/deps/libav/libavcodec/put_bits.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * copyright (c) 2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * bitstream writer API
- */
-
-#ifndef AVCODEC_PUT_BITS_H
-#define AVCODEC_PUT_BITS_H
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#include "libavutil/bswap.h"
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/log.h"
-#include "mathops.h"
-#include "config.h"
-
-typedef struct PutBitContext {
-    uint32_t bit_buf;
-    int bit_left;
-    uint8_t *buf, *buf_ptr, *buf_end;
-    int size_in_bits;
-} PutBitContext;
-
-/**
- * Initialize the PutBitContext s.
- *
- * @param buffer the buffer where to put bits
- * @param buffer_size the size in bytes of buffer
- */
-static inline void init_put_bits(PutBitContext *s, uint8_t *buffer,
-                                 int buffer_size)
-{
-    if (buffer_size < 0) {
-        buffer_size = 0;
-        buffer      = NULL;
-    }
-
-    s->size_in_bits = 8 * buffer_size;
-    s->buf          = buffer;
-    s->buf_end      = s->buf + buffer_size;
-    s->buf_ptr      = s->buf;
-    s->bit_left     = 32;
-    s->bit_buf      = 0;
-}
-
-/**
- * @return the total number of bits written to the bitstream.
- */
-static inline int put_bits_count(PutBitContext *s)
-{
-    return (s->buf_ptr - s->buf) * 8 + 32 - s->bit_left;
-}
-
-/**
- * @return the number of bits available in the bitstream.
- */
-static inline int put_bits_left(PutBitContext* s)
-{
-    return (s->buf_end - s->buf_ptr) * 8 - 32 + s->bit_left;
-}
-
-/**
- * Pad the end of the output stream with zeros.
- */
-static inline void flush_put_bits(PutBitContext *s)
-{
-#ifndef BITSTREAM_WRITER_LE
-    if (s->bit_left < 32)
-        s->bit_buf <<= s->bit_left;
-#endif
-    while (s->bit_left < 32) {
-        /* XXX: should test end of buffer */
-#ifdef BITSTREAM_WRITER_LE
-        *s->buf_ptr++ = s->bit_buf;
-        s->bit_buf  >>= 8;
-#else
-        *s->buf_ptr++ = s->bit_buf >> 24;
-        s->bit_buf  <<= 8;
-#endif
-        s->bit_left  += 8;
-    }
-    s->bit_left = 32;
-    s->bit_buf  = 0;
-}
-
-#ifdef BITSTREAM_WRITER_LE
-#define avpriv_align_put_bits align_put_bits_unsupported_here
-#define avpriv_put_string ff_put_string_unsupported_here
-#define avpriv_copy_bits avpriv_copy_bits_unsupported_here
-#else
-/**
- * Pad the bitstream with zeros up to the next byte boundary.
- */
-void avpriv_align_put_bits(PutBitContext *s);
-
-/**
- * Put the string string in the bitstream.
- *
- * @param terminate_string 0-terminates the written string if value is 1
- */
-void avpriv_put_string(PutBitContext *pb, const char *string,
-                       int terminate_string);
-
-/**
- * Copy the content of src to the bitstream.
- *
- * @param length the number of bits of src to copy
- */
-void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
-#endif
-
-/**
- * Write up to 31 bits into a bitstream.
- * Use put_bits32 to write 32 bits.
- */
-static inline void put_bits(PutBitContext *s, int n, unsigned int value)
-{
-    unsigned int bit_buf;
-    int bit_left;
-
-    assert(n <= 31 && value < (1U << n));
-
-    bit_buf  = s->bit_buf;
-    bit_left = s->bit_left;
-
-    /* XXX: optimize */
-#ifdef BITSTREAM_WRITER_LE
-    bit_buf |= value << (32 - bit_left);
-    if (n >= bit_left) {
-        AV_WL32(s->buf_ptr, bit_buf);
-        s->buf_ptr += 4;
-        bit_buf     = (bit_left == 32) ? 0 : value >> bit_left;
-        bit_left   += 32;
-    }
-    bit_left -= n;
-#else
-    if (n < bit_left) {
-        bit_buf     = (bit_buf << n) | value;
-        bit_left   -= n;
-    } else {
-        bit_buf   <<= bit_left;
-        bit_buf    |= value >> (n - bit_left);
-        AV_WB32(s->buf_ptr, bit_buf);
-        s->buf_ptr += 4;
-        bit_left   += 32 - n;
-        bit_buf     = value;
-    }
-#endif
-
-    s->bit_buf  = bit_buf;
-    s->bit_left = bit_left;
-}
-
-static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
-{
-    assert(n >= 0 && n <= 31);
-
-    put_bits(pb, n, value & ((1 << n) - 1));
-}
-
-/**
- * Write exactly 32 bits into a bitstream.
- */
-static void av_unused put_bits32(PutBitContext *s, uint32_t value)
-{
-    int lo = value & 0xffff;
-    int hi = value >> 16;
-#ifdef BITSTREAM_WRITER_LE
-    put_bits(s, 16, lo);
-    put_bits(s, 16, hi);
-#else
-    put_bits(s, 16, hi);
-    put_bits(s, 16, lo);
-#endif
-}
-
-/**
- * Return the pointer to the byte where the bitstream writer will put
- * the next bit.
- */
-static inline uint8_t *put_bits_ptr(PutBitContext *s)
-{
-    return s->buf_ptr;
-}
-
-/**
- * Skip the given number of bytes.
- * PutBitContext must be flushed & aligned to a byte boundary before calling this.
- */
-static inline void skip_put_bytes(PutBitContext *s, int n)
-{
-    assert((put_bits_count(s) & 7) == 0);
-    assert(s->bit_left == 32);
-    s->buf_ptr += n;
-}
-
-/**
- * Skip the given number of bits.
- * Must only be used if the actual values in the bitstream do not matter.
- * If n is 0 the behavior is undefined.
- */
-static inline void skip_put_bits(PutBitContext *s, int n)
-{
-    s->bit_left -= n;
-    s->buf_ptr  -= 4 * (s->bit_left >> 5);
-    s->bit_left &= 31;
-}
-
-/**
- * Change the end of the buffer.
- *
- * @param size the new size in bytes of the buffer where to put bits
- */
-static inline void set_put_bits_buffer_size(PutBitContext *s, int size)
-{
-    s->buf_end = s->buf + size;
-}
-
-#endif /* AVCODEC_PUT_BITS_H */
diff --git a/deps/libav/libavcodec/qcelpdata.h b/deps/libav/libavcodec/qcelpdata.h
deleted file mode 100644
index 319833e..0000000
--- a/deps/libav/libavcodec/qcelpdata.h
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- * QCELP decoder
- * Copyright (c) 2007 Reynaldo H. Verdejo Pinochet
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_QCELPDATA_H
-#define AVCODEC_QCELPDATA_H
-
-/**
- * @file
- * Data tables for the QCELP decoder
- * @author Reynaldo H. Verdejo Pinochet
- * @remark Libav merging spearheaded by Kenan Gillet
- * @remark Development mentored by Benjamin Larson
- */
-
-#include <stddef.h>
-#include <stdint.h>
-#include "libavutil/common.h"
-
-/**
- * QCELP unpacked data frame
- */
-typedef struct QCELPFrame {
-/// @name QCELP excitation codebook parameters
-/// @{
-    uint8_t cbsign[16]; ///< sign of the codebook gain for each codebook subframe
-    uint8_t cbgain[16]; ///< unsigned codebook gain for each codebook subframe
-    uint8_t cindex[16]; ///< codebook index for each codebook subframe
-/// @}
-
-/// @name QCELP pitch prediction parameters
-/// @{
-    uint8_t plag[4];    ///< pitch lag for each pitch subframe
-    uint8_t pfrac[4];   ///< fractional pitch lag for each pitch subframe
-    uint8_t pgain[4];   ///< pitch gain for each pitch subframe
-/// @}
-
-    /**
-     * line spectral pair frequencies (LSP) for RATE_OCTAVE,
-     * line spectral pair frequencies grouped into five vectors
-     * of dimension two (LSPV) for other rates
-     */
-    uint8_t lspv[10];
-
-    /**
-     * reserved bits only present in bitrate 1, 1/4 and 1/8 packets
-     */
-    uint8_t reserved;
-} QCELPFrame;
-
-/**
- * pre-calculated table for hammsinc function
- * Only half of the table is needed because of symmetry.
- *
- * TIA/EIA/IS-733 2.4.5.2-2/3
- */
-static const float qcelp_hammsinc_table[4] = { -0.006822,  0.041249, -0.143459,  0.588863};
-
-typedef struct QCELPBitmap {
-    uint8_t index;  /**< index into the QCELPContext structure */
-    uint8_t bitpos; /**< position of the lowest bit in the value's byte */
-    uint8_t bitlen; /**< number of bits to read */
-} QCELPBitmap;
-
-#define QCELP_OF(variable, bit, len) {offsetof(QCELPFrame, variable), bit, len}
-
-/**
- * bitmap unpacking tables for RATE_FULL
- *
- * TIA/EIA/IS-733 Table 2.4.7.1-1
- */
-static const QCELPBitmap qcelp_rate_full_bitmap[] = {
-                                // start on bit
-    QCELP_OF(lspv  [ 2], 0, 3), // 265
-    QCELP_OF(lspv  [ 1], 0, 7), // 262
-    QCELP_OF(lspv  [ 0], 0, 6), // 255
-    QCELP_OF(lspv  [ 4], 0, 6), // 249
-    QCELP_OF(lspv  [ 3], 0, 6), // 243
-    QCELP_OF(lspv  [ 2], 3, 4), // 237
-    QCELP_OF(cbsign[ 0], 0, 1), // 233
-    QCELP_OF(cbgain[ 0], 0, 4), // 232
-    QCELP_OF(pfrac [ 0], 0, 1), // 228
-    QCELP_OF(plag  [ 0], 0, 7), // 227
-    QCELP_OF(pgain [ 0], 0, 3), // 220
-    QCELP_OF(cindex[ 1], 0, 4), // 217
-    QCELP_OF(cbsign[ 1], 0, 1), // 213
-    QCELP_OF(cbgain[ 1], 0, 4), // 212
-    QCELP_OF(cindex[ 0], 0, 7), // 208
-    QCELP_OF(cbgain[ 3], 0, 1), // 201
-    QCELP_OF(cindex[ 2], 0, 7), // 200
-    QCELP_OF(cbsign[ 2], 0, 1), // 193
-    QCELP_OF(cbgain[ 2], 0, 4), // 192
-    QCELP_OF(cindex[ 1], 4, 3), // 188
-    QCELP_OF(plag  [ 1], 0, 3), // 185
-    QCELP_OF(pgain [ 1], 0, 3), // 182
-    QCELP_OF(cindex[ 3], 0, 7), // 179
-    QCELP_OF(cbsign[ 3], 0, 1), // 172
-    QCELP_OF(cbgain[ 3], 1, 2), // 171
-    QCELP_OF(cindex[ 4], 0, 6), // 169
-    QCELP_OF(cbsign[ 4], 0, 1), // 163
-    QCELP_OF(cbgain[ 4], 0, 4), // 162
-    QCELP_OF(pfrac [ 1], 0, 1), // 158
-    QCELP_OF(plag  [ 1], 3, 4), // 157
-    QCELP_OF(cbgain[ 6], 0, 3), // 153
-    QCELP_OF(cindex[ 5], 0, 7), // 150
-    QCELP_OF(cbsign[ 5], 0, 1), // 143
-    QCELP_OF(cbgain[ 5], 0, 4), // 142
-    QCELP_OF(cindex[ 4], 6, 1), // 138
-    QCELP_OF(cindex[ 7], 0, 3), // 137
-    QCELP_OF(cbsign[ 7], 0, 1), // 134
-    QCELP_OF(cbgain[ 7], 0, 3), // 133
-    QCELP_OF(cindex[ 6], 0, 7), // 130
-    QCELP_OF(cbsign[ 6], 0, 1), // 123
-    QCELP_OF(cbgain[ 6], 3, 1), // 122
-    QCELP_OF(cbgain[ 8], 0, 1), // 121
-    QCELP_OF(pfrac [ 2], 0, 1), // 120
-    QCELP_OF(plag  [ 2], 0, 7), // 119
-    QCELP_OF(pgain [ 2], 0, 3), // 112
-    QCELP_OF(cindex[ 7], 3, 4), // 109
-    QCELP_OF(cbsign[ 9], 0, 1), // 105
-    QCELP_OF(cbgain[ 9], 0, 4), // 104
-    QCELP_OF(cindex[ 8], 0, 7), // 100
-    QCELP_OF(cbsign[ 8], 0, 1), //  93
-    QCELP_OF(cbgain[ 8], 1, 3), //  92
-    QCELP_OF(cindex[10], 0, 4), //  89
-    QCELP_OF(cbsign[10], 0, 1), //  85
-    QCELP_OF(cbgain[10], 0, 4), //  84
-    QCELP_OF(cindex[ 9], 0, 7), //  80
-    QCELP_OF(pgain [ 3], 0, 2), //  73
-    QCELP_OF(cindex[11], 0, 7), //  71
-    QCELP_OF(cbsign[11], 0, 1), //  64
-    QCELP_OF(cbgain[11], 0, 3), //  63
-    QCELP_OF(cindex[10], 4, 3), //  60
-    QCELP_OF(cindex[12], 0, 2), //  57
-    QCELP_OF(cbsign[12], 0, 1), //  55
-    QCELP_OF(cbgain[12], 0, 4), //  54
-    QCELP_OF(pfrac [ 3], 0, 1), //  50
-    QCELP_OF(plag  [ 3], 0, 7), //  49
-    QCELP_OF(pgain [ 3], 2, 1), //  42
-    QCELP_OF(cindex[13], 0, 6), //  41
-    QCELP_OF(cbsign[13], 0, 1), //  35
-    QCELP_OF(cbgain[13], 0, 4), //  34
-    QCELP_OF(cindex[12], 2, 5), //  30
-    QCELP_OF(cbgain[15], 0, 3), //  25
-    QCELP_OF(cindex[14], 0, 7), //  22
-    QCELP_OF(cbsign[14], 0, 1), //  15
-    QCELP_OF(cbgain[14], 0, 4), //  14
-    QCELP_OF(cindex[13], 6, 1), //  10
-    QCELP_OF(reserved,   0, 2), //   9
-    QCELP_OF(cindex[15], 0, 7), //   7
-    QCELP_OF(cbsign[15], 0, 1)  //   0
-};
-
-/**
- * bitmap unpacking tables for RATE_HALF
- *
- * TIA/EIA/IS-733 Table 2.4.7.2-1
- */
-static const QCELPBitmap qcelp_rate_half_bitmap[] = {
-                               // start on bit
-    QCELP_OF(lspv  [2], 0, 3), // 123
-    QCELP_OF(lspv  [1], 0, 7), // 120
-    QCELP_OF(lspv  [0], 0, 6), // 113
-    QCELP_OF(lspv  [4], 0, 6), // 107
-    QCELP_OF(lspv  [3], 0, 6), // 101
-    QCELP_OF(lspv  [2], 3, 4), //  95
-    QCELP_OF(cbsign[0], 0, 1), //  91
-    QCELP_OF(cbgain[0], 0, 4), //  90
-    QCELP_OF(pfrac [0], 0, 1), //  86
-    QCELP_OF(plag  [0], 0, 7), //  85
-    QCELP_OF(pgain [0], 0, 3), //  78
-    QCELP_OF(plag  [1], 0, 6), //  75
-    QCELP_OF(pgain [1], 0, 3), //  69
-    QCELP_OF(cindex[0], 0, 7), //  66
-    QCELP_OF(pgain [2], 0, 2), //  59
-    QCELP_OF(cindex[1], 0, 7), //  57
-    QCELP_OF(cbsign[1], 0, 1), //  50
-    QCELP_OF(cbgain[1], 0, 4), //  49
-    QCELP_OF(pfrac [1], 0, 1), //  45
-    QCELP_OF(plag  [1], 6, 1), //  44
-    QCELP_OF(cindex[2], 0, 2), //  43
-    QCELP_OF(cbsign[2], 0, 1), //  41
-    QCELP_OF(cbgain[2], 0, 4), //  40
-    QCELP_OF(pfrac [2], 0, 1), //  36
-    QCELP_OF(plag  [2], 0, 7), //  35
-    QCELP_OF(pgain [2], 2, 1), //  28
-    QCELP_OF(pfrac [3], 0, 1), //  27
-    QCELP_OF(plag  [3], 0, 7), //  26
-    QCELP_OF(pgain [3], 0, 3), //  19
-    QCELP_OF(cindex[2], 2, 5), //  16
-    QCELP_OF(cindex[3], 0, 7), //  11
-    QCELP_OF(cbsign[3], 0, 1), //   4
-    QCELP_OF(cbgain[3], 0, 4)  //   3
-};
-
-/**
- * bitmap unpacking tables for RATE_QUARTER
- *
- * TIA/EIA/IS-733 Table 2.4.7.3-1
- */
-static const QCELPBitmap qcelp_rate_quarter_bitmap[] = {
-                               // start on bit
-    QCELP_OF(lspv  [2], 0, 3), // 53
-    QCELP_OF(lspv  [1], 0, 7), // 50
-    QCELP_OF(lspv  [0], 0, 6), // 43
-    QCELP_OF(lspv  [4], 0, 6), // 37
-    QCELP_OF(lspv  [3], 0, 6), // 31
-    QCELP_OF(lspv  [2], 3, 4), // 25
-    QCELP_OF(cbgain[3], 0, 4), // 21
-    QCELP_OF(cbgain[2], 0, 4), // 17
-    QCELP_OF(cbgain[1], 0, 4), // 13
-    QCELP_OF(cbgain[0], 0, 4), //  9
-    QCELP_OF(reserved,  0, 2), //  5
-    QCELP_OF(cbgain[4], 0, 4)  //  3
-};
-
-/**
- * bitmap unpacking tables for RATE_OCTAVE
- *
- * trick: CBSEED is written into QCELPContext.cbsign[15],
- * which is not used for RATE_OCTAVE.
- * CBSEED is only used to ensure the occurrence of random bit
- * patterns in the 16 first bits that are used as the seed.
- *
- * TIA/EIA/IS-733 Table 2.4.7.4-1
- */
-static const QCELPBitmap qcelp_rate_octave_bitmap[] = {
-                                // start on bit
-    QCELP_OF(cbsign[15], 3, 1), // 19
-    QCELP_OF(lspv   [0], 0, 1), // 18
-    QCELP_OF(lspv   [1], 0, 1), // 17
-    QCELP_OF(lspv   [2], 0, 1), // 16
-    QCELP_OF(cbsign[15], 2, 1), // 15
-    QCELP_OF(lspv   [3], 0, 1), // 14
-    QCELP_OF(lspv   [4], 0, 1), // 13
-    QCELP_OF(lspv   [5], 0, 1), // 12
-    QCELP_OF(cbsign[15], 1, 1), // 11
-    QCELP_OF(lspv   [6], 0, 1), // 10
-    QCELP_OF(lspv   [7], 0, 1), //  9
-    QCELP_OF(lspv   [8], 0, 1), //  8
-    QCELP_OF(cbsign[15], 0, 1), //  7
-    QCELP_OF(lspv   [9], 0, 1), //  6
-    QCELP_OF(cbgain [0], 0, 2), //  7
-    QCELP_OF(reserved,   0, 4)  //  3
-};
-
-/**
- * position of the bitmapping data for each packet type in
- * the QCELPContext
- */
-static const QCELPBitmap * const qcelp_unpacking_bitmaps_per_rate[5] = {
-    NULL,                     ///< for SILENCE rate
-    qcelp_rate_octave_bitmap,
-    qcelp_rate_quarter_bitmap,
-    qcelp_rate_half_bitmap,
-    qcelp_rate_full_bitmap,
-};
-
-static const uint16_t qcelp_unpacking_bitmaps_lengths[5] = {
-    0, ///< for SILENCE rate
-    FF_ARRAY_ELEMS(qcelp_rate_octave_bitmap),
-    FF_ARRAY_ELEMS(qcelp_rate_quarter_bitmap),
-    FF_ARRAY_ELEMS(qcelp_rate_half_bitmap),
-    FF_ARRAY_ELEMS(qcelp_rate_full_bitmap),
-};
-
-typedef uint16_t qcelp_vector[2];
-
-/**
- * LSP vector quantization tables in x*10000 form
- *
- * TIA/EIA/IS-733 tables 2.4.3.2.6.3-1 through 2.4.3.2.6.3-5
- */
-
-static const qcelp_vector qcelp_lspvq1[64]= {
-{ 327, 118},{ 919, 111},{ 427, 440},{1327, 185},
-{ 469,  50},{1272,  91},{ 892,  59},{1771, 193},
-{ 222, 158},{1100, 127},{ 827,  55},{ 978, 791},
-{ 665,  47},{ 700,1401},{ 670, 859},{1913,1048},
-{ 471, 215},{1046, 125},{ 645, 298},{1599, 160},
-{ 593,  39},{1187, 462},{ 749, 341},{1520, 511},
-{ 290, 792},{ 909, 362},{ 753,  81},{1111,1058},
-{ 519, 253},{ 828, 839},{ 685, 541},{1421,1258},
-{ 386, 130},{ 962, 119},{ 542, 387},{1431, 185},
-{ 526,  51},{1175, 260},{ 831, 167},{1728, 510},
-{ 273, 437},{1172, 113},{ 771, 144},{1122, 751},
-{ 619, 119},{ 492,1276},{ 658, 695},{1882, 615},
-{ 415, 200},{1018,  88},{ 681, 339},{1436, 325},
-{ 555, 122},{1042, 485},{ 826, 345},{1374, 743},
-{ 383,1018},{1005, 358},{ 704,  86},{1301, 586},
-{ 597, 241},{ 832, 621},{ 555, 573},{1504, 839}};
-
-static const qcelp_vector qcelp_lspvq2[128]= {
-{ 255, 293},{ 904, 219},{ 151,1211},{1447, 498},
-{ 470, 253},{1559, 177},{1547, 994},{2394, 242},
-{  91, 813},{ 857, 590},{ 934,1326},{1889, 282},
-{ 813, 472},{1057,1494},{ 450,3315},{2163,1895},
-{ 538, 532},{1399, 218},{ 146,1552},{1755, 626},
-{ 822, 202},{1299, 663},{ 706,1732},{2656, 401},
-{ 418, 745},{ 762,1038},{ 583,1748},{1746,1285},
-{ 527,1169},{1314, 830},{ 556,2116},{1073,2321},
-{ 297, 570},{ 981, 403},{ 468,1103},{1740, 243},
-{ 725, 179},{1255, 474},{1374,1362},{1922, 912},
-{ 285, 947},{ 930, 700},{ 593,1372},{1909, 576},
-{ 588, 916},{1110,1116},{ 224,2719},{1633,2220},
-{ 402, 520},{1061, 448},{ 402,1352},{1499, 775},
-{ 664, 589},{1081, 727},{ 801,2206},{2165,1157},
-{ 566, 802},{ 911,1116},{ 306,1703},{1792, 836},
-{ 655, 999},{1061,1038},{ 298,2089},{1110,1753},
-{ 361, 311},{ 970, 239},{ 265,1231},{1495, 573},
-{ 566, 262},{1569, 293},{1341,1144},{2271, 544},
-{ 214, 877},{ 847, 719},{ 794,1384},{2067, 274},
-{ 703, 688},{1099,1306},{ 391,2947},{2024,1670},
-{ 471, 525},{1245, 290},{ 264,1557},{1568, 807},
-{ 718, 399},{1193, 685},{ 883,1594},{2729, 764},
-{ 500, 754},{ 809,1108},{ 541,1648},{1523,1385},
-{ 614,1196},{1209, 847},{ 345,2242},{1442,1747},
-{ 199, 560},{1092, 194},{ 349,1253},{1653, 507},
-{ 625, 354},{1376, 431},{1187,1465},{2164, 872},
-{ 360, 974},{1008, 698},{ 704,1346},{2114, 452},
-{ 720, 816},{1240,1089},{ 439,2475},{1498,2040},
-{ 336, 718},{1213, 187},{ 451,1450},{1368, 885},
-{ 592, 578},{1131, 531},{ 861,1855},{1764,1500},
-{ 444, 970},{ 935, 903},{ 424,1687},{1633,1102},
-{ 793, 897},{1060, 897},{ 185,2011},{1205,1855}};
-
-static const qcelp_vector qcelp_lspvq3[128]= {
-{ 225, 283},{1296, 355},{ 543, 343},{2073, 274},
-{ 204,1099},{1562, 523},{1388, 161},{2784, 274},
-{ 112, 849},{1870, 175},{1189, 160},{1490,1088},
-{ 969,1115},{ 659,3322},{1158,1073},{3183,1363},
-{ 517, 223},{1740, 223},{ 704, 387},{2637, 234},
-{ 692,1005},{1287,1610},{ 952, 532},{2393, 646},
-{ 490, 552},{1619, 657},{ 845, 670},{1784,2280},
-{ 191,1775},{ 272,2868},{ 942, 952},{2628,1479},
-{ 278, 579},{1565, 218},{ 814, 180},{2379, 187},
-{ 276,1444},{1199,1223},{1200, 349},{3009, 307},
-{ 312, 844},{1898, 306},{ 863, 470},{1685,1241},
-{ 513,1727},{ 711,2233},{1085, 864},{3398, 527},
-{ 414, 440},{1356, 612},{ 964, 147},{2173, 738},
-{ 465,1292},{ 877,1749},{1104, 689},{2105,1311},
-{ 580, 864},{1895, 752},{ 652, 609},{1485,1699},
-{ 514,1400},{ 386,2131},{ 933, 798},{2473, 986},
-{ 334, 360},{1375, 398},{ 621, 276},{2183, 280},
-{ 311,1114},{1382, 807},{1284, 175},{2605, 636},
-{ 230, 816},{1739, 408},{1074, 176},{1619,1120},
-{ 784,1371},{ 448,3050},{1189, 880},{3039,1165},
-{ 424, 241},{1672, 186},{ 815, 333},{2432, 324},
-{ 584,1029},{1137,1546},{1015, 585},{2198, 995},
-{ 574, 581},{1746, 647},{ 733, 740},{1938,1737},
-{ 347,1710},{ 373,2429},{ 787,1061},{2439,1438},
-{ 185, 536},{1489, 178},{ 703, 216},{2178, 487},
-{ 154,1421},{1414, 994},{1103, 352},{3072, 473},
-{ 408, 819},{2055, 168},{ 998, 354},{1917,1140},
-{ 665,1799},{ 993,2213},{1234, 631},{3003, 762},
-{ 373, 620},{1518, 425},{ 913, 300},{1966, 836},
-{ 402,1185},{ 948,1385},{1121, 555},{1802,1509},
-{ 474, 886},{1888, 610},{ 739, 585},{1231,2379},
-{ 661,1335},{ 205,2211},{ 823, 822},{2480,1179}};
-
-static const qcelp_vector qcelp_lspvq4[64]= {
-{ 348, 311},{ 812,1145},{ 552, 461},{1826, 263},
-{ 601, 675},{1730, 172},{1523, 193},{2449, 277},
-{ 334, 668},{ 805,1441},{1319, 207},{1684, 910},
-{ 582,1318},{1403,1098},{ 979, 832},{2700,1359},
-{ 624, 228},{1292, 979},{ 800, 195},{2226, 285},
-{ 730, 862},{1537, 601},{1115, 509},{2720, 354},
-{ 218,1167},{1212,1538},{1074, 247},{1674,1710},
-{ 322,2142},{1263, 777},{ 981, 556},{2119,1710},
-{ 193, 596},{1035, 957},{ 694, 397},{1997, 253},
-{ 743, 603},{1584, 321},{1346, 346},{2221, 708},
-{ 451, 732},{1040,1415},{1184, 230},{1853, 919},
-{ 310,1661},{1625, 706},{ 856, 843},{2902, 702},
-{ 467, 348},{1108,1048},{ 859, 306},{1964, 463},
-{ 560,1013},{1425, 533},{1142, 634},{2391, 879},
-{ 397,1084},{1345,1700},{ 976, 248},{1887,1189},
-{ 644,2087},{1262, 603},{ 877, 550},{2203,1307}};
-
-static const qcelp_vector qcelp_lspvq5[64]= {
-{ 360, 222},{ 820,1097},{ 601, 319},{1656, 198},
-{ 604, 513},{1552, 141},{1391, 155},{2474, 261},
-{ 269, 785},{1463, 646},{1123, 191},{2015, 223},
-{ 785, 844},{1202,1011},{ 980, 807},{3014, 793},
-{ 570, 180},{1135,1382},{ 778, 256},{1901, 179},
-{ 807, 622},{1461, 458},{1231, 178},{2028, 821},
-{ 387, 927},{1496,1004},{ 888, 392},{2246, 341},
-{ 295,1462},{1156, 694},{1022, 473},{2226,1364},
-{ 210, 478},{1029,1020},{ 722, 181},{1730, 251},
-{ 730, 488},{1465, 293},{1303, 326},{2595, 387},
-{ 458, 584},{1569, 742},{1029, 173},{1910, 495},
-{ 605,1159},{1268, 719},{ 973, 646},{2872, 428},
-{ 443, 334},{ 835,1465},{ 912, 138},{1716, 442},
-{ 620, 778},{1316, 450},{1186, 335},{1446,1665},
-{ 486,1050},{1675,1019},{ 880, 278},{2214, 202},
-{ 539,1564},{1142, 533},{ 984, 391},{2130,1089}};
-
-static const qcelp_vector * const qcelp_lspvq[5] = {
-    qcelp_lspvq1,
-    qcelp_lspvq2,
-    qcelp_lspvq3,
-    qcelp_lspvq4,
-    qcelp_lspvq5
-};
-
-/**
- * the final gain scalefactor before clipping into a usable output float
- */
-#define QCELP_SCALE 8192.
-
-/**
- * table for computing Ga (decoded linear codebook gain magnitude)
- *
- * @note The table could fit in int16_t in x*8 form, but it seems
- *       to be slower on x86
- *
- * TIA/EIA/IS-733 2.4.6.2.1-3
- */
-
-static const float qcelp_g12ga[61] = {
-    1.000/QCELP_SCALE,   1.125/QCELP_SCALE,   1.250/QCELP_SCALE,   1.375/QCELP_SCALE,
-    1.625/QCELP_SCALE,   1.750/QCELP_SCALE,   2.000/QCELP_SCALE,   2.250/QCELP_SCALE,
-    2.500/QCELP_SCALE,   2.875/QCELP_SCALE,   3.125/QCELP_SCALE,   3.500/QCELP_SCALE,
-    4.000/QCELP_SCALE,   4.500/QCELP_SCALE,   5.000/QCELP_SCALE,   5.625/QCELP_SCALE,
-    6.250/QCELP_SCALE,   7.125/QCELP_SCALE,   8.000/QCELP_SCALE,   8.875/QCELP_SCALE,
-   10.000/QCELP_SCALE,  11.250/QCELP_SCALE,  12.625/QCELP_SCALE,  14.125/QCELP_SCALE,
-   15.875/QCELP_SCALE,  17.750/QCELP_SCALE,  20.000/QCELP_SCALE,  22.375/QCELP_SCALE,
-   25.125/QCELP_SCALE,  28.125/QCELP_SCALE,  31.625/QCELP_SCALE,  35.500/QCELP_SCALE,
-   39.750/QCELP_SCALE,  44.625/QCELP_SCALE,  50.125/QCELP_SCALE,  56.250/QCELP_SCALE,
-   63.125/QCELP_SCALE,  70.750/QCELP_SCALE,  79.375/QCELP_SCALE,  89.125/QCELP_SCALE,
-  100.000/QCELP_SCALE, 112.250/QCELP_SCALE, 125.875/QCELP_SCALE, 141.250/QCELP_SCALE,
-  158.500/QCELP_SCALE, 177.875/QCELP_SCALE, 199.500/QCELP_SCALE, 223.875/QCELP_SCALE,
-  251.250/QCELP_SCALE, 281.875/QCELP_SCALE, 316.250/QCELP_SCALE, 354.875/QCELP_SCALE,
-  398.125/QCELP_SCALE, 446.625/QCELP_SCALE, 501.125/QCELP_SCALE, 562.375/QCELP_SCALE,
-  631.000/QCELP_SCALE, 708.000/QCELP_SCALE, 794.375/QCELP_SCALE, 891.250/QCELP_SCALE,
- 1000.000/QCELP_SCALE};
-
-/**
- * circular codebook for rate 1 frames in x*100 form
- *
- * TIA/EIA/IS-733 2.4.6.1-2
- */
-static const int16_t qcelp_rate_full_codebook[128] = {
-     10,  -65,  -59,   12,  110,   34, -134,  157,
-    104,  -84,  -34, -115,   23, -101,    3,   45,
-   -101,  -16,  -59,   28,  -45,  134,  -67,   22,
-     61,  -29,  226,  -26,  -55, -179,  157,  -51,
-   -220,  -93,  -37,   60,  118,   74,  -48,  -95,
-   -181,  111,   36,  -52, -215,   78, -112,   39,
-    -17,  -47, -223,   19,   12,  -98, -142,  130,
-     54, -127,   21,  -12,   39,  -48,   12,  128,
-      6, -167,   82, -102,  -79,   55,  -44,   48,
-    -20,  -53,    8,  -61,   11,  -70, -157, -168,
-     20,  -56,  -74,   78,   33,  -63, -173,   -2,
-    -75,  -53, -146,   77,   66,  -29,    9,  -75,
-     65,  119,  -43,   76,  233,   98,  125, -156,
-    -27,   78,   -9,  170,  176,  143, -148,   -7,
-     27, -136,    5,   27,   18,  139,  204,    7,
-   -184, -197,   52,   -3,   78, -189,    8,  -65
-};
-#define QCELP_RATE_FULL_CODEBOOK_RATIO .01
-
-/**
- * circular codebook for rate 1/2 frames in x*2 form
- *
- * TIA/EIA/IS-733 2.4.6.1-1
- */
-static const int8_t qcelp_rate_half_codebook[128] = {
-     0, -4,  0, -3,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,
-     0, -3, -2,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  5,
-     0,  0,  0,  0,  0,  0,  4,  0,
-     0,  3,  2,  0,  3,  4,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  3,  0,  0,
-    -3,  3,  0,  0, -2,  0,  3,  0,
-     0,  0,  0,  0,  0,  0, -5,  0,
-     0,  0,  0,  3,  0,  0,  0,  3,
-     0,  0,  0,  0,  0,  0,  0,  4,
-     0,  0,  0,  0,  0,  0,  0,  0,
-     0,  3,  6, -3, -4,  0, -3, -3,
-     3, -3,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0
-};
-#define QCELP_RATE_HALF_CODEBOOK_RATIO 0.5
-
-/**
- * sqrt(1.887) is the maximum of the pseudorandom
- * white sequence used to generate the scaled codebook
- * vector for bitrate 1/4.
- *
- * TIA/EIA/IS-733 2.4.8.1.2
- */
-#define QCELP_SQRT1887 1.373681186
-
-/**
- * table for impulse response of BPF used to filter
- * the white excitation for bitrate 1/4 synthesis
- *
- * Only half the tables are needed because of symmetry.
- *
- * TIA/EIA/IS-733 2.4.8.1.2-1.1
- */
-static const double qcelp_rnd_fir_coefs[11] = {
-  -1.344519e-1, 1.735384e-2, -6.905826e-2, 2.434368e-2,
-  -8.210701e-2, 3.041388e-2, -9.251384e-2, 3.501983e-2,
-  -9.918777e-2, 3.749518e-2,  8.985137e-1
-};
-
-/**
- * This spread factor is used, for bitrate 1/8 and I_F_Q,
- * to force the LSP frequencies to be at least 80 Hz apart.
- *
- * TIA/EIA/IS-733 2.4.3.3.2
- */
-#define QCELP_LSP_SPREAD_FACTOR 0.02
-
-/**
- * predictor coefficient for the conversion of LSP codes
- * to LSP frequencies for 1/8 and I_F_Q
- *
- * TIA/EIA/IS-733 2.4.3.2.7-2
- */
-#define QCELP_LSP_OCTAVE_PREDICTOR 29.0/32
-
-/**
- * initial coefficient to perform bandwidth expansion on LPC
- *
- * @note: 0.9883 looks like an approximation of 253/256.
- *
- * TIA/EIA/IS-733 2.4.3.3.6 6
- */
-#define QCELP_BANDWIDTH_EXPANSION_COEFF 0.9883
-
-#endif /* AVCODEC_QCELPDATA_H */
diff --git a/deps/libav/libavcodec/qcelpdec.c b/deps/libav/libavcodec/qcelpdec.c
deleted file mode 100644
index 7d9427c..0000000
--- a/deps/libav/libavcodec/qcelpdec.c
+++ /dev/null
@@ -1,799 +0,0 @@
-/*
- * QCELP decoder
- * Copyright (c) 2007 Reynaldo H. Verdejo Pinochet
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * QCELP decoder
- * @author Reynaldo H. Verdejo Pinochet
- * @remark Libav merging spearheaded by Kenan Gillet
- * @remark Development mentored by Benjamin Larson
- */
-
-#include <stddef.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "qcelpdata.h"
-#include "celp_filters.h"
-#include "acelp_filters.h"
-#include "acelp_vectors.h"
-#include "lsp.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-typedef enum {
-    I_F_Q = -1,    /**< insufficient frame quality */
-    SILENCE,
-    RATE_OCTAVE,
-    RATE_QUARTER,
-    RATE_HALF,
-    RATE_FULL
-} qcelp_packet_rate;
-
-typedef struct {
-    GetBitContext     gb;
-    qcelp_packet_rate bitrate;
-    QCELPFrame        frame;    /**< unpacked data frame */
-
-    uint8_t  erasure_count;
-    uint8_t  octave_count;      /**< count the consecutive RATE_OCTAVE frames */
-    float    prev_lspf[10];
-    float    predictor_lspf[10];/**< LSP predictor for RATE_OCTAVE and I_F_Q */
-    float    pitch_synthesis_filter_mem[303];
-    float    pitch_pre_filter_mem[303];
-    float    rnd_fir_filter_mem[180];
-    float    formant_mem[170];
-    float    last_codebook_gain;
-    int      prev_g1[2];
-    int      prev_bitrate;
-    float    pitch_gain[4];
-    uint8_t  pitch_lag[4];
-    uint16_t first16bits;
-    uint8_t  warned_buf_mismatch_bitrate;
-
-    /* postfilter */
-    float    postfilter_synth_mem[10];
-    float    postfilter_agc_mem;
-    float    postfilter_tilt_mem;
-} QCELPContext;
-
-/**
- * Initialize the speech codec according to the specification.
- *
- * TIA/EIA/IS-733 2.4.9
- */
-static av_cold int qcelp_decode_init(AVCodecContext *avctx)
-{
-    QCELPContext *q = avctx->priv_data;
-    int i;
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_FLT;
-
-    for (i = 0; i < 10; i++)
-        q->prev_lspf[i] = (i + 1) / 11.0;
-
-    return 0;
-}
-
-/**
- * Decode the 10 quantized LSP frequencies from the LSPV/LSP
- * transmission codes of any bitrate and check for badly received packets.
- *
- * @param q the context
- * @param lspf line spectral pair frequencies
- *
- * @return 0 on success, -1 if the packet is badly received
- *
- * TIA/EIA/IS-733 2.4.3.2.6.2-2, 2.4.8.7.3
- */
-static int decode_lspf(QCELPContext *q, float *lspf)
-{
-    int i;
-    float tmp_lspf, smooth, erasure_coeff;
-    const float *predictors;
-
-    if (q->bitrate == RATE_OCTAVE || q->bitrate == I_F_Q) {
-        predictors = q->prev_bitrate != RATE_OCTAVE &&
-                     q->prev_bitrate != I_F_Q ? q->prev_lspf
-                                              : q->predictor_lspf;
-
-        if (q->bitrate == RATE_OCTAVE) {
-            q->octave_count++;
-
-            for (i = 0; i < 10; i++) {
-                q->predictor_lspf[i] =
-                             lspf[i] = (q->frame.lspv[i] ?  QCELP_LSP_SPREAD_FACTOR
-                                                         : -QCELP_LSP_SPREAD_FACTOR) +
-                                        predictors[i] * QCELP_LSP_OCTAVE_PREDICTOR   +
-                                        (i + 1) * ((1 - QCELP_LSP_OCTAVE_PREDICTOR) / 11);
-            }
-            smooth = q->octave_count < 10 ? .875 : 0.1;
-        } else {
-            erasure_coeff = QCELP_LSP_OCTAVE_PREDICTOR;
-
-            assert(q->bitrate == I_F_Q);
-
-            if (q->erasure_count > 1)
-                erasure_coeff *= q->erasure_count < 4 ? 0.9 : 0.7;
-
-            for (i = 0; i < 10; i++) {
-                q->predictor_lspf[i] =
-                             lspf[i] = (i + 1) * (1 - erasure_coeff) / 11 +
-                                       erasure_coeff * predictors[i];
-            }
-            smooth = 0.125;
-        }
-
-        // Check the stability of the LSP frequencies.
-        lspf[0] = FFMAX(lspf[0], QCELP_LSP_SPREAD_FACTOR);
-        for (i = 1; i < 10; i++)
-            lspf[i] = FFMAX(lspf[i], lspf[i - 1] + QCELP_LSP_SPREAD_FACTOR);
-
-        lspf[9] = FFMIN(lspf[9], 1.0 - QCELP_LSP_SPREAD_FACTOR);
-        for (i = 9; i > 0; i--)
-            lspf[i - 1] = FFMIN(lspf[i - 1], lspf[i] - QCELP_LSP_SPREAD_FACTOR);
-
-        // Low-pass filter the LSP frequencies.
-        ff_weighted_vector_sumf(lspf, lspf, q->prev_lspf, smooth, 1.0 - smooth, 10);
-    } else {
-        q->octave_count = 0;
-
-        tmp_lspf = 0.0;
-        for (i = 0; i < 5; i++) {
-            lspf[2 * i + 0] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][0] * 0.0001;
-            lspf[2 * i + 1] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][1] * 0.0001;
-        }
-
-        // Check for badly received packets.
-        if (q->bitrate == RATE_QUARTER) {
-            if (lspf[9] <= .70 || lspf[9] >= .97)
-                return -1;
-            for (i = 3; i < 10; i++)
-                if (fabs(lspf[i] - lspf[i - 2]) < .08)
-                    return -1;
-        } else {
-            if (lspf[9] <= .66 || lspf[9] >= .985)
-                return -1;
-            for (i = 4; i < 10; i++)
-                if (fabs(lspf[i] - lspf[i - 4]) < .0931)
-                    return -1;
-        }
-    }
-    return 0;
-}
-
-/**
- * Convert codebook transmission codes to GAIN and INDEX.
- *
- * @param q the context
- * @param gain array holding the decoded gain
- *
- * TIA/EIA/IS-733 2.4.6.2
- */
-static void decode_gain_and_index(QCELPContext *q, float *gain)
-{
-    int i, subframes_count, g1[16];
-    float slope;
-
-    if (q->bitrate >= RATE_QUARTER) {
-        switch (q->bitrate) {
-        case RATE_FULL: subframes_count = 16; break;
-        case RATE_HALF: subframes_count =  4; break;
-        default:        subframes_count =  5;
-        }
-        for (i = 0; i < subframes_count; i++) {
-            g1[i] = 4 * q->frame.cbgain[i];
-            if (q->bitrate == RATE_FULL && !((i + 1) & 3)) {
-                g1[i] += av_clip((g1[i - 1] + g1[i - 2] + g1[i - 3]) / 3 - 6, 0, 32);
-            }
-
-            gain[i] = qcelp_g12ga[g1[i]];
-
-            if (q->frame.cbsign[i]) {
-                gain[i] = -gain[i];
-                q->frame.cindex[i] = (q->frame.cindex[i] - 89) & 127;
-            }
-        }
-
-        q->prev_g1[0]         = g1[i - 2];
-        q->prev_g1[1]         = g1[i - 1];
-        q->last_codebook_gain = qcelp_g12ga[g1[i - 1]];
-
-        if (q->bitrate == RATE_QUARTER) {
-            // Provide smoothing of the unvoiced excitation energy.
-            gain[7] =       gain[4];
-            gain[6] = 0.4 * gain[3] + 0.6 * gain[4];
-            gain[5] =       gain[3];
-            gain[4] = 0.8 * gain[2] + 0.2 * gain[3];
-            gain[3] = 0.2 * gain[1] + 0.8 * gain[2];
-            gain[2] =       gain[1];
-            gain[1] = 0.6 * gain[0] + 0.4 * gain[1];
-        }
-    } else if (q->bitrate != SILENCE) {
-        if (q->bitrate == RATE_OCTAVE) {
-            g1[0] = 2 * q->frame.cbgain[0] +
-                    av_clip((q->prev_g1[0] + q->prev_g1[1]) / 2 - 5, 0, 54);
-            subframes_count = 8;
-        } else {
-            assert(q->bitrate == I_F_Q);
-
-            g1[0] = q->prev_g1[1];
-            switch (q->erasure_count) {
-            case 1 : break;
-            case 2 : g1[0] -= 1; break;
-            case 3 : g1[0] -= 2; break;
-            default: g1[0] -= 6;
-            }
-            if (g1[0] < 0)
-                g1[0] = 0;
-            subframes_count = 4;
-        }
-        // This interpolation is done to produce smoother background noise.
-        slope = 0.5 * (qcelp_g12ga[g1[0]] - q->last_codebook_gain) / subframes_count;
-        for (i = 1; i <= subframes_count; i++)
-                gain[i - 1] = q->last_codebook_gain + slope * i;
-
-        q->last_codebook_gain = gain[i - 2];
-        q->prev_g1[0]         = q->prev_g1[1];
-        q->prev_g1[1]         = g1[0];
-    }
-}
-
-/**
- * If the received packet is Rate 1/4 a further sanity check is made of the
- * codebook gain.
- *
- * @param cbgain the unpacked cbgain array
- * @return -1 if the sanity check fails, 0 otherwise
- *
- * TIA/EIA/IS-733 2.4.8.7.3
- */
-static int codebook_sanity_check_for_rate_quarter(const uint8_t *cbgain)
-{
-    int i, diff, prev_diff = 0;
-
-    for (i = 1; i < 5; i++) {
-        diff = cbgain[i] - cbgain[i-1];
-        if (FFABS(diff) > 10)
-            return -1;
-        else if (FFABS(diff - prev_diff) > 12)
-            return -1;
-        prev_diff = diff;
-    }
-    return 0;
-}
-
-/**
- * Compute the scaled codebook vector Cdn From INDEX and GAIN
- * for all rates.
- *
- * The specification lacks some information here.
- *
- * TIA/EIA/IS-733 has an omission on the codebook index determination
- * formula for RATE_FULL and RATE_HALF frames at section 2.4.8.1.1. It says
- * you have to subtract the decoded index parameter from the given scaled
- * codebook vector index 'n' to get the desired circular codebook index, but
- * it does not mention that you have to clamp 'n' to [0-9] in order to get
- * RI-compliant results.
- *
- * The reason for this mistake seems to be the fact they forgot to mention you
- * have to do these calculations per codebook subframe and adjust given
- * equation values accordingly.
- *
- * @param q the context
- * @param gain array holding the 4 pitch subframe gain values
- * @param cdn_vector array for the generated scaled codebook vector
- */
-static void compute_svector(QCELPContext *q, const float *gain,
-                            float *cdn_vector)
-{
-    int i, j, k;
-    uint16_t cbseed, cindex;
-    float *rnd, tmp_gain, fir_filter_value;
-
-    switch (q->bitrate) {
-    case RATE_FULL:
-        for (i = 0; i < 16; i++) {
-            tmp_gain = gain[i] * QCELP_RATE_FULL_CODEBOOK_RATIO;
-            cindex   = -q->frame.cindex[i];
-            for (j = 0; j < 10; j++)
-                *cdn_vector++ = tmp_gain * qcelp_rate_full_codebook[cindex++ & 127];
-        }
-        break;
-    case RATE_HALF:
-        for (i = 0; i < 4; i++) {
-            tmp_gain = gain[i] * QCELP_RATE_HALF_CODEBOOK_RATIO;
-            cindex   = -q->frame.cindex[i];
-            for (j = 0; j < 40; j++)
-                *cdn_vector++ = tmp_gain * qcelp_rate_half_codebook[cindex++ & 127];
-        }
-        break;
-    case RATE_QUARTER:
-        cbseed = (0x0003 & q->frame.lspv[4]) << 14 |
-                 (0x003F & q->frame.lspv[3]) <<  8 |
-                 (0x0060 & q->frame.lspv[2]) <<  1 |
-                 (0x0007 & q->frame.lspv[1]) <<  3 |
-                 (0x0038 & q->frame.lspv[0]) >>  3;
-        rnd    = q->rnd_fir_filter_mem + 20;
-        for (i = 0; i < 8; i++) {
-            tmp_gain = gain[i] * (QCELP_SQRT1887 / 32768.0);
-            for (k = 0; k < 20; k++) {
-                cbseed = 521 * cbseed + 259;
-                *rnd   = (int16_t) cbseed;
-
-                    // FIR filter
-                fir_filter_value = 0.0;
-                for (j = 0; j < 10; j++)
-                    fir_filter_value += qcelp_rnd_fir_coefs[j] *
-                                        (rnd[-j] + rnd[-20+j]);
-
-                fir_filter_value += qcelp_rnd_fir_coefs[10] * rnd[-10];
-                *cdn_vector++     = tmp_gain * fir_filter_value;
-                rnd++;
-            }
-        }
-        memcpy(q->rnd_fir_filter_mem, q->rnd_fir_filter_mem + 160,
-               20 * sizeof(float));
-        break;
-    case RATE_OCTAVE:
-        cbseed = q->first16bits;
-        for (i = 0; i < 8; i++) {
-            tmp_gain = gain[i] * (QCELP_SQRT1887 / 32768.0);
-            for (j = 0; j < 20; j++) {
-                cbseed        = 521 * cbseed + 259;
-                *cdn_vector++ = tmp_gain * (int16_t) cbseed;
-            }
-        }
-        break;
-    case I_F_Q:
-        cbseed = -44; // random codebook index
-        for (i = 0; i < 4; i++) {
-            tmp_gain = gain[i] * QCELP_RATE_FULL_CODEBOOK_RATIO;
-            for (j = 0; j < 40; j++)
-                *cdn_vector++ = tmp_gain * qcelp_rate_full_codebook[cbseed++ & 127];
-        }
-        break;
-    case SILENCE:
-        memset(cdn_vector, 0, 160 * sizeof(float));
-        break;
-    }
-}
-
-/**
- * Apply generic gain control.
- *
- * @param v_out output vector
- * @param v_in gain-controlled vector
- * @param v_ref vector to control gain of
- *
- * TIA/EIA/IS-733 2.4.8.3, 2.4.8.6
- */
-static void apply_gain_ctrl(float *v_out, const float *v_ref, const float *v_in)
-{
-    int i;
-
-    for (i = 0; i < 160; i += 40) {
-        float res = avpriv_scalarproduct_float_c(v_ref + i, v_ref + i, 40);
-        ff_scale_vector_to_given_sum_of_squares(v_out + i, v_in + i, res, 40);
-    }
-}
-
-/**
- * Apply filter in pitch-subframe steps.
- *
- * @param memory buffer for the previous state of the filter
- *        - must be able to contain 303 elements
- *        - the 143 first elements are from the previous state
- *        - the next 160 are for output
- * @param v_in input filter vector
- * @param gain per-subframe gain array, each element is between 0.0 and 2.0
- * @param lag per-subframe lag array, each element is
- *        - between 16 and 143 if its corresponding pfrac is 0,
- *        - between 16 and 139 otherwise
- * @param pfrac per-subframe boolean array, 1 if the lag is fractional, 0
- *        otherwise
- *
- * @return filter output vector
- */
-static const float *do_pitchfilter(float memory[303], const float v_in[160],
-                                   const float gain[4], const uint8_t *lag,
-                                   const uint8_t pfrac[4])
-{
-    int i, j;
-    float *v_lag, *v_out;
-    const float *v_len;
-
-    v_out = memory + 143; // Output vector starts at memory[143].
-
-    for (i = 0; i < 4; i++) {
-        if (gain[i]) {
-            v_lag = memory + 143 + 40 * i - lag[i];
-            for (v_len = v_in + 40; v_in < v_len; v_in++) {
-                if (pfrac[i]) { // If it is a fractional lag...
-                    for (j = 0, *v_out = 0.0; j < 4; j++)
-                        *v_out += qcelp_hammsinc_table[j] * (v_lag[j - 4] + v_lag[3 - j]);
-                } else
-                    *v_out = *v_lag;
-
-                *v_out = *v_in + gain[i] * *v_out;
-
-                v_lag++;
-                v_out++;
-            }
-        } else {
-            memcpy(v_out, v_in, 40 * sizeof(float));
-            v_in  += 40;
-            v_out += 40;
-        }
-    }
-
-    memmove(memory, memory + 160, 143 * sizeof(float));
-    return memory + 143;
-}
-
-/**
- * Apply pitch synthesis filter and pitch prefilter to the scaled codebook vector.
- * TIA/EIA/IS-733 2.4.5.2, 2.4.8.7.2
- *
- * @param q the context
- * @param cdn_vector the scaled codebook vector
- */
-static void apply_pitch_filters(QCELPContext *q, float *cdn_vector)
-{
-    int i;
-    const float *v_synthesis_filtered, *v_pre_filtered;
-
-    if (q->bitrate >= RATE_HALF || q->bitrate == SILENCE ||
-        (q->bitrate == I_F_Q && (q->prev_bitrate >= RATE_HALF))) {
-
-        if (q->bitrate >= RATE_HALF) {
-            // Compute gain & lag for the whole frame.
-            for (i = 0; i < 4; i++) {
-                q->pitch_gain[i] = q->frame.plag[i] ? (q->frame.pgain[i] + 1) * 0.25 : 0.0;
-
-                q->pitch_lag[i] = q->frame.plag[i] + 16;
-            }
-        } else {
-            float max_pitch_gain;
-
-            if (q->bitrate == I_F_Q) {
-                  if (q->erasure_count < 3)
-                      max_pitch_gain = 0.9 - 0.3 * (q->erasure_count - 1);
-                  else
-                      max_pitch_gain = 0.0;
-            } else {
-                assert(q->bitrate == SILENCE);
-                max_pitch_gain = 1.0;
-            }
-            for (i = 0; i < 4; i++)
-                q->pitch_gain[i] = FFMIN(q->pitch_gain[i], max_pitch_gain);
-
-            memset(q->frame.pfrac, 0, sizeof(q->frame.pfrac));
-        }
-
-        // pitch synthesis filter
-        v_synthesis_filtered = do_pitchfilter(q->pitch_synthesis_filter_mem,
-                                              cdn_vector, q->pitch_gain,
-                                              q->pitch_lag, q->frame.pfrac);
-
-        // pitch prefilter update
-        for (i = 0; i < 4; i++)
-            q->pitch_gain[i] = 0.5 * FFMIN(q->pitch_gain[i], 1.0);
-
-        v_pre_filtered       = do_pitchfilter(q->pitch_pre_filter_mem,
-                                              v_synthesis_filtered,
-                                              q->pitch_gain, q->pitch_lag,
-                                              q->frame.pfrac);
-
-        apply_gain_ctrl(cdn_vector, v_synthesis_filtered, v_pre_filtered);
-    } else {
-        memcpy(q->pitch_synthesis_filter_mem, cdn_vector + 17, 143 * sizeof(float));
-        memcpy(q->pitch_pre_filter_mem, cdn_vector + 17, 143 * sizeof(float));
-        memset(q->pitch_gain, 0, sizeof(q->pitch_gain));
-        memset(q->pitch_lag,  0, sizeof(q->pitch_lag));
-    }
-}
-
-/**
- * Reconstruct LPC coefficients from the line spectral pair frequencies
- * and perform bandwidth expansion.
- *
- * @param lspf line spectral pair frequencies
- * @param lpc linear predictive coding coefficients
- *
- * @note: bandwidth_expansion_coeff could be precalculated into a table
- *        but it seems to be slower on x86
- *
- * TIA/EIA/IS-733 2.4.3.3.5
- */
-static void lspf2lpc(const float *lspf, float *lpc)
-{
-    double lsp[10];
-    double bandwidth_expansion_coeff = QCELP_BANDWIDTH_EXPANSION_COEFF;
-    int i;
-
-    for (i = 0; i < 10; i++)
-        lsp[i] = cos(M_PI * lspf[i]);
-
-    ff_acelp_lspd2lpc(lsp, lpc, 5);
-
-    for (i = 0; i < 10; i++) {
-        lpc[i]                    *= bandwidth_expansion_coeff;
-        bandwidth_expansion_coeff *= QCELP_BANDWIDTH_EXPANSION_COEFF;
-    }
-}
-
-/**
- * Interpolate LSP frequencies and compute LPC coefficients
- * for a given bitrate & pitch subframe.
- *
- * TIA/EIA/IS-733 2.4.3.3.4, 2.4.8.7.2
- *
- * @param q the context
- * @param curr_lspf LSP frequencies vector of the current frame
- * @param lpc float vector for the resulting LPC
- * @param subframe_num frame number in decoded stream
- */
-static void interpolate_lpc(QCELPContext *q, const float *curr_lspf,
-                            float *lpc, const int subframe_num)
-{
-    float interpolated_lspf[10];
-    float weight;
-
-    if (q->bitrate >= RATE_QUARTER)
-        weight = 0.25 * (subframe_num + 1);
-    else if (q->bitrate == RATE_OCTAVE && !subframe_num)
-        weight = 0.625;
-    else
-        weight = 1.0;
-
-    if (weight != 1.0) {
-        ff_weighted_vector_sumf(interpolated_lspf, curr_lspf, q->prev_lspf,
-                                weight, 1.0 - weight, 10);
-        lspf2lpc(interpolated_lspf, lpc);
-    } else if (q->bitrate >= RATE_QUARTER ||
-               (q->bitrate == I_F_Q && !subframe_num))
-        lspf2lpc(curr_lspf, lpc);
-    else if (q->bitrate == SILENCE && !subframe_num)
-        lspf2lpc(q->prev_lspf, lpc);
-}
-
-static qcelp_packet_rate buf_size2bitrate(const int buf_size)
-{
-    switch (buf_size) {
-    case 35: return RATE_FULL;
-    case 17: return RATE_HALF;
-    case  8: return RATE_QUARTER;
-    case  4: return RATE_OCTAVE;
-    case  1: return SILENCE;
-    }
-
-    return I_F_Q;
-}
-
-/**
- * Determine the bitrate from the frame size and/or the first byte of the frame.
- *
- * @param avctx the AV codec context
- * @param buf_size length of the buffer
- * @param buf the bufffer
- *
- * @return the bitrate on success,
- *         I_F_Q  if the bitrate cannot be satisfactorily determined
- *
- * TIA/EIA/IS-733 2.4.8.7.1
- */
-static qcelp_packet_rate determine_bitrate(AVCodecContext *avctx,
-                                           const int buf_size,
-                                           const uint8_t **buf)
-{
-    qcelp_packet_rate bitrate;
-
-    if ((bitrate = buf_size2bitrate(buf_size)) >= 0) {
-        if (bitrate > **buf) {
-            QCELPContext *q = avctx->priv_data;
-            if (!q->warned_buf_mismatch_bitrate) {
-            av_log(avctx, AV_LOG_WARNING,
-                   "Claimed bitrate and buffer size mismatch.\n");
-                q->warned_buf_mismatch_bitrate = 1;
-            }
-            bitrate = **buf;
-        } else if (bitrate < **buf) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Buffer is too small for the claimed bitrate.\n");
-            return I_F_Q;
-        }
-        (*buf)++;
-    } else if ((bitrate = buf_size2bitrate(buf_size + 1)) >= 0) {
-        av_log(avctx, AV_LOG_WARNING,
-               "Bitrate byte is missing, guessing the bitrate from packet size.\n");
-    } else
-        return I_F_Q;
-
-    if (bitrate == SILENCE) {
-        // FIXME: Remove this warning when tested with samples.
-        avpriv_request_sample(avctx, "Blank frame handling");
-    }
-    return bitrate;
-}
-
-static void warn_insufficient_frame_quality(AVCodecContext *avctx,
-                                            const char *message)
-{
-    av_log(avctx, AV_LOG_WARNING, "Frame #%d, IFQ: %s\n",
-           avctx->frame_number, message);
-}
-
-static void postfilter(QCELPContext *q, float *samples, float *lpc)
-{
-    static const float pow_0_775[10] = {
-        0.775000, 0.600625, 0.465484, 0.360750, 0.279582,
-        0.216676, 0.167924, 0.130141, 0.100859, 0.078166
-    }, pow_0_625[10] = {
-        0.625000, 0.390625, 0.244141, 0.152588, 0.095367,
-        0.059605, 0.037253, 0.023283, 0.014552, 0.009095
-    };
-    float lpc_s[10], lpc_p[10], pole_out[170], zero_out[160];
-    int n;
-
-    for (n = 0; n < 10; n++) {
-        lpc_s[n] = lpc[n] * pow_0_625[n];
-        lpc_p[n] = lpc[n] * pow_0_775[n];
-    }
-
-    ff_celp_lp_zero_synthesis_filterf(zero_out, lpc_s,
-                                      q->formant_mem + 10, 160, 10);
-    memcpy(pole_out, q->postfilter_synth_mem, sizeof(float) * 10);
-    ff_celp_lp_synthesis_filterf(pole_out + 10, lpc_p, zero_out, 160, 10);
-    memcpy(q->postfilter_synth_mem, pole_out + 160, sizeof(float) * 10);
-
-    ff_tilt_compensation(&q->postfilter_tilt_mem, 0.3, pole_out + 10, 160);
-
-    ff_adaptive_gain_control(samples, pole_out + 10,
-                             avpriv_scalarproduct_float_c(q->formant_mem + 10,
-                                                          q->formant_mem + 10,
-                                                          160),
-                             160, 0.9375, &q->postfilter_agc_mem);
-}
-
-static int qcelp_decode_frame(AVCodecContext *avctx, void *data,
-                              int *got_frame_ptr, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    QCELPContext *q    = avctx->priv_data;
-    AVFrame *frame     = data;
-    float *outbuffer;
-    int   i, ret;
-    float quantized_lspf[10], lpc[10];
-    float gain[16];
-    float *formant_mem;
-
-    /* get output buffer */
-    frame->nb_samples = 160;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    outbuffer = (float *)frame->data[0];
-
-    if ((q->bitrate = determine_bitrate(avctx, buf_size, &buf)) == I_F_Q) {
-        warn_insufficient_frame_quality(avctx, "bitrate cannot be determined.");
-        goto erasure;
-    }
-
-    if (q->bitrate == RATE_OCTAVE &&
-        (q->first16bits = AV_RB16(buf)) == 0xFFFF) {
-        warn_insufficient_frame_quality(avctx, "Bitrate is 1/8 and first 16 bits are on.");
-        goto erasure;
-    }
-
-    if (q->bitrate > SILENCE) {
-        const QCELPBitmap *bitmaps     = qcelp_unpacking_bitmaps_per_rate[q->bitrate];
-        const QCELPBitmap *bitmaps_end = qcelp_unpacking_bitmaps_per_rate[q->bitrate] +
-                                         qcelp_unpacking_bitmaps_lengths[q->bitrate];
-        uint8_t *unpacked_data         = (uint8_t *)&q->frame;
-
-        init_get_bits(&q->gb, buf, 8 * buf_size);
-
-        memset(&q->frame, 0, sizeof(QCELPFrame));
-
-        for (; bitmaps < bitmaps_end; bitmaps++)
-            unpacked_data[bitmaps->index] |= get_bits(&q->gb, bitmaps->bitlen) << bitmaps->bitpos;
-
-        // Check for erasures/blanks on rates 1, 1/4 and 1/8.
-        if (q->frame.reserved) {
-            warn_insufficient_frame_quality(avctx, "Wrong data in reserved frame area.");
-            goto erasure;
-        }
-        if (q->bitrate == RATE_QUARTER &&
-            codebook_sanity_check_for_rate_quarter(q->frame.cbgain)) {
-            warn_insufficient_frame_quality(avctx, "Codebook gain sanity check failed.");
-            goto erasure;
-        }
-
-        if (q->bitrate >= RATE_HALF) {
-            for (i = 0; i < 4; i++) {
-                if (q->frame.pfrac[i] && q->frame.plag[i] >= 124) {
-                    warn_insufficient_frame_quality(avctx, "Cannot initialize pitch filter.");
-                    goto erasure;
-                }
-            }
-        }
-    }
-
-    decode_gain_and_index(q, gain);
-    compute_svector(q, gain, outbuffer);
-
-    if (decode_lspf(q, quantized_lspf) < 0) {
-        warn_insufficient_frame_quality(avctx, "Badly received packets in frame.");
-        goto erasure;
-    }
-
-    apply_pitch_filters(q, outbuffer);
-
-    if (q->bitrate == I_F_Q) {
-erasure:
-        q->bitrate = I_F_Q;
-        q->erasure_count++;
-        decode_gain_and_index(q, gain);
-        compute_svector(q, gain, outbuffer);
-        decode_lspf(q, quantized_lspf);
-        apply_pitch_filters(q, outbuffer);
-    } else
-        q->erasure_count = 0;
-
-    formant_mem = q->formant_mem + 10;
-    for (i = 0; i < 4; i++) {
-        interpolate_lpc(q, quantized_lspf, lpc, i);
-        ff_celp_lp_synthesis_filterf(formant_mem, lpc, outbuffer + i * 40, 40, 10);
-        formant_mem += 40;
-    }
-
-    // postfilter, as per TIA/EIA/IS-733 2.4.8.6
-    postfilter(q, outbuffer, lpc);
-
-    memcpy(q->formant_mem, q->formant_mem + 160, 10 * sizeof(float));
-
-    memcpy(q->prev_lspf, quantized_lspf, sizeof(q->prev_lspf));
-    q->prev_bitrate  = q->bitrate;
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_qcelp_decoder = {
-    .name           = "qcelp",
-    .long_name      = NULL_IF_CONFIG_SMALL("QCELP / PureVoice"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_QCELP,
-    .init           = qcelp_decode_init,
-    .decode         = qcelp_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .priv_data_size = sizeof(QCELPContext),
-};
diff --git a/deps/libav/libavcodec/qdm2.c b/deps/libav/libavcodec/qdm2.c
deleted file mode 100644
index 04e7def..0000000
--- a/deps/libav/libavcodec/qdm2.c
+++ /dev/null
@@ -1,2014 +0,0 @@
-/*
- * QDM2 compatible decoder
- * Copyright (c) 2003 Ewald Snel
- * Copyright (c) 2005 Benjamin Larsson
- * Copyright (c) 2005 Alex Beregszaszi
- * Copyright (c) 2005 Roberto Togni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * QDM2 decoder
- * @author Ewald Snel, Benjamin Larsson, Alex Beregszaszi, Roberto Togni
- *
- * The decoder is not perfect yet, there are still some distortions
- * especially on files encoded with 16 or 8 subbands.
- */
-
-#include <math.h>
-#include <stddef.h>
-#include <stdio.h>
-
-#define BITSTREAM_READER_LE
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "rdft.h"
-#include "mpegaudiodsp.h"
-#include "mpegaudio.h"
-
-#include "qdm2data.h"
-#include "qdm2_tablegen.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-
-#define QDM2_LIST_ADD(list, size, packet) \
-do { \
-      if (size > 0) { \
-    list[size - 1].next = &list[size]; \
-      } \
-      list[size].packet = packet; \
-      list[size].next = NULL; \
-      size++; \
-} while(0)
-
-// Result is 8, 16 or 30
-#define QDM2_SB_USED(sub_sampling) (((sub_sampling) >= 2) ? 30 : 8 << (sub_sampling))
-
-#define FIX_NOISE_IDX(noise_idx) \
-  if ((noise_idx) >= 3840) \
-    (noise_idx) -= 3840; \
-
-#define SB_DITHERING_NOISE(sb,noise_idx) (noise_table[(noise_idx)++] * sb_noise_attenuation[(sb)])
-
-#define SAMPLES_NEEDED \
-     av_log (NULL,AV_LOG_INFO,"This file triggers some untested code. Please contact the developers.\n");
-
-#define SAMPLES_NEEDED_2(why) \
-     av_log (NULL,AV_LOG_INFO,"This file triggers some missing code. Please contact the developers.\nPosition: %s\n",why);
-
-#define QDM2_MAX_FRAME_SIZE 512
-
-typedef int8_t sb_int8_array[2][30][64];
-
-/**
- * Subpacket
- */
-typedef struct {
-    int type;            ///< subpacket type
-    unsigned int size;   ///< subpacket size
-    const uint8_t *data; ///< pointer to subpacket data (points to input data buffer, it's not a private copy)
-} QDM2SubPacket;
-
-/**
- * A node in the subpacket list
- */
-typedef struct QDM2SubPNode {
-    QDM2SubPacket *packet;      ///< packet
-    struct QDM2SubPNode *next; ///< pointer to next packet in the list, NULL if leaf node
-} QDM2SubPNode;
-
-typedef struct {
-    float re;
-    float im;
-} QDM2Complex;
-
-typedef struct {
-    float level;
-    QDM2Complex *complex;
-    const float *table;
-    int   phase;
-    int   phase_shift;
-    int   duration;
-    short time_index;
-    short cutoff;
-} FFTTone;
-
-typedef struct {
-    int16_t sub_packet;
-    uint8_t channel;
-    int16_t offset;
-    int16_t exp;
-    uint8_t phase;
-} FFTCoefficient;
-
-typedef struct {
-    DECLARE_ALIGNED(32, QDM2Complex, complex)[MPA_MAX_CHANNELS][256];
-} QDM2FFT;
-
-/**
- * QDM2 decoder context
- */
-typedef struct {
-    /// Parameters from codec header, do not change during playback
-    int nb_channels;         ///< number of channels
-    int channels;            ///< number of channels
-    int group_size;          ///< size of frame group (16 frames per group)
-    int fft_size;            ///< size of FFT, in complex numbers
-    int checksum_size;       ///< size of data block, used also for checksum
-
-    /// Parameters built from header parameters, do not change during playback
-    int group_order;         ///< order of frame group
-    int fft_order;           ///< order of FFT (actually fftorder+1)
-    int frame_size;          ///< size of data frame
-    int frequency_range;
-    int sub_sampling;        ///< subsampling: 0=25%, 1=50%, 2=100% */
-    int coeff_per_sb_select; ///< selector for "num. of coeffs. per subband" tables. Can be 0, 1, 2
-    int cm_table_select;     ///< selector for "coding method" tables. Can be 0, 1 (from init: 0-4)
-
-    /// Packets and packet lists
-    QDM2SubPacket sub_packets[16];      ///< the packets themselves
-    QDM2SubPNode sub_packet_list_A[16]; ///< list of all packets
-    QDM2SubPNode sub_packet_list_B[16]; ///< FFT packets B are on list
-    int sub_packets_B;                  ///< number of packets on 'B' list
-    QDM2SubPNode sub_packet_list_C[16]; ///< packets with errors?
-    QDM2SubPNode sub_packet_list_D[16]; ///< DCT packets
-
-    /// FFT and tones
-    FFTTone fft_tones[1000];
-    int fft_tone_start;
-    int fft_tone_end;
-    FFTCoefficient fft_coefs[1000];
-    int fft_coefs_index;
-    int fft_coefs_min_index[5];
-    int fft_coefs_max_index[5];
-    int fft_level_exp[6];
-    RDFTContext rdft_ctx;
-    QDM2FFT fft;
-
-    /// I/O data
-    const uint8_t *compressed_data;
-    int compressed_size;
-    float output_buffer[QDM2_MAX_FRAME_SIZE * 2];
-
-    /// Synthesis filter
-    MPADSPContext mpadsp;
-    DECLARE_ALIGNED(32, float, synth_buf)[MPA_MAX_CHANNELS][512*2];
-    int synth_buf_offset[MPA_MAX_CHANNELS];
-    DECLARE_ALIGNED(32, float, sb_samples)[MPA_MAX_CHANNELS][128][SBLIMIT];
-    DECLARE_ALIGNED(32, float, samples)[MPA_MAX_CHANNELS * MPA_FRAME_SIZE];
-
-    /// Mixed temporary data used in decoding
-    float tone_level[MPA_MAX_CHANNELS][30][64];
-    int8_t coding_method[MPA_MAX_CHANNELS][30][64];
-    int8_t quantized_coeffs[MPA_MAX_CHANNELS][10][8];
-    int8_t tone_level_idx_base[MPA_MAX_CHANNELS][30][8];
-    int8_t tone_level_idx_hi1[MPA_MAX_CHANNELS][3][8][8];
-    int8_t tone_level_idx_mid[MPA_MAX_CHANNELS][26][8];
-    int8_t tone_level_idx_hi2[MPA_MAX_CHANNELS][26];
-    int8_t tone_level_idx[MPA_MAX_CHANNELS][30][64];
-    int8_t tone_level_idx_temp[MPA_MAX_CHANNELS][30][64];
-
-    // Flags
-    int has_errors;         ///< packet has errors
-    int superblocktype_2_3; ///< select fft tables and some algorithm based on superblock type
-    int do_synth_filter;    ///< used to perform or skip synthesis filter
-
-    int sub_packet;
-    int noise_idx; ///< index for dithering noise table
-} QDM2Context;
-
-
-static VLC vlc_tab_level;
-static VLC vlc_tab_diff;
-static VLC vlc_tab_run;
-static VLC fft_level_exp_alt_vlc;
-static VLC fft_level_exp_vlc;
-static VLC fft_stereo_exp_vlc;
-static VLC fft_stereo_phase_vlc;
-static VLC vlc_tab_tone_level_idx_hi1;
-static VLC vlc_tab_tone_level_idx_mid;
-static VLC vlc_tab_tone_level_idx_hi2;
-static VLC vlc_tab_type30;
-static VLC vlc_tab_type34;
-static VLC vlc_tab_fft_tone_offset[5];
-
-static const uint16_t qdm2_vlc_offs[] = {
-    0,260,566,598,894,1166,1230,1294,1678,1950,2214,2278,2310,2570,2834,3124,3448,3838,
-};
-
-static const int switchtable[23] = {
-    0, 5, 1, 5, 5, 5, 5, 5, 2, 5, 5, 5, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 4
-};
-
-static av_cold void qdm2_init_vlc(void)
-{
-    static VLC_TYPE qdm2_table[3838][2];
-
-    vlc_tab_level.table           = &qdm2_table[qdm2_vlc_offs[0]];
-    vlc_tab_level.table_allocated = qdm2_vlc_offs[1] - qdm2_vlc_offs[0];
-    init_vlc(&vlc_tab_level, 8, 24,
-             vlc_tab_level_huffbits, 1, 1,
-             vlc_tab_level_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_diff.table           = &qdm2_table[qdm2_vlc_offs[1]];
-    vlc_tab_diff.table_allocated = qdm2_vlc_offs[2] - qdm2_vlc_offs[1];
-    init_vlc(&vlc_tab_diff, 8, 37,
-             vlc_tab_diff_huffbits, 1, 1,
-             vlc_tab_diff_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_run.table           = &qdm2_table[qdm2_vlc_offs[2]];
-    vlc_tab_run.table_allocated = qdm2_vlc_offs[3] - qdm2_vlc_offs[2];
-    init_vlc(&vlc_tab_run, 5, 6,
-             vlc_tab_run_huffbits, 1, 1,
-             vlc_tab_run_huffcodes, 1, 1,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    fft_level_exp_alt_vlc.table           = &qdm2_table[qdm2_vlc_offs[3]];
-    fft_level_exp_alt_vlc.table_allocated = qdm2_vlc_offs[4] -
-                                            qdm2_vlc_offs[3];
-    init_vlc(&fft_level_exp_alt_vlc, 8, 28,
-             fft_level_exp_alt_huffbits, 1, 1,
-             fft_level_exp_alt_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    fft_level_exp_vlc.table           = &qdm2_table[qdm2_vlc_offs[4]];
-    fft_level_exp_vlc.table_allocated = qdm2_vlc_offs[5] - qdm2_vlc_offs[4];
-    init_vlc(&fft_level_exp_vlc, 8, 20,
-             fft_level_exp_huffbits, 1, 1,
-             fft_level_exp_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    fft_stereo_exp_vlc.table           = &qdm2_table[qdm2_vlc_offs[5]];
-    fft_stereo_exp_vlc.table_allocated = qdm2_vlc_offs[6] -
-                                         qdm2_vlc_offs[5];
-    init_vlc(&fft_stereo_exp_vlc, 6, 7,
-             fft_stereo_exp_huffbits, 1, 1,
-             fft_stereo_exp_huffcodes, 1, 1,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    fft_stereo_phase_vlc.table           = &qdm2_table[qdm2_vlc_offs[6]];
-    fft_stereo_phase_vlc.table_allocated = qdm2_vlc_offs[7] -
-                                           qdm2_vlc_offs[6];
-    init_vlc(&fft_stereo_phase_vlc, 6, 9,
-             fft_stereo_phase_huffbits, 1, 1,
-             fft_stereo_phase_huffcodes, 1, 1,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_tone_level_idx_hi1.table =
-        &qdm2_table[qdm2_vlc_offs[7]];
-    vlc_tab_tone_level_idx_hi1.table_allocated = qdm2_vlc_offs[8] -
-                                                 qdm2_vlc_offs[7];
-    init_vlc(&vlc_tab_tone_level_idx_hi1, 8, 20,
-             vlc_tab_tone_level_idx_hi1_huffbits, 1, 1,
-             vlc_tab_tone_level_idx_hi1_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_tone_level_idx_mid.table =
-        &qdm2_table[qdm2_vlc_offs[8]];
-    vlc_tab_tone_level_idx_mid.table_allocated = qdm2_vlc_offs[9] -
-                                                 qdm2_vlc_offs[8];
-    init_vlc(&vlc_tab_tone_level_idx_mid, 8, 24,
-             vlc_tab_tone_level_idx_mid_huffbits, 1, 1,
-             vlc_tab_tone_level_idx_mid_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_tone_level_idx_hi2.table =
-        &qdm2_table[qdm2_vlc_offs[9]];
-    vlc_tab_tone_level_idx_hi2.table_allocated = qdm2_vlc_offs[10] -
-                                                 qdm2_vlc_offs[9];
-    init_vlc(&vlc_tab_tone_level_idx_hi2, 8, 24,
-             vlc_tab_tone_level_idx_hi2_huffbits, 1, 1,
-             vlc_tab_tone_level_idx_hi2_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_type30.table           = &qdm2_table[qdm2_vlc_offs[10]];
-    vlc_tab_type30.table_allocated = qdm2_vlc_offs[11] - qdm2_vlc_offs[10];
-    init_vlc(&vlc_tab_type30, 6, 9,
-             vlc_tab_type30_huffbits, 1, 1,
-             vlc_tab_type30_huffcodes, 1, 1,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_type34.table           = &qdm2_table[qdm2_vlc_offs[11]];
-    vlc_tab_type34.table_allocated = qdm2_vlc_offs[12] - qdm2_vlc_offs[11];
-    init_vlc(&vlc_tab_type34, 5, 10,
-             vlc_tab_type34_huffbits, 1, 1,
-             vlc_tab_type34_huffcodes, 1, 1,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_fft_tone_offset[0].table =
-        &qdm2_table[qdm2_vlc_offs[12]];
-    vlc_tab_fft_tone_offset[0].table_allocated = qdm2_vlc_offs[13] -
-                                                 qdm2_vlc_offs[12];
-    init_vlc(&vlc_tab_fft_tone_offset[0], 8, 23,
-             vlc_tab_fft_tone_offset_0_huffbits, 1, 1,
-             vlc_tab_fft_tone_offset_0_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_fft_tone_offset[1].table =
-        &qdm2_table[qdm2_vlc_offs[13]];
-    vlc_tab_fft_tone_offset[1].table_allocated = qdm2_vlc_offs[14] -
-                                                 qdm2_vlc_offs[13];
-    init_vlc(&vlc_tab_fft_tone_offset[1], 8, 28,
-             vlc_tab_fft_tone_offset_1_huffbits, 1, 1,
-             vlc_tab_fft_tone_offset_1_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_fft_tone_offset[2].table =
-        &qdm2_table[qdm2_vlc_offs[14]];
-    vlc_tab_fft_tone_offset[2].table_allocated = qdm2_vlc_offs[15] -
-                                                 qdm2_vlc_offs[14];
-    init_vlc(&vlc_tab_fft_tone_offset[2], 8, 32,
-             vlc_tab_fft_tone_offset_2_huffbits, 1, 1,
-             vlc_tab_fft_tone_offset_2_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_fft_tone_offset[3].table =
-        &qdm2_table[qdm2_vlc_offs[15]];
-    vlc_tab_fft_tone_offset[3].table_allocated = qdm2_vlc_offs[16] -
-                                                 qdm2_vlc_offs[15];
-    init_vlc(&vlc_tab_fft_tone_offset[3], 8, 35,
-             vlc_tab_fft_tone_offset_3_huffbits, 1, 1,
-             vlc_tab_fft_tone_offset_3_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-
-    vlc_tab_fft_tone_offset[4].table =
-        &qdm2_table[qdm2_vlc_offs[16]];
-    vlc_tab_fft_tone_offset[4].table_allocated = qdm2_vlc_offs[17] -
-                                                 qdm2_vlc_offs[16];
-    init_vlc(&vlc_tab_fft_tone_offset[4], 8, 38,
-             vlc_tab_fft_tone_offset_4_huffbits, 1, 1,
-             vlc_tab_fft_tone_offset_4_huffcodes, 2, 2,
-             INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-}
-
-static int qdm2_get_vlc(GetBitContext *gb, VLC *vlc, int flag, int depth)
-{
-    int value;
-
-    value = get_vlc2(gb, vlc->table, vlc->bits, depth);
-
-    /* stage-2, 3 bits exponent escape sequence */
-    if (value-- == 0)
-        value = get_bits(gb, get_bits(gb, 3) + 1);
-
-    /* stage-3, optional */
-    if (flag) {
-        int tmp = vlc_stage3_values[value];
-
-        if ((value & ~3) > 0)
-            tmp += get_bits(gb, (value >> 2));
-        value = tmp;
-    }
-
-    return value;
-}
-
-static int qdm2_get_se_vlc(VLC *vlc, GetBitContext *gb, int depth)
-{
-    int value = qdm2_get_vlc(gb, vlc, 0, depth);
-
-    return (value & 1) ? ((value + 1) >> 1) : -(value >> 1);
-}
-
-/**
- * QDM2 checksum
- *
- * @param data      pointer to data to be checksum'ed
- * @param length    data length
- * @param value     checksum value
- *
- * @return          0 if checksum is OK
- */
-static uint16_t qdm2_packet_checksum(const uint8_t *data, int length, int value)
-{
-    int i;
-
-    for (i = 0; i < length; i++)
-        value -= data[i];
-
-    return (uint16_t)(value & 0xffff);
-}
-
-/**
- * Fill a QDM2SubPacket structure with packet type, size, and data pointer.
- *
- * @param gb            bitreader context
- * @param sub_packet    packet under analysis
- */
-static void qdm2_decode_sub_packet_header(GetBitContext *gb,
-                                          QDM2SubPacket *sub_packet)
-{
-    sub_packet->type = get_bits(gb, 8);
-
-    if (sub_packet->type == 0) {
-        sub_packet->size = 0;
-        sub_packet->data = NULL;
-    } else {
-        sub_packet->size = get_bits(gb, 8);
-
-        if (sub_packet->type & 0x80) {
-            sub_packet->size <<= 8;
-            sub_packet->size  |= get_bits(gb, 8);
-            sub_packet->type  &= 0x7f;
-        }
-
-        if (sub_packet->type == 0x7f)
-            sub_packet->type |= (get_bits(gb, 8) << 8);
-
-        // FIXME: this depends on bitreader-internal data
-        sub_packet->data = &gb->buffer[get_bits_count(gb) / 8];
-    }
-
-    av_log(NULL, AV_LOG_DEBUG, "Subpacket: type=%d size=%d start_offs=%x\n",
-           sub_packet->type, sub_packet->size, get_bits_count(gb) / 8);
-}
-
-/**
- * Return node pointer to first packet of requested type in list.
- *
- * @param list    list of subpackets to be scanned
- * @param type    type of searched subpacket
- * @return        node pointer for subpacket if found, else NULL
- */
-static QDM2SubPNode *qdm2_search_subpacket_type_in_list(QDM2SubPNode *list,
-                                                        int type)
-{
-    while (list != NULL && list->packet != NULL) {
-        if (list->packet->type == type)
-            return list;
-        list = list->next;
-    }
-    return NULL;
-}
-
-/**
- * Replace 8 elements with their average value.
- * Called by qdm2_decode_superblock before starting subblock decoding.
- *
- * @param q       context
- */
-static void average_quantized_coeffs(QDM2Context *q)
-{
-    int i, j, n, ch, sum;
-
-    n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1;
-
-    for (ch = 0; ch < q->nb_channels; ch++)
-        for (i = 0; i < n; i++) {
-            sum = 0;
-
-            for (j = 0; j < 8; j++)
-                sum += q->quantized_coeffs[ch][i][j];
-
-            sum /= 8;
-            if (sum > 0)
-                sum--;
-
-            for (j = 0; j < 8; j++)
-                q->quantized_coeffs[ch][i][j] = sum;
-        }
-}
-
-/**
- * Build subband samples with noise weighted by q->tone_level.
- * Called by synthfilt_build_sb_samples.
- *
- * @param q     context
- * @param sb    subband index
- */
-static void build_sb_samples_from_noise(QDM2Context *q, int sb)
-{
-    int ch, j;
-
-    FIX_NOISE_IDX(q->noise_idx);
-
-    if (!q->nb_channels)
-        return;
-
-    for (ch = 0; ch < q->nb_channels; ch++) {
-        for (j = 0; j < 64; j++) {
-            q->sb_samples[ch][j * 2][sb] =
-                SB_DITHERING_NOISE(sb, q->noise_idx) * q->tone_level[ch][sb][j];
-            q->sb_samples[ch][j * 2 + 1][sb] =
-                SB_DITHERING_NOISE(sb, q->noise_idx) * q->tone_level[ch][sb][j];
-        }
-    }
-}
-
-/**
- * Called while processing data from subpackets 11 and 12.
- * Used after making changes to coding_method array.
- *
- * @param sb               subband index
- * @param channels         number of channels
- * @param coding_method    q->coding_method[0][0][0]
- */
-static int fix_coding_method_array(int sb, int channels,
-                                   sb_int8_array coding_method)
-{
-    int j, k;
-    int ch;
-    int run, case_val;
-
-    for (ch = 0; ch < channels; ch++) {
-        for (j = 0; j < 64; ) {
-            if (coding_method[ch][sb][j] < 8)
-                return -1;
-            if ((coding_method[ch][sb][j] - 8) > 22) {
-                run      = 1;
-                case_val = 8;
-            } else {
-                switch (switchtable[coding_method[ch][sb][j] - 8]) {
-                case 0: run  = 10;
-                    case_val = 10;
-                    break;
-                case 1: run  = 1;
-                    case_val = 16;
-                    break;
-                case 2: run  = 5;
-                    case_val = 24;
-                    break;
-                case 3: run  = 3;
-                    case_val = 30;
-                    break;
-                case 4: run  = 1;
-                    case_val = 30;
-                    break;
-                case 5: run  = 1;
-                    case_val = 8;
-                    break;
-                default: run = 1;
-                    case_val = 8;
-                    break;
-                }
-            }
-            for (k = 0; k < run; k++) {
-                if (j + k < 128) {
-                    if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j]) {
-                        if (k > 0) {
-                            SAMPLES_NEEDED
-                            //not debugged, almost never used
-                            memset(&coding_method[ch][sb][j + k], case_val,
-                                   k *sizeof(int8_t));
-                            memset(&coding_method[ch][sb][j + k], case_val,
-                                   3 * sizeof(int8_t));
-                        }
-                    }
-                }
-            }
-            j += run;
-        }
-    }
-    return 0;
-}
-
-/**
- * Related to synthesis filter
- * Called by process_subpacket_10
- *
- * @param q       context
- * @param flag    1 if called after getting data from subpacket 10, 0 if no subpacket 10
- */
-static void fill_tone_level_array(QDM2Context *q, int flag)
-{
-    int i, sb, ch, sb_used;
-    int tmp, tab;
-
-    for (ch = 0; ch < q->nb_channels; ch++)
-        for (sb = 0; sb < 30; sb++)
-            for (i = 0; i < 8; i++) {
-                if ((tab=coeff_per_sb_for_dequant[q->coeff_per_sb_select][sb]) < (last_coeff[q->coeff_per_sb_select] - 1))
-                    tmp = q->quantized_coeffs[ch][tab + 1][i] * dequant_table[q->coeff_per_sb_select][tab + 1][sb]+
-                          q->quantized_coeffs[ch][tab][i] * dequant_table[q->coeff_per_sb_select][tab][sb];
-                else
-                    tmp = q->quantized_coeffs[ch][tab][i] * dequant_table[q->coeff_per_sb_select][tab][sb];
-                if(tmp < 0)
-                    tmp += 0xff;
-                q->tone_level_idx_base[ch][sb][i] = (tmp / 256) & 0xff;
-            }
-
-    sb_used = QDM2_SB_USED(q->sub_sampling);
-
-    if ((q->superblocktype_2_3 != 0) && !flag) {
-        for (sb = 0; sb < sb_used; sb++)
-            for (ch = 0; ch < q->nb_channels; ch++)
-                for (i = 0; i < 64; i++) {
-                    q->tone_level_idx[ch][sb][i] = q->tone_level_idx_base[ch][sb][i / 8];
-                    if (q->tone_level_idx[ch][sb][i] < 0)
-                        q->tone_level[ch][sb][i] = 0;
-                    else
-                        q->tone_level[ch][sb][i] = fft_tone_level_table[0][q->tone_level_idx[ch][sb][i] & 0x3f];
-                }
-    } else {
-        tab = q->superblocktype_2_3 ? 0 : 1;
-        for (sb = 0; sb < sb_used; sb++) {
-            if ((sb >= 4) && (sb <= 23)) {
-                for (ch = 0; ch < q->nb_channels; ch++)
-                    for (i = 0; i < 64; i++) {
-                        tmp = q->tone_level_idx_base[ch][sb][i / 8] -
-                              q->tone_level_idx_hi1[ch][sb / 8][i / 8][i % 8] -
-                              q->tone_level_idx_mid[ch][sb - 4][i / 8] -
-                              q->tone_level_idx_hi2[ch][sb - 4];
-                        q->tone_level_idx[ch][sb][i] = tmp & 0xff;
-                        if ((tmp < 0) || (!q->superblocktype_2_3 && !tmp))
-                            q->tone_level[ch][sb][i] = 0;
-                        else
-                            q->tone_level[ch][sb][i] = fft_tone_level_table[tab][tmp & 0x3f];
-                }
-            } else {
-                if (sb > 4) {
-                    for (ch = 0; ch < q->nb_channels; ch++)
-                        for (i = 0; i < 64; i++) {
-                            tmp = q->tone_level_idx_base[ch][sb][i / 8] -
-                                  q->tone_level_idx_hi1[ch][2][i / 8][i % 8] -
-                                  q->tone_level_idx_hi2[ch][sb - 4];
-                            q->tone_level_idx[ch][sb][i] = tmp & 0xff;
-                            if ((tmp < 0) || (!q->superblocktype_2_3 && !tmp))
-                                q->tone_level[ch][sb][i] = 0;
-                            else
-                                q->tone_level[ch][sb][i] = fft_tone_level_table[tab][tmp & 0x3f];
-                    }
-                } else {
-                    for (ch = 0; ch < q->nb_channels; ch++)
-                        for (i = 0; i < 64; i++) {
-                            tmp = q->tone_level_idx[ch][sb][i] = q->tone_level_idx_base[ch][sb][i / 8];
-                            if ((tmp < 0) || (!q->superblocktype_2_3 && !tmp))
-                                q->tone_level[ch][sb][i] = 0;
-                            else
-                                q->tone_level[ch][sb][i] = fft_tone_level_table[tab][tmp & 0x3f];
-                        }
-                }
-            }
-        }
-    }
-}
-
-/**
- * Related to synthesis filter
- * Called by process_subpacket_11
- * c is built with data from subpacket 11
- * Most of this function is used only if superblock_type_2_3 == 0,
- * never seen it in samples.
- *
- * @param tone_level_idx
- * @param tone_level_idx_temp
- * @param coding_method        q->coding_method[0][0][0]
- * @param nb_channels          number of channels
- * @param c                    coming from subpacket 11, passed as 8*c
- * @param superblocktype_2_3   flag based on superblock packet type
- * @param cm_table_select      q->cm_table_select
- */
-static void fill_coding_method_array(sb_int8_array tone_level_idx,
-                                     sb_int8_array tone_level_idx_temp,
-                                     sb_int8_array coding_method,
-                                     int nb_channels,
-                                     int c, int superblocktype_2_3,
-                                     int cm_table_select)
-{
-    int ch, sb, j;
-    int tmp, acc, esp_40, comp;
-    int add1, add2, add3, add4;
-    int64_t multres;
-
-    if (!superblocktype_2_3) {
-        /* This case is untested, no samples available */
-        SAMPLES_NEEDED
-        for (ch = 0; ch < nb_channels; ch++)
-            for (sb = 0; sb < 30; sb++) {
-                for (j = 1; j < 63; j++) {  // The loop only iterates to 63 so the code doesn't overflow the buffer
-                    add1 = tone_level_idx[ch][sb][j] - 10;
-                    if (add1 < 0)
-                        add1 = 0;
-                    add2 = add3 = add4 = 0;
-                    if (sb > 1) {
-                        add2 = tone_level_idx[ch][sb - 2][j] + tone_level_idx_offset_table[sb][0] - 6;
-                        if (add2 < 0)
-                            add2 = 0;
-                    }
-                    if (sb > 0) {
-                        add3 = tone_level_idx[ch][sb - 1][j] + tone_level_idx_offset_table[sb][1] - 6;
-                        if (add3 < 0)
-                            add3 = 0;
-                    }
-                    if (sb < 29) {
-                        add4 = tone_level_idx[ch][sb + 1][j] + tone_level_idx_offset_table[sb][3] - 6;
-                        if (add4 < 0)
-                            add4 = 0;
-                    }
-                    tmp = tone_level_idx[ch][sb][j + 1] * 2 - add4 - add3 - add2 - add1;
-                    if (tmp < 0)
-                        tmp = 0;
-                    tone_level_idx_temp[ch][sb][j + 1] = tmp & 0xff;
-                }
-                tone_level_idx_temp[ch][sb][0] = tone_level_idx_temp[ch][sb][1];
-            }
-            acc = 0;
-            for (ch = 0; ch < nb_channels; ch++)
-                for (sb = 0; sb < 30; sb++)
-                    for (j = 0; j < 64; j++)
-                        acc += tone_level_idx_temp[ch][sb][j];
-
-            multres = 0x66666667 * (acc * 10);
-            esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> 31);
-            for (ch = 0;  ch < nb_channels; ch++)
-                for (sb = 0; sb < 30; sb++)
-                    for (j = 0; j < 64; j++) {
-                        comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
-                        if (comp < 0)
-                            comp += 0xff;
-                        comp /= 256; // signed shift
-                        switch(sb) {
-                            case 0:
-                                if (comp < 30)
-                                    comp = 30;
-                                comp += 15;
-                                break;
-                            case 1:
-                                if (comp < 24)
-                                    comp = 24;
-                                comp += 10;
-                                break;
-                            case 2:
-                            case 3:
-                            case 4:
-                                if (comp < 16)
-                                    comp = 16;
-                        }
-                        if (comp <= 5)
-                            tmp = 0;
-                        else if (comp <= 10)
-                            tmp = 10;
-                        else if (comp <= 16)
-                            tmp = 16;
-                        else if (comp <= 24)
-                            tmp = -1;
-                        else
-                            tmp = 0;
-                        coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& 0xff;
-                    }
-            for (sb = 0; sb < 30; sb++)
-                fix_coding_method_array(sb, nb_channels, coding_method);
-            for (ch = 0; ch < nb_channels; ch++)
-                for (sb = 0; sb < 30; sb++)
-                    for (j = 0; j < 64; j++)
-                        if (sb >= 10) {
-                            if (coding_method[ch][sb][j] < 10)
-                                coding_method[ch][sb][j] = 10;
-                        } else {
-                            if (sb >= 2) {
-                                if (coding_method[ch][sb][j] < 16)
-                                    coding_method[ch][sb][j] = 16;
-                            } else {
-                                if (coding_method[ch][sb][j] < 30)
-                                    coding_method[ch][sb][j] = 30;
-                            }
-                        }
-    } else { // superblocktype_2_3 != 0
-        for (ch = 0; ch < nb_channels; ch++)
-            for (sb = 0; sb < 30; sb++)
-                for (j = 0; j < 64; j++)
-                    coding_method[ch][sb][j] = coding_method_table[cm_table_select][sb];
-    }
-}
-
-/**
- *
- * Called by process_subpacket_11 to process more data from subpacket 11
- * with sb 0-8.
- * Called by process_subpacket_12 to process data from subpacket 12 with
- * sb 8-sb_used.
- *
- * @param q         context
- * @param gb        bitreader context
- * @param length    packet length in bits
- * @param sb_min    lower subband processed (sb_min included)
- * @param sb_max    higher subband processed (sb_max excluded)
- */
-static void synthfilt_build_sb_samples(QDM2Context *q, GetBitContext *gb,
-                                       int length, int sb_min, int sb_max)
-{
-    int sb, j, k, n, ch, run, channels;
-    int joined_stereo, zero_encoding;
-    int type34_first;
-    float type34_div = 0;
-    float type34_predictor;
-    float samples[10], sign_bits[16];
-
-    if (length == 0) {
-        // If no data use noise
-        for (sb=sb_min; sb < sb_max; sb++)
-            build_sb_samples_from_noise(q, sb);
-
-        return;
-    }
-
-    for (sb = sb_min; sb < sb_max; sb++) {
-        channels = q->nb_channels;
-
-        if (q->nb_channels <= 1 || sb < 12)
-            joined_stereo = 0;
-        else if (sb >= 24)
-            joined_stereo = 1;
-        else
-            joined_stereo = (get_bits_left(gb) >= 1) ? get_bits1(gb) : 0;
-
-        if (joined_stereo) {
-            if (get_bits_left(gb) >= 16)
-                for (j = 0; j < 16; j++)
-                    sign_bits[j] = get_bits1(gb);
-
-            for (j = 0; j < 64; j++)
-                if (q->coding_method[1][sb][j] > q->coding_method[0][sb][j])
-                    q->coding_method[0][sb][j] = q->coding_method[1][sb][j];
-
-            if (fix_coding_method_array(sb, q->nb_channels,
-                                            q->coding_method)) {
-                build_sb_samples_from_noise(q, sb);
-                continue;
-            }
-            channels = 1;
-        }
-
-        for (ch = 0; ch < channels; ch++) {
-            FIX_NOISE_IDX(q->noise_idx);
-            zero_encoding = (get_bits_left(gb) >= 1) ? get_bits1(gb) : 0;
-            type34_predictor = 0.0;
-            type34_first = 1;
-
-            for (j = 0; j < 128; ) {
-                switch (q->coding_method[ch][sb][j / 2]) {
-                    case 8:
-                        if (get_bits_left(gb) >= 10) {
-                            if (zero_encoding) {
-                                for (k = 0; k < 5; k++) {
-                                    if ((j + 2 * k) >= 128)
-                                        break;
-                                    samples[2 * k] = get_bits1(gb) ? dequant_1bit[joined_stereo][2 * get_bits1(gb)] : 0;
-                                }
-                            } else {
-                                n = get_bits(gb, 8);
-                                for (k = 0; k < 5; k++)
-                                    samples[2 * k] = dequant_1bit[joined_stereo][random_dequant_index[n][k]];
-                            }
-                            for (k = 0; k < 5; k++)
-                                samples[2 * k + 1] = SB_DITHERING_NOISE(sb,q->noise_idx);
-                        } else {
-                            for (k = 0; k < 10; k++)
-                                samples[k] = SB_DITHERING_NOISE(sb,q->noise_idx);
-                        }
-                        run = 10;
-                        break;
-
-                    case 10:
-                        if (get_bits_left(gb) >= 1) {
-                            float f = 0.81;
-
-                            if (get_bits1(gb))
-                                f = -f;
-                            f -= noise_samples[((sb + 1) * (j +5 * ch + 1)) & 127] * 9.0 / 40.0;
-                            samples[0] = f;
-                        } else {
-                            samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
-                        }
-                        run = 1;
-                        break;
-
-                    case 16:
-                        if (get_bits_left(gb) >= 10) {
-                            if (zero_encoding) {
-                                for (k = 0; k < 5; k++) {
-                                    if ((j + k) >= 128)
-                                        break;
-                                    samples[k] = (get_bits1(gb) == 0) ? 0 : dequant_1bit[joined_stereo][2 * get_bits1(gb)];
-                                }
-                            } else {
-                                n = get_bits (gb, 8);
-                                for (k = 0; k < 5; k++)
-                                    samples[k] = dequant_1bit[joined_stereo][random_dequant_index[n][k]];
-                            }
-                        } else {
-                            for (k = 0; k < 5; k++)
-                                samples[k] = SB_DITHERING_NOISE(sb,q->noise_idx);
-                        }
-                        run = 5;
-                        break;
-
-                    case 24:
-                        if (get_bits_left(gb) >= 7) {
-                            n = get_bits(gb, 7);
-                            for (k = 0; k < 3; k++)
-                                samples[k] = (random_dequant_type24[n][k] - 2.0) * 0.5;
-                        } else {
-                            for (k = 0; k < 3; k++)
-                                samples[k] = SB_DITHERING_NOISE(sb,q->noise_idx);
-                        }
-                        run = 3;
-                        break;
-
-                    case 30:
-                        if (get_bits_left(gb) >= 4) {
-                            unsigned index = qdm2_get_vlc(gb, &vlc_tab_type30, 0, 1);
-                            if (index < FF_ARRAY_ELEMS(type30_dequant)) {
-                                samples[0] = type30_dequant[index];
-                            } else
-                                samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
-                        } else
-                            samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
-
-                        run = 1;
-                        break;
-
-                    case 34:
-                        if (get_bits_left(gb) >= 7) {
-                            if (type34_first) {
-                                type34_div = (float)(1 << get_bits(gb, 2));
-                                samples[0] = ((float)get_bits(gb, 5) - 16.0) / 15.0;
-                                type34_predictor = samples[0];
-                                type34_first = 0;
-                            } else {
-                                unsigned index = qdm2_get_vlc(gb, &vlc_tab_type34, 0, 1);
-                                if (index < FF_ARRAY_ELEMS(type34_delta)) {
-                                    samples[0] = type34_delta[index] / type34_div + type34_predictor;
-                                    type34_predictor = samples[0];
-                                } else
-                                    samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
-                            }
-                        } else {
-                            samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
-                        }
-                        run = 1;
-                        break;
-
-                    default:
-                        samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
-                        run = 1;
-                        break;
-                }
-
-                if (joined_stereo) {
-                    for (k = 0; k < run && j + k < 128; k++) {
-                        q->sb_samples[0][j + k][sb] =
-                            q->tone_level[0][sb][(j + k) / 2] * samples[k];
-                        if (q->nb_channels == 2) {
-                            if (sign_bits[(j + k) / 8])
-                                q->sb_samples[1][j + k][sb] =
-                                    q->tone_level[1][sb][(j + k) / 2] * -samples[k];
-                            else
-                                q->sb_samples[1][j + k][sb] =
-                                    q->tone_level[1][sb][(j + k) / 2] * samples[k];
-                        }
-                    }
-                } else {
-                    for (k = 0; k < run; k++)
-                        if ((j + k) < 128)
-                            q->sb_samples[ch][j + k][sb] = q->tone_level[ch][sb][(j + k)/2] * samples[k];
-                }
-
-                j += run;
-            } // j loop
-        } // channel loop
-    } // subband loop
-}
-
-/**
- * Init the first element of a channel in quantized_coeffs with data
- * from packet 10 (quantized_coeffs[ch][0]).
- * This is similar to process_subpacket_9, but for a single channel
- * and for element [0]
- * same VLC tables as process_subpacket_9 are used.
- *
- * @param quantized_coeffs    pointer to quantized_coeffs[ch][0]
- * @param gb        bitreader context
- */
-static void init_quantized_coeffs_elem0(int8_t *quantized_coeffs,
-                                        GetBitContext *gb)
-{
-    int i, k, run, level, diff;
-
-    if (get_bits_left(gb) < 16)
-        return;
-    level = qdm2_get_vlc(gb, &vlc_tab_level, 0, 2);
-
-    quantized_coeffs[0] = level;
-
-    for (i = 0; i < 7; ) {
-        if (get_bits_left(gb) < 16)
-            break;
-        run = qdm2_get_vlc(gb, &vlc_tab_run, 0, 1) + 1;
-
-        if (get_bits_left(gb) < 16)
-            break;
-        diff = qdm2_get_se_vlc(&vlc_tab_diff, gb, 2);
-
-        for (k = 1; k <= run; k++)
-            quantized_coeffs[i + k] = (level + ((k * diff) / run));
-
-        level += diff;
-        i += run;
-    }
-}
-
-/**
- * Related to synthesis filter, process data from packet 10
- * Init part of quantized_coeffs via function init_quantized_coeffs_elem0
- * Init tone_level_idx_hi1, tone_level_idx_hi2, tone_level_idx_mid with
- * data from packet 10
- *
- * @param q         context
- * @param gb        bitreader context
- */
-static void init_tone_level_dequantization(QDM2Context *q, GetBitContext *gb)
-{
-    int sb, j, k, n, ch;
-
-    for (ch = 0; ch < q->nb_channels; ch++) {
-        init_quantized_coeffs_elem0(q->quantized_coeffs[ch][0], gb);
-
-        if (get_bits_left(gb) < 16) {
-            memset(q->quantized_coeffs[ch][0], 0, 8);
-            break;
-        }
-    }
-
-    n = q->sub_sampling + 1;
-
-    for (sb = 0; sb < n; sb++)
-        for (ch = 0; ch < q->nb_channels; ch++)
-            for (j = 0; j < 8; j++) {
-                if (get_bits_left(gb) < 1)
-                    break;
-                if (get_bits1(gb)) {
-                    for (k=0; k < 8; k++) {
-                        if (get_bits_left(gb) < 16)
-                            break;
-                        q->tone_level_idx_hi1[ch][sb][j][k] = qdm2_get_vlc(gb, &vlc_tab_tone_level_idx_hi1, 0, 2);
-                    }
-                } else {
-                    for (k=0; k < 8; k++)
-                        q->tone_level_idx_hi1[ch][sb][j][k] = 0;
-                }
-            }
-
-    n = QDM2_SB_USED(q->sub_sampling) - 4;
-
-    for (sb = 0; sb < n; sb++)
-        for (ch = 0; ch < q->nb_channels; ch++) {
-            if (get_bits_left(gb) < 16)
-                break;
-            q->tone_level_idx_hi2[ch][sb] = qdm2_get_vlc(gb, &vlc_tab_tone_level_idx_hi2, 0, 2);
-            if (sb > 19)
-                q->tone_level_idx_hi2[ch][sb] -= 16;
-            else
-                for (j = 0; j < 8; j++)
-                    q->tone_level_idx_mid[ch][sb][j] = -16;
-        }
-
-    n = QDM2_SB_USED(q->sub_sampling) - 5;
-
-    for (sb = 0; sb < n; sb++)
-        for (ch = 0; ch < q->nb_channels; ch++)
-            for (j = 0; j < 8; j++) {
-                if (get_bits_left(gb) < 16)
-                    break;
-                q->tone_level_idx_mid[ch][sb][j] = qdm2_get_vlc(gb, &vlc_tab_tone_level_idx_mid, 0, 2) - 32;
-            }
-}
-
-/**
- * Process subpacket 9, init quantized_coeffs with data from it
- *
- * @param q       context
- * @param node    pointer to node with packet
- */
-static void process_subpacket_9(QDM2Context *q, QDM2SubPNode *node)
-{
-    GetBitContext gb;
-    int i, j, k, n, ch, run, level, diff;
-
-    init_get_bits(&gb, node->packet->data, node->packet->size * 8);
-
-    n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1;
-
-    for (i = 1; i < n; i++)
-        for (ch = 0; ch < q->nb_channels; ch++) {
-            level = qdm2_get_vlc(&gb, &vlc_tab_level, 0, 2);
-            q->quantized_coeffs[ch][i][0] = level;
-
-            for (j = 0; j < (8 - 1); ) {
-                run  = qdm2_get_vlc(&gb, &vlc_tab_run, 0, 1) + 1;
-                diff = qdm2_get_se_vlc(&vlc_tab_diff, &gb, 2);
-
-                for (k = 1; k <= run; k++)
-                    q->quantized_coeffs[ch][i][j + k] = (level + ((k * diff) / run));
-
-                level += diff;
-                j     += run;
-            }
-        }
-
-    for (ch = 0; ch < q->nb_channels; ch++)
-        for (i = 0; i < 8; i++)
-            q->quantized_coeffs[ch][0][i] = 0;
-}
-
-/**
- * Process subpacket 10 if not null, else
- *
- * @param q         context
- * @param node      pointer to node with packet
- */
-static void process_subpacket_10(QDM2Context *q, QDM2SubPNode *node)
-{
-    GetBitContext gb;
-
-    if (node) {
-        init_get_bits(&gb, node->packet->data, node->packet->size * 8);
-        init_tone_level_dequantization(q, &gb);
-        fill_tone_level_array(q, 1);
-    } else {
-        fill_tone_level_array(q, 0);
-    }
-}
-
-/**
- * Process subpacket 11
- *
- * @param q         context
- * @param node      pointer to node with packet
- */
-static void process_subpacket_11(QDM2Context *q, QDM2SubPNode *node)
-{
-    GetBitContext gb;
-    int length = 0;
-
-    if (node) {
-        length = node->packet->size * 8;
-        init_get_bits(&gb, node->packet->data, length);
-    }
-
-    if (length >= 32) {
-        int c = get_bits(&gb, 13);
-
-        if (c > 3)
-            fill_coding_method_array(q->tone_level_idx,
-                                     q->tone_level_idx_temp, q->coding_method,
-                                     q->nb_channels, 8 * c,
-                                     q->superblocktype_2_3, q->cm_table_select);
-    }
-
-    synthfilt_build_sb_samples(q, &gb, length, 0, 8);
-}
-
-/**
- * Process subpacket 12
- *
- * @param q         context
- * @param node      pointer to node with packet
- */
-static void process_subpacket_12(QDM2Context *q, QDM2SubPNode *node)
-{
-    GetBitContext gb;
-    int length = 0;
-
-    if (node) {
-        length = node->packet->size * 8;
-        init_get_bits(&gb, node->packet->data, length);
-    }
-
-    synthfilt_build_sb_samples(q, &gb, length, 8, QDM2_SB_USED(q->sub_sampling));
-}
-
-/*
- * Process new subpackets for synthesis filter
- *
- * @param q       context
- * @param list    list with synthesis filter packets (list D)
- */
-static void process_synthesis_subpackets(QDM2Context *q, QDM2SubPNode *list)
-{
-    QDM2SubPNode *nodes[4];
-
-    nodes[0] = qdm2_search_subpacket_type_in_list(list, 9);
-    if (nodes[0] != NULL)
-        process_subpacket_9(q, nodes[0]);
-
-    nodes[1] = qdm2_search_subpacket_type_in_list(list, 10);
-    if (nodes[1] != NULL)
-        process_subpacket_10(q, nodes[1]);
-    else
-        process_subpacket_10(q, NULL);
-
-    nodes[2] = qdm2_search_subpacket_type_in_list(list, 11);
-    if (nodes[0] != NULL && nodes[1] != NULL && nodes[2] != NULL)
-        process_subpacket_11(q, nodes[2]);
-    else
-        process_subpacket_11(q, NULL);
-
-    nodes[3] = qdm2_search_subpacket_type_in_list(list, 12);
-    if (nodes[0] != NULL && nodes[1] != NULL && nodes[3] != NULL)
-        process_subpacket_12(q, nodes[3]);
-    else
-        process_subpacket_12(q, NULL);
-}
-
-/*
- * Decode superblock, fill packet lists.
- *
- * @param q    context
- */
-static void qdm2_decode_super_block(QDM2Context *q)
-{
-    GetBitContext gb;
-    QDM2SubPacket header, *packet;
-    int i, packet_bytes, sub_packet_size, sub_packets_D;
-    unsigned int next_index = 0;
-
-    memset(q->tone_level_idx_hi1, 0, sizeof(q->tone_level_idx_hi1));
-    memset(q->tone_level_idx_mid, 0, sizeof(q->tone_level_idx_mid));
-    memset(q->tone_level_idx_hi2, 0, sizeof(q->tone_level_idx_hi2));
-
-    q->sub_packets_B = 0;
-    sub_packets_D    = 0;
-
-    average_quantized_coeffs(q); // average elements in quantized_coeffs[max_ch][10][8]
-
-    init_get_bits(&gb, q->compressed_data, q->compressed_size * 8);
-    qdm2_decode_sub_packet_header(&gb, &header);
-
-    if (header.type < 2 || header.type >= 8) {
-        q->has_errors = 1;
-        av_log(NULL, AV_LOG_ERROR, "bad superblock type\n");
-        return;
-    }
-
-    q->superblocktype_2_3 = (header.type == 2 || header.type == 3);
-    packet_bytes          = (q->compressed_size - get_bits_count(&gb) / 8);
-
-    init_get_bits(&gb, header.data, header.size * 8);
-
-    if (header.type == 2 || header.type == 4 || header.type == 5) {
-        int csum = 257 * get_bits(&gb, 8);
-        csum += 2 * get_bits(&gb, 8);
-
-        csum = qdm2_packet_checksum(q->compressed_data, q->checksum_size, csum);
-
-        if (csum != 0) {
-            q->has_errors = 1;
-            av_log(NULL, AV_LOG_ERROR, "bad packet checksum\n");
-            return;
-        }
-    }
-
-    q->sub_packet_list_B[0].packet = NULL;
-    q->sub_packet_list_D[0].packet = NULL;
-
-    for (i = 0; i < 6; i++)
-        if (--q->fft_level_exp[i] < 0)
-            q->fft_level_exp[i] = 0;
-
-    for (i = 0; packet_bytes > 0; i++) {
-        int j;
-
-        if (i >= FF_ARRAY_ELEMS(q->sub_packet_list_A)) {
-            SAMPLES_NEEDED_2("too many packet bytes");
-            return;
-        }
-
-        q->sub_packet_list_A[i].next = NULL;
-
-        if (i > 0) {
-            q->sub_packet_list_A[i - 1].next = &q->sub_packet_list_A[i];
-
-            /* seek to next block */
-            init_get_bits(&gb, header.data, header.size * 8);
-            skip_bits(&gb, next_index * 8);
-
-            if (next_index >= header.size)
-                break;
-        }
-
-        /* decode subpacket */
-        packet = &q->sub_packets[i];
-        qdm2_decode_sub_packet_header(&gb, packet);
-        next_index      = packet->size + get_bits_count(&gb) / 8;
-        sub_packet_size = ((packet->size > 0xff) ? 1 : 0) + packet->size + 2;
-
-        if (packet->type == 0)
-            break;
-
-        if (sub_packet_size > packet_bytes) {
-            if (packet->type != 10 && packet->type != 11 && packet->type != 12)
-                break;
-            packet->size += packet_bytes - sub_packet_size;
-        }
-
-        packet_bytes -= sub_packet_size;
-
-        /* add subpacket to 'all subpackets' list */
-        q->sub_packet_list_A[i].packet = packet;
-
-        /* add subpacket to related list */
-        if (packet->type == 8) {
-            SAMPLES_NEEDED_2("packet type 8");
-            return;
-        } else if (packet->type >= 9 && packet->type <= 12) {
-            /* packets for MPEG Audio like Synthesis Filter */
-            QDM2_LIST_ADD(q->sub_packet_list_D, sub_packets_D, packet);
-        } else if (packet->type == 13) {
-            for (j = 0; j < 6; j++)
-                q->fft_level_exp[j] = get_bits(&gb, 6);
-        } else if (packet->type == 14) {
-            for (j = 0; j < 6; j++)
-                q->fft_level_exp[j] = qdm2_get_vlc(&gb, &fft_level_exp_vlc, 0, 2);
-        } else if (packet->type == 15) {
-            SAMPLES_NEEDED_2("packet type 15")
-            return;
-        } else if (packet->type >= 16 && packet->type < 48 &&
-                   !fft_subpackets[packet->type - 16]) {
-            /* packets for FFT */
-            QDM2_LIST_ADD(q->sub_packet_list_B, q->sub_packets_B, packet);
-        }
-    } // Packet bytes loop
-
-    if (q->sub_packet_list_D[0].packet != NULL) {
-        process_synthesis_subpackets(q, q->sub_packet_list_D);
-        q->do_synth_filter = 1;
-    } else if (q->do_synth_filter) {
-        process_subpacket_10(q, NULL);
-        process_subpacket_11(q, NULL);
-        process_subpacket_12(q, NULL);
-    }
-}
-
-static void qdm2_fft_init_coefficient(QDM2Context *q, int sub_packet,
-                                      int offset, int duration, int channel,
-                                      int exp, int phase)
-{
-    if (q->fft_coefs_min_index[duration] < 0)
-        q->fft_coefs_min_index[duration] = q->fft_coefs_index;
-
-    q->fft_coefs[q->fft_coefs_index].sub_packet =
-        ((sub_packet >= 16) ? (sub_packet - 16) : sub_packet);
-    q->fft_coefs[q->fft_coefs_index].channel = channel;
-    q->fft_coefs[q->fft_coefs_index].offset  = offset;
-    q->fft_coefs[q->fft_coefs_index].exp     = exp;
-    q->fft_coefs[q->fft_coefs_index].phase   = phase;
-    q->fft_coefs_index++;
-}
-
-static void qdm2_fft_decode_tones(QDM2Context *q, int duration,
-                                  GetBitContext *gb, int b)
-{
-    int channel, stereo, phase, exp;
-    int local_int_4, local_int_8, stereo_phase, local_int_10;
-    int local_int_14, stereo_exp, local_int_20, local_int_28;
-    int n, offset;
-
-    local_int_4  = 0;
-    local_int_28 = 0;
-    local_int_20 = 2;
-    local_int_8  = (4 - duration);
-    local_int_10 = 1 << (q->group_order - duration - 1);
-    offset       = 1;
-
-    while (1) {
-        if (q->superblocktype_2_3) {
-            while ((n = qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2)) < 2) {
-                offset = 1;
-                if (n == 0) {
-                    local_int_4  += local_int_10;
-                    local_int_28 += (1 << local_int_8);
-                } else {
-                    local_int_4  += 8 * local_int_10;
-                    local_int_28 += (8 << local_int_8);
-                }
-            }
-            offset += (n - 2);
-        } else {
-            offset += qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2);
-            while (offset >= (local_int_10 - 1)) {
-                offset       += (1 - (local_int_10 - 1));
-                local_int_4  += local_int_10;
-                local_int_28 += (1 << local_int_8);
-            }
-        }
-
-        if (local_int_4 >= q->group_size)
-            return;
-
-        local_int_14 = (offset >> local_int_8);
-        if (local_int_14 >= FF_ARRAY_ELEMS(fft_level_index_table))
-            return;
-
-        if (q->nb_channels > 1) {
-            channel = get_bits1(gb);
-            stereo  = get_bits1(gb);
-        } else {
-            channel = 0;
-            stereo  = 0;
-        }
-
-        exp  = qdm2_get_vlc(gb, (b ? &fft_level_exp_vlc : &fft_level_exp_alt_vlc), 0, 2);
-        exp += q->fft_level_exp[fft_level_index_table[local_int_14]];
-        exp  = (exp < 0) ? 0 : exp;
-
-        phase        = get_bits(gb, 3);
-        stereo_exp   = 0;
-        stereo_phase = 0;
-
-        if (stereo) {
-            stereo_exp   = (exp - qdm2_get_vlc(gb, &fft_stereo_exp_vlc, 0, 1));
-            stereo_phase = (phase - qdm2_get_vlc(gb, &fft_stereo_phase_vlc, 0, 1));
-            if (stereo_phase < 0)
-                stereo_phase += 8;
-        }
-
-        if (q->frequency_range > (local_int_14 + 1)) {
-            int sub_packet = (local_int_20 + local_int_28);
-
-            qdm2_fft_init_coefficient(q, sub_packet, offset, duration,
-                                      channel, exp, phase);
-            if (stereo)
-                qdm2_fft_init_coefficient(q, sub_packet, offset, duration,
-                                          1 - channel,
-                                          stereo_exp, stereo_phase);
-        }
-        offset++;
-    }
-}
-
-static void qdm2_decode_fft_packets(QDM2Context *q)
-{
-    int i, j, min, max, value, type, unknown_flag;
-    GetBitContext gb;
-
-    if (q->sub_packet_list_B[0].packet == NULL)
-        return;
-
-    /* reset minimum indexes for FFT coefficients */
-    q->fft_coefs_index = 0;
-    for (i = 0; i < 5; i++)
-        q->fft_coefs_min_index[i] = -1;
-
-    /* process subpackets ordered by type, largest type first */
-    for (i = 0, max = 256; i < q->sub_packets_B; i++) {
-        QDM2SubPacket *packet = NULL;
-
-        /* find subpacket with largest type less than max */
-        for (j = 0, min = 0; j < q->sub_packets_B; j++) {
-            value = q->sub_packet_list_B[j].packet->type;
-            if (value > min && value < max) {
-                min    = value;
-                packet = q->sub_packet_list_B[j].packet;
-            }
-        }
-
-        max = min;
-
-        /* check for errors (?) */
-        if (!packet)
-            return;
-
-        if (i == 0 &&
-            (packet->type < 16 || packet->type >= 48 ||
-             fft_subpackets[packet->type - 16]))
-            return;
-
-        /* decode FFT tones */
-        init_get_bits(&gb, packet->data, packet->size * 8);
-
-        if (packet->type >= 32 && packet->type < 48 && !fft_subpackets[packet->type - 16])
-            unknown_flag = 1;
-        else
-            unknown_flag = 0;
-
-        type = packet->type;
-
-        if ((type >= 17 && type < 24) || (type >= 33 && type < 40)) {
-            int duration = q->sub_sampling + 5 - (type & 15);
-
-            if (duration >= 0 && duration < 4)
-                qdm2_fft_decode_tones(q, duration, &gb, unknown_flag);
-        } else if (type == 31) {
-            for (j = 0; j < 4; j++)
-                qdm2_fft_decode_tones(q, j, &gb, unknown_flag);
-        } else if (type == 46) {
-            for (j = 0; j < 6; j++)
-                q->fft_level_exp[j] = get_bits(&gb, 6);
-            for (j = 0; j < 4; j++)
-                qdm2_fft_decode_tones(q, j, &gb, unknown_flag);
-        }
-    } // Loop on B packets
-
-    /* calculate maximum indexes for FFT coefficients */
-    for (i = 0, j = -1; i < 5; i++)
-        if (q->fft_coefs_min_index[i] >= 0) {
-            if (j >= 0)
-                q->fft_coefs_max_index[j] = q->fft_coefs_min_index[i];
-            j = i;
-        }
-    if (j >= 0)
-        q->fft_coefs_max_index[j] = q->fft_coefs_index;
-}
-
-static void qdm2_fft_generate_tone(QDM2Context *q, FFTTone *tone)
-{
-    float level, f[6];
-    int i;
-    QDM2Complex c;
-    const double iscale = 2.0 * M_PI / 512.0;
-
-    tone->phase += tone->phase_shift;
-
-    /* calculate current level (maximum amplitude) of tone */
-    level = fft_tone_envelope_table[tone->duration][tone->time_index] * tone->level;
-    c.im  = level * sin(tone->phase * iscale);
-    c.re  = level * cos(tone->phase * iscale);
-
-    /* generate FFT coefficients for tone */
-    if (tone->duration >= 3 || tone->cutoff >= 3) {
-        tone->complex[0].im += c.im;
-        tone->complex[0].re += c.re;
-        tone->complex[1].im -= c.im;
-        tone->complex[1].re -= c.re;
-    } else {
-        f[1] = -tone->table[4];
-        f[0] = tone->table[3] - tone->table[0];
-        f[2] = 1.0 - tone->table[2] - tone->table[3];
-        f[3] = tone->table[1] + tone->table[4] - 1.0;
-        f[4] = tone->table[0] - tone->table[1];
-        f[5] = tone->table[2];
-        for (i = 0; i < 2; i++) {
-            tone->complex[fft_cutoff_index_table[tone->cutoff][i]].re +=
-                c.re * f[i];
-            tone->complex[fft_cutoff_index_table[tone->cutoff][i]].im +=
-                c.im * ((tone->cutoff <= i) ? -f[i] : f[i]);
-        }
-        for (i = 0; i < 4; i++) {
-            tone->complex[i].re += c.re * f[i + 2];
-            tone->complex[i].im += c.im * f[i + 2];
-        }
-    }
-
-    /* copy the tone if it has not yet died out */
-    if (++tone->time_index < ((1 << (5 - tone->duration)) - 1)) {
-        memcpy(&q->fft_tones[q->fft_tone_end], tone, sizeof(FFTTone));
-        q->fft_tone_end = (q->fft_tone_end + 1) % 1000;
-    }
-}
-
-static void qdm2_fft_tone_synthesizer(QDM2Context *q, int sub_packet)
-{
-    int i, j, ch;
-    const double iscale = 0.25 * M_PI;
-
-    for (ch = 0; ch < q->channels; ch++) {
-        memset(q->fft.complex[ch], 0, q->fft_size * sizeof(QDM2Complex));
-    }
-
-
-    /* apply FFT tones with duration 4 (1 FFT period) */
-    if (q->fft_coefs_min_index[4] >= 0)
-        for (i = q->fft_coefs_min_index[4]; i < q->fft_coefs_max_index[4]; i++) {
-            float level;
-            QDM2Complex c;
-
-            if (q->fft_coefs[i].sub_packet != sub_packet)
-                break;
-
-            ch = (q->channels == 1) ? 0 : q->fft_coefs[i].channel;
-            level = (q->fft_coefs[i].exp < 0) ? 0.0 : fft_tone_level_table[q->superblocktype_2_3 ? 0 : 1][q->fft_coefs[i].exp & 63];
-
-            c.re = level * cos(q->fft_coefs[i].phase * iscale);
-            c.im = level * sin(q->fft_coefs[i].phase * iscale);
-            q->fft.complex[ch][q->fft_coefs[i].offset + 0].re += c.re;
-            q->fft.complex[ch][q->fft_coefs[i].offset + 0].im += c.im;
-            q->fft.complex[ch][q->fft_coefs[i].offset + 1].re -= c.re;
-            q->fft.complex[ch][q->fft_coefs[i].offset + 1].im -= c.im;
-        }
-
-    /* generate existing FFT tones */
-    for (i = q->fft_tone_end; i != q->fft_tone_start; ) {
-        qdm2_fft_generate_tone(q, &q->fft_tones[q->fft_tone_start]);
-        q->fft_tone_start = (q->fft_tone_start + 1) % 1000;
-    }
-
-    /* create and generate new FFT tones with duration 0 (long) to 3 (short) */
-    for (i = 0; i < 4; i++)
-        if (q->fft_coefs_min_index[i] >= 0) {
-            for (j = q->fft_coefs_min_index[i]; j < q->fft_coefs_max_index[i]; j++) {
-                int offset, four_i;
-                FFTTone tone;
-
-                if (q->fft_coefs[j].sub_packet != sub_packet)
-                    break;
-
-                four_i = (4 - i);
-                offset = q->fft_coefs[j].offset >> four_i;
-                ch = (q->channels == 1) ? 0 : q->fft_coefs[j].channel;
-
-                if (offset < q->frequency_range) {
-                    if (offset < 2)
-                        tone.cutoff = offset;
-                    else
-                        tone.cutoff = (offset >= 60) ? 3 : 2;
-
-                    tone.level = (q->fft_coefs[j].exp < 0) ? 0.0 : fft_tone_level_table[q->superblocktype_2_3 ? 0 : 1][q->fft_coefs[j].exp & 63];
-                    tone.complex = &q->fft.complex[ch][offset];
-                    tone.table = fft_tone_sample_table[i][q->fft_coefs[j].offset - (offset << four_i)];
-                    tone.phase = 64 * q->fft_coefs[j].phase - (offset << 8) - 128;
-                    tone.phase_shift = (2 * q->fft_coefs[j].offset + 1) << (7 - four_i);
-                    tone.duration = i;
-                    tone.time_index = 0;
-
-                    qdm2_fft_generate_tone(q, &tone);
-                }
-            }
-            q->fft_coefs_min_index[i] = j;
-        }
-}
-
-static void qdm2_calculate_fft(QDM2Context *q, int channel, int sub_packet)
-{
-    const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.5f : 1.0f;
-    float *out       = q->output_buffer + channel;
-    int i;
-    q->fft.complex[channel][0].re *= 2.0f;
-    q->fft.complex[channel][0].im  = 0.0f;
-    q->rdft_ctx.rdft_calc(&q->rdft_ctx, (FFTSample *)q->fft.complex[channel]);
-    /* add samples to output buffer */
-    for (i = 0; i < FFALIGN(q->fft_size, 8); i++) {
-        out[0]           += q->fft.complex[channel][i].re * gain;
-        out[q->channels] += q->fft.complex[channel][i].im * gain;
-        out              += 2 * q->channels;
-    }
-}
-
-/**
- * @param q        context
- * @param index    subpacket number
- */
-static void qdm2_synthesis_filter(QDM2Context *q, int index)
-{
-    int i, k, ch, sb_used, sub_sampling, dither_state = 0;
-
-    /* copy sb_samples */
-    sb_used = QDM2_SB_USED(q->sub_sampling);
-
-    for (ch = 0; ch < q->channels; ch++)
-        for (i = 0; i < 8; i++)
-            for (k = sb_used; k < SBLIMIT; k++)
-                q->sb_samples[ch][(8 * index) + i][k] = 0;
-
-    for (ch = 0; ch < q->nb_channels; ch++) {
-        float *samples_ptr = q->samples + ch;
-
-        for (i = 0; i < 8; i++) {
-            ff_mpa_synth_filter_float(&q->mpadsp,
-                                      q->synth_buf[ch], &(q->synth_buf_offset[ch]),
-                                      ff_mpa_synth_window_float, &dither_state,
-                                      samples_ptr, q->nb_channels,
-                                      q->sb_samples[ch][(8 * index) + i]);
-            samples_ptr += 32 * q->nb_channels;
-        }
-    }
-
-    /* add samples to output buffer */
-    sub_sampling = (4 >> q->sub_sampling);
-
-    for (ch = 0; ch < q->channels; ch++)
-        for (i = 0; i < q->frame_size; i++)
-            q->output_buffer[q->channels * i + ch] += (1 << 23) * q->samples[q->nb_channels * sub_sampling * i + ch];
-}
-
-/**
- * Init static data (does not depend on specific file)
- *
- * @param q    context
- */
-static av_cold void qdm2_init_static_data(AVCodec *codec) {
-    qdm2_init_vlc();
-    ff_mpa_synth_init_float(ff_mpa_synth_window_float);
-    softclip_table_init();
-    rnd_table_init();
-    init_noise_samples();
-}
-
-/**
- * Init parameters from codec extradata
- */
-static av_cold int qdm2_decode_init(AVCodecContext *avctx)
-{
-    QDM2Context *s = avctx->priv_data;
-    uint8_t *extradata;
-    int extradata_size;
-    int tmp_val, tmp, size;
-
-    /* extradata parsing
-
-    Structure:
-    wave {
-        frma (QDM2)
-        QDCA
-        QDCP
-    }
-
-    32  size (including this field)
-    32  tag (=frma)
-    32  type (=QDM2 or QDMC)
-
-    32  size (including this field, in bytes)
-    32  tag (=QDCA) // maybe mandatory parameters
-    32  unknown (=1)
-    32  channels (=2)
-    32  samplerate (=44100)
-    32  bitrate (=96000)
-    32  block size (=4096)
-    32  frame size (=256) (for one channel)
-    32  packet size (=1300)
-
-    32  size (including this field, in bytes)
-    32  tag (=QDCP) // maybe some tuneable parameters
-    32  float1 (=1.0)
-    32  zero ?
-    32  float2 (=1.0)
-    32  float3 (=1.0)
-    32  unknown (27)
-    32  unknown (8)
-    32  zero ?
-    */
-
-    if (!avctx->extradata || (avctx->extradata_size < 48)) {
-        av_log(avctx, AV_LOG_ERROR, "extradata missing or truncated\n");
-        return -1;
-    }
-
-    extradata      = avctx->extradata;
-    extradata_size = avctx->extradata_size;
-
-    while (extradata_size > 7) {
-        if (!memcmp(extradata, "frmaQDM", 7))
-            break;
-        extradata++;
-        extradata_size--;
-    }
-
-    if (extradata_size < 12) {
-        av_log(avctx, AV_LOG_ERROR, "not enough extradata (%i)\n",
-               extradata_size);
-        return -1;
-    }
-
-    if (memcmp(extradata, "frmaQDM", 7)) {
-        av_log(avctx, AV_LOG_ERROR, "invalid headers, QDM? not found\n");
-        return -1;
-    }
-
-    if (extradata[7] == 'C') {
-//        s->is_qdmc = 1;
-        av_log(avctx, AV_LOG_ERROR, "stream is QDMC version 1, which is not supported\n");
-        return -1;
-    }
-
-    extradata += 8;
-    extradata_size -= 8;
-
-    size = AV_RB32(extradata);
-
-    if(size > extradata_size){
-        av_log(avctx, AV_LOG_ERROR, "extradata size too small, %i < %i\n",
-               extradata_size, size);
-        return -1;
-    }
-
-    extradata += 4;
-    av_log(avctx, AV_LOG_DEBUG, "size: %d\n", size);
-    if (AV_RB32(extradata) != MKBETAG('Q','D','C','A')) {
-        av_log(avctx, AV_LOG_ERROR, "invalid extradata, expecting QDCA\n");
-        return -1;
-    }
-
-    extradata += 8;
-
-    avctx->channels = s->nb_channels = s->channels = AV_RB32(extradata);
-    extradata += 4;
-    if (s->channels <= 0 || s->channels > MPA_MAX_CHANNELS)
-        return AVERROR_INVALIDDATA;
-    avctx->channel_layout = avctx->channels == 2 ? AV_CH_LAYOUT_STEREO :
-                                                   AV_CH_LAYOUT_MONO;
-
-    avctx->sample_rate = AV_RB32(extradata);
-    extradata += 4;
-
-    avctx->bit_rate = AV_RB32(extradata);
-    extradata += 4;
-
-    s->group_size = AV_RB32(extradata);
-    extradata += 4;
-
-    s->fft_size = AV_RB32(extradata);
-    extradata += 4;
-
-    s->checksum_size = AV_RB32(extradata);
-    if (s->checksum_size >= 1U << 28) {
-        av_log(avctx, AV_LOG_ERROR, "data block size too large (%u)\n", s->checksum_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->fft_order = av_log2(s->fft_size) + 1;
-
-    // something like max decodable tones
-    s->group_order = av_log2(s->group_size) + 1;
-    s->frame_size = s->group_size / 16; // 16 iterations per super block
-    if (s->frame_size > QDM2_MAX_FRAME_SIZE)
-        return AVERROR_INVALIDDATA;
-
-    s->sub_sampling = s->fft_order - 7;
-    s->frequency_range = 255 / (1 << (2 - s->sub_sampling));
-
-    switch ((s->sub_sampling * 2 + s->channels - 1)) {
-        case 0: tmp = 40; break;
-        case 1: tmp = 48; break;
-        case 2: tmp = 56; break;
-        case 3: tmp = 72; break;
-        case 4: tmp = 80; break;
-        case 5: tmp = 100;break;
-        default: tmp=s->sub_sampling; break;
-    }
-    tmp_val = 0;
-    if ((tmp * 1000) < avctx->bit_rate)  tmp_val = 1;
-    if ((tmp * 1440) < avctx->bit_rate)  tmp_val = 2;
-    if ((tmp * 1760) < avctx->bit_rate)  tmp_val = 3;
-    if ((tmp * 2240) < avctx->bit_rate)  tmp_val = 4;
-    s->cm_table_select = tmp_val;
-
-    if (s->sub_sampling == 0)
-        tmp = 7999;
-    else
-        tmp = ((-(s->sub_sampling -1)) & 8000) + 20000;
-    /*
-    0: 7999 -> 0
-    1: 20000 -> 2
-    2: 28000 -> 2
-    */
-    if (tmp < 8000)
-        s->coeff_per_sb_select = 0;
-    else if (tmp <= 16000)
-        s->coeff_per_sb_select = 1;
-    else
-        s->coeff_per_sb_select = 2;
-
-    // Fail on unknown fft order
-    if ((s->fft_order < 7) || (s->fft_order > 9)) {
-        av_log(avctx, AV_LOG_ERROR, "Unknown FFT order (%d), contact the developers!\n", s->fft_order);
-        return -1;
-    }
-    if (s->fft_size != (1 << (s->fft_order - 1))) {
-        av_log(avctx, AV_LOG_ERROR, "FFT size %d not power of 2.\n", s->fft_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    ff_rdft_init(&s->rdft_ctx, s->fft_order, IDFT_C2R);
-    ff_mpadsp_init(&s->mpadsp);
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-
-    return 0;
-}
-
-static av_cold int qdm2_decode_close(AVCodecContext *avctx)
-{
-    QDM2Context *s = avctx->priv_data;
-
-    ff_rdft_end(&s->rdft_ctx);
-
-    return 0;
-}
-
-static int qdm2_decode(QDM2Context *q, const uint8_t *in, int16_t *out)
-{
-    int ch, i;
-    const int frame_size = (q->frame_size * q->channels);
-
-    /* select input buffer */
-    q->compressed_data = in;
-    q->compressed_size = q->checksum_size;
-
-    /* copy old block, clear new block of output samples */
-    memmove(q->output_buffer, &q->output_buffer[frame_size], frame_size * sizeof(float));
-    memset(&q->output_buffer[frame_size], 0, frame_size * sizeof(float));
-
-    /* decode block of QDM2 compressed data */
-    if (q->sub_packet == 0) {
-        q->has_errors = 0; // zero it for a new super block
-        av_log(NULL,AV_LOG_DEBUG,"Superblock follows\n");
-        qdm2_decode_super_block(q);
-    }
-
-    /* parse subpackets */
-    if (!q->has_errors) {
-        if (q->sub_packet == 2)
-            qdm2_decode_fft_packets(q);
-
-        qdm2_fft_tone_synthesizer(q, q->sub_packet);
-    }
-
-    /* sound synthesis stage 1 (FFT) */
-    for (ch = 0; ch < q->channels; ch++) {
-        qdm2_calculate_fft(q, ch, q->sub_packet);
-
-        if (!q->has_errors && q->sub_packet_list_C[0].packet != NULL) {
-            SAMPLES_NEEDED_2("has errors, and C list is not empty")
-            return -1;
-        }
-    }
-
-    /* sound synthesis stage 2 (MPEG audio like synthesis filter) */
-    if (!q->has_errors && q->do_synth_filter)
-        qdm2_synthesis_filter(q, q->sub_packet);
-
-    q->sub_packet = (q->sub_packet + 1) % 16;
-
-    /* clip and convert output float[] to 16bit signed samples */
-    for (i = 0; i < frame_size; i++) {
-        int value = (int)q->output_buffer[i];
-
-        if (value > SOFTCLIP_THRESHOLD)
-            value = (value >  HARDCLIP_THRESHOLD) ?  32767 :  softclip_table[ value - SOFTCLIP_THRESHOLD];
-        else if (value < -SOFTCLIP_THRESHOLD)
-            value = (value < -HARDCLIP_THRESHOLD) ? -32767 : -softclip_table[-value - SOFTCLIP_THRESHOLD];
-
-        out[i] = value;
-    }
-
-    return 0;
-}
-
-static int qdm2_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    QDM2Context *s = avctx->priv_data;
-    int16_t *out;
-    int i, ret;
-
-    if(!buf)
-        return 0;
-    if(buf_size < s->checksum_size)
-        return -1;
-
-    /* get output buffer */
-    frame->nb_samples = 16 * s->frame_size;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    out = (int16_t *)frame->data[0];
-
-    for (i = 0; i < 16; i++) {
-        if (qdm2_decode(s, buf, out) < 0)
-            return -1;
-        out += s->channels * s->frame_size;
-    }
-
-    *got_frame_ptr = 1;
-
-    return s->checksum_size;
-}
-
-AVCodec ff_qdm2_decoder = {
-    .name             = "qdm2",
-    .long_name        = NULL_IF_CONFIG_SMALL("QDesign Music Codec 2"),
-    .type             = AVMEDIA_TYPE_AUDIO,
-    .id               = AV_CODEC_ID_QDM2,
-    .priv_data_size   = sizeof(QDM2Context),
-    .init             = qdm2_decode_init,
-    .init_static_data = qdm2_init_static_data,
-    .close            = qdm2_decode_close,
-    .decode           = qdm2_decode_frame,
-    .capabilities     = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/qdm2_tablegen.c b/deps/libav/libavcodec/qdm2_tablegen.c
deleted file mode 100644
index 59d82df..0000000
--- a/deps/libav/libavcodec/qdm2_tablegen.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Generate a header file for hardcoded QDM2 tables
- *
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#include "qdm2_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
-    softclip_table_init();
-    rnd_table_init();
-    init_noise_samples();
-
-    write_fileheader();
-
-    WRITE_ARRAY("static const", uint16_t, softclip_table);
-    WRITE_ARRAY("static const", float, noise_table);
-    WRITE_ARRAY("static const", float, noise_samples);
-
-    WRITE_2D_ARRAY("static const", uint8_t, random_dequant_index);
-    WRITE_2D_ARRAY("static const", uint8_t, random_dequant_type24);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/qdm2_tablegen.h b/deps/libav/libavcodec/qdm2_tablegen.h
deleted file mode 100644
index bb73d92..0000000
--- a/deps/libav/libavcodec/qdm2_tablegen.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Header file for hardcoded QDM2 tables
- *
- * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_QDM2_TABLEGEN_H
-#define AVCODEC_QDM2_TABLEGEN_H
-
-#include <stdint.h>
-#include <math.h>
-#include "libavutil/attributes.h"
-
-#define SOFTCLIP_THRESHOLD 27600
-#define HARDCLIP_THRESHOLD 35716
-
-#if CONFIG_HARDCODED_TABLES
-#define softclip_table_init()
-#define rnd_table_init()
-#define init_noise_samples()
-#include "libavcodec/qdm2_tables.h"
-#else
-static uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1];
-static float noise_table[4096];
-static uint8_t random_dequant_index[256][5];
-static uint8_t random_dequant_type24[128][3];
-static float noise_samples[128];
-
-static av_cold void softclip_table_init(void) {
-    int i;
-    double dfl = SOFTCLIP_THRESHOLD - 32767;
-    float delta = 1.0 / -dfl;
-    for (i = 0; i < HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1; i++)
-        softclip_table[i] = SOFTCLIP_THRESHOLD - ((int)(sin((float)i * delta) * dfl) & 0x0000FFFF);
-}
-
-
-// random generated table
-static av_cold void rnd_table_init(void) {
-    int i,j;
-    uint32_t ldw,hdw;
-    uint64_t tmp64_1;
-    uint64_t random_seed = 0;
-    float delta = 1.0 / 16384.0;
-    for(i = 0; i < 4096 ;i++) {
-        random_seed = random_seed * 214013 + 2531011;
-        noise_table[i] = (delta * (float)(((int32_t)random_seed >> 16) & 0x00007FFF)- 1.0) * 1.3;
-    }
-
-    for (i = 0; i < 256 ;i++) {
-        random_seed = 81;
-        ldw = i;
-        for (j = 0; j < 5 ;j++) {
-            random_dequant_index[i][j] = (uint8_t)((ldw / random_seed) & 0xFF);
-            ldw = (uint32_t)ldw % (uint32_t)random_seed;
-            tmp64_1 = (random_seed * 0x55555556);
-            hdw = (uint32_t)(tmp64_1 >> 32);
-            random_seed = (uint64_t)(hdw + (ldw >> 31));
-        }
-    }
-    for (i = 0; i < 128 ;i++) {
-        random_seed = 25;
-        ldw = i;
-        for (j = 0; j < 3 ;j++) {
-            random_dequant_type24[i][j] = (uint8_t)((ldw / random_seed) & 0xFF);
-            ldw = (uint32_t)ldw % (uint32_t)random_seed;
-            tmp64_1 = (random_seed * 0x66666667);
-            hdw = (uint32_t)(tmp64_1 >> 33);
-            random_seed = hdw + (ldw >> 31);
-        }
-    }
-}
-
-
-static av_cold void init_noise_samples(void) {
-    int i;
-    unsigned random_seed = 0;
-    float delta = 1.0 / 16384.0;
-    for (i = 0; i < 128;i++) {
-        random_seed = random_seed * 214013 + 2531011;
-        noise_samples[i] = (delta * (float)((random_seed >> 16) & 0x00007fff) - 1.0);
-    }
-}
-#endif /* CONFIG_HARDCODED_TABLES */
-
-#endif /* AVCODEC_QDM2_TABLEGEN_H */
diff --git a/deps/libav/libavcodec/qdm2data.h b/deps/libav/libavcodec/qdm2data.h
deleted file mode 100644
index ad6ea88..0000000
--- a/deps/libav/libavcodec/qdm2data.h
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * QDM2 compatible decoder
- * Copyright (c) 2003 Ewald Snel
- * Copyright (c) 2005 Benjamin Larsson
- * Copyright (c) 2005 Alex Beregszaszi
- * Copyright (c) 2005 Roberto Togni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
- /**
- * @file
- * Various QDM2 tables.
- */
-
-#ifndef AVCODEC_QDM2DATA_H
-#define AVCODEC_QDM2DATA_H
-
-#include <stdint.h>
-
-/** VLC TABLES **/
-
-/* values in this table range from -1..23; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_level_huffcodes[24] = {
-    0x037c, 0x0004, 0x003c, 0x004c, 0x003a, 0x002c, 0x001c, 0x001a,
-    0x0024, 0x0014, 0x0001, 0x0002, 0x0000, 0x0003, 0x0007, 0x0005,
-    0x0006, 0x0008, 0x0009, 0x000a, 0x000c, 0x00fc, 0x007c, 0x017c
-};
-
-static const uint8_t vlc_tab_level_huffbits[24] = {
-    10, 6, 7, 7, 6, 6, 6, 6, 6, 5, 4, 4, 4, 3, 3, 3, 3, 4, 4, 5, 7, 8, 9, 10
-};
-
-/* values in this table range from -1..36; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_diff_huffcodes[37] = {
-    0x1c57, 0x0004, 0x0000, 0x0001, 0x0003, 0x0002, 0x000f, 0x000e,
-    0x0007, 0x0016, 0x0037, 0x0027, 0x0026, 0x0066, 0x0006, 0x0097,
-    0x0046, 0x01c6, 0x0017, 0x0786, 0x0086, 0x0257, 0x00d7, 0x0357,
-    0x00c6, 0x0386, 0x0186, 0x0000, 0x0157, 0x0c57, 0x0057, 0x0000,
-    0x0b86, 0x0000, 0x1457, 0x0000, 0x0457
-};
-
-static const uint8_t vlc_tab_diff_huffbits[37] = {
-    13, 3, 3, 2, 3, 3, 4, 4, 6, 5, 6, 6, 7, 7, 8, 8,
-    8, 9, 8, 11, 9, 10, 8, 10, 9, 12, 10, 0, 10, 13, 11, 0,
-    12, 0, 13, 0, 13
-};
-
-/* values in this table range from -1..5; adjust retrieved value by -1 */
-static const uint8_t vlc_tab_run_huffcodes[6] = {
-    0x1f, 0x00, 0x01, 0x03, 0x07, 0x0f
-};
-
-static const uint8_t vlc_tab_run_huffbits[6] = {
-    5, 1, 2, 3, 4, 5
-};
-
-/* values in this table range from -1..19; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_tone_level_idx_hi1_huffcodes[20] = {
-    0x5714, 0x000c, 0x0002, 0x0001, 0x0000, 0x0004, 0x0034, 0x0054,
-    0x0094, 0x0014, 0x0114, 0x0214, 0x0314, 0x0614, 0x0e14, 0x0f14,
-    0x2714, 0x0714, 0x1714, 0x3714
-};
-
-static const uint8_t vlc_tab_tone_level_idx_hi1_huffbits[20] = {
-    15, 4, 2, 1, 3, 5, 6, 7, 8, 10, 10, 11, 11, 12, 12, 12, 14, 14, 15, 14
-};
-
-/* values in this table range from -1..23; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_tone_level_idx_mid_huffcodes[24] = {
-    0x0fea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x03ea, 0x00ea, 0x002a, 0x001a,
-    0x0006, 0x0001, 0x0000, 0x0002, 0x000a, 0x006a, 0x01ea, 0x07ea
-};
-
-static const uint8_t vlc_tab_tone_level_idx_mid_huffbits[24] = {
-    12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12
-};
-
-/* values in this table range from -1..23; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_tone_level_idx_hi2_huffcodes[24] = {
-    0x0664, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0064, 0x00e4,
-    0x00a4, 0x0068, 0x0004, 0x0008, 0x0014, 0x0018, 0x0000, 0x0001,
-    0x0002, 0x0003, 0x000c, 0x0028, 0x0024, 0x0164, 0x0000, 0x0264
-};
-
-static const uint8_t vlc_tab_tone_level_idx_hi2_huffbits[24] = {
-    11, 0, 0, 0, 0, 0, 10, 8, 8, 7, 6, 6, 5, 5, 4, 2, 2, 2, 4, 7, 8, 9, 0, 11
-};
-
-/* values in this table range from -1..8; adjust retrieved value by -1 */
-static const uint8_t vlc_tab_type30_huffcodes[9] = {
-    0x3c, 0x06, 0x00, 0x01, 0x03, 0x02, 0x04, 0x0c, 0x1c
-};
-
-static const uint8_t vlc_tab_type30_huffbits[9] = {
-    6, 3, 3, 2, 2, 3, 4, 5, 6
-};
-
-/* values in this table range from -1..9; adjust retrieved value by -1 */
-static const uint8_t vlc_tab_type34_huffcodes[10] = {
-    0x18, 0x00, 0x01, 0x04, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08
-};
-
-static const uint8_t vlc_tab_type34_huffbits[10] = {
-    5, 4, 3, 3, 3, 3, 3, 3, 3, 5
-};
-
-/* values in this table range from -1..22; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_0_huffcodes[23] = {
-    0x038e, 0x0001, 0x0000, 0x0022, 0x000a, 0x0006, 0x0012, 0x0002,
-    0x001e, 0x003e, 0x0056, 0x0016, 0x000e, 0x0032, 0x0072, 0x0042,
-    0x008e, 0x004e, 0x00f2, 0x002e, 0x0036, 0x00c2, 0x018e
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_0_huffbits[23] = {
-    10, 1, 2, 6, 4, 5, 6, 7, 6, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 6, 6, 8, 10
-};
-
-/* values in this table range from -1..27; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_1_huffcodes[28] = {
-    0x07a4, 0x0001, 0x0020, 0x0012, 0x001c, 0x0008, 0x0006, 0x0010,
-    0x0000, 0x0014, 0x0004, 0x0032, 0x0070, 0x000c, 0x0002, 0x003a,
-    0x001a, 0x002c, 0x002a, 0x0022, 0x0024, 0x000a, 0x0064, 0x0030,
-    0x0062, 0x00a4, 0x01a4, 0x03a4
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_1_huffbits[28] = {
-    11, 1, 6, 6, 5, 4, 3, 6, 6, 5, 6, 6, 7, 6, 6, 6,
-    6, 6, 6, 7, 8, 6, 7, 7, 7, 9, 10, 11
-};
-
-/* values in this table range from -1..31; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_2_huffcodes[32] = {
-    0x1760, 0x0001, 0x0000, 0x0082, 0x000c, 0x0006, 0x0003, 0x0007,
-    0x0008, 0x0004, 0x0010, 0x0012, 0x0022, 0x001a, 0x0000, 0x0020,
-    0x000a, 0x0040, 0x004a, 0x006a, 0x002a, 0x0042, 0x0002, 0x0060,
-    0x00aa, 0x00e0, 0x00c2, 0x01c2, 0x0160, 0x0360, 0x0760, 0x0f60
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_2_huffbits[32] = {
-    13, 2, 0, 8, 4, 3, 3, 3, 4, 4, 5, 5, 6, 5, 7, 7,
-    7, 7, 7, 7, 8, 8, 8, 9, 8, 8, 9, 9, 10, 11, 13, 12
-};
-
-/* values in this table range from -1..34; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_3_huffcodes[35] = {
-    0x33ea, 0x0005, 0x0000, 0x000c, 0x0000, 0x0006, 0x0003, 0x0008,
-    0x0002, 0x0001, 0x0004, 0x0007, 0x001a, 0x000f, 0x001c, 0x002c,
-    0x000a, 0x001d, 0x002d, 0x002a, 0x000d, 0x004c, 0x008c, 0x006a,
-    0x00cd, 0x004d, 0x00ea, 0x020c, 0x030c, 0x010c, 0x01ea, 0x07ea,
-    0x0bea, 0x03ea, 0x13ea
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_3_huffbits[35] = {
-    14, 4, 0, 10, 4, 3, 3, 4, 4, 3, 4, 4, 5, 4, 5, 6,
-    6, 5, 6, 7, 7, 7, 8, 8, 8, 8, 9, 10, 10, 10, 10, 11,
-    12, 13, 14
-};
-
-/* values in this table range from -1..37; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_4_huffcodes[38] = {
-    0x5282, 0x0016, 0x0000, 0x0136, 0x0004, 0x0000, 0x0007, 0x000a,
-    0x000e, 0x0003, 0x0001, 0x000d, 0x0006, 0x0009, 0x0012, 0x0005,
-    0x0025, 0x0022, 0x0015, 0x0002, 0x0076, 0x0035, 0x0042, 0x00c2,
-    0x0182, 0x00b6, 0x0036, 0x03c2, 0x0482, 0x01c2, 0x0682, 0x0882,
-    0x0a82, 0x0082, 0x0282, 0x1282, 0x3282, 0x2282
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_4_huffbits[38] = {
-    15, 6, 0, 9, 3, 3, 3, 4, 4, 3, 4, 4, 5, 4, 5, 6,
-    6, 6, 6, 8, 7, 6, 8, 9, 9, 8, 9, 10, 11, 10, 11, 12,
-    12, 12, 14, 15, 14, 14
-};
-
-/** FFT TABLES **/
-
-/* values in this table range from -1..27; adjust retrieved value by -1 */
-static const uint16_t fft_level_exp_alt_huffcodes[28] = {
-    0x1ec6, 0x0006, 0x00c2, 0x0142, 0x0242, 0x0246, 0x00c6, 0x0046,
-    0x0042, 0x0146, 0x00a2, 0x0062, 0x0026, 0x0016, 0x000e, 0x0005,
-    0x0004, 0x0003, 0x0000, 0x0001, 0x000a, 0x0012, 0x0002, 0x0022,
-    0x01c6, 0x02c6, 0x06c6, 0x0ec6
-};
-
-static const uint8_t fft_level_exp_alt_huffbits[28] = {
-    13, 7, 8, 9, 10, 10, 10, 10, 10, 9, 8, 7, 6, 5, 4, 3,
-    3, 2, 3, 3, 4, 5, 7, 8, 9, 11, 12, 13
-};
-
-/* values in this table range from -1..19; adjust retrieved value by -1 */
-static const uint16_t fft_level_exp_huffcodes[20] = {
-    0x0f24, 0x0001, 0x0002, 0x0000, 0x0006, 0x0005, 0x0007, 0x000c,
-    0x000b, 0x0014, 0x0013, 0x0004, 0x0003, 0x0023, 0x0064, 0x00a4,
-    0x0024, 0x0124, 0x0324, 0x0724
-};
-
-static const uint8_t fft_level_exp_huffbits[20] = {
-    12, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 8, 9, 10, 11, 12
-};
-
-/* values in this table range from -1..6; adjust retrieved value by -1 */
-static const uint8_t fft_stereo_exp_huffcodes[7] = {
-    0x3e, 0x01, 0x00, 0x02, 0x06, 0x0e, 0x1e
-};
-
-static const uint8_t fft_stereo_exp_huffbits[7] = {
-    6, 1, 2, 3, 4, 5, 6
-};
-
-/* values in this table range from -1..8; adjust retrieved value by -1 */
-static const uint8_t fft_stereo_phase_huffcodes[9] = {
-    0x35, 0x02, 0x00, 0x01, 0x0d, 0x15, 0x05, 0x09, 0x03
-};
-
-static const uint8_t fft_stereo_phase_huffbits[9] = {
-    6, 2, 2, 4, 4, 6, 5, 4, 2
-};
-
-static const int fft_cutoff_index_table[4][2] = {
-    { 1, 2 }, {-1, 0 }, {-1,-2 }, { 0, 0 }
-};
-
-static const int16_t fft_level_index_table[256] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-};
-
-static const uint8_t last_coeff[3] = {
-    4, 7, 10
-};
-
-static const uint8_t coeff_per_sb_for_avg[3][30] = {
-    { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
-    { 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
-    { 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9 }
-};
-
-static const uint32_t dequant_table[3][10][30] = {
-    { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 256, 256, 205, 154, 102, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 51, 102, 154, 205, 256, 238, 219, 201, 183, 165, 146, 128, 110, 91, 73, 55, 37, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 18, 37, 55, 73, 91, 110, 128, 146, 165, 183, 201, 219, 238, 256, 228, 199, 171, 142, 114, 85, 57, 28 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
-    { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 256, 171, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 85, 171, 256, 171, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 85, 171, 256, 219, 183, 146, 110, 73, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 73, 110, 146, 183, 219, 256, 228, 199, 171, 142, 114, 85, 57, 28, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 57, 85, 114, 142, 171, 199, 228, 256, 213, 171, 128, 85, 43 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
-    { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 256, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 256, 171, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 85, 171, 256, 192, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 128, 192, 256, 205, 154, 102, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 102, 154, 205, 256, 213, 171, 128, 85, 43, 0, 0, 0, 0, 0, 0 },
-      { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 85, 128, 171, 213, 256, 213, 171, 128, 85, 43 } }
-};
-
-static const uint8_t coeff_per_sb_for_dequant[3][30] = {
-    { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
-    { 0, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 },
-    { 0, 1, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9 }
-};
-
-/* first index is subband, 2nd index is 0, 1 or 3 (2 is unused) */
-static const int8_t tone_level_idx_offset_table[30][4] = {
-    { -50, -50,  0, -50 },
-    { -50, -50,  0, -50 },
-    { -50,  -9,  0, -19 },
-    { -16,  -6,  0, -12 },
-    { -11,  -4,  0,  -8 },
-    {  -8,  -3,  0,  -6 },
-    {  -7,  -3,  0,  -5 },
-    {  -6,  -2,  0,  -4 },
-    {  -5,  -2,  0,  -3 },
-    {  -4,  -1,  0,  -3 },
-    {  -4,  -1,  0,  -2 },
-    {  -3,  -1,  0,  -2 },
-    {  -3,  -1,  0,  -2 },
-    {  -3,  -1,  0,  -2 },
-    {  -2,  -1,  0,  -1 },
-    {  -2,  -1,  0,  -1 },
-    {  -2,  -1,  0,  -1 },
-    {  -2,   0,  0,  -1 },
-    {  -2,   0,  0,  -1 },
-    {  -1,   0,  0,  -1 },
-    {  -1,   0,  0,  -1 },
-    {  -1,   0,  0,  -1 },
-    {  -1,   0,  0,  -1 },
-    {  -1,   0,  0,  -1 },
-    {  -1,   0,  0,  -1 },
-    {  -1,   0,  0,  -1 },
-    {  -1,   0,  0,   0 },
-    {  -1,   0,  0,   0 },
-    {  -1,   0,  0,   0 },
-    {  -1,   0,  0,   0 }
-};
-
-/* all my samples have 1st index 0 or 1 */
-/* second index is subband, only indexes 0-29 seem to be used */
-static const int8_t coding_method_table[5][30] = {
-    { 34, 30, 24, 24, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10,
-      10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
-    },
-    { 34, 30, 24, 24, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10,
-      10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
-    },
-    { 34, 30, 30, 30, 24, 24, 16, 16, 16, 16, 16, 16, 10, 10, 10,
-      10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
-    },
-    { 34, 34, 30, 30, 24, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10, 10
-    },
-    { 34, 34, 30, 30, 30, 30, 30, 30, 24, 24, 24, 24, 24, 24, 24,
-      24, 24, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
-    },
-};
-
-static const int vlc_stage3_values[60] = {
-        0,     1,     2,     3,     4,     6,     8,    10,    12,    16,    20,    24,
-       28,    36,    44,    52,    60,    76,    92,   108,   124,   156,   188,   220,
-      252,   316,   380,   444,   508,   636,   764,   892,  1020,  1276,  1532,  1788,
-     2044,  2556,  3068,  3580,  4092,  5116,  6140,  7164,  8188, 10236, 12284, 14332,
-    16380, 20476, 24572, 28668, 32764, 40956, 49148, 57340, 65532, 81916, 98300,114684
-};
-
-static const float fft_tone_sample_table[4][16][5] = {
-    { { .0100000000f,-.0037037037f,-.0020000000f,-.0069444444f,-.0018416207f },
-      { .0416666667f, .0000000000f, .0000000000f,-.0208333333f,-.0123456791f },
-      { .1250000000f, .0558035709f, .0330687836f,-.0164473690f,-.0097465888f },
-      { .1562500000f, .0625000000f, .0370370370f,-.0062500000f,-.0037037037f },
-      { .1996007860f, .0781250000f, .0462962948f, .0022727272f, .0013468013f },
-      { .2000000000f, .0625000000f, .0370370373f, .0208333333f, .0074074073f },
-      { .2127659619f, .0555555556f, .0329218097f, .0208333333f, .0123456791f },
-      { .2173913121f, .0473484844f, .0280583613f, .0347222239f, .0205761325f },
-      { .2173913121f, .0347222239f, .0205761325f, .0473484844f, .0280583613f },
-      { .2127659619f, .0208333333f, .0123456791f, .0555555556f, .0329218097f },
-      { .2000000000f, .0208333333f, .0074074073f, .0625000000f, .0370370370f },
-      { .1996007860f, .0022727272f, .0013468013f, .0781250000f, .0462962948f },
-      { .1562500000f,-.0062500000f,-.0037037037f, .0625000000f, .0370370370f },
-      { .1250000000f,-.0164473690f,-.0097465888f, .0558035709f, .0330687836f },
-      { .0416666667f,-.0208333333f,-.0123456791f, .0000000000f, .0000000000f },
-      { .0100000000f,-.0069444444f,-.0018416207f,-.0037037037f,-.0020000000f } },
-
-    { { .0050000000f,-.0200000000f, .0125000000f,-.3030303030f, .0020000000f },
-      { .1041666642f, .0400000000f,-.0250000000f, .0333333333f,-.0200000000f },
-      { .1250000000f, .0100000000f, .0142857144f,-.0500000007f,-.0200000000f },
-      { .1562500000f,-.0006250000f,-.00049382716f,-.000625000f,-.00049382716f },
-      { .1562500000f,-.0006250000f,-.00049382716f,-.000625000f,-.00049382716f },
-      { .1250000000f,-.0500000000f,-.0200000000f, .0100000000f, .0142857144f },
-      { .1041666667f, .0333333333f,-.0200000000f, .0400000000f,-.0250000000f },
-      { .0050000000f,-.3030303030f, .0020000001f,-.0200000000f, .0125000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } },
-
-    { { .1428571492f, .1250000000f,-.0285714287f,-.0357142873f, .0208333333f },
-      { .1818181818f, .0588235296f, .0333333333f, .0212765951f, .0100000000f },
-      { .1818181818f, .0212765951f, .0100000000f, .0588235296f, .0333333333f },
-      { .1428571492f,-.0357142873f, .0208333333f, .1250000000f,-.0285714287f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } },
-
-    { { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
-      { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } }
-};
-
-static const float fft_tone_level_table[2][64] = { {
-/* pow ~ (i > 46) ? 0 : (((((i & 1) ? 431 : 304) << (i >> 1))) / 1024.0); */
-    0.17677669f, 0.42677650f, 0.60355347f, 0.85355347f,
-    1.20710683f, 1.68359375f, 2.37500000f, 3.36718750f,
-    4.75000000f, 6.73437500f, 9.50000000f, 13.4687500f,
-    19.0000000f, 26.9375000f, 38.0000000f, 53.8750000f,
-    76.0000000f, 107.750000f, 152.000000f, 215.500000f,
-    304.000000f, 431.000000f, 608.000000f, 862.000000f,
-    1216.00000f, 1724.00000f, 2432.00000f, 3448.00000f,
-    4864.00000f, 6896.00000f, 9728.00000f, 13792.0000f,
-    19456.0000f, 27584.0000f, 38912.0000f, 55168.0000f,
-    77824.0000f, 110336.000f, 155648.000f, 220672.000f,
-    311296.000f, 441344.000f, 622592.000f, 882688.000f,
-    1245184.00f, 1765376.00f, 2490368.00f, 0.00000000f,
-    0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
-    0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
-    0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
-    0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
-  }, {
-/* pow = (i > 45) ? 0 : ((((i & 1) ? 431 : 304) << (i >> 1)) / 512.0); */
-    0.59375000f, 0.84179688f, 1.18750000f, 1.68359375f,
-    2.37500000f, 3.36718750f, 4.75000000f, 6.73437500f,
-    9.50000000f, 13.4687500f, 19.0000000f, 26.9375000f,
-    38.0000000f, 53.8750000f, 76.0000000f, 107.750000f,
-    152.000000f, 215.500000f, 304.000000f, 431.000000f,
-    608.000000f, 862.000000f, 1216.00000f, 1724.00000f,
-    2432.00000f, 3448.00000f, 4864.00000f, 6896.00000f,
-    9728.00000f, 13792.0000f, 19456.0000f, 27584.0000f,
-    38912.0000f, 55168.0000f, 77824.0000f, 110336.000f,
-    155648.000f, 220672.000f, 311296.000f, 441344.000f,
-    622592.000f, 882688.000f, 1245184.00f, 1765376.00f,
-    2490368.00f, 3530752.00f, 0.00000000f, 0.00000000f,
-    0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
-    0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
-    0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
-    0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f
-} };
-
-static const float fft_tone_envelope_table[4][31] = {
-    { .009607375f, .038060248f, .084265202f, .146446645f, .222214907f, .308658302f,
-      .402454883f, .500000060f, .597545207f, .691341758f, .777785182f, .853553414f,
-      .915734828f, .961939812f, .990392685f, 1.00000000f, .990392625f, .961939752f,
-      .915734768f, .853553295f, .777785063f, .691341639f, .597545087f, .500000000f,
-      .402454853f, .308658272f, .222214878f, .146446615f, .084265172f, .038060218f,
-      .009607345f },
-    { .038060248f, .146446645f, .308658302f, .500000060f, .691341758f, .853553414f,
-      .961939812f, 1.00000000f, .961939752f, .853553295f, .691341639f, .500000000f,
-      .308658272f, .146446615f, .038060218f, .000000000f, .000000000f, .000000000f,
-      .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f },
-    { .146446645f, .500000060f, .853553414f, 1.00000000f, .853553295f, .500000000f,
-      .146446615f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f },
-    { .500000060f, 1.00000000f, .500000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
-      .000000000f }
-};
-
-static const float sb_noise_attenuation[32] = {
-    0.0f, 0.0f, 0.3f, 0.4f, 0.5f, 0.7f, 1.0f, 1.0f,
-    1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
-    1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
-    1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
-};
-
-static const uint8_t fft_subpackets[32] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0
-};
-
-/* first index is joined_stereo, second index is 0 or 2 (1 is unused) */
-static const float dequant_1bit[2][3] = {
-    {-0.920000f, 0.000000f, 0.920000f },
-    {-0.890000f, 0.000000f, 0.890000f }
-};
-
-static const float type30_dequant[8] = {
-   -1.0f,-0.625f,-0.291666656732559f,0.0f,
-   0.25f,0.5f,0.75f,1.0f,
-};
-
-static const float type34_delta[10] = { // FIXME: covers 8 entries..
-    -1.0f,-0.60947573184967f,-0.333333343267441f,-0.138071194291115f,0.0f,
-    0.138071194291115f,0.333333343267441f,0.60947573184967f,1.0f,0.0f,
-};
-
-#endif /* AVCODEC_QDM2DATA_H */
diff --git a/deps/libav/libavcodec/qdrw.c b/deps/libav/libavcodec/qdrw.c
deleted file mode 100644
index c365bfd..0000000
--- a/deps/libav/libavcodec/qdrw.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * QuickDraw (qdrw) codec
- * Copyright (c) 2004 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Apple QuickDraw codec.
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf     = avpkt->data;
-    const uint8_t *buf_end = avpkt->data + avpkt->size;
-    int buf_size           = avpkt->size;
-    AVFrame * const p      = data;
-    uint8_t* outdata;
-    int colors;
-    int i, ret;
-    uint32_t *pal;
-    int r, g, b;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->key_frame = 1;
-
-    outdata = p->data[0];
-
-    if (buf_end - buf < 0x68 + 4)
-        return AVERROR_INVALIDDATA;
-    buf   += 0x68; /* jump to palette */
-    colors = AV_RB32(buf);
-    buf   += 4;
-
-    if (colors < 0 || colors > 256) {
-        av_log(avctx, AV_LOG_ERROR, "Error color count - %i(0x%X)\n", colors, colors);
-        return AVERROR_INVALIDDATA;
-    }
-    if (buf_end - buf < (colors + 1) * 8)
-        return AVERROR_INVALIDDATA;
-
-    pal = (uint32_t*)p->data[1];
-    for (i = 0; i <= colors; i++) {
-        unsigned int idx;
-        idx = AV_RB16(buf); /* color index */
-        buf += 2;
-
-        if (idx > 255) {
-            av_log(avctx, AV_LOG_ERROR, "Palette index out of range: %u\n", idx);
-            buf += 6;
-            continue;
-        }
-        r = *buf++;
-        buf++;
-        g = *buf++;
-        buf++;
-        b = *buf++;
-        buf++;
-        pal[idx] = (r << 16) | (g << 8) | b;
-    }
-    p->palette_has_changed = 1;
-
-    if (buf_end - buf < 18)
-        return AVERROR_INVALIDDATA;
-    buf += 18; /* skip unneeded data */
-    for (i = 0; i < avctx->height; i++) {
-        int size, left, code, pix;
-        const uint8_t *next;
-        uint8_t *out;
-        int tsize = 0;
-
-        /* decode line */
-        out  = outdata;
-        size = AV_RB16(buf); /* size of packed line */
-        buf += 2;
-        if (buf_end - buf < size)
-            return AVERROR_INVALIDDATA;
-
-        left = size;
-        next = buf + size;
-        while (left > 0) {
-            code = *buf++;
-            if (code & 0x80 ) { /* run */
-                pix = *buf++;
-                if ((out + (257 - code)) > (outdata +  p->linesize[0]))
-                    break;
-                memset(out, pix, 257 - code);
-                out   += 257 - code;
-                tsize += 257 - code;
-                left  -= 2;
-            } else { /* copy */
-                if ((out + code) > (outdata +  p->linesize[0]))
-                    break;
-                if (buf_end - buf < code + 1)
-                    return AVERROR_INVALIDDATA;
-                memcpy(out, buf, code + 1);
-                out   += code + 1;
-                buf   += code + 1;
-                left  -= 2 + code;
-                tsize += code + 1;
-            }
-        }
-        buf = next;
-        outdata += p->linesize[0];
-    }
-
-    *got_frame      = 1;
-
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    avctx->pix_fmt= AV_PIX_FMT_PAL8;
-
-    return 0;
-}
-
-AVCodec ff_qdraw_decoder = {
-    .name           = "qdraw",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple QuickDraw"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_QDRAW,
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/qpeg.c b/deps/libav/libavcodec/qpeg.c
deleted file mode 100644
index 4de1655..0000000
--- a/deps/libav/libavcodec/qpeg.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * QPEG codec
- * Copyright (c) 2004 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * QPEG codec.
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-typedef struct QpegContext{
-    AVCodecContext *avctx;
-    AVFrame *pic;
-    uint8_t *refdata;
-    uint32_t pal[256];
-    GetByteContext buffer;
-} QpegContext;
-
-static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst,
-                              int stride, int width, int height)
-{
-    int i;
-    int code;
-    int c0, c1;
-    int run, copy;
-    int filled = 0;
-    int rows_to_go;
-
-    rows_to_go = height;
-    height--;
-    dst = dst + height * stride;
-
-    while ((bytestream2_get_bytes_left(&qctx->buffer) > 0) && (rows_to_go > 0)) {
-        code = bytestream2_get_byte(&qctx->buffer);
-        run = copy = 0;
-        if(code == 0xFC) /* end-of-picture code */
-            break;
-        if(code >= 0xF8) { /* very long run */
-            c0 = bytestream2_get_byte(&qctx->buffer);
-            c1 = bytestream2_get_byte(&qctx->buffer);
-            run = ((code & 0x7) << 16) + (c0 << 8) + c1 + 2;
-        } else if (code >= 0xF0) { /* long run */
-            c0 = bytestream2_get_byte(&qctx->buffer);
-            run = ((code & 0xF) << 8) + c0 + 2;
-        } else if (code >= 0xE0) { /* short run */
-            run = (code & 0x1F) + 2;
-        } else if (code >= 0xC0) { /* very long copy */
-            c0 = bytestream2_get_byte(&qctx->buffer);
-            c1 = bytestream2_get_byte(&qctx->buffer);
-            copy = ((code & 0x3F) << 16) + (c0 << 8) + c1 + 1;
-        } else if (code >= 0x80) { /* long copy */
-            c0 = bytestream2_get_byte(&qctx->buffer);
-            copy = ((code & 0x7F) << 8) + c0 + 1;
-        } else { /* short copy */
-            copy = code + 1;
-        }
-
-        /* perform actual run or copy */
-        if(run) {
-            int p;
-
-            p = bytestream2_get_byte(&qctx->buffer);
-            for(i = 0; i < run; i++) {
-                dst[filled++] = p;
-                if (filled >= width) {
-                    filled = 0;
-                    dst -= stride;
-                    rows_to_go--;
-                    if(rows_to_go <= 0)
-                        break;
-                }
-            }
-        } else {
-            for(i = 0; i < copy; i++) {
-                dst[filled++] = bytestream2_get_byte(&qctx->buffer);
-                if (filled >= width) {
-                    filled = 0;
-                    dst -= stride;
-                    rows_to_go--;
-                    if(rows_to_go <= 0)
-                        break;
-                }
-            }
-        }
-    }
-}
-
-static const int qpeg_table_h[16] =
- { 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04};
-static const int qpeg_table_w[16] =
- { 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04};
-
-/* Decodes delta frames */
-static void qpeg_decode_inter(QpegContext *qctx, uint8_t *dst,
-                              int stride, int width, int height,
-                              int delta, const uint8_t *ctable,
-                              uint8_t *refdata)
-{
-    int i, j;
-    int code;
-    int filled = 0;
-    int orig_height;
-
-    /* copy prev frame */
-    for(i = 0; i < height; i++)
-        memcpy(refdata + (i * width), dst + (i * stride), width);
-
-    orig_height = height;
-    height--;
-    dst = dst + height * stride;
-
-    while ((bytestream2_get_bytes_left(&qctx->buffer) > 0) && (height >= 0)) {
-        code = bytestream2_get_byte(&qctx->buffer);
-
-        if(delta) {
-            /* motion compensation */
-            while((code & 0xF0) == 0xF0) {
-                if(delta == 1) {
-                    int me_idx;
-                    int me_w, me_h, me_x, me_y;
-                    uint8_t *me_plane;
-                    int corr, val;
-
-                    /* get block size by index */
-                    me_idx = code & 0xF;
-                    me_w = qpeg_table_w[me_idx];
-                    me_h = qpeg_table_h[me_idx];
-
-                    /* extract motion vector */
-                    corr = bytestream2_get_byte(&qctx->buffer);
-
-                    val = corr >> 4;
-                    if(val > 7)
-                        val -= 16;
-                    me_x = val;
-
-                    val = corr & 0xF;
-                    if(val > 7)
-                        val -= 16;
-                    me_y = val;
-
-                    /* check motion vector */
-                    if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
-                       (height - me_y - me_h < 0) || (height - me_y > orig_height) ||
-                       (filled + me_w > width) || (height - me_h < 0))
-                        av_log(NULL, AV_LOG_ERROR, "Bogus motion vector (%i,%i), block size %ix%i at %i,%i\n",
-                               me_x, me_y, me_w, me_h, filled, height);
-                    else {
-                        /* do motion compensation */
-                        me_plane = refdata + (filled + me_x) + (height - me_y) * width;
-                        for(j = 0; j < me_h; j++) {
-                            for(i = 0; i < me_w; i++)
-                                dst[filled + i - (j * stride)] = me_plane[i - (j * width)];
-                        }
-                    }
-                }
-                code = bytestream2_get_byte(&qctx->buffer);
-            }
-        }
-
-        if(code == 0xE0) /* end-of-picture code */
-            break;
-        if(code > 0xE0) { /* run code: 0xE1..0xFF */
-            int p;
-
-            code &= 0x1F;
-            p = bytestream2_get_byte(&qctx->buffer);
-            for(i = 0; i <= code; i++) {
-                dst[filled++] = p;
-                if(filled >= width) {
-                    filled = 0;
-                    dst -= stride;
-                    height--;
-                    if (height < 0)
-                        break;
-                }
-            }
-        } else if(code >= 0xC0) { /* copy code: 0xC0..0xDF */
-            code &= 0x1F;
-
-            for(i = 0; i <= code; i++) {
-                dst[filled++] = bytestream2_get_byte(&qctx->buffer);
-                if(filled >= width) {
-                    filled = 0;
-                    dst -= stride;
-                    height--;
-                    if (height < 0)
-                        break;
-                }
-            }
-        } else if(code >= 0x80) { /* skip code: 0x80..0xBF */
-            int skip;
-
-            code &= 0x3F;
-            /* codes 0x80 and 0x81 are actually escape codes,
-               skip value minus constant is in the next byte */
-            if(!code)
-                skip = bytestream2_get_byte(&qctx->buffer) +  64;
-            else if(code == 1)
-                skip = bytestream2_get_byte(&qctx->buffer) + 320;
-            else
-                skip = code;
-            filled += skip;
-            while( filled >= width) {
-                filled -= width;
-                dst -= stride;
-                height--;
-                if(height < 0)
-                    break;
-            }
-        } else {
-            /* zero code treated as one-pixel skip */
-            if(code) {
-                dst[filled++] = ctable[code & 0x7F];
-            }
-            else
-                filled++;
-            if(filled >= width) {
-                filled = 0;
-                dst -= stride;
-                height--;
-            }
-        }
-    }
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    uint8_t ctable[128];
-    QpegContext * const a = avctx->priv_data;
-    AVFrame * const p = a->pic;
-    uint8_t* outdata;
-    int delta, ret;
-    const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-
-    if (avpkt->size < 0x86) {
-        av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    bytestream2_init(&a->buffer, avpkt->data, avpkt->size);
-    if ((ret = ff_reget_buffer(avctx, p)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-    outdata = p->data[0];
-    bytestream2_skip(&a->buffer, 4);
-    bytestream2_get_buffer(&a->buffer, ctable, 128);
-    bytestream2_skip(&a->buffer, 1);
-
-    delta = bytestream2_get_byte(&a->buffer);
-    if(delta == 0x10) {
-        qpeg_decode_intra(a, outdata, p->linesize[0], avctx->width, avctx->height);
-    } else {
-        qpeg_decode_inter(a, outdata, p->linesize[0], avctx->width, avctx->height, delta, ctable, a->refdata);
-    }
-
-    /* make the palette available on the way out */
-    if (pal) {
-        p->palette_has_changed = 1;
-        memcpy(a->pal, pal, AVPALETTE_SIZE);
-    }
-    memcpy(p->data[1], a->pal, AVPALETTE_SIZE);
-
-    if ((ret = av_frame_ref(data, p)) < 0)
-        return ret;
-
-    *got_frame      = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    QpegContext * const a = avctx->priv_data;
-
-    av_frame_free(&a->pic);
-
-    av_free(a->refdata);
-    return 0;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx){
-    QpegContext * const a = avctx->priv_data;
-
-    a->avctx = avctx;
-    avctx->pix_fmt= AV_PIX_FMT_PAL8;
-    a->refdata = av_malloc(avctx->width * avctx->height);
-
-    a->pic = av_frame_alloc();
-    if (!a->pic) {
-        decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-AVCodec ff_qpeg_decoder = {
-    .name           = "qpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("Q-team QPEG"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_QPEG,
-    .priv_data_size = sizeof(QpegContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/qtrle.c b/deps/libav/libavcodec/qtrle.c
deleted file mode 100644
index 28f1720..0000000
--- a/deps/libav/libavcodec/qtrle.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/*
- * Quicktime Animation (RLE) Video Decoder
- * Copyright (C) 2004 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * QT RLE Video Decoder by Mike Melanson (melanson at pcisys.net)
- * For more information about the QT RLE format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *
- * The QT RLE decoder has seven modes of operation:
- * 1, 2, 4, 8, 16, 24, and 32 bits per pixel. For modes 1, 2, 4, and 8
- * the decoder outputs PAL8 colorspace data. 16-bit data yields RGB555
- * data. 24-bit data is RGB24 and 32-bit data is RGB32.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-typedef struct QtrleContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    GetByteContext g;
-    uint32_t pal[256];
-} QtrleContext;
-
-#define CHECK_PIXEL_PTR(n)                                                            \
-    if ((pixel_ptr + n > pixel_limit) || (pixel_ptr + n < 0)) {                       \
-        av_log (s->avctx, AV_LOG_ERROR, "Problem: pixel_ptr = %d, pixel_limit = %d\n",\
-                pixel_ptr + n, pixel_limit);                                          \
-        return;                                                                       \
-    }                                                                                 \
-
-static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
-{
-    int rle_code;
-    int pixel_ptr;
-    int row_inc = s->frame->linesize[0];
-    unsigned char pi0, pi1;  /* 2 8-pixel values */
-    unsigned char *rgb = s->frame->data[0];
-    int pixel_limit = s->frame->linesize[0] * s->avctx->height;
-    int skip;
-
-    row_ptr  -= row_inc;
-    pixel_ptr = row_ptr;
-    lines_to_change++;
-    while (lines_to_change) {
-        skip     =              bytestream2_get_byte(&s->g);
-        rle_code = (signed char)bytestream2_get_byte(&s->g);
-        if (rle_code == 0)
-            break;
-        if(skip & 0x80) {
-            lines_to_change--;
-            row_ptr += row_inc;
-            pixel_ptr = row_ptr + 2 * (skip & 0x7f);
-        } else
-            pixel_ptr += 2 * skip;
-        CHECK_PIXEL_PTR(0);  /* make sure pixel_ptr is positive */
-
-        if (rle_code < 0) {
-            /* decode the run length code */
-            rle_code = -rle_code;
-            /* get the next 2 bytes from the stream, treat them as groups
-             * of 8 pixels, and output them rle_code times */
-
-            pi0 = bytestream2_get_byte(&s->g);
-            pi1 = bytestream2_get_byte(&s->g);
-            CHECK_PIXEL_PTR(rle_code * 2);
-
-            while (rle_code--) {
-                rgb[pixel_ptr++] = pi0;
-                rgb[pixel_ptr++] = pi1;
-            }
-        } else {
-            /* copy the same pixel directly to output 2 times */
-            rle_code *= 2;
-            CHECK_PIXEL_PTR(rle_code);
-
-            while (rle_code--)
-                rgb[pixel_ptr++] = bytestream2_get_byte(&s->g);
-        }
-    }
-}
-
-static inline void qtrle_decode_2n4bpp(QtrleContext *s, int row_ptr,
-                                       int lines_to_change, int bpp)
-{
-    int rle_code, i;
-    int pixel_ptr;
-    int row_inc = s->frame->linesize[0];
-    unsigned char pi[16];  /* 16 palette indices */
-    unsigned char *rgb = s->frame->data[0];
-    int pixel_limit = s->frame->linesize[0] * s->avctx->height;
-    int num_pixels = (bpp == 4) ? 8 : 16;
-
-    while (lines_to_change--) {
-        pixel_ptr = row_ptr + (num_pixels * (bytestream2_get_byte(&s->g) - 1));
-        CHECK_PIXEL_PTR(0);
-
-        while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
-            if (rle_code == 0) {
-                /* there's another skip code in the stream */
-                pixel_ptr += (num_pixels * (bytestream2_get_byte(&s->g) - 1));
-                CHECK_PIXEL_PTR(0);  /* make sure pixel_ptr is positive */
-            } else if (rle_code < 0) {
-                /* decode the run length code */
-                rle_code = -rle_code;
-                /* get the next 4 bytes from the stream, treat them as palette
-                 * indexes, and output them rle_code times */
-                for (i = num_pixels-1; i >= 0; i--) {
-                    pi[num_pixels-1-i] = (bytestream2_peek_byte(&s->g) >> ((i*bpp) & 0x07)) & ((1<<bpp)-1);
-                    bytestream2_skip(&s->g, ((i & ((num_pixels>>2)-1)) == 0));
-                }
-                CHECK_PIXEL_PTR(rle_code * num_pixels);
-                while (rle_code--) {
-                    for (i = 0; i < num_pixels; i++)
-                        rgb[pixel_ptr++] = pi[i];
-                }
-            } else {
-                /* copy the same pixel directly to output 4 times */
-                rle_code *= 4;
-                CHECK_PIXEL_PTR(rle_code*(num_pixels>>2));
-                while (rle_code--) {
-                    if(bpp == 4) {
-                        int x = bytestream2_get_byte(&s->g);
-                        rgb[pixel_ptr++] = (x >> 4) & 0x0f;
-                        rgb[pixel_ptr++] =  x       & 0x0f;
-                    } else {
-                        int x = bytestream2_get_byte(&s->g);
-                        rgb[pixel_ptr++] = (x >> 6) & 0x03;
-                        rgb[pixel_ptr++] = (x >> 4) & 0x03;
-                        rgb[pixel_ptr++] = (x >> 2) & 0x03;
-                        rgb[pixel_ptr++] =  x       & 0x03;
-                    }
-                }
-            }
-        }
-        row_ptr += row_inc;
-    }
-}
-
-static void qtrle_decode_8bpp(QtrleContext *s, int row_ptr, int lines_to_change)
-{
-    int rle_code;
-    int pixel_ptr;
-    int row_inc = s->frame->linesize[0];
-    unsigned char pi1, pi2, pi3, pi4;  /* 4 palette indexes */
-    unsigned char *rgb = s->frame->data[0];
-    int pixel_limit = s->frame->linesize[0] * s->avctx->height;
-
-    while (lines_to_change--) {
-        pixel_ptr = row_ptr + (4 * (bytestream2_get_byte(&s->g) - 1));
-        CHECK_PIXEL_PTR(0);
-
-        while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
-            if (rle_code == 0) {
-                /* there's another skip code in the stream */
-                pixel_ptr += (4 * (bytestream2_get_byte(&s->g) - 1));
-                CHECK_PIXEL_PTR(0);  /* make sure pixel_ptr is positive */
-            } else if (rle_code < 0) {
-                /* decode the run length code */
-                rle_code = -rle_code;
-                /* get the next 4 bytes from the stream, treat them as palette
-                 * indexes, and output them rle_code times */
-                pi1 = bytestream2_get_byte(&s->g);
-                pi2 = bytestream2_get_byte(&s->g);
-                pi3 = bytestream2_get_byte(&s->g);
-                pi4 = bytestream2_get_byte(&s->g);
-
-                CHECK_PIXEL_PTR(rle_code * 4);
-
-                while (rle_code--) {
-                    rgb[pixel_ptr++] = pi1;
-                    rgb[pixel_ptr++] = pi2;
-                    rgb[pixel_ptr++] = pi3;
-                    rgb[pixel_ptr++] = pi4;
-                }
-            } else {
-                /* copy the same pixel directly to output 4 times */
-                rle_code *= 4;
-                CHECK_PIXEL_PTR(rle_code);
-
-                while (rle_code--) {
-                    rgb[pixel_ptr++] = bytestream2_get_byte(&s->g);
-                }
-            }
-        }
-        row_ptr += row_inc;
-    }
-}
-
-static void qtrle_decode_16bpp(QtrleContext *s, int row_ptr, int lines_to_change)
-{
-    int rle_code;
-    int pixel_ptr;
-    int row_inc = s->frame->linesize[0];
-    unsigned short rgb16;
-    unsigned char *rgb = s->frame->data[0];
-    int pixel_limit = s->frame->linesize[0] * s->avctx->height;
-
-    while (lines_to_change--) {
-        pixel_ptr = row_ptr + (bytestream2_get_byte(&s->g) - 1) * 2;
-        CHECK_PIXEL_PTR(0);
-
-        while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
-            if (rle_code == 0) {
-                /* there's another skip code in the stream */
-                pixel_ptr += (bytestream2_get_byte(&s->g) - 1) * 2;
-                CHECK_PIXEL_PTR(0);  /* make sure pixel_ptr is positive */
-            } else if (rle_code < 0) {
-                /* decode the run length code */
-                rle_code = -rle_code;
-                rgb16 = bytestream2_get_be16(&s->g);
-
-                CHECK_PIXEL_PTR(rle_code * 2);
-
-                while (rle_code--) {
-                    *(unsigned short *)(&rgb[pixel_ptr]) = rgb16;
-                    pixel_ptr += 2;
-                }
-            } else {
-                CHECK_PIXEL_PTR(rle_code * 2);
-
-                /* copy pixels directly to output */
-                while (rle_code--) {
-                    rgb16 = bytestream2_get_be16(&s->g);
-                    *(unsigned short *)(&rgb[pixel_ptr]) = rgb16;
-                    pixel_ptr += 2;
-                }
-            }
-        }
-        row_ptr += row_inc;
-    }
-}
-
-static void qtrle_decode_24bpp(QtrleContext *s, int row_ptr, int lines_to_change)
-{
-    int rle_code;
-    int pixel_ptr;
-    int row_inc = s->frame->linesize[0];
-    unsigned char r, g, b;
-    unsigned char *rgb = s->frame->data[0];
-    int pixel_limit = s->frame->linesize[0] * s->avctx->height;
-
-    while (lines_to_change--) {
-        pixel_ptr = row_ptr + (bytestream2_get_byte(&s->g) - 1) * 3;
-        CHECK_PIXEL_PTR(0);
-
-        while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
-            if (rle_code == 0) {
-                /* there's another skip code in the stream */
-                pixel_ptr += (bytestream2_get_byte(&s->g) - 1) * 3;
-                CHECK_PIXEL_PTR(0);  /* make sure pixel_ptr is positive */
-            } else if (rle_code < 0) {
-                /* decode the run length code */
-                rle_code = -rle_code;
-                r = bytestream2_get_byte(&s->g);
-                g = bytestream2_get_byte(&s->g);
-                b = bytestream2_get_byte(&s->g);
-
-                CHECK_PIXEL_PTR(rle_code * 3);
-
-                while (rle_code--) {
-                    rgb[pixel_ptr++] = r;
-                    rgb[pixel_ptr++] = g;
-                    rgb[pixel_ptr++] = b;
-                }
-            } else {
-                CHECK_PIXEL_PTR(rle_code * 3);
-
-                /* copy pixels directly to output */
-                while (rle_code--) {
-                    rgb[pixel_ptr++] = bytestream2_get_byte(&s->g);
-                    rgb[pixel_ptr++] = bytestream2_get_byte(&s->g);
-                    rgb[pixel_ptr++] = bytestream2_get_byte(&s->g);
-                }
-            }
-        }
-        row_ptr += row_inc;
-    }
-}
-
-static void qtrle_decode_32bpp(QtrleContext *s, int row_ptr, int lines_to_change)
-{
-    int rle_code;
-    int pixel_ptr;
-    int row_inc = s->frame->linesize[0];
-    unsigned int argb;
-    unsigned char *rgb = s->frame->data[0];
-    int pixel_limit = s->frame->linesize[0] * s->avctx->height;
-
-    while (lines_to_change--) {
-        pixel_ptr = row_ptr + (bytestream2_get_byte(&s->g) - 1) * 4;
-        CHECK_PIXEL_PTR(0);
-
-        while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
-            if (rle_code == 0) {
-                /* there's another skip code in the stream */
-                pixel_ptr += (bytestream2_get_byte(&s->g) - 1) * 4;
-                CHECK_PIXEL_PTR(0);  /* make sure pixel_ptr is positive */
-            } else if (rle_code < 0) {
-                /* decode the run length code */
-                rle_code = -rle_code;
-                argb = bytestream2_get_be32(&s->g);
-
-                CHECK_PIXEL_PTR(rle_code * 4);
-
-                while (rle_code--) {
-                    AV_WN32A(rgb + pixel_ptr, argb);
-                    pixel_ptr += 4;
-                }
-            } else {
-                CHECK_PIXEL_PTR(rle_code * 4);
-
-                /* copy pixels directly to output */
-                while (rle_code--) {
-                    argb = bytestream2_get_be32(&s->g);
-                    AV_WN32A(rgb + pixel_ptr, argb);
-                    pixel_ptr  += 4;
-                }
-            }
-        }
-        row_ptr += row_inc;
-    }
-}
-
-static av_cold int qtrle_decode_init(AVCodecContext *avctx)
-{
-    QtrleContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    switch (avctx->bits_per_coded_sample) {
-    case 1:
-    case 33:
-        avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
-        break;
-
-    case 2:
-    case 4:
-    case 8:
-    case 34:
-    case 36:
-    case 40:
-        avctx->pix_fmt = AV_PIX_FMT_PAL8;
-        break;
-
-    case 16:
-        avctx->pix_fmt = AV_PIX_FMT_RGB555;
-        break;
-
-    case 24:
-        avctx->pix_fmt = AV_PIX_FMT_RGB24;
-        break;
-
-    case 32:
-        avctx->pix_fmt = AV_PIX_FMT_RGB32;
-        break;
-
-    default:
-        av_log (avctx, AV_LOG_ERROR, "Unsupported colorspace: %d bits/sample?\n",
-            avctx->bits_per_coded_sample);
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int qtrle_decode_frame(AVCodecContext *avctx,
-                              void *data, int *got_frame,
-                              AVPacket *avpkt)
-{
-    QtrleContext *s = avctx->priv_data;
-    int header, start_line;
-    int height, row_ptr;
-    int has_palette = 0;
-    int ret;
-
-    bytestream2_init(&s->g, avpkt->data, avpkt->size);
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log (s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    /* check if this frame is even supposed to change */
-    if (avpkt->size < 8)
-        goto done;
-
-    /* start after the chunk size */
-    bytestream2_seek(&s->g, 4, SEEK_SET);
-
-    /* fetch the header */
-    header = bytestream2_get_be16(&s->g);
-
-    /* if a header is present, fetch additional decoding parameters */
-    if (header & 0x0008) {
-        if (avpkt->size < 14)
-            goto done;
-        start_line = bytestream2_get_be16(&s->g);
-        bytestream2_skip(&s->g, 2);
-        height     = bytestream2_get_be16(&s->g);
-        bytestream2_skip(&s->g, 2);
-    } else {
-        start_line = 0;
-        height     = s->avctx->height;
-    }
-    row_ptr = s->frame->linesize[0] * start_line;
-
-    switch (avctx->bits_per_coded_sample) {
-    case 1:
-    case 33:
-        qtrle_decode_1bpp(s, row_ptr, height);
-        break;
-
-    case 2:
-    case 34:
-        qtrle_decode_2n4bpp(s, row_ptr, height, 2);
-        has_palette = 1;
-        break;
-
-    case 4:
-    case 36:
-        qtrle_decode_2n4bpp(s, row_ptr, height, 4);
-        has_palette = 1;
-        break;
-
-    case 8:
-    case 40:
-        qtrle_decode_8bpp(s, row_ptr, height);
-        has_palette = 1;
-        break;
-
-    case 16:
-        qtrle_decode_16bpp(s, row_ptr, height);
-        break;
-
-    case 24:
-        qtrle_decode_24bpp(s, row_ptr, height);
-        break;
-
-    case 32:
-        qtrle_decode_32bpp(s, row_ptr, height);
-        break;
-
-    default:
-        av_log (s->avctx, AV_LOG_ERROR, "Unsupported colorspace: %d bits/sample?\n",
-            avctx->bits_per_coded_sample);
-        break;
-    }
-
-    if(has_palette) {
-        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-
-        if (pal) {
-            s->frame->palette_has_changed = 1;
-            memcpy(s->pal, pal, AVPALETTE_SIZE);
-        }
-
-        /* make the palette available on the way out */
-        memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
-    }
-
-done:
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-    *got_frame      = 1;
-
-    /* always report that the buffer was completely consumed */
-    return avpkt->size;
-}
-
-static av_cold int qtrle_decode_end(AVCodecContext *avctx)
-{
-    QtrleContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_qtrle_decoder = {
-    .name           = "qtrle",
-    .long_name      = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_QTRLE,
-    .priv_data_size = sizeof(QtrleContext),
-    .init           = qtrle_decode_init,
-    .close          = qtrle_decode_end,
-    .decode         = qtrle_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/qtrleenc.c b/deps/libav/libavcodec/qtrleenc.c
deleted file mode 100644
index 7c98bea..0000000
--- a/deps/libav/libavcodec/qtrleenc.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Quicktime Animation (RLE) Video Encoder
- * Copyright (C) 2007 Clemens Fruhwirth
- * Copyright (C) 2007 Alexis Ballier
- *
- * This file is based on flashsvenc.c.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-/** Maximum RLE code for bulk copy */
-#define MAX_RLE_BULK   127
-/** Maximum RLE code for repeat */
-#define MAX_RLE_REPEAT 128
-/** Maximum RLE code for skip */
-#define MAX_RLE_SKIP   254
-
-typedef struct QtrleEncContext {
-    AVCodecContext *avctx;
-    int pixel_size;
-    AVPicture previous_frame;
-    unsigned int max_buf_size;
-    /**
-     * This array will contain at ith position the value of the best RLE code
-     * if the line started at pixel i
-     * There can be 3 values :
-     * skip (0)     : skip as much as possible pixels because they are equal to the
-     *                previous frame ones
-     * repeat (<-1) : repeat that pixel -rle_code times, still as much as
-     *                possible
-     * copy (>0)    : copy the raw next rle_code pixels */
-    signed char *rlecode_table;
-    /**
-     * This array will contain the length of the best rle encoding of the line
-     * starting at ith pixel */
-    int *length_table;
-    /**
-     * Will contain at ith position the number of consecutive pixels equal to the previous
-     * frame starting from pixel i */
-    uint8_t* skip_table;
-} QtrleEncContext;
-
-static av_cold int qtrle_encode_end(AVCodecContext *avctx)
-{
-    QtrleEncContext *s = avctx->priv_data;
-
-    av_frame_free(&avctx->coded_frame);
-
-    avpicture_free(&s->previous_frame);
-    av_free(s->rlecode_table);
-    av_free(s->length_table);
-    av_free(s->skip_table);
-    return 0;
-}
-
-static av_cold int qtrle_encode_init(AVCodecContext *avctx)
-{
-    QtrleEncContext *s = avctx->priv_data;
-
-    if (av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) {
-        return -1;
-    }
-    s->avctx=avctx;
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB555BE:
-        s->pixel_size = 2;
-        break;
-    case AV_PIX_FMT_RGB24:
-        s->pixel_size = 3;
-        break;
-    case AV_PIX_FMT_ARGB:
-        s->pixel_size = 4;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unsupported colorspace.\n");
-        break;
-    }
-    avctx->bits_per_coded_sample = s->pixel_size*8;
-
-    s->rlecode_table = av_mallocz(s->avctx->width);
-    s->skip_table    = av_mallocz(s->avctx->width);
-    s->length_table  = av_mallocz((s->avctx->width + 1)*sizeof(int));
-    if (!s->skip_table || !s->length_table || !s->rlecode_table) {
-        av_log(avctx, AV_LOG_ERROR, "Error allocating memory.\n");
-        return -1;
-    }
-    if (avpicture_alloc(&s->previous_frame, avctx->pix_fmt, avctx->width, avctx->height) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error allocating picture\n");
-        return -1;
-    }
-
-    s->max_buf_size = s->avctx->width*s->avctx->height*s->pixel_size*2 /* image base material */
-                      + 15                                           /* header + footer */
-                      + s->avctx->height*2                           /* skip code+rle end */
-                      + s->avctx->width/MAX_RLE_BULK + 1             /* rle codes */;
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame) {
-        qtrle_encode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-/**
- * Compute the best RLE sequence for a line
- */
-static void qtrle_encode_line(QtrleEncContext *s, const AVFrame *p, int line, uint8_t **buf)
-{
-    int width=s->avctx->width;
-    int i;
-    signed char rlecode;
-
-    /* We will use it to compute the best bulk copy sequence */
-    unsigned int bulkcount;
-    /* This will be the number of pixels equal to the preivous frame one's
-     * starting from the ith pixel */
-    unsigned int skipcount;
-    /* This will be the number of consecutive equal pixels in the current
-     * frame, starting from the ith one also */
-    unsigned int repeatcount;
-
-    /* The cost of the three different possibilities */
-    int total_bulk_cost;
-    int total_skip_cost;
-    int total_repeat_cost;
-
-    int temp_cost;
-    int j;
-
-    uint8_t *this_line = p->               data[0] + line*p->               linesize[0] +
-        (width - 1)*s->pixel_size;
-    uint8_t *prev_line = s->previous_frame.data[0] + line*s->previous_frame.linesize[0] +
-        (width - 1)*s->pixel_size;
-
-    s->length_table[width] = 0;
-    skipcount = 0;
-
-    for (i = width - 1; i >= 0; i--) {
-
-        if (!s->avctx->coded_frame->key_frame && !memcmp(this_line, prev_line, s->pixel_size))
-            skipcount = FFMIN(skipcount + 1, MAX_RLE_SKIP);
-        else
-            skipcount = 0;
-
-        total_skip_cost  = s->length_table[i + skipcount] + 2;
-        s->skip_table[i] = skipcount;
-
-
-        if (i < width - 1 && !memcmp(this_line, this_line + s->pixel_size, s->pixel_size))
-            repeatcount = FFMIN(repeatcount + 1, MAX_RLE_REPEAT);
-        else
-            repeatcount = 1;
-
-        total_repeat_cost = s->length_table[i + repeatcount] + 1 + s->pixel_size;
-
-        /* skip code is free for the first pixel, it costs one byte for repeat and bulk copy
-         * so let's make it aware */
-        if (i == 0) {
-            total_skip_cost--;
-            total_repeat_cost++;
-        }
-
-        if (repeatcount > 1 && (skipcount == 0 || total_repeat_cost < total_skip_cost)) {
-            /* repeat is the best */
-            s->length_table[i]  = total_repeat_cost;
-            s->rlecode_table[i] = -repeatcount;
-        }
-        else if (skipcount > 0) {
-            /* skip is the best choice here */
-            s->length_table[i]  = total_skip_cost;
-            s->rlecode_table[i] = 0;
-        }
-        else {
-            /* We cannot do neither skip nor repeat
-             * thus we search for the best bulk copy to do */
-
-            int limit = FFMIN(width - i, MAX_RLE_BULK);
-
-            temp_cost = 1 + s->pixel_size + !i;
-            total_bulk_cost = INT_MAX;
-
-            for (j = 1; j <= limit; j++) {
-                if (s->length_table[i + j] + temp_cost < total_bulk_cost) {
-                    /* We have found a better bulk copy ... */
-                    total_bulk_cost = s->length_table[i + j] + temp_cost;
-                    bulkcount = j;
-                }
-                temp_cost += s->pixel_size;
-            }
-
-            s->length_table[i]  = total_bulk_cost;
-            s->rlecode_table[i] = bulkcount;
-        }
-
-        this_line -= s->pixel_size;
-        prev_line -= s->pixel_size;
-    }
-
-    /* Good ! Now we have the best sequence for this line, let's ouput it */
-
-    /* We do a special case for the first pixel so that we avoid testing it in
-     * the whole loop */
-
-    i=0;
-    this_line = p->               data[0] + line*p->linesize[0];
-
-    if (s->rlecode_table[0] == 0) {
-        bytestream_put_byte(buf, s->skip_table[0] + 1);
-        i += s->skip_table[0];
-    }
-    else bytestream_put_byte(buf, 1);
-
-
-    while (i < width) {
-        rlecode = s->rlecode_table[i];
-        bytestream_put_byte(buf, rlecode);
-        if (rlecode == 0) {
-            /* Write a skip sequence */
-            bytestream_put_byte(buf, s->skip_table[i] + 1);
-            i += s->skip_table[i];
-        }
-        else if (rlecode > 0) {
-            /* bulk copy */
-            bytestream_put_buffer(buf, this_line + i*s->pixel_size, rlecode*s->pixel_size);
-            i += rlecode;
-        }
-        else {
-            /* repeat the bits */
-            bytestream_put_buffer(buf, this_line + i*s->pixel_size, s->pixel_size);
-            i -= rlecode;
-        }
-    }
-    bytestream_put_byte(buf, -1); // end RLE line
-}
-
-/** Encode frame including header */
-static int encode_frame(QtrleEncContext *s, const AVFrame *p, uint8_t *buf)
-{
-    int i;
-    int start_line = 0;
-    int end_line = s->avctx->height;
-    uint8_t *orig_buf = buf;
-
-    if (!s->avctx->coded_frame->key_frame) {
-        unsigned line_size = s->avctx->width * s->pixel_size;
-        for (start_line = 0; start_line < s->avctx->height; start_line++)
-            if (memcmp(p->data[0] + start_line*p->linesize[0],
-                       s->previous_frame.data[0] + start_line*s->previous_frame.linesize[0],
-                       line_size))
-                break;
-
-        for (end_line=s->avctx->height; end_line > start_line; end_line--)
-            if (memcmp(p->data[0] + (end_line - 1)*p->linesize[0],
-                       s->previous_frame.data[0] + (end_line - 1)*s->previous_frame.linesize[0],
-                       line_size))
-                break;
-    }
-
-    bytestream_put_be32(&buf, 0);                         // CHUNK SIZE, patched later
-
-    if ((start_line == 0 && end_line == s->avctx->height) || start_line == s->avctx->height)
-        bytestream_put_be16(&buf, 0);                     // header
-    else {
-        bytestream_put_be16(&buf, 8);                     // header
-        bytestream_put_be16(&buf, start_line);            // starting line
-        bytestream_put_be16(&buf, 0);                     // unknown
-        bytestream_put_be16(&buf, end_line - start_line); // lines to update
-        bytestream_put_be16(&buf, 0);                     // unknown
-    }
-    for (i = start_line; i < end_line; i++)
-        qtrle_encode_line(s, p, i, &buf);
-
-    bytestream_put_byte(&buf, 0);                         // zero skip code = frame finished
-    AV_WB32(orig_buf, buf - orig_buf);                    // patch the chunk size
-    return buf - orig_buf;
-}
-
-static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                              const AVFrame *pict, int *got_packet)
-{
-    QtrleEncContext * const s = avctx->priv_data;
-    AVFrame * const p = avctx->coded_frame;
-    int ret;
-
-    if ((ret = ff_alloc_packet(pkt, s->max_buf_size)) < 0) {
-        /* Upper bound check for compressed data */
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", s->max_buf_size);
-        return ret;
-    }
-
-    if (avctx->gop_size == 0 || (s->avctx->frame_number % avctx->gop_size) == 0) {
-        /* I-Frame */
-        p->pict_type = AV_PICTURE_TYPE_I;
-        p->key_frame = 1;
-    } else {
-        /* P-Frame */
-        p->pict_type = AV_PICTURE_TYPE_P;
-        p->key_frame = 0;
-    }
-
-    pkt->size = encode_frame(s, pict, pkt->data);
-
-    /* save the current frame */
-    av_picture_copy(&s->previous_frame, (const AVPicture *)pict,
-                    avctx->pix_fmt, avctx->width, avctx->height);
-
-    if (p->key_frame)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-AVCodec ff_qtrle_encoder = {
-    .name           = "qtrle",
-    .long_name      = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_QTRLE,
-    .priv_data_size = sizeof(QtrleEncContext),
-    .init           = qtrle_encode_init,
-    .encode2        = qtrle_encode_frame,
-    .close          = qtrle_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/r210dec.c b/deps/libav/libavcodec/r210dec.c
deleted file mode 100644
index 6adaac0..0000000
--- a/deps/libav/libavcodec/r210dec.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * R210 decoder
- *
- * Copyright (c) 2009 Reimar Doeffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/bswap.h"
-#include "libavutil/common.h"
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    avctx->pix_fmt             = AV_PIX_FMT_RGB48;
-    avctx->bits_per_raw_sample = 10;
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    int h, w, ret;
-    AVFrame *pic = data;
-    const uint32_t *src = (const uint32_t *)avpkt->data;
-    int aligned_width = FFALIGN(avctx->width, 64);
-    uint8_t *dst_line;
-
-    if (avpkt->size < 4 * aligned_width * avctx->height) {
-        av_log(avctx, AV_LOG_ERROR, "packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    pic->pict_type = AV_PICTURE_TYPE_I;
-    pic->key_frame = 1;
-    dst_line = pic->data[0];
-
-    for (h = 0; h < avctx->height; h++) {
-        uint16_t *dst = (uint16_t *)dst_line;
-        for (w = 0; w < avctx->width; w++) {
-            uint32_t pixel = av_be2ne32(*src++);
-            uint16_t r, g, b;
-            if (avctx->codec_id==AV_CODEC_ID_R210) {
-                b =  pixel <<  6;
-                g = (pixel >>  4) & 0xffc0;
-                r = (pixel >> 14) & 0xffc0;
-            } else {
-                b =  pixel <<  4;
-                g = (pixel >>  6) & 0xffc0;
-                r = (pixel >> 16) & 0xffc0;
-            }
-            *dst++ = r | (r >> 10);
-            *dst++ = g | (g >> 10);
-            *dst++ = b | (b >> 10);
-        }
-        src += aligned_width - avctx->width;
-        dst_line += pic->linesize[0];
-    }
-
-    *got_frame      = 1;
-
-    return avpkt->size;
-}
-
-#if CONFIG_R210_DECODER
-AVCodec ff_r210_decoder = {
-    .name           = "r210",
-    .long_name      = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_R210,
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
-#if CONFIG_R10K_DECODER
-AVCodec ff_r10k_decoder = {
-    .name           = "r10k",
-    .long_name      = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_R10K,
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-#endif
diff --git a/deps/libav/libavcodec/ra144.c b/deps/libav/libavcodec/ra144.c
deleted file mode 100644
index 355badd..0000000
--- a/deps/libav/libavcodec/ra144.c
+++ /dev/null
@@ -1,1721 +0,0 @@
-/*
- * Real Audio 1.0 (14.4K)
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include "avcodec.h"
-#include "celp_filters.h"
-#include "mathops.h"
-#include "ra144.h"
-
-const int16_t ff_gain_val_tab[256][3] = {
-    { 541, 956,  768}, { 877, 581,  568}, { 675,1574,  635}, {1248,1464,  668},
-    {1246, 839, 1394}, {2560,1386,  991}, { 925, 687,  608}, {2208, 797, 1144},
-    { 535, 832,  799}, { 762, 605, 1154}, { 832,1122, 1003}, {1180, 687, 1176},
-    {1292, 901,  732}, {1656, 689,  896}, {1750,1248,  848}, {2284, 942, 1022},
-    { 824,1472,  643}, { 517, 765,  512}, { 562,1816, 1522}, { 694,1826, 2700},
-    { 704, 524,  672}, {1442, 757, 2232}, { 884, 551, 1266}, {2232,1007, 1692},
-    { 932, 746,  777}, {1132, 822,  926}, {1226, 771,  611}, {2948,1342, 1008},
-    {1302, 594, 1158}, {1602, 636, 1128}, {3408, 910, 1438}, {1996, 614,  575},
-    { 665, 935,  628}, { 631,1192,  829}, { 644, 926, 1052}, { 879, 988, 1226},
-    { 941,2768, 2772}, { 565,1344, 2304}, { 547, 628,  740}, { 639, 532, 1074},
-    { 955,1208,  598}, {1124,1160,  900}, {1206, 899, 1242}, { 746, 533,  624},
-    {1458,1028,  735}, {1706,1102,  692}, {1898,1018, 1004}, {2176, 988,  735},
-    {1578, 782, 1642}, { 897, 516,  754}, {2068, 702, 1656}, {2344, 818, 1526},
-    { 907, 652,  592}, {1056, 652,  642}, {2124,1416,  780}, {2664,1250,  727},
-    {1894, 727, 1108}, {2196, 657,  981}, {4840, 920, 1704}, {4992,1238,  983},
-    {2420, 909, 1094}, {2760, 935, 1032}, {2800, 612,  853}, {3068, 832,  574},
-    { 523,1796,  923}, { 722,1916, 1382}, {1226,1542,  928}, { 758, 757,  584},
-    { 512,1134,  577}, { 615,1276,  698}, { 574,2568, 2356}, { 993,2728, 3512},
-    { 539, 890,  913}, { 694, 928, 1088}, { 805, 600, 1360}, {2160, 951, 3128},
-    { 816, 950,  590}, { 955, 847,  811}, {1094, 883,  556}, {1304, 888,  604},
-    { 863,1170,  855}, {1023, 997, 1032}, { 932,1228, 1280}, { 627, 564,  573},
-    { 876, 900, 1448}, {1030, 857, 1792}, {1294, 953, 1758}, {1612, 854, 1714},
-    {1090,1166,  631}, {1314,1202,  751}, {1480, 905,  795}, {1682,1016,  568},
-    {1494,1178,  983}, { 878, 613,  526}, {1728,1446,  779}, {2136,1348,  774},
-    { 950, 649,  939}, {1180, 703,  899}, {1236, 527, 1158}, {1450, 647,  972},
-    {1282, 647,  707}, {1460, 663,  644}, {1614, 572,  578}, {3516,1222,  821},
-    {2668, 729, 1682}, {3128, 585, 1502}, {3208, 733,  976}, {6800, 871, 1416},
-    {3480, 743, 1408}, {3764, 899, 1170}, {3772, 632,  875}, {4092, 732,  638},
-    {3112, 753, 2620}, {3372, 945, 1890}, {3768, 969, 2288}, {2016, 559,  854},
-    {1736, 729,  787}, {1940, 686,  547}, {2140, 635,  674}, {4480,1272,  828},
-    {3976, 592, 1666}, {4384, 621, 1388}, {4400, 801,  955}, {4656, 522,  646},
-    {4848, 625, 1636}, {4984, 591,  874}, {5352, 535, 1001}, {11216,938, 1184},
-    { 925,3280, 1476}, { 735,1580, 1088}, {1150,1576,  674}, { 655, 783,  528},
-    { 527,2052, 1354}, { 782,1704, 1880}, { 578, 910, 1026}, { 692, 882, 1468},
-    { 586, 683,  715}, { 739, 609,  717}, { 778, 773,  697}, { 922, 785,  813},
-    { 766, 651,  984}, { 978, 596, 1030}, {1070, 757, 1080}, {1324, 687, 1178},
-    {1108,2144,  979}, { 723, 982,  690}, { 936, 956,  527}, {1180,1002,  547},
-    { 517,1306,  825}, { 832,1184,  974}, {1024, 957,  903}, {1262,1090,  906},
-    {1028, 720,  649}, {1192, 679,  694}, {2468,1480,  979}, {2844,1370,  877},
-    {1310, 835,  848}, {1508, 839,  698}, {1742,1030,  769}, {1910, 852,  573},
-    {1280, 859, 1174}, {1584, 863, 1108}, {1686, 708, 1364}, {1942, 768, 1104},
-    { 891, 536,  690}, {1016, 560,  663}, {2172, 870, 1348}, {2404, 999, 1170},
-    {1890, 966,  889}, {2116, 912,  777}, {2296,1020,  714}, {4872,1844,  932},
-    {2392, 778,  929}, {2604, 772,  744}, {2764, 957,  722}, {5832,1532,  984},
-    {2188, 519, 1264}, {2332, 532,  922}, {5064, 995, 2412}, {2708, 571,  874},
-    {2408, 545,  666}, {5016,1084,  875}, {5376, 983, 1196}, {5536, 979,  730},
-    {5344, 634, 1744}, {5688, 706, 1348}, {5912, 977, 1190}, {6072, 905,  763},
-    {6048, 582, 1526}, {11968,1013,1816}, {12864,937, 1900}, {12560,1086, 998},
-    {1998, 684, 1884}, {2504, 633, 1992}, {1252, 567,  835}, {1478, 571,  973},
-    {2620, 769, 1414}, {2808, 952, 1142}, {2908, 712, 1028}, {2976, 686,  741},
-    {1462, 552,  714}, {3296, 991, 1452}, {1590, 615,  544}, {3480,1150,  824},
-    {3212, 832,  923}, {3276, 839,  531}, {3548, 786,  852}, {3732, 764,  570},
-    {5728, 906, 2616}, {6272, 804, 2252}, {3096, 535,  876}, {3228, 598,  649},
-    {6536, 759, 1436}, {6648, 993,  846}, {6864, 567, 1210},{14016,1012, 1302},
-    {3408, 548, 1098}, {7160,1008, 1742}, {7136,1000, 1182}, {7480,1032,  836},
-    {7448, 612, 1552}, {7744, 614,  816}, {8384, 777, 1438}, {8784, 694,  786},
-    { 882,1508, 1068}, { 597, 837,  766}, {1270, 954, 1408}, { 803, 550,  798},
-    {1398,1308,  798}, {1848,1534,  738}, { 970, 675,  608}, {1264, 706,  684},
-    {1716, 767, 1126}, {2108, 765, 1404}, {2236, 924, 1003}, {2472,1048,  611},
-    { 999, 942,  963}, {1094, 857,  935}, {2936, 926, 1138}, {1934, 746,  551},
-    {3336, 633, 1762}, {3764, 701, 1454}, {1890, 564,  636}, {4096,1126,  793},
-    {3936, 556, 1140}, {3936, 540,  740}, {4216, 764,  874}, {8480,1328, 1014},
-    {2184, 515, 1042}, {4432, 934, 1344}, {4784, 945, 1112}, {5016,1062,  733},
-    {9216,1020, 2028}, {9968, 924, 1188}, {5424, 909, 1206}, {6512, 744, 1086}
-};
-
-const uint8_t ff_gain_exp_tab[256] = {
-   15, 15, 15, 15, 15, 16, 14, 15, 14, 14, 14, 14, 14, 14, 14, 14,
-   14, 13, 14, 14, 13, 14, 13, 14, 13, 13, 13, 14, 13, 13, 14, 13,
-   13, 13, 13, 13, 14, 13, 12, 12, 13, 13, 13, 12, 13, 13, 13, 13,
-   13, 12, 13, 13, 12, 12, 13, 13, 13, 13, 14, 14, 13, 13, 13, 13,
-   13, 13, 13, 12, 12, 12, 13, 13, 12, 12, 12, 13, 12, 12, 12, 12,
-   12, 12, 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12,
-   12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 13, 13, 13, 13,
-   13, 13, 13, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14,
-   13, 12, 12, 11, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-   12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 11, 11, 11, 11,
-   12, 12, 12, 12, 11, 11, 12, 12, 12, 12, 12, 13, 12, 12, 12, 13,
-   12, 12, 13, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14,
-   12, 12, 11, 11, 12, 12, 12, 12, 11, 12, 11, 12, 12, 12, 12, 12,
-   13, 13, 12, 12, 13, 13, 13, 14, 12, 13, 13, 13, 13, 13, 13, 13,
-   11, 10, 11, 10, 11, 11, 10, 10, 11, 11, 11, 11, 10,  9, 11, 10,
-   12, 12, 11, 12, 12, 12, 12, 13, 11, 12, 12, 12, 13, 13, 12, 12
-};
-
-const int8_t ff_cb1_vects[128][40]={
-    {
-     38,  -4,  15,  -4,  14, -13,  12, -11,  -2,  -6,
-     -6, -11, -45, -16, -11, -13,  -7,   6, -12,   4,
-    -20,   3, -16,  12,  -1,  12,  46,  24,   0,  33,
-     -3,   9, -12, -12,  -8,  -7,  17,  -6,   0,  -2,
-    }, {
-     60, -16,   3, -22,  10, -32,   0, -28, -17, -18,
-     -3, -25, -37, -23, -10,   3,   2,   3,   0,   3,
-    -14,   0, -14,  -1,   0,   2,  32,   9,  -1,  25,
-      7,  13,  -5,  13,   8,   1,   2,   8, -10,   6,
-    }, {
-     27, -12,  28,  -2,   6,  -7,  15,   9, -11,   1,
-    -13, -11, -40,   4, -29, -14, -19,  -5, -23,  -8,
-    -30, -13, -17,   0, -14,  12,  34,  20,  -2,  25,
-      2, -16,  -4, -12,  15,  16,  29,   7,  24,  10,
-    }, {
-     49, -24,  16, -20,   2, -26,   2,  -7, -25, -10,
-    -11, -25, -32,  -3, -27,   2,  -8,  -8, -11,  -9,
-    -24, -17, -16, -14, -13,   2,  20,   5,  -4,  17,
-     14, -12,   3,  13,  33,  25,  14,  23,  15,  19,
-    }, {
-     46,  -6,  21,   8,  -2, -16,  -5,  -8, -11,   4,
-      8,  15, -24,   4,  -2, -26,  -3, -16, -16, -14,
-     -9,  -2,  -1,   4,  19,   7,  36,  17,   9,  13,
-      0,  31,  -5, -12,   7,  -8,  11, -15, -13,  -4,
-    }, {
-     68, -18,   9,  -9,  -6, -35, -18, -25, -26,  -7,
-     10,   1, -16,  -3,  -1,  -9,   6, -19,  -4, -15,
-     -4,  -6,   0,  -8,  20,  -2,  23,   2,   7,   5,
-     12,  35,   1,  13,  24,   0,  -3,   0, -22,   4,
-    }, {
-     35, -14,  34,  10, -10, -10,  -1,  12, -20,  12,
-      0,  15, -18,  24, -20, -27, -14, -28, -27, -27,
-    -20, -19,  -2,  -8,   5,   7,  25,  13,   5,   5,
-      6,   5,   2, -12,  31,  15,  23,  -1,  12,   8,
-    }, {
-     57, -26,  22,  -7, -14, -28, -14,  -3, -35,   0,
-      3,   1, -11,  16, -18, -10,  -4, -31, -15, -28,
-    -14, -23,  -1, -21,   7,  -2,  11,  -1,   3,  -1,
-     18,   9,  10,  13,  49,  24,   8,  14,   2,  16,
-    }, {
-     25,  15,  22,  11,  18,   4,  15, -22,   8,  -2,
-    -17,  -9, -48, -20, -30, -17, -16,  11,  -1,  16,
-      2,  10,  -5,  26,  -2,  -4,  22,   0,   2,  10,
-     -6,  13, -14,  10, -23,   0,  10,  -2,   1,   0,
-    }, {
-     47,   3,  11,  -6,  15, -13,   2, -38,  -6, -13,
-    -15, -22, -40, -28, -28,   0,  -5,   8,  10,  15,
-      7,   7,  -4,  13,  -1, -14,   9, -14,   0,   2,
-      4,  18,  -7,  36,  -6,   8,  -3,  13,  -7,   8,
-    }, {
-     14,   7,  36,  13,  10,  10,  18,   0,   0,   5,
-    -25,  -8, -43,   0, -48, -18, -27,   0, -12,   3,
-     -7,  -6,  -7,  13, -15,  -5,  11,  -3,   0,   2,
-      0, -12,  -6,  10,   0,  23,  22,  11,  26,  12,
-    }, {
-     36,  -5,  24,  -4,   7,  -7,   6, -17, -14,  -5,
-    -22, -22, -35,  -8, -46,  -1, -17,  -3,   0,   2,
-     -2, -10,  -5,   0, -14, -15,  -2, -18,  -2,  -4,
-     11,  -7,   1,  36,  18,  32,   7,  27,  17,  20,
-    }, {
-     33,  13,  29,  24,   1,   1,  -2, -18,   0,   9,
-     -3,  17, -27,   0, -21, -30, -12, -11,  -5,  -2,
-     12,   4,   9,  19,  18,  -9,  13,  -6,  11,  -8,
-     -2,  35,  -8,  10,  -7,  -1,   4, -11, -10,  -2,
-    }, {
-     55,   1,  17,   6,  -1, -16, -15, -35, -15,  -2,
-      0,   4, -19,  -8, -20, -13,  -1, -14,   7,  -3,
-     18,   0,  10,   5,  19, -19,   0, -21,   8, -16,
-      9,  39,   0,  36,  10,   7,  -9,   4, -20,   5,
-    }, {
-     22,   5,  42,  26,  -6,   8,   1,   2,  -9,  17,
-    -10,  18, -21,  19, -39, -31, -23, -23, -16, -15,
-      2, -12,   7,   6,   5,  -9,   1, -10,   7, -16,
-      4,   9,   0,  10,  17,  22,  16,   2,  14,   9,
-    }, {
-     44,  -6,  30,   8,  -9, -10, -11, -14, -23,   5,
-     -8,   4, -14,  12, -37, -14, -12, -26,  -4, -16,
-      8, -16,   9,  -7,   6, -19, -12, -25,   5, -24,
-     15,  13,   8,  36,  34,  31,   1,  18,   4,  18,
-    }, {
-     -3,  -5,  -9,  -7,  15,  -1,   5,  13,   2,  12,
-      5,   2, -21, -23,  -2, -16,   0,   5,  -6,  13,
-    -23,   3, -32,  10, -15,   8,  44,  28,   9,  37,
-     -2,  13,  -9, -15, -12, -27,  -7, -12,   0, -11,
-    }, {
-     18, -17, -21, -25,  11, -19,  -6,  -3, -11,   0,
-      7, -11, -13, -31,  -1,   0,   9,   1,   5,  12,
-    -18,   0, -31,  -2, -13,  -1,  30,  14,   7,  29,
-      9,  18,  -1,  10,   4, -18, -22,   3, -10,  -2,
-    }, {
-    -13, -13,   3,  -5,   7,   4,   9,  34,  -5,  20,
-     -2,   3, -16,  -3, -20, -17, -11,  -7, -17,   0,
-    -34, -13, -33,  -2, -28,   8,  32,  24,   5,  29,
-      3, -12,   0, -15,  11,  -3,   3,   2,  24,   1,
-    }, {
-      8, -25,  -8, -23,   3, -13,  -3,  17, -20,   8,
-      0, -10,  -8, -11, -18,   0,  -1, -10,  -5,   0,
-    -28, -17, -32, -15, -26,  -1,  19,   9,   3,  21,
-     15,  -7,   6,   9,  29,   5, -10,  17,  15,   9,
-    }, {
-      4,  -6,  -3,   5,  -1,  -4, -11,  16,  -6,  23,
-     19,  29,   0,  -3,   6, -30,   3, -17, -10,  -5,
-    -13,  -2, -17,   3,   5,   3,  35,  21,  17,  17,
-      2,  35,  -2, -15,   3, -28, -13, -21, -13, -13,
-    }, {
-     26, -19, -15, -12,  -5, -22, -24,   0, -21,  12,
-     21,  15,   8, -11,   7, -12,  14, -20,   2,  -6,
-     -7,  -6, -16,  -9,   6,  -5,  21,   7,  15,  10,
-     13,  39,   5,  10,  20, -19, -28,  -5, -22,  -5,
-    }, {
-     -5, -15,   9,   7,  -9,   2,  -8,  37, -14,  31,
-     11,  29,   5,  16, -11, -30,  -7, -29, -21, -18,
-    -23, -19, -18,  -9,  -7,   3,  23,  17,  14,   9,
-      8,   9,   6, -15,  27,  -4,  -2,  -6,  12,  -1,
-    }, {
-     16, -27,  -2, -10, -13, -16, -20,  20, -29,  20,
-     14,  16,  13,   8,  -9, -13,   2, -33,  -9, -19,
-    -17, -23, -17, -22,  -6,  -6,   9,   2,  12,   2,
-     20,  13,  13,  10,  45,   4, -16,   8,   2,   7,
-    }, {
-    -16,  14,  -2,   8,  20,  17,   9,   2,  14,  16,
-     -6,   5, -24, -28, -21, -20,  -8,   9,   4,  25,
-     -1,  11, -22,  24, -15,  -8,  21,   5,  11,  14,
-     -5,  18, -11,   7, -27, -20, -14,  -7,   1,  -9,
-    }, {
-      6,   2, -14,  -9,  16,  -1,  -3, -14,   0,   5,
-     -3,  -8, -16, -36, -19,  -3,   1,   6,  17,  24,
-      4,   7, -21,  11, -14, -18,   7,  -9,   9,   7,
-      6,  22,  -3,  33, -10, -11, -28,   7,  -7,   0,
-    }, {
-    -26,   6,  11,  10,  12,  23,  12,  23,   5,  24,
-    -13,   5, -19,  -8, -38, -21, -20,  -2,  -6,  12,
-    -11,  -5, -23,  11, -29,  -9,   9,   0,   7,   6,
-      1,  -7,  -2,   7,  -3,   3,  -2,   6,  27,   3,
-    }, {
-     -4,  -6,   0,  -7,   8,   4,   0,   6,  -9,  13,
-    -11,  -7, -11, -15, -37,  -4,  -9,  -5,   5,  11,
-     -5,  -9, -22,  -1, -27, -18,  -4, -14,   5,   0,
-     12,  -3,   4,  32,  14,  12, -17,  22,  17,  11,
-    }, {
-     -8,  12,   3,  21,   3,  14,  -8,   5,   4,  28,
-      7,  32,  -2,  -8, -12, -34,  -4, -12,   1,   6,
-      9,   4,  -7,  17,   4, -13,  11,  -1,  19,  -4,
-      0,  39,  -4,   7, -11, -21, -20, -16, -10, -11,
-    }, {
-     13,   0,  -8,   3,   0,  -4, -21, -11,  -9,  16,
-     10,  18,   5, -16, -10, -16,   5, -15,  13,   5,
-     15,   1,  -6,   4,   6, -23,  -2, -16,  17, -12,
-     10,  44,   3,  33,   6, -12, -34,  -1, -20,  -3,
-    }, {
-    -18,   4,  17,  23,  -4,  20,  -4,  26,  -3,  36,
-      0,  32,   2,  12, -29, -34, -16, -24, -10,  -6,
-      0, -12,  -8,   4,  -8, -13,   0,  -6,  16, -12,
-      5,  13,   3,   7,  13,   3,  -8,  -2,  14,   0,
-    }, {
-      3,  -7,   5,   5,  -8,   2, -17,   9, -18,  24,
-      2,  19,  10,   4, -28, -17,  -5, -28,   2,  -7,
-      4, -15,  -7,  -8,  -6, -23, -13, -21,  14, -20,
-     17,  18,  11,  33,  30,  11, -23,  13,   5,   9,
-    }, {
-     60,  10,   7,  -1,   9,  -8,   6, -13,   2, -15,
-     -1, -10, -13, -11,  15,   0,   6,   9,  -1,   0,
-    -13,   1, -11,  -3, -13,  21,  13,  26,  -7,  31,
-    -10,  -7, -16, -33, -31, -10,  22,  -8,   1,  -2,
-    }, {
-     82,  -1,  -4, -19,   6, -27,  -6, -29, -12, -26,
-      1, -24,  -5, -18,  17,  17,  17,   6,  10,   0,
-     -7,  -2,  -9, -16, -12,  11,   0,  11,  -9,  23,
-      0,  -3,  -8,  -8, -13,  -1,   8,   7,  -7,   6,
-    }, {
-     49,   2,  21,   0,   1,  -2,   9,   8,  -6,  -6,
-     -8, -10,  -8,   9,  -2,   0,  -4,  -2, -13, -12,
-    -23, -15, -12, -16, -26,  21,   2,  21, -11,  23,
-     -4, -33,  -7, -33,  -6,  13,  34,   5,  27,  10,
-    }, {
-     71, -10,   9, -17,  -1, -20,  -3,  -8, -21, -18,
-     -6, -24,   0,   1,   0,  16,   6,  -5,   0, -13,
-    -17, -19, -11, -29, -25,  11, -11,   6, -13,  15,
-      7, -29,   0,  -8,  11,  22,  20,  21,  17,  18,
-    }, {
-     67,   8,  14,  11,  -7, -11, -11,  -9,  -7,  -3,
-     13,  16,   8,   9,  24, -12,  10, -13,  -5, -17,
-     -2,  -4,   3, -10,   6,  17,   4,  19,   0,  11,
-     -6,  13,  -9, -33, -14, -10,  16, -17, -10,  -4,
-    }, {
-     90,  -3,   2,  -6, -10, -29, -24, -26, -21, -15,
-     15,   2,  16,   1,  25,   4,  21, -16,   6, -18,
-      3,  -8,   5, -24,   8,   7,  -9,   4,  -1,   3,
-      5,  18,  -1,  -7,   2,  -1,   2,  -1, -19,   3,
-    }, {
-     57,   0,  27,  13, -14,  -5,  -7,  11, -15,   4,
-      5,  16,  13,  29,   6, -13,   0, -25, -16, -31,
-    -12, -22,   2, -23,  -6,  16,  -7,  14,  -2,   3,
-      0, -12,   0, -33,   9,  13,  28,  -3,  14,   7,
-    }, {
-     79, -11,  15,  -4, -18, -23, -20,  -5, -30,  -7,
-      7,   2,  21,  21,   8,   3,  10, -28,  -4, -31,
-     -6, -25,   3, -37,  -4,   7, -20,   0,  -4,  -4,
-     11,  -7,   6,  -8,  27,  22,  14,  12,   5,  16,
-    }, {
-     47,  30,  15,  14,  14,   9,   9, -23,  13, -10,
-    -12,  -7, -16, -15,  -3,  -3,  -1,  14,   9,  12,
-      9,   8,   0,  10, -14,   4,  -9,   2,  -5,   8,
-    -13,  -3, -18, -10, -45,  -3,  16,  -4,   4,   0,
-    }, {
-     69,  17,   3,  -3,  10,  -8,  -3, -40,  -1, -21,
-    -10, -21,  -8, -23,  -1,  13,   8,  11,  21,  11,
-     15,   4,   0,  -2, -13,  -5, -23, -12,  -7,   0,
-     -1,   0, -10,  14, -28,   5,   1,  11,  -5,   7,
-    }, {
-     36,  21,  28,  16,   6,  16,  12,  -2,   4,  -2,
-    -20,  -7, -11,   4, -20,  -4, -12,   2,  -1,   0,
-      0,  -8,  -2,  -2, -27,   4, -21,  -2,  -9,   0,
-     -6, -29,  -9, -10, -21,  21,  28,  10,  29,  11,
-    }, {
-     58,   9,  16,  -1,   2,  -2,   0, -19, -10, -13,
-    -17, -21,  -3,  -3, -19,  12,  -2,   0,  10,  -1,
-      5, -12,   0, -15, -26,  -5, -34, -16, -11,  -7,
-      4, -25,  -2,  14,  -3,  29,  13,  25,  20,  20,
-    }, {
-     55,  28,  21,  27,  -2,   7,  -8, -20,   4,   1,
-      1,  18,   5,   4,   5, -16,   2,  -8,   5,  -5,
-     19,   2,  14,   3,   6,   0, -18,  -4,   2, -11,
-     -8,  18, -11, -10, -29,  -3,  10, -13,  -8,  -3,
-    }, {
-     77,  16,   9,   9,  -6, -11, -21, -37, -10, -10,
-      4,   5,  13,  -3,   7,   0,  13, -11,  17,  -6,
-     25,  -1,  15,  -9,   7,  -9, -32, -19,   0, -18,
-      2,  22,  -3,  15, -12,   5,  -4,   2, -17,   5,
-    }, {
-     44,  20,  34,  29, -10,  13,  -4,   0,  -4,   9,
-     -5,  19,  10,  24, -11, -17,  -8, -20,  -5, -19,
-      9, -14,  12,  -9,  -6,   0, -30,  -9,   0, -19,
-     -2,  -7,  -2, -10,  -5,  20,  21,   1,  17,   9,
-    }, {
-     66,   8,  23,  11, -14,  -5, -17, -16, -19,  -2,
-     -3,   5,  18,  17, -10,   0,   1, -23,   6, -20,
-     15, -18,  14, -22,  -5, -10, -44, -23,  -2, -26,
-      9,  -3,   4,  14,  12,  29,   7,  16,   7,  18,
-    }, {
-     18,   9, -17,  -4,  11,   3,   0,  11,   7,   4,
-     10,   3,  10, -18,  24,  -3,  14,   7,   4,  10,
-    -16,   1, -27,  -4, -27,  17,  12,  30,   0,  35,
-     -9,  -3, -12, -36, -35, -30,  -2, -13,   2, -11,
-    }, {
-     40,  -2, -29, -22,   7, -14, -12,  -5,  -7,  -7,
-     12,  -9,  18, -26,  26,  14,  24,   4,  16,   9,
-    -10,  -2, -26, -18, -26,   7,  -1,  15,  -1,  27,
-      2,   0,  -4, -11, -17, -21, -16,   1,  -7,  -3,
-    }, {
-      8,   1,  -3,  -2,   3,  10,   3,  32,  -1,  12,
-      2,   4,  15,   1,   7,  -3,   2,  -4,  -6,  -3,
-    -26, -15, -29, -17, -40,  17,   0,  26,  -2,  27,
-     -2, -29,  -4, -36, -10,  -6,   9,   0,  27,   0,
-    }, {
-     30, -11, -15, -20,   0,  -8,  -9,  15, -15,   0,
-      5,  -9,  23,  -6,   8,  13,  13,  -7,   5,  -3,
-    -20, -19, -27, -31, -39,   7, -13,  11,  -4,  19,
-      8, -25,   3, -11,   7,   2,  -4,  16,  18,   9,
-    }, {
-     26,   7, -11,   8,  -5,   1, -17,  14,  -1,  15,
-     24,  30,  32,   1,  33, -16,  18, -14,   0,  -8,
-     -6,  -4, -12, -12,  -6,  13,   2,  23,   8,  15,
-     -4,  17,  -5, -36, -18, -30,  -8, -22, -10, -14,
-    }, {
-     48,  -4, -23,  -9,  -9, -17, -30,  -2, -16,   3,
-     26,  16,  40,  -6,  35,   1,  28, -17,  12,  -9,
-      0,  -8, -11, -25,  -5,   3, -10,   8,   6,   7,
-      6,  22,   1, -11,  -1, -21, -22,  -7, -19,  -5,
-    }, {
-     15,   0,   2,  10, -13,   7, -14,  35, -10,  23,
-     16,  31,  37,  21,  16, -17,   6, -26, -10, -21,
-    -16, -21, -13, -25, -19,  13,  -8,  19,   5,   7,
-      1,  -8,   2, -36,   5,  -6,   3,  -8,  15,  -1,
-    }, {
-     37, -12,  -9,  -7, -17, -11, -26,  18, -25,  12,
-     19,  17,  45,  14,  17,   0,  17, -30,   1, -22,
-    -10, -25, -12, -38, -18,   3, -22,   4,   3,   0,
-     13,  -3,  10, -11,  23,   2, -10,   7,   5,   7,
-    }, {
-      5,  29,  -9,  11,  15,  22,   3,   0,  18,   8,
-     -1,   6,   7, -23,   6,  -6,   5,  12,  15,  21,
-      5,   8, -17,   9, -28,   0, -11,   6,   2,  12,
-    -11,   0, -14, -13, -49, -22,  -8,  -9,   4,  -9,
-    }, {
-     27,  16, -21,  -6,  12,   3,  -9, -16,   3,  -2,
-      1,  -7,  15, -31,   7,  10,  16,   9,  27,  21,
-     11,   5, -16,  -3, -26,  -9, -24,  -7,   0,   4,
-      0,   4,  -6,  11, -32, -14, -23,   6,  -5,  -1,
-    }, {
-     -4,  20,   3,  13,   8,  28,   6,  21,  10,  16,
-     -8,   7,  12,  -3, -11,  -7,  -5,   0,   4,   8,
-     -4,  -8, -18,  -3, -41,   0, -22,   2,   0,   4,
-     -5, -25,  -6, -14, -25,   1,   2,   4,  29,   2,
-    }, {
-     17,   8,  -8,  -4,   4,  10,  -6,   5,  -4,   5,
-     -6,  -6,  20, -10,  -9,   9,   4,  -2,  16,   7,
-      1, -12, -17, -16, -39,  -9, -36, -12,  -2,  -3,
-      6, -21,   1,  11,  -7,  10, -11,  20,  20,  11,
-    }, {
-     13,  27,  -3,  24,  -1,  19, -14,   3,   9,  20,
-     12,  33,  29,  -3,  15, -20,   9,  -9,  11,   3,
-     16,   2,  -2,   2,  -7,  -3, -20,   0,  10,  -7,
-     -7,  22,  -7, -13, -33, -23, -14, -18,  -7, -12,
-    }, {
-     35,  15, -15,   6,  -4,   1, -27, -12,  -5,   8,
-     15,  19,  37, -11,  16,  -2,  20, -12,  23,   2,
-     22,  -1,  -1, -11,  -5, -13, -34, -14,   8, -14,
-      4,  26,   0,  11, -16, -14, -29,  -2, -17,  -3,
-    }, {
-      3,  19,   9,  26,  -8,  26, -10,  24,   0,  28,
-      5,  33,  34,  17,  -2, -20,  -1, -22,   0, -10,
-      6, -14,  -3, -10, -20,  -4, -32,  -4,   7, -15,
-      0,  -3,   0, -13,  -9,   0,  -3,  -4,  17,   0,
-    }, {
-     25,   7,  -2,   8, -12,   7, -23,   8, -13,  16,
-      7,  20,  42,   9,   0,  -3,   9, -25,  12, -10,
-     12, -18,  -2, -24, -19, -13, -46, -19,   5, -22,
-     10,   0,   8,  11,   8,   9, -17,  11,   7,   8,
-    }, {
-    -25,  -7,   2,  -8,  12,  -7,  23,  -8,  13, -16,
-     -7, -20, -42,  -9,   0,   3,  -9,  25, -12,  10,
-    -12,  18,   2,  24,  19,  13,  46,  19,  -5,  22,
-    -10,   0,  -8, -11,  -8,  -9,  17, -11,  -7,  -8,
-    }, {
-     -3, -19,  -9, -26,   8, -26,  10, -24,   0, -28,
-     -5, -33, -34, -17,   2,  20,   1,  22,   0,  10,
-     -6,  14,   3,  10,  20,   4,  32,   4,  -7,  15,
-      0,   3,   0,  13,   9,   0,   3,   4, -17,   0,
-    }, {
-    -35, -15,  15,  -6,   4,  -1,  27,  12,   5,  -8,
-    -15, -19, -37,  11, -16,   2, -20,  12, -23,  -2,
-    -22,   1,   1,  11,   5,  13,  34,  14,  -8,  14,
-     -4, -26,   0, -11,  16,  14,  29,   2,  17,   3,
-    }, {
-    -13, -27,   3, -24,   1, -19,  14,  -3,  -9, -20,
-    -12, -33, -29,   3, -15,  20,  -9,   9, -11,  -3,
-    -16,  -2,   2,  -2,   7,   3,  20,   0, -10,   7,
-      7, -22,   7,  13,  33,  23,  14,  18,   7,  12,
-    }, {
-    -17,  -8,   8,   4,  -4, -10,   6,  -5,   4,  -5,
-      6,   6, -20,  10,   9,  -9,  -4,   2, -16,  -7,
-     -1,  12,  17,  16,  39,   9,  36,  12,   2,   3,
-     -6,  21,  -1, -11,   7, -10,  11, -20, -20, -11,
-    }, {
-      4, -20,  -3, -13,  -8, -28,  -6, -21, -10, -16,
-      8,  -7, -12,   3,  11,   7,   5,   0,  -4,  -8,
-      4,   8,  18,   3,  41,   0,  22,  -2,   0,  -4,
-      5,  25,   6,  14,  25,  -1,  -2,  -4, -29,  -2,
-    }, {
-    -27, -16,  21,   6, -12,  -3,   9,  16,  -3,   2,
-     -1,   7, -15,  31,  -7, -10, -16,  -9, -27, -21,
-    -11,  -5,  16,   3,  26,   9,  24,   7,   0,  -4,
-      0,  -4,   6, -11,  32,  14,  23,  -6,   5,   1,
-    }, {
-     -5, -29,   9, -11, -15, -22,  -3,   0, -18,  -8,
-      1,  -6,  -7,  23,  -6,   6,  -5, -12, -15, -21,
-     -5,  -8,  17,  -9,  28,   0,  11,  -6,  -2, -12,
-     11,   0,  14,  13,  49,  22,   8,   9,  -4,   9,
-    }, {
-    -37,  12,   9,   7,  17,  11,  26, -18,  25, -12,
-    -19, -17, -45, -14, -17,   0, -17,  30,  -1,  22,
-     10,  25,  12,  38,  18,  -3,  22,  -4,  -3,   0,
-    -13,   3, -10,  11, -23,  -2,  10,  -7,  -5,  -7,
-    }, {
-    -15,   0,  -2, -10,  13,  -7,  14, -35,  10, -23,
-    -16, -31, -37, -21, -16,  17,  -6,  26,  10,  21,
-     16,  21,  13,  25,  19, -13,   8, -19,  -5,  -7,
-     -1,   8,  -2,  36,  -5,   6,  -3,   8, -15,   1,
-    }, {
-    -48,   4,  23,   9,   9,  17,  30,   2,  16,  -3,
-    -26, -16, -40,   6, -35,  -1, -28,  17, -12,   9,
-      0,   8,  11,  25,   5,  -3,  10,  -8,  -6,  -7,
-     -6, -22,  -1,  11,   1,  21,  22,   7,  19,   5,
-    }, {
-    -26,  -7,  11,  -8,   5,  -1,  17, -14,   1, -15,
-    -24, -30, -32,  -1, -33,  16, -18,  14,   0,   8,
-      6,   4,  12,  12,   6, -13,  -2, -23,  -8, -15,
-      4, -17,   5,  36,  18,  30,   8,  22,  10,  14,
-    }, {
-    -30,  11,  15,  20,   0,   8,   9, -15,  15,   0,
-     -5,   9, -23,   6,  -8, -13, -13,   7,  -5,   3,
-     20,  19,  27,  31,  39,  -7,  13, -11,   4, -19,
-     -8,  25,  -3,  11,  -7,  -2,   4, -16, -18,  -9,
-    }, {
-     -8,  -1,   3,   2,  -3, -10,  -3, -32,   1, -12,
-     -2,  -4, -15,  -1,  -7,   3,  -2,   4,   6,   3,
-     26,  15,  29,  17,  40, -17,   0, -26,   2, -27,
-      2,  29,   4,  36,  10,   6,  -9,   0, -27,   0,
-    }, {
-    -40,   2,  29,  22,  -7,  14,  12,   5,   7,   7,
-    -12,   9, -18,  26, -26, -14, -24,  -4, -16,  -9,
-     10,   2,  26,  18,  26,  -7,   1, -15,   1, -27,
-     -2,   0,   4,  11,  17,  21,  16,  -1,   7,   3,
-    }, {
-    -18,  -9,  17,   4, -11,  -3,   0, -11,  -7,  -4,
-    -10,  -3, -10,  18, -24,   3, -14,  -7,  -4, -10,
-     16,  -1,  27,   4,  27, -17, -12, -30,   0, -35,
-      9,   3,  12,  36,  35,  30,   2,  13,  -2,  11,
-    }, {
-    -66,  -8, -23, -11,  14,   5,  17,  16,  19,   2,
-      3,  -5, -18, -17,  10,   0,  -1,  23,  -6,  20,
-    -15,  18, -14,  22,   5,  10,  44,  23,   2,  26,
-     -9,   3,  -4, -14, -12, -29,  -7, -16,  -7, -18,
-    }, {
-    -44, -20, -34, -29,  10, -13,   4,   0,   4,  -9,
-      5, -19, -10, -24,  11,  17,   8,  20,   5,  19,
-     -9,  14, -12,   9,   6,   0,  30,   9,   0,  19,
-      2,   7,   2,  10,   5, -20, -21,  -1, -17,  -9,
-    }, {
-    -77, -16,  -9,  -9,   6,  11,  21,  37,  10,  10,
-     -4,  -5, -13,   3,  -7,   0, -13,  11, -17,   6,
-    -25,   1, -15,   9,  -7,   9,  32,  19,   0,  18,
-     -2, -22,   3, -15,  12,  -5,   4,  -2,  17,  -5,
-    }, {
-    -55, -28, -21, -27,   2,  -7,   8,  20,  -4,  -1,
-     -1, -18,  -5,  -4,  -5,  16,  -2,   8,  -5,   5,
-    -19,  -2, -14,  -3,  -6,   0,  18,   4,  -2,  11,
-      8, -18,  11,  10,  29,   3, -10,  13,   8,   3,
-    }, {
-    -58,  -9, -16,   1,  -2,   2,   0,  19,  10,  13,
-     17,  21,   3,   3,  19, -12,   2,   0, -10,   1,
-     -5,  12,   0,  15,  26,   5,  34,  16,  11,   7,
-     -4,  25,   2, -14,   3, -29, -13, -25, -20, -20,
-    }, {
-    -36, -21, -28, -16,  -6, -16, -12,   2,  -4,   2,
-     20,   7,  11,  -4,  20,   4,  12,  -2,   1,   0,
-      0,   8,   2,   2,  27,  -4,  21,   2,   9,   0,
-      6,  29,   9,  10,  21, -21, -28, -10, -29, -11,
-    }, {
-    -69, -17,  -3,   3, -10,   8,   3,  40,   1,  21,
-     10,  21,   8,  23,   1, -13,  -8, -11, -21, -11,
-    -15,  -4,   0,   2,  13,   5,  23,  12,   7,   0,
-      1,   0,  10, -14,  28,  -5,  -1, -11,   5,  -7,
-    }, {
-    -47, -30, -15, -14, -14,  -9,  -9,  23, -13,  10,
-     12,   7,  16,  15,   3,   3,   1, -14,  -9, -12,
-     -9,  -8,   0, -10,  14,  -4,   9,  -2,   5,  -8,
-     13,   3,  18,  10,  45,   3, -16,   4,  -4,   0,
-    }, {
-    -79,  11, -15,   4,  18,  23,  20,   5,  30,   7,
-     -7,  -2, -21, -21,  -8,  -3, -10,  28,   4,  31,
-      6,  25,  -3,  37,   4,  -7,  20,   0,   4,   4,
-    -11,   7,  -6,   8, -27, -22, -14, -12,  -5, -16,
-    }, {
-    -57,   0, -27, -13,  14,   5,   7, -11,  15,  -4,
-     -5, -16, -13, -29,  -6,  13,   0,  25,  16,  31,
-     12,  22,  -2,  23,   6, -16,   7, -14,   2,  -3,
-      0,  12,   0,  33,  -9, -13, -28,   3, -14,  -7,
-    }, {
-    -90,   3,  -2,   6,  10,  29,  24,  26,  21,  15,
-    -15,  -2, -16,  -1, -25,  -4, -21,  16,  -6,  18,
-     -3,   8,  -5,  24,  -8,  -7,   9,  -4,   1,  -3,
-     -5, -18,   1,   7,  -2,   1,  -2,   1,  19,  -3,
-    }, {
-    -67,  -8, -14, -11,   7,  11,  11,   9,   7,   3,
-    -13, -16,  -8,  -9, -24,  12, -10,  13,   5,  17,
-      2,   4,  -3,  10,  -6, -17,  -4, -19,   0, -11,
-      6, -13,   9,  33,  14,  10, -16,  17,  10,   4,
-    }, {
-    -71,  10,  -9,  17,   1,  20,   3,   8,  21,  18,
-      6,  24,   0,  -1,   0, -16,  -6,   5,   0,  13,
-     17,  19,  11,  29,  25, -11,  11,  -6,  13, -15,
-     -7,  29,   0,   8, -11, -22, -20, -21, -17, -18,
-    }, {
-    -49,  -2, -21,   0,  -1,   2,  -9,  -8,   6,   6,
-      8,  10,   8,  -9,   2,   0,   4,   2,  13,  12,
-     23,  15,  12,  16,  26, -21,  -2, -21,  11, -23,
-      4,  33,   7,  33,   6, -13, -34,  -5, -27, -10,
-    }, {
-    -82,   1,   4,  19,  -6,  27,   6,  29,  12,  26,
-     -1,  24,   5,  18, -17, -17, -17,  -6, -10,   0,
-      7,   2,   9,  16,  12, -11,   0, -11,   9, -23,
-      0,   3,   8,   8,  13,   1,  -8,  -7,   7,  -6,
-    }, {
-    -60, -10,  -7,   1,  -9,   8,  -6,  13,  -2,  15,
-      1,  10,  13,  11, -15,   0,  -6,  -9,   1,   0,
-     13,  -1,  11,   3,  13, -21, -13, -26,   7, -31,
-     10,   7,  16,  33,  31,  10, -22,   8,  -1,   2,
-    }, {
-     -3,   7,  -5,  -5,   8,  -2,  17,  -9,  18, -24,
-     -2, -19, -10,  -4,  28,  17,   5,  28,  -2,   7,
-     -4,  15,   7,   8,   6,  23,  13,  21, -14,  20,
-    -17, -18, -11, -33, -30, -11,  23, -13,  -5,  -9,
-    }, {
-     18,  -4, -17, -23,   4, -20,   4, -26,   3, -36,
-      0, -32,  -2, -12,  29,  34,  16,  24,  10,   6,
-      0,  12,   8,  -4,   8,  13,   0,   6, -16,  12,
-     -5, -13,  -3,  -7, -13,  -3,   8,   2, -14,   0,
-    }, {
-    -13,   0,   8,  -3,   0,   4,  21,  11,   9, -16,
-    -10, -18,  -5,  16,  10,  16,  -5,  15, -13,  -5,
-    -15,  -1,   6,  -4,  -6,  23,   2,  16, -17,  12,
-    -10, -44,  -3, -33,  -6,  12,  34,   1,  20,   3,
-    }, {
-      8, -12,  -3, -21,  -3, -14,   8,  -5,  -4, -28,
-     -7, -32,   2,   8,  12,  34,   4,  12,  -1,  -6,
-     -9,  -4,   7, -17,  -4,  13, -11,   1, -19,   4,
-      0, -39,   4,  -7,  11,  21,  20,  16,  10,  11,
-    }, {
-      4,   6,   0,   7,  -8,  -4,   0,  -6,   9, -13,
-     11,   7,  11,  15,  37,   4,   9,   5,  -5, -11,
-      5,   9,  22,   1,  27,  18,   4,  14,  -5,   0,
-    -12,   3,  -4, -32, -14, -12,  17, -22, -17, -11,
-    }, {
-     26,  -6, -11, -10, -12, -23, -12, -23,  -5, -24,
-     13,  -5,  19,   8,  38,  21,  20,   2,   6, -12,
-     11,   5,  23, -11,  29,   9,  -9,   0,  -7,  -6,
-     -1,   7,   2,  -7,   3,  -3,   2,  -6, -27,  -3,
-    }, {
-     -6,  -2,  14,   9, -16,   1,   3,  14,   0,  -5,
-      3,   8,  16,  36,  19,   3,  -1,  -6, -17, -24,
-     -4,  -7,  21, -11,  14,  18,  -7,   9,  -9,  -7,
-     -6, -22,   3, -33,  10,  11,  28,  -7,   7,   0,
-    }, {
-     16, -14,   2,  -8, -20, -17,  -9,  -2, -14, -16,
-      6,  -5,  24,  28,  21,  20,   8,  -9,  -4, -25,
-      1, -11,  22, -24,  15,   8, -21,  -5, -11, -14,
-      5, -18,  11,  -7,  27,  20,  14,   7,  -1,   9,
-    }, {
-    -16,  27,   2,  10,  13,  16,  20, -20,  29, -20,
-    -14, -16, -13,  -8,   9,  13,  -2,  33,   9,  19,
-     17,  23,  17,  22,   6,   6,  -9,  -2, -12,  -2,
-    -20, -13, -13, -10, -45,  -4,  16,  -8,  -2,  -7,
-    }, {
-      5,  15,  -9,  -7,   9,  -2,   8, -37,  14, -31,
-    -11, -29,  -5, -16,  11,  30,   7,  29,  21,  18,
-     23,  19,  18,   9,   7,  -3, -23, -17, -14,  -9,
-     -8,  -9,  -6,  15, -27,   4,   2,   6, -12,   1,
-    }, {
-    -26,  19,  15,  12,   5,  22,  24,   0,  21, -12,
-    -21, -15,  -8,  11,  -7,  12, -14,  20,  -2,   6,
-      7,   6,  16,   9,  -6,   5, -21,  -7, -15, -10,
-    -13, -39,  -5, -10, -20,  19,  28,   5,  22,   5,
-    }, {
-     -4,   6,   3,  -5,   1,   4,  11, -16,   6, -23,
-    -19, -29,   0,   3,  -6,  30,  -3,  17,  10,   5,
-     13,   2,  17,  -3,  -5,  -3, -35, -21, -17, -17,
-     -2, -35,   2,  15,  -3,  28,  13,  21,  13,  13,
-    }, {
-     -8,  25,   8,  23,  -3,  13,   3, -17,  20,  -8,
-      0,  10,   8,  11,  18,   0,   1,  10,   5,   0,
-     28,  17,  32,  15,  26,   1, -19,  -9,  -3, -21,
-    -15,   7,  -6,  -9, -29,  -5,  10, -17, -15,  -9,
-    }, {
-     13,  13,  -3,   5,  -7,  -4,  -9, -34,   5, -20,
-      2,  -3,  16,   3,  20,  17,  11,   7,  17,   0,
-     34,  13,  33,   2,  28,  -8, -32, -24,  -5, -29,
-     -3,  12,   0,  15, -11,   3,  -3,  -2, -24,  -1,
-    }, {
-    -18,  17,  21,  25, -11,  19,   6,   3,  11,   0,
-     -7,  11,  13,  31,   1,   0,  -9,  -1,  -5, -12,
-     18,   0,  31,   2,  13,   1, -30, -14,  -7, -29,
-     -9, -18,   1, -10,  -4,  18,  22,  -3,  10,   2,
-    }, {
-      3,   5,   9,   7, -15,   1,  -5, -13,  -2, -12,
-     -5,  -2,  21,  23,   2,  16,   0,  -5,   6, -13,
-     23,  -3,  32, -10,  15,  -8, -44, -28,  -9, -37,
-      2, -13,   9,  15,  12,  27,   7,  12,   0,  11,
-    }, {
-    -44,   6, -30,  -8,   9,  10,  11,  14,  23,  -5,
-      8,  -4,  14, -12,  37,  14,  12,  26,   4,  16,
-     -8,  16,  -9,   7,  -6,  19,  12,  25,  -5,  24,
-    -15, -13,  -8, -36, -34, -31,  -1, -18,  -4, -18,
-    }, {
-    -22,  -5, -42, -26,   6,  -8,  -1,  -2,   9, -17,
-     10, -18,  21, -19,  39,  31,  23,  23,  16,  15,
-     -2,  12,  -7,  -6,  -5,   9,  -1,  10,  -7,  16,
-     -4,  -9,   0, -10, -17, -22, -16,  -2, -14,  -9,
-    }, {
-    -55,  -1, -17,  -6,   1,  16,  15,  35,  15,   2,
-      0,  -4,  19,   8,  20,  13,   1,  14,  -7,   3,
-    -18,   0, -10,  -5, -19,  19,   0,  21,  -8,  16,
-     -9, -39,   0, -36, -10,  -7,   9,  -4,  20,  -5,
-    }, {
-    -33, -13, -29, -24,  -1,  -1,   2,  18,   0,  -9,
-      3, -17,  27,   0,  21,  30,  12,  11,   5,   2,
-    -12,  -4,  -9, -19, -18,   9, -13,   6, -11,   8,
-      2, -35,   8, -10,   7,   1,  -4,  11,  10,   2,
-    }, {
-    -36,   5, -24,   4,  -7,   7,  -6,  17,  14,   5,
-     22,  22,  35,   8,  46,   1,  17,   3,   0,  -2,
-      2,  10,   5,   0,  14,  15,   2,  18,   2,   4,
-    -11,   7,  -1, -36, -18, -32,  -7, -27, -17, -20,
-    }, {
-    -14,  -7, -36, -13, -10, -10, -18,   0,   0,  -5,
-     25,   8,  43,   0,  48,  18,  27,   0,  12,  -3,
-      7,   6,   7, -13,  15,   5, -11,   3,   0,  -2,
-      0,  12,   6, -10,   0, -23, -22, -11, -26, -12,
-    }, {
-    -47,  -3, -11,   6, -15,  13,  -2,  38,   6,  13,
-     15,  22,  40,  28,  28,   0,   5,  -8, -10, -15,
-     -7,  -7,   4, -13,   1,  14,  -9,  14,   0,  -2,
-     -4, -18,   7, -36,   6,  -8,   3, -13,   7,  -8,
-    }, {
-    -25, -15, -22, -11, -18,  -4, -15,  22,  -8,   2,
-     17,   9,  48,  20,  30,  17,  16, -11,   1, -16,
-     -2, -10,   5, -26,   2,   4, -22,   0,  -2, -10,
-      6, -13,  14, -10,  23,   0, -10,   2,  -1,   0,
-    }, {
-    -57,  26, -22,   7,  14,  28,  14,   3,  35,   0,
-     -3,  -1,  11, -16,  18,  10,   4,  31,  15,  28,
-     14,  23,   1,  21,  -7,   2, -11,   1,  -3,   1,
-    -18,  -9, -10, -13, -49, -24,  -8, -14,  -2, -16,
-    }, {
-    -35,  14, -34, -10,  10,  10,   1, -12,  20, -12,
-      0, -15,  18, -24,  20,  27,  14,  28,  27,  27,
-     20,  19,   2,   8,  -5,  -7, -25, -13,  -5,  -5,
-     -6,  -5,  -2,  12, -31, -15, -23,   1, -12,  -8,
-    }, {
-    -68,  18,  -9,   9,   6,  35,  18,  25,  26,   7,
-    -10,  -1,  16,   3,   1,   9,  -6,  19,   4,  15,
-      4,   6,   0,   8, -20,   2, -23,  -2,  -7,  -5,
-    -12, -35,  -1, -13, -24,   0,   3,   0,  22,  -4,
-    }, {
-    -46,   6, -21,  -8,   2,  16,   5,   8,  11,  -4,
-     -8, -15,  24,  -4,   2,  26,   3,  16,  16,  14,
-      9,   2,   1,  -4, -19,  -7, -36, -17,  -9, -13,
-      0, -31,   5,  12,  -7,   8, -11,  15,  13,   4,
-    }, {
-    -49,  24, -16,  20,  -2,  26,  -2,   7,  25,  10,
-     11,  25,  32,   3,  27,  -2,   8,   8,  11,   9,
-     24,  17,  16,  14,  13,  -2, -20,  -5,   4, -17,
-    -14,  12,  -3, -13, -33, -25, -14, -23, -15, -19,
-    }, {
-    -27,  12, -28,   2,  -6,   7, -15,  -9,  11,  -1,
-     13,  11,  40,  -4,  29,  14,  19,   5,  23,   8,
-     30,  13,  17,   0,  14, -12, -34, -20,   2, -25,
-     -2,  16,   4,  12, -15, -16, -29,  -7, -24, -10,
-    }, {
-    -60,  16,  -3,  22, -10,  32,   0,  28,  17,  18,
-      3,  25,  37,  23,  10,  -3,  -2,  -3,   0,  -3,
-     14,   0,  14,   1,   0,  -2, -32,  -9,   1, -25,
-     -7, -13,   5, -13,  -8,  -1,  -2,  -8,  10,  -6,
-    }, {
-    -38,   4, -15,   4, -14,  13, -12,  11,   2,   6,
-      6,  11,  45,  16,  11,  13,   7,  -6,  12,  -4,
-     20,  -3,  16, -12,   1, -12, -46, -24,   0, -33,
-      3,  -9,  12,  12,   8,   7, -17,   6,   0,   2
-    }
-};
-
-const int8_t ff_cb2_vects[128][40]={
-    {
-     73, -32, -60, -15, -26,  59,   2, -33,  30, -10,
-     -3, -17,   8,  30,  -1, -26,  -4, -22,  10,  16,
-    -36,  -5, -11,  56,  37,   6, -10,  -5, -13,  -3,
-      6,  -5,  11,   4, -19,  -5, -16,  41,  24,  13,
-    }, {
-      4, -11, -37,  23,  -5,  46,  -2, -29,  -5, -39,
-    -21,  -9,   0,  49,  12,  -9, -16, -26,  22,  15,
-    -45, -20,  -5,  40,  22,  17, -26,  31, -14,   2,
-    -14,  10,  30,  20, -27,  -9, -39,  39,  18,   5,
-    }, {
-     34, -25, -48, -28, -11,  34,  -2, -41,   9,  -7,
-    -17,  21,  20,  24, -17, -33,   0, -24,  10,  42,
-      3,  -5,  10,  42,  11,   8,  -3,   3,  16,   9,
-     22,  -2,   0, -33, -10,  18,   7,  58,  10,  28,
-    }, {
-    -34,  -4, -25,  10,   9,  21,  -7, -36, -26, -36,
-    -35,  28,  12,  42,  -3, -16, -12, -28,  21,  42,
-     -5, -21,  16,  26,  -4,  19, -19,  39,  15,  15,
-      1,  13,  19, -17, -17,  14, -15,  55,   4,  19,
-    }, {
-     28, -20, -51, -14,  -6,   7,   0, -26,  27,  -4,
-     18, -40,  -6,  16,  -1, -15,   0, -55,  -5, -16,
-    -19,  14,  -3,  49,  14,   1, -22, -30, -12,   0,
-     24,  15,   9, -17, -45, -29,   4,  28,  51,  35,
-    }, {
-    -40,   0, -28,  24,  14,  -5,  -4, -21,  -7, -33,
-      0, -32, -15,  35,  12,   1, -11, -58,   5, -16,
-    -28,   0,   1,  33,   0,  11, -39,   5, -14,   6,
-      3,  31,  28,  -1, -53, -33, -19,  25,  46,  26,
-    }, {
-    -11, -14, -39, -27,   9, -17,  -4, -33,   6,   0,
-      4,  -1,   5,  10, -17, -22,   5, -57,  -5,   9,
-     20,  13,  18,  35, -11,   3, -16, -22,  17,  13,
-     40,  19,  -1, -55, -35,  -5,  27,  44,  37,  49,
-    }, {
-    -80,   6, -16,  11,  30, -30,  -9, -28, -28, -29,
-    -13,   6,  -2,  28,  -3,  -5,  -7, -60,   5,   9,
-     11,  -1,  24,  19, -27,  13, -32,  13,  15,  19,
-     19,  35,  17, -39, -43,  -9,   4,  42,  32,  41,
-    }, {
-     78, -21, -43,   4, -38,  17,  17,  -5,  55,  24,
-    -15, -36,  14,   4,  24, -24,  12,   5,  17,  31,
-    -54,  -5,  -2,  27,  43, -12,   2,   9,  -9, -15,
-     22,  -3,  28,  21, -20,   3,  20,  28,   9,  -5,
-    }, {
-      9,  -1, -20,  43, -17,   3,  12,   0,  20,  -4,
-    -33, -29,   6,  22,  38,  -7,   0,   1,  29,  30,
-    -63, -21,   3,  11,  27,  -1, -14,  45, -10,  -9,
-      1,  12,  47,  37, -28,   0,  -2,  26,   4, -13,
-    }, {
-     39, -14, -30,  -8, -22,  -8,  12, -12,  34,  27,
-    -29,   2,  26,  -2,   8, -31,  16,   3,  17,  57,
-    -14,  -6,  19,  13,  16, -10,   8,  17,  20,  -2,
-     38,   0,  17, -16, -11,  27,  44,  45,  -4,   8,
-    }, {
-    -29,   5,  -7,  30,  -1, -21,   7,  -7,   0,   0,
-    -47,   9,  18,  15,  22, -14,   4,   0,  28,  57,
-    -23, -21,  25,  -2,   1,   0,  -7,  53,  19,   3,
-     17,  15,  36,   0, -19,  24,  21,  43,  -9,   0,
-    }, {
-     33, -10, -34,   5, -17, -35,  15,   1,  53,  30,
-      6, -59,   0, -10,  24, -13,  17, -27,   1,  -1,
-    -37,  13,   4,  20,  20, -18, -10, -16,  -8, -11,
-     39,  18,  26,   0, -46, -20,  41,  15,  37,  15,
-    }, {
-    -35,  10, -11,  44,   3, -48,  10,   6,  17,   2,
-    -11, -51,  -8,   8,  38,   3,   4, -31,  12,  -2,
-    -46,  -1,  10,   4,   5,  -7, -26,  19, -10,  -5,
-     18,  34,  45,  15, -54, -24,  18,  13,  31,   7,
-    }, {
-     -5,  -3, -21,  -7,  -2, -60,  10,  -5,  32,  34,
-     -7, -20,  11, -16,   8, -20,  21, -29,   1,  24,
-      2,  13,  27,   6,  -5, -15,  -3,  -8,  21,   1,
-     55,  21,  15, -38, -37,   3,  65,  32,  23,  30,
-    }, {
-    -74,  17,   0,  31,  18, -73,   5,   0,  -3,   5,
-    -25, -12,   3,   1,  22,  -3,   9, -33,  12,  24,
-     -6,  -2,  33,  -9, -21,  -5, -20,  27,  19,   7,
-     34,  37,  34, -22, -44,   0,  41,  29,  17,  21,
-    }, {
-     76, -35, -31, -28, -49,  43, -40,   0,  29, -14,
-      8,   5,  10,  18, -26, -46,   0,   7,   6,   3,
-    -25,  -7,  -2,  40,  28,  14,  18,  -3, -27, -28,
-     -8, -45, -13,  34, -13, -27, -15,  31,  12,   3,
-    }, {
-      7, -15,  -9,   9, -28,  29, -45,   5,  -6, -43,
-     -9,  12,   2,  36, -12, -30, -11,   3,  17,   3,
-    -34, -22,   3,  24,  12,  24,   2,  32, -28, -22,
-    -29, -29,   5,  50, -21, -31, -38,  29,   7,  -5,
-    }, {
-     36, -29, -19, -41, -34,  18, -45,  -6,   8, -10,
-     -5,  43,  23,  11, -42, -53,   5,   5,   6,  30,
-     14,  -8,  20,  26,   1,  16,  25,   4,   3, -15,
-      7, -41, -23,  -3,  -4,  -3,   8,  48,  -1,  17,
-    }, {
-    -32,  -8,   3,  -2, -13,   4, -50,  -1, -27, -39,
-    -23,  51,  15,  30, -27, -37,  -7,   1,  17,  29,
-      5, -23,  25,  10, -14,  26,   8,  41,   1,  -9,
-    -13, -26,  -5,  12, -12,  -7, -14,  45,  -6,   9,
-    }, {
-     31, -24, -23, -27, -29,  -9, -43,   8,  26,  -7,
-     30, -17,  -4,   3, -26, -35,   5, -24, -10, -28,
-     -9,  12,   5,  33,   5,   8,   5, -29, -26, -24,
-      9, -23, -14,  12, -39, -52,   5,  18,  39,  24,
-    }, {
-    -37,  -3,   0,  10,  -7, -22, -48,  12,  -8, -36,
-     12,  -9, -12,  22, -12, -19,  -6, -28,   0, -29,
-    -18,  -3,  11,  17, -10,  18, -10,   7, -27, -18,
-    -11,  -7,   3,  28, -47, -55, -18,  15,  34,  16,
-    }, {
-     -8, -17, -10, -40, -13, -34, -47,   0,   5,  -4,
-     16,  21,   8,  -2, -42, -43,  10, -26, -10,  -2,
-     31,  11,  27,  19, -21,  10,  12, -20,   3, -11,
-     25, -20, -25, -25, -29, -28,  28,  34,  25,  38,
-    }, {
-    -77,   2,  11,  -1,   7, -47, -52,   5, -29, -33,
-     -1,  28,   0,  15, -28, -26,  -2, -30,   0,  -2,
-     22,  -4,  33,   3, -36,  21,  -3,  15,   2,  -5,
-      4,  -4,  -6,  -9, -37, -31,   5,  32,  20,  30,
-    }, {
-     81, -25, -14,  -8, -61,   0, -25,  28,  54,  20,
-     -3, -14,  17,  -8,   0, -44,  16,  35,  13,  18,
-    -43,  -7,   6,  11,  33,  -4,  30,  11, -22, -40,
-      6, -43,   3,  50, -14, -18,  22,  18,  -1, -16,
-    }, {
-     12,  -4,   8,  29, -39, -12, -30,  33,  19,  -8,
-    -21,  -6,   8,   9,  13, -28,   4,  31,  24,  18,
-    -52, -23,  12,  -4,  18,   5,  14,  47, -24, -34,
-    -14, -27,  22,  66, -22, -22,  -1,  16,  -6, -24,
-    }, {
-     41, -18,  -2, -21, -45, -24, -30,  21,  33,  24,
-    -17,  24,  29, -15, -16, -51,  21,  33,  13,  45,
-     -3,  -8,  28,  -2,   7,  -2,  37,  19,   7, -27,
-     22, -39,  -7,  12,  -5,   5,  45,  35, -15,  -1,
-    }, {
-    -27,   1,  20,  17, -24, -38, -35,  26,  -1,  -4,
-    -35,  32,  21,   3,  -2, -35,   8,  29,  24,  44,
-    -12, -24,  34, -18,  -8,   7,  21,  55,   5, -21,
-      2, -23,  11,  28, -13,   1,  22,  33, -21, -10,
-    }, {
-     36, -13,  -5,  -7, -40, -51, -28,  36,  52,  27,
-     18, -36,   2, -22,   0, -33,  21,   2,  -3, -13,
-    -26,  11,  14,   4,  10, -10,  18, -14, -22, -36,
-     24, -21,   1,  28, -40, -42,  42,   5,  25,   5,
-    }, {
-    -32,   6,  17,  31, -19, -65, -33,  41,  16,  -1,
-      0, -29,  -6,  -4,  13, -17,   9,  -1,   8, -14,
-    -35,  -3,  19, -11,  -4,   0,   1,  21, -23, -30,
-      3,  -5,  20,  44, -48, -46,  19,   3,  20,  -3,
-    }, {
-     -3,  -7,   6, -20, -25, -77, -32,  29,  31,  30,
-      4,   2,  14, -29, -16, -40,  26,   0,  -3,  12,
-     13,  10,  36,  -9, -15,  -8,  24,  -6,   7, -22,
-     40, -17,  -8,  -9, -31, -18,  66,  22,  11,  19,
-    }, {
-    -72,  13,  29,  18,  -4, -90, -37,  34,  -4,   1,
-    -13,   9,   6, -11,  -2, -24,  13,  -3,   7,  11,
-      4,  -4,  42, -25, -31,   1,   8,  29,   6, -17,
-     19,  -2,  10,   6, -38, -22,  42,  19,   6,  11,
-    }, {
-    116, -20, -68, -30, -28,  83,  28, -18,  32, -22,
-    -13, -21,   5,  28,   5,  -7, -24,  -8, -22,  17,
-    -23,  30, -25,  45,  15,  -9, -11, -18,  22, -10,
-      4,  -2,  19, -12,  23,   3, -43,   2,  12,  -4,
-    }, {
-     47,   0, -45,   7,  -7,  69,  23, -13,  -2, -51,
-    -32, -14,  -3,  47,  19,   8, -37, -11, -10,  16,
-    -32,  15, -19,  29,   0,   1, -28,  18,  20,  -4,
-    -16,  13,  38,   3,  15,   0, -66,   0,   7, -13,
-    }, {
-     77, -13, -56, -43, -13,  57,  23, -26,  11, -19,
-    -27,  16,  17,  22, -10, -15, -19, -10, -22,  43,
-     16,  30,  -2,  31, -11,  -6,  -5,  -9,  52,   2,
-     20,   0,   8, -50,  33,  27, -19,  19,  -1,   9,
-    }, {
-      8,   6, -33,  -4,   7,  44,  18, -21, -23, -48,
-    -46,  24,   9,  40,   3,   1, -32, -13, -11,  43,
-      7,  14,   3,  15, -26,   3, -21,  26,  50,   8,
-      0,  16,  27, -34,  25,  23, -43,  17,  -6,   1,
-    }, {
-     71,  -9, -59, -29,  -8,  30,  26, -11,  30, -16,
-      8, -44,  -9,  14,   5,   2, -19, -40, -38, -15,
-     -7,  50, -17,  38,  -7, -14, -24, -43,  22,  -6,
-     22,  19,  17, -34,  -2, -20, -23, -10,  39,  16,
-    }, {
-      2,  11, -36,   9,  13,  17,  21,  -6,  -5, -45,
-    -10, -36, -18,  33,  19,  19, -31, -44, -27, -15,
-    -16,  34, -11,  22, -22,  -4, -40,  -7,  21,   0,
-      1,  35,  36, -18, -10, -24, -46, -12,  34,   8,
-    }, {
-     32,  -2, -47, -42,   7,   5,  21, -18,   9, -12,
-     -5,  -5,   2,   8, -10,  -4, -14, -42, -38,  10,
-     33,  49,   5,  24, -33, -12, -17, -35,  52,   6,
-     38,  22,   7, -72,   7,   3,   0,   6,  25,  30,
-    }, {
-    -36,  18, -24,  -3,  28,  -7,  16, -13, -26, -41,
-    -24,   1,  -5,  26,   3,  12, -27, -46, -27,  10,
-     24,  34,  10,   8, -49,  -2, -34,   0,  51,  12,
-     17,  38,  25, -56,   0,   0, -22,   3,  20,  22,
-    }, {
-    121,  -9, -50, -10, -40,  40,  43,   9,  58,  12,
-    -25, -41,  11,   2,  31,  -5,  -8,  19, -15,  32,
-    -41,  30, -16,  16,  20, -28,   0,  -3,  26, -22,
-     19,   0,  36,   4,  22,  12,  -6,  -9,  -1, -24,
-    }, {
-     52,  10, -27,  27, -18,  26,  38,  14,  23, -16,
-    -44, -33,   3,  20,  45,  10, -20,  15,  -3,  31,
-    -50,  14, -10,   0,   5, -17, -15,  32,  24, -16,
-     -1,  15,  55,  20,  14,   8, -29, -12,  -7, -32,
-    }, {
-     82,  -3, -38, -23, -24,  15,  38,   2,  37,  15,
-    -39,  -2,  23,  -4,  15, -12,  -3,  17, -15,  58,
-     -1,  29,   6,   2,  -5, -26,   7,   4,  56,  -9,
-     35,   3,  25, -33,  32,  36,  17,   7, -15,  -9,
-    }, {
-     13,  17, -15,  15,  -3,   1,  33,   7,   1, -12,
-    -58,   5,  15,  13,  29,   3, -16,  13,  -4,  57,
-    -10,  13,  11, -13, -21, -15,  -9,  40,  55,  -3,
-     14,  19,  44, -17,  24,  32,  -5,   4, -21, -18,
-    }, {
-     76,   1, -41,  -9, -19, -12,  41,  17,  55,  18,
-     -3, -63,  -3, -12,  30,   5,  -3, -12, -31,   0,
-    -24,  49,  -8,   9,  -1, -33, -12, -29,  27, -18,
-     37,  21,  34, -17,  -3, -11,  14, -23,  25,  -2,
-    }, {
-      7,  22, -18,  29,   1, -25,  36,  21,  20,  -9,
-    -22, -56, -11,   6,  45,  21, -15, -16, -20,  -1,
-    -33,  34,  -2,  -6, -17, -23, -28,   6,  25, -12,
-     16,  37,  53,  -1, -11, -15,  -8, -25,  20, -11,
-    }, {
-     37,   8, -29, -22,  -4, -37,  36,   9,  34,  22,
-    -17, -24,   8, -18,  15,  -2,   1, -14, -31,  25,
-     15,  48,  13,  -4, -28, -31,  -5, -21,  57,  -4,
-     53,  24,  23, -55,   6,  12,  37,  -6,  11,  11,
-    }, {
-    -31,  28,  -6,  16,  16, -50,  31,  14,   0,  -6,
-    -36, -17,   0,   0,  29,  14, -11, -18, -20,  25,
-      6,  33,  19, -20, -43, -21, -21,  14,  55,   0,
-     32,  40,  42, -39,  -1,   8,  14,  -8,   6,   3,
-    }, {
-    119, -24, -39, -44, -51,  66, -14,  15,  31, -26,
-     -1,   0,   7,  16, -19, -28, -19,  22, -26,   4,
-    -13,  28, -16,  29,   5,  -1,  16, -16,   8, -35,
-    -10, -42,  -4,  17,  29, -19, -42,  -7,   0, -15,
-    }, {
-     50,  -3, -16,  -5, -30,  53, -19,  20,  -3, -55,
-    -19,   8,   0,  34,  -5, -11, -32,  18, -15,   4,
-    -22,  13, -10,  13,  -9,   8,   0,  19,   7, -29,
-    -31, -26,  13,  33,  21, -22, -65,  -9,  -4, -23,
-    }, {
-     79, -17, -27, -56, -36,  41, -19,   8,  10, -22,
-    -15,  39,  20,   9, -35, -35, -15,  20, -26,  31,
-     26,  27,   6,  15, -20,   0,  23,  -8,  38, -22,
-      5, -38, -15, -20,  39,   4, -18,   9, -13,  -1,
-    }, {
-     10,   3,  -4, -18, -15,  27, -24,  13, -24, -51,
-    -34,  47,  12,  28, -21, -19, -27,  16, -15,  30,
-     17,  12,  12,   0, -36,  10,   7,  27,  37, -16,
-    -15, -22,   3,  -4,  31,   1, -42,   7, -18,  -9,
-    }, {
-     74, -12, -30, -42, -30,  14, -16,  23,  29, -19,
-     20, -21,  -7,   1, -19, -17, -14, -10, -43, -27,
-      3,  48,  -8,  22, -16,  -7,   4, -42,   9, -31,
-      6, -20,  -6,  -4,   3, -43, -22, -20,  28,   5,
-    }, {
-      5,   7,  -7,  -4,  -9,   0, -21,  28,  -6, -48,
-      2, -14, -15,  20,  -5,   0, -27, -14, -32, -28,
-     -5,  32,  -2,   6, -32,   3, -12,  -5,   8, -25,
-    -14,  -4,  12,  11,  -4, -47, -45, -22,  22,  -2,
-    }, {
-     34,  -6, -18, -55, -15, -11, -21,  16,   8, -16,
-      6,  16,   5,  -4, -35, -24, -10, -12, -43,  -1,
-     43,  47,  14,   8, -43,  -5,  10, -34,  39, -18,
-     22, -16, -17, -42,  13, -19,   1,  -3,  14,  20,
-    }, {
-    -34,  14,   4, -17,   5, -24, -26,  20, -27, -45,
-    -12,  24,  -2,  13, -21,  -8, -22, -16, -32,  -2,
-     34,  31,  20,  -7, -58,   5,  -5,   2,  38, -12,
-      2,  -1,   1, -26,   5, -23, -21,  -6,   8,  11,
-    }, {
-    124, -13, -21, -23, -62,  23,   0,  43,  57,   8,
-    -13, -18,  14, -10,   6, -26,  -3,  49, -19,  19,
-    -31,  27,  -7,   0,  11, -20,  29,  -1,  12, -47,
-      4, -39,  11,  34,  28,  -9,  -5, -19, -13, -34,
-    }, {
-     55,   6,   1,  14, -41,  10,  -4,  48,  22, -20,
-    -31, -10,   5,   7,  20,  -9, -16,  45,  -8,  19,
-    -40,  12,  -1, -15,  -4, -10,  12,  34,  11, -41,
-    -16, -24,  30,  49,  20, -13, -28, -22, -18, -43,
-    }, {
-     84,  -6,  -9, -36, -47,  -1,  -4,  36,  36,  12,
-    -27,  20,  26, -17,  -9, -33,   1,  47, -19,  46,
-      9,  27,  15, -13, -15, -18,  35,   6,  42, -33,
-     20, -36,   1,  -4,  38,  14,  18,  -2, -27, -20,
-    }, {
-     15,  13,  13,   1, -26, -14,  -9,  41,   1, -16,
-    -46,  27,  18,   1,   4, -16, -11,  43,  -8,  45,
-      0,  11,  21, -29, -30,  -8,  19,  42,  41, -28,
-      0, -20,  20,  11,  30,  10,  -4,  -5, -32, -28,
-    }, {
-     79,  -2, -12, -22, -42, -28,  -1,  51,  54,  15,
-      8, -41,   0, -24,   6, -15,   1,  17, -36, -12,
-    -14,  47,   0,  -6, -11, -26,  16, -27,  13, -43,
-     22, -18,  10,  12,   2, -34,  15, -33,  13, -13,
-    }, {
-     10,  18,  10,  15, -21, -41,  -6,  56,  19, -13,
-     -9, -33,  -9,  -6,  20,   1, -11,  13, -24, -13,
-    -23,  32,   6, -22, -26, -15,   0,   8,  12, -37,
-      1,  -2,  28,  27,  -5, -37,  -7, -35,   8, -21,
-    }, {
-     39,   4,   0, -35, -27, -53,  -6,  44,  33,  18,
-     -5,  -2,  11, -31,  -9, -22,   6,  15, -36,  13,
-     25,  46,  23, -20, -37, -24,  23, -19,  43, -29,
-     38, -14,   0, -26,  12, -10,  38, -16,   0,   0,
-    }, {
-    -29,  25,  22,   2,  -6, -67, -11,  49,  -1, -10,
-    -24,   5,   3, -13,   4,  -5,  -6,  11, -25,  12,
-     16,  31,  28, -36, -53, -13,   6,  16,  42, -24,
-     17,   1,  18, -10,   4, -13,  15, -18,  -5,  -7,
-    }, {
-     29, -25, -22,  -2,   6,  67,  11, -49,   1,  10,
-     24,  -5,  -3,  13,  -4,   5,   6, -11,  25, -12,
-    -16, -31, -28,  36,  53,  13,  -6, -16, -42,  24,
-    -17,  -1, -18,  10,  -4,  13, -15,  18,   5,   7,
-    }, {
-    -39,  -4,   0,  35,  27,  53,   6, -44, -33, -18,
-      5,   2, -11,  31,   9,  22,  -6, -15,  36, -13,
-    -25, -46, -23,  20,  37,  24, -23,  19, -43,  29,
-    -38,  14,   0,  26, -12,  10, -38,  16,   0,   0,
-    }, {
-    -10, -18, -10, -15,  21,  41,   6, -56, -19,  13,
-      9,  33,   9,   6, -20,  -1,  11, -13,  24,  13,
-     23, -32,  -6,  22,  26,  15,   0,  -8, -12,  37,
-     -1,   2, -28, -27,   5,  37,   7,  35,  -8,  21,
-    }, {
-    -79,   2,  12,  22,  42,  28,   1, -51, -54, -15,
-     -8,  41,   0,  24,  -6,  15,  -1, -17,  36,  12,
-     14, -47,   0,   6,  11,  26, -16,  27, -13,  43,
-    -22,  18, -10, -12,  -2,  34, -15,  33, -13,  13,
-    }, {
-    -15, -13, -13,  -1,  26,  14,   9, -41,  -1,  16,
-     46, -27, -18,  -1,  -4,  16,  11, -43,   8, -45,
-      0, -11, -21,  29,  30,   8, -19, -42, -41,  28,
-      0,  20, -20, -11, -30, -10,   4,   5,  32,  28,
-    }, {
-    -84,   6,   9,  36,  47,   1,   4, -36, -36, -12,
-     27, -20, -26,  17,   9,  33,  -1, -47,  19, -46,
-     -9, -27, -15,  13,  15,  18, -35,  -6, -42,  33,
-    -20,  36,  -1,   4, -38, -14, -18,   2,  27,  20,
-    }, {
-    -55,  -6,  -1, -14,  41, -10,   4, -48, -22,  20,
-     31,  10,  -5,  -7, -20,   9,  16, -45,   8, -19,
-     40, -12,   1,  15,   4,  10, -12, -34, -11,  41,
-     16,  24, -30, -49, -20,  13,  28,  22,  18,  43,
-    }, {
-   -124,  13,  21,  23,  62, -23,   0, -43, -57,  -8,
-     13,  18, -14,  10,  -6,  26,   3, -49,  19, -19,
-     31, -27,   7,   0, -11,  20, -29,   1, -12,  47,
-     -4,  39, -11, -34, -28,   9,   5,  19,  13,  34,
-    }, {
-     34, -14,  -4,  17,  -5,  24,  26, -20,  27,  45,
-     12, -24,   2, -13,  21,   8,  22,  16,  32,   2,
-    -34, -31, -20,   7,  58,  -5,   5,  -2, -38,  12,
-     -2,   1,  -1,  26,  -5,  23,  21,   6,  -8, -11,
-    }, {
-    -34,   6,  18,  55,  15,  11,  21, -16,  -8,  16,
-     -6, -16,  -5,   4,  35,  24,  10,  12,  43,   1,
-    -43, -47, -14,  -8,  43,   5, -10,  34, -39,  18,
-    -22,  16,  17,  42, -13,  19,  -1,   3, -14, -20,
-    }, {
-     -5,  -7,   7,   4,   9,   0,  21, -28,   6,  48,
-     -2,  14,  15, -20,   5,   0,  27,  14,  32,  28,
-      5, -32,   2,  -6,  32,  -3,  12,   5,  -8,  25,
-     14,   4, -12, -11,   4,  47,  45,  22, -22,   2,
-    }, {
-    -74,  12,  30,  42,  30, -14,  16, -23, -29,  19,
-    -20,  21,   7,  -1,  19,  17,  14,  10,  43,  27,
-     -3, -48,   8, -22,  16,   7,  -4,  42,  -9,  31,
-     -6,  20,   6,   4,  -3,  43,  22,  20, -28,  -5,
-    }, {
-    -10,  -3,   4,  18,  15, -27,  24, -13,  24,  51,
-     34, -47, -12, -28,  21,  19,  27, -16,  15, -30,
-    -17, -12, -12,   0,  36, -10,  -7, -27, -37,  16,
-     15,  22,  -3,   4, -31,  -1,  42,  -7,  18,   9,
-    }, {
-    -79,  17,  27,  56,  36, -41,  19,  -8, -10,  22,
-     15, -39, -20,  -9,  35,  35,  15, -20,  26, -31,
-    -26, -27,  -6, -15,  20,   0, -23,   8, -38,  22,
-     -5,  38,  15,  20, -39,  -4,  18,  -9,  13,   1,
-    }, {
-    -50,   3,  16,   5,  30, -53,  19, -20,   3,  55,
-     19,  -8,   0, -34,   5,  11,  32, -18,  15,  -4,
-     22, -13,  10, -13,   9,  -8,   0, -19,  -7,  29,
-     31,  26, -13, -33, -21,  22,  65,   9,   4,  23,
-    }, {
-   -119,  24,  39,  44,  51, -66,  14, -15, -31,  26,
-      1,   0,  -7, -16,  19,  28,  19, -22,  26,  -4,
-     13, -28,  16, -29,  -5,   1, -16,  16,  -8,  35,
-     10,  42,   4, -17, -29,  19,  42,   7,   0,  15,
-    }, {
-     31, -28,   6, -16, -16,  50, -31, -14,   0,   6,
-     36,  17,   0,   0, -29, -14,  11,  18,  20, -25,
-     -6, -33, -19,  20,  43,  21,  21, -14, -55,   0,
-    -32, -40, -42,  39,   1,  -8, -14,   8,  -6,  -3,
-    }, {
-    -37,  -8,  29,  22,   4,  37, -36,  -9, -34, -22,
-     17,  24,  -8,  18, -15,   2,  -1,  14,  31, -25,
-    -15, -48, -13,   4,  28,  31,   5,  21, -57,   4,
-    -53, -24, -23,  55,  -6, -12, -37,   6, -11, -11,
-    }, {
-     -7, -22,  18, -29,  -1,  25, -36, -21, -20,   9,
-     22,  56,  11,  -6, -45, -21,  15,  16,  20,   1,
-     33, -34,   2,   6,  17,  23,  28,  -6, -25,  12,
-    -16, -37, -53,   1,  11,  15,   8,  25, -20,  11,
-    }, {
-    -76,  -1,  41,   9,  19,  12, -41, -17, -55, -18,
-      3,  63,   3,  12, -30,  -5,   3,  12,  31,   0,
-     24, -49,   8,  -9,   1,  33,  12,  29, -27,  18,
-    -37, -21, -34,  17,   3,  11, -14,  23, -25,   2,
-    }, {
-    -13, -17,  15, -15,   3,  -1, -33,  -7,  -1,  12,
-     58,  -5, -15, -13, -29,  -3,  16, -13,   4, -57,
-     10, -13, -11,  13,  21,  15,   9, -40, -55,   3,
-    -14, -19, -44,  17, -24, -32,   5,  -4,  21,  18,
-    }, {
-    -82,   3,  38,  23,  24, -15, -38,  -2, -37, -15,
-     39,   2, -23,   4, -15,  12,   3, -17,  15, -58,
-      1, -29,  -6,  -2,   5,  26,  -7,  -4, -56,   9,
-    -35,  -3, -25,  33, -32, -36, -17,  -7,  15,   9,
-    }, {
-    -52, -10,  27, -27,  18, -26, -38, -14, -23,  16,
-     44,  33,  -3, -20, -45, -10,  20, -15,   3, -31,
-     50, -14,  10,   0,  -5,  17,  15, -32, -24,  16,
-      1, -15, -55, -20, -14,  -8,  29,  12,   7,  32,
-    }, {
-   -121,   9,  50,  10,  40, -40, -43,  -9, -58, -12,
-     25,  41, -11,  -2, -31,   5,   8, -19,  15, -32,
-     41, -30,  16, -16, -20,  28,   0,   3, -26,  22,
-    -19,   0, -36,  -4, -22, -12,   6,   9,   1,  24,
-    }, {
-     36, -18,  24,   3, -28,   7, -16,  13,  26,  41,
-     24,  -1,   5, -26,  -3, -12,  27,  46,  27, -10,
-    -24, -34, -10,  -8,  49,   2,  34,   0, -51, -12,
-    -17, -38, -25,  56,   0,   0,  22,  -3, -20, -22,
-    }, {
-    -32,   2,  47,  42,  -7,  -5, -21,  18,  -9,  12,
-      5,   5,  -2,  -8,  10,   4,  14,  42,  38, -10,
-    -33, -49,  -5, -24,  33,  12,  17,  35, -52,  -6,
-    -38, -22,  -7,  72,  -7,  -3,   0,  -6, -25, -30,
-    }, {
-     -2, -11,  36,  -9, -13, -17, -21,   6,   5,  45,
-     10,  36,  18, -33, -19, -19,  31,  44,  27,  15,
-     16, -34,  11, -22,  22,   4,  40,   7, -21,   0,
-     -1, -35, -36,  18,  10,  24,  46,  12, -34,  -8,
-    }, {
-    -71,   9,  59,  29,   8, -30, -26,  11, -30,  16,
-     -8,  44,   9, -14,  -5,  -2,  19,  40,  38,  15,
-      7, -50,  17, -38,   7,  14,  24,  43, -22,   6,
-    -22, -19, -17,  34,   2,  20,  23,  10, -39, -16,
-    }, {
-     -8,  -6,  33,   4,  -7, -44, -18,  21,  23,  48,
-     46, -24,  -9, -40,  -3,  -1,  32,  13,  11, -43,
-     -7, -14,  -3, -15,  26,  -3,  21, -26, -50,  -8,
-      0, -16, -27,  34, -25, -23,  43, -17,   6,  -1,
-    }, {
-    -77,  13,  56,  43,  13, -57, -23,  26, -11,  19,
-     27, -16, -17, -22,  10,  15,  19,  10,  22, -43,
-    -16, -30,   2, -31,  11,   6,   5,   9, -52,  -2,
-    -20,   0,  -8,  50, -33, -27,  19, -19,   1,  -9,
-    }, {
-    -47,   0,  45,  -7,   7, -69, -23,  13,   2,  51,
-     32,  14,   3, -47, -19,  -8,  37,  11,  10, -16,
-     32, -15,  19, -29,   0,  -1,  28, -18, -20,   4,
-     16, -13, -38,  -3, -15,   0,  66,   0,  -7,  13,
-    }, {
-   -116,  20,  68,  30,  28, -83, -28,  18, -32,  22,
-     13,  21,  -5, -28,  -5,   7,  24,   8,  22, -17,
-     23, -30,  25, -45, -15,   9,  11,  18, -22,  10,
-     -4,   2, -19,  12, -23,  -3,  43,  -2, -12,   4,
-    }, {
-     72, -13, -29, -18,   4,  90,  37, -34,   4,  -1,
-     13,  -9,  -6,  11,   2,  24, -13,   3,  -7, -11,
-     -4,   4, -42,  25,  31,  -1,  -8, -29,  -6,  17,
-    -19,   2, -10,  -6,  38,  22, -42, -19,  -6, -11,
-    }, {
-      3,   7,  -6,  20,  25,  77,  32, -29, -31, -30,
-     -4,  -2, -14,  29,  16,  40, -26,   0,   3, -12,
-    -13, -10, -36,   9,  15,   8, -24,   6,  -7,  22,
-    -40,  17,   8,   9,  31,  18, -66, -22, -11, -19,
-    }, {
-     32,  -6, -17, -31,  19,  65,  33, -41, -16,   1,
-      0,  29,   6,   4, -13,  17,  -9,   1,  -8,  14,
-     35,   3, -19,  11,   4,   0,  -1, -21,  23,  30,
-     -3,   5, -20, -44,  48,  46, -19,  -3, -20,   3,
-    }, {
-    -36,  13,   5,   7,  40,  51,  28, -36, -52, -27,
-    -18,  36,  -2,  22,   0,  33, -21,  -2,   3,  13,
-     26, -11, -14,  -4, -10,  10, -18,  14,  22,  36,
-    -24,  21,  -1, -28,  40,  42, -42,  -5, -25,  -5,
-    }, {
-     27,  -1, -20, -17,  24,  38,  35, -26,   1,   4,
-     35, -32, -21,  -3,   2,  35,  -8, -29, -24, -44,
-     12,  24, -34,  18,   8,  -7, -21, -55,  -5,  21,
-     -2,  23, -11, -28,  13,  -1, -22, -33,  21,  10,
-    }, {
-    -41,  18,   2,  21,  45,  24,  30, -21, -33, -24,
-     17, -24, -29,  15,  16,  51, -21, -33, -13, -45,
-      3,   8, -28,   2,  -7,   2, -37, -19,  -7,  27,
-    -22,  39,   7, -12,   5,  -5, -45, -35,  15,   1,
-    }, {
-    -12,   4,  -8, -29,  39,  12,  30, -33, -19,   8,
-     21,   6,  -8,  -9, -13,  28,  -4, -31, -24, -18,
-     52,  23, -12,   4, -18,  -5, -14, -47,  24,  34,
-     14,  27, -22, -66,  22,  22,   1, -16,   6,  24,
-    }, {
-    -81,  25,  14,   8,  61,   0,  25, -28, -54, -20,
-      3,  14, -17,   8,   0,  44, -16, -35, -13, -18,
-     43,   7,  -6, -11, -33,   4, -30, -11,  22,  40,
-     -6,  43,  -3, -50,  14,  18, -22, -18,   1,  16,
-    }, {
-     77,  -2, -11,   1,  -7,  47,  52,  -5,  29,  33,
-      1, -28,   0, -15,  28,  26,   2,  30,   0,   2,
-    -22,   4, -33,  -3,  36, -21,   3, -15,  -2,   5,
-     -4,   4,   6,   9,  37,  31,  -5, -32, -20, -30,
-    }, {
-      8,  17,  10,  40,  13,  34,  47,   0,  -5,   4,
-    -16, -21,  -8,   2,  42,  43, -10,  26,  10,   2,
-    -31, -11, -27, -19,  21, -10, -12,  20,  -3,  11,
-    -25,  20,  25,  25,  29,  28, -28, -34, -25, -38,
-    }, {
-     37,   3,   0, -10,   7,  22,  48, -12,   8,  36,
-    -12,   9,  12, -22,  12,  19,   6,  28,   0,  29,
-     18,   3, -11, -17,  10, -18,  10,  -7,  27,  18,
-     11,   7,  -3, -28,  47,  55,  18, -15, -34, -16,
-    }, {
-    -31,  24,  23,  27,  29,   9,  43,  -8, -26,   7,
-    -30,  17,   4,  -3,  26,  35,  -5,  24,  10,  28,
-      9, -12,  -5, -33,  -5,  -8,  -5,  29,  26,  24,
-     -9,  23,  14, -12,  39,  52,  -5, -18, -39, -24,
-    }, {
-     32,   8,  -3,   2,  13,  -4,  50,   1,  27,  39,
-     23, -51, -15, -30,  27,  37,   7,  -1, -17, -29,
-     -5,  23, -25, -10,  14, -26,  -8, -41,  -1,   9,
-     13,  26,   5, -12,  12,   7,  14, -45,   6,  -9,
-    }, {
-    -36,  29,  19,  41,  34, -18,  45,   6,  -8,  10,
-      5, -43, -23, -11,  42,  53,  -5,  -5,  -6, -30,
-    -14,   8, -20, -26,  -1, -16, -25,  -4,  -3,  15,
-     -7,  41,  23,   3,   4,   3,  -8, -48,   1, -17,
-    }, {
-     -7,  15,   9,  -9,  28, -29,  45,  -5,   6,  43,
-      9, -12,  -2, -36,  12,  30,  11,  -3, -17,  -3,
-     34,  22,  -3, -24, -12, -24,  -2, -32,  28,  22,
-     29,  29,  -5, -50,  21,  31,  38, -29,  -7,   5,
-    }, {
-    -76,  35,  31,  28,  49, -43,  40,   0, -29,  14,
-     -8,  -5, -10, -18,  26,  46,   0,  -7,  -6,  -3,
-     25,   7,   2, -40, -28, -14, -18,   3,  27,  28,
-      8,  45,  13, -34,  13,  27,  15, -31, -12,  -3,
-    }, {
-     74, -17,   0, -31, -18,  73,  -5,   0,   3,  -5,
-     25,  12,  -3,  -1, -22,   3,  -9,  33, -12, -24,
-      6,   2, -33,   9,  21,   5,  20, -27, -19,  -7,
-    -34, -37, -34,  22,  44,   0, -41, -29, -17, -21,
-    }, {
-      5,   3,  21,   7,   2,  60, -10,   5, -32, -34,
-      7,  20, -11,  16,  -8,  20, -21,  29,  -1, -24,
-     -2, -13, -27,  -6,   5,  15,   3,   8, -21,  -1,
-    -55, -21, -15,  38,  37,  -3, -65, -32, -23, -30,
-    }, {
-     35, -10,  11, -44,  -3,  48, -10,  -6, -17,  -2,
-     11,  51,   8,  -8, -38,  -3,  -4,  31, -12,   2,
-     46,   1, -10,  -4,  -5,   7,  26, -19,  10,   5,
-    -18, -34, -45, -15,  54,  24, -18, -13, -31,  -7,
-    }, {
-    -33,  10,  34,  -5,  17,  35, -15,  -1, -53, -30,
-     -6,  59,   0,  10, -24,  13, -17,  27,  -1,   1,
-     37, -13,  -4, -20, -20,  18,  10,  16,   8,  11,
-    -39, -18, -26,   0,  46,  20, -41, -15, -37, -15,
-    }, {
-     29,  -5,   7, -30,   1,  21,  -7,   7,   0,   0,
-     47,  -9, -18, -15, -22,  14,  -4,   0, -28, -57,
-     23,  21, -25,   2,  -1,   0,   7, -53, -19,  -3,
-    -17, -15, -36,   0,  19, -24, -21, -43,   9,   0,
-    }, {
-    -39,  14,  30,   8,  22,   8, -12,  12, -34, -27,
-     29,  -2, -26,   2,  -8,  31, -16,  -3, -17, -57,
-     14,   6, -19, -13, -16,  10,  -8, -17, -20,   2,
-    -38,   0, -17,  16,  11, -27, -44, -45,   4,  -8,
-    }, {
-     -9,   1,  20, -43,  17,  -3, -12,   0, -20,   4,
-     33,  29,  -6, -22, -38,   7,   0,  -1, -29, -30,
-     63,  21,  -3, -11, -27,   1,  14, -45,  10,   9,
-     -1, -12, -47, -37,  28,   0,   2, -26,  -4,  13,
-    }, {
-    -78,  21,  43,  -4,  38, -17, -17,   5, -55, -24,
-     15,  36, -14,  -4, -24,  24, -12,  -5, -17, -31,
-     54,   5,   2, -27, -43,  12,  -2,  -9,   9,  15,
-    -22,   3, -28, -21,  20,  -3, -20, -28,  -9,   5,
-    }, {
-     80,  -6,  16, -11, -30,  30,   9,  28,  28,  29,
-     13,  -6,   2, -28,   3,   5,   7,  60,  -5,  -9,
-    -11,   1, -24, -19,  27, -13,  32, -13, -15, -19,
-    -19, -35, -17,  39,  43,   9,  -4, -42, -32, -41,
-    }, {
-     11,  14,  39,  27,  -9,  17,   4,  33,  -6,   0,
-     -4,   1,  -5, -10,  17,  22,  -5,  57,   5,  -9,
-    -20, -13, -18, -35,  11,  -3,  16,  22, -17, -13,
-    -40, -19,   1,  55,  35,   5, -27, -44, -37, -49,
-    }, {
-     40,   0,  28, -24, -14,   5,   4,  21,   7,  33,
-      0,  32,  15, -35, -12,  -1,  11,  58,  -5,  16,
-     28,   0,  -1, -33,   0, -11,  39,  -5,  14,  -6,
-     -3, -31, -28,   1,  53,  33,  19, -25, -46, -26,
-    }, {
-    -28,  20,  51,  14,   6,  -7,   0,  26, -27,   4,
-    -18,  40,   6, -16,   1,  15,   0,  55,   5,  16,
-     19, -14,   3, -49, -14,  -1,  22,  30,  12,   0,
-    -24, -15,  -9,  17,  45,  29,  -4, -28, -51, -35,
-    }, {
-     34,   4,  25, -10,  -9, -21,   7,  36,  26,  36,
-     35, -28, -12, -42,   3,  16,  12,  28, -21, -42,
-      5,  21, -16, -26,   4, -19,  19, -39, -15, -15,
-     -1, -13, -19,  17,  17, -14,  15, -55,  -4, -19,
-    }, {
-    -34,  25,  48,  28,  11, -34,   2,  41,  -9,   7,
-     17, -21, -20, -24,  17,  33,   0,  24, -10, -42,
-     -3,   5, -10, -42, -11,  -8,   3,  -3, -16,  -9,
-    -22,   2,   0,  33,  10, -18,  -7, -58, -10, -28,
-    }, {
-     -4,  11,  37, -23,   5, -46,   2,  29,   5,  39,
-     21,   9,   0, -49, -12,   9,  16,  26, -22, -15,
-     45,  20,   5, -40, -22, -17,  26, -31,  14,  -2,
-     14, -10, -30, -20,  27,   9,  39, -39, -18,  -5,
-    }, {
-    -73,  32,  60,  15,  26, -59,  -2,  33, -30,  10,
-      3,  17,  -8, -30,   1,  26,   4,  22, -10, -16,
-     36,   5,  11, -56, -37,  -6,  10,   5,  13,   3,
-     -6,   5, -11,  -4,  19,   5,  16, -41, -24, -13
-    }
-};
-
-const uint16_t ff_cb1_base[128]={
-    19657, 18474, 18365, 17520, 21048, 18231, 18584, 16671,
-    20363, 19069, 19409, 18430, 21844, 18753, 19613, 17411,
-    20389, 21772, 20129, 21702, 20978, 20472, 19627, 19387,
-    21477, 23134, 21841, 23919, 22089, 21519, 21134, 20852,
-    19675, 17821, 19044, 17477, 19986, 16955, 18446, 16086,
-    21138, 18899, 20952, 18929, 21452, 17833, 20104, 17159,
-    19770, 20056, 20336, 20866, 19329, 18217, 18908, 18004,
-    21556, 21948, 23079, 23889, 20922, 19544, 20984, 19781,
-    19781, 20984, 19544, 20922, 23889, 23079, 21948, 21556,
-    18004, 18908, 18217, 19329, 20866, 20336, 20056, 19770,
-    17159, 20104, 17833, 21452, 18929, 20952, 18899, 21138,
-    16086, 18446, 16955, 19986, 17477, 19044, 17821, 19675,
-    20852, 21134, 21519, 22089, 23919, 21841, 23134, 21477,
-    19387, 19627, 20472, 20978, 21702, 20129, 21772, 20389,
-    17411, 19613, 18753, 21844, 18430, 19409, 19069, 20363,
-    16671, 18584, 18231, 21048, 17520, 18365, 18474, 19657,
-};
-
-const uint16_t ff_cb2_base[128]={
-    12174, 13380, 13879, 13832, 13170, 13227, 13204, 12053,
-    12410, 13988, 14348, 14631, 13100, 13415, 13224, 12268,
-    11982, 13825, 13499, 14210, 13877, 14788, 13811, 13109,
-    11449, 13275, 12833, 13717, 12728, 13696, 12759, 12405,
-    10230, 12185, 11628, 13161, 11762, 13458, 12312, 12818,
-    10443, 12773, 12011, 14020, 11818, 13825, 12453, 13226,
-    10446, 13162, 11881, 14300, 12859, 16288, 13490, 15053,
-    10155, 12820, 11519, 13973, 12041, 15081, 12635, 14198,
-    14198, 12635, 15081, 12041, 13973, 11519, 12820, 10155,
-    15053, 13490, 16288, 12859, 14300, 11881, 13162, 10446,
-    13226, 12453, 13825, 11818, 14020, 12011, 12773, 10443,
-    12818, 12312, 13458, 11762, 13161, 11628, 12185, 10230,
-    12405, 12759, 13696, 12728, 13717, 12833, 13275, 11449,
-    13109, 13811, 14788, 13877, 14210, 13499, 13825, 11982,
-    12268, 13224, 13415, 13100, 14631, 14348, 13988, 12410,
-    12053, 13204, 13227, 13170, 13832, 13879, 13380, 12174,
-};
-
-const int16_t ff_energy_tab[32]={
-        0,    16,    20,    25,    32,    41,    51,    65,
-       81,   103,   129,   163,   205,   259,   326,   410,
-      516,   650,   819,  1031,  1298,  1634,  2057,  2590,
-     3261,  4105,  5168,  6507,  8192, 10313, 12983, 16345
-};
-
-static const int16_t lpc_refl_cb1[64]={
-    -4041, -4018, -3998, -3977, -3954, -3930, -3906, -3879,
-    -3852, -3825, -3795, -3764, -3731, -3699, -3666, -3631,
-    -3594, -3555, -3513, -3468, -3420, -3372, -3321, -3268,
-    -3212, -3153, -3090, -3021, -2944, -2863, -2772, -2676,
-    -2565, -2445, -2328, -2202, -2072, -1941, -1808, -1660,
-    -1508, -1348, -1185,  -994,  -798,  -600,  -374,  -110,
-      152,   447,   720,   982,  1229,  1456,  1682,  1916,
-     2130,  2353,  2595,  2853,  3118,  3363,  3588,  3814
-};
-
-static const int16_t lpc_refl_cb2[32]={
-    -3091, -2386, -1871, -1425, -1021,  -649,  -316,   -20,
-      267,   544,   810,  1065,  1305,  1534,  1756,  1970,
-     2171,  2359,  2536,  2700,  2854,  2996,  3133,  3263,
-     3386,  3499,  3603,  3701,  3789,  3870,  3947,  4020
-};
-
-static const int16_t lpc_refl_cb3[32]={
-    -3525, -3295, -3081, -2890, -2696, -2511, -2328, -2149,
-    -1979, -1817, -1658, -1498, -1341, -1188, -1032,  -876,
-     -721,  -561,  -394,  -228,   -54,   119,   296,   484,
-      683,   895,  1123,  1373,  1651,  1965,  2360,  2854
-};
-
-static const int16_t lpc_refl_cb4[16]={
-    -1845, -1057,  -522,   -77,   301,   647,   975,  1285,
-     1582,  1873,  2163,  2452,  2735,  3017,  3299,  3569
-};
-
-static const int16_t lpc_refl_cb5[16]={
-    -2691, -2187, -1788, -1435, -1118,  -837,  -571,  -316,
-      -59,   201,   470,   759,  1077,  1457,  1908,  2495
-};
-
-static const int16_t lpc_refl_cb6[8]={
-    -1372,  -474,   133,   632,  1100,  1571,  2075,  2672
-};
-
-static const int16_t lpc_refl_cb7[8]={
-    -2389, -1787, -1231,  -717,  -239,   234,   770,  1474
-};
-
-static const int16_t lpc_refl_cb8[8]={
-    -1569,  -864,  -296,   200,   670,  1151,  1709,  2385
-};
-
-static const int16_t lpc_refl_cb9[8]={
-    -2200, -1608, -1062,  -569,  -120,   338,   863,  1621
-};
-
-static const int16_t lpc_refl_cb10[4]={
-     -617,   190,   802,  1483
-};
-
-const int16_t * const ff_lpc_refl_cb[10]={
-    lpc_refl_cb1, lpc_refl_cb2, lpc_refl_cb3, lpc_refl_cb4, lpc_refl_cb5,
-    lpc_refl_cb6, lpc_refl_cb7, lpc_refl_cb8, lpc_refl_cb9, lpc_refl_cb10
-};
-
-static void add_wav(int16_t *dest, int n, int skip_first, int *m,
-                    const int16_t *s1, const int8_t *s2, const int8_t *s3)
-{
-    int i;
-    int v[3];
-
-    v[0] = 0;
-    for (i=!skip_first; i<3; i++)
-        v[i] = (ff_gain_val_tab[n][i] * m[i]) >> ff_gain_exp_tab[n];
-
-    if (v[0]) {
-        for (i=0; i < BLOCKSIZE; i++)
-            dest[i] = (s1[i]*v[0] + s2[i]*v[1] + s3[i]*v[2]) >> 12;
-    } else {
-        for (i=0; i < BLOCKSIZE; i++)
-            dest[i] = (             s2[i]*v[1] + s3[i]*v[2]) >> 12;
-    }
-}
-
-/**
- * Copy the last offset values of *source to *target. If those values are not
- * enough to fill the target buffer, fill it with another copy of those values.
- */
-void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset)
-{
-    source += BUFFERSIZE - offset;
-
-    memcpy(target, source, FFMIN(BLOCKSIZE, offset)*sizeof(*target));
-    if (offset < BLOCKSIZE)
-        memcpy(target + offset, source, (BLOCKSIZE - offset)*sizeof(*target));
-}
-
-/**
- * Evaluate the reflection coefficients from the filter coefficients.
- *
- * @return 1 if one of the reflection coefficients is greater than
- *         4095, 0 if not.
- */
-int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx)
-{
-    int b, i, j;
-    int buffer1[LPC_ORDER];
-    int buffer2[LPC_ORDER];
-    int *bp1 = buffer1;
-    int *bp2 = buffer2;
-
-    for (i=0; i < LPC_ORDER; i++)
-        buffer2[i] = coefs[i];
-
-    refl[LPC_ORDER-1] = bp2[LPC_ORDER-1];
-
-    if ((unsigned) bp2[LPC_ORDER-1] + 0x1000 > 0x1fff) {
-        av_log(avctx, AV_LOG_ERROR, "Overflow. Broken sample?\n");
-        return 1;
-    }
-
-    for (i = LPC_ORDER-2; i >= 0; i--) {
-        b = 0x1000-((bp2[i+1] * bp2[i+1]) >> 12);
-
-        if (!b)
-            b = -2;
-
-        for (j=0; j <= i; j++)
-            bp1[j] = ((bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12)) * (0x1000000 / b)) >> 12;
-
-        if ((unsigned) bp1[i] + 0x1000 > 0x1fff)
-            return 1;
-
-        refl[i] = bp1[i];
-
-        FFSWAP(int *, bp1, bp2);
-    }
-    return 0;
-}
-
-/**
- * Evaluate the LPC filter coefficients from the reflection coefficients.
- * Does the inverse of the ff_eval_refl() function.
- */
-void ff_eval_coefs(int *coefs, const int *refl)
-{
-    int buffer[LPC_ORDER];
-    int *b1 = buffer;
-    int *b2 = coefs;
-    int i, j;
-
-    for (i=0; i < LPC_ORDER; i++) {
-        b1[i] = refl[i] << 4;
-
-        for (j=0; j < i; j++)
-            b1[j] = ((refl[i] * b2[i-j-1]) >> 12) + b2[j];
-
-        FFSWAP(int *, b1, b2);
-    }
-
-    for (i=0; i < LPC_ORDER; i++)
-        coefs[i] >>= 4;
-}
-
-void ff_int_to_int16(int16_t *out, const int *inp)
-{
-    int i;
-
-    for (i = 0; i < LPC_ORDER; i++)
-        *out++ = *inp++;
-}
-
-/**
- * Evaluate sqrt(x << 24). x must fit in 20 bits. This value is evaluated in an
- * odd way to make the output identical to the binary decoder.
- */
-int ff_t_sqrt(unsigned int x)
-{
-    int s = 2;
-    while (x > 0xfff) {
-        s++;
-        x >>= 2;
-    }
-
-    return ff_sqrt(x << 20) << s;
-}
-
-unsigned int ff_rms(const int *data)
-{
-    int i;
-    unsigned int res = 0x10000;
-    int b = LPC_ORDER;
-
-    for (i = 0; i < LPC_ORDER; i++) {
-        res = (((0x1000000 - data[i]*data[i]) >> 12) * res) >> 12;
-
-        if (res == 0)
-            return 0;
-
-        while (res <= 0x3fff) {
-            b++;
-            res <<= 2;
-        }
-    }
-
-    return ff_t_sqrt(res) >> b;
-}
-
-int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold, int energy)
-{
-    int work[LPC_ORDER];
-    int b = NBLOCKS - a;
-    int i;
-
-    // Interpolate block coefficients from the this frame's forth block and
-    // last frame's forth block.
-    for (i = 0; i < LPC_ORDER; i++)
-        out[i] = (a * ractx->lpc_coef[0][i] + b * ractx->lpc_coef[1][i])>> 2;
-
-    if (ff_eval_refl(work, out, ractx->avctx)) {
-        // The interpolated coefficients are unstable, copy either new or old
-        // coefficients.
-        ff_int_to_int16(out, ractx->lpc_coef[copyold]);
-        return ff_rescale_rms(ractx->lpc_refl_rms[copyold], energy);
-    } else {
-        return ff_rescale_rms(ff_rms(work), energy);
-    }
-}
-
-unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy)
-{
-    return (rms * energy) >> 10;
-}
-
-/** inverse root mean square */
-int ff_irms(const int16_t *data)
-{
-    unsigned int i, sum = 0;
-
-    for (i=0; i < BLOCKSIZE; i++)
-        sum += data[i] * data[i];
-
-    if (sum == 0)
-        return 0; /* OOPS - division by zero */
-
-    return 0x20000000 / (ff_t_sqrt(sum) >> 8);
-}
-
-void ff_subblock_synthesis(RA144Context *ractx, const uint16_t *lpc_coefs,
-                           int cba_idx, int cb1_idx, int cb2_idx,
-                           int gval, int gain)
-{
-    uint16_t buffer_a[BLOCKSIZE];
-    uint16_t *block;
-    int m[3];
-
-    if (cba_idx) {
-        cba_idx += BLOCKSIZE/2 - 1;
-        ff_copy_and_dup(buffer_a, ractx->adapt_cb, cba_idx);
-        m[0] = (ff_irms(buffer_a) * gval) >> 12;
-    } else {
-        m[0] = 0;
-    }
-    m[1] = (ff_cb1_base[cb1_idx] * gval) >> 8;
-    m[2] = (ff_cb2_base[cb2_idx] * gval) >> 8;
-    memmove(ractx->adapt_cb, ractx->adapt_cb + BLOCKSIZE,
-            (BUFFERSIZE - BLOCKSIZE) * sizeof(*ractx->adapt_cb));
-
-    block = ractx->adapt_cb + BUFFERSIZE - BLOCKSIZE;
-
-    add_wav(block, gain, cba_idx, m, cba_idx? buffer_a: NULL,
-            ff_cb1_vects[cb1_idx], ff_cb2_vects[cb2_idx]);
-
-    memcpy(ractx->curr_sblock, ractx->curr_sblock + BLOCKSIZE,
-           LPC_ORDER*sizeof(*ractx->curr_sblock));
-
-    if (ff_celp_lp_synthesis_filter(ractx->curr_sblock + LPC_ORDER, lpc_coefs,
-                                    block, BLOCKSIZE, LPC_ORDER, 1, 0, 0xfff))
-        memset(ractx->curr_sblock, 0, (LPC_ORDER+BLOCKSIZE)*sizeof(*ractx->curr_sblock));
-}
diff --git a/deps/libav/libavcodec/ra144.h b/deps/libav/libavcodec/ra144.h
deleted file mode 100644
index 81d6964..0000000
--- a/deps/libav/libavcodec/ra144.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Real Audio 1.0 (14.4K)
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_RA144_H
-#define AVCODEC_RA144_H
-
-#include <stdint.h>
-#include "lpc.h"
-#include "audio_frame_queue.h"
-
-#define NBLOCKS         4       ///< number of subblocks within a block
-#define BLOCKSIZE       40      ///< subblock size in 16-bit words
-#define BUFFERSIZE      146     ///< the size of the adaptive codebook
-#define FIXED_CB_SIZE   128     ///< size of fixed codebooks
-#define FRAMESIZE       20      ///< size of encoded frame
-#define LPC_ORDER       10      ///< order of LPC filter
-
-typedef struct RA144Context {
-    AVCodecContext *avctx;
-    LPCContext lpc_ctx;
-    AudioFrameQueue afq;
-    int last_frame;
-
-    unsigned int     old_energy;        ///< previous frame energy
-
-    unsigned int     lpc_tables[2][10];
-
-    /** LPC coefficients: lpc_coef[0] is the coefficients of the current frame
-     *  and lpc_coef[1] of the previous one. */
-    unsigned int    *lpc_coef[2];
-
-    unsigned int     lpc_refl_rms[2];
-
-    int16_t curr_block[NBLOCKS * BLOCKSIZE];
-
-    /** The current subblock padded by the last 10 values of the previous one. */
-    int16_t curr_sblock[50];
-
-    /** Adaptive codebook, its size is two units bigger to avoid a
-     *  buffer overflow. */
-    uint16_t adapt_cb[146+2];
-} RA144Context;
-
-void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset);
-int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx);
-void ff_eval_coefs(int *coefs, const int *refl);
-void ff_int_to_int16(int16_t *out, const int *inp);
-int ff_t_sqrt(unsigned int x);
-unsigned int ff_rms(const int *data);
-int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold,
-              int energy);
-unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy);
-int ff_irms(const int16_t *data);
-void ff_subblock_synthesis(RA144Context *ractx, const uint16_t *lpc_coefs,
-                           int cba_idx, int cb1_idx, int cb2_idx,
-                           int gval, int gain);
-
-extern const int16_t ff_gain_val_tab[256][3];
-extern const uint8_t ff_gain_exp_tab[256];
-extern const int8_t ff_cb1_vects[128][40];
-extern const int8_t ff_cb2_vects[128][40];
-extern const uint16_t ff_cb1_base[128];
-extern const uint16_t ff_cb2_base[128];
-extern const int16_t ff_energy_tab[32];
-extern const int16_t * const ff_lpc_refl_cb[10];
-
-#endif /* AVCODEC_RA144_H */
diff --git a/deps/libav/libavcodec/ra144dec.c b/deps/libav/libavcodec/ra144dec.c
deleted file mode 100644
index 3be3877..0000000
--- a/deps/libav/libavcodec/ra144dec.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Real Audio 1.0 (14.4K)
- *
- * Copyright (c) 2008 Vitor Sessak
- * Copyright (c) 2003 Nick Kurshev
- *     Based on public domain decoder at http://www.honeypot.net/audio
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "ra144.h"
-
-
-static av_cold int ra144_decode_init(AVCodecContext * avctx)
-{
-    RA144Context *ractx = avctx->priv_data;
-
-    ractx->avctx = avctx;
-
-    ractx->lpc_coef[0] = ractx->lpc_tables[0];
-    ractx->lpc_coef[1] = ractx->lpc_tables[1];
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
-
-    return 0;
-}
-
-static void do_output_subblock(RA144Context *ractx, const uint16_t  *lpc_coefs,
-                               int gval, GetBitContext *gb)
-{
-    int cba_idx = get_bits(gb, 7); // index of the adaptive CB, 0 if none
-    int gain    = get_bits(gb, 8);
-    int cb1_idx = get_bits(gb, 7);
-    int cb2_idx = get_bits(gb, 7);
-
-    ff_subblock_synthesis(ractx, lpc_coefs, cba_idx, cb1_idx, cb2_idx, gval,
-                          gain);
-}
-
-/** Uncompress one block (20 bytes -> 160*2 bytes). */
-static int ra144_decode_frame(AVCodecContext * avctx, void *data,
-                              int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    static const uint8_t sizes[LPC_ORDER] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2};
-    unsigned int refl_rms[NBLOCKS];           // RMS of the reflection coefficients
-    uint16_t block_coefs[NBLOCKS][LPC_ORDER]; // LPC coefficients of each sub-block
-    unsigned int lpc_refl[LPC_ORDER];         // LPC reflection coefficients of the frame
-    int i, j;
-    int ret;
-    int16_t *samples;
-    unsigned int energy;
-
-    RA144Context *ractx = avctx->priv_data;
-    GetBitContext gb;
-
-    if (buf_size < FRAMESIZE) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Frame too small (%d bytes). Truncated file?\n", buf_size);
-        *got_frame_ptr = 0;
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = NBLOCKS * BLOCKSIZE;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (int16_t *)frame->data[0];
-
-    init_get_bits(&gb, buf, FRAMESIZE * 8);
-
-    for (i = 0; i < LPC_ORDER; i++)
-        lpc_refl[i] = ff_lpc_refl_cb[i][get_bits(&gb, sizes[i])];
-
-    ff_eval_coefs(ractx->lpc_coef[0], lpc_refl);
-    ractx->lpc_refl_rms[0] = ff_rms(lpc_refl);
-
-    energy = ff_energy_tab[get_bits(&gb, 5)];
-
-    refl_rms[0] = ff_interp(ractx, block_coefs[0], 1, 1, ractx->old_energy);
-    refl_rms[1] = ff_interp(ractx, block_coefs[1], 2,
-                            energy <= ractx->old_energy,
-                            ff_t_sqrt(energy*ractx->old_energy) >> 12);
-    refl_rms[2] = ff_interp(ractx, block_coefs[2], 3, 0, energy);
-    refl_rms[3] = ff_rescale_rms(ractx->lpc_refl_rms[0], energy);
-
-    ff_int_to_int16(block_coefs[3], ractx->lpc_coef[0]);
-
-    for (i=0; i < NBLOCKS; i++) {
-        do_output_subblock(ractx, block_coefs[i], refl_rms[i], &gb);
-
-        for (j=0; j < BLOCKSIZE; j++)
-            *samples++ = av_clip_int16(ractx->curr_sblock[j + 10] << 2);
-    }
-
-    ractx->old_energy = energy;
-    ractx->lpc_refl_rms[1] = ractx->lpc_refl_rms[0];
-
-    FFSWAP(unsigned int *, ractx->lpc_coef[0], ractx->lpc_coef[1]);
-
-    *got_frame_ptr = 1;
-
-    return FRAMESIZE;
-}
-
-AVCodec ff_ra_144_decoder = {
-    .name           = "real_144",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_RA_144,
-    .priv_data_size = sizeof(RA144Context),
-    .init           = ra144_decode_init,
-    .decode         = ra144_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/ra144enc.c b/deps/libav/libavcodec/ra144enc.c
deleted file mode 100644
index 9f953d4..0000000
--- a/deps/libav/libavcodec/ra144enc.c
+++ /dev/null
@@ -1,558 +0,0 @@
-/*
- * Real Audio 1.0 (14.4K) encoder
- * Copyright (c) 2010 Francesco Lavra <francescolavra at interfree.it>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Real Audio 1.0 (14.4K) encoder
- * @author Francesco Lavra <francescolavra at interfree.it>
- */
-
-#include <float.h>
-
-#include "avcodec.h"
-#include "audio_frame_queue.h"
-#include "internal.h"
-#include "put_bits.h"
-#include "celp_filters.h"
-#include "ra144.h"
-
-
-static av_cold int ra144_encode_close(AVCodecContext *avctx)
-{
-    RA144Context *ractx = avctx->priv_data;
-    ff_lpc_end(&ractx->lpc_ctx);
-    ff_af_queue_close(&ractx->afq);
-    return 0;
-}
-
-
-static av_cold int ra144_encode_init(AVCodecContext * avctx)
-{
-    RA144Context *ractx;
-    int ret;
-
-    if (avctx->channels != 1) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n",
-               avctx->channels);
-        return -1;
-    }
-    avctx->frame_size = NBLOCKS * BLOCKSIZE;
-    avctx->delay      = avctx->frame_size;
-    avctx->bit_rate = 8000;
-    ractx = avctx->priv_data;
-    ractx->lpc_coef[0] = ractx->lpc_tables[0];
-    ractx->lpc_coef[1] = ractx->lpc_tables[1];
-    ractx->avctx = avctx;
-    ret = ff_lpc_init(&ractx->lpc_ctx, avctx->frame_size, LPC_ORDER,
-                      FF_LPC_TYPE_LEVINSON);
-    if (ret < 0)
-        goto error;
-
-    ff_af_queue_init(avctx, &ractx->afq);
-
-    return 0;
-error:
-    ra144_encode_close(avctx);
-    return ret;
-}
-
-
-/**
- * Quantize a value by searching a sorted table for the element with the
- * nearest value
- *
- * @param value value to quantize
- * @param table array containing the quantization table
- * @param size size of the quantization table
- * @return index of the quantization table corresponding to the element with the
- *         nearest value
- */
-static int quantize(int value, const int16_t *table, unsigned int size)
-{
-    unsigned int low = 0, high = size - 1;
-
-    while (1) {
-        int index = (low + high) >> 1;
-        int error = table[index] - value;
-
-        if (index == low)
-            return table[high] + error > value ? low : high;
-        if (error > 0) {
-            high = index;
-        } else {
-            low = index;
-        }
-    }
-}
-
-
-/**
- * Orthogonalize a vector to another vector
- *
- * @param v vector to orthogonalize
- * @param u vector against which orthogonalization is performed
- */
-static void orthogonalize(float *v, const float *u)
-{
-    int i;
-    float num = 0, den = 0;
-
-    for (i = 0; i < BLOCKSIZE; i++) {
-        num += v[i] * u[i];
-        den += u[i] * u[i];
-    }
-    num /= den;
-    for (i = 0; i < BLOCKSIZE; i++)
-        v[i] -= num * u[i];
-}
-
-
-/**
- * Calculate match score and gain of an LPC-filtered vector with respect to
- * input data, possibly othogonalizing it to up to 2 other vectors
- *
- * @param work array used to calculate the filtered vector
- * @param coefs coefficients of the LPC filter
- * @param vect original vector
- * @param ortho1 first vector against which orthogonalization is performed
- * @param ortho2 second vector against which orthogonalization is performed
- * @param data input data
- * @param score pointer to variable where match score is returned
- * @param gain pointer to variable where gain is returned
- */
-static void get_match_score(float *work, const float *coefs, float *vect,
-                            const float *ortho1, const float *ortho2,
-                            const float *data, float *score, float *gain)
-{
-    float c, g;
-    int i;
-
-    ff_celp_lp_synthesis_filterf(work, coefs, vect, BLOCKSIZE, LPC_ORDER);
-    if (ortho1)
-        orthogonalize(work, ortho1);
-    if (ortho2)
-        orthogonalize(work, ortho2);
-    c = g = 0;
-    for (i = 0; i < BLOCKSIZE; i++) {
-        g += work[i] * work[i];
-        c += data[i] * work[i];
-    }
-    if (c <= 0) {
-        *score = 0;
-        return;
-    }
-    *gain = c / g;
-    *score = *gain * c;
-}
-
-
-/**
- * Create a vector from the adaptive codebook at a given lag value
- *
- * @param vect array where vector is stored
- * @param cb adaptive codebook
- * @param lag lag value
- */
-static void create_adapt_vect(float *vect, const int16_t *cb, int lag)
-{
-    int i;
-
-    cb += BUFFERSIZE - lag;
-    for (i = 0; i < FFMIN(BLOCKSIZE, lag); i++)
-        vect[i] = cb[i];
-    if (lag < BLOCKSIZE)
-        for (i = 0; i < BLOCKSIZE - lag; i++)
-            vect[lag + i] = cb[i];
-}
-
-
-/**
- * Search the adaptive codebook for the best entry and gain and remove its
- * contribution from input data
- *
- * @param adapt_cb array from which the adaptive codebook is extracted
- * @param work array used to calculate LPC-filtered vectors
- * @param coefs coefficients of the LPC filter
- * @param data input data
- * @return index of the best entry of the adaptive codebook
- */
-static int adaptive_cb_search(const int16_t *adapt_cb, float *work,
-                              const float *coefs, float *data)
-{
-    int i, best_vect;
-    float score, gain, best_score, best_gain;
-    float exc[BLOCKSIZE];
-
-    gain = best_score = 0;
-    for (i = BLOCKSIZE / 2; i <= BUFFERSIZE; i++) {
-        create_adapt_vect(exc, adapt_cb, i);
-        get_match_score(work, coefs, exc, NULL, NULL, data, &score, &gain);
-        if (score > best_score) {
-            best_score = score;
-            best_vect = i;
-            best_gain = gain;
-        }
-    }
-    if (!best_score)
-        return 0;
-
-    /**
-     * Re-calculate the filtered vector from the vector with maximum match score
-     * and remove its contribution from input data.
-     */
-    create_adapt_vect(exc, adapt_cb, best_vect);
-    ff_celp_lp_synthesis_filterf(work, coefs, exc, BLOCKSIZE, LPC_ORDER);
-    for (i = 0; i < BLOCKSIZE; i++)
-        data[i] -= best_gain * work[i];
-    return best_vect - BLOCKSIZE / 2 + 1;
-}
-
-
-/**
- * Find the best vector of a fixed codebook by applying an LPC filter to
- * codebook entries, possibly othogonalizing them to up to 2 other vectors and
- * matching the results with input data
- *
- * @param work array used to calculate the filtered vectors
- * @param coefs coefficients of the LPC filter
- * @param cb fixed codebook
- * @param ortho1 first vector against which orthogonalization is performed
- * @param ortho2 second vector against which orthogonalization is performed
- * @param data input data
- * @param idx pointer to variable where the index of the best codebook entry is
- *        returned
- * @param gain pointer to variable where the gain of the best codebook entry is
- *        returned
- */
-static void find_best_vect(float *work, const float *coefs,
-                           const int8_t cb[][BLOCKSIZE], const float *ortho1,
-                           const float *ortho2, float *data, int *idx,
-                           float *gain)
-{
-    int i, j;
-    float g, score, best_score;
-    float vect[BLOCKSIZE];
-
-    *idx = *gain = best_score = 0;
-    for (i = 0; i < FIXED_CB_SIZE; i++) {
-        for (j = 0; j < BLOCKSIZE; j++)
-            vect[j] = cb[i][j];
-        get_match_score(work, coefs, vect, ortho1, ortho2, data, &score, &g);
-        if (score > best_score) {
-            best_score = score;
-            *idx = i;
-            *gain = g;
-        }
-    }
-}
-
-
-/**
- * Search the two fixed codebooks for the best entry and gain
- *
- * @param work array used to calculate LPC-filtered vectors
- * @param coefs coefficients of the LPC filter
- * @param data input data
- * @param cba_idx index of the best entry of the adaptive codebook
- * @param cb1_idx pointer to variable where the index of the best entry of the
- *        first fixed codebook is returned
- * @param cb2_idx pointer to variable where the index of the best entry of the
- *        second fixed codebook is returned
- */
-static void fixed_cb_search(float *work, const float *coefs, float *data,
-                            int cba_idx, int *cb1_idx, int *cb2_idx)
-{
-    int i, ortho_cb1;
-    float gain;
-    float cba_vect[BLOCKSIZE], cb1_vect[BLOCKSIZE];
-    float vect[BLOCKSIZE];
-
-    /**
-     * The filtered vector from the adaptive codebook can be retrieved from
-     * work, because this function is called just after adaptive_cb_search().
-     */
-    if (cba_idx)
-        memcpy(cba_vect, work, sizeof(cba_vect));
-
-    find_best_vect(work, coefs, ff_cb1_vects, cba_idx ? cba_vect : NULL, NULL,
-                   data, cb1_idx, &gain);
-
-    /**
-     * Re-calculate the filtered vector from the vector with maximum match score
-     * and remove its contribution from input data.
-     */
-    if (gain) {
-        for (i = 0; i < BLOCKSIZE; i++)
-            vect[i] = ff_cb1_vects[*cb1_idx][i];
-        ff_celp_lp_synthesis_filterf(work, coefs, vect, BLOCKSIZE, LPC_ORDER);
-        if (cba_idx)
-            orthogonalize(work, cba_vect);
-        for (i = 0; i < BLOCKSIZE; i++)
-            data[i] -= gain * work[i];
-        memcpy(cb1_vect, work, sizeof(cb1_vect));
-        ortho_cb1 = 1;
-    } else
-        ortho_cb1 = 0;
-
-    find_best_vect(work, coefs, ff_cb2_vects, cba_idx ? cba_vect : NULL,
-                   ortho_cb1 ? cb1_vect : NULL, data, cb2_idx, &gain);
-}
-
-
-/**
- * Encode a subblock of the current frame
- *
- * @param ractx encoder context
- * @param sblock_data input data of the subblock
- * @param lpc_coefs coefficients of the LPC filter
- * @param rms RMS of the reflection coefficients
- * @param pb pointer to PutBitContext of the current frame
- */
-static void ra144_encode_subblock(RA144Context *ractx,
-                                  const int16_t *sblock_data,
-                                  const int16_t *lpc_coefs, unsigned int rms,
-                                  PutBitContext *pb)
-{
-    float data[BLOCKSIZE] = { 0 }, work[LPC_ORDER + BLOCKSIZE];
-    float coefs[LPC_ORDER];
-    float zero[BLOCKSIZE], cba[BLOCKSIZE], cb1[BLOCKSIZE], cb2[BLOCKSIZE];
-    int16_t cba_vect[BLOCKSIZE];
-    int cba_idx, cb1_idx, cb2_idx, gain;
-    int i, n, m[3];
-    float g[3];
-    float error, best_error;
-
-    for (i = 0; i < LPC_ORDER; i++) {
-        work[i] = ractx->curr_sblock[BLOCKSIZE + i];
-        coefs[i] = lpc_coefs[i] * (1/4096.0);
-    }
-
-    /**
-     * Calculate the zero-input response of the LPC filter and subtract it from
-     * input data.
-     */
-    ff_celp_lp_synthesis_filterf(work + LPC_ORDER, coefs, data, BLOCKSIZE,
-                                 LPC_ORDER);
-    for (i = 0; i < BLOCKSIZE; i++) {
-        zero[i] = work[LPC_ORDER + i];
-        data[i] = sblock_data[i] - zero[i];
-    }
-
-    /**
-     * Codebook search is performed without taking into account the contribution
-     * of the previous subblock, since it has been just subtracted from input
-     * data.
-     */
-    memset(work, 0, LPC_ORDER * sizeof(*work));
-
-    cba_idx = adaptive_cb_search(ractx->adapt_cb, work + LPC_ORDER, coefs,
-                                 data);
-    if (cba_idx) {
-        /**
-         * The filtered vector from the adaptive codebook can be retrieved from
-         * work, see implementation of adaptive_cb_search().
-         */
-        memcpy(cba, work + LPC_ORDER, sizeof(cba));
-
-        ff_copy_and_dup(cba_vect, ractx->adapt_cb, cba_idx + BLOCKSIZE / 2 - 1);
-        m[0] = (ff_irms(cba_vect) * rms) >> 12;
-    }
-    fixed_cb_search(work + LPC_ORDER, coefs, data, cba_idx, &cb1_idx, &cb2_idx);
-    for (i = 0; i < BLOCKSIZE; i++) {
-        cb1[i] = ff_cb1_vects[cb1_idx][i];
-        cb2[i] = ff_cb2_vects[cb2_idx][i];
-    }
-    ff_celp_lp_synthesis_filterf(work + LPC_ORDER, coefs, cb1, BLOCKSIZE,
-                                 LPC_ORDER);
-    memcpy(cb1, work + LPC_ORDER, sizeof(cb1));
-    m[1] = (ff_cb1_base[cb1_idx] * rms) >> 8;
-    ff_celp_lp_synthesis_filterf(work + LPC_ORDER, coefs, cb2, BLOCKSIZE,
-                                 LPC_ORDER);
-    memcpy(cb2, work + LPC_ORDER, sizeof(cb2));
-    m[2] = (ff_cb2_base[cb2_idx] * rms) >> 8;
-    best_error = FLT_MAX;
-    gain = 0;
-    for (n = 0; n < 256; n++) {
-        g[1] = ((ff_gain_val_tab[n][1] * m[1]) >> ff_gain_exp_tab[n]) *
-               (1/4096.0);
-        g[2] = ((ff_gain_val_tab[n][2] * m[2]) >> ff_gain_exp_tab[n]) *
-               (1/4096.0);
-        error = 0;
-        if (cba_idx) {
-            g[0] = ((ff_gain_val_tab[n][0] * m[0]) >> ff_gain_exp_tab[n]) *
-                   (1/4096.0);
-            for (i = 0; i < BLOCKSIZE; i++) {
-                data[i] = zero[i] + g[0] * cba[i] + g[1] * cb1[i] +
-                          g[2] * cb2[i];
-                error += (data[i] - sblock_data[i]) *
-                         (data[i] - sblock_data[i]);
-            }
-        } else {
-            for (i = 0; i < BLOCKSIZE; i++) {
-                data[i] = zero[i] + g[1] * cb1[i] + g[2] * cb2[i];
-                error += (data[i] - sblock_data[i]) *
-                         (data[i] - sblock_data[i]);
-            }
-        }
-        if (error < best_error) {
-            best_error = error;
-            gain = n;
-        }
-    }
-    put_bits(pb, 7, cba_idx);
-    put_bits(pb, 8, gain);
-    put_bits(pb, 7, cb1_idx);
-    put_bits(pb, 7, cb2_idx);
-    ff_subblock_synthesis(ractx, lpc_coefs, cba_idx, cb1_idx, cb2_idx, rms,
-                          gain);
-}
-
-
-static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                              const AVFrame *frame, int *got_packet_ptr)
-{
-    static const uint8_t sizes[LPC_ORDER] = {64, 32, 32, 16, 16, 8, 8, 8, 8, 4};
-    static const uint8_t bit_sizes[LPC_ORDER] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2};
-    RA144Context *ractx = avctx->priv_data;
-    PutBitContext pb;
-    int32_t lpc_data[NBLOCKS * BLOCKSIZE];
-    int32_t lpc_coefs[LPC_ORDER][MAX_LPC_ORDER];
-    int shift[LPC_ORDER];
-    int16_t block_coefs[NBLOCKS][LPC_ORDER];
-    int lpc_refl[LPC_ORDER];    /**< reflection coefficients of the frame */
-    unsigned int refl_rms[NBLOCKS]; /**< RMS of the reflection coefficients */
-    const int16_t *samples = frame ? (const int16_t *)frame->data[0] : NULL;
-    int energy = 0;
-    int i, idx, ret;
-
-    if (ractx->last_frame)
-        return 0;
-
-    if ((ret = ff_alloc_packet(avpkt, FRAMESIZE))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    /**
-     * Since the LPC coefficients are calculated on a frame centered over the
-     * fourth subframe, to encode a given frame, data from the next frame is
-     * needed. In each call to this function, the previous frame (whose data are
-     * saved in the encoder context) is encoded, and data from the current frame
-     * are saved in the encoder context to be used in the next function call.
-     */
-    for (i = 0; i < (2 * BLOCKSIZE + BLOCKSIZE / 2); i++) {
-        lpc_data[i] = ractx->curr_block[BLOCKSIZE + BLOCKSIZE / 2 + i];
-        energy += (lpc_data[i] * lpc_data[i]) >> 4;
-    }
-    if (frame) {
-        int j;
-        for (j = 0; j < frame->nb_samples && i < NBLOCKS * BLOCKSIZE; i++, j++) {
-            lpc_data[i] = samples[j] >> 2;
-            energy += (lpc_data[i] * lpc_data[i]) >> 4;
-        }
-    }
-    if (i < NBLOCKS * BLOCKSIZE)
-        memset(&lpc_data[i], 0, (NBLOCKS * BLOCKSIZE - i) * sizeof(*lpc_data));
-    energy = ff_energy_tab[quantize(ff_t_sqrt(energy >> 5) >> 10, ff_energy_tab,
-                                    32)];
-
-    ff_lpc_calc_coefs(&ractx->lpc_ctx, lpc_data, NBLOCKS * BLOCKSIZE, LPC_ORDER,
-                      LPC_ORDER, 16, lpc_coefs, shift, FF_LPC_TYPE_LEVINSON,
-                      0, ORDER_METHOD_EST, 12, 0);
-    for (i = 0; i < LPC_ORDER; i++)
-        block_coefs[NBLOCKS - 1][i] = -(lpc_coefs[LPC_ORDER - 1][i] <<
-                                        (12 - shift[LPC_ORDER - 1]));
-
-    /**
-     * TODO: apply perceptual weighting of the input speech through bandwidth
-     * expansion of the LPC filter.
-     */
-
-    if (ff_eval_refl(lpc_refl, block_coefs[NBLOCKS - 1], avctx)) {
-        /**
-         * The filter is unstable: use the coefficients of the previous frame.
-         */
-        ff_int_to_int16(block_coefs[NBLOCKS - 1], ractx->lpc_coef[1]);
-        if (ff_eval_refl(lpc_refl, block_coefs[NBLOCKS - 1], avctx)) {
-            /* the filter is still unstable. set reflection coeffs to zero. */
-            memset(lpc_refl, 0, sizeof(lpc_refl));
-        }
-    }
-    init_put_bits(&pb, avpkt->data, avpkt->size);
-    for (i = 0; i < LPC_ORDER; i++) {
-        idx = quantize(lpc_refl[i], ff_lpc_refl_cb[i], sizes[i]);
-        put_bits(&pb, bit_sizes[i], idx);
-        lpc_refl[i] = ff_lpc_refl_cb[i][idx];
-    }
-    ractx->lpc_refl_rms[0] = ff_rms(lpc_refl);
-    ff_eval_coefs(ractx->lpc_coef[0], lpc_refl);
-    refl_rms[0] = ff_interp(ractx, block_coefs[0], 1, 1, ractx->old_energy);
-    refl_rms[1] = ff_interp(ractx, block_coefs[1], 2,
-                            energy <= ractx->old_energy,
-                            ff_t_sqrt(energy * ractx->old_energy) >> 12);
-    refl_rms[2] = ff_interp(ractx, block_coefs[2], 3, 0, energy);
-    refl_rms[3] = ff_rescale_rms(ractx->lpc_refl_rms[0], energy);
-    ff_int_to_int16(block_coefs[NBLOCKS - 1], ractx->lpc_coef[0]);
-    put_bits(&pb, 5, quantize(energy, ff_energy_tab, 32));
-    for (i = 0; i < NBLOCKS; i++)
-        ra144_encode_subblock(ractx, ractx->curr_block + i * BLOCKSIZE,
-                              block_coefs[i], refl_rms[i], &pb);
-    flush_put_bits(&pb);
-    ractx->old_energy = energy;
-    ractx->lpc_refl_rms[1] = ractx->lpc_refl_rms[0];
-    FFSWAP(unsigned int *, ractx->lpc_coef[0], ractx->lpc_coef[1]);
-
-    /* copy input samples to current block for processing in next call */
-    i = 0;
-    if (frame) {
-        for (; i < frame->nb_samples; i++)
-            ractx->curr_block[i] = samples[i] >> 2;
-
-        if ((ret = ff_af_queue_add(&ractx->afq, frame)) < 0)
-            return ret;
-    } else
-        ractx->last_frame = 1;
-    memset(&ractx->curr_block[i], 0,
-           (NBLOCKS * BLOCKSIZE - i) * sizeof(*ractx->curr_block));
-
-    /* Get the next frame pts/duration */
-    ff_af_queue_remove(&ractx->afq, avctx->frame_size, &avpkt->pts,
-                       &avpkt->duration);
-
-    avpkt->size = FRAMESIZE;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-
-AVCodec ff_ra_144_encoder = {
-    .name           = "real_144",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_RA_144,
-    .priv_data_size = sizeof(RA144Context),
-    .init           = ra144_encode_init,
-    .encode2        = ra144_encode_frame,
-    .close          = ra144_encode_close,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/ra288.c b/deps/libav/libavcodec/ra288.c
deleted file mode 100644
index 215786c..0000000
--- a/deps/libav/libavcodec/ra288.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * RealAudio 2.0 (28.8K)
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/internal.h"
-#include "avcodec.h"
-#include "internal.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "ra288.h"
-#include "lpc.h"
-#include "celp_filters.h"
-
-#define MAX_BACKWARD_FILTER_ORDER  36
-#define MAX_BACKWARD_FILTER_LEN    40
-#define MAX_BACKWARD_FILTER_NONREC 35
-
-#define RA288_BLOCK_SIZE        5
-#define RA288_BLOCKS_PER_FRAME 32
-
-typedef struct {
-    AVFloatDSPContext fdsp;
-    DECLARE_ALIGNED(32, float,   sp_lpc)[FFALIGN(36, 16)];   ///< LPC coefficients for speech data (spec: A)
-    DECLARE_ALIGNED(32, float, gain_lpc)[FFALIGN(10, 16)];   ///< LPC coefficients for gain        (spec: GB)
-
-    /** speech data history                                      (spec: SB).
-     *  Its first 70 coefficients are updated only at backward filtering.
-     */
-    float sp_hist[111];
-
-    /// speech part of the gain autocorrelation                  (spec: REXP)
-    float sp_rec[37];
-
-    /** log-gain history                                         (spec: SBLG).
-     *  Its first 28 coefficients are updated only at backward filtering.
-     */
-    float gain_hist[38];
-
-    /// recursive part of the gain autocorrelation               (spec: REXPLG)
-    float gain_rec[11];
-} RA288Context;
-
-static av_cold int ra288_decode_init(AVCodecContext *avctx)
-{
-    RA288Context *ractx = avctx->priv_data;
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_FLT;
-
-    avpriv_float_dsp_init(&ractx->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    return 0;
-}
-
-static void convolve(float *tgt, const float *src, int len, int n)
-{
-    for (; n >= 0; n--)
-        tgt[n] = avpriv_scalarproduct_float_c(src, src - n, len);
-
-}
-
-static void decode(RA288Context *ractx, float gain, int cb_coef)
-{
-    int i;
-    double sumsum;
-    float sum, buffer[5];
-    float *block = ractx->sp_hist + 70 + 36; // current block
-    float *gain_block = ractx->gain_hist + 28;
-
-    memmove(ractx->sp_hist + 70, ractx->sp_hist + 75, 36*sizeof(*block));
-
-    /* block 46 of G.728 spec */
-    sum = 32.0;
-    for (i=0; i < 10; i++)
-        sum -= gain_block[9-i] * ractx->gain_lpc[i];
-
-    /* block 47 of G.728 spec */
-    sum = av_clipf(sum, 0, 60);
-
-    /* block 48 of G.728 spec */
-    /* exp(sum * 0.1151292546497) == pow(10.0,sum/20) */
-    sumsum = exp(sum * 0.1151292546497) * gain * (1.0/(1<<23));
-
-    for (i=0; i < 5; i++)
-        buffer[i] = codetable[cb_coef][i] * sumsum;
-
-    sum = avpriv_scalarproduct_float_c(buffer, buffer, 5) * ((1 << 24) / 5.0);
-
-    sum = FFMAX(sum, 1);
-
-    /* shift and store */
-    memmove(gain_block, gain_block + 1, 9 * sizeof(*gain_block));
-
-    gain_block[9] = 10 * log10(sum) - 32;
-
-    ff_celp_lp_synthesis_filterf(block, ractx->sp_lpc, buffer, 5, 36);
-}
-
-/**
- * Hybrid window filtering, see blocks 36 and 49 of the G.728 specification.
- *
- * @param order   filter order
- * @param n       input length
- * @param non_rec number of non-recursive samples
- * @param out     filter output
- * @param hist    pointer to the input history of the filter
- * @param out     pointer to the non-recursive part of the output
- * @param out2    pointer to the recursive part of the output
- * @param window  pointer to the windowing function table
- */
-static void do_hybrid_window(RA288Context *ractx,
-                             int order, int n, int non_rec, float *out,
-                             float *hist, float *out2, const float *window)
-{
-    int i;
-    float buffer1[MAX_BACKWARD_FILTER_ORDER + 1];
-    float buffer2[MAX_BACKWARD_FILTER_ORDER + 1];
-    LOCAL_ALIGNED(32, float, work, [FFALIGN(MAX_BACKWARD_FILTER_ORDER +
-                                            MAX_BACKWARD_FILTER_LEN   +
-                                            MAX_BACKWARD_FILTER_NONREC, 16)]);
-
-    ractx->fdsp.vector_fmul(work, window, hist, FFALIGN(order + n + non_rec, 16));
-
-    convolve(buffer1, work + order    , n      , order);
-    convolve(buffer2, work + order + n, non_rec, order);
-
-    for (i=0; i <= order; i++) {
-        out2[i] = out2[i] * 0.5625 + buffer1[i];
-        out [i] = out2[i]          + buffer2[i];
-    }
-
-    /* Multiply by the white noise correcting factor (WNCF). */
-    *out *= 257.0 / 256.0;
-}
-
-/**
- * Backward synthesis filter, find the LPC coefficients from past speech data.
- */
-static void backward_filter(RA288Context *ractx,
-                            float *hist, float *rec, const float *window,
-                            float *lpc, const float *tab,
-                            int order, int n, int non_rec, int move_size)
-{
-    float temp[MAX_BACKWARD_FILTER_ORDER+1];
-
-    do_hybrid_window(ractx, order, n, non_rec, temp, hist, rec, window);
-
-    if (!compute_lpc_coefs(temp, order, lpc, 0, 1, 1))
-        ractx->fdsp.vector_fmul(lpc, lpc, tab, FFALIGN(order, 16));
-
-    memmove(hist, hist + n, move_size*sizeof(*hist));
-}
-
-static int ra288_decode_frame(AVCodecContext * avctx, void *data,
-                              int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    float *out;
-    int i, ret;
-    RA288Context *ractx = avctx->priv_data;
-    GetBitContext gb;
-
-    if (buf_size < avctx->block_align) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Error! Input buffer is too small [%d<%d]\n",
-               buf_size, avctx->block_align);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    out = (float *)frame->data[0];
-
-    init_get_bits(&gb, buf, avctx->block_align * 8);
-
-    for (i=0; i < RA288_BLOCKS_PER_FRAME; i++) {
-        float gain = amptable[get_bits(&gb, 3)];
-        int cb_coef = get_bits(&gb, 6 + (i&1));
-
-        decode(ractx, gain, cb_coef);
-
-        memcpy(out, &ractx->sp_hist[70 + 36], RA288_BLOCK_SIZE * sizeof(*out));
-        out += RA288_BLOCK_SIZE;
-
-        if ((i & 7) == 3) {
-            backward_filter(ractx, ractx->sp_hist, ractx->sp_rec, syn_window,
-                            ractx->sp_lpc, syn_bw_tab, 36, 40, 35, 70);
-
-            backward_filter(ractx, ractx->gain_hist, ractx->gain_rec, gain_window,
-                            ractx->gain_lpc, gain_bw_tab, 10, 8, 20, 28);
-        }
-    }
-
-    *got_frame_ptr = 1;
-
-    return avctx->block_align;
-}
-
-AVCodec ff_ra_288_decoder = {
-    .name           = "real_288",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealAudio 2.0 (28.8K)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_RA_288,
-    .priv_data_size = sizeof(RA288Context),
-    .init           = ra288_decode_init,
-    .decode         = ra288_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/ra288.h b/deps/libav/libavcodec/ra288.h
deleted file mode 100644
index 9f4beeb..0000000
--- a/deps/libav/libavcodec/ra288.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * RealAudio 2.0 (28.8K)
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_RA288_H
-#define AVCODEC_RA288_H
-
-#include <stdint.h>
-#include "libavutil/common.h"
-
-static const float amptable[8]={
-     0.515625,  0.90234375,  1.57910156,  2.76342773,
-    -0.515625, -0.90234375, -1.57910156, -2.76342773
-};
-
-static const int16_t codetable[128][5]={
-    {   668, -2950, -1254, -1790, -2553}, { -5032, -4577, -1045,  2908,  3318},
-    { -2819, -2677,  -948, -2825, -4450}, { -6679,  -340,  1482, -1276,  1262},
-    {  -562, -6757,  1281,   179, -1274}, { -2512, -7130, -4925,  6913,  2411},
-    { -2478,  -156,  4683, -3873,     0}, { -8208,  2140,  -478, -2785,   533},
-    {  1889,  2759,  1381, -6955, -5913}, {  5082, -2460, -5778,  1797,   568},
-    { -2208, -3309, -4523, -6236, -7505}, { -2719,  4358, -2988, -1149,  2664},
-    {  1259,   995,  2711, -2464,-10390}, {  1722, -7569, -2742,  2171, -2329},
-    {  1032,   747,  -858, -7946,-12843}, {  3106,  4856, -4193, -2541,  1035},
-    {  1862,  -960, -6628,   410,  5882}, { -2493, -2628, -4000,   -60,  7202},
-    { -2672,  1446,  1536, -3831,  1233}, { -5302,  6912,  1589, -4187,  3665},
-    { -3456, -8170, -7709,  1384,  4698}, { -4699, -6209,-11176,  8104, 16830},
-    {   930,  7004,  1269, -8977,  2567}, {  4649, 11804,  3441, -5657,  1199},
-    {  2542,  -183, -8859, -7976,  3230}, { -2872, -2011, -9713, -8385, 12983},
-    {  3086,  2140, -3680, -9643, -2896}, { -7609,  6515, -2283, -2522,  6332},
-    { -3333, -5620, -9130,-11131,  5543}, {  -407, -6721,-17466, -2889, 11568},
-    {  3692,  6796,  -262,-10846, -1856}, {  7275, 13404, -2989,-10595,  4936},
-    {   244, -2219,  2656,  3776, -5412}, { -4043, -5934,  2131,   863, -2866},
-    { -3302,  1743, -2006,  -128, -2052}, { -6361,  3342, -1583,   -21,  1142},
-    { -3837, -1831,  6397,  2545, -2848}, { -9332, -6528,  5309,  1986, -2245},
-    { -4490,   748,  1935, -3027,  -493}, { -9255,  5366,  3193, -4493,  1784},
-    {  4784,  -370,  1866,  1057, -1889}, {  7342, -2690, -2577,   676,  -611},
-    {  -502,  2235, -1850, -1777, -2049}, {  1011,  3880, -2465,  2209,  -152},
-    {  2592,  2829,  5588,  2839, -7306}, { -3049, -4918,  5955,  9201, -4447},
-    {   697,  3908,  5798, -4451, -4644}, { -2121,  5444, -2570,   321, -1202},
-    {  2846, -2086,  3532,   566,  -708}, { -4279,   950,  4980,  3749,   452},
-    { -2484,  3502,  1719,  -170,   238}, { -3435,   263,  2114, -2005,  2361},
-    { -7338, -1208,  9347, -1216, -4013}, {-13498,  -439,  8028, -4232,   361},
-    { -3729,  5433,  2004, -4727, -1259}, { -3986,  7743,  8429, -3691,  -987},
-    {  5198,  -423,  1150, -1281,   816}, {  7409,  4109, -3949,  2690,    30},
-    {  1246,  3055,   -35, -1370,  -246}, { -1489,  5635,  -678, -2627,  3170},
-    {  4830, -4585,  2008, -1062,   799}, {  -129,   717,  4594, 14937, 10706},
-    {   417,  2759,  1850, -5057, -1153}, { -3887,  7361, -5768,  4285,   666},
-    {  1443,  -938,    20, -2119, -1697}, { -3712, -3402, -2212,   110,  2136},
-    { -2952,    12, -1568, -3500, -1855}, { -1315, -1731,  1160,  -558,  1709},
-    {    88, -4569,   194,  -454, -2957}, { -2839, -1666,  -273,  2084,  -155},
-    {  -189, -2376,  1663, -1040, -2449}, { -2842, -1369,   636,  -248, -2677},
-    {  1517,    79, -3013, -3669,  -973}, {  1913, -2493, -5312,  -749,  1271},
-    { -2903, -3324, -3756, -3690, -1829}, { -2913, -1547, -2760, -1406,  1124},
-    {  1844, -1834,   456,   706, -4272}, {   467, -4256, -1909,  1521,  1134},
-    {  -127,  -994,  -637, -1491, -6494}, {   873, -2045, -3828, -2792,  -578},
-    {  2311, -1817,  2632, -3052,  1968}, {   641,  1194,  1893,  4107,  6342},
-    {   -45,  1198,  2160, -1449,  2203}, { -2004,  1713,  3518,  2652,  4251},
-    {  2936, -3968,  1280,   131, -1476}, {  2827,     8, -1928,  2658,  3513},
-    {  3199,  -816,  2687, -1741, -1407}, {  2948,  4029,   394,  -253,  1298},
-    {  4286,    51, -4507,   -32,  -659}, {  3903,  5646, -5588, -2592,  5707},
-    {  -606,  1234, -1607, -5187,   664}, {  -525,  3620, -2192, -2527,  1707},
-    {  4297, -3251, -2283,   812, -2264}, {  5765,   528, -3287,  1352,  1672},
-    {  2735,  1241, -1103, -3273, -3407}, {  4033,  1648, -2965, -1174,  1444},
-    {    74,   918,  1999,   915, -1026}, { -2496, -1605,  2034,  2950,   229},
-    { -2168,  2037,    15, -1264,  -208}, { -3552,  1530,   581,  1491,   962},
-    { -2613, -2338,  3621, -1488, -2185}, { -1747,    81,  5538,  1432, -2257},
-    { -1019,   867,   214, -2284, -1510}, { -1684,  2816,  -229,  2551, -1389},
-    {  2707,   504,   479,  2783, -1009}, {  2517, -1487, -1596,   621,  1929},
-    {  -148,  2206, -4288,  1292, -1401}, {  -527,  1243, -2731,  1909,  1280},
-    {  2149, -1501,  3688,   610, -4591}, {  3306, -3369,  1875,  3636, -1217},
-    {  2574,  2513,  1449, -3074, -4979}, {   814,  1826, -2497,  4234, -4077},
-    {  1664,  -220,  3418,  1002,  1115}, {   781,  1658,  3919,  6130,  3140},
-    {  1148,  4065,  1516,   815,   199}, {  1191,  2489,  2561,  2421,  2443},
-    {   770, -5915,  5515,  -368, -3199}, {  1190,  1047,  3742,  6927, -2089},
-    {   292,  3099,  4308,  -758, -2455}, {   523,  3921,  4044,  1386,    85},
-    {  4367,  1006, -1252, -1466, -1383}, {  3852,  1579,   -77,  2064,   868},
-    {  5109,  2919,  -202,   359,  -509}, {  3650,  3206,  2303,  1693,  1296},
-    {  2905, -3907,   229, -1196, -2332}, {  5977, -3585,   805,  3825, -3138},
-    {  3746,  -606,    53,  -269, -3301}, {   606,  2018, -1316,  4064,   398}
-};
-
-DECLARE_ALIGNED(32, static const float, syn_window)[FFALIGN(111, 16)]={
-  0.576690972, 0.580838025, 0.585013986, 0.589219987, 0.59345597,  0.597723007,
-  0.602020264, 0.606384277, 0.610748291, 0.615142822, 0.619598389, 0.624084473,
-  0.628570557, 0.633117676, 0.637695313, 0.642272949, 0.646911621, 0.651580811,
-  0.656280518, 0.66104126,  0.665802002, 0.670593262, 0.675445557, 0.680328369,
-  0.685241699, 0.690185547, 0.695159912, 0.700164795, 0.705230713, 0.710327148,
-  0.715454102, 0.720611572, 0.725830078, 0.731048584, 0.736328125, 0.741638184,
-  0.747009277, 0.752380371, 0.7578125,   0.763305664, 0.768798828, 0.774353027,
-  0.779937744, 0.785583496, 0.791229248, 0.796936035, 0.802703857, 0.808502197,
-  0.814331055, 0.820220947, 0.826141357, 0.832092285, 0.838104248, 0.844146729,
-  0.850250244, 0.856384277, 0.862548828, 0.868774414, 0.875061035, 0.881378174,
-  0.88772583,  0.894134521, 0.900604248, 0.907104492, 0.913635254, 0.920227051,
-  0.926879883, 0.933563232, 0.940307617, 0.94708252,  0.953918457, 0.96081543,
-  0.96774292,  0.974731445, 0.981781006, 0.988861084, 0.994842529, 0.998565674,
-  0.999969482, 0.99911499,  0.996002197, 0.990600586, 0.982910156, 0.973022461,
-  0.960876465, 0.946533203, 0.930053711, 0.911437988, 0.89074707,  0.868041992,
-  0.843322754, 0.816680908, 0.788208008, 0.757904053, 0.725891113, 0.692199707,
-  0.656921387, 0.620178223, 0.582000732, 0.542480469, 0.501739502, 0.459838867,
-  0.416900635, 0.373016357, 0.328277588, 0.282775879, 0.236663818, 0.189971924,
-  0.142852783, 0.0954284668,0.0477600098
-};
-
-DECLARE_ALIGNED(32, static const float, gain_window)[FFALIGN(38, 16)]={
-  0.505699992, 0.524200022, 0.54339999,  0.563300014, 0.583953857, 0.60534668,
-  0.627502441, 0.650482178, 0.674316406, 0.699005127, 0.724578857, 0.75112915,
-  0.778625488, 0.807128906, 0.836669922, 0.86730957,  0.899078369, 0.932006836,
-  0.961486816, 0.982757568, 0.995635986, 1,           0.995819092, 0.983154297,
-  0.96206665,  0.932769775, 0.895507813, 0.850585938, 0.798400879, 0.739379883,
-  0.674072266, 0.602996826, 0.526763916, 0.446014404, 0.361480713, 0.273834229,
-  0.183868408, 0.0923461914
-};
-
-/** synthesis bandwidth broadening table */
-DECLARE_ALIGNED(32, static const float, syn_bw_tab)[FFALIGN(36, 16)] = {
-  0.98828125,  0.976699829, 0.965254128, 0.953942537, 0.942763507, 0.931715488,
-  0.920796931, 0.910006344, 0.899342179, 0.888803005, 0.878387332, 0.868093729,
-  0.857920766, 0.847867012, 0.837931097, 0.828111589, 0.818407178, 0.808816493,
-  0.799338162, 0.789970934, 0.780713439, 0.771564424, 0.762522638, 0.753586829,
-  0.744755745, 0.736028135, 0.727402806, 0.718878567, 0.710454226, 0.702128589,
-  0.693900526, 0.685768902, 0.677732527, 0.669790328, 0.66194123,  0.654184103
-};
-
-/** gain bandwidth broadening table */
-DECLARE_ALIGNED(32, static const float, gain_bw_tab)[FFALIGN(10, 16)] = {
-  0.90625,     0.821289063, 0.74432373,  0.674499512, 0.61126709,
-  0.553955078, 0.50201416,  0.454956055, 0.41229248,  0.373657227
-};
-
-#endif /* AVCODEC_RA288_H */
diff --git a/deps/libav/libavcodec/ralf.c b/deps/libav/libavcodec/ralf.c
deleted file mode 100644
index ebcdf6f..0000000
--- a/deps/libav/libavcodec/ralf.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * RealAudio Lossless decoder
- *
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This is a decoder for Real Audio Lossless format.
- * Dedicated to the mastermind behind it, Ralph Wiggum.
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "golomb.h"
-#include "internal.h"
-#include "unary.h"
-#include "ralfdata.h"
-
-#define FILTER_NONE 0
-#define FILTER_RAW  642
-
-typedef struct VLCSet {
-    VLC filter_params;
-    VLC bias;
-    VLC coding_mode;
-    VLC filter_coeffs[10][11];
-    VLC short_codes[15];
-    VLC long_codes[125];
-} VLCSet;
-
-#define RALF_MAX_PKT_SIZE 8192
-
-typedef struct RALFContext {
-    int version;
-    int max_frame_size;
-    VLCSet sets[3];
-    int32_t channel_data[2][4096];
-
-    int     filter_params;   ///< combined filter parameters for the current channel data
-    int     filter_length;   ///< length of the filter for the current channel data
-    int     filter_bits;     ///< filter precision for the current channel data
-    int32_t filter[64];
-
-    int     bias[2];         ///< a constant value added to channel data after filtering
-
-    int num_blocks;          ///< number of blocks inside the frame
-    int sample_offset;
-    int block_size[1 << 12]; ///< size of the blocks
-    int block_pts[1 << 12];  ///< block start time (in milliseconds)
-
-    uint8_t pkt[16384];
-    int     has_pkt;
-} RALFContext;
-
-#define MAX_ELEMS 644 // no RALF table uses more than that
-
-static av_cold int init_ralf_vlc(VLC *vlc, const uint8_t *data, int elems)
-{
-    uint8_t  lens[MAX_ELEMS];
-    uint16_t codes[MAX_ELEMS];
-    int counts[17], prefixes[18];
-    int i, cur_len;
-    int max_bits = 0;
-    int nb = 0;
-
-    for (i = 0; i <= 16; i++)
-        counts[i] = 0;
-    for (i = 0; i < elems; i++) {
-        cur_len  = (nb ? *data & 0xF : *data >> 4) + 1;
-        counts[cur_len]++;
-        max_bits = FFMAX(max_bits, cur_len);
-        lens[i]  = cur_len;
-        data    += nb;
-        nb      ^= 1;
-    }
-    prefixes[1] = 0;
-    for (i = 1; i <= 16; i++)
-        prefixes[i + 1] = (prefixes[i] + counts[i]) << 1;
-
-    for (i = 0; i < elems; i++)
-        codes[i] = prefixes[lens[i]]++;
-
-    return ff_init_vlc_sparse(vlc, FFMIN(max_bits, 9), elems,
-                              lens, 1, 1, codes, 2, 2, NULL, 0, 0, 0);
-}
-
-static av_cold int decode_close(AVCodecContext *avctx)
-{
-    RALFContext *ctx = avctx->priv_data;
-    int i, j, k;
-
-    for (i = 0; i < 3; i++) {
-        ff_free_vlc(&ctx->sets[i].filter_params);
-        ff_free_vlc(&ctx->sets[i].bias);
-        ff_free_vlc(&ctx->sets[i].coding_mode);
-        for (j = 0; j < 10; j++)
-            for (k = 0; k < 11; k++)
-                ff_free_vlc(&ctx->sets[i].filter_coeffs[j][k]);
-        for (j = 0; j < 15; j++)
-            ff_free_vlc(&ctx->sets[i].short_codes[j]);
-        for (j = 0; j < 125; j++)
-            ff_free_vlc(&ctx->sets[i].long_codes[j]);
-    }
-
-    return 0;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    RALFContext *ctx = avctx->priv_data;
-    int i, j, k;
-    int ret;
-
-    if (avctx->extradata_size < 24 || memcmp(avctx->extradata, "LSD:", 4)) {
-        av_log(avctx, AV_LOG_ERROR, "Extradata is not groovy, dude\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->version = AV_RB16(avctx->extradata + 4);
-    if (ctx->version != 0x103) {
-        avpriv_request_sample(avctx, "Unknown version %X", ctx->version);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    avctx->channels    = AV_RB16(avctx->extradata + 8);
-    avctx->sample_rate = AV_RB32(avctx->extradata + 12);
-    if (avctx->channels < 1 || avctx->channels > 2
-        || avctx->sample_rate < 8000 || avctx->sample_rate > 96000) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid coding parameters %d Hz %d ch\n",
-               avctx->sample_rate, avctx->channels);
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16P;
-    avctx->channel_layout = (avctx->channels == 2) ? AV_CH_LAYOUT_STEREO
-                                                   : AV_CH_LAYOUT_MONO;
-
-    ctx->max_frame_size = AV_RB32(avctx->extradata + 16);
-    if (ctx->max_frame_size > (1 << 20) || !ctx->max_frame_size) {
-        av_log(avctx, AV_LOG_ERROR, "invalid frame size %d\n",
-               ctx->max_frame_size);
-    }
-    ctx->max_frame_size = FFMAX(ctx->max_frame_size, avctx->sample_rate);
-
-    for (i = 0; i < 3; i++) {
-        ret = init_ralf_vlc(&ctx->sets[i].filter_params, filter_param_def[i],
-                            FILTERPARAM_ELEMENTS);
-        if (ret < 0) {
-            decode_close(avctx);
-            return ret;
-        }
-        ret = init_ralf_vlc(&ctx->sets[i].bias, bias_def[i], BIAS_ELEMENTS);
-        if (ret < 0) {
-            decode_close(avctx);
-            return ret;
-        }
-        ret = init_ralf_vlc(&ctx->sets[i].coding_mode, coding_mode_def[i],
-                            CODING_MODE_ELEMENTS);
-        if (ret < 0) {
-            decode_close(avctx);
-            return ret;
-        }
-        for (j = 0; j < 10; j++) {
-            for (k = 0; k < 11; k++) {
-                ret = init_ralf_vlc(&ctx->sets[i].filter_coeffs[j][k],
-                                    filter_coeffs_def[i][j][k],
-                                    FILTER_COEFFS_ELEMENTS);
-                if (ret < 0) {
-                    decode_close(avctx);
-                    return ret;
-                }
-            }
-        }
-        for (j = 0; j < 15; j++) {
-            ret = init_ralf_vlc(&ctx->sets[i].short_codes[j],
-                                short_codes_def[i][j], SHORT_CODES_ELEMENTS);
-            if (ret < 0) {
-                decode_close(avctx);
-                return ret;
-            }
-        }
-        for (j = 0; j < 125; j++) {
-            ret = init_ralf_vlc(&ctx->sets[i].long_codes[j],
-                                long_codes_def[i][j], LONG_CODES_ELEMENTS);
-            if (ret < 0) {
-                decode_close(avctx);
-                return ret;
-            }
-        }
-    }
-
-    return 0;
-}
-
-static inline int extend_code(GetBitContext *gb, int val, int range, int bits)
-{
-    if (val == 0) {
-        val = -range - get_ue_golomb(gb);
-    } else if (val == range * 2) {
-        val =  range + get_ue_golomb(gb);
-    } else {
-        val -= range;
-    }
-    if (bits)
-        val = (val << bits) | get_bits(gb, bits);
-    return val;
-}
-
-static int decode_channel(RALFContext *ctx, GetBitContext *gb, int ch,
-                          int length, int mode, int bits)
-{
-    int i, t;
-    int code_params;
-    VLCSet *set = ctx->sets + mode;
-    VLC *code_vlc; int range, range2, add_bits;
-    int *dst = ctx->channel_data[ch];
-
-    ctx->filter_params = get_vlc2(gb, set->filter_params.table, 9, 2);
-    ctx->filter_bits   = (ctx->filter_params - 2) >> 6;
-    ctx->filter_length = ctx->filter_params - (ctx->filter_bits << 6) - 1;
-
-    if (ctx->filter_params == FILTER_RAW) {
-        for (i = 0; i < length; i++)
-            dst[i] = get_bits(gb, bits);
-        ctx->bias[ch] = 0;
-        return 0;
-    }
-
-    ctx->bias[ch] = get_vlc2(gb, set->bias.table, 9, 2);
-    ctx->bias[ch] = extend_code(gb, ctx->bias[ch], 127, 4);
-
-    if (ctx->filter_params == FILTER_NONE) {
-        memset(dst, 0, sizeof(*dst) * length);
-        return 0;
-    }
-
-    if (ctx->filter_params > 1) {
-        int cmode = 0, coeff = 0;
-        VLC *vlc = set->filter_coeffs[ctx->filter_bits] + 5;
-
-        add_bits = ctx->filter_bits;
-
-        for (i = 0; i < ctx->filter_length; i++) {
-            t = get_vlc2(gb, vlc[cmode].table, vlc[cmode].bits, 2);
-            t = extend_code(gb, t, 21, add_bits);
-            if (!cmode)
-                coeff -= 12 << add_bits;
-            coeff = t - coeff;
-            ctx->filter[i] = coeff;
-
-            cmode = coeff >> add_bits;
-            if (cmode < 0) {
-                cmode = -1 - av_log2(-cmode);
-                if (cmode < -5)
-                    cmode = -5;
-            } else if (cmode > 0) {
-                cmode =  1 + av_log2(cmode);
-                if (cmode > 5)
-                    cmode = 5;
-            }
-        }
-    }
-
-    code_params = get_vlc2(gb, set->coding_mode.table, set->coding_mode.bits, 2);
-    if (code_params >= 15) {
-        add_bits = av_clip((code_params / 5 - 3) / 2, 0, 10);
-        if (add_bits > 9 && (code_params % 5) != 2)
-            add_bits--;
-        range    = 10;
-        range2   = 21;
-        code_vlc = set->long_codes + code_params - 15;
-    } else {
-        add_bits = 0;
-        range    = 6;
-        range2   = 13;
-        code_vlc = set->short_codes + code_params;
-    }
-
-    for (i = 0; i < length; i += 2) {
-        int code1, code2;
-
-        t = get_vlc2(gb, code_vlc->table, code_vlc->bits, 2);
-        code1 = t / range2;
-        code2 = t % range2;
-        dst[i]     = extend_code(gb, code1, range, 0) << add_bits;
-        dst[i + 1] = extend_code(gb, code2, range, 0) << add_bits;
-        if (add_bits) {
-            dst[i]     |= get_bits(gb, add_bits);
-            dst[i + 1] |= get_bits(gb, add_bits);
-        }
-    }
-
-    return 0;
-}
-
-static void apply_lpc(RALFContext *ctx, int ch, int length, int bits)
-{
-    int i, j, acc;
-    int *audio = ctx->channel_data[ch];
-    int bias = 1 << (ctx->filter_bits - 1);
-    int max_clip = (1 << bits) - 1, min_clip = -max_clip - 1;
-
-    for (i = 1; i < length; i++) {
-        int flen = FFMIN(ctx->filter_length, i);
-
-        acc = 0;
-        for (j = 0; j < flen; j++)
-            acc += ctx->filter[j] * audio[i - j - 1];
-        if (acc < 0) {
-            acc = (acc + bias - 1) >> ctx->filter_bits;
-            acc = FFMAX(acc, min_clip);
-        } else {
-            acc = (acc + bias) >> ctx->filter_bits;
-            acc = FFMIN(acc, max_clip);
-        }
-        audio[i] += acc;
-    }
-}
-
-static int decode_block(AVCodecContext *avctx, GetBitContext *gb,
-                        int16_t *dst0, int16_t *dst1)
-{
-    RALFContext *ctx = avctx->priv_data;
-    int len, ch, ret;
-    int dmode, mode[2], bits[2];
-    int *ch0, *ch1;
-    int i, t, t2;
-
-    len = 12 - get_unary(gb, 0, 6);
-
-    if (len <= 7) len ^= 1; // codes for length = 6 and 7 are swapped
-    len = 1 << len;
-
-    if (ctx->sample_offset + len > ctx->max_frame_size) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Decoder's stomach is crying, it ate too many samples\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avctx->channels > 1)
-        dmode = get_bits(gb, 2) + 1;
-    else
-        dmode = 0;
-
-    mode[0] = (dmode == 4) ? 1 : 0;
-    mode[1] = (dmode >= 2) ? 2 : 0;
-    bits[0] = 16;
-    bits[1] = (mode[1] == 2) ? 17 : 16;
-
-    for (ch = 0; ch < avctx->channels; ch++) {
-        if ((ret = decode_channel(ctx, gb, ch, len, mode[ch], bits[ch])) < 0)
-            return ret;
-        if (ctx->filter_params > 1 && ctx->filter_params != FILTER_RAW) {
-            ctx->filter_bits += 3;
-            apply_lpc(ctx, ch, len, bits[ch]);
-        }
-        if (get_bits_left(gb) < 0)
-            return AVERROR_INVALIDDATA;
-    }
-    ch0 = ctx->channel_data[0];
-    ch1 = ctx->channel_data[1];
-    switch (dmode) {
-    case 0:
-        for (i = 0; i < len; i++)
-            dst0[i] = ch0[i] + ctx->bias[0];
-        break;
-    case 1:
-        for (i = 0; i < len; i++) {
-            dst0[i] = ch0[i] + ctx->bias[0];
-            dst1[i] = ch1[i] + ctx->bias[1];
-        }
-        break;
-    case 2:
-        for (i = 0; i < len; i++) {
-            ch0[i] += ctx->bias[0];
-            dst0[i] = ch0[i];
-            dst1[i] = ch0[i] - (ch1[i] + ctx->bias[1]);
-        }
-        break;
-    case 3:
-        for (i = 0; i < len; i++) {
-            t  = ch0[i] + ctx->bias[0];
-            t2 = ch1[i] + ctx->bias[1];
-            dst0[i] = t + t2;
-            dst1[i] = t;
-        }
-        break;
-    case 4:
-        for (i = 0; i < len; i++) {
-            t  =   ch1[i] + ctx->bias[1];
-            t2 = ((ch0[i] + ctx->bias[0]) << 1) | (t & 1);
-            dst0[i] = (t2 + t) / 2;
-            dst1[i] = (t2 - t) / 2;
-        }
-        break;
-    }
-
-    ctx->sample_offset += len;
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
-                        AVPacket *avpkt)
-{
-    RALFContext *ctx = avctx->priv_data;
-    AVFrame *frame   = data;
-    int16_t *samples0;
-    int16_t *samples1;
-    int ret;
-    GetBitContext gb;
-    int table_size, table_bytes, i;
-    const uint8_t *src, *block_pointer;
-    int src_size;
-    int bytes_left;
-
-    if (ctx->has_pkt) {
-        ctx->has_pkt = 0;
-        table_bytes = (AV_RB16(avpkt->data) + 7) >> 3;
-        if (table_bytes + 3 > avpkt->size || avpkt->size > RALF_MAX_PKT_SIZE) {
-            av_log(avctx, AV_LOG_ERROR, "Wrong packet's breath smells of wrong data!\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (memcmp(ctx->pkt, avpkt->data, 2 + table_bytes)) {
-            av_log(avctx, AV_LOG_ERROR, "Wrong packet tails are wrong!\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        src      = ctx->pkt;
-        src_size = RALF_MAX_PKT_SIZE + avpkt->size;
-        memcpy(ctx->pkt + RALF_MAX_PKT_SIZE, avpkt->data + 2 + table_bytes,
-               avpkt->size - 2 - table_bytes);
-    } else {
-        if (avpkt->size == RALF_MAX_PKT_SIZE) {
-            memcpy(ctx->pkt, avpkt->data, avpkt->size);
-            ctx->has_pkt   = 1;
-            *got_frame_ptr = 0;
-
-            return avpkt->size;
-        }
-        src      = avpkt->data;
-        src_size = avpkt->size;
-    }
-
-    frame->nb_samples = ctx->max_frame_size;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Me fail get_buffer()? That's unpossible!\n");
-        return ret;
-    }
-    samples0 = (int16_t *)frame->data[0];
-    samples1 = (int16_t *)frame->data[1];
-
-    if (src_size < 5) {
-        av_log(avctx, AV_LOG_ERROR, "too short packets are too short!\n");
-        return AVERROR_INVALIDDATA;
-    }
-    table_size  = AV_RB16(src);
-    table_bytes = (table_size + 7) >> 3;
-    if (src_size < table_bytes + 3) {
-        av_log(avctx, AV_LOG_ERROR, "short packets are short!\n");
-        return AVERROR_INVALIDDATA;
-    }
-    init_get_bits(&gb, src + 2, table_size);
-    ctx->num_blocks = 0;
-    while (get_bits_left(&gb) > 0) {
-        ctx->block_size[ctx->num_blocks] = get_bits(&gb, 15);
-        if (get_bits1(&gb)) {
-            ctx->block_pts[ctx->num_blocks] = get_bits(&gb, 9);
-        } else {
-            ctx->block_pts[ctx->num_blocks] = 0;
-        }
-        ctx->num_blocks++;
-    }
-
-    block_pointer = src      + table_bytes + 2;
-    bytes_left    = src_size - table_bytes - 2;
-    ctx->sample_offset = 0;
-    for (i = 0; i < ctx->num_blocks; i++) {
-        if (bytes_left < ctx->block_size[i]) {
-            av_log(avctx, AV_LOG_ERROR, "I'm pedaling backwards\n");
-            break;
-        }
-        init_get_bits(&gb, block_pointer, ctx->block_size[i] * 8);
-        if (decode_block(avctx, &gb, samples0 + ctx->sample_offset,
-                                     samples1 + ctx->sample_offset) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Sir, I got carsick in your office. Not decoding the rest of packet.\n");
-            break;
-        }
-        block_pointer += ctx->block_size[i];
-        bytes_left    -= ctx->block_size[i];
-    }
-
-    frame->nb_samples = ctx->sample_offset;
-    *got_frame_ptr    = ctx->sample_offset > 0;
-
-    return avpkt->size;
-}
-
-static void decode_flush(AVCodecContext *avctx)
-{
-    RALFContext *ctx = avctx->priv_data;
-
-    ctx->has_pkt = 0;
-}
-
-
-AVCodec ff_ralf_decoder = {
-    .name           = "ralf",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealAudio Lossless"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_RALF,
-    .priv_data_size = sizeof(RALFContext),
-    .init           = decode_init,
-    .close          = decode_close,
-    .decode         = decode_frame,
-    .flush          = decode_flush,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/ralfdata.h b/deps/libav/libavcodec/ralfdata.h
deleted file mode 100644
index 83eb970..0000000
--- a/deps/libav/libavcodec/ralfdata.h
+++ /dev/null
@@ -1,9920 +0,0 @@
-/*
- * RealAudio Lossless decoder
- *
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_RALFDATA_H
-#define AVCODEC_RALFDATA_H
-
-#include <stdint.h>
-
-#define FILTERPARAM_ELEMENTS   643
-#define BIAS_ELEMENTS          255
-#define CODING_MODE_ELEMENTS   140
-#define FILTER_COEFFS_ELEMENTS  43
-#define SHORT_CODES_ELEMENTS   169
-#define LONG_CODES_ELEMENTS    441
-
-static const uint8_t filter_param_def[3][324] = {
-  {
-    0x48, 0x86, 0x66, 0x8A, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB4, 0x54, 0x45,
-    0x66, 0x88, 0xAA, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x65, 0x45, 0x55, 0x66, 0x77, 0x78,
-    0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xBC, 0xCB, 0xBF, 0xFF, 0xCF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF9, 0x86, 0x55, 0x55, 0x55, 0x66, 0x67, 0x77, 0x88, 0x88, 0x99,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0x9B, 0xBB, 0xCB, 0xBB, 0xCC, 0xCC,
-    0xCF, 0xFF, 0xCC, 0xCF, 0xFC, 0xBC, 0xCC, 0xFB, 0xB9, 0xFC, 0xA8, 0x76,
-    0x66, 0x56, 0x66, 0x67, 0x67, 0x77, 0x78, 0x88, 0x88, 0x89, 0x88, 0x89,
-    0x99, 0x99, 0x9A, 0x9A, 0x9A, 0x9A, 0xAA, 0xAA, 0xAA, 0xAA, 0x9A, 0xA9,
-    0xAB, 0xA9, 0xA9, 0x98, 0x86, 0xFF, 0xCA, 0x88, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x88, 0x88, 0x88, 0x88, 0x99, 0x99, 0x99, 0x98, 0x99, 0x99, 0x9A,
-    0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x98, 0x88, 0x87,
-    0x65, 0xFF, 0xFB, 0xAA, 0xA9, 0x88, 0x88, 0x89, 0x99, 0x98, 0x99, 0x9A,
-    0xA9, 0x9A, 0xA9, 0xAA, 0xA9, 0x9A, 0xAA, 0xA9, 0xAA, 0xA9, 0x99, 0x99,
-    0xA9, 0x9A, 0x99, 0x99, 0x99, 0x98, 0x88, 0x77, 0x64, 0xFF, 0xFF, 0xFC,
-    0xBB, 0xBA, 0xB9, 0xAA, 0xAB, 0xAA, 0xAA, 0xBA, 0xAB, 0xAB, 0xAB, 0xCB,
-    0xBA, 0xAB, 0xBB, 0xBB, 0xAA, 0xBA, 0xAA, 0xAA, 0xAA, 0xA9, 0xAA, 0x99,
-    0x99, 0x99, 0x88, 0x87, 0x64, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCB, 0xBB, 0xBC, 0xBB, 0xCC, 0xFB, 0xCC, 0xCF, 0xCF,
-    0xCC, 0xFC, 0xFC, 0xCF, 0xCB, 0xCC, 0xBB, 0xBB, 0xCB, 0xBB, 0xAA, 0x99,
-    0x86, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xB8, 0xA0, 0x00, 0x00,
-  }, {
-    0xFB, 0x95, 0x67, 0x8B, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x55, 0x56,
-    0x77, 0x89, 0xBA, 0xBB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB8, 0x65, 0x55, 0x55, 0x56, 0x77, 0x78,
-    0x89, 0x9A, 0xAA, 0xAA, 0xBC, 0xBC, 0xCB, 0xBC, 0xCF, 0xCF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFB, 0x86, 0x55, 0x55, 0x55, 0x55, 0x56, 0x67, 0x77, 0x77, 0x88,
-    0x89, 0x9A, 0x99, 0x99, 0xAA, 0xBB, 0xBB, 0xAB, 0xBF, 0xCB, 0xFA, 0xCC,
-    0xFC, 0xEC, 0xEF, 0xFB, 0xBC, 0xFF, 0xBC, 0xBB, 0xA9, 0xFF, 0x98, 0x76,
-    0x66, 0x66, 0x65, 0x66, 0x66, 0x76, 0x77, 0x77, 0x77, 0x88, 0x88, 0x88,
-    0x89, 0x99, 0x99, 0x99, 0x99, 0xA9, 0x99, 0x99, 0x9A, 0x99, 0x99, 0xAA,
-    0xAA, 0xA9, 0x99, 0x98, 0x76, 0xFF, 0xF9, 0x87, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x99, 0x99, 0x89, 0x99,
-    0x99, 0x99, 0x99, 0x89, 0x99, 0x99, 0x99, 0x98, 0x99, 0x98, 0x77, 0x77,
-    0x65, 0xFF, 0xCA, 0xA9, 0x99, 0x89, 0x88, 0x88, 0x98, 0x89, 0x99, 0x98,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0x99, 0x99, 0xA9, 0x9A, 0xA9, 0x99, 0x99,
-    0x99, 0x99, 0xA9, 0x99, 0x99, 0x98, 0x88, 0x77, 0x64, 0xFF, 0xCB, 0xA9,
-    0xA9, 0xAA, 0xAA, 0xAA, 0x9A, 0xAB, 0xAA, 0x9A, 0xBB, 0xAB, 0xAB, 0xBB,
-    0xAB, 0xBA, 0xBB, 0xBA, 0xAA, 0xBA, 0xBA, 0xAA, 0xAA, 0xA9, 0xA9, 0x99,
-    0x99, 0x99, 0x88, 0x77, 0x64, 0xFF, 0xFF, 0xFF, 0xBC, 0xFB, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBA, 0xBA, 0xAB, 0xBF, 0xCB, 0xBB, 0xBB, 0xBC, 0xBF, 0xCC,
-    0xCB, 0xCB, 0xCC, 0xBB, 0xBB, 0xFB, 0xCB, 0xBC, 0xCA, 0xBC, 0xAA, 0xA9,
-    0x86, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFC, 0xFF, 0xFF, 0xCF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xF0, 0x00, 0x00,
-  }, {
-    0x9B, 0x65, 0x67, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB5, 0x54, 0x56,
-    0x67, 0x88, 0xA9, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA8, 0x65, 0x44, 0x45, 0x56, 0x67, 0x78,
-    0x89, 0x99, 0xA9, 0xAA, 0xBB, 0xBB, 0xAB, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF9, 0x76, 0x55, 0x54, 0x55, 0x55, 0x56, 0x67, 0x77, 0x77, 0x88,
-    0x89, 0x99, 0x98, 0x99, 0x8A, 0x99, 0xBB, 0xAB, 0xBC, 0xAB, 0xBA, 0xAA,
-    0xBB, 0xCB, 0xCC, 0xBB, 0xCC, 0xBB, 0xAC, 0xBA, 0x97, 0xFB, 0x97, 0x76,
-    0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x88, 0x88, 0x88, 0x88,
-    0x99, 0x89, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x9A, 0x98, 0x99, 0x99,
-    0xA9, 0x99, 0x88, 0x87, 0x65, 0xFF, 0xCA, 0x98, 0x87, 0x77, 0x77, 0x87,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99,
-    0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x88, 0x87, 0x77,
-    0x64, 0xFF, 0xFC, 0xCA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x99, 0xAA, 0x9A,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0x99, 0x99, 0x99, 0x89, 0x88, 0x87, 0x64, 0xFF, 0xFF, 0xFB,
-    0xFF, 0xBC, 0xFC, 0xBB, 0xCB, 0xBB, 0xCA, 0xCB, 0xBC, 0xCC, 0xBF, 0xBC,
-    0xBB, 0xBB, 0xBE, 0xBC, 0xCB, 0xCC, 0xBB, 0xFC, 0xBC, 0xCC, 0xAB, 0xCB,
-    0xAB, 0xBB, 0xAA, 0xA9, 0x97, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xCF, 0xFB,
-    0xCC, 0xFC, 0xCF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-  }
-};
-
-static const uint8_t bias_def[3][128] = {
-  {
-    0x4A, 0xAA, 0xAA, 0xAA, 0xBA, 0xBA, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x9A, 0xA9, 0xA9,
-    0x99, 0xA9, 0x99, 0x99, 0xA9, 0xA9, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99,
-    0x99, 0x99, 0x88, 0x98, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x66, 0x66, 0x66, 0x55, 0x55, 0x55,
-    0x55, 0x54, 0x44, 0x32, 0x44, 0x55, 0x55, 0x66, 0x66, 0x66, 0x66, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x87, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x89, 0x88, 0x89, 0x89, 0x99, 0x99, 0x98, 0x99, 0x9A,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xA9, 0x9A, 0x99, 0x9A, 0xA9, 0xA9, 0xA9,
-    0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBA, 0x40,
-  }, {
-    0x4C, 0xBC, 0xAC, 0xBC, 0xBA, 0xAB, 0xAB, 0xBB, 0xBA, 0xAA, 0xAB, 0xAA,
-    0xBB, 0xAA, 0xBB, 0xAA, 0xAB, 0xBA, 0xBA, 0xAA, 0xBB, 0xAA, 0xA9, 0xAA,
-    0xBB, 0xAA, 0xAA, 0x9A, 0x9A, 0xAA, 0xA9, 0xAA, 0x99, 0x99, 0x99, 0x99,
-    0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x98, 0x89, 0x88, 0x88, 0x88, 0x88,
-    0x87, 0x78, 0x77, 0x77, 0x77, 0x77, 0x67, 0x66, 0x66, 0x55, 0x44, 0x45,
-    0x54, 0x44, 0x44, 0x33, 0x44, 0x45, 0x55, 0x56, 0x66, 0x66, 0x66, 0x67,
-    0x77, 0x77, 0x77, 0x77, 0x87, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x99, 0x88, 0x99, 0x99, 0x89, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xA9,
-    0xA9, 0xAA, 0x9A, 0xA9, 0xAA, 0x9A, 0xAA, 0x9A, 0xAA, 0xAB, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xBB, 0xBA, 0xAA, 0xAB, 0xAB, 0xAA,
-    0xAB, 0xAB, 0xAC, 0xBB, 0xAA, 0xBB, 0xBB, 0x40,
-  }, {
-    0x5B, 0xBB, 0xBC, 0xBB, 0xCB, 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xBB, 0xCB,
-    0xBA, 0xCB, 0xBC, 0xBB, 0xAA, 0xBB, 0xAB, 0xBA, 0xBB, 0xBB, 0xAB, 0xBB,
-    0xAA, 0xBA, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA9, 0x9A,
-    0x9A, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x89, 0x99,
-    0x88, 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x66, 0x66, 0x55,
-    0x54, 0x44, 0x43, 0x22, 0x34, 0x44, 0x55, 0x56, 0x66, 0x66, 0x67, 0x77,
-    0x77, 0x77, 0x87, 0x88, 0x88, 0x88, 0x88, 0x88, 0x99, 0x89, 0x99, 0x99,
-    0x99, 0x99, 0x99, 0x9A, 0x9A, 0xA9, 0xA9, 0x9A, 0x9A, 0xAA, 0x9A, 0xAA,
-    0xAA, 0xAA, 0xBA, 0xAA, 0xAA, 0xAA, 0xBA, 0xAA, 0xAA, 0xAB, 0xBA, 0xBB,
-    0xAA, 0xBB, 0xAB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC,
-    0xBB, 0xBC, 0xBB, 0xBB, 0xCC, 0xBC, 0xCB, 0x50,
-  }
-};
-
-static const uint8_t coding_mode_def[3][72] = {
-  {
-    0xAA, 0x99, 0xAC, 0xB9, 0xBD, 0xAA, 0x7A, 0xA8, 0xA8, 0xA8, 0x79, 0x79,
-    0x77, 0xA8, 0x97, 0x79, 0x89, 0x77, 0x87, 0x87, 0x68, 0x78, 0x66, 0x86,
-    0x87, 0x67, 0x68, 0x66, 0x76, 0x76, 0x57, 0x67, 0x55, 0x75, 0x65, 0x56,
-    0x56, 0x55, 0x65, 0x65, 0x56, 0x45, 0x55, 0x54, 0x55, 0x55, 0x45, 0x55,
-    0x54, 0x55, 0x55, 0x45, 0x56, 0x64, 0x66, 0x76, 0x57, 0x67, 0x77, 0x77,
-    0x98, 0x88, 0x9D, 0xBF, 0xBA, 0xEC, 0xFC, 0xBA, 0xEF, 0xFC, 0x00, 0x00,
-  }, {
-    0xCF, 0x9B, 0xAF, 0xFF, 0xFF, 0xAB, 0x8A, 0x98, 0xB8, 0xF9, 0x78, 0x89,
-    0x77, 0xF9, 0xF7, 0x79, 0x89, 0x77, 0x97, 0x97, 0x68, 0x68, 0x66, 0xA6,
-    0x87, 0x77, 0x68, 0x66, 0x75, 0x76, 0x67, 0x56, 0x65, 0x75, 0x75, 0x56,
-    0x56, 0x55, 0x65, 0x65, 0x56, 0x56, 0x55, 0x54, 0x55, 0x55, 0x45, 0x55,
-    0x53, 0x55, 0x65, 0x35, 0x67, 0x64, 0x66, 0x66, 0x56, 0x78, 0x86, 0x88,
-    0xA8, 0xFB, 0xAF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
-  }, {
-    0xDC, 0xAD, 0xCC, 0xCA, 0xCF, 0xFE, 0xDF, 0xFF, 0xE9, 0xFF, 0x99, 0x79,
-    0x97, 0x97, 0x97, 0x79, 0x79, 0x77, 0x97, 0x97, 0x79, 0x79, 0x77, 0x86,
-    0x87, 0x68, 0x68, 0x76, 0x76, 0x76, 0x67, 0x57, 0x66, 0x65, 0x76, 0x66,
-    0x56, 0x55, 0x64, 0x65, 0x55, 0x45, 0x55, 0x54, 0x55, 0x55, 0x35, 0x55,
-    0x53, 0x55, 0x65, 0x35, 0x67, 0x64, 0x67, 0x87, 0x57, 0x8A, 0x86, 0x8B,
-    0xBA, 0x9A, 0xCD, 0xAA, 0xAF, 0xFC, 0xFF, 0xFF, 0xDF, 0xFF, 0x00, 0x00,
-  }
-};
-
-static const uint8_t filter_coeffs_def[3][10][11][24] = {
- {
-  {
-   {
-    0x47, 0x88, 0x76, 0x52, 0x12, 0x35, 0x44, 0x43, 0x34, 0x45, 0x77, 0x67,
-    0x66, 0x87, 0x87, 0x7D, 0x8A, 0x89, 0x9D, 0xDD, 0x9C, 0xC0, 0x00, 0x00,
-   },
-   {
-    0x7C, 0xCC, 0xC7, 0x65, 0xCC, 0x22, 0x23, 0x46, 0x32, 0x22, 0x46, 0x7B,
-    0xB6, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xBB, 0xB4, 0x43, 0x25, 0x5B, 0x5A, 0xAB, 0x5B, 0x22, 0x22, 0x2B,
-    0xBA, 0xAA, 0x46, 0x5B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0x99, 0x89, 0x88, 0x89, 0x31, 0x88, 0x88, 0x89, 0x88, 0x38, 0x88, 0x13,
-    0x28, 0x88, 0x88, 0x28, 0x88, 0x88, 0x88, 0x88, 0x99, 0x90, 0x00, 0x00,
-   },
-   {
-    0x99, 0x89, 0x88, 0x89, 0x88, 0x88, 0x88, 0x39, 0x98, 0x88, 0x88, 0x88,
-    0x08, 0x88, 0x88, 0x81, 0x99, 0x88, 0x99, 0x99, 0x99, 0x20, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xD9, 0x86, 0xCD, 0xDD, 0xDD, 0x98, 0x76, 0x43, 0x65, 0x35, 0x63,
-    0x23, 0x44, 0x33, 0x24, 0x45, 0x44, 0x45, 0x59, 0xA8, 0x90, 0x00, 0x00,
-   },
-   {
-    0x99, 0x89, 0x88, 0x89, 0x98, 0x88, 0x88, 0x89, 0x98, 0x08, 0x88, 0x88,
-    0x28, 0x88, 0x88, 0x83, 0x19, 0x98, 0x88, 0x99, 0x99, 0x90, 0x00, 0x00,
-   },
-   {
-    0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA5, 0xA4, 0x01, 0x4A, 0xAA,
-    0x53, 0x4A, 0xA4, 0xAA, 0x5A, 0xAA, 0xAA, 0xAA, 0xAA, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x9A, 0xAA, 0xA3, 0x31, 0x31,
-    0x34, 0x34, 0xA9, 0xA5, 0x44, 0x4A, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xED, 0xDE, 0xEE, 0xED, 0xDD, 0xDE, 0xE8, 0xEE, 0xE7, 0x64,
-    0x47, 0x43, 0x30, 0x43, 0x43, 0x36, 0x7E, 0xEE, 0xEE, 0x90, 0x00, 0x00,
-   },
-   {
-    0x67, 0x87, 0x87, 0x66, 0x65, 0x55, 0x44, 0x45, 0x65, 0x54, 0x54, 0x32,
-    0x34, 0x66, 0x63, 0x55, 0x44, 0x54, 0x34, 0x45, 0x56, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x56, 0x66, 0x65, 0x54, 0x33, 0x34, 0x33, 0x33, 0x33, 0x34, 0x44, 0x45,
-    0x56, 0x66, 0x67, 0x77, 0x77, 0x77, 0x78, 0x89, 0x89, 0x60, 0x00, 0x00,
-   },
-   {
-    0x78, 0x89, 0x98, 0x65, 0x65, 0x32, 0x22, 0x32, 0x33, 0x33, 0x45, 0x77,
-    0x77, 0x8B, 0x9A, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0x9D, 0xD8, 0x8D, 0x57, 0x56, 0x55, 0x44, 0x45, 0x22, 0x22, 0x23, 0x34,
-    0x57, 0x78, 0x88, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xDC, 0xCC, 0x8C, 0xCC, 0x87, 0x65, 0x55, 0x54, 0x23, 0x44, 0x21, 0x23,
-    0x46, 0x56, 0x87, 0x7C, 0x8C, 0x8C, 0xCC, 0xCC, 0xCC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xCD, 0xCC, 0xCD, 0xDC, 0xC7, 0x64, 0x58, 0x31, 0x25, 0x33, 0x22,
-    0x44, 0x56, 0x66, 0x6D, 0xDD, 0xDD, 0xDC, 0xDC, 0xDC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xB9, 0x99, 0xA6, 0x67, 0x78, 0x76, 0x78, 0x88, 0x66, 0x55, 0x44, 0x43,
-    0x23, 0x33, 0x33, 0x33, 0x34, 0x45, 0x56, 0x66, 0x88, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xCD, 0xDC, 0xCD, 0xDC, 0xCC, 0x77, 0xC5, 0x53, 0x12, 0x23, 0x33,
-    0x33, 0x46, 0x65, 0x75, 0x8D, 0xDD, 0xDD, 0xDC, 0xDC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xCD, 0xCC, 0xCD, 0xDC, 0xCC, 0x8C, 0x85, 0x55, 0x33, 0x21, 0x23,
-    0x33, 0x44, 0x56, 0x56, 0x56, 0x8D, 0xDD, 0xCC, 0xDC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xDD, 0xDE, 0xDD, 0xDD, 0xDD, 0x87, 0x75, 0x55, 0x43, 0x22,
-    0x21, 0x25, 0x65, 0x55, 0x66, 0x77, 0xD8, 0x8D, 0xDD, 0x90, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xAA, 0x98, 0x77, 0x55, 0x43,
-    0x33, 0x33, 0x21, 0x33, 0x34, 0x66, 0x89, 0xAF, 0xFF, 0xC0, 0x00, 0x00,
-   },
-   {
-    0x57, 0x77, 0x76, 0x66, 0x65, 0x55, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
-    0x33, 0x44, 0x43, 0x44, 0x44, 0x45, 0x56, 0x66, 0x77, 0x50, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x57, 0x76, 0x66, 0x65, 0x44, 0x44, 0x43, 0x33, 0x33, 0x33, 0x33, 0x34,
-    0x45, 0x56, 0x67, 0x77, 0x77, 0x89, 0x88, 0x89, 0x99, 0x60, 0x00, 0x00,
-   },
-   {
-    0x8A, 0x99, 0x88, 0x77, 0x66, 0x44, 0x43, 0x32, 0x32, 0x22, 0x33, 0x45,
-    0x67, 0x89, 0xEB, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFB, 0xBA, 0xA7, 0x78, 0x66, 0x65, 0x54, 0x22, 0x21, 0x23, 0x44,
-    0x56, 0x8A, 0x9E, 0xAF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xAF, 0xFD, 0xDF, 0xAC, 0x98, 0x77, 0x66, 0x44, 0x31, 0x11, 0x35,
-    0x67, 0x88, 0x8A, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xEF, 0xEE, 0xEF, 0xA8, 0x8E, 0x97, 0x66, 0x43, 0x22, 0x21, 0x23,
-    0x45, 0x67, 0x97, 0x7F, 0xFF, 0xEE, 0xE9, 0xEE, 0xEE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xA9, 0x97, 0x65, 0x45, 0x45, 0x67, 0x66, 0x55, 0x54, 0x44, 0x44,
-    0x33, 0x33, 0x33, 0x33, 0x44, 0x45, 0x56, 0x68, 0x8B, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xED, 0xDE, 0xED, 0xDD, 0xD8, 0x77, 0x65, 0x43, 0x11, 0x22,
-    0x34, 0x66, 0x78, 0x87, 0xEE, 0xEE, 0xEE, 0x9D, 0xED, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xDC, 0xFF, 0xAE, 0xEA, 0x98, 0x76, 0x54, 0x31, 0x11,
-    0x34, 0x56, 0x88, 0x99, 0x9B, 0xFF, 0xFF, 0xBF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xCF, 0xDF, 0xFF, 0xFD, 0x9A, 0x76, 0x65, 0x43, 0x21,
-    0x12, 0x35, 0x56, 0x67, 0x89, 0x99, 0xAF, 0xAF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFE, 0xEF, 0xDB, 0xBA, 0xAA, 0x99, 0x76, 0x55, 0x43, 0x22,
-    0x22, 0x33, 0x33, 0x44, 0x55, 0x67, 0x8A, 0xFA, 0xFB, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x57, 0x77, 0x77, 0x66, 0x65, 0x55, 0x54, 0x44, 0x44, 0x44, 0x43, 0x33,
-    0x33, 0x34, 0x44, 0x44, 0x55, 0x55, 0x66, 0x77, 0x88, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x58, 0x77, 0x76, 0x66, 0x55, 0x54, 0x44, 0x33, 0x33, 0x23, 0x33, 0x33,
-    0x45, 0x56, 0x66, 0x77, 0x88, 0x88, 0x88, 0x88, 0x99, 0x60, 0x00, 0x00,
-   },
-   {
-    0x9A, 0xA9, 0xA9, 0x88, 0x76, 0x55, 0x44, 0x33, 0x22, 0x22, 0x23, 0x45,
-    0x56, 0x99, 0x9D, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFD, 0xBB, 0xAA, 0xBA, 0xA9, 0x87, 0x77, 0x54, 0x33, 0x21, 0x12, 0x45,
-    0x68, 0x8A, 0xAA, 0xCB, 0xFF, 0xCF, 0xFF, 0xFF, 0xFE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xA9, 0x98, 0x87, 0x65, 0x41, 0x02, 0x45,
-    0x77, 0x88, 0xAC, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xBF, 0xFC, 0xAB, 0xFB, 0xBA, 0xAB, 0xB8, 0x88, 0x76, 0x52, 0x01, 0x35,
-    0x78, 0x99, 0xAB, 0xAA, 0xCF, 0xBB, 0xCF, 0xFC, 0xFC, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xBA, 0xCA, 0x98, 0x75, 0x21, 0x35, 0x77, 0x77, 0x76, 0x65, 0x54, 0x44,
-    0x44, 0x34, 0x44, 0x44, 0x45, 0x56, 0x78, 0x88, 0x9A, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xDF, 0xCF, 0xCC, 0xFF, 0xAB, 0xC9, 0xB9, 0x98, 0x97, 0x75, 0x20, 0x13,
-    0x56, 0x89, 0x89, 0xAA, 0xFC, 0xBC, 0xAF, 0xCC, 0xFF, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xBB, 0xFB, 0xFF, 0xFB, 0xBA, 0xA8, 0x77, 0x54, 0x21, 0x11,
-    0x45, 0x67, 0x88, 0x8A, 0xEF, 0xBB, 0xFF, 0xBB, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFB, 0xCB, 0xB9, 0x88, 0x65, 0x31, 0x12,
-    0x23, 0x35, 0x67, 0x88, 0xAA, 0xAC, 0xFC, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFC, 0xEF, 0xFF, 0xBB, 0xAA, 0xA9, 0x76, 0x55, 0x32, 0x22,
-    0x22, 0x33, 0x34, 0x56, 0x67, 0x68, 0x9A, 0xAA, 0xCD, 0xE0, 0x00, 0x00,
-   },
-   {
-    0x58, 0x77, 0x77, 0x66, 0x66, 0x55, 0x54, 0x44, 0x44, 0x43, 0x33, 0x33,
-    0x33, 0x34, 0x44, 0x55, 0x55, 0x66, 0x67, 0x78, 0x88, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x57, 0x77, 0x76, 0x66, 0x55, 0x55, 0x54, 0x43, 0x33, 0x22, 0x33, 0x34,
-    0x45, 0x55, 0x66, 0x67, 0x77, 0x77, 0x78, 0x88, 0x99, 0x50, 0x00, 0x00,
-   },
-   {
-    0xAC, 0x99, 0x98, 0x87, 0x76, 0x66, 0x54, 0x43, 0x32, 0x21, 0x23, 0x45,
-    0x66, 0x89, 0x99, 0x99, 0xAA, 0xBF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xB9, 0xAA, 0x98, 0x77, 0x65, 0x42, 0x21, 0x12, 0x45,
-    0x78, 0x8A, 0xBA, 0xAA, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFD, 0xBC, 0xBB, 0xB9, 0x98, 0x76, 0x32, 0x01, 0x46,
-    0x79, 0xAB, 0xBB, 0xBE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xAA, 0xAA, 0x99, 0x76, 0x42, 0x01, 0x36,
-    0x79, 0x9A, 0xAB, 0xBF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xCC, 0xDC, 0xB9, 0x75, 0x10, 0x47, 0x89, 0x99, 0x98, 0x87, 0x76, 0x66,
-    0x55, 0x55, 0x55, 0x56, 0x66, 0x67, 0x78, 0x99, 0xBE, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFC, 0xCC, 0xFF, 0xFB, 0xAB, 0x87, 0x64, 0x10, 0x23,
-    0x67, 0x99, 0x9A, 0xAD, 0xCE, 0xFF, 0xFC, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFD, 0xFA, 0xB9, 0x97, 0x65, 0x20, 0x13,
-    0x56, 0x78, 0xAA, 0x9B, 0xFB, 0xFC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xCF, 0xFC, 0xC9, 0xAC, 0x98, 0x87, 0x54, 0x31, 0x12,
-    0x23, 0x45, 0x67, 0x78, 0x9A, 0xAA, 0xEB, 0xFF, 0xFF, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFE, 0xCA, 0xFA, 0x99, 0x98, 0x88, 0x65, 0x44, 0x32, 0x22,
-    0x22, 0x33, 0x45, 0x56, 0x67, 0x78, 0x99, 0xBB, 0xAB, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x48, 0x77, 0x76, 0x66, 0x65, 0x55, 0x55, 0x44, 0x44, 0x43, 0x33, 0x33,
-    0x33, 0x34, 0x45, 0x55, 0x55, 0x66, 0x67, 0x77, 0x78, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x68, 0x87, 0x77, 0x77, 0x66, 0x55, 0x54, 0x43, 0x33, 0x22, 0x23, 0x34,
-    0x45, 0x55, 0x66, 0x78, 0x88, 0x98, 0x88, 0x88, 0x89, 0x60, 0x00, 0x00,
-   },
-   {
-    0xAB, 0xBA, 0xAA, 0xBA, 0x99, 0x87, 0x76, 0x54, 0x33, 0x21, 0x12, 0x46,
-    0x67, 0x89, 0x9A, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x87, 0x76, 0x54, 0x21, 0x11, 0x45,
-    0x78, 0x8A, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xAA, 0x99, 0x76, 0x32, 0x01, 0x46,
-    0x78, 0x9A, 0xAB, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0xE9, 0x89, 0x76, 0x52, 0x01, 0x35,
-    0x68, 0x98, 0x9A, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xAD, 0xCB, 0xA9, 0x74, 0x10, 0x46, 0x89, 0x9A, 0xA9, 0x98, 0x77, 0x76,
-    0x66, 0x55, 0x55, 0x56, 0x66, 0x66, 0x78, 0x88, 0x8A, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xAA, 0xAA, 0x87, 0x63, 0x10, 0x24,
-    0x67, 0x89, 0xAF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x9A, 0x97, 0x64, 0x20, 0x13,
-    0x67, 0x89, 0x9A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x87, 0x76, 0x43, 0x21, 0x12,
-    0x34, 0x56, 0x67, 0x88, 0x89, 0xAE, 0xCF, 0xFD, 0xEF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xAA, 0x87, 0x66, 0x54, 0x31, 0x12,
-    0x33, 0x44, 0x55, 0x67, 0x77, 0x89, 0xAB, 0xAB, 0xCF, 0xC0, 0x00, 0x00,
-   },
-   {
-    0x58, 0x87, 0x87, 0x77, 0x76, 0x66, 0x55, 0x55, 0x44, 0x43, 0x32, 0x22,
-    0x33, 0x44, 0x55, 0x56, 0x67, 0x77, 0x78, 0x88, 0x88, 0x70, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x67, 0x76, 0x66, 0x76, 0x66, 0x55, 0x44, 0x44, 0x33, 0x22, 0x22, 0x34,
-    0x56, 0x67, 0x77, 0x89, 0x88, 0x99, 0xAB, 0x9A, 0xAB, 0x70, 0x00, 0x00,
-   },
-   {
-    0x9B, 0xA9, 0x88, 0x88, 0x87, 0x77, 0x65, 0x54, 0x43, 0x21, 0x12, 0x45,
-    0x67, 0x9A, 0x9A, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFC, 0xCB, 0xBA, 0xAA, 0x98, 0x87, 0x65, 0x31, 0x02, 0x56,
-    0x89, 0xAB, 0xCB, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xAA, 0x9A, 0x98, 0x76, 0x42, 0x01, 0x36,
-    0x79, 0xAF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x78, 0xA9, 0x98, 0x76, 0x52, 0x01, 0x35,
-    0x78, 0x8E, 0xCB, 0xBF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0x8C, 0xBA, 0x99, 0x74, 0x10, 0x36, 0x89, 0x9A, 0xA9, 0x99, 0x88, 0x87,
-    0x76, 0x66, 0x66, 0x66, 0x66, 0x56, 0x66, 0x78, 0x89, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x8A, 0xA9, 0x88, 0x63, 0x10, 0x24,
-    0x67, 0x8B, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x99, 0x76, 0x54, 0x10, 0x24,
-    0x56, 0x78, 0x9A, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xD9, 0x87, 0x54, 0x20, 0x22,
-    0x45, 0x67, 0x77, 0x89, 0xAC, 0xAB, 0xFB, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAD, 0xAB, 0x86, 0x54, 0x21, 0x12,
-    0x34, 0x45, 0x66, 0x77, 0x67, 0x77, 0x88, 0x99, 0x9A, 0x90, 0x00, 0x00,
-   },
-   {
-    0x57, 0x77, 0x76, 0x66, 0x65, 0x55, 0x55, 0x55, 0x54, 0x43, 0x32, 0x23,
-    0x33, 0x44, 0x55, 0x55, 0x66, 0x67, 0x88, 0x77, 0x77, 0x50, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x35, 0x44, 0x45, 0x55, 0x54, 0x44, 0x44, 0x43, 0x33, 0x33, 0x23, 0x44,
-    0x68, 0x99, 0xAA, 0xAA, 0xCB, 0xAB, 0xAF, 0xFE, 0xEB, 0xE0, 0x00, 0x00,
-   },
-   {
-    0x77, 0x66, 0x67, 0x66, 0x66, 0x66, 0x54, 0x44, 0x33, 0x22, 0x12, 0x45,
-    0x68, 0xAA, 0xBE, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xEA, 0x98, 0x88, 0x87, 0x77, 0x65, 0x55, 0x44, 0x32, 0x02, 0x46,
-    0x78, 0x89, 0xAA, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xAB, 0xAB, 0x99, 0x76, 0x65, 0x42, 0x01, 0x45,
-    0x78, 0xAA, 0xAD, 0xAC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xEB, 0xBA, 0xA9, 0x86, 0x42, 0x01, 0x36,
-    0x77, 0x8A, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xAC, 0xBB, 0x98, 0x74, 0x10, 0x36, 0x77, 0x89, 0x99, 0x99, 0x88, 0x77,
-    0x76, 0x66, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAA, 0xAB, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xC9, 0x99, 0x99, 0x88, 0x64, 0x10, 0x24,
-    0x55, 0x68, 0x89, 0xBB, 0xAD, 0xBF, 0xBF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x97, 0x65, 0x65, 0x54, 0x20, 0x23,
-    0x45, 0x56, 0x77, 0x77, 0x8E, 0xCB, 0xBE, 0xDF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x76, 0x53, 0x21, 0x13,
-    0x34, 0x55, 0x45, 0x55, 0x67, 0x79, 0xAB, 0xFA, 0xFB, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFE, 0x87, 0x54, 0x21, 0x23,
-    0x33, 0x44, 0x55, 0x55, 0x44, 0x45, 0x57, 0x8A, 0xAA, 0x80, 0x00, 0x00,
-   },
-   {
-    0x79, 0x99, 0x99, 0x97, 0x77, 0x76, 0x54, 0x44, 0x44, 0x44, 0x32, 0x33,
-    0x33, 0x33, 0x44, 0x45, 0x56, 0x67, 0x88, 0x77, 0x78, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x34, 0x54, 0x45, 0x55, 0x54, 0x44, 0x44, 0x33, 0x32, 0x43, 0x34, 0x44,
-    0x56, 0x77, 0xBB, 0xB6, 0xCC, 0xCC, 0xCC, 0xC8, 0xCB, 0x70, 0x00, 0x00,
-   },
-   {
-    0x7E, 0x67, 0x55, 0x65, 0x44, 0x55, 0x44, 0x33, 0x22, 0x23, 0x23, 0x57,
-    0x98, 0xDD, 0xDD, 0xDE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xEF, 0xEE, 0x97, 0x75, 0x54, 0x43, 0x33, 0x33, 0x32, 0x12, 0x58,
-    0x88, 0xEE, 0xAE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x88, 0x87, 0x66, 0x53, 0x22, 0x02, 0x57,
-    0x9D, 0xFF, 0xFF, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xA9, 0x78, 0x76, 0x42, 0x01, 0x36,
-    0x99, 0x9A, 0xFF, 0xDF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xAB, 0xAA, 0xA8, 0x75, 0x10, 0x26, 0x79, 0x88, 0x77, 0x77, 0x66, 0x66,
-    0x57, 0x78, 0x88, 0x89, 0x98, 0x9A, 0xBB, 0xBB, 0xDD, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFE, 0xA8, 0x78, 0x76, 0x54, 0x20, 0x22,
-    0x45, 0x6E, 0x8E, 0xEF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFA, 0xE7, 0x66, 0x64, 0x20, 0x23,
-    0x34, 0x56, 0x78, 0x88, 0xAF, 0xFC, 0xFF, 0xFF, 0xAF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xED, 0xDE, 0xED, 0x8D, 0xDD, 0xD9, 0xE6, 0x63, 0x21, 0x23,
-    0x43, 0x34, 0x35, 0x55, 0x65, 0x47, 0xEE, 0xED, 0xED, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xCD, 0xDC, 0xCD, 0xDD, 0xCC, 0xCC, 0xCD, 0xDD, 0x76, 0x43, 0x44,
-    0x44, 0x43, 0x34, 0x33, 0x22, 0x33, 0x35, 0xD8, 0xCC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0x6B, 0x77, 0xBB, 0xB6, 0x96, 0x55, 0x55, 0x54, 0x44, 0x44, 0x33, 0x43,
-    0x33, 0x33, 0x45, 0x34, 0x44, 0x68, 0x57, 0x78, 0x86, 0x50, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x4A, 0xAA, 0xAA, 0x9A, 0x44, 0x44, 0x45, 0x23, 0x24, 0x22, 0xA3, 0x3A,
-    0x44, 0x99, 0x99, 0x9A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0x45, 0x34, 0x94, 0x4A, 0x4A, 0x32, 0x23, 0x32, 0x24, 0x4A, 0xAA,
-    0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xAA, 0xAA, 0xAA, 0x4A, 0xA4, 0x44, 0x21, 0x43, 0x32, 0x23, 0x5A,
-    0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x7D, 0x8D, 0x74, 0x21, 0x11, 0x35, 0x7D,
-    0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xFE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE9, 0x64, 0x32, 0x01, 0x57,
-    0xE8, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xE9, 0x55, 0x10, 0x27, 0x98, 0x65, 0x48, 0xAE, 0x99, 0x88,
-    0x77, 0x87, 0x79, 0x89, 0xEA, 0xEE, 0xAE, 0xEE, 0xEE, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB6, 0x45, 0x11, 0x13,
-    0x44, 0x3B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x5A, 0x31, 0x12,
-    0x23, 0x34, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xBB, 0xBB, 0xAB, 0xBB, 0xBB, 0xAA, 0xAB, 0xBB, 0xBB, 0xB5, 0x55,
-    0x64, 0x22, 0x24, 0x55, 0x32, 0x14, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xAA, 0xA9, 0x9A, 0xAA, 0xA9, 0x99, 0x9A, 0x4A, 0xAA, 0xA3, 0x33,
-    0x32, 0x34, 0x35, 0x44, 0x42, 0x24, 0xA4, 0xAA, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0x9A, 0x99, 0x9A, 0xA9, 0x54, 0x94, 0x95, 0x44, 0x53, 0x34, 0x53,
-    0x23, 0x34, 0x34, 0x45, 0x33, 0x4A, 0x99, 0x99, 0xA9, 0xA0, 0x00, 0x00,
-   },
-  },
- },
- {
-  {
-   {
-    0x57, 0xAB, 0x66, 0x52, 0x12, 0x44, 0x45, 0x43, 0x33, 0x45, 0x77, 0xA6,
-    0x77, 0xA7, 0xA7, 0x65, 0x77, 0xBB, 0xB7, 0xBB, 0x7B, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0x5B, 0xBB, 0x5B, 0xBB, 0x21, 0x22, 0x45, 0x62, 0x26, 0x56, 0xBB,
-    0xBB, 0xBA, 0xAA, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0x3A, 0x99, 0x93, 0x19, 0x99, 0x99, 0x99, 0x99, 0x24, 0x19, 0x33,
-    0x99, 0x93, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x77, 0x67, 0x66, 0x67, 0x76, 0x66, 0x66, 0x67, 0x77, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x10, 0x77, 0x76, 0x77, 0x77, 0x77, 0x70, 0x00, 0x00,
-   },
-   {
-    0x77, 0x67, 0x66, 0x67, 0x76, 0x66, 0x66, 0x67, 0x77, 0x66, 0x66, 0x66,
-    0x61, 0x66, 0x66, 0x67, 0x07, 0x76, 0x77, 0x77, 0x77, 0x70, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xDD, 0xD6, 0xCD, 0xDD, 0xD9, 0x88, 0xC9, 0x64, 0x76, 0x34, 0x42,
-    0x12, 0x54, 0x53, 0x34, 0x54, 0x56, 0x66, 0x79, 0xDD, 0xD0, 0x00, 0x00,
-   },
-   {
-    0x88, 0x78, 0x77, 0x78, 0x77, 0x77, 0x77, 0x78, 0x87, 0x07, 0x77, 0x77,
-    0x21, 0x77, 0x77, 0x78, 0x88, 0x87, 0x87, 0x88, 0x88, 0x80, 0x00, 0x00,
-   },
-   {
-    0xAA, 0x9A, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x9A, 0x99, 0x01, 0x99, 0x99,
-    0x43, 0x99, 0x34, 0x99, 0x94, 0x99, 0x99, 0x99, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x99, 0x89, 0x88, 0x89, 0x88, 0x88, 0x88, 0x89, 0x88, 0x82, 0x88, 0x21,
-    0x82, 0x82, 0x83, 0x88, 0x82, 0x88, 0x88, 0x88, 0x99, 0x90, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xDD, 0xDD, 0xCD, 0xDD, 0xDD, 0xCC, 0xCD, 0xDD, 0xDD, 0xD6, 0x74,
-    0x56, 0x64, 0x20, 0x54, 0x42, 0x38, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00,
-   },
-   {
-    0x79, 0x87, 0x96, 0x76, 0x76, 0x55, 0x66, 0x44, 0x55, 0x44, 0x55, 0x32,
-    0x24, 0x88, 0x62, 0x55, 0x45, 0x43, 0x47, 0x66, 0x76, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x57, 0x66, 0x65, 0x54, 0x43, 0x34, 0x33, 0x33, 0x33, 0x33, 0x44, 0x45,
-    0x55, 0x66, 0x77, 0x77, 0x77, 0x77, 0x98, 0x88, 0x79, 0x60, 0x00, 0x00,
-   },
-   {
-    0x88, 0x98, 0x8D, 0x65, 0x66, 0x32, 0x33, 0x22, 0x23, 0x33, 0x45, 0x67,
-    0x78, 0x68, 0x8D, 0xCD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00,
-   },
-   {
-    0x8D, 0xCD, 0xDC, 0xC5, 0x56, 0x46, 0x45, 0x54, 0x22, 0x22, 0x22, 0x45,
-    0x57, 0x6C, 0xCC, 0xCD, 0xDD, 0xDD, 0xDD, 0xDC, 0xCC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xCC, 0xCC, 0xCB, 0xBC, 0xCC, 0xC7, 0xB5, 0x54, 0x12, 0x33, 0x22, 0x25,
-    0x56, 0xB6, 0x7B, 0xB7, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xAB, 0xBA, 0xAB, 0xBB, 0xA5, 0xA5, 0x55, 0x21, 0x2B, 0x33, 0x23,
-    0x44, 0x55, 0xA6, 0x5B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xAC, 0xAB, 0xC6, 0x66, 0x87, 0x87, 0x77, 0x98, 0x66, 0x54, 0x43, 0x43,
-    0x33, 0x32, 0x33, 0x33, 0x44, 0x45, 0x66, 0x68, 0x79, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xBB, 0xBB, 0xAB, 0xBB, 0xBB, 0xBA, 0x4B, 0x43, 0x22, 0x22, 0x32,
-    0x44, 0x34, 0xA5, 0xA6, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xAB, 0xAA, 0xAB, 0xBA, 0xAA, 0xA6, 0x65, 0x54, 0x43, 0x21, 0x23,
-    0x34, 0x34, 0x55, 0x56, 0x6B, 0xBB, 0xB6, 0xBA, 0xBA, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xCD, 0xDC, 0xCD, 0xDD, 0xCC, 0xCC, 0xC6, 0x66, 0x44, 0x43, 0x32,
-    0x21, 0x25, 0x65, 0x46, 0x54, 0x8D, 0xDD, 0xDC, 0xD7, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xEF, 0xEE, 0xEF, 0xEE, 0xEE, 0xEE, 0x9A, 0xF7, 0x66, 0x55, 0x43,
-    0x33, 0x22, 0x22, 0x33, 0x34, 0x78, 0x98, 0xEE, 0xFE, 0x90, 0x00, 0x00,
-   },
-   {
-    0x57, 0x67, 0x66, 0x76, 0x65, 0x55, 0x44, 0x54, 0x44, 0x43, 0x43, 0x34,
-    0x43, 0x44, 0x44, 0x44, 0x45, 0x45, 0x55, 0x67, 0x77, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x78, 0x88, 0x76, 0x66, 0x55, 0x54, 0x44, 0x33, 0x22, 0x23, 0x33, 0x44,
-    0x55, 0x67, 0x67, 0x78, 0x98, 0x98, 0x99, 0x9A, 0xA9, 0x90, 0x00, 0x00,
-   },
-   {
-    0x99, 0xAA, 0xAB, 0x97, 0x65, 0x55, 0x44, 0x32, 0x22, 0x22, 0x33, 0x45,
-    0x67, 0x89, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFC, 0xBB, 0xA8, 0x88, 0x77, 0x76, 0x54, 0x32, 0x11, 0x23, 0x46,
-    0x77, 0x8A, 0xF8, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xED, 0xDE, 0xE9, 0xDD, 0x77, 0x65, 0x43, 0x21, 0x12, 0x34,
-    0x57, 0x7D, 0x78, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xE7, 0x7D, 0x96, 0x54, 0x22, 0x11, 0x24,
-    0x56, 0x87, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xCB, 0xAA, 0x97, 0x65, 0x44, 0x45, 0x77, 0x76, 0x66, 0x55, 0x44, 0x33,
-    0x33, 0x33, 0x33, 0x33, 0x44, 0x55, 0x68, 0x99, 0x9A, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xDD, 0xDD, 0x7D, 0xDD, 0xDC, 0xCC, 0x66, 0x66, 0x43, 0x11, 0x22,
-    0x34, 0x56, 0x8C, 0xCD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xEF, 0xFE, 0xEF, 0xFF, 0xEE, 0xE9, 0x88, 0x76, 0x54, 0x31, 0x11,
-    0x34, 0x57, 0x77, 0x8F, 0xAF, 0xFF, 0xFF, 0xFE, 0xFE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFE, 0xEE, 0xEE, 0xEA, 0xAE, 0xEE, 0xA9, 0xE9, 0x87, 0x65, 0x43, 0x11,
-    0x22, 0x35, 0x56, 0x66, 0x88, 0x9A, 0xEE, 0xEA, 0xEE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xEA, 0xFF, 0xFB, 0xEA, 0x98, 0x76, 0x55, 0x43, 0x22,
-    0x22, 0x33, 0x33, 0x44, 0x46, 0x78, 0xAA, 0xFF, 0xFB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0x79, 0x99, 0x77, 0x77, 0x66, 0x55, 0x54, 0x44, 0x43, 0x43, 0x33, 0x33,
-    0x33, 0x34, 0x44, 0x55, 0x55, 0x66, 0x66, 0x79, 0x99, 0x80, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x68, 0x87, 0x77, 0x66, 0x55, 0x55, 0x54, 0x43, 0x32, 0x22, 0x33, 0x34,
-    0x45, 0x66, 0x77, 0x78, 0x88, 0x89, 0x98, 0x88, 0x88, 0x60, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xAB, 0xAB, 0xA9, 0x88, 0x66, 0x65, 0x43, 0x22, 0x21, 0x23, 0x46,
-    0x78, 0xA9, 0xBF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFD, 0xFF, 0xFF, 0xBC, 0x99, 0x98, 0x76, 0x65, 0x42, 0x21, 0x12, 0x46,
-    0x67, 0x99, 0xFF, 0xEF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xBE, 0xFA, 0xB9, 0x87, 0x65, 0x31, 0x02, 0x56,
-    0x79, 0x9A, 0xAF, 0xEA, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0x9B, 0xAE, 0xBE, 0x9B, 0xBB, 0xAB, 0xAA, 0x98, 0x76, 0x52, 0x01, 0x35,
-    0x88, 0x99, 0x9A, 0xAC, 0xBA, 0xBB, 0xEA, 0xBA, 0xEA, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xCC, 0xBC, 0xA7, 0x65, 0x21, 0x46, 0x88, 0x87, 0x77, 0x65, 0x44, 0x44,
-    0x43, 0x33, 0x44, 0x45, 0x55, 0x56, 0x78, 0x9A, 0x9B, 0xC0, 0x00, 0x00,
-   },
-   {
-    0x9E, 0x9E, 0xA9, 0xAB, 0xAA, 0xA9, 0x9D, 0x99, 0x87, 0x65, 0x10, 0x23,
-    0x68, 0x88, 0x98, 0x9A, 0xA9, 0xAA, 0xDA, 0xAD, 0xAA, 0x90, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFC, 0xBB, 0xA9, 0xA7, 0x65, 0x30, 0x12,
-    0x56, 0x78, 0x9A, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBA, 0x98, 0x76, 0x41, 0x11,
-    0x24, 0x47, 0x77, 0x89, 0xBB, 0xED, 0xCF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xCF, 0xFF, 0xEF, 0xCF, 0xCE, 0x9B, 0xA9, 0x87, 0x65, 0x42, 0x11,
-    0x23, 0x44, 0x55, 0x66, 0x67, 0x9A, 0xAB, 0xCF, 0xCC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0x68, 0x78, 0x77, 0x76, 0x66, 0x55, 0x55, 0x54, 0x44, 0x33, 0x33, 0x32,
-    0x33, 0x34, 0x55, 0x55, 0x66, 0x66, 0x77, 0x77, 0x88, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x68, 0x77, 0x76, 0x66, 0x55, 0x55, 0x54, 0x44, 0x32, 0x22, 0x33, 0x34,
-    0x55, 0x56, 0x66, 0x66, 0x67, 0x78, 0x88, 0x99, 0x99, 0x50, 0x00, 0x00,
-   },
-   {
-    0xCB, 0xCA, 0xAA, 0xA9, 0x97, 0x77, 0x66, 0x54, 0x32, 0x21, 0x13, 0x46,
-    0x79, 0xAA, 0xAB, 0xBF, 0xCD, 0xFD, 0xCF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFC, 0xFF, 0xBB, 0xA9, 0xA8, 0x87, 0x65, 0x31, 0x02, 0x56,
-    0x89, 0xAB, 0xBB, 0xBB, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFB, 0xFF, 0xCD, 0xCF, 0x99, 0x87, 0x65, 0x42, 0x01, 0x45,
-    0x67, 0x9A, 0xBB, 0xAF, 0xBD, 0xBF, 0xFC, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xF9, 0xA8, 0x86, 0x42, 0x01, 0x36,
-    0x78, 0x8A, 0xBF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xCF, 0xDB, 0xBA, 0x85, 0x10, 0x47, 0x89, 0x99, 0x99, 0x87, 0x66, 0x65,
-    0x55, 0x55, 0x55, 0x56, 0x66, 0x77, 0x89, 0xAC, 0xCE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xBF, 0xBB, 0xFF, 0x98, 0x63, 0x10, 0x24,
-    0x59, 0x99, 0xBF, 0xFB, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xBB, 0xAF, 0x97, 0x65, 0x20, 0x13,
-    0x56, 0x78, 0x99, 0xAB, 0xFD, 0xAF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBB, 0xAA, 0x97, 0x65, 0x30, 0x13,
-    0x44, 0x56, 0x88, 0x89, 0xA9, 0xBF, 0xFF, 0xCF, 0xFC, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFD, 0xFF, 0xFA, 0xBA, 0xBA, 0xB9, 0x87, 0x65, 0x32, 0x11,
-    0x23, 0x45, 0x56, 0x67, 0x77, 0x9A, 0xBA, 0xBF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0x57, 0x78, 0x77, 0x66, 0x66, 0x55, 0x55, 0x44, 0x44, 0x43, 0x33, 0x23,
-    0x33, 0x44, 0x45, 0x55, 0x56, 0x66, 0x66, 0x77, 0x78, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x68, 0x87, 0x87, 0x77, 0x66, 0x55, 0x54, 0x44, 0x32, 0x22, 0x23, 0x44,
-    0x45, 0x56, 0x66, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x50, 0x00, 0x00,
-   },
-   {
-    0x9A, 0xB9, 0xA9, 0xA8, 0x87, 0x76, 0x65, 0x54, 0x43, 0x21, 0x12, 0x45,
-    0x68, 0x88, 0xAA, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFC, 0xCF, 0xBA, 0x98, 0x77, 0x65, 0x31, 0x02, 0x56,
-    0x89, 0xAC, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0x87, 0x76, 0x42, 0x01, 0x36,
-    0x89, 0xAA, 0xBD, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xBF, 0xFF, 0xEF, 0xBF, 0xAC, 0x99, 0x87, 0x42, 0x01, 0x35,
-    0x79, 0xAA, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xCD, 0xCC, 0xB9, 0x74, 0x10, 0x46, 0x8A, 0xA9, 0x99, 0x98, 0x77, 0x66,
-    0x66, 0x55, 0x55, 0x55, 0x66, 0x67, 0x89, 0x9A, 0xAB, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xDA, 0xA8, 0x53, 0x10, 0x24,
-    0x68, 0x9A, 0xAE, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFB, 0x98, 0x74, 0x10, 0x23,
-    0x57, 0x89, 0xAB, 0xBC, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xBA, 0x98, 0x65, 0x20, 0x13,
-    0x56, 0x78, 0x89, 0x9A, 0xAC, 0xEF, 0xFB, 0xFF, 0xDF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x99, 0x86, 0x54, 0x21, 0x12,
-    0x34, 0x45, 0x56, 0x67, 0x67, 0x99, 0xAB, 0xEB, 0xFF, 0xB0, 0x00, 0x00,
-   },
-   {
-    0x57, 0x87, 0x77, 0x77, 0x66, 0x66, 0x65, 0x55, 0x44, 0x43, 0x32, 0x22,
-    0x33, 0x44, 0x55, 0x56, 0x67, 0x77, 0x77, 0x88, 0x99, 0x70, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x78, 0x88, 0x88, 0x77, 0x76, 0x65, 0x54, 0x44, 0x33, 0x32, 0x12, 0x34,
-    0x46, 0x78, 0x99, 0x9A, 0xBA, 0xAC, 0xAB, 0xCB, 0xAA, 0x90, 0x00, 0x00,
-   },
-   {
-    0x9A, 0x98, 0x88, 0x98, 0x87, 0x77, 0x65, 0x54, 0x43, 0x21, 0x12, 0x45,
-    0x67, 0x8B, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xBD, 0xA9, 0x99, 0x87, 0x77, 0x55, 0x41, 0x02, 0x46,
-    0x79, 0xAB, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFE, 0xFF, 0xFF, 0xDB, 0x9A, 0xBA, 0x98, 0x76, 0x42, 0x01, 0x36,
-    0x79, 0xBB, 0xCB, 0xFC, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFA, 0x9A, 0xAA, 0x87, 0x42, 0x01, 0x35,
-    0x78, 0xDA, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xBC, 0xCC, 0xA9, 0x74, 0x10, 0x36, 0x8A, 0xAA, 0xA9, 0x99, 0x88, 0x77,
-    0x76, 0x66, 0x65, 0x66, 0x55, 0x66, 0x78, 0x88, 0xAB, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xAA, 0x97, 0x63, 0x10, 0x24,
-    0x67, 0x88, 0x9B, 0xFD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFC, 0xBB, 0x97, 0x64, 0x10, 0x23,
-    0x67, 0x88, 0xAA, 0xAB, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xBD, 0xA7, 0x64, 0x20, 0x14,
-    0x55, 0x77, 0x78, 0x8A, 0xAA, 0xAB, 0xFD, 0xCC, 0xBF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEA, 0x76, 0x54, 0x21, 0x12,
-    0x34, 0x45, 0x56, 0x67, 0x77, 0x8A, 0xAA, 0x99, 0xBA, 0x90, 0x00, 0x00,
-   },
-   {
-    0x68, 0x88, 0x77, 0x66, 0x66, 0x55, 0x55, 0x55, 0x54, 0x43, 0x22, 0x23,
-    0x34, 0x44, 0x44, 0x56, 0x77, 0x77, 0x78, 0x99, 0x99, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x45, 0x56, 0x66, 0x65, 0x55, 0x54, 0x44, 0x44, 0x44, 0x42, 0x12, 0x35,
-    0x68, 0x8E, 0x9A, 0xBC, 0xEB, 0xBB, 0xEB, 0xBB, 0xBE, 0xB0, 0x00, 0x00,
-   },
-   {
-    0x87, 0x77, 0x76, 0x76, 0x66, 0x66, 0x55, 0x54, 0x43, 0x31, 0x12, 0x45,
-    0x56, 0xA9, 0xEE, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xAF, 0x98, 0x97, 0x78, 0x75, 0x55, 0x44, 0x32, 0x02, 0x45,
-    0x68, 0x8E, 0x9C, 0xEF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBA, 0x98, 0x77, 0x65, 0x42, 0x01, 0x45,
-    0x69, 0x9C, 0x9B, 0xDF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xCA, 0xAA, 0xA8, 0x76, 0x52, 0x01, 0x35,
-    0x67, 0x8A, 0xEA, 0xBF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xA9, 0xAB, 0x98, 0x74, 0x10, 0x36, 0x89, 0x99, 0x99, 0x88, 0x87, 0x87,
-    0x76, 0x66, 0x66, 0x55, 0x56, 0x67, 0x79, 0x9B, 0x9B, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB8, 0x88, 0x87, 0x54, 0x10, 0x24,
-    0x56, 0x77, 0x89, 0xBF, 0xFF, 0xEC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xDC, 0xFF, 0xFB, 0xDB, 0xB9, 0x86, 0x53, 0x20, 0x23,
-    0x44, 0x56, 0x88, 0x78, 0xAA, 0xFF, 0xAB, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xBF, 0xFA, 0x97, 0x64, 0x20, 0x23,
-    0x44, 0x55, 0x56, 0x67, 0x77, 0x89, 0x9B, 0xB9, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xD9, 0x75, 0x43, 0x21, 0x23,
-    0x34, 0x44, 0x44, 0x55, 0x55, 0x66, 0x66, 0x78, 0x8A, 0x80, 0x00, 0x00,
-   },
-   {
-    0x79, 0x89, 0x98, 0x88, 0x77, 0x77, 0x54, 0x44, 0x44, 0x43, 0x22, 0x33,
-    0x33, 0x44, 0x45, 0x45, 0x66, 0x68, 0x77, 0x98, 0x88, 0x60, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x25, 0x45, 0x57, 0x45, 0x45, 0x55, 0x43, 0x33, 0x33, 0x33, 0x34, 0x44,
-    0x55, 0xBB, 0xBB, 0x6B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0x86, 0x76, 0x75, 0x55, 0x55, 0x65, 0x74, 0x44, 0x33, 0x32, 0x12, 0x35,
-    0x6C, 0xCC, 0xCC, 0xCD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xDD, 0x8E, 0x76, 0x55, 0x43, 0x44, 0x32, 0x32, 0x12, 0x46,
-    0x87, 0x99, 0x9D, 0xDE, 0xEE, 0xEE, 0xDD, 0xDD, 0xDD, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xA9, 0x96, 0x55, 0x43, 0x32, 0x02, 0x45,
-    0x88, 0xEE, 0xE9, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xAF, 0x89, 0x66, 0x42, 0x01, 0x36,
-    0xD9, 0x8A, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xEA, 0xF9, 0x74, 0x10, 0x35, 0x79, 0x98, 0x87, 0x66, 0x66, 0x55,
-    0x56, 0x67, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xFC, 0xEE, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xE9, 0x97, 0xF7, 0x65, 0x20, 0x13,
-    0x56, 0x79, 0xEA, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xEE, 0xED, 0xDE, 0xEE, 0xED, 0xDD, 0xDE, 0x75, 0x63, 0x11, 0x22,
-    0x34, 0x45, 0x67, 0x78, 0x9E, 0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xDD, 0xDE, 0xED, 0xD8, 0xDD, 0xDE, 0x87, 0x54, 0x20, 0x23,
-    0x46, 0x46, 0x56, 0x67, 0x76, 0x79, 0x8E, 0xED, 0xED, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xDD, 0xDE, 0xDD, 0xDD, 0xDD, 0xD9, 0x98, 0x54, 0x32, 0x23,
-    0x45, 0x44, 0x34, 0x43, 0x23, 0x66, 0x36, 0xD8, 0xDD, 0x90, 0x00, 0x00,
-   },
-   {
-    0x7B, 0x7B, 0xA7, 0x77, 0x6A, 0x57, 0x56, 0x55, 0x45, 0x43, 0x33, 0x33,
-    0x33, 0x33, 0x44, 0x43, 0x35, 0xBB, 0xBA, 0xAA, 0xB7, 0x50, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x24, 0xA3, 0x44, 0x44, 0xAA, 0x49, 0x34, 0x43, 0x24, 0x42, 0x35, 0xA9,
-    0x99, 0x49, 0x99, 0x9A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x99, 0x39, 0x94, 0x94, 0x39, 0x43, 0x92, 0x33, 0x29, 0x22, 0x39, 0x99,
-    0x99, 0x99, 0x88, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x90, 0x00, 0x00,
-   },
-   {
-    0x99, 0x99, 0x99, 0x99, 0x49, 0x49, 0x33, 0x34, 0x33, 0x21, 0x23, 0x99,
-    0x99, 0x99, 0x98, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x90, 0x00, 0x00,
-   },
-   {
-    0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC6, 0x32, 0x21, 0x12, 0x45,
-    0xC7, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD7, 0xDD, 0x75, 0x42, 0x01, 0x38,
-    0xDD, 0x7D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xCC, 0x8C, 0x87, 0x64, 0x10, 0x37, 0x86, 0x66, 0x67, 0x69, 0x78, 0x77,
-    0x76, 0x66, 0x66, 0x67, 0x68, 0x77, 0x88, 0xCC, 0xCC, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xAB, 0xAA, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA4, 0x20, 0x22,
-    0x44, 0xA5, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBA, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x4B, 0x33, 0x03,
-    0x23, 0x46, 0x4B, 0x5B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xBB, 0xBB, 0xAB, 0xBB, 0xBB, 0xAA, 0xAB, 0xBB, 0xBB, 0xB2, 0x43,
-    0x44, 0x32, 0x13, 0x46, 0x34, 0x35, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA9, 0x9A, 0xAA, 0xAA, 0xA4, 0x23,
-    0x32, 0xA5, 0x32, 0xA2, 0x24, 0xA3, 0xAA, 0x4A, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xA9, 0x59, 0x99, 0x99, 0x99, 0x54, 0x49, 0x45, 0x55, 0x45, 0x43, 0x39,
-    0x52, 0x33, 0x43, 0x44, 0x25, 0x59, 0x59, 0x99, 0x59, 0xA0, 0x00, 0x00,
-   },
-  },
- },
- {
-  {
-   {
-    0x58, 0x76, 0x5B, 0x53, 0x21, 0x25, 0x54, 0x43, 0x33, 0x48, 0x88, 0x56,
-    0x67, 0x6B, 0x87, 0xBC, 0x7C, 0x8C, 0xCC, 0xCC, 0x8C, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xCC, 0xCC, 0x6C, 0x4C, 0xCC, 0x12, 0x12, 0x45, 0x53, 0x35, 0x7C, 0xCC,
-    0xCC, 0xCC, 0xBB, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xAA, 0xA4, 0xA1, 0x44, 0x55, 0xA9, 0x9A, 0xAA, 0xA2, 0x22, 0x24,
-    0xA5, 0xA4, 0x49, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x99, 0x88, 0x33, 0x88, 0x88, 0x88, 0x88, 0x28, 0x88, 0x88, 0x88, 0x21,
-    0x33, 0x88, 0x83, 0x82, 0x88, 0x88, 0x88, 0x88, 0x89, 0x90, 0x00, 0x00,
-   },
-   {
-    0x66, 0x56, 0x55, 0x56, 0x65, 0x55, 0x55, 0x56, 0x06, 0x65, 0x55, 0x55,
-    0x55, 0x55, 0x55, 0x56, 0x66, 0x66, 0x66, 0x66, 0x66, 0x60, 0x00, 0x00,
-   },
-   {
-    0xEE, 0x9D, 0xA6, 0x9D, 0xDA, 0xD9, 0x97, 0x55, 0x42, 0x64, 0x43, 0x32,
-    0x24, 0x44, 0x33, 0x44, 0x66, 0x55, 0x58, 0x7D, 0xDD, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x88, 0x78, 0x77, 0x78, 0x77, 0x77, 0x77, 0x78, 0x82, 0x07, 0x77, 0x77,
-    0x72, 0x27, 0x77, 0x78, 0x87, 0x77, 0x87, 0x88, 0x88, 0x80, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x44, 0x01, 0x3A, 0xAA,
-    0x4A, 0x4A, 0x45, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xB0, 0x00, 0x00,
-   },
-   {
-    0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x89, 0x99, 0x92, 0x39, 0x21,
-    0x49, 0x43, 0x33, 0x99, 0x34, 0x39, 0x99, 0x99, 0x99, 0x90, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xEE, 0xED, 0xDE, 0xEE, 0xED, 0xDD, 0xDE, 0xEE, 0xEE, 0x97, 0x75,
-    0x55, 0x75, 0x20, 0x34, 0x63, 0x26, 0x8E, 0xEE, 0xEE, 0xE0, 0x00, 0x00,
-   },
-   {
-    0x69, 0xB8, 0x77, 0x8B, 0x85, 0x56, 0x55, 0x44, 0x65, 0x44, 0x33, 0x32,
-    0x23, 0x67, 0xA4, 0x74, 0x45, 0x44, 0x45, 0x68, 0x86, 0x70, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x67, 0x76, 0x66, 0x54, 0x43, 0x43, 0x33, 0x33, 0x33, 0x33, 0x44, 0x44,
-    0x55, 0x66, 0x67, 0x67, 0x77, 0x77, 0x89, 0x89, 0x99, 0x60, 0x00, 0x00,
-   },
-   {
-    0xA9, 0x99, 0x99, 0x66, 0x66, 0x43, 0x33, 0x22, 0x22, 0x33, 0x34, 0x57,
-    0x78, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFE, 0xE9, 0xE9, 0x87, 0x65, 0x55, 0x44, 0x44, 0x32, 0x22, 0x22, 0x34,
-    0x56, 0x79, 0x8E, 0xEA, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xDD, 0xD8, 0xDD, 0x75, 0x54, 0x54, 0x33, 0x44, 0x31, 0x13,
-    0x45, 0x66, 0x88, 0x89, 0x8E, 0xDD, 0xDD, 0xDD, 0xED, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xCC, 0xBC, 0xBB, 0xBC, 0xCB, 0x75, 0x65, 0x45, 0x32, 0x24, 0x43, 0x12,
-    0x46, 0x54, 0x77, 0xBC, 0xCC, 0xCC, 0xCB, 0xCB, 0xCB, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xA9, 0x8B, 0x97, 0x56, 0x88, 0x76, 0x77, 0x66, 0x55, 0x44, 0x33, 0x33,
-    0x33, 0x33, 0x33, 0x33, 0x45, 0x56, 0x67, 0x8A, 0xCA, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xCD, 0xCC, 0xCD, 0xDC, 0xCC, 0x68, 0x55, 0x53, 0x21, 0x23, 0x33,
-    0x33, 0x45, 0x77, 0x67, 0xDD, 0xDD, 0xDD, 0xDC, 0xDC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xDD, 0xDE, 0xE9, 0x8D, 0xD8, 0x67, 0x44, 0x32, 0x22, 0x22,
-    0x33, 0x44, 0x46, 0x87, 0xEE, 0xEE, 0xEE, 0xDD, 0xDD, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xEF, 0xEE, 0xEF, 0xFE, 0xEE, 0xE9, 0x78, 0x67, 0x54, 0x43, 0x22,
-    0x12, 0x35, 0x53, 0x55, 0x56, 0x7A, 0xFE, 0xEE, 0xFE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0xFB, 0x87, 0x66, 0x54, 0x33,
-    0x33, 0x22, 0x22, 0x33, 0x46, 0x67, 0x7A, 0xCF, 0xCF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0x67, 0x77, 0x77, 0x66, 0x66, 0x55, 0x55, 0x44, 0x43, 0x44, 0x33, 0x34,
-    0x43, 0x44, 0x43, 0x44, 0x44, 0x55, 0x66, 0x76, 0x88, 0x70, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x78, 0x77, 0x76, 0x66, 0x55, 0x44, 0x44, 0x33, 0x33, 0x22, 0x33, 0x34,
-    0x45, 0x67, 0x78, 0x88, 0x88, 0x99, 0x89, 0xA9, 0xA9, 0x70, 0x00, 0x00,
-   },
-   {
-    0xA9, 0x9B, 0x99, 0x87, 0x77, 0x54, 0x44, 0x33, 0x22, 0x22, 0x23, 0x45,
-    0x67, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFD, 0xAA, 0x98, 0x87, 0x77, 0x65, 0x32, 0x11, 0x23, 0x44,
-    0x57, 0x9A, 0xCE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x88, 0x77, 0x65, 0x54, 0x31, 0x11, 0x35,
-    0x57, 0x88, 0x8F, 0xDF, 0xFC, 0x9F, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xEF, 0xEE, 0xEF, 0xFE, 0x99, 0x87, 0x77, 0x54, 0x22, 0x11, 0x24,
-    0x66, 0x77, 0x78, 0xEA, 0xF9, 0xFF, 0xEE, 0xEE, 0xFE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xAB, 0xAA, 0x97, 0x65, 0x44, 0x45, 0x66, 0x65, 0x54, 0x44, 0x43, 0x33,
-    0x33, 0x33, 0x33, 0x44, 0x55, 0x66, 0x78, 0x8B, 0xAB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xED, 0xDE, 0x98, 0x8D, 0xDD, 0x67, 0x66, 0x43, 0x11, 0x22,
-    0x34, 0x57, 0x77, 0x8E, 0xEE, 0xEE, 0xEE, 0xED, 0xDD, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFB, 0xFF, 0xBB, 0x98, 0x66, 0x54, 0x31, 0x11,
-    0x34, 0x56, 0x98, 0xBF, 0xDC, 0xBF, 0xBF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xAA, 0x88, 0x66, 0x32, 0x11,
-    0x23, 0x35, 0x66, 0x77, 0x99, 0xCE, 0xFE, 0xCD, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCA, 0xA9, 0x76, 0x54, 0x42, 0x22,
-    0x22, 0x33, 0x34, 0x55, 0x56, 0x77, 0x9B, 0xBF, 0xFF, 0xC0, 0x00, 0x00,
-   },
-   {
-    0x69, 0x88, 0x77, 0x77, 0x76, 0x65, 0x55, 0x44, 0x43, 0x43, 0x33, 0x33,
-    0x33, 0x34, 0x44, 0x44, 0x55, 0x67, 0x77, 0x88, 0x89, 0x70, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x79, 0x98, 0x87, 0x77, 0x66, 0x55, 0x44, 0x43, 0x33, 0x22, 0x23, 0x33,
-    0x45, 0x66, 0x77, 0x88, 0x89, 0x99, 0x9A, 0xA9, 0x99, 0x70, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xFB, 0xBA, 0xA9, 0x98, 0x76, 0x65, 0x44, 0x32, 0x21, 0x22, 0x35,
-    0x79, 0xAE, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xCF, 0xFA, 0xAA, 0x99, 0x88, 0x77, 0x65, 0x33, 0x21, 0x12, 0x44,
-    0x57, 0x89, 0xAB, 0xBE, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xBF, 0xDB, 0xA9, 0x99, 0x86, 0x65, 0x41, 0x02, 0x45,
-    0x78, 0x89, 0xCA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAB, 0xA9, 0x98, 0x76, 0x52, 0x01, 0x35,
-    0x68, 0x89, 0x9E, 0xEF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xDB, 0xCA, 0x98, 0x75, 0x21, 0x46, 0x77, 0x76, 0x66, 0x54, 0x44, 0x44,
-    0x33, 0x34, 0x44, 0x45, 0x66, 0x77, 0x89, 0xAC, 0xCB, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x98, 0x77, 0x65, 0x10, 0x23,
-    0x56, 0x89, 0xAA, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xCA, 0x87, 0x65, 0x30, 0x12,
-    0x56, 0x78, 0xA9, 0xBA, 0xFD, 0xCF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, 0xAA, 0xA9, 0x97, 0x64, 0x31, 0x12,
-    0x23, 0x45, 0x56, 0x78, 0xA9, 0xAC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xCB, 0xA8, 0x65, 0x54, 0x32, 0x12,
-    0x23, 0x34, 0x45, 0x56, 0x77, 0x88, 0xAC, 0xDF, 0xDF, 0xE0, 0x00, 0x00,
-   },
-   {
-    0x68, 0x98, 0x88, 0x77, 0x77, 0x66, 0x55, 0x54, 0x44, 0x43, 0x32, 0x22,
-    0x33, 0x44, 0x55, 0x56, 0x66, 0x77, 0x78, 0x89, 0x99, 0x70, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x8A, 0xA9, 0x88, 0x87, 0x66, 0x65, 0x54, 0x43, 0x33, 0x22, 0x23, 0x33,
-    0x45, 0x55, 0x67, 0x78, 0x88, 0x88, 0x88, 0x99, 0x99, 0x60, 0x00, 0x00,
-   },
-   {
-    0xCF, 0xBF, 0xCA, 0xAA, 0x98, 0x87, 0x76, 0x54, 0x33, 0x21, 0x12, 0x45,
-    0x78, 0x8A, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xEF, 0xBE, 0xBA, 0x99, 0x77, 0x65, 0x31, 0x02, 0x56,
-    0x89, 0x9B, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0x97, 0x76, 0x32, 0x01, 0x46,
-    0x88, 0x9B, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFC, 0xA8, 0x97, 0x42, 0x01, 0x35,
-    0x78, 0x9A, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xDC, 0xCB, 0xB9, 0x75, 0x10, 0x47, 0x89, 0x89, 0x88, 0x76, 0x66, 0x55,
-    0x55, 0x55, 0x55, 0x66, 0x77, 0x78, 0x9A, 0xAC, 0xFE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xCA, 0xA9, 0x87, 0x63, 0x10, 0x24,
-    0x67, 0x8A, 0xCA, 0xFF, 0xFE, 0xCF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xAA, 0x98, 0x74, 0x20, 0x13,
-    0x57, 0x8A, 0x9E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xA9, 0x87, 0x65, 0x30, 0x13,
-    0x44, 0x56, 0x78, 0x9A, 0xBE, 0xEF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x98, 0x65, 0x54, 0x31, 0x12,
-    0x33, 0x44, 0x55, 0x67, 0x78, 0x9A, 0xAC, 0xFC, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0x68, 0x88, 0x87, 0x77, 0x77, 0x76, 0x55, 0x54, 0x44, 0x43, 0x32, 0x22,
-    0x33, 0x44, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9A, 0xBB, 0x90, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x8A, 0x99, 0x88, 0x77, 0x76, 0x66, 0x55, 0x43, 0x33, 0x22, 0x22, 0x33,
-    0x45, 0x67, 0x77, 0x88, 0x88, 0x99, 0xAA, 0x9A, 0xAA, 0x80, 0x00, 0x00,
-   },
-   {
-    0xBC, 0xAA, 0xAB, 0xA9, 0x98, 0x87, 0x66, 0x54, 0x33, 0x21, 0x12, 0x45,
-    0x89, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xEF, 0xFC, 0xCC, 0xBA, 0x98, 0x87, 0x65, 0x31, 0x02, 0x56,
-    0x79, 0xBB, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFD, 0xBA, 0x98, 0x76, 0x42, 0x01, 0x36,
-    0x78, 0x9A, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xBB, 0xA9, 0x87, 0x42, 0x01, 0x35,
-    0x78, 0xAB, 0xFB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xEC, 0xC9, 0x74, 0x10, 0x47, 0x89, 0x99, 0x99, 0x87, 0x76, 0x66,
-    0x55, 0x55, 0x55, 0x56, 0x67, 0x78, 0x89, 0xBC, 0xCD, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDA, 0x98, 0x63, 0x10, 0x24,
-    0x58, 0x9A, 0xBF, 0xEF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDB, 0x97, 0x74, 0x10, 0x23,
-    0x57, 0x9A, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0xA8, 0x65, 0x20, 0x13,
-    0x56, 0x77, 0x89, 0x9B, 0xCE, 0xCF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x9A, 0xAA, 0x76, 0x54, 0x21, 0x12,
-    0x34, 0x45, 0x56, 0x66, 0x78, 0x99, 0xAF, 0xEC, 0xEF, 0xB0, 0x00, 0x00,
-   },
-   {
-    0x78, 0x88, 0x87, 0x77, 0x66, 0x66, 0x65, 0x55, 0x54, 0x43, 0x22, 0x22,
-    0x33, 0x44, 0x55, 0x67, 0x77, 0x88, 0x98, 0x99, 0xAA, 0x80, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x67, 0x77, 0x86, 0x66, 0x66, 0x65, 0x54, 0x44, 0x33, 0x32, 0x12, 0x34,
-    0x57, 0x99, 0xAC, 0x9A, 0xAC, 0xFB, 0xCF, 0xEE, 0xEB, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x66, 0x55, 0x43, 0x21, 0x12, 0x35,
-    0x8A, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFA, 0xDA, 0x99, 0x98, 0x77, 0x76, 0x65, 0x53, 0x32, 0x02, 0x45,
-    0x67, 0x9A, 0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xCF, 0xFB, 0xBB, 0xE9, 0x87, 0x76, 0x42, 0x01, 0x36,
-    0x89, 0xBB, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xA9, 0x76, 0x52, 0x01, 0x35,
-    0x67, 0x8A, 0x9A, 0xC9, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xEC, 0xCC, 0xA9, 0x74, 0x10, 0x37, 0x88, 0x89, 0x99, 0x88, 0x87, 0x76,
-    0x66, 0x55, 0x55, 0x56, 0x77, 0x78, 0xAA, 0xFE, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xBA, 0x87, 0x64, 0x10, 0x24,
-    0x46, 0x77, 0xAB, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCF, 0xFF, 0x88, 0x64, 0x10, 0x24,
-    0x46, 0x78, 0x88, 0xAA, 0xBF, 0xCC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDC, 0xA7, 0x65, 0x20, 0x14,
-    0x55, 0x57, 0x77, 0x88, 0x9A, 0xAA, 0xBB, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF9, 0x97, 0x76, 0x53, 0x21, 0x13,
-    0x34, 0x45, 0x55, 0x66, 0x66, 0x77, 0x88, 0xAA, 0xDC, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x9D, 0xAC, 0xBA, 0x98, 0x88, 0x77, 0x65, 0x54, 0x54, 0x43, 0x21, 0x23,
-    0x34, 0x45, 0x55, 0x66, 0x67, 0x79, 0x99, 0x9D, 0xBB, 0x80, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x47, 0x7C, 0x65, 0x45, 0x45, 0x45, 0x45, 0x33, 0x43, 0x22, 0x23, 0x44,
-    0x57, 0x77, 0xCC, 0xB8, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00,
-   },
-   {
-    0x89, 0x88, 0x67, 0x68, 0x67, 0x76, 0x55, 0x55, 0x43, 0x21, 0x12, 0x46,
-    0x8E, 0xEA, 0xEE, 0xEF, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0xDE, 0xD9, 0xD8, 0x87, 0x66, 0x64, 0x55, 0x44, 0x42, 0x02, 0x45,
-    0x67, 0x8D, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xED, 0xDD, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFA, 0xFF, 0xCF, 0xB7, 0x98, 0x66, 0x54, 0x42, 0x01, 0x57,
-    0x89, 0xFA, 0xFF, 0xEF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xAA, 0x88, 0x76, 0x42, 0x01, 0x36,
-    0x78, 0xFF, 0xFF, 0xEA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xBC, 0xAA, 0xB8, 0x75, 0x10, 0x35, 0x78, 0x88, 0x87, 0x66, 0x66, 0x55,
-    0x55, 0x66, 0x77, 0x77, 0x88, 0x99, 0x9A, 0xDB, 0xBB, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFD, 0x99, 0x87, 0x65, 0x10, 0x23,
-    0x56, 0x78, 0x9E, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xEF, 0xFE, 0xEF, 0xFF, 0xEE, 0xE9, 0xE8, 0x65, 0x54, 0x20, 0x23,
-    0x34, 0x67, 0x7A, 0x99, 0x9F, 0xF9, 0xFF, 0xFE, 0xFE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xEF, 0xEE, 0xEF, 0xFE, 0xEE, 0xE9, 0xEF, 0x87, 0x53, 0x20, 0x23,
-    0x55, 0x55, 0x56, 0x68, 0x98, 0x8A, 0x9F, 0xFE, 0xFE, 0xF0, 0x00, 0x00,
-   },
-   {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x8A, 0x77, 0x54, 0x31, 0x23,
-    0x44, 0x34, 0x44, 0x44, 0x43, 0x45, 0x57, 0xFA, 0xFB, 0xF0, 0x00, 0x00,
-   },
-   {
-    0x7C, 0xB7, 0x8B, 0x76, 0x76, 0x66, 0x55, 0x54, 0x44, 0x43, 0x33, 0x32,
-    0x33, 0x44, 0x54, 0x44, 0x44, 0x57, 0x98, 0x87, 0xCB, 0x50, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x46, 0xAB, 0x6A, 0x6B, 0x65, 0x54, 0x54, 0x32, 0x22, 0x32, 0x43, 0x44,
-    0xA4, 0x6A, 0xAA, 0xAB, 0xBB, 0xBB, 0xBB, 0xAA, 0xAA, 0xB0, 0x00, 0x00,
-   },
-   {
-    0x67, 0x66, 0x6B, 0x6C, 0x56, 0xB5, 0x55, 0x34, 0x32, 0x21, 0x23, 0x64,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCB, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xCC, 0xCC, 0xCC, 0xBC, 0x76, 0x57, 0x55, 0x54, 0x43, 0x21, 0x12, 0x46,
-    0x7C, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x77, 0x43, 0x22, 0x02, 0x57,
-    0x8D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xCD, 0xCC, 0xCD, 0xCC, 0xCC, 0xCC, 0xCC, 0x65, 0x42, 0x01, 0x3C,
-    0x7C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDC, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xEE, 0x8E, 0xD9, 0x75, 0x10, 0x35, 0x77, 0x66, 0x68, 0x77, 0x66, 0x65,
-    0x66, 0x65, 0x66, 0x68, 0x88, 0xEE, 0xAE, 0xED, 0xDD, 0xE0, 0x00, 0x00,
-   },
-   {
-    0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD8, 0xDD, 0x55, 0x20, 0x14,
-    0x56, 0x4D, 0x7D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00,
-   },
-   {
-    0xCC, 0xCC, 0xCC, 0xBC, 0xCC, 0xCC, 0xCB, 0xBC, 0xC7, 0x63, 0x20, 0x23,
-    0x44, 0x55, 0x76, 0x7C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xBB, 0xBB, 0xBA, 0xAB, 0xBB, 0xBA, 0xAA, 0xAB, 0xB5, 0xB6, 0x31, 0x22,
-    0x34, 0x43, 0x34, 0x54, 0x45, 0x4B, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00,
-   },
-   {
-    0xCC, 0xBC, 0xCB, 0xBC, 0xCB, 0xBB, 0xBB, 0xB7, 0x66, 0x55, 0x42, 0x22,
-    0x23, 0x34, 0x43, 0x35, 0x54, 0x55, 0x6C, 0xCB, 0xCB, 0xC0, 0x00, 0x00,
-   },
-   {
-    0xCB, 0xBB, 0x6B, 0xB7, 0xBB, 0x6B, 0x65, 0x55, 0x34, 0x33, 0x43, 0x32,
-    0x23, 0x34, 0x55, 0x44, 0x46, 0xBB, 0xBB, 0xB6, 0xBB, 0xC0, 0x00, 0x00,
-   },
-  },
-  {
-   {
-    0x88, 0x78, 0x71, 0x78, 0x77, 0x77, 0x77, 0x78, 0x27, 0x71, 0x77, 0x17,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x77, 0x88, 0x87, 0x88, 0x80, 0x00, 0x00,
-   },
-   {
-    0x99, 0x89, 0x88, 0x89, 0x88, 0x82, 0x88, 0x83, 0x83, 0x12, 0x22, 0x38,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x98, 0x90, 0x00, 0x00,
-   },
-   {
-    0x99, 0x89, 0x88, 0x89, 0x88, 0x88, 0x38, 0x89, 0x22, 0x11, 0x28, 0x88,
-    0x88, 0x88, 0x88, 0x89, 0x98, 0x88, 0x88, 0x98, 0x98, 0x90, 0x00, 0x00,
-   },
-   {
-    0xAA, 0x9A, 0x99, 0x9A, 0x39, 0x99, 0x99, 0x33, 0x99, 0x42, 0x02, 0x99,
-    0x99, 0x99, 0x99, 0x9A, 0xA9, 0x99, 0x99, 0x99, 0xA9, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0x9A, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x9A, 0xA9, 0x92, 0x01, 0x34,
-    0x99, 0x99, 0x99, 0x9A, 0xA9, 0x99, 0x9A, 0xA9, 0xA9, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0xAA, 0xAA, 0xAA, 0x30, 0x4A, 0xAA, 0x9A, 0xAA, 0xA4, 0x43, 0x43,
-    0x35, 0x4A, 0x3A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0xAA, 0x9A, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x9A, 0x99, 0x93, 0x11, 0x13,
-    0x34, 0x99, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x99, 0xA9, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x99, 0x89, 0x88, 0x89, 0x88, 0x88, 0x88, 0x89, 0x88, 0x88, 0x31, 0x12,
-    0x88, 0x18, 0x88, 0x89, 0x98, 0x88, 0x89, 0x99, 0x98, 0x90, 0x00, 0x00,
-   },
-   {
-    0x88, 0x78, 0x77, 0x78, 0x77, 0x77, 0x77, 0x78, 0x77, 0x77, 0x71, 0x11,
-    0x72, 0x77, 0x77, 0x78, 0x87, 0x77, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00,
-   },
-   {
-    0xAA, 0x9A, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x39, 0x92, 0x21,
-    0x19, 0x39, 0x99, 0x94, 0x93, 0x99, 0x99, 0x99, 0xAA, 0xA0, 0x00, 0x00,
-   },
-   {
-    0x88, 0x78, 0x77, 0x78, 0x77, 0x77, 0x77, 0x78, 0x77, 0x72, 0x77, 0x72,
-    0x17, 0x27, 0x77, 0x78, 0x87, 0x71, 0x78, 0x87, 0x88, 0x80, 0x00, 0x00,
-   },
-  },
- },
-};
-
-static const uint8_t short_codes_def[3][15][88] = {
- {
-  {
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDD, 0xFC, 0xCD, 0xFF, 0xFF, 0xFF, 0xCC, 0xCB, 0xBC,
-    0xDF, 0xFF, 0xFD, 0xDB, 0xC9, 0x69, 0xBC, 0xFF, 0xFC, 0xFF, 0xB9, 0x42,
-    0x5A, 0xCD, 0xFF, 0xFD, 0xDC, 0x62, 0x03, 0x9B, 0xCF, 0xFF, 0xFD, 0xC9,
-    0x53, 0x4A, 0xCC, 0xFF, 0xFF, 0xFF, 0xBA, 0x9A, 0xBC, 0xFF, 0xFF, 0xFC,
-    0xDC, 0xBC, 0xBC, 0xFF, 0xFF, 0xFF, 0xFE, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCD, 0xFF,
-    0xFF, 0xFF, 0xFC, 0xFC, 0xCC, 0xCF, 0xDF, 0xFF, 0xFF, 0xDB, 0xA9, 0x9B,
-    0xCF, 0xDF, 0xFF, 0xCB, 0x97, 0x67, 0x9B, 0xFF, 0xFF, 0xDC, 0xA7, 0x42,
-    0x47, 0xAD, 0xFF, 0xFF, 0xC9, 0x63, 0x03, 0x69, 0xBF, 0xFF, 0xFC, 0xA7,
-    0x53, 0x47, 0xAC, 0xDF, 0xFD, 0xDC, 0x97, 0x77, 0x8C, 0xBD, 0xFF, 0xFF,
-    0xCC, 0xAA, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xCC, 0xCC, 0xCF, 0xFF, 0xFF,
-    0xFF, 0xFE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xDC, 0xFF, 0xDF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0xAF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF, 0xA6, 0x43,
-    0x47, 0xEF, 0xFF, 0xFF, 0xF9, 0x53, 0x03, 0x6A, 0xFF, 0xFF, 0xFF, 0xA6,
-    0x43, 0x46, 0xAF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xC9, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xDD, 0xFF, 0xFF, 0xFD, 0xFF, 0xFD, 0xFD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDD, 0xDB, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFA, 0x43,
-    0x6B, 0xFF, 0xDF, 0xFF, 0xFD, 0xA3, 0x02, 0xAD, 0xFF, 0xFF, 0xFD, 0xFB,
-    0x52, 0x3A, 0xDF, 0xFF, 0xFF, 0xFF, 0xCB, 0xAA, 0xCE, 0xFF, 0xDF, 0xFF,
-    0xFE, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xCF, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xCC, 0xCA,
-    0xFF, 0xCF, 0xFB, 0xAA, 0xAA, 0xCF, 0xCB, 0xFC, 0xFF, 0xAA, 0xA9, 0x99,
-    0xAC, 0xBF, 0xFC, 0xA9, 0x98, 0x88, 0x99, 0xAA, 0xCF, 0xCA, 0xA8, 0x53,
-    0x58, 0x9F, 0xCC, 0xCC, 0xB9, 0x73, 0x02, 0x68, 0xAC, 0xCF, 0xCA, 0x98,
-    0x53, 0x37, 0x9B, 0xAC, 0xFB, 0xAA, 0x97, 0x78, 0x8A, 0xFB, 0xFF, 0xFA,
-    0xBB, 0x99, 0x9A, 0xAB, 0xFF, 0xFF, 0xEB, 0xBA, 0xAA, 0xAC, 0xCB, 0xFF,
-    0xBF, 0xBC, 0xBC, 0xCF, 0xFF, 0xFF, 0xCF, 0xFC, 0xFC, 0xFF, 0xFF, 0xCF,
-    0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFD, 0xFC, 0xFF,
-    0xFF, 0xFF, 0xFC, 0xAB, 0xBA, 0xFC, 0xFF, 0xFF, 0xFF, 0xA9, 0x77, 0x78,
-    0xAF, 0xFF, 0xFF, 0xA8, 0x65, 0x45, 0x68, 0xFF, 0xFC, 0xFB, 0x74, 0x33,
-    0x35, 0x7B, 0xFF, 0xFF, 0xB7, 0x43, 0x23, 0x46, 0xAF, 0xFF, 0xCB, 0x75,
-    0x33, 0x35, 0x7A, 0xCC, 0xFF, 0xF8, 0x65, 0x45, 0x68, 0xAC, 0xCF, 0xCC,
-    0xA8, 0x77, 0x78, 0xBF, 0xFF, 0xFF, 0xFF, 0xB9, 0x99, 0xFC, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDA, 0xFC, 0xFF,
-    0xFF, 0xFC, 0xFB, 0x9A, 0x99, 0xBA, 0xFF, 0xFF, 0xFB, 0x97, 0x77, 0x77,
-    0x9C, 0xCF, 0xFC, 0x98, 0x65, 0x45, 0x68, 0xAF, 0xFF, 0xC9, 0x75, 0x33,
-    0x35, 0x79, 0xFF, 0xFB, 0x86, 0x43, 0x23, 0x47, 0x9F, 0xFF, 0xC9, 0x75,
-    0x33, 0x35, 0x7B, 0xBF, 0xFF, 0xA8, 0x65, 0x45, 0x68, 0xAF, 0xFF, 0xFA,
-    0xA8, 0x77, 0x78, 0x9B, 0xFF, 0xFF, 0xFF, 0xFB, 0x99, 0xBB, 0xFF, 0xFF,
-    0xFF, 0xFE, 0xCE, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xBC, 0xEF,
-    0xFF, 0xFF, 0xDB, 0x99, 0x89, 0xAC, 0xDF, 0xFF, 0xDB, 0x97, 0x66, 0x67,
-    0x9C, 0xFF, 0xEC, 0x97, 0x65, 0x45, 0x67, 0xAC, 0xFF, 0xB9, 0x65, 0x33,
-    0x35, 0x69, 0xBF, 0xFB, 0x86, 0x43, 0x33, 0x46, 0x9B, 0xEE, 0xB9, 0x65,
-    0x33, 0x35, 0x69, 0xBE, 0xFD, 0xA7, 0x65, 0x45, 0x67, 0xAC, 0xDF, 0xDB,
-    0x97, 0x66, 0x67, 0x9B, 0xDF, 0xFF, 0xDC, 0xA9, 0x89, 0x9B, 0xCF, 0xFF,
-    0xFF, 0xDC, 0xBB, 0xBC, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xEF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBB, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xAA, 0x99, 0xAB, 0xFF, 0xFF, 0xFA, 0x98, 0x76, 0x67,
-    0xAC, 0xCF, 0xFA, 0xA7, 0x64, 0x45, 0x67, 0x9B, 0xFF, 0xF8, 0x74, 0x33,
-    0x34, 0x68, 0xAF, 0xFB, 0x96, 0x43, 0x33, 0x46, 0x8B, 0xFF, 0xF9, 0x75,
-    0x43, 0x35, 0x69, 0xBF, 0xCC, 0x98, 0x65, 0x45, 0x67, 0x9A, 0xBF, 0xFF,
-    0x98, 0x66, 0x68, 0x8F, 0xFF, 0xFF, 0xFF, 0x98, 0x88, 0xAF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xBA, 0xBA, 0xBE, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF,
-    0xFF, 0xAA, 0xFF, 0xF9, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x88, 0x7F,
-    0xAF, 0xFA, 0xFF, 0xF8, 0x75, 0x55, 0x79, 0xFF, 0xFF, 0xF9, 0x75, 0x32,
-    0x34, 0x8A, 0xFF, 0xFF, 0xB8, 0x43, 0x22, 0x58, 0xFF, 0xFF, 0xCF, 0x95,
-    0x33, 0x46, 0x7A, 0xFF, 0xFA, 0xFF, 0x75, 0x46, 0x79, 0xFA, 0xFF, 0xAF,
-    0xF9, 0x89, 0x8A, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xAA, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFA,
-    0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xBA, 0xAA, 0x99, 0xAA, 0xBD, 0xBB, 0xBA, 0x99, 0x88, 0x89, 0x9B,
-    0xCC, 0xBA, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBA, 0x98, 0x76, 0x65, 0x66,
-    0x78, 0xAB, 0xA8, 0x76, 0x55, 0x45, 0x56, 0x79, 0xA9, 0x87, 0x55, 0x44,
-    0x44, 0x67, 0x8A, 0x98, 0x75, 0x44, 0x44, 0x45, 0x68, 0x9A, 0x87, 0x65,
-    0x44, 0x45, 0x67, 0x8A, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0x98,
-    0x76, 0x55, 0x56, 0x78, 0x9A, 0xBA, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xCD,
-    0xCB, 0xA9, 0x88, 0x89, 0xAA, 0xBB, 0xDD, 0xCA, 0xA9, 0x9A, 0xAB, 0xCC,
-    0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xCA, 0xAA, 0xAA, 0xAB, 0xCE, 0xDC, 0xCB, 0xA9, 0x88, 0x89, 0x9B,
-    0xCD, 0xBB, 0x98, 0x87, 0x77, 0x78, 0xAB, 0xDA, 0xA8, 0x76, 0x65, 0x66,
-    0x78, 0xAC, 0xA9, 0x76, 0x55, 0x44, 0x56, 0x79, 0xAA, 0x97, 0x65, 0x44,
-    0x44, 0x67, 0x9A, 0xA8, 0x75, 0x44, 0x34, 0x45, 0x79, 0x9A, 0x87, 0x65,
-    0x44, 0x45, 0x67, 0x9A, 0xB9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xA8,
-    0x76, 0x65, 0x66, 0x78, 0xBB, 0xCB, 0xA8, 0x77, 0x77, 0x78, 0xAB, 0xBD,
-    0xCB, 0xA9, 0x98, 0x99, 0xAA, 0xCD, 0xFD, 0xFB, 0xAA, 0xAB, 0xAB, 0xCC,
-    0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xCB, 0xAA, 0xAA, 0xAB, 0xCE, 0xED, 0xCB, 0xA9, 0x88, 0x89, 0xAB,
-    0xCE, 0xCB, 0x98, 0x77, 0x77, 0x78, 0x9B, 0xCB, 0xA8, 0x76, 0x65, 0x56,
-    0x78, 0xAB, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xBA, 0x87, 0x55, 0x44,
-    0x45, 0x57, 0x8A, 0xA8, 0x75, 0x44, 0x34, 0x45, 0x78, 0xAA, 0x87, 0x65,
-    0x44, 0x45, 0x67, 0x8A, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xA8,
-    0x76, 0x65, 0x66, 0x78, 0xAB, 0xCB, 0x98, 0x77, 0x77, 0x78, 0x9B, 0xCD,
-    0xCB, 0xA9, 0x88, 0x89, 0xAB, 0xCD, 0xED, 0xCB, 0xAA, 0xAA, 0xAB, 0xCD,
-    0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xCB, 0xB9, 0xAA, 0xBB, 0xFF, 0xDD, 0xCB, 0xA9, 0x89, 0x89, 0x9B,
-    0xEF, 0xBB, 0xA8, 0x77, 0x77, 0x78, 0x9B, 0xFC, 0xA8, 0x76, 0x55, 0x56,
-    0x78, 0xAB, 0xB9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xBB, 0x97, 0x65, 0x44,
-    0x44, 0x57, 0x8A, 0xA8, 0x75, 0x44, 0x44, 0x45, 0x68, 0xAA, 0x87, 0x65,
-    0x44, 0x45, 0x57, 0x9A, 0xB9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xBB, 0x98,
-    0x76, 0x55, 0x66, 0x78, 0xAB, 0xFB, 0xA8, 0x77, 0x77, 0x78, 0xAB, 0xBD,
-    0xFB, 0xA9, 0x88, 0x89, 0xAC, 0xCC, 0xBC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB,
-    0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xAB, 0xA9, 0xAA, 0xAB, 0xCC, 0xDC, 0xBA, 0x98, 0x88, 0x88, 0x9A,
-    0xBD, 0xBA, 0x98, 0x77, 0x77, 0x78, 0x9B, 0xCA, 0xA8, 0x76, 0x65, 0x56,
-    0x78, 0xAB, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xBA, 0x87, 0x55, 0x44,
-    0x45, 0x57, 0x89, 0x98, 0x75, 0x44, 0x44, 0x45, 0x68, 0x9A, 0x87, 0x55,
-    0x44, 0x45, 0x57, 0x89, 0xA8, 0x76, 0x55, 0x55, 0x56, 0x79, 0xAB, 0xA8,
-    0x76, 0x55, 0x56, 0x78, 0x9A, 0xCB, 0xA8, 0x77, 0x77, 0x78, 0x9B, 0xDC,
-    0xCB, 0xA9, 0x88, 0x89, 0x9A, 0xBD, 0xCB, 0xCB, 0xA9, 0xA9, 0xAA, 0xBB,
-    0xB0, 0x00, 0x00, 0x00,
-  },
- },
- {
-  {
-    0xAF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFB, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA9, 0xAF,
-    0xFF, 0xFF, 0xFF, 0xFB, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF, 0xA6, 0x32,
-    0x36, 0xAF, 0xFF, 0xFF, 0xF9, 0x63, 0x12, 0x6A, 0xFF, 0xFF, 0xFF, 0x96,
-    0x33, 0x36, 0xBF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9A, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xDA, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x56, 0xFC, 0xCF, 0xFF, 0xFF, 0xF6, 0x32,
-    0x39, 0xFF, 0xFF, 0xFF, 0xF8, 0x62, 0x12, 0x6F, 0xFF, 0xFF, 0xFF, 0xF6,
-    0x43, 0x37, 0xFF, 0xFF, 0xFF, 0xFF, 0xA6, 0x58, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEA, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF, 0xB6, 0x43,
-    0x36, 0xFF, 0xFF, 0xFF, 0xFB, 0x62, 0x12, 0x5B, 0xFF, 0xFF, 0xFF, 0xD6,
-    0x42, 0x36, 0xFF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFA, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x43,
-    0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xA3, 0x11, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x61, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x8A, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x53,
-    0x5E, 0xFF, 0xFF, 0xFF, 0xFF, 0x93, 0x11, 0x8F, 0xFF, 0xFF, 0xFF, 0xFE,
-    0x51, 0x39, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x88, 0xCF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x70, 0x00, 0x00, 0x00,
-  },
-  {
-    0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x70, 0x00, 0x00, 0x00,
-  },
-  {
-    0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x70, 0x00, 0x00, 0x00,
-  },
-  {
-    0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x70, 0x00, 0x00, 0x00,
-  },
-  {
-    0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x70, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xAA, 0xAA, 0xAC, 0xDE, 0xCB, 0xBA, 0xA9, 0x98, 0x99, 0xAB,
-    0xDE, 0xBA, 0x98, 0x77, 0x77, 0x78, 0xAB, 0xEA, 0xA8, 0x76, 0x65, 0x66,
-    0x79, 0xAC, 0xA9, 0x86, 0x54, 0x44, 0x56, 0x79, 0xAA, 0x87, 0x65, 0x44,
-    0x45, 0x57, 0x9A, 0xA9, 0x75, 0x44, 0x34, 0x45, 0x78, 0x9A, 0x87, 0x65,
-    0x44, 0x45, 0x67, 0x9A, 0xB9, 0x86, 0x55, 0x45, 0x56, 0x89, 0xAC, 0xA8,
-    0x76, 0x65, 0x66, 0x78, 0x9A, 0xCC, 0xA8, 0x87, 0x77, 0x89, 0x9B, 0xBF,
-    0xDB, 0xA9, 0x98, 0x99, 0x9B, 0xBC, 0xDF, 0xCB, 0xAA, 0xB9, 0xAB, 0xBB,
-    0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xCB, 0xAA, 0x9A, 0xAB, 0xCE, 0xCD, 0xCB, 0x99, 0x88, 0x89, 0x9B,
-    0xCD, 0xCA, 0x98, 0x77, 0x67, 0x78, 0x9B, 0xCB, 0xA8, 0x76, 0x65, 0x56,
-    0x78, 0xAB, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAA, 0x87, 0x65, 0x44,
-    0x45, 0x57, 0x8A, 0x98, 0x65, 0x44, 0x44, 0x45, 0x78, 0xAA, 0x87, 0x55,
-    0x44, 0x45, 0x57, 0x8A, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xA8,
-    0x76, 0x55, 0x66, 0x78, 0x9B, 0xCB, 0xA8, 0x77, 0x67, 0x78, 0x9B, 0xCD,
-    0xDB, 0xA9, 0x88, 0x89, 0x9B, 0xCD, 0xDC, 0xDB, 0xAA, 0xA9, 0xAB, 0xBE,
-    0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xBB, 0xAA, 0xAA, 0xAB, 0xCD, 0xDC, 0xCB, 0x99, 0x88, 0x89, 0xAB,
-    0xCD, 0xBB, 0x98, 0x77, 0x77, 0x78, 0x9B, 0xCB, 0xA8, 0x76, 0x55, 0x56,
-    0x78, 0xAB, 0xA9, 0x76, 0x55, 0x44, 0x56, 0x79, 0xAA, 0x87, 0x65, 0x44,
-    0x45, 0x57, 0x8A, 0xA8, 0x75, 0x44, 0x44, 0x45, 0x68, 0xAA, 0x87, 0x55,
-    0x44, 0x45, 0x67, 0x89, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xA8,
-    0x76, 0x65, 0x66, 0x78, 0xAA, 0xCB, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBD,
-    0xCB, 0xA9, 0x88, 0x89, 0xAB, 0xBB, 0xDD, 0xCB, 0xAA, 0x9A, 0xAA, 0xBB,
-    0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xEC, 0xBA, 0xAA, 0xBD, 0xEF, 0xDD, 0xCB, 0xA9, 0x99, 0x9A, 0xBD,
-    0xCF, 0xDB, 0x98, 0x77, 0x77, 0x88, 0xAC, 0xDE, 0xA9, 0x76, 0x55, 0x66,
-    0x79, 0x9F, 0xB9, 0x86, 0x55, 0x45, 0x56, 0x89, 0xBB, 0x97, 0x65, 0x44,
-    0x45, 0x67, 0x9B, 0xB8, 0x75, 0x44, 0x34, 0x45, 0x79, 0xAA, 0x97, 0x64,
-    0x44, 0x45, 0x57, 0x9B, 0xC9, 0x86, 0x55, 0x44, 0x56, 0x79, 0xBC, 0xA8,
-    0x76, 0x55, 0x66, 0x79, 0xBF, 0xFC, 0xA8, 0x87, 0x77, 0x78, 0xAA, 0xFF,
-    0xFC, 0xAA, 0x99, 0x99, 0xAC, 0xCF, 0xFF, 0xCB, 0xBA, 0xAB, 0xBC, 0xBE,
-    0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xBB, 0xBB, 0x9B, 0xBB, 0xFE, 0xCD, 0xCC, 0xA9, 0x99, 0x99, 0xAC,
-    0xED, 0xCC, 0xA8, 0x87, 0x77, 0x88, 0xAB, 0xCB, 0xA8, 0x76, 0x56, 0x66,
-    0x79, 0xBC, 0xA9, 0x86, 0x55, 0x44, 0x56, 0x79, 0xCA, 0x97, 0x65, 0x44,
-    0x44, 0x67, 0x8A, 0xA9, 0x75, 0x44, 0x34, 0x45, 0x79, 0xBB, 0x97, 0x64,
-    0x44, 0x45, 0x67, 0x9A, 0xB9, 0x86, 0x54, 0x45, 0x56, 0x89, 0xBC, 0xA9,
-    0x76, 0x66, 0x66, 0x79, 0xAC, 0xFC, 0xA8, 0x87, 0x77, 0x79, 0x9B, 0xDE,
-    0xDC, 0xA9, 0x99, 0x9A, 0xAB, 0xBD, 0xBD, 0xDB, 0xBA, 0xAA, 0xBB, 0xCD,
-    0xB0, 0x00, 0x00, 0x00,
-  },
- },
- {
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x7F, 0xFC, 0xAF, 0xFF, 0xFF, 0xF6, 0x32,
-    0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x63, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xCC, 0xCF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x99, 0xBB,
-    0xFF, 0xFF, 0xFC, 0xBB, 0x86, 0x56, 0x9B, 0xFF, 0xFF, 0xFB, 0xA7, 0x42,
-    0x36, 0xAF, 0xFF, 0xFF, 0xF9, 0x62, 0x13, 0x59, 0xFF, 0xFF, 0xFF, 0xA6,
-    0x32, 0x47, 0xAF, 0xEF, 0xFF, 0xFF, 0x96, 0x57, 0x9A, 0xCC, 0xFF, 0xFF,
-    0xFB, 0xAA, 0xAA, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0x99, 0x9B,
-    0xFF, 0xFF, 0xFF, 0xFA, 0x86, 0x56, 0x8B, 0xFF, 0xFF, 0xFF, 0xA6, 0x42,
-    0x36, 0xAF, 0xFF, 0xFF, 0xF9, 0x52, 0x13, 0x58, 0xFF, 0xFF, 0xFF, 0xA5,
-    0x33, 0x36, 0x9F, 0xFF, 0xFF, 0xFE, 0x86, 0x56, 0x8B, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xA8, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x7F,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x75, 0x45, 0x68, 0xCF, 0xFF, 0xFF, 0xB5, 0x43,
-    0x35, 0x8F, 0xFF, 0xFF, 0xF8, 0x43, 0x23, 0x57, 0xCF, 0xFF, 0xFF, 0xA5,
-    0x32, 0x34, 0x8F, 0xFF, 0xFF, 0xFF, 0x64, 0x44, 0x6F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x87, 0x98, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xAF, 0xFF, 0xFF, 0xFF, 0xF3,
-    0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF4, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x52, 0x37, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x8F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x88, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xF8, 0x67, 0x87,
-    0xFF, 0xFF, 0xFF, 0xF8, 0x76, 0x54, 0x77, 0xEF, 0xFF, 0xFF, 0x84, 0x33,
-    0x35, 0x7F, 0xFF, 0xF8, 0x86, 0x53, 0x23, 0x57, 0xFF, 0xFF, 0xFF, 0x65,
-    0x33, 0x35, 0x78, 0xFF, 0xFF, 0xF8, 0x55, 0x44, 0x58, 0xEE, 0xEE, 0xFE,
-    0xFE, 0x67, 0x88, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFC, 0xCC, 0xFC, 0xFF, 0xFF, 0xFF, 0xBC, 0xA9, 0xA9, 0xCF,
-    0xFF, 0xFC, 0xBA, 0x98, 0x77, 0x89, 0xBF, 0xFF, 0xB9, 0x87, 0x66, 0x67,
-    0x8A, 0xCF, 0xBA, 0x87, 0x65, 0x44, 0x67, 0x9F, 0xFB, 0xA8, 0x65, 0x43,
-    0x45, 0x69, 0xCF, 0xEA, 0x76, 0x43, 0x33, 0x46, 0x8F, 0xFC, 0xA8, 0x65,
-    0x43, 0x34, 0x68, 0xAF, 0xF9, 0x97, 0x64, 0x44, 0x57, 0xAF, 0xFF, 0xFA,
-    0x97, 0x66, 0x67, 0x9C, 0xFF, 0xFF, 0xFB, 0xA9, 0x99, 0x9B, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xCB, 0xCC, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xDC, 0xCD, 0xCF, 0xFF,
-    0xFF, 0xCC, 0xCB, 0xA9, 0x9A, 0xBC, 0xFF, 0xFD, 0xDB, 0xA8, 0x76, 0x78,
-    0xAD, 0xFF, 0xDC, 0xA8, 0x65, 0x45, 0x68, 0xBF, 0xFE, 0xCA, 0x75, 0x33,
-    0x35, 0x7A, 0xCF, 0xFC, 0xA6, 0x43, 0x23, 0x47, 0x9C, 0xFF, 0xC9, 0x75,
-    0x33, 0x35, 0x79, 0xCE, 0xFD, 0xB8, 0x65, 0x45, 0x68, 0xAC, 0xDF, 0xFC,
-    0xA8, 0x76, 0x78, 0xAB, 0xDF, 0xFF, 0xFD, 0xBA, 0x99, 0xAB, 0xCF, 0xFF,
-    0xFF, 0xFD, 0xDD, 0xCD, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF,
-    0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x9D, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xAF, 0x77, 0x8A,
-    0xFF, 0xFF, 0xFF, 0xF9, 0x75, 0x45, 0x68, 0xFF, 0xFF, 0xFF, 0x84, 0x33,
-    0x35, 0x9A, 0xFF, 0xFF, 0xF6, 0x43, 0x23, 0x47, 0xFF, 0xFF, 0xFF, 0x75,
-    0x33, 0x35, 0x7A, 0xFF, 0xFF, 0xF8, 0x64, 0x45, 0x69, 0xFF, 0xFF, 0xFF,
-    0x97, 0x86, 0x78, 0x9F, 0xFF, 0xFF, 0xAF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF,
-    0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x70, 0x00, 0x00, 0x00,
-  },
-  {
-    0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x70, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEE, 0xDD, 0xDD, 0xDD, 0x5D, 0xDD, 0x4D, 0xDD, 0xDD, 0xD6, 0xDD, 0xD5,
-    0xDD, 0xDD, 0x5D, 0xDD, 0x6D, 0xDD, 0xDD, 0xD5, 0xDD, 0xDD, 0xD6, 0xDD,
-    0xDD, 0x6D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD6, 0xDD, 0xDD, 0xD6,
-    0xD5, 0xDD, 0x5D, 0x6D, 0x55, 0xDD, 0x0D, 0x55, 0x65, 0xDD, 0x5D, 0xDD,
-    0x66, 0xDD, 0xDD, 0xDD, 0xDD, 0xD5, 0xD5, 0x5D, 0x5D, 0xD6, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xD6, 0xD5, 0x6D, 0x6D, 0x6D, 0xD4, 0x6D, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x55, 0xD6, 0xDD, 0xDE,
-    0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0x9B, 0xA9, 0x9B, 0xAC, 0xCC, 0xFA, 0xBA, 0xBB, 0xA9, 0xAA, 0xBF,
-    0xFF, 0xAA, 0xAA, 0x98, 0x88, 0x88, 0xAD, 0xF9, 0x99, 0x88, 0x76, 0x66,
-    0x79, 0xAA, 0x99, 0x98, 0x75, 0x54, 0x56, 0x8F, 0xFA, 0xA9, 0x75, 0x43,
-    0x34, 0x68, 0xAB, 0xBA, 0x86, 0x53, 0x33, 0x56, 0x8A, 0xBC, 0xB8, 0x64,
-    0x33, 0x45, 0x79, 0xAC, 0xCB, 0x86, 0x54, 0x55, 0x67, 0x8A, 0xAC, 0xCA,
-    0x76, 0x67, 0x78, 0x89, 0xBB, 0xFF, 0xB9, 0x78, 0x88, 0x9A, 0xBB, 0x9F,
-    0xFD, 0xF9, 0xAB, 0x9A, 0xAB, 0xAA, 0xFF, 0xFC, 0xFA, 0xAB, 0x99, 0xAA,
-    0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCC, 0xBC, 0xBB, 0xBC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCB, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB4, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xB4, 0x44, 0xB4, 0x2B, 0xBC, 0xCC, 0xCB, 0xBB, 0x33,
-    0x4B, 0xBB, 0xBB, 0xBB, 0xB4, 0xBB, 0x44, 0x3B, 0xBB, 0xBB, 0xBB, 0xBB,
-    0xB3, 0xB4, 0xBB, 0xBB, 0xBB, 0xBB, 0xB4, 0x44, 0x3B, 0xBB, 0xBB, 0xBB,
-    0xB4, 0xB3, 0xBB, 0xBC, 0xCC, 0xCC, 0xCC, 0xCB, 0xB4, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCB, 0xCC, 0xCC,
-    0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-    0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x70, 0x00, 0x00, 0x00,
-  },
- },
-};
-
-static const uint8_t long_codes_def[3][125][224] = {
- {
-  {
-    0xBE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF,
-    0xFE, 0xED, 0xDD, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, 0xDC,
-    0xCB, 0xCB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFE, 0xED, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xDD, 0xFF, 0xFF, 0xFE, 0xDC, 0xBB, 0xA9, 0x99, 0x99,
-    0x99, 0xAB, 0xCD, 0xEF, 0xFE, 0xEC, 0xCB, 0xA9, 0x88, 0x87, 0x78, 0x89,
-    0xAB, 0xCD, 0xFF, 0xFE, 0xCB, 0xA9, 0x87, 0x77, 0x66, 0x77, 0x89, 0xAB,
-    0xDE, 0xFD, 0xDC, 0xAA, 0x87, 0x76, 0x65, 0x66, 0x67, 0x89, 0xBC, 0xEF,
-    0xDD, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xED, 0xDC,
-    0xA9, 0x87, 0x65, 0x54, 0x45, 0x56, 0x79, 0xAC, 0xDD, 0xDD, 0xCA, 0x98,
-    0x65, 0x54, 0x44, 0x55, 0x67, 0x9A, 0xBD, 0xDE, 0xEB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x66, 0x89, 0xAB, 0xDD, 0xED, 0xCA, 0x98, 0x76, 0x55, 0x55,
-    0x56, 0x78, 0x9A, 0xCC, 0xDE, 0xFC, 0xBA, 0x87, 0x76, 0x65, 0x66, 0x77,
-    0x89, 0xBB, 0xDD, 0xFE, 0xDB, 0xA9, 0x87, 0x76, 0x67, 0x77, 0x89, 0xAB,
-    0xCD, 0xDF, 0xEF, 0xCB, 0xA9, 0x88, 0x87, 0x88, 0x89, 0xAB, 0xCC, 0xED,
-    0xFF, 0xED, 0xCB, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xEF, 0xFF,
-    0xFD, 0xDB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFD, 0xFF, 0xFF, 0xFD,
-    0xDC, 0xCC, 0xBC, 0xCC, 0xDC, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDE,
-    0xDD, 0xCD, 0xDD, 0xEE, 0xFF, 0xFE, 0xDF, 0xFF, 0xFF, 0xEF, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xFD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xCD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xCF, 0xFE,
-    0xDC, 0xDC, 0xCC, 0xBB, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xEE, 0xDD, 0xCC,
-    0xCB, 0xBA, 0xAA, 0xBB, 0xBC, 0xDD, 0xFF, 0xDC, 0xDD, 0xCB, 0xBA, 0xA9,
-    0x99, 0x9A, 0x9A, 0xBC, 0xDF, 0xFF, 0xBD, 0xDB, 0xBA, 0x99, 0x88, 0x88,
-    0x88, 0x9A, 0xBC, 0xEF, 0xDD, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x78, 0x9A,
-    0xCC, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x65, 0x66, 0x67, 0x88, 0xAB, 0xCC,
-    0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xCC, 0xCA,
-    0x98, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xCC, 0xBB, 0xA9, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xBC, 0xCA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCC, 0xB9, 0x87, 0x66, 0x55, 0x55,
-    0x56, 0x77, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x67,
-    0x89, 0xAB, 0xBD, 0xDF, 0xCA, 0x98, 0x87, 0x76, 0x66, 0x77, 0x89, 0x9A,
-    0xBC, 0xCF, 0xDD, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xBC, 0xDD,
-    0xFF, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xDF, 0xFF,
-    0xDC, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xEC,
-    0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xDC, 0xDF, 0xDF, 0xFF, 0xFD, 0xEE, 0xCC,
-    0xBC, 0xBB, 0xCC, 0xDD, 0xCE, 0xFE, 0xCF, 0xFF, 0xDD, 0xDD, 0xCD, 0xDC,
-    0xCB, 0xBD, 0xCD, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xDD, 0xEE,
-    0xDD, 0xCD, 0xCC, 0xCC, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xDE, 0xDD, 0xCC,
-    0xBB, 0xBB, 0xBA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFD, 0xDD, 0xCC, 0xBA, 0xAA,
-    0x99, 0x9A, 0xAA, 0xBC, 0xDE, 0xFF, 0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x88,
-    0x89, 0x9A, 0xBC, 0xDF, 0xED, 0xCC, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xDE, 0xCC, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x67, 0x78, 0x9A,
-    0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x65, 0x56, 0x67, 0x89, 0xAB, 0xCC,
-    0xCC, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xCC, 0xCA,
-    0x98, 0x76, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCC, 0xCC, 0xB9, 0x87,
-    0x65, 0x55, 0x45, 0x56, 0x67, 0x89, 0xAC, 0xCC, 0xCB, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x66, 0x78, 0x9B, 0xCC, 0xCC, 0xBA, 0x87, 0x76, 0x55, 0x55,
-    0x56, 0x78, 0x99, 0xBC, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCC, 0xDD, 0xCB, 0x98, 0x87, 0x76, 0x66, 0x77, 0x89, 0x9B,
-    0xBC, 0xCE, 0xED, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89, 0x9A, 0xBC, 0xDC,
-    0xEE, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xBC, 0xCD, 0xCF, 0xFE,
-    0xDD, 0xBB, 0xAA, 0x99, 0x9A, 0xAA, 0xBC, 0xCC, 0xDC, 0xFF, 0xFE, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xDF, 0xFF, 0xFF, 0xED, 0xCC,
-    0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFD, 0xDF, 0xFF, 0xED, 0xDD, 0xDC, 0xCC,
-    0xCC, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xCD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xDD, 0xFF,
-    0xDF, 0xEC, 0xCC, 0xDC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xEE, 0xCC, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xAC, 0xCC, 0xEF, 0xEF, 0xFD, 0xDD, 0xCC, 0xBB, 0xAA,
-    0x99, 0x9A, 0xAB, 0xBC, 0xDF, 0xFF, 0xDD, 0xCB, 0xBA, 0x99, 0x98, 0x88,
-    0x89, 0x9A, 0xBC, 0xDD, 0xFC, 0xDB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xED, 0xBC, 0xBA, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x88, 0x9A,
-    0xBD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x65, 0x56, 0x67, 0x89, 0xAC, 0xCE,
-    0xCC, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x67, 0x8A, 0xBC, 0xDC, 0xDB,
-    0xA9, 0x76, 0x65, 0x55, 0x55, 0x56, 0x78, 0xAA, 0xCC, 0xCC, 0xB9, 0x87,
-    0x66, 0x55, 0x45, 0x55, 0x67, 0x89, 0xBC, 0xCC, 0xDB, 0xA8, 0x76, 0x65,
-    0x55, 0x55, 0x66, 0x78, 0x9B, 0xCC, 0xCC, 0xBA, 0x97, 0x66, 0x55, 0x55,
-    0x56, 0x78, 0x9A, 0xBC, 0xCF, 0xDC, 0xA9, 0x87, 0x66, 0x65, 0x66, 0x77,
-    0x89, 0xAB, 0xCC, 0xFD, 0xCB, 0xA8, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB,
-    0xBC, 0xCF, 0xFD, 0xCB, 0x99, 0x87, 0x77, 0x78, 0x89, 0xAA, 0xCC, 0xCC,
-    0xFF, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x99, 0x9A, 0xBC, 0xDD, 0xCF, 0xFE,
-    0xDD, 0xBB, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xBD, 0xDC, 0xFF, 0xFF, 0xDD,
-    0xBC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xFE, 0xCF, 0xFF, 0xFD, 0xFD, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFE, 0xCF, 0xFF, 0xDD, 0xCD, 0xDD, 0xCC,
-    0xCD, 0xCC, 0xCD, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBF, 0xEE, 0xDD, 0xDD, 0xCD, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xDE, 0xFF,
-    0xFD, 0xED, 0xDD, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0xDD,
-    0xCC, 0xCB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFE, 0xFD, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFF, 0xFF, 0xDC, 0xBA, 0xA9, 0x99, 0x89,
-    0x99, 0xAB, 0xCD, 0xFF, 0xFD, 0xDD, 0xCA, 0xA9, 0x88, 0x87, 0x78, 0x89,
-    0xAB, 0xCD, 0xFF, 0xDE, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB,
-    0xDF, 0xFE, 0xDC, 0xA9, 0x87, 0x76, 0x65, 0x56, 0x67, 0x89, 0xAC, 0xEF,
-    0xED, 0xCA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xED, 0xDB,
-    0xA9, 0x76, 0x65, 0x54, 0x55, 0x56, 0x79, 0xAB, 0xCE, 0xDD, 0xBA, 0x87,
-    0x66, 0x54, 0x44, 0x55, 0x67, 0x9A, 0xBD, 0xDD, 0xDB, 0xA9, 0x86, 0x65,
-    0x54, 0x55, 0x66, 0x79, 0xAB, 0xCD, 0xDD, 0xCA, 0x98, 0x76, 0x55, 0x55,
-    0x56, 0x78, 0x9A, 0xCD, 0xDF, 0xFC, 0xB9, 0x87, 0x66, 0x65, 0x66, 0x77,
-    0x89, 0xBC, 0xDD, 0xFF, 0xDC, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDF, 0xFF, 0xCB, 0xA9, 0x88, 0x87, 0x78, 0x89, 0xAB, 0xBC, 0xED,
-    0xFF, 0xFD, 0xCB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDF, 0xEF, 0xFF,
-    0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xCD, 0xED, 0xFF, 0xFF, 0xFD,
-    0xDC, 0xCB, 0xBC, 0xCC, 0xCD, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xED,
-    0xDE, 0xDD, 0xDE, 0xDD, 0xDF, 0xFF, 0xBF, 0xFF, 0xEF, 0xDF, 0xED, 0xDC,
-    0xDD, 0xDD, 0xDE, 0xED, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xBC, 0xDC,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xBC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCD, 0xDB, 0xCB, 0xAA, 0xA9, 0x98,
-    0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCC, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0xAB, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9,
-    0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87,
-    0x66, 0x65, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x78, 0x99, 0xAA, 0xBA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA,
-    0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCB,
-    0xBA, 0x99, 0x98, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xCB, 0xCC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBD, 0xDD, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xAA, 0x9A, 0x9A, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xCA, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x77,
-    0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x67, 0x78, 0x89,
-    0xAA, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA,
-    0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xA9, 0xA9,
-    0x88, 0x76, 0x66, 0x65, 0x66, 0x66, 0x77, 0x89, 0xAA, 0xAA, 0x98, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x67, 0x78, 0x9A, 0x99, 0xA9, 0x88, 0x76, 0x66,
-    0x65, 0x66, 0x66, 0x78, 0x89, 0xA9, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x78, 0x89, 0xAA, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xAA,
-    0xBB, 0xBA, 0x99, 0x88, 0x87, 0x78, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xCB,
-    0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBA, 0xCC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC, 0xCC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBD, 0xCC, 0xBA, 0xAA, 0xA9, 0x99,
-    0xAA, 0xAA, 0xAB, 0xBB, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBB, 0xDC,
-    0xBB, 0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xDD, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x88, 0x89, 0x99, 0xAB, 0xBB, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77,
-    0x78, 0x88, 0x99, 0xAB, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x76, 0x66, 0x67, 0x77, 0x89,
-    0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA,
-    0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x78, 0x99, 0x99, 0x99,
-    0x87, 0x76, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x99, 0x99, 0x98, 0x77,
-    0x66, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0x99, 0xA9, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x66, 0x77, 0x89, 0x99, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0x9A, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x78, 0x89, 0xA9, 0xAA, 0x99, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA,
-    0xBB, 0xAA, 0x98, 0x88, 0x87, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB,
-    0xA9, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xCC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBC, 0xDC, 0xBB, 0xBA, 0xAA,
-    0x99, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xBC, 0xCB, 0xBA, 0xAA, 0x99, 0x99,
-    0x99, 0xAA, 0xAA, 0xBB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xCC,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDC, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xBC, 0xCB, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x78,
-    0x88, 0x88, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x66, 0x77, 0x78, 0x89,
-    0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA,
-    0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0x99, 0xA9,
-    0x88, 0x76, 0x66, 0x65, 0x66, 0x66, 0x77, 0x89, 0xA9, 0x9A, 0x98, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x67, 0x88, 0x9A, 0x99, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x66, 0x66, 0x78, 0x89, 0xA9, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0x9A, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x78, 0x99, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA,
-    0xBB, 0xAA, 0x99, 0x88, 0x87, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB,
-    0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xCD, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBC, 0xCB, 0xBA, 0xAA, 0x9A, 0x99,
-    0x99, 0xAA, 0xAA, 0xBB, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xCC, 0xDC,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xED, 0xBC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCB, 0xCB, 0xAA, 0x99, 0x98,
-    0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x78,
-    0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9,
-    0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87,
-    0x66, 0x65, 0x55, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67,
-    0x78, 0x99, 0xAA, 0xAB, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA,
-    0xBC, 0xBA, 0x99, 0x88, 0x88, 0x78, 0x88, 0x89, 0x9A, 0xBB, 0xBC, 0xCB,
-    0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xDD, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCD, 0xED, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xBD, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBF, 0xEE, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF,
-    0xFE, 0xED, 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xDD,
-    0xCC, 0xCB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFE, 0xFE, 0xDC, 0xCB, 0xBA,
-    0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xFF, 0xEE, 0xDD, 0xBB, 0xA9, 0x99, 0x99,
-    0x9A, 0xBC, 0xDE, 0xFF, 0xFD, 0xDC, 0xBB, 0xA9, 0x88, 0x77, 0x88, 0x99,
-    0xAC, 0xDF, 0xFF, 0xDD, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x78, 0x8A, 0xBC,
-    0xEF, 0xFD, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xFF,
-    0xDD, 0xBA, 0x98, 0x76, 0x55, 0x45, 0x56, 0x78, 0xAB, 0xDE, 0xFD, 0xDB,
-    0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xEF, 0xED, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xEE, 0xDC, 0xA9, 0x86, 0x55,
-    0x44, 0x55, 0x67, 0x89, 0xBC, 0xDD, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0xAB, 0xCE, 0xEF, 0xFD, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xCD, 0xEE, 0xFF, 0xDC, 0xBA, 0x88, 0x77, 0x77, 0x78, 0x9A, 0xBC,
-    0xDF, 0xEF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0x9A, 0xBC, 0xCD, 0xEF,
-    0xFF, 0xFE, 0xDC, 0xBA, 0xA9, 0x99, 0xAA, 0xBB, 0xCD, 0xEF, 0xEF, 0xFF,
-    0xFE, 0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE,
-    0xDD, 0xDC, 0xCC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xEF, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED,
-    0xDE, 0xEE, 0xEF, 0xEF, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAD, 0xCD, 0xCB, 0xBC, 0xCB, 0xCC, 0xCD, 0xDD, 0xDE, 0xEF, 0xBD, 0xDE,
-    0xDD, 0xCC, 0xCC, 0xCC, 0xDC, 0xDD, 0xFF, 0xFF, 0xFF, 0xDD, 0xDD, 0xCB,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xDD, 0xEF, 0xEF, 0xDD, 0xDC, 0xCC, 0xBB, 0xAA,
-    0xA9, 0xAA, 0xBB, 0xCC, 0xFF, 0xFE, 0xCD, 0xCC, 0xAA, 0x99, 0x98, 0x88,
-    0x99, 0xAB, 0xCE, 0xFE, 0xCC, 0xCB, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xFE, 0xCD, 0xBB, 0x99, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAC,
-    0xDE, 0xDC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x67, 0x8A, 0xBC, 0xFD,
-    0xCC, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCB,
-    0x99, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xBA, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCB, 0xA8, 0x76, 0x65,
-    0x54, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCD, 0xBA, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xCD, 0xEC, 0xB9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBB, 0xDC, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xCE, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xDD,
-    0xEF, 0xFD, 0xDB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xDF, 0xFD,
-    0xFD, 0xCC, 0xBB, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xFC, 0xEF, 0xEF, 0xED,
-    0xDD, 0xCC, 0xBC, 0xBC, 0xCC, 0xED, 0xEE, 0xDF, 0xFF, 0xFF, 0xFD, 0xED,
-    0xDC, 0xDC, 0xDD, 0xDD, 0xDD, 0xED, 0xBE, 0xDD, 0xDD, 0xDD, 0xDC, 0xDC,
-    0xCD, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xDD, 0xFE,
-    0xDD, 0xCC, 0xCC, 0xCB, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xDE, 0xDD, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFD, 0xDD, 0xCB, 0xAA, 0xA9,
-    0x99, 0x99, 0xAB, 0xBC, 0xEF, 0xFF, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCD, 0xEC, 0xCA, 0x99, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD,
-    0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x55, 0x55, 0x66, 0x78, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x55, 0x45, 0x56, 0x67, 0x8A, 0xBC, 0xCC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x79, 0xAB, 0xCC, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCC, 0xDD, 0xCB, 0x99, 0x87, 0x76, 0x67, 0x77, 0x89, 0xAB,
-    0xCD, 0xDE, 0xDD, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x89, 0xAA, 0xBC, 0xDD,
-    0xEF, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x99, 0xAA, 0xBC, 0xDD, 0xDF, 0xFF,
-    0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xED, 0xFF, 0xFE, 0xDC,
-    0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xEF, 0xFF, 0xFF, 0xED, 0xDC,
-    0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xFE, 0xDF, 0xFF, 0xFE, 0xED, 0xDD, 0xDC,
-    0xCD, 0xDD, 0xDD, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xEF, 0xCD, 0xFD,
-    0xED, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB,
-    0xBB, 0xBA, 0xAB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFD, 0xDD, 0xCB, 0xAA, 0xA9,
-    0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xFE, 0xCD, 0xCB, 0xBA, 0x99, 0x88, 0x88,
-    0x89, 0xAA, 0xBD, 0xEF, 0xDC, 0xDC, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x89,
-    0x9A, 0xCD, 0xFD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xDD,
-    0xCC, 0xB9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xCC, 0xCA,
-    0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x79, 0xAB, 0xDD, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x67, 0x8A, 0xBC, 0xCC, 0xCB, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x97, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xCD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xDC, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xED, 0xBA, 0xA9, 0x88, 0x77, 0x88, 0x89, 0x9B, 0xBC, 0xDD,
-    0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xCE, 0xCF, 0xFE,
-    0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xED, 0xFF, 0xEE, 0xED,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCE, 0xEE, 0xDF, 0xFF, 0xFF, 0xED, 0xDD,
-    0xDC, 0xCC, 0xCD, 0xDD, 0xFE, 0xFE, 0xBF, 0xFE, 0xDD, 0xDD, 0xCD, 0xCC,
-    0xDD, 0xCC, 0xDD, 0xEE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBF, 0xFF, 0xFE, 0xEE, 0xEE, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF,
-    0xFF, 0xEE, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED,
-    0xCC, 0xCB, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDC, 0xCB, 0xBA,
-    0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF, 0xEE, 0xDC, 0xBB, 0xA9, 0x99, 0x99,
-    0x9A, 0xBC, 0xDF, 0xFF, 0xFE, 0xED, 0xCB, 0xA9, 0x88, 0x77, 0x88, 0x9A,
-    0xBC, 0xDF, 0xFF, 0xEE, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x78, 0x8A, 0xBC,
-    0xEF, 0xFD, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xFF,
-    0xDD, 0xCA, 0x98, 0x76, 0x55, 0x45, 0x56, 0x78, 0xAB, 0xDF, 0xFE, 0xDC,
-    0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xEF, 0xED, 0xCA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0x9B, 0xCE, 0xEE, 0xDC, 0xA9, 0x76, 0x55,
-    0x44, 0x55, 0x67, 0x89, 0xBC, 0xEE, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0xAB, 0xCE, 0xEF, 0xFD, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBD, 0xEF, 0xFF, 0xEC, 0xB9, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBC,
-    0xDF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x88, 0x9A, 0xBB, 0xDE, 0xFF,
-    0xFF, 0xFE, 0xDC, 0xBA, 0xA9, 0x99, 0xAA, 0xBB, 0xCD, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xEC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xED, 0xDC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xEE, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xBC, 0xDD,
-    0xCB, 0xBB, 0xBA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDD, 0xED, 0xCC, 0xCB, 0xBA,
-    0xAA, 0xA9, 0x99, 0xAA, 0xBB, 0xCC, 0xDE, 0xDB, 0xCB, 0xBA, 0xA9, 0x99,
-    0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDC, 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x9A,
-    0xBC, 0xCA, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x89, 0x9A, 0xBB,
-    0xAA, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9,
-    0x98, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xBB, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x66, 0x65, 0x55,
-    0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xBB, 0xAA, 0x98, 0x87, 0x77, 0x67, 0x77, 0x88, 0x9A,
-    0xBB, 0xBC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB,
-    0xCC, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC,
-    0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xDE, 0xED, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCD, 0xEE, 0xDD, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xDC, 0xAE, 0xDD, 0xCC, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xBC, 0xDC, 0xAB, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xED, 0xBB, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xDA, 0xBA, 0xAA, 0x99, 0x98,
-    0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77,
-    0x88, 0x89, 0xAA, 0xBC, 0xCA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x89, 0xAB, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x87, 0x66, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x66, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x67, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x99, 0x87, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0xBB, 0xA9, 0x88, 0x77, 0x76, 0x67, 0x77, 0x88, 0x99,
-    0xAB, 0xAB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA,
-    0xBB, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xAC, 0xDB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCC, 0xBB,
-    0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBC, 0xED, 0xDC, 0xBB, 0xBA,
-    0xAA, 0xAA, 0xBA, 0xBB, 0xCC, 0xCC, 0xAC, 0xCC, 0xCB, 0xBB, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBB, 0xCC,
-    0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDC, 0xBB, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x66, 0x66, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x99, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x67, 0x77, 0x78, 0x89,
-    0xAA, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB,
-    0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBB, 0xCC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBC, 0xCB, 0xBB, 0xAA, 0xAA, 0x99,
-    0x9A, 0xAA, 0xAB, 0xBB, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xAB, 0xDC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xEC, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xCD, 0xCB, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x78,
-    0x88, 0x89, 0xAA, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x87, 0x66, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x66, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x67, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0x99, 0x87, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0xAB, 0xAA, 0xAA, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0xAB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBA,
-    0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x98, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCB, 0xBA,
-    0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xCD, 0xED, 0xDC, 0xBB, 0xBB,
-    0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xAC, 0xCC, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xCE, 0xAC, 0xDD,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xFE, 0xBC, 0xCB, 0xBA,
-    0xAA, 0x99, 0x9A, 0xAA, 0xAB, 0xCC, 0xDE, 0xDB, 0xCB, 0xBA, 0xA9, 0x99,
-    0x98, 0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x9A,
-    0xBC, 0xCA, 0xAA, 0x98, 0x77, 0x66, 0x65, 0x66, 0x67, 0x88, 0x9A, 0xBB,
-    0xAA, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xAA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBB, 0xBB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBB, 0xBC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB,
-    0xCC, 0xCB, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x99, 0xAB, 0xBC, 0xBD, 0xDC,
-    0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCE, 0xFE, 0xDC, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEC, 0xBE, 0xDC, 0xCC, 0xCB, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDE, 0xDD, 0xDD, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xBE, 0xFF,
-    0xEE, 0xDD, 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xED, 0xDC,
-    0xCC, 0xBC, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xFD, 0xED, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF, 0xDD, 0xDC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xBC, 0xDF, 0xFF, 0xFD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xBC, 0xEF, 0xFF, 0xDD, 0xCB, 0x98, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBD,
-    0xEF, 0xFD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xFF,
-    0xDD, 0xBA, 0x97, 0x66, 0x54, 0x45, 0x56, 0x79, 0xAC, 0xDE, 0xFE, 0xDB,
-    0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xDD, 0xCA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCE, 0xEE, 0xDC, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x8A, 0xBD, 0xEF, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x79, 0xAB, 0xDE, 0xEF, 0xED, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBD, 0xFE, 0xEF, 0xEC, 0xBA, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBC,
-    0xDE, 0xEF, 0xFF, 0xDC, 0xBA, 0x99, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xEE,
-    0xFF, 0xFE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xEF, 0xFF,
-    0xFF, 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xED, 0xDD, 0xCD, 0xCD, 0xDD, 0xDF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xFE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xEE, 0xEE,
-    0xEE, 0xEF, 0xEF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFF, 0xCE, 0xFE,
-    0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xDF, 0xED, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDF, 0xFF, 0xFE, 0xED, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAB, 0xCD, 0xDF, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xEF, 0xFD, 0xDB, 0xB9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xFE, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCD, 0xFC, 0xCB, 0x98, 0x77, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xDE,
-    0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA,
-    0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x79, 0xAB, 0xCD, 0xDC, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xBA, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xCC, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x89, 0xBC, 0xDD, 0xED, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCE, 0xDE, 0xEC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x89, 0xAB, 0xCD, 0xEE,
-    0xFF, 0xEC, 0xBB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xCC, 0xDF, 0xEF, 0xFF,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBD, 0xDE, 0xFF, 0xFF, 0xFF, 0xED,
-    0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xDD,
-    0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xEF, 0xED, 0xDD,
-    0xDD, 0xDF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xCE, 0xFE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xEE, 0xDD, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFF, 0xFD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xDF, 0xED, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xEE, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x67, 0x89, 0x9B,
-    0xCD, 0xEC, 0xBA, 0x98, 0x76, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD,
-    0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x67, 0x8A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x78, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCD, 0xDD, 0xCA, 0x98, 0x87, 0x77, 0x67, 0x77, 0x89, 0xAB,
-    0xCD, 0xDE, 0xEC, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x89, 0xAA, 0xBC, 0xDD,
-    0xEE, 0xDC, 0xBA, 0xA9, 0x98, 0x89, 0x99, 0xAA, 0xBC, 0xDE, 0xEF, 0xFE,
-    0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFE, 0xFF, 0xFE, 0xED,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xED, 0xDC,
-    0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xDF, 0xFF, 0xEE, 0xDD, 0xDD, 0xCD,
-    0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDC, 0xDC, 0xCC, 0xBC, 0xCC, 0xCD, 0xDD, 0xDE, 0xEE, 0xBE, 0xFE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xEF, 0xFF, 0xFD, 0xDD, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xFE, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xCC, 0xEE, 0xEC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCE, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x56, 0x77, 0x8A, 0xAC, 0xDD,
-    0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCC, 0xBA, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x99, 0xAC, 0xDC, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xEC, 0xCA, 0xA9, 0x88, 0x88, 0x88, 0x89, 0xAB, 0xBC, 0xDD,
-    0xDE, 0xDC, 0xCB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xDE, 0xFE,
-    0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xDD, 0xEF, 0xEE, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xEF, 0xFF, 0xFE, 0xEE, 0xDD,
-    0xCD, 0xCD, 0xCD, 0xDD, 0xFF, 0xFE, 0xCE, 0xED, 0xEE, 0xDD, 0xDD, 0xCC,
-    0xDD, 0xCD, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xEE, 0xEF, 0xFF, 0xBE, 0xFF,
-    0xFE, 0xDD, 0xDC, 0xCD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xEF, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFD, 0xEE, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBC, 0xDE, 0xFF, 0xFF, 0xDD, 0xDC, 0xBA, 0x99, 0x98, 0x89,
-    0x9A, 0xAB, 0xDD, 0xFF, 0xFD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x99,
-    0xAC, 0xDE, 0xFF, 0xDD, 0xCB, 0x98, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC,
-    0xDF, 0xED, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xEE,
-    0xDC, 0xBA, 0x97, 0x66, 0x55, 0x45, 0x56, 0x78, 0xAB, 0xCE, 0xED, 0xDB,
-    0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xDE, 0xDC, 0xBA, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xCE, 0xDD, 0xDB, 0xA9, 0x76, 0x65,
-    0x44, 0x55, 0x67, 0x89, 0xBC, 0xDE, 0xDD, 0xCA, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0xAB, 0xDD, 0xEE, 0xEC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBD, 0xEE, 0xEF, 0xDC, 0xB9, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBC,
-    0xDE, 0xEE, 0xFE, 0xDB, 0xAA, 0x98, 0x88, 0x88, 0x9A, 0xAB, 0xCE, 0xFE,
-    0xFF, 0xED, 0xDB, 0xBA, 0xAA, 0x99, 0xAA, 0xBB, 0xCD, 0xEF, 0xEF, 0xFF,
-    0xFE, 0xDC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE,
-    0xED, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE,
-    0xDE, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFE, 0xEE, 0xED, 0xDE,
-    0xED, 0xDE, 0xEE, 0xFE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xBC, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xCD, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xEC, 0xCB, 0xBA, 0xA9, 0x99,
-    0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xBB, 0xCD, 0xDB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xDD, 0xBB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC,
-    0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xA9,
-    0x98, 0x76, 0x65, 0x44, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xCC, 0xCB, 0xBA, 0x99, 0x88, 0x87, 0x88, 0x88, 0x9A, 0xAB, 0xCC,
-    0xDD, 0xCB, 0xBA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCD, 0xED,
-    0xCB, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xDF, 0xED, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDD, 0xDE, 0xFE, 0xED, 0xDC, 0xCB,
-    0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFD, 0xAE, 0xDD, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBB, 0xCC,
-    0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xBC, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBB,
-    0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB,
-    0xAA, 0x99, 0x99, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xCC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCC, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDC, 0xAD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xAB, 0xAA, 0xA9,
-    0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCA, 0xBA, 0x99, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x88, 0x87, 0x77, 0x77,
-    0x78, 0x88, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98,
-    0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x88, 0x77,
-    0x66, 0x66, 0x56, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x98, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0x99, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x78, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89,
-    0xAA, 0xAA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB,
-    0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCC, 0xBC, 0xCB, 0xBA, 0xAA, 0x99, 0x99,
-    0x9A, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xBC, 0xAB, 0xDC,
-    0xBB, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA,
-    0x9A, 0x98, 0x87, 0x66, 0x66, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9,
-    0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB,
-    0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB,
-    0xAA, 0xA9, 0x99, 0x89, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCC, 0xCB, 0xBA,
-    0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xDD, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xAD, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCC, 0xBB, 0xBB, 0xAB, 0xAB, 0xBB, 0xBC, 0xCC, 0xDD, 0xAC, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xBA, 0xBB, 0xBC, 0xCD, 0xDE, 0xFD, 0xCD, 0xCB, 0xBA,
-    0xAA, 0xA9, 0xAA, 0xAA, 0xBC, 0xCD, 0xDE, 0xDB, 0xCC, 0xBA, 0xA9, 0x99,
-    0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBB, 0xDC, 0xBB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC,
-    0xAA, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xAA,
-    0x98, 0x76, 0x65, 0x44, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCB, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xCC, 0xCB, 0xBA, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xAC, 0xCC,
-    0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCD, 0xDD,
-    0xCB, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDC, 0xDE, 0xDD, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xDD, 0xFE, 0xED, 0xDC, 0xCB,
-    0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xED, 0xBD, 0xED, 0xDC, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xFF, 0xFF, 0xEF, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF,
-    0xFF, 0xFE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE,
-    0xDD, 0xDC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xCC, 0xBB,
-    0xBB, 0xBC, 0xCE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xAA, 0x99, 0x9A,
-    0xAB, 0xCD, 0xFF, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0xAB,
-    0xCD, 0xFF, 0xFF, 0xEF, 0xDC, 0xA9, 0x87, 0x77, 0x77, 0x88, 0xAB, 0xCE,
-    0xFF, 0xFE, 0xED, 0xBA, 0x87, 0x66, 0x55, 0x66, 0x79, 0xAC, 0xDF, 0xFF,
-    0xFF, 0xCB, 0x98, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBC, 0xFF, 0xFF, 0xEC,
-    0xB9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xDE, 0xFF, 0xFE, 0xDB, 0x98,
-    0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xFF, 0xED, 0xBA, 0x87, 0x65,
-    0x44, 0x55, 0x78, 0x9B, 0xCE, 0xFF, 0xFF, 0xDC, 0xA9, 0x86, 0x65, 0x55,
-    0x67, 0x8A, 0xBC, 0xEF, 0xFF, 0xFE, 0xDB, 0xA8, 0x87, 0x66, 0x77, 0x89,
-    0xAC, 0xDF, 0xFF, 0xFF, 0xED, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0xAB, 0xCD,
-    0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0xA9, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xFF,
-    0xFF, 0xFF, 0xED, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFE, 0xDD, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xCC, 0xCC, 0xCC, 0xBC, 0xDC, 0xDD, 0xEE, 0xFF, 0xBD, 0xFD,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xFF, 0xED, 0xDC, 0xBB, 0xAA, 0x99,
-    0x99, 0x99, 0xAB, 0xBC, 0xDD, 0xEE, 0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xDF, 0xEC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0x9B, 0xCD, 0xFD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCB, 0x98, 0x77, 0x66, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xDD,
-    0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xCC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xDD, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBB, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xEC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xCC, 0xEE,
-    0xEE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEE, 0xFE,
-    0xDC, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0xFE, 0xDD,
-    0xCC, 0xBC, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xEF, 0xFF, 0xFE, 0xED, 0xDD,
-    0xCD, 0xCC, 0xCE, 0xDE, 0xFE, 0xFE, 0xAF, 0xFE, 0xEE, 0xDD, 0xDD, 0xCD,
-    0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xCE, 0xFE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xEE, 0xDC, 0xCB,
-    0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFD, 0xDC, 0xBB, 0xA9, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xDE, 0xCC, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCD, 0xDC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD,
-    0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x79, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x77, 0x8A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x89, 0xAB, 0xDD, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x89, 0xAB, 0xCD, 0xEE,
-    0xEE, 0xDC, 0xBA, 0xA9, 0x98, 0x89, 0x99, 0xAA, 0xBC, 0xDE, 0xEE, 0xFE,
-    0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFE, 0xDD,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xED, 0xDC,
-    0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xFF, 0xCF, 0xFF, 0xFE, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xBF, 0xFE,
-    0xED, 0xCC, 0xCC, 0xBB, 0xCC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFE, 0xED, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xEF, 0xFF, 0xFD, 0xED, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xBD, 0xDF, 0xFD, 0xDB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0x9B, 0xCD, 0xFF, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xEC, 0xBB, 0x98, 0x77, 0x65, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xDE,
-    0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA,
-    0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x55, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x99, 0xBC, 0xDD, 0xDD, 0xCA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xEE, 0xEC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x89, 0xAB, 0xCD, 0xDD,
-    0xFF, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF,
-    0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFF, 0xFE, 0xED,
-    0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD,
-    0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xCF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDD,
-    0xDD, 0xDE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xEE, 0xEE, 0xDD, 0xDE, 0xDE, 0xEE, 0xEE, 0xFE, 0xEF, 0xAF, 0xFF,
-    0xFE, 0xED, 0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xDC,
-    0xCC, 0xCB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFE, 0xFE, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAB, 0xCC, 0xDE, 0xFF, 0xFF, 0xEE, 0xDC, 0xBA, 0xA9, 0x99, 0x99,
-    0x9A, 0xBC, 0xDE, 0xFF, 0xFE, 0xEC, 0xBA, 0x99, 0x87, 0x77, 0x88, 0x9A,
-    0xBC, 0xDF, 0xFF, 0xED, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBD,
-    0xEF, 0xFD, 0xDC, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xFF,
-    0xDD, 0xBA, 0x98, 0x66, 0x54, 0x45, 0x56, 0x89, 0xAC, 0xDE, 0xED, 0xDB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBD, 0xEE, 0xED, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xFE, 0xDC, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBD, 0xEE, 0xED, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAC, 0xDE, 0xEE, 0xED, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78,
-    0x9B, 0xCD, 0xFE, 0xFF, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDF, 0xFF, 0xFE, 0xDC, 0xBA, 0x99, 0x98, 0x99, 0x9A, 0xBC, 0xDF, 0xFF,
-    0xFF, 0xFE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xEE, 0xDD, 0xDC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE,
-    0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE,
-    0xEE, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xCC, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xBC, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xFE, 0xCC, 0xCB, 0xBA,
-    0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDE, 0xEB, 0xCB, 0xAA, 0x99, 0x98,
-    0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xDD, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x9A, 0xAB, 0xCD, 0xDB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBC, 0xCA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, 0x89, 0xAB, 0xCC,
-    0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x65, 0x44, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x98, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAB, 0xBB, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x77,
-    0x89, 0xAA, 0xBB, 0xBB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xCC, 0xCB, 0xAA, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xBB, 0xCC,
-    0xCD, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCD, 0xDD,
-    0xCB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDD, 0xDE, 0xDC, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDE, 0xFE, 0xED, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xED, 0xAE, 0xDD, 0xDC, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xCC, 0xCD, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xAB, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xBB, 0xBA, 0xA9,
-    0x99, 0x98, 0x89, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x65, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBB,
-    0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB,
-    0xAA, 0xA9, 0x99, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xCD, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xAC, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xAB, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBB, 0xBA, 0xA9,
-    0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0x99, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x88, 0x87, 0x77, 0x77,
-    0x78, 0x89, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xA9, 0x99, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98,
-    0x87, 0x76, 0x66, 0x65, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x88, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89,
-    0xAB, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA,
-    0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xBB, 0xCB,
-    0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xCC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCC, 0xDC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xAB, 0xCC,
-    0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x56, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB,
-    0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xCB,
-    0xAA, 0xA9, 0x99, 0x88, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCC, 0xBA,
-    0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xCC, 0xDC, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xAD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDD, 0xAC, 0xDC,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xCC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDE, 0xEB, 0xCB, 0xAA, 0x99, 0x98,
-    0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xDD, 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x78,
-    0x88, 0x99, 0xAB, 0xCD, 0xCB, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCC, 0xAB, 0xA9, 0x87, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBC, 0xCA, 0xA9, 0x98, 0x77, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9,
-    0x87, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x77,
-    0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xBB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBC, 0xBC, 0xCB, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x89, 0x9A, 0xAB, 0xCC,
-    0xCC, 0xCB, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xCD, 0xDC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xDE, 0xEE, 0xDD, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0xBE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB,
-    0xBB, 0xBC, 0xCC, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF,
-    0xFF, 0xFE, 0xED, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED,
-    0xCC, 0xCC, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xCB, 0xBA,
-    0xAA, 0xBB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xDD, 0xBB, 0xA9, 0x99, 0x99,
-    0xAA, 0xBD, 0xEF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x77, 0x88, 0x9A,
-    0xCD, 0xFF, 0xFF, 0xFE, 0xDB, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xCD,
-    0xFF, 0xFF, 0xDC, 0xB9, 0x87, 0x65, 0x55, 0x56, 0x78, 0xAB, 0xDF, 0xFF,
-    0xFD, 0xCA, 0x98, 0x65, 0x54, 0x45, 0x56, 0x89, 0xBC, 0xEF, 0xFE, 0xDC,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFF, 0xFE, 0xCA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xDF, 0xFF, 0xEC, 0xB9, 0x87, 0x55,
-    0x44, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xFF, 0xDB, 0xA8, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAC, 0xDF, 0xFF, 0xFD, 0xCB, 0x98, 0x76, 0x66, 0x67, 0x89,
-    0xAB, 0xCF, 0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xCD,
-    0xFF, 0xFF, 0xFF, 0xEC, 0xBB, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF,
-    0xFF, 0xFF, 0xDD, 0xCB, 0xBA, 0xAA, 0xAB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFE, 0xDC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xDE, 0xAF, 0xFE,
-    0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xEF, 0xDD, 0xCB,
-    0xBB, 0xAA, 0xAB, 0xBB, 0xCD, 0xEE, 0xFF, 0xEE, 0xED, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xCD, 0xEE, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xEF, 0xED, 0xDC, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCE, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xDE, 0xEC, 0xCB, 0x98, 0x76, 0x65, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCB, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9B, 0xCD, 0xDD, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xDE, 0xED, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE,
-    0xDE, 0xEC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xEF, 0xEE, 0xFE,
-    0xED, 0xCB, 0xBB, 0xAA, 0xAB, 0xBB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xED,
-    0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0xED,
-    0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xAF, 0xEE, 0xEE, 0xED, 0xDD, 0xDD,
-    0xDD, 0xED, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xCC, 0xCC, 0xCC, 0xBC, 0xCC, 0xDD, 0xDD, 0xEE, 0xBE, 0xFE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFF, 0xFE, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xED, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xFE, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAB, 0xCC, 0xDE, 0xDC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDC, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x77, 0x8A, 0xBC, 0xDD,
-    0xBC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xDD, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD,
-    0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xED, 0xEE,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFE, 0xEF, 0xFE, 0xDD,
-    0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xEE, 0xFF, 0xEE, 0xED, 0xDC,
-    0xCC, 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xBE, 0xEE, 0xED, 0xDD, 0xDD, 0xCD,
-    0xCD, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDD, 0xCC, 0xCC, 0xDC, 0xDD, 0xDE, 0xEF, 0xEF, 0xAE, 0xFE,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDB,
-    0xBB, 0xBA, 0xAB, 0xBC, 0xCD, 0xEE, 0xFF, 0xED, 0xED, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xBB, 0xCD, 0xEF, 0xFE, 0xDD, 0xCB, 0xAA, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xEF, 0xED, 0xDB, 0xB9, 0x98, 0x77, 0x77, 0x78, 0x89,
-    0xAB, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAC,
-    0xDE, 0xDC, 0xCB, 0x98, 0x76, 0x65, 0x55, 0x56, 0x77, 0x9A, 0xBC, 0xED,
-    0xCC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xBC, 0xDD, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xCD, 0xDD, 0xDC, 0xB9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xDE, 0xDB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xDD, 0xEE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE,
-    0xFF, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDE, 0xEE, 0xFF,
-    0xDD, 0xCC, 0xBB, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xEE, 0xFF, 0xFE, 0xED,
-    0xDC, 0xCB, 0xCC, 0xCC, 0xCD, 0xEE, 0xFF, 0xEE, 0xFF, 0xFF, 0xFE, 0xED,
-    0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFF, 0xAE, 0xEE, 0xEE, 0xED, 0xED, 0xDD,
-    0xDD, 0xDE, 0xEE, 0xFE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF,
-    0xFF, 0xFF, 0xED, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD,
-    0xCC, 0xCC, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCB, 0xBA,
-    0xAA, 0xBB, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xA9, 0x99, 0x99,
-    0xAB, 0xBD, 0xFF, 0xFF, 0xFF, 0xFD, 0xCA, 0xA9, 0x87, 0x77, 0x88, 0x9A,
-    0xBD, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xCD,
-    0xFF, 0xFF, 0xFC, 0xB9, 0x87, 0x65, 0x55, 0x56, 0x78, 0xAB, 0xDF, 0xFF,
-    0xFD, 0xCA, 0x97, 0x65, 0x54, 0x45, 0x56, 0x89, 0xAC, 0xFF, 0xFF, 0xDC,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCF, 0xFF, 0xFD, 0xCA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xDF, 0xFF, 0xFC, 0xB9, 0x86, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xFF, 0xDB, 0xA8, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAC, 0xEF, 0xFF, 0xFF, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x89,
-    0xAB, 0xCF, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x87, 0x77, 0x89, 0x9B, 0xCD,
-    0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0xA9, 0x99, 0x99, 0xAB, 0xBC, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xED, 0xCB, 0xBA, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xDC, 0xCC, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xCC, 0xCC, 0xBC, 0xBC, 0xCC, 0xDD, 0xDE, 0xEE, 0xAE, 0xEE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFF, 0xFE, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xEF, 0xED, 0xDC, 0xBB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xFE, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xDF, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89,
-    0xAB, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x65,
-    0x54, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9A, 0xBC, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xAC, 0xDD, 0xDD, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xED,
-    0xEE, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xEE, 0xFE,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xEE, 0xEF, 0xFE, 0xDD,
-    0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xDD, 0xEF, 0xEE, 0xFF, 0xFE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFE, 0x9E, 0xED, 0xDD, 0xDD, 0xDC, 0xCC,
-    0xDD, 0xDD, 0xDE, 0xEF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0x9C, 0xDC,
-    0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xED, 0xBC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xDB, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x89, 0x99, 0xAB, 0xBC, 0xDC, 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x78,
-    0x88, 0x99, 0xAB, 0xBC, 0xCA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCC, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x9A,
-    0xAC, 0xCA, 0xA9, 0x98, 0x76, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xBB,
-    0xAA, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x89, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xBB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBC, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xCC, 0xCC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBD, 0xDC, 0xCD, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xCC, 0xEE, 0xDC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xED, 0x9D, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBC, 0xCC, 0xDD, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0x9B, 0xCB,
-    0xBA, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xBB, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAA, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x67, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBA,
-    0xAB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBC, 0xDC, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0x9C, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0x9B, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCD, 0xCA, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x99, 0xAA, 0xCC, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x99, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x9A,
-    0xAC, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBB,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xB9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x87, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAB, 0xAA, 0xBA, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBA, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAB, 0xBC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xCD, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCC, 0xDC, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xAB, 0xBB, 0xCC, 0xCD, 0xDC, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xEF, 0x9E, 0xFE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAB, 0xBB, 0xCD, 0xEE, 0xFF, 0xFD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xEF, 0xEC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89,
-    0xAB, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB,
-    0xDE, 0xEC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0x98, 0x76, 0x65,
-    0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9B, 0xBD, 0xDD, 0xDB, 0xB9, 0x88, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xCD, 0xDD, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED,
-    0xEE, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEE, 0xFE,
-    0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xEF, 0xFE, 0xDD,
-    0xDC, 0xCB, 0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0xDD,
-    0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xAE, 0xFE, 0xEE, 0xED, 0xDD, 0xDD,
-    0xDD, 0xDE, 0xEE, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xED, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC,
-    0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0xAB,
-    0xBC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xBA, 0x99, 0x89, 0x9A, 0xBB,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xBC, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x65, 0x55, 0x67, 0x8A, 0xBC, 0xFF, 0xFF,
-    0xFF, 0xDC, 0xA9, 0x75, 0x44, 0x44, 0x67, 0x9B, 0xCF, 0xFF, 0xFF, 0xFE,
-    0xCA, 0x87, 0x54, 0x33, 0x45, 0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xDC, 0xA9,
-    0x75, 0x43, 0x34, 0x57, 0x8A, 0xCE, 0xFF, 0xFF, 0xFF, 0xCB, 0x97, 0x64,
-    0x44, 0x45, 0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xFD, 0xBA, 0x87, 0x65, 0x55,
-    0x68, 0x9B, 0xCD, 0xFF, 0xFF, 0xFF, 0xDC, 0xB9, 0x87, 0x77, 0x78, 0x9A,
-    0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x89, 0x9A, 0xBC, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFE, 0xDC, 0xBB, 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xCD, 0x9E, 0xFE,
-    0xDD, 0xDD, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFE, 0xFD, 0xDE, 0xED, 0xDC,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xEC, 0xDD, 0xCC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCD, 0xED, 0xED, 0xCD, 0xCC, 0xBA, 0xA9, 0x99, 0x99,
-    0x9A, 0xBB, 0xCD, 0xDF, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x9A,
-    0xBC, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9B, 0xBD, 0xED,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x66, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xED, 0xCD, 0xCA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9B, 0xCC, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xDC, 0xCC, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xED,
-    0xDE, 0xDD, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEE, 0xDC, 0xFE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xDF, 0xEE, 0xDD,
-    0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xED, 0xFF, 0xEE, 0xED, 0xDD,
-    0xDD, 0xDE, 0xEF, 0xEF, 0xFF, 0xEE, 0x9D, 0xDD, 0xCD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDE, 0xEE, 0xFE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDD, 0xDE, 0xAE, 0xEE,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDD, 0xEF, 0xFE, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xEF, 0xED, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xEE, 0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x99, 0xAA, 0xBC, 0xDE, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89,
-    0xAB, 0xCC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x56, 0x77, 0x9A, 0xBC, 0xDD,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x88, 0x76, 0x55, 0x55,
-    0x67, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD,
-    0xDD, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xED,
-    0xDC, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xDF, 0xEE, 0xDC,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFE, 0xFE, 0xFE, 0xDD, 0xDD,
-    0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFE, 0xAE, 0xED, 0xDD, 0xDD, 0xCC, 0xCC,
-    0xCD, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDE, 0x9F, 0xFF,
-    0xED, 0xDD, 0xDD, 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0xEF, 0xED, 0xDC,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xCE, 0xEE, 0xFF, 0xED, 0xED, 0xDC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xFD, 0xDE, 0xDC, 0xBA, 0x99, 0x98, 0x89,
-    0x9A, 0xAB, 0xCD, 0xEF, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x9A,
-    0xBB, 0xCD, 0xED, 0xCD, 0xCB, 0xA8, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xED,
-    0xCD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x66, 0x79, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x76, 0x65,
-    0x45, 0x56, 0x67, 0x9A, 0xBC, 0xDD, 0xDD, 0xCA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x88,
-    0x9A, 0xBD, 0xDD, 0xDD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xCE, 0xDE, 0xED, 0xCB, 0xAA, 0x99, 0x88, 0x89, 0x9A, 0xBC, 0xCD, 0xED,
-    0xEF, 0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEE, 0xDE, 0xFE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFE, 0xDF, 0xFE, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xCC, 0xDE, 0xEE, 0xEF, 0xEE, 0xFF, 0xEF, 0xEE, 0xDE,
-    0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xAE, 0xDD, 0xDD, 0xED, 0xDD, 0xDD,
-    0xDD, 0xDE, 0xEE, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC,
-    0xCC, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCB, 0xAA, 0xAB,
-    0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x99, 0x89, 0x9A, 0xBC,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xBC, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x66, 0x55, 0x67, 0x8A, 0xBD, 0xFF, 0xFF,
-    0xFF, 0xFC, 0xA9, 0x76, 0x44, 0x45, 0x67, 0x9B, 0xCD, 0xFF, 0xFF, 0xFF,
-    0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAC, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9,
-    0x75, 0x43, 0x24, 0x57, 0x8A, 0xCE, 0xFF, 0xFF, 0xFF, 0xCB, 0x97, 0x65,
-    0x44, 0x46, 0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xFD, 0xBA, 0x87, 0x65, 0x56,
-    0x68, 0x9B, 0xCD, 0xFF, 0xFF, 0xFF, 0xDC, 0xB9, 0x87, 0x77, 0x78, 0x9A,
-    0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x99, 0x89, 0x9A, 0xBC, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xCD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDD, 0x9E, 0xFE,
-    0xDD, 0xDC, 0xCC, 0xBC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFE, 0xDE, 0xDD, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xED, 0xED, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xEE, 0xDD, 0xCC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x88, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x99, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x34, 0x55, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x34, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x56, 0x68, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x77, 0x88,
-    0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC,
-    0xDE, 0xDD, 0xEC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBB, 0xCD, 0xED,
-    0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xED, 0xEE,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xEE, 0xEF, 0xFE, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xED, 0xFF, 0xEE, 0xED, 0xDD,
-    0xCD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0x8E, 0xDD, 0xDD, 0xCC, 0xCC, 0xCD,
-    0xDD, 0xDD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x9B, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xEC, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCD, 0xBB, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xAB, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBB,
-    0x9A, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xA9, 0xA9,
-    0x87, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x89, 0xAA, 0xBA, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xBB, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCC, 0xBC, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xCC, 0xDD, 0xDC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xEC, 0x8C, 0xBB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCB,
-    0xBA, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xAB, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x67, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x67, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBA,
-    0xAB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB,
-    0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBB, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0x8B, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xDC, 0xBC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCB, 0xBA, 0x99, 0x98,
-    0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x88,
-    0x88, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xBA,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xBC, 0xBB, 0xCB, 0xAA, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xCC, 0xCC, 0xBD, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xCD, 0xCC, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xDC, 0x8C, 0xBB, 0xBB, 0xBB, 0xAA, 0xAA,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xCD, 0xDD, 0x8E, 0xFE,
-    0xED, 0xDD, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFD, 0xDE, 0xED, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEE, 0xEF, 0xED, 0xDD, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xFD, 0xDD, 0xDC, 0xBA, 0xA9, 0x99, 0x99,
-    0x9A, 0xBB, 0xCD, 0xEE, 0xEC, 0xDC, 0xBA, 0xA9, 0x88, 0x77, 0x88, 0x9A,
-    0xBC, 0xCE, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xED,
-    0xCC, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x34, 0x45, 0x68, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98,
-    0x65, 0x44, 0x34, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x65,
-    0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDD, 0xDD, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCE, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x77, 0x89,
-    0xAB, 0xCC, 0xDD, 0xDD, 0xDB, 0xAA, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC,
-    0xDE, 0xDD, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xED,
-    0xDE, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xED, 0xFF,
-    0xED, 0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEE, 0xFE, 0xDF, 0xFE, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFD, 0xFF, 0xFE, 0xEE, 0xED,
-    0xDD, 0xDD, 0xEE, 0xEE, 0xFF, 0xFF, 0x9D, 0xDD, 0xDE, 0xDD, 0xDD, 0xCD,
-    0xDD, 0xEE, 0xDE, 0xEF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xFE, 0xEE, 0xDE, 0xDD, 0xDD, 0xDD, 0xED, 0xDD, 0xDD, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE,
-    0xDD, 0xDD, 0xCD, 0xDD, 0xDE, 0xEF, 0xFF, 0xEE, 0xFF, 0xED, 0xDC, 0xCB,
-    0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xFE, 0xEF, 0xED, 0xCC, 0xBA, 0xAA, 0xAA,
-    0xBB, 0xCD, 0xEE, 0xFF, 0xFE, 0xEE, 0xDC, 0xBA, 0x98, 0x88, 0x99, 0xAB,
-    0xCD, 0xDE, 0xFE, 0xEF, 0xDC, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xFF, 0xEE, 0xED, 0xCA, 0x98, 0x76, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFF,
-    0xEE, 0xCB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBD, 0xDF, 0xEE, 0xED,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xDE, 0xCB, 0xA8,
-    0x75, 0x43, 0x24, 0x57, 0x8A, 0xBD, 0xEF, 0xED, 0xED, 0xBA, 0x97, 0x65,
-    0x44, 0x46, 0x78, 0xAB, 0xDD, 0xFE, 0xDF, 0xDC, 0xA9, 0x87, 0x65, 0x56,
-    0x78, 0x9A, 0xCD, 0xEF, 0xEE, 0xED, 0xDB, 0xA9, 0x87, 0x77, 0x78, 0x9A,
-    0xBC, 0xDF, 0xFE, 0xDF, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBB, 0xDD,
-    0xFF, 0xFD, 0xFE, 0xDD, 0xCB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDD, 0xFE, 0xFE,
-    0xDF, 0xEE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFD, 0xFE,
-    0xFE, 0xDD, 0xDC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xDF, 0xFE, 0xFF,
-    0xEE, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xED, 0xFE, 0xEF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0x9E, 0xFE,
-    0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEE, 0xEE, 0xDE, 0xDD, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDD, 0xEF, 0xED, 0xDD, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xED, 0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x89,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x78, 0x99, 0xAB,
-    0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x97, 0x66, 0x54, 0x45, 0x66, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xDD, 0xCC, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x86, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xAA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9A, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x89, 0x9A, 0xBC, 0xCD, 0xEE,
-    0xDD, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xED, 0xEE,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xDE, 0xEE, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xED, 0xFF, 0xEE, 0xEE, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0x9D, 0xED, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDD, 0xAE, 0xEE,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xDE, 0xED, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xBC, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAA, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x56, 0x78, 0x89, 0xAB, 0xDC,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBC, 0xAA, 0x88, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9A, 0xBC, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xCD, 0xDC, 0xCC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xDD,
-    0xCD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xED,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xDE, 0xDD, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xED, 0xFE, 0xED, 0xDD, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFE, 0xAD, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC,
-    0xCD, 0xDD, 0xDE, 0xEE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0x9E, 0xFE,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xED, 0xDE, 0xED, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xDD, 0xED, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xED, 0xDD, 0xCC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xCD, 0xDE, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xCC, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9A, 0xBC, 0xDC, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBB, 0xCD, 0xED,
-    0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xDD, 0xED,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xDF, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xDD, 0xEE, 0xEE, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFE, 0x9D, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC,
-    0xCD, 0xDD, 0xDD, 0xDE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xFE, 0xFD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xEE, 0xFE, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xEE, 0xDD,
-    0xDD, 0xDD, 0xFE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFE, 0xFD, 0xCC, 0xBB, 0xBC,
-    0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0xBA, 0xAA, 0xAB, 0xCD,
-    0xDE, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xCD, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xEC, 0xA9, 0x86, 0x66, 0x78, 0x9B, 0xCE, 0xFF, 0xFF,
-    0xFF, 0xED, 0xCA, 0x86, 0x54, 0x45, 0x78, 0xAC, 0xDE, 0xFF, 0xFF, 0xFF,
-    0xCB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xEF, 0xFE, 0xBA,
-    0x86, 0x42, 0x24, 0x68, 0xAC, 0xDE, 0xFF, 0xFF, 0xFE, 0xDC, 0xA8, 0x75,
-    0x44, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0x98, 0x76, 0x66,
-    0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF, 0xED, 0xCA, 0x98, 0x88, 0x89, 0xAB,
-    0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xBB, 0xAA, 0xAA, 0xAB, 0xCD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xED, 0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9E, 0xFE, 0xFF, 0xEF, 0xFF, 0xFE,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCD, 0xDD, 0x9D, 0xFE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xFE, 0xDE, 0xDD, 0xCC,
-    0xBB, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xEE, 0xED, 0xDD, 0xCB, 0xAA, 0xA9,
-    0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xBC, 0xDE, 0xDC, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB,
-    0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xBB, 0xA9, 0x87, 0x66, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xCB, 0xBA,
-    0x98, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xAB, 0xCC, 0xBC, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xCA, 0x98, 0x76, 0x65,
-    0x54, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xCA, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBB,
-    0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xDD,
-    0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDE, 0xDD, 0xED,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xFE, 0xDE, 0xED, 0xDC,
-    0xCC, 0xCB, 0xBB, 0xCC, 0xDD, 0xDE, 0xEF, 0xED, 0xEF, 0xEE, 0xDD, 0xDD,
-    0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFE, 0x8D, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC,
-    0xCC, 0xCD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0x9C, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCB, 0xAA, 0x99, 0x98,
-    0x88, 0x99, 0x99, 0xAB, 0xBC, 0xDC, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xBB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCB, 0xDC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDE, 0xCC, 0xED, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xED, 0x8C, 0xCC, 0xBB, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDB, 0xBB, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78,
-    0x88, 0x89, 0xAA, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAA, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x67, 0x77,
-    0x89, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB,
-    0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBA, 0xCB,
-    0xAA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xCC, 0xCB, 0xBB, 0xBA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0x9C, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x98,
-    0x88, 0x89, 0x99, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x78,
-    0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9,
-    0x87, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x56,
-    0x67, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xBC, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDB, 0xBD, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCC, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDC, 0x8C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDC, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCD, 0x8D, 0xEE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xEE, 0xFD, 0xDD, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xEF, 0xDD, 0xDC, 0xCB, 0xAA, 0xA9,
-    0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xED, 0xCC, 0xCB, 0xAA, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xBC, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAB, 0xCC, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xCB, 0xBB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xBB, 0xA9, 0x87, 0x66, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x54, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xBC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x88, 0x9B, 0xBD, 0xCC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCD, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xAB,
-    0xCD, 0xCC, 0xDC, 0xBB, 0xA9, 0x98, 0x88, 0x89, 0x99, 0xAB, 0xCD, 0xDD,
-    0xDD, 0xCC, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDE, 0xDD, 0xED,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xEE, 0xDE, 0xDD, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xFF, 0xDE, 0xDD, 0xDC,
-    0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0x9D, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC,
-    0xCD, 0xDD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xFF, 0xFE, 0xEF, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xEE, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD,
-    0xDD, 0xDD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xEF, 0xFF, 0xFD, 0xDC, 0xCC,
-    0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFE, 0xFF, 0xFE, 0xDC, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xCD, 0xEF, 0xFF, 0xEF, 0xDC, 0xBA, 0x98, 0x76, 0x77, 0x89, 0xAB, 0xCD,
-    0xFF, 0xEE, 0xED, 0xCA, 0x98, 0x66, 0x55, 0x66, 0x89, 0xAB, 0xDE, 0xFF,
-    0xEE, 0xDB, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xCD, 0xFF, 0xFE, 0xFD,
-    0xBA, 0x86, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xDE, 0xDB, 0xA8,
-    0x75, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xEF, 0xFE, 0xFD, 0xBA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xEE, 0xDC, 0xA9, 0x87, 0x65, 0x55,
-    0x68, 0x9A, 0xCD, 0xFF, 0xFE, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x9A,
-    0xBC, 0xEF, 0xFF, 0xEF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDF,
-    0xFF, 0xFD, 0xFE, 0xDC, 0xCB, 0xAA, 0x9A, 0xAA, 0xBC, 0xDF, 0xFF, 0xFF,
-    0xDF, 0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xCD, 0xDD, 0xFF, 0xFF, 0xFD, 0xFF,
-    0xFE, 0xED, 0xDC, 0xDC, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xEE,
-    0xEF, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xCD, 0xDE, 0xDD, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xDD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0x9E, 0xFE,
-    0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFD, 0xEE, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xED, 0xCC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFD, 0xDE, 0xCC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xCD, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0xA8, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCD, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAC, 0xCE, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x89,
-    0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xEC, 0xDD, 0xCB, 0xAA, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xDE, 0xEE,
-    0xDD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEF, 0xEC, 0xED,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFE, 0xDF, 0xEE, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCD, 0xED, 0xFE, 0xFF, 0xFC, 0xFF, 0xFE, 0xED, 0xDD,
-    0xDD, 0xDD, 0xEE, 0xFE, 0xFF, 0xFF, 0x9D, 0xED, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xED, 0xDE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDD, 0xAE, 0xEE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xEE, 0xDE, 0xDD, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xED, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xBC, 0xCD, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89,
-    0xAA, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xDC,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x54, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBC, 0xAA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9A, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED,
-    0xCD, 0xCC, 0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xED, 0xED,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFE, 0xDE, 0xDD, 0xCC,
-    0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFF, 0xED, 0xFE, 0xED, 0xDD, 0xCC,
-    0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFF, 0xAD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC,
-    0xCD, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0x9E, 0xFF,
-    0xEE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFD, 0xEF, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xDD, 0xED, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xCC, 0xDD, 0xED, 0xDE, 0xDC, 0xBA, 0xA9, 0x98, 0x89,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0xA8, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBB,
-    0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC,
-    0xCD, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBB, 0xCD, 0xDD,
-    0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xDD, 0xED,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0xDE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xDD, 0xFE, 0xEE, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFE, 0x9D, 0xDD, 0xDD, 0xDD, 0xDD, 0xCC,
-    0xDD, 0xDD, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDD, 0xDC, 0xCC, 0xDD, 0xCD, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xDE, 0xEE, 0xDF, 0xEF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFF,
-    0xDD, 0xDC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFF, 0xDF, 0xFF, 0xEE, 0xDC, 0xCB,
-    0xBB, 0xBC, 0xCD, 0xDD, 0xFF, 0xFE, 0xFF, 0xFD, 0xDC, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xCD, 0xEE, 0xFF, 0xEE, 0xEE, 0xCC, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xCC, 0xEF, 0xFF, 0xFF, 0xDC, 0xBA, 0x88, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xEF, 0xFE, 0xED, 0xCA, 0x97, 0x65, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFE,
-    0xEE, 0xDB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xEE, 0xED, 0xFC,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9B, 0xDE, 0xFF, 0xDD, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x57, 0x8A, 0xBC, 0xEF, 0xFD, 0xDC, 0xBA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xDE, 0xDC, 0xA9, 0x87, 0x65, 0x55,
-    0x68, 0x9A, 0xCD, 0xEF, 0xFD, 0xED, 0xCB, 0xA9, 0x87, 0x77, 0x78, 0x9A,
-    0xBC, 0xEF, 0xFF, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDD,
-    0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDD, 0xEF, 0xFF,
-    0xEF, 0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFE, 0xFE,
-    0xEE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDF, 0xEF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF,
-    0xEE, 0xED, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDE, 0xED, 0xDE, 0xFF,
-    0xEF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xDD, 0xDC, 0xCC, 0xCC, 0xCB, 0xCC, 0xCC, 0xCC, 0xCD, 0x8E, 0xFE,
-    0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xEE, 0xEF, 0xFD, 0xDE, 0xED, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xED, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFD, 0xDD, 0xCC, 0xBA, 0x99, 0x99, 0x99,
-    0x9A, 0xAB, 0xCD, 0xEE, 0xDC, 0xDC, 0xBA, 0x98, 0x88, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xCC, 0xCA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBB,
-    0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x98, 0x66, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x34, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x56, 0x68, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9A, 0xBC, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBC, 0xCD, 0xEE,
-    0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xDF, 0xED, 0xED,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xDE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xED, 0xFE, 0xEE, 0xED, 0xDD,
-    0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xCC, 0xCC, 0xDC, 0xCD,
-    0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0x8C, 0xDD,
-    0xCB, 0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDC, 0xCC, 0xCB, 0xBA,
-    0xAA, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xDD, 0xCB, 0xCB, 0xBA, 0xA9, 0x99,
-    0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xCC, 0xBB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBC, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCB,
-    0xAA, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAB, 0xBA, 0xA9,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0x9A, 0xBB, 0xAA, 0x99, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x78, 0x99, 0xAB, 0xBA, 0xAA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x89, 0xAA, 0xBB, 0xAA, 0xA9, 0x88, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x89, 0xAB, 0xCB, 0xBB, 0xAA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xBC, 0xBB, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC,
-    0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x89, 0x99, 0xAA, 0xBB, 0xCD, 0xCB, 0xCC,
-    0xCB, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xBD, 0xDC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDE, 0xCC, 0xDD, 0xDC, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xCC, 0xCD, 0xDD, 0xED, 0x8C, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x9B, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBC, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBB, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78,
-    0x88, 0x99, 0xAA, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAA, 0xBA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB,
-    0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xDC, 0xCB, 0xBB, 0xBA,
-    0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBC, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0x8C, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0xBD, 0xCB, 0xBA,
-    0xAA, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCB, 0xCB, 0xBA, 0xA9, 0x99,
-    0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDB, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x88,
-    0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBB, 0xBA, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBB,
-    0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xBB, 0xBA, 0xA9,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAA, 0xBB, 0xAA, 0x99, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x99, 0xAB, 0xBA, 0xAA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x89, 0x9A, 0xBB, 0xAB, 0xA9, 0x88, 0x76, 0x65, 0x56,
-    0x67, 0x78, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x89, 0xAB, 0xBB, 0xBB, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xBC, 0xBB, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xCB, 0xDC,
-    0xBB, 0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDC, 0xCD, 0xCC, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDD, 0xCC, 0xDD, 0xCC, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xCC, 0xCC, 0xDE, 0xED, 0x8C, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xEE, 0xED, 0xDC, 0xCC, 0xBC, 0xCC, 0xCC, 0xDC, 0xCD, 0x7E, 0xFF,
-    0xEE, 0xDD, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xEF, 0xFD, 0xEF, 0xED, 0xDC,
-    0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xEE, 0xFF, 0xED, 0xEE, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFE, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99,
-    0x9A, 0xAB, 0xCD, 0xEF, 0xED, 0xEC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x9A,
-    0xBB, 0xDD, 0xED, 0xDD, 0xCB, 0x99, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xBC,
-    0xCE, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xED,
-    0xCC, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x34, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x34, 0x56, 0x79, 0xAB, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCE, 0xDD, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x77, 0x89,
-    0xAB, 0xCD, 0xED, 0xDD, 0xCB, 0xAA, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC,
-    0xDF, 0xED, 0xED, 0xCB, 0xAA, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xDE, 0xEF,
-    0xDE, 0xDD, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFE, 0xFD, 0xFE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xDF, 0xEF, 0xED,
-    0xDD, 0xCC, 0xCC, 0xCD, 0xEE, 0xFE, 0xFF, 0xFD, 0xEF, 0xEE, 0xFE, 0xDD,
-    0xDD, 0xED, 0xEE, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xED, 0xFE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, 0xDD, 0xDD, 0xDD, 0xCC, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xFE, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xCD, 0xDC, 0xDD, 0xDD, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xDC, 0xCC,
-    0xBC, 0xBC, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xBB, 0xAA, 0xAA,
-    0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xCC, 0xDE, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAB, 0xDD,
-    0xFF, 0xFF, 0xFE, 0xCB, 0x98, 0x65, 0x55, 0x67, 0x89, 0xAC, 0xDF, 0xFF,
-    0xFF, 0xDB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xCD, 0xFF, 0xFF, 0xFD,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFF, 0xEF, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x57, 0x8A, 0xBD, 0xFF, 0xFE, 0xFD, 0xCA, 0x97, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDD, 0xFF, 0xEF, 0xDC, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x9A, 0xCE, 0xFF, 0xFE, 0xFF, 0xDB, 0xA9, 0x87, 0x76, 0x77, 0x9A,
-    0xBC, 0xFF, 0xFF, 0xEF, 0xFC, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDF,
-    0xFF, 0xFE, 0xFE, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDE, 0xFF, 0xFF,
-    0xDF, 0xFE, 0xDC, 0xDC, 0xBB, 0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFD, 0xFF,
-    0xFE, 0xED, 0xDD, 0xDC, 0xDE, 0xFE, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF,
-    0xEF, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDC, 0xDC, 0xDE, 0xFE, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xEE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF,
-    0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xFE, 0xED, 0xFF, 0xFE, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xDD, 0xEE, 0xDC, 0xCB, 0xBB,
-    0xAB, 0xBB, 0xBC, 0xCD, 0xDE, 0xED, 0xDE, 0xDD, 0xCB, 0xAA, 0x99, 0x99,
-    0xAA, 0xBC, 0xCD, 0xEE, 0xDD, 0xDD, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0x9A,
-    0xBC, 0xDD, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDD, 0xDC, 0xBA, 0x87, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDD,
-    0xCD, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xAC, 0xDE, 0xDC, 0xDB,
-    0xA9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xCD, 0xDD, 0xCD, 0xCA, 0x98,
-    0x75, 0x43, 0x34, 0x56, 0x89, 0xAC, 0xCE, 0xDC, 0xDC, 0xBA, 0x87, 0x65,
-    0x44, 0x55, 0x78, 0x9A, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x8A, 0xBC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x76, 0x77, 0x89,
-    0xAB, 0xCD, 0xEE, 0xCD, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xCD,
-    0xDF, 0xDC, 0xED, 0xCB, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xBC, 0xEF, 0xFE,
-    0xCE, 0xDD, 0xCC, 0xBB, 0xAA, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xED, 0xED,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xDE, 0xEE, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFD, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xED, 0xEE, 0xEF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xAE, 0xFE,
-    0xED, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xEE, 0xDD, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDC, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xDB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED,
-    0xCD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEC, 0xDD,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFE, 0xCE, 0xDD, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFC, 0xEE, 0xDD, 0xDC, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0x9D, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
-    0xDD, 0xDE, 0xEE, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF,
-    0xEE, 0xDD, 0xDC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEE, 0xED, 0xFF, 0xFD, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDF, 0xFE, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFD, 0xEF, 0xDC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDE, 0xEC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xAB, 0xCD, 0xED, 0xDD, 0xCB, 0xA8, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xDD, 0xDD, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDD,
-    0xDD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xED, 0xCD, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xDE, 0xEC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0xAB, 0xCD, 0xEE, 0xDD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xEF, 0xED, 0xDD, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBC, 0xDE, 0xFE,
-    0xDD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFD, 0xFE,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xDE, 0xDD, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFD, 0xFE, 0xED, 0xDD, 0xED,
-    0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDC, 0xDD, 0xCD, 0xDD, 0xDE,
-    0xDE, 0xEF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD, 0xDC, 0xDD, 0xCC, 0xCC, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xDD, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xDD, 0xCB,
-    0xBB, 0xBC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xBA, 0xAA, 0xAA,
-    0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xCC, 0xDF, 0xFF, 0xFF, 0xDC, 0xBA, 0x97, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xFF, 0xFF, 0xFD, 0xCB, 0x98, 0x65, 0x55, 0x67, 0x89, 0xBC, 0xDF, 0xFF,
-    0xFF, 0xDC, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xFF, 0xFD,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xDC, 0x98,
-    0x75, 0x43, 0x34, 0x56, 0x8A, 0xCD, 0xFF, 0xFF, 0xFD, 0xCA, 0x97, 0x65,
-    0x44, 0x45, 0x78, 0xAC, 0xDF, 0xFF, 0xEF, 0xDC, 0xA9, 0x87, 0x65, 0x55,
-    0x68, 0x9A, 0xCE, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x87, 0x77, 0x78, 0x9A,
-    0xBC, 0xDF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDF,
-    0xFF, 0xFD, 0xFF, 0xDD, 0xBB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDE, 0xFF, 0xFF,
-    0xDF, 0xFD, 0xDD, 0xCB, 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFF, 0xFD, 0xFF,
-    0xDF, 0xDD, 0xDC, 0xDC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFE,
-    0xEF, 0xEF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xCD, 0xDD, 0xED, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xEF, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD, 0x7F, 0xFF,
-    0xFF, 0xFE, 0xED, 0xEE, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xDC, 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFF, 0xEF, 0xFF, 0xFD, 0xDC, 0xCB,
-    0xBB, 0xBC, 0xCD, 0xCF, 0xFF, 0xFE, 0xFF, 0xFD, 0xDB, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFD, 0xDC, 0xAA, 0x99, 0x89, 0x99, 0xAB,
-    0xBC, 0xDF, 0xFF, 0xFD, 0xDC, 0xBA, 0x98, 0x77, 0x78, 0x89, 0xAB, 0xCD,
-    0xFF, 0xEF, 0xED, 0xCA, 0x98, 0x76, 0x56, 0x67, 0x89, 0xBC, 0xDE, 0xFE,
-    0xDE, 0xCB, 0xA9, 0x76, 0x54, 0x45, 0x68, 0x9A, 0xBC, 0xEF, 0xEE, 0xED,
-    0xBA, 0x87, 0x64, 0x23, 0x46, 0x78, 0xAB, 0xDD, 0xFE, 0xFE, 0xDB, 0xA9,
-    0x76, 0x43, 0x24, 0x57, 0x8A, 0xBD, 0xDE, 0xED, 0xFD, 0xBA, 0x98, 0x65,
-    0x44, 0x56, 0x79, 0xAB, 0xCD, 0xFF, 0xDD, 0xDC, 0xB9, 0x87, 0x66, 0x56,
-    0x78, 0x9A, 0xBD, 0xEF, 0xFD, 0xFD, 0xCB, 0xA9, 0x88, 0x77, 0x78, 0x9A,
-    0xBC, 0xDE, 0xFF, 0xDE, 0xDC, 0xBB, 0xA9, 0x98, 0x89, 0x9A, 0xAC, 0xDE,
-    0xFF, 0xFE, 0xFE, 0xDD, 0xCB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xFF,
-    0xDF, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xDD, 0xFF, 0xFF, 0xFD, 0xFF,
-    0xEF, 0xDD, 0xDC, 0xCC, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xEE,
-    0xEE, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xED,
-    0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xCC, 0xDD, 0xDC, 0xCE,
-    0xEF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xCC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBA, 0xBB, 0xBB, 0x8D, 0xED,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEC, 0xCD, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCC, 0xDC, 0xBA, 0xA9, 0x99,
-    0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDC, 0xBC, 0xBA, 0xA9, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xCD, 0xBB, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89,
-    0x9A, 0xBC, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x66, 0x67, 0x78, 0x89, 0x9A,
-    0xBC, 0xBB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCB,
-    0xAB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xBA, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCB, 0xAB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xBA, 0xBA, 0x98, 0x77, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0xA9, 0x87, 0x77, 0x66, 0x66, 0x78,
-    0x89, 0xAB, 0xCC, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xBC, 0xCB, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x89, 0xAA, 0xBC, 0xDC,
-    0xBC, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xDD, 0xDB, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xED, 0xCD, 0xCC, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xEC, 0xDD, 0xDD, 0xCC, 0xCC,
-    0xCB, 0xCC, 0xCD, 0xDE, 0xEE, 0xFE, 0x8C, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB,
-    0xCC, 0xCC, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x9B, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBC, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xBC, 0xBB, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78,
-    0x88, 0x99, 0x9A, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAA, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xBA, 0xBA, 0x99, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB,
-    0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBB,
-    0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCC, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCC, 0xCB, 0xBB, 0xBA,
-    0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBC, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xCC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAB, 0xAB, 0xBB, 0xBC, 0x8D, 0xED,
-    0xCC, 0xCB, 0xBA, 0xBA, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0xCD, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCC, 0xCB, 0xBA, 0xA9, 0x99,
-    0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89,
-    0x9A, 0xAB, 0xCB, 0xBB, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBC, 0xBA, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCB,
-    0xAB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBA, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xBB, 0xAA, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xAB, 0xBA, 0xBA, 0x98, 0x77, 0x65,
-    0x55, 0x56, 0x67, 0x89, 0xAB, 0xBB, 0xAB, 0xA9, 0x88, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9A, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x78,
-    0x89, 0xAB, 0xCB, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAA,
-    0xBC, 0xCB, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xDC,
-    0xBC, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xCB, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xBD, 0xCC, 0xCC,
-    0xBB, 0xBA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDE, 0xDC, 0xED, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0x8C, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xCC, 0xCD, 0xDD, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xEF, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xDD, 0xDC, 0xDE, 0xDE, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE,
-    0xDD, 0xCC, 0xBC, 0xCC, 0xDE, 0xEE, 0xFF, 0xEF, 0xFE, 0xED, 0xCB, 0xBB,
-    0xAB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFE, 0xEF, 0xED, 0xCB, 0xAA, 0x99, 0x9A,
-    0xAB, 0xBC, 0xDE, 0xEF, 0xED, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9A,
-    0xBC, 0xDE, 0xFD, 0xEE, 0xDB, 0xA9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xEF, 0xED, 0xEC, 0xBA, 0x87, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xEE,
-    0xDE, 0xCB, 0x98, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDF, 0xED, 0xDC,
-    0xB9, 0x86, 0x54, 0x33, 0x45, 0x78, 0x9B, 0xCD, 0xED, 0xDD, 0xCB, 0x98,
-    0x75, 0x43, 0x34, 0x57, 0x89, 0xBC, 0xDE, 0xFD, 0xDD, 0xBA, 0x87, 0x65,
-    0x44, 0x46, 0x78, 0x9B, 0xCD, 0xEF, 0xEE, 0xCB, 0xA9, 0x87, 0x65, 0x56,
-    0x67, 0x8A, 0xBC, 0xDF, 0xFE, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x89,
-    0xAC, 0xCE, 0xEF, 0xDE, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x89, 0xAB, 0xCD,
-    0xEF, 0xFD, 0xED, 0xDC, 0xBB, 0xA9, 0xA9, 0x9A, 0xBB, 0xCD, 0xEF, 0xFF,
-    0xEF, 0xED, 0xCC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xFF,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xDE, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE, 0xEE,
-    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDE, 0xDC, 0xED, 0xDD, 0xDE,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xCC, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB,
-    0xCE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xAA, 0xAB, 0xBC,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x98, 0x89, 0xAB, 0xCD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x87, 0x66, 0x78, 0xAB, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDB, 0x97, 0x54, 0x45, 0x79, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFC, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA,
-    0x96, 0x42, 0x24, 0x68, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, 0x75,
-    0x43, 0x57, 0x9A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xA8, 0x76, 0x67,
-    0x89, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x9A, 0xBC,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0xAA, 0xAB, 0xBD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBB, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xDC, 0xDD, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xDF, 0xDD, 0xDD, 0xCC, 0xDB, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF,
-    0xFE, 0xFD, 0xDD, 0xCC, 0xCC, 0xDD, 0xDD, 0xDE, 0xFD, 0xFF, 0xFF, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xDD, 0xDD, 0xFF, 0xDF, 0xFD, 0xDD, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xAC, 0xCC, 0xFF, 0xFD, 0xFF, 0xDD, 0xCA, 0xA9, 0x99, 0x99,
-    0x9A, 0xAB, 0xCD, 0xEF, 0xDF, 0xDD, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x99,
-    0xAC, 0xCD, 0xFD, 0xDE, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x78, 0x9A, 0xBC,
-    0xDF, 0xED, 0xEC, 0xA9, 0x87, 0x66, 0x55, 0x67, 0x78, 0x9B, 0xBE, 0xFF,
-    0xDD, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAC, 0xDF, 0xFD, 0xCB,
-    0xA9, 0x86, 0x54, 0x34, 0x45, 0x78, 0x9A, 0xBD, 0xEF, 0xDC, 0xBA, 0x98,
-    0x65, 0x43, 0x34, 0x56, 0x89, 0xAC, 0xDE, 0xFC, 0xDB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x78, 0x9A, 0xBD, 0xDF, 0xDD, 0xBB, 0xA8, 0x77, 0x65, 0x55,
-    0x67, 0x8A, 0xAC, 0xDF, 0xFC, 0xDC, 0xBA, 0x98, 0x77, 0x76, 0x77, 0x89,
-    0xAB, 0xCE, 0xEF, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88, 0x89, 0xAB, 0xCD,
-    0xDF, 0xFD, 0xED, 0xCB, 0xBA, 0xA9, 0x99, 0x9A, 0xAA, 0xCD, 0xFF, 0xFF,
-    0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFD, 0xFD,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xDD, 0xFE, 0xFF, 0xFF, 0xCE, 0xED, 0xED,
-    0xDC, 0xCC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xEF, 0xEF,
-    0xEF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDE, 0xEF, 0xDF, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xAF, 0xFF,
-    0xED, 0xDC, 0xCC, 0xBB, 0xBC, 0xCC, 0xCD, 0xDE, 0xED, 0xFF, 0xED, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xEF, 0xFD, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xDD, 0xEE, 0xDB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xCD, 0xDD, 0xDC, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCB, 0x98, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAC, 0xCD,
-    0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9B, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xEE, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAC,
-    0xDE, 0xFC, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A, 0xAB, 0xCE, 0xFF,
-    0xDD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xFD, 0xED,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xEF, 0xFF, 0xDE, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFD, 0xFE, 0xED, 0xDD, 0xDC,
-    0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xAD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xEE, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xDD, 0xDD, 0xDD, 0xDC, 0xCC, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xDD, 0xDE, 0xED, 0xDD, 0xDD, 0xFF, 0xFD, 0xFF, 0xFF, 0xFD,
-    0xCC, 0xCC, 0xCC, 0xCB, 0xCD, 0xDE, 0xEF, 0xDF, 0xFF, 0xEC, 0xDB, 0xBB,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xDF, 0xFD, 0xFF, 0xFD, 0xCB, 0xA9, 0x99, 0x99,
-    0xAA, 0xBC, 0xDD, 0xEF, 0xDF, 0xED, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x9A,
-    0xBC, 0xCC, 0xFD, 0xFE, 0xDB, 0xA9, 0x87, 0x76, 0x77, 0x78, 0x9A, 0xBC,
-    0xDE, 0xDF, 0xFC, 0xBA, 0x87, 0x66, 0x55, 0x67, 0x78, 0x9B, 0xBD, 0xFE,
-    0xEF, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCE, 0xED, 0xDC,
-    0xA9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9A, 0xBC, 0xED, 0xED, 0xBA, 0x98,
-    0x75, 0x43, 0x34, 0x57, 0x89, 0xAC, 0xDD, 0xED, 0xDC, 0xA9, 0x87, 0x65,
-    0x44, 0x56, 0x78, 0x9A, 0xBD, 0xFF, 0xFF, 0xCB, 0xA9, 0x87, 0x65, 0x56,
-    0x67, 0x89, 0xBC, 0xDF, 0xED, 0xDC, 0xBA, 0x98, 0x87, 0x76, 0x77, 0x89,
-    0xAB, 0xCE, 0xFF, 0xCE, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xDD,
-    0xFF, 0xFF, 0xFD, 0xCB, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xCD, 0xDF, 0xFF,
-    0xDF, 0xEE, 0xCC, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDF, 0xFF, 0xFE, 0xFD,
-    0xDD, 0xCC, 0xBB, 0xCC, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xDD, 0xDE, 0xDD,
-    0xDC, 0xCD, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFC, 0xFF, 0xED, 0xDD, 0xDD,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xCD, 0xCD, 0xDD, 0xEE, 0xDE,
-    0xFE, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xBB, 0xBC, 0xCD,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x99, 0x99, 0xAB, 0xCF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x97, 0x77, 0x89, 0xBC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDC, 0x97, 0x54, 0x46, 0x8A, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xB9, 0x74, 0x12, 0x57, 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB,
-    0x97, 0x42, 0x24, 0x79, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xB9, 0x86,
-    0x44, 0x57, 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, 0x87, 0x77,
-    0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xAA, 0x99, 0x9A, 0xCF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCC, 0xBB, 0xBB, 0xCF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFD, 0xDC, 0xDD, 0xCD, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
-    0xCC, 0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBB, 0xBC,
-    0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xA9, 0xAA, 0xBC,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xA9, 0x88, 0x88, 0x9A, 0xBD, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFB, 0xB9, 0x87, 0x66, 0x78, 0x9A, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xCA, 0x87, 0x54, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xDB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA,
-    0x86, 0x42, 0x24, 0x68, 0xAB, 0xCD, 0xFF, 0xFF, 0xFF, 0xDB, 0xA8, 0x75,
-    0x44, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x98, 0x76, 0x66,
-    0x79, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xCF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFC, 0xBA, 0xAA, 0x9A, 0xAC, 0xCC, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCB, 0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDD, 0xDF, 0xDC, 0xCC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7D, 0xDC, 0xDC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCB, 0xCC, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xA9, 0x9A, 0xBC, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x77, 0x89, 0xBF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFC, 0xA8, 0x54, 0x46, 0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xCA, 0x74, 0x12, 0x47, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
-    0xA7, 0x42, 0x24, 0x7A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x86,
-    0x44, 0x58, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xBA, 0x87, 0x78,
-    0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x99, 0xAB, 0xCF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCC, 0xCC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCC, 0xCB, 0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0x9C, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDC, 0xCC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBB, 0xBB, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0xAA, 0xBB, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xCC,
-    0xBB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xCB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCC, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xDC, 0xCB, 0xBB, 0xBB,
-    0xBA, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xBB, 0xBB, 0xCC, 0xDD, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xED, 0xEE, 0xED, 0xDD, 0xDC, 0xCD, 0xDC, 0x7F, 0xFF,
-    0xFF, 0xFE, 0xED, 0xDD, 0xDD, 0xFD, 0xFF, 0xEE, 0xFD, 0xFF, 0xFF, 0xDE,
-    0xDD, 0xCC, 0xCC, 0xDD, 0xDD, 0xFF, 0xFF, 0xEF, 0xFF, 0xDD, 0xDC, 0xCC,
-    0xBB, 0xCC, 0xBD, 0xDD, 0xEF, 0xFE, 0xFF, 0xFD, 0xDC, 0xBB, 0xAA, 0xAA,
-    0xBB, 0xCD, 0xDE, 0xEF, 0xDF, 0xFE, 0xDC, 0xBA, 0x99, 0x99, 0x99, 0xAB,
-    0xCC, 0xDE, 0xFD, 0xFD, 0xEC, 0xCA, 0x98, 0x87, 0x78, 0x89, 0xAB, 0xCD,
-    0xFF, 0xDE, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x78, 0x9A, 0xBC, 0xDD, 0xFE,
-    0xDD, 0xCB, 0xA9, 0x86, 0x54, 0x45, 0x78, 0x9A, 0xCE, 0xDF, 0xEE, 0xDC,
-    0xBA, 0x97, 0x64, 0x23, 0x46, 0x79, 0xAB, 0xDD, 0xFD, 0xEE, 0xDB, 0xA9,
-    0x76, 0x42, 0x24, 0x67, 0x9A, 0xBC, 0xDE, 0xEF, 0xEE, 0xCA, 0x98, 0x75,
-    0x44, 0x56, 0x89, 0xAB, 0xDE, 0xFE, 0xEE, 0xDC, 0xBA, 0x88, 0x76, 0x66,
-    0x78, 0x9B, 0xCD, 0xEF, 0xDD, 0xFD, 0xCB, 0xA9, 0x98, 0x77, 0x88, 0x9A,
-    0xBC, 0xDF, 0xFF, 0xDF, 0xDD, 0xCB, 0xA9, 0x99, 0x99, 0x9A, 0xBC, 0xDE,
-    0xFF, 0xFD, 0xEE, 0xDD, 0xCB, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFF, 0xFF,
-    0xDF, 0xFD, 0xDC, 0xCC, 0xBC, 0xCB, 0xCC, 0xCE, 0xFF, 0xFF, 0xFD, 0xEF,
-    0xFE, 0xDD, 0xDC, 0xCD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xCF, 0xEE, 0xDD,
-    0xEE, 0xDE, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xDF, 0xFF,
-    0xFE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCD, 0xCC, 0xDD, 0xEE, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCF, 0xDF, 0xDC, 0xCB, 0xCD, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD,
-    0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCC, 0xBC,
-    0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0xBB, 0xBC,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, 0x98, 0x89, 0xAB, 0xCD, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x87, 0x66, 0x78, 0xAB, 0xCF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xCB, 0x97, 0x54, 0x45, 0x79, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xFC, 0xB9, 0x64, 0x22, 0x46, 0x9A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA,
-    0x86, 0x42, 0x23, 0x68, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x75,
-    0x44, 0x57, 0x9B, 0xCF, 0xDF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA8, 0x76, 0x67,
-    0x8A, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xA9, 0x88, 0x9A, 0xBC,
-    0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0xBB, 0xAB, 0xBC, 0xCF, 0xFF,
-    0xFF, 0xFD, 0xFF, 0xFD, 0xDF, 0xCC, 0xCC, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7D, 0xDD, 0xDF, 0xFD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFD, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCD, 0xDD,
-    0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xBB, 0xBB, 0xCF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0xA9, 0xAA, 0xBC, 0xDD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x97, 0x77, 0x89, 0xAC, 0xDF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFC, 0xA8, 0x64, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xB9, 0x74, 0x12, 0x47, 0x9B, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB,
-    0x97, 0x42, 0x24, 0x79, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xBA, 0x86,
-    0x44, 0x58, 0x9C, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0xA9, 0x87, 0x78,
-    0x9A, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBA, 0x99, 0xAB, 0xBD,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xCC, 0xBB, 0xBC, 0xCE, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xDC, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xED, 0xCC, 0xED, 0xBB, 0xCB, 0xBB, 0xCC, 0xBC, 0xCC, 0x6D, 0xFF,
-    0xED, 0xDC, 0xCC, 0xBD, 0xCC, 0xDC, 0xEE, 0xFF, 0xFC, 0xED, 0xDF, 0xCD,
-    0xCC, 0xCB, 0xCC, 0xCD, 0xCD, 0xDE, 0xFF, 0xCF, 0xED, 0xEC, 0xCB, 0xBA,
-    0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xFC, 0xDD, 0xDC, 0xBA, 0xBA, 0xA9, 0x9A,
-    0xAA, 0xBB, 0xCD, 0xEF, 0xDC, 0xDC, 0xCB, 0xA9, 0x98, 0x88, 0x99, 0x9B,
-    0xBC, 0xCD, 0xFD, 0xBC, 0xCB, 0xAA, 0x98, 0x77, 0x77, 0x89, 0xAA, 0xBD,
-    0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xDC,
-    0xBC, 0xBB, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xCE, 0xDC, 0xDB,
-    0xB9, 0x87, 0x64, 0x23, 0x46, 0x78, 0xAB, 0xBC, 0xEC, 0xCC, 0xBA, 0x98,
-    0x76, 0x43, 0x34, 0x57, 0x89, 0xBB, 0xCD, 0xDB, 0xCB, 0xBA, 0x97, 0x65,
-    0x44, 0x56, 0x78, 0x9B, 0xBD, 0xDD, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x56,
-    0x78, 0x9A, 0xBB, 0xDF, 0xEB, 0xDC, 0xBA, 0xA9, 0x87, 0x77, 0x78, 0x8A,
-    0xBB, 0xCD, 0xFD, 0xCC, 0xDB, 0xBB, 0x99, 0x98, 0x88, 0x9A, 0xAA, 0xBC,
-    0xDF, 0xDC, 0xDD, 0xBC, 0xBB, 0xAA, 0x99, 0xAA, 0xAB, 0xBC, 0xCE, 0xFE,
-    0xDF, 0xFD, 0xCC, 0xBB, 0xAA, 0xBB, 0xBB, 0xCC, 0xDC, 0xFF, 0xEC, 0xFF,
-    0xDC, 0xDC, 0xCC, 0xBB, 0xBC, 0xCD, 0xED, 0xED, 0xFE, 0xDE, 0xEE, 0xED,
-    0xCD, 0xCC, 0xCC, 0xDD, 0xDD, 0xEF, 0xEF, 0xEC, 0xEF, 0xFE, 0xED, 0xED,
-    0xDE, 0xED, 0xEE, 0xFE, 0xFF, 0xFF, 0x6C, 0xCC, 0xDD, 0xDD, 0xDD, 0xBC,
-    0xCC, 0xED, 0xDD, 0xEF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xCF, 0xFF,
-    0xFF, 0xDD, 0xDC, 0xCC, 0xCD, 0xDE, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC,
-    0xCB, 0xBA, 0xAA, 0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0xA9,
-    0x99, 0x9A, 0xAA, 0xBC, 0xEF, 0xFF, 0xFD, 0xDC, 0xBA, 0x98, 0x88, 0x88,
-    0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xDD, 0xBA, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xBC, 0xFF, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xED, 0xDB, 0xA8, 0x76, 0x65, 0x55, 0x56, 0x78, 0x89, 0xBC, 0xDF,
-    0xDC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xED, 0xCA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xEF, 0xDC, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xFD, 0xDA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDF, 0xDC, 0xB9, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0xAB, 0xDF, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBE, 0xEF, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xBC,
-    0xDF, 0xFE, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x9A, 0xBC, 0xFE, 0xFF,
-    0xFE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xFF, 0xFD,
-    0xDC, 0xBB, 0xBB, 0xAA, 0xBB, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE,
-    0xDC, 0xCC, 0xCD, 0xCE, 0xEF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xDF, 0xDD,
-    0xED, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xBE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFE, 0xFF, 0xFD, 0xEC, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFD, 0xDD, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD,
-    0xED, 0xCC, 0xCD, 0xFF, 0xED, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFD, 0xCC, 0xCB, 0xBB,
-    0xBD, 0xFD, 0xEF, 0xFF, 0xDF, 0xEE, 0xFD, 0xCB, 0xBA, 0xA9, 0xAB, 0xBC,
-    0xDD, 0xDF, 0xFF, 0xFF, 0xDC, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDF,
-    0xFF, 0xFF, 0xFE, 0xDC, 0xA9, 0x87, 0x66, 0x78, 0x9B, 0xCC, 0xDD, 0xFE,
-    0xED, 0xDC, 0xBA, 0x97, 0x54, 0x45, 0x79, 0xAB, 0xDD, 0xFF, 0xFD, 0xDD,
-    0xCB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBC, 0xDF, 0xFE, 0xDD, 0xDC, 0xBA,
-    0x86, 0x42, 0x24, 0x68, 0xAB, 0xCD, 0xFF, 0xED, 0xDD, 0xCB, 0xA9, 0x75,
-    0x44, 0x57, 0x8A, 0xBD, 0xDF, 0xFF, 0xDF, 0xDD, 0xCB, 0x98, 0x76, 0x67,
-    0x89, 0xBC, 0xCD, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xCD, 0xDE, 0xFE, 0xDF, 0xFD, 0xED, 0xBB, 0xA9, 0xAA, 0xBC, 0xCD, 0xDF,
-    0xFF, 0xEF, 0xFF, 0xFF, 0xDC, 0xCA, 0xBB, 0xBC, 0xCD, 0xDF, 0xFF, 0xFF,
-    0xDF, 0xFF, 0xDC, 0xDD, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF,
-    0xFF, 0xEF, 0xDD, 0xDC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF,
-    0xDF, 0xDD, 0xFD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xED, 0xFF, 0xFE, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6C, 0xDD, 0xDC, 0xCC, 0xFD, 0xFD,
-    0xDD, 0xDF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xDF, 0xFD, 0xCD, 0xDC, 0xFD, 0xDD, 0xDD, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xCD, 0xFF, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC,
-    0xCC, 0xCD, 0xDE, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0xBB, 0xCB,
-    0xCC, 0xCF, 0xFD, 0xFF, 0xFF, 0xFD, 0xFD, 0xCB, 0xAA, 0xA9, 0xAA, 0xBC,
-    0xCD, 0xFF, 0xFF, 0xFF, 0xDF, 0xBB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x78, 0x9A, 0xCC, 0xFF, 0xFD,
-    0xFF, 0xDC, 0xBA, 0x87, 0x54, 0x45, 0x79, 0xAB, 0xDC, 0xDF, 0xFF, 0xFD,
-    0xCA, 0x98, 0x64, 0x22, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xDF, 0xDC, 0xB9,
-    0x86, 0x42, 0x24, 0x68, 0x9C, 0xCF, 0xDF, 0xFF, 0xFF, 0xCB, 0xA9, 0x75,
-    0x44, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xDD, 0xBB, 0x98, 0x76, 0x66,
-    0x79, 0xAB, 0xDF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBA, 0x99, 0x88, 0x89, 0xAB,
-    0xDD, 0xFF, 0xFF, 0xEF, 0xFF, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xCD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xBB, 0xBC, 0xCD, 0xFF, 0xFF, 0xFF,
-    0xDF, 0xFF, 0xDD, 0xDC, 0xDD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xFF, 0xDD, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF,
-    0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7D, 0xDD, 0xDF, 0xFD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xBC, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xA9, 0x9A, 0xBF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x98, 0x77, 0x89, 0xAF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFB, 0xA8, 0x64, 0x46, 0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xB9, 0x74, 0x12, 0x47, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB,
-    0x97, 0x42, 0x24, 0x79, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEA, 0x86,
-    0x44, 0x57, 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0x87, 0x78,
-    0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0x99, 0xAA, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFB, 0xBB, 0xEF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCD, 0xCC, 0xCF, 0xBB, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE,
-    0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBC,
-    0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x99, 0xAA, 0xBC,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0x98, 0x88, 0xAA, 0xBF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xCD, 0xB9, 0x87, 0x66, 0x78, 0x9A, 0xCF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xCA, 0x87, 0x54, 0x45, 0x79, 0xAB, 0xDF, 0xFF, 0xFF, 0xFD,
-    0xFB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9,
-    0x86, 0x42, 0x24, 0x68, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA8, 0x75,
-    0x44, 0x56, 0x9B, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x98, 0x76, 0x66,
-    0x89, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x98, 0x88, 0x89, 0xBB,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFB, 0xCB, 0xAA, 0xAA, 0xBC, 0xDF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCC, 0xAB, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFC, 0xCD, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6C, 0xBC, 0xCF, 0xFF, 0xCD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDC, 0xDB, 0xBA, 0xAA, 0xA9, 0xAA, 0xA9, 0xAB, 0xBB, 0xCC, 0xAF, 0xFD,
-    0xBB, 0xBA, 0xA9, 0xAA, 0x9A, 0xAB, 0xBB, 0xCD, 0xDC, 0xCB, 0xBB, 0xAA,
-    0x99, 0x99, 0x89, 0x9A, 0xAA, 0xBB, 0xCC, 0xCC, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xAB, 0xCB, 0xBB, 0xB9, 0x88, 0x87, 0x77, 0x77,
-    0x88, 0x89, 0xAA, 0xBB, 0xCA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAB, 0xCA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A,
-    0xAB, 0xBB, 0xAA, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBB,
-    0xAA, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x77, 0x89, 0x9B, 0xAA, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9C, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0x9A, 0xBA, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x67, 0x77,
-    0x88, 0x9B, 0xBC, 0xAA, 0x99, 0x98, 0x77, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xCA, 0xAA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x89, 0x99, 0xAB, 0xDD,
-    0xCB, 0xCB, 0xA9, 0x89, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xDC,
-    0xBA, 0xA9, 0x99, 0x98, 0x99, 0x9A, 0xBA, 0xBC, 0xDC, 0xEC, 0xCC, 0xAB,
-    0xBA, 0x9A, 0x9A, 0xAA, 0xAB, 0xBC, 0xEF, 0xEC, 0xEC, 0xCB, 0xBB, 0xBB,
-    0xBA, 0xBB, 0xBB, 0xCC, 0xDC, 0xEE, 0xAC, 0xBC, 0xCB, 0xBA, 0xCA, 0xBA,
-    0xBC, 0xBB, 0xDD, 0xDD, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBF, 0xDF, 0xCC, 0xED, 0xBA, 0xBC, 0xCB, 0xBB, 0xBB, 0xCF, 0x6F, 0xFF,
-    0xDC, 0xFF, 0xEF, 0xED, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0xFF, 0xFD,
-    0xFF, 0xDC, 0xDF, 0xFD, 0xFD, 0xFD, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDC,
-    0xBB, 0xCB, 0xFC, 0xFF, 0xFF, 0xFC, 0xCF, 0xFC, 0xFF, 0xCB, 0xBB, 0xAB,
-    0xCC, 0xBF, 0xFD, 0xFF, 0xFF, 0xFF, 0xCB, 0xBB, 0xA9, 0xA9, 0xAC, 0xBE,
-    0xEE, 0xFE, 0xED, 0xCF, 0xFF, 0xDA, 0xA9, 0x88, 0x88, 0xAA, 0xCD, 0xCD,
-    0xFF, 0xDC, 0xFF, 0xFB, 0xA9, 0x86, 0x66, 0x78, 0xAB, 0xCC, 0xFD, 0xFC,
-    0xCF, 0xDD, 0xDA, 0x86, 0x54, 0x46, 0x79, 0xAD, 0xCF, 0xFF, 0xCC, 0xFF,
-    0xCB, 0xA9, 0x64, 0x22, 0x47, 0x8A, 0xCB, 0xFF, 0xFF, 0xCF, 0xFD, 0xB9,
-    0x86, 0x42, 0x24, 0x68, 0x9B, 0xCE, 0xFD, 0xCC, 0xFD, 0xBB, 0xA9, 0x76,
-    0x44, 0x57, 0x8A, 0xBC, 0xEE, 0xDE, 0xED, 0xFF, 0xDB, 0xA8, 0x76, 0x66,
-    0x78, 0xAC, 0xCD, 0xDF, 0xFD, 0xFF, 0xFB, 0xCB, 0xA9, 0x88, 0x89, 0x9B,
-    0xCF, 0xCF, 0xFF, 0xDF, 0xFC, 0xDF, 0xCA, 0xA9, 0xAA, 0xAA, 0xCF, 0xDD,
-    0xFF, 0xFC, 0xFF, 0xFD, 0xCC, 0xCC, 0xBB, 0xAB, 0xCC, 0xCF, 0xFF, 0xFC,
-    0xCF, 0xDD, 0xFC, 0xFF, 0xCB, 0xCD, 0xFF, 0xDF, 0xFF, 0xFF, 0xFC, 0xFF,
-    0xDF, 0xDF, 0xCF, 0xFC, 0xCF, 0xFF, 0xFF, 0xDF, 0xFD, 0xCF, 0xFF, 0xCF,
-    0xFF, 0xFC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xFF, 0xFF, 0xFF, 0xCF,
-    0xFD, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x6D, 0xCC, 0xCD, 0xBD, 0xDC, 0xFD,
-    0xCD, 0xCF, 0xFF, 0xFF, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
-    0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xCB, 0xCC,
-    0xCC, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBA, 0xA9, 0xAA, 0xCF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xA9, 0x88, 0x88, 0x9A, 0xBF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFB, 0xB9, 0x86, 0x66, 0x78, 0x9A, 0xCF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xB9, 0x87, 0x54, 0x45, 0x78, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBC, 0xFF, 0xFF, 0xFF, 0xFC, 0xCA,
-    0x86, 0x42, 0x24, 0x68, 0x9C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA8, 0x75,
-    0x44, 0x56, 0x8A, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x98, 0x76, 0x66,
-    0x89, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x98, 0x88, 0x89, 0xAC,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xCB, 0xAA, 0xA9, 0xBB, 0xCF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBB, 0xCF, 0xEF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0x9F, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0x9C, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x65, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0x94, 0x12, 0x58, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF8, 0x52, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8,
-    0x54, 0x78, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0x87,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x98, 0x98, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xF9, 0x74, 0x57, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFA, 0x85, 0x12, 0x59, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF9, 0x52, 0x14, 0x89, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x97,
-    0x54, 0x67, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x89,
-    0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF,
-    0xFF, 0xFF, 0xF6, 0xF6, 0x6F, 0x68, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6,
-    0x66, 0xF6, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF6, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x66, 0xF6, 0x6F,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0x6F, 0x66, 0x66, 0xFF, 0x6F, 0xF6,
-    0xFF, 0xFF, 0x6F, 0xCF, 0xFF, 0x6F, 0xFF, 0xF6, 0x6F, 0x6F, 0xFF, 0x6F,
-    0xFF, 0xF6, 0x56, 0xF6, 0xF6, 0x56, 0xFF, 0xFF, 0x66, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x65, 0x56, 0x6F, 0xFF, 0xF6, 0xFF, 0x6F, 0xFF, 0xFF,
-    0xF6, 0x66, 0xF6, 0xFF, 0x66, 0x6F, 0xFF, 0x6F, 0xFF, 0x6F, 0xF6, 0xFF,
-    0x66, 0x6F, 0x56, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0x6F,
-    0x46, 0xF5, 0x6F, 0x6F, 0xFF, 0xF5, 0x6B, 0xAF, 0xFF, 0x5F, 0xFF, 0xFF,
-    0x6F, 0x6F, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xF6, 0x66, 0xF5, 0xFF,
-    0x5F, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xF5, 0x55, 0xF6, 0xF6, 0xFF,
-    0xFF, 0x6F, 0xFF, 0xFF, 0x6F, 0xF6, 0xFF, 0xF6, 0xF6, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xF6, 0x6F, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xF6, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0x6F,
-    0xF6, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0x6F, 0x6F,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0x9F, 0x4F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xF9,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x98, 0x98, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xF8, 0x67, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xF8, 0x97, 0x54, 0x47, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x8F, 0x74, 0x12, 0x57, 0x8F, 0xF9, 0xFF, 0xFF, 0x9F, 0xFF, 0x9F,
-    0x98, 0x52, 0x24, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
-    0x54, 0x58, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xF8,
-    0x9F, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0x89, 0xFF,
-    0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xF9, 0x99, 0xFF, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xBA, 0xFF, 0xFF, 0xBF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA8, 0x77, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xF8, 0x54, 0x45, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFA, 0x84, 0x22, 0x47, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xA8, 0x42, 0x14, 0x7A, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x96,
-    0x44, 0x59, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0x97, 0x78,
-    0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFA, 0xBF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBF, 0xFB, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0x5F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x7F, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x76, 0xF7, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0x6F, 0x67, 0x6F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xF7, 0x55, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xF7, 0x55, 0x44, 0x46, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF7, 0xF5, 0x54, 0x44, 0x57, 0x66, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6,
-    0x75, 0x44, 0x34, 0x46, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x55,
-    0x45, 0x45, 0x56, 0xFF, 0xFF, 0xFF, 0xFD, 0xCF, 0x6F, 0x7F, 0x75, 0x57,
-    0x56, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x76, 0x66, 0x7F,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x7F, 0xF7, 0x7F, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0x7F, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0x5F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA7, 0x78, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFC, 0x44, 0x45, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0x73, 0x22, 0x48, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF7, 0x42, 0x24, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x86,
-    0x43, 0x4C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x77,
-    0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xF9, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xF7, 0x7F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x75, 0x67, 0x78, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xF9, 0x76, 0x43, 0x46, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF6, 0x63, 0x23, 0x58, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xAF, 0x43, 0x23, 0x57, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0x85,
-    0x54, 0x45, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xF7, 0x55,
-    0x68, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xBF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xF8, 0xF8, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xBF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xAF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x87, 0x88, 0x9F, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0x87, 0x66, 0x78, 0xAF, 0xBF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xBF, 0xA7, 0x54, 0x45, 0x6A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF7, 0x64, 0x22, 0x46, 0x89, 0xDF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF,
-    0x76, 0x42, 0x24, 0x68, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x75,
-    0x44, 0x57, 0xA9, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0x97, 0x76, 0x67,
-    0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xBA, 0x98, 0x8A, 0xBB,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFA, 0xAF, 0xBF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x9F, 0xFF, 0xCF, 0x99, 0xFF, 0x3F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x78, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x64, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFA, 0x84, 0x22, 0x48, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF7, 0x42, 0x14, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
-    0x44, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x88,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xEE, 0xEF, 0xFF, 0xFF, 0x3F, 0xFF,
-    0xFE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F,
-    0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x64, 0x56, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xF3, 0x12, 0x46, 0xFF, 0xFE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0x52, 0x24, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0x44, 0x6E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xFE, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0x83, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xF4, 0x12, 0x4F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF7, 0x42, 0x24, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
-    0x44, 0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x8F,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x9C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
- },
- {
-  {
-    0xBE, 0xDD, 0xEC, 0xDD, 0xDD, 0xDC, 0xDE, 0xEE, 0xFF, 0xFF, 0xCD, 0xFE,
-    0xFD, 0xDD, 0xDC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFF, 0xFF, 0xDE, 0xFD, 0xCC,
-    0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xFF, 0xFF, 0xFD, 0xED, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCD, 0xFF, 0xFF, 0xDF, 0xEC, 0xBB, 0xA9, 0x99, 0x99,
-    0x99, 0xAB, 0xCD, 0xFF, 0xFD, 0xEC, 0xBB, 0xA9, 0x88, 0x77, 0x78, 0x89,
-    0xAB, 0xCD, 0xFE, 0xED, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xFC, 0xDC, 0xA9, 0x87, 0x76, 0x65, 0x66, 0x67, 0x89, 0xBC, 0xDF,
-    0xDC, 0xCA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDD, 0xDB,
-    0xA9, 0x87, 0x65, 0x54, 0x55, 0x56, 0x79, 0xAC, 0xDD, 0xDC, 0xBA, 0x97,
-    0x65, 0x54, 0x44, 0x55, 0x67, 0x8A, 0xBD, 0xDE, 0xCB, 0xA9, 0x76, 0x65,
-    0x54, 0x55, 0x66, 0x79, 0xAB, 0xCD, 0xED, 0xCA, 0x98, 0x76, 0x55, 0x55,
-    0x56, 0x78, 0x9A, 0xBD, 0xDE, 0xDC, 0xB9, 0x87, 0x66, 0x65, 0x66, 0x77,
-    0x89, 0xAC, 0xDC, 0xEF, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDF, 0xFE, 0xCB, 0xA9, 0x88, 0x77, 0x78, 0x89, 0xAB, 0xCC, 0xED,
-    0xFF, 0xED, 0xCB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDF, 0xDF, 0xFF,
-    0xED, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFD, 0xFF, 0xFF, 0xFE,
-    0xDC, 0xCB, 0xBB, 0xBC, 0xCC, 0xEE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFE, 0xEE,
-    0xCC, 0xDD, 0xDD, 0xDF, 0xEF, 0xFF, 0xDF, 0xFF, 0xFE, 0xFF, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xDE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAD, 0xCB, 0xBB, 0xBC, 0xCB, 0xFC, 0xDB, 0xCD, 0xFF, 0xFF, 0xCF, 0xFF,
-    0xBD, 0xCC, 0xDC, 0xDB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xCC, 0xDC,
-    0xBB, 0xAB, 0xBA, 0xBC, 0xCD, 0xDD, 0xDD, 0xFB, 0xDD, 0xFB, 0xAB, 0xAA,
-    0x9A, 0xAA, 0xAA, 0xBC, 0xFF, 0xFF, 0xCF, 0xFC, 0xCB, 0xBA, 0x99, 0x99,
-    0x99, 0xAB, 0xBC, 0xCF, 0xFB, 0xDB, 0xBA, 0xA9, 0x98, 0x87, 0x78, 0x88,
-    0xAA, 0xBC, 0xDF, 0xCF, 0xFB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, 0xAA,
-    0xBF, 0xCF, 0xCC, 0xA9, 0x98, 0x76, 0x65, 0x56, 0x67, 0x89, 0xAB, 0xFC,
-    0xCB, 0xDA, 0xA8, 0x76, 0x65, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xFB,
-    0xA9, 0x87, 0x65, 0x44, 0x45, 0x56, 0x79, 0x9B, 0xCC, 0xBF, 0xBA, 0x97,
-    0x75, 0x54, 0x44, 0x56, 0x68, 0x9A, 0xBE, 0xFB, 0xDB, 0xA9, 0x86, 0x65,
-    0x44, 0x45, 0x67, 0x89, 0xAA, 0xCC, 0xDF, 0xBB, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xAC, 0xDC, 0xFC, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x8A, 0xAB, 0xBB, 0xFC, 0xBC, 0xB9, 0x87, 0x76, 0x77, 0x77, 0x89, 0xAB,
-    0xDC, 0xBC, 0xFC, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xCB, 0xCB,
-    0xFF, 0xFC, 0xCA, 0xAA, 0x99, 0x99, 0xA9, 0x9B, 0xBC, 0xCD, 0xDF, 0xFF,
-    0xCF, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCF, 0xDD, 0xFF, 0xFF, 0xFD,
-    0xCC, 0xCB, 0xBB, 0xCC, 0xBB, 0xDB, 0xFF, 0xCF, 0xFF, 0xFF, 0xDD, 0xFD,
-    0xBF, 0xDC, 0xCB, 0xBF, 0xDF, 0xFC, 0xFF, 0xFF, 0xFE, 0xED, 0xFF, 0xCB,
-    0xBC, 0xDC, 0xBC, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xDF, 0xDD, 0xDD, 0xDC, 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xDF, 0xFF,
-    0xFE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFF, 0xFF, 0xEF, 0xFD, 0xDC,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xFE, 0xDC, 0xBB, 0xAA,
-    0x9A, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xDF, 0xDC, 0xBA, 0xA9, 0x98, 0x88,
-    0x89, 0xAA, 0xBD, 0xDF, 0xFD, 0xEC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xEF, 0xDD, 0xCB, 0x99, 0x87, 0x76, 0x66, 0x67, 0x88, 0xAB,
-    0xCD, 0xFD, 0xDB, 0xA9, 0x87, 0x66, 0x65, 0x56, 0x67, 0x89, 0xAB, 0xED,
-    0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x77, 0x8A, 0xBD, 0xDD, 0xCB,
-    0xA8, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0xAB, 0xCD, 0xDC, 0xB9, 0x87,
-    0x65, 0x55, 0x44, 0x55, 0x67, 0x89, 0xBD, 0xDD, 0xCB, 0xA8, 0x76, 0x65,
-    0x55, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55,
-    0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xDB, 0xA9, 0x87, 0x66, 0x65, 0x66, 0x67,
-    0x89, 0xAB, 0xDD, 0xED, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0x9B,
-    0xCC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x78, 0x89, 0x9A, 0xBC, 0xED,
-    0xFF, 0xDD, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0xAA, 0xBC, 0xDD, 0xDF, 0xFF,
-    0xFD, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xED, 0xFF, 0xFE, 0xFD,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xBC, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0xFE, 0xDC,
-    0xCC, 0xCC, 0xCC, 0xDE, 0xDF, 0xFE, 0xDF, 0xFF, 0xFF, 0xFE, 0xDD, 0xDC,
-    0xCD, 0xDD, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xED, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x4D, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xE3, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x3E, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0x44, 0x44, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0x44, 0x4D, 0xDD, 0xD4, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD4, 0xD3,
-    0x3D, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xE4, 0xE4, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0x44, 0xEE,
-    0xE4, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xED, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xED, 0xED, 0xED, 0xEE, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDC, 0xFD, 0xFF, 0xFF, 0xFF, 0xDD, 0xFF,
-    0xDF, 0xDD, 0xCC, 0xCC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xEF, 0xDD, 0xDC,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDF, 0xFF, 0xFE, 0xFD, 0xEC, 0xBB, 0xAA,
-    0x9A, 0xAA, 0xAB, 0xCD, 0xDF, 0xFF, 0xCD, 0xCD, 0xBA, 0xA9, 0x98, 0x88,
-    0x99, 0x9A, 0xCD, 0xDF, 0xFD, 0xDC, 0xBA, 0xA9, 0x88, 0x77, 0x78, 0x89,
-    0x9A, 0xBD, 0xFF, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0x9A,
-    0xDF, 0xFC, 0xDB, 0xB9, 0x87, 0x66, 0x65, 0x66, 0x67, 0x89, 0xAC, 0xDD,
-    0xDD, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x8A, 0xCD, 0xED, 0xCB,
-    0xA8, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9B, 0xDE, 0xDC, 0xBA, 0x87,
-    0x65, 0x55, 0x45, 0x55, 0x67, 0x8A, 0xBD, 0xCD, 0xCB, 0xA8, 0x76, 0x55,
-    0x54, 0x55, 0x56, 0x78, 0xAB, 0xCD, 0xED, 0xBA, 0x98, 0x76, 0x55, 0x55,
-    0x56, 0x78, 0x9A, 0xBC, 0xCD, 0xFB, 0xA9, 0x87, 0x66, 0x65, 0x66, 0x67,
-    0x89, 0xAB, 0xCD, 0xFF, 0xDB, 0xA8, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB,
-    0xCC, 0xDF, 0xFD, 0xCA, 0x98, 0x88, 0x77, 0x77, 0x89, 0x9A, 0xBC, 0xED,
-    0xFF, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x99, 0xAA, 0xBC, 0xDD, 0xDF, 0xFF,
-    0xDC, 0xCB, 0xAA, 0xAA, 0x9A, 0xAB, 0xBC, 0xCE, 0xED, 0xFF, 0xFF, 0xFD,
-    0xCC, 0xBB, 0xBC, 0xBB, 0xCC, 0xDD, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDC,
-    0xCC, 0xCD, 0xDC, 0xDF, 0xFF, 0xEF, 0xDF, 0xFF, 0xFE, 0xFC, 0xEC, 0xCD,
-    0xCC, 0xDD, 0xCD, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCB, 0xBB, 0xBB, 0xBA, 0xAB, 0xBB, 0xCC, 0xCC, 0xEF, 0xBC, 0xDD,
-    0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xEE, 0xFE, 0xCC, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xEC, 0xCC, 0xBA, 0xAA, 0x99,
-    0x98, 0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xBC, 0xDB, 0xBB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x78,
-    0x99, 0xAB, 0xCC, 0xBB, 0xAA, 0x98, 0x77, 0x76, 0x66, 0x77, 0x78, 0x9A,
-    0xAC, 0xCB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBB,
-    0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBB, 0xBA,
-    0x98, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAB, 0xBB, 0x99, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAA, 0xAB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x66, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x67,
-    0x88, 0x9A, 0xBB, 0xCC, 0xAA, 0x98, 0x77, 0x76, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xBC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB,
-    0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBD, 0xDD,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xEE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCF, 0xFE, 0xDD, 0xCC, 0xBB,
-    0xBA, 0xBB, 0xBB, 0xBC, 0xCD, 0xDC, 0xCE, 0xDD, 0xDC, 0xCB, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDD, 0xBC, 0xDC,
-    0xCC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCB, 0xCD, 0xEE, 0xBD, 0xCC, 0xBB,
-    0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xDB, 0xCC, 0xAA, 0xA9, 0x99,
-    0x88, 0x89, 0x99, 0x9A, 0xBC, 0xDC, 0xBC, 0xBA, 0x99, 0x98, 0x88, 0x77,
-    0x88, 0x89, 0x9A, 0xBC, 0xCB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0xAB, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBA,
-    0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x89, 0xAA, 0xAA, 0xA9,
-    0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xAB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67,
-    0x88, 0x9A, 0xAA, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xAB, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0xAB, 0xBB,
-    0xCC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xBC, 0xCB,
-    0xBA, 0x99, 0x99, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xDD, 0xDC, 0xBA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xBE, 0xEE, 0xCC, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDB, 0xCD, 0xEC, 0xBB, 0xBB, 0xBA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBB, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xCA, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77,
-    0x88, 0x88, 0x9A, 0xAB, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x77, 0x89,
-    0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA,
-    0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0x99, 0xA9,
-    0x88, 0x76, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0xA9, 0x9A, 0x98, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x67, 0x78, 0x9A, 0x99, 0xA9, 0x87, 0x76, 0x66,
-    0x65, 0x66, 0x66, 0x77, 0x89, 0xA9, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0x9A, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x78, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0x9A, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xAA,
-    0xBB, 0xAA, 0x99, 0x88, 0x87, 0x78, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xCB,
-    0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xCD, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xCC, 0xCB, 0xBA, 0xAA, 0x99, 0x99,
-    0x99, 0xAA, 0xAA, 0xBB, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xCC, 0xCB,
-    0xBC, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xAC, 0xCD, 0xDE, 0xBD, 0xCB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCA, 0xBC, 0xBA, 0x99, 0x98,
-    0x88, 0x89, 0x89, 0x9A, 0xBB, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xCC, 0xAA, 0xA9, 0x88, 0x87, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xBA, 0xB9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, 0x78, 0x99, 0xAA,
-    0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9,
-    0x87, 0x76, 0x66, 0x65, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87,
-    0x66, 0x65, 0x55, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67,
-    0x78, 0x9A, 0xBA, 0xAB, 0xA9, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAA, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0xAB, 0xBA,
-    0xBB, 0xAA, 0x99, 0x88, 0x87, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBD, 0xBB,
-    0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBB, 0xDD, 0xCB, 0xAB,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xBC, 0xBD, 0xDC, 0xBB, 0xBB, 0xAA,
-    0xA9, 0xAA, 0xAA, 0xBB, 0xDC, 0xDC, 0xBE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9C, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xCB, 0xEC,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xEE, 0xBD, 0xCB, 0xBA,
-    0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCE, 0xDB, 0xCB, 0xBA, 0xA9, 0x99,
-    0x88, 0x89, 0x99, 0xAA, 0xBC, 0xDC, 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88,
-    0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xBB, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x78,
-    0x89, 0xAB, 0xBC, 0xAB, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBB,
-    0xAA, 0x99, 0x87, 0x76, 0x66, 0x55, 0x66, 0x67, 0x89, 0x9A, 0xAA, 0xA9,
-    0x88, 0x76, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x66, 0x78, 0x99, 0xAA, 0xAB, 0x99, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x77, 0x89, 0x9A, 0xAB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xAA, 0xBB, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xBB, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB,
-    0xCC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBC, 0xDC,
-    0xBA, 0xA9, 0x99, 0x88, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xDC, 0xBB,
-    0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xBD, 0xED, 0xCC, 0xBB, 0xBB,
-    0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBD, 0xDC, 0xCB, 0xBB, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xED, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xEF, 0xBF, 0xFF,
-    0xFD, 0xDD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xED, 0xDC,
-    0xCC, 0xCC, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFE, 0xDC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xCC, 0xEF, 0xFF, 0xFF, 0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0x99,
-    0xAA, 0xBC, 0xDF, 0xFF, 0xED, 0xEC, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x9A,
-    0xBD, 0xEF, 0xFF, 0xDD, 0xCB, 0xA9, 0x88, 0x76, 0x67, 0x78, 0x9A, 0xCD,
-    0xEF, 0xFD, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xEE,
-    0xDE, 0xCB, 0x98, 0x76, 0x54, 0x44, 0x56, 0x79, 0xAC, 0xDE, 0xED, 0xDC,
-    0xB9, 0x87, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xED, 0xDE, 0xCB, 0x98,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xDE, 0xFC, 0xB9, 0x87, 0x55,
-    0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xEE, 0xDB, 0xA8, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAB, 0xCE, 0xEF, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x78,
-    0x9B, 0xBD, 0xED, 0xFF, 0xFD, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDF, 0xFE, 0xDC, 0xBA, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED,
-    0xFF, 0xFF, 0xEC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xFE, 0xEF, 0xFF,
-    0xFF, 0xEC, 0xDC, 0xBB, 0xBB, 0xCC, 0xCC, 0xDE, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xED, 0xDC, 0xCD, 0xDD, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xEE, 0xFE, 0xDE, 0xEE, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xEE, 0xDD, 0xDE,
-    0xFE, 0xDD, 0xDE, 0xEE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBF, 0xDD, 0xDC, 0xCC, 0xBC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xCD, 0xDF,
-    0xDC, 0xCB, 0xCB, 0xCB, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xDE, 0xDC, 0xCC,
-    0xBB, 0xBA, 0xAB, 0xBB, 0xCD, 0xFF, 0xFF, 0xFC, 0xDD, 0xBB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xCD, 0xDF, 0xFF, 0xDC, 0xBB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAB, 0xBC, 0xDF, 0xFC, 0xCC, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x89,
-    0xAB, 0xBD, 0xFF, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xDD, 0xFC, 0xCA, 0x99, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xFF,
-    0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBE, 0xEC, 0xBA,
-    0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x78, 0xAB, 0xCC, 0xCC, 0xBA, 0x97, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xDF, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCD, 0xDD, 0xDB, 0xA8, 0x87, 0x77, 0x67, 0x77, 0x89, 0xAA,
-    0xBD, 0xFF, 0xDD, 0xCA, 0xA9, 0x88, 0x77, 0x88, 0x89, 0x9A, 0xBC, 0xDC,
-    0xFF, 0xFD, 0xCB, 0xAA, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xCF, 0xCF, 0xFF,
-    0xFD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDC, 0xFF, 0xFF, 0xFF, 0xFD,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDC,
-    0xCC, 0xCC, 0xDD, 0xCC, 0xFE, 0xDF, 0xDF, 0xFF, 0xFF, 0xDD, 0xCC, 0xCD,
-    0xCC, 0xCF, 0xDD, 0xDD, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBF, 0xDD, 0xED, 0xED, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xCE, 0xFF,
-    0xFF, 0xFE, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFE, 0xFE, 0xED, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xCD, 0xEF, 0xFF, 0xFF, 0xDE, 0xDD, 0xBB, 0xAA, 0x99, 0x99,
-    0xAB, 0xCD, 0xED, 0xFF, 0xFE, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x9A,
-    0xBD, 0xEF, 0xFF, 0xDF, 0xDC, 0xB9, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xCE,
-    0xFF, 0xFE, 0xDD, 0xBA, 0x97, 0x76, 0x55, 0x56, 0x78, 0x9B, 0xCE, 0xFF,
-    0xED, 0xDB, 0xA8, 0x76, 0x54, 0x44, 0x56, 0x79, 0xAC, 0xEF, 0xEE, 0xEC,
-    0xB9, 0x86, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFE, 0xEE, 0xCB, 0x98,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xEF, 0xFD, 0xEC, 0xB9, 0x87, 0x55,
-    0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFD, 0xEF, 0xDB, 0xA8, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAC, 0xDF, 0xEE, 0xFD, 0xCB, 0x98, 0x76, 0x66, 0x67, 0x78,
-    0xAB, 0xCD, 0xEE, 0xFF, 0xFD, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDF, 0xEF, 0xFF, 0xED, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xEE,
-    0xFF, 0xFF, 0xDC, 0xCB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEE, 0xEF, 0xFF,
-    0xFF, 0xED, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFE, 0xFF, 0xFF, 0xFF,
-    0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xEE, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xEE, 0xED, 0xEE,
-    0xED, 0xFE, 0xFE, 0xEE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCB, 0xBB, 0xBB, 0xBB, 0xAB, 0xBB, 0xCC, 0xCD, 0xDE, 0xBC, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDF, 0xFD, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xEB, 0xCB, 0xBA, 0xA9, 0x99,
-    0x99, 0x99, 0xAA, 0xAB, 0xCD, 0xDD, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xCC, 0xBB, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x65, 0x66, 0x77, 0x89, 0xAB, 0xBB,
-    0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA,
-    0x98, 0x76, 0x65, 0x54, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xBC, 0xCB, 0xBA, 0x99, 0x88, 0x87, 0x78, 0x88, 0x9A, 0xAB, 0xCB,
-    0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCD, 0xDD,
-    0xCB, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xDE, 0xDD, 0xCB,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCE, 0xEE, 0xDD, 0xCC, 0xCB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEC, 0xBD, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xCC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xAA, 0x99, 0xA9, 0xAA, 0xBB, 0xBD, 0xDC, 0xAB, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xCA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x88, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0x99, 0xA9, 0x88, 0x76, 0x66,
-    0x65, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0x9A, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x99, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89,
-    0xAA, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xAA,
-    0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xCB,
-    0xAA, 0xA9, 0x98, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xBB, 0xCC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBD, 0xDD, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBB, 0xCB,
-    0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xCC, 0xDC, 0xAB, 0xAA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCA, 0xBA, 0x99, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x88, 0x77, 0x77,
-    0x78, 0x89, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x66, 0x66, 0x66, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x67, 0x88, 0x9A, 0x99, 0x99, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x9A, 0x98, 0x77, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x78, 0x89, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x67, 0x77, 0x78, 0x89,
-    0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xAA,
-    0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xAB, 0xBB,
-    0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBB, 0xBD, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xCD, 0xCB, 0xBB, 0xAA, 0xAA, 0x99,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xAB, 0xCC,
-    0xBB, 0xBB, 0xAA, 0xAA, 0xBA, 0xBC, 0xCD, 0xED, 0xEC, 0xBC, 0xBB, 0xBA,
-    0xA9, 0xA9, 0xA9, 0xAA, 0xAB, 0xBC, 0xDE, 0xDB, 0xBB, 0xBA, 0x99, 0x99,
-    0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xCC, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x78,
-    0x89, 0xAB, 0xCC, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x9A,
-    0xBB, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x89, 0x9A, 0xBA,
-    0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xAA,
-    0x98, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x99, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAA, 0xBA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x89, 0xAA, 0xAB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xAA, 0xBB, 0xA9, 0x98, 0x87, 0x77, 0x67, 0x77, 0x88, 0x9A,
-    0xAB, 0xAC, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x78, 0x89, 0x99, 0xAA, 0xBA,
-    0xCC, 0xCB, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xAC, 0xCC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBB, 0xCB, 0xCE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xBE, 0xED, 0xDC, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xAA, 0xBC, 0xCC, 0xDB, 0xAD, 0xDD, 0xBB, 0xBB, 0xBB, 0xBA,
-    0xAA, 0xBB, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCD, 0xAB, 0xCC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xFD, 0xBC, 0xBB, 0xAA,
-    0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xDB, 0xBB, 0xAA, 0x99, 0x99,
-    0x89, 0x99, 0x9A, 0xAB, 0xCD, 0xDC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xBB, 0xCC, 0xCA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBC, 0xCA, 0xAA, 0x98, 0x77, 0x66, 0x65, 0x66, 0x67, 0x89, 0xAA, 0xCB,
-    0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xAA,
-    0x98, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0xA9, 0x87,
-    0x66, 0x55, 0x45, 0x56, 0x67, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBB, 0xBC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xBC, 0xCB, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB,
-    0xCD, 0xCB, 0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xBD, 0xED,
-    0xCB, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCB, 0xDE, 0xED, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCD, 0xBD, 0xFE, 0xED, 0xCC, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDB, 0xAD, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB,
-    0xAB, 0xBB, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAF, 0xDF, 0xDF, 0xFD, 0xDD, 0xCD, 0xDF, 0xFD, 0xFF, 0xDD, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0xCC, 0xCD, 0xFD, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xFF, 0xFF, 0xFD, 0xBA, 0x88, 0xAC, 0xDF, 0xFD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xCA, 0x74, 0x46, 0x9C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xDF, 0xFC, 0x85, 0x22, 0x47, 0xDF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xD8, 0x42, 0x13, 0x7B, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xA6,
-    0x43, 0x58, 0xCF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xA8, 0x78,
-    0xAB, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xDB, 0xBC, 0xDF,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xDD, 0xFD, 0xDF, 0xDF,
-    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFD,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF,
-    0xDD, 0xFD, 0xFF, 0xDD, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFD, 0xDD, 0xCD, 0xDE, 0xDD, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF,
-    0xFF, 0xED, 0xDC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xDD,
-    0xBB, 0xBA, 0xBB, 0xBD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xAA,
-    0x99, 0xAA, 0xBB, 0xCE, 0xFF, 0xFF, 0xFF, 0xEC, 0xBA, 0x99, 0x88, 0x89,
-    0x9A, 0xAB, 0xCE, 0xFF, 0xFE, 0xFC, 0xCA, 0x98, 0x87, 0x77, 0x78, 0x99,
-    0xAB, 0xDD, 0xFF, 0xDD, 0xBB, 0x98, 0x77, 0x66, 0x66, 0x77, 0x99, 0xBC,
-    0xDF, 0xED, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xFF,
-    0xFC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0xAB, 0xCF, 0xFC, 0xDB,
-    0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xED, 0xDC, 0xCA, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9B, 0xCE, 0xFE, 0xDB, 0xA9, 0x76, 0x55,
-    0x44, 0x55, 0x67, 0x89, 0xBC, 0xDD, 0xDC, 0xCA, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0xAB, 0xCF, 0xED, 0xFD, 0xBA, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBE, 0xEF, 0xDF, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x9A, 0xBC,
-    0xCF, 0xFE, 0xFF, 0xDC, 0xA9, 0x98, 0x88, 0x88, 0x9A, 0xBC, 0xDF, 0xEF,
-    0xFF, 0xFE, 0xCB, 0xBA, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xCD, 0xCB, 0xBB, 0xBB, 0xBC, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xED, 0xDC, 0xDC, 0xDD, 0xCF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xDF, 0xEF,
-    0xDD, 0xEE, 0xFF, 0xDE, 0xFF, 0xFF, 0xBF, 0xFF, 0xFD, 0xFF, 0xFE, 0xED,
-    0xFE, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xEE, 0xED, 0xDD, 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFF, 0xDE, 0xFF,
-    0xED, 0xCC, 0xCC, 0xBC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0xEF, 0xED, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFE, 0xFD, 0xCB, 0xAA, 0xA9,
-    0x99, 0x99, 0xAB, 0xBC, 0xEF, 0xFF, 0xDD, 0xCB, 0xAA, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xBC, 0xEF, 0xFD, 0xDB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0x9B, 0xCD, 0xEE, 0xDD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCE, 0xEC, 0xCB, 0x98, 0x77, 0x66, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xDE,
-    0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x77, 0x9A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xCD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xED, 0xED, 0xCB, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDE, 0xEC, 0xBA, 0x99, 0x88, 0x87, 0x88, 0x89, 0xAB, 0xCD, 0xEF,
-    0xFF, 0xDD, 0xBB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xCC, 0xEF, 0xFF, 0xFF,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xED,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xDC, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xEE, 0xED,
-    0xDC, 0xDD, 0xED, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFE, 0xED, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xCD, 0xDC, 0xCC, 0xCD, 0xDE, 0xDD, 0xFF, 0xFF, 0xFF, 0xDD, 0xFE,
-    0xDC, 0xCC, 0xCB, 0xCC, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xDF, 0xDD, 0xCB,
-    0xBB, 0xBA, 0xBB, 0xBC, 0xCD, 0xEF, 0xEF, 0xFD, 0xFC, 0xCB, 0xA9, 0xA9,
-    0x99, 0x9A, 0xAB, 0xCD, 0xDF, 0xFE, 0xCE, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xEF, 0xFC, 0xCB, 0xAA, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCE, 0xFE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAC,
-    0xDE, 0xEC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x56, 0x77, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xEC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xB9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xCD, 0xDD, 0xDC, 0xB9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x99, 0xBB, 0xDF, 0xDE, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xED, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x89, 0xAA, 0xBD, 0xDD,
-    0xFF, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xEF, 0xFF,
-    0xFD, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEE, 0xFF, 0xFF, 0xED,
-    0xDC, 0xCB, 0xBC, 0xCB, 0xCD, 0xCD, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDD,
-    0xEC, 0xDC, 0xCC, 0xEF, 0xEF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFD, 0xED, 0xDD,
-    0xDC, 0xDD, 0xDD, 0xDF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBF, 0xEE, 0xED, 0xEF, 0xED, 0xEE, 0xFE, 0xEF, 0xFE, 0xFF, 0xAE, 0xFF,
-    0xFE, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xED, 0xCC, 0xCB,
-    0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCB, 0xAA, 0xAA, 0xAA,
-    0xBB, 0xCD, 0xEF, 0xFF, 0xFE, 0xFE, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0xAB,
-    0xCD, 0xFF, 0xFF, 0xEE, 0xDC, 0xA9, 0x88, 0x77, 0x77, 0x89, 0xAB, 0xDE,
-    0xFF, 0xFF, 0xFD, 0xBA, 0x97, 0x76, 0x55, 0x66, 0x89, 0xAC, 0xDF, 0xFE,
-    0xEE, 0xDB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xEE, 0xED,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xDF, 0xFE, 0xFF, 0xDB, 0xA8,
-    0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xEE, 0xFD, 0xCA, 0x87, 0x65,
-    0x44, 0x45, 0x68, 0x9B, 0xCE, 0xFF, 0xFF, 0xEC, 0xB9, 0x86, 0x65, 0x55,
-    0x67, 0x8A, 0xBD, 0xEF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x77, 0x89,
-    0xAB, 0xCF, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0xAB, 0xCD,
-    0xEF, 0xFF, 0xFF, 0xFE, 0xCB, 0xAA, 0x99, 0x9A, 0xAA, 0xBC, 0xDE, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xDC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xED, 0xDD, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xEF, 0xEF, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xEF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAE, 0xDD, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xFE, 0xEE, 0xFF, 0xBD, 0xFF,
-    0xEE, 0xED, 0xED, 0xEE, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE, 0xEE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xEE, 0xEE, 0xDC, 0xCB, 0xBB,
-    0xBB, 0xBC, 0xDD, 0xEE, 0xFF, 0xFE, 0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0xAA,
-    0xBB, 0xCD, 0xEF, 0xFF, 0xED, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0xAB,
-    0xCD, 0xEF, 0xFE, 0xDD, 0xDB, 0xA9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCE,
-    0xFF, 0xED, 0xDC, 0xBA, 0x97, 0x76, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFE,
-    0xDD, 0xCB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBC, 0xEF, 0xDD, 0xDC,
-    0xB9, 0x87, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCD, 0xEE, 0xDE, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xDF, 0xDD, 0xED, 0xBA, 0x97, 0x65,
-    0x44, 0x45, 0x78, 0x9A, 0xCD, 0xEE, 0xDE, 0xDC, 0xB9, 0x87, 0x65, 0x55,
-    0x67, 0x89, 0xBC, 0xDE, 0xDD, 0xEE, 0xDB, 0xA9, 0x87, 0x66, 0x77, 0x89,
-    0xAB, 0xCD, 0xFD, 0xDE, 0xED, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0x9A, 0xBC,
-    0xDF, 0xDD, 0xFE, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE,
-    0xDF, 0xFF, 0xED, 0xCC, 0xBB, 0xAB, 0xBB, 0xBC, 0xDE, 0xEF, 0xDD, 0xFF,
-    0xFF, 0xEE, 0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFE, 0xDF, 0xFF, 0xFF,
-    0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDE, 0xFE, 0xED, 0xFF, 0xFF, 0xFF, 0xEF,
-    0xEE, 0xEE, 0xFE, 0xFF, 0xFF, 0xFE, 0x9D, 0xEE, 0xDD, 0xDE, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xFE, 0xED, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xAB, 0xBA, 0xA9,
-    0x99, 0x88, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77,
-    0x88, 0x89, 0x99, 0xAB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98,
-    0x87, 0x76, 0x66, 0x55, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x99, 0x87, 0x76, 0x66,
-    0x65, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x67, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89,
-    0xAA, 0xAA, 0xA9, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xAB, 0xCB,
-    0xA9, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAA, 0xAB, 0xCB, 0xBC, 0xBA, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBC, 0xCC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xAC, 0xBB, 0xBA, 0xAA, 0x99, 0x99,
-    0xAA, 0xAA, 0xAB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xAB, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCC, 0xAB, 0xBA, 0xA9,
-    0x99, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x99, 0xAB, 0xBB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x78, 0x89, 0x99, 0xAB, 0xA9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98,
-    0x87, 0x76, 0x66, 0x56, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x88, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x98, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x99, 0xAA, 0x9A, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x89,
-    0xAA, 0xAA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA,
-    0xAB, 0xA9, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB,
-    0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xBC, 0xDC, 0xBB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xAC, 0xBB, 0xBA, 0xAA, 0xA9, 0x99,
-    0xAA, 0xAA, 0xAB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xBD, 0xAB, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xDC, 0xBC, 0xBA, 0xA9,
-    0x99, 0x89, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xBB, 0xBC, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77,
-    0x78, 0x89, 0x9A, 0xBC, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98,
-    0x87, 0x76, 0x66, 0x65, 0x66, 0x66, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x67, 0x88, 0x9A, 0x99, 0x99, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x87, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x99, 0xAA, 0x9A, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89,
-    0xAA, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xBB, 0xCB,
-    0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCB, 0xCC, 0xCB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBC, 0xDC, 0xBC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xAD, 0xCB, 0xBA, 0xAA, 0xAA, 0x9A,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCC, 0xCC, 0xBC, 0xCB, 0xCB, 0xCC, 0xCC, 0xCD, 0xDD, 0x9C, 0xED,
-    0xCD, 0xCC, 0xCB, 0xCC, 0xCC, 0xCD, 0xEE, 0xEF, 0xFD, 0xCD, 0xCC, 0xCB,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xDC, 0xCC, 0xBA, 0xAA, 0x99,
-    0x9A, 0xAA, 0xBB, 0xBC, 0xDE, 0xFD, 0xCD, 0xBB, 0xA9, 0x98, 0x88, 0x89,
-    0x9A, 0xAB, 0xCC, 0xEE, 0xDC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xBC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x89, 0xBB,
-    0xCE, 0xDC, 0xCB, 0xA8, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xBC, 0xBA, 0x87, 0x66, 0x55, 0x45, 0x66, 0x78, 0x9A, 0xCD, 0xCC, 0xCB,
-    0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAC, 0xCC, 0xCC, 0xBA, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xCD, 0xCC, 0xAA, 0x98, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDC, 0xDD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xED, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xDC,
-    0xDE, 0xDD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xDD, 0xEE,
-    0xDD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0xDF, 0xFE, 0xEE,
-    0xDC, 0xCC, 0xCB, 0xCC, 0xCC, 0xCD, 0xDE, 0xDE, 0xFF, 0xFF, 0xEE, 0xDD,
-    0xDC, 0xCD, 0xDD, 0xDD, 0xED, 0xED, 0xAE, 0xDD, 0xDD, 0xCD, 0xCC, 0xCC,
-    0xCC, 0xCD, 0xDD, 0xDD, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFE, 0xEE, 0xDD, 0xDD, 0xDD, 0xEE, 0xEF, 0xEF, 0xFF, 0xBF, 0xFF,
-    0xFF, 0xDD, 0xDD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD,
-    0xCC, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFE, 0xDC, 0xCB, 0xAA,
-    0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, 0xEF, 0xDC, 0xBB, 0xA9, 0x99, 0x99,
-    0x9A, 0xBC, 0xDE, 0xFF, 0xFE, 0xED, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x9A,
-    0xBC, 0xDF, 0xFF, 0xED, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC,
-    0xEF, 0xFD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xCE, 0xFF,
-    0xED, 0xBA, 0x97, 0x65, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xDE, 0xFD, 0xCB,
-    0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xEF, 0xDD, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xEE, 0xDC, 0xA9, 0x76, 0x55,
-    0x44, 0x55, 0x67, 0x9A, 0xBD, 0xEF, 0xEE, 0xCA, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAC, 0xDF, 0xFE, 0xED, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78,
-    0x9B, 0xCD, 0xEE, 0xFF, 0xDC, 0xBA, 0x98, 0x77, 0x77, 0x88, 0x9A, 0xBC,
-    0xEF, 0xFF, 0xFE, 0xDC, 0xBA, 0x99, 0x88, 0x89, 0xAA, 0xBC, 0xDE, 0xFF,
-    0xFF, 0xFF, 0xDC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xDC, 0xCB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xED, 0xDD, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xAF, 0xFA, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0x9F, 0xAA, 0xBA, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0x98, 0x89, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x76, 0x78, 0x78, 0x8F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xF7, 0x64, 0x56, 0x78, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xA9, 0x74, 0x22, 0x57, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x97, 0x52, 0x14, 0x69, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x86,
-    0x44, 0x57, 0x8A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x76, 0x77,
-    0x89, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x89, 0x99, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xAF, 0xFA, 0xFF, 0xFF,
-    0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA,
-    0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xAF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x79, 0xFA, 0xCF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xAF, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xEE, 0xEE, 0xCD, 0xEE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xFF, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFD, 0xDC, 0xBB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE, 0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x88, 0xAB,
-    0xCD, 0xDC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xBB, 0xA9, 0x87,
-    0x65, 0x55, 0x45, 0x56, 0x77, 0x9A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x99, 0xAC, 0xDD, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xDC, 0xBA, 0x99, 0x88, 0x78, 0x88, 0x89, 0xAA, 0xBC, 0xDD,
-    0xEE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xDE, 0xFE,
-    0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDD, 0xED, 0xFF, 0xFE, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xED, 0xDD,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFE, 0xCF, 0xFF, 0xEE, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDE, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEF, 0xFF, 0xBF, 0xEF,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xCB,
-    0xBB, 0xBA, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFD, 0xED, 0xCB, 0xBA, 0xA9,
-    0x99, 0x9A, 0xBB, 0xCD, 0xEF, 0xFF, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x88,
-    0x89, 0xAB, 0xCD, 0xEF, 0xED, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89,
-    0xAB, 0xDE, 0xFF, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAC,
-    0xDE, 0xED, 0xCB, 0xA9, 0x77, 0x66, 0x55, 0x56, 0x67, 0x8A, 0xBC, 0xDE,
-    0xDC, 0xBA, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCE, 0xED, 0xCB,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xDC, 0xB9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xEC, 0xCB, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDF, 0xDD, 0xBA, 0x97, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0xAB, 0xCD, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x9A, 0xBD, 0xDF, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xAC,
-    0xDF, 0xDF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xBB, 0xCD, 0xEE,
-    0xFF, 0xFC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xEF, 0xFF, 0xFE,
-    0xEC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xED, 0xEF, 0xFF, 0xED,
-    0xDD, 0xCB, 0xCB, 0xCC, 0xDD, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xEE, 0xED,
-    0xDD, 0xDE, 0xEE, 0xEE, 0xFF, 0xFE, 0xAE, 0xFF, 0xEE, 0xEE, 0xEE, 0xED,
-    0xFD, 0xED, 0xFE, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xFE, 0xFF, 0xEE, 0xEF, 0xEF, 0xDF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF,
-    0xFF, 0xFE, 0xEE, 0xDD, 0xDF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFD,
-    0xDD, 0xCB, 0xBC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCB, 0xBA,
-    0xAA, 0xBB, 0xBC, 0xDF, 0xFF, 0xFF, 0xEF, 0xDD, 0xCB, 0xA9, 0x99, 0x99,
-    0x9A, 0xBC, 0xDF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x77, 0x88, 0x9A,
-    0xBC, 0xDF, 0xFF, 0xFE, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBD,
-    0xFF, 0xFE, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9B, 0xDE, 0xFF,
-    0xEE, 0xCA, 0x98, 0x65, 0x54, 0x45, 0x56, 0x79, 0xAC, 0xEF, 0xFF, 0xDC,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xCD, 0xFF, 0xED, 0xCA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xDF, 0xFE, 0xEC, 0xA9, 0x86, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAC, 0xDF, 0xFF, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x89,
-    0xAB, 0xCE, 0xEF, 0xFF, 0xEC, 0xBA, 0x98, 0x87, 0x77, 0x89, 0x9B, 0xCD,
-    0xEF, 0xFF, 0xFF, 0xEC, 0xBA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF,
-    0xFF, 0xFE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xDD, 0xCB, 0xCB, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBB, 0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xAB, 0xCC, 0xCD, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xEE, 0xBC, 0xBB, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBC, 0xCA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x99,
-    0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB,
-    0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xB9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAB, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xAA, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0xAA, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xBB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB,
-    0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBC, 0xCC,
-    0xBB, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xA9, 0xAA, 0xAB, 0xBB, 0xCD, 0xCD, 0xDD, 0xDC, 0xCB, 0xBB,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xEC, 0xAE, 0xDD, 0xCC, 0xBB, 0xAA, 0xAA,
-    0xAB, 0xBB, 0xBC, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCB, 0x9B, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBC, 0xCC, 0xAB, 0xA9, 0x98, 0x88, 0x87, 0x77,
-    0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xAA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xB9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB,
-    0x9A, 0x98, 0x87, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x87, 0x76, 0x65,
-    0x55, 0x66, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66,
-    0x67, 0x78, 0x89, 0xAA, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x67, 0x77,
-    0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBB,
-    0xBB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCC, 0xBB,
-    0xAA, 0xA9, 0x99, 0xAA, 0xAB, 0xBB, 0xDD, 0xBC, 0xDC, 0xCC, 0xCB, 0xBA,
-    0xAA, 0xBA, 0xBB, 0xBC, 0xCC, 0xDC, 0x9C, 0xCC, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAB, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xAB, 0xBA, 0xA9,
-    0x99, 0x98, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x78, 0x89, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98,
-    0x87, 0x76, 0x66, 0x55, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x88, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBA,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xAB, 0xBB,
-    0xAA, 0x99, 0x99, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xCB, 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0x9C, 0xDC,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEC, 0xBC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCE, 0xCB, 0xCB, 0xBA, 0x99, 0x98,
-    0x88, 0x89, 0x99, 0xAB, 0xBC, 0xDC, 0xBB, 0xBA, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0xAA, 0xBC, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x99,
-    0xBC, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x89, 0x9A, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x87, 0x76, 0x65, 0x66,
-    0x66, 0x78, 0x89, 0xAB, 0xBB, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xCB, 0xBB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xCC,
-    0xBC, 0xBB, 0x99, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xCC, 0xDC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xDD, 0xDC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCC, 0xCD, 0xDD, 0xDE, 0xCD, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCD, 0xDD, 0xED, 0x9D, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAE, 0xDE, 0xDD, 0xED, 0xDC, 0xCC, 0xDC, 0xDD, 0xDD, 0xDD, 0x9E, 0xFF,
-    0xFF, 0xFD, 0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEF, 0xFD, 0xEF, 0xEE, 0xED,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEF, 0xEE, 0xEF, 0xDE, 0xEF, 0xDD, 0xDC, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFD, 0xDF, 0xED, 0xCC, 0xBB, 0xBB, 0xBB,
-    0xBC, 0xCD, 0xDD, 0xFF, 0xDE, 0xEE, 0xDC, 0xBA, 0x99, 0x99, 0x9A, 0xBC,
-    0xCE, 0xFE, 0xFD, 0xDF, 0xDC, 0xBA, 0x98, 0x87, 0x88, 0x9A, 0xBC, 0xDE,
-    0xFE, 0xDD, 0xEE, 0xCB, 0xA8, 0x76, 0x66, 0x67, 0x9A, 0xBC, 0xEE, 0xFD,
-    0xDE, 0xDC, 0xA9, 0x86, 0x54, 0x45, 0x68, 0x9B, 0xCD, 0xEF, 0xED, 0xED,
-    0xCB, 0x97, 0x64, 0x32, 0x46, 0x79, 0xBC, 0xDE, 0xFE, 0xDE, 0xEC, 0xB9,
-    0x86, 0x42, 0x24, 0x57, 0x9A, 0xCD, 0xEF, 0xDD, 0xED, 0xCB, 0x98, 0x75,
-    0x44, 0x56, 0x79, 0xAC, 0xDE, 0xEE, 0xDF, 0xED, 0xCA, 0x98, 0x76, 0x66,
-    0x78, 0x9B, 0xCD, 0xFF, 0xED, 0xEF, 0xDC, 0xBA, 0x98, 0x77, 0x78, 0x9A,
-    0xBC, 0xDE, 0xFE, 0xDF, 0xED, 0xDC, 0xBA, 0x99, 0x99, 0x9A, 0xBC, 0xDD,
-    0xEF, 0xEE, 0xFF, 0xED, 0xCC, 0xBB, 0xAA, 0xBB, 0xBC, 0xDD, 0xEF, 0xFE,
-    0xDF, 0xFE, 0xEE, 0xDC, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xEE, 0xFE,
-    0xFE, 0xEE, 0xEE, 0xDD, 0xDD, 0xED, 0xEE, 0xEE, 0xFE, 0xEE, 0xEF, 0xFF,
-    0xEE, 0xEE, 0xDE, 0xEE, 0xFE, 0xFF, 0xFF, 0xEE, 0xFF, 0xFF, 0xFE, 0xEF,
-    0xEF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xAE, 0xDD, 0xDD, 0xEE, 0xDD, 0xDD,
-    0xEE, 0xDE, 0xEE, 0xFE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0xFE, 0xEF, 0xFF, 0xEF, 0xAF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xEE, 0xDE, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xEC, 0xCC,
-    0xCC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEC, 0xBA, 0xAA, 0xAA,
-    0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xDE, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAC, 0xDF,
-    0xFF, 0xFF, 0xFE, 0xCB, 0x98, 0x66, 0x55, 0x66, 0x89, 0xBC, 0xDF, 0xFF,
-    0xFF, 0xDC, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xCD, 0xFF, 0xFF, 0xFD,
-    0xCA, 0x86, 0x54, 0x33, 0x45, 0x68, 0xAC, 0xDF, 0xFF, 0xFF, 0xDC, 0xA8,
-    0x75, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xEF, 0xFE, 0xFE, 0xCA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAC, 0xDF, 0xFF, 0xFF, 0xED, 0xB9, 0x86, 0x65, 0x55,
-    0x67, 0x9B, 0xCE, 0xFF, 0xFF, 0xFF, 0xDB, 0xA9, 0x87, 0x66, 0x77, 0x8A,
-    0xBD, 0xEF, 0xFF, 0xFF, 0xFF, 0xDB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xFE, 0xDC, 0xBA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xDD, 0xCC, 0xBC, 0xCD, 0xDE, 0xEF, 0xFF, 0xFE, 0xFF,
-    0xFF, 0xFF, 0xED, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDE, 0xDD, 0xDD, 0xCC, 0xDD, 0xDD, 0xEE, 0xDE, 0xEF, 0xAE, 0xFE,
-    0xEE, 0xDD, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xDF, 0xDE, 0xDC,
-    0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xFE, 0xEF, 0xEE, 0xFD, 0xDC, 0xBA, 0xAA,
-    0x9A, 0xAA, 0xBC, 0xDD, 0xEF, 0xFF, 0xDD, 0xDC, 0xBA, 0xA9, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xFF, 0xFC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAC, 0xDD, 0xFE, 0xDD, 0xCA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xBC,
-    0xDE, 0xFC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xEF,
-    0xDD, 0xBA, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0xAB, 0xDE, 0xEC, 0xCB,
-    0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBD, 0xEF, 0xCC, 0xBA, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xDD, 0xDB, 0xA8, 0x76, 0x55,
-    0x44, 0x55, 0x67, 0x89, 0xBC, 0xEE, 0xDD, 0xCA, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAB, 0xCE, 0xED, 0xDC, 0xB9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xFE, 0xED, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xED, 0xEE, 0xCB, 0xAA, 0x98, 0x88, 0x89, 0x9A, 0xBC, 0xDD, 0xEE,
-    0xEF, 0xED, 0xCC, 0xBA, 0xA9, 0x99, 0xAA, 0xBB, 0xCD, 0xEF, 0xED, 0xFE,
-    0xED, 0xDC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xFE, 0xFF, 0xFF, 0xED,
-    0xDD, 0xDC, 0xCD, 0xCD, 0xDD, 0xEE, 0xFF, 0xEE, 0xFF, 0xFF, 0xFE, 0xEE,
-    0xDE, 0xDD, 0xEE, 0xEF, 0xFF, 0xFF, 0x9F, 0xEE, 0xED, 0xFE, 0xEF, 0xEE,
-    0xDF, 0xEE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDC, 0xCC, 0xCB, 0xCC, 0xCC, 0xDD, 0xEE, 0xEE, 0xBE, 0xFE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xFD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xEE, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xBC, 0xDE, 0xEC, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCD, 0xEC, 0xCA, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xDD,
-    0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCC, 0xDC, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xBA, 0x87, 0x66, 0x55, 0x55,
-    0x67, 0x78, 0x9A, 0xCD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xDD, 0xCA, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xCD, 0xDD, 0xEC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD,
-    0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEE, 0xEE,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xEF, 0xFE, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xEE, 0xFF, 0xFF, 0xED, 0xDD,
-    0xDC, 0xCD, 0xDD, 0xDE, 0xEF, 0xFE, 0xBE, 0xFE, 0xEE, 0xED, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xEE, 0xEE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDD, 0xDD, 0x9D, 0xFF,
-    0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xEF, 0xFD, 0xEE, 0xDD, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEF, 0xDE, 0xED, 0xCB, 0xBA, 0xA9,
-    0x99, 0x9A, 0xAB, 0xCD, 0xDE, 0xFE, 0xDD, 0xCB, 0xAA, 0x99, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xEF, 0xDC, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xFD, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCE, 0xEC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x56, 0x77, 0x8A, 0xBD, 0xED,
-    0xCC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCB,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xBB, 0xDD, 0xCC, 0xB9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xDB, 0x98, 0x76, 0x55,
-    0x45, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xBA, 0x97, 0x76, 0x55, 0x55,
-    0x67, 0x88, 0xAA, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xAB,
-    0xCD, 0xDE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xDD,
-    0xEE, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xEE, 0xDE, 0xFD,
-    0xDD, 0xCB, 0xBA, 0xBA, 0xAB, 0xBB, 0xCC, 0xDD, 0xFD, 0xFF, 0xFE, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xCC, 0xDC, 0xDD, 0xFE, 0xEF, 0xFF, 0xEF, 0xEE, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDF, 0xFF, 0xEF, 0xAD, 0xDD, 0xDD, 0xDE, 0xDC, 0xDD,
-    0xDD, 0xDC, 0xDD, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xDD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC,
-    0xBC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0xAA, 0xAA,
-    0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAC,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x88, 0x76, 0x77, 0x89, 0xAC, 0xDF,
-    0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x66, 0x55, 0x67, 0x89, 0xBC, 0xFF, 0xFF,
-    0xFF, 0xFC, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xCF, 0xFF, 0xFF, 0xFD,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x68, 0xAB, 0xDF, 0xFF, 0xFF, 0xDC, 0xA8,
-    0x75, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xCA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xFC, 0xB9, 0x86, 0x65, 0x55,
-    0x67, 0x9A, 0xCD, 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x77, 0x8A,
-    0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x88, 0x88, 0x99, 0xBC, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xAA, 0xAA, 0xBC, 0xCF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xEC, 0xCC, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDD, 0xCD, 0xCC, 0xCC, 0xDD, 0xDE, 0xDE, 0xEE, 0x9E, 0xFF,
-    0xED, 0xDD, 0xDC, 0xCC, 0xCD, 0xDE, 0xFE, 0xFF, 0xFF, 0xDF, 0xED, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFE, 0xEE, 0xDC, 0xBA, 0xAA,
-    0x9A, 0xAA, 0xBB, 0xCD, 0xDF, 0xFE, 0xDD, 0xDC, 0xBA, 0xA9, 0x98, 0x89,
-    0x9A, 0xAB, 0xCD, 0xEF, 0xED, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xEE, 0xCC, 0xCB, 0xA8, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xDE, 0xEC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xED,
-    0xCC, 0xBA, 0x98, 0x76, 0x54, 0x55, 0x66, 0x79, 0xAB, 0xCE, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x34, 0x45, 0x67, 0x8A, 0xBC, 0xED, 0xDC, 0xBA, 0x87,
-    0x65, 0x54, 0x34, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x65,
-    0x44, 0x56, 0x67, 0x9A, 0xBC, 0xDD, 0xCD, 0xCA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCD, 0xDD, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9A, 0xBC, 0xED, 0xDE, 0xDC, 0xA9, 0x98, 0x77, 0x77, 0x89, 0x9A, 0xBC,
-    0xDD, 0xDD, 0xFD, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBC, 0xCD, 0xFE,
-    0xEF, 0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xED, 0xFF,
-    0xED, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xFE, 0xEF, 0xFF, 0xED,
-    0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDF, 0xFF, 0xED, 0xFF, 0xFF, 0xEE, 0xED,
-    0xDD, 0xDD, 0xEE, 0xEF, 0xFF, 0xFE, 0x9E, 0xDD, 0xED, 0xDD, 0xDD, 0xDD,
-    0xED, 0xDD, 0xDE, 0xEE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0x9B, 0xDC,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xED, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xCB, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBC, 0xDC, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0xAA, 0xCC, 0xCA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAB, 0xCB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x9A,
-    0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x87, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66,
-    0x67, 0x78, 0x89, 0xAB, 0xBA, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBB, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xBB, 0xBB, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCC, 0xDC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xCD, 0xDC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xCC, 0xDD, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEC, 0x8D, 0xCC, 0xCB, 0xBB, 0xBA, 0xAA,
-    0xBB, 0xBB, 0xBC, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0x9B, 0xCC,
-    0xBB, 0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xAB, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCC, 0xCA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBB, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x66, 0x66, 0x66,
-    0x67, 0x78, 0x89, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x77,
-    0x89, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBB,
-    0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xA9, 0x9A, 0xAA, 0xAB, 0xBB, 0xCC, 0xBC, 0xDC, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xDC, 0x9C, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xAB, 0xBB, 0xCC, 0x8B, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xCB, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77,
-    0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xAA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAB, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x9A,
-    0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66,
-    0x67, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x67, 0x77,
-    0x89, 0xAA, 0xBA, 0xAB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xAB, 0xBB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xBB,
-    0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xCC,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xCD, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xCD, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBA, 0xBB, 0xBB, 0xBC, 0xCD, 0xDC, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDC, 0xCC, 0xCC, 0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xDD, 0x8D, 0xEE,
-    0xDD, 0xCC, 0xCC, 0xCB, 0xCC, 0xDD, 0xEF, 0xEE, 0xFE, 0xDE, 0xDC, 0xCC,
-    0xBB, 0xAB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xED, 0xDD, 0xCB, 0xBA, 0xA9,
-    0x99, 0xAA, 0xAB, 0xBC, 0xDD, 0xFD, 0xCD, 0xCB, 0xAA, 0x99, 0x88, 0x88,
-    0x99, 0xAA, 0xBC, 0xDE, 0xDC, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAA, 0xCD, 0xDD, 0xCC, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCE, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x8A, 0xBC, 0xDD,
-    0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9B, 0xBC, 0xDB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAC, 0xCC, 0xCB, 0xB9, 0x87,
-    0x65, 0x54, 0x34, 0x56, 0x78, 0x9A, 0xCC, 0xCC, 0xCA, 0x98, 0x76, 0x55,
-    0x54, 0x56, 0x67, 0x89, 0xAB, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x89, 0x9A, 0xCC, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBB,
-    0xCD, 0xDD, 0xEC, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xDD,
-    0xDD, 0xEC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDD, 0xDD, 0xFE,
-    0xDC, 0xCB, 0xBB, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xED, 0xEF, 0xEE, 0xDD,
-    0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFF, 0xEE, 0xDE, 0xDD,
-    0xCD, 0xDC, 0xDD, 0xED, 0xEF, 0xEE, 0x9E, 0xEE, 0xDD, 0xDD, 0xDC, 0xCC,
-    0xCC, 0xCD, 0xDD, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xAF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xED, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xCB,
-    0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xDC, 0xBA, 0xAA, 0xAA,
-    0xBB, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xCD, 0xFF, 0xFF, 0xFF, 0xEC, 0xBA, 0x98, 0x76, 0x67, 0x89, 0xAB, 0xDD,
-    0xFF, 0xFF, 0xED, 0xCA, 0x98, 0x66, 0x55, 0x66, 0x89, 0xBC, 0xDF, 0xFF,
-    0xFF, 0xDB, 0xA8, 0x76, 0x54, 0x44, 0x67, 0x8A, 0xBC, 0xFF, 0xFF, 0xFD,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x68, 0xAB, 0xEF, 0xFF, 0xFF, 0xDB, 0xA8,
-    0x65, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xEF, 0xFE, 0xFD, 0xCA, 0x87, 0x64,
-    0x44, 0x56, 0x78, 0xAB, 0xDE, 0xFF, 0xEF, 0xDC, 0xB9, 0x86, 0x65, 0x56,
-    0x67, 0x9A, 0xCD, 0xFF, 0xFE, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x77, 0x8A,
-    0xBC, 0xDF, 0xFF, 0xEF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBB, 0xDE,
-    0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0xAA, 0xA9, 0xAA, 0xBB, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDD, 0xDC, 0xCB, 0xBB, 0xBC, 0xCE, 0xFF, 0xFF, 0xFD, 0xFF,
-    0xFF, 0xFF, 0xDD, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDF, 0xEE, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xED, 0xED, 0xDD, 0xCC, 0xCD, 0xDD, 0xDD, 0xED, 0xDE, 0x9E, 0xFF,
-    0xFE, 0xDD, 0xDC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFE, 0xFE, 0xFE, 0xED, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xEF, 0xED, 0xFE, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xFF, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99,
-    0x9A, 0xBC, 0xCD, 0xEF, 0xEC, 0xDC, 0xBB, 0xA9, 0x88, 0x77, 0x88, 0x9A,
-    0xBC, 0xCE, 0xEE, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC,
-    0xEF, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xEE,
-    0xDC, 0xBA, 0x98, 0x66, 0x54, 0x45, 0x56, 0x89, 0xAC, 0xCD, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xDD, 0xDD, 0xDB, 0xA9, 0x86, 0x55,
-    0x44, 0x55, 0x67, 0x9A, 0xBD, 0xDD, 0xDE, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAB, 0xDE, 0xED, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x89,
-    0xAB, 0xCD, 0xEE, 0xDE, 0xDC, 0xAA, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC,
-    0xDE, 0xED, 0xED, 0xDB, 0xBA, 0x99, 0x99, 0x99, 0x9A, 0xBC, 0xDD, 0xEF,
-    0xEE, 0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xEF, 0xFD, 0xEF,
-    0xDD, 0xDC, 0xCB, 0xBB, 0xBB, 0xCC, 0xDE, 0xEE, 0xFF, 0xDF, 0xFF, 0xED,
-    0xDD, 0xCC, 0xDD, 0xCD, 0xDE, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xEE, 0xEE,
-    0xDF, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0x9D, 0xED, 0xDE, 0xDE, 0xDE, 0xED,
-    0xEE, 0xEE, 0xFF, 0xEF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xED, 0xDC, 0xCC, 0xBC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDD, 0xAE, 0xFE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDE, 0xEF, 0xFE, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEF, 0xED, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xEE, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x89,
-    0xAA, 0xCC, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDC, 0xBA, 0x98, 0x87, 0x65, 0x55, 0x56, 0x77, 0x89, 0xBC, 0xDD,
-    0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xBA, 0x87, 0x76, 0x55, 0x55,
-    0x67, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB,
-    0xCD, 0xDD, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDE,
-    0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEE, 0xEE,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xDF, 0xED, 0xDD,
-    0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xED, 0xFF, 0xEE, 0xED, 0xDD,
-    0xCD, 0xCD, 0xDD, 0xEE, 0xFF, 0xFF, 0xAE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDE, 0xEE, 0xEF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xED, 0xDD, 0xDC, 0xDC, 0xDC, 0xCC, 0xCD, 0xDD, 0xDD, 0x8E, 0xFE,
-    0xEE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDD, 0xEE, 0xEE, 0xFE, 0xEF, 0xEE, 0xDC,
-    0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xEF, 0xDE, 0xFE, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0xED, 0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99,
-    0x9A, 0xBB, 0xCD, 0xDF, 0xDD, 0xEC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x9A,
-    0xBB, 0xDD, 0xFD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC,
-    0xDD, 0xEC, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xEC,
-    0xCC, 0xBA, 0x98, 0x75, 0x54, 0x45, 0x56, 0x89, 0xAB, 0xCE, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xDC, 0xA9, 0x86, 0x55,
-    0x44, 0x55, 0x78, 0x9A, 0xBC, 0xDD, 0xDD, 0xCA, 0x98, 0x76, 0x55, 0x56,
-    0x67, 0x89, 0xAC, 0xDD, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x77, 0x89,
-    0xAB, 0xBD, 0xED, 0xCD, 0xDC, 0xB9, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC,
-    0xDE, 0xED, 0xDE, 0xCB, 0xBA, 0x99, 0x98, 0x99, 0xAB, 0xBB, 0xCD, 0xEE,
-    0xDE, 0xED, 0xDC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEE, 0xDD, 0xEE,
-    0xDC, 0xDC, 0xBC, 0xBC, 0xBB, 0xCC, 0xCD, 0xDD, 0xFD, 0xDF, 0xEE, 0xDE,
-    0xDC, 0xCD, 0xCD, 0xDD, 0xDD, 0xDE, 0xEE, 0xED, 0xEF, 0xEF, 0xFF, 0xEE,
-    0xED, 0xDE, 0xED, 0xDD, 0xFF, 0xFD, 0x9D, 0xDD, 0xDE, 0xCD, 0xDC, 0xDD,
-    0xDD, 0xED, 0xDE, 0xEF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFD, 0xDF, 0xDD, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC,
-    0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBB, 0xBB,
-    0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBB, 0xA9, 0x99, 0x9A, 0xBC,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x87, 0x78, 0x8A, 0xBC, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xCB, 0xA8, 0x76, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xB9, 0x76, 0x54, 0x45, 0x68, 0x9B, 0xCF, 0xFF, 0xFF, 0xFF,
-    0xCB, 0x97, 0x54, 0x23, 0x45, 0x79, 0xBC, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9,
-    0x75, 0x43, 0x24, 0x57, 0x9B, 0xCF, 0xFF, 0xFF, 0xFF, 0xDB, 0x98, 0x65,
-    0x44, 0x56, 0x79, 0xBC, 0xFF, 0xFF, 0xFF, 0xFD, 0xCA, 0x87, 0x65, 0x56,
-    0x78, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x88, 0x77, 0x78, 0x9A,
-    0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x99, 0x99, 0xAA, 0xCD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xBA, 0xBB, 0xCD, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDD, 0xFC, 0xCC, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDD, 0x9E, 0xEF,
-    0xDD, 0xCC, 0xCB, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFE, 0xDE, 0xED, 0xCC,
-    0xCB, 0xBA, 0xBA, 0xBB, 0xCD, 0xCD, 0xEE, 0xEE, 0xED, 0xCC, 0xBA, 0xA9,
-    0x99, 0x9A, 0xBB, 0xBD, 0xDD, 0xFE, 0xDE, 0xCB, 0xBA, 0x99, 0x88, 0x88,
-    0x99, 0xAB, 0xBC, 0xDE, 0xDC, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAB, 0xCD, 0xEE, 0xCD, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x78, 0x89, 0xBB,
-    0xCE, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x87, 0x66, 0x54, 0x45, 0x56, 0x78, 0x9B, 0xCD, 0xCB, 0xCB,
-    0x98, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xCD, 0xCC, 0xB9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA8, 0x76, 0x65,
-    0x44, 0x56, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x88,
-    0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xEC, 0xBB, 0xA9, 0x98, 0x88, 0x99, 0x99, 0xBB, 0xCD, 0xDD,
-    0xCE, 0xDC, 0xCB, 0xAA, 0xA9, 0x99, 0xAA, 0xBB, 0xBD, 0xDF, 0xDD, 0xEE,
-    0xDD, 0xCB, 0xBB, 0xBA, 0xAB, 0xBC, 0xCD, 0xDE, 0xFE, 0xDE, 0xEE, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xED, 0xFF, 0xEE, 0xDD, 0xDD,
-    0xDC, 0xDE, 0xDD, 0xEE, 0xEF, 0xFD, 0x8D, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC,
-    0xDC, 0xDD, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0x8C, 0xDC,
-    0xCB, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xBA,
-    0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xCB, 0xCB, 0xBA, 0xA9, 0x98,
-    0x88, 0x99, 0x99, 0xAB, 0xBC, 0xDC, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xCC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBC, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xBB,
-    0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9,
-    0x87, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x77,
-    0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x66, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x89, 0xAB, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCC, 0xCC,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xEC, 0xCD, 0xDC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDE, 0xCC, 0xED, 0xCC, 0xCC, 0xCB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xDD, 0x8C, 0xCB, 0xCB, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xCB, 0xCC, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCB,
-    0xBA, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xAB, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0xAA, 0xBB, 0xA9, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x67, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x67, 0x77,
-    0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBA,
-    0xAB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xBB,
-    0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBB, 0xCC, 0xCB, 0xBB, 0xBA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8B, 0xDC,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xDB, 0xBC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x99, 0x9A, 0xAB, 0xBB, 0xDB, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBA,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9,
-    0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87,
-    0x65, 0x54, 0x55, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xAA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAB, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x67, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x89, 0xAA, 0xBA, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xBB, 0xBA, 0xBB, 0xAA, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xCB, 0xBC, 0xCC, 0xBB,
-    0xAB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xBC, 0xDC, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0x8B, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBE, 0xDD, 0xCC, 0xCC, 0xCC, 0xBC, 0xCC, 0xCC, 0xCC, 0xDC, 0x8E, 0xEE,
-    0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFD, 0xEE, 0xED, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDD, 0xED, 0xCC, 0xBA, 0xAA,
-    0xA9, 0xAA, 0xAB, 0xCC, 0xDE, 0xFD, 0xCD, 0xDC, 0xBA, 0x99, 0x98, 0x89,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x99,
-    0xAB, 0xCD, 0xED, 0xCD, 0xBB, 0x99, 0x87, 0x66, 0x66, 0x78, 0x8A, 0xBB,
-    0xCD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xBC, 0xBA, 0x97, 0x66, 0x54, 0x45, 0x66, 0x89, 0xAB, 0xCD, 0xCC, 0xCB,
-    0x98, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xDD, 0xBC, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0x9A, 0xCD, 0xCC, 0xCB, 0xA9, 0x86, 0x65,
-    0x44, 0x56, 0x67, 0x9A, 0xAC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xA9, 0x98, 0x76, 0x66, 0x67, 0x88,
-    0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xDD, 0xCB, 0xA9, 0x99, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xDD,
-    0xCD, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xDD, 0xEE,
-    0xDC, 0xCB, 0xBB, 0xBA, 0xBB, 0xBC, 0xCC, 0xDE, 0xEE, 0xEE, 0xFE, 0xDD,
-    0xCC, 0xBC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xED, 0xFE, 0xEE, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xEE, 0xEF, 0xFD, 0x9D, 0xED, 0xCC, 0xDC, 0xCC, 0xDC,
-    0xDD, 0xDD, 0xEE, 0xED, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xEE, 0xFE, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDC,
-    0xDC, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xBB, 0xBB,
-    0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDB, 0xAA, 0x9A, 0xAB, 0xCC,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBD, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x78, 0x9B, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xBA, 0x86, 0x54, 0x45, 0x78, 0xAC, 0xDE, 0xFF, 0xFF, 0xFF,
-    0xDB, 0x98, 0x64, 0x22, 0x46, 0x89, 0xBC, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA,
-    0x86, 0x42, 0x24, 0x68, 0x9B, 0xDE, 0xFF, 0xFD, 0xFF, 0xCC, 0xA8, 0x75,
-    0x44, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0x98, 0x76, 0x66,
-    0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCA, 0x98, 0x88, 0x89, 0xAB,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0x9A, 0xAB, 0xCD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xCB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFF,
-    0xEF, 0xFE, 0xFE, 0xDD, 0xDC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF,
-    0xFF, 0xFF, 0xEF, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF,
-    0xEF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDE, 0xDE, 0xDE,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xCC, 0xDD, 0x9E, 0xEE,
-    0xEE, 0xED, 0xDC, 0xCD, 0xCD, 0xDD, 0xDD, 0xEF, 0xED, 0xEE, 0xDD, 0xCC,
-    0xCC, 0xBB, 0xCB, 0xCC, 0xDD, 0xDE, 0xEF, 0xDD, 0xEE, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAB, 0xBC, 0xCC, 0xDE, 0xEE, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99,
-    0xAA, 0xBC, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x78, 0x88, 0x9A,
-    0xBC, 0xCD, 0xDD, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x56, 0x78, 0xAB, 0xCD, 0xED,
-    0xCD, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x57, 0x89, 0xBB, 0xCD, 0xDC, 0xDB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x68, 0x9A, 0xBC, 0xDD, 0xDD, 0xBA, 0x98,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x55,
-    0x44, 0x55, 0x68, 0x9A, 0xCC, 0xED, 0xCC, 0xCB, 0xA8, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAB, 0xDD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x89,
-    0xAB, 0xCD, 0xED, 0xCD, 0xCC, 0xBA, 0x98, 0x88, 0x78, 0x89, 0x9A, 0xCC,
-    0xDE, 0xEC, 0xDC, 0xCB, 0xBA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xEE,
-    0xDD, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDE, 0xEE, 0xED, 0xED,
-    0xDD, 0xDC, 0xCB, 0xBB, 0xBB, 0xBD, 0xCD, 0xFE, 0xEE, 0xCE, 0xEE, 0xDD,
-    0xDD, 0xDC, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEC, 0xFE, 0xEE, 0xFE, 0xFD,
-    0xDD, 0xDD, 0xEE, 0xEF, 0xEF, 0xFE, 0x8D, 0xDC, 0xDD, 0xDD, 0xCD, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xFE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDD, 0xAD, 0xEE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xDE, 0xFD, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xBC, 0xDD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAC, 0xCC,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xBB, 0xB9, 0x88, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xED,
-    0xCD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xDD, 0xDD,
-    0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xDE, 0xDD, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xEE, 0xED, 0xDD, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFF, 0xAD, 0xDD, 0xCD, 0xCC, 0xCC, 0xCC,
-    0xCD, 0xDD, 0xDE, 0xEE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCB, 0xCC, 0xCC, 0xCC, 0xDC, 0x9D, 0xFE,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDE, 0xED, 0xDE, 0xED, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xDD, 0xEC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xDC, 0xCD, 0xDC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xBC, 0xDE, 0xCC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xAB, 0xCC, 0xDC, 0xCC, 0xBA, 0xA8, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBB,
-    0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xCC, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x68, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0xAA, 0xBC, 0xDC, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xDC, 0xBB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBB, 0xCD, 0xED,
-    0xCD, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xDC, 0xED,
-    0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xED, 0xDE, 0xDD, 0xDC,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xDD, 0xEE, 0xED, 0xDD, 0xDD,
-    0xDC, 0xDD, 0xDD, 0xEE, 0xEF, 0xFE, 0x9D, 0xDC, 0xDC, 0xCC, 0xCC, 0xCC,
-    0xCC, 0xDD, 0xDD, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD, 0xDD, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xEE, 0xED, 0xDF, 0xDE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xED,
-    0xDC, 0xDD, 0xDC, 0xDD, 0xDE, 0xFF, 0xFF, 0xEE, 0xFF, 0xDD, 0xDC, 0xCB,
-    0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFE, 0xFF, 0xED, 0xDC, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xCD, 0xDE, 0xFF, 0xED, 0xFE, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xCD, 0xEF, 0xFF, 0xDF, 0xDC, 0xBA, 0x98, 0x76, 0x77, 0x89, 0xAB, 0xCD,
-    0xFF, 0xFE, 0xED, 0xCA, 0x98, 0x66, 0x55, 0x67, 0x89, 0xBC, 0xDE, 0xFE,
-    0xED, 0xDB, 0xA8, 0x76, 0x44, 0x44, 0x67, 0x8A, 0xBD, 0xDF, 0xFD, 0xFC,
-    0xBA, 0x86, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFE, 0xEE, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x57, 0x89, 0xBC, 0xFF, 0xFE, 0xED, 0xBA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xDF, 0xDC, 0xA9, 0x87, 0x65, 0x56,
-    0x68, 0x9A, 0xCD, 0xEF, 0xFE, 0xEE, 0xCB, 0xA9, 0x87, 0x76, 0x78, 0x8A,
-    0xBC, 0xDF, 0xFF, 0xDE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDE,
-    0xFF, 0xFE, 0xEE, 0xDD, 0xCB, 0xAA, 0x99, 0xAA, 0xBC, 0xCE, 0xFF, 0xFF,
-    0xEF, 0xFF, 0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFE, 0xFE,
-    0xEF, 0xDD, 0xDC, 0xCD, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF,
-    0xEE, 0xED, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9E, 0xDF, 0xFF, 0xFF, 0xFD, 0xFE,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0x9E, 0xFF,
-    0xEE, 0xDE, 0xDC, 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0xFF, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xDD, 0xFE, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCD, 0xDD, 0xEE, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99,
-    0x9A, 0xAB, 0xDE, 0xDE, 0xDD, 0xEC, 0xCA, 0x99, 0x88, 0x77, 0x88, 0x9A,
-    0xBB, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xED,
-    0xCC, 0xCA, 0x98, 0x65, 0x54, 0x45, 0x66, 0x89, 0xAB, 0xDD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBD, 0xDC, 0xCC, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xEC, 0xCB, 0xA9, 0x86, 0x65,
-    0x44, 0x55, 0x68, 0x9A, 0xBD, 0xDD, 0xCD, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x89,
-    0xAB, 0xCD, 0xFD, 0xCE, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xBC,
-    0xEE, 0xDC, 0xDD, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE,
-    0xDE, 0xDD, 0xCC, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xED, 0xEE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xDE, 0xEE, 0xDE,
-    0xDD, 0xCC, 0xCD, 0xDE, 0xEE, 0xEF, 0xFF, 0xED, 0xFF, 0xFE, 0xEE, 0xDD,
-    0xDD, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0x8D, 0xCD, 0xCD, 0xDD, 0xDC, 0xCD,
-    0xED, 0xEE, 0xEE, 0xFF, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8B, 0xCC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xAA,
-    0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x88,
-    0x89, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xAA, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xBA, 0xCB, 0xAA, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xCB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBC, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xCC, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xED, 0x8C, 0xBB, 0xBB, 0xBB, 0xAB, 0xAB,
-    0xBB, 0xBC, 0xCC, 0xCD, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x8B, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBB, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x88,
-    0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAA, 0xBA, 0x9A, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0x9A, 0x98, 0x87,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x99, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAB, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBA, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB,
-    0xAB, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBA, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xDC, 0xCB, 0xBB, 0xBA,
-    0xAA, 0xBB, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8B, 0xCC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDB, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x98,
-    0x88, 0x99, 0x99, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xBB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xAA, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBB,
-    0xAA, 0xA8, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xA9,
-    0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBB, 0xBA, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCB, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xDC, 0x8B, 0xBB, 0xBB, 0xBB, 0xAA, 0xAA,
-    0xAB, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xEC, 0xCC, 0xCB, 0xCB, 0xBB, 0xCC, 0xCC, 0xCC, 0xCD, 0x8D, 0xED,
-    0xED, 0xDC, 0xCB, 0xBB, 0xBC, 0xCD, 0xCD, 0xEF, 0xFD, 0xDE, 0xED, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xCE, 0xEE, 0xDD, 0xDD, 0xCB, 0xBA, 0x99,
-    0x99, 0x9A, 0xAA, 0xBC, 0xDE, 0xED, 0xDD, 0xCB, 0xBA, 0x99, 0x88, 0x88,
-    0x99, 0xAA, 0xBC, 0xDD, 0xDC, 0xDB, 0xAA, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAB, 0xBC, 0xDC, 0xCD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB,
-    0xCD, 0xCB, 0xCA, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x99, 0xBC, 0xDC,
-    0xBB, 0xA9, 0x87, 0x66, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xCC, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDB, 0xCB, 0x98, 0x76, 0x65,
-    0x54, 0x55, 0x67, 0x89, 0xAC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xDD,
-    0xCD, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDE, 0xEC, 0xED,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xED, 0xDE, 0xED, 0xDC,
-    0xCC, 0xBC, 0xBC, 0xCC, 0xDD, 0xDE, 0xFF, 0xED, 0xFF, 0xDD, 0xDD, 0xDD,
-    0xCD, 0xDD, 0xDD, 0xEE, 0xEF, 0xFE, 0x9D, 0xDD, 0xDD, 0xDD, 0xCC, 0xCC,
-    0xCC, 0xDD, 0xEE, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFE, 0xED, 0xDE, 0xDD, 0xDD, 0xDD, 0xDD, 0xCC, 0xDD, 0x9F, 0xFF,
-    0xFF, 0xEE, 0xDE, 0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFD, 0xEF, 0xEF, 0xEE,
-    0xDD, 0xCC, 0xCC, 0xCD, 0xCD, 0xEE, 0xFF, 0xDF, 0xFF, 0xED, 0xCC, 0xCB,
-    0xBB, 0xBB, 0xCC, 0xDD, 0xDE, 0xFE, 0xDE, 0xDD, 0xCC, 0xAA, 0xAA, 0xAA,
-    0xAB, 0xBC, 0xDD, 0xFF, 0xEE, 0xFD, 0xCB, 0xBA, 0x98, 0x88, 0x89, 0xAA,
-    0xBC, 0xDF, 0xFF, 0xEE, 0xDC, 0xB9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xEF, 0xEE, 0xEC, 0xBA, 0x97, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCE, 0xFE,
-    0xDE, 0xCB, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDE, 0xED, 0xEC,
-    0xB9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9B, 0xCE, 0xEE, 0xDD, 0xCB, 0x98,
-    0x75, 0x43, 0x34, 0x56, 0x8A, 0xBC, 0xDF, 0xED, 0xEC, 0xCA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDE, 0xEE, 0xDD, 0xDB, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x9A, 0xCD, 0xFF, 0xED, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x8A,
-    0xBC, 0xEF, 0xFF, 0xDF, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x9A, 0xBB, 0xCE,
-    0xEF, 0xFD, 0xED, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xFF,
-    0xDF, 0xED, 0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFD, 0xEE,
-    0xDD, 0xDD, 0xCC, 0xCD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xDF, 0xEF, 0xEF,
-    0xDD, 0xEE, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE, 0xFE,
-    0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDD, 0xDE, 0xDE, 0xED, 0xDD,
-    0xEE, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0x9D, 0xFE,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xED, 0xDE, 0xDD, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xDD, 0xDD, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xED, 0xCD, 0xDB, 0xBA, 0x99, 0x98, 0x89,
-    0x9A, 0xAB, 0xCC, 0xEE, 0xDC, 0xDC, 0xBA, 0x98, 0x88, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xDD, 0xCC, 0xBA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xAB,
-    0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDD,
-    0xCC, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCE, 0xDB, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCE, 0xDC, 0xCC, 0xAA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9B, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xEE, 0xDC, 0xDD, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0xAA, 0xBC, 0xDE, 0xEE,
-    0xCD, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xEC, 0xDD,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFE, 0xCF, 0xEE, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFF, 0xED, 0xEE, 0xED, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xEE, 0xFE, 0xFF, 0xFE, 0x8C, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xEE, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCC, 0x9E, 0xEE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xDE, 0xED, 0xDE, 0xDC, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDD, 0xCB, 0xAA, 0xA9,
-    0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88,
-    0x99, 0xAA, 0xBC, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89,
-    0xAB, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x89, 0xAB,
-    0xCC, 0xCC, 0xCB, 0x99, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xCB, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x67, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x87, 0x65,
-    0x54, 0x55, 0x67, 0x89, 0xAC, 0xDC, 0xBC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0x9B, 0xCD, 0xCB, 0xCB, 0xA9, 0x88, 0x77, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xCD, 0xDC, 0xCC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD,
-    0xCD, 0xCC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDE, 0xEC, 0xDD,
-    0xCC, 0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xEE, 0xDE, 0xDD, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xEF, 0xED, 0xEE, 0xDD, 0xDD, 0xCC,
-    0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0xAD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC,
-    0xCD, 0xDD, 0xDE, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9D, 0xFF,
-    0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFD, 0xDE, 0xED, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xDD, 0xDD, 0xCC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEC, 0xDD, 0xDC, 0xBA, 0x99, 0x99, 0x99,
-    0x9A, 0xAB, 0xCD, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xAC,
-    0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9A, 0xCC, 0xDD, 0xCD, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xDD, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED,
-    0xCD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEE, 0xDC, 0xED,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFD, 0xCE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xED, 0xEE, 0xEE, 0xDE, 0xDD,
-    0xDD, 0xDE, 0xDE, 0xEE, 0xFF, 0xFE, 0x9D, 0xDC, 0xCD, 0xDD, 0xCC, 0xCD,
-    0xDD, 0xDD, 0xDE, 0xEE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xFF, 0xEE, 0xDD, 0xCD, 0xCC, 0xDC, 0xCC, 0xDD, 0xCD, 0x8F, 0xFF,
-    0xFF, 0xFE, 0xED, 0xEE, 0xDD, 0xDE, 0xEE, 0xFF, 0xFD, 0xEF, 0xFF, 0xEE,
-    0xDD, 0xCC, 0xCD, 0xDD, 0xDE, 0xEE, 0xEF, 0xDE, 0xFE, 0xED, 0xDC, 0xCB,
-    0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xFE, 0xEE, 0xEE, 0xCC, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xCC, 0xCE, 0xEF, 0xED, 0xED, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAA,
-    0xCD, 0xDE, 0xFE, 0xDE, 0xDC, 0xBA, 0x88, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xEF, 0xEE, 0xED, 0xCB, 0x98, 0x65, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFE,
-    0xEE, 0xDB, 0xA9, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xEF, 0xED, 0xEC,
-    0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFE, 0xDD, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x57, 0x8A, 0xBD, 0xEF, 0xED, 0xDC, 0xBA, 0x97, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDE, 0xEE, 0xDE, 0xCB, 0xA9, 0x87, 0x65, 0x55,
-    0x68, 0x9A, 0xCD, 0xEF, 0xFD, 0xED, 0xCB, 0xA9, 0x87, 0x76, 0x78, 0x9A,
-    0xBC, 0xEE, 0xFF, 0xDF, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDE,
-    0xEF, 0xED, 0xFE, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xBC, 0xDE, 0xDE, 0xFE,
-    0xDF, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xCC, 0xDE, 0xEE, 0xFF, 0xED, 0xEF,
-    0xED, 0xDD, 0xCD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFE, 0xFE, 0xDF, 0xFE, 0xDE,
-    0xEE, 0xEE, 0xDE, 0xEE, 0xFF, 0xEF, 0xFE, 0xFE, 0xFF, 0xEE, 0xEE, 0xEF,
-    0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9D, 0xDD, 0xDD, 0xDD, 0xDD, 0xEE,
-    0xEE, 0xFE, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDC, 0xCC, 0xBB, 0xBB, 0xCC, 0xCC, 0xBC, 0xBC, 0xCD, 0x8D, 0xEE,
-    0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xED, 0xDE, 0xED, 0xDC,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDF, 0xDC, 0xDC, 0xCC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xED, 0xCD, 0xCC, 0xBA, 0x99, 0x99, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDC,
-    0xCD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCD, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAC, 0xCE, 0xCC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x89,
-    0x9A, 0xBC, 0xED, 0xCC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xBC,
-    0xDF, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xED,
-    0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xDC, 0xED,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xEE, 0xDE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDF, 0xEF, 0xED, 0xFF, 0xEE, 0xED, 0xDC,
-    0xDD, 0xDD, 0xEE, 0xEE, 0xFF, 0xFE, 0x7C, 0xCD, 0xCC, 0xCC, 0xCC, 0xCD,
-    0xDD, 0xDD, 0xED, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0x8B, 0xDC,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x98,
-    0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x98, 0x88, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xA9, 0xA9,
-    0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x98, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBB, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xAB, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xCB,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCB, 0xDD, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0x8B, 0xBB, 0xBB, 0xBB, 0xBA, 0xAA,
-    0xBB, 0xBB, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x8B, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBB, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78,
-    0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB,
-    0xAB, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCB, 0xBC, 0xBB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCC, 0xCB, 0xBB, 0xBA,
-    0xAA, 0xAB, 0xBB, 0xBC, 0xCC, 0xDC, 0x8B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8C, 0xDC,
-    0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCC, 0xBB, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xCB, 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x88,
-    0x89, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBB,
-    0xAA, 0x98, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xA9,
-    0x88, 0x76, 0x55, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x89, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBB, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDB, 0xBD, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xCB, 0xDC, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xDC, 0x8C, 0xBB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDD, 0xCD, 0xCB, 0xCB, 0xBB, 0xCB, 0xCB, 0xCC, 0xCC, 0x7D, 0xFF,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCD, 0xDD, 0xDE, 0xED, 0xDD, 0xDC, 0xCC,
-    0xBB, 0xAB, 0xAB, 0xBB, 0xCC, 0xDD, 0xEE, 0xDD, 0xDD, 0xCB, 0xBA, 0xA9,
-    0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xEC, 0xCD, 0xCB, 0xAA, 0x99, 0x88, 0x89,
-    0x99, 0xAA, 0xBC, 0xDD, 0xDC, 0xDB, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x99,
-    0xAB, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x89, 0xAB,
-    0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xBC, 0xB9, 0x87, 0x65, 0x54, 0x55, 0x67, 0x79, 0x9B, 0xBC, 0xCC, 0xBA,
-    0x98, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xAC, 0xCD, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xBD, 0xDB, 0xCA, 0xA8, 0x87, 0x65,
-    0x54, 0x55, 0x67, 0x89, 0xBB, 0xCD, 0xBB, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAA, 0xCD, 0xDC, 0xCB, 0xA9, 0x88, 0x77, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBB, 0xA9, 0x98, 0x77, 0x77, 0x88, 0x9A, 0xBB,
-    0xDE, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xBB, 0xDD, 0xED,
-    0xDD, 0xDC, 0xBB, 0xAA, 0xA9, 0x99, 0xAA, 0xBC, 0xCD, 0xEF, 0xDC, 0xED,
-    0xDC, 0xBB, 0xBB, 0xAA, 0xBB, 0xBC, 0xCC, 0xEE, 0xEE, 0xDE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xEF, 0xFD, 0xFE, 0xDD, 0xDD, 0xDC,
-    0xDD, 0xDD, 0xDE, 0xED, 0xFF, 0xFE, 0x8D, 0xCD, 0xCD, 0xCC, 0xCC, 0xCC,
-    0xCD, 0xDD, 0xEE, 0xEF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, 0xDD, 0xDD, 0xDC, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xEE, 0xED, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xDC,
-    0xCC, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xCB, 0xBB, 0xAB,
-    0xBC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xBB, 0xA9, 0x99, 0x9A, 0xAB,
-    0xCD, 0xFF, 0xFF, 0xEF, 0xFD, 0xCA, 0x98, 0x77, 0x77, 0x89, 0xAC, 0xDF,
-    0xFF, 0xFF, 0xFE, 0xDB, 0xA8, 0x76, 0x56, 0x67, 0x8A, 0xBD, 0xDF, 0xFF,
-    0xFF, 0xFC, 0xB9, 0x76, 0x54, 0x45, 0x68, 0x9B, 0xCD, 0xFF, 0xFF, 0xFD,
-    0xCB, 0x97, 0x54, 0x23, 0x46, 0x79, 0xAC, 0xEF, 0xFF, 0xFF, 0xEC, 0xA9,
-    0x76, 0x43, 0x24, 0x57, 0x9B, 0xCD, 0xFF, 0xFF, 0xFD, 0xCB, 0x98, 0x65,
-    0x44, 0x46, 0x79, 0xBC, 0xEF, 0xFF, 0xEF, 0xDD, 0xBA, 0x87, 0x66, 0x56,
-    0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xFE, 0xDC, 0xA9, 0x88, 0x77, 0x78, 0x9A,
-    0xCD, 0xFF, 0xFF, 0xDF, 0xFD, 0xCB, 0xAA, 0x99, 0x99, 0xAB, 0xBD, 0xDF,
-    0xFF, 0xFD, 0xFF, 0xDD, 0xCB, 0xBB, 0xAA, 0xBB, 0xCC, 0xFE, 0xFF, 0xFF,
-    0xEF, 0xFD, 0xED, 0xDC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF,
-    0xEF, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF,
-    0xEF, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCD, 0xDD, 0xDD, 0xFD, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xEE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9E, 0xFF,
-    0xEE, 0xED, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFD, 0xEF, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xDD, 0xED, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xFE, 0xDE, 0xDC, 0xBA, 0x99, 0x99, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x88, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xDD, 0xCA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xED,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAC, 0xDE, 0xEC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78,
-    0x9B, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xEF, 0xEC, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE,
-    0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xEC, 0xED,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xCF, 0xED, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFF, 0xFC, 0xFE, 0xFE, 0xDD, 0xDD,
-    0xDE, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xCD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xEE, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0x9E, 0xFE,
-    0xED, 0xCC, 0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xEE, 0xDD, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDD, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBB, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCC,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE,
-    0xCD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEC, 0xDD,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xCE, 0xDD, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFD, 0xEE, 0xDD, 0xCD, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xAD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC,
-    0xDD, 0xDE, 0xEF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xED, 0xEE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9F, 0xFF,
-    0xFE, 0xED, 0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xED, 0xEF, 0xEE, 0xDC,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDE, 0xEE, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xED, 0xDE, 0xDC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xDD, 0xDD, 0xCB, 0xA8, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xDD, 0xCC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAC, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9B, 0xCD, 0xDD, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDF, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xDD, 0xED,
-    0xCD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEF, 0xED, 0xED,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xFE, 0xCD, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFD, 0xFE, 0xEE, 0xED, 0xDD,
-    0xDD, 0xEE, 0xDE, 0xFE, 0xFF, 0xFE, 0x9C, 0xCD, 0xCC, 0xCC, 0xCC, 0xDD,
-    0xDD, 0xDE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xFF, 0xFF, 0xEE, 0xDD, 0xDD, 0xDD, 0xCC, 0xCD, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xEE, 0xFE, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xEF, 0xDC, 0xDD, 0xDD, 0xFF, 0xEF, 0xFF, 0xDF, 0xFF, 0xFE, 0xDD, 0xCC,
-    0xBB, 0xBC, 0xCD, 0xDD, 0xDF, 0xFE, 0xFF, 0xFF, 0xDC, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xCC, 0xDF, 0xFF, 0xEF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x99, 0xAB,
-    0xCD, 0xDF, 0xFE, 0xFF, 0xFC, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xFF, 0xFF, 0xFD, 0xCB, 0x97, 0x65, 0x55, 0x67, 0x89, 0xBB, 0xDF, 0xFF,
-    0xFF, 0xDC, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFF, 0xFF, 0xFD,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFE, 0xDB, 0xA8,
-    0x75, 0x43, 0x34, 0x57, 0x8A, 0xBD, 0xFF, 0xFF, 0xED, 0xBA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x9B, 0xCF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x78, 0x9A,
-    0xBC, 0xDF, 0xFF, 0xEF, 0xEC, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDF,
-    0xFF, 0xFE, 0xFF, 0xCD, 0xCB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF,
-    0xEF, 0xFF, 0xDD, 0xCB, 0xBB, 0xBB, 0xDC, 0xEE, 0xFF, 0xFF, 0xFD, 0xFE,
-    0xEF, 0xDD, 0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDC, 0xDD, 0xDE, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xDE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDC, 0xCC, 0xCD, 0x8F, 0xFF,
-    0xEE, 0xDC, 0xDC, 0xBC, 0xCD, 0xDE, 0xDD, 0xEF, 0xED, 0xEE, 0xEE, 0xDC,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xED, 0xEE, 0xED, 0xFE, 0xDC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xCC, 0xDD, 0xED, 0xDE, 0xCC, 0xBA, 0x99, 0x88, 0x89,
-    0x99, 0xAB, 0xBC, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99,
-    0xAB, 0xCE, 0xDD, 0xDD, 0xCA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x99, 0xAB,
-    0xCE, 0xDD, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9B, 0xBD, 0xDD,
-    0xCC, 0xBA, 0x87, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCE, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xCD, 0xCC, 0xBA, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x8A, 0xBC, 0xDD, 0xCD, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78,
-    0x9A, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBC, 0xDD, 0xEE,
-    0xCE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xED, 0xEE,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEE, 0xFE, 0xDE, 0xEE, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCD, 0xDF, 0xEE, 0xFF, 0xEC, 0xEF, 0xEE, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFE, 0x8D, 0xDD, 0xDC, 0xDC, 0xDD, 0xDD,
-    0xDD, 0xDE, 0xEF, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xAA, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xAB, 0xBB, 0x8B, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDB, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x88,
-    0x88, 0x99, 0x99, 0xAA, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x88,
-    0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBB, 0xAA, 0xA9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBA,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xA9,
-    0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x89, 0xAB, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x89, 0x9A, 0xAB, 0xCB,
-    0xAC, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCB, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xCB, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xDB, 0xDC, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCD, 0xDD, 0xEC, 0x8B, 0xBB, 0xBB, 0xBB, 0xAA, 0xAA,
-    0xBB, 0xBB, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0x9B, 0xCC,
-    0xBB, 0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xBC, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x99, 0x9A, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0x9A, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBB,
-    0xAB, 0xAA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBB,
-    0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCB, 0xBC, 0xBB, 0xBA,
-    0xAA, 0xA9, 0x9A, 0xAA, 0xAB, 0xBB, 0xCD, 0xCB, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8C, 0xDD,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xDC, 0xCD, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xCB, 0xCB, 0xAA, 0x99, 0x98,
-    0x88, 0x89, 0x99, 0xAA, 0xBC, 0xCB, 0xBC, 0xAA, 0x98, 0x88, 0x77, 0x78,
-    0x88, 0x99, 0xAB, 0xBC, 0xBB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBB,
-    0xAA, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9,
-    0x87, 0x76, 0x55, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x89, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBC, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x89, 0x9A, 0xAB, 0xCC,
-    0xBC, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCB, 0xCC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xCC, 0xDC, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0x8B, 0xBB, 0xBB, 0xBA, 0xAA, 0xBB,
-    0xBB, 0xBC, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xED, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7E, 0xFF,
-    0xFE, 0xDD, 0xDC, 0xCD, 0xDD, 0xCE, 0xEE, 0xFF, 0xFD, 0xDF, 0xDD, 0xDC,
-    0xDC, 0xCC, 0xBC, 0xCC, 0xCD, 0xDD, 0xFE, 0xDD, 0xEE, 0xDC, 0xBB, 0xBB,
-    0xAA, 0xBB, 0xBB, 0xDD, 0xDE, 0xED, 0xDE, 0xDD, 0xBA, 0xA9, 0x99, 0x99,
-    0xAA, 0xBB, 0xCD, 0xDD, 0xDD, 0xDC, 0xBB, 0xA9, 0x88, 0x88, 0x89, 0x9A,
-    0xBC, 0xDE, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDD, 0xDC, 0xBA, 0x87, 0x65, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDC,
-    0xDD, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xBC, 0xCE, 0xDC, 0xDB,
-    0xA9, 0x86, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xCD, 0xDD, 0xCD, 0xCA, 0x98,
-    0x75, 0x43, 0x34, 0x57, 0x89, 0xAC, 0xCE, 0xCC, 0xDB, 0xB9, 0x87, 0x65,
-    0x44, 0x56, 0x78, 0x9A, 0xBD, 0xFD, 0xCD, 0xCB, 0xA9, 0x87, 0x65, 0x56,
-    0x67, 0x89, 0xBC, 0xDD, 0xDC, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xCD,
-    0xDF, 0xEC, 0xED, 0xDB, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xDE,
-    0xCF, 0xDD, 0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xDF, 0xED, 0xFE,
-    0xDD, 0xCC, 0xCB, 0xCB, 0xCC, 0xCD, 0xDE, 0xEE, 0xFD, 0xDF, 0xEF, 0xFD,
-    0xDD, 0xDD, 0xDC, 0xED, 0xED, 0xEE, 0xFF, 0xFD, 0xFF, 0xFD, 0xEE, 0xED,
-    0xDD, 0xDF, 0xEE, 0xFE, 0xFF, 0xFF, 0x8D, 0xDD, 0xDC, 0xCD, 0xDD, 0xCD,
-    0xCD, 0xDD, 0xED, 0xEE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFE, 0xCF, 0xCD, 0xCC, 0xCC, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD,
-    0xFF, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0xCC, 0xBB,
-    0xCC, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBA, 0xAA, 0xAB, 0xBC,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xA9, 0x87, 0x66, 0x78, 0x9B, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xDC, 0xBA, 0x86, 0x54, 0x45, 0x78, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xFB, 0xA8, 0x64, 0x22, 0x46, 0x89, 0xBD, 0xFF, 0xFF, 0xDF, 0xDC, 0xB9,
-    0x86, 0x42, 0x24, 0x68, 0x9B, 0xDD, 0xFF, 0xFF, 0xFF, 0xCC, 0xA8, 0x75,
-    0x44, 0x56, 0x8A, 0xBF, 0xFF, 0xFF, 0xFF, 0xCF, 0xCA, 0x98, 0x76, 0x66,
-    0x79, 0xAD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFD, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xDC, 0xFF, 0xFF, 0xDF, 0xFF, 0xDC, 0xCA, 0xAA, 0xAA, 0xAB, 0xCF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0xCC, 0xBB, 0xCC, 0xFD, 0xDF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xFF, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFD, 0xDD, 0xDC, 0xCC, 0xCB, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF,
-    0xEE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDC, 0xED, 0xDF, 0xFC, 0xFF, 0xEE, 0xDC,
-    0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xDF, 0xFD, 0xCC, 0xBB, 0xAB,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xED, 0xDD, 0xDC, 0xBB, 0xAA, 0x99, 0x99,
-    0x9A, 0xBC, 0xCD, 0xDD, 0xDD, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0x9A,
-    0xBB, 0xCD, 0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xED,
-    0xCC, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAC, 0xDE, 0xDC, 0xCB,
-    0xA9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xBC, 0xDD, 0xDC, 0xBA, 0x98,
-    0x75, 0x43, 0x34, 0x56, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x56, 0x78, 0x9A, 0xBD, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x89, 0xBC, 0xDE, 0xDC, 0xCC, 0xBA, 0x98, 0x87, 0x76, 0x77, 0x89,
-    0xAB, 0xCD, 0xEE, 0xCD, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xCD,
-    0xDE, 0xFC, 0xED, 0xBB, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xBD, 0xDF, 0xFE,
-    0xCD, 0xED, 0xCB, 0xBB, 0xBA, 0xAA, 0xBB, 0xCC, 0xED, 0xFF, 0xEC, 0xEE,
-    0xDC, 0xCC, 0xCC, 0xBC, 0xCC, 0xDD, 0xDF, 0xEF, 0xFF, 0xCD, 0xED, 0xDD,
-    0xCD, 0xCD, 0xDC, 0xDD, 0xDF, 0xEF, 0xFF, 0xFC, 0xFF, 0xFD, 0xEE, 0xED,
-    0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDC, 0xCD, 0xCD, 0xDD, 0xED,
-    0xEE, 0xFE, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xAF, 0xFF,
-    0xFD, 0xDC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFE, 0xFF, 0xED, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xEE, 0xED, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xFE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xDD, 0xDD, 0xDB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xDD,
-    0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9B, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDE, 0xCC, 0xBA, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xDF, 0xED, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A, 0xAB, 0xCD, 0xFF,
-    0xDD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xFF, 0xFD, 0xED,
-    0xCC, 0xBB, 0xBA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xFF, 0xDF, 0xED, 0xDC,
-    0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xFD, 0xFF, 0xED, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xAD, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD,
-    0xDE, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xED, 0xDC, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0x9F, 0xFF,
-    0xFE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFD, 0xFE, 0xEE, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xDE, 0xEE, 0xDE, 0xFF, 0xDC, 0xBB, 0xAA,
-    0x99, 0xAA, 0xAB, 0xCC, 0xCE, 0xDD, 0xED, 0xEC, 0xBA, 0x99, 0x88, 0x88,
-    0x9A, 0xAB, 0xBC, 0xEE, 0xCD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAB, 0xCC, 0xED, 0xDD, 0xCA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xDC, 0xBA, 0x97, 0x65, 0x54, 0x55, 0x66, 0x78, 0xAB, 0xBD, 0xCC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xCC, 0xA9, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCB, 0xA8, 0x76, 0x65,
-    0x54, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBD, 0xDD, 0xDD, 0xCB, 0xA9, 0x88, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDF, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xBC, 0xCE, 0xFE,
-    0xDD, 0xDC, 0xBB, 0xBA, 0xA9, 0xAA, 0xAA, 0xBC, 0xDE, 0xDF, 0xFD, 0xFD,
-    0xCC, 0xCB, 0xBB, 0xBA, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xDF, 0xDD, 0xDC,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFD, 0xEE, 0xDE, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0x9C, 0xCC, 0xCC, 0xCD, 0xDC, 0xED,
-    0xEE, 0xEF, 0xFF, 0xFE, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xED, 0xDD, 0xCC, 0xDD, 0x8F, 0xFF,
-    0xFF, 0xFE, 0xFE, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xDD, 0xDD, 0xDC, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xCC,
-    0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xFF, 0xDE, 0xDC, 0xBB, 0xAA, 0xAA,
-    0xAA, 0xCC, 0xCF, 0xFF, 0xDF, 0xFF, 0xCC, 0xBA, 0x98, 0x88, 0x99, 0xAB,
-    0xCD, 0xFD, 0xFF, 0xED, 0xED, 0xBA, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xFF, 0xDD, 0xED, 0xCB, 0x97, 0x65, 0x55, 0x67, 0x89, 0xBC, 0xFF, 0xEF,
-    0xEF, 0xDB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xEF, 0xED, 0xEC,
-    0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDF, 0xFE, 0xDE, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x57, 0x89, 0xCD, 0xEF, 0xFD, 0xEC, 0xCA, 0x97, 0x65,
-    0x44, 0x45, 0x79, 0xAB, 0xDE, 0xDF, 0xFE, 0xDC, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x9A, 0xCD, 0xFF, 0xFE, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x78, 0x9A,
-    0xBC, 0xEF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDE,
-    0xFF, 0xFF, 0xDF, 0xCC, 0xBB, 0xAA, 0xA9, 0xAB, 0xBC, 0xDD, 0xFE, 0xFF,
-    0xDF, 0xEE, 0xEC, 0xCC, 0xBB, 0xBC, 0xBD, 0xED, 0xFF, 0xFF, 0xFF, 0xEF,
-    0xFD, 0xDD, 0xCC, 0xDC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xCF, 0xDE, 0xEF,
-    0xDE, 0xFD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFD, 0xFF, 0xEE,
-    0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCB, 0xCD, 0xDE, 0xFF, 0xEE,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xED, 0xDB, 0xCC, 0xBA, 0xAB, 0xBB, 0xBB, 0xBB, 0xBB, 0x7F, 0xFD,
-    0xCD, 0xCB, 0xBA, 0xBB, 0xBB, 0xBF, 0xDC, 0xDC, 0xFD, 0xDD, 0xDC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xED, 0xCF, 0xEC, 0xDC, 0xBA, 0xAA, 0x99,
-    0x98, 0x99, 0xAA, 0xBB, 0xCD, 0xDF, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88,
-    0x99, 0x9A, 0xBC, 0xCE, 0xDC, 0xDB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xCD, 0xCF, 0xCC, 0xB9, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAA,
-    0xCC, 0xDC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAC, 0xCC,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDB, 0xCA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAA, 0xCC, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9A, 0xBD, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x89, 0xAC, 0xCF, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xCC, 0xDB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xDD,
-    0xDF, 0xCB, 0xAA, 0xA9, 0x98, 0x99, 0x9A, 0xAB, 0xBD, 0xDF, 0xFC, 0xEE,
-    0xDB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBD, 0xDE, 0xFF, 0xCF, 0xDD, 0xDD,
-    0xBC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xDD, 0xDD, 0xED, 0xCD, 0xCD,
-    0xDC, 0xCC, 0xCE, 0xDF, 0xFF, 0xFF, 0x8D, 0xBB, 0xED, 0xCC, 0xCB, 0xCD,
-    0xCF, 0xDD, 0xDF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xCB, 0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xAA, 0xBB, 0x7C, 0xDC,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDC, 0xCC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xCB, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBC, 0xDC, 0xBB, 0xAA, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x99, 0xAA, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xAB, 0xB9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAB,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xB9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xB9, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAB, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAC, 0xBA, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCC,
-    0xBB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAB, 0xCD, 0xCB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCC, 0xDE, 0xBC, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xCE, 0xDB, 0xDE, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xED, 0x9C, 0xCB, 0xBB, 0xAB, 0xAA, 0xBA,
-    0xBB, 0xBB, 0xCD, 0xDD, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9C, 0xCC,
-    0xBB, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x65, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xBB,
-    0xAA, 0x99, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xDC, 0xBC, 0xBB, 0xAA,
-    0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCD, 0xDB, 0xCD, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0x9C, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xCC, 0xDD, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCC, 0xCB, 0xBA, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xBB, 0x8C, 0xCD,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xCC, 0xBA, 0xBA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xCC, 0xCC, 0xCB, 0xA9, 0x99, 0x88,
-    0x88, 0x89, 0x99, 0x9A, 0xBB, 0xCB, 0xBB, 0xAA, 0x98, 0x88, 0x77, 0x78,
-    0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xBB,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9,
-    0x87, 0x76, 0x55, 0x55, 0x56, 0x67, 0x79, 0x9A, 0xBB, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBC, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x9A, 0xBB, 0xCB,
-    0xAB, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xCB, 0xDB,
-    0xAA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDB, 0xCC, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xCE, 0xDD, 0x7B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xBB, 0xCB, 0xCC, 0xCC, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDC, 0xFE, 0xCD, 0xCC, 0xDD, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xFF, 0xDF, 0xFF, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xDC,
-    0xBD, 0xDF, 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xDC, 0xCC, 0xBB,
-    0xCC, 0xFF, 0xDF, 0xFF, 0xFD, 0xFF, 0xFD, 0xCB, 0xAA, 0xAA, 0xAC, 0xBB,
-    0xBE, 0xDF, 0xFF, 0xEF, 0xDF, 0xDC, 0xA9, 0x98, 0x89, 0xAA, 0xCB, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xCC, 0xA9, 0x86, 0x66, 0x78, 0xAB, 0xCD, 0xFF, 0xFD,
-    0xFF, 0xFD, 0xBA, 0x86, 0x54, 0x45, 0x79, 0xAC, 0xCF, 0xDF, 0xFF, 0xFF,
-    0xCC, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBE, 0xDF, 0xFF, 0xFF, 0xFD, 0xCA,
-    0x86, 0x42, 0x24, 0x68, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x75,
-    0x44, 0x56, 0x8A, 0xCD, 0xDF, 0xFE, 0xFF, 0xFD, 0xDB, 0x98, 0x76, 0x66,
-    0x89, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x99, 0x88, 0x89, 0xBB,
-    0xDD, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xA9, 0x9A, 0xBC, 0xDD, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBC, 0xBB, 0xCC, 0xCC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDC, 0xFD, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDC, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xCD, 0xDF, 0xFD, 0xEE, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xDF, 0xFF, 0xFD, 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD,
-    0xFF, 0xDF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFC, 0xCC, 0xCF,
-    0xDD, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xCF, 0xDD, 0xBB, 0xBA, 0xAC, 0xCB,
-    0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0x99, 0x89, 0xAA, 0xAF, 0xFF,
-    0xFF, 0xFF, 0xCF, 0xFC, 0xBA, 0x87, 0x66, 0x79, 0xAB, 0xDD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xCB, 0x97, 0x54, 0x45, 0x79, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xB9, 0x64, 0x22, 0x46, 0x8A, 0xDD, 0xDD, 0xFF, 0xFF, 0xFD, 0xDC,
-    0x96, 0x42, 0x23, 0x69, 0xBB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFC, 0xB9, 0x75,
-    0x44, 0x57, 0x9B, 0xBF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xA9, 0x76, 0x66,
-    0x89, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xA9, 0x88, 0x99, 0xAD,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xAA, 0xAB, 0xCC, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xDB, 0xBB, 0xBF, 0xCF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDD, 0xFD, 0xFD, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDC, 0xDC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xDF, 0xFD, 0xFF, 0xFA, 0xBD,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x89, 0x99, 0x98, 0x88, 0x88, 0x88, 0x88, 0x98, 0x98, 0x9A, 0x6A, 0xCB,
-    0x9A, 0xA9, 0x99, 0x99, 0xAA, 0x9A, 0xAB, 0xAA, 0xDA, 0x9A, 0xA9, 0x89,
-    0x99, 0x89, 0x99, 0x89, 0x8A, 0x99, 0xAA, 0x9A, 0xAA, 0x99, 0x88, 0x88,
-    0x88, 0x88, 0x89, 0xA9, 0xAA, 0xAA, 0x89, 0xA9, 0x98, 0x88, 0x88, 0x88,
-    0x88, 0x89, 0x9A, 0xB9, 0xA9, 0xA9, 0x98, 0x78, 0x77, 0x77, 0x77, 0x88,
-    0x89, 0x9A, 0xA9, 0x89, 0x98, 0x87, 0x76, 0x76, 0x77, 0x77, 0x88, 0x99,
-    0x9A, 0xA8, 0x98, 0x88, 0x76, 0x66, 0x66, 0x77, 0x77, 0x88, 0x89, 0x98,
-    0x89, 0x98, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x88, 0x9B, 0xA8, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x66, 0x77, 0x88, 0x98, 0xA8, 0x89, 0x88, 0x87,
-    0x76, 0x65, 0x56, 0x67, 0x77, 0x88, 0x99, 0x98, 0x99, 0x78, 0x77, 0x66,
-    0x65, 0x66, 0x67, 0x78, 0x8A, 0x99, 0x89, 0x98, 0x78, 0x77, 0x66, 0x66,
-    0x67, 0x77, 0x88, 0xAB, 0x98, 0x99, 0x89, 0x87, 0x77, 0x76, 0x67, 0x77,
-    0x88, 0x89, 0xA9, 0x9A, 0x9A, 0x98, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89,
-    0x9B, 0x98, 0xA9, 0x99, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x9A, 0xA9,
-    0x8A, 0x99, 0x99, 0x89, 0x88, 0x88, 0x88, 0x99, 0x8A, 0xAA, 0xA9, 0xAB,
-    0xAA, 0x98, 0x88, 0x89, 0x88, 0x89, 0x9A, 0xBA, 0xA9, 0xAC, 0xBA, 0xB9,
-    0xAA, 0x99, 0x99, 0x9A, 0x99, 0xAA, 0xAD, 0xA9, 0xBA, 0xAB, 0xAB, 0xA9,
-    0x9A, 0x9A, 0xBA, 0xAA, 0x9C, 0xBB, 0x8B, 0xA9, 0xA8, 0x99, 0x98, 0x88,
-    0x99, 0x9A, 0xAA, 0xAB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFE, 0xDD, 0xCC, 0xCC, 0xDC, 0xDD, 0xED, 0xEF, 0xDF, 0xFF,
-    0xED, 0xDC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF, 0xFE, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, 0xFD, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xFF, 0xFD, 0xCB, 0xA9, 0x98, 0x87, 0x88,
-    0x89, 0x9A, 0xBC, 0xFF, 0xFE, 0xDC, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xDF, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCD, 0xEE, 0xBB, 0x98, 0x76, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDF,
-    0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x45, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCB, 0xA9, 0x87,
-    0x65, 0x55, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9B, 0xCD, 0xEC, 0xCA, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDF, 0xDC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xDF, 0xFF, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xFF,
-    0xFE, 0xCB, 0xBA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xFF, 0xFF, 0xFD,
-    0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xFF, 0xFF, 0xFF, 0xEF, 0xDD,
-    0xCB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD,
-    0xDD, 0xDE, 0xDE, 0xFF, 0xFF, 0xFF, 0xCF, 0xFE, 0xFE, 0xFE, 0xEF, 0xDD,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xAA, 0x99, 0xA9, 0x89, 0x89, 0x99, 0x98, 0x99, 0xBB, 0x6B, 0xAB,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0xBA, 0xAB, 0xBE, 0xFB, 0x9B, 0xAA, 0x99,
-    0x99, 0x99, 0x99, 0xA9, 0xAC, 0x9B, 0xBA, 0xC9, 0xB9, 0xA9, 0x99, 0x88,
-    0x89, 0x88, 0x89, 0xAA, 0xAA, 0xBA, 0x99, 0x99, 0x88, 0x88, 0x77, 0x87,
-    0x88, 0x89, 0xAA, 0xAA, 0xA9, 0x9A, 0x88, 0x87, 0x77, 0x77, 0x78, 0x88,
-    0x99, 0xAA, 0xA9, 0x9A, 0x99, 0x87, 0x76, 0x66, 0x67, 0x77, 0x88, 0x99,
-    0xBB, 0xA9, 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x78, 0x88, 0x99, 0xB9,
-    0x9A, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x77, 0x78, 0x8A, 0xA9, 0x99, 0x99, 0x87,
-    0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xA8, 0x99, 0x98, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x99, 0xA9, 0x99, 0x98, 0x98, 0x77, 0x66, 0x66,
-    0x67, 0x78, 0x98, 0x9B, 0xA9, 0x99, 0x98, 0x87, 0x77, 0x66, 0x77, 0x77,
-    0x89, 0x99, 0xCA, 0x9A, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0x99, 0xBA, 0x99, 0x88, 0x88, 0x87, 0x88, 0x88, 0x89, 0x9B, 0xB9,
-    0xAB, 0xA9, 0xAA, 0x88, 0x88, 0x88, 0x88, 0x9A, 0xBA, 0xAB, 0xA9, 0xEA,
-    0xAA, 0x9A, 0xA9, 0x9A, 0x89, 0x99, 0x9A, 0xAC, 0xAB, 0xAC, 0xDA, 0xBA,
-    0xAA, 0x9A, 0x99, 0xAA, 0xAB, 0xBA, 0xCC, 0xAA, 0xFB, 0xDB, 0xBA, 0xAA,
-    0xAA, 0xBA, 0xBB, 0xBB, 0xFC, 0xFB, 0x7A, 0x99, 0x99, 0x99, 0x99, 0x99,
-    0x99, 0x9A, 0xAA, 0xAB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xA9, 0xAA, 0xBB, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0x98, 0x77, 0x89, 0xAF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xA8, 0x54, 0x46, 0x8A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xDA, 0x74, 0x12, 0x47, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xA7, 0x42, 0x24, 0x79, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x86,
-    0x44, 0x57, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0x87, 0x77,
-    0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBA, 0x9A, 0xAB, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x8A, 0x98, 0x88, 0x87, 0x77, 0xF7, 0x6F, 0x88, 0x8F, 0xAA, 0x59, 0xFA,
-    0xAF, 0xAF, 0x8A, 0x87, 0x8A, 0xA8, 0xFA, 0xA9, 0xF9, 0x9A, 0xAF, 0x98,
-    0x9A, 0x79, 0x89, 0x78, 0x9A, 0xFA, 0xFF, 0xAC, 0x88, 0x8F, 0x87, 0x88,
-    0xA8, 0x89, 0x9A, 0x87, 0xAF, 0xFA, 0x7A, 0xA9, 0x87, 0x78, 0x77, 0x98,
-    0x78, 0x89, 0xAA, 0xFA, 0xA8, 0x98, 0x99, 0x87, 0x78, 0x87, 0x77, 0x87,
-    0x87, 0xFA, 0xE8, 0x8B, 0x97, 0x76, 0x88, 0x77, 0x67, 0x77, 0x78, 0x78,
-    0x8A, 0x87, 0xA9, 0x8F, 0x77, 0x77, 0x67, 0x97, 0x88, 0x78, 0x99, 0xA8,
-    0x79, 0x89, 0x77, 0x76, 0x66, 0x76, 0x77, 0x77, 0x8F, 0x89, 0x98, 0xF9,
-    0x88, 0x97, 0x66, 0x57, 0x67, 0x78, 0x77, 0xA9, 0x88, 0x78, 0x87, 0x87,
-    0x66, 0x66, 0x66, 0x67, 0x68, 0x97, 0xF9, 0x88, 0xA8, 0x78, 0x87, 0x76,
-    0x66, 0x77, 0x68, 0x77, 0x88, 0x89, 0x99, 0xA8, 0x78, 0x77, 0x77, 0x76,
-    0x67, 0x76, 0x77, 0x89, 0xA9, 0x8A, 0x87, 0x87, 0x77, 0x68, 0x76, 0x76,
-    0x88, 0x9A, 0x9A, 0xAA, 0xA7, 0x97, 0x87, 0x87, 0x87, 0x77, 0x99, 0x77,
-    0x9A, 0x87, 0x9A, 0x99, 0x79, 0x79, 0x76, 0x87, 0x98, 0x99, 0xA8, 0x88,
-    0x98, 0x9A, 0xA9, 0x99, 0x97, 0x98, 0x8A, 0x98, 0x9A, 0xFF, 0xA8, 0xFA,
-    0x7F, 0x8A, 0x8F, 0x98, 0x8A, 0xA8, 0xFF, 0xF9, 0xA8, 0xAF, 0x99, 0x99,
-    0x88, 0x99, 0xAA, 0x98, 0x9A, 0xAA, 0xAF, 0xAA, 0xFA, 0xF9, 0x9A, 0xFA,
-    0xF9, 0x8A, 0xA8, 0x98, 0xAF, 0xA9, 0x9F, 0xFA, 0x89, 0x87, 0x78, 0x98,
-    0x87, 0x8A, 0x87, 0x99, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xBF, 0xFF, 0xFF, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xBF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x88, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xF8, 0x65, 0x57, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0x84, 0x12, 0x58, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF8, 0x52, 0x14, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0x96,
-    0x54, 0x68, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xA8, 0x89,
-    0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEB, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFB, 0xFF, 0xFF, 0xFF, 0xBF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xEF, 0xFE, 0xEF, 0xFF, 0xFE, 0xEE, 0xE5, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE,
-    0xEE, 0xEE, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0x5F, 0xFF,
-    0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0x5E,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xE5,
-    0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0x55, 0xF5, 0x5F, 0xF5, 0xFF, 0x5F, 0x5F,
-    0xFF, 0xFF, 0xF4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF5, 0xFF, 0xF5, 0xFF, 0x5F, 0x4F, 0xFE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xE3, 0xE5, 0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xE5, 0x4E,
-    0xEE, 0x5E, 0x5E, 0xE5, 0x5E, 0x5E, 0x55, 0xEE, 0xEE, 0x54, 0xEE, 0xE5,
-    0x5E, 0xE5, 0xE6, 0x5E, 0xEE, 0xEE, 0xEE, 0xEF, 0xF5, 0xFF, 0xF5, 0xFF,
-    0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xF5, 0xFF, 0x5F, 0xFF,
-    0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0x5F, 0xF5, 0x5F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0x5F,
-    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFE, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x78, 0xF6, 0x66, 0x68, 0x76, 0x67, 0x67, 0x98, 0x78, 0x7F, 0x68, 0x98,
-    0x9F, 0xF8, 0xF7, 0xFE, 0x8F, 0xFF, 0x9F, 0xFF, 0x9F, 0x88, 0x7F, 0x88,
-    0x9F, 0x79, 0x9F, 0xFF, 0x8F, 0x9F, 0xF9, 0x96, 0x99, 0x97, 0x78, 0x67,
-    0xF7, 0x98, 0xFF, 0x79, 0x99, 0xF8, 0x77, 0xF8, 0x89, 0x97, 0x78, 0x89,
-    0xF7, 0x8F, 0xFF, 0xFF, 0x78, 0x99, 0x79, 0x97, 0x97, 0x77, 0x99, 0x7F,
-    0x79, 0x99, 0x98, 0x77, 0x9F, 0x67, 0x67, 0x67, 0x78, 0x98, 0x9F, 0x99,
-    0x89, 0xF6, 0x9F, 0x79, 0x78, 0x76, 0x66, 0xF8, 0x78, 0x89, 0x78, 0xF8,
-    0x87, 0x88, 0x99, 0x87, 0x77, 0x69, 0x79, 0x78, 0xF7, 0x9F, 0x77, 0xF9,
-    0x99, 0x76, 0x77, 0x77, 0x68, 0x87, 0x78, 0x9F, 0x97, 0x88, 0x78, 0x89,
-    0x97, 0x76, 0x77, 0x77, 0x89, 0x8F, 0x8F, 0x67, 0x89, 0x98, 0x89, 0x78,
-    0x77, 0x87, 0x78, 0x79, 0x78, 0x96, 0x68, 0x9F, 0xA8, 0x97, 0x78, 0x78,
-    0x8F, 0x89, 0x79, 0x8F, 0x67, 0xFF, 0x8F, 0x99, 0x77, 0x66, 0x66, 0x76,
-    0x86, 0xF8, 0xF6, 0x99, 0x9F, 0x7F, 0x89, 0x97, 0x79, 0x88, 0x6F, 0x88,
-    0x89, 0x68, 0xFF, 0xFF, 0xF9, 0x98, 0x89, 0xF8, 0xFF, 0x98, 0x9F, 0xF7,
-    0x78, 0x79, 0xF9, 0x77, 0x89, 0xF8, 0x97, 0x89, 0xF9, 0x98, 0x77, 0x9F,
-    0x9F, 0x89, 0x9F, 0x99, 0x98, 0x9F, 0x99, 0x9F, 0x98, 0x89, 0x98, 0xFF,
-    0x9F, 0xF8, 0xF9, 0x88, 0x9F, 0x7F, 0xF9, 0x67, 0xFF, 0x99, 0x98, 0xF9,
-    0xFF, 0x89, 0x9F, 0xFF, 0x9F, 0xF9, 0x59, 0x77, 0x98, 0x68, 0x96, 0x77,
-    0x68, 0x89, 0xF7, 0x6F, 0x60, 0x00, 0x00, 0x00,
-  },
-  {
-    0x68, 0x89, 0x78, 0x77, 0x67, 0x88, 0x88, 0xFF, 0x79, 0x99, 0x69, 0xF9,
-    0xF9, 0x88, 0x87, 0x79, 0x8F, 0xF9, 0xF8, 0xF9, 0xF7, 0x8F, 0x98, 0x78,
-    0x79, 0xF9, 0xF8, 0x88, 0x79, 0x7F, 0xF9, 0x97, 0xFF, 0x8F, 0x98, 0x78,
-    0x77, 0x67, 0xF8, 0xF9, 0xFF, 0xF9, 0x78, 0xF8, 0x88, 0x87, 0x88, 0x77,
-    0x98, 0xF7, 0x98, 0xFF, 0x98, 0x9F, 0xF8, 0x98, 0x87, 0x76, 0x79, 0x97,
-    0x78, 0x89, 0x8C, 0x77, 0x88, 0x78, 0x77, 0x77, 0x88, 0x77, 0x78, 0x79,
-    0x9F, 0x88, 0x79, 0x77, 0x77, 0x77, 0x67, 0x77, 0x77, 0x8F, 0x99, 0x97,
-    0x87, 0x77, 0x78, 0x87, 0x78, 0x76, 0x77, 0x78, 0x9F, 0x99, 0xF7, 0x77,
-    0x98, 0x76, 0x76, 0x77, 0x68, 0x7F, 0x78, 0xFF, 0xF9, 0x78, 0x88, 0x87,
-    0x88, 0x76, 0x67, 0x88, 0x79, 0x78, 0xF9, 0x87, 0x89, 0x97, 0x77, 0x68,
-    0x67, 0x77, 0x77, 0x77, 0x8E, 0x78, 0x78, 0x8A, 0x88, 0x77, 0x87, 0x77,
-    0x67, 0x88, 0x88, 0x8F, 0x87, 0x89, 0x88, 0x77, 0x76, 0x77, 0x79, 0x77,
-    0x77, 0x8F, 0x88, 0x79, 0xF8, 0x77, 0x78, 0x77, 0x88, 0x77, 0x78, 0x98,
-    0x89, 0x89, 0xFF, 0xF8, 0x88, 0x99, 0x77, 0x98, 0x78, 0x87, 0x99, 0x99,
-    0x98, 0xF8, 0x98, 0xFF, 0xFF, 0x79, 0x88, 0x77, 0x79, 0x8F, 0x88, 0xF8,
-    0x88, 0xFF, 0x88, 0x78, 0x99, 0x9F, 0x88, 0xF9, 0xF8, 0x88, 0x99, 0xB9,
-    0xF7, 0x88, 0x99, 0xF9, 0x99, 0x9F, 0xFF, 0x99, 0xFF, 0x8F, 0x98, 0x8F,
-    0x89, 0x99, 0xF8, 0x99, 0x8F, 0xF9, 0x5F, 0x89, 0x77, 0x87, 0x99, 0x78,
-    0x88, 0x77, 0xF8, 0x8F, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x5E, 0xDE, 0xE5, 0xDE, 0xEE, 0xED, 0xDD, 0xDE, 0xEE, 0xEE, 0x4E, 0xED,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED,
-    0xDD, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xDD,
-    0x5D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD5, 0x45, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE,
-    0x5E, 0xEE, 0xEE, 0xEE, 0xE5, 0xE5, 0xEE, 0xE5, 0x54, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0x45, 0xEE, 0xEE, 0x55, 0xEE, 0xEE, 0xE5, 0xED, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x5D, 0xDD, 0xDD, 0xDD, 0x55, 0xDD, 0xDD,
-    0x55, 0x5D, 0x4D, 0xDD, 0xDD, 0x45, 0xDD, 0x5D, 0xDD, 0xDD, 0xDD, 0xDD,
-    0x54, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0x5E, 0xEE, 0x5E, 0xEE,
-    0xEE, 0x5E, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0x4E, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xEE, 0xE4, 0xE5, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE, 0xEE, 0x5E, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xED,
-    0xEE, 0xED, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xED, 0xED,
-    0xEE, 0xEE, 0xEE, 0x5E, 0xEE, 0xEE, 0xED, 0xED, 0xEE, 0xE5, 0xEE, 0xEE,
-    0xED, 0xED, 0xED, 0xEE, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xF9, 0xF8, 0xF9, 0x4F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xF8, 0x64, 0x68, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0x85, 0x12, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x52, 0x14, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9,
-    0x54, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x59, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xF7, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x7F, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xF6,
-    0xF6, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF7, 0xF6, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0x66, 0xF6,
-    0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x57, 0x67, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFD, 0xBF, 0xF7, 0xF7, 0x6F, 0x66, 0x6F, 0x66, 0xF6, 0xFF,
-    0xFF, 0xF6, 0xF6, 0xFF, 0x75, 0x76, 0xF5, 0x66, 0x66, 0x66, 0xFF, 0xFF,
-    0xF6, 0xFF, 0xFF, 0xF5, 0x57, 0x66, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xF6,
-    0xFF, 0x56, 0x56, 0x75, 0x77, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xF7, 0xF6,
-    0xF6, 0xF6, 0x44, 0xF5, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x66,
-    0x56, 0x75, 0x56, 0xF6, 0xFF, 0xFD, 0xC6, 0xAF, 0xF6, 0x6F, 0xFF, 0x55,
-    0x57, 0x5F, 0x7F, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0x65, 0x6F, 0xFF, 0x68,
-    0x7F, 0xFF, 0xFF, 0x6F, 0xFF, 0xF6, 0xF6, 0x5F, 0x65, 0x6F, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xF6, 0x6F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF,
-    0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0x7F, 0x7F, 0xFF, 0xFF, 0x7F,
-    0xFF, 0x7F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFD, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x12, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x61, 0x15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
- },
- {
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xED,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED,
-    0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xED,
-    0xD5, 0x55, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xE5, 0xE5, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xEE, 0xE5, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0x5E, 0x5E, 0xEE, 0x55, 0x54, 0xEE, 0xEE, 0xEE, 0xEE, 0xED,
-    0xDD, 0xDD, 0xD5, 0x5D, 0x44, 0x5D, 0xDD, 0xDD, 0xDD, 0xDD, 0x5D, 0xD5,
-    0xD5, 0x5D, 0xDD, 0xD3, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x5D,
-    0xD4, 0x35, 0x5D, 0xDD, 0xDD, 0xDD, 0xDD, 0xD5, 0x5E, 0xE4, 0x54, 0x53,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE, 0x5E, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xEE, 0x5E, 0xEE, 0xE5, 0x5E, 0xEE, 0x5E,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xE5, 0xEE, 0xEE, 0xED, 0xEE, 0xED, 0xDD, 0xED, 0xED, 0xED, 0xED, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xEE, 0xEE, 0xED,
-    0xEE, 0xED, 0xED, 0xEE, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDC, 0xCD, 0xCC, 0xCC, 0xDC, 0xDD, 0xFF, 0xFF, 0xFF, 0xDD, 0xEF,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDF, 0xEF, 0xFF, 0xFF, 0xDF, 0xFD, 0xDC,
-    0xBB, 0xBB, 0xAA, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xED, 0xCC, 0xBB, 0xA9,
-    0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xCD, 0xCC, 0xBA, 0x99, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xDF, 0xEC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xEE, 0xDD, 0xBA, 0xA8, 0x87, 0x76, 0x66, 0x67, 0x88, 0x9A,
-    0xCD, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x67, 0x89, 0xAB, 0xCD,
-    0xCC, 0xA9, 0x87, 0x76, 0x55, 0x55, 0x56, 0x77, 0x89, 0xBD, 0xDC, 0xCB,
-    0x98, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xCC, 0xA9, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAD, 0xCD, 0xCA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x66, 0x78, 0x9A, 0xCC, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x55,
-    0x56, 0x77, 0x8A, 0xBC, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x67,
-    0x89, 0xAB, 0xCD, 0xEC, 0xCA, 0x98, 0x87, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBC, 0xDE, 0xDC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x89, 0x9A, 0xBC, 0xDC,
-    0xFE, 0xEC, 0xBA, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xCD, 0xDF, 0xFE,
-    0xDC, 0xBB, 0xA9, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xEE, 0xFF, 0xFF, 0xDC,
-    0xCB, 0xBA, 0xAB, 0xBB, 0xCC, 0xDD, 0xDE, 0xDF, 0xFF, 0xFF, 0xED, 0xCC,
-    0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xED, 0xDF, 0xFF, 0xDF, 0xDD, 0xDD, 0xDC,
-    0xCC, 0xCD, 0xED, 0xCE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xED, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E,
-    0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD4, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0x4E, 0x4E, 0x4E, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xE4, 0xE3, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0x4D, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0x44, 0x4D, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0x4E, 0xE4, 0xEE, 0x3E, 0x4E,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE3, 0xEE, 0xE5, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E, 0x3E, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xED, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9C, 0xBB, 0xAA, 0xAA, 0xAA, 0x9A, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xCC,
-    0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xAB, 0xCD, 0xDB, 0xCB, 0xAA, 0x99, 0x99,
-    0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC, 0xAB, 0xAA, 0xA9, 0x98, 0x88, 0x88,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9,
-    0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87,
-    0x66, 0x65, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x66, 0x78, 0x99, 0xAA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x99, 0xAA, 0xAB, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA,
-    0xBB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCC,
-    0xBA, 0x99, 0x98, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xDD, 0xCC, 0xBA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBD, 0xDD, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xBC, 0xCB, 0xBA, 0xAA, 0xA9, 0x9A,
-    0xAA, 0xAA, 0xBA, 0xBC, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCC, 0xBB, 0xCC,
-    0xCA, 0xAA, 0xAA, 0x9A, 0xA9, 0xAA, 0xBB, 0xBD, 0xDC, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x98, 0x99, 0xA9, 0xAB, 0xBB, 0xCB, 0xBA, 0xAA, 0x99, 0x88,
-    0x88, 0x88, 0x89, 0x99, 0xAB, 0xBB, 0xAA, 0xA9, 0x98, 0x88, 0x88, 0x77,
-    0x88, 0x88, 0x9A, 0xAB, 0xAA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x88, 0x99, 0xBA, 0x9A, 0x99, 0x88, 0x77, 0x76, 0x66, 0x77, 0x77, 0x89,
-    0x9A, 0xA9, 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, 0x78, 0x89, 0xAA,
-    0x99, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x99,
-    0x88, 0x76, 0x66, 0x66, 0x66, 0x67, 0x77, 0x89, 0x99, 0x99, 0x98, 0x77,
-    0x66, 0x66, 0x56, 0x66, 0x67, 0x78, 0x99, 0x99, 0xA9, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x66, 0x77, 0x89, 0xA9, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x99, 0x99, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x78, 0x89, 0xA9, 0xAA, 0x99, 0x88, 0x77, 0x76, 0x67, 0x77, 0x78, 0x89,
-    0x9A, 0x9A, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, 0x88, 0x9A, 0xB9,
-    0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77, 0x88, 0x89, 0x99, 0xAB, 0xAB, 0xCA,
-    0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x99, 0xAB, 0xBB, 0xBB, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xBC, 0xCC, 0xCB, 0xAA, 0x9A,
-    0x99, 0x9A, 0x9A, 0xAB, 0xBC, 0xCC, 0xBC, 0xCA, 0xAA, 0xA9, 0x99, 0x99,
-    0x99, 0x9A, 0xAA, 0xAB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCC, 0xBC, 0xBA, 0xAA,
-    0x99, 0x99, 0x89, 0x99, 0x99, 0xAA, 0xBC, 0xBA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xA9, 0x98, 0x88, 0x87, 0x77,
-    0x88, 0x88, 0x99, 0xAA, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77, 0x77, 0x77,
-    0x88, 0x99, 0xAA, 0x9A, 0x99, 0x88, 0x77, 0x77, 0x67, 0x77, 0x77, 0x89,
-    0x9A, 0x99, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77, 0x78, 0x89, 0xA9,
-    0x99, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x78, 0x99, 0x99, 0x98,
-    0x87, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x99, 0x99, 0x88, 0x77,
-    0x76, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0x99, 0x99, 0x87, 0x77, 0x66,
-    0x66, 0x66, 0x67, 0x77, 0x89, 0x99, 0x99, 0x98, 0x77, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x99, 0x99, 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x78, 0x89, 0xA9, 0x9A, 0x98, 0x87, 0x77, 0x77, 0x67, 0x77, 0x78, 0x89,
-    0x9A, 0x9A, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, 0x88, 0x99, 0xA9,
-    0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, 0x88, 0x88, 0x99, 0xAB, 0xAA, 0xBA,
-    0xA9, 0x98, 0x88, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBA, 0xBB, 0xBA, 0xA9,
-    0x99, 0x99, 0x89, 0x99, 0x99, 0xAA, 0xBB, 0xBC, 0xCB, 0xBB, 0xAA, 0xA9,
-    0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCB, 0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x99,
-    0x99, 0x9A, 0xAA, 0xBB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9C, 0xBA, 0xAA, 0x9A, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCB, 0xAB, 0xCC,
-    0xBA, 0xAA, 0xA9, 0x99, 0xA9, 0xAA, 0xAA, 0xBC, 0xCC, 0xAC, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xBB, 0xCB, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77,
-    0x78, 0x88, 0x99, 0xAA, 0xAA, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xAA, 0x9A, 0x99, 0x88, 0x77, 0x76, 0x67, 0x77, 0x77, 0x88,
-    0x9A, 0x99, 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0xA9,
-    0x99, 0x98, 0x77, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x89, 0x99, 0x98,
-    0x87, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0xA9, 0x99, 0x98, 0x87,
-    0x66, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0x99, 0x99, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x77, 0x89, 0x99, 0x9A, 0x88, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0x99, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x78, 0x89, 0xA9, 0xAA, 0x99, 0x87, 0x77, 0x77, 0x67, 0x77, 0x77, 0x89,
-    0x9A, 0xAA, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x99, 0xAA,
-    0xAB, 0xAA, 0x98, 0x88, 0x87, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xAA, 0xBA,
-    0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAA, 0xBB, 0xCC, 0xBA, 0xA9,
-    0xA9, 0x99, 0x98, 0x99, 0x99, 0xAB, 0xAB, 0xAC, 0xCC, 0xBA, 0xAA, 0xA9,
-    0x99, 0x9A, 0x9A, 0xBB, 0xBC, 0xCB, 0xBC, 0xBB, 0xAA, 0xA9, 0x99, 0x99,
-    0x9A, 0x9A, 0xAA, 0xBB, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xCB, 0xDC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xCC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xDB, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBC, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9,
-    0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87,
-    0x66, 0x65, 0x55, 0x66, 0x67, 0x88, 0x9A, 0xA9, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xAA, 0xB9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67,
-    0x78, 0x99, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0x9A, 0xAA, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA,
-    0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xAC, 0xCB,
-    0xBA, 0x99, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xDC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA,
-    0x9A, 0xAA, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDC, 0xDD, 0xCC, 0xCC, 0xCD, 0xDE, 0xED, 0xFF, 0xFF, 0xCF, 0xFF,
-    0xEE, 0xDD, 0xDC, 0xCD, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFE, 0xDC, 0xBB, 0xAA,
-    0xA9, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xEF, 0xFD, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x89,
-    0xAB, 0xCE, 0xFE, 0xDD, 0xCA, 0x98, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB,
-    0xDF, 0xFD, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x77, 0x9A, 0xBC, 0xEE,
-    0xDC, 0xBA, 0x97, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xED, 0xCB,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xDC, 0xB9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0xA8, 0x76, 0x55,
-    0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDD, 0xBA, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xCD, 0xDE, 0xDC, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xFD, 0xDB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAC,
-    0xCD, 0xDF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEF,
-    0xFF, 0xFD, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xDF, 0xFE,
-    0xED, 0xCB, 0xBA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF, 0xFD,
-    0xDC, 0xBC, 0xCB, 0xCC, 0xCD, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFE, 0xEE,
-    0xDD, 0xDE, 0xDE, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xEE, 0xED, 0xDD,
-    0xEE, 0xDF, 0xEE, 0xFE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDC, 0xCC, 0xCC, 0xCB, 0xCC, 0xCC, 0xEF, 0xFF, 0xDF, 0xCD, 0xFF,
-    0xCD, 0xCC, 0xCC, 0xCC, 0xBD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xBB,
-    0xBB, 0xAB, 0xBA, 0xBC, 0xDC, 0xDF, 0xFF, 0xFD, 0xDC, 0xCB, 0xAA, 0xA9,
-    0x99, 0x9A, 0xBB, 0xBC, 0xFF, 0xFF, 0xCC, 0xDB, 0xA9, 0x99, 0x88, 0x88,
-    0x89, 0xAB, 0xCC, 0xDF, 0xFC, 0xDC, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAB, 0xCD, 0xFF, 0xBC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCF, 0xFC, 0xBB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xCF,
-    0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xFC, 0xBB,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA8, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xEC, 0xBA, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCC, 0xDD, 0xDB, 0x99, 0x87, 0x77, 0x77, 0x77, 0x89, 0xAB,
-    0xBC, 0xCF, 0xFD, 0xBB, 0xA9, 0x88, 0x88, 0x88, 0x89, 0x9B, 0xCC, 0xFC,
-    0xFF, 0xDD, 0xBA, 0x9A, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xFD, 0xDF, 0xFD,
-    0xFD, 0xCB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCF, 0xFD, 0xFF, 0xFF, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDD, 0xDF, 0xDF, 0xFF, 0xFF, 0xFD, 0xFD,
-    0xCC, 0xCC, 0xFC, 0xCD, 0xFE, 0xFE, 0xDF, 0xFF, 0xFD, 0xDD, 0xFC, 0xDC,
-    0xDD, 0xCC, 0xCE, 0xFD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xDD, 0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFD, 0xFE,
-    0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCE, 0xFF, 0xFF, 0xFF, 0xEF, 0xDD, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xDF, 0xFF, 0xFD, 0xED, 0xCB, 0xAA, 0xA9,
-    0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xDD, 0xCB, 0xAA, 0x99, 0x88, 0x88,
-    0x89, 0x9A, 0xBD, 0xEF, 0xFC, 0xDB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x88,
-    0x9A, 0xBD, 0xFF, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCD, 0xFC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDF,
-    0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA,
-    0x98, 0x76, 0x55, 0x55, 0x55, 0x66, 0x78, 0xAB, 0xCD, 0xCC, 0xA9, 0x87,
-    0x65, 0x55, 0x45, 0x56, 0x67, 0x8A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x79, 0xAB, 0xCD, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xDE, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0xAC, 0xCD, 0xFD, 0xCB, 0x98, 0x87, 0x76, 0x67, 0x77, 0x89, 0xAB,
-    0xCD, 0xDF, 0xFD, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x89, 0xAA, 0xBC, 0xDD,
-    0xFF, 0xFD, 0xBA, 0xA9, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xDD, 0xEF, 0xFF,
-    0xED, 0xCB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xFF, 0xFF, 0xED,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0xFE, 0xDD,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFD, 0xED, 0xDD,
-    0xDD, 0xDD, 0xED, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAE, 0xCD, 0xCC, 0xEC, 0xCD, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xDD, 0xFD,
-    0xDC, 0xDC, 0xCD, 0xCC, 0xDD, 0xED, 0xDF, 0xFF, 0xFF, 0xCF, 0xDF, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDF, 0xFF, 0xFD, 0xFD, 0xCB, 0xBB, 0xAA,
-    0x99, 0xA9, 0xAB, 0xCD, 0xFF, 0xFF, 0xDE, 0xCB, 0xBA, 0x99, 0x88, 0x88,
-    0x89, 0xAA, 0xCD, 0xFF, 0xFD, 0xDC, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x88,
-    0x9A, 0xBD, 0xFD, 0xCC, 0xBA, 0x99, 0x87, 0x66, 0x66, 0x67, 0x88, 0xAC,
-    0xCF, 0xEC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xDD,
-    0xDD, 0xBA, 0x97, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xCB,
-    0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x79, 0xAB, 0xDD, 0xDC, 0xB9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x77, 0x9A, 0xBC, 0xDD, 0xCB, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xBD, 0xDC, 0xB9, 0x97, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xCD, 0xCD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x99, 0xAC, 0xDC, 0xFE, 0xCA, 0x98, 0x87, 0x76, 0x67, 0x78, 0x99, 0xAC,
-    0xCD, 0xCD, 0xED, 0xBA, 0x99, 0x88, 0x78, 0x88, 0x99, 0xAB, 0xCD, 0xDC,
-    0xFF, 0xFC, 0xBA, 0xA9, 0x99, 0x89, 0x99, 0xAB, 0xBC, 0xDD, 0xCF, 0xFF,
-    0xFD, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCB, 0xCD, 0xDC, 0xFF, 0xFF, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xFF, 0xDF, 0xFF, 0xFF, 0xEE, 0xDE,
-    0xDC, 0xCD, 0xDF, 0xEE, 0xFF, 0xFD, 0xDF, 0xFF, 0xEE, 0xDC, 0xDD, 0xCC,
-    0xCC, 0xCC, 0xCC, 0xFD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAE, 0xED, 0xDE, 0xDD, 0xDD, 0xDE, 0xDF, 0xFF, 0xFF, 0xFF, 0xCD, 0xFE,
-    0xFF, 0xEE, 0xDD, 0xDD, 0xCE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xEE, 0xDC,
-    0xCB, 0xCB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFD, 0xFE, 0xDC, 0xCB, 0xAA,
-    0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xFF, 0xDF, 0xDC, 0xBB, 0xA9, 0x99, 0x99,
-    0x9A, 0xAB, 0xDF, 0xFF, 0xFD, 0xDD, 0xBA, 0xA9, 0x88, 0x77, 0x78, 0x89,
-    0xAB, 0xDE, 0xFF, 0xDD, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xBC,
-    0xFE, 0xFD, 0xDB, 0xB9, 0x87, 0x66, 0x55, 0x56, 0x77, 0x9A, 0xBD, 0xFF,
-    0xDD, 0xCA, 0x98, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCE, 0xFD, 0xEB,
-    0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBD, 0xFF, 0xDD, 0xBA, 0x97,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xED, 0xDB, 0xA9, 0x76, 0x55,
-    0x44, 0x55, 0x67, 0x89, 0xBC, 0xFD, 0xED, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0xAB, 0xDF, 0xFD, 0xEC, 0xB9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xED, 0xDF, 0xFC, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xAC,
-    0xDE, 0xEF, 0xFF, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x9A, 0xBB, 0xCE, 0xFE,
-    0xFF, 0xFE, 0xCB, 0xBA, 0x99, 0x99, 0xAA, 0xAB, 0xCD, 0xEF, 0xEF, 0xFF,
-    0xED, 0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF,
-    0xDE, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xDD, 0xED, 0xCD,
-    0xDD, 0xCC, 0xDD, 0xDE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xAC, 0xDC,
-    0xCB, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDD, 0xFE, 0xCC, 0xCB, 0xBA,
-    0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDE, 0xDB, 0xCB, 0xAA, 0xA9, 0x99,
-    0x88, 0x89, 0x99, 0xAB, 0xBC, 0xED, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xCC, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x99, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xBC, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x66, 0x65, 0x56,
-    0x66, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBB, 0xBB, 0xA9, 0x98, 0x77, 0x77, 0x67, 0x77, 0x88, 0x9A,
-    0xBB, 0xBC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xCB,
-    0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCC, 0xEE, 0xDC, 0xCB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCD, 0xFD, 0xDC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEC, 0xBD, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xCB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x8A, 0xA9, 0x99, 0x99, 0x98, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xAA, 0xBB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xDC, 0xAB, 0xBA, 0xA9,
-    0x99, 0x99, 0x88, 0x99, 0x9A, 0xAA, 0xBC, 0xC9, 0xAA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x78, 0x88, 0x99, 0xAB, 0xB9, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77,
-    0x88, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89,
-    0xAA, 0xA9, 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x78, 0x89, 0xA9,
-    0x99, 0x98, 0x87, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x99,
-    0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0x99, 0x89, 0x88, 0x77,
-    0x66, 0x66, 0x66, 0x66, 0x77, 0x78, 0x9A, 0x99, 0x98, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0x99, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x99, 0x99, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x78, 0x89, 0xA9, 0x9A, 0x99, 0x87, 0x77, 0x77, 0x67, 0x77, 0x78, 0x89,
-    0x9A, 0x9A, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA,
-    0xAB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x88, 0x99, 0x99, 0xAB, 0xAB, 0xBB,
-    0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBA, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xAD, 0xDD, 0xBB, 0xAA, 0xA9,
-    0xA9, 0x9A, 0xAA, 0xAB, 0xBB, 0xDB, 0xAC, 0xCB, 0xAA, 0xA9, 0x99, 0x99,
-    0x99, 0x9A, 0xAA, 0xAB, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xAA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBA, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xAB, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0x9A, 0x99, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0x9A, 0x98, 0x87, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x66, 0x66, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x56, 0x66, 0x67, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x67, 0x77, 0x88, 0x89,
-    0xAB, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA,
-    0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xAB, 0xCB,
-    0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xBB, 0xCC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xBD, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBC, 0xCB, 0xBB, 0xAA, 0xAA, 0x9A,
-    0xAA, 0xAA, 0xAA, 0xBB, 0x90, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAA, 0xBC, 0xBD, 0xBB, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xA9, 0xA9, 0xAA, 0xBB, 0xCD, 0xDD, 0xBC, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBD, 0xCB, 0xBB, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0x9A, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x67, 0x88, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x65, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x67, 0x77, 0x78, 0x99,
-    0xAB, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB,
-    0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0xAA, 0xBB, 0xBC, 0xCC,
-    0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0x9A, 0xBB, 0xCB, 0xCD, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xBD, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDB, 0xAD, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xBC, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xFD, 0xBC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCE, 0xDB, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x89, 0x99, 0xAB, 0xBC, 0xDD, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x99, 0xAB, 0xBC, 0xCB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x89, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x9A,
-    0xAB, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB,
-    0xAA, 0x99, 0x87, 0x66, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x99, 0xBB, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBB, 0xBB, 0xAA, 0x98, 0x77, 0x76, 0x67, 0x77, 0x88, 0x9A,
-    0xAB, 0xBB, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB,
-    0xCC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBC, 0xCC,
-    0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xDD, 0xDC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCE, 0xFD, 0xDC, 0xCB, 0xBB,
-    0xAB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0xBD, 0xDC, 0xCC, 0xBB, 0xBB, 0xAA,
-    0xAB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xBE, 0xFF,
-    0xED, 0xDD, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xED, 0xDC,
-    0xCC, 0xBC, 0xBC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFD, 0xDD, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99,
-    0x9A, 0xBC, 0xDE, 0xFF, 0xFD, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A,
-    0xBC, 0xDF, 0xFF, 0xDD, 0xCB, 0xA9, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xBD,
-    0xFF, 0xFD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xFE,
-    0xDD, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x56, 0x89, 0xAB, 0xEE, 0xFD, 0xDB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBD, 0xEE, 0xDD, 0xBA, 0x98,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xED, 0xEC, 0xA9, 0x87, 0x55,
-    0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xED, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAB, 0xCE, 0xEE, 0xFD, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBD, 0xEE, 0xFF, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xEF, 0xFE, 0xDC, 0xBA, 0x99, 0x88, 0x99, 0x9A, 0xBB, 0xCD, 0xFE,
-    0xEF, 0xFE, 0xDC, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xEF, 0xFF,
-    0xFE, 0xDC, 0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xED, 0xDD, 0xCC, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xDE, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xBE, 0xFF, 0xFF, 0xEE, 0xEE, 0xDE,
-    0xED, 0xDD, 0xEE, 0xFE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDF, 0xFE, 0xFF, 0xBC, 0xED,
-    0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF, 0xCD, 0xDC, 0xCC,
-    0xBB, 0xAB, 0xAB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFC, 0xDC, 0xCB, 0xAA, 0xA9,
-    0x99, 0x9A, 0xAB, 0xCC, 0xFF, 0xFE, 0xCD, 0xCB, 0xAA, 0x99, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xEF, 0xFC, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89,
-    0xAB, 0xCE, 0xFE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xDE, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x77, 0x8A, 0xBC, 0xDE,
-    0xCC, 0xB9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xB9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xDD, 0xCB, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xCD, 0xCC, 0xBA, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xCC, 0xCD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xDD, 0xDE, 0xED, 0xBB, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xDD,
-    0xFF, 0xEC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xDD, 0xDF, 0xFF,
-    0xFE, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xED, 0xDD, 0xFF, 0xFF, 0xEE,
-    0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xEE, 0xDF, 0xFF, 0xFF, 0xFE, 0xED,
-    0xDC, 0xCD, 0xCD, 0xDD, 0xDE, 0xED, 0xCF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDD,
-    0xCD, 0xCC, 0xDD, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xDD, 0xED,
-    0xDC, 0xCC, 0xCB, 0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xDE, 0xDD, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xDC, 0xBB, 0xAA, 0x99,
-    0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xFF, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xBC, 0xEF, 0xFC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0x9B, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCD, 0xEC, 0xCA, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xDE,
-    0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x99, 0xAB, 0xDD, 0xDD, 0xCA, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDE, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x89, 0xAA, 0xBC, 0xDD,
-    0xEE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xDF, 0xFF,
-    0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xFD, 0xFF, 0xFF, 0xED,
-    0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xDF, 0xFF, 0xFE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFE, 0xCF, 0xFF, 0xFF, 0xDE, 0xDD, 0xDD,
-    0xCD, 0xDD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD, 0xDF, 0xEE, 0xFF, 0xFF, 0xCD, 0xDE,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xDC, 0xCB, 0xBA, 0xA9,
-    0x99, 0xAA, 0xAB, 0xCD, 0xFF, 0xFF, 0xCC, 0xBB, 0xA9, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xCF, 0xFF, 0xFC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCE, 0xFF, 0xCD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xDD, 0xFC, 0xCB, 0x98, 0x87, 0x65, 0x55, 0x56, 0x77, 0x8A, 0xBD, 0xFF,
-    0xCC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xED, 0xCB,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xB9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDD, 0xCB, 0xA8, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xED, 0xBA, 0x98, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xCD, 0xFC, 0xB9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x99, 0xAB, 0xFD, 0xFF, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDF, 0xFD, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x89, 0xAB, 0xCC, 0xDD,
-    0xFF, 0xDE, 0xCC, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xCF, 0xFF,
-    0xDD, 0xCB, 0xBB, 0xBA, 0xAA, 0xBB, 0xBC, 0xCD, 0xED, 0xFF, 0xFF, 0xDD,
-    0xDD, 0xCC, 0xBB, 0xCC, 0xCC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFE, 0xED,
-    0xDC, 0xCD, 0xED, 0xDE, 0xDF, 0xEE, 0xBF, 0xFF, 0xFF, 0xFE, 0xED, 0xDC,
-    0xDD, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDD, 0xDC, 0xCC, 0xDC, 0xCD, 0xDD, 0xDE, 0xFF, 0xEF, 0xBE, 0xEE,
-    0xDD, 0xDC, 0xCC, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFE, 0xDE, 0xDD, 0xCB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFD, 0xDD, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAB, 0xBC, 0xCE, 0xFF, 0xFE, 0xCD, 0xDB, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAC, 0xDD, 0xFF, 0xFD, 0xDC, 0xBA, 0x99, 0x87, 0x77, 0x78, 0x99,
-    0xBC, 0xDE, 0xEE, 0xDC, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x78, 0x9A, 0xBC,
-    0xDF, 0xFC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xFE,
-    0xCC, 0xBA, 0x98, 0x66, 0x55, 0x45, 0x56, 0x78, 0xAB, 0xCE, 0xDD, 0xCB,
-    0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDE, 0xDD, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xDD, 0xDB, 0xA9, 0x86, 0x55,
-    0x44, 0x55, 0x67, 0x89, 0xBC, 0xDE, 0xDD, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDE, 0xFC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xFF, 0xDC, 0xAA, 0x98, 0x77, 0x77, 0x88, 0x99, 0xAB,
-    0xCD, 0xDE, 0xFE, 0xDB, 0xBA, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xDE,
-    0xEF, 0xEE, 0xCC, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xCC, 0xED, 0xEF, 0xFF,
-    0xFD, 0xDC, 0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFE,
-    0xDD, 0xCD, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFE, 0xED,
-    0xDD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFE, 0xBF, 0xEE, 0xEE, 0xFE, 0xED, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9C, 0xCB, 0xBB, 0xBA, 0xBA, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xAC, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFE, 0xCD, 0xCB, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xDB, 0xCB, 0xBA, 0xA9, 0x99,
-    0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED, 0xBC, 0xBA, 0xA9, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xBB, 0xCD, 0xDB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xDC, 0xBB, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC,
-    0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xBB, 0xBA,
-    0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x88, 0xAA, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xBB, 0xBA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCB, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xBC, 0xBC, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC,
-    0xCD, 0xCB, 0xAA, 0x99, 0x98, 0x89, 0x99, 0x9A, 0xBB, 0xCD, 0xCC, 0xDD,
-    0xCB, 0xBA, 0xAA, 0xA9, 0x9A, 0xAA, 0xBC, 0xCC, 0xDC, 0xDE, 0xED, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xCD, 0xCD, 0xFE, 0xED, 0xDC, 0xCC,
-    0xBB, 0xCB, 0xCC, 0xCD, 0xDD, 0xEC, 0xAD, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xCB, 0xCC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0xA9, 0xA9, 0x9A, 0xAA, 0xAB, 0xBB, 0xCC, 0xAB, 0xDC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xED, 0xBB, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBB, 0xDC, 0xAB, 0xAA, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBB,
-    0x9A, 0x98, 0x87, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB,
-    0xBC, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBC, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCB, 0xBB,
-    0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xEC, 0xDC, 0xBB, 0xBB,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xAD, 0xCC, 0xCB, 0xBA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xAB, 0xCB,
-    0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDC, 0xBC, 0xBA, 0xA9,
-    0x99, 0x99, 0x89, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x78, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x88, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA,
-    0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xBB, 0xCB,
-    0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAA, 0xAB, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xAC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xAB, 0xCC,
-    0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xAB, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCD, 0xCA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA,
-    0x9A, 0x98, 0x77, 0x66, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x67, 0x77, 0x89, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA,
-    0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xAC, 0xBB, 0xCB,
-    0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBD, 0xCB, 0xBA,
-    0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xCD, 0xCD, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDC, 0xAC, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCC, 0x9B, 0xCC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xED, 0xBC, 0xCB, 0xBA,
-    0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xCB, 0xCB, 0xAA, 0x99, 0x99,
-    0x89, 0x99, 0x9A, 0xAB, 0xCC, 0xDC, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x9A, 0xAB, 0xCD, 0xCA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xBC, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBB,
-    0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAB, 0xBA, 0xA9,
-    0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x99, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBA, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAB, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xBC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xAB, 0xBB, 0xCB, 0xAA, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xCC, 0xCB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xBC, 0xDC,
-    0xCB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xCE, 0xDC, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCD, 0xED, 0xDD, 0xCC, 0xCB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEC, 0xAD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xFE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xBF, 0xFF,
-    0xFE, 0xFD, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xED,
-    0xCC, 0xCB, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xEE, 0xFF, 0xEC, 0xCB, 0xBA,
-    0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xFE, 0xEF, 0xED, 0xCB, 0xAA, 0x99, 0x99,
-    0xAA, 0xBC, 0xDE, 0xFF, 0xEE, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0x9A,
-    0xBC, 0xDE, 0xFF, 0xDE, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x78, 0x9A, 0xBD,
-    0xEF, 0xED, 0xEC, 0xB9, 0x87, 0x66, 0x55, 0x66, 0x79, 0xAB, 0xCE, 0xFE,
-    0xDD, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAC, 0xDE, 0xED, 0xDB,
-    0xA9, 0x86, 0x54, 0x43, 0x45, 0x68, 0x9A, 0xCD, 0xEE, 0xDD, 0xBA, 0x98,
-    0x75, 0x43, 0x34, 0x56, 0x79, 0xAB, 0xDE, 0xED, 0xDC, 0xB9, 0x87, 0x65,
-    0x44, 0x55, 0x78, 0x9A, 0xCD, 0xEE, 0xDD, 0xCB, 0xA9, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xBC, 0xDF, 0xED, 0xED, 0xBA, 0x98, 0x77, 0x66, 0x77, 0x89,
-    0xAB, 0xCD, 0xFE, 0xDE, 0xEC, 0xBA, 0x99, 0x88, 0x78, 0x89, 0xAB, 0xBD,
-    0xEF, 0xED, 0xFE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0xAB, 0xBC, 0xDF, 0xFE,
-    0xEF, 0xFE, 0xDC, 0xBB, 0xBA, 0xAA, 0xBB, 0xCD, 0xDE, 0xEF, 0xFD, 0xFE,
-    0xEE, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xEF, 0xFF, 0xEE,
-    0xEE, 0xDD, 0xDD, 0xDD, 0xEE, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xEE,
-    0xFE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xAE, 0xEE, 0xEE, 0xEE, 0xDD, 0xDE,
-    0xEF, 0xFE, 0xEE, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBE, 0xDC, 0xDC, 0xCC, 0xCB, 0xCB, 0xCC, 0xCC, 0xDD, 0xCD, 0xAD, 0xED,
-    0xDD, 0xCC, 0xCC, 0xCC, 0xBC, 0xCD, 0xCE, 0xEF, 0xFE, 0xEE, 0xDC, 0xCB,
-    0xBB, 0xBA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDF, 0xDC, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xCD, 0xDE, 0xFD, 0xCD, 0xCB, 0xA9, 0x99, 0x88, 0x88,
-    0x99, 0xAA, 0xBC, 0xEF, 0xDC, 0xDB, 0xAA, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xDE, 0xDC, 0xCB, 0x98, 0x77, 0x65, 0x55, 0x56, 0x77, 0x89, 0xBC, 0xDD,
-    0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xBC, 0xDB, 0xCA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xBA, 0x88, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDC, 0xCD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAC,
-    0xCE, 0xDC, 0xDD, 0xCA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED,
-    0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAC, 0xCD, 0xEE, 0xDD, 0xEF,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xED, 0xFD, 0xEE, 0xEE, 0xDD,
-    0xDC, 0xCB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xFF, 0xED, 0xED, 0xDD,
-    0xDC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0xAD, 0xED, 0xDD, 0xDD, 0xCD, 0xDC,
-    0xDD, 0xDE, 0xED, 0xED, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xDD, 0xCC, 0xCC, 0xBB, 0xBC, 0xCC, 0xCD, 0xDE, 0xEF, 0xCE, 0xFE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCE, 0xFF, 0xED, 0xDC, 0xBB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x88, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xDE, 0xCC, 0xB9, 0x98, 0x77, 0x66, 0x66, 0x67, 0x88, 0x9B,
-    0xCD, 0xDC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDB, 0xBA,
-    0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0xAB, 0xCC, 0xCB, 0xA9, 0x87,
-    0x65, 0x55, 0x55, 0x56, 0x77, 0x8A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x89, 0xAC, 0xDD, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x89, 0xAB, 0xBD, 0xDD,
-    0xDE, 0xDC, 0xBA, 0x99, 0x98, 0x89, 0x99, 0xAB, 0xBC, 0xDE, 0xED, 0xFD,
-    0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFE, 0xEF, 0xEE, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFE, 0xFF, 0xEE, 0xDD, 0xDC,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFF, 0xCF, 0xEE, 0xED, 0xDD, 0xDD, 0xCC,
-    0xCD, 0xDD, 0xDF, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBC, 0xBC, 0xCC, 0xCC, 0xDD, 0xAC, 0xDD,
-    0xDD, 0xCC, 0xCC, 0xBC, 0xBC, 0xCC, 0xDD, 0xDF, 0xFD, 0xDE, 0xEC, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xDE, 0xCC, 0xDD, 0xCB, 0xAA, 0xA9,
-    0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xED, 0xCD, 0xBB, 0xAA, 0x99, 0x88, 0x88,
-    0x99, 0xAA, 0xBC, 0xDD, 0xDB, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAB, 0xCC, 0xED, 0xBC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x77, 0x89, 0xAB,
-    0xCD, 0xCB, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xBC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xCA,
-    0x98, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xB9, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xCA, 0xA8, 0x76, 0x65,
-    0x44, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDC, 0xCD, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x9A, 0xAB,
-    0xCD, 0xCC, 0xDC, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDC,
-    0xCD, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCD, 0xCC, 0xED,
-    0xDC, 0xCB, 0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xDD, 0xDE, 0xDD, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xCC, 0xCC, 0xCD, 0xDF, 0xDD, 0xFF, 0xED, 0xDD, 0xDC,
-    0xCC, 0xCD, 0xDD, 0xEE, 0xEE, 0xFD, 0xAD, 0xDC, 0xDC, 0xCC, 0xCC, 0xBC,
-    0xCC, 0xCC, 0xDC, 0xDE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAE, 0xED, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD, 0xDD, 0xDD, 0xDD, 0x9E, 0xFF,
-    0xFF, 0xED, 0xED, 0xDD, 0xEE, 0xEF, 0xFE, 0xFF, 0xFD, 0xDF, 0xEE, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDD, 0xEF, 0xFE, 0xFF, 0xED, 0xFE, 0xDD, 0xCC, 0xCB,
-    0xBC, 0xCC, 0xDE, 0xEE, 0xEE, 0xFE, 0xDF, 0xDD, 0xCB, 0xBA, 0xAA, 0xAB,
-    0xBC, 0xDD, 0xDF, 0xEF, 0xED, 0xED, 0xDB, 0xBA, 0x99, 0x88, 0x99, 0xAB,
-    0xCD, 0xEF, 0xFD, 0xDE, 0xDC, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAB, 0xDD,
-    0xFF, 0xDD, 0xED, 0xBA, 0x98, 0x76, 0x55, 0x67, 0x89, 0xBC, 0xDD, 0xFE,
-    0xDE, 0xCB, 0xA9, 0x76, 0x54, 0x45, 0x67, 0x9A, 0xCD, 0xEF, 0xED, 0xED,
-    0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xED, 0xDE, 0xDB, 0xA8,
-    0x75, 0x43, 0x24, 0x57, 0x8A, 0xBC, 0xDE, 0xED, 0xED, 0xCA, 0x97, 0x65,
-    0x44, 0x46, 0x78, 0xAC, 0xCD, 0xED, 0xDE, 0xDD, 0xBA, 0x87, 0x65, 0x56,
-    0x68, 0x9A, 0xBD, 0xEF, 0xDD, 0xFE, 0xDC, 0xA9, 0x87, 0x77, 0x78, 0x8A,
-    0xBC, 0xDE, 0xEE, 0xEF, 0xFD, 0xDB, 0xAA, 0x98, 0x88, 0x9A, 0xAB, 0xCD,
-    0xFF, 0xDD, 0xFE, 0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFE,
-    0xDF, 0xFE, 0xED, 0xDC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xEE, 0xFF,
-    0xFF, 0xFE, 0xDD, 0xCD, 0xDD, 0xDD, 0xEF, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE,
-    0xFE, 0xEE, 0xED, 0xEE, 0xEE, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF,
-    0xFE, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE, 0xAD, 0xDD, 0xDD, 0xDD, 0xED, 0xDE,
-    0xDE, 0xEE, 0xDD, 0xEE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xDC, 0xCB, 0xBB, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xCD, 0xAD, 0xED,
-    0xCC, 0xBB, 0xAA, 0xBA, 0xAB, 0xBC, 0xCD, 0xDF, 0xFD, 0xDD, 0xCC, 0xBB,
-    0xAA, 0xA9, 0x9A, 0xAA, 0xBB, 0xCD, 0xEE, 0xDC, 0xDB, 0xBA, 0xA9, 0x99,
-    0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDD, 0xBC, 0xBA, 0xA9, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xBB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBB, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC,
-    0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAC, 0xCA, 0xA9,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xAB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x89, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9A, 0xAC, 0xBB, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x89, 0xAB, 0xCC, 0xBC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xBC, 0xCC, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC,
-    0xCD, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xCC, 0xDD,
-    0xCB, 0xBA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xDD, 0xCE, 0xDD, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xBB, 0xBC, 0xCD, 0xEE, 0xDD, 0xFD, 0xED, 0xCC, 0xCC,
-    0xBC, 0xBC, 0xCC, 0xDD, 0xEE, 0xFE, 0x9D, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB,
-    0xBC, 0xCC, 0xDD, 0xEE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0x9B, 0xDC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBB, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBC, 0xDC, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78,
-    0x88, 0x89, 0xAA, 0xBC, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x99, 0xAB, 0xBB, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x9A,
-    0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x45, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBA, 0xAB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xBB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB,
-    0xBB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xBB, 0xCC,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCC, 0xCC, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCC, 0xDD, 0xDC, 0xCB, 0xBB,
-    0xAA, 0xAB, 0xBB, 0xBC, 0xCC, 0xDD, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAB, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xCC, 0xAB, 0xBA, 0xA9,
-    0x99, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77,
-    0x78, 0x89, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAA, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x77, 0x78, 0x99, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98,
-    0x87, 0x76, 0x66, 0x55, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x88, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xBB,
-    0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0x9A,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xA9, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xBC, 0xDC, 0xBC, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xBA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x9A, 0x98, 0x77, 0x66, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x67, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xAA,
-    0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBB, 0xCC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0x9C, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAD, 0xCC, 0xCC, 0xCC, 0xCB, 0xBB, 0xBC, 0xBC, 0xCC, 0xDC, 0x9D, 0xED,
-    0xED, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xED, 0xDF, 0xDD, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDD, 0xEE, 0xDC, 0xDD, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEC, 0xCC, 0xCB, 0xBA, 0x99, 0x99, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xCC, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A,
-    0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xBB,
-    0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x66, 0x56, 0x67, 0x88, 0xAA, 0xBC, 0xDC,
-    0xBC, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xCB,
-    0xA9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xBC, 0xDC, 0xBC, 0xBA, 0x98,
-    0x76, 0x43, 0x34, 0x56, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xCD, 0xBA, 0x99, 0x87, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCC, 0xBA, 0x98, 0x87, 0x76, 0x77, 0x88,
-    0x9A, 0xBC, 0xDC, 0xCD, 0xCC, 0xAA, 0x98, 0x88, 0x88, 0x88, 0x9A, 0xBB,
-    0xCD, 0xDC, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDC,
-    0xCE, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xDD, 0xDD,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDD, 0xED, 0xDF, 0xEE, 0xDD,
-    0xDC, 0xCB, 0xCC, 0xCC, 0xCC, 0xEE, 0xEF, 0xDD, 0xEE, 0xEE, 0xED, 0xDD,
-    0xCD, 0xCD, 0xDE, 0xEE, 0xEE, 0xFE, 0x9D, 0xCD, 0xCD, 0xCC, 0xCC, 0xCC,
-    0xCC, 0xDD, 0xDD, 0xDE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xFF, 0xFE, 0xFF, 0xEE, 0xDE, 0xDE, 0xEF, 0xEE, 0xEE, 0xAF, 0xFF,
-    0xFF, 0xFE, 0xEE, 0xED, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xDD, 0xCD, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xEF, 0xFF, 0xEE, 0xDC, 0xBB,
-    0xBB, 0xBB, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xBA, 0x99, 0x9A,
-    0xAB, 0xCD, 0xFE, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9B,
-    0xCD, 0xEF, 0xFE, 0xFF, 0xDC, 0xB9, 0x87, 0x76, 0x77, 0x78, 0xAB, 0xCD,
-    0xEF, 0xFE, 0xED, 0xBA, 0x97, 0x66, 0x55, 0x67, 0x79, 0xAB, 0xDE, 0xFF,
-    0xEF, 0xCB, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xBC, 0xEF, 0xFE, 0xEC,
-    0xB9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCE, 0xFF, 0xFE, 0xCB, 0x98,
-    0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xFE, 0xED, 0xB9, 0x87, 0x65,
-    0x44, 0x55, 0x78, 0x9B, 0xCE, 0xFF, 0xFF, 0xDB, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x8A, 0xBD, 0xFF, 0xFF, 0xED, 0xCB, 0x98, 0x87, 0x66, 0x77, 0x89,
-    0xAC, 0xEF, 0xFF, 0xFF, 0xED, 0xCB, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xCE,
-    0xEF, 0xFE, 0xFF, 0xDD, 0xCB, 0xA9, 0x99, 0x9A, 0xAB, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xED, 0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xEE, 0xDC, 0xCC, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF,
-    0xEE, 0xEE, 0xDE, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xEE, 0xFE, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDD, 0x9E, 0xEE,
-    0xDD, 0xCC, 0xCC, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFE, 0xEF, 0xDD, 0xCC,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xDD, 0xEC, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xED, 0xDD, 0xCB, 0xAA, 0x98, 0x88, 0x88,
-    0x89, 0xAB, 0xBC, 0xDF, 0xEC, 0xDB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCE, 0xEC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x77, 0x8A, 0xBC, 0xDD,
-    0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xBA, 0x88, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9B, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xBC,
-    0xDE, 0xED, 0xED, 0xCA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD,
-    0xDE, 0xDC, 0xCB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xFD, 0xFE,
-    0xDC, 0xBB, 0xBB, 0xAA, 0xAA, 0xBC, 0xCC, 0xDE, 0xFE, 0xDF, 0xEE, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xFF, 0xED, 0xFE, 0xFE, 0xED, 0xDD,
-    0xCD, 0xDD, 0xDE, 0xFE, 0xFF, 0xFF, 0xAE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xEE, 0xFE, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xDD, 0xDC, 0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xEE, 0xBE, 0xEE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFE, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEF, 0xED, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xEE, 0xDC, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x67, 0x89, 0xAB,
-    0xCD, 0xDC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD,
-    0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDB, 0xBA,
-    0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCB, 0xA9, 0x87,
-    0x65, 0x55, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78,
-    0x99, 0xAC, 0xDD, 0xDC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDD, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE,
-    0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xEE, 0xED,
-    0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFE, 0xDF, 0xEE, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFE, 0xFF, 0xEE, 0xED, 0xDC,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0xBF, 0xEE, 0xDD, 0xDD, 0xDC, 0xDD,
-    0xDD, 0xDE, 0xEF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xEE, 0xDD, 0xDD, 0xCC, 0xDD, 0xCD, 0xDE, 0xEF, 0xFE, 0xAF, 0xFF,
-    0xFD, 0xDC, 0xCC, 0xCC, 0xCC, 0xED, 0xEE, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC,
-    0xBB, 0xAA, 0xBB, 0xBB, 0xCD, 0xEE, 0xFF, 0xFE, 0xED, 0xCB, 0xAA, 0xA9,
-    0x99, 0x9A, 0xAB, 0xCD, 0xEE, 0xFE, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xCD, 0xEF, 0xED, 0xDC, 0xAA, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCD, 0xFD, 0xDD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCF, 0xEC, 0xCB, 0xA8, 0x77, 0x65, 0x55, 0x56, 0x77, 0x8A, 0xBC, 0xDE,
-    0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCE, 0xDC, 0xCA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xDC, 0xBA, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0x9B, 0xCD, 0xDD, 0xDC, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDE, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xBB,
-    0xCD, 0xED, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE,
-    0xEE, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xED, 0xFF,
-    0xDD, 0xCB, 0xBB, 0xAA, 0xAA, 0xBC, 0xCD, 0xDE, 0xFF, 0xEF, 0xFF, 0xFD,
-    0xDC, 0xCB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xAE, 0xEE, 0xED, 0xED, 0xDD, 0xDD,
-    0xDE, 0xEE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xEE, 0xFE, 0xDE, 0xEE, 0xFF, 0xDE, 0xFF, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xDC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xCB, 0xBA,
-    0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x99, 0x99,
-    0x9A, 0xBC, 0xDF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x87, 0x77, 0x88, 0x9A,
-    0xBD, 0xFF, 0xFF, 0xEF, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xCD,
-    0xFF, 0xFF, 0xFC, 0xB9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9B, 0xCE, 0xFF,
-    0xEE, 0xCA, 0x98, 0x65, 0x54, 0x45, 0x56, 0x89, 0xAC, 0xDF, 0xFE, 0xDC,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFF, 0xED, 0xCA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xDF, 0xFE, 0xDC, 0xA9, 0x86, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAC, 0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x88,
-    0xAB, 0xCE, 0xFF, 0xFF, 0xFC, 0xBA, 0x98, 0x87, 0x77, 0x89, 0x9B, 0xCD,
-    0xFF, 0xFE, 0xFF, 0xDC, 0xBA, 0x99, 0x98, 0x99, 0xAB, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xED, 0xCB, 0xBA, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xDD, 0xCC, 0xCC, 0xCC, 0xCE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFE, 0xED, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xEE, 0xDE, 0xFE,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBE, 0xEE, 0xDD, 0xDD, 0xCC, 0xCC, 0xDD, 0xDD, 0xDD, 0xED, 0x9F, 0xFF,
-    0xFE, 0xDD, 0xDD, 0xCD, 0xDD, 0xEF, 0xEE, 0xFF, 0xFE, 0xEF, 0xED, 0xDC,
-    0xCC, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xFF, 0xEE, 0xEE, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAB, 0xBC, 0xDD, 0xEF, 0xFE, 0xDD, 0xCC, 0xCA, 0xA9, 0x99, 0x99,
-    0x9A, 0xBC, 0xCD, 0xEF, 0xDE, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A,
-    0xBC, 0xDE, 0xFE, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xBC,
-    0xDE, 0xED, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xEE,
-    0xDD, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAC, 0xDF, 0xED, 0xDB,
-    0xA9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xCC, 0xFD, 0xDC, 0xCA, 0x98,
-    0x75, 0x43, 0x34, 0x56, 0x89, 0xAB, 0xCE, 0xDD, 0xDC, 0xA9, 0x87, 0x65,
-    0x44, 0x56, 0x78, 0x9A, 0xBD, 0xEE, 0xDD, 0xCA, 0xA9, 0x77, 0x65, 0x56,
-    0x67, 0x89, 0xAC, 0xDE, 0xED, 0xED, 0xCA, 0x98, 0x77, 0x76, 0x77, 0x89,
-    0xAB, 0xCD, 0xFE, 0xEE, 0xDC, 0xBA, 0x98, 0x88, 0x78, 0x89, 0x9A, 0xBC,
-    0xDE, 0xED, 0xFE, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xEE,
-    0xEF, 0xFD, 0xDC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xEE, 0xFF,
-    0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xCD, 0xDD, 0xEF, 0xFF, 0xEF, 0xFF, 0xFE,
-    0xED, 0xDD, 0xDC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFE, 0xEE,
-    0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0x9E, 0xDE, 0xDD, 0xDE, 0xDD, 0xCD,
-    0xDD, 0xFE, 0xEF, 0xFF, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0x8B, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xCA, 0xBB, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0xAA, 0xBC, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAB, 0xCB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xB9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x87, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0xAB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBB,
-    0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCB, 0xBD, 0xCB, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCC, 0xDD, 0xCC, 0xBB, 0xBA,
-    0xAA, 0xBB, 0xBB, 0xBB, 0xCC, 0xDC, 0x9C, 0xCC, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAB, 0xCB,
-    0xBA, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDC, 0xBB, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77,
-    0x78, 0x89, 0x9A, 0xBB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89,
-    0xAB, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77, 0x66, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBA,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xCB,
-    0xAA, 0x99, 0x99, 0x88, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBC, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDC, 0x9C, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xAA, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCC, 0x9C, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xDD, 0xED, 0xBC, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCB, 0xBB, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0xAA, 0xBC, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x99, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xAA, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBB, 0xAB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xAB, 0xBB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xCB,
-    0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xCC, 0xCD, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCC, 0xED, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xAB, 0xBB, 0xBC, 0xDC, 0xDD, 0x9C, 0xCB, 0xBB, 0xBB, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBC, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xDC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0x9D, 0xED,
-    0xCC, 0xBB, 0xBA, 0xAB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFE, 0xDD, 0xCC, 0xBA,
-    0xAA, 0xAA, 0x9A, 0xAA, 0xBC, 0xCD, 0xDF, 0xEC, 0xDC, 0xAA, 0x99, 0x99,
-    0x89, 0x99, 0x9A, 0xBB, 0xCD, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xBB, 0xCD, 0xDB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDD, 0xBB, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9B,
-    0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC,
-    0xBB, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDB, 0xA9,
-    0x88, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0x9B, 0xCC, 0xBB, 0xA9, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0xAA, 0xCC, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBB, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAA,
-    0xBC, 0xDC, 0xDC, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xDD,
-    0xCD, 0xCC, 0xBA, 0x99, 0x98, 0x89, 0x99, 0xAA, 0xBC, 0xCD, 0xCD, 0xED,
-    0xCB, 0xBA, 0xAA, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xED, 0xDF, 0xED, 0xCC,
-    0xBB, 0xBB, 0xAB, 0xBB, 0xBB, 0xCD, 0xDE, 0xED, 0xEE, 0xDD, 0xDC, 0xCC,
-    0xBB, 0xCC, 0xCC, 0xDD, 0xEE, 0xEE, 0x9D, 0xCD, 0xCC, 0xCC, 0xCB, 0xBC,
-    0xCC, 0xCC, 0xCD, 0xDD, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFE, 0xFF, 0xFD, 0xDD, 0xDC, 0xED, 0xDD, 0xDD, 0x9F, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFE,
-    0xED, 0xDD, 0xCD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCD, 0xBB,
-    0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xDC, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xCD, 0xDE, 0xFF, 0xEF, 0xFD, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB,
-    0xCD, 0xEF, 0xFF, 0xFF, 0xED, 0xBA, 0x88, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x66, 0x55, 0x67, 0x89, 0xAC, 0xDF, 0xFF,
-    0xEF, 0xCB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xFF, 0xFC,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x68, 0xAB, 0xDF, 0xFF, 0xFF, 0xDB, 0xA8,
-    0x75, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xEF, 0xFF, 0xFD, 0xBA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xEC, 0xA9, 0x87, 0x65, 0x55,
-    0x68, 0x9A, 0xCD, 0xFF, 0xFF, 0xFF, 0xCC, 0xA9, 0x87, 0x76, 0x77, 0x8A,
-    0xBC, 0xFF, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xDE, 0xCB, 0xBA, 0xA9, 0xAA, 0xBC, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDD, 0xDC, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFE, 0xFF,
-    0xFF, 0xFE, 0xDD, 0xCC, 0xDC, 0xDF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF,
-    0xFF, 0xED, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xFE, 0xED, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDC, 0x9D, 0xEE,
-    0xEE, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xDD, 0xED, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xDD, 0xCB, 0xBA, 0x99, 0x99, 0x89,
-    0x9A, 0xAB, 0xCD, 0xEE, 0xDC, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xDD, 0xCD, 0xBA, 0x99, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x97, 0x66, 0x54, 0x45, 0x66, 0x79, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x88,
-    0x9A, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xDD, 0xCB, 0xAA, 0x99, 0x98, 0x89, 0x9A, 0xBB, 0xCD, 0xEE,
-    0xDE, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xDD, 0xDF, 0xED, 0xED,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xFF, 0xFE, 0xCE, 0xFF, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFD, 0xFE, 0xFF, 0xDE, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFE, 0x9D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xEE, 0xEF, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xCC, 0xCC, 0xBB, 0xBC, 0xCC, 0xCC, 0xDD, 0xDD, 0xAE, 0xFE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xFE, 0xDE, 0xDD, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xED, 0xDD, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0xAA, 0xBC, 0xDE, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAB, 0xCC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCA, 0x98, 0x77, 0x66, 0x55, 0x56, 0x77, 0x89, 0xBC, 0xDD,
-    0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55,
-    0x67, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xCD, 0xDD, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED,
-    0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDE, 0xED, 0xED,
-    0xDC, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xDF, 0xEE, 0xDD,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xFF, 0xEE, 0xDD, 0xDD,
-    0xCC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xAE, 0xDD, 0xDD, 0xDD, 0xDD, 0xCC,
-    0xDD, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDD, 0x9F, 0xFE,
-    0xED, 0xDD, 0xCD, 0xDC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFD, 0xEF, 0xDE, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xEF, 0xDD, 0xED, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xCD, 0xEF, 0xFD, 0xDD, 0xDB, 0xBA, 0x99, 0x98, 0x89,
-    0x9A, 0xAB, 0xCD, 0xEE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x99,
-    0xAB, 0xCD, 0xFD, 0xDD, 0xCB, 0x98, 0x77, 0x66, 0x66, 0x78, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDD,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x55, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x55, 0x44, 0x55, 0x67, 0x8A, 0xBC, 0xED, 0xCC, 0xBA, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x76, 0x55,
-    0x44, 0x55, 0x67, 0x8A, 0xBC, 0xDC, 0xCD, 0xCA, 0x98, 0x76, 0x55, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x88,
-    0x9A, 0xCC, 0xDD, 0xDD, 0xCC, 0xAA, 0x98, 0x77, 0x77, 0x88, 0x9A, 0xBC,
-    0xDD, 0xDC, 0xED, 0xCB, 0xA9, 0x99, 0x88, 0x89, 0x9A, 0xBC, 0xCE, 0xED,
-    0xDF, 0xDC, 0xCB, 0xBA, 0xA9, 0xAA, 0xAA, 0xBC, 0xDD, 0xEF, 0xED, 0xEE,
-    0xDD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBC, 0xDD, 0xEE, 0xEE, 0xEF, 0xFE, 0xED,
-    0xDC, 0xDC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, 0xEE, 0xFD, 0xDD,
-    0xDD, 0xDD, 0xED, 0xDF, 0xFF, 0xFF, 0x9D, 0xDD, 0xCD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDE, 0xDE, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFE, 0xFE, 0xDE, 0xCD, 0xDD, 0xED, 0xDD, 0xDE, 0x8F, 0xFF,
-    0xFF, 0xEF, 0xED, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xDD, 0xDC, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xA9, 0x9A,
-    0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFE, 0xDC, 0xA9, 0x88, 0x88, 0x89, 0xAA,
-    0xCD, 0xFF, 0xFF, 0xEF, 0xEC, 0xB9, 0x87, 0x76, 0x77, 0x88, 0xAB, 0xCE,
-    0xFF, 0xFF, 0xFD, 0xBA, 0x97, 0x66, 0x55, 0x66, 0x89, 0xAC, 0xDF, 0xFF,
-    0xEE, 0xDB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xFD, 0xDD,
-    0xB9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCF, 0xFF, 0xEF, 0xCB, 0x98,
-    0x65, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xFF, 0xFD, 0xED, 0xBA, 0x87, 0x65,
-    0x44, 0x55, 0x78, 0x9B, 0xDD, 0xFE, 0xEF, 0xDC, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x9A, 0xBD, 0xFF, 0xFF, 0xFD, 0xCB, 0xA8, 0x87, 0x66, 0x77, 0x89,
-    0xBC, 0xDF, 0xFF, 0xFF, 0xDD, 0xBB, 0xA9, 0x88, 0x88, 0x89, 0xAB, 0xCF,
-    0xFF, 0xFF, 0xFF, 0xEC, 0xCB, 0xAA, 0xA9, 0x9A, 0xBB, 0xDD, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xED, 0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xED, 0xDC, 0xCD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xEF, 0xEE, 0xED, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9D, 0xDE, 0xEF, 0xFE, 0xED, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0x9D, 0xED,
-    0xDC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDF, 0xED, 0xDD, 0xDC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xDC, 0xCC, 0xBB, 0xA9, 0x99,
-    0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDD, 0xCC, 0xBA, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xCD, 0xDB, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xBC, 0xCC, 0xBB, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAA,
-    0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCB,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xAA, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9A, 0xBC, 0xBB, 0xBA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x89, 0xAB, 0xCC, 0xBC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xBC, 0xDC, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC,
-    0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x99, 0x9A, 0xAB, 0xBB, 0xDD, 0xCC, 0xDC,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xCD, 0xDD, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xBD, 0xDD, 0xEF, 0xDD, 0xED, 0xDD, 0xCC, 0xCC,
-    0xBC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFD, 0x8D, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB,
-    0xCB, 0xCC, 0xDD, 0xDE, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xBB, 0x8B, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x78,
-    0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78,
-    0x99, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x9A,
-    0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xBA,
-    0x9A, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x65, 0x56,
-    0x66, 0x78, 0x89, 0xAB, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBA, 0xAB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x88, 0x88, 0x9A, 0xAB, 0xCB,
-    0xBB, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCC, 0xBC, 0xCB, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xCB, 0xDC, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0x8C, 0xBB, 0xBA, 0xAB, 0xAA, 0xAA,
-    0xAB, 0xBB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCB,
-    0xBB, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xBC, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x99, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66,
-    0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB,
-    0xAB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xA9, 0x99, 0xAA, 0xAB, 0xBB, 0xCC, 0xCB, 0xDC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0x8C, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x89, 0x99, 0xAA, 0xBC, 0xCB, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x78,
-    0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xCB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x67, 0x88, 0x9A,
-    0xBC, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9,
-    0x87, 0x76, 0x55, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x77,
-    0x65, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x66,
-    0x67, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xBB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x78, 0x88, 0x9A,
-    0xBB, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCC, 0xCD, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCC, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xCE, 0xEC, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xBB, 0xBC, 0xCC, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBF, 0xDC, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCD, 0x7D, 0xFD,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFD, 0xDE, 0xDC, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xCE, 0xEE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xCC, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x99, 0x88, 0x88,
-    0x99, 0xAB, 0xBC, 0xDE, 0xCC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89,
-    0xAA, 0xBD, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB,
-    0xCD, 0xCC, 0xCA, 0xA8, 0x77, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xBC, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xCB, 0xBA,
-    0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xCA, 0x98, 0x76, 0x65,
-    0x54, 0x56, 0x67, 0x89, 0xAC, 0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56,
-    0x67, 0x88, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDC, 0xCD, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x99, 0xAB,
-    0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xFD,
-    0xDD, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xED, 0xED,
-    0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xDF, 0xEE, 0xDC,
-    0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xEE, 0xFD, 0xDD, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xEE, 0x8D, 0xDC, 0xDC, 0xCC, 0xCC, 0xCC,
-    0xCD, 0xDD, 0xDD, 0xEE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xEF, 0xFD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD, 0x8F, 0xFF,
-    0xFF, 0xFE, 0xFD, 0xDE, 0xFE, 0xFE, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xEE,
-    0xDC, 0xCD, 0xDC, 0xDD, 0xEE, 0xFF, 0xFF, 0xDF, 0xFF, 0xED, 0xDC, 0xCB,
-    0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xFE, 0xEF, 0xEE, 0xCC, 0xBA, 0xA9, 0x9A,
-    0xAB, 0xCC, 0xDE, 0xFF, 0xEE, 0xFE, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0x9B,
-    0xCD, 0xDE, 0xFF, 0xDE, 0xDC, 0xBA, 0x97, 0x76, 0x77, 0x89, 0xAB, 0xCD,
-    0xFF, 0xDD, 0xED, 0xBA, 0x97, 0x66, 0x55, 0x66, 0x89, 0xAC, 0xCD, 0xFE,
-    0xDE, 0xDB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBC, 0xEE, 0xED, 0xEC,
-    0xB9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCE, 0xFE, 0xDD, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x56, 0x8A, 0xBC, 0xEF, 0xEE, 0xEC, 0xBA, 0x87, 0x65,
-    0x44, 0x46, 0x78, 0xAB, 0xCD, 0xFE, 0xED, 0xDB, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x9A, 0xBD, 0xDF, 0xFD, 0xED, 0xCB, 0xA9, 0x87, 0x66, 0x77, 0x8A,
-    0xBC, 0xDE, 0xFF, 0xDE, 0xDD, 0xBA, 0xA9, 0x88, 0x88, 0x99, 0xAB, 0xDD,
-    0xEF, 0xFD, 0xFE, 0xDC, 0xCB, 0xAA, 0x99, 0xAA, 0xBC, 0xCD, 0xFF, 0xFF,
-    0xDF, 0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xED, 0xFF,
-    0xEE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFF, 0xDF, 0xFE, 0xEE,
-    0xEE, 0xED, 0xEE, 0xDF, 0xFE, 0xFF, 0xFF, 0xFC, 0xFF, 0xEF, 0xEF, 0xFE,
-    0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xCC, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDE, 0xFF, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xED, 0xDD, 0xCD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0x9E, 0xFE,
-    0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFD, 0xEF, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xDF, 0xDD, 0xED, 0xCC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xED, 0xDD, 0xDC, 0xBA, 0x99, 0x98, 0x89,
-    0x9A, 0xAB, 0xCD, 0xDD, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xCC, 0xCA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xAC,
-    0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78,
-    0x9B, 0xBC, 0xDD, 0xCC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xEC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBC, 0xDD, 0xFE,
-    0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCE, 0xEF, 0xFC, 0xED,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xDE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xFD, 0xFE, 0xEE, 0xED, 0xED,
-    0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0x9D, 0xDD, 0xDC, 0xDC, 0xDD, 0xDD,
-    0xDD, 0xEE, 0xEF, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xAE, 0xEE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xED, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x99, 0xAA, 0xBC, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89,
-    0xAB, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xCB, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xAC, 0xDC,
-    0xBB, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED,
-    0xCD, 0xCC, 0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xED,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xDE, 0xDD, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFD, 0xEE, 0xED, 0xDD, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0x9D, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC,
-    0xCD, 0xDE, 0xEE, 0xEF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDE, 0xEE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDC, 0x9E, 0xFE,
-    0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEF, 0xFD, 0xDF, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xDE, 0xDE, 0xED, 0xCC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xED, 0xDE, 0xDC, 0xBA, 0x99, 0x99, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xDD, 0xCD, 0xBA, 0xA8, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBB,
-    0xDD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xCD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9B, 0xCC, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC,
-    0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0xAA, 0xBC, 0xCD, 0xED,
-    0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xDD, 0xDE, 0xEC, 0xDD,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFE, 0xDE, 0xEE, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFD, 0xEE, 0xEE, 0xDD, 0xDC,
-    0xDD, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0x9D, 0xDC, 0xDC, 0xCC, 0xCC, 0xCD,
-    0xDD, 0xED, 0xEE, 0xEE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xEF, 0xED, 0xDD, 0xCD, 0xDC, 0xCC, 0xCD, 0xDD, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xEE, 0xDD, 0xDE, 0xEF, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE,
-    0xDD, 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFF, 0xDF, 0xFF, 0xED, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xCD, 0xDE, 0xFF, 0xFE, 0xEF, 0xFD, 0xCB, 0xAA, 0x99, 0x9A,
-    0xAB, 0xBC, 0xDE, 0xFF, 0xEE, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9B,
-    0xCC, 0xEE, 0xFD, 0xEF, 0xDB, 0xA9, 0x87, 0x76, 0x67, 0x88, 0x9B, 0xCD,
-    0xFF, 0xFD, 0xDD, 0xBA, 0x97, 0x66, 0x55, 0x66, 0x89, 0xAB, 0xDE, 0xFF,
-    0xDD, 0xCB, 0x98, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBC, 0xDF, 0xFE, 0xEC,
-    0xA9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCD, 0xFE, 0xDD, 0xCB, 0x98,
-    0x65, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xDF, 0xED, 0xDC, 0xBA, 0x87, 0x65,
-    0x44, 0x56, 0x78, 0xAB, 0xCD, 0xEE, 0xDE, 0xCB, 0xA9, 0x76, 0x65, 0x56,
-    0x67, 0x8A, 0xBD, 0xDF, 0xFD, 0xFD, 0xCB, 0x98, 0x87, 0x66, 0x77, 0x89,
-    0xAC, 0xEF, 0xFF, 0xDF, 0xDD, 0xBB, 0xA9, 0x88, 0x88, 0x99, 0xAB, 0xCE,
-    0xFF, 0xFD, 0xEF, 0xDD, 0xCB, 0xAA, 0x99, 0x9A, 0xBB, 0xCD, 0xEF, 0xFF,
-    0xEF, 0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFE, 0xFF,
-    0xDE, 0xDD, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF,
-    0xEE, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0x9D, 0xDD, 0xDD, 0xEE, 0xDD, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0x8D, 0xEE,
-    0xCC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xED, 0xCD, 0xDC, 0xCB,
-    0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0xCC, 0xDC, 0xBB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xCC, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89,
-    0x9A, 0xBC, 0xDC, 0xBB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xDC,
-    0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xBB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xAB, 0xCC, 0xBC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB,
-    0xCD, 0xCC, 0xCC, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xDC,
-    0xCD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xCC, 0xDD, 0xDC, 0xED,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xED, 0xCE, 0xED, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEE, 0xDC, 0xEE, 0xED, 0xDC, 0xCC,
-    0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFE, 0x7C, 0xCC, 0xCC, 0xCB, 0xCB, 0xBB,
-    0xCC, 0xCC, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xAB, 0xBB, 0x8C, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDC, 0xBC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xBB, 0xAA, 0x99, 0x99,
-    0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88,
-    0x88, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBB, 0xBA, 0xAA, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xA9,
-    0x98, 0x76, 0x55, 0x45, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A,
-    0xBC, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCB,
-    0xBC, 0xBA, 0xAA, 0x99, 0x98, 0x89, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCB,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDD, 0xCB, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0x8B, 0xBB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x9B, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x9B, 0xCB,
-    0xBB, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBB, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78,
-    0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBA,
-    0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xCB,
-    0xAA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xCC, 0xCB, 0xBB, 0xBA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBB, 0xAA, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xBB, 0x8B, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDB, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBB, 0xBB, 0xAA, 0x99, 0x88,
-    0x88, 0x89, 0x99, 0xAA, 0xBC, 0xCB, 0xAB, 0xAA, 0x98, 0x88, 0x87, 0x88,
-    0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAB, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A,
-    0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xBA,
-    0x9A, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xA9, 0xA9,
-    0x87, 0x76, 0x55, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0x9A, 0x98, 0x87,
-    0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x89, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBA, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBB, 0xBA, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x88, 0x9A, 0xAB, 0xCB,
-    0xAC, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xCB,
-    0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCB, 0xBC, 0xCB, 0xBB,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCB, 0xDD, 0xCC, 0xBB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xDC, 0xDC, 0x8B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0x7D, 0xFE,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xED, 0xDD, 0xDC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDC, 0xDC, 0xCB, 0xA9, 0x99,
-    0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xED, 0xCD, 0xBA, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xAC, 0xCD, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDD, 0xBC, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCC, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCC,
-    0xBB, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55,
-    0x67, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78,
-    0x99, 0xBB, 0xCC, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCC, 0xCC, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xDD,
-    0xCC, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xDC, 0xDD,
-    0xCC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xED, 0xDE, 0xDD, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xED, 0xED, 0xEE, 0xEC, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFE, 0x8D, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFF, 0xFF, 0xED, 0xDC, 0xDD, 0xDD, 0xCD, 0xCC, 0xCC, 0x8F, 0xFF,
-    0xFF, 0xEE, 0xEE, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE,
-    0xDD, 0xDD, 0xCD, 0xCD, 0xEE, 0xEF, 0xEF, 0xEE, 0xFF, 0xED, 0xDD, 0xCB,
-    0xBB, 0xBC, 0xCD, 0xDD, 0xEF, 0xFD, 0xEF, 0xDE, 0xDC, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xCD, 0xDE, 0xFF, 0xDE, 0xFE, 0xDC, 0xA9, 0x98, 0x88, 0x99, 0xAB,
-    0xCC, 0xEF, 0xFD, 0xEF, 0xDC, 0xB9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xEF, 0xEE, 0xDD, 0xCA, 0x98, 0x66, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFE,
-    0xED, 0xDB, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xEF, 0xDD, 0xED,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFE, 0xDE, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xED, 0xED, 0xCA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xCE, 0xEE, 0xDD, 0xDC, 0xA9, 0x87, 0x65, 0x55,
-    0x68, 0x9A, 0xCD, 0xDF, 0xFD, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x89,
-    0xBC, 0xDE, 0xEF, 0xCE, 0xDC, 0xCB, 0xA9, 0x98, 0x88, 0x99, 0xBB, 0xDD,
-    0xFF, 0xED, 0xEF, 0xEC, 0xCB, 0xAA, 0xA9, 0xAA, 0xBB, 0xDD, 0xEF, 0xFF,
-    0xCD, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xDD, 0xFF, 0xFF, 0xFC, 0xFE,
-    0xDD, 0xDD, 0xDC, 0xCD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xCE, 0xDE, 0xED,
-    0xDD, 0xEE, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFC, 0xFE, 0xFE, 0xDE, 0xEE,
-    0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xCC, 0xCD, 0xDD, 0xDE,
-    0xEE, 0xDE, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9E, 0xFE,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xFD, 0xDF, 0xED, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDD, 0xED, 0xDC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xED, 0xDD, 0xDC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xCD, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99,
-    0xAB, 0xCD, 0xED, 0xCC, 0xCB, 0x99, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9A, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBC, 0xDE, 0xED,
-    0xCD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xDC, 0xED,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFE, 0xCE, 0xED, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xEC, 0xFE, 0xEE, 0xED, 0xDD,
-    0xDD, 0xDD, 0xEE, 0xEE, 0xFF, 0xFF, 0x8D, 0xDD, 0xDC, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xEE, 0xEE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCD, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xAE, 0xEE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xDE, 0xDC, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xCB, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCC,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED,
-    0xCD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDD,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xCE, 0xDD, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xEE, 0xDD, 0xDC, 0xCC,
-    0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFE, 0xAD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC,
-    0xCC, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0x9E, 0xFF,
-    0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDE, 0xFD, 0xEE, 0xED, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDD, 0xEE, 0xDD, 0xED, 0xCC, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xED, 0xDD, 0xCC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xCD, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xAB, 0xCD, 0xDD, 0xCD, 0xCB, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBB,
-    0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xCC, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDB, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9A, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xBC, 0xCD, 0xED,
-    0xCE, 0xDC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xEC, 0xED,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xCE, 0xED, 0xDD,
-    0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFD, 0xEE, 0xEE, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xEF, 0xEF, 0xFF, 0x9C, 0xCD, 0xDC, 0xDC, 0xCC, 0xCD,
-    0xDD, 0xDD, 0xEE, 0xFE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xFE, 0xED, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7E, 0xFF,
-    0xFF, 0xFE, 0xEE, 0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFD, 0xDF, 0xFE, 0xFE,
-    0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xDE, 0xFE, 0xEE, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xFD, 0xEF, 0xED, 0xCB, 0xBA, 0xA9, 0x9A,
-    0xAB, 0xBC, 0xDD, 0xEE, 0xDE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0xAA,
-    0xCC, 0xDE, 0xED, 0xDE, 0xDB, 0xB9, 0x87, 0x76, 0x77, 0x89, 0xAB, 0xCD,
-    0xEF, 0xDE, 0xDC, 0xBA, 0x97, 0x66, 0x55, 0x67, 0x89, 0xAC, 0xCE, 0xFD,
-    0xDD, 0xCB, 0xA8, 0x75, 0x54, 0x45, 0x67, 0x8A, 0xBD, 0xDF, 0xED, 0xEC,
-    0xB9, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCD, 0xED, 0xDD, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xED, 0xDC, 0xBA, 0x87, 0x65,
-    0x44, 0x46, 0x78, 0xAB, 0xCD, 0xED, 0xDD, 0xDB, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x9A, 0xBC, 0xEF, 0xDD, 0xED, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x89,
-    0xBC, 0xDE, 0xFE, 0xDF, 0xDC, 0xCB, 0xA9, 0x88, 0x88, 0x99, 0xAB, 0xCD,
-    0xFF, 0xED, 0xEE, 0xDD, 0xBB, 0xAA, 0x99, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF,
-    0xDE, 0xED, 0xCC, 0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF,
-    0xED, 0xDD, 0xCC, 0xCC, 0xCD, 0xDE, 0xFE, 0xFF, 0xFF, 0xDF, 0xFE, 0xEE,
-    0xDE, 0xDE, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xEF, 0xEE, 0xFE,
-    0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDD, 0xDC, 0xDE, 0xDE, 0xED,
-    0xED, 0xFF, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xEE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0x8E, 0xFF,
-    0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFE, 0xEF, 0xED, 0xCC,
-    0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xEE, 0xDE, 0xED, 0xCB, 0xBA, 0xAA,
-    0xA9, 0xAA, 0xAB, 0xCD, 0xDE, 0xFD, 0xED, 0xDC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDF, 0xDC, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xAB, 0xCD, 0xED, 0xDC, 0xBA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xCE, 0xDC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xCC, 0xBA, 0x98, 0x66, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA8, 0x76, 0x54, 0x34, 0x55, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98,
-    0x65, 0x53, 0x34, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x54, 0x56, 0x67, 0x99, 0xBC, 0xDD, 0xCC, 0xCA, 0x98, 0x77, 0x65, 0x56,
-    0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88,
-    0x9A, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xDE, 0xEC, 0xDD, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xEE,
-    0xDE, 0xDC, 0xCB, 0xAA, 0xAA, 0x9A, 0xAA, 0xBB, 0xCE, 0xEF, 0xFD, 0xEE,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xDE, 0xED, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFD, 0xFF, 0xFD, 0xED, 0xDD,
-    0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFE, 0x7C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
-    0xDD, 0xDD, 0xEE, 0xFE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0x8B, 0xDC,
-    0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xEB, 0xBC, 0xBB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x98,
-    0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x98, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAB, 0xAA, 0xA9,
-    0x88, 0x76, 0x55, 0x45, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87,
-    0x66, 0x55, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBC, 0xBA, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xBD, 0xCC, 0xBB,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xCB, 0xDC, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEC, 0x8B, 0xBB, 0xBB, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x8B, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xBB, 0xBA, 0xAA,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78,
-    0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99,
-    0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA,
-    0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9,
-    0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77,
-    0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x78, 0x89, 0xAB, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB,
-    0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xCB,
-    0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCB, 0xBC, 0xCB, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xCB, 0xCC, 0xCB, 0xBB, 0xBA,
-    0xAA, 0xAB, 0xBB, 0xBC, 0xCC, 0xDC, 0x8B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xAB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xAC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8C, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xBA,
-    0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCB, 0xAA, 0x99, 0x98,
-    0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x88,
-    0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBC, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x55, 0x45, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x98, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAA, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xBB, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB,
-    0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCB, 0xCC,
-    0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xDC, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0x8C, 0xBB, 0xBB, 0xBB, 0xBB, 0xAB,
-    0xBB, 0xBC, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCE, 0xDC, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xBC, 0xCC, 0x7D, 0xFE,
-    0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xFD, 0xDE, 0xDC, 0xCB,
-    0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xDE, 0xDD, 0xDD, 0xCB, 0xAA, 0x99,
-    0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xFD, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x99, 0xAB, 0xBC, 0xDD, 0xCC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAB, 0xBD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x89, 0xAB,
-    0xCD, 0xDB, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC,
-    0xCB, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x67, 0x78, 0x9B, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0x98, 0x77, 0x65,
-    0x54, 0x55, 0x67, 0x89, 0xAC, 0xCC, 0xBC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x66, 0x67, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x99, 0xBB,
-    0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0x99, 0xAB, 0xCD, 0xDD,
-    0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDE, 0xFC, 0xDD,
-    0xDC, 0xBB, 0xBA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDF, 0xEE, 0xDE, 0xDE, 0xDC,
-    0xCC, 0xCB, 0xBC, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xFE, 0xED, 0xDD, 0xCC,
-    0xCD, 0xCC, 0xDE, 0xDE, 0xFF, 0xFF, 0x8C, 0xCC, 0xDC, 0xCC, 0xCC, 0xCC,
-    0xDD, 0xCD, 0xDE, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xEE, 0xED, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xED, 0xED, 0xDD, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xEE,
-    0xDD, 0xDC, 0xCD, 0xDD, 0xDD, 0xFF, 0xFF, 0xDE, 0xFF, 0xED, 0xDC, 0xCB,
-    0xBB, 0xCC, 0xCC, 0xDD, 0xFF, 0xFD, 0xEF, 0xEE, 0xDC, 0xBB, 0xAA, 0xAA,
-    0xBB, 0xCD, 0xDE, 0xFF, 0xEF, 0xFE, 0xDB, 0xBA, 0x98, 0x88, 0x99, 0xAB,
-    0xCC, 0xDE, 0xFF, 0xEF, 0xDD, 0xB9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCE,
-    0xEF, 0xED, 0xED, 0xCA, 0x97, 0x66, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xFF,
-    0xDD, 0xDB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xED, 0xEC,
-    0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDE, 0xFE, 0xDD, 0xCB, 0xA8,
-    0x75, 0x43, 0x34, 0x57, 0x8A, 0xBD, 0xFE, 0xFD, 0xEC, 0xCA, 0x87, 0x65,
-    0x44, 0x45, 0x78, 0xAC, 0xDF, 0xFF, 0xDE, 0xDC, 0xA9, 0x87, 0x65, 0x55,
-    0x67, 0x9A, 0xCD, 0xFF, 0xFD, 0xFD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x8A,
-    0xBD, 0xEF, 0xFF, 0xCF, 0xDD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDE,
-    0xFF, 0xED, 0xFD, 0xED, 0xCB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDE, 0xEE, 0xFF,
-    0xDE, 0xFD, 0xDD, 0xCB, 0xBB, 0xBB, 0xCC, 0xEE, 0xFF, 0xFF, 0xFD, 0xFE,
-    0xEE, 0xDD, 0xDD, 0xCD, 0xDD, 0xEE, 0xFE, 0xFF, 0xFF, 0xDF, 0xEE, 0xEE,
-    0xDD, 0xED, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0xFD, 0xEE, 0xEE, 0xEF, 0xEF,
-    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xCC, 0xDD, 0xDD, 0xDE,
-    0xFE, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xEF, 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF,
-    0xEF, 0xDD, 0xDC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xED, 0xEF, 0xED, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDE, 0xFE, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xFD, 0xEE, 0xDC, 0xBA, 0x99, 0x99, 0x99,
-    0x9A, 0xAB, 0xCD, 0xDE, 0xDD, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xAB, 0xCD, 0xED, 0xDD, 0xCA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xDE, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xEE,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCE, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xEE, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAC, 0xDE, 0xEC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78,
-    0x9B, 0xCD, 0xEE, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBD,
-    0xEF, 0xFC, 0xDC, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBC, 0xDF, 0xFF,
-    0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFC, 0xED,
-    0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xCE, 0xED, 0xDD,
-    0xDC, 0xCC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFC, 0xFE, 0xEE, 0xEE, 0xEE,
-    0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE,
-    0xEF, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xEE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCC, 0xAF, 0xFE,
-    0xED, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xEF, 0xDD, 0xCB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDD, 0xED, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xED, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xCD, 0xDC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89,
-    0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC,
-    0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9A, 0xBD, 0xDB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB,
-    0xCD, 0xEC, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE,
-    0xCD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xEC, 0xDD,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFF, 0xCE, 0xDD, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFC, 0xEE, 0xDD, 0xDD, 0xCC,
-    0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFF, 0xAD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD,
-    0xDD, 0xEE, 0xEF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xDF, 0xFE, 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF,
-    0xFE, 0xDD, 0xDC, 0xCC, 0xDD, 0xDD, 0xDD, 0xEE, 0xEC, 0xEF, 0xEE, 0xDC,
-    0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xDE, 0xEE, 0xDC, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xED, 0xEE, 0xDC, 0xBA, 0x99, 0x99, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xEC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xAB, 0xCD, 0xDD, 0xDD, 0xCB, 0xA8, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBC,
-    0xCD, 0xDD, 0xDC, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xCC, 0xDD,
-    0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBC, 0xEE, 0xCC, 0xCA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78,
-    0x9B, 0xCD, 0xEE, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC,
-    0xEF, 0xEC, 0xDD, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE,
-    0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xEF, 0xFC, 0xED,
-    0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xCE, 0xED, 0xDD,
-    0xDC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFD, 0xFE, 0xEE, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0x8C, 0xCC, 0xCC, 0xDC, 0xDD, 0xDD,
-    0xDE, 0xEE, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xFF, 0xFD, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xDE, 0xDF, 0xDE, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xED, 0xDD, 0xCC, 0xCD, 0xEE, 0xEE, 0xFF, 0xDF, 0xFF, 0xFF, 0xED, 0xCC,
-    0xBC, 0xBB, 0xCD, 0xDD, 0xEF, 0xFD, 0xFF, 0xFE, 0xEC, 0xBA, 0xAA, 0xAA,
-    0xBB, 0xCC, 0xDF, 0xEF, 0xDF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x99, 0xAB,
-    0xCC, 0xEF, 0xFF, 0xFF, 0xED, 0xBA, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xDD,
-    0xEF, 0xDF, 0xFF, 0xCA, 0x97, 0x65, 0x55, 0x67, 0x89, 0xBC, 0xDF, 0xFE,
-    0xEF, 0xDC, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x9A, 0xBD, 0xEF, 0xFE, 0xFD,
-    0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCF, 0xFF, 0xDF, 0xDC, 0xA8,
-    0x75, 0x43, 0x34, 0x57, 0x8A, 0xCD, 0xEF, 0xED, 0xFD, 0xCA, 0x97, 0x65,
-    0x44, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xEF, 0xDC, 0xB9, 0x87, 0x65, 0x55,
-    0x68, 0x9B, 0xCF, 0xFF, 0xFD, 0xEE, 0xCB, 0xA9, 0x87, 0x76, 0x78, 0x9A,
-    0xCD, 0xFF, 0xFF, 0xDF, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDF,
-    0xFF, 0xFD, 0xFD, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xCD, 0xDF, 0xFF, 0xFF,
-    0xDF, 0xFD, 0xDD, 0xCC, 0xCB, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFD, 0xFE,
-    0xFE, 0xDD, 0xDC, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFE, 0xEE,
-    0xEE, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xEF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xCC, 0xCD, 0xDE, 0xEF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xFF, 0xDF, 0xDE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7F, 0xFF,
-    0xEF, 0xFF, 0xFD, 0xEE, 0xFE, 0xDD, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xEE,
-    0xDD, 0xDD, 0xDD, 0xCD, 0xDF, 0xFF, 0xFF, 0xDF, 0xFE, 0xED, 0xDC, 0xCB,
-    0xBB, 0xBC, 0xCC, 0xDD, 0xFF, 0xFD, 0xFF, 0xFD, 0xDB, 0xBA, 0xAA, 0xAA,
-    0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFE, 0xDB, 0xAA, 0x98, 0x89, 0x99, 0xAB,
-    0xCC, 0xFF, 0xFF, 0xFE, 0xDC, 0xBA, 0x98, 0x77, 0x78, 0x89, 0xAC, 0xCC,
-    0xFF, 0xFD, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x89, 0xAC, 0xCD, 0xFE,
-    0xDD, 0xCB, 0xA9, 0x76, 0x54, 0x45, 0x67, 0x9A, 0xCC, 0xDF, 0xDD, 0xED,
-    0xBA, 0x97, 0x64, 0x23, 0x46, 0x78, 0xAB, 0xDD, 0xFF, 0xDD, 0xCB, 0xA9,
-    0x76, 0x43, 0x24, 0x57, 0x9A, 0xCD, 0xFF, 0xFE, 0xDC, 0xCA, 0x98, 0x65,
-    0x44, 0x56, 0x78, 0xAC, 0xDE, 0xFD, 0xDD, 0xDC, 0xAA, 0x87, 0x66, 0x56,
-    0x78, 0x9A, 0xBD, 0xFF, 0xFE, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x78, 0x99,
-    0xBC, 0xEF, 0xFF, 0xDF, 0xED, 0xCB, 0xA9, 0x98, 0x89, 0x9A, 0xBC, 0xDD,
-    0xFF, 0xFD, 0xFF, 0xEC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAC, 0xDE, 0xEF, 0xFF,
-    0xDF, 0xFE, 0xCC, 0xDC, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF,
-    0xDE, 0xED, 0xDD, 0xCC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFE, 0xFF,
-    0xFF, 0xEC, 0xED, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xED, 0xFE,
-    0xED, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6C, 0xCB, 0xBC, 0xCD, 0xDC, 0xCF,
-    0xDF, 0xEF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0x8D, 0xDC,
-    0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xCD, 0xCB, 0xAA,
-    0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCB, 0xBA, 0x99, 0x99,
-    0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xDB, 0xBC, 0xAA, 0x99, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xCD, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89,
-    0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A,
-    0xBC, 0xBA, 0xBA, 0x98, 0x76, 0x66, 0x56, 0x66, 0x78, 0x89, 0xAB, 0xBB,
-    0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBB, 0xBA, 0xA9,
-    0x98, 0x76, 0x55, 0x44, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x99, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x76, 0x65,
-    0x55, 0x56, 0x67, 0x89, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCC, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xCA, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xCC,
-    0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x88, 0x99, 0x9A, 0xBB, 0xCD, 0xDB, 0xDC,
-    0xCB, 0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xDD, 0xBD, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDB, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0x8C, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBC, 0xDD, 0xDE, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0x9B, 0xCB,
-    0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xDB, 0xBC, 0xBA, 0xA9,
-    0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x99,
-    0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x65, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0x9A, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB,
-    0xAB, 0xAA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBB,
-    0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCC, 0xBC, 0xBB, 0xAA,
-    0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xCB, 0xCC, 0xCB, 0xBB, 0xAA,
-    0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDD, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xBC, 0xCD, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBD, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBB, 0x8D, 0xDC,
-    0xCB, 0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xCD, 0xDB, 0xCC, 0xCB, 0xAA,
-    0xAA, 0x99, 0x9A, 0xAA, 0xAB, 0xBB, 0xCD, 0xBC, 0xCB, 0xAA, 0x99, 0x98,
-    0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDB, 0xBB, 0xBA, 0x98, 0x88, 0x88, 0x88,
-    0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x88,
-    0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x77, 0x89, 0x9A,
-    0xBB, 0xBA, 0xB9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x78, 0x89, 0xAB, 0xBB,
-    0xAA, 0x99, 0x87, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x55, 0x44, 0x56, 0x67, 0x89, 0x9A, 0xBB, 0xAA, 0x99, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBA, 0xAA, 0x98, 0x77, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x99, 0xBB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCB, 0xAB, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBC, 0xCB, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xCC,
-    0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCB, 0xCB,
-    0xBB, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xBD, 0xDC, 0xBB,
-    0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDB, 0xDD, 0xCC, 0xCB, 0xBB,
-    0xBB, 0xBC, 0xCC, 0xCD, 0xDD, 0xED, 0x8B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB,
-    0xBB, 0xBC, 0xCD, 0xDD, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEE, 0xFF, 0xDF, 0xDD, 0xCC, 0xCC, 0xDD, 0xCC, 0xCC, 0xCC, 0x7F, 0xFF,
-    0xFF, 0xFD, 0xDE, 0xDD, 0xDE, 0xDE, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xED,
-    0xCD, 0xCC, 0xCC, 0xDC, 0xDD, 0xEE, 0xFF, 0xDF, 0xFF, 0xDE, 0xCC, 0xBB,
-    0xBB, 0xBB, 0xBC, 0xDD, 0xFE, 0xFE, 0xFF, 0xED, 0xCB, 0xAA, 0x99, 0xAA,
-    0xAA, 0xBC, 0xCE, 0xEF, 0xEE, 0xED, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0xAB,
-    0xCC, 0xDE, 0xFF, 0xDF, 0xDB, 0xA9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD,
-    0xDE, 0xED, 0xFC, 0xBA, 0x97, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCE, 0xED,
-    0xDE, 0xCB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDE, 0xED, 0xEC,
-    0xB9, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFF, 0xDE, 0xCB, 0x98,
-    0x75, 0x43, 0x34, 0x57, 0x89, 0xBC, 0xDE, 0xFD, 0xDC, 0xBA, 0x97, 0x65,
-    0x44, 0x46, 0x78, 0xAB, 0xCD, 0xFE, 0xDE, 0xCB, 0xA9, 0x87, 0x65, 0x56,
-    0x67, 0x9A, 0xBC, 0xDF, 0xDD, 0xED, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x89,
-    0xAC, 0xDF, 0xFF, 0xEF, 0xDC, 0xBB, 0xA9, 0x88, 0x88, 0x99, 0xAB, 0xCD,
-    0xFF, 0xFF, 0xFD, 0xDC, 0xBB, 0xAA, 0x99, 0x9A, 0xAB, 0xCE, 0xDF, 0xFF,
-    0xDF, 0xFD, 0xDC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFD, 0xFF,
-    0xDE, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xFF, 0xDF, 0xEF, 0xEE,
-    0xED, 0xDD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFE, 0xEF, 0xFE, 0xEE,
-    0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xDD, 0xDD, 0xED, 0xDE,
-    0xEE, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCC, 0xCB, 0xBB, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xDD, 0xFD, 0xDF, 0xFF, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC,
-    0xCC, 0xCD, 0xFF, 0xFD, 0xFF, 0xFD, 0xFF, 0xFF, 0xFC, 0xDB, 0xBA, 0xBB,
-    0xCB, 0xDD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x99, 0x9A, 0xBC,
-    0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x77, 0x78, 0x9A, 0xBC, 0xDD,
-    0xFD, 0xFF, 0xFF, 0xDD, 0xA8, 0x76, 0x55, 0x68, 0x9A, 0xBC, 0xFF, 0xFF,
-    0xFF, 0xFC, 0xC9, 0x76, 0x54, 0x45, 0x68, 0xAB, 0xCC, 0xFF, 0xFF, 0xFD,
-    0xCA, 0x97, 0x54, 0x23, 0x45, 0x79, 0xBC, 0xFF, 0xFF, 0xFF, 0xDC, 0xB9,
-    0x76, 0x43, 0x24, 0x57, 0x9A, 0xCF, 0xFF, 0xFF, 0xFD, 0xDB, 0xA8, 0x65,
-    0x44, 0x56, 0x79, 0xBD, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x87, 0x65, 0x56,
-    0x78, 0xAC, 0xDF, 0xFF, 0xFD, 0xFC, 0xFD, 0xBA, 0x88, 0x77, 0x78, 0x9A,
-    0xCD, 0xFF, 0xFF, 0xDF, 0xFF, 0xDC, 0xBA, 0x99, 0x99, 0xAB, 0xCD, 0xFF,
-    0xFF, 0xFD, 0xFF, 0xFD, 0xDC, 0xBB, 0xBA, 0xBB, 0xDD, 0xFF, 0xFF, 0xFF,
-    0xDF, 0xFD, 0xFF, 0xDD, 0xDC, 0xCB, 0xDC, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF,
-    0xDF, 0xDD, 0xFD, 0xFD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFD,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCB, 0xDD, 0xCF, 0xFF, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEF, 0xEF, 0xFD, 0xDC, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9F, 0xFF,
-    0xFE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDF, 0xFD, 0xFF, 0xFF, 0xCC,
-    0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xDC, 0xEF, 0xEF, 0xFD, 0xDC, 0xBA, 0xAA,
-    0x99, 0xAA, 0xAB, 0xCC, 0xDE, 0xFD, 0xFE, 0xDC, 0xBA, 0x99, 0x88, 0x89,
-    0x9A, 0xAA, 0xCC, 0xDD, 0xED, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89,
-    0xAB, 0xCD, 0xEE, 0xDD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAC,
-    0xCD, 0xDD, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xED,
-    0xDC, 0xBA, 0x87, 0x65, 0x54, 0x45, 0x66, 0x79, 0xAB, 0xCD, 0xEC, 0xCB,
-    0xA8, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xBD, 0xEE, 0xCC, 0xBA, 0x87,
-    0x65, 0x54, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xEC, 0xCB, 0x98, 0x76, 0x65,
-    0x54, 0x55, 0x67, 0x8A, 0xBC, 0xFE, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAB, 0xDF, 0xFC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78,
-    0x9A, 0xBE, 0xFF, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x9A, 0xBC,
-    0xFF, 0xFC, 0xDD, 0xBB, 0xAA, 0x99, 0x88, 0x89, 0x9A, 0xBC, 0xDF, 0xFF,
-    0xDD, 0xDC, 0xBB, 0xBA, 0xA9, 0x9A, 0xAA, 0xBC, 0xDE, 0xFF, 0xFC, 0xED,
-    0xCC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xDD, 0xDD, 0xED,
-    0xDC, 0xDC, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFE, 0xDE, 0xDD,
-    0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0x9C, 0xDD, 0xDD, 0xDF, 0xDE, 0xEE,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFE, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDE, 0xBF, 0xFF,
-    0xFE, 0xDC, 0xCC, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFD, 0xCC,
-    0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xEF, 0xFD, 0xCB, 0xAA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xFE, 0xFE, 0xCB, 0xA9, 0x98, 0x88, 0x88,
-    0x89, 0x9A, 0xBC, 0xDF, 0xDD, 0xDC, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89,
-    0x9A, 0xBC, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xDC, 0xCB, 0x98, 0x76, 0x65, 0x55, 0x56, 0x77, 0x89, 0xAC, 0xDD,
-    0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xBA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCB, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, 0x98, 0x76, 0x65,
-    0x55, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xCC, 0xA9, 0x87, 0x76, 0x65, 0x55,
-    0x66, 0x78, 0x9B, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xEF, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAC,
-    0xDF, 0xFD, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCE, 0xFF,
-    0xDD, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xFF, 0xFD, 0xED,
-    0xCC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xFF, 0xDF, 0xED, 0xDC,
-    0xCC, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFE, 0xFF, 0xEE, 0xDD, 0xDC,
-    0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xBE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xEF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xFD, 0xEC, 0xDC, 0xCD, 0xCE, 0x9F, 0xFF,
-    0xFF, 0xFD, 0xDD, 0xCC, 0xDC, 0xDD, 0xDE, 0xEF, 0xFD, 0xFF, 0xFF, 0xED,
-    0xDC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xEF, 0xDF, 0xFE, 0xDD, 0xCB, 0xAA,
-    0xAA, 0xAA, 0xBC, 0xCD, 0xDD, 0xFD, 0xFF, 0xDC, 0xBA, 0x99, 0x98, 0x99,
-    0x9A, 0xAB, 0xCC, 0xDD, 0xDF, 0xED, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A,
-    0xAB, 0xCD, 0xFD, 0xED, 0xCB, 0x98, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xAC,
-    0xDD, 0xDD, 0xEB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD,
-    0xDD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xDE, 0xDD, 0xCB,
-    0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xFD, 0xDD, 0xBA, 0x97,
-    0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDD, 0xDC, 0xA9, 0x87, 0x65,
-    0x44, 0x55, 0x67, 0x9A, 0xBD, 0xEE, 0xDD, 0xBA, 0x98, 0x76, 0x65, 0x55,
-    0x67, 0x89, 0xAC, 0xDD, 0xED, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78,
-    0x9B, 0xCF, 0xFE, 0xDD, 0xDB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBD,
-    0xDF, 0xFD, 0xDD, 0xBB, 0xA9, 0x99, 0x89, 0x89, 0xAA, 0xBD, 0xEE, 0xFF,
-    0xDE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBD, 0xDF, 0xFF, 0xFD, 0xDD,
-    0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDF, 0xFF, 0xFF, 0xDE, 0xDD, 0xDC,
-    0xCC, 0xCC, 0xCC, 0xDD, 0xFE, 0xFF, 0xFF, 0xFC, 0xFF, 0xDF, 0xFE, 0xDE,
-    0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9C, 0xCC, 0xDC, 0xDC, 0xDD, 0xDD,
-    0xDD, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xBB, 0xCB, 0x7F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFD, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFD, 0xFF,
-    0xCD, 0xDC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xCC,
-    0xCC, 0xCD, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xCB, 0xAA, 0xA9, 0xAB, 0xBD,
-    0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFC, 0xB9, 0x76, 0x66, 0x78, 0x9B, 0xCD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xCA, 0x86, 0x54, 0x45, 0x79, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA,
-    0x86, 0x42, 0x24, 0x68, 0xAB, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xB8, 0x75,
-    0x44, 0x56, 0x8A, 0xCF, 0xFF, 0xFF, 0xDF, 0xFD, 0xCB, 0x98, 0x76, 0x67,
-    0x89, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0xA9, 0x88, 0x89, 0xBB,
-    0xCF, 0xFF, 0xFF, 0xDF, 0xFF, 0xCC, 0xBB, 0xAA, 0xAA, 0xBC, 0xDF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xCC, 0xBC, 0xCC, 0xCF, 0xFF, 0xFF, 0xFF,
-    0xCF, 0xFD, 0xFF, 0xCC, 0xDD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDD, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7B, 0xCD, 0xDC, 0xCD, 0xDF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xDF, 0xFD, 0xCB, 0xBF, 0xBC, 0xDC, 0xBA, 0xCB, 0xCB, 0x7F, 0xDF,
-    0xDD, 0xDF, 0xCC, 0xBC, 0xFC, 0xFC, 0xFF, 0xFF, 0xFC, 0xDD, 0xFF, 0xDD,
-    0xDC, 0xFB, 0xDB, 0xCB, 0xCF, 0xDC, 0xFF, 0xBC, 0xFF, 0xFA, 0xFB, 0xFB,
-    0xAB, 0xCC, 0xCC, 0xFF, 0xFF, 0xFF, 0xFD, 0xFC, 0xBB, 0xAA, 0xA9, 0x9A,
-    0xBB, 0xCC, 0xCC, 0xFF, 0xCC, 0xFD, 0xCB, 0x9B, 0x89, 0x88, 0x99, 0xAB,
-    0xAD, 0xCD, 0xFF, 0xFC, 0xBA, 0xAA, 0x97, 0x77, 0x78, 0x89, 0xAA, 0xBF,
-    0xFF, 0xCB, 0xFC, 0xB9, 0x97, 0x76, 0x66, 0x77, 0x89, 0xAA, 0xFC, 0xFB,
-    0xBC, 0xBB, 0xA9, 0x76, 0x54, 0x55, 0x67, 0x8A, 0xAC, 0xDC, 0xDD, 0xCC,
-    0xB9, 0x97, 0x64, 0x23, 0x46, 0x78, 0x9C, 0xCB, 0xFC, 0xCF, 0xBB, 0xA8,
-    0x76, 0x43, 0x24, 0x67, 0x99, 0xAC, 0xCF, 0xCF, 0xBC, 0xC9, 0x97, 0x65,
-    0x44, 0x56, 0x78, 0x9A, 0xCD, 0xFF, 0xDC, 0xCA, 0xA9, 0x87, 0x66, 0x66,
-    0x78, 0x9A, 0xBB, 0xFF, 0xFF, 0xFF, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x8A,
-    0xBC, 0xBC, 0xFC, 0xFC, 0xCF, 0xCC, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xCF,
-    0xCF, 0xFF, 0xFF, 0xFC, 0xCB, 0xAA, 0x9A, 0xA9, 0xAA, 0xCF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xEC, 0xAA, 0xAB, 0xAC, 0xCC, 0xDF, 0xFF, 0xFC, 0xDF,
-    0xCD, 0xCD, 0xBC, 0xCB, 0xCF, 0xFB, 0xDC, 0xFD, 0xFF, 0xDF, 0xFF, 0xDC,
-    0xFD, 0xDC, 0xFC, 0xDF, 0xDD, 0xCF, 0xFF, 0xFA, 0xDC, 0xDF, 0xFD, 0xFD,
-    0xCD, 0xDF, 0xDF, 0xDD, 0xDF, 0xFF, 0x6C, 0xBB, 0xCC, 0xCC, 0xDB, 0xFD,
-    0xCF, 0xFF, 0xDD, 0xFF, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xCB, 0xAA, 0xAA, 0x99, 0x99, 0xA9, 0xAA, 0xAA, 0xAB, 0x8C, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xCB, 0xCD, 0xDB, 0xBC, 0xCA, 0xBA,
-    0x9A, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCE, 0xCB, 0xBB, 0xAA, 0x99, 0x98,
-    0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCB, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x88,
-    0x89, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89,
-    0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x87, 0x77, 0x66, 0x67, 0x77, 0x89, 0x9A,
-    0xBC, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xBB,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAB, 0xBA, 0xA9,
-    0x88, 0x76, 0x65, 0x44, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0x9A, 0x98, 0x87,
-    0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAA, 0xB9, 0xA9, 0x88, 0x77, 0x65,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0x9A, 0xA9, 0x87, 0x76, 0x66, 0x56,
-    0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77,
-    0x89, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, 0x77, 0x88, 0x9A,
-    0xBC, 0xDA, 0xBB, 0xA9, 0x98, 0x88, 0x87, 0x88, 0x88, 0x9A, 0xAB, 0xCB,
-    0xAC, 0xBA, 0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAB, 0xCD, 0xCA, 0xCB,
-    0xBA, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB,
-    0xBA, 0xAA, 0xBA, 0xAA, 0xBB, 0xBE, 0xED, 0xCB, 0xCC, 0xDD, 0xCB, 0xBB,
-    0xBB, 0xBB, 0xBB, 0xCD, 0xFE, 0xFE, 0x8C, 0xBB, 0xBB, 0xAA, 0xAB, 0xBB,
-    0xBB, 0xCC, 0xCD, 0xDD, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAC, 0xCC,
-    0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xDC, 0xBC, 0xBA, 0xA9,
-    0x99, 0x98, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0xA9, 0x98, 0x88,
-    0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77,
-    0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x78,
-    0x89, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x89,
-    0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA,
-    0x99, 0x98, 0x77, 0x66, 0x65, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99,
-    0x87, 0x76, 0x65, 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x88, 0x77,
-    0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66,
-    0x65, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66,
-    0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77,
-    0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99,
-    0xAB, 0xBA, 0xAA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB,
-    0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xBB,
-    0xAA, 0x99, 0x99, 0x98, 0x99, 0x99, 0xAA, 0xBC, 0xDC, 0xBC, 0xBB, 0xBA,
-    0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCD, 0xDC, 0xDC, 0xCB, 0xBA, 0xAA,
-    0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xED, 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA,
-    0xAA, 0xBB, 0xCC, 0xDE, 0xD0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xBC, 0xBA, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0x8C, 0xCC,
-    0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCD, 0xDC, 0xDB, 0xBC, 0xBC, 0xA9,
-    0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xAB, 0xCA, 0xAA, 0x98, 0x88,
-    0x88, 0x89, 0x99, 0xAA, 0xCC, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x78, 0x88,
-    0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88,
-    0x99, 0xAA, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x77, 0x88, 0x9A,
-    0xBA, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0xAA, 0xAA,
-    0xAA, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0xA9,
-    0x88, 0x76, 0x65, 0x44, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0x9A, 0x98, 0x87,
-    0x66, 0x54, 0x45, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xB9, 0x98, 0x76, 0x66,
-    0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x66,
-    0x66, 0x78, 0x99, 0xAB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77,
-    0x89, 0x9A, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A,
-    0xBB, 0xAB, 0xDA, 0xA9, 0x98, 0x88, 0x77, 0x88, 0x88, 0x9A, 0xAC, 0xBB,
-    0xBC, 0xAB, 0xA9, 0x99, 0x98, 0x88, 0x89, 0x9A, 0xAA, 0xBD, 0xCB, 0xBB,
-    0xBB, 0xA9, 0xA9, 0x99, 0x99, 0xAA, 0xAC, 0xBC, 0xCC, 0xBC, 0xCC, 0xBA,
-    0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCD, 0xBB, 0xCB, 0xBA,
-    0xBB, 0xBB, 0xAC, 0xBB, 0xDD, 0xDD, 0x7A, 0xAA, 0xAA, 0xBA, 0xAA, 0xAA,
-    0xAB, 0xBB, 0xBB, 0xCD, 0xB0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBF, 0xDF, 0xBB, 0xAB, 0xBF, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xCC, 0xFD, 0xFF, 0xDF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC,
-    0xBB, 0xDF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBF,
-    0xCF, 0xBF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFD, 0xFF, 0xBB, 0xBA, 0xAB, 0xFC,
-    0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCA, 0x99, 0x99, 0xAC, 0xDF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xCD, 0xBA, 0x87, 0x77, 0x89, 0x9B, 0xBF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xCB, 0x97, 0x54, 0x46, 0x8A, 0xDB, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xCD, 0xA9, 0x64, 0x12, 0x57, 0x9B, 0xBF, 0xDF, 0xFF, 0xFF, 0xFF, 0xBA,
-    0x97, 0x52, 0x24, 0x79, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, 0x86,
-    0x54, 0x57, 0x9B, 0xFD, 0xFF, 0xFD, 0xFF, 0xFC, 0xCC, 0xA9, 0x87, 0x77,
-    0x8A, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x99, 0x99, 0x9A, 0xAF,
-    0xCF, 0xFF, 0xFF, 0xDF, 0xFF, 0xBF, 0xAC, 0xBA, 0xAA, 0xCC, 0xBF, 0xFF,
-    0xFF, 0xFD, 0xFF, 0xFF, 0xCB, 0xBC, 0xBB, 0xDF, 0xDD, 0xFF, 0xFF, 0xFF,
-    0xDF, 0xFF, 0xDF, 0xFC, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xFD, 0xDF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFD,
-    0xDF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6B, 0xCF, 0xDF, 0xDF, 0xFF, 0xCF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xAF, 0xFF, 0xBF, 0xAB, 0xFB, 0x9F, 0xBB, 0xAB, 0x6B, 0xFF,
-    0xFB, 0xFF, 0xAF, 0xAA, 0xFB, 0xFA, 0xBB, 0xFF, 0xFF, 0xFF, 0xFB, 0xBF,
-    0xB9, 0xFB, 0xBA, 0xBB, 0xBF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFA, 0xFB, 0xBB,
-    0xAA, 0xFF, 0xFA, 0xBF, 0xBF, 0xFF, 0xBF, 0xFA, 0xAF, 0xBB, 0x99, 0x9A,
-    0xA9, 0xBF, 0xFB, 0xFB, 0xAB, 0xFB, 0xBA, 0xA9, 0x98, 0x9A, 0x99, 0xAA,
-    0xFB, 0xBB, 0xFF, 0xAF, 0xFA, 0xAA, 0x98, 0x78, 0x78, 0x89, 0xAF, 0xBF,
-    0xAF, 0xFB, 0xBF, 0xBA, 0x99, 0x76, 0x66, 0x88, 0x99, 0xBF, 0xFF, 0xBF,
-    0xFF, 0xFA, 0x98, 0x77, 0x54, 0x56, 0x79, 0x9B, 0xBF, 0xBB, 0xBB, 0xAF,
-    0xAB, 0xA8, 0x64, 0x22, 0x57, 0x88, 0x9A, 0xFF, 0xAB, 0xAF, 0x99, 0xB8,
-    0x77, 0x52, 0x25, 0x79, 0xA9, 0xAA, 0xFF, 0xFA, 0xBB, 0xBA, 0x98, 0x76,
-    0x54, 0x66, 0x78, 0x99, 0xBF, 0xFB, 0x9F, 0xFA, 0x9A, 0x98, 0x76, 0x66,
-    0x78, 0x8A, 0xFA, 0xAB, 0xAF, 0xFB, 0xBA, 0xB8, 0x98, 0x88, 0x78, 0x9A,
-    0xAB, 0xFF, 0xFB, 0xAF, 0xBF, 0xBA, 0xAA, 0x99, 0xA9, 0x9F, 0x8A, 0xFA,
-    0xFF, 0xAA, 0xFF, 0xBB, 0xAF, 0xA9, 0xA8, 0x89, 0xAB, 0xFA, 0xBB, 0xFF,
-    0xFB, 0xFF, 0xFF, 0xFB, 0xA9, 0xAB, 0xAF, 0xBF, 0xBB, 0xBB, 0xBB, 0xFF,
-    0xBF, 0xFB, 0xFF, 0xFA, 0xBF, 0xAF, 0xAF, 0xFB, 0xFF, 0xAF, 0xBF, 0xFF,
-    0xFF, 0xBB, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFB, 0xFF, 0xFB, 0xFF, 0xFF, 0xFB, 0x6F, 0xAA, 0xAB, 0xAB, 0xBA, 0xFA,
-    0xFA, 0xBB, 0xFF, 0xFB, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xDE, 0xFF, 0xFF, 0xFF, 0xDC, 0xCC, 0xCF, 0xCD, 0xCF, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xDC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFD, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xDC,
-    0xFC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xDC, 0xDD,
-    0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xEB, 0xBA, 0xBB, 0xBC, 0xDD, 0xFD,
-    0xDF, 0xFC, 0xFF, 0xDD, 0xCB, 0x98, 0x78, 0x9A, 0xCC, 0xFF, 0xFF, 0xFF,
-    0xDF, 0xFF, 0xFD, 0xB8, 0x54, 0x46, 0x9B, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xCD, 0xDA, 0x74, 0x22, 0x48, 0xAC, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
-    0xA7, 0x42, 0x14, 0x7A, 0xDF, 0xFF, 0xFF, 0xDD, 0xFF, 0xFD, 0xDA, 0x96,
-    0x44, 0x58, 0xBC, 0xFD, 0xFF, 0xFF, 0xFF, 0xDF, 0xFC, 0xDA, 0x97, 0x78,
-    0xAC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFC, 0xCA, 0xAA, 0xAB, 0xCF,
-    0xFF, 0xFD, 0xFF, 0xDF, 0xFF, 0xFD, 0xFC, 0xDC, 0xBC, 0xCD, 0xDF, 0xDF,
-    0xFF, 0xFC, 0xFF, 0xFD, 0xFF, 0xDF, 0xCC, 0xFD, 0xFD, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xDF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xDD, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xDF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6B, 0xDD, 0xCD, 0xDD, 0xFF, 0xDF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xDD, 0xDD, 0xCD, 0xDD, 0xDE, 0xDF, 0xFF, 0xCF, 0xFF,
-    0xFF, 0xDC, 0xCC, 0xCB, 0xCC, 0xBD, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xDC,
-    0xBB, 0xBA, 0xAA, 0xBB, 0xCC, 0xDF, 0xEF, 0xFF, 0xFD, 0xCC, 0xBA, 0x99,
-    0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xFE, 0xDC, 0xAA, 0x98, 0x88, 0x88,
-    0x89, 0xAB, 0xBC, 0xDE, 0xFF, 0xDC, 0xB9, 0x98, 0x77, 0x77, 0x77, 0x89,
-    0xAA, 0xCC, 0xFF, 0xFC, 0xCA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB,
-    0xCD, 0xFE, 0xCB, 0xA8, 0x76, 0x65, 0x55, 0x56, 0x77, 0x99, 0xBC, 0xDE,
-    0xDC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xDC, 0xCA,
-    0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xA9, 0x87,
-    0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xEC, 0xCA, 0x98, 0x76, 0x55,
-    0x55, 0x55, 0x67, 0x89, 0xAB, 0xDF, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55,
-    0x66, 0x78, 0xAB, 0xCF, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78,
-    0x9A, 0xBC, 0xFF, 0xDD, 0xCA, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xBC,
-    0xDF, 0xFD, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x9A, 0xAC, 0xDF, 0xFF,
-    0xFF, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBB, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xDD, 0xCB, 0xBA, 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC,
-    0xDC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xDD,
-    0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFE, 0xFE, 0xDD, 0xEF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xCF, 0xFE, 0xFD, 0xDC, 0xCF, 0xFD, 0xED, 0xCC, 0xBC, 0xEC, 0x7F, 0xEF,
-    0xFF, 0xEF, 0xEF, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0xDD, 0xFF,
-    0xDD, 0xFD, 0xEF, 0xEF, 0xEE, 0xEF, 0xFF, 0xCF, 0xEF, 0xFF, 0xDF, 0xEF,
-    0xDF, 0xDE, 0xEF, 0xEF, 0xFF, 0xFD, 0xEE, 0xFD, 0xFD, 0xDD, 0xDD, 0xCC,
-    0xDD, 0xEE, 0xFE, 0xFD, 0xED, 0xFF, 0xEE, 0xDC, 0xCC, 0xBC, 0xBC, 0xCE,
-    0xED, 0xFF, 0xFE, 0xEF, 0xCD, 0xFF, 0xBB, 0xAA, 0xAA, 0xBC, 0xDD, 0xEE,
-    0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0x98, 0x77, 0x89, 0xBC, 0xDE, 0xFF, 0xFD,
-    0xDE, 0xDF, 0xDC, 0xA8, 0x54, 0x46, 0x8A, 0xCF, 0xEF, 0xEF, 0xDC, 0xFF,
-    0xDC, 0xCA, 0x74, 0x12, 0x47, 0xAC, 0xED, 0xEE, 0xFE, 0xEE, 0xEF, 0xFB,
-    0xA7, 0x42, 0x24, 0x7A, 0xBD, 0xEE, 0xEF, 0xDE, 0xED, 0xDE, 0xCA, 0x86,
-    0x44, 0x68, 0xAD, 0xDD, 0xEE, 0xFD, 0xDE, 0xEE, 0xFC, 0xB9, 0x87, 0x78,
-    0xAB, 0xCF, 0xDD, 0xFF, 0xFD, 0xFF, 0xFC, 0xCC, 0xBA, 0x9A, 0xAB, 0xBE,
-    0xEF, 0xEF, 0xFD, 0xDF, 0xFF, 0xFD, 0xCC, 0xCC, 0xCC, 0xDC, 0xCD, 0xFF,
-    0xFF, 0xEF, 0xFF, 0xFE, 0xDE, 0xDD, 0xCC, 0xFD, 0xEF, 0xDF, 0xFF, 0xFE,
-    0xFF, 0xFF, 0xED, 0xDD, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDE, 0xFF,
-    0xFE, 0xFF, 0xED, 0xFE, 0xFE, 0xFF, 0xEF, 0xFF, 0xFF, 0xCE, 0xEF, 0xFF,
-    0xFF, 0xFD, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xEF, 0xFE, 0xEE,
-    0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0xDD, 0xCC, 0xCC, 0xCE, 0xCE,
-    0xCE, 0xED, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0x8F, 0xF8, 0xF8, 0xF9, 0xF8, 0x5F, 0xFF,
-    0xF9, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF,
-    0xF8, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF,
-    0x88, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFE, 0x8F, 0x8F,
-    0x8F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x88, 0x78, 0xFF, 0xFF,
-    0xF8, 0x8F, 0xFF, 0xFF, 0xFF, 0xF9, 0x8F, 0xF8, 0xF9, 0xF9, 0x8F, 0xFF,
-    0x8F, 0x8F, 0xF8, 0x89, 0x8F, 0x68, 0x68, 0x88, 0x88, 0xF8, 0xFF, 0xFF,
-    0xFF, 0xF8, 0x88, 0x78, 0x64, 0x56, 0xFF, 0x8F, 0xF8, 0xFF, 0xFF, 0xF8,
-    0xFF, 0x88, 0x64, 0x22, 0x48, 0x88, 0x8F, 0xFF, 0xFF, 0xE9, 0x8F, 0xFF,
-    0xF7, 0x52, 0x25, 0x78, 0x8F, 0xF8, 0xFF, 0xFF, 0x9F, 0xFF, 0xF8, 0x87,
-    0x44, 0x58, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x8F, 0xF7, 0x76,
-    0x88, 0xF9, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0x79, 0x88, 0xF9, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF8, 0xFF, 0xFF, 0x98, 0xFF, 0xFF, 0x8F, 0xF9, 0xFF, 0x8F, 0xFF, 0xFF,
-    0x8F, 0xFF, 0xFF, 0xF8, 0xFF, 0x98, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0x8F, 0xFF, 0xFF,
-    0xFF, 0x8F, 0xFF, 0x8F, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0x99, 0xFF, 0xCF, 0xF8, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x7F, 0x87, 0x87, 0x66, 0x68, 0x87, 0x77, 0x77, 0x68, 0xFF, 0x57, 0xFF,
-    0x88, 0xFF, 0x88, 0x88, 0x8F, 0x88, 0xFF, 0xFF, 0xF8, 0x6F, 0xF7, 0x78,
-    0xF8, 0x8F, 0x87, 0x78, 0x87, 0xFF, 0xF7, 0x87, 0xF7, 0xF8, 0x7F, 0xF8,
-    0x88, 0x88, 0x87, 0x88, 0x8F, 0x87, 0xF8, 0x88, 0xF7, 0xF7, 0xFF, 0x8F,
-    0x88, 0x7F, 0x8F, 0xF8, 0xF7, 0x8F, 0x8F, 0xF7, 0x77, 0xF7, 0x68, 0x8F,
-    0x8F, 0xFF, 0xF7, 0x69, 0x8F, 0x88, 0x76, 0x78, 0x6F, 0x77, 0x6F, 0xFF,
-    0x7F, 0x88, 0xF8, 0x8F, 0xF7, 0x87, 0x88, 0xF7, 0x7F, 0xF8, 0x8F, 0x77,
-    0x68, 0x87, 0xF7, 0x86, 0x87, 0x67, 0x67, 0x7F, 0x78, 0xF8, 0x77, 0x77,
-    0x88, 0x67, 0xF7, 0x76, 0x88, 0x78, 0x77, 0xFF, 0x8F, 0x7F, 0x88, 0x87,
-    0x67, 0x67, 0x77, 0x77, 0x78, 0x8F, 0x7F, 0x77, 0x7F, 0x87, 0x76, 0x68,
-    0x87, 0x77, 0x67, 0x7F, 0x7E, 0xE8, 0xCB, 0x88, 0x7F, 0xF7, 0x77, 0x87,
-    0x6F, 0x8F, 0x87, 0x7F, 0x68, 0x88, 0xF7, 0x88, 0xF7, 0xF6, 0x87, 0xF8,
-    0x87, 0xFF, 0xF7, 0x88, 0xF8, 0x8F, 0x8F, 0xF7, 0x88, 0x7F, 0xFF, 0x8F,
-    0xFF, 0x77, 0xF8, 0x88, 0x78, 0x8F, 0xF7, 0x78, 0x77, 0x88, 0x8F, 0xF7,
-    0x8F, 0xF8, 0xFF, 0xF8, 0x8F, 0x88, 0x78, 0x77, 0x7F, 0xF8, 0x78, 0xF8,
-    0x88, 0x88, 0x7F, 0x8F, 0x7F, 0x8F, 0xA7, 0x78, 0x7F, 0xFF, 0xFF, 0x87,
-    0x8F, 0x78, 0x87, 0x8F, 0x8F, 0x87, 0x8F, 0x77, 0xF8, 0xF7, 0x88, 0x8F,
-    0x8F, 0xFF, 0xF8, 0x87, 0x7F, 0xF8, 0x8F, 0x87, 0x8F, 0x87, 0x78, 0x7F,
-    0xF7, 0x77, 0x78, 0xF8, 0x70, 0x00, 0x00, 0x00,
-  },
-  {
-    0x57, 0x78, 0x66, 0x77, 0x66, 0x76, 0x77, 0x76, 0x87, 0x79, 0x68, 0xAD,
-    0x98, 0x89, 0x98, 0xDA, 0xB9, 0x99, 0x99, 0x9D, 0x98, 0x79, 0xAA, 0x89,
-    0x98, 0x88, 0x88, 0x98, 0xAA, 0x88, 0x9A, 0x87, 0x89, 0xA9, 0x99, 0x89,
-    0x98, 0x98, 0x99, 0x89, 0xA9, 0x99, 0x7A, 0x88, 0x79, 0x98, 0x88, 0x87,
-    0x87, 0x98, 0x88, 0x9A, 0x76, 0x98, 0x77, 0x88, 0x87, 0x97, 0x88, 0x98,
-    0x98, 0x99, 0x88, 0x79, 0x89, 0x99, 0x78, 0x87, 0x88, 0x88, 0x89, 0xA9,
-    0x98, 0x87, 0x99, 0x87, 0x78, 0x78, 0x87, 0x87, 0x87, 0x97, 0x99, 0x97,
-    0x79, 0x98, 0x98, 0x78, 0x87, 0x98, 0x87, 0x78, 0x88, 0x9A, 0x76, 0x99,
-    0x77, 0x78, 0x78, 0x77, 0x87, 0x78, 0x88, 0x99, 0xA7, 0x79, 0x88, 0x89,
-    0x87, 0x77, 0x87, 0x88, 0x78, 0x88, 0x89, 0x77, 0x88, 0x97, 0x88, 0x87,
-    0x87, 0x67, 0x88, 0x89, 0x89, 0x88, 0x79, 0x89, 0x88, 0x78, 0x87, 0x77,
-    0x77, 0x78, 0x89, 0x8A, 0x76, 0x89, 0x97, 0x77, 0x97, 0x87, 0x77, 0x99,
-    0x89, 0x99, 0x96, 0x6A, 0xA8, 0x88, 0x88, 0x88, 0x89, 0x87, 0x88, 0x88,
-    0x99, 0x87, 0x9A, 0xA8, 0x88, 0x98, 0x78, 0x88, 0x88, 0x88, 0x99, 0x98,
-    0x79, 0x99, 0x88, 0x88, 0x98, 0x88, 0x87, 0x88, 0x88, 0xA9, 0x78, 0xAA,
-    0x98, 0x98, 0xA8, 0x88, 0x88, 0x88, 0x88, 0x88, 0xA7, 0x8A, 0x98, 0x89,
-    0x8A, 0x88, 0x88, 0x9A, 0x89, 0x89, 0x99, 0x78, 0xA9, 0x99, 0xD8, 0x89,
-    0x98, 0x8A, 0x89, 0x98, 0xAA, 0x87, 0x69, 0x88, 0x87, 0x87, 0x78, 0x77,
-    0x67, 0x87, 0x77, 0x79, 0x50, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAB, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x85, 0x68, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xF5, 0x12, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x61, 0x15, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8,
-    0x65, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xAF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBB, 0xFF, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFB,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA9, 0x99, 0xBF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x97, 0x66, 0x88, 0xBF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFB, 0xB7, 0x53, 0x45, 0x7A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF9, 0x63, 0x22, 0x46, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x96, 0x42, 0x24, 0x79, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x85,
-    0x44, 0x57, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x86, 0x67,
-    0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF9, 0x99, 0xBF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xBB, 0xBF, 0xFD, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0x5F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x88, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xF6, 0x12, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF3, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8,
-    0xBC, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xE5, 0xEF, 0xFF, 0xFF, 0x3F, 0xFF,
-    0xEE, 0xEE, 0xE5, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0x5E,
-    0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xF4, 0x5F, 0x5F, 0xFF, 0xF5,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x54, 0x55, 0x5F, 0x5F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x5F, 0x4F, 0xFF, 0x54, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xEE, 0xEE, 0x4E, 0xE5, 0xE6, 0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5,
-    0xE5, 0xE5, 0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E,
-    0xEE, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xEF, 0xFF, 0xF5, 0x45, 0x3F,
-    0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0x4F, 0x4F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0x5F, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFF,
-    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xFF, 0xFE, 0xFF, 0xFE, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xAF, 0x5F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFA, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF,
-    0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0x99, 0x9B, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA7, 0x67, 0x7F, 0xAB, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xA7, 0x54, 0x45, 0x79, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0x64, 0x22, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xA6, 0x42, 0x23, 0x69, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x75,
-    0x43, 0x57, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x77, 0x67,
-    0x9A, 0xBE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xF9, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xBA, 0xAA, 0xAF, 0x5F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x99, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFC, 0x65, 0x56, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF,
-    0xFF, 0xFF, 0x94, 0x12, 0x59, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF9, 0x52, 0x14, 0x9D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x97,
-    0x54, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xAA,
-    0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFA, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x9F, 0xFF, 0xBF, 0xFB, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFE,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xAF, 0xFF, 0xA9, 0xAA, 0xFF, 0x5F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xAF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F,
-    0xAF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFA, 0xFF, 0xAF, 0xFF, 0xAF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xA8, 0xA7, 0x67, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xD7, 0x53, 0x45, 0x7A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFA, 0x64, 0x22, 0x47, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xF9,
-    0x97, 0x42, 0x24, 0x68, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x76,
-    0x44, 0x58, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x76, 0x67,
-    0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xA9, 0xAF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0xAF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFA, 0xFA, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xA9, 0xAF, 0xFF, 0xFA, 0x9F,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x5F, 0xEF, 0x56, 0x6F, 0xF6, 0x66, 0xEE, 0xEF, 0x6F, 0xFF, 0x56, 0xE6,
-    0xE6, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0xE6, 0xEE,
-    0xEE, 0xEE, 0xE6, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0x6F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0xEE, 0xE6, 0xEE, 0xEE, 0x6E,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x6E, 0x4E, 0x6E, 0xEE, 0xEE, 0xEE,
-    0xE6, 0xEE, 0xEE, 0xEF, 0xF6, 0xF5, 0x6F, 0x56, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0xF4, 0x6F, 0x6F, 0xFF, 0xFF, 0xFF, 0xFE,
-    0xEE, 0xE5, 0xE6, 0x66, 0x65, 0x6E, 0xE5, 0xEE, 0xE6, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xE5, 0x56, 0x45, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xE6, 0xE6, 0x65, 0x65, 0xEE, 0xEE, 0xEE, 0xE6, 0xEE, 0xEE, 0xE6, 0x66,
-    0x6E, 0x6E, 0xEE, 0xEE, 0xE6, 0xEE, 0x6E, 0xEF, 0xF6, 0xF6, 0xFF, 0x56,
-    0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x6F,
-    0x66, 0xF5, 0xF6, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xF5, 0xF6, 0xFF, 0x6F, 0xFE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE6, 0xEE, 0xEE, 0xFE, 0x6E, 0xFE,
-    0xFF, 0xFE, 0xFF, 0x6E, 0xF6, 0xFE, 0xFF, 0x66, 0xFF, 0xFE, 0xFF, 0xFE,
-    0xEF, 0xFF, 0xFF, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x5F, 0xFF, 0xFE, 0xFF, 0xFF, 0x5F, 0xFF, 0x65, 0x6F, 0xF6, 0xFE,
-    0x66, 0xFE, 0x66, 0x5E, 0x50, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xA8, 0xFF, 0xFF, 0xF7, 0xFF, 0x3F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x76, 0x77, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0x86, 0x54, 0x45, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF9, 0x64, 0x22, 0x48, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF6, 0x42, 0x24, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xF5,
-    0x44, 0x5B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xF6,
-    0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x87, 0x7F, 0x8F,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xED, 0xD5, 0xEE, 0xEE, 0x3E, 0xEE,
-    0xEE, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xE4, 0x21, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xDD,
-    0xDD, 0xD1, 0x1D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xED, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFE, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0x75, 0x4F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xF4, 0x12, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0x42, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0x54, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFC, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x67, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xF6, 0x44, 0x45, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xF6, 0x54, 0x22, 0x46, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xF5, 0x42, 0x34, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x75,
-    0x43, 0x4F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x56,
-    0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F,
-    0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
-  },
-  {
-    0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xED, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0x53, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xE5, 0x12, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD,
-    0xDD, 0xD2, 0x24, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD,
-    0xD3, 0x3D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x3E, 0xE5, 0xEE, 0xEE, 0xEE, 0xEE,
-    0xEE, 0xEE, 0xEE, 0xED, 0xE0, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
-  {
-    0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
-    0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
-    0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00,
-  },
- },
-};
-
-#endif /* AVCODEC_RALFDATA_H */
diff --git a/deps/libav/libavcodec/rangecoder.c b/deps/libav/libavcodec/rangecoder.c
deleted file mode 100644
index af0a8c0..0000000
--- a/deps/libav/libavcodec/rangecoder.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Range coder
- * Copyright (c) 2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Range coder.
- * based upon
- *    "Range encoding: an algorithm for removing redundancy from a digitised
- *                     message.
- *     G. N. N. Martin                  Presented in March 1979 to the Video &
- *                                      Data Recording Conference,
- *     IBM UK Scientific Center         held in Southampton July 24-27 1979."
- *
- */
-
-#include <string.h>
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "rangecoder.h"
-#include "bytestream.h"
-
-av_cold void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size)
-{
-    c->bytestream_start  =
-    c->bytestream        = buf;
-    c->bytestream_end    = buf + buf_size;
-    c->low               = 0;
-    c->range             = 0xFF00;
-    c->outstanding_count = 0;
-    c->outstanding_byte  = -1;
-}
-
-av_cold void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf,
-                                   int buf_size)
-{
-    /* cast to avoid compiler warning */
-    ff_init_range_encoder(c, (uint8_t *)buf, buf_size);
-
-    c->low = bytestream_get_be16(&c->bytestream);
-}
-
-void ff_build_rac_states(RangeCoder *c, int factor, int max_p)
-{
-    const int64_t one = 1LL << 32;
-    int64_t p;
-    int last_p8, p8, i;
-
-    memset(c->zero_state, 0, sizeof(c->zero_state));
-    memset(c->one_state, 0, sizeof(c->one_state));
-
-    last_p8 = 0;
-    p       = one / 2;
-    for (i = 0; i < 128; i++) {
-        p8 = (256 * p + one / 2) >> 32; // FIXME: try without the one
-        if (p8 <= last_p8)
-            p8 = last_p8 + 1;
-        if (last_p8 && last_p8 < 256 && p8 <= max_p)
-            c->one_state[last_p8] = p8;
-
-        p      += ((one - p) * factor + one / 2) >> 32;
-        last_p8 = p8;
-    }
-
-    for (i = 256 - max_p; i <= max_p; i++) {
-        if (c->one_state[i])
-            continue;
-
-        p  = (i * one + 128) >> 8;
-        p += ((one - p) * factor + one / 2) >> 32;
-        p8 = (256 * p + one / 2) >> 32; // FIXME: try without the one
-        if (p8 <= i)
-            p8 = i + 1;
-        if (p8 > max_p)
-            p8 = max_p;
-        c->one_state[i] = p8;
-    }
-
-    for (i = 1; i < 255; i++)
-        c->zero_state[i] = 256 - c->one_state[256 - i];
-}
-
-/* Return the number of bytes written. */
-int ff_rac_terminate(RangeCoder *c)
-{
-    c->range = 0xFF;
-    c->low  += 0xFF;
-    renorm_encoder(c);
-    c->range = 0xFF;
-    renorm_encoder(c);
-
-    assert(c->low == 0);
-    assert(c->range >= 0x100);
-
-    return c->bytestream - c->bytestream_start;
-}
-
-#ifdef TEST
-#define SIZE 10240
-
-#include "libavutil/lfg.h"
-#include "libavutil/log.h"
-
-int main(void)
-{
-    RangeCoder c;
-    uint8_t b[9 * SIZE];
-    uint8_t r[9 * SIZE];
-    int i;
-    uint8_t state[10];
-    AVLFG prng;
-
-    av_lfg_init(&prng, 1);
-
-    ff_init_range_encoder(&c, b, SIZE);
-    ff_build_rac_states(&c, 0.05 * (1LL << 32), 128 + 64 + 32 + 16);
-
-    memset(state, 128, sizeof(state));
-
-    for (i = 0; i < SIZE; i++)
-        r[i] = av_lfg_get(&prng) % 7;
-
-    for (i = 0; i < SIZE; i++)
-        put_rac(&c, state, r[i] & 1);
-
-    ff_rac_terminate(&c);
-
-    ff_init_range_decoder(&c, b, SIZE);
-
-    memset(state, 128, sizeof(state));
-
-    for (i = 0; i < SIZE; i++)
-        if ((r[i] & 1) != get_rac(&c, state)) {
-            av_log(NULL, AV_LOG_ERROR, "rac failure at %d\n", i);
-            return 1;
-        }
-
-    return 0;
-}
-#endif /* TEST */
diff --git a/deps/libav/libavcodec/rangecoder.h b/deps/libav/libavcodec/rangecoder.h
deleted file mode 100644
index ad9c81f..0000000
--- a/deps/libav/libavcodec/rangecoder.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Range coder
- * Copyright (c) 2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Range coder.
- */
-
-#ifndef AVCODEC_RANGECODER_H
-#define AVCODEC_RANGECODER_H
-
-#include <stdint.h>
-#include <assert.h>
-
-#include "libavutil/common.h"
-
-typedef struct RangeCoder {
-    int low;
-    int range;
-    int outstanding_count;
-    int outstanding_byte;
-    uint8_t zero_state[256];
-    uint8_t one_state[256];
-    uint8_t *bytestream_start;
-    uint8_t *bytestream;
-    uint8_t *bytestream_end;
-} RangeCoder;
-
-void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size);
-void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size);
-int ff_rac_terminate(RangeCoder *c);
-void ff_build_rac_states(RangeCoder *c, int factor, int max_p);
-
-static inline void renorm_encoder(RangeCoder *c)
-{
-    // FIXME: optimize
-    while (c->range < 0x100) {
-        if (c->outstanding_byte < 0) {
-            c->outstanding_byte = c->low >> 8;
-        } else if (c->low <= 0xFF00) {
-            *c->bytestream++ = c->outstanding_byte;
-            for (; c->outstanding_count; c->outstanding_count--)
-                *c->bytestream++ = 0xFF;
-            c->outstanding_byte = c->low >> 8;
-        } else if (c->low >= 0x10000) {
-            *c->bytestream++ = c->outstanding_byte + 1;
-            for (; c->outstanding_count; c->outstanding_count--)
-                *c->bytestream++ = 0x00;
-            c->outstanding_byte = (c->low >> 8) & 0xFF;
-        } else {
-            c->outstanding_count++;
-        }
-
-        c->low     = (c->low & 0xFF) << 8;
-        c->range <<= 8;
-    }
-}
-
-static inline int get_rac_count(RangeCoder *c)
-{
-    int x = c->bytestream - c->bytestream_start + c->outstanding_count;
-    if (c->outstanding_byte >= 0)
-        x++;
-    return 8 * x - av_log2(c->range);
-}
-
-static inline void put_rac(RangeCoder *c, uint8_t *const state, int bit)
-{
-    int range1 = (c->range * (*state)) >> 8;
-
-    assert(*state);
-    assert(range1 < c->range);
-    assert(range1 > 0);
-    if (!bit) {
-        c->range -= range1;
-        *state    = c->zero_state[*state];
-    } else {
-        c->low  += c->range - range1;
-        c->range = range1;
-        *state   = c->one_state[*state];
-    }
-
-    renorm_encoder(c);
-}
-
-static inline void refill(RangeCoder *c)
-{
-    if (c->range < 0x100) {
-        c->range <<= 8;
-        c->low   <<= 8;
-        if (c->bytestream < c->bytestream_end)
-            c->low += c->bytestream[0];
-        c->bytestream++;
-    }
-}
-
-static inline int get_rac(RangeCoder *c, uint8_t *const state)
-{
-    int range1 = (c->range * (*state)) >> 8;
-    int av_unused one_mask;
-
-    c->range -= range1;
-#if 1
-    if (c->low < c->range) {
-        *state = c->zero_state[*state];
-        refill(c);
-        return 0;
-    } else {
-        c->low  -= c->range;
-        *state   = c->one_state[*state];
-        c->range = range1;
-        refill(c);
-        return 1;
-    }
-#else
-    one_mask = (c->range - c->low - 1) >> 31;
-
-    c->low   -= c->range & one_mask;
-    c->range += (range1 - c->range) & one_mask;
-
-    *state = c->zero_state[(*state) + (256 & one_mask)];
-
-    refill(c);
-
-    return one_mask & 1;
-#endif
-}
-
-#endif /* AVCODEC_RANGECODER_H */
diff --git a/deps/libav/libavcodec/ratecontrol.c b/deps/libav/libavcodec/ratecontrol.c
deleted file mode 100644
index 5aaf151..0000000
--- a/deps/libav/libavcodec/ratecontrol.c
+++ /dev/null
@@ -1,1038 +0,0 @@
-/*
- * Rate control for video encoders
- *
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Rate control for video encoders.
- */
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "ratecontrol.h"
-#include "mpegvideo.h"
-#include "libavutil/eval.h"
-
-#undef NDEBUG // Always check asserts, the speed effect is far too small to disable them.
-#include <assert.h>
-
-#ifndef M_E
-#define M_E 2.718281828
-#endif
-
-static int init_pass2(MpegEncContext *s);
-static double get_qscale(MpegEncContext *s, RateControlEntry *rce,
-                         double rate_factor, int frame_num);
-
-void ff_write_pass1_stats(MpegEncContext *s)
-{
-    snprintf(s->avctx->stats_out, 256,
-             "in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d "
-             "fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d;\n",
-             s->current_picture_ptr->f.display_picture_number,
-             s->current_picture_ptr->f.coded_picture_number,
-             s->pict_type,
-             s->current_picture.f.quality,
-             s->i_tex_bits,
-             s->p_tex_bits,
-             s->mv_bits,
-             s->misc_bits,
-             s->f_code,
-             s->b_code,
-             s->current_picture.mc_mb_var_sum,
-             s->current_picture.mb_var_sum,
-             s->i_count, s->skip_count,
-             s->header_bits);
-}
-
-static inline double qp2bits(RateControlEntry *rce, double qp)
-{
-    if (qp <= 0.0) {
-        av_log(NULL, AV_LOG_ERROR, "qp<=0.0\n");
-    }
-    return rce->qscale * (double)(rce->i_tex_bits + rce->p_tex_bits + 1) / qp;
-}
-
-static inline double bits2qp(RateControlEntry *rce, double bits)
-{
-    if (bits < 0.9) {
-        av_log(NULL, AV_LOG_ERROR, "bits<0.9\n");
-    }
-    return rce->qscale * (double)(rce->i_tex_bits + rce->p_tex_bits + 1) / bits;
-}
-
-av_cold int ff_rate_control_init(MpegEncContext *s)
-{
-    RateControlContext *rcc = &s->rc_context;
-    int i, res;
-    static const char * const const_names[] = {
-        "PI",
-        "E",
-        "iTex",
-        "pTex",
-        "tex",
-        "mv",
-        "fCode",
-        "iCount",
-        "mcVar",
-        "var",
-        "isI",
-        "isP",
-        "isB",
-        "avgQP",
-        "qComp",
-#if 0
-        "lastIQP",
-        "lastPQP",
-        "lastBQP",
-        "nextNonBQP",
-#endif
-        "avgIITex",
-        "avgPITex",
-        "avgPPTex",
-        "avgBPTex",
-        "avgTex",
-        NULL
-    };
-    static double (* const func1[])(void *, double) = {
-        (void *)bits2qp,
-        (void *)qp2bits,
-        NULL
-    };
-    static const char * const func1_names[] = {
-        "bits2qp",
-        "qp2bits",
-        NULL
-    };
-    emms_c();
-
-    res = av_expr_parse(&rcc->rc_eq_eval,
-                        s->avctx->rc_eq ? s->avctx->rc_eq : "tex^qComp",
-                        const_names, func1_names, func1,
-                        NULL, NULL, 0, s->avctx);
-    if (res < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Error parsing rc_eq \"%s\"\n", s->avctx->rc_eq);
-        return res;
-    }
-
-    for (i = 0; i < 5; i++) {
-        rcc->pred[i].coeff = FF_QP2LAMBDA * 7.0;
-        rcc->pred[i].count = 1.0;
-        rcc->pred[i].decay = 0.4;
-
-        rcc->i_cplx_sum [i] =
-        rcc->p_cplx_sum [i] =
-        rcc->mv_bits_sum[i] =
-        rcc->qscale_sum [i] =
-        rcc->frame_count[i] = 1; // 1 is better because of 1/0 and such
-
-        rcc->last_qscale_for[i] = FF_QP2LAMBDA * 5;
-    }
-    rcc->buffer_index = s->avctx->rc_initial_buffer_occupancy;
-
-    if (s->flags & CODEC_FLAG_PASS2) {
-        int i;
-        char *p;
-
-        /* find number of pics */
-        p = s->avctx->stats_in;
-        for (i = -1; p; i++)
-            p = strchr(p + 1, ';');
-        i += s->max_b_frames;
-        if (i <= 0 || i >= INT_MAX / sizeof(RateControlEntry))
-            return -1;
-        rcc->entry       = av_mallocz(i * sizeof(RateControlEntry));
-        rcc->num_entries = i;
-
-        /* init all to skipped p frames
-         * (with b frames we might have a not encoded frame at the end FIXME) */
-        for (i = 0; i < rcc->num_entries; i++) {
-            RateControlEntry *rce = &rcc->entry[i];
-
-            rce->pict_type  = rce->new_pict_type = AV_PICTURE_TYPE_P;
-            rce->qscale     = rce->new_qscale    = FF_QP2LAMBDA * 2;
-            rce->misc_bits  = s->mb_num + 10;
-            rce->mb_var_sum = s->mb_num * 100;
-        }
-
-        /* read stats */
-        p = s->avctx->stats_in;
-        for (i = 0; i < rcc->num_entries - s->max_b_frames; i++) {
-            RateControlEntry *rce;
-            int picture_number;
-            int e;
-            char *next;
-
-            next = strchr(p, ';');
-            if (next) {
-                (*next) = 0; // sscanf in unbelievably slow on looong strings // FIXME copy / do not write
-                next++;
-            }
-            e = sscanf(p, " in:%d ", &picture_number);
-
-            assert(picture_number >= 0);
-            assert(picture_number < rcc->num_entries);
-            rce = &rcc->entry[picture_number];
-
-            e += sscanf(p, " in:%*d out:%*d type:%d q:%f itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d",
-                        &rce->pict_type, &rce->qscale, &rce->i_tex_bits, &rce->p_tex_bits,
-                        &rce->mv_bits, &rce->misc_bits,
-                        &rce->f_code, &rce->b_code,
-                        &rce->mc_mb_var_sum, &rce->mb_var_sum,
-                        &rce->i_count, &rce->skip_count, &rce->header_bits);
-            if (e != 14) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "statistics are damaged at line %d, parser out=%d\n",
-                       i, e);
-                return -1;
-            }
-
-            p = next;
-        }
-
-        if (init_pass2(s) < 0)
-            return -1;
-
-        // FIXME maybe move to end
-        if ((s->flags & CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) {
-#if CONFIG_LIBXVID
-            return ff_xvid_rate_control_init(s);
-#else
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Xvid ratecontrol requires libavcodec compiled with Xvid support.\n");
-            return -1;
-#endif
-        }
-    }
-
-    if (!(s->flags & CODEC_FLAG_PASS2)) {
-        rcc->short_term_qsum   = 0.001;
-        rcc->short_term_qcount = 0.001;
-
-        rcc->pass1_rc_eq_output_sum = 0.001;
-        rcc->pass1_wanted_bits      = 0.001;
-
-        if (s->avctx->qblur > 1.0) {
-            av_log(s->avctx, AV_LOG_ERROR, "qblur too large\n");
-            return -1;
-        }
-        /* init stuff with the user specified complexity */
-        if (s->avctx->rc_initial_cplx) {
-            for (i = 0; i < 60 * 30; i++) {
-                double bits = s->avctx->rc_initial_cplx * (i / 10000.0 + 1.0) * s->mb_num;
-                RateControlEntry rce;
-
-                if (i % ((s->gop_size + 3) / 4) == 0)
-                    rce.pict_type = AV_PICTURE_TYPE_I;
-                else if (i % (s->max_b_frames + 1))
-                    rce.pict_type = AV_PICTURE_TYPE_B;
-                else
-                    rce.pict_type = AV_PICTURE_TYPE_P;
-
-                rce.new_pict_type = rce.pict_type;
-                rce.mc_mb_var_sum = bits * s->mb_num / 100000;
-                rce.mb_var_sum    = s->mb_num;
-
-                rce.qscale    = FF_QP2LAMBDA * 2;
-                rce.f_code    = 2;
-                rce.b_code    = 1;
-                rce.misc_bits = 1;
-
-                if (s->pict_type == AV_PICTURE_TYPE_I) {
-                    rce.i_count    = s->mb_num;
-                    rce.i_tex_bits = bits;
-                    rce.p_tex_bits = 0;
-                    rce.mv_bits    = 0;
-                } else {
-                    rce.i_count    = 0; // FIXME we do know this approx
-                    rce.i_tex_bits = 0;
-                    rce.p_tex_bits = bits * 0.9;
-                    rce.mv_bits    = bits * 0.1;
-                }
-                rcc->i_cplx_sum[rce.pict_type]  += rce.i_tex_bits * rce.qscale;
-                rcc->p_cplx_sum[rce.pict_type]  += rce.p_tex_bits * rce.qscale;
-                rcc->mv_bits_sum[rce.pict_type] += rce.mv_bits;
-                rcc->frame_count[rce.pict_type]++;
-
-                get_qscale(s, &rce, rcc->pass1_wanted_bits / rcc->pass1_rc_eq_output_sum, i);
-
-                // FIXME misbehaves a little for variable fps
-                rcc->pass1_wanted_bits += s->bit_rate / (1 / av_q2d(s->avctx->time_base));
-            }
-        }
-    }
-
-    return 0;
-}
-
-av_cold void ff_rate_control_uninit(MpegEncContext *s)
-{
-    RateControlContext *rcc = &s->rc_context;
-    emms_c();
-
-    av_expr_free(rcc->rc_eq_eval);
-    av_freep(&rcc->entry);
-
-#if CONFIG_LIBXVID
-    if ((s->flags & CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID)
-        ff_xvid_rate_control_uninit(s);
-#endif
-}
-
-int ff_vbv_update(MpegEncContext *s, int frame_size)
-{
-    RateControlContext *rcc = &s->rc_context;
-    const double fps        = 1 / av_q2d(s->avctx->time_base);
-    const int buffer_size   = s->avctx->rc_buffer_size;
-    const double min_rate   = s->avctx->rc_min_rate / fps;
-    const double max_rate   = s->avctx->rc_max_rate / fps;
-
-    av_dlog(s, "%d %f %d %f %f\n",
-            buffer_size, rcc->buffer_index, frame_size, min_rate, max_rate);
-
-    if (buffer_size) {
-        int left;
-
-        rcc->buffer_index -= frame_size;
-        if (rcc->buffer_index < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "rc buffer underflow\n");
-            rcc->buffer_index = 0;
-        }
-
-        left = buffer_size - rcc->buffer_index - 1;
-        rcc->buffer_index += av_clip(left, min_rate, max_rate);
-
-        if (rcc->buffer_index > buffer_size) {
-            int stuffing = ceil((rcc->buffer_index - buffer_size) / 8);
-
-            if (stuffing < 4 && s->codec_id == AV_CODEC_ID_MPEG4)
-                stuffing = 4;
-            rcc->buffer_index -= 8 * stuffing;
-
-            if (s->avctx->debug & FF_DEBUG_RC)
-                av_log(s->avctx, AV_LOG_DEBUG, "stuffing %d bytes\n", stuffing);
-
-            return stuffing;
-        }
-    }
-    return 0;
-}
-
-/**
- * Modify the bitrate curve from pass1 for one frame.
- */
-static double get_qscale(MpegEncContext *s, RateControlEntry *rce,
-                         double rate_factor, int frame_num)
-{
-    RateControlContext *rcc = &s->rc_context;
-    AVCodecContext *a       = s->avctx;
-    const int pict_type     = rce->new_pict_type;
-    const double mb_num     = s->mb_num;
-    double q, bits;
-    int i;
-
-    double const_values[] = {
-        M_PI,
-        M_E,
-        rce->i_tex_bits * rce->qscale,
-        rce->p_tex_bits * rce->qscale,
-        (rce->i_tex_bits + rce->p_tex_bits) * (double)rce->qscale,
-        rce->mv_bits / mb_num,
-        rce->pict_type == AV_PICTURE_TYPE_B ? (rce->f_code + rce->b_code) * 0.5 : rce->f_code,
-        rce->i_count / mb_num,
-        rce->mc_mb_var_sum / mb_num,
-        rce->mb_var_sum / mb_num,
-        rce->pict_type == AV_PICTURE_TYPE_I,
-        rce->pict_type == AV_PICTURE_TYPE_P,
-        rce->pict_type == AV_PICTURE_TYPE_B,
-        rcc->qscale_sum[pict_type] / (double)rcc->frame_count[pict_type],
-        a->qcompress,
-#if 0
-        rcc->last_qscale_for[AV_PICTURE_TYPE_I],
-        rcc->last_qscale_for[AV_PICTURE_TYPE_P],
-        rcc->last_qscale_for[AV_PICTURE_TYPE_B],
-        rcc->next_non_b_qscale,
-#endif
-        rcc->i_cplx_sum[AV_PICTURE_TYPE_I] / (double)rcc->frame_count[AV_PICTURE_TYPE_I],
-        rcc->i_cplx_sum[AV_PICTURE_TYPE_P] / (double)rcc->frame_count[AV_PICTURE_TYPE_P],
-        rcc->p_cplx_sum[AV_PICTURE_TYPE_P] / (double)rcc->frame_count[AV_PICTURE_TYPE_P],
-        rcc->p_cplx_sum[AV_PICTURE_TYPE_B] / (double)rcc->frame_count[AV_PICTURE_TYPE_B],
-        (rcc->i_cplx_sum[pict_type] + rcc->p_cplx_sum[pict_type]) / (double)rcc->frame_count[pict_type],
-        0
-    };
-
-    bits = av_expr_eval(rcc->rc_eq_eval, const_values, rce);
-    if (isnan(bits)) {
-        av_log(s->avctx, AV_LOG_ERROR, "Error evaluating rc_eq \"%s\"\n", s->avctx->rc_eq);
-        return -1;
-    }
-
-    rcc->pass1_rc_eq_output_sum += bits;
-    bits *= rate_factor;
-    if (bits < 0.0)
-        bits = 0.0;
-    bits += 1.0; // avoid 1/0 issues
-
-    /* user override */
-    for (i = 0; i < s->avctx->rc_override_count; i++) {
-        RcOverride *rco = s->avctx->rc_override;
-        if (rco[i].start_frame > frame_num)
-            continue;
-        if (rco[i].end_frame < frame_num)
-            continue;
-
-        if (rco[i].qscale)
-            bits = qp2bits(rce, rco[i].qscale);  // FIXME move at end to really force it?
-        else
-            bits *= rco[i].quality_factor;
-    }
-
-    q = bits2qp(rce, bits);
-
-    /* I/B difference */
-    if (pict_type == AV_PICTURE_TYPE_I && s->avctx->i_quant_factor < 0.0)
-        q = -q * s->avctx->i_quant_factor + s->avctx->i_quant_offset;
-    else if (pict_type == AV_PICTURE_TYPE_B && s->avctx->b_quant_factor < 0.0)
-        q = -q * s->avctx->b_quant_factor + s->avctx->b_quant_offset;
-    if (q < 1)
-        q = 1;
-
-    return q;
-}
-
-static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, double q)
-{
-    RateControlContext *rcc   = &s->rc_context;
-    AVCodecContext *a         = s->avctx;
-    const int pict_type       = rce->new_pict_type;
-    const double last_p_q     = rcc->last_qscale_for[AV_PICTURE_TYPE_P];
-    const double last_non_b_q = rcc->last_qscale_for[rcc->last_non_b_pict_type];
-
-    if (pict_type == AV_PICTURE_TYPE_I &&
-        (a->i_quant_factor > 0.0 || rcc->last_non_b_pict_type == AV_PICTURE_TYPE_P))
-        q = last_p_q * FFABS(a->i_quant_factor) + a->i_quant_offset;
-    else if (pict_type == AV_PICTURE_TYPE_B &&
-             a->b_quant_factor > 0.0)
-        q = last_non_b_q * a->b_quant_factor + a->b_quant_offset;
-    if (q < 1)
-        q = 1;
-
-    /* last qscale / qdiff stuff */
-    if (rcc->last_non_b_pict_type == pict_type || pict_type != AV_PICTURE_TYPE_I) {
-        double last_q     = rcc->last_qscale_for[pict_type];
-        const int maxdiff = FF_QP2LAMBDA * a->max_qdiff;
-
-        if (q > last_q + maxdiff)
-            q = last_q + maxdiff;
-        else if (q < last_q - maxdiff)
-            q = last_q - maxdiff;
-    }
-
-    rcc->last_qscale_for[pict_type] = q; // Note we cannot do that after blurring
-
-    if (pict_type != AV_PICTURE_TYPE_B)
-        rcc->last_non_b_pict_type = pict_type;
-
-    return q;
-}
-
-/**
- * Get the qmin & qmax for pict_type.
- */
-static void get_qminmax(int *qmin_ret, int *qmax_ret, MpegEncContext *s, int pict_type)
-{
-    int qmin = s->avctx->lmin;
-    int qmax = s->avctx->lmax;
-
-    assert(qmin <= qmax);
-
-    switch (pict_type) {
-    case AV_PICTURE_TYPE_B:
-        qmin = (int)(qmin * FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset + 0.5);
-        qmax = (int)(qmax * FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset + 0.5);
-        break;
-    case AV_PICTURE_TYPE_I:
-        qmin = (int)(qmin * FFABS(s->avctx->i_quant_factor) + s->avctx->i_quant_offset + 0.5);
-        qmax = (int)(qmax * FFABS(s->avctx->i_quant_factor) + s->avctx->i_quant_offset + 0.5);
-        break;
-    }
-
-    qmin = av_clip(qmin, 1, FF_LAMBDA_MAX);
-    qmax = av_clip(qmax, 1, FF_LAMBDA_MAX);
-
-    if (qmax < qmin)
-        qmax = qmin;
-
-    *qmin_ret = qmin;
-    *qmax_ret = qmax;
-}
-
-static double modify_qscale(MpegEncContext *s, RateControlEntry *rce,
-                            double q, int frame_num)
-{
-    RateControlContext *rcc  = &s->rc_context;
-    const double buffer_size = s->avctx->rc_buffer_size;
-    const double fps         = 1 / av_q2d(s->avctx->time_base);
-    const double min_rate    = s->avctx->rc_min_rate / fps;
-    const double max_rate    = s->avctx->rc_max_rate / fps;
-    const int pict_type      = rce->new_pict_type;
-    int qmin, qmax;
-
-    get_qminmax(&qmin, &qmax, s, pict_type);
-
-    /* modulation */
-    if (s->avctx->rc_qmod_freq &&
-        frame_num % s->avctx->rc_qmod_freq == 0 &&
-        pict_type == AV_PICTURE_TYPE_P)
-        q *= s->avctx->rc_qmod_amp;
-
-    /* buffer overflow/underflow protection */
-    if (buffer_size) {
-        double expected_size = rcc->buffer_index;
-        double q_limit;
-
-        if (min_rate) {
-            double d = 2 * (buffer_size - expected_size) / buffer_size;
-            if (d > 1.0)
-                d = 1.0;
-            else if (d < 0.0001)
-                d = 0.0001;
-            q *= pow(d, 1.0 / s->avctx->rc_buffer_aggressivity);
-
-            q_limit = bits2qp(rce,
-                              FFMAX((min_rate - buffer_size + rcc->buffer_index) *
-                                    s->avctx->rc_min_vbv_overflow_use, 1));
-
-            if (q > q_limit) {
-                if (s->avctx->debug & FF_DEBUG_RC)
-                    av_log(s->avctx, AV_LOG_DEBUG,
-                           "limiting QP %f -> %f\n", q, q_limit);
-                q = q_limit;
-            }
-        }
-
-        if (max_rate) {
-            double d = 2 * expected_size / buffer_size;
-            if (d > 1.0)
-                d = 1.0;
-            else if (d < 0.0001)
-                d = 0.0001;
-            q /= pow(d, 1.0 / s->avctx->rc_buffer_aggressivity);
-
-            q_limit = bits2qp(rce,
-                              FFMAX(rcc->buffer_index *
-                                    s->avctx->rc_max_available_vbv_use,
-                                    1));
-            if (q < q_limit) {
-                if (s->avctx->debug & FF_DEBUG_RC)
-                    av_log(s->avctx, AV_LOG_DEBUG,
-                           "limiting QP %f -> %f\n", q, q_limit);
-                q = q_limit;
-            }
-        }
-    }
-    av_dlog(s, "q:%f max:%f min:%f size:%f index:%f agr:%f\n",
-            q, max_rate, min_rate, buffer_size, rcc->buffer_index,
-            s->avctx->rc_buffer_aggressivity);
-    if (s->avctx->rc_qsquish == 0.0 || qmin == qmax) {
-        if (q < qmin)
-            q = qmin;
-        else if (q > qmax)
-            q = qmax;
-    } else {
-        double min2 = log(qmin);
-        double max2 = log(qmax);
-
-        q  = log(q);
-        q  = (q - min2) / (max2 - min2) - 0.5;
-        q *= -4.0;
-        q  = 1.0 / (1.0 + exp(q));
-        q  = q * (max2 - min2) + min2;
-
-        q = exp(q);
-    }
-
-    return q;
-}
-
-// ----------------------------------
-// 1 Pass Code
-
-static double predict_size(Predictor *p, double q, double var)
-{
-    return p->coeff * var / (q * p->count);
-}
-
-static void update_predictor(Predictor *p, double q, double var, double size)
-{
-    double new_coeff = size * q / (var + 1);
-    if (var < 10)
-        return;
-
-    p->count *= p->decay;
-    p->coeff *= p->decay;
-    p->count++;
-    p->coeff += new_coeff;
-}
-
-static void adaptive_quantization(MpegEncContext *s, double q)
-{
-    int i;
-    const float lumi_masking         = s->avctx->lumi_masking / (128.0 * 128.0);
-    const float dark_masking         = s->avctx->dark_masking / (128.0 * 128.0);
-    const float temp_cplx_masking    = s->avctx->temporal_cplx_masking;
-    const float spatial_cplx_masking = s->avctx->spatial_cplx_masking;
-    const float p_masking            = s->avctx->p_masking;
-    const float border_masking       = s->avctx->border_masking;
-    float bits_sum                   = 0.0;
-    float cplx_sum                   = 0.0;
-    float *cplx_tab                  = s->cplx_tab;
-    float *bits_tab                  = s->bits_tab;
-    const int qmin                   = s->avctx->mb_lmin;
-    const int qmax                   = s->avctx->mb_lmax;
-    Picture *const pic               = &s->current_picture;
-    const int mb_width               = s->mb_width;
-    const int mb_height              = s->mb_height;
-
-    for (i = 0; i < s->mb_num; i++) {
-        const int mb_xy = s->mb_index2xy[i];
-        float temp_cplx = sqrt(pic->mc_mb_var[mb_xy]); // FIXME merge in pow()
-        float spat_cplx = sqrt(pic->mb_var[mb_xy]);
-        const int lumi  = pic->mb_mean[mb_xy];
-        float bits, cplx, factor;
-        int mb_x = mb_xy % s->mb_stride;
-        int mb_y = mb_xy / s->mb_stride;
-        int mb_distance;
-        float mb_factor = 0.0;
-        if (spat_cplx < 4)
-            spat_cplx = 4;              // FIXME finetune
-        if (temp_cplx < 4)
-            temp_cplx = 4;              // FIXME finetune
-
-        if ((s->mb_type[mb_xy] & CANDIDATE_MB_TYPE_INTRA)) { // FIXME hq mode
-            cplx   = spat_cplx;
-            factor = 1.0 + p_masking;
-        } else {
-            cplx   = temp_cplx;
-            factor = pow(temp_cplx, -temp_cplx_masking);
-        }
-        factor *= pow(spat_cplx, -spatial_cplx_masking);
-
-        if (lumi > 127)
-            factor *= (1.0 - (lumi - 128) * (lumi - 128) * lumi_masking);
-        else
-            factor *= (1.0 - (lumi - 128) * (lumi - 128) * dark_masking);
-
-        if (mb_x < mb_width / 5) {
-            mb_distance = mb_width / 5 - mb_x;
-            mb_factor   = (float)mb_distance / (float)(mb_width / 5);
-        } else if (mb_x > 4 * mb_width / 5) {
-            mb_distance = mb_x - 4 * mb_width / 5;
-            mb_factor   = (float)mb_distance / (float)(mb_width / 5);
-        }
-        if (mb_y < mb_height / 5) {
-            mb_distance = mb_height / 5 - mb_y;
-            mb_factor   = FFMAX(mb_factor,
-                                (float)mb_distance / (float)(mb_height / 5));
-        } else if (mb_y > 4 * mb_height / 5) {
-            mb_distance = mb_y - 4 * mb_height / 5;
-            mb_factor   = FFMAX(mb_factor,
-                                (float)mb_distance / (float)(mb_height / 5));
-        }
-
-        factor *= 1.0 - border_masking * mb_factor;
-
-        if (factor < 0.00001)
-            factor = 0.00001;
-
-        bits        = cplx * factor;
-        cplx_sum   += cplx;
-        bits_sum   += bits;
-        cplx_tab[i] = cplx;
-        bits_tab[i] = bits;
-    }
-
-    /* handle qmin/qmax clipping */
-    if (s->flags & CODEC_FLAG_NORMALIZE_AQP) {
-        float factor = bits_sum / cplx_sum;
-        for (i = 0; i < s->mb_num; i++) {
-            float newq = q * cplx_tab[i] / bits_tab[i];
-            newq *= factor;
-
-            if (newq > qmax) {
-                bits_sum -= bits_tab[i];
-                cplx_sum -= cplx_tab[i] * q / qmax;
-            } else if (newq < qmin) {
-                bits_sum -= bits_tab[i];
-                cplx_sum -= cplx_tab[i] * q / qmin;
-            }
-        }
-        if (bits_sum < 0.001)
-            bits_sum = 0.001;
-        if (cplx_sum < 0.001)
-            cplx_sum = 0.001;
-    }
-
-    for (i = 0; i < s->mb_num; i++) {
-        const int mb_xy = s->mb_index2xy[i];
-        float newq      = q * cplx_tab[i] / bits_tab[i];
-        int intq;
-
-        if (s->flags & CODEC_FLAG_NORMALIZE_AQP) {
-            newq *= bits_sum / cplx_sum;
-        }
-
-        intq = (int)(newq + 0.5);
-
-        if (intq > qmax)
-            intq = qmax;
-        else if (intq < qmin)
-            intq = qmin;
-        s->lambda_table[mb_xy] = intq;
-    }
-}
-
-void ff_get_2pass_fcode(MpegEncContext *s)
-{
-    RateControlContext *rcc = &s->rc_context;
-    RateControlEntry *rce   = &rcc->entry[s->picture_number];
-
-    s->f_code = rce->f_code;
-    s->b_code = rce->b_code;
-}
-
-// FIXME rd or at least approx for dquant
-
-float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
-{
-    float q;
-    int qmin, qmax;
-    float br_compensation;
-    double diff;
-    double short_term_q;
-    double fps;
-    int picture_number = s->picture_number;
-    int64_t wanted_bits;
-    RateControlContext *rcc = &s->rc_context;
-    AVCodecContext *a       = s->avctx;
-    RateControlEntry local_rce, *rce;
-    double bits;
-    double rate_factor;
-    int var;
-    const int pict_type = s->pict_type;
-    Picture * const pic = &s->current_picture;
-    emms_c();
-
-#if CONFIG_LIBXVID
-    if ((s->flags & CODEC_FLAG_PASS2) &&
-        s->avctx->rc_strategy == FF_RC_STRATEGY_XVID)
-        return ff_xvid_rate_estimate_qscale(s, dry_run);
-#endif
-
-    get_qminmax(&qmin, &qmax, s, pict_type);
-
-    fps = 1 / av_q2d(s->avctx->time_base);
-    /* update predictors */
-    if (picture_number > 2 && !dry_run) {
-        const int last_var = s->last_pict_type == AV_PICTURE_TYPE_I ? rcc->last_mb_var_sum
-                                                                    : rcc->last_mc_mb_var_sum;
-        update_predictor(&rcc->pred[s->last_pict_type],
-                         rcc->last_qscale,
-                         sqrt(last_var), s->frame_bits);
-    }
-
-    if (s->flags & CODEC_FLAG_PASS2) {
-        assert(picture_number >= 0);
-        assert(picture_number < rcc->num_entries);
-        rce         = &rcc->entry[picture_number];
-        wanted_bits = rce->expected_bits;
-    } else {
-        Picture *dts_pic;
-        rce = &local_rce;
-
-        /* FIXME add a dts field to AVFrame and ensure it is set and use it
-         * here instead of reordering but the reordering is simpler for now
-         * until H.264 B-pyramid must be handled. */
-        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay)
-            dts_pic = s->current_picture_ptr;
-        else
-            dts_pic = s->last_picture_ptr;
-
-        if (!dts_pic || dts_pic->f.pts == AV_NOPTS_VALUE)
-            wanted_bits = (uint64_t)(s->bit_rate * (double)picture_number / fps);
-        else
-            wanted_bits = (uint64_t)(s->bit_rate * (double)dts_pic->f.pts / fps);
-    }
-
-    diff = s->total_bits - wanted_bits;
-    br_compensation = (a->bit_rate_tolerance - diff) / a->bit_rate_tolerance;
-    if (br_compensation <= 0.0)
-        br_compensation = 0.001;
-
-    var = pict_type == AV_PICTURE_TYPE_I ? pic->mb_var_sum : pic->mc_mb_var_sum;
-
-    short_term_q = 0; /* avoid warning */
-    if (s->flags & CODEC_FLAG_PASS2) {
-        if (pict_type != AV_PICTURE_TYPE_I)
-            assert(pict_type == rce->new_pict_type);
-
-        q = rce->new_qscale / br_compensation;
-        av_dlog(s, "%f %f %f last:%d var:%d type:%d//\n", q, rce->new_qscale,
-                br_compensation, s->frame_bits, var, pict_type);
-    } else {
-        rce->pict_type     =
-        rce->new_pict_type = pict_type;
-        rce->mc_mb_var_sum = pic->mc_mb_var_sum;
-        rce->mb_var_sum    = pic->mb_var_sum;
-        rce->qscale        = FF_QP2LAMBDA * 2;
-        rce->f_code        = s->f_code;
-        rce->b_code        = s->b_code;
-        rce->misc_bits     = 1;
-
-        bits = predict_size(&rcc->pred[pict_type], rce->qscale, sqrt(var));
-        if (pict_type == AV_PICTURE_TYPE_I) {
-            rce->i_count    = s->mb_num;
-            rce->i_tex_bits = bits;
-            rce->p_tex_bits = 0;
-            rce->mv_bits    = 0;
-        } else {
-            rce->i_count    = 0;    // FIXME we do know this approx
-            rce->i_tex_bits = 0;
-            rce->p_tex_bits = bits * 0.9;
-            rce->mv_bits    = bits * 0.1;
-        }
-        rcc->i_cplx_sum[pict_type]  += rce->i_tex_bits * rce->qscale;
-        rcc->p_cplx_sum[pict_type]  += rce->p_tex_bits * rce->qscale;
-        rcc->mv_bits_sum[pict_type] += rce->mv_bits;
-        rcc->frame_count[pict_type]++;
-
-        bits        = rce->i_tex_bits + rce->p_tex_bits;
-        rate_factor = rcc->pass1_wanted_bits /
-                      rcc->pass1_rc_eq_output_sum * br_compensation;
-
-        q = get_qscale(s, rce, rate_factor, picture_number);
-        if (q < 0)
-            return -1;
-
-        assert(q > 0.0);
-        q = get_diff_limited_q(s, rce, q);
-        assert(q > 0.0);
-
-        // FIXME type dependent blur like in 2-pass
-        if (pict_type == AV_PICTURE_TYPE_P || s->intra_only) {
-            rcc->short_term_qsum   *= a->qblur;
-            rcc->short_term_qcount *= a->qblur;
-
-            rcc->short_term_qsum += q;
-            rcc->short_term_qcount++;
-            q = short_term_q = rcc->short_term_qsum / rcc->short_term_qcount;
-        }
-        assert(q > 0.0);
-
-        q = modify_qscale(s, rce, q, picture_number);
-
-        rcc->pass1_wanted_bits += s->bit_rate / fps;
-
-        assert(q > 0.0);
-    }
-
-    if (s->avctx->debug & FF_DEBUG_RC) {
-        av_log(s->avctx, AV_LOG_DEBUG,
-               "%c qp:%d<%2.1f<%d %d want:%d total:%d comp:%f st_q:%2.2f "
-               "size:%d var:%d/%d br:%d fps:%d\n",
-               av_get_picture_type_char(pict_type),
-               qmin, q, qmax, picture_number,
-               (int)wanted_bits / 1000, (int)s->total_bits / 1000,
-               br_compensation, short_term_q, s->frame_bits,
-               pic->mb_var_sum, pic->mc_mb_var_sum,
-               s->bit_rate / 1000, (int)fps);
-    }
-
-    if (q < qmin)
-        q = qmin;
-    else if (q > qmax)
-        q = qmax;
-
-    if (s->adaptive_quant)
-        adaptive_quantization(s, q);
-    else
-        q = (int)(q + 0.5);
-
-    if (!dry_run) {
-        rcc->last_qscale        = q;
-        rcc->last_mc_mb_var_sum = pic->mc_mb_var_sum;
-        rcc->last_mb_var_sum    = pic->mb_var_sum;
-    }
-    return q;
-}
-
-// ----------------------------------------------
-// 2-Pass code
-
-static int init_pass2(MpegEncContext *s)
-{
-    RateControlContext *rcc = &s->rc_context;
-    AVCodecContext *a       = s->avctx;
-    int i, toobig;
-    double fps             = 1 / av_q2d(s->avctx->time_base);
-    double complexity[5]   = { 0 }; // approximate bits at quant=1
-    uint64_t const_bits[5] = { 0 }; // quantizer independent bits
-    uint64_t all_const_bits;
-    uint64_t all_available_bits = (uint64_t)(s->bit_rate *
-                                             (double)rcc->num_entries / fps);
-    double rate_factor          = 0;
-    double step;
-    const int filter_size = (int)(a->qblur * 4) | 1;
-    double expected_bits;
-    double *qscale, *blurred_qscale, qscale_sum;
-
-    /* find complexity & const_bits & decide the pict_types */
-    for (i = 0; i < rcc->num_entries; i++) {
-        RateControlEntry *rce = &rcc->entry[i];
-
-        rce->new_pict_type                = rce->pict_type;
-        rcc->i_cplx_sum[rce->pict_type]  += rce->i_tex_bits * rce->qscale;
-        rcc->p_cplx_sum[rce->pict_type]  += rce->p_tex_bits * rce->qscale;
-        rcc->mv_bits_sum[rce->pict_type] += rce->mv_bits;
-        rcc->frame_count[rce->pict_type]++;
-
-        complexity[rce->new_pict_type] += (rce->i_tex_bits + rce->p_tex_bits) *
-                                          (double)rce->qscale;
-        const_bits[rce->new_pict_type] += rce->mv_bits + rce->misc_bits;
-    }
-
-    all_const_bits = const_bits[AV_PICTURE_TYPE_I] +
-                     const_bits[AV_PICTURE_TYPE_P] +
-                     const_bits[AV_PICTURE_TYPE_B];
-
-    if (all_available_bits < all_const_bits) {
-        av_log(s->avctx, AV_LOG_ERROR, "requested bitrate is too low\n");
-        return -1;
-    }
-
-    qscale         = av_malloc(sizeof(double) * rcc->num_entries);
-    blurred_qscale = av_malloc(sizeof(double) * rcc->num_entries);
-    toobig = 0;
-
-    for (step = 256 * 256; step > 0.0000001; step *= 0.5) {
-        expected_bits = 0;
-        rate_factor  += step;
-
-        rcc->buffer_index = s->avctx->rc_buffer_size / 2;
-
-        /* find qscale */
-        for (i = 0; i < rcc->num_entries; i++) {
-            RateControlEntry *rce = &rcc->entry[i];
-
-            qscale[i] = get_qscale(s, &rcc->entry[i], rate_factor, i);
-            rcc->last_qscale_for[rce->pict_type] = qscale[i];
-        }
-        assert(filter_size % 2 == 1);
-
-        /* fixed I/B QP relative to P mode */
-        for (i = rcc->num_entries - 1; i >= 0; i--) {
-            RateControlEntry *rce = &rcc->entry[i];
-
-            qscale[i] = get_diff_limited_q(s, rce, qscale[i]);
-        }
-
-        /* smooth curve */
-        for (i = 0; i < rcc->num_entries; i++) {
-            RateControlEntry *rce = &rcc->entry[i];
-            const int pict_type   = rce->new_pict_type;
-            int j;
-            double q = 0.0, sum = 0.0;
-
-            for (j = 0; j < filter_size; j++) {
-                int index    = i + j - filter_size / 2;
-                double d     = index - i;
-                double coeff = a->qblur == 0 ? 1.0 : exp(-d * d / (a->qblur * a->qblur));
-
-                if (index < 0 || index >= rcc->num_entries)
-                    continue;
-                if (pict_type != rcc->entry[index].new_pict_type)
-                    continue;
-                q   += qscale[index] * coeff;
-                sum += coeff;
-            }
-            blurred_qscale[i] = q / sum;
-        }
-
-        /* find expected bits */
-        for (i = 0; i < rcc->num_entries; i++) {
-            RateControlEntry *rce = &rcc->entry[i];
-            double bits;
-
-            rce->new_qscale = modify_qscale(s, rce, blurred_qscale[i], i);
-
-            bits  = qp2bits(rce, rce->new_qscale) + rce->mv_bits + rce->misc_bits;
-            bits += 8 * ff_vbv_update(s, bits);
-
-            rce->expected_bits = expected_bits;
-            expected_bits     += bits;
-        }
-
-        av_dlog(s->avctx,
-                "expected_bits: %f all_available_bits: %d rate_factor: %f\n",
-                expected_bits, (int)all_available_bits, rate_factor);
-        if (expected_bits > all_available_bits) {
-            rate_factor -= step;
-            ++toobig;
-        }
-    }
-    av_free(qscale);
-    av_free(blurred_qscale);
-
-    /* check bitrate calculations and print info */
-    qscale_sum = 0.0;
-    for (i = 0; i < rcc->num_entries; i++) {
-        av_dlog(s, "[lavc rc] entry[%d].new_qscale = %.3f  qp = %.3f\n",
-                i,
-                rcc->entry[i].new_qscale,
-                rcc->entry[i].new_qscale / FF_QP2LAMBDA);
-        qscale_sum += av_clip(rcc->entry[i].new_qscale / FF_QP2LAMBDA,
-                              s->avctx->qmin, s->avctx->qmax);
-    }
-    assert(toobig <= 40);
-    av_log(s->avctx, AV_LOG_DEBUG,
-           "[lavc rc] requested bitrate: %d bps  expected bitrate: %d bps\n",
-           s->bit_rate,
-           (int)(expected_bits / ((double)all_available_bits / s->bit_rate)));
-    av_log(s->avctx, AV_LOG_DEBUG,
-           "[lavc rc] estimated target average qp: %.3f\n",
-           (float)qscale_sum / rcc->num_entries);
-    if (toobig == 0) {
-        av_log(s->avctx, AV_LOG_INFO,
-               "[lavc rc] Using all of requested bitrate is not "
-               "necessary for this video with these parameters.\n");
-    } else if (toobig == 40) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "[lavc rc] Error: bitrate too low for this video "
-               "with these parameters.\n");
-        return -1;
-    } else if (fabs(expected_bits / all_available_bits - 1.0) > 0.01) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "[lavc rc] Error: 2pass curve failed to converge\n");
-        return -1;
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/ratecontrol.h b/deps/libav/libavcodec/ratecontrol.h
deleted file mode 100644
index 63ebeb2..0000000
--- a/deps/libav/libavcodec/ratecontrol.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Ratecontrol
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_RATECONTROL_H
-#define AVCODEC_RATECONTROL_H
-
-/**
- * @file
- * ratecontrol header.
- */
-
-#include <stdio.h>
-#include <stdint.h>
-#include "libavutil/eval.h"
-
-typedef struct Predictor{
-    double coeff;
-    double count;
-    double decay;
-} Predictor;
-
-typedef struct RateControlEntry{
-    int pict_type;
-    float qscale;
-    int mv_bits;
-    int i_tex_bits;
-    int p_tex_bits;
-    int misc_bits;
-    int header_bits;
-    uint64_t expected_bits;
-    int new_pict_type;
-    float new_qscale;
-    int mc_mb_var_sum;
-    int mb_var_sum;
-    int i_count;
-    int skip_count;
-    int f_code;
-    int b_code;
-}RateControlEntry;
-
-/**
- * rate control context.
- */
-typedef struct RateControlContext{
-    int num_entries;              ///< number of RateControlEntries
-    RateControlEntry *entry;
-    double buffer_index;          ///< amount of bits in the video/audio buffer
-    Predictor pred[5];
-    double short_term_qsum;       ///< sum of recent qscales
-    double short_term_qcount;     ///< count of recent qscales
-    double pass1_rc_eq_output_sum;///< sum of the output of the rc equation, this is used for normalization
-    double pass1_wanted_bits;     ///< bits which should have been outputed by the pass1 code (including complexity init)
-    double last_qscale;
-    double last_qscale_for[5];    ///< last qscale for a specific pict type, used for max_diff & ipb factor stuff
-    int last_mc_mb_var_sum;
-    int last_mb_var_sum;
-    uint64_t i_cplx_sum[5];
-    uint64_t p_cplx_sum[5];
-    uint64_t mv_bits_sum[5];
-    uint64_t qscale_sum[5];
-    int frame_count[5];
-    int last_non_b_pict_type;
-
-    void *non_lavc_opaque;        ///< context for non lavc rc code (for example xvid)
-    float dry_run_qscale;         ///< for xvid rc
-    int last_picture_number;      ///< for xvid rc
-    AVExpr * rc_eq_eval;
-}RateControlContext;
-
-struct MpegEncContext;
-
-/* rate control */
-int ff_rate_control_init(struct MpegEncContext *s);
-float ff_rate_estimate_qscale(struct MpegEncContext *s, int dry_run);
-void ff_write_pass1_stats(struct MpegEncContext *s);
-void ff_rate_control_uninit(struct MpegEncContext *s);
-int ff_vbv_update(struct MpegEncContext *s, int frame_size);
-void ff_get_2pass_fcode(struct MpegEncContext *s);
-
-int ff_xvid_rate_control_init(struct MpegEncContext *s);
-void ff_xvid_rate_control_uninit(struct MpegEncContext *s);
-float ff_xvid_rate_estimate_qscale(struct MpegEncContext *s, int dry_run);
-
-#endif /* AVCODEC_RATECONTROL_H */
diff --git a/deps/libav/libavcodec/raw.c b/deps/libav/libavcodec/raw.c
deleted file mode 100644
index 4ccc6cc..0000000
--- a/deps/libav/libavcodec/raw.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Raw Video Codec
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Raw Video Codec
- */
-
-#include "avcodec.h"
-#include "raw.h"
-#include "libavutil/common.h"
-
-const PixelFormatTag ff_raw_pix_fmt_tags[] = {
-    { AV_PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
-    { AV_PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') },
-    { AV_PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') },
-    { AV_PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') },
-    { AV_PIX_FMT_YUV410P, MKTAG('Y', 'V', 'U', '9') },
-    { AV_PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') },
-    { AV_PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') },
-    { AV_PIX_FMT_YUV422P, MKTAG('P', '4', '2', '2') },
-    { AV_PIX_FMT_YUV422P, MKTAG('Y', 'V', '1', '6') },
-    /* yuvjXXX formats are deprecated hacks specific to libav*,
-       they are identical to yuvXXX  */
-    { AV_PIX_FMT_YUVJ420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
-    { AV_PIX_FMT_YUVJ420P, MKTAG('I', 'Y', 'U', 'V') },
-    { AV_PIX_FMT_YUVJ420P, MKTAG('Y', 'V', '1', '2') },
-    { AV_PIX_FMT_YUVJ422P, MKTAG('Y', '4', '2', 'B') },
-    { AV_PIX_FMT_YUVJ422P, MKTAG('P', '4', '2', '2') },
-    { AV_PIX_FMT_GRAY8,    MKTAG('Y', '8', '0', '0') },
-    { AV_PIX_FMT_GRAY8,    MKTAG('Y', '8', ' ', ' ') },
-
-    { AV_PIX_FMT_YUYV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */
-    { AV_PIX_FMT_YUYV422, MKTAG('Y', '4', '2', '2') },
-    { AV_PIX_FMT_YUYV422, MKTAG('V', '4', '2', '2') },
-    { AV_PIX_FMT_YUYV422, MKTAG('V', 'Y', 'U', 'Y') },
-    { AV_PIX_FMT_YUYV422, MKTAG('Y', 'U', 'N', 'V') },
-    { AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') },
-    { AV_PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') },
-    { AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'V') },
-    { AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'Y') },
-    { AV_PIX_FMT_UYVY422, MKTAG('u', 'y', 'v', '1') },
-    { AV_PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', '1') },
-    { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', 'R', 'n') }, /* Avid AVI Codec 1:1 */
-    { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', '1', 'x') }, /* Avid 1:1x */
-    { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', 'u', 'p') },
-    { AV_PIX_FMT_UYVY422, MKTAG('V', 'D', 'T', 'Z') }, /* SoftLab-NSK VideoTizer */
-    { AV_PIX_FMT_UYVY422, MKTAG('a', 'u', 'v', '2') },
-    { AV_PIX_FMT_UYYVYY411, MKTAG('Y', '4', '1', '1') },
-    { AV_PIX_FMT_GRAY8,   MKTAG('G', 'R', 'E', 'Y') },
-    { AV_PIX_FMT_NV12,    MKTAG('N', 'V', '1', '2') },
-    { AV_PIX_FMT_NV21,    MKTAG('N', 'V', '2', '1') },
-
-    /* nut */
-    { AV_PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) },
-    { AV_PIX_FMT_BGR555LE, MKTAG('B', 'G', 'R', 15) },
-    { AV_PIX_FMT_RGB565LE, MKTAG('R', 'G', 'B', 16) },
-    { AV_PIX_FMT_BGR565LE, MKTAG('B', 'G', 'R', 16) },
-    { AV_PIX_FMT_RGB555BE, MKTAG(15 , 'B', 'G', 'R') },
-    { AV_PIX_FMT_BGR555BE, MKTAG(15 , 'R', 'G', 'B') },
-    { AV_PIX_FMT_RGB565BE, MKTAG(16 , 'B', 'G', 'R') },
-    { AV_PIX_FMT_BGR565BE, MKTAG(16 , 'R', 'G', 'B') },
-    { AV_PIX_FMT_RGB444LE, MKTAG('R', 'G', 'B', 12) },
-    { AV_PIX_FMT_BGR444LE, MKTAG('B', 'G', 'R', 12) },
-    { AV_PIX_FMT_RGB444BE, MKTAG(12 , 'B', 'G', 'R') },
-    { AV_PIX_FMT_BGR444BE, MKTAG(12 , 'R', 'G', 'B') },
-    { AV_PIX_FMT_RGBA,     MKTAG('R', 'G', 'B', 'A') },
-    { AV_PIX_FMT_BGRA,     MKTAG('B', 'G', 'R', 'A') },
-    { AV_PIX_FMT_ABGR,     MKTAG('A', 'B', 'G', 'R') },
-    { AV_PIX_FMT_ARGB,     MKTAG('A', 'R', 'G', 'B') },
-    { AV_PIX_FMT_RGB24,    MKTAG('R', 'G', 'B', 24 ) },
-    { AV_PIX_FMT_BGR24,    MKTAG('B', 'G', 'R', 24 ) },
-    { AV_PIX_FMT_YUV411P,  MKTAG('4', '1', '1', 'P') },
-    { AV_PIX_FMT_YUV422P,  MKTAG('4', '2', '2', 'P') },
-    { AV_PIX_FMT_YUVJ422P, MKTAG('4', '2', '2', 'P') },
-    { AV_PIX_FMT_YUV440P,  MKTAG('4', '4', '0', 'P') },
-    { AV_PIX_FMT_YUVJ440P, MKTAG('4', '4', '0', 'P') },
-    { AV_PIX_FMT_YUV444P,  MKTAG('4', '4', '4', 'P') },
-    { AV_PIX_FMT_YUVJ444P, MKTAG('4', '4', '4', 'P') },
-    { AV_PIX_FMT_MONOWHITE,MKTAG('B', '1', 'W', '0') },
-    { AV_PIX_FMT_MONOBLACK,MKTAG('B', '0', 'W', '1') },
-    { AV_PIX_FMT_BGR8,     MKTAG('B', 'G', 'R',  8 ) },
-    { AV_PIX_FMT_RGB8,     MKTAG('R', 'G', 'B',  8 ) },
-    { AV_PIX_FMT_BGR4,     MKTAG('B', 'G', 'R',  4 ) },
-    { AV_PIX_FMT_RGB4,     MKTAG('R', 'G', 'B',  4 ) },
-    { AV_PIX_FMT_RGB4_BYTE,MKTAG('B', '4', 'B', 'Y') },
-    { AV_PIX_FMT_BGR4_BYTE,MKTAG('R', '4', 'B', 'Y') },
-    { AV_PIX_FMT_RGB48LE,  MKTAG('R', 'G', 'B', 48 ) },
-    { AV_PIX_FMT_RGB48BE,  MKTAG( 48, 'R', 'G', 'B') },
-    { AV_PIX_FMT_BGR48LE,  MKTAG('B', 'G', 'R', 48 ) },
-    { AV_PIX_FMT_BGR48BE,  MKTAG( 48, 'B', 'G', 'R') },
-    { AV_PIX_FMT_GRAY16LE,    MKTAG('Y', '1',  0 , 16 ) },
-    { AV_PIX_FMT_GRAY16BE,    MKTAG(16 ,  0 , '1', 'Y') },
-    { AV_PIX_FMT_YUV420P10LE, MKTAG('Y', '3', 11 , 10 ) },
-    { AV_PIX_FMT_YUV420P10BE, MKTAG(10 , 11 , '3', 'Y') },
-    { AV_PIX_FMT_YUV422P10LE, MKTAG('Y', '3', 10 , 10 ) },
-    { AV_PIX_FMT_YUV422P10BE, MKTAG(10 , 10 , '3', 'Y') },
-    { AV_PIX_FMT_YUV444P10LE, MKTAG('Y', '3',  0 , 10 ) },
-    { AV_PIX_FMT_YUV444P10BE, MKTAG(10 ,  0 , '3', 'Y') },
-    { AV_PIX_FMT_YUV420P16LE, MKTAG('Y', '3', 11 , 16 ) },
-    { AV_PIX_FMT_YUV420P16BE, MKTAG(16 , 11 , '3', 'Y') },
-    { AV_PIX_FMT_YUV422P16LE, MKTAG('Y', '3', 10 , 16 ) },
-    { AV_PIX_FMT_YUV422P16BE, MKTAG(16 , 10 , '3', 'Y') },
-    { AV_PIX_FMT_YUV444P16LE, MKTAG('Y', '3',  0 , 16 ) },
-    { AV_PIX_FMT_YUV444P16BE, MKTAG(16 ,  0 , '3', 'Y') },
-    { AV_PIX_FMT_YUVA420P,    MKTAG('Y', '4', 11 ,  8 ) },
-    { AV_PIX_FMT_Y400A,       MKTAG('Y', '2',  0 ,  8 ) },
-
-    { AV_PIX_FMT_YUVA420P9LE,  MKTAG('Y', '4', 11 ,  9 ) },
-    { AV_PIX_FMT_YUVA420P9BE,  MKTAG( 9 , 11 , '4', 'Y') },
-    { AV_PIX_FMT_YUVA422P9LE,  MKTAG('Y', '4', 10 ,  9 ) },
-    { AV_PIX_FMT_YUVA422P9BE,  MKTAG( 9 , 10 , '4', 'Y') },
-    { AV_PIX_FMT_YUVA444P9LE,  MKTAG('Y', '4',  0 ,  9 ) },
-    { AV_PIX_FMT_YUVA444P9BE,  MKTAG( 9 ,  0 , '4', 'Y') },
-    { AV_PIX_FMT_YUVA420P10LE, MKTAG('Y', '4', 11 , 10 ) },
-    { AV_PIX_FMT_YUVA420P10BE, MKTAG(10 , 11 , '4', 'Y') },
-    { AV_PIX_FMT_YUVA422P10LE, MKTAG('Y', '4', 10 , 10 ) },
-    { AV_PIX_FMT_YUVA422P10BE, MKTAG(10 , 10 , '4', 'Y') },
-    { AV_PIX_FMT_YUVA444P10LE, MKTAG('Y', '4',  0 , 10 ) },
-    { AV_PIX_FMT_YUVA444P10BE, MKTAG(10 ,  0 , '4', 'Y') },
-    { AV_PIX_FMT_YUVA420P16LE, MKTAG('Y', '4', 11 , 16 ) },
-    { AV_PIX_FMT_YUVA420P16BE, MKTAG(16 , 11 , '4', 'Y') },
-    { AV_PIX_FMT_YUVA422P16LE, MKTAG('Y', '4', 10 , 16 ) },
-    { AV_PIX_FMT_YUVA422P16BE, MKTAG(16 , 10 , '4', 'Y') },
-    { AV_PIX_FMT_YUVA444P16LE, MKTAG('Y', '4',  0 , 16 ) },
-    { AV_PIX_FMT_YUVA444P16BE, MKTAG(16 ,  0 , '4', 'Y') },
-
-    /* quicktime */
-    { AV_PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
-    { AV_PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', 'y') },
-    { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */
-    { AV_PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') },
-    { AV_PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', 's') },
-    { AV_PIX_FMT_YUYV422, MKTAG('D', 'V', 'O', 'O') }, /* Digital Voodoo SD 8 Bit */
-    { AV_PIX_FMT_RGB555LE,MKTAG('L', '5', '5', '5') },
-    { AV_PIX_FMT_RGB565LE,MKTAG('L', '5', '6', '5') },
-    { AV_PIX_FMT_RGB565BE,MKTAG('B', '5', '6', '5') },
-    { AV_PIX_FMT_BGR24,   MKTAG('2', '4', 'B', 'G') },
-    { AV_PIX_FMT_BGRA,    MKTAG('B', 'G', 'R', 'A') },
-    { AV_PIX_FMT_RGBA,    MKTAG('R', 'G', 'B', 'A') },
-    { AV_PIX_FMT_ABGR,    MKTAG('A', 'B', 'G', 'R') },
-    { AV_PIX_FMT_GRAY16BE,MKTAG('b', '1', '6', 'g') },
-    { AV_PIX_FMT_RGB48BE, MKTAG('b', '4', '8', 'r') },
-
-    /* special */
-    { AV_PIX_FMT_RGB565LE,MKTAG( 3 ,  0 ,  0 ,  0 ) }, /* flipped RGB565LE */
-    { AV_PIX_FMT_YUV444P, MKTAG('Y', 'V', '2', '4') }, /* YUV444P, swapped UV */
-
-    { AV_PIX_FMT_NONE, 0 },
-};
-
-unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat fmt)
-{
-    const PixelFormatTag *tags = ff_raw_pix_fmt_tags;
-    while (tags->pix_fmt >= 0) {
-        if (tags->pix_fmt == fmt)
-            return tags->fourcc;
-        tags++;
-    }
-    return 0;
-}
diff --git a/deps/libav/libavcodec/raw.h b/deps/libav/libavcodec/raw.h
deleted file mode 100644
index bf66671..0000000
--- a/deps/libav/libavcodec/raw.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Raw Video Codec
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Raw Video Codec
- */
-
-#ifndef AVCODEC_RAW_H
-#define AVCODEC_RAW_H
-
-#include "avcodec.h"
-
-typedef struct PixelFormatTag {
-    enum AVPixelFormat pix_fmt;
-    unsigned int fourcc;
-} PixelFormatTag;
-
-extern const PixelFormatTag ff_raw_pix_fmt_tags[];
-
-#endif /* AVCODEC_RAW_H */
diff --git a/deps/libav/libavcodec/rawdec.c b/deps/libav/libavcodec/rawdec.c
deleted file mode 100644
index a8227c7..0000000
--- a/deps/libav/libavcodec/rawdec.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Raw Video Decoder
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Raw Video Decoder
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "raw.h"
-#include "libavutil/buffer.h"
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-
-typedef struct RawVideoContext {
-    AVBufferRef *palette;
-    int frame_size;  /* size of the frame in bytes */
-    int flip;
-    int is_2_4_bpp; // 2 or 4 bpp raw in avi/mov
-    int is_yuv2;
-} RawVideoContext;
-
-static const PixelFormatTag pix_fmt_bps_avi[] = {
-    { AV_PIX_FMT_PAL8,    4 },
-    { AV_PIX_FMT_PAL8,    8 },
-    { AV_PIX_FMT_RGB444, 12 },
-    { AV_PIX_FMT_RGB555, 15 },
-    { AV_PIX_FMT_RGB555, 16 },
-    { AV_PIX_FMT_BGR24,  24 },
-    { AV_PIX_FMT_RGB32,  32 },
-    { AV_PIX_FMT_NONE,    0 },
-};
-
-static const PixelFormatTag pix_fmt_bps_mov[] = {
-    { AV_PIX_FMT_MONOWHITE, 1 },
-    { AV_PIX_FMT_PAL8,      2 },
-    { AV_PIX_FMT_PAL8,      4 },
-    { AV_PIX_FMT_PAL8,      8 },
-    // FIXME swscale does not support 16 bit in .mov, sample 16bit.mov
-    // http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
-    { AV_PIX_FMT_RGB555BE, 16 },
-    { AV_PIX_FMT_RGB24,    24 },
-    { AV_PIX_FMT_ARGB,     32 },
-    { AV_PIX_FMT_MONOWHITE,33 },
-    { AV_PIX_FMT_NONE,      0 },
-};
-
-static enum AVPixelFormat find_pix_fmt(const PixelFormatTag *tags,
-                                       unsigned int fourcc)
-{
-    while (tags->pix_fmt >= 0) {
-        if (tags->fourcc == fourcc)
-            return tags->pix_fmt;
-        tags++;
-    }
-    return AV_PIX_FMT_YUV420P;
-}
-
-static av_cold int raw_init_decoder(AVCodecContext *avctx)
-{
-    RawVideoContext *context = avctx->priv_data;
-    const AVPixFmtDescriptor *desc;
-
-    if (avctx->codec_tag == MKTAG('r', 'a', 'w', ' '))
-        avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_mov,
-                                      avctx->bits_per_coded_sample);
-    else if (avctx->codec_tag == MKTAG('W', 'R', 'A', 'W'))
-        avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi,
-                                      avctx->bits_per_coded_sample);
-    else if (avctx->codec_tag)
-        avctx->pix_fmt = find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag);
-    else if (avctx->pix_fmt == AV_PIX_FMT_NONE && avctx->bits_per_coded_sample)
-        avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi,
-                                      avctx->bits_per_coded_sample);
-
-    desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-    if (!desc) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid pixel format.\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (desc->flags & (AV_PIX_FMT_FLAG_PAL | AV_PIX_FMT_FLAG_PSEUDOPAL)) {
-        context->palette = av_buffer_alloc(AVPALETTE_SIZE);
-        if (!context->palette)
-            return AVERROR(ENOMEM);
-        if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)
-            avpriv_set_systematic_pal2((uint32_t*)context->palette->data, avctx->pix_fmt);
-        else
-            memset(context->palette->data, 0, AVPALETTE_SIZE);
-    }
-
-    context->frame_size = avpicture_get_size(avctx->pix_fmt, avctx->width,
-                                             avctx->height);
-    if ((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) &&
-        avctx->pix_fmt == AV_PIX_FMT_PAL8 &&
-       (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' ')))
-        context->is_2_4_bpp = 1;
-
-    if ((avctx->extradata_size >= 9 &&
-         !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9)) ||
-        avctx->codec_tag == MKTAG(3, 0, 0, 0) ||
-        avctx->codec_tag == MKTAG('W','R','A','W'))
-        context->flip = 1;
-
-    if (avctx->codec_tag == AV_RL32("yuv2") &&
-        avctx->pix_fmt   == AV_PIX_FMT_YUYV422)
-        context->is_yuv2 = 1;
-
-    return 0;
-}
-
-static void flip(AVCodecContext *avctx, AVPicture *picture)
-{
-    picture->data[0]     += picture->linesize[0] * (avctx->height - 1);
-    picture->linesize[0] *= -1;
-}
-
-static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
-                      AVPacket *avpkt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-    RawVideoContext *context       = avctx->priv_data;
-    const uint8_t *buf             = avpkt->data;
-    int buf_size                   = avpkt->size;
-    int need_copy                  = !avpkt->buf || context->is_2_4_bpp || context->is_yuv2;
-    int res;
-
-    AVFrame   *frame   = data;
-    AVPicture *picture = data;
-
-    frame->pict_type        = AV_PICTURE_TYPE_I;
-    frame->key_frame        = 1;
-    frame->reordered_opaque = avctx->reordered_opaque;
-    frame->pkt_pts          = avctx->internal->pkt->pts;
-
-    if (buf_size < context->frame_size - (avctx->pix_fmt == AV_PIX_FMT_PAL8 ?
-                                          AVPALETTE_SIZE : 0))
-        return -1;
-
-    if (need_copy)
-        frame->buf[0] = av_buffer_alloc(context->frame_size);
-    else
-        frame->buf[0] = av_buffer_ref(avpkt->buf);
-    if (!frame->buf[0])
-        return AVERROR(ENOMEM);
-
-    //2bpp and 4bpp raw in avi and mov (yes this is ugly ...)
-    if (context->is_2_4_bpp) {
-        int i;
-        uint8_t *dst = frame->buf[0]->data;
-        buf_size = context->frame_size - AVPALETTE_SIZE;
-        if (avctx->bits_per_coded_sample == 4) {
-            for (i = 0; 2 * i + 1 < buf_size; i++) {
-                dst[2 * i + 0] = buf[i] >> 4;
-                dst[2 * i + 1] = buf[i] & 15;
-            }
-        } else {
-            for (i = 0; 4 * i + 3 < buf_size; i++) {
-                dst[4 * i + 0] = buf[i] >> 6;
-                dst[4 * i + 1] = buf[i] >> 4 & 3;
-                dst[4 * i + 2] = buf[i] >> 2 & 3;
-                dst[4 * i + 3] = buf[i]      & 3;
-            }
-        }
-        buf = dst;
-    } else if (need_copy) {
-        memcpy(frame->buf[0]->data, buf, FFMIN(buf_size, context->frame_size));
-        buf = frame->buf[0]->data;
-    }
-
-    if (avctx->codec_tag == MKTAG('A', 'V', '1', 'x') ||
-        avctx->codec_tag == MKTAG('A', 'V', 'u', 'p'))
-        buf += buf_size - context->frame_size;
-
-    if ((res = avpicture_fill(picture, buf, avctx->pix_fmt,
-                              avctx->width, avctx->height)) < 0)
-        return res;
-
-    if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
-        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE,
-                                                     NULL);
-
-        if (pal) {
-            av_buffer_unref(&context->palette);
-            context->palette = av_buffer_alloc(AVPALETTE_SIZE);
-            if (!context->palette)
-                return AVERROR(ENOMEM);
-            memcpy(context->palette->data, pal, AVPALETTE_SIZE);
-            frame->palette_has_changed = 1;
-        }
-    }
-
-    if ((avctx->pix_fmt == AV_PIX_FMT_PAL8 && buf_size < context->frame_size) ||
-        (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)) {
-        frame->buf[1]  = av_buffer_ref(context->palette);
-        if (!frame->buf[1])
-            return AVERROR(ENOMEM);
-        frame->data[1] = frame->buf[1]->data;
-    }
-    if (avctx->pix_fmt == AV_PIX_FMT_BGR24 &&
-        ((frame->linesize[0] + 3) & ~3) * avctx->height <= buf_size)
-        frame->linesize[0] = (frame->linesize[0] + 3) & ~3;
-
-    if (context->flip)
-        flip(avctx, picture);
-
-    if (avctx->codec_tag == MKTAG('Y', 'V', '1', '2') ||
-        avctx->codec_tag == MKTAG('Y', 'V', '1', '6') ||
-        avctx->codec_tag == MKTAG('Y', 'V', '2', '4') ||
-        avctx->codec_tag == MKTAG('Y', 'V', 'U', '9'))
-        FFSWAP(uint8_t *, picture->data[1], picture->data[2]);
-
-    if (avctx->codec_tag == AV_RL32("yuv2") &&
-        avctx->pix_fmt   == AV_PIX_FMT_YUYV422) {
-        int x, y;
-        uint8_t *line = picture->data[0];
-        for (y = 0; y < avctx->height; y++) {
-            for (x = 0; x < avctx->width; x++)
-                line[2 * x + 1] ^= 0x80;
-            line += picture->linesize[0];
-        }
-    }
-
-    *got_frame = 1;
-    return buf_size;
-}
-
-static av_cold int raw_close_decoder(AVCodecContext *avctx)
-{
-    RawVideoContext *context = avctx->priv_data;
-
-    av_buffer_unref(&context->palette);
-    return 0;
-}
-
-AVCodec ff_rawvideo_decoder = {
-    .name           = "rawvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_RAWVIDEO,
-    .priv_data_size = sizeof(RawVideoContext),
-    .init           = raw_init_decoder,
-    .close          = raw_close_decoder,
-    .decode         = raw_decode,
-};
diff --git a/deps/libav/libavcodec/rawenc.c b/deps/libav/libavcodec/rawenc.c
deleted file mode 100644
index 6c90d33..0000000
--- a/deps/libav/libavcodec/rawenc.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Raw Video Encoder
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Raw Video Encoder
- */
-
-#include "avcodec.h"
-#include "raw.h"
-#include "internal.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/internal.h"
-
-static av_cold int raw_init_encoder(AVCodecContext *avctx)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-
-    avctx->coded_frame            = avctx->priv_data;
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-    avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc);
-    if(!avctx->codec_tag)
-        avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);
-    return 0;
-}
-
-static int raw_encode(AVCodecContext *avctx, AVPacket *pkt,
-                      const AVFrame *frame, int *got_packet)
-{
-    int ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
-
-    if (ret < 0)
-        return ret;
-
-    if ((ret = ff_alloc_packet(pkt, ret)) < 0)
-        return ret;
-    if ((ret = avpicture_layout((const AVPicture *)frame, avctx->pix_fmt, avctx->width,
-                                avctx->height, pkt->data, pkt->size)) < 0)
-        return ret;
-
-    if(avctx->codec_tag == AV_RL32("yuv2") && ret > 0 &&
-       avctx->pix_fmt   == AV_PIX_FMT_YUYV422) {
-        int x;
-        for(x = 1; x < avctx->height*avctx->width*2; x += 2)
-            pkt->data[x] ^= 0x80;
-    }
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-AVCodec ff_rawvideo_encoder = {
-    .name           = "rawvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_RAWVIDEO,
-    .priv_data_size = sizeof(AVFrame),
-    .init           = raw_init_encoder,
-    .encode2        = raw_encode,
-};
diff --git a/deps/libav/libavcodec/rdft.c b/deps/libav/libavcodec/rdft.c
deleted file mode 100644
index 54cf14a..0000000
--- a/deps/libav/libavcodec/rdft.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * (I)RDFT transforms
- * Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <stdlib.h>
-#include <math.h>
-#include "libavutil/mathematics.h"
-#include "rdft.h"
-
-/**
- * @file
- * (Inverse) Real Discrete Fourier Transforms.
- */
-
-/* sin(2*pi*x/n) for 0<=x<n/4, followed by n/2<=x<3n/4 */
-#if !CONFIG_HARDCODED_TABLES
-SINTABLE(16);
-SINTABLE(32);
-SINTABLE(64);
-SINTABLE(128);
-SINTABLE(256);
-SINTABLE(512);
-SINTABLE(1024);
-SINTABLE(2048);
-SINTABLE(4096);
-SINTABLE(8192);
-SINTABLE(16384);
-SINTABLE(32768);
-SINTABLE(65536);
-#endif
-static SINTABLE_CONST FFTSample * const ff_sin_tabs[] = {
-    NULL, NULL, NULL, NULL,
-    ff_sin_16, ff_sin_32, ff_sin_64, ff_sin_128, ff_sin_256, ff_sin_512, ff_sin_1024,
-    ff_sin_2048, ff_sin_4096, ff_sin_8192, ff_sin_16384, ff_sin_32768, ff_sin_65536,
-};
-
-/** Map one real FFT into two parallel real even and odd FFTs. Then interleave
- * the two real FFTs into one complex FFT. Unmangle the results.
- * ref: http://www.engineeringproductivitytools.com/stuff/T0001/PT10.HTM
- */
-static void rdft_calc_c(RDFTContext *s, FFTSample *data)
-{
-    int i, i1, i2;
-    FFTComplex ev, od;
-    const int n = 1 << s->nbits;
-    const float k1 = 0.5;
-    const float k2 = 0.5 - s->inverse;
-    const FFTSample *tcos = s->tcos;
-    const FFTSample *tsin = s->tsin;
-
-    if (!s->inverse) {
-        s->fft.fft_permute(&s->fft, (FFTComplex*)data);
-        s->fft.fft_calc(&s->fft, (FFTComplex*)data);
-    }
-    /* i=0 is a special case because of packing, the DC term is real, so we
-       are going to throw the N/2 term (also real) in with it. */
-    ev.re = data[0];
-    data[0] = ev.re+data[1];
-    data[1] = ev.re-data[1];
-    for (i = 1; i < (n>>2); i++) {
-        i1 = 2*i;
-        i2 = n-i1;
-        /* Separate even and odd FFTs */
-        ev.re =  k1*(data[i1  ]+data[i2  ]);
-        od.im = -k2*(data[i1  ]-data[i2  ]);
-        ev.im =  k1*(data[i1+1]-data[i2+1]);
-        od.re =  k2*(data[i1+1]+data[i2+1]);
-        /* Apply twiddle factors to the odd FFT and add to the even FFT */
-        data[i1  ] =  ev.re + od.re*tcos[i] - od.im*tsin[i];
-        data[i1+1] =  ev.im + od.im*tcos[i] + od.re*tsin[i];
-        data[i2  ] =  ev.re - od.re*tcos[i] + od.im*tsin[i];
-        data[i2+1] = -ev.im + od.im*tcos[i] + od.re*tsin[i];
-    }
-    data[2*i+1]=s->sign_convention*data[2*i+1];
-    if (s->inverse) {
-        data[0] *= k1;
-        data[1] *= k1;
-        s->fft.fft_permute(&s->fft, (FFTComplex*)data);
-        s->fft.fft_calc(&s->fft, (FFTComplex*)data);
-    }
-}
-
-av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
-{
-    int n = 1 << nbits;
-    int i;
-    const double theta = (trans == DFT_R2C || trans == DFT_C2R ? -1 : 1)*2*M_PI/n;
-
-    s->nbits           = nbits;
-    s->inverse         = trans == IDFT_C2R || trans == DFT_C2R;
-    s->sign_convention = trans == IDFT_R2C || trans == DFT_C2R ? 1 : -1;
-
-    if (nbits < 4 || nbits > 16)
-        return -1;
-
-    if (ff_fft_init(&s->fft, nbits-1, trans == IDFT_C2R || trans == IDFT_R2C) < 0)
-        return -1;
-
-    ff_init_ff_cos_tabs(nbits);
-    s->tcos = ff_cos_tabs[nbits];
-    s->tsin = ff_sin_tabs[nbits]+(trans == DFT_R2C || trans == DFT_C2R)*(n>>2);
-#if !CONFIG_HARDCODED_TABLES
-    for (i = 0; i < (n>>2); i++) {
-        s->tsin[i] = sin(i*theta);
-    }
-#endif
-    s->rdft_calc   = rdft_calc_c;
-
-    if (ARCH_ARM) ff_rdft_init_arm(s);
-
-    return 0;
-}
-
-av_cold void ff_rdft_end(RDFTContext *s)
-{
-    ff_fft_end(&s->fft);
-}
diff --git a/deps/libav/libavcodec/rdft.h b/deps/libav/libavcodec/rdft.h
deleted file mode 100644
index 8ff620f..0000000
--- a/deps/libav/libavcodec/rdft.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * (I)RDFT transforms
- * Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_RDFT_H
-#define AVCODEC_RDFT_H
-
-#include "config.h"
-#include "fft.h"
-
-#if CONFIG_HARDCODED_TABLES
-#   define SINTABLE_CONST const
-#else
-#   define SINTABLE_CONST
-#endif
-
-#define SINTABLE(size) \
-    SINTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_sin_##size)[size/2]
-
-extern SINTABLE(16);
-extern SINTABLE(32);
-extern SINTABLE(64);
-extern SINTABLE(128);
-extern SINTABLE(256);
-extern SINTABLE(512);
-extern SINTABLE(1024);
-extern SINTABLE(2048);
-extern SINTABLE(4096);
-extern SINTABLE(8192);
-extern SINTABLE(16384);
-extern SINTABLE(32768);
-extern SINTABLE(65536);
-
-struct RDFTContext {
-    int nbits;
-    int inverse;
-    int sign_convention;
-
-    /* pre/post rotation tables */
-    const FFTSample *tcos;
-    SINTABLE_CONST FFTSample *tsin;
-    FFTContext fft;
-    void (*rdft_calc)(struct RDFTContext *s, FFTSample *z);
-};
-
-/**
- * Set up a real FFT.
- * @param nbits           log2 of the length of the input array
- * @param trans           the type of transform
- */
-int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans);
-void ff_rdft_end(RDFTContext *s);
-
-void ff_rdft_init_arm(RDFTContext *s);
-
-
-#endif /* AVCODEC_RDFT_H */
diff --git a/deps/libav/libavcodec/rectangle.h b/deps/libav/libavcodec/rectangle.h
deleted file mode 100644
index 73e8b0a..0000000
--- a/deps/libav/libavcodec/rectangle.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * rectangle filling function
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * useful rectangle filling function
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVCODEC_RECTANGLE_H
-#define AVCODEC_RECTANGLE_H
-
-#include <assert.h>
-#include "config.h"
-#include "libavutil/common.h"
-
-/**
- * fill a rectangle.
- * @param h height of the rectangle, should be a constant
- * @param w width of the rectangle, should be a constant
- * @param size the size of val (1, 2 or 4), should be a constant
- */
-static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){
-    uint8_t *p= (uint8_t*)vp;
-    assert(size==1 || size==2 || size==4);
-    assert(w<=4);
-
-    w      *= size;
-    stride *= size;
-
-    assert((stride&(w-1))==0);
-    if(w==2){
-        const uint16_t v= size==4 ? val : val*0x0101;
-        *(uint16_t*)(p + 0*stride)= v;
-        if(h==1) return;
-        *(uint16_t*)(p + 1*stride)= v;
-        if(h==2) return;
-        *(uint16_t*)(p + 2*stride)= v;
-        *(uint16_t*)(p + 3*stride)= v;
-    }else if(w==4){
-        const uint32_t v= size==4 ? val : size==2 ? val*0x00010001 : val*0x01010101;
-        *(uint32_t*)(p + 0*stride)= v;
-        if(h==1) return;
-        *(uint32_t*)(p + 1*stride)= v;
-        if(h==2) return;
-        *(uint32_t*)(p + 2*stride)= v;
-        *(uint32_t*)(p + 3*stride)= v;
-    }else if(w==8){
-    //gcc can't optimize 64bit math on x86_32
-#if HAVE_FAST_64BIT
-        const uint64_t v=  size==2 ? val*0x0001000100010001ULL : val*0x0100000001ULL;
-        *(uint64_t*)(p + 0*stride)= v;
-        if(h==1) return;
-        *(uint64_t*)(p + 1*stride)= v;
-        if(h==2) return;
-        *(uint64_t*)(p + 2*stride)= v;
-        *(uint64_t*)(p + 3*stride)= v;
-    }else if(w==16){
-        const uint64_t v= val*0x0100000001ULL;
-        *(uint64_t*)(p + 0+0*stride)= v;
-        *(uint64_t*)(p + 8+0*stride)= v;
-        *(uint64_t*)(p + 0+1*stride)= v;
-        *(uint64_t*)(p + 8+1*stride)= v;
-        if(h==2) return;
-        *(uint64_t*)(p + 0+2*stride)= v;
-        *(uint64_t*)(p + 8+2*stride)= v;
-        *(uint64_t*)(p + 0+3*stride)= v;
-        *(uint64_t*)(p + 8+3*stride)= v;
-#else
-        const uint32_t v= size==2 ? val*0x00010001 : val;
-        *(uint32_t*)(p + 0+0*stride)= v;
-        *(uint32_t*)(p + 4+0*stride)= v;
-        if(h==1) return;
-        *(uint32_t*)(p + 0+1*stride)= v;
-        *(uint32_t*)(p + 4+1*stride)= v;
-        if(h==2) return;
-        *(uint32_t*)(p + 0+2*stride)= v;
-        *(uint32_t*)(p + 4+2*stride)= v;
-        *(uint32_t*)(p + 0+3*stride)= v;
-        *(uint32_t*)(p + 4+3*stride)= v;
-    }else if(w==16){
-        *(uint32_t*)(p + 0+0*stride)= val;
-        *(uint32_t*)(p + 4+0*stride)= val;
-        *(uint32_t*)(p + 8+0*stride)= val;
-        *(uint32_t*)(p +12+0*stride)= val;
-        *(uint32_t*)(p + 0+1*stride)= val;
-        *(uint32_t*)(p + 4+1*stride)= val;
-        *(uint32_t*)(p + 8+1*stride)= val;
-        *(uint32_t*)(p +12+1*stride)= val;
-        if(h==2) return;
-        *(uint32_t*)(p + 0+2*stride)= val;
-        *(uint32_t*)(p + 4+2*stride)= val;
-        *(uint32_t*)(p + 8+2*stride)= val;
-        *(uint32_t*)(p +12+2*stride)= val;
-        *(uint32_t*)(p + 0+3*stride)= val;
-        *(uint32_t*)(p + 4+3*stride)= val;
-        *(uint32_t*)(p + 8+3*stride)= val;
-        *(uint32_t*)(p +12+3*stride)= val;
-#endif
-    }else
-        assert(0);
-    assert(h==4);
-}
-
-#endif /* AVCODEC_RECTANGLE_H */
diff --git a/deps/libav/libavcodec/remove_extradata_bsf.c b/deps/libav/libavcodec/remove_extradata_bsf.c
deleted file mode 100644
index 460482a..0000000
--- a/deps/libav/libavcodec/remove_extradata_bsf.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-
-
-static int remove_extradata(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe){
-    int cmd= args ? *args : 0;
-    AVCodecParserContext *s;
-
-    if(!bsfc->parser){
-        bsfc->parser= av_parser_init(avctx->codec_id);
-    }
-    s= bsfc->parser;
-
-    if(s && s->parser->split){
-        if(  (((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)) && cmd=='a')
-           ||(!keyframe && cmd=='k')
-           ||(cmd=='e' || !cmd)
-          ){
-            int i= s->parser->split(avctx, buf, buf_size);
-            buf += i;
-            buf_size -= i;
-        }
-    }
-    *poutbuf= (uint8_t *) buf;
-    *poutbuf_size= buf_size;
-
-    return 0;
-}
-
-AVBitStreamFilter ff_remove_extradata_bsf={
-    "remove_extra",
-    0,
-    remove_extradata,
-};
diff --git a/deps/libav/libavcodec/rl.h b/deps/libav/libavcodec/rl.h
deleted file mode 100644
index 367cc98..0000000
--- a/deps/libav/libavcodec/rl.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2000-2002 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * rl header.
- */
-
-#ifndef AVCODEC_RL_H
-#define AVCODEC_RL_H
-
-#include <stdint.h>
-#include "get_bits.h"
-
-/* run length table */
-#define MAX_RUN    64
-#define MAX_LEVEL  64
-
-/** RLTable. */
-typedef struct RLTable {
-    int n;                         ///< number of entries of table_vlc minus 1
-    int last;                      ///< number of values for last = 0
-    const uint16_t (*table_vlc)[2];
-    const int8_t *table_run;
-    const int8_t *table_level;
-    uint8_t *index_run[2];         ///< encoding only
-    int8_t *max_level[2];          ///< encoding & decoding
-    int8_t *max_run[2];            ///< encoding & decoding
-    VLC vlc;                       ///< decoding only deprecated FIXME remove
-    RL_VLC_ELEM *rl_vlc[32];       ///< decoding only
-} RLTable;
-
-/**
- *
- * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] which will hold
- *                     the level and run tables, if this is NULL av_malloc() will be used
- */
-void ff_init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]);
-void ff_init_vlc_rl(RLTable *rl);
-
-#define INIT_VLC_RL(rl, static_size)\
-{\
-    int q;\
-    static RL_VLC_ELEM rl_vlc_table[32][static_size];\
-    INIT_VLC_STATIC(&rl.vlc, 9, rl.n + 1,\
-             &rl.table_vlc[0][1], 4, 2,\
-             &rl.table_vlc[0][0], 4, 2, static_size);\
-\
-    if(!rl.rl_vlc[0]){\
-        for(q=0; q<32; q++)\
-            rl.rl_vlc[q]= rl_vlc_table[q];\
-\
-        ff_init_vlc_rl(&rl);\
-    }\
-}
-
-static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
-{
-    int index;
-    index = rl->index_run[last][run];
-    if (index >= rl->n)
-        return rl->n;
-    if (level > rl->max_level[last][run])
-        return rl->n;
-    return index + level - 1;
-}
-
-#endif /* AVCODEC_RL_H */
diff --git a/deps/libav/libavcodec/rl2.c b/deps/libav/libavcodec/rl2.c
deleted file mode 100644
index 54b3e6a..0000000
--- a/deps/libav/libavcodec/rl2.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * RL2 Video Decoder
- * Copyright (C) 2008 Sascha Sommer (saschasommer at freenet.de)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RL2 Video Decoder
- * @author Sascha Sommer (saschasommer at freenet.de)
- * @see http://wiki.multimedia.cx/index.php?title=RL2
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-#include "internal.h"
-
-
-#define EXTRADATA1_SIZE (6 + 256 * 3) ///< video base, clr count, palette
-
-typedef struct Rl2Context {
-    AVCodecContext *avctx;
-
-    uint16_t video_base;  ///< initial drawing offset
-    uint32_t clr_count;   ///< number of used colors (currently unused)
-    uint8_t *back_frame;  ///< background frame
-    uint32_t palette[AVPALETTE_COUNT];
-} Rl2Context;
-
-/**
- * Run Length Decode a single 320x200 frame
- * @param s rl2 context
- * @param in input buffer
- * @param size input buffer size
- * @param out ouput buffer
- * @param stride stride of the output buffer
- * @param video_base offset of the rle data inside the frame
- */
-static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size,
-                               uint8_t *out, int stride, int video_base)
-{
-    int base_x = video_base % s->avctx->width;
-    int base_y = video_base / s->avctx->width;
-    int stride_adj = stride - s->avctx->width;
-    int i;
-    const uint8_t *back_frame = s->back_frame;
-    const uint8_t *in_end     = in + size;
-    const uint8_t *out_end    = out + stride * s->avctx->height;
-    uint8_t *line_end;
-
-    /** copy start of the background frame */
-    for (i = 0; i <= base_y; i++) {
-        if (s->back_frame)
-            memcpy(out, back_frame, s->avctx->width);
-        out        += stride;
-        back_frame += s->avctx->width;
-    }
-    back_frame += base_x - s->avctx->width;
-    line_end    = out - stride_adj;
-    out        += base_x - stride;
-
-    /** decode the variable part of the frame */
-    while (in < in_end) {
-        uint8_t val = *in++;
-        int len     = 1;
-        if (val >= 0x80) {
-            if (in >= in_end)
-                break;
-            len = *in++;
-            if (!len)
-                break;
-        }
-
-        if (len >= out_end - out)
-            break;
-
-        if (s->back_frame)
-            val |= 0x80;
-        else
-            val &= ~0x80;
-
-        while (len--) {
-            *out++ = (val == 0x80) ? *back_frame : val;
-            back_frame++;
-            if (out == line_end) {
-                 out      += stride_adj;
-                 line_end += stride;
-                 if (len >= out_end - out)
-                     break;
-            }
-        }
-    }
-
-    /** copy the rest from the background frame */
-    if (s->back_frame) {
-        while (out < out_end) {
-            memcpy(out, back_frame, line_end - out);
-            back_frame += line_end - out;
-            out         = line_end + stride_adj;
-            line_end   += stride;
-        }
-    }
-}
-
-
-/**
- * Initialize the decoder
- * @param avctx decoder context
- * @return 0 success, -1 on error
- */
-static av_cold int rl2_decode_init(AVCodecContext *avctx)
-{
-    Rl2Context *s = avctx->priv_data;
-    int back_size;
-    int i;
-
-    s->avctx       = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    /** parse extra data */
-    if (!avctx->extradata || avctx->extradata_size < EXTRADATA1_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "invalid extradata size\n");
-        return AVERROR(EINVAL);
-    }
-
-    /** get frame_offset */
-    s->video_base = AV_RL16(&avctx->extradata[0]);
-    s->clr_count  = AV_RL32(&avctx->extradata[2]);
-
-    if (s->video_base >= avctx->width * avctx->height) {
-        av_log(avctx, AV_LOG_ERROR, "invalid video_base\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /** initialize palette */
-    for (i = 0; i < AVPALETTE_COUNT; i++)
-        s->palette[i] = AV_RB24(&avctx->extradata[6 + i * 3]);
-
-    /** decode background frame if present */
-    back_size = avctx->extradata_size - EXTRADATA1_SIZE;
-
-    if (back_size > 0) {
-        uint8_t *back_frame = av_mallocz(avctx->width*avctx->height);
-        if (!back_frame)
-            return AVERROR(ENOMEM);
-        rl2_rle_decode(s, avctx->extradata + EXTRADATA1_SIZE, back_size,
-                       back_frame, avctx->width, 0);
-        s->back_frame = back_frame;
-    }
-    return 0;
-}
-
-
-static int rl2_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int ret, buf_size  = avpkt->size;
-    Rl2Context *s = avctx->priv_data;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    /** run length decode */
-    rl2_rle_decode(s, buf, buf_size, frame->data[0], frame->linesize[0],
-                   s->video_base);
-
-    /** make the palette available on the way out */
-    memcpy(frame->data[1], s->palette, AVPALETTE_SIZE);
-
-    *got_frame = 1;
-
-    /** report that the buffer was completely consumed */
-    return buf_size;
-}
-
-
-/**
- * Uninit decoder
- * @param avctx decoder context
- * @return 0 success, -1 on error
- */
-static av_cold int rl2_decode_end(AVCodecContext *avctx)
-{
-    Rl2Context *s = avctx->priv_data;
-
-    av_free(s->back_frame);
-
-    return 0;
-}
-
-
-AVCodec ff_rl2_decoder = {
-    .name           = "rl2",
-    .long_name      = NULL_IF_CONFIG_SMALL("RL2 video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_RL2,
-    .priv_data_size = sizeof(Rl2Context),
-    .init           = rl2_decode_init,
-    .close          = rl2_decode_end,
-    .decode         = rl2_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/rle.c b/deps/libav/libavcodec/rle.c
deleted file mode 100644
index cbbde93..0000000
--- a/deps/libav/libavcodec/rle.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * RLE encoder
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "rle.h"
-#include "libavutil/common.h"
-
-/**
- * Count up to 127 consecutive pixels which are either all the same or
- * all differ from the previous and next pixels.
- * @param start Pointer to the first pixel
- * @param len Maximum number of pixels
- * @param bpp Bytes per pixel
- * @param same 1 if searching for identical pixel values.  0 for differing
- * @return Number of matching consecutive pixels found
- */
-static int count_pixels(const uint8_t *start, int len, int bpp, int same)
-{
-    const uint8_t *pos;
-    int count = 1;
-
-    for(pos = start + bpp; count < FFMIN(127, len); pos += bpp, count ++) {
-        if(same != !memcmp(pos-bpp, pos, bpp)) {
-            if(!same) {
-                /* if bpp == 1, then 0 1 1 0 is more efficiently encoded as a single
-                 * raw block of pixels.  for larger bpp, RLE is as good or better */
-                if(bpp == 1 && count + 1 < FFMIN(127, len) && *pos != *(pos+1))
-                    continue;
-
-                /* if RLE can encode the next block better than as a raw block,
-                 * back up and leave _all_ the identical pixels for RLE */
-                count --;
-            }
-            break;
-        }
-    }
-
-    return count;
-}
-
-int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr , int bpp, int w,
-                  int add_rep, int xor_rep, int add_raw, int xor_raw)
-{
-    int count, x;
-    uint8_t *out = outbuf;
-
-    for(x = 0; x < w; x += count) {
-        /* see if we can encode the next set of pixels with RLE */
-        if((count = count_pixels(ptr, w-x, bpp, 1)) > 1) {
-            if(out + bpp + 1 > outbuf + out_size) return -1;
-            *out++ = (count ^ xor_rep) + add_rep;
-            memcpy(out, ptr, bpp);
-            out += bpp;
-        } else {
-            /* fall back on uncompressed */
-            count = count_pixels(ptr, w-x, bpp, 0);
-            if(out + bpp*count >= outbuf + out_size) return -1;
-            *out++ = (count ^ xor_raw) + add_raw;
-
-            memcpy(out, ptr, bpp * count);
-            out += bpp * count;
-        }
-
-        ptr += count * bpp;
-    }
-
-    return out - outbuf;
-}
diff --git a/deps/libav/libavcodec/rle.h b/deps/libav/libavcodec/rle.h
deleted file mode 100644
index 00261d3..0000000
--- a/deps/libav/libavcodec/rle.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * RLE encoder
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_RLE_H
-#define AVCODEC_RLE_H
-
-#include <stdint.h>
-
-/**
- * RLE compress the row, with maximum size of out_size. Value before repeated bytes is (count ^ xor_rep) + add_rep.
- *                                                      Value before raw bytes is      (count ^ xor_raw) + add_raw.
- * @param outbuf Output buffer
- * @param out_size Maximum output size
- * @param inbuf Input buffer
- * @param bpp Bytes per pixel
- * @param w Image width
- * @return Size of output in bytes, or -1 if larger than out_size
- */
-int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *inbuf, int bpp, int w,
-                  int add_rep, int xor_rep, int add_raw, int xor_raw);
-
-#endif /* AVCODEC_RLE_H */
diff --git a/deps/libav/libavcodec/rnd_avg.h b/deps/libav/libavcodec/rnd_avg.h
deleted file mode 100644
index 7301578..0000000
--- a/deps/libav/libavcodec/rnd_avg.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_RND_AVG_H
-#define AVCODEC_RND_AVG_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#define CALL_2X_PIXELS(a, b, n)\
-static void a(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
-    b(block  , pixels  , line_size, h);\
-    b(block+n, pixels+n, line_size, h);\
-}
-
-#define         BYTE_VEC32(c)   ((c)*0x01010101UL)
-#define         BYTE_VEC64(c)   ((c)*0x0001000100010001UL)
-
-static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
-{
-    return (a | b) - (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
-}
-
-static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
-{
-    return (a & b) + (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
-}
-
-static inline uint64_t rnd_avg64(uint64_t a, uint64_t b)
-{
-    return (a | b) - (((a ^ b) & ~BYTE_VEC64(0x01)) >> 1);
-}
-
-static inline uint64_t no_rnd_avg64(uint64_t a, uint64_t b)
-{
-    return (a & b) + (((a ^ b) & ~BYTE_VEC64(0x01)) >> 1);
-}
-
-#endif /* AVCODEC_RND_AVG_H */
diff --git a/deps/libav/libavcodec/roqaudioenc.c b/deps/libav/libavcodec/roqaudioenc.c
deleted file mode 100644
index f97d5d6..0000000
--- a/deps/libav/libavcodec/roqaudioenc.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * RoQ audio encoder
- *
- * Copyright (c) 2005 Eric Lasota
- *    Based on RoQ specs (c)2001 Tim Ferguson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "mathops.h"
-
-#define ROQ_FRAME_SIZE           735
-#define ROQ_HEADER_SIZE   8
-
-#define MAX_DPCM (127*127)
-
-
-typedef struct
-{
-    short lastSample[2];
-    int input_frames;
-    int buffered_samples;
-    int16_t *frame_buffer;
-    int64_t first_pts;
-} ROQDPCMContext;
-
-
-static av_cold int roq_dpcm_encode_close(AVCodecContext *avctx)
-{
-    ROQDPCMContext *context = avctx->priv_data;
-
-    av_freep(&context->frame_buffer);
-
-    return 0;
-}
-
-static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
-{
-    ROQDPCMContext *context = avctx->priv_data;
-    int ret;
-
-    if (avctx->channels > 2) {
-        av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n");
-        return AVERROR(EINVAL);
-    }
-    if (avctx->sample_rate != 22050) {
-        av_log(avctx, AV_LOG_ERROR, "Audio must be 22050 Hz\n");
-        return AVERROR(EINVAL);
-    }
-
-    avctx->frame_size = ROQ_FRAME_SIZE;
-    avctx->bit_rate   = (ROQ_HEADER_SIZE + ROQ_FRAME_SIZE * avctx->channels) *
-                        (22050 / ROQ_FRAME_SIZE) * 8;
-
-    context->frame_buffer = av_malloc(8 * ROQ_FRAME_SIZE * avctx->channels *
-                                      sizeof(*context->frame_buffer));
-    if (!context->frame_buffer) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-
-    context->lastSample[0] = context->lastSample[1] = 0;
-
-    return 0;
-error:
-    roq_dpcm_encode_close(avctx);
-    return ret;
-}
-
-static unsigned char dpcm_predict(short *previous, short current)
-{
-    int diff;
-    int negative;
-    int result;
-    int predicted;
-
-    diff = current - *previous;
-
-    negative = diff<0;
-    diff = FFABS(diff);
-
-    if (diff >= MAX_DPCM)
-        result = 127;
-    else {
-        result = ff_sqrt(diff);
-        result += diff > result*result+result;
-    }
-
-    /* See if this overflows */
- retry:
-    diff = result*result;
-    if (negative)
-        diff = -diff;
-    predicted = *previous + diff;
-
-    /* If it overflows, back off a step */
-    if (predicted > 32767 || predicted < -32768) {
-        result--;
-        goto retry;
-    }
-
-    /* Add the sign bit */
-    result |= negative << 7;   //if (negative) result |= 128;
-
-    *previous = predicted;
-
-    return result;
-}
-
-static int roq_dpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                                 const AVFrame *frame, int *got_packet_ptr)
-{
-    int i, stereo, data_size, ret;
-    const int16_t *in = frame ? (const int16_t *)frame->data[0] : NULL;
-    uint8_t *out;
-    ROQDPCMContext *context = avctx->priv_data;
-
-    stereo = (avctx->channels == 2);
-
-    if (!in && context->input_frames >= 8)
-        return 0;
-
-    if (in && context->input_frames < 8) {
-        memcpy(&context->frame_buffer[context->buffered_samples * avctx->channels],
-               in, avctx->frame_size * avctx->channels * sizeof(*in));
-        context->buffered_samples += avctx->frame_size;
-        if (context->input_frames == 0)
-            context->first_pts = frame->pts;
-        if (context->input_frames < 7) {
-            context->input_frames++;
-            return 0;
-        }
-        in = context->frame_buffer;
-    }
-
-    if (stereo) {
-        context->lastSample[0] &= 0xFF00;
-        context->lastSample[1] &= 0xFF00;
-    }
-
-    if (context->input_frames == 7 || !in)
-        data_size = avctx->channels * context->buffered_samples;
-    else
-        data_size = avctx->channels * avctx->frame_size;
-
-    if ((ret = ff_alloc_packet(avpkt, ROQ_HEADER_SIZE + data_size))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-    out = avpkt->data;
-
-    bytestream_put_byte(&out, stereo ? 0x21 : 0x20);
-    bytestream_put_byte(&out, 0x10);
-    bytestream_put_le32(&out, data_size);
-
-    if (stereo) {
-        bytestream_put_byte(&out, (context->lastSample[1])>>8);
-        bytestream_put_byte(&out, (context->lastSample[0])>>8);
-    } else
-        bytestream_put_le16(&out, context->lastSample[0]);
-
-    /* Write the actual samples */
-    for (i = 0; i < data_size; i++)
-        *out++ = dpcm_predict(&context->lastSample[i & 1], *in++);
-
-    avpkt->pts      = context->input_frames <= 7 ? context->first_pts : frame->pts;
-    avpkt->duration = data_size / avctx->channels;
-
-    context->input_frames++;
-    if (!in)
-        context->input_frames = FFMAX(context->input_frames, 8);
-
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-AVCodec ff_roq_dpcm_encoder = {
-    .name           = "roq_dpcm",
-    .long_name      = NULL_IF_CONFIG_SMALL("id RoQ DPCM"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_ROQ_DPCM,
-    .priv_data_size = sizeof(ROQDPCMContext),
-    .init           = roq_dpcm_encode_init,
-    .encode2        = roq_dpcm_encode_frame,
-    .close          = roq_dpcm_encode_close,
-    .capabilities   = CODEC_CAP_DELAY,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/roqvideo.c b/deps/libav/libavcodec/roqvideo.c
deleted file mode 100644
index 77df079..0000000
--- a/deps/libav/libavcodec/roqvideo.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2003 Mike Melanson
- * Copyright (C) 2003 Dr. Tim Ferguson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * id RoQ Video common functions based on work by Dr. Tim Ferguson
- */
-
-#include "avcodec.h"
-#include "roqvideo.h"
-
-static inline void block_copy(unsigned char *out, unsigned char *in,
-                              int outstride, int instride, int sz)
-{
-    int rows = sz;
-    while(rows--) {
-        memcpy(out, in, sz);
-        out += outstride;
-        in += instride;
-    }
-}
-
-void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell)
-{
-    unsigned char *bptr;
-    int boffs,stride;
-
-    stride = ri->current_frame->linesize[0];
-    boffs = y*stride + x;
-
-    bptr = ri->current_frame->data[0] + boffs;
-    bptr[0       ] = cell->y[0];
-    bptr[1       ] = cell->y[1];
-    bptr[stride  ] = cell->y[2];
-    bptr[stride+1] = cell->y[3];
-
-    stride = ri->current_frame->linesize[1];
-    boffs = y*stride + x;
-
-    bptr = ri->current_frame->data[1] + boffs;
-    bptr[0       ] =
-    bptr[1       ] =
-    bptr[stride  ] =
-    bptr[stride+1] = cell->u;
-
-    bptr = ri->current_frame->data[2] + boffs;
-    bptr[0       ] =
-    bptr[1       ] =
-    bptr[stride  ] =
-    bptr[stride+1] = cell->v;
-}
-
-void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell)
-{
-    unsigned char *bptr;
-    int boffs,stride;
-
-    stride = ri->current_frame->linesize[0];
-    boffs = y*stride + x;
-
-    bptr = ri->current_frame->data[0] + boffs;
-    bptr[         0] = bptr[         1] = bptr[stride    ] = bptr[stride  +1] = cell->y[0];
-    bptr[         2] = bptr[         3] = bptr[stride  +2] = bptr[stride  +3] = cell->y[1];
-    bptr[stride*2  ] = bptr[stride*2+1] = bptr[stride*3  ] = bptr[stride*3+1] = cell->y[2];
-    bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->y[3];
-
-    stride = ri->current_frame->linesize[1];
-    boffs = y*stride + x;
-
-    bptr = ri->current_frame->data[1] + boffs;
-    bptr[         0] = bptr[         1] = bptr[stride    ] = bptr[stride  +1] =
-    bptr[         2] = bptr[         3] = bptr[stride  +2] = bptr[stride  +3] =
-    bptr[stride*2  ] = bptr[stride*2+1] = bptr[stride*3  ] = bptr[stride*3+1] =
-    bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->u;
-
-    bptr = ri->current_frame->data[2] + boffs;
-    bptr[         0] = bptr[         1] = bptr[stride    ] = bptr[stride  +1] =
-    bptr[         2] = bptr[         3] = bptr[stride  +2] = bptr[stride  +3] =
-    bptr[stride*2  ] = bptr[stride*2+1] = bptr[stride*3  ] = bptr[stride*3+1] =
-    bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->v;
-}
-
-
-static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax,
-                                        int deltay, int sz)
-{
-    int mx, my, cp;
-
-    mx = x + deltax;
-    my = y + deltay;
-
-    /* check MV against frame boundaries */
-    if ((mx < 0) || (mx > ri->width - sz) ||
-        (my < 0) || (my > ri->height - sz)) {
-        av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n",
-            mx, my, ri->width, ri->height);
-        return;
-    }
-
-    if (ri->last_frame->data[0] == NULL) {
-        av_log(ri->avctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n");
-        return;
-    }
-
-    for(cp = 0; cp < 3; cp++) {
-        int outstride = ri->current_frame->linesize[cp];
-        int instride  = ri->last_frame   ->linesize[cp];
-        block_copy(ri->current_frame->data[cp] + y*outstride + x,
-                   ri->last_frame->data[cp] + my*instride + mx,
-                   outstride, instride, sz);
-    }
-}
-
-
-void ff_apply_motion_4x4(RoqContext *ri, int x, int y,
-                             int deltax, int deltay)
-{
-    apply_motion_generic(ri, x, y, deltax, deltay, 4);
-}
-
-void ff_apply_motion_8x8(RoqContext *ri, int x, int y,
-                             int deltax, int deltay)
-{
-    apply_motion_generic(ri, x, y, deltax, deltay, 8);
-}
diff --git a/deps/libav/libavcodec/roqvideo.h b/deps/libav/libavcodec/roqvideo.h
deleted file mode 100644
index 3f00022..0000000
--- a/deps/libav/libavcodec/roqvideo.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2003 Mike Melanson
- * Copyright (C) 2003 Dr. Tim Ferguson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ROQVIDEO_H
-#define AVCODEC_ROQVIDEO_H
-
-#include "libavutil/lfg.h"
-#include "avcodec.h"
-#include "bytestream.h"
-
-typedef struct roq_cell {
-    unsigned char y[4];
-    unsigned char u, v;
-} roq_cell;
-
-typedef struct roq_qcell {
-    int idx[4];
-} roq_qcell;
-
-typedef struct motion_vect {
-    int d[2];
-} motion_vect;
-
-struct RoqTempData;
-
-typedef struct RoqContext {
-
-    AVCodecContext *avctx;
-    AVFrame *last_frame;
-    AVFrame *current_frame;
-    int first_frame;
-
-    roq_cell cb2x2[256];
-    roq_qcell cb4x4[256];
-
-    GetByteContext gb;
-    int width, height;
-
-    /* Encoder only data */
-    AVLFG randctx;
-    uint64_t lambda;
-
-    motion_vect *this_motion4;
-    motion_vect *last_motion4;
-
-    motion_vect *this_motion8;
-    motion_vect *last_motion8;
-
-    unsigned int framesSinceKeyframe;
-
-    const AVFrame *frame_to_enc;
-    uint8_t *out_buf;
-    struct RoqTempData *tmpData;
-} RoqContext;
-
-#define RoQ_INFO              0x1001
-#define RoQ_QUAD_CODEBOOK     0x1002
-#define RoQ_QUAD_VQ           0x1011
-#define RoQ_SOUND_MONO        0x1020
-#define RoQ_SOUND_STEREO      0x1021
-
-#define RoQ_ID_MOT              0x00
-#define RoQ_ID_FCC              0x01
-#define RoQ_ID_SLD              0x02
-#define RoQ_ID_CCC              0x03
-
-void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell);
-void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell);
-
-void ff_apply_motion_4x4(RoqContext *ri, int x, int y, int deltax, int deltay);
-
-void ff_apply_motion_8x8(RoqContext *ri, int x, int y, int deltax, int deltay);
-
-#endif /* AVCODEC_ROQVIDEO_H */
diff --git a/deps/libav/libavcodec/roqvideodec.c b/deps/libav/libavcodec/roqvideodec.c
deleted file mode 100644
index ac7d4ba..0000000
--- a/deps/libav/libavcodec/roqvideodec.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * id RoQ Video Decoder by Dr. Tim Ferguson
- * For more information about the id RoQ format, visit:
- *   http://www.csse.monash.edu.au/~timf/
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "roqvideo.h"
-
-static void roqvideo_decode_frame(RoqContext *ri)
-{
-    unsigned int chunk_id = 0, chunk_arg = 0;
-    unsigned long chunk_size = 0;
-    int i, j, k, nv1, nv2, vqflg = 0, vqflg_pos = -1;
-    int vqid, xpos, ypos, xp, yp, x, y, mx, my;
-    int frame_stats[2][4] = {{0},{0}};
-    roq_qcell *qcell;
-    int64_t chunk_start;
-
-    while (bytestream2_get_bytes_left(&ri->gb) >= 8) {
-        chunk_id   = bytestream2_get_le16(&ri->gb);
-        chunk_size = bytestream2_get_le32(&ri->gb);
-        chunk_arg  = bytestream2_get_le16(&ri->gb);
-
-        if(chunk_id == RoQ_QUAD_VQ)
-            break;
-        if(chunk_id == RoQ_QUAD_CODEBOOK) {
-            if((nv1 = chunk_arg >> 8) == 0)
-                nv1 = 256;
-            if((nv2 = chunk_arg & 0xff) == 0 && nv1 * 6 < chunk_size)
-                nv2 = 256;
-            for(i = 0; i < nv1; i++) {
-                ri->cb2x2[i].y[0] = bytestream2_get_byte(&ri->gb);
-                ri->cb2x2[i].y[1] = bytestream2_get_byte(&ri->gb);
-                ri->cb2x2[i].y[2] = bytestream2_get_byte(&ri->gb);
-                ri->cb2x2[i].y[3] = bytestream2_get_byte(&ri->gb);
-                ri->cb2x2[i].u    = bytestream2_get_byte(&ri->gb);
-                ri->cb2x2[i].v    = bytestream2_get_byte(&ri->gb);
-            }
-            for(i = 0; i < nv2; i++)
-                for(j = 0; j < 4; j++)
-                    ri->cb4x4[i].idx[j] = bytestream2_get_byte(&ri->gb);
-        }
-    }
-
-    chunk_start = bytestream2_tell(&ri->gb);
-    xpos = ypos = 0;
-    while (bytestream2_tell(&ri->gb) < chunk_start + chunk_size) {
-        for (yp = ypos; yp < ypos + 16; yp += 8)
-            for (xp = xpos; xp < xpos + 16; xp += 8) {
-                if (vqflg_pos < 0) {
-                    vqflg = bytestream2_get_le16(&ri->gb);
-                    vqflg_pos = 7;
-                }
-                vqid = (vqflg >> (vqflg_pos * 2)) & 0x3;
-                frame_stats[0][vqid]++;
-                vqflg_pos--;
-
-                switch(vqid) {
-                case RoQ_ID_MOT:
-                    break;
-                case RoQ_ID_FCC: {
-                    int byte = bytestream2_get_byte(&ri->gb);
-                    mx = 8 - (byte >> 4) - ((signed char) (chunk_arg >> 8));
-                    my = 8 - (byte & 0xf) - ((signed char) chunk_arg);
-                    ff_apply_motion_8x8(ri, xp, yp, mx, my);
-                    break;
-                }
-                case RoQ_ID_SLD:
-                    qcell = ri->cb4x4 + bytestream2_get_byte(&ri->gb);
-                    ff_apply_vector_4x4(ri, xp,     yp,     ri->cb2x2 + qcell->idx[0]);
-                    ff_apply_vector_4x4(ri, xp + 4, yp,     ri->cb2x2 + qcell->idx[1]);
-                    ff_apply_vector_4x4(ri, xp,     yp + 4, ri->cb2x2 + qcell->idx[2]);
-                    ff_apply_vector_4x4(ri, xp + 4, yp + 4, ri->cb2x2 + qcell->idx[3]);
-                    break;
-                case RoQ_ID_CCC:
-                    for (k = 0; k < 4; k++) {
-                        x = xp; y = yp;
-                        if(k & 0x01) x += 4;
-                        if(k & 0x02) y += 4;
-
-                        if (vqflg_pos < 0) {
-                            vqflg = bytestream2_get_le16(&ri->gb);
-                            vqflg_pos = 7;
-                        }
-                        vqid = (vqflg >> (vqflg_pos * 2)) & 0x3;
-                        frame_stats[1][vqid]++;
-                        vqflg_pos--;
-                        switch(vqid) {
-                        case RoQ_ID_MOT:
-                            break;
-                        case RoQ_ID_FCC: {
-                            int byte = bytestream2_get_byte(&ri->gb);
-                            mx = 8 - (byte >> 4) - ((signed char) (chunk_arg >> 8));
-                            my = 8 - (byte & 0xf) - ((signed char) chunk_arg);
-                            ff_apply_motion_4x4(ri, x, y, mx, my);
-                            break;
-                        }
-                        case RoQ_ID_SLD:
-                            qcell = ri->cb4x4 + bytestream2_get_byte(&ri->gb);
-                            ff_apply_vector_2x2(ri, x,     y,     ri->cb2x2 + qcell->idx[0]);
-                            ff_apply_vector_2x2(ri, x + 2, y,     ri->cb2x2 + qcell->idx[1]);
-                            ff_apply_vector_2x2(ri, x,     y + 2, ri->cb2x2 + qcell->idx[2]);
-                            ff_apply_vector_2x2(ri, x + 2, y + 2, ri->cb2x2 + qcell->idx[3]);
-                            break;
-                        case RoQ_ID_CCC:
-                            ff_apply_vector_2x2(ri, x,     y,     ri->cb2x2 + bytestream2_get_byte(&ri->gb));
-                            ff_apply_vector_2x2(ri, x + 2, y,     ri->cb2x2 + bytestream2_get_byte(&ri->gb));
-                            ff_apply_vector_2x2(ri, x,     y + 2, ri->cb2x2 + bytestream2_get_byte(&ri->gb));
-                            ff_apply_vector_2x2(ri, x + 2, y + 2, ri->cb2x2 + bytestream2_get_byte(&ri->gb));
-                            break;
-                        }
-                    }
-                    break;
-                default:
-                    av_log(ri->avctx, AV_LOG_ERROR, "Unknown vq code: %d\n", vqid);
-            }
-        }
-
-        xpos += 16;
-        if (xpos >= ri->width) {
-            xpos -= ri->width;
-            ypos += 16;
-        }
-        if(ypos >= ri->height)
-            break;
-    }
-}
-
-
-static av_cold int roq_decode_init(AVCodecContext *avctx)
-{
-    RoqContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    if (avctx->width % 16 || avctx->height % 16) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Dimensions must be a multiple of 16\n");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    s->width = avctx->width;
-    s->height = avctx->height;
-
-    s->last_frame    = av_frame_alloc();
-    s->current_frame = av_frame_alloc();
-    if (!s->current_frame || !s->last_frame) {
-        av_frame_free(&s->current_frame);
-        av_frame_free(&s->last_frame);
-        return AVERROR(ENOMEM);
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV444P;
-
-    return 0;
-}
-
-static int roq_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    RoqContext *s = avctx->priv_data;
-    int copy= !s->current_frame->data[0];
-    int ret;
-
-    if ((ret = ff_reget_buffer(avctx, s->current_frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "  RoQ: get_buffer() failed\n");
-        return ret;
-    }
-
-    if(copy)
-        av_picture_copy((AVPicture*)s->current_frame, (AVPicture*)s->last_frame,
-                        avctx->pix_fmt, avctx->width, avctx->height);
-
-    bytestream2_init(&s->gb, buf, buf_size);
-    roqvideo_decode_frame(s);
-
-    if ((ret = av_frame_ref(data, s->current_frame)) < 0)
-        return ret;
-    *got_frame      = 1;
-
-    /* shuffle frames */
-    FFSWAP(AVFrame *, s->current_frame, s->last_frame);
-
-    return buf_size;
-}
-
-static av_cold int roq_decode_end(AVCodecContext *avctx)
-{
-    RoqContext *s = avctx->priv_data;
-
-    av_frame_free(&s->current_frame);
-    av_frame_free(&s->last_frame);
-
-    return 0;
-}
-
-AVCodec ff_roq_decoder = {
-    .name           = "roqvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("id RoQ video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ROQ,
-    .priv_data_size = sizeof(RoqContext),
-    .init           = roq_decode_init,
-    .close          = roq_decode_end,
-    .decode         = roq_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/roqvideoenc.c b/deps/libav/libavcodec/roqvideoenc.c
deleted file mode 100644
index af0089f..0000000
--- a/deps/libav/libavcodec/roqvideoenc.c
+++ /dev/null
@@ -1,1092 +0,0 @@
-/*
- * RoQ Video Encoder.
- *
- * Copyright (C) 2007 Vitor Sessak <vitor1001 at gmail.com>
- * Copyright (C) 2004-2007 Eric Lasota
- *    Based on RoQ specs (C) 2001 Tim Ferguson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * id RoQ encoder by Vitor. Based on the Switchblade3 library and the
- * Switchblade3 Libav glue by Eric Lasota.
- */
-
-/*
- * COSTS:
- * Level 1:
- *  SKIP - 2 bits
- *  MOTION - 2 + 8 bits
- *  CODEBOOK - 2 + 8 bits
- *  SUBDIVIDE - 2 + combined subcel cost
- *
- * Level 2:
- *  SKIP - 2 bits
- *  MOTION - 2 + 8 bits
- *  CODEBOOK - 2 + 8 bits
- *  SUBDIVIDE - 2 + 4*8 bits
- *
- * Maximum cost: 138 bits per cel
- *
- * Proper evaluation requires LCD fraction comparison, which requires
- * Squared Error (SE) loss * savings increase
- *
- * Maximum savings increase: 136 bits
- * Maximum SE loss without overflow: 31580641
- * Components in 8x8 supercel: 192
- * Maximum SE precision per component: 164482
- *    >65025, so no truncation is needed (phew)
- */
-
-#include <string.h>
-
-#include "libavutil/attributes.h"
-#include "roqvideo.h"
-#include "bytestream.h"
-#include "elbg.h"
-#include "internal.h"
-#include "mathops.h"
-
-#define CHROMA_BIAS 1
-
-/**
- * Maximum number of generated 4x4 codebooks. Can't be 256 to workaround a
- * Quake 3 bug.
- */
-#define MAX_CBS_4x4 255
-
-#define MAX_CBS_2x2 256 ///< Maximum number of 2x2 codebooks.
-
-/* The cast is useful when multiplying it by INT_MAX */
-#define ROQ_LAMBDA_SCALE ((uint64_t) FF_LAMBDA_SCALE)
-
-/* Macroblock support functions */
-static void unpack_roq_cell(roq_cell *cell, uint8_t u[4*3])
-{
-    memcpy(u  , cell->y, 4);
-    memset(u+4, cell->u, 4);
-    memset(u+8, cell->v, 4);
-}
-
-static void unpack_roq_qcell(uint8_t cb2[], roq_qcell *qcell, uint8_t u[4*4*3])
-{
-    int i,cp;
-    static const int offsets[4] = {0, 2, 8, 10};
-
-    for (cp=0; cp<3; cp++)
-        for (i=0; i<4; i++) {
-            u[4*4*cp + offsets[i]  ] = cb2[qcell->idx[i]*2*2*3 + 4*cp  ];
-            u[4*4*cp + offsets[i]+1] = cb2[qcell->idx[i]*2*2*3 + 4*cp+1];
-            u[4*4*cp + offsets[i]+4] = cb2[qcell->idx[i]*2*2*3 + 4*cp+2];
-            u[4*4*cp + offsets[i]+5] = cb2[qcell->idx[i]*2*2*3 + 4*cp+3];
-        }
-}
-
-
-static void enlarge_roq_mb4(uint8_t base[3*16], uint8_t u[3*64])
-{
-    int x,y,cp;
-
-    for(cp=0; cp<3; cp++)
-        for(y=0; y<8; y++)
-            for(x=0; x<8; x++)
-                *u++ = base[(y/2)*4 + (x/2) + 16*cp];
-}
-
-static inline int square(int x)
-{
-    return x*x;
-}
-
-static inline int eval_sse(const uint8_t *a, const uint8_t *b, int count)
-{
-    int diff=0;
-
-    while(count--)
-        diff += square(*b++ - *a++);
-
-    return diff;
-}
-
-// FIXME Could use DSPContext.sse, but it is not so speed critical (used
-// just for motion estimation).
-static int block_sse(uint8_t * const *buf1, uint8_t * const *buf2, int x1, int y1,
-                     int x2, int y2, const int *stride1, const int *stride2, int size)
-{
-    int i, k;
-    int sse=0;
-
-    for (k=0; k<3; k++) {
-        int bias = (k ? CHROMA_BIAS : 4);
-        for (i=0; i<size; i++)
-            sse += bias*eval_sse(buf1[k] + (y1+i)*stride1[k] + x1,
-                                 buf2[k] + (y2+i)*stride2[k] + x2, size);
-    }
-
-    return sse;
-}
-
-static int eval_motion_dist(RoqContext *enc, int x, int y, motion_vect vect,
-                             int size)
-{
-    int mx=vect.d[0];
-    int my=vect.d[1];
-
-    if (mx < -7 || mx > 7)
-        return INT_MAX;
-
-    if (my < -7 || my > 7)
-        return INT_MAX;
-
-    mx += x;
-    my += y;
-
-    if ((unsigned) mx > enc->width-size || (unsigned) my > enc->height-size)
-        return INT_MAX;
-
-    return block_sse(enc->frame_to_enc->data, enc->last_frame->data, x, y,
-                     mx, my,
-                     enc->frame_to_enc->linesize, enc->last_frame->linesize,
-                     size);
-}
-
-/**
- * @return distortion between two macroblocks
- */
-static inline int squared_diff_macroblock(uint8_t a[], uint8_t b[], int size)
-{
-    int cp, sdiff=0;
-
-    for(cp=0;cp<3;cp++) {
-        int bias = (cp ? CHROMA_BIAS : 4);
-        sdiff += bias*eval_sse(a, b, size*size);
-        a += size*size;
-        b += size*size;
-    }
-
-    return sdiff;
-}
-
-typedef struct
-{
-    int eval_dist[4];
-    int best_bit_use;
-    int best_coding;
-
-    int subCels[4];
-    motion_vect motion;
-    int cbEntry;
-} SubcelEvaluation;
-
-typedef struct
-{
-    int eval_dist[4];
-    int best_coding;
-
-    SubcelEvaluation subCels[4];
-
-    motion_vect motion;
-    int cbEntry;
-
-    int sourceX, sourceY;
-} CelEvaluation;
-
-typedef struct
-{
-    int numCB4;
-    int numCB2;
-    int usedCB2[MAX_CBS_2x2];
-    int usedCB4[MAX_CBS_4x4];
-    uint8_t unpacked_cb2[MAX_CBS_2x2*2*2*3];
-    uint8_t unpacked_cb4[MAX_CBS_4x4*4*4*3];
-    uint8_t unpacked_cb4_enlarged[MAX_CBS_4x4*8*8*3];
-} RoqCodebooks;
-
-/**
- * Temporary vars
- */
-typedef struct RoqTempData
-{
-    CelEvaluation *cel_evals;
-
-    int f2i4[MAX_CBS_4x4];
-    int i2f4[MAX_CBS_4x4];
-    int f2i2[MAX_CBS_2x2];
-    int i2f2[MAX_CBS_2x2];
-
-    int mainChunkSize;
-
-    int numCB4;
-    int numCB2;
-
-    RoqCodebooks codebooks;
-
-    int *closest_cb2;
-    int used_option[4];
-} RoqTempdata;
-
-/**
- * Initialize cel evaluators and set their source coordinates
- */
-static void create_cel_evals(RoqContext *enc, RoqTempdata *tempData)
-{
-    int n=0, x, y, i;
-
-    tempData->cel_evals = av_malloc(enc->width*enc->height/64 * sizeof(CelEvaluation));
-
-    /* Map to the ROQ quadtree order */
-    for (y=0; y<enc->height; y+=16)
-        for (x=0; x<enc->width; x+=16)
-            for(i=0; i<4; i++) {
-                tempData->cel_evals[n  ].sourceX = x + (i&1)*8;
-                tempData->cel_evals[n++].sourceY = y + (i&2)*4;
-            }
-}
-
-/**
- * Get macroblocks from parts of the image
- */
-static void get_frame_mb(const AVFrame *frame, int x, int y, uint8_t mb[], int dim)
-{
-    int i, j, cp;
-
-    for (cp=0; cp<3; cp++) {
-        int stride = frame->linesize[cp];
-        for (i=0; i<dim; i++)
-            for (j=0; j<dim; j++)
-                *mb++ = frame->data[cp][(y+i)*stride + x + j];
-    }
-}
-
-/**
- * Find the codebook with the lowest distortion from an image
- */
-static int index_mb(uint8_t cluster[], uint8_t cb[], int numCB,
-                    int *outIndex, int dim)
-{
-    int i, lDiff = INT_MAX, pick=0;
-
-    /* Diff against the others */
-    for (i=0; i<numCB; i++) {
-        int diff = squared_diff_macroblock(cluster, cb + i*dim*dim*3, dim);
-        if (diff < lDiff) {
-            lDiff = diff;
-            pick = i;
-        }
-    }
-
-    *outIndex = pick;
-    return lDiff;
-}
-
-#define EVAL_MOTION(MOTION) \
-    do { \
-        diff = eval_motion_dist(enc, j, i, MOTION, blocksize); \
-            \
-        if (diff < lowestdiff) { \
-            lowestdiff = diff; \
-            bestpick = MOTION; \
-        } \
-    } while(0)
-
-static void motion_search(RoqContext *enc, int blocksize)
-{
-    static const motion_vect offsets[8] = {
-        {{ 0,-1}},
-        {{ 0, 1}},
-        {{-1, 0}},
-        {{ 1, 0}},
-        {{-1, 1}},
-        {{ 1,-1}},
-        {{-1,-1}},
-        {{ 1, 1}},
-    };
-
-    int diff, lowestdiff, oldbest;
-    int off[3];
-    motion_vect bestpick = {{0,0}};
-    int i, j, k, offset;
-
-    motion_vect *last_motion;
-    motion_vect *this_motion;
-    motion_vect vect, vect2;
-
-    int max=(enc->width/blocksize)*enc->height/blocksize;
-
-    if (blocksize == 4) {
-        last_motion = enc->last_motion4;
-        this_motion = enc->this_motion4;
-    } else {
-        last_motion = enc->last_motion8;
-        this_motion = enc->this_motion8;
-    }
-
-    for (i=0; i<enc->height; i+=blocksize)
-        for (j=0; j<enc->width; j+=blocksize) {
-            lowestdiff = eval_motion_dist(enc, j, i, (motion_vect) {{0,0}},
-                                          blocksize);
-            bestpick.d[0] = 0;
-            bestpick.d[1] = 0;
-
-            if (blocksize == 4)
-                EVAL_MOTION(enc->this_motion8[(i/8)*(enc->width/8) + j/8]);
-
-            offset = (i/blocksize)*enc->width/blocksize + j/blocksize;
-            if (offset < max && offset >= 0)
-                EVAL_MOTION(last_motion[offset]);
-
-            offset++;
-            if (offset < max && offset >= 0)
-                EVAL_MOTION(last_motion[offset]);
-
-            offset = (i/blocksize + 1)*enc->width/blocksize + j/blocksize;
-            if (offset < max && offset >= 0)
-                EVAL_MOTION(last_motion[offset]);
-
-            off[0]= (i/blocksize)*enc->width/blocksize + j/blocksize - 1;
-            off[1]= off[0] - enc->width/blocksize + 1;
-            off[2]= off[1] + 1;
-
-            if (i) {
-
-                for(k=0; k<2; k++)
-                    vect.d[k]= mid_pred(this_motion[off[0]].d[k],
-                                        this_motion[off[1]].d[k],
-                                        this_motion[off[2]].d[k]);
-
-                EVAL_MOTION(vect);
-                for(k=0; k<3; k++)
-                    EVAL_MOTION(this_motion[off[k]]);
-            } else if(j)
-                EVAL_MOTION(this_motion[off[0]]);
-
-            vect = bestpick;
-
-            oldbest = -1;
-            while (oldbest != lowestdiff) {
-                oldbest = lowestdiff;
-                for (k=0; k<8; k++) {
-                    vect2 = vect;
-                    vect2.d[0] += offsets[k].d[0];
-                    vect2.d[1] += offsets[k].d[1];
-                    EVAL_MOTION(vect2);
-                }
-                vect = bestpick;
-            }
-            offset = (i/blocksize)*enc->width/blocksize + j/blocksize;
-            this_motion[offset] = bestpick;
-        }
-}
-
-/**
- * Get distortion for all options available to a subcel
- */
-static void gather_data_for_subcel(SubcelEvaluation *subcel, int x,
-                                   int y, RoqContext *enc, RoqTempdata *tempData)
-{
-    uint8_t mb4[4*4*3];
-    uint8_t mb2[2*2*3];
-    int cluster_index;
-    int i, best_dist;
-
-    static const int bitsUsed[4] = {2, 10, 10, 34};
-
-    if (enc->framesSinceKeyframe >= 1) {
-        subcel->motion = enc->this_motion4[y*enc->width/16 + x/4];
-
-        subcel->eval_dist[RoQ_ID_FCC] =
-            eval_motion_dist(enc, x, y,
-                             enc->this_motion4[y*enc->width/16 + x/4], 4);
-    } else
-        subcel->eval_dist[RoQ_ID_FCC] = INT_MAX;
-
-    if (enc->framesSinceKeyframe >= 2)
-        subcel->eval_dist[RoQ_ID_MOT] = block_sse(enc->frame_to_enc->data,
-                                                  enc->current_frame->data, x,
-                                                  y, x, y,
-                                                  enc->frame_to_enc->linesize,
-                                                  enc->current_frame->linesize,
-                                                  4);
-    else
-        subcel->eval_dist[RoQ_ID_MOT] = INT_MAX;
-
-    cluster_index = y*enc->width/16 + x/4;
-
-    get_frame_mb(enc->frame_to_enc, x, y, mb4, 4);
-
-    subcel->eval_dist[RoQ_ID_SLD] = index_mb(mb4,
-                                             tempData->codebooks.unpacked_cb4,
-                                             tempData->codebooks.numCB4,
-                                             &subcel->cbEntry, 4);
-
-    subcel->eval_dist[RoQ_ID_CCC] = 0;
-
-    for(i=0;i<4;i++) {
-        subcel->subCels[i] = tempData->closest_cb2[cluster_index*4+i];
-
-        get_frame_mb(enc->frame_to_enc, x+2*(i&1),
-                     y+(i&2), mb2, 2);
-
-        subcel->eval_dist[RoQ_ID_CCC] +=
-            squared_diff_macroblock(tempData->codebooks.unpacked_cb2 + subcel->subCels[i]*2*2*3, mb2, 2);
-    }
-
-    best_dist = INT_MAX;
-    for (i=0; i<4; i++)
-        if (ROQ_LAMBDA_SCALE*subcel->eval_dist[i] + enc->lambda*bitsUsed[i] <
-            best_dist) {
-            subcel->best_coding = i;
-            subcel->best_bit_use = bitsUsed[i];
-            best_dist = ROQ_LAMBDA_SCALE*subcel->eval_dist[i] +
-                enc->lambda*bitsUsed[i];
-        }
-}
-
-/**
- * Get distortion for all options available to a cel
- */
-static void gather_data_for_cel(CelEvaluation *cel, RoqContext *enc,
-                                RoqTempdata *tempData)
-{
-    uint8_t mb8[8*8*3];
-    int index = cel->sourceY*enc->width/64 + cel->sourceX/8;
-    int i, j, best_dist, divide_bit_use;
-
-    int bitsUsed[4] = {2, 10, 10, 0};
-
-    if (enc->framesSinceKeyframe >= 1) {
-        cel->motion = enc->this_motion8[index];
-
-        cel->eval_dist[RoQ_ID_FCC] =
-            eval_motion_dist(enc, cel->sourceX, cel->sourceY,
-                             enc->this_motion8[index], 8);
-    } else
-        cel->eval_dist[RoQ_ID_FCC] = INT_MAX;
-
-    if (enc->framesSinceKeyframe >= 2)
-        cel->eval_dist[RoQ_ID_MOT] = block_sse(enc->frame_to_enc->data,
-                                               enc->current_frame->data,
-                                               cel->sourceX, cel->sourceY,
-                                               cel->sourceX, cel->sourceY,
-                                               enc->frame_to_enc->linesize,
-                                               enc->current_frame->linesize,8);
-    else
-        cel->eval_dist[RoQ_ID_MOT] = INT_MAX;
-
-    get_frame_mb(enc->frame_to_enc, cel->sourceX, cel->sourceY, mb8, 8);
-
-    cel->eval_dist[RoQ_ID_SLD] =
-        index_mb(mb8, tempData->codebooks.unpacked_cb4_enlarged,
-                 tempData->codebooks.numCB4, &cel->cbEntry, 8);
-
-    gather_data_for_subcel(cel->subCels + 0, cel->sourceX+0, cel->sourceY+0, enc, tempData);
-    gather_data_for_subcel(cel->subCels + 1, cel->sourceX+4, cel->sourceY+0, enc, tempData);
-    gather_data_for_subcel(cel->subCels + 2, cel->sourceX+0, cel->sourceY+4, enc, tempData);
-    gather_data_for_subcel(cel->subCels + 3, cel->sourceX+4, cel->sourceY+4, enc, tempData);
-
-    cel->eval_dist[RoQ_ID_CCC] = 0;
-    divide_bit_use = 0;
-    for (i=0; i<4; i++) {
-        cel->eval_dist[RoQ_ID_CCC] +=
-            cel->subCels[i].eval_dist[cel->subCels[i].best_coding];
-        divide_bit_use += cel->subCels[i].best_bit_use;
-    }
-
-    best_dist = INT_MAX;
-    bitsUsed[3] = 2 + divide_bit_use;
-
-    for (i=0; i<4; i++)
-        if (ROQ_LAMBDA_SCALE*cel->eval_dist[i] + enc->lambda*bitsUsed[i] <
-            best_dist) {
-            cel->best_coding = i;
-            best_dist = ROQ_LAMBDA_SCALE*cel->eval_dist[i] +
-                enc->lambda*bitsUsed[i];
-        }
-
-    tempData->used_option[cel->best_coding]++;
-    tempData->mainChunkSize += bitsUsed[cel->best_coding];
-
-    if (cel->best_coding == RoQ_ID_SLD)
-        tempData->codebooks.usedCB4[cel->cbEntry]++;
-
-    if (cel->best_coding == RoQ_ID_CCC)
-        for (i=0; i<4; i++) {
-            if (cel->subCels[i].best_coding == RoQ_ID_SLD)
-                tempData->codebooks.usedCB4[cel->subCels[i].cbEntry]++;
-            else if (cel->subCels[i].best_coding == RoQ_ID_CCC)
-                for (j=0; j<4; j++)
-                    tempData->codebooks.usedCB2[cel->subCels[i].subCels[j]]++;
-        }
-}
-
-static void remap_codebooks(RoqContext *enc, RoqTempdata *tempData)
-{
-    int i, j, idx=0;
-
-    /* Make remaps for the final codebook usage */
-    for (i=0; i<MAX_CBS_4x4; i++) {
-        if (tempData->codebooks.usedCB4[i]) {
-            tempData->i2f4[i] = idx;
-            tempData->f2i4[idx] = i;
-            for (j=0; j<4; j++)
-                tempData->codebooks.usedCB2[enc->cb4x4[i].idx[j]]++;
-            idx++;
-        }
-    }
-
-    tempData->numCB4 = idx;
-
-    idx = 0;
-    for (i=0; i<MAX_CBS_2x2; i++) {
-        if (tempData->codebooks.usedCB2[i]) {
-            tempData->i2f2[i] = idx;
-            tempData->f2i2[idx] = i;
-            idx++;
-        }
-    }
-    tempData->numCB2 = idx;
-
-}
-
-/**
- * Write codebook chunk
- */
-static void write_codebooks(RoqContext *enc, RoqTempdata *tempData)
-{
-    int i, j;
-    uint8_t **outp= &enc->out_buf;
-
-    if (tempData->numCB2) {
-        bytestream_put_le16(outp, RoQ_QUAD_CODEBOOK);
-        bytestream_put_le32(outp, tempData->numCB2*6 + tempData->numCB4*4);
-        bytestream_put_byte(outp, tempData->numCB4);
-        bytestream_put_byte(outp, tempData->numCB2);
-
-        for (i=0; i<tempData->numCB2; i++) {
-            bytestream_put_buffer(outp, enc->cb2x2[tempData->f2i2[i]].y, 4);
-            bytestream_put_byte(outp, enc->cb2x2[tempData->f2i2[i]].u);
-            bytestream_put_byte(outp, enc->cb2x2[tempData->f2i2[i]].v);
-        }
-
-        for (i=0; i<tempData->numCB4; i++)
-            for (j=0; j<4; j++)
-                bytestream_put_byte(outp, tempData->i2f2[enc->cb4x4[tempData->f2i4[i]].idx[j]]);
-
-    }
-}
-
-static inline uint8_t motion_arg(motion_vect mot)
-{
-    uint8_t ax = 8 - ((uint8_t) mot.d[0]);
-    uint8_t ay = 8 - ((uint8_t) mot.d[1]);
-    return ((ax&15)<<4) | (ay&15);
-}
-
-typedef struct
-{
-    int typeSpool;
-    int typeSpoolLength;
-    uint8_t argumentSpool[64];
-    uint8_t *args;
-    uint8_t **pout;
-} CodingSpool;
-
-/* NOTE: Typecodes must be spooled AFTER arguments!! */
-static void write_typecode(CodingSpool *s, uint8_t type)
-{
-    s->typeSpool |= (type & 3) << (14 - s->typeSpoolLength);
-    s->typeSpoolLength += 2;
-    if (s->typeSpoolLength == 16) {
-        bytestream_put_le16(s->pout, s->typeSpool);
-        bytestream_put_buffer(s->pout, s->argumentSpool,
-                              s->args - s->argumentSpool);
-        s->typeSpoolLength = 0;
-        s->typeSpool = 0;
-        s->args = s->argumentSpool;
-    }
-}
-
-static void reconstruct_and_encode_image(RoqContext *enc, RoqTempdata *tempData, int w, int h, int numBlocks)
-{
-    int i, j, k;
-    int x, y;
-    int subX, subY;
-    int dist=0;
-
-    roq_qcell *qcell;
-    CelEvaluation *eval;
-
-    CodingSpool spool;
-
-    spool.typeSpool=0;
-    spool.typeSpoolLength=0;
-    spool.args = spool.argumentSpool;
-    spool.pout = &enc->out_buf;
-
-    if (tempData->used_option[RoQ_ID_CCC]%2)
-        tempData->mainChunkSize+=8; //FIXME
-
-    /* Write the video chunk header */
-    bytestream_put_le16(&enc->out_buf, RoQ_QUAD_VQ);
-    bytestream_put_le32(&enc->out_buf, tempData->mainChunkSize/8);
-    bytestream_put_byte(&enc->out_buf, 0x0);
-    bytestream_put_byte(&enc->out_buf, 0x0);
-
-    for (i=0; i<numBlocks; i++) {
-        eval = tempData->cel_evals + i;
-
-        x = eval->sourceX;
-        y = eval->sourceY;
-        dist += eval->eval_dist[eval->best_coding];
-
-        switch (eval->best_coding) {
-        case RoQ_ID_MOT:
-            write_typecode(&spool, RoQ_ID_MOT);
-            break;
-
-        case RoQ_ID_FCC:
-            bytestream_put_byte(&spool.args, motion_arg(eval->motion));
-
-            write_typecode(&spool, RoQ_ID_FCC);
-            ff_apply_motion_8x8(enc, x, y,
-                                eval->motion.d[0], eval->motion.d[1]);
-            break;
-
-        case RoQ_ID_SLD:
-            bytestream_put_byte(&spool.args, tempData->i2f4[eval->cbEntry]);
-            write_typecode(&spool, RoQ_ID_SLD);
-
-            qcell = enc->cb4x4 + eval->cbEntry;
-            ff_apply_vector_4x4(enc, x  , y  , enc->cb2x2 + qcell->idx[0]);
-            ff_apply_vector_4x4(enc, x+4, y  , enc->cb2x2 + qcell->idx[1]);
-            ff_apply_vector_4x4(enc, x  , y+4, enc->cb2x2 + qcell->idx[2]);
-            ff_apply_vector_4x4(enc, x+4, y+4, enc->cb2x2 + qcell->idx[3]);
-            break;
-
-        case RoQ_ID_CCC:
-            write_typecode(&spool, RoQ_ID_CCC);
-
-            for (j=0; j<4; j++) {
-                subX = x + 4*(j&1);
-                subY = y + 2*(j&2);
-
-                switch(eval->subCels[j].best_coding) {
-                case RoQ_ID_MOT:
-                    break;
-
-                case RoQ_ID_FCC:
-                    bytestream_put_byte(&spool.args,
-                                        motion_arg(eval->subCels[j].motion));
-
-                    ff_apply_motion_4x4(enc, subX, subY,
-                                        eval->subCels[j].motion.d[0],
-                                        eval->subCels[j].motion.d[1]);
-                    break;
-
-                case RoQ_ID_SLD:
-                    bytestream_put_byte(&spool.args,
-                                        tempData->i2f4[eval->subCels[j].cbEntry]);
-
-                    qcell = enc->cb4x4 + eval->subCels[j].cbEntry;
-
-                    ff_apply_vector_2x2(enc, subX  , subY  ,
-                                        enc->cb2x2 + qcell->idx[0]);
-                    ff_apply_vector_2x2(enc, subX+2, subY  ,
-                                        enc->cb2x2 + qcell->idx[1]);
-                    ff_apply_vector_2x2(enc, subX  , subY+2,
-                                        enc->cb2x2 + qcell->idx[2]);
-                    ff_apply_vector_2x2(enc, subX+2, subY+2,
-                                        enc->cb2x2 + qcell->idx[3]);
-                    break;
-
-                case RoQ_ID_CCC:
-                    for (k=0; k<4; k++) {
-                        int cb_idx = eval->subCels[j].subCels[k];
-                        bytestream_put_byte(&spool.args,
-                                            tempData->i2f2[cb_idx]);
-
-                        ff_apply_vector_2x2(enc, subX + 2*(k&1), subY + (k&2),
-                                            enc->cb2x2 + cb_idx);
-                    }
-                    break;
-                }
-                write_typecode(&spool, eval->subCels[j].best_coding);
-            }
-            break;
-        }
-    }
-
-    /* Flush the remainder of the argument/type spool */
-    while (spool.typeSpoolLength)
-        write_typecode(&spool, 0x0);
-
-#if 0
-    uint8_t *fdata[3] = {enc->frame_to_enc->data[0],
-                           enc->frame_to_enc->data[1],
-                           enc->frame_to_enc->data[2]};
-    uint8_t *cdata[3] = {enc->current_frame->data[0],
-                           enc->current_frame->data[1],
-                           enc->current_frame->data[2]};
-    av_log(enc->avctx, AV_LOG_ERROR, "Expected distortion: %i Actual: %i\n",
-           dist,
-           block_sse(fdata, cdata, 0, 0, 0, 0,
-                     enc->frame_to_enc->linesize,
-                     enc->current_frame->linesize,
-                     enc->width));  //WARNING: Square dimensions implied...
-#endif
-}
-
-
-/**
- * Create a single YUV cell from a 2x2 section of the image
- */
-static inline void frame_block_to_cell(uint8_t *block, uint8_t * const *data,
-                                       int top, int left, const int *stride)
-{
-    int i, j, u=0, v=0;
-
-    for (i=0; i<2; i++)
-        for (j=0; j<2; j++) {
-            int x = (top+i)*stride[0] + left + j;
-            *block++ = data[0][x];
-            x = (top+i)*stride[1] + left + j;
-            u       += data[1][x];
-            v       += data[2][x];
-        }
-
-    *block++ = (u+2)/4;
-    *block++ = (v+2)/4;
-}
-
-/**
- * Create YUV clusters for the entire image
- */
-static void create_clusters(const AVFrame *frame, int w, int h, uint8_t *yuvClusters)
-{
-    int i, j, k, l;
-
-    for (i=0; i<h; i+=4)
-        for (j=0; j<w; j+=4) {
-            for (k=0; k < 2; k++)
-                for (l=0; l < 2; l++)
-                    frame_block_to_cell(yuvClusters + (l + 2*k)*6, frame->data,
-                                        i+2*k, j+2*l, frame->linesize);
-            yuvClusters += 24;
-        }
-}
-
-static void generate_codebook(RoqContext *enc, RoqTempdata *tempdata,
-                              int *points, int inputCount, roq_cell *results,
-                              int size, int cbsize)
-{
-    int i, j, k;
-    int c_size = size*size/4;
-    int *buf;
-    int *codebook = av_malloc(6*c_size*cbsize*sizeof(int));
-    int *closest_cb;
-
-    if (size == 4)
-        closest_cb = av_malloc(6*c_size*inputCount*sizeof(int));
-    else
-        closest_cb = tempdata->closest_cb2;
-
-    ff_init_elbg(points, 6*c_size, inputCount, codebook, cbsize, 1, closest_cb, &enc->randctx);
-    ff_do_elbg(points, 6*c_size, inputCount, codebook, cbsize, 1, closest_cb, &enc->randctx);
-
-    if (size == 4)
-        av_free(closest_cb);
-
-    buf = codebook;
-    for (i=0; i<cbsize; i++)
-        for (k=0; k<c_size; k++) {
-            for(j=0; j<4; j++)
-                results->y[j] = *buf++;
-
-            results->u =    (*buf++ + CHROMA_BIAS/2)/CHROMA_BIAS;
-            results->v =    (*buf++ + CHROMA_BIAS/2)/CHROMA_BIAS;
-            results++;
-        }
-
-    av_free(codebook);
-}
-
-static void generate_new_codebooks(RoqContext *enc, RoqTempdata *tempData)
-{
-    int i,j;
-    RoqCodebooks *codebooks = &tempData->codebooks;
-    int max = enc->width*enc->height/16;
-    uint8_t mb2[3*4];
-    roq_cell *results4 = av_malloc(sizeof(roq_cell)*MAX_CBS_4x4*4);
-    uint8_t *yuvClusters=av_malloc(sizeof(int)*max*6*4);
-    int *points = av_malloc(max*6*4*sizeof(int));
-    int bias;
-
-    /* Subsample YUV data */
-    create_clusters(enc->frame_to_enc, enc->width, enc->height, yuvClusters);
-
-    /* Cast to integer and apply chroma bias */
-    for (i=0; i<max*24; i++) {
-        bias = ((i%6)<4) ? 1 : CHROMA_BIAS;
-        points[i] = bias*yuvClusters[i];
-    }
-
-    /* Create 4x4 codebooks */
-    generate_codebook(enc, tempData, points, max, results4, 4, MAX_CBS_4x4);
-
-    codebooks->numCB4 = MAX_CBS_4x4;
-
-    tempData->closest_cb2 = av_malloc(max*4*sizeof(int));
-
-    /* Create 2x2 codebooks */
-    generate_codebook(enc, tempData, points, max*4, enc->cb2x2, 2, MAX_CBS_2x2);
-
-    codebooks->numCB2 = MAX_CBS_2x2;
-
-    /* Unpack 2x2 codebook clusters */
-    for (i=0; i<codebooks->numCB2; i++)
-        unpack_roq_cell(enc->cb2x2 + i, codebooks->unpacked_cb2 + i*2*2*3);
-
-    /* Index all 4x4 entries to the 2x2 entries, unpack, and enlarge */
-    for (i=0; i<codebooks->numCB4; i++) {
-        for (j=0; j<4; j++) {
-            unpack_roq_cell(&results4[4*i + j], mb2);
-            index_mb(mb2, codebooks->unpacked_cb2, codebooks->numCB2,
-                     &enc->cb4x4[i].idx[j], 2);
-        }
-        unpack_roq_qcell(codebooks->unpacked_cb2, enc->cb4x4 + i,
-                         codebooks->unpacked_cb4 + i*4*4*3);
-        enlarge_roq_mb4(codebooks->unpacked_cb4 + i*4*4*3,
-                        codebooks->unpacked_cb4_enlarged + i*8*8*3);
-    }
-
-    av_free(yuvClusters);
-    av_free(points);
-    av_free(results4);
-}
-
-static void roq_encode_video(RoqContext *enc)
-{
-    RoqTempdata *tempData = enc->tmpData;
-    int i;
-
-    memset(tempData, 0, sizeof(*tempData));
-
-    create_cel_evals(enc, tempData);
-
-    generate_new_codebooks(enc, tempData);
-
-    if (enc->framesSinceKeyframe >= 1) {
-        motion_search(enc, 8);
-        motion_search(enc, 4);
-    }
-
- retry_encode:
-    for (i=0; i<enc->width*enc->height/64; i++)
-        gather_data_for_cel(tempData->cel_evals + i, enc, tempData);
-
-    /* Quake 3 can't handle chunks bigger than 65535 bytes */
-    if (tempData->mainChunkSize/8 > 65535) {
-        av_log(enc->avctx, AV_LOG_ERROR,
-               "Warning, generated a frame too big (%d > 65535), "
-               "try using a smaller qscale value.\n",
-               tempData->mainChunkSize/8);
-        enc->lambda *= 1.5;
-        tempData->mainChunkSize = 0;
-        memset(tempData->used_option, 0, sizeof(tempData->used_option));
-        memset(tempData->codebooks.usedCB4, 0,
-               sizeof(tempData->codebooks.usedCB4));
-        memset(tempData->codebooks.usedCB2, 0,
-               sizeof(tempData->codebooks.usedCB2));
-
-        goto retry_encode;
-    }
-
-    remap_codebooks(enc, tempData);
-
-    write_codebooks(enc, tempData);
-
-    reconstruct_and_encode_image(enc, tempData, enc->width, enc->height,
-                                 enc->width*enc->height/64);
-
-    enc->avctx->coded_frame = enc->current_frame;
-
-    /* Rotate frame history */
-    FFSWAP(AVFrame *, enc->current_frame, enc->last_frame);
-    FFSWAP(motion_vect *, enc->last_motion4, enc->this_motion4);
-    FFSWAP(motion_vect *, enc->last_motion8, enc->this_motion8);
-
-    av_free(tempData->cel_evals);
-    av_free(tempData->closest_cb2);
-
-    enc->framesSinceKeyframe++;
-}
-
-static av_cold int roq_encode_end(AVCodecContext *avctx)
-{
-    RoqContext *enc = avctx->priv_data;
-
-    av_frame_free(&enc->current_frame);
-    av_frame_free(&enc->last_frame);
-
-    av_free(enc->tmpData);
-    av_free(enc->this_motion4);
-    av_free(enc->last_motion4);
-    av_free(enc->this_motion8);
-    av_free(enc->last_motion8);
-
-    return 0;
-}
-
-static av_cold int roq_encode_init(AVCodecContext *avctx)
-{
-    RoqContext *enc = avctx->priv_data;
-
-    av_lfg_init(&enc->randctx, 1);
-
-    enc->framesSinceKeyframe = 0;
-    if ((avctx->width & 0xf) || (avctx->height & 0xf)) {
-        av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n");
-        return -1;
-    }
-
-    if (((avctx->width)&(avctx->width-1))||((avctx->height)&(avctx->height-1)))
-        av_log(avctx, AV_LOG_ERROR, "Warning: dimensions not power of two\n");
-
-    enc->width = avctx->width;
-    enc->height = avctx->height;
-
-    enc->framesSinceKeyframe = 0;
-    enc->first_frame = 1;
-
-    enc->last_frame    = av_frame_alloc();
-    enc->current_frame = av_frame_alloc();
-    if (!enc->last_frame || !enc->current_frame) {
-        roq_encode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    enc->tmpData      = av_malloc(sizeof(RoqTempdata));
-
-    enc->this_motion4 =
-        av_mallocz((enc->width*enc->height/16)*sizeof(motion_vect));
-
-    enc->last_motion4 =
-        av_malloc ((enc->width*enc->height/16)*sizeof(motion_vect));
-
-    enc->this_motion8 =
-        av_mallocz((enc->width*enc->height/64)*sizeof(motion_vect));
-
-    enc->last_motion8 =
-        av_malloc ((enc->width*enc->height/64)*sizeof(motion_vect));
-
-    return 0;
-}
-
-static void roq_write_video_info_chunk(RoqContext *enc)
-{
-    /* ROQ info chunk */
-    bytestream_put_le16(&enc->out_buf, RoQ_INFO);
-
-    /* Size: 8 bytes */
-    bytestream_put_le32(&enc->out_buf, 8);
-
-    /* Unused argument */
-    bytestream_put_byte(&enc->out_buf, 0x00);
-    bytestream_put_byte(&enc->out_buf, 0x00);
-
-    /* Width */
-    bytestream_put_le16(&enc->out_buf, enc->width);
-
-    /* Height */
-    bytestream_put_le16(&enc->out_buf, enc->height);
-
-    /* Unused in Quake 3, mimics the output of the real encoder */
-    bytestream_put_byte(&enc->out_buf, 0x08);
-    bytestream_put_byte(&enc->out_buf, 0x00);
-    bytestream_put_byte(&enc->out_buf, 0x04);
-    bytestream_put_byte(&enc->out_buf, 0x00);
-}
-
-static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                            const AVFrame *frame, int *got_packet)
-{
-    RoqContext *enc = avctx->priv_data;
-    int size, ret;
-
-    enc->avctx = avctx;
-
-    enc->frame_to_enc = frame;
-
-    if (frame->quality)
-        enc->lambda = frame->quality - 1;
-    else
-        enc->lambda = 2*ROQ_LAMBDA_SCALE;
-
-    /* 138 bits max per 8x8 block +
-     *     256 codebooks*(6 bytes 2x2 + 4 bytes 4x4) + 8 bytes frame header */
-    size = ((enc->width * enc->height / 64) * 138 + 7) / 8 + 256 * (6 + 4) + 8;
-    if ((ret = ff_alloc_packet(pkt, size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet with size %d.\n", size);
-        return ret;
-    }
-    enc->out_buf = pkt->data;
-
-    /* Check for I frame */
-    if (enc->framesSinceKeyframe == avctx->gop_size)
-        enc->framesSinceKeyframe = 0;
-
-    if (enc->first_frame) {
-        /* Alloc memory for the reconstruction data (we must know the stride
-         for that) */
-        if (ff_get_buffer(avctx, enc->current_frame, 0) ||
-            ff_get_buffer(avctx, enc->last_frame, 0)) {
-            av_log(avctx, AV_LOG_ERROR, "  RoQ: get_buffer() failed\n");
-            return -1;
-        }
-
-        /* Before the first video frame, write a "video info" chunk */
-        roq_write_video_info_chunk(enc);
-
-        enc->first_frame = 0;
-    }
-
-    /* Encode the actual frame */
-    roq_encode_video(enc);
-
-    pkt->size   = enc->out_buf - pkt->data;
-    if (enc->framesSinceKeyframe == 1)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-AVCodec ff_roq_encoder = {
-    .name                 = "roqvideo",
-    .long_name            = NULL_IF_CONFIG_SMALL("id RoQ video"),
-    .type                 = AVMEDIA_TYPE_VIDEO,
-    .id                   = AV_CODEC_ID_ROQ,
-    .priv_data_size       = sizeof(RoqContext),
-    .init                 = roq_encode_init,
-    .encode2              = roq_encode_frame,
-    .close                = roq_encode_end,
-    .supported_framerates = (const AVRational[]){ {30,1}, {0,0} },
-    .pix_fmts             = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P,
-                                                        AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/rpza.c b/deps/libav/libavcodec/rpza.c
deleted file mode 100644
index 83dde7a..0000000
--- a/deps/libav/libavcodec/rpza.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Quicktime Video (RPZA) Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * QT RPZA Video Decoder by Roberto Togni
- * For more information about the RPZA format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *
- * The RPZA decoder outputs RGB555 colorspace data.
- *
- * Note that this decoder reads big endian RGB555 pixel values from the
- * bytestream, arranges them in the host's endian order, and outputs
- * them to the final rendered map in the same host endian order. This is
- * intended behavior as the libavcodec documentation states that RGB555
- * pixels shall be stored in native CPU endianness.
- */
-
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/internal.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-typedef struct RpzaContext {
-
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    GetByteContext gb;
-} RpzaContext;
-
-#define ADVANCE_BLOCK() \
-{ \
-    pixel_ptr += 4; \
-    if (pixel_ptr >= width) \
-    { \
-        pixel_ptr = 0; \
-        row_ptr += stride * 4; \
-    } \
-    total_blocks--; \
-    if (total_blocks < 0) \
-    { \
-        av_log(s->avctx, AV_LOG_ERROR, "warning: block counter just went negative (this should not happen)\n"); \
-        return; \
-    } \
-}
-
-static void rpza_decode_stream(RpzaContext *s)
-{
-    int width = s->avctx->width;
-    int stride = s->frame->linesize[0] / 2;
-    int row_inc = stride - 4;
-    int chunk_size;
-    uint16_t colorA = 0, colorB;
-    uint16_t color4[4];
-    uint16_t ta, tb;
-    uint16_t *pixels = (uint16_t *)s->frame->data[0];
-
-    int row_ptr = 0;
-    int pixel_ptr = 0;
-    int block_ptr;
-    int pixel_x, pixel_y;
-    int total_blocks;
-
-    /* First byte is always 0xe1. Warn if it's different */
-    if (bytestream2_peek_byte(&s->gb) != 0xe1)
-        av_log(s->avctx, AV_LOG_ERROR, "First chunk byte is 0x%02x instead of 0xe1\n",
-               bytestream2_peek_byte(&s->gb));
-
-    /* Get chunk size, ingnoring first byte */
-    chunk_size = bytestream2_get_be32(&s->gb) & 0x00FFFFFF;
-
-    /* If length mismatch use size from MOV file and try to decode anyway */
-    if (chunk_size != bytestream2_get_bytes_left(&s->gb) - 4)
-        av_log(s->avctx, AV_LOG_WARNING, "MOV chunk size != encoded chunk size\n");
-
-    /* Number of 4x4 blocks in frame. */
-    total_blocks = ((s->avctx->width + 3) / 4) * ((s->avctx->height + 3) / 4);
-
-    /* Process chunk data */
-    while (bytestream2_get_bytes_left(&s->gb)) {
-        uint8_t opcode = bytestream2_get_byte(&s->gb); /* Get opcode */
-
-        int n_blocks = (opcode & 0x1f) + 1; /* Extract block counter from opcode */
-
-        /* If opcode MSbit is 0, we need more data to decide what to do */
-        if ((opcode & 0x80) == 0) {
-            colorA = (opcode << 8) | bytestream2_get_byte(&s->gb);
-            opcode = 0;
-            if ((bytestream2_peek_byte(&s->gb) & 0x80) != 0) {
-                /* Must behave as opcode 110xxxxx, using colorA computed
-                 * above. Use fake opcode 0x20 to enter switch block at
-                 * the right place */
-                opcode = 0x20;
-                n_blocks = 1;
-            }
-        }
-
-        n_blocks = FFMIN(n_blocks, total_blocks);
-
-        switch (opcode & 0xe0) {
-
-        /* Skip blocks */
-        case 0x80:
-            while (n_blocks--) {
-              ADVANCE_BLOCK();
-            }
-            break;
-
-        /* Fill blocks with one color */
-        case 0xa0:
-            colorA = bytestream2_get_be16(&s->gb);
-            while (n_blocks--) {
-                block_ptr = row_ptr + pixel_ptr;
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++){
-                        pixels[block_ptr] = colorA;
-                        block_ptr++;
-                    }
-                    block_ptr += row_inc;
-                }
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        /* Fill blocks with 4 colors */
-        case 0xc0:
-            colorA = bytestream2_get_be16(&s->gb);
-        case 0x20:
-            colorB = bytestream2_get_be16(&s->gb);
-
-            /* sort out the colors */
-            color4[0] = colorB;
-            color4[1] = 0;
-            color4[2] = 0;
-            color4[3] = colorA;
-
-            /* red components */
-            ta = (colorA >> 10) & 0x1F;
-            tb = (colorB >> 10) & 0x1F;
-            color4[1] |= ((11 * ta + 21 * tb) >> 5) << 10;
-            color4[2] |= ((21 * ta + 11 * tb) >> 5) << 10;
-
-            /* green components */
-            ta = (colorA >> 5) & 0x1F;
-            tb = (colorB >> 5) & 0x1F;
-            color4[1] |= ((11 * ta + 21 * tb) >> 5) << 5;
-            color4[2] |= ((21 * ta + 11 * tb) >> 5) << 5;
-
-            /* blue components */
-            ta = colorA & 0x1F;
-            tb = colorB & 0x1F;
-            color4[1] |= ((11 * ta + 21 * tb) >> 5);
-            color4[2] |= ((21 * ta + 11 * tb) >> 5);
-
-            if (bytestream2_get_bytes_left(&s->gb) < n_blocks * 4)
-                return;
-            while (n_blocks--) {
-                block_ptr = row_ptr + pixel_ptr;
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    uint8_t index = bytestream2_get_byteu(&s->gb);
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++){
-                        uint8_t idx = (index >> (2 * (3 - pixel_x))) & 0x03;
-                        pixels[block_ptr] = color4[idx];
-                        block_ptr++;
-                    }
-                    block_ptr += row_inc;
-                }
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        /* Fill block with 16 colors */
-        case 0x00:
-            if (bytestream2_get_bytes_left(&s->gb) < 30)
-                return;
-            block_ptr = row_ptr + pixel_ptr;
-            for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                for (pixel_x = 0; pixel_x < 4; pixel_x++){
-                    /* We already have color of upper left pixel */
-                    if ((pixel_y != 0) || (pixel_x != 0))
-                        colorA = bytestream2_get_be16u(&s->gb);
-                    pixels[block_ptr] = colorA;
-                    block_ptr++;
-                }
-                block_ptr += row_inc;
-            }
-            ADVANCE_BLOCK();
-            break;
-
-        /* Unknown opcode */
-        default:
-            av_log(s->avctx, AV_LOG_ERROR, "Unknown opcode %d in rpza chunk."
-                 " Skip remaining %d bytes of chunk data.\n", opcode,
-                 bytestream2_get_bytes_left(&s->gb));
-            return;
-        } /* Opcode switch */
-    }
-}
-
-static av_cold int rpza_decode_init(AVCodecContext *avctx)
-{
-    RpzaContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_RGB555;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int rpza_decode_frame(AVCodecContext *avctx,
-                             void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    RpzaContext *s = avctx->priv_data;
-    int ret;
-
-    bytestream2_init(&s->gb, avpkt->data, avpkt->size);
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    rpza_decode_stream(s);
-
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    *got_frame      = 1;
-
-    /* always report that the buffer was completely consumed */
-    return avpkt->size;
-}
-
-static av_cold int rpza_decode_end(AVCodecContext *avctx)
-{
-    RpzaContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_rpza_decoder = {
-    .name           = "rpza",
-    .long_name      = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_RPZA,
-    .priv_data_size = sizeof(RpzaContext),
-    .init           = rpza_decode_init,
-    .close          = rpza_decode_end,
-    .decode         = rpza_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/rtjpeg.c b/deps/libav/libavcodec/rtjpeg.c
deleted file mode 100644
index f5abe63..0000000
--- a/deps/libav/libavcodec/rtjpeg.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * RTJpeg decoding functions
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "libavutil/common.h"
-#include "get_bits.h"
-#include "rtjpeg.h"
-
-#define PUT_COEFF(c) \
-    i = scan[coeff--]; \
-    block[i] = (c) * quant[i];
-
-/// aligns the bitstream to the given power of two
-#define ALIGN(a) \
-    n = (-get_bits_count(gb)) & (a - 1); \
-    if (n) {skip_bits(gb, n);}
-
-/**
- * @brief read one block from stream
- * @param gb contains stream data
- * @param block where data is written to
- * @param scan array containing the mapping stream address -> block position
- * @param quant quantization factors
- * @return 0 means the block is not coded, < 0 means an error occurred.
- *
- * Note: GetBitContext is used to make the code simpler, since all data is
- * aligned this could be done faster in a different way, e.g. as it is done
- * in MPlayer libmpcodecs/native/rtjpegn.c.
- */
-static inline int get_block(GetBitContext *gb, int16_t *block, const uint8_t *scan,
-                            const uint32_t *quant) {
-    int coeff, i, n;
-    int8_t ac;
-    uint8_t dc = get_bits(gb, 8);
-
-    // block not coded
-    if (dc == 255)
-       return 0;
-
-    // number of non-zero coefficients
-    coeff = get_bits(gb, 6);
-    if (get_bits_left(gb) < (coeff << 1))
-        return AVERROR_INVALIDDATA;
-
-    // normally we would only need to clear the (63 - coeff) last values,
-    // but since we do not know where they are we just clear the whole block
-    memset(block, 0, 64 * sizeof(int16_t));
-
-    // 2 bits per coefficient
-    while (coeff) {
-        ac = get_sbits(gb, 2);
-        if (ac == -2)
-            break; // continue with more bits
-        PUT_COEFF(ac);
-    }
-
-    // 4 bits per coefficient
-    ALIGN(4);
-    if (get_bits_left(gb) < (coeff << 2))
-        return AVERROR_INVALIDDATA;
-    while (coeff) {
-        ac = get_sbits(gb, 4);
-        if (ac == -8)
-            break; // continue with more bits
-        PUT_COEFF(ac);
-    }
-
-    // 8 bits per coefficient
-    ALIGN(8);
-    if (get_bits_left(gb) < (coeff << 3))
-        return AVERROR_INVALIDDATA;
-    while (coeff) {
-        ac = get_sbits(gb, 8);
-        PUT_COEFF(ac);
-    }
-
-    PUT_COEFF(dc);
-    return 1;
-}
-
-/**
- * @brief decode one rtjpeg YUV420 frame
- * @param c context, must be initialized via ff_rtjpeg_decode_init
- * @param f AVFrame to place decoded frame into. If parts of the frame
- *          are not coded they are left unchanged, so consider initializing it
- * @param buf buffer containing input data
- * @param buf_size length of input data in bytes
- * @return number of bytes consumed from the input buffer
- */
-int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
-                                  const uint8_t *buf, int buf_size) {
-    GetBitContext gb;
-    int w = c->w / 16, h = c->h / 16;
-    int x, y, ret;
-    uint8_t *y1 = f->data[0], *y2 = f->data[0] + 8 * f->linesize[0];
-    uint8_t *u = f->data[1], *v = f->data[2];
-
-    if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0)
-        return ret;
-
-    for (y = 0; y < h; y++) {
-        for (x = 0; x < w; x++) {
-#define BLOCK(quant, dst, stride) do { \
-    int res = get_block(&gb, block, c->scan, quant); \
-    if (res < 0) \
-        return res; \
-    if (res > 0) \
-        c->dsp->idct_put(dst, stride, block); \
-} while (0)
-            int16_t *block = c->block;
-            BLOCK(c->lquant, y1, f->linesize[0]);
-            y1 += 8;
-            BLOCK(c->lquant, y1, f->linesize[0]);
-            y1 += 8;
-            BLOCK(c->lquant, y2, f->linesize[0]);
-            y2 += 8;
-            BLOCK(c->lquant, y2, f->linesize[0]);
-            y2 += 8;
-            BLOCK(c->cquant, u,  f->linesize[1]);
-            u += 8;
-            BLOCK(c->cquant, v,  f->linesize[2]);
-            v += 8;
-        }
-        y1 += 2 * 8 * (f->linesize[0] - w);
-        y2 += 2 * 8 * (f->linesize[0] - w);
-        u += 8 * (f->linesize[1] - w);
-        v += 8 * (f->linesize[2] - w);
-    }
-    return get_bits_count(&gb) / 8;
-}
-
-/**
- * @brief initialize an RTJpegContext, may be called multiple times
- * @param c context to initialize
- * @param dsp specifies the idct to use for decoding
- * @param width width of image, will be rounded down to the nearest multiple
- *              of 16 for decoding
- * @param height height of image, will be rounded down to the nearest multiple
- *              of 16 for decoding
- * @param lquant luma quantization table to use
- * @param cquant chroma quantization table to use
- */
-void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
-                           int width, int height,
-                           const uint32_t *lquant, const uint32_t *cquant) {
-    int i;
-    c->dsp = dsp;
-    for (i = 0; i < 64; i++) {
-        int z = ff_zigzag_direct[i];
-        int p = c->dsp->idct_permutation[i];
-        z = ((z << 3) | (z >> 3)) & 63; // rtjpeg uses a transposed variant
-
-        // permute the scan and quantization tables for the chosen idct
-        c->scan[i] = c->dsp->idct_permutation[z];
-        c->lquant[p] = lquant[i];
-        c->cquant[p] = cquant[i];
-    }
-    c->w = width;
-    c->h = height;
-}
diff --git a/deps/libav/libavcodec/rtjpeg.h b/deps/libav/libavcodec/rtjpeg.h
deleted file mode 100644
index c544b0b..0000000
--- a/deps/libav/libavcodec/rtjpeg.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * RTJpeg decoding functions
- * copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_RTJPEG_H
-#define AVCODEC_RTJPEG_H
-
-#include <stdint.h>
-#include "dsputil.h"
-#include "libavutil/mem.h"
-
-#define RTJPEG_FILE_VERSION 0
-#define RTJPEG_HEADER_SIZE 12
-
-typedef struct RTJpegContext {
-    int w, h;
-    DSPContext *dsp;
-    uint8_t scan[64];
-    uint32_t lquant[64];
-    uint32_t cquant[64];
-    DECLARE_ALIGNED(16, int16_t, block)[64];
-} RTJpegContext;
-
-void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
-                        int width, int height,
-                        const uint32_t *lquant, const uint32_t *cquant);
-
-int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
-                               const uint8_t *buf, int buf_size);
-#endif /* AVCODEC_RTJPEG_H */
diff --git a/deps/libav/libavcodec/rv10.c b/deps/libav/libavcodec/rv10.c
deleted file mode 100644
index 51affa8..0000000
--- a/deps/libav/libavcodec/rv10.c
+++ /dev/null
@@ -1,767 +0,0 @@
-/*
- * RV10/RV20 decoder
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV10/RV20 decoder
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "error_resilience.h"
-#include "internal.h"
-#include "mpegvideo.h"
-#include "mpeg4video.h"
-#include "h263.h"
-
-#define RV_GET_MAJOR_VER(x)  ((x) >> 28)
-#define RV_GET_MINOR_VER(x) (((x) >> 20) & 0xFF)
-#define RV_GET_MICRO_VER(x) (((x) >> 12) & 0xFF)
-
-#define DC_VLC_BITS 14 //FIXME find a better solution
-
-typedef struct RVDecContext {
-    MpegEncContext m;
-    int sub_id;
-} RVDecContext;
-
-static const uint16_t rv_lum_code[256] = {
-    0x3e7f, 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06,
-    0x0f07, 0x0f08, 0x0f09, 0x0f0a, 0x0f0b, 0x0f0c, 0x0f0d, 0x0f0e,
-    0x0f0f, 0x0f10, 0x0f11, 0x0f12, 0x0f13, 0x0f14, 0x0f15, 0x0f16,
-    0x0f17, 0x0f18, 0x0f19, 0x0f1a, 0x0f1b, 0x0f1c, 0x0f1d, 0x0f1e,
-    0x0f1f, 0x0f20, 0x0f21, 0x0f22, 0x0f23, 0x0f24, 0x0f25, 0x0f26,
-    0x0f27, 0x0f28, 0x0f29, 0x0f2a, 0x0f2b, 0x0f2c, 0x0f2d, 0x0f2e,
-    0x0f2f, 0x0f30, 0x0f31, 0x0f32, 0x0f33, 0x0f34, 0x0f35, 0x0f36,
-    0x0f37, 0x0f38, 0x0f39, 0x0f3a, 0x0f3b, 0x0f3c, 0x0f3d, 0x0f3e,
-    0x0f3f, 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0386,
-    0x0387, 0x0388, 0x0389, 0x038a, 0x038b, 0x038c, 0x038d, 0x038e,
-    0x038f, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396,
-    0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e,
-    0x039f, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6,
-    0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce,
-    0x00cf, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056,
-    0x0057, 0x0020, 0x0021, 0x0022, 0x0023, 0x000c, 0x000d, 0x0004,
-    0x0000, 0x0005, 0x000e, 0x000f, 0x0024, 0x0025, 0x0026, 0x0027,
-    0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
-    0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
-    0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
-    0x03a0, 0x03a1, 0x03a2, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
-    0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af,
-    0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
-    0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
-    0x0f40, 0x0f41, 0x0f42, 0x0f43, 0x0f44, 0x0f45, 0x0f46, 0x0f47,
-    0x0f48, 0x0f49, 0x0f4a, 0x0f4b, 0x0f4c, 0x0f4d, 0x0f4e, 0x0f4f,
-    0x0f50, 0x0f51, 0x0f52, 0x0f53, 0x0f54, 0x0f55, 0x0f56, 0x0f57,
-    0x0f58, 0x0f59, 0x0f5a, 0x0f5b, 0x0f5c, 0x0f5d, 0x0f5e, 0x0f5f,
-    0x0f60, 0x0f61, 0x0f62, 0x0f63, 0x0f64, 0x0f65, 0x0f66, 0x0f67,
-    0x0f68, 0x0f69, 0x0f6a, 0x0f6b, 0x0f6c, 0x0f6d, 0x0f6e, 0x0f6f,
-    0x0f70, 0x0f71, 0x0f72, 0x0f73, 0x0f74, 0x0f75, 0x0f76, 0x0f77,
-    0x0f78, 0x0f79, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f7e, 0x0f7f,
-};
-
-static const uint8_t rv_lum_bits[256] = {
-    14, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  8,  8,  8,  8,  8,  8,
-     8,  7,  7,  7,  7,  7,  7,  7,
-     7,  6,  6,  6,  6,  5,  5,  4,
-     2,  4,  5,  5,  6,  6,  6,  6,
-     7,  7,  7,  7,  7,  7,  7,  7,
-     8,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  8,  8,  8,  8,  8,  8,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-};
-
-static const uint16_t rv_chrom_code[256] = {
-    0xfe7f, 0x3f00, 0x3f01, 0x3f02, 0x3f03, 0x3f04, 0x3f05, 0x3f06,
-    0x3f07, 0x3f08, 0x3f09, 0x3f0a, 0x3f0b, 0x3f0c, 0x3f0d, 0x3f0e,
-    0x3f0f, 0x3f10, 0x3f11, 0x3f12, 0x3f13, 0x3f14, 0x3f15, 0x3f16,
-    0x3f17, 0x3f18, 0x3f19, 0x3f1a, 0x3f1b, 0x3f1c, 0x3f1d, 0x3f1e,
-    0x3f1f, 0x3f20, 0x3f21, 0x3f22, 0x3f23, 0x3f24, 0x3f25, 0x3f26,
-    0x3f27, 0x3f28, 0x3f29, 0x3f2a, 0x3f2b, 0x3f2c, 0x3f2d, 0x3f2e,
-    0x3f2f, 0x3f30, 0x3f31, 0x3f32, 0x3f33, 0x3f34, 0x3f35, 0x3f36,
-    0x3f37, 0x3f38, 0x3f39, 0x3f3a, 0x3f3b, 0x3f3c, 0x3f3d, 0x3f3e,
-    0x3f3f, 0x0f80, 0x0f81, 0x0f82, 0x0f83, 0x0f84, 0x0f85, 0x0f86,
-    0x0f87, 0x0f88, 0x0f89, 0x0f8a, 0x0f8b, 0x0f8c, 0x0f8d, 0x0f8e,
-    0x0f8f, 0x0f90, 0x0f91, 0x0f92, 0x0f93, 0x0f94, 0x0f95, 0x0f96,
-    0x0f97, 0x0f98, 0x0f99, 0x0f9a, 0x0f9b, 0x0f9c, 0x0f9d, 0x0f9e,
-    0x0f9f, 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6,
-    0x03c7, 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce,
-    0x03cf, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6,
-    0x00e7, 0x0030, 0x0031, 0x0032, 0x0033, 0x0008, 0x0009, 0x0002,
-    0x0000, 0x0003, 0x000a, 0x000b, 0x0034, 0x0035, 0x0036, 0x0037,
-    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
-    0x03d0, 0x03d1, 0x03d2, 0x03d3, 0x03d4, 0x03d5, 0x03d6, 0x03d7,
-    0x03d8, 0x03d9, 0x03da, 0x03db, 0x03dc, 0x03dd, 0x03de, 0x03df,
-    0x0fa0, 0x0fa1, 0x0fa2, 0x0fa3, 0x0fa4, 0x0fa5, 0x0fa6, 0x0fa7,
-    0x0fa8, 0x0fa9, 0x0faa, 0x0fab, 0x0fac, 0x0fad, 0x0fae, 0x0faf,
-    0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7,
-    0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0fbd, 0x0fbe, 0x0fbf,
-    0x3f40, 0x3f41, 0x3f42, 0x3f43, 0x3f44, 0x3f45, 0x3f46, 0x3f47,
-    0x3f48, 0x3f49, 0x3f4a, 0x3f4b, 0x3f4c, 0x3f4d, 0x3f4e, 0x3f4f,
-    0x3f50, 0x3f51, 0x3f52, 0x3f53, 0x3f54, 0x3f55, 0x3f56, 0x3f57,
-    0x3f58, 0x3f59, 0x3f5a, 0x3f5b, 0x3f5c, 0x3f5d, 0x3f5e, 0x3f5f,
-    0x3f60, 0x3f61, 0x3f62, 0x3f63, 0x3f64, 0x3f65, 0x3f66, 0x3f67,
-    0x3f68, 0x3f69, 0x3f6a, 0x3f6b, 0x3f6c, 0x3f6d, 0x3f6e, 0x3f6f,
-    0x3f70, 0x3f71, 0x3f72, 0x3f73, 0x3f74, 0x3f75, 0x3f76, 0x3f77,
-    0x3f78, 0x3f79, 0x3f7a, 0x3f7b, 0x3f7c, 0x3f7d, 0x3f7e, 0x3f7f,
-};
-
-static const uint8_t rv_chrom_bits[256] = {
-    16, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10,  8,  8,  8,  8,  8,  8,  8,
-     8,  6,  6,  6,  6,  4,  4,  3,
-     2,  3,  4,  4,  6,  6,  6,  6,
-     8,  8,  8,  8,  8,  8,  8,  8,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 14, 14, 14,
-};
-
-static VLC rv_dc_lum, rv_dc_chrom;
-
-int ff_rv_decode_dc(MpegEncContext *s, int n)
-{
-    int code;
-
-    if (n < 4) {
-        code = get_vlc2(&s->gb, rv_dc_lum.table, DC_VLC_BITS, 2);
-        if (code < 0) {
-            /* XXX: I don't understand why they use LONGER codes than
-               necessary. The following code would be completely useless
-               if they had thought about it !!! */
-            code = get_bits(&s->gb, 7);
-            if (code == 0x7c) {
-                code = (int8_t)(get_bits(&s->gb, 7) + 1);
-            } else if (code == 0x7d) {
-                code = -128 + get_bits(&s->gb, 7);
-            } else if (code == 0x7e) {
-                if (get_bits1(&s->gb) == 0)
-                    code = (int8_t)(get_bits(&s->gb, 8) + 1);
-                else
-                    code = (int8_t)(get_bits(&s->gb, 8));
-            } else if (code == 0x7f) {
-                skip_bits(&s->gb, 11);
-                code = 1;
-            }
-        } else {
-            code -= 128;
-        }
-    } else {
-        code = get_vlc2(&s->gb, rv_dc_chrom.table, DC_VLC_BITS, 2);
-        /* same remark */
-        if (code < 0) {
-            code = get_bits(&s->gb, 9);
-            if (code == 0x1fc) {
-                code = (int8_t)(get_bits(&s->gb, 7) + 1);
-            } else if (code == 0x1fd) {
-                code = -128 + get_bits(&s->gb, 7);
-            } else if (code == 0x1fe) {
-                skip_bits(&s->gb, 9);
-                code = 1;
-            } else {
-                av_log(s->avctx, AV_LOG_ERROR, "chroma dc error\n");
-                return 0xffff;
-            }
-        } else {
-            code -= 128;
-        }
-    }
-    return -code;
-}
-
-/* read RV 1.0 compatible frame header */
-static int rv10_decode_picture_header(MpegEncContext *s)
-{
-    int mb_count, pb_frame, marker, mb_xy;
-
-    marker = get_bits1(&s->gb);
-
-    if (get_bits1(&s->gb))
-        s->pict_type = AV_PICTURE_TYPE_P;
-    else
-        s->pict_type = AV_PICTURE_TYPE_I;
-
-    if (!marker)
-        av_log(s->avctx, AV_LOG_ERROR, "marker missing\n");
-
-    pb_frame = get_bits1(&s->gb);
-
-    av_dlog(s->avctx, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
-
-    if (pb_frame) {
-        avpriv_request_sample(s->avctx, "pb frame");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    s->qscale = get_bits(&s->gb, 5);
-    if (s->qscale == 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid qscale value: 0\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->pict_type == AV_PICTURE_TYPE_I) {
-        if (s->rv10_version == 3) {
-            /* specific MPEG like DC coding not used */
-            s->last_dc[0] = get_bits(&s->gb, 8);
-            s->last_dc[1] = get_bits(&s->gb, 8);
-            s->last_dc[2] = get_bits(&s->gb, 8);
-            av_dlog(s->avctx, "DC:%d %d %d\n", s->last_dc[0],
-                    s->last_dc[1], s->last_dc[2]);
-        }
-    }
-    /* if multiple packets per frame are sent, the position at which
-       to display the macroblocks is coded here */
-
-    mb_xy = s->mb_x + s->mb_y * s->mb_width;
-    if (show_bits(&s->gb, 12) == 0 || (mb_xy && mb_xy < s->mb_num)) {
-        s->mb_x  = get_bits(&s->gb, 6); /* mb_x */
-        s->mb_y  = get_bits(&s->gb, 6); /* mb_y */
-        mb_count = get_bits(&s->gb, 12);
-    } else {
-        s->mb_x  = 0;
-        s->mb_y  = 0;
-        mb_count = s->mb_width * s->mb_height;
-    }
-    skip_bits(&s->gb, 3);   /* ignored */
-    s->f_code = 1;
-    s->unrestricted_mv = 1;
-
-    return mb_count;
-}
-
-static int rv20_decode_picture_header(RVDecContext *rv)
-{
-    MpegEncContext *s = &rv->m;
-    int seq, mb_pos, i, ret;
-    int rpr_bits;
-
-    i = get_bits(&s->gb, 2);
-    switch (i) {
-    case 0: s->pict_type = AV_PICTURE_TYPE_I; break;
-    case 1: s->pict_type = AV_PICTURE_TYPE_I; break; //hmm ...
-    case 2: s->pict_type = AV_PICTURE_TYPE_P; break;
-    case 3: s->pict_type = AV_PICTURE_TYPE_B; break;
-    default:
-        av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->last_picture_ptr == NULL && s->pict_type == AV_PICTURE_TYPE_B) {
-        av_log(s->avctx, AV_LOG_ERROR, "early B-frame\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (get_bits1(&s->gb)) {
-        av_log(s->avctx, AV_LOG_ERROR, "reserved bit set\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->qscale = get_bits(&s->gb, 5);
-    if (s->qscale == 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid qscale value: 0\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (RV_GET_MINOR_VER(rv->sub_id) >= 2)
-        s->loop_filter = get_bits1(&s->gb);
-
-    if (RV_GET_MINOR_VER(rv->sub_id) <= 1)
-        seq = get_bits(&s->gb, 8) << 7;
-    else
-        seq = get_bits(&s->gb, 13) << 2;
-
-    rpr_bits = s->avctx->extradata[1] & 7;
-    if (rpr_bits) {
-        int f, new_w, new_h;
-        rpr_bits = FFMIN((rpr_bits >> 1) + 1, 3);
-
-        f = get_bits(&s->gb, rpr_bits);
-
-        if (f) {
-            if (s->avctx->extradata_size < 8 + 2 * f) {
-                av_log(s->avctx, AV_LOG_ERROR, "Extradata too small.\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            new_w = 4 * ((uint8_t*)s->avctx->extradata)[6 + 2 * f];
-            new_h = 4 * ((uint8_t*)s->avctx->extradata)[7 + 2 * f];
-        } else {
-            new_w = s->orig_width ;
-            new_h = s->orig_height;
-        }
-        if (new_w != s->width || new_h != s->height) {
-            av_log(s->avctx, AV_LOG_DEBUG,
-                   "attempting to change resolution to %dx%d\n", new_w, new_h);
-            ff_MPV_common_end(s);
-
-            ret = ff_set_dimensions(s->avctx, new_w, new_h);
-            if (ret < 0)
-                return ret;
-
-            s->width  = new_w;
-            s->height = new_h;
-            if ((ret = ff_MPV_common_init(s)) < 0)
-                return ret;
-        }
-
-        if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
-            av_log(s->avctx, AV_LOG_DEBUG, "F %d/%d\n", f, rpr_bits);
-        }
-    } else if (av_image_check_size(s->width, s->height, 0, s->avctx) < 0)
-        return AVERROR_INVALIDDATA;
-
-    mb_pos = ff_h263_decode_mba(s);
-
-    seq |= s->time & ~0x7FFF;
-    if (seq - s->time >  0x4000)
-        seq -= 0x8000;
-    if (seq - s->time < -0x4000)
-        seq += 0x8000;
-
-    if (seq != s->time) {
-        if (s->pict_type != AV_PICTURE_TYPE_B) {
-            s->time            = seq;
-            s->pp_time         = s->time - s->last_non_b_time;
-            s->last_non_b_time = s->time;
-        } else {
-            s->time    = seq;
-            s->pb_time = s->pp_time - (s->last_non_b_time - s->time);
-            if (s->pp_time <= s->pb_time ||
-                s->pp_time <= s->pp_time - s->pb_time || s->pp_time <= 0) {
-                av_log(s->avctx, AV_LOG_DEBUG, "messed up order, possible "
-                       "from seeking? skipping current b frame\n");
-                return FRAME_SKIPPED;
-            }
-            ff_mpeg4_init_direct_mv(s);
-        }
-    }
-
-    s->no_rounding = get_bits1(&s->gb);
-
-    if (RV_GET_MINOR_VER(rv->sub_id) <= 1 && s->pict_type == AV_PICTURE_TYPE_B)
-        skip_bits(&s->gb, 5); // binary decoder reads 3+2 bits here but they don't seem to be used
-
-    s->f_code          = 1;
-    s->unrestricted_mv = 1;
-    s->h263_aic        = s->pict_type == AV_PICTURE_TYPE_I;
-    s->modified_quant  = 1;
-    s->loop_filter     = 1;
-
-    if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
-        av_log(s->avctx, AV_LOG_INFO, "num:%5d x:%2d y:%2d type:%d qscale:%2d rnd:%d\n",
-               seq, s->mb_x, s->mb_y, s->pict_type, s->qscale, s->no_rounding);
-    }
-
-    assert(s->pict_type != AV_PICTURE_TYPE_B || !s->low_delay);
-
-    return s->mb_width*s->mb_height - mb_pos;
-}
-
-static av_cold int rv10_decode_init(AVCodecContext *avctx)
-{
-    RVDecContext  *rv = avctx->priv_data;
-    MpegEncContext *s = &rv->m;
-    static int done = 0;
-    int major_ver, minor_ver, micro_ver, ret;
-
-    if (avctx->extradata_size < 8) {
-        av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if ((ret = av_image_check_size(avctx->coded_width,
-                                   avctx->coded_height, 0, avctx)) < 0)
-        return ret;
-
-    ff_MPV_decode_defaults(s);
-
-    s->avctx      = avctx;
-    s->out_format = FMT_H263;
-    s->codec_id   = avctx->codec_id;
-
-    s->orig_width  = s->width  = avctx->coded_width;
-    s->orig_height = s->height = avctx->coded_height;
-
-    s->h263_long_vectors = ((uint8_t*)avctx->extradata)[3] & 1;
-    rv->sub_id           = AV_RB32((uint8_t*)avctx->extradata + 4);
-
-    major_ver = RV_GET_MAJOR_VER(rv->sub_id);
-    minor_ver = RV_GET_MINOR_VER(rv->sub_id);
-    micro_ver = RV_GET_MICRO_VER(rv->sub_id);
-
-    s->low_delay = 1;
-    switch (major_ver) {
-    case 1:
-        s->rv10_version = micro_ver ? 3 : 1;
-        s->obmc         = micro_ver == 2;
-        break;
-    case 2:
-        if (minor_ver >= 2) {
-            s->low_delay           = 0;
-            s->avctx->has_b_frames = 1;
-        }
-        break;
-    default:
-        av_log(s->avctx, AV_LOG_ERROR, "unknown header %X\n", rv->sub_id);
-        avpriv_request_sample(avctx, "RV1/2 version");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (avctx->debug & FF_DEBUG_PICT_INFO) {
-        av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", rv->sub_id,
-               avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0] : -1);
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    if ((ret = ff_MPV_common_init(s)) < 0)
-        return ret;
-
-    ff_h263dsp_init(&s->h263dsp);
-    ff_h263_decode_init_vlc();
-
-    /* init rv vlc */
-    if (!done) {
-        INIT_VLC_STATIC(&rv_dc_lum, DC_VLC_BITS, 256,
-                        rv_lum_bits, 1, 1,
-                        rv_lum_code, 2, 2, 16384);
-        INIT_VLC_STATIC(&rv_dc_chrom, DC_VLC_BITS, 256,
-                        rv_chrom_bits, 1, 1,
-                        rv_chrom_code, 2, 2, 16388);
-        done = 1;
-    }
-
-    return 0;
-}
-
-static av_cold int rv10_decode_end(AVCodecContext *avctx)
-{
-    MpegEncContext *s = avctx->priv_data;
-
-    ff_MPV_common_end(s);
-    return 0;
-}
-
-static int rv10_decode_packet(AVCodecContext *avctx,
-                              const uint8_t *buf, int buf_size, int buf_size2)
-{
-    RVDecContext  *rv = avctx->priv_data;
-    MpegEncContext *s = &rv->m;
-    int mb_count, mb_pos, left, start_mb_x, active_bits_size, ret;
-
-    active_bits_size = buf_size * 8;
-    init_get_bits(&s->gb, buf, FFMAX(buf_size, buf_size2) * 8);
-    if (s->codec_id == AV_CODEC_ID_RV10)
-        mb_count = rv10_decode_picture_header(s);
-    else
-        mb_count = rv20_decode_picture_header(rv);
-    if (mb_count < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "HEADER ERROR\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->mb_x >= s->mb_width ||
-        s->mb_y >= s->mb_height) {
-        av_log(s->avctx, AV_LOG_ERROR, "POS ERROR %d %d\n", s->mb_x, s->mb_y);
-        return AVERROR_INVALIDDATA;
-    }
-    mb_pos = s->mb_y * s->mb_width + s->mb_x;
-    left = s->mb_width * s->mb_height - mb_pos;
-    if (mb_count > left) {
-        av_log(s->avctx, AV_LOG_ERROR, "COUNT ERROR\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr == NULL) {
-        if (s->current_picture_ptr) { // FIXME write parser so we always have complete frames?
-            ff_er_frame_end(&s->er);
-            ff_MPV_frame_end(s);
-            s->mb_x = s->mb_y = s->resync_mb_x = s->resync_mb_y = 0;
-        }
-        if ((ret = ff_MPV_frame_start(s, avctx)) < 0)
-            return ret;
-        ff_mpeg_er_frame_start(s);
-    } else {
-        if (s->current_picture_ptr->f.pict_type != s->pict_type) {
-            av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    av_dlog(avctx, "qscale=%d\n", s->qscale);
-
-    /* default quantization values */
-    if (s->codec_id == AV_CODEC_ID_RV10) {
-        if (s->mb_y == 0)
-            s->first_slice_line = 1;
-    } else {
-        s->first_slice_line = 1;
-        s->resync_mb_x      = s->mb_x;
-    }
-    start_mb_x     = s->mb_x;
-    s->resync_mb_y = s->mb_y;
-    if (s->h263_aic) {
-        s->y_dc_scale_table = s->c_dc_scale_table = ff_aic_dc_scale_table;
-    } else {
-        s->y_dc_scale_table = s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
-    }
-
-    if (s->modified_quant)
-        s->chroma_qscale_table = ff_h263_chroma_qscale_table;
-
-    ff_set_qscale(s, s->qscale);
-
-    s->rv10_first_dc_coded[0] = 0;
-    s->rv10_first_dc_coded[1] = 0;
-    s->rv10_first_dc_coded[2] = 0;
-    s->block_wrap[0] =
-    s->block_wrap[1] =
-    s->block_wrap[2] =
-    s->block_wrap[3] = s->b8_stride;
-    s->block_wrap[4] =
-    s->block_wrap[5] = s->mb_stride;
-    ff_init_block_index(s);
-
-    /* decode each macroblock */
-    for (s->mb_num_left = mb_count; s->mb_num_left > 0; s->mb_num_left--) {
-        int ret;
-        ff_update_block_index(s);
-        av_dlog(avctx, "**mb x=%d y=%d\n", s->mb_x, s->mb_y);
-
-        s->mv_dir  = MV_DIR_FORWARD;
-        s->mv_type = MV_TYPE_16X16;
-        ret = ff_h263_decode_mb(s, s->block);
-
-        // Repeat the slice end check from ff_h263_decode_mb with our active
-        // bitstream size
-        if (ret != SLICE_ERROR) {
-            int v = show_bits(&s->gb, 16);
-
-            if (get_bits_count(&s->gb) + 16 > active_bits_size)
-                v >>= get_bits_count(&s->gb) + 16 - active_bits_size;
-
-            if (!v)
-                ret = SLICE_END;
-        }
-        if (ret != SLICE_ERROR && active_bits_size < get_bits_count(&s->gb) &&
-            8 * buf_size2 >= get_bits_count(&s->gb)) {
-            active_bits_size = buf_size2 * 8;
-            av_log(avctx, AV_LOG_DEBUG, "update size from %d to %d\n",
-                   8 * buf_size, active_bits_size);
-            ret = SLICE_OK;
-        }
-
-        if (ret == SLICE_ERROR || active_bits_size < get_bits_count(&s->gb)) {
-            av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y);
-            return AVERROR_INVALIDDATA;
-        }
-        if (s->pict_type != AV_PICTURE_TYPE_B)
-            ff_h263_update_motion_val(s);
-        ff_MPV_decode_mb(s, s->block);
-        if (s->loop_filter)
-            ff_h263_loop_filter(s);
-
-        if (++s->mb_x == s->mb_width) {
-            s->mb_x = 0;
-            s->mb_y++;
-            ff_init_block_index(s);
-        }
-        if (s->mb_x == s->resync_mb_x)
-            s->first_slice_line = 0;
-        if (ret == SLICE_END)
-            break;
-    }
-
-    ff_er_add_slice(&s->er, start_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y,
-                    ER_MB_END);
-
-    return active_bits_size;
-}
-
-static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n)
-{
-    if (avctx->slice_count)
-        return avctx->slice_offset[n];
-    else
-        return AV_RL32(buf + n * 8);
-}
-
-static int rv10_decode_frame(AVCodecContext *avctx,
-                             void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    MpegEncContext *s  = avctx->priv_data;
-    AVFrame *pict      = data;
-    int i, ret;
-    int slice_count;
-    const uint8_t *slices_hdr = NULL;
-
-    av_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
-
-    /* no supplementary picture */
-    if (buf_size == 0) {
-        return 0;
-    }
-
-    if (!avctx->slice_count) {
-        slice_count = (*buf++) + 1;
-        buf_size--;
-
-        if (!slice_count || buf_size <= 8 * slice_count) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid slice count: %d.\n", slice_count);
-            return AVERROR_INVALIDDATA;
-        }
-
-        slices_hdr = buf + 4;
-        buf       += 8 * slice_count;
-        buf_size  -= 8 * slice_count;
-    } else
-        slice_count = avctx->slice_count;
-
-    for (i = 0; i < slice_count; i++) {
-        unsigned offset = get_slice_offset(avctx, slices_hdr, i);
-        int size, size2;
-
-        if (offset >= buf_size)
-            return AVERROR_INVALIDDATA;
-
-        if (i + 1 == slice_count)
-            size = buf_size - offset;
-        else
-            size = get_slice_offset(avctx, slices_hdr, i + 1) - offset;
-
-        if (i + 2 >= slice_count)
-            size2 = buf_size - offset;
-        else
-            size2 = get_slice_offset(avctx, slices_hdr, i + 2) - offset;
-
-        if (size <= 0 || size2 <= 0 ||
-            offset + FFMAX(size, size2) > buf_size)
-            return AVERROR_INVALIDDATA;
-
-        if ((ret = rv10_decode_packet(avctx, buf + offset, size, size2)) < 0)
-            return ret;
-
-        if (ret > 8 * size)
-            i++;
-    }
-
-    if (s->current_picture_ptr != NULL && s->mb_y >= s->mb_height) {
-        ff_er_frame_end(&s->er);
-        ff_MPV_frame_end(s);
-
-        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
-            if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
-                return ret;
-            ff_print_debug_info(s, s->current_picture_ptr);
-        } else if (s->last_picture_ptr != NULL) {
-            if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
-                return ret;
-            ff_print_debug_info(s, s->last_picture_ptr);
-        }
-
-        if (s->last_picture_ptr || s->low_delay) {
-            *got_frame = 1;
-        }
-
-        // so we can detect if frame_end was not called (find some nicer solution...)
-        s->current_picture_ptr = NULL;
-    }
-
-    return avpkt->size;
-}
-
-AVCodec ff_rv10_decoder = {
-    .name           = "rv10",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_RV10,
-    .priv_data_size = sizeof(RVDecContext),
-    .init           = rv10_decode_init,
-    .close          = rv10_decode_end,
-    .decode         = rv10_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .pix_fmts       = ff_pixfmt_list_420,
-};
-
-AVCodec ff_rv20_decoder = {
-    .name           = "rv20",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealVideo 2.0"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_RV20,
-    .priv_data_size = sizeof(RVDecContext),
-    .init           = rv10_decode_init,
-    .close          = rv10_decode_end,
-    .decode         = rv10_decode_frame,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
-    .flush          = ff_mpeg_flush,
-    .pix_fmts       = ff_pixfmt_list_420,
-};
diff --git a/deps/libav/libavcodec/rv10enc.c b/deps/libav/libavcodec/rv10enc.c
deleted file mode 100644
index 9b23d7d..0000000
--- a/deps/libav/libavcodec/rv10enc.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * RV10 encoder
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV10 encoder
- */
-
-#include "mpegvideo.h"
-#include "put_bits.h"
-
-void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number)
-{
-    int full_frame= 0;
-
-    avpriv_align_put_bits(&s->pb);
-
-    put_bits(&s->pb, 1, 1);     /* marker */
-
-    put_bits(&s->pb, 1, (s->pict_type == AV_PICTURE_TYPE_P));
-
-    put_bits(&s->pb, 1, 0);     /* not PB frame */
-
-    put_bits(&s->pb, 5, s->qscale);
-
-    if (s->pict_type == AV_PICTURE_TYPE_I) {
-        /* specific MPEG like DC coding not used */
-    }
-    /* if multiple packets per frame are sent, the position at which
-       to display the macroblocks is coded here */
-    if(!full_frame){
-        put_bits(&s->pb, 6, 0); /* mb_x */
-        put_bits(&s->pb, 6, 0); /* mb_y */
-        put_bits(&s->pb, 12, s->mb_width * s->mb_height);
-    }
-
-    put_bits(&s->pb, 3, 0);     /* ignored */
-}
-
-FF_MPV_GENERIC_CLASS(rv10)
-
-AVCodec ff_rv10_encoder = {
-    .name           = "rv10",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_RV10,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &rv10_class,
-};
diff --git a/deps/libav/libavcodec/rv20enc.c b/deps/libav/libavcodec/rv20enc.c
deleted file mode 100644
index 67879e2..0000000
--- a/deps/libav/libavcodec/rv20enc.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * RV20 encoder
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV20 encoder
- */
-
-#include "mpegvideo.h"
-#include "h263.h"
-#include "put_bits.h"
-
-void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number){
-    put_bits(&s->pb, 2, s->pict_type); //I 0 vs. 1 ?
-    put_bits(&s->pb, 1, 0);     /* unknown bit */
-    put_bits(&s->pb, 5, s->qscale);
-
-    put_sbits(&s->pb, 8, picture_number); //FIXME wrong, but correct is not known
-    s->mb_x= s->mb_y= 0;
-    ff_h263_encode_mba(s);
-
-    put_bits(&s->pb, 1, s->no_rounding);
-
-    assert(s->f_code == 1);
-    assert(s->unrestricted_mv == 0);
-    assert(s->alt_inter_vlc == 0);
-    assert(s->umvplus == 0);
-    assert(s->modified_quant==1);
-    assert(s->loop_filter==1);
-
-    s->h263_aic= s->pict_type == AV_PICTURE_TYPE_I;
-    if(s->h263_aic){
-        s->y_dc_scale_table=
-        s->c_dc_scale_table= ff_aic_dc_scale_table;
-    }else{
-        s->y_dc_scale_table=
-        s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-    }
-}
-
-FF_MPV_GENERIC_CLASS(rv20)
-
-AVCodec ff_rv20_encoder = {
-    .name           = "rv20",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealVideo 2.0"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_RV20,
-    .priv_data_size = sizeof(MpegEncContext),
-    .init           = ff_MPV_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .priv_class     = &rv20_class,
-};
diff --git a/deps/libav/libavcodec/rv30.c b/deps/libav/libavcodec/rv30.c
deleted file mode 100644
index 82ad7d4..0000000
--- a/deps/libav/libavcodec/rv30.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * RV30 decoder
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV30 decoder
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "golomb.h"
-
-#include "rv34.h"
-#include "rv30data.h"
-
-
-static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
-{
-    AVCodecContext *avctx = r->s.avctx;
-    int mb_bits;
-    int w = r->s.width, h = r->s.height;
-    int mb_size;
-    int rpr;
-
-    memset(si, 0, sizeof(SliceInfo));
-    if(get_bits(gb, 3))
-        return -1;
-    si->type = get_bits(gb, 2);
-    if(si->type == 1) si->type = 0;
-    if(get_bits1(gb))
-        return -1;
-    si->quant = get_bits(gb, 5);
-    skip_bits1(gb);
-    si->pts = get_bits(gb, 13);
-    rpr = get_bits(gb, r->rpr);
-    if(rpr){
-        if (avctx->extradata_size < rpr * 2 + 8) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Insufficient extradata - need at least %d bytes, got %d\n",
-                   8 + rpr * 2, avctx->extradata_size);
-            return AVERROR(EINVAL);
-        }
-
-        w = r->s.avctx->extradata[6 + rpr*2] << 2;
-        h = r->s.avctx->extradata[7 + rpr*2] << 2;
-    }
-    si->width  = w;
-    si->height = h;
-    mb_size = ((w + 15) >> 4) * ((h + 15) >> 4);
-    mb_bits = ff_rv34_get_start_offset(gb, mb_size);
-    si->start = get_bits(gb, mb_bits);
-    skip_bits1(gb);
-    return 0;
-}
-
-/**
- * Decode 4x4 intra types array.
- */
-static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t *dst)
-{
-    int i, j, k;
-
-    for(i = 0; i < 4; i++, dst += r->intra_types_stride - 4){
-        for(j = 0; j < 4; j+= 2){
-            unsigned code = svq3_get_ue_golomb(gb) << 1;
-            if(code >= 81*2){
-                av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction code\n");
-                return -1;
-            }
-            for(k = 0; k < 2; k++){
-                int A = dst[-r->intra_types_stride] + 1;
-                int B = dst[-1] + 1;
-                *dst++ = rv30_itype_from_context[A * 90 + B * 9 + rv30_itype_code[code + k]];
-                if(dst[-1] == 9){
-                    av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction mode\n");
-                    return -1;
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-/**
- * Decode macroblock information.
- */
-static int rv30_decode_mb_info(RV34DecContext *r)
-{
-    static const int rv30_p_types[6] = { RV34_MB_SKIP, RV34_MB_P_16x16, RV34_MB_P_8x8, -1, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };
-    static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };
-    MpegEncContext *s = &r->s;
-    GetBitContext *gb = &s->gb;
-    unsigned code     = svq3_get_ue_golomb(gb);
-
-    if (code > 11) {
-        av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n");
-        return -1;
-    }
-    if(code > 5){
-        av_log(s->avctx, AV_LOG_ERROR, "dquant needed\n");
-        code -= 6;
-    }
-    if(s->pict_type != AV_PICTURE_TYPE_B)
-        return rv30_p_types[code];
-    else
-        return rv30_b_types[code];
-}
-
-static inline void rv30_weak_loop_filter(uint8_t *src, const int step,
-                                         const int stride, const int lim)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    int i, diff;
-
-    for(i = 0; i < 4; i++){
-        diff = ((src[-2*step] - src[1*step]) - (src[-1*step] - src[0*step])*4) >> 3;
-        diff = av_clip(diff, -lim, lim);
-        src[-1*step] = cm[src[-1*step] + diff];
-        src[ 0*step] = cm[src[ 0*step] - diff];
-        src += stride;
-    }
-}
-
-static void rv30_loop_filter(RV34DecContext *r, int row)
-{
-    MpegEncContext *s = &r->s;
-    int mb_pos, mb_x;
-    int i, j, k;
-    uint8_t *Y, *C;
-    int loc_lim, cur_lim, left_lim = 0, top_lim = 0;
-
-    mb_pos = row * s->mb_stride;
-    for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){
-        int mbtype = s->current_picture_ptr->mb_type[mb_pos];
-        if(IS_INTRA(mbtype) || IS_SEPARATE_DC(mbtype))
-            r->deblock_coefs[mb_pos] = 0xFFFF;
-        if(IS_INTRA(mbtype))
-            r->cbp_chroma[mb_pos] = 0xFF;
-    }
-
-    /* all vertical edges are filtered first
-     * and horizontal edges are filtered on the next iteration
-     */
-    mb_pos = row * s->mb_stride;
-    for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){
-        cur_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos]];
-        if(mb_x)
-            left_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - 1]];
-        for(j = 0; j < 16; j += 4){
-            Y = s->current_picture_ptr->f.data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x;
-            for(i = !mb_x; i < 4; i++, Y += 4){
-                int ij = i + j;
-                loc_lim = 0;
-                if(r->deblock_coefs[mb_pos] & (1 << ij))
-                    loc_lim = cur_lim;
-                else if(!i && r->deblock_coefs[mb_pos - 1] & (1 << (ij + 3)))
-                    loc_lim = left_lim;
-                else if( i && r->deblock_coefs[mb_pos]     & (1 << (ij - 1)))
-                    loc_lim = cur_lim;
-                if(loc_lim)
-                    rv30_weak_loop_filter(Y, 1, s->linesize, loc_lim);
-            }
-        }
-        for(k = 0; k < 2; k++){
-            int cur_cbp, left_cbp = 0;
-            cur_cbp = (r->cbp_chroma[mb_pos] >> (k*4)) & 0xF;
-            if(mb_x)
-                left_cbp = (r->cbp_chroma[mb_pos - 1] >> (k*4)) & 0xF;
-            for(j = 0; j < 8; j += 4){
-                C = s->current_picture_ptr->f.data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x;
-                for(i = !mb_x; i < 2; i++, C += 4){
-                    int ij = i + (j >> 1);
-                    loc_lim = 0;
-                    if (cur_cbp & (1 << ij))
-                        loc_lim = cur_lim;
-                    else if(!i && left_cbp & (1 << (ij + 1)))
-                        loc_lim = left_lim;
-                    else if( i && cur_cbp  & (1 << (ij - 1)))
-                        loc_lim = cur_lim;
-                    if(loc_lim)
-                        rv30_weak_loop_filter(C, 1, s->uvlinesize, loc_lim);
-                }
-            }
-        }
-    }
-    mb_pos = row * s->mb_stride;
-    for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){
-        cur_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos]];
-        if(row)
-            top_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - s->mb_stride]];
-        for(j = 4*!row; j < 16; j += 4){
-            Y = s->current_picture_ptr->f.data[0] + mb_x*16 + (row*16 + j) * s->linesize;
-            for(i = 0; i < 4; i++, Y += 4){
-                int ij = i + j;
-                loc_lim = 0;
-                if(r->deblock_coefs[mb_pos] & (1 << ij))
-                    loc_lim = cur_lim;
-                else if(!j && r->deblock_coefs[mb_pos - s->mb_stride] & (1 << (ij + 12)))
-                    loc_lim = top_lim;
-                else if( j && r->deblock_coefs[mb_pos]                & (1 << (ij - 4)))
-                    loc_lim = cur_lim;
-                if(loc_lim)
-                    rv30_weak_loop_filter(Y, s->linesize, 1, loc_lim);
-            }
-        }
-        for(k = 0; k < 2; k++){
-            int cur_cbp, top_cbp = 0;
-            cur_cbp = (r->cbp_chroma[mb_pos] >> (k*4)) & 0xF;
-            if(row)
-                top_cbp = (r->cbp_chroma[mb_pos - s->mb_stride] >> (k*4)) & 0xF;
-            for(j = 4*!row; j < 8; j += 4){
-                C = s->current_picture_ptr->f.data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize;
-                for(i = 0; i < 2; i++, C += 4){
-                    int ij = i + (j >> 1);
-                    loc_lim = 0;
-                    if (r->cbp_chroma[mb_pos] & (1 << ij))
-                        loc_lim = cur_lim;
-                    else if(!j && top_cbp & (1 << (ij + 2)))
-                        loc_lim = top_lim;
-                    else if( j && cur_cbp & (1 << (ij - 2)))
-                        loc_lim = cur_lim;
-                    if(loc_lim)
-                        rv30_weak_loop_filter(C, s->uvlinesize, 1, loc_lim);
-                }
-            }
-        }
-    }
-}
-
-/**
- * Initialize decoder.
- */
-static av_cold int rv30_decode_init(AVCodecContext *avctx)
-{
-    RV34DecContext *r = avctx->priv_data;
-    int ret;
-
-    r->rv30 = 1;
-    if ((ret = ff_rv34_decode_init(avctx)) < 0)
-        return ret;
-    if(avctx->extradata_size < 2){
-        av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
-        return -1;
-    }
-    r->rpr = (avctx->extradata[1] & 7) >> 1;
-    r->rpr = FFMIN(r->rpr + 1, 3);
-
-    r->parse_slice_header = rv30_parse_slice_header;
-    r->decode_intra_types = rv30_decode_intra_types;
-    r->decode_mb_info     = rv30_decode_mb_info;
-    r->loop_filter        = rv30_loop_filter;
-    r->luma_dc_quant_i = rv30_luma_dc_quant;
-    r->luma_dc_quant_p = rv30_luma_dc_quant;
-    return 0;
-}
-
-AVCodec ff_rv30_decoder = {
-    .name                  = "rv30",
-    .long_name             = NULL_IF_CONFIG_SMALL("RealVideo 3.0"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_RV30,
-    .priv_data_size        = sizeof(RV34DecContext),
-    .init                  = rv30_decode_init,
-    .close                 = ff_rv34_decode_end,
-    .decode                = ff_rv34_decode_frame,
-    .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
-                             CODEC_CAP_FRAME_THREADS,
-    .flush                 = ff_mpeg_flush,
-    .pix_fmts              = ff_pixfmt_list_420,
-    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_init_thread_copy),
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_update_thread_context),
-};
diff --git a/deps/libav/libavcodec/rv30data.h b/deps/libav/libavcodec/rv30data.h
deleted file mode 100644
index 5ee3048..0000000
--- a/deps/libav/libavcodec/rv30data.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * RealVideo 3 decoder
- * copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * miscellaneous RV30 tables
- */
-
-#ifndef AVCODEC_RV30DATA_H
-#define AVCODEC_RV30DATA_H
-
-#include <stdint.h>
-
-/** DC quantizer mapping for RV30 */
-static const uint8_t rv30_luma_dc_quant[32] = {
-     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 22, 22, 23, 23, 23, 24, 24, 25, 25
-};
-
-/**
- * This table is used for storing the differences
- * between the predicted and the real intra type.
- */
-static const uint8_t rv30_itype_code[9*9*2] = {
-    0, 0, 0, 1, 1, 0, 1, 1, 0, 2, 2, 0, 0, 3, 3, 0, 1, 2,
-    2, 1, 0, 4, 4, 0, 3, 1, 1, 3, 0, 5, 5, 0, 2, 2, 1, 4,
-    4, 1, 0, 6, 3, 2, 1, 5, 2, 3, 5, 1, 6, 0, 0, 7, 4, 2,
-    2, 4, 3, 3, 6, 1, 1, 6, 7, 0, 0, 8, 5, 2, 4, 3, 2, 5,
-    3, 4, 1, 7, 4, 4, 7, 1, 8, 0, 6, 2, 3, 5, 5, 3, 2, 6,
-    1, 8, 2, 7, 7, 2, 8, 1, 5, 4, 4, 5, 3, 6, 6, 3, 8, 2,
-    4, 6, 5, 5, 6, 4, 2, 8, 7, 3, 3, 7, 6, 5, 5, 6, 7, 4,
-    4, 7, 8, 3, 3, 8, 7, 5, 8, 4, 5, 7, 4, 8, 6, 6, 7, 6,
-    5, 8, 8, 5, 6, 7, 8, 6, 7, 7, 6, 8, 8, 7, 7, 8, 8, 8,
-};
-
-/**
- * This table is used for retrieving the current intra type
- * based on its neighbors and adjustment provided by
- * code read and decoded before.
- *
- * This is really a three-dimensional matrix with dimensions
- * [-1..9][-1..9][0..9]. The first and second coordinates are
- * detemined by the top and left neighbors (-1 if unavailable).
- */
-static const uint8_t rv30_itype_from_context[900] = {
-    0, 9, 9, 9, 9, 9, 9, 9, 9,
-    0, 2, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    2, 0, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-
-    0, 1, 9, 9, 9, 9, 9, 9, 9,
-    0, 2, 1, 6, 4, 8, 5, 7, 3,
-    1, 0, 2, 6, 5, 4, 3, 8, 7,
-    2, 8, 0, 1, 7, 4, 3, 6, 5,
-    2, 0, 1, 3, 8, 5, 4, 7, 6,
-    2, 0, 1, 4, 6, 7, 8, 3, 5,
-    0, 1, 5, 2, 6, 3, 8, 4, 7,
-    0, 1, 6, 2, 4, 7, 5, 8, 3,
-    2, 7, 0, 1, 4, 8, 6, 3, 5,
-    2, 8, 0, 1, 7, 3, 4, 5, 6,
-
-    1, 0, 9, 9, 9, 9, 9, 9, 9,
-    1, 2, 5, 6, 3, 0, 4, 8, 7,
-    1, 6, 2, 5, 3, 0, 4, 8, 7,
-    2, 1, 7, 6, 8, 3, 5, 0, 4,
-    1, 2, 5, 3, 6, 8, 4, 7, 0,
-    1, 6, 2, 0, 4, 5, 8, 7, 3,
-    1, 5, 2, 6, 3, 8, 4, 0, 7,
-    1, 6, 0, 2, 4, 5, 7, 3, 8,
-    2, 1, 7, 6, 0, 8, 5, 4, 3,
-    1, 2, 7, 8, 3, 4, 5, 6, 0,
-
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    0, 2, 1, 8, 7, 6, 5, 4, 3,
-    1, 2, 0, 6, 5, 7, 4, 8, 3,
-    2, 8, 7, 1, 0, 6, 4, 3, 5,
-    2, 0, 8, 1, 3, 7, 5, 4, 6,
-    2, 0, 4, 1, 7, 8, 6, 3, 5,
-    2, 0, 1, 5, 8, 4, 6, 7, 3,
-    2, 0, 6, 1, 4, 7, 8, 5, 3,
-    2, 7, 8, 1, 0, 5, 4, 6, 3,
-    2, 8, 7, 1, 0, 4, 3, 6, 5,
-
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    0, 2, 1, 3, 5, 8, 6, 4, 7,
-    1, 0, 2, 5, 3, 6, 4, 8, 7,
-    2, 8, 1, 0, 3, 5, 7, 6, 4,
-    3, 2, 5, 8, 1, 4, 6, 7, 0,
-    4, 2, 0, 6, 1, 5, 8, 3, 7,
-    5, 3, 1, 2, 8, 6, 4, 0, 7,
-    1, 6, 0, 2, 4, 5, 8, 3, 7,
-    2, 7, 0, 1, 5, 4, 8, 6, 3,
-    2, 8, 3, 5, 1, 0, 7, 6, 4,
-
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    2, 0, 6, 1, 4, 7, 5, 8, 3,
-    1, 6, 2, 0, 4, 5, 3, 7, 8,
-    2, 8, 7, 6, 4, 0, 1, 5, 3,
-    4, 2, 1, 0, 6, 8, 3, 5, 7,
-    4, 2, 6, 0, 1, 5, 7, 8, 3,
-    1, 2, 5, 0, 6, 3, 4, 7, 8,
-    6, 4, 0, 1, 2, 7, 5, 3, 8,
-    2, 7, 4, 6, 0, 1, 8, 5, 3,
-    2, 8, 7, 4, 6, 1, 3, 5, 0,
-
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    5, 1, 2, 3, 6, 8, 0, 4, 7,
-    1, 5, 6, 3, 2, 0, 4, 8, 7,
-    2, 1, 5, 3, 6, 8, 7, 4, 0,
-    5, 3, 1, 2, 6, 8, 4, 7, 0,
-    1, 6, 2, 4, 5, 8, 0, 3, 7,
-    5, 1, 3, 6, 2, 0, 8, 4, 7,
-    1, 6, 5, 2, 0, 4, 3, 7, 8,
-    2, 7, 1, 6, 5, 0, 8, 3, 4,
-    2, 5, 1, 3, 6, 8, 4, 0, 7,
-
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    1, 6, 2, 0, 5, 4, 3, 7, 8,
-    1, 6, 5, 4, 2, 3, 0, 7, 8,
-    2, 1, 6, 7, 4, 8, 5, 3, 0,
-    2, 1, 6, 5, 8, 4, 3, 0, 7,
-    6, 4, 1, 2, 0, 5, 7, 8, 3,
-    1, 6, 5, 2, 3, 0, 4, 8, 7,
-    6, 1, 4, 0, 2, 7, 5, 3, 8,
-    2, 7, 4, 6, 1, 5, 0, 8, 3,
-    2, 1, 6, 8, 4, 7, 3, 5, 0,
-
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    2, 0, 4, 7, 6, 1, 8, 5, 3,
-    6, 1, 2, 0, 4, 7, 5, 8, 3,
-    2, 7, 8, 0, 1, 6, 4, 3, 5,
-    2, 4, 0, 8, 3, 1, 7, 6, 5,
-    4, 2, 7, 0, 6, 1, 8, 5, 3,
-    2, 1, 0, 8, 5, 6, 7, 4, 3,
-    2, 6, 4, 1, 7, 0, 5, 8, 3,
-    2, 7, 4, 0, 8, 6, 1, 5, 3,
-    2, 8, 7, 4, 1, 0, 3, 6, 5,
-
-    9, 9, 9, 9, 9, 9, 9, 9, 9,
-    2, 0, 8, 1, 3, 4, 6, 5, 7,
-    1, 2, 0, 6, 8, 5, 7, 3, 4,
-    2, 8, 7, 1, 0, 3, 6, 5, 4,
-    8, 3, 2, 5, 1, 0, 4, 7, 6,
-    2, 0, 4, 8, 5, 1, 7, 6, 3,
-    2, 1, 0, 8, 5, 3, 6, 4, 7,
-    2, 1, 6, 0, 8, 4, 5, 7, 3,
-    2, 7, 8, 4, 0, 6, 1, 5, 3,
-    2, 8, 3, 0, 7, 4, 1, 6, 5,
-};
-
-/**
- * Loop filter limits are taken from this table.
- */
-static const uint8_t rv30_loop_filt_lim[32] = {
-     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5
-};
-#endif /* AVCODEC_RV30DATA_H */
diff --git a/deps/libav/libavcodec/rv30dsp.c b/deps/libav/libavcodec/rv30dsp.c
deleted file mode 100644
index d4b122e..0000000
--- a/deps/libav/libavcodec/rv30dsp.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * RV30 decoder motion compensation functions
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV30 decoder motion compensation functions
- */
-
-#include "avcodec.h"
-#include "h264chroma.h"
-#include "h264qpel.h"
-#include "rv34dsp.h"
-
-#define RV30_LOWPASS(OPNAME, OP) \
-static av_unused void OPNAME ## rv30_tpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, const int C1, const int C2){\
-    const int h = 8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    for(i = 0; i < h; i++)\
-    {\
-        OP(dst[0], (-(src[-1]+src[2]) + src[0]*C1 + src[1]*C2 + 8)>>4);\
-        OP(dst[1], (-(src[ 0]+src[3]) + src[1]*C1 + src[2]*C2 + 8)>>4);\
-        OP(dst[2], (-(src[ 1]+src[4]) + src[2]*C1 + src[3]*C2 + 8)>>4);\
-        OP(dst[3], (-(src[ 2]+src[5]) + src[3]*C1 + src[4]*C2 + 8)>>4);\
-        OP(dst[4], (-(src[ 3]+src[6]) + src[4]*C1 + src[5]*C2 + 8)>>4);\
-        OP(dst[5], (-(src[ 4]+src[7]) + src[5]*C1 + src[6]*C2 + 8)>>4);\
-        OP(dst[6], (-(src[ 5]+src[8]) + src[6]*C1 + src[7]*C2 + 8)>>4);\
-        OP(dst[7], (-(src[ 6]+src[9]) + src[7]*C1 + src[8]*C2 + 8)>>4);\
-        dst += dstStride;\
-        src += srcStride;\
-    }\
-}\
-\
-static void OPNAME ## rv30_tpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, const int C1, const int C2){\
-    const int w = 8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    for(i = 0; i < w; i++)\
-    {\
-        const int srcA = src[-1*srcStride];\
-        const int src0 = src[0 *srcStride];\
-        const int src1 = src[1 *srcStride];\
-        const int src2 = src[2 *srcStride];\
-        const int src3 = src[3 *srcStride];\
-        const int src4 = src[4 *srcStride];\
-        const int src5 = src[5 *srcStride];\
-        const int src6 = src[6 *srcStride];\
-        const int src7 = src[7 *srcStride];\
-        const int src8 = src[8 *srcStride];\
-        const int src9 = src[9 *srcStride];\
-        OP(dst[0*dstStride], (-(srcA+src2) + src0*C1 + src1*C2 + 8)>>4);\
-        OP(dst[1*dstStride], (-(src0+src3) + src1*C1 + src2*C2 + 8)>>4);\
-        OP(dst[2*dstStride], (-(src1+src4) + src2*C1 + src3*C2 + 8)>>4);\
-        OP(dst[3*dstStride], (-(src2+src5) + src3*C1 + src4*C2 + 8)>>4);\
-        OP(dst[4*dstStride], (-(src3+src6) + src4*C1 + src5*C2 + 8)>>4);\
-        OP(dst[5*dstStride], (-(src4+src7) + src5*C1 + src6*C2 + 8)>>4);\
-        OP(dst[6*dstStride], (-(src5+src8) + src6*C1 + src7*C2 + 8)>>4);\
-        OP(dst[7*dstStride], (-(src6+src9) + src7*C1 + src8*C2 + 8)>>4);\
-        dst++;\
-        src++;\
-    }\
-}\
-\
-static void OPNAME ## rv30_tpel8_hv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    const int w = 8;\
-    const int h = 8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i, j;\
-    for(j = 0; j < h; j++){\
-        for(i = 0; i < w; i++){\
-            OP(dst[i], (\
-                  src[srcStride*-1+i-1]  -12*src[srcStride*-1+i]  -6*src[srcStride*-1+i+1]    +src[srcStride*-1+i+2]+\
-              -12*src[srcStride* 0+i-1] +144*src[srcStride* 0+i] +72*src[srcStride* 0+i+1] -12*src[srcStride* 0+i+2] +\
-               -6*src[srcStride* 1+i-1]  +72*src[srcStride* 1+i] +36*src[srcStride* 1+i+1]  -6*src[srcStride* 1+i+2] +\
-                  src[srcStride* 2+i-1]  -12*src[srcStride* 2+i]  -6*src[srcStride* 2+i+1]    +src[srcStride* 2+i+2] +\
-                  128)>>8);\
-        }\
-        src += srcStride;\
-        dst += dstStride;\
-    }\
-}\
-\
-static void OPNAME ## rv30_tpel8_hhv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    const int w = 8;\
-    const int h = 8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i, j;\
-    for(j = 0; j < h; j++){\
-        for(i = 0; i < w; i++){\
-            OP(dst[i], (\
-                  src[srcStride*-1+i-1]  -12*src[srcStride*-1+i+1]  -6*src[srcStride*-1+i]    +src[srcStride*-1+i+2]+\
-              -12*src[srcStride* 0+i-1] +144*src[srcStride* 0+i+1] +72*src[srcStride* 0+i] -12*src[srcStride* 0+i+2]+\
-               -6*src[srcStride* 1+i-1]  +72*src[srcStride* 1+i+1] +36*src[srcStride* 1+i]  -6*src[srcStride* 1+i+2]+\
-                  src[srcStride* 2+i-1]  -12*src[srcStride* 2+i+1]  -6*src[srcStride* 2+i]    +src[srcStride* 2+i+2]+\
-                  128)>>8);\
-        }\
-        src += srcStride;\
-        dst += dstStride;\
-    }\
-}\
-\
-static void OPNAME ## rv30_tpel8_hvv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    const int w = 8;\
-    const int h = 8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i, j;\
-    for(j = 0; j < h; j++){\
-        for(i = 0; i < w; i++){\
-            OP(dst[i], (\
-                  src[srcStride*-1+i-1]  -12*src[srcStride*-1+i]  -6*src[srcStride*-1+i+1]    +src[srcStride*-1+i+2]+\
-               -6*src[srcStride* 0+i-1]  +72*src[srcStride* 0+i] +36*src[srcStride* 0+i+1]  -6*src[srcStride* 0+i+2]+\
-              -12*src[srcStride* 1+i-1] +144*src[srcStride* 1+i] +72*src[srcStride* 1+i+1] -12*src[srcStride* 1+i+2]+\
-                  src[srcStride* 2+i-1]  -12*src[srcStride* 2+i]  -6*src[srcStride* 2+i+1]    +src[srcStride* 2+i+2]+\
-                  128)>>8);\
-        }\
-        src += srcStride;\
-        dst += dstStride;\
-    }\
-}\
-\
-static void OPNAME ## rv30_tpel8_hhvv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    const int w = 8;\
-    const int h = 8;\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i, j;\
-    for(j = 0; j < h; j++){\
-        for(i = 0; i < w; i++){\
-            OP(dst[i], (\
-               36*src[i+srcStride*0] +54*src[i+1+srcStride*0] +6*src[i+2+srcStride*0]+\
-               54*src[i+srcStride*1] +81*src[i+1+srcStride*1] +9*src[i+2+srcStride*1]+\
-                6*src[i+srcStride*2] + 9*src[i+1+srcStride*2] +  src[i+2+srcStride*2]+\
-               128)>>8);\
-        }\
-        src += srcStride;\
-        dst += dstStride;\
-    }\
-}\
-\
-static void OPNAME ## rv30_tpel16_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, const int C1, const int C2){\
-    OPNAME ## rv30_tpel8_v_lowpass(dst  , src  , dstStride, srcStride, C1, C2);\
-    OPNAME ## rv30_tpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, C1, C2);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## rv30_tpel8_v_lowpass(dst  , src  , dstStride, srcStride, C1, C2);\
-    OPNAME ## rv30_tpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, C1, C2);\
-}\
-\
-static void OPNAME ## rv30_tpel16_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, const int C1, const int C2){\
-    OPNAME ## rv30_tpel8_h_lowpass(dst  , src  , dstStride, srcStride, C1, C2);\
-    OPNAME ## rv30_tpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, C1, C2);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## rv30_tpel8_h_lowpass(dst  , src  , dstStride, srcStride, C1, C2);\
-    OPNAME ## rv30_tpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, C1, C2);\
-}\
-\
-static void OPNAME ## rv30_tpel16_hv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## rv30_tpel8_hv_lowpass(dst  , src  , dstStride, srcStride);\
-    OPNAME ## rv30_tpel8_hv_lowpass(dst+8, src+8, dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## rv30_tpel8_hv_lowpass(dst  , src  , dstStride, srcStride);\
-    OPNAME ## rv30_tpel8_hv_lowpass(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static void OPNAME ## rv30_tpel16_hhv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## rv30_tpel8_hhv_lowpass(dst  , src  , dstStride, srcStride);\
-    OPNAME ## rv30_tpel8_hhv_lowpass(dst+8, src+8, dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## rv30_tpel8_hhv_lowpass(dst  , src  , dstStride, srcStride);\
-    OPNAME ## rv30_tpel8_hhv_lowpass(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static void OPNAME ## rv30_tpel16_hvv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## rv30_tpel8_hvv_lowpass(dst  , src  , dstStride, srcStride);\
-    OPNAME ## rv30_tpel8_hvv_lowpass(dst+8, src+8, dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## rv30_tpel8_hvv_lowpass(dst  , src  , dstStride, srcStride);\
-    OPNAME ## rv30_tpel8_hvv_lowpass(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static void OPNAME ## rv30_tpel16_hhvv_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## rv30_tpel8_hhvv_lowpass(dst  , src  , dstStride, srcStride);\
-    OPNAME ## rv30_tpel8_hhvv_lowpass(dst+8, src+8, dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## rv30_tpel8_hhvv_lowpass(dst  , src  , dstStride, srcStride);\
-    OPNAME ## rv30_tpel8_hhvv_lowpass(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-
-#define RV30_MC(OPNAME, SIZE) \
-static void OPNAME ## rv30_tpel ## SIZE ## _mc10_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv30_tpel ## SIZE ## _h_lowpass(dst, src, stride, stride, 12, 6);\
-}\
-\
-static void OPNAME ## rv30_tpel ## SIZE ## _mc20_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv30_tpel ## SIZE ## _h_lowpass(dst, src, stride, stride, 6, 12);\
-}\
-\
-static void OPNAME ## rv30_tpel ## SIZE ## _mc01_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv30_tpel ## SIZE ## _v_lowpass(dst, src, stride, stride, 12, 6);\
-}\
-\
-static void OPNAME ## rv30_tpel ## SIZE ## _mc02_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv30_tpel ## SIZE ## _v_lowpass(dst, src, stride, stride, 6, 12);\
-}\
-\
-static void OPNAME ## rv30_tpel ## SIZE ## _mc11_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv30_tpel ## SIZE ## _hv_lowpass(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## rv30_tpel ## SIZE ## _mc12_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv30_tpel ## SIZE ## _hvv_lowpass(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## rv30_tpel ## SIZE ## _mc21_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv30_tpel ## SIZE ## _hhv_lowpass(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## rv30_tpel ## SIZE ## _mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv30_tpel ## SIZE ## _hhvv_lowpass(dst, src, stride, stride);\
-}\
-\
-
-#define op_avg(a, b)  a = (((a)+cm[b]+1)>>1)
-#define op_put(a, b)  a = cm[b]
-
-RV30_LOWPASS(put_       , op_put)
-RV30_LOWPASS(avg_       , op_avg)
-RV30_MC(put_, 8)
-RV30_MC(put_, 16)
-RV30_MC(avg_, 8)
-RV30_MC(avg_, 16)
-
-av_cold void ff_rv30dsp_init(RV34DSPContext *c)
-{
-    H264ChromaContext h264chroma;
-    H264QpelContext qpel;
-
-    ff_rv34dsp_init(c);
-    ff_h264chroma_init(&h264chroma, 8);
-    ff_h264qpel_init(&qpel, 8);
-
-    c->put_pixels_tab[0][ 0] = qpel.put_h264_qpel_pixels_tab[0][0];
-    c->put_pixels_tab[0][ 1] = put_rv30_tpel16_mc10_c;
-    c->put_pixels_tab[0][ 2] = put_rv30_tpel16_mc20_c;
-    c->put_pixels_tab[0][ 4] = put_rv30_tpel16_mc01_c;
-    c->put_pixels_tab[0][ 5] = put_rv30_tpel16_mc11_c;
-    c->put_pixels_tab[0][ 6] = put_rv30_tpel16_mc21_c;
-    c->put_pixels_tab[0][ 8] = put_rv30_tpel16_mc02_c;
-    c->put_pixels_tab[0][ 9] = put_rv30_tpel16_mc12_c;
-    c->put_pixels_tab[0][10] = put_rv30_tpel16_mc22_c;
-    c->avg_pixels_tab[0][ 0] = qpel.avg_h264_qpel_pixels_tab[0][0];
-    c->avg_pixels_tab[0][ 1] = avg_rv30_tpel16_mc10_c;
-    c->avg_pixels_tab[0][ 2] = avg_rv30_tpel16_mc20_c;
-    c->avg_pixels_tab[0][ 4] = avg_rv30_tpel16_mc01_c;
-    c->avg_pixels_tab[0][ 5] = avg_rv30_tpel16_mc11_c;
-    c->avg_pixels_tab[0][ 6] = avg_rv30_tpel16_mc21_c;
-    c->avg_pixels_tab[0][ 8] = avg_rv30_tpel16_mc02_c;
-    c->avg_pixels_tab[0][ 9] = avg_rv30_tpel16_mc12_c;
-    c->avg_pixels_tab[0][10] = avg_rv30_tpel16_mc22_c;
-    c->put_pixels_tab[1][ 0] = qpel.put_h264_qpel_pixels_tab[1][0];
-    c->put_pixels_tab[1][ 1] = put_rv30_tpel8_mc10_c;
-    c->put_pixels_tab[1][ 2] = put_rv30_tpel8_mc20_c;
-    c->put_pixels_tab[1][ 4] = put_rv30_tpel8_mc01_c;
-    c->put_pixels_tab[1][ 5] = put_rv30_tpel8_mc11_c;
-    c->put_pixels_tab[1][ 6] = put_rv30_tpel8_mc21_c;
-    c->put_pixels_tab[1][ 8] = put_rv30_tpel8_mc02_c;
-    c->put_pixels_tab[1][ 9] = put_rv30_tpel8_mc12_c;
-    c->put_pixels_tab[1][10] = put_rv30_tpel8_mc22_c;
-    c->avg_pixels_tab[1][ 0] = qpel.avg_h264_qpel_pixels_tab[1][0];
-    c->avg_pixels_tab[1][ 1] = avg_rv30_tpel8_mc10_c;
-    c->avg_pixels_tab[1][ 2] = avg_rv30_tpel8_mc20_c;
-    c->avg_pixels_tab[1][ 4] = avg_rv30_tpel8_mc01_c;
-    c->avg_pixels_tab[1][ 5] = avg_rv30_tpel8_mc11_c;
-    c->avg_pixels_tab[1][ 6] = avg_rv30_tpel8_mc21_c;
-    c->avg_pixels_tab[1][ 8] = avg_rv30_tpel8_mc02_c;
-    c->avg_pixels_tab[1][ 9] = avg_rv30_tpel8_mc12_c;
-    c->avg_pixels_tab[1][10] = avg_rv30_tpel8_mc22_c;
-
-    c->put_chroma_pixels_tab[0] = h264chroma.put_h264_chroma_pixels_tab[0];
-    c->put_chroma_pixels_tab[1] = h264chroma.put_h264_chroma_pixels_tab[1];
-    c->avg_chroma_pixels_tab[0] = h264chroma.avg_h264_chroma_pixels_tab[0];
-    c->avg_chroma_pixels_tab[1] = h264chroma.avg_h264_chroma_pixels_tab[1];
-}
diff --git a/deps/libav/libavcodec/rv34.c b/deps/libav/libavcodec/rv34.c
deleted file mode 100644
index bff3c09..0000000
--- a/deps/libav/libavcodec/rv34.c
+++ /dev/null
@@ -1,1808 +0,0 @@
-/*
- * RV30/40 decoder common data
- * Copyright (c) 2007 Mike Melanson, Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV30/40 decoder common data
- */
-
-#include "libavutil/internal.h"
-
-#include "avcodec.h"
-#include "error_resilience.h"
-#include "mpegvideo.h"
-#include "golomb.h"
-#include "internal.h"
-#include "mathops.h"
-#include "rectangle.h"
-#include "thread.h"
-
-#include "rv34vlc.h"
-#include "rv34data.h"
-#include "rv34.h"
-
-static inline void ZERO8x2(void* dst, int stride)
-{
-    fill_rectangle(dst,                 1, 2, stride, 0, 4);
-    fill_rectangle(((uint8_t*)(dst))+4, 1, 2, stride, 0, 4);
-}
-
-/** translation of RV30/40 macroblock types to lavc ones */
-static const int rv34_mb_type_to_lavc[12] = {
-    MB_TYPE_INTRA,
-    MB_TYPE_INTRA16x16              | MB_TYPE_SEPARATE_DC,
-    MB_TYPE_16x16   | MB_TYPE_L0,
-    MB_TYPE_8x8     | MB_TYPE_L0,
-    MB_TYPE_16x16   | MB_TYPE_L0,
-    MB_TYPE_16x16   | MB_TYPE_L1,
-    MB_TYPE_SKIP,
-    MB_TYPE_DIRECT2 | MB_TYPE_16x16,
-    MB_TYPE_16x8    | MB_TYPE_L0,
-    MB_TYPE_8x16    | MB_TYPE_L0,
-    MB_TYPE_16x16   | MB_TYPE_L0L1,
-    MB_TYPE_16x16   | MB_TYPE_L0    | MB_TYPE_SEPARATE_DC
-};
-
-
-static RV34VLC intra_vlcs[NUM_INTRA_TABLES], inter_vlcs[NUM_INTER_TABLES];
-
-static int rv34_decode_mv(RV34DecContext *r, int block_type);
-
-/**
- * @name RV30/40 VLC generating functions
- * @{
- */
-
-static const int table_offs[] = {
-      0,   1818,   3622,   4144,   4698,   5234,   5804,   5868,   5900,   5932,
-   5996,   6252,   6316,   6348,   6380,   7674,   8944,  10274,  11668,  12250,
-  14060,  15846,  16372,  16962,  17512,  18148,  18180,  18212,  18244,  18308,
-  18564,  18628,  18660,  18692,  20036,  21314,  22648,  23968,  24614,  26384,
-  28190,  28736,  29366,  29938,  30608,  30640,  30672,  30704,  30768,  31024,
-  31088,  31120,  31184,  32570,  33898,  35236,  36644,  37286,  39020,  40802,
-  41368,  42052,  42692,  43348,  43380,  43412,  43444,  43476,  43604,  43668,
-  43700,  43732,  45100,  46430,  47778,  49160,  49802,  51550,  53340,  53972,
-  54648,  55348,  55994,  56122,  56154,  56186,  56218,  56346,  56410,  56442,
-  56474,  57878,  59290,  60636,  62036,  62682,  64460,  64524,  64588,  64716,
-  64844,  66076,  67466,  67978,  68542,  69064,  69648,  70296,  72010,  72074,
-  72138,  72202,  72330,  73572,  74936,  75454,  76030,  76566,  77176,  77822,
-  79582,  79646,  79678,  79742,  79870,  81180,  82536,  83064,  83672,  84242,
-  84934,  85576,  87384,  87448,  87480,  87544,  87672,  88982,  90340,  90902,
-  91598,  92182,  92846,  93488,  95246,  95278,  95310,  95374,  95502,  96878,
-  98266,  98848,  99542, 100234, 100884, 101524, 103320, 103352, 103384, 103416,
- 103480, 104874, 106222, 106910, 107584, 108258, 108902, 109544, 111366, 111398,
- 111430, 111462, 111494, 112878, 114320, 114988, 115660, 116310, 116950, 117592
-};
-
-static VLC_TYPE table_data[117592][2];
-
-/**
- * Generate VLC from codeword lengths.
- * @param bits   codeword lengths (zeroes are accepted)
- * @param size   length of input data
- * @param vlc    output VLC
- * @param insyms symbols for input codes (NULL for default ones)
- * @param num    VLC table number (for static initialization)
- */
-static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t *insyms,
-                         const int num)
-{
-    int i;
-    int counts[17] = {0}, codes[17];
-    uint16_t cw[MAX_VLC_SIZE], syms[MAX_VLC_SIZE];
-    uint8_t bits2[MAX_VLC_SIZE];
-    int maxbits = 0, realsize = 0;
-
-    for(i = 0; i < size; i++){
-        if(bits[i]){
-            bits2[realsize] = bits[i];
-            syms[realsize] = insyms ? insyms[i] : i;
-            realsize++;
-            maxbits = FFMAX(maxbits, bits[i]);
-            counts[bits[i]]++;
-        }
-    }
-
-    codes[0] = 0;
-    for(i = 0; i < 16; i++)
-        codes[i+1] = (codes[i] + counts[i]) << 1;
-    for(i = 0; i < realsize; i++)
-        cw[i] = codes[bits2[i]]++;
-
-    vlc->table = &table_data[table_offs[num]];
-    vlc->table_allocated = table_offs[num + 1] - table_offs[num];
-    ff_init_vlc_sparse(vlc, FFMIN(maxbits, 9), realsize,
-                       bits2, 1, 1,
-                       cw,    2, 2,
-                       syms,  2, 2, INIT_VLC_USE_NEW_STATIC);
-}
-
-/**
- * Initialize all tables.
- */
-static av_cold void rv34_init_tables(void)
-{
-    int i, j, k;
-
-    for(i = 0; i < NUM_INTRA_TABLES; i++){
-        for(j = 0; j < 2; j++){
-            rv34_gen_vlc(rv34_table_intra_cbppat   [i][j], CBPPAT_VLC_SIZE,   &intra_vlcs[i].cbppattern[j],     NULL, 19*i + 0 + j);
-            rv34_gen_vlc(rv34_table_intra_secondpat[i][j], OTHERBLK_VLC_SIZE, &intra_vlcs[i].second_pattern[j], NULL, 19*i + 2 + j);
-            rv34_gen_vlc(rv34_table_intra_thirdpat [i][j], OTHERBLK_VLC_SIZE, &intra_vlcs[i].third_pattern[j],  NULL, 19*i + 4 + j);
-            for(k = 0; k < 4; k++){
-                rv34_gen_vlc(rv34_table_intra_cbp[i][j+k*2],  CBP_VLC_SIZE,   &intra_vlcs[i].cbp[j][k],         rv34_cbp_code, 19*i + 6 + j*4 + k);
-            }
-        }
-        for(j = 0; j < 4; j++){
-            rv34_gen_vlc(rv34_table_intra_firstpat[i][j], FIRSTBLK_VLC_SIZE, &intra_vlcs[i].first_pattern[j], NULL, 19*i + 14 + j);
-        }
-        rv34_gen_vlc(rv34_intra_coeff[i], COEFF_VLC_SIZE, &intra_vlcs[i].coefficient, NULL, 19*i + 18);
-    }
-
-    for(i = 0; i < NUM_INTER_TABLES; i++){
-        rv34_gen_vlc(rv34_inter_cbppat[i], CBPPAT_VLC_SIZE, &inter_vlcs[i].cbppattern[0], NULL, i*12 + 95);
-        for(j = 0; j < 4; j++){
-            rv34_gen_vlc(rv34_inter_cbp[i][j], CBP_VLC_SIZE, &inter_vlcs[i].cbp[0][j], rv34_cbp_code, i*12 + 96 + j);
-        }
-        for(j = 0; j < 2; j++){
-            rv34_gen_vlc(rv34_table_inter_firstpat [i][j], FIRSTBLK_VLC_SIZE, &inter_vlcs[i].first_pattern[j],  NULL, i*12 + 100 + j);
-            rv34_gen_vlc(rv34_table_inter_secondpat[i][j], OTHERBLK_VLC_SIZE, &inter_vlcs[i].second_pattern[j], NULL, i*12 + 102 + j);
-            rv34_gen_vlc(rv34_table_inter_thirdpat [i][j], OTHERBLK_VLC_SIZE, &inter_vlcs[i].third_pattern[j],  NULL, i*12 + 104 + j);
-        }
-        rv34_gen_vlc(rv34_inter_coeff[i], COEFF_VLC_SIZE, &inter_vlcs[i].coefficient, NULL, i*12 + 106);
-    }
-}
-
-/** @} */ // vlc group
-
-/**
- * @name RV30/40 4x4 block decoding functions
- * @{
- */
-
-/**
- * Decode coded block pattern.
- */
-static int rv34_decode_cbp(GetBitContext *gb, RV34VLC *vlc, int table)
-{
-    int pattern, code, cbp=0;
-    int ones;
-    static const int cbp_masks[3] = {0x100000, 0x010000, 0x110000};
-    static const int shifts[4] = { 0, 2, 8, 10 };
-    const int *curshift = shifts;
-    int i, t, mask;
-
-    code = get_vlc2(gb, vlc->cbppattern[table].table, 9, 2);
-    pattern = code & 0xF;
-    code >>= 4;
-
-    ones = rv34_count_ones[pattern];
-
-    for(mask = 8; mask; mask >>= 1, curshift++){
-        if(pattern & mask)
-            cbp |= get_vlc2(gb, vlc->cbp[table][ones].table, vlc->cbp[table][ones].bits, 1) << curshift[0];
-    }
-
-    for(i = 0; i < 4; i++){
-        t = (modulo_three_table[code] >> (6 - 2*i)) & 3;
-        if(t == 1)
-            cbp |= cbp_masks[get_bits1(gb)] << i;
-        if(t == 2)
-            cbp |= cbp_masks[2] << i;
-    }
-    return cbp;
-}
-
-/**
- * Get one coefficient value from the bistream and store it.
- */
-static inline void decode_coeff(int16_t *dst, int coef, int esc, GetBitContext *gb, VLC* vlc, int q)
-{
-    if(coef){
-        if(coef == esc){
-            coef = get_vlc2(gb, vlc->table, 9, 2);
-            if(coef > 23){
-                coef -= 23;
-                coef = 22 + ((1 << coef) | get_bits(gb, coef));
-            }
-            coef += esc;
-        }
-        if(get_bits1(gb))
-            coef = -coef;
-        *dst = (coef*q + 8) >> 4;
-    }
-}
-
-/**
- * Decode 2x2 subblock of coefficients.
- */
-static inline void decode_subblock(int16_t *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q)
-{
-    int flags = modulo_three_table[code];
-
-    decode_coeff(    dst+0*4+0, (flags >> 6)    , 3, gb, vlc, q);
-    if(is_block2){
-        decode_coeff(dst+1*4+0, (flags >> 4) & 3, 2, gb, vlc, q);
-        decode_coeff(dst+0*4+1, (flags >> 2) & 3, 2, gb, vlc, q);
-    }else{
-        decode_coeff(dst+0*4+1, (flags >> 4) & 3, 2, gb, vlc, q);
-        decode_coeff(dst+1*4+0, (flags >> 2) & 3, 2, gb, vlc, q);
-    }
-    decode_coeff(    dst+1*4+1, (flags >> 0) & 3, 2, gb, vlc, q);
-}
-
-/**
- * Decode a single coefficient.
- */
-static inline void decode_subblock1(int16_t *dst, int code, GetBitContext *gb, VLC *vlc, int q)
-{
-    int coeff = modulo_three_table[code] >> 6;
-    decode_coeff(dst, coeff, 3, gb, vlc, q);
-}
-
-static inline void decode_subblock3(int16_t *dst, int code, GetBitContext *gb, VLC *vlc,
-                                    int q_dc, int q_ac1, int q_ac2)
-{
-    int flags = modulo_three_table[code];
-
-    decode_coeff(dst+0*4+0, (flags >> 6)    , 3, gb, vlc, q_dc);
-    decode_coeff(dst+0*4+1, (flags >> 4) & 3, 2, gb, vlc, q_ac1);
-    decode_coeff(dst+1*4+0, (flags >> 2) & 3, 2, gb, vlc, q_ac1);
-    decode_coeff(dst+1*4+1, (flags >> 0) & 3, 2, gb, vlc, q_ac2);
-}
-
-/**
- * Decode coefficients for 4x4 block.
- *
- * This is done by filling 2x2 subblocks with decoded coefficients
- * in this order (the same for subblocks and subblock coefficients):
- *  o--o
- *    /
- *   /
- *  o--o
- */
-
-static int rv34_decode_block(int16_t *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2)
-{
-    int code, pattern, has_ac = 1;
-
-    code = get_vlc2(gb, rvlc->first_pattern[fc].table, 9, 2);
-
-    pattern = code & 0x7;
-
-    code >>= 3;
-
-    if (modulo_three_table[code] & 0x3F) {
-        decode_subblock3(dst, code, gb, &rvlc->coefficient, q_dc, q_ac1, q_ac2);
-    } else {
-        decode_subblock1(dst, code, gb, &rvlc->coefficient, q_dc);
-        if (!pattern)
-            return 0;
-        has_ac = 0;
-    }
-
-    if(pattern & 4){
-        code = get_vlc2(gb, rvlc->second_pattern[sc].table, 9, 2);
-        decode_subblock(dst + 4*0+2, code, 0, gb, &rvlc->coefficient, q_ac2);
-    }
-    if(pattern & 2){ // Looks like coefficients 1 and 2 are swapped for this block
-        code = get_vlc2(gb, rvlc->second_pattern[sc].table, 9, 2);
-        decode_subblock(dst + 4*2+0, code, 1, gb, &rvlc->coefficient, q_ac2);
-    }
-    if(pattern & 1){
-        code = get_vlc2(gb, rvlc->third_pattern[sc].table, 9, 2);
-        decode_subblock(dst + 4*2+2, code, 0, gb, &rvlc->coefficient, q_ac2);
-    }
-    return has_ac | pattern;
-}
-
-/**
- * @name RV30/40 bitstream parsing
- * @{
- */
-
-/**
- * Decode starting slice position.
- * @todo Maybe replace with ff_h263_decode_mba() ?
- */
-int ff_rv34_get_start_offset(GetBitContext *gb, int mb_size)
-{
-    int i;
-    for(i = 0; i < 5; i++)
-        if(rv34_mb_max_sizes[i] >= mb_size - 1)
-            break;
-    return rv34_mb_bits_sizes[i];
-}
-
-/**
- * Select VLC set for decoding from current quantizer, modifier and frame type.
- */
-static inline RV34VLC* choose_vlc_set(int quant, int mod, int type)
-{
-    if(mod == 2 && quant < 19) quant += 10;
-    else if(mod && quant < 26) quant += 5;
-    return type ? &inter_vlcs[rv34_quant_to_vlc_set[1][av_clip(quant, 0, 30)]]
-                : &intra_vlcs[rv34_quant_to_vlc_set[0][av_clip(quant, 0, 30)]];
-}
-
-/**
- * Decode intra macroblock header and return CBP in case of success, -1 otherwise.
- */
-static int rv34_decode_intra_mb_header(RV34DecContext *r, int8_t *intra_types)
-{
-    MpegEncContext *s = &r->s;
-    GetBitContext *gb = &s->gb;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int t;
-
-    r->is16 = get_bits1(gb);
-    if(r->is16){
-        s->current_picture_ptr->mb_type[mb_pos] = MB_TYPE_INTRA16x16;
-        r->block_type = RV34_MB_TYPE_INTRA16x16;
-        t = get_bits(gb, 2);
-        fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0]));
-        r->luma_vlc   = 2;
-    }else{
-        if(!r->rv30){
-            if(!get_bits1(gb))
-                av_log(s->avctx, AV_LOG_ERROR, "Need DQUANT\n");
-        }
-        s->current_picture_ptr->mb_type[mb_pos] = MB_TYPE_INTRA;
-        r->block_type = RV34_MB_TYPE_INTRA;
-        if(r->decode_intra_types(r, gb, intra_types) < 0)
-            return -1;
-        r->luma_vlc   = 1;
-    }
-
-    r->chroma_vlc = 0;
-    r->cur_vlcs   = choose_vlc_set(r->si.quant, r->si.vlc_set, 0);
-
-    return rv34_decode_cbp(gb, r->cur_vlcs, r->is16);
-}
-
-/**
- * Decode inter macroblock header and return CBP in case of success, -1 otherwise.
- */
-static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types)
-{
-    MpegEncContext *s = &r->s;
-    GetBitContext *gb = &s->gb;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int i, t;
-
-    r->block_type = r->decode_mb_info(r);
-    if(r->block_type == -1)
-        return -1;
-    s->current_picture_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type];
-    r->mb_type[mb_pos] = r->block_type;
-    if(r->block_type == RV34_MB_SKIP){
-        if(s->pict_type == AV_PICTURE_TYPE_P)
-            r->mb_type[mb_pos] = RV34_MB_P_16x16;
-        if(s->pict_type == AV_PICTURE_TYPE_B)
-            r->mb_type[mb_pos] = RV34_MB_B_DIRECT;
-    }
-    r->is16 = !!IS_INTRA16x16(s->current_picture_ptr->mb_type[mb_pos]);
-    rv34_decode_mv(r, r->block_type);
-    if(r->block_type == RV34_MB_SKIP){
-        fill_rectangle(intra_types, 4, 4, r->intra_types_stride, 0, sizeof(intra_types[0]));
-        return 0;
-    }
-    r->chroma_vlc = 1;
-    r->luma_vlc   = 0;
-
-    if(IS_INTRA(s->current_picture_ptr->mb_type[mb_pos])){
-        if(r->is16){
-            t = get_bits(gb, 2);
-            fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0]));
-            r->luma_vlc   = 2;
-        }else{
-            if(r->decode_intra_types(r, gb, intra_types) < 0)
-                return -1;
-            r->luma_vlc   = 1;
-        }
-        r->chroma_vlc = 0;
-        r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 0);
-    }else{
-        for(i = 0; i < 16; i++)
-            intra_types[(i & 3) + (i>>2) * r->intra_types_stride] = 0;
-        r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 1);
-        if(r->mb_type[mb_pos] == RV34_MB_P_MIX16x16){
-            r->is16 = 1;
-            r->chroma_vlc = 1;
-            r->luma_vlc   = 2;
-            r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 0);
-        }
-    }
-
-    return rv34_decode_cbp(gb, r->cur_vlcs, r->is16);
-}
-
-/** @} */ //bitstream functions
-
-/**
- * @name motion vector related code (prediction, reconstruction, motion compensation)
- * @{
- */
-
-/** macroblock partition width in 8x8 blocks */
-static const uint8_t part_sizes_w[RV34_MB_TYPES] = { 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2 };
-
-/** macroblock partition height in 8x8 blocks */
-static const uint8_t part_sizes_h[RV34_MB_TYPES] = { 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2 };
-
-/** availability index for subblocks */
-static const uint8_t avail_indexes[4] = { 6, 7, 10, 11 };
-
-/**
- * motion vector prediction
- *
- * Motion prediction performed for the block by using median prediction of
- * motion vectors from the left, top and right top blocks but in corner cases
- * some other vectors may be used instead.
- */
-static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no, int dmv_no)
-{
-    MpegEncContext *s = &r->s;
-    int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride;
-    int A[2] = {0}, B[2], C[2];
-    int i, j;
-    int mx, my;
-    int* avail = r->avail_cache + avail_indexes[subblock_no];
-    int c_off = part_sizes_w[block_type];
-
-    mv_pos += (subblock_no & 1) + (subblock_no >> 1)*s->b8_stride;
-    if(subblock_no == 3)
-        c_off = -1;
-
-    if(avail[-1]){
-        A[0] = s->current_picture_ptr->motion_val[0][mv_pos-1][0];
-        A[1] = s->current_picture_ptr->motion_val[0][mv_pos-1][1];
-    }
-    if(avail[-4]){
-        B[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride][0];
-        B[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride][1];
-    }else{
-        B[0] = A[0];
-        B[1] = A[1];
-    }
-    if(!avail[c_off-4]){
-        if(avail[-4] && (avail[-1] || r->rv30)){
-            C[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride-1][0];
-            C[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride-1][1];
-        }else{
-            C[0] = A[0];
-            C[1] = A[1];
-        }
-    }else{
-        C[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][0];
-        C[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][1];
-    }
-    mx = mid_pred(A[0], B[0], C[0]);
-    my = mid_pred(A[1], B[1], C[1]);
-    mx += r->dmv[dmv_no][0];
-    my += r->dmv[dmv_no][1];
-    for(j = 0; j < part_sizes_h[block_type]; j++){
-        for(i = 0; i < part_sizes_w[block_type]; i++){
-            s->current_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][0] = mx;
-            s->current_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][1] = my;
-        }
-    }
-}
-
-#define GET_PTS_DIFF(a, b) ((a - b + 8192) & 0x1FFF)
-
-/**
- * Calculate motion vector component that should be added for direct blocks.
- */
-static int calc_add_mv(RV34DecContext *r, int dir, int val)
-{
-    int mul = dir ? -r->mv_weight2 : r->mv_weight1;
-
-    return (val * mul + 0x2000) >> 14;
-}
-
-/**
- * Predict motion vector for B-frame macroblock.
- */
-static inline void rv34_pred_b_vector(int A[2], int B[2], int C[2],
-                                      int A_avail, int B_avail, int C_avail,
-                                      int *mx, int *my)
-{
-    if(A_avail + B_avail + C_avail != 3){
-        *mx = A[0] + B[0] + C[0];
-        *my = A[1] + B[1] + C[1];
-        if(A_avail + B_avail + C_avail == 2){
-            *mx /= 2;
-            *my /= 2;
-        }
-    }else{
-        *mx = mid_pred(A[0], B[0], C[0]);
-        *my = mid_pred(A[1], B[1], C[1]);
-    }
-}
-
-/**
- * motion vector prediction for B-frames
- */
-static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir)
-{
-    MpegEncContext *s = &r->s;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride;
-    int A[2] = { 0 }, B[2] = { 0 }, C[2] = { 0 };
-    int has_A = 0, has_B = 0, has_C = 0;
-    int mx, my;
-    int i, j;
-    Picture *cur_pic = s->current_picture_ptr;
-    const int mask = dir ? MB_TYPE_L1 : MB_TYPE_L0;
-    int type = cur_pic->mb_type[mb_pos];
-
-    if((r->avail_cache[6-1] & type) & mask){
-        A[0] = cur_pic->motion_val[dir][mv_pos - 1][0];
-        A[1] = cur_pic->motion_val[dir][mv_pos - 1][1];
-        has_A = 1;
-    }
-    if((r->avail_cache[6-4] & type) & mask){
-        B[0] = cur_pic->motion_val[dir][mv_pos - s->b8_stride][0];
-        B[1] = cur_pic->motion_val[dir][mv_pos - s->b8_stride][1];
-        has_B = 1;
-    }
-    if(r->avail_cache[6-4] && (r->avail_cache[6-2] & type) & mask){
-        C[0] = cur_pic->motion_val[dir][mv_pos - s->b8_stride + 2][0];
-        C[1] = cur_pic->motion_val[dir][mv_pos - s->b8_stride + 2][1];
-        has_C = 1;
-    }else if((s->mb_x+1) == s->mb_width && (r->avail_cache[6-5] & type) & mask){
-        C[0] = cur_pic->motion_val[dir][mv_pos - s->b8_stride - 1][0];
-        C[1] = cur_pic->motion_val[dir][mv_pos - s->b8_stride - 1][1];
-        has_C = 1;
-    }
-
-    rv34_pred_b_vector(A, B, C, has_A, has_B, has_C, &mx, &my);
-
-    mx += r->dmv[dir][0];
-    my += r->dmv[dir][1];
-
-    for(j = 0; j < 2; j++){
-        for(i = 0; i < 2; i++){
-            cur_pic->motion_val[dir][mv_pos + i + j*s->b8_stride][0] = mx;
-            cur_pic->motion_val[dir][mv_pos + i + j*s->b8_stride][1] = my;
-        }
-    }
-    if(block_type == RV34_MB_B_BACKWARD || block_type == RV34_MB_B_FORWARD){
-        ZERO8x2(cur_pic->motion_val[!dir][mv_pos], s->b8_stride);
-    }
-}
-
-/**
- * motion vector prediction - RV3 version
- */
-static void rv34_pred_mv_rv3(RV34DecContext *r, int block_type, int dir)
-{
-    MpegEncContext *s = &r->s;
-    int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride;
-    int A[2] = {0}, B[2], C[2];
-    int i, j, k;
-    int mx, my;
-    int* avail = r->avail_cache + avail_indexes[0];
-
-    if(avail[-1]){
-        A[0] = s->current_picture_ptr->motion_val[0][mv_pos - 1][0];
-        A[1] = s->current_picture_ptr->motion_val[0][mv_pos - 1][1];
-    }
-    if(avail[-4]){
-        B[0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride][0];
-        B[1] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride][1];
-    }else{
-        B[0] = A[0];
-        B[1] = A[1];
-    }
-    if(!avail[-4 + 2]){
-        if(avail[-4] && (avail[-1])){
-            C[0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride - 1][0];
-            C[1] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride - 1][1];
-        }else{
-            C[0] = A[0];
-            C[1] = A[1];
-        }
-    }else{
-        C[0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride + 2][0];
-        C[1] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride + 2][1];
-    }
-    mx = mid_pred(A[0], B[0], C[0]);
-    my = mid_pred(A[1], B[1], C[1]);
-    mx += r->dmv[0][0];
-    my += r->dmv[0][1];
-    for(j = 0; j < 2; j++){
-        for(i = 0; i < 2; i++){
-            for(k = 0; k < 2; k++){
-                s->current_picture_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][0] = mx;
-                s->current_picture_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][1] = my;
-            }
-        }
-    }
-}
-
-static const int chroma_coeffs[3] = { 0, 3, 5 };
-
-/**
- * generic motion compensation function
- *
- * @param r decoder context
- * @param block_type type of the current block
- * @param xoff horizontal offset from the start of the current block
- * @param yoff vertical offset from the start of the current block
- * @param mv_off offset to the motion vector information
- * @param width width of the current partition in 8x8 blocks
- * @param height height of the current partition in 8x8 blocks
- * @param dir motion compensation direction (i.e. from the last or the next reference frame)
- * @param thirdpel motion vectors are specified in 1/3 of pixel
- * @param qpel_mc a set of functions used to perform luma motion compensation
- * @param chroma_mc a set of functions used to perform chroma motion compensation
- */
-static inline void rv34_mc(RV34DecContext *r, const int block_type,
-                          const int xoff, const int yoff, int mv_off,
-                          const int width, const int height, int dir,
-                          const int thirdpel, int weighted,
-                          qpel_mc_func (*qpel_mc)[16],
-                          h264_chroma_mc_func (*chroma_mc))
-{
-    MpegEncContext *s = &r->s;
-    uint8_t *Y, *U, *V, *srcY, *srcU, *srcV;
-    int dxy, mx, my, umx, umy, lx, ly, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y;
-    int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride + mv_off;
-    int is16x16 = 1;
-
-    if(thirdpel){
-        int chroma_mx, chroma_my;
-        mx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) / 3 - (1 << 24);
-        my = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24);
-        lx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) % 3;
-        ly = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) % 3;
-        chroma_mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] / 2;
-        chroma_my = s->current_picture_ptr->motion_val[dir][mv_pos][1] / 2;
-        umx = (chroma_mx + (3 << 24)) / 3 - (1 << 24);
-        umy = (chroma_my + (3 << 24)) / 3 - (1 << 24);
-        uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3];
-        uvmy = chroma_coeffs[(chroma_my + (3 << 24)) % 3];
-    }else{
-        int cx, cy;
-        mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] >> 2;
-        my = s->current_picture_ptr->motion_val[dir][mv_pos][1] >> 2;
-        lx = s->current_picture_ptr->motion_val[dir][mv_pos][0] & 3;
-        ly = s->current_picture_ptr->motion_val[dir][mv_pos][1] & 3;
-        cx = s->current_picture_ptr->motion_val[dir][mv_pos][0] / 2;
-        cy = s->current_picture_ptr->motion_val[dir][mv_pos][1] / 2;
-        umx = cx >> 2;
-        umy = cy >> 2;
-        uvmx = (cx & 3) << 1;
-        uvmy = (cy & 3) << 1;
-        //due to some flaw RV40 uses the same MC compensation routine for H2V2 and H3V3
-        if(uvmx == 6 && uvmy == 6)
-            uvmx = uvmy = 4;
-    }
-
-    if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) {
-        /* wait for the referenced mb row to be finished */
-        int mb_row = s->mb_y + ((yoff + my + 5 + 8 * height) >> 4);
-        ThreadFrame *f = dir ? &s->next_picture_ptr->tf : &s->last_picture_ptr->tf;
-        ff_thread_await_progress(f, mb_row, 0);
-    }
-
-    dxy = ly*4 + lx;
-    srcY = dir ? s->next_picture_ptr->f.data[0] : s->last_picture_ptr->f.data[0];
-    srcU = dir ? s->next_picture_ptr->f.data[1] : s->last_picture_ptr->f.data[1];
-    srcV = dir ? s->next_picture_ptr->f.data[2] : s->last_picture_ptr->f.data[2];
-    src_x = s->mb_x * 16 + xoff + mx;
-    src_y = s->mb_y * 16 + yoff + my;
-    uvsrc_x = s->mb_x * 8 + (xoff >> 1) + umx;
-    uvsrc_y = s->mb_y * 8 + (yoff >> 1) + umy;
-    srcY += src_y * s->linesize + src_x;
-    srcU += uvsrc_y * s->uvlinesize + uvsrc_x;
-    srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
-    if(s->h_edge_pos - (width << 3) < 6 || s->v_edge_pos - (height << 3) < 6 ||
-       (unsigned)(src_x - !!lx*2) > s->h_edge_pos - !!lx*2 - (width <<3) - 4 ||
-       (unsigned)(src_y - !!ly*2) > s->v_edge_pos - !!ly*2 - (height<<3) - 4) {
-        uint8_t *uvbuf = s->edge_emu_buffer + 22 * s->linesize;
-
-        srcY -= 2 + 2*s->linesize;
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
-                                 s->linesize, s->linesize,
-                                 (width << 3) + 6, (height << 3) + 6,
-                            src_x - 2, src_y - 2, s->h_edge_pos, s->v_edge_pos);
-        srcY = s->edge_emu_buffer + 2 + 2*s->linesize;
-        s->vdsp.emulated_edge_mc(uvbuf, srcU,
-                                 s->uvlinesize,s->uvlinesize,
-                                 (width << 2) + 1, (height << 2) + 1,
-                            uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-        s->vdsp.emulated_edge_mc(uvbuf + 16, srcV,
-                                 s->uvlinesize, s->uvlinesize,
-                                 (width << 2) + 1, (height << 2) + 1,
-                            uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-        srcU = uvbuf;
-        srcV = uvbuf + 16;
-    }
-    if(!weighted){
-        Y = s->dest[0] + xoff      + yoff     *s->linesize;
-        U = s->dest[1] + (xoff>>1) + (yoff>>1)*s->uvlinesize;
-        V = s->dest[2] + (xoff>>1) + (yoff>>1)*s->uvlinesize;
-    }else{
-        Y = r->tmp_b_block_y [dir]     +  xoff     +  yoff    *s->linesize;
-        U = r->tmp_b_block_uv[dir*2]   + (xoff>>1) + (yoff>>1)*s->uvlinesize;
-        V = r->tmp_b_block_uv[dir*2+1] + (xoff>>1) + (yoff>>1)*s->uvlinesize;
-    }
-
-    if(block_type == RV34_MB_P_16x8){
-        qpel_mc[1][dxy](Y, srcY, s->linesize);
-        Y    += 8;
-        srcY += 8;
-    }else if(block_type == RV34_MB_P_8x16){
-        qpel_mc[1][dxy](Y, srcY, s->linesize);
-        Y    += 8 * s->linesize;
-        srcY += 8 * s->linesize;
-    }
-    is16x16 = (block_type != RV34_MB_P_8x8) && (block_type != RV34_MB_P_16x8) && (block_type != RV34_MB_P_8x16);
-    qpel_mc[!is16x16][dxy](Y, srcY, s->linesize);
-    chroma_mc[2-width]   (U, srcU, s->uvlinesize, height*4, uvmx, uvmy);
-    chroma_mc[2-width]   (V, srcV, s->uvlinesize, height*4, uvmx, uvmy);
-}
-
-static void rv34_mc_1mv(RV34DecContext *r, const int block_type,
-                        const int xoff, const int yoff, int mv_off,
-                        const int width, const int height, int dir)
-{
-    rv34_mc(r, block_type, xoff, yoff, mv_off, width, height, dir, r->rv30, 0,
-            r->rdsp.put_pixels_tab,
-            r->rdsp.put_chroma_pixels_tab);
-}
-
-static void rv4_weight(RV34DecContext *r)
-{
-    r->rdsp.rv40_weight_pixels_tab[r->scaled_weight][0](r->s.dest[0],
-                                                        r->tmp_b_block_y[0],
-                                                        r->tmp_b_block_y[1],
-                                                        r->weight1,
-                                                        r->weight2,
-                                                        r->s.linesize);
-    r->rdsp.rv40_weight_pixels_tab[r->scaled_weight][1](r->s.dest[1],
-                                                        r->tmp_b_block_uv[0],
-                                                        r->tmp_b_block_uv[2],
-                                                        r->weight1,
-                                                        r->weight2,
-                                                        r->s.uvlinesize);
-    r->rdsp.rv40_weight_pixels_tab[r->scaled_weight][1](r->s.dest[2],
-                                                        r->tmp_b_block_uv[1],
-                                                        r->tmp_b_block_uv[3],
-                                                        r->weight1,
-                                                        r->weight2,
-                                                        r->s.uvlinesize);
-}
-
-static void rv34_mc_2mv(RV34DecContext *r, const int block_type)
-{
-    int weighted = !r->rv30 && block_type != RV34_MB_B_BIDIR && r->weight1 != 8192;
-
-    rv34_mc(r, block_type, 0, 0, 0, 2, 2, 0, r->rv30, weighted,
-            r->rdsp.put_pixels_tab,
-            r->rdsp.put_chroma_pixels_tab);
-    if(!weighted){
-        rv34_mc(r, block_type, 0, 0, 0, 2, 2, 1, r->rv30, 0,
-                r->rdsp.avg_pixels_tab,
-                r->rdsp.avg_chroma_pixels_tab);
-    }else{
-        rv34_mc(r, block_type, 0, 0, 0, 2, 2, 1, r->rv30, 1,
-                r->rdsp.put_pixels_tab,
-                r->rdsp.put_chroma_pixels_tab);
-        rv4_weight(r);
-    }
-}
-
-static void rv34_mc_2mv_skip(RV34DecContext *r)
-{
-    int i, j;
-    int weighted = !r->rv30 && r->weight1 != 8192;
-
-    for(j = 0; j < 2; j++)
-        for(i = 0; i < 2; i++){
-             rv34_mc(r, RV34_MB_P_8x8, i*8, j*8, i+j*r->s.b8_stride, 1, 1, 0, r->rv30,
-                     weighted,
-                     r->rdsp.put_pixels_tab,
-                     r->rdsp.put_chroma_pixels_tab);
-             rv34_mc(r, RV34_MB_P_8x8, i*8, j*8, i+j*r->s.b8_stride, 1, 1, 1, r->rv30,
-                     weighted,
-                     weighted ? r->rdsp.put_pixels_tab : r->rdsp.avg_pixels_tab,
-                     weighted ? r->rdsp.put_chroma_pixels_tab : r->rdsp.avg_chroma_pixels_tab);
-        }
-    if(weighted)
-        rv4_weight(r);
-}
-
-/** number of motion vectors in each macroblock type */
-static const int num_mvs[RV34_MB_TYPES] = { 0, 0, 1, 4, 1, 1, 0, 0, 2, 2, 2, 1 };
-
-/**
- * Decode motion vector differences
- * and perform motion vector reconstruction and motion compensation.
- */
-static int rv34_decode_mv(RV34DecContext *r, int block_type)
-{
-    MpegEncContext *s = &r->s;
-    GetBitContext *gb = &s->gb;
-    int i, j, k, l;
-    int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride;
-    int next_bt;
-
-    memset(r->dmv, 0, sizeof(r->dmv));
-    for(i = 0; i < num_mvs[block_type]; i++){
-        r->dmv[i][0] = svq3_get_se_golomb(gb);
-        r->dmv[i][1] = svq3_get_se_golomb(gb);
-    }
-    switch(block_type){
-    case RV34_MB_TYPE_INTRA:
-    case RV34_MB_TYPE_INTRA16x16:
-        ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride);
-        return 0;
-    case RV34_MB_SKIP:
-        if(s->pict_type == AV_PICTURE_TYPE_P){
-            ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride);
-            rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0);
-            break;
-        }
-    case RV34_MB_B_DIRECT:
-        //surprisingly, it uses motion scheme from next reference frame
-        /* wait for the current mb row to be finished */
-        if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME))
-            ff_thread_await_progress(&s->next_picture_ptr->tf, FFMAX(0, s->mb_y-1), 0);
-
-        next_bt = s->next_picture_ptr->mb_type[s->mb_x + s->mb_y * s->mb_stride];
-        if(IS_INTRA(next_bt) || IS_SKIP(next_bt)){
-            ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride);
-            ZERO8x2(s->current_picture_ptr->motion_val[1][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride);
-        }else
-            for(j = 0; j < 2; j++)
-                for(i = 0; i < 2; i++)
-                    for(k = 0; k < 2; k++)
-                        for(l = 0; l < 2; l++)
-                            s->current_picture_ptr->motion_val[l][mv_pos + i + j*s->b8_stride][k] = calc_add_mv(r, l, s->next_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][k]);
-        if(!(IS_16X8(next_bt) || IS_8X16(next_bt) || IS_8X8(next_bt))) //we can use whole macroblock MC
-            rv34_mc_2mv(r, block_type);
-        else
-            rv34_mc_2mv_skip(r);
-        ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride);
-        break;
-    case RV34_MB_P_16x16:
-    case RV34_MB_P_MIX16x16:
-        rv34_pred_mv(r, block_type, 0, 0);
-        rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0);
-        break;
-    case RV34_MB_B_FORWARD:
-    case RV34_MB_B_BACKWARD:
-        r->dmv[1][0] = r->dmv[0][0];
-        r->dmv[1][1] = r->dmv[0][1];
-        if(r->rv30)
-            rv34_pred_mv_rv3(r, block_type, block_type == RV34_MB_B_BACKWARD);
-        else
-            rv34_pred_mv_b  (r, block_type, block_type == RV34_MB_B_BACKWARD);
-        rv34_mc_1mv     (r, block_type, 0, 0, 0, 2, 2, block_type == RV34_MB_B_BACKWARD);
-        break;
-    case RV34_MB_P_16x8:
-    case RV34_MB_P_8x16:
-        rv34_pred_mv(r, block_type, 0, 0);
-        rv34_pred_mv(r, block_type, 1 + (block_type == RV34_MB_P_16x8), 1);
-        if(block_type == RV34_MB_P_16x8){
-            rv34_mc_1mv(r, block_type, 0, 0, 0,            2, 1, 0);
-            rv34_mc_1mv(r, block_type, 0, 8, s->b8_stride, 2, 1, 0);
-        }
-        if(block_type == RV34_MB_P_8x16){
-            rv34_mc_1mv(r, block_type, 0, 0, 0, 1, 2, 0);
-            rv34_mc_1mv(r, block_type, 8, 0, 1, 1, 2, 0);
-        }
-        break;
-    case RV34_MB_B_BIDIR:
-        rv34_pred_mv_b  (r, block_type, 0);
-        rv34_pred_mv_b  (r, block_type, 1);
-        rv34_mc_2mv     (r, block_type);
-        break;
-    case RV34_MB_P_8x8:
-        for(i=0;i< 4;i++){
-            rv34_pred_mv(r, block_type, i, i);
-            rv34_mc_1mv (r, block_type, (i&1)<<3, (i&2)<<2, (i&1)+(i>>1)*s->b8_stride, 1, 1, 0);
-        }
-        break;
-    }
-
-    return 0;
-}
-/** @} */ // mv group
-
-/**
- * @name Macroblock reconstruction functions
- * @{
- */
-/** mapping of RV30/40 intra prediction types to standard H.264 types */
-static const int ittrans[9] = {
- DC_PRED, VERT_PRED, HOR_PRED, DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_LEFT_PRED,
- VERT_RIGHT_PRED, VERT_LEFT_PRED, HOR_UP_PRED, HOR_DOWN_PRED,
-};
-
-/** mapping of RV30/40 intra 16x16 prediction types to standard H.264 types */
-static const int ittrans16[4] = {
- DC_PRED8x8, VERT_PRED8x8, HOR_PRED8x8, PLANE_PRED8x8,
-};
-
-/**
- * Perform 4x4 intra prediction.
- */
-static void rv34_pred_4x4_block(RV34DecContext *r, uint8_t *dst, int stride, int itype, int up, int left, int down, int right)
-{
-    uint8_t *prev = dst - stride + 4;
-    uint32_t topleft;
-
-    if(!up && !left)
-        itype = DC_128_PRED;
-    else if(!up){
-        if(itype == VERT_PRED) itype = HOR_PRED;
-        if(itype == DC_PRED)   itype = LEFT_DC_PRED;
-    }else if(!left){
-        if(itype == HOR_PRED)  itype = VERT_PRED;
-        if(itype == DC_PRED)   itype = TOP_DC_PRED;
-        if(itype == DIAG_DOWN_LEFT_PRED) itype = DIAG_DOWN_LEFT_PRED_RV40_NODOWN;
-    }
-    if(!down){
-        if(itype == DIAG_DOWN_LEFT_PRED) itype = DIAG_DOWN_LEFT_PRED_RV40_NODOWN;
-        if(itype == HOR_UP_PRED) itype = HOR_UP_PRED_RV40_NODOWN;
-        if(itype == VERT_LEFT_PRED) itype = VERT_LEFT_PRED_RV40_NODOWN;
-    }
-    if(!right && up){
-        topleft = dst[-stride + 3] * 0x01010101u;
-        prev = (uint8_t*)&topleft;
-    }
-    r->h.pred4x4[itype](dst, prev, stride);
-}
-
-static inline int adjust_pred16(int itype, int up, int left)
-{
-    if(!up && !left)
-        itype = DC_128_PRED8x8;
-    else if(!up){
-        if(itype == PLANE_PRED8x8)itype = HOR_PRED8x8;
-        if(itype == VERT_PRED8x8) itype = HOR_PRED8x8;
-        if(itype == DC_PRED8x8)   itype = LEFT_DC_PRED8x8;
-    }else if(!left){
-        if(itype == PLANE_PRED8x8)itype = VERT_PRED8x8;
-        if(itype == HOR_PRED8x8)  itype = VERT_PRED8x8;
-        if(itype == DC_PRED8x8)   itype = TOP_DC_PRED8x8;
-    }
-    return itype;
-}
-
-static inline void rv34_process_block(RV34DecContext *r,
-                                      uint8_t *pdst, int stride,
-                                      int fc, int sc, int q_dc, int q_ac)
-{
-    MpegEncContext *s = &r->s;
-    int16_t *ptr = s->block[0];
-    int has_ac = rv34_decode_block(ptr, &s->gb, r->cur_vlcs,
-                                   fc, sc, q_dc, q_ac, q_ac);
-    if(has_ac){
-        r->rdsp.rv34_idct_add(pdst, stride, ptr);
-    }else{
-        r->rdsp.rv34_idct_dc_add(pdst, stride, ptr[0]);
-        ptr[0] = 0;
-    }
-}
-
-static void rv34_output_i16x16(RV34DecContext *r, int8_t *intra_types, int cbp)
-{
-    LOCAL_ALIGNED_16(int16_t, block16, [16]);
-    MpegEncContext *s    = &r->s;
-    GetBitContext  *gb   = &s->gb;
-    int             q_dc = rv34_qscale_tab[ r->luma_dc_quant_i[s->qscale] ],
-                    q_ac = rv34_qscale_tab[s->qscale];
-    uint8_t        *dst  = s->dest[0];
-    int16_t        *ptr  = s->block[0];
-    int i, j, itype, has_ac;
-
-    memset(block16, 0, 16 * sizeof(*block16));
-
-    has_ac = rv34_decode_block(block16, gb, r->cur_vlcs, 3, 0, q_dc, q_dc, q_ac);
-    if(has_ac)
-        r->rdsp.rv34_inv_transform(block16);
-    else
-        r->rdsp.rv34_inv_transform_dc(block16);
-
-    itype = ittrans16[intra_types[0]];
-    itype = adjust_pred16(itype, r->avail_cache[6-4], r->avail_cache[6-1]);
-    r->h.pred16x16[itype](dst, s->linesize);
-
-    for(j = 0; j < 4; j++){
-        for(i = 0; i < 4; i++, cbp >>= 1){
-            int dc = block16[i + j*4];
-
-            if(cbp & 1){
-                has_ac = rv34_decode_block(ptr, gb, r->cur_vlcs, r->luma_vlc, 0, q_ac, q_ac, q_ac);
-            }else
-                has_ac = 0;
-
-            if(has_ac){
-                ptr[0] = dc;
-                r->rdsp.rv34_idct_add(dst+4*i, s->linesize, ptr);
-            }else
-                r->rdsp.rv34_idct_dc_add(dst+4*i, s->linesize, dc);
-        }
-
-        dst += 4*s->linesize;
-    }
-
-    itype = ittrans16[intra_types[0]];
-    if(itype == PLANE_PRED8x8) itype = DC_PRED8x8;
-    itype = adjust_pred16(itype, r->avail_cache[6-4], r->avail_cache[6-1]);
-
-    q_dc = rv34_qscale_tab[rv34_chroma_quant[1][s->qscale]];
-    q_ac = rv34_qscale_tab[rv34_chroma_quant[0][s->qscale]];
-
-    for(j = 1; j < 3; j++){
-        dst = s->dest[j];
-        r->h.pred8x8[itype](dst, s->uvlinesize);
-        for(i = 0; i < 4; i++, cbp >>= 1){
-            uint8_t *pdst;
-            if(!(cbp & 1)) continue;
-            pdst   = dst + (i&1)*4 + (i&2)*2*s->uvlinesize;
-
-            rv34_process_block(r, pdst, s->uvlinesize,
-                               r->chroma_vlc, 1, q_dc, q_ac);
-        }
-    }
-}
-
-static void rv34_output_intra(RV34DecContext *r, int8_t *intra_types, int cbp)
-{
-    MpegEncContext *s   = &r->s;
-    uint8_t        *dst = s->dest[0];
-    int      avail[6*8] = {0};
-    int i, j, k;
-    int idx, q_ac, q_dc;
-
-    // Set neighbour information.
-    if(r->avail_cache[1])
-        avail[0] = 1;
-    if(r->avail_cache[2])
-        avail[1] = avail[2] = 1;
-    if(r->avail_cache[3])
-        avail[3] = avail[4] = 1;
-    if(r->avail_cache[4])
-        avail[5] = 1;
-    if(r->avail_cache[5])
-        avail[8] = avail[16] = 1;
-    if(r->avail_cache[9])
-        avail[24] = avail[32] = 1;
-
-    q_ac = rv34_qscale_tab[s->qscale];
-    for(j = 0; j < 4; j++){
-        idx = 9 + j*8;
-        for(i = 0; i < 4; i++, cbp >>= 1, dst += 4, idx++){
-            rv34_pred_4x4_block(r, dst, s->linesize, ittrans[intra_types[i]], avail[idx-8], avail[idx-1], avail[idx+7], avail[idx-7]);
-            avail[idx] = 1;
-            if(!(cbp & 1)) continue;
-
-            rv34_process_block(r, dst, s->linesize,
-                               r->luma_vlc, 0, q_ac, q_ac);
-        }
-        dst += s->linesize * 4 - 4*4;
-        intra_types += r->intra_types_stride;
-    }
-
-    intra_types -= r->intra_types_stride * 4;
-
-    q_dc = rv34_qscale_tab[rv34_chroma_quant[1][s->qscale]];
-    q_ac = rv34_qscale_tab[rv34_chroma_quant[0][s->qscale]];
-
-    for(k = 0; k < 2; k++){
-        dst = s->dest[1+k];
-        fill_rectangle(r->avail_cache + 6, 2, 2, 4, 0, 4);
-
-        for(j = 0; j < 2; j++){
-            int* acache = r->avail_cache + 6 + j*4;
-            for(i = 0; i < 2; i++, cbp >>= 1, acache++){
-                int itype = ittrans[intra_types[i*2+j*2*r->intra_types_stride]];
-                rv34_pred_4x4_block(r, dst+4*i, s->uvlinesize, itype, acache[-4], acache[-1], !i && !j, acache[-3]);
-                acache[0] = 1;
-
-                if(!(cbp&1)) continue;
-
-                rv34_process_block(r, dst + 4*i, s->uvlinesize,
-                                   r->chroma_vlc, 1, q_dc, q_ac);
-            }
-
-            dst += 4*s->uvlinesize;
-        }
-    }
-}
-
-static int is_mv_diff_gt_3(int16_t (*motion_val)[2], int step)
-{
-    int d;
-    d = motion_val[0][0] - motion_val[-step][0];
-    if(d < -3 || d > 3)
-        return 1;
-    d = motion_val[0][1] - motion_val[-step][1];
-    if(d < -3 || d > 3)
-        return 1;
-    return 0;
-}
-
-static int rv34_set_deblock_coef(RV34DecContext *r)
-{
-    MpegEncContext *s = &r->s;
-    int hmvmask = 0, vmvmask = 0, i, j;
-    int midx = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride;
-    int16_t (*motion_val)[2] = &s->current_picture_ptr->motion_val[0][midx];
-    for(j = 0; j < 16; j += 8){
-        for(i = 0; i < 2; i++){
-            if(is_mv_diff_gt_3(motion_val + i, 1))
-                vmvmask |= 0x11 << (j + i*2);
-            if((j || s->mb_y) && is_mv_diff_gt_3(motion_val + i, s->b8_stride))
-                hmvmask |= 0x03 << (j + i*2);
-        }
-        motion_val += s->b8_stride;
-    }
-    if(s->first_slice_line)
-        hmvmask &= ~0x000F;
-    if(!s->mb_x)
-        vmvmask &= ~0x1111;
-    if(r->rv30){ //RV30 marks both subblocks on the edge for filtering
-        vmvmask |= (vmvmask & 0x4444) >> 1;
-        hmvmask |= (hmvmask & 0x0F00) >> 4;
-        if(s->mb_x)
-            r->deblock_coefs[s->mb_x - 1 + s->mb_y*s->mb_stride] |= (vmvmask & 0x1111) << 3;
-        if(!s->first_slice_line)
-            r->deblock_coefs[s->mb_x + (s->mb_y - 1)*s->mb_stride] |= (hmvmask & 0xF) << 12;
-    }
-    return hmvmask | vmvmask;
-}
-
-static int rv34_decode_inter_macroblock(RV34DecContext *r, int8_t *intra_types)
-{
-    MpegEncContext *s   = &r->s;
-    GetBitContext  *gb  = &s->gb;
-    uint8_t        *dst = s->dest[0];
-    int16_t        *ptr = s->block[0];
-    int          mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int cbp, cbp2;
-    int q_dc, q_ac, has_ac;
-    int i, j;
-    int dist;
-
-    // Calculate which neighbours are available. Maybe it's worth optimizing too.
-    memset(r->avail_cache, 0, sizeof(r->avail_cache));
-    fill_rectangle(r->avail_cache + 6, 2, 2, 4, 1, 4);
-    dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width;
-    if(s->mb_x && dist)
-        r->avail_cache[5] =
-        r->avail_cache[9] = s->current_picture_ptr->mb_type[mb_pos - 1];
-    if(dist >= s->mb_width)
-        r->avail_cache[2] =
-        r->avail_cache[3] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride];
-    if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1)
-        r->avail_cache[4] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride + 1];
-    if(s->mb_x && dist > s->mb_width)
-        r->avail_cache[1] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride - 1];
-
-    s->qscale = r->si.quant;
-    cbp = cbp2 = rv34_decode_inter_mb_header(r, intra_types);
-    r->cbp_luma  [mb_pos] = cbp;
-    r->cbp_chroma[mb_pos] = cbp >> 16;
-    r->deblock_coefs[mb_pos] = rv34_set_deblock_coef(r) | r->cbp_luma[mb_pos];
-    s->current_picture_ptr->qscale_table[mb_pos] = s->qscale;
-
-    if(cbp == -1)
-        return -1;
-
-    if (IS_INTRA(s->current_picture_ptr->mb_type[mb_pos])){
-        if(r->is16) rv34_output_i16x16(r, intra_types, cbp);
-        else        rv34_output_intra(r, intra_types, cbp);
-        return 0;
-    }
-
-    if(r->is16){
-        // Only for RV34_MB_P_MIX16x16
-        LOCAL_ALIGNED_16(int16_t, block16, [16]);
-        memset(block16, 0, 16 * sizeof(*block16));
-        q_dc = rv34_qscale_tab[ r->luma_dc_quant_p[s->qscale] ];
-        q_ac = rv34_qscale_tab[s->qscale];
-        if (rv34_decode_block(block16, gb, r->cur_vlcs, 3, 0, q_dc, q_dc, q_ac))
-            r->rdsp.rv34_inv_transform(block16);
-        else
-            r->rdsp.rv34_inv_transform_dc(block16);
-
-        q_ac = rv34_qscale_tab[s->qscale];
-
-        for(j = 0; j < 4; j++){
-            for(i = 0; i < 4; i++, cbp >>= 1){
-                int      dc   = block16[i + j*4];
-
-                if(cbp & 1){
-                    has_ac = rv34_decode_block(ptr, gb, r->cur_vlcs, r->luma_vlc, 0, q_ac, q_ac, q_ac);
-                }else
-                    has_ac = 0;
-
-                if(has_ac){
-                    ptr[0] = dc;
-                    r->rdsp.rv34_idct_add(dst+4*i, s->linesize, ptr);
-                }else
-                    r->rdsp.rv34_idct_dc_add(dst+4*i, s->linesize, dc);
-            }
-
-            dst += 4*s->linesize;
-        }
-
-        r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 1);
-    }else{
-        q_ac = rv34_qscale_tab[s->qscale];
-
-        for(j = 0; j < 4; j++){
-            for(i = 0; i < 4; i++, cbp >>= 1){
-                if(!(cbp & 1)) continue;
-
-                rv34_process_block(r, dst + 4*i, s->linesize,
-                                   r->luma_vlc, 0, q_ac, q_ac);
-            }
-            dst += 4*s->linesize;
-        }
-    }
-
-    q_dc = rv34_qscale_tab[rv34_chroma_quant[1][s->qscale]];
-    q_ac = rv34_qscale_tab[rv34_chroma_quant[0][s->qscale]];
-
-    for(j = 1; j < 3; j++){
-        dst = s->dest[j];
-        for(i = 0; i < 4; i++, cbp >>= 1){
-            uint8_t *pdst;
-            if(!(cbp & 1)) continue;
-            pdst = dst + (i&1)*4 + (i&2)*2*s->uvlinesize;
-
-            rv34_process_block(r, pdst, s->uvlinesize,
-                               r->chroma_vlc, 1, q_dc, q_ac);
-        }
-    }
-
-    return 0;
-}
-
-static int rv34_decode_intra_macroblock(RV34DecContext *r, int8_t *intra_types)
-{
-    MpegEncContext *s = &r->s;
-    int cbp, dist;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-
-    // Calculate which neighbours are available. Maybe it's worth optimizing too.
-    memset(r->avail_cache, 0, sizeof(r->avail_cache));
-    fill_rectangle(r->avail_cache + 6, 2, 2, 4, 1, 4);
-    dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width;
-    if(s->mb_x && dist)
-        r->avail_cache[5] =
-        r->avail_cache[9] = s->current_picture_ptr->mb_type[mb_pos - 1];
-    if(dist >= s->mb_width)
-        r->avail_cache[2] =
-        r->avail_cache[3] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride];
-    if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1)
-        r->avail_cache[4] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride + 1];
-    if(s->mb_x && dist > s->mb_width)
-        r->avail_cache[1] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride - 1];
-
-    s->qscale = r->si.quant;
-    cbp = rv34_decode_intra_mb_header(r, intra_types);
-    r->cbp_luma  [mb_pos] = cbp;
-    r->cbp_chroma[mb_pos] = cbp >> 16;
-    r->deblock_coefs[mb_pos] = 0xFFFF;
-    s->current_picture_ptr->qscale_table[mb_pos] = s->qscale;
-
-    if(cbp == -1)
-        return -1;
-
-    if(r->is16){
-        rv34_output_i16x16(r, intra_types, cbp);
-        return 0;
-    }
-
-    rv34_output_intra(r, intra_types, cbp);
-    return 0;
-}
-
-static int check_slice_end(RV34DecContext *r, MpegEncContext *s)
-{
-    int bits;
-    if(s->mb_y >= s->mb_height)
-        return 1;
-    if(!s->mb_num_left)
-        return 1;
-    if(r->s.mb_skip_run > 1)
-        return 0;
-    bits = get_bits_left(&s->gb);
-    if(bits < 0 || (bits < 8 && !show_bits(&s->gb, bits)))
-        return 1;
-    return 0;
-}
-
-
-static void rv34_decoder_free(RV34DecContext *r)
-{
-    av_freep(&r->intra_types_hist);
-    r->intra_types = NULL;
-    av_freep(&r->tmp_b_block_base);
-    av_freep(&r->mb_type);
-    av_freep(&r->cbp_luma);
-    av_freep(&r->cbp_chroma);
-    av_freep(&r->deblock_coefs);
-}
-
-
-static int rv34_decoder_alloc(RV34DecContext *r)
-{
-    r->intra_types_stride = r->s.mb_width * 4 + 4;
-
-    r->cbp_chroma       = av_malloc(r->s.mb_stride * r->s.mb_height *
-                                    sizeof(*r->cbp_chroma));
-    r->cbp_luma         = av_malloc(r->s.mb_stride * r->s.mb_height *
-                                    sizeof(*r->cbp_luma));
-    r->deblock_coefs    = av_malloc(r->s.mb_stride * r->s.mb_height *
-                                    sizeof(*r->deblock_coefs));
-    r->intra_types_hist = av_malloc(r->intra_types_stride * 4 * 2 *
-                                    sizeof(*r->intra_types_hist));
-    r->mb_type          = av_mallocz(r->s.mb_stride * r->s.mb_height *
-                                     sizeof(*r->mb_type));
-
-    if (!(r->cbp_chroma       && r->cbp_luma && r->deblock_coefs &&
-          r->intra_types_hist && r->mb_type)) {
-        rv34_decoder_free(r);
-        return AVERROR(ENOMEM);
-    }
-
-    r->intra_types = r->intra_types_hist + r->intra_types_stride * 4;
-
-    return 0;
-}
-
-
-static int rv34_decoder_realloc(RV34DecContext *r)
-{
-    rv34_decoder_free(r);
-    return rv34_decoder_alloc(r);
-}
-
-
-static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int buf_size)
-{
-    MpegEncContext *s = &r->s;
-    GetBitContext *gb = &s->gb;
-    int mb_pos, slice_type;
-    int res;
-
-    init_get_bits(&r->s.gb, buf, buf_size*8);
-    res = r->parse_slice_header(r, gb, &r->si);
-    if(res < 0){
-        av_log(s->avctx, AV_LOG_ERROR, "Incorrect or unknown slice header\n");
-        return -1;
-    }
-
-    slice_type = r->si.type ? r->si.type : AV_PICTURE_TYPE_I;
-    if (slice_type != s->pict_type) {
-        av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    r->si.end = end;
-    s->qscale = r->si.quant;
-    s->mb_num_left = r->si.end - r->si.start;
-    r->s.mb_skip_run = 0;
-
-    mb_pos = s->mb_x + s->mb_y * s->mb_width;
-    if(r->si.start != mb_pos){
-        av_log(s->avctx, AV_LOG_ERROR, "Slice indicates MB offset %d, got %d\n", r->si.start, mb_pos);
-        s->mb_x = r->si.start % s->mb_width;
-        s->mb_y = r->si.start / s->mb_width;
-    }
-    memset(r->intra_types_hist, -1, r->intra_types_stride * 4 * 2 * sizeof(*r->intra_types_hist));
-    s->first_slice_line = 1;
-    s->resync_mb_x = s->mb_x;
-    s->resync_mb_y = s->mb_y;
-
-    ff_init_block_index(s);
-    while(!check_slice_end(r, s)) {
-        ff_update_block_index(s);
-
-        if(r->si.type)
-            res = rv34_decode_inter_macroblock(r, r->intra_types + s->mb_x * 4 + 4);
-        else
-            res = rv34_decode_intra_macroblock(r, r->intra_types + s->mb_x * 4 + 4);
-        if(res < 0){
-            ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_ERROR);
-            return -1;
-        }
-        if (++s->mb_x == s->mb_width) {
-            s->mb_x = 0;
-            s->mb_y++;
-            ff_init_block_index(s);
-
-            memmove(r->intra_types_hist, r->intra_types, r->intra_types_stride * 4 * sizeof(*r->intra_types_hist));
-            memset(r->intra_types, -1, r->intra_types_stride * 4 * sizeof(*r->intra_types_hist));
-
-            if(r->loop_filter && s->mb_y >= 2)
-                r->loop_filter(r, s->mb_y - 2);
-
-            if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME))
-                ff_thread_report_progress(&s->current_picture_ptr->tf,
-                                          s->mb_y - 2, 0);
-
-        }
-        if(s->mb_x == s->resync_mb_x)
-            s->first_slice_line=0;
-        s->mb_num_left--;
-    }
-    ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END);
-
-    return s->mb_y == s->mb_height;
-}
-
-/** @} */ // recons group end
-
-/**
- * Initialize decoder.
- */
-av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
-{
-    RV34DecContext *r = avctx->priv_data;
-    MpegEncContext *s = &r->s;
-    int ret;
-
-    ff_MPV_decode_defaults(s);
-    s->avctx      = avctx;
-    s->out_format = FMT_H263;
-    s->codec_id   = avctx->codec_id;
-
-    s->width  = avctx->width;
-    s->height = avctx->height;
-
-    r->s.avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    avctx->has_b_frames = 1;
-    s->low_delay = 0;
-
-    if ((ret = ff_MPV_common_init(s)) < 0)
-        return ret;
-
-    ff_h264_pred_init(&r->h, AV_CODEC_ID_RV40, 8, 1);
-
-#if CONFIG_RV30_DECODER
-    if (avctx->codec_id == AV_CODEC_ID_RV30)
-        ff_rv30dsp_init(&r->rdsp);
-#endif
-#if CONFIG_RV40_DECODER
-    if (avctx->codec_id == AV_CODEC_ID_RV40)
-        ff_rv40dsp_init(&r->rdsp);
-#endif
-
-    if ((ret = rv34_decoder_alloc(r)) < 0) {
-        ff_MPV_common_end(&r->s);
-        return ret;
-    }
-
-    if(!intra_vlcs[0].cbppattern[0].bits)
-        rv34_init_tables();
-
-    avctx->internal->allocate_progress = 1;
-
-    return 0;
-}
-
-int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx)
-{
-    int err;
-    RV34DecContext *r = avctx->priv_data;
-
-    r->s.avctx = avctx;
-
-    if (avctx->internal->is_copy) {
-        r->tmp_b_block_base = NULL;
-        if ((err = ff_MPV_common_init(&r->s)) < 0)
-            return err;
-        if ((err = rv34_decoder_alloc(r)) < 0) {
-            ff_MPV_common_end(&r->s);
-            return err;
-        }
-    }
-
-    return 0;
-}
-
-int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
-{
-    RV34DecContext *r = dst->priv_data, *r1 = src->priv_data;
-    MpegEncContext * const s = &r->s, * const s1 = &r1->s;
-    int err;
-
-    if (dst == src || !s1->context_initialized)
-        return 0;
-
-    if (s->height != s1->height || s->width != s1->width) {
-        s->height = s1->height;
-        s->width  = s1->width;
-        if ((err = ff_MPV_common_frame_size_change(s)) < 0)
-            return err;
-        if ((err = rv34_decoder_realloc(r)) < 0)
-            return err;
-    }
-
-    if ((err = ff_mpeg_update_thread_context(dst, src)))
-        return err;
-
-    r->cur_pts  = r1->cur_pts;
-    r->last_pts = r1->last_pts;
-    r->next_pts = r1->next_pts;
-
-    memset(&r->si, 0, sizeof(r->si));
-
-    return 0;
-}
-
-static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n)
-{
-    if(avctx->slice_count) return avctx->slice_offset[n];
-    else                   return AV_RL32(buf + n*8 - 4) == 1 ? AV_RL32(buf + n*8) :  AV_RB32(buf + n*8);
-}
-
-static int finish_frame(AVCodecContext *avctx, AVFrame *pict)
-{
-    RV34DecContext *r = avctx->priv_data;
-    MpegEncContext *s = &r->s;
-    int got_picture = 0, ret;
-
-    ff_er_frame_end(&s->er);
-    ff_MPV_frame_end(s);
-    s->mb_num_left = 0;
-
-    if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME))
-        ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0);
-
-    if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
-        if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
-            return ret;
-        ff_print_debug_info(s, s->current_picture_ptr);
-        got_picture = 1;
-    } else if (s->last_picture_ptr != NULL) {
-        if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
-            return ret;
-        ff_print_debug_info(s, s->last_picture_ptr);
-        got_picture = 1;
-    }
-
-    return got_picture;
-}
-
-int ff_rv34_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_picture_ptr,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    RV34DecContext *r = avctx->priv_data;
-    MpegEncContext *s = &r->s;
-    AVFrame *pict = data;
-    SliceInfo si;
-    int i, ret;
-    int slice_count;
-    const uint8_t *slices_hdr = NULL;
-    int last = 0;
-
-    /* no supplementary picture */
-    if (buf_size == 0) {
-        /* special case for last picture */
-        if (s->low_delay==0 && s->next_picture_ptr) {
-            if ((ret = av_frame_ref(pict, &s->next_picture_ptr->f)) < 0)
-                return ret;
-            s->next_picture_ptr = NULL;
-
-            *got_picture_ptr = 1;
-        }
-        return 0;
-    }
-
-    if(!avctx->slice_count){
-        slice_count = (*buf++) + 1;
-        slices_hdr = buf + 4;
-        buf += 8 * slice_count;
-        buf_size -= 1 + 8 * slice_count;
-    }else
-        slice_count = avctx->slice_count;
-
-    //parse first slice header to check whether this frame can be decoded
-    if(get_slice_offset(avctx, slices_hdr, 0) < 0 ||
-       get_slice_offset(avctx, slices_hdr, 0) > buf_size){
-        av_log(avctx, AV_LOG_ERROR, "Slice offset is invalid\n");
-        return AVERROR_INVALIDDATA;
-    }
-    init_get_bits(&s->gb, buf+get_slice_offset(avctx, slices_hdr, 0), (buf_size-get_slice_offset(avctx, slices_hdr, 0))*8);
-    if(r->parse_slice_header(r, &r->s.gb, &si) < 0 || si.start){
-        av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if ((!s->last_picture_ptr || !s->last_picture_ptr->f.data[0]) &&
-        si.type == AV_PICTURE_TYPE_B) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid decoder state: B-frame without "
-               "reference data.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if(   (avctx->skip_frame >= AVDISCARD_NONREF && si.type==AV_PICTURE_TYPE_B)
-       || (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=AV_PICTURE_TYPE_I)
-       ||  avctx->skip_frame >= AVDISCARD_ALL)
-        return avpkt->size;
-
-    /* first slice */
-    if (si.start == 0) {
-        if (s->mb_num_left > 0) {
-            av_log(avctx, AV_LOG_ERROR, "New frame but still %d MB left.",
-                   s->mb_num_left);
-            ff_er_frame_end(&s->er);
-            ff_MPV_frame_end(s);
-        }
-
-        if (s->width != si.width || s->height != si.height) {
-            int err;
-
-            av_log(s->avctx, AV_LOG_WARNING, "Changing dimensions to %dx%d\n",
-                   si.width, si.height);
-
-            s->width  = si.width;
-            s->height = si.height;
-
-            err = ff_set_dimensions(s->avctx, s->width, s->height);
-            if (err < 0)
-                return err;
-
-            if ((err = ff_MPV_common_frame_size_change(s)) < 0)
-                return err;
-            if ((err = rv34_decoder_realloc(r)) < 0)
-                return err;
-        }
-        s->pict_type = si.type ? si.type : AV_PICTURE_TYPE_I;
-        if (ff_MPV_frame_start(s, s->avctx) < 0)
-            return -1;
-        ff_mpeg_er_frame_start(s);
-        if (!r->tmp_b_block_base) {
-            int i;
-
-            r->tmp_b_block_base = av_malloc(s->linesize * 48);
-            for (i = 0; i < 2; i++)
-                r->tmp_b_block_y[i] = r->tmp_b_block_base
-                                      + i * 16 * s->linesize;
-            for (i = 0; i < 4; i++)
-                r->tmp_b_block_uv[i] = r->tmp_b_block_base + 32 * s->linesize
-                                       + (i >> 1) * 8 * s->uvlinesize
-                                       + (i &  1) * 16;
-        }
-        r->cur_pts = si.pts;
-        if (s->pict_type != AV_PICTURE_TYPE_B) {
-            r->last_pts = r->next_pts;
-            r->next_pts = r->cur_pts;
-        } else {
-            int refdist = GET_PTS_DIFF(r->next_pts, r->last_pts);
-            int dist0   = GET_PTS_DIFF(r->cur_pts,  r->last_pts);
-            int dist1   = GET_PTS_DIFF(r->next_pts, r->cur_pts);
-
-            if(!refdist){
-                r->mv_weight1 = r->mv_weight2 = r->weight1 = r->weight2 = 8192;
-                r->scaled_weight = 0;
-            }else{
-                r->mv_weight1 = (dist0 << 14) / refdist;
-                r->mv_weight2 = (dist1 << 14) / refdist;
-                if((r->mv_weight1|r->mv_weight2) & 511){
-                    r->weight1 = r->mv_weight1;
-                    r->weight2 = r->mv_weight2;
-                    r->scaled_weight = 0;
-                }else{
-                    r->weight1 = r->mv_weight1 >> 9;
-                    r->weight2 = r->mv_weight2 >> 9;
-                    r->scaled_weight = 1;
-                }
-            }
-        }
-        s->mb_x = s->mb_y = 0;
-        ff_thread_finish_setup(s->avctx);
-    } else if (HAVE_THREADS &&
-               (s->avctx->active_thread_type & FF_THREAD_FRAME)) {
-        av_log(s->avctx, AV_LOG_ERROR, "Decoder needs full frames in frame "
-               "multithreading mode (start MB is %d).\n", si.start);
-        return AVERROR_INVALIDDATA;
-    }
-
-    for(i = 0; i < slice_count; i++){
-        int offset = get_slice_offset(avctx, slices_hdr, i);
-        int size;
-        if(i+1 == slice_count)
-            size = buf_size - offset;
-        else
-            size = get_slice_offset(avctx, slices_hdr, i+1) - offset;
-
-        if(offset < 0 || offset > buf_size){
-            av_log(avctx, AV_LOG_ERROR, "Slice offset is invalid\n");
-            break;
-        }
-
-        r->si.end = s->mb_width * s->mb_height;
-        s->mb_num_left = r->s.mb_x + r->s.mb_y*r->s.mb_width - r->si.start;
-
-        if(i+1 < slice_count){
-            if (get_slice_offset(avctx, slices_hdr, i+1) < 0 ||
-                get_slice_offset(avctx, slices_hdr, i+1) > buf_size) {
-                av_log(avctx, AV_LOG_ERROR, "Slice offset is invalid\n");
-                break;
-            }
-            init_get_bits(&s->gb, buf+get_slice_offset(avctx, slices_hdr, i+1), (buf_size-get_slice_offset(avctx, slices_hdr, i+1))*8);
-            if(r->parse_slice_header(r, &r->s.gb, &si) < 0){
-                if(i+2 < slice_count)
-                    size = get_slice_offset(avctx, slices_hdr, i+2) - offset;
-                else
-                    size = buf_size - offset;
-            }else
-                r->si.end = si.start;
-        }
-        if (size < 0 || size > buf_size - offset) {
-            av_log(avctx, AV_LOG_ERROR, "Slice size is invalid\n");
-            break;
-        }
-        last = rv34_decode_slice(r, r->si.end, buf + offset, size);
-        if(last)
-            break;
-    }
-
-    if (s->current_picture_ptr) {
-        if (last) {
-            if(r->loop_filter)
-                r->loop_filter(r, s->mb_height - 1);
-
-            ret = finish_frame(avctx, pict);
-            if (ret < 0)
-                return ret;
-            *got_picture_ptr = ret;
-        } else if (HAVE_THREADS &&
-                   (s->avctx->active_thread_type & FF_THREAD_FRAME)) {
-            av_log(avctx, AV_LOG_INFO, "marking unfished frame as finished\n");
-            /* always mark the current frame as finished, frame-mt supports
-             * only complete frames */
-            ff_er_frame_end(&s->er);
-            ff_MPV_frame_end(s);
-            s->mb_num_left = 0;
-            ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    return avpkt->size;
-}
-
-av_cold int ff_rv34_decode_end(AVCodecContext *avctx)
-{
-    RV34DecContext *r = avctx->priv_data;
-
-    ff_MPV_common_end(&r->s);
-    rv34_decoder_free(r);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/rv34.h b/deps/libav/libavcodec/rv34.h
deleted file mode 100644
index c32c089..0000000
--- a/deps/libav/libavcodec/rv34.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * RV30/40 decoder common data declarations
- * Copyright (c) 2007 Mike Melanson, Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV30 and RV40 decoder common data declarations
- */
-
-#ifndef AVCODEC_RV34_H
-#define AVCODEC_RV34_H
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-
-#include "h264pred.h"
-#include "rv34dsp.h"
-
-#define MB_TYPE_SEPARATE_DC 0x01000000
-#define IS_SEPARATE_DC(a)   ((a) & MB_TYPE_SEPARATE_DC)
-
-/**
- * RV30 and RV40 Macroblock types
- */
-enum RV40BlockTypes{
-    RV34_MB_TYPE_INTRA,      ///< Intra macroblock
-    RV34_MB_TYPE_INTRA16x16, ///< Intra macroblock with DCs in a separate 4x4 block
-    RV34_MB_P_16x16,         ///< P-frame macroblock, one motion frame
-    RV34_MB_P_8x8,           ///< P-frame macroblock, 8x8 motion compensation partitions
-    RV34_MB_B_FORWARD,       ///< B-frame macroblock, forward prediction
-    RV34_MB_B_BACKWARD,      ///< B-frame macroblock, backward prediction
-    RV34_MB_SKIP,            ///< Skipped block
-    RV34_MB_B_DIRECT,        ///< Bidirectionally predicted B-frame macroblock, no motion vectors
-    RV34_MB_P_16x8,          ///< P-frame macroblock, 16x8 motion compensation partitions
-    RV34_MB_P_8x16,          ///< P-frame macroblock, 8x16 motion compensation partitions
-    RV34_MB_B_BIDIR,         ///< Bidirectionally predicted B-frame macroblock, two motion vectors
-    RV34_MB_P_MIX16x16,      ///< P-frame macroblock with DCs in a separate 4x4 block, one motion vector
-    RV34_MB_TYPES
-};
-
-/**
- * VLC tables used by the decoder
- *
- * Intra frame VLC sets do not contain some of those tables.
- */
-typedef struct RV34VLC{
-    VLC cbppattern[2];     ///< VLCs used for pattern of coded block patterns decoding
-    VLC cbp[2][4];         ///< VLCs used for coded block patterns decoding
-    VLC first_pattern[4];  ///< VLCs used for decoding coefficients in the first subblock
-    VLC second_pattern[2]; ///< VLCs used for decoding coefficients in the subblocks 2 and 3
-    VLC third_pattern[2];  ///< VLCs used for decoding coefficients in the last subblock
-    VLC coefficient;       ///< VLCs used for decoding big coefficients
-}RV34VLC;
-
-/** essential slice information */
-typedef struct SliceInfo{
-    int type;              ///< slice type (intra, inter)
-    int quant;             ///< quantizer used for this slice
-    int vlc_set;           ///< VLCs used for this slice
-    int start, end;        ///< start and end macroblocks of the slice
-    int width;             ///< coded width
-    int height;            ///< coded height
-    int pts;               ///< frame timestamp
-}SliceInfo;
-
-/** decoder context */
-typedef struct RV34DecContext{
-    MpegEncContext s;
-    RV34DSPContext rdsp;
-    int8_t *intra_types_hist;///< old block types, used for prediction
-    int8_t *intra_types;     ///< block types
-    int    intra_types_stride;///< block types array stride
-    const uint8_t *luma_dc_quant_i;///< luma subblock DC quantizer for intraframes
-    const uint8_t *luma_dc_quant_p;///< luma subblock DC quantizer for interframes
-
-    RV34VLC *cur_vlcs;       ///< VLC set used for current frame decoding
-    H264PredContext h;       ///< functions for 4x4 and 16x16 intra block prediction
-    SliceInfo si;            ///< current slice information
-
-    int *mb_type;            ///< internal macroblock types
-    int block_type;          ///< current block type
-    int luma_vlc;            ///< which VLC set will be used for decoding of luma blocks
-    int chroma_vlc;          ///< which VLC set will be used for decoding of chroma blocks
-    int is16;                ///< current block has additional 16x16 specific features or not
-    int dmv[4][2];           ///< differential motion vectors for the current macroblock
-
-    int rv30;                ///< indicates which RV variasnt is currently decoded
-    int rpr;                 ///< one field size in RV30 slice header
-
-    int cur_pts, last_pts, next_pts;
-    int scaled_weight;
-    int weight1, weight2;    ///< B frame distance fractions (0.14) used in motion compensation
-    int mv_weight1, mv_weight2;
-
-    uint16_t *cbp_luma;      ///< CBP values for luma subblocks
-    uint8_t  *cbp_chroma;    ///< CBP values for chroma subblocks
-    uint16_t *deblock_coefs; ///< deblock coefficients for each macroblock
-
-    /** 8x8 block available flags (for MV prediction) */
-    DECLARE_ALIGNED(8, uint32_t, avail_cache)[3*4];
-
-    /** temporary blocks for RV4 weighted MC */
-    uint8_t *tmp_b_block_y[2];
-    uint8_t *tmp_b_block_uv[4];
-    uint8_t *tmp_b_block_base;
-
-    int (*parse_slice_header)(struct RV34DecContext *r, GetBitContext *gb, SliceInfo *si);
-    int (*decode_mb_info)(struct RV34DecContext *r);
-    int (*decode_intra_types)(struct RV34DecContext *r, GetBitContext *gb, int8_t *dst);
-    void (*loop_filter)(struct RV34DecContext *r, int row);
-}RV34DecContext;
-
-/**
- * common decoding functions
- */
-int ff_rv34_get_start_offset(GetBitContext *gb, int blocks);
-int ff_rv34_decode_init(AVCodecContext *avctx);
-int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt);
-int ff_rv34_decode_end(AVCodecContext *avctx);
-int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx);
-int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src);
-
-#endif /* AVCODEC_RV34_H */
diff --git a/deps/libav/libavcodec/rv34_parser.c b/deps/libav/libavcodec/rv34_parser.c
deleted file mode 100644
index 8af7443..0000000
--- a/deps/libav/libavcodec/rv34_parser.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * RV30/40 parser
- * Copyright (c) 2011 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV30/40 parser
- */
-
-#include "parser.h"
-#include "libavutil/intreadwrite.h"
-
-typedef struct {
-    ParseContext pc;
-    int64_t key_dts;
-    int key_pts;
-} RV34ParseContext;
-
-static const int rv_to_av_frame_type[4] = {
-    AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B,
-};
-
-static int rv34_parse(AVCodecParserContext *s,
-                      AVCodecContext *avctx,
-                      const uint8_t **poutbuf, int *poutbuf_size,
-                      const uint8_t *buf, int buf_size)
-{
-    RV34ParseContext *pc = s->priv_data;
-    int type, pts, hdr;
-
-    if (buf_size < 13 + *buf * 8) {
-        *poutbuf = buf;
-        *poutbuf_size = buf_size;
-        return buf_size;
-    }
-
-    hdr = AV_RB32(buf + 9 + *buf * 8);
-    if (avctx->codec_id == AV_CODEC_ID_RV30) {
-        type = (hdr >> 27) & 3;
-        pts  = (hdr >>  7) & 0x1FFF;
-    } else {
-        type = (hdr >> 29) & 3;
-        pts  = (hdr >>  6) & 0x1FFF;
-    }
-
-    if (type != 3 && s->pts != AV_NOPTS_VALUE) {
-        pc->key_dts = s->pts;
-        pc->key_pts = pts;
-    } else {
-        if (type != 3)
-            s->pts = pc->key_dts + ((pts - pc->key_pts) & 0x1FFF);
-        else
-            s->pts = pc->key_dts - ((pc->key_pts - pts) & 0x1FFF);
-    }
-    s->pict_type = rv_to_av_frame_type[type];
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return buf_size;
-}
-
-#if CONFIG_RV30_PARSER
-AVCodecParser ff_rv30_parser = {
-    .codec_ids      = { AV_CODEC_ID_RV30 },
-    .priv_data_size = sizeof(RV34ParseContext),
-    .parser_parse   = rv34_parse,
-};
-#endif
-
-#if CONFIG_RV40_PARSER
-AVCodecParser ff_rv40_parser = {
-    .codec_ids      = { AV_CODEC_ID_RV40 },
-    .priv_data_size = sizeof(RV34ParseContext),
-    .parser_parse   = rv34_parse,
-};
-#endif
diff --git a/deps/libav/libavcodec/rv34data.h b/deps/libav/libavcodec/rv34data.h
deleted file mode 100644
index 3064124..0000000
--- a/deps/libav/libavcodec/rv34data.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * RealVideo 4 decoder
- * copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * miscellaneous RV30/40 tables
- */
-
-#ifndef AVCODEC_RV34DATA_H
-#define AVCODEC_RV34DATA_H
-
-#include <stdint.h>
-
-/**
- * number of ones in nibble minus one
- */
-static const uint8_t rv34_count_ones[16] = {
-    0, 0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 2, 3
-};
-
-/**
- * values used to reconstruct coded block pattern
- */
-static const uint8_t rv34_cbp_code[16] = {
-    0x00, 0x20, 0x10, 0x30, 0x02, 0x22, 0x12, 0x32,
-    0x01, 0x21, 0x11, 0x31, 0x03, 0x23, 0x13, 0x33
-};
-
-/**
- * precalculated results of division by three and modulo three for values 0-107
- *
- * A lot of four-tuples in RV40 are represented as c0*27+c1*9+c2*3+c3.
- * This table allows conversion from a value back to a vector.
- */
-static const uint8_t modulo_three_table[108] = {
-    0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A,
-    0x10, 0x11, 0x12, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A,
-    0x20, 0x21, 0x22, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2A,
-
-    0x40, 0x41, 0x42, 0x44, 0x45, 0x46, 0x48, 0x49, 0x4A,
-    0x50, 0x51, 0x52, 0x54, 0x55, 0x56, 0x58, 0x59, 0x5A,
-    0x60, 0x61, 0x62, 0x64, 0x65, 0x66, 0x68, 0x69, 0x6A,
-
-    0x80, 0x81, 0x82, 0x84, 0x85, 0x86, 0x88, 0x89, 0x8A,
-    0x90, 0x91, 0x92, 0x94, 0x95, 0x96, 0x98, 0x99, 0x9A,
-    0xA0, 0xA1, 0xA2, 0xA4, 0xA5, 0xA6, 0xA8, 0xA9, 0xAA,
-
-    0xC0, 0xC1, 0xC2, 0xC4, 0xC5, 0xC6, 0xC8, 0xC9, 0xCA,
-    0xD0, 0xD1, 0xD2, 0xD4, 0xD5, 0xD6, 0xD8, 0xD9, 0xDA,
-    0xE0, 0xE1, 0xE2, 0xE4, 0xE5, 0xE6, 0xE8, 0xE9, 0xEA,
-};
-
-/**
- * quantizer values used for AC and DC coefficients in chroma blocks
- */
-static const uint8_t rv34_chroma_quant[2][32] = {
- {  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-   16, 17, 17, 18, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 25 },
- {  0,  0,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,
-   14, 15, 15, 16, 17, 18, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23 }
-};
-
-/**
- * This table is used for dequantizing.
- */
-static const uint16_t rv34_qscale_tab[32] = {
-  60,   67,   76,   85,   96,  108,  121,  136,
- 152,  171,  192,  216,  242,  272,  305,  341,
- 383,  432,  481,  544,  606,  683,  767,  854,
- 963, 1074, 1212, 1392, 1566, 1708, 1978, 2211
-};
-
-/**
- * tables used to translate a quantizer value into a VLC set for decoding
- * The first table is used for intraframes.
- */
-static const uint8_t rv34_quant_to_vlc_set[2][31] = {
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
-   2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3,
-   3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6 },
-};
-
-/**
- * table for obtaining the quantizer difference
- * @todo Use with ff_modified_quant_tab from h263data.h.
- */
-static const uint8_t rv34_dquant_tab[2][32]={
-//  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-{
-    0, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9,10,11,12,13,14,15,16,17,18,18,19,20,21,22,23,24,25,26,27,28
-},{
-    0, 2, 3, 4, 5, 6, 7, 8, 9,10,11,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,31,31,26
-}
-};
-
-/**
- * maximum number of macroblocks for each of the possible slice offset sizes
- * @todo This is the same as ff_mba_max, maybe use it instead.
- */
-static const uint16_t rv34_mb_max_sizes[6] = { 0x2F, 0x62, 0x18B, 0x62F, 0x18BF, 0x23FF };
-/**
- * bits needed to code the slice offset for the given size
- * @todo This is the same as ff_mba_length, maybe use it instead.
- */
-static const uint8_t rv34_mb_bits_sizes[6] = { 6, 7, 9, 11, 13, 14 };
-
-#endif /* AVCODEC_RV34DATA_H */
diff --git a/deps/libav/libavcodec/rv34dsp.c b/deps/libav/libavcodec/rv34dsp.c
deleted file mode 100644
index 7234ee8..0000000
--- a/deps/libav/libavcodec/rv34dsp.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * RV30/40 decoder common dsp functions
- * Copyright (c) 2007 Mike Melanson, Konstantin Shishkov
- * Copyright (c) 2011 Janne Grunau
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV30/40 decoder common dsp functions
- */
-
-#include "rv34dsp.h"
-#include "libavutil/common.h"
-
-/**
- * @name RV30/40 inverse transform functions
- * @{
- */
-
-static av_always_inline void rv34_row_transform(int temp[16], int16_t *block)
-{
-    int i;
-
-    for(i = 0; i < 4; i++){
-        const int z0 = 13*(block[i+4*0] +    block[i+4*2]);
-        const int z1 = 13*(block[i+4*0] -    block[i+4*2]);
-        const int z2 =  7* block[i+4*1] - 17*block[i+4*3];
-        const int z3 = 17* block[i+4*1] +  7*block[i+4*3];
-
-        temp[4*i+0] = z0 + z3;
-        temp[4*i+1] = z1 + z2;
-        temp[4*i+2] = z1 - z2;
-        temp[4*i+3] = z0 - z3;
-    }
-}
-
-/**
- * Real Video 3.0/4.0 inverse transform + sample reconstruction
- * Code is almost the same as in SVQ3, only scaling is different.
- */
-static void rv34_idct_add_c(uint8_t *dst, ptrdiff_t stride, int16_t *block){
-    int      temp[16];
-    int      i;
-
-    rv34_row_transform(temp, block);
-    memset(block, 0, 16*sizeof(int16_t));
-
-    for(i = 0; i < 4; i++){
-        const int z0 = 13*(temp[4*0+i] +    temp[4*2+i]) + 0x200;
-        const int z1 = 13*(temp[4*0+i] -    temp[4*2+i]) + 0x200;
-        const int z2 =  7* temp[4*1+i] - 17*temp[4*3+i];
-        const int z3 = 17* temp[4*1+i] +  7*temp[4*3+i];
-
-        dst[0] = av_clip_uint8( dst[0] + ( (z0 + z3) >> 10 ) );
-        dst[1] = av_clip_uint8( dst[1] + ( (z1 + z2) >> 10 ) );
-        dst[2] = av_clip_uint8( dst[2] + ( (z1 - z2) >> 10 ) );
-        dst[3] = av_clip_uint8( dst[3] + ( (z0 - z3) >> 10 ) );
-
-        dst  += stride;
-    }
-}
-
-/**
- * RealVideo 3.0/4.0 inverse transform for DC block
- *
- * Code is almost the same as rv34_inv_transform()
- * but final coefficients are multiplied by 1.5 and have no rounding.
- */
-static void rv34_inv_transform_noround_c(int16_t *block){
-    int temp[16];
-    int i;
-
-    rv34_row_transform(temp, block);
-
-    for(i = 0; i < 4; i++){
-        const int z0 = 39*(temp[4*0+i] +    temp[4*2+i]);
-        const int z1 = 39*(temp[4*0+i] -    temp[4*2+i]);
-        const int z2 = 21* temp[4*1+i] - 51*temp[4*3+i];
-        const int z3 = 51* temp[4*1+i] + 21*temp[4*3+i];
-
-        block[i*4+0] = (z0 + z3) >> 11;
-        block[i*4+1] = (z1 + z2) >> 11;
-        block[i*4+2] = (z1 - z2) >> 11;
-        block[i*4+3] = (z0 - z3) >> 11;
-    }
-}
-
-static void rv34_idct_dc_add_c(uint8_t *dst, ptrdiff_t stride, int dc)
-{
-    int i, j;
-
-    dc = (13*13*dc + 0x200) >> 10;
-    for (i = 0; i < 4; i++)
-    {
-        for (j = 0; j < 4; j++)
-            dst[j] = av_clip_uint8( dst[j] + dc );
-
-        dst += stride;
-    }
-}
-
-static void rv34_inv_transform_dc_noround_c(int16_t *block)
-{
-    int16_t dc = (13 * 13 * 3 * block[0]) >> 11;
-    int i, j;
-
-    for (i = 0; i < 4; i++, block += 4)
-        for (j = 0; j < 4; j++)
-            block[j] = dc;
-}
-
-/** @} */ // transform
-
-
-av_cold void ff_rv34dsp_init(RV34DSPContext *c)
-{
-    c->rv34_inv_transform    = rv34_inv_transform_noround_c;
-    c->rv34_inv_transform_dc = rv34_inv_transform_dc_noround_c;
-
-    c->rv34_idct_add    = rv34_idct_add_c;
-    c->rv34_idct_dc_add = rv34_idct_dc_add_c;
-
-    if (ARCH_ARM)
-        ff_rv34dsp_init_arm(c);
-    if (ARCH_X86)
-        ff_rv34dsp_init_x86(c);
-}
diff --git a/deps/libav/libavcodec/rv34dsp.h b/deps/libav/libavcodec/rv34dsp.h
deleted file mode 100644
index 3d616ee..0000000
--- a/deps/libav/libavcodec/rv34dsp.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * RV30/40 decoder motion compensation functions
- * Copyright (c) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV30/40 decoder motion compensation functions
- */
-
-#ifndef AVCODEC_RV34DSP_H
-#define AVCODEC_RV34DSP_H
-
-#include "dsputil.h"
-#include "h264chroma.h"
-
-typedef void (*rv40_weight_func)(uint8_t *dst/*align width (8 or 16)*/,
-                                 uint8_t *src1/*align width (8 or 16)*/,
-                                 uint8_t *src2/*align width (8 or 16)*/,
-                                 int w1, int w2, ptrdiff_t stride);
-
-typedef void (*rv34_inv_transform_func)(int16_t *block);
-
-typedef void (*rv34_idct_add_func)(uint8_t *dst, ptrdiff_t stride, int16_t *block);
-typedef void (*rv34_idct_dc_add_func)(uint8_t *dst, ptrdiff_t stride,
-                                      int   dc);
-
-typedef void (*rv40_weak_loop_filter_func)(uint8_t *src, ptrdiff_t stride,
-                                           int filter_p1, int filter_q1,
-                                           int alpha, int beta,
-                                           int lims, int lim_q1, int lim_p1);
-
-typedef void (*rv40_strong_loop_filter_func)(uint8_t *src, ptrdiff_t stride,
-                                             int alpha, int lims,
-                                             int dmode, int chroma);
-
-typedef int (*rv40_loop_filter_strength_func)(uint8_t *src, ptrdiff_t stride,
-                                              int beta, int beta2, int edge,
-                                              int *p1, int *q1);
-
-typedef struct RV34DSPContext {
-    qpel_mc_func put_pixels_tab[4][16];
-    qpel_mc_func avg_pixels_tab[4][16];
-    h264_chroma_mc_func put_chroma_pixels_tab[3];
-    h264_chroma_mc_func avg_chroma_pixels_tab[3];
-    /**
-     * Biweight functions, first dimension is transform size (16/8),
-     * second is whether the weight is prescaled by 1/512 to skip
-     * the intermediate shifting.
-     */
-    rv40_weight_func rv40_weight_pixels_tab[2][2];
-    rv34_inv_transform_func rv34_inv_transform;
-    rv34_inv_transform_func rv34_inv_transform_dc;
-    rv34_idct_add_func rv34_idct_add;
-    rv34_idct_dc_add_func rv34_idct_dc_add;
-    rv40_weak_loop_filter_func rv40_weak_loop_filter[2];
-    rv40_strong_loop_filter_func rv40_strong_loop_filter[2];
-    rv40_loop_filter_strength_func rv40_loop_filter_strength[2];
-} RV34DSPContext;
-
-void ff_rv30dsp_init(RV34DSPContext *c);
-void ff_rv34dsp_init(RV34DSPContext *c);
-void ff_rv40dsp_init(RV34DSPContext *c);
-
-void ff_rv34dsp_init_arm(RV34DSPContext *c);
-void ff_rv34dsp_init_x86(RV34DSPContext *c);
-
-void ff_rv40dsp_init_aarch64(RV34DSPContext *c);
-void ff_rv40dsp_init_x86(RV34DSPContext *c);
-void ff_rv40dsp_init_arm(RV34DSPContext *c);
-
-#endif /* AVCODEC_RV34DSP_H */
diff --git a/deps/libav/libavcodec/rv34vlc.h b/deps/libav/libavcodec/rv34vlc.h
deleted file mode 100644
index f4670c1..0000000
--- a/deps/libav/libavcodec/rv34vlc.h
+++ /dev/null
@@ -1,4055 +0,0 @@
-/*
- * RealVideo 3/4 decoder
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV30/40 VLC tables
- */
-
-#ifndef AVCODEC_RV34VLC_H
-#define AVCODEC_RV34VLC_H
-
-#include <stdint.h>
-
-#define NUM_INTRA_TABLES 5
-#define NUM_INTER_TABLES 7
-
-#define CBPPAT_VLC_SIZE   1296
-#define CBP_VLC_SIZE        16
-#define FIRSTBLK_VLC_SIZE  864
-#define OTHERBLK_VLC_SIZE  108
-#define COEFF_VLC_SIZE      32
-#define MAX_VLC_SIZE      1296
-
-static const uint8_t rv34_table_intra_cbppat[NUM_INTRA_TABLES][2][CBPPAT_VLC_SIZE] = {
-  {
-    {
-       8, 10, 10, 10, 10, 10, 11, 10, 10, 11, 10, 10, 10, 10, 10,  6,
-      12, 12, 13, 12, 13, 12, 13, 11, 13, 13, 13, 12, 13, 12, 12,  8,
-      14, 13, 16, 13, 15, 13, 16, 12, 16, 16, 16, 14, 16, 13, 14, 10,
-      12, 13, 12, 12, 13, 13, 13, 12, 13, 13, 12, 12, 13, 12, 12,  8,
-      13, 14, 14, 12, 14, 14, 14, 12, 14, 15, 14, 12, 14, 13, 13,  8,
-      16, 16, 16, 12, 16, 16, 16, 13, 16, 16, 16, 13, 16, 14, 14,  9,
-      14, 16, 13, 13, 16, 16, 16, 14, 15, 16, 14, 13, 15, 15, 14, 10,
-      16, 16, 14, 13, 16, 16, 16, 13, 16, 16, 16, 13, 16, 15, 14, 10,
-      16, 16, 16, 11, 16, 16, 16, 12, 16, 16, 16, 12, 16, 16, 15,  9,
-      12, 13, 13, 13, 12, 12, 14, 12, 12, 14, 13, 12, 12, 12, 12,  8,
-      14, 14, 16, 14, 13, 12, 14, 12, 14, 15, 14, 13, 13, 12, 13,  8,
-      16, 16, 16, 15, 16, 13, 16, 13, 16, 16, 16, 15, 16, 13, 15, 10,
-      14, 16, 14, 14, 14, 14, 15, 13, 14, 16, 14, 13, 13, 13, 13,  9,
-      16, 16, 16, 14, 16, 14, 16, 12, 16, 16, 14, 13, 14, 13, 13,  8,
-      16, 16, 16, 14, 16, 14, 16, 13, 16, 16, 16, 14, 16, 14, 14,  9,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 14, 10,
-      16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 16, 14, 16, 15, 14,  9,
-      16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 16, 13, 16, 15, 15,  8,
-      14, 16, 16, 16, 14, 14, 16, 14, 16, 16, 16, 15, 13, 13, 14, 10,
-      16, 16, 16, 16, 15, 13, 16, 13, 16, 16, 16, 16, 16, 13, 14, 10,
-      16, 16, 16, 16, 16, 11, 16, 12, 16, 16, 16, 16, 16, 12, 16,  9,
-      16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 14, 14, 10,
-      16, 16, 16, 16, 16, 15, 16, 13, 16, 16, 16, 15, 16, 13, 14,  9,
-      16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 16, 16, 13, 14,  8,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 11,
-      16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14,  9,
-      16, 16, 16, 14, 16, 15, 16, 11, 16, 16, 16, 14, 16, 14, 14,  8,
-      12, 13, 13, 13, 13, 13, 14, 12, 12, 13, 12, 12, 12, 12, 12,  8,
-      14, 14, 16, 14, 15, 14, 16, 13, 14, 15, 14, 13, 14, 13, 13,  9,
-      16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 16, 14, 16, 14, 16, 10,
-      14, 15, 14, 14, 15, 14, 15, 13, 14, 14, 13, 12, 13, 13, 13,  9,
-      15, 16, 15, 14, 16, 16, 16, 13, 15, 16, 14, 12, 14, 13, 13,  8,
-      16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 16, 13, 16, 14, 14,  9,
-      16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 13, 13, 16, 16, 14, 10,
-      16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 15, 13, 16, 14, 14,  9,
-      16, 16, 16, 12, 16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 15,  8,
-      13, 14, 14, 14, 14, 14, 16, 13, 13, 14, 14, 13, 12, 12, 12,  8,
-      16, 16, 16, 14, 15, 14, 16, 13, 15, 16, 14, 13, 13, 12, 13,  8,
-      16, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 14, 16, 13, 14,  9,
-      15, 16, 16, 15, 16, 15, 16, 13, 14, 16, 14, 13, 13, 13, 12,  8,
-      16, 16, 16, 14, 16, 14, 15, 12, 15, 15, 14, 12, 13, 12, 12,  7,
-      16, 16, 16, 14, 16, 14, 16, 12, 16, 16, 16, 13, 16, 13, 13,  7,
-      16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 14, 14, 16, 14, 13,  9,
-      16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 14, 12, 16, 13, 12,  7,
-      16, 16, 16, 12, 16, 16, 16, 11, 16, 16, 15, 12, 16, 13, 13,  6,
-      16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 15, 13, 13, 14, 10,
-      16, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 14, 13, 14,  9,
-      16, 16, 16, 16, 16, 13, 16, 13, 16, 16, 16, 16, 16, 12, 14,  8,
-      16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 14, 13, 13,  9,
-      16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 13, 14, 12, 12,  7,
-      16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 13, 14, 12, 13,  6,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 14,  9,
-      16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 13, 15, 13, 12,  7,
-      16, 16, 16, 13, 16, 14, 16, 11, 16, 16, 16, 12, 16, 12, 12,  5,
-      14, 16, 15, 16, 16, 16, 16, 15, 14, 15, 14, 14, 13, 14, 13, 10,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 14, 16, 10,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 11,
-      16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 14, 14, 15, 14, 13, 10,
-      16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 14, 13, 16, 14, 14,  9,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 15,  9,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12, 13, 16, 16, 13, 10,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 16, 16, 13,  9,
-      16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 15, 12, 16, 16, 14,  8,
-      16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 15, 14, 13, 13, 13,  9,
-      16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 14, 13, 13,  9,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 15,  9,
-      16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 14, 14, 14, 13, 13,  9,
-      16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 14, 12, 13, 12, 12,  7,
-      16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 13, 16, 13, 13,  7,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 16, 14, 13,  9,
-      16, 16, 16, 15, 16, 16, 16, 13, 16, 16, 13, 12, 14, 13, 12,  6,
-      16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 14, 10, 15, 12, 12,  5,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12, 13, 13,  9,
-      16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 15, 13, 12, 13,  8,
-      16, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 15, 12, 14,  8,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 13, 13, 13,  8,
-      16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 15, 13, 12, 11, 12,  6,
-      16, 16, 16, 15, 16, 14, 16, 12, 16, 16, 16, 12, 13, 10, 12,  5,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 13, 14, 12,  8,
-      16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 13, 12, 13, 12, 10,  5,
-      16, 16, 16, 13, 16, 13, 16, 10, 16, 16, 13, 10, 13, 10, 10,  1,
-    },
-    {
-       2,  7,  7,  8,  7,  8,  9,  8,  7,  9,  8,  8,  8,  8,  9,  7,
-       6,  9, 10, 10, 10, 10, 11, 10, 10, 11, 11, 11, 10, 11, 11,  9,
-       9, 11, 12, 12, 12, 13, 14, 13, 13, 14, 14, 13, 13, 13, 14, 11,
-       6, 10,  9, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 11, 11,  9,
-       6,  9, 10, 10, 10, 11, 12, 11, 10, 12, 11, 11, 11, 11, 11,  8,
-       9, 11, 12, 12, 12, 13, 13, 13, 12, 14, 14, 13, 13, 13, 13, 10,
-       9, 13, 11, 13, 13, 14, 14, 13, 13, 14, 13, 13, 14, 14, 14, 12,
-       9, 12, 12, 12, 12, 14, 14, 13, 13, 14, 13, 13, 13, 14, 13, 11,
-       8, 12, 12, 11, 12, 14, 14, 12, 13, 14, 14, 13, 13, 13, 14, 11,
-       6, 10, 10, 11,  9, 10, 12, 11, 10, 12, 11, 11, 10, 11, 11,  9,
-       7, 10, 10, 11, 10, 11, 12, 11, 11, 12, 11, 11, 11, 11, 11,  9,
-       9, 12, 13, 13, 12, 12, 14, 13, 13, 14, 14, 13, 14, 13, 14, 11,
-       8, 11, 11, 12, 11, 12, 12, 12, 11, 13, 12, 12, 12, 12, 12, 10,
-       7, 10, 10, 11, 10, 11, 12, 11, 10, 12, 11, 11, 11, 11, 11,  8,
-       9, 11, 12, 12, 12, 12, 13, 12, 12, 13, 13, 12, 13, 12, 13, 10,
-      10, 13, 13, 14, 14, 14, 15, 14, 14, 15, 14, 15, 14, 14, 14, 12,
-       9, 12, 12, 13, 12, 13, 14, 13, 12, 13, 13, 12, 13, 13, 13, 10,
-       9, 12, 12, 12, 12, 13, 14, 12, 12, 14, 13, 12, 13, 13, 13, 10,
-       9, 12, 13, 13, 11, 13, 14, 13, 13, 14, 14, 14, 12, 13, 13, 11,
-      10, 12, 13, 13, 12, 12, 14, 13, 13, 14, 14, 14, 13, 13, 14, 11,
-      10, 13, 14, 14, 13, 12, 15, 13, 14, 14, 14, 14, 15, 13, 14, 11,
-      11, 14, 14, 14, 13, 14, 15, 14, 14, 15, 15, 14, 13, 14, 14, 12,
-      10, 13, 12, 13, 12, 12, 14, 13, 13, 14, 13, 13, 13, 13, 13, 10,
-      10, 12, 13, 13, 13, 12, 14, 12, 13, 14, 14, 13, 13, 13, 13, 10,
-      13, 15, 16, 16, 15, 15, 16, 16, 15, 16, 15, 16, 16, 16, 16, 14,
-      11, 14, 14, 14, 14, 14, 15, 14, 14, 15, 15, 14, 14, 14, 15, 11,
-      10, 13, 13, 13, 13, 13, 14, 12, 13, 14, 14, 13, 13, 13, 13, 10,
-       6, 10, 10, 11, 10, 11, 12, 11, 10, 12, 10, 11, 10, 11, 11,  9,
-       8, 11, 11, 12, 11, 12, 13, 12, 11, 12, 12, 12, 12, 12, 12, 10,
-      11, 13, 14, 14, 13, 14, 15, 14, 13, 15, 15, 14, 14, 14, 15, 12,
-       7, 11, 10, 12, 11, 12, 12, 12, 11, 12, 11, 12, 11, 12, 12, 10,
-       7, 10, 10, 11, 10, 11, 12, 11, 11, 12, 11, 11, 11, 11, 11,  9,
-      10, 12, 13, 13, 12, 13, 14, 13, 13, 14, 13, 13, 13, 13, 13, 10,
-      10, 13, 12, 14, 13, 14, 14, 14, 13, 14, 12, 14, 15, 14, 14, 11,
-      10, 12, 12, 12, 12, 13, 14, 13, 13, 14, 13, 12, 13, 13, 13, 10,
-       9, 12, 13, 13, 13, 14, 14, 13, 13, 14, 14, 13, 13, 13, 13, 10,
-       7, 10, 10, 11, 10, 11, 12, 11, 10, 12, 12, 11,  9, 11, 11,  9,
-       7, 10, 11, 11, 10, 11, 12, 11, 10, 12, 12, 11, 11, 11, 11,  9,
-      10, 12, 13, 13, 13, 13, 15, 13, 13, 14, 13, 13, 13, 13, 13, 10,
-       8, 11, 11, 11, 11, 11, 12, 11, 11, 12, 12, 11, 11, 12, 11,  9,
-       6,  9,  9, 10,  9, 10, 10, 10,  9, 11, 10, 10,  9, 10, 10,  7,
-       8, 10, 11, 11, 11, 11, 12, 11, 11, 12, 12, 11, 11, 11, 11,  8,
-      10, 13, 13, 13, 13, 14, 14, 13, 13, 14, 13, 13, 13, 13, 13, 11,
-       8, 11, 11, 11, 11, 12, 12, 11, 11, 12, 11, 11, 11, 11, 11,  8,
-       8, 11, 11, 11, 11, 12, 12, 10, 11, 12, 12, 11, 11, 11, 11,  8,
-      10, 13, 13, 13, 12, 13, 14, 13, 12, 14, 14, 14, 10, 13, 13, 11,
-      10, 12, 12, 13, 12, 13, 14, 12, 12, 13, 13, 13, 12, 12, 13, 10,
-      11, 13, 14, 14, 13, 13, 14, 13, 13, 15, 14, 13, 13, 13, 13, 10,
-      10, 12, 13, 13, 12, 13, 14, 13, 13, 14, 14, 13, 12, 13, 13, 11,
-       8, 11, 11, 11, 11, 11, 12, 11, 11, 12, 12, 11, 11, 11, 11,  8,
-       9, 11, 12, 12, 11, 11, 12, 11, 12, 12, 12, 11, 12, 11, 11,  8,
-      12, 15, 14, 14, 14, 15, 15, 14, 14, 15, 15, 14, 14, 14, 15, 12,
-      10, 12, 12, 12, 12, 12, 13, 12, 12, 13, 13, 12, 12, 12, 12,  9,
-       9, 11, 11, 11, 11, 11, 12, 10, 11, 12, 12, 11, 11, 11, 11,  7,
-      10, 13, 13, 13, 13, 14, 15, 14, 13, 14, 14, 14, 12, 14, 15, 12,
-      11, 14, 14, 14, 14, 15, 15, 14, 14, 15, 15, 15, 14, 15, 15, 12,
-      13, 16, 16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 14,
-      10, 13, 13, 14, 13, 15, 14, 14, 13, 15, 13, 14, 14, 14, 14, 12,
-      10, 13, 13, 13, 13, 13, 14, 13, 13, 14, 13, 13, 13, 13, 14, 11,
-      12, 14, 14, 14, 14, 15, 15, 14, 14, 15, 15, 14, 15, 14, 14, 12,
-      11, 14, 14, 15, 14, 15, 15, 14, 14, 15, 12, 14, 15, 16, 15, 12,
-      11, 13, 13, 14, 13, 14, 14, 14, 14, 14, 13, 13, 14, 14, 14, 11,
-      11, 14, 14, 14, 14, 15, 15, 14, 14, 16, 14, 13, 14, 14, 14, 11,
-      10, 13, 13, 13, 12, 14, 14, 14, 12, 15, 14, 14, 11, 13, 13, 12,
-      10, 12, 13, 14, 12, 13, 14, 13, 13, 14, 14, 13, 12, 13, 13, 11,
-      12, 14, 14, 15, 14, 15, 16, 15, 15, 15, 15, 15, 14, 14, 15, 12,
-      10, 13, 13, 13, 12, 13, 14, 13, 13, 14, 13, 13, 12, 13, 13, 11,
-       9, 11, 11, 12, 11, 12, 12, 11, 11, 12, 12, 11, 11, 11, 11,  9,
-      10, 12, 12, 12, 12, 12, 13, 12, 12, 13, 13, 12, 13, 12, 12,  9,
-      11, 13, 13, 15, 14, 14, 15, 14, 14, 15, 14, 14, 14, 14, 14, 11,
-      10, 12, 12, 12, 12, 12, 13, 12, 12, 13, 11, 11, 12, 12, 12,  8,
-       9, 12, 12, 11, 12, 12, 13, 11, 12, 12, 12, 11, 12, 11, 11,  8,
-      10, 13, 13, 14, 12, 14, 15, 14, 13, 15, 15, 14, 10, 13, 13, 11,
-      11, 13, 14, 13, 13, 14, 14, 13, 13, 14, 14, 14, 11, 13, 13, 11,
-      12, 14, 14, 14, 14, 14, 15, 14, 15, 16, 15, 14, 13, 13, 14, 11,
-      11, 14, 13, 14, 13, 14, 15, 14, 13, 15, 14, 14, 11, 13, 13, 11,
-       9, 12, 12, 12, 11, 12, 13, 11, 12, 13, 12, 11, 10, 11, 11,  8,
-      10, 12, 12, 12, 12, 12, 13, 11, 12, 12, 12, 11, 11, 11, 11,  8,
-      12, 15, 14, 15, 14, 15, 16, 15, 15, 15, 15, 14, 14, 14, 14, 12,
-      10, 12, 12, 12, 12, 12, 13, 11, 12, 13, 12, 11, 11, 11, 11,  8,
-       8, 10, 10, 10, 10, 10, 11,  9, 10, 11, 10,  9, 10,  9,  9,  5,
-    },
-  },
-  {
-    {
-      12, 12, 11,  9, 11, 10, 11,  9, 11, 11, 10,  9,  9,  8,  9,  5,
-      14, 13, 14, 11, 14, 11, 13, 10, 14, 13, 12, 10, 12, 10, 11,  6,
-      16, 13, 16, 12, 16, 12, 16, 11, 16, 14, 16, 12, 15, 12, 13,  8,
-      14, 14, 12, 11, 14, 12, 13, 10, 13, 13, 11, 10, 12, 11, 10,  6,
-      16, 15, 14, 11, 16, 13, 14, 10, 15, 14, 13, 10, 13, 11, 11,  7,
-      16, 16, 16, 11, 16, 14, 16, 11, 16, 16, 15, 12, 15, 13, 13,  8,
-      16, 16, 13, 12, 16, 16, 15, 12, 16, 16, 12, 11, 15, 13, 12,  8,
-      16, 16, 14, 11, 16, 16, 16, 11, 16, 16, 14, 11, 15, 14, 13,  8,
-      16, 16, 15, 10, 16, 16, 16, 10, 16, 16, 15, 11, 16, 14, 14,  8,
-      14, 14, 14, 12, 13, 11, 13, 10, 13, 13, 12, 11, 11, 10, 10,  6,
-      16, 15, 16, 13, 13, 11, 14, 11, 15, 14, 13, 11, 12, 10, 11,  7,
-      16, 15, 16, 14, 16, 11, 16, 11, 16, 16, 16, 13, 16, 12, 13,  8,
-      16, 16, 14, 13, 15, 13, 14, 11, 14, 15, 13, 11, 13, 11, 11,  7,
-      16, 16, 15, 13, 15, 13, 14, 11, 16, 15, 14, 11, 13, 11, 11,  7,
-      16, 16, 16, 13, 16, 13, 16, 11, 16, 16, 16, 12, 16, 12, 13,  8,
-      16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 14, 13, 15, 14, 13,  9,
-      16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 14, 12, 15, 13, 13,  8,
-      16, 16, 16, 12, 16, 16, 16, 11, 16, 16, 15, 12, 16, 13, 13,  7,
-      16, 16, 16, 16, 13, 12, 16, 12, 16, 16, 14, 13, 12, 11, 12,  8,
-      16, 16, 16, 15, 14, 11, 16, 11, 16, 16, 16, 13, 14, 11, 13,  8,
-      16, 16, 16, 16, 15, 10, 16, 11, 16, 16, 16, 14, 15, 11, 13,  8,
-      16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 14, 14, 14, 12, 13,  9,
-      16, 16, 16, 15, 16, 13, 16, 12, 16, 16, 16, 13, 14, 12, 13,  8,
-      16, 16, 16, 14, 16, 12, 16, 11, 16, 16, 16, 13, 15, 12, 13,  7,
-      16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 15, 16, 14, 13,  9,
-      16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 14, 16, 13, 13,  8,
-      16, 16, 16, 14, 16, 14, 16, 10, 16, 16, 16, 13, 16, 13, 13,  7,
-      14, 14, 13, 12, 13, 12, 13, 11, 12, 13, 11, 10, 11, 10, 10,  6,
-      16, 16, 15, 13, 16, 13, 15, 11, 14, 14, 13, 11, 13, 11, 11,  7,
-      16, 16, 16, 14, 16, 14, 16, 12, 16, 16, 16, 13, 16, 13, 14,  9,
-      16, 16, 13, 13, 15, 14, 14, 11, 13, 14, 11, 11, 12, 11, 11,  7,
-      16, 16, 15, 12, 16, 14, 15, 11, 14, 14, 12, 11, 13, 11, 11,  7,
-      16, 16, 16, 13, 16, 14, 16, 12, 16, 16, 14, 12, 16, 13, 13,  8,
-      16, 16, 14, 14, 16, 16, 16, 13, 16, 16, 12, 11, 15, 13, 12,  8,
-      16, 16, 15, 13, 16, 16, 16, 12, 16, 16, 13, 11, 16, 13, 12,  8,
-      16, 16, 16, 11, 16, 16, 16, 11, 16, 16, 14, 11, 16, 14, 13,  7,
-      16, 16, 15, 13, 14, 13, 14, 11, 14, 14, 12, 11, 11, 10, 11,  7,
-      16, 16, 16, 13, 14, 12, 15, 11, 15, 14, 13, 11, 12, 11, 11,  7,
-      16, 16, 16, 14, 16, 13, 16, 12, 16, 16, 16, 13, 14, 12, 13,  8,
-      16, 16, 15, 13, 15, 14, 14, 12, 14, 14, 12, 11, 12, 11, 11,  7,
-      16, 16, 14, 12, 15, 13, 14, 11, 15, 14, 13, 11, 12, 11, 11,  6,
-      16, 16, 16, 13, 16, 13, 16, 11, 16, 15, 14, 11, 14, 11, 12,  6,
-      16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 13, 12, 14, 13, 12,  8,
-      16, 16, 15, 13, 16, 14, 15, 11, 16, 16, 13, 11, 14, 12, 11,  6,
-      16, 16, 16, 12, 16, 14, 15, 11, 16, 16, 13, 10, 14, 12, 12,  6,
-      16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 14, 13, 12, 11, 12,  8,
-      16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 15, 13, 13, 11, 12,  8,
-      16, 16, 16, 15, 16, 12, 16, 12, 16, 16, 16, 14, 14, 11, 13,  7,
-      16, 16, 16, 16, 16, 15, 16, 13, 16, 16, 14, 13, 13, 12, 12,  8,
-      16, 16, 16, 14, 15, 13, 15, 11, 16, 15, 14, 12, 13, 11, 11,  6,
-      16, 16, 16, 14, 16, 12, 15, 11, 16, 16, 15, 12, 14, 11, 12,  6,
-      16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 15, 13, 14, 13, 12,  8,
-      16, 16, 16, 14, 16, 14, 16, 12, 16, 16, 14, 12, 13, 12, 11,  6,
-      16, 16, 16, 13, 16, 13, 15, 10, 16, 16, 14, 11, 14, 11, 11,  5,
-      16, 16, 15, 14, 16, 16, 16, 13, 14, 14, 12, 12, 12, 12, 12,  8,
-      16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 14, 13, 14, 13, 13,  9,
-      16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 16, 13, 15,  9,
-      16, 16, 14, 15, 16, 16, 16, 14, 14, 16, 12, 12, 13, 13, 12,  8,
-      16, 16, 16, 14, 16, 16, 16, 13, 16, 15, 13, 12, 14, 12, 12,  8,
-      16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 14, 12, 16, 13, 13,  8,
-      16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 11, 11, 15, 14, 12,  8,
-      16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 12, 11, 15, 13, 12,  8,
-      16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 13, 10, 16, 13, 12,  7,
-      16, 16, 16, 16, 16, 15, 16, 13, 14, 16, 13, 13, 12, 12, 12,  8,
-      16, 16, 16, 15, 16, 14, 16, 13, 16, 16, 14, 13, 13, 12, 12,  8,
-      16, 16, 16, 16, 16, 15, 16, 13, 16, 16, 16, 13, 15, 12, 14,  8,
-      16, 16, 16, 15, 16, 16, 16, 13, 14, 16, 13, 12, 12, 12, 11,  8,
-      16, 16, 16, 14, 16, 14, 16, 12, 14, 14, 13, 11, 13, 11, 11,  6,
-      16, 16, 16, 14, 16, 14, 16, 12, 16, 15, 14, 11, 14, 11, 12,  6,
-      16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 12, 12, 14, 13, 11,  8,
-      16, 16, 15, 14, 16, 16, 16, 12, 16, 15, 12, 11, 13, 12, 11,  6,
-      16, 16, 16, 13, 16, 14, 16, 11, 16, 14, 13, 10, 14, 11, 11,  5,
-      16, 16, 16, 16, 16, 16, 16, 14, 14, 16, 15, 13, 11, 11, 11,  8,
-      16, 16, 16, 16, 16, 15, 16, 13, 16, 16, 16, 13, 12, 11, 12,  7,
-      16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 13, 13, 11, 13,  7,
-      16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 14, 13, 12, 12, 11,  7,
-      16, 16, 16, 15, 16, 14, 15, 12, 16, 14, 13, 12, 12, 11, 11,  6,
-      16, 16, 16, 14, 16, 13, 15, 11, 16, 14, 14, 11, 13, 10, 11,  5,
-      16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 13, 12, 12, 12, 11,  7,
-      16, 16, 16, 14, 16, 14, 15, 12, 16, 15, 12, 11, 12, 11, 10,  5,
-      16, 16, 16, 13, 16, 13, 14, 10, 16, 14, 12,  9, 12, 10,  9,  3,
-    },
-    {
-       2,  6,  6,  7,  6,  7,  8,  7,  7,  8,  7,  8,  7,  8,  8,  5,
-       5,  8,  9,  9,  9,  9, 12, 10, 10, 11, 10, 10, 10, 11, 11,  8,
-       9, 10, 13, 12, 13, 12, 15, 13, 13, 14, 13, 14, 13, 13, 14, 11,
-       5, 10,  9, 10, 10, 10, 12, 10, 10, 12, 10, 11, 11, 11, 11,  8,
-       6,  9, 10,  9, 10, 11, 12, 10, 10, 12, 11, 11, 10, 11, 11,  8,
-       9, 11, 12, 11, 12, 13, 14, 12, 13, 14, 14, 12, 13, 13, 13, 11,
-      10, 13, 11, 12, 14, 14, 15, 13, 13, 15, 12, 13, 14, 14, 14, 12,
-       9, 12, 12, 12, 13, 13, 15, 13, 13, 14, 13, 13, 14, 13, 15, 11,
-       8, 11, 12, 10, 12, 13, 14, 12, 13, 14, 14, 13, 13, 13, 14, 11,
-       5,  9, 10, 10,  9, 10, 12, 11, 10, 12, 11, 11,  9, 11, 11,  9,
-       6, 10, 10, 11, 10, 10, 12, 11, 11, 12, 11, 11, 11, 11, 11,  9,
-       9, 11, 13, 13, 12, 11, 14, 12, 13, 15, 13, 13, 14, 13, 14, 11,
-       8, 11, 11, 12, 11, 12, 13, 12, 12, 13, 12, 13, 12, 12, 12, 10,
-       7, 10, 10, 11, 10, 11, 12, 11, 11, 12, 11, 11, 11, 11, 12,  9,
-       9, 12, 12, 12, 12, 12, 14, 12, 13, 14, 13, 13, 13, 13, 13, 11,
-      11, 14, 13, 15, 15, 16, 16, 15, 15, 16, 15, 15, 16, 16, 15, 13,
-      10, 12, 13, 13, 13, 14, 15, 13, 13, 14, 13, 13, 14, 14, 14, 11,
-       9, 12, 12, 12, 13, 13, 14, 12, 13, 14, 14, 13, 13, 13, 14, 11,
-       9, 13, 13, 13, 11, 12, 15, 13, 13, 15, 14, 14, 11, 13, 14, 11,
-      10, 13, 13, 13, 12, 12, 15, 13, 13, 15, 14, 14, 13, 13, 14, 11,
-      10, 12, 13, 13, 12, 11, 14, 12, 13, 15, 13, 13, 13, 13, 14, 11,
-      11, 14, 15, 15, 13, 14, 16, 14, 14, 16, 16, 14, 14, 15, 15, 13,
-      10, 13, 13, 13, 12, 13, 14, 13, 13, 14, 14, 14, 13, 13, 14, 11,
-      10, 12, 13, 13, 13, 12, 14, 13, 13, 14, 14, 13, 13, 13, 13, 11,
-      13, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15,
-      12, 15, 15, 15, 14, 15, 16, 14, 15, 16, 16, 15, 16, 15, 15, 13,
-      10, 12, 12, 12, 13, 13, 14, 12, 13, 14, 13, 13, 13, 13, 13, 11,
-       6, 10, 10, 11, 10, 11, 12, 11, 10, 12, 11, 11, 10, 11, 11,  9,
-       8, 11, 12, 12, 12, 12, 13, 12, 12, 13, 12, 13, 12, 13, 13, 10,
-      11, 13, 15, 14, 15, 14, 16, 14, 15, 16, 16, 14, 15, 15, 15, 13,
-       7, 11, 10, 12, 11, 11, 13, 11, 11, 13, 10, 11, 12, 12, 12, 10,
-       7, 11, 11, 11, 11, 11, 13, 11, 11, 13, 11, 12, 12, 12, 12,  9,
-      10, 12, 13, 13, 13, 13, 15, 13, 14, 15, 14, 14, 14, 14, 15, 11,
-      10, 13, 12, 14, 14, 14, 15, 13, 13, 15, 12, 13, 15, 15, 14, 12,
-      10, 13, 12, 12, 13, 13, 15, 14, 13, 15, 13, 13, 14, 14, 14, 11,
-      10, 13, 13, 12, 13, 14, 15, 13, 13, 15, 13, 13, 14, 14, 14, 11,
-       7, 10, 11, 11, 10, 11, 12, 11, 10, 12, 12, 12,  9, 11, 12,  9,
-       7, 11, 11, 11, 11, 11, 13, 11, 11, 13, 12, 12, 11, 12, 12,  9,
-      10, 12, 14, 13, 13, 13, 16, 13, 14, 16, 14, 14, 13, 13, 14, 11,
-       8, 11, 11, 12, 11, 12, 13, 12, 12, 13, 12, 12, 12, 12, 12, 10,
-       6,  9,  9, 10,  9, 10, 11, 10, 10, 11, 10, 10, 10, 10, 10,  8,
-       8, 11, 11, 11, 12, 11, 13, 11, 12, 13, 12, 12, 12, 12, 12, 10,
-      11, 14, 13, 14, 14, 14, 16, 14, 14, 16, 14, 14, 15, 15, 14, 12,
-       9, 12, 11, 12, 12, 12, 13, 12, 12, 13, 12, 12, 12, 12, 12, 10,
-       8, 11, 11, 11, 11, 11, 13, 11, 12, 12, 12, 12, 12, 12, 12,  9,
-      10, 13, 14, 13, 11, 13, 14, 14, 13, 15, 15, 14, 10, 13, 14, 11,
-      10, 13, 13, 13, 12, 13, 14, 13, 13, 14, 14, 14, 13, 13, 13, 11,
-      10, 13, 14, 13, 13, 12, 15, 13, 14, 15, 14, 14, 14, 13, 14, 12,
-      11, 14, 14, 14, 13, 13, 15, 14, 14, 15, 14, 15, 13, 14, 14, 12,
-       9, 11, 12, 12, 11, 11, 13, 12, 12, 13, 12, 12, 12, 12, 12, 10,
-       9, 11, 12, 12, 12, 11, 13, 11, 12, 13, 12, 12, 12, 12, 12, 10,
-      13, 15, 15, 16, 15, 16, 16, 15, 16, 16, 16, 15, 15, 15, 16, 14,
-      10, 13, 13, 13, 13, 13, 14, 13, 13, 14, 13, 13, 13, 13, 13, 11,
-       8, 11, 11, 11, 11, 11, 12, 11, 11, 12, 12, 11, 12, 11, 12,  9,
-      11, 14, 14, 15, 14, 15, 15, 14, 13, 15, 14, 15, 12, 14, 15, 13,
-      12, 15, 15, 15, 15, 15, 16, 15, 15, 16, 16, 16, 15, 16, 15, 13,
-      14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15,
-      11, 14, 13, 15, 14, 14, 16, 14, 14, 16, 13, 14, 15, 14, 15, 12,
-      11, 14, 13, 14, 14, 14, 16, 15, 14, 16, 14, 14, 15, 15, 15, 12,
-      13, 15, 15, 15, 15, 16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 13,
-      11, 14, 13, 14, 14, 14, 15, 14, 14, 16, 12, 14, 16, 16, 14, 12,
-      11, 14, 14, 14, 14, 15, 16, 15, 14, 16, 13, 14, 16, 15, 14, 12,
-      12, 14, 14, 14, 14, 14, 16, 14, 15, 16, 14, 14, 14, 15, 15, 12,
-      11, 14, 14, 14, 13, 14, 16, 15, 13, 16, 15, 15, 11, 14, 14, 12,
-      11, 14, 14, 15, 14, 14, 16, 14, 14, 15, 14, 14, 13, 15, 15, 12,
-      13, 15, 16, 15, 15, 15, 16, 15, 16, 16, 16, 16, 15, 15, 16, 13,
-      11, 14, 14, 14, 14, 14, 15, 14, 14, 16, 14, 14, 14, 15, 14, 12,
-       9, 12, 12, 12, 12, 12, 13, 12, 12, 13, 12, 13, 12, 12, 12, 10,
-      11, 13, 13, 13, 13, 13, 14, 13, 13, 14, 13, 14, 13, 13, 14, 11,
-      12, 15, 14, 15, 15, 15, 16, 15, 14, 16, 14, 14, 16, 16, 14, 13,
-      10, 12, 12, 12, 12, 12, 14, 12, 13, 13, 12, 12, 13, 13, 13, 10,
-      10, 12, 12, 12, 12, 12, 14, 12, 12, 13, 12, 12, 12, 12, 12, 10,
-      10, 14, 14, 14, 12, 14, 16, 14, 13, 16, 16, 16, 10, 13, 14, 12,
-      11, 14, 14, 14, 13, 14, 16, 14, 14, 16, 15, 14, 12, 13, 14, 12,
-      12, 14, 14, 14, 14, 14, 16, 14, 14, 16, 15, 15, 14, 14, 15, 12,
-      12, 14, 15, 15, 14, 15, 16, 14, 15, 15, 15, 15, 13, 15, 14, 12,
-       9, 12, 12, 12, 12, 13, 13, 12, 12, 13, 13, 12, 11, 12, 12, 10,
-      10, 12, 12, 12, 12, 12, 13, 12, 12, 13, 12, 12, 12, 12, 12, 10,
-      13, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 15, 16, 15, 13,
-      10, 12, 12, 13, 12, 13, 13, 12, 13, 14, 13, 13, 12, 13, 13, 10,
-       7, 10, 10, 10, 10, 10, 11, 10, 10, 11, 10, 10, 10, 10, 10,  7,
-    },
-  },
-  {
-    {
-      10, 10,  9,  8,  9,  8,  9,  7,  9,  9,  8,  7,  8,  7,  7,  4,
-      13, 11, 12,  9, 12,  9, 12,  9, 12, 11, 11,  9, 10,  9,  9,  6,
-      15, 12, 15, 11, 14, 10, 14, 10, 14, 13, 13, 11, 13, 11, 12,  7,
-      13, 12, 11,  9, 12, 11, 12,  9, 12, 12, 10,  9, 10, 10,  9,  6,
-      14, 13, 12, 10, 13, 12, 13,  9, 13, 12, 11, 10, 12, 11, 10,  6,
-      16, 14, 14, 10, 15, 13, 14, 10, 15, 15, 14, 11, 14, 12, 12,  8,
-      15, 14, 12, 11, 15, 14, 13, 11, 14, 14, 11, 10, 13, 12, 11,  8,
-      15, 16, 13, 11, 16, 14, 14, 11, 15, 15, 12, 10, 14, 13, 12,  8,
-      16, 15, 14, 10, 16, 14, 14, 10, 16, 15, 14, 10, 14, 13, 12,  7,
-      13, 12, 12, 11, 11,  9, 12,  9, 12, 12, 11, 10, 10,  9,  9,  6,
-      13, 13, 14, 12, 12, 10, 12, 10, 14, 13, 12, 11, 11, 10, 10,  7,
-      16, 14, 16, 13, 14, 11, 15, 10, 16, 15, 14, 12, 14, 11, 12,  8,
-      14, 14, 13, 12, 13, 12, 13, 10, 13, 13, 12, 11, 11, 10, 10,  7,
-      15, 14, 14, 12, 14, 12, 13, 10, 14, 13, 12, 11, 12, 11, 11,  7,
-      16, 15, 16, 13, 15, 13, 15, 10, 16, 15, 14, 12, 14, 12, 12,  7,
-      15, 16, 14, 13, 16, 14, 14, 12, 15, 15, 12, 12, 13, 12, 12,  8,
-      16, 16, 14, 13, 16, 14, 14, 11, 15, 15, 14, 11, 14, 12, 12,  8,
-      16, 16, 15, 12, 16, 14, 15, 10, 16, 16, 13, 12, 14, 13, 12,  7,
-      14, 14, 14, 13, 13, 11, 13, 11, 14, 14, 13, 12, 11, 10, 11,  8,
-      16, 15, 16, 13, 13, 11, 14, 11, 15, 14, 14, 13, 12, 11, 12,  8,
-      15, 15, 16, 14, 14, 10, 14, 10, 16, 15, 15, 13, 14, 10, 12,  8,
-      16, 16, 16, 14, 15, 13, 14, 12, 15, 15, 13, 13, 13, 12, 12,  8,
-      16, 16, 16, 14, 15, 13, 14, 11, 16, 16, 14, 13, 13, 12, 12,  8,
-      16, 16, 16, 14, 16, 12, 15, 11, 16, 15, 15, 13, 14, 12, 12,  8,
-      16, 16, 16, 16, 16, 15, 15, 13, 16, 16, 14, 13, 14, 13, 12,  9,
-      16, 16, 16, 14, 16, 15, 15, 11, 16, 16, 14, 13, 15, 13, 12,  8,
-      16, 16, 16, 14, 16, 14, 14, 10, 16, 16, 15, 13, 14, 12, 12,  7,
-      12, 12, 12, 11, 12, 11, 12, 10, 11, 11, 10,  9,  9,  9,  9,  6,
-      14, 13, 14, 12, 13, 12, 13, 10, 13, 13, 12, 10, 12, 10, 11,  7,
-      16, 14, 16, 13, 15, 13, 16, 12, 15, 14, 14, 12, 14, 12, 13,  8,
-      14, 14, 13, 11, 14, 12, 13, 11, 12, 12, 10, 10, 11, 10, 10,  7,
-      14, 14, 13, 12, 14, 12, 13, 11, 13, 13, 12, 10, 12, 11, 10,  7,
-      16, 15, 15, 12, 16, 14, 15, 11, 16, 14, 13, 11, 14, 12, 12,  8,
-      16, 16, 13, 13, 16, 15, 14, 12, 14, 14, 11, 11, 13, 12, 11,  8,
-      16, 16, 14, 12, 16, 14, 14, 12, 15, 14, 12, 11, 14, 12, 12,  8,
-      16, 15, 14, 11, 16, 15, 15, 11, 16, 15, 13, 11, 14, 13, 12,  8,
-      14, 13, 13, 12, 13, 11, 13, 10, 12, 13, 11, 10, 10, 10, 10,  7,
-      15, 14, 14, 13, 13, 12, 13, 11, 14, 13, 12, 11, 12, 10, 11,  7,
-      16, 15, 16, 14, 15, 12, 15, 11, 16, 14, 14, 12, 14, 11, 12,  8,
-      14, 15, 13, 12, 14, 13, 13, 11, 13, 13, 11, 11, 11, 10, 10,  7,
-      14, 14, 14, 12, 14, 13, 13, 10, 14, 13, 12, 10, 12, 10, 10,  6,
-      16, 15, 15, 13, 16, 13, 15, 11, 15, 14, 13, 11, 13, 11, 11,  7,
-      16, 16, 14, 13, 16, 15, 14, 12, 15, 15, 12, 11, 13, 12, 11,  8,
-      16, 16, 14, 13, 16, 14, 14, 11, 15, 14, 12, 11, 13, 12, 11,  7,
-      16, 16, 15, 12, 16, 14, 14, 11, 15, 15, 13, 11, 14, 12, 11,  6,
-      16, 15, 15, 14, 14, 12, 14, 12, 13, 14, 13, 12, 11, 11, 11,  8,
-      16, 16, 16, 14, 14, 12, 15, 12, 15, 14, 14, 12, 12, 11, 12,  8,
-      16, 16, 16, 15, 14, 12, 15, 12, 16, 15, 14, 13, 13, 11, 12,  8,
-      16, 16, 16, 15, 15, 14, 15, 12, 14, 14, 13, 12, 12, 11, 11,  8,
-      16, 16, 15, 14, 14, 12, 14, 11, 14, 14, 13, 12, 12, 11, 11,  7,
-      16, 16, 16, 14, 15, 12, 14, 11, 15, 15, 14, 12, 13, 11, 12,  7,
-      16, 16, 16, 16, 16, 15, 16, 13, 15, 15, 14, 12, 13, 12, 11,  8,
-      16, 16, 16, 14, 15, 14, 14, 12, 16, 15, 13, 12, 13, 12, 11,  7,
-      16, 16, 16, 13, 16, 13, 14, 10, 16, 15, 14, 11, 13, 11, 11,  6,
-      14, 15, 13, 13, 14, 13, 14, 12, 12, 13, 11, 11, 11, 11, 10,  8,
-      16, 16, 15, 13, 16, 14, 16, 13, 14, 14, 13, 12, 13, 12, 12,  8,
-      16, 16, 16, 14, 16, 14, 16, 13, 16, 14, 15, 13, 15, 13, 13,  9,
-      15, 15, 14, 14, 15, 14, 14, 12, 13, 14, 11, 11, 12, 12, 11,  8,
-      15, 16, 15, 13, 15, 14, 14, 12, 14, 14, 12, 11, 13, 12, 12,  8,
-      16, 16, 16, 13, 16, 15, 15, 13, 16, 15, 14, 11, 15, 12, 13,  8,
-      16, 16, 14, 13, 16, 15, 15, 13, 14, 14, 10, 11, 14, 12, 11,  8,
-      16, 16, 15, 13, 16, 16, 15, 13, 15, 14, 12, 11, 14, 13, 12,  8,
-      16, 16, 15, 13, 16, 15, 16, 12, 16, 14, 13, 10, 15, 13, 12,  7,
-      15, 15, 15, 14, 14, 14, 15, 12, 13, 14, 12, 12, 11, 11, 11,  8,
-      16, 15, 16, 14, 15, 13, 15, 12, 14, 14, 13, 12, 12, 11, 12,  8,
-      16, 16, 16, 15, 16, 14, 16, 13, 16, 15, 14, 12, 14, 11, 13,  8,
-      16, 16, 15, 14, 16, 14, 15, 13, 14, 14, 12, 11, 12, 11, 11,  8,
-      15, 16, 15, 14, 15, 14, 14, 12, 14, 13, 12, 11, 12, 11, 11,  7,
-      16, 16, 16, 14, 16, 13, 16, 12, 15, 14, 13, 11, 13, 11, 12,  7,
-      16, 16, 15, 14, 16, 15, 15, 13, 14, 15, 11, 11, 13, 12, 11,  8,
-      16, 16, 15, 13, 16, 14, 15, 12, 15, 14, 12, 11, 13, 11, 11,  7,
-      16, 16, 15, 13, 16, 14, 16, 12, 15, 14, 13, 10, 13, 11, 11,  6,
-      16, 16, 16, 14, 14, 14, 15, 13, 14, 14, 14, 12, 11, 11, 11,  8,
-      16, 16, 16, 14, 15, 14, 16, 13, 15, 14, 14, 13, 12, 11, 11,  7,
-      16, 16, 16, 16, 15, 13, 16, 12, 15, 15, 14, 12, 13, 10, 12,  7,
-      16, 16, 16, 14, 15, 15, 14, 13, 14, 14, 13, 12, 12, 11, 11,  8,
-      16, 15, 16, 14, 16, 13, 15, 12, 14, 14, 13, 12, 12, 10, 10,  6,
-      16, 15, 16, 14, 16, 13, 16, 11, 16, 14, 13, 11, 13, 10, 11,  6,
-      16, 16, 16, 15, 16, 16, 15, 13, 14, 16, 12, 12, 12, 12, 10,  7,
-      16, 16, 16, 14, 16, 14, 14, 12, 15, 15, 12, 11, 12, 11, 10,  6,
-      16, 16, 16, 13, 16, 13, 15, 10, 15, 14, 13, 10, 13, 10, 10,  4,
-    },
-    {
-       1,  6,  6,  7,  6,  7,  9,  8,  7,  9,  7,  8,  7,  8,  8,  6,
-       6,  9, 10, 10, 10, 10, 12, 11, 10, 12, 11, 11, 11, 11, 12,  9,
-       9, 10, 13, 11, 13, 12, 14, 13, 14, 14, 14, 14, 14, 14, 14, 12,
-       6, 10,  9, 10, 10, 11, 13, 11, 11, 13, 10, 12, 11, 12, 12,  9,
-       6, 10, 10, 10, 10, 11, 13, 11, 11, 13, 12, 12, 11, 12, 12,  9,
-       9, 11, 13, 12, 13, 14, 15, 13, 14, 16, 14, 14, 14, 14, 15, 12,
-      10, 13, 11, 13, 14, 14, 16, 14, 14, 15, 13, 14, 15, 15, 16, 12,
-       9, 13, 12, 12, 14, 14, 16, 14, 14, 15, 14, 14, 15, 15, 15, 12,
-       8, 11, 12, 11, 13, 14, 15, 13, 13, 15, 14, 14, 13, 15, 15, 11,
-       6, 10, 10, 11,  9, 10, 13, 11, 10, 13, 11, 12, 10, 12, 12,  9,
-       6, 10, 10, 11, 11, 10, 13, 11, 11, 13, 11, 12, 12, 12, 13, 10,
-       9, 12, 13, 13, 13, 12, 16, 13, 14, 15, 14, 14, 15, 14, 15, 12,
-       8, 12, 12, 13, 12, 13, 15, 14, 13, 15, 13, 14, 13, 13, 14, 11,
-       7, 11, 11, 12, 11, 12, 13, 12, 12, 13, 12, 13, 12, 13, 13, 10,
-       9, 12, 13, 13, 13, 13, 16, 13, 13, 15, 14, 14, 14, 15, 15, 12,
-      11, 15, 14, 15, 15, 16, 16, 16, 15, 16, 15, 16, 16, 16, 16, 14,
-      10, 13, 13, 14, 14, 14, 16, 15, 14, 16, 15, 15, 15, 15, 16, 13,
-       9, 12, 13, 13, 13, 14, 16, 14, 13, 15, 14, 14, 14, 16, 15, 12,
-      10, 13, 14, 14, 11, 13, 16, 14, 14, 16, 15, 15, 12, 14, 15, 12,
-      10, 13, 14, 14, 12, 12, 16, 15, 14, 16, 15, 15, 14, 14, 16, 12,
-       9, 12, 13, 14, 13, 11, 16, 13, 14, 15, 13, 14, 14, 14, 15, 12,
-      11, 15, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      10, 13, 14, 14, 13, 14, 16, 15, 14, 16, 16, 16, 14, 15, 16, 13,
-      10, 13, 13, 14, 13, 13, 16, 13, 13, 14, 14, 15, 15, 14, 15, 13,
-      13, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15,
-      12, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      10, 12, 13, 14, 13, 13, 14, 13, 13, 14, 13, 14, 14, 14, 15, 12,
-       6, 10, 11, 11, 10, 11, 13, 12, 11, 13, 11, 12, 11, 12, 12, 10,
-       8, 12, 13, 13, 12, 13, 14, 14, 13, 15, 14, 14, 14, 14, 15, 12,
-      12, 14, 16, 15, 15, 15, 16, 15, 16, 16, 16, 16, 16, 16, 16, 14,
-       7, 11, 11, 12, 12, 12, 14, 13, 12, 14, 11, 12, 13, 13, 13, 11,
-       8, 11, 12, 12, 12, 12, 14, 13, 12, 14, 12, 13, 13, 14, 14, 11,
-      11, 13, 14, 14, 14, 14, 16, 15, 15, 16, 15, 15, 16, 16, 16, 13,
-      10, 14, 12, 14, 14, 15, 16, 15, 13, 16, 12, 14, 16, 16, 15, 13,
-      10, 13, 13, 14, 14, 15, 16, 15, 14, 16, 14, 15, 15, 16, 16, 12,
-      10, 13, 14, 13, 14, 14, 16, 15, 14, 16, 15, 15, 14, 16, 16, 13,
-       7, 11, 11, 11, 10, 12, 14, 13, 11, 14, 13, 13, 10, 12, 13, 10,
-       8, 11, 12, 12, 11, 12, 14, 13, 12, 15, 13, 13, 12, 13, 14, 11,
-      11, 13, 14, 14, 14, 14, 16, 15, 14, 16, 15, 16, 16, 16, 16, 14,
-       8, 12, 12, 13, 12, 13, 15, 14, 12, 15, 13, 13, 13, 14, 14, 11,
-       6, 10, 10, 11, 10, 11, 13, 12, 11, 13, 11, 12, 11, 12, 12,  9,
-       9, 12, 13, 13, 13, 13, 14, 13, 13, 15, 14, 14, 14, 14, 14, 12,
-      11, 15, 14, 15, 14, 15, 16, 16, 16, 16, 15, 16, 16, 16, 16, 14,
-       9, 13, 12, 13, 13, 13, 15, 14, 13, 14, 13, 14, 14, 15, 14, 12,
-       9, 12, 12, 12, 12, 13, 14, 13, 13, 14, 13, 13, 13, 13, 14, 11,
-      10, 13, 15, 14, 12, 14, 16, 14, 14, 16, 15, 15, 12, 14, 16, 12,
-      10, 14, 14, 14, 13, 14, 16, 15, 14, 16, 16, 16, 13, 14, 16, 13,
-      11, 13, 14, 14, 14, 13, 16, 14, 14, 16, 15, 15, 15, 15, 16, 13,
-      11, 15, 15, 15, 14, 15, 16, 16, 15, 16, 16, 16, 14, 16, 16, 13,
-       9, 13, 13, 13, 12, 13, 15, 14, 13, 15, 14, 14, 13, 14, 15, 11,
-       9, 12, 12, 13, 12, 12, 14, 13, 13, 14, 13, 14, 14, 14, 14, 11,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15,
-      11, 14, 14, 15, 15, 14, 16, 16, 14, 16, 14, 15, 15, 16, 16, 12,
-       9, 12, 12, 13, 12, 12, 14, 12, 12, 14, 13, 13, 13, 13, 14, 11,
-      11, 14, 14, 16, 14, 16, 16, 16, 13, 16, 14, 16, 14, 16, 16, 13,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 15, 14, 16, 14, 15, 16, 16, 15, 16, 14, 15, 16, 16, 16, 13,
-      11, 15, 14, 16, 15, 16, 16, 16, 15, 16, 15, 16, 16, 16, 16, 14,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      11, 14, 13, 14, 15, 14, 16, 15, 14, 16, 12, 14, 16, 16, 15, 13,
-      11, 14, 14, 16, 14, 15, 16, 16, 15, 16, 14, 15, 16, 16, 16, 14,
-      12, 14, 14, 15, 14, 16, 16, 15, 14, 16, 15, 15, 15, 16, 16, 13,
-      11, 14, 15, 15, 13, 15, 16, 16, 14, 16, 16, 16, 12, 15, 15, 13,
-      11, 15, 16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 14,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15,
-      11, 15, 14, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
-      10, 13, 13, 14, 14, 14, 16, 15, 14, 16, 14, 15, 14, 14, 15, 12,
-      12, 15, 14, 16, 14, 15, 16, 15, 15, 16, 15, 15, 16, 15, 16, 13,
-      12, 16, 14, 16, 15, 16, 16, 16, 16, 16, 14, 15, 16, 16, 16, 14,
-      10, 13, 13, 14, 14, 13, 16, 14, 13, 16, 13, 14, 15, 15, 15, 12,
-      10, 13, 13, 14, 13, 13, 16, 14, 14, 15, 14, 14, 14, 14, 15, 12,
-      10, 14, 15, 14, 13, 15, 16, 15, 14, 16, 16, 16, 11, 14, 16, 12,
-      11, 14, 14, 16, 14, 15, 16, 15, 15, 16, 16, 16, 13, 15, 16, 13,
-      12, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 15, 16, 13,
-      12, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 13,
-      10, 13, 14, 14, 13, 14, 16, 14, 13, 16, 15, 14, 12, 14, 16, 11,
-      10, 13, 13, 14, 13, 14, 16, 14, 14, 15, 14, 14, 13, 14, 14, 11,
-      13, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      11, 13, 14, 15, 14, 14, 16, 15, 14, 16, 14, 15, 14, 15, 16, 12,
-       8, 11, 11, 11, 11, 12, 13, 12, 11, 13, 11, 12, 11, 12, 12,  9,
-    },
-  },
-  {
-    {
-       8,  8,  8,  7,  8,  7,  8,  6,  8,  8,  7,  6,  7,  6,  6,  4,
-      11, 10, 11,  9, 11,  9, 11,  8, 11, 10, 10,  9, 10,  8,  9,  6,
-      13, 11, 13, 10, 12, 10, 13,  9, 13, 12, 13, 10, 12, 10, 11,  7,
-      11, 11, 10,  9, 11, 10, 11,  9, 10, 11,  9,  8, 10,  9,  9,  6,
-      12, 12, 11,  9, 12, 11, 12,  9, 12, 12, 11,  9, 11, 10, 10,  7,
-      14, 13, 13, 10, 15, 12, 13, 10, 15, 13, 13, 10, 13, 12, 12,  8,
-      13, 13, 11, 10, 14, 13, 12, 10, 13, 13, 10, 10, 12, 11, 10,  8,
-      15, 14, 13, 10, 14, 13, 13, 10, 14, 13, 12, 10, 13, 12, 11,  8,
-      14, 14, 13, 10, 16, 13, 13, 10, 15, 14, 13, 10, 13, 12, 12,  8,
-      11, 11, 11, 10, 10,  9, 10,  9, 10, 10, 10,  9,  9,  8,  9,  6,
-      12, 12, 12, 11, 11,  9, 12,  9, 12, 12, 11, 10, 11,  9, 10,  7,
-      14, 13, 14, 12, 13, 10, 13, 10, 15, 13, 14, 12, 12, 10, 12,  8,
-      13, 13, 12, 11, 12, 11, 12, 10, 12, 12, 11, 10, 11, 10, 10,  7,
-      14, 13, 13, 11, 13, 12, 12, 10, 13, 13, 12, 11, 12, 10, 10,  7,
-      16, 15, 15, 12, 14, 12, 13, 10, 15, 14, 13, 12, 13, 12, 12,  8,
-      15, 15, 13, 13, 14, 14, 14, 12, 14, 14, 12, 11, 13, 12, 11,  8,
-      15, 16, 14, 12, 15, 14, 13, 11, 15, 15, 13, 12, 13, 12, 11,  8,
-      16, 15, 15, 12, 16, 14, 14, 10, 15, 15, 14, 12, 14, 12, 12,  8,
-      13, 13, 13, 13, 11, 10, 12, 10, 12, 13, 12, 11, 10, 10, 10,  8,
-      14, 13, 14, 13, 12, 10, 13, 10, 14, 14, 13, 12, 12, 10, 11,  8,
-      15, 14, 16, 14, 13, 10, 14, 10, 16, 14, 14, 13, 13, 10, 12,  8,
-      15, 15, 14, 14, 14, 13, 13, 12, 14, 14, 13, 12, 12, 11, 11,  9,
-      15, 15, 15, 14, 14, 12, 14, 11, 15, 14, 13, 13, 13, 11, 11,  8,
-      16, 15, 16, 14, 15, 12, 14, 11, 16, 16, 15, 13, 14, 12, 12,  8,
-      16, 16, 16, 14, 15, 14, 14, 12, 15, 15, 14, 13, 13, 12, 11,  9,
-      16, 16, 15, 15, 16, 14, 14, 11, 16, 16, 14, 13, 14, 12, 12,  8,
-      16, 16, 16, 13, 15, 13, 14, 10, 16, 16, 15, 13, 14, 12, 12,  8,
-      11, 11, 11, 10, 11, 10, 11,  9, 10, 10,  9,  8,  9,  9,  9,  6,
-      12, 12, 13, 11, 12, 11, 12, 10, 12, 12, 11, 10, 11, 10, 10,  7,
-      15, 13, 15, 12, 14, 13, 14, 11, 14, 13, 13, 11, 13, 11, 12,  8,
-      12, 13, 12, 11, 13, 11, 12, 10, 11, 12, 10,  9, 11, 10, 10,  7,
-      14, 13, 13, 11, 14, 12, 13, 11, 12, 12, 11, 10, 12, 11, 10,  7,
-      15, 14, 15, 12, 15, 13, 15, 11, 15, 14, 13, 11, 13, 12, 12,  8,
-      14, 14, 13, 12, 15, 14, 13, 12, 13, 13, 11, 10, 13, 12, 11,  8,
-      16, 15, 13, 12, 15, 14, 14, 12, 14, 14, 12, 11, 14, 12, 11,  8,
-      16, 15, 14, 12, 16, 15, 15, 11, 15, 14, 13, 11, 14, 13, 12,  8,
-      12, 12, 12, 11, 12, 11, 12, 10, 11, 11, 11, 10, 10,  9,  9,  7,
-      13, 13, 14, 12, 13, 11, 13, 11, 13, 12, 12, 11, 11, 10, 10,  7,
-      15, 14, 16, 13, 14, 12, 14, 11, 14, 14, 14, 12, 13, 11, 12,  8,
-      13, 13, 13, 12, 13, 12, 13, 11, 12, 12, 11, 10, 11, 10, 10,  7,
-      14, 14, 13, 12, 13, 12, 13, 10, 13, 13, 11, 10, 12, 10, 10,  7,
-      16, 15, 15, 13, 15, 12, 14, 11, 15, 14, 13, 11, 13, 11, 11,  7,
-      15, 16, 14, 13, 15, 14, 14, 12, 14, 14, 12, 11, 13, 12, 11,  8,
-      16, 15, 14, 13, 15, 14, 14, 11, 14, 14, 12, 11, 13, 12, 11,  7,
-      16, 15, 15, 12, 16, 14, 14, 11, 15, 14, 13, 11, 14, 12, 11,  7,
-      14, 15, 14, 14, 13, 12, 13, 12, 13, 13, 12, 12, 11, 10, 11,  8,
-      15, 15, 15, 14, 13, 12, 14, 12, 14, 14, 13, 12, 12, 11, 11,  8,
-      16, 15, 16, 14, 14, 12, 15, 12, 16, 14, 14, 13, 13, 11, 12,  8,
-      15, 15, 15, 14, 14, 13, 14, 12, 14, 14, 13, 12, 12, 11, 11,  8,
-      15, 15, 15, 14, 14, 13, 14, 12, 14, 14, 13, 12, 12, 11, 11,  7,
-      16, 15, 16, 14, 15, 12, 15, 11, 15, 14, 14, 12, 13, 11, 12,  7,
-      16, 16, 16, 15, 16, 15, 14, 13, 15, 15, 13, 12, 13, 12, 11,  9,
-      16, 16, 16, 14, 15, 14, 14, 12, 15, 15, 13, 12, 14, 12, 11,  8,
-      16, 16, 16, 14, 16, 14, 14, 11, 15, 15, 14, 12, 14, 12, 11,  7,
-      13, 13, 13, 12, 13, 12, 13, 11, 11, 12, 11, 10, 10, 10, 10,  8,
-      15, 14, 14, 13, 14, 13, 14, 12, 13, 13, 12, 11, 13, 11, 11,  8,
-      16, 15, 16, 14, 16, 14, 16, 13, 15, 14, 14, 12, 14, 12, 13,  9,
-      14, 15, 13, 13, 14, 13, 14, 12, 12, 13, 11, 11, 12, 11, 11,  8,
-      15, 15, 14, 13, 15, 14, 14, 12, 13, 13, 12, 11, 13, 12, 11,  8,
-      16, 16, 16, 13, 16, 15, 16, 13, 15, 14, 14, 12, 14, 13, 13,  9,
-      14, 15, 13, 13, 16, 15, 15, 13, 13, 14, 11, 11, 13, 12, 11,  9,
-      16, 16, 14, 13, 16, 15, 16, 13, 14, 14, 12, 11, 14, 13, 12,  8,
-      16, 16, 15, 12, 16, 15, 15, 12, 15, 14, 13, 11, 14, 13, 12,  8,
-      14, 14, 14, 13, 14, 13, 14, 12, 12, 13, 12, 11, 11, 11, 11,  8,
-      15, 15, 15, 14, 14, 13, 15, 12, 14, 13, 13, 12, 12, 11, 11,  8,
-      16, 16, 16, 15, 15, 14, 16, 13, 15, 14, 14, 12, 14, 12, 12,  9,
-      15, 15, 14, 14, 14, 14, 14, 13, 13, 14, 12, 11, 12, 11, 11,  8,
-      15, 15, 15, 13, 15, 14, 14, 12, 13, 13, 12, 11, 12, 11, 11,  7,
-      16, 15, 16, 14, 16, 14, 15, 12, 15, 14, 14, 12, 13, 12, 12,  8,
-      16, 16, 15, 14, 16, 15, 15, 13, 14, 14, 12, 11, 13, 12, 11,  8,
-      16, 16, 15, 13, 16, 14, 14, 12, 14, 15, 12, 11, 13, 12, 11,  7,
-      16, 16, 16, 13, 16, 15, 15, 12, 15, 14, 13, 11, 14, 12, 11,  7,
-      15, 15, 15, 14, 13, 13, 14, 13, 13, 14, 13, 12, 11, 11, 11,  8,
-      16, 16, 16, 14, 15, 13, 15, 12, 14, 14, 14, 13, 12, 11, 12,  8,
-      16, 16, 16, 14, 15, 13, 15, 12, 15, 14, 14, 12, 13, 11, 12,  8,
-      15, 16, 16, 14, 15, 14, 15, 13, 14, 14, 12, 12, 11, 11, 11,  8,
-      16, 15, 15, 14, 15, 14, 14, 12, 14, 14, 13, 12, 12, 11, 11,  7,
-      16, 16, 16, 13, 15, 13, 15, 12, 15, 14, 14, 12, 13, 11, 11,  7,
-      16, 16, 16, 15, 15, 16, 15, 13, 14, 14, 12, 12, 12, 12, 11,  8,
-      16, 16, 16, 14, 16, 14, 14, 12, 15, 15, 13, 11, 12, 11, 10,  7,
-      16, 16, 15, 13, 16, 14, 14, 11, 15, 14, 13, 10, 13, 11, 10,  5,
-    },
-    {
-       1,  6,  6,  7,  6,  7,  9,  7,  6,  9,  7,  8,  7,  8,  8,  5,
-       5,  8, 10, 10, 10, 10, 12, 11, 11, 12, 11, 11, 11, 12, 12,  9,
-       9, 10, 12, 11, 13, 12, 15, 13, 14, 15, 15, 14, 14, 15, 15, 12,
-       6, 10,  9, 10, 10, 11, 13, 12, 11, 13, 11, 12, 12, 12, 12, 10,
-       6, 10, 10, 10, 11, 11, 13, 11, 11, 13, 12, 12, 11, 12, 12, 10,
-       9, 12, 13, 12, 13, 13, 16, 13, 14, 16, 15, 14, 14, 15, 16, 12,
-       9, 13, 11, 13, 14, 14, 16, 15, 14, 16, 13, 15, 15, 15, 15, 12,
-       9, 13, 12, 13, 14, 15, 16, 15, 14, 16, 15, 15, 15, 15, 16, 12,
-       8, 12, 12, 11, 13, 14, 15, 13, 13, 15, 14, 14, 14, 14, 14, 12,
-       6, 10, 10, 11,  9, 10, 13, 11, 11, 13, 12, 12, 10, 12, 12,  9,
-       6, 10, 11, 11, 11, 10, 13, 12, 11, 13, 12, 12, 12, 12, 13, 10,
-       9, 12, 13, 13, 13, 12, 16, 13, 14, 16, 14, 15, 16, 14, 15, 12,
-       8, 12, 13, 13, 13, 13, 16, 14, 13, 16, 13, 14, 14, 14, 14, 12,
-       7, 11, 11, 12, 11, 12, 14, 13, 12, 14, 13, 13, 12, 13, 13, 11,
-       9, 12, 13, 13, 13, 13, 15, 14, 14, 16, 16, 15, 15, 15, 16, 12,
-      11, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      10, 14, 14, 15, 15, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 13,
-       9, 13, 13, 13, 14, 14, 16, 14, 14, 16, 15, 14, 14, 16, 16, 13,
-       9, 13, 14, 14, 11, 13, 16, 14, 13, 16, 15, 16, 13, 14, 15, 12,
-      10, 13, 14, 15, 13, 12, 16, 14, 14, 16, 15, 15, 14, 14, 16, 13,
-       9, 12, 13, 14, 12, 11, 15, 13, 13, 15, 13, 14, 15, 14, 16, 12,
-      11, 15, 16, 16, 14, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 13,
-      11, 14, 14, 15, 13, 14, 16, 15, 15, 16, 16, 16, 16, 16, 16, 13,
-      10, 12, 13, 14, 13, 13, 16, 14, 14, 14, 14, 16, 15, 14, 16, 13,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-       9, 12, 13, 14, 13, 13, 16, 13, 13, 15, 15, 16, 15, 15, 16, 12,
-       6, 11, 11, 12, 10, 12, 13, 12, 11, 13, 11, 12, 11, 12, 13, 10,
-       9, 12, 13, 13, 13, 13, 16, 14, 14, 15, 14, 14, 14, 14, 14, 12,
-      12, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-       7, 11, 11, 12, 12, 12, 14, 13, 12, 14, 11, 13, 13, 13, 13, 11,
-       8, 12, 12, 13, 12, 13, 14, 13, 13, 14, 13, 13, 13, 14, 14, 11,
-      11, 14, 14, 15, 16, 15, 16, 16, 15, 16, 16, 16, 16, 16, 16, 13,
-      10, 14, 12, 14, 15, 15, 16, 16, 14, 16, 12, 15, 16, 16, 16, 13,
-      11, 14, 13, 15, 15, 15, 16, 16, 14, 16, 14, 14, 16, 16, 16, 13,
-      11, 14, 14, 14, 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 13,
-       7, 11, 12, 11, 10, 12, 14, 13, 12, 14, 13, 13, 10, 12, 13, 10,
-       8, 12, 12, 13, 12, 12, 15, 13, 13, 14, 13, 13, 13, 13, 14, 11,
-      11, 13, 15, 16, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
-       9, 12, 13, 13, 13, 13, 15, 14, 13, 15, 13, 14, 13, 14, 14, 12,
-       7, 11, 11, 11, 11, 11, 13, 12, 11, 13, 11, 12, 11, 12, 12, 10,
-       9, 12, 13, 13, 13, 13, 16, 13, 14, 16, 15, 14, 14, 14, 16, 12,
-      12, 14, 14, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 14,
-      10, 13, 13, 14, 14, 14, 16, 15, 14, 16, 14, 14, 16, 15, 15, 12,
-       9, 12, 13, 13, 13, 15, 16, 14, 13, 16, 14, 13, 13, 14, 14, 11,
-      10, 14, 15, 14, 12, 14, 16, 15, 13, 16, 16, 16, 12, 14, 16, 12,
-      11, 14, 14, 14, 14, 14, 16, 15, 15, 16, 16, 16, 14, 15, 16, 13,
-      11, 14, 14, 16, 14, 13, 16, 15, 14, 16, 15, 16, 15, 15, 16, 13,
-      12, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 14,
-      10, 13, 14, 14, 13, 14, 16, 14, 13, 16, 15, 15, 13, 14, 14, 12,
-       9, 12, 13, 14, 13, 12, 16, 14, 13, 16, 14, 14, 14, 14, 15, 12,
-      14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
-       9, 12, 13, 13, 13, 13, 14, 13, 12, 15, 14, 14, 14, 14, 14, 11,
-      11, 14, 14, 16, 14, 16, 16, 16, 13, 16, 14, 16, 14, 16, 16, 13,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 14, 14, 16, 16, 15, 16, 16, 15, 16, 14, 16, 16, 16, 16, 14,
-      12, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      10, 14, 12, 15, 15, 15, 16, 16, 14, 16, 12, 14, 16, 16, 15, 14,
-      12, 15, 14, 16, 16, 16, 16, 16, 15, 16, 14, 16, 16, 16, 16, 14,
-      12, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14,
-      11, 15, 15, 16, 14, 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 13,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      11, 15, 14, 16, 14, 14, 16, 15, 14, 16, 15, 16, 15, 16, 16, 12,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
-      12, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 14,
-      10, 14, 13, 14, 15, 14, 16, 15, 14, 16, 13, 16, 16, 16, 15, 13,
-      10, 14, 14, 14, 13, 14, 16, 15, 15, 16, 14, 14, 14, 16, 16, 12,
-      10, 14, 15, 14, 13, 16, 16, 15, 13, 16, 16, 16, 12, 14, 16, 12,
-      11, 16, 16, 16, 14, 15, 16, 16, 16, 16, 16, 16, 14, 16, 16, 13,
-      12, 15, 14, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 14,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 14,
-      11, 14, 14, 14, 14, 15, 16, 14, 14, 16, 16, 16, 13, 15, 15, 12,
-      10, 14, 13, 14, 14, 14, 16, 15, 14, 16, 15, 15, 14, 14, 16, 12,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      12, 14, 14, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 13,
-       8, 11, 11, 12, 12, 12, 13, 12, 11, 13, 12, 12, 12, 13, 12, 10,
-    },
-  },
-  {
-    {
-       5,  6,  6,  6,  6,  6,  7,  6,  6,  7,  6,  6,  6,  6,  6,  4,
-       9,  9,  9,  8,  9,  8, 10,  8, 10, 10,  9,  9,  9,  8,  9,  6,
-      11, 10, 12, 10, 11, 10, 12,  9, 12, 11, 11, 10, 11, 10, 11,  8,
-       9, 10,  9,  8, 10, 10, 10,  9,  9, 10,  8,  8,  9,  9,  8,  7,
-      10, 11, 10,  9, 11, 11, 11,  9, 11, 11, 10,  9, 10, 10, 10,  7,
-      13, 12, 12, 10, 13, 12, 13, 10, 13, 12, 12, 11, 13, 12, 11,  9,
-      11, 12, 10, 10, 12, 12, 11, 10, 11, 12, 10, 10, 11, 11, 10,  8,
-      12, 12, 11, 10, 13, 13, 13, 10, 13, 13, 12, 11, 13, 12, 11,  9,
-      12, 12, 12, 10, 13, 13, 13, 10, 13, 13, 12, 10, 13, 12, 12,  9,
-       9,  9, 10, 10,  9,  8, 10,  9,  9, 10,  9,  9,  8,  8,  9,  6,
-      10, 11, 11, 11, 10,  9, 11,  9, 11, 11, 11, 10, 10,  9, 10,  7,
-      12, 12, 13, 12, 12, 10, 13, 10, 13, 13, 13, 12, 12, 11, 11,  9,
-      11, 12, 11, 11, 11, 11, 11, 10, 11, 12, 10, 10, 10, 10, 10,  8,
-      12, 12, 12, 11, 12, 11, 11, 10, 12, 12, 11, 11, 11, 11, 10,  8,
-      14, 13, 13, 12, 13, 12, 13, 10, 14, 14, 13, 12, 13, 12, 12,  9,
-      13, 14, 13, 12, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 11,  9,
-      14, 14, 13, 12, 13, 13, 13, 11, 14, 14, 13, 12, 13, 12, 12,  9,
-      14, 15, 14, 12, 15, 13, 13, 11, 15, 14, 14, 12, 14, 13, 12,  9,
-      11, 11, 12, 12, 10, 10, 12, 11, 11, 12, 11, 11, 10, 10, 10,  8,
-      12, 12, 14, 13, 11, 10, 12, 11, 13, 13, 13, 12, 12, 10, 11,  9,
-      13, 13, 14, 14, 12, 10, 13, 11, 14, 14, 14, 13, 12, 11, 12,  9,
-      13, 13, 13, 13, 12, 13, 13, 12, 13, 14, 12, 12, 12, 12, 11,  9,
-      13, 14, 14, 13, 13, 12, 13, 11, 14, 14, 13, 12, 13, 12, 12,  9,
-      14, 14, 14, 14, 14, 12, 13, 11, 15, 15, 15, 13, 14, 12, 12,  9,
-      14, 15, 15, 13, 14, 14, 13, 12, 13, 14, 13, 13, 12, 12, 11, 10,
-      16, 16, 15, 14, 15, 14, 13, 11, 15, 15, 14, 13, 13, 13, 12,  9,
-      15, 15, 15, 13, 14, 13, 13, 11, 15, 15, 15, 13, 14, 13, 12,  9,
-       8,  9,  9,  9,  9,  9, 10,  9,  8, 10,  9,  9,  8,  8,  9,  7,
-      11, 11, 11, 11, 11, 11, 12, 10, 11, 11, 11, 10, 10, 10, 10,  8,
-      13, 13, 14, 12, 13, 12, 14, 11, 13, 13, 13, 12, 13, 11, 12,  9,
-      10, 11, 10, 11, 11, 11, 12, 10, 10, 11, 10, 10, 10, 10, 10,  8,
-      12, 12, 12, 11, 12, 12, 12, 11, 11, 12, 11, 10, 11, 11, 10,  8,
-      14, 13, 14, 12, 14, 13, 14, 12, 14, 13, 13, 11, 13, 12, 12,  9,
-      12, 13, 12, 12, 13, 13, 13, 12, 12, 13, 11, 11, 12, 12, 11,  9,
-      13, 14, 13, 12, 14, 14, 14, 12, 14, 13, 12, 11, 13, 12, 12,  9,
-      14, 14, 13, 12, 15, 14, 15, 12, 14, 14, 13, 11, 13, 13, 12,  9,
-      10, 11, 11, 11, 10, 10, 12, 10, 10, 11, 10, 10,  9,  9, 10,  7,
-      12, 12, 13, 12, 12, 11, 12, 11, 12, 12, 12, 11, 11, 10, 10,  8,
-      14, 13, 14, 13, 14, 12, 13, 12, 14, 13, 14, 12, 13, 11, 12,  9,
-      12, 13, 12, 12, 12, 12, 12, 11, 11, 12, 11, 10, 10, 10, 10,  8,
-      12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 10, 11, 10, 10,  7,
-      14, 14, 14, 12, 14, 12, 14, 11, 14, 13, 13, 11, 13, 11, 11,  8,
-      13, 15, 13, 13, 14, 14, 14, 12, 13, 14, 12, 12, 12, 12, 11,  9,
-      14, 15, 13, 12, 14, 13, 13, 11, 13, 13, 12, 11, 13, 12, 11,  8,
-      15, 15, 15, 12, 15, 14, 14, 11, 14, 14, 13, 11, 13, 12, 12,  8,
-      12, 13, 13, 13, 12, 12, 13, 12, 12, 13, 12, 12, 11, 11, 11,  9,
-      13, 14, 15, 14, 13, 12, 14, 12, 13, 13, 14, 12, 12, 11, 12,  9,
-      14, 14, 15, 14, 14, 12, 14, 12, 14, 14, 14, 13, 13, 11, 12,  9,
-      13, 14, 14, 14, 13, 13, 14, 13, 13, 13, 12, 12, 12, 12, 11,  9,
-      14, 14, 14, 13, 13, 13, 13, 12, 13, 14, 13, 12, 12, 11, 11,  8,
-      15, 14, 15, 14, 14, 13, 14, 11, 15, 14, 14, 12, 13, 11, 12,  8,
-      14, 15, 14, 14, 15, 14, 14, 13, 14, 15, 13, 13, 12, 12, 11, 10,
-      16, 15, 14, 14, 14, 14, 13, 12, 14, 14, 13, 12, 13, 12, 11,  9,
-      15, 15, 15, 14, 16, 14, 14, 11, 15, 15, 14, 12, 13, 12, 11,  8,
-      11, 12, 11, 12, 12, 12, 12, 11, 10, 11, 10, 10, 10, 10, 10,  8,
-      13, 13, 13, 13, 13, 13, 14, 12, 12, 12, 12, 12, 12, 11, 12,  9,
-      14, 14, 14, 13, 15, 13, 15, 13, 14, 14, 14, 12, 14, 12, 13, 10,
-      12, 13, 12, 13, 13, 13, 13, 12, 11, 12, 11, 11, 12, 11, 11,  9,
-      14, 14, 13, 13, 14, 14, 14, 12, 12, 13, 12, 11, 13, 12, 12,  9,
-      14, 14, 15, 13, 15, 15, 15, 13, 15, 13, 13, 12, 14, 12, 13, 10,
-      13, 15, 12, 13, 14, 14, 14, 13, 12, 13, 11, 11, 13, 12, 11, 10,
-      14, 15, 14, 13, 15, 14, 15, 13, 14, 14, 12, 11, 13, 13, 12,  9,
-      14, 15, 14, 13, 15, 14, 15, 13, 14, 14, 13, 11, 14, 13, 12,  9,
-      12, 13, 13, 13, 12, 13, 13, 12, 11, 12, 12, 11, 11, 11, 11,  9,
-      13, 14, 14, 13, 14, 13, 14, 12, 13, 13, 13, 12, 12, 11, 11,  9,
-      15, 15, 16, 14, 15, 14, 14, 13, 15, 14, 14, 13, 13, 12, 13, 10,
-      13, 14, 14, 13, 13, 14, 14, 13, 12, 13, 12, 12, 11, 11, 11,  9,
-      14, 14, 14, 13, 14, 13, 14, 12, 13, 13, 12, 11, 12, 11, 11,  8,
-      15, 15, 15, 13, 15, 14, 14, 12, 14, 13, 13, 12, 13, 12, 12,  9,
-      14, 15, 14, 14, 15, 15, 14, 13, 13, 14, 12, 12, 13, 12, 12,  9,
-      15, 15, 14, 13, 15, 14, 14, 13, 14, 14, 12, 11, 13, 12, 11,  8,
-      15, 16, 14, 13, 15, 15, 15, 12, 14, 14, 13, 11, 14, 12, 12,  8,
-      12, 14, 13, 13, 13, 13, 14, 12, 12, 13, 12, 12, 10, 11, 11,  9,
-      14, 15, 15, 14, 13, 13, 15, 13, 13, 14, 14, 12, 12, 11, 12,  9,
-      15, 15, 16, 14, 14, 13, 15, 13, 14, 14, 14, 13, 13, 11, 12,  9,
-      14, 15, 14, 14, 14, 14, 14, 13, 13, 14, 13, 12, 12, 12, 11,  9,
-      14, 15, 15, 14, 14, 14, 14, 12, 13, 14, 13, 12, 12, 11, 11,  8,
-      15, 15, 15, 14, 14, 13, 15, 12, 15, 14, 14, 12, 13, 11, 11,  8,
-      14, 16, 14, 14, 14, 15, 14, 13, 13, 14, 12, 12, 12, 12, 11,  9,
-      15, 15, 15, 14, 15, 14, 14, 12, 14, 14, 13, 12, 12, 11, 11,  8,
-      15, 15, 14, 13, 15, 13, 14, 12, 14, 14, 13, 11, 13, 11, 11,  7,
-    },
-    {
-       1,  5,  6,  7,  6,  7,  9,  8,  6,  9,  8,  8,  7,  8,  8,  6,
-       5,  8, 10, 10, 10, 11, 13, 12, 11, 13, 12, 12, 12, 12, 13, 10,
-       8, 10, 13, 12, 13, 13, 16, 14, 14, 16, 16, 14, 16, 16, 16, 12,
-       5, 10,  9, 11, 11, 12, 13, 12, 11, 13, 11, 12, 12, 12, 13, 10,
-       6, 10, 11, 11, 11, 12, 14, 12, 11, 13, 13, 13, 12, 13, 13, 11,
-       8, 12, 13, 12, 14, 14, 16, 14, 14, 16, 16, 16, 16, 16, 16, 13,
-       9, 13, 11, 14, 14, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 13,
-       9, 13, 13, 13, 14, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 14,
-       8, 12, 13, 12, 13, 14, 16, 14, 14, 16, 16, 16, 14, 16, 16, 13,
-       5, 10, 11, 12,  9, 11, 13, 12, 11, 13, 13, 13, 11, 12, 13, 10,
-       6, 10, 11, 12, 11, 11, 14, 13, 12, 14, 12, 13, 13, 13, 13, 11,
-       9, 12, 14, 15, 13, 13, 16, 16, 14, 16, 16, 16, 16, 16, 16, 13,
-       8, 13, 13, 14, 13, 14, 16, 16, 14, 16, 14, 16, 14, 16, 14, 13,
-       7, 11, 12, 13, 12, 12, 14, 13, 12, 14, 13, 14, 13, 14, 14, 12,
-       9, 13, 14, 14, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
-      11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 15, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-       9, 13, 14, 14, 14, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14,
-       9, 13, 14, 15, 11, 13, 16, 14, 14, 16, 16, 16, 13, 14, 16, 13,
-       9, 13, 14, 16, 13, 13, 16, 16, 14, 16, 16, 16, 16, 15, 16, 14,
-       8, 12, 13, 16, 13, 12, 16, 14, 13, 16, 14, 16, 16, 16, 16, 13,
-      11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 14, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-       9, 13, 16, 16, 14, 14, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 13, 14, 15, 14, 14, 16, 14, 13, 16, 16, 16, 14, 16, 16, 14,
-       6, 11, 11, 12, 11, 12, 14, 13, 11, 14, 12, 13, 12, 13, 13, 11,
-       9, 13, 13, 14, 13, 14, 16, 16, 14, 16, 16, 16, 15, 16, 16, 13,
-      11, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       7, 11, 11, 13, 12, 13, 16, 14, 12, 16, 12, 14, 14, 14, 14, 12,
-       8, 12, 12, 13, 12, 14, 16, 14, 13, 16, 14, 14, 14, 14, 14, 12,
-      11, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      10, 14, 13, 16, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 16,
-      10, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      10, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-       7, 11, 12, 12, 11, 13, 16, 14, 12, 15, 14, 14, 11, 13, 13, 12,
-       8, 12, 12, 13, 13, 13, 16, 14, 13, 16, 13, 15, 13, 14, 14, 12,
-      11, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-       8, 12, 13, 14, 13, 14, 16, 16, 14, 16, 14, 16, 14, 16, 15, 13,
-       6, 11, 11, 12, 11, 12, 13, 13, 11, 13, 12, 13, 12, 13, 13, 11,
-       9, 13, 14, 14, 14, 14, 16, 14, 14, 16, 16, 16, 16, 16, 14, 13,
-      11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 14, 13, 14, 14, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 13,
-       9, 13, 14, 13, 13, 16, 16, 14, 13, 16, 16, 16, 13, 16, 14, 13,
-      10, 14, 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 13, 14, 16, 14,
-      11, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      10, 14, 16, 16, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 14, 14, 14, 14, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 13,
-       9, 13, 13, 16, 14, 14, 16, 16, 14, 16, 14, 16, 16, 16, 16, 13,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 13, 14, 14, 13, 16, 16, 14, 13, 16, 14, 16, 14, 14, 16, 12,
-      10, 14, 14, 16, 16, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 14,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 14, 13, 16, 16, 16, 16, 16, 14, 16, 12, 16, 16, 16, 16, 14,
-      11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16,
-      11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 14,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15,
-      11, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 13,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 15, 14, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 14,
-      10, 14, 14, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
-      10, 14, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16, 12, 16, 16, 14,
-      11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16,
-      11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 15, 14, 16, 14, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 13,
-      10, 15, 14, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-       8, 12, 12, 13, 12, 14, 14, 14, 12, 16, 13, 14, 12, 14, 14, 11,
-    },
-  },
-};
-
-
-static const uint8_t rv34_table_intra_cbp[NUM_INTRA_TABLES][8][CBP_VLC_SIZE] = {
-  {
-    { 0,  3,  3,  4,  3,  5,  5,  5,  2,  5,  4,  6,  4,  6,  6,  6, },
-    { 0,  2,  3,  4,  2,  5,  6,  7,  3,  6,  5,  7,  4,  7,  8,  8, },
-    { 0,  3,  4,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  3, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  6,  3,  5,  6,  5, },
-    { 0,  4,  4,  4,  4,  5,  5,  4,  4,  5,  4,  5,  4,  4,  4,  2, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4, },
-    { 0,  6,  6,  5,  6,  5,  6,  4,  6,  6,  5,  4,  4,  4,  4,  1, },
-    { 0,  4,  4,  4,  4,  5,  5,  4,  4,  5,  5,  4,  4,  4,  4,  2, },
-  },
-  {
-    { 0,  4,  3,  4,  3,  4,  5,  4,  3,  5,  4,  5,  3,  5,  5,  5, },
-    { 0,  2,  3,  4,  2,  5,  6,  7,  3,  6,  5,  7,  4,  7,  8,  8, },
-    { 0,  4,  4,  4,  4,  4,  5,  4,  4,  5,  4,  4,  3,  4,  4,  3, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  6,  3,  5,  6,  5, },
-    { 0,  4,  4,  4,  4,  4,  5,  4,  4,  5,  5,  5,  4,  4,  4,  2, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4, },
-    { 0,  5,  6,  5,  5,  5,  6,  4,  6,  6,  5,  4,  5,  4,  4,  1, },
-    { 0,  4,  4,  4,  4,  4,  5,  4,  4,  5,  5,  4,  4,  4,  5,  2, },
-  },
-  {
-    { 0,  3,  3,  4,  3,  4,  4,  5,  3,  5,  4,  5,  4,  5,  5,  5, },
-    { 0,  2,  3,  4,  2,  4,  6,  7,  3,  6,  5,  7,  5,  7,  8,  8, },
-    { 0,  4,  4,  4,  4,  4,  5,  4,  3,  5,  4,  4,  4,  4,  4,  3, },
-    { 0,  3,  3,  4,  3,  3,  6,  6,  3,  6,  4,  6,  3,  6,  6,  5, },
-    { 0,  4,  4,  4,  3,  4,  5,  4,  4,  5,  4,  4,  4,  4,  4,  3, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4, },
-    { 0,  5,  5,  5,  5,  5,  6,  4,  5,  6,  5,  5,  5,  4,  4,  1, },
-    { 0,  4,  4,  4,  4,  4,  6,  4,  4,  6,  5,  4,  4,  4,  4,  2, },
-  },
-  {
-    { 0,  3,  3,  4,  3,  4,  4,  5,  3,  5,  4,  5,  4,  5,  5,  5, },
-    { 0,  2,  3,  4,  2,  4,  7,  6,  3,  7,  5,  7,  5,  7,  7,  7, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4, },
-    { 0,  3,  3,  3,  3,  4,  6,  6,  3,  6,  4,  6,  3,  6,  6,  5, },
-    { 0,  3,  4,  4,  3,  4,  5,  4,  4,  5,  4,  5,  4,  5,  4,  3, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4, },
-    { 0,  4,  5,  4,  4,  4,  5,  4,  4,  5,  5,  4,  4,  4,  4,  2, },
-    { 0,  4,  4,  4,  4,  5,  5,  4,  4,  5,  5,  4,  4,  4,  4,  2, },
-  },
-  {
-    { 0,  3,  3,  4,  3,  4,  5,  6,  2,  5,  4,  7,  4,  6,  6,  7, },
-    { 0,  2,  3,  4,  2,  4,  6,  7,  3,  7,  5,  7,  5,  7,  7,  7, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4, },
-    { 0,  2,  3,  4,  3,  4,  6,  5,  3,  6,  4,  6,  4,  6,  6,  6, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4, },
-    { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4, },
-    { 0,  4,  4,  4,  4,  5,  5,  4,  4,  5,  5,  4,  4,  4,  4,  2, },
-    { 0,  3,  4,  4,  4,  4,  5,  4,  4,  5,  4,  4,  4,  4,  4,  3, },
-  },
-};
-
-
-static const uint8_t rv34_table_intra_firstpat[NUM_INTRA_TABLES][4][FIRSTBLK_VLC_SIZE] = {
-  {
-    {
-       0, 10,  5, 10,  7, 12,  9, 11,  8, 13,  9, 12, 10, 13, 11, 12,
-      16, 16, 14, 15, 15, 16, 13, 14,  5, 12,  6, 11,  9, 13, 10, 11,
-       9, 14,  9, 12, 11, 14, 11, 12, 16, 16, 14, 15, 15, 16, 13, 13,
-      10, 15,  9, 12, 12, 16, 11, 12, 12, 16, 10, 13, 13, 16, 11, 12,
-      16, 16, 13, 14, 15, 16, 13, 12,  6, 12,  8, 11,  8, 12, 10, 11,
-       9, 14, 10, 12, 10, 13, 11, 12, 15, 16, 14, 15, 14, 16, 13, 13,
-       8, 13,  9, 12, 10, 13, 10, 12, 10, 14,  9, 12, 11, 14, 10, 12,
-      15, 16, 13, 15, 14, 16, 13, 13, 11, 16, 10, 13, 13, 16, 11, 12,
-      12, 16, 11, 13, 13, 16, 11, 12, 16, 16, 13, 14, 15, 16, 12, 12,
-      10, 16, 12, 14, 10, 14, 11, 12, 12, 16, 13, 14, 11, 14, 12, 12,
-      16, 16, 15, 16, 14, 15, 13, 13, 11, 16, 12, 14, 11, 14, 11, 12,
-      12, 16, 12, 14, 11, 14, 11, 12, 16, 16, 14, 15, 13, 15, 13, 12,
-      14, 16, 13, 14, 13, 16, 12, 12, 14, 16, 13, 14, 13, 16, 12, 12,
-      16, 16, 14, 14, 14, 15, 12, 11,  2, 10,  6, 10,  7, 12,  9, 11,
-       8, 12,  9, 11, 10, 13, 10, 11, 15, 16, 14, 15, 14, 16, 13, 13,
-       5, 12,  6, 11,  9, 13, 10, 11,  9, 13,  9, 11, 10, 13, 10, 11,
-      15, 16, 13, 14, 14, 16, 13, 13,  9, 15,  8, 12, 12, 15, 11, 11,
-      11, 16, 10, 12, 13, 15, 11, 11, 15, 16, 13, 14, 15, 16, 12, 12,
-       6, 12,  8, 11,  8, 12,  9, 11,  9, 14,  9, 12, 10, 13, 10, 11,
-      15, 16, 14, 15, 14, 16, 13, 13,  7, 13,  8, 11,  9, 13, 10, 11,
-       9, 14,  9, 12, 10, 13, 10, 11, 14, 16, 13, 14, 13, 16, 12, 12,
-      11, 16, 10, 12, 12, 15, 11, 11, 11, 16, 10, 12, 12, 15, 11, 11,
-      15, 16, 12, 13, 14, 16, 12, 11,  9, 15, 11, 13,  9, 13, 11, 12,
-      11, 16, 12, 14, 10, 14, 11, 12, 16, 16, 14, 15, 13, 15, 12, 12,
-      11, 16, 11, 14, 10, 14, 11, 12, 11, 16, 12, 13, 11, 14, 11, 11,
-      15, 16, 14, 15, 13, 14, 12, 12, 13, 16, 12, 14, 13, 15, 11, 11,
-      13, 16, 12, 14, 13, 15, 11, 11, 16, 16, 13, 14, 13, 15, 11, 10,
-       5, 12,  7, 11,  8, 13, 10, 11,  9, 13,  9, 12, 10, 14, 11, 12,
-      16, 16, 14, 15, 14, 16, 13, 13,  7, 13,  7, 11,  9, 13, 10, 11,
-       9, 14,  9, 12, 11, 14, 11, 12, 16, 16, 14, 14, 14, 16, 13, 13,
-       9, 15,  8, 12, 12, 15, 11, 12, 11, 16, 10, 12, 13, 16, 11, 12,
-      16, 16, 13, 14, 15, 16, 12, 12,  7, 13,  8, 12,  9, 13, 10, 11,
-      10, 14, 10, 12, 10, 14, 11, 12, 16, 16, 14, 15, 14, 16, 13, 13,
-       8, 14,  9, 12, 10, 13, 10, 11,  9, 14,  9, 12, 10, 14, 10, 11,
-      15, 16, 13, 14, 14, 16, 12, 12, 11, 16, 10, 12, 12, 15, 11, 12,
-      11, 16, 10, 12, 12, 15, 11, 11, 15, 16, 12, 14, 14, 16, 12, 11,
-      10, 16, 11, 13,  9, 14, 11, 12, 12, 16, 12, 14, 11, 14, 11, 12,
-      16, 16, 14, 16, 14, 15, 13, 12, 11, 16, 11, 14, 10, 14, 11, 12,
-      11, 16, 12, 14, 11, 14, 11, 11, 15, 16, 14, 15, 13, 15, 12, 12,
-      13, 16, 12, 14, 13, 15, 11, 11, 13, 16, 12, 14, 12, 14, 11, 11,
-      15, 16, 12, 13, 13, 14, 11, 10,  6, 13,  8, 11,  9, 13, 10, 11,
-      10, 14, 10, 12, 10, 13, 10, 11, 15, 16, 13, 13, 13, 14, 12, 11,
-       7, 13,  8, 11,  9, 13,  9, 11, 10, 14,  9, 11, 10, 13, 10, 11,
-      15, 16, 13, 13, 13, 14, 11, 11,  9, 14,  8, 11, 10, 13,  9, 10,
-      11, 15,  9, 11, 11, 13,  9, 10, 15, 16, 12, 13, 13, 14, 10,  9,
-       7, 13,  8, 11,  9, 13,  9, 11, 10, 14, 10, 12, 10, 13, 10, 11,
-      15, 16, 13, 13, 13, 14, 11, 11,  8, 13,  8, 11,  9, 13,  9, 10,
-       9, 14,  9, 11, 10, 13,  9, 10, 14, 16, 12, 13, 13, 14, 11, 10,
-       9, 14,  8, 11, 10, 13,  9,  9, 10, 14,  8, 11, 10, 13,  9,  9,
-      14, 16, 11, 12, 12, 14, 10,  9,  9, 14,  9, 12,  8, 12,  9, 10,
-      11, 15, 10, 12, 10, 13,  9, 10, 15, 16, 13, 13, 12, 13, 11, 10,
-       9, 14,  9, 12,  9, 12,  9, 10, 10, 14, 10, 12,  9, 12,  9,  9,
-      14, 16, 12, 13, 11, 13, 10,  9, 10, 14,  9, 11, 10, 12,  8,  8,
-      10, 14,  9, 11, 10, 12,  8,  8, 12, 14,  9, 10, 10, 11,  8,  7,
-    },
-    {
-       0,  9,  6,  9,  6, 10,  8,  9,  7, 11,  8, 11,  9, 11,  9, 10,
-      14, 16, 13, 14, 13, 14, 12, 11,  5, 11,  7, 10,  8, 10,  8,  9,
-       8, 12,  8, 11,  9, 12,  9, 10, 14, 16, 12, 13, 13, 14, 11, 11,
-      10, 14,  9, 11, 11, 13, 10, 10, 11, 15,  9, 11, 12, 13, 10, 10,
-      15, 16, 12, 12, 13, 14, 11,  9,  6, 11,  7, 10,  7, 10,  8,  9,
-       8, 12,  9, 11,  9, 11,  9, 10, 14, 16, 13, 13, 13, 14, 11, 11,
-       7, 12,  8, 11,  8, 11,  9,  9,  9, 13,  9, 11,  9, 12,  9, 10,
-      14, 16, 12, 13, 12, 14, 11, 10, 11, 14, 10, 12, 11, 13, 10, 10,
-      12, 15, 10, 12, 12, 13, 10, 10, 15, 16, 12, 12, 13, 14, 10,  9,
-      10, 14, 11, 13,  9, 12, 10, 10, 11, 15, 12, 13, 10, 12, 10, 10,
-      14, 16, 13, 14, 12, 13, 11, 10, 11, 14, 11, 13, 10, 12, 10, 10,
-      12, 15, 11, 13, 10, 12, 10, 10, 15, 16, 13, 13, 12, 13, 11,  9,
-      13, 16, 12, 13, 12, 13, 10,  9, 14, 16, 12, 13, 12, 13, 10,  9,
-      16, 16, 12, 12, 13, 13, 10,  7,  4, 10,  6,  9,  7, 10,  8,  9,
-       8, 12,  9, 11,  9, 11,  9,  9, 14, 16, 13, 13, 13, 14, 11, 11,
-       6, 11,  7, 10,  8, 11,  8,  9,  9, 12,  9, 11,  9, 12,  9,  9,
-      14, 16, 12, 13, 13, 14, 11, 10, 10, 14,  9, 11, 11, 13,  9,  9,
-      11, 14,  9, 11, 11, 13, 10,  9, 14, 16, 11, 12, 13, 14, 10,  9,
-       6, 11,  8, 10,  7, 10,  8,  9,  9, 12,  9, 11,  9, 11,  9,  9,
-      14, 16, 13, 13, 12, 13, 11, 10,  8, 12,  8, 10,  8, 11,  9,  9,
-       9, 12,  9, 11,  9, 11,  9,  9, 14, 16, 12, 13, 12, 13, 11, 10,
-      11, 14, 10, 11, 11, 13,  9,  9, 11, 14, 10, 11, 11, 13,  9,  9,
-      14, 16, 11, 12, 13, 14, 10,  8, 10, 14, 11, 12,  9, 12, 10, 10,
-      11, 14, 11, 13, 10, 12, 10, 10, 14, 16, 13, 14, 12, 13, 11,  9,
-      11, 14, 11, 12, 10, 12, 10, 10, 11, 14, 11, 12, 10, 12, 10,  9,
-      14, 16, 13, 13, 11, 12, 10,  9, 13, 16, 12, 13, 12, 13, 10,  9,
-      13, 16, 11, 12, 11, 13, 10,  8, 15, 16, 12, 12, 12, 12,  9,  7,
-       8, 12,  8, 11,  9, 12,  9, 10, 10, 14, 10, 12, 11, 13, 10, 10,
-      16, 16, 14, 14, 14, 14, 12, 11,  8, 13,  8, 11,  9, 12, 10, 10,
-      11, 14, 10, 12, 11, 13, 10, 10, 16, 16, 13, 14, 14, 14, 12, 11,
-      11, 14,  9, 12, 11, 13, 10, 10, 12, 15, 10, 12, 12, 14, 10, 10,
-      15, 16, 12, 12, 14, 14, 11,  9,  9, 13,  9, 11,  9, 12, 10, 10,
-      11, 14, 10, 12, 10, 12, 10, 10, 15, 16, 14, 14, 13, 14, 12, 11,
-       9, 13,  9, 11, 10, 12, 10, 10, 10, 14, 10, 12, 10, 12, 10, 10,
-      15, 16, 13, 13, 13, 14, 11, 10, 11, 15, 10, 12, 11, 13, 10, 10,
-      11, 15, 10, 12, 12, 13, 10,  9, 15, 16, 11, 12, 13, 14, 10,  9,
-      11, 15, 11, 13, 10, 12, 10, 10, 12, 16, 12, 13, 11, 13, 10, 10,
-      16, 16, 14, 14, 12, 13, 11,  9, 11, 15, 11, 13, 10, 13, 10, 10,
-      12, 15, 12, 13, 10, 12, 10, 10, 14, 16, 13, 13, 12, 13, 10,  9,
-      13, 16, 12, 13, 12, 13, 10,  9, 13, 16, 11, 12, 11, 13, 10,  9,
-      14, 16, 11, 12, 12, 12,  9,  7, 10, 15, 10, 12, 11, 13, 10, 10,
-      12, 16, 12, 13, 12, 13, 11, 10, 16, 16, 14, 14, 14, 15, 12, 10,
-      10, 14, 10, 12, 10, 13, 10, 10, 12, 15, 11, 12, 11, 13, 10, 10,
-      16, 16, 14, 13, 14, 14, 11,  9, 11, 14, 10, 11, 11, 12,  9,  9,
-      12, 15, 10, 11, 11, 13,  9,  8, 16, 16, 12, 12, 13, 13, 10,  7,
-      10, 15, 10, 12, 10, 13, 10, 10, 12, 15, 11, 12, 11, 13, 10, 10,
-      16, 16, 14, 13, 14, 14, 11,  9, 10, 14, 10, 12, 10, 12, 10, 10,
-      12, 15, 11, 12, 11, 13, 10, 10, 16, 16, 13, 13, 13, 14, 11,  9,
-      11, 14, 10, 11, 10, 12,  9,  8, 11, 14,  9, 11, 11, 12,  9,  8,
-      14, 16, 10, 11, 12, 13,  9,  7, 11, 15, 11, 12, 10, 12, 10,  9,
-      13, 16, 11, 12, 11, 12, 10,  9, 16, 16, 13, 13, 12, 13, 10,  7,
-      11, 15, 10, 12, 10, 12,  9,  8, 12, 15, 11, 12, 10, 12,  9,  8,
-      14, 16, 12, 12, 11, 12,  9,  7, 11, 14, 10, 11, 10, 12,  8,  7,
-      11, 14,  9, 10, 10, 11,  8,  6, 12, 15,  9,  9,  9, 10,  7,  4,
-    },
-    {
-       0,  6,  3,  7,  3,  7,  6,  7,  5,  9,  6,  9,  7,  9,  8,  8,
-      16, 16, 16, 16, 16, 16, 16, 11,  3,  8,  5,  8,  6,  8,  7,  7,
-       7, 11,  7, 10,  8, 10,  8,  9, 16, 16, 16, 16, 16, 16, 14, 10,
-       8, 16,  7, 11, 10, 16,  9,  9, 11, 16,  9, 14, 16, 16, 10,  9,
-      16, 16, 16, 16, 16, 16, 16, 10,  3,  8,  5,  8,  5,  8,  7,  7,
-       7, 11,  8, 10,  8, 10,  8,  9, 16, 16, 16, 16, 16, 16, 16, 11,
-       6, 10,  7,  9,  7, 10,  8,  8,  8, 11,  8, 10,  8, 11,  8,  8,
-      16, 16, 16, 16, 16, 16, 11, 10, 10, 16,  9, 13, 11, 16, 10,  9,
-      11, 16,  9, 11, 16, 16, 10,  9, 16, 16, 11, 16, 16, 16, 11,  9,
-       9, 16, 10, 11,  8, 11,  9,  9, 11, 16, 12, 16, 10, 16, 10, 10,
-      16, 16, 16, 16, 16, 16, 16, 10, 10, 16, 11, 16, 10, 16, 10, 10,
-      11, 16, 11, 16, 10, 16, 10,  9, 16, 16, 16, 16, 16, 16, 11,  9,
-      16, 16, 16, 16, 16, 16, 11,  9, 16, 16, 16, 16, 16, 16, 11,  9,
-      16, 16, 11, 16, 16, 16,  9,  7, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       2,  8,  5,  9,  6,  9,  8,  8,  8, 12,  9, 11,  9, 11, 10, 10,
-      16, 16, 14, 16, 14, 16, 14, 12,  5, 10,  6,  9,  8, 10,  8,  9,
-       9, 12,  9, 11, 10, 12, 10, 10, 16, 16, 14, 15, 15, 16, 13, 12,
-      10, 13,  9, 12, 11, 12, 10, 10, 12, 15, 11, 12, 12, 13, 11, 10,
-      16, 16, 15, 14, 15, 16, 13, 12,  6, 10,  8, 10,  7, 10,  8,  9,
-       9, 13, 10, 11, 10, 12, 10, 10, 16, 16, 14, 16, 14, 16, 13, 12,
-       7, 11,  8, 11,  9, 11,  9,  9, 10, 13, 10, 11, 10, 12, 10,  9,
-      16, 16, 14, 14, 14, 15, 12, 11, 11, 14, 11, 12, 11, 13, 10, 10,
-      12, 15, 11, 13, 12, 13, 11, 10, 16, 16, 14, 16, 15, 15, 13, 11,
-      10, 13, 11, 12, 10, 12, 10, 10, 12, 15, 12, 13, 11, 13, 11, 11,
-      16, 16, 15, 16, 14, 15, 13, 11, 11, 14, 11, 13, 11, 12, 11, 10,
-      12, 16, 12, 13, 12, 13, 11, 10, 16, 16, 15, 16, 13, 15, 12, 11,
-      13, 15, 12, 13, 13, 14, 11, 11, 14, 16, 13, 13, 13, 14, 11, 11,
-      16, 16, 15, 14, 15, 15, 12, 10,  3,  8,  6,  9,  7,  9,  8,  8,
-       8, 12,  9, 11,  9, 11,  9,  9, 16, 16, 15, 15, 15, 16, 13, 12,
-       6, 10,  7,  9,  8, 10,  8,  8,  9, 12,  9, 11, 10, 12, 10,  9,
-      16, 16, 14, 14, 14, 15, 13, 11, 10, 13,  9, 11, 11, 12, 10, 10,
-      12, 14, 11, 12, 12, 13, 11, 10, 16, 16, 14, 14, 15, 15, 13, 11,
-       6, 10,  8, 10,  7, 10,  8,  9, 10, 12, 10, 11, 10, 11, 10,  9,
-      16, 16, 14, 15, 14, 15, 13, 11,  8, 11,  8, 10,  9, 11,  9,  9,
-       9, 13,  9, 11, 10, 11,  9,  9, 16, 16, 13, 14, 14, 14, 12, 10,
-      11, 14, 10, 12, 11, 12, 10, 10, 12, 14, 11, 12, 12, 13, 10, 10,
-      16, 16, 13, 14, 15, 15, 12, 10, 10, 13, 11, 12, 10, 12, 10, 10,
-      12, 14, 12, 13, 11, 13, 11, 10, 16, 16, 15, 14, 14, 14, 12, 11,
-      11, 14, 11, 12, 10, 12, 10, 10, 12, 15, 12, 12, 11, 13, 10, 10,
-      16, 16, 14, 15, 13, 14, 12, 10, 13, 15, 12, 13, 12, 13, 11, 10,
-      13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 13, 14, 13, 15, 11,  9,
-       6, 10,  8, 10,  8, 11,  9, 10, 11, 13, 11, 12, 11, 13, 11, 10,
-      16, 16, 16, 16, 16, 16, 13, 12,  8, 11,  9, 11,  9, 11, 10, 10,
-      11, 14, 11, 12, 11, 12, 11, 10, 16, 16, 15, 15, 16, 16, 13, 12,
-      11, 14, 10, 12, 12, 13, 11, 10, 13, 16, 12, 13, 13, 14, 11, 11,
-      16, 16, 15, 16, 16, 16, 13, 12,  8, 12,  9, 11,  9, 11, 10, 10,
-      11, 14, 11, 12, 11, 12, 11, 10, 16, 16, 16, 16, 16, 16, 13, 12,
-       9, 12, 10, 11, 10, 12, 10, 10, 11, 14, 11, 12, 11, 13, 10, 10,
-      16, 16, 15, 14, 15, 15, 13, 11, 12, 14, 11, 13, 12, 13, 11, 10,
-      12, 15, 11, 12, 13, 13, 11, 10, 16, 16, 14, 15, 16, 15, 13, 11,
-      11, 15, 12, 13, 11, 13, 11, 10, 13, 16, 13, 14, 12, 14, 11, 11,
-      16, 16, 16, 16, 15, 15, 13, 12, 12, 14, 12, 13, 11, 13, 11, 10,
-      13, 15, 12, 13, 11, 13, 11, 10, 16, 16, 15, 15, 13, 15, 13, 11,
-      13, 16, 13, 13, 13, 13, 12, 11, 13, 16, 13, 13, 13, 13, 11, 10,
-      16, 16, 13, 15, 14, 14, 12,  9,  9, 13, 10, 12, 11, 13, 11, 11,
-      13, 16, 13, 14, 13, 14, 12, 11, 16, 16, 16, 16, 16, 16, 14, 12,
-      10, 14, 11, 13, 11, 13, 11, 10, 13, 16, 13, 13, 13, 14, 12, 11,
-      16, 16, 16, 16, 16, 16, 14, 12, 11, 15, 11, 13, 12, 13, 11, 10,
-      14, 16, 12, 13, 13, 14, 12, 10, 16, 16, 15, 16, 16, 16, 13, 11,
-      10, 14, 11, 12, 11, 13, 11, 10, 13, 16, 12, 13, 12, 14, 12, 11,
-      16, 16, 16, 16, 16, 16, 14, 12, 11, 14, 11, 12, 11, 13, 11, 10,
-      13, 15, 12, 13, 12, 13, 11, 10, 16, 16, 15, 15, 16, 16, 13, 11,
-      12, 15, 12, 13, 12, 13, 11, 10, 13, 16, 12, 13, 13, 13, 11, 10,
-      16, 16, 14, 14, 16, 15, 13, 10, 12, 15, 12, 13, 12, 13, 11, 10,
-      14, 16, 13, 14, 13, 14, 12, 11, 16, 16, 16, 16, 15, 16, 13, 11,
-      12, 16, 12, 13, 12, 13, 11, 10, 13, 16, 13, 13, 12, 14, 11, 10,
-      16, 16, 15, 16, 14, 15, 13, 10, 12, 15, 12, 14, 12, 13, 11, 10,
-      13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 13, 14, 13, 14, 11,  8,
-    },
-  },
-  {
-    {
-       0, 11,  5, 11,  7, 13, 10, 12,  7, 13,  9, 13, 10, 14, 12, 13,
-      16, 16, 15, 16, 16, 16, 15, 15,  4, 13,  6, 12, 10, 14, 11, 12,
-       8, 14,  9, 13, 11, 15, 12, 13, 16, 16, 15, 16, 15, 16, 15, 14,
-       9, 16,  9, 13, 13, 16, 12, 13, 12, 16, 10, 14, 14, 16, 13, 13,
-      16, 16, 14, 16, 16, 16, 14, 14,  5, 13,  8, 13,  8, 13, 11, 12,
-       9, 14, 10, 13, 10, 14, 12, 13, 16, 16, 15, 16, 15, 16, 14, 15,
-       7, 14,  9, 13, 10, 14, 11, 13,  9, 15, 10, 13, 11, 14, 12, 13,
-      16, 16, 14, 16, 15, 16, 14, 14, 11, 16, 11, 14, 13, 16, 12, 13,
-      12, 16, 11, 14, 14, 16, 12, 13, 16, 16, 14, 15, 16, 16, 14, 13,
-      10, 16, 12, 15, 10, 15, 12, 14, 12, 16, 13, 16, 11, 15, 13, 14,
-      16, 16, 16, 16, 14, 16, 14, 14, 11, 16, 12, 15, 11, 16, 12, 13,
-      12, 16, 13, 15, 12, 16, 12, 13, 16, 16, 16, 16, 14, 16, 14, 14,
-      14, 16, 13, 15, 14, 16, 13, 13, 14, 16, 14, 15, 14, 16, 13, 13,
-      16, 16, 15, 16, 15, 16, 13, 13,  2, 12,  6, 11,  7, 13, 10, 12,
-       7, 13,  9, 12, 10, 14, 11, 12, 16, 16, 15, 16, 15, 16, 14, 15,
-       5, 13,  6, 12,  9, 13, 10, 12,  8, 14,  9, 13, 11, 14, 11, 13,
-      16, 16, 14, 16, 15, 16, 14, 14,  9, 16,  8, 13, 12, 16, 11, 13,
-      11, 16, 10, 13, 13, 16, 12, 13, 16, 16, 13, 15, 16, 16, 13, 13,
-       5, 13,  8, 12,  7, 13, 10, 12,  8, 14, 10, 13, 10, 14, 11, 13,
-      16, 16, 14, 16, 15, 16, 14, 14,  7, 14,  8, 12,  9, 14, 11, 12,
-       8, 14,  9, 13, 10, 14, 11, 12, 15, 16, 14, 15, 14, 16, 13, 14,
-      11, 16, 10, 13, 13, 16, 12, 13, 11, 16, 10, 13, 13, 16, 12, 13,
-      16, 16, 13, 15, 15, 16, 13, 13,  9, 16, 12, 15,  9, 14, 11, 13,
-      11, 16, 13, 15, 11, 14, 12, 13, 16, 16, 15, 16, 14, 16, 14, 14,
-      11, 16, 12, 14, 11, 15, 12, 13, 11, 16, 12, 14, 11, 15, 12, 13,
-      16, 16, 15, 16, 14, 16, 13, 13, 13, 16, 13, 15, 13, 16, 12, 13,
-      14, 16, 13, 15, 13, 16, 12, 12, 16, 16, 14, 15, 14, 16, 12, 12,
-       4, 13,  7, 12,  8, 14, 11, 12,  9, 14, 10, 13, 11, 14, 12, 13,
-      16, 16, 15, 16, 16, 16, 15, 15,  6, 14,  7, 12, 10, 14, 11, 12,
-       9, 15, 10, 13, 11, 15, 12, 13, 16, 16, 15, 16, 16, 16, 14, 14,
-       9, 16,  8, 13, 12, 16, 11, 13, 12, 16, 10, 14, 13, 16, 12, 13,
-      16, 16, 14, 16, 16, 16, 14, 14,  6, 14,  8, 13,  8, 14, 11, 13,
-       9, 15, 10, 13, 11, 14, 12, 13, 16, 16, 15, 16, 16, 16, 14, 14,
-       7, 15,  9, 13, 10, 14, 11, 13,  9, 15, 10, 13, 11, 14, 11, 13,
-      16, 16, 14, 16, 15, 16, 14, 14, 10, 16, 10, 13, 12, 16, 12, 13,
-      11, 16, 10, 13, 13, 16, 12, 13, 16, 16, 13, 14, 15, 16, 13, 13,
-       9, 16, 12, 14,  9, 14, 11, 13, 12, 16, 12, 15, 11, 15, 12, 13,
-      16, 16, 16, 16, 15, 16, 14, 14, 10, 16, 12, 15, 11, 15, 12, 13,
-      11, 16, 12, 14, 11, 15, 12, 13, 16, 16, 14, 16, 13, 16, 13, 13,
-      13, 16, 13, 15, 13, 16, 12, 13, 13, 16, 12, 14, 13, 16, 12, 12,
-      15, 16, 13, 14, 13, 16, 12, 12,  6, 14,  8, 13,  9, 14, 10, 12,
-      10, 15, 10, 12, 11, 14, 11, 12, 16, 16, 14, 14, 14, 16, 13, 13,
-       7, 15,  8, 13,  9, 14, 10, 12, 10, 15, 10, 13, 11, 14, 11, 12,
-      16, 16, 14, 14, 14, 16, 13, 12,  9, 16,  8, 12, 11, 14, 10, 11,
-      11, 16, 10, 13, 11, 14, 10, 11, 16, 16, 13, 14, 14, 16, 12, 11,
-       7, 14,  9, 13,  9, 14, 10, 12, 10, 16, 10, 13, 11, 14, 11, 12,
-      16, 16, 14, 14, 14, 15, 13, 12,  7, 14,  9, 13,  9, 14, 10, 12,
-       9, 14, 10, 12, 10, 14, 11, 12, 15, 16, 13, 14, 14, 15, 12, 12,
-       9, 15,  9, 12, 11, 14, 10, 11, 10, 15,  9, 12, 11, 14, 10, 11,
-      14, 16, 11, 13, 13, 15, 11, 11,  9, 16, 10, 13,  9, 14, 10, 11,
-      11, 16, 11, 13, 10, 14, 10, 11, 16, 16, 14, 15, 13, 15, 12, 12,
-       9, 16, 10, 13,  9, 13, 10, 11, 10, 15, 10, 13, 10, 13, 10, 11,
-      14, 16, 13, 14, 12, 14, 11, 11, 11, 16, 10, 13, 11, 13,  9, 10,
-      11, 14, 10, 12, 10, 13,  9,  9, 13, 15, 10, 11, 11, 12,  9,  8,
-    },
-    {
-       0, 10,  5, 10,  6, 11,  8, 10,  7, 12,  8, 11,  9, 12,  9, 10,
-      14, 16, 13, 13, 13, 14, 12, 11,  5, 12,  6, 10,  8, 12,  9, 10,
-       8, 13,  8, 11,  9, 12,  9, 10, 14, 16, 12, 13, 13, 14, 11, 11,
-       9, 15,  8, 12, 11, 14, 10, 10, 11, 16,  9, 12, 12, 14, 10, 10,
-      14, 16, 11, 12, 13, 14, 11, 10,  5, 12,  8, 11,  7, 11,  9, 10,
-       8, 13,  9, 11,  9, 12,  9, 10, 14, 16, 12, 13, 13, 14, 11, 11,
-       7, 13,  8, 11,  9, 12,  9, 10,  9, 13,  9, 11,  9, 12,  9, 10,
-      14, 16, 12, 13, 12, 13, 11, 10, 11, 15, 10, 12, 12, 14, 10, 10,
-      12, 16, 10, 12, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 10,  9,
-      10, 15, 11, 13,  9, 13, 10, 10, 11, 15, 12, 13, 10, 12, 10, 10,
-      14, 16, 13, 14, 12, 13, 11, 10, 11, 16, 11, 13, 10, 13, 10, 10,
-      11, 16, 11, 13, 10, 13, 10, 10, 14, 16, 13, 14, 12, 13, 11,  9,
-      13, 16, 12, 13, 12, 14, 11, 10, 14, 16, 12, 13, 12, 14, 10,  9,
-      16, 16, 12, 13, 13, 13, 10,  8,  3, 11,  6, 10,  7, 11,  9, 10,
-       8, 12,  8, 11,  9, 12,  9, 10, 14, 16, 13, 13, 13, 14, 11, 11,
-       5, 12,  6, 10,  8, 12,  9, 10,  8, 13,  8, 11,  9, 12,  9, 10,
-      14, 16, 12, 13, 13, 14, 11, 10,  9, 14,  8, 11, 11, 14, 10, 10,
-      11, 15,  9, 11, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 11,  9,
-       6, 12,  8, 11,  7, 11,  9, 10,  8, 13,  9, 11,  9, 12,  9, 10,
-      14, 16, 12, 13, 13, 13, 11, 10,  7, 13,  8, 11,  8, 12,  9, 10,
-       9, 13,  9, 11,  9, 12,  9,  9, 14, 16, 12, 13, 12, 13, 11, 10,
-      10, 15,  9, 12, 11, 14, 10, 10, 11, 15,  9, 11, 11, 13, 10,  9,
-      14, 16, 11, 12, 13, 14, 10,  9,  9, 15, 11, 13,  9, 12, 10, 10,
-      11, 15, 11, 13,  9, 12, 10, 10, 14, 16, 13, 14, 12, 13, 11, 10,
-      10, 15, 11, 13, 10, 13, 10, 10, 11, 15, 11, 13, 10, 12, 10, 10,
-      14, 16, 12, 13, 11, 12, 10,  9, 13, 16, 12, 13, 12, 14, 10,  9,
-      13, 16, 11, 12, 12, 13, 10,  9, 14, 16, 11, 12, 12, 13,  9,  8,
-       7, 13,  8, 12,  9, 13, 10, 11, 10, 14, 10, 12, 11, 13, 11, 11,
-      16, 16, 13, 14, 14, 14, 12, 11,  8, 14,  8, 12,  9, 13, 10, 10,
-      10, 14, 10, 12, 11, 13, 10, 10, 16, 16, 13, 13, 14, 14, 12, 11,
-      10, 15,  9, 12, 11, 14, 10, 10, 12, 16, 10, 12, 12, 14, 10, 10,
-      16, 16, 12, 13, 14, 15, 11, 10,  8, 14,  9, 12,  9, 13, 10, 11,
-      10, 15, 10, 12, 10, 13, 10, 11, 16, 16, 13, 14, 14, 14, 12, 11,
-       8, 14,  9, 12,  9, 13, 10, 10, 10, 14, 10, 12, 10, 13, 10, 10,
-      15, 16, 13, 13, 13, 14, 11, 10, 10, 15, 10, 12, 12, 14, 10, 10,
-      11, 16,  9, 12, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 10,  9,
-      11, 16, 11, 13, 10, 13, 10, 10, 12, 16, 12, 13, 10, 13, 11, 10,
-      15, 16, 14, 14, 12, 13, 11, 10, 11, 16, 11, 13, 10, 13, 10, 10,
-      11, 16, 12, 13, 10, 12, 10, 10, 14, 16, 13, 14, 11, 13, 11,  9,
-      13, 16, 12, 13, 12, 14, 10, 10, 12, 16, 11, 12, 12, 13, 10,  9,
-      14, 16, 11, 12, 11, 12,  9,  8, 10, 16, 10, 13, 11, 14, 11, 11,
-      12, 16, 11, 13, 12, 14, 11, 11, 16, 16, 14, 13, 14, 14, 12, 10,
-      10, 15, 10, 13, 10, 13, 10, 11, 12, 16, 11, 13, 11, 13, 11, 10,
-      16, 16, 14, 13, 14, 14, 12, 10, 11, 15,  9, 12, 11, 13, 10,  9,
-      12, 16, 10, 12, 12, 13, 10,  9, 16, 16, 12, 12, 13, 14, 10,  8,
-      10, 16, 10, 13, 10, 14, 11, 11, 12, 16, 11, 13, 12, 14, 11, 10,
-      16, 16, 14, 13, 14, 14, 12, 10,  9, 15,  9, 12, 10, 13, 10, 10,
-      11, 16, 10, 12, 11, 13, 10, 10, 16, 16, 13, 13, 13, 14, 11,  9,
-      10, 15,  9, 11, 11, 13,  9,  9, 11, 15,  9, 11, 11, 13,  9,  8,
-      14, 16, 10, 11, 13, 13, 10,  8, 11, 16, 11, 13, 10, 13, 10,  9,
-      13, 16, 11, 13, 11, 13, 10,  9, 16, 16, 13, 13, 13, 13, 10,  8,
-      11, 16, 10, 12, 10, 13, 10,  9, 11, 16, 11, 12, 10, 12,  9,  9,
-      15, 16, 12, 13, 11, 12, 10,  8, 11, 16, 10, 12, 11, 12,  9,  8,
-      11, 15,  9, 11, 10, 12,  9,  7, 13, 15,  9,  9, 10, 10,  7,  5,
-    },
-    {
-       0,  7,  3,  8,  4,  9,  7,  8,  5, 10,  7, 10,  8, 11,  8,  9,
-      16, 16, 16, 16, 16, 16, 11, 10,  2, 10,  4,  9,  7, 10,  7,  8,
-       7, 16,  7, 10,  9, 16,  8,  9, 16, 16, 16, 16, 16, 16, 11, 10,
-       8, 16,  7, 10, 10, 16,  9,  8, 10, 16,  9, 11, 16, 16,  9,  9,
-      16, 16, 16, 16, 16, 16, 11,  9,  3, 10,  6,  9,  6, 11,  8,  8,
-       7, 16,  8, 10,  9, 16,  9,  9, 16, 16, 16, 16, 16, 16, 11, 10,
-       5, 16,  7, 10,  8, 11,  8,  8,  8, 16,  8, 10,  9, 16,  8,  8,
-      16, 16, 11, 16, 16, 16, 10,  9,  9, 16,  9, 11, 11, 16,  9,  9,
-      11, 16,  9, 11, 11, 16,  9,  8, 16, 16, 10, 16, 16, 16, 10,  9,
-       8, 16, 10, 16,  8, 16, 10,  9, 12, 16, 11, 16, 10, 16, 10,  9,
-      16, 16, 16, 16, 16, 16, 12, 10, 10, 16, 11, 16, 10, 16, 10,  9,
-      11, 16, 11, 16, 10, 16, 10,  9, 16, 16, 16, 16, 16, 16, 11,  9,
-      16, 16, 16, 16, 16, 16, 10,  9, 16, 16, 11, 16, 16, 16, 10,  9,
-      16, 16, 10, 11, 11, 16,  9,  7, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       2,  9,  6,  9,  6, 10,  8,  9,  8, 12,  9, 11,  9, 12, 10, 10,
-      16, 16, 14, 14, 15, 15, 13, 12,  5, 11,  7, 10,  8, 11,  9,  9,
-       9, 13,  9, 11, 10, 12, 10, 10, 15, 16, 14, 14, 14, 16, 12, 11,
-      10, 14,  9, 11, 11, 13, 10, 10, 12, 15, 10, 12, 12, 13, 11, 10,
-      16, 16, 14, 15, 14, 15, 12, 11,  5, 11,  8, 10,  7, 11,  9,  9,
-       9, 13,  9, 12,  9, 12, 10, 10, 15, 16, 13, 14, 13, 16, 12, 11,
-       7, 12,  8, 11,  9, 11,  9, 10,  9, 13,  9, 11, 10, 12,  9,  9,
-      16, 16, 13, 14, 13, 14, 11, 11, 10, 14, 10, 12, 11, 13, 10, 10,
-      11, 16, 11, 12, 12, 13, 10, 10, 16, 16, 13, 14, 13, 14, 12, 11,
-      10, 14, 11, 13, 10, 13, 10, 11, 12, 16, 12, 13, 10, 12, 11, 11,
-      16, 16, 14, 15, 13, 14, 12, 11, 11, 15, 11, 13, 11, 13, 10, 10,
-      12, 15, 12, 13, 11, 13, 11, 10, 15, 16, 14, 15, 13, 15, 12, 11,
-      12, 16, 12, 13, 12, 14, 11, 11, 13, 16, 12, 13, 12, 14, 11, 10,
-      16, 16, 13, 14, 13, 14, 11, 10,  3, 10,  6,  9,  7, 10,  8,  9,
-       9, 12,  9, 11, 10, 12,  9, 10, 15, 16, 14, 14, 14, 14, 12, 11,
-       6, 11,  7, 10,  8, 10,  9,  9,  9, 13,  9, 11, 10, 12,  9,  9,
-      15, 16, 13, 14, 14, 15, 12, 11, 10, 14,  9, 11, 11, 12, 10, 10,
-      12, 14, 10, 12, 11, 13, 10, 10, 15, 16, 13, 14, 14, 16, 12, 11,
-       6, 11,  8, 10,  7, 11,  9,  9,  9, 13,  9, 11,  9, 12,  9,  9,
-      15, 16, 14, 14, 13, 14, 12, 11,  7, 11,  8, 11,  8, 11,  9,  9,
-       9, 12,  9, 11,  9, 12,  9,  9, 15, 16, 13, 13, 13, 14, 11, 10,
-      10, 13, 10, 12, 11, 13, 10, 10, 11, 15, 10, 12, 11, 13, 10, 10,
-      14, 16, 12, 13, 13, 14, 11, 10, 10, 14, 11, 12,  9, 12, 10, 10,
-      11, 15, 11, 13, 10, 13, 10, 10, 15, 16, 14, 14, 13, 14, 12, 11,
-      10, 14, 10, 12, 10, 12, 10, 10, 11, 15, 11, 12, 10, 12, 10, 10,
-      15, 16, 13, 14, 12, 14, 11, 10, 12, 16, 11, 13, 12, 14, 11, 10,
-      12, 16, 12, 13, 11, 13, 10, 10, 15, 16, 12, 14, 12, 14, 11,  9,
-       7, 12,  9, 11,  9, 12, 10, 10, 11, 14, 11, 12, 11, 13, 11, 11,
-      16, 16, 15, 16, 15, 16, 13, 12,  8, 12,  9, 11,  9, 12, 10, 10,
-      11, 14, 11, 12, 11, 13, 10, 10, 16, 16, 14, 15, 15, 16, 13, 12,
-      11, 14, 10, 12, 11, 13, 10, 10, 12, 16, 11, 13, 12, 14, 11, 10,
-      16, 16, 14, 15, 14, 16, 12, 11,  8, 13,  9, 11,  9, 12, 10, 10,
-      11, 14, 11, 12, 11, 13, 10, 10, 16, 16, 15, 15, 14, 15, 13, 12,
-       9, 13,  9, 12,  9, 12, 10, 10, 11, 14, 10, 12, 10, 12, 10, 10,
-      16, 16, 14, 15, 14, 14, 12, 11, 11, 15, 11, 12, 11, 13, 11, 10,
-      12, 16, 11, 12, 12, 13, 11, 10, 16, 16, 13, 15, 14, 15, 11, 11,
-      11, 16, 11, 13, 10, 13, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11,
-      16, 16, 14, 15, 14, 15, 13, 11, 11, 16, 11, 13, 11, 13, 11, 10,
-      12, 16, 12, 13, 10, 13, 11, 10, 16, 16, 14, 14, 12, 14, 12, 10,
-      12, 16, 12, 14, 12, 14, 11, 11, 13, 16, 12, 14, 12, 14, 11, 10,
-      15, 16, 12, 14, 12, 14, 11,  9,  9, 14, 11, 13, 11, 13, 11, 11,
-      13, 16, 12, 14, 13, 14, 12, 11, 16, 16, 16, 16, 16, 16, 14, 12,
-       9, 14, 10, 12, 10, 13, 11, 11, 12, 16, 12, 13, 13, 14, 11, 11,
-      16, 16, 16, 16, 16, 14, 13, 12, 10, 15, 11, 13, 11, 14, 11, 10,
-      13, 16, 12, 13, 12, 15, 11, 10, 16, 16, 14, 16, 15, 16, 13, 11,
-      10, 14, 10, 13, 11, 14, 11, 11, 13, 16, 12, 13, 12, 14, 11, 11,
-      16, 16, 16, 16, 15, 16, 13, 12, 10, 14, 10, 12, 10, 13, 10, 11,
-      12, 15, 12, 13, 12, 13, 11, 10, 16, 16, 14, 14, 15, 15, 13, 11,
-      11, 16, 11, 13, 11, 14, 11, 10, 12, 16, 11, 13, 12, 14, 11, 10,
-      16, 16, 13, 14, 14, 15, 12, 10, 11, 16, 12, 13, 11, 14, 11, 10,
-      13, 16, 13, 14, 12, 14, 11, 11, 16, 16, 15, 16, 15, 15, 12, 11,
-      11, 16, 12, 13, 11, 14, 11, 10, 13, 16, 12, 13, 11, 14, 11, 10,
-      16, 16, 14, 15, 13, 14, 12, 10, 12, 16, 12, 14, 12, 14, 10, 10,
-      12, 16, 11, 13, 11, 14, 10, 10, 14, 16, 11, 13, 12, 13, 10,  8,
-    },
-  },
-  {
-    {
-       0, 12,  6, 13,  7, 14, 11, 14,  8, 14, 10, 14, 11, 15, 13, 15,
-      16, 16, 16, 16, 16, 16, 16, 16,  5, 14,  7, 13, 10, 16, 12, 14,
-       9, 16, 10, 14, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16,  9, 14, 14, 16, 13, 16, 12, 16, 11, 16, 16, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  5, 14,  9, 14,  8, 14, 12, 14,
-       9, 16, 11, 14, 11, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 10, 14, 11, 16, 12, 14, 10, 16, 11, 15, 12, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 12, 16, 14, 16, 14, 16,
-      13, 16, 12, 16, 15, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 13, 16, 11, 16, 14, 16, 13, 16, 14, 16, 13, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 14, 16, 13, 16, 14, 16,
-      13, 16, 14, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 15, 16, 16, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  1, 12,  6, 12,  8, 14, 11, 13,
-       8, 14, 10, 13, 11, 14, 13, 14, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 14,  7, 13, 10, 14, 11, 14,  9, 16, 10, 14, 12, 16, 13, 15,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16,  9, 14, 13, 16, 13, 14,
-      12, 16, 11, 15, 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 14,  9, 13,  8, 14, 12, 14,  9, 16, 11, 14, 11, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 16, 16,  7, 15,  9, 14, 10, 16, 12, 14,
-       9, 16, 10, 14, 11, 16, 12, 14, 16, 16, 16, 16, 16, 16, 15, 16,
-      11, 16, 11, 15, 14, 16, 13, 15, 12, 16, 11, 15, 14, 16, 13, 14,
-      16, 16, 14, 16, 16, 16, 14, 16, 10, 16, 13, 16, 10, 16, 13, 16,
-      12, 16, 14, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 13, 16, 12, 16, 13, 16, 12, 16, 13, 16, 12, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 15, 16, 14, 16, 14, 16, 16, 16, 14, 16,
-      15, 16, 14, 16, 14, 16, 14, 16, 16, 16, 16, 16, 16, 16, 14, 14,
-       4, 14,  8, 13,  9, 16, 12, 14,  9, 16, 11, 14, 11, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 15,  8, 13, 10, 16, 12, 14,
-      10, 16, 11, 14, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 16,  9, 14, 13, 16, 13, 15, 12, 16, 11, 16, 14, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 16,  9, 14,  9, 16, 12, 14,
-      10, 16, 11, 15, 12, 16, 13, 15, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 10, 14, 11, 16, 12, 14, 10, 16, 11, 14, 12, 16, 13, 15,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 15, 14, 16, 13, 15,
-      12, 16, 11, 15, 14, 16, 13, 14, 16, 16, 14, 16, 16, 16, 14, 16,
-      10, 16, 13, 16, 10, 16, 13, 15, 13, 16, 14, 16, 12, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 12, 16, 13, 16,
-      12, 16, 13, 16, 11, 16, 13, 16, 16, 16, 16, 16, 15, 16, 15, 16,
-      14, 16, 14, 16, 15, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 14,
-      16, 16, 14, 16, 15, 16, 14, 14,  6, 16,  9, 14, 10, 16, 12, 14,
-      10, 16, 11, 13, 12, 16, 13, 14, 16, 16, 16, 16, 16, 16, 14, 14,
-       7, 16,  9, 14, 10, 16, 12, 13, 11, 16, 11, 14, 12, 16, 12, 14,
-      16, 16, 16, 16, 16, 16, 14, 14,  9, 16,  9, 14, 12, 16, 11, 13,
-      12, 16, 11, 14, 12, 16, 12, 13, 16, 16, 14, 16, 16, 16, 13, 14,
-       7, 16, 10, 14, 10, 16, 12, 14, 11, 16, 11, 14, 11, 16, 12, 14,
-      16, 16, 16, 16, 16, 16, 14, 14,  8, 16, 10, 14, 10, 16, 11, 13,
-      10, 16, 11, 13, 11, 16, 12, 13, 16, 16, 14, 16, 16, 16, 14, 14,
-      10, 16,  9, 13, 12, 16, 11, 13, 11, 16, 10, 13, 12, 16, 11, 12,
-      16, 16, 13, 15, 15, 16, 13, 13,  9, 16, 11, 14,  9, 16, 11, 13,
-      12, 16, 12, 16, 12, 16, 12, 13, 16, 16, 16, 16, 15, 16, 14, 14,
-      10, 16, 11, 14, 10, 16, 11, 13, 11, 16, 12, 14, 10, 15, 11, 13,
-      16, 16, 15, 16, 13, 16, 13, 13, 12, 16, 11, 13, 12, 16, 11, 12,
-      12, 16, 11, 13, 11, 14, 11, 11, 13, 16, 12, 13, 12, 14, 11, 11,
-    },
-    {
-       0, 10,  5, 10,  6, 11,  8, 10,  7, 12,  8, 11,  8, 12,  9, 10,
-      14, 16, 13, 13, 13, 14, 12, 11,  4, 12,  6, 10,  8, 12,  9, 10,
-       8, 13,  8, 11,  9, 12,  9, 10, 14, 16, 12, 13, 13, 14, 11, 11,
-       9, 15,  8, 12, 12, 14, 10, 11, 11, 16,  9, 12, 12, 14, 10, 10,
-      14, 16, 11, 13, 13, 15, 11, 11,  4, 12,  8, 11,  6, 11,  9, 10,
-       8, 13,  9, 11,  8, 12,  9, 10, 14, 16, 12, 13, 13, 14, 11, 11,
-       7, 13,  8, 11,  9, 12,  9, 10,  8, 13,  9, 11,  9, 12,  9, 10,
-      14, 16, 12, 13, 12, 13, 11, 10, 11, 16, 10, 12, 12, 14, 10, 11,
-      11, 16, 10, 12, 12, 14, 10, 10, 15, 16, 11, 13, 13, 14, 11, 10,
-      10, 16, 11, 13,  9, 13, 10, 11, 11, 15, 12, 13, 10, 12, 10, 11,
-      15, 16, 13, 14, 12, 13, 11, 11, 11, 16, 11, 13, 10, 13, 10, 11,
-      12, 16, 11, 13, 10, 13, 10, 10, 15, 16, 13, 14, 12, 13, 11, 10,
-      13, 16, 12, 13, 13, 14, 11, 11, 14, 16, 12, 13, 12, 14, 11, 10,
-      16, 16, 13, 13, 13, 14, 11,  9,  3, 11,  6, 10,  6, 11,  9, 10,
-       8, 12,  8, 11,  9, 12,  9, 10, 14, 16, 13, 13, 13, 13, 12, 11,
-       5, 12,  6, 10,  8, 12,  9, 10,  8, 13,  8, 11,  9, 12,  9, 10,
-      14, 16, 12, 13, 13, 14, 11, 11,  9, 15,  8, 11, 11, 14, 10, 10,
-      11, 15,  9, 11, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 11, 10,
-       5, 12,  8, 11,  7, 11,  9, 10,  8, 13,  9, 11,  9, 12,  9, 10,
-      14, 16, 12, 13, 13, 13, 11, 11,  7, 13,  8, 11,  8, 12,  9, 10,
-       8, 13,  8, 11,  9, 12,  9,  9, 13, 16, 11, 13, 12, 13, 11, 10,
-      10, 15,  9, 12, 11, 14, 10, 10, 11, 15,  9, 11, 11, 13, 10, 10,
-      14, 16, 11, 12, 13, 14, 10, 10,  9, 16, 11, 13,  9, 12, 10, 10,
-      11, 16, 11, 13,  9, 12, 10, 10, 15, 16, 13, 14, 12, 13, 11, 10,
-      11, 16, 11, 13, 10, 13, 10, 10, 11, 15, 11, 13,  9, 12, 10, 10,
-      14, 16, 12, 13, 11, 13, 10, 10, 13, 16, 12, 13, 12, 14, 11, 10,
-      13, 16, 11, 13, 12, 13, 10, 10, 14, 16, 11, 12, 12, 13, 10,  9,
-       7, 14,  8, 12,  9, 13, 10, 11, 10, 14, 10, 12, 11, 13, 11, 11,
-      16, 16, 14, 14, 14, 14, 12, 12,  7, 14,  8, 12,  9, 13, 10, 11,
-      10, 14, 10, 12, 11, 13, 10, 11, 16, 16, 13, 13, 14, 14, 12, 11,
-      10, 15,  9, 12, 12, 14, 10, 10, 12, 16,  9, 12, 12, 14, 10, 10,
-      16, 16, 12, 13, 14, 15, 12, 11,  8, 14,  9, 12,  9, 13, 10, 11,
-      10, 15, 10, 12, 10, 13, 10, 11, 16, 16, 14, 14, 14, 14, 12, 11,
-       8, 14,  9, 12,  9, 13, 10, 11, 10, 14, 10, 12, 10, 13, 10, 10,
-      15, 16, 13, 13, 13, 14, 12, 11, 10, 15, 10, 12, 12, 14, 10, 10,
-      11, 16,  9, 12, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 11, 10,
-      11, 16, 11, 14,  9, 13, 10, 11, 12, 16, 12, 14, 10, 13, 11, 11,
-      16, 16, 14, 15, 13, 14, 12, 11, 11, 16, 12, 14, 10, 13, 11, 11,
-      11, 16, 11, 13, 10, 13, 10, 10, 15, 16, 13, 14, 12, 13, 11, 10,
-      13, 16, 12, 14, 13, 14, 11, 10, 12, 16, 11, 13, 12, 13, 10, 10,
-      14, 16, 11, 12, 11, 13, 10,  9, 10, 16, 10, 13, 11, 14, 11, 11,
-      12, 16, 11, 13, 12, 14, 11, 11, 16, 16, 14, 13, 14, 15, 12, 11,
-      10, 16, 10, 13, 10, 14, 11, 11, 12, 16, 11, 13, 11, 14, 11, 11,
-      16, 16, 14, 13, 14, 14, 12, 11, 11, 15,  9, 12, 11, 14, 10, 10,
-      13, 16, 10, 12, 12, 14, 10, 10, 16, 16, 13, 13, 14, 14, 11, 10,
-      10, 16, 10, 13, 11, 14, 11, 11, 12, 16, 11, 13, 12, 14, 11, 11,
-      16, 16, 14, 14, 14, 14, 12, 11,  9, 16, 10, 13, 10, 14, 11, 11,
-      11, 15, 11, 12, 11, 13, 11, 11, 16, 16, 13, 13, 14, 14, 12, 10,
-      10, 15,  9, 12, 11, 14, 10, 10, 11, 16,  9, 11, 11, 13, 10,  9,
-      15, 16, 11, 12, 13, 14, 10,  9, 11, 16, 11, 13, 10, 13, 10, 10,
-      13, 16, 12, 13, 11, 13, 10, 10, 16, 16, 14, 14, 13, 13, 11, 10,
-      11, 16, 11, 13, 10, 13, 10, 10, 12, 16, 11, 13, 10, 13, 10, 10,
-      15, 16, 13, 13, 12, 13, 11,  9, 11, 16, 11, 12, 11, 13, 10,  9,
-      11, 15, 10, 11, 11, 12,  9,  8, 13, 15, 10, 10, 10, 11,  8,  7,
-    },
-    {
-       0,  9,  3,  8,  5,  9,  7,  8,  5, 11,  6,  9,  8, 11,  8,  9,
-      16, 16, 16, 16, 16, 16, 11, 10,  2, 10,  4,  9,  7, 10,  7,  8,
-       7, 16,  7, 10,  9, 11,  8,  9, 16, 16, 11, 16, 16, 16, 11, 10,
-       7, 16,  7, 10, 10, 16,  8,  9, 10, 16,  8, 10, 11, 16,  9,  9,
-      16, 16, 16, 16, 16, 16, 11, 10,  3, 11,  6,  9,  6, 11,  8,  8,
-       7, 16,  8, 10,  8, 11,  8,  9, 16, 16, 15, 16, 16, 16, 11, 10,
-       5, 11,  7,  9,  8, 11,  8,  8,  7, 16,  7, 10,  8, 11,  8,  8,
-      16, 16, 11, 16, 16, 16, 10,  9,  9, 16,  8, 11, 11, 16,  9,  9,
-      10, 16,  8, 11, 11, 16,  9,  9, 16, 16, 10, 16, 16, 16, 10,  9,
-       8, 16, 10, 11,  8, 16,  9,  9, 11, 16, 11, 16, 10, 16, 10,  9,
-      16, 16, 16, 16, 16, 16, 11, 10,  9, 16, 10, 16, 10, 16,  9,  9,
-      10, 16, 10, 16,  9, 16,  9,  9, 16, 16, 16, 16, 15, 16, 10,  9,
-      16, 16, 11, 16, 16, 16, 10, 10, 13, 16, 11, 16, 11, 16, 10,  9,
-      16, 16, 10, 11, 11, 16,  9,  8, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       1, 10,  6, 10,  7, 11,  9, 10,  8, 12,  9, 12,  9, 12, 10, 10,
-      16, 16, 14, 16, 14, 15, 13, 12,  5, 12,  7, 10,  9, 11,  9, 10,
-       9, 13,  9, 12, 10, 13, 10, 10, 16, 16, 14, 15, 14, 14, 13, 12,
-      10, 15, 10, 12, 12, 14, 11, 11, 12, 16, 11, 13, 12, 14, 11, 11,
-      16, 16, 14, 16, 15, 16, 13, 12,  6, 12,  8, 11,  8, 11, 10, 10,
-       9, 13, 10, 12, 10, 12, 10, 10, 15, 16, 13, 15, 13, 14, 12, 12,
-       7, 13,  9, 11,  9, 12, 10, 10,  9, 14, 10, 12, 10, 13, 10, 10,
-      15, 16, 13, 15, 13, 14, 12, 11, 11, 15, 11, 13, 12, 14, 11, 11,
-      12, 16, 11, 13, 12, 14, 11, 11, 16, 16, 13, 15, 14, 16, 12, 11,
-      10, 16, 12, 14, 10, 13, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11,
-      16, 16, 15, 16, 14, 16, 13, 12, 11, 16, 12, 14, 11, 14, 11, 11,
-      12, 16, 12, 14, 11, 14, 11, 11, 16, 16, 14, 15, 13, 15, 12, 12,
-      13, 16, 13, 15, 13, 15, 12, 12, 13, 16, 12, 15, 12, 15, 11, 11,
-      16, 16, 13, 16, 13, 15, 12, 11,  4, 11,  7, 10,  7, 11,  9, 10,
-       9, 13,  9, 12, 10, 12, 10, 10, 15, 16, 14, 15, 14, 15, 13, 12,
-       6, 12,  7, 11,  9, 11,  9, 10,  9, 13,  9, 12, 10, 12, 10, 10,
-      15, 16, 14, 15, 14, 15, 12, 12, 10, 15,  9, 12, 12, 13, 11, 11,
-      12, 15, 11, 13, 12, 14, 11, 11, 16, 16, 13, 15, 14, 16, 12, 12,
-       6, 12,  8, 11,  8, 11,  9, 10,  9, 14, 10, 12, 10, 12, 10, 10,
-      14, 16, 13, 14, 13, 14, 12, 12,  8, 13,  9, 11,  9, 12, 10, 10,
-       9, 13,  9, 12,  9, 12,  9, 10, 14, 16, 13, 14, 13, 14, 12, 11,
-      11, 15, 11, 13, 11, 14, 11, 11, 12, 16, 10, 13, 12, 13, 11, 10,
-      15, 16, 12, 15, 13, 16, 12, 11, 10, 15, 11, 13, 10, 13, 11, 11,
-      12, 16, 12, 14, 11, 13, 11, 11, 16, 16, 14, 15, 13, 16, 13, 12,
-      11, 16, 11, 14, 11, 13, 11, 11, 12, 16, 12, 14, 10, 13, 11, 11,
-      15, 16, 13, 16, 12, 14, 12, 11, 12, 16, 12, 14, 12, 15, 11, 11,
-      13, 16, 12, 14, 12, 14, 11, 11, 15, 16, 13, 15, 13, 15, 11, 10,
-       7, 13,  9, 12, 10, 13, 11, 11, 11, 15, 12, 13, 12, 13, 11, 11,
-      16, 16, 15, 16, 16, 16, 14, 13,  8, 13,  9, 12, 10, 13, 11, 11,
-      12, 15, 11, 13, 12, 13, 11, 11, 16, 16, 14, 15, 15, 16, 13, 12,
-      11, 16, 11, 13, 12, 14, 11, 11, 13, 16, 12, 14, 13, 15, 12, 11,
-      16, 16, 14, 16, 15, 16, 13, 12,  9, 15, 10, 13, 10, 13, 11, 11,
-      12, 15, 11, 13, 11, 13, 11, 11, 16, 16, 14, 16, 16, 16, 13, 12,
-       9, 14, 10, 13, 10, 13, 11, 11, 11, 14, 11, 13, 11, 13, 11, 11,
-      16, 16, 14, 16, 14, 16, 12, 12, 11, 16, 11, 14, 12, 14, 12, 11,
-      12, 16, 11, 13, 13, 14, 11, 11, 16, 16, 13, 15, 14, 16, 12, 11,
-      12, 16, 12, 14, 11, 14, 11, 11, 13, 16, 13, 14, 12, 15, 12, 11,
-      16, 16, 16, 16, 14, 16, 13, 12, 12, 16, 12, 14, 11, 14, 12, 11,
-      12, 16, 12, 15, 11, 14, 11, 11, 16, 16, 14, 16, 13, 15, 12, 12,
-      13, 16, 13, 16, 13, 16, 12, 12, 13, 16, 12, 15, 12, 16, 11, 11,
-      14, 16, 12, 15, 12, 15, 11, 10,  9, 16, 11, 14, 12, 14, 12, 12,
-      13, 16, 13, 15, 14, 16, 12, 12, 16, 16, 16, 16, 16, 16, 14, 13,
-      10, 16, 11, 14, 12, 14, 12, 12, 13, 16, 13, 14, 13, 16, 12, 12,
-      16, 16, 15, 16, 16, 16, 13, 12, 11, 16, 11, 14, 12, 15, 12, 11,
-      13, 16, 12, 14, 13, 16, 12, 11, 16, 16, 14, 16, 16, 16, 13, 12,
-      11, 16, 11, 14, 12, 14, 12, 12, 13, 16, 12, 15, 13, 16, 12, 12,
-      16, 16, 16, 16, 16, 16, 14, 13, 10, 16, 11, 14, 11, 15, 11, 11,
-      13, 16, 12, 14, 12, 14, 12, 11, 16, 16, 14, 16, 16, 16, 13, 12,
-      11, 16, 11, 15, 12, 15, 12, 11, 13, 16, 11, 14, 13, 15, 12, 11,
-      16, 16, 13, 16, 14, 16, 12, 11, 12, 16, 12, 15, 11, 15, 12, 11,
-      14, 16, 13, 15, 12, 16, 12, 11, 16, 16, 15, 16, 14, 16, 13, 12,
-      11, 16, 12, 15, 11, 15, 11, 11, 13, 16, 13, 16, 11, 15, 11, 11,
-      16, 16, 14, 16, 13, 15, 12, 11, 12, 16, 12, 15, 12, 16, 11, 11,
-      12, 16, 11, 15, 12, 14, 11, 11, 13, 16, 12, 13, 11, 13, 10,  9,
-    },
-  },
-  {
-    {
-       0, 13,  6, 13,  8, 14, 12, 16,  8, 16, 11, 16, 12, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 16,  7, 14, 11, 16, 13, 16,
-       9, 16, 11, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 10, 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  5, 16, 10, 16,  8, 16, 13, 16,
-      10, 16, 12, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 10, 16, 11, 16, 13, 16, 10, 16, 12, 16, 12, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 12, 16, 16, 16, 16, 16,
-      14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 16, 16, 11, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16,
-      14, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  1, 13,  7, 13,  8, 16, 12, 16,
-       8, 16, 10, 16, 11, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       4, 16,  7, 14, 10, 16, 12, 16,  9, 16, 10, 16, 12, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 10, 16,  9, 16, 14, 16, 14, 16,
-      13, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 16,  9, 16,  8, 16, 12, 16,  9, 16, 11, 16, 11, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  7, 16, 10, 16, 11, 16, 13, 16,
-       9, 16, 11, 16, 11, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 12, 16, 16, 16, 14, 16, 13, 16, 12, 16, 16, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 10, 16, 13, 16, 11, 16, 14, 16,
-      13, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 14, 16, 13, 16, 14, 16, 13, 16, 14, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       4, 16,  8, 16,  9, 16, 13, 16, 10, 16, 11, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 16,  8, 16, 11, 16, 13, 16,
-      10, 16, 11, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 16,  9, 16, 13, 16, 13, 16, 13, 16, 12, 16, 16, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 16, 10, 16, 10, 16, 13, 16,
-      10, 16, 12, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 10, 16, 11, 16, 13, 16, 10, 16, 11, 16, 12, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 16, 16, 16, 14, 16,
-      12, 16, 11, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 13, 16, 10, 16, 13, 16, 13, 16, 16, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 13, 16, 12, 16, 14, 16,
-      12, 16, 15, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 16, 10, 16, 10, 16, 13, 16,
-      11, 16, 11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16,  9, 16, 11, 16, 12, 16, 11, 16, 11, 16, 12, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16,  9, 16, 12, 16, 12, 16,
-      13, 16, 11, 16, 13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 10, 16, 10, 16, 12, 16, 11, 16, 12, 16, 12, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16, 10, 16, 11, 16, 12, 16,
-      10, 16, 11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 10, 14, 12, 16, 12, 16, 11, 16, 10, 14, 13, 16, 12, 14,
-      16, 16, 14, 16, 16, 16, 14, 16,  9, 16, 12, 16, 10, 16, 12, 16,
-      13, 16, 13, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 12, 16, 11, 16, 12, 16, 11, 16, 12, 16, 11, 16, 12, 15,
-      16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 12, 16, 13, 16, 12, 13,
-      12, 16, 12, 16, 12, 16, 12, 13, 16, 16, 13, 14, 13, 16, 13, 13,
-    },
-    {
-       0, 10,  5, 10,  5, 10,  8, 10,  6, 11,  8, 11,  8, 11,  9, 10,
-      14, 16, 13, 14, 13, 14, 12, 12,  4, 12,  5, 10,  8, 12,  9, 10,
-       7, 12,  8, 11,  9, 12,  9, 10, 14, 16, 12, 13, 13, 14, 12, 12,
-       9, 16,  8, 12, 12, 14, 10, 11, 11, 16,  9, 12, 12, 14, 11, 11,
-      14, 16, 12, 13, 14, 15, 12, 12,  4, 12,  7, 11,  6, 11,  9, 10,
-       8, 12,  9, 11,  8, 11,  9, 10, 14, 16, 12, 14, 13, 14, 12, 12,
-       7, 13,  8, 11,  8, 12,  9, 10,  8, 13,  8, 11,  9, 12,  9, 10,
-      14, 16, 12, 13, 12, 13, 11, 11, 11, 16, 10, 12, 12, 14, 11, 11,
-      12, 16, 10, 12, 12, 14, 11, 11, 16, 16, 12, 13, 14, 15, 12, 11,
-      10, 16, 11, 14,  9, 13, 10, 11, 11, 16, 12, 14, 10, 13, 11, 11,
-      15, 16, 13, 14, 13, 14, 12, 12, 11, 16, 12, 14, 10, 13, 11, 11,
-      12, 16, 12, 14, 11, 13, 11, 11, 15, 16, 13, 14, 13, 14, 12, 11,
-      14, 16, 13, 14, 13, 15, 12, 12, 14, 16, 12, 14, 13, 15, 11, 11,
-      16, 16, 13, 14, 14, 15, 12, 11,  3, 11,  5, 10,  6, 11,  9, 10,
-       7, 12,  8, 11,  9, 11,  9, 10, 14, 16, 13, 13, 13, 14, 12, 12,
-       5, 12,  6, 10,  8, 12,  9, 10,  8, 13,  8, 11,  9, 12,  9, 10,
-      14, 16, 12, 13, 13, 14, 12, 12,  9, 16,  8, 11, 11, 14, 10, 11,
-      11, 16,  9, 12, 12, 14, 10, 11, 15, 16, 12, 13, 14, 15, 12, 11,
-       5, 12,  7, 11,  6, 11,  9, 10,  8, 13,  9, 11,  8, 11,  9, 10,
-      14, 16, 12, 14, 13, 13, 12, 12,  7, 13,  8, 11,  8, 12,  9, 10,
-       8, 12,  8, 11,  9, 12,  9, 10, 13, 16, 12, 13, 12, 13, 11, 11,
-      10, 16,  9, 12, 12, 14, 10, 11, 11, 15,  9, 12, 12, 14, 10, 11,
-      14, 16, 11, 13, 13, 14, 11, 11,  9, 16, 11, 14,  8, 13, 10, 11,
-      11, 16, 12, 13, 10, 13, 10, 11, 16, 16, 13, 15, 13, 14, 12, 12,
-      11, 16, 11, 14, 10, 13, 10, 11, 11, 16, 11, 13, 10, 13, 10, 11,
-      14, 16, 13, 14, 12, 13, 11, 11, 14, 16, 12, 14, 13, 15, 11, 11,
-      13, 16, 12, 13, 12, 14, 11, 11, 14, 16, 12, 13, 12, 13, 11, 10,
-       6, 14,  8, 12,  9, 13, 10, 11, 10, 14, 10, 12, 11, 13, 11, 12,
-      16, 16, 14, 14, 14, 14, 13, 12,  7, 14,  8, 12,  9, 13, 10, 11,
-      10, 14, 10, 12, 11, 13, 11, 11, 16, 16, 13, 14, 14, 15, 13, 12,
-      10, 16,  8, 12, 12, 14, 10, 11, 12, 16, 10, 12, 13, 15, 11, 11,
-      16, 16, 13, 14, 15, 16, 12, 12,  8, 15,  9, 13,  9, 13, 10, 11,
-      10, 15, 10, 13, 10, 13, 11, 11, 16, 16, 14, 14, 14, 14, 13, 12,
-       8, 15,  9, 12, 10, 13, 10, 11, 10, 14, 10, 12, 10, 13, 10, 11,
-      16, 16, 13, 14, 13, 14, 12, 12, 10, 16, 10, 13, 12, 15, 11, 11,
-      11, 16,  9, 12, 12, 14, 11, 11, 14, 16, 11, 13, 14, 16, 12, 11,
-      10, 16, 12, 14,  9, 13, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11,
-      16, 16, 15, 16, 14, 14, 13, 12, 11, 16, 12, 14, 11, 14, 11, 11,
-      11, 16, 12, 14, 10, 13, 11, 11, 15, 16, 13, 15, 12, 14, 12, 11,
-      14, 16, 13, 14, 13, 16, 12, 12, 12, 16, 12, 13, 12, 14, 11, 11,
-      14, 16, 11, 12, 12, 13, 10, 10,  9, 16, 10, 14, 11, 15, 12, 12,
-      12, 16, 11, 13, 12, 15, 12, 12, 16, 16, 14, 13, 15, 15, 13, 12,
-      10, 16, 10, 14, 11, 15, 11, 12, 12, 16, 11, 13, 12, 14, 12, 12,
-      16, 16, 14, 13, 15, 14, 13, 12, 11, 16,  9, 12, 12, 14, 11, 11,
-      13, 16, 11, 13, 13, 15, 11, 11, 16, 16, 14, 14, 16, 16, 12, 12,
-      10, 16, 10, 14, 11, 14, 11, 12, 12, 16, 11, 13, 12, 14, 12, 12,
-      16, 16, 14, 14, 15, 15, 13, 12, 10, 16, 10, 13, 11, 14, 11, 12,
-      11, 16, 11, 13, 11, 14, 11, 12, 16, 16, 14, 14, 14, 14, 13, 12,
-      11, 16, 10, 12, 12, 15, 11, 11, 12, 16,  9, 12, 12, 14, 10, 11,
-      16, 16, 12, 13, 14, 15, 11, 11, 11, 16, 12, 14, 10, 14, 11, 11,
-      13, 16, 12, 14, 12, 14, 11, 11, 16, 16, 15, 15, 14, 15, 12, 12,
-      11, 16, 12, 14, 11, 14, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11,
-      16, 16, 14, 14, 13, 14, 12, 11, 12, 16, 11, 13, 12, 14, 10, 10,
-      12, 15, 11, 12, 12, 13, 10, 10, 14, 15, 11, 11, 12, 12, 10,  9,
-    },
-    {
-       0,  8,  3,  8,  5,  9,  7,  8,  5, 10,  6, 10,  8, 11,  8,  9,
-      16, 16, 15, 16, 16, 16, 11, 11,  2, 10,  4,  9,  7, 10,  7,  8,
-       7, 16,  7, 10,  9, 11,  8,  9, 16, 16, 15, 16, 16, 16, 11, 11,
-       7, 16,  6, 11, 10, 16,  9, 10, 10, 16,  9, 11, 11, 16,  9, 10,
-      16, 16, 16, 16, 16, 16, 16, 11,  3, 10,  6,  9,  5, 10,  7,  9,
-       7, 16,  8, 10,  8, 11,  8,  9, 16, 16, 16, 16, 16, 16, 11, 11,
-       5, 11,  7, 10,  8, 11,  8,  9,  7, 14,  7, 10,  8, 11,  8,  9,
-      16, 16, 11, 16, 16, 16, 10, 11,  9, 16,  9, 11, 11, 16,  9, 10,
-      10, 16,  8, 11, 11, 16,  9, 10, 16, 16, 11, 16, 16, 16, 11, 10,
-       8, 16,  9, 16,  7, 16,  9, 10, 11, 16, 11, 16, 10, 16, 10, 10,
-      16, 16, 16, 16, 16, 16, 16, 11,  9, 16, 10, 16,  9, 16,  9, 10,
-      10, 16, 10, 16,  9, 16,  9, 10, 16, 16, 16, 16, 11, 16, 11, 11,
-      16, 16, 16, 16, 16, 16, 10, 10, 11, 16, 11, 16, 11, 16, 10, 10,
-      16, 16, 11, 16, 11, 16, 10,  9, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       1, 10,  6, 10,  7, 11,  9, 10,  8, 12,  9, 12,  9, 12, 10, 10,
-      15, 16, 14, 15, 14, 16, 13, 12,  5, 12,  7, 11,  8, 11,  9, 10,
-       9, 13,  9, 12, 10, 12, 10, 10, 16, 16, 14, 15, 13, 16, 13, 12,
-      10, 15, 10, 13, 12, 14, 11, 11, 12, 16, 11, 13, 12, 14, 11, 11,
-      16, 16, 14, 16, 14, 16, 13, 12,  5, 12,  8, 11,  7, 11,  9, 10,
-       9, 13, 10, 12,  9, 12, 10, 10, 14, 16, 14, 15, 13, 14, 13, 12,
-       7, 13,  9, 12,  9, 12, 10, 10,  9, 13,  9, 12,  9, 12, 10, 10,
-      14, 16, 13, 14, 13, 15, 12, 12, 11, 16, 11, 13, 12, 14, 11, 11,
-      12, 16, 11, 14, 12, 14, 11, 11, 16, 16, 14, 16, 14, 16, 13, 12,
-      10, 16, 11, 14, 10, 13, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11,
-      15, 16, 15, 16, 14, 16, 13, 12, 11, 16, 12, 14, 11, 14, 11, 12,
-      12, 16, 12, 14, 11, 14, 11, 11, 15, 16, 14, 16, 13, 16, 13, 12,
-      13, 16, 13, 16, 13, 16, 12, 12, 13, 16, 13, 16, 13, 16, 12, 12,
-      16, 16, 14, 15, 14, 16, 13, 12,  4, 11,  7, 10,  7, 11,  9, 10,
-       9, 13,  9, 11,  9, 12, 10, 10, 15, 16, 14, 15, 14, 15, 13, 12,
-       6, 12,  7, 11,  8, 11,  9, 10,  9, 13,  9, 12, 10, 12, 10, 10,
-      15, 16, 13, 14, 14, 15, 12, 12, 10, 14, 10, 12, 12, 13, 11, 11,
-      12, 16, 11, 13, 12, 14, 11, 11, 16, 16, 14, 15, 15, 16, 13, 12,
-       6, 12,  8, 11,  8, 11,  9, 10,  9, 13, 10, 12,  9, 12, 10, 10,
-      16, 16, 14, 15, 13, 14, 12, 12,  8, 13,  9, 11,  9, 12,  9, 10,
-       9, 13,  9, 12,  9, 12,  9, 10, 14, 16, 13, 14, 13, 14, 12, 11,
-      11, 15, 11, 13, 12, 14, 11, 11, 11, 16, 10, 13, 12, 14, 11, 11,
-      15, 16, 13, 15, 14, 16, 12, 11, 10, 16, 12, 13, 10, 13, 11, 11,
-      11, 16, 12, 14, 10, 13, 11, 11, 16, 16, 14, 16, 13, 16, 13, 12,
-      11, 16, 12, 14, 10, 14, 11, 11, 11, 16, 12, 14, 10, 13, 11, 11,
-      16, 16, 14, 16, 12, 15, 12, 11, 13, 16, 13, 15, 13, 15, 12, 12,
-      13, 16, 12, 15, 12, 15, 12, 11, 15, 16, 13, 16, 13, 16, 12, 11,
-       8, 14,  9, 12, 10, 13, 11, 11, 11, 16, 11, 13, 11, 13, 11, 11,
-      16, 16, 16, 16, 16, 16, 14, 13,  9, 14, 10, 12, 10, 13, 11, 11,
-      11, 16, 11, 13, 12, 13, 11, 11, 16, 16, 15, 16, 15, 16, 14, 12,
-      11, 16, 11, 13, 12, 14, 12, 11, 13, 16, 12, 14, 13, 14, 12, 11,
-      16, 16, 15, 16, 16, 16, 14, 13,  9, 14, 10, 13, 10, 13, 11, 11,
-      11, 16, 11, 13, 11, 13, 11, 11, 16, 16, 15, 16, 14, 15, 14, 13,
-       9, 14, 10, 13, 10, 13, 11, 11, 11, 15, 11, 13, 11, 13, 11, 11,
-      16, 16, 14, 16, 14, 16, 13, 12, 12, 16, 12, 14, 13, 14, 12, 11,
-      12, 16, 11, 14, 12, 15, 12, 11, 16, 16, 13, 16, 15, 16, 13, 11,
-      11, 16, 12, 14, 11, 14, 12, 11, 13, 16, 13, 15, 12, 14, 12, 12,
-      16, 16, 16, 16, 14, 16, 14, 13, 12, 16, 13, 15, 11, 14, 12, 12,
-      12, 16, 13, 14, 11, 15, 12, 11, 16, 16, 15, 16, 13, 15, 13, 12,
-      13, 16, 13, 15, 13, 16, 12, 12, 13, 16, 13, 15, 13, 15, 12, 12,
-      15, 16, 13, 16, 13, 15, 11, 10, 10, 16, 12, 14, 12, 15, 12, 12,
-      14, 16, 13, 15, 13, 16, 13, 12, 16, 16, 16, 16, 16, 16, 15, 13,
-      10, 16, 12, 14, 12, 15, 12, 12, 13, 16, 13, 15, 13, 15, 13, 12,
-      16, 16, 16, 16, 16, 16, 14, 13, 11, 16, 12, 15, 13, 16, 12, 12,
-      14, 16, 13, 16, 13, 16, 12, 12, 16, 16, 15, 16, 15, 16, 14, 12,
-      11, 16, 12, 14, 12, 16, 12, 12, 14, 16, 13, 15, 13, 15, 13, 12,
-      16, 16, 16, 16, 16, 16, 15, 13, 11, 16, 12, 14, 12, 15, 12, 12,
-      13, 16, 12, 14, 12, 15, 12, 12, 16, 16, 16, 16, 16, 16, 14, 12,
-      12, 16, 12, 15, 13, 16, 12, 12, 13, 16, 12, 15, 13, 15, 12, 11,
-      16, 16, 14, 16, 15, 16, 13, 12, 12, 16, 13, 16, 12, 16, 12, 12,
-      15, 16, 14, 16, 13, 16, 12, 12, 16, 16, 16, 16, 16, 16, 14, 13,
-      12, 16, 13, 15, 12, 16, 12, 12, 13, 16, 13, 15, 12, 15, 12, 12,
-      16, 16, 15, 16, 14, 16, 13, 12, 13, 16, 13, 16, 12, 16, 12, 12,
-      13, 16, 12, 16, 12, 15, 12, 12, 14, 16, 12, 14, 12, 14, 11, 10,
-    },
-  },
-  {
-    {
-       0, 16,  6, 16,  8, 16, 16, 16,  9, 16, 11, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 16,  7, 16, 11, 16, 16, 16,
-      10, 16, 11, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 10, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  5, 16, 10, 16,  9, 16, 16, 16,
-      10, 16, 13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 11, 16, 12, 16, 16, 16, 10, 16, 12, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  1, 16,  7, 16,  8, 16, 13, 16,
-       9, 16, 11, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       4, 16,  7, 16, 11, 16, 13, 16,  9, 16, 11, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16,  9, 16, 16, 16, 16, 16,
-      13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       4, 16, 10, 16,  8, 16, 16, 16, 10, 16, 12, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  7, 16, 10, 16, 11, 16, 16, 16,
-       9, 16, 11, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 12, 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 10, 16, 16, 16, 11, 16, 16, 16,
-      16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       4, 16,  8, 16, 10, 16, 16, 16, 10, 16, 11, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 16,  8, 16, 11, 16, 16, 16,
-      10, 16, 12, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 16,  9, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 16, 10, 16, 10, 16, 16, 16,
-      11, 16, 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 11, 16, 11, 16, 16, 16, 10, 16, 12, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 12, 16, 16, 16, 16, 16,
-      12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 16, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 16, 16, 12, 16, 16, 16,
-      12, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 16, 10, 16, 11, 16, 16, 16,
-      11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16,  9, 16, 11, 16, 13, 16, 11, 16, 12, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16,  9, 16, 13, 16, 12, 16,
-      13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 10, 16, 10, 16, 14, 16, 12, 16, 12, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16, 11, 16, 11, 16, 13, 16,
-      10, 16, 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 10, 16, 13, 16, 12, 16, 12, 16, 11, 16, 16, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16, 12, 16, 10, 16, 13, 16,
-      16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 13, 16, 11, 16, 13, 16, 12, 16, 13, 16, 12, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 13, 16, 16, 16, 12, 16,
-      13, 16, 12, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       0, 10,  4, 10,  5, 11,  9, 11,  6, 11,  8, 11,  8, 12, 10, 12,
-      15, 16, 13, 15, 14, 15, 13, 14,  4, 12,  5, 11,  8, 12,  9, 11,
-       7, 13,  8, 12,  9, 13, 10, 12, 15, 16, 13, 15, 14, 16, 13, 14,
-      10, 16,  9, 13, 12, 16, 11, 13, 11, 16, 10, 14, 13, 16, 12, 13,
-      16, 16, 14, 16, 15, 16, 14, 15,  4, 12,  7, 12,  6, 12,  9, 11,
-       8, 13,  9, 12,  9, 12, 10, 12, 15, 16, 13, 15, 14, 15, 13, 14,
-       7, 13,  8, 12,  9, 13, 10, 12,  8, 13,  9, 12,  9, 13, 10, 12,
-      14, 16, 13, 15, 13, 15, 13, 14, 12, 16, 11, 14, 13, 16, 12, 13,
-      12, 16, 11, 14, 13, 16, 12, 13, 16, 16, 14, 16, 15, 16, 14, 15,
-      10, 16, 12, 16, 10, 14, 12, 13, 12, 16, 13, 16, 11, 14, 12, 13,
-      16, 16, 16, 16, 15, 16, 14, 15, 12, 16, 13, 16, 11, 15, 12, 13,
-      13, 16, 13, 16, 12, 15, 12, 14, 16, 16, 16, 16, 14, 16, 13, 14,
-      16, 16, 14, 16, 14, 16, 13, 15, 16, 16, 14, 16, 14, 16, 13, 15,
-      16, 16, 16, 16, 16, 16, 14, 16,  2, 11,  5, 11,  6, 11,  9, 11,
-       7, 12,  8, 11,  9, 12, 10, 12, 15, 16, 14, 14, 14, 14, 13, 14,
-       4, 13,  6, 11,  8, 12,  9, 11,  8, 13,  8, 12, 10, 13, 10, 12,
-      15, 16, 13, 15, 14, 15, 13, 14,  9, 16,  8, 13, 12, 15, 11, 12,
-      11, 16, 10, 14, 13, 16, 12, 13, 16, 16, 14, 16, 16, 16, 14, 15,
-       5, 13,  8, 12,  7, 12,  9, 11,  8, 13,  9, 12,  9, 12, 10, 12,
-      16, 16, 14, 15, 14, 15, 13, 13,  7, 13,  8, 12,  9, 13, 10, 12,
-       8, 13,  8, 12,  9, 13, 10, 12, 14, 16, 13, 14, 13, 15, 12, 13,
-      11, 16, 10, 14, 13, 16, 12, 13, 11, 16, 10, 13, 12, 15, 11, 13,
-      14, 16, 12, 14, 14, 16, 13, 14, 10, 16, 12, 15,  9, 14, 11, 13,
-      12, 16, 12, 16, 11, 14, 12, 13, 16, 16, 15, 16, 16, 16, 14, 15,
-      11, 16, 12, 15, 11, 15, 12, 13, 12, 16, 12, 15, 11, 14, 12, 13,
-      16, 16, 14, 16, 13, 15, 13, 14, 15, 16, 14, 16, 14, 16, 13, 14,
-      14, 16, 13, 16, 14, 16, 13, 14, 16, 16, 14, 16, 14, 16, 13, 14,
-       7, 15,  8, 13,  9, 14, 11, 13, 10, 14, 10, 13, 11, 14, 12, 13,
-      16, 16, 15, 16, 15, 16, 15, 14,  7, 16,  8, 13, 10, 14, 11, 13,
-      11, 15, 10, 13, 12, 14, 12, 13, 16, 16, 16, 16, 16, 16, 15, 15,
-      10, 16,  9, 13, 13, 16, 12, 13, 13, 16, 11, 14, 14, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 15, 16,  8, 16, 10, 14,  9, 14, 11, 13,
-      11, 16, 11, 14, 11, 14, 12, 13, 16, 16, 16, 16, 16, 16, 14, 15,
-       8, 16, 10, 14, 10, 14, 11, 13, 10, 15, 10, 14, 11, 14, 12, 13,
-      16, 16, 14, 16, 15, 16, 14, 14, 11, 16, 10, 14, 13, 16, 12, 13,
-      11, 16, 10, 13, 13, 16, 12, 13, 16, 16, 13, 16, 16, 16, 14, 14,
-      11, 16, 12, 16, 10, 15, 12, 13, 14, 16, 14, 16, 12, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 13, 16, 11, 16, 12, 14,
-      12, 16, 13, 16, 11, 14, 12, 13, 16, 16, 16, 16, 14, 16, 14, 14,
-      15, 16, 14, 16, 16, 16, 13, 14, 13, 16, 13, 15, 14, 16, 13, 14,
-      14, 16, 13, 14, 14, 15, 13, 14,  9, 16, 11, 16, 12, 16, 13, 14,
-      12, 16, 12, 15, 13, 16, 13, 14, 16, 16, 16, 15, 16, 16, 15, 15,
-      10, 16, 10, 16, 12, 16, 12, 14, 12, 16, 12, 14, 13, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 15, 15, 11, 16, 10, 14, 14, 16, 12, 13,
-      14, 16, 12, 16, 14, 16, 13, 14, 16, 16, 16, 16, 16, 16, 16, 15,
-      10, 16, 12, 16, 11, 16, 12, 14, 13, 16, 12, 15, 13, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 16, 15, 10, 16, 11, 16, 12, 16, 12, 14,
-      12, 16, 12, 15, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 14, 14,
-      11, 16, 10, 14, 14, 16, 12, 13, 13, 16, 11, 14, 14, 16, 12, 13,
-      16, 16, 15, 16, 16, 16, 14, 14, 12, 16, 13, 16, 11, 16, 12, 14,
-      15, 16, 14, 16, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 14, 16,
-      12, 16, 13, 16, 12, 16, 12, 14, 13, 16, 13, 16, 12, 16, 12, 13,
-      16, 16, 16, 16, 16, 16, 14, 15, 13, 16, 13, 16, 14, 16, 12, 13,
-      13, 16, 13, 14, 14, 16, 12, 13, 16, 16, 14, 14, 14, 15, 13, 13,
-    },
-    {
-       0,  9,  3,  9,  5,  9,  7,  9,  5, 10,  7, 11,  8, 11,  9, 10,
-      16, 16, 16, 16, 16, 16, 16, 16,  2, 11,  4, 10,  7, 11,  8, 10,
-       7, 16,  7, 11,  9, 16,  9, 11, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16,  7, 16, 11, 16, 10, 11, 11, 16, 10, 16, 16, 16, 11, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  2, 11,  6, 10,  6, 10,  8, 10,
-       7, 16,  8, 16,  8, 11,  9, 11, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 13,  7, 11,  8, 11,  9, 11,  6, 12,  8, 12,  8, 12,  9, 11,
-      16, 16, 16, 16, 16, 16, 16, 16, 10, 16, 10, 16, 12, 16, 10, 13,
-      10, 16,  9, 16, 11, 16, 11, 12, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 10, 16,  8, 16, 10, 12, 11, 16, 12, 16, 10, 16, 11, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 10, 16, 11, 16, 10, 16, 11, 16,
-      11, 16, 12, 16, 10, 16, 11, 12, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       1, 10,  5, 10,  6, 10,  9, 10,  7, 12,  9, 12,  9, 12, 10, 10,
-      16, 16, 15, 16, 14, 16, 13, 13,  5, 12,  7, 11,  8, 11,  9, 10,
-       8, 13,  9, 12, 10, 12, 10, 11, 16, 16, 16, 16, 14, 16, 13, 12,
-      10, 16, 10, 13, 12, 14, 12, 12, 12, 16, 11, 14, 13, 15, 12, 12,
-      16, 16, 16, 15, 16, 16, 14, 13,  5, 12,  8, 11,  7, 11,  9, 10,
-       8, 13, 10, 12,  9, 12, 10, 10, 15, 16, 14, 15, 14, 14, 13, 13,
-       7, 13,  9, 12,  9, 12, 10, 10,  9, 13, 10, 13, 10, 13, 10, 10,
-      14, 16, 14, 15, 14, 16, 13, 12, 11, 16, 12, 14, 12, 15, 12, 12,
-      12, 16, 12, 15, 13, 16, 12, 12, 16, 16, 15, 16, 16, 16, 14, 13,
-      10, 16, 12, 14, 10, 14, 12, 12, 12, 16, 13, 14, 11, 14, 12, 12,
-      16, 16, 16, 16, 14, 16, 14, 13, 11, 16, 12, 14, 11, 14, 12, 12,
-      12, 16, 13, 16, 11, 15, 12, 12, 16, 16, 16, 16, 14, 16, 14, 13,
-      13, 16, 14, 16, 14, 16, 13, 13, 13, 16, 13, 16, 13, 16, 13, 12,
-      16, 16, 16, 16, 16, 16, 13, 13,  4, 11,  7, 10,  7, 11,  9, 10,
-       8, 12,  9, 12,  9, 12, 10, 11, 15, 16, 14, 15, 14, 16, 13, 13,
-       6, 12,  7, 11,  8, 11,  9, 10,  9, 13,  9, 12, 10, 12, 10, 10,
-      16, 16, 15, 16, 15, 16, 13, 12, 10, 16, 10, 13, 12, 14, 12, 11,
-      12, 16, 11, 14, 13, 14, 12, 12, 16, 16, 16, 14, 16, 16, 14, 13,
-       6, 12,  8, 11,  7, 11,  9, 10,  9, 14, 10, 12,  9, 12, 10, 10,
-      15, 16, 14, 16, 14, 16, 14, 13,  7, 13,  9, 12,  9, 12, 10, 10,
-       9, 13,  9, 12,  9, 12, 10, 10, 14, 16, 13, 14, 14, 16, 12, 11,
-      11, 16, 11, 14, 12, 14, 12, 12, 12, 16, 11, 14, 12, 14, 12, 11,
-      16, 16, 13, 16, 14, 16, 13, 12, 10, 16, 12, 14, 10, 14, 11, 11,
-      12, 16, 13, 14, 11, 14, 12, 12, 16, 16, 16, 16, 14, 16, 13, 13,
-      11, 16, 12, 16, 11, 14, 12, 12, 12, 16, 12, 14, 11, 14, 12, 11,
-      16, 16, 15, 16, 13, 15, 13, 12, 13, 16, 14, 16, 13, 16, 13, 12,
-      13, 16, 13, 16, 13, 16, 13, 12, 16, 16, 14, 16, 14, 16, 12, 11,
-       8, 13, 10, 12, 10, 13, 11, 11, 11, 14, 12, 14, 12, 14, 12, 12,
-      16, 16, 16, 16, 16, 16, 14, 13,  9, 14, 10, 13, 10, 13, 11, 11,
-      12, 16, 12, 13, 12, 13, 12, 11, 16, 16, 16, 16, 16, 16, 15, 14,
-      12, 16, 11, 14, 13, 15, 12, 12, 13, 16, 12, 15, 14, 15, 13, 12,
-      16, 16, 16, 16, 16, 16, 15, 13,  9, 14, 11, 13, 10, 13, 11, 11,
-      11, 16, 12, 14, 12, 14, 12, 12, 16, 16, 16, 16, 16, 16, 16, 13,
-      10, 15, 11, 13, 11, 14, 12, 11, 11, 16, 12, 14, 11, 14, 12, 11,
-      16, 16, 16, 16, 16, 16, 14, 12, 12, 16, 12, 14, 13, 15, 13, 12,
-      12, 16, 12, 14, 13, 15, 12, 12, 16, 16, 14, 16, 16, 16, 14, 12,
-      12, 16, 13, 16, 11, 14, 12, 12, 14, 16, 14, 16, 12, 16, 13, 12,
-      16, 16, 16, 16, 16, 16, 16, 13, 12, 16, 13, 16, 12, 16, 13, 12,
-      12, 16, 13, 16, 12, 16, 12, 12, 16, 16, 16, 16, 14, 16, 14, 12,
-      14, 16, 14, 16, 14, 16, 14, 13, 13, 16, 13, 16, 13, 16, 13, 12,
-      16, 16, 13, 16, 13, 16, 12, 11,  9, 16, 12, 15, 13, 16, 13, 12,
-      13, 16, 14, 16, 14, 16, 14, 13, 16, 16, 16, 16, 16, 16, 16, 14,
-      10, 16, 12, 15, 12, 15, 13, 12, 13, 16, 14, 16, 13, 16, 13, 12,
-      16, 16, 16, 16, 16, 16, 16, 13, 12, 16, 12, 16, 13, 16, 13, 12,
-      14, 16, 13, 16, 14, 16, 13, 12, 16, 16, 16, 16, 16, 16, 16, 13,
-      11, 16, 12, 15, 12, 16, 13, 12, 14, 16, 14, 16, 13, 16, 13, 13,
-      16, 16, 16, 16, 16, 16, 15, 13, 11, 16, 12, 16, 12, 16, 13, 12,
-      13, 16, 13, 15, 13, 16, 13, 12, 16, 16, 16, 16, 16, 16, 15, 13,
-      12, 16, 12, 16, 13, 16, 13, 12, 13, 16, 12, 16, 13, 16, 13, 12,
-      16, 16, 14, 16, 16, 16, 14, 12, 12, 16, 14, 16, 11, 16, 13, 12,
-      14, 16, 14, 16, 13, 16, 13, 12, 16, 16, 16, 16, 16, 16, 16, 13,
-      12, 16, 13, 16, 12, 16, 13, 12, 13, 16, 13, 16, 12, 16, 13, 12,
-      16, 16, 16, 16, 14, 16, 14, 12, 13, 16, 13, 16, 13, 16, 13, 13,
-      13, 16, 12, 16, 12, 16, 12, 12, 14, 16, 13, 15, 13, 16, 12, 11,
-    },
-  },
-};
-
-
-static const uint8_t rv34_table_intra_secondpat[NUM_INTRA_TABLES][2][OTHERBLK_VLC_SIZE] = {
-  {
-    {
-       0,  5, 10,  3,  6, 10,  7,  8,  9,  4,  6, 10,  6,  7,  9,  8,
-       8,  9,  8,  8,  9,  8,  9,  9,  9,  9,  8,  3,  6, 10,  4,  6,
-      10,  7,  7,  9,  5,  7, 10,  6,  7,  9,  7,  7,  8,  7,  8,  9,
-       8,  8,  9,  8,  8,  7,  6,  8, 10,  6,  8, 10,  7,  8,  9,  7,
-       8, 10,  7,  8, 10,  8,  8,  8,  8,  9,  9,  8,  8,  9,  9,  8,
-       7,  7,  8,  9,  7,  8,  9,  7,  7,  7,  8,  8,  9,  7,  8,  9,
-       7,  7,  7,  8,  8,  8,  7,  7,  7,  7,  6,  5,
-    },
-    {
-       0,  5, 11,  3,  6, 11,  8,  9, 11,  3,  6, 10,  6,  7, 11,  9,
-       9, 11,  7,  9, 11,  9,  9, 11, 10, 10, 11,  2,  6, 10,  4,  7,
-      10,  7,  9, 11,  4,  7, 11,  6,  7, 10,  9,  9, 11,  7,  9, 11,
-       8,  9, 10, 10, 10, 10,  5,  8, 11,  6,  8, 11,  8,  9, 11,  6,
-       8, 11,  7,  8, 11,  9,  9, 11,  8, 10, 11,  9,  9, 11, 10, 10,
-      10,  8,  9, 11,  8,  9, 11,  9,  9, 10,  8,  9, 11,  8,  9, 11,
-       9,  9, 10,  8,  9, 10,  9,  9, 10,  9,  9,  8,
-    },
-  },
-  {
-    {
-       0,  5, 10,  4,  6, 10,  7,  8, 10,  4,  6, 10,  6,  7,  9,  8,
-       8,  9,  8,  8,  9,  8,  9,  9,  9,  9,  9,  2,  6, 10,  4,  6,
-      10,  7,  7,  9,  5,  7, 10,  6,  7,  9,  7,  7,  9,  7,  8,  9,
-       8,  8,  9,  9,  8,  8,  6,  8, 10,  6,  8, 10,  7,  8,  9,  6,
-       8, 10,  7,  8, 10,  8,  8,  9,  8,  9, 10,  8,  8,  9,  9,  9,
-       8,  8,  8, 10,  7,  8,  9,  7,  8,  8,  7,  8, 10,  7,  8,  9,
-       7,  7,  8,  8,  8,  9,  8,  8,  8,  7,  7,  6,
-    },
-    {
-       0,  5, 12,  4,  7, 12,  8, 10, 13,  4,  7, 12,  6,  8, 12, 10,
-      10, 12,  8,  9, 12, 10, 10, 12, 12, 12, 12,  1,  6, 12,  4,  7,
-      12,  8,  9, 12,  4,  7, 12,  6,  8, 11,  9, 10, 12,  8,  9, 12,
-       9, 10, 11, 11, 11, 12,  6,  8, 12,  7,  9, 12,  9, 10, 13,  6,
-       9, 12,  8,  9, 12, 10, 10, 12,  9, 10, 12, 10, 10, 12, 12, 12,
-      12,  8, 10, 12,  9, 10, 12, 10, 10, 12,  8, 10, 12,  9, 10, 12,
-      10, 10, 11,  9, 10, 12, 10, 10, 11, 11, 10, 10,
-    },
-  },
-  {
-    {
-       0,  5, 10,  3,  6, 10,  7,  8, 11,  4,  6, 10,  6,  7, 10,  8,
-       9, 10,  8,  8, 10,  9,  9, 10, 10, 10, 10,  2,  6, 10,  4,  6,
-      10,  7,  8, 10,  4,  7, 10,  6,  7, 10,  8,  8, 10,  7,  8, 10,
-       8,  8,  9, 10,  9,  9,  5,  8, 11,  6,  8, 10,  7,  9, 10,  6,
-       8, 11,  7,  8, 10,  8,  8, 10,  8,  9, 11,  9,  9, 10, 10,  9,
-       9,  8,  9, 10,  8,  9, 10,  8,  9, 10,  8,  9, 10,  8,  8, 10,
-       8,  8,  9,  8,  9, 10,  8,  8,  9,  9,  8,  8,
-    },
-    {
-       0,  6, 13,  4,  7, 14,  9, 11, 14,  3,  7, 13,  7,  8, 13, 11,
-      11, 14,  8, 10, 13, 10, 11, 13, 13, 13, 14,  1,  6, 12,  4,  8,
-      13,  9, 10, 15,  4,  8, 13,  7,  8, 12, 11, 11, 14,  8, 10, 13,
-      10, 10, 13, 13, 13, 14,  5,  9, 13,  7,  9, 13, 10, 11, 14,  6,
-      10, 14,  8, 10, 14, 11, 11, 14,  9, 11, 14, 11, 11, 13, 13, 13,
-      14,  9, 10, 14,  9, 11, 13, 11, 12, 14,  9, 11, 13,  9, 11, 14,
-      11, 12, 13, 10, 12, 15, 11, 11, 13, 13, 12, 13,
-    },
-  },
-  {
-    {
-       0,  5, 11,  3,  6, 11,  7,  9, 12,  3,  6, 11,  6,  7, 11,  9,
-       9, 11,  8,  9, 11,  9,  9, 11, 11, 11, 12,  2,  6, 11,  4,  6,
-      11,  7,  9, 11,  4,  7, 11,  5,  7, 10,  9,  9, 11,  7,  8, 11,
-       9,  9, 10, 11, 11, 11,  5,  8, 11,  6,  8, 11,  8,  9, 12,  6,
-       8, 11,  7,  8, 11,  9,  9, 11,  8,  9, 12,  9,  9, 11, 11, 11,
-      11,  8, 10, 12,  8, 10, 11,  9, 10, 12,  8, 10, 12,  8,  9, 12,
-      10, 10, 12,  9, 10, 12,  9,  9, 11, 11, 10, 11,
-    },
-    {
-       0,  6, 13,  3,  8, 14, 10, 12, 16,  3,  8, 15,  7,  9, 15, 12,
-      13, 15,  9, 11, 15, 11, 12, 16, 14, 16, 16,  1,  7, 13,  4,  8,
-      14,  9, 11, 15,  4,  8, 14,  7,  9, 14, 12, 13, 15,  8, 10, 14,
-      11, 11, 14, 16, 14, 16,  6,  9, 14,  7, 10, 14, 11, 13, 15,  7,
-      10, 14,  9, 10, 13, 12, 12, 15, 10, 11, 14, 11, 11, 14, 14, 14,
-      16,  9, 11, 14, 10, 11, 14, 13, 14, 15,  9, 12, 14, 10, 12, 16,
-      13, 14, 16, 10, 13, 16, 12, 12, 14, 15, 14, 15,
-    },
-  },
-  {
-    {
-       0,  6, 12,  3,  7, 12,  9, 11, 13,  4,  7, 12,  6,  8, 12, 10,
-      11, 13,  8, 10, 13, 10, 11, 13, 13, 13, 14,  1,  6, 12,  4,  7,
-      12,  9, 10, 14,  4,  7, 12,  6,  7, 12, 10, 11, 13,  8,  9, 13,
-      10, 10, 12, 13, 13, 14,  6,  9, 13,  7,  9, 13, 10, 12, 14,  7,
-       9, 13,  8, 10, 13, 11, 11, 14,  9, 11, 13, 11, 11, 14, 13, 13,
-      14, 10, 12, 14, 10, 12, 14, 12, 13, 15, 10, 12, 14, 10, 12, 14,
-      12, 13, 15, 11, 13, 15, 12, 12, 15, 14, 14, 14,
-    },
-    {
-       0,  6, 16,  3,  8, 16, 10, 13, 16,  3,  8, 16,  7,  9, 16, 13,
-      16, 16,  8, 10, 16, 11, 13, 16, 16, 16, 16,  1,  7, 14,  4,  8,
-      16, 10, 12, 16,  4,  8, 13,  7,  9, 16, 13, 14, 16,  8, 10, 16,
-      11, 11, 14, 16, 16, 16,  6,  9, 14,  8, 10, 14, 12, 16, 16,  6,
-      10, 13,  9, 11, 16, 13, 14, 16,  9, 12, 16, 12, 11, 16, 16, 16,
-      16, 10, 12, 16, 11, 12, 16, 16, 14, 16,  9, 12, 16, 11, 12, 16,
-      16, 15, 16, 10, 13, 16, 12, 13, 16, 16, 16, 16,
-    },
-  },
-};
-
-static const uint8_t rv34_table_intra_thirdpat[NUM_INTRA_TABLES][2][OTHERBLK_VLC_SIZE] = {
-  {
-    {
-       0,  5, 10,  3,  6, 10,  7,  8, 10,  4,  7, 10,  6,  7, 10,  8,
-       8, 10,  8,  9, 10,  9,  9, 10,  9,  9,  9,  2,  6, 10,  4,  7,
-      10,  7,  8,  9,  5,  7, 10,  6,  7, 10,  8,  8,  9,  8,  9, 10,
-       8,  8,  9,  9,  9,  8,  6,  8, 11,  6,  8, 10,  7,  8, 10,  6,
-       8, 11,  7,  8, 10,  8,  8,  9,  8,  9, 10,  9,  9, 10,  9,  9,
-       9,  7,  8, 10,  7,  8, 10,  7,  8,  8,  7,  8, 10,  7,  8,  9,
-       7,  8,  8,  8,  8,  9,  8,  8,  8,  7,  7,  7,
-    },
-    {
-       0,  4, 10,  3,  6, 10,  7,  8, 11,  3,  6, 10,  5,  7, 10,  9,
-       9, 11,  9, 10, 11,  9, 10, 11, 11, 11, 11,  2,  6, 10,  4,  6,
-      10,  7,  8, 10,  4,  7, 10,  6,  7, 10,  8,  9, 10,  8,  9, 11,
-       9,  9, 11, 10, 10, 11,  6,  8, 11,  6,  8, 11,  8,  9, 11,  7,
-       9, 11,  7,  8, 11,  9,  9, 11,  9, 10, 12, 10, 10, 12, 11, 11,
-      11,  8,  9, 11,  8,  9, 11,  9,  9, 11,  9, 10, 11,  9, 10, 11,
-       9, 10, 11, 10, 11, 12, 10, 10, 12, 10, 10, 10,
-    },
-  },
-  {
-    {
-       0,  5, 10,  3,  6, 10,  7,  8, 10,  4,  7, 10,  6,  7, 10,  8,
-       9, 10,  8,  9, 11,  8,  9, 10, 10, 10, 10,  2,  6, 10,  4,  6,
-      10,  7,  8, 10,  4,  7, 10,  5,  7, 10,  8,  8, 10,  8,  9, 10,
-       8,  9, 10,  9,  9,  9,  5,  7, 11,  6,  8, 11,  7,  8, 11,  6,
-       8, 11,  7,  8, 10,  8,  9, 10,  8,  9, 11,  9,  9, 10, 10,  9,
-      10,  7,  8, 10,  7,  8, 10,  8,  9, 10,  8,  9, 10,  8,  9, 10,
-       8,  8, 10,  9,  9, 10,  9,  9, 10,  9,  9,  9,
-    },
-    {
-       0,  5, 11,  3,  6, 11,  8,  9, 12,  4,  7, 12,  6,  7, 12,  9,
-      10, 13, 10, 11, 13, 10, 11, 14, 12, 13, 14,  1,  6, 11,  4,  7,
-      11,  8,  9, 12,  5,  7, 11,  6,  8, 12,  9, 10, 13, 10, 11, 14,
-      10, 11, 13, 12, 12, 14,  6,  8, 12,  7,  9, 13,  9, 10, 14,  7,
-      10, 13,  8, 10, 12, 11, 11, 13, 11, 13, 14, 11, 12, 14, 13, 13,
-      15,  9, 10, 12,  9, 11, 14, 10, 11, 14, 11, 11, 13, 10, 11, 13,
-      11, 12, 14, 12, 14, 15, 13, 13, 14, 13, 13, 14,
-    },
-  },
-  {
-    {
-       0,  5, 11,  3,  6, 11,  7,  9, 11,  4,  6, 11,  5,  7, 10,  9,
-       9, 11,  8,  9, 11,  9, 10, 11, 11, 11, 11,  2,  6, 10,  3,  6,
-      10,  7,  9, 11,  4,  7, 10,  5,  7, 10,  8,  9, 11,  8,  9, 11,
-       9,  9, 11, 11, 11, 11,  5,  8, 11,  6,  8, 11,  8, 10, 12,  6,
-       8, 11,  7,  8, 11,  9, 10, 11,  9, 10, 12,  9, 10, 11, 11, 11,
-      11,  8,  9, 11,  8, 10, 12,  9, 11, 12,  8, 10, 12,  9, 10, 12,
-      10, 11, 12, 10, 11, 12, 10, 10, 11, 11, 11, 11,
-    },
-    {
-       0,  5, 13,  2,  7, 16,  9, 11, 16,  4,  8, 16,  7,  9, 16, 12,
-      12, 16, 12, 16, 16, 12, 16, 16, 16, 16, 16,  1,  6, 13,  4,  8,
-      16,  9, 11, 16,  6,  9, 16,  7, 10, 16, 13, 13, 16, 13, 15, 16,
-      12, 16, 16, 16, 16, 16,  7,  9, 16,  8, 11, 15, 11, 13, 16, 10,
-      12, 16, 10, 12, 16, 16, 13, 16, 16, 16, 16, 14, 16, 16, 16, 16,
-      16, 12, 12, 16, 12, 16, 16, 16, 16, 16, 13, 14, 16, 12, 13, 16,
-      16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16,
-    },
-  },
-  {
-    {
-       0,  6, 11,  3,  7, 11,  8, 10, 12,  4,  7, 11,  6,  8, 11, 10,
-      11, 12,  9, 10, 12, 10, 10, 12, 12, 12, 13,  1,  6, 11,  4,  7,
-      11,  8, 10, 12,  4,  7, 11,  6,  8, 11, 10, 10, 12,  9, 10, 12,
-      10, 10, 12, 13, 13, 13,  6,  8, 12,  7, 10, 12, 10, 12, 13,  7,
-       9, 12,  8, 10, 12, 11, 11, 13, 11, 12, 14, 11, 11, 13, 13, 13,
-      13,  9, 11, 13, 10, 12, 14, 12, 13, 15, 10, 12, 14, 11, 12, 14,
-      13, 13, 14, 12, 13, 15, 13, 13, 14, 14, 14, 14,
-    },
-    {
-       0,  5, 16,  2,  6, 16, 10, 14, 16,  4,  8, 16,  7,  9, 16, 11,
-      16, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16,  1,  6, 12,  4,  8,
-      12, 12, 12, 16,  6,  8, 16,  8, 10, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 12, 16, 16,  7, 10, 16,  8, 11, 14, 16, 16, 16, 10,
-      12, 16, 10, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-  },
-  {
-    {
-       0,  5, 11,  3,  6, 11, 10, 10, 12,  3,  7, 11,  6,  8, 11, 11,
-      11, 12, 10, 10, 12, 11, 11, 13, 14, 13, 14,  1,  6, 11,  4,  7,
-      11, 10, 11, 13,  5,  7, 11,  7,  8, 11, 11, 11, 13, 10, 11, 13,
-      11, 11, 12, 13, 13, 14,  7, 10, 12,  9, 11, 13, 12, 13, 14,  9,
-      10, 13,  9, 10, 13, 12, 11, 13, 12, 13, 16, 12, 13, 13, 14, 14,
-      14, 11, 14, 16, 12, 14, 15, 14, 13, 16, 13, 13, 15, 13, 14, 16,
-      14, 13, 16, 13, 13, 16, 13, 14, 15, 15, 14, 15,
-    },
-    {
-       0,  4, 16,  2,  7, 16, 10, 16, 16,  4, 10, 16,  7, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  1,  6, 13,  4, 11,
-      16, 16, 16, 16,  6, 10, 16,  8, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16,  8, 16, 16, 10, 16, 16, 16, 16, 16, 10,
-      16, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-  },
-};
-
-
-static const uint8_t rv34_intra_coeff[NUM_INTRA_TABLES][COEFF_VLC_SIZE] = {
-{
-  1,  3,  3,  4,  4,  5,  6,  6,  6,  7,  7,  7,  8,  8,  9,  9,
-  9,  9, 10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 13, 14, 15, 15,
-},
-{
-  1,  2,  3,  5,  5,  6,  6,  7,  7,  8,  8,  9, 10, 10, 10, 11,
- 11, 11, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 16, 16, 16, 16,
-},
-{
-  1,  2,  3,  4,  5,  6,  8,  8,  9,  9, 10, 10, 11, 12, 12, 12,
- 13, 13, 14, 14, 14, 14, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16,
-},
-{
-  1,  2,  3,  4,  5,  6,  8,  8,  9,  9, 10, 10, 11, 12, 12, 12,
- 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 14, 12, 16, 16, 16, 16,
-},
-{
-  1,  2,  3,  4,  5,  7,  7,  8,  8,  9, 10, 10, 12, 11, 13, 12,
- 15, 13, 14, 13, 12, 15, 14, 13, 12, 12, 10, 11, 16, 16, 16, 16,
-}
-};
-
-
-static const uint8_t rv34_inter_cbppat[NUM_INTER_TABLES][CBPPAT_VLC_SIZE] = {
-{
-  7,  9,  9,  8,  9,  8,  9,  8,  9,  9,  8,  8,  8,  8,  8,  4,
-  7, 10, 11, 10, 11, 10, 12, 10, 12, 11, 11, 10, 11, 10, 10,  7,
- 10, 11, 15, 12, 15, 12, 15, 12, 15, 14, 14, 12, 14, 12, 14,  9,
-  7, 11, 10, 10, 12, 11, 11, 10, 11, 12, 10, 10, 11, 10, 10,  7,
-  8, 12, 12, 11, 13, 12, 12, 10, 13, 13, 12, 10, 12, 11, 11,  7,
- 11, 13, 15, 11, 15, 13, 15, 12, 16, 14, 14, 12, 15, 13, 13,  9,
- 10, 15, 11, 12, 15, 14, 14, 12, 15, 15, 12, 12, 14, 14, 12,  9,
- 11, 15, 13, 12, 16, 15, 14, 12, 15, 15, 13, 12, 15, 14, 13,  9,
- 13, 15, 14, 10, 16, 15, 16, 11, 16, 16, 15, 12, 16, 15, 15,  9,
-  7, 11, 11, 11, 11, 10, 11, 10, 11, 12, 11, 10, 10, 10, 10,  7,
-  9, 12, 13, 12, 12, 11, 13, 10, 13, 13, 12, 11, 12, 10, 11,  7,
- 12, 13, 16, 14, 15, 12, 16, 12, 16, 15, 15, 13, 15, 12, 14,  9,
-  9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11,  7,
-  9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 13, 11, 12, 11, 11,  7,
- 12, 14, 15, 13, 16, 13, 15, 11, 16, 14, 15, 12, 15, 12, 13,  8,
- 12, 16, 14, 14, 16, 15, 15, 13, 16, 15, 14, 13, 15, 14, 13,  9,
- 12, 15, 14, 13, 15, 14, 15, 12, 16, 15, 14, 12, 14, 13, 13,  8,
- 13, 16, 16, 12, 16, 14, 16, 11, 16, 16, 15, 12, 16, 14, 14,  8,
- 10, 15, 15, 15, 12, 12, 14, 12, 14, 15, 15, 14, 12, 12, 13,  9,
- 11, 15, 16, 14, 13, 12, 15, 12, 16, 15, 15, 14, 14, 12, 13,  9,
- 14, 15, 16, 16, 15, 11, 16, 12, 16, 16, 16, 15, 16, 12, 15,  9,
- 12, 16, 16, 15, 14, 14, 14, 13, 16, 16, 15, 14, 14, 13, 13,  9,
- 12, 15, 15, 14, 14, 13, 15, 12, 16, 15, 14, 13, 14, 13, 13,  8,
- 13, 16, 16, 15, 16, 12, 16, 11, 16, 16, 16, 14, 16, 13, 14,  8,
- 14, 16, 16, 16, 16, 16, 15, 14, 16, 16, 16, 15, 16, 15, 14, 11,
- 13, 16, 16, 15, 16, 15, 15, 12, 16, 16, 16, 14, 15, 14, 14,  9,
- 14, 16, 16, 13, 16, 14, 16, 10, 16, 16, 16, 13, 16, 14, 14,  8,
-  7, 12, 11, 11, 11, 11, 12, 10, 11, 11, 10, 10, 10, 10, 10,  7,
-  9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11,  8,
- 12, 14, 16, 14, 16, 14, 16, 13, 16, 14, 15, 13, 15, 13, 14,  9,
-  9, 13, 12, 12, 13, 12, 13, 11, 12, 13, 11, 10, 12, 11, 11,  7,
-  9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11,  7,
- 12, 14, 16, 13, 16, 14, 15, 12, 15, 15, 14, 12, 15, 13, 13,  8,
- 11, 15, 13, 14, 15, 15, 14, 13, 15, 15, 12, 12, 14, 14, 12,  9,
- 11, 15, 14, 13, 15, 14, 14, 12, 15, 14, 13, 11, 14, 13, 12,  8,
- 13, 16, 15, 12, 16, 15, 16, 12, 16, 16, 14, 11, 15, 14, 14,  8,
-  8, 13, 13, 12, 12, 12, 13, 11, 12, 13, 12, 11, 11, 10, 10,  7,
-  9, 13, 14, 12, 13, 12, 13, 11, 13, 13, 13, 11, 12, 11, 11,  7,
- 12, 14, 16, 14, 15, 13, 15, 12, 15, 15, 15, 13, 14, 12, 13,  8,
-  9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11,  7,
-  9, 13, 12, 12, 13, 12, 12, 10, 13, 13, 12, 10, 12, 10, 10,  6,
- 11, 14, 14, 12, 14, 12, 14, 11, 14, 14, 13, 11, 13, 11, 12,  7,
- 12, 16, 14, 14, 15, 15, 14, 13, 15, 15, 13, 12, 14, 13, 12,  8,
- 11, 14, 13, 12, 14, 13, 13, 11, 14, 14, 13, 11, 13, 12, 11,  7,
- 11, 14, 14, 12, 15, 13, 14, 11, 15, 14, 13, 11, 14, 12, 12,  6,
- 11, 16, 15, 15, 13, 14, 15, 13, 14, 15, 15, 13, 12, 12, 12,  9,
- 12, 15, 15, 14, 14, 13, 15, 12, 15, 15, 14, 13, 13, 11, 12,  8,
- 13, 16, 16, 15, 16, 13, 16, 13, 16, 16, 15, 14, 14, 12, 14,  8,
- 11, 16, 15, 14, 14, 14, 14, 13, 15, 15, 14, 13, 13, 12, 12,  8,
- 11, 14, 14, 13, 13, 12, 14, 11, 14, 14, 13, 12, 12, 11, 11,  7,
- 12, 14, 15, 13, 14, 12, 14, 11, 15, 14, 14, 12, 13, 11, 12,  7,
- 13, 16, 16, 16, 16, 15, 16, 14, 16, 16, 15, 14, 15, 14, 13,  9,
- 12, 15, 14, 13, 15, 13, 14, 12, 15, 15, 13, 12, 13, 12, 12,  7,
- 11, 15, 14, 12, 14, 13, 14, 10, 15, 14, 13, 11, 13, 11, 11,  5,
- 10, 15, 15, 15, 15, 14, 15, 13, 12, 14, 12, 12, 12, 13, 12,  9,
- 12, 16, 16, 15, 16, 15, 16, 14, 14, 15, 14, 13, 14, 13, 13,  9,
- 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 16, 14, 15, 11,
- 11, 15, 15, 14, 15, 15, 15, 14, 14, 15, 12, 12, 13, 13, 12,  9,
- 12, 15, 15, 14, 16, 14, 15, 13, 14, 14, 13, 12, 14, 13, 12,  8,
- 13, 16, 16, 15, 16, 16, 16, 14, 16, 16, 15, 12, 16, 14, 14,  9,
- 13, 16, 14, 16, 16, 16, 16, 15, 15, 16, 11, 12, 16, 15, 12,  9,
- 13, 16, 15, 14, 16, 15, 16, 14, 15, 16, 12, 11, 15, 14, 13,  8,
- 13, 16, 16, 13, 16, 16, 16, 13, 16, 16, 13, 11, 16, 14, 14,  8,
- 11, 15, 15, 15, 14, 14, 15, 13, 13, 15, 14, 13, 12, 12, 12,  9,
- 11, 15, 16, 14, 15, 14, 15, 13, 14, 14, 14, 13, 13, 12, 13,  8,
- 13, 16, 16, 16, 16, 15, 16, 14, 16, 16, 16, 13, 15, 12, 14,  9,
- 11, 16, 15, 14, 14, 14, 15, 13, 14, 14, 13, 12, 13, 12, 11,  8,
- 11, 14, 14, 13, 14, 13, 14, 12, 13, 13, 12, 11, 12, 11, 11,  7,
- 12, 15, 15, 13, 15, 14, 15, 12, 15, 14, 14, 11, 13, 12, 12,  7,
- 13, 16, 15, 15, 16, 16, 16, 14, 15, 16, 12, 12, 14, 14, 12,  8,
- 11, 15, 14, 13, 15, 13, 14, 12, 14, 14, 12, 11, 13, 12, 11,  6,
- 11, 14, 14, 12, 15, 13, 14, 11, 15, 14, 12, 10, 13, 11, 11,  5,
- 12, 16, 16, 16, 15, 15, 16, 15, 14, 16, 15, 15, 10, 12, 12,  9,
- 13, 16, 16, 16, 15, 14, 16, 13, 15, 15, 15, 14, 12, 11, 13,  8,
- 14, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 14, 14, 11, 14,  8,
- 13, 16, 16, 15, 15, 15, 15, 14, 15, 16, 14, 13, 12, 12, 11,  8,
- 11, 15, 15, 13, 14, 13, 14, 12, 14, 14, 13, 12, 12, 11, 11,  6,
- 11, 15, 15, 13, 15, 12, 14, 11, 14, 14, 13, 11, 12, 10, 11,  5,
- 13, 16, 16, 15, 16, 16, 16, 14, 16, 16, 14, 14, 14, 13, 11,  8,
- 11, 14, 14, 13, 14, 13, 14, 11, 14, 14, 12, 11, 12, 11, 10,  5,
- 10, 13, 13, 11, 13, 12, 13,  9, 13, 13, 12,  9, 12, 10, 10,  3,
-},
-{
-  5,  7,  7,  7,  7,  7,  8,  7,  7,  8,  7,  7,  7,  7,  7,  4,
-  7,  9, 11,  9, 11,  9, 11,  9, 11, 10, 10,  9, 10,  9, 10,  6,
- 11, 11, 14, 11, 14, 11, 14, 11, 15, 13, 14, 12, 14, 12, 13,  9,
-  6, 11, 10,  9, 11, 10, 11,  9, 11, 11,  9,  9, 10, 10,  9,  6,
-  8, 11, 11, 10, 12, 11, 12, 10, 12, 12, 11, 10, 12, 11, 11,  7,
- 11, 13, 14, 11, 15, 13, 15, 11, 15, 14, 14, 12, 14, 13, 13,  9,
- 10, 14, 11, 11, 15, 14, 13, 12, 14, 14, 11, 11, 14, 13, 12,  9,
- 11, 14, 13, 11, 15, 14, 14, 11, 15, 15, 13, 11, 14, 14, 13,  9,
- 12, 14, 14, 10, 16, 15, 16, 11, 16, 16, 15, 11, 16, 15, 14,  9,
-  6, 10, 11, 10, 10,  9, 11,  9, 10, 11, 10, 10,  9,  9,  9,  6,
-  9, 12, 12, 11, 12, 10, 12, 10, 12, 12, 12, 11, 11, 10, 11,  7,
- 12, 13, 15, 13, 14, 11, 15, 11, 15, 15, 14, 13, 14, 12, 14,  9,
-  9, 12, 12, 11, 12, 11, 12, 11, 12, 13, 11, 11, 12, 11, 11,  7,
-  9, 12, 12, 11, 13, 11, 12, 10, 13, 13, 12, 11, 12, 11, 11,  7,
- 12, 14, 15, 12, 15, 12, 14, 11, 15, 15, 14, 12, 14, 13, 13,  8,
- 12, 15, 14, 13, 15, 14, 14, 13, 16, 16, 14, 13, 15, 14, 13,  9,
- 12, 15, 14, 13, 15, 14, 14, 12, 15, 15, 13, 12, 14, 13, 13,  9,
- 13, 15, 15, 12, 16, 14, 15, 11, 16, 16, 15, 12, 15, 14, 14,  9,
- 10, 14, 14, 14, 12, 11, 13, 12, 14, 15, 14, 13, 12, 11, 12,  9,
- 12, 14, 15, 14, 13, 11, 14, 12, 15, 15, 15, 14, 13, 11, 13,  9,
- 13, 15, 16, 15, 14, 11, 16, 11, 16, 16, 16, 14, 15, 12, 15,  9,
- 12, 15, 15, 14, 14, 14, 14, 13, 15, 15, 14, 14, 14, 13, 13,  9,
- 12, 15, 15, 14, 14, 13, 14, 12, 15, 15, 14, 13, 14, 13, 13,  9,
- 13, 15, 16, 14, 15, 13, 16, 11, 16, 16, 15, 14, 15, 13, 14,  9,
- 14, 16, 16, 16, 16, 16, 15, 14, 16, 16, 16, 16, 16, 16, 14, 11,
- 14, 16, 16, 14, 16, 15, 15, 12, 16, 16, 16, 14, 15, 14, 14,  9,
- 14, 16, 16, 14, 16, 14, 16, 11, 16, 16, 16, 14, 16, 14, 14,  9,
-  6, 11, 10, 10, 10, 10, 11, 10, 10, 11,  9,  9,  9,  9,  9,  6,
-  9, 12, 12, 11, 13, 11, 13, 11, 12, 12, 11, 11, 12, 11, 11,  7,
- 12, 14, 16, 13, 16, 14, 16, 13, 15, 14, 15, 12, 15, 13, 14,  9,
-  8, 12, 11, 11, 12, 12, 12, 11, 11, 12, 10, 10, 11, 11, 10,  7,
-  9, 12, 12, 11, 13, 12, 13, 11, 13, 12, 11, 10, 12, 11, 11,  7,
- 12, 14, 15, 12, 15, 14, 15, 12, 15, 14, 14, 12, 14, 13, 13,  9,
- 11, 15, 13, 13, 15, 14, 14, 13, 14, 15, 11, 11, 14, 14, 12,  9,
- 11, 14, 13, 12, 15, 14, 14, 12, 14, 14, 12, 11, 14, 13, 12,  8,
- 13, 15, 15, 12, 16, 15, 15, 12, 15, 15, 14, 11, 15, 14, 14,  8,
-  8, 12, 12, 11, 11, 11, 12, 11, 11, 12, 11, 11, 10, 10, 10,  7,
-  9, 13, 13, 12, 13, 11, 13, 11, 12, 13, 12, 11, 11, 10, 11,  7,
- 12, 14, 15, 14, 15, 13, 15, 12, 15, 14, 14, 13, 14, 12, 13,  9,
-  9, 13, 12, 12, 12, 12, 12, 11, 12, 13, 11, 11, 11, 11, 10,  7,
-  9, 12, 12, 11, 12, 11, 12, 10, 12, 12, 11, 10, 11, 10, 10,  7,
- 11, 13, 14, 12, 14, 12, 14, 11, 14, 13, 13, 11, 13, 11, 12,  7,
- 12, 15, 14, 13, 15, 14, 14, 13, 15, 15, 13, 12, 13, 13, 12,  9,
- 11, 14, 13, 12, 14, 13, 13, 11, 14, 14, 12, 11, 13, 12, 11,  7,
- 11, 14, 14, 12, 14, 13, 14, 11, 14, 14, 13, 11, 13, 12, 12,  7,
- 11, 15, 15, 14, 13, 13, 14, 13, 14, 15, 14, 13, 11, 11, 12,  9,
- 12, 15, 15, 14, 14, 12, 14, 12, 14, 14, 14, 13, 12, 11, 12,  8,
- 13, 16, 16, 15, 15, 12, 16, 13, 16, 15, 15, 14, 14, 12, 14,  9,
- 12, 15, 15, 14, 14, 14, 14, 13, 15, 15, 14, 13, 12, 12, 12,  9,
- 11, 14, 14, 13, 13, 12, 13, 11, 14, 13, 13, 12, 12, 11, 11,  7,
- 12, 14, 15, 13, 14, 12, 14, 11, 15, 14, 13, 12, 13, 11, 12,  7,
- 13, 16, 16, 15, 16, 15, 15, 14, 16, 16, 15, 14, 14, 14, 12,  9,
- 12, 15, 14, 13, 14, 13, 14, 12, 15, 14, 13, 12, 13, 12, 12,  8,
- 12, 14, 14, 13, 15, 13, 14, 11, 14, 14, 13, 12, 13, 12, 12,  6,
- 10, 14, 14, 13, 14, 14, 14, 13, 12, 13, 12, 12, 12, 12, 11,  9,
- 12, 15, 15, 14, 15, 14, 16, 14, 14, 14, 13, 12, 14, 13, 13,  9,
- 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 16, 14, 16, 11,
- 11, 15, 14, 14, 15, 14, 14, 14, 13, 14, 11, 12, 13, 13, 12,  9,
- 12, 15, 14, 14, 15, 14, 15, 13, 14, 14, 13, 12, 14, 13, 13,  9,
- 13, 16, 16, 14, 16, 15, 16, 14, 16, 15, 15, 12, 16, 14, 14,  9,
- 13, 16, 14, 15, 16, 16, 16, 14, 14, 16, 11, 12, 15, 14, 12,  9,
- 13, 16, 15, 14, 16, 15, 16, 14, 15, 15, 12, 11, 15, 14, 13,  9,
- 14, 16, 16, 13, 16, 16, 16, 14, 16, 15, 13, 11, 16, 14, 14,  9,
- 11, 15, 15, 14, 14, 14, 14, 13, 13, 14, 13, 13, 11, 11, 11,  9,
- 12, 15, 15, 14, 15, 14, 15, 13, 14, 14, 13, 13, 13, 12, 12,  9,
- 13, 16, 16, 16, 16, 14, 16, 14, 16, 15, 16, 14, 15, 12, 14,  9,
- 11, 15, 14, 14, 15, 14, 14, 13, 14, 14, 12, 12, 12, 12, 11,  8,
- 11, 14, 14, 13, 14, 13, 13, 12, 13, 13, 12, 11, 12, 11, 11,  7,
- 12, 14, 15, 13, 15, 13, 14, 13, 14, 14, 13, 12, 13, 12, 12,  8,
- 13, 16, 15, 15, 16, 15, 15, 14, 15, 16, 12, 12, 14, 14, 11,  9,
- 12, 15, 14, 13, 15, 13, 14, 12, 14, 14, 12, 11, 13, 12, 11,  7,
- 12, 14, 14, 13, 15, 13, 14, 12, 15, 14, 13, 10, 13, 12, 12,  6,
- 12, 16, 16, 15, 14, 14, 15, 14, 13, 15, 14, 14, 10, 11, 11,  9,
- 13, 16, 16, 15, 15, 14, 15, 14, 15, 15, 15, 14, 12, 11, 12,  8,
- 14, 16, 16, 16, 16, 14, 16, 14, 16, 15, 15, 14, 14, 11, 14,  8,
- 12, 16, 16, 15, 15, 14, 15, 14, 14, 16, 14, 14, 12, 12, 11,  8,
- 11, 14, 14, 13, 14, 13, 14, 12, 14, 14, 13, 12, 12, 11, 11,  7,
- 12, 14, 15, 13, 14, 13, 14, 12, 14, 14, 13, 12, 13, 11, 12,  6,
- 14, 16, 16, 16, 16, 16, 15, 14, 16, 16, 14, 13, 13, 13, 11,  8,
- 12, 15, 15, 13, 15, 13, 14, 12, 14, 14, 13, 12, 13, 12, 10,  6,
- 11, 14, 13, 12, 14, 12, 13, 10, 14, 13, 12, 10, 12, 10, 10,  4,
-},
-{
-  4,  6,  6,  6,  6,  6,  7,  6,  6,  7,  6,  6,  6,  6,  6,  3,
-  6,  9, 10,  9, 10,  9, 11,  9, 10, 10, 10,  9, 10,  9, 10,  6,
- 10, 11, 14, 11, 14, 11, 14, 11, 14, 13, 14, 11, 14, 11, 13,  9,
-  6, 10,  9,  9, 10, 10, 10,  9, 10, 11,  9,  9, 10, 10,  9,  6,
-  8, 11, 11,  9, 12, 11, 12, 10, 12, 12, 11, 10, 12, 11, 11,  7,
- 11, 13, 14, 11, 15, 13, 15, 11, 15, 14, 14, 11, 15, 13, 14,  9,
- 10, 13, 11, 11, 14, 14, 13, 11, 14, 14, 11, 11, 13, 13, 11,  9,
- 11, 14, 12, 11, 15, 14, 14, 11, 15, 15, 13, 11, 14, 14, 13,  9,
- 12, 14, 13, 10, 16, 15, 16, 11, 16, 16, 14, 11, 16, 14, 14,  9,
-  6, 10, 10, 10,  9,  9, 10,  9, 10, 11, 10, 10,  9,  9,  9,  6,
-  8, 11, 12, 11, 11, 10, 12, 10, 12, 12, 12, 11, 11, 10, 11,  7,
- 11, 13, 15, 13, 14, 11, 15, 11, 15, 14, 14, 13, 14, 12, 14,  9,
-  8, 12, 12, 12, 12, 12, 12, 11, 12, 13, 11, 11, 11, 11, 11,  8,
-  9, 12, 12, 11, 12, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11,  8,
- 11, 14, 15, 13, 14, 13, 15, 11, 15, 15, 14, 13, 15, 13, 14,  9,
- 12, 16, 14, 14, 15, 15, 14, 12, 15, 16, 14, 13, 14, 14, 13, 10,
- 11, 15, 14, 13, 15, 14, 15, 12, 15, 16, 14, 13, 15, 14, 13,  9,
- 13, 15, 15, 12, 16, 15, 16, 12, 16, 16, 15, 13, 15, 14, 14,  9,
- 10, 14, 14, 14, 11, 11, 13, 11, 14, 14, 14, 13, 11, 11, 11,  9,
- 11, 14, 15, 14, 13, 11, 14, 12, 15, 15, 15, 14, 13, 11, 13,  9,
- 13, 14, 16, 15, 14, 11, 16, 12, 16, 16, 16, 14, 15, 12, 15, 10,
- 12, 16, 15, 15, 14, 14, 14, 12, 16, 16, 14, 14, 14, 13, 13, 10,
- 12, 15, 15, 14, 14, 13, 14, 12, 15, 16, 14, 14, 14, 13, 13,  9,
- 13, 16, 16, 14, 16, 13, 16, 12, 16, 16, 16, 14, 16, 13, 15, 10,
- 14, 16, 16, 16, 16, 16, 15, 14, 16, 16, 16, 16, 16, 16, 14, 11,
- 13, 16, 16, 15, 16, 16, 16, 13, 16, 16, 16, 15, 16, 15, 14, 10,
- 14, 16, 16, 14, 16, 14, 16, 12, 16, 16, 16, 15, 16, 15, 15, 10,
-  6, 10, 10, 10, 10, 10, 11, 10,  9, 10,  9,  9,  9,  9,  9,  6,
-  9, 12, 12, 11, 12, 11, 13, 11, 12, 12, 11, 10, 12, 11, 11,  8,
- 12, 14, 15, 14, 15, 14, 16, 13, 15, 14, 14, 12, 15, 13, 14, 10,
-  8, 12, 11, 11, 12, 12, 12, 11, 11, 12, 10, 10, 11, 11, 10,  7,
-  9, 12, 12, 11, 13, 12, 13, 11, 12, 13, 11, 10, 12, 12, 11,  8,
- 11, 14, 14, 13, 15, 14, 15, 13, 15, 14, 14, 12, 15, 13, 14,  9,
- 11, 15, 12, 13, 15, 15, 14, 13, 14, 15, 11, 11, 14, 14, 12,  9,
- 11, 14, 13, 13, 15, 14, 15, 13, 15, 15, 13, 11, 15, 14, 13,  9,
- 13, 15, 15, 12, 16, 15, 16, 13, 16, 15, 14, 11, 16, 15, 14,  9,
-  8, 12, 12, 11, 11, 11, 12, 11, 11, 12, 11, 11,  9, 10, 10,  7,
-  9, 12, 13, 12, 12, 11, 13, 11, 12, 13, 12, 12, 11, 11, 11,  8,
- 12, 14, 15, 14, 15, 13, 16, 13, 15, 14, 15, 13, 14, 12, 14,  9,
-  9, 13, 12, 12, 12, 12, 13, 12, 12, 13, 11, 11, 11, 11, 10,  8,
-  9, 12, 12, 12, 12, 12, 13, 11, 12, 13, 11, 11, 12, 11, 11,  7,
- 11, 13, 14, 13, 14, 13, 15, 12, 14, 14, 14, 12, 14, 12, 13,  8,
- 12, 15, 14, 14, 15, 15, 14, 13, 15, 16, 13, 13, 14, 14, 12,  9,
- 11, 14, 13, 13, 14, 14, 14, 12, 14, 15, 13, 12, 14, 13, 12,  8,
- 11, 14, 14, 13, 15, 14, 15, 12, 15, 15, 14, 12, 14, 13, 13,  8,
- 11, 14, 14, 14, 13, 13, 14, 13, 13, 14, 14, 13, 11, 11, 11,  9,
- 11, 15, 15, 14, 14, 13, 15, 13, 14, 15, 14, 14, 13, 11, 13,  9,
- 13, 16, 16, 16, 15, 13, 16, 13, 16, 16, 16, 15, 15, 12, 15, 10,
- 11, 15, 15, 15, 14, 14, 14, 13, 15, 15, 14, 14, 13, 13, 12,  9,
- 11, 14, 14, 13, 13, 13, 14, 12, 14, 14, 13, 13, 13, 12, 12,  8,
- 12, 15, 15, 14, 15, 13, 15, 12, 15, 15, 14, 13, 14, 12, 13,  8,
- 13, 16, 16, 16, 16, 16, 16, 14, 16, 16, 15, 15, 15, 15, 13, 10,
- 12, 15, 15, 14, 15, 14, 15, 13, 15, 16, 14, 13, 14, 14, 13,  9,
- 12, 15, 15, 14, 15, 14, 15, 12, 15, 15, 14, 13, 14, 13, 13,  8,
- 10, 14, 13, 13, 14, 13, 14, 13, 11, 13, 11, 11, 11, 11, 11,  9,
- 12, 15, 16, 14, 15, 14, 16, 14, 14, 14, 14, 13, 14, 13, 13, 10,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 13, 16, 14, 16, 11,
- 11, 15, 14, 14, 15, 14, 15, 14, 13, 14, 11, 12, 13, 13, 11,  9,
- 12, 15, 15, 14, 15, 15, 16, 14, 14, 14, 13, 12, 14, 13, 13,  9,
- 13, 16, 16, 15, 16, 16, 16, 15, 16, 15, 15, 12, 16, 14, 15, 10,
- 12, 16, 14, 15, 16, 16, 16, 14, 14, 16, 11, 12, 14, 15, 12,  9,
- 13, 16, 15, 14, 16, 16, 16, 14, 15, 16, 13, 12, 15, 15, 13,  9,
- 14, 16, 16, 14, 16, 16, 16, 15, 16, 16, 14, 12, 16, 15, 15, 10,
- 11, 14, 14, 14, 14, 14, 14, 13, 12, 14, 13, 13, 11, 11, 11,  9,
- 11, 15, 15, 14, 14, 14, 16, 14, 14, 14, 14, 13, 13, 12, 13,  9,
- 13, 16, 16, 16, 16, 15, 16, 15, 16, 15, 16, 14, 15, 13, 15, 10,
- 11, 15, 15, 14, 14, 14, 15, 14, 14, 15, 13, 13, 12, 13, 11,  9,
- 11, 14, 14, 13, 14, 14, 14, 13, 13, 14, 13, 12, 13, 12, 12,  8,
- 12, 15, 15, 14, 16, 14, 16, 14, 15, 15, 15, 13, 14, 13, 14,  9,
- 13, 16, 15, 16, 16, 16, 16, 15, 15, 16, 13, 13, 14, 14, 12,  9,
- 12, 15, 14, 14, 15, 15, 15, 13, 14, 15, 13, 12, 14, 13, 12,  8,
- 12, 15, 14, 14, 15, 15, 15, 13, 15, 15, 14, 12, 14, 13, 13,  8,
- 12, 16, 15, 15, 13, 14, 15, 14, 13, 15, 14, 14, 10, 11, 11,  9,
- 12, 16, 16, 15, 15, 14, 16, 14, 15, 15, 15, 14, 13, 12, 13,  9,
- 14, 16, 16, 16, 16, 14, 16, 15, 16, 15, 16, 15, 14, 12, 15, 10,
- 12, 16, 15, 15, 15, 15, 15, 14, 15, 16, 14, 14, 12, 13, 11,  9,
- 11, 15, 15, 14, 14, 14, 15, 13, 14, 15, 14, 13, 13, 12, 12,  8,
- 12, 15, 15, 14, 15, 14, 15, 13, 15, 15, 14, 13, 14, 12, 13,  8,
- 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 14, 14, 14, 14, 11,  9,
- 12, 15, 15, 14, 15, 15, 15, 13, 15, 15, 14, 13, 14, 13, 12,  8,
- 11, 14, 14, 13, 14, 13, 14, 12, 13, 14, 13, 12, 13, 12, 12,  7,
-},
-{
-  2,  6,  6,  5,  6,  6,  7,  6,  6,  7,  6,  6,  6,  6,  6,  3,
-  6,  9, 10,  9, 10,  9, 11,  9, 10, 10, 10,  9, 10,  9, 10,  7,
- 10, 11, 14, 11, 14, 11, 14, 11, 14, 13, 14, 12, 14, 12, 13,  9,
-  6, 10,  9,  9, 10, 10, 10,  9, 10, 11,  9,  9, 10, 10,  9,  7,
-  8, 11, 11,  9, 12, 11, 12, 10, 12, 12, 11, 10, 12, 11, 11,  8,
- 11, 13, 14, 11, 16, 13, 15, 12, 16, 14, 14, 12, 15, 13, 14, 10,
- 10, 13, 11, 11, 14, 14, 13, 11, 13, 14, 11, 11, 13, 13, 11,  9,
- 11, 13, 13, 11, 15, 14, 14, 12, 15, 15, 13, 12, 15, 14, 13, 10,
- 12, 14, 14, 11, 16, 15, 16, 12, 16, 16, 15, 12, 16, 15, 15, 10,
-  6, 10, 10, 10,  9,  9, 10,  9, 10, 11, 10, 10,  9,  9,  9,  7,
-  8, 11, 12, 11, 11, 10, 12, 10, 12, 12, 12, 11, 11, 10, 11,  8,
- 12, 13, 16, 13, 14, 11, 16, 12, 16, 15, 15, 13, 14, 12, 14, 10,
-  9, 13, 12, 12, 12, 12, 12, 11, 13, 13, 12, 12, 12, 12, 11,  8,
- 10, 13, 13, 12, 13, 12, 13, 11, 14, 14, 13, 12, 13, 12, 12,  9,
- 12, 14, 16, 13, 15, 13, 15, 12, 16, 16, 16, 13, 16, 14, 14, 10,
- 12, 16, 14, 14, 16, 15, 14, 13, 16, 16, 14, 14, 15, 15, 13, 11,
- 12, 16, 15, 14, 16, 15, 15, 12, 16, 16, 15, 14, 16, 15, 14, 10,
- 14, 16, 16, 14, 16, 15, 16, 13, 16, 16, 16, 14, 16, 16, 15, 11,
- 10, 14, 14, 13, 11, 11, 13, 12, 14, 14, 13, 13, 11, 11, 12,  9,
- 12, 14, 16, 14, 13, 11, 14, 12, 16, 15, 15, 14, 14, 12, 13, 10,
- 13, 14, 16, 15, 14, 11, 16, 12, 16, 16, 16, 15, 16, 13, 15, 11,
- 12, 16, 15, 15, 14, 14, 14, 13, 16, 16, 15, 15, 14, 14, 13, 11,
- 13, 16, 16, 15, 14, 14, 15, 13, 16, 16, 16, 15, 15, 14, 14, 11,
- 14, 16, 16, 15, 16, 14, 16, 13, 16, 16, 16, 15, 16, 14, 15, 11,
- 15, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14, 12,
- 15, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 15, 12,
- 15, 16, 16, 15, 16, 15, 16, 13, 16, 16, 16, 16, 16, 16, 16, 11,
-  6, 10, 10, 10, 10, 10, 11, 10,  9, 10,  9,  9,  9,  9,  9,  7,
-  9, 12, 13, 12, 13, 12, 14, 12, 12, 12, 12, 11, 12, 11, 11,  8,
- 12, 14, 16, 14, 16, 14, 16, 14, 15, 14, 15, 13, 16, 13, 14, 11,
-  8, 12, 11, 11, 12, 12, 12, 11, 11, 12, 10, 10, 11, 11, 10,  8,
- 10, 13, 13, 12, 14, 13, 14, 12, 13, 13, 12, 11, 13, 12, 12,  9,
- 12, 15, 15, 13, 16, 15, 16, 14, 16, 15, 15, 12, 16, 14, 15, 10,
- 11, 15, 13, 13, 16, 15, 14, 13, 14, 15, 11, 12, 14, 14, 12, 10,
- 12, 16, 14, 13, 16, 16, 16, 14, 16, 15, 13, 12, 15, 15, 14, 10,
- 14, 16, 16, 14, 16, 16, 16, 14, 16, 16, 15, 13, 16, 16, 15, 11,
-  8, 12, 12, 12, 11, 11, 12, 11, 11, 12, 11, 11,  9, 10, 10,  8,
- 10, 13, 14, 13, 13, 12, 14, 12, 13, 13, 13, 12, 12, 11, 12,  9,
- 13, 15, 16, 15, 16, 14, 16, 14, 16, 15, 16, 14, 15, 13, 15, 11,
- 10, 13, 13, 13, 13, 13, 13, 12, 13, 14, 12, 12, 12, 12, 11,  9,
- 10, 13, 13, 13, 13, 13, 14, 12, 13, 14, 13, 12, 12, 12, 12,  9,
- 12, 15, 15, 14, 16, 14, 16, 13, 16, 15, 15, 13, 15, 13, 14, 10,
- 13, 16, 15, 15, 16, 16, 15, 14, 16, 16, 13, 14, 15, 15, 12, 10,
- 12, 16, 14, 14, 16, 16, 15, 13, 16, 16, 14, 13, 15, 14, 13, 10,
- 13, 16, 16, 14, 16, 15, 16, 13, 16, 16, 16, 13, 16, 15, 15, 10,
- 11, 15, 15, 14, 13, 13, 14, 13, 13, 15, 14, 14, 11, 12, 12, 10,
- 12, 15, 16, 15, 14, 13, 16, 14, 16, 15, 16, 14, 13, 12, 13, 10,
- 14, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 16, 13, 16, 11,
- 12, 16, 16, 16, 15, 15, 15, 14, 15, 16, 14, 14, 13, 14, 12, 10,
- 12, 16, 16, 15, 15, 14, 16, 13, 16, 16, 15, 14, 14, 13, 13, 10,
- 13, 16, 16, 15, 16, 14, 16, 13, 16, 16, 16, 15, 16, 14, 15, 10,
- 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 13, 12,
- 14, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 15, 16, 15, 14, 11,
- 14, 16, 16, 15, 16, 16, 16, 13, 16, 16, 16, 15, 16, 15, 14, 10,
- 10, 14, 13, 13, 13, 13, 14, 13, 11, 13, 11, 11, 11, 11, 11,  9,
- 12, 15, 16, 15, 16, 15, 16, 14, 14, 14, 14, 13, 14, 13, 14, 11,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 14, 16, 12,
- 11, 15, 14, 14, 15, 15, 15, 14, 13, 14, 11, 12, 13, 13, 12, 10,
- 13, 16, 15, 15, 16, 16, 16, 15, 15, 15, 13, 12, 15, 14, 13, 10,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 12,
- 13, 16, 14, 15, 16, 16, 16, 15, 14, 16, 11, 12, 15, 15, 12, 10,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 16, 16, 14, 11,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 11,
- 11, 15, 15, 14, 13, 14, 14, 14, 13, 14, 13, 13, 11, 12, 11, 10,
- 12, 16, 16, 16, 16, 15, 16, 15, 15, 15, 15, 14, 13, 12, 14, 10,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 14, 16, 12,
- 12, 16, 15, 15, 16, 16, 16, 14, 14, 15, 13, 13, 13, 13, 12, 10,
- 12, 16, 16, 15, 15, 15, 16, 14, 14, 15, 14, 13, 14, 13, 13, 10,
- 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 16, 14, 15, 11,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 15, 15, 12, 11,
- 13, 16, 16, 15, 16, 16, 16, 14, 16, 16, 14, 13, 16, 14, 13, 10,
- 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 16, 14, 15, 10,
- 12, 16, 16, 15, 14, 15, 16, 14, 13, 15, 14, 14, 11, 12, 12, 10,
- 13, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 15, 13, 12, 14, 11,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 11,
- 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 15, 15, 13, 14, 12, 11,
- 13, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 14, 13, 13, 10,
- 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 15, 15, 14, 14, 10,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 15, 16, 13, 11,
- 14, 16, 16, 16, 16, 16, 16, 14, 16, 16, 15, 14, 15, 14, 13, 10,
- 12, 15, 15, 14, 15, 14, 16, 14, 14, 16, 15, 13, 14, 13, 13,  9,
-},
-{
-  2,  5,  5,  5,  5,  5,  6,  6,  5,  6,  5,  6,  5,  6,  6,  4,
-  6,  8, 10,  8, 10,  9, 11,  9, 10, 10, 10,  9, 10,  9, 10,  8,
- 10, 11, 13, 11, 13, 11, 14, 11, 14, 13, 13, 12, 13, 12, 13, 10,
-  6, 10,  8,  9, 10, 10, 10,  9, 10, 11,  9,  9, 10, 10,  9,  7,
-  8, 11, 11, 10, 12, 11, 12, 10, 12, 12, 11, 10, 12, 12, 11,  9,
- 11, 13, 14, 11, 15, 14, 15, 12, 16, 14, 14, 12, 15, 14, 14, 11,
- 10, 13, 11, 11, 14, 13, 13, 12, 13, 14, 11, 11, 13, 13, 12, 10,
- 11, 14, 13, 11, 16, 14, 14, 12, 15, 15, 14, 12, 15, 14, 14, 11,
- 12, 14, 14, 11, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 15, 12,
-  6, 10, 10, 10,  8,  9, 10,  9, 10, 11, 10, 10,  9,  9,  9,  8,
-  8, 11, 12, 12, 11, 10, 12, 11, 12, 12, 12, 12, 12, 11, 12,  9,
- 11, 13, 16, 14, 14, 12, 15, 12, 16, 15, 16, 14, 14, 13, 14, 11,
-  9, 13, 12, 12, 12, 12, 12, 11, 13, 13, 12, 12, 12, 12, 11, 10,
- 10, 13, 13, 12, 13, 12, 13, 11, 14, 14, 13, 13, 13, 13, 12, 10,
- 13, 14, 16, 14, 15, 14, 16, 13, 16, 16, 16, 14, 16, 14, 15, 12,
- 12, 16, 14, 14, 16, 15, 14, 13, 16, 16, 14, 14, 15, 15, 13, 12,
- 13, 16, 15, 14, 16, 16, 15, 13, 16, 16, 15, 14, 16, 16, 14, 12,
- 14, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 12,
- 10, 13, 14, 13, 11, 11, 13, 12, 13, 14, 13, 13, 11, 12, 12, 10,
- 11, 14, 15, 15, 13, 12, 14, 13, 16, 16, 16, 15, 14, 13, 14, 11,
- 12, 14, 16, 16, 14, 12, 16, 13, 16, 16, 16, 16, 15, 13, 16, 12,
- 12, 16, 15, 16, 14, 15, 14, 14, 16, 16, 15, 16, 14, 14, 13, 12,
- 13, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 16, 16, 14, 15, 12,
- 14, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 16, 15, 16, 13,
- 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 15, 13,
- 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 13,
- 15, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 13,
-  6, 10, 10, 10, 10, 10, 10, 10,  8, 10,  9,  9,  8,  9,  9,  7,
-  9, 12, 13, 12, 13, 12, 13, 12, 12, 12, 12, 11, 12, 11, 12, 10,
- 12, 14, 16, 14, 16, 14, 16, 14, 16, 15, 15, 14, 16, 14, 15, 12,
-  8, 12, 11, 11, 12, 12, 12, 11, 11, 12, 10, 10, 11, 12, 10,  9,
- 10, 13, 13, 12, 14, 13, 14, 12, 13, 13, 12, 11, 13, 13, 12, 10,
- 13, 15, 16, 14, 16, 16, 16, 14, 16, 15, 15, 13, 16, 15, 15, 12,
- 11, 15, 13, 13, 15, 15, 15, 14, 14, 14, 11, 12, 14, 14, 12, 11,
- 13, 16, 14, 14, 16, 16, 16, 14, 16, 15, 13, 13, 16, 14, 14, 11,
- 14, 16, 16, 14, 16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 16, 12,
-  8, 12, 12, 12, 11, 11, 12, 12, 11, 12, 11, 11,  9, 10, 10,  9,
- 10, 13, 14, 13, 13, 12, 14, 13, 13, 13, 13, 13, 12, 11, 12, 10,
- 13, 15, 16, 15, 16, 14, 16, 14, 16, 16, 16, 15, 16, 13, 15, 12,
- 10, 14, 13, 13, 13, 13, 13, 13, 13, 14, 12, 12, 12, 12, 11, 10,
- 10, 13, 13, 13, 13, 13, 14, 12, 13, 14, 13, 12, 13, 12, 12, 10,
- 13, 16, 16, 14, 16, 15, 16, 14, 16, 16, 15, 14, 16, 14, 15, 11,
- 13, 16, 15, 16, 16, 16, 15, 14, 16, 16, 14, 14, 15, 15, 13, 12,
- 13, 16, 15, 14, 16, 16, 16, 14, 16, 16, 14, 14, 15, 15, 14, 11,
- 14, 16, 16, 15, 16, 16, 16, 14, 16, 16, 16, 15, 16, 16, 15, 12,
- 11, 14, 15, 14, 13, 13, 14, 14, 13, 15, 14, 14, 11, 12, 12, 11,
- 13, 16, 16, 16, 14, 14, 16, 14, 16, 16, 16, 15, 14, 13, 14, 12,
- 14, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 14, 16, 13,
- 13, 16, 16, 16, 15, 16, 15, 15, 16, 16, 15, 16, 14, 14, 13, 12,
- 13, 16, 16, 15, 15, 14, 16, 14, 16, 16, 16, 15, 14, 14, 14, 11,
- 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 15, 16, 12,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 13,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 12,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12,
-  9, 13, 13, 13, 13, 13, 14, 13, 10, 12, 11, 12, 11, 12, 11, 10,
- 12, 15, 16, 15, 16, 16, 16, 16, 14, 14, 14, 13, 14, 13, 14, 12,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14,
- 11, 15, 14, 14, 15, 14, 15, 14, 13, 14, 11, 12, 13, 13, 12, 11,
- 13, 16, 16, 15, 16, 16, 16, 15, 15, 15, 14, 13, 16, 15, 14, 12,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 13,
- 12, 16, 14, 15, 16, 16, 16, 16, 14, 16, 11, 13, 15, 16, 13, 12,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 16, 16, 15, 12,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 13,
- 11, 15, 14, 14, 13, 14, 15, 14, 12, 14, 13, 13, 11, 12, 12, 11,
- 13, 16, 16, 16, 16, 15, 16, 16, 15, 15, 15, 15, 14, 13, 14, 12,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 13,
- 13, 16, 16, 16, 16, 16, 16, 15, 14, 16, 13, 14, 13, 14, 13, 11,
- 13, 16, 16, 16, 16, 16, 16, 15, 15, 16, 15, 14, 14, 14, 14, 11,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 15, 16, 16, 13, 12,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 16, 16, 15, 12,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12,
- 11, 16, 16, 15, 13, 15, 16, 15, 13, 15, 15, 15, 11, 12, 12, 11,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 15, 12,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 13,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 14, 14, 13, 12,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 14, 12,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 12,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 14, 13,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 12,
- 12, 14, 14, 14, 14, 15, 16, 14, 14, 16, 15, 14, 14, 15, 14, 11,
-},
-{
-  1,  5,  5,  6,  5,  6,  7,  7,  5,  7,  6,  7,  5,  6,  6,  6,
-  6,  9, 10,  9, 10,  9, 11, 10, 11, 11, 11, 10, 11, 10, 11,  9,
- 10, 11, 14, 12, 14, 12, 16, 12, 16, 13, 16, 13, 14, 13, 16, 12,
-  6, 10,  9,  9, 10, 11, 11, 10, 10, 11,  9, 10, 10, 11, 10,  9,
-  8, 11, 11, 10, 13, 12, 13, 12, 13, 13, 12, 12, 13, 13, 13, 11,
- 11, 13, 16, 12, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16, 13,
- 10, 14, 11, 12, 14, 14, 13, 13, 13, 16, 12, 13, 14, 16, 13, 12,
- 11, 14, 13, 12, 16, 16, 16, 14, 16, 16, 14, 14, 16, 16, 16, 13,
- 12, 14, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-  6, 10, 10, 11,  9,  9, 11, 10, 10, 11, 11, 11,  9, 10, 10,  9,
-  9, 12, 13, 12, 12, 11, 13, 12, 13, 13, 13, 13, 12, 12, 13, 11,
- 12, 13, 16, 16, 16, 13, 16, 14, 16, 16, 16, 16, 16, 14, 16, 13,
-  9, 13, 13, 13, 13, 13, 13, 13, 13, 14, 13, 13, 13, 13, 12, 11,
- 10, 14, 14, 13, 14, 13, 14, 13, 16, 16, 14, 15, 14, 14, 14, 12,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 10, 14, 14, 16, 11, 12, 14, 13, 14, 16, 16, 16, 12, 13, 13, 12,
- 12, 16, 16, 16, 13, 13, 16, 14, 16, 16, 16, 16, 16, 14, 16, 13,
- 13, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  6, 10, 10, 10, 10, 11, 11, 11,  9, 11,  9, 10,  9, 10, 10,  9,
-  9, 13, 13, 13, 13, 13, 14, 13, 12, 13, 13, 12, 13, 12, 13, 11,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
-  8, 13, 12, 12, 13, 13, 13, 13, 11, 13, 10, 12, 12, 13, 12, 11,
- 10, 14, 13, 13, 16, 16, 16, 14, 14, 14, 13, 13, 14, 14, 14, 12,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 11, 16, 13, 16, 16, 16, 16, 16, 14, 16, 12, 13, 16, 16, 14, 13,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  8, 13, 13, 13, 11, 12, 13, 13, 11, 13, 12, 13, 10, 12, 12, 11,
- 10, 14, 16, 16, 14, 13, 16, 14, 14, 16, 16, 14, 13, 13, 14, 12,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 10, 16, 14, 16, 14, 14, 14, 14, 13, 16, 13, 14, 13, 14, 12, 12,
- 10, 14, 14, 14, 14, 16, 16, 14, 14, 16, 14, 14, 14, 14, 14, 12,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 11, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16, 12, 14, 14, 13,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  9, 14, 13, 14, 13, 14, 16, 16, 11, 13, 12, 13, 11, 13, 12, 12,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 11, 16, 14, 16, 16, 16, 16, 16, 13, 16, 12, 13, 14, 16, 13, 13,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 12, 16, 16, 16, 16, 16, 16, 16, 14, 16, 12, 16, 16, 16, 14, 14,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 11, 16, 16, 16, 14, 16, 16, 16, 13, 16, 14, 16, 12, 13, 13, 13,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 14,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 11, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16, 12, 16, 14, 14,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
-},
-{
-  1,  5,  5,  6,  5,  6,  7,  8,  5,  7,  6,  8,  6,  7,  7,  7,
-  5,  9, 10, 10, 10, 10, 12, 11, 10, 11, 11, 11, 10, 11, 12, 10,
-  9, 11, 13, 12, 13, 12, 16, 14, 16, 14, 16, 16, 16, 13, 16, 13,
-  5, 10,  9, 10, 10, 11, 11, 11, 10, 11,  9, 11, 10, 11, 11, 10,
-  8, 11, 11, 11, 12, 13, 13, 13, 12, 13, 12, 12, 13, 13, 13, 12,
- 11, 13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  9, 14, 11, 12, 14, 16, 13, 14, 13, 16, 12, 14, 16, 16, 13, 13,
- 11, 16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 11, 14, 14, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  5, 10, 11, 11,  9, 10, 11, 11, 10, 12, 11, 12,  9, 11, 11, 11,
-  8, 12, 13, 13, 11, 11, 14, 13, 13, 14, 13, 16, 12, 12, 13, 12,
- 11, 13, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  9, 13, 12, 13, 12, 13, 13, 14, 13, 16, 13, 16, 13, 16, 13, 13,
- 10, 14, 13, 14, 13, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 13,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  9, 14, 16, 16, 11, 12, 14, 16, 13, 16, 16, 16, 12, 14, 13, 13,
- 11, 16, 16, 16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 12, 16, 16, 16, 14, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  5, 10, 10, 11, 10, 11, 12, 12,  8, 11, 10, 11,  9, 11, 11, 11,
-  9, 12, 13, 13, 13, 13, 16, 16, 12, 13, 13, 13, 13, 13, 16, 13,
- 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  8, 13, 11, 13, 12, 13, 13, 14, 11, 13, 10, 13, 12, 14, 12, 12,
- 10, 14, 13, 14, 16, 16, 16, 16, 13, 16, 13, 14, 16, 16, 16, 14,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 11, 16, 13, 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 16, 16,
- 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  8, 13, 13, 13, 11, 13, 14, 16, 11, 13, 13, 14, 10, 12, 12, 12,
- 10, 14, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, 13, 13, 16, 14,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 10, 16, 14, 16, 13, 16, 16, 16, 13, 16, 13, 16, 13, 16, 13, 14,
- 10, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 13,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 10, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16, 12, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-  9, 14, 13, 16, 13, 16, 16, 16, 10, 14, 12, 14, 11, 13, 13, 13,
- 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 11, 16, 16, 16, 16, 16, 16, 16, 12, 16, 12, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 11, 16, 16, 16, 16, 16, 16, 16, 13, 16, 13, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 10, 16, 16, 16, 14, 16, 16, 16, 12, 16, 16, 16, 12, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 11, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16, 12, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 10, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14,
-}
-};
-
-
-static const uint8_t rv34_inter_cbp[NUM_INTER_TABLES][4][CBP_VLC_SIZE] = {
-{
- { 0,  6,  6,  3,  6,  4,  5,  3,  6,  5,  4,  3,  3,  4,  4,  3 },
- { 0,  6,  6,  4,  6,  4,  5,  3,  6,  5,  4,  3,  4,  4,  4,  2 },
- { 0,  7,  7,  4,  7,  5,  5,  4,  7,  5,  5,  4,  5,  4,  4,  1 },
- { 0,  7,  7,  5,  7,  5,  6,  4,  7,  6,  5,  3,  5,  4,  4,  1 }
-},
-{
- { 0,  6,  6,  3,  6,  3,  5,  4,  6,  5,  3,  4,  3,  4,  4,  3 },
- { 0,  6,  6,  4,  6,  4,  4,  4,  6,  4,  4,  3,  4,  4,  4,  2 },
- { 0,  6,  6,  4,  6,  4,  5,  4,  6,  5,  4,  3,  4,  4,  3,  2 },
- { 0,  7,  7,  5,  7,  5,  6,  4,  7,  6,  5,  3,  5,  4,  4,  1 }
-},
-{
- { 0,  6,  6,  3,  6,  3,  5,  4,  6,  5,  3,  4,  3,  4,  4,  3 },
- { 0,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4,  4,  4,  4,  4,  2 },
- { 0,  6,  6,  4,  6,  4,  5,  3,  6,  5,  4,  3,  4,  4,  4,  2 },
- { 0,  7,  7,  5,  7,  5,  6,  4,  7,  6,  5,  3,  5,  4,  4,  1 }
-},
-{
- { 0,  6,  6,  3,  6,  3,  5,  4,  6,  5,  3,  4,  3,  4,  4,  3 },
- { 0,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4,  4,  4,  4,  4,  2 },
- { 0,  6,  6,  4,  6,  4,  5,  3,  6,  5,  4,  3,  4,  4,  4,  2 },
- { 0,  7,  7,  4,  7,  5,  6,  4,  7,  6,  5,  4,  4,  4,  4,  1 }
-},
-{
- { 0,  5,  5,  3,  5,  3,  5,  4,  5,  5,  3,  4,  3,  4,  4,  4 },
- { 0,  5,  5,  3,  5,  4,  5,  4,  5,  5,  3,  4,  3,  4,  4,  3 },
- { 0,  6,  6,  4,  6,  4,  5,  4,  6,  5,  4,  3,  4,  4,  3,  2 },
- { 0,  7,  7,  4,  7,  5,  6,  4,  7,  6,  5,  4,  4,  4,  4,  1 }
-},
-{
- { 0,  5,  5,  3,  5,  3,  5,  4,  5,  5,  3,  4,  3,  4,  4,  4 },
- { 0,  5,  5,  3,  5,  4,  5,  4,  5,  5,  3,  4,  3,  4,  4,  3 },
- { 0,  5,  5,  3,  5,  4,  4,  4,  5,  4,  4,  4,  3,  4,  4,  3 },
- { 0,  6,  6,  4,  6,  4,  5,  4,  6,  5,  4,  3,  4,  4,  3,  2 }
-},
-{
- { 0,  4,  4,  3,  4,  3,  5,  5,  4,  5,  3,  5,  3,  5,  4,  5 },
- { 0,  4,  4,  3,  4,  4,  5,  4,  4,  5,  3,  5,  3,  5,  4,  4 },
- { 0,  4,  4,  3,  4,  4,  5,  4,  4,  5,  4,  4,  3,  4,  4,  4 },
- { 0,  4,  4,  3,  5,  4,  5,  4,  5,  5,  4,  4,  3,  4,  4,  3 }
-}
-};
-
-
-static const uint8_t rv34_table_inter_firstpat[NUM_INTER_TABLES][2][FIRSTBLK_VLC_SIZE] = {
-  {
-    {
-       0,  7,  5,  7,  5,  7,  6,  6,  7, 10,  7,  9,  8,  9,  8,  7,
-      12, 14, 11, 12, 12, 12, 11,  9,  6,  9,  6,  8,  7,  9,  7,  7,
-       8, 11,  8,  9,  9, 10,  9,  8, 13, 15, 12, 12, 12, 13, 11,  9,
-      10, 13,  9, 10, 11, 12,  9,  8, 12, 14, 10, 11, 12, 13, 10,  9,
-      16, 16, 12, 12, 14, 13, 11,  9,  6,  9,  7,  9,  7,  9,  8,  7,
-       9, 11,  9, 10,  9, 10,  9,  8, 14, 16, 12, 12, 13, 13, 11,  9,
-       8, 11,  8, 10,  9, 10,  9,  8, 10, 13, 10, 11, 10, 11,  9,  8,
-      14, 16, 12, 12, 13, 13, 11,  9, 12, 14, 10, 11, 12, 13, 10,  9,
-      13, 16, 11, 12, 13, 13, 10,  9, 16, 16, 13, 12, 14, 14, 11,  9,
-      11, 13, 11, 12, 10, 11, 10,  9, 13, 14, 12, 12, 11, 12, 10,  9,
-      16, 16, 13, 13, 13, 13, 11,  9, 12, 15, 12, 12, 11, 12, 10,  9,
-      13, 16, 13, 13, 12, 12, 11,  9, 16, 16, 14, 13, 13, 13, 11,  9,
-      14, 16, 13, 13, 13, 14, 11,  9, 16, 16, 13, 13, 14, 14, 11,  9,
-      16, 16, 13, 13, 14, 13, 11,  8,  4,  9,  6,  8,  6,  9,  7,  7,
-       8, 11,  8,  9,  9, 10,  8,  8, 13, 15, 12, 12, 13, 13, 11,  9,
-       7, 10,  7,  9,  8, 10,  8,  8,  9, 12,  9, 10, 10, 11,  9,  8,
-      14, 16, 12, 12, 13, 13, 11,  9, 11, 13,  9, 10, 11, 12,  9,  8,
-      12, 14, 10, 11, 12, 13, 10,  9, 16, 16, 13, 12, 14, 14, 11,  9,
-       7, 10,  8,  9,  8, 10,  8,  8, 10, 12, 10, 11, 10, 11,  9,  8,
-      14, 16, 13, 13, 13, 13, 11,  9,  9, 12,  9, 10,  9, 11,  9,  8,
-      11, 13, 10, 11, 10, 11, 10,  9, 15, 16, 13, 13, 13, 13, 11,  9,
-      12, 14, 11, 11, 12, 13, 10,  9, 13, 16, 11, 12, 13, 13, 10,  9,
-      16, 16, 12, 12, 14, 13, 11,  8, 11, 14, 11, 12, 10, 11, 10,  9,
-      13, 15, 12, 13, 11, 12, 10,  9, 16, 16, 14, 13, 13, 13, 11,  9,
-      12, 15, 12, 13, 11, 12, 10,  9, 13, 16, 13, 13, 12, 12, 11,  9,
-      16, 16, 14, 13, 13, 13, 11,  9, 15, 16, 13, 13, 13, 13, 11,  9,
-      16, 16, 13, 13, 13, 13, 11,  9, 16, 16, 13, 12, 13, 13, 10,  7,
-       8, 11,  8, 10,  9, 11,  9,  9, 10, 13, 10, 11, 11, 12, 10,  9,
-      15, 16, 13, 13, 14, 14, 12, 10,  9, 12,  9, 11, 10, 11,  9,  9,
-      12, 14, 11, 11, 11, 12, 10,  9, 16, 16, 13, 13, 14, 14, 12, 10,
-      12, 14, 10, 11, 12, 13, 10,  9, 14, 16, 11, 12, 13, 14, 10,  9,
-      16, 16, 13, 13, 15, 14, 11,  9,  9, 12, 10, 11,  9, 11, 10,  9,
-      12, 14, 11, 12, 11, 12, 10,  9, 16, 16, 14, 13, 14, 14, 12, 10,
-      11, 14, 10, 12, 11, 12, 10,  9, 12, 15, 11, 12, 12, 13, 11, 10,
-      16, 16, 14, 13, 14, 14, 12, 10, 13, 16, 11, 12, 13, 14, 11,  9,
-      14, 16, 12, 12, 13, 14, 11,  9, 16, 16, 13, 13, 14, 14, 11,  9,
-      12, 15, 12, 13, 10, 12, 10,  9, 14, 16, 13, 13, 11, 12, 11, 10,
-      16, 16, 14, 14, 14, 13, 12,  9, 13, 16, 13, 13, 12, 13, 11, 10,
-      14, 16, 13, 13, 12, 13, 11, 10, 16, 16, 14, 14, 13, 13, 12,  9,
-      15, 16, 13, 13, 13, 14, 11,  9, 16, 16, 13, 13, 13, 14, 11,  9,
-      16, 16, 13, 12, 13, 13, 10,  8, 10, 13, 10, 11, 10, 12, 10,  9,
-      12, 14, 11, 12, 12, 13, 11, 10, 16, 16, 13, 13, 14, 14, 12,  9,
-      11, 14, 10, 11, 11, 12, 10,  9, 13, 16, 11, 12, 12, 13, 11, 10,
-      16, 16, 14, 13, 14, 14, 12,  9, 12, 15, 10, 11, 12, 13,  9,  8,
-      14, 16, 11, 11, 13, 14, 10,  8, 16, 16, 12, 12, 14, 14, 10,  8,
-      11, 14, 11, 12, 11, 12, 10,  9, 13, 16, 12, 13, 12, 13, 11, 10,
-      16, 16, 14, 13, 14, 14, 12,  9, 12, 15, 11, 12, 11, 13, 10, 10,
-      13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 14, 13, 14, 14, 12,  9,
-      13, 16, 11, 11, 13, 13, 10,  8, 14, 16, 11, 12, 13, 14, 10,  8,
-      16, 16, 12, 12, 14, 14, 10,  8, 12, 15, 12, 13, 10, 11, 10,  9,
-      14, 16, 13, 13, 11, 12, 10,  9, 16, 16, 14, 13, 13, 13, 11,  8,
-      13, 16, 12, 13, 11, 12, 10,  9, 14, 16, 13, 13, 12, 12, 10,  9,
-      16, 16, 14, 13, 13, 12, 10,  8, 14, 16, 12, 12, 12, 13, 10,  8,
-      14, 16, 12, 12, 12, 13, 10,  7, 16, 16, 11, 11, 12, 11,  8,  5,
-    },
-    {
-       0,  7,  4,  8,  5,  8,  7,  8,  6, 10,  7, 10,  8, 10,  9,  9,
-      13, 16, 12, 13, 13, 14, 12, 12,  4, 10,  6,  9,  8, 11,  8,  9,
-       8, 12,  8, 11, 10, 12, 10, 10, 14, 16, 12, 13, 14, 15, 12, 12,
-       9, 14,  9, 11, 12, 14, 11, 11, 11, 15, 10, 12, 13, 14, 11, 11,
-      15, 16, 13, 14, 15, 16, 13, 12,  5, 10,  7, 10,  7, 10,  9,  9,
-       8, 12,  9, 11, 10, 11, 10, 10, 14, 16, 13, 14, 14, 14, 12, 12,
-       8, 12,  8, 11, 10, 12, 10, 10, 10, 14, 10, 12, 11, 13, 10, 11,
-      15, 16, 13, 14, 14, 15, 13, 12, 11, 16, 10, 12, 13, 15, 11, 11,
-      13, 16, 11, 13, 14, 15, 12, 12, 16, 16, 14, 14, 16, 16, 13, 12,
-      11, 15, 11, 13, 11, 13, 11, 11, 13, 16, 12, 14, 12, 13, 12, 12,
-      16, 16, 14, 15, 15, 15, 13, 12, 12, 16, 12, 14, 12, 14, 12, 12,
-      14, 16, 13, 14, 13, 14, 12, 12, 16, 16, 14, 16, 16, 16, 13, 12,
-      14, 16, 13, 14, 15, 16, 13, 12, 16, 16, 14, 15, 16, 16, 13, 12,
-      16, 16, 15, 16, 16, 16, 13, 12,  2,  9,  5,  8,  6,  9,  8,  9,
-       7, 11,  8, 10,  9, 11,  9, 10, 13, 16, 12, 13, 14, 14, 12, 12,
-       5, 11,  6, 10,  9, 11,  9,  9,  9, 13,  9, 11, 10, 12, 10, 10,
-      14, 16, 12, 14, 14, 15, 12, 12,  9, 14,  9, 11, 12, 14, 10, 11,
-      11, 16, 10, 12, 13, 14, 11, 11, 16, 16, 13, 14, 15, 16, 13, 12,
-       6, 11,  7, 10,  8, 11,  9,  9,  9, 13,  9, 11, 10, 12, 10, 10,
-      14, 16, 13, 14, 14, 14, 12, 12,  8, 13,  8, 11, 10, 12, 10, 10,
-      10, 13, 10, 12, 11, 13, 10, 11, 14, 16, 13, 14, 14, 15, 12, 12,
-      11, 15, 10, 12, 13, 15, 11, 11, 12, 16, 11, 13, 13, 15, 12, 11,
-      16, 16, 13, 14, 15, 16, 13, 12, 11, 15, 11, 13, 10, 13, 11, 11,
-      13, 16, 12, 14, 12, 13, 12, 11, 16, 16, 14, 15, 15, 15, 13, 12,
-      12, 16, 12, 13, 12, 14, 12, 12, 13, 16, 12, 14, 13, 14, 12, 12,
-      16, 16, 14, 15, 15, 15, 13, 12, 14, 16, 13, 14, 15, 16, 12, 12,
-      16, 16, 13, 14, 15, 16, 12, 12, 16, 16, 14, 15, 16, 16, 13, 12,
-       6, 12,  7, 10,  9, 12,  9, 10,  9, 13,  9, 12, 11, 13, 11, 11,
-      14, 16, 13, 14, 15, 15, 13, 12,  8, 13,  8, 11, 10, 13, 10, 10,
-      10, 14, 10, 12, 12, 14, 11, 11, 15, 16, 13, 14, 16, 16, 13, 12,
-      10, 15,  9, 12, 12, 15, 11, 11, 12, 16, 11, 13, 14, 16, 12, 12,
-      16, 16, 14, 14, 16, 16, 13, 12,  8, 13,  9, 11, 10, 12, 10, 11,
-      11, 14, 11, 12, 11, 13, 11, 11, 16, 16, 14, 15, 15, 16, 13, 12,
-      10, 14, 10, 12, 11, 13, 11, 11, 11, 15, 11, 13, 12, 14, 11, 11,
-      15, 16, 13, 14, 15, 16, 13, 12, 12, 16, 11, 13, 13, 16, 12, 12,
-      13, 16, 11, 13, 14, 16, 12, 12, 16, 16, 13, 14, 16, 16, 13, 12,
-      12, 16, 12, 14, 11, 13, 11, 11, 13, 16, 13, 14, 12, 14, 12, 12,
-      16, 16, 15, 16, 16, 16, 14, 13, 13, 16, 12, 14, 12, 14, 12, 12,
-      14, 16, 13, 14, 13, 14, 12, 12, 16, 16, 14, 16, 14, 16, 13, 12,
-      15, 16, 13, 15, 15, 16, 13, 12, 15, 16, 13, 15, 14, 16, 13, 12,
-      16, 16, 14, 15, 15, 16, 13, 11,  8, 13,  8, 11, 10, 13, 10, 11,
-      11, 15, 10, 12, 12, 14, 11, 11, 15, 16, 13, 14, 15, 15, 13, 12,
-       9, 14,  9, 12, 11, 14, 10, 11, 11, 16, 10, 12, 13, 14, 11, 11,
-      16, 16, 13, 14, 15, 16, 13, 12, 11, 15,  9, 12, 12, 14, 10, 10,
-      12, 16, 11, 12, 14, 15, 11, 11, 16, 16, 13, 14, 16, 16, 12, 11,
-       9, 14, 10, 12, 11, 13, 11, 11, 12, 16, 11, 13, 12, 14, 11, 11,
-      16, 16, 14, 14, 15, 15, 13, 12, 10, 15, 10, 12, 12, 14, 11, 11,
-      12, 16, 11, 13, 13, 14, 11, 11, 16, 16, 14, 14, 15, 16, 13, 12,
-      12, 16, 10, 12, 13, 15, 11, 11, 13, 16, 11, 13, 14, 15, 11, 11,
-      16, 16, 13, 13, 15, 16, 12, 11, 12, 16, 11, 13, 10, 13, 11, 11,
-      14, 16, 13, 14, 12, 14, 11, 11, 16, 16, 15, 16, 14, 15, 13, 11,
-      13, 16, 12, 14, 12, 14, 11, 11, 13, 16, 12, 14, 12, 14, 11, 11,
-      16, 16, 14, 15, 14, 14, 12, 11, 14, 16, 12, 13, 13, 15, 11, 11,
-      14, 16, 12, 13, 13, 14, 11, 11, 15, 16, 12, 13, 13, 13, 10,  9,
-    },
-  },
-  {
-    {
-       0,  7,  4,  7,  5,  7,  6,  6,  6, 10,  7,  8,  8,  9,  8,  7,
-      13, 14, 11, 12, 12, 12, 11,  9,  5,  9,  6,  8,  7,  9,  7,  7,
-       8, 11,  8,  9,  9, 10,  9,  8, 13, 16, 12, 12, 12, 13, 11,  9,
-      10, 13,  8, 10, 11, 12,  9,  9, 12, 14, 10, 11, 12, 13, 10,  9,
-      15, 16, 12, 12, 14, 14, 11,  9,  6, 10,  7,  9,  7,  9,  8,  7,
-       8, 11,  9, 10,  9, 10,  9,  8, 14, 16, 12, 12, 13, 12, 11,  9,
-       8, 11,  8, 10,  9, 10,  9,  8, 10, 13, 10, 11, 10, 11,  9,  9,
-      14, 16, 12, 12, 13, 13, 11,  9, 12, 15, 10, 11, 12, 13, 10,  9,
-      13, 16, 11, 12, 13, 13, 10,  9, 16, 16, 12, 13, 14, 14, 11,  9,
-      10, 14, 11, 12,  9, 11, 10,  9, 12, 15, 12, 13, 11, 12, 11,  9,
-      16, 16, 13, 13, 13, 13, 11,  9, 12, 15, 12, 13, 11, 12, 11,  9,
-      13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 13, 13, 13, 13, 11,  9,
-      14, 16, 13, 13, 13, 14, 11, 10, 16, 16, 13, 13, 13, 14, 11, 10,
-      16, 16, 13, 13, 14, 14, 11,  9,  4,  9,  6,  8,  6,  9,  7,  7,
-       8, 11,  8,  9,  9, 10,  9,  8, 13, 15, 12, 12, 13, 13, 11,  9,
-       6, 10,  7,  9,  8, 10,  8,  8,  9, 12,  9, 10, 10, 11,  9,  8,
-      14, 16, 12, 12, 13, 13, 11, 10, 10, 13,  8, 10, 11, 12,  9,  9,
-      12, 15, 10, 11, 12, 13, 10,  9, 16, 16, 12, 12, 14, 14, 11,  9,
-       7, 11,  8,  9,  7, 10,  8,  8,  9, 12, 10, 11,  9, 11,  9,  9,
-      14, 16, 12, 13, 13, 13, 11, 10,  9, 12,  9, 10,  9, 11,  9,  9,
-      10, 13, 10, 11, 10, 11, 10,  9, 14, 16, 12, 13, 13, 13, 11,  9,
-      12, 15, 10, 11, 12, 13, 10,  9, 13, 16, 11, 12, 13, 13, 10,  9,
-      16, 16, 12, 12, 14, 14, 11,  9, 10, 14, 11, 12,  9, 11, 10,  9,
-      12, 16, 12, 13, 11, 12, 11,  9, 16, 16, 14, 14, 13, 13, 11,  9,
-      12, 16, 12, 13, 11, 12, 10, 10, 13, 16, 12, 13, 11, 12, 11, 10,
-      16, 16, 13, 13, 13, 13, 11,  9, 14, 16, 13, 13, 13, 14, 11,  9,
-      15, 16, 13, 13, 13, 14, 11,  9, 16, 16, 13, 13, 13, 13, 10,  8,
-       7, 11,  8, 10,  9, 11,  9,  9, 10, 13, 10, 11, 11, 12, 10, 10,
-      15, 16, 13, 13, 14, 14, 12, 10,  9, 13,  9, 11, 10, 12, 10,  9,
-      11, 14, 10, 12, 12, 13, 10, 10, 16, 16, 13, 13, 14, 14, 12, 10,
-      11, 15,  9, 11, 12, 13, 10,  9, 13, 16, 11, 12, 13, 14, 11, 10,
-      16, 16, 13, 13, 15, 15, 11, 10,  9, 13, 10, 11,  9, 11, 10,  9,
-      11, 14, 11, 12, 11, 12, 11, 10, 16, 16, 14, 14, 14, 14, 12, 10,
-      10, 14, 10, 12, 11, 12, 10, 10, 12, 15, 11, 12, 12, 13, 11, 10,
-      16, 16, 13, 13, 14, 14, 12, 10, 13, 16, 11, 12, 13, 14, 11, 10,
-      13, 16, 11, 12, 13, 14, 11, 10, 16, 16, 12, 13, 14, 14, 11,  9,
-      11, 15, 12, 13, 10, 12, 10, 10, 13, 16, 13, 14, 11, 13, 11, 10,
-      16, 16, 14, 14, 14, 14, 12, 10, 13, 16, 13, 13, 11, 13, 11, 10,
-      14, 16, 13, 14, 12, 13, 11, 10, 16, 16, 14, 14, 13, 13, 12, 10,
-      15, 16, 13, 14, 14, 14, 11, 10, 15, 16, 13, 13, 13, 14, 11, 10,
-      16, 16, 12, 13, 13, 13, 10,  8,  9, 13, 10, 11, 10, 12, 10, 10,
-      12, 15, 11, 12, 12, 13, 11, 10, 16, 16, 14, 13, 14, 14, 12, 10,
-      10, 14, 10, 12, 11, 13, 10, 10, 13, 16, 11, 12, 12, 14, 11, 10,
-      16, 16, 13, 13, 14, 14, 12, 10, 12, 16,  9, 11, 12, 14, 10,  9,
-      13, 16, 10, 12, 13, 14, 10,  9, 16, 16, 12, 12, 14, 14, 11,  9,
-      10, 14, 11, 12, 10, 12, 10, 10, 13, 16, 12, 13, 12, 13, 11, 10,
-      16, 16, 14, 14, 14, 14, 12, 10, 11, 16, 11, 12, 11, 13, 11, 10,
-      13, 16, 12, 13, 12, 14, 11, 10, 16, 16, 14, 14, 14, 14, 12, 10,
-      13, 16, 11, 12, 13, 14, 10,  9, 14, 16, 11, 12, 13, 14, 10,  9,
-      16, 16, 12, 12, 14, 14, 10,  8, 12, 16, 12, 13, 10, 12, 10,  9,
-      14, 16, 13, 13, 11, 12, 11,  9, 16, 16, 14, 14, 13, 13, 11,  9,
-      13, 16, 12, 13, 11, 12, 10,  9, 14, 16, 13, 13, 11, 13, 11,  9,
-      16, 16, 14, 14, 13, 13, 11,  9, 14, 16, 12, 13, 12, 13, 10,  8,
-      14, 16, 12, 12, 12, 13, 10,  8, 15, 16, 11, 11, 11, 12,  9,  6,
-    },
-    {
-       0,  7,  4,  7,  5,  8,  7,  8,  5, 10,  7, 10,  8, 10,  9, 10,
-      13, 16, 12, 14, 14, 14, 13, 12,  4, 10,  6,  9,  8, 11,  9,  9,
-       8, 12,  8, 11, 10, 12, 10, 10, 14, 16, 13, 14, 14, 15, 13, 12,
-       9, 14,  9, 12, 12, 14, 11, 11, 12, 16, 11, 13, 13, 15, 12, 12,
-      15, 16, 14, 15, 15, 16, 13, 13,  5, 10,  7, 10,  7, 10,  9,  9,
-       8, 12,  9, 11,  9, 11, 10, 10, 14, 16, 13, 14, 14, 15, 13, 12,
-       7, 12,  8, 11, 10, 12, 10, 10, 10, 13, 10, 12, 11, 13, 11, 11,
-      15, 16, 13, 15, 14, 16, 13, 13, 11, 16, 11, 13, 13, 16, 12, 12,
-      13, 16, 12, 14, 14, 16, 12, 12, 16, 16, 14, 16, 16, 16, 14, 13,
-      11, 15, 12, 14, 11, 13, 11, 12, 13, 16, 12, 14, 12, 14, 12, 12,
-      16, 16, 14, 16, 14, 16, 13, 13, 13, 16, 12, 14, 12, 14, 12, 12,
-      14, 16, 13, 15, 13, 15, 13, 13, 16, 16, 15, 16, 16, 16, 14, 13,
-      15, 16, 13, 16, 15, 16, 13, 13, 16, 16, 14, 16, 16, 16, 14, 13,
-      16, 16, 16, 16, 16, 16, 14, 13,  2,  9,  5,  8,  6,  9,  8,  9,
-       7, 11,  8, 10,  9, 11,  9, 10, 14, 16, 13, 14, 14, 15, 13, 12,
-       5, 11,  6, 10,  9, 11,  9, 10,  8, 13,  9, 11, 11, 12, 10, 11,
-      14, 16, 13, 14, 14, 16, 13, 13,  9, 15,  9, 12, 12, 14, 11, 11,
-      12, 16, 11, 13, 13, 15, 12, 12, 16, 16, 14, 15, 16, 16, 14, 13,
-       6, 11,  7, 10,  8, 11,  9, 10,  9, 13,  9, 12, 10, 12, 10, 11,
-      14, 16, 13, 14, 14, 15, 13, 13,  8, 12,  8, 11, 10, 12, 10, 11,
-       9, 13, 10, 12, 11, 13, 11, 11, 14, 16, 13, 14, 14, 16, 13, 13,
-      12, 16, 11, 13, 13, 15, 12, 12, 13, 16, 11, 13, 14, 16, 12, 12,
-      16, 16, 14, 15, 16, 16, 13, 13, 11, 15, 11, 14, 10, 13, 11, 12,
-      13, 16, 13, 15, 12, 14, 12, 12, 16, 16, 15, 16, 15, 16, 14, 13,
-      12, 16, 12, 14, 12, 14, 12, 12, 13, 16, 13, 15, 13, 14, 12, 13,
-      16, 16, 15, 16, 15, 16, 13, 13, 15, 16, 13, 16, 15, 16, 13, 13,
-      16, 16, 14, 16, 16, 16, 13, 13, 16, 16, 15, 16, 16, 16, 14, 13,
-       5, 12,  7, 10,  9, 12, 10, 10,  9, 13,  9, 12, 11, 13, 11, 11,
-      15, 16, 13, 14, 15, 15, 13, 13,  7, 13,  8, 11, 10, 13, 10, 11,
-      10, 14, 10, 12, 12, 14, 11, 12, 16, 16, 14, 15, 16, 16, 14, 13,
-      10, 16,  9, 12, 13, 15, 11, 12, 13, 16, 11, 13, 14, 16, 12, 12,
-      16, 16, 14, 16, 16, 16, 14, 13,  8, 13,  9, 12,  9, 12, 10, 11,
-      11, 15, 11, 13, 11, 13, 11, 12, 16, 16, 14, 16, 16, 16, 14, 13,
-       9, 14, 10, 12, 11, 13, 11, 12, 11, 15, 11, 13, 12, 14, 12, 12,
-      16, 16, 14, 16, 15, 16, 14, 13, 12, 16, 11, 14, 14, 16, 12, 12,
-      13, 16, 12, 14, 14, 16, 13, 13, 16, 16, 13, 15, 16, 16, 14, 13,
-      11, 16, 12, 14, 10, 13, 12, 12, 13, 16, 13, 15, 12, 14, 12, 13,
-      16, 16, 16, 16, 16, 16, 14, 14, 13, 16, 13, 15, 12, 15, 12, 13,
-      13, 16, 13, 15, 12, 15, 13, 13, 16, 16, 15, 16, 14, 16, 14, 13,
-      16, 16, 14, 16, 16, 16, 14, 13, 15, 16, 14, 16, 15, 16, 14, 13,
-      16, 16, 14, 16, 15, 16, 13, 12,  8, 14,  9, 12, 10, 14, 11, 12,
-      11, 16, 10, 13, 12, 14, 12, 12, 16, 16, 14, 15, 15, 16, 14, 13,
-       9, 15,  9, 12, 12, 14, 11, 12, 12, 16, 11, 13, 13, 15, 12, 12,
-      16, 16, 14, 15, 16, 16, 14, 13, 11, 16,  9, 12, 13, 15, 11, 11,
-      13, 16, 11, 13, 14, 16, 12, 12, 16, 16, 14, 14, 16, 16, 13, 12,
-       9, 15, 10, 13, 11, 14, 11, 12, 12, 16, 11, 14, 12, 14, 12, 12,
-      16, 16, 14, 16, 16, 16, 14, 13, 10, 16, 10, 13, 12, 15, 12, 12,
-      12, 16, 12, 14, 13, 15, 12, 12, 16, 16, 14, 16, 16, 16, 14, 13,
-      12, 16, 11, 13, 13, 16, 12, 12, 13, 16, 11, 13, 14, 16, 12, 12,
-      16, 16, 13, 14, 16, 16, 13, 12, 11, 16, 12, 14, 10, 13, 11, 12,
-      13, 16, 13, 15, 12, 14, 12, 12, 16, 16, 16, 16, 15, 16, 13, 12,
-      12, 16, 12, 15, 12, 14, 12, 12, 13, 16, 13, 15, 12, 14, 12, 12,
-      16, 16, 15, 16, 14, 15, 13, 12, 14, 16, 13, 14, 13, 16, 12, 12,
-      13, 16, 12, 14, 13, 15, 12, 12, 14, 16, 12, 13, 13, 14, 11, 10,
-    },
-  },
-  {
-    {
-       0,  7,  4,  7,  5,  7,  6,  6,  6, 10,  7,  8,  8,  9,  8,  8,
-      13, 14, 11, 12, 12, 12, 11, 10,  5,  9,  6,  8,  7,  9,  7,  7,
-       8, 11,  8,  9,  9, 10,  9,  8, 13, 16, 12, 12, 13, 13, 11, 10,
-      10, 14,  8, 10, 11, 13,  9,  9, 12, 15, 10, 11, 12, 13, 10, 10,
-      16, 16, 12, 13, 14, 14, 11, 10,  5, 10,  7,  9,  6,  9,  8,  8,
-       8, 11,  9, 10,  9, 10,  9,  8, 14, 16, 12, 12, 13, 13, 11, 10,
-       8, 12,  8, 10,  9, 10,  9,  9, 10, 13,  9, 11, 10, 11,  9,  9,
-      14, 16, 12, 13, 13, 13, 11, 10, 12, 16, 10, 12, 12, 13, 10, 10,
-      13, 16, 11, 12, 13, 14, 11, 10, 16, 16, 12, 13, 14, 14, 11, 10,
-      10, 14, 11, 13,  9, 11, 10, 10, 12, 16, 12, 13, 11, 12, 11, 10,
-      16, 16, 13, 14, 13, 13, 12, 10, 12, 16, 12, 13, 11, 13, 11, 10,
-      13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 13, 14, 13, 14, 12, 10,
-      14, 16, 13, 14, 13, 14, 12, 11, 16, 16, 13, 14, 14, 15, 12, 11,
-      16, 16, 13, 14, 14, 14, 11, 10,  3,  9,  5,  8,  6,  9,  7,  7,
-       8, 11,  8, 10,  9, 10,  9,  8, 14, 15, 12, 12, 13, 13, 11, 10,
-       6, 11,  6,  9,  8, 10,  8,  8,  9, 12,  9, 10, 10, 11,  9,  9,
-      14, 16, 12, 13, 13, 13, 11, 10, 10, 14,  8, 11, 12, 13,  9,  9,
-      12, 16, 10, 11, 12, 13, 10, 10, 16, 16, 12, 13, 14, 14, 11, 10,
-       6, 11,  8, 10,  7, 10,  8,  8,  9, 12, 10, 11,  9, 11,  9,  9,
-      14, 16, 12, 13, 13, 13, 12, 10,  9, 12,  9, 11,  9, 11,  9,  9,
-      10, 13, 10, 11, 10, 12, 10,  9, 14, 16, 12, 13, 13, 13, 11, 10,
-      12, 16, 10, 12, 12, 14, 10, 10, 13, 16, 10, 12, 13, 14, 11, 10,
-      16, 16, 12, 13, 14, 14, 11, 10, 10, 15, 11, 13,  9, 11, 10, 10,
-      12, 16, 12, 13, 11, 12, 11, 10, 16, 16, 14, 14, 13, 14, 12, 10,
-      12, 16, 12, 13, 11, 13, 11, 10, 13, 16, 12, 13, 11, 13, 11, 10,
-      16, 16, 13, 14, 13, 13, 12, 10, 14, 16, 13, 14, 14, 14, 11, 11,
-      15, 16, 13, 14, 13, 14, 11, 10, 16, 16, 13, 13, 13, 14, 11,  9,
-       7, 12,  8, 11,  9, 11,  9, 10, 10, 14, 10, 12, 11, 12, 11, 10,
-      16, 16, 13, 13, 14, 14, 12, 11,  9, 13,  9, 11, 10, 12, 10, 10,
-      11, 15, 10, 12, 12, 13, 11, 10, 16, 16, 13, 14, 14, 14, 12, 11,
-      11, 16,  9, 11, 12, 14, 10, 10, 13, 16, 10, 12, 13, 14, 11, 10,
-      16, 16, 13, 14, 16, 16, 12, 11,  9, 13, 10, 12,  9, 12, 10, 10,
-      11, 15, 11, 13, 11, 13, 11, 11, 16, 16, 14, 14, 14, 14, 13, 11,
-      10, 14, 10, 12, 11, 13, 11, 10, 12, 16, 11, 13, 12, 13, 11, 11,
-      16, 16, 13, 14, 14, 14, 12, 11, 13, 16, 11, 13, 13, 14, 11, 11,
-      13, 16, 11, 13, 13, 14, 11, 11, 16, 16, 12, 13, 14, 15, 12, 10,
-      11, 16, 12, 14, 10, 12, 11, 10, 13, 16, 13, 14, 11, 13, 11, 11,
-      16, 16, 15, 16, 14, 14, 13, 11, 13, 16, 13, 14, 12, 13, 11, 11,
-      13, 16, 13, 14, 12, 13, 11, 11, 16, 16, 14, 14, 13, 14, 12, 11,
-      15, 16, 13, 14, 14, 16, 12, 11, 14, 16, 13, 14, 13, 14, 12, 11,
-      16, 16, 12, 13, 13, 14, 11,  9,  9, 14, 10, 12, 10, 13, 11, 11,
-      12, 16, 12, 13, 12, 14, 12, 11, 16, 16, 14, 14, 14, 14, 13, 11,
-      10, 16, 10, 13, 12, 14, 11, 11, 13, 16, 12, 13, 13, 14, 12, 11,
-      16, 16, 14, 14, 15, 15, 13, 11, 12, 16,  9, 12, 13, 14, 10, 10,
-      14, 16, 11, 12, 13, 15, 11, 10, 16, 16, 13, 13, 15, 16, 11, 10,
-      10, 16, 11, 13, 11, 13, 11, 11, 13, 16, 12, 14, 12, 14, 12, 11,
-      16, 16, 14, 14, 14, 14, 13, 11, 11, 16, 11, 13, 12, 14, 11, 11,
-      13, 16, 12, 14, 13, 14, 12, 11, 16, 16, 14, 14, 14, 15, 13, 11,
-      13, 16, 11, 13, 13, 14, 11, 10, 14, 16, 11, 13, 13, 14, 11, 10,
-      16, 16, 12, 13, 14, 15, 11,  9, 12, 16, 12, 14, 10, 13, 11, 10,
-      14, 16, 13, 14, 11, 13, 11, 10, 16, 16, 14, 15, 13, 14, 12, 10,
-      13, 16, 13, 14, 11, 13, 11, 10, 14, 16, 13, 14, 12, 13, 11, 10,
-      16, 16, 14, 14, 13, 13, 11, 10, 14, 16, 12, 13, 13, 14, 11,  9,
-      14, 16, 12, 13, 12, 13, 10,  9, 14, 16, 11, 11, 12, 12,  9,  7,
-    },
-    {
-       0,  7,  3,  8,  5,  8,  7,  9,  5, 10,  7, 10,  8, 11, 10, 10,
-      14, 16, 14, 15, 14, 16, 14, 14,  4, 10,  6, 10,  8, 11,  9, 10,
-       8, 12,  9, 11, 10, 12, 11, 11, 15, 16, 14, 16, 15, 16, 14, 14,
-      10, 16, 10, 13, 13, 16, 12, 13, 13, 16, 12, 14, 14, 16, 13, 13,
-      16, 16, 16, 16, 16, 16, 14, 15,  4, 10,  7, 10,  7, 10,  9, 10,
-       8, 12,  9, 12, 10, 12, 11, 12, 14, 16, 14, 16, 15, 16, 14, 14,
-       8, 12,  9, 12, 10, 13, 11, 12, 10, 14, 11, 13, 11, 14, 12, 13,
-      16, 16, 14, 16, 16, 16, 14, 15, 12, 16, 12, 14, 14, 16, 13, 14,
-      14, 16, 13, 16, 16, 16, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 12, 16, 11, 14, 13, 13, 13, 16, 13, 16, 13, 15, 13, 14,
-      16, 16, 16, 16, 16, 16, 15, 16, 13, 16, 13, 16, 13, 16, 13, 14,
-      14, 16, 14, 16, 14, 16, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  2,  9,  5,  9,  6, 10,  8, 10,
-       7, 11,  8, 11,  9, 12, 10, 11, 14, 16, 14, 16, 15, 16, 14, 14,
-       5, 11,  6, 10,  9, 12, 10, 11,  9, 13,  9, 12, 11, 13, 11, 12,
-      16, 16, 14, 16, 16, 16, 14, 14, 10, 16,  9, 13, 13, 16, 12, 13,
-      13, 16, 12, 14, 14, 16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 14,
-       5, 11,  8, 11,  7, 11, 10, 11,  9, 13, 10, 13, 10, 13, 11, 12,
-      16, 16, 14, 16, 16, 16, 14, 14,  8, 13,  9, 12, 10, 13, 11, 12,
-      10, 14, 10, 13, 11, 14, 12, 12, 16, 16, 14, 16, 15, 16, 14, 14,
-      12, 16, 12, 14, 14, 16, 13, 14, 14, 16, 12, 16, 15, 16, 13, 14,
-      16, 16, 15, 16, 16, 16, 15, 15, 11, 16, 12, 16, 10, 14, 12, 13,
-      13, 16, 14, 16, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 15, 16,
-      13, 16, 13, 16, 13, 16, 13, 14, 14, 16, 14, 16, 13, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 15, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16,
-       5, 13,  7, 12,  9, 13, 11, 12, 10, 14, 10, 13, 11, 13, 12, 13,
-      16, 16, 16, 16, 16, 16, 16, 15,  7, 14,  8, 12, 11, 14, 11, 12,
-      11, 16, 11, 13, 13, 16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 10, 14, 14, 16, 12, 13, 13, 16, 12, 15, 16, 16, 14, 14,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 14, 10, 13,  9, 13, 11, 12,
-      11, 16, 12, 14, 12, 14, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 11, 14, 12, 14, 12, 13, 11, 16, 12, 14, 12, 15, 13, 13,
-      16, 16, 15, 16, 16, 16, 15, 16, 13, 16, 12, 16, 15, 16, 14, 14,
-      13, 16, 12, 16, 16, 16, 14, 14, 16, 16, 14, 16, 16, 16, 14, 16,
-      11, 16, 13, 16, 10, 14, 12, 13, 14, 16, 14, 16, 13, 16, 14, 14,
-      16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 14, 16, 13, 16, 14, 15,
-      13, 16, 14, 16, 13, 16, 14, 15, 16, 16, 16, 16, 15, 16, 15, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 15, 16,
-      16, 16, 15, 16, 16, 16, 14, 14,  8, 16, 10, 14, 11, 16, 12, 13,
-      12, 16, 12, 14, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 16, 14,
-      10, 16, 10, 14, 12, 16, 12, 13, 13, 16, 12, 15, 14, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 16, 15, 11, 16, 10, 13, 13, 16, 12, 13,
-      14, 16, 12, 14, 15, 16, 13, 13, 16, 16, 16, 16, 16, 16, 15, 14,
-      10, 16, 11, 14, 11, 16, 12, 13, 13, 16, 13, 16, 13, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 16, 15, 11, 16, 12, 14, 13, 16, 13, 14,
-      13, 16, 13, 16, 14, 16, 13, 14, 16, 16, 16, 16, 16, 16, 16, 15,
-      13, 16, 12, 14, 14, 16, 13, 13, 13, 16, 12, 15, 14, 16, 13, 13,
-      16, 16, 14, 16, 16, 16, 14, 13, 11, 16, 12, 16, 11, 15, 12, 13,
-      14, 16, 14, 16, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 14, 14,
-      12, 16, 13, 16, 12, 16, 13, 14, 13, 16, 14, 16, 13, 16, 13, 14,
-      16, 16, 16, 16, 14, 16, 14, 14, 14, 16, 13, 16, 14, 16, 13, 13,
-      13, 16, 13, 16, 14, 16, 13, 13, 15, 16, 13, 14, 13, 15, 12, 12,
-    },
-  },
-  {
-    {
-       0,  7,  4,  6,  4,  7,  6,  7,  6,  9,  7,  8,  7,  9,  8,  8,
-      13, 14, 12, 12, 12, 13, 11, 11,  5,  9,  5,  8,  7,  9,  7,  8,
-       8, 11,  8, 10,  9, 10,  9,  9, 13, 15, 12, 13, 12, 13, 11, 11,
-       9, 14,  8, 11, 11, 13, 10, 10, 11, 15, 10, 12, 12, 13, 10, 11,
-      14, 16, 12, 13, 14, 14, 12, 11,  5,  9,  7,  9,  6,  9,  8,  8,
-       8, 11,  8, 10,  8, 10,  9,  9, 13, 16, 12, 13, 13, 13, 11, 11,
-       7, 11,  8, 10,  9, 11,  9,  9,  9, 13,  9, 11, 10, 11, 10, 10,
-      14, 16, 12, 13, 13, 13, 12, 11, 11, 16, 10, 12, 12, 14, 11, 11,
-      13, 16, 11, 13, 13, 14, 11, 11, 16, 16, 13, 14, 14, 15, 12, 11,
-      10, 15, 11, 13,  9, 12, 10, 10, 12, 16, 12, 13, 11, 12, 11, 11,
-      15, 16, 13, 14, 13, 14, 12, 11, 12, 16, 12, 14, 11, 13, 11, 11,
-      13, 16, 12, 14, 12, 13, 12, 11, 16, 16, 13, 14, 14, 14, 12, 11,
-      14, 16, 13, 14, 14, 15, 12, 12, 16, 16, 13, 14, 14, 16, 12, 12,
-      16, 16, 14, 14, 14, 15, 12, 11,  3,  9,  5,  8,  6,  9,  7,  8,
-       7, 11,  8, 10,  9, 10,  9,  9, 13, 14, 12, 13, 13, 13, 12, 11,
-       6, 11,  6,  9,  8, 10,  8,  9,  9, 12,  8, 10, 10, 11,  9, 10,
-      14, 16, 12, 13, 13, 14, 12, 11,  9, 14,  8, 11, 11, 13, 10, 10,
-      12, 16, 10, 12, 12, 14, 11, 11, 16, 16, 12, 13, 14, 15, 12, 11,
-       6, 11,  8, 10,  7, 10,  8,  9,  9, 12,  9, 11,  9, 11, 10, 10,
-      14, 16, 13, 13, 13, 14, 12, 11,  8, 12,  9, 11,  9, 11,  9, 10,
-      10, 13,  9, 11, 10, 12, 10, 10, 14, 16, 12, 13, 13, 14, 12, 11,
-      12, 16, 10, 12, 12, 14, 11, 11, 12, 16, 10, 12, 13, 14, 11, 11,
-      15, 16, 12, 13, 14, 14, 11, 11, 10, 15, 11, 13,  9, 12, 10, 10,
-      12, 16, 12, 14, 11, 13, 11, 11, 16, 16, 14, 14, 14, 14, 12, 11,
-      12, 16, 12, 14, 11, 13, 11, 11, 13, 16, 12, 14, 11, 13, 11, 11,
-      16, 16, 13, 14, 13, 14, 12, 11, 14, 16, 13, 14, 14, 15, 12, 11,
-      14, 16, 13, 14, 13, 15, 12, 11, 16, 16, 13, 14, 13, 14, 11, 10,
-       6, 13,  8, 11,  9, 12, 10, 10, 10, 14, 10, 12, 11, 13, 11, 11,
-      16, 16, 13, 14, 14, 14, 13, 12,  8, 14,  8, 12, 10, 13, 10, 11,
-      11, 15, 10, 12, 12, 13, 11, 11, 16, 16, 14, 14, 15, 16, 13, 12,
-      11, 16,  9, 12, 12, 14, 11, 11, 13, 16, 11, 13, 13, 16, 11, 11,
-      16, 16, 13, 14, 16, 16, 13, 12,  8, 14, 10, 12,  9, 12, 10, 11,
-      11, 15, 11, 13, 11, 13, 11, 11, 16, 16, 14, 15, 14, 15, 13, 12,
-      10, 15, 10, 13, 11, 13, 11, 11, 11, 15, 11, 13, 12, 13, 11, 11,
-      16, 16, 13, 15, 14, 15, 13, 12, 12, 16, 11, 13, 13, 15, 11, 11,
-      13, 16, 11, 13, 13, 15, 11, 11, 16, 16, 12, 14, 14, 16, 12, 11,
-      11, 16, 12, 14, 10, 13, 11, 11, 13, 16, 13, 15, 12, 14, 12, 12,
-      16, 16, 15, 16, 14, 15, 13, 12, 12, 16, 13, 14, 12, 14, 12, 12,
-      13, 16, 13, 14, 12, 14, 12, 12, 16, 16, 14, 15, 13, 14, 12, 12,
-      15, 16, 13, 15, 14, 16, 12, 12, 14, 16, 13, 14, 13, 15, 12, 12,
-      15, 16, 12, 13, 13, 14, 11, 10,  9, 15, 10, 13, 11, 14, 11, 12,
-      12, 16, 12, 14, 12, 14, 12, 12, 16, 16, 14, 14, 14, 15, 13, 12,
-      10, 16, 10, 13, 12, 14, 12, 12, 13, 16, 12, 14, 13, 15, 12, 12,
-      16, 16, 14, 14, 15, 16, 13, 12, 11, 16,  9, 12, 13, 15, 11, 11,
-      14, 16, 11, 13, 14, 16, 11, 11, 16, 16, 13, 14, 16, 16, 12, 11,
-      10, 16, 11, 14, 11, 14, 12, 12, 13, 16, 13, 14, 12, 14, 12, 12,
-      16, 16, 14, 15, 15, 15, 13, 12, 11, 16, 12, 14, 12, 15, 12, 12,
-      13, 16, 12, 14, 13, 15, 12, 12, 16, 16, 14, 15, 15, 16, 13, 12,
-      12, 16, 11, 13, 13, 15, 11, 11, 13, 16, 11, 13, 13, 15, 11, 11,
-      16, 16, 12, 13, 14, 16, 12, 10, 11, 16, 12, 14, 10, 13, 11, 11,
-      14, 16, 13, 14, 12, 14, 11, 11, 16, 16, 15, 16, 14, 14, 12, 11,
-      12, 16, 13, 14, 11, 14, 11, 11, 13, 16, 13, 14, 12, 14, 11, 11,
-      16, 16, 14, 15, 13, 14, 12, 11, 14, 16, 12, 14, 13, 14, 11, 10,
-      13, 16, 12, 13, 12, 14, 11, 10, 14, 16, 11, 12, 12, 12, 10,  8,
-    },
-    {
-       0,  8,  4,  9,  5,  9,  8, 10,  6, 11,  8, 11,  9, 12, 11, 12,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 11,  6, 11,  9, 12, 10, 12,
-       9, 13, 10, 13, 11, 16, 12, 13, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 11, 16, 16, 16, 14, 16, 14, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 11,  8, 12,  7, 12, 10, 12,
-       8, 13, 10, 13, 10, 13, 12, 14, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 13, 10, 14, 11, 16, 12, 14, 11, 16, 12, 16, 12, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 14, 16, 12, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  1, 10,  5, 10,  7, 11,  9, 11,
-       8, 12,  9, 12, 10, 13, 12, 13, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 12,  7, 12, 10, 13, 11, 12,  9, 16, 10, 13, 12, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 10, 16, 16, 16, 14, 16,
-      14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       6, 12,  9, 13,  8, 12, 11, 13, 10, 16, 11, 16, 11, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16, 10, 14, 11, 16, 12, 16,
-      10, 16, 11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 14, 16, 11, 16, 14, 16,
-      16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       6, 16,  9, 13, 10, 16, 12, 14, 11, 16, 12, 16, 12, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16,  9, 14, 12, 16, 13, 16,
-      12, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 10, 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16, 11, 16, 10, 16, 12, 16,
-      12, 16, 13, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 12, 16, 13, 16, 14, 16, 11, 16, 13, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 16, 16,
-      14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 11, 16, 14, 16, 16, 16, 16, 16, 14, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16, 11, 16, 12, 16, 13, 16,
-      13, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 11, 16, 13, 16, 14, 16, 14, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 10, 16, 16, 16, 13, 16,
-      16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 12, 16, 12, 16, 13, 16, 13, 16, 16, 16, 14, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 14, 16, 16, 16,
-      13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      13, 16, 12, 16, 16, 16, 14, 16, 14, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 11, 16, 13, 16,
-      16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      13, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 15,
-    },
-  },
-  {
-    {
-       0,  7,  3,  7,  4,  7,  6,  7,  6,  9,  7,  9,  7,  9,  8,  9,
-      13, 14, 12, 13, 13, 13, 12, 12,  4,  9,  5,  9,  7,  9,  8,  9,
-       7, 11,  8, 10,  9, 11,  9, 10, 13, 16, 12, 14, 13, 14, 12, 12,
-       9, 14,  8, 12, 12, 14, 10, 11, 11, 16, 10, 13, 13, 14, 11, 12,
-      15, 16, 13, 14, 14, 16, 12, 12,  5, 10,  7,  9,  6,  9,  8,  9,
-       8, 11,  8, 11,  8, 10,  9, 10, 14, 16, 12, 14, 13, 14, 12, 12,
-       7, 12,  8, 11,  9, 11,  9, 10,  9, 13,  9, 12, 10, 12, 10, 11,
-      14, 16, 12, 14, 13, 14, 12, 12, 12, 16, 11, 13, 13, 15, 11, 12,
-      13, 16, 11, 14, 13, 15, 12, 12, 15, 16, 13, 15, 14, 16, 13, 13,
-      10, 15, 12, 14,  9, 13, 11, 12, 12, 16, 12, 14, 11, 13, 12, 12,
-      15, 16, 13, 15, 14, 15, 13, 13, 12, 16, 12, 14, 12, 14, 12, 12,
-      13, 16, 13, 14, 12, 14, 12, 12, 16, 16, 14, 15, 14, 16, 13, 13,
-      15, 16, 13, 15, 14, 16, 12, 13, 16, 16, 14, 16, 14, 16, 13, 13,
-      16, 16, 14, 16, 15, 16, 13, 13,  3,  9,  5,  9,  6,  9,  8,  9,
-       7, 11,  8, 10,  9, 11,  9, 10, 14, 15, 13, 14, 13, 14, 12, 12,
-       5, 11,  6, 10,  8, 11,  9, 10,  9, 12,  9, 11, 10, 12, 10, 11,
-      14, 16, 13, 14, 14, 15, 13, 13,  9, 15,  8, 12, 12, 14, 10, 11,
-      12, 16, 10, 13, 13, 15, 11, 12, 15, 16, 13, 14, 14, 16, 13, 13,
-       6, 11,  8, 11,  7, 10,  9, 10,  9, 13, 10, 12,  9, 12, 10, 11,
-      14, 16, 13, 14, 14, 14, 13, 13,  8, 13,  9, 12,  9, 12, 10, 11,
-       9, 13,  9, 12, 10, 12, 10, 11, 14, 16, 12, 14, 13, 14, 12, 12,
-      12, 16, 11, 13, 13, 15, 11, 12, 12, 16, 11, 13, 13, 15, 11, 12,
-      14, 16, 12, 14, 14, 15, 12, 12, 10, 15, 11, 14,  9, 13, 11, 12,
-      12, 16, 12, 14, 11, 14, 12, 12, 16, 16, 14, 16, 14, 15, 13, 13,
-      12, 16, 12, 14, 11, 14, 12, 12, 12, 16, 13, 14, 11, 14, 12, 12,
-      15, 16, 14, 15, 13, 15, 12, 13, 14, 16, 13, 15, 14, 16, 13, 13,
-      14, 16, 13, 15, 14, 16, 12, 13, 15, 16, 13, 15, 13, 15, 12, 12,
-       6, 13,  8, 12,  9, 12, 10, 11, 10, 14, 11, 13, 11, 13, 12, 12,
-      15, 16, 14, 15, 15, 15, 14, 13,  8, 14,  9, 12, 11, 13, 11, 12,
-      11, 15, 11, 13, 12, 14, 12, 12, 16, 16, 14, 15, 15, 16, 14, 14,
-      10, 16,  9, 13, 12, 15, 11, 12, 13, 16, 11, 14, 13, 16, 12, 12,
-      16, 16, 14, 15, 16, 16, 13, 13,  8, 14, 10, 13,  9, 13, 11, 12,
-      11, 15, 12, 14, 11, 14, 12, 12, 16, 16, 15, 16, 15, 16, 14, 14,
-      10, 15, 10, 13, 11, 14, 11, 12, 11, 15, 11, 14, 12, 14, 12, 12,
-      15, 16, 14, 15, 14, 16, 13, 13, 12, 16, 11, 14, 13, 16, 12, 12,
-      12, 16, 11, 14, 13, 15, 12, 12, 15, 16, 12, 14, 15, 16, 13, 13,
-      11, 16, 12, 14, 10, 14, 11, 12, 13, 16, 13, 16, 12, 14, 12, 13,
-      16, 16, 16, 16, 15, 16, 14, 13, 12, 16, 13, 15, 12, 14, 12, 13,
-      13, 16, 13, 15, 12, 14, 12, 13, 16, 16, 14, 16, 13, 15, 13, 13,
-      15, 16, 14, 16, 14, 16, 13, 13, 14, 16, 13, 15, 13, 16, 13, 13,
-      14, 16, 12, 14, 13, 14, 12, 12,  9, 16, 11, 14, 11, 15, 12, 13,
-      13, 16, 12, 14, 12, 15, 13, 13, 16, 16, 14, 15, 15, 15, 14, 13,
-      11, 16, 11, 14, 12, 16, 12, 13, 13, 16, 12, 14, 13, 16, 13, 13,
-      16, 16, 14, 15, 16, 16, 14, 13, 11, 16, 10, 13, 13, 16, 11, 12,
-      14, 16, 11, 14, 14, 16, 12, 12, 16, 16, 14, 14, 16, 16, 13, 12,
-      11, 16, 12, 14, 11, 15, 12, 13, 13, 16, 13, 15, 13, 16, 13, 13,
-      16, 16, 15, 16, 15, 16, 14, 13, 11, 16, 12, 15, 12, 16, 12, 13,
-      13, 16, 13, 15, 13, 16, 13, 13, 16, 16, 15, 16, 15, 16, 14, 13,
-      12, 16, 11, 14, 13, 16, 12, 12, 13, 16, 11, 14, 13, 16, 12, 12,
-      16, 16, 13, 14, 15, 16, 12, 12, 11, 16, 12, 14, 10, 14, 11, 12,
-      14, 16, 13, 15, 12, 15, 12, 12, 16, 16, 16, 16, 14, 15, 13, 12,
-      12, 16, 13, 15, 12, 14, 12, 12, 13, 16, 13, 15, 12, 14, 12, 12,
-      16, 16, 14, 16, 14, 15, 12, 12, 14, 16, 13, 15, 13, 16, 11, 12,
-      13, 16, 12, 14, 13, 15, 11, 11, 14, 16, 12, 13, 12, 13, 11, 10,
-    },
-    {
-       0,  8,  4,  9,  5, 10,  9, 11,  5, 11,  9, 12,  9, 13, 12, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 11,  6, 12,  9, 13, 11, 13,
-       9, 16, 10, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 12,  8, 13,  7, 12, 11, 16,
-       8, 16, 11, 16, 11, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 10, 16, 11, 16, 13, 16, 11, 16, 12, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  1, 10,  6, 11,  7, 12, 10, 13,
-       7, 12, 10, 13, 10, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 13,  7, 12, 10, 16, 12, 16, 10, 16, 11, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 16, 16, 16, 16, 16,
-      16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 13,  9, 16,  8, 16, 12, 16,  9, 16, 12, 16, 11, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16, 11, 16, 12, 16, 13, 16,
-      10, 16, 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       6, 16,  9, 16, 10, 16, 13, 16, 11, 16, 12, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16,  9, 16, 12, 16, 13, 16,
-      12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 10, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16, 11, 16, 11, 16, 13, 16,
-      12, 16, 13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 12, 16, 13, 16, 16, 16, 11, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  7, 16, 11, 16, 12, 16, 16, 16,
-      13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 11, 16, 13, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 10, 16, 16, 16, 16, 16,
-      16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 16, 16, 11, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      13, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-  },
-  {
-    {
-       0,  7,  4,  8,  4,  8,  7,  8,  6, 10,  7, 10,  8, 10,  9, 10,
-      13, 16, 13, 15, 13, 15, 13, 14,  4, 10,  5, 10,  7, 10,  9, 10,
-       7, 12,  8, 11,  9, 12, 10, 11, 13, 16, 13, 15, 13, 16, 13, 14,
-       9, 16,  9, 13, 12, 16, 11, 13, 11, 16, 11, 14, 13, 16, 12, 14,
-      15, 16, 14, 16, 15, 16, 14, 14,  4, 10,  7, 10,  6, 10,  9, 10,
-       8, 12,  9, 12,  9, 11, 10, 12, 13, 16, 13, 16, 14, 16, 13, 14,
-       7, 12,  8, 12,  9, 12, 10, 12,  9, 13, 10, 13, 10, 13, 11, 12,
-      14, 16, 13, 16, 14, 16, 13, 14, 12, 16, 11, 14, 13, 16, 12, 14,
-      13, 16, 12, 16, 14, 16, 13, 14, 16, 16, 14, 16, 15, 16, 14, 14,
-      10, 16, 12, 15, 10, 14, 12, 13, 12, 16, 13, 16, 12, 14, 13, 14,
-      15, 16, 14, 16, 14, 16, 14, 14, 12, 16, 13, 16, 12, 16, 13, 14,
-      13, 16, 13, 16, 13, 16, 13, 14, 16, 16, 14, 16, 15, 16, 14, 15,
-      15, 16, 14, 16, 15, 16, 13, 15, 16, 16, 14, 16, 15, 16, 14, 15,
-      16, 16, 16, 16, 16, 16, 15, 15,  2,  9,  5, 10,  6, 10,  8, 10,
-       7, 11,  8, 11,  9, 11, 10, 11, 14, 16, 13, 15, 14, 15, 14, 14,
-       5, 11,  6, 11,  8, 12,  9, 11,  8, 13,  9, 12, 10, 13, 11, 12,
-      14, 16, 13, 15, 14, 16, 14, 14,  9, 16,  8, 13, 12, 16, 11, 13,
-      12, 16, 11, 14, 13, 16, 12, 13, 16, 16, 14, 16, 15, 16, 14, 15,
-       5, 12,  8, 11,  7, 11,  9, 11,  9, 13, 10, 13, 10, 13, 11, 12,
-      14, 16, 14, 16, 14, 16, 14, 15,  8, 13,  9, 13, 10, 13, 11, 12,
-       9, 13, 10, 13, 10, 13, 11, 13, 13, 16, 13, 15, 13, 16, 13, 14,
-      12, 16, 11, 14, 13, 16, 12, 14, 12, 16, 11, 14, 13, 16, 12, 14,
-      14, 16, 13, 16, 14, 16, 13, 14, 10, 16, 12, 15,  9, 14, 11, 13,
-      12, 16, 13, 16, 12, 15, 12, 14, 16, 16, 15, 16, 15, 16, 14, 14,
-      12, 16, 13, 16, 12, 16, 12, 14, 12, 16, 13, 16, 12, 15, 13, 14,
-      15, 16, 14, 16, 14, 16, 14, 14, 15, 16, 14, 16, 14, 16, 14, 15,
-      14, 16, 13, 16, 14, 16, 13, 14, 16, 16, 14, 16, 14, 16, 13, 14,
-       6, 14,  9, 13,  9, 14, 11, 12, 10, 14, 11, 13, 11, 14, 12, 13,
-      16, 16, 15, 16, 15, 16, 14, 15,  8, 15,  9, 13, 11, 14, 11, 13,
-      11, 16, 11, 14, 12, 15, 12, 14, 16, 16, 15, 16, 16, 16, 15, 16,
-      10, 16,  9, 14, 12, 16, 12, 13, 13, 16, 11, 15, 14, 16, 13, 14,
-      16, 16, 15, 16, 16, 16, 15, 16,  8, 15, 10, 13, 10, 14, 11, 13,
-      11, 16, 12, 14, 12, 14, 12, 14, 16, 16, 16, 16, 16, 16, 15, 16,
-      10, 16, 11, 14, 11, 15, 12, 13, 11, 16, 11, 14, 12, 15, 12, 14,
-      16, 16, 14, 16, 15, 16, 14, 15, 12, 16, 11, 15, 13, 16, 13, 14,
-      12, 16, 11, 14, 13, 16, 13, 14, 15, 16, 13, 16, 16, 16, 14, 15,
-      10, 16, 12, 15, 10, 15, 12, 13, 13, 16, 13, 16, 12, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 15, 15, 12, 16, 13, 16, 12, 16, 13, 14,
-      12, 16, 13, 16, 12, 16, 13, 14, 16, 16, 15, 16, 14, 16, 14, 15,
-      15, 16, 14, 16, 15, 16, 14, 15, 14, 16, 13, 16, 14, 16, 13, 14,
-      14, 16, 13, 15, 14, 16, 13, 14,  9, 16, 11, 16, 11, 16, 12, 14,
-      13, 16, 12, 16, 13, 16, 13, 14, 16, 16, 15, 16, 16, 16, 15, 15,
-      11, 16, 11, 16, 12, 16, 13, 14, 13, 16, 12, 16, 13, 16, 13, 14,
-      16, 16, 15, 16, 16, 16, 15, 15, 11, 16, 10, 15, 13, 16, 12, 13,
-      14, 16, 12, 16, 14, 16, 13, 14, 16, 16, 15, 16, 16, 16, 14, 14,
-      11, 16, 12, 16, 11, 16, 13, 14, 13, 16, 13, 16, 13, 16, 13, 14,
-      16, 16, 16, 16, 16, 16, 15, 15, 11, 16, 12, 16, 12, 16, 13, 14,
-      13, 16, 13, 16, 13, 16, 13, 14, 16, 16, 15, 16, 16, 16, 15, 14,
-      12, 16, 12, 15, 13, 16, 12, 14, 13, 16, 12, 16, 14, 16, 13, 14,
-      16, 16, 14, 16, 16, 16, 14, 14, 11, 16, 12, 16, 11, 16, 12, 14,
-      14, 16, 14, 16, 12, 16, 13, 14, 16, 16, 16, 16, 16, 16, 15, 14,
-      12, 16, 13, 16, 12, 16, 12, 14, 13, 16, 13, 16, 12, 16, 13, 14,
-      16, 16, 16, 16, 15, 16, 14, 14, 14, 16, 13, 16, 14, 16, 12, 14,
-      13, 16, 13, 16, 13, 16, 12, 13, 15, 16, 13, 14, 14, 15, 13, 13,
-    },
-    {
-       0,  8,  4, 10,  5, 11, 10, 16,  5, 12,  9, 16, 10, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 12,  7, 12,  9, 16, 12, 16,
-       9, 16, 11, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 12,  9, 16,  8, 16, 12, 16,
-       8, 16, 11, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       8, 16, 11, 16, 12, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  1, 11,  6, 12,  7, 16, 11, 16,
-       7, 16, 10, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 16,  7, 16, 10, 16, 12, 16,  9, 16, 11, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 16, 10, 16,  8, 16, 12, 16,  9, 16, 12, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16, 11, 16, 12, 16, 16, 16,
-      10, 16, 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 16,  9, 16, 10, 16, 16, 16, 11, 16, 12, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16,  9, 16, 12, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16, 11, 16, 11, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 12, 16, 16, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      11, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 16, 10, 16, 12, 16, 16, 16,
-      12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16,  9, 16, 16, 16, 16, 16,
-      16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 16, 16, 11, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-  },
-  {
-    {
-       0,  8,  4, 10,  5,  9,  8, 10,  6, 11,  8, 12,  8, 11, 10, 13,
-      14, 16, 14, 16, 14, 16, 16, 16,  3, 11,  5, 11,  8, 12, 10, 12,
-       7, 12,  9, 13, 10, 13, 11, 13, 14, 16, 14, 16, 16, 16, 16, 16,
-       9, 16,  9, 16, 12, 16, 12, 16, 11, 16, 11, 16, 14, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 11,  7, 12,  6, 11, 10, 12,
-       8, 13,  9, 13,  9, 13, 11, 14, 13, 16, 14, 16, 14, 16, 16, 16,
-       7, 13,  9, 13,  9, 13, 11, 13,  9, 14, 10, 16, 11, 16, 12, 16,
-      15, 16, 14, 16, 16, 16, 16, 16, 12, 16, 12, 16, 14, 16, 13, 16,
-      13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 12, 16, 10, 16, 13, 16, 12, 16, 13, 16, 12, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 13, 16, 13, 16, 14, 16,
-      13, 16, 14, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  2, 10,  5, 11,  6, 11,  9, 11,
-       7, 12,  9, 13,  9, 13, 11, 13, 14, 16, 16, 16, 16, 16, 16, 16,
-       4, 12,  6, 12,  8, 13, 10, 13,  8, 13,  9, 13, 11, 16, 12, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16,  8, 16, 12, 16, 12, 16,
-      12, 16, 11, 16, 13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 12,  8, 13,  7, 13, 10, 13,  8, 14, 10, 14, 10, 14, 12, 14,
-      16, 16, 16, 16, 16, 16, 16, 16,  7, 14,  9, 16, 10, 16, 11, 14,
-       8, 14, 10, 16, 11, 16, 12, 16, 13, 16, 14, 16, 16, 16, 16, 16,
-      11, 16, 11, 16, 13, 16, 13, 16, 12, 16, 12, 16, 14, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16, 12, 16, 10, 16, 12, 16,
-      12, 16, 13, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 13, 16, 12, 16, 14, 16, 12, 16, 13, 16, 12, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       6, 16,  8, 16,  9, 16, 11, 13, 10, 16, 11, 16, 11, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  7, 16,  9, 16, 10, 16, 12, 16,
-      11, 16, 11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16,  9, 16, 12, 16, 13, 16, 13, 16, 12, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  7, 16, 10, 16,  9, 16, 12, 16,
-      11, 16, 12, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 16, 11, 16, 11, 16, 12, 16, 11, 16, 12, 16, 13, 16, 13, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 12, 16, 14, 16, 14, 16,
-      12, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 12, 16, 10, 16, 13, 16, 13, 16, 14, 16, 13, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 13, 16, 12, 16, 14, 16,
-      12, 16, 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16, 11, 16, 11, 16, 13, 16,
-      12, 16, 13, 16, 13, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 11, 16, 13, 16, 13, 16, 13, 16, 13, 16, 14, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 16, 14, 16, 13, 16,
-      14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 12, 16, 12, 16, 13, 16, 13, 16, 13, 16, 13, 16, 14, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 12, 16, 13, 16, 14, 16,
-      13, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 12, 16, 14, 16, 14, 16, 14, 16, 14, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 11, 16, 14, 16,
-      16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 14, 16, 13, 16, 14, 16, 16, 16, 16, 16, 14, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       0, 10,  4, 12,  5, 16, 11, 16,  6, 16, 10, 16, 11, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  3, 16,  7, 16, 10, 16, 16, 16,
-       9, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  4, 16, 10, 16,  9, 16, 16, 16,
-       9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 16, 12, 16, 16, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  1, 16,  6, 16,  8, 16, 16, 16,
-       8, 16, 11, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 16,  8, 16, 11, 16, 16, 16, 10, 16, 12, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 11, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 16, 11, 16,  9, 16, 16, 16, 10, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  9, 16, 12, 16, 16, 16, 16, 16,
-      10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       5, 16,  9, 16, 11, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16, 10, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  8, 16, 16, 16, 11, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      12, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16,  6, 16, 11, 16, 15, 16, 16, 16,
-      15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-       9, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16,  9, 16, 16, 16, 16, 16,
-      16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-  },
-};
-
-static const uint8_t rv34_table_inter_secondpat[NUM_INTER_TABLES][2][OTHERBLK_VLC_SIZE] = {
-  {
-    {
-       0,  4,  8,  3,  6,  8,  6,  7,  8,  4,  6,  8,  6,  7,  8,  7,
-       8,  8,  7,  8,  8,  8,  8,  8,  8,  8,  8,  3,  6,  8,  4,  6,
-       9,  7,  7,  8,  5,  7,  9,  6,  7,  9,  8,  8,  8,  7,  8,  8,
-       8,  8,  8,  8,  8,  7,  6,  8,  9,  7,  8,  9,  7,  8,  9,  7,
-       8,  9,  7,  8,  9,  8,  8,  9,  8,  8,  9,  8,  9,  9,  8,  8,
-       8,  8,  9,  9,  8,  9,  9,  7,  8,  8,  8,  9,  9,  8,  9,  9,
-       8,  8,  8,  7,  8,  8,  8,  8,  8,  7,  7,  6,
-    },
-    {
-       0,  4,  9,  3,  6,  9,  7,  8, 10,  3,  6,  9,  5,  7, 10,  9,
-       9, 10,  7,  8, 10,  8,  9, 10, 10, 10, 10,  2,  6,  9,  4,  7,
-      10,  8,  9, 10,  4,  7, 10,  6,  7, 10,  9,  9, 10,  7,  8, 10,
-       8,  9, 10, 10, 10, 10,  6,  8, 10,  7,  9, 11,  9, 10, 11,  7,
-       9, 11,  8,  9, 11, 10, 10, 11,  8,  9, 11,  9, 10, 11, 11, 11,
-      10,  8, 10, 11,  9, 10, 11,  9, 10, 11,  8, 10, 11,  9, 10, 11,
-      10, 10, 11,  8, 10, 11,  9, 10, 10, 10, 10,  9,
-    },
-  },
-  {
-    {
-       0,  4,  8,  3,  6,  8,  6,  7,  9,  4,  6,  8,  5,  7,  8,  8,
-       8,  9,  7,  7,  8,  8,  8,  8,  8,  9,  8,  3,  6,  8,  4,  6,
-       9,  7,  7,  9,  5,  6,  9,  6,  7,  9,  8,  8,  9,  7,  8,  8,
-       8,  8,  8,  8,  8,  8,  6,  8,  9,  7,  8, 10,  7,  8,  9,  7,
-       8, 10,  7,  8, 10,  8,  8,  9,  7,  8,  9,  8,  9,  9,  9,  9,
-       8,  7,  9, 10,  8,  9, 10,  8,  8,  8,  8,  9, 10,  8,  9,  9,
-       8,  8,  8,  7,  8,  8,  8,  8,  8,  8,  7,  6,
-    },
-    {
-       0,  4,  9,  3,  6, 10,  8,  9, 11,  3,  5,  9,  5,  7, 10,  9,
-      10, 11,  7,  8, 10,  9,  9, 11, 11, 11, 12,  2,  5, 10,  4,  7,
-      10,  8,  9, 11,  4,  6, 10,  6,  7, 10,  9, 10, 11,  7,  9, 10,
-       9,  9, 11, 11, 11, 11,  6,  8, 11,  7,  9, 11,  9, 10, 12,  7,
-       9, 11,  8,  9, 12, 10, 10, 12,  8, 10, 11, 10, 10, 11, 12, 11,
-      11,  8, 10, 12,  9, 11, 12, 10, 11, 12,  9, 10, 12, 10, 11, 12,
-      11, 11, 12,  9, 10, 12, 10, 10, 11, 11, 11, 10,
-    },
-  },
-  {
-    {
-       0,  4,  8,  3,  6,  9,  7,  8,  9,  4,  6,  8,  5,  7,  9,  8,
-       9,  9,  7,  8,  9,  8,  8,  9,  9,  9,  9,  2,  6,  9,  4,  6,
-       9,  7,  8, 10,  5,  7,  9,  6,  7,  9,  8,  8,  9,  7,  8,  9,
-       8,  8,  9,  9,  9,  9,  6,  8, 10,  7,  8, 10,  8,  9, 10,  6,
-       8, 10,  8,  8, 10,  9,  9, 10,  8,  9, 10,  9,  9, 10, 10, 10,
-       9,  8,  9, 10,  8,  9, 10,  8,  9, 10,  8,  9, 10,  9,  9, 10,
-       9,  9,  9,  8,  9,  9,  8,  9,  9,  9,  9,  8,
-    },
-    {
-       0,  4, 10,  3,  6, 10,  8, 10, 12,  2,  6, 10,  6,  8, 11, 10,
-      11, 12,  7,  9, 11,  9, 10, 12, 12, 13, 13,  2,  6, 10,  4,  7,
-      11,  9, 10, 13,  4,  7, 11,  7,  8, 11, 10, 11, 12,  8,  9, 12,
-      10, 10, 12, 12, 12, 13,  6,  9, 12,  8, 10, 13, 10, 12, 14,  7,
-      10, 13,  9, 10, 13, 11, 11, 13,  9, 11, 13, 11, 11, 13, 13, 13,
-      13,  9, 11, 13, 10, 12, 14, 11, 12, 14,  9, 11, 14, 11, 12, 14,
-      12, 12, 14,  9, 12, 13, 11, 12, 13, 13, 12, 12,
-    },
-  },
-  {
-    {
-       0,  4,  9,  3,  6,  9,  7,  8, 10,  3,  6,  9,  6,  7,  9,  9,
-       9, 10,  7,  8,  9,  8,  9, 10, 10, 10, 11,  2,  6,  9,  4,  7,
-      10,  7,  9, 10,  4,  7, 10,  6,  7, 10,  9,  9, 10,  7,  8, 10,
-       8,  9, 10, 10, 10, 10,  6,  8, 11,  7,  9, 11,  8, 10, 11,  6,
-       9, 11,  8,  9, 11,  9,  9, 11,  8,  9, 11,  9, 10, 11, 11, 10,
-      10,  8, 10, 11,  9, 10, 11,  9, 10, 11,  8, 10, 11,  9, 10, 11,
-      10, 10, 11,  8, 10, 11,  9, 10, 11, 10, 10, 10,
-    },
-    {
-       0,  4, 12,  3,  7, 12, 10, 11, 14,  3,  6, 12,  7,  9, 13, 12,
-      13, 14,  8, 11, 13, 11, 12, 14, 14, 14, 14,  1,  7, 12,  5,  8,
-      13, 10, 12, 14,  4,  8, 13,  8,  9, 13, 12, 13, 14,  9, 11, 14,
-      11, 12, 14, 14, 14, 14,  7, 10, 14,  9, 11, 14, 11, 13, 16,  8,
-      11, 14, 10, 12, 14, 13, 13, 16, 10, 12, 15, 12, 13, 15, 15, 15,
-      15, 10, 13, 15, 12, 13, 14, 13, 15, 15, 10, 13, 15, 12, 13, 15,
-      13, 14, 15, 10, 13, 14, 12, 13, 14, 14, 14, 14,
-    },
-  },
-  {
-    {
-       0,  4,  9,  3,  6, 10,  7,  9, 11,  3,  5,  9,  5,  7, 10,  9,
-      10, 12,  7,  8, 10,  9, 10, 11, 11, 12, 12,  2,  6, 10,  4,  7,
-      10,  7,  9, 12,  4,  7, 10,  6,  7, 11,  9, 10, 12,  7,  9, 11,
-       9,  9, 11, 11, 11, 12,  5,  8, 11,  7,  9, 12,  9, 10, 13,  6,
-       9, 12,  8,  9, 12, 10, 10, 12,  8, 10, 12, 10, 10, 12, 12, 12,
-      12,  8, 10, 12,  9, 11, 13, 10, 11, 13,  9, 11, 13, 10, 11, 13,
-      11, 11, 13,  9, 11, 12, 10, 11, 12, 11, 11, 12,
-    },
-    {
-       0,  4, 12,  3,  7, 13, 10, 12, 15,  3,  7, 13,  7,  9, 14, 12,
-      12, 13,  8, 11, 14, 11, 13, 15, 15, 14, 14,  1,  6, 13,  5,  8,
-      13, 10, 13, 15,  4,  8, 13,  8,  9, 14, 13, 13, 15,  8, 11, 14,
-      12, 12, 15, 15, 14, 14,  7, 10, 13,  9, 11, 13, 12, 14, 16,  8,
-      11, 14, 10, 12, 15, 13, 13, 16, 10, 12, 15, 12, 13, 15, 15, 14,
-      15, 11, 12, 14, 12, 14, 14, 13, 15, 15, 10, 12, 14, 12, 13, 15,
-      14, 15, 15, 10, 13, 13, 12, 13, 15, 14, 14, 15,
-    },
-  },
-  {
-    {
-       0,  5, 10,  3,  7, 11,  9, 11, 14,  3,  7, 11,  7,  8, 12, 11,
-      12, 14,  7,  9, 12, 10, 11, 14, 13, 14, 16,  1,  7, 11,  5,  8,
-      12,  9, 11, 15,  4,  8, 12,  7,  9, 13, 11, 12, 15,  8, 10, 13,
-      10, 11, 14, 14, 14, 16,  6,  9, 13,  8, 11, 14, 10, 13, 16,  7,
-      10, 14,  9, 11, 15, 12, 13, 16,  9, 11, 15, 12, 12, 15, 14, 14,
-      16, 10, 12, 14, 11, 13, 15, 12, 14, 16, 10, 12, 15, 11, 13, 16,
-      13, 14, 16, 10, 13, 16, 12, 13, 15, 14, 15, 16,
-    },
-    {
-       0,  5, 16,  3,  8, 14, 11, 13, 14,  2,  8, 14,  8, 10, 16, 13,
-      13, 14,  9, 13, 16, 12, 13, 16, 16, 14, 16,  1,  7, 14,  6, 10,
-      14, 12, 16, 16,  5,  9, 14,  9, 11, 16, 15, 16, 16, 10, 12, 16,
-      13, 13, 16, 16, 14, 16,  8, 11, 14, 11, 13, 14, 14, 14, 16,  8,
-      12, 14, 11, 13, 16, 16, 16, 16, 10, 12, 15, 13, 14, 16, 16, 16,
-      16, 11, 14, 14, 14, 15, 16, 16, 15, 16, 10, 13, 16, 13, 14, 14,
-      16, 16, 16, 10, 13, 16, 13, 14, 16, 16, 16, 16,
-    },
-  },
-  {
-    {
-       0,  5, 11,  3,  7, 13,  9, 12, 16,  3,  7, 12,  6,  9, 14, 11,
-      13, 16,  7, 10, 16, 11, 12, 16, 16, 16, 16,  1,  6, 12,  5,  9,
-      16,  9, 13, 16,  4,  8, 16,  7, 10, 16, 12, 15, 16,  7, 11, 16,
-      11, 12, 16, 16, 16, 16,  6, 10, 15,  8, 11, 16, 11, 14, 16,  7,
-      11, 16, 10, 12, 16, 13, 16, 16,  9, 13, 16, 13, 14, 16, 16, 16,
-      16, 10, 12, 16, 12, 16, 16, 16, 16, 16, 11, 13, 16, 13, 16, 16,
-      16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       0,  5, 16,  3,  8, 16, 12, 12, 16,  2,  8, 16,  8, 10, 16, 13,
-      13, 16,  9, 13, 16, 12, 13, 16, 16, 16, 16,  1,  8, 16,  6, 10,
-      16, 12, 16, 16,  5,  9, 16,  9, 11, 16, 13, 16, 16,  9, 12, 14,
-      12, 12, 16, 16, 16, 16,  8, 11, 13, 11, 12, 16, 14, 16, 16,  8,
-      12, 16, 11, 13, 16, 16, 15, 16,  9, 13, 14, 12, 13, 16, 16, 16,
-      16, 10, 12, 13, 14, 13, 16, 16, 16, 16,  9, 13, 16, 13, 12, 16,
-      16, 16, 16, 10, 12, 16, 14, 15, 16, 16, 16, 16,
-    },
-  },
-};
-
-static const uint8_t rv34_table_inter_thirdpat[NUM_INTER_TABLES][2][OTHERBLK_VLC_SIZE] = {
-  {
-    {
-       0,  5,  8,  3,  6,  9,  6,  7,  9,  4,  6,  9,  6,  7,  9,  8,
-       8,  9,  7,  8,  9,  8,  9,  9,  9,  9,  9,  2,  6,  9,  4,  7,
-       9,  7,  8,  9,  5,  7,  9,  6,  7,  9,  8,  8,  9,  7,  8,  9,
-       8,  9,  9,  9,  9,  8,  5,  8, 10,  6,  8, 10,  8,  9,  9,  7,
-       8, 10,  7,  9, 10,  8,  9,  9,  8,  9, 10,  9,  9, 10,  9,  9,
-       9,  7,  9, 10,  8,  9, 10,  8,  8,  9,  8,  9, 10,  8,  9, 10,
-       8,  8,  9,  8,  9,  9,  8,  9,  9,  8,  8,  7,
-    },
-    {
-       0,  4,  9,  2,  6, 10,  7,  8, 10,  3,  6, 10,  6,  7, 10,  9,
-       9, 10,  8,  9, 11,  9, 10, 11, 10, 11, 11,  2,  6, 10,  4,  7,
-      10,  8,  9, 10,  5,  7, 10,  7,  8, 10,  9,  9, 10,  9, 10, 11,
-      10, 10, 11, 11, 11, 11,  6,  9, 11,  7,  9, 11,  9, 10, 12,  8,
-       9, 11,  8, 10, 11, 10, 10, 11, 10, 11, 12, 11, 11, 12, 11, 11,
-      11,  9, 11, 12, 10, 11, 12, 10, 11, 12, 10, 11, 12, 10, 11, 12,
-      11, 11, 12, 11, 12, 12, 11, 12, 12, 12, 11, 11,
-    },
-  },
-  {
-    {
-       0,  4,  9,  3,  6,  9,  6,  8,  9,  4,  6,  9,  5,  7,  9,  8,
-       8,  9,  7,  8, 10,  8,  9, 10,  9,  9,  9,  2,  6,  9,  4,  7,
-       9,  7,  8,  9,  5,  7,  9,  6,  7, 10,  8,  9,  9,  7,  9, 10,
-       8,  9, 10,  9,  9,  9,  5,  8, 10,  6,  8, 10,  8,  9, 10,  7,
-       8, 10,  7,  9, 11,  9,  9, 10,  8,  9, 10,  9, 10, 10, 10, 10,
-       9,  7,  9, 10,  8,  9, 11,  8,  9, 10,  8,  9, 11,  8,  9, 11,
-       9,  9, 10,  9,  9, 10,  9,  9, 10,  9,  9,  8,
-    },
-    {
-       0,  4,  9,  2,  5, 10,  7,  8, 11,  3,  6, 10,  6,  7, 10,  9,
-      10, 11,  8,  9, 11,  9, 10, 11, 11, 11, 12,  2,  6, 10,  4,  7,
-      10,  8,  9, 11,  5,  7, 10,  6,  8, 10,  9, 10, 11,  9, 10, 12,
-      10, 10, 12, 11, 12, 12,  6,  9, 11,  8,  9, 12,  9, 11, 13,  8,
-      10, 12,  9, 10, 12, 11, 11, 12, 10, 12, 13, 11, 12, 13, 13, 12,
-      13, 10, 11, 13, 10, 12, 13, 11, 12, 13, 11, 12, 13, 11, 12, 13,
-      12, 12, 13, 12, 13, 14, 13, 13, 14, 13, 13, 13,
-    },
-  },
-  {
-    {
-       0,  4,  9,  3,  6,  9,  7,  8, 10,  3,  6,  9,  5,  7, 10,  8,
-       9, 10,  7,  9, 10,  8,  9, 10, 10, 10, 10,  2,  6,  9,  4,  7,
-      10,  7,  9, 10,  4,  7, 10,  6,  8, 10,  8,  9, 10,  8,  9, 10,
-       9,  9, 10, 10, 10, 10,  5,  8, 11,  7,  9, 11,  8, 10, 11,  7,
-       9, 11,  8,  9, 11,  9, 10, 11,  9, 10, 11, 10, 10, 11, 11, 11,
-      11,  8, 10, 11,  9, 10, 11,  9, 10, 11,  9, 10, 12,  9, 10, 12,
-      10, 11, 11,  9, 10, 11, 10, 11, 11, 10, 10, 10,
-    },
-    {
-       0,  4, 10,  3,  6, 11,  8, 10, 12,  3,  6, 11,  6,  8, 11, 10,
-      11, 13,  9, 10, 13, 11, 12, 14, 13, 13, 14,  1,  6, 10,  5,  8,
-      12,  9, 10, 13,  5,  8, 11,  7,  9, 12, 11, 11, 13, 10, 12, 13,
-      11, 12, 14, 14, 13, 15,  7, 10, 12,  9, 11, 14, 11, 12, 15,  9,
-      11, 13, 10, 11, 14, 12, 12, 14, 12, 14, 16, 13, 13, 16, 14, 14,
-      16, 12, 13, 15, 12, 14, 15, 13, 14, 16, 13, 14, 16, 14, 14, 16,
-      14, 15, 16, 14, 16, 16, 15, 16, 16, 15, 15, 16,
-    },
-  },
-  {
-    {
-       0,  4,  9,  2,  6,  9,  7,  9, 11,  3,  6, 10,  6,  7, 10,  9,
-      10, 11,  7,  9, 10,  9, 10, 11, 11, 11, 12,  2,  6, 10,  4,  7,
-      10,  8,  9, 11,  5,  7, 10,  7,  8, 10,  9, 10, 11,  8,  9, 11,
-       9, 10, 11, 11, 12, 11,  6,  9, 11,  7, 10, 12,  9, 11, 12,  7,
-      10, 12,  9, 10, 12, 11, 11, 12,  9, 11, 12, 10, 11, 12, 12, 12,
-      12,  9, 11, 12,  9, 11, 13, 11, 12, 13,  9, 11, 13, 10, 12, 13,
-      11, 12, 13, 11, 12, 13, 11, 12, 13, 12, 13, 12,
-    },
-    {
-       0,  4, 11,  2,  6, 12,  9, 11, 16,  4,  7, 12,  7,  9, 15, 11,
-      12, 16, 10, 11, 16, 11, 13, 16, 16, 16, 16,  1,  6, 11,  5,  8,
-      16,  9, 12, 16,  6,  9, 15,  8, 10, 16, 12, 13, 16, 12, 14, 16,
-      12, 16, 16, 16, 16, 16,  8, 11, 14, 10, 12, 16, 12, 16, 16, 10,
-      13, 16, 12, 16, 16, 13, 14, 16, 14, 16, 16, 16, 16, 16, 16, 16,
-      16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-  },
-  {
-    {
-       0,  5,  9,  3,  6, 10,  8, 10, 12,  3,  6, 10,  6,  8, 10, 10,
-      11, 12,  8,  9, 11, 10, 10, 12, 13, 13, 13,  1,  6, 10,  5,  8,
-      11,  9, 11, 13,  5,  8, 11,  7,  9, 11, 11, 11, 13,  8,  9, 11,
-      10, 10, 12, 13, 13, 14,  6,  9, 12,  8, 11, 13, 11, 13, 15,  8,
-      10, 13, 10, 11, 13, 12, 13, 15, 10, 12, 13, 12, 12, 13, 14, 14,
-      14,  9, 12, 14, 11, 13, 15, 13, 15, 16, 11, 13, 15, 12, 14, 15,
-      14, 15, 16, 13, 14, 15, 14, 14, 15, 15, 16, 16,
-    },
-    {
-       0,  4, 16,  2,  7, 16, 10, 13, 16,  3,  8, 16,  7, 10, 16, 16,
-      16, 16, 12, 16, 16, 15, 16, 16, 16, 16, 16,  1,  7, 16,  6,  9,
-      16, 10, 16, 16,  7, 12, 16,  9, 13, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16,  9, 16, 16, 11, 13, 16, 16, 16, 16, 12,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-  },
-  {
-    {
-       0,  4,  9,  3,  6, 11,  9, 12, 16,  3,  6, 10,  6,  8, 11, 12,
-      13, 16,  8,  9, 12, 10, 11, 13, 16, 16, 16,  1,  6, 10,  5,  8,
-      12, 10, 13, 16,  5,  8, 11,  8,  9, 13, 13, 14, 16,  9, 10, 14,
-      11, 12, 15, 16, 16, 16,  6, 10, 13,  9, 12, 16, 14, 16, 16,  9,
-      12, 14, 11, 13, 16, 16, 16, 16, 12, 14, 16, 14, 16, 16, 16, 16,
-      16, 11, 16, 16, 13, 16, 16, 16, 16, 16, 12, 16, 16, 13, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       0,  4, 16,  2,  8, 16, 10, 16, 16,  3,  9, 16,  8, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  1,  7, 16,  5, 10,
-      16, 16, 16, 16,  7, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 10, 15, 16, 10, 16, 16, 16, 16, 16, 14,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-  },
-  {
-    {
-       0,  3,  9,  3,  7, 11, 11, 15, 16,  3,  6, 11,  7,  9, 12, 16,
-      16, 16,  8, 10, 16, 11, 16, 16, 16, 16, 16,  1,  6, 11,  6,  9,
-      15, 16, 16, 16,  5,  8, 16,  9, 11, 16, 16, 16, 16, 10, 16, 16,
-      16, 16, 16, 16, 16, 16,  7, 11, 16, 11, 16, 16, 16, 16, 16, 11,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-    {
-       0,  4, 16,  2,  8, 16, 16, 16, 16,  3, 12, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  1,  7, 16,  5, 12,
-      16, 16, 16, 16,  6, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16,  9, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    },
-  },
-};
-
-
-static const uint8_t rv34_inter_coeff[NUM_INTER_TABLES][COEFF_VLC_SIZE] = {
-{
-  1,  2,  4,  4,  5,  5,  6,  7,  7,  7,  8,  8,  8,  9,  9, 10,
- 10, 10, 10, 11, 11, 11, 11, 12, 11, 11, 11, 13, 14, 15, 16, 16,
-},
-{
-  1,  2,  3,  5,  5,  6,  6,  7,  7,  8,  9,  9,  9, 10, 10, 10,
- 11, 11, 12, 12, 12, 12, 13, 13, 12, 12, 13, 14, 16, 16, 16, 16,
-},
-{
-  1,  2,  3,  4,  6,  6,  7,  7,  8,  8,  9,  9, 10, 10, 11, 12,
- 12, 12, 13, 13, 13, 14, 14, 15, 14, 14, 16, 16, 16, 16, 16, 16,
-},
-{
-  1,  2,  3,  4,  5,  6,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12,
- 13, 13, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-},
-{
-  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 13, 14, 15, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-},
-{
-  1,  2,  3,  4,  5,  6,  7,  8, 10, 10, 11, 11, 13, 12, 12, 13,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-},
-{
-  1,  2,  3,  4,  5,  6,  7,  8, 10, 10, 10, 11, 14, 13, 15, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16,
-}
-};
-
-#endif /* AVCODEC_RV34VLC_H */
diff --git a/deps/libav/libavcodec/rv40.c b/deps/libav/libavcodec/rv40.c
deleted file mode 100644
index def3990..0000000
--- a/deps/libav/libavcodec/rv40.c
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- * RV40 decoder
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV40 decoder
- */
-
-#include "libavutil/imgutils.h"
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "golomb.h"
-
-#include "rv34.h"
-#include "rv40vlc2.h"
-#include "rv40data.h"
-
-static VLC aic_top_vlc;
-static VLC aic_mode1_vlc[AIC_MODE1_NUM], aic_mode2_vlc[AIC_MODE2_NUM];
-static VLC ptype_vlc[NUM_PTYPE_VLCS], btype_vlc[NUM_BTYPE_VLCS];
-
-static const int16_t mode2_offs[] = {
-       0,  614, 1222, 1794, 2410,  3014,  3586,  4202,  4792, 5382, 5966, 6542,
-    7138, 7716, 8292, 8864, 9444, 10030, 10642, 11212, 11814
-};
-
-/**
- * Initialize all tables.
- */
-static av_cold void rv40_init_tables(void)
-{
-    int i;
-    static VLC_TYPE aic_table[1 << AIC_TOP_BITS][2];
-    static VLC_TYPE aic_mode1_table[AIC_MODE1_NUM << AIC_MODE1_BITS][2];
-    static VLC_TYPE aic_mode2_table[11814][2];
-    static VLC_TYPE ptype_table[NUM_PTYPE_VLCS << PTYPE_VLC_BITS][2];
-    static VLC_TYPE btype_table[NUM_BTYPE_VLCS << BTYPE_VLC_BITS][2];
-
-    aic_top_vlc.table = aic_table;
-    aic_top_vlc.table_allocated = 1 << AIC_TOP_BITS;
-    init_vlc(&aic_top_vlc, AIC_TOP_BITS, AIC_TOP_SIZE,
-             rv40_aic_top_vlc_bits,  1, 1,
-             rv40_aic_top_vlc_codes, 1, 1, INIT_VLC_USE_NEW_STATIC);
-    for(i = 0; i < AIC_MODE1_NUM; i++){
-        // Every tenth VLC table is empty
-        if((i % 10) == 9) continue;
-        aic_mode1_vlc[i].table = &aic_mode1_table[i << AIC_MODE1_BITS];
-        aic_mode1_vlc[i].table_allocated = 1 << AIC_MODE1_BITS;
-        init_vlc(&aic_mode1_vlc[i], AIC_MODE1_BITS, AIC_MODE1_SIZE,
-                 aic_mode1_vlc_bits[i],  1, 1,
-                 aic_mode1_vlc_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-    }
-    for(i = 0; i < AIC_MODE2_NUM; i++){
-        aic_mode2_vlc[i].table = &aic_mode2_table[mode2_offs[i]];
-        aic_mode2_vlc[i].table_allocated = mode2_offs[i + 1] - mode2_offs[i];
-        init_vlc(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE,
-                 aic_mode2_vlc_bits[i],  1, 1,
-                 aic_mode2_vlc_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
-    }
-    for(i = 0; i < NUM_PTYPE_VLCS; i++){
-        ptype_vlc[i].table = &ptype_table[i << PTYPE_VLC_BITS];
-        ptype_vlc[i].table_allocated = 1 << PTYPE_VLC_BITS;
-        ff_init_vlc_sparse(&ptype_vlc[i], PTYPE_VLC_BITS, PTYPE_VLC_SIZE,
-                            ptype_vlc_bits[i],  1, 1,
-                            ptype_vlc_codes[i], 1, 1,
-                            ptype_vlc_syms,     1, 1, INIT_VLC_USE_NEW_STATIC);
-    }
-    for(i = 0; i < NUM_BTYPE_VLCS; i++){
-        btype_vlc[i].table = &btype_table[i << BTYPE_VLC_BITS];
-        btype_vlc[i].table_allocated = 1 << BTYPE_VLC_BITS;
-        ff_init_vlc_sparse(&btype_vlc[i], BTYPE_VLC_BITS, BTYPE_VLC_SIZE,
-                            btype_vlc_bits[i],  1, 1,
-                            btype_vlc_codes[i], 1, 1,
-                            btype_vlc_syms,     1, 1, INIT_VLC_USE_NEW_STATIC);
-    }
-}
-
-/**
- * Get stored dimension from bitstream.
- *
- * If the width/height is the standard one then it's coded as a 3-bit index.
- * Otherwise it is coded as escaped 8-bit portions.
- */
-static int get_dimension(GetBitContext *gb, const int *dim)
-{
-    int t   = get_bits(gb, 3);
-    int val = dim[t];
-    if(val < 0)
-        val = dim[get_bits1(gb) - val];
-    if(!val){
-        do{
-            t = get_bits(gb, 8);
-            val += t << 2;
-        }while(t == 0xFF);
-    }
-    return val;
-}
-
-/**
- * Get encoded picture size - usually this is called from rv40_parse_slice_header.
- */
-static void rv40_parse_picture_size(GetBitContext *gb, int *w, int *h)
-{
-    *w = get_dimension(gb, rv40_standard_widths);
-    *h = get_dimension(gb, rv40_standard_heights);
-}
-
-static int rv40_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
-{
-    int mb_bits;
-    int w = r->s.width, h = r->s.height;
-    int mb_size;
-
-    memset(si, 0, sizeof(SliceInfo));
-    if(get_bits1(gb))
-        return -1;
-    si->type = get_bits(gb, 2);
-    if(si->type == 1) si->type = 0;
-    si->quant = get_bits(gb, 5);
-    if(get_bits(gb, 2))
-        return -1;
-    si->vlc_set = get_bits(gb, 2);
-    skip_bits1(gb);
-    si->pts = get_bits(gb, 13);
-    if(!si->type || !get_bits1(gb))
-        rv40_parse_picture_size(gb, &w, &h);
-    if(av_image_check_size(w, h, 0, r->s.avctx) < 0)
-        return -1;
-    si->width  = w;
-    si->height = h;
-    mb_size = ((w + 15) >> 4) * ((h + 15) >> 4);
-    mb_bits = ff_rv34_get_start_offset(gb, mb_size);
-    si->start = get_bits(gb, mb_bits);
-
-    return 0;
-}
-
-/**
- * Decode 4x4 intra types array.
- */
-static int rv40_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t *dst)
-{
-    MpegEncContext *s = &r->s;
-    int i, j, k, v;
-    int A, B, C;
-    int pattern;
-    int8_t *ptr;
-
-    for(i = 0; i < 4; i++, dst += r->intra_types_stride){
-        if(!i && s->first_slice_line){
-            pattern = get_vlc2(gb, aic_top_vlc.table, AIC_TOP_BITS, 1);
-            dst[0] = (pattern >> 2) & 2;
-            dst[1] = (pattern >> 1) & 2;
-            dst[2] =  pattern       & 2;
-            dst[3] = (pattern << 1) & 2;
-            continue;
-        }
-        ptr = dst;
-        for(j = 0; j < 4; j++){
-            /* Coefficients are read using VLC chosen by the prediction pattern
-             * The first one (used for retrieving a pair of coefficients) is
-             * constructed from the top, top right and left coefficients
-             * The second one (used for retrieving only one coefficient) is
-             * top + 10 * left.
-             */
-            A = ptr[-r->intra_types_stride + 1]; // it won't be used for the last coefficient in a row
-            B = ptr[-r->intra_types_stride];
-            C = ptr[-1];
-            pattern = A + (B << 4) + (C << 8);
-            for(k = 0; k < MODE2_PATTERNS_NUM; k++)
-                if(pattern == rv40_aic_table_index[k])
-                    break;
-            if(j < 3 && k < MODE2_PATTERNS_NUM){ //pattern is found, decoding 2 coefficients
-                v = get_vlc2(gb, aic_mode2_vlc[k].table, AIC_MODE2_BITS, 2);
-                *ptr++ = v/9;
-                *ptr++ = v%9;
-                j++;
-            }else{
-                if(B != -1 && C != -1)
-                    v = get_vlc2(gb, aic_mode1_vlc[B + C*10].table, AIC_MODE1_BITS, 1);
-                else{ // tricky decoding
-                    v = 0;
-                    switch(C){
-                    case -1: // code 0 -> 1, 1 -> 0
-                        if(B < 2)
-                            v = get_bits1(gb) ^ 1;
-                        break;
-                    case  0:
-                    case  2: // code 0 -> 2, 1 -> 0
-                        v = (get_bits1(gb) ^ 1) << 1;
-                        break;
-                    }
-                }
-                *ptr++ = v;
-            }
-        }
-    }
-    return 0;
-}
-
-/**
- * Decode macroblock information.
- */
-static int rv40_decode_mb_info(RV34DecContext *r)
-{
-    MpegEncContext *s = &r->s;
-    GetBitContext *gb = &s->gb;
-    int q, i;
-    int prev_type = 0;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-
-    if(!r->s.mb_skip_run)
-        r->s.mb_skip_run = svq3_get_ue_golomb(gb) + 1;
-
-    if(--r->s.mb_skip_run)
-         return RV34_MB_SKIP;
-
-    if(r->avail_cache[6-4]){
-        int blocks[RV34_MB_TYPES] = {0};
-        int count = 0;
-        if(r->avail_cache[6-1])
-            blocks[r->mb_type[mb_pos - 1]]++;
-        blocks[r->mb_type[mb_pos - s->mb_stride]]++;
-        if(r->avail_cache[6-2])
-            blocks[r->mb_type[mb_pos - s->mb_stride + 1]]++;
-        if(r->avail_cache[6-5])
-            blocks[r->mb_type[mb_pos - s->mb_stride - 1]]++;
-        for(i = 0; i < RV34_MB_TYPES; i++){
-            if(blocks[i] > count){
-                count = blocks[i];
-                prev_type = i;
-                if(count>1)
-                    break;
-            }
-        }
-    } else if (r->avail_cache[6-1])
-        prev_type = r->mb_type[mb_pos - 1];
-
-    if(s->pict_type == AV_PICTURE_TYPE_P){
-        prev_type = block_num_to_ptype_vlc_num[prev_type];
-        q = get_vlc2(gb, ptype_vlc[prev_type].table, PTYPE_VLC_BITS, 1);
-        if(q < PBTYPE_ESCAPE)
-            return q;
-        q = get_vlc2(gb, ptype_vlc[prev_type].table, PTYPE_VLC_BITS, 1);
-        av_log(s->avctx, AV_LOG_ERROR, "Dquant for P-frame\n");
-    }else{
-        prev_type = block_num_to_btype_vlc_num[prev_type];
-        q = get_vlc2(gb, btype_vlc[prev_type].table, BTYPE_VLC_BITS, 1);
-        if(q < PBTYPE_ESCAPE)
-            return q;
-        q = get_vlc2(gb, btype_vlc[prev_type].table, BTYPE_VLC_BITS, 1);
-        av_log(s->avctx, AV_LOG_ERROR, "Dquant for B-frame\n");
-    }
-    return 0;
-}
-
-enum RV40BlockPos{
-    POS_CUR,
-    POS_TOP,
-    POS_LEFT,
-    POS_BOTTOM,
-};
-
-#define MASK_CUR          0x0001
-#define MASK_RIGHT        0x0008
-#define MASK_BOTTOM       0x0010
-#define MASK_TOP          0x1000
-#define MASK_Y_TOP_ROW    0x000F
-#define MASK_Y_LAST_ROW   0xF000
-#define MASK_Y_LEFT_COL   0x1111
-#define MASK_Y_RIGHT_COL  0x8888
-#define MASK_C_TOP_ROW    0x0003
-#define MASK_C_LAST_ROW   0x000C
-#define MASK_C_LEFT_COL   0x0005
-#define MASK_C_RIGHT_COL  0x000A
-
-static const int neighbour_offs_x[4] = { 0,  0, -1, 0 };
-static const int neighbour_offs_y[4] = { 0, -1,  0, 1 };
-
-static void rv40_adaptive_loop_filter(RV34DSPContext *rdsp,
-                                      uint8_t *src, int stride, int dmode,
-                                      int lim_q1, int lim_p1,
-                                      int alpha, int beta, int beta2,
-                                      int chroma, int edge, int dir)
-{
-    int filter_p1, filter_q1;
-    int strong;
-    int lims;
-
-    strong = rdsp->rv40_loop_filter_strength[dir](src, stride, beta, beta2,
-                                                  edge, &filter_p1, &filter_q1);
-
-    lims = filter_p1 + filter_q1 + ((lim_q1 + lim_p1) >> 1) + 1;
-
-    if (strong) {
-        rdsp->rv40_strong_loop_filter[dir](src, stride, alpha,
-                                           lims, dmode, chroma);
-    } else if (filter_p1 & filter_q1) {
-        rdsp->rv40_weak_loop_filter[dir](src, stride, 1, 1, alpha, beta,
-                                         lims, lim_q1, lim_p1);
-    } else if (filter_p1 | filter_q1) {
-        rdsp->rv40_weak_loop_filter[dir](src, stride, filter_p1, filter_q1,
-                                         alpha, beta, lims >> 1, lim_q1 >> 1,
-                                         lim_p1 >> 1);
-    }
-}
-
-/**
- * RV40 loop filtering function
- */
-static void rv40_loop_filter(RV34DecContext *r, int row)
-{
-    MpegEncContext *s = &r->s;
-    int mb_pos, mb_x;
-    int i, j, k;
-    uint8_t *Y, *C;
-    int alpha, beta, betaY, betaC;
-    int q;
-    int mbtype[4];   ///< current macroblock and its neighbours types
-    /**
-     * flags indicating that macroblock can be filtered with strong filter
-     * it is set only for intra coded MB and MB with DCs coded separately
-     */
-    int mb_strong[4];
-    int clip[4];     ///< MB filter clipping value calculated from filtering strength
-    /**
-     * coded block patterns for luma part of current macroblock and its neighbours
-     * Format:
-     * LSB corresponds to the top left block,
-     * each nibble represents one row of subblocks.
-     */
-    int cbp[4];
-    /**
-     * coded block patterns for chroma part of current macroblock and its neighbours
-     * Format is the same as for luma with two subblocks in a row.
-     */
-    int uvcbp[4][2];
-    /**
-     * This mask represents the pattern of luma subblocks that should be filtered
-     * in addition to the coded ones because because they lie at the edge of
-     * 8x8 block with different enough motion vectors
-     */
-    unsigned mvmasks[4];
-
-    mb_pos = row * s->mb_stride;
-    for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){
-        int mbtype = s->current_picture_ptr->mb_type[mb_pos];
-        if(IS_INTRA(mbtype) || IS_SEPARATE_DC(mbtype))
-            r->cbp_luma  [mb_pos] = r->deblock_coefs[mb_pos] = 0xFFFF;
-        if(IS_INTRA(mbtype))
-            r->cbp_chroma[mb_pos] = 0xFF;
-    }
-    mb_pos = row * s->mb_stride;
-    for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){
-        int y_h_deblock, y_v_deblock;
-        int c_v_deblock[2], c_h_deblock[2];
-        int clip_left;
-        int avail[4];
-        unsigned y_to_deblock;
-        int c_to_deblock[2];
-
-        q = s->current_picture_ptr->qscale_table[mb_pos];
-        alpha = rv40_alpha_tab[q];
-        beta  = rv40_beta_tab [q];
-        betaY = betaC = beta * 3;
-        if(s->width * s->height <= 176*144)
-            betaY += beta;
-
-        avail[0] = 1;
-        avail[1] = row;
-        avail[2] = mb_x;
-        avail[3] = row < s->mb_height - 1;
-        for(i = 0; i < 4; i++){
-            if(avail[i]){
-                int pos = mb_pos + neighbour_offs_x[i] + neighbour_offs_y[i]*s->mb_stride;
-                mvmasks[i] = r->deblock_coefs[pos];
-                mbtype [i] = s->current_picture_ptr->mb_type[pos];
-                cbp    [i] = r->cbp_luma[pos];
-                uvcbp[i][0] = r->cbp_chroma[pos] & 0xF;
-                uvcbp[i][1] = r->cbp_chroma[pos] >> 4;
-            }else{
-                mvmasks[i] = 0;
-                mbtype [i] = mbtype[0];
-                cbp    [i] = 0;
-                uvcbp[i][0] = uvcbp[i][1] = 0;
-            }
-            mb_strong[i] = IS_INTRA(mbtype[i]) || IS_SEPARATE_DC(mbtype[i]);
-            clip[i] = rv40_filter_clip_tbl[mb_strong[i] + 1][q];
-        }
-        y_to_deblock =  mvmasks[POS_CUR]
-                     | (mvmasks[POS_BOTTOM] << 16);
-        /* This pattern contains bits signalling that horizontal edges of
-         * the current block can be filtered.
-         * That happens when either of adjacent subblocks is coded or lies on
-         * the edge of 8x8 blocks with motion vectors differing by more than
-         * 3/4 pel in any component (any edge orientation for some reason).
-         */
-        y_h_deblock =   y_to_deblock
-                    | ((cbp[POS_CUR]                           <<  4) & ~MASK_Y_TOP_ROW)
-                    | ((cbp[POS_TOP]        & MASK_Y_LAST_ROW) >> 12);
-        /* This pattern contains bits signalling that vertical edges of
-         * the current block can be filtered.
-         * That happens when either of adjacent subblocks is coded or lies on
-         * the edge of 8x8 blocks with motion vectors differing by more than
-         * 3/4 pel in any component (any edge orientation for some reason).
-         */
-        y_v_deblock =   y_to_deblock
-                    | ((cbp[POS_CUR]                      << 1) & ~MASK_Y_LEFT_COL)
-                    | ((cbp[POS_LEFT] & MASK_Y_RIGHT_COL) >> 3);
-        if(!mb_x)
-            y_v_deblock &= ~MASK_Y_LEFT_COL;
-        if(!row)
-            y_h_deblock &= ~MASK_Y_TOP_ROW;
-        if(row == s->mb_height - 1 || (mb_strong[POS_CUR] | mb_strong[POS_BOTTOM]))
-            y_h_deblock &= ~(MASK_Y_TOP_ROW << 16);
-        /* Calculating chroma patterns is similar and easier since there is
-         * no motion vector pattern for them.
-         */
-        for(i = 0; i < 2; i++){
-            c_to_deblock[i] = (uvcbp[POS_BOTTOM][i] << 4) | uvcbp[POS_CUR][i];
-            c_v_deblock[i] =   c_to_deblock[i]
-                           | ((uvcbp[POS_CUR] [i]                       << 1) & ~MASK_C_LEFT_COL)
-                           | ((uvcbp[POS_LEFT][i]   & MASK_C_RIGHT_COL) >> 1);
-            c_h_deblock[i] =   c_to_deblock[i]
-                           | ((uvcbp[POS_TOP][i]    & MASK_C_LAST_ROW)  >> 2)
-                           |  (uvcbp[POS_CUR][i]                        << 2);
-            if(!mb_x)
-                c_v_deblock[i] &= ~MASK_C_LEFT_COL;
-            if(!row)
-                c_h_deblock[i] &= ~MASK_C_TOP_ROW;
-            if(row == s->mb_height - 1 || (mb_strong[POS_CUR] | mb_strong[POS_BOTTOM]))
-                c_h_deblock[i] &= ~(MASK_C_TOP_ROW << 4);
-        }
-
-        for(j = 0; j < 16; j += 4){
-            Y = s->current_picture_ptr->f.data[0] + mb_x*16 + (row*16 + j) * s->linesize;
-            for(i = 0; i < 4; i++, Y += 4){
-                int ij = i + j;
-                int clip_cur = y_to_deblock & (MASK_CUR << ij) ? clip[POS_CUR] : 0;
-                int dither = j ? ij : i*4;
-
-                // if bottom block is coded then we can filter its top edge
-                // (or bottom edge of this block, which is the same)
-                if(y_h_deblock & (MASK_BOTTOM << ij)){
-                    rv40_adaptive_loop_filter(&r->rdsp, Y+4*s->linesize,
-                                              s->linesize, dither,
-                                              y_to_deblock & (MASK_BOTTOM << ij) ? clip[POS_CUR] : 0,
-                                              clip_cur, alpha, beta, betaY,
-                                              0, 0, 0);
-                }
-                // filter left block edge in ordinary mode (with low filtering strength)
-                if(y_v_deblock & (MASK_CUR << ij) && (i || !(mb_strong[POS_CUR] | mb_strong[POS_LEFT]))){
-                    if(!i)
-                        clip_left = mvmasks[POS_LEFT] & (MASK_RIGHT << j) ? clip[POS_LEFT] : 0;
-                    else
-                        clip_left = y_to_deblock & (MASK_CUR << (ij-1)) ? clip[POS_CUR] : 0;
-                    rv40_adaptive_loop_filter(&r->rdsp, Y, s->linesize, dither,
-                                              clip_cur,
-                                              clip_left,
-                                              alpha, beta, betaY, 0, 0, 1);
-                }
-                // filter top edge of the current macroblock when filtering strength is high
-                if(!j && y_h_deblock & (MASK_CUR << i) && (mb_strong[POS_CUR] | mb_strong[POS_TOP])){
-                    rv40_adaptive_loop_filter(&r->rdsp, Y, s->linesize, dither,
-                                       clip_cur,
-                                       mvmasks[POS_TOP] & (MASK_TOP << i) ? clip[POS_TOP] : 0,
-                                       alpha, beta, betaY, 0, 1, 0);
-                }
-                // filter left block edge in edge mode (with high filtering strength)
-                if(y_v_deblock & (MASK_CUR << ij) && !i && (mb_strong[POS_CUR] | mb_strong[POS_LEFT])){
-                    clip_left = mvmasks[POS_LEFT] & (MASK_RIGHT << j) ? clip[POS_LEFT] : 0;
-                    rv40_adaptive_loop_filter(&r->rdsp, Y, s->linesize, dither,
-                                       clip_cur,
-                                       clip_left,
-                                       alpha, beta, betaY, 0, 1, 1);
-                }
-            }
-        }
-        for(k = 0; k < 2; k++){
-            for(j = 0; j < 2; j++){
-                C = s->current_picture_ptr->f.data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize;
-                for(i = 0; i < 2; i++, C += 4){
-                    int ij = i + j*2;
-                    int clip_cur = c_to_deblock[k] & (MASK_CUR << ij) ? clip[POS_CUR] : 0;
-                    if(c_h_deblock[k] & (MASK_CUR << (ij+2))){
-                        int clip_bot = c_to_deblock[k] & (MASK_CUR << (ij+2)) ? clip[POS_CUR] : 0;
-                        rv40_adaptive_loop_filter(&r->rdsp, C+4*s->uvlinesize, s->uvlinesize, i*8,
-                                           clip_bot,
-                                           clip_cur,
-                                           alpha, beta, betaC, 1, 0, 0);
-                    }
-                    if((c_v_deblock[k] & (MASK_CUR << ij)) && (i || !(mb_strong[POS_CUR] | mb_strong[POS_LEFT]))){
-                        if(!i)
-                            clip_left = uvcbp[POS_LEFT][k] & (MASK_CUR << (2*j+1)) ? clip[POS_LEFT] : 0;
-                        else
-                            clip_left = c_to_deblock[k]    & (MASK_CUR << (ij-1))  ? clip[POS_CUR]  : 0;
-                        rv40_adaptive_loop_filter(&r->rdsp, C, s->uvlinesize, j*8,
-                                           clip_cur,
-                                           clip_left,
-                                           alpha, beta, betaC, 1, 0, 1);
-                    }
-                    if(!j && c_h_deblock[k] & (MASK_CUR << ij) && (mb_strong[POS_CUR] | mb_strong[POS_TOP])){
-                        int clip_top = uvcbp[POS_TOP][k] & (MASK_CUR << (ij+2)) ? clip[POS_TOP] : 0;
-                        rv40_adaptive_loop_filter(&r->rdsp, C, s->uvlinesize, i*8,
-                                           clip_cur,
-                                           clip_top,
-                                           alpha, beta, betaC, 1, 1, 0);
-                    }
-                    if(c_v_deblock[k] & (MASK_CUR << ij) && !i && (mb_strong[POS_CUR] | mb_strong[POS_LEFT])){
-                        clip_left = uvcbp[POS_LEFT][k] & (MASK_CUR << (2*j+1)) ? clip[POS_LEFT] : 0;
-                        rv40_adaptive_loop_filter(&r->rdsp, C, s->uvlinesize, j*8,
-                                           clip_cur,
-                                           clip_left,
-                                           alpha, beta, betaC, 1, 1, 1);
-                    }
-                }
-            }
-        }
-    }
-}
-
-/**
- * Initialize decoder.
- */
-static av_cold int rv40_decode_init(AVCodecContext *avctx)
-{
-    RV34DecContext *r = avctx->priv_data;
-    int ret;
-
-    r->rv30 = 0;
-    if ((ret = ff_rv34_decode_init(avctx)) < 0)
-        return ret;
-    if(!aic_top_vlc.bits)
-        rv40_init_tables();
-    r->parse_slice_header = rv40_parse_slice_header;
-    r->decode_intra_types = rv40_decode_intra_types;
-    r->decode_mb_info     = rv40_decode_mb_info;
-    r->loop_filter        = rv40_loop_filter;
-    r->luma_dc_quant_i = rv40_luma_dc_quant[0];
-    r->luma_dc_quant_p = rv40_luma_dc_quant[1];
-    return 0;
-}
-
-AVCodec ff_rv40_decoder = {
-    .name                  = "rv40",
-    .long_name             = NULL_IF_CONFIG_SMALL("RealVideo 4.0"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_RV40,
-    .priv_data_size        = sizeof(RV34DecContext),
-    .init                  = rv40_decode_init,
-    .close                 = ff_rv34_decode_end,
-    .decode                = ff_rv34_decode_frame,
-    .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
-                             CODEC_CAP_FRAME_THREADS,
-    .flush                 = ff_mpeg_flush,
-    .pix_fmts              = ff_pixfmt_list_420,
-    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_init_thread_copy),
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_update_thread_context),
-};
diff --git a/deps/libav/libavcodec/rv40data.h b/deps/libav/libavcodec/rv40data.h
deleted file mode 100644
index 42328af..0000000
--- a/deps/libav/libavcodec/rv40data.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * RealVideo 4 decoder
- * copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * miscellaneous RV40 tables
- */
-
-#ifndef AVCODEC_RV40DATA_H
-#define AVCODEC_RV40DATA_H
-
-#include <stdint.h>
-
-/**
- * standard widths and heights coded in RV40
- */
-//@{
-static const int rv40_standard_widths[]   = { 160, 172, 240, 320, 352, 640, 704, 0};
-static const int rv40_standard_heights[]  = { 120, 132, 144, 240, 288, 480, -8, -10, 180, 360, 576, 0};
-//@}
-
-#define MODE2_PATTERNS_NUM 20
-/**
- * intra types table
- *
- * These values are actually coded 3-tuples
- * used for detecting standard block configurations.
- */
-static const uint16_t rv40_aic_table_index[MODE2_PATTERNS_NUM] = {
- 0x000, 0x100, 0x200,
- 0x011, 0x111, 0x211, 0x511, 0x611,
- 0x022, 0x122, 0x222, 0x722,
- 0x272, 0x227,
- 0x822, 0x282, 0x228,
- 0x112, 0x116, 0x221
-};
-
-/**
- * luma quantizer values
- * The second table is used for inter blocks.
- */
-static const uint8_t rv40_luma_dc_quant[2][32] = {
- {  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-   16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 22, 22, 22, 22 },
- {  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-   16, 17, 18, 19, 20, 20, 21, 21, 22, 23, 23, 23, 24, 24, 24, 24 }
-};
-
-/**
- * @name Coefficients used by the RV40 loop filter
- * @{
- */
-
-/** alpha parameter for RV40 loop filter - almost the same as in JVT-A003r1 */
-static const uint8_t rv40_alpha_tab[32] = {
-    128, 128, 128, 128, 128, 128, 128, 128,
-    128, 128, 122,  96,  75,  59,  47,  37,
-     29,  23,  18,  15,  13,  11,  10,   9,
-      8,   7,   6,   5,   4,   3,   2,   1
-};
-/** beta parameter for RV40 loop filter - almost the same as in JVT-A003r1 */
-static const uint8_t rv40_beta_tab[32] = {
-     0,  0,  0,  0,  0,  0,  0,  0,  3,  3,  3,  4,  4,  4,  6,  6,
-     6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 13, 14, 15, 16, 17
-};
-/** clip table for RV40 loop filter - the same as in JVT-A003r1 */
-static const uint8_t rv40_filter_clip_tbl[3][32] = {
-    {
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-    },
-    {
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
-        1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5
-    },
-    {
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
-        1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 7, 8, 9
-    }
-};
-/** @} */ // end loopfilter group
-
-#endif /* AVCODEC_RV40DATA_H */
diff --git a/deps/libav/libavcodec/rv40dsp.c b/deps/libav/libavcodec/rv40dsp.c
deleted file mode 100644
index 6517d46..0000000
--- a/deps/libav/libavcodec/rv40dsp.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- * RV40 decoder motion compensation functions
- * Copyright (c) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV40 decoder motion compensation functions
- */
-
-#include "avcodec.h"
-#include "h264qpel.h"
-#include "rv34dsp.h"
-#include "libavutil/common.h"
-
-#define RV40_LOWPASS(OPNAME, OP) \
-static av_unused void OPNAME ## rv40_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
-                                                     const int h, const int C1, const int C2, const int SHIFT){\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    for(i = 0; i < h; i++)\
-    {\
-        OP(dst[0], (src[-2] + src[ 3] - 5*(src[-1]+src[2]) + src[0]*C1 + src[1]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[1], (src[-1] + src[ 4] - 5*(src[ 0]+src[3]) + src[1]*C1 + src[2]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[2], (src[ 0] + src[ 5] - 5*(src[ 1]+src[4]) + src[2]*C1 + src[3]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[3], (src[ 1] + src[ 6] - 5*(src[ 2]+src[5]) + src[3]*C1 + src[4]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[4], (src[ 2] + src[ 7] - 5*(src[ 3]+src[6]) + src[4]*C1 + src[5]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[5], (src[ 3] + src[ 8] - 5*(src[ 4]+src[7]) + src[5]*C1 + src[6]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[6], (src[ 4] + src[ 9] - 5*(src[ 5]+src[8]) + src[6]*C1 + src[7]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[7], (src[ 5] + src[10] - 5*(src[ 6]+src[9]) + src[7]*C1 + src[8]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        dst += dstStride;\
-        src += srcStride;\
-    }\
-}\
-\
-static void OPNAME ## rv40_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
-                                           const int w, const int C1, const int C2, const int SHIFT){\
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
-    int i;\
-    for(i = 0; i < w; i++)\
-    {\
-        const int srcB  = src[-2*srcStride];\
-        const int srcA  = src[-1*srcStride];\
-        const int src0  = src[0 *srcStride];\
-        const int src1  = src[1 *srcStride];\
-        const int src2  = src[2 *srcStride];\
-        const int src3  = src[3 *srcStride];\
-        const int src4  = src[4 *srcStride];\
-        const int src5  = src[5 *srcStride];\
-        const int src6  = src[6 *srcStride];\
-        const int src7  = src[7 *srcStride];\
-        const int src8  = src[8 *srcStride];\
-        const int src9  = src[9 *srcStride];\
-        const int src10 = src[10*srcStride];\
-        OP(dst[0*dstStride], (srcB + src3  - 5*(srcA+src2) + src0*C1 + src1*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[1*dstStride], (srcA + src4  - 5*(src0+src3) + src1*C1 + src2*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[2*dstStride], (src0 + src5  - 5*(src1+src4) + src2*C1 + src3*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[3*dstStride], (src1 + src6  - 5*(src2+src5) + src3*C1 + src4*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[4*dstStride], (src2 + src7  - 5*(src3+src6) + src4*C1 + src5*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[5*dstStride], (src3 + src8  - 5*(src4+src7) + src5*C1 + src6*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[6*dstStride], (src4 + src9  - 5*(src5+src8) + src6*C1 + src7*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        OP(dst[7*dstStride], (src5 + src10 - 5*(src6+src9) + src7*C1 + src8*C2 + (1<<(SHIFT-1))) >> SHIFT);\
-        dst++;\
-        src++;\
-    }\
-}\
-\
-static void OPNAME ## rv40_qpel16_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
-                                            const int w, const int C1, const int C2, const int SHIFT){\
-    OPNAME ## rv40_qpel8_v_lowpass(dst  , src  , dstStride, srcStride, 8, C1, C2, SHIFT);\
-    OPNAME ## rv40_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, 8, C1, C2, SHIFT);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## rv40_qpel8_v_lowpass(dst  , src  , dstStride, srcStride, w-8, C1, C2, SHIFT);\
-    OPNAME ## rv40_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, w-8, C1, C2, SHIFT);\
-}\
-\
-static void OPNAME ## rv40_qpel16_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
-                                            const int h, const int C1, const int C2, const int SHIFT){\
-    OPNAME ## rv40_qpel8_h_lowpass(dst  , src  , dstStride, srcStride, 8, C1, C2, SHIFT);\
-    OPNAME ## rv40_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, 8, C1, C2, SHIFT);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## rv40_qpel8_h_lowpass(dst  , src  , dstStride, srcStride, h-8, C1, C2, SHIFT);\
-    OPNAME ## rv40_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, h-8, C1, C2, SHIFT);\
-}\
-\
-
-#define RV40_MC(OPNAME, SIZE) \
-static void OPNAME ## rv40_qpel ## SIZE ## _mc10_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc30_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc01_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc11_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)];\
-    uint8_t * const full_mid = full + SIZE*2;\
-    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc21_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)];\
-    uint8_t * const full_mid = full + SIZE*2;\
-    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc31_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)];\
-    uint8_t * const full_mid = full + SIZE*2;\
-    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc12_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)];\
-    uint8_t * const full_mid = full + SIZE*2;\
-    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)];\
-    uint8_t * const full_mid = full + SIZE*2;\
-    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc32_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)];\
-    uint8_t * const full_mid = full + SIZE*2;\
-    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc03_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc13_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)];\
-    uint8_t * const full_mid = full + SIZE*2;\
-    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
-}\
-\
-static void OPNAME ## rv40_qpel ## SIZE ## _mc23_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    uint8_t full[SIZE*(SIZE+5)];\
-    uint8_t * const full_mid = full + SIZE*2;\
-    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
-    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
-}\
-\
-
-#define op_avg(a, b)  a = (((a)+cm[b]+1)>>1)
-#define op_put(a, b)  a = cm[b]
-
-RV40_LOWPASS(put_       , op_put)
-RV40_LOWPASS(avg_       , op_avg)
-
-#undef op_avg
-#undef op_put
-
-RV40_MC(put_, 8)
-RV40_MC(put_, 16)
-RV40_MC(avg_, 8)
-RV40_MC(avg_, 16)
-
-static const int rv40_bias[4][4] = {
-    {  0, 16, 32, 16 },
-    { 32, 28, 32, 28 },
-    {  0, 32, 16, 32 },
-    { 32, 28, 32, 28 }
-};
-
-#define RV40_CHROMA_MC(OPNAME, OP)\
-static void OPNAME ## rv40_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\
-    const int A = (8-x) * (8-y);\
-    const int B = (  x) * (8-y);\
-    const int C = (8-x) * (  y);\
-    const int D = (  x) * (  y);\
-    int i;\
-    int bias = rv40_bias[y>>1][x>>1];\
-    \
-    assert(x<8 && y<8 && x>=0 && y>=0);\
-\
-    if(D){\
-        for(i = 0; i < h; i++){\
-            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + bias));\
-            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + bias));\
-            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + bias));\
-            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + bias));\
-            dst += stride;\
-            src += stride;\
-        }\
-    }else{\
-        const int E = B + C;\
-        const int step = C ? stride : 1;\
-        for(i = 0; i < h; i++){\
-            OP(dst[0], (A*src[0] + E*src[step+0] + bias));\
-            OP(dst[1], (A*src[1] + E*src[step+1] + bias));\
-            OP(dst[2], (A*src[2] + E*src[step+2] + bias));\
-            OP(dst[3], (A*src[3] + E*src[step+3] + bias));\
-            dst += stride;\
-            src += stride;\
-        }\
-    }\
-}\
-\
-static void OPNAME ## rv40_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\
-    const int A = (8-x) * (8-y);\
-    const int B = (  x) * (8-y);\
-    const int C = (8-x) * (  y);\
-    const int D = (  x) * (  y);\
-    int i;\
-    int bias = rv40_bias[y>>1][x>>1];\
-    \
-    assert(x<8 && y<8 && x>=0 && y>=0);\
-\
-    if(D){\
-        for(i = 0; i < h; i++){\
-            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + bias));\
-            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + bias));\
-            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + bias));\
-            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + bias));\
-            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + bias));\
-            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + bias));\
-            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + bias));\
-            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + bias));\
-            dst += stride;\
-            src += stride;\
-        }\
-    }else{\
-        const int E = B + C;\
-        const int step = C ? stride : 1;\
-        for(i = 0; i < h; i++){\
-            OP(dst[0], (A*src[0] + E*src[step+0] + bias));\
-            OP(dst[1], (A*src[1] + E*src[step+1] + bias));\
-            OP(dst[2], (A*src[2] + E*src[step+2] + bias));\
-            OP(dst[3], (A*src[3] + E*src[step+3] + bias));\
-            OP(dst[4], (A*src[4] + E*src[step+4] + bias));\
-            OP(dst[5], (A*src[5] + E*src[step+5] + bias));\
-            OP(dst[6], (A*src[6] + E*src[step+6] + bias));\
-            OP(dst[7], (A*src[7] + E*src[step+7] + bias));\
-            dst += stride;\
-            src += stride;\
-        }\
-    }\
-}
-
-#define op_avg(a, b) a = (((a)+((b)>>6)+1)>>1)
-#define op_put(a, b) a = ((b)>>6)
-
-RV40_CHROMA_MC(put_, op_put)
-RV40_CHROMA_MC(avg_, op_avg)
-
-#define RV40_WEIGHT_FUNC(size) \
-static void rv40_weight_func_rnd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
-{\
-    int i, j;\
-\
-    for (j = 0; j < size; j++) {\
-        for (i = 0; i < size; i++)\
-            dst[i] = (((w2 * src1[i]) >> 9) + ((w1 * src2[i]) >> 9) + 0x10) >> 5;\
-        src1 += stride;\
-        src2 += stride;\
-        dst  += stride;\
-    }\
-}\
-static void rv40_weight_func_nornd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
-{\
-    int i, j;\
-\
-    for (j = 0; j < size; j++) {\
-        for (i = 0; i < size; i++)\
-            dst[i] = (w2 * src1[i] + w1 * src2[i] + 0x10) >> 5;\
-        src1 += stride;\
-        src2 += stride;\
-        dst  += stride;\
-    }\
-}
-
-RV40_WEIGHT_FUNC(16)
-RV40_WEIGHT_FUNC(8)
-
-/**
- * dither values for deblocking filter - left/top values
- */
-static const uint8_t rv40_dither_l[16] = {
-    0x40, 0x50, 0x20, 0x60, 0x30, 0x50, 0x40, 0x30,
-    0x50, 0x40, 0x50, 0x30, 0x60, 0x20, 0x50, 0x40
-};
-
-/**
- * dither values for deblocking filter - right/bottom values
- */
-static const uint8_t rv40_dither_r[16] = {
-    0x40, 0x30, 0x60, 0x20, 0x50, 0x30, 0x30, 0x40,
-    0x40, 0x40, 0x50, 0x30, 0x20, 0x60, 0x30, 0x40
-};
-
-#define CLIP_SYMM(a, b) av_clip(a, -(b), b)
-/**
- * weaker deblocking very similar to the one described in 4.4.2 of JVT-A003r1
- */
-static av_always_inline void rv40_weak_loop_filter(uint8_t *src,
-                                                   const int step,
-                                                   const ptrdiff_t stride,
-                                                   const int filter_p1,
-                                                   const int filter_q1,
-                                                   const int alpha,
-                                                   const int beta,
-                                                   const int lim_p0q0,
-                                                   const int lim_q1,
-                                                   const int lim_p1)
-{
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-    int i, t, u, diff;
-
-    for (i = 0; i < 4; i++, src += stride) {
-        int diff_p1p0 = src[-2*step] - src[-1*step];
-        int diff_q1q0 = src[ 1*step] - src[ 0*step];
-        int diff_p1p2 = src[-2*step] - src[-3*step];
-        int diff_q1q2 = src[ 1*step] - src[ 2*step];
-
-        t = src[0*step] - src[-1*step];
-        if (!t)
-            continue;
-
-        u = (alpha * FFABS(t)) >> 7;
-        if (u > 3 - (filter_p1 && filter_q1))
-            continue;
-
-        t <<= 2;
-        if (filter_p1 && filter_q1)
-            t += src[-2*step] - src[1*step];
-
-        diff = CLIP_SYMM((t + 4) >> 3, lim_p0q0);
-        src[-1*step] = cm[src[-1*step] + diff];
-        src[ 0*step] = cm[src[ 0*step] - diff];
-
-        if (filter_p1 && FFABS(diff_p1p2) <= beta) {
-            t = (diff_p1p0 + diff_p1p2 - diff) >> 1;
-            src[-2*step] = cm[src[-2*step] - CLIP_SYMM(t, lim_p1)];
-        }
-
-        if (filter_q1 && FFABS(diff_q1q2) <= beta) {
-            t = (diff_q1q0 + diff_q1q2 + diff) >> 1;
-            src[ 1*step] = cm[src[ 1*step] - CLIP_SYMM(t, lim_q1)];
-        }
-    }
-}
-
-static void rv40_h_weak_loop_filter(uint8_t *src, const ptrdiff_t stride,
-                                    const int filter_p1, const int filter_q1,
-                                    const int alpha, const int beta,
-                                    const int lim_p0q0, const int lim_q1,
-                                    const int lim_p1)
-{
-    rv40_weak_loop_filter(src, stride, 1, filter_p1, filter_q1,
-                          alpha, beta, lim_p0q0, lim_q1, lim_p1);
-}
-
-static void rv40_v_weak_loop_filter(uint8_t *src, const ptrdiff_t stride,
-                                    const int filter_p1, const int filter_q1,
-                                    const int alpha, const int beta,
-                                    const int lim_p0q0, const int lim_q1,
-                                    const int lim_p1)
-{
-    rv40_weak_loop_filter(src, 1, stride, filter_p1, filter_q1,
-                          alpha, beta, lim_p0q0, lim_q1, lim_p1);
-}
-
-static av_always_inline void rv40_strong_loop_filter(uint8_t *src,
-                                                     const int step,
-                                                     const ptrdiff_t stride,
-                                                     const int alpha,
-                                                     const int lims,
-                                                     const int dmode,
-                                                     const int chroma)
-{
-    int i;
-
-    for(i = 0; i < 4; i++, src += stride){
-        int sflag, p0, q0, p1, q1;
-        int t = src[0*step] - src[-1*step];
-
-        if (!t)
-            continue;
-
-        sflag = (alpha * FFABS(t)) >> 7;
-        if (sflag > 1)
-            continue;
-
-        p0 = (25*src[-3*step] + 26*src[-2*step] + 26*src[-1*step] +
-              26*src[ 0*step] + 25*src[ 1*step] +
-              rv40_dither_l[dmode + i]) >> 7;
-
-        q0 = (25*src[-2*step] + 26*src[-1*step] + 26*src[ 0*step] +
-              26*src[ 1*step] + 25*src[ 2*step] +
-              rv40_dither_r[dmode + i]) >> 7;
-
-        if (sflag) {
-            p0 = av_clip(p0, src[-1*step] - lims, src[-1*step] + lims);
-            q0 = av_clip(q0, src[ 0*step] - lims, src[ 0*step] + lims);
-        }
-
-        p1 = (25*src[-4*step] + 26*src[-3*step] + 26*src[-2*step] + 26*p0 +
-              25*src[ 0*step] + rv40_dither_l[dmode + i]) >> 7;
-        q1 = (25*src[-1*step] + 26*q0 + 26*src[ 1*step] + 26*src[ 2*step] +
-              25*src[ 3*step] + rv40_dither_r[dmode + i]) >> 7;
-
-        if (sflag) {
-            p1 = av_clip(p1, src[-2*step] - lims, src[-2*step] + lims);
-            q1 = av_clip(q1, src[ 1*step] - lims, src[ 1*step] + lims);
-        }
-
-        src[-2*step] = p1;
-        src[-1*step] = p0;
-        src[ 0*step] = q0;
-        src[ 1*step] = q1;
-
-        if(!chroma){
-            src[-3*step] = (25*src[-1*step] + 26*src[-2*step] +
-                            51*src[-3*step] + 26*src[-4*step] + 64) >> 7;
-            src[ 2*step] = (25*src[ 0*step] + 26*src[ 1*step] +
-                            51*src[ 2*step] + 26*src[ 3*step] + 64) >> 7;
-        }
-    }
-}
-
-static void rv40_h_strong_loop_filter(uint8_t *src, const ptrdiff_t stride,
-                                      const int alpha, const int lims,
-                                      const int dmode, const int chroma)
-{
-    rv40_strong_loop_filter(src, stride, 1, alpha, lims, dmode, chroma);
-}
-
-static void rv40_v_strong_loop_filter(uint8_t *src, const ptrdiff_t stride,
-                                      const int alpha, const int lims,
-                                      const int dmode, const int chroma)
-{
-    rv40_strong_loop_filter(src, 1, stride, alpha, lims, dmode, chroma);
-}
-
-static av_always_inline int rv40_loop_filter_strength(uint8_t *src,
-                                                      int step, ptrdiff_t stride,
-                                                      int beta, int beta2,
-                                                      int edge,
-                                                      int *p1, int *q1)
-{
-    int sum_p1p0 = 0, sum_q1q0 = 0, sum_p1p2 = 0, sum_q1q2 = 0;
-    int strong0 = 0, strong1 = 0;
-    uint8_t *ptr;
-    int i;
-
-    for (i = 0, ptr = src; i < 4; i++, ptr += stride) {
-        sum_p1p0 += ptr[-2*step] - ptr[-1*step];
-        sum_q1q0 += ptr[ 1*step] - ptr[ 0*step];
-    }
-
-    *p1 = FFABS(sum_p1p0) < (beta << 2);
-    *q1 = FFABS(sum_q1q0) < (beta << 2);
-
-    if(!*p1 && !*q1)
-        return 0;
-
-    if (!edge)
-        return 0;
-
-    for (i = 0, ptr = src; i < 4; i++, ptr += stride) {
-        sum_p1p2 += ptr[-2*step] - ptr[-3*step];
-        sum_q1q2 += ptr[ 1*step] - ptr[ 2*step];
-    }
-
-    strong0 = *p1 && (FFABS(sum_p1p2) < beta2);
-    strong1 = *q1 && (FFABS(sum_q1q2) < beta2);
-
-    return strong0 && strong1;
-}
-
-static int rv40_h_loop_filter_strength(uint8_t *src, ptrdiff_t stride,
-                                       int beta, int beta2, int edge,
-                                       int *p1, int *q1)
-{
-    return rv40_loop_filter_strength(src, stride, 1, beta, beta2, edge, p1, q1);
-}
-
-static int rv40_v_loop_filter_strength(uint8_t *src, ptrdiff_t stride,
-                                       int beta, int beta2, int edge,
-                                       int *p1, int *q1)
-{
-    return rv40_loop_filter_strength(src, 1, stride, beta, beta2, edge, p1, q1);
-}
-
-av_cold void ff_rv40dsp_init(RV34DSPContext *c)
-{
-    H264QpelContext qpel;
-
-    ff_rv34dsp_init(c);
-    ff_h264qpel_init(&qpel, 8);
-
-    c->put_pixels_tab[0][ 0] = qpel.put_h264_qpel_pixels_tab[0][0];
-    c->put_pixels_tab[0][ 1] = put_rv40_qpel16_mc10_c;
-    c->put_pixels_tab[0][ 2] = qpel.put_h264_qpel_pixels_tab[0][2];
-    c->put_pixels_tab[0][ 3] = put_rv40_qpel16_mc30_c;
-    c->put_pixels_tab[0][ 4] = put_rv40_qpel16_mc01_c;
-    c->put_pixels_tab[0][ 5] = put_rv40_qpel16_mc11_c;
-    c->put_pixels_tab[0][ 6] = put_rv40_qpel16_mc21_c;
-    c->put_pixels_tab[0][ 7] = put_rv40_qpel16_mc31_c;
-    c->put_pixels_tab[0][ 8] = qpel.put_h264_qpel_pixels_tab[0][8];
-    c->put_pixels_tab[0][ 9] = put_rv40_qpel16_mc12_c;
-    c->put_pixels_tab[0][10] = put_rv40_qpel16_mc22_c;
-    c->put_pixels_tab[0][11] = put_rv40_qpel16_mc32_c;
-    c->put_pixels_tab[0][12] = put_rv40_qpel16_mc03_c;
-    c->put_pixels_tab[0][13] = put_rv40_qpel16_mc13_c;
-    c->put_pixels_tab[0][14] = put_rv40_qpel16_mc23_c;
-    c->put_pixels_tab[0][15] = ff_put_rv40_qpel16_mc33_c;
-    c->avg_pixels_tab[0][ 0] = qpel.avg_h264_qpel_pixels_tab[0][0];
-    c->avg_pixels_tab[0][ 1] = avg_rv40_qpel16_mc10_c;
-    c->avg_pixels_tab[0][ 2] = qpel.avg_h264_qpel_pixels_tab[0][2];
-    c->avg_pixels_tab[0][ 3] = avg_rv40_qpel16_mc30_c;
-    c->avg_pixels_tab[0][ 4] = avg_rv40_qpel16_mc01_c;
-    c->avg_pixels_tab[0][ 5] = avg_rv40_qpel16_mc11_c;
-    c->avg_pixels_tab[0][ 6] = avg_rv40_qpel16_mc21_c;
-    c->avg_pixels_tab[0][ 7] = avg_rv40_qpel16_mc31_c;
-    c->avg_pixels_tab[0][ 8] = qpel.avg_h264_qpel_pixels_tab[0][8];
-    c->avg_pixels_tab[0][ 9] = avg_rv40_qpel16_mc12_c;
-    c->avg_pixels_tab[0][10] = avg_rv40_qpel16_mc22_c;
-    c->avg_pixels_tab[0][11] = avg_rv40_qpel16_mc32_c;
-    c->avg_pixels_tab[0][12] = avg_rv40_qpel16_mc03_c;
-    c->avg_pixels_tab[0][13] = avg_rv40_qpel16_mc13_c;
-    c->avg_pixels_tab[0][14] = avg_rv40_qpel16_mc23_c;
-    c->avg_pixels_tab[0][15] = ff_avg_rv40_qpel16_mc33_c;
-    c->put_pixels_tab[1][ 0] = qpel.put_h264_qpel_pixels_tab[1][0];
-    c->put_pixels_tab[1][ 1] = put_rv40_qpel8_mc10_c;
-    c->put_pixels_tab[1][ 2] = qpel.put_h264_qpel_pixels_tab[1][2];
-    c->put_pixels_tab[1][ 3] = put_rv40_qpel8_mc30_c;
-    c->put_pixels_tab[1][ 4] = put_rv40_qpel8_mc01_c;
-    c->put_pixels_tab[1][ 5] = put_rv40_qpel8_mc11_c;
-    c->put_pixels_tab[1][ 6] = put_rv40_qpel8_mc21_c;
-    c->put_pixels_tab[1][ 7] = put_rv40_qpel8_mc31_c;
-    c->put_pixels_tab[1][ 8] = qpel.put_h264_qpel_pixels_tab[1][8];
-    c->put_pixels_tab[1][ 9] = put_rv40_qpel8_mc12_c;
-    c->put_pixels_tab[1][10] = put_rv40_qpel8_mc22_c;
-    c->put_pixels_tab[1][11] = put_rv40_qpel8_mc32_c;
-    c->put_pixels_tab[1][12] = put_rv40_qpel8_mc03_c;
-    c->put_pixels_tab[1][13] = put_rv40_qpel8_mc13_c;
-    c->put_pixels_tab[1][14] = put_rv40_qpel8_mc23_c;
-    c->put_pixels_tab[1][15] = ff_put_rv40_qpel8_mc33_c;
-    c->avg_pixels_tab[1][ 0] = qpel.avg_h264_qpel_pixels_tab[1][0];
-    c->avg_pixels_tab[1][ 1] = avg_rv40_qpel8_mc10_c;
-    c->avg_pixels_tab[1][ 2] = qpel.avg_h264_qpel_pixels_tab[1][2];
-    c->avg_pixels_tab[1][ 3] = avg_rv40_qpel8_mc30_c;
-    c->avg_pixels_tab[1][ 4] = avg_rv40_qpel8_mc01_c;
-    c->avg_pixels_tab[1][ 5] = avg_rv40_qpel8_mc11_c;
-    c->avg_pixels_tab[1][ 6] = avg_rv40_qpel8_mc21_c;
-    c->avg_pixels_tab[1][ 7] = avg_rv40_qpel8_mc31_c;
-    c->avg_pixels_tab[1][ 8] = qpel.avg_h264_qpel_pixels_tab[1][8];
-    c->avg_pixels_tab[1][ 9] = avg_rv40_qpel8_mc12_c;
-    c->avg_pixels_tab[1][10] = avg_rv40_qpel8_mc22_c;
-    c->avg_pixels_tab[1][11] = avg_rv40_qpel8_mc32_c;
-    c->avg_pixels_tab[1][12] = avg_rv40_qpel8_mc03_c;
-    c->avg_pixels_tab[1][13] = avg_rv40_qpel8_mc13_c;
-    c->avg_pixels_tab[1][14] = avg_rv40_qpel8_mc23_c;
-    c->avg_pixels_tab[1][15] = ff_avg_rv40_qpel8_mc33_c;
-
-    c->put_chroma_pixels_tab[0] = put_rv40_chroma_mc8_c;
-    c->put_chroma_pixels_tab[1] = put_rv40_chroma_mc4_c;
-    c->avg_chroma_pixels_tab[0] = avg_rv40_chroma_mc8_c;
-    c->avg_chroma_pixels_tab[1] = avg_rv40_chroma_mc4_c;
-
-    c->rv40_weight_pixels_tab[0][0] = rv40_weight_func_rnd_16;
-    c->rv40_weight_pixels_tab[0][1] = rv40_weight_func_rnd_8;
-    c->rv40_weight_pixels_tab[1][0] = rv40_weight_func_nornd_16;
-    c->rv40_weight_pixels_tab[1][1] = rv40_weight_func_nornd_8;
-
-    c->rv40_weak_loop_filter[0]     = rv40_h_weak_loop_filter;
-    c->rv40_weak_loop_filter[1]     = rv40_v_weak_loop_filter;
-    c->rv40_strong_loop_filter[0]   = rv40_h_strong_loop_filter;
-    c->rv40_strong_loop_filter[1]   = rv40_v_strong_loop_filter;
-    c->rv40_loop_filter_strength[0] = rv40_h_loop_filter_strength;
-    c->rv40_loop_filter_strength[1] = rv40_v_loop_filter_strength;
-
-    if (ARCH_AARCH64)
-        ff_rv40dsp_init_aarch64(c);
-    if (ARCH_ARM)
-        ff_rv40dsp_init_arm(c);
-    if (ARCH_X86)
-        ff_rv40dsp_init_x86(c);
-}
diff --git a/deps/libav/libavcodec/rv40vlc2.h b/deps/libav/libavcodec/rv40vlc2.h
deleted file mode 100644
index 2f63fc2..0000000
--- a/deps/libav/libavcodec/rv40vlc2.h
+++ /dev/null
@@ -1,706 +0,0 @@
-/*
- * RealVideo 4 decoder
- * copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV40 VLC tables used for macroblock information decoding
- */
-
-#ifndef AVCODEC_RV40VLC2_H
-#define AVCODEC_RV40VLC2_H
-
-#include <stdint.h>
-
-/**
- * codes used for the first four block types
- */
-//@{
-#define AIC_TOP_BITS  8
-#define AIC_TOP_SIZE 16
-static const uint8_t rv40_aic_top_vlc_codes[AIC_TOP_SIZE] = {
- 0x01, 0x05, 0x01, 0x00, 0x03, 0x3D, 0x1D, 0x02,
- 0x04, 0x3C, 0x3F, 0x1C, 0x0D, 0x3E, 0x0C, 0x01
-};
-
-static const uint8_t rv40_aic_top_vlc_bits[AIC_TOP_SIZE] = {
- 1, 4, 5, 5, 5, 7, 6, 5, 4, 7, 7, 6, 5, 7, 5, 3
-};
-//@}
-
-/**
- * codes used for determining a pair of block types
- */
-//@{
-#define AIC_MODE2_NUM  20
-#define AIC_MODE2_SIZE 81
-#define AIC_MODE2_BITS  9
-
-static const uint16_t aic_mode2_vlc_codes[AIC_MODE2_NUM][AIC_MODE2_SIZE] = {
-{ 0x0001, 0x0001, 0x0005, 0x01F5, 0x0011, 0x0049, 0x0000, 0x0048, 0x004B,
-  0x0035, 0x0003, 0x0034, 0x03C9, 0x01F4, 0x00C9, 0x004A, 0x0FD9, 0x03C8,
-  0x0010, 0x0037, 0x0001, 0x00C8, 0x0075, 0x01F7, 0x00CB, 0x0074, 0x0002,
-  0x01F6, 0x00CA, 0x01F1, 0x01F0, 0x1F81, 0x07F9, 0x1F80, 0x1F83, 0x07F8,
-  0x0077, 0x00F5, 0x0036, 0x07FB, 0x0076, 0x1F82, 0x00F4, 0x00F7, 0x07FA,
-  0x0071, 0x00F6, 0x03CB, 0x03CA, 0x0FD8, 0x00F1, 0x03F5, 0x1F8D, 0x07E5,
-  0x0013, 0x0031, 0x00F0, 0x0FDB, 0x00F3, 0x07E4, 0x0030, 0x01F3, 0x07E7,
-  0x03F4, 0x07E6, 0x0070, 0x3F19, 0x01F2, 0x3F18, 0x0FDA, 0x0033, 0x07E1,
-  0x01FD, 0x01FC, 0x0073, 0x01FF, 0x0FC5, 0x0FC4, 0x0FC7, 0x03F7, 0x0072, },
-{ 0x0005, 0x0005, 0x0005, 0x0079, 0x0005, 0x000D, 0x001D, 0x0078, 0x0069,
-  0x0004, 0x0001, 0x0007, 0x0068, 0x001C, 0x001F, 0x0004, 0x006B, 0x000C,
-  0x0004, 0x001E, 0x0006, 0x006A, 0x0015, 0x000F, 0x0014, 0x0017, 0x0007,
-  0x0016, 0x000E, 0x0011, 0x0009, 0x00D1, 0x00D0, 0x0181, 0x00D3, 0x007B,
-  0x0010, 0x0013, 0x0004, 0x00D2, 0x0007, 0x0319, 0x0008, 0x007A, 0x00DD,
-  0x0019, 0x0006, 0x000B, 0x0065, 0x00DC, 0x0012, 0x0064, 0x0180, 0x00DF,
-  0x0006, 0x0018, 0x0001, 0x00DE, 0x001D, 0x00D9, 0x001B, 0x0067, 0x000A,
-  0x00D8, 0x00DB, 0x001C, 0x0318, 0x00DA, 0x0635, 0x0183, 0x0000, 0x00C5,
-  0x0066, 0x0061, 0x0035, 0x00C4, 0x0182, 0x0634, 0x031B, 0x00C7, 0x001F, },
-{ 0x0005, 0x0001, 0x001D, 0x01C1, 0x0035, 0x00F1, 0x006D, 0x00F0, 0x0049,
-  0x0000, 0x0004, 0x0003, 0x00F3, 0x0048, 0x0034, 0x006C, 0x01C0, 0x01C3,
-  0x0007, 0x0006, 0x0001, 0x006F, 0x0002, 0x004B, 0x006E, 0x001C, 0x0005,
-  0x0069, 0x0068, 0x006B, 0x0037, 0x01C2, 0x00F2, 0x0395, 0x01CD, 0x00FD,
-  0x006A, 0x0036, 0x0015, 0x01CC, 0x0014, 0x0394, 0x004A, 0x00FC, 0x00FF,
-  0x0017, 0x0031, 0x00FE, 0x01CF, 0x0397, 0x00F9, 0x01CE, 0x0725, 0x0396,
-  0x0016, 0x0030, 0x0075, 0x0724, 0x00F8, 0x0727, 0x0033, 0x0391, 0x0390,
-  0x0011, 0x0032, 0x001F, 0x00FB, 0x0074, 0x0726, 0x00FA, 0x001E, 0x0077,
-  0x0019, 0x0018, 0x0004, 0x0010, 0x003D, 0x0076, 0x0071, 0x0013, 0x0001, },
-{ 0x000D, 0x0019, 0x0011, 0x0015, 0x0061, 0x0019, 0x0014, 0x01AD, 0x0060,
-  0x0018, 0x0001, 0x0005, 0x001B, 0x0010, 0x0019, 0x0005, 0x0017, 0x0018,
-  0x0016, 0x0004, 0x0004, 0x0013, 0x000C, 0x0012, 0x001A, 0x0018, 0x0005,
-  0x000F, 0x001B, 0x0004, 0x001D, 0x0011, 0x001C, 0x0010, 0x000E, 0x001B,
-  0x0013, 0x001F, 0x001A, 0x0029, 0x0005, 0x0063, 0x001E, 0x0009, 0x0062,
-  0x0008, 0x0007, 0x0007, 0x0019, 0x0004, 0x001A, 0x0018, 0x006D, 0x0007,
-  0x001B, 0x0007, 0x001A, 0x006C, 0x0006, 0x0012, 0x0005, 0x006F, 0x000B,
-  0x006E, 0x0069, 0x001D, 0x0359, 0x0028, 0x002B, 0x002A, 0x001C, 0x00D5,
-  0x0358, 0x001F, 0x0001, 0x001E, 0x0068, 0x00D4, 0x00D7, 0x0019, 0x0000, },
-{ 0x00B9, 0x0061, 0x0060, 0x00B8, 0x02B5, 0x01AD, 0x00BB, 0x0AF5, 0x0151,
-  0x0001, 0x0001, 0x0005, 0x0000, 0x0003, 0x0005, 0x0004, 0x0063, 0x0025,
-  0x00BA, 0x0004, 0x0007, 0x0062, 0x00A5, 0x0024, 0x006D, 0x0002, 0x006C,
-  0x02B4, 0x000D, 0x006F, 0x0027, 0x00A4, 0x0026, 0x01AC, 0x0150, 0x01AF,
-  0x01AE, 0x0021, 0x006E, 0x02B7, 0x0020, 0x0153, 0x0023, 0x00A7, 0x0152,
-  0x00A6, 0x0006, 0x000C, 0x0022, 0x01A9, 0x0019, 0x002D, 0x02B6, 0x01A8,
-  0x000F, 0x0007, 0x000E, 0x00A1, 0x0069, 0x002C, 0x0001, 0x01AB, 0x00A0,
-  0x02B1, 0x00A3, 0x002F, 0x0AF4, 0x02B0, 0x0AF7, 0x02B3, 0x0068, 0x015D,
-  0x0AF6, 0x01AA, 0x0055, 0x015C, 0x02B2, 0x0579, 0x0578, 0x015F, 0x00A2, },
-{ 0x0905, 0x013D, 0x013C, 0x0904, 0x121D, 0x049D, 0x049C, 0x243D, 0x0907,
-  0x00ED, 0x0001, 0x0015, 0x0041, 0x013F, 0x0031, 0x0014, 0x025D, 0x025C,
-  0x013E, 0x000D, 0x0000, 0x0040, 0x0139, 0x0043, 0x0030, 0x0017, 0x0033,
-  0x0906, 0x0032, 0x0042, 0x00EC, 0x025F, 0x00EF, 0x025E, 0x049F, 0x0138,
-  0x0901, 0x013B, 0x0259, 0x121C, 0x049E, 0x0900, 0x0258, 0x243C, 0x121F,
-  0x0903, 0x003D, 0x00EE, 0x025B, 0x025A, 0x004D, 0x013A, 0x0902, 0x0245,
-  0x00E9, 0x0016, 0x00E8, 0x0499, 0x0125, 0x0244, 0x004C, 0x0498, 0x090D,
-  0x00EB, 0x003C, 0x0011, 0x049B, 0x049A, 0x0485, 0x00EA, 0x003F, 0x0124,
-  0x090C, 0x003E, 0x0039, 0x0095, 0x0247, 0x0246, 0x0484, 0x0094, 0x0038, },
-{ 0x0F09, 0x00CD, 0x01FD, 0x0791, 0x1E6D, 0x0790, 0x03D9, 0x3CD1, 0x3CD0,
-  0x0075, 0x0001, 0x0001, 0x0035, 0x00CC, 0x0011, 0x0000, 0x03D8, 0x01FC,
-  0x03DB, 0x0010, 0x0003, 0x00CF, 0x03DA, 0x00CE, 0x0074, 0x0034, 0x0077,
-  0x0793, 0x0013, 0x0076, 0x0071, 0x03C5, 0x0070, 0x01FF, 0x0792, 0x01FE,
-  0x01F9, 0x0037, 0x00C9, 0x0F08, 0x01F8, 0x03C4, 0x00C8, 0x0F0B, 0x079D,
-  0x03C7, 0x0001, 0x0012, 0x0073, 0x00CB, 0x0005, 0x0036, 0x03C6, 0x0072,
-  0x007D, 0x0002, 0x00CA, 0x079C, 0x01FB, 0x00F5, 0x0031, 0x079F, 0x0F0A,
-  0x0F35, 0x079E, 0x01FA, 0x1E6C, 0x1E6F, 0x3CD3, 0x0799, 0x03C1, 0x1E6E,
-  0x3CD2, 0x0030, 0x00F4, 0x007C, 0x03C0, 0x03C3, 0x0798, 0x01E5, 0x00F7, },
-{ 0x01A5, 0x0001, 0x001D, 0x0021, 0x00A1, 0x000D, 0x0061, 0x06B9, 0x00A0,
-  0x0060, 0x0001, 0x0005, 0x000C, 0x0020, 0x001C, 0x0004, 0x01A4, 0x01A7,
-  0x00A3, 0x001F, 0x001E, 0x0023, 0x0022, 0x002D, 0x002C, 0x0063, 0x0062,
-  0x1A81, 0x01A6, 0x01A1, 0x06B8, 0x06BB, 0x00A2, 0x06BA, 0x0D59, 0x06A5,
-  0x01A0, 0x000F, 0x006D, 0x06A4, 0x002F, 0x00AD, 0x006C, 0x06A7, 0x00AC,
-  0x0D58, 0x000E, 0x01A3, 0x00AF, 0x00AE, 0x006F, 0x01A2, 0x0D5B, 0x00A9,
-  0x0019, 0x0001, 0x0009, 0x00A8, 0x006E, 0x002E, 0x0000, 0x01AD, 0x00AB,
-  0x00AA, 0x0355, 0x0029, 0x1A80, 0x1A83, 0x1A82, 0x0354, 0x01AC, 0x0D5A,
-  0x1A8D, 0x01AF, 0x0357, 0x0D45, 0x0D44, 0x0D47, 0x1A8C, 0x06A6, 0x06A1, },
-{ 0x0001, 0x0011, 0x0005, 0x0775, 0x00F9, 0x00F8, 0x0031, 0x0030, 0x0049,
-  0x00FB, 0x0010, 0x0033, 0x0EC9, 0x038D, 0x038C, 0x00FA, 0x038F, 0x0774,
-  0x0048, 0x0032, 0x0000, 0x01D5, 0x00E5, 0x038E, 0x00E4, 0x0013, 0x000D,
-  0x0389, 0x0777, 0x0388, 0x038B, 0x1DF9, 0x0EC8, 0x3BC9, 0x1DF8, 0x038A,
-  0x03B5, 0x0776, 0x00E7, 0x3BC8, 0x01D4, 0x3BCB, 0x0ECB, 0x0771, 0x0ECA,
-  0x01D7, 0x03B4, 0x01D6, 0x1DFB, 0x0EF5, 0x0770, 0x0EF4, 0x3BCA, 0x0773,
-  0x00E6, 0x03B7, 0x004B, 0x1DFA, 0x03B6, 0x0EF7, 0x00E1, 0x0EF6, 0x0EF1,
-  0x03B1, 0x01D1, 0x003D, 0x0EF0, 0x0772, 0x077D, 0x077C, 0x003C, 0x01D0,
-  0x03B0, 0x01D3, 0x003F, 0x03B3, 0x01D2, 0x0EF3, 0x077F, 0x00E0, 0x004A, },
-{ 0x0015, 0x0049, 0x0014, 0x07D1, 0x03FD, 0x03FC, 0x01C1, 0x01C0, 0x00F1,
-  0x0017, 0x0001, 0x0001, 0x01C3, 0x0048, 0x004B, 0x0016, 0x0031, 0x01C2,
-  0x004A, 0x0011, 0x0000, 0x01CD, 0x00F0, 0x01CC, 0x0075, 0x0010, 0x000D,
-  0x03FF, 0x01CF, 0x01CE, 0x07D0, 0x0F81, 0x07D3, 0x1F1D, 0x0F80, 0x07D2,
-  0x01C9, 0x03FE, 0x0074, 0x07DD, 0x00F3, 0x1F1C, 0x07DC, 0x03F9, 0x07DF,
-  0x00F2, 0x00FD, 0x0077, 0x07DE, 0x07D9, 0x01C8, 0x07D8, 0x0F83, 0x03F8,
-  0x0030, 0x0076, 0x0013, 0x0F82, 0x00FC, 0x03FB, 0x0033, 0x03FA, 0x03E5,
-  0x03E4, 0x01CB, 0x0032, 0x1F1F, 0x03E7, 0x07DB, 0x07DA, 0x003D, 0x01CA,
-  0x07C5, 0x03E6, 0x0071, 0x0F8D, 0x07C4, 0x1F1E, 0x0F8C, 0x03E1, 0x01F5, },
-{ 0x0019, 0x0065, 0x0018, 0x0351, 0x0350, 0x0353, 0x0021, 0x0020, 0x0064,
-  0x001D, 0x0005, 0x0005, 0x01A5, 0x0023, 0x0067, 0x0005, 0x0066, 0x0022,
-  0x001B, 0x0004, 0x0001, 0x0004, 0x001C, 0x0061, 0x001A, 0x0005, 0x0004,
-  0x0007, 0x002D, 0x0006, 0x002C, 0x01A4, 0x002F, 0x0352, 0x035D, 0x0060,
-  0x0001, 0x002E, 0x001F, 0x035C, 0x0000, 0x06B1, 0x01A7, 0x0029, 0x01A6,
-  0x0028, 0x0063, 0x0062, 0x035F, 0x01A1, 0x002B, 0x06B0, 0x06B3, 0x01A0,
-  0x0003, 0x006D, 0x001E, 0x035E, 0x006C, 0x06B2, 0x0002, 0x01A3, 0x01A2,
-  0x000D, 0x0005, 0x0007, 0x01AD, 0x006F, 0x002A, 0x006E, 0x0004, 0x0004,
-  0x000C, 0x0007, 0x0006, 0x000F, 0x000E, 0x00D5, 0x0009, 0x0006, 0x0007, },
-{ 0x0065, 0x0181, 0x0064, 0x36C9, 0x06D5, 0x0DB5, 0x0379, 0x0180, 0x0183,
-  0x00D5, 0x001D, 0x001C, 0x0DB4, 0x0182, 0x0378, 0x00D4, 0x00D7, 0x06D4,
-  0x0067, 0x001F, 0x0001, 0x00D6, 0x00D1, 0x018D, 0x0066, 0x0001, 0x0000,
-  0x037B, 0x06D7, 0x037A, 0x0DB7, 0x36C8, 0x06D6, 0x0DB6, 0x1B79, 0x0DB1,
-  0x018C, 0x0365, 0x00D0, 0x1B78, 0x00D3, 0x1B7B, 0x0364, 0x06D1, 0x06D0,
-  0x018F, 0x018E, 0x00D2, 0x36CB, 0x0367, 0x0366, 0x06D3, 0x0DB0, 0x06D2,
-  0x0361, 0x06DD, 0x0189, 0x36CA, 0x0360, 0x36F5, 0x0188, 0x0DB3, 0x36F4,
-  0x0009, 0x0008, 0x0005, 0x06DC, 0x00DD, 0x018B, 0x00DC, 0x0004, 0x000B,
-  0x018A, 0x0061, 0x0003, 0x0363, 0x00DF, 0x06DF, 0x0362, 0x000A, 0x001E, },
-{ 0x001D, 0x0061, 0x000D, 0x0D55, 0x06B9, 0x06B8, 0x01A5, 0x0021, 0x0020,
-  0x0023, 0x000C, 0x0060, 0x0D54, 0x00AD, 0x00AC, 0x0022, 0x00AF, 0x06BB,
-  0x000F, 0x001C, 0x0001, 0x002D, 0x0063, 0x01A4, 0x000E, 0x0001, 0x0005,
-  0x01A7, 0x06BA, 0x01A6, 0x06A5, 0x0D57, 0x0D56, 0x1ABD, 0x0D51, 0x00AE,
-  0x002C, 0x00A9, 0x002F, 0x0D50, 0x01A1, 0x1ABC, 0x06A4, 0x06A7, 0x06A6,
-  0x00A8, 0x06A1, 0x01A0, 0x1ABF, 0x0D53, 0x06A0, 0x0D52, 0x1ABE, 0x06A3,
-  0x0062, 0x002E, 0x0009, 0x0D5D, 0x01A3, 0x0D5C, 0x006D, 0x00AB, 0x06A2,
-  0x006C, 0x001F, 0x0001, 0x06AD, 0x0029, 0x01A2, 0x0028, 0x0004, 0x001E,
-  0x01AD, 0x006F, 0x0000, 0x01AC, 0x01AF, 0x06AC, 0x00AA, 0x006E, 0x0019, },
-{ 0x0019, 0x007D, 0x0018, 0x01B5, 0x000D, 0x01B4, 0x007C, 0x007F, 0x01B7,
-  0x000C, 0x001B, 0x001A, 0x01B6, 0x000F, 0x00D5, 0x0019, 0x007E, 0x00D4,
-  0x0018, 0x001B, 0x0001, 0x000E, 0x0011, 0x0009, 0x0005, 0x0005, 0x0005,
-  0x00D7, 0x01B1, 0x0008, 0x01B0, 0x0079, 0x06FD, 0x0371, 0x0370, 0x00D6,
-  0x0078, 0x01B3, 0x0010, 0x0373, 0x0013, 0x06FC, 0x007B, 0x007A, 0x00D1,
-  0x00D0, 0x00D3, 0x0065, 0x0372, 0x06FF, 0x0064, 0x06FE, 0x037D, 0x00D2,
-  0x00DD, 0x0067, 0x0004, 0x037C, 0x0012, 0x01B2, 0x0007, 0x0066, 0x01BD,
-  0x0006, 0x0061, 0x0004, 0x01BC, 0x001A, 0x0060, 0x001D, 0x0004, 0x001C,
-  0x0063, 0x0001, 0x0007, 0x000B, 0x0000, 0x0062, 0x000A, 0x0005, 0x0007, },
-{ 0x0069, 0x0045, 0x0068, 0x04BD, 0x0255, 0x04BC, 0x00E5, 0x00E4, 0x0031,
-  0x0030, 0x0019, 0x0001, 0x0121, 0x00E7, 0x00E6, 0x0033, 0x00E1, 0x00E0,
-  0x006B, 0x0018, 0x0001, 0x0044, 0x0032, 0x0047, 0x006A, 0x001B, 0x0005,
-  0x003D, 0x0046, 0x0015, 0x0041, 0x0120, 0x0123, 0x04BF, 0x0122, 0x0040,
-  0x003C, 0x00E3, 0x0014, 0x0254, 0x0043, 0x0975, 0x012D, 0x00E2, 0x00ED,
-  0x0042, 0x00EC, 0x004D, 0x0257, 0x0256, 0x0251, 0x04BE, 0x0974, 0x0250,
-  0x00EF, 0x00EE, 0x004C, 0x04B9, 0x012C, 0x04B8, 0x004F, 0x04BB, 0x0253,
-  0x003F, 0x0017, 0x0001, 0x0252, 0x00E9, 0x00E8, 0x00EB, 0x0000, 0x0003,
-  0x0016, 0x0002, 0x0004, 0x004E, 0x003E, 0x00EA, 0x0049, 0x000D, 0x0007, },
-{ 0x000D, 0x01BD, 0x000C, 0x0D31, 0x0D30, 0x0D33, 0x0359, 0x0358, 0x002D,
-  0x0065, 0x001D, 0x001C, 0x0D32, 0x035B, 0x035A, 0x002C, 0x01BC, 0x0345,
-  0x000F, 0x001F, 0x0001, 0x002F, 0x0064, 0x01BF, 0x0067, 0x0001, 0x0005,
-  0x0066, 0x002E, 0x0061, 0x0029, 0x0695, 0x0694, 0x0697, 0x0696, 0x0060,
-  0x01BE, 0x0D3D, 0x0028, 0x1A49, 0x0344, 0x1A48, 0x1A4B, 0x0D3C, 0x0691,
-  0x002B, 0x01B9, 0x002A, 0x0D3F, 0x0690, 0x0347, 0x0D3E, 0x1A4A, 0x0346,
-  0x00D5, 0x0341, 0x0063, 0x0D39, 0x0340, 0x0D38, 0x01B8, 0x0D3B, 0x0D3A,
-  0x00D4, 0x0062, 0x0000, 0x0693, 0x01BB, 0x0343, 0x0342, 0x001E, 0x000E,
-  0x006D, 0x0009, 0x0001, 0x006C, 0x00D7, 0x034D, 0x01BA, 0x0008, 0x0004, },
-{ 0x0075, 0x00CD, 0x0035, 0x03C1, 0x03C0, 0x07F9, 0x03C3, 0x1F8D, 0x00CC,
-  0x0074, 0x0011, 0x0010, 0x03C2, 0x0FD9, 0x01F1, 0x00CF, 0x03CD, 0x00CE,
-  0x0034, 0x0001, 0x0001, 0x0037, 0x00C9, 0x00C8, 0x0036, 0x0000, 0x0001,
-  0x0FD8, 0x03CC, 0x00CB, 0x01F0, 0x07F8, 0x03CF, 0x07FB, 0x07FA, 0x00CA,
-  0x01F3, 0x03CE, 0x00F5, 0x0FDB, 0x00F4, 0x07E5, 0x07E4, 0x07E7, 0x01F2,
-  0x07E6, 0x03C9, 0x01FD, 0x0FDA, 0x1F8C, 0x07E1, 0x1F8F, 0x1F8E, 0x03C8,
-  0x03CB, 0x0077, 0x0076, 0x0FC5, 0x03CA, 0x07E0, 0x00F7, 0x0FC4, 0x03F5,
-  0x00F6, 0x01FC, 0x0003, 0x03F4, 0x0071, 0x03F7, 0x00F1, 0x0013, 0x0031,
-  0x0030, 0x0070, 0x0005, 0x0012, 0x0073, 0x01FF, 0x0072, 0x007D, 0x0002, },
-{ 0x0061, 0x0055, 0x0060, 0x02C9, 0x02C8, 0x02CB, 0x0171, 0x00B5, 0x0054,
-  0x0001, 0x0001, 0x0001, 0x0057, 0x0001, 0x0063, 0x001D, 0x0062, 0x0039,
-  0x006D, 0x0000, 0x0005, 0x0038, 0x0056, 0x00B4, 0x006C, 0x0003, 0x001C,
-  0x006F, 0x003B, 0x0002, 0x003A, 0x0170, 0x00B7, 0x0173, 0x0051, 0x006E,
-  0x0025, 0x0050, 0x0069, 0x02CA, 0x0024, 0x0027, 0x0172, 0x00B6, 0x00B1,
-  0x000D, 0x000C, 0x001F, 0x017D, 0x0026, 0x0068, 0x0053, 0x017C, 0x006B,
-  0x001E, 0x000F, 0x0004, 0x017F, 0x006A, 0x02F5, 0x0019, 0x0021, 0x0052,
-  0x02F4, 0x02F7, 0x0020, 0x0BCD, 0x05E5, 0x05E4, 0x0BCC, 0x0023, 0x00B0,
-  0x02F6, 0x00B3, 0x0022, 0x02F1, 0x02F0, 0x0BCF, 0x0BCE, 0x017E, 0x005D, },
-{ 0x00BD, 0x0025, 0x01A1, 0x0159, 0x0299, 0x00BC, 0x0024, 0x0505, 0x0504,
-  0x01A0, 0x0001, 0x001D, 0x006D, 0x001C, 0x0001, 0x0005, 0x0027, 0x01A3,
-  0x0158, 0x001F, 0x001E, 0x01A2, 0x0026, 0x0021, 0x000D, 0x0020, 0x0023,
-  0x0298, 0x006C, 0x0022, 0x00BF, 0x00BE, 0x01AD, 0x002D, 0x029B, 0x00B9,
-  0x01AC, 0x00B8, 0x01AF, 0x029A, 0x006F, 0x015B, 0x006E, 0x0285, 0x0284,
-  0x01AE, 0x0019, 0x002C, 0x01A9, 0x01A8, 0x000C, 0x000F, 0x015A, 0x00BB,
-  0x000E, 0x0000, 0x0069, 0x01AB, 0x0018, 0x01AA, 0x0004, 0x0055, 0x00BA,
-  0x0507, 0x0145, 0x0054, 0x0506, 0x00A5, 0x0501, 0x00A4, 0x0057, 0x0500,
-  0x0A05, 0x0144, 0x00A7, 0x0287, 0x0286, 0x0503, 0x0147, 0x0A04, 0x0146, },
-{ 0x0759, 0x0041, 0x00E5, 0x03BD, 0x0E9D, 0x012D, 0x012C, 0x3A1D, 0x03BC,
-  0x012F, 0x000D, 0x0040, 0x00E4, 0x03BF, 0x0043, 0x0042, 0x0758, 0x03BE,
-  0x00E7, 0x0001, 0x0000, 0x003D, 0x00E6, 0x0015, 0x0014, 0x0017, 0x003C,
-  0x743D, 0x012E, 0x03B9, 0x03B8, 0x0E9C, 0x03BB, 0x075B, 0x3A1C, 0x0E9F,
-  0x0129, 0x00E1, 0x0128, 0x0E9E, 0x012B, 0x075A, 0x00E0, 0x0E99, 0x0745,
-  0x3A1F, 0x03BA, 0x0744, 0x0E98, 0x1D0D, 0x03A5, 0x0E9B, 0x743C, 0x0E9A,
-  0x012A, 0x004D, 0x00E3, 0x0E85, 0x01D5, 0x0E84, 0x004C, 0x0747, 0x1D0C,
-  0x01D4, 0x003F, 0x0016, 0x0746, 0x03A4, 0x0741, 0x004F, 0x003E, 0x01D7,
-  0x0740, 0x000C, 0x0011, 0x004E, 0x00E2, 0x00ED, 0x00EC, 0x0049, 0x0048, },
-};
-
-static const uint8_t aic_mode2_vlc_bits[AIC_MODE2_NUM][AIC_MODE2_SIZE] = {
-{  1,  5,  4, 10,  6,  8,  5,  8,  8,
-   7,  5,  7, 11, 10,  9,  8, 13, 11,
-   6,  7,  3,  9,  8, 10,  9,  8,  5,
-  10,  9, 10, 10, 14, 12, 14, 14, 12,
-   8,  9,  7, 12,  8, 14,  9,  9, 12,
-   8,  9, 11, 11, 13,  9, 11, 14, 12,
-   6,  7,  9, 13,  9, 12,  7, 10, 12,
-  11, 12,  8, 15, 10, 15, 13,  7, 12,
-  10, 10,  8, 10, 13, 13, 13, 11,  8, },
-{  4,  6,  5, 11,  8, 10,  7, 11,  9,
-   4,  1,  4,  9,  7,  7,  5,  9, 10,
-   6,  7,  4,  9,  9, 10,  9,  9,  6,
-   9, 10,  9, 10, 12, 12, 13, 12, 11,
-   9,  9,  8, 12,  8, 14, 10, 11, 12,
-   7,  8, 10, 11, 12,  9, 11, 13, 12,
-   6,  7,  8, 12,  9, 12,  7, 11, 10,
-  12, 12,  9, 14, 12, 15, 13,  8, 12,
-  11, 11, 10, 12, 13, 15, 14, 12,  9, },
-{  5,  7,  6, 12,  9, 11,  8, 11, 10,
-   7,  5,  7, 11, 10,  9,  8, 12, 12,
-   5,  5,  1,  8,  7, 10,  8,  6,  4,
-   8,  8,  8,  9, 12, 11, 13, 12, 11,
-   8,  9,  8, 12,  8, 13, 10, 11, 11,
-   8,  9, 11, 12, 13, 11, 12, 14, 13,
-   8,  9, 10, 14, 11, 14,  9, 13, 13,
-   8,  9,  6, 11, 10, 14, 11,  6, 10,
-   6,  6,  4,  8,  9, 10, 10,  8,  5, },
-{ 11,  7,  8, 10, 12,  9, 10, 14, 12,
-   7,  1,  5,  7,  8,  6,  4, 10,  9,
-  10,  5,  4,  8, 11,  8,  7,  6,  7,
-  11,  6,  7,  8, 10,  8, 10, 11,  9,
-  10,  8,  9, 13,  9, 12,  8, 11, 12,
-  11,  4,  7,  8,  9,  6,  8, 12,  9,
-   8,  5,  8, 12,  9, 10,  6, 12, 11,
-  12, 12, 10, 15, 13, 13, 13, 10, 13,
-  15, 10,  9, 10, 12, 13, 13, 10,  9, },
-{ 11,  8,  8, 11, 13, 10, 11, 15, 12,
-   7,  1,  4,  7,  7,  5,  4,  8,  9,
-  11,  5,  5,  8, 11,  9,  8,  7,  8,
-  13,  7,  8,  9, 11,  9, 10, 12, 10,
-  10,  9,  8, 13,  9, 12,  9, 11, 12,
-  11,  5,  7,  9, 10,  6,  9, 13, 10,
-   7,  4,  7, 11,  8,  9,  5, 10, 11,
-  13, 11,  9, 15, 13, 15, 13,  8, 12,
-  15, 10, 10, 12, 13, 14, 14, 12, 11, },
-{ 12,  9,  9, 12, 13, 11, 11, 14, 12,
-   8,  2,  5,  7,  9,  6,  5, 10, 10,
-   9,  4,  2,  7,  9,  7,  6,  5,  6,
-  12,  6,  7,  8, 10,  8, 10, 11,  9,
-  12,  9, 10, 13, 11, 12, 10, 14, 13,
-  12,  6,  8, 10, 10,  7,  9, 12, 10,
-   8,  5,  8, 11,  9, 10,  7, 11, 12,
-   8,  6,  5, 11, 11, 11,  8,  6,  9,
-  12,  6,  6,  8, 10, 10, 11,  8,  6, },
-{ 13,  9, 10, 12, 14, 12, 11, 15, 15,
-   8,  1,  5,  7,  9,  6,  5, 11, 10,
-  11,  6,  5,  9, 11,  9,  8,  7,  8,
-  12,  6,  8,  8, 11,  8, 10, 12, 10,
-  10,  7,  9, 13, 10, 11,  9, 13, 12,
-  11,  3,  6,  8,  9,  4,  7, 11,  8,
-   8,  5,  9, 12, 10,  9,  7, 12, 13,
-  13, 12, 10, 14, 14, 15, 12, 11, 14,
-  15,  7,  9,  8, 11, 11, 12, 10,  9, },
-{ 10,  5,  6,  9, 11,  7,  8, 12, 11,
-   8,  1,  4,  7,  9,  6,  4, 10, 10,
-  11,  6,  6,  9,  9,  9,  9,  8,  8,
-  14, 10, 10, 12, 12, 11, 12, 13, 12,
-  10,  7,  8, 12,  9, 11,  8, 12, 11,
-  13,  7, 10, 11, 11,  8, 10, 13, 11,
-   6,  3,  7, 11,  8,  9,  5, 10, 11,
-  11, 11,  9, 14, 14, 14, 11, 10, 13,
-  14, 10, 11, 13, 13, 13, 14, 12, 12, },
-{  2,  5,  3, 11,  8,  8,  6,  6,  7,
-   8,  5,  6, 12, 10, 10,  8, 10, 11,
-   7,  6,  2,  9,  8, 10,  8,  5,  4,
-  10, 11, 10, 10, 13, 12, 14, 13, 10,
-  10, 11,  8, 14,  9, 14, 12, 11, 12,
-   9, 10,  9, 13, 12, 11, 12, 14, 11,
-   8, 10,  7, 13, 10, 12,  8, 12, 12,
-  10,  9,  6, 12, 11, 11, 11,  6,  9,
-  10,  9,  6, 10,  9, 12, 11,  8,  7, },
-{  6,  8,  6, 12, 11, 11, 10, 10,  9,
-   6,  1,  3, 10,  8,  8,  6,  7, 10,
-   8,  6,  3, 10,  9, 10,  8,  6,  5,
-  11, 10, 10, 12, 13, 12, 14, 13, 12,
-  10, 11,  8, 12,  9, 14, 12, 11, 12,
-   9,  9,  8, 12, 12, 10, 12, 13, 11,
-   7,  8,  6, 13,  9, 11,  7, 11, 11,
-  11, 10,  7, 14, 11, 12, 12,  7, 10,
-  12, 11,  8, 13, 12, 14, 13, 11, 10, },
-{  7, 10,  7, 13, 13, 13, 11, 11, 10,
-   8,  5,  6, 12, 11, 10,  9, 10, 11,
-   7,  5,  1,  9,  8, 10,  7,  4,  4,
-   9, 11,  9, 11, 12, 11, 13, 13, 10,
-   9, 11,  8, 13,  9, 14, 12, 11, 12,
-  11, 10, 10, 13, 12, 11, 14, 14, 12,
-   9, 10,  8, 13, 10, 14,  9, 12, 12,
-   9,  7,  4, 12, 10, 11, 10,  6,  7,
-   9,  7,  4,  9,  9, 11,  9,  7,  5, },
-{  7,  9,  7, 14, 11, 12, 10,  9,  9,
-   8,  5,  5, 12,  9, 10,  8,  8, 11,
-   7,  5,  2,  8,  8,  9,  7,  4,  4,
-  10, 11, 10, 12, 14, 11, 12, 13, 12,
-   9, 10,  8, 13,  8, 13, 10, 11, 11,
-   9,  9,  8, 14, 10, 10, 11, 12, 11,
-  10, 11,  9, 14, 10, 14,  9, 12, 14,
-   6,  6,  3, 11,  8,  9,  8,  3,  6,
-   9,  7,  4, 10,  8, 11, 10,  6,  5, },
-{  6,  8,  7, 13, 12, 12, 10,  9,  9,
-   9,  7,  8, 13, 11, 11,  9, 11, 12,
-   7,  6,  1,  9,  8, 10,  7,  5,  4,
-  10, 12, 10, 12, 13, 13, 14, 13, 11,
-   9, 11,  9, 13, 10, 14, 12, 12, 12,
-  11, 12, 10, 14, 13, 12, 13, 14, 12,
-   8,  9,  7, 13, 10, 13,  8, 11, 12,
-   8,  6,  3, 12,  9, 10,  9,  4,  6,
-  10,  8,  5, 10, 10, 12, 11,  8,  6, },
-{  7, 10,  7, 12,  9, 12, 10, 10, 12,
-   9,  7,  7, 12,  9, 11,  6, 10, 11,
-   6,  6,  1,  9,  8,  9,  7,  4,  5,
-  11, 12,  9, 12, 10, 14, 13, 13, 11,
-  10, 12,  8, 13,  8, 14, 10, 10, 11,
-  11, 11, 10, 13, 14, 10, 14, 13, 11,
-  11, 10,  7, 13,  8, 12,  7, 10, 12,
-   7, 10,  4, 12,  6, 10,  8,  5,  8,
-  10,  7,  4,  9,  7, 10,  9,  6,  5, },
-{  7,  9,  7, 13, 12, 13, 10, 10,  8,
-   8,  5,  6, 11, 10, 10,  8, 10, 10,
-   7,  5,  2,  9,  8,  9,  7,  5,  3,
-   8,  9,  7,  9, 11, 11, 13, 11,  9,
-   8, 10,  7, 12,  9, 14, 11, 10, 10,
-   9, 10,  9, 12, 12, 12, 13, 14, 12,
-  10, 10,  9, 13, 11, 13,  9, 13, 12,
-   8,  7,  4, 12, 10, 10, 10,  6,  6,
-   7,  6,  3,  9,  8, 10,  9,  6,  3, },
-{  7, 10,  7, 13, 13, 13, 11, 11,  9,
-   8,  6,  6, 13, 11, 11,  9, 10, 11,
-   7,  6,  1,  9,  8, 10,  8,  5,  4,
-   8,  9,  8,  9, 12, 12, 12, 12,  8,
-  10, 13,  9, 14, 11, 14, 14, 13, 12,
-   9, 10,  9, 13, 12, 11, 13, 14, 11,
-   9, 11,  8, 13, 11, 13, 10, 13, 13,
-   9,  8,  5, 12, 10, 11, 11,  6,  7,
-   8,  7,  3,  8,  9, 11, 10,  7,  4, },
-{  8,  9,  7, 11, 11, 12, 11, 14,  9,
-   8,  6,  6, 11, 13, 10,  9, 11,  9,
-   7,  5,  1,  7,  9,  9,  7,  5,  3,
-  13, 11,  9, 10, 12, 11, 12, 12,  9,
-  10, 11,  9, 13,  9, 12, 12, 12, 10,
-  12, 11, 10, 13, 14, 12, 14, 14, 11,
-  11,  8,  8, 13, 11, 12,  9, 13, 11,
-   9, 10,  5, 11,  8, 11,  9,  6,  7,
-   7,  8,  4,  6,  8, 10,  8,  8,  5, },
-{  8, 10,  8, 13, 13, 13, 12, 11, 10,
-   5,  1,  3, 10,  7,  8,  6,  8,  9,
-   8,  7,  4,  9, 10, 11,  8,  7,  6,
-   8,  9,  7,  9, 12, 11, 12, 10,  8,
-   9, 10,  8, 13,  9,  9, 12, 11, 11,
-   7,  7,  6, 12,  9,  8, 10, 12,  8,
-   6,  7,  4, 12,  8, 13,  6,  9, 10,
-  13, 13,  9, 15, 14, 14, 15,  9, 11,
-  13, 11,  9, 13, 13, 15, 15, 12, 10, },
-{ 10,  8,  9, 11, 12, 10,  8, 13, 13,
-   9,  2,  5,  7,  5,  4,  3,  8,  9,
-  11,  5,  5,  9,  8,  8,  6,  8,  8,
-  12,  7,  8, 10, 10,  9,  8, 12, 10,
-   9, 10,  9, 12,  7, 11,  7, 12, 12,
-   9,  5,  8,  9,  9,  6,  6, 11, 10,
-   6,  4,  7,  9,  5,  9,  3,  9, 10,
-  13, 11,  9, 13, 10, 13, 10,  9, 13,
-  14, 11, 10, 12, 12, 13, 11, 14, 11, },
-{ 11,  7,  8, 10, 12,  9,  9, 14, 10,
-   9,  4,  7,  8, 10,  7,  7, 11, 10,
-   8,  2,  2,  6,  8,  5,  5,  5,  6,
-  15,  9, 10, 10, 12, 10, 11, 14, 12,
-   9,  8,  9, 12,  9, 11,  8, 12, 11,
-  14, 10, 11, 12, 13, 10, 12, 15, 12,
-   9,  7,  8, 12,  9, 12,  7, 11, 13,
-   9,  6,  5, 11, 10, 11,  7,  6,  9,
-  11,  4,  5,  7,  8,  8,  8,  7,  7, },
-};
-//@}
-
-/**
- * Codes used for determining block type
- */
-//@{
-#define AIC_MODE1_NUM  90
-#define AIC_MODE1_SIZE  9
-#define AIC_MODE1_BITS  7
-
-static const uint8_t aic_mode1_vlc_codes[AIC_MODE1_NUM][AIC_MODE1_SIZE] = {
- { 0x01, 0x01, 0x01, 0x11, 0x00, 0x09, 0x03, 0x10, 0x05,},
- { 0x09, 0x01, 0x01, 0x05, 0x11, 0x00, 0x03, 0x21, 0x20,},
- { 0x01, 0x01, 0x01, 0x11, 0x09, 0x10, 0x05, 0x00, 0x03,},
- { 0x01, 0x01, 0x00, 0x03, 0x21, 0x05, 0x09, 0x20, 0x11,},
- { 0x01, 0x09, 0x00, 0x29, 0x08, 0x15, 0x03, 0x0B, 0x28,},
- { 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x03, 0x02,},
- { 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x01, 0x09, 0x08,},
- { 0x01, 0x01, 0x01, 0x09, 0x01, 0x08, 0x00, 0x03, 0x05,},
- { 0x01, 0x01, 0x01, 0x00, 0x05, 0x11, 0x09, 0x10, 0x03,},
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
-
- { 0x01, 0x01, 0x01, 0x05, 0x01, 0x00, 0x03, 0x09, 0x08,},
- { 0x09, 0x01, 0x01, 0x05, 0x11, 0x00, 0x03, 0x21, 0x20,},
- { 0x01, 0x01, 0x01, 0x0D, 0x05, 0x04, 0x00, 0x07, 0x0C,},
- { 0x01, 0x01, 0x00, 0x05, 0x11, 0x03, 0x09, 0x21, 0x20,},
- { 0x05, 0x01, 0x01, 0x11, 0x00, 0x09, 0x03, 0x21, 0x20,},
- { 0x09, 0x01, 0x01, 0x00, 0x05, 0x01, 0x03, 0x11, 0x10,},
- { 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x03, 0x02,},
- { 0x01, 0x01, 0x01, 0x09, 0x00, 0x05, 0x01, 0x03, 0x08,},
- { 0x01, 0x01, 0x01, 0x09, 0x11, 0x05, 0x00, 0x10, 0x03,},
- { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
-
- { 0x01, 0x00, 0x01, 0x09, 0x08, 0x15, 0x14, 0x0B, 0x03,},
- { 0x0D, 0x01, 0x01, 0x05, 0x0C, 0x04, 0x01, 0x00, 0x07,},
- { 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x03, 0x01, 0x01,},
- { 0x05, 0x01, 0x01, 0x04, 0x19, 0x07, 0x18, 0x0D, 0x00,},
- { 0x11, 0x09, 0x01, 0x21, 0x05, 0x20, 0x01, 0x00, 0x03,},
- { 0x41, 0x01, 0x00, 0x05, 0x40, 0x03, 0x09, 0x21, 0x11,},
- { 0x29, 0x01, 0x00, 0x28, 0x09, 0x15, 0x03, 0x08, 0x0B,},
- { 0x01, 0x00, 0x01, 0x11, 0x09, 0x10, 0x05, 0x01, 0x03,},
- { 0x05, 0x01, 0x01, 0x04, 0x0D, 0x0C, 0x07, 0x00, 0x01,},
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
-
- { 0x01, 0x00, 0x03, 0x05, 0x11, 0x10, 0x25, 0x24, 0x13,},
- { 0x21, 0x01, 0x01, 0x00, 0x11, 0x03, 0x05, 0x20, 0x09,},
- { 0x01, 0x01, 0x01, 0x00, 0x09, 0x11, 0x10, 0x05, 0x03,},
- { 0x21, 0x05, 0x01, 0x01, 0x09, 0x00, 0x11, 0x20, 0x03,},
- { 0x05, 0x01, 0x00, 0x04, 0x01, 0x19, 0x07, 0x18, 0x0D,},
- { 0x11, 0x01, 0x00, 0x01, 0x09, 0x01, 0x03, 0x10, 0x05,},
- { 0x1D, 0x01, 0x05, 0x0D, 0x0C, 0x04, 0x00, 0x1C, 0x0F,},
- { 0x05, 0x19, 0x01, 0x04, 0x00, 0x18, 0x1B, 0x1A, 0x07,},
- { 0x09, 0x01, 0x00, 0x01, 0x05, 0x03, 0x11, 0x10, 0x01,},
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
-
- { 0x01, 0x00, 0x03, 0x41, 0x05, 0x40, 0x09, 0x11, 0x21,},
- { 0x05, 0x01, 0x01, 0x19, 0x04, 0x07, 0x00, 0x18, 0x0D,},
- { 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x01, 0x00, 0x03,},
- { 0x01, 0x05, 0x00, 0x0D, 0x01, 0x04, 0x07, 0x19, 0x18,},
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,},
- { 0x31, 0x01, 0x05, 0x19, 0x04, 0x07, 0x00, 0x30, 0x0D,},
- { 0x01, 0x00, 0x03, 0x11, 0x01, 0x05, 0x01, 0x09, 0x10,},
- { 0x01, 0x05, 0x01, 0x11, 0x01, 0x10, 0x00, 0x03, 0x09,},
- { 0x01, 0x09, 0x00, 0x29, 0x03, 0x08, 0x28, 0x15, 0x0B,},
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
-
- { 0x01, 0x01, 0x00, 0x09, 0x15, 0x03, 0x08, 0x14, 0x0B,},
- { 0x11, 0x01, 0x01, 0x00, 0x09, 0x01, 0x03, 0x10, 0x05,},
- { 0x01, 0x00, 0x03, 0x25, 0x11, 0x05, 0x10, 0x24, 0x13,},
- { 0x11, 0x01, 0x00, 0x01, 0x09, 0x01, 0x05, 0x10, 0x03,},
- { 0x05, 0x01, 0x00, 0x0D, 0x0C, 0x04, 0x0F, 0x1D, 0x1C,},
- { 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x03, 0x02,},
- { 0x21, 0x01, 0x05, 0x09, 0x11, 0x00, 0x03, 0x41, 0x40,},
- { 0x05, 0x01, 0x00, 0x1D, 0x1C, 0x0D, 0x0C, 0x0F, 0x04,},
- { 0x05, 0x01, 0x00, 0x0D, 0x31, 0x04, 0x19, 0x30, 0x07,},
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
-
- { 0x01, 0x01, 0x00, 0x21, 0x05, 0x11, 0x03, 0x09, 0x20,},
- { 0x01, 0x01, 0x00, 0x11, 0x03, 0x05, 0x01, 0x09, 0x10,},
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,},
- { 0x05, 0x01, 0x04, 0x19, 0x07, 0x0D, 0x00, 0x31, 0x30,},
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,},
- { 0x05, 0x01, 0x01, 0x11, 0x09, 0x00, 0x03, 0x21, 0x20,},
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02,},
- { 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x01, 0x01, 0x02,},
- { 0x09, 0x01, 0x00, 0x29, 0x08, 0x15, 0x03, 0x28, 0x0B,},
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
-
- { 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x00, 0x01, 0x03,},
- { 0x09, 0x01, 0x00, 0x29, 0x28, 0x15, 0x08, 0x03, 0x0B,},
- { 0x01, 0x00, 0x01, 0x11, 0x05, 0x10, 0x09, 0x01, 0x03,},
- { 0x05, 0x04, 0x01, 0x1D, 0x0D, 0x0C, 0x1C, 0x00, 0x0F,},
- { 0x09, 0x11, 0x01, 0x41, 0x00, 0x40, 0x05, 0x03, 0x21,},
- { 0x0D, 0x05, 0x01, 0x1D, 0x1C, 0x0C, 0x04, 0x00, 0x0F,},
- { 0x41, 0x09, 0x01, 0x40, 0x00, 0x11, 0x05, 0x03, 0x21,},
- { 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x00, 0x01, 0x03,},
- { 0x05, 0x04, 0x01, 0x0D, 0x01, 0x0C, 0x07, 0x01, 0x00,},
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
-
- { 0x05, 0x04, 0x01, 0x07, 0x19, 0x31, 0x30, 0x0D, 0x00,},
- { 0x21, 0x01, 0x01, 0x00, 0x11, 0x09, 0x20, 0x05, 0x03,},
- { 0x05, 0x01, 0x01, 0x04, 0x07, 0x0D, 0x0C, 0x00, 0x01,},
- { 0x21, 0x09, 0x01, 0x00, 0x20, 0x05, 0x23, 0x22, 0x03,},
- { 0x31, 0x0D, 0x01, 0x19, 0x05, 0x30, 0x04, 0x07, 0x00,},
- { 0x31, 0x05, 0x01, 0x04, 0x19, 0x00, 0x0D, 0x30, 0x07,},
- { 0x31, 0x01, 0x00, 0x0D, 0x05, 0x19, 0x04, 0x30, 0x07,},
- { 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02, 0x01, 0x01,},
- { 0x01, 0x00, 0x01, 0x01, 0x05, 0x09, 0x08, 0x03, 0x01,},
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,},
-};
-
-static const uint8_t aic_mode1_vlc_bits[AIC_MODE1_NUM][AIC_MODE1_SIZE] = {
- {  1,  4,  2,  7,  4,  6,  4,  7,  5,},
- {  5,  1,  3,  4,  6,  3,  3,  7,  7,},
- {  1,  4,  2,  7,  6,  7,  5,  4,  4,},
- {  1,  3,  3,  3,  7,  4,  5,  7,  6,},
- {  2,  4,  2,  6,  4,  5,  2,  4,  6,},
- {  7,  2,  3,  4,  7,  1,  5,  7,  7,},
- {  5,  1,  3,  6,  5,  5,  2,  7,  7,},
- {  2,  5,  1,  7,  3,  7,  5,  5,  6,},
- {  2,  4,  1,  4,  5,  7,  6,  7,  4,},
- {  0,  0,  0,  0,  0,  0,  0,  0,  0,},
-
- {  2,  1,  3,  6,  5,  5,  5,  7,  7,},
- {  5,  1,  3,  4,  6,  3,  3,  7,  7,},
- {  4,  1,  2,  6,  5,  5,  4,  5,  6,},
- {  3,  1,  3,  4,  6,  3,  5,  7,  7,},
- {  4,  1,  3,  6,  3,  5,  3,  7,  7,},
- {  6,  1,  4,  4,  5,  2,  4,  7,  7,},
- {  7,  1,  5,  7,  4,  3,  2,  7,  7,},
- {  5,  3,  2,  7,  5,  6,  1,  5,  7,},
- {  4,  1,  2,  6,  7,  5,  4,  7,  4,},
- {  1,  0,  1,  0,  0,  0,  0,  0,  0,},
-
- {  3,  3,  1,  5,  5,  6,  6,  5,  3,},
- {  6,  2,  1,  5,  6,  5,  4,  4,  5,},
- {  6,  4,  1,  7,  6,  7,  6,  3,  2,},
- {  4,  3,  1,  4,  6,  4,  6,  5,  3,},
- {  6,  5,  1,  7,  4,  7,  3,  3,  3,},
- {  7,  2,  2,  3,  7,  2,  4,  6,  5,},
- {  6,  2,  2,  6,  4,  5,  2,  4,  4,},
- {  4,  4,  1,  7,  6,  7,  5,  2,  4,},
- {  5,  4,  1,  5,  6,  6,  5,  4,  2,},
- {  0,  0,  0,  0,  0,  0,  0,  0,  0,},
-
- {  2,  2,  2,  3,  5,  5,  6,  6,  5,},
- {  7,  1,  3,  3,  6,  3,  4,  7,  5,},
- {  2,  4,  1,  4,  6,  7,  7,  5,  4,},
- {  7,  4,  3,  1,  5,  3,  6,  7,  3,},
- {  4,  3,  3,  4,  1,  6,  4,  6,  5,},
- {  7,  4,  4,  2,  6,  1,  4,  7,  5,},
- {  5,  2,  3,  4,  4,  3,  2,  5,  4,},
- {  3,  5,  2,  3,  2,  5,  5,  5,  3,},
- {  6,  4,  4,  2,  5,  4,  7,  7,  1,},
- {  0,  0,  0,  0,  0,  0,  0,  0,  0,},
-
- {  2,  2,  2,  7,  3,  7,  4,  5,  6,},
- {  4,  1,  3,  6,  4,  4,  3,  6,  5,},
- {  2,  4,  1,  7,  3,  7,  6,  6,  6,},
- {  3,  4,  3,  5,  1,  4,  4,  6,  6,},
- {  4,  5,  2,  7,  1,  7,  3,  7,  7,},
- {  6,  2,  3,  5,  3,  3,  2,  6,  4,},
- {  4,  4,  4,  7,  2,  5,  1,  6,  7,},
- {  4,  5,  2,  7,  1,  7,  4,  4,  6,},
- {  2,  4,  2,  6,  2,  4,  6,  5,  4,},
- {  0,  0,  0,  0,  0,  0,  0,  0,  0,},
-
- {  1,  3,  3,  5,  6,  3,  5,  6,  5,},
- {  7,  1,  4,  4,  6,  2,  4,  7,  5,},
- {  2,  2,  2,  6,  5,  3,  5,  6,  5,},
- {  7,  4,  4,  2,  6,  1,  5,  7,  4,},
- {  3,  2,  2,  4,  4,  3,  4,  5,  5,},
- {  7,  2,  5,  3,  7,  1,  4,  7,  7,},
- {  6,  2,  3,  4,  5,  2,  2,  7,  7,},
- {  3,  2,  2,  5,  5,  4,  4,  4,  3,},
- {  3,  2,  2,  4,  6,  3,  5,  6,  3,},
- {  0,  0,  0,  0,  0,  0,  0,  0,  0,},
-
- {  1,  3,  3,  7,  4,  6,  3,  5,  7,},
- {  4,  1,  4,  7,  4,  5,  2,  6,  7,},
- {  2,  4,  1,  7,  5,  7,  3,  7,  7,},
- {  3,  2,  3,  5,  3,  4,  2,  6,  6,},
- {  3,  5,  4,  7,  2,  7,  1,  7,  7,},
- {  4,  1,  3,  6,  5,  3,  3,  7,  7,},
- {  4,  2,  5,  7,  3,  7,  1,  7,  7,},
- {  7,  4,  1,  7,  3,  7,  2,  5,  7,},
- {  4,  2,  2,  6,  4,  5,  2,  6,  4,},
- {  0,  0,  0,  0,  0,  0,  0,  0,  0,},
-
- {  3,  4,  1,  7,  6,  7,  6,  2,  6,},
- {  4,  2,  2,  6,  6,  5,  4,  2,  4,},
- {  4,  4,  1,  7,  5,  7,  6,  2,  4,},
- {  3,  3,  2,  5,  4,  4,  5,  2,  4,},
- {  4,  5,  2,  7,  2,  7,  3,  2,  6,},
- {  4,  3,  2,  5,  5,  4,  3,  2,  4,},
- {  7,  4,  2,  7,  2,  5,  3,  2,  6,},
- {  4,  6,  2,  7,  3,  7,  6,  1,  6,},
- {  5,  5,  1,  6,  4,  6,  5,  2,  4,},
- {  0,  0,  0,  0,  0,  0,  0,  0,  0,},
-
- {  3,  3,  2,  3,  5,  6,  6,  4,  2,},
- {  7,  1,  3,  3,  6,  5,  7,  4,  3,},
- {  5,  4,  1,  5,  5,  6,  6,  4,  2,},
- {  6,  4,  2,  2,  6,  3,  6,  6,  2,},
- {  6,  4,  2,  5,  3,  6,  3,  3,  2,},
- {  6,  3,  2,  3,  5,  2,  4,  6,  3,},
- {  6,  2,  2,  4,  3,  5,  3,  6,  3,},
- {  7,  5,  1,  7,  4,  7,  7,  3,  2,},
- {  5,  5,  2,  3,  6,  7,  7,  5,  1,},
- {  0,  0,  0,  0,  0,  0,  0,  0,  0,},
-};
-
-//@}
-
-#define PBTYPE_ESCAPE 0xFF
-
-/** tables used for P-frame macroblock type decoding */
-//@{
-#define NUM_PTYPE_VLCS 7
-#define PTYPE_VLC_SIZE 8
-#define PTYPE_VLC_BITS 7
-
-static const uint8_t ptype_vlc_codes[NUM_PTYPE_VLCS][PTYPE_VLC_SIZE] = {
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
- { 0x0D, 0x05, 0x01, 0x04, 0x01, 0x00, 0x07, 0x0C },
- { 0x09, 0x11, 0x01, 0x00, 0x05, 0x03, 0x21, 0x20 },
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }
-};
-
-static const uint8_t ptype_vlc_bits[NUM_PTYPE_VLCS][PTYPE_VLC_SIZE] = {
- { 1, 2, 3, 6, 5, 4, 7, 7 },
- { 3, 1, 2, 7, 6, 5, 4, 7 },
- { 5, 4, 1, 4, 3, 3, 4, 5 },
- { 4, 5, 2, 2, 3, 2, 6, 6 },
- { 5, 6, 1, 4, 2, 3, 7, 7 },
- { 5, 6, 1, 4, 3, 2, 7, 7 },
- { 6, 3, 2, 7, 5, 4, 1, 7 }
-};
-
-static const uint8_t ptype_vlc_syms[PTYPE_VLC_SIZE] = {
- 0, 1, 2, 3, 8, 9, 11, PBTYPE_ESCAPE
-};
-
-/** reverse of ptype_vlc_syms */
-static const uint8_t block_num_to_ptype_vlc_num[12] = {
- 0, 1, 2, 3, 0, 0, 2, 0, 4, 5, 0, 6
-};
-//@}
-
-/** tables used for P-frame macroblock type decoding */
-//@{
-#define NUM_BTYPE_VLCS 6
-#define BTYPE_VLC_SIZE 7
-#define BTYPE_VLC_BITS 6
-
-static const uint8_t btype_vlc_codes[NUM_BTYPE_VLCS][BTYPE_VLC_SIZE] = {
- { 0x01, 0x05, 0x00, 0x03, 0x11, 0x09, 0x10 },
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
- { 0x09, 0x01, 0x00, 0x01, 0x05, 0x03, 0x08 },
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 },
- { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 }
-};
-
-static const uint8_t btype_vlc_bits[NUM_BTYPE_VLCS][PTYPE_VLC_SIZE] = {
- { 2, 3, 2, 2, 5, 4, 5 },
- { 4, 1, 3, 2, 6, 5, 6 },
- { 6, 4, 1, 2, 5, 3, 6 },
- { 5, 3, 3, 1, 4, 3, 5 },
- { 6, 5, 3, 2, 4, 1, 6 },
- { 6, 5, 3, 1, 4, 2, 6 }
-};
-
-static const uint8_t btype_vlc_syms[BTYPE_VLC_SIZE] = {
- 0, 1, 4, 5, 10, 7, PBTYPE_ESCAPE
-};
-
-/** reverse of btype_vlc_syms */
-static const uint8_t block_num_to_btype_vlc_num[12] = {
- 0, 1, 0, 0, 2, 3, 0, 5, 0, 0, 4, 0
-};
-//@}
-#endif /* AVCODEC_RV40VLC2_H */
diff --git a/deps/libav/libavcodec/s302m.c b/deps/libav/libavcodec/s302m.c
deleted file mode 100644
index 36384fb..0000000
--- a/deps/libav/libavcodec/s302m.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * SMPTE 302M decoder
- * Copyright (c) 2008 Laurent Aimar <fenrir at videolan.org>
- * Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/log.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "mathops.h"
-
-#define AES3_HEADER_LEN 4
-
-static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
-                                    int buf_size)
-{
-    uint32_t h;
-    int frame_size, channels, bits;
-
-    if (buf_size <= AES3_HEADER_LEN) {
-        av_log(avctx, AV_LOG_ERROR, "frame is too short\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /*
-     * AES3 header :
-     * size:            16
-     * number channels   2
-     * channel_id        8
-     * bits per samples  2
-     * alignments        4
-     */
-
-    h = AV_RB32(buf);
-    frame_size =  (h >> 16) & 0xffff;
-    channels   = ((h >> 14) & 0x0003) * 2 +  2;
-    bits       = ((h >>  4) & 0x0003) * 4 + 16;
-
-    if (AES3_HEADER_LEN + frame_size != buf_size || bits > 24) {
-        av_log(avctx, AV_LOG_ERROR, "frame has invalid header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Set output properties */
-    avctx->bits_per_coded_sample = bits;
-    if (bits > 16)
-        avctx->sample_fmt = AV_SAMPLE_FMT_S32;
-    else
-        avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-
-    avctx->channels    = channels;
-    avctx->sample_rate = 48000;
-    avctx->bit_rate    = 48000 * avctx->channels * (avctx->bits_per_coded_sample + 4) +
-                         32 * (48000 / (buf_size * 8 /
-                                        (avctx->channels *
-                                         (avctx->bits_per_coded_sample + 4))));
-
-    return frame_size;
-}
-
-static int s302m_decode_frame(AVCodecContext *avctx, void *data,
-                              int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    int block_size, ret;
-
-    int frame_size = s302m_parse_frame_header(avctx, buf, buf_size);
-    if (frame_size < 0)
-        return frame_size;
-
-    buf_size -= AES3_HEADER_LEN;
-    buf      += AES3_HEADER_LEN;
-
-    /* get output buffer */
-    block_size = (avctx->bits_per_coded_sample + 4) / 4;
-    frame->nb_samples = 2 * (buf_size / block_size) / avctx->channels;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    buf_size = (frame->nb_samples * avctx->channels / 2) * block_size;
-
-    if (avctx->bits_per_coded_sample == 24) {
-        uint32_t *o = (uint32_t *)frame->data[0];
-        for (; buf_size > 6; buf_size -= 7) {
-            *o++ = (ff_reverse[buf[2]]        << 24) |
-                   (ff_reverse[buf[1]]        << 16) |
-                   (ff_reverse[buf[0]]        <<  8);
-            *o++ = (ff_reverse[buf[6] & 0xf0] << 28) |
-                   (ff_reverse[buf[5]]        << 20) |
-                   (ff_reverse[buf[4]]        << 12) |
-                   (ff_reverse[buf[3] & 0x0f] <<  4);
-            buf += 7;
-        }
-    } else if (avctx->bits_per_coded_sample == 20) {
-        uint32_t *o = (uint32_t *)frame->data[0];
-        for (; buf_size > 5; buf_size -= 6) {
-            *o++ = (ff_reverse[buf[2] & 0xf0] << 28) |
-                   (ff_reverse[buf[1]]        << 20) |
-                   (ff_reverse[buf[0]]        << 12);
-            *o++ = (ff_reverse[buf[5] & 0xf0] << 28) |
-                   (ff_reverse[buf[4]]        << 20) |
-                   (ff_reverse[buf[3]]        << 12);
-            buf += 6;
-        }
-    } else {
-        uint16_t *o = (uint16_t *)frame->data[0];
-        for (; buf_size > 4; buf_size -= 5) {
-            *o++ = (ff_reverse[buf[1]]        <<  8) |
-                    ff_reverse[buf[0]];
-            *o++ = (ff_reverse[buf[4] & 0xf0] << 12) |
-                   (ff_reverse[buf[3]]        <<  4) |
-                   (ff_reverse[buf[2]]        >>  4);
-            buf += 5;
-        }
-    }
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_s302m_decoder = {
-    .name           = "s302m",
-    .long_name      = NULL_IF_CONFIG_SMALL("SMPTE 302M"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_S302M,
-    .decode         = s302m_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/s3tc.c b/deps/libav/libavcodec/s3tc.c
deleted file mode 100644
index d35cf2a..0000000
--- a/deps/libav/libavcodec/s3tc.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * S3 Texture Compression (S3TC) decoding functions
- * Copyright (c) 2007 by Ivo van Poorten
- *
- * see also: http://wiki.multimedia.cx/index.php?title=S3TC
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "s3tc.h"
-
-static inline void dxt1_decode_pixels(GetByteContext *gb, uint32_t *d,
-                                      unsigned int qstride, unsigned int flag,
-                                      uint64_t alpha) {
-    unsigned int x, y, c0, c1, a = (!flag * 255u) << 24;
-    unsigned int rb0, rb1, rb2, rb3, g0, g1, g2, g3;
-    uint32_t colors[4], pixels;
-
-    c0 = bytestream2_get_le16(gb);
-    c1 = bytestream2_get_le16(gb);
-
-    rb0  = (c0<<3 | c0<<8) & 0xf800f8;
-    rb1  = (c1<<3 | c1<<8) & 0xf800f8;
-    rb0 +=        (rb0>>5) & 0x070007;
-    rb1 +=        (rb1>>5) & 0x070007;
-    g0   =        (c0 <<5) & 0x00fc00;
-    g1   =        (c1 <<5) & 0x00fc00;
-    g0  +=        (g0 >>6) & 0x000300;
-    g1  +=        (g1 >>6) & 0x000300;
-
-    colors[0] = rb0 + g0 + a;
-    colors[1] = rb1 + g1 + a;
-
-    if (c0 > c1 || flag) {
-        rb2 = (((2*rb0+rb1) * 21) >> 6) & 0xff00ff;
-        rb3 = (((2*rb1+rb0) * 21) >> 6) & 0xff00ff;
-        g2  = (((2*g0 +g1 ) * 21) >> 6) & 0x00ff00;
-        g3  = (((2*g1 +g0 ) * 21) >> 6) & 0x00ff00;
-        colors[3] = rb3 + g3 + a;
-    } else {
-        rb2 = ((rb0+rb1) >> 1) & 0xff00ff;
-        g2  = ((g0 +g1 ) >> 1) & 0x00ff00;
-        colors[3] = 0;
-    }
-
-    colors[2] = rb2 + g2 + a;
-
-    pixels = bytestream2_get_le32(gb);
-    for (y=0; y<4; y++) {
-        for (x=0; x<4; x++) {
-            a        = (alpha & 0x0f) << 28;
-            a       += a >> 4;
-            d[x]     = a + colors[pixels&3];
-            pixels >>= 2;
-            alpha  >>= 4;
-        }
-        d += qstride;
-    }
-}
-
-void ff_decode_dxt1(GetByteContext *gb, uint8_t *dst,
-                    const unsigned int w, const unsigned int h,
-                    const unsigned int stride) {
-    unsigned int bx, by, qstride = stride/4;
-    uint32_t *d = (uint32_t *) dst;
-
-    for (by=0; by < h/4; by++, d += stride-w)
-        for (bx = 0; bx < w / 4; bx++, d += 4)
-            dxt1_decode_pixels(gb, d, qstride, 0, 0LL);
-}
-
-void ff_decode_dxt3(GetByteContext *gb, uint8_t *dst,
-                    const unsigned int w, const unsigned int h,
-                    const unsigned int stride) {
-    unsigned int bx, by, qstride = stride/4;
-    uint32_t *d = (uint32_t *) dst;
-
-    for (by=0; by < h/4; by++, d += stride-w)
-        for (bx = 0; bx < w / 4; bx++, d += 4)
-            dxt1_decode_pixels(gb, d, qstride, 1, bytestream2_get_le64(gb));
-}
diff --git a/deps/libav/libavcodec/s3tc.h b/deps/libav/libavcodec/s3tc.h
deleted file mode 100644
index 25237b9..0000000
--- a/deps/libav/libavcodec/s3tc.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * S3 Texture Compression (S3TC) decoding functions
- * Copyright (c) 2007 by Ivo van Poorten
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_S3TC_H
-#define AVCODEC_S3TC_H
-
-#include <stdint.h>
-
-#include "bytestream.h"
-
-#define FF_S3TC_DXT1    0x31545844
-#define FF_S3TC_DXT3    0x33545844
-
-/**
- * Decode DXT1 encoded data to RGB32
- * @param gb GetByteContext
- * @param dst destination buffer
- * @param w width of output image
- * @param h height of output image
- * @param stride line size of output image
- */
-void ff_decode_dxt1(GetByteContext *gb, uint8_t *dst,
-                    const unsigned int w, const unsigned int h,
-                    const unsigned int stride);
-/**
- * Decode DXT3 encoded data to RGB32
- * @param gb GetByteContext
- * @param dst destination buffer
- * @param w width of output image
- * @param h height of output image
- * @param stride line size of output image
- */
-void ff_decode_dxt3(GetByteContext *gb, uint8_t *dst,
-                    const unsigned int w, const unsigned int h,
-                    const unsigned int stride);
-
-#endif /* AVCODEC_S3TC_H */
diff --git a/deps/libav/libavcodec/sbr.h b/deps/libav/libavcodec/sbr.h
deleted file mode 100644
index a47ad6e..0000000
--- a/deps/libav/libavcodec/sbr.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Spectral Band Replication definitions and structures
- * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
- * Copyright (c) 2010      Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Spectral Band Replication definitions and structures
- * @author Robert Swain ( rob opendot cl )
- */
-
-#ifndef AVCODEC_SBR_H
-#define AVCODEC_SBR_H
-
-#include <stdint.h>
-#include "fft.h"
-#include "aacps.h"
-#include "sbrdsp.h"
-
-/**
- * Spectral Band Replication header - spectrum parameters that invoke a reset if they differ from the previous header.
- */
-typedef struct SpectrumParameters {
-    uint8_t bs_start_freq;
-    uint8_t bs_stop_freq;
-    uint8_t bs_xover_band;
-
-    /**
-     * @name Variables associated with bs_header_extra_1
-     * @{
-     */
-    uint8_t bs_freq_scale;
-    uint8_t bs_alter_scale;
-    uint8_t bs_noise_bands;
-    /** @} */
-} SpectrumParameters;
-
-#define SBR_SYNTHESIS_BUF_SIZE ((1280-128)*2)
-
-/**
- * Spectral Band Replication per channel data
- */
-typedef struct SBRData {
-    /**
-     * @name Main bitstream data variables
-     * @{
-     */
-    unsigned           bs_frame_class;
-    unsigned           bs_add_harmonic_flag;
-    unsigned           bs_num_env;
-    uint8_t            bs_freq_res[7];
-    unsigned           bs_num_noise;
-    uint8_t            bs_df_env[5];
-    uint8_t            bs_df_noise[2];
-    uint8_t            bs_invf_mode[2][5];
-    uint8_t            bs_add_harmonic[48];
-    unsigned           bs_amp_res;
-    /** @} */
-
-    /**
-     * @name State variables
-     * @{
-     */
-    DECLARE_ALIGNED(32, float, synthesis_filterbank_samples)[SBR_SYNTHESIS_BUF_SIZE];
-    DECLARE_ALIGNED(32, float, analysis_filterbank_samples) [1312];
-    int                synthesis_filterbank_samples_offset;
-    ///l_APrev and l_A
-    int                e_a[2];
-    ///Chirp factors
-    float              bw_array[5];
-    ///QMF values of the original signal
-    float              W[2][32][32][2];
-    ///QMF output of the HF adjustor
-    int                Ypos;
-    DECLARE_ALIGNED(16, float, Y)[2][38][64][2];
-    DECLARE_ALIGNED(16, float, g_temp)[42][48];
-    float              q_temp[42][48];
-    uint8_t            s_indexmapped[8][48];
-    ///Envelope scalefactors
-    float              env_facs[6][48];
-    ///Noise scalefactors
-    float              noise_facs[3][5];
-    ///Envelope time borders
-    uint8_t            t_env[8];
-    ///Envelope time border of the last envelope of the previous frame
-    uint8_t            t_env_num_env_old;
-    ///Noise time borders
-    uint8_t            t_q[3];
-    unsigned           f_indexnoise;
-    unsigned           f_indexsine;
-    /** @} */
-} SBRData;
-
-/**
- * Spectral Band Replication
- */
-typedef struct SpectralBandReplication {
-    int                sample_rate;
-    int                start;
-    int                reset;
-    SpectrumParameters spectrum_params;
-    int                bs_amp_res_header;
-    /**
-     * @name Variables associated with bs_header_extra_2
-     * @{
-     */
-    unsigned           bs_limiter_bands;
-    unsigned           bs_limiter_gains;
-    unsigned           bs_interpol_freq;
-    unsigned           bs_smoothing_mode;
-    /** @} */
-    unsigned           bs_coupling;
-    unsigned           k[5]; ///< k0, k1, k2
-    ///kx', and kx respectively, kx is the first QMF subband where SBR is used.
-    ///kx' is its value from the previous frame
-    unsigned           kx[2];
-    ///M' and M respectively, M is the number of QMF subbands that use SBR.
-    unsigned           m[2];
-    unsigned           kx_and_m_pushed;
-    ///The number of frequency bands in f_master
-    unsigned           n_master;
-    SBRData            data[2];
-    PSContext          ps;
-    ///N_Low and N_High respectively, the number of frequency bands for low and high resolution
-    unsigned           n[2];
-    ///Number of noise floor bands
-    unsigned           n_q;
-    ///Number of limiter bands
-    unsigned           n_lim;
-    ///The master QMF frequency grouping
-    uint16_t           f_master[49];
-    ///Frequency borders for low resolution SBR
-    uint16_t           f_tablelow[25];
-    ///Frequency borders for high resolution SBR
-    uint16_t           f_tablehigh[49];
-    ///Frequency borders for noise floors
-    uint16_t           f_tablenoise[6];
-    ///Frequency borders for the limiter
-    uint16_t           f_tablelim[29];
-    unsigned           num_patches;
-    uint8_t            patch_num_subbands[6];
-    uint8_t            patch_start_subband[6];
-    ///QMF low frequency input to the HF generator
-    DECLARE_ALIGNED(16, float, X_low)[32][40][2];
-    ///QMF output of the HF generator
-    DECLARE_ALIGNED(16, float, X_high)[64][40][2];
-    ///QMF values of the reconstructed signal
-    DECLARE_ALIGNED(16, float, X)[2][2][38][64];
-    ///Zeroth coefficient used to filter the subband signals
-    DECLARE_ALIGNED(16, float, alpha0)[64][2];
-    ///First coefficient used to filter the subband signals
-    DECLARE_ALIGNED(16, float, alpha1)[64][2];
-    ///Dequantized envelope scalefactors, remapped
-    float              e_origmapped[7][48];
-    ///Dequantized noise scalefactors, remapped
-    float              q_mapped[7][48];
-    ///Sinusoidal presence, remapped
-    uint8_t            s_mapped[7][48];
-    ///Estimated envelope
-    float              e_curr[7][48];
-    ///Amplitude adjusted noise scalefactors
-    float              q_m[7][48];
-    ///Sinusoidal levels
-    float              s_m[7][48];
-    float              gain[7][48];
-    DECLARE_ALIGNED(32, float, qmf_filter_scratch)[5][64];
-    FFTContext         mdct_ana;
-    FFTContext         mdct;
-    SBRDSPContext      dsp;
-} SpectralBandReplication;
-
-#endif /* AVCODEC_SBR_H */
diff --git a/deps/libav/libavcodec/sbrdsp.c b/deps/libav/libavcodec/sbrdsp.c
deleted file mode 100644
index 4d07af5..0000000
--- a/deps/libav/libavcodec/sbrdsp.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * AAC Spectral Band Replication decoding functions
- * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
- * Copyright (c) 2009-2010 Alex Converse <alex.converse at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/intfloat.h"
-#include "sbrdsp.h"
-
-static void sbr_sum64x5_c(float *z)
-{
-    int k;
-    for (k = 0; k < 64; k++) {
-        float f = z[k] + z[k + 64] + z[k + 128] + z[k + 192] + z[k + 256];
-        z[k] = f;
-    }
-}
-
-static float sbr_sum_square_c(float (*x)[2], int n)
-{
-    float sum0 = 0.0f, sum1 = 0.0f;
-    int i;
-
-    for (i = 0; i < n; i += 2)
-    {
-        sum0 += x[i + 0][0] * x[i + 0][0];
-        sum1 += x[i + 0][1] * x[i + 0][1];
-        sum0 += x[i + 1][0] * x[i + 1][0];
-        sum1 += x[i + 1][1] * x[i + 1][1];
-    }
-
-    return sum0 + sum1;
-}
-
-static void sbr_neg_odd_64_c(float *x)
-{
-    union av_intfloat32 *xi = (union av_intfloat32*) x;
-    int i;
-    for (i = 1; i < 64; i += 4) {
-        xi[i + 0].i ^= 1U << 31;
-        xi[i + 2].i ^= 1U << 31;
-    }
-}
-
-static void sbr_qmf_pre_shuffle_c(float *z)
-{
-    union av_intfloat32 *zi = (union av_intfloat32*) z;
-    int k;
-    zi[64].i = zi[0].i;
-    zi[65].i = zi[1].i;
-    for (k = 1; k < 31; k += 2) {
-        zi[64 + 2 * k + 0].i = zi[64 - k].i ^ (1U << 31);
-        zi[64 + 2 * k + 1].i = zi[ k + 1].i;
-        zi[64 + 2 * k + 2].i = zi[63 - k].i ^ (1U << 31);
-        zi[64 + 2 * k + 3].i = zi[ k + 2].i;
-    }
-    zi[64 + 2 * 31 + 0].i = zi[64 - 31].i ^ (1U << 31);
-    zi[64 + 2 * 31 + 1].i = zi[31 +  1].i;
-}
-
-static void sbr_qmf_post_shuffle_c(float W[32][2], const float *z)
-{
-    const union av_intfloat32 *zi = (const union av_intfloat32*) z;
-    union av_intfloat32 *Wi       = (union av_intfloat32*) W;
-    int k;
-    for (k = 0; k < 32; k += 2) {
-        Wi[2 * k + 0].i = zi[63 - k].i ^ (1U << 31);
-        Wi[2 * k + 1].i = zi[ k + 0].i;
-        Wi[2 * k + 2].i = zi[62 - k].i ^ (1U << 31);
-        Wi[2 * k + 3].i = zi[ k + 1].i;
-    }
-}
-
-static void sbr_qmf_deint_neg_c(float *v, const float *src)
-{
-    const union av_intfloat32 *si = (const union av_intfloat32*)src;
-    union av_intfloat32 *vi = (union av_intfloat32*)v;
-    int i;
-    for (i = 0; i < 32; i++) {
-        vi[     i].i = si[63 - 2 * i    ].i;
-        vi[63 - i].i = si[63 - 2 * i - 1].i ^ (1U << 31);
-    }
-}
-
-static void sbr_qmf_deint_bfly_c(float *v, const float *src0, const float *src1)
-{
-    int i;
-    for (i = 0; i < 64; i++) {
-        v[      i] = src0[i] - src1[63 - i];
-        v[127 - i] = src0[i] + src1[63 - i];
-    }
-}
-
-static av_always_inline void autocorrelate(const float x[40][2],
-                                           float phi[3][2][2], int lag)
-{
-    int i;
-    float real_sum = 0.0f;
-    float imag_sum = 0.0f;
-    if (lag) {
-        for (i = 1; i < 38; i++) {
-            real_sum += x[i][0] * x[i+lag][0] + x[i][1] * x[i+lag][1];
-            imag_sum += x[i][0] * x[i+lag][1] - x[i][1] * x[i+lag][0];
-        }
-        phi[2-lag][1][0] = real_sum + x[ 0][0] * x[lag][0] + x[ 0][1] * x[lag][1];
-        phi[2-lag][1][1] = imag_sum + x[ 0][0] * x[lag][1] - x[ 0][1] * x[lag][0];
-        if (lag == 1) {
-            phi[0][0][0] = real_sum + x[38][0] * x[39][0] + x[38][1] * x[39][1];
-            phi[0][0][1] = imag_sum + x[38][0] * x[39][1] - x[38][1] * x[39][0];
-        }
-    } else {
-        for (i = 1; i < 38; i++) {
-            real_sum += x[i][0] * x[i][0] + x[i][1] * x[i][1];
-        }
-        phi[2][1][0] = real_sum + x[ 0][0] * x[ 0][0] + x[ 0][1] * x[ 0][1];
-        phi[1][0][0] = real_sum + x[38][0] * x[38][0] + x[38][1] * x[38][1];
-    }
-}
-
-static void sbr_autocorrelate_c(const float x[40][2], float phi[3][2][2])
-{
-#if 0
-    /* This code is slower because it multiplies memory accesses.
-     * It is left for educational purposes and because it may offer
-     * a better reference for writing arch-specific DSP functions. */
-    autocorrelate(x, phi, 0);
-    autocorrelate(x, phi, 1);
-    autocorrelate(x, phi, 2);
-#else
-    float real_sum2 = x[0][0] * x[2][0] + x[0][1] * x[2][1];
-    float imag_sum2 = x[0][0] * x[2][1] - x[0][1] * x[2][0];
-    float real_sum1 = 0.0f, imag_sum1 = 0.0f, real_sum0 = 0.0f;
-    int   i;
-    for (i = 1; i < 38; i++) {
-        real_sum0 += x[i][0] * x[i    ][0] + x[i][1] * x[i    ][1];
-        real_sum1 += x[i][0] * x[i + 1][0] + x[i][1] * x[i + 1][1];
-        imag_sum1 += x[i][0] * x[i + 1][1] - x[i][1] * x[i + 1][0];
-        real_sum2 += x[i][0] * x[i + 2][0] + x[i][1] * x[i + 2][1];
-        imag_sum2 += x[i][0] * x[i + 2][1] - x[i][1] * x[i + 2][0];
-    }
-    phi[2 - 2][1][0] = real_sum2;
-    phi[2 - 2][1][1] = imag_sum2;
-    phi[2    ][1][0] = real_sum0 + x[ 0][0] * x[ 0][0] + x[ 0][1] * x[ 0][1];
-    phi[1    ][0][0] = real_sum0 + x[38][0] * x[38][0] + x[38][1] * x[38][1];
-    phi[2 - 1][1][0] = real_sum1 + x[ 0][0] * x[ 1][0] + x[ 0][1] * x[ 1][1];
-    phi[2 - 1][1][1] = imag_sum1 + x[ 0][0] * x[ 1][1] - x[ 0][1] * x[ 1][0];
-    phi[0    ][0][0] = real_sum1 + x[38][0] * x[39][0] + x[38][1] * x[39][1];
-    phi[0    ][0][1] = imag_sum1 + x[38][0] * x[39][1] - x[38][1] * x[39][0];
-#endif
-}
-
-static void sbr_hf_gen_c(float (*X_high)[2], const float (*X_low)[2],
-                         const float alpha0[2], const float alpha1[2],
-                         float bw, int start, int end)
-{
-    float alpha[4];
-    int i;
-
-    alpha[0] = alpha1[0] * bw * bw;
-    alpha[1] = alpha1[1] * bw * bw;
-    alpha[2] = alpha0[0] * bw;
-    alpha[3] = alpha0[1] * bw;
-
-    for (i = start; i < end; i++) {
-        X_high[i][0] =
-            X_low[i - 2][0] * alpha[0] -
-            X_low[i - 2][1] * alpha[1] +
-            X_low[i - 1][0] * alpha[2] -
-            X_low[i - 1][1] * alpha[3] +
-            X_low[i][0];
-        X_high[i][1] =
-            X_low[i - 2][1] * alpha[0] +
-            X_low[i - 2][0] * alpha[1] +
-            X_low[i - 1][1] * alpha[2] +
-            X_low[i - 1][0] * alpha[3] +
-            X_low[i][1];
-    }
-}
-
-static void sbr_hf_g_filt_c(float (*Y)[2], const float (*X_high)[40][2],
-                            const float *g_filt, int m_max, intptr_t ixh)
-{
-    int m;
-
-    for (m = 0; m < m_max; m++) {
-        Y[m][0] = X_high[m][ixh][0] * g_filt[m];
-        Y[m][1] = X_high[m][ixh][1] * g_filt[m];
-    }
-}
-
-static av_always_inline void sbr_hf_apply_noise(float (*Y)[2],
-                                                const float *s_m,
-                                                const float *q_filt,
-                                                int noise,
-                                                float phi_sign0,
-                                                float phi_sign1,
-                                                int m_max)
-{
-    int m;
-
-    for (m = 0; m < m_max; m++) {
-        float y0 = Y[m][0];
-        float y1 = Y[m][1];
-        noise = (noise + 1) & 0x1ff;
-        if (s_m[m]) {
-            y0 += s_m[m] * phi_sign0;
-            y1 += s_m[m] * phi_sign1;
-        } else {
-            y0 += q_filt[m] * ff_sbr_noise_table[noise][0];
-            y1 += q_filt[m] * ff_sbr_noise_table[noise][1];
-        }
-        Y[m][0] = y0;
-        Y[m][1] = y1;
-        phi_sign1 = -phi_sign1;
-    }
-}
-
-static void sbr_hf_apply_noise_0(float (*Y)[2], const float *s_m,
-                                 const float *q_filt, int noise,
-                                 int kx, int m_max)
-{
-    sbr_hf_apply_noise(Y, s_m, q_filt, noise, 1.0, 0.0, m_max);
-}
-
-static void sbr_hf_apply_noise_1(float (*Y)[2], const float *s_m,
-                                 const float *q_filt, int noise,
-                                 int kx, int m_max)
-{
-    float phi_sign = 1 - 2 * (kx & 1);
-    sbr_hf_apply_noise(Y, s_m, q_filt, noise, 0.0, phi_sign, m_max);
-}
-
-static void sbr_hf_apply_noise_2(float (*Y)[2], const float *s_m,
-                                 const float *q_filt, int noise,
-                                 int kx, int m_max)
-{
-    sbr_hf_apply_noise(Y, s_m, q_filt, noise, -1.0, 0.0, m_max);
-}
-
-static void sbr_hf_apply_noise_3(float (*Y)[2], const float *s_m,
-                                 const float *q_filt, int noise,
-                                 int kx, int m_max)
-{
-    float phi_sign = 1 - 2 * (kx & 1);
-    sbr_hf_apply_noise(Y, s_m, q_filt, noise, 0.0, -phi_sign, m_max);
-}
-
-av_cold void ff_sbrdsp_init(SBRDSPContext *s)
-{
-    s->sum64x5 = sbr_sum64x5_c;
-    s->sum_square = sbr_sum_square_c;
-    s->neg_odd_64 = sbr_neg_odd_64_c;
-    s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_c;
-    s->qmf_post_shuffle = sbr_qmf_post_shuffle_c;
-    s->qmf_deint_neg = sbr_qmf_deint_neg_c;
-    s->qmf_deint_bfly = sbr_qmf_deint_bfly_c;
-    s->autocorrelate = sbr_autocorrelate_c;
-    s->hf_gen = sbr_hf_gen_c;
-    s->hf_g_filt = sbr_hf_g_filt_c;
-
-    s->hf_apply_noise[0] = sbr_hf_apply_noise_0;
-    s->hf_apply_noise[1] = sbr_hf_apply_noise_1;
-    s->hf_apply_noise[2] = sbr_hf_apply_noise_2;
-    s->hf_apply_noise[3] = sbr_hf_apply_noise_3;
-
-    if (ARCH_ARM)
-        ff_sbrdsp_init_arm(s);
-    if (ARCH_X86)
-        ff_sbrdsp_init_x86(s);
-}
diff --git a/deps/libav/libavcodec/sbrdsp.h b/deps/libav/libavcodec/sbrdsp.h
deleted file mode 100644
index 07235c6..0000000
--- a/deps/libav/libavcodec/sbrdsp.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2012 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SBRDSP_H
-#define AVCODEC_SBRDSP_H
-
-#include <stdint.h>
-
-typedef struct SBRDSPContext {
-    void (*sum64x5)(float *z);
-    float (*sum_square)(float (*x)[2], int n);
-    void (*neg_odd_64)(float *x);
-    void (*qmf_pre_shuffle)(float *z);
-    void (*qmf_post_shuffle)(float W[32][2], const float *z);
-    void (*qmf_deint_neg)(float *v, const float *src);
-    void (*qmf_deint_bfly)(float *v, const float *src0, const float *src1);
-    void (*autocorrelate)(const float x[40][2], float phi[3][2][2]);
-    void (*hf_gen)(float (*X_high)[2], const float (*X_low)[2],
-                   const float alpha0[2], const float alpha1[2],
-                   float bw, int start, int end);
-    void (*hf_g_filt)(float (*Y)[2], const float (*X_high)[40][2],
-                      const float *g_filt, int m_max, intptr_t ixh);
-    void (*hf_apply_noise[4])(float (*Y)[2], const float *s_m,
-                              const float *q_filt, int noise,
-                              int kx, int m_max);
-} SBRDSPContext;
-
-extern const float ff_sbr_noise_table[][2];
-
-void ff_sbrdsp_init(SBRDSPContext *s);
-void ff_sbrdsp_init_arm(SBRDSPContext *s);
-void ff_sbrdsp_init_x86(SBRDSPContext *s);
-
-#endif /* AVCODEC_SBRDSP_H */
diff --git a/deps/libav/libavcodec/sgi.h b/deps/libav/libavcodec/sgi.h
deleted file mode 100644
index ca531f0..0000000
--- a/deps/libav/libavcodec/sgi.h
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
- * SGI image encoder
- * Xiaohui Sun <tjnksxh at hotmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SGI_H
-#define AVCODEC_SGI_H
-
-/**
- * SGI image file signature
- */
-#define SGI_MAGIC 474
-
-#define SGI_HEADER_SIZE 512
-
-#define SGI_GRAYSCALE 1
-#define SGI_RGB 3
-#define SGI_RGBA 4
-
-#endif /* AVCODEC_SGI_H */
diff --git a/deps/libav/libavcodec/sgidec.c b/deps/libav/libavcodec/sgidec.c
deleted file mode 100644
index b25b41f..0000000
--- a/deps/libav/libavcodec/sgidec.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * SGI image decoder
- * Todd Kirby <doubleshot at pacbell.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "sgi.h"
-
-typedef struct SgiState {
-    AVCodecContext *avctx;
-    unsigned int width;
-    unsigned int height;
-    unsigned int depth;
-    unsigned int bytes_per_channel;
-    int linesize;
-    GetByteContext g;
-} SgiState;
-
-/**
- * Expand an RLE row into a channel.
- * @param s the current image state
- * @param out_buf Points to one line after the output buffer.
- * @param len length of out_buf in bytes
- * @param pixelstride pixel stride of input buffer
- * @return size of output in bytes, -1 if buffer overflows
- */
-static int expand_rle_row(SgiState *s, uint8_t *out_buf,
-                          int len, int pixelstride)
-{
-    unsigned char pixel, count;
-    unsigned char *orig = out_buf;
-
-    while (1) {
-        if (bytestream2_get_bytes_left(&s->g) < 1)
-            return AVERROR_INVALIDDATA;
-        pixel = bytestream2_get_byteu(&s->g);
-        if (!(count = (pixel & 0x7f))) {
-            return (out_buf - orig) / pixelstride;
-        }
-
-        /* Check for buffer overflow. */
-        if (pixelstride * (count - 1) >= len) {
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (pixel & 0x80) {
-            while (count--) {
-                *out_buf = bytestream2_get_byte(&s->g);
-                out_buf += pixelstride;
-            }
-        } else {
-            pixel = bytestream2_get_byte(&s->g);
-
-            while (count--) {
-                *out_buf = pixel;
-                out_buf += pixelstride;
-            }
-        }
-    }
-}
-
-/**
- * Read a run length encoded SGI image.
- * @param out_buf output buffer
- * @param s the current image state
- * @return 0 if no error, else return error number.
- */
-static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
-{
-    uint8_t *dest_row;
-    unsigned int len = s->height * s->depth * 4;
-    GetByteContext g_table = s->g;
-    unsigned int y, z;
-    unsigned int start_offset;
-
-    /* size of  RLE offset and length tables */
-    if (len * 2  > bytestream2_get_bytes_left(&s->g)) {
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (z = 0; z < s->depth; z++) {
-        dest_row = out_buf;
-        for (y = 0; y < s->height; y++) {
-            dest_row -= s->linesize;
-            start_offset = bytestream2_get_be32(&g_table);
-            bytestream2_seek(&s->g, start_offset, SEEK_SET);
-            if (expand_rle_row(s, dest_row + z, FFABS(s->linesize) - z,
-                               s->depth) != s->width) {
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-    return 0;
-}
-
-/**
- * Read an uncompressed SGI image.
- * @param out_buf output buffer
- * @param out_end end ofoutput buffer
- * @param s the current image state
- * @return 0 if read success, otherwise return -1.
- */
-static int read_uncompressed_sgi(unsigned char* out_buf, uint8_t* out_end,
-                                 SgiState *s)
-{
-    int x, y, z;
-    unsigned int offset = s->height * s->width * s->bytes_per_channel;
-    GetByteContext gp[4];
-
-    /* Test buffer size. */
-    if (offset * s->depth > bytestream2_get_bytes_left(&s->g))
-        return AVERROR_INVALIDDATA;
-
-    /* Create a reader for each plane */
-    for (z = 0; z < s->depth; z++) {
-        gp[z] = s->g;
-        bytestream2_skip(&gp[z], z * offset);
-    }
-
-    for (y = s->height - 1; y >= 0; y--) {
-        out_end = out_buf + (y * s->linesize);
-        if (s->bytes_per_channel == 1) {
-            for (x = s->width; x > 0; x--)
-                for (z = 0; z < s->depth; z++)
-                    *out_end++ = bytestream2_get_byteu(&gp[z]);
-        } else {
-            uint16_t *out16 = (uint16_t *)out_end;
-            for (x = s->width; x > 0; x--)
-                for (z = 0; z < s->depth; z++)
-                    *out16++ = bytestream2_get_ne16u(&gp[z]);
-        }
-    }
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    SgiState *s = avctx->priv_data;
-    AVFrame *p = data;
-    unsigned int dimension, rle;
-    int ret = 0;
-    uint8_t *out_buf, *out_end;
-
-    bytestream2_init(&s->g, avpkt->data, avpkt->size);
-    if (bytestream2_get_bytes_left(&s->g) < SGI_HEADER_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "buf_size too small (%d)\n", avpkt->size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Test for SGI magic. */
-    if (bytestream2_get_be16(&s->g) != SGI_MAGIC) {
-        av_log(avctx, AV_LOG_ERROR, "bad magic number\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    rle                  = bytestream2_get_byte(&s->g);
-    s->bytes_per_channel = bytestream2_get_byte(&s->g);
-    dimension            = bytestream2_get_be16(&s->g);
-    s->width             = bytestream2_get_be16(&s->g);
-    s->height            = bytestream2_get_be16(&s->g);
-    s->depth             = bytestream2_get_be16(&s->g);
-
-    if (s->bytes_per_channel != 1 && (s->bytes_per_channel != 2 || rle)) {
-        av_log(avctx, AV_LOG_ERROR, "wrong channel number\n");
-        return -1;
-    }
-
-    /* Check for supported image dimensions. */
-    if (dimension != 2 && dimension != 3) {
-        av_log(avctx, AV_LOG_ERROR, "wrong dimension number\n");
-        return -1;
-    }
-
-    if (s->depth == SGI_GRAYSCALE) {
-        avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY8;
-    } else if (s->depth == SGI_RGB) {
-        avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_RGB48BE : AV_PIX_FMT_RGB24;
-    } else if (s->depth == SGI_RGBA && s->bytes_per_channel == 1) {
-        avctx->pix_fmt = AV_PIX_FMT_RGBA;
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "wrong picture format\n");
-        return -1;
-    }
-
-    ret = ff_set_dimensions(avctx, s->width, s->height);
-    if (ret < 0)
-        return ret;
-
-    if (ff_get_buffer(avctx, p, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n");
-        return -1;
-    }
-
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->key_frame = 1;
-    out_buf = p->data[0];
-
-    out_end = out_buf + p->linesize[0] * s->height;
-
-    s->linesize = p->linesize[0];
-
-    /* Skip header. */
-    bytestream2_seek(&s->g, SGI_HEADER_SIZE, SEEK_SET);
-    if (rle) {
-        ret = read_rle_sgi(out_end, s);
-    } else {
-        ret = read_uncompressed_sgi(out_buf, out_end, s);
-    }
-
-    if (ret == 0) {
-        *got_frame = 1;
-        return avpkt->size;
-    } else {
-        return ret;
-    }
-}
-
-static av_cold int sgi_decode_init(AVCodecContext *avctx)
-{
-    SgiState *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    return 0;
-}
-
-AVCodec ff_sgi_decoder = {
-    .name           = "sgi",
-    .long_name      = NULL_IF_CONFIG_SMALL("SGI image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SGI,
-    .priv_data_size = sizeof(SgiState),
-    .decode         = decode_frame,
-    .init           = sgi_decode_init,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/sgienc.c b/deps/libav/libavcodec/sgienc.c
deleted file mode 100644
index 902437f..0000000
--- a/deps/libav/libavcodec/sgienc.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * SGI image encoder
- * Todd Kirby <doubleshot at pacbell.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "sgi.h"
-#include "rle.h"
-
-#define SGI_SINGLE_CHAN 2
-#define SGI_MULTI_CHAN 3
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *frame, int *got_packet)
-{
-    const AVFrame * const p = frame;
-    uint8_t *offsettab, *lengthtab, *in_buf, *encode_buf, *buf;
-    int x, y, z, length, tablesize, ret;
-    unsigned int width, height, depth, dimension;
-    unsigned char *end_buf;
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    width  = avctx->width;
-    height = avctx->height;
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_GRAY8:
-        dimension = SGI_SINGLE_CHAN;
-        depth     = SGI_GRAYSCALE;
-        break;
-    case AV_PIX_FMT_RGB24:
-        dimension = SGI_MULTI_CHAN;
-        depth     = SGI_RGB;
-        break;
-    case AV_PIX_FMT_RGBA:
-        dimension = SGI_MULTI_CHAN;
-        depth     = SGI_RGBA;
-        break;
-    default:
-        return AVERROR_INVALIDDATA;
-    }
-
-    tablesize = depth * height * 4;
-    length = SGI_HEADER_SIZE;
-    if (avctx->coder_type == FF_CODER_TYPE_RAW)
-        length += depth * height * width;
-    else // assume ff_rl_encode() produces at most 2x size of input
-        length += tablesize * 2 + depth * height * (2 * width + 1);
-
-    if ((ret = ff_alloc_packet(pkt, length)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", length);
-        return ret;
-    }
-    buf     = pkt->data;
-    end_buf = pkt->data + pkt->size;
-
-    /* Encode header. */
-    bytestream_put_be16(&buf, SGI_MAGIC);
-    bytestream_put_byte(&buf, avctx->coder_type != FF_CODER_TYPE_RAW); /* RLE 1 - VERBATIM 0*/
-    bytestream_put_byte(&buf, 1); /* bytes_per_channel */
-    bytestream_put_be16(&buf, dimension);
-    bytestream_put_be16(&buf, width);
-    bytestream_put_be16(&buf, height);
-    bytestream_put_be16(&buf, depth);
-
-    /* The rest are constant in this implementation. */
-    bytestream_put_be32(&buf, 0L); /* pixmin */
-    bytestream_put_be32(&buf, 255L); /* pixmax */
-    bytestream_put_be32(&buf, 0L); /* dummy */
-
-    /* name */
-    memset(buf, 0, SGI_HEADER_SIZE);
-    buf += 80;
-
-     /* colormap */
-    bytestream_put_be32(&buf, 0L);
-
-    /* The rest of the 512 byte header is unused. */
-    buf += 404;
-    offsettab = buf;
-
-    if (avctx->coder_type  != FF_CODER_TYPE_RAW) {
-        /* Skip RLE offset table. */
-        buf += tablesize;
-        lengthtab = buf;
-
-        /* Skip RLE length table. */
-        buf += tablesize;
-
-        /* Make an intermediate consecutive buffer. */
-        if (!(encode_buf = av_malloc(width)))
-            return -1;
-
-        for (z = 0; z < depth; z++) {
-            in_buf = p->data[0] + p->linesize[0] * (height - 1) + z;
-
-            for (y = 0; y < height; y++) {
-                bytestream_put_be32(&offsettab, buf - pkt->data);
-
-                for (x = 0; x < width; x++)
-                    encode_buf[x] = in_buf[depth * x];
-
-                if ((length = ff_rle_encode(buf, end_buf - buf - 1, encode_buf, 1, width, 0, 0, 0x80, 0)) < 1) {
-                    av_free(encode_buf);
-                    return -1;
-                }
-
-                buf += length;
-                bytestream_put_byte(&buf, 0);
-                bytestream_put_be32(&lengthtab, length + 1);
-                in_buf -= p->linesize[0];
-            }
-        }
-
-        av_free(encode_buf);
-    } else {
-        for (z = 0; z < depth; z++) {
-            in_buf = p->data[0] + p->linesize[0] * (height - 1) + z;
-
-            for (y = 0; y < height; y++) {
-                for (x = 0; x < width * depth; x += depth)
-                    bytestream_put_byte(&buf, in_buf[x]);
-
-                in_buf -= p->linesize[0];
-            }
-        }
-    }
-
-    /* total length */
-    pkt->size = buf - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-AVCodec ff_sgi_encoder = {
-    .name           = "sgi",
-    .long_name      = NULL_IF_CONFIG_SMALL("SGI image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SGI,
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/sh4/Makefile b/deps/libav/libavcodec/sh4/Makefile
deleted file mode 100644
index 01a573b..0000000
--- a/deps/libav/libavcodec/sh4/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-OBJS += sh4/dsputil_sh4.o                                               \
-        sh4/idct_sh4.o                                                  \
diff --git a/deps/libav/libavcodec/sh4/dsputil_sh4.c b/deps/libav/libavcodec/sh4/dsputil_sh4.c
deleted file mode 100644
index 6fd287d..0000000
--- a/deps/libav/libavcodec/sh4/dsputil_sh4.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *  sh4 dsputil
- *
- * Copyright (c) 2003 BERO <bero at geocities.co.jp>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_sh4.h"
-#include "sh4.h"
-
-static void memzero_align8(void *dst,size_t size)
-{
-        int fpscr;
-        fp_single_enter(fpscr);
-        dst = (char *)dst + size;
-        size /= 32;
-        __asm__ volatile (
-        " fldi0 fr0\n"
-        " fldi0 fr1\n"
-        " fschg\n"  // double
-        "1: \n" \
-        " dt %1\n"
-        " fmov  dr0, at -%0\n"
-        " fmov  dr0, at -%0\n"
-        " fmov  dr0, at -%0\n"
-        " bf.s 1b\n"
-        " fmov  dr0, at -%0\n"
-        " fschg" //back to single
-        : "+r"(dst),"+r"(size) :: "memory" );
-        fp_single_leave(fpscr);
-}
-
-static void clear_blocks_sh4(int16_t *blocks)
-{
-        memzero_align8(blocks,sizeof(int16_t)*6*64);
-}
-
-static void idct_put(uint8_t *dest, int line_size, int16_t *block)
-{
-        int i;
-        const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-        ff_idct_sh4(block);
-        for(i=0;i<8;i++) {
-                dest[0] = cm[block[0]];
-                dest[1] = cm[block[1]];
-                dest[2] = cm[block[2]];
-                dest[3] = cm[block[3]];
-                dest[4] = cm[block[4]];
-                dest[5] = cm[block[5]];
-                dest[6] = cm[block[6]];
-                dest[7] = cm[block[7]];
-                dest+=line_size;
-                block+=8;
-        }
-}
-static void idct_add(uint8_t *dest, int line_size, int16_t *block)
-{
-        int i;
-        const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-        ff_idct_sh4(block);
-        for(i=0;i<8;i++) {
-                dest[0] = cm[dest[0]+block[0]];
-                dest[1] = cm[dest[1]+block[1]];
-                dest[2] = cm[dest[2]+block[2]];
-                dest[3] = cm[dest[3]+block[3]];
-                dest[4] = cm[dest[4]+block[4]];
-                dest[5] = cm[dest[5]+block[5]];
-                dest[6] = cm[dest[6]+block[6]];
-                dest[7] = cm[dest[7]+block[7]];
-                dest+=line_size;
-                block+=8;
-        }
-}
-
-av_cold void ff_dsputil_init_sh4(DSPContext *c, AVCodecContext *avctx)
-{
-        const int idct_algo= avctx->idct_algo;
-        const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-        if (!high_bit_depth)
-        c->clear_blocks = clear_blocks_sh4;
-        if (avctx->bits_per_raw_sample <= 8 &&
-            (idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SH4)) {
-                c->idct_put = idct_put;
-                c->idct_add = idct_add;
-                c->idct     = ff_idct_sh4;
-                c->idct_permutation_type= FF_NO_IDCT_PERM;
-        }
-}
diff --git a/deps/libav/libavcodec/sh4/dsputil_sh4.h b/deps/libav/libavcodec/sh4/dsputil_sh4.h
deleted file mode 100644
index 9c2b311..0000000
--- a/deps/libav/libavcodec/sh4/dsputil_sh4.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SH4_DSPUTIL_SH4_H
-#define AVCODEC_SH4_DSPUTIL_SH4_H
-
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-
-void ff_idct_sh4(int16_t *block);
-
-#endif /* AVCODEC_SH4_DSPUTIL_SH4_H */
diff --git a/deps/libav/libavcodec/sh4/idct_sh4.c b/deps/libav/libavcodec/sh4/idct_sh4.c
deleted file mode 100644
index 768b334..0000000
--- a/deps/libav/libavcodec/sh4/idct_sh4.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * idct for sh4
- *
- * Copyright (c) 2001-2003 BERO <bero at geocities.co.jp>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "dsputil_sh4.h"
-#include "sh4.h"
-
-#define c1      1.38703984532214752434  /* sqrt(2)*cos(1*pi/16) */
-#define c2      1.30656296487637657577  /* sqrt(2)*cos(2*pi/16) */
-#define c3      1.17587560241935884520  /* sqrt(2)*cos(3*pi/16) */
-#define c4      1.00000000000000000000  /* sqrt(2)*cos(4*pi/16) */
-#define c5      0.78569495838710234903  /* sqrt(2)*cos(5*pi/16) */
-#define c6      0.54119610014619712324  /* sqrt(2)*cos(6*pi/16) */
-#define c7      0.27589937928294311353  /* sqrt(2)*cos(7*pi/16) */
-
-static const float even_table[] __attribute__ ((aligned(8))) = {
-        c4, c4, c4, c4,
-        c2, c6,-c6,-c2,
-        c4,-c4,-c4, c4,
-        c6,-c2, c2,-c6
-};
-
-static const float odd_table[] __attribute__ ((aligned(8))) = {
-        c1, c3, c5, c7,
-        c3,-c7,-c1,-c5,
-        c5,-c1, c7, c3,
-        c7,-c5, c3,-c1
-};
-
-#undef  c1
-#undef  c2
-#undef  c3
-#undef  c4
-#undef  c5
-#undef  c6
-#undef  c7
-
-#define         load_matrix(table) \
-    do { \
-        const float *t = table; \
-        __asm__ volatile( \
-        "       fschg\n" \
-        "       fmov   @%0+,xd0\n" \
-        "       fmov   @%0+,xd2\n" \
-        "       fmov   @%0+,xd4\n" \
-        "       fmov   @%0+,xd6\n" \
-        "       fmov   @%0+,xd8\n" \
-        "       fmov   @%0+,xd10\n" \
-        "       fmov   @%0+,xd12\n" \
-        "       fmov   @%0+,xd14\n" \
-        "       fschg\n" \
-        : "+r"(t) \
-        ); \
-    } while (0)
-
-#define         ftrv() \
-                __asm__ volatile("ftrv xmtrx,fv0" \
-                : "+f"(fr0),"+f"(fr1),"+f"(fr2),"+f"(fr3));
-
-#define         DEFREG        \
-        register float fr0 __asm__("fr0"); \
-        register float fr1 __asm__("fr1"); \
-        register float fr2 __asm__("fr2"); \
-        register float fr3 __asm__("fr3")
-
-#define         DESCALE(x,n)    (x)*(1.0f/(1<<(n)))
-
-/* this code work worse on gcc cvs. 3.2.3 work fine */
-
-
-//optimized
-
-void ff_idct_sh4(int16_t *block)
-{
-        DEFREG;
-
-        int i;
-        float        tblock[8*8],*fblock;
-        int ofs1,ofs2,ofs3;
-        int fpscr;
-
-        fp_single_enter(fpscr);
-
-        /* row */
-
-        /* even part */
-        load_matrix(even_table);
-
-        fblock = tblock+4;
-        i = 8;
-        do {
-                fr0 = block[0];
-                fr1 = block[2];
-                fr2 = block[4];
-                fr3 = block[6];
-                block+=8;
-                ftrv();
-                *--fblock = fr3;
-                *--fblock = fr2;
-                *--fblock = fr1;
-                *--fblock = fr0;
-                fblock+=8+4;
-        } while(--i);
-        block-=8*8;
-        fblock-=8*8+4;
-
-        load_matrix(odd_table);
-
-        i = 8;
-
-        do {
-                float t0,t1,t2,t3;
-                fr0 = block[1];
-                fr1 = block[3];
-                fr2 = block[5];
-                fr3 = block[7];
-                block+=8;
-                ftrv();
-                t0 = *fblock++;
-                t1 = *fblock++;
-                t2 = *fblock++;
-                t3 = *fblock++;
-                fblock+=4;
-                *--fblock = t0 - fr0;
-                *--fblock = t1 - fr1;
-                *--fblock = t2 - fr2;
-                *--fblock = t3 - fr3;
-                *--fblock = t3 + fr3;
-                *--fblock = t2 + fr2;
-                *--fblock = t1 + fr1;
-                *--fblock = t0 + fr0;
-                fblock+=8;
-        } while(--i);
-        block-=8*8;
-        fblock-=8*8;
-
-        /* col */
-
-        /* even part */
-        load_matrix(even_table);
-
-        ofs1 = sizeof(float)*2*8;
-        ofs2 = sizeof(float)*4*8;
-        ofs3 = sizeof(float)*6*8;
-
-        i = 8;
-
-#define        OA(fblock,ofs)   *(float*)((char*)fblock + ofs)
-
-        do {
-                fr0 = OA(fblock,   0);
-                fr1 = OA(fblock,ofs1);
-                fr2 = OA(fblock,ofs2);
-                fr3 = OA(fblock,ofs3);
-                ftrv();
-                OA(fblock,0   ) = fr0;
-                OA(fblock,ofs1) = fr1;
-                OA(fblock,ofs2) = fr2;
-                OA(fblock,ofs3) = fr3;
-                fblock++;
-        } while(--i);
-        fblock-=8;
-
-        load_matrix(odd_table);
-
-        i=8;
-        do {
-                float t0,t1,t2,t3;
-                t0 = OA(fblock,   0); /* [8*0] */
-                t1 = OA(fblock,ofs1); /* [8*2] */
-                t2 = OA(fblock,ofs2); /* [8*4] */
-                t3 = OA(fblock,ofs3); /* [8*6] */
-                fblock+=8;
-                fr0 = OA(fblock,   0); /* [8*1] */
-                fr1 = OA(fblock,ofs1); /* [8*3] */
-                fr2 = OA(fblock,ofs2); /* [8*5] */
-                fr3 = OA(fblock,ofs3); /* [8*7] */
-                fblock+=-8+1;
-                ftrv();
-                block[8*0] = DESCALE(t0 + fr0,3);
-                block[8*7] = DESCALE(t0 - fr0,3);
-                block[8*1] = DESCALE(t1 + fr1,3);
-                block[8*6] = DESCALE(t1 - fr1,3);
-                block[8*2] = DESCALE(t2 + fr2,3);
-                block[8*5] = DESCALE(t2 - fr2,3);
-                block[8*3] = DESCALE(t3 + fr3,3);
-                block[8*4] = DESCALE(t3 - fr3,3);
-                block++;
-        } while(--i);
-
-        fp_single_leave(fpscr);
-}
diff --git a/deps/libav/libavcodec/sh4/sh4.h b/deps/libav/libavcodec/sh4/sh4.h
deleted file mode 100644
index acd12e6..0000000
--- a/deps/libav/libavcodec/sh4/sh4.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SH4_SH4_H
-#define AVCODEC_SH4_SH4_H
-
-#ifdef __SH4__
-#   define fp_single_enter(fpscr)                               \
-    do {                                                        \
-        __asm__ volatile ("sts   fpscr, %0     \n\t"            \
-                          "and   %1,    %0     \n\t"            \
-                          "lds   %0,    fpscr  \n\t"            \
-                          : "=&r"(fpscr) : "r"(~(1<<19)));      \
-    } while (0)
-
-#   define fp_single_leave(fpscr)                       \
-    do {                                                \
-        __asm__ volatile ("or    %1,    %0     \n\t"    \
-                          "lds   %0,    fpscr  \n\t"    \
-                          : "+r"(fpscr) : "r"(1<<19));  \
-    } while (0)
-#else
-#   define fp_single_enter(fpscr) ((void)fpscr)
-#   define fp_single_leave(fpscr)
-#endif
-
-#endif /* AVCODEC_SH4_SH4_H */
diff --git a/deps/libav/libavcodec/shorten.c b/deps/libav/libavcodec/shorten.c
deleted file mode 100644
index c465fff..0000000
--- a/deps/libav/libavcodec/shorten.c
+++ /dev/null
@@ -1,662 +0,0 @@
-/*
- * Shorten decoder
- * Copyright (c) 2005 Jeff Muizelaar
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Shorten decoder
- * @author Jeff Muizelaar
- *
- */
-
-#include <limits.h>
-#include "avcodec.h"
-#include "bytestream.h"
-#include "get_bits.h"
-#include "golomb.h"
-#include "internal.h"
-
-#define MAX_CHANNELS 8
-#define MAX_BLOCKSIZE 65535
-
-#define OUT_BUFFER_SIZE 16384
-
-#define ULONGSIZE 2
-
-#define WAVE_FORMAT_PCM 0x0001
-
-#define DEFAULT_BLOCK_SIZE 256
-
-#define TYPESIZE 4
-#define CHANSIZE 0
-#define LPCQSIZE 2
-#define ENERGYSIZE 3
-#define BITSHIFTSIZE 2
-
-#define TYPE_S16HL 3
-#define TYPE_S16LH 5
-
-#define NWRAP 3
-#define NSKIPSIZE 1
-
-#define LPCQUANT 5
-#define V2LPCQOFFSET (1 << LPCQUANT)
-
-#define FNSIZE 2
-#define FN_DIFF0        0
-#define FN_DIFF1        1
-#define FN_DIFF2        2
-#define FN_DIFF3        3
-#define FN_QUIT         4
-#define FN_BLOCKSIZE    5
-#define FN_BITSHIFT     6
-#define FN_QLPC         7
-#define FN_ZERO         8
-#define FN_VERBATIM     9
-
-/** indicates if the FN_* command is audio or non-audio */
-static const uint8_t is_audio_command[10] = { 1, 1, 1, 1, 0, 0, 0, 1, 1, 0 };
-
-#define VERBATIM_CKSIZE_SIZE 5
-#define VERBATIM_BYTE_SIZE 8
-#define CANONICAL_HEADER_SIZE 44
-
-typedef struct ShortenContext {
-    AVCodecContext *avctx;
-    GetBitContext gb;
-
-    int min_framesize, max_framesize;
-    unsigned channels;
-
-    int32_t *decoded[MAX_CHANNELS];
-    int32_t *decoded_base[MAX_CHANNELS];
-    int32_t *offset[MAX_CHANNELS];
-    int *coeffs;
-    uint8_t *bitstream;
-    int bitstream_size;
-    int bitstream_index;
-    unsigned int allocated_bitstream_size;
-    int header_size;
-    uint8_t header[OUT_BUFFER_SIZE];
-    int version;
-    int cur_chan;
-    int bitshift;
-    int nmean;
-    int internal_ftype;
-    int nwrap;
-    int blocksize;
-    int bitindex;
-    int32_t lpcqoffset;
-    int got_header;
-    int got_quit_command;
-} ShortenContext;
-
-static av_cold int shorten_decode_init(AVCodecContext *avctx)
-{
-    ShortenContext *s = avctx->priv_data;
-    s->avctx          = avctx;
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-
-    return 0;
-}
-
-static int allocate_buffers(ShortenContext *s)
-{
-    int i, chan, err;
-
-    for (chan = 0; chan < s->channels; chan++) {
-        if (FFMAX(1, s->nmean) >= UINT_MAX / sizeof(int32_t)) {
-            av_log(s->avctx, AV_LOG_ERROR, "nmean too large\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (s->blocksize + s->nwrap >= UINT_MAX / sizeof(int32_t) ||
-            s->blocksize + s->nwrap <= (unsigned)s->nwrap) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "s->blocksize + s->nwrap too large\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        if ((err = av_reallocp(&s->offset[chan],
-                               sizeof(int32_t) *
-                               FFMAX(1, s->nmean))) < 0)
-            return err;
-
-        if ((err = av_reallocp(&s->decoded_base[chan], (s->blocksize + s->nwrap) *
-                               sizeof(s->decoded_base[0][0]))) < 0)
-            return err;
-        for (i = 0; i < s->nwrap; i++)
-            s->decoded_base[chan][i] = 0;
-        s->decoded[chan] = s->decoded_base[chan] + s->nwrap;
-    }
-
-    if ((err = av_reallocp(&s->coeffs, s->nwrap * sizeof(*s->coeffs))) < 0)
-        return err;
-
-    return 0;
-}
-
-static inline unsigned int get_uint(ShortenContext *s, int k)
-{
-    if (s->version != 0)
-        k = get_ur_golomb_shorten(&s->gb, ULONGSIZE);
-    return get_ur_golomb_shorten(&s->gb, k);
-}
-
-static void fix_bitshift(ShortenContext *s, int32_t *buffer)
-{
-    int i;
-
-    if (s->bitshift != 0)
-        for (i = 0; i < s->blocksize; i++)
-            buffer[i] <<= s->bitshift;
-}
-
-static int init_offset(ShortenContext *s)
-{
-    int32_t mean = 0;
-    int chan, i;
-    int nblock = FFMAX(1, s->nmean);
-    /* initialise offset */
-    switch (s->internal_ftype) {
-    case TYPE_S16HL:
-    case TYPE_S16LH:
-        mean = 0;
-        break;
-    default:
-        av_log(s->avctx, AV_LOG_ERROR, "unknown audio type");
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (chan = 0; chan < s->channels; chan++)
-        for (i = 0; i < nblock; i++)
-            s->offset[chan][i] = mean;
-    return 0;
-}
-
-static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,
-                              int header_size)
-{
-    int len;
-    short wave_format;
-    GetByteContext gb;
-
-    bytestream2_init(&gb, header, header_size);
-
-    if (bytestream2_get_le32(&gb) != MKTAG('R', 'I', 'F', 'F')) {
-        av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    bytestream2_skip(&gb, 4); /* chunk size */
-
-    if (bytestream2_get_le32(&gb) != MKTAG('W', 'A', 'V', 'E')) {
-        av_log(avctx, AV_LOG_ERROR, "missing WAVE tag\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    while (bytestream2_get_le32(&gb) != MKTAG('f', 'm', 't', ' ')) {
-        len = bytestream2_get_le32(&gb);
-        bytestream2_skip(&gb, len);
-        if (bytestream2_get_bytes_left(&gb) < 16) {
-            av_log(avctx, AV_LOG_ERROR, "no fmt chunk found\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    len = bytestream2_get_le32(&gb);
-
-    if (len < 16) {
-        av_log(avctx, AV_LOG_ERROR, "fmt chunk was too short\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    wave_format = bytestream2_get_le16(&gb);
-
-    switch (wave_format) {
-    case WAVE_FORMAT_PCM:
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "unsupported wave format\n");
-        return AVERROR(ENOSYS);
-    }
-
-    bytestream2_skip(&gb, 2); // skip channels    (already got from shorten header)
-    avctx->sample_rate = bytestream2_get_le32(&gb);
-    bytestream2_skip(&gb, 4); // skip bit rate    (represents original uncompressed bit rate)
-    bytestream2_skip(&gb, 2); // skip block align (not needed)
-    avctx->bits_per_coded_sample = bytestream2_get_le16(&gb);
-
-    if (avctx->bits_per_coded_sample != 16) {
-        av_log(avctx, AV_LOG_ERROR, "unsupported number of bits per sample\n");
-        return AVERROR(ENOSYS);
-    }
-
-    len -= 16;
-    if (len > 0)
-        av_log(avctx, AV_LOG_INFO, "%d header bytes unparsed\n", len);
-
-    return 0;
-}
-
-static void output_buffer(int16_t **samples, int nchan, int blocksize,
-                          int32_t **buffer)
-{
-    int i, ch;
-    for (ch = 0; ch < nchan; ch++) {
-        int32_t *in  = buffer[ch];
-        int16_t *out = samples[ch];
-        for (i = 0; i < blocksize; i++)
-            out[i] = av_clip_int16(in[i]);
-    }
-}
-
-static const int fixed_coeffs[][3] = {
-    { 0,  0,  0 },
-    { 1,  0,  0 },
-    { 2, -1,  0 },
-    { 3, -3,  1 }
-};
-
-static int decode_subframe_lpc(ShortenContext *s, int command, int channel,
-                               int residual_size, int32_t coffset)
-{
-    int pred_order, sum, qshift, init_sum, i, j;
-    const int *coeffs;
-
-    if (command == FN_QLPC) {
-        /* read/validate prediction order */
-        pred_order = get_ur_golomb_shorten(&s->gb, LPCQSIZE);
-        if (pred_order > s->nwrap) {
-            av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n",
-                   pred_order);
-            return AVERROR(EINVAL);
-        }
-        /* read LPC coefficients */
-        for (i = 0; i < pred_order; i++)
-            s->coeffs[i] = get_sr_golomb_shorten(&s->gb, LPCQUANT);
-        coeffs = s->coeffs;
-
-        qshift = LPCQUANT;
-    } else {
-        /* fixed LPC coeffs */
-        pred_order = command;
-        if (pred_order >= FF_ARRAY_ELEMS(fixed_coeffs)) {
-            av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n",
-                   pred_order);
-            return AVERROR_INVALIDDATA;
-        }
-        coeffs     = fixed_coeffs[pred_order];
-        qshift     = 0;
-    }
-
-    /* subtract offset from previous samples to use in prediction */
-    if (command == FN_QLPC && coffset)
-        for (i = -pred_order; i < 0; i++)
-            s->decoded[channel][i] -= coffset;
-
-    /* decode residual and do LPC prediction */
-    init_sum = pred_order ? (command == FN_QLPC ? s->lpcqoffset : 0) : coffset;
-    for (i = 0; i < s->blocksize; i++) {
-        sum = init_sum;
-        for (j = 0; j < pred_order; j++)
-            sum += coeffs[j] * s->decoded[channel][i - j - 1];
-        s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) +
-                                 (sum >> qshift);
-    }
-
-    /* add offset to current samples */
-    if (command == FN_QLPC && coffset)
-        for (i = 0; i < s->blocksize; i++)
-            s->decoded[channel][i] += coffset;
-
-    return 0;
-}
-
-static int read_header(ShortenContext *s)
-{
-    int i, ret;
-    int maxnlpc = 0;
-    /* shorten signature */
-    if (get_bits_long(&s->gb, 32) != AV_RB32("ajkg")) {
-        av_log(s->avctx, AV_LOG_ERROR, "missing shorten magic 'ajkg'\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->lpcqoffset     = 0;
-    s->blocksize      = DEFAULT_BLOCK_SIZE;
-    s->nmean          = -1;
-    s->version        = get_bits(&s->gb, 8);
-    s->internal_ftype = get_uint(s, TYPESIZE);
-
-    s->channels = get_uint(s, CHANSIZE);
-    if (!s->channels) {
-        av_log(s->avctx, AV_LOG_ERROR, "No channels reported\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (s->channels > MAX_CHANNELS) {
-        av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
-        s->channels = 0;
-        return AVERROR_INVALIDDATA;
-    }
-    s->avctx->channels = s->channels;
-
-    /* get blocksize if version > 0 */
-    if (s->version > 0) {
-        int skip_bytes;
-        unsigned blocksize;
-
-        blocksize = get_uint(s, av_log2(DEFAULT_BLOCK_SIZE));
-        if (!blocksize || blocksize > MAX_BLOCKSIZE) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "invalid or unsupported block size: %d\n",
-                   blocksize);
-            return AVERROR(EINVAL);
-        }
-        s->blocksize = blocksize;
-
-        maxnlpc  = get_uint(s, LPCQSIZE);
-        s->nmean = get_uint(s, 0);
-
-        skip_bytes = get_uint(s, NSKIPSIZE);
-        for (i = 0; i < skip_bytes; i++)
-            skip_bits(&s->gb, 8);
-    }
-    s->nwrap = FFMAX(NWRAP, maxnlpc);
-
-    if ((ret = allocate_buffers(s)) < 0)
-        return ret;
-
-    if ((ret = init_offset(s)) < 0)
-        return ret;
-
-    if (s->version > 1)
-        s->lpcqoffset = V2LPCQOFFSET;
-
-    if (get_ur_golomb_shorten(&s->gb, FNSIZE) != FN_VERBATIM) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "missing verbatim section at beginning of stream\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->header_size = get_ur_golomb_shorten(&s->gb, VERBATIM_CKSIZE_SIZE);
-    if (s->header_size >= OUT_BUFFER_SIZE ||
-        s->header_size < CANONICAL_HEADER_SIZE) {
-        av_log(s->avctx, AV_LOG_ERROR, "header is wrong size: %d\n",
-               s->header_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (i = 0; i < s->header_size; i++)
-        s->header[i] = (char)get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
-
-    if ((ret = decode_wave_header(s->avctx, s->header, s->header_size)) < 0)
-        return ret;
-
-    s->cur_chan = 0;
-    s->bitshift = 0;
-
-    s->got_header = 1;
-
-    return 0;
-}
-
-static int shorten_decode_frame(AVCodecContext *avctx, void *data,
-                                int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    ShortenContext *s  = avctx->priv_data;
-    int i, input_buf_size = 0;
-    int ret;
-
-    /* allocate internal bitstream buffer */
-    if (s->max_framesize == 0) {
-        void *tmp_ptr;
-        s->max_framesize = 1024; // should hopefully be enough for the first header
-        tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
-                                  s->max_framesize + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!tmp_ptr) {
-            av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
-            return AVERROR(ENOMEM);
-        }
-        s->bitstream = tmp_ptr;
-    }
-
-    /* append current packet data to bitstream buffer */
-    if (1 && s->max_framesize) { //FIXME truncated
-        buf_size       = FFMIN(buf_size, s->max_framesize - s->bitstream_size);
-        input_buf_size = buf_size;
-
-        if (s->bitstream_index + s->bitstream_size + buf_size >
-            s->allocated_bitstream_size) {
-            memmove(s->bitstream, &s->bitstream[s->bitstream_index],
-                    s->bitstream_size);
-            s->bitstream_index = 0;
-        }
-        if (buf)
-            memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], buf,
-                   buf_size);
-        buf               = &s->bitstream[s->bitstream_index];
-        buf_size         += s->bitstream_size;
-        s->bitstream_size = buf_size;
-
-        /* do not decode until buffer has at least max_framesize bytes or
-         * the end of the file has been reached */
-        if (buf_size < s->max_framesize && avpkt->data) {
-            *got_frame_ptr = 0;
-            return input_buf_size;
-        }
-    }
-    /* init and position bitstream reader */
-    init_get_bits(&s->gb, buf, buf_size * 8);
-    skip_bits(&s->gb, s->bitindex);
-
-    /* process header or next subblock */
-    if (!s->got_header) {
-        if ((ret = read_header(s)) < 0)
-            return ret;
-        *got_frame_ptr = 0;
-        goto finish_frame;
-    }
-
-    /* if quit command was read previously, don't decode anything */
-    if (s->got_quit_command) {
-        *got_frame_ptr = 0;
-        return avpkt->size;
-    }
-
-    s->cur_chan = 0;
-    while (s->cur_chan < s->channels) {
-        unsigned cmd;
-        int len;
-
-        if (get_bits_left(&s->gb) < 3 + FNSIZE) {
-            *got_frame_ptr = 0;
-            break;
-        }
-
-        cmd = get_ur_golomb_shorten(&s->gb, FNSIZE);
-
-        if (cmd > FN_VERBATIM) {
-            av_log(avctx, AV_LOG_ERROR, "unknown shorten function %d\n", cmd);
-            *got_frame_ptr = 0;
-            break;
-        }
-
-        if (!is_audio_command[cmd]) {
-            /* process non-audio command */
-            switch (cmd) {
-            case FN_VERBATIM:
-                len = get_ur_golomb_shorten(&s->gb, VERBATIM_CKSIZE_SIZE);
-                while (len--)
-                    get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
-                break;
-            case FN_BITSHIFT:
-                s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
-                break;
-            case FN_BLOCKSIZE: {
-                unsigned blocksize = get_uint(s, av_log2(s->blocksize));
-                if (blocksize > s->blocksize) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Increasing block size is not supported\n");
-                    return AVERROR_PATCHWELCOME;
-                }
-                if (!blocksize || blocksize > MAX_BLOCKSIZE) {
-                    av_log(avctx, AV_LOG_ERROR, "invalid or unsupported "
-                                                "block size: %d\n", blocksize);
-                    return AVERROR(EINVAL);
-                }
-                s->blocksize = blocksize;
-                break;
-            }
-            case FN_QUIT:
-                s->got_quit_command = 1;
-                break;
-            }
-            if (cmd == FN_BLOCKSIZE || cmd == FN_QUIT) {
-                *got_frame_ptr = 0;
-                break;
-            }
-        } else {
-            /* process audio command */
-            int residual_size = 0;
-            int channel = s->cur_chan;
-            int32_t coffset;
-
-            /* get Rice code for residual decoding */
-            if (cmd != FN_ZERO) {
-                residual_size = get_ur_golomb_shorten(&s->gb, ENERGYSIZE);
-                /* This is a hack as version 0 differed in the definition
-                 * of get_sr_golomb_shorten(). */
-                if (s->version == 0)
-                    residual_size--;
-            }
-
-            /* calculate sample offset using means from previous blocks */
-            if (s->nmean == 0)
-                coffset = s->offset[channel][0];
-            else {
-                int32_t sum = (s->version < 2) ? 0 : s->nmean / 2;
-                for (i = 0; i < s->nmean; i++)
-                    sum += s->offset[channel][i];
-                coffset = sum / s->nmean;
-                if (s->version >= 2)
-                    coffset >>= FFMIN(1, s->bitshift);
-            }
-
-            /* decode samples for this channel */
-            if (cmd == FN_ZERO) {
-                for (i = 0; i < s->blocksize; i++)
-                    s->decoded[channel][i] = 0;
-            } else {
-                if ((ret = decode_subframe_lpc(s, cmd, channel,
-                                               residual_size, coffset)) < 0)
-                    return ret;
-            }
-
-            /* update means with info from the current block */
-            if (s->nmean > 0) {
-                int32_t sum = (s->version < 2) ? 0 : s->blocksize / 2;
-                for (i = 0; i < s->blocksize; i++)
-                    sum += s->decoded[channel][i];
-
-                for (i = 1; i < s->nmean; i++)
-                    s->offset[channel][i - 1] = s->offset[channel][i];
-
-                if (s->version < 2)
-                    s->offset[channel][s->nmean - 1] = sum / s->blocksize;
-                else
-                    s->offset[channel][s->nmean - 1] = (sum / s->blocksize) << s->bitshift;
-            }
-
-            /* copy wrap samples for use with next block */
-            for (i = -s->nwrap; i < 0; i++)
-                s->decoded[channel][i] = s->decoded[channel][i + s->blocksize];
-
-            /* shift samples to add in unused zero bits which were removed
-             * during encoding */
-            fix_bitshift(s, s->decoded[channel]);
-
-            /* if this is the last channel in the block, output the samples */
-            s->cur_chan++;
-            if (s->cur_chan == s->channels) {
-                /* get output buffer */
-                frame->nb_samples = s->blocksize;
-                if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-                    av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                    return ret;
-                }
-                /* interleave output */
-                output_buffer((int16_t **)frame->extended_data, s->channels,
-                              s->blocksize, s->decoded);
-
-                *got_frame_ptr = 1;
-            }
-        }
-    }
-    if (s->cur_chan < s->channels)
-        *got_frame_ptr = 0;
-
-finish_frame:
-    s->bitindex = get_bits_count(&s->gb) - 8 * (get_bits_count(&s->gb) / 8);
-    i           = get_bits_count(&s->gb) / 8;
-    if (i > buf_size) {
-        av_log(s->avctx, AV_LOG_ERROR, "overread: %d\n", i - buf_size);
-        s->bitstream_size  = 0;
-        s->bitstream_index = 0;
-        return AVERROR_INVALIDDATA;
-    }
-    if (s->bitstream_size) {
-        s->bitstream_index += i;
-        s->bitstream_size  -= i;
-        return input_buf_size;
-    } else
-        return i;
-}
-
-static av_cold int shorten_decode_close(AVCodecContext *avctx)
-{
-    ShortenContext *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < s->channels; i++) {
-        s->decoded[i] = NULL;
-        av_freep(&s->decoded_base[i]);
-        av_freep(&s->offset[i]);
-    }
-    av_freep(&s->bitstream);
-    av_freep(&s->coeffs);
-
-    return 0;
-}
-
-AVCodec ff_shorten_decoder = {
-    .name           = "shorten",
-    .long_name      = NULL_IF_CONFIG_SMALL("Shorten"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_SHORTEN,
-    .priv_data_size = sizeof(ShortenContext),
-    .init           = shorten_decode_init,
-    .close          = shorten_decode_close,
-    .decode         = shorten_decode_frame,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/simple_idct.c b/deps/libav/libavcodec/simple_idct.c
deleted file mode 100644
index f61e9e6..0000000
--- a/deps/libav/libavcodec/simple_idct.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Simple IDCT
- *
- * Copyright (c) 2001 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * simpleidct in C.
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "mathops.h"
-#include "simple_idct.h"
-
-#define BIT_DEPTH 8
-#include "simple_idct_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "simple_idct_template.c"
-#undef BIT_DEPTH
-
-/* 2x4x8 idct */
-
-#define CN_SHIFT 12
-#define C_FIX(x) ((int)((x) * (1 << CN_SHIFT) + 0.5))
-#define C1 C_FIX(0.6532814824)
-#define C2 C_FIX(0.2705980501)
-
-/* row idct is multiple by 16 * sqrt(2.0), col idct4 is normalized,
-   and the butterfly must be multiplied by 0.5 * sqrt(2.0) */
-#define C_SHIFT (4+1+12)
-
-static inline void idct4col_put(uint8_t *dest, int line_size, const int16_t *col)
-{
-    int c0, c1, c2, c3, a0, a1, a2, a3;
-
-    a0 = col[8*0];
-    a1 = col[8*2];
-    a2 = col[8*4];
-    a3 = col[8*6];
-    c0 = ((a0 + a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1));
-    c2 = ((a0 - a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1));
-    c1 = a1 * C1 + a3 * C2;
-    c3 = a1 * C2 - a3 * C1;
-    dest[0] = av_clip_uint8((c0 + c1) >> C_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_uint8((c2 + c3) >> C_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_uint8((c2 - c3) >> C_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_uint8((c0 - c1) >> C_SHIFT);
-}
-
-#define BF(k) \
-{\
-    int a0, a1;\
-    a0 = ptr[k];\
-    a1 = ptr[8 + k];\
-    ptr[k] = a0 + a1;\
-    ptr[8 + k] = a0 - a1;\
-}
-
-/* only used by DV codec. The input must be interlaced. 128 is added
-   to the pixels before clamping to avoid systematic error
-   (1024*sqrt(2)) offset would be needed otherwise. */
-/* XXX: I think a 1.0/sqrt(2) normalization should be needed to
-   compensate the extra butterfly stage - I don't have the full DV
-   specification */
-void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block)
-{
-    int i;
-    int16_t *ptr;
-
-    /* butterfly */
-    ptr = block;
-    for(i=0;i<4;i++) {
-        BF(0);
-        BF(1);
-        BF(2);
-        BF(3);
-        BF(4);
-        BF(5);
-        BF(6);
-        BF(7);
-        ptr += 2 * 8;
-    }
-
-    /* IDCT8 on each line */
-    for(i=0; i<8; i++) {
-        idctRowCondDC_8(block + i*8, 0);
-    }
-
-    /* IDCT4 and store */
-    for(i=0;i<8;i++) {
-        idct4col_put(dest + i, 2 * line_size, block + i);
-        idct4col_put(dest + line_size + i, 2 * line_size, block + 8 + i);
-    }
-}
-
-/* 8x4 & 4x8 WMV2 IDCT */
-#undef CN_SHIFT
-#undef C_SHIFT
-#undef C_FIX
-#undef C1
-#undef C2
-#define CN_SHIFT 12
-#define C_FIX(x) ((int)((x) * 1.414213562 * (1 << CN_SHIFT) + 0.5))
-#define C1 C_FIX(0.6532814824)
-#define C2 C_FIX(0.2705980501)
-#define C3 C_FIX(0.5)
-#define C_SHIFT (4+1+12)
-static inline void idct4col_add(uint8_t *dest, int line_size, const int16_t *col)
-{
-    int c0, c1, c2, c3, a0, a1, a2, a3;
-
-    a0 = col[8*0];
-    a1 = col[8*1];
-    a2 = col[8*2];
-    a3 = col[8*3];
-    c0 = (a0 + a2)*C3 + (1 << (C_SHIFT - 1));
-    c2 = (a0 - a2)*C3 + (1 << (C_SHIFT - 1));
-    c1 = a1 * C1 + a3 * C2;
-    c3 = a1 * C2 - a3 * C1;
-    dest[0] = av_clip_uint8(dest[0] + ((c0 + c1) >> C_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_uint8(dest[0] + ((c2 + c3) >> C_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_uint8(dest[0] + ((c2 - c3) >> C_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_uint8(dest[0] + ((c0 - c1) >> C_SHIFT));
-}
-
-#define RN_SHIFT 15
-#define R_FIX(x) ((int)((x) * 1.414213562 * (1 << RN_SHIFT) + 0.5))
-#define R1 R_FIX(0.6532814824)
-#define R2 R_FIX(0.2705980501)
-#define R3 R_FIX(0.5)
-#define R_SHIFT 11
-static inline void idct4row(int16_t *row)
-{
-    int c0, c1, c2, c3, a0, a1, a2, a3;
-
-    a0 = row[0];
-    a1 = row[1];
-    a2 = row[2];
-    a3 = row[3];
-    c0 = (a0 + a2)*R3 + (1 << (R_SHIFT - 1));
-    c2 = (a0 - a2)*R3 + (1 << (R_SHIFT - 1));
-    c1 = a1 * R1 + a3 * R2;
-    c3 = a1 * R2 - a3 * R1;
-    row[0]= (c0 + c1) >> R_SHIFT;
-    row[1]= (c2 + c3) >> R_SHIFT;
-    row[2]= (c2 - c3) >> R_SHIFT;
-    row[3]= (c0 - c1) >> R_SHIFT;
-}
-
-void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    int i;
-
-    /* IDCT8 on each line */
-    for(i=0; i<4; i++) {
-        idctRowCondDC_8(block + i*8, 0);
-    }
-
-    /* IDCT4 and store */
-    for(i=0;i<8;i++) {
-        idct4col_add(dest + i, line_size, block + i);
-    }
-}
-
-void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    int i;
-
-    /* IDCT4 on each line */
-    for(i=0; i<8; i++) {
-        idct4row(block + i*8);
-    }
-
-    /* IDCT8 and store */
-    for(i=0; i<4; i++){
-        idctSparseColAdd_8(dest + i, line_size, block + i);
-    }
-}
-
-void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    int i;
-
-    /* IDCT4 on each line */
-    for(i=0; i<4; i++) {
-        idct4row(block + i*8);
-    }
-
-    /* IDCT4 and store */
-    for(i=0; i<4; i++){
-        idct4col_add(dest + i, line_size, block + i);
-    }
-}
-
-void ff_prores_idct(int16_t *block, const int16_t *qmat)
-{
-    int i;
-
-    for (i = 0; i < 64; i++)
-        block[i] *= qmat[i];
-
-    for (i = 0; i < 8; i++)
-        idctRowCondDC_10(block + i*8, 2);
-
-    for (i = 0; i < 8; i++)
-        idctSparseCol_10(block + i);
-}
diff --git a/deps/libav/libavcodec/simple_idct.h b/deps/libav/libavcodec/simple_idct.h
deleted file mode 100644
index e257290..0000000
--- a/deps/libav/libavcodec/simple_idct.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Simple IDCT
- *
- * Copyright (c) 2001 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * simple idct header.
- */
-
-#ifndef AVCODEC_SIMPLE_IDCT_H
-#define AVCODEC_SIMPLE_IDCT_H
-
-#include <stdint.h>
-
-void ff_simple_idct_put_8(uint8_t *dest, int line_size, int16_t *block);
-void ff_simple_idct_add_8(uint8_t *dest, int line_size, int16_t *block);
-void ff_simple_idct_8(int16_t *block);
-
-void ff_simple_idct_put_10(uint8_t *dest, int line_size, int16_t *block);
-void ff_simple_idct_add_10(uint8_t *dest, int line_size, int16_t *block);
-void ff_simple_idct_10(int16_t *block);
-/**
- * Special version of ff_simple_idct_10() which does dequantization
- * and scales by a factor of 2 more between the two IDCTs to account
- * for larger scale of input coefficients.
- */
-void ff_prores_idct(int16_t *block, const int16_t *qmat);
-
-void ff_simple_idct_mmx(int16_t *block);
-void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);
-void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);
-
-void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block);
-
-void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block);
-void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block);
-void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block);
-
-#endif /* AVCODEC_SIMPLE_IDCT_H */
diff --git a/deps/libav/libavcodec/simple_idct_template.c b/deps/libav/libavcodec/simple_idct_template.c
deleted file mode 100644
index 367bc34..0000000
--- a/deps/libav/libavcodec/simple_idct_template.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Simple IDCT
- *
- * Copyright (c) 2001 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * simpleidct in C.
- */
-
-/*
-  based upon some outcommented c code from mpeg2dec (idct_mmx.c
-  written by Aaron Holtzman <aholtzma at ess.engr.uvic.ca>)
- */
-
-#include "bit_depth_template.c"
-
-#undef W1
-#undef W2
-#undef W3
-#undef W4
-#undef W5
-#undef W6
-#undef W7
-#undef ROW_SHIFT
-#undef COL_SHIFT
-#undef DC_SHIFT
-#undef MUL
-#undef MAC
-
-#if BIT_DEPTH == 8
-
-#define W1  22725  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W2  21407  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W3  19266  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W4  16383  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W5  12873  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W6  8867   //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W7  4520   //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-
-#define ROW_SHIFT 11
-#define COL_SHIFT 20
-#define DC_SHIFT 3
-
-#define MUL(a, b)    MUL16(a, b)
-#define MAC(a, b, c) MAC16(a, b, c)
-
-#elif BIT_DEPTH == 10
-
-#define W1 90901
-#define W2 85627
-#define W3 77062
-#define W4 65535
-#define W5 51491
-#define W6 35468
-#define W7 18081
-
-#define ROW_SHIFT 15
-#define COL_SHIFT 20
-#define DC_SHIFT 1
-
-#define MUL(a, b)    ((a) * (b))
-#define MAC(a, b, c) ((a) += (b) * (c))
-
-#else
-
-#error "Unsupported bitdepth"
-
-#endif
-
-static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift)
-{
-    int a0, a1, a2, a3, b0, b1, b2, b3;
-
-#if HAVE_FAST_64BIT
-#define ROW0_MASK (0xffffLL << 48 * HAVE_BIGENDIAN)
-    if (((((uint64_t *)row)[0] & ~ROW0_MASK) | ((uint64_t *)row)[1]) == 0) {
-        uint64_t temp;
-        if (DC_SHIFT - extra_shift > 0) {
-            temp = (row[0] << (DC_SHIFT - extra_shift)) & 0xffff;
-        } else {
-            temp = (row[0] >> (extra_shift - DC_SHIFT)) & 0xffff;
-        }
-        temp += temp << 16;
-        temp += temp << 32;
-        ((uint64_t *)row)[0] = temp;
-        ((uint64_t *)row)[1] = temp;
-        return;
-    }
-#else
-    if (!(((uint32_t*)row)[1] |
-          ((uint32_t*)row)[2] |
-          ((uint32_t*)row)[3] |
-          row[1])) {
-        uint32_t temp;
-        if (DC_SHIFT - extra_shift > 0) {
-            temp = (row[0] << (DC_SHIFT - extra_shift)) & 0xffff;
-        } else {
-            temp = (row[0] >> (extra_shift - DC_SHIFT)) & 0xffff;
-        }
-        temp += temp << 16;
-        ((uint32_t*)row)[0]=((uint32_t*)row)[1] =
-            ((uint32_t*)row)[2]=((uint32_t*)row)[3] = temp;
-        return;
-    }
-#endif
-
-    a0 = (W4 * row[0]) + (1 << (ROW_SHIFT - 1));
-    a1 = a0;
-    a2 = a0;
-    a3 = a0;
-
-    a0 += W2 * row[2];
-    a1 += W6 * row[2];
-    a2 -= W6 * row[2];
-    a3 -= W2 * row[2];
-
-    b0 = MUL(W1, row[1]);
-    MAC(b0, W3, row[3]);
-    b1 = MUL(W3, row[1]);
-    MAC(b1, -W7, row[3]);
-    b2 = MUL(W5, row[1]);
-    MAC(b2, -W1, row[3]);
-    b3 = MUL(W7, row[1]);
-    MAC(b3, -W5, row[3]);
-
-    if (AV_RN64A(row + 4)) {
-        a0 +=   W4*row[4] + W6*row[6];
-        a1 += - W4*row[4] - W2*row[6];
-        a2 += - W4*row[4] + W2*row[6];
-        a3 +=   W4*row[4] - W6*row[6];
-
-        MAC(b0,  W5, row[5]);
-        MAC(b0,  W7, row[7]);
-
-        MAC(b1, -W1, row[5]);
-        MAC(b1, -W5, row[7]);
-
-        MAC(b2,  W7, row[5]);
-        MAC(b2,  W3, row[7]);
-
-        MAC(b3,  W3, row[5]);
-        MAC(b3, -W1, row[7]);
-    }
-
-    row[0] = (a0 + b0) >> (ROW_SHIFT + extra_shift);
-    row[7] = (a0 - b0) >> (ROW_SHIFT + extra_shift);
-    row[1] = (a1 + b1) >> (ROW_SHIFT + extra_shift);
-    row[6] = (a1 - b1) >> (ROW_SHIFT + extra_shift);
-    row[2] = (a2 + b2) >> (ROW_SHIFT + extra_shift);
-    row[5] = (a2 - b2) >> (ROW_SHIFT + extra_shift);
-    row[3] = (a3 + b3) >> (ROW_SHIFT + extra_shift);
-    row[4] = (a3 - b3) >> (ROW_SHIFT + extra_shift);
-}
-
-#define IDCT_COLS do {                                  \
-        a0 = W4 * (col[8*0] + ((1<<(COL_SHIFT-1))/W4)); \
-        a1 = a0;                                        \
-        a2 = a0;                                        \
-        a3 = a0;                                        \
-                                                        \
-        a0 +=  W2*col[8*2];                             \
-        a1 +=  W6*col[8*2];                             \
-        a2 += -W6*col[8*2];                             \
-        a3 += -W2*col[8*2];                             \
-                                                        \
-        b0 = MUL(W1, col[8*1]);                         \
-        b1 = MUL(W3, col[8*1]);                         \
-        b2 = MUL(W5, col[8*1]);                         \
-        b3 = MUL(W7, col[8*1]);                         \
-                                                        \
-        MAC(b0,  W3, col[8*3]);                         \
-        MAC(b1, -W7, col[8*3]);                         \
-        MAC(b2, -W1, col[8*3]);                         \
-        MAC(b3, -W5, col[8*3]);                         \
-                                                        \
-        if (col[8*4]) {                                 \
-            a0 +=  W4*col[8*4];                         \
-            a1 += -W4*col[8*4];                         \
-            a2 += -W4*col[8*4];                         \
-            a3 +=  W4*col[8*4];                         \
-        }                                               \
-                                                        \
-        if (col[8*5]) {                                 \
-            MAC(b0,  W5, col[8*5]);                     \
-            MAC(b1, -W1, col[8*5]);                     \
-            MAC(b2,  W7, col[8*5]);                     \
-            MAC(b3,  W3, col[8*5]);                     \
-        }                                               \
-                                                        \
-        if (col[8*6]) {                                 \
-            a0 +=  W6*col[8*6];                         \
-            a1 += -W2*col[8*6];                         \
-            a2 +=  W2*col[8*6];                         \
-            a3 += -W6*col[8*6];                         \
-        }                                               \
-                                                        \
-        if (col[8*7]) {                                 \
-            MAC(b0,  W7, col[8*7]);                     \
-            MAC(b1, -W5, col[8*7]);                     \
-            MAC(b2,  W3, col[8*7]);                     \
-            MAC(b3, -W1, col[8*7]);                     \
-        }                                               \
-    } while (0)
-
-static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size,
-                                          int16_t *col)
-{
-    int a0, a1, a2, a3, b0, b1, b2, b3;
-
-    IDCT_COLS;
-
-    dest[0] = av_clip_pixel((a0 + b0) >> COL_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_pixel((a1 + b1) >> COL_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_pixel((a2 + b2) >> COL_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_pixel((a3 + b3) >> COL_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_pixel((a3 - b3) >> COL_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_pixel((a2 - b2) >> COL_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_pixel((a1 - b1) >> COL_SHIFT);
-    dest += line_size;
-    dest[0] = av_clip_pixel((a0 - b0) >> COL_SHIFT);
-}
-
-static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size,
-                                          int16_t *col)
-{
-    int a0, a1, a2, a3, b0, b1, b2, b3;
-
-    IDCT_COLS;
-
-    dest[0] = av_clip_pixel(dest[0] + ((a0 + b0) >> COL_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_pixel(dest[0] + ((a1 + b1) >> COL_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_pixel(dest[0] + ((a2 + b2) >> COL_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_pixel(dest[0] + ((a3 + b3) >> COL_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_pixel(dest[0] + ((a3 - b3) >> COL_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_pixel(dest[0] + ((a2 - b2) >> COL_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_pixel(dest[0] + ((a1 - b1) >> COL_SHIFT));
-    dest += line_size;
-    dest[0] = av_clip_pixel(dest[0] + ((a0 - b0) >> COL_SHIFT));
-}
-
-static inline void FUNC(idctSparseCol)(int16_t *col)
-{
-    int a0, a1, a2, a3, b0, b1, b2, b3;
-
-    IDCT_COLS;
-
-    col[0 ] = ((a0 + b0) >> COL_SHIFT);
-    col[8 ] = ((a1 + b1) >> COL_SHIFT);
-    col[16] = ((a2 + b2) >> COL_SHIFT);
-    col[24] = ((a3 + b3) >> COL_SHIFT);
-    col[32] = ((a3 - b3) >> COL_SHIFT);
-    col[40] = ((a2 - b2) >> COL_SHIFT);
-    col[48] = ((a1 - b1) >> COL_SHIFT);
-    col[56] = ((a0 - b0) >> COL_SHIFT);
-}
-
-void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, int16_t *block)
-{
-    pixel *dest = (pixel *)dest_;
-    int i;
-
-    line_size /= sizeof(pixel);
-
-    for (i = 0; i < 8; i++)
-        FUNC(idctRowCondDC)(block + i*8, 0);
-
-    for (i = 0; i < 8; i++)
-        FUNC(idctSparseColPut)(dest + i, line_size, block + i);
-}
-
-void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, int16_t *block)
-{
-    pixel *dest = (pixel *)dest_;
-    int i;
-
-    line_size /= sizeof(pixel);
-
-    for (i = 0; i < 8; i++)
-        FUNC(idctRowCondDC)(block + i*8, 0);
-
-    for (i = 0; i < 8; i++)
-        FUNC(idctSparseColAdd)(dest + i, line_size, block + i);
-}
-
-void FUNC(ff_simple_idct)(int16_t *block)
-{
-    int i;
-
-    for (i = 0; i < 8; i++)
-        FUNC(idctRowCondDC)(block + i*8, 0);
-
-    for (i = 0; i < 8; i++)
-        FUNC(idctSparseCol)(block + i);
-}
diff --git a/deps/libav/libavcodec/sinewin.c b/deps/libav/libavcodec/sinewin.c
deleted file mode 100644
index be38dbc..0000000
--- a/deps/libav/libavcodec/sinewin.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "sinewin.h"
-#include "sinewin_tablegen.h"
diff --git a/deps/libav/libavcodec/sinewin.h b/deps/libav/libavcodec/sinewin.h
deleted file mode 100644
index 478036d..0000000
--- a/deps/libav/libavcodec/sinewin.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2008 Robert Swain
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SINEWIN_H
-#define AVCODEC_SINEWIN_H
-
-#include "config.h"
-#include "libavutil/mem.h"
-
-#if CONFIG_HARDCODED_TABLES
-#   define SINETABLE_CONST const
-#else
-#   define SINETABLE_CONST
-#endif
-
-#define SINETABLE(size) \
-    SINETABLE_CONST DECLARE_ALIGNED(32, float, ff_sine_##size)[size]
-
-/**
- * Generate a sine window.
- * @param   window  pointer to half window
- * @param   n       size of half window
- */
-void ff_sine_window_init(float *window, int n);
-
-/**
- * initialize the specified entry of ff_sine_windows
- */
-void ff_init_ff_sine_windows(int index);
-
-extern SINETABLE(  32);
-extern SINETABLE(  64);
-extern SINETABLE( 128);
-extern SINETABLE( 256);
-extern SINETABLE( 512);
-extern SINETABLE(1024);
-extern SINETABLE(2048);
-extern SINETABLE(4096);
-extern SINETABLE(8192);
-
-extern SINETABLE_CONST float * const ff_sine_windows[14];
-
-#endif /* AVCODEC_SINEWIN_H */
diff --git a/deps/libav/libavcodec/sinewin_tablegen.c b/deps/libav/libavcodec/sinewin_tablegen.c
deleted file mode 100644
index 90a75c2..0000000
--- a/deps/libav/libavcodec/sinewin_tablegen.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Generate a header file for hardcoded sine windows
- *
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#define CONFIG_HARDCODED_TABLES 0
-#define SINETABLE_CONST
-#define SINETABLE(size) \
-    float ff_sine_##size[size]
-#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
-#include "sinewin_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
-    int i;
-
-    write_fileheader();
-
-    for (i = 5; i <= 13; i++) {
-        ff_init_ff_sine_windows(i);
-        printf("SINETABLE(%4i) = {\n", 1 << i);
-        write_float_array(ff_sine_windows[i], 1 << i);
-        printf("};\n");
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/sinewin_tablegen.h b/deps/libav/libavcodec/sinewin_tablegen.h
deleted file mode 100644
index 1ee225b..0000000
--- a/deps/libav/libavcodec/sinewin_tablegen.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Header file for hardcoded sine windows
- *
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SINEWIN_TABLEGEN_H
-#define AVCODEC_SINEWIN_TABLEGEN_H
-
-#include <assert.h>
-// do not use libavutil/libm.h since this is compiled both
-// for the host and the target and config.h is only valid for the target
-#include <math.h>
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-
-#if !CONFIG_HARDCODED_TABLES
-SINETABLE(  32);
-SINETABLE(  64);
-SINETABLE( 128);
-SINETABLE( 256);
-SINETABLE( 512);
-SINETABLE(1024);
-SINETABLE(2048);
-SINETABLE(4096);
-SINETABLE(8192);
-#else
-#include "libavcodec/sinewin_tables.h"
-#endif
-
-SINETABLE_CONST float * const ff_sine_windows[] = {
-    NULL, NULL, NULL, NULL, NULL, // unused
-    ff_sine_32 , ff_sine_64 ,
-    ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024, ff_sine_2048, ff_sine_4096, ff_sine_8192
-};
-
-// Generate a sine window.
-av_cold void ff_sine_window_init(float *window, int n) {
-    int i;
-    for(i = 0; i < n; i++)
-        window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n)));
-}
-
-av_cold void ff_init_ff_sine_windows(int index) {
-    assert(index >= 0 && index < FF_ARRAY_ELEMS(ff_sine_windows));
-#if !CONFIG_HARDCODED_TABLES
-    ff_sine_window_init(ff_sine_windows[index], 1 << index);
-#endif
-}
-
-#endif /* AVCODEC_SINEWIN_TABLEGEN_H */
diff --git a/deps/libav/libavcodec/sipr.c b/deps/libav/libavcodec/sipr.c
deleted file mode 100644
index 98607f2..0000000
--- a/deps/libav/libavcodec/sipr.c
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- * SIPR / ACELP.NET decoder
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <math.h>
-#include <stdint.h>
-#include <string.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/mathematics.h"
-#include "avcodec.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "internal.h"
-
-#include "lsp.h"
-#include "acelp_vectors.h"
-#include "acelp_pitch_delay.h"
-#include "acelp_filters.h"
-#include "celp_filters.h"
-
-#define MAX_SUBFRAME_COUNT   5
-
-#include "sipr.h"
-#include "siprdata.h"
-
-typedef struct {
-    const char *mode_name;
-    uint16_t bits_per_frame;
-    uint8_t subframe_count;
-    uint8_t frames_per_packet;
-    float pitch_sharp_factor;
-
-    /* bitstream parameters */
-    uint8_t number_of_fc_indexes;
-    uint8_t ma_predictor_bits;  ///< size in bits of the switched MA predictor
-
-    /** size in bits of the i-th stage vector of quantizer */
-    uint8_t vq_indexes_bits[5];
-
-    /** size in bits of the adaptive-codebook index for every subframe */
-    uint8_t pitch_delay_bits[5];
-
-    uint8_t gp_index_bits;
-    uint8_t fc_index_bits[10]; ///< size in bits of the fixed codebook indexes
-    uint8_t gc_index_bits;     ///< size in bits of the gain  codebook indexes
-} SiprModeParam;
-
-static const SiprModeParam modes[MODE_COUNT] = {
-    [MODE_16k] = {
-        .mode_name          = "16k",
-        .bits_per_frame     = 160,
-        .subframe_count     = SUBFRAME_COUNT_16k,
-        .frames_per_packet  = 1,
-        .pitch_sharp_factor = 0.00,
-
-        .number_of_fc_indexes = 10,
-        .ma_predictor_bits    = 1,
-        .vq_indexes_bits      = {7, 8, 7, 7, 7},
-        .pitch_delay_bits     = {9, 6},
-        .gp_index_bits        = 4,
-        .fc_index_bits        = {4, 5, 4, 5, 4, 5, 4, 5, 4, 5},
-        .gc_index_bits        = 5
-    },
-
-    [MODE_8k5] = {
-        .mode_name          = "8k5",
-        .bits_per_frame     = 152,
-        .subframe_count     = 3,
-        .frames_per_packet  = 1,
-        .pitch_sharp_factor = 0.8,
-
-        .number_of_fc_indexes = 3,
-        .ma_predictor_bits    = 0,
-        .vq_indexes_bits      = {6, 7, 7, 7, 5},
-        .pitch_delay_bits     = {8, 5, 5},
-        .gp_index_bits        = 0,
-        .fc_index_bits        = {9, 9, 9},
-        .gc_index_bits        = 7
-    },
-
-    [MODE_6k5] = {
-        .mode_name          = "6k5",
-        .bits_per_frame     = 232,
-        .subframe_count     = 3,
-        .frames_per_packet  = 2,
-        .pitch_sharp_factor = 0.8,
-
-        .number_of_fc_indexes = 3,
-        .ma_predictor_bits    = 0,
-        .vq_indexes_bits      = {6, 7, 7, 7, 5},
-        .pitch_delay_bits     = {8, 5, 5},
-        .gp_index_bits        = 0,
-        .fc_index_bits        = {5, 5, 5},
-        .gc_index_bits        = 7
-    },
-
-    [MODE_5k0] = {
-        .mode_name          = "5k0",
-        .bits_per_frame     = 296,
-        .subframe_count     = 5,
-        .frames_per_packet  = 2,
-        .pitch_sharp_factor = 0.85,
-
-        .number_of_fc_indexes = 1,
-        .ma_predictor_bits    = 0,
-        .vq_indexes_bits      = {6, 7, 7, 7, 5},
-        .pitch_delay_bits     = {8, 5, 8, 5, 5},
-        .gp_index_bits        = 0,
-        .fc_index_bits        = {10},
-        .gc_index_bits        = 7
-    }
-};
-
-const float ff_pow_0_5[] = {
-    1.0/(1 <<  1), 1.0/(1 <<  2), 1.0/(1 <<  3), 1.0/(1 <<  4),
-    1.0/(1 <<  5), 1.0/(1 <<  6), 1.0/(1 <<  7), 1.0/(1 <<  8),
-    1.0/(1 <<  9), 1.0/(1 << 10), 1.0/(1 << 11), 1.0/(1 << 12),
-    1.0/(1 << 13), 1.0/(1 << 14), 1.0/(1 << 15), 1.0/(1 << 16)
-};
-
-static void dequant(float *out, const int *idx, const float *cbs[])
-{
-    int i;
-    int stride  = 2;
-    int num_vec = 5;
-
-    for (i = 0; i < num_vec; i++)
-        memcpy(out + stride*i, cbs[i] + stride*idx[i], stride*sizeof(float));
-
-}
-
-static void lsf_decode_fp(float *lsfnew, float *lsf_history,
-                          const SiprParameters *parm)
-{
-    int i;
-    float lsf_tmp[LP_FILTER_ORDER];
-
-    dequant(lsf_tmp, parm->vq_indexes, lsf_codebooks);
-
-    for (i = 0; i < LP_FILTER_ORDER; i++)
-        lsfnew[i] = lsf_history[i] * 0.33 + lsf_tmp[i] + mean_lsf[i];
-
-    ff_sort_nearly_sorted_floats(lsfnew, LP_FILTER_ORDER - 1);
-
-    /* Note that a minimum distance is not enforced between the last value and
-       the previous one, contrary to what is done in ff_acelp_reorder_lsf() */
-    ff_set_min_dist_lsf(lsfnew, LSFQ_DIFF_MIN, LP_FILTER_ORDER - 1);
-    lsfnew[9] = FFMIN(lsfnew[LP_FILTER_ORDER - 1], 1.3 * M_PI);
-
-    memcpy(lsf_history, lsf_tmp, LP_FILTER_ORDER * sizeof(*lsf_history));
-
-    for (i = 0; i < LP_FILTER_ORDER - 1; i++)
-        lsfnew[i] = cos(lsfnew[i]);
-    lsfnew[LP_FILTER_ORDER - 1] *= 6.153848 / M_PI;
-}
-
-/** Apply pitch lag to the fixed vector (AMR section 6.1.2). */
-static void pitch_sharpening(int pitch_lag_int, float beta,
-                             float *fixed_vector)
-{
-    int i;
-
-    for (i = pitch_lag_int; i < SUBFR_SIZE; i++)
-        fixed_vector[i] += beta * fixed_vector[i - pitch_lag_int];
-}
-
-/**
- * Extract decoding parameters from the input bitstream.
- * @param parms          parameters structure
- * @param pgb            pointer to initialized GetBitContext structure
- */
-static void decode_parameters(SiprParameters* parms, GetBitContext *pgb,
-                              const SiprModeParam *p)
-{
-    int i, j;
-
-    if (p->ma_predictor_bits)
-        parms->ma_pred_switch       = get_bits(pgb, p->ma_predictor_bits);
-
-    for (i = 0; i < 5; i++)
-        parms->vq_indexes[i]        = get_bits(pgb, p->vq_indexes_bits[i]);
-
-    for (i = 0; i < p->subframe_count; i++) {
-        parms->pitch_delay[i]       = get_bits(pgb, p->pitch_delay_bits[i]);
-        if (p->gp_index_bits)
-            parms->gp_index[i]      = get_bits(pgb, p->gp_index_bits);
-
-        for (j = 0; j < p->number_of_fc_indexes; j++)
-            parms->fc_indexes[i][j] = get_bits(pgb, p->fc_index_bits[j]);
-
-        parms->gc_index[i]          = get_bits(pgb, p->gc_index_bits);
-    }
-}
-
-static void sipr_decode_lp(float *lsfnew, const float *lsfold, float *Az,
-                           int num_subfr)
-{
-    double lsfint[LP_FILTER_ORDER];
-    int i,j;
-    float t, t0 = 1.0 / num_subfr;
-
-    t = t0 * 0.5;
-    for (i = 0; i < num_subfr; i++) {
-        for (j = 0; j < LP_FILTER_ORDER; j++)
-            lsfint[j] = lsfold[j] * (1 - t) + t * lsfnew[j];
-
-        ff_amrwb_lsp2lpc(lsfint, Az, LP_FILTER_ORDER);
-        Az += LP_FILTER_ORDER;
-        t += t0;
-    }
-}
-
-/**
- * Evaluate the adaptive impulse response.
- */
-static void eval_ir(const float *Az, int pitch_lag, float *freq,
-                    float pitch_sharp_factor)
-{
-    float tmp1[SUBFR_SIZE+1], tmp2[LP_FILTER_ORDER+1];
-    int i;
-
-    tmp1[0] = 1.0;
-    for (i = 0; i < LP_FILTER_ORDER; i++) {
-        tmp1[i+1] = Az[i] * ff_pow_0_55[i];
-        tmp2[i  ] = Az[i] * ff_pow_0_7 [i];
-    }
-    memset(tmp1 + 11, 0, 37 * sizeof(float));
-
-    ff_celp_lp_synthesis_filterf(freq, tmp2, tmp1, SUBFR_SIZE,
-                                 LP_FILTER_ORDER);
-
-    pitch_sharpening(pitch_lag, pitch_sharp_factor, freq);
-}
-
-/**
- * Evaluate the convolution of a vector with a sparse vector.
- */
-static void convolute_with_sparse(float *out, const AMRFixed *pulses,
-                                  const float *shape, int length)
-{
-    int i, j;
-
-    memset(out, 0, length*sizeof(float));
-    for (i = 0; i < pulses->n; i++)
-        for (j = pulses->x[i]; j < length; j++)
-            out[j] += pulses->y[i] * shape[j - pulses->x[i]];
-}
-
-/**
- * Apply postfilter, very similar to AMR one.
- */
-static void postfilter_5k0(SiprContext *ctx, const float *lpc, float *samples)
-{
-    float buf[SUBFR_SIZE + LP_FILTER_ORDER];
-    float *pole_out = buf + LP_FILTER_ORDER;
-    float lpc_n[LP_FILTER_ORDER];
-    float lpc_d[LP_FILTER_ORDER];
-    int i;
-
-    for (i = 0; i < LP_FILTER_ORDER; i++) {
-        lpc_d[i] = lpc[i] * ff_pow_0_75[i];
-        lpc_n[i] = lpc[i] * ff_pow_0_5 [i];
-    };
-
-    memcpy(pole_out - LP_FILTER_ORDER, ctx->postfilter_mem,
-           LP_FILTER_ORDER*sizeof(float));
-
-    ff_celp_lp_synthesis_filterf(pole_out, lpc_d, samples, SUBFR_SIZE,
-                                 LP_FILTER_ORDER);
-
-    memcpy(ctx->postfilter_mem, pole_out + SUBFR_SIZE - LP_FILTER_ORDER,
-           LP_FILTER_ORDER*sizeof(float));
-
-    ff_tilt_compensation(&ctx->tilt_mem, 0.4, pole_out, SUBFR_SIZE);
-
-    memcpy(pole_out - LP_FILTER_ORDER, ctx->postfilter_mem5k0,
-           LP_FILTER_ORDER*sizeof(*pole_out));
-
-    memcpy(ctx->postfilter_mem5k0, pole_out + SUBFR_SIZE - LP_FILTER_ORDER,
-           LP_FILTER_ORDER*sizeof(*pole_out));
-
-    ff_celp_lp_zero_synthesis_filterf(samples, lpc_n, pole_out, SUBFR_SIZE,
-                                      LP_FILTER_ORDER);
-
-}
-
-static void decode_fixed_sparse(AMRFixed *fixed_sparse, const int16_t *pulses,
-                                SiprMode mode, int low_gain)
-{
-    int i;
-
-    switch (mode) {
-    case MODE_6k5:
-        for (i = 0; i < 3; i++) {
-            fixed_sparse->x[i] = 3 * (pulses[i] & 0xf) + i;
-            fixed_sparse->y[i] = pulses[i] & 0x10 ? -1 : 1;
-        }
-        fixed_sparse->n = 3;
-        break;
-    case MODE_8k5:
-        for (i = 0; i < 3; i++) {
-            fixed_sparse->x[2*i    ] = 3 * ((pulses[i] >> 4) & 0xf) + i;
-            fixed_sparse->x[2*i + 1] = 3 * ( pulses[i]       & 0xf) + i;
-
-            fixed_sparse->y[2*i    ] = (pulses[i] & 0x100) ? -1.0: 1.0;
-
-            fixed_sparse->y[2*i + 1] =
-                (fixed_sparse->x[2*i + 1] < fixed_sparse->x[2*i]) ?
-                -fixed_sparse->y[2*i    ] : fixed_sparse->y[2*i];
-        }
-
-        fixed_sparse->n = 6;
-        break;
-    case MODE_5k0:
-    default:
-        if (low_gain) {
-            int offset = (pulses[0] & 0x200) ? 2 : 0;
-            int val = pulses[0];
-
-            for (i = 0; i < 3; i++) {
-                int index = (val & 0x7) * 6 + 4 - i*2;
-
-                fixed_sparse->y[i] = (offset + index) & 0x3 ? -1 : 1;
-                fixed_sparse->x[i] = index;
-
-                val >>= 3;
-            }
-            fixed_sparse->n = 3;
-        } else {
-            int pulse_subset = (pulses[0] >> 8) & 1;
-
-            fixed_sparse->x[0] = ((pulses[0] >> 4) & 15) * 3 + pulse_subset;
-            fixed_sparse->x[1] = ( pulses[0]       & 15) * 3 + pulse_subset + 1;
-
-            fixed_sparse->y[0] = pulses[0] & 0x200 ? -1 : 1;
-            fixed_sparse->y[1] = -fixed_sparse->y[0];
-            fixed_sparse->n = 2;
-        }
-        break;
-    }
-}
-
-static void decode_frame(SiprContext *ctx, SiprParameters *params,
-                         float *out_data)
-{
-    int i, j;
-    int subframe_count = modes[ctx->mode].subframe_count;
-    int frame_size = subframe_count * SUBFR_SIZE;
-    float Az[LP_FILTER_ORDER * MAX_SUBFRAME_COUNT];
-    float *excitation;
-    float ir_buf[SUBFR_SIZE + LP_FILTER_ORDER];
-    float lsf_new[LP_FILTER_ORDER];
-    float *impulse_response = ir_buf + LP_FILTER_ORDER;
-    float *synth = ctx->synth_buf + 16; // 16 instead of LP_FILTER_ORDER for
-                                        // memory alignment
-    int t0_first = 0;
-    AMRFixed fixed_cb;
-
-    memset(ir_buf, 0, LP_FILTER_ORDER * sizeof(float));
-    lsf_decode_fp(lsf_new, ctx->lsf_history, params);
-
-    sipr_decode_lp(lsf_new, ctx->lsp_history, Az, subframe_count);
-
-    memcpy(ctx->lsp_history, lsf_new, LP_FILTER_ORDER * sizeof(float));
-
-    excitation = ctx->excitation + PITCH_DELAY_MAX + L_INTERPOL;
-
-    for (i = 0; i < subframe_count; i++) {
-        float *pAz = Az + i*LP_FILTER_ORDER;
-        float fixed_vector[SUBFR_SIZE];
-        int T0,T0_frac;
-        float pitch_gain, gain_code, avg_energy;
-
-        ff_decode_pitch_lag(&T0, &T0_frac, params->pitch_delay[i], t0_first, i,
-                            ctx->mode == MODE_5k0, 6);
-
-        if (i == 0 || (i == 2 && ctx->mode == MODE_5k0))
-            t0_first = T0;
-
-        ff_acelp_interpolatef(excitation, excitation - T0 + (T0_frac <= 0),
-                              ff_b60_sinc, 6,
-                              2 * ((2 + T0_frac)%3 + 1), LP_FILTER_ORDER,
-                              SUBFR_SIZE);
-
-        decode_fixed_sparse(&fixed_cb, params->fc_indexes[i], ctx->mode,
-                            ctx->past_pitch_gain < 0.8);
-
-        eval_ir(pAz, T0, impulse_response, modes[ctx->mode].pitch_sharp_factor);
-
-        convolute_with_sparse(fixed_vector, &fixed_cb, impulse_response,
-                              SUBFR_SIZE);
-
-        avg_energy = (0.01 + avpriv_scalarproduct_float_c(fixed_vector,
-                                                          fixed_vector,
-                                                          SUBFR_SIZE)) /
-                     SUBFR_SIZE;
-
-        ctx->past_pitch_gain = pitch_gain = gain_cb[params->gc_index[i]][0];
-
-        gain_code = ff_amr_set_fixed_gain(gain_cb[params->gc_index[i]][1],
-                                          avg_energy, ctx->energy_history,
-                                          34 - 15.0/(0.05*M_LN10/M_LN2),
-                                          pred);
-
-        ff_weighted_vector_sumf(excitation, excitation, fixed_vector,
-                                pitch_gain, gain_code, SUBFR_SIZE);
-
-        pitch_gain *= 0.5 * pitch_gain;
-        pitch_gain = FFMIN(pitch_gain, 0.4);
-
-        ctx->gain_mem = 0.7 * ctx->gain_mem + 0.3 * pitch_gain;
-        ctx->gain_mem = FFMIN(ctx->gain_mem, pitch_gain);
-        gain_code *= ctx->gain_mem;
-
-        for (j = 0; j < SUBFR_SIZE; j++)
-            fixed_vector[j] = excitation[j] - gain_code * fixed_vector[j];
-
-        if (ctx->mode == MODE_5k0) {
-            postfilter_5k0(ctx, pAz, fixed_vector);
-
-            ff_celp_lp_synthesis_filterf(ctx->postfilter_syn5k0 + LP_FILTER_ORDER + i*SUBFR_SIZE,
-                                         pAz, excitation, SUBFR_SIZE,
-                                         LP_FILTER_ORDER);
-        }
-
-        ff_celp_lp_synthesis_filterf(synth + i*SUBFR_SIZE, pAz, fixed_vector,
-                                     SUBFR_SIZE, LP_FILTER_ORDER);
-
-        excitation += SUBFR_SIZE;
-    }
-
-    memcpy(synth - LP_FILTER_ORDER, synth + frame_size - LP_FILTER_ORDER,
-           LP_FILTER_ORDER * sizeof(float));
-
-    if (ctx->mode == MODE_5k0) {
-        for (i = 0; i < subframe_count; i++) {
-            float energy = avpriv_scalarproduct_float_c(ctx->postfilter_syn5k0 + LP_FILTER_ORDER + i * SUBFR_SIZE,
-                                                        ctx->postfilter_syn5k0 + LP_FILTER_ORDER + i * SUBFR_SIZE,
-                                                        SUBFR_SIZE);
-            ff_adaptive_gain_control(&synth[i * SUBFR_SIZE],
-                                     &synth[i * SUBFR_SIZE], energy,
-                                     SUBFR_SIZE, 0.9, &ctx->postfilter_agc);
-        }
-
-        memcpy(ctx->postfilter_syn5k0, ctx->postfilter_syn5k0 + frame_size,
-               LP_FILTER_ORDER*sizeof(float));
-    }
-    memmove(ctx->excitation, excitation - PITCH_DELAY_MAX - L_INTERPOL,
-           (PITCH_DELAY_MAX + L_INTERPOL) * sizeof(float));
-
-    ff_acelp_apply_order_2_transfer_function(out_data, synth,
-                                             (const float[2]) {-1.99997   , 1.000000000},
-                                             (const float[2]) {-1.93307352, 0.935891986},
-                                             0.939805806,
-                                             ctx->highpass_filt_mem,
-                                             frame_size);
-}
-
-static av_cold int sipr_decoder_init(AVCodecContext * avctx)
-{
-    SiprContext *ctx = avctx->priv_data;
-    int i;
-
-    switch (avctx->block_align) {
-    case 20: ctx->mode = MODE_16k; break;
-    case 19: ctx->mode = MODE_8k5; break;
-    case 29: ctx->mode = MODE_6k5; break;
-    case 37: ctx->mode = MODE_5k0; break;
-    default:
-        if      (avctx->bit_rate > 12200) ctx->mode = MODE_16k;
-        else if (avctx->bit_rate > 7500 ) ctx->mode = MODE_8k5;
-        else if (avctx->bit_rate > 5750 ) ctx->mode = MODE_6k5;
-        else                              ctx->mode = MODE_5k0;
-        av_log(avctx, AV_LOG_WARNING,
-               "Invalid block_align: %d. Mode %s guessed based on bitrate: %d\n",
-               avctx->block_align, modes[ctx->mode].mode_name, avctx->bit_rate);
-    }
-
-    av_log(avctx, AV_LOG_DEBUG, "Mode: %s\n", modes[ctx->mode].mode_name);
-
-    if (ctx->mode == MODE_16k) {
-        ff_sipr_init_16k(ctx);
-        ctx->decode_frame = ff_sipr_decode_frame_16k;
-    } else {
-        ctx->decode_frame = decode_frame;
-    }
-
-    for (i = 0; i < LP_FILTER_ORDER; i++)
-        ctx->lsp_history[i] = cos((i+1) * M_PI / (LP_FILTER_ORDER + 1));
-
-    for (i = 0; i < 4; i++)
-        ctx->energy_history[i] = -14;
-
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_FLT;
-
-    return 0;
-}
-
-static int sipr_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    SiprContext *ctx = avctx->priv_data;
-    AVFrame *frame   = data;
-    const uint8_t *buf=avpkt->data;
-    SiprParameters parm;
-    const SiprModeParam *mode_par = &modes[ctx->mode];
-    GetBitContext gb;
-    float *samples;
-    int subframe_size = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE;
-    int i, ret;
-
-    ctx->avctx = avctx;
-    if (avpkt->size < (mode_par->bits_per_frame >> 3)) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Error processing packet: packet size (%d) too small\n",
-               avpkt->size);
-        return -1;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = mode_par->frames_per_packet * subframe_size *
-                        mode_par->subframe_count;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (float *)frame->data[0];
-
-    init_get_bits(&gb, buf, mode_par->bits_per_frame);
-
-    for (i = 0; i < mode_par->frames_per_packet; i++) {
-        decode_parameters(&parm, &gb, mode_par);
-
-        ctx->decode_frame(ctx, &parm, samples);
-
-        samples += subframe_size * mode_par->subframe_count;
-    }
-
-    *got_frame_ptr = 1;
-
-    return mode_par->bits_per_frame >> 3;
-}
-
-AVCodec ff_sipr_decoder = {
-    .name           = "sipr",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealAudio SIPR / ACELP.NET"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_SIPR,
-    .priv_data_size = sizeof(SiprContext),
-    .init           = sipr_decoder_init,
-    .decode         = sipr_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/sipr.h b/deps/libav/libavcodec/sipr.h
deleted file mode 100644
index 4cdea67..0000000
--- a/deps/libav/libavcodec/sipr.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * SIPR / ACELP.NET decoder
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SIPR_H
-#define AVCODEC_SIPR_H
-
-#include "avcodec.h"
-#include "acelp_pitch_delay.h"
-#include "libavutil/mem.h"
-
-#define LP_FILTER_ORDER_16k  16
-#define L_SUBFR_16k          80
-#define PITCH_MIN            30
-#define PITCH_MAX            281
-
-#define LSFQ_DIFF_MIN        (0.0125 * M_PI)
-
-#define LP_FILTER_ORDER      10
-
-/** Number of past samples needed for excitation interpolation */
-#define L_INTERPOL           (LP_FILTER_ORDER + 1)
-
-/**  Subframe size for all modes except 16k */
-#define SUBFR_SIZE           48
-
-#define SUBFRAME_COUNT_16k   2
-
-typedef enum {
-    MODE_16k,
-    MODE_8k5,
-    MODE_6k5,
-    MODE_5k0,
-    MODE_COUNT
-} SiprMode;
-
-typedef struct SiprParameters {
-    int ma_pred_switch;        ///< switched moving average predictor
-    int vq_indexes[5];
-    int pitch_delay[5];        ///< pitch delay
-    int gp_index[5];           ///< adaptive-codebook gain indexes
-    int16_t fc_indexes[5][10]; ///< fixed-codebook indexes
-    int gc_index[5];           ///< fixed-codebook gain indexes
-} SiprParameters;
-
-typedef struct SiprContext {
-    AVCodecContext *avctx;
-
-    SiprMode mode;
-
-    float past_pitch_gain;
-    float lsf_history[LP_FILTER_ORDER_16k];
-
-    float excitation[L_INTERPOL + PITCH_MAX + 2 * L_SUBFR_16k];
-
-    DECLARE_ALIGNED(16, float, synth_buf)[LP_FILTER_ORDER + 5*SUBFR_SIZE + 6];
-
-    float lsp_history[LP_FILTER_ORDER];
-    float gain_mem;
-    float energy_history[4];
-    float highpass_filt_mem[2];
-    float postfilter_mem[PITCH_DELAY_MAX + LP_FILTER_ORDER];
-
-    /* 5k0 */
-    float tilt_mem;
-    float postfilter_agc;
-    float postfilter_mem5k0[PITCH_DELAY_MAX + LP_FILTER_ORDER];
-    float postfilter_syn5k0[LP_FILTER_ORDER + SUBFR_SIZE*5];
-
-    /* 16k */
-    int pitch_lag_prev;
-    float iir_mem[LP_FILTER_ORDER_16k+1];
-    float filt_buf[2][LP_FILTER_ORDER_16k+1];
-    float *filt_mem[2];
-    float mem_preemph[LP_FILTER_ORDER_16k];
-    float synth[LP_FILTER_ORDER_16k];
-    double lsp_history_16k[16];
-
-    void (*decode_frame)(struct SiprContext *ctx, SiprParameters *params,
-                         float *out_data);
-} SiprContext;
-
-extern const float ff_pow_0_5[16];
-
-void ff_sipr_init_16k(SiprContext *ctx);
-
-void ff_sipr_decode_frame_16k(SiprContext *ctx, SiprParameters *params,
-                              float *out_data);
-
-#endif /* AVCODEC_SIPR_H */
diff --git a/deps/libav/libavcodec/sipr16k.c b/deps/libav/libavcodec/sipr16k.c
deleted file mode 100644
index f7fcb34..0000000
--- a/deps/libav/libavcodec/sipr16k.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * SIPR decoder for the 16k mode
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <math.h>
-
-#include "sipr.h"
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/mathematics.h"
-#include "lsp.h"
-#include "celp_filters.h"
-#include "acelp_vectors.h"
-#include "acelp_pitch_delay.h"
-#include "acelp_filters.h"
-#include "celp_filters.h"
-
-#include "sipr16kdata.h"
-
-/**
- * Convert an lsf vector into an lsp vector.
- *
- * @param lsf               input lsf vector
- * @param lsp               output lsp vector
- */
-static void lsf2lsp(const float *lsf, double *lsp)
-{
-    int i;
-
-    for (i = 0; i < LP_FILTER_ORDER_16k; i++)
-        lsp[i] = cosf(lsf[i]);
-}
-
-static void dequant(float *out, const int *idx, const float *cbs[])
-{
-    int i;
-
-    for (i = 0; i < 4; i++)
-        memcpy(out + 3*i, cbs[i] + 3*idx[i], 3*sizeof(float));
-
-    memcpy(out + 12, cbs[4] + 4*idx[4], 4*sizeof(float));
-}
-
-static void lsf_decode_fp_16k(float* lsf_history, float* isp_new,
-                              const int* parm, int ma_pred)
-{
-    int i;
-    float isp_q[LP_FILTER_ORDER_16k];
-
-    dequant(isp_q, parm, lsf_codebooks_16k);
-
-    for (i = 0; i < LP_FILTER_ORDER_16k; i++) {
-        isp_new[i] = (1 - qu[ma_pred]) * isp_q[i]
-                    +     qu[ma_pred]  * lsf_history[i]
-                    + mean_lsf_16k[i];
-    }
-
-    memcpy(lsf_history, isp_q, LP_FILTER_ORDER_16k * sizeof(float));
-}
-
-static int dec_delay3_1st(int index)
-{
-    if (index < 390) {
-        return index + 88;
-    } else
-        return 3 * index - 690;
-}
-
-static int dec_delay3_2nd(int index, int pit_min, int pit_max,
-                          int pitch_lag_prev)
-{
-    if (index < 62) {
-        int pitch_delay_min = av_clip(pitch_lag_prev - 10,
-                                      pit_min, pit_max - 19);
-        return 3 * pitch_delay_min + index - 2;
-    } else
-        return 3 * pitch_lag_prev;
-}
-
-static void postfilter(float *out_data, float* synth, float* iir_mem,
-                       float* filt_mem[2], float* mem_preemph)
-{
-    float buf[30 + LP_FILTER_ORDER_16k];
-    float *tmpbuf = buf + LP_FILTER_ORDER_16k;
-    float s;
-    int i;
-
-    for (i = 0; i < LP_FILTER_ORDER_16k; i++)
-        filt_mem[0][i] = iir_mem[i] * ff_pow_0_5[i];
-
-    memcpy(tmpbuf - LP_FILTER_ORDER_16k, mem_preemph,
-           LP_FILTER_ORDER_16k*sizeof(*buf));
-
-    ff_celp_lp_synthesis_filterf(tmpbuf, filt_mem[1], synth, 30,
-                                 LP_FILTER_ORDER_16k);
-
-    memcpy(synth - LP_FILTER_ORDER_16k, mem_preemph,
-           LP_FILTER_ORDER_16k * sizeof(*synth));
-
-    ff_celp_lp_synthesis_filterf(synth, filt_mem[0], synth, 30,
-                                 LP_FILTER_ORDER_16k);
-
-    memcpy(out_data + 30 - LP_FILTER_ORDER_16k,
-           synth    + 30 - LP_FILTER_ORDER_16k,
-           LP_FILTER_ORDER_16k * sizeof(*synth));
-
-    ff_celp_lp_synthesis_filterf(out_data + 30, filt_mem[0],
-                                 synth + 30, 2 * L_SUBFR_16k - 30,
-                                 LP_FILTER_ORDER_16k);
-
-
-    memcpy(mem_preemph, out_data + 2*L_SUBFR_16k - LP_FILTER_ORDER_16k,
-           LP_FILTER_ORDER_16k * sizeof(*synth));
-
-    FFSWAP(float *, filt_mem[0], filt_mem[1]);
-    for (i = 0, s = 0; i < 30; i++, s += 1.0/30)
-        out_data[i] = tmpbuf[i] + s * (synth[i] - tmpbuf[i]);
-}
-
-/**
- * Floating point version of ff_acelp_lp_decode().
- */
-static void acelp_lp_decodef(float *lp_1st, float *lp_2nd,
-                             const double *lsp_2nd, const double *lsp_prev)
-{
-    double lsp_1st[LP_FILTER_ORDER_16k];
-    int i;
-
-    /* LSP values for first subframe (3.2.5 of G.729, Equation 24) */
-    for (i = 0; i < LP_FILTER_ORDER_16k; i++)
-        lsp_1st[i] = (lsp_2nd[i] + lsp_prev[i]) * 0.5;
-
-    ff_acelp_lspd2lpc(lsp_1st, lp_1st, LP_FILTER_ORDER_16k >> 1);
-
-    /* LSP values for second subframe (3.2.5 of G.729) */
-    ff_acelp_lspd2lpc(lsp_2nd, lp_2nd, LP_FILTER_ORDER_16k >> 1);
-}
-
-/**
- * Floating point version of ff_acelp_decode_gain_code().
- */
-static float acelp_decode_gain_codef(float gain_corr_factor, const float *fc_v,
-                                     float mr_energy, const float *quant_energy,
-                                     const float *ma_prediction_coeff,
-                                     int subframe_size, int ma_pred_order)
-{
-    mr_energy += avpriv_scalarproduct_float_c(quant_energy, ma_prediction_coeff,
-                                              ma_pred_order);
-
-    mr_energy = gain_corr_factor * exp(M_LN10 / 20. * mr_energy) /
-        sqrt((0.01 + avpriv_scalarproduct_float_c(fc_v, fc_v, subframe_size)));
-    return mr_energy;
-}
-
-#define DIVIDE_BY_3(x) ((x) * 10923 >> 15)
-
-void ff_sipr_decode_frame_16k(SiprContext *ctx, SiprParameters *params,
-                              float *out_data)
-{
-    int frame_size = SUBFRAME_COUNT_16k * L_SUBFR_16k;
-    float *synth = ctx->synth_buf + LP_FILTER_ORDER_16k;
-    float lsf_new[LP_FILTER_ORDER_16k];
-    double lsp_new[LP_FILTER_ORDER_16k];
-    float Az[2][LP_FILTER_ORDER_16k];
-    float fixed_vector[L_SUBFR_16k];
-    float pitch_fac, gain_code;
-
-    int i;
-    int pitch_delay_3x;
-
-    float *excitation = ctx->excitation + 292;
-
-    lsf_decode_fp_16k(ctx->lsf_history, lsf_new, params->vq_indexes,
-                      params->ma_pred_switch);
-
-    ff_set_min_dist_lsf(lsf_new, LSFQ_DIFF_MIN / 2, LP_FILTER_ORDER_16k);
-
-    lsf2lsp(lsf_new, lsp_new);
-
-    acelp_lp_decodef(Az[0], Az[1], lsp_new, ctx->lsp_history_16k);
-
-    memcpy(ctx->lsp_history_16k, lsp_new, LP_FILTER_ORDER_16k * sizeof(double));
-
-    memcpy(synth - LP_FILTER_ORDER_16k, ctx->synth,
-           LP_FILTER_ORDER_16k * sizeof(*synth));
-
-    for (i = 0; i < SUBFRAME_COUNT_16k; i++) {
-        int i_subfr = i * L_SUBFR_16k;
-        AMRFixed f;
-        float gain_corr_factor;
-        int pitch_delay_int;
-        int pitch_delay_frac;
-
-        if (!i) {
-            pitch_delay_3x = dec_delay3_1st(params->pitch_delay[i]);
-        } else
-            pitch_delay_3x = dec_delay3_2nd(params->pitch_delay[i],
-                                            PITCH_MIN, PITCH_MAX,
-                                            ctx->pitch_lag_prev);
-
-        pitch_fac = gain_pitch_cb_16k[params->gp_index[i]];
-        f.pitch_fac = FFMIN(pitch_fac, 1.0);
-        f.pitch_lag = DIVIDE_BY_3(pitch_delay_3x+1);
-        ctx->pitch_lag_prev = f.pitch_lag;
-
-        pitch_delay_int  = DIVIDE_BY_3(pitch_delay_3x + 2);
-        pitch_delay_frac = pitch_delay_3x + 2 - 3*pitch_delay_int;
-
-        ff_acelp_interpolatef(&excitation[i_subfr],
-                              &excitation[i_subfr] - pitch_delay_int + 1,
-                              sinc_win, 3, pitch_delay_frac + 1,
-                              LP_FILTER_ORDER, L_SUBFR_16k);
-
-
-        memset(fixed_vector, 0, sizeof(fixed_vector));
-
-        ff_decode_10_pulses_35bits(params->fc_indexes[i], &f,
-                                   ff_fc_4pulses_8bits_tracks_13, 5, 4);
-
-        ff_set_fixed_vector(fixed_vector, &f, 1.0, L_SUBFR_16k);
-
-        gain_corr_factor = gain_cb_16k[params->gc_index[i]];
-        gain_code = gain_corr_factor *
-            acelp_decode_gain_codef(sqrt(L_SUBFR_16k), fixed_vector,
-                                    19.0 - 15.0/(0.05*M_LN10/M_LN2),
-                                    pred_16k, ctx->energy_history,
-                                    L_SUBFR_16k, 2);
-
-        ctx->energy_history[1] = ctx->energy_history[0];
-        ctx->energy_history[0] = 20.0 * log10f(gain_corr_factor);
-
-        ff_weighted_vector_sumf(&excitation[i_subfr], &excitation[i_subfr],
-                                fixed_vector, pitch_fac,
-                                gain_code, L_SUBFR_16k);
-
-        ff_celp_lp_synthesis_filterf(synth + i_subfr, Az[i],
-                                     &excitation[i_subfr], L_SUBFR_16k,
-                                     LP_FILTER_ORDER_16k);
-
-    }
-    memcpy(ctx->synth, synth + frame_size - LP_FILTER_ORDER_16k,
-           LP_FILTER_ORDER_16k * sizeof(*synth));
-
-    memmove(ctx->excitation, ctx->excitation + 2 * L_SUBFR_16k,
-            (L_INTERPOL+PITCH_MAX) * sizeof(float));
-
-    postfilter(out_data, synth, ctx->iir_mem, ctx->filt_mem, ctx->mem_preemph);
-
-    memcpy(ctx->iir_mem, Az[1], LP_FILTER_ORDER_16k * sizeof(float));
-}
-
-av_cold void ff_sipr_init_16k(SiprContext *ctx)
-{
-    int i;
-
-    for (i = 0; i < LP_FILTER_ORDER_16k; i++)
-        ctx->lsp_history_16k[i] = cos((i + 1) * M_PI/(LP_FILTER_ORDER_16k + 1));
-
-    ctx->filt_mem[0] = ctx->filt_buf[0];
-    ctx->filt_mem[1] = ctx->filt_buf[1];
-
-    ctx->pitch_lag_prev = 180;
-}
diff --git a/deps/libav/libavcodec/sipr16kdata.h b/deps/libav/libavcodec/sipr16kdata.h
deleted file mode 100644
index ec60c29..0000000
--- a/deps/libav/libavcodec/sipr16kdata.h
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
- * SIPR decoder for the 16k mode
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SIPR16KDATA_H
-#define AVCODEC_SIPR16KDATA_H
-
-static const float pred_16k[2] = {0.8, 0.6};
-static const float qu[2] = { 0.12, 0.5};
-
-static const float gain_cb_16k[32] = {
-    0.07499,  0.10593,  0.14125,  0.18836,
-    0.23714,  0.28184,  0.32734,  0.37584,
-    0.42170,  0.47315,  0.53088,  0.59566,
-    0.66834,  0.74989,  0.84140,  0.94406,
-    1.05925,  1.18850,  1.33352,  1.49624,
-    1.67880,  1.88365,  2.11349,  2.37137,
-    2.66073,  3.05492,  3.54813,  4.21697,
-    5.30884,  7.07946,  9.44061, 13.33521,
-};
-
-static const float gain_pitch_cb_16k[16] = {
-    0.00, 0.2, 0.40, 0.5, 0.60, 0.7, 0.75, 0.8,
-    0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2,
-};
-
-
-static const float mean_lsf_16k[16] = {
-    0.131554,  0.246615,  0.435896,  0.644419,
-    0.827810,  1.017876,  1.198910,  1.379159,
-    1.562157,  1.736908,  1.940719,  2.131963,
-    2.347162,  2.521521,  2.717870,  2.847068
-};
-
-/**
- * Hamming windowed sinc function, like in AMR
- */
-static const float sinc_win[40] = {
-     0.874475,  0.755101,  0.455962,  0.118807, -0.114223, -0.176778,
-    -0.101923,  0.015553,  0.086555,  0.078193,  0.018660, -0.037513,
-    -0.052733, -0.027459,  0.009967,  0.030278,  0.024050,  0.003055,
-    -0.013862, -0.016162, -0.006725,  0.004212,  0.008634,  0.005721,
-    -0.000000, -0.003710, -0.003690, -0.001228,  0.001409,  0.002610,
-};
-
-static const float lsf_cb1_16k[128][3] = {
-    {-0.089990, -0.172485, -0.203391}, {-0.094710, -0.178687, -0.134483},
-    {-0.056398, -0.131952, -0.154500}, {-0.051362, -0.128138, -0.198549},
-    {-0.061700, -0.142830, -0.251623}, {-0.041512, -0.115637, -0.229420},
-    {-0.036544, -0.107512, -0.173125}, {-0.024158, -0.088450, -0.204144},
-    {-0.038690, -0.103368, -0.132674}, {-0.056954, -0.128472, -0.104669},
-    {-0.020963, -0.076785, -0.163199}, {-0.012952, -0.077249, -0.128385},
-    {-0.032787, -0.097044, -0.093967}, {-0.035214, -0.053838, -0.111940},
-    {-0.013850, -0.036926, -0.139328}, {-0.004956, -0.065092, -0.087709},
-    {-0.065354, -0.065595, -0.079064}, {-0.023627, -0.081457, -0.054195},
-    {-0.027335, -0.035244, -0.068034}, { 0.016555, -0.047075, -0.128286},
-    { 0.021066, -0.037252, -0.092041}, { 0.014681, -0.043044, -0.057739},
-    {-0.008493, -0.008143, -0.102486}, {-0.002303, -0.061540, -0.022952},
-    {-0.006061, -0.014278, -0.033652}, {-0.005276,  0.011246, -0.062762},
-    { 0.043411, -0.006303, -0.063730}, { 0.035885, -0.010052, -0.115290},
-    { 0.030628, -0.031538, -0.017807}, { 0.022345,  0.028210, -0.032335},
-    { 0.026535,  0.027536, -0.091150}, {-0.003365, -0.008077,  0.015687},
-    {-0.026013,  0.017493, -0.010355}, { 0.059069,  0.010634, -0.007530},
-    { 0.044038, -0.019424,  0.030453}, {-0.036065, -0.034215, -0.007758},
-    { 0.022486,  0.042543,  0.027870}, {-0.049985, -0.016085,  0.021768},
-    {-0.021715,  0.021168,  0.052076}, {-0.004243, -0.061228,  0.027640},
-    {-0.033950, -0.017287,  0.064656}, { 0.016151,  0.000727,  0.062757},
-    {-0.063456, -0.043152,  0.056707}, {-0.067715,  0.006126,  0.058178},
-    {-0.038931,  0.051673,  0.030636}, {-0.073017, -0.074716,  0.026387},
-    {-0.039893, -0.104629,  0.039616}, {-0.073179, -0.074601,  0.082069},
-    {-0.066154, -0.027180,  0.099439}, {-0.075167, -0.121149,  0.071938},
-    {-0.030382, -0.092582,  0.091067}, {-0.084519, -0.137542,  0.023626},
-    {-0.060956, -0.121259, -0.015264}, {-0.030069, -0.093823, -0.008692},
-    {-0.063564, -0.065225, -0.025820}, {-0.052074, -0.117595, -0.059689},
-    {-0.091652, -0.165173, -0.045573}, {-0.070167, -0.121342,  0.131707},
-    {-0.061024, -0.005833, -0.051035}, { 0.007837, -0.051816,  0.074575},
-    {-0.070643, -0.053927,  0.149498}, {-0.014358, -0.066681,  0.139708},
-    {-0.058186,  0.029576,  0.092923}, {-0.023371,  0.007058,  0.112484},
-    {-0.057969,  0.022786,  0.148420}, { 0.029439, -0.017673,  0.121423},
-    {-0.015811,  0.056785,  0.091594}, { 0.004347,  0.056680,  0.137848},
-    {-0.004464,  0.002342,  0.184013}, { 0.029660,  0.046870,  0.082654},
-    { 0.059408,  0.001016,  0.086063}, { 0.055263,  0.027574,  0.155037},
-    { 0.062166,  0.064323,  0.117371}, { 0.022967,  0.100050,  0.077227},
-    { 0.041795,  0.096343,  0.170421}, { 0.053189,  0.122931,  0.118549},
-    { 0.094247,  0.094448,  0.078395}, { 0.082407,  0.033408,  0.041085},
-    { 0.096820,  0.115960,  0.149433}, { 0.067804,  0.121849,  0.025336},
-    {-0.008421,  0.104316,  0.032314}, { 0.031013,  0.073218, -0.004899},
-    { 0.085079,  0.060323, -0.009687}, { 0.028174,  0.092766, -0.055590},
-    { 0.070133,  0.039160, -0.061035}, {-0.039211,  0.072517, -0.028756},
-    { 0.129686,  0.100233, -0.046998}, { 0.154189,  0.107616,  0.022791},
-    {-0.049331,  0.094184,  0.087984}, {-0.013179,  0.126552,  0.125099},
-    {-0.058716,  0.098524,  0.150886}, {-0.022753,  0.080011,  0.191127},
-    { 0.013451,  0.164593,  0.153768}, { 0.074818,  0.181214,  0.108211},
-    { 0.091323,  0.169249,  0.168460}, { 0.033885,  0.155516,  0.213745},
-    {-0.032128,  0.227238,  0.135815}, {-0.059176,  0.168980,  0.229110},
-    { 0.033917,  0.229753,  0.222264}, { 0.082702,  0.116370,  0.224697},
-    { 0.127737,  0.186658,  0.212783}, { 0.047528,  0.063920,  0.216856},
-    {-0.002446,  0.114174,  0.263289}, {-0.077783,  0.082523,  0.249697},
-    { 0.010023,  0.024267,  0.256874}, { 0.053190,  0.111422,  0.310407},
-    {-0.078804,  0.004444,  0.224078}, {-0.055253, -0.059180,  0.217892},
-    {-0.065371,  0.008124,  0.333405}, {-0.076188, -0.098767,  0.286983},
-    {-0.071911, -0.115804,  0.198031}, {-0.062473,  0.183639,  0.370162},
-    {-0.042666,  0.255210,  0.262720}, { 0.011999,  0.217530,  0.318291},
-    {-0.042144,  0.322087,  0.326387}, { 0.090663,  0.205835,  0.294784},
-    { 0.058218,  0.293649,  0.277927}, { 0.157506,  0.282870,  0.294610},
-    { 0.118248,  0.261007,  0.148614}, { 0.065261,  0.332362,  0.411912},
-    { 0.141269,  0.451850,  0.315726}, { 0.001706,  0.456301,  0.357590},
-    {-0.052947,  0.356559,  0.456944}, { 0.247707,  0.263837,  0.152591},
-    { 0.306847,  0.417373,  0.258553}, { 0.166347,  0.149222,  0.118973},
-    { 0.379709,  0.292172,  0.139875}, { 0.010171, -0.055170, -0.174523}
-};
-
-static const float lsf_cb2_16k[256][3] = {
-    {-0.213011, -0.293385, -0.330597}, {-0.212582, -0.240992, -0.338239},
-    {-0.223373, -0.306214, -0.277192}, {-0.231138, -0.287729, -0.229412},
-    {-0.238466, -0.228571, -0.260954}, {-0.140931, -0.247018, -0.258566},
-    {-0.136239, -0.249669, -0.350143}, {-0.149738, -0.192970, -0.281475},
-    {-0.167058, -0.261052, -0.196301}, {-0.177049, -0.201324, -0.207897},
-    {-0.116915, -0.200629, -0.212526}, {-0.162247, -0.143805, -0.245093},
-    {-0.082042, -0.191842, -0.266338}, {-0.098846, -0.208511, -0.320481},
-    {-0.113510, -0.152470, -0.222474}, {-0.066197, -0.179112, -0.207813},
-    {-0.129490, -0.169320, -0.155238}, {-0.078843, -0.190292, -0.155172},
-    {-0.087790, -0.147729, -0.169351}, {-0.141037, -0.127207, -0.177910},
-    {-0.126525, -0.223961, -0.153639}, {-0.101464, -0.189953, -0.114559},
-    {-0.102450, -0.106303, -0.151171}, {-0.103208, -0.144457, -0.105378},
-    {-0.170794, -0.140525, -0.136428}, {-0.168641, -0.203064, -0.135368},
-    {-0.138193, -0.116042, -0.111905}, {-0.145085, -0.168581, -0.092613},
-    {-0.126379, -0.220431, -0.091327}, {-0.212934, -0.184797, -0.101632},
-    {-0.193711, -0.140556, -0.078304}, {-0.173674, -0.197276, -0.060140},
-    {-0.197897, -0.241907, -0.091997}, {-0.156037, -0.258519, -0.111628},
-    {-0.241964, -0.191124, -0.063140}, {-0.261340, -0.240847, -0.103132},
-    {-0.221621, -0.242972, -0.041255}, {-0.224166, -0.232742, -0.161568},
-    {-0.203591, -0.294470, -0.126035}, {-0.209540, -0.303149, -0.053170},
-    {-0.253859, -0.295066, -0.156050}, {-0.278143, -0.331105, -0.085237},
-    {-0.300273, -0.198750, -0.094834}, {-0.260477, -0.169713, -0.132476},
-    {-0.211889, -0.172454, -0.164281}, {-0.228370, -0.122149, -0.124178},
-    {-0.254629, -0.135668, -0.081692}, {-0.263813, -0.154928, -0.213596},
-    {-0.308224, -0.106877, -0.084404}, {-0.242644, -0.082862, -0.085835},
-    {-0.252084, -0.064888, -0.146498}, {-0.198162, -0.105721, -0.188887},
-    {-0.189238, -0.088028, -0.109736}, {-0.197598, -0.099831, -0.044030},
-    {-0.269017, -0.105991, -0.021513}, {-0.231349, -0.058825, -0.041407},
-    {-0.225589, -0.027501, -0.087160}, {-0.160347, -0.058341, -0.079789},
-    {-0.158729, -0.108951, -0.067262}, {-0.170483, -0.053023, -0.017561},
-    {-0.175207, -0.013649, -0.049513}, {-0.156004, -0.108378, -0.004052},
-    {-0.219958, -0.082362,  0.014950}, {-0.217785, -0.012981, -0.009410},
-    {-0.123290, -0.040849, -0.040910}, {-0.119861, -0.095078, -0.060246},
-    {-0.117537, -0.065479,  0.002968}, {-0.103231, -0.113298, -0.023282},
-    {-0.136365, -0.149524, -0.051387}, {-0.119332, -0.164400, -0.009103},
-    {-0.104522, -0.060948, -0.083056}, {-0.071461, -0.070787, -0.037347},
-    {-0.081116, -0.149015, -0.056740}, {-0.069561, -0.108099, -0.069167},
-    {-0.055624, -0.117369, -0.025091}, {-0.091941, -0.190091, -0.060020},
-    {-0.072003, -0.168433, -0.006540}, {-0.033305, -0.154427, -0.054608},
-    {-0.062988, -0.127093, -0.108307}, {-0.056690, -0.170813, -0.102834},
-    {-0.018273, -0.127863, -0.094998}, {-0.056239, -0.123678, -0.146262},
-    {-0.023442, -0.154617, -0.137417}, {-0.051903, -0.078379, -0.093395},
-    {-0.014599, -0.104412, -0.135959}, {-0.051582, -0.081280, -0.140643},
-    {-0.092727, -0.091930, -0.107816}, {-0.024814, -0.140993, -0.183243},
-    {-0.064307, -0.113024, -0.194788}, {-0.000118, -0.098858, -0.195336},
-    {-0.028090, -0.048258, -0.164101}, {-0.093414, -0.055969, -0.172743},
-    {-0.114445, -0.104336, -0.215204}, {-0.048518, -0.132063, -0.242991},
-    {-0.159620, -0.060240, -0.178592}, {-0.135728, -0.067473, -0.131876},
-    {-0.078464, -0.038040, -0.125105}, {-0.011061, -0.064011, -0.102496},
-    {-0.033887, -0.026485, -0.109493}, {-0.129128, -0.014216, -0.111329},
-    {-0.190687, -0.030660, -0.135825}, {-0.082037,  0.010997, -0.100167},
-    {-0.183403,  0.001651, -0.098962}, {-0.074775, -0.030335, -0.062217},
-    {-0.031759, -0.050551, -0.059420}, {-0.051439,  0.010827, -0.052148},
-    {-0.126744,  0.008689, -0.047785}, {-0.145916,  0.042019, -0.077431},
-    {-0.093552,  0.054143, -0.060473}, {-0.090660,  0.012868, -0.018195},
-    {-0.079783, -0.033071,  0.001482}, {-0.033010, -0.022331, -0.014506},
-    {-0.004798, -0.017339, -0.060120}, {-0.025021,  0.026390, -0.003263},
-    {-0.001437,  0.025994, -0.040892}, {-0.074821,  0.019005,  0.027549},
-    {-0.030811, -0.012114,  0.034284}, { 0.006785,  0.004618,  0.018717},
-    { 0.013392, -0.032597, -0.023731}, { 0.035994,  0.005963, -0.011757},
-    { 0.008071, -0.045750,  0.024889}, { 0.013055,  0.017040,  0.054121},
-    {-0.012989,  0.044864,  0.036327}, { 0.025054,  0.047137,  0.009974},
-    { 0.053801,  0.024178,  0.031774}, { 0.056442, -0.030647,  0.021291},
-    { 0.032247,  0.052680,  0.049886}, { 0.035369,  0.090207,  0.031394},
-    { 0.064720,  0.070390,  0.040938}, { 0.022112,  0.054834,  0.091059},
-    { 0.041765,  0.086248,  0.070196}, { 0.070645,  0.060852,  0.078825},
-    { 0.058506,  0.016920,  0.081612}, { 0.000009,  0.086500,  0.059849},
-    { 0.071253,  0.107392,  0.059046}, { 0.094702,  0.096160,  0.090982},
-    { 0.047639,  0.110877,  0.111227}, { 0.122444,  0.090909,  0.057396},
-    { 0.101916,  0.052299,  0.029909}, { 0.076560,  0.086094, -0.007252},
-    { 0.123411,  0.030769,  0.082749}, { 0.135579,  0.103022,  0.009540},
-    { 0.120576,  0.065284, -0.024095}, { 0.077483,  0.028526, -0.012369},
-    { 0.128747,  0.017901, -0.003874}, { 0.158254,  0.046962,  0.029577},
-    { 0.102287, -0.002211,  0.037329}, { 0.089654, -0.021372, -0.006857},
-    { 0.137917,  0.027228, -0.053223}, { 0.098728, -0.012192, -0.048518},
-    { 0.083974,  0.036153, -0.062266}, { 0.048230, -0.010241, -0.052293},
-    { 0.110135,  0.007715, -0.095233}, { 0.068294, -0.014317, -0.104029},
-    { 0.063909, -0.056416, -0.063023}, { 0.059133, -0.044675, -0.023780},
-    { 0.030748,  0.021845, -0.086332}, { 0.023994, -0.045574, -0.076232},
-    { 0.052147, -0.059825, -0.109667}, { 0.013087, -0.020420, -0.121945},
-    { 0.018163, -0.096765, -0.088758}, { 0.020196, -0.076470, -0.048112},
-    { 0.020282, -0.084204, -0.135535}, { 0.040076, -0.053464, -0.161949},
-    {-0.017796, -0.103070, -0.059559}, {-0.016484, -0.070138, -0.016866},
-    { 0.004849, -0.112481, -0.017731}, { 0.040160, -0.073873, -0.005327},
-    { 0.002202, -0.094723,  0.045366}, {-0.056918, -0.081578,  0.017875},
-    {-0.031099, -0.141708,  0.009186}, {-0.102802, -0.122675,  0.030060},
-    {-0.061717, -0.145116,  0.076680}, {-0.073607, -0.050464,  0.072853},
-    {-0.117403, -0.194921,  0.040101}, {-0.185236, -0.133620,  0.045939},
-    {-0.160174, -0.057226,  0.056641}, {-0.178489, -0.173435, -0.007806},
-    {-0.199916, -0.204866,  0.047342}, {-0.152337, -0.249651,  0.034656},
-    {-0.185637, -0.230942, -0.002072}, {-0.122548, -0.215209, -0.024552},
-    {-0.249578, -0.209714,  0.009470}, {-0.160108, -0.257702, -0.040992},
-    {-0.216694, -0.289353,  0.027182}, {-0.226390, -0.147844, -0.022742},
-    {-0.288737, -0.272150, -0.013948}, {-0.262554, -0.237035,  0.072473},
-    {-0.306267, -0.188335, -0.032894}, {-0.259666, -0.345816,  0.024138},
-    {-0.271093, -0.137143,  0.040404}, {-0.201317, -0.286782,  0.107615},
-    {-0.235725, -0.163396,  0.113844}, {-0.159988, -0.209788,  0.112140},
-    {-0.262985, -0.056741,  0.093506}, {-0.277226, -0.037306,  0.016008},
-    {-0.293486, -0.040422, -0.062018}, {-0.214921,  0.022900,  0.055295},
-    {-0.253889,  0.058575, -0.000151}, {-0.246689,  0.024242, -0.058488},
-    {-0.143790,  0.006767,  0.014061}, {-0.187077,  0.048882, -0.035625},
-    {-0.196369,  0.112085,  0.031546}, {-0.124264,  0.086197, -0.020800},
-    {-0.126249,  0.016960,  0.095741}, {-0.079816,  0.080398,  0.051038},
-    {-0.056269,  0.075380, -0.028262}, {-0.120493,  0.148495,  0.028430},
-    {-0.161750,  0.101290,  0.117806}, {-0.003247,  0.083393, -0.017061},
-    {-0.034007,  0.142542,  0.007402}, {-0.037618,  0.025871,  0.089496},
-    {-0.082819,  0.184435,  0.073224}, { 0.006448,  0.167015,  0.080548},
-    { 0.035315,  0.144022,  0.003218}, {-0.023459,  0.088147,  0.152604},
-    { 0.006247, -0.024099,  0.077792}, { 0.039894,  0.057586, -0.042455},
-    {-0.020417,  0.035400, -0.093971}, { 0.075465,  0.052063,  0.145582},
-    { 0.078027,  0.184720,  0.092096}, { 0.107295,  0.148380,  0.022264},
-    { 0.066928, -0.052831,  0.065108}, { 0.093295,  0.118157,  0.149815},
-    { 0.119373,  0.137114,  0.099536}, { 0.138653,  0.075509,  0.121545},
-    { 0.174025,  0.077531,  0.077169}, { 0.165839,  0.150080,  0.133423},
-    { 0.173276,  0.155887,  0.048150}, { 0.162910,  0.095898,  0.171896},
-    { 0.214577,  0.112888,  0.115579}, { 0.204755,  0.106392,  0.032337},
-    { 0.178853,  0.205034,  0.114760}, { 0.177401,  0.070504, -0.013778},
-    { 0.241624,  0.166921,  0.066087}, { 0.219595,  0.183553,  0.172332},
-    { 0.123671,  0.170842,  0.167216}, { 0.177104,  0.240197,  0.186359},
-    { 0.272003,  0.220214,  0.126073}, { 0.093748,  0.235843,  0.160998},
-    { 0.141510,  0.190012,  0.240416}, { 0.046878,  0.168984,  0.190412},
-    { 0.094898,  0.107038,  0.235003}, { 0.108592,  0.269536,  0.262528},
-    {-0.027754,  0.234355,  0.134544}, { 0.265127,  0.267540,  0.199041},
-    { 0.199523,  0.291507,  0.265171}, { 0.266177,  0.209339,  0.350369},
-    { 0.322159,  0.344794,  0.270823}, { 0.399957,  0.264065,  0.110387},
-    { 0.277817,  0.127407, -0.035625}, {-0.177038,  0.208155,  0.119077},
-    { 0.049075, -0.076294,  0.145711}, { 0.187246,  0.042865, -0.127097},
-    { 0.117885, -0.023489, -0.138658}, {-0.284256,  0.068153,  0.124259}
-};
-
-static const float lsf_cb3_16k[128][3] = {
-    {-0.223412, -0.236300, -0.188067}, {-0.202286, -0.218711, -0.102947},
-    {-0.251652, -0.161020, -0.125280}, {-0.169223, -0.138155, -0.140430},
-    {-0.176427, -0.146628, -0.222632}, {-0.120584, -0.187276, -0.180164},
-    {-0.195559, -0.074225, -0.169109}, {-0.144551, -0.142774, -0.073340},
-    {-0.111001, -0.111310, -0.130696}, {-0.095221, -0.174684, -0.111841},
-    {-0.112158, -0.103049, -0.195130}, {-0.059989, -0.142170, -0.157850},
-    {-0.127598, -0.051759, -0.153109}, {-0.063753, -0.067898, -0.164117},
-    {-0.141753, -0.068274, -0.091999}, {-0.060482, -0.101054, -0.099475},
-    {-0.104699, -0.104456, -0.066496}, {-0.073649, -0.052614, -0.091612},
-    {-0.088268, -0.019072, -0.129956}, {-0.018837, -0.104115, -0.127837},
-    {-0.021630, -0.033055, -0.129868}, {-0.083768, -0.047549, -0.041407},
-    {-0.055892, -0.108526, -0.043200}, {-0.027816, -0.062499, -0.048190},
-    {-0.002248, -0.110428, -0.062868}, { 0.001270, -0.033245, -0.072404},
-    {-0.042747, -0.013835, -0.033829}, {-0.037615, -0.147833, -0.083912},
-    {-0.045023,  0.006011, -0.092182}, {-0.050411, -0.081832,  0.005787},
-    { 0.000357, -0.104282, -0.009428}, {-0.003893, -0.047892, -0.001506},
-    {-0.040077, -0.147110, -0.009065}, {-0.060858, -0.030972,  0.012999},
-    {-0.014674,  0.001370,  0.005554}, {-0.101362, -0.126061, -0.001898},
-    {-0.102519, -0.000390, -0.015721}, {-0.132687, -0.069608, -0.019928},
-    {-0.102227, -0.076131,  0.043306}, {-0.055193,  0.027001,  0.011857},
-    {-0.156427, -0.016629,  0.017480}, {-0.078736,  0.002809,  0.057979},
-    {-0.157789, -0.016693, -0.055073}, {-0.179397, -0.095520,  0.022065},
-    {-0.110219,  0.010408, -0.081927}, {-0.125392,  0.049111,  0.044595},
-    {-0.112528,  0.063173, -0.024954}, {-0.185525,  0.053093, -0.032102},
-    {-0.176887, -0.019379, -0.115125}, {-0.249706, -0.017664, -0.059188},
-    {-0.200243, -0.103311, -0.066846}, {-0.055404,  0.045106, -0.046991},
-    {-0.000544,  0.022690, -0.044831}, { 0.022298, -0.016367, -0.022509},
-    { 0.028278,  0.017585, -0.100612}, { 0.061781, -0.020826, -0.068190},
-    { 0.029157, -0.074477, -0.098898}, { 0.043073, -0.067234, -0.032293},
-    { 0.060157,  0.034636, -0.034885}, { 0.071153, -0.013881, -0.009036},
-    { 0.054196, -0.029989, -0.131139}, { 0.030193,  0.024976,  0.009861},
-    { 0.055943, -0.045304,  0.031927}, { 0.033217, -0.002418,  0.038165},
-    { 0.063814,  0.045625,  0.025309}, { 0.033689,  0.038819,  0.049700},
-    { 0.073582,  0.028527,  0.060200}, {-0.007957,  0.022531,  0.043687},
-    {-0.000984,  0.054518,  0.018742}, { 0.057004,  0.060916,  0.060573},
-    { 0.009883,  0.015238,  0.080211}, { 0.022742,  0.070832,  0.068855},
-    { 0.053001,  0.029790,  0.091446}, {-0.042447,  0.060379,  0.061462},
-    { 0.076826,  0.062468,  0.089653}, { 0.039065,  0.069768,  0.119128},
-    { 0.064145,  0.095353,  0.071621}, { 0.094411,  0.069527,  0.054197},
-    { 0.042812,  0.093060,  0.027980}, { 0.094791,  0.099189,  0.101112},
-    { 0.117611,  0.048601,  0.093111}, { 0.119951,  0.122758,  0.051546},
-    { 0.103558,  0.085245, -0.010700}, { 0.150126,  0.059766,  0.020280},
-    { 0.108066,  0.017170,  0.008606}, { 0.108422,  0.023253, -0.063942},
-    { 0.019652,  0.072284, -0.030331}, { 0.192719,  0.075624,  0.071156},
-    { 0.221140,  0.069191, -0.035085}, { 0.188367,  0.126200,  0.035225},
-    { 0.185760,  0.043537, -0.101714}, {-0.042518,  0.099646,  0.003244},
-    {-0.015308, -0.027521,  0.046006}, { 0.034086, -0.045777,  0.095989},
-    { 0.007174, -0.093358,  0.046459}, {-0.051248, -0.062095,  0.083161},
-    {-0.045626, -0.133301,  0.052997}, {-0.037840,  0.024042,  0.131097},
-    {-0.020217, -0.115942,  0.126170}, {-0.134550, -0.036291,  0.111322},
-    {-0.110576, -0.160024,  0.091841}, {-0.093308, -0.184958,  0.013939},
-    {-0.082735, -0.167417, -0.051725}, {-0.169934, -0.173003, -0.007155},
-    {-0.128244, -0.213123, -0.053337}, {-0.079852, -0.154116, -0.246546},
-    {-0.032242, -0.108756, -0.204133}, {-0.140117, -0.199495, -0.284505},
-    { 0.010842, -0.074979, -0.166333}, {-0.093313,  0.145006,  0.034110},
-    {-0.039236,  0.113213,  0.111053}, { 0.040613, -0.031783,  0.174058},
-    {-0.164232,  0.131421,  0.149842}, { 0.026893,  0.107281,  0.179297},
-    { 0.047086,  0.158606,  0.103267}, {-0.070567,  0.210459,  0.134734},
-    { 0.094392,  0.137050,  0.166892}, { 0.086039,  0.063657,  0.168825},
-    { 0.159371,  0.120897,  0.154357}, { 0.147101,  0.160684,  0.114882},
-    { 0.120158,  0.199650,  0.180948}, { 0.191417,  0.174500,  0.170734},
-    { 0.159153,  0.142165,  0.233347}, { 0.232002,  0.150181,  0.102736},
-    { 0.188299,  0.221738,  0.228748}, { 0.256786,  0.209685,  0.161534},
-    { 0.257861,  0.247793,  0.250516}, {-0.164461, -0.000143,  0.232461}
-};
-
-static const float lsf_cb4_16k[128][3] = {
-    {-0.193369, -0.304643, -0.253777}, {-0.164125, -0.277786, -0.153116},
-    {-0.135681, -0.209120, -0.211724}, {-0.121822, -0.215734, -0.292207},
-    {-0.198781, -0.161674, -0.242538}, {-0.164147, -0.180570, -0.138070},
-    {-0.095915, -0.198695, -0.154309}, {-0.248386, -0.234462, -0.136984},
-    {-0.164968, -0.108318, -0.175635}, {-0.124171, -0.111809, -0.224402},
-    {-0.067398, -0.157017, -0.195759}, {-0.090132, -0.119174, -0.165253},
-    {-0.099460, -0.146895, -0.106799}, {-0.141493, -0.108103, -0.108880},
-    {-0.085088, -0.098340, -0.109953}, {-0.105526, -0.054463, -0.154315},
-    {-0.040480, -0.144285, -0.124042}, {-0.040969, -0.084039, -0.142880},
-    {-0.049082, -0.118553, -0.066686}, {-0.096336, -0.087515, -0.055741},
-    {-0.058605, -0.059327, -0.089275}, {-0.121842, -0.058681, -0.086949},
-    {-0.053792, -0.022025, -0.124451}, {-0.036744, -0.068891, -0.045865},
-    { 0.003900, -0.098237, -0.091158}, {-0.001664, -0.045089, -0.081353},
-    {-0.072829, -0.034087, -0.038416}, {-0.100822, -0.007330, -0.088715},
-    {-0.035911, -0.005864, -0.062577}, {-0.020205, -0.026547, -0.019634},
-    { 0.004291, -0.041290, -0.138181}, { 0.023404, -0.010932, -0.044904},
-    { 0.013557,  0.014823, -0.092943}, { 0.059673, -0.031024, -0.095739},
-    { 0.021130, -0.080607, -0.034594}, { 0.024655, -0.035564,  0.003243},
-    { 0.017106,  0.006952, -0.000308}, { 0.075208, -0.030910, -0.031181},
-    { 0.024965,  0.048632, -0.039448}, { 0.057028,  0.021547, -0.009418},
-    {-0.018577,  0.023697, -0.009759}, { 0.024077,  0.033053,  0.024324},
-    { 0.037052, -0.003436,  0.044530}, {-0.012871, -0.007179,  0.031795},
-    { 0.077877,  0.021547,  0.023131}, { 0.053365,  0.052078,  0.029433},
-    { 0.011429,  0.070426,  0.028734}, {-0.001827,  0.033115,  0.061505},
-    {-0.044870,  0.038568,  0.026239}, { 0.061633,  0.034799,  0.059784},
-    { 0.034261,  0.060342,  0.065185}, { 0.058981,  0.082481,  0.047252},
-    { 0.090008,  0.065942,  0.044470}, { 0.066961,  0.073728, -0.000428},
-    { 0.074763,  0.060293,  0.085632}, { 0.066366,  0.103375,  0.079642},
-    { 0.122297,  0.036558,  0.058745}, { 0.111042,  0.092093,  0.085412},
-    { 0.099243,  0.115476,  0.039254}, { 0.019973,  0.122844,  0.050255},
-    { 0.159571,  0.098965,  0.051740}, { 0.137624,  0.072405, -0.006922},
-    { 0.130240,  0.146091,  0.089698}, { 0.138335,  0.092968,  0.136193},
-    { 0.066031,  0.149304,  0.125476}, { 0.202749,  0.145751,  0.077122},
-    { 0.002224,  0.082811,  0.131200}, { 0.124476,  0.178073,  0.162336},
-    { 0.174722,  0.190298,  0.127106}, { 0.202193,  0.153569,  0.163840},
-    { 0.242604,  0.197796,  0.136929}, { 0.185809,  0.229348,  0.193353},
-    {-0.058814,  0.195178,  0.141821}, { 0.253646,  0.247175,  0.205766},
-    { 0.061433, -0.025542,  0.119311}, {-0.057816,  0.082445,  0.073243},
-    {-0.069239,  0.148678,  0.031146}, {-0.030217, -0.008503,  0.106194},
-    {-0.026708,  0.087469, -0.009589}, {-0.090418,  0.000265,  0.056807},
-    {-0.050607, -0.019383,  0.010494}, {-0.079397,  0.008233, -0.011469},
-    {-0.072634, -0.061165,  0.046917}, {-0.075741, -0.072343, -0.007557},
-    {-0.025162, -0.073363,  0.005173}, {-0.123371, -0.041257, -0.008375},
-    {-0.139904,  0.018285,  0.009920}, {-0.143421, -0.104238,  0.033457},
-    {-0.100923, -0.134400, -0.023257}, {-0.157791, -0.095042, -0.036959},
-    {-0.219890, -0.078637,  0.001815}, {-0.183607, -0.023053, -0.043678},
-    {-0.145303, -0.158923, -0.059045}, {-0.197615, -0.165199,  0.028099},
-    {-0.225131, -0.167756, -0.056401}, {-0.216572, -0.104751, -0.102964},
-    {-0.171336, -0.241967, -0.063404}, {-0.134035, -0.205614,  0.011831},
-    {-0.297116, -0.211173, -0.015352}, {-0.086464, -0.200592, -0.070454},
-    {-0.217777, -0.278403,  0.030398}, {-0.236248, -0.323694, -0.087588},
-    {-0.222074, -0.210785,  0.106210}, {-0.283400, -0.097077,  0.041303},
-    {-0.078417, -0.154464,  0.062956}, {-0.214417, -0.100695,  0.121909},
-    {-0.178576, -0.028847,  0.061042}, {-0.037999, -0.144233, -0.010546},
-    {-0.086695, -0.070996,  0.125282}, { 0.010788, -0.085006,  0.058527},
-    {-0.154015,  0.066560,  0.071038}, {-0.143503,  0.033260,  0.154393},
-    {-0.134069,  0.032420, -0.056293}, {-0.110851,  0.086908,  0.003920},
-    {-0.057254,  0.047674, -0.055571}, {-0.214206,  0.068784, -0.004735},
-    {-0.257264,  0.050468,  0.081702}, {-0.291834,  0.004120, -0.022366},
-    {-0.173309, -0.029081, -0.115901}, {-0.207622,  0.168664,  0.136030},
-    { 0.090541,  0.032754, -0.057330}, { 0.140219, -0.000735, -0.015633},
-    { 0.136697, -0.017163, -0.100909}, { 0.029838, -0.089515, -0.147130},
-    {-0.055367, -0.072683, -0.214015}, { 0.048680, -0.057633, -0.212429},
-    {-0.013134, -0.113898, -0.196403}, {-0.071702, -0.159408, -0.254895}
-};
-
-static const float lsf_cb5_16k[128][4] = {
-    {-0.201277, -0.278679, -0.173262, -0.198580},
-    {-0.214667, -0.151922, -0.117551, -0.192713},
-    {-0.160962, -0.207728, -0.124750, -0.129749},
-    {-0.131043, -0.137818, -0.155281, -0.166308},
-    {-0.179134, -0.169602, -0.165223, -0.066293},
-    {-0.136474, -0.177035, -0.250127, -0.134370},
-    {-0.066970, -0.146274, -0.170638, -0.134436},
-    {-0.083288, -0.165860, -0.103437, -0.140361},
-    {-0.130474, -0.119317, -0.124393, -0.086408},
-    {-0.127609, -0.134415, -0.073592, -0.116103},
-    {-0.113027, -0.091756, -0.107786, -0.131935},
-    {-0.125530, -0.182152, -0.093796, -0.045088},
-    {-0.077122, -0.138052, -0.166271, -0.038886},
-    {-0.073027, -0.106845, -0.067073, -0.113910},
-    {-0.049146, -0.107019, -0.112531, -0.063388},
-    {-0.101539, -0.119586, -0.050297, -0.040670},
-    {-0.107784, -0.066913, -0.080993, -0.052352},
-    {-0.152155, -0.103010, -0.090461, -0.015526},
-    {-0.153087, -0.087656, -0.029889, -0.037367},
-    {-0.215281, -0.138062, -0.089162, -0.050839},
-    {-0.053350, -0.060169, -0.063459, -0.024499},
-    {-0.051674, -0.076355, -0.033733, -0.077211},
-    {-0.045047, -0.107006, -0.020880, -0.024525},
-    {-0.083003, -0.063672, -0.013243, -0.028324},
-    {-0.104104, -0.075450, -0.032746,  0.024480},
-    {-0.085695, -0.019502, -0.045121, -0.025016},
-    {-0.123120, -0.030844, -0.003533, -0.016224},
-    {-0.025568, -0.049172, -0.003911, -0.027522},
-    {-0.039029, -0.019857, -0.043211, -0.058087},
-    {-0.040122, -0.023067, -0.001356,  0.008607},
-    {-0.063351, -0.001776,  0.016015, -0.027088},
-    {-0.068110, -0.038838,  0.042525,  0.001076},
-    {-0.043623, -0.020736, -0.047862,  0.037710},
-    {-0.041052,  0.021954, -0.025660,  0.000758},
-    {-0.013035,  0.002583, -0.008233, -0.037300},
-    {-0.005523, -0.014670,  0.019651, -0.012667},
-    {-0.004409, -0.014437, -0.059412, -0.019701},
-    { 0.024946, -0.011663, -0.014351, -0.028762},
-    { 0.012660,  0.018489, -0.010205,  0.012695},
-    {-0.004423,  0.017827,  0.040544,  0.003629},
-    { 0.020684,  0.026743,  0.007752, -0.025595},
-    { 0.032071,  0.000043,  0.026188, -0.006444},
-    { 0.058793,  0.015820, -0.001119, -0.017415},
-    { 0.020156, -0.047590,  0.004227,  0.008670},
-    { 0.054770,  0.032135,  0.029770, -0.009767},
-    { 0.030884,  0.047757,  0.033068,  0.006866},
-    { 0.062039,  0.011646,  0.056037,  0.016859},
-    { 0.013798, -0.028196,  0.060710,  0.014299},
-    { 0.100043,  0.041445,  0.023379, -0.014889},
-    { 0.062728, -0.042821,  0.002180, -0.055380},
-    { 0.061663,  0.018767, -0.015571, -0.074095},
-    { 0.062980,  0.080497,  0.011808, -0.031787},
-    { 0.084964,  0.043100, -0.025877,  0.020309},
-    { 0.014707,  0.035421, -0.041440, -0.053373},
-    { 0.081268,  0.005791, -0.066290, -0.039825},
-    { 0.017691, -0.020401, -0.040513, -0.083960},
-    { 0.120874,  0.055753, -0.025988, -0.059552},
-    { 0.079912,  0.007894, -0.085380, -0.114587},
-    { 0.036856, -0.039331, -0.104237, -0.069116},
-    { 0.008526, -0.064273, -0.048312, -0.038595},
-    { 0.033461, -0.028956, -0.066505,  0.038722},
-    {-0.042064, -0.043989, -0.100653, -0.071550},
-    {-0.015342, -0.064850, -0.065675, -0.122769},
-    {-0.006581, -0.004919, -0.113564, -0.145753},
-    { 0.008273, -0.070702, -0.164998, -0.095541},
-    {-0.001698, -0.063744, -0.129971, -0.011162},
-    {-0.048471, -0.087500, -0.111006, -0.161823},
-    {-0.032193, -0.091955, -0.080642,  0.012288},
-    {-0.095873, -0.015986, -0.072722, -0.101745},
-    {-0.079477, -0.082060, -0.203008, -0.100297},
-    {-0.023883, -0.064022, -0.168341, -0.211739},
-    {-0.070530, -0.103547, -0.123858,  0.055049},
-    {-0.033503, -0.076812, -0.016287,  0.044159},
-    {-0.088427, -0.161682, -0.058579,  0.013873},
-    {-0.083068, -0.168222, -0.016773, -0.080209},
-    {-0.080548, -0.139090,  0.030544,  0.007171},
-    {-0.117482, -0.083718,  0.027074, -0.003674},
-    {-0.163085, -0.156856, -0.012618, -0.022329},
-    {-0.176540, -0.113042, -0.020148,  0.051770},
-    {-0.153891, -0.199293, -0.043244,  0.028331},
-    {-0.107822, -0.150615,  0.016430,  0.092919},
-    {-0.137676, -0.183224,  0.066026,  0.029343},
-    {-0.191106, -0.099250,  0.045370,  0.004084},
-    {-0.237042, -0.130815, -0.022543, -0.029428},
-    {-0.201014, -0.053591, -0.007305, -0.033547},
-    {-0.249286, -0.228408,  0.005002,  0.007146},
-    {-0.206509, -0.211998, -0.061352, -0.047233},
-    {-0.255702, -0.135114,  0.076375,  0.036630},
-    {-0.296271, -0.073946, -0.007273, -0.019601},
-    {-0.302917, -0.175111, -0.070024, -0.043905},
-    {-0.239275, -0.043962, -0.084982, -0.067446},
-    {-0.254583, -0.294720, -0.088762, -0.070451},
-    {-0.205583, -0.238996, -0.124753,  0.033076},
-    {-0.205583, -0.215882, -0.028472,  0.118679},
-    {-0.153640, -0.204464, -0.039654, -0.134441},
-    {-0.145929, -0.191970, -0.175308,  0.021366},
-    {-0.149348, -0.212569, -0.118324,  0.103812},
-    {-0.166397, -0.220581, -0.265260, -0.029113},
-    {-0.164171, -0.231262, -0.258828,  0.061427},
-    {-0.200198, -0.263453, -0.212016,  0.115359},
-    {-0.130088, -0.212168, -0.202368,  0.118563},
-    {-0.206387, -0.078075, -0.227856, -0.111165},
-    {-0.129605, -0.176848, -0.241584, -0.259900},
-    {-0.176826, -0.045901, -0.141712, -0.209345},
-    {-0.351173, -0.031097, -0.133935, -0.182412},
-    {-0.164232,  0.027006, -0.014039, -0.053567},
-    {-0.171037, -0.025924,  0.030972,  0.017329},
-    {-0.080862, -0.021577,  0.007652,  0.063968},
-    {-0.061788,  0.042024, -0.018783, -0.057979},
-    {-0.110311,  0.054760,  0.031446, -0.006710},
-    {-0.136637,  0.022171,  0.084991,  0.028039},
-    {-0.254471, -0.004376,  0.078034,  0.033649},
-    {-0.234464,  0.088157,  0.040999,  0.002639},
-    {-0.037095,  0.059443,  0.072180,  0.015027},
-    {-0.046841, -0.004813,  0.088266,  0.038786},
-    {-0.086782,  0.120100,  0.082655,  0.020271},
-    {-0.118361, -0.069242,  0.094867,  0.039200},
-    {-0.023342, -0.084303,  0.052684,  0.017093},
-    {-0.014194,  0.001012,  0.011946,  0.074125},
-    {-0.015342,  0.076396,  0.022365, -0.028001},
-    { 0.027706,  0.037047,  0.107573,  0.060815},
-    { 0.030615,  0.040664,  0.010467,  0.074289},
-    { 0.038646,  0.115584,  0.069627,  0.007642},
-    { 0.096463,  0.069818,  0.062494,  0.015413},
-    { 0.054834,  0.065232,  0.054286,  0.110088},
-    { 0.152312,  0.092371,  0.026420, -0.013184},
-    { 0.144264,  0.123438,  0.080131,  0.023233},
-    { 0.124405,  0.009943, -0.148477, -0.205184}
-};
-
-static const float *lsf_codebooks_16k[] = {
-    lsf_cb1_16k[0], lsf_cb2_16k[0], lsf_cb3_16k[0], lsf_cb4_16k[0],
-    lsf_cb5_16k[0]
-};
-
-#endif /* AVCODEC_SIPR16KDATA_H */
diff --git a/deps/libav/libavcodec/siprdata.h b/deps/libav/libavcodec/siprdata.h
deleted file mode 100644
index 92037a4..0000000
--- a/deps/libav/libavcodec/siprdata.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * SIPR / ACELP.NET decoder
- *
- * Copyright (c) 2008 Vladimir Voroshilov
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SIPRDATA_H
-#define AVCODEC_SIPRDATA_H
-
-static const float mean_lsf[10] = {
-    0.297151,  0.452308,  0.765443,  1.134803,  1.421125,
-    1.773822,  2.049173,  2.375914,  2.585097,  0.075756
-};
-
-static const float lsf_cb1[64][2] = {
-    { 0.007587, -0.005843}, { 0.042163, -0.028048}, {-0.017147, -0.060705},
-    { 0.013773, -0.038108}, {-0.041563, -0.078571}, {-0.076928, -0.119343},
-    { 0.012654,  0.176005}, { 0.059737,  0.156869}, { 0.171767,  0.231837},
-    { 0.114030,  0.242047}, { 0.168977,  0.283101}, { 0.146210,  0.397961},
-    { 0.249446,  0.268421}, { 0.137074,  0.186724}, {-0.057736, -0.135638},
-    {-0.109664, -0.124611}, {-0.021234, -0.031174}, {-0.013990, -0.091819},
-    {-0.040046, -0.111426}, {-0.016830,  0.055361}, { 0.057815,  0.071606},
-    { 0.060670,  0.114436}, { 0.106695,  0.140838}, { 0.093601,  0.092793},
-    { 0.039593,  0.006142}, {-0.066589, -0.092463}, {-0.102589, -0.171380},
-    {-0.059621, -0.050671}, { 0.166131,  0.139773}, { 0.213069,  0.190761},
-    { 0.061820,  0.037661}, { 0.136471,  0.090823}, {-0.019789,  0.013515},
-    { 0.022280,  0.079473}, { 0.215281,  0.461959}, { 0.206497,  0.340077},
-    { 0.012249, -0.065596}, { 0.091345,  0.190871}, { 0.019506,  0.037266},
-    {-0.050702, -0.013223}, {-0.057334,  0.028943}, { 0.291512,  0.371415},
-    {-0.053467,  0.084160}, { 0.025372,  0.375310}, { 0.269995,  0.566520},
-    {-0.095259, -0.012353}, { 0.050479,  0.212893}, { 0.101219,  0.049320},
-    { 0.072426,  0.283362}, {-0.084116, -0.150542}, {-0.031485,  0.144922},
-    { 0.012714,  0.256910}, {-0.009528,  0.102768}, {-0.039572,  0.204967},
-    {-0.098800,  0.055038}, { 0.020719,  0.128387}, {-0.045559, -0.178373},
-    {-0.082338,  0.136933}, {-0.058270,  0.292806}, { 0.084242,  0.505112},
-    { 0.121825,  0.326386}, {-0.102658, -0.069341}, { 0.071675,  0.004744},
-    {-0.117763, -0.202608}
-};
-
-static const float lsf_cb2[128][2] = {
-    { 0.025412,  0.006095}, {-0.069803,  0.010650}, {-0.175957, -0.185800},
-    {-0.139298, -0.048013}, {-0.156150, -0.129688}, {-0.160523,  0.068022},
-    { 0.199683,  0.259982}, { 0.258038,  0.236147}, { 0.367089,  0.304716},
-    { 0.251764,  0.305853}, { 0.394314,  0.382153}, { 0.448579,  0.337438},
-    { 0.323286,  0.425563}, { 0.015369,  0.123820}, {-0.026770,  0.083881},
-    {-0.112161, -0.097993}, {-0.221847, -0.161311}, {-0.050014, -0.092862},
-    {-0.214960, -0.398498}, {-0.114062, -0.241381}, { 0.137950,  0.138852},
-    { 0.031529,  0.065719}, { 0.208734,  0.084760}, { 0.157862,  0.057535},
-    { 0.124750,  0.011922}, {-0.035227, -0.154397}, {-0.105523, -0.291427},
-    {-0.073488, -0.201948}, {-0.224184, -0.273290}, {-0.168019, -0.240297},
-    {-0.271591, -0.384682}, {-0.124784,  0.014253}, { 0.004210, -0.110418},
-    { 0.074270, -0.014272}, { 0.053058, -0.068672}, {-0.090098, -0.145019},
-    { 0.303214,  0.210323}, { 0.413443,  0.272002}, { 0.356904,  0.230646},
-    {-0.035186, -0.028579}, {-0.117558,  0.115105}, {-0.159225,  0.218385},
-    {-0.230178,  0.172901}, {-0.216148, -0.110195}, { 0.309444,  0.101508},
-    { 0.250489,  0.118338}, { 0.293324,  0.151205}, {-0.023634,  0.033084},
-    { 0.076708,  0.114024}, { 0.123119,  0.087704}, {-0.060265,  0.126543},
-    {-0.223766, -0.021903}, {-0.241987, -0.328089}, { 0.205598,  0.147925},
-    {-0.087010,  0.064601}, {-0.287892, -0.286099}, {-0.179451, -0.350781},
-    {-0.219572,  0.043816}, {-0.217263,  0.245550}, {-0.286743, -0.180981},
-    { 0.172659,  0.112620}, {-0.105422,  0.176856}, { 0.006176, -0.051491},
-    { 0.099802,  0.176322}, {-0.186620, -0.068980}, { 0.164689,  0.185018},
-    { 0.519877,  0.376111}, { 0.521941,  0.533731}, { 0.473375,  0.439534},
-    { 0.214235,  0.202476}, { 0.579215,  0.466969}, { 0.310414,  0.271057},
-    { 0.257450,  0.058939}, { 0.023936, -0.169464}, {-0.268817, -0.064531},
-    {-0.174182, -0.000198}, {-0.268405, -0.234529}, {-0.296522,  0.247140},
-    { 0.115950, -0.072194}, {-0.303666,  0.149084}, {-0.347762, -0.011002},
-    {-0.223829, -0.214137}, {-0.278958, -0.457975}, { 0.135500,  0.238466},
-    { 0.312730,  0.342760}, { 0.071754, -0.125912}, { 0.485938,  0.260429},
-    { 0.037536,  0.179771}, { 0.391493,  0.156938}, { 0.397320,  0.484446},
-    {-0.308630, -0.342418}, {-0.269599, -0.128453}, {-0.086683, -0.043863},
-    { 0.421115,  0.213521}, { 0.082417,  0.049006}, {-0.087873,  0.238126},
-    { 0.338899,  0.166131}, {-0.166988,  0.147105}, {-0.167214, -0.294075},
-    { 0.588706,  0.328303}, { 0.207270,  0.017671}, {-0.141658,  0.291147},
-    {-0.140850,  0.374321}, { 0.028180,  0.322510}, {-0.229858,  0.328036},
-    {-0.060743, -0.260916}, {-0.011131,  0.246442}, {-0.058151,  0.310760},
-    {-0.127536, -0.186432}, {-0.128523, -0.334884}, {-0.283899,  0.077729},
-    {-0.031595,  0.181015}, {-0.329330, -0.108630}, {-0.215739,  0.107458},
-    { 0.175734,  0.327134}, { 0.255801,  0.176077}, { 0.228265,  0.396859},
-    {-0.370909, -0.185081}, {-0.355138, -0.300405}, { 0.061669,  0.242616},
-    { 0.104489,  0.307995}, {-0.320021, -0.234002}, { 0.077349,  0.416286},
-    {-0.339471, -0.407609}, {-0.019384, -0.215111}, { 0.168229, -0.032453},
-    {-0.040140,  0.399658}, {-0.275141,  0.008218}
-};
-
-static const float lsf_cb3[128][2] = {
-    { 0.024608,  0.006198}, {-0.216616, -0.398169}, {-0.089601, -0.201370},
-    {-0.121878, -0.305281}, { 0.037913,  0.059320}, { 0.245126,  0.244089},
-    { 0.266853,  0.182476}, { 0.319362,  0.203481}, { 0.349945,  0.252644},
-    { 0.393849,  0.279272}, { 0.445707,  0.258063}, { 0.387321,  0.200855},
-    {-0.038818,  0.129603}, {-0.009510,  0.076441}, {-0.023892, -0.028199},
-    {-0.117134, -0.145990}, {-0.186585, -0.052886}, {-0.034250, -0.084547},
-    {-0.087443, -0.095426}, {-0.453322, -0.174493}, {-0.363975, -0.148186},
-    {-0.334413, -0.202479}, {-0.221313, -0.181320}, {-0.131146, -0.050611},
-    {-0.104706,  0.115139}, { 0.192765,  0.275417}, { 0.014184,  0.194251},
-    { 0.154215,  0.226949}, { 0.084031,  0.221759}, { 0.189438,  0.164566},
-    { 0.130737,  0.170962}, {-0.066815,  0.062954}, {-0.177176, -0.145167},
-    {-0.247608, -0.129767}, {-0.187886, -0.293720}, {-0.244036, -0.344655},
-    {-0.203063, -0.234947}, {-0.292715, -0.158421}, { 0.064990, -0.028164},
-    { 0.147664,  0.085995}, { 0.107977,  0.002253}, { 0.071286,  0.027533},
-    { 0.021017, -0.049807}, {-0.272056, -0.217857}, {-0.065596,  0.008375},
-    {-0.150818, -0.195514}, {-0.012767, -0.150787}, { 0.238541,  0.136606},
-    { 0.291741,  0.114024}, { 0.202677,  0.103701}, { 0.140985,  0.037759},
-    {-0.257347, -0.442383}, {-0.320666, -0.319742}, {-0.488725, -0.603660},
-    {-0.319170, -0.469806}, { 0.014970, -0.101074}, { 0.102209,  0.066790},
-    {-0.076202, -0.044884}, { 0.073868,  0.152565}, { 0.070755, -0.091358},
-    {-0.016751,  0.027216}, { 0.071201,  0.096981}, {-0.060975, -0.145638},
-    { 0.114156,  0.117587}, {-0.284757, -0.029101}, {-0.253005, -0.073645},
-    {-0.204028, -0.098492}, {-0.114508,  0.001219}, {-0.225284, -0.011998},
-    {-0.235670,  0.084330}, { 0.161921,  0.128334}, { 0.025717,  0.119456},
-    {-0.255292, -0.281471}, {-0.392803, -0.095809}, { 0.039229, -0.152110},
-    {-0.310905, -0.099233}, {-0.268773,  0.032308}, {-0.340150,  0.013129},
-    {-0.344890, -0.045157}, {-0.188423,  0.265603}, {-0.168235, -0.000936},
-    { 0.000462,  0.297000}, { 0.263674,  0.371214}, {-0.146797, -0.098225},
-    {-0.386557, -0.282426}, {-0.070940, -0.255550}, { 0.293258,  0.252785},
-    { 0.408332,  0.387751}, {-0.381914, -0.358918}, {-0.463621, -0.315560},
-    {-0.323681, -0.258465}, { 0.250055,  0.071195}, {-0.405256, -0.429754},
-    {-0.135748, -0.251274}, { 0.186827,  0.060177}, { 0.116742, -0.053526},
-    {-0.403321, -0.220339}, {-0.414144, -0.021108}, {-0.416877,  0.050184},
-    {-0.470083, -0.079564}, {-0.315554,  0.219217}, {-0.273183,  0.138437},
-    { 0.253231,  0.306374}, { 0.177802,  0.346298}, { 0.210358,  0.207697},
-    {-0.323480,  0.077519}, {-0.193136,  0.048170}, { 0.114492,  0.292778},
-    {-0.130766,  0.056677}, {-0.171572, -0.349267}, {-0.370076, -0.536392},
-    {-0.311109, -0.389953}, { 0.334928,  0.367664}, { 0.351246,  0.438664},
-    { 0.518803,  0.331253}, { 0.437061,  0.327257}, { 0.318906,  0.307389},
-    {-0.025972, -0.206758}, { 0.373278,  0.325438}, { 0.473488,  0.389441},
-    { 0.478553,  0.477990}, { 0.332783,  0.153825}, { 0.212098,  0.452336},
-    { 0.161522, -0.011212}, { 0.209368,  0.020687}, {-0.086262,  0.204493},
-    {-0.388643,  0.133640}, {-0.177016,  0.134404}
-};
-
-static const float lsf_cb4[128][2] = {
-    {-0.003594, -0.022447}, { 0.070651,  0.028334}, {-0.290374, -0.018347},
-    {-0.224495, -0.370312}, {-0.269555, -0.131227}, {-0.122714, -0.267733},
-    { 0.173325,  0.138698}, { 0.161946,  0.020687}, { 0.111706,  0.022510},
-    { 0.097638,  0.056049}, { 0.139754,  0.059920}, { 0.056549, -0.050586},
-    { 0.036301,  0.021501}, {-0.066347,  0.012324}, {-0.066972,  0.096136},
-    {-0.120062, -0.084201}, { 0.011225,  0.047425}, {-0.012846, -0.067390},
-    {-0.116201,  0.122874}, {-0.027819,  0.035453}, {-0.024743,  0.072835},
-    {-0.034061, -0.001310}, { 0.077469,  0.081609}, { 0.128347,  0.139584},
-    { 0.183416,  0.086563}, {-0.155839, -0.053775}, {-0.190403, -0.018639},
-    {-0.202548, -0.062841}, {-0.373733, -0.275094}, {-0.394260, -0.186513},
-    {-0.465700, -0.220031}, { 0.064400, -0.095825}, {-0.262053, -0.199837},
-    {-0.167233, -0.094402}, { 0.048600,  0.057567}, {-0.007122,  0.168506},
-    { 0.050938,  0.156451}, {-0.060828,  0.147083}, {-0.171889,  0.195822},
-    {-0.218934,  0.138431}, {-0.270532,  0.195775}, {-0.405818,  0.075643},
-    {-0.440187,  0.193387}, {-0.484968,  0.157607}, {-0.480560,  0.067230},
-    {-0.436757, -0.111847}, {-0.040731, -0.040363}, {-0.202319, -0.170457},
-    {-0.158515, -0.134551}, {-0.356709, -0.378549}, {-0.268820, -0.289831},
-    {-0.188486, -0.289306}, {-0.148139, -0.177616}, {-0.071591, -0.191128},
-    {-0.052270, -0.150589}, {-0.020543, -0.116220}, { 0.039584, -0.012592},
-    {-0.268226,  0.042704}, {-0.209755,  0.069423}, {-0.168964,  0.124504},
-    {-0.363240,  0.188266}, {-0.524935, -0.025010}, {-0.105894, -0.002699},
-    {-0.251830, -0.062018}, {-0.310480, -0.082325}, { 0.014652,  0.083127},
-    {-0.136512,  0.033116}, {-0.073755, -0.025236}, { 0.110766,  0.095954},
-    { 0.002878,  0.011838}, {-0.074977, -0.244586}, {-0.047023, -0.081339},
-    {-0.183249,  0.029525}, { 0.263435,  0.206934}, {-0.156721, -0.229993},
-    {-0.112224, -0.208941}, {-0.116534, -0.123191}, {-0.073988, -0.111668},
-    { 0.029484, -0.137573}, {-0.009802, -0.161685}, {-0.023273,  0.114043},
-    {-0.332651,  0.049072}, {-0.394009,  0.018608}, {-0.433543, -0.035318},
-    {-0.368459, -0.108024}, {-0.350215, -0.037617}, {-0.321140, -0.178537},
-    { 0.020307, -0.048487}, {-0.210512, -0.232274}, {-0.082140, -0.065443},
-    { 0.081961, -0.009340}, { 0.146794,  0.101973}, { 0.213999,  0.124687},
-    { 0.100217, -0.054095}, {-0.114411, -0.041403}, {-0.097631,  0.037061},
-    {-0.099651, -0.157978}, {-0.215790, -0.116550}, {-0.107100,  0.076300},
-    { 0.084653,  0.126088}, { 0.246439,  0.091442}, { 0.160077,  0.188536},
-    { 0.273900,  0.279190}, { 0.320417,  0.232550}, { 0.132710, -0.018988},
-    { 0.018950, -0.091681}, {-0.032073, -0.202906}, { 0.212789,  0.178188},
-    { 0.208580,  0.239726}, { 0.049420,  0.099840}, {-0.145695, -0.010619},
-    {-0.132525, -0.322660}, { 0.019666,  0.126603}, { 0.260809,  0.147727},
-    {-0.232795, -0.001090}, {-0.049826,  0.225987}, {-0.154774,  0.076614},
-    { 0.045032,  0.221397}, { 0.321014,  0.161632}, {-0.062379,  0.053586},
-    { 0.132252,  0.246675}, { 0.392627,  0.271905}, {-0.264585,  0.102344},
-    {-0.327200,  0.121624}, {-0.399642,  0.124445}, {-0.108335,  0.179171},
-    { 0.100374,  0.182731}, { 0.203852,  0.049505}
-};
-
-static const float lsf_cb5[32][2] = {
-    {-0.047705,  0.008002}, { 0.011332,  0.065028}, {-0.021796, -0.034777},
-    {-0.147394, -0.001241}, {-0.001577,  0.020599}, {-0.083827, -0.028975},
-    {-0.177707,  0.066046}, {-0.043241, -0.165144}, { 0.053322,  0.096519},
-    {-0.097688,  0.106484}, {-0.023392,  0.111234}, {-0.146747, -0.159360},
-    { 0.027241, -0.011806}, {-0.043156,  0.057667}, { 0.019516, -0.062116},
-    { 0.025990,  0.162533}, { 0.091888,  0.009720}, {-0.098511,  0.036414},
-    { 0.013722, -0.116512}, { 0.054833, -0.180975}, { 0.119497,  0.128774},
-    { 0.118378, -0.125997}, { 0.065882, -0.030932}, { 0.120581, -0.039964},
-    {-0.050561, -0.088577}, { 0.050134,  0.033194}, {-0.129654, -0.075112},
-    {-0.225334, -0.040234}, { 0.070629, -0.084455}, { 0.095508,  0.063548},
-    { 0.150514,  0.034366}, { 0.186092, -0.069272}
-};
-
-static const float *lsf_codebooks[] = {
-    lsf_cb1[0], lsf_cb2[0], lsf_cb3[0], lsf_cb4[0], lsf_cb5[0]
-};
-
-static const float gain_cb[128][2] = {
-    {0.035230, 0.161540}, {0.049223, 0.448359}, {0.057443, 0.809043},
-    {0.072434, 1.760306}, {0.111491, 0.566418}, {0.112820, 1.098524},
-    {0.143493, 0.726856}, {0.144840, 0.347800}, {0.180341, 1.050010},
-    {0.188171, 2.197256}, {0.189771, 0.256947}, {0.198260, 0.484678},
-    {0.210622, 0.755825}, {0.220694, 0.590788}, {0.237062, 1.322214},
-    {0.255175, 0.338710}, {0.298980, 0.919051}, {0.314627, 0.520961},
-    {0.337106, 1.469863}, {0.341422, 2.804546}, {0.363257, 0.736222},
-    {0.363881, 0.367640}, {0.369850, 1.937934}, {0.370136, 1.075201},
-    {0.397152, 0.549410}, {0.426557, 0.876015}, {0.450686, 0.215588},
-    {0.468116, 0.671848}, {0.470495, 1.242034}, {0.474180, 1.739845},
-    {0.484875, 0.490564}, {0.498917, 0.971238}, {0.530996, 0.785765},
-    {0.539768, 2.130689}, {0.546021, 0.589544}, {0.546632, 3.050846},
-    {0.552336, 0.389775}, {0.556302, 1.400103}, {0.559688, 1.105421},
-    {0.574140, 0.667513}, {0.595547, 0.828943}, {0.597771, 0.496929},
-    {0.617079, 1.863075}, {0.619657, 1.221713}, {0.621172, 0.950275},
-    {0.628426, 0.630766}, {0.628689, 4.242164}, {0.640899, 1.529846},
-    {0.645813, 0.331127}, {0.653056, 0.748168}, {0.662909, 1.077438},
-    {0.669505, 2.631114}, {0.681570, 1.839298}, {0.687844, 0.903400},
-    {0.688660, 1.270830}, {0.695070, 0.578227}, {0.697926, 0.428440},
-    {0.715454, 0.812355}, {0.729981, 1.539357}, {0.737434, 1.106765},
-    {0.740241, 2.033374}, {0.740871, 0.568460}, {0.752689, 0.698461},
-    {0.756587, 0.893078}, {0.767797, 0.499246}, {0.768516, 3.712434},
-    {0.773153, 1.332360}, {0.786125, 1.042996}, {0.788792, 0.238388},
-    {0.790861, 2.273229}, {0.795338, 1.582767}, {0.809621, 0.595501},
-    {0.821032, 0.756460}, {0.824590, 0.922925}, {0.826019, 1.186793},
-    {0.827426, 1.885076}, {0.830080, 6.088666}, {0.837028, 2.819993},
-    {0.845561, 1.490623}, {0.848323, 0.410436}, {0.856522, 0.729725},
-    {0.862636, 0.966880}, {0.874561, 1.681660}, {0.874751, 1.177630},
-    {0.879289, 2.301300}, {0.886671, 0.613068}, {0.896729, 0.781097},
-    {0.904777, 3.484111}, {0.906098, 1.330892}, {0.919182, 1.877203},
-    {0.919901, 0.569511}, {0.921772, 1.034126}, {0.922439, 0.376000},
-    {0.934221, 1.485214}, {0.938842, 0.869135}, {0.939166, 2.378294},
-    {0.958933, 1.122722}, {0.959042, 0.694098}, {0.960995, 1.743430},
-    {0.970763, 2.884897}, {0.982881, 0.814506}, {0.990141, 1.330022},
-    {0.996447, 1.823381}, {1.000013, 0.967498}, {1.000743, 0.480597},
-    {1.008020, 5.095226}, {1.013883, 2.105435}, {1.026438, 0.691312},
-    {1.027361, 1.558169}, {1.030123, 3.586526}, {1.033916, 1.118036},
-    {1.039315, 2.543360}, {1.068596, 0.836380}, {1.081023, 1.318768},
-    {1.093150, 2.267843}, {1.095607, 1.712383}, {1.102816, 1.037334},
-    {1.103231, 3.536292}, {1.107320, 0.508615}, {1.150000, 7.999000},
-    {1.156731, 1.236772}, {1.168428, 2.268084}, {1.184130, 0.775839},
-    {1.210609, 1.511840}, {1.220663, 4.365683}, {1.224016, 0.983179},
-    {1.252236, 2.778535}, {1.301176, 1.923126}
-};
-
-static const float pred[4] = {
-    0.200, 0.334, 0.504, 0.691
-};
-
-#endif /* AVCODEC_SIPRDATA_H */
diff --git a/deps/libav/libavcodec/smacker.c b/deps/libav/libavcodec/smacker.c
deleted file mode 100644
index ba69303..0000000
--- a/deps/libav/libavcodec/smacker.c
+++ /dev/null
@@ -1,777 +0,0 @@
-/*
- * Smacker decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Smacker decoder
- */
-
-/*
- * Based on http://wiki.multimedia.cx/index.php?title=Smacker
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "mathops.h"
-
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "bytestream.h"
-
-#define SMKTREE_BITS 9
-#define SMK_NODE 0x80000000
-
-/*
- * Decoder context
- */
-typedef struct SmackVContext {
-    AVCodecContext *avctx;
-    AVFrame *pic;
-
-    int *mmap_tbl, *mclr_tbl, *full_tbl, *type_tbl;
-    int mmap_last[3], mclr_last[3], full_last[3], type_last[3];
-} SmackVContext;
-
-/**
- * Context used for code reconstructing
- */
-typedef struct HuffContext {
-    int length;
-    int maxlength;
-    int current;
-    uint32_t *bits;
-    int *lengths;
-    int *values;
-} HuffContext;
-
-/* common parameters used for decode_bigtree */
-typedef struct DBCtx {
-    VLC *v1, *v2;
-    int *recode1, *recode2;
-    int escapes[3];
-    int *last;
-    int lcur;
-} DBCtx;
-
-/* possible runs of blocks */
-static const int block_runs[64] = {
-      1,    2,    3,    4,    5,    6,    7,    8,
-      9,   10,   11,   12,   13,   14,   15,   16,
-     17,   18,   19,   20,   21,   22,   23,   24,
-     25,   26,   27,   28,   29,   30,   31,   32,
-     33,   34,   35,   36,   37,   38,   39,   40,
-     41,   42,   43,   44,   45,   46,   47,   48,
-     49,   50,   51,   52,   53,   54,   55,   56,
-     57,   58,   59,  128,  256,  512, 1024, 2048 };
-
-enum SmkBlockTypes {
-    SMK_BLK_MONO = 0,
-    SMK_BLK_FULL = 1,
-    SMK_BLK_SKIP = 2,
-    SMK_BLK_FILL = 3 };
-
-/**
- * Decode local frame tree
- */
-static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, uint32_t prefix, int length)
-{
-    if(!get_bits1(gb)){ //Leaf
-        if(hc->current >= 256){
-            av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\n");
-            return -1;
-        }
-        if(length){
-            hc->bits[hc->current] = prefix;
-            hc->lengths[hc->current] = length;
-        } else {
-            hc->bits[hc->current] = 0;
-            hc->lengths[hc->current] = 0;
-        }
-        hc->values[hc->current] = get_bits(gb, 8);
-        hc->current++;
-        if(hc->maxlength < length)
-            hc->maxlength = length;
-        return 0;
-    } else { //Node
-        int r;
-        length++;
-        r = smacker_decode_tree(gb, hc, prefix, length);
-        if(r)
-            return r;
-        return smacker_decode_tree(gb, hc, prefix | (1 << (length - 1)), length);
-    }
-}
-
-/**
- * Decode header tree
- */
-static int smacker_decode_bigtree(GetBitContext *gb, HuffContext *hc, DBCtx *ctx)
-{
-    if (hc->current + 1 >= hc->length) {
-        av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\n");
-        return -1;
-    }
-    if(!get_bits1(gb)){ //Leaf
-        int val, i1, i2;
-        i1 = ctx->v1->table ? get_vlc2(gb, ctx->v1->table, SMKTREE_BITS, 3) : 0;
-        i2 = ctx->v2->table ? get_vlc2(gb, ctx->v2->table, SMKTREE_BITS, 3) : 0;
-        if (i1 < 0 || i2 < 0)
-            return -1;
-        val = ctx->recode1[i1] | (ctx->recode2[i2] << 8);
-        if(val == ctx->escapes[0]) {
-            ctx->last[0] = hc->current;
-            val = 0;
-        } else if(val == ctx->escapes[1]) {
-            ctx->last[1] = hc->current;
-            val = 0;
-        } else if(val == ctx->escapes[2]) {
-            ctx->last[2] = hc->current;
-            val = 0;
-        }
-
-        hc->values[hc->current++] = val;
-        return 1;
-    } else { //Node
-        int r = 0, r_new, t;
-
-        t = hc->current++;
-        r = smacker_decode_bigtree(gb, hc, ctx);
-        if(r < 0)
-            return r;
-        hc->values[t] = SMK_NODE | r;
-        r++;
-        r_new = smacker_decode_bigtree(gb, hc, ctx);
-        if (r_new < 0)
-            return r_new;
-        return r + r_new;
-    }
-}
-
-/**
- * Store large tree as Libav's vlc codes
- */
-static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int **recodes, int *last, int size)
-{
-    int res;
-    HuffContext huff;
-    HuffContext tmp1, tmp2;
-    VLC vlc[2] = { { 0 } };
-    int escapes[3];
-    DBCtx ctx;
-    int err = 0;
-
-    if(size >= UINT_MAX>>4){ // (((size + 3) >> 2) + 3) << 2 must not overflow
-        av_log(smk->avctx, AV_LOG_ERROR, "size too large\n");
-        return -1;
-    }
-
-    tmp1.length = 256;
-    tmp1.maxlength = 0;
-    tmp1.current = 0;
-    tmp1.bits = av_mallocz(256 * 4);
-    tmp1.lengths = av_mallocz(256 * sizeof(int));
-    tmp1.values = av_mallocz(256 * sizeof(int));
-
-    tmp2.length = 256;
-    tmp2.maxlength = 0;
-    tmp2.current = 0;
-    tmp2.bits = av_mallocz(256 * 4);
-    tmp2.lengths = av_mallocz(256 * sizeof(int));
-    tmp2.values = av_mallocz(256 * sizeof(int));
-    if (!tmp1.bits || !tmp1.lengths || !tmp1.values ||
-        !tmp2.bits || !tmp2.lengths || !tmp2.values) {
-        err = AVERROR(ENOMEM);
-        goto error;
-    }
-
-    if(get_bits1(gb)) {
-        smacker_decode_tree(gb, &tmp1, 0, 0);
-        skip_bits1(gb);
-        res = init_vlc(&vlc[0], SMKTREE_BITS, tmp1.length,
-                    tmp1.lengths, sizeof(int), sizeof(int),
-                    tmp1.bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
-        if(res < 0) {
-            av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
-            err = res;
-            goto error;
-        }
-    } else {
-        av_log(smk->avctx, AV_LOG_ERROR, "Skipping low bytes tree\n");
-    }
-    if(get_bits1(gb)){
-        smacker_decode_tree(gb, &tmp2, 0, 0);
-        skip_bits1(gb);
-        res = init_vlc(&vlc[1], SMKTREE_BITS, tmp2.length,
-                    tmp2.lengths, sizeof(int), sizeof(int),
-                    tmp2.bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
-        if(res < 0) {
-            av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
-            err = res;
-            goto error;
-        }
-    } else {
-        av_log(smk->avctx, AV_LOG_ERROR, "Skipping high bytes tree\n");
-    }
-
-    escapes[0]  = get_bits(gb, 8);
-    escapes[0] |= get_bits(gb, 8) << 8;
-    escapes[1]  = get_bits(gb, 8);
-    escapes[1] |= get_bits(gb, 8) << 8;
-    escapes[2]  = get_bits(gb, 8);
-    escapes[2] |= get_bits(gb, 8) << 8;
-
-    last[0] = last[1] = last[2] = -1;
-
-    ctx.escapes[0] = escapes[0];
-    ctx.escapes[1] = escapes[1];
-    ctx.escapes[2] = escapes[2];
-    ctx.v1 = &vlc[0];
-    ctx.v2 = &vlc[1];
-    ctx.recode1 = tmp1.values;
-    ctx.recode2 = tmp2.values;
-    ctx.last = last;
-
-    huff.length = ((size + 3) >> 2) + 4;
-    huff.maxlength = 0;
-    huff.current = 0;
-    huff.values = av_mallocz(huff.length * sizeof(int));
-    if (!huff.values) {
-        err = AVERROR(ENOMEM);
-        goto error;
-    }
-
-    if (smacker_decode_bigtree(gb, &huff, &ctx) < 0)
-        err = -1;
-    skip_bits1(gb);
-    if(ctx.last[0] == -1) ctx.last[0] = huff.current++;
-    if(ctx.last[1] == -1) ctx.last[1] = huff.current++;
-    if(ctx.last[2] == -1) ctx.last[2] = huff.current++;
-    if (ctx.last[0] >= huff.length ||
-        ctx.last[1] >= huff.length ||
-        ctx.last[2] >= huff.length) {
-        av_log(smk->avctx, AV_LOG_ERROR, "Huffman codes out of range\n");
-        err = AVERROR_INVALIDDATA;
-    }
-
-    *recodes = huff.values;
-
-error:
-    if(vlc[0].table)
-        ff_free_vlc(&vlc[0]);
-    if(vlc[1].table)
-        ff_free_vlc(&vlc[1]);
-    av_free(tmp1.bits);
-    av_free(tmp1.lengths);
-    av_free(tmp1.values);
-    av_free(tmp2.bits);
-    av_free(tmp2.lengths);
-    av_free(tmp2.values);
-
-    return err;
-}
-
-static int decode_header_trees(SmackVContext *smk) {
-    GetBitContext gb;
-    int mmap_size, mclr_size, full_size, type_size;
-
-    mmap_size = AV_RL32(smk->avctx->extradata);
-    mclr_size = AV_RL32(smk->avctx->extradata + 4);
-    full_size = AV_RL32(smk->avctx->extradata + 8);
-    type_size = AV_RL32(smk->avctx->extradata + 12);
-
-    init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
-
-    if(!get_bits1(&gb)) {
-        av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
-        smk->mmap_tbl = av_malloc(sizeof(int) * 2);
-        if (!smk->mmap_tbl)
-            return AVERROR(ENOMEM);
-        smk->mmap_tbl[0] = 0;
-        smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
-    } else {
-        if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size))
-            return -1;
-    }
-    if(!get_bits1(&gb)) {
-        av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
-        smk->mclr_tbl = av_malloc(sizeof(int) * 2);
-        if (!smk->mclr_tbl)
-            return AVERROR(ENOMEM);
-        smk->mclr_tbl[0] = 0;
-        smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
-    } else {
-        if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size))
-            return -1;
-    }
-    if(!get_bits1(&gb)) {
-        av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
-        smk->full_tbl = av_malloc(sizeof(int) * 2);
-        if (!smk->full_tbl)
-            return AVERROR(ENOMEM);
-        smk->full_tbl[0] = 0;
-        smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
-    } else {
-        if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size))
-            return -1;
-    }
-    if(!get_bits1(&gb)) {
-        av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
-        smk->type_tbl = av_malloc(sizeof(int) * 2);
-        if (!smk->type_tbl)
-            return AVERROR(ENOMEM);
-        smk->type_tbl[0] = 0;
-        smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1;
-    } else {
-        if (smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size))
-            return -1;
-    }
-
-    return 0;
-}
-
-static av_always_inline void last_reset(int *recode, int *last) {
-    recode[last[0]] = recode[last[1]] = recode[last[2]] = 0;
-}
-
-/* get code and update history */
-static av_always_inline int smk_get_code(GetBitContext *gb, int *recode, int *last) {
-    register int *table = recode;
-    int v;
-
-    while(*table & SMK_NODE) {
-        if(get_bits1(gb))
-            table += (*table) & (~SMK_NODE);
-        table++;
-    }
-    v = *table;
-
-    if(v != recode[last[0]]) {
-        recode[last[2]] = recode[last[1]];
-        recode[last[1]] = recode[last[0]];
-        recode[last[0]] = v;
-    }
-    return v;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    SmackVContext * const smk = avctx->priv_data;
-    uint8_t *out;
-    uint32_t *pal;
-    GetByteContext gb2;
-    GetBitContext gb;
-    int blocks, blk, bw, bh;
-    int i, ret;
-    int stride;
-    int flags;
-
-    if (avpkt->size <= 769)
-        return 0;
-
-    if ((ret = ff_reget_buffer(avctx, smk->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    /* make the palette available on the way out */
-    pal = (uint32_t*)smk->pic->data[1];
-    bytestream2_init(&gb2, avpkt->data, avpkt->size);
-    flags = bytestream2_get_byteu(&gb2);
-    smk->pic->palette_has_changed = flags & 1;
-    smk->pic->key_frame = !!(flags & 2);
-    if(smk->pic->key_frame)
-        smk->pic->pict_type = AV_PICTURE_TYPE_I;
-    else
-        smk->pic->pict_type = AV_PICTURE_TYPE_P;
-
-    for(i = 0; i < 256; i++)
-        *pal++ = bytestream2_get_be24u(&gb2);
-
-    last_reset(smk->mmap_tbl, smk->mmap_last);
-    last_reset(smk->mclr_tbl, smk->mclr_last);
-    last_reset(smk->full_tbl, smk->full_last);
-    last_reset(smk->type_tbl, smk->type_last);
-    init_get_bits(&gb, avpkt->data + 769, (avpkt->size - 769) * 8);
-
-    blk = 0;
-    bw = avctx->width >> 2;
-    bh = avctx->height >> 2;
-    blocks = bw * bh;
-    out = smk->pic->data[0];
-    stride = smk->pic->linesize[0];
-    while(blk < blocks) {
-        int type, run, mode;
-        uint16_t pix;
-
-        type = smk_get_code(&gb, smk->type_tbl, smk->type_last);
-        run = block_runs[(type >> 2) & 0x3F];
-        switch(type & 3){
-        case SMK_BLK_MONO:
-            while(run-- && blk < blocks){
-                int clr, map;
-                int hi, lo;
-                clr = smk_get_code(&gb, smk->mclr_tbl, smk->mclr_last);
-                map = smk_get_code(&gb, smk->mmap_tbl, smk->mmap_last);
-                out = smk->pic->data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
-                hi = clr >> 8;
-                lo = clr & 0xFF;
-                for(i = 0; i < 4; i++) {
-                    if(map & 1) out[0] = hi; else out[0] = lo;
-                    if(map & 2) out[1] = hi; else out[1] = lo;
-                    if(map & 4) out[2] = hi; else out[2] = lo;
-                    if(map & 8) out[3] = hi; else out[3] = lo;
-                    map >>= 4;
-                    out += stride;
-                }
-                blk++;
-            }
-            break;
-        case SMK_BLK_FULL:
-            mode = 0;
-            if(avctx->codec_tag == MKTAG('S', 'M', 'K', '4')) { // In case of Smacker v4 we have three modes
-                if(get_bits1(&gb)) mode = 1;
-                else if(get_bits1(&gb)) mode = 2;
-            }
-            while(run-- && blk < blocks){
-                out = smk->pic->data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
-                switch(mode){
-                case 0:
-                    for(i = 0; i < 4; i++) {
-                        pix = smk_get_code(&gb, smk->full_tbl, smk->full_last);
-                        AV_WL16(out+2,pix);
-                        pix = smk_get_code(&gb, smk->full_tbl, smk->full_last);
-                        AV_WL16(out,pix);
-                        out += stride;
-                    }
-                    break;
-                case 1:
-                    pix = smk_get_code(&gb, smk->full_tbl, smk->full_last);
-                    out[0] = out[1] = pix & 0xFF;
-                    out[2] = out[3] = pix >> 8;
-                    out += stride;
-                    out[0] = out[1] = pix & 0xFF;
-                    out[2] = out[3] = pix >> 8;
-                    out += stride;
-                    pix = smk_get_code(&gb, smk->full_tbl, smk->full_last);
-                    out[0] = out[1] = pix & 0xFF;
-                    out[2] = out[3] = pix >> 8;
-                    out += stride;
-                    out[0] = out[1] = pix & 0xFF;
-                    out[2] = out[3] = pix >> 8;
-                    out += stride;
-                    break;
-                case 2:
-                    for(i = 0; i < 2; i++) {
-                        uint16_t pix1, pix2;
-                        pix2 = smk_get_code(&gb, smk->full_tbl, smk->full_last);
-                        pix1 = smk_get_code(&gb, smk->full_tbl, smk->full_last);
-                        AV_WL16(out,pix1);
-                        AV_WL16(out+2,pix2);
-                        out += stride;
-                        AV_WL16(out,pix1);
-                        AV_WL16(out+2,pix2);
-                        out += stride;
-                    }
-                    break;
-                }
-                blk++;
-            }
-            break;
-        case SMK_BLK_SKIP:
-            while(run-- && blk < blocks)
-                blk++;
-            break;
-        case SMK_BLK_FILL:
-            mode = type >> 8;
-            while(run-- && blk < blocks){
-                uint32_t col;
-                out = smk->pic->data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
-                col = mode * 0x01010101;
-                for(i = 0; i < 4; i++) {
-                    *((uint32_t*)out) = col;
-                    out += stride;
-                }
-                blk++;
-            }
-            break;
-        }
-
-    }
-
-    if ((ret = av_frame_ref(data, smk->pic)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return avpkt->size;
-}
-
-
-
-/*
- *
- * Uninit smacker decoder
- *
- */
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    SmackVContext * const smk = avctx->priv_data;
-
-    av_freep(&smk->mmap_tbl);
-    av_freep(&smk->mclr_tbl);
-    av_freep(&smk->full_tbl);
-    av_freep(&smk->type_tbl);
-
-    av_frame_free(&smk->pic);
-
-    return 0;
-}
-
-
-/*
- *
- * Init smacker decoder
- *
- */
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    SmackVContext * const c = avctx->priv_data;
-
-    c->avctx = avctx;
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    c->pic = av_frame_alloc();
-    if (!c->pic)
-        return AVERROR(ENOMEM);
-
-    /* decode huffman trees from extradata */
-    if(avctx->extradata_size < 16){
-        av_log(avctx, AV_LOG_ERROR, "Extradata missing!\n");
-        return -1;
-    }
-
-    if (decode_header_trees(c)) {
-        decode_end(avctx);
-        return -1;
-    }
-
-    return 0;
-}
-
-
-
-static av_cold int smka_decode_init(AVCodecContext *avctx)
-{
-    if (avctx->channels < 1 || avctx->channels > 2) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n");
-        return AVERROR(EINVAL);
-    }
-    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt = avctx->bits_per_coded_sample == 8 ? AV_SAMPLE_FMT_U8 : AV_SAMPLE_FMT_S16;
-
-    return 0;
-}
-
-/**
- * Decode Smacker audio data
- */
-static int smka_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    GetBitContext gb;
-    HuffContext h[4] = { { 0 } };
-    VLC vlc[4]       = { { 0 } };
-    int16_t *samples;
-    uint8_t *samples8;
-    int val;
-    int i, res, ret;
-    int unp_size;
-    int bits, stereo;
-    int pred[2] = {0, 0};
-
-    if (buf_size <= 4) {
-        av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
-        return AVERROR(EINVAL);
-    }
-
-    unp_size = AV_RL32(buf);
-
-    init_get_bits(&gb, buf + 4, (buf_size - 4) * 8);
-
-    if(!get_bits1(&gb)){
-        av_log(avctx, AV_LOG_INFO, "Sound: no data\n");
-        *got_frame_ptr = 0;
-        return 1;
-    }
-    stereo = get_bits1(&gb);
-    bits = get_bits1(&gb);
-    if (stereo ^ (avctx->channels != 1)) {
-        av_log(avctx, AV_LOG_ERROR, "channels mismatch\n");
-        return AVERROR(EINVAL);
-    }
-    if (bits && avctx->sample_fmt == AV_SAMPLE_FMT_U8) {
-        av_log(avctx, AV_LOG_ERROR, "sample format mismatch\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* get output buffer */
-    frame->nb_samples = unp_size / (avctx->channels * (bits + 1));
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples  = (int16_t *)frame->data[0];
-    samples8 =            frame->data[0];
-
-    // Initialize
-    for(i = 0; i < (1 << (bits + stereo)); i++) {
-        h[i].length = 256;
-        h[i].maxlength = 0;
-        h[i].current = 0;
-        h[i].bits = av_mallocz(256 * 4);
-        h[i].lengths = av_mallocz(256 * sizeof(int));
-        h[i].values = av_mallocz(256 * sizeof(int));
-        if (!h[i].bits || !h[i].lengths || !h[i].values) {
-            ret = AVERROR(ENOMEM);
-            goto error;
-        }
-        skip_bits1(&gb);
-        if (smacker_decode_tree(&gb, &h[i], 0, 0) < 0) {
-            ret = AVERROR_INVALIDDATA;
-            goto error;
-        }
-        skip_bits1(&gb);
-        if(h[i].current > 1) {
-            res = init_vlc(&vlc[i], SMKTREE_BITS, h[i].length,
-                    h[i].lengths, sizeof(int), sizeof(int),
-                    h[i].bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
-            if(res < 0) {
-                av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
-                ret = AVERROR_INVALIDDATA;
-                goto error;
-            }
-        }
-    }
-    /* this codec relies on wraparound instead of clipping audio */
-    if(bits) { //decode 16-bit data
-        for(i = stereo; i >= 0; i--)
-            pred[i] = sign_extend(av_bswap16(get_bits(&gb, 16)), 16);
-        for(i = 0; i <= stereo; i++)
-            *samples++ = pred[i];
-        for(; i < unp_size / 2; i++) {
-            if(i & stereo) {
-                if(vlc[2].table)
-                    res = get_vlc2(&gb, vlc[2].table, SMKTREE_BITS, 3);
-                else
-                    res = 0;
-                val  = h[2].values[res];
-                if(vlc[3].table)
-                    res = get_vlc2(&gb, vlc[3].table, SMKTREE_BITS, 3);
-                else
-                    res = 0;
-                val |= h[3].values[res] << 8;
-                pred[1] += sign_extend(val, 16);
-                *samples++ = pred[1];
-            } else {
-                if(vlc[0].table)
-                    res = get_vlc2(&gb, vlc[0].table, SMKTREE_BITS, 3);
-                else
-                    res = 0;
-                val  = h[0].values[res];
-                if(vlc[1].table)
-                    res = get_vlc2(&gb, vlc[1].table, SMKTREE_BITS, 3);
-                else
-                    res = 0;
-                val |= h[1].values[res] << 8;
-                pred[0] += sign_extend(val, 16);
-                *samples++ = pred[0];
-            }
-        }
-    } else { //8-bit data
-        for(i = stereo; i >= 0; i--)
-            pred[i] = get_bits(&gb, 8);
-        for(i = 0; i <= stereo; i++)
-            *samples8++ = pred[i];
-        for(; i < unp_size; i++) {
-            if(i & stereo){
-                if(vlc[1].table)
-                    res = get_vlc2(&gb, vlc[1].table, SMKTREE_BITS, 3);
-                else
-                    res = 0;
-                pred[1] += sign_extend(h[1].values[res], 8);
-                *samples8++ = pred[1];
-            } else {
-                if(vlc[0].table)
-                    res = get_vlc2(&gb, vlc[0].table, SMKTREE_BITS, 3);
-                else
-                    res = 0;
-                pred[0] += sign_extend(h[0].values[res], 8);
-                *samples8++ = pred[0];
-            }
-        }
-    }
-
-    *got_frame_ptr = 1;
-    ret = buf_size;
-
-error:
-    for(i = 0; i < 4; i++) {
-        if(vlc[i].table)
-            ff_free_vlc(&vlc[i]);
-        av_free(h[i].bits);
-        av_free(h[i].lengths);
-        av_free(h[i].values);
-    }
-
-    return ret;
-}
-
-AVCodec ff_smacker_decoder = {
-    .name           = "smackvid",
-    .long_name      = NULL_IF_CONFIG_SMALL("Smacker video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SMACKVIDEO,
-    .priv_data_size = sizeof(SmackVContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-AVCodec ff_smackaud_decoder = {
-    .name           = "smackaud",
-    .long_name      = NULL_IF_CONFIG_SMALL("Smacker audio"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_SMACKAUDIO,
-    .init           = smka_decode_init,
-    .decode         = smka_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/smc.c b/deps/libav/libavcodec/smc.c
deleted file mode 100644
index 46903ab..0000000
--- a/deps/libav/libavcodec/smc.c
+++ /dev/null
@@ -1,478 +0,0 @@
-/*
- * Quicktime Graphics (SMC) Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * QT SMC Video Decoder by Mike Melanson (melanson at pcisys.net)
- * For more information about the SMC format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *
- * The SMC decoder outputs PAL8 colorspace data.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-#define CPAIR 2
-#define CQUAD 4
-#define COCTET 8
-
-#define COLORS_PER_TABLE 256
-
-typedef struct SmcContext {
-
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    GetByteContext gb;
-
-    /* SMC color tables */
-    unsigned char color_pairs[COLORS_PER_TABLE * CPAIR];
-    unsigned char color_quads[COLORS_PER_TABLE * CQUAD];
-    unsigned char color_octets[COLORS_PER_TABLE * COCTET];
-
-    uint32_t pal[256];
-} SmcContext;
-
-#define GET_BLOCK_COUNT() \
-  (opcode & 0x10) ? (1 + bytestream2_get_byte(&s->gb)) : 1 + (opcode & 0x0F);
-
-#define ADVANCE_BLOCK() \
-{ \
-    pixel_ptr += 4; \
-    if (pixel_ptr >= width) \
-    { \
-        pixel_ptr = 0; \
-        row_ptr += stride * 4; \
-    } \
-    total_blocks--; \
-    if (total_blocks < 0) \
-    { \
-        av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
-        return; \
-    } \
-}
-
-static void smc_decode_stream(SmcContext *s)
-{
-    int width = s->avctx->width;
-    int height = s->avctx->height;
-    int stride = s->frame->linesize[0];
-    int i;
-    int chunk_size;
-    int buf_size = (int) (s->gb.buffer_end - s->gb.buffer_start);
-    unsigned char opcode;
-    int n_blocks;
-    unsigned int color_flags;
-    unsigned int color_flags_a;
-    unsigned int color_flags_b;
-    unsigned int flag_mask;
-
-    unsigned char *pixels = s->frame->data[0];
-
-    int image_size = height * s->frame->linesize[0];
-    int row_ptr = 0;
-    int pixel_ptr = 0;
-    int pixel_x, pixel_y;
-    int row_inc = stride - 4;
-    int block_ptr;
-    int prev_block_ptr;
-    int prev_block_ptr1, prev_block_ptr2;
-    int prev_block_flag;
-    int total_blocks;
-    int color_table_index;  /* indexes to color pair, quad, or octet tables */
-    int pixel;
-
-    int color_pair_index = 0;
-    int color_quad_index = 0;
-    int color_octet_index = 0;
-
-    /* make the palette available */
-    memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
-
-    bytestream2_skip(&s->gb, 1);
-    chunk_size = bytestream2_get_be24(&s->gb);
-    if (chunk_size != buf_size)
-        av_log(s->avctx, AV_LOG_INFO, "warning: MOV chunk size != encoded chunk size (%d != %d); using MOV chunk size\n",
-            chunk_size, buf_size);
-
-    chunk_size = buf_size;
-    total_blocks = ((s->avctx->width + 3) / 4) * ((s->avctx->height + 3) / 4);
-
-    /* traverse through the blocks */
-    while (total_blocks) {
-        /* sanity checks */
-        /* make sure the row pointer hasn't gone wild */
-        if (row_ptr >= image_size) {
-            av_log(s->avctx, AV_LOG_INFO, "SMC decoder just went out of bounds (row ptr = %d, height = %d)\n",
-                row_ptr, image_size);
-            return;
-        }
-
-        opcode = bytestream2_get_byte(&s->gb);
-        switch (opcode & 0xF0) {
-        /* skip n blocks */
-        case 0x00:
-        case 0x10:
-            n_blocks = GET_BLOCK_COUNT();
-            while (n_blocks--) {
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        /* repeat last block n times */
-        case 0x20:
-        case 0x30:
-            n_blocks = GET_BLOCK_COUNT();
-
-            /* sanity check */
-            if ((row_ptr == 0) && (pixel_ptr == 0)) {
-                av_log(s->avctx, AV_LOG_INFO, "encountered repeat block opcode (%02X) but no blocks rendered yet\n",
-                    opcode & 0xF0);
-                return;
-            }
-
-            /* figure out where the previous block started */
-            if (pixel_ptr == 0)
-                prev_block_ptr1 =
-                    (row_ptr - s->avctx->width * 4) + s->avctx->width - 4;
-            else
-                prev_block_ptr1 = row_ptr + pixel_ptr - 4;
-
-            while (n_blocks--) {
-                block_ptr = row_ptr + pixel_ptr;
-                prev_block_ptr = prev_block_ptr1;
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++) {
-                        pixels[block_ptr++] = pixels[prev_block_ptr++];
-                    }
-                    block_ptr += row_inc;
-                    prev_block_ptr += row_inc;
-                }
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        /* repeat previous pair of blocks n times */
-        case 0x40:
-        case 0x50:
-            n_blocks = GET_BLOCK_COUNT();
-            n_blocks *= 2;
-
-            /* sanity check */
-            if ((row_ptr == 0) && (pixel_ptr < 2 * 4)) {
-                av_log(s->avctx, AV_LOG_INFO, "encountered repeat block opcode (%02X) but not enough blocks rendered yet\n",
-                    opcode & 0xF0);
-                return;
-            }
-
-            /* figure out where the previous 2 blocks started */
-            if (pixel_ptr == 0)
-                prev_block_ptr1 = (row_ptr - s->avctx->width * 4) +
-                    s->avctx->width - 4 * 2;
-            else if (pixel_ptr == 4)
-                prev_block_ptr1 = (row_ptr - s->avctx->width * 4) + row_inc;
-            else
-                prev_block_ptr1 = row_ptr + pixel_ptr - 4 * 2;
-
-            if (pixel_ptr == 0)
-                prev_block_ptr2 = (row_ptr - s->avctx->width * 4) + row_inc;
-            else
-                prev_block_ptr2 = row_ptr + pixel_ptr - 4;
-
-            prev_block_flag = 0;
-            while (n_blocks--) {
-                block_ptr = row_ptr + pixel_ptr;
-                if (prev_block_flag)
-                    prev_block_ptr = prev_block_ptr2;
-                else
-                    prev_block_ptr = prev_block_ptr1;
-                prev_block_flag = !prev_block_flag;
-
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++) {
-                        pixels[block_ptr++] = pixels[prev_block_ptr++];
-                    }
-                    block_ptr += row_inc;
-                    prev_block_ptr += row_inc;
-                }
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        /* 1-color block encoding */
-        case 0x60:
-        case 0x70:
-            n_blocks = GET_BLOCK_COUNT();
-            pixel = bytestream2_get_byte(&s->gb);
-
-            while (n_blocks--) {
-                block_ptr = row_ptr + pixel_ptr;
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++) {
-                        pixels[block_ptr++] = pixel;
-                    }
-                    block_ptr += row_inc;
-                }
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        /* 2-color block encoding */
-        case 0x80:
-        case 0x90:
-            n_blocks = (opcode & 0x0F) + 1;
-
-            /* figure out which color pair to use to paint the 2-color block */
-            if ((opcode & 0xF0) == 0x80) {
-                /* fetch the next 2 colors from bytestream and store in next
-                 * available entry in the color pair table */
-                for (i = 0; i < CPAIR; i++) {
-                    pixel = bytestream2_get_byte(&s->gb);
-                    color_table_index = CPAIR * color_pair_index + i;
-                    s->color_pairs[color_table_index] = pixel;
-                }
-                /* this is the base index to use for this block */
-                color_table_index = CPAIR * color_pair_index;
-                color_pair_index++;
-                /* wraparound */
-                if (color_pair_index == COLORS_PER_TABLE)
-                    color_pair_index = 0;
-            } else
-                color_table_index = CPAIR * bytestream2_get_byte(&s->gb);
-
-            while (n_blocks--) {
-                color_flags = bytestream2_get_be16(&s->gb);
-                flag_mask = 0x8000;
-                block_ptr = row_ptr + pixel_ptr;
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++) {
-                        if (color_flags & flag_mask)
-                            pixel = color_table_index + 1;
-                        else
-                            pixel = color_table_index;
-                        flag_mask >>= 1;
-                        pixels[block_ptr++] = s->color_pairs[pixel];
-                    }
-                    block_ptr += row_inc;
-                }
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        /* 4-color block encoding */
-        case 0xA0:
-        case 0xB0:
-            n_blocks = (opcode & 0x0F) + 1;
-
-            /* figure out which color quad to use to paint the 4-color block */
-            if ((opcode & 0xF0) == 0xA0) {
-                /* fetch the next 4 colors from bytestream and store in next
-                 * available entry in the color quad table */
-                for (i = 0; i < CQUAD; i++) {
-                    pixel = bytestream2_get_byte(&s->gb);
-                    color_table_index = CQUAD * color_quad_index + i;
-                    s->color_quads[color_table_index] = pixel;
-                }
-                /* this is the base index to use for this block */
-                color_table_index = CQUAD * color_quad_index;
-                color_quad_index++;
-                /* wraparound */
-                if (color_quad_index == COLORS_PER_TABLE)
-                    color_quad_index = 0;
-            } else
-                color_table_index = CQUAD * bytestream2_get_byte(&s->gb);
-
-            while (n_blocks--) {
-                color_flags = bytestream2_get_be32(&s->gb);
-                /* flag mask actually acts as a bit shift count here */
-                flag_mask = 30;
-                block_ptr = row_ptr + pixel_ptr;
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++) {
-                        pixel = color_table_index +
-                            ((color_flags >> flag_mask) & 0x03);
-                        flag_mask -= 2;
-                        pixels[block_ptr++] = s->color_quads[pixel];
-                    }
-                    block_ptr += row_inc;
-                }
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        /* 8-color block encoding */
-        case 0xC0:
-        case 0xD0:
-            n_blocks = (opcode & 0x0F) + 1;
-
-            /* figure out which color octet to use to paint the 8-color block */
-            if ((opcode & 0xF0) == 0xC0) {
-                /* fetch the next 8 colors from bytestream and store in next
-                 * available entry in the color octet table */
-                for (i = 0; i < COCTET; i++) {
-                    pixel = bytestream2_get_byte(&s->gb);
-                    color_table_index = COCTET * color_octet_index + i;
-                    s->color_octets[color_table_index] = pixel;
-                }
-                /* this is the base index to use for this block */
-                color_table_index = COCTET * color_octet_index;
-                color_octet_index++;
-                /* wraparound */
-                if (color_octet_index == COLORS_PER_TABLE)
-                    color_octet_index = 0;
-            } else
-                color_table_index = COCTET * bytestream2_get_byte(&s->gb);
-
-            while (n_blocks--) {
-                /*
-                  For this input of 6 hex bytes:
-                    01 23 45 67 89 AB
-                  Mangle it to this output:
-                    flags_a = xx012456, flags_b = xx89A37B
-                */
-                /* build the color flags */
-                int val1 = bytestream2_get_be16(&s->gb);
-                int val2 = bytestream2_get_be16(&s->gb);
-                int val3 = bytestream2_get_be16(&s->gb);
-                color_flags_a = ((val1 & 0xFFF0) << 8) | (val2 >> 4);
-                color_flags_b = ((val3 & 0xFFF0) << 8) |
-                    ((val1 & 0x0F) << 8) | ((val2 & 0x0F) << 4) | (val3 & 0x0F);
-
-                color_flags = color_flags_a;
-                /* flag mask actually acts as a bit shift count here */
-                flag_mask = 21;
-                block_ptr = row_ptr + pixel_ptr;
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    /* reload flags at third row (iteration pixel_y == 2) */
-                    if (pixel_y == 2) {
-                        color_flags = color_flags_b;
-                        flag_mask = 21;
-                    }
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++) {
-                        pixel = color_table_index +
-                            ((color_flags >> flag_mask) & 0x07);
-                        flag_mask -= 3;
-                        pixels[block_ptr++] = s->color_octets[pixel];
-                    }
-                    block_ptr += row_inc;
-                }
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        /* 16-color block encoding (every pixel is a different color) */
-        case 0xE0:
-            n_blocks = (opcode & 0x0F) + 1;
-
-            while (n_blocks--) {
-                block_ptr = row_ptr + pixel_ptr;
-                for (pixel_y = 0; pixel_y < 4; pixel_y++) {
-                    for (pixel_x = 0; pixel_x < 4; pixel_x++) {
-                        pixels[block_ptr++] = bytestream2_get_byte(&s->gb);
-                    }
-                    block_ptr += row_inc;
-                }
-                ADVANCE_BLOCK();
-            }
-            break;
-
-        case 0xF0:
-            avpriv_request_sample(s->avctx, "0xF0 opcode");
-            break;
-        }
-    }
-
-    return;
-}
-
-static av_cold int smc_decode_init(AVCodecContext *avctx)
-{
-    SmcContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int smc_decode_frame(AVCodecContext *avctx,
-                             void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    SmcContext *s = avctx->priv_data;
-    const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-    int ret;
-
-    bytestream2_init(&s->gb, buf, buf_size);
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    if (pal) {
-        s->frame->palette_has_changed = 1;
-        memcpy(s->pal, pal, AVPALETTE_SIZE);
-    }
-
-    smc_decode_stream(s);
-
-    *got_frame      = 1;
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int smc_decode_end(AVCodecContext *avctx)
-{
-    SmcContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_smc_decoder = {
-    .name           = "smc",
-    .long_name      = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SMC,
-    .priv_data_size = sizeof(SmcContext),
-    .init           = smc_decode_init,
-    .close          = smc_decode_end,
-    .decode         = smc_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/sp5x.h b/deps/libav/libavcodec/sp5x.h
deleted file mode 100644
index 1577302..0000000
--- a/deps/libav/libavcodec/sp5x.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Sunplus JPEG tables
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SP5X_H
-#define AVCODEC_SP5X_H
-
-#include <stdint.h>
-
-static const uint8_t sp5x_data_sof[] =
-{
-    0xFF, 0xC0,       /* SOF */
-    0x00, 0x11,       /* len */
-    0x08,             /* bits */
-    0x00, 0xf0,       /* height (default: 240) */
-    0x01, 0x40,       /* width (default: 240) */
-    0x03,             /* nb components */
-    0x01, 0x22, 0x00, /* 21 vs 22 ? */
-    0x02, 0x11, 0x01,
-    0x03, 0x11, 0x01
-};
-
-static const uint8_t sp5x_data_sos[] =
-{
-    0xFF, 0xDA,       /* SOS */
-    0x00, 0x0C,       /* len */
-    0x03,             /* nb components */
-    0x01, 0x00,
-    0x02, 0x11,
-    0x03, 0x11,
-    0x00,             /* Ss */
-    0x3F,             /* Se */
-    0x00              /* Ah/Al */
-};
-
-static const uint8_t sp5x_data_dqt[] =
-{
-    0xFF, 0xDB, /* DQT */
-    0x00, 0x84, /* len */
-    0x00,
-    0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, 0x04,
-    0x04, 0x04, 0x06, 0x05, 0x05, 0x06, 0x08, 0x0D,
-    0x08, 0x08, 0x07, 0x07, 0x08, 0x10, 0x0C, 0x0C,
-    0x0A, 0x0D, 0x14, 0x11, 0x15, 0x14, 0x13, 0x11,
-    0x13, 0x13, 0x16, 0x18, 0x1F, 0x1A, 0x16, 0x17,
-    0x1E, 0x17, 0x13, 0x13, 0x1B, 0x25, 0x1C, 0x1E,
-    0x20, 0x21, 0x23, 0x23, 0x23, 0x15, 0x1A, 0x27,
-    0x29, 0x26, 0x22, 0x29, 0x1F, 0x22, 0x23, 0x22,
-    0x01,
-    0x05, 0x06, 0x06, 0x08, 0x07, 0x08, 0x10, 0x08,
-    0x08, 0x10, 0x22, 0x16, 0x13, 0x16, 0x22, 0x22,
-    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
-    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
-    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
-    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
-    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
-    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22
-};
-
-static const uint8_t sp5x_data_dht[] = {
-    0xFF, 0xC4, /* DHT */
-    0x01, 0xA2, /* len */
-    0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01,
-    0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
-    0x07, 0x08, 0x09, 0x0A, 0x0B, 0x01, 0x00, 0x03,
-    0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
-    0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
-    0x0A, 0x0B, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03,
-    0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00,
-    0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04,
-    0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13,
-    0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81,
-    0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15,
-    0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82,
-    0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25,
-    0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36,
-    0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46,
-    0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56,
-    0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66,
-    0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76,
-    0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86,
-    0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95,
-    0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4,
-    0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3,
-    0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2,
-    0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA,
-    0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9,
-    0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
-    0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5,
-    0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0x11, 0x00, 0x02,
-    0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05,
-    0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01,
-    0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06,
-    0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22,
-    0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1,
-    0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62,
-    0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25,
-    0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28,
-    0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
-    0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A,
-    0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A,
-    0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A,
-    0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A,
-    0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
-    0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
-    0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
-    0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6,
-    0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5,
-    0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4,
-    0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3,
-    0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2,
-    0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA
-};
-
-
-static const uint8_t sp5x_quant_table[20][64]=
-{
-    /* index 0, Q50 */
-    {  16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16, 19, 24, 40,
-       26, 24, 22, 22, 24, 49, 35, 37, 29, 40, 58, 51, 61, 60, 57, 51,
-       56, 55, 64, 72, 92, 78, 64, 68, 87, 69, 55, 56, 80,109, 81, 87,
-       95, 98,103,104,103, 62, 77,113,121,112,100,120, 92,101,103, 99 },
-    {  17, 18, 18, 24, 21, 24, 47, 26, 26, 47, 99, 66, 56, 66, 99, 99,
-       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
-       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
-       99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99 },
-
-    /* index 1, Q70 */
-    {  10,  7,  7,  8,  7,  6, 10,  8,  8,  8, 11, 10, 10, 11, 14, 24,
-       16, 14, 13, 13, 14, 29, 21, 22, 17, 24, 35, 31, 37, 36, 34, 31,
-       34, 33, 38, 43, 55, 47, 38, 41, 52, 41, 33, 34, 48, 65, 49, 52,
-       57, 59, 62, 62, 62, 37, 46, 68, 73, 67, 60, 72, 55, 61, 62, 59 },
-    {  10, 11, 11, 14, 13, 14, 28, 16, 16, 28, 59, 40, 34, 40, 59, 59,
-       59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
-       59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
-       59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59 },
-
-    /* index 2, Q80 */
-    {   6,  4,  5,  6,  5,  4,  6,  6,  5,  6,  7,  7,  6,  8, 10, 16,
-       10, 10,  9,  9, 10, 20, 14, 15, 12, 16, 23, 20, 24, 24, 23, 20,
-       22, 22, 26, 29, 37, 31, 26, 27, 35, 28, 22, 22, 32, 44, 32, 35,
-       38, 39, 41, 42, 41, 25, 31, 45, 48, 45, 40, 48, 37, 40, 41, 40 },
-    {   7,  7,  7, 10,  8, 10, 19, 10, 10, 19, 40, 26, 22, 26, 40, 40,
-       40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
-       40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
-       40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40 },
-
-    /* index 3, Q85 */
-    {   5,  3,  4,  4,  4,  3,  5,  4,  4,  4,  5,  5,  5,  6,  7, 12,
-        8,  7,  7,  7,  7, 15, 11, 11,  9, 12, 17, 15, 18, 18, 17, 15,
-       17, 17, 19, 22, 28, 23, 19, 20, 26, 21, 17, 17, 24, 33, 24, 26,
-       29, 29, 31, 31, 31, 19, 23, 34, 36, 34, 30, 36, 28, 30, 31, 30 },
-    {   5,  5,  5,  7,  6,  7, 14,  8,  8, 14, 30, 20, 17, 20, 30, 30,
-       30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
-       30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
-       30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 },
-
-    /* index 4, Q90 */
-    {   3,  2,  2,  3,  2,  2,  3,  3,  3,  3,  4,  3,  3,  4,  5,  8,
-        5,  5,  4,  4,  5, 10,  7,  7,  6,  8, 12, 10, 12, 12, 11, 10,
-       11, 11, 13, 14, 18, 16, 13, 14, 17, 14, 11, 11, 16, 22, 16, 17,
-       19, 20, 21, 21, 21, 12, 15, 23, 24, 22, 20, 24, 18, 20, 21, 20 },
-    {   3,  4,  4,  5,  4,  5,  9,  5,  5,  9, 20, 13, 11, 13, 20, 20,
-       20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-       20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-       20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 },
-
-    /* index 5, Q60 */
-    {  13,  9, 10, 11, 10,  8, 13, 11, 10, 11, 14, 14, 13, 15, 19, 32,
-       21, 19, 18, 18, 19, 39, 28, 30, 23, 32, 46, 41, 49, 48, 46, 41,
-       45, 44, 51, 58, 74, 62, 51, 54, 70, 55, 44, 45, 64, 87, 65, 70,
-       76, 78, 82, 83, 82, 50, 62, 90, 97, 90, 80, 96, 74, 81, 82, 79 },
-    {  14, 14, 14, 19, 17, 19, 38, 21, 21, 38, 79, 53, 45, 53, 79, 79,
-       79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
-       79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
-       79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79 },
-
-    /* index 6, Q25 */
-    {  32, 22, 24, 28, 24, 20, 32, 28, 26, 28, 36, 34, 32, 38, 48, 80,
-       52, 48, 44, 44, 48, 98, 70, 74, 58, 80,116,102,122,120,114,102,
-      112,110,128,144,184,156,128,136,174,138,110,112,160,218,162,174,
-      190,196,206,208,206,124,154,226,242,224,200,240,184,202,206,198 },
-    {  34, 36, 36, 48, 42, 48, 94, 52, 52, 94,198,132,112,132,198,198,
-      198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,
-      198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,
-      198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198 },
-
-    /* index 7, Q95 */
-    {   2,  1,  1,  1,  1,  1,  2,  1,  1,  1,  2,  2,  2,  2,  2,  4,
-        3,  2,  2,  2,  2,  5,  4,  4,  3,  4,  6,  5,  6,  6,  6,  5,
-        6,  6,  6,  7,  9,  8,  6,  7,  9,  7,  6,  6,  8, 11,  8,  9,
-       10, 10, 10, 10, 10,  6,  8, 11, 12, 11, 10, 12,  9, 10, 10, 10 },
-    {   2,  2,  2,  2,  2,  2,  5,  3,  3,  5, 10,  7,  6,  7, 10, 10,
-       10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-       10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-       10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 },
-
-    /* index 8, Q93 */
-    {   2,  2,  2,  2,  2,  1,  2,  2,  2,  2,  3,  2,  2,  3,  3,  6,
-        4,  3,  3,  3,  3,  7,  5,  5,  4,  6,  8,  7,  9,  8,  8,  7,
-        8,  8,  9, 10, 13, 11,  9, 10, 12, 10,  8,  8, 11, 15, 11, 12,
-       13, 14, 14, 15, 14,  9, 11, 16, 17, 16, 14, 17, 13, 14, 14, 14 },
-    {   2,  3,  3,  3,  3,  3,  7,  4,  4,  7, 14,  9,  8,  9, 14, 14,
-       14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-       14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-       14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 },
-
-    /* index 9, Q40 */
-    {  20, 14, 15, 18, 15, 13, 20, 18, 16, 18, 23, 21, 20, 24, 30, 50,
-       33, 30, 28, 28, 30, 61, 44, 46, 36, 50, 73, 64, 76, 75, 71, 64,
-       70, 69, 80, 90,115, 98, 80, 85,109, 86, 69, 70,100,136,101,109,
-      119,123,129,130,129, 78, 96,141,151,140,125,150,115,126,129,124 },
-    {  21, 23, 23, 30, 26, 30, 59, 33, 33, 59,124, 83, 70, 83,124,124,
-      124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,
-      124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,
-      124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124 }
-};
-
-#endif /* AVCODEC_SP5X_H */
diff --git a/deps/libav/libavcodec/sp5xdec.c b/deps/libav/libavcodec/sp5xdec.c
deleted file mode 100644
index ca6b9fd..0000000
--- a/deps/libav/libavcodec/sp5xdec.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Sunplus JPEG decoder (SP5X)
- * Copyright (c) 2003 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sunplus JPEG decoder (SP5X).
- */
-
-#include "avcodec.h"
-#include "mjpeg.h"
-#include "mjpegdec.h"
-#include "sp5x.h"
-
-
-static int sp5x_decode_frame(AVCodecContext *avctx,
-                              void *data, int *got_frame,
-                              AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    AVPacket avpkt_recoded;
-    const int qscale = 5;
-    uint8_t *recoded;
-    int i = 0, j = 0;
-
-    if (!avctx->width || !avctx->height)
-        return -1;
-
-    recoded = av_mallocz(buf_size + 1024);
-    if (!recoded)
-        return -1;
-
-    /* SOI */
-    recoded[j++] = 0xFF;
-    recoded[j++] = 0xD8;
-
-    memcpy(recoded+j, &sp5x_data_dqt[0], sizeof(sp5x_data_dqt));
-    memcpy(recoded+j+5, &sp5x_quant_table[qscale * 2], 64);
-    memcpy(recoded+j+70, &sp5x_quant_table[(qscale * 2) + 1], 64);
-    j += sizeof(sp5x_data_dqt);
-
-    memcpy(recoded+j, &sp5x_data_dht[0], sizeof(sp5x_data_dht));
-    j += sizeof(sp5x_data_dht);
-
-    memcpy(recoded+j, &sp5x_data_sof[0], sizeof(sp5x_data_sof));
-    AV_WB16(recoded+j+5, avctx->coded_height);
-    AV_WB16(recoded+j+7, avctx->coded_width);
-    j += sizeof(sp5x_data_sof);
-
-    memcpy(recoded+j, &sp5x_data_sos[0], sizeof(sp5x_data_sos));
-    j += sizeof(sp5x_data_sos);
-
-    if(avctx->codec_id==AV_CODEC_ID_AMV)
-        for (i = 2; i < buf_size-2 && j < buf_size+1024-2; i++)
-            recoded[j++] = buf[i];
-    else
-    for (i = 14; i < buf_size && j < buf_size+1024-2; i++)
-    {
-        recoded[j++] = buf[i];
-        if (buf[i] == 0xff)
-            recoded[j++] = 0;
-    }
-
-    /* EOI */
-    recoded[j++] = 0xFF;
-    recoded[j++] = 0xD9;
-
-    av_init_packet(&avpkt_recoded);
-    avpkt_recoded.data = recoded;
-    avpkt_recoded.size = j;
-    i = ff_mjpeg_decode_frame(avctx, data, got_frame, &avpkt_recoded);
-
-    av_free(recoded);
-
-    return i;
-}
-
-AVCodec ff_sp5x_decoder = {
-    .name           = "sp5x",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sunplus JPEG (SP5X)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SP5X,
-    .priv_data_size = sizeof(MJpegDecodeContext),
-    .init           = ff_mjpeg_decode_init,
-    .close          = ff_mjpeg_decode_end,
-    .decode         = sp5x_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-AVCodec ff_amv_decoder = {
-    .name           = "amv",
-    .long_name      = NULL_IF_CONFIG_SMALL("AMV Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_AMV,
-    .priv_data_size = sizeof(MJpegDecodeContext),
-    .init           = ff_mjpeg_decode_init,
-    .close          = ff_mjpeg_decode_end,
-    .decode         = sp5x_decode_frame,
-};
diff --git a/deps/libav/libavcodec/sparc/Makefile b/deps/libav/libavcodec/sparc/Makefile
deleted file mode 100644
index aeb0f47..0000000
--- a/deps/libav/libavcodec/sparc/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-VIS-OBJS += sparc/dsputil_vis.o                                         \
-            sparc/simple_idct_vis.o                                     \
-
-VIS-OBJS-$(CONFIG_HPELDSP) += sparc/hpeldsp_vis.o
diff --git a/deps/libav/libavcodec/sparc/dsputil_vis.c b/deps/libav/libavcodec/sparc/dsputil_vis.c
deleted file mode 100644
index cee2e1d..0000000
--- a/deps/libav/libavcodec/sparc/dsputil_vis.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2003 David S. Miller <davem at redhat.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavcodec/dsputil.h"
-#include "dsputil_vis.h"
-#include "vis.h"
-
-av_cold void ff_dsputil_init_vis(DSPContext *c, AVCodecContext *avctx)
-{
-  /* VIS-specific optimizations */
-  int accel = vis_level ();
-  const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-  if (accel & ACCEL_SPARC_VIS && !high_bit_depth) {
-      if (avctx->idct_algo == FF_IDCT_SIMPLEVIS) {
-          c->idct_put = ff_simple_idct_put_vis;
-          c->idct_add = ff_simple_idct_add_vis;
-          c->idct     = ff_simple_idct_vis;
-          c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
-      }
-  }
-}
diff --git a/deps/libav/libavcodec/sparc/dsputil_vis.h b/deps/libav/libavcodec/sparc/dsputil_vis.h
deleted file mode 100644
index d7f6e01..0000000
--- a/deps/libav/libavcodec/sparc/dsputil_vis.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SPARC_DSPUTIL_VIS_H
-#define AVCODEC_SPARC_DSPUTIL_VIS_H
-
-#include <stdint.h>
-
-void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_vis(int16_t *data);
-
-#endif /* AVCODEC_SPARC_DSPUTIL_VIS_H */
diff --git a/deps/libav/libavcodec/sparc/hpeldsp_vis.c b/deps/libav/libavcodec/sparc/hpeldsp_vis.c
deleted file mode 100644
index bca32e2..0000000
--- a/deps/libav/libavcodec/sparc/hpeldsp_vis.c
+++ /dev/null
@@ -1,3524 +0,0 @@
-/*
- * Copyright (C) 2003 David S. Miller <davem at redhat.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* The *no_round* functions have been added by James A. Morrison, 2003,2004.
-   The vis code from libmpeg2 was adapted for libavcodec by James A. Morrison.
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-#include "libavcodec/hpeldsp.h"
-#include "vis.h"
-
-/* The trick used in some of this file is the formula from the MMX
- * motion comp code, which is:
- *
- * (x+y+1)>>1 == (x|y)-((x^y)>>1)
- *
- * This allows us to average 8 bytes at a time in a 64-bit FPU reg.
- * We avoid overflows by masking before we do the shift, and we
- * implement the shift by multiplying by 1/2 using mul8x16.  So in
- * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask
- * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and
- * the value 0x80808080 is in f8):
- *
- *      fxor            f0,   f2, f10
- *      fand            f10,  f4, f10
- *      fmul8x16        f8,  f10, f10
- *      fand            f10,  f6, f10
- *      for             f0,   f2, f12
- *      fpsub16         f12, f10, f10
- */
-
-#define DUP4(x) {x, x, x, x}
-#define DUP8(x) {x, x, x, x, x, x, x, x}
-DECLARE_ALIGNED(8, static const int16_t, constants1)[] = DUP4 (1);
-DECLARE_ALIGNED(8, static const int16_t, constants2)[] = DUP4 (2);
-DECLARE_ALIGNED(8, static const int16_t, constants3)[] = DUP4 (3);
-DECLARE_ALIGNED(8, static const int16_t, constants6)[] = DUP4 (6);
-DECLARE_ALIGNED(8, static const int8_t, constants_fe)[] = DUP8 (0xfe);
-DECLARE_ALIGNED(8, static const int8_t, constants_7f)[] = DUP8 (0x7f);
-DECLARE_ALIGNED(8, static const int8_t, constants128)[] = DUP8 (128);
-DECLARE_ALIGNED(8, static const int16_t, constants256_512)[] =
-        {256, 512, 256, 512};
-DECLARE_ALIGNED(8, static const int16_t, constants256_1024)[] =
-        {256, 1024, 256, 1024};
-
-#define REF_0           0
-#define REF_0_1         1
-#define REF_2           2
-#define REF_2_1         3
-#define REF_4           4
-#define REF_4_1         5
-#define REF_6           6
-#define REF_6_1         7
-#define REF_S0          8
-#define REF_S0_1        9
-#define REF_S2          10
-#define REF_S2_1        11
-#define REF_S4          12
-#define REF_S4_1        13
-#define REF_S6          14
-#define REF_S6_1        15
-#define DST_0           16
-#define DST_1           17
-#define DST_2           18
-#define DST_3           19
-#define CONST_1         20
-#define CONST_2         20
-#define CONST_3         20
-#define CONST_6         20
-#define MASK_fe         20
-#define CONST_128       22
-#define CONST_256       22
-#define CONST_512       22
-#define CONST_1024      22
-#define TMP0            24
-#define TMP1            25
-#define TMP2            26
-#define TMP3            27
-#define TMP4            28
-#define TMP5            29
-#define ZERO            30
-#define MASK_7f         30
-
-#define TMP6            32
-#define TMP8            34
-#define TMP10           36
-#define TMP12           38
-#define TMP14           40
-#define TMP16           42
-#define TMP18           44
-#define TMP20           46
-#define TMP22           48
-#define TMP24           50
-#define TMP26           52
-#define TMP28           54
-#define TMP30           56
-#define TMP32           58
-
-static void MC_put_o_16_vis (uint8_t * dest, const uint8_t * ref,
-                             const ptrdiff_t stride, int height)
-{
-        ref = vis_alignaddr(ref);
-        do {    /* 5 cycles */
-                vis_ld64(ref[0], TMP0);
-
-                vis_ld64_2(ref, 8, TMP2);
-
-                vis_ld64_2(ref, 16, TMP4);
-                ref += stride;
-
-                vis_faligndata(TMP0, TMP2, REF_0);
-                vis_st64(REF_0, dest[0]);
-
-                vis_faligndata(TMP2, TMP4, REF_2);
-                vis_st64_2(REF_2, dest, 8);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_put_o_8_vis (uint8_t * dest, const uint8_t * ref,
-                            const ptrdiff_t stride, int height)
-{
-        ref = vis_alignaddr(ref);
-        do {    /* 4 cycles */
-                vis_ld64(ref[0], TMP0);
-
-                vis_ld64(ref[8], TMP2);
-                ref += stride;
-
-                /* stall */
-
-                vis_faligndata(TMP0, TMP2, REF_0);
-                vis_st64(REF_0, dest[0]);
-                dest += stride;
-        } while (--height);
-}
-
-
-static void MC_avg_o_16_vis (uint8_t * dest, const uint8_t * ref,
-                             const ptrdiff_t stride, int height)
-{
-        int stride_8 = stride + 8;
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[0], TMP0);
-
-        vis_ld64(ref[8], TMP2);
-
-        vis_ld64(ref[16], TMP4);
-
-        vis_ld64(dest[0], DST_0);
-
-        vis_ld64(dest[8], DST_2);
-
-        vis_ld64(constants_fe[0], MASK_fe);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-        vis_faligndata(TMP2, TMP4, REF_2);
-
-        vis_ld64(constants128[0], CONST_128);
-
-        ref += stride;
-        height = (height >> 1) - 1;
-
-        do {    /* 24 cycles */
-                vis_ld64(ref[0], TMP0);
-                vis_xor(DST_0, REF_0, TMP6);
-
-                vis_ld64_2(ref, 8, TMP2);
-                vis_and(TMP6, MASK_fe, TMP6);
-
-                vis_ld64_2(ref, 16, TMP4);
-                ref += stride;
-                vis_mul8x16(CONST_128, TMP6, TMP6);
-                vis_xor(DST_2, REF_2, TMP8);
-
-                vis_and(TMP8, MASK_fe, TMP8);
-
-                vis_or(DST_0, REF_0, TMP10);
-                vis_ld64_2(dest, stride, DST_0);
-                vis_mul8x16(CONST_128, TMP8, TMP8);
-
-                vis_or(DST_2, REF_2, TMP12);
-                vis_ld64_2(dest, stride_8, DST_2);
-
-                vis_ld64(ref[0], TMP14);
-                vis_and(TMP6, MASK_7f, TMP6);
-
-                vis_and(TMP8, MASK_7f, TMP8);
-
-                vis_psub16(TMP10, TMP6, TMP6);
-                vis_st64(TMP6, dest[0]);
-
-                vis_psub16(TMP12, TMP8, TMP8);
-                vis_st64_2(TMP8, dest, 8);
-
-                dest += stride;
-                vis_ld64_2(ref, 8, TMP16);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, 16, TMP18);
-                vis_faligndata(TMP2, TMP4, REF_2);
-                ref += stride;
-
-                vis_xor(DST_0, REF_0, TMP20);
-
-                vis_and(TMP20, MASK_fe, TMP20);
-
-                vis_xor(DST_2, REF_2, TMP22);
-                vis_mul8x16(CONST_128, TMP20, TMP20);
-
-                vis_and(TMP22, MASK_fe, TMP22);
-
-                vis_or(DST_0, REF_0, TMP24);
-                vis_mul8x16(CONST_128, TMP22, TMP22);
-
-                vis_or(DST_2, REF_2, TMP26);
-
-                vis_ld64_2(dest, stride, DST_0);
-                vis_faligndata(TMP14, TMP16, REF_0);
-
-                vis_ld64_2(dest, stride_8, DST_2);
-                vis_faligndata(TMP16, TMP18, REF_2);
-
-                vis_and(TMP20, MASK_7f, TMP20);
-
-                vis_and(TMP22, MASK_7f, TMP22);
-
-                vis_psub16(TMP24, TMP20, TMP20);
-                vis_st64(TMP20, dest[0]);
-
-                vis_psub16(TMP26, TMP22, TMP22);
-                vis_st64_2(TMP22, dest, 8);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0], TMP0);
-        vis_xor(DST_0, REF_0, TMP6);
-
-        vis_ld64_2(ref, 8, TMP2);
-        vis_and(TMP6, MASK_fe, TMP6);
-
-        vis_ld64_2(ref, 16, TMP4);
-        vis_mul8x16(CONST_128, TMP6, TMP6);
-        vis_xor(DST_2, REF_2, TMP8);
-
-        vis_and(TMP8, MASK_fe, TMP8);
-
-        vis_or(DST_0, REF_0, TMP10);
-        vis_ld64_2(dest, stride, DST_0);
-        vis_mul8x16(CONST_128, TMP8, TMP8);
-
-        vis_or(DST_2, REF_2, TMP12);
-        vis_ld64_2(dest, stride_8, DST_2);
-
-        vis_ld64(ref[0], TMP14);
-        vis_and(TMP6, MASK_7f, TMP6);
-
-        vis_and(TMP8, MASK_7f, TMP8);
-
-        vis_psub16(TMP10, TMP6, TMP6);
-        vis_st64(TMP6, dest[0]);
-
-        vis_psub16(TMP12, TMP8, TMP8);
-        vis_st64_2(TMP8, dest, 8);
-
-        dest += stride;
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_faligndata(TMP2, TMP4, REF_2);
-
-        vis_xor(DST_0, REF_0, TMP20);
-
-        vis_and(TMP20, MASK_fe, TMP20);
-
-        vis_xor(DST_2, REF_2, TMP22);
-        vis_mul8x16(CONST_128, TMP20, TMP20);
-
-        vis_and(TMP22, MASK_fe, TMP22);
-
-        vis_or(DST_0, REF_0, TMP24);
-        vis_mul8x16(CONST_128, TMP22, TMP22);
-
-        vis_or(DST_2, REF_2, TMP26);
-
-        vis_and(TMP20, MASK_7f, TMP20);
-
-        vis_and(TMP22, MASK_7f, TMP22);
-
-        vis_psub16(TMP24, TMP20, TMP20);
-        vis_st64(TMP20, dest[0]);
-
-        vis_psub16(TMP26, TMP22, TMP22);
-        vis_st64_2(TMP22, dest, 8);
-}
-
-static void MC_avg_o_8_vis (uint8_t * dest, const uint8_t * ref,
-                            const ptrdiff_t stride, int height)
-{
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[0], TMP0);
-
-        vis_ld64(ref[8], TMP2);
-
-        vis_ld64(dest[0], DST_0);
-
-        vis_ld64(constants_fe[0], MASK_fe);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_ld64(constants128[0], CONST_128);
-
-        ref += stride;
-        height = (height >> 1) - 1;
-
-        do {    /* 12 cycles */
-                vis_ld64(ref[0], TMP0);
-                vis_xor(DST_0, REF_0, TMP4);
-
-                vis_ld64(ref[8], TMP2);
-                vis_and(TMP4, MASK_fe, TMP4);
-
-                vis_or(DST_0, REF_0, TMP6);
-                vis_ld64_2(dest, stride, DST_0);
-                ref += stride;
-                vis_mul8x16(CONST_128, TMP4, TMP4);
-
-                vis_ld64(ref[0], TMP12);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64(ref[8], TMP2);
-                vis_xor(DST_0, REF_0, TMP0);
-                ref += stride;
-
-                vis_and(TMP0, MASK_fe, TMP0);
-
-                vis_and(TMP4, MASK_7f, TMP4);
-
-                vis_psub16(TMP6, TMP4, TMP4);
-                vis_st64(TMP4, dest[0]);
-                dest += stride;
-                vis_mul8x16(CONST_128, TMP0, TMP0);
-
-                vis_or(DST_0, REF_0, TMP6);
-                vis_ld64_2(dest, stride, DST_0);
-
-                vis_faligndata(TMP12, TMP2, REF_0);
-
-                vis_and(TMP0, MASK_7f, TMP0);
-
-                vis_psub16(TMP6, TMP0, TMP4);
-                vis_st64(TMP4, dest[0]);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0], TMP0);
-        vis_xor(DST_0, REF_0, TMP4);
-
-        vis_ld64(ref[8], TMP2);
-        vis_and(TMP4, MASK_fe, TMP4);
-
-        vis_or(DST_0, REF_0, TMP6);
-        vis_ld64_2(dest, stride, DST_0);
-        vis_mul8x16(CONST_128, TMP4, TMP4);
-
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_xor(DST_0, REF_0, TMP0);
-
-        vis_and(TMP0, MASK_fe, TMP0);
-
-        vis_and(TMP4, MASK_7f, TMP4);
-
-        vis_psub16(TMP6, TMP4, TMP4);
-        vis_st64(TMP4, dest[0]);
-        dest += stride;
-        vis_mul8x16(CONST_128, TMP0, TMP0);
-
-        vis_or(DST_0, REF_0, TMP6);
-
-        vis_and(TMP0, MASK_7f, TMP0);
-
-        vis_psub16(TMP6, TMP0, TMP4);
-        vis_st64(TMP4, dest[0]);
-}
-
-static void MC_put_x_16_vis (uint8_t * dest, const uint8_t * ref,
-                             const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[0],    TMP0);
-
-        vis_ld64_2(ref, 8,  TMP2);
-
-        vis_ld64_2(ref, 16, TMP4);
-
-        vis_ld64(constants_fe[0], MASK_fe);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_ld64(constants128[0], CONST_128);
-        vis_faligndata(TMP2, TMP4, REF_4);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_2);
-                vis_faligndata(TMP2, TMP4, REF_6);
-        } else {
-                vis_src1(TMP2, REF_2);
-                vis_src1(TMP4, REF_6);
-        }
-
-        ref += stride;
-        height = (height >> 1) - 1;
-
-        do {    /* 34 cycles */
-                vis_ld64(ref[0],    TMP0);
-                vis_xor(REF_0, REF_2, TMP6);
-
-                vis_ld64_2(ref, 8,  TMP2);
-                vis_xor(REF_4, REF_6, TMP8);
-
-                vis_ld64_2(ref, 16, TMP4);
-                vis_and(TMP6, MASK_fe, TMP6);
-                ref += stride;
-
-                vis_ld64(ref[0],    TMP14);
-                vis_mul8x16(CONST_128, TMP6, TMP6);
-                vis_and(TMP8, MASK_fe, TMP8);
-
-                vis_ld64_2(ref, 8,  TMP16);
-                vis_mul8x16(CONST_128, TMP8, TMP8);
-                vis_or(REF_0, REF_2, TMP10);
-
-                vis_ld64_2(ref, 16, TMP18);
-                ref += stride;
-                vis_or(REF_4, REF_6, TMP12);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                        vis_faligndata(TMP2, TMP4, REF_6);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                        vis_src1(TMP4, REF_6);
-                }
-
-                vis_and(TMP6, MASK_7f, TMP6);
-
-                vis_and(TMP8, MASK_7f, TMP8);
-
-                vis_psub16(TMP10, TMP6, TMP6);
-                vis_st64(TMP6, dest[0]);
-
-                vis_psub16(TMP12, TMP8, TMP8);
-                vis_st64_2(TMP8, dest, 8);
-                dest += stride;
-
-                vis_xor(REF_0, REF_2, TMP6);
-
-                vis_xor(REF_4, REF_6, TMP8);
-
-                vis_and(TMP6, MASK_fe, TMP6);
-
-                vis_mul8x16(CONST_128, TMP6, TMP6);
-                vis_and(TMP8, MASK_fe, TMP8);
-
-                vis_mul8x16(CONST_128, TMP8, TMP8);
-                vis_or(REF_0, REF_2, TMP10);
-
-                vis_or(REF_4, REF_6, TMP12);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_faligndata(TMP14, TMP16, REF_0);
-
-                vis_faligndata(TMP16, TMP18, REF_4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP14, TMP16, REF_2);
-                        vis_faligndata(TMP16, TMP18, REF_6);
-                } else {
-                        vis_src1(TMP16, REF_2);
-                        vis_src1(TMP18, REF_6);
-                }
-
-                vis_and(TMP6, MASK_7f, TMP6);
-
-                vis_and(TMP8, MASK_7f, TMP8);
-
-                vis_psub16(TMP10, TMP6, TMP6);
-                vis_st64(TMP6, dest[0]);
-
-                vis_psub16(TMP12, TMP8, TMP8);
-                vis_st64_2(TMP8, dest, 8);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0],    TMP0);
-        vis_xor(REF_0, REF_2, TMP6);
-
-        vis_ld64_2(ref, 8,  TMP2);
-        vis_xor(REF_4, REF_6, TMP8);
-
-        vis_ld64_2(ref, 16, TMP4);
-        vis_and(TMP6, MASK_fe, TMP6);
-
-        vis_mul8x16(CONST_128, TMP6, TMP6);
-        vis_and(TMP8, MASK_fe, TMP8);
-
-        vis_mul8x16(CONST_128, TMP8, TMP8);
-        vis_or(REF_0, REF_2, TMP10);
-
-        vis_or(REF_4, REF_6, TMP12);
-
-        vis_alignaddr_g0((void *)off);
-
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_faligndata(TMP2, TMP4, REF_4);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_2);
-                vis_faligndata(TMP2, TMP4, REF_6);
-        } else {
-                vis_src1(TMP2, REF_2);
-                vis_src1(TMP4, REF_6);
-        }
-
-        vis_and(TMP6, MASK_7f, TMP6);
-
-        vis_and(TMP8, MASK_7f, TMP8);
-
-        vis_psub16(TMP10, TMP6, TMP6);
-        vis_st64(TMP6, dest[0]);
-
-        vis_psub16(TMP12, TMP8, TMP8);
-        vis_st64_2(TMP8, dest, 8);
-        dest += stride;
-
-        vis_xor(REF_0, REF_2, TMP6);
-
-        vis_xor(REF_4, REF_6, TMP8);
-
-        vis_and(TMP6, MASK_fe, TMP6);
-
-        vis_mul8x16(CONST_128, TMP6, TMP6);
-        vis_and(TMP8, MASK_fe, TMP8);
-
-        vis_mul8x16(CONST_128, TMP8, TMP8);
-        vis_or(REF_0, REF_2, TMP10);
-
-        vis_or(REF_4, REF_6, TMP12);
-
-        vis_and(TMP6, MASK_7f, TMP6);
-
-        vis_and(TMP8, MASK_7f, TMP8);
-
-        vis_psub16(TMP10, TMP6, TMP6);
-        vis_st64(TMP6, dest[0]);
-
-        vis_psub16(TMP12, TMP8, TMP8);
-        vis_st64_2(TMP8, dest, 8);
-}
-
-static void MC_put_x_8_vis (uint8_t * dest, const uint8_t * ref,
-                            const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[0], TMP0);
-
-        vis_ld64(ref[8], TMP2);
-
-        vis_ld64(constants_fe[0], MASK_fe);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-
-        vis_ld64(constants128[0], CONST_128);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_2);
-        } else {
-                vis_src1(TMP2, REF_2);
-        }
-
-        ref += stride;
-        height = (height >> 1) - 1;
-
-        do {    /* 20 cycles */
-                vis_ld64(ref[0], TMP0);
-                vis_xor(REF_0, REF_2, TMP4);
-
-                vis_ld64_2(ref, 8, TMP2);
-                vis_and(TMP4, MASK_fe, TMP4);
-                ref += stride;
-
-                vis_ld64(ref[0], TMP8);
-                vis_or(REF_0, REF_2, TMP6);
-                vis_mul8x16(CONST_128, TMP4, TMP4);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64_2(ref, 8, TMP10);
-                ref += stride;
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                }
-
-                vis_and(TMP4, MASK_7f, TMP4);
-
-                vis_psub16(TMP6, TMP4, DST_0);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-
-                vis_xor(REF_0, REF_2, TMP12);
-
-                vis_and(TMP12, MASK_fe, TMP12);
-
-                vis_or(REF_0, REF_2, TMP14);
-                vis_mul8x16(CONST_128, TMP12, TMP12);
-
-                vis_alignaddr_g0((void *)off);
-                vis_faligndata(TMP8, TMP10, REF_0);
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP8, TMP10, REF_2);
-                } else {
-                        vis_src1(TMP10, REF_2);
-                }
-
-                vis_and(TMP12, MASK_7f, TMP12);
-
-                vis_psub16(TMP14, TMP12, DST_0);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0], TMP0);
-        vis_xor(REF_0, REF_2, TMP4);
-
-        vis_ld64_2(ref, 8, TMP2);
-        vis_and(TMP4, MASK_fe, TMP4);
-
-        vis_or(REF_0, REF_2, TMP6);
-        vis_mul8x16(CONST_128, TMP4, TMP4);
-
-        vis_alignaddr_g0((void *)off);
-
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_2);
-        } else {
-                vis_src1(TMP2, REF_2);
-        }
-
-        vis_and(TMP4, MASK_7f, TMP4);
-
-        vis_psub16(TMP6, TMP4, DST_0);
-        vis_st64(DST_0, dest[0]);
-        dest += stride;
-
-        vis_xor(REF_0, REF_2, TMP12);
-
-        vis_and(TMP12, MASK_fe, TMP12);
-
-        vis_or(REF_0, REF_2, TMP14);
-        vis_mul8x16(CONST_128, TMP12, TMP12);
-
-        vis_and(TMP12, MASK_7f, TMP12);
-
-        vis_psub16(TMP14, TMP12, DST_0);
-        vis_st64(DST_0, dest[0]);
-        dest += stride;
-}
-
-static void MC_avg_x_16_vis (uint8_t * dest, const uint8_t * ref,
-                             const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        vis_ld64(constants3[0], CONST_3);
-        vis_fzero(ZERO);
-        vis_ld64(constants256_512[0], CONST_256);
-
-        ref = vis_alignaddr(ref);
-        do {    /* 26 cycles */
-                vis_ld64(ref[0], TMP0);
-
-                vis_ld64(ref[8], TMP2);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64(ref[16], TMP4);
-
-                vis_ld64(dest[0], DST_0);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64(dest[8], DST_2);
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                        vis_faligndata(TMP2, TMP4, REF_6);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                        vis_src1(TMP4, REF_6);
-                }
-
-                vis_mul8x16au(REF_0,   CONST_256, TMP0);
-
-                vis_pmerge(ZERO,     REF_2,     TMP4);
-                vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
-                vis_pmerge(ZERO, REF_2_1, TMP6);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-
-                vis_mul8x16al(DST_0,   CONST_512, TMP4);
-                vis_padd16(TMP2, TMP6, TMP2);
-
-                vis_mul8x16al(DST_1,   CONST_512, TMP6);
-
-                vis_mul8x16au(REF_6,   CONST_256, TMP12);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-                vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-                vis_mul8x16au(REF_4,   CONST_256, TMP16);
-
-                vis_padd16(TMP0, CONST_3, TMP8);
-                vis_mul8x16au(REF_4_1, CONST_256, TMP18);
-
-                vis_padd16(TMP2, CONST_3, TMP10);
-                vis_pack16(TMP8, DST_0);
-
-                vis_pack16(TMP10, DST_1);
-                vis_padd16(TMP16, TMP12, TMP0);
-
-                vis_st64(DST_0, dest[0]);
-                vis_mul8x16al(DST_2,   CONST_512, TMP4);
-                vis_padd16(TMP18, TMP14, TMP2);
-
-                vis_mul8x16al(DST_3,   CONST_512, TMP6);
-                vis_padd16(TMP0, CONST_3, TMP0);
-
-                vis_padd16(TMP2, CONST_3, TMP2);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-                vis_pack16(TMP0, DST_2);
-
-                vis_pack16(TMP2, DST_3);
-                vis_st64(DST_2, dest[8]);
-
-                ref += stride;
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_avg_x_8_vis (uint8_t * dest, const uint8_t * ref,
-                            const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-        int stride_times_2 = stride << 1;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        vis_ld64(constants3[0], CONST_3);
-        vis_fzero(ZERO);
-        vis_ld64(constants256_512[0], CONST_256);
-
-        ref = vis_alignaddr(ref);
-        height >>= 2;
-        do {    /* 47 cycles */
-                vis_ld64(ref[0],   TMP0);
-
-                vis_ld64_2(ref, 8, TMP2);
-                ref += stride;
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64(ref[0],   TMP4);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, 8, TMP6);
-                ref += stride;
-
-                vis_ld64(ref[0],   TMP8);
-
-                vis_ld64_2(ref, 8, TMP10);
-                ref += stride;
-                vis_faligndata(TMP4, TMP6, REF_4);
-
-                vis_ld64(ref[0],   TMP12);
-
-                vis_ld64_2(ref, 8, TMP14);
-                ref += stride;
-                vis_faligndata(TMP8, TMP10, REF_S0);
-
-                vis_faligndata(TMP12, TMP14, REF_S4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-
-                        vis_ld64(dest[0], DST_0);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-
-                        vis_ld64_2(dest, stride, DST_2);
-                        vis_faligndata(TMP4, TMP6, REF_6);
-
-                        vis_faligndata(TMP8, TMP10, REF_S2);
-
-                        vis_faligndata(TMP12, TMP14, REF_S6);
-                } else {
-                        vis_ld64(dest[0], DST_0);
-                        vis_src1(TMP2, REF_2);
-
-                        vis_ld64_2(dest, stride, DST_2);
-                        vis_src1(TMP6, REF_6);
-
-                        vis_src1(TMP10, REF_S2);
-
-                        vis_src1(TMP14, REF_S6);
-                }
-
-                vis_pmerge(ZERO,     REF_0,     TMP0);
-                vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
-                vis_pmerge(ZERO,     REF_2,     TMP4);
-                vis_mul8x16au(REF_2_1, CONST_256, TMP6);
-
-                vis_padd16(TMP0, CONST_3, TMP0);
-                vis_mul8x16al(DST_0,   CONST_512, TMP16);
-
-                vis_padd16(TMP2, CONST_3, TMP2);
-                vis_mul8x16al(DST_1,   CONST_512, TMP18);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-                vis_mul8x16au(REF_4, CONST_256, TMP8);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-                vis_mul8x16au(REF_4_1, CONST_256, TMP10);
-
-                vis_padd16(TMP0, TMP16, TMP0);
-                vis_mul8x16au(REF_6, CONST_256, TMP12);
-
-                vis_padd16(TMP2, TMP18, TMP2);
-                vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
-                vis_padd16(TMP8, CONST_3, TMP8);
-                vis_mul8x16al(DST_2, CONST_512, TMP16);
-
-                vis_padd16(TMP8, TMP12, TMP8);
-                vis_mul8x16al(DST_3, CONST_512, TMP18);
-
-                vis_padd16(TMP10, TMP14, TMP10);
-                vis_pack16(TMP0, DST_0);
-
-                vis_pack16(TMP2, DST_1);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-                vis_padd16(TMP10, CONST_3, TMP10);
-
-                vis_ld64_2(dest, stride, DST_0);
-                vis_padd16(TMP8, TMP16, TMP8);
-
-                vis_ld64_2(dest, stride_times_2, TMP4/*DST_2*/);
-                vis_padd16(TMP10, TMP18, TMP10);
-                vis_pack16(TMP8, DST_2);
-
-                vis_pack16(TMP10, DST_3);
-                vis_st64(DST_2, dest[0]);
-                dest += stride;
-
-                vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
-                vis_pmerge(ZERO,     REF_S0,     TMP0);
-
-                vis_pmerge(ZERO,     REF_S2,     TMP24);
-                vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
-
-                vis_padd16(TMP0, CONST_3, TMP0);
-                vis_mul8x16au(REF_S4, CONST_256, TMP8);
-
-                vis_padd16(TMP2, CONST_3, TMP2);
-                vis_mul8x16au(REF_S4_1, CONST_256, TMP10);
-
-                vis_padd16(TMP0, TMP24, TMP0);
-                vis_mul8x16au(REF_S6, CONST_256, TMP12);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-                vis_mul8x16au(REF_S6_1, CONST_256, TMP14);
-
-                vis_padd16(TMP8, CONST_3, TMP8);
-                vis_mul8x16al(DST_0,   CONST_512, TMP16);
-
-                vis_padd16(TMP10, CONST_3, TMP10);
-                vis_mul8x16al(DST_1,   CONST_512, TMP18);
-
-                vis_padd16(TMP8, TMP12, TMP8);
-                vis_mul8x16al(TMP4/*DST_2*/, CONST_512, TMP20);
-
-                vis_mul8x16al(TMP5/*DST_3*/, CONST_512, TMP22);
-                vis_padd16(TMP0, TMP16, TMP0);
-
-                vis_padd16(TMP2, TMP18, TMP2);
-                vis_pack16(TMP0, DST_0);
-
-                vis_padd16(TMP10, TMP14, TMP10);
-                vis_pack16(TMP2, DST_1);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-
-                vis_padd16(TMP8, TMP20, TMP8);
-
-                vis_padd16(TMP10, TMP22, TMP10);
-                vis_pack16(TMP8, DST_2);
-
-                vis_pack16(TMP10, DST_3);
-                vis_st64(DST_2, dest[0]);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_put_y_16_vis (uint8_t * dest, const uint8_t * ref,
-                             const ptrdiff_t stride, int height)
-{
-        ref = vis_alignaddr(ref);
-        vis_ld64(ref[0], TMP0);
-
-        vis_ld64_2(ref, 8, TMP2);
-
-        vis_ld64_2(ref, 16, TMP4);
-        ref += stride;
-
-        vis_ld64(ref[0], TMP6);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_ld64_2(ref, 8, TMP8);
-        vis_faligndata(TMP2, TMP4, REF_4);
-
-        vis_ld64_2(ref, 16, TMP10);
-        ref += stride;
-
-        vis_ld64(constants_fe[0], MASK_fe);
-        vis_faligndata(TMP6, TMP8, REF_2);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-        vis_faligndata(TMP8, TMP10, REF_6);
-
-        vis_ld64(constants128[0], CONST_128);
-        height = (height >> 1) - 1;
-        do {    /* 24 cycles */
-                vis_ld64(ref[0], TMP0);
-                vis_xor(REF_0, REF_2, TMP12);
-
-                vis_ld64_2(ref, 8, TMP2);
-                vis_xor(REF_4, REF_6, TMP16);
-
-                vis_ld64_2(ref, 16, TMP4);
-                ref += stride;
-                vis_or(REF_0, REF_2, TMP14);
-
-                vis_ld64(ref[0], TMP6);
-                vis_or(REF_4, REF_6, TMP18);
-
-                vis_ld64_2(ref, 8, TMP8);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, 16, TMP10);
-                ref += stride;
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                vis_and(TMP12, MASK_fe, TMP12);
-
-                vis_and(TMP16, MASK_fe, TMP16);
-                vis_mul8x16(CONST_128, TMP12, TMP12);
-
-                vis_mul8x16(CONST_128, TMP16, TMP16);
-                vis_xor(REF_0, REF_2, TMP0);
-
-                vis_xor(REF_4, REF_6, TMP2);
-
-                vis_or(REF_0, REF_2, TMP20);
-
-                vis_and(TMP12, MASK_7f, TMP12);
-
-                vis_and(TMP16, MASK_7f, TMP16);
-
-                vis_psub16(TMP14, TMP12, TMP12);
-                vis_st64(TMP12, dest[0]);
-
-                vis_psub16(TMP18, TMP16, TMP16);
-                vis_st64_2(TMP16, dest, 8);
-                dest += stride;
-
-                vis_or(REF_4, REF_6, TMP18);
-
-                vis_and(TMP0, MASK_fe, TMP0);
-
-                vis_and(TMP2, MASK_fe, TMP2);
-                vis_mul8x16(CONST_128, TMP0, TMP0);
-
-                vis_faligndata(TMP6, TMP8, REF_2);
-                vis_mul8x16(CONST_128, TMP2, TMP2);
-
-                vis_faligndata(TMP8, TMP10, REF_6);
-
-                vis_and(TMP0, MASK_7f, TMP0);
-
-                vis_and(TMP2, MASK_7f, TMP2);
-
-                vis_psub16(TMP20, TMP0, TMP0);
-                vis_st64(TMP0, dest[0]);
-
-                vis_psub16(TMP18, TMP2, TMP2);
-                vis_st64_2(TMP2, dest, 8);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0], TMP0);
-        vis_xor(REF_0, REF_2, TMP12);
-
-        vis_ld64_2(ref, 8, TMP2);
-        vis_xor(REF_4, REF_6, TMP16);
-
-        vis_ld64_2(ref, 16, TMP4);
-        vis_or(REF_0, REF_2, TMP14);
-
-        vis_or(REF_4, REF_6, TMP18);
-
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_faligndata(TMP2, TMP4, REF_4);
-
-        vis_and(TMP12, MASK_fe, TMP12);
-
-        vis_and(TMP16, MASK_fe, TMP16);
-        vis_mul8x16(CONST_128, TMP12, TMP12);
-
-        vis_mul8x16(CONST_128, TMP16, TMP16);
-        vis_xor(REF_0, REF_2, TMP0);
-
-        vis_xor(REF_4, REF_6, TMP2);
-
-        vis_or(REF_0, REF_2, TMP20);
-
-        vis_and(TMP12, MASK_7f, TMP12);
-
-        vis_and(TMP16, MASK_7f, TMP16);
-
-        vis_psub16(TMP14, TMP12, TMP12);
-        vis_st64(TMP12, dest[0]);
-
-        vis_psub16(TMP18, TMP16, TMP16);
-        vis_st64_2(TMP16, dest, 8);
-        dest += stride;
-
-        vis_or(REF_4, REF_6, TMP18);
-
-        vis_and(TMP0, MASK_fe, TMP0);
-
-        vis_and(TMP2, MASK_fe, TMP2);
-        vis_mul8x16(CONST_128, TMP0, TMP0);
-
-        vis_mul8x16(CONST_128, TMP2, TMP2);
-
-        vis_and(TMP0, MASK_7f, TMP0);
-
-        vis_and(TMP2, MASK_7f, TMP2);
-
-        vis_psub16(TMP20, TMP0, TMP0);
-        vis_st64(TMP0, dest[0]);
-
-        vis_psub16(TMP18, TMP2, TMP2);
-        vis_st64_2(TMP2, dest, 8);
-}
-
-static void MC_put_y_8_vis (uint8_t * dest, const uint8_t * ref,
-                            const ptrdiff_t stride, int height)
-{
-        ref = vis_alignaddr(ref);
-        vis_ld64(ref[0], TMP0);
-
-        vis_ld64_2(ref, 8, TMP2);
-        ref += stride;
-
-        vis_ld64(ref[0], TMP4);
-
-        vis_ld64_2(ref, 8, TMP6);
-        ref += stride;
-
-        vis_ld64(constants_fe[0], MASK_fe);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-        vis_faligndata(TMP4, TMP6, REF_2);
-
-        vis_ld64(constants128[0], CONST_128);
-        height = (height >> 1) - 1;
-        do {    /* 12 cycles */
-                vis_ld64(ref[0], TMP0);
-                vis_xor(REF_0, REF_2, TMP4);
-
-                vis_ld64_2(ref, 8, TMP2);
-                ref += stride;
-                vis_and(TMP4, MASK_fe, TMP4);
-
-                vis_or(REF_0, REF_2, TMP6);
-                vis_mul8x16(CONST_128, TMP4, TMP4);
-
-                vis_faligndata(TMP0, TMP2, REF_0);
-                vis_ld64(ref[0], TMP0);
-
-                vis_ld64_2(ref, 8, TMP2);
-                ref += stride;
-                vis_xor(REF_0, REF_2, TMP12);
-
-                vis_and(TMP4, MASK_7f, TMP4);
-
-                vis_and(TMP12, MASK_fe, TMP12);
-
-                vis_mul8x16(CONST_128, TMP12, TMP12);
-                vis_or(REF_0, REF_2, TMP14);
-
-                vis_psub16(TMP6, TMP4, DST_0);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-
-                vis_faligndata(TMP0, TMP2, REF_2);
-
-                vis_and(TMP12, MASK_7f, TMP12);
-
-                vis_psub16(TMP14, TMP12, DST_0);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0], TMP0);
-        vis_xor(REF_0, REF_2, TMP4);
-
-        vis_ld64_2(ref, 8, TMP2);
-        vis_and(TMP4, MASK_fe, TMP4);
-
-        vis_or(REF_0, REF_2, TMP6);
-        vis_mul8x16(CONST_128, TMP4, TMP4);
-
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_xor(REF_0, REF_2, TMP12);
-
-        vis_and(TMP4, MASK_7f, TMP4);
-
-        vis_and(TMP12, MASK_fe, TMP12);
-
-        vis_mul8x16(CONST_128, TMP12, TMP12);
-        vis_or(REF_0, REF_2, TMP14);
-
-        vis_psub16(TMP6, TMP4, DST_0);
-        vis_st64(DST_0, dest[0]);
-        dest += stride;
-
-        vis_and(TMP12, MASK_7f, TMP12);
-
-        vis_psub16(TMP14, TMP12, DST_0);
-        vis_st64(DST_0, dest[0]);
-}
-
-static void MC_avg_y_16_vis (uint8_t * dest, const uint8_t * ref,
-                             const ptrdiff_t stride, int height)
-{
-        int stride_8 = stride + 8;
-        int stride_16 = stride + 16;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[ 0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64(ref[ 8], TMP2);
-
-        vis_ld64(ref[16], TMP4);
-
-        vis_ld64(constants3[0], CONST_3);
-        vis_faligndata(TMP0, TMP2, REF_2);
-
-        vis_ld64(constants256_512[0], CONST_256);
-        vis_faligndata(TMP2, TMP4, REF_6);
-        height >>= 1;
-
-        do {    /* 31 cycles */
-                vis_ld64_2(ref, stride, TMP0);
-                vis_pmerge(ZERO,       REF_2,     TMP12);
-                vis_mul8x16au(REF_2_1, CONST_256, TMP14);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                vis_pmerge(ZERO,       REF_6,     TMP16);
-                vis_mul8x16au(REF_6_1, CONST_256, TMP18);
-
-                vis_ld64_2(ref, stride_16, TMP4);
-                ref += stride;
-
-                vis_ld64(dest[0], DST_0);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(dest, 8, DST_2);
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                vis_ld64_2(ref, stride, TMP6);
-                vis_pmerge(ZERO,     REF_0,     TMP0);
-                vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
-                vis_ld64_2(ref, stride_8, TMP8);
-                vis_pmerge(ZERO,     REF_4,     TMP4);
-
-                vis_ld64_2(ref, stride_16, TMP10);
-                ref += stride;
-
-                vis_ld64_2(dest, stride, REF_S0/*DST_4*/);
-                vis_faligndata(TMP6, TMP8, REF_2);
-                vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
-                vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/);
-                vis_faligndata(TMP8, TMP10, REF_6);
-                vis_mul8x16al(DST_0,   CONST_512, TMP20);
-
-                vis_padd16(TMP0, CONST_3, TMP0);
-                vis_mul8x16al(DST_1,   CONST_512, TMP22);
-
-                vis_padd16(TMP2, CONST_3, TMP2);
-                vis_mul8x16al(DST_2,   CONST_512, TMP24);
-
-                vis_padd16(TMP4, CONST_3, TMP4);
-                vis_mul8x16al(DST_3,   CONST_512, TMP26);
-
-                vis_padd16(TMP6, CONST_3, TMP6);
-
-                vis_padd16(TMP12, TMP20, TMP12);
-                vis_mul8x16al(REF_S0,   CONST_512, TMP20);
-
-                vis_padd16(TMP14, TMP22, TMP14);
-                vis_mul8x16al(REF_S0_1, CONST_512, TMP22);
-
-                vis_padd16(TMP16, TMP24, TMP16);
-                vis_mul8x16al(REF_S2,   CONST_512, TMP24);
-
-                vis_padd16(TMP18, TMP26, TMP18);
-                vis_mul8x16al(REF_S2_1, CONST_512, TMP26);
-
-                vis_padd16(TMP12, TMP0, TMP12);
-                vis_mul8x16au(REF_2,   CONST_256, TMP28);
-
-                vis_padd16(TMP14, TMP2, TMP14);
-                vis_mul8x16au(REF_2_1, CONST_256, TMP30);
-
-                vis_padd16(TMP16, TMP4, TMP16);
-                vis_mul8x16au(REF_6,   CONST_256, REF_S4);
-
-                vis_padd16(TMP18, TMP6, TMP18);
-                vis_mul8x16au(REF_6_1, CONST_256, REF_S6);
-
-                vis_pack16(TMP12, DST_0);
-                vis_padd16(TMP28, TMP0, TMP12);
-
-                vis_pack16(TMP14, DST_1);
-                vis_st64(DST_0, dest[0]);
-                vis_padd16(TMP30, TMP2, TMP14);
-
-                vis_pack16(TMP16, DST_2);
-                vis_padd16(REF_S4, TMP4, TMP16);
-
-                vis_pack16(TMP18, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-                vis_padd16(REF_S6, TMP6, TMP18);
-
-                vis_padd16(TMP12, TMP20, TMP12);
-
-                vis_padd16(TMP14, TMP22, TMP14);
-                vis_pack16(TMP12, DST_0);
-
-                vis_padd16(TMP16, TMP24, TMP16);
-                vis_pack16(TMP14, DST_1);
-                vis_st64(DST_0, dest[0]);
-
-                vis_padd16(TMP18, TMP26, TMP18);
-                vis_pack16(TMP16, DST_2);
-
-                vis_pack16(TMP18, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_avg_y_8_vis (uint8_t * dest, const uint8_t * ref,
-                            const ptrdiff_t stride, int height)
-{
-        int stride_8 = stride + 8;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[ 0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64(ref[ 8], TMP2);
-
-        vis_ld64(constants3[0], CONST_3);
-        vis_faligndata(TMP0, TMP2, REF_2);
-
-        vis_ld64(constants256_512[0], CONST_256);
-
-        height >>= 1;
-        do {    /* 20 cycles */
-                vis_ld64_2(ref, stride, TMP0);
-                vis_pmerge(ZERO,       REF_2,     TMP8);
-                vis_mul8x16au(REF_2_1, CONST_256, TMP10);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                ref += stride;
-
-                vis_ld64(dest[0], DST_0);
-
-                vis_ld64_2(dest, stride, DST_2);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, stride, TMP4);
-                vis_mul8x16al(DST_0,   CONST_512, TMP16);
-                vis_pmerge(ZERO,       REF_0,     TMP12);
-
-                vis_ld64_2(ref, stride_8, TMP6);
-                ref += stride;
-                vis_mul8x16al(DST_1,   CONST_512, TMP18);
-                vis_pmerge(ZERO,       REF_0_1,   TMP14);
-
-                vis_padd16(TMP12, CONST_3, TMP12);
-                vis_mul8x16al(DST_2,   CONST_512, TMP24);
-
-                vis_padd16(TMP14, CONST_3, TMP14);
-                vis_mul8x16al(DST_3,   CONST_512, TMP26);
-
-                vis_faligndata(TMP4, TMP6, REF_2);
-
-                vis_padd16(TMP8, TMP12, TMP8);
-
-                vis_padd16(TMP10, TMP14, TMP10);
-                vis_mul8x16au(REF_2,   CONST_256, TMP20);
-
-                vis_padd16(TMP8, TMP16, TMP0);
-                vis_mul8x16au(REF_2_1, CONST_256, TMP22);
-
-                vis_padd16(TMP10, TMP18, TMP2);
-                vis_pack16(TMP0, DST_0);
-
-                vis_pack16(TMP2, DST_1);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-                vis_padd16(TMP12, TMP20, TMP12);
-
-                vis_padd16(TMP14, TMP22, TMP14);
-
-                vis_padd16(TMP12, TMP24, TMP0);
-
-                vis_padd16(TMP14, TMP26, TMP2);
-                vis_pack16(TMP0, DST_2);
-
-                vis_pack16(TMP2, DST_3);
-                vis_st64(DST_2, dest[0]);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_put_xy_16_vis (uint8_t * dest, const uint8_t * ref,
-                              const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-        int stride_8 = stride + 8;
-        int stride_16 = stride + 16;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[ 0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64(ref[ 8], TMP2);
-
-        vis_ld64(ref[16], TMP4);
-
-        vis_ld64(constants2[0], CONST_2);
-        vis_faligndata(TMP0, TMP2, REF_S0);
-
-        vis_ld64(constants256_512[0], CONST_256);
-        vis_faligndata(TMP2, TMP4, REF_S4);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_S2);
-                vis_faligndata(TMP2, TMP4, REF_S6);
-        } else {
-                vis_src1(TMP2, REF_S2);
-                vis_src1(TMP4, REF_S6);
-        }
-
-        height >>= 1;
-        do {
-                vis_ld64_2(ref, stride, TMP0);
-                vis_mul8x16au(REF_S0, CONST_256, TMP12);
-                vis_pmerge(ZERO,      REF_S0_1,  TMP14);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                vis_mul8x16au(REF_S2, CONST_256, TMP16);
-                vis_pmerge(ZERO,      REF_S2_1,  TMP18);
-
-                vis_ld64_2(ref, stride_16, TMP4);
-                ref += stride;
-                vis_mul8x16au(REF_S4, CONST_256, TMP20);
-                vis_pmerge(ZERO,      REF_S4_1,  TMP22);
-
-                vis_ld64_2(ref, stride, TMP6);
-                vis_mul8x16au(REF_S6, CONST_256, TMP24);
-                vis_pmerge(ZERO,      REF_S6_1,  TMP26);
-
-                vis_ld64_2(ref, stride_8, TMP8);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, stride_16, TMP10);
-                ref += stride;
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                vis_faligndata(TMP6, TMP8, REF_S0);
-
-                vis_faligndata(TMP8, TMP10, REF_S4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                        vis_faligndata(TMP2, TMP4, REF_6);
-                        vis_faligndata(TMP6, TMP8, REF_S2);
-                        vis_faligndata(TMP8, TMP10, REF_S6);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                        vis_src1(TMP4, REF_6);
-                        vis_src1(TMP8, REF_S2);
-                        vis_src1(TMP10, REF_S6);
-                }
-
-                vis_mul8x16au(REF_0, CONST_256, TMP0);
-                vis_pmerge(ZERO,      REF_0_1,  TMP2);
-
-                vis_mul8x16au(REF_2, CONST_256, TMP4);
-                vis_pmerge(ZERO,      REF_2_1,  TMP6);
-
-                vis_padd16(TMP0, CONST_2, TMP8);
-                vis_mul8x16au(REF_4, CONST_256, TMP0);
-
-                vis_padd16(TMP2, CONST_2, TMP10);
-                vis_mul8x16au(REF_4_1, CONST_256, TMP2);
-
-                vis_padd16(TMP8, TMP4, TMP8);
-                vis_mul8x16au(REF_6, CONST_256, TMP4);
-
-                vis_padd16(TMP10, TMP6, TMP10);
-                vis_mul8x16au(REF_6_1, CONST_256, TMP6);
-
-                vis_padd16(TMP12, TMP8, TMP12);
-
-                vis_padd16(TMP14, TMP10, TMP14);
-
-                vis_padd16(TMP12, TMP16, TMP12);
-
-                vis_padd16(TMP14, TMP18, TMP14);
-                vis_pack16(TMP12, DST_0);
-
-                vis_pack16(TMP14, DST_1);
-                vis_st64(DST_0, dest[0]);
-                vis_padd16(TMP0, CONST_2, TMP12);
-
-                vis_mul8x16au(REF_S0, CONST_256, TMP0);
-                vis_padd16(TMP2, CONST_2, TMP14);
-
-                vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
-                vis_padd16(TMP12, TMP4, TMP12);
-
-                vis_mul8x16au(REF_S2, CONST_256, TMP4);
-                vis_padd16(TMP14, TMP6, TMP14);
-
-                vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
-                vis_padd16(TMP20, TMP12, TMP20);
-
-                vis_padd16(TMP22, TMP14, TMP22);
-
-                vis_padd16(TMP20, TMP24, TMP20);
-
-                vis_padd16(TMP22, TMP26, TMP22);
-                vis_pack16(TMP20, DST_2);
-
-                vis_pack16(TMP22, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-                vis_padd16(TMP0, TMP4, TMP24);
-
-                vis_mul8x16au(REF_S4, CONST_256, TMP0);
-                vis_padd16(TMP2, TMP6, TMP26);
-
-                vis_mul8x16au(REF_S4_1, CONST_256, TMP2);
-                vis_padd16(TMP24, TMP8, TMP24);
-
-                vis_padd16(TMP26, TMP10, TMP26);
-                vis_pack16(TMP24, DST_0);
-
-                vis_pack16(TMP26, DST_1);
-                vis_st64(DST_0, dest[0]);
-                vis_pmerge(ZERO, REF_S6, TMP4);
-
-                vis_pmerge(ZERO,      REF_S6_1,  TMP6);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-
-                vis_padd16(TMP0, TMP12, TMP0);
-
-                vis_padd16(TMP2, TMP14, TMP2);
-                vis_pack16(TMP0, DST_2);
-
-                vis_pack16(TMP2, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_put_xy_8_vis (uint8_t * dest, const uint8_t * ref,
-                             const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-        int stride_8 = stride + 8;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[ 0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64(ref[ 8], TMP2);
-
-        vis_ld64(constants2[0], CONST_2);
-
-        vis_ld64(constants256_512[0], CONST_256);
-        vis_faligndata(TMP0, TMP2, REF_S0);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_S2);
-        } else {
-                vis_src1(TMP2, REF_S2);
-        }
-
-        height >>= 1;
-        do {    /* 26 cycles */
-                vis_ld64_2(ref, stride, TMP0);
-                vis_mul8x16au(REF_S0,   CONST_256, TMP8);
-                vis_pmerge(ZERO,        REF_S2,    TMP12);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                ref += stride;
-                vis_mul8x16au(REF_S0_1, CONST_256, TMP10);
-                vis_pmerge(ZERO,        REF_S2_1,  TMP14);
-
-                vis_ld64_2(ref, stride, TMP4);
-
-                vis_ld64_2(ref, stride_8, TMP6);
-                ref += stride;
-                vis_faligndata(TMP0, TMP2, REF_S4);
-
-                vis_pmerge(ZERO, REF_S4, TMP18);
-
-                vis_pmerge(ZERO, REF_S4_1, TMP20);
-
-                vis_faligndata(TMP4, TMP6, REF_S0);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_S6);
-                        vis_faligndata(TMP4, TMP6, REF_S2);
-                } else {
-                        vis_src1(TMP2, REF_S6);
-                        vis_src1(TMP6, REF_S2);
-                }
-
-                vis_padd16(TMP18, CONST_2, TMP18);
-                vis_mul8x16au(REF_S6,   CONST_256, TMP22);
-
-                vis_padd16(TMP20, CONST_2, TMP20);
-                vis_mul8x16au(REF_S6_1, CONST_256, TMP24);
-
-                vis_mul8x16au(REF_S0,   CONST_256, TMP26);
-                vis_pmerge(ZERO, REF_S0_1, TMP28);
-
-                vis_mul8x16au(REF_S2,   CONST_256, TMP30);
-                vis_padd16(TMP18, TMP22, TMP18);
-
-                vis_mul8x16au(REF_S2_1, CONST_256, TMP32);
-                vis_padd16(TMP20, TMP24, TMP20);
-
-                vis_padd16(TMP8,  TMP18, TMP8);
-
-                vis_padd16(TMP10, TMP20, TMP10);
-
-                vis_padd16(TMP8,  TMP12, TMP8);
-
-                vis_padd16(TMP10, TMP14, TMP10);
-                vis_pack16(TMP8,  DST_0);
-
-                vis_pack16(TMP10, DST_1);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-                vis_padd16(TMP18, TMP26, TMP18);
-
-                vis_padd16(TMP20, TMP28, TMP20);
-
-                vis_padd16(TMP18, TMP30, TMP18);
-
-                vis_padd16(TMP20, TMP32, TMP20);
-                vis_pack16(TMP18, DST_2);
-
-                vis_pack16(TMP20, DST_3);
-                vis_st64(DST_2, dest[0]);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_avg_xy_16_vis (uint8_t * dest, const uint8_t * ref,
-                              const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-        int stride_8 = stride + 8;
-        int stride_16 = stride + 16;
-
-        vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[ 0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64(ref[ 8], TMP2);
-
-        vis_ld64(ref[16], TMP4);
-
-        vis_ld64(constants6[0], CONST_6);
-        vis_faligndata(TMP0, TMP2, REF_S0);
-
-        vis_ld64(constants256_1024[0], CONST_256);
-        vis_faligndata(TMP2, TMP4, REF_S4);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_S2);
-                vis_faligndata(TMP2, TMP4, REF_S6);
-        } else {
-                vis_src1(TMP2, REF_S2);
-                vis_src1(TMP4, REF_S6);
-        }
-
-        height >>= 1;
-        do {    /* 55 cycles */
-                vis_ld64_2(ref, stride, TMP0);
-                vis_mul8x16au(REF_S0, CONST_256, TMP12);
-                vis_pmerge(ZERO,      REF_S0_1,  TMP14);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                vis_mul8x16au(REF_S2, CONST_256, TMP16);
-                vis_pmerge(ZERO,      REF_S2_1,  TMP18);
-
-                vis_ld64_2(ref, stride_16, TMP4);
-                ref += stride;
-                vis_mul8x16au(REF_S4, CONST_256, TMP20);
-                vis_pmerge(ZERO,      REF_S4_1,  TMP22);
-
-                vis_ld64_2(ref, stride, TMP6);
-                vis_mul8x16au(REF_S6, CONST_256, TMP24);
-                vis_pmerge(ZERO,      REF_S6_1,  TMP26);
-
-                vis_ld64_2(ref, stride_8, TMP8);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, stride_16, TMP10);
-                ref += stride;
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                vis_ld64(dest[0], DST_0);
-                vis_faligndata(TMP6, TMP8, REF_S0);
-
-                vis_ld64_2(dest, 8, DST_2);
-                vis_faligndata(TMP8, TMP10, REF_S4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                        vis_faligndata(TMP2, TMP4, REF_6);
-                        vis_faligndata(TMP6, TMP8, REF_S2);
-                        vis_faligndata(TMP8, TMP10, REF_S6);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                        vis_src1(TMP4, REF_6);
-                        vis_src1(TMP8, REF_S2);
-                        vis_src1(TMP10, REF_S6);
-                }
-
-                vis_mul8x16al(DST_0,   CONST_1024, TMP30);
-                vis_pmerge(ZERO, REF_0, TMP0);
-
-                vis_mul8x16al(DST_1,   CONST_1024, TMP32);
-                vis_pmerge(ZERO,      REF_0_1,  TMP2);
-
-                vis_mul8x16au(REF_2, CONST_256, TMP4);
-                vis_pmerge(ZERO,      REF_2_1,  TMP6);
-
-                vis_mul8x16al(DST_2,   CONST_1024, REF_0);
-                vis_padd16(TMP0, CONST_6, TMP0);
-
-                vis_mul8x16al(DST_3,   CONST_1024, REF_2);
-                vis_padd16(TMP2, CONST_6, TMP2);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-                vis_mul8x16au(REF_4, CONST_256, TMP4);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-                vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
-                vis_padd16(TMP12, TMP0, TMP12);
-                vis_mul8x16au(REF_6, CONST_256, TMP8);
-
-                vis_padd16(TMP14, TMP2, TMP14);
-                vis_mul8x16au(REF_6_1, CONST_256, TMP10);
-
-                vis_padd16(TMP12, TMP16, TMP12);
-                vis_mul8x16au(REF_S0, CONST_256, REF_4);
-
-                vis_padd16(TMP14, TMP18, TMP14);
-                vis_mul8x16au(REF_S0_1, CONST_256, REF_6);
-
-                vis_padd16(TMP12, TMP30, TMP12);
-
-                vis_padd16(TMP14, TMP32, TMP14);
-                vis_pack16(TMP12, DST_0);
-
-                vis_pack16(TMP14, DST_1);
-                vis_st64(DST_0, dest[0]);
-                vis_padd16(TMP4, CONST_6, TMP4);
-
-                vis_ld64_2(dest, stride, DST_0);
-                vis_padd16(TMP6, CONST_6, TMP6);
-                vis_mul8x16au(REF_S2, CONST_256, TMP12);
-
-                vis_padd16(TMP4, TMP8, TMP4);
-                vis_mul8x16au(REF_S2_1, CONST_256,  TMP14);
-
-                vis_padd16(TMP6, TMP10, TMP6);
-
-                vis_padd16(TMP20, TMP4, TMP20);
-
-                vis_padd16(TMP22, TMP6, TMP22);
-
-                vis_padd16(TMP20, TMP24, TMP20);
-
-                vis_padd16(TMP22, TMP26, TMP22);
-
-                vis_padd16(TMP20, REF_0, TMP20);
-                vis_mul8x16au(REF_S4, CONST_256, REF_0);
-
-                vis_padd16(TMP22, REF_2, TMP22);
-                vis_pack16(TMP20, DST_2);
-
-                vis_pack16(TMP22, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-
-                vis_ld64_2(dest, 8, DST_2);
-                vis_mul8x16al(DST_0,   CONST_1024, TMP30);
-                vis_pmerge(ZERO,      REF_S4_1,  REF_2);
-
-                vis_mul8x16al(DST_1,   CONST_1024, TMP32);
-                vis_padd16(REF_4, TMP0, TMP8);
-
-                vis_mul8x16au(REF_S6, CONST_256, REF_4);
-                vis_padd16(REF_6, TMP2, TMP10);
-
-                vis_mul8x16au(REF_S6_1, CONST_256, REF_6);
-                vis_padd16(TMP8, TMP12, TMP8);
-
-                vis_padd16(TMP10, TMP14, TMP10);
-
-                vis_padd16(TMP8, TMP30, TMP8);
-
-                vis_padd16(TMP10, TMP32, TMP10);
-                vis_pack16(TMP8, DST_0);
-
-                vis_pack16(TMP10, DST_1);
-                vis_st64(DST_0, dest[0]);
-
-                vis_padd16(REF_0, TMP4, REF_0);
-
-                vis_mul8x16al(DST_2,   CONST_1024, TMP30);
-                vis_padd16(REF_2, TMP6, REF_2);
-
-                vis_mul8x16al(DST_3,   CONST_1024, TMP32);
-                vis_padd16(REF_0, REF_4, REF_0);
-
-                vis_padd16(REF_2, REF_6, REF_2);
-
-                vis_padd16(REF_0, TMP30, REF_0);
-
-                /* stall */
-
-                vis_padd16(REF_2, TMP32, REF_2);
-                vis_pack16(REF_0, DST_2);
-
-                vis_pack16(REF_2, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_avg_xy_8_vis (uint8_t * dest, const uint8_t * ref,
-                             const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-        int stride_8 = stride + 8;
-
-        vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64_2(ref, 8, TMP2);
-
-        vis_ld64(constants6[0], CONST_6);
-
-        vis_ld64(constants256_1024[0], CONST_256);
-        vis_faligndata(TMP0, TMP2, REF_S0);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_S2);
-        } else {
-                vis_src1(TMP2, REF_S2);
-        }
-
-        height >>= 1;
-        do {    /* 31 cycles */
-                vis_ld64_2(ref, stride, TMP0);
-                vis_mul8x16au(REF_S0, CONST_256, TMP8);
-                vis_pmerge(ZERO,      REF_S0_1,  TMP10);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                ref += stride;
-                vis_mul8x16au(REF_S2, CONST_256, TMP12);
-                vis_pmerge(ZERO,      REF_S2_1,  TMP14);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64_2(ref, stride, TMP4);
-                vis_faligndata(TMP0, TMP2, REF_S4);
-
-                vis_ld64_2(ref, stride_8, TMP6);
-                ref += stride;
-
-                vis_ld64(dest[0], DST_0);
-                vis_faligndata(TMP4, TMP6, REF_S0);
-
-                vis_ld64_2(dest, stride, DST_2);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_S6);
-                        vis_faligndata(TMP4, TMP6, REF_S2);
-                } else {
-                        vis_src1(TMP2, REF_S6);
-                        vis_src1(TMP6, REF_S2);
-                }
-
-                vis_mul8x16al(DST_0,   CONST_1024, TMP30);
-                vis_pmerge(ZERO, REF_S4, TMP22);
-
-                vis_mul8x16al(DST_1,   CONST_1024, TMP32);
-                vis_pmerge(ZERO,      REF_S4_1,  TMP24);
-
-                vis_mul8x16au(REF_S6, CONST_256, TMP26);
-                vis_pmerge(ZERO,      REF_S6_1,  TMP28);
-
-                vis_mul8x16au(REF_S0, CONST_256, REF_S4);
-                vis_padd16(TMP22, CONST_6, TMP22);
-
-                vis_mul8x16au(REF_S0_1, CONST_256, REF_S6);
-                vis_padd16(TMP24, CONST_6, TMP24);
-
-                vis_mul8x16al(DST_2,   CONST_1024, REF_0);
-                vis_padd16(TMP22, TMP26, TMP22);
-
-                vis_mul8x16al(DST_3,   CONST_1024, REF_2);
-                vis_padd16(TMP24, TMP28, TMP24);
-
-                vis_mul8x16au(REF_S2, CONST_256, TMP26);
-                vis_padd16(TMP8, TMP22, TMP8);
-
-                vis_mul8x16au(REF_S2_1, CONST_256, TMP28);
-                vis_padd16(TMP10, TMP24, TMP10);
-
-                vis_padd16(TMP8, TMP12, TMP8);
-
-                vis_padd16(TMP10, TMP14, TMP10);
-
-                vis_padd16(TMP8, TMP30, TMP8);
-
-                vis_padd16(TMP10, TMP32, TMP10);
-                vis_pack16(TMP8, DST_0);
-
-                vis_pack16(TMP10, DST_1);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-
-                vis_padd16(REF_S4, TMP22, TMP12);
-
-                vis_padd16(REF_S6, TMP24, TMP14);
-
-                vis_padd16(TMP12, TMP26, TMP12);
-
-                vis_padd16(TMP14, TMP28, TMP14);
-
-                vis_padd16(TMP12, REF_0, TMP12);
-
-                vis_padd16(TMP14, REF_2, TMP14);
-                vis_pack16(TMP12, DST_2);
-
-                vis_pack16(TMP14, DST_3);
-                vis_st64(DST_2, dest[0]);
-                dest += stride;
-        } while (--height);
-}
-
-/* End of rounding code */
-
-/* Start of no rounding code */
-/* The trick used in some of this file is the formula from the MMX
- * motion comp code, which is:
- *
- * (x+y)>>1 == (x&y)+((x^y)>>1)
- *
- * This allows us to average 8 bytes at a time in a 64-bit FPU reg.
- * We avoid overflows by masking before we do the shift, and we
- * implement the shift by multiplying by 1/2 using mul8x16.  So in
- * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask
- * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and
- * the value 0x80808080 is in f8):
- *
- *      fxor            f0,   f2, f10
- *      fand            f10,  f4, f10
- *      fmul8x16        f8,  f10, f10
- *      fand            f10,  f6, f10
- *      fand            f0,   f2, f12
- *      fpadd16         f12, f10, f10
- */
-
-static void MC_put_no_round_o_16_vis (uint8_t * dest, const uint8_t * ref,
-                                      const ptrdiff_t stride, int height)
-{
-        ref = vis_alignaddr(ref);
-        do {    /* 5 cycles */
-                vis_ld64(ref[0], TMP0);
-
-                vis_ld64_2(ref, 8, TMP2);
-
-                vis_ld64_2(ref, 16, TMP4);
-                ref += stride;
-
-                vis_faligndata(TMP0, TMP2, REF_0);
-                vis_st64(REF_0, dest[0]);
-
-                vis_faligndata(TMP2, TMP4, REF_2);
-                vis_st64_2(REF_2, dest, 8);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_put_no_round_o_8_vis (uint8_t * dest, const uint8_t * ref,
-                                     const ptrdiff_t stride, int height)
-{
-        ref = vis_alignaddr(ref);
-        do {    /* 4 cycles */
-                vis_ld64(ref[0], TMP0);
-
-                vis_ld64(ref[8], TMP2);
-                ref += stride;
-
-                /* stall */
-
-                vis_faligndata(TMP0, TMP2, REF_0);
-                vis_st64(REF_0, dest[0]);
-                dest += stride;
-        } while (--height);
-}
-
-
-static void MC_avg_no_round_o_16_vis (uint8_t * dest, const uint8_t * ref,
-                                      const ptrdiff_t stride, int height)
-{
-        int stride_8 = stride + 8;
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[0], TMP0);
-
-        vis_ld64(ref[8], TMP2);
-
-        vis_ld64(ref[16], TMP4);
-
-        vis_ld64(dest[0], DST_0);
-
-        vis_ld64(dest[8], DST_2);
-
-        vis_ld64(constants_fe[0], MASK_fe);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-        vis_faligndata(TMP2, TMP4, REF_2);
-
-        vis_ld64(constants128[0], CONST_128);
-
-        ref += stride;
-        height = (height >> 1) - 1;
-
-        do {    /* 24 cycles */
-                vis_ld64(ref[0], TMP0);
-                vis_xor(DST_0, REF_0, TMP6);
-
-                vis_ld64_2(ref, 8, TMP2);
-                vis_and(TMP6, MASK_fe, TMP6);
-
-                vis_ld64_2(ref, 16, TMP4);
-                ref += stride;
-                vis_mul8x16(CONST_128, TMP6, TMP6);
-                vis_xor(DST_2, REF_2, TMP8);
-
-                vis_and(TMP8, MASK_fe, TMP8);
-
-                vis_and(DST_0, REF_0, TMP10);
-                vis_ld64_2(dest, stride, DST_0);
-                vis_mul8x16(CONST_128, TMP8, TMP8);
-
-                vis_and(DST_2, REF_2, TMP12);
-                vis_ld64_2(dest, stride_8, DST_2);
-
-                vis_ld64(ref[0], TMP14);
-                vis_and(TMP6, MASK_7f, TMP6);
-
-                vis_and(TMP8, MASK_7f, TMP8);
-
-                vis_padd16(TMP10, TMP6, TMP6);
-                vis_st64(TMP6, dest[0]);
-
-                vis_padd16(TMP12, TMP8, TMP8);
-                vis_st64_2(TMP8, dest, 8);
-
-                dest += stride;
-                vis_ld64_2(ref, 8, TMP16);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, 16, TMP18);
-                vis_faligndata(TMP2, TMP4, REF_2);
-                ref += stride;
-
-                vis_xor(DST_0, REF_0, TMP20);
-
-                vis_and(TMP20, MASK_fe, TMP20);
-
-                vis_xor(DST_2, REF_2, TMP22);
-                vis_mul8x16(CONST_128, TMP20, TMP20);
-
-                vis_and(TMP22, MASK_fe, TMP22);
-
-                vis_and(DST_0, REF_0, TMP24);
-                vis_mul8x16(CONST_128, TMP22, TMP22);
-
-                vis_and(DST_2, REF_2, TMP26);
-
-                vis_ld64_2(dest, stride, DST_0);
-                vis_faligndata(TMP14, TMP16, REF_0);
-
-                vis_ld64_2(dest, stride_8, DST_2);
-                vis_faligndata(TMP16, TMP18, REF_2);
-
-                vis_and(TMP20, MASK_7f, TMP20);
-
-                vis_and(TMP22, MASK_7f, TMP22);
-
-                vis_padd16(TMP24, TMP20, TMP20);
-                vis_st64(TMP20, dest[0]);
-
-                vis_padd16(TMP26, TMP22, TMP22);
-                vis_st64_2(TMP22, dest, 8);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0], TMP0);
-        vis_xor(DST_0, REF_0, TMP6);
-
-        vis_ld64_2(ref, 8, TMP2);
-        vis_and(TMP6, MASK_fe, TMP6);
-
-        vis_ld64_2(ref, 16, TMP4);
-        vis_mul8x16(CONST_128, TMP6, TMP6);
-        vis_xor(DST_2, REF_2, TMP8);
-
-        vis_and(TMP8, MASK_fe, TMP8);
-
-        vis_and(DST_0, REF_0, TMP10);
-        vis_ld64_2(dest, stride, DST_0);
-        vis_mul8x16(CONST_128, TMP8, TMP8);
-
-        vis_and(DST_2, REF_2, TMP12);
-        vis_ld64_2(dest, stride_8, DST_2);
-
-        vis_ld64(ref[0], TMP14);
-        vis_and(TMP6, MASK_7f, TMP6);
-
-        vis_and(TMP8, MASK_7f, TMP8);
-
-        vis_padd16(TMP10, TMP6, TMP6);
-        vis_st64(TMP6, dest[0]);
-
-        vis_padd16(TMP12, TMP8, TMP8);
-        vis_st64_2(TMP8, dest, 8);
-
-        dest += stride;
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_faligndata(TMP2, TMP4, REF_2);
-
-        vis_xor(DST_0, REF_0, TMP20);
-
-        vis_and(TMP20, MASK_fe, TMP20);
-
-        vis_xor(DST_2, REF_2, TMP22);
-        vis_mul8x16(CONST_128, TMP20, TMP20);
-
-        vis_and(TMP22, MASK_fe, TMP22);
-
-        vis_and(DST_0, REF_0, TMP24);
-        vis_mul8x16(CONST_128, TMP22, TMP22);
-
-        vis_and(DST_2, REF_2, TMP26);
-
-        vis_and(TMP20, MASK_7f, TMP20);
-
-        vis_and(TMP22, MASK_7f, TMP22);
-
-        vis_padd16(TMP24, TMP20, TMP20);
-        vis_st64(TMP20, dest[0]);
-
-        vis_padd16(TMP26, TMP22, TMP22);
-        vis_st64_2(TMP22, dest, 8);
-}
-
-static void MC_put_no_round_x_16_vis (uint8_t * dest, const uint8_t * ref,
-                                      const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[0],    TMP0);
-
-        vis_ld64_2(ref, 8,  TMP2);
-
-        vis_ld64_2(ref, 16, TMP4);
-
-        vis_ld64(constants_fe[0], MASK_fe);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_ld64(constants128[0], CONST_128);
-        vis_faligndata(TMP2, TMP4, REF_4);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_2);
-                vis_faligndata(TMP2, TMP4, REF_6);
-        } else {
-                vis_src1(TMP2, REF_2);
-                vis_src1(TMP4, REF_6);
-        }
-
-        ref += stride;
-        height = (height >> 1) - 1;
-
-        do {    /* 34 cycles */
-                vis_ld64(ref[0],    TMP0);
-                vis_xor(REF_0, REF_2, TMP6);
-
-                vis_ld64_2(ref, 8,  TMP2);
-                vis_xor(REF_4, REF_6, TMP8);
-
-                vis_ld64_2(ref, 16, TMP4);
-                vis_and(TMP6, MASK_fe, TMP6);
-                ref += stride;
-
-                vis_ld64(ref[0],    TMP14);
-                vis_mul8x16(CONST_128, TMP6, TMP6);
-                vis_and(TMP8, MASK_fe, TMP8);
-
-                vis_ld64_2(ref, 8,  TMP16);
-                vis_mul8x16(CONST_128, TMP8, TMP8);
-                vis_and(REF_0, REF_2, TMP10);
-
-                vis_ld64_2(ref, 16, TMP18);
-                ref += stride;
-                vis_and(REF_4, REF_6, TMP12);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                        vis_faligndata(TMP2, TMP4, REF_6);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                        vis_src1(TMP4, REF_6);
-                }
-
-                vis_and(TMP6, MASK_7f, TMP6);
-
-                vis_and(TMP8, MASK_7f, TMP8);
-
-                vis_padd16(TMP10, TMP6, TMP6);
-                vis_st64(TMP6, dest[0]);
-
-                vis_padd16(TMP12, TMP8, TMP8);
-                vis_st64_2(TMP8, dest, 8);
-                dest += stride;
-
-                vis_xor(REF_0, REF_2, TMP6);
-
-                vis_xor(REF_4, REF_6, TMP8);
-
-                vis_and(TMP6, MASK_fe, TMP6);
-
-                vis_mul8x16(CONST_128, TMP6, TMP6);
-                vis_and(TMP8, MASK_fe, TMP8);
-
-                vis_mul8x16(CONST_128, TMP8, TMP8);
-                vis_and(REF_0, REF_2, TMP10);
-
-                vis_and(REF_4, REF_6, TMP12);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_faligndata(TMP14, TMP16, REF_0);
-
-                vis_faligndata(TMP16, TMP18, REF_4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP14, TMP16, REF_2);
-                        vis_faligndata(TMP16, TMP18, REF_6);
-                } else {
-                        vis_src1(TMP16, REF_2);
-                        vis_src1(TMP18, REF_6);
-                }
-
-                vis_and(TMP6, MASK_7f, TMP6);
-
-                vis_and(TMP8, MASK_7f, TMP8);
-
-                vis_padd16(TMP10, TMP6, TMP6);
-                vis_st64(TMP6, dest[0]);
-
-                vis_padd16(TMP12, TMP8, TMP8);
-                vis_st64_2(TMP8, dest, 8);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0],    TMP0);
-        vis_xor(REF_0, REF_2, TMP6);
-
-        vis_ld64_2(ref, 8,  TMP2);
-        vis_xor(REF_4, REF_6, TMP8);
-
-        vis_ld64_2(ref, 16, TMP4);
-        vis_and(TMP6, MASK_fe, TMP6);
-
-        vis_mul8x16(CONST_128, TMP6, TMP6);
-        vis_and(TMP8, MASK_fe, TMP8);
-
-        vis_mul8x16(CONST_128, TMP8, TMP8);
-        vis_and(REF_0, REF_2, TMP10);
-
-        vis_and(REF_4, REF_6, TMP12);
-
-        vis_alignaddr_g0((void *)off);
-
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_faligndata(TMP2, TMP4, REF_4);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_2);
-                vis_faligndata(TMP2, TMP4, REF_6);
-        } else {
-                vis_src1(TMP2, REF_2);
-                vis_src1(TMP4, REF_6);
-        }
-
-        vis_and(TMP6, MASK_7f, TMP6);
-
-        vis_and(TMP8, MASK_7f, TMP8);
-
-        vis_padd16(TMP10, TMP6, TMP6);
-        vis_st64(TMP6, dest[0]);
-
-        vis_padd16(TMP12, TMP8, TMP8);
-        vis_st64_2(TMP8, dest, 8);
-        dest += stride;
-
-        vis_xor(REF_0, REF_2, TMP6);
-
-        vis_xor(REF_4, REF_6, TMP8);
-
-        vis_and(TMP6, MASK_fe, TMP6);
-
-        vis_mul8x16(CONST_128, TMP6, TMP6);
-        vis_and(TMP8, MASK_fe, TMP8);
-
-        vis_mul8x16(CONST_128, TMP8, TMP8);
-        vis_and(REF_0, REF_2, TMP10);
-
-        vis_and(REF_4, REF_6, TMP12);
-
-        vis_and(TMP6, MASK_7f, TMP6);
-
-        vis_and(TMP8, MASK_7f, TMP8);
-
-        vis_padd16(TMP10, TMP6, TMP6);
-        vis_st64(TMP6, dest[0]);
-
-        vis_padd16(TMP12, TMP8, TMP8);
-        vis_st64_2(TMP8, dest, 8);
-}
-
-static void MC_put_no_round_x_8_vis (uint8_t * dest, const uint8_t * ref,
-                                     const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[0], TMP0);
-
-        vis_ld64(ref[8], TMP2);
-
-        vis_ld64(constants_fe[0], MASK_fe);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-
-        vis_ld64(constants128[0], CONST_128);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_2);
-        } else {
-                vis_src1(TMP2, REF_2);
-        }
-
-        ref += stride;
-        height = (height >> 1) - 1;
-
-        do {    /* 20 cycles */
-                vis_ld64(ref[0], TMP0);
-                vis_xor(REF_0, REF_2, TMP4);
-
-                vis_ld64_2(ref, 8, TMP2);
-                vis_and(TMP4, MASK_fe, TMP4);
-                ref += stride;
-
-                vis_ld64(ref[0], TMP8);
-                vis_and(REF_0, REF_2, TMP6);
-                vis_mul8x16(CONST_128, TMP4, TMP4);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64_2(ref, 8, TMP10);
-                ref += stride;
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                }
-
-                vis_and(TMP4, MASK_7f, TMP4);
-
-                vis_padd16(TMP6, TMP4, DST_0);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-
-                vis_xor(REF_0, REF_2, TMP12);
-
-                vis_and(TMP12, MASK_fe, TMP12);
-
-                vis_and(REF_0, REF_2, TMP14);
-                vis_mul8x16(CONST_128, TMP12, TMP12);
-
-                vis_alignaddr_g0((void *)off);
-                vis_faligndata(TMP8, TMP10, REF_0);
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP8, TMP10, REF_2);
-                } else {
-                        vis_src1(TMP10, REF_2);
-                }
-
-                vis_and(TMP12, MASK_7f, TMP12);
-
-                vis_padd16(TMP14, TMP12, DST_0);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0], TMP0);
-        vis_xor(REF_0, REF_2, TMP4);
-
-        vis_ld64_2(ref, 8, TMP2);
-        vis_and(TMP4, MASK_fe, TMP4);
-
-        vis_and(REF_0, REF_2, TMP6);
-        vis_mul8x16(CONST_128, TMP4, TMP4);
-
-        vis_alignaddr_g0((void *)off);
-
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_2);
-        } else {
-                vis_src1(TMP2, REF_2);
-        }
-
-        vis_and(TMP4, MASK_7f, TMP4);
-
-        vis_padd16(TMP6, TMP4, DST_0);
-        vis_st64(DST_0, dest[0]);
-        dest += stride;
-
-        vis_xor(REF_0, REF_2, TMP12);
-
-        vis_and(TMP12, MASK_fe, TMP12);
-
-        vis_and(REF_0, REF_2, TMP14);
-        vis_mul8x16(CONST_128, TMP12, TMP12);
-
-        vis_and(TMP12, MASK_7f, TMP12);
-
-        vis_padd16(TMP14, TMP12, DST_0);
-        vis_st64(DST_0, dest[0]);
-        dest += stride;
-}
-
-static void MC_avg_no_round_x_16_vis (uint8_t * dest, const uint8_t * ref,
-                                      const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        vis_ld64(constants3[0], CONST_3);
-        vis_fzero(ZERO);
-        vis_ld64(constants256_512[0], CONST_256);
-
-        ref = vis_alignaddr(ref);
-        do {    /* 26 cycles */
-                vis_ld64(ref[0], TMP0);
-
-                vis_ld64(ref[8], TMP2);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64(ref[16], TMP4);
-
-                vis_ld64(dest[0], DST_0);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64(dest[8], DST_2);
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                        vis_faligndata(TMP2, TMP4, REF_6);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                        vis_src1(TMP4, REF_6);
-                }
-
-                vis_mul8x16au(REF_0,   CONST_256, TMP0);
-
-                vis_pmerge(ZERO,     REF_2,     TMP4);
-                vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
-                vis_pmerge(ZERO, REF_2_1, TMP6);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-
-                vis_mul8x16al(DST_0,   CONST_512, TMP4);
-                vis_padd16(TMP2, TMP6, TMP2);
-
-                vis_mul8x16al(DST_1,   CONST_512, TMP6);
-
-                vis_mul8x16au(REF_6,   CONST_256, TMP12);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-                vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-                vis_mul8x16au(REF_4,   CONST_256, TMP16);
-
-                vis_padd16(TMP0, CONST_3, TMP8);
-                vis_mul8x16au(REF_4_1, CONST_256, TMP18);
-
-                vis_padd16(TMP2, CONST_3, TMP10);
-                vis_pack16(TMP8, DST_0);
-
-                vis_pack16(TMP10, DST_1);
-                vis_padd16(TMP16, TMP12, TMP0);
-
-                vis_st64(DST_0, dest[0]);
-                vis_mul8x16al(DST_2,   CONST_512, TMP4);
-                vis_padd16(TMP18, TMP14, TMP2);
-
-                vis_mul8x16al(DST_3,   CONST_512, TMP6);
-                vis_padd16(TMP0, CONST_3, TMP0);
-
-                vis_padd16(TMP2, CONST_3, TMP2);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-                vis_pack16(TMP0, DST_2);
-
-                vis_pack16(TMP2, DST_3);
-                vis_st64(DST_2, dest[8]);
-
-                ref += stride;
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_put_no_round_y_16_vis (uint8_t * dest, const uint8_t * ref,
-                                      const ptrdiff_t stride, int height)
-{
-        ref = vis_alignaddr(ref);
-        vis_ld64(ref[0], TMP0);
-
-        vis_ld64_2(ref, 8, TMP2);
-
-        vis_ld64_2(ref, 16, TMP4);
-        ref += stride;
-
-        vis_ld64(ref[0], TMP6);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_ld64_2(ref, 8, TMP8);
-        vis_faligndata(TMP2, TMP4, REF_4);
-
-        vis_ld64_2(ref, 16, TMP10);
-        ref += stride;
-
-        vis_ld64(constants_fe[0], MASK_fe);
-        vis_faligndata(TMP6, TMP8, REF_2);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-        vis_faligndata(TMP8, TMP10, REF_6);
-
-        vis_ld64(constants128[0], CONST_128);
-        height = (height >> 1) - 1;
-        do {    /* 24 cycles */
-                vis_ld64(ref[0], TMP0);
-                vis_xor(REF_0, REF_2, TMP12);
-
-                vis_ld64_2(ref, 8, TMP2);
-                vis_xor(REF_4, REF_6, TMP16);
-
-                vis_ld64_2(ref, 16, TMP4);
-                ref += stride;
-                vis_and(REF_0, REF_2, TMP14);
-
-                vis_ld64(ref[0], TMP6);
-                vis_and(REF_4, REF_6, TMP18);
-
-                vis_ld64_2(ref, 8, TMP8);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, 16, TMP10);
-                ref += stride;
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                vis_and(TMP12, MASK_fe, TMP12);
-
-                vis_and(TMP16, MASK_fe, TMP16);
-                vis_mul8x16(CONST_128, TMP12, TMP12);
-
-                vis_mul8x16(CONST_128, TMP16, TMP16);
-                vis_xor(REF_0, REF_2, TMP0);
-
-                vis_xor(REF_4, REF_6, TMP2);
-
-                vis_and(REF_0, REF_2, TMP20);
-
-                vis_and(TMP12, MASK_7f, TMP12);
-
-                vis_and(TMP16, MASK_7f, TMP16);
-
-                vis_padd16(TMP14, TMP12, TMP12);
-                vis_st64(TMP12, dest[0]);
-
-                vis_padd16(TMP18, TMP16, TMP16);
-                vis_st64_2(TMP16, dest, 8);
-                dest += stride;
-
-                vis_and(REF_4, REF_6, TMP18);
-
-                vis_and(TMP0, MASK_fe, TMP0);
-
-                vis_and(TMP2, MASK_fe, TMP2);
-                vis_mul8x16(CONST_128, TMP0, TMP0);
-
-                vis_faligndata(TMP6, TMP8, REF_2);
-                vis_mul8x16(CONST_128, TMP2, TMP2);
-
-                vis_faligndata(TMP8, TMP10, REF_6);
-
-                vis_and(TMP0, MASK_7f, TMP0);
-
-                vis_and(TMP2, MASK_7f, TMP2);
-
-                vis_padd16(TMP20, TMP0, TMP0);
-                vis_st64(TMP0, dest[0]);
-
-                vis_padd16(TMP18, TMP2, TMP2);
-                vis_st64_2(TMP2, dest, 8);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0], TMP0);
-        vis_xor(REF_0, REF_2, TMP12);
-
-        vis_ld64_2(ref, 8, TMP2);
-        vis_xor(REF_4, REF_6, TMP16);
-
-        vis_ld64_2(ref, 16, TMP4);
-        vis_and(REF_0, REF_2, TMP14);
-
-        vis_and(REF_4, REF_6, TMP18);
-
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_faligndata(TMP2, TMP4, REF_4);
-
-        vis_and(TMP12, MASK_fe, TMP12);
-
-        vis_and(TMP16, MASK_fe, TMP16);
-        vis_mul8x16(CONST_128, TMP12, TMP12);
-
-        vis_mul8x16(CONST_128, TMP16, TMP16);
-        vis_xor(REF_0, REF_2, TMP0);
-
-        vis_xor(REF_4, REF_6, TMP2);
-
-        vis_and(REF_0, REF_2, TMP20);
-
-        vis_and(TMP12, MASK_7f, TMP12);
-
-        vis_and(TMP16, MASK_7f, TMP16);
-
-        vis_padd16(TMP14, TMP12, TMP12);
-        vis_st64(TMP12, dest[0]);
-
-        vis_padd16(TMP18, TMP16, TMP16);
-        vis_st64_2(TMP16, dest, 8);
-        dest += stride;
-
-        vis_and(REF_4, REF_6, TMP18);
-
-        vis_and(TMP0, MASK_fe, TMP0);
-
-        vis_and(TMP2, MASK_fe, TMP2);
-        vis_mul8x16(CONST_128, TMP0, TMP0);
-
-        vis_mul8x16(CONST_128, TMP2, TMP2);
-
-        vis_and(TMP0, MASK_7f, TMP0);
-
-        vis_and(TMP2, MASK_7f, TMP2);
-
-        vis_padd16(TMP20, TMP0, TMP0);
-        vis_st64(TMP0, dest[0]);
-
-        vis_padd16(TMP18, TMP2, TMP2);
-        vis_st64_2(TMP2, dest, 8);
-}
-
-static void MC_put_no_round_y_8_vis (uint8_t * dest, const uint8_t * ref,
-                                     const ptrdiff_t stride, int height)
-{
-        ref = vis_alignaddr(ref);
-        vis_ld64(ref[0], TMP0);
-
-        vis_ld64_2(ref, 8, TMP2);
-        ref += stride;
-
-        vis_ld64(ref[0], TMP4);
-
-        vis_ld64_2(ref, 8, TMP6);
-        ref += stride;
-
-        vis_ld64(constants_fe[0], MASK_fe);
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_ld64(constants_7f[0], MASK_7f);
-        vis_faligndata(TMP4, TMP6, REF_2);
-
-        vis_ld64(constants128[0], CONST_128);
-        height = (height >> 1) - 1;
-        do {    /* 12 cycles */
-                vis_ld64(ref[0], TMP0);
-                vis_xor(REF_0, REF_2, TMP4);
-
-                vis_ld64_2(ref, 8, TMP2);
-                ref += stride;
-                vis_and(TMP4, MASK_fe, TMP4);
-
-                vis_and(REF_0, REF_2, TMP6);
-                vis_mul8x16(CONST_128, TMP4, TMP4);
-
-                vis_faligndata(TMP0, TMP2, REF_0);
-                vis_ld64(ref[0], TMP0);
-
-                vis_ld64_2(ref, 8, TMP2);
-                ref += stride;
-                vis_xor(REF_0, REF_2, TMP12);
-
-                vis_and(TMP4, MASK_7f, TMP4);
-
-                vis_and(TMP12, MASK_fe, TMP12);
-
-                vis_mul8x16(CONST_128, TMP12, TMP12);
-                vis_and(REF_0, REF_2, TMP14);
-
-                vis_padd16(TMP6, TMP4, DST_0);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-
-                vis_faligndata(TMP0, TMP2, REF_2);
-
-                vis_and(TMP12, MASK_7f, TMP12);
-
-                vis_padd16(TMP14, TMP12, DST_0);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-        } while (--height);
-
-        vis_ld64(ref[0], TMP0);
-        vis_xor(REF_0, REF_2, TMP4);
-
-        vis_ld64_2(ref, 8, TMP2);
-        vis_and(TMP4, MASK_fe, TMP4);
-
-        vis_and(REF_0, REF_2, TMP6);
-        vis_mul8x16(CONST_128, TMP4, TMP4);
-
-        vis_faligndata(TMP0, TMP2, REF_0);
-
-        vis_xor(REF_0, REF_2, TMP12);
-
-        vis_and(TMP4, MASK_7f, TMP4);
-
-        vis_and(TMP12, MASK_fe, TMP12);
-
-        vis_mul8x16(CONST_128, TMP12, TMP12);
-        vis_and(REF_0, REF_2, TMP14);
-
-        vis_padd16(TMP6, TMP4, DST_0);
-        vis_st64(DST_0, dest[0]);
-        dest += stride;
-
-        vis_and(TMP12, MASK_7f, TMP12);
-
-        vis_padd16(TMP14, TMP12, DST_0);
-        vis_st64(DST_0, dest[0]);
-}
-
-static void MC_avg_no_round_y_16_vis (uint8_t * dest, const uint8_t * ref,
-                                      const ptrdiff_t stride, int height)
-{
-        int stride_8 = stride + 8;
-        int stride_16 = stride + 16;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[ 0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64(ref[ 8], TMP2);
-
-        vis_ld64(ref[16], TMP4);
-
-        vis_ld64(constants3[0], CONST_3);
-        vis_faligndata(TMP0, TMP2, REF_2);
-
-        vis_ld64(constants256_512[0], CONST_256);
-        vis_faligndata(TMP2, TMP4, REF_6);
-        height >>= 1;
-
-        do {    /* 31 cycles */
-                vis_ld64_2(ref, stride, TMP0);
-                vis_pmerge(ZERO,       REF_2,     TMP12);
-                vis_mul8x16au(REF_2_1, CONST_256, TMP14);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                vis_pmerge(ZERO,       REF_6,     TMP16);
-                vis_mul8x16au(REF_6_1, CONST_256, TMP18);
-
-                vis_ld64_2(ref, stride_16, TMP4);
-                ref += stride;
-
-                vis_ld64(dest[0], DST_0);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(dest, 8, DST_2);
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                vis_ld64_2(ref, stride, TMP6);
-                vis_pmerge(ZERO,     REF_0,     TMP0);
-                vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
-                vis_ld64_2(ref, stride_8, TMP8);
-                vis_pmerge(ZERO,     REF_4,     TMP4);
-
-                vis_ld64_2(ref, stride_16, TMP10);
-                ref += stride;
-
-                vis_ld64_2(dest, stride, REF_S0/*DST_4*/);
-                vis_faligndata(TMP6, TMP8, REF_2);
-                vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
-                vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/);
-                vis_faligndata(TMP8, TMP10, REF_6);
-                vis_mul8x16al(DST_0,   CONST_512, TMP20);
-
-                vis_padd16(TMP0, CONST_3, TMP0);
-                vis_mul8x16al(DST_1,   CONST_512, TMP22);
-
-                vis_padd16(TMP2, CONST_3, TMP2);
-                vis_mul8x16al(DST_2,   CONST_512, TMP24);
-
-                vis_padd16(TMP4, CONST_3, TMP4);
-                vis_mul8x16al(DST_3,   CONST_512, TMP26);
-
-                vis_padd16(TMP6, CONST_3, TMP6);
-
-                vis_padd16(TMP12, TMP20, TMP12);
-                vis_mul8x16al(REF_S0,   CONST_512, TMP20);
-
-                vis_padd16(TMP14, TMP22, TMP14);
-                vis_mul8x16al(REF_S0_1, CONST_512, TMP22);
-
-                vis_padd16(TMP16, TMP24, TMP16);
-                vis_mul8x16al(REF_S2,   CONST_512, TMP24);
-
-                vis_padd16(TMP18, TMP26, TMP18);
-                vis_mul8x16al(REF_S2_1, CONST_512, TMP26);
-
-                vis_padd16(TMP12, TMP0, TMP12);
-                vis_mul8x16au(REF_2,   CONST_256, TMP28);
-
-                vis_padd16(TMP14, TMP2, TMP14);
-                vis_mul8x16au(REF_2_1, CONST_256, TMP30);
-
-                vis_padd16(TMP16, TMP4, TMP16);
-                vis_mul8x16au(REF_6,   CONST_256, REF_S4);
-
-                vis_padd16(TMP18, TMP6, TMP18);
-                vis_mul8x16au(REF_6_1, CONST_256, REF_S6);
-
-                vis_pack16(TMP12, DST_0);
-                vis_padd16(TMP28, TMP0, TMP12);
-
-                vis_pack16(TMP14, DST_1);
-                vis_st64(DST_0, dest[0]);
-                vis_padd16(TMP30, TMP2, TMP14);
-
-                vis_pack16(TMP16, DST_2);
-                vis_padd16(REF_S4, TMP4, TMP16);
-
-                vis_pack16(TMP18, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-                vis_padd16(REF_S6, TMP6, TMP18);
-
-                vis_padd16(TMP12, TMP20, TMP12);
-
-                vis_padd16(TMP14, TMP22, TMP14);
-                vis_pack16(TMP12, DST_0);
-
-                vis_padd16(TMP16, TMP24, TMP16);
-                vis_pack16(TMP14, DST_1);
-                vis_st64(DST_0, dest[0]);
-
-                vis_padd16(TMP18, TMP26, TMP18);
-                vis_pack16(TMP16, DST_2);
-
-                vis_pack16(TMP18, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_put_no_round_xy_16_vis (uint8_t * dest, const uint8_t * ref,
-                                       const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-        int stride_8 = stride + 8;
-        int stride_16 = stride + 16;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[ 0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64(ref[ 8], TMP2);
-
-        vis_ld64(ref[16], TMP4);
-
-        vis_ld64(constants1[0], CONST_1);
-        vis_faligndata(TMP0, TMP2, REF_S0);
-
-        vis_ld64(constants256_512[0], CONST_256);
-        vis_faligndata(TMP2, TMP4, REF_S4);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_S2);
-                vis_faligndata(TMP2, TMP4, REF_S6);
-        } else {
-                vis_src1(TMP2, REF_S2);
-                vis_src1(TMP4, REF_S6);
-        }
-
-        height >>= 1;
-        do {
-                vis_ld64_2(ref, stride, TMP0);
-                vis_mul8x16au(REF_S0, CONST_256, TMP12);
-                vis_pmerge(ZERO,      REF_S0_1,  TMP14);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                vis_mul8x16au(REF_S2, CONST_256, TMP16);
-                vis_pmerge(ZERO,      REF_S2_1,  TMP18);
-
-                vis_ld64_2(ref, stride_16, TMP4);
-                ref += stride;
-                vis_mul8x16au(REF_S4, CONST_256, TMP20);
-                vis_pmerge(ZERO,      REF_S4_1,  TMP22);
-
-                vis_ld64_2(ref, stride, TMP6);
-                vis_mul8x16au(REF_S6, CONST_256, TMP24);
-                vis_pmerge(ZERO,      REF_S6_1,  TMP26);
-
-                vis_ld64_2(ref, stride_8, TMP8);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, stride_16, TMP10);
-                ref += stride;
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                vis_faligndata(TMP6, TMP8, REF_S0);
-
-                vis_faligndata(TMP8, TMP10, REF_S4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                        vis_faligndata(TMP2, TMP4, REF_6);
-                        vis_faligndata(TMP6, TMP8, REF_S2);
-                        vis_faligndata(TMP8, TMP10, REF_S6);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                        vis_src1(TMP4, REF_6);
-                        vis_src1(TMP8, REF_S2);
-                        vis_src1(TMP10, REF_S6);
-                }
-
-                vis_mul8x16au(REF_0, CONST_256, TMP0);
-                vis_pmerge(ZERO,      REF_0_1,  TMP2);
-
-                vis_mul8x16au(REF_2, CONST_256, TMP4);
-                vis_pmerge(ZERO,      REF_2_1,  TMP6);
-
-                vis_padd16(TMP0, CONST_2, TMP8);
-                vis_mul8x16au(REF_4, CONST_256, TMP0);
-
-                vis_padd16(TMP2, CONST_1, TMP10);
-                vis_mul8x16au(REF_4_1, CONST_256, TMP2);
-
-                vis_padd16(TMP8, TMP4, TMP8);
-                vis_mul8x16au(REF_6, CONST_256, TMP4);
-
-                vis_padd16(TMP10, TMP6, TMP10);
-                vis_mul8x16au(REF_6_1, CONST_256, TMP6);
-
-                vis_padd16(TMP12, TMP8, TMP12);
-
-                vis_padd16(TMP14, TMP10, TMP14);
-
-                vis_padd16(TMP12, TMP16, TMP12);
-
-                vis_padd16(TMP14, TMP18, TMP14);
-                vis_pack16(TMP12, DST_0);
-
-                vis_pack16(TMP14, DST_1);
-                vis_st64(DST_0, dest[0]);
-                vis_padd16(TMP0, CONST_1, TMP12);
-
-                vis_mul8x16au(REF_S0, CONST_256, TMP0);
-                vis_padd16(TMP2, CONST_1, TMP14);
-
-                vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
-                vis_padd16(TMP12, TMP4, TMP12);
-
-                vis_mul8x16au(REF_S2, CONST_256, TMP4);
-                vis_padd16(TMP14, TMP6, TMP14);
-
-                vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
-                vis_padd16(TMP20, TMP12, TMP20);
-
-                vis_padd16(TMP22, TMP14, TMP22);
-
-                vis_padd16(TMP20, TMP24, TMP20);
-
-                vis_padd16(TMP22, TMP26, TMP22);
-                vis_pack16(TMP20, DST_2);
-
-                vis_pack16(TMP22, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-                vis_padd16(TMP0, TMP4, TMP24);
-
-                vis_mul8x16au(REF_S4, CONST_256, TMP0);
-                vis_padd16(TMP2, TMP6, TMP26);
-
-                vis_mul8x16au(REF_S4_1, CONST_256, TMP2);
-                vis_padd16(TMP24, TMP8, TMP24);
-
-                vis_padd16(TMP26, TMP10, TMP26);
-                vis_pack16(TMP24, DST_0);
-
-                vis_pack16(TMP26, DST_1);
-                vis_st64(DST_0, dest[0]);
-                vis_pmerge(ZERO, REF_S6, TMP4);
-
-                vis_pmerge(ZERO,      REF_S6_1,  TMP6);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-
-                vis_padd16(TMP0, TMP12, TMP0);
-
-                vis_padd16(TMP2, TMP14, TMP2);
-                vis_pack16(TMP0, DST_2);
-
-                vis_pack16(TMP2, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_put_no_round_xy_8_vis (uint8_t * dest, const uint8_t * ref,
-                                      const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-        int stride_8 = stride + 8;
-
-        vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[ 0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64(ref[ 8], TMP2);
-
-        vis_ld64(constants1[0], CONST_1);
-
-        vis_ld64(constants256_512[0], CONST_256);
-        vis_faligndata(TMP0, TMP2, REF_S0);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_S2);
-        } else {
-                vis_src1(TMP2, REF_S2);
-        }
-
-        height >>= 1;
-        do {    /* 26 cycles */
-                vis_ld64_2(ref, stride, TMP0);
-                vis_mul8x16au(REF_S0,   CONST_256, TMP8);
-                vis_pmerge(ZERO,        REF_S2,    TMP12);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                ref += stride;
-                vis_mul8x16au(REF_S0_1, CONST_256, TMP10);
-                vis_pmerge(ZERO,        REF_S2_1,  TMP14);
-
-                vis_ld64_2(ref, stride, TMP4);
-
-                vis_ld64_2(ref, stride_8, TMP6);
-                ref += stride;
-                vis_faligndata(TMP0, TMP2, REF_S4);
-
-                vis_pmerge(ZERO, REF_S4, TMP18);
-
-                vis_pmerge(ZERO, REF_S4_1, TMP20);
-
-                vis_faligndata(TMP4, TMP6, REF_S0);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_S6);
-                        vis_faligndata(TMP4, TMP6, REF_S2);
-                } else {
-                        vis_src1(TMP2, REF_S6);
-                        vis_src1(TMP6, REF_S2);
-                }
-
-                vis_padd16(TMP18, CONST_1, TMP18);
-                vis_mul8x16au(REF_S6,   CONST_256, TMP22);
-
-                vis_padd16(TMP20, CONST_1, TMP20);
-                vis_mul8x16au(REF_S6_1, CONST_256, TMP24);
-
-                vis_mul8x16au(REF_S0,   CONST_256, TMP26);
-                vis_pmerge(ZERO, REF_S0_1, TMP28);
-
-                vis_mul8x16au(REF_S2,   CONST_256, TMP30);
-                vis_padd16(TMP18, TMP22, TMP18);
-
-                vis_mul8x16au(REF_S2_1, CONST_256, TMP32);
-                vis_padd16(TMP20, TMP24, TMP20);
-
-                vis_padd16(TMP8,  TMP18, TMP8);
-
-                vis_padd16(TMP10, TMP20, TMP10);
-
-                vis_padd16(TMP8,  TMP12, TMP8);
-
-                vis_padd16(TMP10, TMP14, TMP10);
-                vis_pack16(TMP8,  DST_0);
-
-                vis_pack16(TMP10, DST_1);
-                vis_st64(DST_0, dest[0]);
-                dest += stride;
-                vis_padd16(TMP18, TMP26, TMP18);
-
-                vis_padd16(TMP20, TMP28, TMP20);
-
-                vis_padd16(TMP18, TMP30, TMP18);
-
-                vis_padd16(TMP20, TMP32, TMP20);
-                vis_pack16(TMP18, DST_2);
-
-                vis_pack16(TMP20, DST_3);
-                vis_st64(DST_2, dest[0]);
-                dest += stride;
-        } while (--height);
-}
-
-static void MC_avg_no_round_xy_16_vis (uint8_t * dest, const uint8_t * ref,
-                                       const ptrdiff_t stride, int height)
-{
-        unsigned long off = (unsigned long) ref & 0x7;
-        unsigned long off_plus_1 = off + 1;
-        int stride_8 = stride + 8;
-        int stride_16 = stride + 16;
-
-        vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
-        ref = vis_alignaddr(ref);
-
-        vis_ld64(ref[ 0], TMP0);
-        vis_fzero(ZERO);
-
-        vis_ld64(ref[ 8], TMP2);
-
-        vis_ld64(ref[16], TMP4);
-
-        vis_ld64(constants6[0], CONST_6);
-        vis_faligndata(TMP0, TMP2, REF_S0);
-
-        vis_ld64(constants256_1024[0], CONST_256);
-        vis_faligndata(TMP2, TMP4, REF_S4);
-
-        if (off != 0x7) {
-                vis_alignaddr_g0((void *)off_plus_1);
-                vis_faligndata(TMP0, TMP2, REF_S2);
-                vis_faligndata(TMP2, TMP4, REF_S6);
-        } else {
-                vis_src1(TMP2, REF_S2);
-                vis_src1(TMP4, REF_S6);
-        }
-
-        height >>= 1;
-        do {    /* 55 cycles */
-                vis_ld64_2(ref, stride, TMP0);
-                vis_mul8x16au(REF_S0, CONST_256, TMP12);
-                vis_pmerge(ZERO,      REF_S0_1,  TMP14);
-
-                vis_alignaddr_g0((void *)off);
-
-                vis_ld64_2(ref, stride_8, TMP2);
-                vis_mul8x16au(REF_S2, CONST_256, TMP16);
-                vis_pmerge(ZERO,      REF_S2_1,  TMP18);
-
-                vis_ld64_2(ref, stride_16, TMP4);
-                ref += stride;
-                vis_mul8x16au(REF_S4, CONST_256, TMP20);
-                vis_pmerge(ZERO,      REF_S4_1,  TMP22);
-
-                vis_ld64_2(ref, stride, TMP6);
-                vis_mul8x16au(REF_S6, CONST_256, TMP24);
-                vis_pmerge(ZERO,      REF_S6_1,  TMP26);
-
-                vis_ld64_2(ref, stride_8, TMP8);
-                vis_faligndata(TMP0, TMP2, REF_0);
-
-                vis_ld64_2(ref, stride_16, TMP10);
-                ref += stride;
-                vis_faligndata(TMP2, TMP4, REF_4);
-
-                vis_ld64(dest[0], DST_0);
-                vis_faligndata(TMP6, TMP8, REF_S0);
-
-                vis_ld64_2(dest, 8, DST_2);
-                vis_faligndata(TMP8, TMP10, REF_S4);
-
-                if (off != 0x7) {
-                        vis_alignaddr_g0((void *)off_plus_1);
-                        vis_faligndata(TMP0, TMP2, REF_2);
-                        vis_faligndata(TMP2, TMP4, REF_6);
-                        vis_faligndata(TMP6, TMP8, REF_S2);
-                        vis_faligndata(TMP8, TMP10, REF_S6);
-                } else {
-                        vis_src1(TMP2, REF_2);
-                        vis_src1(TMP4, REF_6);
-                        vis_src1(TMP8, REF_S2);
-                        vis_src1(TMP10, REF_S6);
-                }
-
-                vis_mul8x16al(DST_0,   CONST_1024, TMP30);
-                vis_pmerge(ZERO, REF_0, TMP0);
-
-                vis_mul8x16al(DST_1,   CONST_1024, TMP32);
-                vis_pmerge(ZERO,      REF_0_1,  TMP2);
-
-                vis_mul8x16au(REF_2, CONST_256, TMP4);
-                vis_pmerge(ZERO,      REF_2_1,  TMP6);
-
-                vis_mul8x16al(DST_2,   CONST_1024, REF_0);
-                vis_padd16(TMP0, CONST_6, TMP0);
-
-                vis_mul8x16al(DST_3,   CONST_1024, REF_2);
-                vis_padd16(TMP2, CONST_6, TMP2);
-
-                vis_padd16(TMP0, TMP4, TMP0);
-                vis_mul8x16au(REF_4, CONST_256, TMP4);
-
-                vis_padd16(TMP2, TMP6, TMP2);
-                vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
-                vis_padd16(TMP12, TMP0, TMP12);
-                vis_mul8x16au(REF_6, CONST_256, TMP8);
-
-                vis_padd16(TMP14, TMP2, TMP14);
-                vis_mul8x16au(REF_6_1, CONST_256, TMP10);
-
-                vis_padd16(TMP12, TMP16, TMP12);
-                vis_mul8x16au(REF_S0, CONST_256, REF_4);
-
-                vis_padd16(TMP14, TMP18, TMP14);
-                vis_mul8x16au(REF_S0_1, CONST_256, REF_6);
-
-                vis_padd16(TMP12, TMP30, TMP12);
-
-                vis_padd16(TMP14, TMP32, TMP14);
-                vis_pack16(TMP12, DST_0);
-
-                vis_pack16(TMP14, DST_1);
-                vis_st64(DST_0, dest[0]);
-                vis_padd16(TMP4, CONST_6, TMP4);
-
-                vis_ld64_2(dest, stride, DST_0);
-                vis_padd16(TMP6, CONST_6, TMP6);
-                vis_mul8x16au(REF_S2, CONST_256, TMP12);
-
-                vis_padd16(TMP4, TMP8, TMP4);
-                vis_mul8x16au(REF_S2_1, CONST_256,  TMP14);
-
-                vis_padd16(TMP6, TMP10, TMP6);
-
-                vis_padd16(TMP20, TMP4, TMP20);
-
-                vis_padd16(TMP22, TMP6, TMP22);
-
-                vis_padd16(TMP20, TMP24, TMP20);
-
-                vis_padd16(TMP22, TMP26, TMP22);
-
-                vis_padd16(TMP20, REF_0, TMP20);
-                vis_mul8x16au(REF_S4, CONST_256, REF_0);
-
-                vis_padd16(TMP22, REF_2, TMP22);
-                vis_pack16(TMP20, DST_2);
-
-                vis_pack16(TMP22, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-
-                vis_ld64_2(dest, 8, DST_2);
-                vis_mul8x16al(DST_0,   CONST_1024, TMP30);
-                vis_pmerge(ZERO,      REF_S4_1,  REF_2);
-
-                vis_mul8x16al(DST_1,   CONST_1024, TMP32);
-                vis_padd16(REF_4, TMP0, TMP8);
-
-                vis_mul8x16au(REF_S6, CONST_256, REF_4);
-                vis_padd16(REF_6, TMP2, TMP10);
-
-                vis_mul8x16au(REF_S6_1, CONST_256, REF_6);
-                vis_padd16(TMP8, TMP12, TMP8);
-
-                vis_padd16(TMP10, TMP14, TMP10);
-
-                vis_padd16(TMP8, TMP30, TMP8);
-
-                vis_padd16(TMP10, TMP32, TMP10);
-                vis_pack16(TMP8, DST_0);
-
-                vis_pack16(TMP10, DST_1);
-                vis_st64(DST_0, dest[0]);
-
-                vis_padd16(REF_0, TMP4, REF_0);
-
-                vis_mul8x16al(DST_2,   CONST_1024, TMP30);
-                vis_padd16(REF_2, TMP6, REF_2);
-
-                vis_mul8x16al(DST_3,   CONST_1024, TMP32);
-                vis_padd16(REF_0, REF_4, REF_0);
-
-                vis_padd16(REF_2, REF_6, REF_2);
-
-                vis_padd16(REF_0, TMP30, REF_0);
-
-                /* stall */
-
-                vis_padd16(REF_2, TMP32, REF_2);
-                vis_pack16(REF_0, DST_2);
-
-                vis_pack16(REF_2, DST_3);
-                vis_st64_2(DST_2, dest, 8);
-                dest += stride;
-        } while (--height);
-}
-
-/* End of no rounding code */
-
-av_cold void ff_hpeldsp_init_vis(HpelDSPContext *c, int flags)
-{
-  /* VIS-specific optimizations */
-  int accel = vis_level ();
-
-  if (accel & ACCEL_SPARC_VIS) {
-      c->put_pixels_tab[0][0] = MC_put_o_16_vis;
-      c->put_pixels_tab[0][1] = MC_put_x_16_vis;
-      c->put_pixels_tab[0][2] = MC_put_y_16_vis;
-      c->put_pixels_tab[0][3] = MC_put_xy_16_vis;
-
-      c->put_pixels_tab[1][0] = MC_put_o_8_vis;
-      c->put_pixels_tab[1][1] = MC_put_x_8_vis;
-      c->put_pixels_tab[1][2] = MC_put_y_8_vis;
-      c->put_pixels_tab[1][3] = MC_put_xy_8_vis;
-
-      c->avg_pixels_tab[0][0] = MC_avg_o_16_vis;
-      c->avg_pixels_tab[0][1] = MC_avg_x_16_vis;
-      c->avg_pixels_tab[0][2] = MC_avg_y_16_vis;
-      c->avg_pixels_tab[0][3] = MC_avg_xy_16_vis;
-
-      c->avg_pixels_tab[1][0] = MC_avg_o_8_vis;
-      c->avg_pixels_tab[1][1] = MC_avg_x_8_vis;
-      c->avg_pixels_tab[1][2] = MC_avg_y_8_vis;
-      c->avg_pixels_tab[1][3] = MC_avg_xy_8_vis;
-
-      c->put_no_rnd_pixels_tab[0][0] = MC_put_no_round_o_16_vis;
-      c->put_no_rnd_pixels_tab[0][1] = MC_put_no_round_x_16_vis;
-      c->put_no_rnd_pixels_tab[0][2] = MC_put_no_round_y_16_vis;
-      c->put_no_rnd_pixels_tab[0][3] = MC_put_no_round_xy_16_vis;
-
-      c->put_no_rnd_pixels_tab[1][0] = MC_put_no_round_o_8_vis;
-      c->put_no_rnd_pixels_tab[1][1] = MC_put_no_round_x_8_vis;
-      c->put_no_rnd_pixels_tab[1][2] = MC_put_no_round_y_8_vis;
-      c->put_no_rnd_pixels_tab[1][3] = MC_put_no_round_xy_8_vis;
-
-      c->avg_no_rnd_pixels_tab[0] = MC_avg_no_round_o_16_vis;
-      c->avg_no_rnd_pixels_tab[1] = MC_avg_no_round_x_16_vis;
-      c->avg_no_rnd_pixels_tab[2] = MC_avg_no_round_y_16_vis;
-      c->avg_no_rnd_pixels_tab[3] = MC_avg_no_round_xy_16_vis;
-  }
-}
diff --git a/deps/libav/libavcodec/sparc/simple_idct_vis.c b/deps/libav/libavcodec/sparc/simple_idct_vis.c
deleted file mode 100644
index 2057d66..0000000
--- a/deps/libav/libavcodec/sparc/simple_idct_vis.c
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * SPARC VIS optimized inverse DCT
- * Copyright (c) 2007 Denes Balatoni < dbalatoni XatX interware XdotX hu >
- *
- * I did consult the following fine web page about dct
- * http://www.geocities.com/ssavekar/dct.htm
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "dsputil_vis.h"
-#include "libavutil/mem.h"
-
-static const DECLARE_ALIGNED(8, int16_t, coeffs)[28] = {
-    - 1259,- 1259,- 1259,- 1259,
-    - 4989,- 4989,- 4989,- 4989,
-    -11045,-11045,-11045,-11045,
-    -19195,-19195,-19195,-19195,
-    -29126,-29126,-29126,-29126,
-     25080, 25080, 25080, 25080,
-     12785, 12785, 12785, 12785
-};
-static const DECLARE_ALIGNED(8, uint16_t, scale)[4] = {
-    65536>>6, 65536>>6, 65536>>6, 65536>>6
-};
-static const DECLARE_ALIGNED(8, uint16_t, rounder)[4] = {
-    1<<5, 1<<5, 1<<5, 1<<5
-};
-static const DECLARE_ALIGNED(8, uint16_t, expand)[4] = {
-    1<<14, 1<<14, 1<<14, 1<<14
-};
-
-#define INIT_IDCT \
-        "ldd [%1], %%f32         \n\t"\
-        "ldd [%1+8], %%f34       \n\t"\
-        "ldd [%1+16], %%f36      \n\t"\
-        "ldd [%1+24], %%f38      \n\t"\
-        "ldd [%1+32], %%f40      \n\t"\
-        "ldd [%1+40], %%f42      \n\t"\
-        "ldd [%1+48], %%f44      \n\t"\
-        "ldd [%0], %%f46         \n\t"\
-        "fzero %%f62             \n\t"\
-
-#define LOADSCALE(in) \
-        "ldd [" in "], %%f0          \n\t"\
-        "ldd [" in "+16], %%f2       \n\t"\
-        "ldd [" in "+32], %%f4       \n\t"\
-        "ldd [" in "+48], %%f6       \n\t"\
-        "ldd [" in "+64], %%f8       \n\t"\
-        "ldd [" in "+80], %%f10      \n\t"\
-        "ldd [" in "+96], %%f12      \n\t"\
-        "ldd [" in "+112], %%f14     \n\t"\
-        "fpadd16 %%f0, %%f0, %%f0    \n\t"\
-        "fpadd16 %%f2, %%f2, %%f2    \n\t"\
-        "fpadd16 %%f4, %%f4, %%f4    \n\t"\
-        "fpadd16 %%f6, %%f6, %%f6    \n\t"\
-        "fpadd16 %%f8, %%f8, %%f8    \n\t"\
-        "fpadd16 %%f10, %%f10, %%f10 \n\t"\
-        "fpadd16 %%f12, %%f12, %%f12 \n\t"\
-        "fpadd16 %%f14, %%f14, %%f14 \n\t"\
-\
-        "fpadd16 %%f0, %%f0, %%f0    \n\t"\
-        "fpadd16 %%f2, %%f2, %%f2    \n\t"\
-        "fpadd16 %%f4, %%f4, %%f4    \n\t"\
-        "fpadd16 %%f6, %%f6, %%f6    \n\t"\
-        "fpadd16 %%f8, %%f8, %%f8    \n\t"\
-        "fpadd16 %%f10, %%f10, %%f10 \n\t"\
-        "fpadd16 %%f12, %%f12, %%f12 \n\t"\
-        "fpadd16 %%f14, %%f14, %%f14 \n\t"\
-\
-        "fpadd16 %%f0, %%f0, %%f0    \n\t"\
-        "fpadd16 %%f2, %%f2, %%f2    \n\t"\
-        "fpadd16 %%f4, %%f4, %%f4    \n\t"\
-        "fpadd16 %%f6, %%f6, %%f6    \n\t"\
-        "fpadd16 %%f8, %%f8, %%f8    \n\t"\
-        "fpadd16 %%f10, %%f10, %%f10 \n\t"\
-        "fpadd16 %%f12, %%f12, %%f12 \n\t"\
-        "fpadd16 %%f14, %%f14, %%f14 \n\t"\
-\
-        "fpadd16 %%f0, %%f0, %%f0    \n\t"\
-        "fpadd16 %%f2, %%f2, %%f2    \n\t"\
-        "fpadd16 %%f4, %%f4, %%f4    \n\t"\
-        "fpadd16 %%f6, %%f6, %%f6    \n\t"\
-        "fpadd16 %%f8, %%f8, %%f8    \n\t"\
-        "fpadd16 %%f10, %%f10, %%f10 \n\t"\
-        "fpadd16 %%f12, %%f12, %%f12 \n\t"\
-        "fpadd16 %%f14, %%f14, %%f14 \n\t"\
-
-#define LOAD(in) \
-        "ldd [" in "], %%f16         \n\t"\
-        "ldd [" in "+8], %%f18       \n\t"\
-        "ldd [" in "+16], %%f20      \n\t"\
-        "ldd [" in "+24], %%f22      \n\t"\
-        "ldd [" in "+32], %%f24      \n\t"\
-        "ldd [" in "+40], %%f26      \n\t"\
-        "ldd [" in "+48], %%f28      \n\t"\
-        "ldd [" in "+56], %%f30      \n\t"\
-
-#define TRANSPOSE \
-        "fpmerge %%f16, %%f24, %%f0  \n\t"\
-        "fpmerge %%f20, %%f28, %%f2  \n\t"\
-        "fpmerge %%f17, %%f25, %%f4  \n\t"\
-        "fpmerge %%f21, %%f29, %%f6  \n\t"\
-        "fpmerge %%f18, %%f26, %%f8  \n\t"\
-        "fpmerge %%f22, %%f30, %%f10 \n\t"\
-        "fpmerge %%f19, %%f27, %%f12 \n\t"\
-        "fpmerge %%f23, %%f31, %%f14 \n\t"\
-\
-        "fpmerge %%f0, %%f2, %%f16   \n\t"\
-        "fpmerge %%f1, %%f3, %%f18   \n\t"\
-        "fpmerge %%f4, %%f6, %%f20   \n\t"\
-        "fpmerge %%f5, %%f7, %%f22   \n\t"\
-        "fpmerge %%f8, %%f10, %%f24  \n\t"\
-        "fpmerge %%f9, %%f11, %%f26  \n\t"\
-        "fpmerge %%f12, %%f14, %%f28 \n\t"\
-        "fpmerge %%f13, %%f15, %%f30 \n\t"\
-\
-        "fpmerge %%f16, %%f17, %%f0  \n\t"\
-        "fpmerge %%f18, %%f19, %%f2  \n\t"\
-        "fpmerge %%f20, %%f21, %%f4  \n\t"\
-        "fpmerge %%f22, %%f23, %%f6  \n\t"\
-        "fpmerge %%f24, %%f25, %%f8  \n\t"\
-        "fpmerge %%f26, %%f27, %%f10 \n\t"\
-        "fpmerge %%f28, %%f29, %%f12 \n\t"\
-        "fpmerge %%f30, %%f31, %%f14 \n\t"\
-
-#define IDCT4ROWS \
-    /* 1. column */\
-        "fmul8ulx16 %%f0, %%f38, %%f28 \n\t"\
-        "for %%f4, %%f6, %%f60         \n\t"\
-        "fmul8ulx16 %%f2, %%f32, %%f18 \n\t"\
-        "fmul8ulx16 %%f2, %%f36, %%f22 \n\t"\
-        "fmul8ulx16 %%f2, %%f40, %%f26 \n\t"\
-        "fmul8ulx16 %%f2, %%f44, %%f30 \n\t"\
-\
-        ADDROUNDER\
-\
-        "fmul8sux16 %%f0, %%f38, %%f48 \n\t"\
-        "fcmpd %%fcc0, %%f62, %%f60    \n\t"\
-        "for %%f8, %%f10, %%f60        \n\t"\
-        "fmul8sux16 %%f2, %%f32, %%f50 \n\t"\
-        "fmul8sux16 %%f2, %%f36, %%f52 \n\t"\
-        "fmul8sux16 %%f2, %%f40, %%f54 \n\t"\
-        "fmul8sux16 %%f2, %%f44, %%f56 \n\t"\
-\
-        "fpadd16 %%f48, %%f28, %%f28 \n\t"\
-        "fcmpd %%fcc1, %%f62, %%f60  \n\t"\
-        "for %%f12, %%f14, %%f60     \n\t"\
-        "fpadd16 %%f50, %%f18, %%f18 \n\t"\
-        "fpadd16 %%f52, %%f22, %%f22 \n\t"\
-        "fpadd16 %%f54, %%f26, %%f26 \n\t"\
-        "fpadd16 %%f56, %%f30, %%f30 \n\t"\
-\
-        "fpadd16 %%f28, %%f0, %%f16  \n\t"\
-        "fcmpd %%fcc2, %%f62, %%f60  \n\t"\
-        "fpadd16 %%f28, %%f0, %%f20  \n\t"\
-        "fpadd16 %%f28, %%f0, %%f24  \n\t"\
-        "fpadd16 %%f28, %%f0, %%f28  \n\t"\
-        "fpadd16 %%f18, %%f2, %%f18  \n\t"\
-        "fpadd16 %%f22, %%f2, %%f22  \n\t"\
-    /* 2. column */\
-        "fbe %%fcc0, 3f                \n\t"\
-        "fpadd16 %%f26, %%f2, %%f26    \n\t"\
-        "fmul8ulx16 %%f4, %%f34, %%f48 \n\t"\
-        "fmul8ulx16 %%f4, %%f42, %%f50 \n\t"\
-        "fmul8ulx16 %%f6, %%f36, %%f52 \n\t"\
-        "fmul8ulx16 %%f6, %%f44, %%f54 \n\t"\
-        "fmul8ulx16 %%f6, %%f32, %%f56 \n\t"\
-        "fmul8ulx16 %%f6, %%f40, %%f58 \n\t"\
-\
-        "fpadd16 %%f16, %%f48, %%f16 \n\t"\
-        "fpadd16 %%f20, %%f50, %%f20 \n\t"\
-        "fpsub16 %%f24, %%f50, %%f24 \n\t"\
-        "fpsub16 %%f28, %%f48, %%f28 \n\t"\
-        "fpadd16 %%f18, %%f52, %%f18 \n\t"\
-        "fpsub16 %%f22, %%f54, %%f22 \n\t"\
-        "fpsub16 %%f26, %%f56, %%f26 \n\t"\
-        "fpsub16 %%f30, %%f58, %%f30 \n\t"\
-\
-        "fmul8sux16 %%f4, %%f34, %%f48 \n\t"\
-        "fmul8sux16 %%f4, %%f42, %%f50 \n\t"\
-        "fmul8sux16 %%f6, %%f36, %%f52 \n\t"\
-        "fmul8sux16 %%f6, %%f44, %%f54 \n\t"\
-        "fmul8sux16 %%f6, %%f32, %%f56 \n\t"\
-        "fmul8sux16 %%f6, %%f40, %%f58 \n\t"\
-\
-        "fpadd16 %%f16, %%f48, %%f16 \n\t"\
-        "fpadd16 %%f20, %%f50, %%f20 \n\t"\
-        "fpsub16 %%f24, %%f50, %%f24 \n\t"\
-        "fpsub16 %%f28, %%f48, %%f28 \n\t"\
-        "fpadd16 %%f18, %%f52, %%f18 \n\t"\
-        "fpsub16 %%f22, %%f54, %%f22 \n\t"\
-        "fpsub16 %%f26, %%f56, %%f26 \n\t"\
-        "fpsub16 %%f30, %%f58, %%f30 \n\t"\
-\
-        "fpadd16 %%f16, %%f4, %%f16  \n\t"\
-        "fpsub16 %%f28, %%f4, %%f28  \n\t"\
-        "fpadd16 %%f18, %%f6, %%f18  \n\t"\
-        "fpsub16 %%f26, %%f6, %%f26  \n\t"\
-    /* 3. column */\
-        "3:                             \n\t"\
-        "fbe %%fcc1, 4f                 \n\t"\
-        "fpsub16 %%f30, %%f6, %%f30     \n\t"\
-        "fmul8ulx16 %%f8, %%f38, %%f48  \n\t"\
-        "fmul8ulx16 %%f10, %%f40, %%f50 \n\t"\
-        "fmul8ulx16 %%f10, %%f32, %%f52 \n\t"\
-        "fmul8ulx16 %%f10, %%f44, %%f54 \n\t"\
-        "fmul8ulx16 %%f10, %%f36, %%f56 \n\t"\
-\
-        "fpadd16 %%f16, %%f48, %%f16 \n\t"\
-        "fpsub16 %%f20, %%f48, %%f20 \n\t"\
-        "fpsub16 %%f24, %%f48, %%f24 \n\t"\
-        "fpadd16 %%f28, %%f48, %%f28 \n\t"\
-        "fpadd16 %%f18, %%f50, %%f18 \n\t"\
-        "fpsub16 %%f22, %%f52, %%f22 \n\t"\
-        "fpadd16 %%f26, %%f54, %%f26 \n\t"\
-        "fpadd16 %%f30, %%f56, %%f30 \n\t"\
-\
-        "fmul8sux16 %%f8, %%f38, %%f48 \n\t"\
-        "fmul8sux16 %%f10, %%f40, %%f50 \n\t"\
-        "fmul8sux16 %%f10, %%f32, %%f52 \n\t"\
-        "fmul8sux16 %%f10, %%f44, %%f54 \n\t"\
-        "fmul8sux16 %%f10, %%f36, %%f56 \n\t"\
-\
-        "fpadd16 %%f16, %%f48, %%f16 \n\t"\
-        "fpsub16 %%f20, %%f48, %%f20 \n\t"\
-        "fpsub16 %%f24, %%f48, %%f24 \n\t"\
-        "fpadd16 %%f28, %%f48, %%f28 \n\t"\
-        "fpadd16 %%f18, %%f50, %%f18 \n\t"\
-        "fpsub16 %%f22, %%f52, %%f22 \n\t"\
-        "fpadd16 %%f26, %%f54, %%f26 \n\t"\
-        "fpadd16 %%f30, %%f56, %%f30 \n\t"\
-\
-        "fpadd16 %%f16, %%f8, %%f16  \n\t"\
-        "fpsub16 %%f20, %%f8, %%f20  \n\t"\
-        "fpsub16 %%f24, %%f8, %%f24  \n\t"\
-        "fpadd16 %%f28, %%f8, %%f28  \n\t"\
-        "fpadd16 %%f18, %%f10, %%f18 \n\t"\
-        "fpsub16 %%f22, %%f10, %%f22 \n\t"\
-    /* 4. column */\
-        "4:                             \n\t"\
-        "fbe %%fcc2, 5f                 \n\t"\
-        "fpadd16 %%f30, %%f10, %%f30    \n\t"\
-        "fmul8ulx16 %%f12, %%f42, %%f48 \n\t"\
-        "fmul8ulx16 %%f12, %%f34, %%f50 \n\t"\
-        "fmul8ulx16 %%f14, %%f44, %%f52 \n\t"\
-        "fmul8ulx16 %%f14, %%f40, %%f54 \n\t"\
-        "fmul8ulx16 %%f14, %%f36, %%f56 \n\t"\
-        "fmul8ulx16 %%f14, %%f32, %%f58 \n\t"\
-\
-        "fpadd16 %%f16, %%f48, %%f16 \n\t"\
-        "fpsub16 %%f20, %%f50, %%f20 \n\t"\
-        "fpadd16 %%f24, %%f50, %%f24 \n\t"\
-        "fpsub16 %%f28, %%f48, %%f28 \n\t"\
-        "fpadd16 %%f18, %%f52, %%f18 \n\t"\
-        "fpsub16 %%f22, %%f54, %%f22 \n\t"\
-        "fpadd16 %%f26, %%f56, %%f26 \n\t"\
-        "fpsub16 %%f30, %%f58, %%f30 \n\t"\
-\
-        "fmul8sux16 %%f12, %%f42, %%f48 \n\t"\
-        "fmul8sux16 %%f12, %%f34, %%f50 \n\t"\
-        "fmul8sux16 %%f14, %%f44, %%f52 \n\t"\
-        "fmul8sux16 %%f14, %%f40, %%f54 \n\t"\
-        "fmul8sux16 %%f14, %%f36, %%f56 \n\t"\
-        "fmul8sux16 %%f14, %%f32, %%f58 \n\t"\
-\
-        "fpadd16 %%f16, %%f48, %%f16 \n\t"\
-        "fpsub16 %%f20, %%f50, %%f20 \n\t"\
-        "fpadd16 %%f24, %%f50, %%f24 \n\t"\
-        "fpsub16 %%f28, %%f48, %%f28 \n\t"\
-        "fpadd16 %%f18, %%f52, %%f18 \n\t"\
-        "fpsub16 %%f22, %%f54, %%f22 \n\t"\
-        "fpadd16 %%f26, %%f56, %%f26 \n\t"\
-        "fpsub16 %%f30, %%f58, %%f30 \n\t"\
-\
-        "fpsub16 %%f20, %%f12, %%f20 \n\t"\
-        "fpadd16 %%f24, %%f12, %%f24 \n\t"\
-        "fpsub16 %%f22, %%f14, %%f22 \n\t"\
-        "fpadd16 %%f26, %%f14, %%f26 \n\t"\
-        "fpsub16 %%f30, %%f14, %%f30 \n\t"\
-    /* final butterfly */\
-        "5:                          \n\t"\
-        "fpsub16 %%f16, %%f18, %%f48 \n\t"\
-        "fpsub16 %%f20, %%f22, %%f50 \n\t"\
-        "fpsub16 %%f24, %%f26, %%f52 \n\t"\
-        "fpsub16 %%f28, %%f30, %%f54 \n\t"\
-        "fpadd16 %%f16, %%f18, %%f16 \n\t"\
-        "fpadd16 %%f20, %%f22, %%f20 \n\t"\
-        "fpadd16 %%f24, %%f26, %%f24 \n\t"\
-        "fpadd16 %%f28, %%f30, %%f28 \n\t"\
-
-#define STOREROWS(out) \
-        "std %%f48, [" out "+112]          \n\t"\
-        "std %%f50, [" out "+96]           \n\t"\
-        "std %%f52, [" out "+80]           \n\t"\
-        "std %%f54, [" out "+64]           \n\t"\
-        "std %%f16, [" out "]              \n\t"\
-        "std %%f20, [" out "+16]           \n\t"\
-        "std %%f24, [" out "+32]           \n\t"\
-        "std %%f28, [" out "+48]           \n\t"\
-
-#define SCALEROWS \
-        "fmul8sux16 %%f46, %%f48, %%f48 \n\t"\
-        "fmul8sux16 %%f46, %%f50, %%f50 \n\t"\
-        "fmul8sux16 %%f46, %%f52, %%f52 \n\t"\
-        "fmul8sux16 %%f46, %%f54, %%f54 \n\t"\
-        "fmul8sux16 %%f46, %%f16, %%f16 \n\t"\
-        "fmul8sux16 %%f46, %%f20, %%f20 \n\t"\
-        "fmul8sux16 %%f46, %%f24, %%f24 \n\t"\
-        "fmul8sux16 %%f46, %%f28, %%f28 \n\t"\
-
-#define PUTPIXELSCLAMPED(dest) \
-        "fpack16 %%f48, %%f14 \n\t"\
-        "fpack16 %%f50, %%f12 \n\t"\
-        "fpack16 %%f16, %%f0  \n\t"\
-        "fpack16 %%f20, %%f2  \n\t"\
-        "fpack16 %%f24, %%f4  \n\t"\
-        "fpack16 %%f28, %%f6  \n\t"\
-        "fpack16 %%f54, %%f8  \n\t"\
-        "fpack16 %%f52, %%f10 \n\t"\
-        "st %%f0, [%3+" dest "]   \n\t"\
-        "st %%f2, [%5+" dest "]   \n\t"\
-        "st %%f4, [%6+" dest "]   \n\t"\
-        "st %%f6, [%7+" dest "]   \n\t"\
-        "st %%f8, [%8+" dest "]   \n\t"\
-        "st %%f10, [%9+" dest "]  \n\t"\
-        "st %%f12, [%10+" dest "] \n\t"\
-        "st %%f14, [%11+" dest "] \n\t"\
-
-#define ADDPIXELSCLAMPED(dest) \
-        "ldd [%5], %%f18         \n\t"\
-        "ld [%3+" dest"], %%f0   \n\t"\
-        "ld [%6+" dest"], %%f2   \n\t"\
-        "ld [%7+" dest"], %%f4   \n\t"\
-        "ld [%8+" dest"], %%f6   \n\t"\
-        "ld [%9+" dest"], %%f8   \n\t"\
-        "ld [%10+" dest"], %%f10 \n\t"\
-        "ld [%11+" dest"], %%f12 \n\t"\
-        "ld [%12+" dest"], %%f14 \n\t"\
-        "fmul8x16 %%f0, %%f18, %%f0   \n\t"\
-        "fmul8x16 %%f2, %%f18, %%f2   \n\t"\
-        "fmul8x16 %%f4, %%f18, %%f4   \n\t"\
-        "fmul8x16 %%f6, %%f18, %%f6   \n\t"\
-        "fmul8x16 %%f8, %%f18, %%f8   \n\t"\
-        "fmul8x16 %%f10, %%f18, %%f10 \n\t"\
-        "fmul8x16 %%f12, %%f18, %%f12 \n\t"\
-        "fmul8x16 %%f14, %%f18, %%f14 \n\t"\
-        "fpadd16 %%f0, %%f16, %%f0    \n\t"\
-        "fpadd16 %%f2, %%f20, %%f2    \n\t"\
-        "fpadd16 %%f4, %%f24, %%f4    \n\t"\
-        "fpadd16 %%f6, %%f28, %%f6    \n\t"\
-        "fpadd16 %%f8, %%f54, %%f8    \n\t"\
-        "fpadd16 %%f10, %%f52, %%f10  \n\t"\
-        "fpadd16 %%f12, %%f50, %%f12  \n\t"\
-        "fpadd16 %%f14, %%f48, %%f14  \n\t"\
-        "fpack16 %%f0, %%f0   \n\t"\
-        "fpack16 %%f2, %%f2   \n\t"\
-        "fpack16 %%f4, %%f4   \n\t"\
-        "fpack16 %%f6, %%f6   \n\t"\
-        "fpack16 %%f8, %%f8   \n\t"\
-        "fpack16 %%f10, %%f10 \n\t"\
-        "fpack16 %%f12, %%f12 \n\t"\
-        "fpack16 %%f14, %%f14 \n\t"\
-        "st %%f0, [%3+" dest "]   \n\t"\
-        "st %%f2, [%6+" dest "]   \n\t"\
-        "st %%f4, [%7+" dest "]   \n\t"\
-        "st %%f6, [%8+" dest "]   \n\t"\
-        "st %%f8, [%9+" dest "]   \n\t"\
-        "st %%f10, [%10+" dest "] \n\t"\
-        "st %%f12, [%11+" dest "] \n\t"\
-        "st %%f14, [%12+" dest "] \n\t"\
-
-
-void ff_simple_idct_vis(int16_t *data) {
-    int out1, out2, out3, out4;
-    DECLARE_ALIGNED(8, int16_t, temp)[8*8];
-
-    __asm__ volatile(
-        INIT_IDCT
-
-#define ADDROUNDER
-
-        // shift right 16-4=12
-        LOADSCALE("%2+8")
-        IDCT4ROWS
-        STOREROWS("%3+8")
-        LOADSCALE("%2+0")
-        IDCT4ROWS
-        "std %%f48, [%3+112] \n\t"
-        "std %%f50, [%3+96]  \n\t"
-        "std %%f52, [%3+80]  \n\t"
-        "std %%f54, [%3+64]  \n\t"
-
-        // shift right 16+4
-        "ldd [%3+8], %%f18  \n\t"
-        "ldd [%3+24], %%f22 \n\t"
-        "ldd [%3+40], %%f26 \n\t"
-        "ldd [%3+56], %%f30 \n\t"
-        TRANSPOSE
-        IDCT4ROWS
-        SCALEROWS
-        STOREROWS("%2+0")
-        LOAD("%3+64")
-        TRANSPOSE
-        IDCT4ROWS
-        SCALEROWS
-        STOREROWS("%2+8")
-
-        : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4)
-        : "0" (scale), "1" (coeffs), "2" (data), "3" (temp)
-    );
-}
-
-void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data) {
-    int out1, out2, out3, out4, out5;
-    int r1, r2, r3, r4, r5, r6, r7;
-
-    __asm__ volatile(
-        "wr %%g0, 0x8, %%gsr \n\t"
-
-        INIT_IDCT
-
-        "add %3, %4, %5   \n\t"
-        "add %5, %4, %6   \n\t"
-        "add %6, %4, %7   \n\t"
-        "add %7, %4, %8   \n\t"
-        "add %8, %4, %9   \n\t"
-        "add %9, %4, %10  \n\t"
-        "add %10, %4, %11 \n\t"
-
-        // shift right 16-4=12
-        LOADSCALE("%2+8")
-        IDCT4ROWS
-        STOREROWS("%2+8")
-        LOADSCALE("%2+0")
-        IDCT4ROWS
-        "std %%f48, [%2+112] \n\t"
-        "std %%f50, [%2+96]  \n\t"
-        "std %%f52, [%2+80]  \n\t"
-        "std %%f54, [%2+64]  \n\t"
-
-#undef ADDROUNDER
-#define ADDROUNDER "fpadd16 %%f28, %%f46, %%f28 \n\t"
-
-        // shift right 16+4
-        "ldd [%2+8], %%f18  \n\t"
-        "ldd [%2+24], %%f22 \n\t"
-        "ldd [%2+40], %%f26 \n\t"
-        "ldd [%2+56], %%f30 \n\t"
-        TRANSPOSE
-        IDCT4ROWS
-        PUTPIXELSCLAMPED("0")
-        LOAD("%2+64")
-        TRANSPOSE
-        IDCT4ROWS
-        PUTPIXELSCLAMPED("4")
-
-        : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5),
-          "=r" (r1), "=r" (r2), "=r" (r3), "=r" (r4), "=r" (r5), "=r" (r6), "=r" (r7)
-        : "0" (rounder), "1" (coeffs), "2" (data), "3" (dest), "4" (line_size)
-    );
-}
-
-void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data) {
-    int out1, out2, out3, out4, out5, out6;
-    int r1, r2, r3, r4, r5, r6, r7;
-
-    __asm__ volatile(
-        "wr %%g0, 0x8, %%gsr \n\t"
-
-        INIT_IDCT
-
-        "add %3, %4, %6   \n\t"
-        "add %6, %4, %7   \n\t"
-        "add %7, %4, %8   \n\t"
-        "add %8, %4, %9   \n\t"
-        "add %9, %4, %10  \n\t"
-        "add %10, %4, %11 \n\t"
-        "add %11, %4, %12 \n\t"
-
-#undef ADDROUNDER
-#define ADDROUNDER
-
-        // shift right 16-4=12
-        LOADSCALE("%2+8")
-        IDCT4ROWS
-        STOREROWS("%2+8")
-        LOADSCALE("%2+0")
-        IDCT4ROWS
-        "std %%f48, [%2+112] \n\t"
-        "std %%f50, [%2+96]  \n\t"
-        "std %%f52, [%2+80]  \n\t"
-        "std %%f54, [%2+64]  \n\t"
-
-#undef ADDROUNDER
-#define ADDROUNDER "fpadd16 %%f28, %%f46, %%f28 \n\t"
-
-        // shift right 16+4
-        "ldd [%2+8], %%f18  \n\t"
-        "ldd [%2+24], %%f22 \n\t"
-        "ldd [%2+40], %%f26 \n\t"
-        "ldd [%2+56], %%f30 \n\t"
-        TRANSPOSE
-        IDCT4ROWS
-        ADDPIXELSCLAMPED("0")
-        LOAD("%2+64")
-        TRANSPOSE
-        IDCT4ROWS
-        ADDPIXELSCLAMPED("4")
-
-        : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6),
-          "=r" (r1), "=r" (r2), "=r" (r3), "=r" (r4), "=r" (r5), "=r" (r6), "=r" (r7)
-        : "0" (rounder), "1" (coeffs), "2" (data), "3" (dest), "4" (line_size), "5" (expand)
-    );
-}
diff --git a/deps/libav/libavcodec/sparc/vis.h b/deps/libav/libavcodec/sparc/vis.h
deleted file mode 100644
index ff2fb9d..0000000
--- a/deps/libav/libavcodec/sparc/vis.h
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (C) 2003 David S. Miller <davem at redhat.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* You may be asking why I hard-code the instruction opcodes and don't
- * use the normal VIS assembler mnenomics for the VIS instructions.
- *
- * The reason is that Sun, in their infinite wisdom, decided that a binary
- * using a VIS instruction will cause it to be marked (in the ELF headers)
- * as doing so, and this prevents the OS from loading such binaries if the
- * current cpu doesn't have VIS.  There is no way to easily override this
- * behavior of the assembler that I am aware of.
- *
- * This totally defeats what libmpeg2 is trying to do which is allow a
- * single binary to be created, and then detect the availability of VIS
- * at runtime.
- *
- * I'm not saying that tainting the binary by default is bad, rather I'm
- * saying that not providing a way to override this easily unnecessarily
- * ties people's hands.
- *
- * Thus, we do the opcode encoding by hand and output 32-bit words in
- * the assembler to keep the binary from becoming tainted.
- */
-
-#ifndef AVCODEC_SPARC_VIS_H
-#define AVCODEC_SPARC_VIS_H
-
-#define ACCEL_SPARC_VIS 1
-#define ACCEL_SPARC_VIS2 2
-
-static inline int vis_level(void)
-{
-    int accel = 0;
-    accel |= ACCEL_SPARC_VIS;
-    accel |= ACCEL_SPARC_VIS2;
-    return accel;
-}
-
-#define vis_opc_base    ((0x1 << 31) | (0x36 << 19))
-#define vis_opf(X)      ((X) << 5)
-#define vis_sreg(X)     (X)
-#define vis_dreg(X)     (((X)&0x1f)|((X)>>5))
-#define vis_rs1_s(X)    (vis_sreg(X) << 14)
-#define vis_rs1_d(X)    (vis_dreg(X) << 14)
-#define vis_rs2_s(X)    (vis_sreg(X) << 0)
-#define vis_rs2_d(X)    (vis_dreg(X) << 0)
-#define vis_rd_s(X)     (vis_sreg(X) << 25)
-#define vis_rd_d(X)     (vis_dreg(X) << 25)
-
-#define vis_ss2s(opf,rs1,rs2,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs1_s(rs1) | \
-                                       vis_rs2_s(rs2) | \
-                                       vis_rd_s(rd)))
-
-#define vis_dd2d(opf,rs1,rs2,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs1_d(rs1) | \
-                                       vis_rs2_d(rs2) | \
-                                       vis_rd_d(rd)))
-
-#define vis_ss2d(opf,rs1,rs2,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs1_s(rs1) | \
-                                       vis_rs2_s(rs2) | \
-                                       vis_rd_d(rd)))
-
-#define vis_sd2d(opf,rs1,rs2,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs1_s(rs1) | \
-                                       vis_rs2_d(rs2) | \
-                                       vis_rd_d(rd)))
-
-#define vis_d2s(opf,rs2,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs2_d(rs2) | \
-                                       vis_rd_s(rd)))
-
-#define vis_s2d(opf,rs2,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs2_s(rs2) | \
-                                       vis_rd_d(rd)))
-
-#define vis_d12d(opf,rs1,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs1_d(rs1) | \
-                                       vis_rd_d(rd)))
-
-#define vis_d22d(opf,rs2,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs2_d(rs2) | \
-                                       vis_rd_d(rd)))
-
-#define vis_s12s(opf,rs1,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs1_s(rs1) | \
-                                       vis_rd_s(rd)))
-
-#define vis_s22s(opf,rs2,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rs2_s(rs2) | \
-                                       vis_rd_s(rd)))
-
-#define vis_s(opf,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rd_s(rd)))
-
-#define vis_d(opf,rd) \
-        __asm__ volatile (".word %0" \
-                              : : "i" (vis_opc_base | vis_opf(opf) | \
-                                       vis_rd_d(rd)))
-
-#define vis_r2m(op,rd,mem) \
-        __asm__ volatile (#op "\t%%f" #rd ", [%0]" : : "r" (&(mem)) )
-
-#define vis_r2m_2(op,rd,mem1,mem2) \
-        __asm__ volatile (#op "\t%%f" #rd ", [%0 + %1]" : : "r" (mem1), "r" (mem2) )
-
-#define vis_m2r(op,mem,rd) \
-        __asm__ volatile (#op "\t[%0], %%f" #rd : : "r" (&(mem)) )
-
-#define vis_m2r_2(op,mem1,mem2,rd) \
-        __asm__ volatile (#op "\t[%0 + %1], %%f" #rd : : "r" (mem1), "r" (mem2) )
-
-static inline void vis_set_gsr(unsigned int val)
-{
-        __asm__ volatile("mov %0,%%asr19"
-                             : : "r" (val));
-}
-
-#define VIS_GSR_ALIGNADDR_MASK          0x0000007
-#define VIS_GSR_ALIGNADDR_SHIFT         0
-#define VIS_GSR_SCALEFACT_MASK          0x0000078
-#define VIS_GSR_SCALEFACT_SHIFT         3
-
-#define vis_ld32(mem,rs1)               vis_m2r(ld, mem, rs1)
-#define vis_ld32_2(mem1,mem2,rs1)       vis_m2r_2(ld, mem1, mem2, rs1)
-#define vis_st32(rs1,mem)               vis_r2m(st, rs1, mem)
-#define vis_st32_2(rs1,mem1,mem2)       vis_r2m_2(st, rs1, mem1, mem2)
-#define vis_ld64(mem,rs1)               vis_m2r(ldd, mem, rs1)
-#define vis_ld64_2(mem1,mem2,rs1)       vis_m2r_2(ldd, mem1, mem2, rs1)
-#define vis_st64(rs1,mem)               vis_r2m(std, rs1, mem)
-#define vis_st64_2(rs1,mem1,mem2)       vis_r2m_2(std, rs1, mem1, mem2)
-
-/* 16 and 32 bit partitioned addition and subtraction.  The normal
- * versions perform 4 16-bit or 2 32-bit additions or subtractions.
- * The 's' versions perform 2 16-bit or 1 32-bit additions or
- * subtractions.
- */
-
-#define vis_padd16(rs1,rs2,rd)          vis_dd2d(0x50, rs1, rs2, rd)
-#define vis_padd16s(rs1,rs2,rd)         vis_ss2s(0x51, rs1, rs2, rd)
-#define vis_padd32(rs1,rs2,rd)          vis_dd2d(0x52, rs1, rs2, rd)
-#define vis_padd32s(rs1,rs2,rd)         vis_ss2s(0x53, rs1, rs2, rd)
-#define vis_psub16(rs1,rs2,rd)          vis_dd2d(0x54, rs1, rs2, rd)
-#define vis_psub16s(rs1,rs2,rd)         vis_ss2s(0x55, rs1, rs2, rd)
-#define vis_psub32(rs1,rs2,rd)          vis_dd2d(0x56, rs1, rs2, rd)
-#define vis_psub32s(rs1,rs2,rd)         vis_ss2s(0x57, rs1, rs2, rd)
-
-/* Pixel formatting instructions.  */
-
-#define vis_pack16(rs2,rd)              vis_d2s( 0x3b,      rs2, rd)
-#define vis_pack32(rs1,rs2,rd)          vis_dd2d(0x3a, rs1, rs2, rd)
-#define vis_packfix(rs2,rd)             vis_d2s( 0x3d,      rs2, rd)
-#define vis_expand(rs2,rd)              vis_s2d( 0x4d,      rs2, rd)
-#define vis_pmerge(rs1,rs2,rd)          vis_ss2d(0x4b, rs1, rs2, rd)
-
-/* Partitioned multiply instructions.  */
-
-#define vis_mul8x16(rs1,rs2,rd)         vis_sd2d(0x31, rs1, rs2, rd)
-#define vis_mul8x16au(rs1,rs2,rd)       vis_ss2d(0x33, rs1, rs2, rd)
-#define vis_mul8x16al(rs1,rs2,rd)       vis_ss2d(0x35, rs1, rs2, rd)
-#define vis_mul8sux16(rs1,rs2,rd)       vis_dd2d(0x36, rs1, rs2, rd)
-#define vis_mul8ulx16(rs1,rs2,rd)       vis_dd2d(0x37, rs1, rs2, rd)
-#define vis_muld8sux16(rs1,rs2,rd)      vis_ss2d(0x38, rs1, rs2, rd)
-#define vis_muld8ulx16(rs1,rs2,rd)      vis_ss2d(0x39, rs1, rs2, rd)
-
-/* Alignment instructions.  */
-
-static inline const void *vis_alignaddr(const void *ptr)
-{
-        __asm__ volatile("alignaddr %0, %%g0, %0"
-                             : "=&r" (ptr)
-                             : "0" (ptr));
-
-        return ptr;
-}
-
-static inline void vis_alignaddr_g0(void *ptr)
-{
-        __asm__ volatile("alignaddr %0, %%g0, %%g0"
-                             : : "r" (ptr));
-}
-
-#define vis_faligndata(rs1,rs2,rd)        vis_dd2d(0x48, rs1, rs2, rd)
-
-/* Logical operate instructions.  */
-
-#define vis_fzero(rd)                   vis_d(   0x60,           rd)
-#define vis_fzeros(rd)                  vis_s(   0x61,           rd)
-#define vis_fone(rd)                    vis_d(   0x7e,           rd)
-#define vis_fones(rd)                   vis_s(   0x7f,           rd)
-#define vis_src1(rs1,rd)                vis_d12d(0x74, rs1,      rd)
-#define vis_src1s(rs1,rd)               vis_s12s(0x75, rs1,      rd)
-#define vis_src2(rs2,rd)                vis_d22d(0x78,      rs2, rd)
-#define vis_src2s(rs2,rd)               vis_s22s(0x79,      rs2, rd)
-#define vis_not1(rs1,rd)                vis_d12d(0x6a, rs1,      rd)
-#define vis_not1s(rs1,rd)               vis_s12s(0x6b, rs1,      rd)
-#define vis_not2(rs2,rd)                vis_d22d(0x66,      rs2, rd)
-#define vis_not2s(rs2,rd)               vis_s22s(0x67,      rs2, rd)
-#define vis_or(rs1,rs2,rd)              vis_dd2d(0x7c, rs1, rs2, rd)
-#define vis_ors(rs1,rs2,rd)             vis_ss2s(0x7d, rs1, rs2, rd)
-#define vis_nor(rs1,rs2,rd)             vis_dd2d(0x62, rs1, rs2, rd)
-#define vis_nors(rs1,rs2,rd)            vis_ss2s(0x63, rs1, rs2, rd)
-#define vis_and(rs1,rs2,rd)             vis_dd2d(0x70, rs1, rs2, rd)
-#define vis_ands(rs1,rs2,rd)            vis_ss2s(0x71, rs1, rs2, rd)
-#define vis_nand(rs1,rs2,rd)            vis_dd2d(0x6e, rs1, rs2, rd)
-#define vis_nands(rs1,rs2,rd)           vis_ss2s(0x6f, rs1, rs2, rd)
-#define vis_xor(rs1,rs2,rd)             vis_dd2d(0x6c, rs1, rs2, rd)
-#define vis_xors(rs1,rs2,rd)            vis_ss2s(0x6d, rs1, rs2, rd)
-#define vis_xnor(rs1,rs2,rd)            vis_dd2d(0x72, rs1, rs2, rd)
-#define vis_xnors(rs1,rs2,rd)           vis_ss2s(0x73, rs1, rs2, rd)
-#define vis_ornot1(rs1,rs2,rd)          vis_dd2d(0x7a, rs1, rs2, rd)
-#define vis_ornot1s(rs1,rs2,rd)         vis_ss2s(0x7b, rs1, rs2, rd)
-#define vis_ornot2(rs1,rs2,rd)          vis_dd2d(0x76, rs1, rs2, rd)
-#define vis_ornot2s(rs1,rs2,rd)         vis_ss2s(0x77, rs1, rs2, rd)
-#define vis_andnot1(rs1,rs2,rd)         vis_dd2d(0x68, rs1, rs2, rd)
-#define vis_andnot1s(rs1,rs2,rd)        vis_ss2s(0x69, rs1, rs2, rd)
-#define vis_andnot2(rs1,rs2,rd)         vis_dd2d(0x64, rs1, rs2, rd)
-#define vis_andnot2s(rs1,rs2,rd)        vis_ss2s(0x65, rs1, rs2, rd)
-
-/* Pixel component distance.  */
-
-#define vis_pdist(rs1,rs2,rd)           vis_dd2d(0x3e, rs1, rs2, rd)
-
-#endif /* AVCODEC_SPARC_VIS_H */
diff --git a/deps/libav/libavcodec/srtdec.c b/deps/libav/libavcodec/srtdec.c
deleted file mode 100644
index bbc8061..0000000
--- a/deps/libav/libavcodec/srtdec.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * SubRip subtitle decoder
- * Copyright (c) 2010  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/common.h"
-#include "libavutil/parseutils.h"
-#include "avcodec.h"
-#include "ass.h"
-
-static int html_color_parse(AVCodecContext *avctx, const char *str)
-{
-    uint8_t rgba[4];
-    if (av_parse_color(rgba, str, strcspn(str, "\" >"), avctx) < 0)
-        return -1;
-    return rgba[0] | rgba[1] << 8 | rgba[2] << 16;
-}
-
-enum {
-    PARAM_UNKNOWN = -1,
-    PARAM_SIZE,
-    PARAM_COLOR,
-    PARAM_FACE,
-    PARAM_NUMBER
-};
-
-typedef struct {
-    char tag[128];
-    char param[PARAM_NUMBER][128];
-} SrtStack;
-
-static const char *srt_to_ass(AVCodecContext *avctx, char *out, char *out_end,
-                              const char *in, int x1, int y1, int x2, int y2)
-{
-    char c, *param, buffer[128], tmp[128];
-    int len, tag_close, sptr = 1, line_start = 1, an = 0, end = 0;
-    SrtStack stack[16];
-
-    stack[0].tag[0] = 0;
-    strcpy(stack[0].param[PARAM_SIZE],  "{\\fs}");
-    strcpy(stack[0].param[PARAM_COLOR], "{\\c}");
-    strcpy(stack[0].param[PARAM_FACE],  "{\\fn}");
-
-    if (x1 >= 0 && y1 >= 0) {
-        if (x2 >= 0 && y2 >= 0 && (x2 != x1 || y2 != y1))
-            out += snprintf(out, out_end-out,
-                            "{\\an1}{\\move(%d,%d,%d,%d)}", x1, y1, x2, y2);
-        else
-            out += snprintf(out, out_end-out, "{\\an1}{\\pos(%d,%d)}", x1, y1);
-    }
-
-    for (; out < out_end && !end && *in; in++) {
-        switch (*in) {
-        case '\r':
-            break;
-        case '\n':
-            if (line_start) {
-                end = 1;
-                break;
-            }
-            while (out[-1] == ' ')
-                out--;
-            out += snprintf(out, out_end-out, "\\N");
-            line_start = 1;
-            break;
-        case ' ':
-            if (!line_start)
-                *out++ = *in;
-            break;
-        case '{':    /* skip all {\xxx} substrings except for {\an%d}
-                        and all microdvd like styles such as {Y:xxx} */
-            an += sscanf(in, "{\\an%*1u}%c", &c) == 1;
-            if ((an != 1 && sscanf(in, "{\\%*[^}]}%n%c", &len, &c) > 0) ||
-                sscanf(in, "{%*1[CcFfoPSsYy]:%*[^}]}%n%c", &len, &c) > 0) {
-                in += len - 1;
-            } else
-                *out++ = *in;
-            break;
-        case '<':
-            tag_close = in[1] == '/';
-            if (sscanf(in+tag_close+1, "%127[^>]>%n%c", buffer, &len,&c) >= 2) {
-                if ((param = strchr(buffer, ' ')))
-                    *param++ = 0;
-                if ((!tag_close && sptr < FF_ARRAY_ELEMS(stack)) ||
-                    ( tag_close && sptr > 0 && !strcmp(stack[sptr-1].tag, buffer))) {
-                    int i, j, unknown = 0;
-                    in += len + tag_close;
-                    if (!tag_close)
-                        memset(stack+sptr, 0, sizeof(*stack));
-                    if (!strcmp(buffer, "font")) {
-                        if (tag_close) {
-                            for (i=PARAM_NUMBER-1; i>=0; i--)
-                                if (stack[sptr-1].param[i][0])
-                                    for (j=sptr-2; j>=0; j--)
-                                        if (stack[j].param[i][0]) {
-                                            out += snprintf(out, out_end-out,
-                                                            "%s", stack[j].param[i]);
-                                            break;
-                                        }
-                        } else {
-                            while (param) {
-                                if (!strncmp(param, "size=", 5)) {
-                                    unsigned font_size;
-                                    param += 5 + (param[5] == '"');
-                                    if (sscanf(param, "%u", &font_size) == 1) {
-                                        snprintf(stack[sptr].param[PARAM_SIZE],
-                                             sizeof(stack[0].param[PARAM_SIZE]),
-                                             "{\\fs%u}", font_size);
-                                    }
-                                } else if (!strncmp(param, "color=", 6)) {
-                                    param += 6 + (param[6] == '"');
-                                    snprintf(stack[sptr].param[PARAM_COLOR],
-                                         sizeof(stack[0].param[PARAM_COLOR]),
-                                         "{\\c&H%X&}",
-                                         html_color_parse(avctx, param));
-                                } else if (!strncmp(param, "face=", 5)) {
-                                    param += 5 + (param[5] == '"');
-                                    len = strcspn(param,
-                                                  param[-1] == '"' ? "\"" :" ");
-                                    av_strlcpy(tmp, param,
-                                               FFMIN(sizeof(tmp), len+1));
-                                    param += len;
-                                    snprintf(stack[sptr].param[PARAM_FACE],
-                                             sizeof(stack[0].param[PARAM_FACE]),
-                                             "{\\fn%s}", tmp);
-                                }
-                                if ((param = strchr(param, ' ')))
-                                    param++;
-                            }
-                            for (i=0; i<PARAM_NUMBER; i++)
-                                if (stack[sptr].param[i][0])
-                                    out += snprintf(out, out_end-out,
-                                                    "%s", stack[sptr].param[i]);
-                        }
-                    } else if (!buffer[1] && strspn(buffer, "bisu") == 1) {
-                        out += snprintf(out, out_end-out,
-                                        "{\\%c%d}", buffer[0], !tag_close);
-                    } else {
-                        unknown = 1;
-                        snprintf(tmp, sizeof(tmp), "</%s>", buffer);
-                    }
-                    if (tag_close) {
-                        sptr--;
-                    } else if (unknown && !strstr(in, tmp)) {
-                        in -= len + tag_close;
-                        *out++ = *in;
-                    } else
-                        av_strlcpy(stack[sptr++].tag, buffer,
-                                   sizeof(stack[0].tag));
-                    break;
-                }
-            }
-        default:
-            *out++ = *in;
-            break;
-        }
-        if (*in != ' ' && *in != '\r' && *in != '\n')
-            line_start = 0;
-    }
-
-    out = FFMIN(out, out_end-3);
-    while (!strncmp(out-2, "\\N", 2))
-        out -= 2;
-    while (out[-1] == ' ')
-        out--;
-    out += snprintf(out, out_end-out, "\r\n");
-    return in;
-}
-
-static const char *read_ts(const char *buf, int *ts_start, int *ts_end,
-                           int *x1, int *y1, int *x2, int *y2)
-{
-    int i, hs, ms, ss, he, me, se;
-
-    for (i=0; i<2; i++) {
-        /* try to read timestamps in either the first or second line */
-        int c = sscanf(buf, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d"
-                       "%*[ ]X1:%u X2:%u Y1:%u Y2:%u",
-                       &hs, &ms, &ss, ts_start, &he, &me, &se, ts_end,
-                       x1, x2, y1, y2);
-        buf += strcspn(buf, "\n") + 1;
-        if (c >= 8) {
-            *ts_start = 100*(ss + 60*(ms + 60*hs)) + *ts_start/10;
-            *ts_end   = 100*(se + 60*(me + 60*he)) + *ts_end  /10;
-            return buf;
-        }
-    }
-    return NULL;
-}
-
-static int srt_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_sub_ptr, AVPacket *avpkt)
-{
-    AVSubtitle *sub = data;
-    int ts_start, ts_end, x1 = -1, y1 = -1, x2 = -1, y2 = -1;
-    char buffer[2048];
-    const char *ptr = avpkt->data;
-    const char *end = avpkt->data + avpkt->size;
-
-    if (avpkt->size <= 0)
-        return avpkt->size;
-
-    ff_ass_init(sub);
-
-    while (ptr < end && *ptr) {
-        ptr = read_ts(ptr, &ts_start, &ts_end, &x1, &y1, &x2, &y2);
-        if (!ptr)
-            break;
-        ptr = srt_to_ass(avctx, buffer, buffer+sizeof(buffer), ptr,
-                         x1, y1, x2, y2);
-        ff_ass_add_rect(sub, buffer, ts_start, ts_end, 0);
-    }
-
-    *got_sub_ptr = sub->num_rects > 0;
-    return avpkt->size;
-}
-
-AVCodec ff_srt_decoder = {
-    .name         = "srt",
-    .long_name    = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
-    .type         = AVMEDIA_TYPE_SUBTITLE,
-    .id           = AV_CODEC_ID_SRT,
-    .init         = ff_ass_subtitle_header_default,
-    .decode       = srt_decode_frame,
-};
diff --git a/deps/libav/libavcodec/sunrast.c b/deps/libav/libavcodec/sunrast.c
deleted file mode 100644
index ffa685c..0000000
--- a/deps/libav/libavcodec/sunrast.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Sun Rasterfile (.sun/.ras/im{1,8,24}/.sunras) image decoder
- * Copyright (c) 2007, 2008 Ivo van Poorten
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "sunrast.h"
-
-static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
-                                int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf       = avpkt->data;
-    const uint8_t *buf_end   = avpkt->data + avpkt->size;
-    AVFrame * const p        = data;
-    unsigned int w, h, depth, type, maptype, maplength, stride, x, y, len, alen;
-    uint8_t *ptr;
-    const uint8_t *bufstart = buf;
-    int ret;
-
-    if (avpkt->size < 32)
-        return AVERROR_INVALIDDATA;
-
-    if (AV_RB32(buf) != RAS_MAGIC) {
-        av_log(avctx, AV_LOG_ERROR, "this is not sunras encoded data\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    w         = AV_RB32(buf + 4);
-    h         = AV_RB32(buf + 8);
-    depth     = AV_RB32(buf + 12);
-    type      = AV_RB32(buf + 20);
-    maptype   = AV_RB32(buf + 24);
-    maplength = AV_RB32(buf + 28);
-    buf      += 32;
-
-    if (type == RT_FORMAT_TIFF || type == RT_FORMAT_IFF || type == RT_EXPERIMENTAL) {
-        avpriv_request_sample(avctx, "TIFF/IFF/EXPERIMENTAL (compression) type");
-        return AVERROR_PATCHWELCOME;
-    }
-    if (type > RT_FORMAT_IFF) {
-        av_log(avctx, AV_LOG_ERROR, "invalid (compression) type\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (maptype == RMT_RAW) {
-        avpriv_request_sample(avctx, "Unknown colormap type");
-        return AVERROR_PATCHWELCOME;
-    }
-    if (maptype > RMT_RAW) {
-        av_log(avctx, AV_LOG_ERROR, "invalid colormap type\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-
-    switch (depth) {
-        case 1:
-            avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
-            break;
-        case 8:
-            avctx->pix_fmt = maplength ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_GRAY8;
-            break;
-        case 24:
-            avctx->pix_fmt = (type == RT_FORMAT_RGB) ? AV_PIX_FMT_RGB24 : AV_PIX_FMT_BGR24;
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "invalid depth\n");
-            return AVERROR_INVALIDDATA;
-    }
-
-    ret = ff_set_dimensions(avctx, w, h);
-    if (ret < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    p->pict_type = AV_PICTURE_TYPE_I;
-
-    if (buf_end - buf < maplength)
-        return AVERROR_INVALIDDATA;
-
-    if (depth != 8 && maplength) {
-        av_log(avctx, AV_LOG_WARNING, "useless colormap found or file is corrupted, trying to recover\n");
-
-    } else if (maplength) {
-        unsigned int len = maplength / 3;
-
-        if (maplength % 3 || maplength > 768) {
-            av_log(avctx, AV_LOG_WARNING, "invalid colormap length\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        ptr = p->data[1];
-        for (x = 0; x < len; x++, ptr += 4)
-            *(uint32_t *)ptr = (buf[x] << 16) + (buf[len + x] << 8) + buf[len + len + x];
-    }
-
-    buf += maplength;
-
-    ptr    = p->data[0];
-    stride = p->linesize[0];
-
-    /* scanlines are aligned on 16 bit boundaries */
-    len  = (depth * w + 7) >> 3;
-    alen = len + (len & 1);
-
-    if (type == RT_BYTE_ENCODED) {
-        int value, run;
-        uint8_t *end = ptr + h * stride;
-
-        x = 0;
-        while (ptr != end && buf < buf_end) {
-            run = 1;
-            if (buf_end - buf < 1)
-                return AVERROR_INVALIDDATA;
-
-            if ((value = *buf++) == RLE_TRIGGER) {
-                run = *buf++ + 1;
-                if (run != 1)
-                    value = *buf++;
-            }
-            while (run--) {
-                if (x < len)
-                    ptr[x] = value;
-                if (++x >= alen) {
-                    x = 0;
-                    ptr += stride;
-                    if (ptr == end)
-                        break;
-                }
-            }
-        }
-    } else {
-        for (y = 0; y < h; y++) {
-            if (buf_end - buf < len)
-                break;
-            memcpy(ptr, buf, len);
-            ptr += stride;
-            buf += alen;
-        }
-    }
-
-    *got_frame = 1;
-
-    return buf - bufstart;
-}
-
-AVCodec ff_sunrast_decoder = {
-    .name           = "sunrast",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SUNRAST,
-    .decode         = sunrast_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/sunrast.h b/deps/libav/libavcodec/sunrast.h
deleted file mode 100644
index d9fe307..0000000
--- a/deps/libav/libavcodec/sunrast.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Sun Rasterfile Image Format
- * Copyright (c) 2007, 2008 Ivo van Poorten
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SUNRAST_H
-#define AVCODEC_SUNRAST_H
-
-#define RAS_MAGIC 0x59a66a95
-
-#define RMT_NONE      0
-#define RMT_EQUAL_RGB 1
-#define RMT_RAW       2 ///< the data layout of this map type is unknown
-
-/* The Old and Standard format types indicate that the image data is
- * uncompressed. There is no difference between the two formats. */
-#define RT_OLD          0
-#define RT_STANDARD     1
-
-/* The Byte-Encoded format type indicates that the image data is compressed
- * using a run-length encoding scheme. */
-#define RT_BYTE_ENCODED 2
-#define RLE_TRIGGER 0x80
-
-/* The RGB format type indicates that the image is uncompressed with reverse
- * component order from Old and Standard (RGB vs BGR). */
-#define RT_FORMAT_RGB   3
-
-/* The TIFF and IFF format types indicate that the raster file was originally
- * converted from either of these file formats. We do not have any samples or
- * documentation of the format details. */
-#define RT_FORMAT_TIFF  4
-#define RT_FORMAT_IFF   5
-
-/* The Experimental format type is implementation-specific and is generally an
- * indication that the image file does not conform to the Sun Raster file
- * format specification. */
-#define RT_EXPERIMENTAL 0xffff
-
-#endif /* AVCODEC_SUNRAST_H */
diff --git a/deps/libav/libavcodec/sunrastenc.c b/deps/libav/libavcodec/sunrastenc.c
deleted file mode 100644
index 25ae9bd..0000000
--- a/deps/libav/libavcodec/sunrastenc.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Sun Rasterfile (.sun/.ras/im{1,8,24}/.sunras) image encoder
- * Copyright (c) 2012 Aneesh Dogra (lionaneesh) <lionaneesh at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "sunrast.h"
-
-typedef struct SUNRASTContext {
-    PutByteContext p;
-    int depth;      ///< depth of pixel
-    int length;     ///< length (bytes) of image
-    int type;       ///< type of file
-    int maptype;    ///< type of colormap
-    int maplength;  ///< length (bytes) of colormap
-    int size;
-} SUNRASTContext;
-
-static void sunrast_image_write_header(AVCodecContext *avctx)
-{
-    SUNRASTContext *s = avctx->priv_data;
-
-    bytestream2_put_be32u(&s->p, RAS_MAGIC);
-    bytestream2_put_be32u(&s->p, avctx->width);
-    bytestream2_put_be32u(&s->p, avctx->height);
-    bytestream2_put_be32u(&s->p, s->depth);
-    bytestream2_put_be32u(&s->p, s->length);
-    bytestream2_put_be32u(&s->p, s->type);
-    bytestream2_put_be32u(&s->p, s->maptype);
-    bytestream2_put_be32u(&s->p, s->maplength);
-}
-
-static void sunrast_image_write_image(AVCodecContext *avctx,
-                                      const uint8_t *pixels,
-                                      const uint32_t *palette_data,
-                                      int linesize)
-{
-    SUNRASTContext *s = avctx->priv_data;
-    const uint8_t *ptr;
-    int len, alen, x;
-
-    if (s->maplength) {     // palettized
-        PutByteContext pb_r, pb_g;
-        int len = s->maplength / 3;
-
-        pb_r = s->p;
-        bytestream2_skip_p(&s->p, len);
-        pb_g = s->p;
-        bytestream2_skip_p(&s->p, len);
-
-        for (x = 0; x < len; x++) {
-            uint32_t pixel = palette_data[x];
-
-            bytestream2_put_byteu(&pb_r, (pixel >> 16) & 0xFF);
-            bytestream2_put_byteu(&pb_g, (pixel >> 8)  & 0xFF);
-            bytestream2_put_byteu(&s->p,  pixel        & 0xFF);
-        }
-    }
-
-    len  = (s->depth * avctx->width + 7) >> 3;
-    alen = len + (len & 1);
-    ptr  = pixels;
-
-     if (s->type == RT_BYTE_ENCODED) {
-        uint8_t value, value2;
-        int run;
-        const uint8_t *start = linesize < 0 ? pixels + (avctx->height - 1) * linesize
-                                            : pixels;
-        const uint8_t *end   = linesize < 0 ? pixels - linesize
-                                            : pixels + avctx->height * linesize;
-
-        ptr = pixels;
-
-#define GET_VALUE ptr >= end || ptr < start ? 0 : x >= len ? ptr[len-1] : ptr[x]
-
-        x = 0;
-        value2 = GET_VALUE;
-        while (ptr < end && ptr >= start) {
-            run = 1;
-            value = value2;
-            x++;
-            if (x >= alen) {
-                x = 0;
-                ptr += linesize;
-            }
-
-            value2 = GET_VALUE;
-            while (value2 == value && run < 256 && ptr < end && ptr >= start) {
-                x++;
-                run++;
-                if (x >= alen) {
-                    x = 0;
-                    ptr += linesize;
-                }
-                value2 = GET_VALUE;
-            }
-
-            if (run > 2 || value == RLE_TRIGGER) {
-                bytestream2_put_byteu(&s->p, RLE_TRIGGER);
-                bytestream2_put_byteu(&s->p, run - 1);
-                if (run > 1)
-                    bytestream2_put_byteu(&s->p, value);
-            } else if (run == 1) {
-                bytestream2_put_byteu(&s->p, value);
-            } else
-                bytestream2_put_be16u(&s->p, (value << 8) | value);
-        }
-
-        // update data length for header
-        s->length = bytestream2_tell_p(&s->p) - 32 - s->maplength;
-    } else {
-        int y;
-        for (y = 0; y < avctx->height; y++) {
-            bytestream2_put_buffer(&s->p, ptr, len);
-            if (len < alen)
-                bytestream2_put_byteu(&s->p, 0);
-            ptr += linesize;
-        }
-    }
-}
-
-static av_cold int sunrast_encode_init(AVCodecContext *avctx)
-{
-    SUNRASTContext *s = avctx->priv_data;
-
-    switch (avctx->coder_type) {
-    case FF_CODER_TYPE_RLE:
-        s->type = RT_BYTE_ENCODED;
-        break;
-    case FF_CODER_TYPE_RAW:
-        s->type = RT_STANDARD;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "invalid coder_type\n");
-        return AVERROR(EINVAL);
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->key_frame = 1;
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    s->maptype                    = RMT_NONE;
-    s->maplength                  = 0;
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_MONOWHITE:
-        s->depth = 1;
-        break;
-    case AV_PIX_FMT_PAL8 :
-        s->maptype   = RMT_EQUAL_RGB;
-        s->maplength = 3 * 256;
-    case AV_PIX_FMT_GRAY8:
-        s->depth = 8;
-        break;
-    case AV_PIX_FMT_BGR24:
-        s->depth = 24;
-        break;
-    default:
-        return AVERROR_BUG;
-    }
-    s->length = avctx->height * (FFALIGN(avctx->width * s->depth, 16) >> 3);
-    s->size   = 32 + s->maplength +
-                s->length * (s->type == RT_BYTE_ENCODED ? 2 : 1);
-
-    return 0;
-}
-
-static int sunrast_encode_frame(AVCodecContext *avctx,  AVPacket *avpkt,
-                                const AVFrame *frame, int *got_packet_ptr)
-{
-    SUNRASTContext *s = avctx->priv_data;
-    int ret;
-
-    if ((ret = ff_alloc_packet(avpkt, s->size)) < 0)
-        return ret;
-
-    bytestream2_init_writer(&s->p, avpkt->data, avpkt->size);
-    sunrast_image_write_header(avctx);
-    sunrast_image_write_image(avctx, frame->data[0],
-                              (const uint32_t *)frame->data[1],
-                              frame->linesize[0]);
-    // update data length in header after RLE
-    if (s->type == RT_BYTE_ENCODED)
-        AV_WB32(&avpkt->data[16], s->length);
-
-    *got_packet_ptr = 1;
-    avpkt->flags |= AV_PKT_FLAG_KEY;
-    avpkt->size = bytestream2_tell_p(&s->p);
-    return 0;
-}
-
-static av_cold int sunrast_encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-static const AVCodecDefault sunrast_defaults[] = {
-     { "coder", "rle" },
-     { NULL },
-};
-
-AVCodec ff_sunrast_encoder = {
-    .name           = "sunrast",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SUNRAST,
-    .priv_data_size = sizeof(SUNRASTContext),
-    .init           = sunrast_encode_init,
-    .close          = sunrast_encode_close,
-    .encode2        = sunrast_encode_frame,
-    .defaults       = sunrast_defaults,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24,
-                                                  AV_PIX_FMT_PAL8,
-                                                  AV_PIX_FMT_GRAY8,
-                                                  AV_PIX_FMT_MONOWHITE,
-                                                  AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/svq1.c b/deps/libav/libavcodec/svq1.c
deleted file mode 100644
index 545df80..0000000
--- a/deps/libav/libavcodec/svq1.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * SVQ1 decoder
- * ported to MPlayer by Arpi <arpi at thot.banki.hu>
- * ported to libavcodec by Nick Kurshev <nickols_k at mail.ru>
- *
- * Copyright (C) 2002 the xine project
- * Copyright (C) 2002 the ffmpeg project
- *
- * SVQ1 Encoder (c) 2004 Mike Melanson <melanson at pcisys.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sorenson Vector Quantizer #1 (SVQ1) video codec.
- * For more information of the SVQ1 algorithm, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- */
-
-#include "svq1.h"
-#include "svq1_cb.h"
-#include "svq1_vlc.h"
-
-/* standard video sizes */
-const uint16_t ff_svq1_frame_size_table[7][2] = {
-    { 160, 120 }, { 128,  96 }, { 176, 144 }, { 352, 288 },
-    { 704, 576 }, { 240, 180 }, { 320, 240 }
-};
diff --git a/deps/libav/libavcodec/svq1.h b/deps/libav/libavcodec/svq1.h
deleted file mode 100644
index 70b5c37..0000000
--- a/deps/libav/libavcodec/svq1.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * SVQ1 decoder
- * ported to MPlayer by Arpi <arpi at thot.banki.hu>
- * ported to libavcodec by Nick Kurshev <nickols_k at mail.ru>
- *
- * Copyright (C) 2002 the xine project
- * Copyright (C) 2002 the ffmpeg project
- *
- * SVQ1 Encoder (c) 2004 Mike Melanson <melanson at pcisys.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sorenson Vector Quantizer #1 (SVQ1) video codec.
- * For more information of the SVQ1 algorithm, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- */
-
-#ifndef AVCODEC_SVQ1_H
-#define AVCODEC_SVQ1_H
-
-#include <stdint.h>
-
-#define SVQ1_BLOCK_SKIP         0
-#define SVQ1_BLOCK_INTER        1
-#define SVQ1_BLOCK_INTER_4V     2
-#define SVQ1_BLOCK_INTRA        3
-
-uint16_t ff_svq1_packet_checksum(const uint8_t *data,
-                                 const int length, int value);
-
-extern const int8_t *const ff_svq1_inter_codebooks[6];
-extern const int8_t *const ff_svq1_intra_codebooks[6];
-
-extern const uint8_t ff_svq1_block_type_vlc[4][2];
-extern const uint8_t ff_svq1_intra_multistage_vlc[6][8][2];
-extern const uint8_t ff_svq1_inter_multistage_vlc[6][8][2];
-extern const uint16_t ff_svq1_intra_mean_vlc[256][2];
-extern const uint16_t ff_svq1_inter_mean_vlc[512][2];
-
-extern const uint16_t ff_svq1_frame_size_table[7][2];
-
-#endif /* AVCODEC_SVQ1_H */
diff --git a/deps/libav/libavcodec/svq13.c b/deps/libav/libavcodec/svq13.c
deleted file mode 100644
index e0d2154..0000000
--- a/deps/libav/libavcodec/svq13.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * SVQ1/SVQ3 decoder common code
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "svq1.h"
-
-static const uint16_t checksum_table[256] = {
-    0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
-    0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
-    0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
-    0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
-    0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
-    0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
-    0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
-    0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
-    0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
-    0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
-    0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
-    0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
-    0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
-    0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
-    0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
-    0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
-    0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
-    0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
-    0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
-    0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
-    0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
-    0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
-    0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
-    0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
-    0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
-    0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
-    0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
-    0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
-    0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
-    0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
-    0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
-    0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
-};
-
-uint16_t ff_svq1_packet_checksum (const uint8_t *data,
-                                  const int length, int value)
-{
-    int i;
-
-    for (i = 0; i < length; i++)
-        value = checksum_table[data[i] ^ (value >> 8)] ^ ((value & 0xFF) << 8);
-
-    return value;
-}
diff --git a/deps/libav/libavcodec/svq1_cb.h b/deps/libav/libavcodec/svq1_cb.h
deleted file mode 100644
index e22cd60..0000000
--- a/deps/libav/libavcodec/svq1_cb.h
+++ /dev/null
@@ -1,1525 +0,0 @@
-/*
- * SVQ1 decoder
- * ported to MPlayer by Arpi <arpi at thot.banki.hu>
- * ported to libavcodec by Nick Kurshev <nickols_k at mail.ru>
- *
- * Copyright (C) 2002 the xine project
- * Copyright (C) 2002 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * svq1 code books.
- */
-
-#ifndef AVCODEC_SVQ1_CB_H
-#define AVCODEC_SVQ1_CB_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#include "libavutil/mem.h"
-
-/* 6x16-entry codebook for inter-coded 4x2 vectors */
-DECLARE_ALIGNED(4, static const int8_t, svq1_inter_codebook_4x2)[768] = {
-    7,  2, -6, -7,  7,  3, -3, -4, -7, -2,  7,  8, -8, -4,  3,  4,
-   19, 17,  9,  3,-14,-16,-12, -8,-18,-16, -8, -3, 11, 14, 12,  8,
-    7,-16,-10, 20,  7,-17,-10, 20, -6, 18,  8,-21, -7, 18,  9,-20,
-   25,  3,-20,-14, 29,  7,-18,-13,-29, -4, 21, 14,-31, -6, 20, 14,
-  -19,-26,-28,-24, 31, 32, 22, 10, 15, 24, 31, 28,-32,-32,-22,-13,
-    2, -8,-23,-26, -9,  3, 27, 35,  3, 11, 21, 21,  8, -4,-27,-34,
-  -30,-31, 12, 47,-29,-30, 13, 47, 38, 30,-17,-46, 34, 26,-19,-46,
-  -42,-50,-51,-43, 34, 48, 55, 48, 48, 54, 51, 42,-44,-52,-53,-47,
-    4,  5,  0, -6, -2, -2,  0,  1,-11, -6, -1, -2,  1,  8,  9,  1,
-    0,  1, -6,  5,  8,  1,-12,  2,  7,-14, -7,  8,  5, -8,  0,  8,
-    1,  4, 11,  8,-12, -8,  0, -5, -1,  1,  0,  4,-15, -8,  3, 16,
-   17,  8, -4, -6,  9, -4,-13, -8,  2,  6,  1,-18, -1, 11, 11,-12,
-    6,  0,  2,  0, 14,  6, -7,-21,  1, -1,-13,-20,  1,  1, 10, 21,
-  -22, -5,  7, 13,-11, -1,  4, 12, -7,  0, 14, 19, -4,  3, -5,-19,
-  -26,-14, 10, 15, 18,  4, -6, -2, 25, 19, -5,-18,-20, -7,  4,  2,
-  -13, -6, -1, -4, 25, 37, -2,-35,  5,  4,  1,  1,-21,-36,  2, 43,
-    2, -2, -1,  3,  8, -2, -6, -1, -2, -3,  2, 12, -5, -2, -2, -1,
-   -3, -1, -1, -5, -1,  7,  8, -2,  2,  7,  5, -3,  1,  1, -3, -8,
-   -3, -1, -3, -2, -2, -3,  2, 13, 15,  0,-11, -6,  3,  0,  0,  0,
-   -6, -9, -5, -4, 18,  4,  1,  3, 12,  3,  0,  4,-16, -3,  3, -3,
-  -17,  3, 18,  2, -1, -3, -1, -1, -6, 16, -8,  0, -9, 14, -7,  0,
-    3,-13, 14, -5,  3,-13, 14, -4, -7, 20, 14,-23,  8, -7, -8,  4,
-    8,-15,-19, 16,-10, 13, 11, -3,  9, -1,  1, 26,  5,-15,-27,  2,
-  -20,  7, 16, -4,-40,  9, 31,  1, 26,-12,-30, -7, 40, -2,-19,  4,
-    6,  0,  0,  0, -6, -2,  1,  2,  0, -1,  0, -6,  9,  0, -2, -1,
-   -7,  8,  2, -3, -1,  2, -3,  2,  7, -4, -2,  4,  2,  0,  0, -6,
-   -3, -2,  9,  2, -2, -1,  0, -4, -3, -3,  0, -3, -6,  2, 10,  4,
-    3,  0,-10,  8,  0,  0, -4,  4, -1,  1,  4,  2,  3, -7, -9,  7,
-    2,  1, -9, -4, -1, 12,  0,  0,  3, -1,  7, -4,  3,-14,  4,  2,
-  -12, -9,  1, 11,  2,  5,  1,  0,  3,  1,  0,  2,  0,  8,  6,-19,
-   -6,-10, -7, -4,  9,  7,  5,  7,  6, 21,  3, -3,-11, -9, -5, -2,
-   -4, -9,-16, -1, -2, -5,  1, 36,  8, 11, 19,  0,  2,  5, -4,-41,
-   -1, -1, -2, -1, -2, -2,  1,  6,  0,  4,  1, -8,  1,  1,  1,  0,
-   -2, -3,  4,  0,  2, -1,  3, -3,  1,  3, -4,  1, -1,  3,  0, -5,
-    3,  4,  2,  3, -2, -3, -6, -1, -2, -3, -2,  2, -4,  8,  1,  0,
-   -7,  4,  2,  6, -7, -1,  1,  0, -2,  2, -4,  1,  8, -6,  2, -1,
-   -6,  2,  0,  2,  5,  4, -8, -1, -1,-11,  0,  9,  0, -2,  2,  2,
-   17, -5, -4, -1, -1, -4, -2, -2,  0,-13,  9, -3, -1, 12, -7,  2,
-    0, -2, -5,  2, -7, -5, 20, -3,  7,  7, -1,-30,  3,  5,  8,  1,
-   -6,  3, -1, -4,  2, -2,-11, 18,  0, -7,  3, 14, 20, -3,-18, -9,
-    7, -2,  0, -1, -2,  0,  0, -1, -4, -1,  1,  0, -2,  2,  0,  4,
-    1, -3,  2,  1,  3,  1, -5,  1, -3,  0, -1, -2,  7,  1,  0, -3,
-    2,  5,  0, -2,  2, -5, -1,  1, -1, -2,  4, -1,  0, -3,  5,  0,
-    0,  3, -1, -2, -4,  1,  5, -1, -1,  0, -1,  9, -1, -2, -1, -1,
-   -2,  5,  5, -1, -2,  2, -3, -2,  1,  2,-11,  1,  2,  1,  3,  2,
-    2,-10, -1, -2,  4,  2,  4,  1,  4,  5, -5,  1,  0,  6,-11,  1,
-    1,  0,  6,  6,  0,  2,  1,-15,  7,  3,  5,  9,-30,  2,  2,  2,
-  -34,  1,  9,  2,  5,  8,  8,  2,  7,  2,  6,  6,  2,-27,  1,  4
-};
-
-/* 6x16-entry codebook for inter-coded 4x4 vectors */
-DECLARE_ALIGNED(4, static const int8_t, svq1_inter_codebook_4x4)[1536] = {
-    4,  0, -6, -7, -4, -8,-13, -9, -8, -8, -1,  6, -2,  5, 22, 27,
-  -16, -7, 11, 10,-18, -7, 13, 10,-15, -4, 12,  8, -9, -1,  9,  5,
-   -2,  2, 15,-16, -3,  2, 19,-19, -3,  2, 19,-19, -2,  3, 15,-14,
-   17, 22, 22, 16, -6, -7, -5, -2,-12,-16,-16,-12,  1,  1, -1, -3,
-   11,-17,  0,  8, 14,-21, -1,  9, 14,-21, -2,  8, 11,-16, -2,  6,
-    7, -2,-16, 11,  9, -2,-21, 14, 10, -1,-22, 14,  8, -1,-18, 10,
-  -10, 16,  3, -9,-13, 20,  4,-11,-14, 21,  4,-10,-11, 16,  3, -8,
-   11,  4, -9, -9, 15,  6,-12,-14, 17,  8,-12,-14, 16, 10, -7,-11,
-    4, 10, 14, 13, -1,  7, 15, 16,-12, -7,  3,  8,-20,-23,-18,-10,
-  -10,-18,-26,-25,  4,  1, -6,-11, 13, 15, 11,  3, 12, 15, 13,  8,
-  -16,-19,-16,-11,  7, 12, 15, 11, 11, 16, 16, 11, -6, -9,-11,-10,
-   18, 19, 12,  5, 18, 16,  5, -4,  6,  0,-10,-15, -9,-17,-23,-22,
-  -10,-14, -1, 21,-11,-17,  0, 29,-11,-16,  1, 30,-10,-14,  0, 23,
-  -16,-17,-12, -6,-19,-19,-14, -7, -3, -1,  1,  2, 27, 35, 29, 19,
-  -37, -8, 23, 23,-42, -9, 28, 29,-43,-10, 26, 28,-38,-11, 19, 22,
-   32, 16,-16,-33, 39, 20,-18,-37, 38, 19,-19,-38, 32, 15,-17,-34,
-   24,  9, -6, -4, -1,-10, -6,  3, -8, -9, -1,  3,  3,  7,  2, -6,
-   -1, -3, -1,  0, -1,  4,  2, -7, -3, 11,  3,-16,  1, 20,  9,-18,
-   -3, -8,  6, 12, -5,-10,  7, 13, -6, -9,  5,  7, -5, -5,  2, -1,
-   -8, 12, -3, -1,-10, 15, -3,  1,-11, 13, -4,  1,-11,  8, -3,  2,
-    9,  6, -5,-12,  3,  0, -8,-13, -4, -4, -1, -1, -4,  1, 15, 18,
-    9, 13, 14, 12,  4,  3, -1, -2, -2, -5, -8, -5, -7,-11, -9, -4,
-    7, -5, -7, -4, 14, -2, -7, -4, 17,  0, -8, -5, 15,  1, -7, -5,
-  -10, -1,  6,  4,-15, -9,  2,  4,  2, -1, -3,  0, 25, 13, -8,-10,
-    7, 11, -3,-16,  7, 11, -3,-15,  6,  7, -2, -9,  4,  2, -3, -5,
-   -7, -1, -1,  0, -9, -2,  2,  6,-12, -4,  6, 14,-13, -6,  8, 19,
-  -18,-18,-11, -5, -3,  0,  3,  4,  6,  8,  6,  6,  6,  6,  6,  6,
-   -5,  3, 13,-10, -6,  1, 15, -9, -6, -3, 15, -6, -6, -6, 10, -3,
-    9,  1, -9, -9, 11,  9,  6,  5,  0,  3,  8,  7,-15,-14, -6, -5,
-  -11, -6, 11, 19, -2, -5, -9, -8,  6,  2, -9,-10,  6,  5,  4,  5,
-   -7, -3,  8, 15, -1,  3, 10, 15,  5,  5, -1, -2,  4, -2,-21,-25,
-    6, -6, -6,  5,  8, -9, -7,  9,  8,-12, -7, 13,  4,-14, -7, 14,
-   -4, -3,  1,  1, -3, -5, -2, -3,  7,  0, -2, -4, 20,  7, -4, -4,
-   -3,-20, -6, 10,  6,  0,  0,  1,  5,  8,  5, -1, -3,  0,  0, -2,
-   13,  6, -1,  2,  5,  3,  2,  3, -3,  0,  3,  0,-16, -8, -2, -5,
-   -2, -7, -6,  0, -3, -6, -3,  1, -5, -1,  2, -1, -1, 12, 16,  5,
-   -7,  1,  9,  8,-10, -2,  5,  3, -6,  2,  7,  3, -4,  0, -1, -7,
-    3,  4, -9,-24,  0,  2,  6,  3, -1, -1,  4,  7,  5,  3, -1, -2,
-    3,  6, -9,  2,  1,  6,-13,  1,  1,  8,-10,  2,  1,  8, -7,  1,
-   -3, -3,  2, 22, -2, -3, -5, 12, -2, -3,-10,  2, -3, -1, -4,  2,
-   11, 12,  8,  2, -5, -5, -5, -8, -6, -4,  0, -3, -2, -1,  3,  3,
-   12, -6, -2, -1, 12, -8, -2, -2,  9, -7,  0, -3,  4, -6,  2, -2,
-  -19,  1, 12, -3, -4,  4,  5, -4,  6,  1, -2, -1,  4, -4, -2,  7,
-   -3, -4, -7, -8, -4, -4, -2,  0, -1,  2, 14, 16, -4, -2,  4,  4,
-   -1,  7,  2, -5, -2,  0, -1,  1,  4, -3, -1, 13,  6,-12,-14,  8,
-   -1,  5,  4, -5, -2,  5,  3, -9, -2,  7,  4,-12, -1,  7,  4, -9,
-   -6, -3,  1,  1, 11, 11,  0, -6,  6,  4, -2, -7,-12,-10,  3, 10,
-   -2, -3, -3, -2,  6, 11, 14, 10, -9,-11,-10,-10,  2,  2,  3,  2,
-   -7, -5, -7, -1, -1,  2,  0,  7, -1,  1,  0,  9,  3,  4, -5, -1,
-   10, -1,-15, -1,  4,  1, -5,  2, -3,  1, -1,  1, -3,  1,  4,  4,
-    2, -1,  4, 10,  6,  2, -1,  0,  2,  2, -7,-12, -4,  2,  0, -3,
-   -1, -4, -1, -8,  3, -1,  2, -9,  4,  0,  5, -5,  2,  0,  8,  3,
-    3,  2,  1,  1,  4, -2,  0,  3,  2, -1,  4,  1,  0,  6, -1,-25,
-   -1, -2, -2, -4, -3,  0, -1, -4, -1, -1, -4,  2,  0, -6,  2, 25,
-  -11, -1,  5,  0,  7,  0, -2,  2, 10, -1, -3,  4, -5, -5, -2, -1,
-    0,  6,  3, -1, -2, -1, -1,  1, -1, -7,-12, -5,  8,  6,  2,  4,
-    2,  6, -1, -6,  9, 10, -1, -4,  1,  0, -4,  0,  3, -2, -9, -5,
-   -4,  3,  4,  0, -4,  3,  3,  0,-11,  0,  3,  2,-11,  3,  7,  2,
-    2, -4,  7,  3,  1, -8,  7,  1, -1,-12,  4,  1,  3, -9,  2,  2,
-    2, -2, -2,  9,-17, -3,  3,  1, -4,  7,  1, -6,  5,  4, -1,  3,
-   -1,  2,  0, -4, -7,  8, 12, -1, -2,  5,  4, -5,  3, -5, -8, -2,
-    0,  0, -5, -2, -2, -8,  3, 27, -1, -4, -3,  6, -3,  1, -2, -7,
-    4,  4,  1, -1, -7,-10, -7, -3, 10, 10,  5,  3, -2, -2, -4, -3,
-    0,  1,  5,  7,  4, -2,-16,-20,  0,  4,  7,  8,  2,  0, -2, -1,
-   -2,  1,  3, 17, -3,  1, -2, -1, -1, -2, -1, -2, -1, -5, -1,  0,
-    5, -3,  1,  0,  6, -2,  0,  0, -1, -2,  0, -3,-11,  1,  8, -1,
-    3,  0,  0,  0,  0,  2,  4,  1,  2,  0,  6,  1, -2,-18, -3,  2,
-  -14,  0,  6,  1, -5, -2, -1,  1, -1,  1,  0,  1,  1,  7,  4,  0,
-   -1,  0,  1, -4,  1,  8,  3, -4, -3,  4,  1,  3, -6,  1, -4,  1,
-    1,-12,  3,  3, -1,-10,  0, -1,  2,  0,  2,  1,  3,  2,  2,  4,
-    3,  0,  0,  3,  2,  0, -2,  1,  5,  2, -5,  0,  6, -1,-14, -1,
-   -2, -6, -3, -3,  2, -1,  4,  5,  6, -1, -2,  0,  4,  4, -1, -5,
-   -4,  1,-11,  0, -1,  2, -4,  1,  2, -3,  3, -1,  1, -2, 15,  0,
-    1, -1,  0, -2,  1, -4, -7,  1, -2, -6, -1, 21, -2,  2, -1,  1,
-   21, -1, -2,  0, -1, -3,  1, -2, -9, -2,  2, -1,  2,  1, -4, -1,
-    1,  8,  2, -6,-10, -1,  4,  0, -4, -3,  3,  3,  5,  0, -1, -1,
-    3,  2,  1, -2, -2, -2,  4,  3,  5,  2, -4,-17,  0, -2,  4,  3,
-   -7, -4,  0,  3,  9,  9,  2, -1,-11, -6,  0, -1,  5,  1,  0,  1,
-    0, 17,  5,-11,  3, -2, -6,  0,  2, -2, -4,  1, -4,  1,  2, -1,
-   -5, -1, -5, -3, -3,  5, -3, -2,  4, 16,  2, -5, -2,  5, -1, -1,
-    0,  0, -4,  1, -1,  2,  5, 11, -1, -1, -2,  1, -4, -2, -3, -1,
-   -5, -1, 10,  0,  6,  1,  0, -3,  0, -4,  1,  0, -2, -4,  3, -1,
-    6,  9,  3,  0, -2,  1, -2,  0, -2, -3, -2, -2,  1,  0,  1, -6,
-    1,  0,  2,  1, -1,  3, -2,  1,  0, -1,-15,  0, -1,  5,  2,  6,
-    2,  0,  2,  2,  0,-12, -4,  6,  0,  1,  4, -1,  1,  2,  1, -4,
-    1, -2, -7,  0,  0,  0,  0, -1, -5,  2, 11,  3,  1,  3,  0, -6,
-    0, -3, -9, -4,  1,  3, -1,  0,  4,  1, -2,  0,  7, -3, -1,  6,
-    1, -2,  6,  2,  0, -1,  3, -2, -2,  4,  0,  2, -1,  2,-14,  2,
-    2,  2,  0, -1, -2,  3, -3,-14,  0,  2,  3, -3,  5,  1,  3,  2,
-    1, -3,  4,-14,  1, -2, 11, -1,  0, -1,  3,  0, -1,  1,  0,  2,
-   -2,  3, -3,  2, -4, -1, -4,  3, -1,  2,  1,  3, -6, -2,  2,  7,
-   -2,  1,  2,  0, -2,  0,  0, -1, 12,  5, -1,  2, -8, -1,  1, -7,
-    2, -2, -4,  2, 11,  0,-11, -2,  3,  1, -3, -1,  0,  3,  1, -1,
-    0,  3,  0, -2,  0, -6, -1, -3, 12, -7, -2,  0,  7, -2,  1,  1,
-    1,  2,  2,  2, -1,  2,  0,  2,-23,  0,  4,  0,  3,  2,  1,  3,
-   -4, -5, -1,  5, -3,  5, 10, -1,  0,  0,  3, -4,  1, -1,  2, -5
-};
-
-/* 6x16-entry codebook for inter-coded 8x4 vectors */
-DECLARE_ALIGNED(4, static const int8_t, svq1_inter_codebook_8x4)[3072] = {
-    9,  8,  4,  0, -3, -4, -4, -3,  9,  8,  4, -1, -4, -5, -5, -3,
-    8,  7,  3, -2, -5, -5, -5, -4,  6,  4,  1, -2, -4, -5, -4, -3,
-  -12,-14,-11, -4,  1,  5,  6,  6, -8,-10, -7, -5, -2,  1,  1,  1,
-    5,  4,  3,  1,  0,  0, -1, -1, 13, 13,  9,  6,  3,  0, -1, -2,
-   -4, -4, -3, -1,  1,  4,  8, 11, -5, -6, -4, -2,  0,  3,  8, 12,
-   -7, -7, -6, -4, -2,  2,  7, 10, -7, -7, -5, -4, -2,  1,  5,  8,
-   -3, -2, -1,  1,  3,  6,  7,  6,  2,  3,  5,  7,  8,  8,  6,  4,
-    4,  5,  4,  3,  1, -2, -6, -7,  1,  0, -2, -7,-10,-14,-17,-16,
-   -5, -4,  1,  8,  9,  3, -3, -7, -7, -6,  1, 11, 12,  5, -3, -8,
-   -8, -7,  0,  9, 11,  5, -3, -7, -8, -6, -1,  5,  8,  4, -2, -6,
-   -4, -5, -7, -8, -9, -9, -8, -6, -4, -5, -6, -7, -7, -6, -4, -2,
-    0,  1,  2,  3,  5,  8, 10,  9,  1,  2,  3,  6,  9, 12, 14, 13,
-    5,  6,  6,  5,  4,  3,  2,  1,  5,  6,  7,  7,  6,  6,  6,  4,
-   -1,  0,  1,  1,  3,  5,  5,  5,-13,-16,-17,-17,-14,-10, -6, -4,
-    9, 11, 13, 16, 15, 13, 12, 10, -4, -5, -6, -7, -7, -7, -6, -5,
-   -6, -6, -7, -7, -7, -7, -6, -5, -2, -1,  0,  0,  0,  0,  0, -1,
-  -11,-13,-15,-16,-16,-14,-12,-10,  2,  3,  4,  5,  4,  3,  3,  3,
-    6,  7,  8,  8,  8,  7,  6,  5,  3,  4,  3,  3,  3,  3,  3,  3,
-    3,  4,  4,  1, -2, -7,-13,-17,  5,  7,  7,  5,  1, -5,-13,-19,
-    6,  8,  9,  8,  5, -1, -9,-16,  6,  8, 10, 10,  7,  2, -4,-11,
-   18,  9, -1,-10,-13, -9, -4,  0, 22, 12, -1,-12,-15,-10, -4,  2,
-   23, 13,  0,-10,-13, -9, -3,  2, 20, 12,  2, -6, -9, -6, -2,  2,
-   -6, -6, -6, -7, -7, -7, -7, -6, -6, -7, -8, -8, -9, -9, -9, -8,
-   -3, -3, -3, -3, -3, -3, -3, -3, 12, 15, 18, 21, 21, 19, 17, 14,
-   14, 16, 18, 18, 18, 16, 15, 13,  5,  6,  6,  5,  5,  4,  4,  3,
-   -6, -7, -9,-10,-10,-10, -9, -7,-10,-11,-13,-14,-14,-13,-12,-10,
-  -27,-17, -4,  5,  9, 10, 10,  7,-32,-19, -3,  7, 11, 12, 11,  8,
-  -30,-16, -2,  8, 12, 12, 10,  7,-23,-12,  0,  7, 10, 11,  9,  6,
-   16, 17, 16, 12,  6, -1, -8,-12, 17, 18, 15, 10,  1, -8,-15,-18,
-   15, 14, 10,  4, -5,-14,-20,-23, 10,  8,  4, -1, -9,-16,-21,-22,
-  -10,-12,-12,-11, -5,  4, 14, 20,-11,-13,-15,-12, -4,  7, 19, 27,
-  -11,-13,-14,-11, -3,  8, 21, 28,-10,-11,-12, -9, -2,  8, 18, 25,
-   -1, -1, -1,  1,  4,  6,  6,  5,  0,  0,  0,  2,  4,  3,  1, -2,
-    0,  0,  2,  4,  4, -1, -7,-10,  0,  0,  3,  5,  3, -3,-11,-15,
-  -14,-13, -8, -1,  3,  3, -1, -4, -5, -4, -1,  4,  8,  8,  3,  0,
-    3,  2,  2,  3,  4,  5,  3,  1,  5,  3,  0, -2, -2, -1, -1, -1,
-    9,  1, -6, -6, -5, -3, -2, -1, 12,  1, -6, -6, -4, -2, -1,  0,
-   14,  4, -4, -4, -2, -2, -1, -1, 14,  6, -1, -1, -1, -1, -1, -1,
-    4,  6,  8, 10, 11,  9,  7,  5, -1, -1, -1,  0,  0, -1, -1, -2,
-   -2, -4, -4, -5, -5, -5, -5, -4, -2, -3, -3, -4, -4, -3, -2, -1,
-    2,  3,  4,  4,  3,  1,  0,  0, -1,  1,  4,  5,  6,  5,  4,  3,
-   -8, -6, -2,  2,  3,  4,  4,  3,-14,-13, -9, -5, -2, -1,  0,  0,
-   -3, -4, -5, -4,  0,  7, 12, 13, -3, -4, -5, -5, -2,  4,  9, 10,
-   -2, -3, -4, -5, -4, -1,  3,  4, -1, -1, -2, -3, -3, -2,  0,  1,
-    9,  5, -2, -8,-11,-10, -7, -4, 12, 10,  6,  2,  0, -1,  0,  0,
-    2,  2,  3,  4,  3,  1,  1,  1, -9, -8, -4,  0,  1,  2,  1,  0,
-    6,  8,  8,  5,  1, -5,-11,-13,  0,  1,  2,  2, -1, -4, -8,-11,
-   -3, -2,  1,  3,  3,  1, -1, -4, -2, -1,  2,  5,  6,  6,  4,  1,
-    3,  4,  5,  5,  4,  1, -3, -6,  5,  6,  4,  2,  2,  2,  0, -3,
-    6,  5,  0, -5, -5, -2, -1, -2,  7,  4, -3,-11,-12, -7, -3, -2,
-    1,  0, -1, -1, -1,  0,  0,  0,  2,  3,  4,  4,  5,  5,  4,  3,
-   -7, -9, -9,-10,-10, -9, -7, -6,  3,  4,  5,  6,  5,  5,  5,  5,
-   -7, -7, -7, -7, -6, -6, -5, -4, -5, -4, -3, -1, -1, -1,  0,  0,
-   -3, -2,  1,  4,  5,  5,  5,  5, -2, -1,  3,  6,  9, 10, 10,  9,
-  -14,  1, 10,  3, -2,  0,  1,  1,-16,  2, 13,  3, -3, -1,  1,  0,
-  -15,  2, 12,  3, -4, -2,  1,  1,-10,  3, 10,  2, -3, -1,  1,  1,
-    0,  1,  4,  2, -5,-10, -3, 11, -1,  1,  4,  2, -6,-13, -2, 15,
-   -1,  0,  3,  1, -6,-12, -1, 15, -1,  1,  2,  1, -4, -8,  0, 11,
-   10,  5, -2, -2,  2,  5,  1, -4,  7,  0, -8, -6,  1,  5,  2, -4,
-    2, -5,-12, -7,  2,  7,  4, -1, -1, -7,-10, -4,  4,  9,  7,  2,
-   -5, -5, -4, -6, -6, -5, -5, -3, -1, -2, -2, -4, -5, -6, -5, -4,
-    6,  7,  7,  4,  0, -2, -3, -3, 13, 14, 13, 10,  5,  1, -1, -2,
-    1,  1,  2,  2,  2,  2,  2,  2, -5, -6, -8, -9, -9, -8, -7, -6,
-    7,  9, 10, 11, 11,  9,  7,  5, -1, -2, -3, -3, -4, -4, -4, -3,
-   -1, -1,  0,  0,  0,  0, -1, -1, -3, -3, -4, -5, -4, -3, -3, -2,
-    2,  1, -1, -3, -3, -2, -1,  0, 12, 12,  8,  3,  1,  0,  0,  1,
-   -6, -8, -8, -6, -2,  2,  6,  8,  1,  1, -1, -2,  0,  3,  5,  7,
-    3,  3,  1, -1, -1,  0,  0,  2,  0,  1,  0, -1, -1, -1, -2, -1,
-    1,  0,  0,  0,  0,  0,  2,  4,  2,  1,  3,  4,  3,  1,  0,  2,
-    2,  1,  0,  0, -1, -1,  0,  3,  5,  1, -6,-12,-13, -8, -1,  4,
-   -2,  0, -1, -2, -1,  0,  2,  3, -6, -3, -2,  0,  1,  1,  1,  1,
-   -9, -5,  0,  4,  5,  3,  1,  0, -8, -3,  3,  7,  8,  4,  1,  0,
-    1,  2,  2,  3,  3,  1, -1, -3,  4,  5,  5,  6,  6,  5,  2,  0,
-    0,  0,  0,  0,  1,  0, -2, -4, -3, -3, -4, -3, -3, -4, -7, -8,
-   14, 12,  6, -1, -3, -3,  0,  0,  7,  5,  1, -3, -5, -4, -2, -1,
-   -2, -2, -2, -2, -2, -2, -1, -1, -6, -4, -1,  1,  1,  1,  0, -1,
-    2,  2,  1, -3, -6, -7, -6, -3,  1,  0, -1, -3, -2,  1,  4,  6,
-    0,  0,  1,  2,  4,  7,  8,  7,  0,  0,  0,  0, -1, -4, -7, -8,
-    0,  2,  1, -2, -3, -3, -2, -1, -1,  1,  0, -3, -5, -2,  0,  2,
-   -2, -1, -2, -5, -4,  1,  6,  9, -3, -2, -3, -4, -2,  5, 11, 13,
-   -4, -2,  2,  6,  4, -3,-10,-14, -2, -1,  1,  4,  4,  1, -1, -2,
-    0,  0, -1, -2, -2,  0,  4,  6,  2,  2,  0, -3, -3,  0,  5,  9,
-   -4, -4, -2,  1,  6,  9,  3, -7, -2, -2, -2, -1,  4,  8,  0,-11,
-    1,  1,  0,  0,  2,  6, -1,-10,  2,  2,  1,  0,  2,  4,  0, -7,
-   -1, -2, -3, -6, -7, -8, -8, -8,  2,  3,  3,  1, -1, -2, -3, -4,
-    5,  5,  5,  4,  3,  2,  0, -1,  3,  3,  3,  3,  2,  2,  1,  1,
-    3,  3,  2, -2, -3,  0,  7, 10,  1,  2,  2, -2, -5, -4,  0,  3,
-    0,  3,  4,  2, -3, -5, -6, -4,  0,  2,  4,  4,  1, -4, -7, -7,
-    2,  4,  5,  5,  5,  5,  6,  6, -4, -4, -3, -5, -5, -3, -3, -2,
-   -3, -4, -4, -5, -4, -2, -2, -2,  1,  1,  0,  0,  2,  4,  5,  4,
-   -2,  0,  3,  4,  4,  3,  2,  2, -9, -7, -4,  0,  3,  6,  6,  6,
-   -5, -5, -3, -2,  0,  1,  3,  4,  5,  5,  2, -2, -4, -6, -5, -3,
-    1, -6, -4,  7,  5, -2, -2,  1,  5, -5, -4,  6,  4, -5, -4,  1,
-    5, -5, -4,  6,  4, -5, -3,  1,  1, -7, -3,  8,  7, -1, -3,  1,
-   -8, -7, -4,  0,  2,  4,  5,  5,  5,  6,  5,  2, -1, -5, -7, -7,
-    5,  6,  4,  1, -3, -5, -6, -5, -7, -7, -5, -2,  1,  6,  9, 10,
-    6,  3,  0,  1,  3,  0, -8,-14,  3,  0, -1,  1,  4,  3,  0, -4,
-    1,  0,  0,  1,  2,  1,  1,  1, -1, -1,  1,  2,  1, -1, -1,  0,
-    1,  1,  1,  1,  0, -2, -3,  0,  1,  2,  1,  0, -2, -8, -9, -4,
-    1,  3,  3,  2,  1, -3, -3,  1,  0,  1,  1,  1,  1,  1,  4,  8,
-    2,  5,  9,  7,  2, -1, -1,  1, -4, -1,  1,  0, -3, -4, -1,  2,
-   -3,  0,  3,  3,  0, -1,  0,  2, -4, -1,  1,  1, -2, -4, -5, -4,
-    1, -1, -2, -2, -1,  2,  4,  5,  2,  1,  1,  0, -1, -1,  0,  0,
-    2,  3,  4,  5,  4,  2,  1,  0, -9, -9, -6, -3, -1, -1, -1, -1,
-   -6, -6,  4,  7,  0, -2, -1, -2, -1, -2,  5,  6, -1, -2,  0, -1,
-    4, -1,  1,  0, -4, -2,  0, -2,  7,  1, -1, -2, -3,  1,  3,  1,
-    4,  2,  1,  3,  3,  1,  1,  2,  2, -2, -4,  0,  3,  1,  0,  0,
-    1, -4, -8, -4,  1,  2,  1,  0,  2, -3, -9, -6,  0,  3,  3,  2,
-   -1, -1,  0, -1, -1,  0,  1,  2,  3,  1, -4, -8, -7, -3,  1,  2,
-    2, -1, -3, -2, -1,  0,  1,  0, -1,  0,  5, 11,  9,  3, -1, -3,
-   -1, -2, -2, -1,  1,  1,  1,  1,  0, -1,  0,  3,  6,  6,  5,  5,
-    2,  1, -1, -1, -2, -5, -6, -4,  2,  2,  2,  1, -1, -4, -5, -5,
-   -1, -3, -6, -7, -6, -4, -1,  1,  5,  5,  3,  4,  4,  3,  4,  5,
-   -1, -2, -3, -2, -2, -2,  0,  1,  0,  0,  0,  0,  0,  1,  2,  3,
-   -6, -6, -4, -1,  2,  2,  2,  2, -6, -7, -5, -2,  0, -1, -1,  0,
-    2,  2,  2,  4,  4,  3,  3,  4,  2,  1,  0, -1,  0,  0,  2,  4,
-   12,  5, -5, -8, -5,  0,  2,  2,  2, -3, -6, -3,  0,  0, -1, -2,
-   -2, -3, -1,  3,  4,  1, -2, -3,  2,  2,  3,  4,  3,  1, -1, -1,
-    3,  2,  1,  0,  1,  4,  3,  0,  4,  3,  0, -5, -6,  0,  3,  3,
-    2,  3,  1, -7,-12, -6,  1,  3,  1,  3,  4, -1, -6, -4,  0,  1,
-   -9, -4,  2,  6,  7,  4,  1,  0, -7, -1,  4,  6,  4,  0, -3, -3,
-   -6,  0,  4,  4,  1, -2, -3, -2, -4,  1,  3,  2,  0, -2, -1,  0,
-    0,  5,  2, -5, -3,  3,  1, -4, -2,  4,  2, -6, -3,  6,  4, -3,
-   -1,  5,  3, -5, -1,  7,  3, -4, -1,  2,  0, -6, -3,  5,  3, -3,
-   -8, -3,  3,  5,  3,  1, -2, -2,  2,  4,  4, -2, -4, -3,  1,  3,
-    2,  1, -3, -5, -3,  3,  4,  3, -5, -6, -5,  3, 10,  8, -1, -5,
-    0,  3,  2, -4, -9, -7,  0,  6, -5, -1,  5,  7,  4, -1, -3, -3,
-   -5, -5, -2,  3,  6,  5, -1, -4,  9,  6,  0, -4, -2,  1,  1, -1,
-   -1, -1, -1,  1,  1,  0, -1,  0, -1,  0,  0,  0,  0, -1, -1,  0,
-    2,  1, -2, -1,  1,  1,  0,  0, 12,  8,  2, -1, -1, -4, -7, -7,
-    2,  1,  3,  6,  7,  4,  2,  0,  1,  0, -1,  0, -1, -4, -7, -8,
-    0,  0, -1,  0,  0,  0, -1, -3,  0,  0,  0,  0,  1,  1,  0, -2,
-   -1,  0,  1,  1,  0,  0, -1, -2,  0,  0, -1, -3, -4, -3, -1,  1,
-   -1,  0,  0,  0,  1,  4, 10, 12, -1,  0, -2, -2, -3, -3, -1,  1,
-   -3, -1, -2, -4,  2,  9,  9,  7, -3,  0, -1, -3,  0,  2, -1,  1,
-   -1,  1, -2, -3,  0, -1, -3,  0,  0,  0, -3, -2,  0, -1, -1,  1,
-   -1, -2, -1, -1, -2, -1, -1, -2,  2, -1, -2, -1,  0,  1,  0, -2,
-    3, -1, -2,  2,  5,  3, -1, -3,  1, -5, -5,  1,  6,  6,  2,  0,
-    1,  2,  0, -1,  0,  1,  0, -2, -5, -3, -1,  0,  1,  2,  1, -2,
-   -7, -5, -2, -2, -2, -2,  0,  1, -1,  0,  1,  1,  0,  3,  9, 12,
-    0,  6,  5,  1, -2, -3,  0,  3,  0,  6,  5,  1,  1,  1,  2,  3,
-   -5, -2, -2, -3,  0,  0,  0,  0, -6, -3, -3, -2,  0,  0, -1, -2,
-    4,  4,  2,  1,  0, -1, -1,  0, -2, -2,  0,  1,  2,  1,  1,  0,
-    2,  2,  1, -1, -3, -5, -9,-10,  2,  1, -1, -1,  1,  4,  4,  1,
-    4,  0, -2, -2, -2, -2, -1,  0,  7,  1, -4, -3, -2,  0,  1,  1,
-   10,  5, -1, -2,  0,  1,  1,  0,  5,  1, -3, -4, -3, -1, -1, -2,
-    2,  1, -1, -3, -3,  1,  1, -1, -2, -1,  3,  0, -1,  1,  1,  0,
-   -3,  1,  7,  2, -3, -2, -1,  0, -2,  4,  8, -1, -8, -5,  0,  2,
-   -4, -1,  1,  2,  1, -3, -4, -2, -5, -3, -2,  1,  4,  4,  4,  6,
-   -3, -2, -4, -3,  0,  1,  1,  2,  2,  2,  2,  1,  2,  1, -1, -1,
-   -4, -1,  0, -1, -3, -3, -1, -1,  1,  4,  4,  2,  0, -1, -2, -3,
-    4,  6,  5,  3,  2,  1, -2, -4,  0,  1,  1,  1,  1, -1, -4, -6,
-    1,  2,  2, -1, -6, -5, -1,  2, -3, -2,  1,  1, -4, -3,  2,  5,
-   -2, -1,  2,  2, -3, -4,  0,  3, -2, -2,  2,  6,  5,  2,  1,  2,
-    2, -3, -3,  0,  0,  2,  3,  1,  3, -1,  1,  3,  1,  2, -1, -5,
-   -5, -7, -4, -2,  1,  8,  8,  1, -1,  0,  2,  0, -3,  0,  1, -3,
-   -2, -5, -5, -2, -3, -1,  0, -2, -1, -4,  0,  4,  0,  2,  4,  0,
-    0,  0,  8, 10,  2,  1,  3, -1, -4, -3,  2,  3, -3, -3,  1, -1,
-    1, -2, -4,  2,  7,  3, -2, -1,  6,  4, -2, -1,  2,  0, -1,  3,
-    1,  1, -2, -2, -2, -5, -3,  4, -6, -2,  1,  1, -1, -4, -2,  4,
-   -2, -1, -2, -2,  0,  1,  0, -2, -1,  1,  0, -1,  0,  0, -1, -3,
-    0,  1, -2, -4, -3, -1,  0,  0,  6,  8,  5,  0,  0,  1,  2,  3,
-   -2, -2,  2,  5,  2,  0,  0,  1,  2, -2, -2, -1, -1,  1,  2,  4,
-    2, -1,  0,  1,  0,  0,  0,  1, -8, -7, -1,  1, -1, -1,  1,  3,
-    0,  3,  6,  2, -2,  1,  2,  0,-10, -7, -1,  0, -3, -1,  2,  1,
-    0,  0,  2,  2,  1,  1,  1, -1,  3,  0, -2, -2,  0,  2,  1,  0,
-    8,  1,  0,  0, -2, -3, -1,  0,  2, -2,  2,  5,  1, -2, -1,  1,
-   -3, -6, -3, -1, -3, -3, -1,  2,  2,  0,  1,  2,  2,  1,  0,  0,
-    1, -1, -1, -2, -1,  0,  1,  0, 15,  9,  2, -1, -2, -3, -3, -3,
-    0, -3, -2,  0,  0, -1, -1, -1,  1,  0,  1,  0,  0, -1, -1, -1,
-    0,  2,  2, -2, -3, -3, -7, -8,  0,  2,  2,  0,  1,  2,  1,  1,
-    1,  2,  2,  2,  3,  1,  0,  3,  1,  0, -1, -2, -1, -2,  0,  5,
-  -11, -6, -1,  1,  2,  3,  1, -3,  1,  4,  3, -1, -2,  1,  2, -1,
-    2,  2,  1, -1, -2,  0,  1, -1,  0,  0, -1, -1,  0,  2,  3,  2,
-    1,  1,  2,  1, -1,  1,  0, -4,  0,  0,  0, -2, -2,  2,  4, -2,
-   -2, -3,  0,  0, -1,  2,  1, -6,  0,  2,  5,  5,  3,  2, -1, -7,
-    4,  2,  0,  0,  3,  3,  1, -1,  0, -1, -1,  3,  6,  4,  1, -1,
-   -2, -2,  0,  2,  2,  0, -2, -2, -1,  0, -1, -5, -7, -5, -1,  1,
-    5, -1, -2,  0,  2,  4,  2, -5,  0, -5, -2,  2,  1,  2,  0, -6,
-    6,  1,  0,  1, -2, -1,  4,  2,  2, -3, -3,  0, -1, -2,  0,  0,
-    1, -1,  0,  2,  0,  0,  6, 11,  2, -1, -1,  0, -3, -2,  3,  5,
-    0, -2, -1,  0, -1,  0,  0, -3,  1, -1, -1, -1, -2, -1, -3, -7,
-    1,  1, -2, -2,  1,  3,  1, -2, -1,  2,  0, -1, -1,  1,  0,  0,
-   -4,  2,  3, -1, -2, -2,  0,  1,-11, -2,  4,  5,  6,  2, -1, -2,
-   -6, -2,  1, -1, -3, -4,  1,  9, -3,  0,  3,  3,  2, -3, -3,  3,
-    1,  1,  0,  0,  1, -1, -2,  3,  2,  0, -3, -3,  0, -1, -1,  3,
-    1, -1, -3,  1,  2, -6, -4,  6,  0, -2, -5, -2,  0, -3, -2,  3,
-    2,  2,  1, -2, -2,  1,  2, -1, -1,  1,  1, -2, -1,  6,  7, -1,
-    1,  0, -4, -2,  1, -2, -3,  1, -4,  0, -3, -2,  2,  0, -3,  0,
-   -3,  4,  3,  1,  8,  7,  0, -1, -3,  4,  1, -4,  2,  3, -2, -3,
-   -3,  6,  1, -4,  1,  1, -1, -1, -2,  4, -3, -3,  3,  0, -1, -1,
-    1,  2, -4,  2,  4, -3, -1,  2,  3, -1, -4,  5,  4, -6, -3,  2
-};
-
-/* 6x16-entry codebook for inter-coded 8x8 vectors */
-DECLARE_ALIGNED(4, static const int8_t, svq1_inter_codebook_8x8)[6144] = {
-   -4, -3,  4,  5,  2,  1,  1,  0, -5, -3,  5,  5,  2,  1,  0,  0,
-   -6, -4,  5,  5,  2,  1,  0,  0, -7, -4,  4,  5,  2,  1,  0,  0,
-   -8, -5,  3,  4,  2,  1,  0,  0, -8, -6,  3,  4,  1,  1,  1,  0,
-   -8, -6,  2,  4,  2,  1,  1,  0, -8, -6,  2,  4,  1,  1,  1,  1,
-   -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2,
-   -2, -3, -3, -3, -3, -3, -3, -3, -2, -3, -3, -3, -3, -3, -4, -3,
-   -2, -2, -2, -2, -2, -3, -3, -2,  1,  1,  1,  1,  1,  0, -1, -1,
-    4,  5,  5,  5,  4,  3,  3,  2,  7,  7,  8,  8,  8,  7,  6,  5,
-    2,  1,  2,  4,  4,  0, -4, -6,  1,  1,  2,  5,  5,  1, -5, -7,
-    1,  2,  1,  4,  5,  1, -5, -8,  1,  1,  1,  5,  5,  0, -6, -8,
-    0,  1,  1,  5,  6,  1, -6, -9,  0,  0,  1,  4,  5,  0, -5, -8,
-    0,  0,  1,  4,  5,  0, -5, -7,  0,  0,  1,  4,  4,  1, -4, -7,
-    1,  2,  3,  0, -3, -4, -3, -1,  1,  3,  4,  0, -3, -4, -3, -1,
-    2,  4,  5,  1, -3, -4, -3, -2,  2,  5,  6,  1, -3, -5, -4, -2,
-    3,  6,  6,  1, -3, -5, -4, -2,  3,  6,  6,  1, -3, -5, -4, -2,
-    3,  6,  6,  1, -3, -5, -4, -2,  3,  5,  5,  1, -3, -4, -4, -2,
-    2,  2,  2,  2,  1,  0,  0, -1,  4,  4,  4,  3,  2,  1,  1,  0,
-    4,  5,  4,  4,  3,  3,  2,  1,  4,  4,  4,  4,  4,  3,  2,  2,
-    2,  3,  3,  3,  3,  3,  2,  1, -1, -1, -1, -1,  0,  0,  0,  0,
-   -5, -6, -6, -5, -5, -4, -3, -3, -7, -9, -9, -8, -7, -6, -6, -5,
-    6,  6,  6,  6,  6,  5,  5,  4,  4,  4,  4,  3,  3,  3,  3,  2,
-    0, -1, -1, -1, -2, -2, -1, -1, -3, -5, -6, -6, -6, -6, -5, -4,
-   -3, -5, -6, -7, -6, -6, -5, -4, -1, -2, -2, -2, -2, -2, -1, -1,
-    0,  1,  1,  1,  1,  1,  1,  1,  3,  3,  3,  3,  3,  3,  3,  3,
-    2,  1, -2, -5, -4,  0,  2,  5,  2,  1, -2, -6, -5,  0,  3,  5,
-    2,  1, -2, -6, -6, -1,  3,  6,  3,  2, -2, -7, -6,  0,  4,  7,
-    2,  1, -2, -7, -5,  0,  5,  7,  2,  1, -2, -6, -5,  0,  4,  7,
-    2,  1, -2, -6, -4,  0,  4,  6,  1,  1, -2, -5, -4,  0,  3,  6,
-  -10, -9, -6, -4, -1,  2,  3,  2,-10, -9, -5, -3,  0,  4,  4,  3,
-   -9, -7, -3, -1,  2,  5,  5,  3, -7, -5, -2,  0,  3,  5,  5,  3,
-   -6, -3,  0,  1,  4,  6,  5,  3, -4, -2,  1,  2,  3,  5,  4,  2,
-   -2,  0,  1,  2,  2,  4,  3,  1, -1,  1,  2,  2,  2,  3,  3,  1,
-   -4, -5, -5, -6, -6, -6, -6, -5, -3, -3, -4, -4, -4, -4, -4, -4,
-    0,  0,  0,  0, -1, -1, -1, -1,  5,  5,  6,  5,  5,  4,  3,  2,
-    5,  6,  7,  7,  7,  6,  5,  4,  3,  3,  4,  4,  4,  4,  3,  2,
-    0, -1,  0,  0, -1, -1,  0, -1, -3, -3, -4, -4, -4, -4, -3, -3,
-    1, -2, -5,  1,  5,  4,  2,  0,  1, -3, -6,  1,  6,  5,  2,  0,
-    0, -4, -7,  0,  6,  6,  2,  1, -1, -5, -9, -1,  6,  6,  3,  1,
-   -1, -6,-10, -2,  6,  6,  3,  1, -1, -6, -9, -2,  5,  6,  3,  1,
-   -2, -6, -9, -2,  5,  5,  3,  1, -2, -6, -7, -2,  4,  4,  2,  1,
-   -5, -7, -8, -9, -9, -8, -7, -6, -5, -6, -6, -7, -7, -6, -6, -5,
-   -3, -3, -3, -4, -5, -5, -4, -4, -1,  0,  0, -1, -1, -1, -1, -1,
-    0,  1,  2,  2,  2,  2,  2,  1,  2,  3,  4,  5,  5,  5,  5,  4,
-    3,  4,  5,  6,  8,  8,  8,  7,  3,  4,  5,  6,  7,  7,  7,  6,
-    5,  6,  7,  8,  9, 10, 10,  9,  3,  4,  6,  7,  8,  9,  9,  8,
-    0,  1,  2,  3,  4,  5,  5,  5, -1, -2, -1, -1,  0,  1,  2,  2,
-   -2, -3, -3, -3, -3, -2, -1,  0, -3, -4, -5, -5, -5, -5, -5, -4,
-   -4, -5, -5, -6, -7, -7, -6, -5, -3, -4, -5, -6, -7, -7, -6, -6,
-   13,  7,  0, -3, -3, -4, -4, -5, 14,  7,  0, -3, -3, -4, -4, -4,
-   15,  8, -1, -4, -4, -4, -5, -4, 15,  8, -1, -4, -4, -5, -4, -3,
-   15,  7, -1, -4, -5, -5, -5, -4, 14,  7, -1, -4, -4, -4, -4, -3,
-   12,  6, -1, -4, -4, -4, -4, -3, 11,  5, -1, -4, -4, -4, -4, -3,
-  -17, -4,  5,  4,  4,  4,  3,  3,-18, -5,  5,  4,  4,  4,  3,  3,
-  -19, -5,  6,  4,  4,  4,  3,  2,-20, -5,  6,  4,  4,  4,  3,  3,
-  -20, -4,  6,  4,  4,  5,  3,  3,-19, -5,  6,  4,  4,  5,  3,  3,
-  -18, -4,  5,  4,  4,  4,  3,  2,-17, -5,  4,  3,  4,  4,  3,  3,
-   -6, -6, -6, -4, -2,  1,  6, 11, -6, -7, -7, -4, -2,  2,  8, 13,
-   -8, -8, -7, -4, -2,  3,  9, 14, -8, -8, -7, -5, -1,  4, 10, 16,
-   -8, -8, -7, -5, -1,  4, 10, 17, -8, -8, -7, -4,  0,  5, 10, 16,
-   -8, -8, -6, -3,  0,  4,  9, 15, -7, -7, -5, -3,  0,  4,  8, 12,
-    8,  7,  7,  5,  2, -2, -8,-14,  8,  8,  7,  5,  2, -2, -8,-15,
-    8,  8,  7,  5,  1, -3, -9,-16,  8,  8,  7,  5,  1, -3,-10,-17,
-    8,  9,  8,  5,  1, -3,-10,-17,  8,  8,  7,  4,  1, -4,-10,-16,
-    7,  7,  7,  4,  1, -3, -9,-14,  6,  7,  6,  3,  0, -3, -9,-13,
-    5,  1, -4, -4, -3, -1,  0,  0,  7,  2, -3, -3, -2, -1,  1,  0,
-    7,  1, -3, -3, -1,  0,  1,  1,  6,  1, -3, -2, -1,  1,  1,  0,
-    6,  0, -4, -2, -1,  0,  1,  0,  5,  0, -4, -3, -1,  0,  0, -1,
-    5,  0, -3, -1,  0,  0,  0, -2,  4,  1, -2, -1,  0,  1,  0, -1,
-    2,  2,  1,  1, -2, -6, -8, -8,  1,  1,  1,  1, -2, -5, -8, -8,
-    1,  1,  1,  0, -1, -3, -5, -5,  0,  0,  0,  0, -1, -1, -1, -2,
-    0, -1,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  1,  2,  3,  2,
-    2,  1,  1,  1,  2,  3,  4,  3,  3,  3,  3,  3,  4,  4,  5,  4,
-   -4, -4, -3, -2,  0,  0,  1,  1, -4, -4, -3, -2, -1,  0,  0,  1,
-   -2, -2, -2, -1, -1, -1,  0,  0,  0,  1,  0,  0,  0,  0,  0, -1,
-    2,  2,  2,  2,  2,  2,  1,  1,  3,  4,  4,  4,  4,  4,  4,  3,
-    1,  1,  1,  3,  3,  4,  3,  3, -5, -6, -5, -4, -3, -3, -2, -2,
-   -4, -2, -1, -1, -1, -1,  0,  1, -4, -2, -1, -1, -1, -1,  0,  1,
-   -3, -2, -1, -1, -1,  0,  1,  2, -4, -3, -2, -1, -1,  1,  3,  3,
-   -4, -3, -3, -1, -1,  1,  4,  5, -4, -3, -2, -2, -1,  1,  4,  7,
-   -2, -2, -1, -1,  0,  2,  6,  8, -1,  0,  0,  1,  1,  4,  7,  8,
-   -3, -3, -3, -2, -2, -1, -1,  0, -1, -1,  0,  1,  2,  2,  3,  3,
-    0,  1,  2,  4,  5,  6,  6,  5, -1,  0,  2,  3,  5,  6,  5,  3,
-   -1, -1,  0,  2,  3,  3,  2,  1, -2, -2, -1,  0, -1, -3, -4, -4,
-    0,  0, -1, -1, -2, -4, -8, -7,  1,  2,  1,  0, -1, -4, -6, -7,
-   -2,  4,  1, -6,  0,  3,  0,  0, -2,  5,  1, -7,  0,  3,  0,  0,
-   -3,  5,  1, -8,  0,  3, -1, -1, -2,  6,  1, -9,  0,  3,  0, -1,
-   -2,  6,  2, -8,  0,  4,  0, -1, -3,  5,  1, -7,  1,  4,  0,  0,
-   -2,  4,  1, -7,  0,  4,  1,  0, -1,  4,  1, -6,  0,  3,  1,  0,
-    0,  0,  0,  3,  4,  5,  4,  1,  1,  1,  1,  2,  3,  3,  2,  0,
-    2,  2,  1,  2,  2,  1, -1, -2,  4,  3,  1,  1,  0, -1, -3, -5,
-    5,  3,  1, -1, -2, -3, -4, -6,  5,  3,  0, -2, -3, -5, -6, -7,
-    4,  3,  0, -2, -3, -4, -5, -5,  4,  3,  0, -1, -2, -2, -3, -3,
-    0,  0,  0,  0, -1, -5, -2,  6,  0,  0,  0,  1, -1, -6, -2,  8,
-    0,  0,  0,  2,  0, -6, -3,  9,  0, -1,  0,  2,  0, -7, -2, 10,
-    0, -1,  0,  2, -1, -8, -3, 10,  0, -1, -1,  2, -1, -7, -3,  9,
-    0, -1,  0,  1, -1, -6, -3,  8,  0,  0,  0,  1,  0, -5, -2,  7,
-    2,  3,  3,  2,  1,  0, -1, -1,  3,  4,  3,  2,  1,  0, -1, -2,
-    3,  4,  4,  2,  1, -1, -2, -3,  2,  3,  3,  2,  0, -1, -2, -3,
-   -1,  0,  1,  1,  0, -1, -2, -2, -5, -4, -3, -1,  0,  1,  1,  1,
-   -8, -8, -5, -1,  1,  3,  4,  3,-10, -9, -5,  0,  3,  5,  6,  5,
-   -5, -1,  4,  5,  3,  1,  0,  0, -6, -1,  4,  5,  2,  0, -1, -2,
-   -6, -1,  5,  4,  2, -1, -2, -2, -7, -1,  4,  4,  1, -2, -3, -3,
-   -6, -1,  5,  4,  1, -2, -3, -3, -5,  0,  4,  4,  1, -1, -2, -2,
-   -4,  0,  5,  4,  1, -1, -1, -2, -3,  1,  4,  3,  1, -1, -1, -2,
-   -2, -3, -2,  1,  4,  6,  5,  3, -3, -4, -4,  0,  3,  5,  4,  2,
-   -3, -5, -5, -1,  2,  4,  3,  1, -4, -6, -4, -1,  2,  4,  2, -1,
-   -2, -4, -3,  1,  2,  4,  2, -1, -2, -4, -2,  1,  3,  3,  1, -2,
-   -2, -3, -2,  1,  3,  3,  1, -2, -2, -2, -1,  1,  3,  3,  0, -2,
-   -4, -4, -3, -2, -1,  2,  5,  7, -4, -4, -3, -3, -2,  1,  5,  7,
-   -2, -3, -2, -3, -3, -1,  3,  5, -1, -1,  0, -2, -3, -2,  2,  4,
-    1,  1,  1, -1, -4, -3,  1,  3,  4,  3,  2, -1, -4, -3, -1,  1,
-    6,  4,  3,  0, -3, -3, -2,  0,  6,  5,  3,  1, -2, -3, -2, -1,
-   12, 11,  8,  4,  0, -2, -2, -1, 10,  9,  6,  2, -1, -2, -1,  0,
-    4,  3,  2,  0, -1, -1,  0,  1, -1, -1, -1, -1, -2,  0,  1,  2,
-   -3, -5, -4, -2, -2,  0,  2,  3, -5, -5, -4, -2, -1,  0,  1,  2,
-   -5, -5, -4, -2, -1,  0,  1,  1, -4, -4, -3, -2, -2, -1,  0,  0,
-    3,  3,  2, -1, -3, -4, -3, -2,  3,  2,  0, -2, -4, -4, -3, -2,
-    2,  2,  1, -1, -3, -5, -4, -3,  3,  3,  3,  1, -2, -3, -3, -3,
-    4,  4,  4,  3,  0, -2, -2, -2,  5,  5,  5,  3,  0, -1, -2, -2,
-    5,  5,  4,  2, -1, -2, -3, -2,  3,  3,  3,  0, -2, -4, -4, -4,
-   -1, -1,  4, -2, -2,  6,  2, -5, -1,  0,  4, -2, -3,  6,  2, -6,
-   -1,  0,  4, -2, -3,  7,  3, -7, -1, -1,  4, -3, -4,  8,  3, -7,
-    0, -1,  4, -3, -4,  7,  3, -6, -1, -1,  4, -3, -4,  7,  3, -6,
-   -1, -1,  3, -3, -4,  6,  3, -6, -1,  0,  3, -2, -3,  6,  3, -5,
-    1, -2, -7,  2,  5, -2, -1,  1,  1, -2, -8,  3,  6, -3, -1,  2,
-    2, -2, -9,  4,  7, -4, -2,  2,  3, -1, -9,  5,  7, -4, -1,  3,
-    3, -1, -9,  4,  7, -4, -2,  2,  3, -1, -7,  4,  6, -4, -2,  1,
-    2,  0, -6,  4,  6, -4, -1,  1,  2,  0, -5,  3,  4, -3, -1,  1,
-   -2,  2,  2,  0,  0, -1, -3, -4, -2,  2,  2,  1,  1,  0, -2, -4,
-   -2,  2,  2,  2,  2,  1, -1, -2, -3,  2,  3,  3,  4,  2,  0, -2,
-   -3,  2,  3,  2,  4,  2,  0, -3, -4,  1,  2,  1,  2,  1, -1, -3,
-   -5,  0,  1,  0,  1,  1, -2, -3, -4,  0,  0,  0,  1,  0, -2, -3,
-    0,  0, -1, -2, -2,  2,  7,  8,  0,  0, -1, -3, -2,  1,  6,  7,
-    0,  1, -1, -3, -3,  0,  4,  5,  0,  1,  0, -1, -1,  0,  1,  3,
-    0,  2,  1,  1,  0, -1,  0,  1, -2,  0,  1,  2,  1,  0, -1, -1,
-   -5, -2,  0,  1,  1,  0, -3, -3, -6, -4, -1,  1,  1, -1, -3, -4,
-   -4, -2,  2,  5,  6,  4,  3,  2, -5, -3,  1,  4,  4,  2,  0,  0,
-   -4, -2,  0,  2,  1, -1, -2, -2, -2, -1,  0,  1,  0, -2, -3, -2,
-   -2,  0,  0,  0, -1, -1, -2, -1, -2, -1, -1,  0,  0,  0,  1,  2,
-   -2, -2, -1, -1,  0,  1,  3,  4, -2, -3, -2, -1,  0,  2,  4,  5,
-    2,  1, -2, -2, -1,  0,  1,  0,  1,  0, -3, -3, -1,  0,  1,  0,
-    0, -1, -3, -3, -1,  1,  1,  1,  0,  0, -3, -1,  1,  2,  3,  3,
-    0, -1, -3, -1,  1,  3,  3,  3, -2, -2, -4, -2,  1,  3,  4,  4,
-   -3, -3, -4, -2,  1,  3,  3,  4, -2, -3, -5, -2,  1,  2,  3,  3,
-    4,  5,  3,  4,  4,  4,  4,  5,  3,  3,  1,  0,  0,  0,  0,  1,
-    1,  1, -1, -2, -3, -4, -3, -2,  2,  2,  0, -2, -2, -4, -3, -2,
-    2,  3,  1, -1, -1, -3, -3, -2,  1,  2,  0,  0, -1, -2, -2, -1,
-    0,  1,  0, -1, -1, -3, -2, -1,  1,  1,  0, -1, -1, -2, -2, -2,
-   -2, -1, -1,  0,  1,  2,  1,  0,  1,  2,  3,  5,  6,  5,  5,  3,
-    1,  2,  3,  4,  5,  5,  4,  3, -2, -2, -3, -3, -2, -1,  0,  0,
-   -3, -3, -4, -5, -4, -3, -2, -1, -1, -1, -2, -2, -2, -1,  0,  0,
-    0,  1,  0, -1, -1,  0,  0,  1, -1,  0, -1, -2, -3, -2, -2, -1,
-    7,  7,  6,  5,  4,  2, -1, -2,  3,  3,  2,  2,  1,  0, -2, -3,
-    0, -1, -1, -1,  0, -1, -2, -2, -1, -3, -2, -1,  0,  0,  0,  1,
-    0, -2, -2, -1, -1,  1,  2,  2,  3,  1, -1, -1, -1,  1,  2,  2,
-    3,  1, -2, -3, -2, -1,  1,  2,  1, -2, -5, -6, -5, -3, -2,  0,
-    0, -1, -2, -3, -1,  0, -2, -2,  0,  0, -1, -1,  0,  1, -1, -2,
-    0,  0, -2, -1,  0,  0,  0, -2, -1, -2, -3, -3, -2, -1, -3, -3,
-   -1, -2, -3, -3, -2, -2, -3, -4,  2,  2,  0,  0,  0,  0, -1, -2,
-    5,  5,  3,  2,  2,  2,  0, -1,  8,  8,  6,  5,  4,  4,  2,  1,
-   -7, -8, -6, -3, -1, -1, -2, -1, -5, -5, -3,  0,  2,  1,  0,  0,
-   -1, -1,  0,  3,  4,  3,  1,  1,  2,  1,  1,  3,  4,  3,  2,  2,
-    3,  2,  0,  2,  3,  2,  1,  2,  4,  2, -1, -1,  0,  1,  1,  1,
-    3,  2, -2, -3, -2, -1,  0,  1,  3,  1, -3, -4, -3, -2,  0,  1,
-   -4, -2, -1,  2,  3,  3,  1,  0, -7, -5, -4, -2,  0,  0, -1, -2,
-   -6, -5, -5, -4, -2, -2, -2, -3, -1,  0, -1, -1,  0,  0,  0, -1,
-    2,  3,  2,  2,  2,  2,  1,  0,  3,  5,  4,  3,  1,  0,  1,  0,
-    3,  4,  3,  2,  0, -1, -1, -1,  5,  5,  3,  1,  0, -1, -1, -1,
-    1,  1,  0, -1, -3, -5, -6, -4,  1,  1,  0,  0,  0, -3, -3, -1,
-    0, -1, -1,  0,  1,  0,  1,  3, -2, -2, -3, -1,  2,  2,  4,  7,
-   -2, -2, -2,  0,  2,  2,  3,  6, -1,  0,  0,  1,  1,  0,  0,  3,
-    0,  3,  3,  3,  1, -2, -3, -1,  1,  3,  4,  3,  0, -3, -5, -4,
-    0,  2,  0, -1, -3, -4, -2, -2,  1,  4,  2,  0, -2, -3, -2, -1,
-    3,  6,  3,  1, -2, -2,  0, -1,  4,  7,  4,  1, -2, -3, -1,  0,
-    3,  6,  3,  0, -3, -3, -1,  0,  1,  3,  0, -1, -3, -2,  1,  1,
-    0,  1, -1, -2, -3, -1,  2,  2, -2, -1, -3, -3, -3, -1,  1,  2,
-    3,  1, -1,  0,  1,  0,  0,  0,  2, -1, -2, -1,  1,  0, -1, -1,
-    1, -1, -2,  0,  1,  0, -2, -3,  0, -2, -1,  1,  3,  1, -3, -5,
-    0, -2, -1,  2,  5,  2, -3, -5,  0, -2, -1,  4,  6,  3, -2, -5,
-    0, -2,  0,  4,  7,  4, -2, -4,  0, -2,  0,  4,  6,  4, -2, -4,
-   -2, -2, -3, -4, -3, -2, -1,  0,  1,  1,  0, -1, -1, -1,  0,  1,
-    3,  3,  2,  2,  1,  1,  1,  1,  2,  2,  2,  2,  1,  0,  0,  1,
-    0,  0,  0,  0, -1, -1, -1, -1, -4, -4, -4, -4, -4, -4, -4, -3,
-   -3, -3, -2, -3, -2, -1, -1,  0,  3,  4,  4,  5,  5,  6,  6,  7,
-   -1, -2,  7, -2, -4, -1, -1,  0, -1, -2,  9, -1, -4, -1, -1,  0,
-   -1, -3, 10, -1, -4, -1, -1,  1, -1, -3, 10, -2, -3, -1, -1,  2,
-   -1, -2, 10, -2, -4, -1, -1,  2, -1, -2,  9, -2, -4, -1, -1,  2,
-   -1, -2,  8, -2, -4,  0, -1,  1,  0, -2,  7, -2, -3, -1,  0,  2,
-    3, -4,  1,  3, -3, -2,  1,  0,  3, -5,  1,  4, -3, -2,  1,  0,
-    3, -6,  2,  5, -3, -1,  3,  0,  3, -6,  2,  5, -3, -1,  2,  0,
-    3, -6,  1,  5, -4, -2,  3,  0,  3, -6,  1,  5, -3, -2,  2,  0,
-    2, -6,  1,  4, -3, -1,  1,  0,  2, -6,  1,  4, -2, -1,  1,  0,
-    0,  0,  1,  1,  1,  0,  0,  2,  0, -1,  1,  1,  1,  0,  0,  2,
-    0, -1,  0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  0, -1,  0,
-    1,  0,  1,  0,  0, -1, -2, -1,  3,  1,  1,  0,  0, -2, -4, -3,
-    5,  3,  2,  1,  0, -3, -5, -4,  5,  4,  2,  0, -1, -4, -5, -5,
-    1,  0, -1, -2, -2, -3, -6, -9,  2,  0, -1, -1,  0,  0, -3, -6,
-    1,  0,  0, -1,  0,  0, -2, -5,  2,  1,  1,  1,  1,  2, -1, -3,
-    1,  1,  2,  1,  2,  2,  1, -1,  1,  1,  2,  1,  1,  1,  1,  1,
-    0,  0,  2,  1,  0,  0,  2,  2,  0,  1,  2,  2,  0,  0,  2,  2,
-   -4, -3,  0,  1,  4,  6,  4,  3, -3, -2,  0,  0,  2,  4,  1,  0,
-   -1, -1,  0,  0,  1,  1, -2, -3,  1,  1,  1,  0,  1,  1, -3, -5,
-    1,  1,  1,  0,  1,  1, -3, -5, -1,  0,  0, -1,  1,  1, -2, -4,
-   -1,  0,  0, -1,  1,  2,  0, -2, -1,  0,  0,  0,  2,  3,  1,  0,
-   -1,  0,  3,  4,  0, -4, -5, -5,  0,  0,  4,  5,  2, -2, -3, -2,
-    0, -1,  2,  4,  2, -1, -1,  0,  0, -2, -1,  1,  0, -2,  0,  1,
-    1, -2, -2,  0,  0, -1, -1,  1,  1, -2, -3,  0,  1,  0, -1,  0,
-    1, -2, -2,  1,  3,  1,  0,  0,  1, -2, -1,  2,  4,  2,  0,  0,
-    1,  2,  3,  2,  0,  2,  2,  1, -1,  0,  1,  0, -3,  1,  1,  1,
-   -1,  0,  0, -2, -4,  0,  2,  1, -1,  2,  2, -1, -5,  0,  2,  1,
-   -1,  3,  4, -1, -5,  0,  2,  1, -2,  2,  4,  0, -4, -1,  0,  0,
-   -4,  0,  2,  0, -4, -2,  0,  0, -5, -1,  2,  1, -2,  1,  3,  2,
-    1,  0,  1,  0,  1,  2, -1, -2,  2,  0, -1, -2,  1,  3,  0, -1,
-    3,  0, -2, -4,  0,  3,  1,  0,  5,  1, -3, -5, -2,  2,  1,  1,
-    6,  1, -2, -5, -2,  1,  0,  1,  5,  1, -1, -5, -2,  0, -1,  0,
-    3,  0, -2, -4, -2,  0, -1,  0,  1, -1,  0, -2,  0,  1,  0,  1,
-    1,  1,  2,  3,  2,  1,  1,  2, -1, -1,  0,  1,  1,  0,  1,  1,
-   -4, -3,  0,  0,  1,  1,  1,  2, -4, -3,  0,  2,  2,  2,  3,  2,
-   -5, -4,  0,  1,  1,  1,  1,  2, -5, -4, -1, -1, -2, -2, -1,  0,
-   -3, -2,  0,  0, -2, -3, -2, -1,  2,  3,  4,  4,  2,  0,  0,  0,
-   -4, -2,  0,  1,  0,  0,  0,  0, -3, -1,  1,  1,  0,  0,  0,  0,
-   -2,  0,  2,  2,  0,  0,  0,  2, -1,  1,  2,  1, -1,  0,  3,  5,
-    0,  2,  1, -1, -2,  0,  5,  6,  0,  1,  0, -3, -3,  0,  4,  6,
-    1,  1, -2, -4, -4, -3,  1,  2,  1,  0, -2, -4, -5, -4, -2,  0,
-   -1, -3, -3, -3, -3, -2, -1, -1,  3,  2,  1,  0,  0,  1,  1,  1,
-    5,  4,  3,  2,  1,  1,  2,  2,  2,  1,  0, -2, -2, -2, -1, -1,
-    0,  0,  0, -1, -2, -2, -2, -2,  0,  1,  3,  3,  2,  1, -1, -1,
-    0,  1,  3,  4,  3,  2,  1, -1, -4, -3, -1,  1,  0, -2, -3, -3,
-   -3, -4, -7, -8, -7, -4, -1,  2,  0, -1, -3, -4, -4, -2,  0,  2,
-    1,  0,  0, -1, -3, -2,  0,  2,  2,  1,  1,  0, -1, -1,  0,  2,
-    1,  1,  1,  1,  0,  0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    0,  0,  1,  2,  3,  3,  2,  2,  0,  0,  1,  3,  4,  4,  3,  2,
-    3,  3,  3,  0, -1,  0,  1,  2,  1,  1,  1, -1, -2, -1, -1,  1,
-   -2, -2, -1, -3, -3, -2, -2,  0, -4, -4, -2, -2, -2, -2, -3,  0,
-   -4, -4, -1,  1,  1,  0, -1,  2, -3, -1,  2,  3,  4,  3,  3,  5,
-   -2,  0,  2,  3,  3,  3,  3,  3, -2, -2,  0,  0,  0,  0,  0,  1,
-    0,  2,  1, -1, -3, -1,  3, -2, -1,  0, -1, -1, -3,  0,  4, -2,
-   -2, -2, -2, -2, -2,  1,  5, -2, -3, -2, -3, -1, -2,  1,  4, -3,
-   -2,  0, -1,  0, -1,  0,  3, -5,  1,  2,  1,  2,  0,  0,  2, -5,
-    2,  4,  2,  3,  1,  1,  3, -3,  1,  2,  1,  1,  0,  1,  4, -2,
-    4, -3, -4, -1,  3,  3,  1,  3,  4, -4, -4, -1,  3,  2,  0,  2,
-    4, -3, -4,  0,  2,  2, -1,  1,  4, -3, -2,  1,  2,  1, -2,  0,
-    2, -4, -2,  1,  2,  0, -3,  0,  2, -3, -2,  0,  1,  0, -2,  2,
-    3, -1, -1,  0,  0,  0,  0,  3,  2, -2, -2, -2, -1, -1, -1,  2,
-    2,  2,  3,  4,  3,  1,  0, -1,  1,  0,  1,  2,  1, -1, -2, -2,
-    2,  1,  2,  1,  1,  0, -1, -1,  4,  3,  4,  3,  2,  1,  1,  1,
-    3,  2,  2,  2,  1,  1,  1,  1, -1, -2, -1,  0, -1, -1, -1, -1,
-   -3, -3, -2, -1, -2, -2, -2, -2, -4, -4, -3, -3, -4, -4, -3, -3,
-    2,  1, -1, -3, -4, -2,  3,  4,  2,  2,  1, -1, -3, -2,  1,  2,
-    1,  2,  3,  3,  0, -2, -1, -2, -1,  0,  2,  4,  2,  0, -1, -3,
-   -2, -2,  0,  3,  3,  2,  0, -3,  0, -2, -3, -1,  1,  2,  2, -1,
-    3, -1, -4, -5, -3,  0,  2,  0,  6,  3, -2, -6, -5,  0,  3,  1,
-   -2,  3, -2,  0,  3, -2, -2,  1, -3,  4, -3,  0,  3, -2, -1,  2,
-   -3,  5, -3,  0,  4, -2, -1,  2, -2,  4, -4, -1,  3, -3, -2,  2,
-   -3,  4, -3,  0,  3, -3, -1,  2, -2,  5, -2,  0,  3, -3, -1,  2,
-   -2,  4, -3,  1,  3, -2, -1,  2, -2,  3, -2,  1,  3, -2,  0,  2,
-    1,  0,  0, -1,  1,  2, -4, -1,  2,  0,  0, -1,  1,  2, -4, -2,
-    1,  1,  1, -1,  2,  4, -2,  0,  0, -1,  1, -1,  2,  5, -1,  1,
-    0, -1,  0, -2,  1,  5, -1,  1,  0, -1, -1, -2,  0,  3, -3, -1,
-    1,  1,  0, -2,  0,  3, -3, -1,  1,  1,  0, -3,  0,  3, -2,  0,
-    1,  0, -1,  1,  1,  2,  4,  5,  1,  0, -1,  1,  1,  1,  5,  7,
-    0,  0, -2, -1, -1,  0,  3,  5,  0, -1, -2, -1, -1, -1,  2,  3,
-    0, -1, -3, -1, -1, -1,  1,  2, -1, -2, -4, -2, -2, -2,  0,  0,
-   -1, -2, -2, -1, -2, -2,  0,  0,  0, -1, -1,  0, -1, -1,  0,  0,
-    3,  3,  0, -1, -1,  1,  4,  4,  2,  3,  0, -2, -2,  0,  1,  1,
-    2,  3,  1, -1, -1,  0,  1,  0,  1,  2,  0, -1, -1, -1,  0, -2,
-    0,  1,  0, -1, -2, -1,  0, -2,  0,  1,  0, -1, -2, -1,  1,  0,
-    1,  1, -1, -3, -4, -3,  1,  3,  1,  2, -1, -3, -5, -4,  1,  3,
-   -3, -2,  0,  1,  1,  1,  0, -2,  0,  1,  1,  1,  0,  0, -1, -3,
-    1,  2,  1,  1,  0, -1, -1, -2,  0, -1, -3, -1, -1, -1,  0, -1,
-    0, -3, -6, -3, -2, -1,  1,  1,  2, -1, -4, -3, -2,  0,  2,  2,
-    5,  4,  1,  1,  0,  1,  3,  2,  5,  4,  2,  1,  0, -1,  0,  1,
-   -2,  0, -2, -5, -6, -3,  0,  0, -2,  0,  1,  0, -1,  1,  2,  2,
-   -2,  0,  1,  3,  2,  2,  2,  1, -2,  0,  2,  4,  3,  2,  1,  1,
-   -2,  0,  2,  3,  2,  0, -1,  0, -3, -1,  1,  1,  0, -1, -1,  1,
-   -4, -1,  1,  0, -1, -2,  0,  2, -4, -1,  0, -1, -1, -2,  1,  4,
-   -3,  0,  0, -1,  1,  1,  1,  0, -3,  1,  0, -1,  0,  0, -1, -1,
-   -1,  3,  3,  0,  1,  0,  0,  1, -3,  2,  2, -2, -1,  0,  0,  1,
-   -5,  0,  0, -2, -1,  1,  0,  2, -7, -2,  1,  0,  1,  2,  2,  2,
-   -5,  0,  3,  2,  3,  3,  2,  2, -3,  2,  4,  1,  0,  0, -2, -3,
-    5,  2, -2, -2,  0, -1, -1, -1,  2, -1, -4, -3, -1, -2, -1, -1,
-    0, -2, -2,  1,  2, -1,  0,  1, -1, -2, -1,  3,  3, -1,  0,  2,
-    1,  0,  0,  3,  3, -2, -1,  2,  2,  1,  1,  3,  2, -2, -2,  0,
-    1,  0, -1,  1,  1, -3, -3, -2,  1,  0,  1,  2,  3,  0,  0,  0,
-   -4, -5, -3,  0,  1, -1, -2, -1, -2, -3, -1,  1,  2,  0,  0,  0,
-    1,  1,  2,  1,  2,  1,  1,  1,  3,  4,  3,  1,  0, -2, -1, -1,
-    3,  3,  2,  0, -2, -3, -3, -2,  1,  1,  0, -1, -2, -4, -2, -2,
-    2,  1,  0,  0,  0, -1,  0,  1,  2,  1,  1,  1,  1,  1,  1,  3,
-    0,  0,  0, -1, -2, -1,  1,  0, -2, -1, -1, -2, -3, -2,  0,  0,
-   -1,  0,  0, -1, -2,  0,  1,  1,  1,  1,  0, -1, -1,  1,  3,  1,
-    2,  2,  0, -2, -1,  2,  3,  0,  3,  1, -1, -1,  1,  4,  2, -2,
-    2,  0, -3, -1,  3,  5,  0, -5,  1, -1, -2,  0,  3,  3, -1, -6,
-   -1,  0,  3,  4,  2,  0,  1,  2, -2, -1,  0,  1, -1, -2,  0,  1,
-   -2, -3, -2, -3, -6, -7, -6, -3,  2,  2,  3,  1, -1, -2, -3, -2,
-    2,  2,  3,  1,  0,  0,  0,  0,  2,  1,  1,  0,  1,  1,  0,  1,
-    1,  0,  0,  0,  0,  1,  1,  2,  1,  0, -1,  0,  0,  2,  2,  1,
-    1,  1,  3,  1, -1, -1, -1,  1, -2, -1,  0,  0, -2, -2, -1,  2,
-   -2, -2,  1,  1,  1,  0,  1,  3, -2, -2,  0, -1,  0, -1,  0,  2,
-    0,  0,  1,  0, -1, -1, -2,  1,  3,  2,  2,  1,  0, -2, -2,  1,
-    5,  3,  3,  2,  1,  1,  1,  4,  0, -3, -4, -5, -4, -3, -1,  1,
-   -6, -4, -1,  2,  2,  0,  0, -1, -4, -2,  1,  3,  3,  2,  2,  0,
-   -3, -2, -1,  2,  3,  3,  2,  0, -3, -2, -2,  1,  2,  1,  1, -1,
-   -2, -2, -2,  0,  2,  2,  1, -1, -1, -1, -1,  1,  2,  3,  2,  0,
-   -1, -1, -2,  1,  2,  2,  2, -1,  0, -1, -2,  0,  2,  1,  0, -1,
-    6,  4,  2,  1,  0,  0,  0,  1,  4,  2, -1, -2, -2, -2, -1, -1,
-    2,  1, -1, -2, -2, -2, -2, -1,  2,  2,  0, -2, -2, -2, -1,  0,
-    0,  0, -1, -2, -2, -1,  0,  1, -3, -3, -2, -1, -1, -2, -1,  0,
-   -3, -2,  2,  3,  2,  0, -1, -2, -2,  0,  4,  5,  5,  2,  0, -1,
-    5,  4,  2,  0, -1, -2, -1, -1,  4,  3,  2,  1,  0, -1,  0, -1,
-    1,  1,  0,  1,  1,  0,  1, -1, -2, -1, -1,  0,  0, -2, -2, -3,
-   -1,  0,  0,  0, -1, -3, -3, -5,  0,  1,  1, -1, -1, -2, -2, -3,
-   -1, -1, -1, -2, -1,  1,  3,  1, -1, -2, -2, -1,  2,  5,  6,  5,
-   -3, -3, -2,  1,  1, -2, -1, -1,  1,  2,  3,  4,  1, -3, -1, -3,
-    3,  2,  0,  1, -1, -3, -1, -3,  1,  0, -1,  0, -1, -1,  1,  0,
-    1,  1,  0,  1,  2,  2,  5,  3,  1,  1,  1,  2,  2,  2,  3,  0,
-   -3, -1, -2, -2, -3, -3, -1, -3, -1,  1,  1,  0, -1, -1,  0, -2,
-    2,  0, -2, -2,  2,  4,  1, -2,  1,  0, -2, -1,  3,  5,  2, -1,
-   -1, -2, -3, -2,  1,  3,  1, -2, -1, -2, -1, -1,  0,  2,  1, -1,
-    0,  0,  1,  1,  1,  2,  2,  0,  0,  1,  4,  4,  2,  2,  3,  1,
-   -2, -1,  2,  1, -2, -3, -2, -3, -1,  0,  1,  0, -3, -4, -4, -5,
-    4,  0, -3, -4, -4, -4, -2, -1,  5,  0, -1,  0, -1, -3, -2, -1,
-    4,  0,  0,  1,  1,  0,  0,  0,  0, -3, -2, -1,  0,  0,  1,  0,
-    0, -2,  0,  0,  1,  1,  2,  1,  2,  0,  0,  0,  1,  1,  1,  0,
-    2,  0, -1, -1,  1,  1,  1,  0,  1, -1, -2, -2,  0,  2,  2,  2,
-   -3, -5, -2,  0, -1, -3, -3,  0,  0, -2,  0,  2,  2,  0,  0,  3,
-    2, -1, -2,  0,  0, -1, -1,  2,  5,  2, -1, -1, -1, -1, -1,  2,
-    5,  2,  0, -1, -1,  0, -1,  2,  2,  1,  0,  0,  0,  1,  0,  2,
-   -1, -1,  1,  1,  2,  2,  1,  2, -3, -2,  0,  0,  0,  0, -2, -1,
-    0,  3,  2,  0, -2, -3, -3, -3,  0,  3,  3,  1,  0,  0,  1,  2,
-   -1,  0, -1, -2, -1, -1,  1,  3, -1,  0, -1, -2, -1, -1,  0,  2,
-   -1,  0, -1, -2,  0,  0, -1,  2, -1,  0, -1, -2, -1, -1, -2,  1,
-    0,  1,  0, -3, -1, -1, -1,  2,  5,  5,  2, -1, -1, -1,  1,  3,
-    0,  0,  1, -1, -3, -2,  0,  2,  1,  1,  3,  0, -2, -2,  0,  1,
-    1,  1,  3,  1,  0,  0, -1, -1,  0, -1,  2,  1,  1,  0, -1, -3,
-   -1, -2,  1,  1,  1,  0, -2, -4, -1,  0,  2,  1,  1,  0, -1, -3,
-    1,  1,  3,  2,  1,  0, -2, -3,  2,  2,  4,  2,  1, -1, -2, -4,
-    1,  2,  2,  2,  0, -2,  0,  2, -1, -1, -2, -3, -4, -5, -3,  1,
-    0,  1,  1,  0, -1, -1, -1,  1,  0,  1,  1,  1,  0,  0,  0,  2,
-    0,  1,  1,  2,  1,  1,  1,  2, -1, -1,  0,  2,  2,  2,  2,  3,
-   -2, -4, -4, -1, -2, -2, -2,  0,  1,  0,  0,  1,  0,  0,  0,  1,
-    0, -1, -3, -2,  0,  2,  2,  1,  0, -1, -2, -3,  0,  1,  1,  2,
-    1,  0, -2, -3, -1,  0,  0,  1, -1,  0, -1, -2,  0,  0, -1,  0,
-   -1,  1,  1,  0,  2,  2,  0,  0,  0,  2,  3,  1,  3,  5,  3,  2,
-   -1,  1,  1, -2,  0,  3,  1,  1, -1,  0,  0, -4, -4, -1, -1, -1,
-   -1,  1,  1,  0,  1,  2,  1,  2, -3,  0,  1,  0,  1,  1,  0,  2,
-   -5, -3, -1, -1,  0,  1,  0,  1, -4, -3, -2, -3, -2, -1, -1,  0,
-    0,  0, -1, -2, -2, -2, -2,  0,  3,  4,  2,  0,  0,  0,  0,  1,
-    2,  1,  0,  0,  0,  0, -1,  0,  0,  1,  2,  3,  4,  4,  3,  2,
-   -1,  4,  7,  4,  0,  0,  0,  0, -1,  4,  6,  3,  0,  1,  1,  1,
-    0,  3,  4,  0, -1,  0,  0,  1,  0,  1,  1, -2, -1,  0, -1, -1,
-   -1,  0, -1, -1, -1,  0,  0,  0, -1, -1, -1,  0,  0,  0,  0,  0,
-   -1, -3, -3,  0,  1, -1, -2, -1, -3, -4, -4, -2, -1, -2, -2, -1,
-    2,  2,  1,  0,  1,  1,  0, -3, -2, -1,  0,  0,  1,  1,  0, -3,
-   -2, -1,  0,  1,  2,  1,  1, -2,  1,  2,  2,  2,  3,  3,  2, -1,
-    1,  2,  1,  0,  1,  1,  2, -1,  0,  1, -2, -4, -2,  0,  1, -1,
-    1,  1, -1, -3, -2,  0, -1, -3,  1,  2,  0, -1,  0,  1, -1, -4,
-   -1, -1, -2, -2,  0,  3,  4,  3,  1,  1, -1, -3, -2,  0,  0,  0,
-    2,  2,  2,  2,  2,  1, -1, -1,  1,  1,  1,  3,  3,  0, -2, -2,
-    0, -1, -1, -1,  0, -2, -1, -1, -1, -3, -4, -3, -2, -2,  0,  2,
-   -1, -1,  0,  1,  2,  2,  3,  5, -2, -1, -1,  0,  0,  0,  0,  1,
-   -2, -3,  2,  0,  0,  1,  1, -1, -1, -4,  1, -2, -1,  2,  2,  0,
-    1, -4,  0, -2, -2,  1,  1, -1,  2, -3,  1, -1, -1,  1,  1, -1,
-    3, -2,  3,  1,  0,  1,  1, -1,  1, -3,  2,  1,  0,  1,  0, -1,
-   -1, -5,  1,  0, -1,  0,  1,  1,  0, -3,  3,  3,  1,  2,  3,  3,
-    0, -1, -2,  1,  5,  5,  2, -1,  1, -1, -2, -1,  1,  1, -2, -5,
-    1,  1, -1, -2, -1, -1, -1, -3,  1,  1, -1, -1, -1,  2,  4,  3,
-   -1, -1, -1, -1, -1,  0,  4,  3, -1, -1,  0,  1, -1, -3, -1, -1,
-    0,  0,  0,  2,  2,  0,  0, -1,  0, -2, -3,  0,  1,  1,  3,  2,
-    2,  3,  2,  1,  0,  0, -2, -2,  2,  3,  0,  1,  1,  3,  3,  2,
-    0,  0, -3, -1, -1,  2,  2,  3, -2, -2, -3,  1,  1,  2,  1,  1,
-   -2, -1, -2,  2,  1,  1, -1, -2,  0,  1,  0,  2,  0,  0, -2, -2,
-    0,  1,  0,  2,  0,  0, -2, -2, -3, -2, -2,  0, -1, -2, -2, -3,
-    0,  1, -1,  3, -1,  1,  3, -1,  0,  1, -1,  3, -1, -1,  2, -3,
-    1,  1, -2,  3, -1, -3,  0, -3,  2,  2, -2,  3,  0, -2,  1, -2,
-    1,  1, -3,  3, -1, -2,  1, -3,  1,  1, -3,  3,  0, -1,  1, -2,
-    1,  2, -1,  4,  0, -1,  1, -2,  0,  1, -1,  3, -1, -3,  0, -3,
-   -3, -3, -1,  1,  2,  1, -1, -2, -2, -2,  0,  2,  1,  0, -2, -2,
-   -3, -2,  1,  2,  1, -1, -2, -1, -3, -2,  2,  4,  0, -2, -2,  1,
-   -3, -1,  2,  4,  0, -2, -2,  2, -1,  1,  4,  3, -1, -3, -2,  2,
-    0,  2,  4,  2, -1, -2, -1,  2,  0,  1,  2,  0, -1,  0,  1,  3,
-    3,  0, -5,  1,  4,  0,  0,  1,  1, -2, -5,  2,  5, -1, -2,  1,
-   -1,  0,  0,  3,  3,  1,  0, -1, -2,  3,  4, -2, -3, -1,  0, -2,
-   -3,  3,  5, -3, -3,  0,  0, -2, -1,  3,  2, -2, -2,  2,  2, -1,
-    2,  0,  0, -1,  0,  0,  0,  0,  0, -3, -2,  1,  3,  0, -2, -2
-};
-
-/* list of codebooks for inter-coded vectors */
-const int8_t* const ff_svq1_inter_codebooks[6] = {
-    svq1_inter_codebook_4x2, svq1_inter_codebook_4x4,
-    svq1_inter_codebook_8x4, svq1_inter_codebook_8x8,
-    NULL, NULL,
-};
-
-/* 6x16-entry codebook for intra-coded 4x2 vectors */
-DECLARE_ALIGNED(4, static const int8_t, svq1_intra_codebook_4x2)[768] = {
-   12, 13, 13, 11, -7,-10,-15,-17,-16,-15,-12,-10, 11, 15, 15, 12,
-    2, 17, 20, 15,-45,-24,  2, 13, 21, 20, -6,-36, 12, 16, -1,-27,
-  -18,-21, 10, 45,-11,-20, -7, 21, 43, -8,-28,  0, 33,-16,-28,  3,
-  -12,-18,-18, -6,-20,-10, 28, 55, -5,-18,-21,-18, 56, 30, -6,-20,
-  -34, 27, 29,-22,-30, 29, 26,-25, 30, 34, 33, 26,-25,-31,-35,-33,
-  -31,-35,-36,-32, 29, 36, 37, 31,-71,-12, 38, 34,-63, -1, 42, 33,
-   58, 37,-31,-60, 55, 34,-33,-61,-57,-57, 22, 93,-57,-58, 21, 93,
-   59, 69, 70, 62,-63,-68,-68,-60,-64,-71,-71,-64, 63, 73, 72, 62,
-   -2,  0,  7, 15,-11,-10, -3,  5, -5, -8,-10,-10,  1,  9, 14,  9,
-   15,  8, -4,-11, 12,  2,-11,-12, -8,  0, 19, 28,  4, -1,-15,-26,
-  -15, 27,  2,-14,-14, 22,  1, -9, -4, -6,-13,-10, -6,-14,  6, 47,
-  -35,-20,  6, 23,  6,  9,  6,  4, -6,  2, 23,-22, -7,  4, 28,-21,
-   20,-22, -2,  6, 22,-28, -5,  8,-10,-18,-16,-12, 36, 19,  2, -1,
-   -3,  0,  4,  8,-45,-10, 23, 23, 40, 15,-20,-35, -4, -1,  4,  1,
-    9, -5,-33, 24,  8,  3,-26, 19, -1,  4,  6, -3, 32, 25,-13,-49,
-   24, 24, 15,  7,-17,-27,-19, -7,-47,  0, 39, 24,-21, -6,  7,  4,
-   -1,  0,-10,-13,  1,  1,  5, 16, 20,  5, -3, -9, -1, -4, -2, -6,
-  -17, -7,  1,  4, 12,  7,  0,  0,  3,  0, 12, 11, -3,  1,  0,-23,
-    4, 17, -6,  0,  6,  3,-25,  0,-17, 10,  8,  5,-14,  4,  1,  4,
-   13, 10,  4,  2,-23, -9,  1,  2,  3, -3,  1,  7,  1,-23, -7, 20,
-   -7,-18,  2, 12, -5, -4, 10,  9,  4, 10,  7,-24,  6,  3,  4,-10,
-   22,-14,-22,  6,  0,  5,  5, -1, -4,  3,-11, -4, -7, 31,  7,-14,
-   -5,-16, -1, 42, -4, -2, -9, -5,  5, -8, -6, -3, 42, -4,-21, -5,
-  -18, 12, 20,-12, 13,-13,-10,  7, -8, -9, -2,-18,-16,  6, 40,  8,
-   10, -1,  0,  4, -3,  4, -1,-13, -2,  6,  1,-15,  5,  3,  1,  2,
-   -4, -2,  1,  3, 15,  0, -9, -4, -3, -4, -4, -4, -3,  5, 16, -3,
-    2, 13,  3,  4, -3, -8,-10,  0, -6, -2, -4, -1, -2, -3, -6, 23,
-    6, -6,  7,  1,  4,-18,  5,  1, -1,  1,-15, 14, -5,  6, -4,  4,
-    2,  2,  2,  6,-24,  2,  7,  3,-26,  0,  3,  3,  5,  7,  1,  6,
-   14, -2,-18, -3,  7,  5, -4,  2, -6,  3, 32,  1, -6, -6, -6,-12,
-    5,-36,  7,  6,  9, -1, 11,  0,  4,  4,  5,  3,  4, 15,  3,-38,
-   10, 23, -5,-42,  0,  4,  4,  4, 23, 17, -6,-13,-13,-37,  1, 29,
-    5,-14, -1,  1,  5,  0,  3,  1,  0,  4, -5,  2,  8,  0,  0,-10,
-    4,  7, -2, -3,-10,  3,  1,  1,-12, -1, 13,  3,  0, -1,  1, -3,
-    0, -1,  3,  1, -6, -9,  3,  9, -6,  1, -4, -6,  8, -1,  0,  8,
-   -3, -3,  0, 18, -5, -1, -4, -1, -8, -2,  3, -4,  0, 17, -1, -5,
-    5, -2,  9,-10,  1, -5,  6, -5,  4,  2,  2,  3, 10,-14, -8,  1,
-   -1, -2,-18, -1, -1, 20,  1,  2, -1,  1, -9,  1, -1, -9, 22, -4,
-    6, -4,  8, -3, -1,  7,-19,  5, -7, 31, -4, -4, -6,  0, -5, -5,
-   -7, -8,-19, -4,  1,  1,  4, 32, 38, -1, -8,  4, -7, -8, -6,-12,
-   -1,  0, -7,  1, -1,  9, -1,  0,  9, -1, -1,  0,  2, -6,  1, -3,
-  -12,  0,  2,  1,  1,  1,  8,  0,  9,  1,  0,  2, -2,  1,-11,  0,
-    0,  8,  2,-10, -1,  2, -1,  0, -2, -4,  0, -5, -2, -1, -1, 14,
-   -3,  7, -1,  5,  0,-10,  1,  1, -1, -5, 14, -1, -2,  1, -3, -2,
-   -6,  0,  0,  6,  2,  3, -9,  4,  4, -5, -1, -1, -7,  3,  8, -1,
-    2, -4, -1,-11, 11,  2,  1,  0, -1,  2,  3,  9,  0,  2,  0,-15,
-    3,  5,-20,  3,  3, -1,  3,  3,  1, -1, 16,  1,  2,-29,  9,  2,
-  -13, -6, -1, -3, 36, -1, -8, -3,  2,  5,  4,  2,-37,  9, 11,  3
-};
-
-/* 6x16-entry codebook for intra-coded 4x4 vectors */
-DECLARE_ALIGNED(4, static const int8_t, svq1_intra_codebook_4x4)[1536] = {
-  -11, -3,  3,  6,-10, -1,  5,  7, -9, -1,  6,  7, -9, -1,  4,  6,
-    5,  7,  0,-14,  6,  9,  2,-15,  6,  9,  2,-15,  4,  6,  0,-14,
-   16,  3, -5, -6, 16,  1, -8, -8, 14, -1, -9, -9, 12,  0, -8, -8,
-    8, 12, 16, 17, -2,  2,  6,  9,-10, -8, -4,  0,-15,-14,-11, -7,
-   -7,-10, -2, 16, -7,-11, -3, 18, -7,-11, -1, 20, -6, -8,  1, 19,
-   -9,-13,-16,-17,  2, -2, -7, -9, 11,  8,  4, -1, 16, 15, 11,  7,
-  -22, -2, 13, 15,-24, -2, 14, 16,-25, -4, 13, 15,-25, -6, 10, 13,
-   26, 26, 22, 16, 17, 15,  9,  3, -2, -6,-11,-14,-20,-25,-28,-28,
-  -27,-27,-25,-21,-16,-15,-11, -7,  3,  8, 12, 13, 23, 28, 31, 30,
-   20, 16, -7,-33, 22, 19, -6,-35, 22, 19, -6,-34, 20, 17, -6,-32,
-  -20,-20,  2, 38,-21,-22,  2, 40,-21,-22,  2, 40,-20,-20,  3, 38,
-  -47, -4, 24, 26,-50, -3, 26, 27,-50, -3, 26, 27,-47, -4, 24, 26,
-   45,  6,-23,-27, 48,  5,-25,-28, 48,  5,-26,-28, 44,  6,-24,-27,
-  -30,-36,-10, 76,-31,-37,-11, 78,-31,-37,-11, 78,-31,-36,-10, 77,
-  -53,-32, 35, 52,-54,-34, 36, 52,-54,-34, 36, 52,-53,-33, 34, 51,
-  -93,-34, 62, 65,-93,-34, 62, 66,-93,-34, 62, 65,-93,-34, 60, 64,
-   -7,  0,  2,  2, -8, -1,  3,  3, -8,  0,  4,  5, -6,  1,  5,  5,
-    3,  7, 11, 11,  2,  2,  3,  3,  1, -2, -6, -7,  1, -5,-11,-13,
-    3, -2, -4, -3,  7,  0, -5, -5, 12,  4, -5, -7, 14,  6, -4, -7,
-   18, 14,  3, -2,  6,  4,  0, -3, -8, -5, -2,  0,-16,-11, -2,  2,
-   -8, -6,  7, 18, -7, -8,  2, 13, -4, -6, -2,  6,  0, -4, -3,  1,
-    1, -3,-13,-18,  0, -1, -5, -7, -1,  1,  6,  7, -2,  4, 15, 17,
-  -15,-14, -7, -2, -6, -5, -1,  0,  6,  6,  3,  1, 15, 13,  6,  1,
-    2, -2,-11, 10,  2, -1,-12, 11,  3, -1,-12, 11,  2, -2,-11, 11,
-   -9, 14, -1, -5, -9, 15, -2, -5, -8, 16, -2, -5, -7, 15, -1, -4,
-    2,  6,  8,  8, -2,  3,  9, 12,-11, -5,  4, 10,-19,-16, -8,  0,
-   14,  8, -7,-15, 12,  7, -7,-14,  8,  5, -4, -9,  5,  3, -1, -4,
-   12,-14, -2,  2, 13,-15, -1,  3, 14,-15, -1,  3, 13,-14, -1,  3,
-    0,  6, 10,-13,  0,  6, 10,-15,  0,  7,  9,-17,  1,  6,  8,-16,
-   -8, -5, 15, -2, -8, -6, 17, -2, -8, -6, 16, -3, -8, -5, 15, -2,
-   -9,-11,-11,-10,  9, 10,  9,  8,  8, 10, 10,  9, -8, -9, -8, -7,
-    9, 10,  9,  7, -8,-10,-10,-10, -7,-10,-11,-11, 11, 12, 11,  8,
-    0, 10,  7,  0,  0,  7,  0, -6,  0,  2, -5, -6, -2, -1, -4, -1,
-    5,  0, -6, -9,  2,  2,  2,  1, -2,  0,  5,  7, -6, -5,  1,  4,
-    3, -8,  2, -1,  4, -9,  3,  0,  5, -7,  3,  0,  7, -5,  3,  0,
-   -5, -3,  2,  9, -6, -3,  1,  8, -6, -3,  1,  7, -5, -2,  0,  4,
-   13,  8,  3,  1, -3, -5, -4, -1, -8, -7, -3,  0, -1,  1,  3,  2,
-    3,  2, -5,-12,  4,  3, -2, -9,  3,  4,  1, -4,  3,  5,  4, -1,
-   -9, -8, -4,  0,  8,  6,  2,  0, 10,  8,  3,  0, -6, -5, -3, -1,
-   -3, -9,-12, -5,  0, -3, -5,  0,  2,  3,  2,  4,  5,  8,  7,  6,
-   -1, -2,  5, 12, -1, -1,  5,  9,  2,  1, -1, -2,  2, -1,-11,-17,
-   -7,  3,  3, -1, -9,  3,  4, -1,-10,  4,  6, -1, -9,  5,  7,  0,
-  -18, -7,  2,  2, -8,  1,  5,  3,  3,  4,  1,  0,  9,  5, -2, -3,
-   -2,  0,  6,  8, -4, -5, -5, -3,  1, -2, -6, -8, 10,  9,  3, -1,
-    0, -2, -2,  0,  0, -4, -5,  0, -2, -8, -4,  8, -5, -7,  6, 24,
-    9,  1, -7,  1,  9,  1, -8,  1,  8,  0,-10,  1,  8, -1,-11, -1,
-    8,  8,  6,  3,  5,  4,  3,  2, -2, -3, -1,  0,-10,-13, -8, -4,
-    0,  4,  2, -3,  0,  6,  3, -5,  3, 10,  2,-12,  5, 10, -4,-22,
-    0, -4, -1,  3,  1, -4, -1,  5,  1, -5,  0,  8, -1, -6, -2,  7,
-   -1, -1, -2, -4, -1, -2, -4, -6, -1, -1, -1, -2,  1,  5, 10,  9,
-   10,  3,  0, -2,  6, -1, -2, -5,  3, -1, -2, -6,  2,  0,  0, -5,
-    6,  3,  0,  0,  6,  3,  1,  1,  4, -2, -2,  1,  0, -9, -9, -2,
-  -11, -3,  1,  2, -6,  2,  4,  5, -3,  2,  3,  4, -2,  1,  1,  2,
-   -6, -4, -1, -2,  2, -1, -1, -2, 10,  2, -2, -2, 11,  2, -4, -1,
-    6,  0, -2,  2,  3,  3,  0,  0, -6,  3,  3,  0,-17, -1,  5,  0,
-   -1,  4, 10, 11, -3, -2,  0,  1, -3, -4, -5, -3, -1, -2, -2, -1,
-    2, -3, -9,-12,  3,  3,  3,  2,  2,  2,  4,  4,  2,  1, -1, -2,
-   -2,  9,  5,-10, -3,  5,  5, -5, -2,  1,  2,  0, -1, -2, -2,  1,
-   -2, -3,  7, -2, -1, -3,  7, -3, -1, -2,  8, -4, -2, -2,  7, -3,
-    1, -8, -3, 12,  2, -2, -2,  4,  1,  3,  0, -5, -1,  5,  2, -7,
-   -1,  3,  1, -5, -7, -2,  3,  1, -2, -7, -2,  2, 20,  3, -5, -1,
-    5,  0, -3, -2, -7, -7,  0,  6, -6,  0,  7,  6,  2,  6,  0, -7,
-   -2,  6, -7,  1, -2,  7, -8,  3, -2,  7, -7,  3, -1,  7, -6,  2,
-   -5, -2,  5,  7,  4,  1, -4, -8,  6,  3, -2, -5, -7, -5,  3,  7,
-   -1, -1,  6,  5,  0, -1,  1, -4,  2,  1,  0, -7,  1,  0,  0, -4,
-   -8,  0,  3,  1, -2,  1, -1, -1,  1, -1, -3,  1,  1, -2,  1,  9,
-    5,  2, -3, -4, -1,  0, -1, -3, -3,  1,  3,  1, -4,  0,  4,  2,
-    2, -2, -2, 12,  0, -2, -5,  3, -1,  0, -3,  1, -3, -1, -2,  1,
-    1,  5,  3,  0, -6, -4, -2,  1,  0, -2, -2,  2,  6,  1, -4, -1,
-   -3, -5, -5, -1,  3,  5,  5,  4,  0,  3,  1, -1, -2,  1, -2, -3,
-    2, -4, -5, -3,  4, -2, -3, -2,  6,  0, -1, -1,  7,  1,  0,  0,
-   -3, -2, -2,  0, -2, -3, -5, -1, -2,  2,  0, -1, -1, 11,  9, -1,
-    0,  1, -1,-10, -1,  1,  0, -6,  1,  0,  1,  4,  2, -5, -1, 13,
-   -2,  4,  5,  0, -5,  1,  6,  3, -6, -2,  3,  2, -5, -2,  0, -2,
-   -1,  1,  1, -2, -1, -2,  0,  2,  5,  5,  5,  7,  0, -4, -8, -7,
-    0,  2, -1, -5, -1,  2,  2, -3,  0,  5,  3, -5,  3,  8,  2,-12,
-    8,  4,  0, -2, 10, -1, -4, -1,  3, -6, -3,  0, -4, -5,  0,  0,
-    0,-10, -4,  2, -1, -6,  3,  5, -1, -3,  6,  4,  0, -2,  4,  2,
-    0,  8,  1, -1,  0, 11,  1, -3, -1,  6, -2, -4, -3, -2, -7, -4,
-    0, -1, -1, -1,  4,  5,  6,  5, -5, -9, -8, -5,  2,  2,  3,  2,
-    0,  2,  6,  1,  2,  0,  3,  0,  1, -2, -1, -2,  0, -1, -3, -6,
-    0,  0,  2,  0,  4,  0,  2,  1,  5, -2,  0,  0, -2, -9, -1,  2,
-    0,  1,  0,-10, -1,  1,  8,  0, -1, -2,  4,  0,  1, -1,  2, -1,
-   -3, -2,  2, -1, -3, -1,  2, -3,  0, -1,  1,  0,  8,  1, -1,  3,
-    0,  1,  1,  2,  0, -4, -2,  0, -1, -5,  1, -1, -2, -1, 11,  2,
-    1,  5, -2, -2,  0,  2, -4,  0, -2,  1, -5,  1,  0,  5,  0,  1,
-   -5, -3,  0,  6, -4,  2,  0,  0, -3,  5,  1,  0, -3,  3,  0,  0,
-    3, -2, -3,  1,  1, -4,  0,  8, -2, -3, -2,  3,  1,  2, -1, -1,
-    1,  1,  0,  2,  2,  0,  1,  6,  1, -1,  2,  1,  0,  3,  0,-19,
-    1, -3, -2,  2,  6,  5, -2, -7, -3,  1,  3,  1, -1, -1,  0,  2,
-   -8, -1, -1, -4,  1,  1, -1,  2,  4,  3,  2,  3, -5,  1,  3,  0,
-    0,  2, -1,  1, -3,  0,  0,  5, -5, -2,  0,  8, -4, -4, -4,  6,
-    1,  2,  1,  2,  2,  2, -3,  2,  4,  0, -9,  0,  7,  0,-11,  1,
-    0,  0,  0, -2,  3,  3, -1, -6,  4,  3, -3,-10, -1,  2,  6,  2,
-    7, -2, -3,  5, -4,  0,  3, -1, -4,  2,  1, -7,  2, -1, -1,  3,
-    3,  2,  2,  2, -5, -7, -7, -5,  5,  6,  4,  2, -2, -1,  0,  1
-};
-
-/* 6x16-entry codebook for intra-coded 8x4 vectors */
-DECLARE_ALIGNED(4, static const int8_t, svq1_intra_codebook_8x4)[3072] = {
-    5,  6,  6,  6,  7,  7,  8,  8,  0,  0,  0,  0,  0,  1,  2,  3,
-   -3, -4, -4, -5, -5, -4, -3, -2, -4, -4, -4, -5, -4, -4, -3, -3,
-    1,  2,  2,  2,  2,  3,  3,  3,  2,  3,  3,  4,  4,  5,  5,  5,
-   -1,  0,  1,  1,  2,  3,  4,  4, -9,-10, -9, -9, -8, -7, -6, -5,
-   -4, -4, -5, -6, -6, -7, -7, -7,  0, -1, -2, -2, -3, -3, -4, -4,
-    4,  4,  3,  3,  2,  1,  1,  0,  7,  7,  7,  6,  6,  5,  4,  4,
-    2,  4,  5,  6,  4,  1, -3, -6,  3,  4,  5,  5,  4,  0, -5, -8,
-    2,  3,  4,  4,  2, -2, -7,-10,  2,  2,  2,  1,  0, -4, -9,-12,
-   -9, -7, -3,  1,  4,  4,  3,  3,-10, -7, -2,  3,  5,  5,  3,  3,
-   -9, -6, -2,  3,  6,  5,  4,  3, -8, -6, -1,  3,  4,  4,  3,  2,
-   -5, -5, -5, -5, -3,  1,  4,  7, -5, -5, -5, -4, -2,  1,  6,  8,
-   -4, -5, -4, -3, -1,  3,  8, 10, -3, -4, -3, -2,  1,  5,  9, 11,
-   -2, -2, -2, -2, -2, -2, -2, -2, -4, -5, -5, -5, -5, -5, -5, -4,
-   -3, -4, -4, -4, -4, -4, -4, -3,  9, 10, 10, 11, 11, 11, 10, 10,
-    7,  4,  1, -2, -4, -6, -9,-10,  9,  7,  3,  0, -2, -4, -8, -9,
-   11,  8,  4,  2,  0, -3, -6, -8, 11,  9,  5,  3,  1, -2, -5, -7,
-  -13,-13,-13,-12,-11,-10, -8, -8,  0,  1,  2,  3,  4,  4,  4,  3,
-    3,  4,  5,  6,  6,  6,  5,  4,  3,  4,  4,  4,  3,  3,  3,  2,
-   10, 10, 11, 10,  9,  9,  8,  7,  6,  6,  6,  6,  5,  4,  3,  2,
-    0,  0,  0, -1, -2, -3, -4, -4,-10,-10,-11,-12,-13,-14,-14,-14,
-   16, 16, 17, 16, 15, 13, 12, 11, -1, -2, -3, -4, -4, -4, -4, -3,
-   -4, -5, -6, -6, -6, -6, -6, -6, -5, -6, -6, -6, -6, -6, -5, -5,
-  -13,-13,-13,-12,-11,-10, -8, -6, -9, -8, -7, -6, -4, -2,  0,  1,
-   -2, -1,  1,  3,  5,  7,  8,  9,  5,  7,  9, 11, 13, 14, 15, 15,
-   16, 14, 11,  7,  2, -3, -7, -9, 14, 12,  8,  3, -1, -6, -9,-11,
-   11,  9,  4,  0, -4, -8,-11,-13,  8,  5,  1, -3, -6,-10,-12,-14,
-  -18,-15, -9, -3,  1,  6,  9, 11,-17,-13, -7, -1,  3,  7, 11, 12,
-  -15,-11, -5,  1,  5,  9, 12, 13,-13, -9, -3,  2,  5,  9, 11, 13,
-   22, 21, 19, 15, 10,  3, -4, -9, 20, 18, 15,  9,  2, -5,-12,-17,
-   16, 13,  8,  1, -7,-14,-20,-24, 10,  6, -1, -8,-15,-21,-25,-27,
-  -25,-23,-20,-14, -7,  1,  9, 14,-23,-21,-16, -9,  0,  9, 16, 21,
-  -20,-16,-10, -1,  8, 16, 22, 25,-15,-11, -3,  6, 14, 20, 25, 27,
-   -4, -2,  0,  1,  2,  2,  2,  2, -5, -2,  0,  2,  3,  3,  3,  3,
-   -6, -4, -1,  1,  2,  3,  3,  3, -7, -5, -2,  0,  1,  1,  2,  2,
-    2,  1,  1,  1,  1,  0, -2, -3,  3,  3,  2,  1,  0, -1, -3, -4,
-    4,  3,  2,  1,  0, -2, -4, -6,  5,  4,  3,  1, -1, -3, -5, -6,
-    5,  6,  6,  4,  2,  0, -2, -3,  3,  4,  4,  4,  3,  1,  0, -1,
-   -2, -2, -1, -1, -1, -1, -2, -2, -5, -4, -3, -2, -2, -2, -3, -3,
-   -1, -1, -1, -1, -1, -1, -1, -1, -3, -4, -4, -4, -3, -3, -3, -3,
-   -1, -1, -1, -1, -1, -1, -1, -2,  5,  6,  6,  6,  6,  5,  4,  3,
-    4,  4,  4,  4,  4,  5,  6,  7,  0, -1, -1, -1, -1,  0,  1,  2,
-   -2, -3, -3, -3, -3, -2, -1,  0, -3, -3, -4, -4, -4, -3, -2, -1,
-    0, -2, -4, -4, -2,  0,  2,  3,  0, -2, -3, -3, -1,  2,  4,  5,
-   -1, -2, -4, -3,  0,  3,  5,  6, -2, -3, -4, -3, -1,  2,  4,  5,
-    9,  4,  0, -3, -3, -1,  0,  1,  8,  4, -1, -4, -3, -1,  1,  2,
-    6,  2, -3, -5, -4, -2,  0,  1,  5,  1, -3, -4, -4, -2,  0,  1,
-    5,  3,  1, -1, -4, -8,-10,-10,  3,  3,  2,  1,  0, -2, -3, -4,
-    1,  1,  1,  2,  3,  2,  1,  0, -1,  0,  1,  2,  3,  4,  3,  2,
-    0,  1,  2,  2,  1, -1, -3, -3,  0,  1,  1,  1, -1, -2, -4, -3,
-   -3, -3, -3, -3, -3, -3, -1,  2, -4, -4, -3,  0,  3,  7, 12, 14,
-   -5, -5, -6, -6, -6, -6, -6, -5,  2,  2,  2,  1,  0,  0,  0,  0,
-    4,  4,  3,  2,  1,  0,  0,  0,  6,  6,  5,  4,  2,  2,  1,  1,
-   -7, -7, -6, -3,  0,  4,  7,  8, -1, -2, -3, -3, -2, -1,  1,  2,
-    3,  3,  1, -1, -2, -2, -2, -1,  6,  6,  4,  2,  0, -2, -2, -2,
-   -6, -5, -2,  2,  5,  9, 11, 12, -4, -4, -2,  0,  2,  4,  5,  6,
-   -3, -2, -2, -2, -2, -1,  0,  1, -2, -2, -2, -3, -3, -3, -3, -2,
-   -7, -3,  1,  3,  3,  0, -3, -5, -6, -2,  3,  5,  4,  1, -3, -5,
-   -5, -1,  4,  6,  5,  2, -3, -4, -4,  0,  5,  7,  6,  3, -1, -3,
-    0,  0,  0,  0,  0,  0,  0,  0, -2, -2, -3, -3, -3, -3, -2, -1,
-    6,  7,  8,  9,  9,  8,  7,  6, -4, -4, -5, -5, -6, -6, -5, -4,
-   -9, -8, -6, -4,  0,  3,  6,  6, -5, -4, -1,  3,  5,  6,  5,  3,
-    1,  3,  6,  6,  4,  1, -2, -5,  6,  7,  5,  1, -3, -7,-10,-11,
-   10,  9,  5,  1, -3, -6, -6, -4,  5,  3, -1, -5, -6, -5, -2,  2,
-   -2, -4, -6, -6, -4,  1,  6, 10, -6, -7, -7, -4,  1,  7, 11, 12,
-    6,  5,  3,  2,  0,  0,  0,  0,  2,  1, -1, -2, -3, -2, -1, -1,
-    0, -1, -2, -4, -4, -2, -1,  1,  0,  0, -1, -2, -1,  0,  2,  3,
-    0, -1, -2, -2, -2, -2, -1, -1,  5,  4,  2,  1,  0,  0,  0,  0,
-    6,  5,  3,  1,  0,  0,  0,  0,  2,  0, -2, -4, -4, -3, -2, -2,
-   -7, -4,  0,  2,  2,  2,  2,  1, -7, -3,  0,  0,  0,  0,  0,  0,
-   -4, -1,  1,  1,  0,  0,  0,  1, -1,  1,  2,  2,  2,  2,  3,  3,
-   -2,  0,  2,  2,  1,  1,  1,  1, -1,  1,  2,  2,  1,  0,  0, -1,
-    0,  2,  4,  2,  0, -1, -2, -3,  1,  2,  3,  1, -2, -4, -6, -6,
-    1,  2,  2,  4,  5,  6,  4,  1,  0, -1, -1, -1,  0,  0, -2, -4,
-    0,  0, -1, -2, -2, -2, -4, -6,  2,  1,  0,  0,  1,  1, -1, -3,
-    1,  1,  1,  1,  1,  2,  3,  3,  0,  0,  1,  0,  1,  2,  4,  4,
-   -1, -1, -1, -1,  0,  1,  2,  3, -4, -4, -5, -5, -5, -3, -1,  0,
-   -6, -5, -5, -4, -3, -2, -1, -1, -1,  0,  0,  1,  1,  2,  3,  3,
-    0,  1,  1,  1,  2,  2,  3,  4,  0,  0, -1, -1,  0,  1,  2,  3,
-    0,  1,  1,  1,  0,  0, -1, -1,  1,  3,  3,  2,  1, -1, -2, -2,
-   -2,  0,  2,  2,  2,  2,  1,  1, -9, -8, -4, -2,  1,  3,  3,  3,
-   -1, -1, -1, -2, -3, -3, -3, -4,  0,  0,  0, -1, -2, -2, -3, -3,
-    2,  2,  2,  0, -1, -1, -1, -1,  5,  5,  4,  3,  2,  2,  2,  2,
-    6,  3, -1, -4, -3, -1,  1,  1,  2, -1, -3, -4, -1,  2,  2,  0,
-   -1, -2, -2,  1,  4,  4,  1, -3, -2, -1,  1,  4,  6,  3, -3, -8,
-    3,  3,  2,  1, -1, -2, -2, -2, -4, -4, -2, -1,  1,  3,  4,  4,
-   -4, -5, -5, -4, -2,  0,  2,  2,  7,  7,  4,  1, -1, -2, -3, -2,
-   -1,  1,  3,  0, -4, -6,  0,  6, -2,  1,  4,  1, -4, -6, -1,  7,
-   -3,  1,  4,  2, -3, -6, -1,  6, -2,  0,  3,  2, -2, -5, -1,  4,
-    1, -1, -2,  1,  4,  4, -1, -7,  1, -1, -4, -1,  5,  6,  0, -6,
-    3,  0, -4, -3,  3,  6,  2, -4,  3,  0, -5, -4,  1,  4,  1, -3,
-    2,  2,  3,  3,  3,  3,  2,  2, -4, -5, -6, -7, -7, -7, -7, -6,
-    1,  2,  3,  3,  3,  3,  2,  2,  0,  0,  1,  1,  1,  2,  2,  1,
-    3, -3, -3,  3,  4, -2, -2,  2,  3, -4, -4,  4,  4, -4, -4,  2,
-    4, -4, -4,  4,  4, -4, -3,  3,  3, -3, -4,  3,  3, -3, -3,  3,
-   -2, -2, -2, -2, -2, -2, -1, -1,  6,  7,  8,  8,  8,  7,  6,  5,
-   -5, -6, -7, -7, -8, -7, -6, -5,  1,  1,  2,  2,  2,  2,  1,  1,
-    0,  0,  0,  0,  0, -1,  0,  0, -1,  0,  0,  0,  0, -1,  0,  0,
-   -2, -3, -2, -2, -2, -3, -3, -3,  2,  3,  5,  6,  4,  2,  1,  0,
-    8,  6,  2,  0,  0,  0,  0,  0,  4,  1,  0,  0,  0, -1, -1, -1,
-    1, -1,  0,  0,  0, -1, -2, -3, -2, -2, -1,  0,  0, -2, -4, -5,
-    3,  1, -1, -2, -3, -4, -5, -5,  2,  1,  0,  0,  1,  1,  0,  0,
-    0, -1, -1,  0,  2,  2,  2,  2, -1, -2, -1,  1,  2,  2,  2,  2,
-    0, -1, -2, -1, -1, -1, -1,  0, -1, -2, -2, -1, -1,  0,  0,  1,
-    2,  1,  1,  2,  2,  1,  1,  0,  6,  5,  3,  1,  0, -2, -4, -4,
-   -3, -2, -1,  0,  1,  1,  0, -1,  0,  1,  3,  4,  5,  5,  3,  1,
-   -1, -1, -1,  0,  1,  0, -1, -2, -2, -2, -2, -1,  0, -1, -2, -3,
-    0, -1, -2, -2, -1, -1,  0,  2,  1, -1, -2, -1, -1, -1,  0,  2,
-    1,  0, -2, -2, -2, -2,  1,  5,  1, -1, -2, -2, -2,  0,  5, 10,
-    0,  0,  0,  0,  0, -1, -1, -1, -1, -1, -1,  0,  0,  0,  1,  2,
-    1,  2,  2,  3,  4,  4,  6,  5, -3, -3, -3, -2, -2, -3, -3, -3,
-    1, -1, -2, -2,  0,  3,  5,  7,  2,  0, -2, -3, -2,  0,  2,  3,
-    3,  1, -2, -3, -3, -2, -1, -1,  3,  1,  0, -1, -1, -1, -1, -1,
-    1,  3,  5,  4,  2, -1, -3, -4, -3, -2,  1,  2,  1,  0, -1, -2,
-   -5, -3,  0,  2,  2,  1,  0,  0, -3, -1,  1,  2,  2,  1,  0,  0,
-    0, -1, -1, -1,  1,  2,  3,  4, -3, -4, -4, -3, -1,  0,  0,  1,
-   -2, -3, -2, -1,  1,  1,  1,  1, -2, -2,  0,  3,  4,  4,  3,  2,
-   -4, -4, -3, -2, -1,  1,  2,  3,  0,  1,  1,  1, -1, -2, -3, -3,
-    3,  4,  5,  4,  2, -1, -3, -3, -2, -2,  0,  2,  2,  2,  1,  0,
-   -4,  0,  5,  7,  4, -1, -4, -4, -1,  2,  4,  3,  0, -3, -3, -2,
-    2,  1,  0, -1, -2, -2,  0,  1,  0,  0, -1, -2, -2, -1,  1,  2,
-   -4, -3, -2, -1,  0,  1,  2,  2, 10,  9,  5,  0, -3, -4, -3, -2,
-    1, -1, -2, -2, -1,  0,  0,  0, -2, -2, -1,  1,  1,  1,  0, -1,
-   -5, -3,  0,  3,  4,  2,  0, -2, -2, -1,  0,  1,  1,  0, -1, -1,
-    3,  2, -1, -2, -2, -1,  1,  1,  7,  5, -1, -5, -6, -2,  2,  4,
-   -2,  3,  3, -3, -4,  1,  2, -2, -3,  3,  4, -3, -4,  2,  3, -2,
-   -3,  3,  4, -3, -4,  2,  3, -2, -4,  2,  4, -2, -3,  1,  2, -1,
-    4,  3, -1, -3, -3, -1,  1,  2, -4, -6, -4,  0,  4,  5,  4,  1,
-    0,  2,  5,  6,  2, -3, -5, -4,  1,  1, -1, -3, -5, -2,  2,  4,
-   -1,  0,  1,  2,  2,  3,  3,  4, -1,  0,  1,  1,  0, -1, -1, -1,
-   -1,  0,  1,  2,  2,  1, -1, -2, -3, -2, -1,  0,  0, -1, -2, -3,
-    1,  1,  1,  1,  0,  0,  1,  2,  1,  0, -1,  0,  0,  1,  1,  0,
-    1, -2, -4, -1,  1,  2,  1,  0,  1, -4, -7, -3,  1,  3,  2,  1,
-    1,  1,  1,  1,  1,  1,  0, -1,  1,  1,  1,  0,  1,  2,  2,  0,
-    1,  1,  0,  0,  0,  2,  0, -3,  3,  2,  0, -1, -1, -2, -6, -9,
-    0,  0,  0,  1,  0,  0,  1,  2,  1,  0,  0,  0, -1, -1,  0,  2,
-    0,  1,  1,  1, -1, -3, -2,  0, -7, -5,  1,  6,  6,  2, -1, -1,
-    3,  1, -1, -3, -4, -2,  1,  4,  2,  0, -2, -3, -4, -3, -1,  2,
-    2,  2,  1,  1,  1,  0,  0,  1,  1,  1,  0,  0,  0,  0,  0,  1,
-   -1,  1,  1, -2, -5, -6, -4, -1, -1,  1,  4,  3,  2,  0,  1,  2,
-   -1,  0,  2,  3,  1,  0,  0,  1, -1,  0,  1,  0,  0, -1, -1,  0,
-    0,  1,  2,  2,  0, -2, -1,  1, -2, -1, -1, -2, -1,  2,  6,  8,
-   -1, -1, -2, -3, -2,  0,  1,  2, -1,  0,  0, -1, -1,  0, -1, -1,
-    2,  1,  1,  1,  1,  0,  0,  0,  0,  0,  1,  1,  1, -1, -1,  1,
-   -1,  0,  2,  2, -1, -3, -2,  3,  0,  2,  3,  0, -5, -7, -2,  4,
-   -1,  0,  0,  0, -1, -2, -3, -3, -1,  0, -1, -2, -2, -2, -2, -2,
-    1,  1,  0,  0,  1,  2,  0, -1,  1,  2,  1,  2,  5,  6,  2,  0,
-   -2, -4, -3,  0,  2,  2,  0, -3,  3,  1,  0,  1,  2,  1, -2, -3,
-    3,  1,  0,  0,  0,  0,  0, -1,  1, -1, -2, -2, -1,  1,  3,  3,
-    3,  2,  1,  2,  4,  3,  1, -2, -2, -4, -4, -3, -1,  0, -2, -3,
-    1,  0, -1, -1,  0,  1,  0, -1,  3,  2,  0,  0,  0,  1,  1,  0,
-    1,  1,  0,  0,  0,  0,  0,  0,  2,  3,  3,  2,  2,  2,  1,  1,
-    0, -1, -2, -3, -5, -5, -5, -4,  1,  1,  0, -1,  0,  1,  3,  3,
-   -9, -6, -2,  0,  1,  1,  2,  2, -6, -2,  1,  2,  1,  1,  0,  1,
-   -2,  1,  2,  2,  1,  1,  1,  1,  0,  2,  2,  1,  0,  1,  1,  1,
-    1,  0,  0,  0,  0,  0, -1,  0,  0,  0,  0,  0, -1, -3, -2,  0,
-   -3, -3, -3, -2, -1,  3,  7,  9,  1,  2,  2,  2,  0, -2, -4, -3,
-    2,  0, -2, -1,  3,  4, -1, -6,  1,  0, -2, -3, -1,  3,  3,  0,
-    0,  3,  3,  0, -2, -1,  1,  1, -6, -1,  3,  2, -1, -2,  0,  1,
-    5,  3,  0, -2, -3,  0,  2,  1,  1,  1,  2,  2,  0, -2, -4, -7,
-   -3, -2,  1,  2,  2,  1, -1, -4,  2,  2,  0, -2, -2,  0,  2,  2,
-    0,  0, -2, -3, -2, -1,  0,  0,  0,  0,  0,  0,  0,  0,  2,  2,
-   -2, -1,  0,  1,  0,  1,  2,  3, -4, -2,  0,  0, -1,  0,  2,  3,
-   -2, -2, -2, -1, -1,  0,  2,  4,  0,  0,  0,  0, -1, -1,  0,  1,
-    0, -1, -1, -1, -1, -1,  0,  0,  6,  4,  2,  0, -1, -2, -1, -1,
-    0,  1,  1,  1,  1, -1, -5,-10,  1,  1,  1,  1,  1,  1,  0, -4,
-    1,  0,  1,  1,  1,  1,  1, -1,  2,  1,  1,  1,  0,  0,  0,  0,
-   -3,  1,  4,  3,  3,  1, -1,  0, -4,  0,  1,  0, -1,  0,  0,  0,
-   -5,  0,  2,  1,  1,  1,  0, -1, -1,  2,  1, -2, -2, -1,  0, -1,
-    2,  4,  5,  3,  0, -1,  1,  2,  0,  0,  1,  0, -2, -2, -1, -1,
-   -2, -2, -2, -2, -3, -2, -1,  0,  0,  0,  1,  0,  0,  0,  1,  2,
-    0, -2, -2, -3, -1,  2,  2, -1,  1,  0,  0,  0,  1,  5,  3, -2,
-   -1, -1,  0, -1,  0,  2,  0, -5, -1,  0,  1,  0,  0,  2,  2, -2,
-    3,  1, -1, -1,  0,  1,  1,  2,  1,  0,  0,  1,  1,  1,  1,  1,
-  -10, -8, -2,  1,  2,  1,  1,  1, -1,  1,  2,  1,  0,  0,  0,  0,
-   -1, -1,  0,  1,  2,  2,  2,  1, -1, -1, -1,  0, -1, -3, -5, -4,
-    1,  1,  2,  1,  1,  0,  0,  2, -1, -2, -1, -1, -1,  0,  2,  4,
-   -3, -7, -5,  0,  2,  0,  0,  0,  3, -1, -2,  1,  2,  1,  1,  2,
-    1, -2, -1,  1,  2,  1,  0,  1,  0, -1,  0,  3,  2, -1, -1, -1,
-    2,  1,  1,  0,  0,  0,  0,  0, -9, -7, -2,  3,  3,  2,  1,  1,
-    3,  2,  0, -2, -2, -1,  1,  1,  0, -1,  0,  0,  1,  1,  0,  0,
-   -2, -1,  1,  1,  1,  0,  0,  0,  1,  2,  1, -2, -4, -3,  1,  2,
-    1,  2,  1, -2, -3,  0,  3,  1, -1, -1,  0,  0,  1,  3,  0, -4,
-    2,  0, -1,  1,  2, -2, -2,  3,  2,  0, -1,  2,  3, -2, -4,  1,
-    0,  1,  1,  1,  2, -2, -6, -2, -1,  0,  0,  0,  2,  0, -2, -1,
-   -1, -1,  1,  2,  1, -2, -3, -2,  3, -1, -2, -1, -1,  0,  1,  2,
-   10,  4,  0,  0, -1, -2, -2, -1,  3, -1, -2, -1,  0, -1, -1,  0,
-   -5,  2,  7,  1, -4, -2,  1,  0, -2,  2,  3, -1, -3,  0,  2,  0,
-    2,  1,  0,  0,  1,  1, -1, -2,  1, -2, -2, -1, -1, -2,  0,  0,
-    0,  3, -2, -7, -1,  3,  0,  0,  1,  3, -3, -5,  2,  3, -1,  0,
-    0,  2, -2, -2,  4,  2, -2,  0, -1,  1, -1,  0,  2, -1, -2,  1,
-    4,  0, -3, -4, -2,  1,  2,  1,  0,  0,  3,  5,  3,  1, -1, -2,
-    1,  1,  1, -1, -3, -1,  1,  1,  1, -1, -2, -2,  0,  0, -1, -2
-};
-
-/* 6x16-entry codebook for intra-coded 8x8 vectors */
-DECLARE_ALIGNED(4, static const int8_t, svq1_intra_codebook_8x8)[6144] = {
-    4,  4,  3,  2,  2,  1,  0, -1,  4,  3,  3,  2,  1,  0, -1, -1,
-    3,  3,  2,  2,  1,  0, -1, -2,  3,  2,  2,  1,  0, -1, -2, -3,
-    2,  2,  1,  0, -1, -1, -2, -3,  2,  1,  0,  0, -1, -2, -3, -4,
-    1,  0,  0, -1, -2, -3, -4, -4,  0,  0, -1, -2, -2, -3, -4, -4,
-    2,  3,  3,  3,  3,  3,  3,  3,  2,  2,  2,  2,  2,  2,  3,  3,
-    1,  2,  2,  2,  2,  2,  2,  2,  0,  1,  1,  1,  1,  1,  1,  1,
-   -1,  0,  0,  0,  0,  0,  1,  1, -2, -2, -1, -1, -1, -1, -1, -1,
-   -3, -3, -3, -3, -3, -3, -2, -2, -5, -4, -4, -4, -4, -4, -4, -3,
-   -4, -2, -1,  0,  1,  2,  2,  3, -4, -2, -1,  0,  1,  2,  3,  3,
-   -4, -3, -1,  0,  1,  2,  3,  3, -4, -3, -1,  0,  1,  2,  3,  3,
-   -5, -3, -1,  0,  1,  2,  3,  3, -5, -3, -1,  0,  1,  2,  3,  3,
-   -5, -3, -1,  0,  1,  1,  2,  3, -5, -3, -2, -1,  0,  1,  2,  3,
-    4,  4,  5,  5,  6,  6,  7,  7,  2,  2,  2,  3,  3,  4,  4,  4,
-    0,  0,  0,  0,  1,  1,  1,  2, -2, -2, -2, -2, -1, -1, -1,  0,
-   -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-   -1, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -2, -2, -2, -2,
-    5,  3,  1, -1, -2, -3, -3, -3,  5,  3,  1, -1, -2, -3, -3, -3,
-    5,  3,  1, -1, -2, -3, -3, -3,  5,  3,  1, -1, -2, -3, -3, -3,
-    5,  4,  1,  0, -2, -3, -3, -3,  6,  4,  2,  0, -2, -2, -3, -3,
-    6,  4,  2,  0, -1, -2, -2, -3,  6,  4,  2,  1, -1, -2, -2, -2,
-   -1,  1,  3,  3,  2,  0, -3, -6, -1,  1,  3,  4,  3,  0, -3, -6,
-   -1,  1,  4,  4,  3,  1, -3, -6, -1,  1,  3,  4,  3,  1, -3, -6,
-   -2,  1,  3,  4,  3,  1, -3, -6, -2,  1,  3,  4,  3,  1, -3, -7,
-   -2,  1,  3,  3,  2,  0, -3, -7, -2,  0,  2,  3,  2,  0, -3, -6,
-   10,  9,  8,  6,  6,  5,  4,  4,  6,  5,  4,  3,  2,  2,  2,  1,
-    2,  1,  0, -1, -2, -2, -2, -1, -1, -2, -3, -4, -4, -4, -4, -3,
-   -2, -3, -4, -4, -5, -4, -4, -3, -2, -2, -3, -3, -3, -3, -2, -2,
-   -1, -1, -1, -1, -1, -1, -1,  0,  1,  1,  1,  1,  1,  1,  1,  2,
-   -2, -1,  1,  2,  4,  5,  7,  8, -3, -2,  0,  1,  3,  5,  7,  8,
-   -4, -3, -1,  0,  2,  4,  6,  7, -5, -4, -2, -1,  1,  3,  5,  7,
-   -6, -5, -3, -2,  0,  2,  4,  6, -6, -5, -4, -2, -1,  1,  3,  5,
-   -7, -6, -5, -3, -2,  0,  2,  3, -8, -7, -5, -4, -3, -1,  1,  2,
-   11,  9,  7,  5,  3,  1, -1, -1, 10,  8,  6,  3,  1,  0, -2, -2,
-    9,  7,  5,  2,  0, -2, -3, -4,  8,  6,  3,  1, -1, -3, -4, -4,
-    6,  4,  2, -1, -3, -4, -5, -5,  5,  3,  0, -2, -4, -5, -6, -6,
-    3,  1, -1, -3, -5, -6, -7, -7,  2,  0, -2, -4, -6, -6, -7, -7,
-    5,  6,  7,  7,  7,  8,  8,  8,  3,  4,  5,  5,  6,  6,  6,  6,
-    0,  2,  2,  3,  4,  4,  4,  5, -2, -1,  0,  1,  2,  2,  3,  3,
-   -4, -3, -2, -1,  0,  1,  1,  2, -6, -5, -4, -3, -2, -2, -1,  0,
-   -8, -7, -6, -6, -5, -4, -3, -3,-10, -9, -8, -8, -7, -6, -6, -5,
-    6,  5,  3,  1, -1, -3, -6, -8,  6,  5,  4,  2, -1, -3, -6, -8,
-    6,  5,  4,  2,  0, -3, -6, -8,  6,  5,  4,  2,  0, -3, -6, -8,
-    6,  6,  4,  2,  0, -3, -6, -8,  6,  5,  4,  2,  0, -3, -6, -8,
-    6,  5,  4,  2,  0, -3, -6, -8,  6,  5,  4,  2, -1, -3, -5, -8,
-   11, 10,  9,  8,  7,  6,  5,  4,  8,  8,  7,  6,  5,  4,  3,  2,
-    6,  5,  4,  4,  2,  2,  1,  0,  3,  3,  2,  1,  0,  0, -1, -2,
-    1,  1,  0, -1, -2, -2, -3, -3, -1, -1, -2, -3, -4, -4, -5, -5,
-   -3, -4, -4, -5, -6, -6, -7, -7, -5, -5, -6, -7, -8, -8, -8, -8,
-  -14,-13,-12,-11, -9, -7, -6, -4,-12,-11,-10, -9, -7, -5, -3, -1,
-  -10, -9, -7, -6, -3, -2,  0,  2, -8, -6, -4, -2,  0,  2,  4,  5,
-   -5, -3,  0,  2,  4,  5,  7,  8, -2,  0,  2,  4,  6,  8,  9, 10,
-    0,  3,  5,  7,  8, 10, 11, 12,  3,  5,  7,  8, 10, 11, 12, 12,
-  -19,-19,-18,-18,-17,-16,-15,-14,-15,-15,-14,-13,-12,-11,-10, -9,
-  -11,-10, -9, -8, -6, -5, -4, -3, -6, -5, -3, -2, -1,  0,  1,  2,
-   -1,  0,  2,  3,  4,  5,  6,  6,  4,  6,  7,  8,  9, 10, 10, 10,
-    9, 10, 11, 12, 13, 14, 14, 14, 12, 14, 14, 15, 16, 16, 16, 16,
-   22, 21, 19, 17, 14, 11,  9,  5, 20, 19, 17, 14, 11,  8,  4,  1,
-   17, 15, 13, 10,  6,  3,  0, -4, 13, 11,  8,  5,  1, -2, -5, -9,
-    9,  6,  3, -1, -4, -7,-11,-13,  4,  0, -3, -6, -9,-12,-15,-17,
-   -2, -5, -8,-11,-14,-16,-18,-20, -8,-10,-13,-16,-17,-19,-21,-22,
-   17, 18, 18, 18, 17, 16, 16, 14, 16, 16, 15, 15, 14, 13, 12, 11,
-   12, 12, 11, 10,  9,  8,  7,  5,  7,  6,  6,  4,  3,  2,  1, -1,
-    1,  0, -1, -2, -3, -4, -5, -6, -5, -6, -7, -8, -9,-10,-11,-12,
-  -11,-12,-13,-14,-15,-16,-16,-17,-16,-17,-17,-18,-19,-20,-20,-20,
-    0,  0,  0,  0, -1, -1, -2, -3,  1,  0,  0,  0,  0, -1, -2, -3,
-    1,  1,  0,  0, -1, -1, -2, -2,  1,  1,  1,  0,  0, -1, -1, -2,
-    2,  1,  1,  1,  0, -1, -1, -2,  2,  2,  1,  1,  0,  0, -1, -2,
-    2,  2,  1,  1,  1,  0, -1, -1,  2,  2,  1,  1,  1,  0,  0, -2,
-    0, -1, -1,  0,  0,  1,  2,  3,  0, -1, -1,  0,  1,  1,  2,  2,
-   -1, -1, -1, -1,  0,  1,  2,  2, -1, -1, -2, -1,  0,  1,  1,  2,
-   -1, -2, -2, -1,  0,  0,  1,  2, -1, -2, -2, -2, -1,  0,  1,  2,
-   -1, -1, -2, -1,  0,  0,  1,  2, -1, -1, -1, -1,  0,  1,  1,  2,
-    3,  2,  2,  2,  1,  1,  0,  0,  3,  2,  2,  2,  2,  1,  0,  0,
-    2,  2,  2,  1,  1,  1,  0,  0,  2,  2,  1,  1,  1,  0,  0, -1,
-    1,  1,  1,  0,  0,  0, -1, -1,  0,  0, -1, -1, -1, -1, -1, -1,
-   -2, -2, -2, -2, -2, -2, -2, -2, -2, -3, -3, -3, -2, -2, -2, -2,
-    5,  2,  0,  0, -1,  0,  0,  0,  4,  2,  0, -1, -1, -1,  0, -1,
-    4,  1, -1, -1, -2, -1, -1, -1,  4,  1, -1, -1, -2, -1, -1, -1,
-    4,  1, -1, -2, -2, -1, -1, -1,  4,  1, -1, -2, -2, -1, -1, -1,
-    4,  1, -1, -1, -1, -1, -1, -1,  4,  2,  0, -1,  0,  0,  0, -1,
-   -2, -1,  0,  1,  1,  1,  1,  1, -3, -1,  0,  1,  1,  1,  1,  1,
-   -3, -1,  0,  1,  1,  1,  1,  1, -3, -1,  0,  1,  1,  1,  1,  1,
-   -3, -2,  0,  1,  2,  2,  1,  1, -4, -2,  0,  1,  2,  2,  2,  2,
-   -5, -3, -1,  1,  1,  2,  1,  2, -5, -3, -2,  0,  1,  1,  1,  1,
-    3,  3,  1,  0, -2, -4, -4, -5,  3,  3,  2,  0, -1, -2, -3, -4,
-    2,  2,  1,  1,  0, -1, -2, -2,  1,  1,  1,  1,  1,  0,  0,  0,
-    0,  0,  0,  1,  1,  1,  1,  1, -2, -1, -1,  0,  0,  1,  2,  2,
-   -3, -2, -2, -1,  0,  1,  2,  3, -3, -3, -2, -1,  0,  1,  2,  3,
-   -3, -3, -3, -3, -3, -2, -2, -2, -3, -3, -2, -2, -2, -1, -1, -1,
-   -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1,  0,  0,  0,  0,  0,
-    0,  0,  0,  0,  1,  1,  1,  1,  0,  0,  1,  1,  2,  2,  2,  2,
-    1,  1,  1,  2,  2,  3,  3,  3,  2,  2,  2,  2,  3,  3,  3,  3,
-   -8, -7, -5, -3, -2, -1,  0, -1, -4, -3, -1,  0,  1,  2,  1,  1,
-   -1,  1,  2,  3,  3,  2,  2,  1,  1,  2,  3,  3,  2,  2,  1,  0,
-    2,  3,  3,  2,  1,  0,  0, -1,  1,  2,  1,  0, -1, -1, -1, -1,
-    1,  1,  0, -1, -1, -2, -2, -1,  1,  1,  0,  0, -1, -1,  0, -1,
-   -4, -3, -2,  0,  1,  2,  3,  3, -4, -3, -2,  0,  1,  2,  2,  2,
-   -3, -3, -2, -1,  0,  1,  1,  1, -2, -2, -2, -1, -1,  0,  0,  0,
-    0, -1, -1, -1, -1, -1, -1, -1,  2,  1,  1,  0,  0, -1, -1, -2,
-    3,  3,  3,  1,  0, -1, -2, -2,  5,  4,  4,  2,  1,  0, -1, -2,
-    0,  0,  0,  0,  1,  2,  3,  3,  0, -1,  0,  0,  1,  2,  3,  3,
-    0, -1,  0,  0,  1,  2,  3,  2,  0,  0,  0,  1,  1,  2,  2,  2,
-    2,  1,  1,  1,  1,  1,  1,  0,  2,  2,  2,  1,  0,  0, -1, -2,
-    2,  1,  0,  0, -2, -3, -5, -6,  0, -1, -1, -3, -5, -6, -8, -9,
-   -2,  0,  1,  2,  2,  1, -1, -4, -2,  0,  2,  2,  2,  1, -1, -4,
-   -2,  0,  2,  2,  2,  1, -1, -3, -2,  0,  2,  2,  2,  1, -1, -3,
-   -2, -1,  2,  2,  2,  1, -1, -3, -2, -1,  1,  2,  2,  1, -1, -3,
-   -3, -1,  1,  2,  2,  1, -1, -3, -2, -1,  1,  2,  2,  1, -1, -3,
-   -1,  1,  1, -1, -3, -3,  0,  4, -1,  1,  1, -1, -3, -3,  0,  4,
-   -1,  1,  1,  0, -3, -3,  0,  4, -1,  1,  2,  0, -3, -3,  0,  5,
-    0,  1,  2,  0, -3, -4,  0,  4,  0,  1,  2,  0, -3, -4,  0,  5,
-    0,  1,  2,  0, -3, -3,  0,  4,  0,  1,  2, -1, -2, -2,  0,  4,
-    6,  6,  5,  6,  5,  5,  5,  5,  2,  2,  2,  2,  2,  2,  2,  2,
-    0,  0,  0,  0,  0,  0,  0,  0, -1, -1, -1, -1, -2, -2, -2, -2,
-   -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
-   -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-    2,  2,  2,  2,  2,  2,  2,  2,  0,  1,  1,  0,  0,  0,  0,  0,
-   -1, -2, -2, -2, -2, -2, -2, -1, -3, -3, -3, -3, -3, -3, -3, -2,
-   -3, -4, -4, -3, -3, -3, -2, -2, -2, -2, -2, -2, -1, -1,  0,  0,
-    0,  1,  1,  1,  2,  2,  3,  3,  3,  4,  4,  5,  5,  6,  6,  6,
-    4,  1, -2, -3, -3, -1,  1,  3,  4,  1, -2, -4, -3, -1,  1,  3,
-    5,  1, -2, -4, -3, -1,  1,  4,  5,  1, -2, -3, -3, -1,  2,  4,
-    5,  1, -2, -3, -3, -1,  2,  4,  4,  0, -3, -4, -3, -1,  2,  4,
-    4,  0, -3, -3, -3, -1,  1,  3,  3,  0, -2, -3, -2, -1,  1,  3,
-   -3, -4, -4, -4, -4, -4, -4, -4, -1, -1, -1, -1, -1, -1, -2, -2,
-    2,  1,  1,  2,  2,  1,  1,  1,  3,  3,  3,  4,  4,  3,  3,  3,
-    3,  3,  3,  4,  4,  4,  3,  3,  1,  2,  1,  2,  2,  2,  2,  2,
-   -2, -2, -2, -1, -1, -1,  0,  0, -4, -4, -4, -4, -3, -3, -3, -3,
-   -1, -2, -3, -3, -2, -2, -1,  0,  0, -1, -2, -2, -2, -1,  0,  1,
-    2,  1, -1, -1, -1, -1,  0,  1,  3,  1,  0, -1, -1,  0,  0,  1,
-    3,  2,  0, -1,  0,  0,  0,  1,  3,  1,  0, -1,  0,  0,  0,  1,
-    3,  1,  0, -1,  0,  0,  0,  1,  2,  1,  0,  0,  0,  0,  0,  1,
-    0,  0,  0,  1,  1,  2,  3,  4,  0,  0, -1,  0,  0,  0,  2,  3,
-    0, -1, -1, -1, -1, -1,  0,  1,  0, -1, -1, -1, -1, -1, -1,  0,
-    0,  0, -1, -1, -1, -2, -2, -1,  1,  0,  0, -1, -1, -2, -2, -1,
-    2,  2,  1,  0, -1, -1, -1, -1,  3,  3,  2,  1,  0, -1, -1,  0,
-    1,  0,  1,  0,  0, -1, -2, -1,  0,  0,  0,  0, -1, -1, -2, -1,
-    0, -1,  0,  0, -1, -1, -1, -1, -1, -1, -1,  0,  0,  0,  0,  0,
-   -1, -1, -1,  0,  0,  0,  1,  1, -1, -1, -1,  0,  1,  1,  2,  3,
-   -2, -2, -1,  0,  1,  2,  3,  4, -2, -2, -1,  0,  1,  2,  4,  5,
-   -3, -1,  1,  0,  0, -1,  0,  1, -3,  0,  1,  0, -1, -1,  0,  2,
-   -3,  0,  1,  0, -1, -1,  0,  2, -2,  1,  2,  0, -1, -1,  0,  2,
-   -2,  1,  2,  0, -1, -1,  0,  2, -2,  1,  2,  0, -1, -1,  0,  2,
-   -1,  2,  2,  0, -1, -1,  0,  2, -1,  1,  1,  0, -1, -1, -1,  1,
-   -2, -2, -1,  1,  3,  4,  3,  1, -2, -2, -1,  0,  2,  3,  2,  0,
-   -2, -2, -1,  0,  1,  2,  1, -1, -1, -1, -1,  0,  1,  2,  1, -1,
-   -1, -1, -1,  0,  1,  1,  0, -2,  0, -1, -1,  0,  1,  1,  0, -1,
-    0, -1, -1,  0,  1,  1,  1, -1,  0, -1, -1,  0,  0,  1,  0, -1,
-   -2, -1,  0,  1,  1,  1,  1,  1, -2, -1,  0,  0,  0,  0,  0,  0,
-   -2, -1, -1,  0, -1, -1, -2, -2, -2, -1, -1, -1, -1, -2, -2, -3,
-   -1,  0,  1,  1,  0, -1, -2, -2,  1,  2,  3,  3,  2,  1,  0,  0,
-    1,  2,  3,  3,  3,  2,  1,  0,  0,  0,  1,  1,  1,  1,  0,  0,
-    0, -1, -1, -1,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1, -1,  0,  0,  1,  1,  0,  0,  0,
-   -3, -2, -1, -1, -1, -1,  0, -1, -5, -5, -4, -3, -2, -2, -2, -1,
-    1,  1,  1,  1,  2,  1,  0, -1,  1,  1,  1,  2,  1,  1,  0, -1,
-    1,  1,  1,  1,  1,  1,  0, -2,  2,  1,  1,  1,  1,  1,  0, -2,
-    1,  1,  0,  0,  0,  0, -1, -3,  1,  1,  0,  0,  0, -1, -2, -3,
-    1,  1,  0,  0, -1, -1, -2, -4,  1,  0,  0, -1, -2, -2, -3, -4,
-    8,  7,  5,  3,  2,  1,  1,  1,  2,  1,  0,  0, -1, -1, -2, -1,
-   -1, -1, -1, -2, -2, -2, -2, -1, -1, -1, -1, -1,  0, -1, -1,  0,
-    0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  1,  1,  1,  0,  0,  0,
-   -1,  0,  0,  0,  0,  0, -1, -1, -2, -2, -1, -1, -1, -2, -2, -1,
-    9,  4,  0, -2, -2, -2, -1, -1,  7,  2, -1, -2, -2, -1,  0,  0,
-    4,  0, -2, -2, -1,  0,  1,  1,  1, -2, -2, -2, -1,  0,  1,  1,
-   -1, -2, -2, -1,  0,  1,  1,  1, -1, -2, -1,  0,  1,  1,  1,  0,
-   -1, -1,  0,  1,  1,  1,  0, -1,  0, -1,  0,  1,  0,  0, -1, -1,
-    0,  1,  1,  1,  1,  1,  0,  0,  1,  2,  2,  2,  1,  0,  0,  0,
-    2,  2,  2,  2,  1,  0, -1, -1,  1,  1,  1,  0, -1, -2, -2, -2,
-    0,  0,  0, -1, -2, -3, -2, -2, -1, -1, -1, -2, -2, -2, -1,  0,
-   -1, -1, -1, -1,  0,  0,  1,  2, -1, -1, -1,  0,  1,  2,  3,  4,
-   -1, -1,  0,  0, -1, -2, -3, -3, -1, -1,  0,  0,  0, -1, -1, -1,
-   -2, -2, -1,  0,  1,  1,  1,  1, -2, -2, -2,  0,  1,  2,  3,  3,
-   -1, -1, -1,  0,  1,  3,  3,  3,  1,  0,  0,  0,  1,  1,  2,  2,
-    2,  2,  1,  0,  0, -1, -1, -1,  3,  2,  1,  0, -1, -2, -3, -3,
-   -1, -1, -1, -2, -2, -3, -4, -5,  0,  0,  0, -1, -1, -3, -3, -4,
-    1,  1,  1,  0,  0, -1, -2, -3,  2,  2,  2,  1,  1,  0, -1, -1,
-    2,  2,  2,  2,  1,  1,  0, -1,  2,  2,  2,  2,  2,  1,  0,  0,
-    1,  1,  2,  1,  1,  1,  0,  0,  0,  0,  1,  1,  0,  0,  0, -1,
-   -2,  2,  3,  1, -1,  1,  1, -1, -3,  2,  3,  0, -1,  1,  1, -1,
-   -3,  2,  3,  0, -1,  1,  1, -1, -4,  2,  3,  0, -1,  1,  1, -2,
-   -4,  1,  3,  0, -1,  1,  1, -2, -4,  1,  3, -1, -2,  1,  1, -2,
-   -3,  1,  2,  0, -1,  1,  1, -2, -3,  1,  2,  0, -1,  1,  1, -1,
-   -1, -1, -1, -2, -2, -2, -2, -2,  1,  1,  1,  1,  0,  0,  0,  0,
-    1,  2,  2,  2,  2,  2,  2,  2,  0,  0,  1,  1,  1,  2,  2,  2,
-   -2, -2, -1, -1, -1,  0,  0,  0, -3, -3, -3, -3, -3, -3, -3, -2,
-   -1, -1, -1, -1, -2, -2, -2, -2,  4,  4,  4,  4,  4,  3,  3,  2,
-   -3, -3, -2, -1,  0,  1,  2,  5, -3, -3, -3, -2, -1,  1,  3,  6,
-   -3, -3, -2, -2,  0,  2,  3,  5, -3, -2, -2, -2,  0,  1,  3,  5,
-   -2, -2, -2, -1, -1,  1,  3,  5, -2, -2, -1, -1,  0,  1,  2,  4,
-   -1, -1, -1, -1,  0,  1,  1,  4, -1, -1, -1, -1,  0,  1,  2,  3,
-    0, -1,  0,  1,  1,  0, -1, -1,  0,  0,  0,  1,  2,  0, -1, -1,
-    1,  0, -1,  0,  1,  0,  0,  0,  1, -1, -2, -1,  0,  0,  0,  0,
-    1, -2, -3, -1,  0,  0,  0,  1,  1, -1, -3, -2,  0,  1,  1,  2,
-    1, -1, -2, -1,  0,  1,  1,  2,  2,  0, -1,  0,  1,  1,  2,  2,
-    1,  1,  1,  1,  0,  0,  1,  2, -1,  0,  0, -1,  0,  0,  0,  1,
-   -3, -2, -1, -1, -1,  0,  1,  1, -4, -2, -1,  0,  0,  1,  1,  1,
-   -3, -2,  0,  0,  1,  1,  1,  1, -3, -1,  0,  1,  1,  1,  0,  0,
-   -1,  0,  1,  1,  1,  0,  0, -1,  0,  1,  2,  2,  1,  0,  0, -1,
-   -4, -4, -4, -3, -2, -1, -1, -1, -2, -2, -2, -1,  0,  0,  0,  0,
-   -1,  0,  0,  0,  1,  1,  1,  1,  0,  0,  1,  1,  1,  1,  1,  1,
-    0,  0,  1,  1,  2,  2,  1,  0,  0,  0,  1,  1,  1,  1,  1,  0,
-    0,  0,  0,  1,  1,  1,  1,  0, -1,  0,  0,  1,  1,  1,  0,  0,
-    1,  2,  2,  2,  1, -1, -2, -4,  1,  1,  2,  2,  1,  0, -2, -4,
-    0,  1,  1,  1,  1,  0, -1, -3, -1,  0,  1,  1,  0,  0, -1, -2,
-   -1,  0,  1,  1,  1,  0,  0, -1, -2, -1,  0,  0,  0,  0,  0, -1,
-   -1, -1,  0,  1,  1,  0,  0,  0, -1,  0,  1,  1,  1,  1,  1,  0,
-    2,  2,  0, -1, -2, -1, -1, -2,  1,  1, -1, -2, -2, -1, -1, -2,
-    1,  1, -1, -2, -2,  0,  0, -1,  1,  1,  0, -2, -1,  1,  1,  0,
-    1,  1,  0, -1, -1,  1,  2,  1,  1,  1,  0, -1, -1,  1,  2,  1,
-    1,  1,  0, -1, -1,  1,  1,  1,  1,  1,  0, -1,  0,  1,  1,  1,
-    0,  0, -1, -2, -4, -4, -4, -4,  3,  3,  3,  2,  1,  0,  0,  0,
-    3,  3,  3,  3,  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  1,
-   -1, -1, -1, -1, -1, -1, -1,  0,  0, -1,  0,  0, -1,  0,  0,  0,
-    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1, -1,  0,
-   -1, -1,  0, -1, -1,  1,  2, -1,  1,  1,  0,  0,  0,  2,  3, -1,
-    1,  1,  0, -1, -1,  1,  3, -1,  1,  1,  0, -2, -2,  0,  1, -2,
-    1,  0,  0, -2, -2,  0,  1, -3,  0,  0,  0,  0, -1,  1,  1, -3,
-    0,  1,  1,  0,  1,  2,  1, -3, -1,  0,  1,  1,  1,  2,  1, -4,
-   -4, -3,  0,  1,  1,  1,  0,  0, -4, -2,  0,  1,  1,  1,  0, -1,
-   -3, -1,  1,  1,  1,  0, -1, -1, -1,  1,  1,  1,  1,  0, -1,  0,
-    1,  2,  2,  1,  0, -1,  0,  0,  2,  2,  1,  0, -1, -1,  0,  1,
-    2,  1,  0, -1, -2, -1,  0,  1,  2,  2,  0, -1, -2, -1,  1,  1,
-    1,  1,  0,  0, -1, -1, -1, -1,  0, -1, -1, -1, -1, -1, -1, -1,
-   -1, -1, -1, -1, -1, -1, -1, -1,  0,  0, -1, -1, -1, -1, -1, -1,
-    1,  0,  0, -1, -1, -1, -1, -1,  2,  1,  0,  0, -1, -1, -1, -1,
-    5,  3,  2,  1,  0,  0,  0,  0,  6,  5,  3,  2,  1,  0,  0,  0,
-    4,  4,  3,  1,  0,  0,  0,  1,  3,  3,  2,  1,  0,  0,  0,  1,
-    2,  2,  1,  0, -1, -1,  0,  1,  0,  0,  0, -1, -1, -1,  0,  1,
-    0,  0, -1, -1, -2, -1,  0,  2,  0, -1, -1, -2, -2, -2,  0,  1,
-    0, -1, -1, -2, -2, -2, -1,  0,  0,  0, -1, -2, -2, -2, -1,  0,
-    0,  0, -1, -1, -1,  0,  2,  3,  0, -1, -2, -2, -1, -1,  1,  2,
-    1,  0, -1, -1, -1,  0,  0,  0,  1,  1,  1,  0,  0,  0, -1, -1,
-    1,  2,  1,  0,  0, -1, -1, -1, -1,  0,  0,  0, -1, -1, -1, -1,
-   -3, -2, -1, -1,  0,  1,  1,  2, -4, -3, -1,  1,  2,  3,  5,  5,
-    0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  1,  1,  1,
-    0,  0,  0, -1,  0,  0,  0,  1, -1, -1, -2, -2, -2, -1, -1,  0,
-    0,  0,  0,  0,  0,  1,  1,  1,  2,  2,  2,  2,  2,  3,  3,  3,
-    1,  1,  1,  1,  2,  2,  1,  1, -4, -3, -4, -4, -4, -4, -3, -3,
-   -1,  0,  1,  2,  2,  3,  3,  3, -1, -1, -1, -1,  0,  0,  0,  0,
-    0,  0, -1, -2, -2, -3, -3, -2,  3,  2,  1,  0, -1, -2, -2, -2,
-    4,  3,  2,  1,  1,  0,  0,  0,  2,  2,  1,  1,  0,  1,  1,  1,
-    0, -1, -1, -1, -1,  0,  0,  1, -2, -2, -2, -2, -2, -1,  0,  0,
-    1, -1,  0,  2,  1, -2, -1,  1,  1, -1,  0,  2,  1, -2, -2,  1,
-    1, -1,  0,  3,  2, -2, -1,  1,  0, -2,  0,  3,  2, -2, -2,  1,
-    0, -2,  0,  3,  2, -2, -2,  1,  0, -2,  0,  3,  1, -2, -1,  1,
-    0, -2,  0,  2,  1, -2, -2,  1,  0, -1,  0,  2,  1, -2, -1,  1,
-    0,  1,  2,  2,  3,  3,  2,  2,  0,  1,  1,  2,  3,  3,  2,  1,
-    0,  0,  1,  2,  2,  2,  2,  1, -1,  0,  0,  1,  1,  1,  1,  1,
-   -1, -1,  0,  0,  0,  0,  0,  0, -1, -1, -1, -1, -1, -1, -1, -1,
-   -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -2, -2, -2, -2, -2, -1,
-    0,  0, -1, -2, -1,  0,  3,  5,  0,  0, -1, -1, -1,  0,  2,  4,
-    1,  1,  0,  0, -1, -1,  1,  2,  1,  2,  1,  1,  0, -1, -1,  0,
-    0,  1,  2,  1,  0, -1, -2, -2, -1,  0,  1,  2,  1,  0, -3, -3,
-   -2, -1,  1,  2,  2,  0, -2, -4, -2, -1,  0,  2,  2,  1, -1, -3,
-    0,  0,  0,  0,  0,  0, -1, -1,  0,  0, -1,  0,  0,  0,  0,  0,
-   -1, -1, -1, -1,  0,  0,  0,  0, -1, -1, -1, -1, -1, -1, -1,  0,
-   -1, -1, -1, -1, -1, -1, -1,  0, -1,  0,  0,  0,  0, -1, -1,  0,
-    0,  0,  1,  1,  0,  0,  0,  1,  3,  3,  3,  4,  3,  3,  3,  3,
-    5,  1, -2, -2,  0,  0,  0, -1,  4, -1, -3, -1,  0,  0,  0, -1,
-    3, -1, -1,  0,  1,  1,  0, -1,  2,  0,  0,  1,  1,  1,  0, -2,
-    1,  0,  0,  1,  1,  1,  0, -2,  0, -1, -1, -1,  0,  0,  0, -1,
-    0, -1, -1, -1, -1,  0,  0, -1,  2,  1,  0,  0,  0,  1,  0,  0,
-    1,  0,  1,  1,  1,  1,  0,  0,  1,  0,  0,  1,  1,  0,  0,  0,
-    1, -1, -1,  0,  0,  0,  0,  0,  2,  0, -1, -1, -1, -1, -1,  0,
-    3,  1, -1, -1, -2, -2, -2, -1,  4,  2,  1,  0, -1, -2, -2, -1,
-    2,  1,  0,  0, -1, -1,  0,  0,  0, -1, -1, -1, -1,  0,  1,  1,
-    0,  1,  2,  2,  2,  1, -1, -3,  0,  0,  1,  1,  1,  0, -1, -2,
-    0,  0,  0,  0,  0,  0, -1, -1,  0,  0, -1,  0,  0,  1,  1,  0,
-    0,  0, -1,  0,  1,  1,  1,  1,  0,  0,  0,  0,  1,  1,  1,  0,
-    0,  0,  1,  1,  2,  1, -1, -3,  0,  0,  0,  1,  1, -1, -4, -5,
-   -2, -2, -2, -1,  0,  2,  2,  2,  0,  0,  0,  0,  1,  1,  1,  0,
-    1,  1,  1,  1,  1,  0, -2, -3,  0,  0,  1,  1,  0, -1, -3, -4,
-   -1, -1,  0,  1,  0,  0, -2, -3, -1, -1,  0,  1,  1,  1,  0, -1,
-    0,  0,  0,  1,  1,  1,  1,  0,  1,  1,  1,  1,  0,  0,  0,  0,
-    0,  1,  0,  0,  1,  1,  1,  2,  1,  2,  0,  0,  0,  0, -1,  1,
-    0,  2,  0, -1,  1,  0, -1,  0,  0,  1,  0,  0,  2,  1,  0,  1,
-    0,  1, -1,  0,  2,  2,  0,  1, -1,  0, -1, -1,  2,  1,  1,  2,
-   -2, -2, -3, -2,  0,  1,  1,  1, -2, -2, -3, -3, -1, -1, -1,  0,
-   -3, -1,  0,  1,  2,  1,  1,  0, -3, -1,  0,  1,  2,  1,  1,  1,
-   -2,  0,  0,  1,  1,  1,  1,  1, -1,  0,  0,  0,  0,  0,  0,  0,
-   -2,  0,  0,  0,  0, -1, -1,  0, -2,  0,  0,  0,  0,  0, -1, -1,
-   -3,  0,  1,  1,  1,  1,  0,  1, -5, -2,  0,  1,  2,  2,  1,  2,
-   -2, -1, -1,  0,  0,  1,  2,  3,  0,  0,  1,  1,  0,  0,  1,  2,
-    0,  0,  1,  0, -1, -1,  0,  1, -1, -1, -1, -1, -2, -2, -1,  0,
-   -2, -2, -2, -2, -2, -1,  0,  1,  0,  0,  0, -1,  0,  1,  2,  2,
-    2,  1,  0,  0,  0,  1,  2,  2,  2,  1,  0, -1, -1, -1,  0,  0,
-    0,  1,  1,  1,  1,  1, -1, -4, -1, -1,  0,  1,  1,  1,  0, -3,
-   -2, -1,  0,  0,  1,  2,  2, -2, -1,  0,  0,  0,  0,  2,  3, -1,
-   -1,  0,  0,  0,  0,  1,  2,  0,  0,  0, -1, -2, -1,  1,  1,  0,
-    0,  0, -1, -2, -2,  0,  2,  1,  0,  0, -1, -2, -1,  1,  2,  2,
-    1,  0,  0,  0, -2, -3, -2, -3,  0,  0,  1,  0, -2, -2, -1, -1,
-    0, -1,  1,  1, -1, -1,  0,  0,  0, -1,  1,  1, -1, -1,  0,  0,
-    0,  1,  2,  1, -1, -1,  0,  1,  1,  2,  3,  2,  0,  0,  1,  2,
-   -1,  0,  2,  1,  0,  0,  2,  3, -2, -1,  0,  0, -1,  0,  1,  2,
-    1,  1,  0, -1, -2, -2, -1,  1,  1,  1,  1, -1, -2, -2,  0,  2,
-    1,  1,  1, -1, -1, -1,  0,  2,  0,  0,  0,  0,  0,  0,  1,  2,
-   -1, -1, -1,  0,  0,  0,  1,  2, -1, -2, -1,  1,  1,  1,  0,  0,
-   -1, -2, -1,  1,  2,  2,  0, -1, -1, -2, -1,  2,  2,  2,  0, -1,
-   -1, -1, -1, -2, -1, -1,  0,  1,  0,  0, -1, -1, -1,  0,  1,  2,
-    1,  0,  0,  0,  0,  1,  1,  2,  1,  1,  0,  0,  1,  1,  1,  1,
-    1,  1,  0,  1,  1,  0,  1,  1,  1,  1,  1,  1,  0, -1, -1, -1,
-    1,  2,  1,  0, -1, -2, -2, -3,  2,  2,  1,  0, -2, -3, -4, -4,
-   -4, -2,  1,  1,  1,  1,  0,  0, -2,  0,  1,  0,  0,  0,  0,  0,
-    0,  1,  1, -2, -2, -1,  0,  1,  2,  2,  1, -2, -2, -1,  1,  2,
-    1,  2,  1, -2, -2, -1,  1,  2, -1,  1,  1, -1, -1, -1,  0,  1,
-   -2,  0,  1,  1,  0, -1, -1,  0, -2,  0,  2,  2,  1, -1, -1,  0,
-    1,  1,  0,  0,  0,  1,  0,  0, -2, -3, -3, -2, -2, -1,  0,  0,
-   -3, -4, -3, -2, -1,  0,  0,  0, -1, -1,  0,  1,  2,  3,  2,  1,
-    0,  1,  2,  3,  3,  3,  2,  1,  1,  1,  1,  2,  1,  0,  0, -1,
-    0,  0,  0,  0, -1, -1, -1, -1,  0, -1, -1,  0,  0,  0,  0,  0,
-    1,  1,  0,  0, -1, -1,  0,  2,  0,  0,  1,  0, -1, -1,  1,  1,
-   -2, -1,  0,  1,  1,  1,  1,  1, -3, -3,  0,  2,  2,  1,  1,  0,
-   -2, -2,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0, -1, -1,
-    3,  1, -1, -3, -2, -1,  0,  1,  4,  2, -1, -3, -3, -1,  1,  2,
-    0,  0,  0, -1, -1, -1, -1, -1,  1,  2,  1,  0,  0,  0, -1, -1,
-    2,  3,  3,  2,  1,  0, -1, -1,  3,  4,  4,  2,  1,  0, -1, -2,
-    3,  3,  2,  1,  0, -1, -2, -2,  1,  1,  0, -1, -1, -2, -2, -3,
-    0,  0,  0, -1, -1, -2, -2, -2, -1, -1, -1, -1, -1, -2, -2, -1,
-    1,  2,  2,  2,  2,  1,  2,  2,  0,  1,  1,  1,  1,  0,  0,  0,
-    0,  0,  0,  1,  1,  0, -1, -2,  0,  0,  0,  0,  1,  0, -1, -4,
-    1,  0,  0,  0,  0,  0, -2, -5,  1,  0,  0,  0,  0,  0, -1, -4,
-    1,  0, -1,  0,  0,  0, -1, -3,  0, -1, -1,  0,  1,  1,  1, -1,
-   -2, -1,  0,  0, -1, -1, -1, -2, -1,  0,  0,  0, -1, -1, -2, -2,
-    0,  1,  1,  0, -1, -1, -1, -2,  0,  1,  1,  0,  0,  0, -1, -1,
-    0,  1,  0,  0,  1,  1,  1,  0,  1,  1,  0,  0,  1,  2,  2,  1,
-    1,  1,  0,  0,  1,  2,  2,  1,  1,  1,  0, -1,  0,  1,  1,  0,
-    4,  2,  1,  0,  0,  1,  1,  1,  4,  2,  1,  0,  0,  0,  0,  1,
-    3,  1,  0,  0, -1, -1, -1,  0,  1,  0,  0, -1, -1, -2, -1,  0,
-    0,  0,  0,  0, -1, -1, -1,  0, -1, -1,  0,  0, -1, -1,  0,  1,
-   -2, -1,  0, -1, -1,  0,  0,  1, -2, -2, -1, -2, -1,  0,  0,  1,
-    0,  1,  1,  1,  2,  1,  0, -1, -1, -1, -1,  0,  0, -1, -2, -2,
-   -1,  0, -1,  0,  0, -1, -2, -1,  0,  0,  0,  0,  0,  0,  1,  2,
-    0,  0,  0,  0,  0,  0,  2,  3, -1,  0, -1, -1, -1, -1,  0,  3,
-   -1,  0,  0, -1, -1, -2,  0,  3,  0,  0,  0,  0, -1, -1,  1,  4,
-    2,  2,  0,  0,  0,  0,  0,  1,  1,  1, -1, -2, -1, -2, -1,  1,
-   -1, -1, -2, -2, -2, -3, -2,  0, -1,  0, -1, -1, -1, -2, -1,  1,
-    1,  1,  0,  0,  1,  0,  0,  1,  2,  2,  0,  0,  1,  0,  0,  1,
-    2,  2,  0,  0,  0,  0, -1, -1,  2,  2,  0,  0,  1,  0, -1, -1,
-   -1,  0,  1,  1,  0, -1, -1, -1,  1,  2,  3,  2,  1,  0,  0,  0,
-    0,  1,  1,  1,  0, -1,  0,  0, -2, -2, -1,  0,  1,  0,  0,  0,
-   -2, -2, -1,  2,  2,  2,  1,  0, -2, -1,  0,  1,  1,  0,  0, -1,
-   -1, -1,  0,  0, -1, -2, -1, -2,  0,  1,  1,  1,  0,  0,  1,  1,
-   -3, -3, -3, -2, -1, -1, -2, -2, -1, -1,  0,  1,  2,  1,  0,  0,
-    1,  1,  1,  2,  2,  1,  0,  0,  1,  1,  1,  1,  1,  0, -1,  1,
-    1,  0, -1, -1,  0,  0, -1,  1,  0, -1, -1, -1,  0, -1, -1,  1,
-    1,  0, -1,  0,  0, -1,  0,  2,  2,  0, -1,  0,  0,  0,  0,  2,
-    1,  0, -2, -1,  0,  1,  1,  0,  2,  0, -1, -1,  0,  1,  1,  0,
-    1,  0, -2, -1,  0,  1,  0, -1,  1,  0, -1, -1,  0,  1,  0, -1,
-    0,  1,  1,  0,  1,  1,  0,  0, -2,  1,  2,  1,  0,  0,  0,  1,
-   -5,  0,  2,  1,  0, -1,  0,  1, -6, -1,  2,  1,  0, -1,  0,  0,
-    5,  3,  0, -1, -2, -1, -1, -1,  1,  1,  0, -1, -1,  0, -1, -1,
-   -1,  0,  1,  1,  2,  2,  1,  0, -2, -1,  0,  1,  2,  1,  1,  1,
-   -2, -1, -1, -1,  0, -1,  0,  1,  0,  1,  0,  0, -1, -1,  0,  0,
-    0,  1,  1,  1,  1,  0,  0,  0, -3, -2,  0,  1,  1,  0,  0, -1,
-   -1,  0,  1,  0, -1,  0,  2,  3, -1,  0,  0, -2, -4, -2, -1,  0,
-    0,  1,  1,  0, -2, -1,  0, -1,  1,  2,  3,  1,  0,  1,  1,  0,
-   -1,  0,  1,  1,  1,  1,  1,  0, -2, -3, -2,  0,  0,  0,  1,  0,
-   -1, -2, -2,  0,  1,  0,  0, -1,  3,  1,  0,  0,  1,  0, -1, -1,
-   -2, -1,  0,  0, -1, -1,  0,  0, -1,  0,  0,  0,  0,  1,  1,  1,
-   -1, -1, -1,  0,  1,  1,  1,  1,  0, -2, -3, -1,  1,  0,  0,  0,
-    1, -1, -3, -1,  1,  1,  0, -1,  3,  1, -1,  1,  2,  2,  0, -1,
-    3,  1,  0,  1,  2,  1,  1,  0,  0, -2, -2, -1, -1,  0,  0,  0,
-    1,  0, -1, -1,  1,  2,  1,  0,  0, -1, -2, -1,  1,  2,  2,  1,
-   -1, -1, -1,  0,  0,  1,  2,  0, -2,  0,  0,  0,  0,  0,  1, -1,
-   -1,  0,  1,  0, -1, -1, -1, -1,  0,  1,  1,  2,  0, -2, -1,  0,
-    1,  2,  2,  2,  1, -1, -1,  0,  0,  1,  1,  1,  0, -2, -2, -1,
-    0,  0, -1, -1, -1, -1, -2, -2,  0,  0, -1,  0,  1,  2,  2,  1,
-    0,  0, -1, -1,  0,  1,  2,  2,  1,  1, -1, -2, -1, -1, -1, -1,
-    2,  2,  1,  0,  0, -1, -2, -2,  1,  2,  2,  1,  0,  0, -2, -2,
-    0,  0,  0,  0,  1,  1,  0, -1,  0, -1, -1, -1,  2,  3,  2,  1,
-    0, -2,  1,  2, -1,  0,  0,  1, -1, -2,  2,  3, -1,  0,  0,  0,
-    0, -2,  2,  3, -1, -1,  0,  0,  0, -1,  3,  2, -2,  0,  1,  0,
-    0, -1,  3,  1, -2,  0,  1,  0,  0, -1,  2,  1, -1,  1,  0, -1,
-    0,  0,  1, -1, -2,  0,  0, -1,  1,  0,  0, -2, -2, -1, -1, -1,
-    1,  1,  1,  1,  1, -1, -1, -2,  0,  0,  0,  1,  1,  1,  1,  1,
-    0,  0,  0,  1,  1,  1,  2,  3,  1,  0,  0, -1,  0,  0,  1,  2,
-    0, -1, -1, -2, -1,  0,  1,  2, -2, -2, -2, -2, -1,  0,  1,  1,
-   -1, -1, -1, -1,  0,  0,  0, -1,  2,  2,  2,  0, -1, -1, -2, -4,
-   -1, -2, -1, -1,  0,  1,  2,  3, -1, -1, -1, -1,  0,  1,  2,  3,
-    1,  0, -1,  0, -1,  0,  1,  2,  1,  0,  0,  0, -1,  0,  2,  2,
-    1,  0, -1, -1, -2,  0,  1,  2,  0, -2, -2, -2, -3, -1,  0,  1,
-    0, -2, -2, -2, -2, -1,  1,  1,  0,  0,  0,  0,  0,  1,  2,  2
-};
-
-/* list of codebooks for intra-coded vectors */
-const int8_t* const ff_svq1_intra_codebooks[6] = {
-    svq1_intra_codebook_4x2, svq1_intra_codebook_4x4,
-    svq1_intra_codebook_8x4, svq1_intra_codebook_8x8,
-    NULL, NULL,
-};
-
-#endif /* AVCODEC_SVQ1_CB_H */
diff --git a/deps/libav/libavcodec/svq1_vlc.h b/deps/libav/libavcodec/svq1_vlc.h
deleted file mode 100644
index 834279d..0000000
--- a/deps/libav/libavcodec/svq1_vlc.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SVQ1_VLC_H
-#define AVCODEC_SVQ1_VLC_H
-
-#include <stdint.h>
-
-/* values in this table range from 0..3; adjust retrieved value by +0 */
-const uint8_t ff_svq1_block_type_vlc[4][2] = {
-    /* { code, length } */
-    { 0x1, 1 },  { 0x1, 2 },  { 0x1, 3 },  { 0x0, 3 }
-};
-
-/* values in this table range from -1..6; adjust retrieved value by -1 */
-const uint8_t ff_svq1_intra_multistage_vlc[6][8][2] = {
-    /* { code, length } */
-    { { 0x1, 5 },  { 0x1, 1 },  { 0x3, 3 },  { 0x2, 3 },
-      { 0x3, 4 },  { 0x2, 4 },  { 0x0, 5 },  { 0x1, 4 } },
-    { { 0x1, 4 },  { 0x3, 2 },  { 0x5, 3 },  { 0x4, 3 },
-      { 0x3, 3 },  { 0x2, 3 },  { 0x0, 4 },  { 0x1, 3 } },
-    { { 0x1, 5 },  { 0x1, 1 },  { 0x3, 3 },  { 0x0, 5 },
-      { 0x3, 4 },  { 0x2, 3 },  { 0x2, 4 },  { 0x1, 4 } },
-    { { 0x1, 6 },  { 0x1, 1 },  { 0x1, 2 },  { 0x0, 6 },
-      { 0x3, 4 },  { 0x2, 4 },  { 0x1, 5 },  { 0x1, 4 } },
-    { { 0x1, 6 },  { 0x1, 1 },  { 0x1, 2 },  { 0x3, 5 },
-      { 0x2, 5 },  { 0x0, 6 },  { 0x1, 5 },  { 0x1, 3 } },
-    { { 0x1, 7 },  { 0x1, 1 },  { 0x1, 2 },  { 0x1, 3 },
-      { 0x1, 4 },  { 0x1, 6 },  { 0x0, 7 },  { 0x1, 5 } }
-};
-
-/* values in this table range from -1..6; adjust retrieved value by -1 */
-const uint8_t ff_svq1_inter_multistage_vlc[6][8][2] = {
-    /* { code, length } */
-    { { 0x3, 2 },  { 0x5, 3 },  { 0x4, 3 },  { 0x3, 3 },
-      { 0x2, 3 },  { 0x1, 3 },  { 0x1, 4 },  { 0x0, 4 } },
-    { { 0x3, 2 },  { 0x5, 3 },  { 0x4, 3 },  { 0x3, 3 },
-      { 0x2, 3 },  { 0x1, 3 },  { 0x1, 4 },  { 0x0, 4 } },
-    { { 0x1, 1 },  { 0x3, 3 },  { 0x2, 3 },  { 0x3, 4 },
-      { 0x2, 4 },  { 0x1, 4 },  { 0x1, 5 },  { 0x0, 5 } },
-    { { 0x1, 1 },  { 0x3, 3 },  { 0x2, 3 },  { 0x3, 4 },
-      { 0x2, 4 },  { 0x1, 4 },  { 0x1, 5 },  { 0x0, 5 } },
-    { { 0x1, 1 },  { 0x3, 3 },  { 0x2, 3 },  { 0x3, 4 },
-      { 0x2, 4 },  { 0x1, 4 },  { 0x1, 5 },  { 0x0, 5 } },
-    { { 0x1, 1 },  { 0x1, 2 },  { 0x1, 3 },  { 0x3, 5 },
-      { 0x2, 5 },  { 0x1, 5 },  { 0x1, 6 },  { 0x0, 6 } }
-};
-
-/* values in this table range from 0..255; adjust retrieved value by +0 */
-const uint16_t ff_svq1_intra_mean_vlc[256][2] = {
-    /* { code, length } */
-    { 0x37,  6 },  { 0x56,  7 },  { 0x01, 17 },  { 0x01, 20 },
-    { 0x02, 20 },  { 0x03, 20 },  { 0x00, 20 },  { 0x04, 20 },
-    { 0x05, 20 },  { 0x03, 19 },  { 0x15, 11 },  { 0x42,  9 },
-    { 0x14, 11 },  { 0x03, 14 },  { 0x02, 14 },  { 0x01, 15 },
-    { 0x01, 16 },  { 0x01, 12 },  { 0x2B, 10 },  { 0x18, 11 },
-    { 0x0C, 11 },  { 0x41,  9 },  { 0x78,  8 },  { 0x6C,  8 },
-    { 0x55,  7 },  { 0x0F,  4 },  { 0x0E,  4 },  { 0x34,  6 },
-    { 0x51,  7 },  { 0x72,  8 },  { 0x6E,  8 },  { 0x40,  9 },
-    { 0x3F,  9 },  { 0x3E,  9 },  { 0x3D,  9 },  { 0x3C,  9 },
-    { 0x3B,  9 },  { 0x3A,  9 },  { 0x39,  9 },  { 0x38,  9 },
-    { 0x37,  9 },  { 0x43,  9 },  { 0x46,  9 },  { 0x47,  9 },
-    { 0x45,  9 },  { 0x44,  9 },  { 0x49,  9 },  { 0x48,  9 },
-    { 0x4A,  8 },  { 0x79,  8 },  { 0x76,  8 },  { 0x77,  8 },
-    { 0x71,  8 },  { 0x75,  8 },  { 0x74,  8 },  { 0x73,  8 },
-    { 0x6A,  8 },  { 0x55,  8 },  { 0x70,  8 },  { 0x6F,  8 },
-    { 0x52,  8 },  { 0x6D,  8 },  { 0x4C,  8 },  { 0x6B,  8 },
-    { 0x40,  7 },  { 0x69,  8 },  { 0x68,  8 },  { 0x67,  8 },
-    { 0x66,  8 },  { 0x65,  8 },  { 0x64,  8 },  { 0x63,  8 },
-    { 0x62,  8 },  { 0x61,  8 },  { 0x60,  8 },  { 0x5F,  8 },
-    { 0x5E,  8 },  { 0x5D,  8 },  { 0x5C,  8 },  { 0x5B,  8 },
-    { 0x5A,  8 },  { 0x59,  8 },  { 0x58,  8 },  { 0x57,  8 },
-    { 0x56,  8 },  { 0x3D,  7 },  { 0x54,  8 },  { 0x53,  8 },
-    { 0x3F,  7 },  { 0x51,  8 },  { 0x50,  8 },  { 0x4F,  8 },
-    { 0x4E,  8 },  { 0x4D,  8 },  { 0x41,  7 },  { 0x4B,  8 },
-    { 0x53,  7 },  { 0x3E,  7 },  { 0x48,  8 },  { 0x4F,  7 },
-    { 0x52,  7 },  { 0x45,  8 },  { 0x50,  7 },  { 0x43,  8 },
-    { 0x42,  8 },  { 0x41,  8 },  { 0x42,  7 },  { 0x43,  7 },
-    { 0x3E,  8 },  { 0x44,  7 },  { 0x3C,  8 },  { 0x45,  7 },
-    { 0x46,  7 },  { 0x47,  7 },  { 0x48,  7 },  { 0x49,  7 },
-    { 0x4A,  7 },  { 0x4B,  7 },  { 0x4C,  7 },  { 0x4D,  7 },
-    { 0x4E,  7 },  { 0x58,  7 },  { 0x59,  7 },  { 0x5A,  7 },
-    { 0x5B,  7 },  { 0x5C,  7 },  { 0x5D,  7 },  { 0x44,  8 },
-    { 0x49,  8 },  { 0x29,  8 },  { 0x3F,  8 },  { 0x3D,  8 },
-    { 0x3B,  8 },  { 0x2C,  8 },  { 0x28,  8 },  { 0x25,  8 },
-    { 0x26,  8 },  { 0x5E,  7 },  { 0x57,  7 },  { 0x54,  7 },
-    { 0x5F,  7 },  { 0x62,  7 },  { 0x63,  7 },  { 0x64,  7 },
-    { 0x61,  7 },  { 0x65,  7 },  { 0x67,  7 },  { 0x66,  7 },
-    { 0x35,  6 },  { 0x36,  6 },  { 0x60,  7 },  { 0x39,  8 },
-    { 0x3A,  8 },  { 0x38,  8 },  { 0x37,  8 },  { 0x36,  8 },
-    { 0x35,  8 },  { 0x34,  8 },  { 0x33,  8 },  { 0x32,  8 },
-    { 0x31,  8 },  { 0x30,  8 },  { 0x2D,  8 },  { 0x2B,  8 },
-    { 0x2A,  8 },  { 0x27,  8 },  { 0x40,  8 },  { 0x46,  8 },
-    { 0x47,  8 },  { 0x26,  9 },  { 0x25,  9 },  { 0x24,  9 },
-    { 0x23,  9 },  { 0x22,  9 },  { 0x2E,  8 },  { 0x2F,  8 },
-    { 0x1F,  9 },  { 0x36,  9 },  { 0x1D,  9 },  { 0x21,  9 },
-    { 0x1B,  9 },  { 0x1C,  9 },  { 0x19,  9 },  { 0x1A,  9 },
-    { 0x18,  9 },  { 0x17,  9 },  { 0x16,  9 },  { 0x1E,  9 },
-    { 0x20,  9 },  { 0x27,  9 },  { 0x28,  9 },  { 0x29,  9 },
-    { 0x2A,  9 },  { 0x2B,  9 },  { 0x2C,  9 },  { 0x2D,  9 },
-    { 0x2E,  9 },  { 0x2F,  9 },  { 0x30,  9 },  { 0x35,  9 },
-    { 0x31,  9 },  { 0x32,  9 },  { 0x33,  9 },  { 0x34,  9 },
-    { 0x19, 10 },  { 0x2A, 10 },  { 0x17, 10 },  { 0x16, 10 },
-    { 0x15, 10 },  { 0x28, 10 },  { 0x26, 10 },  { 0x25, 10 },
-    { 0x22, 10 },  { 0x21, 10 },  { 0x18, 10 },  { 0x14, 10 },
-    { 0x29, 10 },  { 0x12, 10 },  { 0x0D, 10 },  { 0x0E, 10 },
-    { 0x0F, 10 },  { 0x10, 10 },  { 0x11, 10 },  { 0x1A, 10 },
-    { 0x1B, 10 },  { 0x1C, 10 },  { 0x1D, 10 },  { 0x1E, 10 },
-    { 0x1F, 10 },  { 0x20, 10 },  { 0x13, 10 },  { 0x23, 10 },
-    { 0x24, 10 },  { 0x09, 11 },  { 0x08, 11 },  { 0x07, 11 },
-    { 0x27, 10 },  { 0x05, 11 },  { 0x0B, 11 },  { 0x06, 11 },
-    { 0x04, 11 },  { 0x03, 11 },  { 0x02, 11 },  { 0x01, 11 },
-    { 0x0A, 11 },  { 0x16, 11 },  { 0x19, 11 },  { 0x17, 11 },
-    { 0x0D, 11 },  { 0x0E, 11 },  { 0x0F, 11 },  { 0x10, 11 },
-    { 0x11, 11 },  { 0x12, 11 },  { 0x13, 11 },  { 0x01, 14 }
-};
-
-/* values in this table range from -256..255; adjust retrieved value by -256 */
-const uint16_t ff_svq1_inter_mean_vlc[512][2] = {
-    /* { code, length } */
-    { 0x5A, 22 },  { 0xD4, 22 },  { 0xD5, 22 },  { 0xD6, 22 },
-    { 0xD7, 22 },  { 0xD8, 22 },  { 0xD9, 22 },  { 0xDA, 22 },
-    { 0xDB, 22 },  { 0xDC, 22 },  { 0xDD, 22 },  { 0xDE, 22 },
-    { 0xDF, 22 },  { 0xE0, 22 },  { 0xE1, 22 },  { 0xE2, 22 },
-    { 0xE3, 22 },  { 0xE4, 22 },  { 0xE5, 22 },  { 0xE6, 22 },
-    { 0xE8, 22 },  { 0xCB, 22 },  { 0xE9, 22 },  { 0xEA, 22 },
-    { 0xE7, 22 },  { 0xEC, 22 },  { 0xED, 22 },  { 0xEE, 22 },
-    { 0xEF, 22 },  { 0xF0, 22 },  { 0xF1, 22 },  { 0xF2, 22 },
-    { 0xF3, 22 },  { 0xF4, 22 },  { 0xF5, 22 },  { 0xF6, 22 },
-    { 0xF7, 22 },  { 0xF8, 22 },  { 0x102,22 },  { 0xEB, 22 },
-    { 0xF9, 22 },  { 0xFC, 22 },  { 0xFD, 22 },  { 0xFE, 22 },
-    { 0x100,22 },  { 0x5C, 22 },  { 0x60, 22 },  { 0x101,22 },
-    { 0x71, 22 },  { 0x104,22 },  { 0x105,22 },  { 0xFB, 22 },
-    { 0xFF, 22 },  { 0x86, 21 },  { 0xFA, 22 },  { 0x7C, 22 },
-    { 0x75, 22 },  { 0x103,22 },  { 0x78, 22 },  { 0xD3, 22 },
-    { 0x7B, 22 },  { 0x82, 22 },  { 0xD2, 22 },  { 0xD1, 22 },
-    { 0xD0, 22 },  { 0xCF, 22 },  { 0xCE, 22 },  { 0xCD, 22 },
-    { 0xCC, 22 },  { 0xC3, 22 },  { 0xCA, 22 },  { 0xC9, 22 },
-    { 0xC8, 22 },  { 0xC7, 22 },  { 0xC6, 22 },  { 0xC5, 22 },
-    { 0x8B, 22 },  { 0xC4, 22 },  { 0xC2, 22 },  { 0xC1, 22 },
-    { 0xC0, 22 },  { 0xBF, 22 },  { 0xBE, 22 },  { 0xBD, 22 },
-    { 0xBC, 22 },  { 0xBB, 22 },  { 0xBA, 22 },  { 0xB9, 22 },
-    { 0x61, 22 },  { 0x84, 22 },  { 0x85, 22 },  { 0x86, 22 },
-    { 0x87, 22 },  { 0x88, 22 },  { 0x89, 22 },  { 0x8A, 22 },
-    { 0x8C, 22 },  { 0x8D, 22 },  { 0x8E, 22 },  { 0x8F, 22 },
-    { 0x90, 22 },  { 0x91, 22 },  { 0x92, 22 },  { 0x93, 22 },
-    { 0x94, 22 },  { 0x95, 22 },  { 0x96, 22 },  { 0x97, 22 },
-    { 0x98, 22 },  { 0x99, 22 },  { 0x9A, 22 },  { 0x9B, 22 },
-    { 0x9C, 22 },  { 0x9D, 22 },  { 0x9E, 22 },  { 0x9F, 22 },
-    { 0xA0, 22 },  { 0xA1, 22 },  { 0xA2, 22 },  { 0xA3, 22 },
-    { 0xA4, 22 },  { 0xA5, 22 },  { 0xA6, 22 },  { 0xA7, 22 },
-    { 0xA8, 22 },  { 0xA9, 22 },  { 0xAA, 22 },  { 0xAB, 22 },
-    { 0x7F, 22 },  { 0x8F, 21 },  { 0xAC, 22 },  { 0xAD, 22 },
-    { 0xAE, 22 },  { 0xAF, 22 },  { 0xB0, 22 },  { 0xB1, 22 },
-    { 0x53, 20 },  { 0x90, 21 },  { 0xB2, 22 },  { 0x91, 21 },
-    { 0xB3, 22 },  { 0xB4, 22 },  { 0x54, 20 },  { 0xB5, 22 },
-    { 0xB6, 22 },  { 0x8C, 21 },  { 0x34, 19 },  { 0x3D, 18 },
-    { 0x55, 20 },  { 0xB7, 22 },  { 0xB8, 22 },  { 0x8B, 21 },
-    { 0x56, 20 },  { 0x3D, 19 },  { 0x57, 20 },  { 0x58, 20 },
-    { 0x40, 19 },  { 0x43, 19 },  { 0x47, 19 },  { 0x2A, 18 },
-    { 0x2E, 19 },  { 0x2C, 18 },  { 0x46, 19 },  { 0x59, 20 },
-    { 0x49, 19 },  { 0x2D, 19 },  { 0x38, 18 },  { 0x36, 18 },
-    { 0x39, 18 },  { 0x45, 19 },  { 0x28, 18 },  { 0x30, 18 },
-    { 0x35, 18 },  { 0x20, 17 },  { 0x44, 19 },  { 0x32, 18 },
-    { 0x31, 18 },  { 0x1F, 17 },  { 0x2F, 18 },  { 0x2E, 18 },
-    { 0x2D, 18 },  { 0x21, 17 },  { 0x22, 17 },  { 0x23, 17 },
-    { 0x24, 17 },  { 0x27, 16 },  { 0x23, 16 },  { 0x20, 16 },
-    { 0x1D, 16 },  { 0x25, 16 },  { 0x1E, 16 },  { 0x24, 16 },
-    { 0x2A, 16 },  { 0x26, 16 },  { 0x21, 15 },  { 0x29, 16 },
-    { 0x22, 15 },  { 0x23, 15 },  { 0x24, 15 },  { 0x1B, 15 },
-    { 0x1A, 15 },  { 0x1D, 15 },  { 0x1F, 15 },  { 0x27, 15 },
-    { 0x17, 14 },  { 0x18, 14 },  { 0x19, 14 },  { 0x1B, 14 },
-    { 0x1C, 14 },  { 0x1E, 14 },  { 0x25, 14 },  { 0x20, 14 },
-    { 0x21, 14 },  { 0x13, 13 },  { 0x14, 13 },  { 0x15, 13 },
-    { 0x16, 13 },  { 0x17, 13 },  { 0x18, 13 },  { 0x19, 13 },
-    { 0x1A, 13 },  { 0x18, 12 },  { 0x17, 12 },  { 0x15, 12 },
-    { 0x14, 12 },  { 0x13, 12 },  { 0x12, 12 },  { 0x0F, 11 },
-    { 0x10, 11 },  { 0x12, 11 },  { 0x13, 11 },  { 0x1B, 11 },
-    { 0x1A, 11 },  { 0x0E, 10 },  { 0x13, 10 },  { 0x0F, 10 },
-    { 0x10, 10 },  { 0x11, 10 },  { 0x12, 10 },  { 0x0D,  9 },
-    { 0x14,  9 },  { 0x15,  9 },  { 0x0C,  9 },  { 0x13,  9 },
-    { 0x0F,  8 },  { 0x0E,  8 },  { 0x10,  8 },  { 0x11,  8 },
-    { 0x0C,  7 },  { 0x09,  7 },  { 0x0A,  7 },  { 0x08,  6 },
-    { 0x09,  6 },  { 0x09,  5 },  { 0x08,  5 },  { 0x05,  4 },
-    { 0x01,  1 },  { 0x03,  3 },  { 0x07,  5 },  { 0x06,  5 },
-    { 0x0B,  6 },  { 0x0A,  6 },  { 0x0E,  7 },  { 0x0F,  7 },
-    { 0x0B,  7 },  { 0x0D,  7 },  { 0x0B,  8 },  { 0x0D,  8 },
-    { 0x0C,  8 },  { 0x0F,  9 },  { 0x10,  9 },  { 0x11,  9 },
-    { 0x0E,  9 },  { 0x12,  9 },  { 0x17, 10 },  { 0x14, 10 },
-    { 0x16, 10 },  { 0x15, 10 },  { 0x19, 11 },  { 0x18, 11 },
-    { 0x17, 11 },  { 0x16, 11 },  { 0x15, 11 },  { 0x14, 11 },
-    { 0x11, 11 },  { 0x19, 12 },  { 0x1A, 12 },  { 0x16, 12 },
-    { 0x1D, 12 },  { 0x1B, 12 },  { 0x1C, 12 },  { 0x20, 13 },
-    { 0x1C, 13 },  { 0x23, 13 },  { 0x22, 13 },  { 0x21, 13 },
-    { 0x1F, 13 },  { 0x1E, 13 },  { 0x1B, 13 },  { 0x1D, 13 },
-    { 0x24, 14 },  { 0x16, 14 },  { 0x1A, 14 },  { 0x22, 14 },
-    { 0x1D, 14 },  { 0x1F, 14 },  { 0x15, 14 },  { 0x23, 14 },
-    { 0x18, 15 },  { 0x20, 15 },  { 0x29, 15 },  { 0x28, 15 },
-    { 0x26, 15 },  { 0x25, 15 },  { 0x19, 15 },  { 0x1C, 15 },
-    { 0x1E, 15 },  { 0x17, 15 },  { 0x2C, 16 },  { 0x2B, 16 },
-    { 0x1C, 16 },  { 0x21, 16 },  { 0x2D, 16 },  { 0x28, 16 },
-    { 0x1F, 16 },  { 0x1B, 16 },  { 0x1A, 16 },  { 0x22, 16 },
-    { 0x2D, 17 },  { 0x32, 17 },  { 0x2C, 17 },  { 0x27, 17 },
-    { 0x31, 17 },  { 0x33, 17 },  { 0x2F, 17 },  { 0x2B, 17 },
-    { 0x37, 18 },  { 0x2A, 17 },  { 0x2E, 17 },  { 0x30, 17 },
-    { 0x29, 17 },  { 0x28, 17 },  { 0x26, 17 },  { 0x25, 17 },
-    { 0x2F, 19 },  { 0x33, 18 },  { 0x34, 18 },  { 0x30, 19 },
-    { 0x3A, 18 },  { 0x3B, 18 },  { 0x31, 19 },  { 0x3C, 18 },
-    { 0x2B, 18 },  { 0x29, 18 },  { 0x48, 19 },  { 0x27, 18 },
-    { 0x42, 19 },  { 0x41, 19 },  { 0x26, 18 },  { 0x52, 20 },
-    { 0x51, 20 },  { 0x3F, 19 },  { 0x3E, 19 },  { 0x39, 19 },
-    { 0x3C, 19 },  { 0x3B, 19 },  { 0x3A, 19 },  { 0x25, 18 },
-    { 0x38, 19 },  { 0x50, 20 },  { 0x37, 19 },  { 0x36, 19 },
-    { 0x87, 21 },  { 0x4F, 20 },  { 0x35, 19 },  { 0x4E, 20 },
-    { 0x33, 19 },  { 0x32, 19 },  { 0x4D, 20 },  { 0x4C, 20 },
-    { 0x83, 22 },  { 0x4B, 20 },  { 0x81, 22 },  { 0x80, 22 },
-    { 0x8E, 21 },  { 0x7E, 22 },  { 0x7D, 22 },  { 0x84, 21 },
-    { 0x8D, 21 },  { 0x7A, 22 },  { 0x79, 22 },  { 0x4A, 20 },
-    { 0x77, 22 },  { 0x76, 22 },  { 0x89, 21 },  { 0x74, 22 },
-    { 0x73, 22 },  { 0x72, 22 },  { 0x49, 20 },  { 0x70, 22 },
-    { 0x6F, 22 },  { 0x6E, 22 },  { 0x6D, 22 },  { 0x6C, 22 },
-    { 0x6B, 22 },  { 0x6A, 22 },  { 0x69, 22 },  { 0x68, 22 },
-    { 0x67, 22 },  { 0x66, 22 },  { 0x65, 22 },  { 0x64, 22 },
-    { 0x63, 22 },  { 0x62, 22 },  { 0x8A, 21 },  { 0x88, 21 },
-    { 0x5F, 22 },  { 0x5E, 22 },  { 0x5D, 22 },  { 0x85, 21 },
-    { 0x5B, 22 },  { 0x83, 21 },  { 0x59, 22 },  { 0x58, 22 },
-    { 0x57, 22 },  { 0x56, 22 },  { 0x55, 22 },  { 0x54, 22 },
-    { 0x53, 22 },  { 0x52, 22 },  { 0x51, 22 },  { 0x50, 22 },
-    { 0x4F, 22 },  { 0x4E, 22 },  { 0x4D, 22 },  { 0x4C, 22 },
-    { 0x4B, 22 },  { 0x4A, 22 },  { 0x49, 22 },  { 0x48, 22 },
-    { 0x47, 22 },  { 0x46, 22 },  { 0x45, 22 },  { 0x44, 22 },
-    { 0x43, 22 },  { 0x42, 22 },  { 0x41, 22 },  { 0x40, 22 },
-    { 0x3F, 22 },  { 0x3E, 22 },  { 0x3D, 22 },  { 0x3C, 22 },
-    { 0x3B, 22 },  { 0x3A, 22 },  { 0x39, 22 },  { 0x38, 22 },
-    { 0x37, 22 },  { 0x36, 22 },  { 0x35, 22 },  { 0x34, 22 },
-    { 0x33, 22 },  { 0x32, 22 },  { 0x31, 22 },  { 0x30, 22 },
-    { 0x2F, 22 },  { 0x2E, 22 },  { 0x2D, 22 },  { 0x2C, 22 },
-    { 0x2B, 22 },  { 0x2A, 22 },  { 0x29, 22 },  { 0x28, 22 },
-    { 0x27, 22 },  { 0x26, 22 },  { 0x25, 22 },  { 0x24, 22 },
-    { 0x23, 22 },  { 0x22, 22 },  { 0x21, 22 },  { 0x20, 22 },
-    { 0x1F, 22 },  { 0x1E, 22 },  { 0x1D, 22 },  { 0x1C, 22 },
-    { 0x1B, 22 },  { 0x1A, 22 },  { 0x19, 22 },  { 0x18, 22 },
-    { 0x17, 22 },  { 0x16, 22 },  { 0x15, 22 },  { 0x14, 22 },
-    { 0x13, 22 },  { 0x12, 22 },  { 0x11, 22 },  { 0x10, 22 },
-    { 0x0F, 22 },  { 0x0E, 22 },  { 0x0D, 22 },  { 0x0C, 22 },
-    { 0x0B, 22 },  { 0x0A, 22 },  { 0x09, 22 },  { 0x08, 22 },
-    { 0x07, 22 },  { 0x06, 22 },  { 0x05, 22 },  { 0x04, 22 },
-    { 0x03, 22 },  { 0x02, 22 },  { 0x01, 22 },  { 0x00, 22 }
-};
-
-#endif /* AVCODEC_SVQ1_VLC_H */
diff --git a/deps/libav/libavcodec/svq1dec.c b/deps/libav/libavcodec/svq1dec.c
deleted file mode 100644
index 000487b..0000000
--- a/deps/libav/libavcodec/svq1dec.c
+++ /dev/null
@@ -1,823 +0,0 @@
-/*
- * SVQ1 decoder
- * ported to MPlayer by Arpi <arpi at thot.banki.hu>
- * ported to libavcodec by Nick Kurshev <nickols_k at mail.ru>
- *
- * Copyright (C) 2002 the xine project
- * Copyright (C) 2002 the ffmpeg project
- *
- * SVQ1 Encoder (c) 2004 Mike Melanson <melanson at pcisys.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sorenson Vector Quantizer #1 (SVQ1) video codec.
- * For more information of the SVQ1 algorithm, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "h263.h"
-#include "hpeldsp.h"
-#include "internal.h"
-#include "mathops.h"
-#include "svq1.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-static VLC svq1_block_type;
-static VLC svq1_motion_component;
-static VLC svq1_intra_multistage[6];
-static VLC svq1_inter_multistage[6];
-static VLC svq1_intra_mean;
-static VLC svq1_inter_mean;
-
-/* motion vector (prediction) */
-typedef struct svq1_pmv_s {
-    int x;
-    int y;
-} svq1_pmv;
-
-typedef struct SVQ1Context {
-    HpelDSPContext hdsp;
-    GetBitContext gb;
-    AVFrame *prev;
-    int width;
-    int height;
-    int frame_code;
-    int nonref;         // 1 if the current frame won't be referenced
-} SVQ1Context;
-
-static const uint8_t string_table[256] = {
-    0x00, 0xD5, 0x7F, 0xAA, 0xFE, 0x2B, 0x81, 0x54,
-    0x29, 0xFC, 0x56, 0x83, 0xD7, 0x02, 0xA8, 0x7D,
-    0x52, 0x87, 0x2D, 0xF8, 0xAC, 0x79, 0xD3, 0x06,
-    0x7B, 0xAE, 0x04, 0xD1, 0x85, 0x50, 0xFA, 0x2F,
-    0xA4, 0x71, 0xDB, 0x0E, 0x5A, 0x8F, 0x25, 0xF0,
-    0x8D, 0x58, 0xF2, 0x27, 0x73, 0xA6, 0x0C, 0xD9,
-    0xF6, 0x23, 0x89, 0x5C, 0x08, 0xDD, 0x77, 0xA2,
-    0xDF, 0x0A, 0xA0, 0x75, 0x21, 0xF4, 0x5E, 0x8B,
-    0x9D, 0x48, 0xE2, 0x37, 0x63, 0xB6, 0x1C, 0xC9,
-    0xB4, 0x61, 0xCB, 0x1E, 0x4A, 0x9F, 0x35, 0xE0,
-    0xCF, 0x1A, 0xB0, 0x65, 0x31, 0xE4, 0x4E, 0x9B,
-    0xE6, 0x33, 0x99, 0x4C, 0x18, 0xCD, 0x67, 0xB2,
-    0x39, 0xEC, 0x46, 0x93, 0xC7, 0x12, 0xB8, 0x6D,
-    0x10, 0xC5, 0x6F, 0xBA, 0xEE, 0x3B, 0x91, 0x44,
-    0x6B, 0xBE, 0x14, 0xC1, 0x95, 0x40, 0xEA, 0x3F,
-    0x42, 0x97, 0x3D, 0xE8, 0xBC, 0x69, 0xC3, 0x16,
-    0xEF, 0x3A, 0x90, 0x45, 0x11, 0xC4, 0x6E, 0xBB,
-    0xC6, 0x13, 0xB9, 0x6C, 0x38, 0xED, 0x47, 0x92,
-    0xBD, 0x68, 0xC2, 0x17, 0x43, 0x96, 0x3C, 0xE9,
-    0x94, 0x41, 0xEB, 0x3E, 0x6A, 0xBF, 0x15, 0xC0,
-    0x4B, 0x9E, 0x34, 0xE1, 0xB5, 0x60, 0xCA, 0x1F,
-    0x62, 0xB7, 0x1D, 0xC8, 0x9C, 0x49, 0xE3, 0x36,
-    0x19, 0xCC, 0x66, 0xB3, 0xE7, 0x32, 0x98, 0x4D,
-    0x30, 0xE5, 0x4F, 0x9A, 0xCE, 0x1B, 0xB1, 0x64,
-    0x72, 0xA7, 0x0D, 0xD8, 0x8C, 0x59, 0xF3, 0x26,
-    0x5B, 0x8E, 0x24, 0xF1, 0xA5, 0x70, 0xDA, 0x0F,
-    0x20, 0xF5, 0x5F, 0x8A, 0xDE, 0x0B, 0xA1, 0x74,
-    0x09, 0xDC, 0x76, 0xA3, 0xF7, 0x22, 0x88, 0x5D,
-    0xD6, 0x03, 0xA9, 0x7C, 0x28, 0xFD, 0x57, 0x82,
-    0xFF, 0x2A, 0x80, 0x55, 0x01, 0xD4, 0x7E, 0xAB,
-    0x84, 0x51, 0xFB, 0x2E, 0x7A, 0xAF, 0x05, 0xD0,
-    0xAD, 0x78, 0xD2, 0x07, 0x53, 0x86, 0x2C, 0xF9
-};
-
-#define SVQ1_PROCESS_VECTOR()                                           \
-    for (; level > 0; i++) {                                            \
-        /* process next depth */                                        \
-        if (i == m) {                                                   \
-            m = n;                                                      \
-            if (--level == 0)                                           \
-                break;                                                  \
-        }                                                               \
-        /* divide block if next bit set */                              \
-        if (get_bits1(bitbuf) == 0)                                     \
-            break;                                                      \
-        /* add child nodes */                                           \
-        list[n++] = list[i];                                            \
-        list[n++] = list[i] +                                           \
-                    (((level & 1) ? pitch : 1) << (level / 2 + 1));     \
-    }
-
-#define SVQ1_ADD_CODEBOOK()                                             \
-    /* add codebook entries to vector */                                \
-    for (j = 0; j < stages; j++) {                                      \
-        n3  = codebook[entries[j]] ^ 0x80808080;                        \
-        n1 += (n3 & 0xFF00FF00) >> 8;                                   \
-        n2 +=  n3 & 0x00FF00FF;                                         \
-    }                                                                   \
-                                                                        \
-    /* clip to [0..255] */                                              \
-    if (n1 & 0xFF00FF00) {                                              \
-        n3  = (n1 >> 15  & 0x00010001 | 0x01000100) - 0x00010001;       \
-        n1 += 0x7F007F00;                                               \
-        n1 |= (~n1 >> 15 & 0x00010001 | 0x01000100) - 0x00010001;       \
-        n1 &= n3 & 0x00FF00FF;                                          \
-    }                                                                   \
-                                                                        \
-    if (n2 & 0xFF00FF00) {                                              \
-        n3  = (n2 >> 15  & 0x00010001 | 0x01000100) - 0x00010001;       \
-        n2 += 0x7F007F00;                                               \
-        n2 |= (~n2 >> 15 & 0x00010001 | 0x01000100) - 0x00010001;       \
-        n2 &= n3 & 0x00FF00FF;                                          \
-    }
-
-#define SVQ1_CALC_CODEBOOK_ENTRIES(cbook)                               \
-    codebook = (const uint32_t *)cbook[level];                          \
-    if (stages > 0)                                                     \
-        bit_cache = get_bits(bitbuf, 4 * stages);                       \
-    /* calculate codebook entries for this vector */                    \
-    for (j = 0; j < stages; j++) {                                      \
-        entries[j] = (((bit_cache >> (4 * (stages - j - 1))) & 0xF) +   \
-                      16 * j) << (level + 1);                           \
-    }                                                                   \
-    mean -= stages * 128;                                               \
-    n4    = mean + (mean >> 31) << 16 | (mean & 0xFFFF);
-
-static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels,
-                                   int pitch)
-{
-    uint32_t bit_cache;
-    uint8_t *list[63];
-    uint32_t *dst;
-    const uint32_t *codebook;
-    int entries[6];
-    int i, j, m, n;
-    int mean, stages;
-    unsigned x, y, width, height, level;
-    uint32_t n1, n2, n3, n4;
-
-    /* initialize list for breadth first processing of vectors */
-    list[0] = pixels;
-
-    /* recursively process vector */
-    for (i = 0, m = 1, n = 1, level = 5; i < n; i++) {
-        SVQ1_PROCESS_VECTOR();
-
-        /* destination address and vector size */
-        dst    = (uint32_t *)list[i];
-        width  = 1 << ((4 + level) / 2);
-        height = 1 << ((3 + level) / 2);
-
-        /* get number of stages (-1 skips vector, 0 for mean only) */
-        stages = get_vlc2(bitbuf, svq1_intra_multistage[level].table, 3, 3) - 1;
-
-        if (stages == -1) {
-            for (y = 0; y < height; y++)
-                memset(&dst[y * (pitch / 4)], 0, width);
-            continue;   /* skip vector */
-        }
-
-        if (stages > 0 && level >= 4) {
-            av_dlog(NULL,
-                    "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",
-                    stages, level);
-            return AVERROR_INVALIDDATA;  /* invalid vector */
-        }
-
-        mean = get_vlc2(bitbuf, svq1_intra_mean.table, 8, 3);
-
-        if (stages == 0) {
-            for (y = 0; y < height; y++)
-                memset(&dst[y * (pitch / 4)], mean, width);
-        } else {
-            SVQ1_CALC_CODEBOOK_ENTRIES(ff_svq1_intra_codebooks);
-
-            for (y = 0; y < height; y++) {
-                for (x = 0; x < width / 4; x++, codebook++) {
-                    n1 = n4;
-                    n2 = n4;
-                    SVQ1_ADD_CODEBOOK()
-                    /* store result */
-                    dst[x] = n1 << 8 | n2;
-                }
-                dst += pitch / 4;
-            }
-        }
-    }
-
-    return 0;
-}
-
-static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels,
-                                       int pitch)
-{
-    uint32_t bit_cache;
-    uint8_t *list[63];
-    uint32_t *dst;
-    const uint32_t *codebook;
-    int entries[6];
-    int i, j, m, n;
-    int mean, stages;
-    int x, y, width, height, level;
-    uint32_t n1, n2, n3, n4;
-
-    /* initialize list for breadth first processing of vectors */
-    list[0] = pixels;
-
-    /* recursively process vector */
-    for (i = 0, m = 1, n = 1, level = 5; i < n; i++) {
-        SVQ1_PROCESS_VECTOR();
-
-        /* destination address and vector size */
-        dst    = (uint32_t *)list[i];
-        width  = 1 << ((4 + level) / 2);
-        height = 1 << ((3 + level) / 2);
-
-        /* get number of stages (-1 skips vector, 0 for mean only) */
-        stages = get_vlc2(bitbuf, svq1_inter_multistage[level].table, 3, 2) - 1;
-
-        if (stages == -1)
-            continue;           /* skip vector */
-
-        if ((stages > 0) && (level >= 4)) {
-            av_dlog(NULL,
-                    "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",
-                    stages, level);
-            return AVERROR_INVALIDDATA;  /* invalid vector */
-        }
-
-        mean = get_vlc2(bitbuf, svq1_inter_mean.table, 9, 3) - 256;
-
-        SVQ1_CALC_CODEBOOK_ENTRIES(ff_svq1_inter_codebooks);
-
-        for (y = 0; y < height; y++) {
-            for (x = 0; x < width / 4; x++, codebook++) {
-                n3 = dst[x];
-                /* add mean value to vector */
-                n1 = n4 + ((n3 & 0xFF00FF00) >> 8);
-                n2 = n4 +  (n3 & 0x00FF00FF);
-                SVQ1_ADD_CODEBOOK()
-                /* store result */
-                dst[x] = n1 << 8 | n2;
-            }
-            dst += pitch / 4;
-        }
-    }
-    return 0;
-}
-
-static int svq1_decode_motion_vector(GetBitContext *bitbuf, svq1_pmv *mv,
-                                     svq1_pmv **pmv)
-{
-    int diff;
-    int i;
-
-    for (i = 0; i < 2; i++) {
-        /* get motion code */
-        diff = get_vlc2(bitbuf, svq1_motion_component.table, 7, 2);
-        if (diff < 0)
-            return AVERROR_INVALIDDATA;
-        else if (diff) {
-            if (get_bits1(bitbuf))
-                diff = -diff;
-        }
-
-        /* add median of motion vector predictors and clip result */
-        if (i == 1)
-            mv->y = sign_extend(diff + mid_pred(pmv[0]->y, pmv[1]->y, pmv[2]->y), 6);
-        else
-            mv->x = sign_extend(diff + mid_pred(pmv[0]->x, pmv[1]->x, pmv[2]->x), 6);
-    }
-
-    return 0;
-}
-
-static void svq1_skip_block(uint8_t *current, uint8_t *previous,
-                            int pitch, int x, int y)
-{
-    uint8_t *src;
-    uint8_t *dst;
-    int i;
-
-    src = &previous[x + y * pitch];
-    dst = current;
-
-    for (i = 0; i < 16; i++) {
-        memcpy(dst, src, 16);
-        src += pitch;
-        dst += pitch;
-    }
-}
-
-static int svq1_motion_inter_block(HpelDSPContext *hdsp, GetBitContext *bitbuf,
-                                   uint8_t *current, uint8_t *previous,
-                                   int pitch, svq1_pmv *motion, int x, int y,
-                                   int width, int height)
-{
-    uint8_t *src;
-    uint8_t *dst;
-    svq1_pmv mv;
-    svq1_pmv *pmv[3];
-    int result;
-
-    /* predict and decode motion vector */
-    pmv[0] = &motion[0];
-    if (y == 0) {
-        pmv[1] =
-        pmv[2] = pmv[0];
-    } else {
-        pmv[1] = &motion[x / 8 + 2];
-        pmv[2] = &motion[x / 8 + 4];
-    }
-
-    result = svq1_decode_motion_vector(bitbuf, &mv, pmv);
-
-    if (result != 0)
-        return result;
-
-    motion[0].x         =
-    motion[x / 8 + 2].x =
-    motion[x / 8 + 3].x = mv.x;
-    motion[0].y         =
-    motion[x / 8 + 2].y =
-    motion[x / 8 + 3].y = mv.y;
-
-    mv.x = av_clip(mv.x, -2 * x, 2 * (width  - x - 16));
-    mv.y = av_clip(mv.y, -2 * y, 2 * (height - y - 16));
-
-    src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1)) * pitch];
-    dst = current;
-
-    hdsp->put_pixels_tab[0][(mv.y & 1) << 1 | (mv.x & 1)](dst, src, pitch, 16);
-
-    return 0;
-}
-
-static int svq1_motion_inter_4v_block(HpelDSPContext *hdsp, GetBitContext *bitbuf,
-                                      uint8_t *current, uint8_t *previous,
-                                      int pitch, svq1_pmv *motion, int x, int y,
-                                      int width, int height)
-{
-    uint8_t *src;
-    uint8_t *dst;
-    svq1_pmv mv;
-    svq1_pmv *pmv[4];
-    int i, result;
-
-    /* predict and decode motion vector (0) */
-    pmv[0] = &motion[0];
-    if (y == 0) {
-        pmv[1] =
-        pmv[2] = pmv[0];
-    } else {
-        pmv[1] = &motion[(x / 8) + 2];
-        pmv[2] = &motion[(x / 8) + 4];
-    }
-
-    result = svq1_decode_motion_vector(bitbuf, &mv, pmv);
-
-    if (result != 0)
-        return result;
-
-    /* predict and decode motion vector (1) */
-    pmv[0] = &mv;
-    if (y == 0) {
-        pmv[1] =
-        pmv[2] = pmv[0];
-    } else {
-        pmv[1] = &motion[(x / 8) + 3];
-    }
-    result = svq1_decode_motion_vector(bitbuf, &motion[0], pmv);
-
-    if (result != 0)
-        return result;
-
-    /* predict and decode motion vector (2) */
-    pmv[1] = &motion[0];
-    pmv[2] = &motion[(x / 8) + 1];
-
-    result = svq1_decode_motion_vector(bitbuf, &motion[(x / 8) + 2], pmv);
-
-    if (result != 0)
-        return result;
-
-    /* predict and decode motion vector (3) */
-    pmv[2] = &motion[(x / 8) + 2];
-    pmv[3] = &motion[(x / 8) + 3];
-
-    result = svq1_decode_motion_vector(bitbuf, pmv[3], pmv);
-
-    if (result != 0)
-        return result;
-
-    /* form predictions */
-    for (i = 0; i < 4; i++) {
-        int mvx = pmv[i]->x + (i  & 1) * 16;
-        int mvy = pmv[i]->y + (i >> 1) * 16;
-
-        // FIXME: clipping or padding?
-        mvx = av_clip(mvx, -2 * x, 2 * (width  - x - 8));
-        mvy = av_clip(mvy, -2 * y, 2 * (height - y - 8));
-
-        src = &previous[(x + (mvx >> 1)) + (y + (mvy >> 1)) * pitch];
-        dst = current;
-
-        hdsp->put_pixels_tab[1][((mvy & 1) << 1) | (mvx & 1)](dst, src, pitch, 8);
-
-        /* select next block */
-        if (i & 1)
-            current += 8 * (pitch - 1);
-        else
-            current += 8;
-    }
-
-    return 0;
-}
-
-static int svq1_decode_delta_block(AVCodecContext *avctx, HpelDSPContext *hdsp,
-                                   GetBitContext *bitbuf,
-                                   uint8_t *current, uint8_t *previous,
-                                   int pitch, svq1_pmv *motion, int x, int y,
-                                   int width, int height)
-{
-    uint32_t block_type;
-    int result = 0;
-
-    /* get block type */
-    block_type = get_vlc2(bitbuf, svq1_block_type.table, 2, 2);
-
-    /* reset motion vectors */
-    if (block_type == SVQ1_BLOCK_SKIP || block_type == SVQ1_BLOCK_INTRA) {
-        motion[0].x         =
-        motion[0].y         =
-        motion[x / 8 + 2].x =
-        motion[x / 8 + 2].y =
-        motion[x / 8 + 3].x =
-        motion[x / 8 + 3].y = 0;
-    }
-
-    switch (block_type) {
-    case SVQ1_BLOCK_SKIP:
-        svq1_skip_block(current, previous, pitch, x, y);
-        break;
-
-    case SVQ1_BLOCK_INTER:
-        result = svq1_motion_inter_block(hdsp, bitbuf, current, previous,
-                                         pitch, motion, x, y, width, height);
-
-        if (result != 0) {
-            av_dlog(avctx, "Error in svq1_motion_inter_block %i\n", result);
-            break;
-        }
-        result = svq1_decode_block_non_intra(bitbuf, current, pitch);
-        break;
-
-    case SVQ1_BLOCK_INTER_4V:
-        result = svq1_motion_inter_4v_block(hdsp, bitbuf, current, previous,
-                                            pitch, motion, x, y, width, height);
-
-        if (result != 0) {
-            av_dlog(avctx, "Error in svq1_motion_inter_4v_block %i\n", result);
-            break;
-        }
-        result = svq1_decode_block_non_intra(bitbuf, current, pitch);
-        break;
-
-    case SVQ1_BLOCK_INTRA:
-        result = svq1_decode_block_intra(bitbuf, current, pitch);
-        break;
-    }
-
-    return result;
-}
-
-static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out)
-{
-    uint8_t seed;
-    int i;
-
-    out[0] = get_bits(bitbuf, 8);
-    seed   = string_table[out[0]];
-
-    for (i = 1; i <= out[0]; i++) {
-        out[i] = get_bits(bitbuf, 8) ^ seed;
-        seed   = string_table[out[i] ^ seed];
-    }
-}
-
-static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
-{
-    SVQ1Context *s = avctx->priv_data;
-    GetBitContext *bitbuf = &s->gb;
-    int frame_size_code;
-
-    skip_bits(bitbuf, 8); /* temporal_reference */
-
-    /* frame type */
-    s->nonref = 0;
-    switch (get_bits(bitbuf, 2)) {
-    case 0:
-        frame->pict_type = AV_PICTURE_TYPE_I;
-        break;
-    case 2:
-        s->nonref = 1;
-    case 1:
-        frame->pict_type = AV_PICTURE_TYPE_P;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame type.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (frame->pict_type == AV_PICTURE_TYPE_I) {
-        /* unknown fields */
-        if (s->frame_code == 0x50 || s->frame_code == 0x60) {
-            int csum = get_bits(bitbuf, 16);
-
-            csum = ff_svq1_packet_checksum(bitbuf->buffer,
-                                           bitbuf->size_in_bits >> 3,
-                                           csum);
-
-            av_dlog(avctx, "%s checksum (%02x) for packet data\n",
-                    (csum == 0) ? "correct" : "incorrect", csum);
-        }
-
-        if ((s->frame_code ^ 0x10) >= 0x50) {
-            uint8_t msg[256];
-
-            svq1_parse_string(bitbuf, msg);
-
-            av_log(avctx, AV_LOG_INFO,
-                   "embedded message: \"%s\"\n", (char *)msg);
-        }
-
-        skip_bits(bitbuf, 2);
-        skip_bits(bitbuf, 2);
-        skip_bits1(bitbuf);
-
-        /* load frame size */
-        frame_size_code = get_bits(bitbuf, 3);
-
-        if (frame_size_code == 7) {
-            /* load width, height (12 bits each) */
-            s->width  = get_bits(bitbuf, 12);
-            s->height = get_bits(bitbuf, 12);
-
-            if (!s->width || !s->height)
-                return AVERROR_INVALIDDATA;
-        } else {
-            /* get width, height from table */
-            s->width  = ff_svq1_frame_size_table[frame_size_code][0];
-            s->height = ff_svq1_frame_size_table[frame_size_code][1];
-        }
-    }
-
-    /* unknown fields */
-    if (get_bits1(bitbuf) == 1) {
-        skip_bits1(bitbuf);    /* use packet checksum if (1) */
-        skip_bits1(bitbuf);    /* component checksums after image data if (1) */
-
-        if (get_bits(bitbuf, 2) != 0)
-            return AVERROR_INVALIDDATA;
-    }
-
-    if (get_bits1(bitbuf) == 1) {
-        skip_bits1(bitbuf);
-        skip_bits(bitbuf, 4);
-        skip_bits1(bitbuf);
-        skip_bits(bitbuf, 2);
-
-        while (get_bits1(bitbuf) == 1)
-            skip_bits(bitbuf, 8);
-    }
-
-    return 0;
-}
-
-static int svq1_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    SVQ1Context     *s = avctx->priv_data;
-    AVFrame       *cur = data;
-    uint8_t *current;
-    int result, i, x, y, width, height;
-    svq1_pmv *pmv;
-
-    /* initialize bit buffer */
-    init_get_bits(&s->gb, buf, buf_size * 8);
-
-    /* decode frame header */
-    s->frame_code = get_bits(&s->gb, 22);
-
-    if ((s->frame_code & ~0x70) || !(s->frame_code & 0x60))
-        return AVERROR_INVALIDDATA;
-
-    /* swap some header bytes (why?) */
-    if (s->frame_code != 0x20) {
-        uint32_t *src = (uint32_t *)(buf + 4);
-
-        for (i = 0; i < 4; i++)
-            src[i] = ((src[i] << 16) | (src[i] >> 16)) ^ src[7 - i];
-    }
-
-    result = svq1_decode_frame_header(avctx, cur);
-
-    if (result != 0) {
-        av_dlog(avctx, "Error in svq1_decode_frame_header %i\n", result);
-        return result;
-    }
-
-    result = ff_set_dimensions(avctx, s->width, s->height);
-    if (result < 0)
-        return result;
-
-    if ((avctx->skip_frame >= AVDISCARD_NONREF && s->nonref) ||
-        (avctx->skip_frame >= AVDISCARD_NONKEY &&
-         cur->pict_type != AV_PICTURE_TYPE_I) ||
-        avctx->skip_frame >= AVDISCARD_ALL)
-        return buf_size;
-
-    result = ff_get_buffer(avctx, cur, s->nonref ? 0 : AV_GET_BUFFER_FLAG_REF);
-    if (result < 0)
-        return result;
-
-    pmv = av_malloc((FFALIGN(s->width, 16) / 8 + 3) * sizeof(*pmv));
-    if (!pmv)
-        return AVERROR(ENOMEM);
-
-    /* decode y, u and v components */
-    for (i = 0; i < 3; i++) {
-        int linesize = cur->linesize[i];
-        if (i == 0) {
-            width    = FFALIGN(s->width,  16);
-            height   = FFALIGN(s->height, 16);
-        } else {
-            if (avctx->flags & CODEC_FLAG_GRAY)
-                break;
-            width    = FFALIGN(s->width  / 4, 16);
-            height   = FFALIGN(s->height / 4, 16);
-        }
-
-        current = cur->data[i];
-
-        if (cur->pict_type == AV_PICTURE_TYPE_I) {
-            /* keyframe */
-            for (y = 0; y < height; y += 16) {
-                for (x = 0; x < width; x += 16) {
-                    result = svq1_decode_block_intra(&s->gb, &current[x],
-                                                     linesize);
-                    if (result != 0) {
-                        av_log(avctx, AV_LOG_INFO,
-                               "Error in svq1_decode_block %i (keyframe)\n",
-                               result);
-                        goto err;
-                    }
-                }
-                current += 16 * linesize;
-            }
-        } else {
-            /* delta frame */
-            uint8_t *previous = s->prev->data[i];
-            if (!previous ||
-                s->prev->width != s->width || s->prev->height != s->height) {
-                av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
-                result = AVERROR_INVALIDDATA;
-                goto err;
-            }
-
-            memset(pmv, 0, ((width / 8) + 3) * sizeof(svq1_pmv));
-
-            for (y = 0; y < height; y += 16) {
-                for (x = 0; x < width; x += 16) {
-                    result = svq1_decode_delta_block(avctx, &s->hdsp,
-                                                     &s->gb, &current[x],
-                                                     previous, linesize,
-                                                     pmv, x, y, width, height);
-                    if (result != 0) {
-                        av_dlog(avctx,
-                                "Error in svq1_decode_delta_block %i\n",
-                                result);
-                        goto err;
-                    }
-                }
-
-                pmv[0].x     =
-                    pmv[0].y = 0;
-
-                current += 16 * linesize;
-            }
-        }
-    }
-
-    if (!s->nonref) {
-        av_frame_unref(s->prev);
-        result = av_frame_ref(s->prev, cur);
-        if (result < 0)
-            goto err;
-    }
-
-    *got_frame = 1;
-    result     = buf_size;
-
-err:
-    av_free(pmv);
-    return result;
-}
-
-static av_cold int svq1_decode_init(AVCodecContext *avctx)
-{
-    SVQ1Context *s = avctx->priv_data;
-    int i;
-    int offset = 0;
-
-    s->prev = av_frame_alloc();
-    if (!s->prev)
-        return AVERROR(ENOMEM);
-
-    s->width            = avctx->width  + 3 & ~3;
-    s->height           = avctx->height + 3 & ~3;
-    avctx->pix_fmt      = AV_PIX_FMT_YUV410P;
-
-    ff_hpeldsp_init(&s->hdsp, avctx->flags);
-
-    INIT_VLC_STATIC(&svq1_block_type, 2, 4,
-                    &ff_svq1_block_type_vlc[0][1], 2, 1,
-                    &ff_svq1_block_type_vlc[0][0], 2, 1, 6);
-
-    INIT_VLC_STATIC(&svq1_motion_component, 7, 33,
-                    &ff_mvtab[0][1], 2, 1,
-                    &ff_mvtab[0][0], 2, 1, 176);
-
-    for (i = 0; i < 6; i++) {
-        static const uint8_t sizes[2][6] = { { 14, 10, 14, 18, 16, 18 },
-                                             { 10, 10, 14, 14, 14, 16 } };
-        static VLC_TYPE table[168][2];
-        svq1_intra_multistage[i].table           = &table[offset];
-        svq1_intra_multistage[i].table_allocated = sizes[0][i];
-        offset                                  += sizes[0][i];
-        init_vlc(&svq1_intra_multistage[i], 3, 8,
-                 &ff_svq1_intra_multistage_vlc[i][0][1], 2, 1,
-                 &ff_svq1_intra_multistage_vlc[i][0][0], 2, 1,
-                 INIT_VLC_USE_NEW_STATIC);
-        svq1_inter_multistage[i].table           = &table[offset];
-        svq1_inter_multistage[i].table_allocated = sizes[1][i];
-        offset                                  += sizes[1][i];
-        init_vlc(&svq1_inter_multistage[i], 3, 8,
-                 &ff_svq1_inter_multistage_vlc[i][0][1], 2, 1,
-                 &ff_svq1_inter_multistage_vlc[i][0][0], 2, 1,
-                 INIT_VLC_USE_NEW_STATIC);
-    }
-
-    INIT_VLC_STATIC(&svq1_intra_mean, 8, 256,
-                    &ff_svq1_intra_mean_vlc[0][1], 4, 2,
-                    &ff_svq1_intra_mean_vlc[0][0], 4, 2, 632);
-
-    INIT_VLC_STATIC(&svq1_inter_mean, 9, 512,
-                    &ff_svq1_inter_mean_vlc[0][1], 4, 2,
-                    &ff_svq1_inter_mean_vlc[0][0], 4, 2, 1434);
-
-    return 0;
-}
-
-static av_cold int svq1_decode_end(AVCodecContext *avctx)
-{
-    SVQ1Context *s = avctx->priv_data;
-
-    av_frame_free(&s->prev);
-
-    return 0;
-}
-
-static void svq1_flush(AVCodecContext *avctx)
-{
-    SVQ1Context *s = avctx->priv_data;
-
-    av_frame_unref(s->prev);
-}
-
-AVCodec ff_svq1_decoder = {
-    .name           = "svq1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SVQ1,
-    .priv_data_size = sizeof(SVQ1Context),
-    .init           = svq1_decode_init,
-    .close          = svq1_decode_end,
-    .decode         = svq1_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = svq1_flush,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P,
-                                                     AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/svq1enc.c b/deps/libav/libavcodec/svq1enc.c
deleted file mode 100644
index 3cd3a4a..0000000
--- a/deps/libav/libavcodec/svq1enc.c
+++ /dev/null
@@ -1,642 +0,0 @@
-/*
- * SVQ1 Encoder
- * Copyright (C) 2004 Mike Melanson <melanson at pcisys.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sorenson Vector Quantizer #1 (SVQ1) video codec.
- * For more information of the SVQ1 algorithm, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "hpeldsp.h"
-#include "mpegvideo.h"
-#include "h263.h"
-#include "internal.h"
-#include "svq1.h"
-#include "svq1enc_cb.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-typedef struct SVQ1Context {
-    /* FIXME: Needed for motion estimation, should not be used for anything
-     * else, the idea is to make the motion estimation eventually independent
-     * of MpegEncContext, so this will be removed then. */
-    MpegEncContext m;
-    AVCodecContext *avctx;
-    DSPContext dsp;
-    HpelDSPContext hdsp;
-    AVFrame *current_picture;
-    AVFrame *last_picture;
-    PutBitContext pb;
-    GetBitContext gb;
-
-    /* why ooh why this sick breadth first order,
-     * everything is slower and more complex */
-    PutBitContext reorder_pb[6];
-
-    int frame_width;
-    int frame_height;
-
-    /* Y plane block dimensions */
-    int y_block_width;
-    int y_block_height;
-
-    /* U & V plane (C planes) block dimensions */
-    int c_block_width;
-    int c_block_height;
-
-    uint16_t *mb_type;
-    uint32_t *dummy;
-    int16_t (*motion_val8[3])[2];
-    int16_t (*motion_val16[3])[2];
-
-    int64_t rd_total;
-
-    uint8_t *scratchbuf;
-} SVQ1Context;
-
-static void svq1_write_header(SVQ1Context *s, int frame_type)
-{
-    int i;
-
-    /* frame code */
-    put_bits(&s->pb, 22, 0x20);
-
-    /* temporal reference (sure hope this is a "don't care") */
-    put_bits(&s->pb, 8, 0x00);
-
-    /* frame type */
-    put_bits(&s->pb, 2, frame_type - 1);
-
-    if (frame_type == AV_PICTURE_TYPE_I) {
-        /* no checksum since frame code is 0x20 */
-        /* no embedded string either */
-        /* output 5 unknown bits (2 + 2 + 1) */
-        put_bits(&s->pb, 5, 2); /* 2 needed by quicktime decoder */
-
-        i = ff_match_2uint16(ff_svq1_frame_size_table,
-                             FF_ARRAY_ELEMS(ff_svq1_frame_size_table),
-                             s->frame_width, s->frame_height);
-        put_bits(&s->pb, 3, i);
-
-        if (i == 7) {
-            put_bits(&s->pb, 12, s->frame_width);
-            put_bits(&s->pb, 12, s->frame_height);
-        }
-    }
-
-    /* no checksum or extra data (next 2 bits get 0) */
-    put_bits(&s->pb, 2, 0);
-}
-
-#define QUALITY_THRESHOLD    100
-#define THRESHOLD_MULTIPLIER 0.6
-
-static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref,
-                        uint8_t *decoded, int stride, int level,
-                        int threshold, int lambda, int intra)
-{
-    int count, y, x, i, j, split, best_mean, best_score, best_count;
-    int best_vector[6];
-    int block_sum[7] = { 0, 0, 0, 0, 0, 0 };
-    int w            = 2 << (level + 2 >> 1);
-    int h            = 2 << (level + 1 >> 1);
-    int size         = w * h;
-    int16_t block[7][256];
-    const int8_t *codebook_sum, *codebook;
-    const uint16_t(*mean_vlc)[2];
-    const uint8_t(*multistage_vlc)[2];
-
-    best_score = 0;
-    // FIXME: Optimize, this does not need to be done multiple times.
-    if (intra) {
-        codebook_sum   = svq1_intra_codebook_sum[level];
-        codebook       = ff_svq1_intra_codebooks[level];
-        mean_vlc       = ff_svq1_intra_mean_vlc;
-        multistage_vlc = ff_svq1_intra_multistage_vlc[level];
-        for (y = 0; y < h; y++) {
-            for (x = 0; x < w; x++) {
-                int v = src[x + y * stride];
-                block[0][x + w * y] = v;
-                best_score         += v * v;
-                block_sum[0]       += v;
-            }
-        }
-    } else {
-        codebook_sum   = svq1_inter_codebook_sum[level];
-        codebook       = ff_svq1_inter_codebooks[level];
-        mean_vlc       = ff_svq1_inter_mean_vlc + 256;
-        multistage_vlc = ff_svq1_inter_multistage_vlc[level];
-        for (y = 0; y < h; y++) {
-            for (x = 0; x < w; x++) {
-                int v = src[x + y * stride] - ref[x + y * stride];
-                block[0][x + w * y] = v;
-                best_score         += v * v;
-                block_sum[0]       += v;
-            }
-        }
-    }
-
-    best_count  = 0;
-    best_score -= (int)((unsigned)block_sum[0] * block_sum[0] >> (level + 3));
-    best_mean   = block_sum[0] + (size >> 1) >> (level + 3);
-
-    if (level < 4) {
-        for (count = 1; count < 7; count++) {
-            int best_vector_score = INT_MAX;
-            int best_vector_sum   = -999, best_vector_mean = -999;
-            const int stage       = count - 1;
-            const int8_t *vector;
-
-            for (i = 0; i < 16; i++) {
-                int sum = codebook_sum[stage * 16 + i];
-                int sqr, diff, score;
-
-                vector = codebook + stage * size * 16 + i * size;
-                sqr    = s->dsp.ssd_int8_vs_int16(vector, block[stage], size);
-                diff   = block_sum[stage] - sum;
-                score  = sqr - (diff * (int64_t)diff >> (level + 3)); // FIXME: 64bit slooow
-                if (score < best_vector_score) {
-                    int mean = diff + (size >> 1) >> (level + 3);
-                    assert(mean > -300 && mean < 300);
-                    mean               = av_clip(mean, intra ? 0 : -256, 255);
-                    best_vector_score  = score;
-                    best_vector[stage] = i;
-                    best_vector_sum    = sum;
-                    best_vector_mean   = mean;
-                }
-            }
-            assert(best_vector_mean != -999);
-            vector = codebook + stage * size * 16 + best_vector[stage] * size;
-            for (j = 0; j < size; j++)
-                block[stage + 1][j] = block[stage][j] - vector[j];
-            block_sum[stage + 1] = block_sum[stage] - best_vector_sum;
-            best_vector_score   += lambda *
-                                   (+1 + 4 * count +
-                                    multistage_vlc[1 + count][1]
-                                    + mean_vlc[best_vector_mean][1]);
-
-            if (best_vector_score < best_score) {
-                best_score = best_vector_score;
-                best_count = count;
-                best_mean  = best_vector_mean;
-            }
-        }
-    }
-
-    split = 0;
-    if (best_score > threshold && level) {
-        int score  = 0;
-        int offset = level & 1 ? stride * h / 2 : w / 2;
-        PutBitContext backup[6];
-
-        for (i = level - 1; i >= 0; i--)
-            backup[i] = s->reorder_pb[i];
-        score += encode_block(s, src, ref, decoded, stride, level - 1,
-                              threshold >> 1, lambda, intra);
-        score += encode_block(s, src + offset, ref + offset, decoded + offset,
-                              stride, level - 1, threshold >> 1, lambda, intra);
-        score += lambda;
-
-        if (score < best_score) {
-            best_score = score;
-            split      = 1;
-        } else {
-            for (i = level - 1; i >= 0; i--)
-                s->reorder_pb[i] = backup[i];
-        }
-    }
-    if (level > 0)
-        put_bits(&s->reorder_pb[level], 1, split);
-
-    if (!split) {
-        assert(best_mean >= 0 && best_mean < 256 || !intra);
-        assert(best_mean >= -256 && best_mean < 256);
-        assert(best_count >= 0 && best_count < 7);
-        assert(level < 4 || best_count == 0);
-
-        /* output the encoding */
-        put_bits(&s->reorder_pb[level],
-                 multistage_vlc[1 + best_count][1],
-                 multistage_vlc[1 + best_count][0]);
-        put_bits(&s->reorder_pb[level], mean_vlc[best_mean][1],
-                 mean_vlc[best_mean][0]);
-
-        for (i = 0; i < best_count; i++) {
-            assert(best_vector[i] >= 0 && best_vector[i] < 16);
-            put_bits(&s->reorder_pb[level], 4, best_vector[i]);
-        }
-
-        for (y = 0; y < h; y++)
-            for (x = 0; x < w; x++)
-                decoded[x + y * stride] = src[x + y * stride] -
-                                          block[best_count][x + w * y] +
-                                          best_mean;
-    }
-
-    return best_score;
-}
-
-static int svq1_encode_plane(SVQ1Context *s, int plane,
-                             unsigned char *src_plane,
-                             unsigned char *ref_plane,
-                             unsigned char *decoded_plane,
-                             int width, int height, int src_stride, int stride)
-{
-    const AVFrame *f = s->avctx->coded_frame;
-    int x, y;
-    int i;
-    int block_width, block_height;
-    int level;
-    int threshold[6];
-    uint8_t *src     = s->scratchbuf + stride * 16;
-    const int lambda = (f->quality * f->quality) >>
-                       (2 * FF_LAMBDA_SHIFT);
-
-    /* figure out the acceptable level thresholds in advance */
-    threshold[5] = QUALITY_THRESHOLD;
-    for (level = 4; level >= 0; level--)
-        threshold[level] = threshold[level + 1] * THRESHOLD_MULTIPLIER;
-
-    block_width  = (width  + 15) / 16;
-    block_height = (height + 15) / 16;
-
-    if (f->pict_type == AV_PICTURE_TYPE_P) {
-        s->m.avctx                         = s->avctx;
-        s->m.current_picture_ptr           = &s->m.current_picture;
-        s->m.last_picture_ptr              = &s->m.last_picture;
-        s->m.last_picture.f.data[0]        = ref_plane;
-        s->m.linesize                      =
-        s->m.last_picture.f.linesize[0]    =
-        s->m.new_picture.f.linesize[0]     =
-        s->m.current_picture.f.linesize[0] = stride;
-        s->m.width                         = width;
-        s->m.height                        = height;
-        s->m.mb_width                      = block_width;
-        s->m.mb_height                     = block_height;
-        s->m.mb_stride                     = s->m.mb_width + 1;
-        s->m.b8_stride                     = 2 * s->m.mb_width + 1;
-        s->m.f_code                        = 1;
-        s->m.pict_type                     = f->pict_type;
-        s->m.me_method                     = s->avctx->me_method;
-        s->m.me.scene_change_score         = 0;
-        s->m.flags                         = s->avctx->flags;
-        // s->m.out_format                    = FMT_H263;
-        // s->m.unrestricted_mv               = 1;
-        s->m.lambda                        = f->quality;
-        s->m.qscale                        = s->m.lambda * 139 +
-                                             FF_LAMBDA_SCALE * 64 >>
-                                             FF_LAMBDA_SHIFT + 7;
-        s->m.lambda2                       = s->m.lambda * s->m.lambda +
-                                             FF_LAMBDA_SCALE / 2 >>
-                                             FF_LAMBDA_SHIFT;
-
-        if (!s->motion_val8[plane]) {
-            s->motion_val8[plane]  = av_mallocz((s->m.b8_stride *
-                                                 block_height * 2 + 2) *
-                                                2 * sizeof(int16_t));
-            s->motion_val16[plane] = av_mallocz((s->m.mb_stride *
-                                                 (block_height + 2) + 1) *
-                                                2 * sizeof(int16_t));
-        }
-
-        s->m.mb_type = s->mb_type;
-
-        // dummies, to avoid segfaults
-        s->m.current_picture.mb_mean   = (uint8_t *)s->dummy;
-        s->m.current_picture.mb_var    = (uint16_t *)s->dummy;
-        s->m.current_picture.mc_mb_var = (uint16_t *)s->dummy;
-        s->m.current_picture.mb_type = s->dummy;
-
-        s->m.current_picture.motion_val[0]   = s->motion_val8[plane] + 2;
-        s->m.p_mv_table                      = s->motion_val16[plane] +
-                                               s->m.mb_stride + 1;
-        s->m.dsp                             = s->dsp; // move
-        ff_init_me(&s->m);
-
-        s->m.me.dia_size      = s->avctx->dia_size;
-        s->m.first_slice_line = 1;
-        for (y = 0; y < block_height; y++) {
-            s->m.new_picture.f.data[0] = src - y * 16 * stride; // ugly
-            s->m.mb_y                  = y;
-
-            for (i = 0; i < 16 && i + 16 * y < height; i++) {
-                memcpy(&src[i * stride], &src_plane[(i + 16 * y) * src_stride],
-                       width);
-                for (x = width; x < 16 * block_width; x++)
-                    src[i * stride + x] = src[i * stride + x - 1];
-            }
-            for (; i < 16 && i + 16 * y < 16 * block_height; i++)
-                memcpy(&src[i * stride], &src[(i - 1) * stride],
-                       16 * block_width);
-
-            for (x = 0; x < block_width; x++) {
-                s->m.mb_x = x;
-                ff_init_block_index(&s->m);
-                ff_update_block_index(&s->m);
-
-                ff_estimate_p_frame_motion(&s->m, x, y);
-            }
-            s->m.first_slice_line = 0;
-        }
-
-        ff_fix_long_p_mvs(&s->m);
-        ff_fix_long_mvs(&s->m, NULL, 0, s->m.p_mv_table, s->m.f_code,
-                        CANDIDATE_MB_TYPE_INTER, 0);
-    }
-
-    s->m.first_slice_line = 1;
-    for (y = 0; y < block_height; y++) {
-        for (i = 0; i < 16 && i + 16 * y < height; i++) {
-            memcpy(&src[i * stride], &src_plane[(i + 16 * y) * src_stride],
-                   width);
-            for (x = width; x < 16 * block_width; x++)
-                src[i * stride + x] = src[i * stride + x - 1];
-        }
-        for (; i < 16 && i + 16 * y < 16 * block_height; i++)
-            memcpy(&src[i * stride], &src[(i - 1) * stride], 16 * block_width);
-
-        s->m.mb_y = y;
-        for (x = 0; x < block_width; x++) {
-            uint8_t reorder_buffer[3][6][7 * 32];
-            int count[3][6];
-            int offset       = y * 16 * stride + x * 16;
-            uint8_t *decoded = decoded_plane + offset;
-            uint8_t *ref     = ref_plane + offset;
-            int score[4]     = { 0, 0, 0, 0 }, best;
-            uint8_t *temp    = s->scratchbuf;
-
-            if (s->pb.buf_end - s->pb.buf -
-                (put_bits_count(&s->pb) >> 3) < 3000) { // FIXME: check size
-                av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
-                return -1;
-            }
-
-            s->m.mb_x = x;
-            ff_init_block_index(&s->m);
-            ff_update_block_index(&s->m);
-
-            if (f->pict_type == AV_PICTURE_TYPE_I ||
-                (s->m.mb_type[x + y * s->m.mb_stride] &
-                 CANDIDATE_MB_TYPE_INTRA)) {
-                for (i = 0; i < 6; i++)
-                    init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i],
-                                  7 * 32);
-                if (f->pict_type == AV_PICTURE_TYPE_P) {
-                    const uint8_t *vlc = ff_svq1_block_type_vlc[SVQ1_BLOCK_INTRA];
-                    put_bits(&s->reorder_pb[5], vlc[1], vlc[0]);
-                    score[0] = vlc[1] * lambda;
-                }
-                score[0] += encode_block(s, src + 16 * x, NULL, temp, stride,
-                                         5, 64, lambda, 1);
-                for (i = 0; i < 6; i++) {
-                    count[0][i] = put_bits_count(&s->reorder_pb[i]);
-                    flush_put_bits(&s->reorder_pb[i]);
-                }
-            } else
-                score[0] = INT_MAX;
-
-            best = 0;
-
-            if (f->pict_type == AV_PICTURE_TYPE_P) {
-                const uint8_t *vlc = ff_svq1_block_type_vlc[SVQ1_BLOCK_INTER];
-                int mx, my, pred_x, pred_y, dxy;
-                int16_t *motion_ptr;
-
-                motion_ptr = ff_h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y);
-                if (s->m.mb_type[x + y * s->m.mb_stride] &
-                    CANDIDATE_MB_TYPE_INTER) {
-                    for (i = 0; i < 6; i++)
-                        init_put_bits(&s->reorder_pb[i], reorder_buffer[1][i],
-                                      7 * 32);
-
-                    put_bits(&s->reorder_pb[5], vlc[1], vlc[0]);
-
-                    s->m.pb = s->reorder_pb[5];
-                    mx      = motion_ptr[0];
-                    my      = motion_ptr[1];
-                    assert(mx     >= -32 && mx     <= 31);
-                    assert(my     >= -32 && my     <= 31);
-                    assert(pred_x >= -32 && pred_x <= 31);
-                    assert(pred_y >= -32 && pred_y <= 31);
-                    ff_h263_encode_motion(&s->m, mx - pred_x, 1);
-                    ff_h263_encode_motion(&s->m, my - pred_y, 1);
-                    s->reorder_pb[5] = s->m.pb;
-                    score[1]        += lambda * put_bits_count(&s->reorder_pb[5]);
-
-                    dxy = (mx & 1) + 2 * (my & 1);
-
-                    s->hdsp.put_pixels_tab[0][dxy](temp + 16,
-                                                   ref + (mx >> 1) +
-                                                   stride * (my >> 1),
-                                                   stride, 16);
-
-                    score[1] += encode_block(s, src + 16 * x, temp + 16,
-                                             decoded, stride, 5, 64, lambda, 0);
-                    best      = score[1] <= score[0];
-
-                    vlc       = ff_svq1_block_type_vlc[SVQ1_BLOCK_SKIP];
-                    score[2]  = s->dsp.sse[0](NULL, src + 16 * x, ref,
-                                              stride, 16);
-                    score[2] += vlc[1] * lambda;
-                    if (score[2] < score[best] && mx == 0 && my == 0) {
-                        best = 2;
-                        s->hdsp.put_pixels_tab[0][0](decoded, ref, stride, 16);
-                        for (i = 0; i < 6; i++)
-                            count[2][i] = 0;
-                        put_bits(&s->pb, vlc[1], vlc[0]);
-                    }
-                }
-
-                if (best == 1) {
-                    for (i = 0; i < 6; i++) {
-                        count[1][i] = put_bits_count(&s->reorder_pb[i]);
-                        flush_put_bits(&s->reorder_pb[i]);
-                    }
-                } else {
-                    motion_ptr[0]                      =
-                    motion_ptr[1]                      =
-                    motion_ptr[2]                      =
-                    motion_ptr[3]                      =
-                    motion_ptr[0 + 2 * s->m.b8_stride] =
-                    motion_ptr[1 + 2 * s->m.b8_stride] =
-                    motion_ptr[2 + 2 * s->m.b8_stride] =
-                    motion_ptr[3 + 2 * s->m.b8_stride] = 0;
-                }
-            }
-
-            s->rd_total += score[best];
-
-            for (i = 5; i >= 0; i--)
-                avpriv_copy_bits(&s->pb, reorder_buffer[best][i],
-                                 count[best][i]);
-            if (best == 0)
-                s->hdsp.put_pixels_tab[0][0](decoded, temp, stride, 16);
-        }
-        s->m.first_slice_line = 0;
-    }
-    return 0;
-}
-
-static av_cold int svq1_encode_end(AVCodecContext *avctx)
-{
-    SVQ1Context *const s = avctx->priv_data;
-    int i;
-
-    av_log(avctx, AV_LOG_DEBUG, "RD: %f\n",
-           s->rd_total / (double)(avctx->width * avctx->height *
-                                  avctx->frame_number));
-
-    av_freep(&s->m.me.scratchpad);
-    av_freep(&s->m.me.map);
-    av_freep(&s->m.me.score_map);
-    av_freep(&s->mb_type);
-    av_freep(&s->dummy);
-    av_freep(&s->scratchbuf);
-
-    for (i = 0; i < 3; i++) {
-        av_freep(&s->motion_val8[i]);
-        av_freep(&s->motion_val16[i]);
-    }
-
-    av_frame_free(&s->current_picture);
-    av_frame_free(&s->last_picture);
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-static av_cold int svq1_encode_init(AVCodecContext *avctx)
-{
-    SVQ1Context *const s = avctx->priv_data;
-
-    ff_dsputil_init(&s->dsp, avctx);
-    ff_hpeldsp_init(&s->hdsp, avctx->flags);
-
-    avctx->coded_frame = av_frame_alloc();
-    s->current_picture = av_frame_alloc();
-    s->last_picture    = av_frame_alloc();
-    if (!avctx->coded_frame || !s->current_picture || !s->last_picture) {
-        svq1_encode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    s->frame_width  = avctx->width;
-    s->frame_height = avctx->height;
-
-    s->y_block_width  = (s->frame_width  + 15) / 16;
-    s->y_block_height = (s->frame_height + 15) / 16;
-
-    s->c_block_width  = (s->frame_width  / 4 + 15) / 16;
-    s->c_block_height = (s->frame_height / 4 + 15) / 16;
-
-    s->avctx               = avctx;
-    s->m.avctx             = avctx;
-    s->m.picture_structure = PICT_FRAME;
-    s->m.me.temp           =
-    s->m.me.scratchpad     = av_mallocz((avctx->width + 64) *
-                                        2 * 16 * 2 * sizeof(uint8_t));
-    s->m.me.map            = av_mallocz(ME_MAP_SIZE * sizeof(uint32_t));
-    s->m.me.score_map      = av_mallocz(ME_MAP_SIZE * sizeof(uint32_t));
-    s->mb_type             = av_mallocz((s->y_block_width + 1) *
-                                        s->y_block_height * sizeof(int16_t));
-    s->dummy               = av_mallocz((s->y_block_width + 1) *
-                                        s->y_block_height * sizeof(int32_t));
-    ff_h263_encode_init(&s->m); // mv_penalty
-
-    return 0;
-}
-
-static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                             const AVFrame *pict, int *got_packet)
-{
-    SVQ1Context *const s = avctx->priv_data;
-    AVFrame *const p     = avctx->coded_frame;
-    int i, ret;
-
-    if (!pkt->data &&
-        (ret = av_new_packet(pkt, s->y_block_width * s->y_block_height *
-                             MAX_MB_BYTES * 3 + FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    if (avctx->pix_fmt != AV_PIX_FMT_YUV410P) {
-        av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
-        return -1;
-    }
-
-    if (!s->current_picture->data[0]) {
-        ff_get_buffer(avctx, s->current_picture, 0);
-        ff_get_buffer(avctx, s->last_picture, 0);
-        s->scratchbuf = av_malloc(s->current_picture->linesize[0] * 16 * 2);
-    }
-
-    FFSWAP(AVFrame*, s->current_picture, s->last_picture);
-
-    init_put_bits(&s->pb, pkt->data, pkt->size);
-
-    p->pict_type = avctx->gop_size && avctx->frame_number % avctx->gop_size ?
-                   AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
-    p->key_frame = p->pict_type == AV_PICTURE_TYPE_I;
-    p->quality   = pict->quality;
-
-    svq1_write_header(s, p->pict_type);
-    for (i = 0; i < 3; i++)
-        if (svq1_encode_plane(s, i,
-                              pict->data[i],
-                              s->last_picture->data[i],
-                              s->current_picture->data[i],
-                              s->frame_width  / (i ? 4 : 1),
-                              s->frame_height / (i ? 4 : 1),
-                              pict->linesize[i],
-                              s->current_picture->linesize[i]) < 0)
-            return -1;
-
-    // avpriv_align_put_bits(&s->pb);
-    while (put_bits_count(&s->pb) & 31)
-        put_bits(&s->pb, 1, 0);
-
-    flush_put_bits(&s->pb);
-
-    pkt->size = put_bits_count(&s->pb) / 8;
-    if (p->pict_type == AV_PICTURE_TYPE_I)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-AVCodec ff_svq1_encoder = {
-    .name           = "svq1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SVQ1,
-    .priv_data_size = sizeof(SVQ1Context),
-    .init           = svq1_encode_init,
-    .encode2        = svq1_encode_frame,
-    .close          = svq1_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P,
-                                                     AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/svq1enc_cb.h b/deps/libav/libavcodec/svq1enc_cb.h
deleted file mode 100644
index a5cd179..0000000
--- a/deps/libav/libavcodec/svq1enc_cb.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * SVQ1 Encoder
- * Copyright (C) 2004 Mike Melanson <melanson at pcisys.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * svq1 code books.
- */
-
-#ifndef AVCODEC_SVQ1ENC_CB_H
-#define AVCODEC_SVQ1ENC_CB_H
-
-#include <stdint.h>
-
-static const int8_t svq1_inter_codebook_sum[4][16*6] = {
-    { -1,  1, -2,  0,  1, -1, -1, -1, -2, -1,  1, -1, -1,  0, -1, -1,
-       0, -1, -1, -1, -1,  0, -1,  0,  0,  0, -3,  1, -1,  0,  1, -1,
-       1, -1,  2,  2,  1,  1,  2,  0,  0,  0, -1,  1,  1,  0,  0,  0,
-       1, -1,  0,  1, -1,  1,  1,  0,  1,  0, -1,  1,  1,  0,  0,  0,
-      -2,  0,  0, -2,  0,  0, -2,  0, -2, -1, -2, -1,  0,  0, -1,  0,
-       1,  0,  1, -1,  2,  2,  1,  2,  2,  1,  0,  1,  1,  0,  1,  1, },
-    { -2,  1, -1, -1,  1,  0,  1, -1, -1, -1,  1, -1,  0, -1,  0, -1,
-       0,  0,  0, -2,  0,  1,  0, -1, -1,  0,  2, -3,  1, -2,  3, -1,
-       2,  0,  2,  1,  1, -1,  1,  1,  0,  0,  1,  1,  2, -2,  1,  0,
-      -2, -1,  2, -2, -2,  0, -3,  0, -1,  0, -1,  0, -1,  0, -2, -3,
-       1, -2, -2, -1,  1, -1, -1,  1, -1,  1,  1,  0, -2,  0,  1,  1,
-       1,  1,  2,  1,  0,  0, -1,  0,  0,  1,  0,  1, -1,  1,  0,  2, },
-    {  0,  0,  0, -3,  1,  1,  1, -3,  0, -1,  0, -3,  1, -3,  0, -2,
-       1,  2, -1, -3,  0, -3,  1, -1,  0, -1,  0,  0,  1,  2,  1,  1,
-      -1,  2, -3,  3,  1,  0, -5,  1,  0, -1, -3,  1,  0,  2,  0, -3,
-       4,  2,  0, -2,  1, -2,  3, -2,  1,  1,  0, -1,  2,  5,  3,  1,
-      -1,  0,  2, -3, -2,  0,  0, -2,  2, -3, -1, -1,  2,  1,  0, -2,
-       3, -1,  1, -1,  2,  4,  0,  1,  0,  1,  0, -1, -3, -2, -1,  0, },
-    {  0,  2, -1, -1,  2, -4, -2,  3,  0, -1, -5,  1,  0,  1,  0,  6,
-      -2,  2,  0,  1,  1, -1, -1, -2,  1, -2, -1,  0,  2, -2, -2, -1,
-      -4,  2, -1, -3, -1, -2,  2, -1,  2, -1,  2,  0,  3, -3, -3,  0,
-      -3,  0,  0, -2,  4, -4,  0, -1,  4,  0, -2, -2,  3, -2,  0,  4,
-       5,  0,  1,  0, -3,  3,  3,  2,  0,  0,  1,  2, -5, -2, -3,  0,
-      -3,  2, -2,  2, -2,  4,  7, -3,  4,  2,  3,  2, -1,  0, -3,  1, }
-};
-
-static const int8_t svq1_intra_codebook_sum[4][16*6] = {
-    {  0,  0,  0, -1, -1, -1, -1, -2,  0, -1, -1,  0, -1,  0,  1,  0,
-       1,  0, -1,  1,  0,  0, -1,  1, -1,  0,  0,  0, -1,  1,  0,  0,
-      -1,  0,  0,  1, -1,  1,  0, -1, -1,  0,  1,  1,  0,  0, -1,  1,
-       0,  1,  0,  0,  1, -1,  0,  0,  0, -1,  1,  0,  1,  0, -2,  1,
-       0, -1,  1,  0,  0,  0,  1,  0, -1,  0,  0,  0, -1,  0,  0,  0,
-       0,  1,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0, -1,  1,  1, -1, },
-    { -1, -2,  0, -1,  1,  0, -1,  0, -1, -4, -1, -2, -1, -2,  1, -2,
-       0,  0,  4, -2, -1,  1,  1,  0,  2,  1,  1,  0,  2,  0,  0,  0,
-       1,  1,  0, -1, -1, -1,  1,  0, -1, -3, -3,  1, -1,  1, -2, -1,
-       1, -1,  0,  1,  2,  1, -1, -1,  1,  1,  1,  2,  1,  0,  1, -2,
-      -2,  0, -1, -2, -2,  0, -1, -1, -1,  0,  1,  0, -1, -1,  0, -1,
-       0,  2,  1,  2,  2,  1, -1,  1,  0,  2,  0, -1,  1,  0,  0,  0, },
-    { -2,  0, -1, -1,  1,  1, -2,  0, -2,  0,  1, -2, -2,  1, -1, -1,
-       3, -2,  0, -3, -4, -3,  2,  1,  0,  3, -2,  2,  3,  2,  2, -1,
-      -3,  1,  0,  1,  0,  0,  0,  1, -2,  1, -2, -2, -1, -2, -2,  2,
-       0, -4,  0,  2, -1,  0,  2,  2,  2,  1,  0, -1, -1,  1, -3,  2,
-       2,  1,  0,  3,  1, -1,  1,  3,  1,  0,  1,  1,  2, -1,  1, -1,
-      -2, -1,  0, -1,  1, -1,  1, -2, -2, -1, -1, -3,  1, -4, -3,  1, },
-    { -2,  0, -2,  3, -1, -1,  0,  2,  2, -1, -3,  2,  1,  0, -2, -1,
-      -3, -2, -2,  1,  2, -3,  0,  1, -5, -2, -3,  0, -2, -1,  2,  0,
-      -1, -1,  0, -2,  1,  3, -7, -2, -2, -1,  2, -1,  0,  3,  1,  3,
-       1,  0,  0,  1,  2,  3,  1,  2,  0, -2, -2,  1,  1,  2,  2,  3,
-       4,  1, -1,  2, -2,  4,  0,  0,  0,  4,  2,  0, -2, -2,  2, -4,
-      -1,  5, -2, -2, -3,  2, -3, -1,  3, -3,  0,  4,  3,  0,  1, -2, }
-};
-
-#endif /* AVCODEC_SVQ1ENC_CB_H */
diff --git a/deps/libav/libavcodec/svq3.c b/deps/libav/libavcodec/svq3.c
deleted file mode 100644
index fac95ee..0000000
--- a/deps/libav/libavcodec/svq3.c
+++ /dev/null
@@ -1,1329 +0,0 @@
-/*
- * Copyright (c) 2003 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * How to use this decoder:
- * SVQ3 data is transported within Apple Quicktime files. Quicktime files
- * have stsd atoms to describe media trak properties. A stsd atom for a
- * video trak contains 1 or more ImageDescription atoms. These atoms begin
- * with the 4-byte length of the atom followed by the codec fourcc. Some
- * decoders need information in this atom to operate correctly. Such
- * is the case with SVQ3. In order to get the best use out of this decoder,
- * the calling app must make the SVQ3 ImageDescription atom available
- * via the AVCodecContext's extradata[_size] field:
- *
- * AVCodecContext.extradata = pointer to ImageDescription, first characters
- * are expected to be 'S', 'V', 'Q', and '3', NOT the 4-byte atom length
- * AVCodecContext.extradata_size = size of ImageDescription atom memory
- * buffer (which will be the same as the ImageDescription atom size field
- * from the QT file, minus 4 bytes since the length is missing)
- *
- * You will know you have these parameters passed correctly when the decoder
- * correctly decodes this file:
- *  http://samples.libav.org/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
- */
-
-#include "libavutil/attributes.h"
-#include "internal.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h264.h"
-
-#include "h264data.h" // FIXME FIXME FIXME
-
-#include "h264_mvpred.h"
-#include "golomb.h"
-#include "hpeldsp.h"
-#include "rectangle.h"
-
-#if CONFIG_ZLIB
-#include <zlib.h>
-#endif
-
-#include "svq1.h"
-#include "svq3.h"
-
-/**
- * @file
- * svq3 decoder.
- */
-
-typedef struct {
-    H264Context h;
-    HpelDSPContext hdsp;
-    Picture *cur_pic;
-    Picture *next_pic;
-    Picture *last_pic;
-    int halfpel_flag;
-    int thirdpel_flag;
-    int unknown_flag;
-    int next_slice_index;
-    uint32_t watermark_key;
-    int adaptive_quant;
-    int next_p_frame_damaged;
-    int h_edge_pos;
-    int v_edge_pos;
-    int last_frame_output;
-} SVQ3Context;
-
-#define FULLPEL_MODE  1
-#define HALFPEL_MODE  2
-#define THIRDPEL_MODE 3
-#define PREDICT_MODE  4
-
-/* dual scan (from some older h264 draft)
- * o-->o-->o   o
- *         |  /|
- * o   o   o / o
- * | / |   |/  |
- * o   o   o   o
- *   /
- * o-->o-->o-->o
- */
-static const uint8_t svq3_scan[16] = {
-    0 + 0 * 4, 1 + 0 * 4, 2 + 0 * 4, 2 + 1 * 4,
-    2 + 2 * 4, 3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4,
-    0 + 1 * 4, 0 + 2 * 4, 1 + 1 * 4, 1 + 2 * 4,
-    0 + 3 * 4, 1 + 3 * 4, 2 + 3 * 4, 3 + 3 * 4,
-};
-
-static const uint8_t luma_dc_zigzag_scan[16] = {
-    0 * 16 + 0 * 64, 1 * 16 + 0 * 64, 2 * 16 + 0 * 64, 0 * 16 + 2 * 64,
-    3 * 16 + 0 * 64, 0 * 16 + 1 * 64, 1 * 16 + 1 * 64, 2 * 16 + 1 * 64,
-    1 * 16 + 2 * 64, 2 * 16 + 2 * 64, 3 * 16 + 2 * 64, 0 * 16 + 3 * 64,
-    3 * 16 + 1 * 64, 1 * 16 + 3 * 64, 2 * 16 + 3 * 64, 3 * 16 + 3 * 64,
-};
-
-static const uint8_t svq3_pred_0[25][2] = {
-    { 0, 0 },
-    { 1, 0 }, { 0, 1 },
-    { 0, 2 }, { 1, 1 }, { 2, 0 },
-    { 3, 0 }, { 2, 1 }, { 1, 2 }, { 0, 3 },
-    { 0, 4 }, { 1, 3 }, { 2, 2 }, { 3, 1 }, { 4, 0 },
-    { 4, 1 }, { 3, 2 }, { 2, 3 }, { 1, 4 },
-    { 2, 4 }, { 3, 3 }, { 4, 2 },
-    { 4, 3 }, { 3, 4 },
-    { 4, 4 }
-};
-
-static const int8_t svq3_pred_1[6][6][5] = {
-    { { 2, -1, -1, -1, -1 }, { 2, 1, -1, -1, -1 }, { 1, 2, -1, -1, -1 },
-      { 2,  1, -1, -1, -1 }, { 1, 2, -1, -1, -1 }, { 1, 2, -1, -1, -1 } },
-    { { 0,  2, -1, -1, -1 }, { 0, 2,  1,  4,  3 }, { 0, 1,  2,  4,  3 },
-      { 0,  2,  1,  4,  3 }, { 2, 0,  1,  3,  4 }, { 0, 4,  2,  1,  3 } },
-    { { 2,  0, -1, -1, -1 }, { 2, 1,  0,  4,  3 }, { 1, 2,  4,  0,  3 },
-      { 2,  1,  0,  4,  3 }, { 2, 1,  4,  3,  0 }, { 1, 2,  4,  0,  3 } },
-    { { 2,  0, -1, -1, -1 }, { 2, 0,  1,  4,  3 }, { 1, 2,  0,  4,  3 },
-      { 2,  1,  0,  4,  3 }, { 2, 1,  3,  4,  0 }, { 2, 4,  1,  0,  3 } },
-    { { 0,  2, -1, -1, -1 }, { 0, 2,  1,  3,  4 }, { 1, 2,  3,  0,  4 },
-      { 2,  0,  1,  3,  4 }, { 2, 1,  3,  0,  4 }, { 2, 0,  4,  3,  1 } },
-    { { 0,  2, -1, -1, -1 }, { 0, 2,  4,  1,  3 }, { 1, 4,  2,  0,  3 },
-      { 4,  2,  0,  1,  3 }, { 2, 0,  1,  4,  3 }, { 4, 2,  1,  0,  3 } },
-};
-
-static const struct {
-    uint8_t run;
-    uint8_t level;
-} svq3_dct_tables[2][16] = {
-    { { 0, 0 }, { 0, 1 }, { 1, 1 }, { 2, 1 }, { 0, 2 }, { 3, 1 }, { 4, 1 }, { 5, 1 },
-      { 0, 3 }, { 1, 2 }, { 2, 2 }, { 6, 1 }, { 7, 1 }, { 8, 1 }, { 9, 1 }, { 0, 4 } },
-    { { 0, 0 }, { 0, 1 }, { 1, 1 }, { 0, 2 }, { 2, 1 }, { 0, 3 }, { 0, 4 }, { 0, 5 },
-      { 3, 1 }, { 4, 1 }, { 1, 2 }, { 1, 3 }, { 0, 6 }, { 0, 7 }, { 0, 8 }, { 0, 9 } }
-};
-
-static const uint32_t svq3_dequant_coeff[32] = {
-     3881,  4351,  4890,  5481,   6154,   6914,   7761,   8718,
-     9781, 10987, 12339, 13828,  15523,  17435,  19561,  21873,
-    24552, 27656, 30847, 34870,  38807,  43747,  49103,  54683,
-    61694, 68745, 77615, 89113, 100253, 109366, 126635, 141533
-};
-
-void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp)
-{
-    const int qmul = svq3_dequant_coeff[qp];
-#define stride 16
-    int i;
-    int temp[16];
-    static const uint8_t x_offset[4] = { 0, 1 * stride, 4 * stride, 5 * stride };
-
-    for (i = 0; i < 4; i++) {
-        const int z0 = 13 * (input[4 * i + 0] +      input[4 * i + 2]);
-        const int z1 = 13 * (input[4 * i + 0] -      input[4 * i + 2]);
-        const int z2 =  7 *  input[4 * i + 1] - 17 * input[4 * i + 3];
-        const int z3 = 17 *  input[4 * i + 1] +  7 * input[4 * i + 3];
-
-        temp[4 * i + 0] = z0 + z3;
-        temp[4 * i + 1] = z1 + z2;
-        temp[4 * i + 2] = z1 - z2;
-        temp[4 * i + 3] = z0 - z3;
-    }
-
-    for (i = 0; i < 4; i++) {
-        const int offset = x_offset[i];
-        const int z0     = 13 * (temp[4 * 0 + i] +      temp[4 * 2 + i]);
-        const int z1     = 13 * (temp[4 * 0 + i] -      temp[4 * 2 + i]);
-        const int z2     =  7 *  temp[4 * 1 + i] - 17 * temp[4 * 3 + i];
-        const int z3     = 17 *  temp[4 * 1 + i] +  7 * temp[4 * 3 + i];
-
-        output[stride *  0 + offset] = (z0 + z3) * qmul + 0x80000 >> 20;
-        output[stride *  2 + offset] = (z1 + z2) * qmul + 0x80000 >> 20;
-        output[stride *  8 + offset] = (z1 - z2) * qmul + 0x80000 >> 20;
-        output[stride * 10 + offset] = (z0 - z3) * qmul + 0x80000 >> 20;
-    }
-}
-#undef stride
-
-void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block,
-                        int stride, int qp, int dc)
-{
-    const int qmul = svq3_dequant_coeff[qp];
-    int i;
-
-    if (dc) {
-        dc       = 13 * 13 * (dc == 1 ? 1538 * block[0]
-                                      : qmul * (block[0] >> 3) / 2);
-        block[0] = 0;
-    }
-
-    for (i = 0; i < 4; i++) {
-        const int z0 = 13 * (block[0 + 4 * i] +      block[2 + 4 * i]);
-        const int z1 = 13 * (block[0 + 4 * i] -      block[2 + 4 * i]);
-        const int z2 =  7 *  block[1 + 4 * i] - 17 * block[3 + 4 * i];
-        const int z3 = 17 *  block[1 + 4 * i] +  7 * block[3 + 4 * i];
-
-        block[0 + 4 * i] = z0 + z3;
-        block[1 + 4 * i] = z1 + z2;
-        block[2 + 4 * i] = z1 - z2;
-        block[3 + 4 * i] = z0 - z3;
-    }
-
-    for (i = 0; i < 4; i++) {
-        const int z0 = 13 * (block[i + 4 * 0] +      block[i + 4 * 2]);
-        const int z1 = 13 * (block[i + 4 * 0] -      block[i + 4 * 2]);
-        const int z2 =  7 *  block[i + 4 * 1] - 17 * block[i + 4 * 3];
-        const int z3 = 17 *  block[i + 4 * 1] +  7 * block[i + 4 * 3];
-        const int rr = (dc + 0x80000);
-
-        dst[i + stride * 0] = av_clip_uint8(dst[i + stride * 0] + ((z0 + z3) * qmul + rr >> 20));
-        dst[i + stride * 1] = av_clip_uint8(dst[i + stride * 1] + ((z1 + z2) * qmul + rr >> 20));
-        dst[i + stride * 2] = av_clip_uint8(dst[i + stride * 2] + ((z1 - z2) * qmul + rr >> 20));
-        dst[i + stride * 3] = av_clip_uint8(dst[i + stride * 3] + ((z0 - z3) * qmul + rr >> 20));
-    }
-
-    memset(block, 0, 16 * sizeof(int16_t));
-}
-
-static inline int svq3_decode_block(GetBitContext *gb, int16_t *block,
-                                    int index, const int type)
-{
-    static const uint8_t *const scan_patterns[4] =
-    { luma_dc_zigzag_scan, zigzag_scan, svq3_scan, chroma_dc_scan };
-
-    int run, level, limit;
-    unsigned vlc;
-    const int intra           = 3 * type >> 2;
-    const uint8_t *const scan = scan_patterns[type];
-
-    for (limit = (16 >> intra); index < 16; index = limit, limit += 8) {
-        for (; (vlc = svq3_get_ue_golomb(gb)) != 0; index++) {
-            int sign = (vlc & 1) ? 0 : -1;
-            vlc      = vlc + 1 >> 1;
-
-            if (type == 3) {
-                if (vlc < 3) {
-                    run   = 0;
-                    level = vlc;
-                } else if (vlc < 4) {
-                    run   = 1;
-                    level = 1;
-                } else {
-                    run   = vlc & 0x3;
-                    level = (vlc + 9 >> 2) - run;
-                }
-            } else {
-                if (vlc < 16) {
-                    run   = svq3_dct_tables[intra][vlc].run;
-                    level = svq3_dct_tables[intra][vlc].level;
-                } else if (intra) {
-                    run   = vlc & 0x7;
-                    level = (vlc >> 3) +
-                            ((run == 0) ? 8 : ((run < 2) ? 2 : ((run < 5) ? 0 : -1)));
-                } else {
-                    run   = vlc & 0xF;
-                    level = (vlc >> 4) +
-                            ((run == 0) ? 4 : ((run < 3) ? 2 : ((run < 10) ? 1 : 0)));
-                }
-            }
-
-            if ((index += run) >= limit)
-                return -1;
-
-            block[scan[index]] = (level ^ sign) - sign;
-        }
-
-        if (type != 2) {
-            break;
-        }
-    }
-
-    return 0;
-}
-
-static inline void svq3_mc_dir_part(SVQ3Context *s,
-                                    int x, int y, int width, int height,
-                                    int mx, int my, int dxy,
-                                    int thirdpel, int dir, int avg)
-{
-    H264Context *h     = &s->h;
-    const Picture *pic = (dir == 0) ? s->last_pic : s->next_pic;
-    uint8_t *src, *dest;
-    int i, emu = 0;
-    int blocksize = 2 - (width >> 3); // 16->0, 8->1, 4->2
-
-    mx += x;
-    my += y;
-
-    if (mx < 0 || mx >= s->h_edge_pos - width  - 1 ||
-        my < 0 || my >= s->v_edge_pos - height - 1) {
-        emu = 1;
-        mx = av_clip(mx, -16, s->h_edge_pos - width  + 15);
-        my = av_clip(my, -16, s->v_edge_pos - height + 15);
-    }
-
-    /* form component predictions */
-    dest = h->cur_pic.f.data[0] + x + y * h->linesize;
-    src  = pic->f.data[0] + mx + my * h->linesize;
-
-    if (emu) {
-        h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src,
-                                 h->linesize, h->linesize,
-                                 width + 1, height + 1,
-                                 mx, my, s->h_edge_pos, s->v_edge_pos);
-        src = h->edge_emu_buffer;
-    }
-    if (thirdpel)
-        (avg ? h->dsp.avg_tpel_pixels_tab
-             : h->dsp.put_tpel_pixels_tab)[dxy](dest, src, h->linesize,
-                                                width, height);
-    else
-        (avg ? s->hdsp.avg_pixels_tab
-             : s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src, h->linesize,
-                                                       height);
-
-    if (!(h->flags & CODEC_FLAG_GRAY)) {
-        mx     = mx + (mx < (int) x) >> 1;
-        my     = my + (my < (int) y) >> 1;
-        width  = width  >> 1;
-        height = height >> 1;
-        blocksize++;
-
-        for (i = 1; i < 3; i++) {
-            dest = h->cur_pic.f.data[i] + (x >> 1) + (y >> 1) * h->uvlinesize;
-            src  = pic->f.data[i] + mx + my * h->uvlinesize;
-
-            if (emu) {
-                h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src,
-                                         h->uvlinesize, h->uvlinesize,
-                                         width + 1, height + 1,
-                                         mx, my, (s->h_edge_pos >> 1),
-                                         s->v_edge_pos >> 1);
-                src = h->edge_emu_buffer;
-            }
-            if (thirdpel)
-                (avg ? h->dsp.avg_tpel_pixels_tab
-                     : h->dsp.put_tpel_pixels_tab)[dxy](dest, src,
-                                                        h->uvlinesize,
-                                                        width, height);
-            else
-                (avg ? s->hdsp.avg_pixels_tab
-                     : s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src,
-                                                               h->uvlinesize,
-                                                               height);
-        }
-    }
-}
-
-static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode,
-                              int dir, int avg)
-{
-    int i, j, k, mx, my, dx, dy, x, y;
-    H264Context *h          = &s->h;
-    const int part_width    = ((size & 5) == 4) ? 4 : 16 >> (size & 1);
-    const int part_height   = 16 >> ((unsigned)(size + 1) / 3);
-    const int extra_width   = (mode == PREDICT_MODE) ? -16 * 6 : 0;
-    const int h_edge_pos    = 6 * (s->h_edge_pos - part_width)  - extra_width;
-    const int v_edge_pos    = 6 * (s->v_edge_pos - part_height) - extra_width;
-
-    for (i = 0; i < 16; i += part_height)
-        for (j = 0; j < 16; j += part_width) {
-            const int b_xy = (4 * h->mb_x + (j >> 2)) +
-                             (4 * h->mb_y + (i >> 2)) * h->b_stride;
-            int dxy;
-            x = 16 * h->mb_x + j;
-            y = 16 * h->mb_y + i;
-            k = (j >> 2 & 1) + (i >> 1 & 2) +
-                (j >> 1 & 4) + (i      & 8);
-
-            if (mode != PREDICT_MODE) {
-                pred_motion(h, k, part_width >> 2, dir, 1, &mx, &my);
-            } else {
-                mx = s->next_pic->motion_val[0][b_xy][0] << 1;
-                my = s->next_pic->motion_val[0][b_xy][1] << 1;
-
-                if (dir == 0) {
-                    mx = mx * h->frame_num_offset /
-                         h->prev_frame_num_offset + 1 >> 1;
-                    my = my * h->frame_num_offset /
-                         h->prev_frame_num_offset + 1 >> 1;
-                } else {
-                    mx = mx * (h->frame_num_offset - h->prev_frame_num_offset) /
-                         h->prev_frame_num_offset + 1 >> 1;
-                    my = my * (h->frame_num_offset - h->prev_frame_num_offset) /
-                         h->prev_frame_num_offset + 1 >> 1;
-                }
-            }
-
-            /* clip motion vector prediction to frame border */
-            mx = av_clip(mx, extra_width - 6 * x, h_edge_pos - 6 * x);
-            my = av_clip(my, extra_width - 6 * y, v_edge_pos - 6 * y);
-
-            /* get (optional) motion vector differential */
-            if (mode == PREDICT_MODE) {
-                dx = dy = 0;
-            } else {
-                dy = svq3_get_se_golomb(&h->gb);
-                dx = svq3_get_se_golomb(&h->gb);
-
-                if (dx == INVALID_VLC || dy == INVALID_VLC) {
-                    av_log(h->avctx, AV_LOG_ERROR, "invalid MV vlc\n");
-                    return -1;
-                }
-            }
-
-            /* compute motion vector */
-            if (mode == THIRDPEL_MODE) {
-                int fx, fy;
-                mx  = (mx + 1 >> 1) + dx;
-                my  = (my + 1 >> 1) + dy;
-                fx  = (unsigned)(mx + 0x3000) / 3 - 0x1000;
-                fy  = (unsigned)(my + 0x3000) / 3 - 0x1000;
-                dxy = (mx - 3 * fx) + 4 * (my - 3 * fy);
-
-                svq3_mc_dir_part(s, x, y, part_width, part_height,
-                                 fx, fy, dxy, 1, dir, avg);
-                mx += mx;
-                my += my;
-            } else if (mode == HALFPEL_MODE || mode == PREDICT_MODE) {
-                mx  = (unsigned)(mx + 1 + 0x3000) / 3 + dx - 0x1000;
-                my  = (unsigned)(my + 1 + 0x3000) / 3 + dy - 0x1000;
-                dxy = (mx & 1) + 2 * (my & 1);
-
-                svq3_mc_dir_part(s, x, y, part_width, part_height,
-                                 mx >> 1, my >> 1, dxy, 0, dir, avg);
-                mx *= 3;
-                my *= 3;
-            } else {
-                mx = (unsigned)(mx + 3 + 0x6000) / 6 + dx - 0x1000;
-                my = (unsigned)(my + 3 + 0x6000) / 6 + dy - 0x1000;
-
-                svq3_mc_dir_part(s, x, y, part_width, part_height,
-                                 mx, my, 0, 0, dir, avg);
-                mx *= 6;
-                my *= 6;
-            }
-
-            /* update mv_cache */
-            if (mode != PREDICT_MODE) {
-                int32_t mv = pack16to32(mx, my);
-
-                if (part_height == 8 && i < 8) {
-                    AV_WN32A(h->mv_cache[dir][scan8[k] + 1 * 8], mv);
-
-                    if (part_width == 8 && j < 8)
-                        AV_WN32A(h->mv_cache[dir][scan8[k] + 1 + 1 * 8], mv);
-                }
-                if (part_width == 8 && j < 8)
-                    AV_WN32A(h->mv_cache[dir][scan8[k] + 1], mv);
-                if (part_width == 4 || part_height == 4)
-                    AV_WN32A(h->mv_cache[dir][scan8[k]], mv);
-            }
-
-            /* write back motion vectors */
-            fill_rectangle(h->cur_pic.motion_val[dir][b_xy],
-                           part_width >> 2, part_height >> 2, h->b_stride,
-                           pack16to32(mx, my), 4);
-        }
-
-    return 0;
-}
-
-static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
-{
-    H264Context *h = &s->h;
-    int i, j, k, m, dir, mode;
-    int cbp = 0;
-    uint32_t vlc;
-    int8_t *top, *left;
-    const int mb_xy         = h->mb_xy;
-    const int b_xy          = 4 * h->mb_x + 4 * h->mb_y * h->b_stride;
-
-    h->top_samples_available      = (h->mb_y == 0) ? 0x33FF : 0xFFFF;
-    h->left_samples_available     = (h->mb_x == 0) ? 0x5F5F : 0xFFFF;
-    h->topright_samples_available = 0xFFFF;
-
-    if (mb_type == 0) {           /* SKIP */
-        if (h->pict_type == AV_PICTURE_TYPE_P ||
-            s->next_pic->mb_type[mb_xy] == -1) {
-            svq3_mc_dir_part(s, 16 * h->mb_x, 16 * h->mb_y, 16, 16,
-                             0, 0, 0, 0, 0, 0);
-
-            if (h->pict_type == AV_PICTURE_TYPE_B)
-                svq3_mc_dir_part(s, 16 * h->mb_x, 16 * h->mb_y, 16, 16,
-                                 0, 0, 0, 0, 1, 1);
-
-            mb_type = MB_TYPE_SKIP;
-        } else {
-            mb_type = FFMIN(s->next_pic->mb_type[mb_xy], 6);
-            if (svq3_mc_dir(s, mb_type, PREDICT_MODE, 0, 0) < 0)
-                return -1;
-            if (svq3_mc_dir(s, mb_type, PREDICT_MODE, 1, 1) < 0)
-                return -1;
-
-            mb_type = MB_TYPE_16x16;
-        }
-    } else if (mb_type < 8) {     /* INTER */
-        if (s->thirdpel_flag && s->halfpel_flag == !get_bits1(&h->gb))
-            mode = THIRDPEL_MODE;
-        else if (s->halfpel_flag &&
-                 s->thirdpel_flag == !get_bits1(&h->gb))
-            mode = HALFPEL_MODE;
-        else
-            mode = FULLPEL_MODE;
-
-        /* fill caches */
-        /* note ref_cache should contain here:
-         *  ????????
-         *  ???11111
-         *  N??11111
-         *  N??11111
-         *  N??11111
-         */
-
-        for (m = 0; m < 2; m++) {
-            if (h->mb_x > 0 && h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) {
-                for (i = 0; i < 4; i++)
-                    AV_COPY32(h->mv_cache[m][scan8[0] - 1 + i * 8],
-                              h->cur_pic.motion_val[m][b_xy - 1 + i * h->b_stride]);
-            } else {
-                for (i = 0; i < 4; i++)
-                    AV_ZERO32(h->mv_cache[m][scan8[0] - 1 + i * 8]);
-            }
-            if (h->mb_y > 0) {
-                memcpy(h->mv_cache[m][scan8[0] - 1 * 8],
-                       h->cur_pic.motion_val[m][b_xy - h->b_stride],
-                       4 * 2 * sizeof(int16_t));
-                memset(&h->ref_cache[m][scan8[0] - 1 * 8],
-                       (h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4);
-
-                if (h->mb_x < h->mb_width - 1) {
-                    AV_COPY32(h->mv_cache[m][scan8[0] + 4 - 1 * 8],
-                              h->cur_pic.motion_val[m][b_xy - h->b_stride + 4]);
-                    h->ref_cache[m][scan8[0] + 4 - 1 * 8] =
-                        (h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride + 1] + 6] == -1 ||
-                         h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1;
-                } else
-                    h->ref_cache[m][scan8[0] + 4 - 1 * 8] = PART_NOT_AVAILABLE;
-                if (h->mb_x > 0) {
-                    AV_COPY32(h->mv_cache[m][scan8[0] - 1 - 1 * 8],
-                              h->cur_pic.motion_val[m][b_xy - h->b_stride - 1]);
-                    h->ref_cache[m][scan8[0] - 1 - 1 * 8] =
-                        (h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride - 1] + 3] == -1) ? PART_NOT_AVAILABLE : 1;
-                } else
-                    h->ref_cache[m][scan8[0] - 1 - 1 * 8] = PART_NOT_AVAILABLE;
-            } else
-                memset(&h->ref_cache[m][scan8[0] - 1 * 8 - 1],
-                       PART_NOT_AVAILABLE, 8);
-
-            if (h->pict_type != AV_PICTURE_TYPE_B)
-                break;
-        }
-
-        /* decode motion vector(s) and form prediction(s) */
-        if (h->pict_type == AV_PICTURE_TYPE_P) {
-            if (svq3_mc_dir(s, mb_type - 1, mode, 0, 0) < 0)
-                return -1;
-        } else {        /* AV_PICTURE_TYPE_B */
-            if (mb_type != 2) {
-                if (svq3_mc_dir(s, 0, mode, 0, 0) < 0)
-                    return -1;
-            } else {
-                for (i = 0; i < 4; i++)
-                    memset(h->cur_pic.motion_val[0][b_xy + i * h->b_stride],
-                           0, 4 * 2 * sizeof(int16_t));
-            }
-            if (mb_type != 1) {
-                if (svq3_mc_dir(s, 0, mode, 1, mb_type == 3) < 0)
-                    return -1;
-            } else {
-                for (i = 0; i < 4; i++)
-                    memset(h->cur_pic.motion_val[1][b_xy + i * h->b_stride],
-                           0, 4 * 2 * sizeof(int16_t));
-            }
-        }
-
-        mb_type = MB_TYPE_16x16;
-    } else if (mb_type == 8 || mb_type == 33) {   /* INTRA4x4 */
-        memset(h->intra4x4_pred_mode_cache, -1, 8 * 5 * sizeof(int8_t));
-
-        if (mb_type == 8) {
-            if (h->mb_x > 0) {
-                for (i = 0; i < 4; i++)
-                    h->intra4x4_pred_mode_cache[scan8[0] - 1 + i * 8] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6 - i];
-                if (h->intra4x4_pred_mode_cache[scan8[0] - 1] == -1)
-                    h->left_samples_available = 0x5F5F;
-            }
-            if (h->mb_y > 0) {
-                h->intra4x4_pred_mode_cache[4 + 8 * 0] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 0];
-                h->intra4x4_pred_mode_cache[5 + 8 * 0] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 1];
-                h->intra4x4_pred_mode_cache[6 + 8 * 0] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 2];
-                h->intra4x4_pred_mode_cache[7 + 8 * 0] = h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 3];
-
-                if (h->intra4x4_pred_mode_cache[4 + 8 * 0] == -1)
-                    h->top_samples_available = 0x33FF;
-            }
-
-            /* decode prediction codes for luma blocks */
-            for (i = 0; i < 16; i += 2) {
-                vlc = svq3_get_ue_golomb(&h->gb);
-
-                if (vlc >= 25) {
-                    av_log(h->avctx, AV_LOG_ERROR, "luma prediction:%d\n", vlc);
-                    return -1;
-                }
-
-                left = &h->intra4x4_pred_mode_cache[scan8[i] - 1];
-                top  = &h->intra4x4_pred_mode_cache[scan8[i] - 8];
-
-                left[1] = svq3_pred_1[top[0] + 1][left[0] + 1][svq3_pred_0[vlc][0]];
-                left[2] = svq3_pred_1[top[1] + 1][left[1] + 1][svq3_pred_0[vlc][1]];
-
-                if (left[1] == -1 || left[2] == -1) {
-                    av_log(h->avctx, AV_LOG_ERROR, "weird prediction\n");
-                    return -1;
-                }
-            }
-        } else {    /* mb_type == 33, DC_128_PRED block type */
-            for (i = 0; i < 4; i++)
-                memset(&h->intra4x4_pred_mode_cache[scan8[0] + 8 * i], DC_PRED, 4);
-        }
-
-        write_back_intra_pred_mode(h);
-
-        if (mb_type == 8) {
-            ff_h264_check_intra4x4_pred_mode(h);
-
-            h->top_samples_available  = (h->mb_y == 0) ? 0x33FF : 0xFFFF;
-            h->left_samples_available = (h->mb_x == 0) ? 0x5F5F : 0xFFFF;
-        } else {
-            for (i = 0; i < 4; i++)
-                memset(&h->intra4x4_pred_mode_cache[scan8[0] + 8 * i], DC_128_PRED, 4);
-
-            h->top_samples_available  = 0x33FF;
-            h->left_samples_available = 0x5F5F;
-        }
-
-        mb_type = MB_TYPE_INTRA4x4;
-    } else {                      /* INTRA16x16 */
-        dir = i_mb_type_info[mb_type - 8].pred_mode;
-        dir = (dir >> 1) ^ 3 * (dir & 1) ^ 1;
-
-        if ((h->intra16x16_pred_mode = ff_h264_check_intra_pred_mode(h, dir, 0)) < 0) {
-            av_log(h->avctx, AV_LOG_ERROR, "ff_h264_check_intra_pred_mode < 0\n");
-            return h->intra16x16_pred_mode;
-        }
-
-        cbp     = i_mb_type_info[mb_type - 8].cbp;
-        mb_type = MB_TYPE_INTRA16x16;
-    }
-
-    if (!IS_INTER(mb_type) && h->pict_type != AV_PICTURE_TYPE_I) {
-        for (i = 0; i < 4; i++)
-            memset(h->cur_pic.motion_val[0][b_xy + i * h->b_stride],
-                   0, 4 * 2 * sizeof(int16_t));
-        if (h->pict_type == AV_PICTURE_TYPE_B) {
-            for (i = 0; i < 4; i++)
-                memset(h->cur_pic.motion_val[1][b_xy + i * h->b_stride],
-                       0, 4 * 2 * sizeof(int16_t));
-        }
-    }
-    if (!IS_INTRA4x4(mb_type)) {
-        memset(h->intra4x4_pred_mode + h->mb2br_xy[mb_xy], DC_PRED, 8);
-    }
-    if (!IS_SKIP(mb_type) || h->pict_type == AV_PICTURE_TYPE_B) {
-        memset(h->non_zero_count_cache + 8, 0, 14 * 8 * sizeof(uint8_t));
-    }
-
-    if (!IS_INTRA16x16(mb_type) &&
-        (!IS_SKIP(mb_type) || h->pict_type == AV_PICTURE_TYPE_B)) {
-        if ((vlc = svq3_get_ue_golomb(&h->gb)) >= 48) {
-            av_log(h->avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc);
-            return -1;
-        }
-
-        cbp = IS_INTRA(mb_type) ? golomb_to_intra4x4_cbp[vlc]
-                                : golomb_to_inter_cbp[vlc];
-    }
-    if (IS_INTRA16x16(mb_type) ||
-        (h->pict_type != AV_PICTURE_TYPE_I && s->adaptive_quant && cbp)) {
-        h->qscale += svq3_get_se_golomb(&h->gb);
-
-        if (h->qscale > 31u) {
-            av_log(h->avctx, AV_LOG_ERROR, "qscale:%d\n", h->qscale);
-            return -1;
-        }
-    }
-    if (IS_INTRA16x16(mb_type)) {
-        AV_ZERO128(h->mb_luma_dc[0] + 0);
-        AV_ZERO128(h->mb_luma_dc[0] + 8);
-        if (svq3_decode_block(&h->gb, h->mb_luma_dc[0], 0, 1)) {
-            av_log(h->avctx, AV_LOG_ERROR,
-                   "error while decoding intra luma dc\n");
-            return -1;
-        }
-    }
-
-    if (cbp) {
-        const int index = IS_INTRA16x16(mb_type) ? 1 : 0;
-        const int type  = ((h->qscale < 24 && IS_INTRA4x4(mb_type)) ? 2 : 1);
-
-        for (i = 0; i < 4; i++)
-            if ((cbp & (1 << i))) {
-                for (j = 0; j < 4; j++) {
-                    k = index ? (1 * (j & 1) + 2 * (i & 1) +
-                                 2 * (j & 2) + 4 * (i & 2))
-                              : (4 * i + j);
-                    h->non_zero_count_cache[scan8[k]] = 1;
-
-                    if (svq3_decode_block(&h->gb, &h->mb[16 * k], index, type)) {
-                        av_log(h->avctx, AV_LOG_ERROR,
-                               "error while decoding block\n");
-                        return -1;
-                    }
-                }
-            }
-
-        if ((cbp & 0x30)) {
-            for (i = 1; i < 3; ++i)
-                if (svq3_decode_block(&h->gb, &h->mb[16 * 16 * i], 0, 3)) {
-                    av_log(h->avctx, AV_LOG_ERROR,
-                           "error while decoding chroma dc block\n");
-                    return -1;
-                }
-
-            if ((cbp & 0x20)) {
-                for (i = 1; i < 3; i++) {
-                    for (j = 0; j < 4; j++) {
-                        k                                 = 16 * i + j;
-                        h->non_zero_count_cache[scan8[k]] = 1;
-
-                        if (svq3_decode_block(&h->gb, &h->mb[16 * k], 1, 1)) {
-                            av_log(h->avctx, AV_LOG_ERROR,
-                                   "error while decoding chroma ac block\n");
-                            return -1;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    h->cbp                              = cbp;
-    h->cur_pic.mb_type[mb_xy] = mb_type;
-
-    if (IS_INTRA(mb_type))
-        h->chroma_pred_mode = ff_h264_check_intra_pred_mode(h, DC_PRED8x8, 1);
-
-    return 0;
-}
-
-static int svq3_decode_slice_header(AVCodecContext *avctx)
-{
-    SVQ3Context *s = avctx->priv_data;
-    H264Context *h    = &s->h;
-    const int mb_xy   = h->mb_xy;
-    int i, header;
-    unsigned slice_id;
-
-    header = get_bits(&h->gb, 8);
-
-    if (((header & 0x9F) != 1 && (header & 0x9F) != 2) || (header & 0x60) == 0) {
-        /* TODO: what? */
-        av_log(avctx, AV_LOG_ERROR, "unsupported slice header (%02X)\n", header);
-        return -1;
-    } else {
-        int length = header >> 5 & 3;
-
-        s->next_slice_index = get_bits_count(&h->gb) +
-                              8 * show_bits(&h->gb, 8 * length) +
-                              8 * length;
-
-        if (s->next_slice_index > h->gb.size_in_bits) {
-            av_log(avctx, AV_LOG_ERROR, "slice after bitstream end\n");
-            return -1;
-        }
-
-        h->gb.size_in_bits = s->next_slice_index - 8 * (length - 1);
-        skip_bits(&h->gb, 8);
-
-        if (s->watermark_key) {
-            uint32_t header = AV_RL32(&h->gb.buffer[(get_bits_count(&h->gb) >> 3) + 1]);
-            AV_WL32(&h->gb.buffer[(get_bits_count(&h->gb) >> 3) + 1],
-                    header ^ s->watermark_key);
-        }
-        if (length > 0) {
-            memcpy((uint8_t *) &h->gb.buffer[get_bits_count(&h->gb) >> 3],
-                   &h->gb.buffer[h->gb.size_in_bits >> 3], length - 1);
-        }
-        skip_bits_long(&h->gb, 0);
-    }
-
-    if ((slice_id = svq3_get_ue_golomb(&h->gb)) >= 3) {
-        av_log(h->avctx, AV_LOG_ERROR, "illegal slice type %d \n", slice_id);
-        return -1;
-    }
-
-    h->slice_type = golomb_to_pict_type[slice_id];
-
-    if ((header & 0x9F) == 2) {
-        i              = (h->mb_num < 64) ? 6 : (1 + av_log2(h->mb_num - 1));
-        h->mb_skip_run = get_bits(&h->gb, i) -
-                         (h->mb_y * h->mb_width + h->mb_x);
-    } else {
-        skip_bits1(&h->gb);
-        h->mb_skip_run = 0;
-    }
-
-    h->slice_num      = get_bits(&h->gb, 8);
-    h->qscale         = get_bits(&h->gb, 5);
-    s->adaptive_quant = get_bits1(&h->gb);
-
-    /* unknown fields */
-    skip_bits1(&h->gb);
-
-    if (s->unknown_flag)
-        skip_bits1(&h->gb);
-
-    skip_bits1(&h->gb);
-    skip_bits(&h->gb, 2);
-
-    while (get_bits1(&h->gb))
-        skip_bits(&h->gb, 8);
-
-    /* reset intra predictors and invalidate motion vector references */
-    if (h->mb_x > 0) {
-        memset(h->intra4x4_pred_mode + h->mb2br_xy[mb_xy - 1] + 3,
-               -1, 4 * sizeof(int8_t));
-        memset(h->intra4x4_pred_mode + h->mb2br_xy[mb_xy - h->mb_x],
-               -1, 8 * sizeof(int8_t) * h->mb_x);
-    }
-    if (h->mb_y > 0) {
-        memset(h->intra4x4_pred_mode + h->mb2br_xy[mb_xy - h->mb_stride],
-               -1, 8 * sizeof(int8_t) * (h->mb_width - h->mb_x));
-
-        if (h->mb_x > 0)
-            h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride - 1] + 3] = -1;
-    }
-
-    return 0;
-}
-
-static av_cold int svq3_decode_init(AVCodecContext *avctx)
-{
-    SVQ3Context *s = avctx->priv_data;
-    H264Context *h = &s->h;
-    int m;
-    unsigned char *extradata;
-    unsigned char *extradata_end;
-    unsigned int size;
-    int marker_found = 0;
-
-    s->cur_pic  = av_mallocz(sizeof(*s->cur_pic));
-    s->last_pic = av_mallocz(sizeof(*s->last_pic));
-    s->next_pic = av_mallocz(sizeof(*s->next_pic));
-    if (!s->next_pic || !s->last_pic || !s->cur_pic) {
-        av_freep(&s->cur_pic);
-        av_freep(&s->last_pic);
-        av_freep(&s->next_pic);
-        return AVERROR(ENOMEM);
-    }
-
-    if (ff_h264_decode_init(avctx) < 0)
-        return -1;
-
-    ff_hpeldsp_init(&s->hdsp, avctx->flags);
-    h->flags           = avctx->flags;
-    h->is_complex      = 1;
-    h->picture_structure = PICT_FRAME;
-    avctx->pix_fmt     = avctx->codec->pix_fmts[0];
-
-    h->chroma_qp[0] = h->chroma_qp[1] = 4;
-    h->chroma_x_shift = h->chroma_y_shift = 1;
-
-    s->halfpel_flag  = 1;
-    s->thirdpel_flag = 1;
-    s->unknown_flag  = 0;
-
-    /* prowl for the "SEQH" marker in the extradata */
-    extradata     = (unsigned char *)avctx->extradata;
-    extradata_end = avctx->extradata + avctx->extradata_size;
-    if (extradata) {
-        for (m = 0; m + 8 < avctx->extradata_size; m++) {
-            if (!memcmp(extradata, "SEQH", 4)) {
-                marker_found = 1;
-                break;
-            }
-            extradata++;
-        }
-    }
-
-    /* if a match was found, parse the extra data */
-    if (marker_found) {
-        GetBitContext gb;
-        int frame_size_code;
-
-        size = AV_RB32(&extradata[4]);
-        if (size > extradata_end - extradata - 8)
-            return AVERROR_INVALIDDATA;
-        init_get_bits(&gb, extradata + 8, size * 8);
-
-        /* 'frame size code' and optional 'width, height' */
-        frame_size_code = get_bits(&gb, 3);
-        switch (frame_size_code) {
-        case 0:
-            avctx->width  = 160;
-            avctx->height = 120;
-            break;
-        case 1:
-            avctx->width  = 128;
-            avctx->height =  96;
-            break;
-        case 2:
-            avctx->width  = 176;
-            avctx->height = 144;
-            break;
-        case 3:
-            avctx->width  = 352;
-            avctx->height = 288;
-            break;
-        case 4:
-            avctx->width  = 704;
-            avctx->height = 576;
-            break;
-        case 5:
-            avctx->width  = 240;
-            avctx->height = 180;
-            break;
-        case 6:
-            avctx->width  = 320;
-            avctx->height = 240;
-            break;
-        case 7:
-            avctx->width  = get_bits(&gb, 12);
-            avctx->height = get_bits(&gb, 12);
-            break;
-        }
-
-        s->halfpel_flag  = get_bits1(&gb);
-        s->thirdpel_flag = get_bits1(&gb);
-
-        /* unknown fields */
-        skip_bits1(&gb);
-        skip_bits1(&gb);
-        skip_bits1(&gb);
-        skip_bits1(&gb);
-
-        h->low_delay = get_bits1(&gb);
-
-        /* unknown field */
-        skip_bits1(&gb);
-
-        while (get_bits1(&gb))
-            skip_bits(&gb, 8);
-
-        s->unknown_flag  = get_bits1(&gb);
-        avctx->has_b_frames = !h->low_delay;
-        if (s->unknown_flag) {
-#if CONFIG_ZLIB
-            unsigned watermark_width  = svq3_get_ue_golomb(&gb);
-            unsigned watermark_height = svq3_get_ue_golomb(&gb);
-            int u1                    = svq3_get_ue_golomb(&gb);
-            int u2                    = get_bits(&gb, 8);
-            int u3                    = get_bits(&gb, 2);
-            int u4                    = svq3_get_ue_golomb(&gb);
-            unsigned long buf_len     = watermark_width *
-                                        watermark_height * 4;
-            int offset                = get_bits_count(&gb) + 7 >> 3;
-            uint8_t *buf;
-
-            if (watermark_height > 0 &&
-                (uint64_t)watermark_width * 4 > UINT_MAX / watermark_height)
-                return -1;
-
-            buf = av_malloc(buf_len);
-            av_log(avctx, AV_LOG_DEBUG, "watermark size: %dx%d\n",
-                   watermark_width, watermark_height);
-            av_log(avctx, AV_LOG_DEBUG,
-                   "u1: %x u2: %x u3: %x compressed data size: %d offset: %d\n",
-                   u1, u2, u3, u4, offset);
-            if (uncompress(buf, &buf_len, extradata + 8 + offset,
-                           size - offset) != Z_OK) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "could not uncompress watermark logo\n");
-                av_free(buf);
-                return -1;
-            }
-            s->watermark_key = ff_svq1_packet_checksum(buf, buf_len, 0);
-            s->watermark_key = s->watermark_key << 16 | s->watermark_key;
-            av_log(avctx, AV_LOG_DEBUG,
-                   "watermark key %#x\n", s->watermark_key);
-            av_free(buf);
-#else
-            av_log(avctx, AV_LOG_ERROR,
-                   "this svq3 file contains watermark which need zlib support compiled in\n");
-            return -1;
-#endif
-        }
-    }
-
-    h->width  = avctx->width;
-    h->height = avctx->height;
-    h->mb_width  = (h->width + 15) / 16;
-    h->mb_height = (h->height + 15) / 16;
-    h->mb_stride = h->mb_width + 1;
-    h->mb_num    = h->mb_width * h->mb_height;
-    h->b_stride = 4 * h->mb_width;
-    s->h_edge_pos = h->mb_width * 16;
-    s->v_edge_pos = h->mb_height * 16;
-
-    if (ff_h264_alloc_tables(h) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "svq3 memory allocation failed\n");
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static void free_picture(AVCodecContext *avctx, Picture *pic)
-{
-    int i;
-    for (i = 0; i < 2; i++) {
-        av_buffer_unref(&pic->motion_val_buf[i]);
-        av_buffer_unref(&pic->ref_index_buf[i]);
-    }
-    av_buffer_unref(&pic->mb_type_buf);
-
-    av_frame_unref(&pic->f);
-}
-
-static int get_buffer(AVCodecContext *avctx, Picture *pic)
-{
-    SVQ3Context *s = avctx->priv_data;
-    H264Context *h = &s->h;
-    const int big_mb_num    = h->mb_stride * (h->mb_height + 1) + 1;
-    const int mb_array_size = h->mb_stride * h->mb_height;
-    const int b4_stride     = h->mb_width * 4 + 1;
-    const int b4_array_size = b4_stride * h->mb_height * 4;
-    int ret;
-
-    if (!pic->motion_val_buf[0]) {
-        int i;
-
-        pic->mb_type_buf = av_buffer_allocz((big_mb_num + h->mb_stride) * sizeof(uint32_t));
-        if (!pic->mb_type_buf)
-            return AVERROR(ENOMEM);
-        pic->mb_type = (uint32_t*)pic->mb_type_buf->data + 2 * h->mb_stride + 1;
-
-        for (i = 0; i < 2; i++) {
-            pic->motion_val_buf[i] = av_buffer_allocz(2 * (b4_array_size + 4) * sizeof(int16_t));
-            pic->ref_index_buf[i]  = av_buffer_allocz(4 * mb_array_size);
-            if (!pic->motion_val_buf[i] || !pic->ref_index_buf[i]) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-
-            pic->motion_val[i] = (int16_t (*)[2])pic->motion_val_buf[i]->data + 4;
-            pic->ref_index[i]  = pic->ref_index_buf[i]->data;
-        }
-    }
-    pic->reference = !(h->pict_type == AV_PICTURE_TYPE_B);
-
-    ret = ff_get_buffer(avctx, &pic->f,
-                        pic->reference ? AV_GET_BUFFER_FLAG_REF : 0);
-    if (ret < 0)
-        goto fail;
-
-    if (!h->edge_emu_buffer) {
-        h->edge_emu_buffer = av_mallocz(pic->f.linesize[0] * 17);
-        if (!h->edge_emu_buffer)
-            return AVERROR(ENOMEM);
-    }
-
-    h->linesize   = pic->f.linesize[0];
-    h->uvlinesize = pic->f.linesize[1];
-
-    return 0;
-fail:
-    free_picture(avctx, pic);
-    return ret;
-}
-
-static int svq3_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    SVQ3Context *s     = avctx->priv_data;
-    H264Context *h     = &s->h;
-    int buf_size       = avpkt->size;
-    int ret, m, i;
-
-    /* special case for last picture */
-    if (buf_size == 0) {
-        if (s->next_pic->f.data[0] && !h->low_delay && !s->last_frame_output) {
-            ret = av_frame_ref(data, &s->next_pic->f);
-            if (ret < 0)
-                return ret;
-            s->last_frame_output = 1;
-            *got_frame          = 1;
-        }
-        return 0;
-    }
-
-    init_get_bits(&h->gb, buf, 8 * buf_size);
-
-    h->mb_x = h->mb_y = h->mb_xy = 0;
-
-    if (svq3_decode_slice_header(avctx))
-        return -1;
-
-    h->pict_type = h->slice_type;
-
-    if (h->pict_type != AV_PICTURE_TYPE_B)
-        FFSWAP(Picture*, s->next_pic, s->last_pic);
-
-    av_frame_unref(&s->cur_pic->f);
-
-    /* for skipping the frame */
-    s->cur_pic->f.pict_type = h->pict_type;
-    s->cur_pic->f.key_frame = (h->pict_type == AV_PICTURE_TYPE_I);
-
-    ret = get_buffer(avctx, s->cur_pic);
-    if (ret < 0)
-        return ret;
-
-    h->cur_pic_ptr = s->cur_pic;
-    av_frame_unref(&h->cur_pic.f);
-    h->cur_pic     = *s->cur_pic;
-    ret = av_frame_ref(&h->cur_pic.f, &s->cur_pic->f);
-    if (ret < 0)
-        return ret;
-
-    for (i = 0; i < 16; i++) {
-        h->block_offset[i]           = (4 * ((scan8[i] - scan8[0]) & 7)) + 4 * h->linesize * ((scan8[i] - scan8[0]) >> 3);
-        h->block_offset[48 + i]      = (4 * ((scan8[i] - scan8[0]) & 7)) + 8 * h->linesize * ((scan8[i] - scan8[0]) >> 3);
-    }
-    for (i = 0; i < 16; i++) {
-        h->block_offset[16 + i]      =
-        h->block_offset[32 + i]      = (4 * ((scan8[i] - scan8[0]) & 7)) + 4 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3);
-        h->block_offset[48 + 16 + i] =
-        h->block_offset[48 + 32 + i] = (4 * ((scan8[i] - scan8[0]) & 7)) + 8 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3);
-    }
-
-    if (h->pict_type != AV_PICTURE_TYPE_I) {
-        if (!s->last_pic->f.data[0]) {
-            av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
-            ret = get_buffer(avctx, s->last_pic);
-            if (ret < 0)
-                return ret;
-            memset(s->last_pic->f.data[0], 0, avctx->height * s->last_pic->f.linesize[0]);
-            memset(s->last_pic->f.data[1], 0x80, (avctx->height / 2) *
-                   s->last_pic->f.linesize[1]);
-            memset(s->last_pic->f.data[2], 0x80, (avctx->height / 2) *
-                   s->last_pic->f.linesize[2]);
-        }
-
-        if (h->pict_type == AV_PICTURE_TYPE_B && !s->next_pic->f.data[0]) {
-            av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
-            ret = get_buffer(avctx, s->next_pic);
-            if (ret < 0)
-                return ret;
-            memset(s->next_pic->f.data[0], 0, avctx->height * s->next_pic->f.linesize[0]);
-            memset(s->next_pic->f.data[1], 0x80, (avctx->height / 2) *
-                   s->next_pic->f.linesize[1]);
-            memset(s->next_pic->f.data[2], 0x80, (avctx->height / 2) *
-                   s->next_pic->f.linesize[2]);
-        }
-    }
-
-    if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(h->avctx, AV_LOG_DEBUG,
-               "%c hpel:%d, tpel:%d aqp:%d qp:%d, slice_num:%02X\n",
-               av_get_picture_type_char(h->pict_type),
-               s->halfpel_flag, s->thirdpel_flag,
-               s->adaptive_quant, h->qscale, h->slice_num);
-
-    if (avctx->skip_frame >= AVDISCARD_NONREF && h->pict_type == AV_PICTURE_TYPE_B ||
-        avctx->skip_frame >= AVDISCARD_NONKEY && h->pict_type != AV_PICTURE_TYPE_I ||
-        avctx->skip_frame >= AVDISCARD_ALL)
-        return 0;
-
-    if (s->next_p_frame_damaged) {
-        if (h->pict_type == AV_PICTURE_TYPE_B)
-            return 0;
-        else
-            s->next_p_frame_damaged = 0;
-    }
-
-    if (h->pict_type == AV_PICTURE_TYPE_B) {
-        h->frame_num_offset = h->slice_num - h->prev_frame_num;
-
-        if (h->frame_num_offset < 0)
-            h->frame_num_offset += 256;
-        if (h->frame_num_offset == 0 ||
-            h->frame_num_offset >= h->prev_frame_num_offset) {
-            av_log(h->avctx, AV_LOG_ERROR, "error in B-frame picture id\n");
-            return -1;
-        }
-    } else {
-        h->prev_frame_num        = h->frame_num;
-        h->frame_num             = h->slice_num;
-        h->prev_frame_num_offset = h->frame_num - h->prev_frame_num;
-
-        if (h->prev_frame_num_offset < 0)
-            h->prev_frame_num_offset += 256;
-    }
-
-    for (m = 0; m < 2; m++) {
-        int i;
-        for (i = 0; i < 4; i++) {
-            int j;
-            for (j = -1; j < 4; j++)
-                h->ref_cache[m][scan8[0] + 8 * i + j] = 1;
-            if (i < 3)
-                h->ref_cache[m][scan8[0] + 8 * i + j] = PART_NOT_AVAILABLE;
-        }
-    }
-
-    for (h->mb_y = 0; h->mb_y < h->mb_height; h->mb_y++) {
-        for (h->mb_x = 0; h->mb_x < h->mb_width; h->mb_x++) {
-            unsigned mb_type;
-            h->mb_xy = h->mb_x + h->mb_y * h->mb_stride;
-
-            if ((get_bits_count(&h->gb) + 7) >= h->gb.size_in_bits &&
-                ((get_bits_count(&h->gb) & 7) == 0 ||
-                 show_bits(&h->gb, -get_bits_count(&h->gb) & 7) == 0)) {
-                skip_bits(&h->gb, s->next_slice_index - get_bits_count(&h->gb));
-                h->gb.size_in_bits = 8 * buf_size;
-
-                if (svq3_decode_slice_header(avctx))
-                    return -1;
-
-                /* TODO: support s->mb_skip_run */
-            }
-
-            mb_type = svq3_get_ue_golomb(&h->gb);
-
-            if (h->pict_type == AV_PICTURE_TYPE_I)
-                mb_type += 8;
-            else if (h->pict_type == AV_PICTURE_TYPE_B && mb_type >= 4)
-                mb_type += 4;
-            if (mb_type > 33 || svq3_decode_mb(s, mb_type)) {
-                av_log(h->avctx, AV_LOG_ERROR,
-                       "error while decoding MB %d %d\n", h->mb_x, h->mb_y);
-                return -1;
-            }
-
-            if (mb_type != 0)
-                ff_h264_hl_decode_mb(h);
-
-            if (h->pict_type != AV_PICTURE_TYPE_B && !h->low_delay)
-                h->cur_pic.mb_type[h->mb_x + h->mb_y * h->mb_stride] =
-                    (h->pict_type == AV_PICTURE_TYPE_P && mb_type < 8) ? (mb_type - 1) : -1;
-        }
-
-        ff_draw_horiz_band(avctx, s->cur_pic,
-                           s->last_pic->f.data[0] ? s->last_pic : NULL,
-                           16 * h->mb_y, 16, h->picture_structure, 0,
-                           h->low_delay);
-    }
-
-    if (h->pict_type == AV_PICTURE_TYPE_B || h->low_delay)
-        ret = av_frame_ref(data, &s->cur_pic->f);
-    else if (s->last_pic->f.data[0])
-        ret = av_frame_ref(data, &s->last_pic->f);
-    if (ret < 0)
-        return ret;
-
-    /* Do not output the last pic after seeking. */
-    if (s->last_pic->f.data[0] || h->low_delay)
-        *got_frame = 1;
-
-    if (h->pict_type != AV_PICTURE_TYPE_B) {
-        FFSWAP(Picture*, s->cur_pic, s->next_pic);
-    } else {
-        av_frame_unref(&s->cur_pic->f);
-    }
-
-    return buf_size;
-}
-
-static av_cold int svq3_decode_end(AVCodecContext *avctx)
-{
-    SVQ3Context *s = avctx->priv_data;
-    H264Context *h = &s->h;
-
-    free_picture(avctx, s->cur_pic);
-    free_picture(avctx, s->next_pic);
-    free_picture(avctx, s->last_pic);
-    av_freep(&s->cur_pic);
-    av_freep(&s->next_pic);
-    av_freep(&s->last_pic);
-
-    av_frame_unref(&h->cur_pic.f);
-
-    ff_h264_free_context(h);
-
-    return 0;
-}
-
-AVCodec ff_svq3_decoder = {
-    .name           = "svq3",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_SVQ3,
-    .priv_data_size = sizeof(SVQ3Context),
-    .init           = svq3_decode_init,
-    .close          = svq3_decode_end,
-    .decode         = svq3_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND |
-                      CODEC_CAP_DR1             |
-                      CODEC_CAP_DELAY,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P,
-                                                     AV_PIX_FMT_NONE},
-};
diff --git a/deps/libav/libavcodec/svq3.h b/deps/libav/libavcodec/svq3.h
deleted file mode 100644
index a20e620..0000000
--- a/deps/libav/libavcodec/svq3.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SVQ3_H
-#define AVCODEC_SVQ3_H
-
-#include <stdint.h>
-
-void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp);
-void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, int stride, int qp, int dc);
-
-#endif /* AVCODEC_SVQ3_H */
diff --git a/deps/libav/libavcodec/synth_filter.c b/deps/libav/libavcodec/synth_filter.c
deleted file mode 100644
index 8e6f120..0000000
--- a/deps/libav/libavcodec/synth_filter.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * copyright (c) 2008 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "fft.h"
-#include "synth_filter.h"
-
-static void synth_filter_float(FFTContext *imdct,
-                           float *synth_buf_ptr, int *synth_buf_offset,
-                           float synth_buf2[32], const float window[512],
-                           float out[32], const float in[32], float scale)
-{
-    float *synth_buf= synth_buf_ptr + *synth_buf_offset;
-    int i, j;
-
-    imdct->imdct_half(imdct, synth_buf, in);
-
-    for (i = 0; i < 16; i++){
-        float a= synth_buf2[i     ];
-        float b= synth_buf2[i + 16];
-        float c= 0;
-        float d= 0;
-        for (j = 0; j < 512 - *synth_buf_offset; j += 64){
-            a += window[i + j     ]*(-synth_buf[15 - i + j      ]);
-            b += window[i + j + 16]*( synth_buf[     i + j      ]);
-            c += window[i + j + 32]*( synth_buf[16 + i + j      ]);
-            d += window[i + j + 48]*( synth_buf[31 - i + j      ]);
-        }
-        for (     ; j < 512; j += 64){
-            a += window[i + j     ]*(-synth_buf[15 - i + j - 512]);
-            b += window[i + j + 16]*( synth_buf[     i + j - 512]);
-            c += window[i + j + 32]*( synth_buf[16 + i + j - 512]);
-            d += window[i + j + 48]*( synth_buf[31 - i + j - 512]);
-        }
-        out[i     ] = a*scale;
-        out[i + 16] = b*scale;
-        synth_buf2[i     ] = c;
-        synth_buf2[i + 16] = d;
-    }
-    *synth_buf_offset= (*synth_buf_offset - 32)&511;
-}
-
-av_cold void ff_synth_filter_init(SynthFilterContext *c)
-{
-    c->synth_filter_float = synth_filter_float;
-
-    if (ARCH_ARM) ff_synth_filter_init_arm(c);
-}
diff --git a/deps/libav/libavcodec/synth_filter.h b/deps/libav/libavcodec/synth_filter.h
deleted file mode 100644
index 7b73578..0000000
--- a/deps/libav/libavcodec/synth_filter.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * copyright (c) 2008 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_SYNTH_FILTER_H
-#define AVCODEC_SYNTH_FILTER_H
-
-#include "fft.h"
-
-typedef struct SynthFilterContext {
-    void (*synth_filter_float)(FFTContext *imdct,
-                               float *synth_buf_ptr, int *synth_buf_offset,
-                               float synth_buf2[32], const float window[512],
-                               float out[32], const float in[32],
-                               float scale);
-} SynthFilterContext;
-
-void ff_synth_filter_init(SynthFilterContext *c);
-void ff_synth_filter_init_arm(SynthFilterContext *c);
-
-#endif /* AVCODEC_SYNTH_FILTER_H */
diff --git a/deps/libav/libavcodec/tableprint.h b/deps/libav/libavcodec/tableprint.h
deleted file mode 100644
index daa89fe..0000000
--- a/deps/libav/libavcodec/tableprint.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Generate a file for hardcoded tables
- *
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_TABLEPRINT_H
-#define AVCODEC_TABLEPRINT_H
-
-#include <inttypes.h>
-#include <stdio.h>
-
-#include "libavutil/common.h"
-
-#define WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, ...)\
-void write_##type##_array(const type *data, int len)\
-{\
-    int i;\
-    printf("   ");\
-    for (i = 0; i < len - 1; i++) {\
-       printf(" "fmtstr",", __VA_ARGS__);\
-       if ((i & linebrk) == linebrk) printf("\n   ");\
-    }\
-    printf(" "fmtstr"\n", __VA_ARGS__);\
-}
-
-#define WRITE_1D_FUNC(type, fmtstr, linebrk)\
-    WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, data[i])
-
-#define WRITE_2D_FUNC(type)\
-void write_##type##_2d_array(const void *arg, int len, int len2)\
-{\
-    const type *data = arg;\
-    int i;\
-    printf("    {\n");\
-    for (i = 0; i < len; i++) {\
-        write_##type##_array(data + i * len2, len2);\
-        printf(i == len - 1 ? "    }\n" : "    }, {\n");\
-    }\
-}
-
-/**
- * @name Predefined functions for printing tables
- *
- * @{
- */
-void write_int8_t_array     (const int8_t   *, int);
-void write_uint8_t_array    (const uint8_t  *, int);
-void write_uint16_t_array   (const uint16_t *, int);
-void write_uint32_t_array   (const uint32_t *, int);
-void write_float_array      (const float    *, int);
-void write_int8_t_2d_array  (const void *, int, int);
-void write_uint8_t_2d_array (const void *, int, int);
-void write_uint32_t_2d_array(const void *, int, int);
-void write_float_2d_array   (const void *, int, int);
-/** @} */ // end of printfuncs group
-
-/*
- * MSVC doesn't have %zu, since it was introduced in C99,
- * but has its own %Iu for printing size_t values.
- */
-#if defined(_MSC_VER)
-#define FMT "Iu"
-#else
-#define FMT "zu"
-#endif
-
-#define WRITE_ARRAY(prefix, type, name)                 \
-    do {                                                \
-        const size_t array_size = FF_ARRAY_ELEMS(name); \
-        printf(prefix" "#type" "#name"[%"FMT"] = {\n",  \
-               array_size);                             \
-        write_##type##_array(name, array_size);         \
-        printf("};\n");                                 \
-    } while(0)
-
-#define WRITE_2D_ARRAY(prefix, type, name)                              \
-    do {                                                                \
-        const size_t array_size1 = FF_ARRAY_ELEMS(name);                \
-        const size_t array_size2 = FF_ARRAY_ELEMS(name[0]);             \
-        printf(prefix" "#type" "#name"[%"FMT"][%"FMT"] = {\n",          \
-               array_size1, array_size2 );                              \
-        write_##type##_2d_array(name, array_size1, array_size2);        \
-        printf("};\n");                                                 \
-    } while(0)
-
-
-WRITE_1D_FUNC(int8_t,   "%3"PRIi8, 15)
-WRITE_1D_FUNC(uint8_t,  "0x%02"PRIx8, 15)
-WRITE_1D_FUNC(uint16_t, "0x%08"PRIx16, 7)
-WRITE_1D_FUNC(uint32_t, "0x%08"PRIx32, 7)
-WRITE_1D_FUNC(float,    "%.18e", 3)
-
-WRITE_2D_FUNC(int8_t)
-WRITE_2D_FUNC(uint8_t)
-WRITE_2D_FUNC(uint32_t)
-WRITE_2D_FUNC(float)
-
-static inline void write_fileheader(void)
-{
-    printf("/* This file was automatically generated. */\n");
-    printf("#include <stdint.h>\n");
-}
-
-#endif /* AVCODEC_TABLEPRINT_H */
diff --git a/deps/libav/libavcodec/tak.c b/deps/libav/libavcodec/tak.c
deleted file mode 100644
index 867a84b..0000000
--- a/deps/libav/libavcodec/tak.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * TAK common code
- * Copyright (c) 2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/bswap.h"
-#include "libavutil/crc.h"
-#include "libavutil/intreadwrite.h"
-#include "tak.h"
-
-static const uint16_t frame_duration_type_quants[] = {
-    3, 4, 6, 8, 4096, 8192, 16384, 512, 1024, 2048,
-};
-
-static int tak_get_nb_samples(int sample_rate, enum TAKFrameSizeType type)
-{
-    int nb_samples, max_nb_samples;
-
-    if (type <= TAK_FST_250ms) {
-        nb_samples     = sample_rate * frame_duration_type_quants[type] >>
-                         TAK_FRAME_DURATION_QUANT_SHIFT;
-        max_nb_samples = 16384;
-    } else if (type < FF_ARRAY_ELEMS(frame_duration_type_quants)) {
-        nb_samples     = frame_duration_type_quants[type];
-        max_nb_samples = sample_rate *
-                         frame_duration_type_quants[TAK_FST_250ms] >>
-                         TAK_FRAME_DURATION_QUANT_SHIFT;
-    } else {
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (nb_samples <= 0 || nb_samples > max_nb_samples)
-        return AVERROR_INVALIDDATA;
-
-    return nb_samples;
-}
-
-static int crc_init = 0;
-#if CONFIG_SMALL
-#define CRC_TABLE_SIZE 257
-#else
-#define CRC_TABLE_SIZE 1024
-#endif
-static AVCRC crc_24[CRC_TABLE_SIZE];
-
-av_cold void ff_tak_init_crc(void)
-{
-    if (!crc_init) {
-        av_crc_init(crc_24, 0, 24, 0x864CFBU, sizeof(crc_24));
-        crc_init = 1;
-    }
-}
-
-int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size)
-{
-    uint32_t crc, CRC;
-
-    if (buf_size < 4)
-        return AVERROR_INVALIDDATA;
-    buf_size -= 3;
-
-    CRC = av_bswap32(AV_RL24(buf + buf_size)) >> 8;
-    crc = av_crc(crc_24, 0xCE04B7U, buf, buf_size);
-    if (CRC != crc)
-        return AVERROR_INVALIDDATA;
-
-    return 0;
-}
-
-void avpriv_tak_parse_streaminfo(GetBitContext *gb, TAKStreamInfo *s)
-{
-    uint64_t channel_mask = 0;
-    int frame_type, i;
-
-    s->codec = get_bits(gb, TAK_ENCODER_CODEC_BITS);
-    skip_bits(gb, TAK_ENCODER_PROFILE_BITS);
-
-    frame_type = get_bits(gb, TAK_SIZE_FRAME_DURATION_BITS);
-    s->samples = get_bits64(gb, TAK_SIZE_SAMPLES_NUM_BITS);
-
-    s->data_type   = get_bits(gb, TAK_FORMAT_DATA_TYPE_BITS);
-    s->sample_rate = get_bits(gb, TAK_FORMAT_SAMPLE_RATE_BITS) +
-                     TAK_SAMPLE_RATE_MIN;
-    s->bps         = get_bits(gb, TAK_FORMAT_BPS_BITS) +
-                     TAK_BPS_MIN;
-    s->channels    = get_bits(gb, TAK_FORMAT_CHANNEL_BITS) +
-                     TAK_CHANNELS_MIN;
-
-    if (get_bits1(gb)) {
-        skip_bits(gb, TAK_FORMAT_VALID_BITS);
-        if (get_bits1(gb)) {
-            for (i = 0; i < s->channels; i++) {
-                int value = get_bits(gb, TAK_FORMAT_CH_LAYOUT_BITS);
-
-                if (value > 0 && value <= 18)
-                    channel_mask |= 1 << (value - 1);
-            }
-        }
-    }
-
-    s->ch_layout     = channel_mask;
-    s->frame_samples = tak_get_nb_samples(s->sample_rate, frame_type);
-}
-
-int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
-                               TAKStreamInfo *ti, int log_level_offset)
-{
-    if (get_bits(gb, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) {
-        av_log(avctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ti->flags     = get_bits(gb, TAK_FRAME_HEADER_FLAGS_BITS);
-    ti->frame_num = get_bits(gb, TAK_FRAME_HEADER_NO_BITS);
-
-    if (ti->flags & TAK_FRAME_FLAG_IS_LAST) {
-        ti->last_frame_samples = get_bits(gb, TAK_FRAME_HEADER_SAMPLE_COUNT_BITS) + 1;
-        skip_bits(gb, 2);
-    } else {
-        ti->last_frame_samples = 0;
-    }
-
-    if (ti->flags & TAK_FRAME_FLAG_HAS_INFO) {
-        avpriv_tak_parse_streaminfo(gb, ti);
-
-        if (get_bits(gb, 6))
-            skip_bits(gb, 25);
-        align_get_bits(gb);
-    }
-
-    skip_bits(gb, 24);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/tak.h b/deps/libav/libavcodec/tak.h
deleted file mode 100644
index fa91149..0000000
--- a/deps/libav/libavcodec/tak.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * TAK decoder/demuxer common code
- * Copyright (c) 2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * TAK (Tom's lossless Audio Kompressor) decoder/demuxer common functions
- */
-
-#ifndef AVCODEC_TAK_H
-#define AVCODEC_TAK_H
-
-#include <stdint.h>
-
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "avcodec.h"
-
-#define TAK_FORMAT_DATA_TYPE_BITS               3
-#define TAK_FORMAT_SAMPLE_RATE_BITS            18
-#define TAK_FORMAT_BPS_BITS                     5
-#define TAK_FORMAT_CHANNEL_BITS                 4
-#define TAK_FORMAT_VALID_BITS                   5
-#define TAK_FORMAT_CH_LAYOUT_BITS               6
-#define TAK_SIZE_FRAME_DURATION_BITS            4
-#define TAK_SIZE_SAMPLES_NUM_BITS              35
-#define TAK_LAST_FRAME_POS_BITS                40
-#define TAK_LAST_FRAME_SIZE_BITS               24
-#define TAK_ENCODER_CODEC_BITS                  6
-#define TAK_ENCODER_PROFILE_BITS                4
-#define TAK_ENCODER_VERSION_BITS               24
-#define TAK_SAMPLE_RATE_MIN                  6000
-#define TAK_CHANNELS_MIN                        1
-#define TAK_BPS_MIN                             8
-#define TAK_FRAME_HEADER_FLAGS_BITS             3
-#define TAK_FRAME_HEADER_SYNC_ID           0xA0FF
-#define TAK_FRAME_HEADER_SYNC_ID_BITS          16
-#define TAK_FRAME_HEADER_SAMPLE_COUNT_BITS     14
-#define TAK_FRAME_HEADER_NO_BITS               21
-#define TAK_FRAME_DURATION_QUANT_SHIFT          5
-#define TAK_CRC24_BITS                         24
-
-
-#define TAK_FRAME_FLAG_IS_LAST                0x1
-#define TAK_FRAME_FLAG_HAS_INFO               0x2
-#define TAK_FRAME_FLAG_HAS_METADATA           0x4
-
-#define TAK_MAX_CHANNELS               (1 << TAK_FORMAT_CHANNEL_BITS)
-
-#define TAK_MIN_FRAME_HEADER_BITS      (TAK_FRAME_HEADER_SYNC_ID_BITS + \
-                                        TAK_FRAME_HEADER_FLAGS_BITS   + \
-                                        TAK_FRAME_HEADER_NO_BITS      + \
-                                        TAK_CRC24_BITS)
-
-#define TAK_MIN_FRAME_HEADER_LAST_BITS (TAK_MIN_FRAME_HEADER_BITS + 2 + \
-                                        TAK_FRAME_HEADER_SAMPLE_COUNT_BITS)
-
-#define TAK_ENCODER_BITS               (TAK_ENCODER_CODEC_BITS + \
-                                        TAK_ENCODER_PROFILE_BITS)
-
-#define TAK_SIZE_BITS                  (TAK_SIZE_SAMPLES_NUM_BITS + \
-                                        TAK_SIZE_FRAME_DURATION_BITS)
-
-#define TAK_FORMAT_BITS                (TAK_FORMAT_DATA_TYPE_BITS   + \
-                                        TAK_FORMAT_SAMPLE_RATE_BITS + \
-                                        TAK_FORMAT_BPS_BITS         + \
-                                        TAK_FORMAT_CHANNEL_BITS + 1 + \
-                                        TAK_FORMAT_VALID_BITS   + 1 + \
-                                        TAK_FORMAT_CH_LAYOUT_BITS   * \
-                                        TAK_MAX_CHANNELS)
-
-#define TAK_STREAMINFO_BITS            (TAK_ENCODER_BITS + \
-                                        TAK_SIZE_BITS    + \
-                                        TAK_FORMAT_BITS)
-
-#define TAK_MAX_FRAME_HEADER_BITS      (TAK_MIN_FRAME_HEADER_LAST_BITS + \
-                                        TAK_STREAMINFO_BITS + 31)
-
-#define TAK_STREAMINFO_BYTES           ((TAK_STREAMINFO_BITS       + 7) / 8)
-#define TAK_MAX_FRAME_HEADER_BYTES     ((TAK_MAX_FRAME_HEADER_BITS + 7) / 8)
-#define TAK_MIN_FRAME_HEADER_BYTES     ((TAK_MIN_FRAME_HEADER_BITS + 7) / 8)
-
-enum TAKCodecType {
-    TAK_CODEC_MONO_STEREO  = 2,
-    TAK_CODEC_MULTICHANNEL = 4
-};
-
-enum TAKMetaDataType {
-    TAK_METADATA_END = 0,
-    TAK_METADATA_STREAMINFO,
-    TAK_METADATA_SEEKTABLE,
-    TAK_METADATA_SIMPLE_WAVE_DATA,
-    TAK_METADATA_ENCODER,
-    TAK_METADATA_PADDING,
-    TAK_METADATA_MD5,
-    TAK_METADATA_LAST_FRAME,
-};
-
-enum TAKFrameSizeType {
-    TAK_FST_94ms = 0,
-    TAK_FST_125ms,
-    TAK_FST_188ms,
-    TAK_FST_250ms,
-    TAK_FST_4096,
-    TAK_FST_8192,
-    TAK_FST_16384,
-    TAK_FST_512,
-    TAK_FST_1024,
-    TAK_FST_2048,
-};
-
-typedef struct TAKStreamInfo {
-    int               flags;
-    enum TAKCodecType codec;
-    int               data_type;
-    int               sample_rate;
-    int               channels;
-    int               bps;
-    int               frame_num;
-    int               frame_samples;
-    int               last_frame_samples;
-    uint64_t          ch_layout;
-    int64_t           samples;
-} TAKStreamInfo;
-
-void ff_tak_init_crc(void);
-
-int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size);
-
-/**
- * Parse the Streaminfo metadata block.
- * @param[in]  gb pointer to GetBitContext
- * @param[out] s  storage for parsed information
- */
-void avpriv_tak_parse_streaminfo(GetBitContext *gb, TAKStreamInfo *s);
-
-/**
- * Validate and decode a frame header.
- * @param      avctx             AVCodecContext to use as av_log() context
- * @param[in]  gb                GetBitContext from which to read frame header
- * @param[out] s                 frame information
- * @param      log_level_offset  log level offset, can be used to silence
- *                               error messages.
- * @return non-zero on error, 0 if OK
- */
-int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
-                               TAKStreamInfo *s, int log_level_offset);
-
-#endif /* AVCODEC_TAK_H */
diff --git a/deps/libav/libavcodec/tak_parser.c b/deps/libav/libavcodec/tak_parser.c
deleted file mode 100644
index 295df24..0000000
--- a/deps/libav/libavcodec/tak_parser.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * TAK parser
- * Copyright (c) 2012 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * TAK parser
- **/
-
-#include "tak.h"
-#include "parser.h"
-
-typedef struct TAKParseContext {
-    ParseContext  pc;
-    TAKStreamInfo ti;
-    int           index;
-} TAKParseContext;
-
-static av_cold int tak_init(AVCodecParserContext *s)
-{
-    ff_tak_init_crc();
-    return 0;
-}
-
-static int tak_parse(AVCodecParserContext *s, AVCodecContext *avctx,
-                     const uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size)
-{
-    TAKParseContext *t = s->priv_data;
-    ParseContext *pc   = &t->pc;
-    int next           = END_NOT_FOUND;
-    GetBitContext gb;
-    int consumed = 0;
-    int needed   = buf_size ? TAK_MAX_FRAME_HEADER_BYTES : 8;
-
-    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
-        TAKStreamInfo ti;
-        init_get_bits(&gb, buf, buf_size);
-        if (!ff_tak_decode_frame_header(avctx, &gb, &ti, 127))
-            s->duration = t->ti.last_frame_samples ? t->ti.last_frame_samples
-                                                   : t->ti.frame_samples;
-        *poutbuf      = buf;
-        *poutbuf_size = buf_size;
-        return buf_size;
-    }
-
-    while (buf_size || t->index + needed <= pc->index) {
-        if (buf_size && t->index + TAK_MAX_FRAME_HEADER_BYTES > pc->index) {
-            int tmp_buf_size       = FFMIN(2 * TAK_MAX_FRAME_HEADER_BYTES,
-                                           buf_size);
-            const uint8_t *tmp_buf = buf;
-
-            ff_combine_frame(pc, END_NOT_FOUND, &tmp_buf, &tmp_buf_size);
-            consumed += tmp_buf_size;
-            buf      += tmp_buf_size;
-            buf_size -= tmp_buf_size;
-        }
-
-        for (; t->index + needed <= pc->index; t->index++)
-            if (pc->buffer[t->index]     == 0xFF &&
-                pc->buffer[t->index + 1] == 0xA0) {
-                TAKStreamInfo ti;
-
-                init_get_bits(&gb, pc->buffer + t->index,
-                              8 * (pc->index - t->index));
-                if (!ff_tak_decode_frame_header(avctx, &gb,
-                                                pc->frame_start_found ? &ti
-                                                                      : &t->ti,
-                                                127) &&
-                    !ff_tak_check_crc(pc->buffer + t->index,
-                                      get_bits_count(&gb) / 8)) {
-                    if (!pc->frame_start_found) {
-                        pc->frame_start_found = 1;
-                        s->duration           = t->ti.last_frame_samples ?
-                                                t->ti.last_frame_samples :
-                                                t->ti.frame_samples;
-                    } else {
-                        pc->frame_start_found = 0;
-                        next                  = t->index - pc->index;
-                        t->index              = 0;
-                        goto found;
-                    }
-                }
-            }
-    }
-
-found:
-    if (consumed && !buf_size && next == END_NOT_FOUND ||
-        ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
-        *poutbuf      = NULL;
-        *poutbuf_size = 0;
-        return buf_size + consumed;
-    }
-
-    if (next != END_NOT_FOUND) {
-        next        += consumed;
-        pc->overread = FFMAX(0, -next);
-    }
-
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-AVCodecParser ff_tak_parser = {
-    .codec_ids      = { AV_CODEC_ID_TAK },
-    .priv_data_size = sizeof(TAKParseContext),
-    .parser_init    = tak_init,
-    .parser_parse   = tak_parse,
-    .parser_close   = ff_parse_close,
-};
diff --git a/deps/libav/libavcodec/takdec.c b/deps/libav/libavcodec/takdec.c
deleted file mode 100644
index 0d2dcbb..0000000
--- a/deps/libav/libavcodec/takdec.c
+++ /dev/null
@@ -1,933 +0,0 @@
-/*
- * TAK decoder
- * Copyright (c) 2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * TAK (Tom's lossless Audio Kompressor) decoder
- * @author Paul B Mahol
- */
-
-#include "libavutil/internal.h"
-#include "libavutil/samplefmt.h"
-#include "tak.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "internal.h"
-#include "unary.h"
-
-#define MAX_SUBFRAMES     8                         // max number of subframes per channel
-#define MAX_PREDICTORS  256
-
-typedef struct MCDParam {
-    int8_t present;                                 // decorrelation parameter availability for this channel
-    int8_t index;                                   // index into array of decorrelation types
-    int8_t chan1;
-    int8_t chan2;
-} MCDParam;
-
-typedef struct TAKDecContext {
-    AVCodecContext *avctx;                          // parent AVCodecContext
-    DSPContext      dsp;
-    TAKStreamInfo   ti;
-    GetBitContext   gb;                             // bitstream reader initialized to start at the current frame
-
-    int             uval;
-    int             nb_samples;                     // number of samples in the current frame
-    uint8_t        *decode_buffer;
-    unsigned int    decode_buffer_size;
-    int32_t        *decoded[TAK_MAX_CHANNELS];      // decoded samples for each channel
-
-    int8_t          lpc_mode[TAK_MAX_CHANNELS];
-    int8_t          sample_shift[TAK_MAX_CHANNELS]; // shift applied to every sample in the channel
-    int             subframe_scale;
-
-    int8_t          dmode;                          // channel decorrelation type in the current frame
-
-    MCDParam        mcdparams[TAK_MAX_CHANNELS];    // multichannel decorrelation parameters
-
-    int16_t        *residues;
-    unsigned int    residues_buf_size;
-} TAKDecContext;
-
-static const int8_t mc_dmodes[] = { 1, 3, 4, 6, };
-
-static const uint16_t predictor_sizes[] = {
-    4, 8, 12, 16, 24, 32, 48, 64, 80, 96, 128, 160, 192, 224, 256, 0,
-};
-
-static const struct CParam {
-    int init;
-    int escape;
-    int scale;
-    int aescape;
-    int bias;
-} xcodes[50] = {
-    { 0x01, 0x0000001, 0x0000001, 0x0000003, 0x0000008 },
-    { 0x02, 0x0000003, 0x0000001, 0x0000007, 0x0000006 },
-    { 0x03, 0x0000005, 0x0000002, 0x000000E, 0x000000D },
-    { 0x03, 0x0000003, 0x0000003, 0x000000D, 0x0000018 },
-    { 0x04, 0x000000B, 0x0000004, 0x000001C, 0x0000019 },
-    { 0x04, 0x0000006, 0x0000006, 0x000001A, 0x0000030 },
-    { 0x05, 0x0000016, 0x0000008, 0x0000038, 0x0000032 },
-    { 0x05, 0x000000C, 0x000000C, 0x0000034, 0x0000060 },
-    { 0x06, 0x000002C, 0x0000010, 0x0000070, 0x0000064 },
-    { 0x06, 0x0000018, 0x0000018, 0x0000068, 0x00000C0 },
-    { 0x07, 0x0000058, 0x0000020, 0x00000E0, 0x00000C8 },
-    { 0x07, 0x0000030, 0x0000030, 0x00000D0, 0x0000180 },
-    { 0x08, 0x00000B0, 0x0000040, 0x00001C0, 0x0000190 },
-    { 0x08, 0x0000060, 0x0000060, 0x00001A0, 0x0000300 },
-    { 0x09, 0x0000160, 0x0000080, 0x0000380, 0x0000320 },
-    { 0x09, 0x00000C0, 0x00000C0, 0x0000340, 0x0000600 },
-    { 0x0A, 0x00002C0, 0x0000100, 0x0000700, 0x0000640 },
-    { 0x0A, 0x0000180, 0x0000180, 0x0000680, 0x0000C00 },
-    { 0x0B, 0x0000580, 0x0000200, 0x0000E00, 0x0000C80 },
-    { 0x0B, 0x0000300, 0x0000300, 0x0000D00, 0x0001800 },
-    { 0x0C, 0x0000B00, 0x0000400, 0x0001C00, 0x0001900 },
-    { 0x0C, 0x0000600, 0x0000600, 0x0001A00, 0x0003000 },
-    { 0x0D, 0x0001600, 0x0000800, 0x0003800, 0x0003200 },
-    { 0x0D, 0x0000C00, 0x0000C00, 0x0003400, 0x0006000 },
-    { 0x0E, 0x0002C00, 0x0001000, 0x0007000, 0x0006400 },
-    { 0x0E, 0x0001800, 0x0001800, 0x0006800, 0x000C000 },
-    { 0x0F, 0x0005800, 0x0002000, 0x000E000, 0x000C800 },
-    { 0x0F, 0x0003000, 0x0003000, 0x000D000, 0x0018000 },
-    { 0x10, 0x000B000, 0x0004000, 0x001C000, 0x0019000 },
-    { 0x10, 0x0006000, 0x0006000, 0x001A000, 0x0030000 },
-    { 0x11, 0x0016000, 0x0008000, 0x0038000, 0x0032000 },
-    { 0x11, 0x000C000, 0x000C000, 0x0034000, 0x0060000 },
-    { 0x12, 0x002C000, 0x0010000, 0x0070000, 0x0064000 },
-    { 0x12, 0x0018000, 0x0018000, 0x0068000, 0x00C0000 },
-    { 0x13, 0x0058000, 0x0020000, 0x00E0000, 0x00C8000 },
-    { 0x13, 0x0030000, 0x0030000, 0x00D0000, 0x0180000 },
-    { 0x14, 0x00B0000, 0x0040000, 0x01C0000, 0x0190000 },
-    { 0x14, 0x0060000, 0x0060000, 0x01A0000, 0x0300000 },
-    { 0x15, 0x0160000, 0x0080000, 0x0380000, 0x0320000 },
-    { 0x15, 0x00C0000, 0x00C0000, 0x0340000, 0x0600000 },
-    { 0x16, 0x02C0000, 0x0100000, 0x0700000, 0x0640000 },
-    { 0x16, 0x0180000, 0x0180000, 0x0680000, 0x0C00000 },
-    { 0x17, 0x0580000, 0x0200000, 0x0E00000, 0x0C80000 },
-    { 0x17, 0x0300000, 0x0300000, 0x0D00000, 0x1800000 },
-    { 0x18, 0x0B00000, 0x0400000, 0x1C00000, 0x1900000 },
-    { 0x18, 0x0600000, 0x0600000, 0x1A00000, 0x3000000 },
-    { 0x19, 0x1600000, 0x0800000, 0x3800000, 0x3200000 },
-    { 0x19, 0x0C00000, 0x0C00000, 0x3400000, 0x6000000 },
-    { 0x1A, 0x2C00000, 0x1000000, 0x7000000, 0x6400000 },
-    { 0x1A, 0x1800000, 0x1800000, 0x6800000, 0xC000000 },
-};
-
-static av_cold void tak_init_static_data(AVCodec *codec)
-{
-    ff_tak_init_crc();
-}
-
-static int set_bps_params(AVCodecContext *avctx)
-{
-    switch (avctx->bits_per_coded_sample) {
-    case 8:
-        avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
-        break;
-    case 16:
-        avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-        break;
-    case 24:
-        avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "unsupported bits per sample: %d\n",
-               avctx->bits_per_coded_sample);
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->bits_per_raw_sample = avctx->bits_per_coded_sample;
-
-    return 0;
-}
-
-static void set_sample_rate_params(AVCodecContext *avctx)
-{
-    TAKDecContext *s  = avctx->priv_data;
-    int shift         = 3 - (avctx->sample_rate / 11025);
-    shift             = FFMAX(0, shift);
-    s->uval           = FFALIGN(avctx->sample_rate + 511 >> 9, 4) << shift;
-    s->subframe_scale = FFALIGN(avctx->sample_rate + 511 >> 9, 4) << 1;
-}
-
-static av_cold int tak_decode_init(AVCodecContext *avctx)
-{
-    TAKDecContext *s = avctx->priv_data;
-
-    ff_dsputil_init(&s->dsp, avctx);
-
-    s->avctx = avctx;
-
-    set_sample_rate_params(avctx);
-
-    return set_bps_params(avctx);
-}
-
-static void decode_lpc(int32_t *coeffs, int mode, int length)
-{
-    int i;
-
-    if (length < 2)
-        return;
-
-    if (mode == 1) {
-        int a1 = *coeffs++;
-        for (i = 0; i < length - 1 >> 1; i++) {
-            *coeffs   += a1;
-            coeffs[1] += *coeffs;
-            a1         = coeffs[1];
-            coeffs    += 2;
-        }
-        if (length - 1 & 1)
-            *coeffs += a1;
-    } else if (mode == 2) {
-        int a1    = coeffs[1];
-        int a2    = a1 + *coeffs;
-        coeffs[1] = a2;
-        if (length > 2) {
-            coeffs += 2;
-            for (i = 0; i < length - 2 >> 1; i++) {
-                int a3    = *coeffs + a1;
-                int a4    = a3 + a2;
-                *coeffs   = a4;
-                a1        = coeffs[1] + a3;
-                a2        = a1 + a4;
-                coeffs[1] = a2;
-                coeffs   += 2;
-            }
-            if (length & 1)
-                *coeffs += a1 + a2;
-        }
-    } else if (mode == 3) {
-        int a1    = coeffs[1];
-        int a2    = a1 + *coeffs;
-        coeffs[1] = a2;
-        if (length > 2) {
-            int a3  = coeffs[2];
-            int a4  = a3 + a1;
-            int a5  = a4 + a2;
-            coeffs += 3;
-            for (i = 0; i < length - 3; i++) {
-                a3     += *coeffs;
-                a4     += a3;
-                a5     += a4;
-                *coeffs = a5;
-                coeffs++;
-            }
-        }
-    }
-}
-
-static int decode_segment(GetBitContext *gb, int mode, int32_t *decoded,
-                          int len)
-{
-    struct CParam code;
-    int i;
-
-    if (!mode) {
-        memset(decoded, 0, len * sizeof(*decoded));
-        return 0;
-    }
-
-    if (mode > FF_ARRAY_ELEMS(xcodes))
-        return AVERROR_INVALIDDATA;
-    code = xcodes[mode - 1];
-
-    for (i = 0; i < len; i++) {
-        int x = get_bits_long(gb, code.init);
-        if (x >= code.escape && get_bits1(gb)) {
-            x |= 1 << code.init;
-            if (x >= code.aescape) {
-                int scale = get_unary(gb, 1, 9);
-                if (scale == 9) {
-                    int scale_bits = get_bits(gb, 3);
-                    if (scale_bits > 0) {
-                        if (scale_bits == 7) {
-                            scale_bits += get_bits(gb, 5);
-                            if (scale_bits > 29)
-                                return AVERROR_INVALIDDATA;
-                        }
-                        scale = get_bits_long(gb, scale_bits) + 1;
-                        x    += code.scale * scale;
-                    }
-                    x += code.bias;
-                } else
-                    x += code.scale * scale - code.escape;
-            } else
-                x -= code.escape;
-        }
-        decoded[i] = (x >> 1) ^ -(x & 1);
-    }
-
-    return 0;
-}
-
-static int decode_residues(TAKDecContext *s, int32_t *decoded, int length)
-{
-    GetBitContext *gb = &s->gb;
-    int i, mode, ret;
-
-    if (length > s->nb_samples)
-        return AVERROR_INVALIDDATA;
-
-    if (get_bits1(gb)) {
-        int wlength, rval;
-        int coding_mode[128];
-
-        wlength = length / s->uval;
-
-        rval = length - (wlength * s->uval);
-
-        if (rval < s->uval / 2)
-            rval += s->uval;
-        else
-            wlength++;
-
-        if (wlength <= 1 || wlength > 128)
-            return AVERROR_INVALIDDATA;
-
-        coding_mode[0] = mode = get_bits(gb, 6);
-
-        for (i = 1; i < wlength; i++) {
-            int c = get_unary(gb, 1, 6);
-
-            switch (c) {
-            case 6:
-                mode = get_bits(gb, 6);
-                break;
-            case 5:
-            case 4:
-            case 3: {
-                /* mode += sign ? (1 - c) : (c - 1) */
-                int sign = get_bits1(gb);
-                mode    += (-sign ^ (c - 1)) + sign;
-                break;
-            }
-            case 2:
-                mode++;
-                break;
-            case 1:
-                mode--;
-                break;
-            }
-            coding_mode[i] = mode;
-        }
-
-        i = 0;
-        while (i < wlength) {
-            int len = 0;
-
-            mode = coding_mode[i];
-            do {
-                if (i >= wlength - 1)
-                    len += rval;
-                else
-                    len += s->uval;
-                i++;
-
-                if (i == wlength)
-                    break;
-            } while (coding_mode[i] == mode);
-
-            if ((ret = decode_segment(gb, mode, decoded, len)) < 0)
-                return ret;
-            decoded += len;
-        }
-    } else {
-        mode = get_bits(gb, 6);
-        if ((ret = decode_segment(gb, mode, decoded, length)) < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-static int get_bits_esc4(GetBitContext *gb)
-{
-    if (get_bits1(gb))
-        return get_bits(gb, 4) + 1;
-    else
-        return 0;
-}
-
-static void decode_filter_coeffs(TAKDecContext *s, int filter_order, int size,
-                                 int filter_quant, int16_t *filter)
-{
-    GetBitContext *gb = &s->gb;
-    int i, j, a, b;
-    int filter_tmp[MAX_PREDICTORS];
-    int16_t predictors[MAX_PREDICTORS];
-
-    predictors[0] = get_sbits(gb, 10);
-    predictors[1] = get_sbits(gb, 10);
-    predictors[2] = get_sbits(gb, size) << (10 - size);
-    predictors[3] = get_sbits(gb, size) << (10 - size);
-    if (filter_order > 4) {
-        int av_uninit(code_size);
-        int code_size_base = size - get_bits1(gb);
-
-        for (i = 4; i < filter_order; i++) {
-            if (!(i & 3))
-                code_size = code_size_base - get_bits(gb, 2);
-            predictors[i] = get_sbits(gb, code_size) << (10 - size);
-        }
-    }
-
-    filter_tmp[0] = predictors[0] << 6;
-    for (i = 1; i < filter_order; i++) {
-        int *p1 = &filter_tmp[0];
-        int *p2 = &filter_tmp[i - 1];
-
-        for (j = 0; j < (i + 1) / 2; j++) {
-            int tmp = *p1 + (predictors[i] * *p2 + 256 >> 9);
-            *p2     = *p2 + (predictors[i] * *p1 + 256 >> 9);
-            *p1     = tmp;
-            p1++;
-            p2--;
-        }
-
-        filter_tmp[i] = predictors[i] << 6;
-    }
-
-    a = 1 << (32 - (15 - filter_quant));
-    b = 1 << ((15 - filter_quant) - 1);
-    for (i = 0, j = filter_order - 1; i < filter_order / 2; i++, j--) {
-        filter[j] = a - ((filter_tmp[i] + b) >> (15 - filter_quant));
-        filter[i] = a - ((filter_tmp[j] + b) >> (15 - filter_quant));
-    }
-}
-
-static int decode_subframe(TAKDecContext *s, int32_t *decoded,
-                           int subframe_size, int prev_subframe_size)
-{
-    LOCAL_ALIGNED_16(int16_t, filter, [MAX_PREDICTORS]);
-    GetBitContext *gb = &s->gb;
-    int i, ret;
-    int dshift, size, filter_quant, filter_order;
-
-    memset(filter, 0, MAX_PREDICTORS * sizeof(*filter));
-
-    if (!get_bits1(gb))
-        return decode_residues(s, decoded, subframe_size);
-
-    filter_order = predictor_sizes[get_bits(gb, 4)];
-
-    if (prev_subframe_size > 0 && get_bits1(gb)) {
-        if (filter_order > prev_subframe_size)
-            return AVERROR_INVALIDDATA;
-
-        decoded       -= filter_order;
-        subframe_size += filter_order;
-
-        if (filter_order > subframe_size)
-            return AVERROR_INVALIDDATA;
-    } else {
-        int lpc_mode;
-
-        if (filter_order > subframe_size)
-            return AVERROR_INVALIDDATA;
-
-        lpc_mode = get_bits(gb, 2);
-        if (lpc_mode > 2)
-            return AVERROR_INVALIDDATA;
-
-        if ((ret = decode_residues(s, decoded, filter_order)) < 0)
-            return ret;
-
-        if (lpc_mode)
-            decode_lpc(decoded, lpc_mode, filter_order);
-    }
-
-    dshift = get_bits_esc4(gb);
-    size   = get_bits1(gb) + 6;
-
-    filter_quant = 10;
-    if (get_bits1(gb)) {
-        filter_quant -= get_bits(gb, 3) + 1;
-        if (filter_quant < 3)
-            return AVERROR_INVALIDDATA;
-    }
-
-    decode_filter_coeffs(s, filter_order, size, filter_quant, filter);
-
-    if ((ret = decode_residues(s, &decoded[filter_order],
-                               subframe_size - filter_order)) < 0)
-        return ret;
-
-    av_fast_malloc(&s->residues, &s->residues_buf_size,
-                   FFALIGN(subframe_size + 16, 16) * sizeof(*s->residues));
-    if (!s->residues)
-        return AVERROR(ENOMEM);
-    memset(s->residues, 0, s->residues_buf_size);
-
-    for (i = 0; i < filter_order; i++)
-        s->residues[i] = *decoded++ >> dshift;
-
-    for (i = 0; i < subframe_size - filter_order; i++) {
-        int v = 1 << (filter_quant - 1);
-
-        v += s->dsp.scalarproduct_int16(&s->residues[i], filter,
-                                        FFALIGN(filter_order, 16));
-
-        v = (av_clip(v >> filter_quant, -8192, 8191) << dshift) - *decoded;
-        *decoded++ = v;
-        s->residues[filter_order + i] = v >> dshift;
-    }
-
-    emms_c();
-
-    return 0;
-}
-
-static int decode_channel(TAKDecContext *s, int chan)
-{
-    AVCodecContext *avctx = s->avctx;
-    GetBitContext *gb     = &s->gb;
-    int32_t *decoded      = s->decoded[chan];
-    int left              = s->nb_samples - 1;
-    int i, prev, ret, nb_subframes;
-    int subframe_len[MAX_SUBFRAMES];
-
-    s->sample_shift[chan] = get_bits_esc4(gb);
-    if (s->sample_shift[chan] >= avctx->bits_per_coded_sample)
-        return AVERROR_INVALIDDATA;
-
-    /* NOTE: TAK 2.2.0 appears to set the sample value to 0 if
-     *       bits_per_coded_sample - sample_shift is 1, but this produces
-     *       non-bit-exact output. Reading the 1 bit using get_sbits() instead
-     *       of skipping it produces bit-exact output. This has been reported
-     *       to the TAK author. */
-    *decoded++        = get_sbits(gb,
-                                  avctx->bits_per_coded_sample -
-                                  s->sample_shift[chan]);
-    s->lpc_mode[chan] = get_bits(gb, 2);
-    nb_subframes      = get_bits(gb, 3) + 1;
-
-    i = 0;
-    if (nb_subframes > 1) {
-        if (get_bits_left(gb) < (nb_subframes - 1) * 6)
-            return AVERROR_INVALIDDATA;
-
-        prev = 0;
-        for (; i < nb_subframes - 1; i++) {
-            int subframe_end = get_bits(gb, 6) * s->subframe_scale;
-            if (subframe_end <= prev)
-                return AVERROR_INVALIDDATA;
-            subframe_len[i] = subframe_end - prev;
-            left           -= subframe_len[i];
-            prev            = subframe_end;
-        }
-
-        if (left <= 0)
-            return AVERROR_INVALIDDATA;
-    }
-    subframe_len[i] = left;
-
-    prev = 0;
-    for (i = 0; i < nb_subframes; i++) {
-        if ((ret = decode_subframe(s, decoded, subframe_len[i], prev)) < 0)
-            return ret;
-        decoded += subframe_len[i];
-        prev     = subframe_len[i];
-    }
-
-    return 0;
-}
-
-static int decorrelate(TAKDecContext *s, int c1, int c2, int length)
-{
-    GetBitContext *gb = &s->gb;
-    int32_t *p1       = s->decoded[c1] + 1;
-    int32_t *p2       = s->decoded[c2] + 1;
-    int i;
-    int dshift, dfactor;
-
-    switch (s->dmode) {
-    case 1: /* left/side */
-        for (i = 0; i < length; i++) {
-            int32_t a = p1[i];
-            int32_t b = p2[i];
-            p2[i]     = a + b;
-        }
-        break;
-    case 2: /* side/right */
-        for (i = 0; i < length; i++) {
-            int32_t a = p1[i];
-            int32_t b = p2[i];
-            p1[i]     = b - a;
-        }
-        break;
-    case 3: /* side/mid */
-        for (i = 0; i < length; i++) {
-            int32_t a = p1[i];
-            int32_t b = p2[i];
-            a        -= b >> 1;
-            p1[i]     = a;
-            p2[i]     = a + b;
-        }
-        break;
-    case 4: /* side/left with scale factor */
-        FFSWAP(int32_t*, p1, p2);
-    case 5: /* side/right with scale factor */
-        dshift  = get_bits_esc4(gb);
-        dfactor = get_sbits(gb, 10);
-        for (i = 0; i < length; i++) {
-            int32_t a = p1[i];
-            int32_t b = p2[i];
-            b         = dfactor * (b >> dshift) + 128 >> 8 << dshift;
-            p1[i]     = b - a;
-        }
-        break;
-    case 6:
-        FFSWAP(int32_t*, p1, p2);
-    case 7: {
-        LOCAL_ALIGNED_16(int16_t, filter, [MAX_PREDICTORS]);
-        int length2, order_half, filter_order, dval1, dval2;
-        int av_uninit(code_size);
-
-        memset(filter, 0, MAX_PREDICTORS * sizeof(*filter));
-
-        if (length < 256)
-            return AVERROR_INVALIDDATA;
-
-        dshift       = get_bits_esc4(gb);
-        filter_order = 8 << get_bits1(gb);
-        dval1        = get_bits1(gb);
-        dval2        = get_bits1(gb);
-
-        for (i = 0; i < filter_order; i++) {
-            if (!(i & 3))
-                code_size = 14 - get_bits(gb, 3);
-            filter[i] = get_sbits(gb, code_size);
-        }
-
-        order_half = filter_order / 2;
-        length2    = length - (filter_order - 1);
-
-        /* decorrelate beginning samples */
-        if (dval1) {
-            for (i = 0; i < order_half; i++) {
-                int32_t a = p1[i];
-                int32_t b = p2[i];
-                p1[i]     = a + b;
-            }
-        }
-
-        /* decorrelate ending samples */
-        if (dval2) {
-            for (i = length2 + order_half; i < length; i++) {
-                int32_t a = p1[i];
-                int32_t b = p2[i];
-                p1[i]     = a + b;
-            }
-        }
-
-        av_fast_malloc(&s->residues, &s->residues_buf_size,
-                       FFALIGN(length + 16, 16) * sizeof(*s->residues));
-        if (!s->residues)
-            return AVERROR(ENOMEM);
-        memset(s->residues, 0, s->residues_buf_size);
-
-        for (i = 0; i < length; i++)
-            s->residues[i] = p2[i] >> dshift;
-
-        p1 += order_half;
-
-        for (i = 0; i < length2; i++) {
-            int v = 1 << 9;
-
-            v += s->dsp.scalarproduct_int16(&s->residues[i], filter,
-                                            FFALIGN(filter_order, 16));
-
-            p1[i] = (av_clip(v >> 10, -8192, 8191) << dshift) - p1[i];
-        }
-
-        emms_c();
-        break;
-    }
-    }
-
-    return 0;
-}
-
-static int tak_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *pkt)
-{
-    TAKDecContext *s  = avctx->priv_data;
-    AVFrame *frame    = data;
-    GetBitContext *gb = &s->gb;
-    int chan, i, ret, hsize;
-
-    if (pkt->size < TAK_MIN_FRAME_HEADER_BYTES)
-        return AVERROR_INVALIDDATA;
-
-    init_get_bits(gb, pkt->data, pkt->size * 8);
-
-    if ((ret = ff_tak_decode_frame_header(avctx, gb, &s->ti, 0)) < 0)
-        return ret;
-
-    if (s->ti.flags & TAK_FRAME_FLAG_HAS_METADATA) {
-        avpriv_request_sample(avctx, "Frame metadata");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    hsize = get_bits_count(gb) / 8;
-    if (avctx->err_recognition & AV_EF_CRCCHECK) {
-        if (ff_tak_check_crc(pkt->data, hsize)) {
-            av_log(avctx, AV_LOG_ERROR, "CRC error\n");
-            if (avctx->err_recognition & AV_EF_EXPLODE)
-                return AVERROR_INVALIDDATA;
-        }
-    }
-
-    if (s->ti.codec != TAK_CODEC_MONO_STEREO &&
-        s->ti.codec != TAK_CODEC_MULTICHANNEL) {
-        av_log(avctx, AV_LOG_ERROR, "unsupported codec: %d\n", s->ti.codec);
-        return AVERROR_PATCHWELCOME;
-    }
-    if (s->ti.data_type) {
-        av_log(avctx, AV_LOG_ERROR,
-               "unsupported data type: %d\n", s->ti.data_type);
-        return AVERROR_INVALIDDATA;
-    }
-    if (s->ti.codec == TAK_CODEC_MONO_STEREO && s->ti.channels > 2) {
-        av_log(avctx, AV_LOG_ERROR,
-               "invalid number of channels: %d\n", s->ti.channels);
-        return AVERROR_INVALIDDATA;
-    }
-    if (s->ti.channels > 6) {
-        av_log(avctx, AV_LOG_ERROR,
-               "unsupported number of channels: %d\n", s->ti.channels);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->ti.frame_samples <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "unsupported/invalid number of samples\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->ti.bps != avctx->bits_per_coded_sample) {
-        avctx->bits_per_coded_sample = s->ti.bps;
-        if ((ret = set_bps_params(avctx)) < 0)
-            return ret;
-    }
-    if (s->ti.sample_rate != avctx->sample_rate) {
-        avctx->sample_rate = s->ti.sample_rate;
-        set_sample_rate_params(avctx);
-    }
-    if (s->ti.ch_layout)
-        avctx->channel_layout = s->ti.ch_layout;
-    avctx->channels = s->ti.channels;
-
-    s->nb_samples = s->ti.last_frame_samples ? s->ti.last_frame_samples
-                                             : s->ti.frame_samples;
-
-    frame->nb_samples = s->nb_samples;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-        return ret;
-
-    if (avctx->bits_per_coded_sample <= 16) {
-        int buf_size = av_samples_get_buffer_size(NULL, avctx->channels,
-                                                  s->nb_samples,
-                                                  AV_SAMPLE_FMT_S32P, 0);
-        av_fast_malloc(&s->decode_buffer, &s->decode_buffer_size, buf_size);
-        if (!s->decode_buffer)
-            return AVERROR(ENOMEM);
-        ret = av_samples_fill_arrays((uint8_t **)s->decoded, NULL,
-                                     s->decode_buffer, avctx->channels,
-                                     s->nb_samples, AV_SAMPLE_FMT_S32P, 0);
-        if (ret < 0)
-            return ret;
-    } else {
-        for (chan = 0; chan < avctx->channels; chan++)
-            s->decoded[chan] = (int32_t *)frame->extended_data[chan];
-    }
-
-    if (s->nb_samples < 16) {
-        for (chan = 0; chan < avctx->channels; chan++) {
-            int32_t *decoded = s->decoded[chan];
-            for (i = 0; i < s->nb_samples; i++)
-                decoded[i] = get_sbits(gb, avctx->bits_per_coded_sample);
-        }
-    } else {
-        if (s->ti.codec == TAK_CODEC_MONO_STEREO) {
-            for (chan = 0; chan < avctx->channels; chan++)
-                if (ret = decode_channel(s, chan))
-                    return ret;
-
-            if (avctx->channels == 2) {
-                if (get_bits1(gb)) {
-                    // some kind of subframe length, but it seems to be unused
-                    skip_bits(gb, 6);
-                }
-
-                s->dmode = get_bits(gb, 3);
-                if (ret = decorrelate(s, 0, 1, s->nb_samples - 1))
-                    return ret;
-            }
-        } else if (s->ti.codec == TAK_CODEC_MULTICHANNEL) {
-            if (get_bits1(gb)) {
-                int ch_mask = 0;
-
-                chan = get_bits(gb, 4) + 1;
-                if (chan > avctx->channels)
-                    return AVERROR_INVALIDDATA;
-
-                for (i = 0; i < chan; i++) {
-                    int nbit = get_bits(gb, 4);
-
-                    if (nbit >= avctx->channels)
-                        return AVERROR_INVALIDDATA;
-
-                    if (ch_mask & 1 << nbit)
-                        return AVERROR_INVALIDDATA;
-
-                    s->mcdparams[i].present = get_bits1(gb);
-                    if (s->mcdparams[i].present) {
-                        s->mcdparams[i].index = get_bits(gb, 2);
-                        s->mcdparams[i].chan2 = get_bits(gb, 4);
-                        if (s->mcdparams[i].index == 1) {
-                            if ((nbit == s->mcdparams[i].chan2) ||
-                                (ch_mask & 1 << s->mcdparams[i].chan2))
-                                return AVERROR_INVALIDDATA;
-
-                            ch_mask |= 1 << s->mcdparams[i].chan2;
-                        } else if (!(ch_mask & 1 << s->mcdparams[i].chan2)) {
-                            return AVERROR_INVALIDDATA;
-                        }
-                    }
-                    s->mcdparams[i].chan1 = nbit;
-
-                    ch_mask |= 1 << nbit;
-                }
-            } else {
-                chan = avctx->channels;
-                for (i = 0; i < chan; i++) {
-                    s->mcdparams[i].present = 0;
-                    s->mcdparams[i].chan1   = i;
-                }
-            }
-
-            for (i = 0; i < chan; i++) {
-                if (s->mcdparams[i].present && s->mcdparams[i].index == 1)
-                    if (ret = decode_channel(s, s->mcdparams[i].chan2))
-                        return ret;
-
-                if (ret = decode_channel(s, s->mcdparams[i].chan1))
-                    return ret;
-
-                if (s->mcdparams[i].present) {
-                    s->dmode = mc_dmodes[s->mcdparams[i].index];
-                    if (ret = decorrelate(s,
-                                          s->mcdparams[i].chan2,
-                                          s->mcdparams[i].chan1,
-                                          s->nb_samples - 1))
-                        return ret;
-                }
-            }
-        }
-
-        for (chan = 0; chan < avctx->channels; chan++) {
-            int32_t *decoded = s->decoded[chan];
-
-            if (s->lpc_mode[chan])
-                decode_lpc(decoded, s->lpc_mode[chan], s->nb_samples);
-
-            if (s->sample_shift[chan] > 0)
-                for (i = 0; i < s->nb_samples; i++)
-                    decoded[i] <<= s->sample_shift[chan];
-        }
-    }
-
-    align_get_bits(gb);
-    skip_bits(gb, 24);
-    if (get_bits_left(gb) < 0)
-        av_log(avctx, AV_LOG_DEBUG, "overread\n");
-    else if (get_bits_left(gb) > 0)
-        av_log(avctx, AV_LOG_DEBUG, "underread\n");
-
-    if (avctx->err_recognition & AV_EF_CRCCHECK) {
-        if (ff_tak_check_crc(pkt->data + hsize,
-                             get_bits_count(gb) / 8 - hsize)) {
-            av_log(avctx, AV_LOG_ERROR, "CRC error\n");
-            if (avctx->err_recognition & AV_EF_EXPLODE)
-                return AVERROR_INVALIDDATA;
-        }
-    }
-
-    /* convert to output buffer */
-    switch (avctx->sample_fmt) {
-    case AV_SAMPLE_FMT_U8P:
-        for (chan = 0; chan < avctx->channels; chan++) {
-            uint8_t *samples = (uint8_t *)frame->extended_data[chan];
-            int32_t *decoded = s->decoded[chan];
-            for (i = 0; i < s->nb_samples; i++)
-                samples[i] = decoded[i] + 0x80;
-        }
-        break;
-    case AV_SAMPLE_FMT_S16P:
-        for (chan = 0; chan < avctx->channels; chan++) {
-            int16_t *samples = (int16_t *)frame->extended_data[chan];
-            int32_t *decoded = s->decoded[chan];
-            for (i = 0; i < s->nb_samples; i++)
-                samples[i] = decoded[i];
-        }
-        break;
-    case AV_SAMPLE_FMT_S32P:
-        for (chan = 0; chan < avctx->channels; chan++) {
-            int32_t *samples = (int32_t *)frame->extended_data[chan];
-            for (i = 0; i < s->nb_samples; i++)
-                samples[i] <<= 8;
-        }
-        break;
-    }
-
-    *got_frame_ptr = 1;
-
-    return pkt->size;
-}
-
-static av_cold int tak_decode_close(AVCodecContext *avctx)
-{
-    TAKDecContext *s = avctx->priv_data;
-
-    av_freep(&s->decode_buffer);
-    av_freep(&s->residues);
-
-    return 0;
-}
-
-AVCodec ff_tak_decoder = {
-    .name             = "tak",
-    .long_name        = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor)"),
-    .type             = AVMEDIA_TYPE_AUDIO,
-    .id               = AV_CODEC_ID_TAK,
-    .priv_data_size   = sizeof(TAKDecContext),
-    .init             = tak_decode_init,
-    .init_static_data = tak_init_static_data,
-    .close            = tak_decode_close,
-    .decode           = tak_decode_frame,
-    .capabilities     = CODEC_CAP_DR1,
-    .sample_fmts      = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
-                                                        AV_SAMPLE_FMT_S16P,
-                                                        AV_SAMPLE_FMT_S32P,
-                                                        AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/targa.c b/deps/libav/libavcodec/targa.c
deleted file mode 100644
index f077c03..0000000
--- a/deps/libav/libavcodec/targa.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Targa (.tga) image decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "targa.h"
-
-typedef struct TargaContext {
-    GetByteContext gb;
-
-    int color_type;
-    int compression_type;
-} TargaContext;
-
-static int targa_decode_rle(AVCodecContext *avctx, TargaContext *s,
-                            uint8_t *dst, int w, int h, int stride, int bpp)
-{
-    int x, y;
-    int depth = (bpp + 1) >> 3;
-    int type, count;
-    int diff;
-
-    diff = stride - w * depth;
-    x = y = 0;
-    while (y < h) {
-        if (bytestream2_get_bytes_left(&s->gb) <= 0) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Ran ouf of data before end-of-image\n");
-            return AVERROR_INVALIDDATA;
-        }
-        type  = bytestream2_get_byteu(&s->gb);
-        count = (type & 0x7F) + 1;
-        type &= 0x80;
-        if (x + count > w && x + count + 1 > (h - y) * w) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Packet went out of bounds: position (%i,%i) size %i\n",
-                   x, y, count);
-            return AVERROR_INVALIDDATA;
-        }
-        if (!type) {
-            do {
-                int n  = FFMIN(count, w - x);
-                bytestream2_get_buffer(&s->gb, dst, n * depth);
-                count -= n;
-                dst   += n * depth;
-                x     += n;
-                if (x == w) {
-                    x    = 0;
-                    y++;
-                    dst += diff;
-                }
-            } while (count > 0);
-        } else {
-            uint8_t tmp[4];
-            bytestream2_get_buffer(&s->gb, tmp, depth);
-            do {
-                int n  = FFMIN(count, w - x);
-                count -= n;
-                x     += n;
-                do {
-                    memcpy(dst, tmp, depth);
-                    dst += depth;
-                } while (--n);
-                if (x == w) {
-                    x    = 0;
-                    y++;
-                    dst += diff;
-                }
-            } while (count > 0);
-        }
-    }
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    TargaContext * const s = avctx->priv_data;
-    AVFrame * const p = data;
-    uint8_t *dst;
-    int stride;
-    int idlen, compr, y, w, h, bpp, flags, ret;
-    int first_clr, colors, csize;
-
-    bytestream2_init(&s->gb, avpkt->data, avpkt->size);
-
-    /* parse image header */
-    idlen     = bytestream2_get_byte(&s->gb);
-    bytestream2_skip(&s->gb, 1); /* pal */
-    compr     = bytestream2_get_byte(&s->gb);
-    first_clr = bytestream2_get_le16(&s->gb);
-    colors    = bytestream2_get_le16(&s->gb);
-    csize     = bytestream2_get_byte(&s->gb);
-    bytestream2_skip(&s->gb, 4); /* 2: x, 2: y */
-    w         = bytestream2_get_le16(&s->gb);
-    h         = bytestream2_get_le16(&s->gb);
-    bpp       = bytestream2_get_byte(&s->gb);
-    flags     = bytestream2_get_byte(&s->gb);
-    // skip identifier if any
-    bytestream2_skip(&s->gb, idlen);
-
-    switch(bpp){
-    case 8:
-        avctx->pix_fmt = ((compr & (~TGA_RLE)) == TGA_BW) ? AV_PIX_FMT_GRAY8 : AV_PIX_FMT_PAL8;
-        break;
-    case 15:
-        avctx->pix_fmt = AV_PIX_FMT_RGB555LE;
-        break;
-    case 16:
-        avctx->pix_fmt = AV_PIX_FMT_RGB555LE;
-        break;
-    case 24:
-        avctx->pix_fmt = AV_PIX_FMT_BGR24;
-        break;
-    case 32:
-        avctx->pix_fmt = AV_PIX_FMT_BGRA;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Bit depth %i is not supported\n", bpp);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0){
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    if(flags & 0x20){
-        dst = p->data[0];
-        stride = p->linesize[0];
-    }else{ //image is upside-down
-        dst = p->data[0] + p->linesize[0] * (h - 1);
-        stride = -p->linesize[0];
-    }
-
-    if(colors){
-        int pal_size, pal_sample_size;
-        if((colors + first_clr) > 256){
-            av_log(avctx, AV_LOG_ERROR, "Incorrect palette: %i colors with offset %i\n", colors, first_clr);
-            return AVERROR_INVALIDDATA;
-        }
-        switch (csize) {
-        case 24: pal_sample_size = 3; break;
-        case 16:
-        case 15: pal_sample_size = 2; break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Palette entry size %i bits is not supported\n", csize);
-            return AVERROR_INVALIDDATA;
-        }
-        pal_size = colors * pal_sample_size;
-        if(avctx->pix_fmt != AV_PIX_FMT_PAL8)//should not occur but skip palette anyway
-            bytestream2_skip(&s->gb, pal_size);
-        else{
-            int t;
-            uint32_t *pal = ((uint32_t *)p->data[1]) + first_clr;
-
-            if (bytestream2_get_bytes_left(&s->gb) < pal_size) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Not enough data to read palette\n");
-                return AVERROR_INVALIDDATA;
-            }
-            switch (pal_sample_size) {
-            case 3:
-                /* RGB24 */
-                for (t = 0; t < colors; t++)
-                    *pal++ = bytestream2_get_le24u(&s->gb);
-                break;
-            case 2:
-                /* RGB555 */
-                for (t = 0; t < colors; t++) {
-                    uint32_t v = bytestream2_get_le16u(&s->gb);
-                    v = ((v & 0x7C00) <<  9) |
-                        ((v & 0x03E0) <<  6) |
-                        ((v & 0x001F) <<  3);
-                    /* left bit replication */
-                    v |= (v & 0xE0E0E0U) >> 5;
-                    *pal++ = v;
-                }
-                break;
-            }
-            p->palette_has_changed = 1;
-        }
-    }
-    if ((compr & (~TGA_RLE)) == TGA_NODATA) {
-        memset(p->data[0], 0, p->linesize[0] * h);
-    } else {
-        if(compr & TGA_RLE){
-            int res = targa_decode_rle(avctx, s, dst, w, h, stride, bpp);
-            if (res < 0)
-                return res;
-        } else {
-            size_t img_size = w * ((bpp + 1) >> 3);
-            if (bytestream2_get_bytes_left(&s->gb) < img_size * h) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Not enough data available for image\n");
-                return AVERROR_INVALIDDATA;
-            }
-            for (y = 0; y < h; y++) {
-                bytestream2_get_bufferu(&s->gb, dst, img_size);
-                dst += stride;
-            }
-        }
-    }
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_targa_decoder = {
-    .name           = "targa",
-    .long_name      = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TARGA,
-    .priv_data_size = sizeof(TargaContext),
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/targa.h b/deps/libav/libavcodec/targa.h
deleted file mode 100644
index f4ef553..0000000
--- a/deps/libav/libavcodec/targa.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_TARGA_H
-#define AVCODEC_TARGA_H
-
-/**
- * @file
- * targa file common definitions
- *
- * Based on:
- * http://www.gamers.org/dEngine/quake3/TGA.txt
- *
- * and other specs you can find referenced for example in:
- * http://en.wikipedia.org/wiki/Truevision_TGA
- */
-
-enum TargaCompr {
-    TGA_NODATA = 0, // no image data
-    TGA_PAL    = 1, // palettized
-    TGA_RGB    = 2, // true-color
-    TGA_BW     = 3, // black & white or grayscale
-    TGA_RLE    = 8, // flag pointing that data is RLE-coded
-};
-
-#endif /* AVCODEC_TARGA_H */
diff --git a/deps/libav/libavcodec/targaenc.c b/deps/libav/libavcodec/targaenc.c
deleted file mode 100644
index 7679029..0000000
--- a/deps/libav/libavcodec/targaenc.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Targa (.tga) image encoder
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/pixdesc.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "rle.h"
-#include "targa.h"
-
-/**
- * RLE compress the image, with maximum size of out_size
- * @param outbuf Output buffer
- * @param out_size Maximum output size
- * @param pic Image to compress
- * @param bpp Bytes per pixel
- * @param w Image width
- * @param h Image height
- * @return Size of output in bytes, or -1 if larger than out_size
- */
-static int targa_encode_rle(uint8_t *outbuf, int out_size, const AVFrame *pic,
-                            int bpp, int w, int h)
-{
-    int y,ret;
-    uint8_t *out;
-
-    out = outbuf;
-
-    for(y = 0; y < h; y ++) {
-        ret = ff_rle_encode(out, out_size, pic->data[0] + pic->linesize[0] * y, bpp, w, 0x7f, 0, -1, 0);
-        if(ret == -1){
-            return -1;
-        }
-        out+= ret;
-        out_size -= ret;
-    }
-
-    return out - outbuf;
-}
-
-static int targa_encode_normal(uint8_t *outbuf, const AVFrame *pic, int bpp, int w, int h)
-{
-    int i, n = bpp * w;
-    uint8_t *out = outbuf;
-    uint8_t *ptr = pic->data[0];
-
-    for(i=0; i < h; i++) {
-        memcpy(out, ptr, n);
-        out += n;
-        ptr += pic->linesize[0];
-    }
-
-    return out - outbuf;
-}
-
-static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                              const AVFrame *p, int *got_packet)
-{
-    int bpp, picsize, datasize = -1, ret;
-    uint8_t *out;
-
-    if(avctx->width > 0xffff || avctx->height > 0xffff) {
-        av_log(avctx, AV_LOG_ERROR, "image dimensions too large\n");
-        return AVERROR(EINVAL);
-    }
-    picsize = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
-    if ((ret = ff_alloc_packet(pkt, picsize + 45)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
-        return ret;
-    }
-
-    /* zero out the header and only set applicable fields */
-    memset(pkt->data, 0, 12);
-    AV_WL16(pkt->data+12, avctx->width);
-    AV_WL16(pkt->data+14, avctx->height);
-    /* image descriptor byte: origin is always top-left, bits 0-3 specify alpha */
-    pkt->data[17] = 0x20 | (avctx->pix_fmt == AV_PIX_FMT_BGRA ? 8 : 0);
-
-    switch(avctx->pix_fmt) {
-    case AV_PIX_FMT_GRAY8:
-        pkt->data[2]  = TGA_BW;     /* uncompressed grayscale image */
-        pkt->data[16] = 8;          /* bpp */
-        break;
-    case AV_PIX_FMT_RGB555LE:
-        pkt->data[2]  = TGA_RGB;    /* uncompresses true-color image */
-        pkt->data[16] = 16;         /* bpp */
-        break;
-    case AV_PIX_FMT_BGR24:
-        pkt->data[2]  = TGA_RGB;    /* uncompressed true-color image */
-        pkt->data[16] = 24;         /* bpp */
-        break;
-    case AV_PIX_FMT_BGRA:
-        pkt->data[2]  = TGA_RGB;    /* uncompressed true-color image */
-        pkt->data[16] = 32;         /* bpp */
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Pixel format '%s' not supported.\n",
-               av_get_pix_fmt_name(avctx->pix_fmt));
-        return AVERROR(EINVAL);
-    }
-    bpp = pkt->data[16] >> 3;
-
-    out = pkt->data + 18;  /* skip past the header we just output */
-
-    /* try RLE compression */
-    if (avctx->coder_type != FF_CODER_TYPE_RAW)
-        datasize = targa_encode_rle(out, picsize, p, bpp, avctx->width, avctx->height);
-
-    /* if that worked well, mark the picture as RLE compressed */
-    if(datasize >= 0)
-        pkt->data[2] |= 8;
-
-    /* if RLE didn't make it smaller, go back to no compression */
-    else datasize = targa_encode_normal(out, p, bpp, avctx->width, avctx->height);
-
-    out += datasize;
-
-    /* The standard recommends including this section, even if we don't use
-     * any of the features it affords. TODO: take advantage of the pixel
-     * aspect ratio and encoder ID fields available? */
-    memcpy(out, "\0\0\0\0\0\0\0\0TRUEVISION-XFILE.", 26);
-
-    pkt->size   = out + 26 - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int targa_encode_init(AVCodecContext *avctx)
-{
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->key_frame = 1;
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
-    return 0;
-}
-
-static av_cold int targa_encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-AVCodec ff_targa_encoder = {
-    .name           = "targa",
-    .long_name      = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TARGA,
-    .init           = targa_encode_init,
-    .close          = targa_encode_close,
-    .encode2        = targa_encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]){
-        AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_NONE
-    },
-};
diff --git a/deps/libav/libavcodec/thread.h b/deps/libav/libavcodec/thread.h
deleted file mode 100644
index 864e67e..0000000
--- a/deps/libav/libavcodec/thread.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2008 Alexander Strange <astrange at ithinksw.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Multithreading support functions
- * @author Alexander Strange <astrange at ithinksw.com>
- */
-
-#ifndef AVCODEC_THREAD_H
-#define AVCODEC_THREAD_H
-
-#include "libavutil/buffer.h"
-
-#include "config.h"
-#include "avcodec.h"
-
-typedef struct ThreadFrame {
-    AVFrame *f;
-    AVCodecContext *owner;
-    // progress->data is an array of 2 ints holding progress for top/bottom
-    // fields
-    AVBufferRef *progress;
-} ThreadFrame;
-
-/**
- * Wait for decoding threads to finish and reset internal state.
- * Called by avcodec_flush_buffers().
- *
- * @param avctx The context.
- */
-void ff_thread_flush(AVCodecContext *avctx);
-
-/**
- * Submit a new frame to a decoding thread.
- * Returns the next available frame in picture. *got_picture_ptr
- * will be 0 if none is available.
- * The return value on success is the size of the consumed packet for
- * compatibility with avcodec_decode_video2(). This means the decoder
- * has to consume the full packet.
- *
- * Parameters are the same as avcodec_decode_video2().
- */
-int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture,
-                           int *got_picture_ptr, AVPacket *avpkt);
-
-/**
- * If the codec defines update_thread_context(), call this
- * when they are ready for the next thread to start decoding
- * the next frame. After calling it, do not change any variables
- * read by the update_thread_context() method, or call ff_thread_get_buffer().
- *
- * @param avctx The context.
- */
-void ff_thread_finish_setup(AVCodecContext *avctx);
-
-/**
- * Notify later decoding threads when part of their reference picture is ready.
- * Call this when some part of the picture is finished decoding.
- * Later calls with lower values of progress have no effect.
- *
- * @param f The picture being decoded.
- * @param progress Value, in arbitrary units, of how much of the picture has decoded.
- * @param field The field being decoded, for field-picture codecs.
- * 0 for top field or frame pictures, 1 for bottom field.
- */
-void ff_thread_report_progress(ThreadFrame *f, int progress, int field);
-
-/**
- * Wait for earlier decoding threads to finish reference pictures.
- * Call this before accessing some part of a picture, with a given
- * value for progress, and it will return after the responsible decoding
- * thread calls ff_thread_report_progress() with the same or
- * higher value for progress.
- *
- * @param f The picture being referenced.
- * @param progress Value, in arbitrary units, to wait for.
- * @param field The field being referenced, for field-picture codecs.
- * 0 for top field or frame pictures, 1 for bottom field.
- */
-void ff_thread_await_progress(ThreadFrame *f, int progress, int field);
-
-/**
- * Wrapper around get_buffer() for frame-multithreaded codecs.
- * Call this function instead of ff_get_buffer(f).
- * Cannot be called after the codec has called ff_thread_finish_setup().
- *
- * @param avctx The current context.
- * @param f The frame to write into.
- */
-int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags);
-
-/**
- * Wrapper around release_buffer() frame-for multithreaded codecs.
- * Call this function instead of avctx->release_buffer(f).
- * The AVFrame will be copied and the actual release_buffer() call
- * will be performed later. The contents of data pointed to by the
- * AVFrame should not be changed until ff_thread_get_buffer() is called
- * on it.
- *
- * @param avctx The current context.
- * @param f The picture being released.
- */
-void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f);
-
-int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src);
-
-int ff_thread_init(AVCodecContext *s);
-void ff_thread_free(AVCodecContext *s);
-
-#endif /* AVCODEC_THREAD_H */
diff --git a/deps/libav/libavcodec/tiertexseqv.c b/deps/libav/libavcodec/tiertexseqv.c
deleted file mode 100644
index 33b2579..0000000
--- a/deps/libav/libavcodec/tiertexseqv.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Tiertex Limited SEQ Video Decoder
- * Copyright (c) 2006 Gregory Montoir (cyx at users.sourceforge.net)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Tiertex Limited SEQ video decoder
- */
-
-#include "avcodec.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "internal.h"
-
-
-typedef struct SeqVideoContext {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-} SeqVideoContext;
-
-
-static const unsigned char *seq_unpack_rle_block(const unsigned char *src,
-                                                 const unsigned char *src_end,
-                                                 unsigned char *dst, int dst_size)
-{
-    int i, len, sz;
-    GetBitContext gb;
-    int code_table[64];
-
-    /* get the rle codes */
-    init_get_bits(&gb, src, (src_end - src) * 8);
-    for (i = 0, sz = 0; i < 64 && sz < dst_size; i++) {
-        if (get_bits_left(&gb) < 4)
-            return NULL;
-        code_table[i] = get_sbits(&gb, 4);
-        sz += FFABS(code_table[i]);
-    }
-    src += (get_bits_count(&gb) + 7) / 8;
-
-    /* do the rle unpacking */
-    for (i = 0; i < 64 && dst_size > 0; i++) {
-        len = code_table[i];
-        if (len < 0) {
-            len = -len;
-            if (src_end - src < 1)
-                return NULL;
-            memset(dst, *src++, FFMIN(len, dst_size));
-        } else {
-            if (src_end - src < len)
-                return NULL;
-            memcpy(dst, src, FFMIN(len, dst_size));
-            src += len;
-        }
-        dst += len;
-        dst_size -= len;
-    }
-    return src;
-}
-
-static const unsigned char *seq_decode_op1(SeqVideoContext *seq,
-                                           const unsigned char *src,
-                                           const unsigned char *src_end,
-                                           unsigned char *dst)
-{
-    const unsigned char *color_table;
-    int b, i, len, bits;
-    GetBitContext gb;
-    unsigned char block[8 * 8];
-
-    if (src_end - src < 1)
-        return NULL;
-    len = *src++;
-    if (len & 0x80) {
-        switch (len & 3) {
-        case 1:
-            src = seq_unpack_rle_block(src, src_end, block, sizeof(block));
-            for (b = 0; b < 8; b++) {
-                memcpy(dst, &block[b * 8], 8);
-                dst += seq->frame->linesize[0];
-            }
-            break;
-        case 2:
-            src = seq_unpack_rle_block(src, src_end, block, sizeof(block));
-            for (i = 0; i < 8; i++) {
-                for (b = 0; b < 8; b++)
-                    dst[b * seq->frame->linesize[0]] = block[i * 8 + b];
-                ++dst;
-            }
-            break;
-        }
-    } else {
-        if (len <= 0)
-            return NULL;
-        bits = ff_log2_tab[len - 1] + 1;
-        if (src_end - src < len + 8 * bits)
-            return NULL;
-        color_table = src;
-        src += len;
-        init_get_bits(&gb, src, bits * 8 * 8); src += bits * 8;
-        for (b = 0; b < 8; b++) {
-            for (i = 0; i < 8; i++)
-                dst[i] = color_table[get_bits(&gb, bits)];
-            dst += seq->frame->linesize[0];
-        }
-    }
-
-    return src;
-}
-
-static const unsigned char *seq_decode_op2(SeqVideoContext *seq,
-                                           const unsigned char *src,
-                                           const unsigned char *src_end,
-                                           unsigned char *dst)
-{
-    int i;
-
-    if (src_end - src < 8 * 8)
-        return NULL;
-
-    for (i = 0; i < 8; i++) {
-        memcpy(dst, src, 8);
-        src += 8;
-        dst += seq->frame->linesize[0];
-    }
-
-    return src;
-}
-
-static const unsigned char *seq_decode_op3(SeqVideoContext *seq,
-                                           const unsigned char *src,
-                                           const unsigned char *src_end,
-                                           unsigned char *dst)
-{
-    int pos, offset;
-
-    do {
-        if (src_end - src < 2)
-            return NULL;
-        pos = *src++;
-        offset = ((pos >> 3) & 7) * seq->frame->linesize[0] + (pos & 7);
-        dst[offset] = *src++;
-    } while (!(pos & 0x80));
-
-    return src;
-}
-
-static int seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size)
-{
-    const unsigned char *data_end = data + data_size;
-    GetBitContext gb;
-    int flags, i, j, x, y, op;
-    unsigned char c[3];
-    unsigned char *dst;
-    uint32_t *palette;
-
-    flags = *data++;
-
-    if (flags & 1) {
-        palette = (uint32_t *)seq->frame->data[1];
-        if (data_end - data < 256 * 3)
-            return AVERROR_INVALIDDATA;
-        for (i = 0; i < 256; i++) {
-            for (j = 0; j < 3; j++, data++)
-                c[j] = (*data << 2) | (*data >> 4);
-            palette[i] = AV_RB24(c);
-        }
-        seq->frame->palette_has_changed = 1;
-    }
-
-    if (flags & 2) {
-        if (data_end - data < 128)
-            return AVERROR_INVALIDDATA;
-        init_get_bits(&gb, data, 128 * 8); data += 128;
-        for (y = 0; y < 128; y += 8)
-            for (x = 0; x < 256; x += 8) {
-                dst = &seq->frame->data[0][y * seq->frame->linesize[0] + x];
-                op = get_bits(&gb, 2);
-                switch (op) {
-                case 1:
-                    data = seq_decode_op1(seq, data, data_end, dst);
-                    break;
-                case 2:
-                    data = seq_decode_op2(seq, data, data_end, dst);
-                    break;
-                case 3:
-                    data = seq_decode_op3(seq, data, data_end, dst);
-                    break;
-                }
-                if (!data)
-                    return AVERROR_INVALIDDATA;
-            }
-    }
-    return 0;
-}
-
-static av_cold int seqvideo_decode_init(AVCodecContext *avctx)
-{
-    SeqVideoContext *seq = avctx->priv_data;
-
-    seq->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    seq->frame = av_frame_alloc();
-    if (!seq->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int seqvideo_decode_frame(AVCodecContext *avctx,
-                                 void *data, int *got_frame,
-                                 AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    int ret;
-
-    SeqVideoContext *seq = avctx->priv_data;
-
-    if ((ret = ff_reget_buffer(avctx, seq->frame)) < 0) {
-        av_log(seq->avctx, AV_LOG_ERROR, "tiertexseqvideo: reget_buffer() failed\n");
-        return ret;
-    }
-
-    if (seqvideo_decode(seq, buf, buf_size))
-        return AVERROR_INVALIDDATA;
-
-    if ((ret = av_frame_ref(data, seq->frame)) < 0)
-        return ret;
-    *got_frame       = 1;
-
-    return buf_size;
-}
-
-static av_cold int seqvideo_decode_end(AVCodecContext *avctx)
-{
-    SeqVideoContext *seq = avctx->priv_data;
-
-    av_frame_free(&seq->frame);
-
-    return 0;
-}
-
-AVCodec ff_tiertexseqvideo_decoder = {
-    .name           = "tiertexseqvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("Tiertex Limited SEQ video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TIERTEXSEQVIDEO,
-    .priv_data_size = sizeof(SeqVideoContext),
-    .init           = seqvideo_decode_init,
-    .close          = seqvideo_decode_end,
-    .decode         = seqvideo_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/tiff.c b/deps/libav/libavcodec/tiff.c
deleted file mode 100644
index 7fb0e7a..0000000
--- a/deps/libav/libavcodec/tiff.c
+++ /dev/null
@@ -1,714 +0,0 @@
-/*
- * TIFF image decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * TIFF image decoder
- * @author Konstantin Shishkov
- */
-
-#include "config.h"
-#if CONFIG_ZLIB
-#include <zlib.h>
-#endif
-
-#include "libavutil/attributes.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "faxcompr.h"
-#include "internal.h"
-#include "lzw.h"
-#include "mathops.h"
-#include "tiff.h"
-
-typedef struct TiffContext {
-    AVCodecContext *avctx;
-
-    int width, height;
-    unsigned int bpp, bppcount;
-    uint32_t palette[256];
-    int palette_is_set;
-    int le;
-    enum TiffCompr compr;
-    int invert;
-    int fax_opts;
-    int predictor;
-    int fill_order;
-
-    int strips, rps, sstype;
-    int sot;
-    const uint8_t *stripdata;
-    const uint8_t *stripsizes;
-    int stripsize, stripoff;
-    LZWState *lzw;
-} TiffContext;
-
-static unsigned tget_short(const uint8_t **p, int le)
-{
-    unsigned v = le ? AV_RL16(*p) : AV_RB16(*p);
-    *p += 2;
-    return v;
-}
-
-static unsigned tget_long(const uint8_t **p, int le)
-{
-    unsigned v = le ? AV_RL32(*p) : AV_RB32(*p);
-    *p += 4;
-    return v;
-}
-
-static unsigned tget(const uint8_t **p, int type, int le)
-{
-    switch (type) {
-    case TIFF_BYTE:
-        return *(*p)++;
-    case TIFF_SHORT:
-        return tget_short(p, le);
-    case TIFF_LONG:
-        return tget_long(p, le);
-    default:
-        return UINT_MAX;
-    }
-}
-
-#if CONFIG_ZLIB
-static int tiff_uncompress(uint8_t *dst, unsigned long *len, const uint8_t *src,
-                           int size)
-{
-    z_stream zstream = { 0 };
-    int zret;
-
-    zstream.next_in   = src;
-    zstream.avail_in  = size;
-    zstream.next_out  = dst;
-    zstream.avail_out = *len;
-    zret              = inflateInit(&zstream);
-    if (zret != Z_OK) {
-        av_log(NULL, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
-        return zret;
-    }
-    zret = inflate(&zstream, Z_SYNC_FLUSH);
-    inflateEnd(&zstream);
-    *len = zstream.total_out;
-    return zret == Z_STREAM_END ? Z_OK : zret;
-}
-
-static int tiff_unpack_zlib(TiffContext *s, uint8_t *dst, int stride,
-                            const uint8_t *src, int size,
-                            int width, int lines)
-{
-    uint8_t *zbuf;
-    unsigned long outlen;
-    int ret, line;
-    outlen = width * lines;
-    zbuf   = av_malloc(outlen);
-    if (!zbuf)
-        return AVERROR(ENOMEM);
-    ret = tiff_uncompress(zbuf, &outlen, src, size);
-    if (ret != Z_OK) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Uncompressing failed (%lu of %lu) with error %d\n", outlen,
-               (unsigned long)width * lines, ret);
-        av_free(zbuf);
-        return AVERROR_UNKNOWN;
-    }
-    src = zbuf;
-    for (line = 0; line < lines; line++) {
-        memcpy(dst, src, width);
-        dst += stride;
-        src += width;
-    }
-    av_free(zbuf);
-    return 0;
-}
-#endif
-
-
-static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,
-                           const uint8_t *src, int size, int lines)
-{
-    int i, ret = 0;
-    uint8_t *src2 = av_malloc((unsigned)size +
-                              FF_INPUT_BUFFER_PADDING_SIZE);
-
-    if (!src2) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Error allocating temporary buffer\n");
-        return AVERROR(ENOMEM);
-    }
-    if (s->fax_opts & 2) {
-        avpriv_request_sample(s->avctx, "Uncompressed fax mode");
-        av_free(src2);
-        return AVERROR_PATCHWELCOME;
-    }
-    if (!s->fill_order) {
-        memcpy(src2, src, size);
-    } else {
-        for (i = 0; i < size; i++)
-            src2[i] = ff_reverse[src[i]];
-    }
-    memset(src2 + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    ret = ff_ccitt_unpack(s->avctx, src2, size, dst, lines, stride,
-                          s->compr, s->fax_opts);
-    av_free(src2);
-    return ret;
-}
-
-static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
-                             const uint8_t *src, int size, int lines)
-{
-    int c, line, pixels, code, ret;
-    const uint8_t *ssrc = src;
-    int width           = ((s->width * s->bpp) + 7) >> 3;
-
-    if (size <= 0)
-        return AVERROR_INVALIDDATA;
-
-    if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE) {
-#if CONFIG_ZLIB
-        return tiff_unpack_zlib(s, dst, stride, src, size, width, lines);
-#else
-        av_log(s->avctx, AV_LOG_ERROR,
-               "zlib support not enabled, "
-               "deflate compression not supported\n");
-        return AVERROR(ENOSYS);
-#endif
-    }
-    if (s->compr == TIFF_LZW) {
-        if ((ret = ff_lzw_decode_init(s->lzw, 8, src, size, FF_LZW_TIFF)) < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "Error initializing LZW decoder\n");
-            return ret;
-        }
-    }
-    if (s->compr == TIFF_CCITT_RLE ||
-        s->compr == TIFF_G3        ||
-        s->compr == TIFF_G4) {
-        return tiff_unpack_fax(s, dst, stride, src, size, lines);
-    }
-    for (line = 0; line < lines; line++) {
-        if (src - ssrc > size) {
-            av_log(s->avctx, AV_LOG_ERROR, "Source data overread\n");
-            return AVERROR_INVALIDDATA;
-        }
-        switch (s->compr) {
-        case TIFF_RAW:
-            if (ssrc + size - src < width)
-                return AVERROR_INVALIDDATA;
-            if (!s->fill_order) {
-                memcpy(dst, src, width);
-            } else {
-                int i;
-                for (i = 0; i < width; i++)
-                    dst[i] = ff_reverse[src[i]];
-            }
-            src += width;
-            break;
-        case TIFF_PACKBITS:
-            for (pixels = 0; pixels < width;) {
-                if (ssrc + size - src < 2)
-                    return AVERROR_INVALIDDATA;
-                code = (int8_t) *src++;
-                if (code >= 0) {
-                    code++;
-                    if (pixels + code > width ||
-                        ssrc + size - src < code) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "Copy went out of bounds\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    memcpy(dst + pixels, src, code);
-                    src    += code;
-                    pixels += code;
-                } else if (code != -128) { // -127..-1
-                    code = (-code) + 1;
-                    if (pixels + code > width) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "Run went out of bounds\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    c = *src++;
-                    memset(dst + pixels, c, code);
-                    pixels += code;
-                }
-            }
-            break;
-        case TIFF_LZW:
-            pixels = ff_lzw_decode(s->lzw, dst, width);
-            if (pixels < width) {
-                av_log(s->avctx, AV_LOG_ERROR, "Decoded only %i bytes of %i\n",
-                       pixels, width);
-                return AVERROR_INVALIDDATA;
-            }
-            break;
-        }
-        dst += stride;
-    }
-    return 0;
-}
-
-static int init_image(TiffContext *s, AVFrame *frame)
-{
-    int i, ret;
-    uint32_t *pal;
-
-    switch (s->bpp * 10 + s->bppcount) {
-    case 11:
-        s->avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
-        break;
-    case 81:
-        s->avctx->pix_fmt = AV_PIX_FMT_PAL8;
-        break;
-    case 243:
-        s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
-        break;
-    case 161:
-        s->avctx->pix_fmt = s->le ? AV_PIX_FMT_GRAY16LE : AV_PIX_FMT_GRAY16BE;
-        break;
-    case 324:
-        s->avctx->pix_fmt = AV_PIX_FMT_RGBA;
-        break;
-    case 483:
-        s->avctx->pix_fmt = s->le ? AV_PIX_FMT_RGB48LE : AV_PIX_FMT_RGB48BE;
-        break;
-    default:
-        av_log(s->avctx, AV_LOG_ERROR,
-               "This format is not supported (bpp=%d, bppcount=%d)\n",
-               s->bpp, s->bppcount);
-        return AVERROR_INVALIDDATA;
-    }
-    if (s->width != s->avctx->width || s->height != s->avctx->height) {
-        ret = ff_set_dimensions(s->avctx, s->width, s->height);
-        if (ret < 0)
-            return ret;
-    }
-    if ((ret = ff_get_buffer(s->avctx, frame, 0)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
-        if (s->palette_is_set) {
-            memcpy(frame->data[1], s->palette, sizeof(s->palette));
-        } else {
-            /* make default grayscale pal */
-            pal = (uint32_t *) frame->data[1];
-            for (i = 0; i < 256; i++)
-                pal[i] = i * 0x010101;
-        }
-    }
-    return 0;
-}
-
-static int tiff_decode_tag(TiffContext *s, const uint8_t *start,
-                           const uint8_t *buf, const uint8_t *end_buf)
-{
-    unsigned tag, type, count, off, value = 0;
-    int i, j;
-    uint32_t *pal;
-    const uint8_t *rp, *gp, *bp;
-
-    if (end_buf - buf < 12)
-        return AVERROR_INVALIDDATA;
-    tag   = tget_short(&buf, s->le);
-    type  = tget_short(&buf, s->le);
-    count = tget_long(&buf, s->le);
-    off   = tget_long(&buf, s->le);
-
-    if (type == 0 || type >= FF_ARRAY_ELEMS(type_sizes)) {
-        av_log(s->avctx, AV_LOG_DEBUG, "Unknown tiff type (%u) encountered\n",
-               type);
-        return 0;
-    }
-
-    if (count == 1) {
-        switch (type) {
-        case TIFF_BYTE:
-        case TIFF_SHORT:
-            buf  -= 4;
-            value = tget(&buf, type, s->le);
-            buf   = NULL;
-            break;
-        case TIFF_LONG:
-            value = off;
-            buf   = NULL;
-            break;
-        case TIFF_STRING:
-            if (count <= 4) {
-                buf -= 4;
-                break;
-            }
-        default:
-            value = UINT_MAX;
-            buf   = start + off;
-        }
-    } else {
-        if (count <= 4 && type_sizes[type] * count <= 4)
-            buf -= 4;
-        else
-            buf = start + off;
-    }
-
-    if (buf && (buf < start || buf > end_buf)) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Tag referencing position outside the image\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    switch (tag) {
-    case TIFF_WIDTH:
-        s->width = value;
-        break;
-    case TIFF_HEIGHT:
-        s->height = value;
-        break;
-    case TIFF_BPP:
-        s->bppcount = count;
-        if (count > 4) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "This format is not supported (bpp=%d, %d components)\n",
-                   s->bpp, count);
-            return AVERROR_INVALIDDATA;
-        }
-        if (count == 1)
-            s->bpp = value;
-        else {
-            switch (type) {
-            case TIFF_BYTE:
-                s->bpp = (off & 0xFF) + ((off >> 8) & 0xFF) +
-                         ((off >> 16) & 0xFF) + ((off >> 24) & 0xFF);
-                break;
-            case TIFF_SHORT:
-            case TIFF_LONG:
-                s->bpp = 0;
-                for (i = 0; i < count && buf < end_buf; i++)
-                    s->bpp += tget(&buf, type, s->le);
-                break;
-            default:
-                s->bpp = -1;
-            }
-        }
-        break;
-    case TIFF_SAMPLES_PER_PIXEL:
-        if (count != 1) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Samples per pixel requires a single value, many provided\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (s->bppcount == 1)
-            s->bpp *= value;
-        s->bppcount = value;
-        break;
-    case TIFF_COMPR:
-        s->compr     = value;
-        s->predictor = 0;
-        switch (s->compr) {
-        case TIFF_RAW:
-        case TIFF_PACKBITS:
-        case TIFF_LZW:
-        case TIFF_CCITT_RLE:
-            break;
-        case TIFF_G3:
-        case TIFF_G4:
-            s->fax_opts = 0;
-            break;
-        case TIFF_DEFLATE:
-        case TIFF_ADOBE_DEFLATE:
-#if CONFIG_ZLIB
-            break;
-#else
-            av_log(s->avctx, AV_LOG_ERROR, "Deflate: ZLib not compiled in\n");
-            return AVERROR(ENOSYS);
-#endif
-        case TIFF_JPEG:
-        case TIFF_NEWJPEG:
-            avpriv_report_missing_feature(s->avctx, "JPEG compression");
-            return AVERROR_PATCHWELCOME;
-        default:
-            av_log(s->avctx, AV_LOG_ERROR, "Unknown compression method %i\n",
-                   s->compr);
-            return AVERROR_INVALIDDATA;
-        }
-        break;
-    case TIFF_ROWSPERSTRIP:
-        if (type == TIFF_LONG && value == UINT_MAX)
-            value = s->avctx->height;
-        if (value < 1) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Incorrect value of rows per strip\n");
-            return AVERROR_INVALIDDATA;
-        }
-        s->rps = value;
-        break;
-    case TIFF_STRIP_OFFS:
-        if (count == 1) {
-            s->stripdata = NULL;
-            s->stripoff  = value;
-        } else
-            s->stripdata = start + off;
-        s->strips = count;
-        if (s->strips == 1)
-            s->rps = s->height;
-        s->sot = type;
-        if (s->stripdata > end_buf) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Tag referencing position outside the image\n");
-            return AVERROR_INVALIDDATA;
-        }
-        break;
-    case TIFF_STRIP_SIZE:
-        if (count == 1) {
-            s->stripsizes = NULL;
-            s->stripsize  = value;
-            s->strips     = 1;
-        } else {
-            s->stripsizes = start + off;
-        }
-        s->strips = count;
-        s->sstype = type;
-        if (s->stripsizes > end_buf) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Tag referencing position outside the image\n");
-            return AVERROR_INVALIDDATA;
-        }
-        break;
-    case TIFF_PREDICTOR:
-        s->predictor = value;
-        break;
-    case TIFF_INVERT:
-        switch (value) {
-        case 0:
-            s->invert = 1;
-            break;
-        case 1:
-            s->invert = 0;
-            break;
-        case 2:
-        case 3:
-            break;
-        default:
-            av_log(s->avctx, AV_LOG_ERROR, "Color mode %d is not supported\n",
-                   value);
-            return AVERROR_INVALIDDATA;
-        }
-        break;
-    case TIFF_FILL_ORDER:
-        if (value < 1 || value > 2) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Unknown FillOrder value %d, trying default one\n", value);
-            value = 1;
-        }
-        s->fill_order = value - 1;
-        break;
-    case TIFF_PAL:
-        pal = (uint32_t *) s->palette;
-        off = type_sizes[type];
-        if (count / 3 > 256 || end_buf - buf < count / 3 * off * 3)
-            return AVERROR_INVALIDDATA;
-        rp  = buf;
-        gp  = buf + count / 3 * off;
-        bp  = buf + count / 3 * off * 2;
-        off = (type_sizes[type] - 1) << 3;
-        for (i = 0; i < count / 3; i++) {
-            j      = (tget(&rp, type, s->le) >> off) << 16;
-            j     |= (tget(&gp, type, s->le) >> off) << 8;
-            j     |= tget(&bp, type, s->le) >> off;
-            pal[i] = j;
-        }
-        s->palette_is_set = 1;
-        break;
-    case TIFF_PLANAR:
-        if (value == 2) {
-            avpriv_report_missing_feature(s->avctx, "Planar format");
-            return AVERROR_PATCHWELCOME;
-        }
-        break;
-    case TIFF_T4OPTIONS:
-        if (s->compr == TIFF_G3)
-            s->fax_opts = value;
-        break;
-    case TIFF_T6OPTIONS:
-        if (s->compr == TIFF_G4)
-            s->fax_opts = value;
-        break;
-    default:
-        if (s->avctx->err_recognition & AV_EF_EXPLODE) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Unknown or unsupported tag %d/0X%0X\n",
-                   tag, tag);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    TiffContext *const s = avctx->priv_data;
-    AVFrame *const p = data;
-    const uint8_t *orig_buf = buf, *end_buf = buf + buf_size;
-    unsigned off;
-    int id, le, ret;
-    int i, j, entries, stride;
-    unsigned soff, ssize;
-    uint8_t *dst;
-
-    // parse image header
-    if (end_buf - buf < 8)
-        return AVERROR_INVALIDDATA;
-    id   = AV_RL16(buf);
-    buf += 2;
-    if (id == 0x4949)
-        le = 1;
-    else if (id == 0x4D4D)
-        le = 0;
-    else {
-        av_log(avctx, AV_LOG_ERROR, "TIFF header not found\n");
-        return AVERROR_INVALIDDATA;
-    }
-    s->le         = le;
-    s->invert     = 0;
-    s->compr      = TIFF_RAW;
-    s->fill_order = 0;
-    // As TIFF 6.0 specification puts it "An arbitrary but carefully chosen number
-    // that further identifies the file as a TIFF file"
-    if (tget_short(&buf, le) != 42) {
-        av_log(avctx, AV_LOG_ERROR,
-               "The answer to life, universe and everything is not correct!\n");
-        return AVERROR_INVALIDDATA;
-    }
-    // Reset these pointers so we can tell if they were set this frame
-    s->stripsizes = s->stripdata = NULL;
-    /* parse image file directory */
-    off = tget_long(&buf, le);
-    if (off >= UINT_MAX - 14 || end_buf - orig_buf < off + 14) {
-        av_log(avctx, AV_LOG_ERROR, "IFD offset is greater than image size\n");
-        return AVERROR_INVALIDDATA;
-    }
-    buf     = orig_buf + off;
-    entries = tget_short(&buf, le);
-    for (i = 0; i < entries; i++) {
-        if ((ret = tiff_decode_tag(s, orig_buf, buf, end_buf)) < 0)
-            return ret;
-        buf += 12;
-    }
-    if (!s->stripdata && !s->stripoff) {
-        av_log(avctx, AV_LOG_ERROR, "Image data is missing\n");
-        return AVERROR_INVALIDDATA;
-    }
-    /* now we have the data and may start decoding */
-    if ((ret = init_image(s, p)) < 0)
-        return ret;
-
-    if (s->strips == 1 && !s->stripsize) {
-        av_log(avctx, AV_LOG_WARNING, "Image data size missing\n");
-        s->stripsize = buf_size - s->stripoff;
-    }
-    stride = p->linesize[0];
-    dst    = p->data[0];
-    for (i = 0; i < s->height; i += s->rps) {
-        if (s->stripsizes) {
-            if (s->stripsizes >= end_buf)
-                return AVERROR_INVALIDDATA;
-            ssize = tget(&s->stripsizes, s->sstype, s->le);
-        } else
-            ssize = s->stripsize;
-
-        if (s->stripdata) {
-            if (s->stripdata >= end_buf)
-                return AVERROR_INVALIDDATA;
-            soff = tget(&s->stripdata, s->sot, s->le);
-        } else
-            soff = s->stripoff;
-
-        if (soff > buf_size || ssize > buf_size - soff) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid strip size/offset\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if ((ret = tiff_unpack_strip(s, dst, stride, orig_buf + soff, ssize,
-                                     FFMIN(s->rps, s->height - i))) < 0) {
-            if (avctx->err_recognition & AV_EF_EXPLODE)
-                return ret;
-            break;
-        }
-        dst += s->rps * stride;
-    }
-    if (s->predictor == 2) {
-        dst   = p->data[0];
-        soff  = s->bpp >> 3;
-        ssize = s->width * soff;
-        for (i = 0; i < s->height; i++) {
-            for (j = soff; j < ssize; j++)
-                dst[j] += dst[j - soff];
-            dst += stride;
-        }
-    }
-
-    if (s->invert) {
-        uint8_t *src;
-        int j;
-
-        src = p->data[0];
-        for (j = 0; j < s->height; j++) {
-            for (i = 0; i < p->linesize[0]; i++)
-                src[i] = 255 - src[i];
-            src += p->linesize[0];
-        }
-    }
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int tiff_init(AVCodecContext *avctx)
-{
-    TiffContext *s = avctx->priv_data;
-
-    s->width  = 0;
-    s->height = 0;
-    s->avctx  = avctx;
-    ff_lzw_decode_open(&s->lzw);
-    ff_ccitt_unpack_init();
-
-    return 0;
-}
-
-static av_cold int tiff_end(AVCodecContext *avctx)
-{
-    TiffContext *const s = avctx->priv_data;
-
-    ff_lzw_decode_close(&s->lzw);
-    return 0;
-}
-
-AVCodec ff_tiff_decoder = {
-    .name           = "tiff",
-    .long_name      = NULL_IF_CONFIG_SMALL("TIFF image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TIFF,
-    .priv_data_size = sizeof(TiffContext),
-    .init           = tiff_init,
-    .close          = tiff_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/tiff.h b/deps/libav/libavcodec/tiff.h
deleted file mode 100644
index 9052d2f..0000000
--- a/deps/libav/libavcodec/tiff.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * TIFF tables
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * TIFF tables
- * @author Konstantin Shishkov
- */
-
-#ifndef AVCODEC_TIFF_H
-#define AVCODEC_TIFF_H
-
-#include <stdint.h>
-
-/** abridged list of TIFF tags */
-enum TiffTags {
-    TIFF_SUBFILE            = 0xfe,
-    TIFF_WIDTH              = 0x100,
-    TIFF_HEIGHT,
-    TIFF_BPP,
-    TIFF_COMPR,
-    TIFF_INVERT             = 0x106,
-    TIFF_FILL_ORDER         = 0x10A,
-    TIFF_STRIP_OFFS         = 0x111,
-    TIFF_SAMPLES_PER_PIXEL  = 0x115,
-    TIFF_ROWSPERSTRIP       = 0x116,
-    TIFF_STRIP_SIZE,
-    TIFF_XRES               = 0x11A,
-    TIFF_YRES               = 0x11B,
-    TIFF_PLANAR             = 0x11C,
-    TIFF_XPOS               = 0x11E,
-    TIFF_YPOS               = 0x11F,
-    TIFF_T4OPTIONS          = 0x124,
-    TIFF_T6OPTIONS,
-    TIFF_RES_UNIT           = 0x128,
-    TIFF_SOFTWARE_NAME      = 0x131,
-    TIFF_PREDICTOR          = 0x13D,
-    TIFF_PAL                = 0x140,
-    TIFF_YCBCR_COEFFICIENTS = 0x211,
-    TIFF_YCBCR_SUBSAMPLING  = 0x212,
-    TIFF_YCBCR_POSITIONING  = 0x213,
-    TIFF_REFERENCE_BW       = 0x214,
-};
-
-/** list of TIFF compression types */
-enum TiffCompr {
-    TIFF_RAW = 1,
-    TIFF_CCITT_RLE,
-    TIFF_G3,
-    TIFF_G4,
-    TIFF_LZW,
-    TIFF_JPEG,
-    TIFF_NEWJPEG,
-    TIFF_ADOBE_DEFLATE,
-    TIFF_PACKBITS = 0x8005,
-    TIFF_DEFLATE  = 0x80B2
-};
-
-enum TiffTypes {
-    TIFF_BYTE = 1,
-    TIFF_STRING,
-    TIFF_SHORT,
-    TIFF_LONG,
-    TIFF_RATIONAL,
-};
-
-/** sizes of various TIFF field types (string size = 100)*/
-static const uint8_t type_sizes[6] = {
-    0, 1, 100, 2, 4, 8
-};
-
-#endif /* AVCODEC_TIFF_H */
diff --git a/deps/libav/libavcodec/tiffenc.c b/deps/libav/libavcodec/tiffenc.c
deleted file mode 100644
index 4cbc517..0000000
--- a/deps/libav/libavcodec/tiffenc.c
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- * TIFF image encoder
- * Copyright (c) 2007 Bartlomiej Wolowiec
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * TIFF image encoder
- * @author Bartlomiej Wolowiec
- */
-
-#include "config.h"
-#if CONFIG_ZLIB
-#include <zlib.h>
-#endif
-
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "lzw.h"
-#include "put_bits.h"
-#include "rle.h"
-#include "tiff.h"
-
-#define TIFF_MAX_ENTRY 32
-
-/** sizes of various TIFF field types (string size = 1)*/
-static const uint8_t type_sizes2[6] = {
-    0, 1, 1, 2, 4, 8
-};
-
-typedef struct TiffEncoderContext {
-    AVClass *class;                         ///< for private options
-    AVCodecContext *avctx;
-
-    int width;                              ///< picture width
-    int height;                             ///< picture height
-    unsigned int bpp;                       ///< bits per pixel
-    int compr;                              ///< compression level
-    int bpp_tab_size;                       ///< bpp_tab size
-    int photometric_interpretation;         ///< photometric interpretation
-    int strips;                             ///< number of strips
-    int rps;                                ///< row per strip
-    uint8_t entries[TIFF_MAX_ENTRY * 12];   ///< entries in header
-    int num_entries;                        ///< number of entries
-    uint8_t **buf;                          ///< actual position in buffer
-    uint8_t *buf_start;                     ///< pointer to first byte in buffer
-    int buf_size;                           ///< buffer size
-    uint16_t subsampling[2];                ///< YUV subsampling factors
-    struct LZWEncodeState *lzws;            ///< LZW encode state
-} TiffEncoderContext;
-
-/**
- * Check free space in buffer
- * @param s Tiff context
- * @param need Needed bytes
- * @return 0 - ok, 1 - no free space
- */
-static inline int check_size(TiffEncoderContext *s, uint64_t need)
-{
-    if (s->buf_size < *s->buf - s->buf_start + need) {
-        *s->buf = s->buf_start + s->buf_size + 1;
-        av_log(s->avctx, AV_LOG_ERROR, "Buffer is too small\n");
-        return 1;
-    }
-    return 0;
-}
-
-/**
- * Put n values to buffer
- *
- * @param p Pointer to pointer to output buffer
- * @param n Number of values
- * @param val Pointer to values
- * @param type Type of values
- * @param flip =0 - normal copy, >0 - flip
- */
-static void tnput(uint8_t **p, int n, const uint8_t *val, enum TiffTypes type,
-                  int flip)
-{
-    int i;
-#if HAVE_BIGENDIAN
-    flip ^= ((int[]) { 0, 0, 0, 1, 3, 3 })[type];
-#endif
-    for (i = 0; i < n * type_sizes2[type]; i++)
-        *(*p)++ = val[i ^ flip];
-}
-
-/**
- * Add entry to directory in tiff header.
- * @param s Tiff context
- * @param tag Tag that identifies the entry
- * @param type Entry type
- * @param count The number of values
- * @param ptr_val Pointer to values
- */
-static void add_entry(TiffEncoderContext *s, enum TiffTags tag,
-                      enum TiffTypes type, int count, const void *ptr_val)
-{
-    uint8_t *entries_ptr = s->entries + 12 * s->num_entries;
-
-    assert(s->num_entries < TIFF_MAX_ENTRY);
-
-    bytestream_put_le16(&entries_ptr, tag);
-    bytestream_put_le16(&entries_ptr, type);
-    bytestream_put_le32(&entries_ptr, count);
-
-    if (type_sizes[type] * count <= 4) {
-        tnput(&entries_ptr, count, ptr_val, type, 0);
-    } else {
-        bytestream_put_le32(&entries_ptr, *s->buf - s->buf_start);
-        check_size(s, count * type_sizes2[type]);
-        tnput(s->buf, count, ptr_val, type, 0);
-    }
-
-    s->num_entries++;
-}
-
-static void add_entry1(TiffEncoderContext *s,
-                       enum TiffTags tag, enum TiffTypes type, int val)
-{
-    uint16_t w  = val;
-    uint32_t dw = val;
-    add_entry(s, tag, type, 1, type == TIFF_SHORT ? (void *)&w : (void *)&dw);
-}
-
-/**
- * Encode one strip in tiff file
- *
- * @param s Tiff context
- * @param src Input buffer
- * @param dst Output buffer
- * @param n Size of input buffer
- * @param compr Compression method
- * @return Number of output bytes. If an output error is encountered, -1 returned
- */
-static int encode_strip(TiffEncoderContext *s, const int8_t *src,
-                        uint8_t *dst, int n, int compr)
-{
-    switch (compr) {
-#if CONFIG_ZLIB
-    case TIFF_DEFLATE:
-    case TIFF_ADOBE_DEFLATE:
-    {
-        unsigned long zlen = s->buf_size - (*s->buf - s->buf_start);
-        if (compress(dst, &zlen, src, n) != Z_OK) {
-            av_log(s->avctx, AV_LOG_ERROR, "Compressing failed\n");
-            return -1;
-        }
-        return zlen;
-    }
-#endif
-    case TIFF_RAW:
-        if (check_size(s, n))
-            return -1;
-        memcpy(dst, src, n);
-        return n;
-    case TIFF_PACKBITS:
-        return ff_rle_encode(dst, s->buf_size - (*s->buf - s->buf_start),
-                             src, 1, n, 2, 0xff, -1, 0);
-    case TIFF_LZW:
-        return ff_lzw_encode(s->lzws, src, n);
-    default:
-        return -1;
-    }
-}
-
-static void pack_yuv(TiffEncoderContext *s, const AVFrame *p,
-                     uint8_t *dst, int lnum)
-{
-    int i, j, k;
-    int w       = (s->width - 1) / s->subsampling[0] + 1;
-    uint8_t *pu = &p->data[1][lnum / s->subsampling[1] * p->linesize[1]];
-    uint8_t *pv = &p->data[2][lnum / s->subsampling[1] * p->linesize[2]];
-    for (i = 0; i < w; i++) {
-        for (j = 0; j < s->subsampling[1]; j++)
-            for (k = 0; k < s->subsampling[0]; k++)
-                *dst++ = p->data[0][(lnum + j) * p->linesize[0] +
-                                    i * s->subsampling[0] + k];
-        *dst++ = *pu++;
-        *dst++ = *pv++;
-    }
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *pict, int *got_packet)
-{
-    TiffEncoderContext *s = avctx->priv_data;
-    const AVFrame *const p = pict;
-    int i;
-    uint8_t *ptr;
-    uint8_t *offset;
-    uint32_t strips;
-    uint32_t *strip_sizes   = NULL;
-    uint32_t *strip_offsets = NULL;
-    int bytes_per_row;
-    uint32_t res[2]    = { 72, 1 };     // image resolution (72/1)
-    uint16_t bpp_tab[] = { 8, 8, 8, 8 };
-    int ret;
-    int is_yuv = 0;
-    uint8_t *yuv_line = NULL;
-    int shift_h, shift_v;
-    const AVPixFmtDescriptor *pfd;
-
-    s->avctx = avctx;
-
-    s->width          = avctx->width;
-    s->height         = avctx->height;
-    s->subsampling[0] = 1;
-    s->subsampling[1] = 1;
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB48LE:
-    case AV_PIX_FMT_GRAY16LE:
-    case AV_PIX_FMT_RGB24:
-    case AV_PIX_FMT_GRAY8:
-    case AV_PIX_FMT_PAL8:
-        pfd    = av_pix_fmt_desc_get(avctx->pix_fmt);
-        s->bpp = av_get_bits_per_pixel(pfd);
-        if (pfd->flags & AV_PIX_FMT_FLAG_PAL)
-            s->photometric_interpretation = 3;
-        else if (pfd->flags & AV_PIX_FMT_FLAG_RGB)
-            s->photometric_interpretation = 2;
-        else
-            s->photometric_interpretation = 1;
-        s->bpp_tab_size = pfd->nb_components;
-        for (i = 0; i < s->bpp_tab_size; i++)
-            bpp_tab[i] = s->bpp / s->bpp_tab_size;
-        break;
-    case AV_PIX_FMT_MONOBLACK:
-        s->bpp                        = 1;
-        s->photometric_interpretation = 1;
-        s->bpp_tab_size               = 0;
-        break;
-    case AV_PIX_FMT_MONOWHITE:
-        s->bpp                        = 1;
-        s->photometric_interpretation = 0;
-        s->bpp_tab_size               = 0;
-        break;
-    case AV_PIX_FMT_YUV420P:
-    case AV_PIX_FMT_YUV422P:
-    case AV_PIX_FMT_YUV444P:
-    case AV_PIX_FMT_YUV410P:
-    case AV_PIX_FMT_YUV411P:
-        av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &shift_h, &shift_v);
-        s->photometric_interpretation = 6;
-        s->bpp                        = 8 + (16 >> (shift_h + shift_v));
-        s->subsampling[0]             = 1 << shift_h;
-        s->subsampling[1]             = 1 << shift_v;
-        s->bpp_tab_size               = 3;
-        is_yuv                        = 1;
-        break;
-    default:
-        av_log(s->avctx, AV_LOG_ERROR,
-               "This colors format is not supported\n");
-        return -1;
-    }
-
-    if (s->compr == TIFF_DEFLATE       ||
-        s->compr == TIFF_ADOBE_DEFLATE ||
-        s->compr == TIFF_LZW)
-        // best choice for DEFLATE
-        s->rps = s->height;
-    else
-        // suggest size of strip
-        s->rps = FFMAX(8192 / (((s->width * s->bpp) >> 3) + 1), 1);
-    // round rps up
-    s->rps = ((s->rps - 1) / s->subsampling[1] + 1) * s->subsampling[1];
-
-    strips = (s->height - 1) / s->rps + 1;
-
-    if (!pkt->data &&
-        (ret = av_new_packet(pkt,
-                             avctx->width * avctx->height * s->bpp * 2 +
-                             avctx->height * 4 + FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-    ptr          = pkt->data;
-    s->buf_start = pkt->data;
-    s->buf       = &ptr;
-    s->buf_size  = pkt->size;
-
-    if (check_size(s, 8))
-        goto fail;
-
-    // write header
-    bytestream_put_le16(&ptr, 0x4949);
-    bytestream_put_le16(&ptr, 42);
-
-    offset = ptr;
-    bytestream_put_le32(&ptr, 0);
-
-    strip_sizes   = av_mallocz(sizeof(*strip_sizes)   * strips);
-    strip_offsets = av_mallocz(sizeof(*strip_offsets) * strips);
-    if (!strip_sizes || !strip_offsets) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    bytes_per_row = (((s->width - 1) / s->subsampling[0] + 1) * s->bpp *
-                     s->subsampling[0] * s->subsampling[1] + 7) >> 3;
-    if (is_yuv) {
-        yuv_line = av_malloc(bytes_per_row);
-        if (yuv_line == NULL) {
-            av_log(s->avctx, AV_LOG_ERROR, "Not enough memory\n");
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-    }
-
-#if CONFIG_ZLIB
-    if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE) {
-        uint8_t *zbuf;
-        int zlen, zn;
-        int j;
-
-        zlen = bytes_per_row * s->rps;
-        zbuf = av_malloc(zlen);
-        if (!zbuf) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        strip_offsets[0] = ptr - pkt->data;
-        zn               = 0;
-        for (j = 0; j < s->rps; j++) {
-            if (is_yuv) {
-                pack_yuv(s, p, yuv_line, j);
-                memcpy(zbuf + zn, yuv_line, bytes_per_row);
-                j += s->subsampling[1] - 1;
-            } else
-                memcpy(zbuf + j * bytes_per_row,
-                       p->data[0] + j * p->linesize[0], bytes_per_row);
-            zn += bytes_per_row;
-        }
-        ret = encode_strip(s, zbuf, ptr, zn, s->compr);
-        av_free(zbuf);
-        if (ret < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "Encode strip failed\n");
-            goto fail;
-        }
-        ptr           += ret;
-        strip_sizes[0] = ptr - pkt->data - strip_offsets[0];
-    } else
-#endif
-    if (s->compr == TIFF_LZW) {
-        s->lzws = av_malloc(ff_lzw_encode_state_size);
-        if (!s->lzws) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-    }
-    for (i = 0; i < s->height; i++) {
-        if (strip_sizes[i / s->rps] == 0) {
-            if (s->compr == TIFF_LZW) {
-                ff_lzw_encode_init(s->lzws, ptr,
-                                   s->buf_size - (*s->buf - s->buf_start),
-                                   12, FF_LZW_TIFF, put_bits);
-            }
-            strip_offsets[i / s->rps] = ptr - pkt->data;
-        }
-        if (is_yuv) {
-            pack_yuv(s, p, yuv_line, i);
-            ret = encode_strip(s, yuv_line, ptr, bytes_per_row, s->compr);
-            i  += s->subsampling[1] - 1;
-        } else
-            ret = encode_strip(s, p->data[0] + i * p->linesize[0],
-                               ptr, bytes_per_row, s->compr);
-        if (ret < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "Encode strip failed\n");
-            goto fail;
-        }
-        strip_sizes[i / s->rps] += ret;
-        ptr                     += ret;
-        if (s->compr == TIFF_LZW &&
-            (i == s->height - 1 || i % s->rps == s->rps - 1)) {
-            ret = ff_lzw_encode_flush(s->lzws, flush_put_bits);
-            strip_sizes[(i / s->rps)] += ret;
-            ptr                       += ret;
-        }
-    }
-    if (s->compr == TIFF_LZW)
-        av_free(s->lzws);
-
-    s->num_entries = 0;
-
-    add_entry1(s, TIFF_SUBFILE, TIFF_LONG, 0);
-    add_entry1(s, TIFF_WIDTH,   TIFF_LONG, s->width);
-    add_entry1(s, TIFF_HEIGHT,  TIFF_LONG, s->height);
-
-    if (s->bpp_tab_size)
-        add_entry(s, TIFF_BPP, TIFF_SHORT, s->bpp_tab_size, bpp_tab);
-
-    add_entry1(s, TIFF_COMPR,      TIFF_SHORT, s->compr);
-    add_entry1(s, TIFF_INVERT,     TIFF_SHORT, s->photometric_interpretation);
-    add_entry(s,  TIFF_STRIP_OFFS, TIFF_LONG,  strips, strip_offsets);
-
-    if (s->bpp_tab_size)
-        add_entry1(s, TIFF_SAMPLES_PER_PIXEL, TIFF_SHORT, s->bpp_tab_size);
-
-    add_entry1(s, TIFF_ROWSPERSTRIP, TIFF_LONG,     s->rps);
-    add_entry(s,  TIFF_STRIP_SIZE,   TIFF_LONG,     strips, strip_sizes);
-    add_entry(s,  TIFF_XRES,         TIFF_RATIONAL, 1,      res);
-    add_entry(s,  TIFF_YRES,         TIFF_RATIONAL, 1,      res);
-    add_entry1(s, TIFF_RES_UNIT,     TIFF_SHORT,    2);
-
-    if (!(avctx->flags & CODEC_FLAG_BITEXACT))
-        add_entry(s, TIFF_SOFTWARE_NAME, TIFF_STRING,
-                  strlen(LIBAVCODEC_IDENT) + 1, LIBAVCODEC_IDENT);
-
-    if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
-        uint16_t pal[256 * 3];
-        for (i = 0; i < 256; i++) {
-            uint32_t rgb = *(uint32_t *) (p->data[1] + i * 4);
-            pal[i]       = ((rgb >> 16) & 0xff) * 257;
-            pal[i + 256] = ((rgb >>  8) & 0xff) * 257;
-            pal[i + 512] =  (rgb        & 0xff) * 257;
-        }
-        add_entry(s, TIFF_PAL, TIFF_SHORT, 256 * 3, pal);
-    }
-    if (is_yuv) {
-        /** according to CCIR Recommendation 601.1 */
-        uint32_t refbw[12] = { 15, 1, 235, 1, 128, 1, 240, 1, 128, 1, 240, 1 };
-        add_entry(s, TIFF_YCBCR_SUBSAMPLING, TIFF_SHORT,    2, s->subsampling);
-        add_entry(s, TIFF_REFERENCE_BW,      TIFF_RATIONAL, 6, refbw);
-    }
-    // write offset to dir
-    bytestream_put_le32(&offset, ptr - pkt->data);
-
-    if (check_size(s, 6 + s->num_entries * 12)) {
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-    bytestream_put_le16(&ptr, s->num_entries);  // write tag count
-    bytestream_put_buffer(&ptr, s->entries, s->num_entries * 12);
-    bytestream_put_le32(&ptr, 0);
-
-    pkt->size   = ptr - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-
-fail:
-    av_free(strip_sizes);
-    av_free(strip_offsets);
-    av_free(yuv_line);
-    return ret;
-}
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-    avctx->coded_frame->key_frame = 1;
-
-    return 0;
-}
-
-static av_cold int encode_close(AVCodecContext *avctx)
-{
-    av_frame_free(&avctx->coded_frame);
-    return 0;
-}
-
-#define OFFSET(x) offsetof(TiffEncoderContext, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "compression_algo", NULL, OFFSET(compr), AV_OPT_TYPE_INT,   { .i64 = TIFF_PACKBITS }, TIFF_RAW, TIFF_DEFLATE, VE, "compression_algo" },
-    { "packbits",         NULL, 0,             AV_OPT_TYPE_CONST, { .i64 = TIFF_PACKBITS }, 0,        0,            VE, "compression_algo" },
-    { "raw",              NULL, 0,             AV_OPT_TYPE_CONST, { .i64 = TIFF_RAW      }, 0,        0,            VE, "compression_algo" },
-    { "lzw",              NULL, 0,             AV_OPT_TYPE_CONST, { .i64 = TIFF_LZW      }, 0,        0,            VE, "compression_algo" },
-#if CONFIG_ZLIB
-    { "deflate",          NULL, 0,             AV_OPT_TYPE_CONST, { .i64 = TIFF_DEFLATE  }, 0,        0,            VE, "compression_algo" },
-#endif
-    { NULL },
-};
-
-static const AVClass tiffenc_class = {
-    .class_name = "TIFF encoder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_tiff_encoder = {
-    .name           = "tiff",
-    .long_name      = NULL_IF_CONFIG_SMALL("TIFF image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TIFF,
-    .priv_data_size = sizeof(TiffEncoderContext),
-    .init           = encode_init,
-    .close          = encode_close,
-    .encode2        = encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]) {
-        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_PAL8,
-        AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16LE,
-        AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_MONOWHITE,
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
-        AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_NONE
-    },
-    .priv_class     = &tiffenc_class,
-};
diff --git a/deps/libav/libavcodec/tmv.c b/deps/libav/libavcodec/tmv.c
deleted file mode 100644
index f04a5f5..0000000
--- a/deps/libav/libavcodec/tmv.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 8088flex TMV video decoder
- * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * 8088flex TMV video decoder
- * @author Daniel Verkamp
- * @see http://www.oldskool.org/pc/8088_Corruption
- */
-
-#include <string.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/internal.h"
-
-#include "cga_data.h"
-
-static int tmv_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *src = avpkt->data;
-    uint8_t *dst;
-    unsigned char_cols = avctx->width >> 3;
-    unsigned char_rows = avctx->height >> 3;
-    unsigned x, y, fg, bg, c;
-    int ret;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (avpkt->size < 2*char_rows*char_cols) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Input buffer too small, truncated sample?\n");
-        *got_frame = 0;
-        return AVERROR_INVALIDDATA;
-    }
-
-    frame->pict_type = AV_PICTURE_TYPE_I;
-    frame->key_frame = 1;
-    dst              = frame->data[0];
-
-    frame->palette_has_changed = 1;
-    memcpy(frame->data[1], ff_cga_palette, 16 * 4);
-
-    for (y = 0; y < char_rows; y++) {
-        for (x = 0; x < char_cols; x++) {
-            c  = *src++;
-            bg = *src  >> 4;
-            fg = *src++ & 0xF;
-            ff_draw_pc_font(dst + x * 8, frame->linesize[0],
-                            ff_cga_font, 8, c, fg, bg);
-        }
-        dst += frame->linesize[0] * 8;
-    }
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int tmv_decode_init(AVCodecContext *avctx)
-{
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-    return 0;
-}
-
-AVCodec ff_tmv_decoder = {
-    .name           = "tmv",
-    .long_name      = NULL_IF_CONFIG_SMALL("8088flex TMV"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TMV,
-    .init           = tmv_decode_init,
-    .decode         = tmv_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/truemotion1.c b/deps/libav/libavcodec/truemotion1.c
deleted file mode 100644
index 270a030..0000000
--- a/deps/libav/libavcodec/truemotion1.c
+++ /dev/null
@@ -1,912 +0,0 @@
-/*
- * Duck TrueMotion 1.0 Decoder
- * Copyright (C) 2003 Alex Beregszaszi & Mike Melanson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Duck TrueMotion v1 Video Decoder by
- * Alex Beregszaszi and
- * Mike Melanson (melanson at pcisys.net)
- *
- * The TrueMotion v1 decoder presently only decodes 16-bit TM1 data and
- * outputs RGB555 (or RGB565) data. 24-bit TM1 data is not supported yet.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mem.h"
-
-#include "truemotion1data.h"
-
-typedef struct TrueMotion1Context {
-    AVCodecContext *avctx;
-    AVFrame *frame;
-
-    const uint8_t *buf;
-    int size;
-
-    const uint8_t *mb_change_bits;
-    int mb_change_bits_row_size;
-    const uint8_t *index_stream;
-    int index_stream_size;
-
-    int flags;
-    int x, y, w, h;
-
-    uint32_t y_predictor_table[1024];
-    uint32_t c_predictor_table[1024];
-    uint32_t fat_y_predictor_table[1024];
-    uint32_t fat_c_predictor_table[1024];
-
-    int compression;
-    int block_type;
-    int block_width;
-    int block_height;
-
-    int16_t ydt[8];
-    int16_t cdt[8];
-    int16_t fat_ydt[8];
-    int16_t fat_cdt[8];
-
-    int last_deltaset, last_vectable;
-
-    unsigned int *vert_pred;
-    int vert_pred_size;
-
-} TrueMotion1Context;
-
-#define FLAG_SPRITE         32
-#define FLAG_KEYFRAME       16
-#define FLAG_INTERFRAME      8
-#define FLAG_INTERPOLATED    4
-
-struct frame_header {
-    uint8_t header_size;
-    uint8_t compression;
-    uint8_t deltaset;
-    uint8_t vectable;
-    uint16_t ysize;
-    uint16_t xsize;
-    uint16_t checksum;
-    uint8_t version;
-    uint8_t header_type;
-    uint8_t flags;
-    uint8_t control;
-    uint16_t xoffset;
-    uint16_t yoffset;
-    uint16_t width;
-    uint16_t height;
-};
-
-#define ALGO_NOP        0
-#define ALGO_RGB16V     1
-#define ALGO_RGB16H     2
-#define ALGO_RGB24H     3
-
-/* these are the various block sizes that can occupy a 4x4 block */
-#define BLOCK_2x2  0
-#define BLOCK_2x4  1
-#define BLOCK_4x2  2
-#define BLOCK_4x4  3
-
-typedef struct comp_types {
-    int algorithm;
-    int block_width; // vres
-    int block_height; // hres
-    int block_type;
-} comp_types;
-
-/* { valid for metatype }, algorithm, num of deltas, vert res, horiz res */
-static const comp_types compression_types[17] = {
-    { ALGO_NOP,    0, 0, 0 },
-
-    { ALGO_RGB16V, 4, 4, BLOCK_4x4 },
-    { ALGO_RGB16H, 4, 4, BLOCK_4x4 },
-    { ALGO_RGB16V, 4, 2, BLOCK_4x2 },
-    { ALGO_RGB16H, 4, 2, BLOCK_4x2 },
-
-    { ALGO_RGB16V, 2, 4, BLOCK_2x4 },
-    { ALGO_RGB16H, 2, 4, BLOCK_2x4 },
-    { ALGO_RGB16V, 2, 2, BLOCK_2x2 },
-    { ALGO_RGB16H, 2, 2, BLOCK_2x2 },
-
-    { ALGO_NOP,    4, 4, BLOCK_4x4 },
-    { ALGO_RGB24H, 4, 4, BLOCK_4x4 },
-    { ALGO_NOP,    4, 2, BLOCK_4x2 },
-    { ALGO_RGB24H, 4, 2, BLOCK_4x2 },
-
-    { ALGO_NOP,    2, 4, BLOCK_2x4 },
-    { ALGO_RGB24H, 2, 4, BLOCK_2x4 },
-    { ALGO_NOP,    2, 2, BLOCK_2x2 },
-    { ALGO_RGB24H, 2, 2, BLOCK_2x2 }
-};
-
-static void select_delta_tables(TrueMotion1Context *s, int delta_table_index)
-{
-    int i;
-
-    if (delta_table_index > 3)
-        return;
-
-    memcpy(s->ydt, ydts[delta_table_index], 8 * sizeof(int16_t));
-    memcpy(s->cdt, cdts[delta_table_index], 8 * sizeof(int16_t));
-    memcpy(s->fat_ydt, fat_ydts[delta_table_index], 8 * sizeof(int16_t));
-    memcpy(s->fat_cdt, fat_cdts[delta_table_index], 8 * sizeof(int16_t));
-
-    /* Y skinny deltas need to be halved for some reason; maybe the
-     * skinny Y deltas should be modified */
-    for (i = 0; i < 8; i++)
-    {
-        /* drop the lsb before dividing by 2-- net effect: round down
-         * when dividing a negative number (e.g., -3/2 = -2, not -1) */
-        s->ydt[i] &= 0xFFFE;
-        s->ydt[i] /= 2;
-    }
-}
-
-#if HAVE_BIGENDIAN
-static int make_ydt15_entry(int p2, int p1, int16_t *ydt)
-#else
-static int make_ydt15_entry(int p1, int p2, int16_t *ydt)
-#endif
-{
-    int lo, hi;
-
-    lo = ydt[p1];
-    lo += (lo << 5) + (lo << 10);
-    hi = ydt[p2];
-    hi += (hi << 5) + (hi << 10);
-    return (lo + (hi << 16)) << 1;
-}
-
-static int make_cdt15_entry(int p1, int p2, int16_t *cdt)
-{
-    int r, b, lo;
-
-    b = cdt[p2];
-    r = cdt[p1] << 10;
-    lo = b + r;
-    return (lo + (lo << 16)) << 1;
-}
-
-#if HAVE_BIGENDIAN
-static int make_ydt16_entry(int p2, int p1, int16_t *ydt)
-#else
-static int make_ydt16_entry(int p1, int p2, int16_t *ydt)
-#endif
-{
-    int lo, hi;
-
-    lo = ydt[p1];
-    lo += (lo << 6) + (lo << 11);
-    hi = ydt[p2];
-    hi += (hi << 6) + (hi << 11);
-    return (lo + (hi << 16)) << 1;
-}
-
-static int make_cdt16_entry(int p1, int p2, int16_t *cdt)
-{
-    int r, b, lo;
-
-    b = cdt[p2];
-    r = cdt[p1] << 11;
-    lo = b + r;
-    return (lo + (lo << 16)) << 1;
-}
-
-static int make_ydt24_entry(int p1, int p2, int16_t *ydt)
-{
-    int lo, hi;
-
-    lo = ydt[p1];
-    hi = ydt[p2];
-    return (lo + (hi << 8) + (hi << 16)) << 1;
-}
-
-static int make_cdt24_entry(int p1, int p2, int16_t *cdt)
-{
-    int r, b;
-
-    b = cdt[p2];
-    r = cdt[p1]<<16;
-    return (b+r) << 1;
-}
-
-static void gen_vector_table15(TrueMotion1Context *s, const uint8_t *sel_vector_table)
-{
-    int len, i, j;
-    unsigned char delta_pair;
-
-    for (i = 0; i < 1024; i += 4)
-    {
-        len = *sel_vector_table++ / 2;
-        for (j = 0; j < len; j++)
-        {
-            delta_pair = *sel_vector_table++;
-            s->y_predictor_table[i+j] = 0xfffffffe &
-                make_ydt15_entry(delta_pair >> 4, delta_pair & 0xf, s->ydt);
-            s->c_predictor_table[i+j] = 0xfffffffe &
-                make_cdt15_entry(delta_pair >> 4, delta_pair & 0xf, s->cdt);
-        }
-        s->y_predictor_table[i+(j-1)] |= 1;
-        s->c_predictor_table[i+(j-1)] |= 1;
-    }
-}
-
-static void gen_vector_table16(TrueMotion1Context *s, const uint8_t *sel_vector_table)
-{
-    int len, i, j;
-    unsigned char delta_pair;
-
-    for (i = 0; i < 1024; i += 4)
-    {
-        len = *sel_vector_table++ / 2;
-        for (j = 0; j < len; j++)
-        {
-            delta_pair = *sel_vector_table++;
-            s->y_predictor_table[i+j] = 0xfffffffe &
-                make_ydt16_entry(delta_pair >> 4, delta_pair & 0xf, s->ydt);
-            s->c_predictor_table[i+j] = 0xfffffffe &
-                make_cdt16_entry(delta_pair >> 4, delta_pair & 0xf, s->cdt);
-        }
-        s->y_predictor_table[i+(j-1)] |= 1;
-        s->c_predictor_table[i+(j-1)] |= 1;
-    }
-}
-
-static void gen_vector_table24(TrueMotion1Context *s, const uint8_t *sel_vector_table)
-{
-    int len, i, j;
-    unsigned char delta_pair;
-
-    for (i = 0; i < 1024; i += 4)
-    {
-        len = *sel_vector_table++ / 2;
-        for (j = 0; j < len; j++)
-        {
-            delta_pair = *sel_vector_table++;
-            s->y_predictor_table[i+j] = 0xfffffffe &
-                make_ydt24_entry(delta_pair >> 4, delta_pair & 0xf, s->ydt);
-            s->c_predictor_table[i+j] = 0xfffffffe &
-                make_cdt24_entry(delta_pair >> 4, delta_pair & 0xf, s->cdt);
-            s->fat_y_predictor_table[i+j] = 0xfffffffe &
-                make_ydt24_entry(delta_pair >> 4, delta_pair & 0xf, s->fat_ydt);
-            s->fat_c_predictor_table[i+j] = 0xfffffffe &
-                make_cdt24_entry(delta_pair >> 4, delta_pair & 0xf, s->fat_cdt);
-        }
-        s->y_predictor_table[i+(j-1)] |= 1;
-        s->c_predictor_table[i+(j-1)] |= 1;
-        s->fat_y_predictor_table[i+(j-1)] |= 1;
-        s->fat_c_predictor_table[i+(j-1)] |= 1;
-    }
-}
-
-/* Returns the number of bytes consumed from the bytestream. Returns -1 if
- * there was an error while decoding the header */
-static int truemotion1_decode_header(TrueMotion1Context *s)
-{
-    int i, ret;
-    int width_shift = 0;
-    int new_pix_fmt;
-    struct frame_header header;
-    uint8_t header_buffer[128] = { 0 };  /* logical maximum size of the header */
-    const uint8_t *sel_vector_table;
-
-    header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
-    if (s->buf[0] < 0x10)
-    {
-        av_log(s->avctx, AV_LOG_ERROR, "invalid header size (%d)\n", s->buf[0]);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (header.header_size + 1 > s->size) {
-        av_log(s->avctx, AV_LOG_ERROR, "Input packet too small.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* unscramble the header bytes with a XOR operation */
-    for (i = 1; i < header.header_size; i++)
-        header_buffer[i - 1] = s->buf[i] ^ s->buf[i + 1];
-
-    header.compression = header_buffer[0];
-    header.deltaset = header_buffer[1];
-    header.vectable = header_buffer[2];
-    header.ysize = AV_RL16(&header_buffer[3]);
-    header.xsize = AV_RL16(&header_buffer[5]);
-    header.checksum = AV_RL16(&header_buffer[7]);
-    header.version = header_buffer[9];
-    header.header_type = header_buffer[10];
-    header.flags = header_buffer[11];
-    header.control = header_buffer[12];
-
-    /* Version 2 */
-    if (header.version >= 2)
-    {
-        if (header.header_type > 3)
-        {
-            av_log(s->avctx, AV_LOG_ERROR, "invalid header type (%d)\n", header.header_type);
-            return AVERROR_INVALIDDATA;
-        } else if ((header.header_type == 2) || (header.header_type == 3)) {
-            s->flags = header.flags;
-            if (!(s->flags & FLAG_INTERFRAME))
-                s->flags |= FLAG_KEYFRAME;
-        } else
-            s->flags = FLAG_KEYFRAME;
-    } else /* Version 1 */
-        s->flags = FLAG_KEYFRAME;
-
-    if (s->flags & FLAG_SPRITE) {
-        avpriv_request_sample(s->avctx, "Frame with sprite");
-        /* FIXME header.width, height, xoffset and yoffset aren't initialized */
-        return AVERROR_PATCHWELCOME;
-    } else {
-        s->w = header.xsize;
-        s->h = header.ysize;
-        if (header.header_type < 2) {
-            if ((s->w < 213) && (s->h >= 176))
-            {
-                s->flags |= FLAG_INTERPOLATED;
-                avpriv_request_sample(s->avctx, "Interpolated frame");
-            }
-        }
-    }
-
-    if (header.compression >= 17) {
-        av_log(s->avctx, AV_LOG_ERROR, "invalid compression type (%d)\n", header.compression);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((header.deltaset != s->last_deltaset) ||
-        (header.vectable != s->last_vectable))
-        select_delta_tables(s, header.deltaset);
-
-    if ((header.compression & 1) && header.header_type)
-        sel_vector_table = pc_tbl2;
-    else {
-        if (header.vectable > 0 && header.vectable < 4)
-            sel_vector_table = tables[header.vectable - 1];
-        else {
-            av_log(s->avctx, AV_LOG_ERROR, "invalid vector table id (%d)\n", header.vectable);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    if (compression_types[header.compression].algorithm == ALGO_RGB24H) {
-        new_pix_fmt = AV_PIX_FMT_RGB32;
-        width_shift = 1;
-    } else
-        new_pix_fmt = AV_PIX_FMT_RGB555; // RGB565 is supported as well
-
-    s->w >>= width_shift;
-
-    if (s->w != s->avctx->width || s->h != s->avctx->height ||
-        new_pix_fmt != s->avctx->pix_fmt) {
-        av_frame_unref(s->frame);
-        s->avctx->sample_aspect_ratio = (AVRational){ 1 << width_shift, 1 };
-        s->avctx->pix_fmt = new_pix_fmt;
-
-        if ((ret = ff_set_dimensions(s->avctx, s->w, s->h)) < 0)
-            return ret;
-
-        av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned int));
-    }
-
-    /* There is 1 change bit per 4 pixels, so each change byte represents
-     * 32 pixels; divide width by 4 to obtain the number of change bits and
-     * then round up to the nearest byte. */
-    s->mb_change_bits_row_size = ((s->avctx->width >> (2 - width_shift)) + 7) >> 3;
-
-    if ((header.deltaset != s->last_deltaset) || (header.vectable != s->last_vectable))
-    {
-        if (compression_types[header.compression].algorithm == ALGO_RGB24H)
-            gen_vector_table24(s, sel_vector_table);
-        else
-        if (s->avctx->pix_fmt == AV_PIX_FMT_RGB555)
-            gen_vector_table15(s, sel_vector_table);
-        else
-            gen_vector_table16(s, sel_vector_table);
-    }
-
-    /* set up pointers to the other key data chunks */
-    s->mb_change_bits = s->buf + header.header_size;
-    if (s->flags & FLAG_KEYFRAME) {
-        /* no change bits specified for a keyframe; only index bytes */
-        s->index_stream = s->mb_change_bits;
-    } else {
-        /* one change bit per 4x4 block */
-        s->index_stream = s->mb_change_bits +
-            (s->mb_change_bits_row_size * (s->avctx->height >> 2));
-    }
-    s->index_stream_size = s->size - (s->index_stream - s->buf);
-
-    s->last_deltaset = header.deltaset;
-    s->last_vectable = header.vectable;
-    s->compression = header.compression;
-    s->block_width = compression_types[header.compression].block_width;
-    s->block_height = compression_types[header.compression].block_height;
-    s->block_type = compression_types[header.compression].block_type;
-
-    if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(s->avctx, AV_LOG_INFO, "tables: %d / %d c:%d %dx%d t:%d %s%s%s%s\n",
-            s->last_deltaset, s->last_vectable, s->compression, s->block_width,
-            s->block_height, s->block_type,
-            s->flags & FLAG_KEYFRAME ? " KEY" : "",
-            s->flags & FLAG_INTERFRAME ? " INTER" : "",
-            s->flags & FLAG_SPRITE ? " SPRITE" : "",
-            s->flags & FLAG_INTERPOLATED ? " INTERPOL" : "");
-
-    return header.header_size;
-}
-
-static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
-{
-    TrueMotion1Context *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    // FIXME: it may change ?
-//    if (avctx->bits_per_sample == 24)
-//        avctx->pix_fmt = AV_PIX_FMT_RGB24;
-//    else
-//        avctx->pix_fmt = AV_PIX_FMT_RGB555;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    /* there is a vertical predictor for each pixel in a line; each vertical
-     * predictor is 0 to start with */
-    av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned int));
-
-    return 0;
-}
-
-/*
-Block decoding order:
-
-dxi: Y-Y
-dxic: Y-C-Y
-dxic2: Y-C-Y-C
-
-hres,vres,i,i%vres (0 < i < 4)
-2x2 0: 0 dxic2
-2x2 1: 1 dxi
-2x2 2: 0 dxic2
-2x2 3: 1 dxi
-2x4 0: 0 dxic2
-2x4 1: 1 dxi
-2x4 2: 2 dxi
-2x4 3: 3 dxi
-4x2 0: 0 dxic
-4x2 1: 1 dxi
-4x2 2: 0 dxic
-4x2 3: 1 dxi
-4x4 0: 0 dxic
-4x4 1: 1 dxi
-4x4 2: 2 dxi
-4x4 3: 3 dxi
-*/
-
-#define GET_NEXT_INDEX() \
-{\
-    if (index_stream_index >= s->index_stream_size) { \
-        av_log(s->avctx, AV_LOG_INFO, " help! truemotion1 decoder went out of bounds\n"); \
-        return; \
-    } \
-    index = s->index_stream[index_stream_index++] * 4; \
-}
-
-#define INC_INDEX                                                   \
-do {                                                                \
-    if (index >= 1023) {                                            \
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid index value.\n");   \
-        return;                                                     \
-    }                                                               \
-    index++;                                                        \
-} while (0)
-
-#define APPLY_C_PREDICTOR() \
-    predictor_pair = s->c_predictor_table[index]; \
-    horiz_pred += (predictor_pair >> 1); \
-    if (predictor_pair & 1) { \
-        GET_NEXT_INDEX() \
-        if (!index) { \
-            GET_NEXT_INDEX() \
-            predictor_pair = s->c_predictor_table[index]; \
-            horiz_pred += ((predictor_pair >> 1) * 5); \
-            if (predictor_pair & 1) \
-                GET_NEXT_INDEX() \
-            else \
-                INC_INDEX; \
-        } \
-    } else \
-        INC_INDEX;
-
-#define APPLY_C_PREDICTOR_24() \
-    predictor_pair = s->c_predictor_table[index]; \
-    horiz_pred += (predictor_pair >> 1); \
-    if (predictor_pair & 1) { \
-        GET_NEXT_INDEX() \
-        if (!index) { \
-            GET_NEXT_INDEX() \
-            predictor_pair = s->fat_c_predictor_table[index]; \
-            horiz_pred += (predictor_pair >> 1); \
-            if (predictor_pair & 1) \
-                GET_NEXT_INDEX() \
-            else \
-                INC_INDEX; \
-        } \
-    } else \
-        INC_INDEX;
-
-
-#define APPLY_Y_PREDICTOR() \
-    predictor_pair = s->y_predictor_table[index]; \
-    horiz_pred += (predictor_pair >> 1); \
-    if (predictor_pair & 1) { \
-        GET_NEXT_INDEX() \
-        if (!index) { \
-            GET_NEXT_INDEX() \
-            predictor_pair = s->y_predictor_table[index]; \
-            horiz_pred += ((predictor_pair >> 1) * 5); \
-            if (predictor_pair & 1) \
-                GET_NEXT_INDEX() \
-            else \
-                INC_INDEX; \
-        } \
-    } else \
-        INC_INDEX;
-
-#define APPLY_Y_PREDICTOR_24() \
-    predictor_pair = s->y_predictor_table[index]; \
-    horiz_pred += (predictor_pair >> 1); \
-    if (predictor_pair & 1) { \
-        GET_NEXT_INDEX() \
-        if (!index) { \
-            GET_NEXT_INDEX() \
-            predictor_pair = s->fat_y_predictor_table[index]; \
-            horiz_pred += (predictor_pair >> 1); \
-            if (predictor_pair & 1) \
-                GET_NEXT_INDEX() \
-            else \
-                INC_INDEX; \
-        } \
-    } else \
-        INC_INDEX;
-
-#define OUTPUT_PIXEL_PAIR() \
-    *current_pixel_pair = *vert_pred + horiz_pred; \
-    *vert_pred++ = *current_pixel_pair++;
-
-static void truemotion1_decode_16bit(TrueMotion1Context *s)
-{
-    int y;
-    int pixels_left;  /* remaining pixels on this line */
-    unsigned int predictor_pair;
-    unsigned int horiz_pred;
-    unsigned int *vert_pred;
-    unsigned int *current_pixel_pair;
-    unsigned char *current_line = s->frame->data[0];
-    int keyframe = s->flags & FLAG_KEYFRAME;
-
-    /* these variables are for managing the stream of macroblock change bits */
-    const unsigned char *mb_change_bits = s->mb_change_bits;
-    unsigned char mb_change_byte;
-    unsigned char mb_change_byte_mask;
-    int mb_change_index;
-
-    /* these variables are for managing the main index stream */
-    int index_stream_index = 0;  /* yes, the index into the index stream */
-    int index;
-
-    /* clean out the line buffer */
-    memset(s->vert_pred, 0, s->avctx->width * sizeof(unsigned int));
-
-    GET_NEXT_INDEX();
-
-    for (y = 0; y < s->avctx->height; y++) {
-
-        /* re-init variables for the next line iteration */
-        horiz_pred = 0;
-        current_pixel_pair = (unsigned int *)current_line;
-        vert_pred = s->vert_pred;
-        mb_change_index = 0;
-        mb_change_byte = mb_change_bits[mb_change_index++];
-        mb_change_byte_mask = 0x01;
-        pixels_left = s->avctx->width;
-
-        while (pixels_left > 0) {
-
-            if (keyframe || ((mb_change_byte & mb_change_byte_mask) == 0)) {
-
-                switch (y & 3) {
-                case 0:
-                    /* if macroblock width is 2, apply C-Y-C-Y; else
-                     * apply C-Y-Y */
-                    if (s->block_width == 2) {
-                        APPLY_C_PREDICTOR();
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_C_PREDICTOR();
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                    } else {
-                        APPLY_C_PREDICTOR();
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                    }
-                    break;
-
-                case 1:
-                case 3:
-                    /* always apply 2 Y predictors on these iterations */
-                    APPLY_Y_PREDICTOR();
-                    OUTPUT_PIXEL_PAIR();
-                    APPLY_Y_PREDICTOR();
-                    OUTPUT_PIXEL_PAIR();
-                    break;
-
-                case 2:
-                    /* this iteration might be C-Y-C-Y, Y-Y, or C-Y-Y
-                     * depending on the macroblock type */
-                    if (s->block_type == BLOCK_2x2) {
-                        APPLY_C_PREDICTOR();
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_C_PREDICTOR();
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                    } else if (s->block_type == BLOCK_4x2) {
-                        APPLY_C_PREDICTOR();
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                    } else {
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_Y_PREDICTOR();
-                        OUTPUT_PIXEL_PAIR();
-                    }
-                    break;
-                }
-
-            } else {
-
-                /* skip (copy) four pixels, but reassign the horizontal
-                 * predictor */
-                *vert_pred++ = *current_pixel_pair++;
-                horiz_pred = *current_pixel_pair - *vert_pred;
-                *vert_pred++ = *current_pixel_pair++;
-
-            }
-
-            if (!keyframe) {
-                mb_change_byte_mask <<= 1;
-
-                /* next byte */
-                if (!mb_change_byte_mask) {
-                    mb_change_byte = mb_change_bits[mb_change_index++];
-                    mb_change_byte_mask = 0x01;
-                }
-            }
-
-            pixels_left -= 4;
-        }
-
-        /* next change row */
-        if (((y + 1) & 3) == 0)
-            mb_change_bits += s->mb_change_bits_row_size;
-
-        current_line += s->frame->linesize[0];
-    }
-}
-
-static void truemotion1_decode_24bit(TrueMotion1Context *s)
-{
-    int y;
-    int pixels_left;  /* remaining pixels on this line */
-    unsigned int predictor_pair;
-    unsigned int horiz_pred;
-    unsigned int *vert_pred;
-    unsigned int *current_pixel_pair;
-    unsigned char *current_line = s->frame->data[0];
-    int keyframe = s->flags & FLAG_KEYFRAME;
-
-    /* these variables are for managing the stream of macroblock change bits */
-    const unsigned char *mb_change_bits = s->mb_change_bits;
-    unsigned char mb_change_byte;
-    unsigned char mb_change_byte_mask;
-    int mb_change_index;
-
-    /* these variables are for managing the main index stream */
-    int index_stream_index = 0;  /* yes, the index into the index stream */
-    int index;
-
-    /* clean out the line buffer */
-    memset(s->vert_pred, 0, s->avctx->width * sizeof(unsigned int));
-
-    GET_NEXT_INDEX();
-
-    for (y = 0; y < s->avctx->height; y++) {
-
-        /* re-init variables for the next line iteration */
-        horiz_pred = 0;
-        current_pixel_pair = (unsigned int *)current_line;
-        vert_pred = s->vert_pred;
-        mb_change_index = 0;
-        mb_change_byte = mb_change_bits[mb_change_index++];
-        mb_change_byte_mask = 0x01;
-        pixels_left = s->avctx->width;
-
-        while (pixels_left > 0) {
-
-            if (keyframe || ((mb_change_byte & mb_change_byte_mask) == 0)) {
-
-                switch (y & 3) {
-                case 0:
-                    /* if macroblock width is 2, apply C-Y-C-Y; else
-                     * apply C-Y-Y */
-                    if (s->block_width == 2) {
-                        APPLY_C_PREDICTOR_24();
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_C_PREDICTOR_24();
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                    } else {
-                        APPLY_C_PREDICTOR_24();
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                    }
-                    break;
-
-                case 1:
-                case 3:
-                    /* always apply 2 Y predictors on these iterations */
-                    APPLY_Y_PREDICTOR_24();
-                    OUTPUT_PIXEL_PAIR();
-                    APPLY_Y_PREDICTOR_24();
-                    OUTPUT_PIXEL_PAIR();
-                    break;
-
-                case 2:
-                    /* this iteration might be C-Y-C-Y, Y-Y, or C-Y-Y
-                     * depending on the macroblock type */
-                    if (s->block_type == BLOCK_2x2) {
-                        APPLY_C_PREDICTOR_24();
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_C_PREDICTOR_24();
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                    } else if (s->block_type == BLOCK_4x2) {
-                        APPLY_C_PREDICTOR_24();
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                    } else {
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                        APPLY_Y_PREDICTOR_24();
-                        OUTPUT_PIXEL_PAIR();
-                    }
-                    break;
-                }
-
-            } else {
-
-                /* skip (copy) four pixels, but reassign the horizontal
-                 * predictor */
-                *vert_pred++ = *current_pixel_pair++;
-                horiz_pred = *current_pixel_pair - *vert_pred;
-                *vert_pred++ = *current_pixel_pair++;
-
-            }
-
-            if (!keyframe) {
-                mb_change_byte_mask <<= 1;
-
-                /* next byte */
-                if (!mb_change_byte_mask) {
-                    mb_change_byte = mb_change_bits[mb_change_index++];
-                    mb_change_byte_mask = 0x01;
-                }
-            }
-
-            pixels_left -= 2;
-        }
-
-        /* next change row */
-        if (((y + 1) & 3) == 0)
-            mb_change_bits += s->mb_change_bits_row_size;
-
-        current_line += s->frame->linesize[0];
-    }
-}
-
-
-static int truemotion1_decode_frame(AVCodecContext *avctx,
-                                    void *data, int *got_frame,
-                                    AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int ret, buf_size = avpkt->size;
-    TrueMotion1Context *s = avctx->priv_data;
-
-    s->buf = buf;
-    s->size = buf_size;
-
-    if ((ret = truemotion1_decode_header(s)) < 0)
-        return ret;
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (compression_types[s->compression].algorithm == ALGO_RGB24H) {
-        truemotion1_decode_24bit(s);
-    } else if (compression_types[s->compression].algorithm != ALGO_NOP) {
-        truemotion1_decode_16bit(s);
-    }
-
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    *got_frame      = 1;
-
-    /* report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int truemotion1_decode_end(AVCodecContext *avctx)
-{
-    TrueMotion1Context *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-    av_free(s->vert_pred);
-
-    return 0;
-}
-
-AVCodec ff_truemotion1_decoder = {
-    .name           = "truemotion1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Duck TrueMotion 1.0"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TRUEMOTION1,
-    .priv_data_size = sizeof(TrueMotion1Context),
-    .init           = truemotion1_decode_init,
-    .close          = truemotion1_decode_end,
-    .decode         = truemotion1_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/truemotion1data.h b/deps/libav/libavcodec/truemotion1data.h
deleted file mode 100644
index e950450..0000000
--- a/deps/libav/libavcodec/truemotion1data.h
+++ /dev/null
@@ -1,832 +0,0 @@
-/*
- * Duck Truemotion v1 Decoding Tables
- *
- * Data in this file was originally part of VpVision from On2 which is
- * distributed under the GNU GPL. It is redistributed with libavcodec under
- * the GNU LGPL using the common understanding that data tables necessary
- * for decoding algorithms are not necessarily copyrightable.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVCODEC_TRUEMOTION1DATA_H
-#define AVCODEC_TRUEMOTION1DATA_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-/* Y delta tables, skinny and fat */
-static const int16_t ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 };
-static const int16_t ydt2[8] = { 0, -2, 4, -6, 8, -12, 12, -12 };
-static const int16_t ydt3[8] = { 4, -6, 20, -20, 46, -46, 94, -94 };
-static const int16_t fat_ydt3[8] = { 0, -15, 50, -50, 115, -115, 235, -235 };
-static const int16_t ydt4[8] = { 0, -4, 4, -16, 16, -36, 36, -80 };
-/* NOTE: This table breaks the [+,-] pattern that the rest of the
- * tables maintain. Is this intentional? */
-static const int16_t fat_ydt4[8] = { 0, 40, 80, -76, 160, -154, 236, -236 };
-
-/* C delta tables, skinny and fat */
-static const int16_t cdt1[8] = { 0, -1, 1, -2, 3, -4, 5, -4 };
-static const int16_t cdt2[8] = { 0, -4, 3, -16, 20, -32, 36, -32 };
-static const int16_t fat_cdt2[8] = { 0, -20, 15, -80, 100, -160, 180, -160 };
-static const int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 };
-
-/* all the delta tables to choose from, at all 4 delta levels */
-static const int16_t * const ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL };
-static const int16_t * const fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL };
-static const int16_t * const cdts[] = { cdt1, cdt1, cdt2, cdt3, NULL };
-static const int16_t * const fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_ydt4, NULL };
-
-static const uint8_t pc_tbl2[] = {
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x10,0x00,0x00,0x00,
-0x8,0x01,0x00,0x00,0x00,
-0x8,0x00,0x10,0x00,0x00,
-0x8,0x00,0x01,0x00,0x00,
-0x8,0x00,0x00,0x10,0x00,
-0x8,0x00,0x00,0x01,0x00,
-0x8,0x00,0x00,0x00,0x10,
-0x8,0x00,0x00,0x00,0x01,
-0x6,0x00,0x00,0x00,
-0x6,0x10,0x00,0x00,
-0x6,0x01,0x00,0x00,
-0x6,0x00,0x10,0x00,
-0x6,0x00,0x01,0x00,
-0x6,0x00,0x00,0x01,
-0x6,0x00,0x00,0x10,
-0x6,0x00,0x00,0x02,
-0x6,0x00,0x00,0x20,
-0x6,0x20,0x10,0x00,
-0x6,0x00,0x02,0x01,
-0x6,0x00,0x20,0x10,
-0x6,0x02,0x01,0x00,
-0x6,0x11,0x00,0x00,
-0x6,0x00,0x20,0x00,
-0x6,0x00,0x02,0x00,
-0x6,0x20,0x00,0x00,
-0x6,0x01,0x10,0x00,
-0x6,0x02,0x00,0x00,
-0x6,0x01,0x00,0x02,
-0x6,0x10,0x00,0x20,
-0x6,0x00,0x01,0x02,
-0x6,0x10,0x01,0x00,
-0x6,0x00,0x10,0x20,
-0x6,0x10,0x10,0x00,
-0x6,0x10,0x00,0x01,
-0x6,0x20,0x00,0x10,
-0x6,0x02,0x00,0x01,
-0x6,0x01,0x01,0x00,
-0x6,0x01,0x00,0x10,
-0x6,0x00,0x11,0x00,
-0x6,0x10,0x00,0x02,
-0x6,0x00,0x01,0x10,
-0x6,0x00,0x00,0x11,
-0x6,0x10,0x00,0x10,
-0x6,0x01,0x00,0x01,
-0x6,0x00,0x00,0x22,
-0x6,0x02,0x01,0x01,
-0x6,0x10,0x20,0x10,
-0x6,0x01,0x02,0x01,
-0x6,0x20,0x10,0x10,
-0x6,0x01,0x00,0x20,
-0x6,0x00,0x10,0x01,
-0x6,0x21,0x10,0x00,
-0x6,0x10,0x02,0x01,
-0x6,0x12,0x01,0x00,
-0x6,0x01,0x20,0x10,
-0x6,0x01,0x02,0x00,
-0x6,0x10,0x20,0x00,
-0x6,0x00,0x10,0x02,
-0x6,0x00,0x01,0x20,
-0x6,0x00,0x02,0x21,
-0x6,0x00,0x02,0x20,
-0x6,0x00,0x00,0x12,
-0x6,0x00,0x00,0x21,
-0x6,0x20,0x11,0x00,
-0x6,0x00,0x01,0x01,
-0x6,0x11,0x10,0x00,
-0x6,0x00,0x20,0x12,
-0x6,0x00,0x20,0x11,
-0x6,0x20,0x10,0x02,
-0x6,0x02,0x01,0x20,
-0x6,0x00,0x22,0x11,
-0x6,0x00,0x10,0x10,
-0x6,0x02,0x11,0x00,
-0x6,0x00,0x21,0x10,
-0x6,0x00,0x02,0x03,
-0x6,0x20,0x10,0x01,
-0x6,0x00,0x12,0x01,
-0x4,0x11,0x00,
-0x4,0x00,0x22,
-0x4,0x20,0x00,
-0x4,0x01,0x10,
-0x4,0x02,0x20,
-0x4,0x00,0x20,
-0x4,0x02,0x00,
-0x4,0x10,0x01,
-0x4,0x00,0x11,
-0x4,0x02,0x01,
-0x4,0x02,0x21,
-0x4,0x00,0x02,
-0x4,0x20,0x02,
-0x4,0x01,0x01,
-0x4,0x10,0x10,
-0x4,0x10,0x02,
-0x4,0x22,0x00,
-0x4,0x10,0x00,
-0x4,0x01,0x00,
-0x4,0x21,0x00,
-0x4,0x12,0x00,
-0x4,0x00,0x10,
-0x4,0x20,0x12,
-0x4,0x01,0x11,
-0x4,0x00,0x01,
-0x4,0x01,0x02,
-0x4,0x11,0x02,
-0x4,0x11,0x01,
-0x4,0x10,0x20,
-0x4,0x20,0x01,
-0x4,0x22,0x11,
-0x4,0x00,0x12,
-0x4,0x20,0x10,
-0x4,0x22,0x01,
-0x4,0x01,0x20,
-0x4,0x00,0x21,
-0x4,0x10,0x11,
-0x4,0x21,0x10,
-0x4,0x10,0x22,
-0x4,0x02,0x03,
-0x4,0x12,0x01,
-0x4,0x20,0x11,
-0x4,0x11,0x10,
-0x4,0x20,0x30,
-0x4,0x11,0x20,
-0x4,0x02,0x10,
-0x4,0x22,0x10,
-0x4,0x11,0x11,
-0x4,0x30,0x20,
-0x4,0x30,0x00,
-0x4,0x01,0x22,
-0x4,0x01,0x12,
-0x4,0x02,0x11,
-0x4,0x03,0x02,
-0x4,0x03,0x00,
-0x4,0x10,0x21,
-0x4,0x12,0x20,
-0x4,0x00,0x00,
-0x4,0x12,0x21,
-0x4,0x21,0x11,
-0x4,0x02,0x22,
-0x4,0x10,0x12,
-0x4,0x31,0x00,
-0x4,0x20,0x20,
-0x4,0x00,0x03,
-0x4,0x02,0x02,
-0x4,0x22,0x20,
-0x4,0x01,0x21,
-0x4,0x21,0x02,
-0x4,0x21,0x12,
-0x4,0x11,0x22,
-0x4,0x00,0x30,
-0x4,0x12,0x11,
-0x4,0x20,0x22,
-0x4,0x31,0x20,
-0x4,0x21,0x30,
-0x4,0x22,0x02,
-0x4,0x22,0x22,
-0x4,0x20,0x31,
-0x4,0x13,0x02,
-0x4,0x03,0x10,
-0x4,0x11,0x12,
-0x4,0x00,0x13,
-0x4,0x21,0x01,
-0x4,0x12,0x03,
-0x4,0x13,0x00,
-0x4,0x13,0x10,
-0x4,0x02,0x13,
-0x4,0x30,0x01,
-0x4,0x12,0x10,
-0x4,0x22,0x13,
-0x4,0x03,0x12,
-0x4,0x31,0x01,
-0x4,0x30,0x22,
-0x4,0x00,0x31,
-0x4,0x01,0x31,
-0x4,0x02,0x23,
-0x4,0x01,0x30,
-0x4,0x11,0x21,
-0x4,0x22,0x21,
-0x4,0x01,0x13,
-0x4,0x10,0x03,
-0x4,0x22,0x03,
-0x4,0x30,0x21,
-0x4,0x21,0x31,
-0x4,0x33,0x00,
-0x4,0x13,0x12,
-0x4,0x11,0x31,
-0x4,0x30,0x02,
-0x4,0x12,0x02,
-0x4,0x11,0x13,
-0x4,0x12,0x22,
-0x4,0x20,0x32,
-0x4,0x10,0x13,
-0x4,0x22,0x31,
-0x4,0x21,0x20,
-0x4,0x01,0x33,
-0x4,0x33,0x10,
-0x4,0x20,0x13,
-0x4,0x31,0x22,
-0x4,0x13,0x30,
-0x4,0x01,0x03,
-0x4,0x11,0x33,
-0x4,0x20,0x21,
-0x4,0x13,0x31,
-0x4,0x03,0x22,
-0x4,0x31,0x02,
-0x4,0x00,0x24,
-0x2,0x00,
-0x2,0x10,
-0x2,0x20,
-0x2,0x30,
-0x2,0x40,
-0x2,0x50,
-0x2,0x60,
-0x2,0x01,
-0x2,0x11,
-0x2,0x21,
-0x2,0x31,
-0x2,0x41,
-0x2,0x51,
-0x2,0x61,
-0x2,0x02,
-0x2,0x12,
-0x2,0x22,
-0x2,0x32,
-0x2,0x42,
-0x2,0x52,
-0x2,0x62,
-0x2,0x03,
-0x2,0x13,
-0x2,0x23,
-0x2,0x33,
-0x2,0x43,
-0x2,0x53,
-0x2,0x63,
-0x2,0x04,
-0x2,0x14,
-0x2,0x24,
-0x2,0x34,
-0x2,0x44,
-0x2,0x54,
-0x2,0x64,
-0x2,0x05,
-0x2,0x15,
-0x2,0x25,
-0x2,0x35,
-0x2,0x45,
-0x2,0x55,
-0x2,0x65,
-0x2,0x06,
-0x2,0x16,
-0x2,0x26,
-0x2,0x36,
-0x2,0x46,
-0x2,0x56,
-0x2,0x66
-};
-
-static const uint8_t pc_tbl3[] = {
-0x6,0x00,0x00,0x00,
-0x6,0x00,0x00,0x00,
-0x6,0x00,0x00,0x01,
-0x6,0x00,0x00,0x10,
-0x6,0x00,0x00,0x11,
-0x6,0x00,0x01,0x00,
-0x6,0x00,0x01,0x01,
-0x6,0x00,0x01,0x10,
-0x6,0x00,0x01,0x11,
-0x6,0x00,0x10,0x00,
-0x6,0x00,0x10,0x01,
-0x6,0x00,0x10,0x10,
-0x6,0x00,0x10,0x11,
-0x6,0x00,0x11,0x00,
-0x6,0x00,0x11,0x01,
-0x6,0x00,0x11,0x10,
-0x6,0x00,0x11,0x11,
-0x6,0x01,0x00,0x00,
-0x6,0x01,0x00,0x01,
-0x6,0x01,0x00,0x10,
-0x6,0x01,0x00,0x11,
-0x6,0x01,0x01,0x00,
-0x6,0x01,0x01,0x01,
-0x6,0x01,0x01,0x10,
-0x6,0x01,0x01,0x11,
-0x6,0x01,0x10,0x00,
-0x6,0x01,0x10,0x01,
-0x6,0x01,0x10,0x10,
-0x6,0x01,0x10,0x11,
-0x6,0x01,0x11,0x00,
-0x6,0x01,0x11,0x01,
-0x6,0x01,0x11,0x10,
-0x6,0x01,0x11,0x11,
-0x6,0x10,0x00,0x00,
-0x6,0x10,0x00,0x01,
-0x6,0x10,0x00,0x10,
-0x6,0x10,0x00,0x11,
-0x6,0x10,0x01,0x00,
-0x6,0x10,0x01,0x01,
-0x6,0x10,0x01,0x10,
-0x6,0x10,0x01,0x11,
-0x6,0x10,0x10,0x00,
-0x6,0x10,0x10,0x01,
-0x6,0x10,0x10,0x10,
-0x6,0x10,0x10,0x11,
-0x6,0x10,0x11,0x00,
-0x6,0x10,0x11,0x01,
-0x6,0x10,0x11,0x10,
-0x6,0x10,0x11,0x11,
-0x6,0x11,0x00,0x00,
-0x6,0x11,0x00,0x01,
-0x6,0x11,0x00,0x10,
-0x6,0x11,0x00,0x11,
-0x6,0x11,0x01,0x00,
-0x6,0x11,0x01,0x01,
-0x6,0x11,0x01,0x10,
-0x6,0x11,0x01,0x11,
-0x6,0x11,0x10,0x00,
-0x6,0x11,0x10,0x01,
-0x6,0x11,0x10,0x10,
-0x6,0x11,0x10,0x11,
-0x6,0x11,0x11,0x00,
-0x6,0x11,0x11,0x01,
-0x6,0x11,0x11,0x10,
-0x4,0x00,0x00,
-0x4,0x00,0x01,
-0x4,0x00,0x02,
-0x4,0x00,0x03,
-0x4,0x00,0x10,
-0x4,0x00,0x11,
-0x4,0x00,0x12,
-0x4,0x00,0x13,
-0x4,0x00,0x20,
-0x4,0x00,0x21,
-0x4,0x00,0x22,
-0x4,0x00,0x23,
-0x4,0x00,0x30,
-0x4,0x00,0x31,
-0x4,0x00,0x32,
-0x4,0x00,0x33,
-0x4,0x01,0x00,
-0x4,0x01,0x01,
-0x4,0x01,0x02,
-0x4,0x01,0x03,
-0x4,0x01,0x10,
-0x4,0x01,0x11,
-0x4,0x01,0x12,
-0x4,0x01,0x13,
-0x4,0x01,0x20,
-0x4,0x01,0x21,
-0x4,0x01,0x22,
-0x4,0x01,0x23,
-0x4,0x01,0x30,
-0x4,0x01,0x31,
-0x4,0x01,0x32,
-0x4,0x01,0x33,
-0x4,0x02,0x00,
-0x4,0x02,0x01,
-0x4,0x02,0x02,
-0x4,0x02,0x03,
-0x4,0x02,0x10,
-0x4,0x02,0x11,
-0x4,0x02,0x12,
-0x4,0x02,0x13,
-0x4,0x02,0x20,
-0x4,0x02,0x21,
-0x4,0x02,0x22,
-0x4,0x02,0x23,
-0x4,0x02,0x30,
-0x4,0x02,0x31,
-0x4,0x02,0x32,
-0x4,0x02,0x33,
-0x4,0x03,0x00,
-0x4,0x03,0x01,
-0x4,0x03,0x02,
-0x4,0x03,0x03,
-0x4,0x03,0x10,
-0x4,0x03,0x11,
-0x4,0x03,0x12,
-0x4,0x03,0x13,
-0x4,0x03,0x20,
-0x4,0x03,0x21,
-0x4,0x03,0x22,
-0x4,0x03,0x23,
-0x4,0x03,0x30,
-0x4,0x03,0x31,
-0x4,0x03,0x32,
-0x4,0x03,0x33,
-0x4,0x10,0x00,
-0x4,0x10,0x01,
-0x4,0x10,0x02,
-0x4,0x10,0x03,
-0x4,0x10,0x10,
-0x4,0x10,0x11,
-0x4,0x10,0x12,
-0x4,0x10,0x13,
-0x4,0x10,0x20,
-0x4,0x10,0x21,
-0x4,0x10,0x22,
-0x4,0x10,0x23,
-0x4,0x10,0x30,
-0x4,0x10,0x31,
-0x4,0x10,0x32,
-0x4,0x10,0x33,
-0x4,0x11,0x00,
-0x4,0x11,0x01,
-0x4,0x11,0x02,
-0x4,0x11,0x03,
-0x4,0x11,0x10,
-0x4,0x11,0x11,
-0x4,0x11,0x12,
-0x4,0x11,0x13,
-0x4,0x11,0x20,
-0x4,0x11,0x21,
-0x4,0x11,0x22,
-0x4,0x11,0x23,
-0x4,0x11,0x30,
-0x4,0x11,0x31,
-0x4,0x11,0x32,
-0x4,0x11,0x33,
-0x4,0x12,0x00,
-0x4,0x12,0x01,
-0x4,0x12,0x02,
-0x4,0x12,0x03,
-0x4,0x12,0x10,
-0x4,0x12,0x11,
-0x4,0x12,0x12,
-0x4,0x12,0x13,
-0x4,0x12,0x20,
-0x4,0x12,0x21,
-0x4,0x12,0x22,
-0x4,0x12,0x23,
-0x4,0x12,0x30,
-0x4,0x12,0x31,
-0x4,0x12,0x32,
-0x4,0x12,0x33,
-0x4,0x13,0x00,
-0x4,0x13,0x01,
-0x4,0x13,0x02,
-0x4,0x13,0x03,
-0x4,0x13,0x10,
-0x4,0x13,0x11,
-0x4,0x13,0x12,
-0x4,0x13,0x13,
-0x4,0x13,0x20,
-0x4,0x13,0x21,
-0x4,0x13,0x22,
-0x4,0x13,0x23,
-0x4,0x13,0x30,
-0x4,0x13,0x31,
-0x4,0x13,0x32,
-0x4,0x13,0x33,
-0x2,0x00,
-0x2,0x10,
-0x2,0x20,
-0x2,0x30,
-0x2,0x40,
-0x2,0x50,
-0x2,0x60,
-0x2,0x70,
-0x2,0x01,
-0x2,0x11,
-0x2,0x21,
-0x2,0x31,
-0x2,0x41,
-0x2,0x51,
-0x2,0x61,
-0x2,0x71,
-0x2,0x02,
-0x2,0x12,
-0x2,0x22,
-0x2,0x32,
-0x2,0x42,
-0x2,0x52,
-0x2,0x62,
-0x2,0x72,
-0x2,0x03,
-0x2,0x13,
-0x2,0x23,
-0x2,0x33,
-0x2,0x43,
-0x2,0x53,
-0x2,0x63,
-0x2,0x73,
-0x2,0x04,
-0x2,0x14,
-0x2,0x24,
-0x2,0x34,
-0x2,0x44,
-0x2,0x54,
-0x2,0x64,
-0x2,0x74,
-0x2,0x05,
-0x2,0x15,
-0x2,0x25,
-0x2,0x35,
-0x2,0x45,
-0x2,0x55,
-0x2,0x65,
-0x2,0x75,
-0x2,0x06,
-0x2,0x16,
-0x2,0x26,
-0x2,0x36,
-0x2,0x46,
-0x2,0x56,
-0x2,0x66,
-0x2,0x76,
-0x2,0x07,
-0x2,0x17,
-0x2,0x27,
-0x2,0x37,
-0x2,0x47,
-0x2,0x57,
-0x2,0x67,
-0x2,0x77
-};
-
-static const uint8_t pc_tbl4[] = {
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x20,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x01,
-0x8,0x10,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x02,
-0x8,0x01,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x10,
-0x8,0x02,0x00,0x00,0x00,
-0x6,0x00,0x00,0x00,
-0x6,0x20,0x00,0x00,
-0x6,0x00,0x00,0x01,
-0x6,0x10,0x00,0x00,
-0x6,0x00,0x00,0x02,
-0x6,0x00,0x10,0x00,
-0x6,0x00,0x20,0x00,
-0x6,0x00,0x02,0x00,
-0x6,0x00,0x01,0x00,
-0x6,0x01,0x00,0x00,
-0x6,0x00,0x00,0x20,
-0x6,0x02,0x00,0x00,
-0x6,0x00,0x00,0x10,
-0x6,0x10,0x00,0x20,
-0x6,0x01,0x00,0x02,
-0x6,0x20,0x00,0x10,
-0x6,0x02,0x00,0x01,
-0x6,0x20,0x10,0x00,
-0x6,0x00,0x12,0x00,
-0x6,0x00,0x02,0x01,
-0x6,0x02,0x01,0x00,
-0x6,0x00,0x21,0x00,
-0x6,0x00,0x01,0x02,
-0x6,0x00,0x20,0x10,
-0x6,0x00,0x00,0x21,
-0x6,0x00,0x00,0x12,
-0x6,0x00,0x01,0x20,
-0x6,0x12,0x00,0x00,
-0x6,0x00,0x10,0x20,
-0x6,0x01,0x20,0x00,
-0x6,0x02,0x10,0x00,
-0x6,0x10,0x20,0x00,
-0x6,0x01,0x02,0x00,
-0x6,0x21,0x00,0x00,
-0x6,0x00,0x02,0x10,
-0x6,0x20,0x01,0x00,
-0x6,0x00,0x22,0x00,
-0x6,0x10,0x02,0x00,
-0x6,0x00,0x10,0x02,
-0x6,0x11,0x00,0x00,
-0x6,0x00,0x11,0x00,
-0x6,0x22,0x00,0x00,
-0x6,0x20,0x00,0x02,
-0x6,0x10,0x00,0x01,
-0x6,0x00,0x20,0x01,
-0x6,0x02,0x20,0x00,
-0x6,0x01,0x10,0x00,
-0x6,0x01,0x00,0x20,
-0x6,0x00,0x20,0x02,
-0x6,0x01,0x20,0x02,
-0x6,0x10,0x01,0x00,
-0x6,0x02,0x00,0x10,
-0x6,0x00,0x10,0x01,
-0x6,0x10,0x01,0x20,
-0x6,0x20,0x02,0x10,
-0x6,0x00,0x00,0x22,
-0x6,0x10,0x00,0x02,
-0x6,0x00,0x02,0x20,
-0x6,0x20,0x02,0x00,
-0x6,0x00,0x00,0x11,
-0x6,0x02,0x10,0x01,
-0x6,0x00,0x01,0x10,
-0x6,0x00,0x02,0x11,
-0x4,0x01,0x02,
-0x4,0x02,0x01,
-0x4,0x01,0x00,
-0x4,0x10,0x20,
-0x4,0x20,0x10,
-0x4,0x20,0x00,
-0x4,0x11,0x00,
-0x4,0x02,0x00,
-0x4,0x12,0x00,
-0x4,0x00,0x21,
-0x4,0x22,0x00,
-0x4,0x00,0x12,
-0x4,0x21,0x00,
-0x4,0x02,0x11,
-0x4,0x00,0x01,
-0x4,0x10,0x02,
-0x4,0x02,0x20,
-0x4,0x20,0x11,
-0x4,0x01,0x10,
-0x4,0x21,0x10,
-0x4,0x10,0x00,
-0x4,0x10,0x22,
-0x4,0x20,0x20,
-0x4,0x00,0x22,
-0x4,0x01,0x22,
-0x4,0x20,0x01,
-0x4,0x02,0x02,
-0x4,0x00,0x20,
-0x4,0x00,0x10,
-0x4,0x00,0x11,
-0x4,0x22,0x01,
-0x4,0x11,0x20,
-0x4,0x12,0x01,
-0x4,0x12,0x20,
-0x4,0x11,0x02,
-0x4,0x10,0x10,
-0x4,0x01,0x01,
-0x4,0x02,0x21,
-0x4,0x20,0x12,
-0x4,0x01,0x12,
-0x4,0x22,0x11,
-0x4,0x21,0x12,
-0x4,0x22,0x10,
-0x4,0x21,0x02,
-0x4,0x20,0x02,
-0x4,0x10,0x01,
-0x4,0x00,0x02,
-0x4,0x10,0x21,
-0x4,0x01,0x20,
-0x4,0x11,0x22,
-0x4,0x12,0x21,
-0x4,0x22,0x20,
-0x4,0x02,0x10,
-0x4,0x02,0x22,
-0x4,0x11,0x10,
-0x4,0x22,0x02,
-0x4,0x20,0x21,
-0x4,0x01,0x11,
-0x4,0x11,0x01,
-0x4,0x10,0x12,
-0x4,0x02,0x12,
-0x4,0x20,0x22,
-0x4,0x21,0x20,
-0x4,0x01,0x21,
-0x4,0x12,0x02,
-0x4,0x21,0x11,
-0x4,0x12,0x22,
-0x4,0x12,0x10,
-0x4,0x22,0x21,
-0x4,0x10,0x11,
-0x4,0x21,0x01,
-0x4,0x11,0x12,
-0x4,0x12,0x11,
-0x4,0x66,0x66,
-0x4,0x22,0x22,
-0x4,0x11,0x21,
-0x4,0x11,0x11,
-0x4,0x21,0x22,
-0x4,0x00,0x00,
-0x4,0x22,0x12,
-0x4,0x12,0x12,
-0x4,0x21,0x21,
-0x4,0x42,0x00,
-0x4,0x00,0x04,
-0x4,0x40,0x00,
-0x4,0x30,0x00,
-0x4,0x31,0x00,
-0x4,0x00,0x03,
-0x4,0x00,0x14,
-0x4,0x00,0x13,
-0x4,0x01,0x24,
-0x4,0x20,0x13,
-0x4,0x01,0x42,
-0x4,0x14,0x20,
-0x4,0x42,0x02,
-0x4,0x13,0x00,
-0x4,0x00,0x24,
-0x4,0x31,0x20,
-0x4,0x22,0x13,
-0x4,0x11,0x24,
-0x4,0x12,0x66,
-0x4,0x30,0x01,
-0x4,0x02,0x13,
-0x4,0x12,0x42,
-0x4,0x40,0x10,
-0x4,0x40,0x02,
-0x4,0x01,0x04,
-0x4,0x24,0x00,
-0x4,0x42,0x10,
-0x4,0x21,0x13,
-0x4,0x13,0x12,
-0x4,0x31,0x21,
-0x4,0x21,0x24,
-0x4,0x00,0x40,
-0x4,0x10,0x24,
-0x4,0x10,0x42,
-0x4,0x32,0x01,
-0x4,0x11,0x42,
-0x4,0x20,0x31,
-0x4,0x12,0x40,
-0x2,0x00,
-0x2,0x10,
-0x2,0x20,
-0x2,0x30,
-0x2,0x40,
-0x2,0x50,
-0x2,0x60,
-0x2,0x70,
-0x2,0x01,
-0x2,0x11,
-0x2,0x21,
-0x2,0x31,
-0x2,0x41,
-0x2,0x51,
-0x2,0x61,
-0x2,0x71,
-0x2,0x02,
-0x2,0x12,
-0x2,0x22,
-0x2,0x32,
-0x2,0x42,
-0x2,0x52,
-0x2,0x62,
-0x2,0x72,
-0x2,0x03,
-0x2,0x13,
-0x2,0x23,
-0x2,0x33,
-0x2,0x43,
-0x2,0x53,
-0x2,0x63,
-0x2,0x73,
-0x2,0x04,
-0x2,0x14,
-0x2,0x24,
-0x2,0x34,
-0x2,0x44,
-0x2,0x54,
-0x2,0x64,
-0x2,0x74,
-0x2,0x05,
-0x2,0x15,
-0x2,0x25,
-0x2,0x35,
-0x2,0x45,
-0x2,0x55,
-0x2,0x65,
-0x2,0x75,
-0x2,0x06,
-0x2,0x16,
-0x2,0x26,
-0x2,0x36,
-0x2,0x46,
-0x2,0x56,
-0x2,0x66,
-0x2,0x76,
-0x2,0x07,
-0x2,0x17,
-0x2,0x27,
-0x2,0x37,
-0x2,0x47,
-0x2,0x57,
-0x2,0x67,
-0x2,0x77
-};
-
-static const uint8_t * const tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 };
-
-#endif /* AVCODEC_TRUEMOTION1DATA_H */
diff --git a/deps/libav/libavcodec/truemotion2.c b/deps/libav/libavcodec/truemotion2.c
deleted file mode 100644
index e41d7a3..0000000
--- a/deps/libav/libavcodec/truemotion2.c
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
- * Duck/ON2 TrueMotion 2 Decoder
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Duck TrueMotion2 decoder.
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "internal.h"
-
-#define TM2_ESCAPE 0x80000000
-#define TM2_DELTAS 64
-
-/* Huffman-coded streams of different types of blocks */
-enum TM2_STREAMS {
-    TM2_C_HI = 0,
-    TM2_C_LO,
-    TM2_L_HI,
-    TM2_L_LO,
-    TM2_UPD,
-    TM2_MOT,
-    TM2_TYPE,
-    TM2_NUM_STREAMS
-};
-
-/* Block types */
-enum TM2_BLOCKS {
-    TM2_HI_RES = 0,
-    TM2_MED_RES,
-    TM2_LOW_RES,
-    TM2_NULL_RES,
-    TM2_UPDATE,
-    TM2_STILL,
-    TM2_MOTION
-};
-
-typedef struct TM2Context {
-    AVCodecContext *avctx;
-    AVFrame *pic;
-
-    GetBitContext gb;
-    DSPContext dsp;
-
-    /* TM2 streams */
-    int *tokens[TM2_NUM_STREAMS];
-    int tok_lens[TM2_NUM_STREAMS];
-    int tok_ptrs[TM2_NUM_STREAMS];
-    int deltas[TM2_NUM_STREAMS][TM2_DELTAS];
-    /* for blocks decoding */
-    int D[4];
-    int CD[4];
-    int *last;
-    int *clast;
-
-    /* data for current and previous frame */
-    int *Y1_base, *U1_base, *V1_base, *Y2_base, *U2_base, *V2_base;
-    int *Y1, *U1, *V1, *Y2, *U2, *V2;
-    int y_stride, uv_stride;
-    int cur;
-} TM2Context;
-
-/**
-* Huffman codes for each of streams
-*/
-typedef struct TM2Codes {
-    VLC vlc; ///< table for Libav bitstream reader
-    int bits;
-    int *recode; ///< table for converting from code indexes to values
-    int length;
-} TM2Codes;
-
-/**
-* structure for gathering Huffman codes information
-*/
-typedef struct TM2Huff {
-    int val_bits; ///< length of literal
-    int max_bits; ///< maximum length of code
-    int min_bits; ///< minimum length of code
-    int nodes; ///< total number of nodes in tree
-    int num; ///< current number filled
-    int max_num; ///< total number of codes
-    int *nums; ///< literals
-    uint32_t *bits; ///< codes
-    int *lens; ///< codelengths
-} TM2Huff;
-
-static int tm2_read_tree(TM2Context *ctx, uint32_t prefix, int length, TM2Huff *huff)
-{
-    int ret;
-    if (length > huff->max_bits) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Tree exceeded its given depth (%i)\n",
-               huff->max_bits);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!get_bits1(&ctx->gb)) { /* literal */
-        if (length == 0) {
-            length = 1;
-        }
-        if (huff->num >= huff->max_num) {
-            av_log(ctx->avctx, AV_LOG_DEBUG, "Too many literals\n");
-            return AVERROR_INVALIDDATA;
-        }
-        huff->nums[huff->num] = get_bits_long(&ctx->gb, huff->val_bits);
-        huff->bits[huff->num] = prefix;
-        huff->lens[huff->num] = length;
-        huff->num++;
-        return 0;
-    } else { /* non-terminal node */
-        if ((ret = tm2_read_tree(ctx, prefix << 1, length + 1, huff)) < 0)
-            return ret;
-        if ((ret = tm2_read_tree(ctx, (prefix << 1) | 1, length + 1, huff)) < 0)
-            return ret;
-    }
-    return 0;
-}
-
-static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code)
-{
-    TM2Huff huff;
-    int res = 0;
-
-    huff.val_bits = get_bits(&ctx->gb, 5);
-    huff.max_bits = get_bits(&ctx->gb, 5);
-    huff.min_bits = get_bits(&ctx->gb, 5);
-    huff.nodes    = get_bits_long(&ctx->gb, 17);
-    huff.num      = 0;
-
-    /* check for correct codes parameters */
-    if ((huff.val_bits < 1) || (huff.val_bits > 32) ||
-        (huff.max_bits < 0) || (huff.max_bits > 25)) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect tree parameters - literal "
-               "length: %i, max code length: %i\n", huff.val_bits, huff.max_bits);
-        return AVERROR_INVALIDDATA;
-    }
-    if ((huff.nodes <= 0) || (huff.nodes > 0x10000)) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect number of Huffman tree "
-               "nodes: %i\n", huff.nodes);
-        return AVERROR_INVALIDDATA;
-    }
-    /* one-node tree */
-    if (huff.max_bits == 0)
-        huff.max_bits = 1;
-
-    /* allocate space for codes - it is exactly ceil(nodes / 2) entries */
-    huff.max_num = (huff.nodes + 1) >> 1;
-    huff.nums    = av_mallocz(huff.max_num * sizeof(int));
-    huff.bits    = av_mallocz(huff.max_num * sizeof(uint32_t));
-    huff.lens    = av_mallocz(huff.max_num * sizeof(int));
-
-    res = tm2_read_tree(ctx, 0, 0, &huff);
-
-    if (huff.num != huff.max_num) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Got less codes than expected: %i of %i\n",
-               huff.num, huff.max_num);
-        res = AVERROR_INVALIDDATA;
-    }
-
-    /* convert codes to vlc_table */
-    if (res >= 0) {
-        int i;
-
-        res = init_vlc(&code->vlc, huff.max_bits, huff.max_num,
-                       huff.lens, sizeof(int), sizeof(int),
-                       huff.bits, sizeof(uint32_t), sizeof(uint32_t), 0);
-        if (res < 0)
-            av_log(ctx->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
-        else {
-            code->bits = huff.max_bits;
-            code->length = huff.max_num;
-            code->recode = av_malloc(code->length * sizeof(int));
-            for (i = 0; i < code->length; i++)
-                code->recode[i] = huff.nums[i];
-        }
-    }
-    /* free allocated memory */
-    av_free(huff.nums);
-    av_free(huff.bits);
-    av_free(huff.lens);
-
-    return res;
-}
-
-static void tm2_free_codes(TM2Codes *code)
-{
-    av_free(code->recode);
-    if (code->vlc.table)
-        ff_free_vlc(&code->vlc);
-}
-
-static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code)
-{
-    int val;
-    val = get_vlc2(gb, code->vlc.table, code->bits, 1);
-    return code->recode[val];
-}
-
-#define TM2_OLD_HEADER_MAGIC 0x00000100
-#define TM2_NEW_HEADER_MAGIC 0x00000101
-
-static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf)
-{
-    uint32_t magic = AV_RL32(buf);
-
-    switch (magic) {
-    case TM2_OLD_HEADER_MAGIC:
-        avpriv_request_sample(ctx->avctx, "Old TM2 header");
-        return 0;
-    case TM2_NEW_HEADER_MAGIC:
-        return 0;
-    default:
-        av_log(ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic);
-        return AVERROR_INVALIDDATA;
-    }
-}
-
-static int tm2_read_deltas(TM2Context *ctx, int stream_id)
-{
-    int d, mb;
-    int i, v;
-
-    d  = get_bits(&ctx->gb, 9);
-    mb = get_bits(&ctx->gb, 5);
-
-    if ((d < 1) || (d > TM2_DELTAS) || (mb < 1) || (mb > 32)) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect delta table: %i deltas x %i bits\n", d, mb);
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (i = 0; i < d; i++) {
-        v = get_bits_long(&ctx->gb, mb);
-        if (v & (1 << (mb - 1)))
-            ctx->deltas[stream_id][i] = v - (1 << mb);
-        else
-            ctx->deltas[stream_id][i] = v;
-    }
-    for (; i < TM2_DELTAS; i++)
-        ctx->deltas[stream_id][i] = 0;
-
-    return 0;
-}
-
-static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id, int buf_size)
-{
-    int i, ret;
-    int skip = 0;
-    int len, toks, pos;
-    TM2Codes codes;
-    GetByteContext gb;
-
-    /* get stream length in dwords */
-    bytestream2_init(&gb, buf, buf_size);
-    len  = bytestream2_get_be32(&gb);
-    skip = len * 4 + 4;
-
-    if (len == 0)
-        return 4;
-
-    if (len >= INT_MAX/4-1 || len < 0 || len > buf_size) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Error, invalid stream size.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    toks = bytestream2_get_be32(&gb);
-    if (toks & 1) {
-        len = bytestream2_get_be32(&gb);
-        if (len == TM2_ESCAPE) {
-            len = bytestream2_get_be32(&gb);
-        }
-        if (len > 0) {
-            pos = bytestream2_tell(&gb);
-            if (skip <= pos)
-                return AVERROR_INVALIDDATA;
-            init_get_bits(&ctx->gb, buf + pos, (skip - pos) * 8);
-            if ((ret = tm2_read_deltas(ctx, stream_id)) < 0)
-                return ret;
-            bytestream2_skip(&gb, ((get_bits_count(&ctx->gb) + 31) >> 5) << 2);
-        }
-    }
-    /* skip unused fields */
-    len = bytestream2_get_be32(&gb);
-    if (len == TM2_ESCAPE) { /* some unknown length - could be escaped too */
-        bytestream2_skip(&gb, 8); /* unused by decoder */
-    } else {
-        bytestream2_skip(&gb, 4); /* unused by decoder */
-    }
-
-    pos = bytestream2_tell(&gb);
-    if (skip <= pos)
-        return AVERROR_INVALIDDATA;
-    init_get_bits(&ctx->gb, buf + pos, (skip - pos) * 8);
-    if ((ret = tm2_build_huff_table(ctx, &codes)) < 0)
-        return ret;
-    bytestream2_skip(&gb, ((get_bits_count(&ctx->gb) + 31) >> 5) << 2);
-
-    toks >>= 1;
-    /* check if we have sane number of tokens */
-    if ((toks < 0) || (toks > 0xFFFFFF)) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect number of tokens: %i\n", toks);
-        tm2_free_codes(&codes);
-        return AVERROR_INVALIDDATA;
-    }
-    ctx->tokens[stream_id]   = av_realloc(ctx->tokens[stream_id], toks * sizeof(int));
-    ctx->tok_lens[stream_id] = toks;
-    len = bytestream2_get_be32(&gb);
-    if (len > 0) {
-        pos = bytestream2_tell(&gb);
-        if (skip <= pos)
-            return AVERROR_INVALIDDATA;
-        init_get_bits(&ctx->gb, buf + pos, (skip - pos) * 8);
-        for (i = 0; i < toks; i++) {
-            if (get_bits_left(&ctx->gb) <= 0) {
-                av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect number of tokens: %i\n", toks);
-                return AVERROR_INVALIDDATA;
-            }
-            ctx->tokens[stream_id][i] = tm2_get_token(&ctx->gb, &codes);
-            if (stream_id <= TM2_MOT && ctx->tokens[stream_id][i] >= TM2_DELTAS) {
-                av_log(ctx->avctx, AV_LOG_ERROR, "Invalid delta token index %d for type %d, n=%d\n",
-                       ctx->tokens[stream_id][i], stream_id, i);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    } else {
-        for (i = 0; i < toks; i++) {
-            ctx->tokens[stream_id][i] = codes.recode[0];
-            if (stream_id <= TM2_MOT && ctx->tokens[stream_id][i] >= TM2_DELTAS) {
-                av_log(ctx->avctx, AV_LOG_ERROR, "Invalid delta token index %d for type %d, n=%d\n",
-                       ctx->tokens[stream_id][i], stream_id, i);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-    tm2_free_codes(&codes);
-
-    return skip;
-}
-
-static inline int GET_TOK(TM2Context *ctx,int type)
-{
-    if (ctx->tok_ptrs[type] >= ctx->tok_lens[type]) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "Read token from stream %i out of bounds (%i>=%i)\n", type, ctx->tok_ptrs[type], ctx->tok_lens[type]);
-        return 0;
-    }
-    if (type <= TM2_MOT)
-        return ctx->deltas[type][ctx->tokens[type][ctx->tok_ptrs[type]++]];
-    return ctx->tokens[type][ctx->tok_ptrs[type]++];
-}
-
-/* blocks decoding routines */
-
-/* common Y, U, V pointers initialisation */
-#define TM2_INIT_POINTERS() \
-    int *last, *clast; \
-    int *Y, *U, *V;\
-    int Ystride, Ustride, Vstride;\
-\
-    Ystride = ctx->y_stride;\
-    Vstride = ctx->uv_stride;\
-    Ustride = ctx->uv_stride;\
-    Y = (ctx->cur?ctx->Y2:ctx->Y1) + by * 4 * Ystride + bx * 4;\
-    V = (ctx->cur?ctx->V2:ctx->V1) + by * 2 * Vstride + bx * 2;\
-    U = (ctx->cur?ctx->U2:ctx->U1) + by * 2 * Ustride + bx * 2;\
-    last = ctx->last + bx * 4;\
-    clast = ctx->clast + bx * 4;
-
-#define TM2_INIT_POINTERS_2() \
-    int *Yo, *Uo, *Vo;\
-    int oYstride, oUstride, oVstride;\
-\
-    TM2_INIT_POINTERS();\
-    oYstride = Ystride;\
-    oVstride = Vstride;\
-    oUstride = Ustride;\
-    Yo = (ctx->cur?ctx->Y1:ctx->Y2) + by * 4 * oYstride + bx * 4;\
-    Vo = (ctx->cur?ctx->V1:ctx->V2) + by * 2 * oVstride + bx * 2;\
-    Uo = (ctx->cur?ctx->U1:ctx->U2) + by * 2 * oUstride + bx * 2;
-
-/* recalculate last and delta values for next blocks */
-#define TM2_RECALC_BLOCK(CHR, stride, last, CD) {\
-    CD[0] = CHR[1] - last[1];\
-    CD[1] = (int)CHR[stride + 1] - (int)CHR[1];\
-    last[0] = (int)CHR[stride + 0];\
-    last[1] = (int)CHR[stride + 1];}
-
-/* common operations - add deltas to 4x4 block of luma or 2x2 blocks of chroma */
-static inline void tm2_apply_deltas(TM2Context *ctx, int* Y, int stride, int *deltas, int *last)
-{
-    int ct, d;
-    int i, j;
-
-    for (j = 0; j < 4; j++){
-        ct = ctx->D[j];
-        for (i = 0; i < 4; i++){
-            d        = deltas[i + j * 4];
-            ct      += d;
-            last[i] += ct;
-            Y[i]     = av_clip_uint8(last[i]);
-        }
-        Y        += stride;
-        ctx->D[j] = ct;
-    }
-}
-
-static inline void tm2_high_chroma(int *data, int stride, int *last, int *CD, int *deltas)
-{
-    int i, j;
-    for (j = 0; j < 2; j++) {
-        for (i = 0; i < 2; i++)  {
-            CD[j]   += deltas[i + j * 2];
-            last[i] += CD[j];
-            data[i]  = last[i];
-        }
-        data += stride;
-    }
-}
-
-static inline void tm2_low_chroma(int *data, int stride, int *clast, int *CD, int *deltas, int bx)
-{
-    int t;
-    int l;
-    int prev;
-
-    if (bx > 0)
-        prev = clast[-3];
-    else
-        prev = 0;
-    t        = (CD[0] + CD[1]) >> 1;
-    l        = (prev - CD[0] - CD[1] + clast[1]) >> 1;
-    CD[1]    = CD[0] + CD[1] - t;
-    CD[0]    = t;
-    clast[0] = l;
-
-    tm2_high_chroma(data, stride, clast, CD, deltas);
-}
-
-static inline void tm2_hi_res_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
-    int i;
-    int deltas[16];
-    TM2_INIT_POINTERS();
-
-    /* hi-res chroma */
-    for (i = 0; i < 4; i++) {
-        deltas[i]     = GET_TOK(ctx, TM2_C_HI);
-        deltas[i + 4] = GET_TOK(ctx, TM2_C_HI);
-    }
-    tm2_high_chroma(U, Ustride, clast,     ctx->CD,     deltas);
-    tm2_high_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas + 4);
-
-    /* hi-res luma */
-    for (i = 0; i < 16; i++)
-        deltas[i] = GET_TOK(ctx, TM2_L_HI);
-
-    tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
-}
-
-static inline void tm2_med_res_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
-    int i;
-    int deltas[16];
-    TM2_INIT_POINTERS();
-
-    /* low-res chroma */
-    deltas[0] = GET_TOK(ctx, TM2_C_LO);
-    deltas[1] = deltas[2] = deltas[3] = 0;
-    tm2_low_chroma(U, Ustride, clast, ctx->CD, deltas, bx);
-
-    deltas[0] = GET_TOK(ctx, TM2_C_LO);
-    deltas[1] = deltas[2] = deltas[3] = 0;
-    tm2_low_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas, bx);
-
-    /* hi-res luma */
-    for (i = 0; i < 16; i++)
-        deltas[i] = GET_TOK(ctx, TM2_L_HI);
-
-    tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
-}
-
-static inline void tm2_low_res_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
-    int i;
-    int t1, t2;
-    int deltas[16];
-    TM2_INIT_POINTERS();
-
-    /* low-res chroma */
-    deltas[0] = GET_TOK(ctx, TM2_C_LO);
-    deltas[1] = deltas[2] = deltas[3] = 0;
-    tm2_low_chroma(U, Ustride, clast, ctx->CD, deltas, bx);
-
-    deltas[0] = GET_TOK(ctx, TM2_C_LO);
-    deltas[1] = deltas[2] = deltas[3] = 0;
-    tm2_low_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas, bx);
-
-    /* low-res luma */
-    for (i = 0; i < 16; i++)
-        deltas[i] = 0;
-
-    deltas[ 0] = GET_TOK(ctx, TM2_L_LO);
-    deltas[ 2] = GET_TOK(ctx, TM2_L_LO);
-    deltas[ 8] = GET_TOK(ctx, TM2_L_LO);
-    deltas[10] = GET_TOK(ctx, TM2_L_LO);
-
-    if (bx > 0)
-        last[0] = (last[-1] - ctx->D[0] - ctx->D[1] - ctx->D[2] - ctx->D[3] + last[1]) >> 1;
-    else
-        last[0] = (last[1]  - ctx->D[0] - ctx->D[1] - ctx->D[2] - ctx->D[3])>> 1;
-    last[2] = (last[1] + last[3]) >> 1;
-
-    t1 = ctx->D[0] + ctx->D[1];
-    ctx->D[0] = t1 >> 1;
-    ctx->D[1] = t1 - (t1 >> 1);
-    t2 = ctx->D[2] + ctx->D[3];
-    ctx->D[2] = t2 >> 1;
-    ctx->D[3] = t2 - (t2 >> 1);
-
-    tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
-}
-
-static inline void tm2_null_res_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
-    int i;
-    int ct;
-    int left, right, diff;
-    int deltas[16];
-    TM2_INIT_POINTERS();
-
-    /* null chroma */
-    deltas[0] = deltas[1] = deltas[2] = deltas[3] = 0;
-    tm2_low_chroma(U, Ustride, clast, ctx->CD, deltas, bx);
-
-    deltas[0] = deltas[1] = deltas[2] = deltas[3] = 0;
-    tm2_low_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas, bx);
-
-    /* null luma */
-    for (i = 0; i < 16; i++)
-        deltas[i] = 0;
-
-    ct = ctx->D[0] + ctx->D[1] + ctx->D[2] + ctx->D[3];
-
-    if (bx > 0)
-        left = last[-1] - ct;
-    else
-        left = 0;
-
-    right   = last[3];
-    diff    = right - left;
-    last[0] = left + (diff >> 2);
-    last[1] = left + (diff >> 1);
-    last[2] = right - (diff >> 2);
-    last[3] = right;
-    {
-        int tp = left;
-
-        ctx->D[0] = (tp + (ct >> 2)) - left;
-        left     += ctx->D[0];
-        ctx->D[1] = (tp + (ct >> 1)) - left;
-        left     += ctx->D[1];
-        ctx->D[2] = ((tp + ct) - (ct >> 2)) - left;
-        left     += ctx->D[2];
-        ctx->D[3] = (tp + ct) - left;
-    }
-    tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
-}
-
-static inline void tm2_still_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
-    int i, j;
-    TM2_INIT_POINTERS_2();
-
-    /* update chroma */
-    for (j = 0; j < 2; j++) {
-        for (i = 0; i < 2; i++){
-            U[i] = Uo[i];
-            V[i] = Vo[i];
-        }
-        U  += Ustride; V += Vstride;
-        Uo += oUstride; Vo += oVstride;
-    }
-    U -= Ustride * 2;
-    V -= Vstride * 2;
-    TM2_RECALC_BLOCK(U, Ustride, clast, ctx->CD);
-    TM2_RECALC_BLOCK(V, Vstride, (clast + 2), (ctx->CD + 2));
-
-    /* update deltas */
-    ctx->D[0] = Yo[3] - last[3];
-    ctx->D[1] = Yo[3 + oYstride] - Yo[3];
-    ctx->D[2] = Yo[3 + oYstride * 2] - Yo[3 + oYstride];
-    ctx->D[3] = Yo[3 + oYstride * 3] - Yo[3 + oYstride * 2];
-
-    for (j = 0; j < 4; j++) {
-        for (i = 0; i < 4; i++) {
-            Y[i]    = Yo[i];
-            last[i] = Yo[i];
-        }
-        Y  += Ystride;
-        Yo += oYstride;
-    }
-}
-
-static inline void tm2_update_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
-    int i, j;
-    int d;
-    TM2_INIT_POINTERS_2();
-
-    /* update chroma */
-    for (j = 0; j < 2; j++) {
-        for (i = 0; i < 2; i++) {
-            U[i] = Uo[i] + GET_TOK(ctx, TM2_UPD);
-            V[i] = Vo[i] + GET_TOK(ctx, TM2_UPD);
-        }
-        U  += Ustride;
-        V  += Vstride;
-        Uo += oUstride;
-        Vo += oVstride;
-    }
-    U -= Ustride * 2;
-    V -= Vstride * 2;
-    TM2_RECALC_BLOCK(U, Ustride, clast, ctx->CD);
-    TM2_RECALC_BLOCK(V, Vstride, (clast + 2), (ctx->CD + 2));
-
-    /* update deltas */
-    ctx->D[0] = Yo[3] - last[3];
-    ctx->D[1] = Yo[3 + oYstride] - Yo[3];
-    ctx->D[2] = Yo[3 + oYstride * 2] - Yo[3 + oYstride];
-    ctx->D[3] = Yo[3 + oYstride * 3] - Yo[3 + oYstride * 2];
-
-    for (j = 0; j < 4; j++) {
-        d = last[3];
-        for (i = 0; i < 4; i++) {
-            Y[i]    = Yo[i] + GET_TOK(ctx, TM2_UPD);
-            last[i] = Y[i];
-        }
-        ctx->D[j] = last[3] - d;
-        Y  += Ystride;
-        Yo += oYstride;
-    }
-}
-
-static inline void tm2_motion_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
-    int i, j;
-    int mx, my;
-    TM2_INIT_POINTERS_2();
-
-    mx = GET_TOK(ctx, TM2_MOT);
-    my = GET_TOK(ctx, TM2_MOT);
-    mx = av_clip(mx, -(bx * 4 + 4), ctx->avctx->width  - bx * 4);
-    my = av_clip(my, -(by * 4 + 4), ctx->avctx->height - by * 4);
-
-    Yo += my * oYstride + mx;
-    Uo += (my >> 1) * oUstride + (mx >> 1);
-    Vo += (my >> 1) * oVstride + (mx >> 1);
-
-    /* copy chroma */
-    for (j = 0; j < 2; j++) {
-        for (i = 0; i < 2; i++) {
-            U[i] = Uo[i];
-            V[i] = Vo[i];
-        }
-        U  += Ustride;
-        V  += Vstride;
-        Uo += oUstride;
-        Vo += oVstride;
-    }
-    U -= Ustride * 2;
-    V -= Vstride * 2;
-    TM2_RECALC_BLOCK(U, Ustride, clast, ctx->CD);
-    TM2_RECALC_BLOCK(V, Vstride, (clast + 2), (ctx->CD + 2));
-
-    /* copy luma */
-    for (j = 0; j < 4; j++) {
-        for (i = 0; i < 4; i++) {
-            Y[i] = Yo[i];
-        }
-        Y  += Ystride;
-        Yo += oYstride;
-    }
-    /* calculate deltas */
-    Y -= Ystride * 4;
-    ctx->D[0] = Y[3] - last[3];
-    ctx->D[1] = Y[3 + Ystride] - Y[3];
-    ctx->D[2] = Y[3 + Ystride * 2] - Y[3 + Ystride];
-    ctx->D[3] = Y[3 + Ystride * 3] - Y[3 + Ystride * 2];
-    for (i = 0; i < 4; i++)
-        last[i] = Y[i + Ystride * 3];
-}
-
-static int tm2_decode_blocks(TM2Context *ctx, AVFrame *p)
-{
-    int i, j;
-    int w = ctx->avctx->width, h = ctx->avctx->height, bw = w >> 2, bh = h >> 2, cw = w >> 1;
-    int type;
-    int keyframe = 1;
-    int *Y, *U, *V;
-    uint8_t *dst;
-
-    for (i = 0; i < TM2_NUM_STREAMS; i++)
-        ctx->tok_ptrs[i] = 0;
-
-    if (ctx->tok_lens[TM2_TYPE]<bw*bh) {
-        av_log(ctx->avctx,AV_LOG_ERROR,"Got %i tokens for %i blocks\n",ctx->tok_lens[TM2_TYPE],bw*bh);
-        return AVERROR_INVALIDDATA;
-    }
-
-    memset(ctx->last, 0, 4 * bw * sizeof(int));
-    memset(ctx->clast, 0, 4 * bw * sizeof(int));
-
-    for (j = 0; j < bh; j++) {
-        memset(ctx->D, 0, 4 * sizeof(int));
-        memset(ctx->CD, 0, 4 * sizeof(int));
-        for (i = 0; i < bw; i++) {
-            type = GET_TOK(ctx, TM2_TYPE);
-            switch(type) {
-            case TM2_HI_RES:
-                tm2_hi_res_block(ctx, p, i, j);
-                break;
-            case TM2_MED_RES:
-                tm2_med_res_block(ctx, p, i, j);
-                break;
-            case TM2_LOW_RES:
-                tm2_low_res_block(ctx, p, i, j);
-                break;
-            case TM2_NULL_RES:
-                tm2_null_res_block(ctx, p, i, j);
-                break;
-            case TM2_UPDATE:
-                tm2_update_block(ctx, p, i, j);
-                keyframe = 0;
-                break;
-            case TM2_STILL:
-                tm2_still_block(ctx, p, i, j);
-                keyframe = 0;
-                break;
-            case TM2_MOTION:
-                tm2_motion_block(ctx, p, i, j);
-                keyframe = 0;
-                break;
-            default:
-                av_log(ctx->avctx, AV_LOG_ERROR, "Skipping unknown block type %i\n", type);
-            }
-        }
-    }
-
-    /* copy data from our buffer to AVFrame */
-    Y = (ctx->cur?ctx->Y2:ctx->Y1);
-    U = (ctx->cur?ctx->U2:ctx->U1);
-    V = (ctx->cur?ctx->V2:ctx->V1);
-    dst = p->data[0];
-    for (j = 0; j < h; j++) {
-        for (i = 0; i < w; i++) {
-            int y = Y[i], u = U[i >> 1], v = V[i >> 1];
-            dst[3*i+0] = av_clip_uint8(y + v);
-            dst[3*i+1] = av_clip_uint8(y);
-            dst[3*i+2] = av_clip_uint8(y + u);
-        }
-
-        /* horizontal edge extension */
-        Y[-4]    = Y[-3]    = Y[-2]    = Y[-1] = Y[0];
-        Y[w + 3] = Y[w + 2] = Y[w + 1] = Y[w]  = Y[w - 1];
-
-        /* vertical edge extension */
-        if (j == 0) {
-            memcpy(Y - 4 - 1 * ctx->y_stride, Y - 4, ctx->y_stride);
-            memcpy(Y - 4 - 2 * ctx->y_stride, Y - 4, ctx->y_stride);
-            memcpy(Y - 4 - 3 * ctx->y_stride, Y - 4, ctx->y_stride);
-            memcpy(Y - 4 - 4 * ctx->y_stride, Y - 4, ctx->y_stride);
-        } else if (j == h - 1) {
-            memcpy(Y - 4 + 1 * ctx->y_stride, Y - 4, ctx->y_stride);
-            memcpy(Y - 4 + 2 * ctx->y_stride, Y - 4, ctx->y_stride);
-            memcpy(Y - 4 + 3 * ctx->y_stride, Y - 4, ctx->y_stride);
-            memcpy(Y - 4 + 4 * ctx->y_stride, Y - 4, ctx->y_stride);
-        }
-
-        Y += ctx->y_stride;
-        if (j & 1) {
-            /* horizontal edge extension */
-            U[-2]     = U[-1] = U[0];
-            V[-2]     = V[-1] = V[0];
-            U[cw + 1] = U[cw] = U[cw - 1];
-            V[cw + 1] = V[cw] = V[cw - 1];
-
-            /* vertical edge extension */
-            if (j == 1) {
-                memcpy(U - 2 - 1 * ctx->uv_stride, U - 2, ctx->uv_stride);
-                memcpy(V - 2 - 1 * ctx->uv_stride, V - 2, ctx->uv_stride);
-                memcpy(U - 2 - 2 * ctx->uv_stride, U - 2, ctx->uv_stride);
-                memcpy(V - 2 - 2 * ctx->uv_stride, V - 2, ctx->uv_stride);
-            } else if (j == h - 1) {
-                memcpy(U - 2 + 1 * ctx->uv_stride, U - 2, ctx->uv_stride);
-                memcpy(V - 2 + 1 * ctx->uv_stride, V - 2, ctx->uv_stride);
-                memcpy(U - 2 + 2 * ctx->uv_stride, U - 2, ctx->uv_stride);
-                memcpy(V - 2 + 2 * ctx->uv_stride, V - 2, ctx->uv_stride);
-            }
-
-            U += ctx->uv_stride;
-            V += ctx->uv_stride;
-        }
-        dst += p->linesize[0];
-    }
-
-    return keyframe;
-}
-
-static const int tm2_stream_order[TM2_NUM_STREAMS] = {
-    TM2_C_HI, TM2_C_LO, TM2_L_HI, TM2_L_LO, TM2_UPD, TM2_MOT, TM2_TYPE
-};
-
-#define TM2_HEADER_SIZE 40
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    TM2Context * const l = avctx->priv_data;
-    const uint8_t *buf   = avpkt->data;
-    int buf_size         = avpkt->size & ~3;
-    AVFrame * const p    = l->pic;
-    int offset           = TM2_HEADER_SIZE;
-    int i, t, ret;
-    uint8_t *swbuf;
-
-    swbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!swbuf) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
-        return AVERROR(ENOMEM);
-    }
-
-    if ((ret = ff_reget_buffer(avctx, p)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        av_free(swbuf);
-        return ret;
-    }
-
-    l->dsp.bswap_buf((uint32_t*)swbuf, (const uint32_t*)buf, buf_size >> 2);
-
-    if ((ret = tm2_read_header(l, swbuf)) < 0) {
-        av_free(swbuf);
-        return ret;
-    }
-
-    for (i = 0; i < TM2_NUM_STREAMS; i++) {
-        if (offset >= buf_size) {
-            av_free(swbuf);
-            return AVERROR_INVALIDDATA;
-        }
-        t = tm2_read_stream(l, swbuf + offset, tm2_stream_order[i],
-                            buf_size - offset);
-        if (t < 0) {
-            av_free(swbuf);
-            return t;
-        }
-        offset += t;
-    }
-    p->key_frame = tm2_decode_blocks(l, p);
-    if (p->key_frame)
-        p->pict_type = AV_PICTURE_TYPE_I;
-    else
-        p->pict_type = AV_PICTURE_TYPE_P;
-
-    l->cur = !l->cur;
-    *got_frame      = 1;
-    ret = av_frame_ref(data, l->pic);
-    av_free(swbuf);
-
-    return (ret < 0) ? ret : buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    TM2Context * const l = avctx->priv_data;
-    int i, w = avctx->width, h = avctx->height;
-
-    if ((avctx->width & 3) || (avctx->height & 3)) {
-        av_log(avctx, AV_LOG_ERROR, "Width and height must be multiple of 4\n");
-        return AVERROR(EINVAL);
-    }
-
-    l->avctx       = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_BGR24;
-
-    l->pic = av_frame_alloc();
-    if (!l->pic)
-        return AVERROR(ENOMEM);
-
-    ff_dsputil_init(&l->dsp, avctx);
-
-    l->last  = av_malloc(4 * sizeof(*l->last)  * (w >> 2));
-    l->clast = av_malloc(4 * sizeof(*l->clast) * (w >> 2));
-
-    for (i = 0; i < TM2_NUM_STREAMS; i++) {
-        l->tokens[i] = NULL;
-        l->tok_lens[i] = 0;
-    }
-
-    w += 8;
-    h += 8;
-    l->Y1_base = av_malloc(sizeof(*l->Y1_base) * w * h);
-    l->Y2_base = av_malloc(sizeof(*l->Y2_base) * w * h);
-    l->y_stride = w;
-    w = (w + 1) >> 1;
-    h = (h + 1) >> 1;
-    l->U1_base = av_malloc(sizeof(*l->U1_base) * w * h);
-    l->V1_base = av_malloc(sizeof(*l->V1_base) * w * h);
-    l->U2_base = av_malloc(sizeof(*l->U2_base) * w * h);
-    l->V2_base = av_malloc(sizeof(*l->V1_base) * w * h);
-    l->uv_stride = w;
-    l->cur = 0;
-    if (!l->Y1_base || !l->Y2_base || !l->U1_base ||
-        !l->V1_base || !l->U2_base || !l->V2_base ||
-        !l->last    || !l->clast) {
-        av_freep(&l->Y1_base);
-        av_freep(&l->Y2_base);
-        av_freep(&l->U1_base);
-        av_freep(&l->U2_base);
-        av_freep(&l->V1_base);
-        av_freep(&l->V2_base);
-        av_freep(&l->last);
-        av_freep(&l->clast);
-        return AVERROR(ENOMEM);
-    }
-    l->Y1 = l->Y1_base + l->y_stride  * 4 + 4;
-    l->Y2 = l->Y2_base + l->y_stride  * 4 + 4;
-    l->U1 = l->U1_base + l->uv_stride * 2 + 2;
-    l->U2 = l->U2_base + l->uv_stride * 2 + 2;
-    l->V1 = l->V1_base + l->uv_stride * 2 + 2;
-    l->V2 = l->V2_base + l->uv_stride * 2 + 2;
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    TM2Context * const l = avctx->priv_data;
-    int i;
-
-    av_free(l->last);
-    av_free(l->clast);
-    for (i = 0; i < TM2_NUM_STREAMS; i++)
-        av_free(l->tokens[i]);
-    if (l->Y1) {
-        av_free(l->Y1_base);
-        av_free(l->U1_base);
-        av_free(l->V1_base);
-        av_free(l->Y2_base);
-        av_free(l->U2_base);
-        av_free(l->V2_base);
-    }
-
-    av_frame_free(&l->pic);
-
-    return 0;
-}
-
-AVCodec ff_truemotion2_decoder = {
-    .name           = "truemotion2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TRUEMOTION2,
-    .priv_data_size = sizeof(TM2Context),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/truespeech.c b/deps/libav/libavcodec/truespeech.c
deleted file mode 100644
index 3f56973..0000000
--- a/deps/libav/libavcodec/truespeech.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * DSP Group TrueSpeech compatible decoder
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "internal.h"
-
-#include "truespeech_data.h"
-/**
- * @file
- * TrueSpeech decoder.
- */
-
-/**
- * TrueSpeech decoder context
- */
-typedef struct {
-    DSPContext dsp;
-    /* input data */
-    DECLARE_ALIGNED(16, uint8_t, buffer)[32];
-    int16_t vector[8];  ///< input vector: 5/5/4/4/4/3/3/3
-    int offset1[2];     ///< 8-bit value, used in one copying offset
-    int offset2[4];     ///< 7-bit value, encodes offsets for copying and for two-point filter
-    int pulseoff[4];    ///< 4-bit offset of pulse values block
-    int pulsepos[4];    ///< 27-bit variable, encodes 7 pulse positions
-    int pulseval[4];    ///< 7x2-bit pulse values
-    int flag;           ///< 1-bit flag, shows how to choose filters
-    /* temporary data */
-    int filtbuf[146];   // some big vector used for storing filters
-    int prevfilt[8];    // filter from previous frame
-    int16_t tmp1[8];    // coefficients for adding to out
-    int16_t tmp2[8];    // coefficients for adding to out
-    int16_t tmp3[8];    // coefficients for adding to out
-    int16_t cvector[8]; // correlated input vector
-    int filtval;        // gain value for one function
-    int16_t newvec[60]; // tmp vector
-    int16_t filters[32]; // filters for every subframe
-} TSContext;
-
-static av_cold int truespeech_decode_init(AVCodecContext * avctx)
-{
-    TSContext *c = avctx->priv_data;
-
-    if (avctx->channels != 1) {
-        avpriv_request_sample(avctx, "Channel count %d", avctx->channels);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_S16;
-
-    ff_dsputil_init(&c->dsp, avctx);
-
-    return 0;
-}
-
-static void truespeech_read_frame(TSContext *dec, const uint8_t *input)
-{
-    GetBitContext gb;
-
-    dec->dsp.bswap_buf((uint32_t *)dec->buffer, (const uint32_t *)input, 8);
-    init_get_bits(&gb, dec->buffer, 32 * 8);
-
-    dec->vector[7] = ts_codebook[7][get_bits(&gb, 3)];
-    dec->vector[6] = ts_codebook[6][get_bits(&gb, 3)];
-    dec->vector[5] = ts_codebook[5][get_bits(&gb, 3)];
-    dec->vector[4] = ts_codebook[4][get_bits(&gb, 4)];
-    dec->vector[3] = ts_codebook[3][get_bits(&gb, 4)];
-    dec->vector[2] = ts_codebook[2][get_bits(&gb, 4)];
-    dec->vector[1] = ts_codebook[1][get_bits(&gb, 5)];
-    dec->vector[0] = ts_codebook[0][get_bits(&gb, 5)];
-    dec->flag      = get_bits1(&gb);
-
-    dec->offset1[0] = get_bits(&gb, 4) << 4;
-    dec->offset2[3] = get_bits(&gb, 7);
-    dec->offset2[2] = get_bits(&gb, 7);
-    dec->offset2[1] = get_bits(&gb, 7);
-    dec->offset2[0] = get_bits(&gb, 7);
-
-    dec->offset1[1]  = get_bits(&gb, 4);
-    dec->pulseval[1] = get_bits(&gb, 14);
-    dec->pulseval[0] = get_bits(&gb, 14);
-
-    dec->offset1[1] |= get_bits(&gb, 4) << 4;
-    dec->pulseval[3] = get_bits(&gb, 14);
-    dec->pulseval[2] = get_bits(&gb, 14);
-
-    dec->offset1[0] |= get_bits1(&gb);
-    dec->pulsepos[0] = get_bits_long(&gb, 27);
-    dec->pulseoff[0] = get_bits(&gb, 4);
-
-    dec->offset1[0] |= get_bits1(&gb) << 1;
-    dec->pulsepos[1] = get_bits_long(&gb, 27);
-    dec->pulseoff[1] = get_bits(&gb, 4);
-
-    dec->offset1[0] |= get_bits1(&gb) << 2;
-    dec->pulsepos[2] = get_bits_long(&gb, 27);
-    dec->pulseoff[2] = get_bits(&gb, 4);
-
-    dec->offset1[0] |= get_bits1(&gb) << 3;
-    dec->pulsepos[3] = get_bits_long(&gb, 27);
-    dec->pulseoff[3] = get_bits(&gb, 4);
-}
-
-static void truespeech_correlate_filter(TSContext *dec)
-{
-    int16_t tmp[8];
-    int i, j;
-
-    for(i = 0; i < 8; i++){
-        if(i > 0){
-            memcpy(tmp, dec->cvector, i * sizeof(*tmp));
-            for(j = 0; j < i; j++)
-                dec->cvector[j] = ((tmp[i - j - 1] * dec->vector[i]) +
-                                   (dec->cvector[j] << 15) + 0x4000) >> 15;
-        }
-        dec->cvector[i] = (8 - dec->vector[i]) >> 3;
-    }
-    for(i = 0; i < 8; i++)
-        dec->cvector[i] = (dec->cvector[i] * ts_decay_994_1000[i]) >> 15;
-
-    dec->filtval = dec->vector[0];
-}
-
-static void truespeech_filters_merge(TSContext *dec)
-{
-    int i;
-
-    if(!dec->flag){
-        for(i = 0; i < 8; i++){
-            dec->filters[i + 0] = dec->prevfilt[i];
-            dec->filters[i + 8] = dec->prevfilt[i];
-        }
-    }else{
-        for(i = 0; i < 8; i++){
-            dec->filters[i + 0]=(dec->cvector[i] * 21846 + dec->prevfilt[i] * 10923 + 16384) >> 15;
-            dec->filters[i + 8]=(dec->cvector[i] * 10923 + dec->prevfilt[i] * 21846 + 16384) >> 15;
-        }
-    }
-    for(i = 0; i < 8; i++){
-        dec->filters[i + 16] = dec->cvector[i];
-        dec->filters[i + 24] = dec->cvector[i];
-    }
-}
-
-static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)
-{
-    int16_t tmp[146 + 60], *ptr0, *ptr1;
-    const int16_t *filter;
-    int i, t, off;
-
-    t = dec->offset2[quart];
-    if(t == 127){
-        memset(dec->newvec, 0, 60 * sizeof(*dec->newvec));
-        return;
-    }
-    for(i = 0; i < 146; i++)
-        tmp[i] = dec->filtbuf[i];
-    off = (t / 25) + dec->offset1[quart >> 1] + 18;
-    off = av_clip(off, 0, 145);
-    ptr0 = tmp + 145 - off;
-    ptr1 = tmp + 146;
-    filter = ts_order2_coeffs + (t % 25) * 2;
-    for(i = 0; i < 60; i++){
-        t = (ptr0[0] * filter[0] + ptr0[1] * filter[1] + 0x2000) >> 14;
-        ptr0++;
-        dec->newvec[i] = t;
-        ptr1[i] = t;
-    }
-}
-
-static void truespeech_place_pulses(TSContext *dec, int16_t *out, int quart)
-{
-    int16_t tmp[7];
-    int i, j, t;
-    const int16_t *ptr1;
-    int16_t *ptr2;
-    int coef;
-
-    memset(out, 0, 60 * sizeof(*out));
-    for(i = 0; i < 7; i++) {
-        t = dec->pulseval[quart] & 3;
-        dec->pulseval[quart] >>= 2;
-        tmp[6 - i] = ts_pulse_scales[dec->pulseoff[quart] * 4 + t];
-    }
-
-    coef = dec->pulsepos[quart] >> 15;
-    ptr1 = ts_pulse_values + 30;
-    ptr2 = tmp;
-    for(i = 0, j = 3; (i < 30) && (j > 0); i++){
-        t = *ptr1++;
-        if(coef >= t)
-            coef -= t;
-        else{
-            out[i] = *ptr2++;
-            ptr1 += 30;
-            j--;
-        }
-    }
-    coef = dec->pulsepos[quart] & 0x7FFF;
-    ptr1 = ts_pulse_values;
-    for(i = 30, j = 4; (i < 60) && (j > 0); i++){
-        t = *ptr1++;
-        if(coef >= t)
-            coef -= t;
-        else{
-            out[i] = *ptr2++;
-            ptr1 += 30;
-            j--;
-        }
-    }
-
-}
-
-static void truespeech_update_filters(TSContext *dec, int16_t *out, int quart)
-{
-    int i;
-
-    memmove(dec->filtbuf, &dec->filtbuf[60], 86 * sizeof(*dec->filtbuf));
-    for(i = 0; i < 60; i++){
-        dec->filtbuf[i + 86] = out[i] + dec->newvec[i] - (dec->newvec[i] >> 3);
-        out[i] += dec->newvec[i];
-    }
-}
-
-static void truespeech_synth(TSContext *dec, int16_t *out, int quart)
-{
-    int i,k;
-    int t[8];
-    int16_t *ptr0, *ptr1;
-
-    ptr0 = dec->tmp1;
-    ptr1 = dec->filters + quart * 8;
-    for(i = 0; i < 60; i++){
-        int sum = 0;
-        for(k = 0; k < 8; k++)
-            sum += ptr0[k] * ptr1[k];
-        sum = (sum + (out[i] << 12) + 0x800) >> 12;
-        out[i] = av_clip(sum, -0x7FFE, 0x7FFE);
-        for(k = 7; k > 0; k--)
-            ptr0[k] = ptr0[k - 1];
-        ptr0[0] = out[i];
-    }
-
-    for(i = 0; i < 8; i++)
-        t[i] = (ts_decay_35_64[i] * ptr1[i]) >> 15;
-
-    ptr0 = dec->tmp2;
-    for(i = 0; i < 60; i++){
-        int sum = 0;
-        for(k = 0; k < 8; k++)
-            sum += ptr0[k] * t[k];
-        for(k = 7; k > 0; k--)
-            ptr0[k] = ptr0[k - 1];
-        ptr0[0] = out[i];
-        out[i] = ((out[i] << 12) - sum) >> 12;
-    }
-
-    for(i = 0; i < 8; i++)
-        t[i] = (ts_decay_3_4[i] * ptr1[i]) >> 15;
-
-    ptr0 = dec->tmp3;
-    for(i = 0; i < 60; i++){
-        int sum = out[i] << 12;
-        for(k = 0; k < 8; k++)
-            sum += ptr0[k] * t[k];
-        for(k = 7; k > 0; k--)
-            ptr0[k] = ptr0[k - 1];
-        ptr0[0] = av_clip((sum + 0x800) >> 12, -0x7FFE, 0x7FFE);
-
-        sum = ((ptr0[1] * (dec->filtval - (dec->filtval >> 2))) >> 4) + sum;
-        sum = sum - (sum >> 3);
-        out[i] = av_clip((sum + 0x800) >> 12, -0x7FFE, 0x7FFE);
-    }
-}
-
-static void truespeech_save_prevvec(TSContext *c)
-{
-    int i;
-
-    for(i = 0; i < 8; i++)
-        c->prevfilt[i] = c->cvector[i];
-}
-
-static int truespeech_decode_frame(AVCodecContext *avctx, void *data,
-                                   int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    TSContext *c = avctx->priv_data;
-
-    int i, j;
-    int16_t *samples;
-    int iterations, ret;
-
-    iterations = buf_size / 32;
-
-    if (!iterations) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Too small input buffer (%d bytes), need at least 32 bytes\n", buf_size);
-        return -1;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = iterations * 240;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (int16_t *)frame->data[0];
-
-    memset(samples, 0, iterations * 240 * sizeof(*samples));
-
-    for(j = 0; j < iterations; j++) {
-        truespeech_read_frame(c, buf);
-        buf += 32;
-
-        truespeech_correlate_filter(c);
-        truespeech_filters_merge(c);
-
-        for(i = 0; i < 4; i++) {
-            truespeech_apply_twopoint_filter(c, i);
-            truespeech_place_pulses  (c, samples, i);
-            truespeech_update_filters(c, samples, i);
-            truespeech_synth         (c, samples, i);
-            samples += 60;
-        }
-
-        truespeech_save_prevvec(c);
-    }
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_truespeech_decoder = {
-    .name           = "truespeech",
-    .long_name      = NULL_IF_CONFIG_SMALL("DSP Group TrueSpeech"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_TRUESPEECH,
-    .priv_data_size = sizeof(TSContext),
-    .init           = truespeech_decode_init,
-    .decode         = truespeech_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/truespeech_data.h b/deps/libav/libavcodec/truespeech_data.h
deleted file mode 100644
index 6e9806a..0000000
--- a/deps/libav/libavcodec/truespeech_data.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * DSP Group TrueSpeech compatible decoder
- * copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_TRUESPEECH_DATA_H
-#define AVCODEC_TRUESPEECH_DATA_H
-
-#include <stdint.h>
-
-/* codebooks fo expanding input filter */
-static const int16_t ts_cb_0[32] = {
-    0x8240, 0x8364, 0x84CE, 0x865D, 0x8805, 0x89DE, 0x8BD7, 0x8DF4,
-    0x9051, 0x92E2, 0x95DE, 0x990F, 0x9C81, 0xA079, 0xA54C, 0xAAD2,
-    0xB18A, 0xB90A, 0xC124, 0xC9CC, 0xD339, 0xDDD3, 0xE9D6, 0xF893,
-    0x096F, 0x1ACA, 0x29EC, 0x381F, 0x45F9, 0x546A, 0x63C3, 0x73B5,
-};
-
-static const int16_t ts_cb_1[32] = {
-    0x9F65, 0xB56B, 0xC583, 0xD371, 0xE018, 0xEBB4, 0xF61C, 0xFF59,
-    0x085B, 0x1106, 0x1952, 0x214A, 0x28C9, 0x2FF8, 0x36E6, 0x3D92,
-    0x43DF, 0x49BB, 0x4F46, 0x5467, 0x5930, 0x5DA3, 0x61EC, 0x65F9,
-    0x69D4, 0x6D5A, 0x709E, 0x73AD, 0x766B, 0x78F0, 0x7B5A, 0x7DA5,
-};
-
-static const int16_t ts_cb_2[16] = {
-    0x96F8, 0xA3B4, 0xAF45, 0xBA53, 0xC4B1, 0xCECC, 0xD86F, 0xE21E,
-    0xEBF3, 0xF640, 0x00F7, 0x0C20, 0x1881, 0x269A, 0x376B, 0x4D60,
-};
-
-static const int16_t ts_cb_3[16] = {
-    0xC654, 0xDEF2, 0xEFAA, 0xFD94, 0x096A, 0x143F, 0x1E7B, 0x282C,
-    0x3176, 0x3A89, 0x439F, 0x4CA2, 0x557F, 0x5E50, 0x6718, 0x6F8D,
-};
-
-static const int16_t ts_cb_4[16] = {
-    0xABE7, 0xBBA8, 0xC81C, 0xD326, 0xDD0E, 0xE5D4, 0xEE22, 0xF618,
-    0xFE28, 0x064F, 0x0EB7, 0x17B8, 0x21AA, 0x2D8B, 0x3BA2, 0x4DF9,
-};
-
-static const int16_t ts_cb_5[8] = {
-    0xD51B, 0xF12E, 0x042E, 0x13C7, 0x2260, 0x311B, 0x40DE, 0x5385,
-};
-
-static const int16_t ts_cb_6[8] = {
-    0xB550, 0xC825, 0xD980, 0xE997, 0xF883, 0x0752, 0x1811, 0x2E18,
-};
-
-static const int16_t ts_cb_7[8] = {
-    0xCEF0, 0xE4F9, 0xF6BB, 0x0646, 0x14F5, 0x23FF, 0x356F, 0x4A8D,
-};
-
-static const int16_t * const ts_codebook[8] = {
-    ts_cb_0, ts_cb_1, ts_cb_2, ts_cb_3, ts_cb_4, ts_cb_5, ts_cb_6, ts_cb_7
-};
-
-/* table used for decoding pulse positions */
-static const int16_t ts_pulse_values[120] = {
-    0x0E46, 0x0CCC, 0x0B6D, 0x0A28, 0x08FC, 0x07E8, 0x06EB, 0x0604,
-    0x0532, 0x0474, 0x03C9, 0x0330, 0x02A8, 0x0230, 0x01C7, 0x016C,
-    0x011E, 0x00DC, 0x00A5, 0x0078, 0x0054, 0x0038, 0x0023, 0x0014,
-    0x000A, 0x0004, 0x0001, 0x0000, 0x0000, 0x0000,
-
-    0x0196, 0x017A, 0x015F, 0x0145, 0x012C, 0x0114, 0x00FD, 0x00E7,
-    0x00D2, 0x00BE, 0x00AB, 0x0099, 0x0088, 0x0078, 0x0069, 0x005B,
-    0x004E, 0x0042, 0x0037, 0x002D, 0x0024, 0x001C, 0x0015, 0x000F,
-    0x000A, 0x0006, 0x0003, 0x0001, 0x0000, 0x0000,
-
-    0x001D, 0x001C, 0x001B, 0x001A, 0x0019, 0x0018, 0x0017, 0x0016,
-    0x0015, 0x0014, 0x0013, 0x0012, 0x0011, 0x0010, 0x000F, 0x000E,
-    0x000D, 0x000C, 0x000B, 0x000A, 0x0009, 0x0008, 0x0007, 0x0006,
-    0x0005, 0x0004, 0x0003, 0x0002, 0x0001, 0x0000,
-
-    0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
-    0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
-    0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
-    0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001
-};
-
-/* filter for correlated input filter */
-static const int16_t ts_decay_994_1000[8] =
-    { 0x7F3B, 0x7E78, 0x7DB6, 0x7CF5, 0x7C35, 0x7B76, 0x7AB8, 0x79FC };
-
-/* two-point filters table */
-static const int16_t ts_order2_coeffs[25 * 2] = {
-    0xED2F, 0x5239,
-    0x54F1, 0xE4A9,
-    0x2620, 0xEE3E,
-    0x09D6, 0x2C40,
-    0xEFB5, 0x2BE0,
-
-    0x3FE1, 0x3339,
-    0x442F, 0xE6FE,
-    0x4458, 0xF9DF,
-    0xF231, 0x43DB,
-    0x3DB0, 0xF705,
-
-    0x4F7B, 0xFEFB,
-    0x26AD, 0x0CDC,
-    0x33C2, 0x0739,
-    0x12BE, 0x43A2,
-    0x1BDF, 0x1F3E,
-
-    0x0211, 0x0796,
-    0x2AEB, 0x163F,
-    0x050D, 0x3A38,
-    0x0D1E, 0x0D78,
-    0x150F, 0x3346,
-
-    0x38A4, 0x0B7D,
-    0x2D5D, 0x1FDF,
-    0x19B7, 0x2822,
-    0x0D99, 0x1F12,
-    0x194C, 0x0CE6
-};
-
-/* possible pulse values */
-static const int16_t ts_pulse_scales[64] = {
-    0x0002, 0x0006, 0xFFFE, 0xFFFA,
-    0x0004, 0x000C, 0xFFFC, 0xFFF4,
-    0x0006, 0x0012, 0xFFFA, 0xFFEE,
-    0x000A, 0x001E, 0xFFF6, 0xFFE2,
-    0x0010, 0x0030, 0xFFF0, 0xFFD0,
-    0x0019, 0x004B, 0xFFE7, 0xFFB5,
-    0x0028, 0x0078, 0xFFD8, 0xFF88,
-    0x0040, 0x00C0, 0xFFC0, 0xFF40,
-    0x0065, 0x012F, 0xFF9B, 0xFED1,
-    0x00A1, 0x01E3, 0xFF5F, 0xFE1D,
-    0x0100, 0x0300, 0xFF00, 0xFD00,
-    0x0196, 0x04C2, 0xFE6A, 0xFB3E,
-    0x0285, 0x078F, 0xFD7B, 0xF871,
-    0x0400, 0x0C00, 0xFC00, 0xF400,
-    0x0659, 0x130B, 0xF9A7, 0xECF5,
-    0x0A14, 0x1E3C, 0xF5EC, 0xE1C4
-};
-
-/* filters used in final output calculations */
-static const int16_t ts_decay_35_64[8] =
-    { 0x4666, 0x26B8, 0x154C, 0x0BB6, 0x0671, 0x038B, 0x01F3, 0x0112 };
-static const int16_t ts_decay_3_4[8] =
-    { 0x6000, 0x4800, 0x3600, 0x2880, 0x1E60, 0x16C8, 0x1116, 0x0CD1 };
-
-#endif /* AVCODEC_TRUESPEECH_DATA_H */
diff --git a/deps/libav/libavcodec/tscc.c b/deps/libav/libavcodec/tscc.c
deleted file mode 100644
index c26853e..0000000
--- a/deps/libav/libavcodec/tscc.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * TechSmith Camtasia decoder
- * Copyright (c) 2004 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * TechSmith Camtasia decoder
- *
- * Fourcc: TSCC
- *
- * Codec is very simple:
- *  it codes picture (picture difference, really)
- *  with algorithm almost identical to Windows RLE8,
- *  only without padding and with greater pixel sizes,
- *  then this coded picture is packed with ZLib
- *
- * Supports: BGR8,BGR555,BGR24 - only BGR8 and BGR555 tested
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "msrledec.h"
-
-#include <zlib.h>
-
-typedef struct TsccContext {
-
-    AVCodecContext *avctx;
-
-    // Bits per pixel
-    int bpp;
-    // Decompressed data size
-    unsigned int decomp_size;
-    // Decompression buffer
-    unsigned char* decomp_buf;
-    GetByteContext gb;
-    int height;
-    z_stream zstream;
-
-    uint32_t pal[256];
-} CamtasiaContext;
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    CamtasiaContext * const c = avctx->priv_data;
-    const unsigned char *encoded = buf;
-    AVFrame *frame = data;
-    int zret; // Zlib return code
-    int ret, len = buf_size;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0){
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    zret = inflateReset(&c->zstream);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
-        return AVERROR_UNKNOWN;
-    }
-    c->zstream.next_in = encoded;
-    c->zstream.avail_in = len;
-    c->zstream.next_out = c->decomp_buf;
-    c->zstream.avail_out = c->decomp_size;
-    zret = inflate(&c->zstream, Z_FINISH);
-    // Z_DATA_ERROR means empty picture
-    if ((zret != Z_OK) && (zret != Z_STREAM_END) && (zret != Z_DATA_ERROR)) {
-        av_log(avctx, AV_LOG_ERROR, "Inflate error: %d\n", zret);
-        return AVERROR_UNKNOWN;
-    }
-
-
-    if (zret != Z_DATA_ERROR) {
-        bytestream2_init(&c->gb, c->decomp_buf,
-                         c->decomp_size - c->zstream.avail_out);
-        ff_msrle_decode(avctx, (AVPicture*)frame, c->bpp, &c->gb);
-    }
-
-    /* make the palette available on the way out */
-    if (c->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
-        const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-
-        if (pal) {
-            frame->palette_has_changed = 1;
-            memcpy(c->pal, pal, AVPALETTE_SIZE);
-        }
-        memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
-    }
-
-    *got_frame      = 1;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    CamtasiaContext * const c = avctx->priv_data;
-    int zret; // Zlib return code
-
-    c->avctx = avctx;
-
-    c->height = avctx->height;
-
-    // Needed if zlib unused or init aborted before inflateInit
-    memset(&c->zstream, 0, sizeof(z_stream));
-    switch(avctx->bits_per_coded_sample){
-    case  8: avctx->pix_fmt = AV_PIX_FMT_PAL8; break;
-    case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
-    case 24:
-             avctx->pix_fmt = AV_PIX_FMT_BGR24;
-             break;
-    case 32: avctx->pix_fmt = AV_PIX_FMT_RGB32; break;
-    default: av_log(avctx, AV_LOG_ERROR, "Camtasia error: unknown depth %i bpp\n", avctx->bits_per_coded_sample);
-             return AVERROR_INVALIDDATA;
-    }
-    c->bpp = avctx->bits_per_coded_sample;
-    // buffer size for RLE 'best' case when 2-byte code precedes each pixel and there may be padding after it too
-    c->decomp_size = (((avctx->width * c->bpp + 7) >> 3) + 3 * avctx->width + 2) * avctx->height + 2;
-
-    /* Allocate decompression buffer */
-    if (c->decomp_size) {
-        if ((c->decomp_buf = av_malloc(c->decomp_size)) == NULL) {
-            av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    c->zstream.zalloc = Z_NULL;
-    c->zstream.zfree = Z_NULL;
-    c->zstream.opaque = Z_NULL;
-    zret = inflateInit(&c->zstream);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
-        return AVERROR_UNKNOWN;
-    }
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    CamtasiaContext * const c = avctx->priv_data;
-
-    av_freep(&c->decomp_buf);
-
-    inflateEnd(&c->zstream);
-
-    return 0;
-}
-
-AVCodec ff_tscc_decoder = {
-    .name           = "camtasia",
-    .long_name      = NULL_IF_CONFIG_SMALL("TechSmith Screen Capture Codec"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TSCC,
-    .priv_data_size = sizeof(CamtasiaContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/tscc2.c b/deps/libav/libavcodec/tscc2.c
deleted file mode 100644
index 3d22fd7..0000000
--- a/deps/libav/libavcodec/tscc2.c
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- * TechSmith Screen Codec 2 (aka Dora) decoder
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * TechSmith Screen Codec 2 decoder
- */
-
-#define BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "get_bits.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "tscc2data.h"
-
-typedef struct TSCC2Context {
-    AVCodecContext *avctx;
-    AVFrame       *pic;
-    int            mb_width, mb_height;
-    uint8_t        *slice_quants;
-    int            quant[2];
-    int            q[2][3];
-    GetBitContext  gb;
-
-    VLC            dc_vlc, nc_vlc[NUM_VLC_SETS], ac_vlc[NUM_VLC_SETS];
-    int            block[16];
-} TSCC2Context;
-
-static av_cold void free_vlcs(TSCC2Context *c)
-{
-    int i;
-
-    ff_free_vlc(&c->dc_vlc);
-    for (i = 0; i < NUM_VLC_SETS; i++) {
-        ff_free_vlc(c->nc_vlc + i);
-        ff_free_vlc(c->ac_vlc + i);
-    }
-}
-
-static av_cold int init_vlcs(TSCC2Context *c)
-{
-    int i, ret;
-
-    ret = ff_init_vlc_sparse(&c->dc_vlc, 9, DC_VLC_COUNT,
-                             tscc2_dc_vlc_bits,  1, 1,
-                             tscc2_dc_vlc_codes, 2, 2,
-                             tscc2_dc_vlc_syms,  2, 2, INIT_VLC_LE);
-    if (ret)
-        return ret;
-
-    for (i = 0; i < NUM_VLC_SETS; i++) {
-        ret = ff_init_vlc_sparse(c->nc_vlc + i, 9, 16,
-                                 tscc2_nc_vlc_bits[i],  1, 1,
-                                 tscc2_nc_vlc_codes[i], 2, 2,
-                                 tscc2_nc_vlc_syms,     1, 1, INIT_VLC_LE);
-        if (ret) {
-            free_vlcs(c);
-            return ret;
-        }
-        ret = ff_init_vlc_sparse(c->ac_vlc + i, 9, tscc2_ac_vlc_sizes[i],
-                                 tscc2_ac_vlc_bits[i],  1, 1,
-                                 tscc2_ac_vlc_codes[i], 2, 2,
-                                 tscc2_ac_vlc_syms[i],  2, 2, INIT_VLC_LE);
-        if (ret) {
-            free_vlcs(c);
-            return ret;
-        }
-    }
-
-    return 0;
-}
-
-#define DEQUANT(val, q) ((q * val + 0x80) >> 8)
-#define DCT1D(d0, d1, d2, d3, s0, s1, s2, s3, OP) \
-    OP(d0, 5 * ((s0) + (s1) + (s2)) + 2 * (s3));  \
-    OP(d1, 5 * ((s0) - (s2) - (s3)) + 2 * (s1));  \
-    OP(d2, 5 * ((s0) - (s2) + (s3)) - 2 * (s1));  \
-    OP(d3, 5 * ((s0) - (s1) + (s2)) - 2 * (s3));  \
-
-#define COL_OP(a, b)  a = b
-#define ROW_OP(a, b)  a = ((b) + 0x20) >> 6
-
-static void tscc2_idct4_put(int *in, int q[3], uint8_t *dst, int stride)
-{
-    int i;
-    int tblk[4 * 4];
-    int t0, t1, t2, t3;
-
-    for (i = 0; i < 4; i++) {
-        t0 = DEQUANT(q[0 + (i & 1)], in[0 * 4 + i]);
-        t1 = DEQUANT(q[1 + (i & 1)], in[1 * 4 + i]);
-        t2 = DEQUANT(q[0 + (i & 1)], in[2 * 4 + i]);
-        t3 = DEQUANT(q[1 + (i & 1)], in[3 * 4 + i]);
-        DCT1D(tblk[0 * 4 + i], tblk[1 * 4 + i],
-              tblk[2 * 4 + i], tblk[3 * 4 + i],
-              t0, t1, t2, t3, COL_OP);
-    }
-    for (i = 0; i < 4; i++) {
-        DCT1D(dst[0], dst[1], dst[2], dst[3],
-              tblk[i * 4 + 0], tblk[i * 4 + 1],
-              tblk[i * 4 + 2], tblk[i * 4 + 3], ROW_OP);
-        dst += stride;
-    }
-}
-
-static int tscc2_decode_mb(TSCC2Context *c, int *q, int vlc_set,
-                           uint8_t *dst, int stride, int plane)
-{
-    GetBitContext *gb = &c->gb;
-    int prev_dc, dc, nc, ac, bpos, val;
-    int i, j, k, l;
-
-    if (get_bits1(gb)) {
-        if (get_bits1(gb)) {
-            val = get_bits(gb, 8);
-            for (i = 0; i < 8; i++, dst += stride)
-                memset(dst, val, 16);
-        } else {
-            if (get_bits_left(gb) < 16 * 8 * 8)
-                return AVERROR_INVALIDDATA;
-            for (i = 0; i < 8; i++) {
-                for (j = 0; j < 16; j++)
-                    dst[j] = get_bits(gb, 8);
-                dst += stride;
-            }
-        }
-        return 0;
-    }
-
-    prev_dc = 0;
-    for (j = 0; j < 2; j++) {
-        for (k = 0; k < 4; k++) {
-            if (!(j | k)) {
-                dc = get_bits(gb, 8);
-            } else {
-                dc = get_vlc2(gb, c->dc_vlc.table, 9, 2);
-                if (dc == -1)
-                    return AVERROR_INVALIDDATA;
-                if (dc == 0x100)
-                    dc = get_bits(gb, 8);
-            }
-            dc          = (dc + prev_dc) & 0xFF;
-            prev_dc     = dc;
-            c->block[0] = dc;
-
-            nc = get_vlc2(gb, c->nc_vlc[vlc_set].table, 9, 1);
-            if (nc == -1)
-                return AVERROR_INVALIDDATA;
-
-            bpos = 1;
-            memset(c->block + 1, 0, 15 * sizeof(*c->block));
-            for (l = 0; l < nc; l++) {
-                ac = get_vlc2(gb, c->ac_vlc[vlc_set].table, 9, 2);
-                if (ac == -1)
-                    return AVERROR_INVALIDDATA;
-                if (ac == 0x1000)
-                    ac = get_bits(gb, 12);
-                bpos += ac & 0xF;
-                if (bpos >= 16)
-                    return AVERROR_INVALIDDATA;
-                val = sign_extend(ac >> 4, 8);
-                c->block[tscc2_zigzag[bpos++]] = val;
-            }
-            tscc2_idct4_put(c->block, q, dst + k * 4, stride);
-        }
-        dst += 4 * stride;
-    }
-    return 0;
-}
-
-static int tscc2_decode_slice(TSCC2Context *c, int mb_y,
-                              const uint8_t *buf, int buf_size)
-{
-    int i, mb_x, q, ret;
-    int off;
-
-    init_get_bits(&c->gb, buf, buf_size * 8);
-
-    for (mb_x = 0; mb_x < c->mb_width; mb_x++) {
-        q = c->slice_quants[mb_x + c->mb_width * mb_y];
-
-        if (q == 0 || q == 3) // skip block
-            continue;
-        for (i = 0; i < 3; i++) {
-            off = mb_x * 16 + mb_y * 8 * c->pic->linesize[i];
-            ret = tscc2_decode_mb(c, c->q[q - 1], c->quant[q - 1] - 2,
-                                  c->pic->data[i] + off, c->pic->linesize[i], i);
-            if (ret)
-                return ret;
-        }
-    }
-
-    return 0;
-}
-
-static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
-                              int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    TSCC2Context *c = avctx->priv_data;
-    GetByteContext gb;
-    uint32_t frame_type, size;
-    int i, val, len, pos = 0;
-    int num_mb = c->mb_width * c->mb_height;
-    int ret;
-
-    bytestream2_init(&gb, buf, buf_size);
-    frame_type = bytestream2_get_byte(&gb);
-    if (frame_type > 1) {
-        av_log(avctx, AV_LOG_ERROR, "Incorrect frame type %d\n", frame_type);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    if (frame_type == 0) {
-        *got_frame      = 1;
-        if ((ret = av_frame_ref(data, c->pic)) < 0)
-            return ret;
-
-        return buf_size;
-    }
-
-    if (bytestream2_get_bytes_left(&gb) < 4) {
-        av_log(avctx, AV_LOG_ERROR, "Frame is too short\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    c->quant[0] = bytestream2_get_byte(&gb);
-    c->quant[1] = bytestream2_get_byte(&gb);
-    if (c->quant[0] < 2 || c->quant[0] > NUM_VLC_SETS + 1 ||
-        c->quant[1] < 2 || c->quant[1] > NUM_VLC_SETS + 1) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid quantisers %d / %d\n",
-               c->quant[0], c->quant[1]);
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (i = 0; i < 3; i++) {
-        c->q[0][i] = tscc2_quants[c->quant[0] - 2][i];
-        c->q[1][i] = tscc2_quants[c->quant[1] - 2][i];
-    }
-
-    bytestream2_skip(&gb, 1);
-
-    size = bytestream2_get_le32(&gb);
-    if (size > bytestream2_get_bytes_left(&gb)) {
-        av_log(avctx, AV_LOG_ERROR, "Slice properties chunk is too large\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (i = 0; i < size; i++) {
-        val   = bytestream2_get_byte(&gb);
-        len   = val & 0x3F;
-        val >>= 6;
-        if (pos + len > num_mb) {
-            av_log(avctx, AV_LOG_ERROR, "Too many slice properties\n");
-            return AVERROR_INVALIDDATA;
-        }
-        memset(c->slice_quants + pos, val, len);
-        pos += len;
-    }
-    if (pos < num_mb) {
-        av_log(avctx, AV_LOG_ERROR, "Too few slice properties (%d / %d)\n",
-               pos, num_mb);
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (i = 0; i < c->mb_height; i++) {
-        size = bytestream2_peek_byte(&gb);
-        if (size & 1) {
-            size = bytestream2_get_byte(&gb) - 1;
-        } else {
-            size = bytestream2_get_le32(&gb) >> 1;
-        }
-        if (!size) {
-            int skip_row = 1, j, off = i * c->mb_width;
-            for (j = 0; j < c->mb_width; j++) {
-                if (c->slice_quants[off + j] == 1 ||
-                    c->slice_quants[off + j] == 2) {
-                    skip_row = 0;
-                    break;
-                }
-            }
-            if (!skip_row) {
-                av_log(avctx, AV_LOG_ERROR, "Non-skip row with zero size\n");
-                return AVERROR_INVALIDDATA;
-            }
-        }
-        if (bytestream2_get_bytes_left(&gb) < size) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid slice size (%d/%d)\n",
-                   size, bytestream2_get_bytes_left(&gb));
-            return AVERROR_INVALIDDATA;
-        }
-        ret = tscc2_decode_slice(c, i, buf + bytestream2_tell(&gb), size);
-        if (ret) {
-            av_log(avctx, AV_LOG_ERROR, "Error decoding slice %d\n", i);
-            return ret;
-        }
-        bytestream2_skip(&gb, size);
-    }
-
-    *got_frame      = 1;
-    if ((ret = av_frame_ref(data, c->pic)) < 0)
-        return ret;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int tscc2_decode_end(AVCodecContext *avctx)
-{
-    TSCC2Context * const c = avctx->priv_data;
-
-    av_frame_free(&c->pic);
-    av_freep(&c->slice_quants);
-    free_vlcs(c);
-
-    return 0;
-}
-
-static av_cold int tscc2_decode_init(AVCodecContext *avctx)
-{
-    TSCC2Context * const c = avctx->priv_data;
-    int ret;
-
-    c->avctx = avctx;
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV444P;
-
-    if ((ret = init_vlcs(c)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n");
-        return ret;
-    }
-
-    c->mb_width     = FFALIGN(avctx->width,  16) >> 4;
-    c->mb_height    = FFALIGN(avctx->height,  8) >> 3;
-    c->slice_quants = av_malloc(c->mb_width * c->mb_height);
-    if (!c->slice_quants) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot allocate slice information\n");
-        free_vlcs(c);
-        return AVERROR(ENOMEM);
-    }
-
-    c->pic = av_frame_alloc();
-    if (!c->pic) {
-        tscc2_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-AVCodec ff_tscc2_decoder = {
-    .name           = "tscc2",
-    .long_name      = NULL_IF_CONFIG_SMALL("TechSmith Screen Codec 2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TSCC2,
-    .priv_data_size = sizeof(TSCC2Context),
-    .init           = tscc2_decode_init,
-    .close          = tscc2_decode_end,
-    .decode         = tscc2_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/tscc2data.h b/deps/libav/libavcodec/tscc2data.h
deleted file mode 100644
index 70a06e5..0000000
--- a/deps/libav/libavcodec/tscc2data.h
+++ /dev/null
@@ -1,935 +0,0 @@
-/*
- * TechSmith Screen Codec 2 (aka Dora) decoder
- * Copyright (c) 2012 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_TSCC2_DATA_H
-#define AVCODEC_TSCC2_DATA_H
-
-#include <stdint.h>
-
-static const uint8_t tscc2_zigzag[16] = {
-   0,  1,  4,  8,
-   5,  2,  3,  6,
-   9, 12, 13, 10,
-   7, 11, 14, 15
-};
-
-#define NUM_VLC_SETS 13
-
-static const uint16_t tscc2_quants[NUM_VLC_SETS][3] = {
-    {  655,  861, 1130 }, {  983, 1291, 1695 }, { 1311, 1721, 2260 },
-    { 1638, 2151, 2825 }, { 1966, 2582, 3390 }, { 2294, 3012, 3955 },
-    { 2621, 3442, 4520 }, { 2949, 3872, 5085 }, { 3277, 4303, 5650 },
-    { 3604, 4733, 6215 }, { 3932, 5163, 6780 }, { 4260, 5593, 7345 },
-    { 4588, 6024, 7910 },
-};
-
-#define DC_VLC_COUNT 47
-
-static const uint16_t tscc2_dc_vlc_syms[DC_VLC_COUNT] = {
-   0x100, 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9,
-    0xF8, 0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1,
-    0xF0, 0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0x17,
-    0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F,
-    0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07,
-    0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
-};
-
-static const uint16_t tscc2_dc_vlc_codes[DC_VLC_COUNT] = {
-    0x000A, 0x0000, 0x0006, 0x002E, 0x0002, 0x000E, 0x001A, 0x007E,
-    0x004E, 0x005A, 0x00E2, 0x01BE, 0x01BA, 0x00BA, 0x0072, 0x0022,
-    0x02BE, 0x00BE, 0x033A, 0x03F2, 0x01F2, 0x03A2, 0x0122, 0x0322,
-    0x01A2, 0x0172, 0x0372, 0x013A, 0x00CE, 0x02CE, 0x02FE, 0x00FE,
-    0x00A2, 0x00F2, 0x003A, 0x01CE, 0x01FE, 0x0062, 0x00DA, 0x003E,
-    0x0032, 0x007A, 0x0012, 0x001E, 0x0016, 0x0004, 0x0001,
-};
-
-static const uint8_t tscc2_dc_vlc_bits[DC_VLC_COUNT] = {
-     5,  3,  5,  6,  6,  7,  7,  8,
-     8,  8,  8,  9,  9,  9,  9,  9,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-     9,  9,  9,  9,  9,  8,  8,  8,
-     7,  7,  6,  6,  5,  3,  1,
-};
-
-static const uint8_t tscc2_nc_vlc_syms[16] = {
-    0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08,
-    0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
-};
-
-static const uint16_t tscc2_nc_vlc_codes[NUM_VLC_SETS][16] = {
-    { 0x0023, 0x0003, 0x0031, 0x0021, 0x0011, 0x0053, 0x0013, 0x0001,
-      0x0009, 0x0029, 0x0033, 0x0019, 0x000B, 0x0005, 0x0007, 0x0000, },
-    { 0x0030, 0x0022, 0x0028, 0x0020, 0x0008, 0x0000, 0x0032, 0x0072,
-      0x0010, 0x0002, 0x0012, 0x0018, 0x000A, 0x0004, 0x0006, 0x0001, },
-    { 0x0032, 0x0038, 0x0020, 0x0008, 0x0002, 0x0018, 0x0072, 0x0000,
-      0x0028, 0x0022, 0x0012, 0x0010, 0x000A, 0x0004, 0x0006, 0x0001, },
-    { 0x0032, 0x0010, 0x0072, 0x0030, 0x0022, 0x0038, 0x0008, 0x0028,
-      0x0018, 0x0002, 0x0012, 0x0000, 0x000A, 0x0004, 0x0006, 0x0001, },
-    { 0x0012, 0x0052, 0x0000, 0x0020, 0x0018, 0x0022, 0x0008, 0x0028,
-      0x0038, 0x0002, 0x0032, 0x0010, 0x000A, 0x0004, 0x0006, 0x0001, },
-    { 0x0016, 0x0096, 0x0006, 0x0046, 0x0056, 0x0002, 0x0036, 0x0076,
-      0x0012, 0x0022, 0x0032, 0x0026, 0x000A, 0x000E, 0x0000, 0x0001, },
-    { 0x001A, 0x009A, 0x0032, 0x0072, 0x005A, 0x007A, 0x003A, 0x0002,
-      0x0012, 0x0022, 0x000A, 0x002A, 0x0006, 0x000E, 0x0000, 0x0001, },
-    { 0x002A, 0x00AA, 0x0002, 0x0042, 0x006A, 0x003A, 0x007A, 0x0022,
-      0x0032, 0x0012, 0x000A, 0x001A, 0x0006, 0x000E, 0x0000, 0x0001, },
-    { 0x0042, 0x00C2, 0x0002, 0x000A, 0x004A, 0x003A, 0x007A, 0x0022,
-      0x0012, 0x0032, 0x002A, 0x001A, 0x0006, 0x000E, 0x0000, 0x0001, },
-    { 0x00BA, 0x01BA, 0x003A, 0x0012, 0x0052, 0x007A, 0x0002, 0x0022,
-      0x0032, 0x000A, 0x002A, 0x001A, 0x0000, 0x0004, 0x0006, 0x0001, },
-    { 0x00AA, 0x01AA, 0x002A, 0x0022, 0x0062, 0x006A, 0x0002, 0x0012,
-      0x0032, 0x000A, 0x001A, 0x003A, 0x0000, 0x0004, 0x0006, 0x0001, },
-    { 0x00AA, 0x01AA, 0x002A, 0x0022, 0x0062, 0x006A, 0x0002, 0x0012,
-      0x0032, 0x000A, 0x003A, 0x001A, 0x0000, 0x0004, 0x0006, 0x0001, },
-    { 0x008A, 0x018A, 0x000A, 0x0022, 0x0062, 0x004A, 0x0002, 0x0012,
-      0x0032, 0x002A, 0x001A, 0x003A, 0x0000, 0x0004, 0x0006, 0x0001, },
-};
-
-static const uint8_t tscc2_nc_vlc_bits[NUM_VLC_SETS][16] = {
-    { 6, 6, 6, 6, 6, 7, 7, 6, 6, 6, 6, 5, 4, 3, 3, 1 },
-    { 6, 6, 6, 6, 6, 6, 7, 7, 6, 6, 6, 5, 4, 3, 3, 1 },
-    { 7, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 5, 4, 3, 3, 1 },
-    { 7, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 4, 3, 3, 1 },
-    { 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 4, 3, 3, 1 },
-    { 8, 8, 7, 7, 7, 6, 7, 7, 6, 6, 6, 6, 4, 4, 2, 1 },
-    { 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 4, 4, 2, 1 },
-    { 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 4, 4, 2, 1 },
-    { 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 4, 4, 2, 1 },
-    { 9, 9, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 3, 3, 3, 1 },
-    { 9, 9, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 3, 3, 3, 1 },
-    { 9, 9, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 3, 3, 3, 1 },
-    { 9, 9, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 3, 3, 3, 1 },
-};
-
-static const uint16_t ac_vlc_desc0_syms[172] = {
-   0x1000, 0xFF8, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, 0xFF1,
-    0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, 0xFE0,
-    0xFD6, 0xFD5, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6, 0xFC5,
-    0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB2, 0xFB1,
-    0xFB0, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF95, 0xF91, 0xF90,
-    0xF83, 0xF81, 0xF80, 0xF73, 0xF71, 0xF70, 0xF61, 0xF60,
-    0xF51, 0xF50, 0xF45, 0xF41, 0xF40, 0xF31, 0xF30, 0xF21,
-    0xF20, 0xF10, 0xF00, 0xEF0, 0xEE0, 0xED5, 0xED1, 0xED0,
-    0xEC0, 0xEB0, 0xEA0, 0xE90, 0xE80, 0xE70, 0xE60, 0xE50,
-    0xE40, 0xE30, 0xE20, 0xE10, 0xE00, 0xDF0, 0xDE0, 0xDD0,
-    0xDC0, 0xDB0, 0xDA0, 0xD90, 0xD80, 0xD60, 0xCD1, 0x280,
-    0x270, 0x260, 0x250, 0x240, 0x230, 0x220, 0x210, 0x200,
-    0x1F0, 0x1E0, 0x1D0, 0x1C0, 0x1B0, 0x1A1, 0x1A0, 0x190,
-    0x180, 0x170, 0x160, 0x150, 0x140, 0x130, 0x121, 0x120,
-    0x111, 0x110, 0x101, 0x100, 0x0F1, 0x0F0, 0x0E1, 0x0E0,
-    0x0D1, 0x0D0, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A5, 0x0A1,
-    0x0A0, 0x091, 0x090, 0x081, 0x080, 0x075, 0x071, 0x070,
-    0x065, 0x063, 0x061, 0x060, 0x055, 0x053, 0x052, 0x051,
-    0x050, 0x046, 0x045, 0x043, 0x042, 0x041, 0x040, 0x036,
-    0x035, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024,
-    0x023, 0x022, 0x021, 0x020, 0x018, 0x016, 0x015, 0x014,
-    0x013, 0x012, 0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_desc0_codes[172] = {
-    0x001F, 0x0D71, 0x013F, 0x006C, 0x00A7, 0x0067, 0x001C, 0x0008,
-    0x0005, 0x06F1, 0x002C, 0x04BA, 0x0072, 0x01AA, 0x0002, 0x0006,
-    0x06AC, 0x02AF, 0x06EF, 0x018F, 0x000A, 0x0009, 0x02AC, 0x042A,
-    0x06E1, 0x068F, 0x00B1, 0x0000, 0x0317, 0x0C17, 0x0612, 0x010F,
-    0x0011, 0x0FBA, 0x002A, 0x0172, 0x000C, 0x05AC, 0x03D7, 0x0037,
-    0x0E8F, 0x02F2, 0x0041, 0x0BE1, 0x057F, 0x004A, 0x00AF, 0x006F,
-    0x06AA, 0x0097, 0x0101, 0x0012, 0x0081, 0x0571, 0x0092, 0x0EAF,
-    0x01BF, 0x00D7, 0x0031, 0x0001, 0x01F2, 0x0F17, 0x053A, 0x00BF,
-    0x038F, 0x0217, 0x0371, 0x01F1, 0x01BA, 0x022A, 0x02BF, 0x028F,
-    0x008F, 0x03F1, 0x00E1, 0x00BA, 0x00F2, 0x0EBF, 0x06AF, 0x048F,
-    0x0FE1, 0x0271, 0x07BA, 0x0D3A, 0x0C12, 0x08AC, 0x0717, 0x00AC,
-    0x0412, 0x0901, 0x04E1, 0x07E1, 0x0417, 0x0CAF, 0x04AC, 0x01AC,
-    0x04F2, 0x03BA, 0x05D7, 0x07F1, 0x01D7, 0x04AF, 0x04EF, 0x03AC,
-    0x00AA, 0x01E1, 0x0071, 0x00F1, 0x012C, 0x03EF, 0x082A, 0x0112,
-    0x03E1, 0x01FA, 0x0DAC, 0x0131, 0x0E12, 0x000F, 0x0B17, 0x007F,
-    0x0AEF, 0x007A, 0x02AA, 0x0061, 0x0671, 0x0027, 0x013A, 0x058F,
-    0x00FF, 0x033A, 0x0032, 0x0301, 0x0021, 0x0C8F, 0x037F, 0x0077,
-    0x02F1, 0x02E1, 0x003A, 0x003C, 0x0212, 0x0817, 0x0CE1, 0x003F,
-    0x0007, 0x0017, 0x0501, 0x02BA, 0x06BF, 0x0057, 0x0010, 0x02EF,
-    0x0117, 0x017F, 0x00EF, 0x006A, 0x0019, 0x0171, 0x01EF, 0x06BA,
-    0x012A, 0x00FA, 0x0022, 0x000E, 0x0AE1, 0x01AF, 0x0052, 0x002F,
-    0x004F, 0x001A, 0x0004, 0x0003,
-};
-
-static const uint8_t ac_vlc_desc0_bits[172] = {
-     6, 12,  9,  7,  8,  7,  6,  4,
-     3, 11,  9, 11,  9,  9,  6,  4,
-    11, 11, 11, 11,  7,  5, 11, 11,
-    11, 12,  8,  5, 12, 12, 12,  9,
-     6, 12, 12,  9,  6, 12, 10,  7,
-    12, 10,  7, 12, 11,  7, 11,  8,
-    11,  8, 12, 11,  8, 12,  8, 12,
-     9,  9,  9,  9,  9, 12, 12, 10,
-    10, 10, 10, 10, 10, 10, 11, 11,
-    11, 11, 11, 11, 11, 12, 12, 12,
-    12, 11, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 11, 11,
-    11, 11, 11, 11, 11, 12, 11, 10,
-    10, 10, 10, 10,  9, 10, 12,  9,
-    12,  9, 12,  9, 12,  9, 12,  9,
-    12,  8, 11,  8, 11,  8, 11, 11,
-     8, 10,  7, 10,  7, 12, 10,  7,
-    11, 12,  9,  6, 11, 12, 12,  9,
-     6, 12, 11, 11, 12,  8,  5, 12,
-    10, 11, 11,  7,  5, 11, 10, 11,
-     9,  9,  6,  4, 12,  9,  7,  8,
-     7,  6,  4,  3,
-};
-
-static const uint16_t ac_vlc_desc1_syms[169] = {
-   0x1000, 0xFF8, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, 0xFF1,
-    0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, 0xFE0,
-    0xFD6, 0xFD5, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6, 0xFC5,
-    0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, 0xFB2,
-    0xFB1, 0xFB0, 0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF95,
-    0xF93, 0xF91, 0xF90, 0xF85, 0xF81, 0xF80, 0xF71, 0xF70,
-    0xF61, 0xF60, 0xF51, 0xF50, 0xF45, 0xF41, 0xF40, 0xF31,
-    0xF30, 0xF21, 0xF20, 0xF11, 0xF10, 0xF01, 0xF00, 0xEF1,
-    0xEF0, 0xEE1, 0xEE0, 0xED0, 0xEC6, 0xEC0, 0xEB6, 0xEB0,
-    0xEA0, 0xE90, 0xE80, 0xE70, 0xE60, 0xE50, 0xE40, 0xE33,
-    0xE31, 0xE30, 0xE20, 0xE10, 0xE00, 0xDF0, 0xDE1, 0xDE0,
-    0xDC0, 0xDB0, 0xDA0, 0x250, 0x240, 0x1F0, 0x1E0, 0x1D0,
-    0x1C0, 0x1B0, 0x1A0, 0x190, 0x180, 0x170, 0x160, 0x150,
-    0x140, 0x130, 0x120, 0x111, 0x110, 0x101, 0x100, 0x0F1,
-    0x0F0, 0x0E1, 0x0E0, 0x0D1, 0x0D0, 0x0C6, 0x0C1, 0x0C0,
-    0x0B1, 0x0B0, 0x0A1, 0x0A0, 0x095, 0x091, 0x090, 0x085,
-    0x081, 0x080, 0x075, 0x071, 0x070, 0x065, 0x063, 0x061,
-    0x060, 0x055, 0x053, 0x052, 0x051, 0x050, 0x046, 0x045,
-    0x043, 0x042, 0x041, 0x040, 0x036, 0x035, 0x033, 0x032,
-    0x031, 0x030, 0x026, 0x025, 0x024, 0x023, 0x022, 0x021,
-    0x020, 0x018, 0x016, 0x015, 0x014, 0x013, 0x012, 0x011,
-    0x010,
-};
-
-static const uint16_t ac_vlc_desc1_codes[169] = {
-    0x0019, 0x027D, 0x0084, 0x0044, 0x009D, 0x003D, 0x000A, 0x0002,
-    0x0003, 0x00EA, 0x02FD, 0x017A, 0x01C6, 0x00B6, 0x0026, 0x000E,
-    0x0095, 0x0260, 0x032A, 0x0360, 0x0006, 0x0005, 0x05B6, 0x036A,
-    0x06F6, 0x0704, 0x00FA, 0x0010, 0x0279, 0x04D4, 0x00F6, 0x066A,
-    0x001D, 0x0029, 0x05F9, 0x0846, 0x04F6, 0x01D4, 0x0038, 0x0446,
-    0x0160, 0x031D, 0x0075, 0x0054, 0x02D4, 0x005A, 0x05FD, 0x0040,
-    0x06EA, 0x0055, 0x0460, 0x009A, 0x052A, 0x00A0, 0x00D8, 0x0380,
-    0x017D, 0x092A, 0x00F9, 0x0D7A, 0x0179, 0x0304, 0x002A, 0x0104,
-    0x01A0, 0x0780, 0x007D, 0x03F9, 0x0C46, 0x03EA, 0x0E6A, 0x0204,
-    0x01FD, 0x051D, 0x02AA, 0x05EA, 0x00AA, 0x0080, 0x067D, 0x09EA,
-    0x0C95, 0x09F9, 0x07B6, 0x0DB6, 0x012A, 0x0904, 0x0454, 0x0FB6,
-    0x0960, 0x08D4, 0x0495, 0x0F80, 0x0560, 0x0B04, 0x057A, 0x0079,
-    0x0795, 0x0E7D, 0x0060, 0x076A, 0x03B6, 0x0395, 0x0180, 0x02A0,
-    0x006A, 0x0195, 0x0295, 0x0646, 0x03FD, 0x01F9, 0x0154, 0x0DF9,
-    0x00C6, 0x0F95, 0x01F6, 0x0480, 0x0000, 0x0A79, 0x04AA, 0x00E0,
-    0x0246, 0x001A, 0x0479, 0x0015, 0x0D60, 0x0280, 0x0018, 0x01EA,
-    0x037A, 0x003A, 0x011D, 0x00FD, 0x0035, 0x0A7D, 0x04A0, 0x0146,
-    0x0024, 0x01B6, 0x0504, 0x0046, 0x0020, 0x0009, 0x00D4, 0x03AA,
-    0x0679, 0x026A, 0x0036, 0x0008, 0x02F6, 0x01AA, 0x016A, 0x0254,
-    0x0039, 0x000D, 0x0004, 0x0176, 0x02EA, 0x007A, 0x0076, 0x0016,
-    0x0001, 0x0879, 0x0058, 0x0014, 0x00D5, 0x005D, 0x0034, 0x000C,
-    0x0007,
-};
-
-static const uint8_t ac_vlc_desc1_bits[169] = {
-     6, 12,  8,  7,  8,  7,  6,  4,
-     3, 10, 10, 11,  9,  9,  6,  4,
-    11, 10, 10, 10,  7,  5, 12, 11,
-    11, 11,  8,  5, 12, 11, 11, 12,
-     9,  6, 12, 12, 11,  9,  6, 12,
-    12, 10,  7, 11, 10,  7, 11,  7,
-    11,  8, 11,  8, 11, 11,  8, 11,
-     9, 12,  9, 12,  9, 12,  9, 12,
-     9, 12, 10, 10, 12, 10, 12, 10,
-    11, 11, 10, 11, 11, 11, 12, 12,
-    12, 12, 12, 12, 12, 12, 11, 12,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 11, 11, 11, 11, 10, 10,
-    10, 10, 10, 11, 10, 12,  9, 12,
-     9, 12,  9, 11,  8, 12, 11,  8,
-    11,  8, 11,  8, 12, 10,  7, 12,
-    10,  7, 11, 10,  7, 12, 11,  9,
-     6, 11, 11, 12,  8,  6, 12, 10,
-    11, 11,  8,  5, 11, 10, 10, 10,
-     7,  5, 10,  9, 11,  9,  9,  6,
-     4, 12,  8,  7,  8,  7,  6,  4,
-     3,
-};
-
-static const uint16_t ac_vlc_desc2_syms[165] = {
-   0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2,
-    0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1,
-    0xFE0, 0xFD6, 0xFD5, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6,
-    0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3,
-    0xFB2, 0xFB1, 0xFB0, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF95,
-    0xF93, 0xF91, 0xF90, 0xF81, 0xF80, 0xF75, 0xF71, 0xF70,
-    0xF61, 0xF60, 0xF51, 0xF50, 0xF41, 0xF40, 0xF36, 0xF31,
-    0xF30, 0xF26, 0xF21, 0xF20, 0xF16, 0xF11, 0xF10, 0xF06,
-    0xF01, 0xF00, 0xEF1, 0xEF0, 0xEE1, 0xEE0, 0xED0, 0xEC0,
-    0xEB3, 0xEB1, 0xEB0, 0xEA3, 0xEA1, 0xEA0, 0xE90, 0xE81,
-    0xE80, 0xE71, 0xE70, 0xE61, 0xE60, 0xE50, 0xE40, 0xE30,
-    0xE10, 0xE00, 0x241, 0x240, 0x231, 0x1D0, 0x1C0, 0x1B3,
-    0x1B0, 0x1A0, 0x190, 0x180, 0x170, 0x160, 0x150, 0x140,
-    0x130, 0x120, 0x110, 0x100, 0x0F0, 0x0E0, 0x0D1, 0x0D0,
-    0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A5, 0x0A1, 0x0A0, 0x096,
-    0x095, 0x091, 0x090, 0x086, 0x085, 0x081, 0x080, 0x075,
-    0x071, 0x070, 0x065, 0x063, 0x061, 0x060, 0x055, 0x053,
-    0x052, 0x051, 0x050, 0x045, 0x043, 0x042, 0x041, 0x040,
-    0x036, 0x035, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025,
-    0x024, 0x023, 0x022, 0x021, 0x020, 0x018, 0x016, 0x015,
-    0x014, 0x013, 0x012, 0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_desc2_codes[165] = {
-    0x0034, 0x059C, 0x0280, 0x001C, 0x004C, 0x00BD, 0x0020, 0x003C,
-    0x000A, 0x0003, 0x00FD, 0x008C, 0x0332, 0x01D5, 0x0055, 0x003E,
-    0x0001, 0x07E4, 0x0264, 0x00B2, 0x00A2, 0x005C, 0x0005, 0x02A2,
-    0x011D, 0x0132, 0x076C, 0x0012, 0x0018, 0x01E4, 0x05E4, 0x02B2,
-    0x0432, 0x017D, 0x000E, 0x055D, 0x0955, 0x0164, 0x0028, 0x0D62,
-    0x0B24, 0x02DE, 0x001E, 0x0340, 0x0014, 0x0555, 0x0180, 0x00DD,
-    0x01B2, 0x0092, 0x036C, 0x00EC, 0x00E4, 0x00C0, 0x0C64, 0x095D,
-    0x01DE, 0x0AE4, 0x0C32, 0x01A2, 0x06E4, 0x0832, 0x01A4, 0x015D,
-    0x0732, 0x031D, 0x0F9C, 0x03E2, 0x09E2, 0x02FD, 0x0224, 0x051D,
-    0x02E4, 0x019C, 0x05B2, 0x0355, 0x0064, 0x016C, 0x038C, 0x0880,
-    0x0480, 0x06B2, 0x0540, 0x0080, 0x075D, 0x0155, 0x0424, 0x0680,
-    0x0A62, 0x0A80, 0x078C, 0x0D9C, 0x0F8C, 0x0562, 0x0FF2, 0x0464,
-    0x0B55, 0x01E2, 0x0032, 0x07F2, 0x0140, 0x03E4, 0x0662, 0x0755,
-    0x0380, 0x026C, 0x0232, 0x001D, 0x0040, 0x00E2, 0x035D, 0x00F2,
-    0x0162, 0x01FD, 0x03F2, 0x000C, 0x0EA2, 0x05F2, 0x0072, 0x04E4,
-    0x0F32, 0x018C, 0x009D, 0x0324, 0x079C, 0x006C, 0x0054, 0x0F5D,
-    0x021D, 0x0015, 0x0024, 0x06A2, 0x009C, 0x0004, 0x0062, 0x056C,
-    0x0262, 0x0000, 0x002E, 0x01F2, 0x0124, 0x039C, 0x005E, 0x0010,
-    0x0724, 0x00A4, 0x00DE, 0x0362, 0x0052, 0x000D, 0x03B2, 0x007D,
-    0x05E2, 0x00D5, 0x005D, 0x0035, 0x0009, 0x099C, 0x0022, 0x002C,
-    0x003D, 0x0008, 0x0002, 0x0006, 0x0007,
-};
-
-static const uint8_t ac_vlc_desc2_bits[165] = {
-     6, 12, 12,  8,  7,  8,  6,  6,
-     4,  3, 10,  9, 11,  9,  9,  6,
-     4, 11, 10, 10, 10,  7,  5, 11,
-    11, 10, 11,  8,  5, 11, 11, 11,
-    12,  9,  6, 11, 12,  9,  6, 12,
-    12, 10,  7, 10,  7, 11, 10,  8,
-    11,  8, 11,  8, 11,  8, 12, 12,
-     9, 12, 12,  9, 11, 12,  9, 12,
-    12, 10, 12, 10, 12, 10, 10, 11,
-    12, 12, 11, 12, 11, 11, 11, 12,
-    11, 11, 11, 12, 12, 12, 11, 11,
-    12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 11, 11, 11, 11,
-    10, 10, 10, 10,  9,  9, 11,  9,
-    11,  9, 11,  8, 12, 11,  8, 11,
-    12, 10,  8, 12, 12, 10,  7, 12,
-    10,  7, 11, 12,  9,  6, 10, 11,
-    12,  8,  6, 11, 10, 11,  8,  5,
-    11,  9, 10, 10,  7,  5, 10,  9,
-    11,  9,  9,  6,  4, 12,  8,  7,
-     8,  6,  6,  4,  3,
-};
-
-static const uint16_t ac_vlc_desc3_syms[162] = {
-   0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2,
-    0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1,
-    0xFE0, 0xFD6, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0,
-    0xFC6, 0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3,
-    0xFB2, 0xFB1, 0xFB0, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF95,
-    0xF93, 0xF91, 0xF90, 0xF85, 0xF83, 0xF81, 0xF80, 0xF71,
-    0xF70, 0xF66, 0xF61, 0xF60, 0xF56, 0xF51, 0xF50, 0xF46,
-    0xF41, 0xF40, 0xF36, 0xF31, 0xF30, 0xF26, 0xF21, 0xF20,
-    0xF11, 0xF10, 0xF01, 0xF00, 0xEF3, 0xEF1, 0xEF0, 0xEE3,
-    0xEE1, 0xEE0, 0xED3, 0xED1, 0xED0, 0xEC1, 0xEC0, 0xEB1,
-    0xEB0, 0xEA0, 0xE90, 0xE80, 0xE70, 0x1E1, 0x1D1, 0x1D0,
-    0x1C1, 0x1B1, 0x1A1, 0x180, 0x170, 0x163, 0x160, 0x150,
-    0x140, 0x130, 0x123, 0x120, 0x113, 0x110, 0x100, 0x0F0,
-    0x0E0, 0x0D1, 0x0D0, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A1,
-    0x0A0, 0x095, 0x091, 0x090, 0x085, 0x081, 0x080, 0x076,
-    0x075, 0x073, 0x071, 0x070, 0x066, 0x065, 0x063, 0x061,
-    0x060, 0x055, 0x053, 0x052, 0x051, 0x050, 0x045, 0x043,
-    0x042, 0x041, 0x040, 0x036, 0x035, 0x034, 0x033, 0x032,
-    0x031, 0x030, 0x026, 0x025, 0x024, 0x023, 0x022, 0x021,
-    0x020, 0x018, 0x017, 0x016, 0x015, 0x014, 0x013, 0x012,
-    0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_desc3_codes[162] = {
-    0x001D, 0x087C, 0x0AE8, 0x003A, 0x001C, 0x0008, 0x000C, 0x0032,
-    0x0006, 0x0003, 0x03A5, 0x01EC, 0x01A5, 0x0080, 0x0030, 0x0005,
-    0x0001, 0x0040, 0x03FC, 0x02D4, 0x0154, 0x02FC, 0x003C, 0x0015,
-    0x051A, 0x0000, 0x02EC, 0x077C, 0x00D2, 0x0018, 0x03E8, 0x04EC,
-    0x027C, 0x01FA, 0x0022, 0x0765, 0x0EA5, 0x0054, 0x0010, 0x08EC,
-    0x0AAC, 0x03BA, 0x0042, 0x065D, 0x0AD4, 0x005C, 0x0028, 0x03C0,
-    0x00E5, 0x035C, 0x04FA, 0x00DC, 0x06A5, 0x075C, 0x00C8, 0x05A5,
-    0x04D4, 0x00BA, 0x01C0, 0x05E8, 0x012C, 0x00E8, 0x01B0, 0x00B0,
-    0x025D, 0x002C, 0x0A52, 0x025C, 0x01E8, 0x00FA, 0x0348, 0x0652,
-    0x0B7C, 0x0365, 0x031A, 0x0E52, 0x011A, 0x0200, 0x01BA, 0x02AC,
-    0x06D4, 0x01FC, 0x05BA, 0x0DFC, 0x0248, 0x0EE8, 0x0B1A, 0x0CFC,
-    0x0F65, 0x0B5C, 0x0DC0, 0x007C, 0x0548, 0x08A5, 0x00FC, 0x03B0,
-    0x0148, 0x06AC, 0x0252, 0x071A, 0x02E8, 0x0240, 0x00AC, 0x021A,
-    0x0140, 0x08E8, 0x01AC, 0x00EC, 0x0152, 0x00A5, 0x0068, 0x001A,
-    0x006C, 0x05C0, 0x015C, 0x0025, 0x05B0, 0x017C, 0x0014, 0x047C,
-    0x00D4, 0x06E8, 0x00C0, 0x0002, 0x0A5D, 0x04E8, 0x0A7C, 0x01D4,
-    0x0020, 0x04A5, 0x07B0, 0x037C, 0x015D, 0x002A, 0x005D, 0x0048,
-    0x067C, 0x007A, 0x0004, 0x04FC, 0x02FA, 0x0648, 0x0100, 0x0052,
-    0x005A, 0x000D, 0x0165, 0x0065, 0x02A5, 0x0070, 0x00F0, 0x003D,
-    0x0009, 0x05FC, 0x0E48, 0x009A, 0x0012, 0x00DD, 0x0034, 0x000A,
-    0x000E, 0x0007,
-};
-
-static const uint8_t ac_vlc_desc3_bits[162] = {
-     7, 12, 12,  8,  7,  7,  6,  6,
-     4,  3, 10,  9, 11,  8,  8,  6,
-     4, 10, 10, 12,  9, 10,  7,  5,
-    11, 10, 10, 11,  8,  5, 10, 11,
-    12,  9,  6, 12, 12,  9,  6, 12,
-    12, 10,  7, 11, 12, 10,  7, 10,
-     8, 12, 11,  8, 12, 11,  8, 11,
-    11,  9, 11, 11,  9, 12, 11,  9,
-    12,  9, 12, 10, 11, 11, 10, 12,
-    12, 11, 12, 12, 11, 10, 11, 12,
-    11, 11, 11, 12, 11, 12, 12, 12,
-    12, 12, 12, 12, 11, 12, 11, 11,
-    11, 11, 12, 11, 12, 10, 10, 10,
-     9, 12,  9, 12,  9, 12,  8, 10,
-     8, 12, 10,  8, 11, 10,  7, 11,
-    11, 12,  9,  7, 12, 11, 12,  9,
-     6, 11, 11, 12,  9,  6, 10, 10,
-    11,  8,  5, 12, 10, 12,  9, 10,
-     7,  5, 10,  9, 11,  8,  8,  6,
-     4, 12, 12,  8,  7,  8,  6,  6,
-     4,  3,
-};
-
-static const uint16_t ac_vlc_desc4_syms[131] = {
-   0x1000, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, 0xFF1, 0xFF0,
-    0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, 0xFE0, 0xFD6,
-    0xFD5, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5, 0xFC3, 0xFC2,
-    0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB1, 0xFB0, 0xFA5, 0xFA3,
-    0xFA1, 0xFA0, 0xF93, 0xF91, 0xF90, 0xF81, 0xF80, 0xF76,
-    0xF71, 0xF70, 0xF66, 0xF61, 0xF60, 0xF56, 0xF51, 0xF50,
-    0xF41, 0xF40, 0xF31, 0xF30, 0xF23, 0xF21, 0xF20, 0xF13,
-    0xF11, 0xF10, 0xF03, 0xF01, 0xF00, 0xEF1, 0xEF0, 0xEE0,
-    0xED0, 0xEC0, 0xEB0, 0x191, 0x181, 0x180, 0x171, 0x161,
-    0x140, 0x130, 0x123, 0x120, 0x110, 0x100, 0x0F3, 0x0F0,
-    0x0E0, 0x0D0, 0x0C0, 0x0B1, 0x0B0, 0x0A1, 0x0A0, 0x091,
-    0x090, 0x085, 0x081, 0x080, 0x075, 0x071, 0x070, 0x066,
-    0x065, 0x063, 0x061, 0x060, 0x056, 0x055, 0x053, 0x051,
-    0x050, 0x045, 0x043, 0x042, 0x041, 0x040, 0x036, 0x035,
-    0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024, 0x023,
-    0x022, 0x021, 0x020, 0x018, 0x016, 0x015, 0x014, 0x013,
-    0x012, 0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_desc4_codes[131] = {
-    0x006B, 0x00BE, 0x0052, 0x00F3, 0x005B, 0x003A, 0x0009, 0x0007,
-    0x00DA, 0x03FB, 0x0123, 0x00B3, 0x01B3, 0x002E, 0x0006, 0x030A,
-    0x005A, 0x004A, 0x034A, 0x0072, 0x0005, 0x02DA, 0x0173, 0x04FB,
-    0x0032, 0x0013, 0x039B, 0x0B9B, 0x011E, 0x0002, 0x00FB, 0x021E,
-    0x009B, 0x007E, 0x0E1A, 0x03CA, 0x007B, 0x02FB, 0x0033, 0x03AB,
-    0x0463, 0x008A, 0x0773, 0x041E, 0x002B, 0x031B, 0x065A, 0x011A,
-    0x060A, 0x01DA, 0x0963, 0x0323, 0x0BAB, 0x059E, 0x010A, 0x05AB,
-    0x0CFB, 0x071B, 0x079E, 0x0F9E, 0x0263, 0x079B, 0x0563, 0x019E,
-    0x01AB, 0x0E63, 0x029B, 0x04CA, 0x0DAB, 0x0663, 0x0B1B, 0x020A,
-    0x0A1E, 0x021A, 0x0063, 0x061E, 0x06FB, 0x025A, 0x0163, 0x0573,
-    0x000A, 0x0223, 0x011B, 0x0C1A, 0x015A, 0x0863, 0x00AB, 0x02CA,
-    0x00B2, 0x0A0A, 0x01CA, 0x00A3, 0x0B73, 0x0023, 0x0012, 0x039E,
-    0x001A, 0x0CCA, 0x01FB, 0x005E, 0x0A9B, 0x00CA, 0x0373, 0x009E,
-    0x0022, 0x07AB, 0x001E, 0x0EFB, 0x009A, 0x000B, 0x041A, 0x019B,
-    0x0363, 0x014A, 0x006A, 0x0015, 0x069B, 0x0073, 0x0523, 0x001B,
-    0x012B, 0x0003, 0x0001, 0x061A, 0x003E, 0x002A, 0x00E3, 0x003B,
-    0x000E, 0x000D, 0x0000,
-};
-
-static const uint8_t ac_vlc_desc4_bits[131] = {
-     7,  8,  7,  8,  7,  6,  4,  3,
-    10, 10, 11,  9,  9,  6,  4, 10,
-    10,  9, 10,  7,  5, 10, 11, 12,
-     8,  6, 12, 12,  9,  6, 11, 12,
-    10,  7, 12, 10,  8, 11,  8, 12,
-    11,  8, 11, 11,  9, 12, 11,  9,
-    11,  9, 12, 10, 12, 11, 10, 12,
-    12, 11, 12, 12, 11, 11, 11, 11,
-    11, 12, 12, 12, 12, 12, 12, 12,
-    12, 11, 12, 11, 12, 11, 12, 11,
-    10, 10, 10, 12,  9, 12,  9, 10,
-     8, 12, 10,  8, 12, 10,  7, 11,
-    11, 12, 10,  7, 12, 11, 12,  9,
-     6, 11, 11, 12,  8,  6, 12, 10,
-    10, 10,  7,  5, 11,  9, 11,  9,
-     9,  6,  4, 12,  8,  7,  8,  7,
-     6,  4,  2,
-};
-
-static const uint16_t ac_vlc_desc5_syms[132] = {
-   0x1000, 0xFF8, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2, 0xFF1,
-    0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1, 0xFE0,
-    0xFD6, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5,
-    0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB1, 0xFB0,
-    0xFA3, 0xFA1, 0xFA0, 0xF96, 0xF93, 0xF91, 0xF90, 0xF86,
-    0xF85, 0xF81, 0xF80, 0xF76, 0xF75, 0xF71, 0xF70, 0xF66,
-    0xF61, 0xF60, 0xF51, 0xF50, 0xF43, 0xF41, 0xF40, 0xF33,
-    0xF31, 0xF30, 0xF23, 0xF21, 0xF20, 0xF11, 0xF10, 0xF00,
-    0xEF0, 0xEE0, 0xEC1, 0xEC0, 0x151, 0x141, 0x140, 0x131,
-    0x121, 0x120, 0x111, 0x110, 0x103, 0x100, 0x0F0, 0x0E0,
-    0x0D3, 0x0D0, 0x0C3, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A1,
-    0x0A0, 0x091, 0x090, 0x081, 0x080, 0x075, 0x071, 0x070,
-    0x065, 0x061, 0x060, 0x056, 0x055, 0x053, 0x052, 0x051,
-    0x050, 0x046, 0x045, 0x043, 0x042, 0x041, 0x040, 0x035,
-    0x034, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024,
-    0x023, 0x022, 0x021, 0x020, 0x018, 0x016, 0x015, 0x014,
-    0x013, 0x012, 0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_desc5_codes[132] = {
-    0x0001, 0x0D62, 0x00BD, 0x0022, 0x009B, 0x0032, 0x0019, 0x0005,
-    0x0007, 0x034D, 0x009A, 0x012B, 0x0052, 0x006B, 0x003A, 0x0006,
-    0x06FD, 0x017D, 0x081A, 0x031B, 0x031A, 0x0012, 0x0011, 0x0202,
-    0x00FD, 0x051B, 0x00D2, 0x001D, 0x011A, 0x0782, 0x018D, 0x007B,
-    0x067D, 0x037D, 0x0021, 0x0E8D, 0x0562, 0x008D, 0x00BB, 0x053D,
-    0x082A, 0x0002, 0x000D, 0x0302, 0x007D, 0x053B, 0x003B, 0x0A4D,
-    0x027D, 0x01FD, 0x042A, 0x01C2, 0x041A, 0x0182, 0x014D, 0x0162,
-    0x00C2, 0x032A, 0x0D9A, 0x012A, 0x0102, 0x087D, 0x072B, 0x039A,
-    0x0362, 0x019A, 0x0C62, 0x04C2, 0x0D1B, 0x028D, 0x0762, 0x0E7D,
-    0x0E41, 0x059A, 0x024D, 0x093B, 0x052B, 0x011B, 0x064D, 0x013D,
-    0x0382, 0x0262, 0x0641, 0x0462, 0x004D, 0x0CC2, 0x033B, 0x068D,
-    0x0141, 0x0D2B, 0x001B, 0x0041, 0x00C1, 0x0C41, 0x01E2, 0x00EB,
-    0x062A, 0x0082, 0x0061, 0x02FD, 0x047D, 0x013B, 0x002A, 0x003D,
-    0x005B, 0x022A, 0x02C2, 0x0241, 0x0062, 0x00AA, 0x000B, 0x00E2,
-    0x001A, 0x033D, 0x021A, 0x006A, 0x0009, 0x032B, 0x002B, 0x04FD,
-    0x0042, 0x016B, 0x002D, 0x000E, 0x0441, 0x00CD, 0x005A, 0x00AB,
-    0x000A, 0x0039, 0x0003, 0x0000,
-};
-
-static const uint8_t ac_vlc_desc5_bits[132] = {
-     7, 12,  8,  7,  8,  6,  6,  4,
-     3, 10,  9, 11,  8,  9,  6,  4,
-    11, 10, 12, 10, 10,  7,  5, 10,
-    11, 12,  8,  6, 10, 11,  9,  7,
-    12, 10,  7, 12, 12, 10,  8, 11,
-    12, 10,  8, 10, 12, 11,  9, 12,
-    11,  9, 11,  9, 11, 10, 10, 11,
-    11, 10, 12, 10, 10, 12, 11, 10,
-    11, 11, 12, 12, 12, 11, 11, 12,
-    12, 12, 12, 12, 12, 11, 11, 11,
-    11, 10, 12, 12, 10, 12, 10, 12,
-     9, 12,  9, 11,  8, 12,  9,  8,
-    11,  9,  7, 11, 11, 12, 12,  9,
-     7, 11, 10, 11, 11,  8,  6,  9,
-    12, 10, 10,  7,  5, 11,  9, 11,
-     8,  9,  6,  4, 12,  8,  7,  8,
-     6,  6,  4,  2,
-};
-
-static const uint16_t ac_vlc_desc6_syms[130] = {
-   0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2,
-    0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1,
-    0xFE0, 0xFD6, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0,
-    0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB1,
-    0xFB0, 0xFA6, 0xFA3, 0xFA1, 0xFA0, 0xF96, 0xF95, 0xF93,
-    0xF91, 0xF90, 0xF86, 0xF85, 0xF81, 0xF80, 0xF76, 0xF71,
-    0xF70, 0xF63, 0xF61, 0xF60, 0xF53, 0xF51, 0xF50, 0xF43,
-    0xF41, 0xF40, 0xF31, 0xF30, 0xF20, 0xF10, 0xF00, 0xEF0,
-    0xEE1, 0x131, 0x121, 0x120, 0x111, 0x110, 0x101, 0x100,
-    0x0F1, 0x0F0, 0x0E3, 0x0E1, 0x0E0, 0x0D1, 0x0D0, 0x0C3,
-    0x0C0, 0x0B3, 0x0B1, 0x0B0, 0x0A1, 0x0A0, 0x091, 0x090,
-    0x081, 0x080, 0x075, 0x071, 0x070, 0x065, 0x063, 0x061,
-    0x060, 0x056, 0x055, 0x053, 0x051, 0x050, 0x046, 0x045,
-    0x043, 0x042, 0x041, 0x040, 0x036, 0x035, 0x034, 0x033,
-    0x032, 0x031, 0x030, 0x026, 0x025, 0x024, 0x023, 0x022,
-    0x021, 0x020, 0x018, 0x016, 0x015, 0x014, 0x013, 0x012,
-    0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_desc6_codes[130] = {
-    0x0022, 0x0BB2, 0x0942, 0x002B, 0x0072, 0x0002, 0x001A, 0x0039,
-    0x000D, 0x0007, 0x007B, 0x008E, 0x06DB, 0x00EA, 0x015B, 0x002E,
-    0x0006, 0x0959, 0x027B, 0x0A0E, 0x01AB, 0x008A, 0x0012, 0x001E,
-    0x0575, 0x005B, 0x02AB, 0x00C2, 0x0015, 0x036A, 0x04B2, 0x0099,
-    0x001B, 0x0519, 0x0C19, 0x00DB, 0x004E, 0x0042, 0x0159, 0x03B2,
-    0x030E, 0x00EB, 0x0252, 0x0EAB, 0x018A, 0x00E2, 0x06AB, 0x0242,
-    0x017B, 0x0452, 0x0319, 0x0152, 0x025B, 0x016A, 0x00AB, 0x0052,
-    0x05B2, 0x010E, 0x038E, 0x028A, 0x0359, 0x0019, 0x078A, 0x0C52,
-    0x0D8E, 0x0ED9, 0x02D9, 0x0662, 0x0119, 0x09B2, 0x0BAB, 0x0D19,
-    0x0C5B, 0x00B2, 0x0542, 0x0B8A, 0x02B2, 0x0142, 0x065B, 0x058E,
-    0x0062, 0x018E, 0x038A, 0x00D9, 0x0419, 0x0162, 0x03AB, 0x0075,
-    0x07B2, 0x0032, 0x020E, 0x07AB, 0x006B, 0x045B, 0x01B2, 0x0199,
-    0x002A, 0x0375, 0x0775, 0x0AAB, 0x01D9, 0x003B, 0x060E, 0x0342,
-    0x0175, 0x0262, 0x000A, 0x0005, 0x0559, 0x006A, 0x0D59, 0x0219,
-    0x000E, 0x004A, 0x0009, 0x0719, 0x0059, 0x02DB, 0x00D2, 0x01DB,
-    0x0025, 0x0001, 0x06D9, 0x00F5, 0x0035, 0x00FB, 0x003A, 0x000B,
-    0x0003, 0x0000,
-};
-
-static const uint8_t ac_vlc_desc6_bits[130] = {
-     7, 12, 12,  8,  7,  7,  6,  6,
-     4,  3, 10,  9, 11,  8,  9,  6,
-     4, 12, 10, 12, 10, 10,  7,  5,
-    11, 11, 12,  8,  6, 10, 11,  9,
-     7, 12, 12, 10,  7, 10, 12, 12,
-    10,  8, 10, 12, 10,  8, 12, 10,
-     9, 12, 11,  9, 11, 10, 10, 11,
-    11, 10, 10, 10, 10, 11, 11, 12,
-    12, 12, 11, 11, 11, 12, 12, 12,
-    12, 11, 11, 12, 10, 12, 11, 12,
-    10, 11, 12, 10, 12,  9, 12,  9,
-    11,  8, 12, 11,  8, 12, 12,  9,
-     7, 11, 11, 12,  9,  7, 11, 10,
-    11, 11,  8,  6, 12,  9, 12, 10,
-    10,  7,  5, 11,  9, 11,  8,  9,
-     6,  4, 12,  8,  7,  8,  6,  6,
-     4,  2,
-};
-
-static const uint16_t ac_vlc_desc7_syms[125] = {
-   0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2,
-    0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1,
-    0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5,
-    0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB5, 0xFB3, 0xFB1, 0xFB0,
-    0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF96, 0xF95, 0xF93,
-    0xF91, 0xF90, 0xF86, 0xF81, 0xF80, 0xF73, 0xF71, 0xF70,
-    0xF63, 0xF61, 0xF60, 0xF53, 0xF51, 0xF50, 0xF41, 0xF40,
-    0xF31, 0xF30, 0xF20, 0xF10, 0xF01, 0xF00, 0x121, 0x111,
-    0x101, 0x100, 0x0F1, 0x0F0, 0x0E1, 0x0E0, 0x0D1, 0x0D0,
-    0x0C3, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A3, 0x0A1, 0x0A0,
-    0x093, 0x091, 0x090, 0x081, 0x080, 0x071, 0x070, 0x065,
-    0x063, 0x061, 0x060, 0x055, 0x053, 0x052, 0x051, 0x050,
-    0x046, 0x045, 0x043, 0x042, 0x041, 0x040, 0x036, 0x035,
-    0x034, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024,
-    0x023, 0x022, 0x021, 0x020, 0x018, 0x017, 0x016, 0x015,
-    0x014, 0x013, 0x012, 0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_desc7_codes[125] = {
-    0x0053, 0x009A, 0x0EE2, 0x00D3, 0x006A, 0x0052, 0x003A, 0x0035,
-    0x000D, 0x0007, 0x0062, 0x0125, 0x0142, 0x0019, 0x01F3, 0x0029,
-    0x000E, 0x0082, 0x0ADA, 0x02E3, 0x00E2, 0x0022, 0x0006, 0x0065,
-    0x05E3, 0x0765, 0x0032, 0x0039, 0x0F99, 0x05E2, 0x0099, 0x0033,
-    0x0362, 0x0799, 0x0F65, 0x0073, 0x004A, 0x02A5, 0x0162, 0x0742,
-    0x01A5, 0x00D9, 0x0342, 0x005A, 0x00AA, 0x0EF3, 0x0182, 0x01DA,
-    0x0382, 0x035A, 0x00F3, 0x0673, 0x0165, 0x00E5, 0x06F3, 0x0225,
-    0x0842, 0x025A, 0x07E3, 0x0399, 0x07A5, 0x072A, 0x0F2A, 0x09E3,
-    0x0273, 0x049A, 0x02E5, 0x0B99, 0x02E2, 0x0E73, 0x0562, 0x02F3,
-    0x032A, 0x0F42, 0x00DA, 0x0999, 0x012A, 0x0365, 0x00A5, 0x00E3,
-    0x0199, 0x03E3, 0x019A, 0x01E2, 0x0173, 0x06E5, 0x0059, 0x01E3,
-    0x02DA, 0x002A, 0x000A, 0x06DA, 0x0FA5, 0x0042, 0x01E5, 0x0013,
-    0x03E2, 0x015A, 0x03A5, 0x0442, 0x001A, 0x0005, 0x04A5, 0x0265,
-    0x08A5, 0x0025, 0x029A, 0x0072, 0x0016, 0x0599, 0x00C2, 0x0242,
-    0x00B2, 0x0002, 0x0015, 0x0001, 0x0BE3, 0x06E2, 0x0063, 0x0023,
-    0x0012, 0x0009, 0x0003, 0x000B, 0x0000,
-};
-
-static const uint8_t ac_vlc_desc7_bits[125] = {
-     8, 11, 12,  8,  7,  7,  6,  6,
-     4,  3,  9,  9, 10,  8,  9,  6,
-     4,  9, 12, 10, 10,  7,  5, 10,
-    11, 12,  8,  6, 12, 11,  9,  7,
-    10, 12, 12, 10,  7, 10, 11, 12,
-    10,  8, 11, 10,  8, 12, 10,  9,
-    10, 10, 10, 12, 10, 10, 12, 10,
-    12, 10, 11, 12, 12, 12, 12, 12,
-    11, 11, 11, 12, 11, 12, 11, 11,
-    11, 12, 10, 12, 10, 11, 12, 10,
-    12, 12,  9, 11,  9, 11,  8, 12,
-    12,  9,  7, 11, 12, 12,  9,  7,
-    10, 10, 11, 11,  8,  6, 11, 10,
-    12, 10, 10,  7,  5, 11,  8, 10,
-     8,  8,  6,  4, 12, 12,  8,  7,
-     7,  6,  6,  4,  2,
-};
-
-static const uint16_t ac_vlc_desc8_syms[121] = {
-   0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2,
-    0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1,
-    0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5,
-    0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, 0xFB1,
-    0xFB0, 0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF96, 0xF95,
-    0xF93, 0xF91, 0xF90, 0xF86, 0xF83, 0xF81, 0xF80, 0xF73,
-    0xF71, 0xF70, 0xF63, 0xF61, 0xF60, 0xF51, 0xF50, 0xF41,
-    0xF40, 0xF30, 0xF21, 0xF20, 0x111, 0x101, 0x0F1, 0x0E1,
-    0x0E0, 0x0D1, 0x0D0, 0x0C1, 0x0C0, 0x0B3, 0x0B1, 0x0B0,
-    0x0A3, 0x0A1, 0x0A0, 0x093, 0x091, 0x090, 0x083, 0x081,
-    0x080, 0x073, 0x071, 0x070, 0x065, 0x063, 0x061, 0x060,
-    0x055, 0x053, 0x051, 0x050, 0x046, 0x045, 0x043, 0x042,
-    0x041, 0x040, 0x036, 0x035, 0x034, 0x033, 0x032, 0x031,
-    0x030, 0x026, 0x025, 0x024, 0x023, 0x022, 0x021, 0x020,
-    0x018, 0x017, 0x016, 0x015, 0x014, 0x013, 0x012, 0x011,
-    0x010,
-};
-
-static const uint16_t ac_vlc_desc8_codes[121] = {
-    0x00F6, 0x0676, 0x0EB6, 0x00F3, 0x0056, 0x006A, 0x0039, 0x0003,
-    0x000D, 0x0007, 0x00A2, 0x0173, 0x00CA, 0x0025, 0x0082, 0x0019,
-    0x0001, 0x00B6, 0x0276, 0x02E3, 0x00B2, 0x0062, 0x001A, 0x0175,
-    0x01E3, 0x0BE5, 0x004A, 0x0029, 0x07A5, 0x00E3, 0x030A, 0x0176,
-    0x0023, 0x0042, 0x05CA, 0x00A5, 0x0142, 0x0052, 0x04A5, 0x0B02,
-    0x0D22, 0x0375, 0x0065, 0x0522, 0x0DE3, 0x010A, 0x00F5, 0x0136,
-    0x0275, 0x01B2, 0x03F5, 0x03E3, 0x0002, 0x08E3, 0x01A2, 0x0B36,
-    0x020A, 0x0076, 0x0CE3, 0x07E5, 0x070A, 0x03A5, 0x02B6, 0x0036,
-    0x01E5, 0x02A5, 0x05E3, 0x07B6, 0x07F5, 0x0736, 0x0BA5, 0x0075,
-    0x0302, 0x0FE5, 0x01B6, 0x0102, 0x04E3, 0x0022, 0x08A5, 0x01CA,
-    0x00E5, 0x0F0A, 0x05E5, 0x0096, 0x0A76, 0x0336, 0x0236, 0x0012,
-    0x03B6, 0x0BF5, 0x0073, 0x0035, 0x02B2, 0x000A, 0x0476, 0x0122,
-    0x0016, 0x0009, 0x0322, 0x01F5, 0x03E5, 0x01A5, 0x03CA, 0x0072,
-    0x0006, 0x06A5, 0x0032, 0x02CA, 0x008A, 0x00C2, 0x0015, 0x000E,
-    0x0702, 0x06B6, 0x0063, 0x0033, 0x002A, 0x0005, 0x0013, 0x000B,
-    0x0000,
-};
-
-static const uint8_t ac_vlc_desc8_bits[121] = {
-     8, 11, 12,  8,  7,  7,  6,  6,
-     4,  3,  9,  9, 10,  8,  8,  6,
-     4, 10, 12, 10, 10,  7,  5, 10,
-    11, 12,  8,  6, 11, 12, 11,  9,
-     7,  9, 11, 12,  9,  7, 11, 12,
-    12, 10,  8, 12, 12, 10,  9, 10,
-    10,  9, 12, 10,  9, 12,  9, 12,
-    10, 11, 12, 12, 12, 12, 11, 10,
-    11, 11, 12, 11, 11, 11, 12, 10,
-    12, 12, 10, 10, 12,  9, 12, 11,
-     9, 12, 11,  8, 12, 12, 10,  7,
-    11, 12,  9,  7, 10, 10, 11, 11,
-     8,  6, 10, 10, 12, 10, 10,  7,
-     5, 11,  8, 10,  8,  8,  6,  4,
-    11, 12,  8,  7,  7,  6,  6,  4,
-     2,
-};
-
-static const uint16_t ac_vlc_desc9_syms[114] = {
-   0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2,
-    0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1,
-    0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC5,
-    0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3, 0xFB2,
-    0xFB1, 0xFB0, 0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0, 0xF96,
-    0xF93, 0xF91, 0xF90, 0xF83, 0xF81, 0xF80, 0xF73, 0xF71,
-    0xF70, 0xF61, 0xF60, 0xF51, 0xF50, 0xF40, 0xF31, 0xF30,
-    0xF21, 0x121, 0x0F1, 0x0E1, 0x0D1, 0x0D0, 0x0C1, 0x0C0,
-    0x0B1, 0x0B0, 0x0A3, 0x0A1, 0x0A0, 0x093, 0x091, 0x090,
-    0x083, 0x081, 0x080, 0x073, 0x071, 0x070, 0x065, 0x063,
-    0x061, 0x060, 0x055, 0x053, 0x051, 0x050, 0x045, 0x043,
-    0x042, 0x041, 0x040, 0x036, 0x035, 0x034, 0x033, 0x032,
-    0x031, 0x030, 0x026, 0x025, 0x024, 0x023, 0x022, 0x021,
-    0x020, 0x018, 0x017, 0x016, 0x015, 0x014, 0x013, 0x012,
-    0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_desc9_codes[114] = {
-    0x0061, 0x0403, 0x0DB1, 0x0012, 0x0071, 0x0056, 0x0035, 0x0023,
-    0x000D, 0x0007, 0x0243, 0x01D3, 0x026A, 0x00A1, 0x00A2, 0x0011,
-    0x000E, 0x01AA, 0x0531, 0x0093, 0x0222, 0x0032, 0x0006, 0x07F2,
-    0x04D3, 0x0C43, 0x0072, 0x0001, 0x0343, 0x05F2, 0x04AA, 0x03F2,
-    0x0031, 0x0045, 0x0143, 0x00AA, 0x0B31, 0x00F2, 0x00C3, 0x0693,
-    0x0BF2, 0x0203, 0x00E1, 0x03B1, 0x02D3, 0x00B1, 0x056A, 0x01D2,
-    0x008A, 0x046A, 0x01E2, 0x0003, 0x0103, 0x01B1, 0x02E2, 0x0293,
-    0x016A, 0x04E2, 0x0443, 0x0521, 0x0321, 0x0043, 0x00D3, 0x00E2,
-    0x0703, 0x00D2, 0x0731, 0x0A93, 0x0393, 0x0803, 0x0422, 0x0383,
-    0x018A, 0x006A, 0x0021, 0x096A, 0x0303, 0x0052, 0x0CE2, 0x0D31,
-    0x038A, 0x0013, 0x01F2, 0x0E93, 0x0083, 0x0005, 0x02D2, 0x0121,
-    0x0022, 0x00EA, 0x0036, 0x0122, 0x0193, 0x0331, 0x0183, 0x02AA,
-    0x004A, 0x001A, 0x0131, 0x002A, 0x036A, 0x000A, 0x0062, 0x0025,
-    0x0009, 0x06E2, 0x05B1, 0x0053, 0x0002, 0x0016, 0x0015, 0x0033,
-    0x000B, 0x0000,
-};
-
-static const uint8_t ac_vlc_desc9_bits[114] = {
-     8, 11, 12,  7,  7,  7,  6,  6,
-     4,  3, 10,  9, 10,  8,  8,  6,
-     4,  9, 12, 10, 10,  7,  5, 11,
-    11, 12,  8,  6, 10, 11, 11, 12,
-     9,  7, 10, 11, 12,  9,  8, 12,
-    12, 10,  8, 10, 10,  9, 11,  9,
-     9, 11,  9, 12, 10, 11, 11, 12,
-    12, 12, 12, 11, 10, 11, 11, 11,
-    11, 10, 11, 12, 10, 12, 11, 10,
-    10, 11,  9, 12, 11,  8, 12, 12,
-    10,  8, 11, 12,  9,  7, 10, 11,
-    11,  8,  6,  9, 10, 12, 10, 10,
-     7,  5, 11,  8, 10,  8,  8,  6,
-     4, 11, 12,  8,  6,  7,  6,  6,
-     4,  2,
-};
-
-static const uint16_t ac_vlc_descA_syms[110] = {
-   0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2,
-    0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1,
-    0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6,
-    0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3,
-    0xFB2, 0xFB1, 0xFB0, 0xFA6, 0xFA5, 0xFA3, 0xFA1, 0xFA0,
-    0xF96, 0xF93, 0xF91, 0xF90, 0xF83, 0xF81, 0xF80, 0xF73,
-    0xF71, 0xF70, 0xF61, 0xF60, 0xF51, 0xF50, 0xF41, 0xF40,
-    0xF31, 0x0E1, 0x0D1, 0x0C1, 0x0C0, 0x0B1, 0x0B0, 0x0A1,
-    0x0A0, 0x093, 0x091, 0x090, 0x083, 0x081, 0x080, 0x073,
-    0x071, 0x070, 0x063, 0x061, 0x060, 0x055, 0x053, 0x051,
-    0x050, 0x045, 0x044, 0x043, 0x042, 0x041, 0x040, 0x036,
-    0x035, 0x034, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025,
-    0x024, 0x023, 0x022, 0x021, 0x020, 0x018, 0x017, 0x016,
-    0x015, 0x014, 0x013, 0x012, 0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_descA_codes[110] = {
-    0x002A, 0x04C5, 0x02A3, 0x004A, 0x0015, 0x0005, 0x0003, 0x0013,
-    0x000D, 0x0007, 0x0171, 0x0032, 0x0371, 0x0076, 0x0042, 0x0011,
-    0x000E, 0x00AA, 0x04D5, 0x03A3, 0x06A3, 0x0062, 0x001A, 0x06D5,
-    0x07F2, 0x0223, 0x0CD5, 0x006A, 0x0001, 0x00F6, 0x0623, 0x03F2,
-    0x07EA, 0x01F1, 0x0021, 0x03D5, 0x08C2, 0x07F6, 0x00F2, 0x00E3,
-    0x0FEA, 0x02C5, 0x01AA, 0x0082, 0x04A3, 0x00B6, 0x0071, 0x03B2,
-    0x0023, 0x01B6, 0x08A3, 0x0002, 0x0BB2, 0x00C5, 0x02EA, 0x0C23,
-    0x0FF6, 0x0423, 0x07B2, 0x01C5, 0x07D5, 0x01EA, 0x06EA, 0x02C2,
-    0x01F6, 0x01D5, 0x01B2, 0x00B2, 0x04F1, 0x03EA, 0x01A2, 0x02A2,
-    0x02D5, 0x0123, 0x00D5, 0x01F2, 0x0055, 0x05B2, 0x04C2, 0x0102,
-    0x0061, 0x05D5, 0x00C2, 0x00F1, 0x00A3, 0x0045, 0x0016, 0x01A3,
-    0x01C2, 0x08D5, 0x03C5, 0x00EA, 0x000A, 0x0006, 0x00A2, 0x0036,
-    0x02F1, 0x0072, 0x0022, 0x0025, 0x0009, 0x03F6, 0x0AA3, 0x0063,
-    0x0012, 0x0031, 0x0035, 0x0033, 0x000B, 0x0000,
-};
-
-static const uint8_t ac_vlc_descA_bits[110] = {
-     8, 11, 12,  7,  7,  7,  6,  6,
-     4,  3, 10,  8, 10,  8,  8,  6,
-     4,  9, 12, 10, 11,  7,  5, 11,
-    11, 11, 12,  8,  6,  9, 11, 11,
-    12,  9,  7, 11, 12, 12,  9,  8,
-    12, 10,  9,  8, 11,  9,  9, 12,
-    11,  9, 12,  9, 12, 11, 11, 12,
-    12, 12, 11, 10, 11, 10, 11, 10,
-    10, 11, 11,  9, 11, 11,  9, 10,
-    11,  9, 12, 10,  8, 11, 11,  9,
-     7, 11, 12, 11, 12,  8,  6, 10,
-     9, 12, 10, 10,  7,  5, 10,  8,
-    10,  8,  8,  6,  4, 11, 12,  8,
-     6,  7,  6,  6,  4,  2,
-};
-
-static const uint16_t ac_vlc_descB_syms[101] = {
-   0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2,
-    0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1,
-    0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6,
-    0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3,
-    0xFB1, 0xFB0, 0xFA6, 0xFA3, 0xFA1, 0xFA0, 0xF93, 0xF91,
-    0xF90, 0xF83, 0xF81, 0xF80, 0xF71, 0xF70, 0xF61, 0xF60,
-    0xF51, 0xF50, 0xF41, 0x0F1, 0x0D1, 0x0C1, 0x0B1, 0x0B0,
-    0x0A1, 0x0A0, 0x091, 0x090, 0x083, 0x081, 0x080, 0x073,
-    0x071, 0x070, 0x063, 0x061, 0x060, 0x055, 0x053, 0x051,
-    0x050, 0x045, 0x043, 0x042, 0x041, 0x040, 0x036, 0x035,
-    0x034, 0x033, 0x032, 0x031, 0x030, 0x026, 0x025, 0x024,
-    0x023, 0x022, 0x021, 0x020, 0x018, 0x017, 0x016, 0x015,
-    0x014, 0x013, 0x012, 0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_descB_codes[101] = {
-    0x00EE, 0x03A5, 0x0B73, 0x004E, 0x0035, 0x0015, 0x0023, 0x0013,
-    0x000D, 0x0007, 0x0673, 0x01F3, 0x02FE, 0x0096, 0x0133, 0x001E,
-    0x0001, 0x0116, 0x00F5, 0x03F5, 0x0473, 0x0052, 0x001A, 0x01D5,
-    0x0025, 0x0073, 0x0633, 0x0086, 0x0036, 0x012E, 0x0155, 0x0006,
-    0x0055, 0x000E, 0x0106, 0x023E, 0x0192, 0x0075, 0x0173, 0x01AE,
-    0x00D5, 0x08F5, 0x002E, 0x01FE, 0x0406, 0x00AE, 0x0E3E, 0x0206,
-    0x013E, 0x0373, 0x0D55, 0x063E, 0x0E33, 0x033E, 0x01F5, 0x0273,
-    0x003E, 0x06A5, 0x0092, 0x03D5, 0x04F5, 0x053E, 0x0016, 0x00FE,
-    0x07A5, 0x0125, 0x0506, 0x0292, 0x00BE, 0x0425, 0x0F73, 0x02F5,
-    0x0056, 0x0233, 0x02A5, 0x0C25, 0x007E, 0x0026, 0x0355, 0x0033,
-    0x0555, 0x01A5, 0x0306, 0x0046, 0x000A, 0x0225, 0x006E, 0x00A5,
-    0x0012, 0x00F3, 0x0005, 0x0009, 0x073E, 0x0773, 0x00B3, 0x0032,
-    0x0065, 0x0003, 0x0002, 0x000B, 0x0000,
-};
-
-static const uint8_t ac_vlc_descB_bits[101] = {
-     8, 11, 12,  7,  7,  7,  6,  6,
-     4,  3, 11,  9, 10,  8,  9,  6,
-     4,  9, 12, 10, 11,  7,  5, 10,
-    11, 11, 12,  8,  6,  9, 11, 11,
-     9,  7, 11, 11,  9,  8, 10,  9,
-     9, 12,  9,  9, 11,  9, 12, 10,
-    11, 12, 12, 12, 12, 11, 10, 11,
-    10, 11, 10, 10, 11, 11,  9, 10,
-    11,  9, 11, 10,  8, 12, 12, 10,
-     7, 11, 11, 12,  8,  6, 10, 10,
-    12, 10, 10,  7,  5, 10,  8, 10,
-     8,  9,  6,  4, 11, 12,  8,  6,
-     7,  6,  5,  4,  2,
-};
-
-static const uint16_t ac_vlc_descC_syms[96] = {
-    0x1000, 0xFF8, 0xFF7, 0xFF6, 0xFF5, 0xFF4, 0xFF3, 0xFF2,
-    0xFF1, 0xFF0, 0xFE6, 0xFE5, 0xFE4, 0xFE3, 0xFE2, 0xFE1,
-    0xFE0, 0xFD5, 0xFD4, 0xFD3, 0xFD2, 0xFD1, 0xFD0, 0xFC6,
-    0xFC5, 0xFC3, 0xFC2, 0xFC1, 0xFC0, 0xFB6, 0xFB5, 0xFB3,
-    0xFB1, 0xFB0, 0xFA6, 0xFA3, 0xFA1, 0xFA0, 0xF93, 0xF91,
-    0xF90, 0xF81, 0xF80, 0xF71, 0xF70, 0xF61, 0xF60, 0xF51,
-    0x0E1, 0x0C1, 0x0B1, 0x0A1, 0x0A0, 0x091, 0x090, 0x083,
-    0x081, 0x080, 0x073, 0x071, 0x070, 0x063, 0x061, 0x060,
-    0x055, 0x053, 0x051, 0x050, 0x045, 0x043, 0x042, 0x041,
-    0x040, 0x036, 0x035, 0x034, 0x033, 0x032, 0x031, 0x030,
-    0x026, 0x025, 0x024, 0x023, 0x022, 0x021, 0x020, 0x018,
-    0x017, 0x016, 0x015, 0x014, 0x013, 0x012, 0x011, 0x010,
-};
-
-static const uint16_t ac_vlc_descC_codes[96] = {
-    0x00DE, 0x072E, 0x0576, 0x006E, 0x0075, 0x0055, 0x0013, 0x0033,
-    0x000D, 0x0007, 0x07D2, 0x0052, 0x0065, 0x00CE, 0x0183, 0x003E,
-    0x0001, 0x002E, 0x0F35, 0x0003, 0x0243, 0x001A, 0x0006, 0x01A5,
-    0x0043, 0x0012, 0x0E43, 0x00B6, 0x0016, 0x0135, 0x0176, 0x0643,
-    0x0035, 0x001E, 0x0735, 0x0283, 0x0125, 0x00AE, 0x00D2, 0x0165,
-    0x0103, 0x0603, 0x00E5, 0x0C43, 0x02B5, 0x04A5, 0x00A5, 0x0443,
-    0x0265, 0x0476, 0x0212, 0x0112, 0x0376, 0x012E, 0x02D2, 0x0083,
-    0x0483, 0x015E, 0x06A5, 0x0335, 0x005E, 0x0025, 0x01D2, 0x00F6,
-    0x03D2, 0x032E, 0x03B5, 0x005A, 0x0203, 0x02A5, 0x0BD2, 0x004E,
-    0x0032, 0x01B5, 0x00B5, 0x0A65, 0x0225, 0x0276, 0x000E, 0x000A,
-    0x03E5, 0x0143, 0x01E5, 0x0036, 0x0092, 0x0005, 0x0009, 0x0665,
-    0x0076, 0x00C3, 0x003A, 0x0015, 0x0023, 0x0002, 0x000B, 0x0000,
-};
-
-static const uint8_t ac_vlc_descC_bits[96] = {
-     8, 11, 11,  7,  7,  7,  6,  6,
-     4,  3, 11,  8, 10,  8,  9,  6,
-     4,  9, 12, 10, 11,  7,  5,  9,
-    11, 10, 12,  8,  6, 10, 11, 12,
-     9,  7, 12, 10,  9,  8, 10,  9,
-     9, 11,  9, 12, 10, 11, 11, 12,
-    12, 11, 10,  9, 10, 10, 10, 11,
-    11,  9, 11, 11,  9, 10, 10,  8,
-    12, 11, 10,  7, 11, 11, 12,  8,
-     6, 10, 10, 12, 10, 10,  7,  5,
-    10,  9, 10,  8,  8,  6,  4, 11,
-    11,  8,  6,  7,  6,  5,  4,  2,
-};
-
-static const int tscc2_ac_vlc_sizes[NUM_VLC_SETS] = {
-    172, 169, 165, 162, 131, 132, 130, 125, 121, 114, 110, 101, 96
-};
-
-static const uint16_t *tscc2_ac_vlc_syms[NUM_VLC_SETS] = {
-    ac_vlc_desc0_syms, ac_vlc_desc1_syms, ac_vlc_desc2_syms, ac_vlc_desc3_syms,
-    ac_vlc_desc4_syms, ac_vlc_desc5_syms, ac_vlc_desc6_syms, ac_vlc_desc7_syms,
-    ac_vlc_desc8_syms, ac_vlc_desc9_syms, ac_vlc_descA_syms, ac_vlc_descB_syms,
-    ac_vlc_descC_syms,
-};
-
-static const uint16_t *tscc2_ac_vlc_codes[NUM_VLC_SETS] = {
-    ac_vlc_desc0_codes, ac_vlc_desc1_codes, ac_vlc_desc2_codes,
-    ac_vlc_desc3_codes, ac_vlc_desc4_codes, ac_vlc_desc5_codes,
-    ac_vlc_desc6_codes, ac_vlc_desc7_codes, ac_vlc_desc8_codes,
-    ac_vlc_desc9_codes, ac_vlc_descA_codes, ac_vlc_descB_codes,
-    ac_vlc_descC_codes,
-};
-
-static const uint8_t *tscc2_ac_vlc_bits[NUM_VLC_SETS] = {
-    ac_vlc_desc0_bits, ac_vlc_desc1_bits, ac_vlc_desc2_bits, ac_vlc_desc3_bits,
-    ac_vlc_desc4_bits, ac_vlc_desc5_bits, ac_vlc_desc6_bits, ac_vlc_desc7_bits,
-    ac_vlc_desc8_bits, ac_vlc_desc9_bits, ac_vlc_descA_bits, ac_vlc_descB_bits,
-    ac_vlc_descC_bits,
-};
-
-#endif /* AVCODEC_TSCC2_DATA_H */
diff --git a/deps/libav/libavcodec/tta.c b/deps/libav/libavcodec/tta.c
deleted file mode 100644
index 4d2e2a0..0000000
--- a/deps/libav/libavcodec/tta.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * TTA (The Lossless True Audio) decoder
- * Copyright (c) 2006 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * TTA (The Lossless True Audio) decoder
- * @see http://www.true-audio.com/
- * @see http://tta.corecodec.org/
- * @author Alex Beregszaszi
- */
-
-#define BITSTREAM_READER_LE
-#include <limits.h>
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "libavutil/crc.h"
-
-#define FORMAT_SIMPLE    1
-#define FORMAT_ENCRYPTED 2
-
-#define MAX_ORDER 16
-typedef struct TTAFilter {
-    int32_t shift, round, error;
-    int32_t qm[MAX_ORDER];
-    int32_t dx[MAX_ORDER];
-    int32_t dl[MAX_ORDER];
-} TTAFilter;
-
-typedef struct TTARice {
-    uint32_t k0, k1, sum0, sum1;
-} TTARice;
-
-typedef struct TTAChannel {
-    int32_t predictor;
-    TTAFilter filter;
-    TTARice rice;
-} TTAChannel;
-
-typedef struct TTAContext {
-    AVCodecContext *avctx;
-    GetBitContext gb;
-    const AVCRC *crc_table;
-
-    int format, channels, bps;
-    unsigned data_length;
-    int frame_length, last_frame_length;
-
-    int32_t *decode_buffer;
-
-    TTAChannel *ch_ctx;
-} TTAContext;
-
-static const uint32_t shift_1[] = {
-    0x00000001, 0x00000002, 0x00000004, 0x00000008,
-    0x00000010, 0x00000020, 0x00000040, 0x00000080,
-    0x00000100, 0x00000200, 0x00000400, 0x00000800,
-    0x00001000, 0x00002000, 0x00004000, 0x00008000,
-    0x00010000, 0x00020000, 0x00040000, 0x00080000,
-    0x00100000, 0x00200000, 0x00400000, 0x00800000,
-    0x01000000, 0x02000000, 0x04000000, 0x08000000,
-    0x10000000, 0x20000000, 0x40000000, 0x80000000,
-    0x80000000, 0x80000000, 0x80000000, 0x80000000,
-    0x80000000, 0x80000000, 0x80000000, 0x80000000
-};
-
-static const uint32_t * const shift_16 = shift_1 + 4;
-
-static const int32_t ttafilter_configs[4] = {
-    10,
-    9,
-    10,
-    12
-};
-
-static void ttafilter_init(TTAFilter *c, int32_t shift) {
-    memset(c, 0, sizeof(TTAFilter));
-    c->shift = shift;
-   c->round = shift_1[shift-1];
-//    c->round = 1 << (shift - 1);
-}
-
-// FIXME: copy paste from original
-static inline void memshl(register int32_t *a, register int32_t *b) {
-    *a++ = *b++;
-    *a++ = *b++;
-    *a++ = *b++;
-    *a++ = *b++;
-    *a++ = *b++;
-    *a++ = *b++;
-    *a++ = *b++;
-    *a = *b;
-}
-
-static inline void ttafilter_process(TTAFilter *c, int32_t *in)
-{
-    register int32_t *dl = c->dl, *qm = c->qm, *dx = c->dx, sum = c->round;
-
-    if (!c->error) {
-        sum += *dl++ * *qm, qm++;
-        sum += *dl++ * *qm, qm++;
-        sum += *dl++ * *qm, qm++;
-        sum += *dl++ * *qm, qm++;
-        sum += *dl++ * *qm, qm++;
-        sum += *dl++ * *qm, qm++;
-        sum += *dl++ * *qm, qm++;
-        sum += *dl++ * *qm, qm++;
-        dx += 8;
-    } else if(c->error < 0) {
-        sum += *dl++ * (*qm -= *dx++), qm++;
-        sum += *dl++ * (*qm -= *dx++), qm++;
-        sum += *dl++ * (*qm -= *dx++), qm++;
-        sum += *dl++ * (*qm -= *dx++), qm++;
-        sum += *dl++ * (*qm -= *dx++), qm++;
-        sum += *dl++ * (*qm -= *dx++), qm++;
-        sum += *dl++ * (*qm -= *dx++), qm++;
-        sum += *dl++ * (*qm -= *dx++), qm++;
-    } else {
-        sum += *dl++ * (*qm += *dx++), qm++;
-        sum += *dl++ * (*qm += *dx++), qm++;
-        sum += *dl++ * (*qm += *dx++), qm++;
-        sum += *dl++ * (*qm += *dx++), qm++;
-        sum += *dl++ * (*qm += *dx++), qm++;
-        sum += *dl++ * (*qm += *dx++), qm++;
-        sum += *dl++ * (*qm += *dx++), qm++;
-        sum += *dl++ * (*qm += *dx++), qm++;
-    }
-
-    *(dx-0) = ((*(dl-1) >> 30) | 1) << 2;
-    *(dx-1) = ((*(dl-2) >> 30) | 1) << 1;
-    *(dx-2) = ((*(dl-3) >> 30) | 1) << 1;
-    *(dx-3) = ((*(dl-4) >> 30) | 1);
-
-    c->error = *in;
-    *in += (sum >> c->shift);
-    *dl = *in;
-
-    *(dl-1) = *dl - *(dl-1);
-    *(dl-2) = *(dl-1) - *(dl-2);
-    *(dl-3) = *(dl-2) - *(dl-3);
-
-    memshl(c->dl, c->dl + 1);
-    memshl(c->dx, c->dx + 1);
-}
-
-static void rice_init(TTARice *c, uint32_t k0, uint32_t k1)
-{
-    c->k0 = k0;
-    c->k1 = k1;
-    c->sum0 = shift_16[k0];
-    c->sum1 = shift_16[k1];
-}
-
-static int tta_get_unary(GetBitContext *gb)
-{
-    int ret = 0;
-
-    // count ones
-    while (get_bits_left(gb) > 0 && get_bits1(gb))
-        ret++;
-    return ret;
-}
-
-static int tta_check_crc(TTAContext *s, const uint8_t *buf, int buf_size)
-{
-    uint32_t crc, CRC;
-
-    CRC = AV_RL32(buf + buf_size);
-    crc = av_crc(s->crc_table, 0xFFFFFFFFU, buf, buf_size);
-    if (CRC != (crc ^ 0xFFFFFFFFU)) {
-        av_log(s->avctx, AV_LOG_ERROR, "CRC error\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-static av_cold int tta_decode_init(AVCodecContext * avctx)
-{
-    TTAContext *s = avctx->priv_data;
-    int total_frames;
-
-    s->avctx = avctx;
-
-    // 30bytes includes a seektable with one frame
-    if (avctx->extradata_size < 30)
-        return -1;
-
-    init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size * 8);
-    if (show_bits_long(&s->gb, 32) == AV_RL32("TTA1"))
-    {
-        if (avctx->err_recognition & AV_EF_CRCCHECK) {
-            s->crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
-            tta_check_crc(s, avctx->extradata, 18);
-        }
-
-        /* signature */
-        skip_bits_long(&s->gb, 32);
-
-        s->format = get_bits(&s->gb, 16);
-        if (s->format > 2) {
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid format\n");
-            return -1;
-        }
-        if (s->format == FORMAT_ENCRYPTED) {
-            avpriv_report_missing_feature(s->avctx, "Encrypted TTA");
-            return AVERROR_PATCHWELCOME;
-        }
-        avctx->channels = s->channels = get_bits(&s->gb, 16);
-        avctx->bits_per_coded_sample = get_bits(&s->gb, 16);
-        s->bps = (avctx->bits_per_coded_sample + 7) / 8;
-        avctx->sample_rate = get_bits_long(&s->gb, 32);
-        s->data_length = get_bits_long(&s->gb, 32);
-        skip_bits_long(&s->gb, 32); // CRC32 of header
-
-        if (s->channels == 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid number of channels\n");
-            return AVERROR_INVALIDDATA;
-        } else if (avctx->sample_rate == 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid samplerate\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        switch(s->bps) {
-        case 2:
-            avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-            avctx->bits_per_raw_sample = 16;
-            break;
-        case 3:
-            avctx->sample_fmt = AV_SAMPLE_FMT_S32;
-            avctx->bits_per_raw_sample = 24;
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Invalid/unsupported sample format.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        // prevent overflow
-        if (avctx->sample_rate > 0x7FFFFFu) {
-            av_log(avctx, AV_LOG_ERROR, "sample_rate too large\n");
-            return AVERROR(EINVAL);
-        }
-        s->frame_length = 256 * avctx->sample_rate / 245;
-
-        s->last_frame_length = s->data_length % s->frame_length;
-        total_frames = s->data_length / s->frame_length +
-                       (s->last_frame_length ? 1 : 0);
-
-        av_log(s->avctx, AV_LOG_DEBUG, "format: %d chans: %d bps: %d rate: %d block: %d\n",
-            s->format, avctx->channels, avctx->bits_per_coded_sample, avctx->sample_rate,
-            avctx->block_align);
-        av_log(s->avctx, AV_LOG_DEBUG, "data_length: %d frame_length: %d last: %d total: %d\n",
-            s->data_length, s->frame_length, s->last_frame_length, total_frames);
-
-        // FIXME: seek table
-        if (avctx->extradata_size <= 26 || total_frames > INT_MAX / 4 ||
-            avctx->extradata_size - 26 < total_frames * 4)
-            av_log(avctx, AV_LOG_WARNING, "Seek table missing or too small\n");
-        else if (avctx->err_recognition & AV_EF_CRCCHECK) {
-            int ret = tta_check_crc(s, avctx->extradata + 22, total_frames * 4);
-            if (ret < 0 && avctx->err_recognition & AV_EF_EXPLODE)
-                return AVERROR_INVALIDDATA;
-        }
-        skip_bits_long(&s->gb, 32 * total_frames);
-        skip_bits_long(&s->gb, 32); // CRC32 of seektable
-
-        if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){
-            av_log(avctx, AV_LOG_ERROR, "frame_length too large\n");
-            return -1;
-        }
-
-        if (s->bps == 2) {
-            s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels);
-            if (!s->decode_buffer)
-                return AVERROR(ENOMEM);
-        }
-        s->ch_ctx = av_malloc(avctx->channels * sizeof(*s->ch_ctx));
-        if (!s->ch_ctx) {
-            av_freep(&s->decode_buffer);
-            return AVERROR(ENOMEM);
-        }
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "Wrong extradata present\n");
-        return -1;
-    }
-
-    return 0;
-}
-
-static int tta_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    TTAContext *s = avctx->priv_data;
-    int i, ret;
-    int cur_chan = 0, framelen = s->frame_length;
-    int32_t *p;
-
-    if (avctx->err_recognition & AV_EF_CRCCHECK) {
-        if (buf_size < 4 ||
-            (tta_check_crc(s, buf, buf_size - 4) && avctx->err_recognition & AV_EF_EXPLODE))
-            return AVERROR_INVALIDDATA;
-    }
-
-    init_get_bits(&s->gb, buf, buf_size*8);
-
-    /* get output buffer */
-    frame->nb_samples = framelen;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    // decode directly to output buffer for 24-bit sample format
-    if (s->bps == 3)
-        s->decode_buffer = (int32_t *)frame->data[0];
-
-    // init per channel states
-    for (i = 0; i < s->channels; i++) {
-        s->ch_ctx[i].predictor = 0;
-        ttafilter_init(&s->ch_ctx[i].filter, ttafilter_configs[s->bps-1]);
-        rice_init(&s->ch_ctx[i].rice, 10, 10);
-    }
-
-    i = 0;
-    for (p = s->decode_buffer; p < s->decode_buffer + (framelen * s->channels); p++) {
-        int32_t *predictor = &s->ch_ctx[cur_chan].predictor;
-        TTAFilter *filter = &s->ch_ctx[cur_chan].filter;
-        TTARice *rice = &s->ch_ctx[cur_chan].rice;
-        uint32_t unary, depth, k;
-        int32_t value;
-
-        unary = tta_get_unary(&s->gb);
-
-        if (unary == 0) {
-            depth = 0;
-            k = rice->k0;
-        } else {
-            depth = 1;
-            k = rice->k1;
-            unary--;
-        }
-
-        if (get_bits_left(&s->gb) < k) {
-            ret = AVERROR_INVALIDDATA;
-            goto error;
-        }
-
-        if (k) {
-            if (k > MIN_CACHE_BITS) {
-                ret = AVERROR_INVALIDDATA;
-                goto error;
-            }
-            value = (unary << k) + get_bits(&s->gb, k);
-        } else
-            value = unary;
-
-        // FIXME: copy paste from original
-        switch (depth) {
-        case 1:
-            rice->sum1 += value - (rice->sum1 >> 4);
-            if (rice->k1 > 0 && rice->sum1 < shift_16[rice->k1])
-                rice->k1--;
-            else if(rice->sum1 > shift_16[rice->k1 + 1])
-                rice->k1++;
-            value += shift_1[rice->k0];
-        default:
-            rice->sum0 += value - (rice->sum0 >> 4);
-            if (rice->k0 > 0 && rice->sum0 < shift_16[rice->k0])
-                rice->k0--;
-            else if(rice->sum0 > shift_16[rice->k0 + 1])
-                rice->k0++;
-        }
-
-        // extract coded value
-        *p = 1 + ((value >> 1) ^ ((value & 1) - 1));
-
-        // run hybrid filter
-        ttafilter_process(filter, p);
-
-        // fixed order prediction
-#define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k)
-        switch (s->bps) {
-        case 1: *p += PRED(*predictor, 4); break;
-        case 2:
-        case 3: *p += PRED(*predictor, 5); break;
-        case 4: *p +=      *predictor;     break;
-        }
-        *predictor = *p;
-
-        // flip channels
-        if (cur_chan < (s->channels-1))
-            cur_chan++;
-        else {
-            // decorrelate in case of multiple channels
-            if (s->channels > 1) {
-                int32_t *r = p - 1;
-                for (*p += *r / 2; r > p - s->channels; r--)
-                    *r = *(r + 1) - *r;
-            }
-            cur_chan = 0;
-            i++;
-            // check for last frame
-            if (i == s->last_frame_length && get_bits_left(&s->gb) / 8 == 4) {
-                frame->nb_samples = framelen = s->last_frame_length;
-                break;
-            }
-        }
-    }
-
-    align_get_bits(&s->gb);
-    if (get_bits_left(&s->gb) < 32) {
-        ret = AVERROR_INVALIDDATA;
-        goto error;
-    }
-    skip_bits_long(&s->gb, 32); // frame crc
-
-    // convert to output buffer
-    if (s->bps == 2) {
-        int16_t *samples = (int16_t *)frame->data[0];
-        for (p = s->decode_buffer; p < s->decode_buffer + (framelen * s->channels); p++)
-            *samples++ = *p;
-    } else {
-        // shift samples for 24-bit sample format
-        int32_t *samples = (int32_t *)frame->data[0];
-        for (i = 0; i < framelen * s->channels; i++)
-            *samples++ <<= 8;
-        // reset decode buffer
-        s->decode_buffer = NULL;
-    }
-
-    *got_frame_ptr = 1;
-
-    return buf_size;
-error:
-    // reset decode buffer
-    if (s->bps == 3)
-        s->decode_buffer = NULL;
-    return ret;
-}
-
-static av_cold int tta_decode_close(AVCodecContext *avctx) {
-    TTAContext *s = avctx->priv_data;
-
-    av_free(s->decode_buffer);
-    av_freep(&s->ch_ctx);
-
-    return 0;
-}
-
-AVCodec ff_tta_decoder = {
-    .name           = "tta",
-    .long_name      = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_TTA,
-    .priv_data_size = sizeof(TTAContext),
-    .init           = tta_decode_init,
-    .close          = tta_decode_close,
-    .decode         = tta_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/twinvq.c b/deps/libav/libavcodec/twinvq.c
deleted file mode 100644
index e1b1c7b..0000000
--- a/deps/libav/libavcodec/twinvq.c
+++ /dev/null
@@ -1,805 +0,0 @@
-/*
- * TwinVQ decoder
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <math.h>
-#include <stdint.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "fft.h"
-#include "internal.h"
-#include "lsp.h"
-#include "sinewin.h"
-#include "twinvq.h"
-
-/**
- * Evaluate a single LPC amplitude spectrum envelope coefficient from the line
- * spectrum pairs.
- *
- * @param lsp a vector of the cosine of the LSP values
- * @param cos_val cos(PI*i/N) where i is the index of the LPC amplitude
- * @param order the order of the LSP (and the size of the *lsp buffer). Must
- *        be a multiple of four.
- * @return the LPC value
- *
- * @todo reuse code from Vorbis decoder: vorbis_floor0_decode
- */
-static float eval_lpc_spectrum(const float *lsp, float cos_val, int order)
-{
-    int j;
-    float p         = 0.5f;
-    float q         = 0.5f;
-    float two_cos_w = 2.0f * cos_val;
-
-    for (j = 0; j + 1 < order; j += 2 * 2) {
-        // Unroll the loop once since order is a multiple of four
-        q *= lsp[j]     - two_cos_w;
-        p *= lsp[j + 1] - two_cos_w;
-
-        q *= lsp[j + 2] - two_cos_w;
-        p *= lsp[j + 3] - two_cos_w;
-    }
-
-    p *= p * (2.0f - two_cos_w);
-    q *= q * (2.0f + two_cos_w);
-
-    return 0.5 / (p + q);
-}
-
-/**
- * Evaluate the LPC amplitude spectrum envelope from the line spectrum pairs.
- */
-static void eval_lpcenv(TwinVQContext *tctx, const float *cos_vals, float *lpc)
-{
-    int i;
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int size_s = mtab->size / mtab->fmode[TWINVQ_FT_SHORT].sub;
-
-    for (i = 0; i < size_s / 2; i++) {
-        float cos_i = tctx->cos_tabs[0][i];
-        lpc[i]              = eval_lpc_spectrum(cos_vals,  cos_i, mtab->n_lsp);
-        lpc[size_s - i - 1] = eval_lpc_spectrum(cos_vals, -cos_i, mtab->n_lsp);
-    }
-}
-
-static void interpolate(float *out, float v1, float v2, int size)
-{
-    int i;
-    float step = (v1 - v2) / (size + 1);
-
-    for (i = 0; i < size; i++) {
-        v2    += step;
-        out[i] = v2;
-    }
-}
-
-static inline float get_cos(int idx, int part, const float *cos_tab, int size)
-{
-    return part ? -cos_tab[size - idx - 1]
-                :  cos_tab[idx];
-}
-
-/**
- * Evaluate the LPC amplitude spectrum envelope from the line spectrum pairs.
- * Probably for speed reasons, the coefficients are evaluated as
- * siiiibiiiisiiiibiiiisiiiibiiiisiiiibiiiis ...
- * where s is an evaluated value, i is a value interpolated from the others
- * and b might be either calculated or interpolated, depending on an
- * unexplained condition.
- *
- * @param step the size of a block "siiiibiiii"
- * @param in the cosine of the LSP data
- * @param part is 0 for 0...PI (positive cosine values) and 1 for PI...2PI
- *        (negative cosine values)
- * @param size the size of the whole output
- */
-static inline void eval_lpcenv_or_interp(TwinVQContext *tctx,
-                                         enum TwinVQFrameType ftype,
-                                         float *out, const float *in,
-                                         int size, int step, int part)
-{
-    int i;
-    const TwinVQModeTab *mtab = tctx->mtab;
-    const float *cos_tab      = tctx->cos_tabs[ftype];
-
-    // Fill the 's'
-    for (i = 0; i < size; i += step)
-        out[i] =
-            eval_lpc_spectrum(in,
-                              get_cos(i, part, cos_tab, size),
-                              mtab->n_lsp);
-
-    // Fill the 'iiiibiiii'
-    for (i = step; i <= size - 2 * step; i += step) {
-        if (out[i + step] + out[i - step] > 1.95 * out[i] ||
-            out[i + step]                 >= out[i - step]) {
-            interpolate(out + i - step + 1, out[i], out[i - step], step - 1);
-        } else {
-            out[i - step / 2] =
-                eval_lpc_spectrum(in,
-                                  get_cos(i - step / 2, part, cos_tab, size),
-                                  mtab->n_lsp);
-            interpolate(out + i - step + 1, out[i - step / 2],
-                        out[i - step], step / 2 - 1);
-            interpolate(out + i - step / 2 + 1, out[i],
-                        out[i - step / 2], step / 2 - 1);
-        }
-    }
-
-    interpolate(out + size - 2 * step + 1, out[size - step],
-                out[size - 2 * step], step - 1);
-}
-
-static void eval_lpcenv_2parts(TwinVQContext *tctx, enum TwinVQFrameType ftype,
-                               const float *buf, float *lpc,
-                               int size, int step)
-{
-    eval_lpcenv_or_interp(tctx, ftype, lpc, buf, size / 2, step, 0);
-    eval_lpcenv_or_interp(tctx, ftype, lpc + size / 2, buf, size / 2,
-                          2 * step, 1);
-
-    interpolate(lpc + size / 2 - step + 1, lpc[size / 2],
-                lpc[size / 2 - step], step);
-
-    twinvq_memset_float(lpc + size - 2 * step + 1, lpc[size - 2 * step],
-                        2 * step - 1);
-}
-
-/**
- * Inverse quantization. Read CB coefficients for cb1 and cb2 from the
- * bitstream, sum the corresponding vectors and write the result to *out
- * after permutation.
- */
-static void dequant(TwinVQContext *tctx, const uint8_t *cb_bits, float *out,
-                    enum TwinVQFrameType ftype,
-                    const int16_t *cb0, const int16_t *cb1, int cb_len)
-{
-    int pos = 0;
-    int i, j;
-
-    for (i = 0; i < tctx->n_div[ftype]; i++) {
-        int tmp0, tmp1;
-        int sign0 = 1;
-        int sign1 = 1;
-        const int16_t *tab0, *tab1;
-        int length = tctx->length[ftype][i >= tctx->length_change[ftype]];
-        int bitstream_second_part = (i >= tctx->bits_main_spec_change[ftype]);
-
-        int bits = tctx->bits_main_spec[0][ftype][bitstream_second_part];
-        tmp0 = *cb_bits++;
-        if (bits == 7) {
-            if (tmp0 & 0x40)
-                sign0 = -1;
-            tmp0 &= 0x3F;
-        }
-
-        bits = tctx->bits_main_spec[1][ftype][bitstream_second_part];
-        tmp1 = *cb_bits++;
-        if (bits == 7) {
-            if (tmp1 & 0x40)
-                sign1 = -1;
-            tmp1 &= 0x3F;
-        }
-
-        tab0 = cb0 + tmp0 * cb_len;
-        tab1 = cb1 + tmp1 * cb_len;
-
-        for (j = 0; j < length; j++)
-            out[tctx->permut[ftype][pos + j]] = sign0 * tab0[j] +
-                                                sign1 * tab1[j];
-
-        pos += length;
-    }
-}
-
-static void dec_gain(TwinVQContext *tctx,
-                     enum TwinVQFrameType ftype, float *out)
-{
-    const TwinVQModeTab   *mtab =  tctx->mtab;
-    const TwinVQFrameData *bits = &tctx->bits[tctx->cur_frame];
-    int i, j;
-    int sub        = mtab->fmode[ftype].sub;
-    float step     = TWINVQ_AMP_MAX     / ((1 << TWINVQ_GAIN_BITS)     - 1);
-    float sub_step = TWINVQ_SUB_AMP_MAX / ((1 << TWINVQ_SUB_GAIN_BITS) - 1);
-
-    if (ftype == TWINVQ_FT_LONG) {
-        for (i = 0; i < tctx->avctx->channels; i++)
-            out[i] = (1.0 / (1 << 13)) *
-                     twinvq_mulawinv(step * 0.5 + step * bits->gain_bits[i],
-                                     TWINVQ_AMP_MAX, TWINVQ_MULAW_MU);
-    } else {
-        for (i = 0; i < tctx->avctx->channels; i++) {
-            float val = (1.0 / (1 << 23)) *
-                        twinvq_mulawinv(step * 0.5 + step * bits->gain_bits[i],
-                                        TWINVQ_AMP_MAX, TWINVQ_MULAW_MU);
-
-            for (j = 0; j < sub; j++)
-                out[i * sub + j] =
-                    val * twinvq_mulawinv(sub_step * 0.5 +
-                                          sub_step * bits->sub_gain_bits[i * sub + j],
-                                          TWINVQ_SUB_AMP_MAX, TWINVQ_MULAW_MU);
-        }
-    }
-}
-
-/**
- * Rearrange the LSP coefficients so that they have a minimum distance of
- * min_dist. This function does it exactly as described in section of 3.2.4
- * of the G.729 specification (but interestingly is different from what the
- * reference decoder actually does).
- */
-static void rearrange_lsp(int order, float *lsp, float min_dist)
-{
-    int i;
-    float min_dist2 = min_dist * 0.5;
-    for (i = 1; i < order; i++)
-        if (lsp[i] - lsp[i - 1] < min_dist) {
-            float avg = (lsp[i] + lsp[i - 1]) * 0.5;
-
-            lsp[i - 1] = avg - min_dist2;
-            lsp[i]     = avg + min_dist2;
-        }
-}
-
-static void decode_lsp(TwinVQContext *tctx, int lpc_idx1, uint8_t *lpc_idx2,
-                       int lpc_hist_idx, float *lsp, float *hist)
-{
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int i, j;
-
-    const float *cb  = mtab->lspcodebook;
-    const float *cb2 = cb  + (1 << mtab->lsp_bit1) * mtab->n_lsp;
-    const float *cb3 = cb2 + (1 << mtab->lsp_bit2) * mtab->n_lsp;
-
-    const int8_t funny_rounding[4] = {
-        -2,
-        mtab->lsp_split == 4 ? -2 : 1,
-        mtab->lsp_split == 4 ? -2 : 1,
-        0
-    };
-
-    j = 0;
-    for (i = 0; i < mtab->lsp_split; i++) {
-        int chunk_end = ((i + 1) * mtab->n_lsp + funny_rounding[i]) /
-                        mtab->lsp_split;
-        for (; j < chunk_end; j++)
-            lsp[j] = cb[lpc_idx1     * mtab->n_lsp + j] +
-                     cb2[lpc_idx2[i] * mtab->n_lsp + j];
-    }
-
-    rearrange_lsp(mtab->n_lsp, lsp, 0.0001);
-
-    for (i = 0; i < mtab->n_lsp; i++) {
-        float tmp1 = 1.0     - cb3[lpc_hist_idx * mtab->n_lsp + i];
-        float tmp2 = hist[i] * cb3[lpc_hist_idx * mtab->n_lsp + i];
-        hist[i] = lsp[i];
-        lsp[i]  = lsp[i] * tmp1 + tmp2;
-    }
-
-    rearrange_lsp(mtab->n_lsp, lsp, 0.0001);
-    rearrange_lsp(mtab->n_lsp, lsp, 0.000095);
-    ff_sort_nearly_sorted_floats(lsp, mtab->n_lsp);
-}
-
-static void dec_lpc_spectrum_inv(TwinVQContext *tctx, float *lsp,
-                                 enum TwinVQFrameType ftype, float *lpc)
-{
-    int i;
-    int size = tctx->mtab->size / tctx->mtab->fmode[ftype].sub;
-
-    for (i = 0; i < tctx->mtab->n_lsp; i++)
-        lsp[i] = 2 * cos(lsp[i]);
-
-    switch (ftype) {
-    case TWINVQ_FT_LONG:
-        eval_lpcenv_2parts(tctx, ftype, lsp, lpc, size, 8);
-        break;
-    case TWINVQ_FT_MEDIUM:
-        eval_lpcenv_2parts(tctx, ftype, lsp, lpc, size, 2);
-        break;
-    case TWINVQ_FT_SHORT:
-        eval_lpcenv(tctx, lsp, lpc);
-        break;
-    }
-}
-
-static const uint8_t wtype_to_wsize[] = { 0, 0, 2, 2, 2, 1, 0, 1, 1 };
-
-static void imdct_and_window(TwinVQContext *tctx, enum TwinVQFrameType ftype,
-                             int wtype, float *in, float *prev, int ch)
-{
-    FFTContext *mdct = &tctx->mdct_ctx[ftype];
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int bsize = mtab->size / mtab->fmode[ftype].sub;
-    int size  = mtab->size;
-    float *buf1 = tctx->tmp_buf;
-    int j, first_wsize, wsize; // Window size
-    float *out  = tctx->curr_frame + 2 * ch * mtab->size;
-    float *out2 = out;
-    float *prev_buf;
-    int types_sizes[] = {
-        mtab->size /  mtab->fmode[TWINVQ_FT_LONG].sub,
-        mtab->size /  mtab->fmode[TWINVQ_FT_MEDIUM].sub,
-        mtab->size / (mtab->fmode[TWINVQ_FT_SHORT].sub * 2),
-    };
-
-    wsize       = types_sizes[wtype_to_wsize[wtype]];
-    first_wsize = wsize;
-    prev_buf    = prev + (size - bsize) / 2;
-
-    for (j = 0; j < mtab->fmode[ftype].sub; j++) {
-        int sub_wtype = ftype == TWINVQ_FT_MEDIUM ? 8 : wtype;
-
-        if (!j && wtype == 4)
-            sub_wtype = 4;
-        else if (j == mtab->fmode[ftype].sub - 1 && wtype == 7)
-            sub_wtype = 7;
-
-        wsize = types_sizes[wtype_to_wsize[sub_wtype]];
-
-        mdct->imdct_half(mdct, buf1 + bsize * j, in + bsize * j);
-
-        tctx->fdsp.vector_fmul_window(out2, prev_buf + (bsize - wsize) / 2,
-                                      buf1 + bsize * j,
-                                      ff_sine_windows[av_log2(wsize)],
-                                      wsize / 2);
-        out2 += wsize;
-
-        memcpy(out2, buf1 + bsize * j + wsize / 2,
-               (bsize - wsize / 2) * sizeof(float));
-
-        out2 += ftype == TWINVQ_FT_MEDIUM ? (bsize - wsize) / 2 : bsize - wsize;
-
-        prev_buf = buf1 + bsize * j + bsize / 2;
-    }
-
-    tctx->last_block_pos[ch] = (size + first_wsize) / 2;
-}
-
-static void imdct_output(TwinVQContext *tctx, enum TwinVQFrameType ftype,
-                         int wtype, float **out, int offset)
-{
-    const TwinVQModeTab *mtab = tctx->mtab;
-    float *prev_buf           = tctx->prev_frame + tctx->last_block_pos[0];
-    int size1, size2, i;
-    float *out1, *out2;
-
-    for (i = 0; i < tctx->avctx->channels; i++)
-        imdct_and_window(tctx, ftype, wtype,
-                         tctx->spectrum + i * mtab->size,
-                         prev_buf + 2 * i * mtab->size,
-                         i);
-
-    if (!out)
-        return;
-
-    size2 = tctx->last_block_pos[0];
-    size1 = mtab->size - size2;
-
-    out1 = &out[0][0] + offset;
-    memcpy(out1,         prev_buf,         size1 * sizeof(*out1));
-    memcpy(out1 + size1, tctx->curr_frame, size2 * sizeof(*out1));
-
-    if (tctx->avctx->channels == 2) {
-        out2 = &out[1][0] + offset;
-        memcpy(out2, &prev_buf[2 * mtab->size],
-               size1 * sizeof(*out2));
-        memcpy(out2 + size1, &tctx->curr_frame[2 * mtab->size],
-               size2 * sizeof(*out2));
-        tctx->fdsp.butterflies_float(out1, out2, mtab->size);
-    }
-}
-
-static void read_and_decode_spectrum(TwinVQContext *tctx, float *out,
-                                     enum TwinVQFrameType ftype)
-{
-    const TwinVQModeTab *mtab = tctx->mtab;
-    TwinVQFrameData *bits     = &tctx->bits[tctx->cur_frame];
-    int channels              = tctx->avctx->channels;
-    int sub        = mtab->fmode[ftype].sub;
-    int block_size = mtab->size / sub;
-    float gain[TWINVQ_CHANNELS_MAX * TWINVQ_SUBBLOCKS_MAX];
-    float ppc_shape[TWINVQ_PPC_SHAPE_LEN_MAX * TWINVQ_CHANNELS_MAX * 4];
-
-    int i, j;
-
-    dequant(tctx, bits->main_coeffs, out, ftype,
-            mtab->fmode[ftype].cb0, mtab->fmode[ftype].cb1,
-            mtab->fmode[ftype].cb_len_read);
-
-    dec_gain(tctx, ftype, gain);
-
-    if (ftype == TWINVQ_FT_LONG) {
-        int cb_len_p = (tctx->n_div[3] + mtab->ppc_shape_len * channels - 1) /
-                       tctx->n_div[3];
-        dequant(tctx, bits->ppc_coeffs, ppc_shape,
-                TWINVQ_FT_PPC, mtab->ppc_shape_cb,
-                mtab->ppc_shape_cb + cb_len_p * TWINVQ_PPC_SHAPE_CB_SIZE,
-                cb_len_p);
-    }
-
-    for (i = 0; i < channels; i++) {
-        float *chunk = out + mtab->size * i;
-        float lsp[TWINVQ_LSP_COEFS_MAX];
-
-        for (j = 0; j < sub; j++) {
-            tctx->dec_bark_env(tctx, bits->bark1[i][j],
-                               bits->bark_use_hist[i][j], i,
-                               tctx->tmp_buf, gain[sub * i + j], ftype);
-
-            tctx->fdsp.vector_fmul(chunk + block_size * j,
-                                   chunk + block_size * j,
-                                   tctx->tmp_buf, block_size);
-        }
-
-        if (ftype == TWINVQ_FT_LONG)
-            tctx->decode_ppc(tctx, bits->p_coef[i], bits->g_coef[i],
-                             ppc_shape + i * mtab->ppc_shape_len, chunk);
-
-        decode_lsp(tctx, bits->lpc_idx1[i], bits->lpc_idx2[i],
-                   bits->lpc_hist_idx[i], lsp, tctx->lsp_hist[i]);
-
-        dec_lpc_spectrum_inv(tctx, lsp, ftype, tctx->tmp_buf);
-
-        for (j = 0; j < mtab->fmode[ftype].sub; j++) {
-            tctx->fdsp.vector_fmul(chunk, chunk, tctx->tmp_buf, block_size);
-            chunk += block_size;
-        }
-    }
-}
-
-const enum TwinVQFrameType ff_twinvq_wtype_to_ftype_table[] = {
-    TWINVQ_FT_LONG,   TWINVQ_FT_LONG, TWINVQ_FT_SHORT, TWINVQ_FT_LONG,
-    TWINVQ_FT_MEDIUM, TWINVQ_FT_LONG, TWINVQ_FT_LONG,  TWINVQ_FT_MEDIUM,
-    TWINVQ_FT_MEDIUM
-};
-
-int ff_twinvq_decode_frame(AVCodecContext *avctx, void *data,
-                           int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    TwinVQContext *tctx = avctx->priv_data;
-    const TwinVQModeTab *mtab = tctx->mtab;
-    float **out = NULL;
-    int ret;
-
-    /* get output buffer */
-    if (tctx->discarded_packets >= 2) {
-        frame->nb_samples = mtab->size * tctx->frames_per_packet;
-        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-        out = (float **)frame->extended_data;
-    }
-
-    if (buf_size < avctx->block_align) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Frame too small (%d bytes). Truncated file?\n", buf_size);
-        return AVERROR(EINVAL);
-    }
-
-    if ((ret = tctx->read_bitstream(avctx, tctx, buf, buf_size)) < 0)
-        return ret;
-
-    for (tctx->cur_frame = 0; tctx->cur_frame < tctx->frames_per_packet;
-         tctx->cur_frame++) {
-        read_and_decode_spectrum(tctx, tctx->spectrum,
-                                 tctx->bits[tctx->cur_frame].ftype);
-
-        imdct_output(tctx, tctx->bits[tctx->cur_frame].ftype,
-                     tctx->bits[tctx->cur_frame].window_type, out,
-                     tctx->cur_frame * mtab->size);
-
-        FFSWAP(float *, tctx->curr_frame, tctx->prev_frame);
-    }
-
-    if (tctx->discarded_packets < 2) {
-        tctx->discarded_packets++;
-        *got_frame_ptr = 0;
-        return buf_size;
-    }
-
-    *got_frame_ptr = 1;
-
-    // VQF can deliver packets 1 byte greater than block align
-    if (buf_size == avctx->block_align + 1)
-        return buf_size;
-    return avctx->block_align;
-}
-
-/**
- * Init IMDCT and windowing tables
- */
-static av_cold int init_mdct_win(TwinVQContext *tctx)
-{
-    int i, j, ret;
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int size_s = mtab->size / mtab->fmode[TWINVQ_FT_SHORT].sub;
-    int size_m = mtab->size / mtab->fmode[TWINVQ_FT_MEDIUM].sub;
-    int channels = tctx->avctx->channels;
-    float norm = channels == 1 ? 2.0 : 1.0;
-
-    for (i = 0; i < 3; i++) {
-        int bsize = tctx->mtab->size / tctx->mtab->fmode[i].sub;
-        if ((ret = ff_mdct_init(&tctx->mdct_ctx[i], av_log2(bsize) + 1, 1,
-                                -sqrt(norm / bsize) / (1 << 15))))
-            return ret;
-    }
-
-    FF_ALLOC_OR_GOTO(tctx->avctx, tctx->tmp_buf,
-                     mtab->size * sizeof(*tctx->tmp_buf), alloc_fail);
-
-    FF_ALLOC_OR_GOTO(tctx->avctx, tctx->spectrum,
-                     2 * mtab->size * channels * sizeof(*tctx->spectrum),
-                     alloc_fail);
-    FF_ALLOC_OR_GOTO(tctx->avctx, tctx->curr_frame,
-                     2 * mtab->size * channels * sizeof(*tctx->curr_frame),
-                     alloc_fail);
-    FF_ALLOC_OR_GOTO(tctx->avctx, tctx->prev_frame,
-                     2 * mtab->size * channels * sizeof(*tctx->prev_frame),
-                     alloc_fail);
-
-    for (i = 0; i < 3; i++) {
-        int m       = 4 * mtab->size / mtab->fmode[i].sub;
-        double freq = 2 * M_PI / m;
-        FF_ALLOC_OR_GOTO(tctx->avctx, tctx->cos_tabs[i],
-                         (m / 4) * sizeof(*tctx->cos_tabs[i]), alloc_fail);
-
-        for (j = 0; j <= m / 8; j++)
-            tctx->cos_tabs[i][j] = cos((2 * j + 1) * freq);
-        for (j = 1; j < m / 8; j++)
-            tctx->cos_tabs[i][m / 4 - j] = tctx->cos_tabs[i][j];
-    }
-
-    ff_init_ff_sine_windows(av_log2(size_m));
-    ff_init_ff_sine_windows(av_log2(size_s / 2));
-    ff_init_ff_sine_windows(av_log2(mtab->size));
-
-    return 0;
-
-alloc_fail:
-    return AVERROR(ENOMEM);
-}
-
-/**
- * Interpret the data as if it were a num_blocks x line_len[0] matrix and for
- * each line do a cyclic permutation, i.e.
- * abcdefghijklm -> defghijklmabc
- * where the amount to be shifted is evaluated depending on the column.
- */
-static void permutate_in_line(int16_t *tab, int num_vect, int num_blocks,
-                              int block_size,
-                              const uint8_t line_len[2], int length_div,
-                              enum TwinVQFrameType ftype)
-{
-    int i, j;
-
-    for (i = 0; i < line_len[0]; i++) {
-        int shift;
-
-        if (num_blocks == 1                                    ||
-            (ftype == TWINVQ_FT_LONG && num_vect % num_blocks) ||
-            (ftype != TWINVQ_FT_LONG && num_vect & 1)          ||
-            i == line_len[1]) {
-            shift = 0;
-        } else if (ftype == TWINVQ_FT_LONG) {
-            shift = i;
-        } else
-            shift = i * i;
-
-        for (j = 0; j < num_vect && (j + num_vect * i < block_size * num_blocks); j++)
-            tab[i * num_vect + j] = i * num_vect + (j + shift) % num_vect;
-    }
-}
-
-/**
- * Interpret the input data as in the following table:
- *
- * @verbatim
- *
- * abcdefgh
- * ijklmnop
- * qrstuvw
- * x123456
- *
- * @endverbatim
- *
- * and transpose it, giving the output
- * aiqxbjr1cks2dlt3emu4fvn5gow6hp
- */
-static void transpose_perm(int16_t *out, int16_t *in, int num_vect,
-                           const uint8_t line_len[2], int length_div)
-{
-    int i, j;
-    int cont = 0;
-
-    for (i = 0; i < num_vect; i++)
-        for (j = 0; j < line_len[i >= length_div]; j++)
-            out[cont++] = in[j * num_vect + i];
-}
-
-static void linear_perm(int16_t *out, int16_t *in, int n_blocks, int size)
-{
-    int block_size = size / n_blocks;
-    int i;
-
-    for (i = 0; i < size; i++)
-        out[i] = block_size * (in[i] % n_blocks) + in[i] / n_blocks;
-}
-
-static av_cold void construct_perm_table(TwinVQContext *tctx,
-                                         enum TwinVQFrameType ftype)
-{
-    int block_size, size;
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int16_t *tmp_perm = (int16_t *)tctx->tmp_buf;
-
-    if (ftype == TWINVQ_FT_PPC) {
-        size       = tctx->avctx->channels;
-        block_size = mtab->ppc_shape_len;
-    } else {
-        size       = tctx->avctx->channels * mtab->fmode[ftype].sub;
-        block_size = mtab->size / mtab->fmode[ftype].sub;
-    }
-
-    permutate_in_line(tmp_perm, tctx->n_div[ftype], size,
-                      block_size, tctx->length[ftype],
-                      tctx->length_change[ftype], ftype);
-
-    transpose_perm(tctx->permut[ftype], tmp_perm, tctx->n_div[ftype],
-                   tctx->length[ftype], tctx->length_change[ftype]);
-
-    linear_perm(tctx->permut[ftype], tctx->permut[ftype], size,
-                size * block_size);
-}
-
-static av_cold void init_bitstream_params(TwinVQContext *tctx)
-{
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int n_ch                  = tctx->avctx->channels;
-    int total_fr_bits         = tctx->avctx->bit_rate * mtab->size /
-                                tctx->avctx->sample_rate;
-
-    int lsp_bits_per_block = n_ch * (mtab->lsp_bit0 + mtab->lsp_bit1 +
-                                     mtab->lsp_split * mtab->lsp_bit2);
-
-    int ppc_bits = n_ch * (mtab->pgain_bit + mtab->ppc_shape_bit +
-                           mtab->ppc_period_bit);
-
-    int bsize_no_main_cb[3], bse_bits[3], i;
-    enum TwinVQFrameType frametype;
-
-    for (i = 0; i < 3; i++)
-        // +1 for history usage switch
-        bse_bits[i] = n_ch *
-                      (mtab->fmode[i].bark_n_coef *
-                       mtab->fmode[i].bark_n_bit + 1);
-
-    bsize_no_main_cb[2] = bse_bits[2] + lsp_bits_per_block + ppc_bits +
-                          TWINVQ_WINDOW_TYPE_BITS + n_ch * TWINVQ_GAIN_BITS;
-
-    for (i = 0; i < 2; i++)
-        bsize_no_main_cb[i] =
-            lsp_bits_per_block + n_ch * TWINVQ_GAIN_BITS +
-            TWINVQ_WINDOW_TYPE_BITS +
-            mtab->fmode[i].sub * (bse_bits[i] + n_ch * TWINVQ_SUB_GAIN_BITS);
-
-    if (tctx->codec == TWINVQ_CODEC_METASOUND && !tctx->is_6kbps) {
-        bsize_no_main_cb[1] += 2;
-        bsize_no_main_cb[2] += 2;
-    }
-
-    // The remaining bits are all used for the main spectrum coefficients
-    for (i = 0; i < 4; i++) {
-        int bit_size, vect_size;
-        int rounded_up, rounded_down, num_rounded_down, num_rounded_up;
-        if (i == 3) {
-            bit_size  = n_ch * mtab->ppc_shape_bit;
-            vect_size = n_ch * mtab->ppc_shape_len;
-        } else {
-            bit_size  = total_fr_bits - bsize_no_main_cb[i];
-            vect_size = n_ch * mtab->size;
-        }
-
-        tctx->n_div[i] = (bit_size + 13) / 14;
-
-        rounded_up                     = (bit_size + tctx->n_div[i] - 1) /
-                                         tctx->n_div[i];
-        rounded_down                   = (bit_size) / tctx->n_div[i];
-        num_rounded_down               = rounded_up * tctx->n_div[i] - bit_size;
-        num_rounded_up                 = tctx->n_div[i] - num_rounded_down;
-        tctx->bits_main_spec[0][i][0]  = (rounded_up + 1)   / 2;
-        tctx->bits_main_spec[1][i][0]  =  rounded_up        / 2;
-        tctx->bits_main_spec[0][i][1]  = (rounded_down + 1) / 2;
-        tctx->bits_main_spec[1][i][1]  =  rounded_down      / 2;
-        tctx->bits_main_spec_change[i] = num_rounded_up;
-
-        rounded_up             = (vect_size + tctx->n_div[i] - 1) /
-                                 tctx->n_div[i];
-        rounded_down           = (vect_size) / tctx->n_div[i];
-        num_rounded_down       = rounded_up * tctx->n_div[i] - vect_size;
-        num_rounded_up         = tctx->n_div[i] - num_rounded_down;
-        tctx->length[i][0]     = rounded_up;
-        tctx->length[i][1]     = rounded_down;
-        tctx->length_change[i] = num_rounded_up;
-    }
-
-    for (frametype = TWINVQ_FT_SHORT; frametype <= TWINVQ_FT_PPC; frametype++)
-        construct_perm_table(tctx, frametype);
-}
-
-av_cold int ff_twinvq_decode_close(AVCodecContext *avctx)
-{
-    TwinVQContext *tctx = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < 3; i++) {
-        ff_mdct_end(&tctx->mdct_ctx[i]);
-        av_free(tctx->cos_tabs[i]);
-    }
-
-    av_free(tctx->curr_frame);
-    av_free(tctx->spectrum);
-    av_free(tctx->prev_frame);
-    av_free(tctx->tmp_buf);
-
-    return 0;
-}
-
-av_cold int ff_twinvq_decode_init(AVCodecContext *avctx)
-{
-    int ret;
-    TwinVQContext *tctx = avctx->priv_data;
-
-    tctx->avctx       = avctx;
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    if (!avctx->block_align) {
-        avctx->block_align = tctx->frame_size + 7 >> 3;
-    } else if (avctx->block_align * 8 < tctx->frame_size) {
-        av_log(avctx, AV_LOG_ERROR, "Block align is %d bits, expected %d\n",
-               avctx->block_align * 8, tctx->frame_size);
-        return AVERROR_INVALIDDATA;
-    }
-    tctx->frames_per_packet = avctx->block_align * 8 / tctx->frame_size;
-    if (tctx->frames_per_packet > TWINVQ_MAX_FRAMES_PER_PACKET) {
-        av_log(avctx, AV_LOG_ERROR, "Too many frames per packet (%d)\n",
-               tctx->frames_per_packet);
-        return AVERROR_INVALIDDATA;
-    }
-
-    avpriv_float_dsp_init(&tctx->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-    if ((ret = init_mdct_win(tctx))) {
-        av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n");
-        ff_twinvq_decode_close(avctx);
-        return ret;
-    }
-    init_bitstream_params(tctx);
-
-    twinvq_memset_float(tctx->bark_hist[0][0], 0.1,
-                        FF_ARRAY_ELEMS(tctx->bark_hist));
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/twinvq.h b/deps/libav/libavcodec/twinvq.h
deleted file mode 100644
index 7601e5b..0000000
--- a/deps/libav/libavcodec/twinvq.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * TwinVQ decoder
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_TWINVQ_H
-#define AVCODEC_TWINVQ_H
-
-#include <math.h>
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "fft.h"
-#include "internal.h"
-
-enum TwinVQCodec {
-    TWINVQ_CODEC_VQF,
-    TWINVQ_CODEC_METASOUND,
-};
-
-enum TwinVQFrameType {
-    TWINVQ_FT_SHORT = 0,  ///< Short frame  (divided in n   sub-blocks)
-    TWINVQ_FT_MEDIUM,     ///< Medium frame (divided in m<n sub-blocks)
-    TWINVQ_FT_LONG,       ///< Long frame   (single sub-block + PPC)
-    TWINVQ_FT_PPC,        ///< Periodic Peak Component (part of the long frame)
-};
-
-#define TWINVQ_PPC_SHAPE_CB_SIZE 64
-#define TWINVQ_PPC_SHAPE_LEN_MAX 60
-#define TWINVQ_SUB_AMP_MAX       4500.0
-#define TWINVQ_MULAW_MU          100.0
-#define TWINVQ_GAIN_BITS         8
-#define TWINVQ_AMP_MAX           13000.0
-#define TWINVQ_SUB_GAIN_BITS     5
-#define TWINVQ_WINDOW_TYPE_BITS  4
-#define TWINVQ_PGAIN_MU          200
-#define TWINVQ_LSP_COEFS_MAX     20
-#define TWINVQ_LSP_SPLIT_MAX     4
-#define TWINVQ_CHANNELS_MAX      2
-#define TWINVQ_SUBBLOCKS_MAX     16
-#define TWINVQ_BARK_N_COEF_MAX   4
-
-#define TWINVQ_MAX_FRAMES_PER_PACKET 2
-
-/**
- * Parameters and tables that are different for each frame type
- */
-struct TwinVQFrameMode {
-    uint8_t         sub;      ///< Number subblocks in each frame
-    const uint16_t *bark_tab;
-
-    /** number of distinct bark scale envelope values */
-    uint8_t         bark_env_size;
-
-    const int16_t  *bark_cb;    ///< codebook for the bark scale envelope (BSE)
-    uint8_t         bark_n_coef;///< number of BSE CB coefficients to read
-    uint8_t         bark_n_bit; ///< number of bits of the BSE coefs
-
-    //@{
-    /** main codebooks for spectrum data */
-    const int16_t    *cb0;
-    const int16_t    *cb1;
-    //@}
-
-    uint8_t         cb_len_read; ///< number of spectrum coefficients to read
-};
-
-typedef struct TwinVQFrameData {
-    int     window_type;
-    enum TwinVQFrameType ftype;
-
-    uint8_t main_coeffs[1024];
-    uint8_t ppc_coeffs[TWINVQ_PPC_SHAPE_LEN_MAX];
-
-    uint8_t gain_bits[TWINVQ_CHANNELS_MAX];
-    uint8_t sub_gain_bits[TWINVQ_CHANNELS_MAX * TWINVQ_SUBBLOCKS_MAX];
-
-    uint8_t bark1[TWINVQ_CHANNELS_MAX][TWINVQ_SUBBLOCKS_MAX][TWINVQ_BARK_N_COEF_MAX];
-    uint8_t bark_use_hist[TWINVQ_CHANNELS_MAX][TWINVQ_SUBBLOCKS_MAX];
-
-    uint8_t lpc_idx1[TWINVQ_CHANNELS_MAX];
-    uint8_t lpc_idx2[TWINVQ_CHANNELS_MAX][TWINVQ_LSP_SPLIT_MAX];
-    uint8_t lpc_hist_idx[TWINVQ_CHANNELS_MAX];
-
-    int     p_coef[TWINVQ_CHANNELS_MAX];
-    int     g_coef[TWINVQ_CHANNELS_MAX];
-} TwinVQFrameData;
-
-/**
- * Parameters and tables that are different for every combination of
- * bitrate/sample rate
- */
-typedef struct TwinVQModeTab {
-    struct TwinVQFrameMode fmode[3]; ///< frame type-dependant parameters
-
-    uint16_t     size;        ///< frame size in samples
-    uint8_t      n_lsp;       ///< number of lsp coefficients
-    const float *lspcodebook;
-
-    /* number of bits of the different LSP CB coefficients */
-    uint8_t      lsp_bit0;
-    uint8_t      lsp_bit1;
-    uint8_t      lsp_bit2;
-
-    uint8_t      lsp_split;      ///< number of CB entries for the LSP decoding
-    const int16_t *ppc_shape_cb; ///< PPC shape CB
-
-    /** number of the bits for the PPC period value */
-    uint8_t      ppc_period_bit;
-
-    uint8_t      ppc_shape_bit;  ///< number of bits of the PPC shape CB coeffs
-    uint8_t      ppc_shape_len;  ///< size of PPC shape CB
-    uint8_t      pgain_bit;      ///< bits for PPC gain
-
-    /** constant for peak period to peak width conversion */
-    uint16_t     peak_per2wid;
-} TwinVQModeTab;
-
-typedef struct TwinVQContext {
-    AVCodecContext *avctx;
-    AVFloatDSPContext fdsp;
-    FFTContext mdct_ctx[3];
-
-    const TwinVQModeTab *mtab;
-
-    int is_6kbps;
-
-    // history
-    float lsp_hist[2][20];           ///< LSP coefficients of the last frame
-    float bark_hist[3][2][40];       ///< BSE coefficients of last frame
-
-    // bitstream parameters
-    int16_t permut[4][4096];
-    uint8_t length[4][2];            ///< main codebook stride
-    uint8_t length_change[4];
-    uint8_t bits_main_spec[2][4][2]; ///< bits for the main codebook
-    int bits_main_spec_change[4];
-    int n_div[4];
-
-    float *spectrum;
-    float *curr_frame;               ///< non-interleaved output
-    float *prev_frame;               ///< non-interleaved previous frame
-    int last_block_pos[2];
-    int discarded_packets;
-
-    float *cos_tabs[3];
-
-    // scratch buffers
-    float *tmp_buf;
-
-    int frame_size, frames_per_packet, cur_frame;
-    TwinVQFrameData bits[TWINVQ_MAX_FRAMES_PER_PACKET];
-
-    enum TwinVQCodec codec;
-
-    int (*read_bitstream)(AVCodecContext *avctx, struct TwinVQContext *tctx,
-                          const uint8_t *buf, int buf_size);
-    void (*dec_bark_env)(struct TwinVQContext *tctx, const uint8_t *in,
-                         int use_hist, int ch, float *out, float gain,
-                         enum TwinVQFrameType ftype);
-    void (*decode_ppc)(struct TwinVQContext *tctx, int period_coef, int g_coef,
-                       const float *shape, float *speech);
-} TwinVQContext;
-
-extern const enum TwinVQFrameType ff_twinvq_wtype_to_ftype_table[];
-
-/** @note not speed critical, hence not optimized */
-static inline void twinvq_memset_float(float *buf, float val, int size)
-{
-    while (size--)
-        *buf++ = val;
-}
-
-static inline float twinvq_mulawinv(float y, float clip, float mu)
-{
-    y = av_clipf(y / clip, -1, 1);
-    return clip * FFSIGN(y) * (exp(log(1 + mu) * fabs(y)) - 1) / mu;
-}
-
-int ff_twinvq_decode_frame(AVCodecContext *avctx, void *data,
-                           int *got_frame_ptr, AVPacket *avpkt);
-av_cold int ff_twinvq_decode_close(AVCodecContext *avctx);
-av_cold int ff_twinvq_decode_init(AVCodecContext *avctx);
-
-#endif /* AVCODEC_TWINVQ_DATA_H */
diff --git a/deps/libav/libavcodec/twinvq_data.h b/deps/libav/libavcodec/twinvq_data.h
deleted file mode 100644
index 01a54a5..0000000
--- a/deps/libav/libavcodec/twinvq_data.h
+++ /dev/null
@@ -1,11144 +0,0 @@
-/*
- * TwinVQ decoder
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_TWINVQ_DATA_H
-#define AVCODEC_TWINVQ_DATA_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-/*
- * The bark_tab_* tables are constructed so that
- *
- *       /i-1              \
- *       |--               |
- *  bark |\   bark_tab[j]  | == i
- *       |/                |
- *       |--               |
- *       \j=0              /
- *
- *
- * for some slightly nonconventional bark-scale function
- */
-static const uint16_t bark_tab_l08_512[] = {
-     7,  8,  7,  8,  8,  8,  8,  8,  8,  9,
-     9, 10, 10, 11, 11, 12, 12, 14, 15, 16,
-    18, 19, 21, 24, 27, 30, 35, 40, 46, 53
-};
-
-static const uint16_t bark_tab_l11_512[] = {
-     6,  6,  6,  6,  6,  6,  7,  6,  7,  7,
-     8,  8,  8,  9, 10, 10, 11, 13, 13, 15,
-    17, 18, 21, 25, 27, 33, 38, 45, 54, 66
-};
-
-static const uint16_t bark_tab_l16_1024[] = {
-     9,  9,  8,  9, 10, 9,  10,  10,  10,  12,
-    11, 13, 13, 14, 16, 17, 19,  20,  24,  26,
-    30, 35, 40, 48, 56, 68, 83, 102, 128, 165
-};
-
-static const uint16_t bark_tab_l22_1024[] = {
-      6,   7,  6,  6,  7,  7,  7,  7,  7,   8,
-      9,   8, 10, 10, 11, 12, 13, 15, 16,  18,
-     21,  24, 27, 33, 38, 46, 55, 68, 84, 107,
-    140, 191
-};
-
-static const uint16_t bark_tab_l22_512[] = {
-     3,  3,  3,  4,  3,  3,  4,  3,  4,  4,
-     4,  5,  4,  5,  6,  6,  7,  7,  8,  9,
-    10, 12, 14, 16, 20, 22, 28, 34, 42, 53,
-    71, 95
-};
-
-static const uint16_t bark_tab_l44_2048[] = {
-     5,  6,  5,  6,  5,   6,   6,   6,   6,   6,
-     7,  7,  7,  8,  8,   9,   9,  10,  11,  11,
-    13, 14, 16, 17, 19,  22,  25,  29,  33,  39,
-    46, 54, 64, 79, 98, 123, 161, 220, 320, 512
-};
-
-static const uint16_t bark_tab_m08_256[] = {
-    6,  5,  6,  6,  6,  6,  7,  7,  8,  8,
-    9, 10, 11, 13, 15, 18, 20, 25, 31, 39
-};
-
-static const uint16_t bark_tab_m11_256[] = {
-    4, 5,  4,  5,  5,  5,  6,  5,  7,  7,
-    8, 9, 10, 12, 15, 17, 22, 28, 35, 47
-};
-
-static const uint16_t bark_tab_m16_512[] = {
-     7,  6,  7,  7,  7,  8,  9,  9, 10,  11,
-    14, 15, 18, 22, 27, 34, 44, 59, 81, 117
-};
-
-static const uint16_t bark_tab_m22_256[] = {
-    3, 2, 3, 2,  3,  3,  4,  3,  4,  5,
-    5, 7, 8, 9, 13, 16, 22, 30, 44, 70
-};
-
-static const uint16_t bark_tab_m22_512[] = {
-     5,  5,  5,  6,  5,  7,  6,  7,  9,   9,
-    11, 13, 15, 20, 24, 33, 43, 61, 88, 140
-};
-
-static const uint16_t bark_tab_m44_512[] = {
-    3, 2,  3,  3,  3,  4,  3,  5,  4,   6,
-    7, 8, 10, 14, 18, 25, 36, 55, 95, 208
-};
-
-static const uint16_t bark_tab_s08_64[] = {
-    3, 3, 3, 3, 4, 5, 6, 8, 12, 17
-};
-
-static const uint16_t bark_tab_s11_64[] = {
-    2, 3, 2, 3, 3, 4, 6, 8, 12, 21
-};
-
-static const uint16_t bark_tab_s16_128[] = {
-    3, 4, 4, 4, 5, 7, 10, 16, 26, 49
-};
-
-static const uint16_t bark_tab_s22_128[] = {
-    3, 2, 3, 4, 4, 6, 9, 14, 26, 57
-};
-
-static const uint16_t bark_tab_s44_128[] = {
-    1, 2, 1, 2, 3, 4, 6, 10, 23, 76
-};
-
-/**
- * TwinVQ codebooks. They are coded in a struct so we can use code such as
- *
- * float val = tab.fcb0808l[get_bits(gb, 12)];
- *
- * without risking a segfault on malformed files.
- */
-static const struct twinvq_data {
-    float lsp08[504];
-    int16_t fcb08l[640];
-    int16_t fcb08m[320];
-    int16_t fcb08s[320];
-    int16_t shape08[1280];
-
-    int16_t cb0808l0[1088];
-    int16_t cb0808l1[1088];
-    int16_t cb0808s0[1152];
-    int16_t cb0808s1[1152];
-    int16_t cb0808m0[1024];
-    int16_t cb0808m1[1024];
-
-    int16_t cb1108l0[1728];
-    int16_t cb1108l1[1728];
-    int16_t cb1108m0[1536];
-    int16_t cb1108m1[1536];
-    int16_t cb1108s0[1856];
-    int16_t cb1108s1[1856];
-
-    int16_t fcb11l[640];
-    int16_t fcb11m[320];
-    int16_t fcb11s[320];
-    int16_t shape11[1280];
-    float lsp11[1312];
-
-    int16_t cb1110l0[1280];
-    int16_t cb1110l1[1280];
-    int16_t cb1110m0[1152];
-    int16_t cb1110m1[1152];
-    int16_t cb1110s0[1344];
-    int16_t cb1110s1[1344];
-
-    int16_t fcb16l[640];
-    int16_t fcb16m[320];
-    int16_t fcb16s[320];
-    int16_t shape16[1920];
-    float lsp16[1400];
-
-    int16_t cb1616l0[1024];
-    int16_t cb1616l1[1024];
-    int16_t cb1616m0[960];
-    int16_t cb1616m1[960];
-    int16_t cb1616s0[1024];
-    int16_t cb1616s1[1024];
-
-    int16_t cb2220l0[1152];
-    int16_t cb2220l1[1152];
-    int16_t cb2220m0[1088];
-    int16_t cb2220m1[1088];
-    int16_t cb2220s0[1152];
-    int16_t cb2220s1[1152];
-
-    int16_t fcb22l_1[512];
-    int16_t fcb22m_1[640];
-    int16_t fcb22s_1[640];
-    int16_t shape22_1[1152];
-    float lsp22_1[1312];
-
-    int16_t cb2224l0[960];
-    int16_t cb2224l1[960];
-    int16_t cb2224m0[896];
-    int16_t cb2224m1[896];
-    int16_t cb2224s0[960];
-    int16_t cb2224s1[960];
-
-    int16_t fcb22l_2[512];
-    int16_t fcb22m_2[640];
-    int16_t fcb22s_2[640];
-    int16_t shape22_2[1152];
-    float lsp22_2[1312];
-
-    int16_t cb2232l0[768];
-    int16_t cb2232l1[768];
-    int16_t cb2232m0[704];
-    int16_t cb2232m1[704];
-    int16_t cb2232s0[704];
-    int16_t cb2232s1[704];
-
-    int16_t cb4440l0[1088];
-    int16_t cb4440l1[1088];
-    int16_t cb4440m0[1088];
-    int16_t cb4440m1[1088];
-    int16_t cb4440s0[1152];
-    int16_t cb4440s1[1152];
-
-    int16_t fcb44l[640];
-    int16_t fcb44m[640];
-    int16_t fcb44s[640];
-    int16_t shape44[1152];
-    float lsp44[1640];
-
-    int16_t cb4448l0[896];
-    int16_t cb4448l1[896];
-    int16_t cb4448m0[896];
-    int16_t cb4448m1[896];
-    int16_t cb4448s0[960];
-    int16_t cb4448s1[960];
-} tab = {
-.cb0808l0 = {
-    96, -12592, -12443,    425,    182,   -456,   -341,   -843,
-   615,    689,    982,   1470,   -518,    231,   -538,    282,
-   409,   -600,   -303,    -29,     51,     -4,   -115,     79,
-   -27,    450,   -937,   -461,   -554,   -159,    426,    710,
--29106,  -2148,     99,   3426,   1838,  12427,    585,  -2080,
- -2524,   -474,   1572,    718,    578,   -344,    188,    328,
- 12125,    112,    654,  -1232,  -1644,    288,    553,   1513,
-   966,   1012,     49,    631,   -111,   -238,   -116,   -182,
-   -21,    -46,    334,  11013,   -454,   -261,     12,     21,
-    52, -20440,   -295,   -502,   -516,   -329,   -230,    465,
-    59,    270,    971,   -127,    505,   -194,     43,    -30,
-   300,     38,    665,   -613,     33,   -172,   -153,    323,
-  -166,     54,    399,    109,    186,  -1765,   -222,    138,
-    16,    204,  30111,    208,   -564,   -612,    156,   -146,
-  -345,    321,   -138,    202,   -184,     93,    710, -15945,
--13401,    234,  -1113,    146,     -9,     56,   -628,   -834,
- -1268,    872,     61,  -1184,   -126,   -205,    145,   -109,
- -8248,    113,   -146,   1288,   9142,    857,   -782,   -686,
-  -256,   -650,   1061,   -202,     12,   -709,    -88,    273,
-   497,    150,    -59,  -8807,    240,    532,     16,   1482,
- 11012,   -444,   1918,  -1786,   1934,    172,    598,  -1324,
-  5638,  -3166,    492,   -545,   -770,   1067,      0,   -356,
-  -421,   1684,    273,   -502,    316,   1116,    807,   -529,
-  -831, -13379,   -420,    236,    470,  -2590,   -193,    -47,
-   580,  -1613,    798,     27,    -16, -12768,   -893,    256,
-     0,   1659,   1463,    544,    196, -30444,    314,   -421,
-   508,   -276,   -173,    414,   -380,   -371,    -40,   -121,
-   375,    432,   -438,      1,   -350,   -280,   1198,   -373,
-   452,    100,    -68,   9053,    165,    770,     73,    291,
-   717,    515,    596,   -323,     -4,     -2,    803,    738,
-  2605,     30,     73,    455,  11280,   1534,   -283,   1502,
- -9126,  -4760,   -570,    483,   -179,  -8628,  -1639,    322,
-   -56,   6149,  -3330,    114,   4598,  -1976,    -34,    -56,
-   840,    753,  12292,  -7100,   -492,    320,   -412,    908,
-  1186,    444,   6546,   -788,   5394,    697,  13105,    194,
-  -394,    294,   2639,     12,  -1009,  -1426,    -36,   2106,
-  -252, -31979,    -66,    341,    996,    298,    105,      6,
-    10,    106,   -498,   -244,   -105,   -574,     16,   -206,
-    24,  -2067,   -381,  10265,   -103,   -762,   -785,  -2036,
--11927,     16,   -710,    -35,   -270,    -99,      4,    772,
-  -272,   -186,   -328, -14936,    -57,  -1357,   -175,   -606,
-   220,    918,    -11,    398,   -189,   -278,    138,    429,
-   509,   -701,    -43,    -42,   -630,   -560,  11736,   -528,
- 10286,   -633,   -870,    423,    550,   -888,    297,   -170,
-   258,   2234,    486,    292,   -446, -11858,  10008,     52,
-  1203,   -164,    810,  -1527,   -604,   -883,   -588,    -96,
-   332,    148,   -180,    223,    356,    285,    434,    -57,
-  -172,   -520,   -432,    -72,    294,    -93,   -134,    316,
- 30647,   -351,    278,     84,   -439,    589,    105,   1001,
-   297,    660,    196,    171,    178,    -90,    -55,   1172,
- 21100,    227,   -288,    372,    162,    458,   -555,  -1329,
-   380,    366,   -104,    105,    674,   -378,   1328,    283,
- -1928,    549,    762,    454,     55,    606,  12499,     24,
-   435,     23,     29,   6170,   1129,    -95,     97,    569,
-   132,    491,    164,   -288,  -1011,   -134,   1234,   -427,
-  -254,   -524,    226, -14114,    328,    -70,   1666,   -189,
- -2352,   1097,    619,    632,   -981,    745,    587,    -27,
-  -200,   -871,     50,    470,   -246,   2610,    581,    254,
-  9893,   -586,    880, -11894,    386,   1135,    117,   1072,
-   116,   -830,   -160,  -1002,   -699,    -66,   -230,   -260,
-   112,    106,    221,    297,    -47,   7642,    170,   -330,
-  -599,    -51,   -476,     33,    475,    624,   6199,   -350,
-  -406,    184,    906,   -528,    382,    401,    348,     26,
-  -186,     33,   -130,    -62,    -50,   1268,   -132,   -109,
-  1164,   -354,    675,      3,   -402,   -244,    644,    648,
-  -132,     -4,     45,  20386,   -136,    568,    126,    376,
- 14476,   -376,    267,  13518,   -260,    111,   1014,    758,
-   439,    551,   -164,    207,    128,   -416,    616,    690,
- -9460,  -1856,   1123,    826,   -265,   -762,   1596,   -632,
-    52,   -622,   -894,    367,   -433,   -100,   1873,    756,
--17436,    168,   -541,    550,    145,  -5612,  -1057,  -1344,
-  -656,   -194,    216,   -500,   -245,    246,     64,    688,
-   727,  12538,  -5492,    252,   -908,   -424,   -532,   -659,
-  -277,   -230,   -736,   -183,     35,   -228,    200,    -12,
-  -248,    -60,   -493,    433,    446,    366,   -644,     92,
-  -324,     29,    833, -21542,   -977,     94,    379,     49,
- -1058,    248,   -178,     85,   -961,  -1198,    -48,    467,
-  -242, -10202,   1556,  11263,   -716,    814,  -1686,   3594,
-   -27,    694,   -802,    390,   4144,   -663,     44,   -546,
-   312,    -28,   -484,    981,   -307,    496,    408,    203,
- 12543,    296,  -1240,    159,    846,   -957,  -1493,   -618,
-  1593,  11868,   2616,   1954,    412,   -922,  -1320,   3325,
-  -254,  -1892,    607,  -2223,  -8745,  -1486,     17,    343,
-   -50,   -562,  22011,   -350,   -491,    -70,    -60,    617,
-   768,   -346,    387,    660,   1409,    222,    616,    173,
- -1323,   4017,   -207,   -525, -13243,     11,    440,   -614,
-  -280,    549,   -670,    -79,    459,    560,   -102,   -214,
-   -54,  -1201,    230,   -526,    857,   1044,   -369,   2470,
--11010, -12586,    243,   -205,    838,   -920,    348,   -738,
-  1319,     86,    -78,   -428,  -1909,   -155,      2,    508,
-   711,   -292,   1699,    225,   -101,   -163,    540,   9692,
-   235,   -183,    -38,    198,   -466,   -204,  -8957,   -914,
-  -299,    193,     10,    723,    643,   -533,  -1418,    323,
-    20,    334,   -886,   -331,    368,    130, -30233,   -152,
-   -14,    637,    132,   -232,   -149,   -430,     64,   -243,
-  -376,    370,    388,    196,  -1098,    117,   -794,    -16,
-  -274,    348,    464, -28156,    184,    322,   -101,      2,
-   -27,   -183,    610,    256,   -160,   -573,   -226,    588,
-  1613,   1028,   9518,  -2151,  -1602,   -528,   -356,   -116,
--11511,   1828,  -2206,    -47,   -757,  -1479,  -1429, -14717,
-  1686,    253,    802,    462,    -37,   -916,   -289,   -401,
- 13383,    353,    -74,    114,   -189,    636,    434,   -639,
-  1013,    234,  11752,    219,   1464,   -132, -12838,    125,
-  -592,    -40,   -162,  -1772,    506,    479,    422,     36,
-    15,   -960,    799,    517,   1311,   -409,    748,    729,
-   446,  11029, -13039,   1257,   -651,    -13,   -742,   1416,
-  -388,   -274,   -795,    163,   -572,     74,    430,    -90,
-  -126,    -74,   -598,    140,    125,    -20, -20332,    208,
-    37,     19,   -174,   -209,    305,     28,   -402,     28,
-  -315,     -1,   -134,    440,   -832,     79,   -635,   -304,
-     8, -32768,    625,    470,  -1224,   -351,    546,  -1171,
-  -706,    652,     31,   7484,   -448,    916,   1244,   -379,
-  -300,     68,    868,    607,    247,     70,   -984,  14314,
-    21,   -350,    -82,    368,    456,   -742,    472,     34,
-   782,   -498,   -879,    700,    417,    216,    415,   -161,
-  -181,   -608,   1570,    862,    -96,   -114,   8095,    -26,
-   168,   -363,   -804,    -36,   -770,    139,   -171,   6645,
- -1425,   4826,  -5288,   1358, -11747,    -64,    650,  -3206,
- -1692,    789,  -2047,   -279,    916,  -1648,   1164,   2044,
-  -144,   -717,   -392,   -216,    372,    348,   1052,   -175,
-   668,    308,    -15,  29112,   -406,   -774,    365,  -1006,
-  -526,   1076,     59,   -672,    -87,   -106,    174,     96,
-   615,    462,    -43,   -496,    112,    149,    -56,   -182,
-  -268, -32768,   -205,   -676,    165,  -1210,   -325,   7964,
-   -44,    546,   -699,    285,   -418,    355,    238,    550,
-    67,    425,    384,   -950,   -330,   -208,   -452,    212,
- 11610,   -190,     37,   -907, -11137,   -982,    585,   -783,
-  -864,    164,    -24,   -514,   -211,      2,   -510,   -580,
-   595,    128,    100,   -229,    -55,    290,   -539,     40,
- -7786,   -270,    295,   -508,    562,  -1196,    218,     33,
-  3788,  -8954,  -1082,    297,   -906,   -322,    123,   1162,
-  -343, -11655,     88,    -28,   1173,      9,    -99,     36,
--11987,    356,  12630,    767,   -183,   -983,   -559,    186,
-  1148,    530,   -440,   1230,   -456,   -133,   -424,     35,
-  -357,    418,   1457,   -687,    740,   -242,  17855,   -368,
- -1057,   -262,   -646,    406,   -712,  -1058,    -84,    454
-},
-
-.cb0808l1 = {
-   982,    -26,   -721,    359,    509,  13290,   2391,    727,
-   325,    328,    269,   -156,    346,   -242,    -31,   -356,
-   741,    396,    -98,    108,     35,   -237, -29684,    196,
-   -69,    462,   -339,     24,  -1221,    352,   -658,    396,
-   243,  -1658,   -458,  -1153,      5,   -662,    -47,     18,
-  -572,   -567,  -2084,   -980,   -210,    150,   -396,  14836,
-  -210,      0,   -162,   -539,    588,   -868,    248,  -8576,
-  1020,    526,   1056,    262,   -149,    818,  -1353,  -1120,
-   767,   -738,   -634, -14742,   -105,    811,   1718,   -116,
-   -64,    307,    920,  -1244,   2388,  10213,  -4505,   -250,
-   617,  -1725,   -645,   1258,   1146,   -590,    707,    -12,
-   372,   1794,   1012,   -149,    404,   -978,   -306,    168,
- -1536,     89,    142,    938, -19891,    973,   -481,   -419,
-  -904,   -455,  -1821,  -1617,    654,  -2022,   1906,   -497,
--11346,   -330, -11679,    -14,      1,    535,   -377,   1057,
-  -214,   -213,    430,    -13,  -3379, -11250,    911,   -716,
-  -240,    -10,    260,    132,   -611,    -64,   -594,  -8540,
-   837,  -3717,  -1154,    906,  10623,   -502,   -167,     67,
-   119,  13501,  -1469,    213,  -1048,  -1403,    432,  -1079,
-    45,   -230,   -730,   -203,   -595,  -1150,   -460,    -97,
-   395,   -304,  27816,   -300,    -16,    153,   -671,    551,
-   436,   -956,   -182,    194,    113,  -5504,    194,    263,
-  -332,   -517,   -244,   -396,    540,     56,   -371,    446,
-   147,    -66,      7,   -306,   1440,   -308,    327,    645,
-   597,  -6642,     72,    392,   -138,    -50,   -144,   -262,
-   504,   -230,    114,   2076,   8175,   1188,    290,   -872,
-   202,     69,     82,   -281,   -126,   -291,   -158,   -152,
-   -45,    239,    153,   -516,   -422,   -691,    801,     28,
-   496,   -298, -11118,  10430,   -227,   -851,    214,   -801,
-   538,    834,   -137,    942,    573,    405,   1308,   2234,
-   300,   1269,  12361,   -752,   2177,   -743,     60,    464,
-   946,    302,   -422,    116,  -1200,   -110,   -843,    284,
-  -578,    732,   -308,    153,    -64,    156,    225, -29232,
-  -452,   -466,   -130,    888,    240,    305,    -83,    236,
-   208,    417,   1530,    294,    594,    351,    508,    137,
- -7274,   -184,    201,     44,   -635,   -891,   -652,   -596,
-   380,   -652,  -8670,    -76,  -3746,   -732,    262,  -1860,
- -1030,   1366,   -279,    444,    911,    209,    330,    251,
-  -208,   -747,     65, -10154,   -204,  12960,   -325,    347,
-  -465,   -730,   -727,    385,    -89,   -763,   -427,    868,
-   -39,   -859,     34,    -29,   -388,  -1324,   -218,   2051,
- -1593,   5511,  10507,  -8516,   2254,   5847,  -1474,   1994,
-  4704,  -1876,    880,  -3810,   -489,   -946,  -1225,  -1104,
-   125,    139,   -668,   2232,   -537,    179,   -215,     63,
-   144,     72,   1198,   9750,    248,   -709,    308,  10552,
-  -434,   -462,  13569,   1096,   -491,   -262,    804,  -1599,
-   679,    569,    604,   1326,    213,  -2026,    324,  -2612,
-  -373, -12818,    -20,     38,   -171,    316,  15516,    306,
-   763,     97,     91,   -832,     23,   -437,   -390,    505,
- -1226,   2518,    106,  -2065,    315,     86,    523,    172,
- -1012, -13851,   3358,   2610,   -381,   -194,   1200,  -4106,
- -1298,  -3637,  -1534,    780,   1367,   -544,   -770,   1690,
-  1047,    -54,   2136,  12502,     32,   6689,    706,  -1172,
-   846,  -4853,   2146,   2548,    -39,   -465,   -596,    177,
-   213,    421,     28,   -388,     11,     69,     31,    -83,
-   -28,   -166,   -150, -19836,   -323,      3,    659,    783,
-   390,    139,   -138,     31,   -111,    453,    -80,    432,
-  -519,   -259,    686,  11431,    163, -13179,    554,     40,
-  -379,   -120,   -692,    340,    169,    120,   -476,    643,
-   778,    501,   -128,    543,   1275,   -134,  20568,    201,
-   401,    512,   -362,   -210,   -269,   -812,    112,     75,
-   149,   -547,   -494,   -418,   -100, -13621,  -1002,   1176,
-  1634,   -395,  -4289,  -1531,    -47,    850,  -1102,  13558,
-  -403,    683,   -164,  -2215,  -1180,  -1750,    344,    630,
-  -968,    669,    540,     26,   -594,    192,    -17,   -336,
- 19645,   1133,     18,    -56,    418,   -426,  -1535,    409,
-   732,    186,    268, -20422,    -22,     62,   -621,    722,
-   440,     96,   -307,   -128,    480,      5,     87,    668,
-  -361,   -599,    -22,    652,   -176,   -114,    214, -12233,
-  -698,    232,    608,   -126,   -714,   -488,   -228,    929,
- -1582, -19845,    245,   -460,    124,     57,    328,   -436,
-  -158,    236,   -196,   -534,    209,     69,    229,    210,
-  -251,   1100,    583,    415,    210,    189,   -219,   1242,
- 19482,   -105,    190,   -374,    -43,   -232,    253,    561,
-  -297,   -376,  -1077,   -308,  13486, -12462,     64,   -190,
-  -298,   -643,    460,    232,   -987,   -478,   1596,    168,
-  -722,    616,   -873,    -98,   -948,    231,  -1102,  11915,
-   746,   -495,   1248,   1203,  11067,    -32,    160,    -94,
-   -24,   -153,   -209,  -1453,  -1059,   -313,   -922,   1143,
-  -538,  -1348,   -323,    679,    -54,   -232,   -470,   2075,
--19135,    628,   -774,     35,    247,    -86,    721,    512,
-  1305,    850,   9760,    248,  -2404,   -220,      6,    -73,
- -1370,    567,   1432,  -2529,  -1508,  14358,   -992,  -1111,
-  -940,   -111,    968,   -530,    576,    102,  -1045,    453,
-   180,    -94,  -7936,   -310,    512,    996,    -32,  -1062,
-  -150,    -26,  -6687,   -181,   -336,  -1510,    616,     70,
-  -332,   -175,    624,   -546,    171,    364,   1011,     68,
-  -284,   -368,    711,     46,     73,    -34,   -419,    404,
- 28270,    283,   -324,    335,   -131,    316,    212,    -27,
-  -342,  -1062,    470,   1269,    454,    286,  -1928,  -1674,
-  -739,   -389,   1073,  -6172,   -317,   -586,   -194,   -182,
--13034,   -848,   4596,   -659,    709,   -630,   -310,    400,
-   344,   -276,    430,    876,  -2047,  -1012,  -1672,   -180,
-    64,  22005,   -736,    829,    266,    182,    436,   -112,
-   -36,    131,    252,    -63,    154,    368,    107,     93,
-   -42, -32768,      0,    200,   -230,    271,  -1776,   4329,
-   986,   -553,    481,   1888,  -2770,    848,  -6305,    264,
- 12244,   1610,   -640,   1348,  -2742,  -2078,    907,  -1115,
-   370, -16539,  -1571,   -176,     24,   -515,    234,    954,
-   605,    613,   -154,    463,    535,   -160,    684,    470,
-   827,  10458,    150,   -669,  -6684,    339,   -542,   -730,
-  -351,    984,    212,    116,     -7,     62,    926,   2175,
-  -185,   -552,    489,   -209,   5247,     38,    366,     53,
-    16,    263,   -142,   -535,   -224,    338,   -174,   -125,
-   113, -12750,    400,   -410,    281,    -12,    744,   -173,
-   486, -12159,   -107,   -183,   -484,      2,    150,      1,
-  -239,      7,   -399,   -608,   -873,    698,  -1623,    701,
-  -773,    272,   -832,    -94,   -921,    885,  13588,    178,
-   192,    148,   1346,     44,     59,   -275,    -14,   -328,
-   212,    133,   -223,    300,   -394,   -275,    -43,    -76,
-   -47,    322,   -208,  21713,    484,    329,   1860,     40,
-  -916,    502,    130,    477,   1754,    503,   7984,   -338,
-  -323,   -230,    354,    928,    430,    -89,    -94,    108,
-  -543,    365,   -130,     70,    902,   -131,     58,    469,
-   580, -30949,     36,    232,   -410,   -451,    104,  -8698,
-   113,  -1682,    -42,   -279,    -92,   -280,   -477,   -386,
-  -531,    832,     80, -15002,    -56,     93,    164,   -721,
-  8388,   -412,  -2396,    584,   1004,   -310,  -2229,   -304,
-  -383,    275,   1062,   1266,    297,    -70,   -909,    891,
-   131,  -1046,    539,  32502,   1000,    -21,   -229,    138,
-  1528,   -175,    546,    326,    168,   -320,    716,   -291,
-  -298,   -227,   1094,    -59, -12561,  12943,    786,    600,
-  -206,    889,   -761,     54,    332,  -1253,   -597,    357,
- -1124,    -50,   -168,   1172,   2266,     75,   -174,    583,
-   408,   -157,  14666,    378,    302,     -5,     48,    109,
-    28,    -21,   1044,    529,   -859,  -1182,   -202,   1984,
-   308,    402,     66,  -1139,   2595,   -380,   1119,    309,
-   482, -10705,    100,  -4591,  11646,  -1364,   -365,   9521,
-  -318,    -23,   1076,   -135,  -2742,   -833,     78,    910,
-    96,    -20,   -599,     46,    855,  -1265,   4748,   2394,
-  -250,  -9096,   -962,    191,   -346,    348,    342,   1909,
- 15330,    266,    540,    271,   2986,   1356,   1542,  -1019,
-  -895,    737,    281,    684,   -538,  10414,   -922,    287,
-   679,    204, -11142,  -2321,   -346,  -1572,   -250,   -315,
-  -604,   1336,    311,   1317,  -1111,    409,   -104,   -221,
--14125,  -1511,   -990,    705,   -808,    587,    676,    348
-},
-
-.cb0808s0 = {
- -7488,  -1327,  -5244,  -2049,  -3736,    -45,    446,   1558,
-  -755,  -6052,   6034,  -4326,    740,   -348,  12369,   2115,
-  -662,   -685,  -6592,  10176,   8575,  -1035,  -2752,  -4453,
-  -283,   1547,   4776,  -2932,    700,   3425,  -3905,   1073,
-  2356,  -7094,  -1705,   -435,   4840,  -1944,   1188,    780,
- -3963,  -6170,  -1726,   4759,  -4356,  -2124,  -1686,    321,
-  -901,   1414,   -923,  -2678,  -1198, -14777,  -2038,  -3528,
-   123,  11216,   1904,  -1914,   7588,   2744,  -4265,  -4886,
- -3530,  -1495,  -1709,  -5857,   3829,   2196,  -4842,   -817,
-  -874,  -5649,  -2181,  -3871,   3774,  -1368,    322,  -1126,
-  -996,  -3873,  13698,  -9369,   -848,   3797,   -667,  -1083,
-  2429,  -3351,  -1672,  -3562,  -1590,  -3507,    552,   6610,
- -4137, -10061,  -5452,  -6142,  -1454,   1726,  -1298,  -4479,
-  6126,   1626,  -2791,   1584,   1300,   5726,   2584,  11109,
-   696,  -3344,  -2418,   9029,   4346,  -3554,   1393,    144,
-  2051,   8916,   6174,   5170,    376,   9778,  -2298,  -4119,
-  3733,    -35,  -2673,   2222,   1383,   2046,   2859, -16131,
-  1637,  -1195,   -662,   2800,  -2241,   3801,  -5062,   -978,
-  5670,  -5449,    -79,   3479,    606,   3766,  -1325,   -265,
-   907,   -745,   1005, -14528,  -4227,  -3955,  -7194,   3690,
-  2166,  -2520,  11555,   -511,   5900,   -388,  -3854,  -3440,
-  2136,   -868,  -2986,    722,   1286,  -4027,  10382,  -1646,
-  5193,   2539,   1239,   7819,    -67,   3382,  -3297,    -46,
- -3808,    830,   1313,  -2188,  -4346,   5922,  -1057,  -6294,
- 14317,   2001,    968,   4150,  -4121,   1412,   -302,  -8401,
- -1388,  10649,  -9513,   1042,    840,  -4606,   2098,   1166,
-  1472,   -802,  -2810,    420,   -561,   -325,   2652,  -2866,
-  1334,   4878,    958,     83,    456,   1203,  -7594,  14590,
- -1210,   2202,  -1954,  -1938,  -3413,  -1096,   6036,  -1675,
- -1320,  -4485, -10665,  10026,  -2484,  -3273,   4753,   -275,
- -3542,    924,   1262,   7348,  -2959,   -749,   -408,   4594,
-  4876,   -491,   3409,   4616,    110,    557,  -1378,  -1616,
- -4532,   1699,   1412,    579,   -494,    716,    197, -23346,
- -2284,    156,   1096,   -151,  -1827,    688,   -322,   2371,
- -7909,  -1324,  -1683,   7861,   7074,   -451,    258,   9088,
-  1900,   8660,    840,   3491,  -3275,   3029,   -475,  -2122,
- -5725,  -8668,  -6069,  -3458,   4240,  -3007,  -5463,   9395,
- -2686,   4718,   -717,     42,  -1802,   3122,  -3197,  -5212,
- -1572,   -243,   -451,   8213,  -2199,  -3372,   4110,  -8176,
--10525,  -5551,   4312,    682,   2069,   1985,  -3713,  -6780,
-  1193,   2831,  -2228,    486,  -3667,   -789,  -1691,   4567,
-   464,  -2114,  -2340,  -1881,   1921,   1602,  18418,   1535,
-  -567,    228,  -9359,  -6027,   -267,   3628,  32767,   1423,
-   -74,  -2817,   2112,   -128,  -1516,  -2446,   1673,   2812,
- -1582,   2125,    618,   2569,   2714,  -1710,    340,   3255,
-   848,   3379,  -2317,  -2361,  -1823,    412,  -2496, -18164,
- -1224,   2552,  -3040,    144,   -597,   7716,   4916,  -2867,
- -2172,   2120,  -2776,    675, -11985,   1692,  -1384,  -3588,
-  4310,   1020,  -4215,   -251,  -7090,  -1916,   1914,  -2804,
-  6189,  -6732,  -1370,  -3704,    450,  -2652,   6553,    -38,
- 10348,   1244,  -2246,  -3729,  -2158,  -1340,   2357,   3118,
-  9378,  -1727,   3150,  -3867,   1277,    -15,    769,  -2352,
-  -411,   1428, -14032,  -1029,   2828,  -1894,   6084,    -36,
-   518,  13159,   1095,  -1185,  -3207,   -555,  -3256,    -76,
-  3884,   3394,   1010,   1946,    160,  -4863,   4714,  -7087,
- -3985,   5602,   3350,   7822,  -5729,  -7701,   9296,   3067,
-  3582,   5256,  13629,  -4012,  -2206,  -3867,   -664,   -104,
-  4397,  -7862,     36,    955,    -38,   -973,   3458,   5004,
-   364,  -9116,  -2764,  -2168,  -1892,  -7632,  -4834,  -5788,
- -3565,  -1245,  -4544,   6552,   4601,   2342,   6625,   1040,
-  2154,  -6985,   5838,  -1912,  -3439,   1189,  -2422,   -555,
-  3286, -14872,   -776,   1228,   2434,    120,  13673,    904,
- -1354,    645,  -1550,  -1377,  -1888,   1416,   -679,  -1685,
-  1731,   2404,  -5786,   3285,   -193,   -123,   1973,   3663,
- -1388, -14961,  -3597,   5555,  -1420,    284,   1527,  -2575,
-  1941,    871,   3900,  -2168, -12763,   2970,   -408,  -3131,
- -6426,   1892,    782,   6768,   -284,   1034,   9785,   6029,
- -3873,  -4102,  -4349,   2548,  -3686,  -5622,   4769,   -351,
-  8178,  -7253,   3687,    624,  -4386,   4028,  -2780,  -1938,
- -4061,  -1872,  -1264,   7300,    760,   8530,   -821,   -874,
--14225,  -1143,  -5400,   -850,  -2537,    478,   1668,  -1244,
-  -362,    877,   3481,  -1338,  -5218,   2091,   3996,   -577,
-   390,   8626,    820,    181,   -988,   5604,   9694,   1112,
- -3064,   -266,   1234,   -486,   1264,  -2173, -13671,   3729,
- -3212,   2548,   1745,  -9363,   8065,   3713,  -3343,  -4847,
-  2808,  -4716,  -2175,     25,  -5718,   4056,   1855,   4663,
-  2324,  -1166,    543,      2,   3931,  -3196,   2771,   -920,
- -2907,   -746,  -1241,   -306,   2793,    -22,  -2642,   3048,
-  3256,   1804,  -1310,  17876,  -1816,     56,  -1694,   -465,
-  -534,  -2274,   6139,  -2247,  -2515,  -1077,   3305,   1519,
-   273,   1128,  -1637,   2561,  -1534,    874, -22808,  -1119,
- -2551, -10344,  -2229,  -3510,    194,   2594,   1737,   4713,
- 13767,   3532,   -311,   8097,  -1012,   -841,  -4360,    793,
-  -267,   -206,  12905,  -2683,  -6424,    196,   7098,  -1690,
-  -690,   1236,  -2882,  -2668,  -2020,   8291,  -2714,  -4607,
-  -923,  -2077,  -2878,   1687, -10457,  -1575,   2172,  -3974,
-  5795,   1748,  -1852,  -5143,   4763,  -5097,  -2840,  -1851,
-  2634,   5970,    180,  -3326,  -1655,   1226,    375,   5137,
- -2678,  -5246,   4327,  -3670,   9956,  -1976,   2189,   2952,
- -6785,   -697,   1129,  -5768,  -5819,   6532,   3650,  -1711,
-  3857,     47,  -9618,  -1941,   2524,  -1244,   7242,  11646,
-   -64,   2304,    201,  -3707,   -700,    149,   2692,   -805,
-  3978,   2738,   -977,  -1004,  -5776,  12779,   7454,   -353,
- -4731,  -3866,   7076,    146,  -3302,   3065,   1955,   -343,
- -1459,   -426,  -5906,  -1318,    500,  -1014,  -1002,  -2090,
- -2924, -20521,   2610,   1581,    397,  -3380,  -2885,    510,
- -1147,   3398,   1914,     99,   -119,    144,  -3128,   2445,
-  1791,    397,   3734,    -80,  -3410,  -3798,  -1142,  -1515,
- -2615,  -1540,   5193,   2187,    940,   4969,  -2334, -16589,
-   325,  -2186,  -4567,   5121,   -894,  -6848,  -6002,   1832,
-  -568,   8259,    833,   3420,  -4459,   -748,   3442,   4358,
- -3041, -10203,   9303,  -1511,  -4821,   1950,   -966,   3573,
-   453,    705,  16238,   -901,   -163,  -2866,   -104,  -1767,
- -1779,  -1249,   3251,   1975,   1254,   -838,   -390,  -3150,
-  1020,   2526,  -2025,    662,  -2817,  -1338,   -855,  -3442,
--21123,    241,   -134,   -952,   -588,   2572,   2080,   8153,
-   114,   9732,  -6774,  -5266,  -2462,   2286,   -599,   -426,
-  1396,  -7051,  -1228,    312,  -4495,  -2525,   4649,  -1305,
- -1106,  -2366,   2232,   4065, -18674,  -1295,  -3259,  -1004,
- -5136,    206,   1177,  -5130,   2394,   2518,  -1381,   2564,
-  -138,   4341,  16988,   2546,   6782,  -3433,    850,   -970,
-  -255,   1308,   2228,   1704,  -1283,   1452,  -2608,   1487,
-  3106,  -2267,  -2998,  -6814,   1654,  21195,   1555,    968,
-   154,    124,  -1258,    714,   -407,     44,    247,    992,
-  2228,   2824,   1435,   -341,   1212,  -1612,   6126,   1636,
- -8368,    578,  -5418,    217,   -191,    204,  -7147,   5110,
-  3766,   5055,  -5979,   6683,    368,  -3597,  -4595,   7630,
- -3611,  -2384,   1369,   6995,  -3299,    -53,   2036,  -4654,
-  4259,   9618,  -1012,  -2964,   4397,  -2112,  11885,  -1648,
-  -942,  -3474,   -544,  -1410,  -1958,  -1535,   2981,  -1591,
--16787,    335,   4609,  -1990,   3821,   -645,   1842,    -64,
- -3485,   3202,   -374,    -58,  -1410,   7304,  -1958,  -2142,
--11412,  -2533,    513,  -6149,  -6679,   2152,   3153,   5102,
-  2216,  -1361,   2260,   4863,  -7031,   1538,  -5250,  -2511,
-    96,   3339,  -3447,  -3708,   7168,  -4168,    838,  -3134,
-  3228,  -1531,  -5598,  14125,    208,  -2150,    819,  -1085,
- 12282,   6714,  -2778,  -9252,  -5117,  -6623,  -1711,  -4253,
- -6306,  -1292,  -1370,  -1027,   -908,  -2863,  -1832,   4645,
-  -722,   -284,   -161,  -5106,   7110, -12494,  -1514,  -5453,
- -3308,   3520,   1101,  -1096,  -2325,   -746,    -33,   2645,
- -4458,   -797,   -684,   1514,   1716,  -6204,   6580,  -3427,
-  -650, -10493,   4868,   5833,  -2385,   -274,   1530,   3892,
- -1940,  -1415,  -2389, -11499,  -2064,    937,   -333,   1361,
- -1583,   5458,  -2296,  -3263,  -8344,  -4236,  -6357,  -2372,
- -3115,   1336,  -2184,    194,  -4262,  -7838,   6946,   4535,
-   749,   7332,     67,   -327,    273,   3211,  -1825,   -357,
-  7039,   3346,   6282,    488,  -3940,  10196,   6463,    327,
-  4407,    909,    889,  -4943,   -622,  -4049,   2532,   1870,
-   652,   1778,    663,   3063,  -1012,  -1390,   4162,  20486,
-   -86,   3166,    325,  -1912,    511,   -634,   1262,  -4719,
- -1490,   6767,  -3314,   -125,   4490, -10334,   5386,   9932,
-   781,    290,   2198,   1695,   3790,  -1878,   7760,   -300,
-  2021,   5508,   2200,    232,   7138,   1370,  -3268,   3496,
- 13934,  -1230,  -2303,    958,    141,   3348,  -2867,   -987
-},
-
-.cb0808s1 = {
-  9313,    734,   6610,  -3629, -12020,   5317,   -244,  -1858,
-     2,  -1812,  -6486,    892,    926,   -236,   1016,  -1249,
-  -469,   -238,  -1908, -10594,  -4704,   -907,  -7746,   3847,
-   564,  -5956,   3395,    371,  -5136,   4001,   1180,    769,
-  -555,  -1872,  -2943,  -1744,   8620,   1485,   9901,  -1392,
-  3425,  -7940,    151,    376,   1984,   3031,   3815,   -974,
-   537,  -7038,   1964,  -5625,   4457, -10214,  -1787,  -2768,
- -8514,    176,  -3692,   6441,   3148,    602,  -2000,  13769,
- -2792,   1104,  -2067,  -6219,   1515,   -288,   3240,  -5490,
- 11589,   3742,  -2343,  -1752,   3701,   7525,  -1676,    845,
-  6895,   2884,   3540,   2454,   1010,   2454,  -5761,   2035,
-  3369,  -9628,   -862,  -7060,   1802,   5676,   2396,   2757,
-  5891,   -701, -11896,  -4061,   7932,   -272,   2562,     83,
-   560,  -5180,  -2223,   -356,  -3343,   2874,  -1370,  -7612,
-  1773,   2006,  -4258,   5312,    342,   8196,   4939,    519,
-  3568,   4420,   2768, -11872,  -3021,   1893,   1690,  -5483,
- -8129,   7540,   -116,  -2064,  -4473,   1141,   1930,    656,
- -7728,  -2742,  -3276,   2782,   2860,  -6082,   5198,  -4751,
-  -486,   -789, -16932,   -566,   5116,   1196,    832,   4282,
-    78,   3088,   2768,   2125,   1027,   1712,    310,    808,
- -1595,   -106,   3174,   4598,  -2945,   1551,  -7688,    620,
- -1640,    339,   4538,   3339,    532,   -351,    260,    249,
- -2135,   -543, -18362,   -648,  -3871,   5514,  -1782, -11301,
-  -374,  -2078,   1610,     50,  -4439,  -2546,  -3058,    839,
- -9221,   2618,   1790,    103,  -1061,   -363,    285,  -3542,
-   503,   -437,     30,   1382,     75,  -2852,  -1028,   3095,
-  4318,  -2316,    739,    801, -22765,   2162,    913,   1698,
-   149,   2049,   -313,   -803,   3393,  -1476,   4396,  -4003,
-   854,  -1344,   1062,  10009,   6332,  -8522,  -2616,  -9904,
-  -390,  -3146,  -2951,   4222,   5538,    495,   3776, -13684,
-  4687,  -2187,   -905,   4997,   6209,   4775,  -1234,   1956,
- -4607,   3006,   -370,   -670, -12448,  -5802,   8151,    140,
-  1485,  -6340,   2139,   1231,     22,   -212,   2090,   -676,
-  2366,   -701,  -4113,    365,   2970,   -577,    918,   7324,
-  -709,   2035,   5162,   7232, -13287,  -3259,   -908,  -1900,
- -4255,  -2590,    318,   4891,    696,    -40,  -1647,   1572,
- -1221,   4896,   5241,     49,  -2083,  -5068,   7645,   8978,
-  1628,   2895,  -4930,  -8068,   2266,   2025,  -1868,   3250,
-  2642,   -785, -14571,   9979,   3481,  -2246,   1154,   2646,
-  2616,  -2033,  -2936,  -1300,   2490,    879,  -1237,  -1228,
-  -724,  -1780,    524,  -6619,  -3339,  -2526,   3533,    844,
-  2946,   2208,  -3522, -12411,  -3062,   2380,    448,    604,
- -4708,   2403,   1914,    -58,    149,  -3704,  -2019,   4246,
- -7020,  -3197,   -712,  -2219,  10036,  -2776,  -3166,   2648,
-  2947,   3386,   6445,   1587,   -268,   -536,   1895,  -9005,
- 10791,   -982,   8215,   6414,   5166,   4751,    160,   3050,
-  -865,   6216,  -1187,  -7077,   1640,   5078,   4354,   1762,
- -3869,   1174,   -149,   1078,   1884,   5149,  15091,   -432,
- -2441,  -1102,  -1194,   1078,  -1535,   8289,  -2702,   4007,
-   694,     72,    685,   2816,  13244,   -422,  -7094,    432,
-  2044, -12004,   -276,   2174,   -908,  -4784,   5725,   -250,
-    22,   5116,     -2,   2686,    955,  -8509,  -7697,  -3735,
-   672,  -1202,   4299,   4284,  12352,  -2362,   5757,   1317,
-  4293,    508,   3050,   -524,   1097,   3346,   -537,  -2440,
- -1596,  -5659,   4188,   -625,   1659,   3061,   2791,   1712,
- -2991,    966, -16903,    610,  -3314,   4160,  -3750,    580,
- -3407,   -340, -11829,   -520,  -1625,   2905,    674,   -147,
- -5284,  -4278,  -5021,   4635,   6299,   2207,   2595,  -7811,
-   -68,   4107,   4314,  -1540, -11044,  -2214,   -803,    232,
- -7602,    -95,   1130,   4991,   -361,   1675,   4487,   3607,
- -6192,   -130,    137,  -1440,   2826,    178, -13834,   -984,
-  1149,   1230,   1587,   1571,   3286,   5293,  -2259,   2021,
- -6211,  -7608,  -2710,   2502,   4315,   -539,  -8530,   -746,
-  -654,  -4003,  -5917,  -3728,   4522, -10350,  -1266,    210,
-  5078,  -2988,  -3866,   3919,    969,  -1063,  -6300,  -4584,
- -2420,  -2094,   -884,   2338,  -3150,   5461,  -1145,   -734,
-  1644,   2183,  19114,  -1144,  -2313,   -404,   1236,   3583,
-   134,   1802,  -4088,  -2795,    681,   3738,   1831,  16571,
-   917,  -2290,  -3648,  -1588,   -158,   -528,   -792,    394,
- -7432,   2446,    402,   -391,    -73,  -1398,   1286,  -6503,
-  5216,   1094,   -939,   1673,  -2038,  15842,  -1971,   4160,
- -1664,   7231,    642,   5770,   4209,  -1839,    220,   -266,
-   165,   2055,   5222,  -3344,  -6544,   5412,   1514,    586,
-  1591, -15256,  -2715,    941,   1308,  -9170,  -2863,   4935,
- -2913,  -1291,   2791,   7967,     14,  -1101,   3774,   3580,
-   848,   1337,   1138,  -2839,  -3564,  -5300,  12429,     14,
-  1466,  -7114,   1198,  -3474,   -237,  -2577,  -1305,    445,
-  1069,   -174,   1684,   3902,    229,   5842,   -690,    978,
-  -754,   1182,   -859,  21078,   -185,    710,    797,  -2155,
-   367,  -2168,   1002,   3805,   -924,    468,  -2322,  -3590,
-  1608,   3387,     18,   1536,   -858,    642,  -7964,  17689,
-  9843,  -4878,  -3003,   7373,   5934,   4286,  10484,    -63,
- -4629,    974,  -2227,   2602,   3810,   1905,  -1668,  -2130,
-  2020,  -2360,   2853,    612,   5070,  -1248,   -868,   -497,
-  3478,  -1937,  -3006,   -645,   3589,   3019,  -3293,  16469,
- -5243,  -2918,   1788,  -2569,   3717,  -9630,  -1352,  -3870,
-  -416,  -4190,  -8863,  -6888,   -498,   -814,   -783,  -4625,
-  5841,   1562,  -2173,    481,    280,    816,   4742,  -9962,
- 11799,  -2029,  -2460,   4972,   -600,  -1452,  -1901,  -2122,
-  3130,   2686,   -819,  -2366,    866,  -2093,   1052,    -58,
-   284,   3830,  -4738,  -4114,  -1321,   1307,  -2820,   4915,
--11701,    522,  -1982,   7024,   8403,   1762,    -46,    532,
-  5097,   5013,   -615,   3086,   2089,   6899,  -1107,  -4047,
- -2903,   5356,  -4802,   -965,   6706,   3895,   9022,   1388,
- 10971,   5927,  -2954,   -965,  -3473,  -5177,  -2654,   3418,
- -5315, -16695,  -6587,   -416,    404,   1230,  -2586,  -3292,
-  1390,     14,   -481,  -4446,   1335,    109,   1060,   3958,
-  1275,  -5655,   1253,  -2411,    207, -12550,   6208,  -2447,
- -3415,   2503,    848,   3094,   9336,   2647,   2455,   2238,
-  2356,  -2132,   5347,    915,   2227,   -103,   5832,  -2504,
-  7562,   9568,  -6100,   4091,   2668,  -1722,    287,   6763,
-  4058,   -387,  -2060,   5522,   3184,   4766,   -158,    650,
--11284,  11841,   6230,  -4232,   5308,   3174,   4926,  -2970,
- -4761,   -980,    117,   1944,  -1974,  -5484,   6534,   -266,
- -7222,    924,  -2654,   -588,   9609,  -2337,   1892,  -2110,
-  5088,   1856,   7964,  -4029,   -940,   1429,    805,  -4705,
- -1362,    892,   -189,  -8354,   3259,    194,    767,  -2877,
- -4165,   -990,  12185,   -160,  -2002,  -1384,  -5388,  -1604,
-   226,  -6353,  -4157,   1773,   2360,  -4356,   -730,  -5462,
- -4054, -15669,  -1528,   -394,   4101,   -203,   2792,   -787,
-  3391,   -299,   6384,  -1630,  -7186, -12765,   4618,    934,
-  -401,   2790,   2284,  -4932,  -1260,  -6009,  -2590,  -2285,
- -1289,   3366,  -4192,  -4462,  32767,  -3135,  -1888,     67,
- -2874,    150,   4760,  -1571,    584,  -2187,    358,  -1733,
- -1286,  -4573,  -2003,   1872,    940,  -1942,   -255,  -8856,
- -1320,  -3348,   4854,   -509,   2836,    -14,   2490,  -1537,
-   882,   1188,  -3132, -15209,  -1633,    -44,  -2827,    368,
- -1099,  -1073,   -467,   6318,   5863,   2840,  -5200,    569,
- -2984,   6587,   9596,  -4924,    457,   4879,  -4449,   3528,
-  1868,  -3894,  -3905,  15420,  -2590,   -599,  -4975,   3892,
- -1454,   -616,   1890,  -2700,  -3268,  -1386,  -1065,  -3078,
- -2454,  -1902,   4726,    -34,  -4218,   1619,  -3074,   5540,
- -6392,  -3570,   2687,  -8742,    333,   -106,   2326,  -1737,
- -3775,    397,  -3553,  -6632,  -6066,   9567,   2904,   -889,
-  1136,   1295,  19390,   -268,  -3127,   -180,   1696,   -814,
-  -775,  -4914,   -456,   -758,   -866,   1102,  -3740,   -374,
-   469,  -6902,   1440, -10243,  -6221,  -4797,  -3074,  -1142,
-   297,   5069,  -1547,   5474,    716,   -454,   3806,   4100,
-  2901,  -2169,   -744,   5032,  -5586,  -2986,   2286,   2414,
-  7860,  -2672,    -46, -10046,   5348,  -1018,   1016,   9142,
-  4543,   5587,   2228,  -2684,  -4594,  -2457,  -1850,  -3651,
- -1806,   4826, -11686,   1940,  -3529,   1078,  -5234,  -2420,
-   -83,  -2322,  -5134,   -775,    677,  -9257,   -864,   -915,
-  4494,    411,  -4820,   5999,   4472,   5823,  -4597,   3121,
- -1868,  -1539,   2338,  -4249,   1154, -13422,    791,  -1235,
- -1240,    364,    177,  -1508,  -2527,  -2949,  -2062,    118,
- -3115,    293,  -1927,  18644,  -1100,    152,  -2528,   1914,
- -1380,  -1624,    302,   -831,   -920,    320,   -879,  -1252,
-   813,    -11,   6960,   -522,   3092,   -119,   1486,   3068,
-  6690,  -3079,  13305,   6342,    937,   1632,  -1026,   1896,
- -2335,  -3961,   5510,   2782,    187,  -2448,  -1251,    756,
--15856,   3179,  -1155,    808,  -1748,  -6593,   1494,  -3122,
-   -98,  -3808,    491,   1752,   3188,   2158,  -1924,    763,
-  1165,    148,  -3161,  -1284,  18082,   -195,  -1125,    845
-},
-
-.cb0808m0 = {
--18656,   -461,    236,  -1122,   -796,   -101,    851,  -3748,
-  1374,  -8549,  -3366,  -1482,   1026,   2046,   4394,   -521,
-   232,   -486,  -1656,  32767,   1954,  -1183,   -130,    392,
-   194,   -868,   2883,   -168,  -1674,   -910,    -34,    819,
- -1105,   1628,  -4871,   -585,  -1170,   -572,    451,   3911,
- 10770,    -35,  -4126,   7124,   7110,   -860,  -3914,  -3294,
-   272,   -647,    220,  11965,  -3378,   2726,   1990,   1624,
- -3689,   9884,   2394,   3096,   -518,   5169,  -4018,   3108,
-   168,   1256,   -410,  -3851, -11176, -10479,   2042,   1421,
-  1488,   -992,  -1562,   -653,  -1191,   2246,    467,   4732,
-   154,    729,   7244,    -18,   1313,    -51,  -1824,   1218,
-  1473,  -6763, -11270,  -4295,   4118,   1043,  -5782,   1370,
-    46, -11027,   4086,  -1501,    -11,   -621,    464,    781,
- 13680,    257,    554,   3119,    750,  -1857,   1046,  -1252,
-  -512,    739,  14811,  12642,   3841,   2824,    163,   1620,
-    39,   4766,   1411,  -2197,    525,    658,    419,      5,
-    92,   1544,    290,  -2038,  10603,  -5764,  -3335,  -6629,
- -2579,   4020,  -3107,   2779,    849,   5678,    260,   2804,
-    99,   1339,    544,   1438,   -450,   -598,    764,   1568,
- -1034,  -4560,   2604, -18205,   1644,   1003,   -675,   3217,
-  -334,   -832,  -1452,    322,    608,    300,  -4776,   -812,
-   -36,    627,   1654,   -248,   -838,  21571,    -89,  -1626,
-   530,  -1151,   9440,    522,  -6138,   2213, -10095,   -562,
-  1000,   5037,   -122,     -3,   7064,    397,  -2118,    362,
- 15791,  -1047, -15010,  -1527,  -1356,  -2805,   -560,  -3148,
-   266,    -45,   1324,  -3312,  -1772,   2382,    189,   6537,
-   124,  -1272,    156,    588,  -2678,  -3106,   2828,  -3684,
-   689,   3884,   4650,    192,   -323,  -5426,   -722,  11486,
-  -607,   3591,   4299,   2117,    362,  -9114,  11700,  -3391,
-  2357,   7639,   2197,   4350,   2970,  -2525,    169,  -6112,
-    91,   1520,    -19,   1558,  -4588,   -837,  -8163,    897,
- -7992,   2080,  -3102,    774, -10592,   -314,   -137,   -524,
-    87,   -799,   -111,     74,   1312,    862,    266,    243,
-   199,   -288,   1205,   -829,   1650,   2880, -24776,   3867,
--13101,    597,  -9778,  -2084,  -3089,  -1112,    548,   -638,
-  3727,   -446,   4877,   2099,     68,  -2736,  -4914,  -7103,
-   263,  -9228,   -782,  -2109,   1088,  -1881,  -1424,    -30,
- -1353,    586,   4085,  -3573, -11921,   2366,    516,  -1028,
-   834,   -234,   2150, -15893,   2305,  -3619,  -2567,  -8366,
-   610,   2946,  -2383,   2293,    946,  -3550,  -6770,  -1481,
-  -758,   -864,   -232,   2855,     40,  -2330,   2069,   -345,
-  1801,   -589,  -1241,    647,   6988,  -2625,  14308,   2801,
-   759,  -2740,   -680,    964,    365,   -506,  22268,   1766,
-  -202,  -2751,   -293,   3754,   1280,   -521,  -3355,   4615,
-   594,  -1783,    -39,    -46,     48,  -2638,   -551,   2548,
- -1880,   3730,  -1726,    939,   -345,     -7,  -1630, -23405,
- -1002,   5655,   2100,    440,   1682,   1020,   -594,    344,
-  1511,  -1286,   5518,    473, -11398,  -4552,    720,   4701,
-  7726,    126,  -1953,   -484,  -1648,  -1766,   1589,    996,
-  -688,   -381,   1678,   1498,   -528,   -860,   -667,   -823,
- 32767,   -463,   -243,  -1242,   1074,   2460,  -1411,   -459,
- -1533,   1462,  -2603,   -784,   -391,    338,   3444,   2170,
-  -924,    949,   1972,   1520,  -3062,   -671,  12908,   2636,
-  2805,    722, -12016,    -26,    616,   1192,   1193,  -1028,
-  -128, -22850,    191,    408,  -3105,   -592,   -440,   1264,
- -2580,    847,    850,   2300,   -278,    126,   2214,  -2693,
-   -21,   -194,   -594,   -533,     45,    570,     38,    636,
-  1276,    171,  29846,    648,    911,   -358,    300,    602,
-   413, -10167,    -54,  -1353,     42,  -1770,    491, -12154,
- -1808,     26,    425,   2009,    910,  -8134,    362,   2001,
-  -114,  -2586,  -1049,   -249,   -312,    160,   1677,  27043,
-   -44,    160,    834,    243,   -606,   -272,   -979,  -1605,
-   105,   -491,    754,   -230,   2442,     24,  -5139,   -395,
- -3562,  14436,  -1208,  -3232,   2555, -12980,   -906,    429,
-   217,   -432,  -1263,   -244,   -225,    912,    -64,    780,
-  1101,    854,   -240,    308, -28630,    518,     32,    976,
- -8642,  -3041,   1801,   -742,  -1513,    128,  -3189,    857,
--14277,  -1802,   1229,    -68,   -565,     65,   4094,   1614,
- -8254,  -1153,   -640,  16225,   3508,  -1383,  -3882,   -347,
-  1346,   3845,   2665,   2340,  -1862,  -5318,   1402,  -1352,
--21682,   -694,  -1182,    286,   -806,   2133,   1848,   -532,
- -3750,   7564,   1054,    284,  -3742,   2559,   2748,   3408,
- -1544,   -342, -22578,   1225,    958,   2559,    267,    378,
- -3608,  -1404,  -1669,    -13,   1135,    153,   -625,   1436,
-   211,    556,    739,   1094,  10452,    850,   5128,  11469,
-   121,   4937,  -3643,   1371,   -373,  -6686,    229,  -3256,
-   -75,   1304,  -1023,   -452,    288,  12709,  13572,   -501,
-  1840,  -1044,  -2014,  -4077,  -2726,  -1010,  -3826,   -629,
-  -466,   -923,   -847,   5784,    898, -12036,   1253,  -1741,
-  1546,  -3710,   2782,  -3430,  -1810,    263,  -8254,   3126,
-    55,   -376,    202,    968,  -1686,    944, -15300,  -2664,
-  1393,    783, -11080,   1714,  -1666,  -1064,  -4859,  -2344,
-   334,   1313,  -1209,    877,  -1828,  -2130,  -3057,    340,
-  8030,  -3222,  11622,  -5620,   1469,   3340,   2862,  -3945,
-  -868,    351,  -1314,   2277,  -2346,  12384,    996,  -2460,
-  1810,    703,  -2158,   3168,  -9887,   8754,   3503,  -1414,
-   445,    850,    -30,   2389,   -617,   3271,  -1606,  -5633,
-  2993,  10009,   5704, -11589,   4278,   1304,  -2418,    479,
--16596, -12349,   2915,    327,    895,   1278,   1412,   -310,
-  -653,  -1287,    880,  -4294,     38,   2179,  -2074,  -1810,
-   198,  -1544,  -8008,   2456,  -2821,  -3223,  -3713,  11763,
- -2081,   -141,   4833,   1652,   3598,    551,  -1655,  -1154,
-   -60,   -302,    739,  -1494,   2595,  -1006,   2665,  10834,
--11270,  -2996,   -636,   -446,   1816,  -1539,   4149,   -184,
-  -100,    -55,    265,   2207,    639,   -162,  -2210,   -626,
-   605, -21149,   2163,   -970,   -330,  -4655,   3396,  -3092,
-  -544,   -650,   -304,     93,  -1484,   -888,  -8982,   1871,
-  1701,  -1423,   1671,    -11,  -1287, -14292,    592,   1040,
-  -622,  13202,   -660, -12745,  -2836,  -1832,   3481,   1546,
-   235,   -646,   2132,   -602,   2391,   1534,   3599,  -4932,
-  -296,  -1855,  -2075,  -2646,   -219, -10248,   1161,   5955,
-  6954,   9109,   3498,  -5932,  -1787,    373,   1234,   1244,
-  -813,    -76,   9083,  -5120,   -499,  -1774,  -2150,  10601,
-  -170,   1160,    982,   -597,     95,    151,   -534,   6554,
-   840,   -958,   -720,   2066,    -50,  -2877,    -74,  -2068,
--24760,   -725,   -357,   1273,   1941,   2525,     46,   -819,
-  -230,   1030,   2291,   -287,   1092,  -2315,    427,    -19,
-   448,   1698,   9797,  10962,   3034,   2622,  -2652,  -1128,
-  -194,   -180,  -1176,  -1794, -22248,    244,     -3,  -1856,
- -1054,  -2751,   -459,    -62,   -433,  -2274,  -1790,   -192,
-  -720,   -421,     55,   -721,   1960,   1094,   2500,  -2353,
-  -480,   -784,  -1221,   -505,   1738,  -9960, -10772, -13657,
-   122,    387,   -667,   -454,    988,  30780,   -757,  -2319,
-   878,    962,    753,   1306,    716,   -771,    539,   -705,
-   508,   1915,   2114,    937,    447,    935,  -1432,  -1143,
-  4435,  11759,  -2442,    -53, -10601,   1979,   5419,  -2296,
-  -172,  -5987,  -1168,  -2012,   2257,  -1451,     97,  -1253,
-  5548,    884, -14448,   3134,   2549,    172,   5404,    869,
-   -83,    597, -12416,    762,  -1035,   -805,  -1369,   -804,
-   664,   9644,  -4329,   1130,  -1526,  -2900,    628,    620,
- -6436,  -2370,   2107, -11836,     37,    864,   2105,    314,
-   216,   -529,    810,   3141,   3716,   7019,  -2653,   1466,
--14940,  13128,   1218,   2287,   -145,   -443,   -923,    476,
-  2411,   5428,   -611,   2212,   1450,  -3042,  -4750,   3562,
-   587, -15378, -15151,    600,   1029,  -2353,   -934,   1986,
-  1444,  -2171,   1020,   -700,  -1508,    195,  -2466,   -798,
- 16460,  -2164,    520,   2711, -13832,  -2024,   -871,  -5268,
-  3556,    117,   -416,     -8,   2128,  -1570,   2052,  -3169
-},
-
-.cb0808m1 = {
- 16492,   -295,   2556,   1303,   -440,   7584,   3305,  -3422,
- -1196,  -1809,   2142,  -1292,   1048,    314,   1945,    578,
-  1080,   -255,   1109,    617,   1597,    198, -29081,   -243,
-    54,    -33,     76,   -418,   1332,    475,   1495,   1554,
-  -782,    308,  -1286,   1044,    300,   1544,    646,   9441,
-  2577, -11140,   1421,   1107,   -483,   -590,    625,   8544,
-   446,  -1814,   1714,    685,   9620,  -4981,  -3100,   -724,
-  8439,  -2333,    506,   3557,  -1160,  -2199,   -659,   4107,
-  8620,  -1406,  -3745,   1729,  10756,    868,    -82,   2584,
- -3140,   3632,   2617,   3880,  -1175,   -163,   1864,   -980,
-   551,    201,   -433,  -1464,    708,   1926,  -8471,   3870,
- -2376,  15567,   2112,    753,  -2450,     72,   1131,   2932,
-  -139,   6392,   1547,      3,    625,   -823,  -1750,    811,
-  -977,  -1389,   1300,   1184,    399,   4684,    196,   3679,
- -1672,   -218, -11023,     98,    492,   4072,   1213,  -2004,
-  3602,  -1787,   1288,  -9442,   4157,  -4267,   3509,   5317,
-  -574, -11094,   1078,   6240,   1593, -12773,    408,   3960,
-  1116,   1517,   -816,   -577,   -696,    554,   1645,   -936,
-    83, -20255,   -754,   1460,   1110,   1412,   -757,    377,
-  2373,  -1608,  -1414,  -1028,  -3152,   1534,  -4145,   2274,
-  -286,  -7058,   2286,   4013,   2515,   2681,  -5602,      0,
- -1740,    257,    756,  11496,    954,   4513,   3968,   4851,
-   278,   -511,    829,   2853,  -9743,  -3723,  -1550,   -444,
-  4256,   -679, -11411,  -4290,  -1470,  -4191,   -952,   -239,
-  -198,   1361,   9527,   1481,   -981,   1403,    991,   -255,
-  9326,   1832,  -1936,   -135,   1123,   2756,   1932,   2543,
-   795,  12612,   2429,   -498, -13185,   3812,  -1628,    196,
-  1822,   4333,   2760,   -676,  -2902,   1244,  -1974,  -7046,
--12216,   1503,  -2176,   1916,    365,    636, -11348,  -5030,
- -3319,  -3794,  -1016,   1157,  -4158,   3424,    344,   4494,
-   812,  -3074,   4356,    293,  -3463,   1232,   1746,   2696,
- -8269,   -961,  -4316,    130,  -4278, -14007,   3025,  -2703,
-   179, -10176,   1511,  -1460,  -1100,  -1171,  -1575,  -2596,
- -2026, -11400,   2689,   1480,    743,  -1669,   2728,    742,
-   -60,  11452,     84,   -662,   1424, -15103,   -410,   2141,
- -1664,  -1378,   -122,     97,   -358,   -820,    382,  -3865,
-   374,   1698,    -21,   -752,    595,  -8771,   -731,   9368,
-  1698,  -2586,  -6790,  -2507,  -1776,   4993,  -3867,  -2807,
-  -190,  14465, -13938,   3095,  -1198,    374,   1682,   1888,
-   286,   -576,  -2094,    454,   -690,   1396,  -1139,   -422,
-   405,    238,   1718,   2048,  13448,   -151,   -247,    202,
-  -900,  -5630,   3121, -10988,  -1615,   1955,  -3901,   3360,
-  1429,   3928,   1951,  -1099,   -435,   1572,   1500,  19176,
-   731,   -439,   3686,  -3039,    244,  -4270,    -34,   1289,
-   296,   -406,   2216,  -1400,  -1946,    264,   1536,   2992,
-    54,    892,   -181,  -1545,    278,  24923,    989,   1301,
- -1279,   -188,   -198,   -661,    612,  -1520,   2355, -12972,
-  -694,   -560,   1364,  -2988,  -6236,   2555,  -6630,   1423,
-   440,   -598,  -1092,    304,  -2529,  -1698,   -909,   2560,
-   844,    768,  -2988,   -661,  18432,   1158,   -639,   5070,
- 11015,    -14,   2313,    756,  -1941, -10986,   -490,  -5235,
-  2646,   2406,    170,   -546,    337,   6499,  -4450,   5598,
-   299,   -504,  14322,   -972,   9356,  -2056,   8812,  -1599,
- -1931,   2084,    119,   -983,   -305,   1437,    403,   2651,
-  -159,    229,    209,   1438,  -1789,  -1159,   1017,    416,
-   408,    454,    858,   -652,  -1554,   1198,  18278,    122,
-   433,   -165,    162, -10532,  11563,   4754,  -2022,   4246,
- -1396,  -2417,  -1796,  -1496,  -1279,   3877,  -1217,   -770,
-   983,   -609,   1766,   -184,  -5664,    546,   7948,   1978,
-  -250,   4350,   3498,   2797,    802,    846, -12628,  -1092,
-  -240,    781, -11252,   -955,   9944,   -222,   1177,   1262,
-  -534,   1790,  -7396,   1452,   4251,    303,  -3714,  -2295,
-  -290,   -227,    672,  22690,   -622,   -466,   1599,   -496,
-   326,    871,  -1948,    148,    449,    214,  -2175,    713,
-   394,   1921, -28716,   -786,   1083,   -641,   1232,   -246,
-  1572,   1575,   -879,  -2962,    -57,    369,   1633,  -1457,
-  1194,  -1222,    304,   -955,    104,  -1249,   -935,    135,
-  -758,   3483,  -1190,   1457,   1130,  -1284,  -3709,  18042,
-     6,     25,   1233,   -328,    347,   -512,   2071,    328,
--18037,   4582,   3841,   -434,   -745,    332,   -576,   3006,
-   336, -11505,   -646,   3509,   -996,   1270,   2041,   1353,
-  1193,   2976,  11569,  -3165,   1450,   4351,   2522, -10022,
-    -6,  12602,    874,    518,    475,   1251,  -3290,  -2674,
-  4802, -11794,   -946,   -426,  -2846,   1619,   1105,  -1022,
-    -1,   1759,    646,  10347,  -2937,  13505,   1104,    614,
-  1149,   -800,   2377,   -115,    792,   -948,  -2431,  -1779,
- -1142,    809,  -3130,    447, -15516,    313,  11235,  -1346,
- -2426,  -2737,  -1738,   2236,   1094,    802,   1323,   3612,
-  -213,   1383,   2800,  10394,   1210,  -2360, -10203,  -1991,
-  -102,  -2669,   2303,  -2184,   1830,  -1158,  -5633,  -4083,
-  -252,    311,    612,   -331,  -2786, -12421,   9994,  -6006,
- -4996,   -954,   1014,  -1147,    860,   1252,   1114,  -2069,
-   266,   -230,   -591,  -4442,    230,  20603,   1386,   1130,
- -1468,  -3600,   2168,    836,  -1754,   -511,   -542,    216,
-    26,   3476,   1165,  -4293,   3098,   -245,   -579,   1830,
-  2248,   5326, -18357,    397,   5466,    734,   3920,  -3678,
-   319,  -1062,   -610,  -7509,  -1064,   1456,  -5729,   1088,
-  9099,   2266,    241,    201, -10017,  -1545,  -2799,   1491,
- 27098,    -60,  -1736,   1387,    859,  -1474,    -79,  -1122,
-  -971,  -1302,    906,  -1133,  -2659,   -296,   1344,  -2698,
-  -448,  -1476,   -212,  -1585,   1310,  14353,  -2165,  -2229,
-  -656,   5219,  -3266,  -1850,   7942,   4997,  -2295,    519,
-   608,  -9498,  -1700,   1770, -15308,   1286,  -2914,   2252,
-  -717,   2136,   2478,  -3747,   2362,     -5,   -237,   2334,
-   701,   -774,   -672,    -20,   -599,    623,   -700,   -713,
-  -979, -29926,  -1090,    848,   -141,   1273,   -711,   1782,
-  -221,   -103,    170,   -185,  -1059,   3066,   1321,   1182,
-  3641,   -217,   1959,  11806,   2390, -10312,  -2575,   1612,
-   596,   -352,   2197,  -2041,   2385,   -898,  -9363,  -1144,
--10896,     20,  -7842,  -1047,   3687,   2147,   2584,   -249,
-   -72,  32767,   1936,    446,   -889,   -845,   -896,   1269,
-   448,    327,  -3411,      4,    702,  -1900,   -646,    799,
-  -770,    662,   -911,   -856,    287,   1667,   -108,    -64,
-    16,   1578,  -2059, -27327,    112,   -188,   2504,   -692,
-   250,    360,    564,    868,   4147,   1340,  18080,  -3584,
-   445,    364,  -2623,   -412,  -2918,   -116,   2611,  -2396,
-   -44,  10934,  -1512,  -1166,    239,    913,    190, -14681,
-  -767,   2610,   2931,  -2389,   3590,  -1680,   6287,   -531,
-  -616,   1317,  -1034,   -900,    871,   -329,    467,   1200,
- -1914,   1108,   3150,  -6878,    544, -14411,   2807,   5427,
- 13361,   1448,  -1753,    524,  -5851,   1467,  -1866,   6888,
- -8742,   1372,  -1515,   4883,  -2248,  -1042,   4628,  10768,
-   149,   -358,  -1287,  -1289,  32767,  -1137,    941,  -2112,
-   451,  -1436,    174,    294,    475,  -3667,   1610,   1641,
-  -599,    626,   2058,    671,   1626,   -985,   -123,   2040,
-   421,   1797,  18448,   2538,   -359,  -5042,   3096,  -1136,
-  -320,   1823,     30, -12002,  -1297,   -850,   -418,  -1497,
- -1761,   5073,  10944,    212,  -4713,  -1614,  -1752,  -2135,
-   483,   1043,  -1989,   -293,     39,  -1049,     67,  -7482,
-   712,  -5358,    896,  12460,  -1744,  -1793,   1538,   3577,
-    -6,    418,    -72,   1072,   1367,   1080,   3564,   1468,
-   482,  -1298,  -6442,   -299, -12934,   -757,  -4199,   3842,
--11331,  -1216,   -206,   1598,  -1135,  -3240,   3294,   -286,
-  -540,    777,   1188,  -1189,   4516,   2638,   2071,   9702,
-  -900,   1002,  18707,   -705,  -1856,   1185,  -4832,  -1694,
- -3502,  -2324,  -2826,  -4600,   1996,  -3110,    110,    117,
-   405, -16854,   -510, -14725,   1699,   1922,  -2117,  -2718,
-    45,   1064,    507,  -1781,   2106,  -2310,   1239,   5860
-},
-
-.cb1108l0 = {
-  2354,   8016,  12528,   -947,   -348,   1760,   2054,  -3960,
- -2125,  -3578,   3932,   1647,  -3316,   6053,    392,  -3128,
-  3209,  -2445,    463,  -2835,  -1555,   1259,    296,  -1465,
-  1839,  -4811,    420,   -215,    469,  -1013,   -272,    185,
--27061,  -1154,      8,    298,    259,   -953,   -555,    472,
-   617,  -1127,   -673,    982,   -398,  -1681,    328,    882,
-   614,    800,    431,     84,    880,   -240,  15758, -14324,
-  1301,   1578,    932,   -694,  -1456,   2435,  -1651,   1464,
-   227,   1527,    527,   -128,    698,   2405,   -726,   1489,
-  1016,   1938,  -1897,  -1478,   -238,    932,   2507,   -519,
- -1147,    557,   2334,    700, -12914,  14861,    158,    255,
-  1195,   -883,   3359,  -1045,   2095,    520,    249,    926,
-   789,   1392,   -185,  -1654,    902,      9,  -2166,  -1916,
-   543,  -2126,   2842,   -332,   1356,   -344,    436,   -404,
-  -174,   -489,    858,    258,    229,    -45,    327,   -316,
- -1176,   -454,    115,   -220,   -458,   -194,    271,   -530,
-  1572,   -574, -25068,    167,    601,  -1027,  -1705,  -3144,
- -4231,  -1636,  -1012,  -1002,   -519,   -825,   -458,    945,
-   546,    193, -17909,   -156,  -1067,    826,    338,   1152,
-   562,   -506,    848,    239,    188,    656,     97,   -174,
-   -59,    242,   1946,    -67,    745,   2043,    424,   -192,
-   574,   -524,   1553,    566,   1480,   -747,    487, -20623,
-   872,  -1089,   1034,   1357,    919,    153,    154,    498,
-    54,    555,   -989,    707,    -85,    -21,    700,  -1424,
-    90,    655,   -399,    123,   -709,    117,    438,    330,
-  -720,    190,    812,   -138,    460, -32768,   -162,   -410,
-  -327,   -122,  -1208,   -554,   -502,   -178,   -309,    373,
-  4295,   -945,  -5502,  -2752,  -6615,  -1241,   1278,  -1315,
- -7683,   -986,   -419,    -50,   2384,  -4640,  -6246, -11804,
-  -308,   -446,   3486,  -4824,   1736,   -590,    960,    195,
-   593,    164,   3355,   1655,   1233,     66,   -787,   -347,
--13751,     74,  -1209,   -812,  -4098,   -102,    910,  -1659,
- -2036,  -3147,  -2075,  -2605,  -1240,   4499,   1727,  -9484,
-   549,    728,   3411,   1958,  -4439,  -1064,   5690,  -1600,
- -1984,   1695,   -588,   4815,   -138,  -3380,   -512,   1553,
-  1978,   4310,   -730,   -402,    828,   2124,  14216,   -222,
-  2757,  -8686,    523,   2516,   1017,    790,   -136,   -470,
-  -252,   -717,    808,  -1113,  13766,   -114,  -1182,   3053,
- -5238,  -2231,   1720,   -511,   -987,   1592,  -1257,  -2578,
-  1777,   1075,   2367,   -227,   2330,   -672,  -2620,  -1449,
-  2122,    362,   1249,   1338,   -327, -21631,  -1540,     24,
- -2356,   -656,   1981,    -92,   -207,  -2188,     34,   -457,
- -1291,   1231,   -460,   -128,   -396,    593,   -671,  -1513,
-   136,   -335,    560,  -1121,    490,   1008,    948,   8629,
- -3344,    467,    881,  -5731,   1120,   -300,  -1432,   1227,
-  1558,    990,  -1078,    214,   -922,    -81,   1120, -15586,
- -1176,   1203,  -1911,    151,   1484,   1555,   -421,   -420,
-  -428,   -762,    292,    -59,   1075,   -649,   -841,    494,
-   194,     27,   -768,   -356,     54,    163,    -73,    293,
- -1717,   -392,    750,    234,    751,   -111,  26858,    911,
-  -389,    451,    442,    260,   -117,    270,     19,  -2429,
-   618,   -962,    378,     10,  -1954,  -1336,    525,   -258,
-  -693,  -4155,  10265,   2924,  -1361,   3197,  10199,   6870,
- -2608,  -5792,    619,  -1994,  -2035,   -701,   2598,    465,
-  -575,    311,    175,    162,  -1191,    162,   -157,   -147,
-   325,    551,    536,   -188,   -290,   -165,    343,     14,
-  -268, -27113,    278,    127,   -233,    -68,    606,    125,
-   665,    438,   -442,   2510,    800,  -1991,   -641,   -386,
- -1574,     78,    946,    189,    106,  -2249,   -268,  -1708,
- -1192,    986,   3076,   1807,     21,  -5884,   -964,    256,
--15916,  -1320,  -2867,  -3562,    491,   3502,   -337,  -1542,
-   496,  -3182,   1676,  -2371,  -4264,  -2053,  14342,  -5674,
-  1744,   1813,  -3731,  -3761,   1350,   1783,   -438,   -920,
-  2366,   1438,   -687,    512,  -1934,    323,  -3158,   1775,
-  1964,  -6742,  10162,   7763,   1469,   1967,    851,   2742,
-  7413,  -3338,    742,   1854,    310,   -192,   -936,  -1770,
-  -775,   -976,  -1532,  -1436,   -670,  -4032,   1194,  -1336,
- -4369,    332,    604,    962, -27563,   -972,    842,   -743,
-   275,    713,   -251,   -799,  -1190,    372,   -213,   -423,
-   202,   1189,    -31,   1084,   -974,    756,   -148,  -1669,
-   640,   -549,   -339,  -1506,   -112,   -598,   -870,    410,
--13307,  13141,  -1911,   2308,    -92,   -776,    221,   1503,
-  1578,    803,   -308,  -1672,   -404,    -83,  -3517,  -1327,
-  -606,  -2426,    -61,   -513,    318,  -1805,   2049,   1887,
-  -777,   1268,   -542,   -116,   3550, -18840,  -2986,   -979,
-  2653,  -2875,   -922, -10520,    804,    107,   3234,  -1270,
-  -608,   1042,   3599,    965,   -342,  -2096,   -267,   1704,
- -3939,    791,   2180,   -985,    816,   -716,  -2661,     99,
-  1523,  11902,  -1782,    775, -12517,   3244,  -3762,   2046,
-  -278,   1539,   2895,  -2425,    -10,    990,   1484,  -1377,
- -3399,   -984,   3171,   1513,    696,   -785,    155,  -1072,
-   414,   2016,  -1932,  -3124,  -1126,     68,   3855,   1360,
-  4074,  17596,   1714,   -596,   4000,   1656,    230,   -258,
-  2266,    843,  -1720,   4624,   -714,    854,    696,    636,
- -1357,    350,  -1256,   -523,    168,  -9933,   -766,    198,
-  2680,   8060,   2168,  -2789, -14255,   1444,   -520,    169,
-  1032,   1478,    294,   -644,   -320,    856,   1282,   -216,
- -1000,   -925,      2,   -890,    679,   -629,   1152,  -1329,
--13941, -16385,  -1050,  -1022,    106,  -1151,    -41,   -709,
-  1771,   -882,   -729,  -1420,   1544,   -120,    386,   -838,
- -2744,   1559,    904,    273,  -4221,  -1065,   -312,  -1046,
-   234,    830,    387,    172,   -956,   -332,    360,    408,
-   125,     90,    348,    915,   -264,    911,    263,    124,
-  -620,   -612,    220,    164,    202,    124, -30252,   -159,
-  1006,   -320,    283,  -1641,  -1312,  -9057,   5525,   7520,
- -2884, -12194,   2771,  -1164,   1842,   1261,   -582,    766,
-  2498,    393,    953,   -617,   -756,   -323,  -1862,   1195,
- -1326,   -436,   -965,    366,  -6727,  -1226,   9014,    400,
- -1258,   -812,   -279,   -404,   1621,     86,   1622,    -16,
-    96,   -515,   -257,    -39,   -134,   1843,   -294,   -491,
-  -908,   -120,   -720,  -1162,  -1555,    405,   -134,    528,
- 23596,    -77,    183,   -444,   2077,    955,    649,   2246,
-  3236,    735,  -1202,   7954,   9440,   6134,  -7267,     28,
- -3398,    500,   4965,  -1230,    306,    357,   2942,   -906,
- -4733,    903,  -3945,   4447,   1046,  -1125,    465,   1183,
--12710,  -1018, -11302,   5177,   -219,  -6232,   1552,   2061,
- -1372,  -1290,   -822,    295,    814,  -3003,   -527,   -614,
-  -856,    802,    167,   1178,   -494,  -1625,    754,  -1550,
-   682,  -1286,   -480,   -694,     86,    -67,  -1429,  -1235,
-  -559,   -311,    322,   -308,    -56,    296,   -158,    -24,
-  -748,   -197,  26954,   1054,    209,   -226,    165,    681,
-  -131,    341,    341,   1510,    615,    907,   -264,   1355,
-   388,    198,     -5,    418,   -783,  28539,     82,   -559,
-  -459,   -344,    279,   -114,    966,   -529,   -423,    286,
-  -418,   -766,     42,    186,    461,    418,   -688,   2937,
-  2793,    146,   1709,   -665,   2022,    293,  -1522,  -2740,
--15926,   -600,  -1503,  -1732,  -2827,  -1027,   1702,    252,
-  -643,    470,   -815,    858,  -1954,   1190,   1847,    -16,
-   266,     29,    486,  25985,    139,    220,    433,   -330,
-   168,   -362,   -562,    180,    906,    386,   -845,    664,
-  1064,   -616,  -1498,   -335,   -164,   -930,   -854,   -869,
-  -101,   -204,    835,    117, -16034,  -4478,   2634,   1629,
- -1873,  -1156,   -373,   -526,   2537,    967,  -2433,   -857,
-  1264,  -1670,    113,    845,   7654,  -1343,   5245,  -1605,
-  2236,  -1190,    -48,   3340,  -1981,  -1606,  -1369,   -227,
-  -727,   -570,   1136,   1868,    667,     92,   -144,    531,
-   949,  -1086,    530,   1764,    302,    190, -28036,    182,
-   825,    229,   -656,    585,    444,    200,  -1195,  -1855,
-  -387,   -781,   1156,    692,  -1164,   -517,   -464,   -275,
-  -328,    218,   -970,    174,   -384,   -561,    -38,   -720,
-  -140,   1021,   -271,    -57,    463, -25313,   -342,    -40,
-    26,    159,   -854,    916,  -1532,  -1033,    265,    105,
-  -719,   -588,     96,   -435,   -296,   -226,    224,    357,
-    30,    576,    -66, -30037,    -72,    374,     32,    256,
-   304,   -852,   -706,    248,   -741,   -379,    980,    629,
-  1344,   3858,  -2211,   -153,  -3914,  -3775,   1570,    718,
- -1042,  -1338,  -4409,   1338,   5118,   5186,   3619,   2142,
-  9081,  -2784,   4169,   3598,   6621,   4562,   -170,   -614,
-  1196,  -1174,   5024,    721,    -71,    267,      4,  25598,
-  -369,    356,    331,   1099,    377,   -356,   -938,   1161,
-  -863,   1107,   -132,    222,    148,   1410,    908,     60,
-   377,   1280,    468,    690,    454,    247,  -4552,   6122,
-  -267,   2973,  -5932,  -6424,  -4983,  -4193,  -3386,   1691,
-  1349,   1419,  -3730,    300,  12150,  -2927,   1588,    -34,
- -2435,   -271,   -961,  -1744,   1881,    -73,   -453,   -788,
-  -798,   9166,   2744,    858,    342,    991,   -287,    822,
-   -37,   1156,  -1493,    723, -14127,  -1755,   2029,   -933,
- -1276,    632,  -5249,    464,   -272,   1149,   -290,   4693,
-  -728,  -1475,    841,     10,   -283,     92,   -268,   -295,
-   358,    160,    405,      2,   -381,    679,    716,   -190,
-   128,    275,    255,    123,   -412,   -453,   -273,     26,
-  -174,   -340,    644,   -376,  27584,    -25,     66,   3107,
- -1707,    911,    500,  -1029,   1029,  -1557,   9020,   -398,
- -2512,   -582,   1131, -16696,   -429,  -1284,     -3,   2320,
-  -532,   -302,   -174,   -146,   -413,   2152,   1009,     42,
-   402,  -1471,    157,   5742,   -782,   -229,   2379,    646,
-  2842,  -1776,   -463,  -2749,  -3617,  -1710, -12281,   -566,
-   263,  -3174,  -2337,   9590,  -1150,   2465,   4577,   2064,
-  -648,  -2175,  -1877,   -674,   -634,   -338,    343,  -1492,
-   878,   -530,   1072,  13670,  -4542,    746,   9704,  -4188,
- -7076,   1179,   -740,   -589,   -876,    268,  -1080,   -986,
- -4584,   2692,   3032,  -2067,    230,  -3533,    944,  -4950,
- -1908,   1452,   -255,   -698,   1460,   -606,   -250,   -154,
--22303,   -945,   1626,   -588,   -482,  -1549,   -129,    978,
-  -631,   -722,   1094,   1771,   -311,    532,   -508,    696,
- -1128,   1270,    854,    -84,   4290,    414,   3351,   1061,
-   931,  -2936,  -9606,    -35,   2514,  -1095,    567,   -452,
- -8520,   4037,   -431,   2744,  -2276,   2647,  -1188,   -454,
-  -400,  -3698,   -315,  11558,   -667,    512,    162,   -395,
--13015,    -11,  -1944,   -890, -14358,  -3850,  -4296,   1310,
-  -580,   -248,   1305,    402,  -1049,    115,   2085,  -1797,
- -1172,   -321,   -919,   -313,   -512,   -131,   1619,    576,
-   499,  -2024,    130,     14,    -76,  -6324,    495,   2445,
--16757,  -2348,  -2706,  -1906,   2377,  -2252,   -619,  -2579,
-   643,   -661,  -1276,    935,    893,    992,  -2204,  -2451,
-  -395,   -508,   1163,   -216, -13034,   -718,  -1018,  -1675,
-  -698,    710,   -257,   2658,   1178,   2046,  -2270,  -2588,
--14442,  -1142,  -1026,   2247,   -536,    314,    123,  -1175,
-  -673,   1576,  -2600,      5,    964,    619,  -1714, -14811,
- -1502,  -1646,  -1151,    -93, -11652,   -222,    343,  -2203,
-  -351,   -928,   -289,   2679,   2101,    742,    747,  -2245,
-   146,  -1828,  -2728,   1058,   1048,   3046,    242,   4432,
-   246,    350, -13419,    768,   -805,   1819,  14332,   1316,
-  -370,    391,  -1421,  -1426,   -355,   -812,    -64,    196,
- -2917,   1097,  -1550,  -1246,    436,    -62,   -813,   1350,
-   555,  -2236,  -1589,    980,  -1483,  10122,  -2434,   7236,
--15225,   1513,   2090,  -1224,    -83,  -2821,    664,    658,
- -3242,  -1031,   1509,   2667,   -160,  -1315,   1060,    891,
-   432,  -1311,  -2503,   1304,   1295,   1745,   -722,  -2496,
- -4409,  -3360,  -2776,  -2793,  -4921,  12616,  -1031,   -443,
-  1495,  -2416,  -4640,   4508,  -2944,   2608,   1323,   -394,
-  -415,  -2111,  -2065,   1030,  -3636,  -1338,   2916,  -3007,
- -3680,  -3152,   -115,    577,   2742,    785,  -4429,  -1945,
-  -304,  -4883,   -133,  -3136,  -1927,   -576,    618,   1780,
-  2568,  -2102,   -158,  -3986,  -1187,    280,    655,    162,
- -1352,  -5730,  15372,  -1314,   1553,    274,  -2873,   4221,
-  4610,  -4143, -13699,   2760,  -1255,   -238,   1487,   1583,
-  1422,  -2272,   4734,  -6368,    795,   -406,   1498,   1588,
-  -500,  -2744,   -875,   2080,   1901,    960,    344,    979,
-  -258,    952,   2526, -11785,    893,    669,   1361,    518,
- -1368,   3854,   2539,    623,  -1835,  -4177,   2686,  -2956,
- -2804,   1121,  -8890,   1377,   1125,  -3990,    140,   3594,
-  1757,   2271,    366,   1723,   2150,  13557,  -1768,  -1433,
- -6632,   -578,   3266,   2509,   7142,    680,   1532,   1318,
- -1123,   5668,   1283,   -412,  -5404,   2893,  -2647,  -2695,
- -1412,    340,   -650,    863,   1895,   2867,    384,    626,
-   856,    508,   1365,   -295,    960, -26080,    234,     -4,
-   239,   -412,     -6,   -765,    736,    -30,    136,    912,
-   538,   -792,    413,    871,   -437,    305,     30,   -194,
-  1105,  -1113,   3550,  -4854,    449,   -549,  -7626,   3706,
- -3698,   1778,   1441,   2240,     73,    513,  -3383,  -2346,
- -1372,   3955,   2973,   1175,  -6087,   5071,  -2135,   8552,
-  4961,  -1201,  -1458,  -2627,   -730,    515,   -756,    476,
- -1104,   2115,  -1276,    498,    336,   -451,    809,  -1030,
-   556,   -211,    -70,    -93,     89,   -755,    296,    872,
-  -282,    380,   -298,   2774,    660,   1339,   -545,    429
-},
-
-.cb1108l1 = {
--13570,  -9232,   -673,    267,   -819,   1633,    -33,    623,
-  -850,  -4376,  -1135,    999,   -262,   1928,    695,  -1751,
- -2793,    772,   5064,  -1158,    280,  -2144,   1313,    888,
- -2482,    469,   2996,  -1406,  12525,  -1200,  -1202,    939,
-    -3,    847,    818,   -924,    135,  -1308, -12000,   -544,
-  -592,  -3914,    441,   3372,   3188,   1314,  -1836,   -706,
-  -844,  -1319,   1029,  -1754,    172,   2468,   -903,   -889,
--14602,  -2054,  11694,  -1980,   -730,  -1661,    214,   1243,
-  -337,   -646,    -95,   1432,   -854,   -236,     88,     -2,
-   514,  -1643,    -84,   3561,    302,    770,  -1248,    480,
-   664,    738,   1728,  -1783,  -2227,   -702,  -3582, -16641,
-  1713,   1506,    660,  -2471,   2061,    -48,  -3161,   1697,
-   900,  -1477,    558,    287,  -5515,   1023,  -1972,    999,
- -1856,  -3022,   -228,    711,   1270,   2644,   -648,   1064,
-  3899,  -1205,   -754,   1080,   1262,     18,    860,   2274,
-   655,    494,   -221, -15647,   1334,   -473,  -1648,   -341,
-  3541,   3109,  -1671,    639,  -2491,    185,    477,   -388,
-  5198,  -5680,    812,    700,   2180,   -536, -19468,  -2508,
-  2592,   2901,     32,  -1165,   1500,   -422,   -790,  -1914,
-   971,    111,   1226,  -1302,    541,  -3862,   -832,    642,
-   305,  -3870,   8921,    570,    180,   1734,  -1572,   -891,
- 17672,   -756,    702,   2740,   -647,   2122,    102,  -1371,
-   461,    454,    204,   -307,  -1248,  -2330,   1353,  -1783,
- -1939,   -601,    512,   2118,  -2178,    254,   1190,  -1252,
-   923,   1166,    360,    320,    320,   1210,   -142,   -416,
-  1260,   -205,   1403,  -1025,  19252,    328,     58,     21,
- -1044,   1786,   2153,    697,   -436,  -1617,   -869,   -493,
- -2419,  -3102,   1995,   1519,  -1799,   -153,   2689,   -665,
- -1371,   -915,  18486,    941,  -2612,  -1057,   1076,  -3351,
-   -48,  -1478,    575,    728,    130,   -168,     40,    898,
-  2141,   1518,   -965,  -1910,    896,    838,   1220,    416,
- -1494,   1404,   -126,  21472,    604,   1740,    102,   -812,
-  -796,   -734,   1082,   -507,   -468,  -1732,   1171,    252,
-   359,    436,   -765,    791,    726,   -810,   1838,  -1798,
-  5662,  -2362,   1275,  -2829,  -4041,   1398,   2681,    480,
- 13740,   -752,   2252,   1306,  -1026,   1834,     54,   9993,
-   559,   1370,    711,   1918,  -1757,    646,     16,  -3262,
-  2676,   1751,  -2595,   4782,  -1050,   2401, -15131,   1100,
-   386,    708,   -359,    455,    -25,   -950,    241,   -482,
-   268,   2327,  -2766,   -142,  -1992,   -566,    -36,    990,
- -6302,   3245,  -1394,  -1579,    760,   -757,  -2115,  -8542,
- -2945,   -800,  -4027,  -3102,  -1319,  -1989,  -1787,   -426,
-   590,   1031,    467,     31,   2674,   1686, -14352,   1174,
- -1446,   -813,  -1267,   2919,   2052,  -1574,   -753,   3369,
- -1090,   3830,   2042,  11376,   1140,    895,   1130,   -720,
- -1284,  -2277,     49,   -724,    397,  13201,   -985,   1599,
-  -365,   1517,   -496,    978,   2152,   1391,   1777,   3032,
-  -936,    280,   1719,  -4551,   4874,   -941,   -160,    956,
-  -676,   -229,   -548,    183, -16606,   -855,  -3433,   1248,
-  -578,   2254,   -532,   3081,  -1406,  -1859,   -605,   1809,
- -1001,   -114,  -1222,   3890,   -609,   3114,  -2430,  -2142,
-   440,   1780,   1606,  -4211,   1047,   -456,   8280,      9,
-  5866,  -1718,   -932, -13049,   -562,   3097,   -583,    -21,
- -1972,   1254,   -172,    527,   2282,   5064,  -5391,   1074,
-   357,   1845,     24,   -996,    100,    -50,   1098,   2905,
-  -417,   -937,   -439,    247,  18502,  -2380,  -2088,   -402,
-  -580,     83,   -282,    -70,    969,    540,   -219,  -1132,
- -1701,   -195,  -3030,  -2748,  -1974,  -1304,  -1909,   1080,
-  1042,   1124,   -128,   5816,   2303,   2840,  -2420,     35,
- 16550,    721,  -2079,  -1489,   1023,   -654,   2025,   1479,
-  -185,  -2449,    500,   3034,   2663,   3911,   1203,    998,
-   594,   -533,   -163,   -262,    739,     13,   -426,    182,
-   394,    350, -30055,   -371,    150,   -430,    147,  -1122,
-    43,   -390,    298,    831,   -194,    158,   -114,   -257,
- -1346,   -585,    206,   -456,    478,   -502,  -1710,  -1719,
-  -581,   -536,     45,   -861,    825,   1093,   -255,   -685,
-    38,    -20,    419,   -594,     10,  -1408,   -526, -19191,
-   196,  -1496,    255,   1844,  -8759,  -3565,  -1009,   -926,
-  -818,  -1195,    236,   2898,   -182,  14344,  -1384,   1064,
-  1181,  -1846,    543,   -583,    170,  -3305,  -1187,  -2406,
-   -40,  -1051,  -1071,    -28,   1482,  -1060,  -1057,   3028,
- -2023,    913,   1052,    980,  -5158,   4642, -14067,   3920,
-  1450,  -4497,  -1591,    842,  -2222,   -392,    -42,  -3546,
-  -258,  -3566,   2595,    225,  -2696,   4624,   2283,   1483,
- -1506,   2164,    151,    380,  -3207,  -1086, -10594,   2005,
-  2379,  -2567,   -925,   -363,  -1261,  13174,    -73,   1168,
-  2215,  -1721,    726,    525,   1048,    322,   -827,   2117,
-  3890,   1346,  -3512,   2243,    638,   2259,  -1371,  -2260,
- 10590,    851,  -1247,   -894,   1871,   -882,  -1955,   3822,
- -3654,  -1730,    906,   2074,   -548,    885,  -2501,  -1316,
- -3275, -10694,   2031,   1077,   3013,  -1105,   2951,   1907,
-  1218,    194,   1860,  -1662,    178,    915,   1092,    809,
-  -451,   -610,   -728,    799,   -129,   -101,   -905,     -2,
-  2470,   1292,   -137,    544, -18795,  -1081,   -300,    -59,
-   282,   -329,   -544,  -1324,   2155,   9326,    462,   -388,
-  -303,  -2940,   -608, -13652,    532,  -1350,  -1026,   1330,
-  5559,   -333,   4961,    707,  -1832,   1070,   2483,  -2016,
-  -315,   2197,    849,   -348,    379,  -2179, -15691,    903,
-  3192,   3888,    396,   4610,   3261,  -2589,  -4903,   -643,
-  3604,  -1380,   1524,  -2155,    469,  -3528,   -790,    429,
- -3862,   1797,   -104,   2364,  -1162,  -1559,   1011,   1849,
-  -235,  -1952,  -2088,   1436,   2502,  -3862,  -1704, -14859,
- -2863,    710,    624,   4373,  -6302,   -616,   -807,  -1577,
- -2492,   -620,   -917,    948,   4957,   -848,   -863,    514,
- -2210,   2162,   -753, -15168,  -2068,  12472,  -2611,   -723,
-  2797,  -8573,  -2270,    978,  -2597,   2215,   -684,   2535,
-  3114,   -261,   -178,   2385,  -4869,   1161,    -32,  -1469,
-  2074,  -1407,   3226,   -992,   4546,  -3158,   1044,    463,
- -5285,      4,  -1396,  -1395,   1770,  -1767,   -860,     -6,
- -2242,  -1548,   -667,    587,   -982,  -2246,  -1312,   1550,
-  -542,   5302,   -716,    135, -15895,   3382,   -478,   1279,
-   615,   3365,   1620, -12613,   -230,   3101,   3230,  -1307,
-  2860,    628,    647,  -3595,   -214,  -1631,   2783,    748,
-  1088,    -57,  -6014,   2496,    359,    719,   1476,   -750,
- -1644,  -2125,   3913,  -3788,    565,  -1118,  -1411,   1377,
- -1020,   -246,  18851,  -1438,  -1150,  -1492,   -681,   -798,
-  -776,    960,    911,  -1449,    336,  -1114,  -2111,   -877,
-  -532,    668,   1018,   1098,    408,   2032,   -607,   -656,
- -5997,   3089,   2462, -18368,  -1027,     78,  -4066,    439,
-  -845,   1476,    290,    490,   -452,   1638,  -3381,     80,
-  1699,    458,    260,   1215,   -516,   1883,    -62,     35,
- -2540,  -1703,  -1042,   1751,   -422,   1222,    207,   -104,
-  1112,    151,   -473,   -522,  26426,    562,    884,  -2201,
-  -281,    238,   -839,   1037,   -588,     81,   -109,     -2,
-   -32,     75,    654,    489,    524,   -388,  -1408,   -906,
- -1193,   -936,   -273,    -40,   -100,   -662,   -522,   -145,
-   119,    614,   -922, -25329,   -180,   -668,   -574,    161,
-  -448,    173,    750,   -609,   -812,   -125,    814,    572,
-  2602,  20372,    244,   1820,    724,    515,    932,  -1290,
-  -712,   -990,   -305,    -13,   -763,  -1157,    481,   -764,
-   320,    624,   -620,    642,  -1494,   -568,   -601,   -655,
-  -790,  -1348,    334,  -1302,    382,    782,  -1122,   -641,
--23549,    180,    463,   -634,   -666,    599,   -356,  -1071,
-   816,   -576,   1208,    912,   -377,    624,   1049,     42,
-   -95,    370,   1932,   -167,   -275,    142,   -159,   -410,
-   595,   -562,   -632,    748,   1192,    614,    -41,    -18,
-  -156,    -61,   1280,   -686,    363,    759,    756, -19362,
-  -614,   2151,  -1185,    169,    327,   1494,    782,  -1313,
-  -134,    841,    218,    -76,  -2980,    202,     80,    281,
-    89,    -61,  -1678,     59,   -125,    195,    320,  -1310,
-   -56,    806,     47,    -65,    249,  18432,   -666,   -506,
-  -204,   -194,   -560,   -416,  -3641,    330,   -268,    842,
- 10600,   -176,    424,  -1744,  -3609,  -1682,   -844,   -309,
-  -538,    435,  14251,  -1281,    373,   2748,   -702,  -1358,
-  -766,   3480,   -679,   4039,    529,  -5698,    -38,   -813,
-  1203,   4734,    318,  -1044,  -5109,   2187,  -3474,    415,
-  2436,  -3021,  -1628,   -456,  -1451,   3406,  -1798,   1001,
- -8648,    468,   1188,    497,   4628,   -948,  -4073, -11894,
- -2750,   -738,   1520,  -4070,   -810,  -5755,  -1370,   2978,
-  4460,    917,   1221,   -324,  -1166,   2339,  -1221,  -2048,
-   714,   6884,   3096,   6998,     13,   -275,  -3879,    790,
-   104,   1383,   2056,   1957,  -9216,   -430,   -199,    261,
-   764,   -109,   -210,    795,    884,   -334,   1546,   -272,
-   -35,    738,   -268,    -13,   -448,    645,     97,     76,
-  1284,   -343,   -654,    112,    643,  22846,    634,   -597,
-  -621,   -784,   -380,    951,   -452,   -685,    140,    688,
-  -770,    247,   -679,   -228, -26856,    311,   -546,   -444,
-   606,     69,   -195,     18,   -220,   -334,    -42,    543,
-   -28,    492,    766,    208,  -1206,   -554,    213,  -1112,
- -1675,   -608,    382,   2011,   5077, -17442,   1367,   -702,
-  -856,   -416,  -1728,  -1987,   2966,  -1952,     38,    152,
-   712,    210,   -589,   3029,  -1189,  -2016,  -8071,  10746,
- -2143,   -556,  -1964,    162,   -504,    995,    982,  -2565,
-  -634,   -985,  -1668,    444,  -2098,   -411,    488,   1397,
- -1134,   1888,   -920,   -279,  15057,   -757,  -1258,  -3040,
-  -890,   -105,   -670,   -490,   -238,  -2419,  -1302,    915,
-  -784,   -929,   1653,    -89,   1076,    445,   2538,  -1424,
- 19175,    -91,    437,    752,    254,    935,    854,  -1666,
-   -86,   -543,   1053,    664,   -155,   -485,  -3994,    -50,
-    50,    -58,  -2626,   1801,   -314, -16052,  -1831,   1009,
-  2344,  -3030,   -938,   1761,  -1283,   -150,   -425,  -6660,
-  -900,   1374,    803,    549,  -2683,    837,    483,   -655,
-  4610,   1259,    -45,    834,   1103,  -3250,  -3604,  -2882,
- -2463,  -5331,  11312,  -1653,  -3505,  -1855,  -4962,   8579,
-  2370,  -2474,    501,  -1282,    985,   -924,   3452,    456,
-  -242,   3878,  -2095,   2994,   7076,   -459,   2574,  16116,
-  8277,    -88,    572,    -38,      0,   1664,   -553,   1820,
- -2096,   1076,    415,   -420,   1900,  -1696,   -130,    298,
- -1555,    201,   -404,  -1831,   -932,    844,   9606,   -497,
--16304,   3278,    918,   -523,  -1573,   2488,   -813,    147,
-  1540,   3795,   1390,   1061,    -78,    -10,    574,   2620,
- -1143,   -512,   -582,  -1496,    736,  -4323,    786,  -2873,
- -1342,   3932,  14508,  12635,   -899,   1730,   -673,    386,
-  -676,   2787,  -2780,  -2960,    375,    475,  -2188,   2250,
-   851,    788,    268,   1264,   2973,    -94,   1062,   1006,
-  -697,    669,   -635,   -986,  -4848,  -1486,     -6,  -3914,
-  6267,  -1560,      8,   -503,   5273,  -3545,     69,  15146,
-  2263,  -1490,   -548,   1740,   1636,   -892,   -895,    769,
-  -471,    226,   6497,  -2466,  -2037,  -1068,   1075,   -902,
- 13668,  -1213,  12424,  -3523,   -124,  -1090,    972,  -1134,
-  -494,  -2568,    881,  -3081,    369,   -254,   -618,   -914,
-   443,  -1254,    658,   1322,    546,    -14,    778,   -116,
-  -378,   -802,   -268,     48,   1140,  25942,    503,   -637,
-  -871,   1050,    298,   -187,    387,   -406,    343,    212,
-   110,    723,    695,    -47,    -50,   -568,    -66,    347,
- -1588,     20,    701,   -485,    -98,   -787,   4502,   1046,
- -1628,  -2526,    185,   1016,   -256,   -700,   -403,   -154,
-   103,   -752,   -689,   2084,  -1463,   2294,    360,  17590,
-  -698,  -1262,    788,    116,    755,    751,   -440,   -610,
-  -469,   1235,  -2314,   1240,   -308,    553,   1065,  24442,
-  -733,    667,      4,   -484,     93,   -263,   -361,   -278,
- -1524,    176,   1311,   1561,    435,   -436,  -1079,    260,
-  -366,    472,  -1049,    647,    158,    302,   -931,    -36,
-  -990,    736,   -444,   1077,  -1560,   -251,    148,   1000,
-  1096,   -300,   -224,   -307, -17646,     39,    206,     74,
-   505,  -3051,  -1285,   -793,   -724,    718,    324,    803,
-   874,   6062,  -2235,  -3321,   -550,   9264,   3483,  -4172,
- -4024,   -471,    858,   2682,  -1078,  -1922,   2088,   1135,
-  -878,    545,   2205,    836,  -1088,    547,  12461,   2222,
-  -828,  -3841,   4797,  -2360,  -2510,  -4029,  -2213,  13736,
-  1032,   -958,   1895,    264,  -1499,  -2066,   -241,   1324,
-  -224,   -792,    776,   2130,   2600,  -2276,  -4239,   3260,
-  1610,  -1620,  -1220,  -2752,    979,  -2028,  19626,  -2146,
-   684,   -729,   -235,   -289,    588,   -600,    245,   -879,
-  -816,    413,    -87,  -1158,   -246,     69,    970,   -111,
-   500,   1097,   1087,   -138,  -1356,     30,   -434,   -452,
--22802,    177,    492,    206,   -257,   -854,   1445,     37,
-  1384,     97,   -258,    811,   -222,     53,    548,   1744,
-   124,  -1031,   1076,    186,    453,   -173,   1180,  -2235,
-   583,   -392,  -1542,   -726,   2937,  -3635,   -856,   1446,
-  7796,  -2779,   -962,  -2277,   1651,   1960,  -1460,  -1277,
- -9794,   -288,   2459,   2350,  -2521,     84,    578,   2286,
-   480,   1620,   6421,   -200,    170,   1513,    198,  -1001,
-  -491,  -1000,    161,   -482,    607,    214,    743,   -292,
-  -394,   -192,     92,     73,   -415,   -316,    593,    -42,
-  -346,    456,     44,    950,    129,   -189,    806,   -221
-},
-
-.cb1108s0 = {
--32768,   -828,   9569,    331,   6938,   3122,  -1008,   2847,
-   646,  -5690,   1712,   -795,  -4406,   1368,    307,   -526,
- -2206,     26,   -210,   1358,    746,   1920,    667,   3866,
-  -413,   -720,  -4328,  -2475,  -1189,   -863,  -3809,  -5052,
- -8567,   2859,   1915,   4895,  12440, -13002,   2757,  -5969,
-  4054,   1100,  -9430,   4930,  10266,  -1522,   7092,  -8778,
- -1968,   4325,   8440,   3888,  -1966,   -688,  -2455,   2966,
- -2380,   1682,   4956,  -2310,  -3706,    404,   6774,  17562,
--12437,  -2667,   4864,  -9411,  -6436,  -9316,   -903,  -5526,
-  3463,  -1690,  -5250, -12568,   2338,  -1310,  -3019,    776,
-  -641,   3483,     54, -10732,  -3878,   -691, -17615,   4530,
- 10267,   7830,   8488, -12624,  -4514, -17183,   7070,   3115,
-  4176,    383,  -4558,    410,   6379,   6242,   4702,   4853,
-  -217,    446,  -3811,  -2396,    244,  -2120,   3275,   5122,
-   180,   4523,   8680,  -1868,  -6164,   2636,  -5056,  -4039,
--11618,   4014,  11349,  -2616,   8240,  -5119,   1988,  -2552,
-  6060,   3206,   -662,   2686,   1116, -10447,  -3004,    650,
-  7811, -12148,   -327,    856,   -916,   -397,   -600,   4621,
-  3011,   5539,   5417,  -2374,   9667,  -4714,   7821,  -2819,
-   573,   4492,   1882, -26770,   1486,  -6963,   1103,   2515,
-  8196,   1849,  -7492,  -5243,   2106,  -5290, -11000,  -1410,
- -3448,  -8548,  -4536,  -7730,   3083,   6109, -14458,  -8624,
-  -381,   7840,   4694,  -3906,   8223,   3315,   5849,  13112,
--13132,   6081,  11801,  -7624,   -376,  -6372,  -6817,   6834,
-  1760,  -1435,   1072,   3505,  -1494,   -709,   5786,    454,
-  1807,   2650,   7728,   1357,  -1002,  -5366,  -2368,   2052,
-   333,   6312,   -336,   8274,  -1653,  -4309,  -6630,   2841,
-  2448,   8398,   5376,  -7248,  -1474,  -1842,  -4119,    838,
-   501,  -4206,   4052,  -1250, -20943,  -3338,   -592,  -2973,
-  7057,   -128,  -3235,  -4313,  -2510, -11313,  -4925,   3103,
-  1448,  -5186,  -1322, -16815,   1956,  -7950,   2641,  -2890,
-  4396,   2322,  -1381,  -1911,    448,   2543,   3535,    782,
-  3719,   -624,   1610,  -2843,   7583,   1794,    700,   3107,
-  4528,   5461,   2540,  -1074,   5976,    741,    576,   4426,
-  4400,  -4920,   5724,  -3734,  -1186,  10645,   1100,  10537,
-  2828,  11670,  -8391, -32572,  -9405,  -6807,   -875,   2277,
-   736,  -4546, -18693,   1204,  -1083,   3422,  -3328,   6013,
- -2992,   5812,   2744, -11668,  -2519,  -2384,  -3635,   6532,
-  6874,  -2820,  -5222, -12261, -14266,  -6663,  -1150,  -2032,
-  2099,   4642,   1638,  -4162,   -644,    249,  -3133,  11830,
--10712,  12370,   4818,  -1924,  -5639,  -6448,   2455,  -4898,
-  -613,   1760,   2393,   1414,   7039,  -7018,   5901,  -2900,
-  3786,  -3230,  -3718,   3514,  -4040,  -4676,   6367,  -1449,
- -2758,  -2888,   4066,  -7140,    408,  -7656,   3156,  19919,
- -1858,   6671,    352,  -3355,   3074,   5524,  -1429,   1954,
- -6664, -10082,   4405,  -1598,   -806,   1779,  -6913,   7062,
-  5064,   6518,  -1042,   3400,  -5530,  -1192,    590,  -3298,
-  -772,    571,  -6239,   9810, -12380,   1302,   1344,  -3430,
-  3830,   4106,   5792,  -6196,    224,  -2604,   3954, -12551,
- -5539,  -8306,   1801,  -4521,   3578,  -4349,  -5716,   4960,
-  3620,   1516,   5779,   5550,  -3710,   3329,  10542,   4198,
-  5148,  -3291,    196,   6232,   6943,  -1303, -10306,   1862,
-  6547,  -1544,  -2996,   2868,  -4389,  -6894,  28557, -13130,
-  1397,  -2331,  -4076,   2870,   3592,   6613,    265,  -4790,
- -3514,  -3152,   8710,    230,   3142,  -1264,   1822,   -769,
-  6168,  -1792,   2189,   2660,  -2664,   3402,   -533,  -3100,
-  -476,  -1164,   6092,  -2930,   3372,  -5895,   8507,   -918,
- -4716,  -1582,  23959,   1506,   2360,   -117,   2029,   -452,
- -6575,    964, -13132,  -2838,   3800,  -3355,   3168,   5230,
- 11116,    826,  -1711,  -3546,   7398,  -4092,  -2884,    743,
- -1784,  -3824,  -3437,   1050,  -3306,    928,  -5109,  -7999,
-  1581,   8609,  -4662,  -3594,  -1618,   9929,  -3982,  -5591,
- -8789,  -1444, -12011,   1304,  12668,  -5138,  10837,  -7951,
- -4089,   3921,  -5375,  -2486,  -2590,  11398,    -80,   7734,
- -4547, -11286,  -7098,  -7758,   5303,   7380, -11266, -11138,
- -8676,     30,   6328,    597,   7852,   3144,  -3933,  15142,
-  3954,  12197,   -507,  -1667,   5517,  -4187,    709,  -1330,
-  2094,   4739,   1341,   8276,   8544, -10107, -10151,   3641,
-   771,   4798,   4839,  -3254,  -9246,  -7304,  14850, -18155,
-  3068,   4993,  -4930,  10985,   6270,   8528,   5904, -13010,
- -7824,   1300,   -706,   -156,  -4228,    302,   9962,  -3087,
-  4472,   4541,  13179,  -6576,  -2541,   8284,    -51,   5366,
- -4369,    289,   3890,  -3671,   1894,  21820,  -3031,   5336,
- -8412,   2487,  -1211,  -6759,   1292,   3749,  -8904,    638,
-  6863,    154,   1145,   -684,   6648,  -3874,   2005,   4670,
-  4408,   4191,   3984,    632,   2957,  -1532,  -3974,  -2576,
- -1636,  -3714,   -136,  -4946,   3900,    367,  27072,   1864,
-  1426,  -3321,    860,  -1768,  -2009,  -3436,   2666,  -9899,
- -1328,  -2330,  -3078,  -3258,  -4600,   5604,  -5248,   1703,
-  4403,  -4781,  -8275,   6717,  -3860,  10980, -10634,  -8360,
- -2291,  20311,   7602,  -4028,    483,  -4886,   2677,  -4921,
-  6065,   5393,  -2145,   6201,   -472,   1796,   2869,  -3578,
-  3053,  -2342,  -3193,  -2589,  -3215,   1322,    536,   -164,
-  -314,   4800,  -1903,  -1338, -11833, -23399,   5562,   4440,
- -1864,   2520,  -4251,  -1464,   5053,  -8553,  -3852,  -5932,
-  -849,  -7113,  -3493,  -5338,  -1671,   1496,   4504,  -1830,
-  5716,   -210,   1397,  -2060,   2242,   -583,   2604,   5355,
- 13938,  13150,   1346,   2649,  -1527,  -4568,   8891,   7399,
- -6492, -10371,  -4885,  13056,  -8262,  -1267,  -2959,   -868,
-  5941,    299,   -601,   8834,   1436,   5404,   1914,  -3775,
-   980,   8848,  -2270,  -1952,   6902,   8642, -25725,   9556,
- 14540,   1998, -13157,    308, -13844, -10126,  -2147,   8296,
-  1772,   1094,  -9712,  -8560,  -7552,   5527,  -1446,  -1097,
- -5798, -17270,   2860,   -210,   2136,    175,    729,  11775,
- -5154,  -4202,  13342,   3977,  14494,  -5659,   9105, -11067,
- -3694,   4794,   -593,   6817,   1875,  -4975,   3663,   4141,
- -8317,  -8932,   2127,  -4176,   1136,   -148,   7640,   8127,
-  -744,   2354,    389,   1600,  -6475,  -4558,  10735,  11407,
-  3896,  13098,   1814,   5191,  -3850,   2629,  18430,   8343,
-  4630,  -4624,   -702,  -3834,  -2276,  -2894,  -1556,   1437,
-   424,   5652,  -6260,   2387,  -5845,   7496,  10657,  -2754,
-  4806,   1169,   1308,  -4114,  -5347,  15076,   5686,   7287,
-  3004,  -6254,   5186, -14096,  10323,  -1974,  -9355,  -5544,
-  -986,  -5998,    261,   4494,   2467,  -1911,   -603,  -4548,
- -1344,   1995,  -1603,  10464,   5222,   3714,  -5342,  -8039,
- 12530, -26465,  -1813,   4044,    746,   8123, -12078,  -4703,
-  2971,  -4487,   2556,   3904,  -2518,   1504,   5774,   5431,
-  1120,   -934,  -5202,  -6826,  -8774,   7156,  -2392,  10643,
- -2918,  -4298,   3361,  -3758,   -894,   5828,   -203,  -4905,
-  6480,  11771, -19830, -17545,  -4920, -17263,  10066,  10125,
- -8980, -19719,  23554,  27907,   2607,  -7014,   6128, -23759,
- -4802,  -7099,    874,  13103,  21667,  -8475, -12938, -13122,
- -3694, -18860,  -3518,  -3586,  12658,   -793,  10661,   6925,
-  -730, -11373,  -7845,     94,  -2627,  -6044,  -2213,  -4381,
--10198,  -5816,    -56,  -4349,   3722,   3911,  -1719,  -2513,
--13290,   3218,    105,   1876,    -76,  -1107,   2563,   4520,
- 10288,   5862,  -7738,   6180,   9863,   1380,   6756,   2632,
--18798,   9314,   7190,  -7454,    432, -15141,   8462,   2128,
- -2386,  -2710,    292,   -751,  -3125,   6147,   4941,   3146,
-  3046,    120,    321,  -5884,   5105,  -4300,   6264,   -317,
-  1667,   -694,   7950,   5639,  -3284,   1089,  -6456, -14694,
- -3527,  -1104,   4313, -20858,   7920, -10782, -13536,    933,
-  4523,   2640,   2118,     97,   -614,   9834,  -9515,    232,
-  5086,  -6720,  -1529,    568,   3139,  -3665,  -8567, -13771,
-  6274,  -4370,  -5653,  -8920,  -7667,  -9391,  -6653,  12489,
- -3666,  -5103, -12324,   4796,   -540,  10396,   3668,  -3467,
-  7124,  -4398,     87, -12139,   -204,   1213,  -2190,  11948,
- -2641,  -2434,  -5647,   2819,   3148,   3558,  -6455,   3705,
-  1644,  -3090,  -4225,  -5998,    112,  17789,  -7220,   2166,
-  4153,   4516,  -1100,  -1667,  -1402,  -8837,   6344,  -1586,
- -3451,   2357,    616,   -392,  -8163, -11579,   6160,  -2783,
-  7895,  11321, -11847,   8070,   5231,  -6496,  -3172,  -3470,
- -2960, -11437,    465,   -470,  -2568,  11197,  -9417,  -4117,
- -1162,  -1893,  -2361,    551,  14478,   3510,  -1372,   3117,
- -8236,  -2904,  14556,   3191,    200,   2166, -13974,   2718,
-  3946,   2444,   1982,   5320,   2087,  -2222,   1573,    742,
- -8828,  -3917, -11080,   -241,  -8472,   6119,    290,  -2364,
- -3163,   1923,  -1964,   -582,   2564,  -5566,  -6411,   2069,
-  7392,   9115,  25316,   1504,   2540,   -814,  -1746,    566,
- -1580,  -2290,    170,    698,    105,   9567,  -6714,   -584,
- -4934,   -379,   -491,   -978,   4580,   1180,  -3355,   1882,
- -4343,   4817,   1503,   9968,  -8878,  -4908,   3419,  -4818,
- -2254,   6694,  -4368, -10849,  -5093,   4510,  -3129,    152,
-  1926,  -4490,   1510, -17764,  -6699,    962,   3474,   4981,
-    25,  -7128,   1432,   5386,   3108,  -4545,   1092,   1663,
- -1363,   3076,  -8916,   6158,    244,  -1181,   -825,   -933,
- -5570,  17221,   -535,  -2892,  -5031,  -1297,  -3010,   5840,
-   678,    748,   3944,   1630,  -3648,  -5457,  -2618,    876,
-  6655,  -2834,   2597,  -6667,   1330,    -40,  -4423,   6257,
-   743,   6083,   -584,  -3742,  -1401,   1779,  -5166,   4559,
-  5558,   8588,  -6476,   7521,  -1561,   4950,   -778,   3564,
- 11403,  -1010,  -3151, -14151,  -1020,   2595,  -3278,  24555,
- -4859,   -909,   2314,   1301,   2098,  -5664,   3938,  -4050,
-  -203,   3368,  -2580,   3061,  -9266,  -6263,  -6748,   3890,
-  1950,   -329,   1050,  -1106,    588,  23705,   -661,   6913,
-   722,  -5820,   2147,   3789,  -1689,    661,   5389,  -8519,
-  1152,   3800,   7160,   5234,   1343,   3218,  -2900,   -391,
- -4258,   5084,  -4783,   7262, -10013,   -811,  -5252,   6474,
--17338,  -2388,  -2596,  -8715,   5836,   9523,    639,   4652,
-  3071,   3114,  -1648,   1563,   -931, -10143,   4394,  -2838,
--11900,  -1012,    841,  -5812,  -3048,  -2715,   -196,  -5794,
--20022,   1949,   3464,   -770,   2200,  -3564,   1975,  -6242,
- -1937,   3954,   5678,  -2744,   1888,  -3825,   5770,   3869,
-  8315,  -7386,   1318,   1302,  -5534,  -4554,    924,  -3804,
- -4292, -22757,  -7972,  -7469,  -3543,   7858, -10125,  -2637,
- -4765, -10644,  -5944,   1159,  -3293,   4363,  -1219, -12248,
-  5060,  -7232,   6947,  -1609,  -3037,  -5084,   6580,  15873,
-  5336,   7295,   2386,   2961,   4655,   9714,   5080,  11635,
-  1790,   2897,    687,   -914,   -692,  -6653,  -8562,  -1412,
-   244,   4478,   1650,   7175,   1046,  -6689,   3693,  -3520,
-  6046,  -1336,   1976,  16822,  -1176,    792,  -1733,   8286,
- -7359,  -2402,  -8536,   1392,  -3271,   6580,  -4939,   1562,
-   595,  -4237,   4872,   4266,  -1798,  -6589,   7457,   4207,
-  9978,  -3996,  -2236,  -3078,   1861,  10101,  -2394,  -3250,
- -7619,  -7082, -14305,   5664,  -1337, -11019,  -3839,  10190,
-  7249,   3086,  -1782,     24,  -3566,  10769,  -4102,  -6408,
-  -688,  -8987,   3018,  -5942,   7478,   -368,  -7931,  -3018,
-  6766,    -78,   5705,  -3264,  -1100,   4850,   4518,    -28,
- -6276,   4905,   7094,  -4394,  -2846,    -88,    434,   2039,
-   352,   9827,  12372,   1207,  -8561,  -4476,   1496,  -4927,
-  2087,  -6730,   1134,    -81,     57,  -8701,  -2918,   3953,
- -2844,  -1842,   4804,  -5315,   -401,   7060, -16397,  -4802,
- -9849,  17542, -11715, -12432,  -6676,   9323, -13189,  -5761,
-  8054,   -620,  -7431,   3726,  17790,   7880,    251,   2983,
-  3736,   7118,  17197,   8613,   1445, -15290, -16184,  11084,
- -4971,  -5922,  -1893,   9067,   9321,  -8139,    714,    182,
- -3138,   7258,  -1874,  -2781,  10800,   2915,   5316,  -5206,
- -2581,  10219,   -484,    862,    119,   6628,   1514,   3883,
-  -880,   7586,  -2573,   3279,   3801,   4492,  -3850,   9416,
-   -38,   7518,   -574,   4052,  -1136,   -668,   9672,  -9536,
-  2551,  -4223,  -1074,  -3616,   8446,    158,   3262,   7965,
-  1311,  -8634,  -6786,    700,   4973,    917,   -754,  -1156,
-  6054,   2067,  10757,    421,   1030,  11351,   2149,  -4286,
- 12075,   4593,   1193,  -5290,  -8566,  -2965,   6824,  -6238,
-  2392,  -3395,   5350,  -2789,   7529,  -1873,   3032,  -1494,
- -2703, -18535,   1583,   9539,   2556,  -4422,  -6079,  -2699,
- -7860,  -4573,  -8236,   4281,  -1079, -17578,  -2840,   7468,
-  4675,  -5002,  -1268,  -1529,  -8222,   8285,   -766,  -4314,
-  6048,  11507,   5046,  -2444,   3186,   1732,   7872,   6598,
-  2828,  -2920,   8278,  13263, -10204,   1334,  -5552,  10532,
-  5412,   2554, -10076,   1128,  -3959,  -3210,   4091,   1824,
-  4984,   5558,  -2204,   2080,  -3802,   6614,  -7380,   3612,
- -4624,   6366,  -1795,   4038,   6227,  -4312,  -4910,  -2127,
- 15077,   4144, -16885,   3757,   2303,   -670,   5625,  -2590,
- -2594,   2491,  -3174,   4199,   1152,  -1532,  -7308,  -8578,
-  6431,   2975,   6032,   3037,  -7451,  -2643,   5503,  -7856,
- -2451,   5309,  -3678,   8145,   1864,  -8341, -15575,   7716,
--10337,   8935,  12350, -10418,  -4092,    734,  10400,  10934,
-  5724,   1778,   5836,  -3203, -10700,   2766,   4178, -18135,
--16589,  -5465,  -5005,   7239,  25480,   7310,  -6408,   6142,
- -7748,  -1423,  -4318,   -321,  -2899,   3728,  -3184,  -3578,
--11598,  -1223,  -8554,    656,  -3945,  -4084,   -724,    301,
-  9539,   9695,  -1799,  -2602,  -1379,  -5282,  -4709,  11858,
-  9562,  -7508,   4886,    896,   5780,   -160, -12724,  -9598,
-  1220,  -5411,  -5072,  -6476, -11763,   -104,   9311,   5230,
-   591,   4342,    263,  13198, -17801,  -1892,   2619,  18194,
- -2080,  16536,  18497, -25926,  25541,     66,  -6648,   1627,
-  2794,  -3790,   9424,   1387,  20702,   5260,   5211,   1702,
-  1019, -11143,  -6501, -18711,  10869,  -4204,   4994,   1722,
-  8569,   3670,   4386, -16874,   8876,  -2297,  -2743,  -4562,
- -9207,   8033,   -346,  -3586,  -9451,   3242,   1552,   4278,
- -6787,   7118,   3630,   4602,  -7371, -12789, -10424, -14922,
- -3010,   1885,   4144,  -4490,   4074,   7796,  -1201,  -7244,
-  2675,   1221,  -7060, -12828,  -3520,   1983,  -4615,   8207,
-  1606,    517,   3646,  -7252,    816,  -3690,   -674,  13100,
--16254,   4727,  -8184,   -968,  -5366,  -2288, -20260,   1174,
--19384,  -4199,  -5292,    582, -13118,   1836,   1698,  -2034,
--14601,   6642, -10530,    482,   -851,   9968,   7050, -13366,
- -8354,   4740, -20050,   -193,  -1881,  -1205,  -4042,   7067,
- 12872,   5846,  -4792,  -1833,   2504,  -3222,  -1607,   2634,
-  4587,   6761,   1549,   1124,   9427,   3978,  -8305,   7524,
-  2507,  -5744,   3238,   5238,  -3664,    694, -28496,  -1674
-},
-
-.cb1108s1 = {
--10979,   8698,   -630,   4660,   3060,  -7292,  10140,  11942,
-  1448,  -5820,  -3144,   3100,  10575,   6888,   3505,   9996,
-  2787,   -484,   8057,   1503,   6329,   3074,   3954,   9419,
-  -736,   2333,  -1858,   3264,  -4026,  16130, -14501,  -5284,
-  -472,    850,  -7258,   1542,   1473,  -2348,  -7055,  -9574,
- -2275,  -4383,   7542,   -360,  -2945,  -3878,     28,    809,
-   600,   2246,    587,  -1779,  -3456,   -737,   3242,  -2523,
- -1862,   6127,    899,   1070, -15614,  10990,  -3084,   9546,
-  7339,   8899,  -1490, -10379,  -9193,  -3857,   8289,   7261,
- 12489,   7814,  -6458,   1223,  15486, -10960,  -1880,   4922,
- -7819,   -527,  -2370,   3687,   1358,  10367, -14266,  -1496,
-  1060,  -9325,  -5582,  -3947, -17536,   1470,   4878,  10793,
-  2904,  -2566,  -4995,   6549,   6141,  11048,   3177,   -494,
-  9087,    797,  -2575,  -5616,   1197,   2966, -11287,   4658,
-  -504,   4571,   1814,  18830,  26254,   2399,   8750,   2656,
-  8206, -12987,  -9119,  -1027,   -457,   1228,   6137,   2322,
-  1732,  -5694,   -892,   -249,   -178,  -7009,  -4368,    402,
- -5564,  -5183,   2470,  -4745,   2788,  -3255,  -5181,   -706,
-    40,  -4915,   8926,  -3633,  -2455,  15054,   5376,   -867,
- -7270,   -979,   7053,  -7433,  13749,   5039,  -2234,   8474,
-  7031,  -3917,   5127,  -7602,    580,  12067,   2252,    149,
-    86,   -582,  -5729,   2193,   4178,  -9195, -11824,   3897,
-  1298,  -1044,   6450,   1885, -19562,   6205,  -4610,  -2544,
-  5192,  -4885,   5021,  -2373,   -102,   7358,  -2434,  -3512,
- -4048,   3070,     45,  -1344,    202,  -2189,    448,   1172,
-  2939,   -547,   1003,  -6370,   3643,  -1157,   3932,  -6044,
--12882,   1959,  -1574,   2574,  14854, -16317,  -6627,    505,
-  1102,  -9361,  -8087,   7525,  -1466,    284,   3756,   -383,
-  5147,   5060,   -474,    531,  -6144,  -1872,  -1206,    527,
- -4861, -12410,   7508,  -7226,   5046, -12233,  -4153,   4628,
--14402,  -5265,    534,   1528, -13408,    -62, -18757,  -1280,
- -9301, -10254,  -8990,  -6335,  -7724,  -3394,   1951, -13271,
- -1389,  -5274,  -4616,  -9643, -10295,   1332,  -5618, -10737,
- -7536,  -9314,  -7006,   -760,   7694,   2955,   -404,  -2800,
- 15250,  -3828,   5994,   5408,   8411,  16568,  -7280,  -6901,
-  -222,  -1554,   -862,  -1871,    939,  -3678,  -4348,  -3200,
-  3220,   1614,   8598,   8162,   1749,  -7378,  -1658,    931,
-  3870,   9183,   1509,  -5068,    -17,   5733,  -8121,   2769,
- -3195,  -3296,   8940,   2828,  -2470,  -2448,   7413,  -2851,
- -1058,  -4505,  -9653,  -5074,     73,  -3286,  -4014,  -1760,
-  2562,  13690,  -3464,   5438,  -3394,  16997,  -2944,    291,
-  4224,   1175,  -2237,  -6894,  -5479,  -1291,   3390,   5455,
-   898,   3461,  -7914,  -4785,   1879,   1059,  -3721,  -5796,
-  5054,  -3931,   6315,  -2460,   1909,    573,  -3373,   3052,
-  -178,    986,    572,  -5976,   5781,  -4928, -10539,    580,
--18727,    757,   1759,  -4049,   2232,   1890,   4115,    699,
- -2934,   4926,   2391,  10848,   5103,   4340,  -1518,   2288,
-  2283,   8886,  -5131,  -4429,  -4384,  -3265,  11933,   3993,
- 11474,   3721,   1532,    976,   6112,   1954,  -2360,  -1783,
-  2080,  -6356,   2482,  -4646,  -1992,   1590,   1790,   3290,
- -2312,   -564,    508,  -1688,  -7522,  -9263,   3059,   1883,
- -3005,  -1303,  -9146,  10282,   1333,   4692,  -2083, -15792,
-  2208,   1128, -11574,  -7149,  -1126,  -4995,  18963,  -6262,
-  5045,   2179,   -822,  -1249,  10092,   -338,   5744,   1635,
-  2535,   6114,  -1339,  -8337,  -4370,   4288,   2468,   3051,
- 12491,  -9554,  -4034,    522,  -1085,   5852,  -2759,   4918,
--10717,   -194, -11376,   3059,  12075,   1037,   5260,    816,
-  5918,  -1987,   7924,  -6022, -10374,  11607,  25035, -11598,
- 16894,   2458,  -5461,  -2039,    385,   6002,   7574,   1229,
-  -834,  -1032,  -7453,   2694,  -1447,   3632,   4215,   3541,
-  2936,  -3294,   1001,  -6451,  -4595, -11682,   7880,   2261,
-  3786,  -2849,   2276,   -826,   3742,   7586,   -334,   2837,
- -2331, -12849,   1170,  -1150,  -5253,   -997,  -8996,   8124,
-  2234,    904,  -2294,   3144,   7352,  -5452,   1536,  -8800,
-  1886, -18282,  -9787,  -8066, -12066,   1536,   4460,  -1345,
-  1418,   7471,  13451,  -7299,   5507,   6795,   -184,   8905,
- -2040,  -4933,   4998,   7317,  -6667,  -5134,   9094,  -8561,
- -2534,   3422,   2278,   3118,    205,   5811,   2247,   5946,
-  1078,  -2105,  -6946,    170,  -1625,  -4734,  -1447,  -4329,
- -4553,  -2230,  -8738, -15289,   7311,   6665,   5047,   1984,
- 11896,  13922, -10490,  -9313,   1424,  -2991,   1408,    335,
-  8914,   3773,   8814,   7917,  -4560,   -114,   -624,   8984,
- -1598,   -580,   3233,    590,  -2172,  -3162,  -3985,   5394,
- 13842, -11625,     73,  12826,  -1204,   5119,  10304, -10006,
- -2695,   1318,    156,     84,   -760,  -4638,  -3804,   3041,
-  -782,  -2994,  -3113,    637,  -3256,  -5831,    452,  -1204,
-  1614, -11626,  -4769,  10612,  -8710, -20019,  10542,  -4279,
-  6912,  -1429,   3812,   2844,   3903, -11622,  -8954,    180,
-  3898,   3858,    119,   1385,   4038,  -5899,   -969,  -5454,
- 13305,  -6748,   5934,   8027,  -7348,  -3797, -29781,  -4956,
-  2037,  -2331,  -3292,   8254,   6597,   4446,  -7848,   6250,
-  1400,  -1182,  -4966,  -3490,  -1410,  -2286,   3334,    350,
-  9271,   2987,   -934,  -5702,  -3881,    -97,   -671,   5108,
-  -133,   1302,  11630,  -8858,  -3027,    -42,   3682,  -1507,
-  3992,   5641,   2778,  -8698,  -2509,  -1360,     77,   2116,
-    98,   2853,  -6334,   5915,  -1214,  -2721,   8921,   1380,
- -4158,  -4315,  -4740, -21049,   7044,    866,   2094,  -9442,
-  9003,  -5147,  -4897,   3407, -11558,   4280,   4508,   6697,
-  1612,   1508,   8547, -14257,   -151,  -9530,  -7250,  11321,
--14430,  -4944,  -2488,   1349,   -248,  -1490,   1749,   3970,
- -5830,  20767,   4642,   3236,     36, -17079, -11099,   5996,
--10759,    -39,   7822,  -7527,  -1431,    179,  -3841,   2298,
-  1407,   -241,  -2303,   9244,  -3626,   6609,   1959,   -518,
-   368,   1678,  -5334,  -5849,  -4986,  -2363,    607,   2809,
- -1006,  -7695,  10022,   2216,  -8992,   4282,    807,  14707,
-  9528, -11065,   3014,   3157,   5597,   1139,  -1298,  -3642,
-  7839,    860,  -4336,   2624,  -4171,   1791,  -2825,   5362,
-  -529,   1494,    337,  -4487,   -671,   5360,   3283,   4933,
--14692,   4033,  -4365,   2713,  -6903,  -1784, -10862,   6173,
-  5278,  14859,   -852,  10020,  12304,   8898,  -3089,   9183,
-  1841,   8276,   4929,   -261,  -1264,    615,   3615,  14535,
-  6557,    519,   4228,   7382,  -1805,  -4529,   4992,   4277,
-  -342,  -9610,  -5193,  -7022, -23264,   2402,   -740,   2875,
- -5052,   1983,   4987,   3336,  -3806,   1335,  -2868,    846,
-  7652,    936,   3510,  -4570,  -3010,  -8805,   6177,  -4413,
-  5879, -15204,  -1632,  13416,  -4543,   3838,  -9293,   1744,
-   920,  15544,   3820,  -5852,   3935,   2357,  -6486,   1932,
- 12044,  -6374,  -2545,  -2389,   2755,  -8073,  -8203,   4659,
-  4286,  16128,   -987,    434,  -4495,  -4428,  -4816, -10329,
- -4529, -13408, -13283,  -1136,   4002,  -1271,   3547,  -5274,
- -5577,    701,   -365,  -2764,    370,   -369,   2611,   -832,
-  3862,   4604,  -7786,  11170,  -1453,  -1568,  10758,    168,
-   402,  -1985,   1436,  -8858,  10080,  -8559,   3998,  -4310,
--13478,  -3104, -11458,    506, -18194,  -3724,  -6768,   7960,
- -4213,   1121,  -1658,  -1141,  -1874,   -383,  -5090,    748,
- -1032,  -1207,   1046,  -1865,  -2387,   2126,  -3672,   6733,
- -2794,   3797,  15562, -11989,    170,   6129,    658,    929,
-  4800,  -4296,   -955,  -2189,   -188,   3180,   -118,   -766,
- -2182,  -6928,  -2254,   6615,  -4422,   6324,    -31,   3742,
- -5832,  -5022,   4671,   1574,  -6309,    288,  -2768,  -2492,
- -4818,  -5192,   -248,  -3236,   -429,    120,   1182, -10486,
- -2964,  -3713,  -5978,  11817, -20052,  -6525,   2054,   -879,
-  -602,  -2843,   7244,  -1372,    417,   -172,   3322,  -6556,
- -7021,   5842,   7357,  -2799,   3660,   7579,   4682,  -2242,
-    73,  -9247,  21061,  -2060,  -3614,   2486,   4793,  -2959,
-  -510,    -74,  -5982,   2274,  -4147,   3260,   1994,  -1678,
- -7494, -13624,   2560,  -7375,   -896,  -4945,  -2838, -11096,
- -1969,   5879,    444,  -3220,  14630,   4915,  -2376,  -8475,
-  9854,  11380,  11060,   1534, -14413,   4366,  -9544, -10646,
- -7654, -17916,   3481,  -3240,   1776,  -2436,  -8403,   3679,
- -1914,  12537,  -5540,  -5294,   5995,   5968,  -2609, -16882,
-   789,  -9506, -10075, -12142,  -7580,  -7090,  -2046,  11065,
-  7617,  -3503,  -2013,   3516,   6347,   -195,  -3119,   2444,
-    14,  -4998,    767,   4976,  -3974,   9038,    579,   1804,
- -8206,  32767,  -5633,   1018,  13388,    996, -12737,  -3179,
- -2058,  13663,   1274,  -4475,   7386,  -1698,  17927,  -6118,
- 15942,  -2922,  -3434,   5903,   6333,  -9149,  14140,  -1488,
-  2999,   1151,   2361,  -1935, -10243, -11566,  -5319,    965,
-  5146,   3652,   -441,  -2173,  -3484,   3685, -13595,  -1703,
-   -78,  -1408,  18517,  -3788,  -3266,   3162,    996,  19950,
- -8560,   4989,   6593,  -5329,   2950, -13896,  -3524,   5590,
-  4055,   6084,   2493,  12659,  -5786,   4858,   7252,  -7111,
- -7318,   5411,   7393,  -8714,  -3454,  -1562,   1919,    -49,
-  -680,   7285,   -398,  -2956,   7100,   5563,   -538,   1719,
-   -16,  -3824,    437,  -6842,   1504,   5694,   1214,   3209,
--15562,  -4365,   9329, -25577,   1425,  -2598,  -8389,  -6891,
- -3275,   3304,  -3993,  -6391,   -934,   7862,   4844,   -134,
-  9890,  -4646,   2468,  -9901,  -4111,  -3080,  -5056,    476,
--13099,   1447,    205,  -2424,   7098, -12075,  -4646, -13725,
-  8367,  -2910,  -8461,   1387,   3553, -10228,  -2771,   4698,
- -6483,  12234,  -8086,   3329,   2374,    452,  -1805,   5083,
-  2014,    164,   7143,     81,   6062,   2838,   5318,  -4982,
-  1440,   2014,  -3273,  -6658,   -798,  -3204,   1398,   -599,
- -5834,   2070,   4644, -17238,    390,  -1684,  -4932,   8961,
--12217,  -3079,   6574,   1387,  -5991,  -7803,   1285,   7439,
-  -395,  -3048,   2038,   -847,   -690,  -5127,   2228,  -4180,
- -3499,    530,   -584,   9884,   -323,    446, -15644,  -9162,
- -1683,   3643,  -3578,   2634,    496,   8097,    109,   1056,
-  1422,   5452,   6517,   -449,  -2389,    302,   6827,   1507,
- -3106,  -7188,  -4909,   -441,  12955,  -3933,  -5322,   5155,
--23171,  -2780,  -2655,  -4048,  12844,  -3709,   6555,  -5700,
-  3780,  -6566,  -4415,  11091,  11291,   6443,   9146,   -796,
- -1420,   5600,  12098,  -5790,   6619, -10474, -12177,  -5890,
- 21700,  11148,   3427,   3130,  -5727,  14646,  13953,  -2721,
-  1404,  -3102,  -4693,   4762,   1757,   2533,   3998,   -530,
-  -758,   5301,  -1426,   8948,   -720,   6877,  -3863,   2396,
-  5266,   -685,    890,  -7188,   2742,   -270,   8125,   -804,
- 32292,   6964,   8599,  -3466,  -1080,  -8423,   2070,   -295,
-  -157,  -5432,    152,   2478,  -3738,   1104,   1500,  -5290,
- -2463,  -6386,  -2537,  -2331,  -3290,  -2398,    159,   6588,
- -2547,  -2424,  -2184,   8316,   5670,  -5608,  -2600,   2659,
-   166,  14828,   2622, -10490, -16378,     64,    434,   4576,
- -3010,   2479,  -6798,   3431,    360,  -1067,   3421,    664,
-  4029,  -4050,   -240,   3875,    672,   3587,    501,   2494,
-   -48,   9997,   3259,   8551,  -7624,  17342,  10765,   4328,
- -3721,   1729,  -2844,  -6330,   5114,  15589,   -261,  -7554,
-  2708,   7260,   5852,  -8736,    436,  -6160,   -588,  -5919,
-  5752,   3127,  -4558,    540,     74,  -4048,   3735,   7873,
- -2869,   -544,   -111,   5182,   1032,   2315,   -159,   5105,
-  4106,   -494,    678,  -4756,  -3865,  -7389,  -2492,   7193,
-  5146,  -7926,  12043,  11137,   1719,   2307,  -5476,  12679,
-  7996,    726,    933,   3222,   7515,    678,  -5858,  -2716,
-  1503,  -3014,  -2125,   4982,  -4984,    467,    986,   5450,
- -1472,   5314,  -1285,    218,  -3411,   4511,   8047,   4268,
- -8307, -10587,  17200,   3303,   7553,   5361,   1108,  -7982,
-  8240,  -5856,  -3376,  -3952,  -2884,   4401,  -7252,   4078,
-  7538,   3420, -13834,  -1139,  10742,  -2536,    636,   7758,
-  4282,  -3505,   1190,  -7382,  -8164,   5306,   -408,  -5005,
-  2776,   7806,   4781,  -7903,  -2370,  13884,    542,   5643,
-  6948,   6471,   2699,    815,   4454,   1882,   2290,  -3856,
- -3086,   8215,   3234,   4444,  -1580,   2835,  -3083,   6706,
-  7409,   4626,   2658,   2308,   7965,  -1034,  -2584,    344,
-   704,  12280,  10344,  -8032,  -4410,  -6168,   6860,   7977,
- -5630,  -6680,  -5001,  -6199, -10378,  -1764,  -3322,  -4284,
- -1048,   2721, -11738, -11800,  -7975,   2754,   3424,  -7641,
- -2245,  -4945,   -194,  -1948,  -2850,   4111, -21846,  -8750,
-  4306,  24494,  10428,  26998,   4976,  -2701,  -3283,   -723,
- -1539,   6758,  -9730,  -3517,   6401,  -4546,   -410,  -9900,
- -4947,   6996,  10983,   5110,  19948,    -78,  -1794,  11051,
-   -14,    316,   6447, -20430,   9363,   9062,  -2134,  13711,
-  6448,   6655,  -5232,   4610, -10352,  -3042,  -8713,   5777,
- -2438,  -2602,  -7293,   -755,   6736,   2960,  -3676,  -2882,
- -9806,   1342,   1242,   2122,   2749,    631,   6502,   2266,
--12996,  13620,  19762,   8096,    702,  -4394,  -8668,  -1460,
- -3228,   -173,  -6239,   4643,  -1916,   4098,  -2234,   1202,
-  1763,   6170,  -6320,  12984,  -5936,   8301,   6021,   2191,
-   466,  -4044,  -1913,  -3458,   8197,  -3249,  -5935,   2383,
- -4241,   4977,  -4415,    704,   3488,  -8356,  10229,    562,
-    14,  -4828,  -3890,  -7599,  -4208,  -3166,   1132, -16584,
-  -506,   1397,   6266,   3307,   5782,   2349,   3257,  -3017,
-  7814,   1216,   7440, -10096,  12698,    944,   1221,  -1683,
-   152,   6020,  -7910,   3897,  -6954,  -9439,  -9838,  -3860,
- -5383,  -4228,  -1980,  -4045,   7442,  -5504,   2145,    636,
-  2857,  -4538,   -820,   4275,  -2104,   5076,   5191,   -363,
--23254,   1962,    -66,   7550,     88,   8721,  -1361,   7733,
- -2661,   5282,  -5112,    -24,   -975,  -3200,  -2235,   5144,
-   213,  -6340,  -3974,   1266,  -2383,   2432,   -124,   -233,
- -3504,  10604,    806,   -918,  11601,  19332,    206,   7456,
- -8885,  -9692,   3087,   3685,  -2183,  -7538,  11970,  -5098,
- -7364,  -1173,  -3099,   6532,  -6850,   4622,   -828,    390,
-   467,  -5364,   4442,  -1878,   8949,  -4340,   -261,  -2720,
-  6659,  16184,  -6552,  -3736, -15416,  15774,   -306,  -4240,
- -1807, -10304,  11073,   2743,   3974,  -5557,  -3499,   5315,
--10742,   -378,  -4517,  -5949,  -7664,  -2830,  -6510,  -6096,
-  2052,   3425,   1971,  -3328,   5326,  -1362,   1806, -14286,
--12774,   6058,  -3365,   -735,  -2586, -18658,   6664,   9502,
- -1590,    323,   6445, -17766,  14694,  -9786,   3696,  -4547,
-  1601,   3645,   -584,    910,   2516,   8197,   3898,   4306,
-   631,  -2020,   4309,   -765,  -6591,   2083,   8969,  -1474,
-   -27,   9130,  -5808,   8492,   -135,   2230,   2296,  -4509,
-  4600,   4951,   1930,  -2564,  -5889,  -1338, -11737,   6387,
- -3649,  -5447,  -2462,  -4751,  -1012,   3523,  -3504,  -9510
-},
-
-.cb1108m0 = {
- -2417,   4623,   2916,  -4257,    120, -10323,   1198, -10252,
-  -117,   8767,   3160,   2323,   1162,   -650,   2237,  -4171,
-  2386,    432,   1627,  -7255,     38,    124,  -3658,  -1558,
--11711,     10,   8146,   1700,  -1975, -16731,   2397,   1056,
- -2502,  -2660,  -2731,  -2477,   1488,   1220,   4880,  -1156,
-  1805,     -3,  -3009,  -6233,  -2216,   3440,  -3082,   2124,
-    70,  -2461,   1125,   1919,  11949,  -2506,   -622,   2209,
-  -702,   2685,   9183,   -510,  -2806,  -1129,  -1823,  -1746,
- -3600,   2298,  -3360,  10793,  -1714,   1662,    -62,    395,
- 14142,   -261,   -144,  -9896,  11481,   -884,  -2197,    352,
-  -326,   -453,  -1984,   2027,  -1466,   3290,     94,   3481,
-  2533,   4401,   5492,   3803,    247,   -896,  -1688,  -3166,
-  1130,  -1125,  -1973,    322,    867,  -1936,    714,   -880,
-     8,   2313,  23418,  -1682,   -677,    384,  -2140,   -386,
-   920,  -2523,   -495,  -1494,   3027,   -707,   1172,  -1403,
-  2177,  -2137,   -885,  -1035,  -1637,    375,   2452,  -3709,
- -1171,   2069,   1095,  -1937,   -686,   -956,   2034,   3410,
- -3075,   -359,   -598,  -2084,  18550,   1781,    -45,   1400,
- -1580, -13180,   -609,  -1376,  -3145,   -248,   5661,   6886,
- -3915,   -194,   9876,   1065,   3879,  -1726,   -837,   -660,
- -7467,  -3055,   3516,    283,  -1604,   -625,   1165,   3023,
- -1531,  -1825,   1430,   -561,   -881,   1346,   -129,  -1817,
-   851, -32768,   -294,   -188,   -116,   -646,   1176,    630,
-   903,    417,  -2487,    352,   -789,    571,   -127,  -2054,
- -2112,    418,   1631,    266,   -270,    362,  -2765,  -1198,
-  -182,   3586,  -1272,   1470,    -66, -18384,  -1230,    823,
-  1171,   1350,   1101,   1410,  -3730,   1535,   -101,  -3234,
-  2315,    -34,   -458,   1361, -16497,   -990,   1438,   2542,
- -1193,    586,  -1708,   2689,   2741,   6010,   4209,  -5974,
-  -628,   1556,   2238,   6134,  -3040,  -2937,   2188,  -1660,
-  1137,   1316,  -2650,    905,   -502,    -93,  -1177, -31964,
- -1170,   1504,  -1284,   -104,    168,     55,   3478,   -161,
-  2818,   -484,    -32,  -1536,   1218,   -854,   -351,   4465,
- 16922,    681,   4198,    419,   -414,   6824,  -3906,  11598,
-    75,   4904,   1374,     64,  -2692,  -3759,   3065,  -1397,
-  -202,   -347,  -2466,     96,   1035,   -765,   -258,   3711,
-  1437, -18250,    566,    976,   2483,      4,  -1096,   1906,
-  3745,  -2621,  -2756,   1864,   -560,     98,    821,  -4094,
-  5349,   1369,  -5245,  -2170,   2932,  -1052,   3932,   -413,
-  -400,  31206,   1125,   1631,     43,   -764,   1666,    780,
-  2036,   -564,     64,   1311,   -202,    843,  -2030,    856,
-  1766,  -3163,  -1158,   -626,    316,    127,   1783,   1918,
-  3384,  -2887,  -5885,   1763,   4910,   -248,  17100,  -3022,
- -1880,  -2927,  -1287,  -3308,  -1767,  -2622,  -1460,   -250,
-  3597,  -4526,    946,  -1533,   1059,     -8,   -807,  -1283,
-  1436, -11184,    643,    398,  -1565,   1983,    -60,  -9862,
-  1219,    322,   3132,  -2043,   1138,   6258,  -3540,    790,
-  -923,  -4692,  -1401,   2733,  -8918,   4905,   6181,    192,
-    82,  -1094,      4,   -634,  -1323,  -2865,   1036,   1484,
- -2461,   -937,    414,    221,   2179,   -438,   1273,  -2690,
- 18442,   2781,   1788,   2264,  -1230,   4284,  -4708,   1190,
- -4810,   -975,    230,  -3728,   2504,   3602,   3488,     88,
-  1322,    487,   2965,  -3731,  -2341,   5937,   8545,   1716,
-  7308,   9017,   6426,    727,   3992,  -4584,    388,   3714,
-  1164,     18,    445,   1253,    398,  -1989,   -824,   -430,
-   745,  -5447,   2176,  -1986,  -3963,   2861,    194,  17739,
-  1891,  -5368,   4172,    125,    530,  -2766,   1179,    401,
-  1759,  -1609,  31234,    910,   1100,   1036,   -948,  -1101,
-  -614,   1768,   -344,    840,   -696,   -842,    320,  -1444,
- -2560,  -3199,     58,  -2172,   1375,  -3002,   -821,   -863,
--12096,  -2484,   -677,  -2130,   4450,   3568,  -3192,  -1114,
- -3218,   3121,   -503,   5570,   -561,   3896,  10566,  -3065,
- -2768,   1398,   1719,  -2708,   1952,   -142,   4777,   -978,
-  2238,  -5780,   -430,   1228,  -1298,  -2923,   4353,  -1621,
- -2368,  -2908,  -8012,   4398,   -502,    518,  -6964,    622,
-  -377,   3758,   6598,   4438,   6849,  -7696,    470,   3585,
-   466, -14664,   3438,  14706,  -1944,  -2544,   -785,   3653,
-  1274,    443,   -694,   1968,  -3499,   2855,  -3930,  -1210,
-  -528,   1931,   3849,   -772,  -2659,   4499,  -3624,   -540,
- -1645,   -949,   -382,    979,    595,    165,    429,    -80,
--20468,   1040,    544,   2545,  -5010,  -2122,  -2840,   -335,
-  -405,    404,    -50,  -2996,   1226,    519,  -1046,   3745,
- -2317,   6211, -14500,   9754,  -5802,   5230,  -3112,   1506,
-  3741,    664,   -902,    197,   2476,  -3618,   2040,  -1066,
-  2338,   -257,  -2580,   -293,   2740,   -576,   2050,   -865,
- -3666,  -2090,  -1831, -32056,    658,   1549,   1602,   1728,
-  -534,    390,  -1517,   -627,  -4025,   -797,  -2351,   2759,
-  -102,   2574,    -56,    796,   -232,   -886,   1639,  -2773,
-  1007,    830,   5880,  -2220,    762,  -3834,  -2865,   -415,
-   584,  -3498,  -4546, -16108,    344,  -4072,    551,  -5435,
-  2007,  -1418,   3838,  -1662,   1981,   3545,   1424,    769,
-  2135,   1705, -15076,   -636,    283,   3386,     97,  -1048,
- -3933,    204,  -8616,   -556,  -2936,   4241,   5100,   1777,
-    98,    719,   6202,  -1496,    708,   2160,  -2396,   4060,
-  1513,   2253,    -46,  -1823,   -132,    709,   -756,   -944,
-   575,   1070,  -1583,    587, -24575,  -1989,    874,   -568,
-  1040,   1116,  -4002,   3196,   2826,    117,   1590,   2456,
-   938,    112,   -938,  -1268,   5056,  -2851,   2995,   2559,
--13121,  -8374,   3593,  -6684,   3663,    766,    747,   1016,
-  -921,   2241,  -1942,   4269,  -3312,  -1012,   2340,   2781,
- -3881,   2532,  -1976,  -1436,  -3219,    420,  22088,   -742,
-  -640,   3270,   1446,   1935,   1279,   1913,   1377,  -3297,
-  -751,   4209,  -1052,   2381,   2938,  -1330,   2154,   2784,
- -2420,   1270,   2334,   -526,   1480,   -435,   2206,    252,
-  -510,  -1018,  -1469,  -1294,   -950,    424,   1058,  -2317,
-  -846, -20737,  -1877,     88,   -431,  -1268,    116,   -378,
- -2326,   3115,   -246,     30,  -4725,    648,   2084,  14286,
-  -817,   2496,  -1947,  -4869,  -9703,   1505,  -2476,  -2108,
-   747,   -449,   3002,  -5464,   -514,   1805,   2559,   2494,
- 12782,  -1232,  12091,   2118,   3996,   2592,   1058,    510,
- -1384,  -3050,   2533,   -408,   5219,   3044,   3242,   -185,
-  2654,  -3723,     16,  -1723,   1823,   6144,  -4806,    182,
-  1772,   4841,  16390,    -96,   2505,  -7713,  -5244,  -3316,
- -6776,   1448,  -1470,   4238,    294,    889,  -2372,  -6281,
- -2423,   5423,   2119,   2897,   1378,    817,   -993,  -1599,
--14662,   3014,  -3397,  -6182,   -245,   4897,   5116,   2285,
- -2863,   1174,    415,  -6777,   3863,  -6009,  -4722,   -119,
-   606,  -2247,   4447,   1064,  -1935,   2705,  -2629,  -1144,
--11980,   3805,    882,   1634,   5446,  -4300,    643,   3436,
-  7632,    592,    998,    674,  -2647,   4644,  -6854,   1368,
-  -146,  -3395,  10599,   1369,   3852,   1689,   2437,  -3937,
-  3405,   2517,   1895, -14092,  -1142,   2570,  10163,   1608,
- -2445,    850,  -1678,   3112,  -3465,   3138,   4413,  -1973,
- -4151,   1163,   1822,  -3819,  -1568,   -407,  -2642,    424,
-   365,  -3599,    164,  -1448,   1062,   1536,   1590,  -1982,
-   200,  18572,   -230,   -638,  -1253,   1650,   2280,   4945,
-  4527,  -2353,  -4216,   3752,  -3807,   3686,  -4816,   2382,
--14833,   1306,  17246,   -739,   2012,   3521,   1473,  -1436,
-  1514,   -142,   -461,   1038,   2462,    971,   1354,   1272,
-  1787,   2420,   -922,   3364,   2250,    497,   1349,   2795,
--32768,    425,   1874,    -72,   2461,    389,   -306,  -1180,
-  -646,    251,    299,  -2735,    577,   1055,   1826,   1620,
- -1214,   1422,   -901,  -1273,  -2367,  -1241,    366,    521,
-  -433,     55,   4000,   3035,  -1390,   2505,   1786, -15397,
-   413,  -5916,   -234,   3559,  -6776,  -5068,   2251,     36,
-  -180,    596,   5744,  -2450,  -1276,  -4786,  -1872,     24,
-   252,    464,   2833,   -136, -25600,    -33,    873,   2646,
-  1471,  -1336,  -1330,   -276,   1778,   -242,   -951,   1580,
-   -79,   -858,   -927,  -4310,   -604,   7568,  -1713,   -948,
-   192,   -260,  -1334,  -1116,   -705,    638,    132,   1186,
-  -952,   1157,    428,   2039,   1568,   1778,  22453,  -2190,
-  2176,   1674,  -3996,   1294,   1162,    274,    415,  -2877,
-   464,    505,  -1842,  -1066,  -2241,   -761,   -291,      8,
-  -987,   -104,    796, -32768,   1302,   -809,    571,   1214,
-   455,    686,    656,  -1752,    886,   -790,    644,  -1114,
-  2358,  11452,  -4398,   1334,  13095,   3230,  -1818,   4053,
- -1990,  -1093,    878,   3796,   2712,  -1523,  -1229,   1077,
-   960,   1250,    -75,  -3233,  -7734,   2783,   8430,   -327,
- -1428,  -1687,  -4092,    269,   3161,   -569,  -1267,   1774,
-  2772,  -2033,    171,   -520,   1551,   3719,  -3364,   -220,
-  1904,  -1282,  -2008,   -818,   4261,   -886, -19201,  -3454,
-  -478,  -2645,  -2601,  -2124,  -3977,   2960,   1563,   -432,
-  -989,   2682,   1734,  -9085,   4614,  -4454,   2535,  -7201,
-  -220, -10022,   -431,  -7907,    889,  -9658,   6653,    762,
- -1827,   5886,    862,  -1836,   -430, -16363,   5709,    851,
-  1814,    304,   5045,   1685,  -1004,   5108,  -5936,  -3143,
-   940,   1832,   -270,   -674,   1441,   -241,   3222,   -551,
-  -434,    -69,  -3584,    349,  -1354, -12080,   3639,   5219,
-  7583,  -1023,   2078,   3263,  -5807,   -873,   4085,  -5153,
- -3623,   -436,  -4717,  -1803,  -6274,  -2049,   -247,   2516,
-  1922,  10204,   2194,  -1574,   -535,    656,   1638,  -3091,
-  1156,   1377,  -1220,   4956,   -221,   4984,  -1154,   4603,
- -1618,  -5655,  -2583,  13494,  -2442,  -3968,   3086,   1098,
- -1625, -13781, -12826,   2659,   3604,   -702,  -1900,  -3508,
- -6283,   2320,   1979,  -2823,  -4890,  -1728,      2,  -4402,
-  -437,   1932,  -3272,   2853,  -3018,    840,   -632,  -6691,
-  -484,   9579,   1008,  11677,  -2814,  -2029,   8048,  -1170,
- -7366,  -2664,   3349,   1319,  -1160,  -1864,    606,   1568,
-  5428,  -4763,  -2470,   2145,   1798,   -502,  -1538,  -3736,
- -1376,   1330,  -3567,    -78,    478,   -743,    890,   -800,
-   -44,  -1832,  -1761,  -1022,   -996,   -846,   1188,  -1042,
- -3202,  -2439,   1602,   3601,    564,  18338,    -17,   1327,
-  -387,  -1998,  -1260,   3352,    849,  -4780,   1932,    -56,
-  2625,  10753,  -1676, -10536,   2980,   1542,   1177,  -3113,
-  -859,    522,   3092,   9588,   2882,  -4540,  -1406,  -5183,
-    50,  -4245,   3649,   -420,  -3612,  -5290,  -1919,  14559,
- -2605,   1169,  -2009,  10760,  -2372,    339,  -2538,   4476,
-  3001,  -4570,  -3158,  -3465,   2873,    650,  -2099,     76,
-  1166,  -1469,  -2769,   -391,   4215,   -630,  -1448,  -1796,
- -1573,   5914,    807,  -1580,   2072,     99,    580,  -2999,
-  1079,   -202,  17940,  -1233,  -4909,   1079,    390,   -891,
-  1834,  -2155,  -2642,  -1703,   1856, -14125,   2081,   3178,
- -2480,  -4342, -11991,  -2050,   1046,   2412,    436,   1046,
- -2291,  -1718,  -3087,   1710,   -963,  -1914,  -3423,   6190,
- -1238,  -4333,    115, -10550,  -2742,   -919,  -4849,   1502,
- -3054,  -3304,   2300,  -1850,   2337,  -6643,   1995,  -1279,
-  -238,    738,   -124,  13593,    252,  -1424,   -165,   2786,
- -1717,   -838, -11244, -10971,   -902,  -3330,  -2580,  -2735,
-  -171,   4041,  -2149,   2502,   6726,   -738,  -4235,    368,
-  6144,  -1718,  -8620,  -1888,    112,   -282,    -19,   4126,
- 10797,    610,  -3097,   7783,  -2974,  -2058,  -3558,    470,
- -5914,  10322,    -20,     85,  -1652,   6111,  -1398,   2613,
-  3733,  -3716,   1930,  -4325,  -1199,   -921,   -446,   1095,
-  1006,    910,  -2323,   -351,    808, -32768,    274,   1346,
-   105,   2360,  -1184,   2249,   -970,    153,   3180,   1307,
-  2207,   -962,   2209,   -921,   1504,   -117,  -2111,  -3734,
-  5738,   8014,     76,   1566,   3013,   -462,  -3600,   3939,
-  4862,   1038,   4312,   -790,   -426,  -1656,     20, -10568,
- -6389,  -6597,   4230,   2910,   2504,  -2962,    256,    814,
-  -488,    824,   -355,   3574,  -1890,  -2657,   -767,   2730,
- -1087,  -2538,  -3522,  -4067,   6249,  -3354,  13923,   4070,
--11004,   4703,    909,  -5968,  -5483,  -4242,   -780,  -2489
-},
-
-.cb1108m1 = {
-   752,  -4098,   7726,    592,  -9487,   2004,    318,  -4322,
-  6989,  -3350,   -478,  -4308,   2023,    753,  -7081,  -3934,
-  -866,   6267,  -5710,   2100,  -8467,    100,  -4654,  -6773,
-  4271,  10728,  11618,   1128,  12733,   1471,  -5518,  -1162,
- -2159,   -402,   -632,  -4720,    -28,  -1412,  -1037,    897,
- -1242,  -1735,  -2632,  -3460,   3389,   -582,    206,    325,
- -2547,     46,   1340,  -4424, -13408,  -4918,  -2832,   1454,
-  2127,   1276,   2292,  -3973,  -3230,  -7810,    542,   4227,
-  2673,  -8490,   -902,   1361,  -1398,  -1986,   -991,   -680,
-   602,  -2887,   -557,   2656,   3214,   1794,  31241,   1462,
- -1457,  -3750,  -1923,  -2381,   1313,   -128,   -172,   -647,
-  -574,   1045,   2438,   1662,    503,    288,   1535,  -1016,
-  2487,   -820,   4692,   2799, -31949,    166,  -1655,  -2192,
-  -636,   1357,  -2361,   -459,  -1752,   2782,   -293,   -144,
-  1900,    685,   1766,   1900,   -347,  -4488,    590,    915,
-   798,   1133,  -4494,  -1388,     75,    884,  13088,  -2392,
-   679,   -315,  -7520,   1086,   3873,   3297,   -812,   -626,
- -9443,   2548,  -6417,   1619,   7196,    -57,      5,   3594,
- -1922,    184,   2784,   -261,  -3310,   2779,    174,   2814,
-  -965,  -2912,  -1835,    425,  -4285,    896,   2001,   3717,
-   775,  -1192,  22365,   -175,   1522,   -711,  -1135,   5123,
-  -517,    870,   4323,    585,   -437,    260,  -1737,  -1984,
-  2522,  -2539,   -973,  -8812, -16173,   4678,  -4107,    130,
- -7832,   1140,   2792,   3394,   -692,  -4105,   -299,   1488,
-  1246,    604,   2796,  -3767,    579,    188,  -1544,     86,
-   424,   1204,   4441,  -1000,  15227,   3459,  -3444,  -1631,
- -2177,   3497,   1684,    925,   2872,  -3905,   5729,    647,
-   913,   -758,   -547,    566,   1787,    792,  -1509,  -1641,
-  -926,  -1515,   -116,   1266,    481,  -3944,  28526,  -2279,
-  5577,   1026,   4082,   -605,    696,   1094,   -478,   5732,
-  7247,   1461,   1521,   -234,    -42,   -878,    270,   -554,
-  3702,    -71,   1362,   7719,    305, -13654,  -4985,  -1072,
- -2044,   6851,    438,  -8435,    923,   -537,   1511,  -1003,
-  2056,  -2299, -15578,    503,   1944,   3188,   2318,   1761,
-  1290,  -2322,   -568,  -1591,  -2746,  -1966,  -9784,   1514,
- -5596,   4070,   -181,  -3006,  -1903,   -240,  -1143,    393,
- -1530,   -822,    520,    989,  -1600,  -3374,    946,    678,
-    86,  -1957,   1947,   1188,    356,    719,  -2874,  -2245,
--19010,    547,   9067,    439,  -2384,    847,  -3307,   -116,
- -1114,   -445,  -3505,   -967,  -1252,   4880,    625,   1478,
- -2970,  -2275,   1337,    422,   3870,  -1906,  -1033,   1724,
-  -532,   1734,   1011, -21848,   -477,   -251,   -615,    770,
-  7520,   1030,  -4372,   -446,  -3156,  -2314,    172,    901,
-    70,   1837,   1205,  -1344,   2933,   1080,  -1290,   1353,
- 10205,   1158,  11135,    560,  -3480,  -2376,   7539,  -5418,
--14092,   2138,   -253,  -9344,  -1907,   2177,    687,   2772,
- -2730,   -546,  -4180,   2021,   -577,   2530,  -3822,  -7080,
-   971,   2083,  -1220,    203,   3187,   3705,   -752,  -2591,
-  -704, -17469,  -1168,   -214,   2518,    308,   -585,   1117,
- -1893,   2488,   1856,    -23,   2418,  -2922,   1960,    235,
- -1629,  -8277,   1088,   2032,    874,   2763,  -1867,     60,
-  1684,    834,  -2676,   1574,  -3098,   3250,  -3723,   -126,
-    59,   -787,   2710,    930,   1384,    475,  -3915,  -1162,
-  1640, -16818,   2356,    -70,    761,   4151,   -778,    523,
-  -183,  19374,  -4223,  -1379,  -1667,  -1690,   -512,   8742,
-   -34,   3816,   -678,   2749,   2418,   -341,  -1216,   4280,
- -2208,   -264,  -2884,   4679,   -821,   1824,  -6724,  -1528,
--12042,  -9908,    935,   4338,   -116,    612,      6,   -161,
-  1935,   1600,   -442,   4059,   2510,   2186,  -7678,   3600,
- -2460,  -1072,   -122,  -1817,   -246,   2786,   9079,    525,
-  -226,   2628,  -2549,   1459,   4533,   1111, -17410,   4529,
- -2545,  -3272,    403,  -2758,  -1876,   2734,   2136,  -6171,
- -2055,   1163,  -2820,   2992,   2978,   1458,   1572,   2508,
- 13576,  -1545,  14861,   -796,  -6444,   4022,  -4358,   -529,
-  3439,  -2630,  -2457,   3030,  -2972,   -398,    471,   2547,
-  1127,   1344,    202,    420,  -1858,   -589,    594,   1478,
-  5590,   1682,  -1560,   -378,  -2198,    400,   2231,    566,
-   -80,  -2042,  -4557,  -2309,   8743,  -4258,   1291,  11770,
-   718,   2342,   2912,   5170,   2470,   6832,    833,   4990,
-  2009,  -1258,   -898,  -1414,   1214,    670,  -2104,  -5068,
-   788, -18997,   -743,   -864,   -356,   1592,  -5786,    652,
-  4952,  -2319,  -1097,   2177,  -1654,   2879,  -1645,   -172,
- -1581,  -3062,   -805,  -1065,  -2222,  20857,  -1146,    864,
-  1690,  -1794,    855,    307,   2320,   3618,   6184,  -4129,
-   187,  -2423,   4946,  -3072,   -213,  -2621,  -2026,  -5793,
-  -986,  -1597,   2125,   1474,   1766,    360,  -4652,  -1030,
-  1546,  -1085,   -253,   1016,    -96,  -1608,  -7017,  -4855,
-  1295,   -271,   3751,    341,  19804,  -2006,   2322,  -2298,
-   353,  -2077,   -764,    212,    150,  -1140,    564,   -614,
-   268,  -2023,   -332,   -699,   -937,   1684,  -1617, -22863,
-  1202,   -144,     62,    373,   -598,    184,    987,   3721,
-  -611,     86,   3676,    362,   -652,   -214,   -311,   -694,
- -1973,   2351,   -733,  -1601,  -1189,  28227,   -154,     10,
-  -347,   3400,   1333,  -1695,   -773,   1362,   -447,  -2999,
-  -626,  -1776,   2474,   2195,  -1041,   -797,   1828,     62,
-  3397,  -1779,  -2924,   1740,  -1694,   4083,  15100,   3871,
- -7821,   -108,    292,    998,   3141,   5813,   -918,  -1290,
-  -902,    895,  -1336,    -50,   2014,  -2066,   2383,     68,
- 31769,   -334,   1243,   1981,   -715,    125,   -380,  -1272,
-  1068,   -357,  -1734,  -1138,   -630,   1042,    688,   -438,
-  -558,  -2460,  -2894,   4196,  -1004,  -2177,  -2291,  -4701,
--13990,    747,  -5558,  -2754,   1950,  -2780,   8414,  -1286,
-  -946,    220,  -2507,   -192,   3726,  -1361,   1296,  -2215,
-   872,   8270,  -2797,  -6732,   1256,  -1957,  -2916,    107,
--14847,   1868,   4638,   1292,  -1006,   5285,   2947,  -5028,
-   942,    153,    420,  -1152,   -391,   3612,   4621,    172,
-   762,   -876,  -3561, -14406,   -552,  -2570,  -4448, -15704,
-  -806,   -928,   3380,   -686,  -2604,  -3895,   -714,   -626,
- -1763,   1144,    485,     34,  -1922,   1528,   -213,   5050,
-  -804,    185,     96,   3320,   -621,   -329,  -1444,    864,
- -1684,  16583,   1872,   3327,   2146,   1132,  -8216,     73,
-  6524,   1623,  -4147,  -4985,   1450,   -646,  -7189,   4524,
- -1596,   2120,   3913,    680,   2094,   1660,    752,  -1221,
-  2414,   3986, -10314,   2096,    129,  -5458,    634,  -5426,
-  -594,  -9731,   2083,  -2284,  -5085,  -4777,  -1323,  -1740,
-  6157,   -841,   -126,    247,  -1163,  -7005,   3863,   -764,
- -1552,   1356,  10788,   -745, -12481,    -73,   5234,  -3220,
-  2979,    635,   3372,   -540,    -36,   2887,   5221,    931,
- -1724,  -4824,    780,    -49,    120,   -739,    890,    714,
- -1438,   -458,  -1861, -16732,  -1858, -13282,   2182,  -6796,
- -3307,    556,  -2968,    542,  -2358,   1463,  -3536,   1866,
-  2833,  -1369,  -1576,  -2825,   3561,  -1625,   1858,  -1052,
- -1079,   1302,  -2049,  19052,  -1188,  -4137,   1592,  -4705,
-  1082,  -1168,   2355,    649,  -1900,  -2582,   1000,  -3065,
- -2399,   3625,   1062,    860,   2586,  -2645,  14755,   3147,
-  5002,  -6720,   1728,  -2114,   5090,  -2838,   3020,  -5048,
-  4182,   2237,    706,  -4945,    -86,  -1908,  -1207,    135,
-   675,   -200, -22134,   1492,   2490,  -1324,  -1135,   -842,
-  1457,    185,   1342,   3516,   -882,   1069,   1159,    -52,
-  1844,  -1186,    554,   3860,   1824,  -2136,   -881,  -1281,
--13259,   -705,    -90,   2150,    573,   2787,   1068,  -1968,
-   121,    805,   4382,  -1033,  -9220,   -744,  -1446,   7180,
-   257,  -5983,  -1643,  -6198,   1854,  -3524,   1060,   -118,
-    56,   -843,   2832,    -98,  -3493,    368,      6,  -1877,
- -3615,  -1954,  17971,    962,   1532,  -1754,   3776,    661,
- -2025,    -60,  -1013,  -1222,  -3062,    -69,  -4933,   3064,
- -1176,    213,    477,   1081,   1679,  -2328,   1984, -21759,
-  -881,    -54,  -1101,  -1092,    598,   1648,  -3384,   -213,
-   379,  -1318,  -1972,    630,   -536,  -1970,   -461,   -356,
--22416,  -1855,   -113,    876,  -2809,   -587,  -2323,    -56,
-  2177,   -797,   1649,  -4069,   1350,  -2075,    101,  -1384,
-  1703,   1085,    471,   8093,   1020,  -4112,    970,    866,
- -1456,   -341,   1418, -12938,    379,   9787,   1814,   2337,
- -1705,   9913,   1026,   1962,   -744,  -2900,  -1690,   1534,
-  -959,   -629,   2330,   3735,   4742,  -3139,  -2135,   2298,
- -2765,  -1389,  -3634,  27139,    671,   2208,    494,   1015,
- -1197,   -239,   -321,  -1145,   -679,   -637,  -3116,    544,
-  -952,    882,    396,   1087,  -3163,  -2684,    759,   -725,
- -2186,   -542,   2545,   3669,     24,   1689,  10473,   1836,
-  -419,    322,   2475,   1908,  -1346,     50,  -6401,  -3644,
-   552,   2348,   1327,  11853,   2467,   5493,   1544,    464,
-  1796,  -2801,   8217,   1014,  -2103,   3764,   8091,    170,
--12422,   1708,  -2438,  -1873,   1970,   2160,  -5027,   -647,
-  -118,   2830,   2379,  -1091,  -5723,    124,   3017,    417,
-    55,   1376,  -1079,   7122,   3086,  17847,   2468,   3273,
-  -599,   3302,   -922,  -2073,  -1696,    805,   2022,  -1899,
-  3188,   1425,  -4364,   -140,  -3760,    437,   1393,  -1298,
- 17166,  -1283,  -2904,   -692,    518,   -404,    944,  -1990,
-  -968,   1323,   2376, -11708,   2187,   3164,   -559,   2212,
-  1598,  -1741,    360,    633,   3075,   -660,  -1012,    778,
-   565,  -2020,   -123,      5,  -2217,  -2967,    374,    272,
-   336,  -1725,   -408,  -2270,  -2645,  -1044,   -517,   1911,
-  -386,  -4439,  -7603,  -1000,   7660,    589,  14931,   2901,
- 11998, -13102,  -1919,   3904,     86,   1617,   7324,   3078,
-  1714,   4636,  -2504,   -194,  -3274,   -710,     33,  -1965,
- -2298,   2513,    726,     75,     67,    884,   2104,   4110,
-  1936,  10387,   2722,  -1970, -12496,   4799,   3086,  -2938,
-  1719,  -2138,   -338,  -1124,    971,  -4200,    480,  -3361,
-  6220,   5954,   1830,   1001,   2996,   4166,  -2854,   -437,
- -1430,   1072,   -312, -12949,   3113,  -2479,  -2034,   6956,
-  2805,   2128,    856,  -8803,  -4709,  -1274,   -120,   1252,
-  3898,   6526,  -3914,  -2276,   2754,  -2604,  -3038,   4136,
-  2598,  -2172,   4861,  -2457,      2,  -2693,   -808,   3527,
- -1184,    392,  -2202,   2406,    960,  -1064,  -2589,   1161,
-  2418,    728,   -466,  -4865,    211,  14720,  -2093,  -1977,
-    85, -12618,  -2073,  -3028,  -1067,   1734,  -2491,   9506,
-  -422,  -2718,  -2966,   3883,  -2852,    336,   1306,  -2297,
-  2009,   2589,   3071,    192,  -1239, -10553,      2,  -1174,
- -3036,   9939,    -27,  -1278,   1448,  18655,    761,    931,
-   445,    -94,    206,    448,  -1865,    232,  -4353,   4596,
-  -260,   -976,    594,    648,    796,  -1376,  -1186,   3056,
-  3171,  -5675,   6179,  -1287,  16934,  -1478,   1090,    577,
-  8075,   1119,   2943,  -3208,   1852,   1986,   6003,    901,
-  -962,  -3196,  -1907,    392,  -2605,   2796,   4082,   -456,
- -3109,  -1219,    123,   2470,    174,  -1254,  -1350,  -4919,
-  1271,  12302,  -1154,  -6317,  -3346,  -1315,   -144,   1214,
-   -49,   3491,  -1029,  -2043,  -8373,   4197,   4971,   9808,
-  9732,    700,   2247,  -2755,  -2034,   3260,    839, -10554,
-  1661,  11484,  -3180,  -1909,   1089,   -813,   3116,  -2103,
- -3726,  -4514,    663,   1152,   3902,   4862,   2739,  -3828,
-   707,   2712,  -8009,   -832, -16492,  -1472,  -2422,  -5593,
-   322,  -1894,   2810,    109,  -1788,   2050,   3539,  -3112,
- -6178,   2487,   2102,   -135,   3163,   2096,   4123,   -310,
- -1090,     -2,  -2662, -17087,   1373,   1448,    162,    527,
-   655,  -2248,  -3530,    194,   1305,   7590,  -5515,   1225,
-  1607,  -3816,   2185,  -2679,  -4486,   -582,   4981,  -1675,
-   147,  14790,    119,  11771,  -1228,   1012,  -6133,  -2247,
- -3913,   1348,  -1846,   -513,  -6386,   -749,   6726,    745,
-  -809,   -799,   3224,     43,  -2230,   2598,   2994,  -1590,
--11198, -14476,   -256,    695,    877,  -3680,  -2734,  -1448,
-  1336,  -1633,   3327,   3497,   2956,   -782,   2958,  -1866,
-  2876,   2003,   -856,   1282,   5068,    391, -10539,   1703
-},
-
-.cb1110l0 = {
--14944, -14950,    -73,  -1141,   1532,   -575,   -620,   -816,
-  1185,  -1597,  -2651,   1426,  -1458,   1317,  -1320,    -19,
-  -209,   -352,   -163,    912,    -85,   -180,   -546,  -1121,
-  -435,   -345,    229,    364,   -850,    632,   -426,   -359,
--32768,    278,  -1021,    310,    -31,   -355,   -442,   -234,
-   415,   -202, -10393,   1645,   -378,  -2270,    837,  -1857,
-   556,   -935,  -1344,   3016,   3452,   1597,   1378,    466,
--13740,   -878,   1475,    237,  -1301,   9756,   -592,     23,
-  -192,    335,    -58,    285,    376,     40,     24,    292,
-   426,  -1962,   -798,    745,   1379,    -34,    397, -14748,
- -6285,   7343,  -6374,   4442, -14800,   1878,    -24,   1606,
-  -728,   -476,   1754,  -1052,    911,   3139,  -1444,   -222,
- -1968,   1858,   1330,    244,    213,    935,    -92,   -348,
-   155,    418,  29128,    236,   -190,   -226,   -309,   -178,
-  -690,     46,    716,   -534,    147,   -630,    -75,   -826,
-    37,   4745,  -1056,   2400,   1398,   1494,    460,   -221,
-  2908,   -656, -15611,  -2940,   2342,    -98,    581,  -3144,
-  -471,   3772,   2057,   1583,  13738,   -139,    330,   1175,
-   429,     63, -14544,   -374,   1439,  -1226,   -422,   -690,
-   816,   1279,   -592,   1642,    700,   1338,      0,   -714,
-    46,    377,   -188,   -366,   -197,   -637,   -622,   -262,
-   -69,   -637,  -1266,    257,    620,  -1040,    324, -19064,
-  -602,   -463,  -1329,    513,   2699,   -421,  -1918,   2250,
-  -404,    403,  -1514,    134,    147,      3,    426,    605,
-   276,    561,    -26,   -294,    630,   -500,   -480,   -133,
-  -712,  -1144,    238,   -633,    173, -29164,  -1182,   -274,
-  -138,   -271,   -232,     30,    706,   -168,   -848,    704,
- -2132,   -248,   -108,    669,   1165,    234,   1243, -12201,
-  2208,  -1971,   -829,  10305,  -3964,  -1502,   -409,  -3918,
-  4520,  -2259,   -797,   2235,  -5560,  -1710,  -2472,    280,
- -1747,   -980,  -4529,  -5208,  -1813,    330,    890,  -6220,
-  -710,  -5583,  -4704,   -913,   2920, -12484,  -4340,    334,
- -1303,    283,   -740,  -1261,   3556,   3210, -11640, -14438,
- -2557,   -795,    747,    546,  -2488,   1891,    485,    725,
-   338,   1579,   2092,   2354,    284,   2812,    490,   1442,
-   187,  -2699,   1196,  -1783,   1228,   2364,  13364,    258,
-  2102,  -6163,   -200,  -5475,   2804,   -576,   6878,  -2852,
-  2246,   1186,    584,   -136,   5258,   3825,   3045,  -1661,
- -5246,   2548,  -5054,  -4383,  -1542,  12912,  -1580,   1268,
- -1415,  -2012,   1021,  -2106,    979,   2390,   3411,  -1076,
-  -439,   5416,   1333,    440,   3422, -13384,   2540,   2544,
- -3668,  -2308,   1042,    589,   4166,   5090,   1539,  -3447,
-  7003,  -4396,    319,   -590,    481,   -471,  22260,  -1936,
-  -297,   1302,   1163,    937,   -164,    847,    768,    827,
-  -430,    792,    472,  -1557,    712,   -602,  -1007,   -278,
-  -974,  -3198,  10560,  -2124,    335,  -1206,    629, -13712,
-    12,  -1673,   -691,   -666,  -2890,    826,   1792,  -1547,
- -2016,    807,   1810,    841,   -814,   1214,    760,  -1056,
-   404,    -94,    144,    297,   -584,    106,    116,   -132,
-   236,   -507,     86,    853,   -670,    413,  32767,    730,
- 10835,   -502,   1297,  -3857,  -1035,  -1602,   -164,  -1721,
-  1468,    507,   1064,   1478,   4323,   -760,   -882,  -4331,
-  2564, -10933,   3000,   2101,  -2492,    -72,  12636,   2743,
- -1113,  -8334,   6720,   2348,    491,    -23,  -1065,   1506,
-  2090,  -1731,  -1997,    675,    425,   8165,    695,   2285,
-  -433,    515,   -465,   -347,  -1006,    357,    -55,     57,
-   481, -31494,   -816,     60,     76,   -439,   -328,   -217,
-   265,    123,    839,    218,   1355,    243,   -878, -12819,
-  5168,    318,   1376,  -2931,  12689,    -83,   -220,   2848,
-  -770,    150,   1631,   1955,   1552,  -1371,  -3053,   1752,
- -7250,    -24,   -514,  -5568,  -1529,   -112,    419,  -1136,
-  -672,  -1847,  -1136,     90,    453,   4810,  13012,  -2355,
- -2477,   1393,    451,   3390,     12,  -2228,   1840,  -2543,
- -2404,  -2969,    186,   -444,    204,   -265, -11467,   2204,
-  1821,   3591,     67,   8821,   4015,   -183,  -5902,  -1468,
- 11394,   3062,   -128,   -476,   2495,  -2888,  13482,    686,
- -1320,    371,   -884,   1829,  -1810,    337,  -1124,  -1442,
-   432,   1950,  -1203,    663, -10445,   2310,    766,    137,
-  4418,   2821,    135,    116, -12164,  -3592,    686,   2310,
-  1229,   1930,  -1756,  -1309,   1439,  -3741,   -305,   1547,
- -9940,   3198,   1333,   2403,  -2847,  -3892,   -259,  -1766,
-   881,  14310,  -1711,   -840,   2259,   3027,  -1527,   1156,
-  2904,    -75,   -728,   1536,   -127,    152,  -3240,   -726,
--11914,   1037,   -851,  -1893,   -748,  -3294,  -1114,   6072,
-   103,  -1539,   4573,  -1637,   5242,   2705,  -9890,    254,
- -1565,   -407,   1818, -23004,   1110,    119,    256,   -707,
-  -451,   -679,    374,   -935,   -669,    403,    -10,   -594,
-  -525,   1403,  -1016,   -553,    595,   -169,   2523,    -82,
-   947,  11572,  -1166,  11668,  -4962,    842,   -860,     89,
- -3308,   -640,    558,   -851,    622,  -1002,  -4933,   2762,
-  1991,   -121,   1401,   -111,    -49,    868,    135,  -1392,
-  -279,   -560,    412,   -241,   1414,   -802,  -1256,   -298,
-   447,  17738,   -320,  -1150,   1650,   -398,   5626,   6076,
- -8919,    455,  12716,  -2094,    157,   1361,  -1515,   1494,
- -6210,   -553,  -1785,   -424,  -3049,  -4066,  -1188,   -732,
-  1992,  -1926,   1495,   1085, -22434,   1187,    391,  -1512,
-   747,   -313,   -502,   1331,    456,   -323,    246,   -581,
-    56,   1448,   2071,    535,    782,    520,   -136,   -290,
--12350, -11858,   -456,   2340,   -310,     22,   2210,  -2531,
-  -392,   -898,   3919,   1354,   -332,  -4255,    169,    425,
-  -476,   2577,  -1172,   1984,    266,    514,   -516,   2481,
-    81,   2103,   -710,    273,   1405, -14811,   5858,   3621,
-  -982,    345,   2044,    158,  -2050,   -602,    954,    342,
-   239,    157,   -317,    -35,   -260,    307, -31972,    228,
-   -77,    225,   -154,    643,   -883,   -518,     32,    372,
-   208, -22488,   -458,    530,    104,    254,   -775,  -1264,
-  -571,    900,   -263,   -323,   -296,    962,    520,    548,
- -2196,     42,   1408,   -211, -16117,   2052,  12656,   -822,
-   507,    321,   -772,   -786,   -144,  -3539,    892,  -3430,
-    19,  -1831,   1161,   1836,    988,  -1134,   -704,  -2994,
-   692,    765,    457,   1624,    502,     13,    364,    337,
- 32108,   1517,   -225,    189,    141,    985,   -572,    262,
-  -146,     31,    236,    269,   -278,  -1686, -13968,   1247,
- -1009,   1046,  13467,   1276,   -268,    307,  -1383,   1544,
-   136,    949,     70,    446,   1391,  -2188,    745,   -374,
--14231,   -712, -15202,   -533,   -108,  -2244,  -1232,    450,
-  -895,   1086,   -782,  -1082,   -718,   -660,    796,  -2095,
-  2722,   -468,  -1717,    147, -23566,    377,   -220,  -1731,
- -1416,    486,   -241,    266,   -802,   -322,   1066,   -544,
-  -167,    520,  -1297,   -100,    622,    670,   -188,    711,
-    32,   1155,    628,    350,   -112,   -154,  -1048,    -44,
-    36,   -454,    304,  32767,    356,    462,  -1194,    549,
-   138,      0,   1044,   -119,    195,   1098,    521,   3294,
- -3776,   -224,   4297,  -1256,   -303,   2107,    300, -13283,
-  2933,  -3194,  -1408,  -4152,   4195,    287,   -932,   1247,
- 13453,    277,    418,   -598,     87,   1132,    -80,   -405,
--13400,    656,  -1310,  -1447,  -3974,   1719,    313,    500,
-  1078,   -114,   1449,   -293,   -120,  -4754,   5583,    235,
- -5140,   -865,   -484,  15572,    336,  -1854,   -154,   -454,
- -1475,   -726,  -3718,  -4048,   1575,    480,   1094,  -2209,
- -3202,    420,   -564,    -48,    964,  -2667,   2172,  -1666,
-   112,   -730,    203,   3618, -15857,  -4853,     48,  -1084,
-  1512,   -937,   3353,   -453,    223,   2267,    139,    190,
-  1959,   -720,   4389,    681,  10383,   -112,  12390,   -882,
-  1695,   3539,   -169,   3131,   -122,   3627,    252,    185,
-  -523,    112,   -219,    214,   -182,   -102,    118,    230,
-   -60,   -801,    -25,     42,   -279,    262, -32358,    344,
-  -542,    382,   -223,   -404,   1201,  -2646,   -163,   -803,
-  3041,  -1009,   3818,    756,   5834,  14249,  -1828,    139,
-  -218,   -658,  -1314,  -4980,  -3322,  -1461,  -1598,    -91,
-  2464,   -954,  -5203,   -791,   1339, -13598,    594,    702,
-  -388,  -1115,  -2377,   -370,  -3658,  -3322,   1871,   2513,
-  2910,   4095,  -2195,   4291,    886,   -567,   1182,   -302,
-  -672,    -21,   -268, -29244,   -199,  -1024,  -1284,    485,
-  1432,  -1086,    119,   1030,    418,   -643,  -1165,   1847,
-   -30,   -844,   -909,   -416,   -604,   -609,   -289,   -391,
-  -238,    -94,   -391,   -810,    413,    356,    954,  -1935,
- 30996,    441,    138,   1381,   1130,  -2313,    558,   -203,
-  -248,   -951,    408,   1815,    256,   -429,   -892,   -695,
-  1138,    439,   -760,    -63,   6498,    570,  15252,  -3397,
-   170,    935,    338,      1,   -528,    524,   -541,   -281,
-    -3,    499,   -333,    685,    436,  32176,    389,   -153,
-   572,    256,     53,     16,   -902,    724,   2849,   2503,
-    80,    667,  -1867,    742,  15205,  -8715,  -2588,   -476,
-  -450,   -733,   -891,   1178,  -1751,  -1630,   -114,    144,
-  -138,  10145,   -188,  -1608,   -131,   -247,   -544,   9774,
-  -610,  -2868,  -3472,    345,  -9294,   3724,   2634,  -5124,
-  -392,   2551,   -649,    782,    -18,   -160,   -351,  12074,
- 13865,  -1294,   1262,  -3135,  -2861,     18,    753,    167,
-   620,  -2432,   1998,    740,   1902,    400,   -206,   3518,
- -3563,   -632,     72,  -1810,   1520,   -827,   -572,   1604,
-  -613,   3704,   -736,  11100,  12702,  -3189,   -792,  -3552,
-  1621,   1841,   1236,   1215,   -457,   9542,   9278,   2633,
- -8801,    862,   1741,  -4840,  -2620,    616,    324,   2152,
-  3632,    880,   -472,   1927,  -3456,  -2105,   -965,   3426,
- -1893,   3095,  -1152,  -3542,    182,    998,   -386,   1202,
-   481,  -1951,   -510,   -931,   1688,    151, -13664,  -3894,
-  -973,   -906,   1524,   9576,   2607,  12497,   -819,  -5214,
-  5936,   -634,   -610,  -4148,   -421,   -486,  -1864,   -306,
-  2421,    724,   -219,  -1304,  -2106,   -504,   6762,   5266
-},
-
-.cb1110l1 = {
- -2972,  -1201,  -1388,  -1762,    340,  21127,   -999,    126,
-   111,  -1224,  -1738,    311,   -712,   -450,   -114,   -648,
-  -752,   -172,     67,    375,   -967,  -1032, -10763,  -1885,
- -2223,  -3258,    480,   -228,   -143,  -1299,  13128,  -3062,
-  1418,      6,   -649,  -1816,   -288,    767,    345,    876,
-  -491,    948,    540,   -167,   1969,  -1883,   -455,  20584,
-  -656,    114,    308,    279,   1105,   -594,   1332,    255,
-  -356,   -186,   -540,   1898,   -873,   -477,   1404,  30475,
-   370,   -322,   -337,   -206,   -440,   -894,    -54,   -466,
-  -640,   -408,   -256,   -560,  -1503,    626,   -573,  -1684,
-   419,    407,   2076,   5022,   3143,  -1135, -12118, -12082,
- -1462,  -2060,  -5432,  -1092,   1575,   1958,   -968,    122,
-   958,  -5312,    677,  -1952, -12276,  -1594,   1211,  -1094,
-  1992, -11032,  -2993,   -834,  -1297,  -1139,    312,  -1546,
- -4253,   1191,     21,   2771,    639,  -2514,   6623,    746,
-  1830,   2967,   1688, -14893,   7988,   4099,    -97,   1165,
- -2350,     65,  -1308,   1834,  -2084,   1683,   5118,  -1633,
-   -10,  -5282,    403,  -1489,   -264,    398,  -2420,  12854,
- -1498,  -2642,  -1486,    826,    699,  -2213,  -2296,  11849,
-   478,  -2202,   -561,   -250,    199,  -2433,   -948,   -402,
-   433,    403,  13031,   -124,   -180,   1499,   -643,    527,
- 11368,   5833,    938,   3202,   -452,   2875,  -1163,   -117,
- -2047,  -1068,    211,   3122,   -236,  13548,   -702,    352,
-  -312,  -1901,  -2145,   2334, -12100,    -76,   -419,    362,
-  3501,   -220,  -3086,    572,   1537,   3240,  -1489,  -1012,
-   640,   -513,    930,    390,  31019,    724,    -78,   -706,
-   183,   -157,   -122,   -847,  -1156,    301,    508,   -456,
-   321,    317,   1300,   -512,  -1743,  10190,   -294,   -116,
-  4183,   1374,  13360,  -1339,   1832,   2547,   -702,  -2782,
- -1464,   1176,  -1287,   2256,   2169,    836,   2096,   -248,
-  1777,  11306,   -211,    265,  -3834,    336,   1936,   -586,
-   633,   1037,  -1915,  12862,    930,   -273,   2333,  -3239,
-   429,    374,   2518,   -671,    570,  -2208,    385,   -284,
--15613,  -1752,   1341,   -531,   -744,  -1111,    290,  -2302,
- -1012,  -2933,   -366,    -30,  -4595,   1400,    560,     48,
- 15739,   -945,    411,   1876,   2441,  -2144,  -1222,  12448,
-    54,   -726,  -2743,   2548,   2100,   1307,    408,   -198,
- -1802,    -63,  -1919,    933,   -329,   -528, -15918,   1704,
-  3028,    217,    606,  -2804,   2052,   9320,    592,    969,
-  6836,    647,   -671,    584,     -1,   3564,  -2575,    436,
- -2195,    414,   -201,   1099,   -772,   -220,   -578,   -467,
-   125,   -934,    271, -21476,    288,    215,    216,    476,
-  -560,    768,   1142,   -169,  -1112, -14096, -14436,   2769,
- -1464,    -61,   1373,  -3539,  -1067,   1175,  -1549,   -861,
-  -332,  -1876,   3159,    340,   1711,  -2453,    457,   2536,
-  1114,  -2278,   2464,  -3253,   -466,  12291,  12484,  -2868,
-  -800,   1142,  -4244,   -178,   3781,   1542,   -663,   1976,
-  3105,    145,   -100,  -1774,  -1039,   1627,  15540,   4194,
-  5392,    741,   1816,   -544,  -9100,   4255,  -1083,  -1266,
-  2580,  -4200,   1934,   1721,    129,   2276,  -2704,  -1341,
- -1310, -11926,  -1478,    199,    755,    619,   4231,   -478,
- -1627,  -1242,   1842,  13170,  -2416,    778,    192,    273,
-   782,    774,   2188,   -838,   3139,  -1532,  -1639,  -1073,
-  -596,    770,   -353,    -53,     82,   -322, -20584,   -344,
-  -443,    158,   -144,   -554,     50,    954,   -145,   -336,
- -2050,    596,   -950,  -2690,  13908, -13783,   4792,    879,
-   584,  -2987,    967,    192,   -585,   -783,  -1341,  -3108,
- -1622,   2478,  -1362,  -1470,  -1556,   -430,   -110,   -736,
- -8097,   2073,    964,   -417,   1669,  -5425,  -7846,    536,
- 12883,  -1690,   1143,   -242,   -438,  -2274,     57,    302,
-  -574,    637,   2816,  -1642,   2166,   -172,    893,    421,
-  -614,   -565,   -338,   -526,  -1085,   -939,  -1138,   -991,
-  1919,   1720, -18845,  -1950,   -342,   1930,    321,    184,
-  -956,   -374,   -462,   -216,     -6,     26,    386,    -50,
-   603,   -720,    634,   -252,    261,   -860,    218,  22846,
- 11544,   -459,   -946,    452,   -102,  -1203,  -1802,  -1105,
-  -310,    787,   -220,  -1113,  -2043,    650,  13767,  -3638,
-  -296,   -902,   -413,    252,   -816,   -172,   -505,  -1335,
-   890,    768,   -523,    808,   -331,  20000,   -264,   1763,
-   133,     -1,   -464,    949,   -954,   -147,   1780,   -190,
-    30,  -7422,  -4615,  -1006,   -470,   -742,    500,   7509,
-  1500,   1550,  -3614,    810,   2595,   1506, -12926,   3588,
-   402,  -2547,   1505,     65,      4,   3382,  -2201,  -2441,
- -1521,  -5450,  -3820,    282,   5212,   1186,  -1056,  -2334,
-   988,  12987,    390,   4141,  -2680,   1663,  -8034,  -1792,
-  -225,   -674,  -7147,  13254,   1631,  10163,  -3332,     -7,
-  -675,   -735,    772,  -2299,   -326,   1641,  -1174,  -1911,
-    82,    776,    891,   -445,  18590,    238,   1417,  -2372,
- -9718,  -2682,    600,  -1401,    604,  -1791,    -22,   1546,
- -1764,    525,  -1355,    348,   3260,   1115,    204,    524,
-   225, -12776,   -679, -15595,  -1188,   1078,     82,   -859,
-    28,    819,  -1220,    563,   2309,    331,  -1158,  -2010,
-  -264,   -383,   1732,   -424,  -2742,   -775,   -329,    132,
-   391,   1261,   1033,  -9812, -11829,   2433,   2690,    606,
- -2724,   7216,   -296,  -1834,  -1694,    456,  -4732,   -400,
- -3192,   1428,   -316, -13674,  -2702,   2320,  -6548,  -2025,
-  1222,   1749,   4005,   2924,  -3539,  -5104,  -2333,  -1438,
-  2598,     62,   -757,    760,    343,    154, -31947,   -534,
-  1296,    697,     88,    345,   -577,   -500,   -174,   -326,
-  -198,    272,    157,   -815,   -636,  -1163,   -867,   -273,
-  1054,    774,   1624,    989,    107,  -1088,   -673,   2143,
--22962,   -566,    151,     72,    -27,   1034,   -444,    501,
-  1905,  -1455,     21,    289, -10670,   -789,  -2421,  -2686,
-  -327,    804,  -3009,    907,    960,   1379,    -43,   -552,
-  2203,  -1406,   -911, -11094,   -529,   4458,  -4152,    -70,
-  3162, -12546,    326,    874,   1426,   3019,   2315,    104,
--12516,  -1591,  -2877,    772,   1982,   1160,  -4491,   3417,
- -1524,  -2139,    130,    930,   9359, -18308,   -376,   4090,
-  -468,    156,   -216,     60,   -643,  -3440,    256,   -835,
- -2389,   1660,   -542,  -1628,   4270,   3574,  -3136,    433,
-  1069,  30024,    561,    268,    790,    294,    207,  -1552,
-  -736,    -97,   -215,    -98,    690,    686,   -202,   -736,
-  -453,    655,    511,   -156,   1006,    361,   1424,  -1254,
-  -361,  -1253,  -1419,   -290,     78,    555,    565,   -488,
-  -923, -18193,   -630,   -908,    188,    925,  -1684,    241,
-  -319, -14478,  17007,  -1415,    274,    592,   1344,   1784,
-  -731,    344,    992,    141,    290,    481,    628,    623,
- -1166,  -2092,    140,  -1056,  13736,    754,   1980,   -238,
-  2132,  -1372,  -2216, -12057,  -1662,     66,   1742,   2209,
-  -962,  -1574,  -3044,    173,  -3066,    183,  -4476,  -1016,
-  6160,    780,  -1193,  -3334,    179,   -371,    244,    160,
-  -686,    669,    330,    426,     65,    159,   -664,   -186,
-   479,   -742,     54,    605,  32603,   -941,    370,    -91,
-   856,    825,   1042,    374,    651,    313,    734,   -240,
-   -49,   -685,  -1994,   -604,   -875,     44,   -884,    886,
- 13012,  -1506,  -4317,  -1926,   3050,  -1027,   -482,    -40,
-   137,  -2560,   1366, -11812,   2112,   2266,  -2690,  -1339,
-  -700,   -243,   2322,  -1042,   4635,  -3210,   4281,     47,
-   670,   9218,   1165,    814,    -62,  -2276,  12987,   -714,
-  2481,   1355,    896,   2840,  -1664,   2048,   -345,   2285,
-  1754,   -669,   2284,   -288,   -575,    944,  -1528,     44,
-  1071,   -706,   -543,  -1347,    880,    257,   1364,   1444,
--17896,     99,   1539,   1813,   -611,    355,  -2290,    980,
-  -787,    132,    300,   2353,    204,   -798,   -296,   -594,
-   895,    842,  18755,   1129,     79,   -189,    515,    882,
-  -286,    109,    305,    374,   1323,    861,    -18,    -78,
-   294,   -320,    674,    504,   -159,   -549,    -95, -32403,
-   -90,    658,   1082,   1611,   -137,    -74,   1160,   -794,
-   -55,    822,   2627,   1203,  -3540,   9829,  -7860,  -9063,
- -4015,   -894,  -2218,    729,   -879,  -1869,  -2446,   4050,
-  -488,  13211,   -290,   -820,    371,  14196,    866,   -891,
-   218,  -1838,   2162,   1144,   -186,    512,   1416,    546,
-  3298,  -1253,    128,   1202,    557,  -1967,    680,    545,
-  -139,  -3008,  18453,  -3322,   -137,    163,   1377,   1116,
-  2572,  -1577,  -1846,    651,  -1319,    796,   -862,    331,
-  4383,   2453,  -1894,   3264,  14137,    842,  -3087,   3740,
- -1100,  -2400,  -1364,   2406,    417,  -2393,   -868,  -3158,
- -9712,   3480,  -1403,   1896,    201,   1285,   -593, -11718,
-    99,   -539,   -186,     45,  -2266, -12228,  -2658,   2802,
- -1198,   1022,  -3840,   1401,  -1918,   1655,   1725,     96,
-  -205,   -913,   1629,    568,  -1285,   1264,  -1160,    594,
-   223,   -336,  -1436,   -472, -19792,    553,   1494,   -195,
-   570,    282,   -653,    -54,  -1115,    153,   -484,    141,
-  -188,   -278,   -173,    464,     13,   -634,    -42,    390,
-  -464,   -246,    622,   1229,   -692,  29175,   -574,   1150,
-  -135,   2685,   2452,     63,   -962,   -918,  -1657,  -1978,
-  -172,   -677,  -3414,   1345,  -3964,   2875,  -1412,   -654,
- -3000,  10739,  11348,  -2232,    516,   8303,   -189,   2564,
-  -150,   -373,    903,   -275,   2394,  -1135,    508,    424,
- -1704,  -2222,  -3789,   1938,    216, -12702,   2488,  -1364,
- -2175,   1114,   -819,  -2756,   1564,    952,     36,    609,
-  -933,  -1568,    110,    143,  -1575,  -4236,    528,  15042,
- -1920,    348,  -2623,   5217,   1911,  -1088,    259,   -590,
-   364,   2081,  -3585,    662,    249,   -119,   -111,    778,
-  2167,     11,   2500,   7182,  14452,   4388,   4121,   3623,
-  1598,    532,   -507,    877,   3830,    372,  -2184,  -2810,
- 11748,  -2095,  -1079,  -3070,   -768,   2901,  -3587,  -2572,
- 10008,    563,  -4588,   1026,   1117,   1879, -12004,   -416,
-   317,   2032,   1800,   1058,    -84,   -296,  -1748,   2588,
--11019,  -1627,  -3264,   2480,     96,   2146,  -2672,   2418
-},
-
-.cb1110s0 = {
--32746,    360,  -2774,   -672,  -1808,    -14,  -1037,  -1327,
-  1409,  -2215,    172,   1557,    945,   2031,   -702,   1844,
- -1106,    472,   2603,   -978,   2782,  -5691,   1473,  -5668,
-  7129,   6600,  -2160,    108,  -1844,   2062,  -2395,   -740,
-  1690,    -45,   -725,     77,   7236, -12903,  -3356,   -764,
-  1870,    720,  -2201,    790,   9950,  -3694,  -5340,  -4031,
-  4115,   6863,   2352,   1484,   3606,  -4855,    714,   4104,
-  6240,   7261,  -6855,   4919,  -2847,   6701,   7469,   -616,
--11442,  -1935,   9157,  -4072,    133,  -5976,   2455,  -9360,
- -2898,  -4353,  -7721,  -3098,  -3505,   2568,  -5432,   -576,
--10072,    250,   2173,  -4196,  -4322,   2688,   5220,  -6026,
-  -346,  11678,   2071,  -7344,  -2182,   -530,   -180,  -2568,
-  1524,  -1617,  -8825,  -4845,   2794,  -2813,  -2669,  -2423,
- -2709,  -8985,   2105,  -4629,    708,   2040,  -5680,  -2470,
- -7277,   6841,   6523,   4196,  -6788,  -1982,   3844,  -5000,
-   156,   1930,   1780,  -3824,   -286,   3908,   1703,   7304,
-  1145,    144,   1180,   7145,   3175, -13823,   6580,  -3066,
- -6321,  -9739,   4432,  -1145,   2923,  -2636,   3838,  -7037,
- -3913,   1262,  -1398,    363,   -141,   -886,  -5667,   -212,
- -2118,  -2717,   2724, -18802,  -2098,   -155,  -1399,    782,
-   797,    766,   2613,   5374,  -3767,  -1711,    624,    693,
-  2544,  -6153,   7179,   6835,   -762,   5061,    655,   2600,
-  9208,  -7030,   7047,   1654,  -3404,    176,  -5486,   1374,
--15378,   -487,   7456,  -1954,   2404,  -2994,  -1608,   2362,
-  -498,  -7952,  -6143,  -3996,   1596,  -3013,   1181,  -1534,
- -5265,    220,  -2677,   1047,  -4629, -15066,   3966,   -446,
--11713,  -5694,   -393,   -250,  -1336,  -7394,   1508,   6239,
-  3788,   6273,   6215,    822,   2657,   8057,   8391,   -658,
- -2561, -11587,  -2589,  -6702,  -9227,  -1016,  -2220,  -9702,
-  5988,   1859,  -6100,  -4594,    221,   2529,   2217,   8273,
-  1804,  -6128,  -2859,  -8259,  -4707,  -2494,   1913,   -352,
- -4561,   -289,  -1801,   -994,  -4445,  -1001,   5422,  10868,
- -7366,   1679,  -5195,  -6859,   2982,   -406,   2400,   4520,
- -3611,  -1892,   4900,  -3504,    771,   2774,   -772,  -1929,
- -7354,    375,    628,   4522,   1069,   -969,   8083,   -155,
-  3178,  -1138,   1752, -17288,   4390,  -2483,  -2071,  -1353,
- -1155,   -456,  -2683,   6798,  -1908,   1797,  -6657,  -2770,
-  5610, -14518,   5922,  -3964,   -938,   -853,   1416,  -1077,
- -4562,   -160,   5820,  -3031,   5091,   1987,  -2746,  -3779,
-   238,   -264,  -3074, -11718,   9370,   9806,  -6302,   3979,
- -2938,   4034,    393,  -1399,  -4466,   2181,    756,    394,
-  2264,  -3664,     78,    470,  -3228,   3942,  -1714,    708,
-  4988,   1938,  -2722,   4555,  -5054,  -1026,  19312,    354,
-   107,  -5357,  -4364,    597,  -2566,  -2812,  -2278,   -446,
-  1384,   -371,  -2566,   -388,  -3964,  -8989,   9136,   3389,
-  8440,  -5570,  -1262,  -5874,   2056,  -5973,   -185,   4540,
- -4924,    154,  -3653,  -1113,  -3048,   7099,  -2734,   2940,
- -6704,   1543,  -8120,  10134,  -9485,  -6645,   4816,   -442,
-   -32,  -2430,   4932,  -6129,  -5050,   6120,  -2147,  -6910,
- -1342,   1075,  -2458,     50,  -4747,  -3080,   1886,   1490,
- 18972,     48,    787,   2441,   -405,   1668,  -1399,   2202,
-  2175,  -3592,   1548,  -2728,  -4864,    504,    383,    376,
- -1073,   2142,    504,  -3114,   6378,  -5516,  13462,    196,
-  1840,   7087,    792,  -3583,    302,   1012,  -5504,    270,
-  3354,  -4486,  -2312,  -2522,  -2872,  -3899,  -2261,   5211,
-  1417,  -3075,   -151,   -985,   -772,  -1630,    164,    659,
-  1496,   -349,   -621,    -32,  -2982,  -1720,  -3475,  -7370,
- -1541,   1122,  20474,   1726,   4474,  -3228,   7024,   3265,
-   522,  -2193,  -2113,   5388,   1912,   5929,  11768,  -1162,
-  2600,   4048,    652,   3360,  -3215,    376,  10028,   6054,
- -3814,  -1155,     93,   4512,  -3581,  -4037,   7484,  -1481,
-  2797,   2635, -12275,  -2780,  -6235,   5739,   2687,    376,
-  5984,  -2547,  -8834,   4332,   2752,   1942,   1002,  -3312,
-  5251,    -86,  -7794,    918,  -2413,   3131,  -3316,   2095,
- -4569, -15382,  -5534,   1290,   5179,   2928,   3034,   2365,
-   270,  -7476,  -3024,   6910,   1355,  -6262,  -2040,  10490,
-  1432,  12284,   1125,  -3160,   4518,    973,  -2351,  -1726,
-  1967,   1488,    382,   3559,  -3742,  -2908,   -944,  -1662,
-   682,    902,  -4360,   5026,  -4252,  -1212,  -3269,  -6024,
- -3788,   9128,  -2638,  -1625,    315,   3087,  -3265, -10441,
- -7207,  -4078,  -3266,  -7543,  -5223,   5460,   2496,  -9258,
-  -227,   4048,    860,   -520,  13616,  -3458,   3837,    809,
-  -104,  -4062,  -4846,   -136,  -1631,  13977,  -1136,   3380,
-  1099,  -4022,   1831,   3360,  -9034,    -52,   -516,  10144,
-  5074,   4866,   8282,   -972,   2496,   2336,   8766,   2881,
-  2417,  -5588,   3064,   3934,  -4202,    627,   -986,   1750,
-   958,  -2348,   5006,  -2597,    -90,    133,  23271,   2431,
- -3984,   1894,  -2094,  -1816,   5007,  -3164,   2526,  -1862,
-  2651,   1809,   7173,   3410,    154,  14930,   3032,  -5314,
-    44,   8868,   -543,  -2158,   5341,    258,  -8188,   3772,
-  2804,   7544,   8339,  -3560,    -63,   -735,   1300,  -4308,
- -1085,  -4986,   1564,  -6744,  -2605,   -310,   1275,   1166,
-  -640,   4814,   4373,   3103,  -1242,   6049,  -4786,    597,
-   182,   2371,   6950,  -2265,    389, -14669,  -1942,  -2733,
-  -485,   -865,   -597,  -1376,   1626,  -3956,  -1244,   1532,
-  3918,  -3311,   1574,    -88, -20573,  -5471,    -71,  -1731,
-  1436,   2428,   3982,  -4576,   -914,   5460,  -4973,   1650,
- -2364,  -2486,   3212,   5424,  -2501,   4595,   -937,    728,
- -5140,  -9948,   1437,  10560,  -5704,   -264,  -2752,    949,
-  5229,  -1445,    430,    827,   4103,  -1999,  -4625,  -4171,
- -8769,  -8927,   7161,   4539,   6968,   5975,  -4626,  -2793,
- 10080, -10386,  -2479,   1724,   2992,    354,   3650,   3328,
-  4490,  -1931,   7348,   7283,  -3304,   4446,  -1698,  -1224,
- -3002,   4340,   1041,    607,   -454,  -4261, -18071,  -1199,
- -3902,    570,   5808,   5582,   6710,    235,   -205,  -4288,
-  3472,   -686,   -103,  -3658,   -436,  -9680,   -190,    275,
-  -919,   2522,  -2087,   9096,   5060,  -6450,  10282,   3344,
- -8167,  -7688,  11881,   3101,  -1280,  -9942, -11741,   2213,
-   712,   3976,  -4218,  -5285,   2797,   2996,   4006,   2053,
-  2344,   6200,    141,   2616,  -3981,   6970,  -4194,  -1621,
--13724,   7772,   2800,   2220,    445,   -266,   4030,    444,
-  -228,   2642,   1617,  -2511,   1699,   8740,   3438,  -2063,
- -2093,   1806,    950,  -7112,  -1513,  -2886,  -8789,    870,
-  3456,  -4126,  -3330,    541, -10173,  -1789,   3156,   4466,
- -5965,    479,   5177,  -2806,   2506,  -1646,  -3609,   1617,
- -7373,  -3146,  -2389,   3601,   7850,     89,  -3373,   4670,
- -4180,  -3186,   3056,  -1691,   1314,   9234,  -7799,   1323,
- -4360,  -9866,  -1930,   8091, -13452,   8503,   1980,  11247,
-  7688,  -5953,  -4165,  -3192,    540,   1631,    131,   2250,
-  5330,   -146,  -8724,  -3148,   2834,   1148,  -3886,    374,
- -1836,  -3898,   9649,   1119,  10221,    128,   8868,  -7301,
-  2601,   1252,   2340,  -3789,   4682,    181,   4434,  -1740,
-  4368,    879,   -620,   2046,   1842,    844,   -925,  -2506,
- -3344,  -8820,   -722,   -451,    521,    903,  -1286,  -3059,
- -5308,  -4759,  -2706,  -1429,   2762,    927,  -1459,  -7274,
--12028,   8838,   3987,   2406,   8626,  -3128,   6505,  -4322,
-  -197,  -2464,   2738,    -46,    161,  13919,   2252,   2059,
-   981,    204,   1161,   4910,    683,  -4311,   2081,  -1932,
-  1119,  -6067,  -5325,   8528,  -4704,  -5522,  -6183,   5744,
- -3407,  -2021,   2688,  -3230,   2490,   -976,   -500,  -7834,
-  2064,   3191,   4740,   3686,   1762,   2604,  -2442,  -5720,
- -7550,    457,  -3478,  -8097,  -6510,  -9105,   8031,  -4895,
-   500,  -2436,   1483,  -4415,  -2023,  -3768,  -2497,  -1911,
-   789,    566,   -969,  -4204,   6128,  -5076,   2664,  -4222,
-  6755,   1774,   6881,     64,   1205,  -9243,   4782,   4432,
-  5193,  -2258,  -4787,  -7433,   1755,   -794,   1297,  -7535,
- 12773,   9124,    806,   2348,  -8112,   7874,  -4348,  -1410,
-  -350,  -2528,    576,    661,    272,   4598,    691,   1913,
- -3349,  -1881,  -1854,   -779,   -821,   8444,     60,   2570,
- -1813,  -1354,  -4512,  -5471,   4728,   3289,   2617,  -9326,
- -6670,   -859,  -2713,  -9839,   4676,  -2657,   3106,  -1393,
- 10278,  -3069,  -2253,   1015,   2246,  -2227,     16,   -388,
-  7962,   1493,  -3122,  -2707,   7982,  -6106,  -1462,  -1665,
- -1302,   2347,   3640, -15122,  -2211,    417,   6819,    959,
- -2876,  -6868,  11060,  -2329,   -302,   1595,  -4610,   9514,
- 12677,  -4614,  -2899,   -141,  -4857,   1447,   6400,  -2894,
-  1696,  -2888,   1889,   3489,   2775,   -504,  -6597,  -5258,
- -7256,   -379,  -1249,   -136,   3118,  -3537,   3295,  -3458,
-  2103,   -399,  15281,   -222,  -1809,    172,   2257,   1947,
-   707,   3562,  -5691,   3575,  -2210,   5750,    815,   4059,
-   -16,   1306, -13308,  -1733,  -1338,  -3477,   5247,  -1950,
- -5148,   -678,   8074,   1740,    290,   2033,   4639,  -4240,
-  -536,  -5214,  -1366,   2491,    501,    -59,  -4480,    430,
-  -285,  -5947,   -755, -14559,   5696,   6960,   4462,   2317,
-  6414, -13174,   4962,   -899,   5924,  11100,   5303,   -970,
- -2528,  -6239,   2253,   2236,    553,    458,  -2229,   8016,
- -7082,   2869,  -4209,  -4460,  -6536,   3557,  -1766,   7815,
-  -655,  -6029,  -5250,  -1627,   2646,  -3466,  -3584,    901,
- 10305,   -895,   -427,    949,  -2776,   3436,    769,  -4131,
-  9019,  -4898,  -3562,  -7978,   -359,   1358,  -1528,  -3095,
-  5840,  -6214,   2591,  -2086,   9480,    640,   2858,    216,
- -3625,   5740,  -7008,  -1097,  -2091,   -143,   4832,   6210,
- -1358,   3998,   -714,    835,  -4004,   3664,   1980,   1240,
-  2902,    510,  -1565,    427,  -2052,  -4208,  -1505,   1187,
- -1229,   3732,   -932,  -1014,   4784,  18474,  -5111,   3047,
-   -54,  -1547,  -3892,   8612,    274,   1446,  -3548,  -7689,
-  -423,   1192,  -4508, -10403,  -8735,   -446,    444,  -6353,
-  4008,  -1462,  -8906,  -1161,  -2395,   2442,   2204,  -5472,
--17376,   2471,   -689,   1394,  -3657,  -2119,   -769,   2872,
-  1393,  -2701,  -3536,   3650,   -378,    859,  -3338,   1412,
-  3010,  -3243,   -335,  -3619,   -511,  -1931,  -7126,  -5018,
- -9332,  -4440,   1906,  -2265,   1386,   8072,  -6576,  -1300,
-  5458,  -4894,    630,  -7146,   2263,    810,   2968,   1124,
- -2219,   2292,  -3914,  -1836,  -6683,   1511,  -2755,   1396,
-  2425, -23842,   2249,    -53,   -891,  -1678,  -1766,  -1788,
-   502,  -4210,    211,  10376,  -5507,    837,  -6196,   2132,
-  -472, -10153,   7234,  -1456,   -148,   4886,   2427,   2371,
-  1234,   -962,   6298,   1016,   1735,   -566,   -878,  -8071
-},
-
-.cb1110s1 = {
-  2525,  12164,   4861,   9505,  -7371,   -414,   3002,    576,
-  -347,   -998,   2861,   -804,   3034,    810,   -788,   -539,
- -2092,   4970,   1828,  -2869,  -2802,   6649,   3673,   -193,
- -4034,    722,   1642,   3792,   8770,  10428,  -3303,  -3849,
- -4520,   -234,  -4190,  -1219,  -1300,  -4128,   8384,  -1150,
-  1578,  -6174,  -1072,  -4871,  -8180,  -6698,   3806,  -7386,
- -2545,   1052,   -550,  -1148,  -1308,  -8834,  -2654,   1982,
-  8716,   6579,   1360,  -2404,   1893,   2680,   3801,  11097,
-  1455,   2453,  -7585,  -7503, -12710,   -420,   2023,   -656,
-  1124,   2872,   9676,  -4309,   -202,   1458,  -6526,   -534,
- -1535,    924,   3068,  -1142,   5073,   1284,  -5632,    869,
- -1637,  -2898,   4900, -10202, -10488,  -1097,   1890,  11006,
-   -44,   1368,  -1979,   6507,    316,    961,      8,  -4085,
-  2561,  -2034,  -1077,   2594,   -465,  -5134,   -868,     54,
- -6694,   9608,  -3516,   7165,  11011,   9542,   4780,  -2800,
- -1130,  -1714,  -2684,   -369,   4746,  -2688,   4146,  -7652,
-   984,  -3263,   -276,  -9134,  -2848,  -3983,   9994,   3608,
-  3234,   -596,    263,   3102,   -178,  -2264,   3820,  -4293,
- -5752,  -3577,  -3914,   1095,  -1562,  22110,   4610,     69,
- -2999,    254,   2178,  -2901,  -1203,  -1292,   2642,  -3254,
- -1389,   2955,   1340,    542,    810,   1369,   3208,   -795,
- -3272,  -2717,  -1129,   8781,  -6854,  -3028,   -616,    729,
-   529,  -6946,   1621,   9574, -14909,   5398,    854,   -774,
- -9978,  -5417,  -2516,  -4683,   5715,    -66,   3336,  -5040,
-   640,  -7566,   3494,   7016,  -2269,   1376, -13994,   6448,
- -3948,  -1697,  -3988,  -6559,   2376,   4231,  -3131,   2045,
- -2417,  -5919,  -7016,  -1695,   9046,  -7966,   5187,  -2553,
-  1402,  -2351,   -220,   5931,  -1823,  -2270,    584,  -3784,
-  2924,   6166,  -3035,   2370,   4923,  -1080,    682,  -7899,
--10827,  -1824,   -908,   1568,  -3565,   4033,  -4266,  -1948,
-   923,   5488,   -203,  -2396,   -907,   2783,  -3278,   1415,
-  7710,   -190,  -5208,  -2279,   1266,  -1132,  -3392,  10251,
- -1064,  11283,   2162,   2213,  -5088,   4479,  -4658,  -1803,
-  1534,  -4233,  -4073,   6938,   3966,  -4878,   -332,   5961,
-  9217,    488,   6520,   4430,   7988,   9383,  -2586,   1206,
- -6983,   -873,   1251,   1849,   5945,  -2144,  -2032,  -1852,
-   416,   3720,   2419,   8462,   3173,  11524,  -2894,  -5517,
-  -211,  17830,   3170,   1098,   -721,  -2066,  -1956,  -3097,
- -1061,   2815,    447,    701,    449,   -485,   2609,   1239,
-  2257,  -1760,   3091,   7538,   3710,  -2689,  -3092,   6903,
- -2457,   3271,   6355,  -1486,   -828,   1994,  -3575,   3949,
-  3185,   2606,  -4912, -16039,  -8833,   1831,   2580,   1993,
- -1117,  -3408,  -7590,  -7278,   -141,   2696,    805,   1896,
-   308,    378,   9308,   2894,  -4324,   1042,    837,   4716,
- -4702,   2493,  -5173,   8616,   -468, -14829,   3759,   3251,
- -4237,  -1340,   5224,   2099,   -764,  -8263,  -1699,     76,
- -1464,   2115,   -582,   3286,  -3653,   1017,   1696,  -1414,
-  -668,  -9748,  -5730,   2413,  -1270,  -6070,  17002,   2164,
- -5440,   1801,  -2123,    800,   2135,   4801,   -887,  -2141,
-  -647,  -4846,   -463,   -577,  -1846,   -555,  -1929,   2046,
-  8272,  -8399,   3886,  -5950,  -4202, -12600,  -2805,    477,
-    65,   6140,   1089,  -4737,   8967,   1952,  -1968,  -3660,
-  6641,    850,  -3304,  -1775,   4010,  10819,  14365,   -696,
- -1331,  -1724,   -237,  -3611,    244,   3005,   4349,   -182,
- -4124,   2466,   2746,    -61,   3391,  -1392,   3788,   1582,
-  3723,   7140,  -2207,  -3678,  -2675,   -252,  -7476,   9426,
- -6196,   3226,   3554,  -6326,  -4284,   6346,  -4432,   5199,
- -2633,  -2499,   1200,  -1140,  -3910,   6624,  16732,   5946,
-  -766,   2630,  -1200,   1988,   5510,  -1199,   4126,   1287,
-   454,  -1795,   2664,   5001,   1058,    500,   -437,   2992,
- -2012,   -160,    796,  -4846,  -6572, -10088,    603,    483,
- -4510, -12799,   3502,  -1784,   3510,  -3956,   6038,   9044,
- -6029,   7170,  -1608,    120,    914,   -200,   3939,  -6274,
-  3020,   6235,  -2754,   5368,  -1693,  -6028,    386,  -2006,
-  1898, -11704,  -9973,   -525,  -2624,   1799,   4140,   3248,
-   -57,  -3731,   3764,   5582,  -3830,  -2484,  -2066,   1517,
-  -900,  -8250,  -8191,   2676,   1147,   6752,   6908,   1196,
- -2634,   3408,   2980,  -1042,   3971,    632,  -4946,  -5690,
-   133,   2445,   -446,  -1294,   -777,   3356,  -5628,  -6020,
- -8042,   5069,  -1421,  -2701, -15117,   3074,   -912,  -2574,
-  2643,   5252,  -2118,   3849,  -3793,   -850,   4170,   6240,
-  -697,   6976,  -3752,   1155,   7769,  -8912,  -7728,   4224,
- -2362,  -3760,   3688,   2402,  -3411,  -3165,  -2550,     -8,
-  -209,   -334,   -837,   5688,   3425,  -4564,   9999,  -4780,
-  3093,   4346,  -5556,   1636,   1755, -14696,   1810,   6547,
-   -60,   4054,  10539,   6118,  -4414,   1760,   3581,   -841,
-  4471,    -23,    180,    259,  -4439, -13230,  -1326,   1913,
-  -621,  -1641,  -2882,  -4934,    516,  -3886,  -4468,   -110,
- -4526,  -5157,   7550,  -4449,    813,  -4364,   1768,  -8829,
-  2003,  -1372,   1873,   -209,   1539,   1076, -12408,  -1464,
- -1878,   1563,   2020,    704,   1425,   -275,  -3718,   4618,
- -1120,  -5057,  -3590,   4022,  -1977,    620,    143,  -2507,
-  3697,  -3263,    616,  -3002,  -3347,  21051,  -4398,    364,
- -1924,    284,  -2724,  -2297,   4916,   2702,   4866,   4293,
- -2781,   1094,  -1525,   -562,   5487,  -2098,   4658,   1362,
-  -597,  -3426,   3173,  -5174,   3922,  -3844,   1482,   4711,
-  5853,   1490,   5499, -17537,    956,    544,    268,  -4782,
-  -504,  -4003,   -911,    599,   1746,  -7322,   1907,   1990,
- 16985,   3171,  -2645,   1040,  -7239,   5618,    304,   3606,
- -3377,   3630,   7319,    108,   -496,   1026,   3062,   -392,
-  2366,   1948,   -530,    806,   2700,  -2676,  -2717,   5238,
--16008,   -823,   -264,  -1560,  -1014,   -760,  -3684,   -330,
-  5644,  -1668, -10239,  -2583,   7411,   -593,   2193,  -1479,
- -2892,   3834,  -3625, -12234,  -1103,   1868,  -5121,   3879,
-  2748,   1936,   2026,   4572,  -6037,   3310,  -8678,  11724,
-  5290,  -2316,   4131,    834,  -3915,    869,  -1734,  -5752,
-  1255,   9534,  -3625,   -115,  -5912,   -125,   2298,  -1494,
-  5910,   -496,  -2719,   1320,   3175,  -3012,  -3906,   4602,
- -4760,  -5918,  -2568,   6632,  -8802,  -5876,   6358,   2349,
-   207,   5191,   8369,  -5932,   2710,   7950,   3673,  -2592,
-  1311,   8384,  -4360,   8614,  -5662,   1180,   2147,   1044,
-  1591,  -5555,  -1597,   4418,     38,  -1579,   4675,  -1725,
- -1693,  -6470,   3066,  -7601, -12822,    524,  -2986,  -3406,
-  8860,  -1266,   -930,   4316,   1171,  -2908,    199,  -1785,
- -2851,  -3588,   3072,  -3585,  -2668,  -1123,   1508,    460,
-  6780, -19480,   2854,  -1574,   1004,   5074,   1907,  -1988,
-  1177,     74,  -1436,   2224,   1232,  -3008,  -3454,   -862,
-   604,   -653,   2778,   2349,   3242,   8426,   -430,   3684,
-  4814,  -1886,   5118,   1487,    442,  -2322,   -900,  -2854,
-  -234, -10350,  -7922,   -745,  -1490,  -5638,  -6014,  -4079,
- -2979,   -351,   9493,  -2274, -11362,  -8166,  -7364,   8261,
-  1554,  -1722,   4651,   -831,   2276,   1502,   2600,   1266,
-  4456,  -4145,  -3837,  -3584,   4242,   4058,  -2395,  -6971,
-  4486,   3233,   6226,   1306, -11506,  -6223,  -5132,   1537,
- -4407,   1510,   5732,   2808,   5817,  -4972,  -2900,    897,
- -2441,  -1819,   5651,  -6988, -10063,  -2288,  -5820,  -1250,
-   925,   3120,   6125,  -9901,   -137,   3684,  -6601,   1077,
-  3272,     21,   3341,   -838,  -3643,  -1727,  -4417,    660,
- -6551,   -184,  -8125,  -1780,   5232,   6077,  -7968,   6423,
-  3823,   3026,   4555,    464,   3318,  -5504,    837,  -3571,
-  3853,  -2277,  -1864,   -742,  -5380,   6096,   6856,   1076,
-   877,   -642,   1926,  -4712, -14482,  -3323,  -2672,   7485,
- -2116,  -3932,   2233,  -3270,    326,   2221,    132,  -1893,
-  -748,    453,   3597,  -2308,  -4371,   5632,   3609,  -1033,
-  -444,  -2591,  17359,  -3120,  -2604,   3157,   -370,   9242,
- -1606,   2675,   -853,   1475,   -416,  -3280,  -1159,    191,
- -3670,    282,   4282,   -957,  -2978,   3564,     91, -20520,
- -3046,   1248,   1277,   3368,   1118,    311,   -598,   1406,
- -2377,  -1444,   1417,  -3626,    167,  -6440,   3341,    629,
- -2523,   4398,  -1187,   4322,   -383,   1934,  -3298,  -8530,
-  2195,   5220,    510,  -1256,  -6932,  -1061,   5141, -16242,
- -1390,   -546,  -3760,  -2029,   -929,  -6044,  -3503,    312,
-  8478,    701,   8865,   4715,   1987,   1342,   1400,    -71,
- -5229,  -1547,  -8827,   2349,  12836,  -1479,   4621,   6003,
- -6749,  -3184,  -5667,  -2930,  -1074,   3204,    330,   4692,
-  2872, -10808,     75,  -1260,  18003,   4100,  -1462,   1391,
- -1667,  -2039,   -687,  -4806,   5913,   2682,   7730,   7034,
-  2703,   1666,    120,   1601,   2123,   1402,  -4702, -11229,
-  7875,  -5591,   4634,  -2274,   3015,   -597,  -7520,  -1095,
- -4814,   -173,   5562,   1533,   2807,   8466,   5195,   7806,
-  2585,  -2877,   6938,  -3942,    402,  -3825,   4162,   9149,
- -6423,   2447,   7041,   2932,  -9813,   2124,    -58,     -3,
--12856,  -7973,   1484,    907,    180,   8042,  -2124,   4356,
- -4117,   1126,  -9706,  -2101,   3957,  -1877,   1139,   7148,
-  3707,  -1341,   4509,  -1220,   4570,  -1650,  -6504,   7036,
--10268,   -328,   4678, -12205,   5062,   6089,   -496,  -7740,
-  2207,   4489,   -205,   1386,  -2695,  -1442,   4730,    892,
- 12061,   3818,  -3305,   4431,   9300,   3470,   4608,   4315,
-   892,    866,  -1714,   1529,   2569, -11398,  -3068,   -282,
-  1626,    587,  -1568,  -1630,   -220,  -2033,   7141,  -2732,
- -3541,   3404,  15514,   1883,  -2697,   -926,   5972,   6485,
- -6794,   2111,   2490,   1201,   5467,  -2352,   3264,    -97,
-  2400,   -728,  -3364,   3417,   1481,   2862,    462,   2855,
- -5233,   5740,   7208, -10508,  -3254,   1450,  -1270,   -293,
-  3400,  -6978,  10035,  -1213,   4308,   2641,   8579,   8518,
- -2919,   -351,   -459,  -2069,   -617,    638,  -1347,    107,
-  6009,   2035,   -280,   2009,   3280,  -1236, -14960,  -5177,
- -2440,    965,  -2646,  -2095,   5274,   1825,   3705,   3831,
-  -446,  -4018,   7178,  -2415,   4344,   1850,   -509,   -500,
-  1056,  -4374,   5709,   1336,   3352,   7915,  -2302,  12209,
--14362,   6429,   1423,   2912,   6474,  -1599,   1116,   2280,
- -1738,   3108,  -5792,  -3554,    623,  -1110,  -6114,   4488,
-  8941,  -3176,  13670,  -3320,   -327,  -2657,  -7349,   3782,
- -1481,   5737,   -200,   2968,  -9474,   5752,   5056,   4688,
- -5352,   -432,   -906,  -3832,  -8519,     -7,   3667,   3583,
-  6250,   8724,  10737,   9371,    950,  -1630, -10740,   5788,
-  4111,  -2910,    437,  -2482,   1910,    185,  -2168,  -3155,
- -3515,  -1754,   4978,   4298,  -6921,    476,  -2778,    546
-},
-
-.cb1110m0 = {
-  3666,  -1078,   -175,   1370,   2491, -10050,   -685,  -7617,
-  4002,  11104,    903,   5948,   2821,   3050,  -2465,   1151,
-  -848,  -2139,  12321,  -1408,  -1469,   2046,  -2693,   2479,
- -3498,   3077,  -3822,   1841,  -2404, -11172,   -407,  -3062,
- -1725,  -5475,    597,   1924,   -197,    434,  -1648,   2678,
- -2462,   1148,    599,   1284, -13171,   -949,  -6508,    754,
-  7466,   5924,   1411,   -536,  10825,    588,    297,   -310,
-  -593,   -896,    784,   -242,    716,    501,    -52,   4043,
-  -755,   -690,   2630,  17762,  -2159,   2126,    954,  -1316,
- 11129,   1570,    387,  -2639,  13953,   -311,   5231,  -2297,
- -3612,   -678,  -1117,    690,   -279,   2403,  -1541,    493,
- -1692,  -2048,   -771,   -933,    423,    700,    840,    739,
-  1956,   -944,    612,  -2678,    101,    245,   -786,    850,
-   269,   1355,  21773,    463,  -2589,    596,   -519,    788,
-   -43,   1220,  10674,   4847,   1192,    335,    875,   -106,
- 10644,   2600,   5391,   -262,   2296,  -5928,  -1072,   -122,
-  2504,   1313,   1117,   -981,    350,    375,   -810,      8,
-  1462,  -2020,  -2368,      8,  22663,   1537,     87,    908,
-   832,  -4884,    312,    620,   1042,  -4444,    660,   1582,
- -2710,  -2954,  10012,  -9580,   8102,   5696,  -1371,  -3035,
- -3347,    402,    218,   1096,  -1924,     88,  -2270,   4175,
- -1083,   -497,  -2437,  -3332,   -824,    212,  -2362,   4600,
- -7800, -11501,   7795,    236,  -1336, -12920,    705,   4532,
- -1488,  11746,  -3213,  -2650,   2524,  -2638,   -128,   -328,
-  3402,    453,   -242,  -2500,   2224,    708,    450,  -3014,
-  -132,   1251,   -131,   -831,   -710, -21985,    222,  -2132,
- -3261,    490,  -3020,   -860,   2550,    892,   -623,  -3666,
-  -664,   -131,   2018,   2817, -12005,    496,   -610,  -7238,
- -3909,  -2867,   6872,   1903,    848,   6644,   3812,  -5686,
- -4055,   -377,  -2096, -10247,  -1068,   1486,    415,   -253,
- -2186,   1050,    771,  -6856,   1044,   7466,   2953,  -7514,
-  1601,   7015,  -1778,  -1622,  -3364,  -1755,   2835,    176,
-  2700,    991,   2560,   -554,   4867,   1571,  -5610,   2610,
- 12438,  -3751,  -9964,  -2753,   4856,  -2595,  -5423,  10025,
-   812,    687,   2715,   4013,   3086, -12039,    328,  -3992,
-  4044,  -3920,   -111,   -553,  -1720,   2454,   1706,  -1365,
-   804, -32329,   -471,    897,  -4670,    780,  -3680,  -1409,
- -2630,     20,    184,   -157,   -290,   2794,   -546,   -160,
-  1564,   1146,    628,  -4787,   -239,  11233,   -492,   1955,
-   608,   9273,  -3220,   3830,    390,  -5982,  -3342,  -3384,
-  2356,   1820,  -3473,    979,    -40, -20190,     47,   -200,
-  5106,   -381,   1824,   -197,   2280,   2434,  -2633,  -1409,
- -1109,  -1072,    857,   1554,   7459,      6,  12130,  -1078,
-  1038,   -300, -13748,   3201,   -762,   2670,  -1051,   -445,
-   914,   -172,   -558,   2634,  -1158,   3129,    -74,  -3415,
-  1086,  -8892,    118,   -647,    285,    186,   3022,  -5077,
-  1342,   3453,  -7991,    -65,   4690,    944,   3717,  -1909,
- -9783,   -367,  -1699,   -772, -32768,   1286,   -408,    340,
-  -340,    430,   1274,    596,   -109,   -727,    276,   -946,
-   139,   1804,  -1050,  -3562,  -1392,  -1179,    257,   1639,
- 25708,   2278,   2415,   2174,    153,    126,    -60,    592,
-   994,   -334,   -268,   1826,   -306,  -2241,   2774,  -3188,
-   758,   -450,   8023,    542,   6819,  -1712,  14195,  -2198,
-   281,    -12,   -590,  -1153,   4568,  -3676,   1973,  -5221,
- -1839,   -603,   3324,   2492,  -3070,   -846,    123,  -1184,
-   667, -10886,    -65,  -2615,    971,  10219,  -1245,   7378,
- -2122,  -2306,    571,  -2298,   1958,  -4356,  -9210,   4321,
-  2805,   1888,  11129,   1282,  -5819,  -2528,   -873,   1123,
- -5968,  -2644,  -5515,  -2151,   -944,  -7712,  -2007,  -2260,
- -1920,   2100,   -325,    153,   1050,     10,   1462,    650,
--12559,   3530,    754,   4493,   1528,  -6991,  -4842,   1483,
- -2408,   2785,  -1651,   -830,   1433,  -2464,  18899,  -1891,
- -3137,    996,   2485,   3056,  -1061,  -4015,  -2282,   1356,
- -2572,   -490,   1209,   1137,      4,   -636,  -1282,   1001,
- -1190,   -172, -14049,  -4256,  -1972,   2225,  -4738,  -1054,
-  5254,   8113,   4294,     36,  11765,  -3993,  -1084,   3864,
- -3016, -10356,    353,   2963,  -1228,    536,    609,   -343,
-  1246,   3617,  -3667,   4794, -20360,    473,    725,  -1246,
- -1649,   1900,  -2589,  -2869,  -2550,   -886,  -1164,  -1876,
-   307,   3784,  -4782,   -476,   -700,   2118,  -1860,   1533,
- -5013,   2356,   3305,   3338, -14312,  -1278,   -322,   1950,
-  -954,  -1990,   1438,   3358,   7479,   3046,  -6677,  -3078,
-  1717,   3113, -12484,  -1302,   -221,   -510,  10423,  -3497,
-  4170,  -3606,   6983,  -2902,    458,    667,    566,   2415,
-  -403,  -2898,    -44,  -1832,   -110,   1799,   1172,      7,
- -1534,     90,    686, -26902,   1601,   -822,    658,    182,
-  -151,    345,   1488,   1416,   -272,   1560,   9774,   2084,
-    16, -14344,   1428,    514,   2658,  -1312,   2095,    454,
- -1783,  -2056,   4529,   1154,  -2239,    956,    668,  -1396,
- -2898,    405, -12659, -12556,   -650,   -587,   3461,  -2470,
-     0,  -3156,   3186,  -4104,   1729,   1438,  -1842,   -422,
-  4476,   1945,   -932,  -1439,   -702,  -1398,   3349,   1876,
-  -999,  -2086, -17879,   -432,   4036,  -2299,   1133,     88,
- -2221,  -2730,   -938,   -998,   -132,   -426,   2084,   2060,
- -1134,   -313,    402,   -538,  -2593,   2022,    725,   1566,
- -2070,  21622,   1767,   -424, -32672,    205,  -1239,  -3253,
-   198,  -1257,   2342,  -1918,   1505,    452,   1348,   -604,
-   978,   1079,     -4,   2476,  -1247,   -146,   -861,  -1928,
--12222, -13042,  -1384,  -1971,  -1428,   1224,   -639,    -83,
-  1034,   3488,  -2310,   -565,     74,   -335,   2774,    602,
-   872,  -2132,   -147,   2160,    244,    162,  12600,    628,
--10194,  -1296,   1068,  -1824,  -4945,   3194,   2066,   -895,
-  -784,   2347,  -1982,     73,   1030,  12589,    -62,  -2272,
-  3827,  -1776,   2546,  -1417,   3310,   4726,  -3078,   -548,
- -8522,   1632,  -6667,   1008,   1128,    805,    954,    616,
-   499, -31526,  -1327,    790,   -190,   1058,  -1157,   1432,
-   -16,    411,  -3180,    827,    327,    914,   1716,   1442,
-  1052,  -1635,  -1805,  -4145, -13678,   3597,  -2273,  -5920,
-  3592,   1136,   -211,    717,   3901,  -5132,   3036,   -601,
- 12976,   1633,  10316,  -1674,   -468,    905,   2331,    841,
-  -247,  -6053,   -593,  -3281,   4291,   5159,  -1053,  -1814,
-  2613,   2221,   1146,    871,   -421,   -542,    923,  -3567,
- -1138,  10051,  10860,  -6121,   -661,  -5677,   -890,   -266,
-  2100,   6223,    -70,  -2658,    -78,   3424,    714,   2138,
- -1355,   -981,   1990,    772,    938,   1311,  -1963,    924,
--22516,    260,   -341,   1251,  -1578,     23,   1375,   1068,
-  2688,  -3965,    713,  -5342,   -257,     37,  -6034,   -276,
-   228,  -1240,  -7171,  -3402, -14677,   1708,   -317,  -2880,
-   874,   1466,    524,   2091,    565,  -4220,   -265,     52,
- -3373,   -220,  -3175,   2646,    448,  -1628,  -1986,   2200,
-  3722, -15752,   7120,  -2036,  -2170,   -627,  -1079,  -4060,
-  2257,   -925,  -3418, -13488,  -1308,   3476,   -783,  -3924,
-  -820,   -860,   2418,   2982,  -8753,   9001,    294, -11915,
-  -969,   3329,   -761,   1459,  -5308,   1811,    379,    306,
-   632,  -2732,   2512,   1188,  -3470,  -2167,   -572,  -2274,
- -1657,  24074,   -159,   -138,  -1826,  -2527,  -3117,   -906,
- -1770,  -1182,   1240,  -3064,   2313,   -790,    336,  -3843,
--13384,   -423,  13066,    -14,  -1908,    -32,   2607,    487,
- -2426,    195,    135,   2742,   1540,  -1034,    856,  -2288,
-  -287,   -774,    497,   1760,    191,    178,    298,     38,
--30898,    801,  -1456,   2311,   1272,  -1845,    334,   -933,
-   183,  -1614,    739,   1881, -13548, -13589,   1496,  -2075,
- -1281,  -1510,    108,   3683,  -1120,    752,   -980,   -277,
- -1289,   2016,   -290,   1838,   -321,   -139,   -881, -12391,
--14713,   1906,    990,  -3202,   2320,    749,   1872,  -2545,
- -1457,  -1727,    734,   -327,   -316,   1062,  -3149,  -2959,
-  2210,    912,    952,   1926,  -8918,   1098,    594,  -1439,
- -1402,  11097,   3482,   -472,    219,  -3845,   -662,   9715,
-  3928,   1254,  -2009,  12375,  -1724,  13938,   1892,  -1390,
-   686,   2174,   1010,  -1297,   -199,   1855,    463,   2601,
-  4408,   1978,   1679,  -1614,     -3, -11965,  16220,    828,
-  1497,   -747,   -484,    519,  -1804,  -3814,   3287,   2104,
-  1149,    478,  -3918,   1504,   2376,   -316,   -520,  -1449,
- -3918,    664,   2772, -16434,    334,   -540,   -778,  -2812,
- -6026,  -4392,  -2446,   3479,   3742,   -624,   3895,   1145,
-  -344,    333,  11898,  -2725,  12873,  -1145,  -1807,   -279,
-  -452,  -1581,    548,  -5180,  -2012,   3411,   1188,  -1407,
- -4016,   -468,   1904,  -1724, -11390,    -30,  14402,   1610,
- -2138,   1249,    346,   6097,  -1433,   -655,   -174,   3652,
-  4010,    954,  -1458,   -354,  -1872,  -2689,    880,   -846,
- -1304,  -1725,   1750,  -1186,   1520,    499,   -583,  18201,
- -1083,  -3323,   3072,  -5440,   -182,   1065,  -1112,   -984,
-  2501,   -529,    613,   2054,    460,  -5245,   2827,  -1445,
- -2403, -12898,   1504,  -8428,  -1035,  -4620,   1704,  -2586
-},
-
-.cb1110m1 = {
-  1442,  12425,  -2072,    741,  -3624,  12979,   2031,   -364,
-  3750,  -5082,  -1968,    146,    670,  -3988,   -831,   3962,
-   397,   6213,  -1178,    816,    -88,   -432,  -9620,  11572,
-   194,    289,  -1958,  -2115,   -871,   5372,  -3145,   3612,
-  1644,    826,    525,  -2545,   -514,   -537,   2485,  -1014,
-  1276,    541,   -936,   -302,  -1172,    183,    827,  23939,
-  1120,   -346,   -313,   2759,   3934,  -3082,  -2260,   -906,
-  -967,   1496,    102,  -2782,    323,  -1109,    -37,   2554,
- -2920,    998,   -930,  -1952,  -1138,   1842,  -1593,  17345,
- -1214,  -1065,   2182,  -1169,  11745,    278,   8310,   1491,
-  -564,   1169,   8406,   1359,  -1249,  -2094,  -1365,   4069,
-  1828,    897,   1258,   1083,   4319,    610,    766,   2273,
-  4057,    621,    338,   1317, -20941,    548,  -2012,    563,
-  1102,    -27,   3007,   1129,  -1068,   1282,  -2939,   2983,
-  1958,   1800,   1912,   1728,   -606,   1804,  -4768,   5068,
- -1365,   4543,    399, -14152,  -6206,   6187,  -2205,   1174,
- -1892,  -3284,   -206,   2872,  -2622,    -43,  11268,   -104,
-   292,  -1836,  -6276,    725,   2066,   -604,  11382,   -448,
-   742,   2854,   -910,   -838,  -1802,   3678,   -397,   -530,
--10647,   2356,  12161,   1506,   2649,  -3335,   3128,   2169,
-  5942,   2152,  14124,    428,    187,    248,   1592,    -44,
-   -59,  -2934,   1883,   -923,   2673,   -847,    150,  -2142,
- -7620,  11078,   -595,   6490, -13673,    948,    219,  -1314,
- -3080,   1339,  11020,   1362,    247,  -1863,   1069,  -3786,
-  1706,   1064,    320,   4535,    136,   3795,   1465,  -1356,
-  -449,     13,   -421,   1769,  20470,   2181,   -371,   2444,
-  -744,   2263,   -155,   -688,   -236,  -4481,   1551,   2812,
-  2476,  -1436,   -470,   -272,   2276,    594,   -858,   -978,
-  1122,   2468,  -9350,   -353,  -1020,    494,  13167,   1770,
-  1734,    -70,  -4630,  12358,   -818,   -979,  -3931,   1000,
- -4343,   2570,   5567,   3322,   2930,   -236,  -4796,   6987,
- -1658,   4291,   1118,   1710,  -2050, -13566,     -2,    -23,
-  2104,   1101,   -316,   1906,   1643,    340,   5940,   3180,
-  -837,   1978, -10514,   1466,  -6936,   3600,   1205,    957,
-  -211,  -8272,   1611,   5330,  -5217,  -2264,  -5681,  -3085,
- -9201,    -62,   3366,   1370,  -9494,    244,  -5516,   1210,
-  2930,   -432,  -1265,    376,  -1910,  -1016,   -845,   3228,
-  1094,  -3168,    634,   -265,  -3426,   4367,  -4004,   -277,
--15081,   3998,   9671,   3418,    691,   9124,  -2723,   1939,
-  2311,    581,  -4980,   3381,  -1502,    878,  -1037,   1496,
-  3002,    904,  -5388,  -3300,    263,   1277,   -694,    766,
-  1781,   1134,    250, -32602,   -285,    210,   2550,   -383,
-   908,    302,    292,   -352,   2615,    -97,  -1863,   1908,
-  2685,   -502,  -3767,    416,    990,   -602,  -1533,     43,
-  1288,   1326,  16638,    433,  -1204,   1850,  -1609,   1407,
- -7196,   2319,   5770,   1584,   1150,   -634,  -1686,   1359,
- -1396,    438,    246,    186, -11262,  -1194,  -3790,  -3267,
-  2692,    755,    142,  16276,  -2338,  -1341,  10433,     38,
- -1510,  -2520,  -3205,    913,   3783,  -1622,  -4744,   1891,
-  2502,     -8,  -2962,   2091,  14986,   1270,   2931,    682,
-  1073, -10215,   1606,  -1010,   -822,   1168,  -1403,    254,
-  1156,   3206,   3958,   1739,   -402,   -654,  -4862,  -1869,
-  2643,  -2858,    658,   -910,  -2548,   5428,  -1992,   -208,
-  1950, -15526,    520,  -4212,   3182,   4160,   1524,  -2916,
-   586,   3213,    675,    185,   -629,    669,   -838,    502,
- -4065,    353,  -4072,  -1832,  -2108,   5034,   2484,  15386,
- -2102,   4988,     70,   1011,   2568,   1360,  -2821,   3352,
--11074,  -2686,    611,    460,   1811,   3093,     34,  -9140,
- -1163,     26,   -875,   2510,   1134,  -1322,   2274,   -960,
-  -823,   -510,   1092,   1490,   1466,  -1978,  32767,  -2379,
- -1019,   -633,  -1306,   -242,   2050,   1336,  -2668,  -2195,
-  -442,      8,   2292,   4344,  -2439,  -1472,   1035, -14443,
- -1820,   6309,  -2096,     45,   3617,   1561,   1252,   2828,
- 10682,   -894,  10841,   2373,   -101,    913,   2160,   2653,
-  2960,  -4433,   1193,   4892,  -2123,  -7911,    991,  -2643,
- -1364,  -3641,  -9736,    444,    869,   2990,    926,  -1220,
- -1676,   7492,   4376,  -3742,  -6964,   4531,   7522,  -2686,
-   164,   1070,  -7305,   1863,    542,    146,   -800,  18492,
- -4849,  -3876,   2162,   5111,   2606,   4243,  -3035,  -2990,
- -1710,   -426,  -5315,  -2332,  -1020,   -268,  -1242,    -39,
- -1684, -32768,   1288,   -726,  -1768,    304,    702,  -2969,
-  -700,    586,   1541,  -1099,   -348,  -2816,  -2181,  -1260,
- -1658,   2278,    323,  -1548,   2513,  11816,  -2416,  -5837,
-  -118,   6770,   3360,  -4097,   -264,  -1270,   1064,  -9862,
- -3669,    -56,    603,  -1475,   1464,  -9553,      6,  -3091,
-  5331,   -396,    892,  -2774,  -4674,   3667,  -9982,  -5160,
- -1146,  -4026,  -2032,   2936,   1805,  -1026,   1065,   -420,
-  -572,   1756,   -479,   -583,  30760,   -732,    750,    270,
- -1541,     28,  -1114,    -96,   -264,   1167,    548,    570,
-    84,  -1981,  -2110,  -1136,    358,  -6337,   -257, -14658,
-  1144,  -9032,    322,  -3730,  -3086,  -1351,  -3320,  -4116,
-  -396,   -129,  -3202,   1403,   -347,   2400,   -371,    532,
-  1555,  -2760,   1078,    804,  -1314,  21956,   2231,  -2808,
- -1947,    838,  12428, -14514,   -384,  -1554,   -675,   -885,
-  1358,   1612,  -3266,    -98,   1876,   -447,   2241,   3375,
- -1765,   2792,    674,  -1513,  -1132,  -3696,  11368,  -1916,
- -2778,   -466,   -377,   2090,   3897,   5422,  -2550,   2360,
-  3279,   8657,    990,  -2128,   2592,   -970,  -2397,   -269,
- 22742,    694,    310,  -2433,    920,   -690,   1478,   1370,
-  -450,    445,  -1379,  -1244,   2374,   1400,  -1040,  -5692,
- -1700,  -1630,  -4068,  -1193,   -719,  -2953,  -3562,    264,
--13247,  -4629,      5,   3245,  -5724,   2449,   3190,  -5375,
- -3560,  -3834,   1271,   1568,   -762,   2938,    782,  -1390,
-   243,   -466,   1376,    974,  -1646,  -1784,    249,   -514,
--13543,   1904,  10778,   -772,   -155,   7838,    -30,   3634,
-  -473,  -9100,   -112,  -3990,   -840,   1495,  -2346,   -326,
-  3655,   1292,   -292, -10972,   3431,   -262,    171,  -9775,
-  -985,    578,    312,  -2553,   3375,  -8316,   1410,  -1326,
-  2459,  -3116,   1079,   7194,   2720,   1998,   2742,   4672,
- -1589,  -8932,   -124,   -652,    -72,   2409,   -926,  -3661,
- -3762,  14832,  -1350,  -2234,   1258,  -1604,    169,    103,
-  1263,   -400,   -765,    144,    824,    855, -13344,  -1629,
-  1977,   2995,  -1964,   -650,   -219, -11607,  -6062,   -792,
- -1243,  -1438,   1757,   1436,  -3739,    812,   -856,  -9603,
- -2428, -11372,   3273,  -2318,  -8263,   1551,  -2054,  -3646,
-  3149,   2255,    594,   -412,  -3030,   1558,    694,  -1211,
-   618,   3256,   6526,  -1572,  -9054,   6655,  -3208,   3616,
-  2162,   3137,   4254,   4610, -10040,   1188,    335,   -615,
-   640,  -1990,   -314,   6014,  -2392,  -2174,    343,   6730,
- -1320,    183,    -97,  -3566,   2988, -13343,  -1573,  -9070,
-   428,   2839,   6728,  -1109,  -1113,  -1102,   5012,   1308,
- -3943,   3207,    764,  -2928,   1144,  -3044,   4033,   1846,
-  6460,  -4165,   8509,   9824,  15708,   -642,    748,    124,
-  -406,  13033,    807,   -299,   1319,   1499,  -1206,  -1102,
- -3129,   3795,     47,  -2483,  -2470,   2287,   4028,   1656,
-  -364,  -1712,  -1568,  -3940,  -2770, -13688,    796,   3380,
-   363,   1673,   1160,  -3934,   2884,  -5060,    832,   4799,
-   364,  -3030, -10596,  -1805,  -3256,  -2492,  -1831,   1088,
- 11108,   3236,   5128,   3052,   4486,     84,   2078,    200,
- -4071,   1713,   1539,  24597,  -1019,     32,    -48,     82,
-    81,   1171,  -1261,  -1783,  -1693,   2194,   1714,   -225,
- -1989,    402,   2611,   -708, -15901,    222,   -507,  12855,
-  1162,  -1536,  -2884,   1911,  -1256,   -926,  -1875,  -1448,
- -2730,   3059,  -1231,   1680,   1824,   1288,   -215,     -9,
-    40,   -957,  27662,  -1844,  -1927,   -846,  -1144,   -439,
- -3507,  -2844,  -1880,    637,   1042,    237,   1007,   -387,
--11913,  -2584,   -142,    624,   -494,   1439,   2225, -13017,
- -1901,  -1253,  -1071,  -7083,  -2154,    814,   3867,   1130,
- -2611,  -2260,   1548, -12389,  -1018,    102,   1178,   1058,
--14863,   2020,   4094,  -1259,   -861,   -886,  -3119,   2638,
-  1725,  -1364,  -2086,    183,    507,   -978,  -3086, -14966,
-   759,  -1341,    -70,   8538,   2974,   -140,   2509,  -4460,
-  2724,  -1372,    491,  -6138,   -345,  -2170,  -1187,   -330,
--11090,  15657,   -300,   2105,    496,  -2093,   -447,   2000,
-  3451,   1482,    758,   4142,    562,  -4042,   1491,   3183,
-  1685,  -2729,   1611,  11698,  14918,     25,    842,  -2766,
-  -667,  -1564,  -2619,    646,   1391,    862,   -909,  -2141,
-  -589,   1468,   -755,   1324,   -765,    634,    195, -19622,
- -1006,  -1161,   2434,  -1808,   4168,   4108,  -2580,   -635,
- -2533,  -2170,  -3701,  -1047,   -363,    769,   5064,     -8,
-  -654,   2346,    752,  13736,  -4056,      7,   5492,   7326,
- -4894,  -3860,   3325,  -3947,   4721,   5557,  -3699,    194,
--12957,   1052,  -1317,  -2642,  -2931,   1050,  -3951,   2392,
- -9683,   2519,   2880,  -3700,  -1820,    831,   4370,  -1177
-},
-
-.cb1616l0 = {
-  -185, -20290,    476,   -272,     31,   -638,    806,    -61,
-   220,    176,    178,   -788,   -441,   -333,   -360,   -263,
-  -116,   -512,   9794,   -727,   8904,   1192,   -277,    756,
-  -670,    795,   -311,    240,   -617,   -675,   -970,    756,
-   857,    529,   -166,    674,    890,   -522,    837,     79,
-  -618,  -1308, -13832,    744,   5422,   2688,    531,    398,
-  1500,  -1965,   -209,   -346,    613,   2147,  10053,  -1398,
-   189,   -108,    471,  -1202,    999,    178,    762,   -601,
-  1116,   9468,   -281,    763,  -1204,   -822,    -20,   -160,
-  -806,  14720,   -269,    143,  -1362,   -532,   -788,  -1532,
-  -405,     85,   -271,  -4959,    276,    -34,    -28,    -66,
-   112,   -188,   -582,   -678,    128,    680,    982,    596,
- 12154, -10468,   -167,   -380,    734,   -296,    282,   -223,
-   -86,   -342,   -812,    514,    387,   -418,   -364,  -1216,
-    14,    373,    357,  10897,  11235,   -714,    206,   -618,
-  -607,    596,    190,    726,    496,   -300,     95,   1022,
-  -153,    212,   -540,    252,    281,    238,   -234,     28,
-    24,    184,  32767,   -627,    569,    323,    486,    544,
-  -348,   -589,   -284,    238,    228,    475,     83,  -7753,
-   182,    745,    400,   -633,   -207,    137,    382,     90,
-    78,    715,    448,    463,    937,  10203, -12047,   -667,
-  -370,  -1516,   -360,     94,    832,   1027,   1013,     92,
- -5446,    834,    302,    764,    -94,   -462,   8095,   1057,
-   308,   -635,    308,   -877,   -946,   -616,     51,   1090,
--13351,    490,   -819,  15182,   -384,    411,   -546,   -242,
-   460,   -323,     76,    277,   1582,    900,  -1119,    345,
-  1316,   1138,   2020,   1612,   -148,    812,   1241, -10350,
- -9495,   -965,    -69,   1967,   -168,   -128,   1042,    447,
-   491,   -133,  -5083,   -450,   -164,     50,    326,    269,
-  -283,    226,    -40,   -334,   -110,     60,    -47,    169,
-  9166,   1188,   -942,    -14,   2112,   -230,    634,   -741,
-  -214,   -336,   -606,   3102,     59,    216,   1805,  -1176,
-   211,     -8,    564,    156,   -261,    300,    597, -21842,
-    66,   -232,   -506,  -1126,   1057,    603,   1448,   -391,
-   249,  -9445, -10240,    694,    167,  -1158,   -645,   -385,
-  -209,    330,    519,   -345,   -600,    192,     78,   -229,
-   208,  -9053,   -383,  10646,   -264,     84,    295,   -148,
-    87,   1292,    257,   1080,   -564,  -2395,  -1200,   -484,
-   -48,   -513,   -383,    -11,   -516, -17356,  -1172,   -218,
-   124,   -327,     31,    328,    -80,    231,     58,   -951,
-   560,   -501,   -392,  30528,    -56,    382,   -515,    -50,
-  -155,    338,      0,   -414,   -899,     95,     11,    378,
-  -350,    459,    673,     76,     86,    379,  32222,    143,
-   -48,    425,   -394,    -60,   -348,    450,   -489,    220,
-    56,   1129,   -125,    322,    168,    -16,    322,   -293,
-   294,    -38,    328,    141,    692,    -82,   -160, -32768,
-  -140,  -1543,   1079,   1052,   -924,   -569,    168,  -1782,
-   815,    706,  -1318,  -3436,   2860,  10922,    236,  10311,
-   882,  -1911,     11,   1638,   -189,    245,   -858,  11060,
-  -826,    696,    224,   1707,   1766,    472,  10832,   -265,
-  -161,    163,    478,   -258,   -284,    -86,    496,    425,
-   -71, -10344,   -141,    425,  -1457,   1145,    -63,   -713,
-  -583,   -327,    628,    368,    -18,  -1746,   -525,   -338,
-  -110,   -359,     92,   -233, -21328,    460,   -275,    -98,
-   -58,     51,    208,     56,  -1145,    -51,   -242,     65,
-    76,    214,    141,     28,    -86,     26,    925,    193,
-  9980,   -326,  11342,    176,   -534,   -303,    130,  -1575,
-   189,   -496,   -699,    381,    411,    644,    229,   -147,
-   694,  -1998,    523,  -1576,   8028, -10385,  -1924,   1174,
-   608,   2402,    575,  -1753,    437,   -816,   1267,    147,
-  1448,   -614,    865,   1076,   -156,   5000,   2020,   2021,
- 10283,   -460,  -2381,  -3226,  -3991,   4904,   -284,    105,
-  -268,   1049,    203,   -646,    732,   6490,   -128,    932,
-    10,   -866,     74,    -64,    834,    204,    159,   -162,
-  -170,   -110, -28908,     52,   -512,    -72,    327,    615,
-   534,   -484,    131,   -262,     31,   -407,    284,     33,
- 11118,   -170,    318,  12848,  -1126,   -659,    500,    310,
-  -403,   -234,    237,   -544,   1232,   -243,  -1178,   -965,
-  -117,    108,  -1304,  11728,  -2254,   1231,  -1077,   -136,
-  -632,   -103,   -256,  -1644,   -300,   1680,  -1175,   -956,
-   -43,   1718,    175,    144,    275,   -802,   -223,   1116,
-   321,   -871,  -1174,  -1175,   1008,    255,  31172,     28,
-  -621,   -222, -12473, -10995,   -712,    247,   1762,    418,
-  -181,     90,     92,   -406,   -435,   -105,   -596,   2262,
-  -116,  -1574,  -3402,   6796,   7944,    973,  -2661,   2260,
-   621,  -6984,    382,  -1375,  -2604,   1550,  -1453,   1133,
-   966,    403,    284,    -72,    -36,    174,    457,    -90,
-    38,   -437,   -476,   -370,    469,  32767,   -267,    350,
-   694,   -169,   -782,   2110,   -620,   -782,   -669,  -6478,
- 10550,  -3294,    485,    177,    553,  -3232,   1628,   2335,
-  -870,   -360,  -1112,   2197,   -474,  -5113,   3346,    878,
-   566,  -3823,  -1175,    357,  10509,   1077,   -514,   1012,
-    38,     59,    669,    654,    349,  -1046,    355,    192,
-    57,     95,  11869,   -702,  10201,    204,     45,   -608,
-  -444,    921,  -1070,   -316,   1286,  -2566,   2026,   -127,
-   -79,   -954,     93,  -1288, -10024,    693,   8820,   -366,
-   -84,  -6378,   1682,   -627,    386,    254,    503,   -152,
-  -336,     38,   -341,    373,    -85,   1088,  -1707,    119,
-  -242,    242,   -326,   -162,    109,     70,   -114,   -831,
-  -279, -32768,     62,     58,    214,    136,    194,   -103,
--10047,   -610,     91,   -310,  12059,    346,   -656,    986,
-   478,    364,   1777,   -173,   -663,   -103,   1011,   -373,
-   200,   1632, -13098,   3651,    418,    478,     68,   -217,
-   169,     78,  -1176,  -1191,  -1664,   -328,    152,  -1053,
-   547,    527, -10435,   -176,  11131,   -137,    -36,   1062,
-    33,     71,   -730,   2080,   2061,   -372,   -637,    -84,
-   744,    109,   -357,    550,    309,   -239,   -134,    135,
--20461,   -177,   -690,   -488,    -36,   -415,    275,     64,
-   378,  11250,   -802,   -569,   -200,   1499,  13103,  -1090,
-  -175,    189,   -162,   -751,   1052,   -949,    -98,   1249,
-   479,  -1304,   3293,    771,   1642,   -381,   1423,   2258,
-  1184,   4806, -10950,  -3873,    348,   -815,  -5315,  -3306,
- -3307,   2337,    776,   -125,    -48,   -435,   -155,    -30,
-   294,    116,     96,    -47,   1022,   -391,   -183,    252,
-   826,    -32,    293,  -1369,  18310,   -146,    239,   -266,
-    34,   -154,   -704,   -498,   -135,    228,   -563,   -210,
-  -158,   -514,   -201,   -571,   -341,   -428,     74,   -152,
-   297,   -162,   -644,   -216,   -252, -13810,    705,    464,
- 21097,     74,   -169,    792,     12,    131,    320,   -398,
-  -446,     44,   -362,    388,    -22,    -13,   -209,   1205,
-  9341,    590,   -683,   -351,    177,  -1618,    495,     14,
-  -319,    755,  11352,    249,   -989,   1574,   -922,   -364,
-   366, -10348,    337,   -558,   -124,  12056,    102,    802,
-  -548,   -254,   1532,      7,   -282,   -459,   -839,    171,
- -4445,  -1610,  -1515,    -37,    970,    306,   -881,   -238,
-  -154,    -58,     27,    435,    166,    571,    225,   -844,
- -9967,   -192,   -874,   -459,  -1283,  -1431,   1552,    -38,
-  -686,   -207,    709,  11982,   -383,   1922,    -92,    -60,
-   708,   -900,    867,     39,   1470,    517,   -182,   -456,
-    90,   1026,   -192,   9988,    942,     48,    789,    981,
-    74,   -692,  -1283,   1239,   1625,  -1121,   -286,  -1115,
-   294,  13228,    980,    312,   -745,  11711,   1055,   1052,
-  -907,    201,    688,    364,   1171,     96,   -591,   -981,
-  -246,    875,   -352,    677,    881,   -397,  12890,     10,
-     0,    412,     76,    464,    275,   -721,    -28,   -197,
-   104,   -238,   -372,   -272,    490,   1426,    963, -13232,
- -1190,    790,    161,   -321,   1138,    646,    359,   -183,
-  -659,   -129,    348, -22703,   1016,   -147,     26,    -80
-},
-
-.cb1616l1 = {
-   292,    310,   -255,    305,     69,  25001,    -16,   -668,
-   210,     17,    -12,     45,   -758,    -76,   -544,   -882,
-    61,     26,  -1682,  -8820,    154, -11775,     64,    472,
-  -464,    245,    478,  -1560,    869,   2192,     98,    645,
-   -95,  -9369,   -594,   -635, -11132,    900,   1606,   -904,
-   841,   2570,  -1464,    961,   1056,    669,    461,   3307,
-  -157,   -644,    121,   -694,    170,    116,    393,   1507,
-  -233,   -654,   -162,    108,     98,  17471,    347, -11344,
-  -701,   -284,   -246,   -337,  -1903,     14,   9865,    453,
--11318,  -3662,   2373,   1106,  -1424,  -1709,  -2743,   -860,
- 11008,   1579,    -38,  -1381,    467,   -487,  -1306,    369,
-   426,   -424,    128,   1078,   1085,    683,  12552,    792,
-  -184,   -278,    186,   2006,    363,    310,    -75,    862,
-   377,    490,   -256,  -1568,   -124, -10785,  -1456,   -524,
- -1259,    517,  -1844,    914,    769,    945,    739,  -1053,
-  -691,    177,     96,  -1070,   -162,   -707,   -594,  -9885,
-   103,    452,   -734,  -6774,   -753,    192,     88,   -292,
-   201,   -532,    231,   -281,   -691,  -1232,  -1768,   -753,
-   369,   1556,   -139,    668,    941,    264,  10372,   9740,
-   976,   2519,    -88,    941,    446,   -130,   2131,   -631,
-   325,    285,    176,   -236,   -634,    -91,    112,  32767,
-  -233,   -726,    156,    881,   -217,   -497,   -236,  -1106,
-   283,    164,   -328,   -629, -27442,    -17,    176,   -338,
-  -192,    538,   -773,    634,   -180,    872,   -190,   -530,
-   586,   6994,   3060,   -336,    736,  -1268,  -1142,    -69,
- -1359,  -1047,   -975,    -86,  12489,   1162,   -509,   -478,
-   717,   -514,   -502,  -1755,  11064,   7668,    340,    230,
-  -127,   1490,    -63,    680,   -297,    125,   1700,   2505,
-     3,  -2043,    255,   1547,    569,  -2483,    733,   -896,
-   881,   4780,   1544, -13442,   1328,   1937,  -4448,   -384,
-   749,    173,   7350,    156,   -144,     52,   -527,    -34,
-    -3,   -173,    118,   -528,    -75,     39,     42,   -874,
--14636,    474,   -413,   -106,   -115,   -431,     54,    722,
-   156,   -468,    369,    149,    -68,   -791,   1318,   2150,
-    69,    454,  19032,      3,    111,    -40,    349,     88,
-   385,    -54,   -395,   -224,   -519,      0,   -219,    179,
-  -253, -11379,  11005,   1857,   -126,   -248,    304,   -616,
-   351,    324,    500,   1494,  -1390,   2349,  -1257,  -1114,
-  -213,   8156,  -2066,   9746,    763,   -848,    349,     -7,
-   723,   -966,    469,     91,   -252,   1336,    579,   1816,
-  1372,   -941,    364,    276,    -33,      7,   -425,   -433,
-   -21,    546,   -671, -31271,   -926,    101,    147,    302,
-  -552,    224,    568,  -2386,    519,   -458,  13171,  -1464,
-  1161,    639,    -10,   -877,    331,   3372,    -72,   5158,
-  -706,    906,   2668,   1008,  -2732,   3264,    105,    630,
-   673,  -1948,   -196, -13130,   1726,    737,   4829,     93,
-   654,   2175,   3858,     -5,    245,   -471,    369,   5435,
-   356, -12934,     61,   1984,    975,    706,  -2454,   -642,
-   -93,   -780,   -443,  -1487,   -460,   1112,    385,    309,
--10268,    197,  -1692,  -1870,     50,  -1934,   5380,  -1193,
-   775,   -493,   -992,   -557,   2952,    408,   4616,  -1341,
- 10774,   5305,    854,   3031,     67,    617,   2436,  -2072,
- -1469,    804,   -578,    243,    264,   9150,    200,  10753,
-  -350,    182,    -52,   -406,    508,   -761,   -161,  -1142,
-    25,    484,    127,    126,    477,   -341,    110,    371,
- 32767,   1090,    678,    175,    146,   1020,   -897,    878,
-  -137,   -507,   -534,    658,    678,    505,   -753,   -207,
-   391,     60, -23279,   -772,  -1323,  -1578,     -3,    196,
-  -749,    220,   -482,   -785,    456,     38,   1034,   -579,
-   -58,  -1539,    421,   -746,    238,   1531,  21290,    586,
-  -441,   -276,   1512,    553,  -1407,   -276,     60,  -1068,
-   299,    650,    -25,  12590,   2058,    925,   -295,  -1744,
-  5152,   4935,   -419,    272,   -383,   -665,   -194,   -255,
-   574,   -267,    541,   1031,   -282,   -648,    622,  -1464,
-   -28,   -269,   -533,    -80,   -476,    282,   -336,    125,
-   104,    464,  -8948,    849,    171,   1518,   -296,     51,
-   -27,   3097,  -5103,   -412,   -494,   -194,   -713,  -1277,
-   102,   1740,   -445,   3432,   1180,   6404, -10908,   -970,
-    31,    142,   -242,    -79,    -78,    -76,    124,   1031,
-    83,    -55,   1522,   -613, -32768,   -394,   1306,    287,
-   701,  -4725,  -1085,    415,   -122,   -538,   -675,     82,
-   116,   -728,    -99,    500,    659,   -329,    292,   -106,
-  9243,   -340, -11933,   -498,    341,   -825,   -401,   -402,
-   142,    -13,   -309,   -722,    141,      0,   -681,    494,
-   671,  -1210,   1466,  -1335,  11743,   -280,   1616, -11481,
-    52,    317,    902,   -653,   -967,   -494,   -162,   -685,
-  -438,    756,     81,   -207,    577,  -7476,   -353,    918,
-   -31,   -107,    181,    523,    -46,   -752,    373,   -908,
- -1808,   -916,    632,   1508,    -35,  -6943,     64,  13072,
-  -655,    163,   1221,  -1655,  -2568,   -446,   -401,    470,
-  -622,   -944,   3744,   -458,    203,    125,    238,   5196,
-    21,  12193,   1095,   1091,   -787,  -1157,   -980,  -1154,
-  7707,    -29,    106,   1226,    696,   -974,   -379,   -537,
-    56,     95,   -477,   -528, -11245,  -1014,    140,    380,
-    89,    540,     84,   -619,   -322,   -572,   -240,    -26,
-   727,    310,     43,   -790,    -31, -24318,    110,    618,
-    44,   -108,     89,   -191,    -33,   -201,   -490,     43,
-  -136,   1366,     -2,    162,   -832,    469,   -140,   -278,
-   600, -15775,  -1699,    184,   1825,    728,  -1803,   -876,
-   152,     60,   -813,   3063,   -929,    972,   -282,    718,
-  8426,   -888,   1383,   -664,    571,    958,    982,    236,
-  -548,     66,   1898,   -274,  10715,  -1693,     79,  -1254,
-   296,    609,    682,  -1074,    272,    157, -18972,    377,
-   -12,    438,    536,   -672,    292,    719,   -464,   1106,
-  -296,   -812,      6,   -334,     67,    678,    382,    678,
-   301, -22165,    184,     80,   -671,    -86,    139,   -298,
-   416,   -610,   1057,     15,   -230,    376,   -768,    643,
-    58,     27,    178,   -742,     60,   -500,    485, -19923,
- -1016,    717,   1126,    287,   2171,   -388,   1453,    -21,
-  -268,  -1555,   -263,    713,   1709,  -1103, -10699,   1788,
-    -8,   -501,   -892,  11476,  -2006,    466,   8070,   -286,
-   163,     35,    494,     76,   1428,  -2249,    100,  -1542,
-   319,   -214,   -701,  10130,   -294, -11962,   -656,    227,
-  -512,  -1014,    213,   -600,   -720,     63,   -180,   1286,
-  1063,  -9671,  -1056,   1269,   1484,     20,    790,     29,
- -9906,   -373,    608,    361,   -659,     43,  -1034,    -96,
-  -219,    -65,    392, -19615,   -464,    212,    820,   -182,
-  -227,    463,    301,    642,   -219,    386,  -1170,    108,
- -5583,    422,   -507,    530,  -1058,   -131,     20, -14487,
-   101,    -14,   -415,     32,  -1133,   -917,    944,   -832,
-   580,   2509,   -959,    470,   1184,    432,  -1238,    193,
--13382,   2329,   1993,   1035,     80,   3139,   -553,   1683,
-   390,   1480,    642,    564, -11173,    422,   -984,   -559,
-  -686,    168,   -777,   -810,  -1278,   -427,    -96,   1691,
- 29172,   -435,    -50,   -968,    221,    685,     52,   -373,
-   525,   -563,    350,    528,    305,    705,    313,    612,
-  -254,   -220,  -1638,   -156,     24,    109,   -893,   -697,
-   245,   2579,    667,   -142,  12315,   -694,   3799,      5,
-  -438,   -473,   -426,     59,  -5381,    -56,    200,   -280,
-  -276,     96,    435,    729,    336,    123,   -714,   -372,
--12609, -12053,   -238,    223,   -242,    230,    663,   -645,
-    98,    515,      3,    724,    510,    -48,   1090,   -173,
- -5024,    536,    635,   -143,    702,    172,   -196,    164,
-   190,   -152,   -180,    238,   -142,   -329,    191,   -296,
-  -416,  11775,   -496,    -95,    392,    994,   -584,   -925,
-  -963,    286,   -458,   3104,  -1990,    968,  -1430,    998,
-  -407,  28485,    436,     42,    378,   -210,    148,   -149,
-  -532,     94,   -628,    186,   -186,   -274,    250,   -316
-},
-
-.cb1616s0 = {
-  5604,   1491,  -2064,   1321,  -2846,  -3007,  -1899,   -896,
-   556,   1969,  -2225,  18515,   4156,   1333,   3489,  -2168,
-  1897,  -1440,  -1514, -13837,   1017,   4797,    453,  -2101,
- -6822,    923,    185,    754,   -201,  -4151,    126,   -793,
-  -437,   2474,   4286,  -6405,   4007,  -1644,   -757, -13106,
-  2460,  -1874,  -1867,  -1099,  -5146,   2945,   2162,  -4427,
-  1692,    763,   1756,   -821,     66,   -348,   2001,    702,
-  1046,  -1365,   -570,   1073,  32655,     -9,    450,   -761,
-   908,   -200,   -572,  -1306,   2589,   2406,   1926,   1772,
- 11042,  -1989,   3914,  -1192,   1817, -11710,   2985,  -2942,
- 15684,   1919,   -667,  -1267,   5212,    444,    864,  -3844,
-   438,  -2382,    974,    983,   -887,   -822,    185,    245,
- -3192,   1030,   1441, -28152,  -2616,   -380,    300,   1990,
-   -94,   -999,    285,    553,   2107,    960,   -859,   1001,
- -1632,   2208,  -1302,   1331,  -3956,  10593,  -1931,  -4486,
-  9376,  -6587,   -463,  -3605,   2460,   1306,      2,   1987,
-  1643,   -552,   1327,   1124,   -581,   1347,    650, -29514,
-   278,   1062,   1459,    951,   2416,    396,   -594,    930,
-   434,   3308,  -2816,   5466,   4831,  -2869,    -68,   -894,
-    58, -13036,    210,  -1940,  -2524,   1139,   2044,    -32,
-   969,   2187,    516,    581,   8185,   2080,    176,   -708,
-  1529,   1132,   -675,  -1384, -10949,   1174,  -5245,    580,
-  7490,   3258,   4314,   2706, -13676,  -1735,   1937,    577,
-  -108,   2676,    612,   -966,   -966,   3255,   1401,   1443,
- -1850,   -252,   9270,   5037,  -1492,  -1957,  -2134,   1198,
-  3470,  10482,   -468,   -671,  -1655,   -955,   3248,   3360,
-   448,  -1854, -25145,  -2771,  -3318,    561,   -672,   1791,
-  2194,   -598,   1673,   -420,    547,    122,   -160,   -172,
-  1686,   -397,   1187,     11,   -879,    -58,    323,    180,
- -2588,  -2139,  -1794,  -2924,    999, -26969,  -1280,  -1401,
-  -770,   6159,  -4449,  -4174,   5270,  -4813,   4139,  -2023,
-  2694,   2884,   3418,  -5948,   3118,  -1176,   4691,   8566,
--32768,   -681,   -553,   -216,   -216,   -931,   -507,    579,
-  -932,   -740,    349,     81,   2120,  -1222,    564,  -1576,
-  1241,    159,   2579,   3236,  19205,   -744,  -1727,  -1803,
-  1247,   -575,   -261,    261,    540,   -255,    -60,  -1428,
--14184,  -5194,    863,    997,   1043,   -828,    466, -12553,
-  2106,     56,   -566,   1142,    401,   1360,   2322,    629,
-   937,   2954, -10086,    -12,   2554,  -5760,    523, -15184,
-   636,    156,    165,  -2638,   1134,    658,   4398,  -1385,
- -1924,   1179,   3222,   -908,  -1153,  18082,   1011,   1948,
- -1007,    352,   -172,  -6446,    -22,   -228,   -264,     73,
-    76,   2229,  -1349,   6103, -11588,    576,   3374,  -1616,
-  7904,   3146,    984,   1056,  -1626,   3113,  -3674,    203,
-  -452,   -938,   2074,   2409,  -1228,  -8186,  -2766,  11098,
-  1598,  -8658,   -735,    556,   1610,  -7419,  -5267,   1158,
-  2841,   4497,   7551,  -2066,   1105,    761,   2549,  -1764,
-  2870,   3889,  -1478,   1912,   2504,  -1417,    963, -14602,
-   579,     28,  -2953,   1589,   3962,  -1372,  -3304,    566,
-  2687,   9700,  -2464, -13110,   3005,   -772,  -3775,   -138,
- -4244,   5031,   2523,  -2883,    582,   -446,   -274,   3311,
-  -157,   -784,   -948,   -292,   3085,   -781,    954,  -2133,
- -6693,  13909,  -2236,    416,  -2589,  -3194,    668,  -1988,
- -2234,   2365,   1034,   1201,   -100,   1688,    372,    156,
-  -254,    931,    576,  -4680,    566,  -1823,    294,   1645,
- 27678,  -1353,  -1230,   1744,    570,   1679,    608,    -35,
- -7150,  -4383, -11992,  -2910,  -2096,    512,   1838,   3129,
-  -410,  -2306,   -551,  -3904,   4140, -12782,  -1743,   -106,
- -4190,  -5554,  12975,   -573,  -3532,  -4050,     15,   1307,
-    62,   1643,  -1988,   5774,   2064,   4734,   1009,   2038,
- -2794,  -2704,   2275,   -279,  -1588,   -910,  31315,   1249,
- -1642,     78,    164,   -260,   -878,    698,   1189,    159,
- -6137,  -1994,    775,   3484,   1635,   1121,   4391,  -5883,
--11300,   3722,   -422,  -2180,  -3206,  -3181,  -1490,    291,
-  1326,    399,   1952,  -8405,   2240,    175,   3541,   4258,
-  1518,   -781,   1105,    498,   -348,    771,  15918,    120,
-   379,  -2036,  -3723,  10948,  -1827,   3220,     40,    210,
-  -294,   -813,  -2349,   -707,    967,    953,   2625, -13614,
- -1519,   9454,  11606,   -903,    817,   6237,  -8878,   -160,
- -1768,    444,  -2812,  -1697,  -1010,   -964,   1846,   2997,
-  2633,  -1924,    501,  -1464,   2402,   -986,  -1143,    527,
-  1187,   -929,  20923,   -563,    785,   -486,   -940,   1625,
-  -796,   -697,    348,   -428,   1451,   1087,  -2252,  -2481,
-   939,    890,  -2508,  -1357,  -1868,   1395,  -6386, -21986,
-  2574,   -384,   -324,   7752,   2996,   -641,  -7903,  -5745,
- -4226,  -4178,  -4394,   9307,   3906,   -227,   -496,   4556,
-  1099,   -838,  -2546,   1190,   9937,  11057,   3846,   -156,
-   433,  -2873,  -1769,     36,   3188,   4490,   4369,   4714,
- -4681,  -2804,  -1525,   -947,  -5064,  -4180,  -1348,  -1404,
- -1097,  -3922,  -1088,   -444, -13636,  -1547,   1685,  -1625,
- -8494,   2492,    -72,   9893,   2470,    705,    105,   5609,
- -5403,    846,     90,   -688,   1184,   6286,   -253,  -1610,
-  3348,  -2082,   8838,  -2453,  -1315,  -1235,   -719,  -4607,
- -2138,  -5522, -10466,   1900,   1541,  -2688,    729,    368,
- -8845,   1282,    438,  -2532,  -2328,   4833,  -6145,   4037,
-  3584,   7965,  -1495,   6999,  -5037,  -1364,   7095,   4253,
-  2711,  -8336,   3946,  -1347,    192,   -820,   -328,  -1152,
-  1554,    869,   5053,   9707,  -5888,  -4294,  -3858,  -3344,
-  8344,   -644,   1750,  -1796,   -149,  -3706, -14823,    656,
- -1487,  -2466,    640,  -2286,  -2902,   2906,     44,    211,
-  -336,  29976,   -298,   2092,   -688,   1857,   1807,  -1705,
-  3211,    425,  -1046,    128,   1191,  -1966,   -726,  -3040,
- -3632,   1212,   2986,   5266,   1086,   3624,   3068,    422,
-   989,  24479,   3791,  -2229,  -3713,  -2379,  -1370,  -1799,
-  2742,  -3259,  -4973,   -626,   2287,   5655,    663,   -918,
- 13266,   7762,  -1131,   2490,  -3123,   2869,   -846,  -2828,
-   119,  14540,   4588,  -2784,  -3713,  -2547,   3698,   3189,
-  3372,  -5436,    856,   4382,   4124,   3406,   -336,   -911,
-  -137,   4268,  -4436,   1566,   1169,  -3020,  13980,   -162,
- -7226,  -2550,   -946,  -2408,  -1056,   -587,   -273,   -932,
-  -219,  -8021,  -1086,  -2587,   3852,   1235,    -22,    222,
- -1100,  -1594,    137,  -1985,  10225,   4998,   -348,   -450,
-  6651,  -2217,  -7705,   2508,  10061,  -4512,  -2262,   6156,
-  2962,    150,  -2456,   1089,   -927,   -609,  -3130,  -1682,
- -1215,  -9251,   -130,  -3776,   -309, -13872,   -276,  -6922,
-   -82,   2660,  -1255,  -6562,   2640,   2646,    422,    -84,
- -6020, -11551,  -1710,  -3462,  -2666,  12510,   3145,   -218,
-  2956,    447,     30,   2268,  -2410,  -1400,    660,    431,
-  3068,    258,  -2862,   3919,   2693,   -744,   3070,  -2179,
- -1192,   -932,  -2095,   -279,   2045,  -8205,  15263,  -4415,
-  2116,   4047,  10308,   3110,   1368,  -1547,  10919,    988,
-   -81,   -907,  -1728,  -1052,  -3539,  -4769,  -2576,  -1038,
-  9255,    152,    431,   2455,  -1544,   1880,   -312,   2724,
--13336,  -4197,  -1199,    709,   -695,  -1687,    442,  -2564,
- -1626,  -1888,   1870,   3539,  -2922,  -3506,  -7890,  -5486,
- -1640,   2178,   2173,  -3200,  -4626,   1116,  13161,  -5221,
-  -852,  -1047,  -3328,  -3975,  -4441,   2870,  -1458,   5664,
-   -28,   3853,   1809,   2721,    658, -15262,   3611,   3223,
-   595,     44,  -5327,  -2486,  -1806,    606,  -2474,  -1236,
-   983,   1741,  -8390,   1948,   1875,  -1806,  -6294,   -814,
-  -747,   2209,  -1332,   2058,  -1326,   5808,   1113, -10765,
-  -584,   4038,   1412,  -3356,     24, -12826,  -4322,  -2287,
--10793,   3008,  -6903,  -1273,   1590,   -608,   -514,   -309,
-  -144,  -2024,   1822,   4375,   1122,   -631,    -76,   -595,
-   192, -11323,   8168,  10180,   -646,   2478,   4516,   1095,
-    94,      6,   1251,   -658,   2620,    626,   3078,    727,
-  7769,    966,  -3593,  -6990,  -2358,   1022,   1288,   2733,
-  -259,   -291,   2482,    297,  -1268,  10338,    739,  -1862
-},
-
-.cb1616s1 = {
--12873,  -2429,   6659,   4401,  -2250,   1684,   1508,   1780,
- -1081,    -10,  -6012,    895,  -2373,  -1263,    125,   1448,
-  4744,   1556,  -7267,   2354, -11368,   1155,  -7699,  -1424,
-  -914,   -591,   2472,    538,   1431,    953,      5,  -3066,
- -1063,      3,    406,    979,    922,   -668,   1633,      2,
-   649,   -139,    964,    860, -18807,   1944,   2183,  -1358,
-  1395,  -1167,   5369,  -3525,    735,  -2698,  10556,  -1137,
- -3979,   1383,  -1997,   5995,   6465,   2310,   1781,   -311,
-  3376,   7199,  -2745,  -1656,  -5702,   3180,   3017,  -5673,
-  -712,  -8902,   2058,   -570,    170,   2276,   3869,  -9332,
- -7965,   1130,   2111,   5638,  -1507,   2944,   1574,   -919,
- -1459,   -970,  11093,    544,  -2952,   -146,  -4684,   -303,
-  -528,  -1199,   -890,  -2720,  -1665, -10952,    373,   1657,
-  1960,  -1386,    299,  -4356,  -4527,   8948,   7378,   1580,
-  1301,  -6057,   7650,  -7399,   4646,  -1768,   2756,   -263,
-  -286,   -334,   1369,   -786,  -3760,    824, -13524,  -5099,
- -1693,   -347,  -1821,   1992,   3462,   1421,   4900,   -462,
--13331,  -1617,  -2350,   4083,  -8721,  -5880,   4900,   2912,
-   235,  10369,  -1340,    776,  -2598,  14344,  -3805,   -568,
- -3788,   3591,   -394,  -1077,   3908,   6080,   1953,  -1454,
- -1013,    507,  10097,   3396,  -4662,   -763,   2506,   1486,
-  3088,    580,    -86,   1117,   1606,  -3454, -10782,   4870,
-  6170,   4020,  -5675,   6848,    439,  -8765,   3877,   6250,
-   734,   3245,   -874,  -4312,   -879,  -4368,  -1287,   3212,
- -2130,  -1435,   1619,   -280,  -3082,  -1070, -18921,    940,
- -2428,  -1548,  -1142,   -271,    193,   -240,   -890,    918,
- -4350,  -5042,  -8994,   5060,  -6495,   3455,   -259,    892,
- -1290,   1348,  -1049, -12681,    -49,  18286,     75,    791,
-  1830,  -4116,  10240,    -12,   -459,   2477,  -2582,  -3344,
- -1598,    982,   -324,    -48,  -4229,  -8476,  11120,    100,
- -6238,   1164,   2369,  -2052,    247,    626,   2213,   2279,
- -2627,    289,   -471,  -1136,  -1818,  15413,    579,   1034,
- -6835,  -8645, -12667,    758,   -932,  -4398,    565,    458,
- -2024,  -4050,  -3100,   1897,   1324,   3191,   1876,   7660,
-   385,  -1066,  -1539,  -1317,  -2632,    766,     63,    389,
-  -189,   1136,   -653,    802,    755,     70, -29812,    640,
--11953,  10901,   2078,   -529,  10373,   2509,  -2776,   -104,
- -2232,    174,   -837,    158,   1507,   1963,   -273,   1534,
-  1084,   8469,   2568,  12662,  -2276,   2808,   2052,  -7430,
-   434,   3777,    991,    664,   2724,   1631,  -3632,   2099,
-  -582,   4140,    757,  11248,    540,  -1425, -10204,   1604,
-   600,  -2034,  -1060,    977,   1843,   3831,   -933,   -816,
-  2975,  -6413,   1589,   -915,   -696,   2155,   -556, -17893,
-  3348,  -1239,   1014,  -2539,   1588,   -320,   2402,  -1485,
- -8062,  -1046,  -1458,    200,   1323,    357,  -3752,   2836,
-  5774, -11638,   -913,   -648,   1676,    246,  -1277,  -1065,
-  2334,  14911,    228,    880,  -2172,   3072,  -2520,   1445,
-  1442,   2568,  -1254,    730,  -1950,   -192,  12003,  -1587,
-  2558,    714,     33,   4324,  -4642,   -231,   -279,   -255,
- 17824,   1292,   3530,   -766,    -64,    245,   1677,   1716,
-  2507,  -3594,  -3532,   3000,   1996,  -5342,  -1868,  -5642,
-   -21,   1132,  -1202,   1104,  -6543,   1242,    457,  -1711,
--32768,     49,   -458,    295,    858,   2043,   1268,  -1257,
-  -346,    793,    554,   1260,  -1082,    985,  -1453,   1704,
-  2431,  -2858,   1466,  -5424,  -8870,   4714,  -1539,   5767,
-   110,  -2568,  -1482,   -348, -11580,  -2838,   1213,   -599,
- -1591,  -3472,  -6907,   6191,   3928,   4708,   1326,  -1510,
-  6322,   3849,  -4112,   7689,   5976,  -3298,    372,  -5450,
- -2208,   6564,  -6915,    911,   4216,   1682,   -739,  -2146,
-   203,    350,   -816,    351,  -3386,  -3016, -15045, -10824,
-  -553,  -4969,    138,    256,   1672,  -1840,   2851,  15838,
-  2934,   1871,   -600,  -3293,   -845,  -2696,   1463,  -1075,
-   720,  -1177,  -1538,   2415,   7315,   -484,   1082,    962,
-   766,   -845, -10687,  -5932,  -4410,   3840,    362,    194,
- -4576,  10209,  -3548,   -127,  -1202,    246,   -734,    770,
-   311,  -3126,    772,  -2422,  -1141, -12330,    960,   1567,
-  2816,     80,  -4414,   -778,    665,   2308,   -420,   -180,
- -1242,   -423,  12138,    113,  -1477,   2899,    214,    348,
-  -927,   -764,     26,  -1127,  -2288, -32768,   1302,    394,
-   646,   -453,   -946,   -838,   1649,  -2292,   1182,  -1558,
- -6413,   -265,  -1942,  -3467,   1863,  -3526,   3446,   -863,
-   886,    202,   -202,  15706,   2226,   1763,    894,    936,
- 16191,   -693,   1682,   6678,   1742,   1365,    700,  -1765,
-  -803,    299,  -2194,   1259,    689,   1670,   -635,     28,
- 11890,    -14,   -878,  -5439,    103,  11124,    528,   1179,
-   -62,    868,   -664,    749,  -1128,   1429,   -485,   1920,
-  -866,   1176,   1051,    379, -29470,   2354,   -252,  -1648,
-  -412,   -804,   1339,   -383,   -812,    959,    893,  -1741,
-  1462,  -1868,    470,   2112,  -1889,  -2236,  -1668,   -755,
- -2562,   1354,   6183, -10964,   5651,  -1062,   2550,  -6225,
-  -194,   1687,   -782,   1568,    -85,     10,     -8,   1128,
-  -521,  -1090,  -1933,  -3441,  -2698,   3049,  -5822,  20847,
-   710,    789,  -1872,   1082,  -1242,   4152,   1624,  10795,
- -2149,   -134,   1087,    900,  -7943,   5178,  -3429, -11622,
- -3617,  -7444,   -824,   3462,   -579,   -830,   1010,  -3301,
- 12202,  -5446,  -1763,    340,   -744,   -509,    554,   1140,
- 12266,  -1328,   4652,    992,  -1931,   -708,   1074,   2762,
-  2931,   -414,   -217,  10166,  -4167,   -903,    660,   1000,
-    27,  -1037,  -1532,   1308,   8655,   9087,  -2998,   9928,
- -3722,   -556,   4812,   3062,    600,   1281,   3879,    114,
- -5404,   1869,   2174,   2083, -11631,   -301,  -3609,   2443,
-  2300,   4863,   -838,    -29,   2166,   1319,   2110,   1387,
-  -741,  -1225,  -1729, -13536,  -7376,  -1520,    619,  -4919,
-  2517,  -4338,  -1650,    475,    456,   4372,    792,   3224,
-  1963,   -547,  -2071,   2142,   -254,   1549,  -6846,   2430,
-   -96,  19844,    595,   1197,  -1367,   2019,   2014,  -1547,
- -3775,  -1186,  -9690,   -394,  -4106,  -1728,  -1036,   2945,
-   509,  14242,  -1893,  -2494,  -3004,    458,  -1753,   2628,
-  9790,   3450,  -1652,   -322,   8263,   3952,  -2156,  -2110,
-  -442,   1256,   1561,  -4913,  -3452,     74,   3051,   8907,
- -3376,    -96,  16654,    557,    520,   -446,  -2520,  -1712,
-  2151,  -2423,   3761,  -3507,    487,   2103,    777,   -416,
-   509,    468,   3629,  -3155,  11460,   2106,  -2191,  -1014,
-  1154,   9317,    704,   -282,   3098,   2722,     84,    150,
- -5922,   3063,   8373, -11896,  -1157,  -2286,  -1781,   7331,
-  1331,   -334,   -974,  -1653,    752,  -1970,    -89,  -3470,
-  2418,  -1334,   3615,  12770,   -116,   1965,  -1643,   1480,
- -2225, -10686,  -1174,    530,   -972,   -933,    719,    722,
-  1530,   -317,    105, -14155,   2569,   4506,  -8502,   -681,
- -1544,   -542,  -2814,  -1161,   -629,  -1776,  -3540,  -1366,
- -3681,   1838,  -1630,   -703,  12613, -12335,  -2020,   2173,
-    27,    315,   4766,   4590,  -1603,    -68,   1154,  -2940,
-  1198,   7884,   2502,   -586,    440,  -5124,  -2454,  -2597,
-  -826,   7401,   2803,   4552,  -3212,   2966,  -5567,    588,
-  2216,   7444,  -2633,  -5922,    434,   3423,   4084,   2296,
- 13258,   2070,  -4624,  -1226,    166,   -367,   -527,   1110,
- -1407,   -150,    140,    584,   -373,  -2649,    862,    500,
-  3292,  -3506,   -679, -20109,   1775,   -726,   3378,    754,
- -1962,  -5764,  -1338,  -3628,   -691,   4554,  -1890,  -6021,
- -6566,   2590,    262,   2509,    257,  -4386,  -2480,   6352,
- -2026,   1234,   -399,  22808,  -2221,   -626,   -714,   -339,
- -1196,   -455,    -80,    713,   1662,    474,  -2324,   -527,
-  4101, -10526,  -4617,  10492,  -1143,    805,   1360,   3796,
-   942,    684,   2596,   1313,   1589,   -570,   5476,    -27,
-  9220,  -1493,   2631,  -6726,  -2976, -14295,    137,   -734,
- -2015,    658,    323,     83,   2539,  -1230,   1714,  -2080,
-   658, -18803,   2978,    996,  -3374,    -28,  -1335,    150,
-  2154,   1069,   -852,    293,    535,  -1004,   -993,  -3692
-},
-
-.cb1616m0 = {
--16476, -11442,   -305,   -196,   -767,  -2167,     -1,    378,
- -2200,     22,   2405,    944,  -1786,   -806,    669,    952,
- 10435,  -2752,  -1625,   1060, -12314,   1283,    234,  -2405,
-   627,    798,  -1058,    311,  -2794,  -2715,     73,   -214,
-   813,  -2749,  10732,   -445, -12147,  -2507,  -1972,   1652,
- -1920,    215,    298,   1106,    826,  -7445,     69,  -1679,
-  -675,   1249,   1444,  -1109,    -48,  -1452,  -2368,   3034,
-  -492,  13068,    311,  -3446,    326,  -1426,   2384,  -2146,
-  2916,   8957,   -196,   2212,    447,   1775,   2607, -11962,
-  -278,   4335,  -1743,    135,    212,    -41,    -92,    164,
-   -11,   -504,    828,   -519,   -834,    251,   1919,    762,
- 24917,   -180,   -132,   -330,    138,    225,   1038,      3,
- 32138,   -388,    208,   -638,  -1338,   -165,    200,   -230,
-   225,   -777,  -2270,   8198,    583,   3946,  -1534,   1666,
- -1032,  11384,    202,     30,   2758,   -505,  -2815,   1265,
-    64,    -17,   -360,    636,    134,    502,    259,    872,
--28148,  -1046,   -348,    -86,   -739,     55,    448,    168,
-  -656,   1094,  -1074,   4552,   -834,   2296,   2356,   -572,
- -1917,  10979,   3127,    -52,  -9969,   -527,   1994,  -1626,
-  1041,   3310,  -2319,   2232, -11444,  -2400,  -1788,  -1254,
-  5265,   3198,   7088,   4522,   1292,   -191, -15886,   2787,
-    22,  -1610,    184,    380,    521,    336,   -158,    877,
-   468,   6515,   -756,  -5484,    100,   -464,   9244,  -2726,
- -1644,  -2741,  -5362,  -1635,    894,  -1849,  10118,  -3264,
- -4472,   1255,  -3571,   -437,  -1050,   1505, -11178,   -193,
--11513,    -24,    719,    212,  -1999,   -725,    502,  -1164,
- -1060,   -618,    -91,   -738,    740,  -2254,  -4635,   2700,
-    95,   -853,   1093, -11620,   -968,   9492,    -25,   -664,
-   367,   1105,   5501,   -112,   7516,  10286,    821,   -484,
-   204,   1425,  -3491,  -1234,  -4240,   3807,   2877,   1824,
-   423,    466,   -428,   -845,    -86,  13276,   8436,   -690,
-  -688,    574,  -2874,   -552,   4540,    926,  -5443,    629,
-  -395,   2090, -17468,    335,   2419,   1275,  -3750,  -1589,
-   470,  -1735,    330,   2532,   1094,  -6218,   -884,   -236,
- -9678,  -9945,   -447,    542,   -728,  -1922,    108,  -2193,
-  -946,   3270,   2121,   2624,   1010, -10742,   -102,   2813,
--13070,   1523,  -1532,  -1291,    420,  -1999,    262,  -1194,
- -4226,  -1450,   -275,     83,   1168,   1590,  -1517,   -426,
- -1424,    152,    676,  11463,    824,  -2092,  -1106, -11502,
- -2327,   -278,   2597,    -11,    793,   -118,    393,    580,
-  -499,   -743,    -77,   -427,   -408,   -692, -29195,   -247,
- -2014,   -922,     97,    581,   5469,  -1419,   -698,   1490,
- -3814,  -2818, -13816,    680,   3595,   1544,   2366,  -3018,
-  2479,    323,    346,   -260,    337,   2730,  12214,  -1118,
--11301,  -3028,    212,    -41,   1764,   -580,    553,   5454,
-    -8,   -366,  -1202,    901,   -796,  -8350,   4380,  -1452,
-  -300,   1152,   3058,  -3476,    -27,  13046,     34, -11438,
- -1321,  -1528,  13237,    114,   2514,    976,   -571,  -1192,
- -2050,  -1635,   -964,    416,    -23,  -1083,     -9,  32767,
-  -548,    556,  -1217,    -56,    325,   1048,   -145,    202,
-  1520,     44,    402,    400,   -611,   8667,  -1083,   1068,
-  1224, -12031,   2318,  -1109,   1266,   1306,   4673,    285,
- -5603,   1555,   -100,  -1059,    403,   -213,   -680,   -904,
- 11443,    581,  12160,   -638,    309,    -65,    933,  -2280,
-  1958,   2642,   1808,   7945,  -2088,    850,   -428,    785,
-  -989,   1234,  -1413,    745, -10756,   1943,   -184,   3252,
-   -96,    932,   -664,  13222,  11326,  -1374,   -327,   1901,
-  1069,  -1540,    104,   -139,   -904,    106,   1664,    925,
-    46,    353,   -835,   -554,   1618,   -956,   -437,   -727,
- -3403,   1038,    968,    436,     46,  -4385,    340, -16903,
-  -498,     47,   -554,   -399,  -2418,   -347,    358,  23280,
-   234,   -172,   -338,   1058,  -2172,     -1,   1710,    -64,
-  -583,  -2224,   -780,   -637,   3500,    108,   1045,    828,
-  -728,   9466,  -2487, -12773,   1924,  -1158,    208,     49,
-   136,  12055,     42,  -1381,   -375, -11534,   -249,   1602,
-   996,    204,   -710,   4761,   -511, -15761,    166,  -1184,
-  -192,     50,   -105,    890,  -9566,   2062,  -1536,    133,
-  -185,   -643,   -172,   -894,   -355,    -16,  -1395,    542,
-  2160,   -481,  -1104,   -793,    517, -20454,    698,   -181,
-  -135,   -434,   1677,   -181,   -415,   -738,  -1574,   1664,
--14058,    597, -12354,   -460,   -313,   1724,   -686,     85,
- -1162,   -648,    865,    165,   -225,  -1947,   2818,   -778,
- -4010,    402,    686,  11170,   -332,  10336,   -757,   4794,
-  2204,   -477,   -292,   -366,   8412,  -2476,    494,    510,
- 10514,    769,    642,   -441,   1079,   6954,   4246,  -2272,
-  -290,   -224,   1312,    398,   1536,   -692,    330,    157,
-  -946,   -100,  -1830,    214, -25652,   1382,  -1836,   -440,
-   110,   -506,   -438,  -2370,    126,    562,  -3515,   1014,
-  8526,  -1641,  -2493,   4411,  -9210,   2110,    625,    114,
-   323,   2450,   2407,    682,   1999,  -9424,   2480,     69,
- -2091, -11845,  -3684,   -429,  -1622,   -919,   -518,     70,
-  1450,  -3523,   5126,   5706,  -1451,   2633,    820,   -204,
- 11338,  -8014,    753,   -103,    290,   -923,   1408,    298,
- -1962,   -887,   9691,  -1366, -11048,    -55,   -223,  -1040,
-  -163,    132,    676,   -760,   4990,   -310,  -9286,  -2427,
- 14442,   -418,   -802,   -359,   -323,   2877,   -210,  -1436,
-  1574,  -1206,    265,   -155,   -225, -32768,    347,    222,
- -1165,    200,    924,   1135,   -843,    -66,   -343,   -334,
-  -113,    209,     14,   -203,   1214,   -896,    910,  -1496,
-  1831,  -7833,   -841, -10453,   1605,  -8514,   -477,    -48,
-  -241,    -58, -32768,    213,    108,    450,   1155,    -30,
-    89,    240,   -768,   1332,    290,  -1377,    951,    586,
- -8939,   1298,    496,    705,  -1661,   1798,  -1906,  -2233,
- -1716,   -986,  -2204,  -1149,   2686,   8578,  32767,    645,
-  -661,   -135,    770,   -432,   -550,   -385,   -272,    625,
-  1234,   -729,     19,   1753,   -284,   -106,   -655,    750,
-  -442,  23143,   -328,   -520,   -506,    790,  -1048,   -730,
-  -471,   -438,    483,   -374,    939,   -226,   -397,   -849,
--12054,   -772,    -40, -11776,    232,   -540,  -2497,   -679,
-   337,   1357,    458,   -341,  -7542,   1001,    492,   -416,
- -1496,  -8966,   9814,  -1752,   -674,   2526,   -544,  -2900,
- -1318,  -1578,   -238,     75,  11181,   1750,  -3182,    564,
-  -570,    528,   1004,    146,   1144,   7430,    158,   9524,
-   -36,   -340,   -441,    596,  -1659,   1420,   -686,    -36,
-  -596,   2215,  -1295, -19722,  -2149,  -1046,  -2339,  -1166,
-  3057,   -370,   -556,    -33,   -322,    260,    -23,   -106,
-  -323,    147,    -57,    179,    458,    684,  -1283,   1251,
-  1231, -18548,   -513,   -480,   -695,    593,   3072,   1960,
-   322,   -702,  -1043,   -544,   6005,   1378,    100,   -225,
-  -848,  -1294,  -3346,    828,  -2610,  -3010,   9623,  -1329,
-  1956,  -1098,  -3730,   1137,  12413,  -1260,   2457, -10844,
-  6824,  -4289,   -653,   -302,  -4415,    650,  -1684,   6129,
-  -370,   -652,  -3245,   -473,   -150,  -3018,   1864,  -1258,
-   928,  -2379,  14451,   -119,   2282,   -248,   3139,   6502,
-  4318,   2214,  -1627,    126,   -422,    326,   -622,   -302,
- 32252,   -268,    456,   -260,   -260,   -968,    391,   -497,
-   152,   1764, -10580,   -369,    277,     70, -13137,  -1114,
- -1111,    464,   2266,  -2968,    728,  -1216,   1726,   1044,
-   344, -16436,   1558,   3178,   -551,    604,    442,   -891,
-  9570,   1596,   -541,  -2182,    730,   -906,    242,    935
-},
-
-.cb1616m1 = {
-  -116,    -53, -24868,   -544,   -783,     97,   -912,  -1202,
-  -622,   -147,   -215,   -362,    -16,   -522,  -1694,   -358,
-  -724,   2628,    439, -18106,  -1566,   3048,   4133,  -1238,
- -3233,  -1130,  -2884,  -2762,   1031,  -1037,     63,  -2219,
- 10701,  -1518, -10322,   1425,    792,  -1820,    380,   -777,
- -3017,   1531,  -1052,  -3491,   1085,   -428,   -765,   -113,
-    42,   -265,    365,     99,   -859,     35,    610,     44,
-  -495,    262,   1689,   2082,  21605,    412,   -717,  -1163,
- -3285,  -5062,  -1583,    599,   -277,    -62,    615,   6014,
- -1781,    465,   -544, -14114,  11277,    -20,    696,    663,
-  1156,   -240,    631,  -2802,    333,  -2544,  -1628,    775,
-  -960,   -553,    496,   -378,    526,   -421,   -426,    290,
-   555,    403,    390, -31714,     25,    449,    654,   -334,
- -1317,    165,    496,   1554,    -88,   -777,    626,  -1511,
- -9020,  -1725,  12705,   -798,  -1240,    195,   1932,   -833,
-  -939,     43,    182,   2547,   4879,   9234,    370,   2058,
- -7757,    544,   1106,   -660,    546,   9983,    225,    124,
-   952,  -2153,  -1732,   2760,  -1270,   -176,   3334,  -6735,
-  -526,  10475,   -627,   7835,  -2263,    475,    731,    908,
-  8264,   1605,   -192,   5026,   2414,   5223,    595,   1093,
-  2345,   -796,   8663,   1028,   8188,   -185,  -1506,  -3044,
-  -100,  -1818,  -6369,   -170,   1728,  -9249,    886,  -2111,
-  -349,  -1146,   2127,  11622,  -8043,   2880,   2215,   1693,
- -2303,   1698,   1121,  -3575,   -927,   -716,   1940,   2514,
--11672,   1619,    916,     -7,   -585,    508,  -1316,   -972,
-   778,   9774,  -2126,   2368,    -56,   6716,   1169,  -3656,
- -1330,   9530, -12158,   1188, -11426,   -353,    945,  -1941,
-  1750,    962,  -1133,   1793,   2318,  -2641,   1109,    933,
-   804,    505,     60,  -1642,  -2238,  -2328,  -1558,  -1568,
-   -27,    952,      4,   1376,   -862, -18404,  -1828,   4107,
-  -454,     52,  -1202,   1150,    686,  -1950,   -497, -10883,
-   400,   -422,   1734,    -54,  11165,  -3309,   6402,   -877,
--19967,   -400,   1642,   1305,  -2432,  -3115,    375,   3898,
-  1812,  -5305,   -946,   1717,   -757,   3322,    126,    747,
-  1836,   9957,   1904,    658,  13043,  -1779,    675,    716,
-  -453,    670,  -1572,    210,  -1533,   -133,    294,    546,
--24084,  -1036,   -485,   -117,   -184,   -624,    273,   -901,
-   866,    609,  -1119,     28,    250,     13,     70,   1178,
-   882,   -632, -21624,  -1339,    926,  -1814,  -1279,   1868,
-  -181,    383,   -679,  -1070,   5091,   1148,   1034,   2144,
- -2779,  -3810,   4536,   1713,   1003,  13322,   2866,  -3217,
-  2508,   4395,    480,     14,    167,    763,    -34,   1034,
- -1342,  -1349,   -100,   -225,    464,   -914,  -1403,  -1851,
- 23767,    770,   -457,   -257,  -1072,   1201,    583,    -59,
-  2627,   1469,     -7, -11642,   3352,  -1003,     -6,  11588,
-  -311,  -2435,  -2180,  -2352,   1952,   5532,   1945,   7281,
-   504,  11882,   -603,     45,     42,  -1396,  -1115,  -1041,
- -1061,    566,  -2733,   -765,    687,    118,  -1174, -20412,
-  -244,   -986,   -151,   2888,   1102,  -1303,   -135,    529,
-  1186,  13220,   -183,    906,  -4209,  -4455,   2247,    246,
- -6474,   2794,   1450,  -6495,  -1819,    598,   -438,    244,
- -1064,   -673,   -672,  -1563,    543,  -2278,  -3087,   -811,
-  1866,     80, -18987,   -682,    569,   -551,    514,   6876,
-  7582,    839,  -4031,    823,   2342,  -1300,   1180,    702,
--10168,  -1957,    485,   -374,   -151, -11066,   -461, -12824,
- -1221,   1281,   -718,   2012,    330,   -289,   -487,   -207,
-  -722,    394,    156,  -2023, -11006,   -373,     -4,   -238,
- 10581,    991,  -1236,   -814,    553,   1295,  -2269,   2783,
- -1973,    681,   9759,   3674,  -1680, -12118,  -1340,  -2372,
-  -288,   2143,   -328,    809,    312,   2038,    736,    -10,
-   908, -11319,     74,   6362,  -1122,   1546,   -184,   1630,
- -1851,  -2143,   1048,   8858,   -462,  -6458,  -1540,    811,
-   130,  -3542, -10424,   9353,    388,   1168,  -1797,   1796,
- -4151,  -2329,      1,   -272,    846,   -642,    248,  -1144,
- -9863,  -1684,   -190,   7611,  -4147,   -692,   5354,  -2363,
-   609,  -4926,   3166,   2094,    857,   -369,    118,    725,
-  -899,   -601,     -6,    556, -32540,    950,   -478,    757,
-   136,   -560,   -754,    562,   -448,    223,   -704,    616,
-   365,  22610,   1191,  -1264,    -94,    927,   -294,  -1270,
-   -16,  -2520,  -2026,    420,  -6621,   -504,   9666,    452,
-  -379,  -1888,    536,   1161,  -3021,    609,  -4890,   -231,
-  3926,   -943,  32767,   -615,    300,    870,   -742,    429,
-   -42,    155,   1060,   -900,   -347,     34,    491,  -3625,
- -1529,  10175,    178,  -7938,   -406,   1628,   -362,  -7340,
-  -433,    489,    568,    674,    536,  -2886,  -6118,    -16,
-  -531,    182,   1498,  -4194,   -306,     63,  -1429,   1109,
-   631, -10386,    -16,  -5938,    -52,  10638,   -793,     35,
-  -874,   1633,   -252,    709,   -286,   -780,  17172,    -32,
-   912,    137,  -1684,   2781,  -5637,    338,  10961,   1401,
-   176,   1890,    563,   -371,    578,   -235,   -882,   -616,
-  -591,   -672,   -821,  12194,    917,    778,   -427,    358,
- -1411,   2032,  -1372,   1891,  -1784,   1830,  -1808,   -464,
- 13973,   2016,   8606,   -914,  -7329,  -1853,  -2627,   2219,
-  2628,   2161,   2185,   2414,   8857,   -273,   1016,   2253,
-  1070,    907,    367,   -430,    574,   1039,     93,    170,
-   255,   -267,    550,   -668,    287,   1827,  19833,    244,
- -3731,      4,  21365,   -127,    356,    643,   2016,   3290,
-  1242,     46,   -734,  -2298,   -316,  -6618,   -296,  -1465,
-   657,  -1451,    469,    212,   2823,  -2803, -11862,    931,
-    44,    660,   1576,   1848, -10529,   2813,  -1163,   -260,
-  -195,  16320,  -3447,   -262,    -76,   -439,  -3487,   1292,
-  3330,   -616,   1477,   1900,   8843,     81,   -846,   6845,
-   -95,   -112,   -231,    129,   6982,    165,  -3115,   2456,
-  2032,  12201,   2747,   1691,   -728,  -1935,   -239,    968,
- 15578,  -2260,  -1813,    440,   2188,  -3845,   1278,   -136,
- -1388,  -7850,   -462,   2921,  -1740,   -136,    164,    103,
-  -206,  32767,   -459,   1249,    736,   -590,   -797,    628,
-   612,    327,    396,    552,   -128,    -76,   -258,   -557,
-   429,    170,    532,   -347,    169,   -593,  28319,   -633,
- -1339,   -997,   -258,    324,    628,   3254,  -1118,   8902,
-   -63,   4762,  -2820,   2429,    820,    -46,  -5366,  -2193,
- -9005,  -1304,   -597, -10143,    555,  -3000,    294,  -1577,
-  -871,   -140,    726,   3700,  -2226,    903,   -253,  10330,
- -2946,    656,    725,   -668,   -920,   1653,   1312,   1623,
- -1150, -11970,   2157,   4532,   -340,  -8648,   -616,  -1429,
-  -980,    -30,    647,   -474,    442,   5098,    188,  -1258,
- -8172, -10927,  -4207,   -112,   2501,  -3241,  -1949,    159,
-  -525,   1090,    420,  10418, -11897,   1072,    -78,  -1028,
-  3367,  -2647,   3421,   2021,   2358,   -973,    272,  27911,
-   472,   -402,   1397,   -927,  -1032,  -1274,    848,    221,
- -2745,   -710,   -692,   -409,   1922,    142,    594,   1053,
--11350,   -791,   3767,   1569,    541,  11921,    134,    368,
-  -948,  -2689,    896,  -1193,   1190,   8514,   1436,   1017,
-   599,  -3358,   4002,  12936,   -675,   1044,  -1210,    296,
- -1109,   1992,   1282,    774, -13102,   -608, -11145,    134,
-   278,    944,   -888,    350,  -1574,    189,  -2542,   3476,
- -3018,   3368,  -9304,  -1839,    533,     -2,   1057,    686,
--11819,  -1146,   -973,   1594,   3526,  -2890,  -1528,   3489,
-  -475,   -259,  -9610,   -475,   -984,  -3559,   -742,    408,
-  -130,  -2291,    899,  12177,  -1934,   -162,  -3238,   1610
-},
-
-.cb2220l0 = {
--12528,    350,   1782,   -474,   1439, -14269,     -8,  -1782,
-  -753,  -1720,    167,   -440,  -2706,    222,  -1629,   -288,
-   671,   -111,  10270,    878,    152,    330,  -1000,    639,
- -1280,   1111,  -2072,   1439,   -476,    553,  -2974,   -614,
-  1666,   -466,  11811,  -1393,    154,    624,   -697,    176,
-  1108,    504,    250,    572,     -6,    704,     16,    647,
- -1143,  -1407,   -411,  23745,    319,   -189,   -404,   -641,
-   -86,   -707,   -770,   -302,     13,   -398,     76,   -681,
-  -525,    354,  -1225,   -757, -23170,   -484,   -965,   -430,
- 13477,    898,    505,    -17,  13812,   -890,    357,    662,
-  1000,   -935,    -60,    944,    400,   -432,   -221,   1047,
-   307,   -180,   5260,  16509,    650,   -269,   1563,  -6002,
- -3082,    186,  -3334,  -5770,   1010,   -394,    128,   -699,
-   537,    -27,   1014,   -531,    -50,   -163,  -1664,  -1026,
-   732,  -1296,  21856,    574,    416,   -745,   -443,  -1382,
-   272,    791,   1308,   -308,  -1636,    168, -10922,    119,
- -1190,   1123,   1492,   1706,   1076,  -2016,   3270,   -994,
-   876,  -2316,  -2992,  12625,   -412,   -159,   5249,   1424,
-  -304,    557,   -431,   -360,   -340,   -561,   -292,   1748,
-  -224,   1789,   -352,    386,    136,     76,   1309,   -270,
--24204,   -515,   1142,   2119,   1144,   -173,   1008,   -693,
-  -430,  -1052,   1890, -12483, -11416,   2918,   1591,  -1202,
- -1782,  -1335,   1354,   1703,   -510,   4287,   -854,   1153,
-  2018,   -518,   -960,  11825,   1295,   -563,  11252,    190,
-  4078,    222,  -3115,   3306,    747,   2638,   1015,  -1674,
-  8032,  -2386,    573,   -349,   -832,     96,   9564,  11708,
-  -483,   1326,   1804,  -2903,  -2024,   -234,   1009,   3229,
-  -232,    803,    275,    444,   -629,   -192,    381,  -1289,
-  -109, -29019,    270,   -420,   -408,   -466,    113,   -537,
-  -266,    296,    180,    506,   1015,   -565,   -517,   1494,
--11053,   3968,  -1735,   3474,  -1991,  -8326,   8075,   1740,
- -3995,  -1287,  -2558,   1030,   3742,   -618,  -2600,  -1783,
-  2696,   1480,   1054,    341,   3762,   4225,  -1742, -11582,
-  4348,  -8756,    493,   -404,   3840,  -1049,   -683,   -962,
-   163,  10997,    -97,   -848,  -4632,   2794,   2684,   2540,
-   739,   8534,   3688,   -878,   3138,   2576,   6444,   3674,
- -2371,   -218,   2864,  12270,   2866,    189,   4549,   4894,
- -6378,  -1050,  -3166,  -5897,   2245,   2803,    -70,  -1909,
-  2783,   3951,    153,  11221,   -658,  12780,   -238,   3418,
- -2235,    754,    311,   -739,  -2414,    702,   1076,    303,
-  -320,     47,  -3288,   -234,  -1376,   3022,   -103,  -1780,
-   716,  11886,  10942,  -5402,  -5431,   1196,   -624,   -885,
-  -652,  -3248,     74,   -435,   -686,    154,   8675,   3325,
- -1779,   -341,    564,   -901,   1335,   -639,   3494,  -1820,
-   290,    -92,  -3088,   4775,  -2140,   2334,    710,  10536,
--15042,  14823,  -1082,  -1045,   1008,    734,    241,  -1048,
-  -933,    245,    913,    114,    322,  -1798,    246,   1067,
-   348,    408,   -183,   -728, -12915,    685,   1525,   1694,
-   183,   -168,  12703,  -1268,   1613,  -2072,   1546,    743,
-  2356,   2135,   -550,   -153,   1327,      2,  12487,  -3111,
-  2347,  -1722,   -300,   -193,   2222,  -1928,   -658,   -384,
- -5738,  -1141,   3634,  10312,    -69,  -1549,  10879,   1795,
-  -361,  -1838,    143,   1202,    327, -15549,  -1268,   -194,
-  3284,    -12,   -344,  -2042,   1663,    334,   -798,   -873,
-  1736,   -324,    195,   -417,   -382, -22936,    812,   -478,
-  -962,   -451,    730,    382,   -135,   1311,   -290,    122,
-   148,   -775,   -305, -32218,    -84,     98,    374,    369,
-   -44,    923,   -432,    156,  -1471,    236,    -39,    143,
-  -146,    835,    135,    229,   -297,   1690,   6786, -12169,
-   815,   -176,   1868,     -9,  -3052,    108,    114,    260,
- 11337,  -2689,   -132,    765,   -239,     54,    691,  -9737,
-  -627,   -474,  12212,   2222,  -7595,   -239,   1793,   2115,
-   563,  -2390,  -1991,   2906,    675,    923,    146,  -3605,
-   981,  -1725,     92,   -562, -21192,    304,   -450,   -323,
-  -889,   -726,    688,  -1186,   2590,    466,    326,   -734,
-   308,   -782,  -3219,    963,    454,   1348,   -513,    953,
- -1414,   -320,   1012,  -1148,   1185, -17356,    -15,   1546,
-  1346,   2182,  -2457,   1426,  -1690,    155,   8793,   1394,
-   510,   2608,   -203,   2697,    608,   2612, -13542,    177,
-  4642,   -824,   1877,  -1864,   1681,  -1033,   1487,   -749,
-   356,    -11,     -1,   -366,   -215,   1531,    -38,   -922,
-  -378,   -296,   1245,  19967,  -2389,   -459,  -3729,   -163,
-  6578,    354,  -1471,    195,    353,   1831,   -605,  -2291,
-  -359,    947,   8409,   3454,  12416,   2434,   3485,     40,
-   350,   1640,    738,  -9827,    935,   -171,   -944,   1407,
-  -399,    571,   2805, -13108,    784,    678,   2405,    328,
-  -417,   1188,  -1596,   -649,  -1358,  -1130,    341,    202,
- -2459,  11307,  -2250,  -3518,  -1812,   3338,   -924,  10027,
-  3004,    703,   -184,   -666,    223,  -1644,  -7221,   3507,
- 10108,   1324,   -412,   -371,    -92,   2496,   3182,     10,
- 10269,   -998,  -1010,    610,   3296,  -1842,    407,    406,
- -1609,   -181,   2202,   -662,  -1450,   1360,   1488,   -212,
-  1501,   -214,   -555,    168,    275,    301,   -950,   3272,
-  -323,  20632,    -21,  -1729,  11013,   2149,  -9278,   6735,
-  -593,  -7374,   -430,  -2776,   2343,  -1374,    519,  -4876,
-   827,  -2477,  -1971,   1249, -23380,  -1810,    199,   -761,
-  2182,   1654,    447,   -488,  -1219,    364,    -53,   -382,
-  -989,    154,   -545,   -872,    776,   -211,   7706,   -767,
-  8006,   -138,   1989,   -180,    306,    486,   1112,   -648,
-   -12,   1538,   -300,   2458,  -5833,  -1181,  -7680,  -6700,
-  -621,   -308, -29995,    602,    -24,     94,    752,    517,
-    86,   -249,   1058,    704,   -404,   -387,    106,   -632,
-  -159,   1275,   -197,  -1263,  -1210,  -1689, -10488,   1950,
- -2037,   5974,  -3960,     38,   1284,   2851,  -2813,  -1613,
- -1646,  10164,    138,  -2956,    196,   -118,   -484,    860,
-   124,   -262,     30,  -1448,    128,    287,    327,    590,
- 27272,    391,   -738,  -1631,   -481,  -1511,     82,   -574,
-  -737,   -614,   -447,    -80,    292,    -19,    252,     -2,
--28117,    332,    141,   1485,   -154,   1382,  -1755,   -422,
- -1692,  -2144,    910,   1004,   1894,  -1537,    897,   -458,
- 19483,  -1321,   2280,    622,    288,  -2253,  -1001,   -976,
-  -408,   -394,    132,   -250,   -428,    -22,    140,    287,
-  -141,  30981,   -293,    631,    729,     -2,   -231,   -127,
-   377,   -879,   -294,   -107,    253,   -964,   1258,    570,
-    71,   9421,   8358,   9295,   8354,   -546,   1153,  -1807,
-  1577,   2911,  -1808,   1808,  -1631,  -1348,  -6977,   -382,
-  1625,  -2793,  10633,   1977,  -1793, -12480,      1,   2010,
-    23,    423,   1102,  -1920,   -478,   1845,   1016,    465,
-   758,    800,  -1540,   5448, -10472,  -2749,   -989,  -6362,
-  9283,    373,  -2560,  -5478,  -1618,     20,   -564,  -1074,
-  4075,   -471,   -515,    409,  -2069,    359,   -788, -11618,
-  2524,    917,   2757,    243,  -3261,   6922,   6268,  -3148,
- -2804,  -3412,  -4262,  -1903,   1043, -12255,   -162,   1598,
-   496,    454,   1401,  -1635, -12711,   -673,   3392,   1255,
-  1602,  -1206,   -297,  -2066,   3009,   1149,   1285,  -1307,
-   412,  27971,    183,    569,   1304,   -706,    824,   -635,
-  -358,   -340,    -28,  -1344,    955,     14,    676,   -243,
-   -20, -11947,   1350,   8122,    196, -10161,   4925,  -3764,
-  1661,   -401,    145,    253,    680,    718,   -614,   -613,
-   498,   -293,  -4257,   -684, -14853, -10522,    698,   1537,
- -2016,   1162,  -2684,  -1578,      8,   -238,  -3214,  -2749,
- -1577,  -1187,    113,  -1457,   1068,    590,     25,   -644,
-  1000,   2430,  -1612,  13246,  -2684,  -1642,  -4648,    816,
- -1103,  -7556,   5753,  -3998,  -1338,   -776,  -1958,  -9652,
- -1288,   -290,  -4240,  -2788,  -8191,   1625,   2558,   1238,
- -1824,    -39,  -3129,  -8916,  -3302,  -5632,  -1768,    866,
-   708,    684,   3530,  -8772,   1485,    677, -10398,    686,
-  -852,  -6974,   5286,  -2658,    612,   1180,  -3367,   4285,
-  5708,   1416,    166,   2787,  -3697,   1431,   1648,   7942,
-  -544,  -1064,   -514,   -840,   -870,   1246,  -3582,  -9310,
- -3802,   4025,  -8251,   5978,    132,   -619,   2792,   9786,
-  1244,    242,  -1948,  -4701,  -5904,    951,   7486,  -3494,
-    48,  -4468,  -2403,   6090,  -2343,  -4175,   1336,  -2546,
-  -281,   -736,  -1758,  -1720,  11066,   -918,  -1354,   3885,
-   -33,  -4116,   1246,   -218,  -8082,   -766,   7796,   1505,
-  1559,   -964,   1741,   -454,  -1628,   -762,   3034,   -804,
-  -888,  -9682,   9603,  -2556,   2874,  -5456,   3066,  -7747,
-   956,   -660,  -1538,   -381,   -760,   1747,    547,   -517,
-  -697,  -1411,    410,   -514,  -3988,   -219,  13358,  -2393,
-  -280,  11230,   2640,    795,   2534,  -8094,  -1838,     71,
-    16,   -203,   4224,    -96,  -2829,   2010,   1961,  -1312,
- -1266,   3952,   6894,   6996,  -8062,   4708,   1193,  -3439,
-  1549,    935,    170,    614,   -868,     43,   -246,   -188,
-  -940,    130,    126,   -736,    697,   -510,    -56,   1596
-},
-
-.cb2220l1 = {
--13582,   1049,  15596,   -101,    707,   2677,    542,   -522,
-  -636,    194,  -2361,  -1252,    524,    -32,    227,   -419,
-  -652,   -601,     84, -10428,  -1417,  13117,   -573,   3774,
- -3632,   2025,  -1237,   -692,  -1486,    192,   1221,    452,
-   436,   -764,  -2636,   -153,   -685,    118,   -424,   -635,
-  -458,    209,   -577, -12042,   4240, -10861,     49,  -1534,
-  -991,  -2416,   -280,   2095,  -1841,   1278,    -94,   -423,
-  -572,   -949,    734,  -1087,  12449,   6514,  -4582,  -7845,
- -3722,   1446,   2531,  -1238,  -2070,   1515,  -1331,   2382,
-  1066,  -1298,  -1189,   6811,  -1868,  -1082,  -1732,    356,
- -2622,    493,  -3345,   1367,   1737,   4497, -14734,  -1350,
-  -354,  -1340,   8478,  -1152,   1832,   1793,    830,    974,
--13918,    522,  -1472,  -2502,  -2625,   -157,   -360,    -17,
-  -830,    673,     36,  -1339, -14860,    522, -13377,    851,
-   937,  -1103,    -44,    408,   -364,   -953,   -392,   1837,
-  2342,   1236,    111,   -218,   -919,    985,  10077,  -1065,
-  1840,   -124,   3780, -11015,    204,    437,   -830,   6712,
- -1720,    288,   -991,   1094,   5647,  -1296,  -2284,   1642,
-  1000,    -35,   -115,    208,   -244,  -1099,   -832,  -2092,
-   802,   -163,   3343,   -964,    314,    126,  -1204,    754,
--17838,   -826,   4414,   8331,   -770,   1246,  -3500,   1680,
-   833,   -108,    494,   -910,  -6314,  -2832,   2553,  -6230,
-  1165,   3631,  -1717,   2404, -32768,    520,    -38,   1228,
-  -708,     58,    260,    771,    588,   -448,    389,    156,
-   606,   -830,    400,   -488,   -188,    536,  -1428,  11982,
-  -156,  -1407,   1796,   1036,    905,   1371,  -1472,    325,
-  3098,  -1436,   6449,   2105, -11183,   1632,  -1848,   1019,
-  1247,   1308,  -1351,   -823,   1679,   -651,    978,    296,
-  1088,   3965,  -1414, -11838,    139,   8664,  -3452,  -1804,
-  3088,  -2044,   -221,  -1347,   1232,   -909,  -1323,  -1409,
-  1399,   2557,  14552,   1535,  -5088,   1699,   1012,   3333,
-  3940,   2294,   1189,  -2256,   -484,  -3307,  -1333,    464,
-  -305,   -744,    -24, -20464,    332,   2968,    308,   -649,
-   292,   -402,   1226,  -2575,  -1505,   -100,   1413,    733,
- -1024,    616,   -121,   -322,     67,   -161,   -708,    251,
-   462, -26697,  -1112,  -1381,   -324,   -286,   1091,    662,
- 15830,  13124,  -1049,  -1816,   -355,   1848,   -801,  -1710,
-  2513,    458,   -798,    386,   -726,   -356,  -1240,  -1133,
-  -388,    631,     91,   1867,   2511,   -306,   3097,  14399,
-  -571,   2191,  -2916,   2850,    761,  -2442,    698,  -2193,
- -2739,  -1914,  -4077,  -4631,  12702,    333,   1162,  -6248,
--12466,   -310,   -107,  -2465,   -163,   1970,   -998,  -1253,
-  2007,     79,   -426,   -276,    365,    568,   -520,  23642,
-   276,   1059,    184,   1081,    650,   2286,   -191,    883,
- -1946,    246,     64,   -225,    800,    910,   -136,   1187,
-   955, -15604,  12847,   -747,    874,    506,   -646,   1920,
-  -449,   -321,   1152,   1341,   1653,    341,    -32,    907,
-   673,   1045,   1245,   -499, -10331,   4683,  -1121,  -3164,
-  3382,   6397,  -1341,   -769,   1186,    229,  -1354,  -7370,
-   155,   1858,   5617,  -3487,   -247,   -783,    724,    508,
- 14029,   -528,   1853,   1572,    580,   -708,    528,  -1394,
-  8922,   2284,    550,   3084,  -1726,  -3235,   -700,   7132,
- -3540,   -200,   3288,   -815,  -2189,   1232,   2412,   2088,
- -1101,  12592,    806,   1508,   1741,     13,   1124,  -3883,
-  -687,  -8180,  -3094,  -3346,   1781,  11836,   -657,  -3469,
-  1429,  -1822,  -3433,     87,   3871,    651,   -965,  -1757,
-  6778,    109,    112,   -131,    710,  11943, -12107,  -3460,
-  -726,   1002,  -3803,    580,   2756,  -1293,    116,    457,
-   581,   3834,  -1678,   -977,   1242,  -2040,    232, -10034,
-  1644,  -2290,   1368,    172,  -3012,   1423,  -2620,   3608,
--10831,   -303,  -1610,   3246,    562,   5212,    448,   -877,
-   954,    688,  -8981,    579,    717,   1315,   -952,   6817,
-   662,   3218,   7213,  -2116,  10446,   1012,   2270,   -858,
-    10,  -1066,  10618,   6108,   -547,   3221,   -893,   3888,
- -1088, -10085,   -247,   1064,  -3500,   3123,  -2480,  -2128,
-  2788,  -2253,  -9756,   -472,   -166,   -680,    727,     74,
--14151,   -189,  -1734,    610,  -1169,    845,     94,   -786,
-   394,   -581,    500,   1981, -10940,    354,    500,    399,
- -1952,   -373,   2197,  -4712,  -2582,   2751,    654,    613,
- -1254,   1406,   2056, -12518,   1583,   -582,   4834,  -1541,
-   508, -20580,    270,   1214,    515,  -1082,      5,      7,
-  -533,    -28,   1270,  -1307,    497,    -57,   -331,    933,
-    92,   -856, -10458,  -4576,  -9991,   2426,   6552,  -3022,
-   279,   -562,   -192,   1878,  -2237,   4978,  -1753,    332,
- -1462,   -853,    238,    478,   9746,  -7385, -10290,  -8278,
-   457,   3121,    841,     48,  -3745,  -1298,   -637,  -1820,
-  -468,   -248,   1400,    394,   -125,   -950,  11524,  -1860,
-   426,   -773,  12669,  -1620,   -158,   1625,   1045,    768,
-   -66,    -12,   1625,   -770,    559,     54,    593,  14468,
- 14994,    490,    543,   -811,    700,   -277,    900,   -178,
- -2000,    475,    241,    950,    106,  -1260,    874,   -862,
- 18907,  -1947,   -844,    205,   1253,    -83,   1966,   2300,
- -2694,    852,   2450,    661,   -334,   -518,  -1136,  -2377,
-   325,   1152,    511,    881, -22205,    898,    574,   -582,
-  -265,  -1362,   -253,    -40,   -780,  -1967,    469,   1484,
-  -818,   -926,    958,   -415,  -7934,   -330,    330,   1439,
-  1643,     77,   1034,   -156, -12094,   3782,  -5725,   -520,
-  -598,   2345,   3506,   5333,   -322,     99,    -48,   1490,
-    20,  11393,   3468,  -1144,   7013,  -3728,   7145,   1432,
-  1810,     26,   -912,  -6530,  -1079,   1771,     95,   4007,
--11346,    -43,    249, -14616,   -249,      1,   -725,    244,
-  1053,   1815,   -626,    408,   -344,   1972,   2222,   2288,
- -2324,   -411,  -3993,    494,   -706,  -5078, -11695,  -3645,
- -2090,   2465,   5893,  -5096,   6815,   -537,   5003,   1258,
-   185,  -1555,   -875,  -2047,   -170,   -433,   -194,  -1020,
-   349,   -724, -31811,    197,    251,   -418,   -222,   -618,
-   278,    554,    363,    183,   -898,     14,    350,    745,
- -2054,  -1623,    806,   -770,  -1246,   1594,    -54, -18501,
-  1516,    840,    -86,    484,    514,   1209,    978,    564,
-  -537,     34,   -431,    128,    938,  -1807,    832,    -90,
--29509,   -642,   1397,    -52,    523,   -393,    216,    908,
-     9,    -63,    710,   -949,      3,   -184,    175,    613,
-  -687,   -408,     27,   -855,  18258,   1282,   -948,   -219,
-  2374,   1668,  -4567,   1063,  -2045,  12026,    461,   3074,
-  1050,  -1788,    169, -13442,    612,     19,  -2019,    685,
-   452,   -152,    299,    310,  -2327,    348,   -215,   1634,
-  -201,   2162, -10300,  12452,  -3733,   -420,   2388,    518,
- -2308,   -160,   1552,   3347,   1650,   3293,  -1108,   2065,
--12618,     20,    -42,   -643,    202,  -1298,    251,   2489,
-  1322,   2362,   3698,   -190,    592, -12484,   -937,   2072,
-  1531,    302,   -409,   -899,  -1016,   -388,   1103,  30006,
-   789,  -1609,   -548,  -1002,   1055,    605,   -955,   1557,
-   452,   -623,    810,    597,   -696,  10628,  -1174,    606,
-  2628,   -553,  -2297,   6668,  -2600,    787,   3504,  -3606,
-  4087,   1052,   6276,  -7619,    337,   2565,    -13,   1205,
-  -124,   1222, -28082,    -79,   -553,    628,    542,   1315,
-  -609,    322,   -895,   -377,   -694,    610,    239,   -152,
- -2901,   9890,    716,   1030,  -3306,    988,   -738,    562,
- -2209,  -1676,   4507,   1165, -12924,    866,   -154,   3664,
-  -367,  -2580,  -7286,   -572,   2167,    118,    508,  -4429,
-  -480,    842,   2489,  -1636,  -2042,   1125,   1847,   2586,
- -5639,   3361,   -760,  11189,    623,   -282,   1353,   -279,
-   515,   -816,    713,    322,    417,  -2820,  -1114,  -1563,
-   401, -21604,  -1300,   -972,  -2298,   -483,   2176,   -830,
-  2135,  -4084,   1095,   1950,  -1937,    539,   -374,   3197,
-   682,    472,  -1368,  -8095, -12026,   4833,   5586,    467,
-  2400,    148,    381,   -138,    954,   -459,   -724,    970,
-   156,  -1955,  -1363,    560,   -761,  -1708,  -1599, -17408,
- -1064,  -1372,   -500,   1160,    735,    441,   -773,   -228,
-   420,  -1128,    260,    930,  12879,   -926,   -231,   1355,
-  -850,    559,  11377,  -1729,   2478,    961,    336,   1056,
-  5081,   9788,   -555,   4067,   8664,  -2720,  -1462,   3012,
- -7280,    965,   1462,  -4703,   3649,   2084,   -699,   -262,
-   408,   -188,   2193,  -2216,  -4509,   -736,  -1039,  -4848,
- -8243,  -7958,   -172,  -1318,   9566,   4665,   3363,  -3672,
-  1581,   -551,  -2024,   1630,   1543,     90,  -1728,   -792,
- -1799,   2571,     80,   -412,   -301,  -2870,   1796,  -5327,
-   111,  17342,    592,  -2108,    477,   1541,   1266,  -1062,
-  -215,  -2210,    223,   1215,   -197,     87, -18340,    -67,
-   804,   -398,   -118,  -3457,   -741,  -1935,   -704,   -274,
-   566,   -872,  -1821,  12874,   5057,   2069,   1742,  -6205,
- -6115,  -1614,   -294,    187,  -5210,   1734,  -1466,  -2162,
- -2266,   -642,   -148,    440,      2,    233,   -319,   -637,
-  -734,   -230,    301,    508,   -433,    311,   -313,  -1206
-},
-
-.cb2220s0 = {
--15119,   7508,   1337,   4182,  -2914,  -3733,   2686,   -470,
-  2249,  -3901,   1444,   3805,     99,  -1771,   -354,   -903,
- -2755,   -709,  -4980,    214,  -2750,   -652,  -1042,   1434,
- -1090,   -612,  -2574,   1274,   1310,   -760,   1420,   -112,
-  2776,  -4843,  15060,  -4929,  -3942,  -5721,  -1628,  -1142,
-  3023,  -1435,   1402,   1010,    623,  -3527,   2624,    184,
-   988,     98,    340,  16676,  -1262,  -1162,   3183,  -4816,
-  -592,   1019,  -1406,  -2478,   2371,  -1004,   3944,    803,
-  5665,  -2261,  16427,    349,   3113,   -916,    442,  -1754,
- -3551,  -1351,   1563,  -1316,    532,    343,   -392,   1509,
-  -717,   -122,   2462,   -929,   -185,   -683, -18780,   2682,
-  -123,    518,   -379,  -5160,    245,   1940,  13964, -12311,
-   590,    -30,    159,  -1558,  -1940,     36,  -1528,   -515,
- -1178,    856,   -395,     29,  -5854, -12943,  13286,  -2572,
-  1049,    768,   3292,  -3921,    -52,   -462,   1968,   4933,
-   630,    930,   1026,   2606,    319,   -277,   6333,  -2119,
- -4700,   2164,   1583,    154,   2107,  -1467,    339,    634,
--17240,   -595,  -3525,  -2690,  -1788,   -476,    -41,    165,
- -1016,  -1456,   -348,  11289,  -2920,  -3804,   2357,  12012,
-  3848,   1796,   2164,  -5555,   4527,   -201,    965,  -4893,
-  3419,   6441,   1691,    -77,    348,   -769,  27319,   -345,
-  -336,   -541,   -320,    972,    926,  -1026,   1052,    702,
-   224,     76,    742,    220,   6292,   8625,  -3742,   4139,
- -5989,  -5615,   -641,   -231,   -837,   6156,   4141,   3792,
-  4746,   9972,   1800,   -397,  -2237,  -2218,  -7595,  -2761,
-  -496,  -1451,   1178,   -970,  -1226,   2527,  -2105,   1778,
-  1446,   1986,   9970, -13107,   -985,  -1142,  -1367,   -329,
- -4498,    590,     36,   2073,  -1069,    862,    133,   2516,
-   -27,   4494, -11602,  -1638,   2524,   1449,   5684,   -611,
- -9452,  -2618,   5006,   3481,   -639,    379,  -2333,   -498,
-  -713,    382,    784,    269,  -5692,   -350,    524, -18705,
- -1042,  -1349,   1210,   1770,   3964,   4908,  -1131,  17535,
-  -788,  -1896,     30,  -2682,   1044,   1604,  -3740,     18,
-  1771,    331,   4279,   2634,   -368,   -447,  -6995,  -1224,
-  -688,  -5368,   -236,  -8872,   2449, -12189,   4465,   1895,
-  2484,   1315,  -5446,   -457,   -575,    101,   2356,  -1585,
-  3204,   -104,  -7244,  -1678,   -801,  -2620,  -4603, -11876,
- -1787,   2962,  -1796,  -3385,   -411,   5796,   2900,   -562,
-   835,    293,   7127,   4939,    721,  -2972,   -482,    121,
- -2694,  -2277,    412,  12770,   -342,    718,   3306,    502,
- -7281,   -307,    552,   7158,   3289,  -5051,   5230,  -1185,
-  3024,   -942,  -1347,   -283, -13937,   -208,   2576,   -906,
-  1848,   5692,  -2434,    175,   7837,   1872,  -4536,  -3341,
-  -957,  14787,  -1598,   9058,   3776,    407,  -1734,   1259,
- -3011,   -131,  -3589,   -614,    272,  -2968,  -1611,   3645,
- -8126,   2120,   4868,  -5462, -13235,  -3452,  -6077,   5064,
- -1593,  -1395,  -2427,  -1139,   -958,   1585,  -1330,   2178,
-  -778,   3545,   2836,   7712,   5993,   -432,   3575,    929,
- -7951,    115,   2180,   3904,   -193,   1556,   -252,   -913,
-  2574,  11948,  -4525,   1391,  -8513,   4540, -12815,  -3379,
- -4676,   1838,  -5676,   1321,  -6168,   1397,   1020,    438,
-  -141,   3424,    392,   -512,  -1614,  -1396,   -318,  -2451,
-  1545,  -7132,  -1763,   -424,   3575,   -828,  19216,   1978,
-  1624,  -1969,  -1667,   -772,  -2031,   -781,   1732,    244,
-  -212,    416,    900,  -8960,   1002,  -1077,   4667,  -3527,
-  1586, -13109,  -2442,   3829,   4358,   1056,   2960,  -1087,
-  -662,   4775,  -6316,   6157,  -3736,  -2040,   -187,    904,
-  1254,   -636,   2032,   -734,  -1271,  -2691,   3376,    564,
- -7769,  -5482,    840,  14171,  -5828,   -966,   1685, -10192,
-  -388,   -434,   3706,    594,   2188,    365,    209,    298,
-  1825,   -236,  12762,   1644,   3199,   -468,  12876,    130,
- -2169,  -3406,  -3571,  -4655,   2339,  10757,   1292,   2920,
-   289,   -314,   -591,  -1631,  -1778,  -1296,   -254,    469,
- -9408,   1154,    334,     -4,  -1922,   2787,    317,    416,
- -1703,  14075,   1601,    638,  -2260,   -973,   -824,   2816,
- -2954,   3282,  -3716,   -882,  -3447,   3058,  -6701,   1233,
-   177,   3579,   3508,  -3539, -10511,   7507,   7608,  -1928,
-  2482,   -719,   2278,   5167,   9828,  10572,  -3635,  -2750,
-  3407,   -116,   3343,  -3432,  -3375,    982,    903,  -3239,
-  -444,  -1574,   -333,   9613,  -1914,   -532,   1879,    -78,
--17944,  -7029,   1586,  -3122,    360,   -401,   1219,  -2086,
-  3066,    878,   5780,   -948,    102,   1952,    418,   -416,
-  1002,   1380,   1297,    -92,   -640,   -555,  -1159, -28517,
- -1757,   -696,    124,   -618,   1590,    300,   -598,    924,
-  -190,  -1734,  -4196,  -5345, -14068,   5971,   8293,  -3878,
- -1448,  -1777,   -174,    921,  -1555,   -866,    560,    232,
- -1914,  -4002,   -772,   1960,  -4945,   3424,   6492,   3675,
-  -800,   5346,   4404,   -639,  10697,   1631,  -1446,  -4469,
- -7804,   3721,   4824,   -620,   1099,  -2956,   5175,  -2453,
- -4894,   2562,  -1842,   4940,   1391,   2818,   1095,  -4285,
-  6469,  -1966, -14564,  -2232,    592,   5570,  -2682,   2651,
-  4678,  -7444,  -2387,   6812, -12757,  -5664,    -42,    134,
- -2861,  -1780,   -158,   1410,  -4990,    673,   2083,  -2639,
-  3019,     -2,   8305,  -1981,  -2114,    -54,   2892,   1659,
--14913,    -74,  -1092,  -1187,   2465,  -2218,    791,   -608,
-  3077,     26,  -1096,  -1692,   3234,  -7116,  -1835,  -5244,
-   398,  10137,    698,   2298,    498,   7060,   6430,   1393,
-  2540,    487,  -1534,  -1926,  -5139,   3425,   4533,   5067,
-  -535,   -924,    938,  -1799,  16120,   2037,  -3727,   -821,
-  2986,   2314,   -223,   1358,      9,   2697,  -1806,   -940,
- -3630,  -1843,  -2776,  -2246,    580,  -1678,   2427,   2126,
- -1935,   2956,    849,  18234,    638,    342,   1036,    249,
-   -24,   2713,  -1973,   -134,  -4469,  -2014,  -6162, -19776,
-   703,    -50,   2295,  -2294,   1971,   1179,   1014,   2374,
- -1480,   1513,    630,   1542,  24716,   3534,   2926,    662,
- -2886,   -521,   -348,    402,   1112,   -371,   1587,   1822,
-  1880,   1284,    302,   1873,   1284,   -924,   6420,   4650,
-  7986,    427,    361,  -8276,    304, -11911,  -1305,  -2018,
-   189,    258,    839,   -942,    479,  -3162,  -1195,  -1138,
-  1560,  -1850,  -5304, -10132, -10533,  -1301,  -3147,   -680,
-    56,   4260,  -6867,  -1350,  -1094,  -1385,   1831,     -2,
-  -941,   3740,   7701,   -855,   3304,   3444,  -4467,    269,
- -4092,    588,  13957,  -1566,  -3561,   1936,   2816,   2982,
-  1804,   2710,    419,    685,   4468,    488,  -9520,  -2738,
-  3974,  -9978,  -1681,  -2418,   2340,   -717,   -899,  -2855,
--10470,   1030,  -2346,  -5555,   2559,   2180,  -5324,   1832,
- 10294,    342,  11318,  -2376,  -3904,  -1524,  -3806,   1078,
- -1896,   7199,  -3522,   1364,   2291,   -911,   -156,  -4327,
-  -778, -30451,   -577,   -158,    560,   2749,    799,   2689,
-   337,   -301,  -1218,   1243,    687,   -880,   -419,     40,
-  -280,      4,   1834,   9908,   1953,    408,   1080,   8777,
-  3861,    552,  -6906,  -3546,  -6666,     35,  -1903,   4788,
-  5080,   2865,   -233,   1031,  -4519, -13752,  -2417,  -1742,
- -7389,   3191,   -626,   -411,  -7351,   3063,  -1801,  -4377,
- -2974,   -124,   2778,   2733,    349,  -1191,  -6528,  -1699,
-  6907,    239,  -2765,  -5706,   3627,   2096,    -20,   2285,
-  7164,   3523, -11582,   3616,   -614,   6266,   -285,   3643,
-  1506,   3665,   1261,  -2338,    418,  -5062,   4893,   2945,
-  1923,  -2990,  -4531,  -8858,   2769,  -5029,   2202,   3337,
- 10703,    716,   5614, -14982,  -2366,  -5415,     25,  -1665,
-  4353,   3060,  -2159,   1005,  -1587,   -368,   -949,  -2788,
-  1063,   1307,    -59,    -46,  -6337,    500,  -1194,   2914,
-  2372,  -1393,  -1914,   3820,  -1160,   -135,   3777, -14151,
-  5208,  -2290,   5738,   1018,    385,   1883,  -2626,  -9289,
-  1082,   1558,  -1756,   2720,   -519, -13050,  -3672,   1759,
-   -13,   3471,   4071,  -5977,    167,  -4210,   2219,   1344,
- -2412,   4497,  -6946,    660,   8774,  -3141,   6080,  -4478,
-  2520,   -609,  -3080,   -741,   7864,   7428,   -333,   1154,
- -1849,   1478,    460,   -338,  -6651,  -2480,   1692,   2104,
-  1642,   2720,   1017,   2759,  -1822,  -2668,  -2265,  -1019,
- -8926,   1487,    733, -15128,   5543,  -4214,  -7044,    666,
-  7108,   2222,  -2454,   4995,   5108,   1481,   2242,   5743,
-  -487,   9669,    295,   3539,   4836,    487,  -1541,    824,
- -5946,   6692,   -368,  -1390,  -6103,   4545,   2671, -12272,
-  3160,    760,  -2080,   3523,  -2752,  -2940,   -718,   2202,
- -5523,   2346,  -5580,  -5007,   6212,  -5406, -11348,   1272,
-  5389,   2331,   3691,  -1184,  -3585,  -4500,   -603,    -38,
- -5285,   -531,   4844,  -3850,   3944,  -6525,  -5723,  -2313,
-  -985,    879,    578,  -3217,  -3600,  -2814,   1432,  11568,
- -1461,  -1761,  -4110,  -4104,   -103,  -1803,   5195,  -1477,
-  1348,    107,   3902,   1215,   3522,  -3404,   9098,   -237,
-    68,     34,  -2524, -12040,  -6183,   2122,    470,  -1257,
-   346,   -232,  -1725,   5913,  -1525,  -5873,   1846, -11368,
-  1043,  -1027,   4201,  -3864,  -4294,   7756,   1847,  -3688
-},
-
-.cb2220s1 = {
- 32767,  -2256,     16,   2156,    267,   1128,   1394,  -1936,
-  -488,   -405,   -345,   1068,    578,   1504,  -1192,   -405,
-   292,   1149,   4243,    152,   1036,   1782,   2655, -23349,
- -1100,  -1933,    354,    966,  -1554,   1173,  -1186,    495,
-   618,   1009,  -2715,    461,   5974,    939,   3552,   1325,
-  3385,   -956,   2177,   2101,   -145,  -1000,   2326,   2466,
-  2822,  15822,   -581,   -713,   4398,    828,  -3249,  -3942,
-  1990,   -862,   2272,    348,  -2972,    241,  -2678,  -1881,
--22307,    417,   -587,    312,    280,  -2524,   2380,    299,
-  3931,    178,   2910,  -2544,   -356,   -786,    546,    -73,
-  -862,    240,  -1653,   1286,  -3875,  -2072,  -1477,  16800,
- -1148,   2099,   3216,   5174,   2177,   3042,   -796,    414,
-  -506,    883,   1837,   1451,   2864,    850,   2395,   -414,
-  3254,  -1937, -16379,  -3976,   2178,  -1473,   4759,   -832,
-  8890,   3324,  -3053,   -407,  -1530,   -431,  -1220,    128,
- -3472,    980,     52, -14716,   1732,   1931,  -6518,  -1784,
--11113,   4466,    -24,  -8559,    105,   5478,  -4116,  -2213,
- -3006,   1738,  -4189,   3310,   -753,   1869,    580,   -885,
-  3089,   8146,  -4990,  -1825,   -524,   3620,  -6920,    621,
- -1064,   4633,  -1509,     80, -10949,  -2752,    476,  -3684,
-  3547,  -1967,   3364,   2887,   -729,   7921,  -4216,  -3681,
--14417,  -3978,    261,  -1146,  -1124,   -901,    777,    783,
-    -2,   -989,  -1582,   3988,   7785,  -6371,  -2258,   3344,
-   354,  13289,   3339,    316,  -3186,  -2088,  -1951,    310,
-  -545,   -704,    -40,   4416,   -392,  -1033,   5650,     99,
- -3008,  -3716,   2448,  -3758,   9463,  -1793,   -130,   1705,
-  6501,  -2214,   2970, -10476,    564,  -5952,   -541,   2077,
-   -90,   6588,  -2858,  -1733,  -9247,   -345,  -3170,   4986,
-  3353,  -4868,   8873,    113,  -5223,   1562,   -163,  -2446,
- -4459,  -8052,   1106, -10883,   1185,  -1756,   -152,   3109,
-   181,  -1427,   8291,  11419,  -6265,   2116,   -469,   5150,
-  1355,    182,   -740,    779,  -7754,   1868,    144,   3936,
-   -60,   -784,   -231,    879,  17032,  -2273,   1886,   -538,
-  1015,   1798,   -633,   1090,   1910,    128,  -6094,  -1946,
- -1570,   -727, -18457,    498,    784,  -4419,   1656,    -21,
-   154,   2430,   3815,    -41,  -2708,  -1594,    228,   -784,
-  7284,   -452,  -7634, -12868,   3564,   5473,  -1244,   2231,
-    28,   4321,  -1464,   1402,  -1358,   2241,    656,  -1128,
-  1160,  -2352,   3641,   -680,   1816,   6864,    -42,   1269,
-  -280,  -1265,  -2048,    238,   -653,  13571,   3874,   -269,
-  7977,   2238,  -1246,  -2066,   4741,   1706,   3498,    595,
-  2559,     55,    593,   1681,   1612,     43,  -2756,   2702,
-  2439,  -2471,   -809,   1890,  17032,   -787,  -4280,   1167,
- -1926,  -4973,  -1181,  -2764,  -4151,   2962,   3444,    844,
-  2446,  14013,   3326,  -1195,  -1829,   1588,   1765,  -3140,
-  8562, -14425,   4040,   2003,   -738,  -1032,  -3314,  -2236,
-   548,    768,  -2348,    436,   1755,     31,  -4616,   1259,
-   269,   1543,  -1393,   5338, -16463,   2900,  -2480,   1659,
-   217,  -5864,   3878,   5268,   1244,   -520,  -1202,   1238,
-   182,  -1049,   -695,   -320,  -6832,  -5904,   2914,  -2616,
-  2586, -10958,  -3258,  -1846,  -4633,   2371,   3251,  -3583,
-  2631,  -4162,   3035,   2718,    616,   2890,    206,  16128,
-   979,   3551,  -6864,  -3221,   5881,   3692,   1718,    234,
- -2844,   1668,    102,   2687,   -838,    988,   1116,    533,
-  4026,  -7235,   5972, -13781,  -3394,  -3518,   -294,  -6383,
-  1675,   4507,   5444,    385,  -1931,    930,    699,   1639,
-   415,   6720,   7854,   1514,   3192,  -2253, -14786,  -1307,
-   871,   1329,   1881,   6628,   2851,    -85,  -2284,  -4538,
-  -837,  -2232,    269,  -2227,  13930,  -2063,  -7540,   8978,
-  1195,   2717,  -1282,   -972,   1305,   3864,   2412,   2308,
- -4824,  -3282,   -864,   -489,  -1458,   2192,  15903,   2460,
-  2792,  -4137,   1034,   -359,      5,   2297,     -6,  -3859,
-   478,  -1535,   2080,   -741,   2030,   -603,  -2640,  -1902,
- -8208,   3818,  -1273,  -8138,   2015,   9169,  -3440,  -1779,
-  4076,   -576,    -93,  -1718,    744,   2563,   6744,  -3841,
-  1355,   1590,  -4196, -13924,    356,  13381,   2552,  -2862,
-  2790,   -578,   3562,   2711,   -686,  -3783,   -489,   1230,
-   896,   1208,  -1101,  -3482,  -2478,    772,   1254,    320,
- -1825,   -327,   1070,  -1712,    295, -18141,  -2618,   1537,
-  -603,   3782,  -1272,  -1901,    414,    169,  -6574,  -6966,
-  2711,  -3292,  13204,  -1324,   3620,   4962,   2835,   4177,
-  4861,  -2378,  -5534,   3701,  -4224,   -631,  -3199,   -653,
-  4785,  -1045,  -2097,    580,   2190,   -140,     48,   3075,
- -1346,   -810,   2016,    566,  -2543,    235,  -5930,   1956,
-   481,  19003,  -3938,   6489,   2697,   4796,   3435,   7102,
-  3062,   1460,  -5814,   2723,   4181,  -4979,  -2534,  -2058,
-  -136,   3554,  -2684,  15252,   4112,  -3146,   2812,   7182,
- -2642,   5443,  -1043,   -803,   2786,  -1622,   1988,   -780,
-  1482, -13015,  -1762,  -1377,  -4005,    161,  -9568,   8166,
-  1832,    330,  -6484,    945,  -4388,   1090,   -524,   1556,
-  -582,    320,    770,   -938,  -8757,    977,   1084,  -7062,
-  3552,    775,  -4708,  -2281,   -552, -10027,   4263,   1197,
-  -672,    -93,   5716,  -3825,  -4526,   1781,   9799,   4450,
-  1981,  -3149,  -9664,   3119,   3794,    -91,   6710,    840,
- -1098,  11310,  -2933,    785,  -2573,    748,   1803,  -1401,
- -1547,  -4118,    849,   -580,  -1404,   1536,  -9382,  -1610,
-  2335,    403,  -2939,  -3015,  -3753,  -7593,   1640,   3346,
- -2594,  -8028,   5485,   2189,  -3369,   2106,   5369,  -2573,
-  -515,   1459,   6996,   1344,   -389,  -7009,  10332,   -840,
- -3869,    901,  -6449,  -2348,  -2461,  -4103,   -810,  -2060,
-  1040,    117,  32241,   -231,    945,    999,  -1183,    180,
-  1443,    188,    855,  -1634,    774,   -202,     99,   1714,
-   286,   -849,   1968,  -9743, -15458,   -859,  -3726,   2257,
-   355,   -167,  -1674,   1808,   -488,   1118,  -1416,  -1685,
-  2928,   1471,  -1145,   -536,   2307,   -972,  -1191,   1625,
- -1436,    378,  20178,   -638,   1826,    472,   -300,   -845,
- -1045,   1074,  -1041,   -510,    -39,    516,   4548,   2741,
--10197,  -2336,   3828,   2093,  -4148,  -9138,   4239,   2520,
- -3536,  -3807,   2998,  -2226,  -6898,   4838,   2552,  -2024,
- -5579,   1370,  11706,  -7626,   1566,    989,  -4934,  -1345,
- -5962,   4259,   1158,  -3712,  -2710,  -1037,    105,  -2733,
-  1068,   3682,   3904,   2044,    184,    537,  -3438,  -1376,
-   332,  17812,  -3170,   2386,  -2090,   3481,  -1352,    431,
- -1016,  -1062,   -564,  -1752,  -2602,   1299,   6720,    789,
-  1275,  -9801,   5320,   2327,  -4048,   4443,  -7820,   1112,
-  1232,  -1139,   -920,   -744,   -845,  -3754,   5958,  -5388,
-  3336,  -3578,  -4027,    688,  -7043,   -136,   -163,  -1395,
- 13400,   1729,  -1862,   2612,    321,  -3874,    947,   -990,
- -3164,  11487,     46,  -1978,  -2139,   1222,   3897,  -9664,
-  3692,   5431,  -3364,  -3706,    180,  -4009,   2563,   -313,
-  3228,  -1631,  -9763,  -9184,  -6058,  -4594,   1040,  -3323,
-   321,  -3233,   5035,  -1919,  -5525,   1899,   1196,  -1834,
-  -391,    549,  -2114,  -1436,  -2624,   2441,    618, -27606,
-  -841,   -936,   1067,   1157,    230,    784,   -755,   1798,
-  -219,  -1026,  -1119,    320,  -2611,  -1382,   8776,   1151,
-  3739,   -607,   2997,  -7704,  -5870,   1800,   1357,   4973,
- -9674,  -5182,    -50,   -886,   2056,   -802,  -1909,    574,
- -1716,  -6388,  -2882,  -3526,  -3188,   -543,    244,   9648,
-  5129,  -5069,    598,  -9049,   1834,  -3375,   1369,   1461,
- -1295,   -380,   -274,   7258,  -9353,  -2401,  11915,  -5087,
-  1505,   4211,   -719,   -902,   1762,   -168,    642,    699,
- -2067,   -933,   1092,   -958,    715,  -1978,  -1968,  -1613,
- -1263,   -777,   1170,  -9652,  -9570,    612,  -3935,    237,
-   386,   4237,  -1468, -10172,  -4964,   2919,  -6428,  -7184,
-   119,   3610,     59,   3168,  -5474,   -853,  -5735,  -1765,
-  3063,  -1352,    944,  -1934,  -3500,   9282,   5920,    784,
-    90,    275,   3211,   2418,  -8570, -10498,  -2026,  -1020,
- -2989,   1511,    -41, -11462,  -1980,   5296,   2614,    -21,
-   770,   -156,  -2817,  -4748,  -8672,   3447,  -7231,   4598,
- -1347,   -689,  -3198,    434,     56,  -2065,   1798,  13761,
-  -533,  -1280,   -796,   2481,     56,   1377,  -5473,   9116,
- -1185,   -602,   2547,  -3693,  -8880,   2978,   9093,   1829,
-  4844,   -649,    316,   -162,   1520,  -5814,   4860,    199,
- -1330,  -5182,  -6269,   2642,   1220,   2816,  -4098,  -3981,
--13264,   -398,    361,   2768,  -4786,   1023,    -97,    655,
-  -397,   2403,  -1576,   -386,  -1112,    792,  -1195,   -759,
-   742,    729,  -2916,  -1020,  21350,    -26,  -3577,    659,
- -1263,   1378,  -4339,   1880,   4842,   -669,  -1203,   5936,
-   816,  -8356,   3660,   1673,   -677,  -2370,   1652,   8710,
- -1254,   6171,  -6868,   -891,  -6752,   -169,  -5678,  -7588,
- -3247,   2982,   5281,  -4941,   -359,  -3354,    851,  -1609,
--11194,    610,    261,  -1936,   2715,  -3540,  -2488,   2086,
-  6110,    914,  -3224,   1777,  -1558,    937,   3736,  -3109,
-  1903,   4250,  -4478,   2636,   2292,  -1451,  10231,   7600
-},
-
-.cb2220m0 = {
--26430,   -533,   1599,    208,   -293,   2303,    704,   1586,
- -1064,  -1630,    690,   1697,    623,   1786,    332,    682,
-   199,  12695,    475,   1288,  -2471,   -797,    -68,   9659,
-  -816,  -2465,    546,  -1421,   1596,   -926,   4471,   2360,
-  5551,   -900,    297,     96,    400,    936,   1548,  -1066,
- -1625,    652,   1416,   -118,   -525,    683,   1545,   1340,
- 20684,    936,  -1033,   -773,   8416,    954,  -4822,   4223,
--10815,   -312,   -896,    531,   3140,  -1649,    508,  10294,
-  -315,  -2078,    584,   1523,    118,    997, -11837,   -605,
-  -262,  -1732,   -613,  12220,  -2666,  -1802,   -507,  -4410,
-  -100,   2127,   -114,   -886,  -2806,    500,   1034,  -2811,
- 12642,   1015,  -9193,  -4201,    238,   1096,  -1159,   1619,
-  2534,   1644,  -3465,   4797,    639,   2583,  -1316,  -9884,
-   948,   1479,   1186,  -1760,   -343,  -1286,  -1653,    678,
- -7439,   4542,  -6295,  -1600,  -6978,     48,    448,    369,
-  1597,  -3696,  -2121,   1002,   2428, -11368,   5385,    827,
--10674,  -2252,   2240,   1230,  -3074,  -1894,    296,  -2216,
-   571,    114,   -497,  -1675,   1311,  -2297,   1843,   -350,
-  -856,   2067,   1198,   -588,    270,   -470,   2640,    274,
- 19586,   -762, -11471,   -623,   -506,   4236, -10981,   -214,
- -1856,    409,  -1276,   -935,  -1681,   5116,    774,   3008,
-  4388,   -112,  -9493,  -1108,   1454,   1385,   1065,    519,
-  -486,    308,  -1141,    289,   1424,  -3672, -15989,  -3738,
- -1592,   -258,   3304,     62,   1441,     45,   -686,  -1070,
- -1616,   -701,   2313,   1918,   4843,    654, -16902,    263,
-  1837,  -4062,   2727,   -709,   1524,  -1628,   2025,   -281,
-   264,   1238,  -1023, -11981,  -2990,  -1293,    801,  -9606,
-  -604,   -210,   1248,   4014,   3652, -11286,  -2094,   -470,
- -1330,  14523,  -2388,   1413,  -3968,    641,   2936,    161,
- -1687,  -1260,   1722,  -1968,    364,   -854, -14386,  10146,
-   792,    133,   1746,    261,   3345,   -408,   2036,    272,
-  1412,    720,  -3302,  -1495,  -4334,   2210,    799,  17546,
-  2600,   1314,    764,   1327,   3433,   -377,   4296,   2402,
- -1074,    470,   7220,  -2556,   3326,  -4338,  -2086,  -1945,
- 11865,   3525,   1513,   1520,  -1814, -13020,   -929,  -2001,
- -1496,    580,  -3293,  -3146,  -2185,   1442,    390,  -2026,
- -2141,   -192, -18700,  -2039,  -4330,   1691,   -250,   1451,
- -2913,   2832,  -3284,   2899,   1529,   -888,    486,  -2381,
- -1459,  -2663,    530,   -717,   -248,  -1714,  12662,   1820,
--11488,  -1044,   3035,   3872,  -2430,    679,   1075,    475,
-  -593,    930,  -1751,    405,  -2308,   2148,    510,  -2798,
-   445,   -240,  -6865,   2106, -11323,    670,   4342,    154,
- -7748,  -1805,   5381,   -842,   -697,   -709,    688,   -498,
-  5525,  15212,  -2006,  -4146,  -2452,   2392,  -3522,  -2023,
-  1306,   5522,    916,  -3616,   -287,   -653,    333,   -330,
-     4, -24886,    635,    119,  -1949,    899,    -36,    -37,
-  2658,   -133,   2064,   -534,   -549,  -1745,    -70,  32767,
-  1089,   -869,    150,   -599,  -1146,   -574,   -424,    377,
-  -648,   -303,    590,    453,   1910,   -351,    553,    304,
-  -752,   -752,   -502,    -42, -31211,   -634,    449,    638,
-  1086,  -1406,   1220,    802,   -924,  -1874,   -212,     86,
-  -200,  -1140,    618,   -621,   -605, -10976,   1699,   -603,
-  2056,  -4448,  -1519,   2564,   -743,  12304,   1482,    547,
- -1589,   -817,   -217,  -1633,  -1089,  -2270,    181,   -634,
-  3890,    734,  -1319,  -2035,   3304,  13144,  -9076,  -4067,
-    70,   1309,   1067,   -354,   1529,   1379,  -1002,  -3324,
-  -525,   -817,  -1438,  10834,   1036,  12441,   1242,   2461,
-  2858,   2257,    430,  -1177,   1142,   -870,    844,   1102,
-  1208,  -1482,    830,  17622,  -2753,      6,    174,   4385,
-  -339,   2157,   -155,    -68,   -190,  -1181,     29,  -2046,
- -2140,     27,    949,   1889,    446,    -54,  16696,    -49,
- -3304,  -1929,   1833,   3735,   -495,  -1225, -11743,  -2259,
-   891,  -1954,   2848,   -504,   1164,  -2489,    861,    579,
--11547,    976,    -42,   1477,  -2428,  -1561,    112,     74,
- -2721,  12046,    632,   1283,  -1900,   1990,  -1193,   1606,
- -1370,  -2812,  -1309,  -1419, -12526,   3391,  -4213,  -2710,
-   269,     90,  14575,   -345,    820,   6118,    892,   6302,
- -2825,    332,  -3071,   2279,   3756,    185,  -3029,   2402,
-   245,   1010,   -273, -32751,   -140,   -600,    482,   1516,
-  -462,   1931,   1941,    272,   -310,    544,   -422,   -815,
- -1116,    803,   -617,  -1640,  -4336, -11735,   3656,  -1176,
-  1170,  -6209,   2139,  -1571,   2067,   1011,   9842,    790,
-  1702,   -191,    911,   2771,   -253,    794,  -3862,  -1885,
-  -494,   2070,  -2682,    772,    763,   4304, -15657,  -2194,
- -1998,   -963,  -5222,   -175,    238,     32,  10067,   -692,
-  2824,   -474,   3016, -11994,    -51,    713,   2423,   2864,
-  -338,   4838,  -1095,    215, -13471,     -2,    704,    752,
--14654,   1396,    484,    564,   -886,   -775,  -1099,    775,
- -1035,   1661,  -1013,  -1118,    449,    822,  14253, -13238,
- -1084,  -1107,  -1672,    996,    472,   2237,   -440,   1186,
-  1200,  -2112,  -1388,  -1093,  -1902,    555,   -328,  -1493,
- -2034,    426,  -2144,   -388, -20028,   1285,   1122,    730,
-  1661,  -1576,  -2084,   2930,    337,    -66,   1591,   8685,
-  2361,    146,   1370,     22,   1371,   -105,  -4190,    371,
--13252,    328,   1301,   -995,   3689,   6422,    -79,  -1407,
-  -384,    828,    840,    854,    266,   1222,    796,   -550,
-  -729,  -1213,    -87,    524,   1070,  22334,  -2333,    574,
-   680,   -624,    463,   4047,   -236,    114,   1020,   -692,
-  1575,   -320,  -3229,    222,    520,    996,   2104,  -5404,
--18197,  -1105,   -184,  -1057,  10712,  -2509,  -7140,  -2307,
-  1333,   3041,    183,   1241,  -7861,  -3060,   1432,      9,
- -1431,  -2605,   2663,    273,    250,    770,   -740,   6699,
--10929,  -7227,    105,  -2983,  -1203,   1637,  -6072,  -6630,
-   933,  -1526,    658,   2612,   5377,    -91,    -66,   4944,
-  3025,   2723,   -869,    142,  10532,   9858,   -207,   3072,
- -2610,      0,     81,   1078,   2136,   -266,    223,    931,
-  -385,    983,   1029,    108,   2290,   -491,  26685,    565,
-  -140,   -662,    680,  -2206,   -803,   -777,   -250,   -467,
-    98,   2944, -12296,  -4190,  -2254,   -748,  -2076,   4780,
-  -510,   -221,   1428,  -6162,   2693,   6238,  -4030,    266,
-  6540,   2502,   5147,  -4649,   1804, -10514,  -3413,   2503,
-  2143,  -1924,  -3811,   3674,   4341,  -1054,  -3130,  -1260,
-  -576,    887,  25908,   -773,   1186,    548,   -606,   -744,
-  -995,   1320,   -507,    279,   1803,  -2451,    880,    -31,
-    -5,   1615,    770, -11818,   1062,  -1126,    472,   -297,
--12126,  -1197,   1912,   -962,   1241,   2348,   2332,  -3047,
-  1561,   3844,    720,   -387,    371,   2942,   1174,  -2347,
-  1244,  10148,  -1620, -11788,   1315,    -31,  -1867,   3450,
- -1589,   5180,   3184,  -2614,    -13,    130,    107,    297,
-   113,  -1407,  29190,   -544,   -173,    990,    913,  -1848,
-  -990,   1230,    264,   1896,  -6974,   -102,  -2232,   3826,
- -2269,  -5027,     94, -12612,    436,  -5979,   1757,   1757,
-  -724,   2378,   2584,    728,  -1022,  -7274,    668,    744,
-  -516,    420, -11866,    246,  -1357,   2406,   3674,  -2594,
-  1638,  -3037,  -2402,   1525,  -7304,  -1078,   1772,   9264,
- 12366,    202,      2,   -728,    684,   -437,   1446,  -3546,
-   828,  -2106,  -2736,    964,   -180,   6524,   2250,    514,
-  -782,    675,   1418, -11225,   2760,  -3970,   -545,   9128,
- -6601,   -556,  -1966,  -4625,   -149,   -198,  -3330,  -1575,
- -6198,    656,    674,    367,   1809,    155,  -5126,   6109,
-  -572,   4927,   1448,  -1855,   1636,   8648,   2010,   8973,
-  3087,  10172,     34,  -1183,    -12,  -1057,    192,  -2955,
-  1034,   -374,   2500,   9318,  -4090,  -5220,   -404,  -1022,
- -1458,  -1367,    765,  -1193,   1542,    302,  -1337,    -34,
-  1449,   1434,   2210,    404,  -3277,  -8024,   1363,  -7591,
-  9096,  -9179,   1176,  -7311,    544,  -8942,   -713,    -56,
-  2623,    -35,   1623,   2212,   1733,   -712,  -1327,   -320,
- -1966,  11352,  -1276,  -3804,   -550,    520,  -4848,    550,
-  1488,    944,  10756,   -782,   5643,  -2647,  -6513,  -3500,
- -2877,   1880,  -6634,   2349,    256,    440,    188,  -8428,
- -4580,   2479,   4763,  -1807,   -513,  -4292,  -1729,  -6878,
-   448,  -6706,  -1162,   4938,   -721,   5465,   1409,  -8759,
-  -898,  -4254,  -5230,  -3886,  -7969,   1730,   3656,   1198,
-  3537,     33,   4091,  -2088,  -7646,   1160,   2922,    855,
- -1254,  -2616,   -770,   -685,   -100,   -577,  -4927,   -792,
- -2107,   9613,   2563,   5096,   6143,  -3404,  -8630,   4164
-},
-
-.cb2220m1 = {
- 32524,   -324,    411,    -34,   -697,    818,    -71,   2326,
-  -142,   -989,  -1512,    358,   -260,   3791,   -575,     93,
-   224,    208,  -1101,  32767,   1147,   -203,   2015,    461,
-   668,   -296,  -3340,    -38,    720,   -993,   1765,  -1344,
-  1323,    648,   -997,    729,    581,    349,    861,  -2035,
-  1791,  -2142,   -822,  -1425,    820,  -6555,   -811, -15708,
-  -912,   4835,   1500,   -604,    527,   -937,   -640,  -1240,
-  4692,   1259,    174, -12040,    450,   8196,   2796,  -5123,
-  1595,    538,   -101,   -218,   5581,    367,  -2700,    277,
-  2111,   2718,   1458,    155,   -100,   3284,   -498,   9961,
- -1505, -10336,  -1170,   5337,   1032, -14947,   1154,   -578,
--11773,   -945,   -660,    669,   2340,  -1038,   1520,    713,
-  2663,    422,  -1242,   1918,   -234,  -1793,  -1580,   -271,
- -5628,  -2010, -12209,  -1784,  -4417,  -2804,  -3123,  -4316,
-   126,   6353,  -2391,  -2088,    836,  -2550,    521,  -1258,
-   918,   4471,   -528,   4243,   -615,   3453,  -6683,   1784,
-   790,  13200,    700,    322,   -815,   6049,   -290,    928,
- -1121,  -1531,   -878,  -1150,   1404,    325,   -530,   -435,
-  -254,   -804,  -2536,    589,   8439,  -1087, -16248,   -637,
- -1528,    305,  -1577,    642, -22699,   -139,   1319,    588,
- -3079,    800,   -597,  -1408,  -1150,   3145,   -868,   3244,
- -1004,   1004,  -1459, -11618,  -4557,  -3643,   -914,   4238,
-  -626,   4025,   3227,    537,  -4285,   2010,    747,   1595,
-  1599,   5994,   -797,   -911,   2854,  -3426,  -8488,  -1899,
-  -301,  -2146,   -111,   -522,  -1852,   3075,  -3864,  -1531,
-   654,    193, -11264,   5561,    304,    525,    346,  -2761,
- -1124,   1134,   8354, -12460,  -1023,  -7634,  -2750,  -1518,
-  5001,   1480,  -1039,   -502,   1455,    586,   1012,  -1270,
- 12435,    895,   1169,    466, -10696,  -3861,   4381,   1790,
-   767,  -1808,   -537,  -1057,  -2374,  -2058,   9992,   -858,
- -1568,   -678,  -3812,  -1520,   1521,    230,  -1716,  13418,
- -1930,   -979,   3272,   1116,  -4555,   -559,   -320,  12080,
- 13696,   -286,    652,   2420,   1725,   -277,    213,  -1046,
-  1642,   -576,  -1514,   -973,  -1501,     77,    537,   -606,
-  1144,   -680,   -568,   1104,   2176,   -969,   1657,   -784,
-  1107,  -1056,    -59,  -5607,     64,  11913,   -178,   8703,
-  3744,    276,    -50, -12807,   1122,  -6138,   1901,   -439,
-   733,   6829,   3001,    -61,  -1005,   3816,   3987,  -3588,
-  -778,   2257,  12101,    196,  13796,    355,   1407,    989,
-   101,   1041,    988,   1274,  -1478,  -1127,   1320,   -442,
-  3452,  -1717,   1244,   -466,   -868,   -323,    502,   1243,
-   -70,    897,    958,   2781,  -2492,    788,    744, -12324,
-  1111, -11704,   -452,   -734,  19574,    -45,   -584,  -2387,
-  -830,    603,    380,    787,  -2962,   2046,   2524,  -2403,
-   699,  -4144,   1587,    573,    588,    238,    -88,     31,
-  -278, -32768,  -1173,   -745,    667,   -188,   1221,   -369,
-  -261,    322,  -2054,    651,    100,  -2092,    315,   1558,
-   596,   -407,   -146,  -1234, -30970,    -71,    633,    536,
- -1345,   1819,    655,    680,  -1453,    492,  -1265,  -1292,
-  1780,    -68,   1008,    215, -19980,   -521,  -3148,   -256,
-   193,    916,    453,     86,    116,    108,   1518,  -1420,
- -1501,    688,    669,   1196,  -1579,   -942,    868,    804,
-   110,   1126,    202,   1086,  23516,   1070,  -1623,    747,
-   -38,   -116,   1176,    554,  -2361,   1008,   1085,   1972,
- -1794,    -96,    464, -20910,  -1208,  -3857,   -466,  -2173,
-  2461,   2364,   -931,   -684,   3056,   -719,   -936,    887,
- -3149,   1004,   7085,  -2985,  -9393,   5142,  -9621,    150,
-   174,    572,  -2232,   -390,   1356,    160, -10796,   2256,
-  2238,    242,   1663,    485,  12378,   1236,    688,  -2908,
-  1084,   1047,   4850,    -72,   -642,   1604,    152,   -850,
-   670,    968,  -3207,   1690,    105,  -2516,  11539,    390,
- -1117,   -588, -10771,   2879,   4742,  -8351,   1571,   -850,
-  -605,  -1959,    395,  12324,   1750,   2290,    -92,    774,
- -2897,   1025,  -1841,    546,   3904,   3908,  11494,      9,
-  1340, -11976,   -525,   1522,    -43,    -43,  -1860,  -6160,
-  -199,   2479,   4593,  -2876,  -2985,   1044,    -62,   -812,
- 10424,  -2489,  -1098,    796,  -1292,  -2070,   1096,  -1944,
- -2145,  -4374,   1041,  -1014,   9036,  -2142,    328,  -8232,
-   152, -13336,  -2225,  13716,   -367,   -558,  -1942,    161,
-  -472,   2224,   -748,   3550,   -809,   -493,   2121,   1234,
-   772,   5146,   2485,  -2282,   7546,  -1441,   1595,   9176,
-  6208,   1292,   1704,   3968,  -1500,  -1974,  -3519,  -2826,
-   149,   -903,    504,   -187,   -940,    121,   -215,   -615,
-  -257,  -1954,    958,   2057,   -191,  21258,   -726,   2081,
-  1278,   1670,   -854,   2730,  -8132,   -530,   1004,   2574,
-  1430,  -2536, -10851,   1389,    155,   -140,   2158,   2762,
-  3807,   3850,  -3728,   -954, -11366,    709,  14727,    514,
-   694,    -87,    857,   -249,   -419,    617,   -418,  -1144,
-   -32,  -2182,   -839,   1449,  -1072,   -785,   -246,  13634,
- 12488,    358,   -447,  -2262,    926,   1023,   -901,   -345,
-  2260,  -1530,  -1466,  -2973,  -2170,   2090,     44, -23476,
-   603,  -1740,   -345,   -438,  -3004,   1322,  -3088,   1274,
-   341,   -348,   -534,   1055,   3026,   -932,    514,   8958,
--15489,   -374,   1077,   1166,     48,   1016,   -918,    -27,
-  -410,   -266,  -1401,  -3888,  -2918,  -2146,   2815,   1834,
-  -875,    162,   -678,   1876,  -2033,   1999, -12854,  -1563,
-   192,    414,    782,  -3109,   1432,  -4197,   2358,   8517,
-   784,   1256,  -1362,   2938, -11355,  -5184, -10314,    -39,
- -2182,  -1686,    241,   -195,   -232,  -6169,    206,    181,
-  -470,   1008,   -599,   -284,    733,   -836,    648,   -138,
-  2078,    313,  24432,    548,   -441,   1446,  -1628,  -1218,
-   -64,   -716,  -2456,   1987,   -352,  -1025,  -1951,   1320,
-   350,    744,   2598,   -984, -18328,    622,     -4,  -1572,
-   893,  -3043,  -4365,    127,     -1,   -226,  -1696,   1332,
- -1360,   6756,   2596,  12059,    370,  -3690,    497,    585,
-  1619,   -778,   9174,  -2046,   2214,   2004,   1133,   1069,
-   132,   -250,  -1555,   -906,    561, -12904,  -1039,  -8006,
-  1876,   2300,  -1116,   1895,   1782,   3734,  -1108,   1338,
- -1409,   -248,  16117,  -1458,    156,  -2626,     64,  -1199,
- -3544,   4283,  -3390,   -404,   1426,   -907,  -2768,   -780,
-   -34, -18656,   2003,    515,   3171,   -653,    762,  -3352,
-  -154,  -1171,   -452,  -1590,  -5936,    519,   1210,    502,
-  -409,   2262,    695,   1028,   8652,   2532,  -2636,   3472,
- -1186,   1350,   -651,   -639,   8382,  -3234,    630, -10323,
- -2285,  -1916,    826,  -1449,   -738,   -344,   1022,  -3248,
--20921,   -200,    568,    -84,    777,  -1570,  -2756,   2834,
-    26,   3878,  -1709,    101,   1433,  -2238,    305,     61,
- -1041,   2399,    628,  -1509,   -388,    946,    733,  -1538,
-  -650,  19935,    478, -10696,    850,   -682,    447,   2311,
-    35,  -1258,   2332, -11417,   1743,   -834,    660,   3170,
-  2378,  -2734,   -762,  -1151,  -1802,  -9324,   4625,   2304,
- -1186,   1180,   4894,    662,  -7067,    869,    613,   1802,
-  4839,   3412,  -5460,   -862,  -4202,   7876,  -1057,   2872,
- -1336,   1731, -10788,   1088,   3433,     42,   -939,   2479,
-  6425,    991,  -1621,   3222,  -2464,   2988,    -29,    481,
- 11606,  -2800,  -8315,   7660,  -3385,   1217,   -728,  -3670,
-   684,  -2295,   -724,   -567,  -2150,   -106,  -1920,  -2143,
-  3465,   1968,  -1089, -11953,  -2704,   3049,  -1351,   7225,
-  5727,   -525,   2639,   1955,   2259,   6489,  -1867,   1544,
- -3199,  -4992,   2420,   4119,  -2860,  -9505,  -2152,  10204,
- -1133,  -1201,  -1468,  -2989,   4658,    578,   1115,    368,
-  1570,   -776,   -503,   1554,   1329,   -696,   -760,    575,
- -1527,  -3865,   8372,  -3378,  -8137,  -8392,  -3471,  -1854,
- -4852,   5270,   -634,    608,   1289,  -7660,   4983,  -1266,
- -2070,   -906,   3291,   2459,   4807,  -4241,   5773,  -2258,
- -4500,   2634, -13176,   6412,    282,  -5849,    294,   -626,
-   888,  -1088,    656,    192,   -630,  -3405, -12469,   2882,
-  2184,   3920,   2715,  -6852,  -1111,    869,   -161,    341,
-  1856,  -9450,   2719,   -579,  -3840,  -8763,   1153,  -3532,
-  -571,   -766,   8301,   2936, -10501,  -1073,  10068,  -2930,
-  6308,  -2747,   3093,  -1710,  -3865,  -1464,  -4447,    446,
-   898,   5386,  -1074,  -4651,   6205,    455,  -1773,  -1270,
-  6986,  -2493,   4076,  10605,  -2522,    977,   4098,   1153,
-  -434,   4071,  -2890,   2920,   9175,   2276,   4699,    642,
- -1067,   -968,    508,  -1752,    728,   3260,   -500,   1414,
-  5554,   2761,   1973,  -4704,   2127,   1397,  -1070, -14536
-},
-
-.cb2224l0 = {
--12451,    389,    917,   1238,   -626,   -904,  -1877,   2328,
--12808,  -1345,    406,     80,    383,  -3841,   1188,   -907,
-  2369, -13409,  11191,  -2547,   -532,    762,  -1627,    680,
- -2305,   -811,  -1118,   3232,   3413,  -2010,   -453,  -6816,
- -4100,   1643,  11209,    933,  -2272,   1440,  -2465,  -6862,
-   186,   1563,  -8468,  -1832,  -1166,   -596,   -326,    105,
-  -115,   -352,   -624,  31621,    129,   -301,   -615,   -313,
-  -176,    620,     -5,  -1354,  -3563,    678,   -301,    621,
-   904,   -769,  -1314,   -956,  -2294,   -362,    381,  -2398,
- 17085,    100,   3962,   -830,  18705,    237,  -1296,   3534,
-  1452,    259,   1690,  -3106,  -3624,   -316,    -16,   5900,
-  2195,  -1008,  14335,  14173,  -1637,   1130,   1110,    499,
- -1516,    500,   -720,   -494,  -1010,  -1264,   -773,   1389,
-   212,   8036,    780,    608,   -415,    931,   -301,  -2186,
-  2256,   -706,  12972,  -3461,  -3695,   2073,  -2768,  -1525,
- -7539,   -441,   -753,   4558,  -8171,  -1751,  -6885,   4077,
-  6714,     53,   1090,  -3006,   3688,  -1162,    -59,    302,
-   928,   -450,    238,  10809,    353,    698,   -476,    172,
- -2198,  -4377,  -7518,   1605,   6348,   5147,   -165,    165,
-  -463,    -93,   1251,    671,    587,   -402,   -227,   -462,
--27960,    215,    -56,   -958,   -657,    508,     98,  -2811,
- -1443,   3076,   6218,  -9760, -10465,   -770,    345,   3076,
-  -116,  -2884,   2215,  -2652,   1306,   2638,   -124,   -317,
-   366,   1461,   -295,   5073,    460,   1920,  12216,  -7032,
-  6816,   3037,  -2630,  -1087,  -1315,    123,   -582,  -2137,
-  5061,    291,   1740,   -214,   1920,  -3470,  10895,   9491,
-  3558,  -1256,   -448, -10304,  -2391,   1890,    484,  11057,
-  6636,    422,   2316,  -1663,   -348,    633,   1200,   1788,
- -1124, -24435,    140,    869,    738,    223,  -1429,    602,
-   433,   -196,  -1127,  -1937,   -879,   -310,   -564,   1022,
- -4380,   7247,  -3938,   4461,   2219,  -8465,   9266,  -4564,
- -3169,  -3463,   -477,    749,   2460,   -776,    294,   -171,
-  1072,   1748,   1000,   -208,   1908,   -998,  -1898, -10485,
-  2360, -11950,  -2412,  -2609,   3885,  -2738,   1348,   -559,
- -1342,   9366,   1560,   -816,   1178,    342,   -175,   1286,
-  3014,  10641,    246,   3128,   6618,   -305,  10906,   6359,
- -4395,   1415,    196,  11136,   1772,  -3047,   3313,  -1231,
- -1974,  -3021,  -1480,  -1345,   -830,   1551,   2521,   -506,
-  7821,   7715,   5078,   8215,   2102,   1552,   2247,   3766,
- -3158,  -1811,    631,   3980,   -397,   9030,  -1267,  -1974,
-  1539,   -360,   -315,    796,  -4749,   2076,  -1017,    717,
-  2290,  11212,   9365,   1626,    379,   2060,   1329,      4,
-   -25,  -1348,    566,  -1266,   1670,   2166,  13123,     42,
-  2416,  -2170,  -6380,    172,    316,     40,    300,   -487,
-   402,   -220,    846,   -894,  -1413,  -2227,   1962,  19478,
--14756,  14377,   -582,   -770,   -186,  -1008,  -1520,   -722,
-  -885,   2622,    311,   -753,    480,    539,  -1011,  -1748,
-  -832,   -603,  -2015,    869, -14860,   -600,   2110,    484,
- -5874,   1532,   3290,   -222,  -4670,    -33,   -794,  -2061,
- -1185,    -96,    337,    515,  -1887,     26,  20283,   -455,
-  -799,    -62,  -1083,    236,  -1721,   -569,  -1259,    361,
-  1090,   -226,   1480,  13367,   -638,    940,   3736,   6419,
- -5995,    830,  -6599,   4549,   1583,  -9001,   1104,  -1281,
- -1270,    -94,   1104,  -2076,    652,   2263,   1465,    -25,
-  9046,  -8139,  -2646, -13200,   -534, -15244,  -1448,  -1390,
-   452,    584,   -314,  -1192,    951,    885,    396,    776,
-  1303,   1298,   -448, -32641,   -234,    -62,     31,   -164,
- -1042,    -82,    -26,   -272,   -559,   -164,    669,   -500,
-   516,   1347,   9615,   1123,  -1346,  -1898,   8341, -10583,
-  2286,  -5233,   1503,    454,  -2024,   4248,  -2298,  -2117,
- 13390,   -849,   2078,   1096,   -651, -12232,   -374,   -812,
- -3729,   -829,   -144,   1213,   -469,   1112,   1146,    816,
-   818,   -912,   -967,    907,     12,   2443,   -759,  -1833,
-  -174,   -838,    488,  -1560, -18242,   -558,   5510,  -1316,
-  1758,   3957,  -7130,  -1394,   4962,   3870,  -1907,  -9247,
-  2217,  -3880,  -4413,   1893,  -3085,   -202,    599,   1307,
-  1574,  -1070,  -2593,  -2722,   9506, -10170,   1105,   4879,
-  2208,     38,   5596,  -5990,  -3205,     35,   9405,   -219,
-   618,   1308,    353,   3457,   1712,    717, -12937,     25,
-  2176,  -2590,  -1223,    528,   1318,   4588,   7678,   5743,
- -8430,  -4487,   1364,   8082,  -1727,   -387,    469,   3172,
-   401,  -2771,    694,  14554,  -2278,   3640, -11084,    924,
-  -593,  -3841,  -4338,    227,    750,   2974,  -2834,  -1765,
-  2133,  -1181,   5149,  11758,  11949,   3538,   2442,   2801,
-  1457,   -822,  -3419,  -2468,    191,   -646,   -975,  -1271,
-   832,   3088,   -495, -10022,   1817,   1319,   -880,   1342,
- -1448,  -3597,  -3310,   8753,   -161,  -6550,   1422,   -640,
-  -508,  11542,   -277,   -165,    837,   7389,   -942,  11009,
-   -97,   1548,   1418,   -445,   2105,   -946,  -8676,   5274,
-  8842,    576,  -1392,  -1737,  -1276,   5491,    312,   3624,
-  2806,   2157,   -537,   1656,   1982,  -1300,   -146,    463,
-   496,  16792,   -140,  -1755,   -832,  -2123,   -399,   5811,
-  -702,   2891,  -3630,  -1843,    346,    508,   -364,   -498,
-  -558,  32048,   -744,     90,   -372,    430,    704,    871,
-   139,    772,    696,   -108,    -18,    310,   -411,   -798,
-   465,   -165,   -321,    745, -27861,   -752,    499,   -215,
-   172,     35,   -196,   -770,    274,   -546,    -96,   -470,
- -8976,   9156,    581,    904,  -4644,  -7801,   3525,   -607,
-  6444,   4058,   -696,  -1107,   -632,   1475,    196,   -933,
-   883,   1101,    278,    433,    544,   -497,      4,  -1882,
-  1504,    594, -30386,    218,    211,    850,   -989,    319,
-  -867,    -42,    754,    498,    -70,   -562,    660, -11561,
-    54,    803,    425,    966,  -1017,  -1224, -12630,   1834,
-   -41,     98,  -1083,   3508,   1750,  -1751,     72,   -503,
-   -38,  22211,    252,     88,    221,    690,     82,  -1340,
-   508,    638,    832,    482,     51,   7954,   2702,  -1176,
-  8830,   -311,   2536,  -6072,  -4147,   5234,    494,   -157,
- -1289,  -5678,  -1617,   1508,   -140,    -55,    713,    440,
--32583,    105,   -394,   -613,   -972,    578,   1122,    -32,
-   114,   -228,    342,  -1237,   1123,   1126,   -188,   -106,
- 11308,  -3787,    563,   3423,  -9926,   1623,  -2551,  -1448,
- -4125,    918,  -1366,   -476,    -66,      4,    761,    164,
-   -61,  20445,    238,    296,    492,  -1126,    -98,  -1201,
-    14,  -1840,   -865,   1178,   -869,    105,    907,    248,
-  1538,   2990,  11691,   7783,   1566,  -6704,   2397,    594,
- -1825,   -383,   4264,   1911,    468,   1018,   -676,  -2676,
- -7756,  -2623,  10705,   2710,  -8078,  -5256,   1699,  -2100,
-  -355,  -2086,  10828,    611,     18,   -830,    978,  -4181,
-  1324,  -5262,   -327,   1796,  -9777,   1306,  -1934,  -8930,
-  9520,  -2364,  -3997, -10209,  -6326,   1394,  -1758,    868,
-  1192,  -2916,    -23,  -1586,   -296,    438,   -279, -14171,
- -1554,   -206,   2383,    506,   1181,   8298,   -491,  -2771,
- -4286,  -7116,  -1680,    506,   1729, -12965,   -925,   -985,
-   420,  -1746,   -267,   -478, -11763,  -1030,    187,  -3878,
-  1516,   2472,   -371,     29,    809,  -1700,   -152,    560,
-  1833,  14397,    968,    -96,  -3242,  -2497,    -76,   2096,
-  9593,  -1200,    446,   1505,   8058,   1722,    501,    923,
- -1171,  -9516,  -2536,   7368,     -2,  -5304,  -2440,   -352,
-   510,    320,    301,    120,    687,   -942,    137,    824,
-  -316,   1312,    510,  -1133, -27448,   -404,   1041,    272
-},
-
-.cb2224l1 = {
--14840,  -1361,  12733,    798,   -496,   1691,  -1668,  -1730,
-   928,  -3233,    338,   -578,    156,    784,   -787,   -242,
-  -618,   -853,  -1282, -11766,   3970,  12178,  -2034,    244,
- -3411,    300,    159,   3494,  -3060,  -1459,  -2484, -10680,
-   752,    227,  -1612,   -922,   -549,    158,   2260,  -7640,
- -4479,  -4075,  -2412,  -7707,    600, -12358,     93,  -1666,
-  -795, -13060,     61,    511,  -2102,  -2122,    364,   -157,
-  2310,  -1552,   1260,    158,   9503,   7050,      7,  -5902,
- -7098,    444,   3736,  -1836,   3109,  -2328,    457,   -871,
-  -327,   -780,    661,   8684,   2530,   -268,    954,   1380,
- -1029,    418,   -136,  -3515,   1953,  -1688,  -8623,  -3292,
-  7758,   2796,  11643,   -931,   -501,   -873,   -444,  -1342,
--13900,   -246,   -283,  -1779,    998,  -1318,    408,   1505,
-  -462,  10667,  -1813,     78, -16514,    360,  -2029,    942,
-  1674,    171,    317,    244,   1183,    724,    760,   1634,
-   863,    793,    126,   -326,    980,   -629,  22219,   -649,
-  1274,    717,   1355,  -1853,  -1792,  -1017,  -2104,   -768,
- -1708,   2302,   2353,  11167,  10734,  -3412,  -2266,     75,
-  -104,    425,   -880,   2072,   2934,   -930,    270,  -2414,
-  -925,   1023,   -746,   -236,  -1620,    825,   1324,   -101,
--19348,  -1291,    585,   2165,   2891,   3662,   -577,   1800,
-   408,  -1486,    107,    351,   -319,   1104,    956,    403,
-   628,   -277,    -57,    938, -32768,    -71,   -441,   -208,
-   -32,    191,    314,   -171,    613,    749,    844,   -472,
-  -444,    952,     42,  -8026,   2720,   1911,  -2780,  12311,
-  -122,   3569,    -91,   6048,   -776,   1694,    -63,  -1272,
-  3581,   1622,   2538,    190, -13108,   -820,  -3056,   1189,
- -1428,   -244,   -752,  -6187,  -3473,   -697,   1368,   1043,
-  7702,    352,   -140, -12999,    -80,  12672,  -1473,   3113,
-  1505,    667,   2392,   1767,    537,   1949,    657,   -130,
-   980,   1743,   8269,   2380,  -2311,    197,   -651,   2531,
-   553,  -1117,   -396,    472,   4565, -12672,   2322,   -360,
--12766,   2205,  -2651, -10690,   -218,    586,   5229,     34,
-    59,   1730,   1226,   2106,   4008,  -1878,  -9520,  -1366,
- -1174,   -290,  -1037,   1642,   1234,    305,  -1279,   -642,
-  1126, -13199,    -29,    642,   2928,   1936,   -260,    588,
- 11690,   9282,  -3362,   7732,   1073,   2738,   4688,  -1507,
- -1461,  -2271,  -1131,   1969,  -2152,   1637,   -774,     66,
- -1190,   -206,   -491,  -1080,    644,   -378,    367,  17980,
- -1583,   2162,    918,   -121,   -432,    115,      5,    791,
-  1968,  -2287,  -1574,  -9545,  11146,   3540,  -4700,   -515,
- -4548,    881,    591,   1044,   -259,   -978,      2,    232,
-   778,   -198,  -1161,   -378,    -83,    421,    282,  26564,
-  -801,  -1628,  -1983,   -301,    931,    886,   2196,   1453,
-   752,   2956,  -3478,    490,  -1420,  13303,   1293,  -9466,
-   462, -12829,  11130,   8061,    593,   3697,   -611,   -534,
-  -698,  -1148,   1598,    293,   -726,   -698,    289,    180,
-   876,   -369,    -43,    234, -21629,  -1448,   -753,   -480,
-   956,    994,    531,   -916,    630,    720,  -2300,  -9544,
- -1418,    993,   2130,  -2359,   2460,   -339,   -277,   1577,
- 12206,  -3507,  -1280,   1938,    871,  -1850,   -809,  -3364,
-  6918,   1134,   5010,   8772,   2103,  -9775,  -1404,   5148,
- -1494,   1549,   1761,   -812,    654,   -611,    822,   -229,
-  -384,  10466,   -337,   2207,    131,   2818,  -2925,  -3374,
- -8786,  -8552,  -2282,     88,  -1058,   8571,   2900,   -529,
- -1569,   1882,   -981,    204,   2955,  -4227,   4196,  -3041,
- 10804,   1822,     82,   1936,   2380,  12992,  -5659,  -3449,
-  1329,  -1668,   1291,  -1726,   8328,    314,   2737,   -677,
-  2384,   -910,   -878,    687,    640,   -721,   -912, -12772,
- -2079,   -398,  -1788,  -2516,  -8711,  -1038,   -985,  -7151,
- -9057,    890,    459,   -298,    918, -10061,    848,   -716,
-  1822,    836,  -9516,   -985,  -1379,   -409,  -2237,   1036,
- -1082,  -1704,   1333,  -1432,  11463,  -2355,  -5975,  -1674,
-  -640,   -554,   8352,   2732,  -5251,   4243,   -354,   3662,
-  -592,  -9317,  -1205,  -1084,   -995,  11288,  -2098,  -1620,
-  2367,  -1286,  -5312,    -64,    540,  -2327,  -2703,  -2013,
- -8649,  -1306,   -948,   1443,    664,   2400,   4706,   4061,
-   387,    -20,   1859,   9283, -18175,    806,  -1401,   1253,
-   596,   2176,  -1682,   2209,    733,   1404,  -6652,   2754,
-   950,   2346,   3629,  -6875,   5069,  -9302,   1472,    942,
-  1184, -10432,    960,   3987,   1985,    421,    300,   -716,
-   938,    500,   -160,    226,    -87,  -1648,  -1857,  -1977,
-  -323,   2305, -13843,  -4148,  -2978,   5430,  -3422,  -1138,
- -2146,   1548,  -1430,    734,   -339,   8598,  -4568,   -496,
-   477,   4969,   2593,   2842,   8645,  -2365,  -7455,  -2687,
-   249,   7516,    -53,    219,   1139,   -668,    566,   -522,
-  1289,     33,   -141,   -920,   2526,  -2797,  16456,  -2000,
-  -758,   -194,  10984,    187,   1686,  -4799,   9671,   1838,
- -1224,   1325,    656,  -5434,   3207,   1813,   1833,  14375,
- 12259,    -95,   -536,  -1746,  -3568,   -442,    964,  -1472,
-  1345,   2692,   -589,    520,    616,    357,    326,  -1363,
- 28603,    700,    473,   -908,  -1129,   1046,   1106,   -471,
-  -472,   -980,     29,    574,   -350,   -545,   -585,  -1936,
-   279,    882,   -880,    -52, -30552,    371,   -154,  -1275,
- -1914,    104,   -110,   1122,   -719,    729,   -743,    360,
-   766,    198, -11674,    612, -10602,   1157,    186,  -3132,
-  3070,   1535,    155,    774,  -9432,   4966,  -6717,    320,
-  5167,    112,   2727,  11228,   1368,   1864,   1197,  -1519,
-  1504,  17863,     49,   2212,    611,  -1788,   2932,    395,
-    32,   -566,   2425,  -9457,    673,    670,   -247,   1617,
--12578,   1408,    462, -14935,   1438,   -808,  -1850,   -784,
-  1856,  -1648,    767,  -1452,  -1652,  -1621,   1016,   1428,
--11203,   4217,  -6410,   2570,  -1016,  -1720,  -9036,   -390,
-    62,  -1245,   3027,   -255,   1646,   1358,   -907,   -864,
-  -118,    874,    268,    252,    104,   -926,   -552,  -1206,
-   965,   -208, -24472,    890,  -1516,   -630,   -885,   -804,
-  -374, -22520,  -1143,   -777,    532,    185,    603,   1775,
- -1887,    413,   -458,  -1036,   -211,   2693,   6976,  -9498,
-  1437,  10163,   2450,  -1574,   4941,    884,   -470,  -3366,
-  4664,    420,   -568,   5703,     10,  -1692,    143,   1592,
--10966,   2891,  -2961,   3938,   1990,   1726,  -5247,   3326,
- -6575,    584,   -277,   -441,   1679,   -520,   1339,   1077,
--11462,   -267,   -351,    201,  10939,   4150,   3890,   1484,
-  2615,   -676,   -448,   2316,  -1278,   9734,  -3039,   2841,
-   964,  -7557,    156,  -7228,   -120,   5533,  -4322,   1796,
-  2555,  -9912,  -3038,   2236,   1190,    222,  -1684,   3273,
- -1768,   6233,  -6442,   8545,    -49,    -45,   2366,    293,
-   308,   -689,    308,    368,   -452,   1125,   2326,  -2335,
--17793,   2027,   -779,    734,  -2032,   1246,  -2898,   4174,
-   -74,    -40,  -3105,  -2135,    996, -12714,   3614,   4936,
- -1928,   1528,  -4158,  -1791,  -2318,    907,   -326,  22513,
-  -660,   1022,    434,   -564,     28,   -112,    252,    372,
-  -842,     -2,    648,   2323,   -614,  23377,   -263,    486,
-  -408,   -362,   -821,   -724,    972,   1248,    444,  -1741,
-  -420,  -1371,   1088,   -565,     22,   -394,    -64,   -292,
-  -103,   -501, -30510,   -294,   -266,    433,   -700,    742,
-  -756,   -407,   -961,   -148,  -1416,  -1041,   -481,    121,
-   346,  10240,  12629,   1476,  -2647,   1350,  -2012,   -262,
- -5621,    714,   4398,  -2732, -10473,   9834,  -5165,   -991,
-  -557,  -2733,  -3460,   5779,    659,   1472,   2029,  -2339
-},
-
-.cb2224s0 = {
--27522,   2628,  -2486,    277,    874,  -2351,   2725,    915,
-   994,  -1209,   -439,   2936,     46,   1014,  -1816,  -3561,
--14386,   3113, -10400,  -1025,   2114,   1328,   -278,   1182,
- -1820,   3928,  -1062,   -282,  -1327,  -1468,   5975,   2342,
-  -630,  -4217,  10116,  -1254,  -2646,  -5210,  -9942,   1904,
-    21,    504,   2325,   1443,   6470,   2598,   8130,    810,
-   304,  -1059,   -645,  14634,  -3198,   4277,   -669,  -7170,
-  1554,  -2321,   2386,  -1072,   2483,  -4141,   2841,   3414,
-  8014,  -3141,  10857,   6634,   3138,   3199,   -320,     36,
- -1366,  -4129,   3157,   2602,   4273,  -2435,   2645,   2986,
- -3712,  -3995,  -5476,  -4693,  -1664,   6384, -11201,   1320,
-  2184,  -5102,  -2984,  -1569,  -2116,  -1513,  14284, -11182,
- -2925,   -731,  -1321,  -6363,   1483,   3463,   1292,  -2065,
-  -357,   9108,   6371,   3840,  -6905,  -8918,   2906,  -1658,
-   757,   1998,   -580,   -708,   2198,   1867,    960,   4522,
-  1896,  -1674,  -4943,   2695,  -2465,  -2078,   9755,  -4853,
- -2602,   3466,   3897,  -3633,   4918,  -2049,   3730,  -1982,
--10085,  -3458,  -1866,     32,  -1706,   3648,   -308,   -942,
- -1630,   1730,    512,  14612,   3415,    974,   3079,    765,
-   897,   -270,  -1813,  -1533,   1118,  -2805,  -2764,   1130,
- -1798,   4594,  -3134,    964, -20082,   2574,  32450,  -1379,
-    52,    358,   -226,   1902,    257,  -1071,   -650,   -399,
-  -381,   2073,   2310,   2164,   8221,   1433,   -629,   1440,
-  1120,  -3362,  -4642,   2000,    378,   1208,  -2648,   4534,
-  3307,  13200,   2780,   3100,  -3194, -10606, -11563,  -4491,
-  2218,  -4500,    622,   1313,   2682,   3003,  -1387,  -3886,
- -1567,  -4864,  10899, -20606,  -1606,    -60,    602,    125,
-  -730,  -1112,    979,    325,    -13,   -185,   1241,   -288,
-  -552,   6042,  -7049,  -7359,  -1456,    493,  11204,    -65,
- -2170,  -5248,   2248,  -1046,    591,   2085,  -2844,    244,
- -3454,    581,   1315,   3043,    304,   -620,    405, -19944,
-   769,   1076,  -1456,   -694,   2560,  -1046,   2514,  14552,
-  1586,  -7027,  -4710,   1366,   1552,   4354,   3296,    462,
-   600,    500,   3225,   5083,   -792,   3199,   -698,  -3589,
- -2596,  -3350,   2758,  -3019,   5664,  -9387,   4716,  -3125,
-  3306,   6268,   -592,   -622,  -4144,  -6290,   4990,   -748,
-  1854,  -1042,  -2996,  -4279,    338,  -1864,  -8639, -11208,
-   932,   -722,   1788,  -1927,    450,   2191,  11828,  -6400,
-  5364,  -2236,   3212,   8340,  -3229,  -2846,  -4676,  -1825,
-  2628,   -303,   -589,   7728,  -4216,  -3866,  -4400,   -194,
--11316,   5646,   3716,   4827,    232,   -583,    308,  -1833,
-  2153,  -2508,    -46,    857,  -9587,   2768,   5136,   1462,
-  5142,   7990,  -3424,   1067,   7462,   4944,     98,   1014,
- -4750,  13824,   1130,   2334,   9393,   2416,  -4519,     27,
-  2000,    929,   -204,    481,  -2780,  -3720,   1267,    269,
- -5383,  -1999,   1249,  -4238,  -9351,  -7440,  -5964,   6154,
- -6827,   3112,  -2613,   -164,   1604,   1245,    -50,   8619,
- -4044,   4652,   2846,   8359,   5345,  -2902,   2295,   4801,
- -5016,  -6270,   2893,   2732,  -3510,  -2613,   4548,  -6376,
-  4510,  10566,   1859,   1038,  -8381,   2782,  -1622,    159,
- -1035,  -3232,  -3766,   1580,   -720,  -4476,  -3863,   -920,
- -2135,   -458,    352,  -2645,   3029,    301,  -1145,   -478,
-  3696, -11700,   9930,   6649,   7290,   2362,  17226,   3238,
-  1786,    662,    971,   -736,   -647,   1745,   -506,   -777,
-  1458,   2406,  -1417,  -7933,   -846,  -2654,   1104,    618,
- -2783, -10168,  -3322,   9498,   -939,  -2342,  -1876,  -1914,
-    84,   3468,  -6533,   7796,  -3797,  -1318,  -2183,   1310,
-  -895,   4943,   1062,  -4468,    142,   -244,    884,    613,
--13963,  -5853,   -947,  18703,   -964,   1090,   1070,   1388,
- -1572,  -1110,    671,   1706,    620,   -262,  -2421,  -2277,
- -5665,  -5212,   4994,   2379,   -593,   2048,  14489,   1165,
- -1775,  -2093,   2466,    419,    404,   5429,   3089,  -1350,
-  1975,   2281,     60,    599,  -1600,   2286,   2358,   6698,
--16423,   3760,    666,  -1309,  -1346,   2786,   2364,   1448,
-  1114,  17956,  -5301,   2430,   1178,   -164,   2195,   3927,
-  -122,   -737,   1468,    307,  -1863,   1592,  -7714,  -2428,
-   958,    220,     59,   4124,  -1945,  11151,   8604,  -2077,
- -4787,  -4578,   1096,   2685,   6478,   8314,  -6221,  -3842,
-  2173,    -43,    104,  -2510,   3109,  -2324,  -4238,  -4709,
- -3233,   3228,  11454,   2428,    578,    780,  -1096,     72,
--22624,  -1421,  -4104,    226,    464,  -1726,  -1971,   2068,
-  1142,   1412,   1412,    798,  -2605,  -3451,  -1104,  -2224,
- -2250,  -3470,   -572,  -1420,  -1292,    -58,   -217, -21417,
-  -172,  -6368,     30,  -2170,     95,    378,  -2926,  -2180,
-  2820,   -683,   2018,  -4313, -13469,   5396,   1808,   -592,
-  4732,  -6602,  -5602,   -983,  -4130,   -477,  -1236,  -2263,
-  3992, -12962,  -1778,  -2631,  -2421,   -746,   1964,   1754,
-  -760,   2753,   -116,  -3860,  10246,   -448,  -1318,   -100,
--10372,   1420,   -210,   2768,     48,  -2373,   7721,  -3217,
-  -328,   1543,  -2527,   3709,   4024,   -916,  -4588,   -726,
- -4302,   -982, -14714,   3615,  -1190,   9051,    199,   2252,
-  1348,  -4204,    693,   1241, -14160,  -2460,  -2017,   2997,
-   766,   -360,   -450,  -2919,  -7976,   3210,   -179,   8935,
-   670,   1155,   6888,  -2249,   2729,   1810,   6283,    684,
- -9717,  -1763,   -921,  -4578,   3941,  -6408,   1431,  -2742,
-   -91,  -2094,  -2118,  -9752,   2801,  -2497,    147,  -5901,
- -5270,  13170,   2810,   1576,  -3191,  10253,   4226,  -1340,
-  2456,   1079,  12541,  -5124,  -8356,  -1000,   -558,    180,
- -2070,  -1880,  -5718,   -687,  10549,   1066,    220,  -4147,
-  -695,   3648,  -3460,  -3143,  -1623,   2150, -11222,  -2566,
- -6395,   3552,  -4176,   -698,   1248,    112,  -4628,   -960,
-  -724,   1191,   2084,  15207,   -346,    371,    190,   5345,
- -4283,  -7482,   1354,  -4424,  -3775,  -4143,   1444, -14876,
-  -589,   2498,   1305,   -486,   1628,   -867,   1584,   1094,
-   -10,  -1260,  -1046,   2528,  27472,    910,  -1069,    829,
-  -117,  -1097,    770,    252,  -1412,   2353,   2200,    -11,
-   624,   8459,   6320,  -9465,   1225,   2532,   5415,   9252,
- -1441,  -1378,   1081,  -1997,  -3904, -14740,  -5220,   3627,
-  5725,   6180,  -5336,     72,   4638,    915,   -496,    628,
-  1880,   -420,   2800,  -7143,  -7578,   3180,  -4210,  -1111,
-  2979,   -442,   -182,   2778,   2398, -13878,   2209,   -282,
-  -888,    180,   3584,  -1005,      2,    999,  -3074,   1205,
- -4605,   5250,  17255,   2839,   2718,   -678,  -2651,    160,
-  1596,   4685,   2324,   3100,   3744,  -1954, -11674,    621,
-  -678,  -6242,  -3449,  -1890,   3134,   -289,  -7162,   2268,
- -8437,   -624,   4999,  -5946,  13013,    244,   -200,  -1494,
- -1108,   3768,    445,   2429,  -1264,    786,  -2993,   3482,
-  2448,   -968,  -1184,    213,   -772,   4931,     42,  -3850,
-  2020, -17970,     84,   3016,   -602,   1805,    731,   3522,
- -2606,   -637,  25535,    680,   1083,   4138,   1602,    190,
- -1854,   -962,   -379,  -2499,   2453,   -362,  -4552,   4689,
-  2168,  -5930, -10552,  -5585,  -4694,   2447,   2047,   5420,
-  3908,  -1449,    -90,    -68,    496, -12713,  -2127,   1406,
--10766,   2438,   2278,   2962,  -6411,    -22,  -1966,   2814,
- -1746,   -383,  -2381,  -5981,  10920, -12354,   -656,   2260,
-  5200,  -1908,  -2275,   4276,   1174,   -932,   -532,   2832,
-   601,   1551,  -8434,  -4170,  -6411,   9099,  -6886,   2243,
-   561,   2026,  -3598,  -1125,    646,  -5188,   6017,   -632,
-   772,  -2919,  -3776,  -9938,   2461,   -122,    128,  -1416,
- -1533,    343,   1318, -13738,  -1528,  -6418,  -1196,    832
-},
-
-.cb2224s1 = {
- 32767,   -749,  -1885,   -806,    739,  -1858,   3902,   1029,
-   332,  -2122,   1240,   2705,   1362,    190,   1058,  -1404,
-  1224,   1122,   1208,    190,   1984,  -1355,   1694, -21000,
- -1012,   2418,  -1269,  -1154,   1113,   2291,  -2317,    315,
- 12872,  -2296,  -1510,   1104,  11324,  -1146,  -1018,   1326,
-  -902,    168,    647,  -1828,  -3838,  -5682,   2732,   -238,
-  -134,  13450,   1570,   2424,    996,  -3494,  -3720,   4897,
-  5875,    149,  -6367,   6659,  -2329,   6916,   1134,    425,
--19014,   -479,  -1900,   3470,  -1777,   -811,   1723,    -46,
- -2103,  -1298,   2929,  -4279,   -639,  -2443,   7231,  -1187,
- -2145,   -777,  -3287,   4895,   8878,  -9318,    289,   4015,
- -3148,   -598,   2226,  11700,    114,   3237,   9586,  -4570,
-  2592,   3614,  -2272,  -2829,  -3356,  -1095,  -5290,   4709,
- -1867,  -1930, -20722,    937,    892,   1415,   1544,   2950,
-  5090,    937,  -1411,    123,    -31,  -1568,    338,   -938,
-  5465,   5796,    480,  -2782,   3351,  -2489,   -383,   1529,
- -5686,   2446,   -693, -12796,   -599,   1894,  -1576,  -2244,
- -4686,  10165,  -1085,  10050,   2681,   1138,   2544,  -1809,
-  -806,   5278,  -8730,  -3740,  -2343,    971,  -3254,   -165,
-  -212,  -4164,    850,    233, -13694,    442,   1073,   3854,
--12926,  -2001,   3468,   -765,    829,   2174,   1531,  -6036,
--10848, -11009,    803,   1713,   2884,   1992,     75,  -2989,
-   268,    346,   1998,   4798,   8976,  -4632,   1863,  -4127,
-  -612,   4790,  10946,  -1296,   8009,  -1351,    356,  -1711,
-   313,   2301,   1318,   8050,    700,   1218,   2270,  -2156,
-    67,   1537,   1941,   3442,  13321,    691,   2344,   2594,
-  1551,   3853,   7279, -10441,   1006, -11862,   5532,   -611,
-  -582,   2257,  -2873,   3993,  -5133,  -2264,  -2478,   1576,
-  1834,  -4931,  10264,  -1429, -10404,    393,  -3715,  -1470,
- -2003,    384,   4869,  -6780,  -1297,   1572,   1043,   6980,
- -4382,  -3005,   3698,   4176,  -1348,  -4972,   1574,   9815,
- -5995,   -979,   3609,   3702,  -8503,    668,   3354,   2552,
-  9183,  -1175,   1224,  -2859,  11176,   6088,  -1355,     84,
-  1271,   -380,   5336,    299,   -690,   -365,  -8047,  -3679,
- -3204,   1334, -13451,  -1392,   2200,  -3646,  -1046,  -4292,
-   741,  -1701,   1722,   2061,  -1358,   7266,  -6356,    963,
-  2190,  -1349,  -1882, -14128,  -4662,   3552,    565,  -1109,
-  5413,   1239,  -2618,    794,  -2064,  11805,   9004,  -2134,
-  2804,    946,     80,  -2387,  -1205,     11,   1642,  -1825,
- -2324,  -5018,   4208,   5285,    661,  12430,   1907,    784,
- 10864,    340,     18,   -138,   2885,  -2247,     17,    334,
- -3172,   2977,    970,    536,  -1540,   -516,   -488,   -512,
- -1334,  -1930,  -2418,   1078,  24837,     12,   2060,   -252,
- -2536,  -2206,  -3179,  -6785,  -8842,   8736,   1393,    119,
-  1652,  10126,    856,    855,   -742,   -289,  -2208,   3831,
-  6909,  -6556,   2472,   -245,  -1729,   1460,  -3014,     59,
-   -58,    132,   3903,  -3762,  -1419,  13273,   2708,  -7752,
-    84,   3525,  -1305,   -334, -13421,   5931,  -4845,  -2697,
-   666,    558,  -1102,    632,  -2946,   4153,  -4018,   4516,
-  4875,   4460,  -1567,   2233,    386,   -754,   1256,   2145,
- -1692, -13046,   1581,   -518,   4397,   1215,   -723,   3413,
-  -640,  -5088,   1711,   -714,   2536,   2433,   -691,  10758,
- -8764,   5541,  -2071,  -1662,  12955,  12998,   1252,    -94,
-   802,   2573,  -2557,    -66,   -832,    106,   -728,   1050,
-  -811,  -2684,    629, -16524,   1531,  -1617,   1348,    204,
-  1722,    368,    554,  -1752,    114,   1349,   1952,  -1007,
-  2626,   2035,   8148,  -2539,  -4296,  -4460,  -8542,  -3089,
- -1543,   -857,  -2617,  -1765,   6642,   2167,  -1531,  -6881,
-    86,   -414,  -5896,  -5152,  17445,   1129,  -5006,   2936,
- -3432,  -2226,   1176,    972,   1170,    530,   3390,    260,
- -2909,  -3550,  -5255,   1771,   -382,  -1690,  17070,   2688,
-   566,   2430,  -1768,   3373,   1460,  -3464,   -629,   3119,
-   430,  -3554,   8357,   7075,    293,   2955,    -61,  -6919,
- -4939,   3678,  -6852,    652,   2206,   5918,  -2768,  -3022,
-  5721,   -770,  -1102,  -1057,  -2760,   3086,   5611,   -160,
-  2714,  -1042,   2569, -14248,   3846,   8212,   5392,    144,
--11896,    618,   1212,   3283,  -3777,   -715,  -3870,   2528,
- -2900,   1645,  -1786,  -1852,   2776,  -1348,   -586,    234,
-    -4,  -1666,     46,   2095,  -1987, -18728,  -2980,   2501,
-  4042,     79,  -1849,  -2013,   8047,  -1898,   -108,    340,
- -4760,   2134,   9000,    347,  10365,   4779,   6660,   1694,
- -3253,  -2282,  -1488,  10406,  -8054,  -3414,  -2934,  -1611,
-  3172,  -2195,   4973,   1249,   2888,  -4054,  -5738,  -2995,
- -2282,   1977,   -353,   -516,   5322,   3225,  -4907,   1303,
- -4656,   9947,   -236,   9382,   2332,   2076,   1470,   3173,
-  4712,   2645,    559,   4904,   1511,  -1715,  -4856,   5750,
- -1276,   -306,  -5980,  14393,   1443,     85,    156,   7718,
-   793,   4199,   2122,   1098,    128,  -1996,  -1397,    -20,
-  -534, -13296,  -1518,  -2970,  -1001,  -6474,  -6146,   8337,
-  5476,   3058,   -526,  -1295,   1623,  -8791,   1257,   2006,
- -5725,   3035,  -2917,   1280,  -8479,   5934,   9870, -13131,
-    14,   1088,     -9,   1969,    366,  -3214,    192,   2764,
-  1499,    346,  -2031,  -2900,  -2529,   1072,  11717,   5206,
-   -44,  -2514,  -8900,   2892,   2132,   3635,   3735,   2726,
-  1398,   6035,  -2830,  -4568,    424,  -8696,   1368,  -3860,
-  1823,  -2620,   4546,  -2210,   1660,  -1672, -10524,   -484,
-   950,     11,  -4494,  -6220,  -5653, -13332,   2868,    460,
- -4120,  -4030,  -3277,    522,  -3403,   1126,   -170,  -1892,
- -4366,   1304,   3477,  -1507,   1111,   -594,   1670,  -8416,
- -1690,   2492,  -7109,   2531,   4131,  -8123,  -4884,  16505,
-  -240,    -63,  32099,    974,  -1360,  -2395,  -2005,  -1156,
-  -877,   -416,   -922,   1857,    766,     71,   1380,   -259,
-  -272,  -1924,   2498,  -3290, -16045,  -2064,   2966,   2936,
- -1265,   2121,    488,   3781,   1484,  -1193,   4776,  -1001,
-  -669,   1569,   -379,   -604,     -5,  -1943,    757,    359,
-  -560,    118,  17941,   2323,    215,   7621,  -3582,  -8130,
-  -698,   9893,  -2752,   -417,  -1262,  -1504,   3319,   1186,
- -2192,   3014,    781,  -3602,  -6190,  -7725,   3169,   2038,
-  1175,    612,   2477,  -4136, -12152,   4538,    567,   -116,
- -3222,   -470,   -118,  -9257,   -635,   3078, -11596,     93,
- -4178,   4150,   5985,   4414,  -2110,    542,  -1125,  -1242,
-  -234,    807,  -1385,  -2448,    824,    109,  -1826,   3032,
-   269,  14188,   3468,    908,    -12,   2290,   5758,   1685,
-   680,   5963,  -2763,   -173,    -34,   3135,   1230,   2226,
-  2471,  -9546,   2266,  -1583,    729,   3506, -10664,   -652,
-  2212,   -620,   2762,   -751,  -6337,  -4339,   4131,  -1234,
-  5423,  -2279,  -2884,   -929, -12582,    416,   2046,  -3854,
- 11130,  -2738,   -670,   -202,   6216,  -7266,   9726,   1308,
- -1761,   4696,  -1061,   -144,    482,  -1586,   4377,  -5016,
- -3894,   2296,   4340,   -555,  -3003,  -2117,   -962,    100,
-  4548,  -1870, -13885,   1351,  -3226,  -8114,    377,   -391,
- -1344,  -2148,   4756,  -3518, -14429,   -670,   -238,    400,
-  1234,   4389,   1181,   1046,    425,    -32,    840, -29846,
-  1580,   -992,   1844,   1961,  -1305,   1055,    418,     52,
-  -641,   2430,  -1773,  -5323,   3341,  -5367,  14027,   3051,
-  3864,    404,   4186,  -1875,  -5822,  -4321,    112,    395,
-  -177,   1080,  -3008,    520,      8,    226,   1430,  -1635,
-     8,  -2632,  -3249,  -3595,    622,    564,   8404,  14463,
-   160,  -7828,  -4113, -16547,    848,   6320,   2311,   4074,
- -2050,    668,   1463,  -2322,   1790,    864,    317,   -594
-},
-
-.cb2224m0 = {
--17338,   5737,   -912,   5906,  -5315,    920,   2743,  -2232,
-  1943,   -753,   1696,  -1818,  -2272,   -564,  -1306,   -527,
-  -156,   9952,     36,   2524,   2053,   1841,  -1670,  10622,
-  2532,  -5616,   -324,  -1132,  -1148,   1920,  10232,    -75,
-  -630, -10796,   1618,   1104,  -2557,   -603,   2115,    966,
- -3763,  -3183,   -851,   4502,  -1565,  10062,    313,   -709,
- 10707,    867,   3820,  -2747,   3470,  -1942,   -486,   4092,
- -6289,  -2363,    556,   3190,   5046,  -1869,   2886,  10572,
-  -948,  -4191,   1544,  -1727,    721,  -3153,   -712,    934,
-  1610,   1070,   1248,  10645,   2340, -11102,  -2744,   -353,
-   -65,  -4973,  -1782,  -1037,   1210,   1192,   1138,   1106,
-  9422,    652,  -9595,  -1663,    460,   9107,  -2827,    775,
-  1131,   4732,     93,    476,    387,  32767,   -161,    266,
-  -406,    604,    675,     83,   -589,   -639,    220,   -830,
-  2200,   -142,  -2000,   -128,    902,    823,    287,    717,
-  1857,  -1626,    208,   2784,    -72, -19310,   6190,  -2063,
- -9101,   3419,   1721,  -2092,    332,  -6533,  -7594,   1138,
-   807,  -2582,   -668,    410,   -497,   1526,     96,    944,
-  3319,   1294,   -335,   1964,   -380,   -618,   3069,    101,
- 18964,  -2298, -10304,  -1190,   -998,  -1384, -11466,   -256,
- -4475,   4027,  -3532,   1828,  -1311,  -3417,  -3925,   -221,
- 27688,   2277,  -1227,   1043,   -399,  -3327,    515,   1665,
-  -616,   2724,   -546,   4608,   -576,   -103,  -9064,  -1281,
-  -563,  -3588,   2174,   -824,   3379,  -2360,    354,    844,
- -7044,  -2295,  -2613, -11152,   1006,  -1064, -17007,   1180,
-   387,  -8448,    836,   -578,   2621,   -356,  -1476,   2362,
-   822,   4547,    118, -11628,    352,    367,   -958, -12423,
-   -65,  -1591,  -2304,  -2880,   1684,   1708,  -1693,   -781,
-   -71,  10012,   -534,  -3672,    417,  -2048,  -1955,  10491,
- -1257,    861,   -414,  -4058,   3042,   1529,  -5823,   6877,
- -3918,    993,    221,   2576,  -7780,    170,   -648,   -139,
- -3410,   7974,   -756,   2657,   -596,  12527,   -199,  13752,
-  2198,   -938,  -2265,   1736,    257,   1517,   -676,  -1165,
- -2874,  -2433,    123,   -829,   2605, -10270,  -3158,   3624,
-  2072,   6960,   1490,   4634,    455,  -8175,   1139,  -4545,
- -1491,   3727,  -8738,  -1951,    593,     14,   2897,   2490,
- -2273,  -1436, -10992,   3005,  -4392,  -3434,  -4561,  -1014,
- -9506,  -1609,  -1248,  -1593,   -190, -10472,   3264,  -2274,
-  5097,   -633,    473,    427,    725,   1577,  11032,    318,
--12228,     78,  -1116,    441,   1930,   4041,   -648,  -4324,
-  -224,   2738,   8826,    -40,    327,   1761,   2371,    171,
-  4039,  -3411,  -2495,   1150, -12181,  -1704,     35,    528,
-   417,    626,   1866,   -472,    466,    905,   -854,   -875,
-  1194,  24371,    488,     26,    695,   1777,    798,   -169,
-   -16,  -1252,    395,    871,   1170,   -635,  -1637,   2094,
- -5427, -16393,   -384,   3872,     33,   -687,  -1777,  -4160,
-  3020,  -1906,   3868,    699,   -400,   6755,  -3253,  12699,
-  1474,   7312,    991,   -646,  26770,   2524,   2144,   -500,
-  1096,  -1869,   1036,  -1707,    521,  -2091,   1445,   2335,
-   107,    238,   -227,   -120, -32768,    591,   -257,    867,
- -1231,    650,   -465,    356,    431,    762,   -516,   -594,
-   512,    242,   2298,   1012,  -1538, -11748,   3551,  -5608,
- -2174,  -2428,  10557,    625,   1002,  27865,   -589,  -1527,
- -1552,    156,   1905,   1041,  -4190,   2300,   1603,   -980,
- -1764,    484,   1555,  -2664,    381,  11676,  -8848,  -3060,
-   675,   -646,    736,  -1279,  -1261,  -1988,    543,  -1880,
-  1917,  -2165,   2846,  11863,   2076,  10381,   -307,   4354,
-    73,  -2788,  -2464,    964,   -218,   1552,   1846,   1470,
-   577,   -594,    725,  30798,     43,     13,  -1474,    260,
-  1218,   1433,   -114,   1020,   -648,   -678,  -1879,    -65,
-   791,    366,   8547,    931,   1091,   1018,  16312,  -1116,
-  -777,  -1098,    404,    180,   -899,  -2865, -10089,   -751,
-    40,  -2358,  -2980,   3574,   7905,   -190,   9207,    -18,
--18766,   -270,  -5300,  -2023,   2422,  -1189,   1267,  -1085,
-  -704,   6823,   2164,      2,    125,  -2319,    411,    591,
-  -488,   -566,  -3394,    304, -12375,   -268,  11098,   -150,
- -2392,  -1255,   3172,    162,   1295,   5897,   7944,   6019,
-  3329,  -2014,   2957,  -4933,   4805,   2780,  -5453,   2680,
-  3220,   2784,   -549, -19908,  -1222,    550,  -3540,   1822,
-  4082,   2399,  -6844,   2145,    938,   -597,    122,    -20,
--14986,  -1620,   1575,    561,    408,  -6305,    760,   1634,
-  2652,  -8301,  -2988,   1864,   2524,   3228,   7466,  -2620,
-   410,   1364,   1740,   2204,   1999,   1704,  -2601,   -351,
-  -104,  10688,  -7166,    134,   -346,  11852, -13322,  -3171,
- -1230,   1109,  -2336,   -962,   -563,   1030,   2832,   -969,
- -1997,   3233,   -414,  -8246,  -2074,   2737,   3557,   1625,
-  1036,    845,   1848,   1710, -10388,  -4586,   6915,   2734,
- -8693,   -667,   1568,   1758,   2396,  -3262,  -2497,  -1472,
--11848,   -689,   3379,   1692,   1449,   2844,   8524, -15598,
-   337,    590,   3303,  -1594,  -2548,   4529,    433,  -1921,
-   920,   1061,  -1693,    191,     44,    957,  -2397,  -1126,
-    41,   2164,  -1587,    568, -17290,   4687,  -1028,   -403,
-  1169,  -1282,  -1602,    242,  -1234,   1870,   1067,   2444,
-  1752,  -2552,   8775,   1384,   5683,  -4770, -12436,   -680,
--13344,   -196,   -276,   -299,    734,  12378,   2364,    327,
- -1494,    560,    -90,   3394,    496,   2357,    629,    -17,
-  1040,   -706,    589,    294,  -1135,  25012,    444,   1206,
-  -298,   1424,   1524,  -2188,    -64,  -1101,  -1998,    374,
-  1377,  -1382, -11349,   1456,   -171,  -2369,   6966,  -2808,
- -8987,   3390,   -811,    671,   3032,  -3396,  -9815,   2246,
-  4418,   -678,   1851,  -1592, -11038,  -1194,  -3612,   2589,
-  -250,   -495,   1203,   1348,   -805,   1853,   -345,   -555,
- -8755,  -9695,  -3768,  -1506,  -8172,   -322,  -7163,  -6319,
-  2052,    116,  -4459,  -2328,   4857,  -2569,   1419,    959,
-  1138,   7034,   4836,   3449,   6826,  13411,   -893,    981,
- -2060,  -3710,   3177,   -761,  -1128,   4386,   -127,   6698,
-  3426,  -2922,    -61,    408,   1426,  -1238,  15468,     94,
-   373,   3597,  -2432,  -1989,   -859,  -8976,   2938,   -777,
-   409,   -206,  -7758,   3384,    295,   -466,     29,   7925,
-  2048,    930,   2296, -10030,    330,   7864,  -1004,   -385,
-  2130,    388,   3587,  -4480,   1560, -12768,  -2606,   8178,
-   771,  -3519,  -1590,   -592,   2192,  -1126,    -77,  -3947,
-  1868,  -1304,  11107,    781,   6240,   4134,  -3314,    407,
- -6125,   5168,   -503,   2155,   -990,    143,    219,  -9950,
- -1186,  -1446,   1930,  -8963,  -4084,  -6141,   -976,    153,
--13665,    564,  13631,    138,   -269,    379,   1333,  -1710,
-  -940,   -511,   1214,  -2190,   1347,  -1397,  -1321,     94,
- -1802,   6627,   1306, -12347,   2780,  -1091,  -4362,   5047,
-  -446,  -3472,   6064,   1075,    478,    769,     58,    802,
-   562,  -1581,  28580,    194,   1338,    573,   -555,    617,
-  -409,  -1249,     -8,   1133,    952,   -120,   2502,   5313,
-   969,  -1664,   1769, -12199,   5551,   -402,   4862,   3270
-},
-
-.cb2224m1 = {
- 32767,    -54,   1385,   -206,     19,    522,  -1176,   -667,
-  -260,  -1388,  -1751,  -2234,    228,   -343,   -893,   -898,
- -1004,   2517,   -232,  20996,    507,  -1857,   2574,    840,
-  -615,  -1922,    660,    844,     52,   1272,    609,   -692,
- 21805,    938,    678,   -399,    -22,  -1839,   -996,   1560,
-   218,   3973,  -6547,  -1151,  -3914,   -789,    938, -11509,
- -2282,   -606,   -327,   3088,    797,  -1540,  -7598,   1378,
-  -100,   2108,  -1907, -11671,   1538,  11136,    310,  -2096,
- -3037,   3181,   1731,   2043,   3424,  -1098,   2046,    545,
- -1778,    605,    932,    832,  -2356,  -1498,   1129,  11542,
-   119, -10994,  -3720,   4316,    346,  -9141,   3921,   -918,
- -5476,    372,   -318,   9254,   -681,   4896,   1587,   1620,
-  1850,   4057,  -1507,   -362,  -1074,   -328,  -1502,  -3092,
-  2735,   -378, -11572,  -1292,  -2575,  -3397,  -7566,  -8977,
-  1670,   8659,   -655,    884,   1815,  -9348,    570,    394,
-  1670,   1942,   -195,    386,    553,   8885,  -9206,   -624,
- -2312,  15852,    782,    562,  -1497,    720,   1804,   1415,
- -3809,   3783,  -1918,  -3496,   -637,    581,   1161,    961,
-  -960,   -930,  -1673,    904,  11510,  -2286,  -9964,   2964,
- -5752,   2229,    786,  -1479, -18882,   1517,    128,   3282,
-   157,  -2178,   -564,  -6029,    766,  -4599,   3620,  -4380,
--20114,   -677,   2134,    -93,   1486,    648,  -4790,   1862,
- -1476,    -56,  -3443,  -2622,  -2806,  -1185,    122,   1801,
- -1547,  12241,  -2785,   2386,     56,  -4075, -10964,   -832,
- -4744,  -1350,   2849,   -255,  -1375,    163,   1306,     37,
-  2304,  -1396, -11234,   9712,   1732,  -2262,   3632,   -431,
-  -579,  -4045,    806, -12168,  -1309,    840,  -1474,    918,
- -1240,  -1601,     48,  -4137,   6934,   3968,   7370,   4088,
-  8648,   2351,   1466,    615, -12314,  -2347,   4382,    862,
- -4288,  -3138,   1886,  -4357,    375,   1949,     73,    287,
-   135,    -60,  -1498,  -2427,   1263,   3322,   -582,  17508,
- -1202,   1558,   3351,    484,   -439,   -571,   -370,  11952,
- 11656,  -1407,  -1410,  -2976,   -459,    397,   1980,  -1374,
-  1237,   5044,  -2074,    405, -10650,   -174, -12556,  -1962,
-  4569,  -1293,   -200,   3106,    343,    748,   1918,   1084,
-  -670,      3,  -1070,   -397,   3965,   9966,   -609,   9691,
-  -900,    137,   2305,  -5944,   -944,  -1500,    638,   -703,
-  -582,  10098,   -523,    776,   1266,   4860,   6213,   1181,
- -5634,    518,   9116,  -4740,  10683,   -547,  -1295,    -91,
-   104,  -3115,  -1724,    -17,   1953,   -745,    694,   -474,
- 12248,   -596,   -674,    765,    674,   4494,   1205,   5883,
- -1638,  -3996,   -664,   8694,  -5620,   3968,   -717, -10425,
-  -285, -12605,    368,  -3904,  12363,  -1288,   1242,  -1497,
- -3117,   2396,   -220,   1700,  -2788,    250,    107,   -150,
-   345,    681,    -44,  -2466,   -389,   2098,    312,     54,
-  2734, -22225,  -1232,  -1778,   1063,  -1586,  -6658,    344,
- -2889,  -4348,  -3685,  -2100,     12,  -1755,  -6401,   -149,
-  8150, -10689,   -748,   1443, -32768,   1698,   1461,    216,
-  1373,  -2814,   1014,   1135,   -227,  -1309,   -616,   1566,
-   395,   -724,    852,   1579,  -9647,  -1214,    728,    329,
-  9244,    179,   7204,   -836,  -3954,    168,  -5722,    152,
- -2886,    472,   -651,   5114,   8734,    -71,  11406,   1098,
- -1452,   1190,    598,   -880,  14611,  12540,  -1523,   1340,
-  1015,   1510,   -208,    206,   1314,  -1532,   -246,  -3210,
- -1637,   -197,    197, -32768,   1448,   -191,  -1720,   -217,
-  1021,    973,  -2099,     56,    606,     39,  -1569,  -1205,
- -2375,  -2156,   4798,   2504, -11914,    933,  -6015,   2657,
- -2911,  -5173,  -1964,   1576,   5268,   1190,    675,    856,
- -1718,  -4332,    166,   1556,  19005,   2040,   1198,  -2170,
-  1824,  -3409,    121,    830,   -252,   -525,    289,  -1701,
-   292,    854,  -1150,  -1108,    171,    511,  22114,    662,
- -1263,   -540,  -2306,  -2332,    869,  -5191,    186,    536,
-   410,  -7576,    590,  13625,   3519,   3858,  -2787,   -376,
- -6506,    891,   5025,  -2054,   8316,  -2115,   7668,  -5808,
- -2464,  -2422,   1541,  -3851,   1578,    420,   -617,  -6507,
-  -858,    160,   3876,  -2830,  -5970,  -3295,   9829,   1099,
-  1617,   3502,  -3124,  -4116,    138,    287,    914,   -548,
-  1056,  -1546,   1218,   -227,  11632,   -574,   -996,  -9894,
-   808,  -5868,  -1457,   8374,  -2086,   -280,   1038,    528,
-  1862,    284,   3926,   -144,   7168,   1224,  11628,   -221,
-  1018,   1683,    922,    561,   6910,   1895,   3044,  12613,
-   -74,  -1424,   1654,   8872,   2255,   -990,  -2039,    269,
-  9558,  10122,    958,    466,  -1948,  -1242,   1042,    886,
- -1143,  -3444,  -8720,   1918,   -300,  19074,  -1629,    991,
-   908,   -896,   1207,   3602,  -4802,  -2912,   4100,   2936,
- -1344,    459,  -6904,   -714,    524,    171,  -1430,   1454,
- -2725,   1130,   -757,   2861, -11174,  -2768,   5466,   3662,
-   110,  -1999,  12376,  -2173,  -2508,  -2838,  -2025,  -4378,
-   134,  -9856,   1738,   1027,   1428,     38,  -1560,  12824,
- 13932,    549,    586,    720,    923,  -1040,  -2827,  -3272,
-  1902,  -2113,   2624,   3296,    -34,  12291,   1449, -12138,
-  -796,    186,   2777,  -1007,   3276,   -587,  -1917,   -130,
-  2120,   -564,   -364,   1005,   -615,   1504,  -2412,   9219,
--11412,  -2490,   1262,  -2720,   1608,  -3276,   1294,   1882,
-  -188,   7090,   6029,  -4207,  -2739,     72, -10035,  -1672,
-  1509,   -124,  -1649,    420,  -3623,  -1069, -11225,   -754,
-  -388,    790,  -3209,   -330,  -2632, -11920,   3178,  -1788,
-  2585,   4146,   1944,  -2757, -10616,    220, -14136,   2158,
-  -274,   2010,   -362,   1107,   -348,  -1990,     96,   -985,
-  1599,   1566,   1393,    304,  -1380,   -924,   -285,    620,
-   -30,   -902,  26210,   1485,   1042,  -1160,    352,   -177,
-  1245,   1879,    -18,    727,   -421,    223,  -1298,   1066,
-   962,   1306,   3866,    870, -18780,  -3873,    107,  -1408,
- -1261,    808,   -818,   1738,   1439,  -2156,  -1499,  -2108,
- -4626,   4039,   -964,  16682,  -1169,    266,   9373,   1238,
- -2728,   2381,  12159,   2155,   -472,  -2293,   -513,   3808,
-  -690,  -2190,  -1139,     -6,   1379, -22803,   1380,   -612,
-   308,   1394,   -902,  -1454,  -2620,  -1080,  -2864,  -3301,
-   108,    218,   8718,   -617,  -1098,   1436,  -2005,  -3966,
- -2658,   6152,   -874,  -4636,   8705,  -3382, -12072,    418,
- -1837, -12582,    270,   -788,  -1174,   2156,    461,   -297,
-   478,   -632,   -356,   5796, -12024,    416,   2602,   3544,
- -1240,   -970,   4874,   7221,    704,   8940,   2316,   1174,
-  2537,   5380,     -5,  -1818,   3020,  -4120,   7042,  -9618,
- -1622,   3576,   2455,   -298,    451,  -5298,   7371,  -1570,
--12956,   9758,   -216,    889,   5395,  -2779,  -4036,   1736,
- -1871,  -2036,  -1119,   1847,    912,   2292,    850,    220,
-  1300,   2228,    399,  -2885,  -2696,   2399,   3179,   6266,
-  1629,  13091,   -232,  -5322,   1397,   -724,   1666,  -2012,
-  3643,   1400,  -2724, -18007,   -506,   -103,   1318,   2473,
-   965,   -587,   1135,   -904,   -510, -10767,   1937,   -585,
-   -73,  -1662,   3021,    340, -12475,  -1618,     -1,  -1914
-},
-
-.cb2232l0 = {
- -9947,   -673,    522,    -36,    396,   -433,    949,   -442,
--12495,  -2186,   4280,   -997,  -1715,  -7385,   -379,   3498,
-  -572,  -9897,   6686,  -4736,    577,   1866,    659,   -123,
- -1682,    420,   -866,   4458,   5821,   3155,   7929,  -5562,
- -1798,   3086,   8556,    -65,  -8943,   2354,  -4187,  -3798,
-   627,  -1859,  -9760,  -1811,  -1724,    -45,  -1838,   1638,
-   499,    148,   -335,  20916,   -264,   -556,   -269,  -1014,
- -1531,    711,   -519,    462,  -5117,   3944,   -950,   8277,
-   878,  -4803,  -5003,  -4402,  -4722,   2988,   -144,  -6887,
- 10661,   -909,    700,  -2287,  12126,   -101,   -761,   1836,
-   827,   -609,    538,    442,  -4504,   1812,   3818,   7359,
-    96,   -555,   1598,  10040,   -554,    924,   3426,  -1786,
-  2620,  -2132,    867,   -519,  -2299,   -672,   -508,    201,
- -2457,  10872,  -5003,   5422,  -8890,   -104,   2579,    940,
-   401,    871,  11167,   1216,   1054,  -2876,  -1523,  -3950,
- -1229,  -3410,   -428,   3648,  -9389,  -3025,  -1752,   7583,
-  3953,   1938,   3899,   1435,   8170,   1019,  -2320,   1299,
- -1152,    226,    394,  11328,  -1471,    604,   -184,    567,
- -3704,  -5723,  -5938,    423,   9362,   4546,  -3318,  -3395,
-  5084,  -4341,  -1781,  -2619,   1078,   -365,    151,   -413,
--21591,   -968,   -202,   -183,    849,   -481,    407,    -11,
- -2708,   2472,   2689,  -9232,  -9482,  -1776,    645,  -1510,
- -1410,  -6115,   -114,  -2550,   1922,   1668,    288,  -1302,
-   948,   1967,     52,   2393,  -1975,    374,  17358,  -1332,
-  5303,   3195,  -2674,   4784,  -1418,  -1359,    -57,  -2126,
-  4618,   8890,   6455,   1181,     76,    374,   9585,   8762,
-   672,   -642,    666,  -6485,   1751,   3255,   -934,   6196,
-   892,    171,   -102,    -44,   -326,   1330,   -320,   -480,
-  -842, -22376,   -561,   -141,    635,  -6528,   5711,   2400,
-   838,   2846,  -3212,  -5341,  -5479,   4961,   2110,  -7480,
- -4215,   7964,  -1308,   1219,   1541,  -4418,   6293,  -4522,
- -4887,  -5760,   2790,   1441,   6135,  -1133,  -1627,   1235,
-   914,    572,  -1043,  -1473,   -519,  -4618,  -1228, -12212,
-  1101, -10794,  -4292,  -4355,   6431,   -588,   -992,    612,
- -1771,   6751,   4871,    581,    620,   -352,    277,    727,
-  2226,   8552,    -43,   2295,   9409,   1122,   7618,   1885,
-  1192,  -1432,  -1103,   8666,  -2078,   -403,  -1787,   1572,
- -2200,  -7705,  -6743,  -1277,  -1228,    955,   7613,  -1536,
-  8530,   5703,   5446,   4251,   -853,   4910,   1578,   2832,
-  1274,  -2610,    243,   2820,    951,   9240,   1617,    605,
- -6755,  -2728,  -5658,   3866,   -157,   1215,  -8470,  -2038,
-  -189,  10411,   7444,   -376,    407,  -1128,    770,   -410,
-   503,   1707,    786,   -529,     82,    -27,  21512,   -282,
-    81,  -1129,   -686,   -555,   2674,    -99,   1284,   2216,
-  1238,    404,  -3398,   1010,   3966,  -1134,  -2682,  14222,
- -1581,   9779,  -1114,    848,   1905,   2129,  -3937,  -4742,
-  1229,   8051,  -4344,   3914,   4273,   -659,    159,  -1188,
- -1844,    912,  -1256,   -478, -16158,  -2869,    959,  -2096,
- -2166,   2360,   7861,  -2718,  -6358,   7653,   6639,  -3239,
- -1690,  -1242,   3439,   1254,   -954,    604,  17512,   -288,
-  2412,    211,   -298,   2656,  -5217,  -1770,    892,   1979,
- -1482,   3498,    -40,  10424,  -1038,  -1862,   9905,    298,
-    77,   2179,  -4444,   2580,  -2069,  -6473,     61,     84,
-  1035,   -645,   -662,   -824,   -743,   -104,  -1962,   -124,
-  4976,  -5378,  -1254,  -7055,  -3474, -10695,  -1254,   2547,
-  -694,   3194,    -82,  -2634,    230,    358,    -12,   1594,
-   -90,    598,    -76, -21136,  -1278,    846,    -84,    259,
- -2536,  -4442,   2337,  -1606,  -3264,  -3126,   -591,  -1295,
- -2440,  -2592,  10888,   5821,   -862,  -5070,  10402, -10633,
-   159,  -2660,    894,  -2112,  -1774,   3732,  -1020,    422,
-  9487,   1608,   -992,   2046,    275, -10676,   2606,   -999,
-   477,  -1868,  -1690,   4764,  -6419,  -7550,   8159,    529,
-  2308,   -394,  -2394,   2826,   6680,    496,   3628,   -646,
-  3186,   -657,  -2260,  -1416,  -9202,    496,   6624,   2441,
-  1554,  -2195,  -8458,  -3459,    466,   6706,   1056,  -8777,
-  5436,  -4000,  -3130,   4794,  -6127,   2008,   1602,    195,
-   558,  -1362,   -880,  -2662,   9726,  -9793,   2989,  -3182,
- -2378,  -1338,   1086,  -4682,    372,   -399,  11129,   -601,
-  -666,   5206,  -1106,    362,   3155,    328,  -9862,    719,
-  1602,    998,  -2342,    857,   1510,    476,   7256,   4652,
- -5750,  -4991,   4611,   8718,  -4434,  -4119,   -351,  -1606,
- -1033,  -3717,   3585,   9381,  -1594,   5052,  -7414,   -205,
-  2356,  -5949,  -8738,   1526,  -1838,   4760,  -5444,    623,
-   112,  -2863,   5710,   4920,   9497,   3759,  10748,   -201,
-   716,    747,  -2559,  -4077,   -449,   -741,   -136,  -1303,
-  -572,   1886,   -986, -10529,    -51,   1360,   2418,    116,
- -1490,   1928,  -9977,   4720,    227, -11212,   3730,  -2996,
-  1300,   9935,    356,  -4618,   -384,    972,   3174,   3732,
-  -803,   2666,    790,   2067,   2343,  -1209, -10147,     21,
-  9066,  -4564,   2508,   -176,    264,   9834,   3360,   7278,
-  9386,  -1274,    522,    -50,   4150,   -884,    592,   -688,
-   309,  20750,    672,  -1326,   -346,    366,   2058,   -607,
-   633,    620,   -677,    330,     69,    432,    319,    436,
-  -300,  21845,   -318,   -676,    320,   -386,    889,   -724,
- -1394,  -2664,   -431,   2046,   -136,   5520,   6700,   1192,
-  5779,   9386,  -3541,  -5638, -16125,   -259,    545,   -267,
-  1972,  -2366,    -43,    615,    251,   1003,   -980,   2262,
--10519,  12166,   2007,   -884,  -1560,  -1250,   -491,   -438,
-   820,   1212,   3512,    354,  -1066,    -46,     98,    315,
-  8532,    944,  -1297,   8011,   1029,   -383,  -1606,  -8381,
- -1650,   2852,   -958,   1757,  -4270,   2160,  -9283,   2918,
- -3718,   -224,   6154,  -5671,   3764,   -554,   5214,  -2526,
-   -31,    547,      6,   1633,  -4562,   1424,   1177,   -866,
-  1648,    653,   6056,  -1845,  -1271,   -350,    596,  -2286,
-  9893,  -6594,   1099,    630,   -537,    230,    972,   -134,
-  -491,     79,    306,    -74,    253,    208,  -1804,     73
-},
-
-.cb2232l1 = {
--11397,    378,  12845,  -1813,    342,    329,   1165,    550,
-   556,   -115,    755,    117,   2511,    260,  -1189,  -1406,
- -1528,   1866,   3300,  -9678,   1025,  10413,    199,   2878,
- -3572,   8701,  -1895,  -1189,   -576,  -3384,   -162, -10866,
-  3253,  -1267,     91,   2277,    -86,  -3394,   6576,  -2475,
- -1136,  -4295,  -1610,  -8064,    297,  -8908,  -4433,  -2954,
-   -82, -11426,  -4610,   2063,   1522,  -7972,   -495,   1799,
-  2922,  -5179,   -865,   4739,  11072,   3927,   -483, -11111,
- -2375,  -1432,   1210,  -1342,   2418,   1688,    852,    -64,
-   133,  -4582,  -7136,  10558,  -3417,  -3162,   2033,   3149,
- -3050,   2532,    568,  -2444,   4082,  -2859, -10350,  -4983,
-  6633,    230,   5954,  -1140,   -657,   -998,   1156,    736,
- -8894,     64,    939,   -260,  -1704,   -526,  -1330,   -869,
- -2427,  12377,   1296,   -120, -10560,   1794,  -9090,   1487,
-  7162,    519,   -382,  -3234,    -66,   1294,   2363,   1482,
-   498,  -4053,   -752,   -154,   -587,   -293,  16533,     65,
- -1211,   1666,    291,   2820,   2222,      2,    865,    344,
- -1206,  -1214,  -2162,   8842,  11063,  -2093,   1896,   -857,
-  -144,    321,  -9548,   4464,   5038,   -282,   1160,   -194,
-   823,   3479,  -8234,   5834,   -320,   7114,   -184,  -2663,
--11670,    472,  -2013,  -1282,   4390,   4453,  -2126,  -2483,
-  -900,  -6262,  -2237,   -539,  -1134,    164,    426,  -8969,
- -1746,  -1960,   8172,  -2127, -19948,    657,   -712,    344,
-  -443,    458,   -564,     56,    756,   -157,    274,  -1324,
- -3372,   2981,    635,  -9454,  -4916,   2884,   2316,   8200,
- -1452,   2135,   1785,  -1054,     82,   5007,  -4164,    642,
-  9241,   5091,   1002,   2467,  -8409,   -854,   -861,  -2317,
-   405,  -1810,   -793,  -7907,    496,  -1005,   3373,  -1016,
-  9527,   -542,   1672,  -9105,    280,  11170,    273,    908,
-    89,   -233,  10850,    870,    436,   1630,   3328,   -499,
-  5091,   1224,   9135,   -480,  -1134,   2428,  -2904,   5077,
-  2014,   2859,   4277,   7763,   8719, -11474,   1619,   1167,
- -3188,  -1063,   -433,  -4291,   2646,   1024,   2008,    317,
-   746,    327,   6824,   1174,   8978,   5254,  -8948,   -136,
- -2602,  -1442,   -698,   -950,   1800,    296,  -1016,   1653,
-  3771,  -9326,   4536,   7033,   4729,   6630,   1042,    167,
- 11485,  12338,   -147,   2834,    611,   1844,   -313,    486,
-  -916,   -887,  -1423,    642,    242,     75,  -1875,   -645,
- -1239,  -2118,   1458,   -272,  -1703,    949,    778,  21826,
-   214,  -1320,    310,   2680,  -1542,  -2202,   1072,   -132,
- -2067,  -3593,  -8293, -10331,   9030,    402,  -2702,   2984,
--12068,   3170,  -1098,  -1175,  -1188,   2998,   1159,  -1712,
-  -904,    236,     42,    823,    548,   -546,  -1954,  15989,
- -2212,   1886,   2300,   2293,   2606,   2905,   2365,  -1214,
-  1592,   1362,  -2210,   1674,  -1892,  15049,  -1012,  -2824,
-  -792, -11447,  11144,   4853,   -357,  -1230,    748,   1212,
-  -294,   -424,  -2720,     78,  -2149,    966,   7794,   1645,
-   138,   -709,    464,   3614, -10308,    310,  -4726,  -3694,
-  1088,   -576,    690,     68,   -145,  -3282,  -9280,  -9537,
- -1274,   3202,    588,   1790,   1437,   3880,  -1803,  -1154,
- 15082,  -2388,  -1746,   -885,   2267,   1813,   1688,  -1039,
-  9775,    350,   3218,  10550,   1048,  -3731,  -3748,   3517,
-  -910,   -663,   -413,  -1045,  -1236,   -248,   -132,  -1196,
-    12,  15815,    653,   1429,   -371,   4094,  -3050,    567,
- -5524, -11128,  -4261,   1929,  -1719,   8236,    686,   1309,
- -1057,   -715,  -2586,   1327,    -38,  -6180,   3499,  -2080,
-  8980,  -1890,     62,  -1004,   3308,   5809,  -5778,  -3865,
-  -610,    180,   -519,   3129,   9000,   1607,   8484,  -4056,
-  4741,  -4491,   -355,  -1324,   1203,  -1864,   -811, -15995,
-  -121,   1325,   -817,  -2170,  -5753,    731,  -1875,  -2286,
- -9193,   -307,    247,   2469,  -1738, -12290,     31,   1028,
-   670,    -66,  -1856,    570,  -3542,  -3401,    144,   -320,
-  -524,    184,   -928,  -1606,  10978,  -3114,  -8861,   1467,
-  1156,    872,   8276,   5655,   -695,   2788,   3733,   2155,
- -2044, -10260,   1683,   1859,   -263,  17966,    -19,   1621,
-    50,   -261,  -4143,   1245,    -22,  -1564,    809,   2462,
- -8005,   1247,  -1471,   -763,  -1686,   -698,   2868,    796,
-  4036,  -3672,  11209,   1102,  -9369,  -1008,   1273,   -906,
- -4458,   1642,  -3254,   3563,    -94,  -6267,   -604,   8687,
-  2388,   2214,   1759,  -7788,   4296,  -7467,   3547,   3248,
-   845,  -7784,  -2195,    -42,   5327,  -1002,  -3915,  -4581,
- -1215,   -919,  -3444,   5142,  -1874,  -3020,  -2627,   1129,
- -4456,   1840, -11472,   -914,  -6366,   3495,  -2775,    484,
- -5859,    980,  -1967,   1350,    929,   6856,  -3952,  -3365,
-  1514,   7423,   -675,  -2260,   6027,  -3072,  -6388,  -3716,
- -2398,   5564,   1447,    -86,   1180,  -1239,  -1372,   -435,
- -1314,  -1978,    942,  -2018,   1027,    704,  20417,    -94,
- -1239,    252,   -171,  -1100,   1684,   1401,    623,   -354,
- -2674,  -5042,   -734,  -6631,   7587,   4901,  -1596,   6806,
-  4230,   -859,   -867,   1266,  -3869,  -3972,   1548,  -4889,
-  2811,   2263,   2468,    354,  -6197,  -1278,   1947,   5675,
- 10612,  -1730,   2056,    -70,   3034,   -583,    879,  -3719,
- -8623,  -1241,    822,   5832,    163,  -1075,   -784,    398,
-  1170,   -717,   -374,    856, -21602,     89,   -513,    260,
-   854,   1152,    762,   -601,    523,   -107,   1033,   1877,
- -1456,    226, -20758,    365,  -8943,   1305,    193,    948,
-   295,   2696,  -3165,  -1982,  -2439,   1067, -12266,  -1018,
-  3400,   -178,   1995,  11745,   1833,   9785,   1171,    582,
- -1844,    157,  -1242,  -4080,    864,  -1771,  -4257,    721,
- -4010,   7990,    142,    730,   1976,  -6623,   4637,  -7394,
- -1143,   -835,   3341,   1732,  -7266,   -448,   5379,    290,
-  1855,   6977,   6637,  -6561,  -1370,  -1767,  -2769,  -1189,
-  3872,  -4895,  -4679,   3906,  -1664,   1514,   7908,  -7960,
- -4147,  -1235,  -1706,   3314,    144,   1668,  -9505,   2268,
-  4147,   2515,  -1451,   6475,   1675,    106,    981,    201,
-   309,     60,   -133,   -472,    561,   -380,   1130,     91
-},
-
-.cb2232s0 = {
--26218,   1606,   -390,   -696,    266,   -947,    561,  -1526,
-    -8,   1080,   -187,   5671,   2249,    -30,  -4129,   -768,
--10908,   3826, -10422,   -144,  -1259,  -1372,  -3553,   1287,
- -5151,   6442,  -5101,   1386,    791,  -1593,  12942,   -764,
-   424,  -6212,   9733,    702,  -9721,    524,  -4818,  -1232,
-     6,   -484,   -818,    955,   6425,   3594,   5156,   -286,
-  1514,   4466,  -1756,  11321,   -679,  -1481,   -477,  -8015,
- -3059,   4476,    679,  -1143,   2877,   2581,   3230,    239,
- 12018,  -1597,  13431,  11852,    260,   3306,   -714,   1299,
- -4375,   -778,    170,   -565,  -3510,  -6632,   3354,   5901,
- -1070,  -5912,  -3430,  -4970,  -4712,   2648,  -9113,   1561,
-  1002,  -5659,  -3177,    638,   2289,  -1050,  12310, -10364,
-  2830,   -961,   -194,  -6442,   2206,   3454,  -2087,   4327,
-  1080,  10257,   8107,   4904,  -3141,  -2339,   7568,   -363,
-  3765,   7960,   7067,   1496,  -3842,   1805,   2415,    913,
- -1641,  -5411,  -7583,   4597,  -1324,   2882,  11310,  -2570,
- -2877,   3544,   4642,  -2249,   7110,   -307,  -3413,  -2871,
- -8974,  -6358,  -5703,   4046,     83,   1887,  -3476,  -4346,
- -2995,   -346,    -46,  22143,   -576,   2597,    696,   1520,
-   140,   2937,  -3356,   -988,   4090,  -1246,  -3347,   1387,
-  2264,   1282,   7040,   -806, -12810,  -1105,  32767,  -4266,
-   108,  -1998,   -680,  -1279,   -467,   -110,    462,    768,
-  1678,   1408,  -1888,  -1115,   9430,   5852,  -3578,   5367,
- -1096,  -4310,  -9588,   4350,   6048,   2516,   3214,   4468,
-  -276,  15175,   -848,  -2875,   -314,  -6002, -11743,    448,
-  9238,  -3026,  -3934,   2840,  -2070,   1850,    444,    511,
-  -542,  -7382,   6002, -14447,  -1498,    176,    812,  -2632,
- -2291,  -3312,   3953,    370,  -2154,   1678,  -1186,  -6382,
-  1544,   3534,  -3767,  -7459,   7265,  -3272,  10669,  -1677,
- -7046,  -1679,   -132,   2108,  -1948,  -2938,  -5393,  -6222,
--11293,   2066,    981,   -731,   1869,  -2211,   3558, -21513,
-  -678,   -493,  -2087,    245,    635,  -2011,  -3316,  13445,
-  2089, -10186,   1114,  -1241,   2121,  -2305,   3316,  -1282,
-  2733,    318,   3534,   4844,  -1439,   8932,  -7649,   -556,
- -7519,  -3442,   5068,  -3546,   8586,  -8425,   7146,   -683,
-   665,   3052,  -2581,    248,  -8320,   2270,   7045,   -800,
-  5890,   2187,   -251,  -2552,  -3867,   3665,  -1643, -11757,
- -5542,   1806,   3669,   -508,  -3436,    600,  10412,  -5426,
-  1680,  -4545,  11536,  -1859,  -5446,  -4594,  -4300,  -1173,
-   282,   2100,  -2556,   9486,  -7325,  -7252,  -3155,   -775,
--13674,   4272,   3066,   9352,   1647,   1136,    794,   -520,
-  -654,   1539,  -2244,   3155, -12039,    731,   3379,  -1904,
-  6866,   9669,  -2384,   2099,  -2426,   1633,  -3358,  -5662,
-  2164,  10679,  -5330,   7066,   5826,   -187,  -4840,  -1174,
- -3694,    976,  -2548,   2292,  -3517,  -1007,  -4041,    684,
--14986,  -4789,  -4135,  -4376, -10678,  -1482, -10466,   3575,
- -1960,   3185,   1198,   -196,   -892,  -5424,   4802,  13608,
- -7772,   3952,   4404,    -52,   1097,   3182,  -2699,    900,
- -1258,  -8055,  -3102,    784,  -2574,   1556,   1060,  -5417,
-   537,  11991,   -650,   -487, -10250,   6766,  -3716,   1062,
-  2525,   1039,  -3002,   5742,   -502,  -4583,   -144,   -144,
- -5896,   -978,   1786,  -1420,   1944,   -130,  -5202,  -1578,
-  7821, -11675,   9980,   5065,   5942,   -362,  16344,   -801,
-  1932,   1242,    -10,    791,   -170,  -2468,   -479,   3297,
-  4328,  11473,  -1549, -12316,    209,   1739,   1875,   1305,
- -4310, -13049,  -4913,   9208,   -966,   2570,   -138,    890,
-  1373,  -1324,   -965,   8563,  -7560,    490,  -1392,   5695,
- -5656,   5431,   3974,  -1131,  -1246,  -1334,  -3859,  -3150,
--12976,  -6929,    665,   9393,    490,   2212,     18,    542,
-   229,  -3925,   1836,   4223,   5268,   1200,    471,     20,
- -9914,  -5774,   8362,   5929,  -7087,   2005,  15624,   1626,
-  5419,  -1492,  -1536,   -417,   1957,   2585,   -404,  -1125,
-  2296,    596,    836,   -356,    745,  -2810,   2879,  -2354,
--21682,   -108,    726,   -862,    593,    -42,    266,  -1356,
- -2119,  19613,    814,   2462,  -2940,    222,   3595,   5634,
-  -807,   1219,   2446,   5666,  -1839,   7092, -10581,  -5136,
- -2408,   5726,  -1116,  -2348,  -6318,   8991,   6750,  -5321,
- -7344,  -2194,  -5544,   1705,  12500,   9069,  -1966,  -4914,
-  2225,   3537,  -1485,  -5141,    434,  -1620,  -5383,   -710,
- -5443,   3930,   7082,    667,  -3289,  -3202,  -2097,   1970,
--11647,  -2927,  -2098,  -1345,   3449,  -2075,    262,   -756,
-  1829,   -271,  -1292,   1079,  -5746,   -344,   3660,  -4456,
-  3593,  -7652,  -1367,   -828,  -2290,   1063,   4234, -17596,
-  -911,  -6068,   1040,  -2956,   2704,   1763,    974,   3132,
-   697,   1267,    240,  -5520, -12368,  10830,   -633,  -5939,
-  2307,   1868,  -2216,  -1261,    597,  -6302,  -5145,   3550,
-  7519,  -6963,   3752,    876,  -1912,     30,  -9192,   1075,
- -4632,   9108,   1139,    911,   9290,   1268,  -1006,  -1718,
- -6668,   3294,  -1510,   6527,    456,  -1400,  11424,  -4168,
- -3940,   4738,  -4863,   2990,   3202,   -441,  -4744,   4623,
- -4351,   3997, -11016,   -737,    136,   7978,  -3801,   4170,
-  3602,  -2217,    849,  -2552, -22232,    323,    193,     -4,
- -1030,    590,   1625,   3208, -10595,   2624,   -741,  13121,
- -1044,   1601,   5175,   2199,  -3833,   1804,  -2314,    793,
--11486,   -655,  -3320,  -2975,   4065,  -3124,   -706,  -7264,
- -1038,  -3082,  -5503,  -7147,   8367,   1205,  -1092,  -1694,
- -1078,  11584,      8,  -1237,  -2077,   9732,   4963,   2780,
-   674,    581,   8226,  -1231,  -9252,    644,  -3284,   -744
-},
-
-.cb2232s1 = {
- 32767,    -45,    422,  -1139,  -1052,  -2085,   -695,   -612,
-  1451,   -288,     58,   -878,     53,   2912,  -1891,  -7148,
-  1893,   3028,    165,    963,   2260,  -7904,   5857, -18824,
- -2617,  -1030,   -872,   1500,   1118,   -745,    143,   -436,
-  1239,  -3840,   1785,  -2506,  20237,  -1026,  -1556,  -1371,
-  -660,  -1185,    939,   1315,  -3658,  -5428,    587,  -4105,
-  1596,  12612,   5781,   1172,  -3490,  -1182,   -333,   6258,
- -2594,   2144,  -4830,   -190,   1972,   2687,   1327,   -987,
--15046,   4659,    -71,   6890,   1588,  -4787,   4318,  -3704,
-   496,  -5601,   1954,  -1250,  -3389,  -5156,   9238,   2298,
- -4945,    183,  -2036,    114,  12250,  -2330,     71,  -3395,
- -1402,   3668,    531,  10915,   1162,   7738,   9089,  -1250,
-  1500,   6357,   1155,  -5094,  -2641,   1657,    470,   2022,
-   535,   -306, -18031,   -903,   2913,  -5486,   1769,  -1419,
-  9082,   2149,   3516,   6960,    833,   1123,   1266,   1672,
-  -690,   9634,  -2986,  -4675,   1006,  -2205,  -2919,  -3205,
- -2759,    107,   -931,  -9694,   2340,   -862,  -2782,  -3636,
- -9414,   9564,   1057,   8664,   1326,   3928,   1452,  -4692,
- -3437,   8610, -10466,  -6638,  -2879,   3408,    861,  -3057,
-  -823,    164,   3153,  -3698, -15693,   -886,   1456,   3278,
- -6160,    -57,   1110,     22,  -2985,   7299,  -1082,  -7921,
--12212,    480,  -7645,   -211,   1586,   3874,   3242,   -883,
-  6730,  -1597,   -506,   3744,   7552,  -7607,    -65,  -1442,
-   266,  10012,   1594,  -2628,   6988,  -1049,   -516,   -691,
-   672,   4913,   1788,  14973,    342,    962,   7212,   1124,
-   500,   1135,   -311,   3886,  12548,   5432,   6219,   3341,
-  -122,   5636,   6871, -10831,   4010, -10084,   1456,   5216,
- -1013,   1102,   4164,  -1490,  -5186,   -242,  -4498,   3322,
-  3584,  -2176,   5704,    515, -11556,   1446,   4303,  -3928,
- -4227,  -7268,   6069, -11330,    822,  -2054,  -3035,  -2516,
- -1816,  -3796,   8408,   8849,  -3030,  -8201,   1149,   7388,
-  1036,   2586,   5618,  -2274,  -5037,  -1497,    384,   1454,
-  8154,   1672,  -2409,   3347,  13258,   -979,    513,   7826,
-  2662,   1818,   5537,  -1104,   2645, -10632,  -8767,  -5667,
- -1029,    806,  -9040,  -4684,    792,  -5008,  -5807,  -3924,
-   964,    313,  -2521,   1106,  -5728,  13534,  -8078,   4216,
- -1388,  -2588,    986, -14536,  -1410,   3461,   1360,  -1348,
-  -104,   1493,  -2858,  -2860,   2045,  18330,   4814,  -3628,
-  -705,  -3228,   -660,  -2664,   2616,   4548,   3753,   1574,
- -1319,  -1110,    556,   3304,  -2803,  13052,   4592,   2922,
- 13667,  -2322,  -3056,  -2717,    174,  -4222,  -4296,  -7695,
-  1366,   1786,   1041,   -110,  -1997,   4102,  -1855,   -900,
-   203,   1311,   3412,   4107,  22609,  -4112,    427,  -2488,
-   257,  -1267,  -1277,  -6430,  -7193,  10667,   4495,  -4317,
-  6846,  13213,   7335,   -972,  -3137,    335,   -609,   3131,
-  2406,  -3762,   2151,  -5188,  -7675,   2068,  -2027,   3722,
-  -773,  -3276,   1539,  -7886,   1005,  13693,   4601,  -8386,
-  -508,   5662,  -4889,     93, -10603,   4051,     -2,   1094,
- -4897,  -2274,  -2377,   2228,  -5507,   -464,  -3455,   -227,
-  9433,   8093,  -2245,   3701,  -1047,  -6827,   2037,   1926,
- -3610, -15420,   -581,  -6127,  -2075,   2501,  -2216,   5385,
- -2297,  -2660,   1563,   3244,   1418,  -2012,   2964,  12235,
- -8595,   2728,  -3541,  -6511,  11038,  11326,   -183,  -1102,
-  1038,   1224,     20,   1441,   -349,   1240,  -7737,   -930,
-  1411,   6945,   4130, -13544,  -2625,   3550,   3149,   -730,
-  7658,   3098,    673,  -2259,   2556,   1543,   1478,   -951,
- -8128,   4951,  11919,   4588,  -8448,    784, -11498,  -1908,
-  2578,   2936,  -7496,  -5834,   1987,   3407,  -4133,  -4924,
- -1348,  -1300,    916,    899,  20257,   2027,   1450,   4388,
- -3748,   3846,   2187,  -1158,   4720,  -3613,   5312,   4055,
-   448,  -6383,  -8794,  -2232,   1920,    834,  27087,   -754,
-    90,   1410,   -985,  -1381,    -61,    650,   1080,   7035,
- -2772,  -1233,  13410,   4494,   -472,  -2896,  -5083,  -2217,
- -5778,    437,  -6853,   4996,   3442,   6092,  -6497,  -3871,
-  4024,   -898,    -73,  -3067,  -2793,   5640,   6076,  -2454,
-  3598,   -277,   1672,  -6858,   2419,   9753,   6292,   8835,
- -9909,  -4724,   -618,   7266,   -416,   1965,  -4968,   2421,
-  1155,   3815,   -116,  -3725,   7872,  -4901,   2383,   1612,
- -2186,  -2302,   2791,  -2226,   1144, -13379,  -6602,   -806,
-  7099,  -2098,   4194,  -2128,   8663,  -4275,    452,   -135,
- -6053,   1280,  12815,   3278,   8452,   4479,  -1648,   1453,
-  1407,   -966,  -1016,   3173,  -7333,  -4552, -13176,  -1744,
-   577,  -1572,    611,   1202,   -146,  -5773,   3012,  -3016,
- -1581,   3162,   3818,  -1970,   6195,   1946,  -9656,   2861,
- -7875,   3133,  -7840,  10951,  -1684,   -306,   -227,   9776,
-   -82,   1736,   1180,   3457,  -2874,   5365,  -7428,   7604,
-  2623,  -2998,  -2270,  10410,   1252,  -2725,  -4433,   1758,
- -5225,   6522,   6698,    712,   4694,  -2392,    240,    423,
- -3030, -12708,  -3136,  -5176,    480,  -1624, -12900,   7537,
-  4371,   1186,  -1828,   -757,  -1850,   -974,  -3755,   1415,
- -6302,   2642,  -3823,  -1570,  -8090,   8251,   1945,  -9213,
-  1147,   4128,  -4301,    806,  -1745,    704,  -2496,   1375,
-  -802,      9,   -808,   -252,  -5453,   3857,  10353,   -536,
-  1875,  -2896, -10792,   3358,   1063,   -890,   7200,   3660,
-   406,   2840,  -6973,  -4469,   4638,  -8091,   2772,  -8035,
-  1728,  -5315,   7234,  -2718,   3707,  -1226, -11858,  -2397,
-   772,   3285,  -4089,  -1400,   1113, -16680,   1885,   -435,
-  -959,    242,   -817,    259,  -2010,  -1857,   -557,   -914
-},
-
-.cb2232m0 = {
--13394,  14382,   -488,  -1088,   -817,    100,    305,   2267,
-  2527,  -1584,    995,  -5781,  -3585,  -1826,    803,  -4108,
- -3137,  12111,   -211,    838,   4879,  -1964,  -1728,  13830,
-  2084, -11535,    664,  -2499,  -3421,   -703,   4528,    968,
-  1008, -12010,    984,   2658,    422,   1412,  10772,   2216,
- -4291,   1329,  -2324,   2392,  -2029,  12322,   1053,    169,
- 12635,   -902,    -62,   -670,  -3007,  -3322,  -2948,   1817,
--10688,  -1264,   1949,   2734,   1072,  -1429,   2085,  10312,
- -1685,  -4433,  -1287,  -9620,  -1132,     20,    614,   2470,
-  2821,   5934,   3526,  11292,     50, -12970, -11948,   1114,
-  1980,   -945,   -713,  -5357,   3766,   -447,    969,   2247,
- 11854,   2148, -12393,   1518,    610,   4527,   1164,   1347,
- -1422,    649,    653,    855,    -24,  30152,     20,   -564,
- -2825,    -11,  -1408,    -80,    239,    305,  -3163,   -854,
-   568,    -18,  -4212,   -403,    288,  -3009,    229,  -1152,
- 16390,   -877,   -458,    316,   -128, -12165,   1088,   -828,
--10886,   -269,    747,  -1026,   1716, -10920,  -9204,  -3123,
-   958,  -6128,   -260,   -851,  -1524,  -2386,  -6472,    228,
-  2667,   3158,   -140,   1719,   2330,  -2730,   3080,     44,
- 15743,  -2167, -11637,   -607,    476,    408, -12505,  -1862,
- -1892,   -440,  -3785,  -2348,   1229,   -338,   -438,   -797,
- 29933,   -715,    366,   -197,    576,   -188,    484,    240,
- -4844,   1168,  -1054,    863,    875,   -295, -16091,  -1972,
-  3976,   3833,   3056,   -770,   1011,  -3098,    165,   3973,
- -9367,    -18,   -299, -11254,   1005,   8644, -14788,  -2268,
-  2644,  -8410,    578,   2169,   -766,   2764,   2378,   3282,
- -2710,   7612,   -542, -12062,  -2437,   -414,   -506, -10332,
-  2732,    839,  -2593,    923,   1159,  -1057,  -7333,    -86,
-  2832,  11328,  -1616,   -302,   4399,   -547,   6107,   9983,
- -6901,    -85,   -544,  -4916,    366,   4878,  -8662,   7313,
- -3056,  -1027,   2381,   8906,  -7270,    509,  -1124,  -2512,
- -1636,   5830,  -5868,   2369,  -3236,  12557,  -2713,  12793,
- -2957,   1688,   -852,   4723,   -122,  -2336,  -4698,  -1306,
- -7399,  -2090,  -1953,  -1505,   3335, -10906,  -2598,   1322,
-  2556,   7210,  -1553,   1262,   1878, -10719,   1746,  -2736,
-  1448,   8734,  -9602,    828,   1752,  -1632,   8037,   2728,
-   562,  -1879, -10572,   -544,  -2254,  -1997,  -6384,    -87,
- -5878,   -473,    498,  -2960,  -5698, -11500,   1815,   2050,
-  7388,   5230,   2782,   5602,    514,   -306,  13022,    523,
--10776,   -846,    716,    270,   3350,  -6021,   1420,  -6175,
- -1978,   3967,  11612,   3320,  -4100,  -2468,   4595,  -5338,
-    65,   3478,     19,   3501, -15896,  -1335,  -1861,  -1944,
-  3935,   3630,   4627,  -5892,   -458,    383,   -211,   -594,
-  -165,  24865,   -656,   2300,   -404,    257,    214,   -643,
-  2298,   -180,     35,   4974,    834,   -998,  -1738,   5449,
- -9222, -10858,   4188,   9147,  -5639,  -1691,    990,  -1945,
-  3421,  -3527,   9005,  -2038,  -2369,   5098,    967,  15840,
-   196,  -3204,  -1079,   -776,  11806,  -1352,  -2053,   2011,
-   309,    642,   1541,  -1466,  -4465,   6679,   5756,   7474,
-   -58,  -1864,   5908,  -1576, -30374,   -904,   -571,  -1136,
-   425,    -22,    666,   1150,   -734,     82,   1254,   -226,
-  -437,   -890,   1464,  -3368,    987, -11885,   1127,  -7224,
-  1872,  -8198,   8775,  -2695,   1457,  15102,   -899,  -1384,
- -1975,   1891,   3128,   1465,  -1649,  -1363,   1483,    303,
-  -534,     -7,  -1710,  -1377,    769,  12698,  -8987,   -802,
-  4636,    572,   2004,  -3513,    442,  -9863,   3215,  -4550,
-  2138,  -4346,   5682,  11053,   7220,   9842,    797,  -1399,
- -2679,  -5857,  -2143,   3241,   2330,    248,   -630,   1044,
-   639,  -3432,    125,  22083,   1976,  -1003,    813,    552,
-  -571,   4358,  -6200,   3635,   5439,   -636,    233,  -4856,
- -3519,   -460,   6956,  -4215,   1537,   7895,  13910,  -7637,
-  1392,   1572,    648,   3690,  -1988,  -2463,  -3302,    677,
-  -924,   -535,  -6025,   4126,   7178,  -4145,   4960,  -1860,
--10926,  -1470,  -9506,   -226,   -258,     32,   -479,   2222,
-    94,  11358,   3984,  -2732,   2111,   -590,  -2444,   -344,
-  -425,    598,  -1382,  -1213, -17632,   1566,   1387,  -3521,
-   -57,  -1829,   4788,    574,   -206,   7962,   9157,   6459,
- -1594,  -1355,   4874,   1066,   2006,   1793,  -7569,   2369,
-  1108,   1305,  -3046, -14052,  -1736,  -4045,  -4328,   7497,
-  3304,   1518,  -5666,   -529,   4256,   4667,    932,  -1495,
--10414,   -414,  -2110,  -3150,  -1250,  -8799,   -419,   5162,
-  8497,  -8720,   -746,  -3015,   6403,   3855,   7350,    165,
-   -59,   -958,   5780,   6044,   1736,   3016,     31,   1012,
-  3422,   7598,  -6837,  -2092,   2262,   6171, -10362,  -2108,
- -1352,   1798,  -4872,  -6369,   2507,   2640,   6074,   1835,
-  2948,    388,    398,  -9295,  -5384,  -2088,   2096,    742,
-  3286,    441,   7135,  -2112,  -9958,  -5612,   2479,   5427,
--10114,   -674,    308,  -1037,    770,    514,   1868,   -252,
--11901,   -984,    670,   2506,   5396,  -1047,   9113, -10865,
-  4872,   1720,   2226,    947,  -2336,   2649,    173,  -1464,
- -2874,   4463,  -1270,   3429,   6242,  -5380,  -7772,  -4550,
- -8451,   2045,  -2855,   5336, -15066,   -418,  -4886,   -648,
-  3736,    945,   -956,  -4825,   -116,    130,   1889,   9642,
-  3790,  -4371,   7180,  -1556,   6562,  -2207,  -7910,    506,
--21594,    662,   -338,   -943,  -1022,   6453,    301,   -464,
-  -457,    840,   3313,  10946,   -294,   8156,    138,  -1425,
-  2397,   -792,   6468,   4615,   -511,  15938,    494,    274,
- -5976,   -660,   3894,  -2140,   1424,   2003,   4101,   2823
-},
-
-.cb2232m1 = {
- 20456,  -1952,  -1581,    869,    628,     76,   1404,   4060,
-   508,  -3177,   -946,  -2992,   2422,   1139,  -1931,   -240,
-  1011,    365,  -1106,  20973,  -1438,    372,    137,  -1058,
-  1171,  -1252,   2794,   1434,   1814,    482,   3948,  -2704,
- 20422,   -241,    441,  -1121,    499,   1036,   -918,   9708,
- -3166,   -488, -10379,  -3201,  -5254,  -1871,   5665, -12622,
- -7591,    127,   1469,  -2267,   1813,  -4197,   2065,   -602,
-  -395,   -652,    333, -19114,  -1092,   4310,   1590,   1688,
- -1453,    177,   4402,   1168,   5972,  -1295,  -3258,   1542,
- -4832,   3377,  -5545,  -3622,  -4944,   2064,  -2846,   8118,
-  -845,  -6778,  -3640,   5729,   -907, -11007,     -5,   2634,
--11118,   2108,    144,  13299,    251,    336,    563,    -75,
-  3004,    169,  -3892,   1477,   1066,  -1571,  -1113,  -1088,
-   517,    465, -21841,  -1541,  -1094,   1841,  -9213, -17478,
-  1662,      8,   1192,   1174,   1014,  -5659,   -695,    316,
- -5161,   1803,  -1056,  -2369,  -2919,   2941,  -9712,   1975,
-   426,  11214,   2288,   6186,  -7348,  -3062,   3341,   3252,
- -4102,   -346,   -876,  -7088,  -3330,   4507,    310,  -1632,
-   299,  -2636,  -2740,   -752,  10159,  -7201,  -9568,   3134,
- -4002,    -41,   2479,  -1816, -14099,   3575,   1161,   6427,
- -2466,    390,  -1883,  -6265,  -1266,   -263,   1474,   -592,
--21234,     94,   4187,      1,   3227,  -3273,   1950,    406,
-   543,   1661,  -2648,  -9252,  -2048,  -5987,   -722,   4932,
- -4410,  12504,  -1572,   2244,   5610,    307,  -9710,  -3642,
- -6436,   4368,   2956,  -2269,  -6196,   4069,   -766,  -3695,
-  3416,  -5786,  -9668,  11677,   1208,   -965,   1516,   1132,
-  1018,  -6168,   1970, -10357,   1379,   -725,  -8789,   3730,
-   -65,  -4758,  -1818,  -1050,   9641,   4519,   2886,   2667,
-  6348,   2436,   -438,   1978,  -9374,  -1286,   3893,  -2073,
--11199,  -2081,   3345,  -3444,  -9480,   2410,   1986,  -1869,
-  3252,   5949,  -2119,   -401,   -214,   3416,  -1067,  18510,
- -2986,   3510,    508,   -357,   -837,  -1205,   2884,  11587,
- 11565,   -555,  -2664,   -873,   3642,  -2068,   1734,  -4408,
-   330,   -181,  -1358,   1407,  -9739,    809, -10203,  -2066,
-  3440,  -2063,   3238,   3734,   1671,    750,   6890,   4068,
-  1238,    493,  -1330,     76,   8918,  10855,     85,  12236,
-  3570,  -1074,   3008,  -9424,  -3186,   1271,   -380,   -157,
- -4974,  10575,  -1378,   -219,   1354,  -1589,  10936,   2268,
- -3787,  -1040,   7567,    924,  10490,   -806,  -1318,  -1576,
-  -209,     93,  -3745,  -3820,    439,  -9828,  -6265,   -864,
- 31342,     35,   1332,    443,   -590,    846,    104,    868,
-  -863,   1526,  -1088,  11494,  -7055,   3564,    109,  -3072,
- -2234,  -4530,   1866,  -3425,   9940,   3158,  -1821,   -680,
- -1124,   2884,   1191,    -61,  -9698,   7596,   -558,  -9019,
- -1181,    208,  -1342,    -68,   -312,    294,  -1468,   1410,
-    39, -21081,    724,  -2137,    935,     -8, -10297,   3509,
- -6510,  -6558,  -6906,  -1905,   1915,   5920,  -8983,   3416,
-  7300,  -1372,  -1422,   1822, -10433,  -2530,   1669,    554,
- -3008,  -3351,   -922,   8279,  -5184,   5520,   4785,    683,
-  -506,  -4558,   1938,   8442, -12639,    -54,  -2907,   -820,
- 10004,   1780,    485,   1401,  -3786,    786,  -5937,   2632,
- -1540,    972,  -3342,   2294,   8076,  -1006,  11731,  -1825,
-  3036,   1085,   1160,  -9680,  11111,   7838,  -2504,  -2112,
-  2376,   2534,   3624,    555,   3610,   -520,   -831,    -15,
-  -498,    167,    711, -22685,   -999,  -1466,  -1643,   -394,
-  5404,  -4247,  -2307,   4052,  -1156,  -1240,   -490,  -1598,
- -4365,  -8382,  10493,    464, -16592,   3723,  -7709,   -821,
- -4218,   -922,    398,   5635,   2184,   5090,  -7144,   2420,
-   792,   -324,  -1278,   3172,  13101,   1608,  -3996,  -2219,
-  2995,  -6924,    816,  -2482,   -406,   3458,    503,  -8154,
-  3460,   2542,  -3703,   8524,    -61,   -430,  23212,   1203,
-  2335,   5556,   -476,    923,   -565,    593,  -1611,   1814,
- -1614,  -7067,  -1957,  10166,  -4306,   -421,  -4026,   1854,
- -9881,    667,   7720,  -2906,   7003,  -1823,   6344,  -8614,
- -2965,  -2720,    -62,   -802,   1945,   4574,  -4604,  -8341,
-   518,  -3543,     95,  -4262,  -5220,   -133,  10270,   1999,
-  3234,   8900,  -4866,  -3708,  -4465,   4542,   2545,   1770,
-  6995,   3559,   1133,  -1152,  14680,   1002,    634, -12913,
-  1686,  -1645,  -1796,    -50,    112,  -1108,   1070,    686,
-  1068,   1555,    896,   3498,  10458,    -32,  12017,   -737,
-   650,   -432,    404,    170,  10873,   1864,  -1718,  11061,
- -1556,  -3766,    225,   6999,   1730,  -6919,  -1895,  -2919,
-  8250,  10050,  -4631,  -1488,  -4801,  -1504,  -2736,   -110,
- -3630,  -2752, -11162,   1128,  -2580,  11692,   -678,   1338,
-  2175,  -6030,    616,   1651,  -7034,  -3057,   2420,   1998,
-  4383,  -1721, -10762,   -428,   2902,   -906,  -4298,   2141,
- -1242,   5464,   -607,   5389,  -8946,  -3890,  10884,   1544,
-   628,  -1969,  13902,  -1570,  -1080,   -689,  -4676,  -3642,
-   753, -11351,   -110,   -744,   4286,   1163,   3105,   9752,
- 11143,   4296,  -1698,   1012,   2284,   -989,   -958,  -9481,
-   738,     24,    426,   1638,   3898,   8885,   2938,  -8826,
-  2982,  -1679,   8466,   -651,   5144,   2736,    751,    -84,
-  7710,   3077,   2885,    146,  -1102,  -2569,  -2039,  11059,
- -9950,  -1048,  -1031,    -33,  -5118,  -1096,  -1986,   2306,
-  2400,   9320,   6188,    500,   2090,     61, -11357,    118,
-  1505,   1032,  -1920,   -164,  -9744,  -4670, -11029,   -102,
-  -960,  -1023,  -2570,   4102,  -3989, -11478,    772,  -1515,
- -1102,  -2194,   1722,  -1195,  -8144,    746,  -9534,   3250
-},
-
-.cb4440l0 = {
--14497,  -1982,    631,   -984,  -2115,  -3252,   2755,   2017,
- -2110,  -8864,   -792,  -1291,  -2761,  -2365,    698,   1047,
-   972, -14703,  10590,  -3945,    663,    972,   1204,  -2801,
-  1295,  -1296,     50,   1448,    888,  -1879,    122,     78,
-  -183,   -588,  16202,   -388,  -2240,   1136,   1266,  -6445,
-  2619,  -1664,  -6329,  -2700,   1557,   -497,    598,   -110,
-  1298,   -334,    191,  29897,    387,    419,     76,    152,
-   533,     78,    112,    101,    158,    136,   -236,     88,
-    43,    107,     84,     21,  -6385,  -1711,   1757,   1411,
-  9152,    -72,   1428,  -1098,  10328,   -506,   -360,    285,
-   -36,  -2816,    819,     88,    176,   -481,   -172,   2067,
-  3268,   5479,   8605,  11272,  -1880,    361,   1582,  -4973,
- -1379,   3835,     74,     -3,    493,   -431,   1390,    101,
-  -550,     59,    476,   -469,   -583,    568,    732,  -1015,
- -1104,   -698,  23922,   1130,  -1268,    280,    204,    -59,
- -9789,   -317,    935,   2944, -10402,  -2564,  -4648,   1506,
-  3834,  -1002,   2805,   -158,   -409,    814,   -150,    -97,
- -3573,  -1550,   1356,   5350,   -365,  -2622,  -3454,    310,
-  1194,    911, -10928,    937,   7980,  -5286,   -554,   1999,
- -1263,   -562,     10,   -321,    744,     44,     64,   -274,
--30136,    340,  -1051,    756,    -30,     -6,   -269,   -273,
-    12,     95,   1565, -13194, -11810,   -485,  -1574,    414,
-  -240,   -452,    564,    740,   -476,    959,   1079,  -1568,
-  -422,     37,   -154,  10117,    -68,   1412,  11862,  -3420,
-  4169,   5178,    527,  -1027,  -1030,  -1985,    448,   -716,
-  1696,   1942,   -254,    308,   1100,   -790,   8102,   6630,
-  3653,  -1018,   -587,  -6990,    -19,   1671,   1425,   8089,
-  3708,  -1182,    774,    659,    113,    437,     50,    835,
-  -532, -11209,   1682,  -7490,  -2592,   1234,  -4689,  -7301,
-  -143,   3361,   1121,    177,   -473,    513,    136,    965,
- -4020,   4639,  -1212,   1271,   2905,  -6865,  10499,  -3800,
- -3354,  -5029,  -3606,   -950,   4490,    526,   1006,      2,
-  1760,   5819,    -55,  -1098,  -1843,    348,  -2062,  -9196,
-  3712, -11466,  -3218,   -858,   2720,    589,    320,    861,
-    59,   5357,    564,   -380,    538,   -142,    490,    212,
-  1716,    670,   1904,   -181,   2979,    943,  16916,   1271,
-   988,   -802,  -1490,   9154,    643,   1725,   1347,  -2827,
- -4096,    485,  -7091,  -3180,  -4747,  -1604,   1576,  -5724,
-  6104,   -139,   1726,  11715,    360,   7519,   2513,   5192,
- -2208,  -1993,    829,   -387,  -5724,   4418,    116,  -2955,
-  -226,    249,    377,   2149,  -2929,   5021,  -3064,    800,
- -1459,  11384,   8556,   1740,    368,  -2839,  -2049,   1438,
- -1357,   4084,   1896,   -528,   1621,  -1760,  13741,    302,
- -1018,  -9774,  -3521,   1302,   1374,   1139,    918,  -1724,
-  -764,    858,    804,  -1772,    372,   -322,   -526,  11924,
--11944,   4012,   1749,   1737,  -1545,     68,    889,    280,
-   690,  -2200,   1068,   -484,   -171,    455,    -44,  -3178,
-  2243,   -590,    749,   -792, -19876,    198,    236,   2695,
- -3413,    652,    284,   -820,  -1134,   -199,   -112,  -5650,
-  -418,   1047,   1090,   2260,  -3297,  -2164,  13524,   1720,
-  -326,    910,  -1706,   3912,  -1175,   1687,  -2152,     50,
-    35,   1718,    721,   9316,  -2256,  -4330,   6961,   4432,
- -8043,     45,   1370,   3472,   2892,  -3224,   1368,   1355,
-  -562,   -694,    746,    198,   1188,   2819,   3131,  -2371,
-  6438,    847,   2111, -10187,  -3451,  -9826,  -3502,    655,
-   649,   1460,    270,    118,     45,    192,    188,  -1139,
-  -258,    663,    -84, -27519,   -765,   -905,    357,     -4,
-    89,   -372,    -24,    178,   1127,    209,   1177,  -2762,
-  -587,   1488,   8989,   3217,  -2550,    215,   9540,  -7196,
-  1259,  -3716,   2767,   -261,   -216,    872,  -3008,  -2076,
-  8682,    709,   3629,     87,  -3114, -10624,    246,  -1670,
- -1738,   1229,   7624,  -1120,    784,    305,    233,   -185,
-   280,  -1466,   -268,    198,    499,    308,  -2187,  -1149,
-  -388,    -38,   -338,  -1084, -19424,     40,   1958,  -2240,
-   -86,    264,  -9876,  -1287,   4086,   3742,   2502, -10078,
-  4574,  -1493,   1078,   3218,   2410,   -364,   1049,   2638,
-    35,  -1295,    200,  -2847,  10818, -12064,   2375,    348,
-  -353,   2788,   -821,  -3196,   -511,    146,   2015,    235,
- -1094,   2622,   2688,    -79,   5176,   -884, -11814,    794,
-  2696,  -6704,   3452,   1295,   3872,   2924,   4498,   -166,
-  -598,  -1213,    891,   5478,   -266,   -777,     -5,   -776,
-  1003,  -1837,   -156,  17910,    453,   -297,  -1545,    857,
-  -288,   -308,  -6373,   2045,  -1846,   3007,  -2236,  -1904,
-   815,  -2889,   4200,   8320,   9872,   -614,   -834,   3856,
-   414,   -234,   1559,  -7451,   3641,  -1230,    837,   -127,
-  2652,    411,   -532, -12548,  -1692,   1034,  -2418,   -968,
-   558,  -1564,  -1952,    307,  -1064,  -6776,   1588,  -2636,
-   949,   8272,    -12,  -3468,   3481,   6588,   2580,   7393,
-   272,   1528,   1818,  -2206,   -349,   -396, -11704,   1487,
-  9753,  -4665,    -24,   2084,   -780,   5036,   -647,   3668,
-   561,   1099,  -1094,    534,   1270,    -99,   1006,   -476,
-  -528,  12481,   1589,   1593,  -1682,   7022,   2664,   8702,
-  -563,   1082,   -206,     87,  -1978,   -144,    228,   1232,
-   889,  14340,     65,  -1061,  10510,    -95,    649,     53,
-  -962,   -383,   2479,   1322,  -1798,   2840,   -492,   -419,
-    90,   -680,     79,   1026, -20912,   1593,   -742,   1086,
-   516,    699,   2393,    -64,  -2010,     46,   -859,    111,
-  -440,  14281,    272,    797, -10141,  -3734,   3126,  -3050,
-  1300,     73,  -1754,  -1278,   1890,  -2710,    704,   1160,
-     1,    269,    -24,   -622,    124,    138,   -522,   -510,
-    95,   -402, -27306,   -470,   -214,   -159,    396,   -201,
-  -372,    122,    136,  -1005,    744,   1949,   -810,  -2648,
-  -726,   -384,    955,   1232,   1354,   -345, -19485,   1056,
-  -193,   1257,   -263,    398,   -752,    602,     98,    793,
-    17,  20186,   -189,  -2615,   -174,    166,    436,    411,
- -1046,    374,   -471,   -253,    233,   8352,   1342,  -1279,
-  9305,   2190,  -3239,  -5262,  -3454,   1844,    684,    303,
- -4434,  -6041,  -3495,  -2482,    389,    353,    159,    -14,
--29179,   -511,   -158,     92,   -401,    -36,   -297,    447,
-  -605,    269,     85,    212,      8,   -118,   -130,    207,
- 13150,  -8712,   2504,   1355,  -3268,   1396,  -4748,  -2200,
- -1560,    228,   -162,   1179,   3024,    742,   -860,     69,
-    10,  30006,   -538,   -489,   -125,   -214,    364,   -682,
-  -283,    532,   -134,    227,   -448,    -20,   -266,     70,
-     2,   9310,  14858,    856,   -493,  -3357,     36,   -248,
-   214,    281,    -73,   3268,    745,   -245,  -1007,    146,
-   392,     36,   8042,   2953,  -6603,  -7697,   4425,  -2498,
-   571,  -2194,   3388,   -794,   -561,  -2763,   1912,  -3030,
-   225,    214,    -27,    834, -10661,    437,   -506,   -535,
-  8397,   1332,  -2406,  -8868,  -2972,   1385,    296,    865,
-  2318,    890,    244,   -121,    226,    375,    896, -10381,
- -2266,  -3404,    983,   1255,    259,  11427,    455,  -3041,
-   307,  -2446,    476,    723,     18, -10224,    510,    552,
-  -654,   -876,   -465,    628, -12572,    786,   -393,  -4162,
-   938,  -1327,  -1695,   -608,  -1352,   -131,   -880,    830,
-  1016,  21875,   -408,  -1560,   -500,  -1682,    453,   -930,
-  1316,   -136,    434,   -683,    412,    202,    233,    382,
- -2002,  -9267,  -1034,   8710,    434,  -8121,   3035,  -3121,
-  1792,   2712,  -1537,  -1082,    854,   1337,  -1084,     91,
- -4485,   2545,  -4412,  -1930, -12234,  -4802,   4641,    437,
-  -928,   2163,  -3154,    521,   -665,  -1200,   2654,    931,
-  -388,   -118,  -1144,    133,   5089,  -1194,  -1528,   -967,
-  -795,    188,   1918,    897,  -7046,  -7617,   7118,   5755,
- -2724,  -7894,   -472,   -360,   -591,    990,  -3032,   7742,
-   726,   5490,   9383,    479,  -3032,  -1904,   7158,   4706,
-  2442,  -1576,    -58,   -156,  -3977,  -2696,   4195,   -166,
-  3342,  -1566,   3767,  -4159,  -5750,   5505,  -7663,   4516,
- -4073,  -2612,   5136,   -290,   -666,   1282,    776,   -566,
-  -602,   -310,   1003,   -648,   2928,  -3159,    427,  -1168,
- -2702, -16990,   -205,   -343,  -1196,  -1980,   1653,   -512,
- -1820,   -418,  -3368,   3522,  -1966,   4964,  -5728,  -5185,
-  -210,  -1721,  10131,  -7060,   3351,    334,    -96,  -3193,
- -1713,   -614,  -2633,    147,  -1552,  -2363,  -3724,  -1731,
- -7350,   5453,  -2732,  -2867,  12458,    416,      0,   4414,
-   833,    590,   1617,    405,     73,    868,    232,    195,
-    15,   -196,   -782,    749,   -955,    -84,   1176,   -553
-},
-
-.cb4440l1 = {
--12227,  -3413,  12848,  -1336,     20,    894,    254,  -1001,
- -1381,   -406,  -1157,   -458,    300,   -395,    825,    -34,
-    74,    382,  -1018, -10266,   1338,  11091,    544,    797,
- -4304,   1389,   -747,   1924,   -257,   2615,    -37,  -4375,
-   782,    158,   -378,     19,    652,   -539,   1012,  -4211,
-  1263,   -925,     96,  -9226,   5921,  -8209,    -71,  -1838,
- -2201,  -7441,    -60,    393,  -5626,   -264,  -1002,     85,
-  1989,  -1616,   -216,   -914,   9907,   8044,   -578,  -7830,
- -1705,  -3624,   2430,     59,   5813,    870,   -317,  -2545,
- -4020,  -1330,   1215,   9352,   5425,    324,  -4803,   -681,
-  -506,  -4710,  -6574,  -4184,     65,    729,  -1310,  -1387,
-  1385,   2364,   1672,   2493,   -438,  -1367,   -907,     38,
--20220,  -1644,    512,   -413,    348,   -112,   -532,    785,
-  1332,   7140,  -1916,  -1766, -11570,   1811,  -9167,    -76,
- -1531,   -175,  -1739,   -771,   2014,    519,     15,    576,
-  8736,   -979,    -28,   1830,    329,   -302,  12206,  -1501,
-  5195,   -305,   1456,   -581,   1488,    142,    235,   -157,
-   192,   1540,   -922,  11056,  11823,  -2964,  -1488,   1712,
- -2018,   -880,  -3282,   -190,   -198,   2436,   -248,    222,
-    22,    863,   1504,   2078,  -2047,    216,  -1270,   -732,
--18252,   1186,   3178,   -730,    432,    934,   1617,    873,
-  -491,    -70,   -768,    679,   1398,    537,   -364,    172,
-  -541,    -94,    -24,   -129, -26725,    201,   -554,   -357,
-   -71,     60,     96,  -1665,   1425,   1244,    332,  -1068,
-   326,    834,   -620,  -1473,   1585,   1432,    928,  18782,
- -1388,   2897,    448,     40,   1323,   1433,    787,    215,
-  3297,   2586,   -856,    451, -17700,    735,    -43,    405,
- -1252,    744,   1012,    677,    312,    206,   -279,   -432,
-  6677,    -87,    -72, -10400,   -106,  11224,   1152,   -422,
-  2024,    704,   2462,  -1197,    232,   -119,      4,   -879,
-  1600,   -708,   3496,    279,   -143,  -1096,   -555,   4594,
-  1486,    161,    942,   2018,   2474, -16010,   -380,   -193,
--11415,    457,   -276, -11220,  -1604,    -38,    813,  -4044,
-  1888,  -4265,   1647,   -882,    981,   -734,   -110,    140,
- -3050,   1248,   -549,  -1167,   -967,   3586,    688,  -1380,
-   424, -17959,   2022,   2274,    -44,  -1406,   -432,   1335,
-  -659,   9555,  -3581,  11045,   1870,    806,    599,  -2065,
-   156,  -4420,     16,   2349,   -609,  -3058,   -738,    -60,
-  -548,   -119,    -49,     26,   1528,  -1842,   6306,  14078,
-  -692,   5480,    321,   1996,   1376,  -3086,    490,    -54,
-  1151,    932,    445,  -9887,  15808,   3085,    866,  -2020,
- -1785,   2126,   -920,    414,   -290,    138,    244,    994,
-  -702,   1410,    330,    202,    675,   -389,   -241,  31306,
-   380,    300,    -53,    804,   -109,    413,    -44,      6,
-    14,    486,   -293,   -112,     26,  11632,   -836,  -3948,
-  -518,  -1364,  11360,   3558,   -588,  -2084,    490,    381,
-  -955,   2207,  -2953,   1115,   -265,      2,     65,    464,
-  -180,   -111,   -174,   -152, -30508,    121,   -207,   -835,
-  1126,   -185,     91,    -96,    222,    -99,    -93, -10138,
-  -430,   -184,   -372,   -194,    953,   -100,    382,  -1422,
- 13931,  -1835,  -1657,    821,    408,    808,   -601,   -463,
-  7142,   5596,   3171,   2174,   2740, -11350,   1019,   1449,
-  -386,   1642,   3703,   4271,   1664,   2232,   -674,    983,
-   551,   8543,    154,   -383,  -2419,   1117,   -520, -10966,
- -4406,  -3742,    -79,   -909,   1813,   5043,    412,   1099,
-  1434,    173,    788,    -92,  -1004,   1288,    -87,    931,
- 10241,   -855,      6,   -405,   2580,  11455,   1150,  -1916,
-  3614,   -262,    292,    897,   9673,   -381,   1711,  -2713,
- -1111,    282,  -2180,  -2282,  -2266,   -724,   -849, -11787,
-   888,   3120,  -1459,    495, -10812,   -792,   -274,   -984,
--12223,   -737,  -2394,   -299,   -578,  -2758,   1521,    774,
-  1938,    857,  -1935,    217,    654,   1452,  -3695,   6734,
-   804,    134,    946,  -2156,   9495,   -600,  -1962,  -5252,
-  -246,   1269,   8492,   1261,  -2205,   -106,  -1314,    828,
-  1013, -12059,    663,    436,  -2648,   9863,   -630,  -2961,
-  3004,   1015,  -3153,  -1475,    -25,    399,   -846,    430,
- -1237,   -156,   -187,   1115,   -502,   -363,    386,  -2820,
-   942,   -926,    727,   1130, -20388,   -274,   1140,    198,
-   199,   2548,    442,    157,  -1546,   3693,    892,    460,
-  6552,   4858,  -2560,  -8673,   1930,  -8913,   3427,    686,
-    61,  -8830,   -358,   1338,    -74,   1180,   2871,  -3822,
-   104,   2414,  -1742,  11425,  -4522,    393,  -3016,    972,
-    34,    117, -16113,  -6900,  -6964,   1726,   -843,   -242,
- -2141,    803,  -1093,    442,   1776,   2429,  -1000,    489,
-   393,    635,    389,   1126,  12285,  -1648, -11396,  -2885,
-   -56,   3840,   -174,   3177,  -1708,   1189,   1914,   1514,
-  -189,    -88,    276,   -240,   -120,  -2929,   9823,    678,
-   568,     26,  10080,  -2575,   -806,    -64,   6406,    -82,
- -1171,   2169,  -1804,   -667,    -37,     54,   4208,  10829,
- 11920,   -468,   1916,   -809,   -370,    144,   3616,   -263,
- -4352,   -124,    300,   -246,   -440,   -115,    447,   -407,
- 20869,   -340,     54,   -764,   -807,   -699,   -283,    727,
-  -922,   1098,    577,     -6,   -809,    -50,   -115,    -75,
-   280,    156,    182,    225, -30432,   -212,   -417,   -245,
-   177,     94,      4,   -627,    167,     47,    152,    148,
-  1325,  -2436, -10063,   -696,  -9966,   1032,  -1024,  -3702,
-  3933,    400,    333,    692,  -3858,   2599,  -1215,   -389,
-   393,   -666,   2135,  10280,  -2443,   1972,    410,   -392,
-   590,  12322,   -523,   1141,     52,  -1468,    819,   -213,
-   162,    116,   -614, -10630,   -204,  -1247,    535,    199,
- -6058,   2538,   1644, -11539,  -1562,   1462,  -1493,   -218,
-  -296,   -605,    321,    607,   -366,   -257,   -837,   4536,
--11683,   1266,  -3805,   4496,   2854,      8,  -8848,    124,
-   656,  -1041,    411,    144,    916,    445,    -91,   -260,
-  -149,   -882,   -433,   -121,    345,     68,    349,    821,
-   652,    251, -23053,   1015,    712,    -73,   7038,  -1520,
-  5810, -12604,   2841,    425,    265,   1546,    938,   1851,
- -1180,   2751,   -498,   1289,   -774,    327,   4047,  -8132,
- -2622,   5449,   3221,  -2990,  10107,   1880,    173,  -4006,
-   399,   -332,    642,    297,  -4513,  -1230,   -330,   -788,
--21881,    903,  -1308,    547,   -522,   1885,  -1730,    -63,
-   973,    897,    670,   -657,   -232,    498,     92,     -8,
--11010,   1072,   -368,  -1864,  11505,   3497,    730,   2158,
- -1629,  -1351,  -1583,   2247,  -1506,   2144,   -902,    639,
-   175,  -6006,   -986,  -4246,  -1510,   1785,  -9792,   -495,
-  1995,  -9189,  -1414,  -2550,   1578,   2390,  -2989,   1673,
- -1980,     21,  -4054,   8552,   1155,   -301,   1204,   3776,
-   262,  -1828,  -1837,  -1014,     -9,   2711,   1467,    463,
--11605,   1743,   -956,  -1213,  -3892,   1534, -10298,     22,
-  -902,   -658,  -1759,   2507,   1552, -12298,  -1050,    623,
- -3221,   1522,    -36,   -446,  -5925,   2144,  -2844,  15080,
- -1984,   3631,   1931,   1894,   1193,  -1694,  -3172,   -813,
- -1336,    534,   -365,    833,   -293,  21759,  -1266,  -1216,
-   996,     -2,   -393,   -858,    759,    969,   -230,   -151,
-   977,   -874,    119,   -896,    262,   -118,     89,     95,
-    94,   -437, -30375,   -462,    360,   -588,   -334,     86,
- -1027,   -208,    536,   -196,    367,   -467,    119,    -32,
- -2544,   6204,   8830,   -264,  -7847,    848,   2267,   3877,
- -6378,  -2249,   1420,  -1868,  -3443,   3747,   -590,     58,
-  -274,  -6065,  -8472,   5906,   3109,   5834,   3905,   2086,
-  1300,   3828,   -518,   -528,  -3672,   1794,   4353,    408,
-   566,  -2577,  -1137,   2749,  -2662,   -528,  -7479,   5550,
-  2932,   -336,   3681,  -2034,    212,  -8733,   1017,   2258,
-  8225,    387,    227,    877,   2752,  -1375,   2636,   8131,
-  3850,  -6870,  -1158,  -3736,  -8478,    228,  -5809,     97,
- -2555,  -2956,   -928,    678,    112,   1434,  -1250,   1240,
-  -412,  -4267,  -3811,   4322,  -3430,   7705,   5456,  -6876,
- -3452,   7329,   3142,    220,    662,   1531,  -5492,  -1388,
-  6842,  -3631,    362,   5029,   8052,  -2367,  -5346,   5724,
-  -358,   2469,   2196,  -1426,   -272,    534,   -192,   -531,
-  -705,    -70,   -259,     93,    335,    -94,   -145,    -17,
-   920,   1186,   -818,   -599,    343, -19859,   2968,    161,
-   128,  -4282,    598,    152,   1210,  -1317,  -1545,   -229,
-   181,  -6488,   5699,   7270,   6271,   8809,     27,  -4770,
-  -804,   -168,   -247,   -680,   -129,   -470,   -152,    915,
-   176,   -904,    622,    280,   2986,   1034,  -1046,   -482
-},
-
-.cb4440s0 = {
--12085,   8192,  -1802,   4587,   5947,  -3183,  -2629,   1837,
-  2434,    252,   -612,  -4697,   -576,    150,   -704,   -640,
-   174,   -126, -10309,    350,  -3187,   4714,  -2829,  12618,
- -2172,   3502,    465,   -159,   -601,   1306,   1174,   -448,
-  -292,   -136,    242,     31,  -9005,  -6203, -10027,     25,
-  -209,    -20,  -1292,  -1252,   4304,   3681,   4462,  -4401,
-  4412,   1240,   -576,   3618,    595,   -237,   2544,  -6032,
- -1511,   1523,  -3668,  -3472,   5552,  -4901,   -272,   5963,
-  2740,   -878,  13010,    191,  -2017,    768,    455,    -45,
- -6873,  -3664,   2639,   -961,   3068,  -4242,   1327,   2362,
- -1909,  -1114,    100,  -5940,    220,    865, -12952,    -76,
- -1279,   -591,   1092,  -3502,     88,  -2118,  13053, -10141,
- -3024,   -533,  -1923,  -4097,    135,   1672,  -1661,   1646,
-  -370,   -361,    644,   -197,  -6796, -10948,  11692,   -974,
-   488,    349,   3936,  -1506,   -149,    513,   1401,  -1776,
-  -391,   -210,     57,    -56,   -344,   1018,   7989,  -4957,
-   167,    987,    -60,     62,   1622,   1207,    -69,    338,
--16133,    -46,   1018,  -1460,   -821,   -646,   1316,    126,
- -4631,   -842,  -1505,  15833,  -6404,  -4514,   2946,   2923,
-  1198,  -3141,  -3109,  -1613,   1853,   -906,   -436,  -1110,
-  -282,   -214,  -3424,  -3141,  -3988,    284,  22262,   1269,
-  1787,  -1116,  -1429,   1017,    371,   -187,   -825,    534,
-   350,   1088,     26,    176,   8914,   6662,    935,   2074,
- -7986,  -4780,   2194,   1796,    697,  -4040,   2486,   1700,
-  9150,    -37,  -1560,   2449,   -162,    128,  -7469,  -2690,
-  -281,  -4698,    424,    535,   1416,    243,   -575,  -1160,
-   326,  -2417,    808, -15816,    994,   -302,     26,    894,
- -7376,    395,   -586,    823,  -1341,    972,    100,    241,
-   743,    470,    267,   -550,    474,    182,  18252,    178,
-  -182,     -7,   3496,   2132,    863,   -151,    741,  -2158,
-  -763,   -652,   -503,   -434,   -736,    770,   -156, -19071,
-   443,   -354,   -243,     66,   4258,   6714,   3577,  17338,
-   556,  -3570,   1269,  -1406,   1668,   -349,    -90,    781,
-    82,    558,    936,   -788,  -1072,    -21,  -6472,  -3022,
-  -475,  -6997,  -2816,  -3774,   1683, -13950,   3482,  -1872,
-  2624,   1064,   -318,   1300,  -1214,    179,    -11,   -124,
-  4560,  -2827,  -6314,  -5736,   1159,   1309,  -5462, -11652,
-  4192,    151,   -543,  -3484,  -2288,   -119,    745,   1373,
-  -121,   -629,   5204,   7650,  -2062,  -3370,  -2894,   -338,
- -1361,   1080,  -3674,  12852,  -6119,  -1578,   -736,   -241,
- -1564,   -109,   -441,    335,    416,   1678,   4802,  -3239,
-  6182,    154,  -3656,  -1337, -17027,   1707,   -381,  -1704,
-  -377,   1022,   -592,    983,   -321,     37,  -1846,  -4500,
-  2575,  14162,   -560,   9385,   4179,  -1340,  -3466,   3235,
-  1727,   1545,    -23,    636,    280,    -39,    871,    173,
- -8915,  -2427,   2146,  -3698, -12153,  -3773,  -3873,   5042,
-   112,    788,  -1139,    245,    546,    278,     -8,  -1005,
-   443,    -76,  -1256,   8255,   3841,   6116,   4226,   3705,
- -1278,  -6470,   5220,   5892,  -3468,   2736,   5427,  -3336,
-  -264,   1906,    294,    -60,  -7078,   7699,  -9792,  -7108,
- -2030,   1055,  -6962,    702,  -2074,   -232,    127,   -430,
-   658,   -272,    757,    138,    159,   -340,  -4606,   1021,
-   146,  -7690,   6001,   5660,   3363,   -367,  13222,   -441,
-    13,   -874,    668,   2293,    875,   1238,    110,    778,
-  1434,   -976,   2151,  -8169,   1421,   2622,    206,   -795,
-  -816, -14443,  -1583,   3356,   2971,   -964,   -321,   -841,
-  -404,    111,  -5595,   4248,  -3819,    214,  -2520,   -712,
- -1505,    849,    947,   -876,    188,   3221,    863,    105,
--17336,   1818,     14,     17,  -6349,    379,   4746, -12405,
-  -560,  -3448,   3664,   8251,    845,    383,   1348,   -739,
-  -780,   1695,   4828,   -123,   -647,    823,   9940,   -183,
- -1804,  -7112,   -161,    578,   -619,  11534,   3214,   1586,
-  4784,  -2540,   1188,   -304,   -485,   -648,   -824,   -595,
- -8817,   4138,    927,  -3259,   -198,   4022,   2213,  -1627,
-   645,  14602,  -1058,   1481,  -1670,   -113,    564,   -710,
-  -451,   -360,  -1261,   2504,    247,   5566,  -7262,   1344,
- -5106,  -1608,   1946,  -4240,  -7393,  10440,   3306,   1940,
-  -999,    155,    832,     55,  10218,  11475,  -3252,  -8295,
-  1347,   2405,   3421,  -2619,   2262,  -2829,    754,   -307,
-   548,  -2040,  -1130,    317,    170,    292,    248,   2601,
--18930,  -1942,   1417,   1678,   3310,  -2578,  -1969,   1550,
-  3010,     70,      8,   3064,   -848,    504,   -172,    180,
-  1787,  -1133,   2427,   1002,   -664,    -40,    192, -23400,
- -1004,    513,   -818,   -382,    360,    360,    268,     98,
-  -202,   -192,   -668, -12924, -11702,   7325,    797,   1937,
-   674,  -2458,   -541,  -1497,  -1673,   -955,   -356,   -486,
-   182,    299,    -46,     65,  -4232,   1418,   6532,   2356,
- -4894,   4870,   3369,  -4585,   8743,   1497,  -1451,    862,
- -8612,  -1718,   1716,  -2389,    371,    592,   7397,  -3188,
-  -649,    126,  -1300,   1374,  -1292,    645,  -1494,   2736,
- -1468,  -1808, -17223,   -352,    111,   -222,   -236,    171,
-  -198,  -7994,  -3822,   5324, -16856,   -517,    119,    314,
-  -360,   -515,    435,    520,   -638,   1635,    420,   1191,
-   830,    710,   6897,   2925,   3091,    510,   3268,  -1702,
--16186,    718,  -3127,   -463,    763,  -1035,    725,   -122,
-   646,    172,   -164,   -277,   5853,  -7074,    -10,  -1770,
- -2544,   5978,   -874,   -494,   -232,  14465,   1815,  -1902,
-   987,  -1533,   1216,    741,    620,    161,   4414,   4184,
-   -32,  -2944,  -4619,   -462,  15701,  -1026,   -140,  -2396,
- -1747,   -538,  -1024,    219,    854,   -351,    860,   -226,
- -4390,    732,  -2003,  -2430,   -540,    592,   1622,   1180,
-   385,  -2052,   4050,  17401,   -650,   -243,   1709,   1261,
-    95,   -307,  -5110,   -666,  -7094,   -533,  -1293, -17357,
-  2929,   2389,   -119,   -413,    317,   -962,    709,  -1552,
-    26,    175,    700,   -570,  20120,   1107,    232,    169,
-  -889,   -533,  -1276,     22,    959,    866,   -954,   -792,
-   873,   -172,   1757,    195,    148,    423,   4490,   8782,
-   631,    682,   1832,  -3728,  -1742, -11130,  -1201,   1776,
-  9268,   -586,  -1358,   -646,    626,   -866,      5,    263,
-  3950,   -760,  -2914, -12751, -12669,   1513,     -4,    631,
-  1835,    312,   -167,   1546,   -532,    619,   1176,   1436,
-  -116,    312,   7054,   3120,   4075,  -1320,    715,   -206,
- -1572,   1350,  17688,  -1182,  -1568,    680,      6,    207,
-  1010,    600,   -766,    554,  -1483,    644,  -8810,    624,
-   148,  -4015,  -1536,  -1863,     92,    730, -14806,    386,
- -5174,  -1420,   -331,   -254,   -104,    275,  -7268,   2563,
- 11983,    -65,   8043,  -1623,  -2589,  -2610,   1328,   3154,
-  1935,   3672,  -1761,   4984,    661,    209,  -1038,    122,
- -1019, -28948,     55,    358,   -539,    488,     55,    618,
-    20,   -314,    446,  -1016,    618,    -93,    -94,   -331,
-   -36,    194,  -1706,   6628,    396,   -146,   -765,  10500,
-  2619,    -82, -10894,  -3908,   -888,   -192,    620,    163,
-    78,    774,   -293,   -104,  -4826, -14066,  -1883,  -3258,
- -4577,  -1484,   5412,  -4274,  -4951,   3316,   -907,   1948,
- -1187,   -404,   3654,    400,    -70,    459,  -3224,  -3194,
-  2338,   4390,     -5,  -3167,   3273,    116,  -1026,  -1668,
-  3767,    272, -16662,    137,  -1634,  -1007,    220,   -310,
-   982,   8220,    -16,  -1251,  -2644,  -3344,   2236,  -1573,
-  8174,    612,   1142, -10799,    393,   -707,   4804,    397,
-  1232,   -292,   5762, -15608,   2921,  -6440,   3544,  -2395,
-  -504,   1890,    172,  -1010,    178,    380,  -1163,    404,
- -1230,   1034,   -596,    105,  -2038,   1991,   5613,   -312,
- -4156, -10205,   3092,  -4704,  -6101,  -1620,  -1037,  -1130,
-  1590,   8321,   -797,    247,    954,   -103,   3838,   2330,
- 10064,   3197,  -8508,   1300,  -1012,  -6607,  -3861,   5651,
-    31,   -475,   1582,  -1370,   1107,   2164,    743,   -567,
-  4842,  -2930,   3191,   -190,  -2230,    -47,    254,   2147,
-   591,   -512,   1312,   1159,    811,   1444,  -1312,   -257,
- 16016,    789,  -2562,   3983,   -373,  -9255,    302,  -3655,
-  5750,  -3856,  -6941,   3934,  -2314,   5556,  -4099,   -265,
-  -479,  -4843,   -130,     20,  -4859,   3083,   6482,  -3738,
- -3936,    590,  -6368,  -1784,     75,  -3903,  -6834,  -4452,
-  -871,    764,  -1118,   8731,     38,   -148,  -3368,  -6330,
-  -370,   2234,    907,  -2809,  -1458,  -2306,   -402,   2679,
- -1222,   1138,    192,  -1317,   1012,  15514,    624,    279,
- -4032,   2565,   6162,   -938,   5760,   1685,   4350,   2939,
-  -825,   -331,   1840,   -556,    427,  -4642,    -23,   8346,
-  7577,   -467,   3848,    454,  -3962,    373,   -116,   2314,
-  4868,   -208,  -1367,  -1803,   2681,    806,  -4279,   3348,
-  -528,  14027,   -238,   -457,  -2764,    832,  -4680,   4354,
-  1219,   -801,   2414,  -5204,  -3768,  -6524,   5163, -10909,
-  1656,    321,   3260,  -1773,    214,   -135,  -4563,   5206,
- -4794,   1486,    406,  -1026,    281,   1799,   -218,    320,
-  -908,    872,   1056,   2955,   -208,   -799,  15492,    334
-},
-
-.cb4440s1 = {
- 27498,   -414,   -266,    646,    229,     94,    -15,    302,
-  -489,   -401,    125,    752,   -476,   -200,   -976,    195,
-     4,   -402,   2220,   1012,   1731,   2530,   -652, -21380,
-  -679,   -867,   -195,   -114,   1326,   2531,   -348,   -185,
-  -114,    178,   -694,   -298,   8752,   1735,   2640,  -2374,
-  6191,   1516,   5771,   6705,   -253,  -8502,    986,   2134,
- -1854,   3490,   -678,    -48,    133,    844,  -1635,   1630,
-  6056,   -756,  -1109,   1563,  -1445,   -139,    580,  -1448,
--18675,    846,   -390,   -259,   1548,   -324,    281,    142,
-  1792,   1211,   1328,  -4308,  -1032,  -5412,   4742,   -201,
-   -47,   -297,  -8403,   9715,   7268,  -3756,   1573,    677,
-   -88,   -145,   4877,  12946,   3264,   1809,   7230,  -2583,
-  1627,  -1786,  -7113,  -1480,  -2111,   -508,    415,   1664,
-  -483,   -538,   -249,     80,   7005,  -2562,   -887,   3801,
-  6411,   2222,     36,    875,  -5089,  10897,   4014,   4948,
- -1580,   1425,  -1814,   -391,    -96,    322,  -6484,   1896,
- -7790,   -950,  -4235,  -8362,   3118,   4843,   3754,   1070,
- -1648,   7692,  -1675,   3405,    918,   2270,    573,    193,
-  6024,   8912,  -4905,  -1810,    985,   1877,   2158,  -2150,
-  -386,   3908,   2030,    419, -12599,   -570,   -150,   1580,
-    36,   -152,      2,   -538,  -1565,   6809,   -715,  -6266,
--12725,  -6718,    810,   -603,   1547,   1001,   2250,    810,
-  1773,   -672,    327,    246,   6414,  -7511,    916,   -327,
-   830,  11862,   4373,   1003,   6370,  -1730,  -2127,    613,
-  1627,    626,    763,   -864,    207,   -233,   3738,  -8644,
- -1634,  -2050,   3906,   -451,  12986,  -4828,  -2973,  -4714,
-   545,    822,    735,  -3539,   -256,     65,    -93,    -94,
-  2923,   7075,  -3763,   6172,  -9544,  -2675,  -3833,    930,
-   418,  -4496,   3790,    386,  -7797,    234,   -609,   -259,
-   454,    330,   1546,  -7634,  -1966,    515,  -2496,    374,
-  2633,  -3014,   4126,   9920,  -7103,   1441,   -150,   7695,
-   670,    -48,    -41,   -512,  -6849,  -1785,   3755,   1860,
-  2418,  -2346,  -1194,  -1574,  15510,    444,  -1515,    585,
-   742,   -199,  -1115,   -122,    -11,    140,  -7763,   1438,
-  -317,   -444, -17149,    -24,   2685,   -856,  -3166,   1109,
-   308,    233,     30,     63,    530,    645,     84,    133,
-  6139,  -1183, -10673, -12790,   -112,  -1544,   4623,    576,
-  -804,   1023,  -1646,   1192,    269,   2681,     44,   -909,
-   -14,   -414,     48,  -4002,   4768,   3440,   3252,   1441,
-   101,    372,   3166,  -1398,    325,  16184,   -711,    486,
-  1328,    114,   -450,    -31,   1152,   2154,    -69,   -252,
-    32,    922,    219,  -2055,    421,  -1377,   1006,   -614,
-   234,    -40,    -84,    204,  27171,    182,   1034,   1536,
-   834,  -8038,   1243,  -3074,  -7829,  11165,  -1854,  -1173,
-  -871,   4105,   3588,  -3191,    188,  -2102,    124,   -166,
-  8070, -11066,   6632,   2739,  -7787,    184,  -5872,   1360,
- -1089,   1273,     84,  -1683,  -1584,    975,   -206,   1160,
-   180,     12,  -6121,   5436, -14726,   5949,  -6756,    834,
-  1750,  -3142,   -878,      7,   -220,  -1933,   -141,    160,
-    26,    756,   -800,      6,  -8104,  -6989,   3353,  -3518,
-  4510, -12430,    736,  -2685,  -1042,     32,   1184,   -519,
-  -312,  -1073,   -402,     71,   -422,    -35,   1791,  12735,
- -2281,   2623,  -1502,  -3878,   6727,  10541,  -1110,   2308,
-   870,   1124,    874,  -1406,    123,    254,    405,    328,
-  3828,  -7541,   3096, -14145,   -672,  -1725,   -423,  -1918,
-  4164,   -411,   3094,   -568,   3575,  -2895,   -378,  -3065,
-  -232,    449,   8110,   2264,  -1383,   -557, -10683,  -7628,
-  4155,    754,   -134,   6759,   1051,  -2054,   -900,   -948,
-   579,  -1277,    151,    462,  11562,   -310,  -8260,  10238,
- -1309,  -3052,    345,   -689,  -1133,   -588,    548,    980,
- -1332,    881,    368,    776,   -704,    422,  12433,   1314,
- -1487,  -4753,   2679,   3092,   -939,    136,   -586,   3504,
- -1034,  -6318,   3506,    420,   2326,   1034,   -252,   -398,
- -6232,   4488,  -6166,  -1754,    908,   4884,  -5188,  -2985,
- 10793,   -116,   4674,   3980,     -9,    805,   1568,  -1620,
-   -88,   -146,   3027, -16154,   2899,   7839,   5912,   -427,
-   270,  -1467,   -387,   -351,    615,   -322,     -2,  -1061,
-  -654,     56,   -438,    132,   2388,    460,   2172,   1874,
- -3028,   3302,   2035,   -704,  -1222, -19835,   -472,  -1858,
- -1686,   -286,      5,   -748,    491,   -350,  -4344,    103,
-  1473,   2440,  13575,  -1350,   1456,  10377,   1962,   3036,
- -1238,   1580,    607,   1352,    997,   1212,   -489,    251,
-  4075,  -3457,   6186,    786,    300,  -2532,   -373,  -2522,
-  3108,   -294,   4938,  -2980,   1509,  12450,   -695,  -1128,
-   -96,    354,  -3678,   8494,   2480,   2264,   5162,  11907,
-  4721,   1111,    752,   2999,   3924,  -1429,    321,    276,
-   309,   -603,    601,    -62,   3337,  -3570,   3273,   6618,
- -2001,    950,    532,    972,   1619,    956,     65,   -609,
-  -281, -14769,   -438,    580,    230,   -228, -10108,  12289,
-  8904,    872,  -3296,   1535,   -384,    477,   -913,   -777,
-   546,    445,  -1004,   -435,   -716,   -138,    572,    435,
-  4626,   -864,  -5716,  -2810,   1291,  -4796,   -241,   2527,
- -2342,  -1360,   4161,   1886,   -128,  -1521,  13726,   1818,
-  -554,   -157,  -9665,   2607,  -1013,    579,   1122,   1571,
- -2684,  11364,  -6464,   -184,  -1542,  -5670,  -1091,   -670,
-  1273,  -1051,     -7,   -278,  -2551,   -548, -10673,  -1434,
-  -343,    317,  -3108,  -1615,  -2239, -14132,    490,   -454,
-  2467,   1990,    470,  -1072,    440,    290,   3006,  -4420,
- -2083,   3050,   2779,  -2349,   -590,  -4941,   7464,  -9000,
- -2686,  -2045,  -8712,  -3281,  -2476,    648,   -148,    408,
- -1367,  -1113,  27347,  -1113,    739,     39,   1443,   -208,
-  -686,    986,    735,   -702,     76,    665,   -194,   -165,
-   366,   -606,  -4908,  -3932, -15941,  -2810,   4572,    816,
- -2092,   4213,  -2492,   4006,    926,    210,  -1110,  -1635,
-  -270,   -226,   -362,   -187,   1790,   3016,   2216,   3890,
-  2018,  -1325,  19784,   -771,    356,   2118,    -98,   -688,
-  1016,    978,    559,    -39,    160,   -310,   6622,  -1754,
--11104,    204,  -2212,   2370, -11610,   1119,   3216,   3102,
-   524,    278,   -829,    524,     28,    838,    374,    -76,
- -4593,  -2933,  10697,  -6510,  -4970,  -2025,  -9383,  -3428,
- -4112,   2665,   1459,  -1411,    421,    481,    842,   -341,
-   147,   -158,   4108,     45,   4935,    -21,  -7905,   2058,
-  1158,  15260,   -567,   -752,   -992,  -1094,  -1059,   2370,
-   820,    655,   -261,    280,  -3969,   6342,   8521,   3114,
-   369, -12269,   1684,      4,   4686,   1985,  -3668,  -3040,
-   677,   -254,     57,   -161,   -989,   -379,   7075,   -580,
-  2846,  -3177,  -2285,    958,  -7096,   -154,   -515,  -3345,
- 13487,   3548,  -1804,    290,   -430,    726,    399,     54,
- -2814,  10235,   1958,  -3356,  -1330,    536,   3218, -14194,
-   200,   -796,   -862,  -1480,   1811,   -346,    604,   -391,
-  -231,    513, -10495,  -6029,  -6492,  -8746,   -357,   -221,
- -1890,  -2669,      8,  -1756,  -5812,  -1048,   2258,    223,
-  -474,   1154,   -226,    348,  -1590,   2915,    158, -24059,
-   875,   -846,   1150,  -1000,   -844,   -116,   -246,   -219,
-  -482,   -367,    120,    517,   -489,    442,   8148,   5040,
-  3770,  -1006,    -51,  -3175, -10278,  -4468,   1188,   1497,
- -6515,     -5,  -1628,  -2387,  -1297,   -717,   1630,    232,
- -3608,  -6688,   2444,   -792,   -246,    411,   1464,   3661,
-  3244,  -1121,  -1602, -15398,   -443,    882,   1412,    926,
-    16,    -73,   2693,   7168,  -9399,    528,   7916,  -9270,
- -1669,  -2756,   1304,   3074,  -1510,  -2089,   1491,  -1556,
-  -422,   -414,    132,   -192,   5988,   4500,   7572, -10978,
- -4875,   3685,   1888,   -660,  -1750,   -515,  -2728,  -3133,
- -2742,    666,  -2861,    626,    256,    243,   4587,  -3567,
-  -288,   2314,   4765, -11036,   7322,   7581,   2651,   3264,
-  -394,   -246,   -891,  -1464,  -1717,    123,   -517,   -486,
- -1019,   7215,    554,    722,  -4253,   2393,   3053,   2881,
-  1538,  -2104,    573,    321,    673,   3902,  -2855,    944,
--12816,    370,   3496,    952,  -1435,   6379,    766,   2273,
-  -729,     80,  -2432,  -1150,   2408,   -895,  15497,  -1231,
-  -282,  -3306,   -435,   -167,  -3528,  -5683,  -6413,   2501,
- -4825,    124,   3128,   -425,  -2800,   -986,  -2283,   -495,
- -3392,  -1560,  -2093, -11613,    -37,    157,   -438,   -794,
-  1988,    -45,   1508,     20,     98,   -458,   -245,   1130,
-   110,   -525,   -771,   1120,    710, -21758,    174,   -210,
- -4839,  -2468,   -648,  -4388,    -11,   2990,   -181,  -4790,
- -4232,   3634,   6427,   2772,    166,  -2996, -12005,   1630,
-  -249,    179,    856,  -1250,  -4216,   1993,   5164,   4757,
- -5071,   4331,  -3029,  -1276, -11184,  -2864,   1238,   6332,
- -2431,   1276,   -338,   -476,  -5659,  -2410,   2510,   1853,
- -4853,  -3175,  -1896,  10728,   3724,    960,   9963,    305,
-  -938,   -646,  -2760,   1436,    113,    -74,  -3098,  -4090,
-  2950,   2701,    992,    206,  -1393,  -2179, -10862,  -2396,
- -1008,   2639,  -1547,   -416,   9264,   1824,   -360,    401
-},
-
-.cb4440m0 = {
--25793,   -238,   1193,  -2635,   -238,   1315,  -2277,   1588,
-  -896,    512,   -864,    611,   -398,   1277,   -212,   -358,
-   202,  13250,     16,   -860,   1618,  -1024,    310,  11560,
-  -746,  -3876,    780,  -4087,   -475,    857,   1017,  -1439,
-  -890,    155,   8556,    362,  -1158,   2116,   -291,    -66,
- -1272,    510,  -1394,   2259,  -4761,    808,   -740,   -937,
- 13993,    191,    273,  -7670,   6776,    846,  -1907,    955,
--13206,  -1956,   1697,   1670,   -329,   -244,   2395,   6119,
-  -802,  -1007,    649,   -974,    170,  -2136, -10780,   1020,
-  1270,   1954,   1118,  13348,    983,  -1394,   -594,   -514,
-  -586,   1026,  -1821,    548,   -298,   3342,    837,  -1395,
- 13977,   1021,  -7792,  -2930,   1466,   5494,   -843,   2432,
-  1378,    -68,    174,    407,     76,   -877,    691,  -9445,
-   522,  -3448,   2549,   -412,  -2358,    875,  -5044,   -952,
--10113,   6574,  -6347,  -2760,   -662,     29,   -227,   4884,
-  1304,    411,  -3320,   2434,    785, -14822,   4412,   2272,
- -6407,   2172,   -613,  -1665,    296,    742,    624,    135,
-  5316,  -3191,   -855,  -2061,    485,  -3188,   2998,   1382,
-  2516,  -2438,  -3506,   -238,    737,   -629,   1001,    773,
- 17540,   1478,   -724,   -764,  -1231,  -1254,  -1582,   -692,
-  -351,  -1551,   -171,    183,     38,   -668,    756,   -770,
- 24344,   -905,  -7182,    502,  -3766,  -1690,   1588,   1522,
-  1844,   1276,   1458,   -777,   1731,   4856, -14860,  -1097,
-    36,  -1310,    846,  -1500,    521,  -3669,   -252,   4480,
- -2602,   -845,    597,  -4512,   1062,   -292, -18518,   1972,
-  -334,    -80,  -1256,   -366,   3640,   -436,    -12,  -1670,
-  -435,   1496,   1429, -11092,   1012,   -936,  -1224, -12240,
- -3048,    210,   1905,  -1197,   -357,  -9759,  -2632,   -332,
- -3417,  15078,   1496,   2206,   1800,    205,   1384,   3546,
- -1853,    755,   1016,    726,     58,   -150, -13053,  10375,
- -2589,   -330,   1616,   3081,   2763,  -2617,  -1204,    324,
-   -53,   2968,   1485,    214,    124,   -334,   -237,  16784,
-  2612,   1023,  -4298,  -2156,   4336,  -4307,   4952,   1036,
-    81,   -762,   3416,    714,   -187,  -4100,   -757,   1124,
- 10224,   7059,    424,   -316,   1281, -12262,    912,  -1999,
-     2,   -731,   -184,    879,   -934,   -202,   -391,  -1046,
-  -338,   -101, -17511,  -1712,  -5580,  -2327,  -2478,   1770,
- -5825,   1499,    578,   -130,   1424,  -1818,    110,    542,
-    22,    988,  -4227,   2836,  -1447,   1170,  12335,   2179,
--11216,  -2500,     64,   -912,   -954,    654,   -802,   -455,
-  -597,    234,   -296,    811,   1083,   1848,   4148,    637,
- -6608,  -2362,  -3382,   -664, -13088,   2839,   3090,   3294,
- -4554,   2518,    -55,    837,   1392,   5905,   1287,  -1484,
-   965,  16533,  -3507,  -1903,  -1562,   2408,   5037,  -4816,
-  1409,    361,  -1890,    170,   -610,  -1755,   -524,   -867,
- -6238, -20117,   -745,   -956,   -176,   2998,    130,   -668,
-  -843,   -267,   -364,   -573,    495,    127,    -66,  32767,
-   271,   -408,    654,   -123,   1831,    151,    996,     82,
-   628,   -251,    144,    198,    -88,    357,     37,    612,
-   184,    238,   -584,    -52, -30025,   -415,    404,   -566,
-   100,    659,   -336,    877,    211,   -730,   -377,    184,
- -5256,  -1484,  -1191,  -2108,     24,  -7821,    209,  -2856,
- -1844,    697,   5798,  -1191,    427,  11858,   1000,   -261,
-   184,   -686,   1182,  -3142,  -3138,    139,    144,    117,
-  3658,  -3566,  -1562,    672,   2036,  15051,  -5069,   -551,
-   529,   1696,   -214,  -2678,  -5966,  -3707,   2847,  -2554,
- -1760,  -1196,   2088,   6372,   1778,  12935,   2189,   1992,
-  1761,    578,   -542,   -753,  -1182,   4321,   1871,    309,
-   704,  -1259,    884,  19136,  -2665,   1096,   3048,   -167,
-   872,   -344,  -1092,    464,   3255,    -86,   1608,  -1062,
- -1569,  -1699,   4504,   -274,    568,   1428,  20571,   1452,
-  -894,   -791,    459,   -882,  -1048,  -2944, -11095,   -783,
-  -832,  -2450,    650,   2784,   3156,    529,    457,    483,
--12553,    655,    686,   -757,    929,    212,   1242,   -201,
- -1627,   4826,  -1895,    997,  -3225,     84,     80,    287,
- -2136,    405,   -188,   -890, -18272,   -511,   -118,  -3642,
- -1018,    420,  12650,   -474,   -540,   6978,   6977,   4418,
-  1162,  -1332,  -1112,  -1765,   2640,    562,  -1164,   1256,
-   595,    567,   -483, -31511,   -960,   -816,    756,   1505,
-    12,   -518,    234,    184,    679,    328,   -600,   -137,
-   267,   -440,   2540,    593,   1023, -11756,    626,  -2034,
-  5756,  -9882,   3175,  -1190,   1628,   3920,   3219,   1394,
-   834,   -140,   4036,   4722,   -455,   3105,  -1355,  -3106,
-  1000,   7806,  -2227,    687,  -1580,   3180, -12302,  -1394,
-  -425,    488,   -187,    -36,    219,    158,  12006,   1683,
-  2151,     -2,  -1110, -12250,    -59,    672,   1844,   2084,
- -2101,   1652,   -783,    634, -13257,   -339,   3932,   2260,
--12452,    152,    316,   -688,     79,   -912,  -2081,   1384,
-   188,   1942,   -706,    204,    700,   1776,  13901, -13666,
-  -324,    472,   1055,   -646,     82,   -769,   -877,   -443,
-  -227,   -900,    636,   -870,    470,   -112,   -598,  -4402,
- -2726,   1775,   -216,    -43, -18675,   -863,  -4604,   3433,
-   674,   -155,    208,   1546,    294,   -157,   -616,  11070,
-  1229,   -528,   2124,    699,   3624,     54,   -516,    194,
--13556,   1902,   -506,  -1317,   1916,    471,   -342,    836,
-    18,    906,    614,     -8,   -951,   1052,    -97,   2212,
-  -924,    310,      6,   -733,    122,  23731,    468,    345,
-  1545,   1434,    611,    403,  -3136,  -2214,    -54,   1023,
- -1390,  -5243,  -3744,   -258,   6871,  -1778,    673,  -2362,
--13007,   -776,   -974,  -1077,   8386,  -3978,  -4325,   1236,
-  4011,   1161,   -263,   1224, -12957,   -100,   2801,   1458,
- -3081,    578,     17,   1037,   -742,   5972,   -632,   2904,
--12721,  -6733,   -478,    182,  -1973,   -820,  -6911,  -4904,
-  -942,   -348,   -353,   -350,   7864,     34,    568,   1985,
-   956,   3310,    118,  -2067,  12600,   9063,   1609,  -1261,
-   296,  -1248,  -1656,    -65,   1832,   1525,   1503,   5149,
-  4370,  -1638,  -3868,    320,   1527,   -424,  17676,   1780,
-  1172,  -1132,   1128,   1294,   -322,   -101,    462,  -6668,
- -3024,   7573, -11088,   1581,     13,  -1398,    550,   4376,
-  1623,   1727,    857,  -5310,   2528,   -529,   -401,    539,
-  6508,   4246,   4105,  -5363,     96, -13407,   -694,   5061,
-  3445,  -3283,   -348,  -1470,   1114,    602,   -404,   -129,
-   642,   1547,  23110,  -2255,   1969,    333,   1297,    116,
- -1691,    364,   -528,    758,  -1239,  -1826,   -249,   -395,
-   684,   -856,   -638, -10000,  -2773,  -6151,  -1244,  -3138,
- -9688,  -1994,   7124,   1368,  -1870,   -312,   1863,  -1006,
-   963,    789,    743,  -4158,   -760,   1384,  -7525,   -959,
-  -262,   5752,   4005, -12037,   -210,    886,  -1961,   4895,
-  -251,   -158,    212,    677,    518,    342,   -226,   -360,
-   466,     17,  28392,    -20,    246,   -686,   -258,    640,
-  -378,   -120,   -443,   1078,  -2612,   2084,  -1706,   4334,
- -4675,  -4634,   2336,  -9998,   9975,  -1285,   2778,   3292,
- -1717,    138,   2114,  -1120,   -180,  -1146,  11988,    829,
- -2530,  -8827,   6833,  -1191,  -1653,   2691,  -4067,   1166,
-  1971,    303,   -544,  -1459,   -261,   1065,   3410,   2050,
-  3163,   -515,   5456,  -4261,   5483,   1531,  -2098,   2020,
-  3773,    588,    915,    158, -11876,    282,  -1180,    265,
- 11036,    -66,  -1741,  -1894,  -4234,   3048,    218,  -1030,
-  2240, -12666,  -2290,  -1673,  -1911,   1480,    287,    -81,
-  1182,    216, -10734,   2201,    -58,   -619,   8585,   -574,
- -4576,   1852,   -468,  -6759,  -7667,    167,    995,  -1114,
- -1276,  -2053,   2178,  -8133,  -1270,  -7822, -10582,   5380,
-  3037,   1071,    827,   4972,   1024,   -129,   -180,  -3002,
-  -846,   -736,   9587,   1890,  10287,  -1954,   1042,   1558,
-  -950,   2406,  -1852,   2275,   6694,   -703,   -910,   3854,
-   812,    521,  -1075,   -761,   5357,  -3911,   3892,   7944,
-  4580,   5031,   1088,   7116,  -1746,  -5223,   2607,   3227,
-  2296,   5603,    211,   -731,   6450,  -3312, -12378,   -326,
-  4245,   4168,   -799,  -3563,   -505,    725,  -5297,   2196,
-  2221,    -16,  -3472,    315,    626,  -6131,     71,    920,
- -4383,  -1340,  -2675,   -664,   7412,  -1240,  -1361,    997,
- -3817,  -2377, -11717,   1661,     22,    540,  -5261,   -950,
-  7472,   3148,   7647,  -4400,   4558,  -4412,   -869,  -1528,
- -2618,   8311,   2110,    534,   -460,   -223,   -162,   -828,
-   274,   1844,   1861,  -1583,   6899,   5222,  -1772,  -2880,
- -6400,   4703,   2606,  -3990,  -1224,  -4160,   9032,   -299
-},
-
-.cb4440m1 = {
- 32767,    383,    857,  -1579,   -423,   1164,  -1606,   1218,
-  -410,    777,   -292,    122,    282,    -74,  -1394,    259,
-  -734,    102,    -82,  32616,    427,   -545,   -146,   -141,
-   340,    506,   -808,    171,   -778,    900,   -204,   -277,
-  -228,   -426,    566,   -481,  -1138,   -907,    112,   2722,
-   871,    115,  -7202,   1953,   -826,  -1812,   -396, -14722,
-  -840,    155,   1114,   5624,   1112,   -147,  -6383,    926,
-  1505,    360,    937, -13391,    969,   7062,   2218,  -3531,
-   471,    458,    191,   -465,   8664,  -1168,    546,   2109,
-  -944,    -74,   1644,    -81,   -760,  -1920,   2659,  13330,
-  1511,  -1148,   1346,    796,    -20, -15616,   1246,  -1190,
--10882,   -774,    -70,   3643,   -896,   1830,   -192,   1018,
-  1085,    -95,   -309,    659,     91,    727,  -4486,    486,
- -2078,   1235, -14415,  -4053,  -1619,  -2589,   -582,  -4650,
-  4076,   -762,  -1111,    277,   1448,   -742,   -314,   -979,
-  1889,   2679,  -1972,   2480,    302,   2869,  -9183,   -445,
- -1817,  12894,    106,    187,  -1406,   -615,  -1174,    746,
-  -371,    382,    350,  -1811,   -527,     36,    500,   -835,
-  -106,   1134,  -2207,   1021,    348,    908, -21780,    448,
-   688,    -60,  -1790,   1901, -22990,   1467,    596,   -912,
- -3190,   1484,    269,   -409,   -474,  -1670,   1328,    152,
-  -402,    359,   -734, -13208,     62,  -4197,  -6242,   5195,
- -2841,   5030,   2794,   1264,  -1130,   3821,    961,    729,
-  1075,     49,   -148,   7267,   2596,  -5093,  -8284,  -6875,
- -3059,   3909,  -4635,   1402,  -6334,   -342,  -3083,   -861,
-   490,   1257,   -630,    128,   2240,    832,   1060,  -1802,
- -1652,    128,   7816, -14391,  -6722,  -3328,  -2586,   3044,
-  1088,   1577,    852,   -142,   -176,   1371,   1236,    976,
- 12165,  -1596,   -199,   -504, -11020,   -582,    972,  -1468,
- -2402,   -666,  -3327,  -2148,   1078,   -194,   9675,  -2102,
- -1236,    -70,   -942,    291,   1364,   1403,  -3362,  12963,
-  -375,  -1728,   1615,  -2354,    633,   -506,   -194,  13037,
- 14172,    534,  -1026,   -425,   2488,   -180,   -678,   -436,
-   272,   1507,   -334,    840,  -1000,  -1068,   1029,   -306,
-    24,  -4435,  -5994,  -1307,   4251,   3968,   2527,   -981,
- -2626,  -4400,   -242,  -1823,   -679,  12831,    -22,     51,
-  -381,   2422,  -2376,  -8156,  -1477,  -6974,   1102,   -373,
-   467,  11314,   -554,   -432,    824,   7277,    393,   -178,
-   179,   -653,  11848,  -1593,  14143,   -731,  -1036,  -2322,
-   261,  -1992,  -1152,  -1430,  -1354,    -51,   -285,  -1637,
-   144,    -59,  -2182,   5731,    538,   -880,    397,   3010,
-   707,  -1822,  -1006,   4686,  -5096,   4246,  -3096,  -3997,
-  -254, -11025,    394,   -345,  18780,   -686,   -517,  -3422,
-   104,  -2173,   2439,  -5400,    -10,   1084,   1821,   -602,
-  1431,    405,   2143,    499,    405,    351,    -62,    -47,
-  1954, -29915,    440,   1054,    559,  -1210,    442,    928,
-    -1,     59,    279,   -112,   -110,   -440,   -396,    805,
-   311,    858,   -431,  -1070, -30192,    135,   1246,   -345,
-   790,    498,    319,   -302,   -469,    -10,    512,   -829,
-  -526,  -2052,   2456,    134, -19375,  -1210,  -1292,    640,
-  3232,   2580,    973,  -2412,    271,   -282,    632,   -523,
-  -847,   -138,   -990,   2501,    536,   -166,   2100,   -357,
-   122,    466,     -4,   2034,  20083,   1578,    444,   -344,
-  -689,   5733,   -456,   -503,   -592,  -1350,  -1038,    932,
- -1916,   1098,   -990, -22687,   1544,   -442,   -396,   -570,
-  -683,   -616,  -1431,    118,   4113,   -312,   2300,   2093,
- -2344,  -2955,   6343,   4306, -10078,   6286,  -5794,   -806,
-   664,   -217,    548,   5072,   4626,  -1643, -11619,    779,
-  1956,  -2960,    614,   2087,   9104,  -2418,    775,  -4447,
-   768,   1599,  -1084,    999,   1652,   1090,    630,  -1197,
- -3495,   -912,  -9817,    648,   3278,   1828,  13605,   2757,
-  -831,  -1191,  -1846,  -1441,   -278,  -8530,   -455,   -495,
-   323,   -911,   2500,  14100,   3635,   1016,   -936,   5265,
- -3092,   2125,   -121,    -64,   -656,   -337,   9438,  -7600,
-  1403, -11917,   2180,   2612,   1664,   1091,   -318,  -3300,
-  -427,    282,   1979,    894,   -703,    514,    160,   1697,
-  6508,    828,    187,    -34,  -1094,  -2861,    240,  -5013,
-  6004,  -4796,   -991,    158,  11437,  -1730,    354,   1195,
-  3790, -10432,  -3584,  13872,    336,   2043,    221,    604,
-  2930,   1080,  -1417,   1878,   -878,   -459,   -419,    364,
- -1037,   7764,   3100,     48,  11057,   1936,   2229,   9150,
-  -472,   1178,   -129,   2876,   -249,   -258,  -1181,   -329,
-  -581,  -1140,  -1967,    347,   -539,   -394,    775,  -1151,
-   -31,   1052,  -1900,   -213,  -1552,  22484,    164,   -113,
-   135,  -1294,    550,   7738,  -7223,   -739,   1362,   5518,
-   193,  -2170, -11861,  -1357,    351,   2215,    165,     16,
-  -606,    727,   -158,   -772, -13420,  -1248,  12422,   -812,
-  1768,   -442,   1269,  -1076,    899,    124,   -249,  -1110,
-   653,  -3064,  -1632,    839,   -230,    512,    642,  13230,
- 13285,   -552,  -1113,   -595,    864,    537,  -1012,   -539,
-  -615,   -491,   1014,    800,    -10,    534,  -1227, -25011,
-  1239,    -26,   3834,    104,    762,   1259,   2112,   -300,
-  -920,   -812,    612,  -1061,   -378,   -246,     -7,  11042,
--18492,  -1411,    -77,    407,   -556,    218,   1751,   1069,
-  -294,   1789,    904,    285,    -76,    300,   -160,   -128,
- -3398,  -2001,   1689,   4946,  -2750,   1427, -12632,  -1873,
- -1802,  -1115,  -2777,  -4436,   2937,  -6408,   -467,    487,
-  1043,   3914,    -81,   1540, -11718,   1368, -12656,   -583,
-  1009,   -416,    249,   1874,   1157,    994,   -858,   -154,
-   294,    333,    -26,     73,  -1576,    -20,   -560,  -1068,
-  1325,   -588,  26161,   1580,   -411,   -587,  -1083,    -79,
-   762,    292,   -622,    788,    284,   2014,     78,    554,
-  -516,   1340,    835,    300, -24827,    558,   -705,    -22,
-   139,   -159,   -246,   -585,   4318,    234,   1308,   -198,
- -3370,   5724,   2381,  13843,      4,    569,   8002,   1188,
-   -63,  -1698,   4624,   -405,   -218,   4238,   -888,  -1180,
-  3750,  -4848,  -9497,    293,  -1087, -13274,    -33,  -2870,
-   457,   -618,    338,    -34,    286,    345,  -5321,    904,
- -5656,  -2082,  12644,  -7423,    532,    958,  -1997,  -1483,
- -2982,   3115,  -1851,  -2025,   1853,   -918,   -903,   1554,
-   540, -16549,   1441,   2939,  -1272,   3106,   2374,   3906,
-  -697,   1144,    750,   -379,  -6502,    980,    386,     36,
-  1109,   1195,   6272,   4264,   1501,   5369,  -1560,   3535,
-  1084,    739,  -1031,  -4400,   8452,   -430,  -1787,  -7669,
-  -231,   -115,   4324,  -1820,  -2098,   -786,   7478,  -2709,
--14255,   5771,    115,  -1700,   -111,  -1482,  -1369,   -112,
-   122,   -472,    233,   2427,   1816,    180,   -481,    928,
-    82,     84,   -700,   -448,   -946,   1968,   1644,    168,
-  -167,  16164,    155, -10316,    941,   -584,    488,     96,
-  5205,    491,  -1844, -13055,   1266,   -352,   -836,    558,
-  1546,  -1720,    313,   2033,    597, -14351,   4426,   3281,
-  -559,   2614,   3248,  -2265, -10312,  -1614,   -288,    480,
-  1419,   -546,   -485,    835,    960,    462,    923,   6518,
-   834,   -711, -12639,   8811,   -207,   1806,    337,  -1240,
- -4796,   2383,    277,   1141,    969,     59,    197,   1365,
-  -614,  -9144,   4824,   -436,   4191,  -2588,   4509,    391,
- -5055,  -3231,   6978,  -6388,     51,    105,   -863,   1050,
- 13103,  12769,   -420,  -1562,   -123,   2702,    292,   1061,
-   123,    405,   1917,   -275,    493,    -95,   -195,    130,
- -2613,   9010,    196,  -1382,   5903,   7281,   1585,   2557,
-  -876,   3166,   6910,    590,  -3060,   -559,   4722,    393,
-   613,   -392,  -3022,   9892,   1808,    923,   8123,   9873,
- -1665,   2349,   2894,    591,   2000,  -3734,   -917,    220,
-   408,    296,   -656,   2608,  -1700,    400, -10734,   5434,
-  6504,  -1399,   2175,  -1203,  -6358,  -1221,  -5062,     45,
-   970,   -500,  -1322,   1176,   5882, -11687,   6324,  -2183,
-  2327,    922,  -5628,  -3507,   2406,    874,   1399,   4518,
-  -343,    857,   -224,    802,   -725,  -8561,   4432,   1974,
-  1825,  -2168,   -451,  -3408,   6587,   7589,   3361,  -4711,
- -1474,   3151,   1950,   1022,   1466,   9192,   4666,   -822,
-  1024,   2342,  -2220,   1169,  10460,   2993,   -988,  -4407,
- -6727,    902,   1659,     80,    106,    400,     34,   1746,
- -6982,  10484,   6333,   -845,  -3333,   1764,    217,  -4730,
- -3306,  -3664,  -2830,   2254,   -927,    -55,    587,   1812,
-   281,   4375,  -3614,  -1349,   1802,  -6184,  -2648,  -4189,
- -9381,  -3243,  -4147,    384,   2241,   5524,   -478,  -1534
-},
-
-.cb4448l0 = {
--15402,  -5156,  -1798,   -144,  -4711,  -4700,   2819,   -389,
-   148,  -2600,   1706,  -1906,   -578,    495,     24,    829,
-  -383, -12581,  11667,  -1039,   1395,   2670,   -288,     23,
-   628,   -248,   -512,     79,   -326,  -5428,  -2830,  -2476,
- -1253,   -915,  12042,   -674,   -110,   2950,   3885,  -5799,
-   983,    616,   -652,    -60,   -372,     22,   -141,   -167,
-    98,    125,   -100,  27211,    133,   -127,   -271,   -272,
-  -176,   1268,    173,   -422,   2431,  -3998,  -2797,   2328,
-   182,   6526,   3318,  -6282, -10580,   3966,   8504,    527,
-  9507,   6203,    990,   -989,   6030,   -136,    647,  -1100,
-  -324,  -2618,  -2499,    500,   -132,   -842,   1237,   3599,
-  2285,   2906,  10766,  11284,  -2794,    242,    184,  -1934,
-    55,   -839,  -1181,    406,    855,    902,  10490,   -327,
- -1561,   5742,    428,   2218,   1523,   5229,   9130,   -760,
-   108,   -140,  22229,   1132,    411,    720,    414,   -356,
-  -745,  -1276,   -899,   -562,    369,      5,  -7770,   4101,
-  3626,    126,    -13,  -4356,    728,  -3197,   1930,  -1470,
- -6936,   -410,   6720,   1897,   -530,  -4267,  -2181,   -876,
-  -472,  -2540, -10234,   4008,  10217,  -2561,  -2021,    716,
- -1378,   -325,    427,   -245,    314,    -48,   -118,   -150,
--30295,   -368,    256,    369,   -656,    -78,   -246,   -140,
- -1250,   -635,   1332, -13604, -10383,  -1375,    353,   2417,
-  2140,   -349,   1460,    -51,   -309,    523,    509,   2352,
-  1208,   -377,  -2023,   9708,    397,   1216,  10610,  -4416,
-  5520,   3902,  -2119,   -480,   -420,   1170,     36,  -3304,
-  1550,   -266,   1682,   -808,   2420,   2700,  16239,   3910,
-   572,   -375,     85,  -9775,   -120,   2214,   2779,  11510,
-  2628,   -416,  -1740,  -1305,   1226,     78,     78,    635,
-   422, -13892,   1302,  -4117,  -1218,   2681,  -8436,  -1723,
-  2290,   2815,   1172,   -181,   -675,   -475,   -763,   2394,
- -3639,   7903,   -659,   2323,   4837,  -6758,   9460,  -1480,
- -2403,  -2783,   1496,    806,   -458,   -246,     12,   -254,
-   121,   1477,   -633,   -513,    791,    208,   -390,   -177,
- -1292, -20471,  -4401,  -2678,   9026,    128,   -265,    822,
-   260,  11202,   3132,  -1879,  -3891,   1884,   -842,   -107,
-  7516,   1208,  -1552,   -995,   1203,   2150,  11044,   1285,
-  2282,     80,   1348,   5342,   2089,    924,   1472,  -1454,
- -8259,   -226, -10259,  -2335,  -2442,    224,   3257,  -1528,
-  6685,   1630,   1969,     48,   4802,   6051,    987,   8662,
- -2368,  -4984,  -1974,  -4049,  -5320,   5003,    299,   -400,
-   727,    208,   -187,   2838,  -4547,   9682,  -2238,   1065,
- -3206,  10091,   4915,   2945,  -1635,   -198,   1074,   -698,
-  -716,    -96,   1390,  -2644,   1006,  -4154,  10587,   1132,
-  2912,  -7399,  -8350,    785,    156,   -290,   -142,   -374,
- -2161,   1066,   1358,  -1798,   3050,    -19,    452,  10470,
--10948,   4190,   -984,  -2089,   -728,   1503,   4273,    812,
-  4950,  -3750,    844,  -1231,  -1582,  -2517,   2385, -10537,
-  5807,  -4621,    332,   -357, -12484,   1676,    160,  10762,
- -1225,  -1374,     14,  -1389,  -2900,   -467,  -1260,    459,
-  -861,    102,   1715,   4295,  -7324,  -7400,  10435,    287,
-  1866,    765,   1730,   3430,   -744,     -2,  -1773,    -96,
-  2001,   2165,    118,   9296,  -4640,  -4612,   7134,   5128,
- -7967,    404,   -433,   -433,   2222,  -8050,   2023,   2766,
-  -260,  -2440,   1607,   2442,   7763,   -486,   3766,   2355,
-  7515,    230,   1248,  -8873,  -8224,  -9135,  -1402,  -1812,
-  1223,    152,  -2316,   -739,   -405,   -784,   -598,    625,
-   503,   -175,   -573, -31693,    502,   -478,   -554,   -934,
-   387,    -80,   -484,   -701,    -34,    -51,   -494,  -1461,
-  1005,   2920,  11532,   2667,  -1674,   -832,   8680,  -5767,
-   786,  -1558,  -2062,   1009,   -392,   2099,  -7277,  -2587,
-  6302,   3070,   4496,  -1713,  -4042,  -8109,   1642,  -1894,
-  3450,    840,   3632,    160,    578,    149,    767,    754,
-   208,   -870,   -672,    252,    -30,   -213,   -482,     50,
-  -578,     -2,   -148,    246, -31918,   -568,    130,    472,
-   761,    -27,    -51,    454,    144,    124,   5844,  -8354,
-  9562,  -3755,   -262,   3286,   1120,    983,   -628,   -734,
- -1732,  -1424,    353,   -403,  15877, -13552,   -335,    337,
-   519,    140,    297,    150,    725,   -780,    876,   -116,
-   -91,   -128,    275,   2499,   9313,   -768, -10469,   1148,
-  2172,  -6417,   3292,  -2187,  -1108,   3055,   1105,    625,
-   794,     68,    337,   1384,   -106,   -516,    574,    868,
-   849,   -997,     81,  25796,     28,    206,  -3556,   -351,
-  1058,   1126,  -7826,   5310,  -4102,   5352,  -6835,  -4032,
-  1487,    230,   5617,    937,  10484,    -71,   2653,   1203,
-    -1,    667,  -1489, -10136,   7782,   -763,    792,   1434,
-  -170,    367,     96, -21992,   -252,    756,    145,  -1476,
-  1408,   1523,   -819,   -576,   -476,  -1068,   -241,    -39,
-  1547,   9553,   -622,  -1799,   1861,   6115,   -864,  10690,
-  -586,    470,    200,   1162,    586,     44, -11650,   3453,
-  8734,  -2754,   -178,    236,  -2650,   2654,   2699,   1180,
-  5325,   -458,    -40,   -218,     -6,    126,   6794,    506,
-   860,  11863,    652,   1665,  -4213,   4863,   1424,   5712,
-  -663,   -688,    -10,  -1421,   -676,  -1325,   -378,   -311,
-  -490,  19501,   1242,    268,   4581,   1587,  -1153,    848,
- -1378,  -1159,    505,     63,    704,   1942,   2204,  -2106,
-    44,    479,  -1098,    333, -21595,   -617,  -6444,   3547,
-  1282,  -1784,   4664,  -1330,   2607,   1241,  -3579,    247,
-  -875,  11359,  -3013,   -136, -12813, -14400,   1857,   -998,
-  1342,   1187,   -338,   1263,    575,   1226,   -995,    596,
-   446,    293,    767,   -356,     70,    786,    466,    202,
-   149,    849, -28991,    652,    124,   -209,   -124,   -406,
- -5463,  -1413,  -1300,  -5339,  -1761,   4770,   2680, -10542,
-  3486,   5601,   2932,   1581,    489,    521, -16583,      1,
- -1529,   5942,   1234,   4714,  -1647,   1150,   2802,    642,
-   586,   3836,    240,    307,   -490,     67,    771,    816,
-  -906,   1554,   1090,  -2353,   -629,  11291,   2941,  -2982,
-  9473,   1434,  -4351,  -8017,  -5173,   8071,   1931,   1281,
- -4055,  -3224,  -1918,   -271,   -204,    670,   3491,    107,
--31624,    227,     75,    -91,    108,    171,    -53,   -201,
-   373,     63,    118,    126,   -104,    127,    -88,   1810,
- 11688, -10240,    550,   3692,  -4978,  -1619,     40,    911,
- -1080,    580,   -767,    333,    192,    403,    308,   -904,
-   142,  31169,    503,  -1101,   -146,   -144,     35,    181,
-  -355,     54,    590,    499,     95,  -1767,    444,    -49,
-  2160,   7176,  12032,   6478,   -741,  -5576,   -644,   -101,
- -1251,  -1268,   2365,  10029,    537,  -1476,    307,   2108,
- -2478,   -944,  10725,    349,  -4242,   -135,   7577,  -4492,
-  1492,  -2512,   7736,  -5118,  -6756,  -2436,  -1890,  -2390,
-  1620,    914,   1658,     47, -11692,   -134,  -1740,   -196,
-  9521,   -136,  -1376,  -8682,  -1136,   1096,    903,  -1148,
-  -334,   -228,     -4,   -675,   -199,   1914,   2827, -11098,
- -2129,  -2559,   -978,    175,   1832,  10075,  -2358,  -1888
-},
-
-.cb4448l1 = {
--11514,  -2858,  12392,   -305,   -206,    929,    473,  -3120,
- -2766,  -1068,  -1237,    420,   -718,    -21,   -336,    -45,
-  -478,  -1517,   1830, -12644,    259,  11978,    257,   1494,
- -1759,    247,   -733,    112,  -2242,    290,    234, -10260,
-  1781,  -1806,  -4104,   1747,     38,   -692,   4971,  -9113,
- -1925,  -1580,   -615,  -9608,   3779, -11158,    469,  -4736,
-   299,  -2815,   2108,   1910,  -2356,     66,    523,   -440,
-  2298,  -4219,  -2512,  -1110,  11192,   5932,  -2629,  -7985,
-  -992,    775,  -1134,   3287,    900,   -681,    -39,  -1206,
- -1708,  -6800,   -361,  11024,   8496,   -198,  -3855,   1486,
- -2547,   1773,     50,   -276,   -286,    785,  -7884,    438,
-  4590,   2794,   5333,   5476,   2108,    660,   3610,   2308,
- -8538,    224,   -132,    134,    731,    988,  -1368,   3894,
-  4318,   9911,   -104,    320,  -9506,   1721,  -5690,   1712,
- -8747,  -1876,  -5122,  -1304,   -162,    752,   3646,   1621,
- 11089,   1117,  -1971,   1058,   3070,    180,  23112,    175,
-   483,  -1028,   -538,    497,   1053,     61,    788,   -455,
-    22,    -55,    -32,   -326,  15956,  -2045,    788,   9784,
- -1170,   -819,  -3677,    647,   -484,    578,   -160,    286,
-  -421,    289,   8140,   3838,   -578,  -1866,  -2074,    667,
--11951,   1684,   3439,   1280,    158,  -1784,   1276,    638,
-   562,   2045,   -220,    852,   -594,  -2109,  -2665,   2748,
-    38,     91,   1377,   -624, -18586,   -498,   -882,     36,
-   536,    -99,     62,  -5275,   3051,    231,  -6343,  -1751,
-  1206,  -1646,  -1347, -13590,   1431,   -271,   -442,  21934,
-  -143,  -1824,   -378,   -463,    816,    379,    336,   -291,
-  -652,    275,   -758,    257, -14866,  -1304,   7260,  -3373,
-  1249,  -1992,   2734,  -2565,  -3064,   -416,   2424,    279,
- 10518,    206,   -681, -14338,    666,   1843,   -648,    526,
-  1982,    366,    684,   1019,    192,      8,   -482,  -4785,
-  2134,  -1722,  10674,  -1613,     33,   1148,  -1566,  10226,
-  3397,    667,  -1100,   -738,   2420, -14282,    451,     90,
--10346,   2673,   1175,  -3639,    266,   -566,      0,   1672,
-  1082,    298,    359,   -497,   1784,   -570,  -2538,   2522,
- -3825,   6265,     99,  -7927,   3160,  11079,    131,  -2080,
-    92, -29951,    268,   -293,    240,    254,   -182,   -145,
-   303,     12,     86,    596,    246,    136,   1020,  -1521,
- -1134, -10125,  -5691,   6028,  -3703,  -4295,  -3718,  -5719,
-  -564,    660,   -321,  -1073,     83,  -3068,   6167,  12788,
-  -762,   8057,  -1215,   2379,   2142,  -3625,   -503,  -1418,
-  -304,   -649,   -501, -12558,  12787,   3737,   1465,  -3692,
- -1321,   1106,  -1136,   -651,    -50,   1608,     59,   -583,
-    82,    331,    443,    782,     93,    285,    310,  29149,
-  -698,    -52,   -909,   -238,   -222,   -114,      4,    650,
-  -200,    235,   2541,    598,    378,  11000,   3101,  -8228,
-  1690,  -4313,   6996,    -11,  -2620,  -1458,  -1428,    579,
-  -304,     20,   -372,    897,    602,    432,   -138,    690,
-   593,  -1485,    136,    191, -32147,    260,    199,    412,
-  -168,    -41,   -384,   -362,    -14,    242,    366,   -318,
-  -304,   1544,    458,  -7790,   3332,  -5117,  -1937,    868,
- 12622,    906,   1941,   4763,   1698,    351,   -234,   -973,
-  9166,   6726,   2686,    248,   3597,  -9812,   -400,   4155,
-  2852,   -415,   2218,    876,   1423,   3852,   2965,   -410,
-  1820,   8268,  -1296,    686,    114,   3087,   3007,  -9402,
- -5751,  -3459,  -6674,    418,   4137,   4778,     56,  -1399,
- -1698,  -2590,   8343,  -2130,   2535,   6148,   -134,  -2393,
- 11551,   -338,    735,    630,   -658,  13358,    949,  -1136,
-  -217,   -985,    182,  -1014,   1459,    221,   7713,  -1386,
- -1427,   1326,    555,     66,   2694,  -1535,   -268, -13596,
-   658,    305,    858,    548, -12748,   -582,  -1055,   -659,
--12155,    940,  -2164,  -2518,   -126,   -132,   -842,    641,
-  -483,   -446,  -5184,   -186,   -511,   1169,  -6092,   6161,
-  3082,   -664,  -2037,    847,  11032,  -1306,  -1673,  -1219,
-   -36,   1862,  10053,    780,   -282,   -837,   -263,    509,
-  -588, -12646,   -769,  -2164,  -2219,    524,  -3433,  -6437,
-  3890,   -623,  -7509,    241,   4042,    264,  -1394,   3646,
- -6925,  -5184,   1218,  -1476,  -2240,   1882,    182,  -3450,
-  -497,   -148,    160,  -1579, -19545,    -80,    886,    913,
-   708,    728,    393,   -603,   -778,   3414,   -778,  -1495,
-  1205,   2342,    232,  -3634,    -76, -16792,   -684,   1322,
-   192, -13248,   -658,   7650,   4731,   -169,   5148,  -1413,
-  3026,   2480,  -2190,   1004,  -2082,    237,    171,   -717,
-  -766,   -525, -11802,  -3776,  -9914,   1374,  -3250,    415,
- -2787,   -175,  -1081,    792,    980,  11464,    834,    714,
-  -993,    150,     77,   2306,  11249,  -3058,  -3418,  -1758,
-  -239,   -119,  -1408,   6083,  -4276,   1827,   1660,   2287,
- -2997,   -576,    400,   2062,  -3174,  -6215,  10026,  -1082,
-    41,    249,  10026,  -6199,   -301,    280,  10120,   2249,
-   527,   -564,   1002,    622,   3341,    408,   2870,  12902,
- 13307,    689,    336,   -819,    -43,    832,  -1242,    657,
-  -106,     42,   1123,    149,  -2072,     78,   -303,    329,
- 21745,  -2172,  -1204,    448,   1437,   -560,   -376,    311,
-   -73,    153,   -785,   -368,     54,   -445,    -92,    120,
-   -59,   -377,    402,    567, -25820,   1284,   1288,    200,
-  -865,  -1286,    -41,  -1862,    402,    179,  -2338,  -3876,
-  4992,  -1824, -10092,  -3407,  -8516,  -3556,    130,  -5695,
-  5846,   2333,   2995,   2110,  -6946,   5049,  -2377,   1655,
-  -859,  -4737,   1648,   7031,  -7344,   4992,   1760,   -711,
-  3134,  14363,   -907,    171,  -1971,  -3062,  -1079,    600,
-   603,   -224,   -440, -11328,   -291,   -663,   1878,   -715,
- -2724,    284,   -456, -10970,  -3225,  -2240,    252,   -977,
-  -360,    729,   -572,   3981,   1615,    -52,  -5372,   6095,
- -9888,   6873,  -3830,   4916,   1834,  -1581, -11268,  -2316,
-  -398,   1361,   6151,   2736,  -1968,   4624,   -180,   -260,
- -1221,  -5633,  -1300,  -1081,  -1433,   -509,    366,   -388,
-  1660,    340, -18997,    694,  -1184,   -813,   1324,   1261,
-   735,   -186,   5258,   -583,   -221,   1707,    149,   1022,
-  -835,   1089,   2939,   2025,    421,    411,   3609, -13797,
-   464,   9214,   2462,  -6257,   6032,   1911,   1282,  -9673,
-   974,   -703,   -128,    950,    369,   1160,   -674,   -312,
--13858,   1078,  -7606,      8,   2786,    367,  -6441,   -824,
-  -195,    714,    484,    108,    475,    289,  -1012,  -1591,
--10880,   -324,   -647,  -2199,  10378,   5781,    995,   -416,
-   871,  -1240,   -380,     70,  -1893,   7632,   1727,   -908,
-  -672, -10901,   -962,  -7322,    794,   1748,  -5568,   1215,
-  5845,  -9575,  -2413,  -2159,   3077,   1359,   -416,   6277,
-   -85,   1352,  -3498,   6130,   1125,   -236,   1950,   8481,
-   716,   -560,  -1311,   -228,    250,   -440,  -5320,  -1941,
- -9710,   4637,   1420,   -102,  -8222,    616,  -2254,   -528,
-   196,  -1315,   -749,    -97,   -285, -15880,   1105,    630,
-   368,   -809,     29,  -1688,  -2314,    745,  -1627,  19840,
- -2380,   4108,   1670,   2763,    275,    530,    492,   -589
-},
-
-.cb4448s0 = {
--10720,   9997,  -1313,   8849,   5152,   -226,  -2908,    303,
-  -842,   -870,    165,  -1372,   -105,   -154,    170,   2424,
- -2476,  -2126,  -8329,    349,  -4509,   5128,    -92,   9086,
- -7263,    416,   -124,    341,    -88,    239,   5172,    553,
-  1526,   1728,   1955,  -1489,  -6595, -11237, -10224,   -394,
-  -927,   -932,    674,    743,    317,   4628,   8453,  -3768,
-  2545,   3506,  -2406,   9108,   5643,   4660,   4116,  -2452,
- -1391,   -154,    -74,    180,   5270,  -7922,     46,  11046,
-  6076,    735,   7922,   -196,  -1080,   1445,   -687,  -2403,
-  -784,    742,   -269,   -498,   6010,  -4045,   1053,    891,
- -1538,    613,    -84,  -4254,   -957,   4682, -14004,   2050,
-  -647,   -718,    557,  -2720,   2437,  -7675,  11874,  -9284,
-  -734,    775,  -2231,    105,    366,   1360,    -98,   -126,
-   508,   2647,    729,    762,  -8806, -10413,   9008,  -2093,
-  1107,    201,   1421,   1181,   -259,   1420,    828,    327,
- -1956,   -573,   -874,    354,   2662,  -1437,  10864,  -9240,
- -7648,   1670,   1598,    173,    438,   -373,   -566,    246,
--11999,   1817,   -611,      1,  -1652,   1876,   1354,   1270,
-  -789,    300,   -321,  11577,   -516,    329,   5723,   4732,
-  1717,  -6224,  -5356,  -6292,   -370,  -3644,   -922,    -50,
-   -14,   -581,  -1554,  -1675,    -20,   -965,  28479,    658,
-  -498,   -488,    504,   -601,    437,   -585,   -245,   -196,
-   186,    281,   -174,    159,   7469,   5890,  -5112,   4918,
- -9023,   -360,     40,  -2975,   4784,   -437,   1609,   1032,
-  2759,   -297,    106,   5176,  -4315,    568,  -9536,  -1297,
- -6783, -10965,   1285,    264,    330,   -508,   -522,    624,
-   662,    539,   7248, -13780,     40,   2140,  -2188,   1925,
- -8972,   1147,  -1340,    870,    779,     -4,   -101,   -374,
-   781,   5733,  -5712,  -5777,   2080,    875,  13450,  -1551,
- -3229,  -1818,   -114,   1265,    501,    636,   -576,   -623,
- -1269,   3006,   1023,    862,   1359,   1950,    588, -22648,
-   218,   -438,   1547,   -408,   -844,   -263,   -106,  14754,
-  -689,  -9466,   -978,    -21,   1412,     43,   2012,    352,
-   908,    277,   -960,   -747,   -230,  -1557,  -7132,  -5707,
-    79,  -2474,   2177,  -5349,   2510, -12720,   2833,  -2152,
- -1693,    458,    197,   -643,    735,  -2728,   -893,   2758,
-  5196,  -3566,  -4294,  -4914,  -1222,    188,  -8884,  -6234,
-  2391,  -1518,    663,    572,  -1465,   1147,   8486,   2037,
-  2516,    941,   6092,  11602,  -2559,  -1702,  -1848,   -924,
-  -210,   -108,  -1052,   8360,  -7567,  -4588,   -169,   3464,
- -9206,   1842,  -4329,  -2499,   -341,    592,    918,   -102,
-   340,    214,   1037,   -324, -16289,  10308,    -47,    -29,
-  1340,   -603,  -2763,   -548,    392,   1489,   -149,   -769,
-   -67,  13270,  -2233,   8257,   1582,   1034,  -4270,    916,
-  4486,   1191,   -102,    159,    109,   -536,   -664,   -987,
- -8041,  -1759,   4264,  -5600, -13815,  -1158,   1712,   2516,
-  -634,    504,    515,    732,    -46,   -685,   -481,   1685,
- -1782,    262,  -3600,  14721,   6334,   7941,    101,    914,
- -2141,     -2,    182,    829,   -215,   -122,   6325,  -3752,
- -2812,   1618,   3512,  -1591,  -4276,   6994, -10349,  -5675,
- -1501,  -1766,  -1949,    436,     82,  -5596,   2592,  -1086,
- -2804,   2540,    458,   -550,  -1834,  -2401,  -7563,   2340,
-  1678,  -7666,   4538,     27,   6337,   3642,  17068,   5310,
-  1115,   1579,   -142,   -397,   -670,   2010,    863,   -504,
-   845,    848,    770,  -8821,   1963,   2782,    162,   1130,
-  2597, -13699,  -3996,    800,   2499,  -1045,  -1512,   -186,
-   -59,   -119,  -5048,   6800,  -8766,    784,  -7091,  -1002,
-   335,   1993,  -1045,    601,   1804,    166,   1343,    110,
-  -224,   2247,   -344,     -5,  -4292,   5846,   8591, -11846,
- -1303,  -1027,   1759,   -168,   -194,  -1281,    489,    378,
- -5069,  -3321,  11238,   -375,   -806,   3962,   9660,  -2960,
-  -664,  -1067,   -627,    271,   1205,   1160,    261,   3725,
-  7877,   -679,     22,    598,  -1086,   -420,   2168,    -46,
--15552,    420,   1220,   1332,    -58,   -156,   7777,  -4657,
-   352,  15316,  -4760,  -2140,  -2577,  -1321,   2037,   -371,
- -1254,   -912,  -1177,  -1367,   -103,   4572,  -9482,  -1599,
-   294,    403,   -272,  -2331,  -4365,  13467,   4585,  -2554,
- -1743,    545,    162,   -369,   6074,  11273,  -8856,  -8175,
-  2543,     -7,    314,  -2033,   2704,  -1755,  -1431,   -791,
-  -276,   1085,    236,   6553,   1872,    387,   1056,    -31,
--20610,   -609,    608,   1007,   1604,  -1501,    -68,   -527,
-   204,    252,   2533,   -721,   1468,    444,    -72,     61,
-  -209,    512,   -216,     42,    385,   -490,   -104, -29030,
-  -166,  -4883,  -2754,    788,   -430,   -867,    565,  -1155,
-   562,   1076,   1757,  -2990, -14971,   8392,    902,    550,
-   102,  -6579,  -6939,   -319,    172,   -863,    979,   2178,
-   630,    160,    952,    946,  -3955,   1515,    352,   2557,
- -5339,   6166,   4588,  -2040,   4031,   -535,  -2504,   2782,
--12136,   1338,  -2758,    458,   -671,    155,   6998,  -2598,
-  -931,   -396,   -922,   2060,    447,    -42,   -649,   -532,
-  -552,  -1945, -16548,    815,   -408,   3469,  -4118,    875,
- -1017, -11150,   -511,   3846, -11349,  -1928,   -781,   2765,
-  -681,   -713,    655,   -218,  -8032,   -465,    295,   1591,
-  -383,  -1889,   1627,    108,   1149,   2513,    388,  -5702,
--15693,     24,    470,  -4322,   3721,   1584,   1808,    350,
- -1765,   -620,  -2953,   4354,   8512, -12533,    -86,  -2490,
-  -192,   -507,   2024,   3942,   -801,  13444,    738,  -2086,
-   162,   2013,    837,     56,   -384,   3164,   5052,   1158,
-  -403,  -6913,  -4290,  -2068,  16622,  -2738,    856,  -2884,
- -2432,   -410,  -1179,   -456,    504,  -1359,    436,    352,
- -6351,    327,  -2196,  -1502,    302,    338,   -839,    235,
-  -520,   1283,   2710,  18814,   2256,     -2,    400,   1300,
- -1185,   1024,  -3744,  -3542,  -4350,   -763,   1902, -14737,
-  5437,     48,  -1589,   -280,    -67,    232,   2276,   1413,
-  3284,   -308,   1013,    610,  22787,   -685,    724,     12,
-  -359,  -1651,  -1060,    569,    248,   3836,    605,   -413,
-  3380,  -1360,  -1120,  -2933,  -2368,   -977,  10135,  12356,
-  3739,  -1571,   -418,    580,  -2662, -11460,  -6128,   2867,
- 11468,    825,  -3201,   -501,   -138,   -755,   -554,    168,
-   757,   -564,    428, -12118, -15179,  -1978,    432,   -597,
-  1528,   3038,   -568,   1349,  -3377,    914,    498,    928,
-   -91,     -5,   9192,   3000,   2542,  -1411,    626,   2705,
-  -763,   3247,  13736,   3034,   2170,    -67,   -852,   -378,
-  1264,  -2771,  -2415,  -4236,    126,  -1984, -13336,  -1088,
-  -416,  -1979,   -520,   2506,  -1505,    294,  -2398,    218,
- -8740,  -3873,   2069,  -1374,     86,   -998,  -3851,   1070,
- 13357,    955,   3085,   -536,    166,    926,    299,   6532,
-  1324,   -502,  -1658,   1829,  -1263,    445,  -1902,   1452,
- -2747, -16422,   1875,   1773,    452,    288,   5992,   1626,
-  3659,   -917,   2255,  -1508,    356,    547,    158,      9,
-  -117,  -1665,   -595,  14392,  -1013,     49,  -4060,  12064,
-  3666,  -2903,  -9145,   -396,  -4341,   -953,   2758,   -178,
-  -204,   -462,     98,    222,  -3622, -12200,  -4484,    -94,
- -8642,  -5694,   4034,   -720,  -1695,    751,  -1668,   -266,
-  -343,    296,   -112,   -900,  -3750,   -360,   1002,  -7402,
-  7758,   7370,   3332,  -7517,   -769,  -1272,    412,  -1451,
-   -89,   -227, -11332,   -472,  -1108,   -394,   -339,  -1981,
- -3494,  12110,   -564,  -5958,   -690,  -1066,   -130,    762,
-   -50,  -1456,  -1521,  -8428,    994,   -867,   2650,  -2335,
-   354,  -2253,   4612, -12364,  -2626,   1853,    577,   -103
-},
-
-.cb4448s1 = {
- 25901,   -239,    648,    167,   -284,    198,   -340,  -1112,
-   -55,   -242,   -214,    528,    112,   -259,   -284,   -250,
-    23,    475,    780,   -558,    111,    148,  -2411, -19826,
- -1158,   2799,   -964,     44,  -1204,   1187,  -4036,   1872,
-  3541,    768,    159,   1979,   3382,   -113,    804,  -1021,
-  3708,  -2577,   9697,  11527,   -326,  -7058,   4306,   1260,
-  3782,   3370,   1595,    705,   2268,   2182,   1509,   1131,
-  9877,  -7260,   -258,     49,   1686,  -1472,  -2556,  -1973,
--22425,    338,    486,    963,   1069,    -34,  -1027,    -90,
-  -881,   -473,    554,  -6326,   -873,  -9744,  10157,  -1079,
-   584,  -1047,  -1954,   6204,   2416,   -899,   1452,    938,
-  -439,   -664,   4231,   9370,   7800,    170,   9448,  -4756,
-  1967,    686,  -1186,    636,  -1719,  -1244,   -540,   -728,
-   306,  -1778,  -7980,  -3418,   8318,  -1828,   1556,   3487,
- 10195,   3741,   -510,   2077,  -1496,   1241,    384,    477,
- -1051,   7922,  -4077,  -2513,    849,   -693,  -9170,   4264,
- -7940,  -1703,    460,  -2986,    586,     13,    377,    781,
- -7047,   6852,  -1350,   7537,   -493,  -1919,    379,   3108,
-  4293,   8467,  -3875,     63,     44,    493,   1496,  -1577,
- -5676,   3318,   6628,   5177, -11082,   1146,   3251,  -1159,
-  -461,    442,   1250,    212,    176,   3586,    137,  -9153,
--13772,  -8211,    393,   1170,   1717,   -671,    298,   -233,
-   883,  -1533,    401,    254,   7700,  -4827,    794,    377,
-  -376,  12240,   7298,   2445,   1168,   -562,   1528,    563,
-   421,   -606,      0,   5792,  -1069,    824,   3728,  -2729,
-  1005,   -730,   4318,    644,  17336,  -1588,   2100,   -365,
-   509,   -415,   3684,  -9128,  -1096,  -4278,   1549,  -1247,
-  5519,  11075,  -2216,   6004,  -3683,    409,   -730,   -414,
-  -263,  -6623,   8194,    489,  -9085,    334,  -1104,   -814,
-  1412,   1522,  -1657,  -7029,  -4142,  -1274,   -520,    -40,
-   650,  -1886,   9701,  11456,  -7567,   1176,   3268,   3016,
-  1109,   -117,   -858,   -155,  -1249,   -230,   -216,   3945,
-  9142,  -2297,    134,  -2563,  15131,    857,  -1597,   -618,
-   150,   -590,   -166,   -357,    388,    -69,  -8767,   2914,
-  1087,   4673, -14373,    600,    382,  -1893,    844,   -242,
-   544,   -106,    568,  -1141,    371,   2663,  -1860,   -725,
-  8066,  -1353,  -8743, -10433,  -1796,    427,    -73,    178,
-    96,    980,   -478,    978,   1767,   6034,    633,    966,
-   677,    -65,   -884,    417,    461,     62,   -868,     93,
-  -100,    519,  16304,   2646,  -1260,  12271,   -140,    142,
- 11138,   -892,  -2114,   -629,    172,    744,  -2056,   -960,
-    61,   -980,   2082,   -439,  -3126,  -2564,   1174,    -78,
-   254,   -178,   1599,   -436,  19023,   5335,  -1686,   -782,
-   520,  -8727,    256,  -3588,  -5694,  12323,  -2091,   1511,
-  -656,   3872,   2370,   -770,    282,    455,   -573,    -39,
-  7845, -12566,  12690,   -156,   -442,   -227,    575,   -274,
- -1717,    120,    -40,   1866,    635,    161,    270,   1039,
-  3256,   -673,  -3343,   4292, -14247,   7142,  -4821,   -591,
-  -418,    376,     21,    572,    551,     70,  -5536,     79,
-  2540,   -505,   -283,   -350,  -1279,  -1630,   2234,   -604,
-  5246, -17580,  -3022,  -1052,   -307,   6626,   2794,   1702,
-  1875,  -1876,   1011,   -320,   1268,   -282,   1072,  14370,
- -8206,   1218,    630,    173,   7486,  15176,  -6146,   4903,
-  -636,  -1341,   1360,  -1541,  -1012,   -778,     84,    426,
-  -124,   -746,   -252, -11085,   1783,  -2833,    809,   -744,
-  2194,   3328,   7029,  -5097,   4934,  -3025,   -641,    303,
-  -328,    258,   8674,     53,  -3395,    975,  -9944,  -8550,
-  3376,   -714,   1078,   1186,    598,    808,   -166,   -752,
-   484,  -5088,   1484,  -1278,  11394,  -1876,  -8236,   5159,
- -1830,  -1520,   2761,    592,   -204,  -1360,    454,    230,
- -5038,  -1582,  -5617,   1346,  -2045,   2306,  17764,    494,
-   572,  -1930,    339,    550,    784,    151,   -753,   4708,
- -3058,  -8267,   3281,  -1054,    870,  -1201,  -2005,   -920,
--10115,   5395,  -6423,   -798,    367,   -221,  -5296,  -2808,
-  8313,  -5077,   1655,   -200,    114,     46,    350,  -2374,
-   868,   -327,    377,  -9570,   1231,   9258,   8752,   3074,
- -4411,   -308,   2315,   6824,  -3303,   -896,  -1186,    579,
- -2561,   2280,    586,   -798,   4747,  -3487,   1306,  -1241,
-  -487,    -90,    -52,   3231,   -555, -17702,  -2681,   1649,
-   -17,   -278,   -647,  -4225,   2740,  -1248,  -3826,   1356,
-  3572,  -1010,  16160,   -422,    304,   3970,   1124,   -317,
-  -554,    673,  -1191,   3180,  -4429,   1581,   1543,  -2097,
-  4208,  -9363,  10146,   1896,   2904,  -4112,  -1428,   -207,
-   459,    -35,   5395,  -8960,   3141,  11004,    308,   3687,
-  1540,  -2156,   -592,   1640,   1003,   -280,    797,    204,
-  6910,   -824,   4724,   4729,   5553,  -3165,    483,    -12,
-    33,   -588,   -379,    402,   3543,  -9646,     74,   9603,
-  -465,   2872,  -2367,   -885,   2894,   -133,   2758,   -721,
-  3473, -13322,   1506,  -1344,    512,   1066,  -8300,  11391,
- 11976,  -1201,     13,   -612,    165,  -1823,    154,   -123,
-  1234,   -423,   -367,    -58,    384,   2687,   2536,    826,
-  6223,   1750,  -8589,   1126,   9772,  -6646,   2043,   1826,
- -1037,  -2018,    692,   -818,  -3431,   -467,  11006,   3407,
-   880,  -2047, -10303,   6168,   1428,   -307,    -18,    661,
-  -252,    754,   1207,  -2797,  -3057,  -6235,     99,   -931,
-  1618,    692,   2790,   -294,  -1200,  -5768, -11691,  -5305,
-  -100,    390,   -783, -11660,  -4675, -13570,   2764,   1414,
-  -786,    385,    163,    718,    794,   1118,    827,   -634,
-   -75,   6224,   3965,  -2092,  -1120,  -6395,   5474, -12986,
- -3985,    635,   -544,  -1877,   -191,      0,    121,    379,
- -3059,    132,  26320,   -721,   1262,   -706,    421,    -85,
-   -38,    665,    590,   -208,   -196,    168,     10,   1271,
-  -218,   -365,  -5843,  -5897, -12346,  -3026,   5916,   -115,
- -2671,  -1022,   -203,    962,    995,   -850,    527,   -516,
- -1641,    452,     68,   1204,    740,    385,     38,    752,
-   150,  -3088,  20608,    -54,    -39,   6109,   3224,    -92,
-  -315,   4407,   -306,   1317,   -395,  -1617,   9104,  -3493,
--10724,  -3059,    283,     81,  -9791,  -3210,   7307,   4459,
-  -639,    -61,   1152,   -184,   2290,    398,  -2902,  -2776,
- -1624,   1153,    242,  -8865,  -3617,    309, -11933,  -3847,
- -5750,   3235,   -153,   -315,    382,    209,   -923,   2072,
-   458,    164,   3631,   3121,   3220,   -828,  -8644,   2215,
-  3873,  12445,    533,   -631,    -53,   -136,   -728,   -240,
-   420,   2870,  -4981,    906,  -3272,   4735,   3613,   2412,
- -3951, -10587,   7389,    564,   3266,  -1348,    524,   1570,
-  6611,   3354,  -1042,   1862,   1860,  -1187,   5761,  -1722,
-  8231,  -7428,  -5662,   1239,  -2887,   -218,    810,  -1063,
- 15078,    686,  -2374,   -293,  -2031,   -245,   4441,   5045,
-  1100,   6722,   1787,   -587,   -380,    132,   5124, -12478,
-    95,  -1230,   1464,  -1871,    929,   1430,   2666,  -3768,
-  2784,  -3697,  -8238,   -247,    603,  -8406,   1330,   1033,
-  -743,  -2546,   2739,    856, -12698,  -4970,   2290,  -1104,
-    34,  -1048,    -80,    634,   -695,    -84,   2374, -24793,
- -1064,  -1080,   -254,   -812,    252,  -1582,   -401,    765,
-   847,    340,    479,  -3163,    150,   -187,   8432,   2607,
-  2075,   1384,    423,  -7361, -10262,  -2254,     54,   1065,
-    40,    857,   2014,  -5076,    198,    657,    482,   -422,
- -2185,   -850,   -318,    164,   -684,   2698,  -1008,  17493,
-   -64,  -6788,  -5966, -14352,  -2349,   2492,    266,   1077,
-  1935,    -99,   4270,   2319,  -2391,    779,    187,    -70
-},
-
-.cb4448m0 = {
--20455,    663,  -3140,   2540,  -2110,   -406,   1078,   1968,
-  -741,  -2458,    490,   -496,    338,    581,   1079,   -616,
-   154,  10097,    231,   -228,    477,     20,   1372,  11492,
- -1112,  -3148,    547,    248,   -676,   8197,   5902,  -1299,
-   519,  -2808,  11529,    -76,   1239,  -1032,   -542,    353,
- -1071,    278,    274,   2781,  -7741,   3260,   2711,    175,
- 12340,   1110,  -2348,  -5303,   1440,    581,    -70,    262,
- -9902,  -2375,    530,   1433,   1624,  -1475,   -947,  13450,
-  1318,  -1696,    207,    198,   1162,   -944,  -9329,  -1046,
-   195,   -106,    682,  14624,   -854,  -2410,   1054,    242,
-  -348,    581,    463,    716,    760,   2714,   1356,  -1359,
- 13089,   2565, -10523,   1934,    637,   1218,   1160,    830,
-   905,    272,    408,   -581,  -1426,    613,   2586,  -8186,
-  3748,  -6663,   4372,   -114,  -4644,   2998,  -9440,    685,
- -8741,   3363,  -5623,  -4229,  -7058,  -1201,   -822,   1806,
-  8671,   -856,   -612,   1165,   -426,    317,   6867,    -80,
- -7084,   1143,  -1862,   2742,    669,    550,     22,    173,
-  4301, -10406,   1042,   -346,  -1334,  -2897,    647,    744,
-    14,  -1338,  -1648,  -1235,   3550,   -455,   2125,   1188,
- 17136,   1188,  -6782,   -849,    298,  -1054,  -9254,    409,
- -1736,   1410,  -7254,  -1889,    457,   -740,     22,    262,
- 32242,   1657,  -2308,   2688,   -607,    609,      4,    150,
-  -264,    192,   -140,    246,   -393,    -76, -15050,    390,
-   969,    457,   1436,   -649,    460, -12150,   1359,   1014,
- -2103,   -576,     55,   -590,    113,  -1410, -23431,    182,
- -2386,  -1568,    904,   -218,   -281,   -188,   -178,     63,
-   211,    549,    687, -12069,    -88,   -654,  -1070, -13155,
-  -124,   -697,    438,   3174,   1700,    270,    234,   -289,
-  -625,  15749,  -2340,   8466,    397,  -4460,  -1030,   3206,
-  1081,  -1317,  -1030,    -72,    487,  -1477,  -8782,   6984,
- -1221,   2395,   3198,   2995,   5862,  -1195,  -6075,  -1020,
-  -934,    868,   -470,  -1024,   1202,   -998,  -1306,  22118,
-   344,    540,  -3137,   -547,   2440,    -28,    222,    372,
-  -424,   -199,   1068,   -917,   -105,  -4278,     52,   -299,
-  6933,  11715,   -520,  -2853,     58,  -8575,    416,  -1272,
-  1128,    -32,  -1140,  -1873,   -495,    235,   2079,   -314,
- -1328,  -2615, -20194,    848,  -1553,    387,  -6091,    906,
--10180,   8634,   -506,   4078,    318,  -2657,   1612,   -126,
- -1424,     -4,  -1745,   -343,    302,   2439,  12190,    941,
--12534,  -4756,   -176,    -90,  -1295,   1041,   1875,   -450,
-    89,    212,   2098,   1708,   1876,   4065,   1682,   1972,
- -4916,   -951, -10683,   1443, -10978,    772,  -1013,   -235,
-    59,    213,   -230,    142,   -576,    506,    101,     44,
-  -137,  26238,    -47,   -322,   -289,    281,   2614,  -4538,
-   634,   1116,   1191,   2985,   -759,  -5527,    550,   2107,
- -6018, -11013,   -425,   -221,    901,    217,    546,    213,
-  2026,    695,   1074,  -2132,   -173,  -1664,   -783,  25065,
-  -326,     86,   -632,   1398,   4708,  -2911,   2376,    135,
- -1471,   -904,  -2338,    987,   3216,  -4564,    314,  15692,
-  -214,   1238,    230,   -181, -30537,   -294,    155,   -607,
-   218,   -309,   -180,   -246,   -102,   -988,   -644,    111,
--10517,  -1604,  -1180,  -2748,   1191, -12959,     -2,  -1004,
-    28,   -196,   1974,   -790,    809,   8802,  -1204,    332,
-   180,  -3857,   1025,  -5998,  -9578,     94,  -1069,  -2398,
-   185,    643,  -1479,    322,   2544,  12584,  -8308,  -3856,
-  1286,   1600,  -2539,  -2752,  -2520,   -367,   -942,    417,
-  -309,  -2162,   2044,  10886,   1764,  11028,   3810,   2955,
- -1028,  -1017,  -1752,   -487,   -605,     48,   2312,   -368,
- -1758,   -252,    371,  19882,  -1994,   1675,   5494,   -660,
- -1669,    256,    -54,   -941,   4318,   -306,   2143,    273,
- -3367,  -3088,   6509,  -1884,  -5400,   -576,  11394,    875,
-   455,    271,   -218,   1401,    -44,  -5336, -12170,   4664,
-  -589,  -3562,  -1934,   5842,   1357,   3232,   1449,   -402,
--11228,    -96,  -1509,   2073,  -1751,    776,   -439,    775,
- -3302,  13521,   -325,   -118,   -172,    411,   -396,   6154,
- -2455,    -52,  -4616,    783, -12488,  -2085,   5817,  -1278,
-   635,  -1713,   2888,   -830,    649,   7482,  10134,   9147,
-  3784,   1046,  -1934,  -2580,    102,   -679,   -124,     68,
-   657,    417,   -175, -32768,    -80,    375,   -941,    224,
-   271,   -232,   1519,    -99,   -680,     67,     66,   -618,
-   252,   1907,   5121,   2456,  -2117,  -9388,  -1441,    636,
-  7868,  -8340,   1939,   1340,   1511,    711,   6530,  -1748,
-  -183,     90,   2561,   5860,   -364,   5117,  -4101,  -4028,
-  -944,  10526,  -1028,   1047,    707,  12116, -12596,  -4006,
-   922,  -1047,    348,   -971,   -272,  -2388,    435,    246,
- -1055,    148,  -1852, -12418,  -2531,   3524,   4103,   -344,
-  1667,   2818,  -4576,   -273,  -8337,    183,    497,   -144,
- -9845,   -292,   -503,  -1212,   4316,  -1434, -11058,  -3043,
- -5817,   -981,    813,      0,   -718,   -467,  10285, -19005,
-   -82,    776,   1192,   1030,   1560,   1080,   -144,    729,
-   606,   -225,   -389,   -187,    552,   -930,   -444,  -5959,
- -1960,  -1315,   2650,  -1282, -18790,   1772,    263,   1410,
-   812,   -458,   -476,    744,   2595,   -426,    -19,   9119,
-  4529,  -1502,   4673,   3675,   7430,   1084,  -6966,   -518,
--13552,   1054,   2474,  -9499,   1041,   5114,    442,   2927,
-   511,  -1492,    217,   -726,    398,   -522,     35,    119,
-  -332,    106,    816,    437,  -1223,  27612,    521,    -29,
-  -462,    367,   -966,    476,  -2559,  -3485,   -160,   1487,
-  -272,   -586,  -6014,   -232,   3679,  -1864,   1244,    575,
--14591,   -483,  -1428,     20,   7874,  -2948,  -5965,   2383,
-  3270,    490,   2750,   -547,  -9658,  -1473,    943,    285,
- -2388,   -772,  -1582,   3181,   3419,   2628,   -197,   3376,
--13282,  -7684,   3383,     70,  -1174,    -70,  -6703,  -7305,
-  -553,   3588,   -826,    -12,   7350,  -3604,    345,   1098,
-  3856,    918,   2038,    -39,  11514,  15798,   1327,   1158,
-   436,   -918,     71,    953,    975,   1147,    174,    411,
-  1467,     83,  -4536,  -1511,   5350,  -3314,  13999,     18,
-  4107,   1901,    834,   2614,   2356,   -369,    943,   -341,
-  -460,   4380, -10014,   3308,  -3541,  -3225,   -621,   8449,
- -1383,   4481,  -1399,  -3646,   -936,    923,    221,    346,
-  7828,   2406,   3021,  -4993,   3012, -10903,  -1925,   8153,
-   382,  -1453,   1238,    601,   1195,  -2245,  -2792,  -4118,
-   473,   4898,  12961,  -6094,   5905,   1368,  -2754,   -303,
-   768,    -31,  -1275,   1400,    596,  -1326,    619,  -1744,
-  1145,  -3977,    639, -10785,  -1693, -11192,   -541,   -434,
--11384,  -1017,  14361,   1398,    521,  -3239,   1851,   -491,
-   237,  -1024,   1002,  -3002,   -303,    -33,  -6532,    601,
- -3726,   7832,   6090, -10107,    957,  -1149,    689,   1327,
-   -51,   1945,    990,   -106,    595,    234,    518,   1060,
-    77,    837,  28880,    -91,   -395,   -275,   -265,   -279,
-  -217,   -300,    240,  -1055,   -406,   4314,  -2139,   6349,
- -2227,  -5996,    963, -10386,   4629,   -560,   1080,    134
-},
-
-.cb4448m1 = {
- 31577,  -1322,   1533,  -2224,    253,  -1485,    -92,    294,
-   183,   -580,    420,    172,   -794,   -206,   -342,   -338,
-    53,    -85,   -920,  29517,   1073,   -972,  -1839,   1004,
-   290,     46,    460,    -71,   -988,   1731,   -362,  -2070,
-  3848,     -2,  -3842,    734,  -1221,  -8012,   1104,   6782,
-  9673,   1082,  -8561,   -860,  -2135,  -1557,  -1613, -13999,
-  1664,   2268,  -1570,   -732,   1010,   -402,  -1139,   -428,
-   400,   1123,  -2108, -11776,   -345,  10608,   1245,  -3142,
- -3244,  -1132,   1700,   -308,   1573,    543,    678,   5160,
- -3062,    433,   2703,   -852,  -4903,  -1880,   1706,  13995,
-  2465,  -4844,   -904,   -148,    350, -11168,   1406,    312,
--11900,    397,    769,   5558,  -1354,    187,    -30,    231,
- -1020,    202,    884,   -198,  -3151,   -830,  -8490,   -670,
- -2767,   1517, -12957,  -3861,  -2794,  -1854,   -180,    135,
-  7140,   4103,  -4427,    450,    494,  -1033,  -1110,  -2857,
- 11056,   -711,   -800,   3628,   -180,   -852, -10300,  -2120,
-  -450,  14464,   -511,    303,  -1464,   -542,    -89,   -204,
-   500,   -400,   -318,    569,    216,    428,    350,   1973,
-  -137,   -885,  -1794,   -974,   3977,   3382, -18624,   -420,
- -1947,    165,   -449,   1395, -17313,   -286,   2054,   -447,
- -2740,  -1881,   -550,  -2166,   1360,  -6021,    -94,    148,
-   676,  -1619,  -1737, -11977,   -169,  -1664,  -7709,   6202,
- -5954,   1681,    715,   -263,     56,    369,    589,    564,
-  1989,   1617,  -1648,   9205,   1343, -11508,  -7379,  -3791,
- -3136,   1049,   -844,     24,  -6714,  -1736,  -5734,  -2907,
-  5016,   2167,  -5722,  -1210,   6232,    428,   2467,  -3334,
- -1477,   -711,   6728, -10274,  -4930,  -6224,   -349,   -710,
-  1598,   -713,  -1708,   -497,   -254,    567,   -884,    131,
- 11520,   -908,  -1425,  -1862, -13449,  -1590,   -669,    657,
-   505,    236,     -4,     21,    846,    100,   8248,  -1847,
-  -131,   -186,    181,   -806,   3293,  -1072,  -1208,  14492,
-  1555,   1527,    544,   -120,   -258,      6,  -2401,  12455,
- 10880,   1091,  -2350,   -939,  -1252,   -564,    150,   -114,
-  1419,    737,  -1732,   -440,  -2303,   -226,    536,  -2492,
- -1085, -10117, -11013,   3786,   5275,    -10,   2479,    143,
- -1647,  -7945,    884,  -1618,   2056,  12890,   -424,   5986,
- -1471,   -666,   -570,  -1466,   -499,     64,    566,  -1738,
-  -639,  11380,   -612,   1879,   1550,  12469,   -299,  -1501,
-  2634,   1036,   3020,    -13,  14974,  -2066,  -5786,  -2667,
-  5487,  -6768,    468,   -385,    778,   -805,   -536,   -304,
-   718,    386,    285,   7546,    643,   1462,    913,   4707,
-   941,  -3338,   -194,   6669,  -4493,   8869,   -837,    400,
-  -877, -11113,    326,  -2318,  13683,  -1304,  -1966,   -933,
-   312,    128,    470,   -296,   -322,    340,  -1126,   1811,
-  1999,   2885,   3201,    331,  -2494,   3999,    660,    -80,
- -2063, -16771,  -1337,    426,   4884,  -6026,    -40,   2093,
-   342,   -176,     83,    134,    796,   -425,  -8934,   2100,
-  8550,    160,   -221,   -252, -32714,   1306,   1332,   -609,
-  -109,    547,    848,    518,    -40,    303,   -246,   -451,
- -2177,   -716,   -750,      1, -21232,   1287,  -1303,   2051,
-  1659,   1501,   -369,  -1415,    274,    308,    260,    371,
- -1409,   -662,  -7347,   7161,   3656,  -1104,   8862,  -5671,
-  1370,   1122,     16,   1132,  17593,   6778,   -993,    613,
-  -665,   3004,   3288,  -1625,  -1823,  -1003,    740,  -1002,
-  -888,   -677,  -1065, -25294,    997,   -160,   -180,   -811,
-   188,   -333,  -2483,   -696,   1309,    120,    456,   -116,
- -2020,   -896,   7216,   6328,  -9170,   8407,  -2986,  -1684,
-   680,   1752,   -684,    613,    337,   -629, -11750,   -493,
-  -324,   -907,   -391,   1053,  14125,    142,    420,  -1917,
-  -378,  -1428,    -90,   -497,   1116,   -464,   2170,    805,
- -1572,   -904,  -9020,   -534,   6450,   -490,  10750,    279,
-   765,    961,  -3985,  -2702,   2423,  -4981,  -1222,   1654,
- -1089,  -2157,   1940,  14331,   -895,   1726,   1555,    122,
- -3552,   1274,   -598,   -910,   3056,  -1704,   6430, -10626,
-  1014,  -8773,   1009,   1936,   -360,   -468,  -1029,  -8841,
-  -625,   2212,   2234,   2720,   1190,    -64,  -2078,   4688,
-  8690,   5150,   -450,    744,   -796,  -5661,   -332,  -7938,
-  2670,  -4054,   1377,  -1594,  11554,  -4702,  -3631,    745,
-   742,    -90,  -1311,  12528,  -4664,    834,   -853,   1542,
-  8560,   2209,   4091,   2876,   2117,   -678,   1684,    785,
-   304,   7980,   2126,   -302,   8239,  -2105,   1584,  11894,
- -1055,  -1391,    596,   2343,     86,    388,  -1348,  -1007,
-  1428,    413,  -9231, -10312,  -7346,  -1108,   1385,  -1255,
- -3954,    738,  -1258,    410,    226,  15115,  -1059,  -4117,
-   -50,   -504,  -1726,   1425,  -9974,   -346,    688,    464,
-   244,   -586,  -8880,    845,   -659,    932,  -1309,    290,
-   -29,   -417,  -2184,   1011,  -9622,   1443,   9009,   1945,
-  2698,   -708,  10572,   2410,   1200,   4492,  -2569,   1444,
-  2735,  -8604,   2274,  -4057,    478,   -199,   1285,  12695,
- 12321,  -2933,  -1708,   1198,    675,   -492,   -560,    -52,
- -1261,     85,   -480,    -96,    696,   -764,  -1402, -31368,
-  -580,   -675,  -1678,    -58,    600,   -522,   -292,    647,
-   -36,    154,  -1148,    437,   1561,    588,    603,   7629,
--16973,     29,   -828,   -589,   -919,  -1372,   -470,   -445,
-   428,    528,   5828,   -353,    -32,  -1781,   -702,   -690,
- -7196,  -3253,   1942,   4600, -12102,   -674, -10480,  -2336,
-   711,  -2174,  -7474,  -1436,   -451,  -7133,    856,  -2652,
-  1892,   3464,   -546,    676, -13296,   -516, -13618,   -997,
-   938,   1686,   1006,   1358,  -1371,    922,    534,   -170,
-   126,    255,   -835,     50,    945,  -1066,  -1676,      3,
-  1038,   -437,  26030,    418,     27,  -1092,   -493,   -428,
-  -606,  -1097,   -628,    298,    295,   -806,    183,    146,
-  1352,    -84,   -722,    833, -25667,   3176,   1001,   -322,
- -2339,     15,   -475,  -1257,   2116,    876,    637,   -529,
- -1108,    302,  -2452,  19734,     58,    851,   9845,   1142,
-  2168,    706,  11070,   1556,    544,   3002,   2238,  -3974,
-  2738,    -48,  -8324,  -2186,   -355, -14933,   2192,  -2481,
-  2700,    473,   -486,    761,   -208,     76,    -78,    102,
- -4896,   1378,  12377,  -8269,     28,   1092,  -5071,  -1500,
- -1190,   -804,   1085,   -766,    493,     22,  -1041,   9136,
- -1234, -12247,    967,   2672,   -883,   4582,   4871,   1891,
-  -532,    329,    226,    446,  -6710,    312,   -914,   1416,
- -1852,   3052,   6512,   8971,   5544,   6519,   -579,   1021,
-  -241,    911,    782,  -3456,  10158,  -1865,   3941, -12300,
-     8,    472,    882,  -1580,  -1799,  -1025,   -631,   -127,
--15316,   8047,   -200,  -1860,    582,  -4363,  -1274,   1085,
-   -48,   2383,    638,    480,    369,   -838,  -1341,    414,
-  -114,   2757,   1222,  -2194,  -3394,   6469,   2418,    738,
- -1656,  15594,  -1090,    202,    727,   -769,    484,   2462,
-  4875,   1656,  -3835, -16877,   5276,    239,    982,  -1872,
-  -130,    901,   1352,   -155,   4939,  -8317,   9000,   2503,
-   485,   1184,   -548,  -1356,  -7482,   -188,  -1587,    496
-},
-
-.fcb08l = {
- -2539,  -3275,  -2699,  -3345,  -2843,   5501,    426,   7127,
-  -149,   3111,  -2991,  -2297,  -2345,   2702,   -969,   -946,
-  2837,   1114,   1800,   1271,  12249,  -2282,  -2309,   1566,
- -2889,  -3020,  -2083,   3586,   8919,   2651,   4111,  -1842,
- -1588,  -1428,   3251,   -102,    156,   -320,    722,   1711,
- 20565,  -3068,  -2211,  -3164,  -3410,  -3396,  -2882,  -2002,
-  1730,   4077,  -2696,  -1694,  -2839,   2948,  -2739,  -2380,
- -2252,  -1311,   -269,   1900,  -2796,   -444,  -2996,  -2525,
-  5194,   1459,   5042,  -1089,    914,   4116,   7644,  -3137,
- -3156,   4028,  -3435,  -3240,  -2585,   5542,   5119,   9885,
- -2995,  -3153,  -3449,  -3101,  -3551,  -3469,  -2196,  -1271,
-  3869,   5413,  -2800,  -1990,   3371,  -2286,  -1022,   3190,
-  -550,   1723,    968,   1916,  -2749,  -1530,  -2211,  -2987,
- -3357,  -3262,  -1042,  10277,    107,   2662,   9819,  -2753,
-  4269,  -3277,   3125,  -3131,  -2974,  -3251,   6466,   9484,
- -2034,  -2707,  -2424,  -3170,  -2619,  -2278,   -143,  -1641,
- 11856,   5975,  -1282,  -2629,  -2396,  -2364,  -2012,  -1085,
- -2576,  -2422,  -2206,  13731,  -2261,   2751,  -1768,   2482,
- -1065,   -347,   -137,     31,    619,    385,  -2257,  -2215,
- -1698,  -2686,   4468,  -2563,  -1071,  -1359,   7757,   3732,
- -2856,   9018,  -2046,  -1494,  -2234,  -2209,    -67,   1340,
-  2433,   2965,  -2722,  -2151,  -2966,  -2780,  -2732,  -1509,
- -2085,  -1532,   6934,  -1248,  -1936,  -2203,   -787,  -1781,
-  -895,  -1990,   4693,  -1818,  -1569,   1954,  -2283,  -2403,
- 10514,  -3105,  -1074,  -2838,     -1,   1192,   1113,   3309,
- -2249,  -2451,  -1660,   2535,  -1439,   3582,  -1093,   -594,
-  1956,    758,   5349,  -2524,  -2320,  -1903,  -2055,   5075,
-  -941,   -721,   -536,   2197,  -2309,  -3027,  -1460,  -2911,
- 11344,  -2474,  -1601,  -1749,   3260,   2547,   3819,  -1247,
- -1449,   2835,  -1118,   -652,   -516,   -379,    531,    440,
-  -569,  -2606,  -2545,  -2447,  -1685,   8678,  -1868,  -2003,
-  -992,   5888,   8591,  -1848,  -2010,  -2196,  -2049,   -658,
-  3473,    214,    905,    317,  -2050,  -1083,  -2593,   8754,
- -2234,  -2449,  -1688,   2194,   2244,   2502,  -1659,  -2748,
-  4584,  -3011,   3702,  -2307,  -1887,  -1960,  -1068,   2889,
- -3022,  -2989,  -2295,  -2794,   3071,  -1588,    -43,   2627,
-  1278,   2031,  -2145,  -2551,  -2333,  -3205,  -3237,  -2760,
-  9082,   -454,   4339,   1776,  -2738,   4785,  -2176,  -1896,
-  2148,   1350,    768,    249,   1001,   1499,    797,  -2182,
- -1443,   -229,    -32,    827,    401,    270,    581,    380,
- -2370,  -2376,  -2679,  -3099,  -1742,  -1149,   4666,   -693,
-  1109,   7547,  -2496,  -3063,  -2818,  -2621,  -2016,   5722,
-  4932,   1217,   2161,   2449,  -2207,  -2954,   3769,  -2824,
- -1809,  -2946,  -1693,   -377,   1565,   4100,  -2947,   3063,
- -3062,  -2919,  -3093,  -2520,  -1712,   2383,   1305,   1867,
- 10145,  -2912,  -3307,   7519,  -3502,  -1063,  -2782,   8595,
-  -750,  -1503,  -3141,  -2486,   2923,  -2574,  -1826,  -1244,
-  3537,   2494,   2583,   1560,  -2722,   3284,   2245,  -1258,
-  -658,   -394,    483,    719,   1121,   1073,  -2949,  -1013,
- -3048,    597,  -3103,  -2510,  -1970,   7207,   8635,   1917,
- -1772,   -483,  -2318,  -1860,  -2500,   2981,  -1651,    550,
-   696,    615,  -2121,  -2055,  -1619,  -2126,   3108,   3417,
-  -485,    -47,    848,   1608,  -2636,  -1707,   3142,   3798,
-   479,  -1112,    597,   -323,   1555,   1531,  -2930,   2106,
- -2398,  -2314,  -1835,      0,   2920,    896,   2356,   1259,
- -2911,  -3184,    593,  -3570,  -3389,  -3263,   7340,   7640,
-  6874,   6549,  -1912,  -1334,  -1749,   -568,  -1718,   -405,
- -1375,   3456,  -1024,  -1903,   9384,  -2721,  -2485,  -2377,
- -3026,   -899,  -3133,  -3032,  -2452,   7715,   2492,  -2450,
- -1721,  -2138,  -1497,    -55,    760,   2382,   1183,   1105,
- -2782,    389,  -1528,   -927,    664,   -531,   1405,    363,
-   582,   -292,  -1678,  -2718,  -2763,  -3140,  -2799,  -2178,
- -2715,  -2592,   -972,  -1226,   3278,  -1173,   2916,  -1548,
-  -446,  -1241,   -209,    379,    689,    538,   3110,   2857,
- -1735,  -1244,   -589,   -413,     65,    471,    522,    323,
- -2043,   -212,   1309,   -471,   -564,    -16,    378,   -320,
-  -437,    228,  -2194,  -2637,  -2513,  -2670,  -1863,   -954,
- -2082,  -2398,  -2270,   5563,  -2959,  -2444,  -2794,  -1736,
- -1631,  -1324,   1482,   -481,   2317,   1470,  -2871,  -2007,
-   702,  -1980,   -491,   -146,   -695,   -145,   2817,   1268,
- -3395,  -3456,  -3069,  -3433,  -2874,   -205,    806,   3038,
-  3806,   2623,  -2954,  -1861,   -712,   1017,   -326,     44,
-   -93,    910,    775,    346,  -2625,  -2570,  -2974,  -2344,
- -2712,  -1930,  -2213,   3521,  -1341,   4327,   -141,    835,
- -1119,  -1336,  -1092,  -1891,   -860,   -727,    315,   2562,
-  4119,  -2638,  -2584,  -1951,  -2710,  -2499,  -1561,   -952,
-  2821,   2505,  -2388,  -1855,  -2926,   1742,  -2563,  -2655,
- -1802,   3082,   3063,   2456,  -3304,  -2670,  -2147,  -1504,
-  -309,   1421,   1661,   1546,    560,    615,  -2590,  -1593,
- -1523,   2025,   3167,   -841,   -356,   -648,    309,   1165
-},
-
-.fcb08m = {
- -2962,  -2140,  -2166,  -1454,  -1638,  -1100,   -835,    686,
-   978,    550,  -1630,  -1021,  -1424,  -1867,  -1118,   -474,
-    66,   6104,    904,    603,   -829,   -475,  -1368,  -1199,
-  7255,   -890,   -465,    114,    118,    224,  -2453,  -1279,
-  8192,  -1289,   -452,    -47,    180,    324,    627,    209,
- -2770,  11214,   -857,  -1720,   -895,   -531,   -291,   -264,
-   232,   -402,  -2699,  -2561,  -2433,  -2093,  -1315,     86,
-  2666,   1663,   1351,   2349,  -2788,   4576,   3680,  -1365,
-  -995,   -513,     46,     44,    522,    142,  -2739,  -1654,
- -1950,   4573,   -659,   -536,    285,     72,    875,    627,
-  3142,    105,   -941,   1245,   -489,   -495,   -229,     44,
-  -236,  -1083,  -2336,  -1193,  -1620,  -1859,  -1339,   -655,
-   205,   1032,   5581,   1195,  -2635,  -1740,   2656,   1976,
-   -52,    784,    -96,   -165,    419,   -486,   8850,   -624,
-  -792,  -1531,   -765,   -674,   -730,   -829,   -150,    -27,
-  2255,  -1177,   2727,  -1430,    737,   -902,   -780,   -729,
-   169,    278,   3729,   3763,    -32,  -1581,   -563,   -573,
-    77,   -372,    -64,   -477,  -2500,    526,  -1682,   1464,
-  -830,   -124,   -548,    561,    202,   1115,  -1682,  -1552,
- -2014,  -2127,  -1374,   -749,   -720,     64,   2097,   6944,
- -2771,   4929,  -1680,  -2212,  -1430,   -801,    114,    891,
-  1176,    855,   3571,  -2187,  -1566,  -1694,     84,    -46,
-   932,    786,    765,    856,  -1038,   -498,   -117,  -1582,
- -1379,  -1162,   6293,   -367,    594,    132,  -2487,   2119,
- -2153,  -1749,    833,   1089,    507,    133,    337,    423,
- -2777,   2507,    277,  -1455,  -1019,   1811,    639,   -595,
-   136,  -1050,  -2941,   4474,   -176,   1095,   1113,   -479,
-   182,   -295,   -229,   -605,  -2035,  -1649,  -1171,     51,
-     0,    125,   2844,   -310,    -82,   -640,  -2251,  -2138,
- -2270,  -1567,   2260,     92,    368,     95,   1433,   1346,
-   820,  -2339,  -1822,   -895,    -69,    158,    190,    911,
-  1008,    764,    684,  -1756,  -1013,  -1625,  -1610,   6062,
-  -499,  -1036,   -139,   1129,    488,    524,   -665,   -870,
-  -347,    -76,    123,     91,    -12,     14,  -2867,  -2019,
-  2858,  -1903,  -1165,    309,    287,   1250,    767,    776,
- -2784,  -2446,  -1157,    460,   2589,    437,   -285,    711,
-  -299,    402,  -2683,  -2271,  -1714,  -1535,   -547,   4118,
-   510,   1158,    700,    631,  -2084,  -1236,    509,  -1009,
-  -510,   -193,  -1075,   -793,    727,   2150,  -2722,    968,
-  1077,  -1579,  -1410,   -894,    401,   1043,    427,    182
-},
-
-.fcb08s = {
- -2368,  -2340,  -1735,  -1897,  -1493,    984,   3062,   2826,
-  1049,    164,   1181,  -1990,  -1833,  -1720,  -1360,     24,
-  1485,   1923,    460,    511,     69,     78,   -353,     -3,
-  3761,   -480,  -1538,  -1063,    540,    -64,  -1546,   -988,
-  1514,  -1167,  -1354,   -563,   1435,    880,   1123,    182,
- -2243,  -2109,  -2378,  -2201,  -1491,   -836,   -124,    605,
-  6159,   3636,  -2770,  -2959,  -2956,  -3019,  -2154,   -648,
-  1805,   4698,   2929,   2078,   -975,   -360,   -895,   -623,
-  -593,   -879,   -345,   4333,    492,    -56,  -2102,   -781,
-  -476,   1268,    606,   -670,   1686,   -105,    370,    461,
-  -221,   -868,  -1381,    297,    128,   -578,   -809,   -938,
-  3896,    490,   4032,   2675,   -684,  -1108,  -1235,   -915,
-  -874,   -919,   -802,  -1040,  -1324,    -16,   2156,   1943,
-  -652,   -666,    -47,  -1499,    168,   -210,   4213,  -1895,
- -1734,  -1767,  -1412,   -867,    -71,    329,    855,   1294,
- -1849,   4393,  -1312,  -1597,   -564,    434,   -454,    269,
-   892,    -31,  -1170,     67,    370,  -1144,   -320,   3706,
-  -811,   -190,   -123,   -166,   -659,  -1033,   -789,   -902,
-  -347,   -280,   -108,   -313,    452,   3701,  -1505,  -2610,
- -2758,  -2550,  -2034,  -1361,   -676,    713,   2263,   8286,
- -2241,  -2508,  -2540,  -1721,    182,   1947,    306,   1773,
-  1220,   2909,    -60,     73,   -235,  -1631,  -1302,   -692,
-  4171,   -830,     49,   -188,   -471,  -2208,  -2265,  -1518,
-  -196,   2995,   2571,   -579,    -68,    805,  -1294,   1274,
-  4294,  -1356,   -702,   -532,   -465,   -123,   -400,   -719,
-   336,   3093,   1634,   -906,    -71,   -502,   -938,   -982,
-  -742,  -1187,  -1757,   2890,  -1591,   1303,    216,   -311,
-  -404,    -29,    501,   -543,  -1466,   1587,    309,   -578,
-  -173,     34,   1116,   1286,  -1184,  -1174,   -175,   -732,
-  -619,   3508,    -80,    191,  -1059,   -174,   -429,   -470,
- 10000,   -933,  -1511,  -1601,  -1571,  -1445,  -1065,  -1407,
- -1053,   -932,   1183,   7875,   -460,  -1609,  -1618,  -1398,
- -1154,  -1227,  -1012,  -1450,     20,     28,   -235,   -110,
-   203,    105,    252,   -154,    -51,    -58,   2940,   -490,
-    17,    -51,    131,   -106,   -526,   -566,   -822,  -1177,
- -1335,   2749,    608,  -1575,  -1322,  -1351,    111,    641,
-  1441,     -9,    733,   -207,   -273,   -665,   -630,   -588,
-   -78,    254,    304,    762,  -2661,  -2677,  -1238,    -82,
-  2569,   3001,    932,  -1032,    211,   -324,     40,   1395,
-  -836,  -1119,   -635,  -1425,  -1514,  -1135,   1509,   2963
-},
-
-.fcb11l = {
- -3004,  -2927,  -2672,  -2356,   -735,    179,    950,   1734,
-  1101,   1641,  -1610,  -1161,  -1606,   -179,  -1634,   3383,
-  -610,    240,     73,   1128,    818,  -1052,  -1641,    724,
- -1938,  -1741,  -1211,   3967,   1988,   1445,   3010,   2203,
- -1685,  -1698,  -1838,   -759,   -144,    515,    999,   1215,
-  3239,  -1912,  -2048,  -1739,  -1488,   -148,   1590,   1370,
-  1066,   1270,  -2721,  -1637,     99,  -1964,    224,   -946,
- -1437,   -954,    755,   1420,  -2800,  -2211,  -2304,  -2048,
-  4853,   -714,   -383,   2159,   1823,   2328,  -1619,  -1584,
- -1839,   5462,  -1703,   -802,   -227,    485,   1017,   1695,
- -2459,   2399,  -1820,   2254,  -1373,   -767,     53,    705,
-  1074,   1293,  -1582,  -2486,  -2208,  -2341,  -2264,  -2132,
- -1578,  -1043,    322,   7685,  -2198,  -1768,  -2106,     16,
- -2207,  -1495,  -1106,   -961,   -482,   1642,   6785,  -1540,
- -1540,  -1449,  -1177,   -854,   -307,    853,   1279,   1449,
-  3253,  -1427,   2314,  -1473,   -985,  -1025,   -321,    923,
-  1140,   1166,  -2704,   2664,  -2444,  -2717,    481,   3083,
- -1449,   1225,   3168,   2389,  -2124,  -1981,  -1342,  -1939,
- -1904,   4736,   -885,   -826,   3866,   2046,   -290,   -567,
- -1986,  -1880,   1966,   -465,   1638,    683,   1005,   1099,
- -2842,  -2537,  -2559,  -2427,  -1243,   4039,   1371,   3897,
-  2529,   2400,  -2586,  -1328,    785,  -1697,   1733,   2382,
-  -442,    190,    901,   1281,  -2669,   2198,  -1502,  -1404,
-  2593,   -694,   -186,    466,   1065,   1199,  -1905,  -1389,
-  6171,  -1817,   -513,   -989,   -356,    246,   1619,   1883,
-    36,  -2178,  -1602,    608,  -1523,     23,   1265,    578,
-   953,   1038,   -483,  -2278,  -2138,  -1740,    584,    244,
-   -54,   -192,    915,   1097,   -213,  -1569,   1861,  -1401,
-  3686,  -1625,  -1234,   -614,    860,   1311,  -1397,   2315,
-  1896,  -1608,  -1326,  -1487,    -99,   2241,    697,   1156,
-  1711,  -2099,  -1507,   -135,   1422,   -695,    -57,   1390,
-   823,    937,   -122,    479,     47,  -2144,  -1514,    955,
- -1317,   -726,    480,   1153,  -2959,  -2558,  -2573,  -1355,
- -1879,  -1446,   6435,    677,   3124,   3134,   1850,   1834,
- -1396,  -1417,   1290,   -896,   -561,   1428,   1007,   1105,
- -2101,  -2044,   1779,  -1913,  -1868,   1410,    916,   1232,
-  1112,   1335,  -2663,   -104,   -513,    -96,   -470,    480,
-  1516,   -150,    298,    714,  -2558,   3076,    468,   -745,
-  -945,   -443,   -849,   -989,    341,   1102,    433,    588,
- -1772,    462,   -527,    670,   -128,   -108,    583,    701,
- -2281,  -2149,  -2398,  -2749,  -2557,  -1691,  -1095,   1336,
-  9088,   3844,  -1799,  -1861,  -1908,  -2242,  -2184,   2313,
-  3779,   -809,    519,   2229,  -1914,  -1673,   1764,   -634,
- -1955,  -1721,    405,   -499,    243,   1632,  -2377,   7289,
- -1659,  -1752,  -1341,   -948,   -323,    841,   1703,   1774,
- -2029,   2384,  -1877,  -1918,  -1729,   1483,    483,   1916,
-   576,   1258,  -2310,  -1796,   2208,  -1579,     57,  -1735,
- -1161,   5177,   1674,   2468,  -1907,  -1499,   1868,   2275,
-  -620,   -356,   -228,    489,   1064,    849,   -683,  -1204,
- -1761,  -2211,   -606,   -764,  -1056,   3888,    253,   1518,
- -2555,  -2075,    119,  -1567,    971,  -1178,   2683,   1476,
-   978,   1419,  -2947,  -2418,  -2164,   1178,   1582,   1470,
-   896,    645,   1671,   1462,  -2234,  -1363,  -1184,   1408,
-  1042,  -1091,   -208,    -49,    527,    917,   1266,  -1444,
- -2174,  -2447,  -2300,  -1732,   3076,   5631,    248,   2195,
- -2477,  -1724,  -2434,  -2477,  -2524,  -1828,   2331,    845,
-  1423,   1767,  -2393,  -1946,   -857,   -462,    344,     17,
-  -896,   2391,    892,    882,   -828,   -280,   -752,  -1136,
- -1563,  -1040,   1222,  -1173,   1763,   1179,  -1448,   1946,
- -1815,  -1588,  -1638,  -1282,   3302,    132,    509,   1408,
- -2760,  -2338,  -1935,   1353,  -1531,  -1074,   1156,   3086,
-  1374,   1667,   2302,  -1623,  -1897,  -1991,   -494,   2603,
-  -754,    524,   1265,   1304,   3062,  -1359,  -1365,   1987,
- -1334,   -916,   -146,    -40,    635,   1033,   1724,  -1057,
-    49,  -1159,   -774,    106,   1053,   -153,    134,    691,
-  -119,  -1226,    332,   -363,   -197,    -69,   -133,    573,
-   190,    216,  -2236,   -294,   1288,  -2110,  -1537,  -1005,
- -1175,     56,   4227,   1623,  -2440,  -1894,  -1623,  -2377,
-  2287,  -1220,  -1506,    177,   5689,   2849,  -2857,  -2166,
- -2546,   2174,  -2414,  -2343,    559,  -1020,   4650,   3514,
- -2875,   1309,  -2557,  -2534,  -2235,  -1901,   1559,   4412,
-  2301,   2204,  -2969,  -2018,  -2399,  -2834,  -2431,   1316,
- -1474,   1269,   2533,   3485,  -2892,  -2387,  -2716,  -2317,
- -2031,  -1992,  -1311,   8071,   3933,   3807,  -2139,   1909,
- -2200,  -2344,  -2060,  -1638,  -1154,   -210,   2781,   2139,
-  1119,  -1828,  -2069,  -2306,  -1975,  -1165,   -444,    789,
-  2409,   1551,  -2929,   -103,  -1920,  -2010,   -904,    694,
-  -188,      4,   1051,   1190,  -2649,  -2454,  -2205,  -1651,
- -1856,  -1552,  -1165,    352,   3351,   1266,  -1719,     57,
- -1828,   -420,   -938,  -1251,   -461,   1294,   1158,    893
-},
-
-.fcb11m = {
- -2704,  -2459,  -2349,  -1535,   2807,    365,   1064,    892,
-   830,   1222,  -2190,  -1542,  -2285,   6443,  -1607,  -1362,
-  -605,    637,    883,    877,  -2378,   2292,   3106,  -1057,
-  1776,  -1094,   -859,    249,    199,    256,  -1537,   2098,
- -1126,   2243,  -1186,   -193,   -211,    211,    502,    308,
-  3369,   3197,  -1271,  -1370,   -355,   -423,   -537,    468,
-  -237,    -99,  -1439,  -1748,  -2185,  -1972,  -1357,   -814,
-  -470,    815,   1306,   6390,   1983,  -1169,  -1749,    -29,
- -1368,   5929,  -1539,   -900,    576,    701,   1708,  -1608,
- -1148,   3522,   -822,   -120,   -461,   -158,    -43,     39,
- -2543,   8872,  -1347,  -1580,    222,   -488,   -162,    295,
-   382,    291,  11143,  -1223,  -1270,  -1399,   -392,   -563,
-  -500,   -604,   -544,   -135,  -1787,  -1313,  -1490,  -1395,
- -1100,  -1278,   -818,   6172,    768,   1597,   -623,   -681,
- -1128,  -1575,   7257,   -665,  -1021,   -439,    932,    703,
- -1496,  -2168,  -1945,  -1454,   -808,  -1261,   -354,    875,
-  6706,   1956,  -1773,  -1503,  -1536,  -1162,  -1386,  -1885,
- -1607,   -318,    -72,     -7,  -1932,  -1349,   6150,  -1852,
-  -345,    -18,    -81,    223,    339,    425,    362,  -1623,
- -1432,  -1973,  -1042,  -1373,   7830,     38,   -116,   1000,
-   421,  -2375,  -1808,  -1832,  -1046,   2077,    955,   1576,
-   581,    824,  -2021,  -1582,  -1402,  -1420,     69,   3549,
-  -513,    192,    262,    483,  -2503,   4173,    -11,  -1532,
-  -893,    282,    187,    320,    176,    259,  -2308,   2342,
- -2385,  -2147,   -784,   -375,    413,    833,    889,   1297,
-  1415,  -1085,  -1009,  -1501,  -1246,  -1298,   1553,   1384,
-   332,    662,   2226,  -2399,  -1752,   -857,   1899,    131,
-   501,    209,    217,    346,   4294,  -1811,  -1694,  -1080,
-  -752,   -263,   -228,    249,    628,    971,   2508,  -1031,
-  2871,  -1054,     42,   -202,   -738,   -170,   -239,   -290,
- -2751,  -2379,  -2379,  -1999,  -1448,   -380,   1594,   1279,
-  1399,   1633,  -2376,  -1839,   1367,   1685,    356,   -126,
-   -50,    143,     31,     33,    314,    160,   -663,   -687,
-    25,    388,   -267,   -188,   -188,   -129,  -2614,   1063,
- -1835,   -285,   2549,    205,    -30,    370,    319,    297,
-   -87,  -2208,  -1164,   -839,    894,   -266,   -410,    375,
-  1263,    924,  -2606,  -2325,  -1854,   1792,    407,    328,
-  -110,    575,   1090,    971,  -2517,  -1583,   1355,  -1892,
-  -490,   -203,    846,    724,    597,    779,  -1650,  -1281,
- -1294,    549,   -146,   -548,   2947,    -28,    265,    339
-},
-
-.fcb11s = {
- -1536,  -2360,  -2378,  -2138,  -1380,   -346,   1575,   2779,
-  3247,   1689,   -340,  -1788,  -1839,    103,     31,    853,
-  -653,   3159,    365,    154,    404,   -835,   -716,    -35,
-  4309,   -155,  -1214,  -1180,   -750,   -522,   -753,    350,
- -1660,  -1603,  -1159,   -582,   -489,   1067,   2615,   1747,
- -1755,  -2351,  -2314,  -1453,    922,   3458,    867,    439,
-   493,   1212,  -1584,  -1655,   1300,   1783,   1641,   1442,
-   816,  -1283,  -1456,  -1417,   4998,   1923,   -200,  -1086,
- -1060,  -1016,  -1074,  -1217,  -1285,  -1245,    633,    390,
- -1443,  -1099,   -507,   3041,    343,   -163,   -745,   -667,
-  2333,  -2144,  -2460,  -2247,  -2063,  -1736,   -742,    418,
-  3124,   3504,    227,   -735,    799,  -1326,    -20,   -543,
-  1900,    237,   -671,   -545,  -1727,    121,  -1750,   3700,
-  -485,   -553,    -77,   -212,    942,     62,   1647,   -688,
- -1506,  -1429,   -619,   -839,    172,   3209,   -500,   -371,
- -1680,  -1408,  -1122,   -563,   3627,   -115,    510,    534,
-   -65,    199,    800,   5040,    631,   -744,   -612,  -1023,
- -1099,  -1319,  -1520,  -1460,  -1120,   -274,  -1220,    349,
-  1848,   -620,  -1411,   -616,   1771,   1024,  -1223,  -2195,
- -2345,  -2144,  -1517,  -1055,   -385,    557,   1482,   6797,
- -2274,    818,   -460,   -707,   -274,    646,    654,    731,
-   268,    347,   4583,  -1289,  -1452,  -1193,  -1072,   -681,
-  -178,   -131,   -108,    547,  -1521,   -781,  -1298,    239,
-  -486,   -445,   3453,   -226,     90,    653,  -1237,    624,
-  4692,   -482,   -798,   -799,   -766,   -645,   -890,   -915,
-  3748,   -909,  -1012,     85,    963,    375,   -100,  -1010,
- -1269,  -1508,   2106,  -1194,   2632,    595,   -826,   -221,
-  -411,  -1104,  -1365,  -1050,  -2112,   -863,   1943,   -727,
- -1079,   -733,     78,   1990,    363,    953,   1325,    459,
-  -891,   3364,   -410,   -362,   -547,   -994,  -1371,  -1258,
- 12270,    -43,  -1668,  -1868,  -2004,  -2133,  -1863,  -1949,
- -1805,  -1288,  -1640,   3783,  -1414,   -578,   -505,   -464,
-  -158,    252,     71,     76,     22,    -20,    -72,    -13,
-   -19,    -95,    -14,      2,     23,     -5,   1289,    630,
-   291,   -707,   -794,   -857,   -715,   -122,    551,    219,
- -2358,  -1905,  -1397,    277,    572,    343,    789,    526,
-  1629,    991,   -980,    222,    740,   1199,     19,   1200,
-  -864,   -467,   -656,   -138,    820,  -2005,   -924,    154,
-   195,    393,    267,   -183,   1024,    100,   1243,   -872,
-  -705,   -781,   -422,   -377,   -910,   -637,     89,   2849
-},
-
-.fcb16l = {
- -2676,  -2246,  -3119,  -2904,  -2707,  -1946,   7718,   2292,
-  2451,   4206,  -1214,   -362,   1116,   -860,     30,   -993,
-  -888,  -1046,  -3732,  -2268,  -2541,   6060,  -2220,  -1597,
- -1650,  -1320,     88,   1229,   2118,   2348,   1430,  -1865,
- -2190,  -2122,  -1844,  -2069,  -1746,     15,  -1746,   1321,
- -2671,  -2993,  -3247,  -2811,  -2141,  -1360,   1886,    270,
-  -381,   5676,  -2070,   -444,   -674,  -1082,  -1144,   -346,
-  -823,   4630,   -224,   1940,  -2441,  -2072,  -2194,   -295,
-  2175,   1209,   -734,    168,    923,   1359,  -2667,    389,
- -2585,  -2279,  -2195,  -1141,  -1016,   -218,    109,   1926,
-  5184,  -2226,  -1888,  -1273,  -1044,     25,    461,    886,
-  1125,   1249,  -2215,  -2381,   3109,  -1963,   3015,  -2027,
-  -790,   1192,   1646,   2188,  -2906,  -2598,    484,  -2372,
- -1372,  -1082,   1718,    664,   1391,   2396,  -2518,   1937,
- -2362,  -2510,  -1504,   2947,    446,    684,   1947,   2059,
- -3263,  -3001,  -3240,  -3034,  -2598,   3367,   4407,   2327,
-  2450,   2994,  -2379,  -1875,  -1862,   6387,  -1956,  -1417,
-  -525,   1098,   1836,   2932,   1408,  -1130,  -1417,   1693,
-  -262,   -645,   -515,    443,    735,    619,  -2834,  -2246,
- -2646,  -2521,   -811,   6608,   -421,   1572,   2015,   3234,
- -2086,  -1435,     89,   1648,    838,   -986,  -1159,  -1208,
-   -32,   1354,  -2135,  -2159,   7796,  -2424,   -949,  -2040,
- -1179,    228,   1187,   3008,  -2963,  -2500,  -2074,  -2025,
- -1439,   1692,   -378,   -596,    -62,   2419,  -3522,  -3132,
- -2899,  -3290,  -2929,   2844,     49,   4307,   2754,   3897,
- -2960,   1305,  -1858,   -831,  -1379,   -773,   3257,    979,
-   975,   1513,  -2849,  -1610,   2483,    456,  -1395,   -634,
-   847,   1320,   1116,   1175,   2497,  -1554,   2176,  -1697,
-  -997,   -799,   -120,    339,    996,   1379,  11359,  -1557,
- -2219,  -2237,  -1792,  -2084,  -1009,    781,   3341,    939,
-  1954,  -1860,  -2347,  -2117,  -2000,  -1394,   3825,    106,
-  2595,   2162,  -2938,  -2488,  -2112,    772,  -1059,   1822,
-   159,   1017,   2452,   1506,   1313,  -2615,  -2479,  -2941,
- -2220,  -2510,   -726,   4703,   1778,   3375,  -3133,  -2664,
- -2821,  -2771,   1559,  -1000,   -434,   1874,   4130,   2987,
- -2998,  -2692,  -2326,   1580,  -2231,  -1347,   4166,   2021,
-  1177,   2531,  -2880,  -2337,  -2589,   1505,  -2843,  -2468,
-  -339,  -1059,   3212,   4264,  -3112,  -2885,  -2889,    975,
- -2522,  -2278,    721,   5057,   3989,   3373,  -3098,  -2947,
- -1128,  -2251,   1935,   2981,   3007,    975,   1983,   2048,
- -2861,  -2302,  -2431,  -1460,  -1492,  -1524,   -944,   1556,
-  1778,   1549,  -2658,  -2259,   2768,  -2460,  -1447,   2957,
-   759,    324,   2533,   2477,  -2935,  -1687,  -2554,  -2647,
- -1431,    118,   -365,  10280,   1526,   3447,  -2570,   2268,
- -2351,  -2115,   2588,     -9,   -834,   1115,   1878,   2365,
-    79,   1132,  -1619,  -1406,  -1568,  -1766,   -224,    825,
-  2113,   1382,   -548,  -2669,  -1797,  -2691,  -2139,  -2495,
-  -210,   1276,  13623,   2315,   1965,  -1713,  -1610,  -2187,
-  2534,  -1495,  -1301,    622,    563,   2154,   2743,   3230,
- -1784,  -1774,   -792,   -493,   -131,    156,    944,   1211,
- -1886,    357,  -1018,    225,   -285,   1025,   -134,    218,
-   290,    153,   5869,  -2407,  -2856,  -3051,  -2540,  -3238,
- -2260,   -370,   -451,   6314,   -500,  -2554,  -2110,   -879,
-  -323,   -537,    570,   1228,   1556,   1342,  -2486,   3366,
-  1838,   -937,   -959,   -683,     63,    937,    652,   1212,
- -2164,  -1448,    166,   -799,   -550,  -1317,    481,    299,
-  5494,   1360,  -3147,  -2574,   -989,   1550,   1952,  -1502,
-   -96,   3517,   1304,   2311,  -2931,  -2146,  -2174,  -2052,
-   579,    680,    896,   2697,    703,   1365,   4130,  -2367,
- -2627,  -3125,   -934,  -3093,  -2155,   -955,   6025,   5024,
- -3121,  -3064,  -2883,  -2458,   1723,   -842,   3032,   4391,
-  2327,   2837,  -2536,  -2208,  -1610,  -2189,   6509,  -1424,
- -1116,   1427,   2830,   3370,   1084,  -1562,  -1655,  -1628,
-  -491,   2260,   -321,    421,    774,   1237,  -3267,    977,
- -3170,  -3144,  -2698,  -1324,   1424,   3034,   3323,   3347,
- -3021,  -3061,   2027,  -2345,    852,  -2832,  -1714,   5926,
-  4517,   3839,  -1490,  -2416,  -1726,  -1268,  -1458,  -2137,
- -1715,   -580,   1403,  13408,  -3005,  -2706,  -3063,  -2745,
- -2777,  -2136,   2786,    202,   5141,   3407,  -3104,  -3001,
- -3176,  -3388,  -3507,  -2863,  -2097,   2325,   2618,   6146,
- -1997,  -3152,  -1036,  -2694,  -2587,  -2986,  -2750,  -2219,
- -1607,   5944,  -2893,  -2633,  -2229,  -2811,  -2482,  -2115,
- -2219,  -1180,   5246,   3252,  -3111,  -2052,  -2693,  -2934,
- -1805,   2583,    353,   1262,   8588,   3900,  -2468,  -2726,
- -1861,  -2352,  -2237,  -2750,  -2345,  -1936,   9793,   8392,
- -3490,  -3124,  -3596,  -3630,  -3154,  -2390,    743,   6652,
-  6366,   6143,  -2852,  -3547,  -3124,  -2718,  -1094,   -494,
-    49,  -1053,  -3005,  32767,  -1721,  -1229,  -1715,  -1590,
-  1587,  -1233,   3384,   -252,    312,   1120,  -3287,  -2926,
- -3048,  -2828,  -2502,  -1185,   2028,   3778,    487,   2083
-},
-
-.fcb16m = {
-   616,  -1065,  -1622,  -1949,  -1283,   -863,   6819,    517,
-  1135,   1282,   2631,  -1447,  -1477,  -1004,    286,   1358,
-  -135,   -340,    147,   -130,   5435,  -1609,  -1916,  -1758,
- -1066,  -1126,    478,    995,   1098,   1437,  -1737,  -1339,
- -1864,  -2009,  -1038,  -1004,   -573,    810,   5974,   2840,
-   349,  -1559,  -1496,  -1151,   -307,    -82,    681,    827,
-   550,    776,   1930,    166,  -1100,  -1489,  -1185,  -1182,
- -1210,   -326,    858,   1688,  -2561,   3514,   -736,   1555,
-   -59,   -906,   -123,     87,    102,    274,   1902,   -459,
-  3008,   -984,   -707,   -334,   -571,   -317,   -190,   -371,
- -2862,    607,   1346,  -1517,  -1220,   -617,   2494,    697,
-   190,     64,   3264,   3926,  -1249,  -1542,   -933,   -302,
-  -246,   -248,     69,   -283,  -1766,   -750,  -1898,  -1259,
-  6841,  -1546,   -785,    -64,   1208,   1294,  -1522,  -1742,
- -1873,  -1898,  -1455,   7128,   -752,   1718,   1398,   1123,
- -2742,   4733,  -1552,  -2483,  -2210,   -495,    355,    864,
-   830,    759,  -2721,  -2115,  -1891,  -1696,  -1137,  -1559,
- -1265,   -658,   -591,    850,   -699,   1262,   -551,  -1055,
-   877,     96,   -388,   -192,   -479,  -1091,  -2763,  -1379,
-  3290,   2331,   -874,   -307,   -386,    615,    366,    133,
- -2671,   5181,   4339,   -894,   -871,   -634,   -165,    409,
-    91,   -291,  -2649,   -411,   8039,  -1947,  -1156,     57,
-   351,   1014,    472,   -198,  -1816,   -590,   2887,  -1702,
- -1113,   3414,   -556,    117,    483,   -377,  -1707,  -1146,
- -1155,   2518,   2014,   -382,      3,     -6,    206,    -98,
- 10770,    274,  -1415,  -1670,  -1020,  -1036,   -786,   -782,
-  -463,   -552,  -2500,  10460,  -1624,  -1787,   -707,  -1327,
-   -59,    375,     91,     22,  -2776,  -2343,  -2104,    825,
-  -759,   -823,    482,   1149,   1265,    570,  -1676,  -1826,
- -1848,   6125,  -1391,   -820,   -449,    844,    586,    535,
- -2873,  -2475,  -2607,  -2611,  -1830,   -487,   1643,   1680,
-  2088,   2570,  -2357,   -993,   3189,  -1473,   3506,  -1203,
-  -793,    662,    464,     98,  -2507,   1617,  -1793,  -1935,
- -1307,   -169,      9,    885,    728,   1178,  -2010,  -1346,
- -1375,   -187,   -548,   2753,   -464,   -105,    799,    511,
- -2170,  -2428,  -2177,  -1497,   2072,    828,    441,   1020,
-   873,   1000,  -1297,  -1531,  -1863,  -1967,  -1516,  -1088,
-  -758,   -230,   1561,   6655,  -2173,  -1787,  -1548,  -1763,
- -1366,    -24,   -645,   6836,   1480,   1923,  -2728,  -1859,
-  1798,  -2010,  -1585,   -677,   -371,   1405,   1254,   1278
-},
-
-.fcb16s = {
- -2250,  -2771,  -2879,  -2775,  -2240,  -1363,   -272,   1233,
-  6172,   5074,  -2882,  -2419,  -2054,  -2420,  -1252,    347,
-  1325,   1799,   1723,   4361,    774,   2066,   1874,    280,
-  -707,   -605,   -581,   -662,  -1104,  -2038,   7111,   -137,
-  -883,  -1079,  -1001,    -54,   -847,  -1013,  -1045,   -832,
-  4696,   3781,   -624,  -1485,  -1360,  -1359,  -1307,  -1219,
-  -866,   -945,   5419,  -1512,  -2307,  -2134,  -2056,  -1724,
- -1653,   -630,    157,   3399,   -727,   -860,  -1381,   -380,
-  -716,  -1335,   3819,     78,     -2,    277,  -3185,  -3118,
- -2715,  -3110,  -1500,   1626,   3352,   3075,   1956,   -539,
- 16640,  -1204,  -2281,  -2307,  -2272,  -2349,  -2009,  -2184,
- -2777,  -2375,  -1015,   6208,   -402,  -1331,  -1182,   -763,
-  -730,    -81,   -591,  -1184,  -1927,    543,   4464,  -1095,
-  -131,   -542,   -129,    486,   -366,  -1097,  -1594,   -554,
-   -15,   -337,   3152,   -723,     71,    -40,    385,   -309,
-  -769,    290,   -853,  -1058,  -1196,  -1557,   -595,   3695,
-  1129,    438,   1729,  -1309,   -971,   -871,     90,   1418,
-  1261,    -23,  -1382,   -223,  -1551,   -713,  -1044,   4495,
-  -160,   -867,  -1242,   1188,    159,    120,  -1657,   -951,
-  1536,   -159,  -1310,   1101,   -404,    155,   1717,    -24,
- -1607,   2347,   2056,  -1943,  -1313,  -1297,    -81,     34,
-  1441,    354,  -2110,  -1873,   -516,   1102,   2174,   2131,
-     0,   -946,   -729,     61,    107,    -14,   -108,    -50,
-    42,   -164,   -177,    -92,    -29,    162,   1349,  -2380,
- -2099,  -1692,   -980,    -49,    -94,    331,   1317,   3819,
-  -482,   -782,   -775,   -909,   -640,  -1099,   -615,   -225,
-  1556,   2973,   -630,     70,   -186,  -1599,  -1076,   4440,
-  -890,     78,    -76,   -517,   -855,  -1886,  -1521,  -1206,
- -1152,   -900,    753,   1338,   1758,   2431,  -2433,  -1569,
- -1294,   -583,    552,   2040,   -154,    250,    513,   2333,
-  -820,  -1987,  -2291,  -2238,  -1880,  -1651,  -1120,   -262,
-  2013,   9756,  -2803,  -2574,  -2634,  -2789,    356,  -1838,
-   325,   4584,   3584,   2486,  -1524,   1874,   -337,  -1800,
- -1659,    406,   2450,   1252,   -245,  -1030,   1985,   -397,
- -1565,    -51,    148,   2039,  -1212,   -729,   -700,    -11,
-   904,    649,    531,  -2287,  -1640,    766,   -725,    171,
- -1596,   1387,   3189,   -672,   -459,   -794,   -422,   -714,
-  -195,   -231,    185,     99,   -952,  -2248,  -2170,  -1190,
-  -457,   1458,     34,   1179,   2427,   1683,  -1658,   3749,
- -1816,  -2000,   2823,  -1243,  -1415,    713,    875,     75
-},
-
-.fcb22l_1 = {
-  2198,  -2215,  -2251,  -1966,  -1540,   -467,    403,   1647,
- -2867,  -2589,    -34,  -2314,   -602,   2371,   2614,   2218,
- -2494,   3659,   2708,  -1076,   -914,    233,   1149,   1425,
-   319,   -979,   1023,   -682,    110,    239,    427,    703,
- -2979,  -2513,  -2649,  -2265,   7420,    526,   2174,   2932,
- -2868,  -2056,  -2232,   1651,  -1325,   -856,   -218,   2091,
-   458,   1508,  -1208,   -845,    244,   -441,    558,    752,
-  -700,  -1370,   -395,    980,   -321,   -232,   -241,    293,
- 10391,  -1792,  -1948,  -1518,  -1049,     43,   1524,   2033,
- -2434,    303,   1730,  -1205,  -1432,  -1183,   -694,   1185,
- -2531,  -2656,  -2751,  -1756,  -1321,  -1100,    287,   8605,
- -2868,  -2554,    721,  -2065,  -1671,   -771,    675,   2223,
- -2690,  -2501,  -2313,   1829,   3189,     45,   1825,   2024,
- -3153,  -2824,  -2729,  -2308,   1686,   -370,    482,   2606,
- -2972,  -2324,   2492,  -1762,  -1662,     28,   4976,   3214,
- -2769,   -316,  -1146,  -1954,     86,    -60,   -370,   1144,
-  5519,  -1785,  -1538,  -1044,   -580,    -89,    704,   1151,
- -2586,  -1094,   7473,  -1220,  -1076,    -50,   1029,   1850,
-  3546,   3279,  -1806,  -1191,   -528,    682,   1160,   1341,
- -2852,   1541,  -2358,  -1841,  -2317,  -1351,    993,   2417,
- -2675,   2482,  -2061,  -2089,   3681,    626,   1619,   1818,
- -2916,   2821,  -2482,  -2166,  -1084,   1137,   5537,   2864,
- -2499,  -1782,   2156,   2558,  -1117,    127,   1147,   1556,
- -2572,   3865,  -2008,  -1805,   -679,    119,     35,   1319,
- -2704,  -1872,  -1756,   6843,   -911,    322,   1641,   2461,
- -2652,  -1957,   1972,  -1582,   3082,     84,   1086,   1487,
- -2983,  -2325,  -2780,  -2532,  -1858,   -279,  10092,   4519,
- -2364,   2718,  -1907,   2678,  -1005,    246,   1499,   1679,
- -2570,   8779,  -2004,  -1627,   -844,     89,   1712,   2145,
-  3316,  -1763,  -1642,   2819,   -599,      9,    906,   1401,
- -2289,  -2224,   2462,  -1580,   -843,   2501,    -24,   1310,
-  3091,  -1745,   2398,  -1264,   -731,    113,    831,   1328,
- -2803,  -2380,  -2808,  -2379,  -2290,  -1376,   -234,   2242,
-  3537,  -2137,  -2050,  -1260,   2881,    177,   1158,   1424,
- -3303,  -3123,  -3130,  -2861,  -2075,   2528,    -43,   3890,
- -3106,  -2672,  -2554,   1833,   -826,     55,   4910,   3324,
-  3993,  -2176,  -2446,  -1848,   -786,   3346,   1590,   2034,
- -2725,   -265,    303,   1076,  -1985,   3661,   1556,   1983,
- -3182,  -2712,  -2988,  -2841,  -1332,   4816,   6422,   4184,
- -2230,  -1248,  -2176,  -1806,  -1617,   -878,   3764,   1309,
- -2280,    509,   -211,    426,    773,     99,    513,    628,
-   167,    196,  -2256,  -1802,  -1157,    724,   1405,   1383,
-  2384,   -409,   -672,   -453,   -205,    -89,    -12,    240,
-   114,  -2220,   -807,  -1302,  -1612,   -405,   1134,   1381,
-   699,  -1816,  -2151,  -1883,   2975,    928,   1527,   1565,
-   775,  -2141,  -1981,  -1532,   -591,   3338,    683,   1763,
-   466,  -2028,  -2086,   1448,   -622,    589,   1294,   1150,
-   145,  -2382,  -1093,   -367,    986,    323,    404,    931,
-  -371,  -2868,  -2737,  -2103,    129,    771,   1498,   1974,
- -1481,  -1060,  -2398,  -1125,    285,   2777,   2975,   1431,
- -2720,   1748,  -2375,  -1847,   -912,   3829,    808,   2034,
- -2492,  -2447,  -1248,   -991,   1449,   1304,    867,   1171,
- -2999,  -2556,  -2763,  -2298,   3359,   4277,   1991,   2850,
- -2692,  -2640,  -2593,   1813,   -458,   3068,   1012,   2049,
- -3258,  -2820,  -2845,  -2395,   2787,    -45,   5457,   3568,
- -2491,  -2114,  -1884,      6,   -332,   -232,   1680,   1139,
-  2032,  -2383,  -2183,  -1725,   -914,    192,   4175,   2059,
- -2922,  -2972,  -2920,  -2210,  -1143,   1850,   2468,   1871,
- -3138,    -99,  -2651,  -2510,   -129,    631,   1677,   1925,
- -3302,  -3124,  -3214,  -3143,  -2616,   -761,   3978,   4234,
- -1698,   -824,  -1975,   -742,   2449,   -610,     21,    998,
- -3047,  -2697,  -2747,  -1919,  -1545,   7534,   1243,   3548,
- -1863,  -1257,    339,  -1027,    122,   -613,   1989,    953,
- -2232,  -1759,  -1751,   -969,  -1591,   1917,   -325,    889
-},
-
-.fcb22m_1 = {
- 13531,  -1278,  -2217,  -1956,  -1360,   -892,   -650,   -866,
-  -255,    192,  -1139,  -1242,  -2101,  -1682,  -1601,   2950,
-  2340,    121,    662,    446,  -2636,   1711,    615,  -1864,
- -1297,  -1098,   -296,   1070,   1284,    891,   7332,  -2292,
- -2334,  -1889,  -1170,   1884,   -570,     52,   1146,    944,
- -2083,  -2192,  -2420,  -2165,  -1542,  -1474,   -278,   4147,
-  1506,   1666,   1014,  -1657,  -2225,  -2261,   8568,  -1445,
-  -523,   -115,    999,    602,  -2762,  -2261,    271,  -1797,
- -1633,   -790,    391,    907,   1302,   1076,  -1907,  -2219,
- -2443,  -1963,  -1495,  -1294,   4722,    935,   1691,   1370,
- -2355,  -1585,  -2510,  -2297,   2690,  -1491,   -647,    360,
-  1460,   1479,  -2041,    368,  10454,  -1277,   -716,   -172,
-  -538,   -287,    169,   -232,    960,  -1087,  -2459,  -2196,
- -1189,  -1967,  -1586,   -783,   5275,   2811,  -1523,  -1733,
- -2373,  -1946,  -1586,  -1280,   -442,   -205,   2330,   6319,
- -2483,  -2115,  -2645,  -2016,  -1464,     89,    529,   1338,
-  5291,   3186,   5770,  -2311,  -2696,  -2420,   -619,  -2322,
-  8434,   -129,   1661,   1232,  -1377,  -1277,  -1193,    406,
- -1332,  -1246,   -999,   -497,   1024,   1500,  -2791,  -1417,
- -2173,   2419,  -1492,   -734,   2795,    559,    750,    519,
- -2714,   -509,   4622,   3679,   -294,     73,   -805,    602,
-   -99,     94,  -2658,  -1984,   6907,  -1780,  -1244,    272,
-   874,    140,   1326,    693,  -2679,  -2274,  -2551,  13351,
- -2619,   4570,  -1739,   2309,   1280,   1235,  -1011,  -2084,
- -1968,  -1404,   2568,   3147,   -336,    270,    499,    506,
- -1567,  -2240,  -2685,  -1951,  -2254,   2783,  -1411,   8878,
-  2321,   1691,  -2567,  -2450,  -2572,  -2286,  -2038,  -1803,
- -1316,   -315,    464,   1223,  -1988,   -927,  -2035,   2165,
-  3663,   -919,   -328,    229,     -2,    217,  -2773,  -2160,
- -2637,  -2183,   5081,  -1434,   1526,   2830,   1698,   1153,
- -2810,  -1132,   5408,  -1992,   4267,  -1357,    809,    563,
-     9,    -64,  -2949,   7061,   4604,  -1424,  -1839,   -610,
-  -251,    370,    901,    147,  -2264,   3135,   3241,  -1102,
-  -397,  -1292,     39,     17,    380,    383,  -1483,  -1458,
-   820,   2135,   -646,   -479,    173,     23,   -274,   -442,
-  -978,  -1216,  -1928,   7260,  -1249,   -956,    -24,    250,
-   438,    128,   4080,    152,   2677,   -587,   -667,   -672,
-  -662,   -492,   -722,   -688,  -1907,   -787,   3101,  -1404,
- -1234,   -508,   3817,    424,    657,    -86,  -2179,   -599,
-  2141,  -1446,  -1847,   4341,   -801,    -26,    -57,    216,
- -1625,   -802,   1752,  -1301,   2617,  -1545,   -513,   -401,
-   234,    658,   1299,  -1279,    874,  -1408,  -1135,    -40,
-  -423,    394,    660,    684,   3341,   -937,  -1842,  -1177,
-  1945,   -621,     19,    -93,    141,    -59,  -2626,   3368,
- -1588,  -1959,  -1506,   3729,   -347,    218,    497,    585,
- -2495,  -2452,  -2118,    578,   -225,    378,     40,   1080,
-   908,    761,  -2070,  -1607,   2534,  -1535,   1493,   2664,
-   215,    634,    317,   -233,   4188,  -1446,  -2129,  -1812,
- -1428,  -1579,  -1038,     97,    989,   2038,   3671,  -2707,
- -2608,  -2198,  -1119,   1601,   1042,   1325,   1230,   1149,
- -2566,  -1054,   3659,  -2173,  -1772,   -713,  -1080,   -101,
-   987,    805,  -1555,   -749,  -1510,   3443,  -1402,   4172,
-  -696,    437,    276,    219,  -2735,  -2453,  -2082,   3898,
-  -867,   -582,   -726,   1134,   1227,   1121,   2333,   -963,
- -1474,   2386,   -959,   -327,   -138,      4,    268,    479,
- -2889,  -2896,  -2701,  -1975,   -593,   1212,   1511,   1087,
-  1482,   1612,  -1703,   4874,     46,  -1364,  -1342,   -544,
-  -879,   -455,   -488,   -396,  -2616,    849,  -2424,  -1976,
- -1491,   -739,    325,   1284,   1831,   1223,    -48,  -1457,
- -2123,  -1318,   1617,  -1064,   2484,   -467,    533,    707,
-   351,    422,   -525,   -657,    202,   -476,    133,   -679,
-  -945,   -832,   1906,  -2981,  -2605,  -1911,  -2541,  11553,
- -1585,   1555,   2196,   1616,  -2669,  -2345,  -2423,  -1848,
- -1756,   4918,   -711,   1186,   1873,   1399,   -672,  -1401,
- -1524,  -1138,   -674,   1285,    195,    884,   -377,  -1067,
- -2125,    377,  -1747,  -1604,    837,   -334,   -115,    -59,
-   160,    483,  -2220,  12861,  -1633,  -1616,   -926,  -1203,
-  -113,    -90,    378,    148,   5740,     88,  -2246,  -1598,
- -1546,  -1694,   2790,    -72,    590,     28,  -2608,   4312,
- -1068,   3091,   -632,   -651,    366,     63,    744,    375,
-  1746,   2753,  -2075,  -1621,  -1033,   -471,    972,    199,
-   575,    655,  -2148,   2407,  -2180,  -1764,  -1030,  -1089,
-  4083,    -80,    417,    384,   1196,  -2284,  -2549,  -1771,
-  -773,    213,   1188,    788,   1343,   1358,  -2584,   7723,
- -2171,  -2301,  -1497,   -438,   1001,    110,    671,    939,
-  6435,   5777,  -1765,  -1287,  -1181,  -1014,     87,   -919,
-  -422,   -444,  -1930,   4906,  -1660,  -1558,   3617,  -1177,
-   261,      9,    261,    -47,  -2539,   2749,  -2476,  -2298,
- -1047,  -1319,   -341,   -604,   2111,   2779,  -2935,   5011,
- -1860,  -2363,  -1686,  -1033,    800,   1774,   1700,   1478
-},
-
-.fcb22s_1 = {
- 11523,   -796,  -1488,  -1897,  -1888,  -1691,  -1767,  -1794,
- -1622,  -1210,  -2284,  -2777,  -2382,  -1371,   -238,   2997,
-  3182,    588,   1129,    704,    248,   1703,   -264,  -1306,
- -1147,   -560,  -1513,   -956,   1667,   1340,   5220,  -2276,
- -2215,  -2049,  -1479,  -1294,   -774,     66,   1270,   2075,
- -1435,  -1981,  -2322,  -1896,  -1321,   -462,    138,   5022,
-  2549,   1683,   -100,  -1744,  -1528,   -423,   6093,    -61,
-  -288,   -623,   -650,   -828,  -1521,    134,   1240,  -1399,
- -1450,    612,   -969,   2585,    945,   -312,  -1138,  -2488,
- -2513,  -1988,  -1607,   -773,   3384,   1192,   2651,   2580,
-  -984,  -2015,  -1465,  -1576,   2273,  -1221,     91,   2615,
-   840,   1299,  -1069,  -2151,  -1899,   -735,    440,    888,
-  -241,    502,    953,   3613,   1806,  -1855,  -2303,  -1758,
- -1318,  -1484,    -10,    597,   3723,   1992,   -488,  -2063,
- -2284,  -2172,  -1905,  -1547,   -937,    -18,   3276,   7184,
- -1942,  -2302,  -2399,  -1972,  -1378,   -635,    302,   1081,
-  5454,   3358,   -447,   -807,    205,  -1805,  -1546,   -446,
-  6364,   -916,    151,   -377,   -582,   -856,   -204,   -731,
-  -884,   -674,   -257,    -67,   1564,   2486,   1003,  -1508,
- -1692,   1515,   -889,   -622,   2366,      9,    -17,   -245,
-  3733,  -1057,   -284,   3197,    -31,   -440,  -1115,  -1609,
- -1834,  -1930,    230,    262,   7344,    -39,  -1746,   -562,
- -1554,  -1838,  -1648,  -1310,   2157,     80,   -102,    238,
-  -823,   -622,   -720,   -115,   -274,     16,  -1562,  -1785,
- -1535,   -334,   2604,   3388,   -410,   -103,   -348,   -142,
-  1676,   -441,  -2267,  -1988,  -1421,   -680,   1302,   2682,
-   383,    -10,   1487,  -1086,   -251,  -1134,    141,    -84,
- -1003,   -898,     95,   2304,    802,  -1549,  -1562,   2650,
-  2180,     64,   -512,   -832,   -705,   -429,   1826,  -2283,
- -1976,  -1277,   2699,    504,    249,     -9,    178,    -33,
- -1357,  -1138,   3005,    293,    229,   1633,   -197,   -540,
- -1245,  -1617,  -1269,   6639,   2437,   -647,  -1501,  -1097,
- -1051,  -1150,  -1183,  -1461,     71,   1529,   2847,   1149,
-  -705,  -1345,  -1605,   -629,   -617,    -60,  -2081,  -1435,
-   938,    844,  -1055,   -841,   1179,    392,   1112,    946,
- -1252,  -1728,   -266,   7063,  -1335,   -920,  -1048,    206,
-    48,   -619,   4764,    274,   2394,   -799,   -798,  -1003,
- -1278,  -1800,  -1626,  -1415,   -498,   1439,   1643,  -1978,
- -1258,  -1136,   1285,     -9,    596,    141,  -2211,    908,
-   802,   -470,  -1125,   3216,   -234,   -412,      3,   -980,
-    15,  -1047,   1530,    660,   1986,   -480,   -499,   -550,
-  -733,   -531,   1326,  -1607,    787,  -1136,  -1002,    -65,
-   358,    743,    253,   -294,   3498,  -1033,  -1270,   -790,
-   537,   1788,    309,    -72,  -1241,  -1999,    609,   2981,
- -1025,  -1642,   -958,   3845,  -1221,   -962,   -965,  -1612,
- -1993,    -33,  -1136,   1086,    -46,   1178,   -229,    139,
-   644,    718,  -1696,   2411,   1019,  -1056,     52,    224,
-  -487,   -395,    -40,    125,   3001,  -1955,  -1950,   -784,
- -1111,    897,   -514,    159,    785,   1095,   2944,  -2554,
- -2407,  -1975,   -632,   1030,   1712,    366,    463,    125,
- -2354,   -796,   5663,  -1055,  -1151,   -870,    348,   -676,
-  1447,    215,  -1005,  -1531,   -910,   2249,   -438,   2889,
-   107,   -404,   -271,   -534,  -1022,  -2117,  -1738,   2261,
-  -257,   -788,     32,   1747,   1196,    910,     33,      1,
-   -23,     28,    -25,     19,     13,    -29,    -23,    -48,
-  -907,  -2113,  -1978,  -1426,   -535,   1589,   1908,   2724,
-  1646,   -897,    758,   2326,    674,  -1449,    111,    220,
-   475,   -162,  -1465,  -2036,   -528,   1308,  -2087,  -2031,
- -1308,    183,     35,   1097,   1008,   1864,  -2116,  -2303,
- -1928,   -261,   2342,   -292,   1480,    268,   1582,   1079,
- -1183,  -1154,   -777,    309,   1218,    683,   1314,   1677,
-  -758,  -1745,   1422,  -1331,  -1638,  -1100,   -303,   5003,
-   -57,   -379,   -511,   -756,   -727,  -2315,  -1860,  -1775,
-  -676,   3854,    -67,    -52,   2018,   1532,   -160,   -197,
-   -75,  -1934,  -1134,   2025,   1810,   -491,     83,    646,
-   390,   -297,   -441,   -342,   -479,   -486,   -296,    -30,
-   443,   1151,   3508,   6119,   -493,  -1427,  -1393,  -1273,
- -1280,  -1687,  -1683,  -1511,   5109,  -1008,  -1137,   -638,
-  -649,   -342,   -590,   -478,   -577,   -349,   -579,   2548,
-  -463,   2107,   -568,   -678,   -788,   -454,   -608,   -452,
-  1934,   1485,  -1746,  -1007,  -1174,   -573,    239,   -119,
-   679,    -76,  -1687,   1956,   -898,   -477,    456,   -156,
-  1460,     13,     92,   -987,    554,  -2772,  -2578,  -1694,
-  -235,    753,   1527,   1106,   1539,   1342,  -1305,   6560,
- -1526,  -1765,   -793,   -600,    248,   -542,    -63,   -421,
-  4828,   1288,  -1580,  -1826,  -1163,  -1014,   -221,   -818,
-  -109,    -61,   1265,   1939,  -1265,   -414,   1912,   -190,
- -1157,   -675,   -756,   -935,   2529,    136,  -1709,  -1727,
- -1819,  -1504,  -1232,   -959,   1128,   4142,  -1945,   2958,
-  -900,  -1432,  -1720,  -1380,    381,   1473,   1235,   1062
-},
-
-.fcb22l_2 = {
-  2441,  -2086,  -2129,  -2146,  -1839,  -1035,    295,   2465,
- -2785,  -2597,    -81,  -2162,   -991,   3060,   3056,   2985,
- -2415,   4009,   3058,  -1165,  -1281,   -322,    629,   2232,
-   481,  -2255,   1165,  -1455,   -621,    -29,    923,   1371,
- -2822,  -2421,  -2596,  -1908,   6338,    279,   1845,   3532,
- -2955,  -2571,  -2554,    744,  -1785,   -909,    775,   3156,
-   738,   1760,   -458,   -590,    -73,     22,    -91,    326,
- -1098,  -1511,  -1000,   1741,  -1024,   -562,   -399,    736,
-  9669,  -2109,  -1872,  -1539,  -1208,   -265,    994,   2364,
- -2121,    -98,   1523,  -1427,  -1450,  -1157,   -294,   1375,
- -3007,  -2669,  -2847,  -1777,  -1196,  -1257,   1065,   9128,
- -2948,  -2509,    470,  -2521,  -1947,   -728,    503,   3810,
- -2538,  -2469,  -2217,   1957,   2580,   -229,   1212,   2263,
- -3174,  -2660,  -2792,  -2692,   1226,   -512,    555,   3960,
- -2979,  -2426,   1978,  -2182,  -1868,   -455,   4681,   4580,
- -2514,  -1642,  -1029,  -1712,    416,   -838,   -362,   1208,
-  5211,  -2128,  -1867,  -1337,   -549,    -70,    828,   1508,
- -2272,  -1611,   7307,  -1612,  -1244,   -461,    749,   2510,
-  3669,   3236,  -1845,  -1333,   -866,    268,    850,   1686,
- -2805,   1079,  -2258,  -2075,  -2017,  -1115,    214,   2735,
- -2719,   2676,  -2154,  -1976,   2884,    393,   1247,   2382,
- -3043,   2188,  -2703,  -2353,  -1861,   -208,   4419,   4511,
- -2187,  -1630,   2246,   2331,  -1105,   -198,    818,   1721,
- -2180,   3571,  -1841,  -1738,  -1020,     14,    407,   1028,
- -2536,  -2171,  -2115,   6630,   -968,   -306,   1438,   3574,
- -2411,  -1857,   1911,  -1546,   2709,     57,    910,   1727,
- -3159,  -2565,  -2675,  -2746,  -2017,   -534,   8461,   6103,
- -2299,   2912,  -1851,   2660,  -1479,    -97,   1148,   2204,
- -2510,   8781,  -2194,  -1790,  -1114,   -110,   1140,   2885,
-  3261,  -1921,  -1633,   2766,   -788,   -403,    610,   1651,
- -2515,  -2021,   2415,  -1606,  -1149,   2479,    297,   1693,
-  3823,  -1538,   2514,  -1261,   -904,   -236,    550,   1581,
- -2903,  -2440,  -2922,  -2749,  -2480,  -1849,   -423,   3613,
-  3420,  -1876,  -1929,  -1537,   2955,     58,   1014,   1950,
- -3295,  -3009,  -3161,  -2926,  -2353,   2355,    351,   5502,
- -3140,  -2745,  -2781,   1247,  -1037,    538,   4939,   4382,
-  3584,  -2284,  -2321,  -1844,   -743,   3156,   1546,   2358,
-  -562,   -101,   -497,  -1196,  -1023,   1972,   1255,   1374,
- -3146,  -2824,  -3057,  -2757,  -1736,   3746,   5609,   5118,
- -2155,  -1665,  -1701,  -1780,  -1975,  -1127,   3185,   2036,
- -2540,    324,   -481,    311,    624,    719,    543,   1030,
-   550,    513,  -2430,  -1817,  -1129,     62,   1526,   1809,
-  2172,  -1314,  -1035,   -586,   -292,    233,    209,    543,
-  -252,  -2372,  -1961,  -1629,  -1306,   -408,    451,   1339,
-   792,  -2619,  -2316,  -1624,   1941,    678,    977,   1710,
-   428,  -2499,  -2369,  -2101,  -1448,   2988,    874,   2497,
-   451,  -2263,  -2204,   1403,   -631,    694,   1424,   1658,
-  -243,  -2104,   -378,    355,   1446,    373,    377,    973,
-  -756,  -2802,  -2508,  -2081,    177,    352,   2428,   2359,
- -1533,  -2710,  -2544,  -1102,    419,   3132,   1222,   1942,
- -2756,   1844,  -2429,  -1854,  -1283,   3960,   1633,   2917,
- -2858,  -2784,  -2106,  -1025,   1588,    905,   1092,   1657,
- -3028,  -2715,  -2782,  -2218,   2852,   4006,   2534,   3726,
- -2783,  -2355,  -2146,   2113,  -1201,   3361,   1178,   2670,
- -3199,  -2796,  -2682,  -2489,   1905,   -471,   5097,   4436,
- -2197,  -1078,  -2327,    420,   -637,     10,   1647,   1362,
-  1815,  -2519,  -2363,  -2174,  -1454,    -31,   4125,   3446,
- -3054,  -2953,  -2738,  -2328,  -1636,   1086,   2238,   2132,
- -3089,   -432,  -2674,  -2515,   -168,    745,   2236,   2305,
- -3214,  -2953,  -3159,  -3086,  -2748,  -1200,   3346,   5127,
- -1150,   -501,  -2109,  -1662,   2301,   -401,    651,   1320,
- -3072,  -2608,  -2833,  -2249,  -1387,   7704,   1811,   4960,
- -2474,  -2589,     83,   -499,   -785,    194,   1312,   1442,
- -2716,  -1663,  -2088,  -1812,  -1396,   1862,   -369,   1397
-},
-
-.fcb22m_2 = {
-  8809,  -2291,  -2452,  -1982,  -1356,   -423,    419,    588,
-   897,   1086,     79,  -2155,  -1957,    367,   1080,    233,
-   718,    441,    515,    642,    730,   2454,    774,  -2299,
- -1526,   -784,   -359,     96,    385,    482,   4905,  -2501,
- -2431,  -2047,  -1139,    131,    743,    999,   1243,   1294,
- -2154,   -433,  -2461,  -2201,  -1552,   -163,   -200,   4009,
-  1731,   1652,  -2381,   5295,  -1457,   -895,   3480,  -1230,
-   -94,    471,    554,    669,  -2458,  -1271,    278,  -2238,
- -1852,   -813,    888,   1032,    801,   1008,   -258,   -538,
- -1744,  -2087,  -1651,  -1239,   2222,     -4,    783,    882,
-   478,    782,  -1335,  -1453,   1728,   -627,   -387,   -205,
-   221,    193,  -2282,   -518,   7464,  -1808,  -1134,   -199,
-   340,    321,    410,    617,   2278,   -436,  -2082,  -1958,
- -1493,   -885,    628,    794,    855,    989,    232,  -1115,
- -2617,  -2152,  -1290,  -1299,   -458,    222,   3936,   3349,
- -2240,  -2787,  -2689,  -2255,  -1241,    816,   2307,   1566,
-  1685,   1723,   2960,  -2134,  -2532,  -1798,  -1128,  -1073,
-  5380,   1013,   1525,   1415,  -1976,    456,   -538,  -1433,
- -1347,     22,   -496,    284,    387,    465,  -2214,  -1863,
- -2261,   1049,  -1487,  -1222,   1610,    621,   1000,   1116,
- -2393,   -731,   4075,   2375,  -1178,   -908,   -383,    327,
-   543,    572,  -2071,  -2039,   3310,  -1903,  -1502,    -72,
-   123,    693,    721,    918,  -1866,  -1251,  -1065,   5630,
- -1574,   -541,      1,   1014,    813,    887,  -2145,  -2421,
- -2176,  -1756,   1856,    408,     -1,    759,   1109,   1276,
-  3053,  -2705,  -2467,  -2068,  -1160,   1405,    459,   1167,
-  1219,   1318,  -2198,  -2037,  -2005,  -2204,  -2039,  -1473,
- -1529,    264,   1333,   1822,  -2121,  -1434,   -472,   1901,
-  2448,   -589,   -424,    248,    376,    602,  -1571,  -1032,
- -1243,  -1619,   5682,  -1162,    362,    570,    865,    852,
- -1875,   -805,   4258,  -1569,   2992,  -1175,     51,    164,
-   314,    648,  -2083,   5574,   2553,  -1866,  -1156,   -642,
-  -198,    330,    446,    602,  -2365,   1601,   2873,  -2043,
- -1510,  -1142,    -20,    588,    535,    676,  -2207,  -1637,
-   626,    745,  -1548,   -590,    745,    540,    505,    618,
-   749,  -1389,    857,   1387,   -398,   -606,    -75,    -86,
-    11,     78,   3322,  -1347,   1978,  -1431,   -745,   -280,
-   -42,    135,    350,    376,   -508,  -1349,   2961,  -1184,
-  -647,  -1257,   3009,   -374,    523,    616,  -1848,    -41,
-  2652,  -1609,  -1603,   3284,    -24,    502,    122,    448,
- -2337,  -1029,    734,  -1533,   1523,  -1312,   -754,    335,
-   510,    774,    769,   -117,    139,  -1254,  -1468,   -965,
-  -375,      2,    227,    518,   3187,  -1524,   -776,  -1253,
-  2977,   -530,    319,    -61,    244,    413,  -2290,   3085,
- -1763,  -1480,  -1374,   3272,    -87,    323,    421,    652,
- -2317,  -2182,  -1604,     -1,   -801,   1320,   -156,    907,
-   799,    918,  -1494,  -2205,   1137,     69,   1249,   3437,
-   925,     29,    419,    448,   3574,  -1564,  -1713,   2374,
-  -941,   -252,    123,    263,    366,    539,   1059,  -1856,
- -1753,    766,  -1704,    106,    262,    596,    684,    820,
- -2503,  -1878,   1835,   -594,  -1024,  -2105,  -1567,    488,
-   794,    883,  -1626,   -613,  -1410,   2846,  -1413,   3557,
-  -348,    460,    332,    577,   -907,    700,  -1680,   1130,
- -1637,   -793,   -160,    -38,    473,    630,   1487,   1872,
- -1526,   1379,   -806,    121,   -383,    149,    259,    413,
-   759,  -2817,  -2758,  -2290,  -1348,    460,   1782,   1536,
-  1513,   1503,  -2265,   3193,    117,  -1704,  -1367,   -487,
-   125,    365,    594,    651,  -2287,   1272,  -2537,  -2038,
- -1515,   -578,   2994,    582,    941,   1058,  -1556,  -1583,
-  -720,  -1584,    956,  -1032,   1861,    146,    402,    429,
- -2184,   1667,   1241,    289,     52,   -232,   -265,    210,
-   248,    331,   1133,  -1813,  -1869,  -1429,  -1484,   5620,
-  -400,   1316,   1146,   1150,  -1975,   -818,  -1921,  -2054,
- -1768,   2953,   -544,    426,    856,   1107,    493,  -2019,
-   176,  -1915,  -1040,    717,    -91,    728,    647,    776,
- -2360,    739,  -2136,     30,    636,   -447,   -116,    498,
-   531,    775,  -2250,   8607,  -2075,  -1928,  -1072,   -450,
-    38,    439,    558,    778,   4484,   1056,  -1830,  -1716,
-  -988,   -412,    260,     56,    425,    579,  -2243,   4094,
- -1267,   2172,   -990,   -562,     97,    304,    533,    609,
-   790,    780,  -2029,  -1947,  -1327,   1224,    255,    344,
-   516,    660,   -591,   1702,   -118,  -1402,    396,  -1387,
-  2268,   -247,    177,    355,   1393,  -2318,  -1975,  -1563,
-   863,   -939,   -365,    411,    800,   1019,  -2370,   4656,
- -2301,  -2111,  -1679,   -698,    458,    788,   1004,   1138,
-  2285,   4924,  -1940,  -1955,  -1159,   -436,    237,      5,
-   300,    364,  -2492,   2165,  -2021,  -2072,   1504,   -612,
-   -93,    249,    676,    799,  -2411,   1952,  -1752,  -2418,
- -2285,  -1323,   -621,    837,   1043,   1266,     76,   3160,
- -2176,  -2176,  -1717,  -1105,   1045,    410,    728,    940
-},
-
-.fcb22s_2 = {
-  6946,  -1850,  -1986,  -1590,  -1276,  -1063,  -1026,  -1017,
-  -805,   -346,      9,  -2911,  -2843,  -1899,   -198,   2193,
-  3325,   1315,     37,   -528,   -371,    599,   -751,  -2157,
- -1912,   -855,    988,   1222,   1085,    953,   3212,  -2793,
- -2564,  -1707,   -657,    683,   1109,    683,    647,    446,
- -1906,  -2315,  -2569,  -2428,  -1698,   -600,   1100,   3790,
-  3368,   2172,   2017,   -895,  -1354,   -734,   2552,   -403,
-   -68,   -402,   -752,   -932,  -1205,  -1937,    572,  -1434,
-  -500,   -579,    291,   1723,   1312,   1695,   -238,  -1715,
- -2029,  -1525,   -816,   -363,   2816,    167,   2196,   1793,
-   897,  -1081,   -262,  -1338,   1052,  -1231,    -94,   1296,
-   503,    184,    588,  -2057,   -911,  -1933,  -1769,    167,
-  1013,   1774,   1414,   1289,   2406,  -1906,  -2055,  -1952,
- -1726,  -1618,   -451,    575,   3021,   2569,   -776,  -1649,
- -2111,  -1930,  -1499,  -1349,   -595,    329,   3090,   5458,
- -1954,  -1309,  -1554,  -1159,  -1132,    329,    714,    760,
-  2529,   2417,   1046,  -1025,  -1114,  -1325,   -154,  -1501,
-  4160,   -696,    230,    398,  -2010,    385,  -1344,     36,
- -1269,   -987,   1009,   1453,   1163,   1591,    916,  -1534,
-  -508,    221,  -1596,  -1130,   1394,    539,    676,    676,
-  1263,   2029,    284,   1592,    161,   -124,   -572,  -1362,
- -1946,  -2148,  -1488,   -222,   4967,  -1202,   -939,   -375,
-   -80,   -593,   -445,   -418,   -781,  -1560,     31,   4757,
- -1417,   -954,   -402,    193,   -316,   -278,   -926,   -895,
- -1024,   -436,   2673,   1991,    254,     28,   -861,  -1291,
-  1475,  -2708,  -2689,  -2118,   -703,    290,   1841,   2048,
-  1213,    594,    132,  -2598,  -2427,   -988,  -1111,   -158,
-   478,   2118,   2571,    830,  -1430,   -678,   -773,   1340,
-  2473,   -798,   -751,    215,    274,    -65,    335,  -1947,
- -1796,  -1436,   3862,   -611,    105,    -31,    775,    669,
-  1439,  -1266,   1670,   -739,  -1259,   -572,    -17,   -107,
-   176,    130,   3899,   3478,   -548,  -1429,  -1176,  -1104,
- -1147,  -1503,  -1277,  -1068,   -258,   2645,   1753,   -333,
-  -827,  -1306,   -827,   -502,   -306,   -119,  -1602,  -1644,
-  1922,   1127,   -628,  -1073,    348,    195,    616,    685,
-  1750,   -898,  -1852,   1813,   -700,    254,    598,   -234,
-  -433,  -1035,   2502,     94,    467,  -1672,   -905,    776,
-   679,    -11,  -1071,  -1845,  -1083,   -320,    690,    110,
-  -708,  -1077,   2514,     70,   -412,   -300,   -371,   -717,
-  1700,  -1625,  -1346,   1954,     14,    -64,   -121,    181,
-  -673,   -909,   2274,  -1389,   2058,  -1503,    306,   -187,
-  -209,    -69,   1523,   -632,   -695,  -1283,   -988,   -569,
-  -798,   -521,    398,   2834,   1953,  -2215,  -1626,    106,
-     6,   -498,    -57,    173,    731,   1002,  -1706,   1701,
-  -328,  -1745,  -1398,   2176,    -19,    311,    492,    667,
- -1073,  -1803,  -1684,    703,  -1316,   1803,    659,    913,
-   906,   1033,  -1982,   -102,    945,  -1620,    718,    555,
-   613,     38,    394,    421,   2738,  -1159,  -2248,  -1852,
- -1568,     33,    363,   1490,    935,    561,   1464,  -2466,
- -1209,  -1204,   -692,   2009,    129,    354,    372,    380,
- -2053,   1122,   2272,   -824,  -1355,   -926,   -122,    567,
-   526,    923,  -1320,     59,   -226,   1674,  -1512,   1498,
-  -631,    221,     26,   -247,    -40,  -1615,  -1597,   2111,
-    34,   -813,    200,    219,    758,   1000,    306,    394,
-  -430,   -117,   -409,    -81,   -207,     16,     36,    176,
- -1737,  -2898,  -3005,  -2214,   -568,   2140,   4132,   2592,
-   504,   -521,  -1509,   3610,   1070,  -1890,  -1319,    -11,
-   174,   -148,   -212,   -347,   -464,  -1068,  -2568,  -2532,
- -1973,   -519,   2104,   3713,   1882,   -145,  -1319,  -2375,
- -1862,   -843,   2061,   -266,   1465,    866,    912,   1183,
- -1784,   2072,    205,   -375,   1112,   -374,   -534,   -430,
-  -162,   -204,    375,     82,   -823,  -1148,   -752,   4681,
-  -339,   -247,   -790,  -1088,   -494,  -2302,  -2310,  -1603,
-    46,   3367,    -50,    393,   1383,   1457,  -1377,  -2005,
-   643,    326,    312,   1189,   -225,    563,    261,    -70,
-  -667,  -1191,  -2255,   -470,   1000,    142,   -525,   2285,
-   756,   2061,   -953,   5888,  -1339,  -1534,  -1252,    -16,
-  -116,   -305,   -375,   -596,   3611,   -889,   -511,     43,
-  -809,   -659,   -737,   -510,   -258,   -108,  -1515,   2806,
- -1555,   1025,   -932,   -601,    146,    164,    207,     71,
-  1606,     93,  -2420,  -2311,  -1641,   -244,   1785,    804,
-  1040,    427,  -1510,     38,  -2490,  -1987,     44,    699,
-  1407,    988,   1061,    411,   1162,  -1382,  -2669,  -1635,
-  -905,   1503,    674,   1357,    869,    244,    411,   2612,
- -1792,  -2147,  -1693,   1434,    281,     38,    228,    424,
-  2291,   1354,  -2128,  -1377,  -1014,   -609,    131,   -151,
-   418,    602,    111,   2200,  -1547,  -1153,   1435,  -1282,
-     6,   -111,     -1,     92,    238,    613,  -2271,  -1181,
- -1455,   -919,   -182,   1066,   1932,   1679,  -1715,   2825,
- -1764,  -1759,   -741,   -829,    501,    746,   1056,   1416
-},
-
-.fcb44l = {
-  4868,  -1851,  -2031,  -2019,  -1751,   -552,    756,    929,
-  1389,   1590,  -2090,  -1202,  -1317,    516,  -1798,  -1020,
-  -694,   4322,   1388,   1904,  -2605,  -1239,   1005,   -757,
- -1248,   -358,    699,   -201,    409,   1093,  -2901,  -2254,
- -2605,  -2595,  -2104,  -1681,   6854,   2692,   3155,   3446,
- -2535,  -1421,  -1745,    898,  -2046,  -1457,  -1044,   -269,
-  1748,   1873,  -2268,  -1098,    407,  -1865,  -2103,   1510,
- -1217,   -399,   1718,   2017,   3638,  -1685,  -1547,  -1480,
-  1637,   -744,    580,    586,   1313,   1409,    617,  -2020,
- -1919,  -2179,    932,   -937,    559,   1795,   1528,   1596,
- -2867,  -2553,  -2507,  -2653,  -2365,  -1985,   -170,   8679,
-  4271,   4273,   2263,  -1835,  -1934,  -1719,  -1778,   2357,
-   125,   1319,   1543,   1765,   3689,  -1215,   2369,  -1533,
- -1611,   -771,   -123,   1005,   1297,   1465,  -2491,   2631,
- -1636,  -1655,   1244,  -1178,    386,    961,   1300,   1553,
- -2357,  -2404,  -2305,  -2177,  -1714,   -383,    -98,    258,
-  3902,   2475,  -2923,  -2580,  -2685,  -2803,  -2678,  -2428,
- -1247,    450,   8174,   5035,  -2302,  -1629,  -1495,   1832,
-  1616,   -577,    639,    872,   1122,   1437,    785,  -1947,
- -1976,    823,  -1909,  -1005,    430,   1244,   1713,   1664,
- -2537,   8025,  -1705,  -2005,  -2030,  -1155,     64,   1106,
-  1975,   2277,  -2410,  -2639,  -2292,  -1858,    162,    744,
-   555,   1559,   1719,   1806,  -2282,  -1982,  -1914,   1415,
- -1785,   2197,    254,    763,   1338,   1741,  -2509,  -1991,
- -2328,  -1853,  -2299,   5145,    -34,   1495,   2913,   3018,
- -2009,  -1736,   2411,  -1595,   1877,  -1316,    693,   1042,
-  1565,   1744,  -2657,  -2161,  -2222,  -2135,   4454,  -1784,
-  1331,   3208,   2852,   2955,   3738,  -1338,  -1425,   2090,
- -1601,   -279,     -2,    712,   1220,   1436,  -2385,  -1265,
-  7093,  -1561,  -1742,  -1003,    283,   1009,   1843,   2055,
- -2251,  -2175,   2310,  -1321,  -1976,   1874,    164,   2781,
-  2721,   2487,   2519,  -1101,  -1539,  -1575,  -1487,   -724,
-   -25,    355,    643,   1011,  -2296,  -1799,  -1895,  -1700,
-  2743,   -924,   -254,     32,   1504,   1910,  -2811,    898,
- -2363,  -2518,  -2408,  -1737,   -936,    221,   2588,   2527,
- -2535,  -2360,  -2477,  -1861,  -1882,   1833,   3587,   1307,
-  2141,   2274,   -433,  -1994,  -1692,  -1318,  -1398,   -350,
-  1518,   1923,    835,   1262,  -2246,   3383,   2458,  -1464,
- -1874,   -983,   -157,    531,   1490,   1729,   9543,  -1713,
- -2011,  -2015,  -1870,   -969,    -34,   1160,   1724,   1919,
- -2530,    140,  -1923,  -1730,  -1720,   -605,    629,   1577,
-   974,   1373,  -2268,  -1582,   -933,   1124,  -1624,   -514,
-  4156,   -118,   1515,   1907,  -2267,   -574,  -1311,   -954,
-   -47,  -1259,     15,    364,    854,   1009,  -2221,    629,
-   994,  -1646,  -1324,  -1509,   2359,   3453,   1393,   1912,
-  3586,  -2286,  -2537,  -2560,  -2415,  -1748,   -368,   3093,
-  2881,   2611,  -2556,   2792,  -1558,   1117,  -1681,    -65,
-   -36,    516,   1233,   1514,    531,  -1814,    998,  -1795,
- -1693,   -871,    725,    868,   1504,   1465,    907,    300,
- -2060,  -2366,  -2392,  -1881,   -596,   1754,   2169,   2104,
- -2755,   2709,  -2298,  -2627,  -2423,  -1875,   -733,   3886,
-  2648,   2821,    623,   -541,   -163,   -319,     85,     84,
-    15,    716,    511,    572,   3948,   2773,  -1504,  -1746,
- -1832,   -934,    -78,    988,   1277,   1518,  -2678,   2216,
- -2162,  -2331,  -2076,   -968,   3445,   1070,   2077,   2206,
- -2892,  -2425,  -2674,  -2905,  -2844,  -2584,  -1381,   3269,
-  2696,   3281,  -2090,   -369,  -1515,  -1367,   -200,   2089,
-   739,    700,    866,   1169,  -2276,  -1057,   2851,   2589,
- -1686,   -515,    -65,    579,   1278,   1593,  -2837,  -2458,
- -2565,  -2783,  -2843,  -2468,  -1704,  -1531,   1475,   4153,
- -2209,  -1857,  -1873,  -2177,    758,  -1531,   3207,   1163,
-  1506,   1851,  -2383,  -1683,  -1839,   5772,  -1815,   -465,
-   361,   1086,   1912,   2140,  -2629,  -1688,   1608,  -2190,
- -2419,  -2064,  -1253,   1397,   2099,   2306,    513,   1664,
- -1683,  -1629,  -1682,   -109,    269,    695,   1072,   1317,
-   208,  -1602,  -1918,  -1038,   -813,    312,     24,     26,
-   761,    990,  -2288,  -2225,  -1948,  -1932,  -1832,   -949,
-  -450,    920,    805,   1468,  -2897,  -2633,  -2557,    464,
- -2174,  -1157,   1170,   2230,   2550,   2522,  -2643,  -1928,
- -2255,  -2578,     82,  -2206,    -63,   2663,   2007,   2292,
-   226,  -2541,  -2687,  -2753,  -2229,  -1556,    785,   3837,
-  2331,   2492,  -2496,  -1740,  -2465,  -2295,  -2151,   1142,
-   363,   3967,   1943,   2432,  -2619,  -2400,    520,  -2274,
- -1900,  -1486,   2135,   1407,   2300,   2288,  -2811,  -3066,
- -3128,  -3098,  -2529,  -1475,   2172,   3413,   3613,   3571,
-   564,  -2347,  -2257,  -2377,  -1944,  -1771,   -582,    509,
-  1683,   1975,   -285,  -2136,  -2529,  -2464,  -2117,    278,
-  1094,   1042,   2192,   1976,   1781,  -1874,  -2042,  -2103,
- -1744,  -1044,   3373,   1252,   1861,   1873,  -2688,  -1849,
- -2462,  -2494,  -2105,  -1903,   2221,    250,   1653,   2233
-},
-
-.fcb44m = {
- 13151,  -1763,  -2583,  -2518,  -2181,  -1036,   -537,   -112,
-   214,    590,   -608,  -2270,  -2228,  -1301,  -1018,   3687,
-  -471,   -282,    909,   1665,  -2426,   1713,   -808,  -1240,
- -1366,   -976,   -140,   1730,    683,    191,   7253,  -2076,
- -2733,  -2698,  -2253,  -1116,    376,    687,   1314,   1532,
-  -820,  -1471,  -2092,  -2047,  -1796,  -1347,   -732,   6348,
-  2529,   1441,  -1460,  -1845,  -1046,  -1643,   8086,   -928,
-    90,    660,    428,   -188,    604,  -2022,    556,  -1680,
- -1641,   -902,    834,    941,   1480,   1906,  -2439,  -2573,
- -3091,  -2853,  -2419,  -1606,   2312,   2624,   2659,   2659,
- -1286,  -2273,  -2400,  -1826,   2443,  -1391,    685,   1822,
-  1810,   1625,  -1993,   -731,   9737,  -1476,  -1183,  -1244,
-    34,    -85,      0,    201,   4171,  -2430,  -2869,  -2866,
- -2488,  -1154,  -1253,    282,   2715,   3643,  -2130,  -2522,
- -3259,  -3051,  -2977,  -2204,  -1264,   1103,   7113,   7948,
- -1271,  -1694,  -2011,  -1294,  -1607,    247,   -303,    715,
-  4276,   1908,  -2337,  -2111,  -2232,  -2123,  -1648,  -1302,
-  7686,   1213,    982,    984,  -2594,  -2127,  -1981,  -2104,
- -2405,  -1966,   -936,    -95,    326,    672,  -2263,   -893,
- -1367,   1288,  -1321,  -1351,   2503,    747,    390,   -247,
- -2220,   -860,   3641,   3766,  -1724,  -1487,   -531,    239,
-   134,    -82,  -2563,  -1537,   3883,  -1911,  -2109,  -1713,
-  1056,    726,    977,   1091,  -1874,  -1366,  -1628,  11069,
- -1653,   -696,    118,    -78,    337,     29,   2449,  -1438,
-  -601,  -1533,   -816,   1262,    540,     79,   -460,  -1403,
-  3204,  -1918,  -1892,  -1911,  -1468,   -976,    -42,   2785,
-  1088,    564,   -236,  -2267,  -2324,  -2130,  -1880,   -427,
-  -258,   -543,    903,   5142,  -1791,  -1611,  -1073,   2911,
-  2993,  -1295,   -400,    229,    192,    -85,   4461,  -1711,
- -1431,  -1640,   3525,  -1398,   -101,   -219,    327,    415,
-  -669,  -1520,   6595,  -1291,   5123,    155,   -480,   -518,
-  -552,   -890,  -2609,   7074,   3220,  -1054,  -1852,  -1165,
-   -25,     89,   -361,   -140,  -1610,   2214,   2903,  -1737,
- -1704,  -1178,   -708,   -171,    177,    674,  -1075,   -890,
-    82,    463,  -1432,  -1048,   -703,   -759,   -247,    344,
-  2448,   -656,  -1135,   4366,   -583,   -705,     40,   -314,
-  -676,  -1271,   4389,   -952,   3249,  -1606,  -1524,  -1172,
-  -490,     97,    128,    -91,    -66,  -1293,   1696,  -1114,
- -1455,   -519,   2620,    479,   -257,  -1512,  -2037,  -1281,
-  1752,  -1285,  -1812,   2789,    -52,    676,    409,    296,
- -1977,  -1043,    270,  -1615,   2131,  -1051,   -161,   -498,
-   767,   1673,   1044,     27,  -1107,  -1730,  -1856,  -1264,
-  -275,   -167,    893,    443,   3850,     97,  -1244,  -1691,
- -1566,  -1088,  -1062,   -837,   -159,   1830,  -1424,   2494,
- -1878,  -1532,  -1991,   2919,     62,    399,    524,    381,
- -1340,  -2415,  -2028,    218,  -1342,    410,    815,    533,
-   948,   1998,  -1213,  -1847,   3691,  -2123,   1822,  -1548,
-   537,    987,    356,    123,   3876,  -2476,  -2021,  -2195,
- -1562,   -737,   2250,    709,    797,   1102,   2065,  -2258,
- -2394,  -1816,  -1536,   1059,   4653,   1457,    456,    -27,
- -2226,   -736,    765,  -1879,  -2188,  -1793,   -928,    892,
-  1793,   2257,  -1182,  -1646,  -1789,   6105,  -1936,   4316,
-  -307,   -143,    223,    236,  -2213,  -1862,  -1823,   3326,
- -1810,  -1384,   -453,   1007,   1331,   1405,   4135,  -2298,
- -1657,   1981,  -1702,   -853,   -318,    298,    760,   1025,
- -2537,  -2782,  -2985,  -2687,  -2839,   4493,   -448,   4249,
-  3048,   2678,   1045,   3227,   -690,  -1390,   -976,   -652,
-   587,    194,   -749,  -1358,   -730,    250,  -2404,  -2548,
- -2157,  -1027,     32,   2091,   1059,   1360,    262,  -2135,
- -2061,  -1777,  -1614,   -246,   2004,   2605,   1516,   -948,
- -1060,  -1076,  -1643,   -748,    144,   1595,   1730,    531,
- -1086,  -2182,   -483,  -2191,  -2411,  -1983,  -2345,  10051,
-  -841,   1456,    924,    207,   4652,  -1831,  -2026,  -1710,
- -2235,   4036,   -755,    -70,    533,    887,  -1899,  -2326,
- -2129,  -2115,  -1606,   1443,   2557,    941,    618,    527,
-   949,  -1547,  -2067,  -1785,    455,    -60,     79,    202,
-   912,    954,  -2527,  14551,  -1893,  -2315,  -2609,  -1844,
-   497,    287,   -197,    626,   6839,   -804,  -1299,  -1259,
- -1109,    -97,    976,    144,   -343,  -1375,  -2334,   3740,
- -1049,   2980,  -1739,   -474,    223,    137,    155,   -171,
-  2962,   1814,  -2378,  -2643,  -2249,  -1109,    858,    643,
-  1630,   1399,  -2098,    974,  -1718,  -2193,  -2146,  -1488,
-  3353,   -147,   1187,   1266,   1559,  -2532,  -2941,  -2759,
- -2101,  -1098,   1562,   1049,   2045,   2159,  -2298,   7439,
- -2129,  -2361,  -2318,  -1552,   -422,    482,    985,   1111,
-  6050,   5657,  -1698,  -2267,  -2127,  -1135,   -140,   -286,
-  -352,   -124,  -1230,   3492,  -1370,  -1221,   2958,  -1239,
-  -472,   -722,   -169,    -89,  -2310,   2988,  -2367,  -2421,
- -2589,  -2034,   -662,    421,   1863,   2736,  -2612,   5429,
- -2104,  -2257,  -2440,  -1817,   4819,    883,    622,    636
-},
-
-.fcb44s = {
- 11239,   -328,  -2011,  -1713,  -1662,  -1290,  -1225,  -1520,
- -1541,   -912,    400,  -1103,  -2698,   -162,    263,   -964,
-   668,    405,    732,   2493,  -2491,   1000,  -2910,   -793,
- -1351,   -515,   1051,   2002,   1757,   2150,  -2010,  -2021,
- -2254,  -1896,  -1953,    664,   7067,   2632,    531,  -1367,
- -2228,   2113,  -2019,   2309,  -1458,   -426,   1242,    338,
-   205,   -222,  -1317,  -1806,  -2477,  -2427,  -2477,  -1852,
- -1472,   -911,   2261,  10280,  -2369,    382,   3180,  -1210,
- -1601,   -748,   -732,    504,   1440,   1142,    -13,    610,
- -2457,   -739,  -1318,  -1013,    -52,   -470,    627,   4734,
-  1248,   2947,   -631,   1560,   2096,   -833,  -1173,  -1475,
- -2060,  -2189,    967,  -1451,  -1544,   -758,   -538,    -31,
-  1395,   3550,     -3,  -1999,  -1975,  -1734,  -2680,  -2512,
- -2037,  -1306,   -252,   1288,   6012,   4834,  -1087,   3259,
-  3115,  -1369,  -1136,   -948,   -264,   -582,   -677,   -643,
- -2500,   1284,   -317,  -1872,  -1150,  -1150,    310,    832,
-  1597,   2842,   6295,   3806,   -671,  -1536,  -1460,  -1256,
- -1223,  -1504,  -1672,  -1471,   1358,   1004,  -1893,   1114,
- -1643,   -103,   -513,    189,    303,    140,  -1618,   -648,
-  -720,   7274,    573,   -180,   -731,  -1226,  -1564,  -1742,
-   151,   2103,  -1562,   -974,     94,    546,   3536,   -205,
- -1657,  -2534,  -2187,   2840,  -1248,    451,   2615,    171,
-   479,   -305,  -1299,  -1708,  -2144,  -1593,  -1289,   2766,
-  2287,   -400,    188,    -51,    141,    105,  -2128,   4976,
- -1690,  -1216,  -1175,    297,   1454,    449,   -478,   -970,
- -1914,  -1459,   3036,   2668,   -950,   -634,   -507,   -374,
-     4,     34,  -1664,   2901,    847,   2817,  -1154,  -1651,
- -1262,  -1160,   -624,    629,   1578,    765,  -2002,  -2121,
- -1527,   1938,   -272,    113,    287,    955,  -1473,     60,
-  8047,    137,   -534,   -841,  -1077,  -1504,  -1788,  -1758,
- -1871,    119,    931,   1775,   -704,   2792,    354,   -501,
- -1370,  -2038,  -1031,  -1631,  -1914,   -879,    377,   7589,
-   173,   -196,   -491,  -1658,   3790,   -773,  -1731,   3028,
-    49,  -1013,   -563,  -1232,   -953,   -730,  -2568,  -1926,
-  -679,   -267,   -324,   -962,     51,    461,   2728,   3631,
-  3533,  -1690,  -2846,  -2370,  -1945,   -917,   -551,    276,
-  2634,   3558,  -2592,  -1750,  -2422,  -1586,  -1204,  -1001,
-  4603,   1802,   2673,   1685,   2710,   -853,  -2321,  -1919,
- -1603,   -868,   3706,    290,    570,    338,  -2245,  -1704,
- -1915,    545,   -787,   1635,   1725,    526,    666,   1604,
-   642,  -1154,   3231,  -1232,  -1772,   -623,    217,     27,
-     3,    641,  -2411,   1924,   -967,  -1583,  -1499,   2316,
-  1354,   -115,    333,    559,  -1721,   2475,  -1942,  -2114,
- -1196,   -571,   1769,   2350,   1315,   -607,   4510,  -1414,
- -2228,  -1312,   1439,    469,   -248,   -399,   -270,   -721,
- -1517,  -1247,   -771,    -36,   6488,    942,   -279,   -572,
- -1041,  -1908,  -2388,  -2281,  -2595,  -2275,  -1529,     51,
-   471,   4435,   3002,   2738,   4049,   1562,  -2706,  -1672,
- -1649,  -1204,   -518,   -280,    774,   1344,      6,  -1950,
- -1521,  -1768,   -972,   1420,   3011,   -191,    644,   1478,
-  3220,   -313,   3030,   -153,   -841,   -739,   -378,  -1013,
- -1410,  -1815,  -2104,  -1033,  -2097,  -1992,   -943,   2391,
-   424,    369,   1601,   3331,   1494,  -2060,  -2027,   1579,
- -1407,   1120,   -280,   -197,    761,   1048,   -710,   4094,
- -1533,  -1984,  -1620,  -1132,   -515,   -485,    971,   2644,
-  3979,   -661,  -1891,  -1120,   -897,   2484,   1623,     21,
- -1534,  -2438,   3201,  -1510,    858,  -1459,   -711,  -1332,
-  -833,   -240,    763,   1096,  -1435,    -29,   3174,  -1773,
-   -19,    708,   1680,    403,   -910,  -2224,  -2670,   -619,
-  1320,   -751,  -1323,  -1022,   2875,   1080,    985,      1,
-   191,   7823,   -475,   -604,  -1126,   -967,  -1139,  -1600,
- -1767,  -1161,  -1342,  -1960,  -2112,  -1793,  -1596,   3103,
-   535,   2001,   3235,    151,  -2266,   -807,  -1977,  -1661,
- -1255,   2328,   2632,   3189,    621,  -1130,  -2183,  -1127,
-  2391,   -884,   2173,   -690,   -354,   -516,    352,    954,
-  1847,    -74,  -1260,  -1839,   2557,  -1221,    228,   -630,
-  -162,    386,   1462,  -1889,  -2596,  -2216,  -1869,   -518,
-  1281,   2329,   2653,   1117,  -1535,  -1038,  -1752,  -1862,
- -1635,  -1067,    994,   5212,   2719,   -264,  -2021,   1824,
- -2110,   -619,   1538,   -397,   -332,   -153,    860,   1281,
-  6568,  -1790,  -2459,  -1707,  -1708,   -799,    294,     89,
-   475,    992,  -1668,  -1819,  -2010,  -1623,   2079,   3255,
-  -388,    591,   1477,    581,  -1544,    476,  -1825,   -959,
- -1296,  -1037,   -453,   1146,   4693,    839,   2027,   3021,
- -1731,  -1746,  -1964,  -1115,   1197,    102,    164,   -162,
- -2301,  -1281,  -2022,   3983,  -1122,   -281,     85,    352,
-  1042,   1599,   6463,    -93,  -2010,  -1988,  -2282,  -2189,
- -1915,  -1721,     17,   4694,    424,   -998,   -111,  -1995,
- -1246,  -1176,     78,   -116,   1951,   3059,  -1974,  -1783,
- -2243,  -1238,   3935,   -928,    -15,   1265,   1536,   1907
-},
-
-.shape08 = {
-  5279,   1101,  12974,   5624,   2029,   3853,   5918,   1516,
- -2905,   -224,    -92,   -819,    803,   1091,   3091,  -3355,
-   152,  -1214,  -7317,   -738,  -8973,    546,  12035,   -937,
-  2216,   2113,   1214,  -6577,   2006,  -1661,   -673,  -5880,
-   496,    454,   3400,    676,   -322,  11388,    634,  -1169,
- 12556,  -5804,  -7724,    588,  -6801,   1080,    354,  -1681,
-  -942,   1926,   -487,   -580,    156,     79,  15253,    667,
-  1155,    655,   -719,   1999,   -785,    214,   2822,   1020,
- -1967,     73,   -387,   -137, -15225,  -1552,   -357,   2830,
-  2140,   3070,  -2552,   2410,   1230,   4131,    999,    248,
-   531,   -909,   3948,  12858,  -8056,   2205,  -2837,   -171,
- -1633,   -129,    -93,   1852,  -1920,    157,   9647,    -84,
-  -150,  -1365,  -1522, -13197,   6168,  -3195,   5890,  -1724,
- -6407,  -1340,  -7435,   -621,  -5732,  -2895,    145,   3974,
-   728,   9840,   -494,   7357,   -394, -13614,   -256,  -1930,
-   468,   -266,   8001,   -153,   -365,   7652,    135,   1400,
- -3869,   1091,  -4935,  -2884,   1259,   6819,   1025,  -6667,
-  1079,  -9794,   6827,  -4166,   1108,   1149,  18861,    593,
-  -177,  -1067,   -644,  -2164,   4727,     85,   -101, -10805,
-  -247,   8918,   2261,   5475,    756,   3018,  -6535,   1941,
-   359,  -4229,   1206,    958,   -878,    554, -18780,   2289,
-  4906,  -7412,  -7685,   7932,    965,   2460,   4423,   -563,
- -3668,  -3482,   3307,  -1737,    971,  -7480,  10742,   1978,
-  2365,     20,  -3625,    466,   2056,  -6602,   9396,   3145,
-  3162,   1857,   -630,  -6905,   1660,  -3024,  -2159,   1109,
-  1282,   2767,    210,  -2203,   3099,  -7889,   1805, -13115,
-   988,  -6235,   1566,  -1399,  -9612,   1821,   -519,    -57,
-  3428, -14024,   1141,  -2542,  -9396,    -17,    440,  -8591,
-  2271,  -7811,   1891,   -935,  -4330,  -1303,    362,    426,
-   319,   1176,   3176,   2202, -14308,   -619,  -2942,  -2271,
-  -531,   -652,    345,  17681,   1453,  -1561,    341,  -2077,
-   933,    433,   1529,    463,  -1095,   4912,   -840,  16266,
-   973,   1732,   -718,   6702,  -3659,   4037,   -704,  -2707,
-  1423,   1291,   2300,    149,   -933,  -1338,   2019,   6173,
-   481,  14937,   -364,   3896,   -443,    992,   -896,    378,
-  -226,  -1505,    268,   -428,  -2622,   -289,  -2069,  10472,
- -3880,  -5330,    385,   3053,  -4642,   1525,  -1557,    716,
-  2504,    848,   -450,  -2018,   -458,   -705,  -7120,   -543,
- -2138,   2548,   -351,    737,  12906,  -1012,     63,  15357,
-   332,   -837,   -225,  -1299,   2843,   1334,   -669,   2083,
-  -707,   1171,   8219,   2190,  10567,   1370,  -1376,  -2919,
-  2108,  10098,   -388,   4442,    164,    490,   7580,     26,
- -1848,  -2919,    640,   4758,   -108,   8194,  -1325,  -2314,
-   447,   5178,  -1095,   9902,   -693,  -3624,   -223,    690,
- 10495,    776,   -919,  -1621,   2046,    469,   1454,   3681,
- -1090,  -1776,   1457,    212,   2054,   -994,    698,   -496,
- 22347,   -623,    254,    960,  -4073,    531,  -2572, -14393,
- -1022,    258,  -3667,    994,  15242,   5078,  -3618,   1925,
- -1229,  -1754,   1715,   4358,   1286,  -2360,  -4590,   1824,
-  7864,   1423,  -2146,  -2763, -10635,    474,   -829,   1159,
-  -157,    -54,   -158,    -29,    202,   -383,    285,     -2,
-   862,   -364,    415,   -123,   -145,  -9733,   1167,  10199,
- -1408,  -2992,   2131,   -412,   4743,   2992,   3555,   -617,
-  9606,  -2831,   2357,   5300,    625,   -678,   -500,   -128,
-   -56,  -6327,  -1122,  -2567,   1904,  -1804,    709,   3194,
-  -148,  -1371,  -6534,  -1748,  -1490,  14159,   1466,   1395,
-  1101,  -2725,    503,     68,  -1486,      0,    211,  -1218,
-    -3,  20920,   1709,   -208,   -839,   4574,  -6084,  -6557,
-  -103,   -984,   -375,   8409,   1715,  -2170,  -5003,  -3296,
- 13482,   1211,  -4159,   3496,   1040,   6925,    213,  -1398,
-   441,  -1231,   -814,    842,   1574,   1145,   1359,    437,
- -1777,  20566,    259,  -4573,  -1412,   -158,  10144,   1269,
-  1405, -12631,  -1104,   -615, -15892,    355,  -3795,  -1158,
-  3241,    252,    232,   -179,   -617,  -2038,    285,  -1014,
- -1248,   1835,  -1558,   1266, -10207,    629,   -312,  11376,
-   154,   -288,   5915,   -353,     60,   2695,   -853,   -103,
- 15659,   2403,  -1184,      3,   9236, -10953,   4434,    829,
-  2563,   -164,   -848,   -646,   7247,    895,   1726,   -752,
-  -979,   1053,   -971,    318,   2180,    927,    804,   -262,
-   446,   3261,  -4926,  -4523,   1247,   2039,  12770,  -1191,
- -1310,  -5574,   4763,    657,  -4139,  10821,   -805,  -1109,
- -3189,  -1721,    167, -10022,  -1877,   2123,    328,  -7048,
- -2130,   2431,   1522,   3209,  -8448,   1810,  -5412,   9815,
- -3677,   6575,  -6237,   -929,   -434,  -2375, -13586,   3497,
- -1140,   1227,  -6354,   -507,    329,  -1690,   1079,   -880,
- -3743,  -4021,  -4645,  -6053,    958,   4594,  -1122, -11628,
-  1537,  -3418,  -1242,    133,  -9335,   1611,   -432,  10733,
-  -885,   -468, -13466,    690,    214,   8968,   3441,   5451,
-  -219,   5492,   -377,    409,   3812,   2450,    508,   6542,
-  3824,  -3705,   -514,  -8262,   1537,   7969,    946,  -2869,
-  8762,    417,   5094,   2104,   6694,   -342,   1259,  -4779,
- -1445,  -1519,    333,   4385,    652,   -386,   -580,  -1892,
-  -873,   1862,   2704,  13837,  -5415,  -1975,   5881,   7150,
-  8272,  -6412,    704,   1854,    257,  -3746,  -9789,  -9634,
-  -924,   1393,  -3237,    259,    -56,   4390,   4902,   1172,
-  5114,  -2616,  -4409,  -1180,   4691,   7400,   -625,   8873,
-  6846,  -1224,   -213,  -5296,  -3504,   -147,  17828,  -1347,
-  3251,   1702,   1440,  -2364,   -491,   -227,   1765,   -446,
- -9746,  -2019,  11287,   -195,  -9559,   -312,    888,   5789,
- -1753, -11069,   2537,   -265,  -1762,   -779,  -8501,   -308,
-   -89,   1973,   3640,  17344,   1326,   -689,   -398,  -3820,
-  2167,    229,   -636,   2142,  -6587,   -751,  13243,    465,
- -5946,   -202,   -968,  -1060,   -240, -10626,   3405,   1302,
- -1263,    972,  11351,    100,   2266,   -930,  -2108,   5350,
- -3186,  11130,   2073,  -5616,    650,   2000,   1048,   5628,
-  -531,    674,   8453,   1030,   1152,  12095,    352,    409,
- -1029,  -1236,   -190,  -5724,   -589,   3550,   1958, -14081,
-  -339,   1672,  -1659,   4518,    -75,   -638,   5501,    277,
-  -578,  -2185,    157,   2066,   8634,  -2403,   1617, -12487,
- -1881,   8273,    179,  -2152,  -1294,   -512,   -415,    456,
-  -141,   -125,   -405,    132,     49,  -1978, -19085,   -451,
- -1480,    324,  -5397,    235,  -1217,    346,  -1258,   3540,
- 10075,  10291,   5060,  -2057,   6156,   -992,   9344,  -3718,
-  4296,    895,  -8464,    341,   1426,    648,   1494,   2895,
- -3760,  10139,  15531,   -984,  -1550,  -1319,  -1542,   -119,
-  -517,   -185,  -3368,  -9279,  -3455,  -4257,   1092, -10120,
-  5072,   3099,    986,  -2562, -12068,   1932,   6489,    950,
- -2417,   1362,   -567,    591,   -715,   -515,   3506,   -726,
-  6319,    214,   -364,   3611,   1895,  -2005,   -273,   1513,
-  2379,    475,  -4855,   -527, -11493,     27,   4343,  -2394,
-  -639,   -744,  -2601,  10917,   1910,   2449,   1238,  -2175,
-  5322,  -4054,    -40,   4274,    684,   8152,    966,  10882,
-   -13,   4253,   -287,  -3192,    548,   2020,    189,  -6894,
-   797,   2160,    579,   4084,   1767,  -4011,   -640,   7697,
-   791,    945,   1230,   6491,   1508,  -3762,   -433,  11340,
-  -129,  -1131,  -5121,   3148,   1544,  -7648,   1866,   9660,
-  2365,  -2110,    782,    -82,   3666,   -701,    303,    298,
- -1934,   -125,  -1427, -17589,  -1188,    175,  -7046,   -488,
-  1121,  -6594,    489,  -1551,  14349,   1499,   -544,  17132,
-   198,   2516,   2479,   -978,   -214,  -3399,  -1223,   2094,
-   130,  -1020,   1049,   -710,  12801,   -498,    297,  -1365,
-  -187,  -3169,   -123,   9019,    958,    221,  14234,   -590,
-   961,   3092,      8,    255,  -4586,   1789,   2522, -12577,
-   -91,   -822,   -805,   -714,   5298,   1299,   3306,  -1288,
- 13176,    235,   1754,    -67,   1912,   -604,   3240,  -2048,
-  -200,    772,   -173,   -996,   1368,   2380,    294,    763,
- 19665,   -196,    528,    182,  -2394,    923,    749, -13578,
-   855,    589,  -9553,      0,   5737,  10399,   9147,  -1655,
- -3735,   1246,  -2429,  -1147,  -2199,  -2953,    614,  -1404,
-  -449,  -8524,  -2271,   5001,  -9517,   2940,   -204,   3625,
-  -258,     32,   1521,   -299,  -1786,  -2836,   1523,   2427,
-  -835,   3139,   -197,   3351,   -279, -14766,  -1267,   5169,
- -1039, -10967,     58,    641,   -767,  -1193,   -591,   -716,
-  -834,   8109,   -915,   -711, -10427,  -1680,   -638,   2643,
-  -850,   -258,  10452,    362,  -5394,   -349, -14727,   -655,
-  1040,   1722, -10265,    551,   -283,   9888,    408,   -400,
-  5980,   1878,    781,   -923,   -667,   -789,   -348,    624,
-  -260,  14515,   -804,   1721,     -2,   5356,   1802,   1218,
-   498,   1871,   -988,  16295,   4163,  -2342,  -4290,   3121,
-  3269,    112,  -3492,   1124,  -1496,   1863,  -1426,  -1090,
-  1598,   -197,   1160,  -1660,  -1094,    477,  -4104,   -396,
-  1605,  26134,    746, -12876,   2320,  -1690,   8626,     39,
-  1341,  -1254,  -1890,   2555, -13996,  -1218,   3827,   1216,
-  -909,   -180,   1720,    -87,   -143,    989,    340,  -1426,
- -4029,   3141,  -9424,    466,  -8227,    422,  -7379,   2038,
-   401,     98,   3602,  -1223,   -946,   2469,   1159,    727,
-  -268,    467,    203, -11079,   3850,  -3469,  -1965,  -1857,
- -1415,  -2477,   3173,   7352,   9483,  -5541,   6212,   1886,
- -3868,   2728,    577,  -5057,    321,    972,    -77,     47,
-   227,    -38,  -1037,   -222,   -347,   -341,   1179,   -948,
-   592,  -7485,   2218,  -5955,   2698,  11798,    197,   6260,
-  1711,    998,      8,  -6223,  -1184,   1145,  -1781,   1376,
-  1394,    388,   -689,   2279,   6511,   2542,  -4903,   3917,
-  -790,    535,  -1903,  -4448,   4216,    -22,  -6715,   5204,
-  4807,   3193,  -1064,   5403,   4503,  -2434,  -4296,   1383,
- -1514,  -4103,    747,   3928,   2987,   9513,   2492,  -8691,
-  -993,  -2667,    -40,   -170,  -3116,    611,   2367,  16297,
- -1256,  -1404,  -3462,    466,   -524,   5464,    491,    706,
- -7491,   2027,    373,  -4086,   1620,  -7789,    704,   5002,
-  1706,   8325,   -851,  -9883,  -3072,   4475,   2696,  -8549
-},
-
-.shape11 = {
-    44, -10592,   -832,   -413,    612,    530,    379,    753,
-  1442,  -3006,   -858,  -1077, -12018,   -196,   -771,  -1142,
-  -628,  -2938,   -439,  -3323,     20,  12513,  -2462,  -1270,
-   -57,  -8417,   -690,    790,    276,   2349,   -341,  -1644,
-   230,  -2176,   -202, -14725,    170,   1725,   3030,    683,
-  -231,    641,   -242,  -3252,    110,  -1440,   2886,  -1467,
- -1155,  14395,    297,     52,    240,   3938,   9880,  -7555,
- -1214,   3351,    129,  -1269,   -168,    669,  13765,  -1289,
-  -465,  10017,   -632,   -328,   -276,    -33,     31,  18883,
-  -148,   -131,    525,   1669,   2288,   -203,    868,   -660,
-   248,   -409,    -91,    295,  -9174,  -1484,    929,   2824,
-  1097,  -3205,   -113,   2712,  -1544,    527,   1419,   -963,
-  -388,    691, -16791,    -84,     72,  -3802,   -357,   1633,
--15182,     62,  -6024,   -742,  -5396,   4470,   -198,      1,
-  1428,  -1691,  18715,   1402,  -2539,   -375,  -8455,   -901,
-  -147,  -3274,   9359,   -277,  -8941,    714,   2834,   2924,
- -6326,    907,   -123,  10487,   -484,  -4772,    877,   9840,
-  -505,  -7562,    301,    671,    116,   -371,   3740,    359,
-   385,  -5145,   -908,    156,   9639,   3782,  -9688,  -4214,
-  -945,  -7685,    334,   2185,  -1342,    388,  -1741,    278,
-  -231,   -912,    905,  -1039,    598,   2049,    662,   -198,
- 22378,    166,    116,  -1699,    335,  -8380,   1279,   1536,
- 14955,   1254,    190,  -2519,   -608,    364,   -561,   5748,
- -1178,   -923,   3183,    -59,  13880,  -2530,    241,   -564,
-  -319,  -7510,     -9,   -124, -20346,    305,    -25,   -400,
-   222, -16943,   -488,    802,  -1685,   3323,  -6198,   1000,
-  -903,   -846,   -387,    462,    847,    526,  10024,   2020,
-  2090,  -9563,   1416,    169, -12182,   -428,  10388,    869,
-  1068,   2201,  -1041,  -3180,    152,   -646,      4,   4017,
- -1069,    307,   5283,   3021, -13662,   -493,      9,    542,
-   152,  -2617,  -3870,   -514,  13497,   1180,   -603,   1255,
-  2396,   7418,   8902, -11165,  -2626,  -5719,   1764,    858,
-  1105,   1476,  -1764,   1969,    977,  -1738,   -928, -13940,
-  1444,  -4157,    836, -12243,   -369,   -256, -15681,   5320,
- -5170,   -509,    353,  -1581,  -1455,    965,    716,    209,
-  -883,   -317,  -1961,   9128,  -8197,   2173,  -2434,  -1126,
-  4066,   1025, -16663,  -7013,   -147,   1617,   -745,  -3205,
-  1496,   1822,  -1199,  -2999,    117,    619, -20002,   -232,
-   142,   3207,    561,   -292,  -1635,   1035,     37,   2712,
-  -243,  -8269,    305,  -2601,    495,  14516,    831,    260,
-   -54,   4217,    675,  -1632,   4962,    793,   1066,    133,
-  -344, -12428,     95,   6164,  -1298,  -1860,   3622,   -467,
-  -867,  -1178,  11053,    118,    -36,  -6997,   -763,  16019,
-    16,   2459,    306,   -820,  -1135,    847,   -709,    928,
-  -164,   -293,  -5736,    543, -11548,   5389,  -2012,    300,
-  -228,  -1043,   5107,   -558,   1187,   -140, -13034,  -1571,
-   740,  -4967,   -432,  -6289,  -1778,   3449,   -337, -12607,
-   344,  -3790,  -1598,   -274,   -346,  -1494,   -108,    325,
- -1215,    819,    404,   -568,   -286, -21364,  15495,  -2297,
-   606,    117,     10,   -193,   -972,   -292,   -573,  -1155,
- -1289,  -1025,    472,   1154,    843,    187,    586,  20569,
-    -5,   -236,  -1181,  -1092,    700,    891,   -603,   -601,
- 21648,   -449,   -193,  -1103,   -298,   2084,   -251,    449,
- -1414,  17168,   -391,    104,  -5465,    401,   8839,    781,
-  1741,    201,   -369,    466,  12358,   -636,   -945,   3928,
-  -605, -17445,   5020,  -1289,    977,  -6202,   1783,   -507,
-   -76,    267,    -31,  -2731,  -1560,  -1225,   1348,  11176,
-  1669,    754,   1671,  -4038,    151,   -371,   7283,    243,
-  1387,    126,   1007,   1292,    -15,    696,    282,  -2623,
-  1065,  -1026,    191,   -632,   -132, -12957,    -32,  -1697,
-  -422,   -240,   1352,  10252,   1067,   8296,  -1244,     -9,
-  -301,  -3014,   -249,   -372,  10731,    535,   2147,  -8959,
-   346,   -408,  -8329,  -1905,    -48,  -8176,   2782,    412,
-  1425,   -946,   -748,   1095,  -1370,   9086,    -99,   -143,
-    68,   -544,    264,    494,   -377,     13,   -618,    237,
-   193,   3549,    317,   -168,  -7148,   2351,   -244, -13240,
- -3355,  -2322,   -533,   9554,   6906,    124,   -694,   -901,
- -2762,    207,   -915,  -2520,   -143,   8544,   -678,  -2788,
- 12926,    791,   1296,   4861,  -1470,    889,   3675,    806,
-   290, -11146,    422,   9217,    -31,   1608,    140,   3939,
- -6903,   -276,   -704,   2353,   -344,  -1038,   -230,   -177,
-   670,   -617,   -129,   -857,  -8231,    638,   -411,   -252,
--15709,  -1218,    210,    288,    542,    533,  -9087, -10493,
-  -624,   1175,    611,   -230,    746,   1455,   -590,    830,
-  1756, -15800,    823,  -1077,    788,   1071,    468,  -1654,
-   660,    983,  -9697,  -1300,    662,   2053,   -281,  12949,
-   389,   -915,    197,  -1742,  -4587,   1746,    707,   1625,
-  9021,   2204,    759,   1303,   -428,   -220,     41,  -5499,
--16080,   -193,    443,    443,    -78,    889,   -561,   5629,
- -1073,   7019,    222,   1661,   1190,   1108,     94,   5624,
- -3796,    407,   -706,   -122,    744,    363,   1648, -10896,
-   595,    953,     85,   -267,    195,    851,  17173,   -636,
-   243,    907,   2029,   -700,    351,   1495,   -157,   -575,
--11664,   1252,   8341,   -616,   3708,   5693,     -6,  -1753,
-  1072,    863,   -823,  -4278, -12043,    750,    597,   3145,
-    38,  -8140,   3136,    290,      7,  11084,   -876,   1842,
-   175,   3458,    460,   1615,  11698,   -827,     16, -12482,
-   428,    411,   2625,  -1352,    142,    529,    229,    -48,
-  -965,   -145,   -592,    655,    499,  22095,  22141,     37,
- -1875,    701,     45,    724,   1111,   1631,    262,   -252,
- -9092,   5325,    408,   -637,   -612,    647,   1268,    834,
-  -510,    603,    199,    816,  -9904,   9533,  -1580,   2669,
-  1824,  -2092,   -701,   -271,   7489,     46,  -3295,   -844,
-  -304,   -226,   -260,   -692,     -5,   -527,     37,    -49,
- -1542,    -69,  -1087,  20519,    367,      1,   3487,   2535,
- -5110,    642,   1223,  -2130,  -2894,   1752,  -1618,   9732,
- -1633,   6904,    137,    654,   -358,    355,    -21,   -277,
-   -68,   -188,    132,    530,    372,   -315, -11498,    221,
-   815,   2480,  -1398,   -123,    353,   3114, -12025,  -1212,
- -1111,    916,   6452,  -1880,   1867,    307,    -66,   1857,
-   138,   -980,  -3088,   -174,    -41,   -393,   -656,    847,
- 15824,   -379,    358,    672,   -389,    920, -21145,   -393,
-   350,   -574,   1005,  -2083,     26,     79,   -203,  -7967,
- -3302,  -5805,    772,   -302,   2104,  -1240,  13710,   6816,
-  2282,  -3709,  -1512,    -81,  -2216,  -3005,    444,   -795,
-   751,   2163,  20751,    780,    542,   -480,    624,   -425,
-   769,   2474,  -5903,    399,  10564,   -112,     69,  -1409,
-  1885,   2339,     67,   -620,    196,  -2432,   6046,  -1673,
-  6512,    809,   7904,   -516,   4278,    223,    359,  16512,
-  1224,   -480,   -505,   -735,   -502,   -593,  -4565,   1914,
-   122,   -531,   1442,    464,     69,    292,    410,   -581,
--19848,   1059,    132,   1392,   5917,    705,  -7706,   2496,
- -1487,   -791,  11939,    185,   -265,  -2412,    630,  -8028,
-  1434,  10315,  -1541,  -3756,  -2403,  -1918,   1050,   8057,
-   234,  13546,    -92,  -2172,   -671,  11631,    103,    116,
-  -171,  -4604,   -267,   -602,     15,    454,   6859,  -2151,
- -8707,  -1664,     61,   2518,   -969,    903,   1209,  -1435,
- 13531,    590,    236,   -821,    598,   1186,  -7690,    134,
- -1005, -18177,   -148,    519,    900,    951,    406,  -3584,
-    47,   9439,   1418,   -797,  -3353,   -703,  -1798,  -1244,
-   291,  -2784,  14612,   2029,   -161,   1040,  -4130,   3064,
-  1721,  -2898,    269,   3367,   1379,  14359,   -690,   -655,
-  2010,  -4935,   -681,  -2606,  11651,    748,    101,  13593,
-   629,     28,   -540,   -854,   1405,    558,  -8785,  -1016,
--13043,    121,   -556,   4959,   1694,   -720,   -138,  -3897,
-   182,   1938,    844,    919,   -683,  12042,  -1101,   -155,
- -1375,  -1509,     11,    220,    821,  21721,   -367,   -634,
- -1468,   -174,   1002,  -1203,    318,  11672,  -2114,   2472,
- -1701,   5932,   -661,   1094,   2500,  -5609,    254,    437,
-  -911,  -1611,  -8005,    217,  -1139,   1321, -10713,  -2183,
-  1163,   -890,   -622,  12820,   1021, -13578,   1040,   3216,
-   592,    686,    737,  -2881,  -1693,   3995,   -455,   4666,
- -4124,  -9316,   2061,  10645,    271,    264,  -6829,    641,
-  2061,  -6683,   -512,   -747,  -9131,   2445,    343,  -9944,
- -2888,    607, -10855,    871,    418,    504,    936,   1079,
-   273,    400, -17752,   -391,  -1543,  -6193,   1482,    737,
-  2096,   -982,    167,    972,    336,   1063,  -1272,  -1602,
- -1907,      9,   -191, -15207,   -119,   4047,   1479,  -1405,
-   526, -18462,   -627,  -1996,  -1022,  -1544,    312,   7972,
-  -227,    797,  -5204,  -2160,    391,   -423,    257,   3836,
-   442,  -1931,     22,    143,   -203,    362,    -73,  15679,
-  -289,  -1445,    577,    858,  11408,  -1970,  -1022,   1550,
-   882,  -3699,  -2697,   3978,    600,     86,   3858,   8683,
- -7681,  -4856,   4051,  -1321,   -587,     46,   -499,   -354,
-  -655, -15717,     67,    490,  -2670,    474,  -1374,   5601,
-    60, -17615,   -808,     87,    367,    579,   1057,   1020,
-  -394,   1181,   -189, -10846,    763,   2635,    282,  -3279,
-  -866, -15257,   -449,    112, -15577,    227,    269,  13964,
- -1273,   1513,  -1487,    195,    319,   2527,   -286,  -5883,
- -5360,   -959,   2791,  -3335,   -945,  -1985,   -903, -11418,
-  8525,    669,   6106,    153,  -1169,  -1198,   -553,   7037,
-   528,  -4237,    717,   -214,   1824,  10108,    961,   9077,
-  1899,  10407,   -207,    -29,    355,  -6794,    111, -13627,
-  1361,  -3577,    291,   4534,   2209,  -1579,    109,    523,
-   456,  10990,     31,   -448,    385,   1481,      2,  15266,
-   798,   5759,    860, -16424,  -1315,   1631,   -456,   -977,
-  -180,  -2593,   1191,   5959,    -32,   8112,   -506,  -7766,
- -1871, -15310,    662,    196, -20401,    925,    446,  -2035,
-  -620,   -686,   -249,  -2517,    423,    703,    633,    828,
-  -182,    -37,   -406,   -149,    821, -22255,    652,    522
-},
-
-.shape16 = {
-  -786,    193, -15441,    200,   1050, -16545,    -41,    329,
-  -869,   -170,   -858,   2725,    217,    447,   2107,    -23,
-  -387, -10280,   -383,   -320,    387,  16012,    -79,   -967,
-  3528,  -2123,   -537,   -636,  -1761,    949,    100,    -17,
-  -446,    261,  22527,    331,     26,    -87,   -206,  -2292,
- -1178,   -164,    598,    147,    889, -14487,  -2823,  -1280,
- -1892,     33,  -1763,    993,   4807,   -953,   2181,   -588,
-    59,   -296,    218,    291,   -104,    495,  -1092,   2232,
--14904,   -983,  -2919,    795, -17207,  -2045,   2988,    597,
--10312,   -718,  -2196,  -5822,    847,   1304,   -757,  -4714,
-  -148,    831,   -734,    806,   4348,   -308,    244,    566,
-  2706,    604,   -748,   -864,   -568,   -219,   -128,   -688,
-  -218,    110, -29289,    482,     76,  -1447,   -142,   -417,
-  -253,   8124, -19775,    990,   4546,  -1012,  -8082,    133,
- -1612,  -2243,  -3788,   1568,  -2892,    852,  -1642,  -3479,
-   -23,   1300,   -564,  -1037,    249, -14533,    -43,    321,
-  -680,     10,   -417,  23426,    397,   -108,   1843,    180,
- 11976,  -9613,    353,   3768,    130,  -1035,   4340,    218,
-   596,   -224,   -779,  -1680,   1326,    152,   -971,  -9725,
-  -355,   5328,   -459,  16242,   -438,    926,   6210,   1912,
-   769,   2621,   -148,  -1008,    517,    341,  -3594,   -965,
- 11383,   -874, -16949,   1167,  -3371,  -1655,    586,   -132,
-  3990,   -770,    211,    246,    514,   -166,   -734,  30408,
-  -258,   -521,    -20,    339,    499,  -2572,   2110,    272,
-  1357,    123,   2841,   -320,    -31,   -444,   -501,    215,
-   -42,    595,    108,    484,   -223,    937,    475,    -72,
-  -319,     75,   -205,   -978,  -9155,    145,   2020,     -3,
-  2438,   4046,  -1281,   -875,   1532,   -598,  12288,    369,
- -2046,    343,   -778,   1769,  -2589,   -641,  17437,   1793,
-  -592,  -1954,  -1607,   6184,   3440,   -512,  -2710,  -1330,
-  -127,   8765,     83,   -243,   -315,    709,    256,   1176,
- -1198,   -463,    970,   -302,   -568,   -997,  -1022,    159,
- 11008,     27,  13074,   1523,  -3239,   2330,  -4808,   6115,
- -9933,   1449,   2153,  -3111,   1780,   -731,    121,   -881,
--14289,   -265,    566,   -611,   -253,  -2965,    250,   -105,
-   -66,   2570,  -1922,   2712,   1907,  -2025,   -454,    173,
-  1463,    -29, -31955,   -113,  -1751,  -3353,    254,   1001,
-  6781,    -29,   -639,  -1289,    288,    498, -21505,     48,
-   109,  -2151,   -223,   1360,  -3430,    658,  -4185,  -1706,
-  1244,   1899,    124,     12,    -35,    289,    382,    433,
-   261,   -131,     54,   -646,   -280,     86,    180,    153,
-  -169, -20242,    -95,    734,   -524,     77,    102,   8468,
-  -421,     29,     -3,     51,   1526,   -600,   -264,    355,
-  1949,   -985,   -291,    -86,  10212,   -789,   -393,   -182,
-   -51,    946, -16716,   -954,   1179,  -2745,   -509,  -4774,
-  -587,   -608,   7657,   -509,   -388,    987,    109,   -218,
--17579,   -524,   -467,  -1643,   -444,   1430,   2541,   -124,
-  1785,     27,   7905,    -73,  -3135,  -1241,   -254,  -2114,
-  1175,    780,    -50,   4055,    535,    438,     32,   -113,
-  -260,     81,   1102,    -59,  29188,    -48,    212,    -29,
-  -344,    559,    856,   -483,    608,    -40,  -1498,    112,
- 10374,   1198,   -434,   4053,   1286,    236,   1823,  16046,
-   592,   1583,     78,  -5243,   1311,    456,  -1342,   -546,
-  -353,  13289,   -333,   -529, -20859,    183,   -167,  -1368,
-  -338,   -690,   4248,   -205,   -666,   -634,  -1653,   1174,
-   234, -18622,    891,    284,  -2632,  -1516,    289,  11242,
-   727,    133,    284,   -323,  -1370,    908, -13169,   -412,
-  1155,    410,    610,  -3072,  -8220,   -637,    242,   -647,
- -2072,  16041,   2292,  -8009,    351,  -3137,  -3075,  -1051,
-  4569,    125,     23,   1281,   2487,    520,   -209,   -688,
-   205,  -1248,    246,   -601,    533, -12209,  -2298,    826,
- -2762,     45,  15123,    721,   1128,    798,   -676,    349,
-  -153,    263,     89,   -854,    -24,   -350,   -227,    157,
-   587,   -240,   -185,    663, -32328,   -148,   -204,  -2396,
-  -597,   -344,   8104,   -280,   -375,    264,    648,    741,
-  -290,   -321,    263,   -569,   -381,    167,   1757, -29636,
-    30,    393,    398,    590,   -242,     81,   1601,   3683,
-   787,   -336,    675,  -1080,   -713,    261,  18420,   1760,
-   609,  -4610,   -551,   2790,  19807,   1347,   -125,  -9412,
-  -261,    548,   1056,    179,   -917,   -181,  12637,   -267,
-   621, -11908,   1366,     76,   5875,   -742,    394,    155,
-  -370,   2481,     46, -15392,   -344,  -9750,  -1353,  -2242,
- -1685,  -1286,   2320,  -2176,  -1729,    705,  -1582,   1590,
-  1603,  21129,  -3555,   2192,   -883,   3438,    233,   1965,
-  -537,    399,  -4818,  -4085,    559,   -292,   1290,  -2700,
-    10,   -301,  -1865,    226,     52,  -1346,    306,    316,
--12281,   -525,    285,   9631,     -2,   -849,   1620,    128,
-   176,  -1021,   -473,   7929,   -133,   2459,    -33,  -1517,
--22047,  -2300,     98,  -3513,    334,   4617,   -193,  -1309,
- -1279,    738,   -443,     95,    406,    660,   -705,    -54,
-   -39,  26396,   -766,    249,  -2423,   7759,   -689,  -3909,
--17404,     65,   1849,    945,  15907,   1386,   -433,   -831,
- -6349,  -3919,   1870,   8096,    311,  15043,   1709,   -315,
-  1288,   7522,   -215,  -5072,   1246,  -1486,   3762,   4526,
-  1517,  -1936,   -543,   -263,    771, -10215,   -425,  -5098,
-    59,   -266,  -1012,   -380,  -2131,    630,    405,    665,
- -4550,   1403,      8,    -46,   -879,    398,   -532,   -185,
-  -286,    921,    -65,    378,    669,    174, -15280,     91,
-  -776,   8480,   2463,    184,   2065,   -666,   -561,   4122,
-   594,    732,   4007,   -852,    -71,    194,   -126,   1765,
- -1570,    968,   -257,   -288,    950,  27482,   -333,    370,
- -1429,    285,    558,  11245,   -135,    565,   1296,   -261,
-   -62,    600,   1455,   1457,    820,    357,  -1203,    169,
- 16611,   -893,    359,    231,    418,   -547,    -95,   3866,
-  -511,  -6344,   -205,    923,   -239, -16205,  -1619,    217,
- -3362,  -6342,  -1551,    649,   -492,    264,    -55,    170,
- 16992,    -91,    306,     43,  -2770,    582,  -1740,     77,
-  -882,    268,   -515,    -45,  -6093,     24,  -5596,   9034,
-   284,   3211,    846,   1158,  -1118,   -604,   -514,   1402,
-  -493,   -938,  -3892,    242,    643,   1421,   -434,   -406,
-  -102,    -88, -11733,    161,    518,    978,   1508,    248,
- -1036,   1407,   -396,    293,   1154,  -1435,    495,   8243,
-    20,   -845,  -5373,    659,   2366,  29148,    145,    603,
-  4088,   -251,  -2841,  -2526,  20682,  -1357,  -2454,    660,
-  -125,    347,  11772,   -113,   -357,  -2181,  -1234,   1908,
-  -432,  16555,   -248,    822,  15516,   -158,   -653,   1573,
-    93,  -2730,  -1111,    958,  -1550,  -1153,     17,    610,
-   781,   -372,  -1640,    144,   -135,  -1171,  22140,   -427,
-   -26,    690,   -800,  -1497,   -300,   5438,    390,  11304,
-  9253,   1098,   5564,     -9,   3856,    965,   2016, -12797,
-  1687,    915,   3687,    539,   2496,    702,  -1324,    -71,
--12955,   7456,   4626,   -848,  -1815,    831,   2151,   7921,
- -3000,    123,   1189,  -1489,    222,   4973,   1936,     54,
--10527,  -1238,  -1157,    628,  14112,  -2164,   1478,   -985,
- -4102,    635,    225,   -311,   -609,  -1015,    301,    507,
-   -85,    443,    186,   -552,   -711, -16988,  -1327,    220,
-   565,  -1673,   -543,  18633,    331,    127,   -342,     22,
-   -77,   -360,   -439,   -501,  -1848,  -1147,   -483,   1133,
-  -351,     41,    908,    502,   -658,    474,   -430, -11348,
-    -1,   -531,    451,    709,    227,   -978,    348,   -265,
-   269,   -376,   2511,   -188,   -111,   -387,    809,   1009,
-  1570,   -755, -11463,    667,   -895,    446,    276,    145,
-  -513,   -117,   -462,   -340,   1457,   -963,    191,   -788,
-  -150,   -979,   -507, -27540,    122,    368,    -73,  10051,
-  -465,    642,    507,  -6828,    241,  -5025,   1598,  -1174,
-  2373,  -2272,  -1910,   -108,     15,    166,      2,  10518,
-   933, -12716,    510,    778,   -424,    414,   4899,    759,
-   862,   -438,   -886,    457,    304,  23639,    136,   -203,
-   478,   -565,    244,   -541,   2419,   -773,   1107,   -217,
-  1579,  -1037,    476,    -97,    995,  17973,    161,  16466,
-  -178,   -718,  -1606,    947,   1991,   2266,   1249,   2708,
-  -611,   1424,   -142,    -53,     36,    509,  26159,   -144,
-   357,    -37,   -234,    587,    311,   -509,  -1639,   -332,
- -1618,   -382,    302,  -8657,    -68,    -30,    545, -12834,
-   158,    158,    135,    621,   -354,   -871,    451,   1220,
-   -31,      2, -13414,     60,      3,   -380,    541,    -44,
-   552,   -366,    155,   -462,     61,   -232, -15426,    317,
-   688,   1121,   2933,   7151,   -168,  -9167,  -2521,    745,
-  2792, -10448,    569,  -3823,    630,  -4626,    -95,   -416,
-   828,    259,     72,    171,    635,   -250,   -128,   -426,
-  -153,    260,   -771,    314,    235,     26,  32281,   -343,
-   751,  -1443,    324,   -684,   1900,  -1334,   2022,     30,
-  1073,  -2406,   2080,   -485,   -320,  15328,   -860,   -529,
--16444,   -219,   1736,   -149,   -160,   -828,   1089,    413,
-   241,   3720,    -90,    146,   1109,    243,   -321,   -256,
-   -68,     88,    -50,    571,   1179, -25030,    104,    929,
-    35,    529,    117, -13724,    734,  -1344,    456,   5586,
-  1566, -12573,   -840,  -1617,  -2494,   1791,   1901,   3066,
- -2159,   -414,  -3856,  -9894,  -1608,   -657,  15355,   -773,
- -9217,   -658,   -972,   4730,  -2986,  -3478,   -757,  -1416,
- -3702,  18089,    629,   7061,    124,   5843,    158,  19017,
- -2204,  -6976,   1629,  -5657,   1101,  -1859,  -1425,   -548,
- -1132,  -5043,   1074,   -592,   -196,   1902,  22705,  -1228,
-   214,   -685,  -2036,  -2368,   -315,   -914,    533,    218,
-  1091,   -627,   2031,  13922,    104,   -450,   4494,   -498,
-  -361,  24734,    623,   1029,   2437,  -1123,  -5092,  -6551,
-   438,  16562,    375, -13102,   -193,  -2004,   3556,    179,
-  1832,   2086,    798,   -534,   -195,  -7105,    796,   3969,
--12269,   1570,   4273,  -2692,   1240,  -2901,  -2045,  -2453,
-   372,    613,   -548,   -245,    687,    258,  -8964,  -1500,
- -1519,   -993,  17571,   -357,    916,  -1202,   1752,   2081,
-  -536,  -3185,  -1062,  19335,    721,  -9958,   1052,   -872,
-   248,  -3133,    456,   1641,    149,    -11,   2955,    310,
- -3178, -18823,    497,   -971,  -6587,  -1380,    351,    106,
-   -43,    607,  -4754,    213,   1030,   5377,   -804,  -2557,
-   850,   1081,   -706,   1325, -14922,   -794, -14060,  -1953,
-   891,  -3296,    329,   -510,  -1126,   1113,   1753,   -411,
-  1769,    429,   -185,  -1020,    194,   -106,  11470,   -591,
-  -272,    422,    337,    524,   -150,    822,     51,   -120,
-  7193,    802,    640,   -140,    -42,  28125,  -1020,    285,
-  -465,   3195,     69,    482,   -953,    262,  -7672,   -373,
-  5158,   5625,  -3003,    550,   5371,   5619,  -2200,   5392,
-  -804,    135,   1300,  -3610,    -23,   -433,  13503,    224,
-   911, -14421,   -502,  -2151,  -1667,  -1933,   2888,   -277,
-   547,   -989,   3115,    -32,   -680,   -164,    804,    412,
-    62,   -154,   -190,    156, -10938,   -360,    -88,    843,
-   328,   -773,   -267, -12668,    856,   1496,   -243,   -586,
-   736,  -2175,   -677,  -3069,   7480,  -1764,  -4024,  -2569,
-  1805,    194,  -6814,  -1135,   -237,   2682,   -156,   -890,
-  1285,    368,   1802,   -683,   -163,   1191, -13063,   -496,
-  -335,  17482,    746,    818,     48,  21419,   -598,  -1753,
- -1169,  -2135,     40,  -9114,    592,  -3912,   1980,   -264,
-  -304,   8138,   -185,    286,  -3024,     48,  -1630,    909,
-   661,   -662,  18085,    240,   -201,     69,    192,    305,
--22167,    692,  -1135,   -996,    398,    -74,  18553,   -958,
-  1223,  -5578,    508,   -352,   1234,   -450,    497,    780,
-    79,     51,   -221,    255,    -26,  13352,   -170,    231,
-   590,    169,   -733,   -812,    -65,   -219, -20939,    200,
-    35,   -177,   -454,    632,   -267,   -407,   -120,    623,
-  -176,   -664,    715,    -23,    318,    148,   1125,     16,
-   709, -21687,   -230,   -413,   1398,  -1235,   -283,   1615,
-   175,   -299,    349,    400,   -112,  21762,   -665,    364,
-  1089,   1303,    -54,    523,   -381,  -1312,     48,   -886,
- -1260,    408,    415,  -8349,   7115,    180,   -774,   3508,
-  -971,   -255,   -195,     81,  -2674,   -977,   -355,  -1500,
-   178,  -2081,  -4432,  -1014,    340,   5818,    138,   -106,
- 16917,   1203,    349,   3271,    961,    363,   6008,  -6043,
-  3736,   -730,  -4201,   -514,  -6131,    -68, -14935,  -1781,
- -3898,    -40, -18944,   -461,  -1694,  -1269,   -755,    -81,
-  2369,    484,    531,  14114,     85,     32, -10142,   -142,
-   600,  -2374,    375,    675,  -2663,    155,   -947,   6427,
- 11476,   1253,   5049,   1063,   2003,  -1608,   2463,  -2168,
- -1128,   1079,    383,   -996,    368,   1208,  -3554,   -959,
-  4596,  -1209,  -4154,   1270,   9365,  -2775,  -1751,    998,
--20023,   -347,   1505,    218,   -142,    342,   -128,   -523,
-  -159,     75,   -467,    257,   -133,   -142,    712,   -621,
-   428, -29584,     13,    402,   -455,    119,   -483,   1121,
-  -461,    960,    807,    -46,    297,  14856,    221,   -356,
-   221,  15037,  -4744,  -2555,    447,  -1418,   1464,   1391,
- -1404,  -5812,    512,  -2321,   9882,    242,  -2298,   -137,
-  -849,  -3182,   9394,   1412,   1052,   1369,   -904,   -494,
-  -231,   1113,   1087, -13317,    768,  -1178,  -3011,     24,
-   229,    164, -10170,    328,    308,   -591,    213,   -543,
-   -82,   -790,   -875,    794,   -558,  -7651,   -573,   1266,
- -2084,   2275,   -187,     97,    384, -11830,   -185,   -472,
-  1365,  11636,  -1405,    360,   -487,   -440,  -1820,   -349,
-  -293,    285,     25,   -139,   -415,   -540,   -108,   1136,
-  -673,    230,  19202,   -545,   -542,    919,   1221,   -518,
-   196, -21900,    795,    115,    -16,    459,   3339,   -347,
-  -346,   -186,   -695,   -267,   -714,    185,    266,  -1218,
-   120,   -249,    233,   -110, -30412,    285,    219,   2256,
-   536,   -442,    673,  -1487,   -477,    -60,  -1806,    183,
- -7195,   -577,   2230,  -7594,  -3230,     65,  22963,    111,
-   390,   7134,  -3716,  -5123,   -475,    -32,    -98,   -466,
-  -118,    -43,     74,  -1071,   -902,   1714,   4004,     26,
-    97,   1680,    423,    252,   9667,    550,    354,   -222,
-    19,   -224,   -807,    365,    593,    363,   -851,    -28,
-   553,    238,   -481,    769,    279,  18367,   -462,    286,
-  4825,   -141,    500,  20383,   1618,    -31,   -514,  -2484,
-  -327,  -8506,   -705,   -872,    530,  -9997,    -36,   -431,
-  2824,   3185,   1712,   -318,   9513, -10065,    614,   -503,
-   389,  12830,   -113,    -15,  -1007,   -523,  -1293,  -2102,
-  -543,  -1157,   -583,   1228,    262,   -674,  -1847,   -242,
-   299, -12025,    547,   -591,  -9173,    275,    412,   2493,
-   997,   1229,   1982,  27554,    245,    106,  -1320,   -153,
-  -423,   -955,   -449,    392,    824,    796,  -1181,   1640,
-  -884,    -70,   8789,  10021,  -1806,   1019,     90,   1494,
-  2071,   -911,  -1159,    212,   2207,   -994,  -2500,   -497,
-    92, -11544,   -398,   -774,   1474,     32,   -671,   -171,
- -1250,   -249,   1161,   -654,   -205,    -36,   1733,    763
-},
-
-.shape22_1 = {
-   987,     -6,   -621,   -220,  -2438,   -387,   -535,    -23,
-  -934,    -68,  -4985,    575,    483,   7243,  -1075,    917,
-  1739,  -1832,   -580,   1564,    131,   -180,  -1271,   3672,
-   161,   1040,   1737,   2719,   1101,   -185,  -1410,    221,
-  -422,  -8675,   -753,   -401,  -5388,     13,    762,   1378,
-  1113,   1768,   -177,   3397,   2162,    267,   2261,   -156,
-  1708,   -848,    -79,  -1819,  -3159,  -5548,   -745,   7208,
- -1039,   7555,   -134,   2661,  -2112,   2270,  -1991,    441,
- -6248,    246,    166,   2092,  -1402,   -242, -13600,   -539,
-   391,   2395,  11001,   -981,  10906,   -403,    823,   1647,
-  -294,     93,    504,  -5448,   1213,  -1849,  -3077,    790,
-  -841,  12812, -11266,  -1882,   -805,   -274,   1968,    -49,
-  1189,    -80,   -281,    -40,    409,   2423,    581,  -1362,
-   207,   -869,   -589,   3294,   -318,  -4592,   -476,   1014,
-  -135, -17999,   -194,    807,  -2946,   -222,     44,   -514,
- -4407,  -1201,   1155,   -235,     98,   4432,   -342,   2386,
-  1402,   -956,   3357,   1959,   4790,   -139,  -3494,  -4280,
-  -589,  -8422,    363,   -746,    640,   -360,  -1007,  -1100,
- -7989, -12630,   1006,  -1608,   -864,   -226,   -915,  -2032,
-  1274,    596,   1864,   1067,   1597,    460,  -2003,  -5560,
- -8020,   2354,    379,  -3151,     44,   7024,   -698,  -2901,
-  4976,    927,   1223,    -93,    172,    189,   6639,  -6082,
-  -726,   -524,  -3068,  -3802,     16,  -1039,   -105,   2333,
-  -350,   -306,   -379,   -832,   1282,     56,   3529,    562,
-  -603,   5954,    294,  -1265,   8045,  -3990,   -169,   -123,
- -3267,    572,   -879,   1562,  -1185,    799,  -9589,    407,
-  -590,     65,  -2848,    433,  -5547,    -19,   7180,  -7904,
-  -392,    323,   -448,  -4481,  -3773,  -5286,   1957,    226,
- -2040,   3292,   2987,  -1704,   2835,   -149,   1435,    823,
-  1775,  -2769,    146,    234,   -131,    -15,    268,     37,
-   139,     22,   -196,     91,  -3503,  -5421,     24,   -280,
-    58,    370,    655,   1412,    113,    306,  16404,   -234,
-   315,   -957,     72,  -1129,   1993, -18719,  -1415,   1349,
-  2340,    541,    313,  -1360,     31,   1441,    -78,  -9905,
-  -393,    367,   -712,  -2009,    372,   -297,   -123,    303,
-  -458,   -323,     46,   8701,  -1301,  -8768,    -43,   1818,
-   212,   -543,  -5077,  -8037,  -2536,    702,    792,   -381,
-  -272,   1941,   6320,  -1871, -13938,   -262,  -2063,    108,
-  -861,    485,   -440,    768,   5665,   -302,    305, -13784,
-  2889,   -127,    -94,    145,   1308,   7911,  -8376,   -643,
-  -596,   1357,   -943,   1329,    -84,    -62,   1651,    391,
- -2295,  -5456,   -357,  -4611,   1361,   3961,   -295,    642,
-  -698,   8614,   1613,   -526,   -120,   -205,     17, -20171,
-  1252,   -261,    535,  -1244,     92,   -315,    878,    380,
-   157,   3217,   -493,   -773,    513,   -510,  11304,   -899,
-   -27,    398,  -6386,    659,  -1001,  -2737, -13295,   1219,
- -1014,   -193,    445,  -2393,    344,    -25,   -599,  -2848,
-   884,     94,    -11,   -564,    -36,   9939,  -3530,    462,
-  -942,  10089,    824,   2994,   -293,     71,  10167,   -457,
-   711,   -964,  -2128,   2530,    160,  -2558,   2451,   1654,
- -3828,   1560,    879,  -1023,  -8354,    851,    -77,   -112,
- 19572,   2010,  -1077,  -1329,  -1282,   1277,    252,  -5622,
-  4617,     58,  -2315,   -459,  -1249,     92,    708,   -737,
- -3323,    182,   1557,   -657,    546,   -447,  19117,   1645,
-  -336,    -26,  -2041,   5926,   4746,  -1866,   3922,   2798,
-  5320,      7,    470,    842,    229,   -567,    742,  -3306,
-   659,   -871,   -226,  -2593,  -1003,  -1373,    595,   -768,
- 20658,    944,   1228,    279,  -1531,   -618,    361,  -4019,
-  -343,   -351,   7143,    293,     92,  -2713,   -269,    -30,
-  -332,   4093,    216,    239,   -563,   1943,   -944,  -2268,
-    70,   -209,    440,   1493,   -446,    491,   -362,     25,
-  -331,    433,  -1585,    173,   1126,  -3614,   -234,  -2649,
-  1181,   -641,   -160,   3727,   -841,  -2134,  -1396,  -5758,
-   -14,    364,  -4651,   1151,    194,  -5234,   5878,  -1348,
- -1388,   -233,   3810,   -860,   9479,    -24,  -6616,   1387,
-  -455,    447,   -224,  -2997,     12,   3502,    -73,    470,
- -9170,   1677,   -740,   -592,  -1638,    675,    -93, -17842,
-  1750,   -847,    993,  -2393,    -49,  -2029,   1940,    588,
-   475,  -3467,     55,   5087,   2989,    380,    915,  -2782,
-  2418,  11303,   1098,   1009,   1372,  -5780,   -303,   1451,
-   972,  -7433,   -571,   1661,     64,  10265,   1541,    -50,
-  -964,   -738,   -253,  -3105,   -695,   -546,   -775, -18971,
- -3094,  -2379,    738,   1625,    623,   1073,    782,    723,
- -3417,   -578,   -189,   4108,   1115,  -1222,  -9102,  -4736,
-   347,    946,    322,  -3699,    193, -15139,    367,    969,
-  -788,   -694,   -620,    -26,    -16,      4,   -478,  20792,
- -1175,   -231,   2566,  -1270,    162,    181,  -1451,  -5370,
- -2429,  -8910,  -3794,  -5807,  -1655,    248,   4432,   1393,
- -2451,  -2706,   -744,    687,    842,  -1281,   2960,  -2348,
-   153,  -1671,  -1433,  -1250,  -1096,   2501,  -5393,   4266,
- -1098,    880,  -1215,    817,   -443,  10053,    705,   -689,
- -2679,  -1205,  -3302,   -809,   -918,  -1005,    124,   -329,
-   108,    -52,  -5305,   -419,    128,  -8137,   1427,    387,
-  -235,  -2582,    190,   -173,  -1031,   2672,   -985,   3309,
- -5927,   7327,  -8463,     -2,   6035,    743,    552,    -14,
-  -580,    -68, -11886,    476,     61,   1172,   -529,   -988,
-   871,   -776,   -332,  20870,    384,   7795, -10830,    723,
-  1690,   -519,    962,    663,   1300,   -465,     47,  -3578,
-    56,  -8131,   2041,  -8524,  -1303,   6349,   1903,  -6726,
-  1156,   -224,   1286,  -2355,  -3415,    985,   -502,  -2474,
-    49,  -2789,  -3616,  -1707,   3363,   -140,   1702,  -1919,
--11518,   -404,     62,  -6933,  -1187,  10830,    132,    284,
-  -639,   1349,   2367,   -311,   -626,    745,   5660,   -152,
-  -121,  -5236,   -481,   5889,  -1263,  -8443,    -33,    936,
-   423,   -117,    111,  -1055,   -103,   -321,   1286,   -611,
-   777,    827,    422,   -162,  -6767,   -241,    289,   -441,
- -1344,   2706,  -1260,  -4649,   -847, -16107,   -263,  -1826,
-  -521,   -760,    942,    309,  -2692,  -4835,   -853,   -806,
-  -276,   -322,   5647,   1219,   -433,   -346,  -1171,  -1028,
-   191,   -406,    444,     33,    272,   3502,    475,  -2178,
-  1915,   -290,  -1037,    833,   -695,   -121,    415,    556,
-  1025,  -2268,    334,   2847,  -1768,   -389, -14034,  -3878,
-   836,   4605,  -1985,   -359,   1478,   -149,    823,   -926,
-  -828,    135,    469,   -645,   -328,    -94,   -178,   2820,
-   781,  -2361,  -5778,   1312,   3918,     -1,  -3654,   -942,
- -2495,    615,    210, -17006,   -396,   -445,    382,    563,
- -1738,     95,  -9107,   4869,    348,    527,   5688,   -145,
- -1195,  -2367,   -749,   -187,   6697,     27,    347,  12571,
-   -64,   -427,   3765,    824,  -1216,  -1126,   5997,    586,
-   110,   -294,   -240,   1646,   -186,   1360,    413,  -6459,
- -1535,  -3208,   -520,   -621,   8613,   1098,    -19,   -199,
--11446,   -657,   -353,    906,    678, -19375,   -126,   1688,
-   644,   1231,  -2151,   -742,    320,    -68, -12426,  -2750,
-  1483,  -1603,  -2639,   3028,   2662,   -140,   5405,   -917,
-  -407,    207,   9392,   -569,    931,   -124,    -82,   6370,
-   477, -12264,   1093,   3427,   -732,    -50,    232,    -67,
-   609,   1615,   -463,    583,   1808,   1499,   -509, -24431,
-   231,    -72,   -192,   -333,  -7554,   -342,  -9036,   -304,
-   136, -15450,   1333,  -1147,  -1488,  -1440,     75,     63,
-   747,    297,   -251,     30,   -301,  -1810,    -86,    544,
--10446,   1300,  10468,    218,  -2471,   1982,    423,   3046,
- -1112,   -657,   -104,  10671,    -46, -10953,  -6205,  -1275,
-  1972,    937,    -75,   -330,   -529,  -2581,   1510,  -1881,
- -1372,  -1725,  14541,   -560,   -884,    946,   -307,  -5031,
-  7798,   -190,    720,   1525,     29,    868,   1238,    372,
-  -462,   2467,  -2661,   2721,  -1514,    723,  -2782,   -494,
-   240,  -7147,    587,    751,   1613,  11054,   1074,    275,
-   972,   -970,     27,    -75,     24,     -9,    163,     88,
-    21,     87,    -78,   -743,   -128,  -2336,   -235,   -743,
- -3918,   -333,   1088,   -195,   -166,    782,   -119,  -3263,
-   604,   2155,   -258,  -1282,   -129,     43,  -5124,   -472,
-   685, -14243,  -1294,    -99,  -1922,   -284,   -422,  -1112,
- -3194,  -1977,   1448,   -419,  -7172,     20,    -70,   2102,
-     0,    278,   1882, -10005,   1612,   6020,     71,   -141,
-  1027,    -43,   -864,   -448, -21257,   -336,  -2090,   5207,
-   674,    722,   1030,   1367,   1963,   6057,    984,  -1087,
- -3690,     47,    -61,    104,    -81,    895,     22,    728,
-  -191,   3219,   5228,    -27,   -802,   1438,  -9026,  -1352,
-  -581,    912,   -664,    -23,   -522,   -912,    178,   -603,
-   571,    574,    406,    564,    175,   -405,  -2965,  -1072,
-  1749,   -957,   -402,   9431,   1649,   -409,    291,   5765,
-   808,   6754,    727,    -37,   -254,   1530,    213,   3253,
-   357,    371,     45,  -1276, -12432,   2799,  -1924,   -176,
- -1107,   -183,    198,   3662,     20,  -1166,   2507,  -3484
-},
-
-.shape22_2 = {
-  1688,   -307,   -590,    971,  -3616,  -1632,   -218,   1861,
- -1479,   -367,  -6584,    487,   -951,  10808,   -232,    444,
-    89,  -1216,  -1577,   1283,    249,     -3,  -3646,   2205,
- -1116,   2630,   2110,   3193,    270,   -189,     78,   -826,
-  1010, -10520,   -370,   1234,  -5604,   -262,   1277,   1440,
-  2225,   2466,    305,   2469,   -740,    120,   3184,   2125,
-  1185,  -3230,   1597,  -1670,  -8283,  -9857,   -129,   8932,
- -1355,   8755,    707,   -256,   -135,    423,   1543,   1782,
- -4875,    403,    373,   1570,   -183,    782,  -9617,  -2539,
-  1090,    523,   6929,  -1226,  10329,   -278,   -999,   -260,
- -1810,    666,   -463,  -6100,   2040,    256,    532,  -1475,
-   383,  13137, -10953,  -2226,  -1243,   1584,  -2348,   -809,
-  3602,   -816,    194,    480,     84,   2297,    344,  -5181,
- -6243,  -2616,   2093,   7112,  -2373,  -1346,    291,   -372,
-  -863, -16911,  -1878,    378,   -826,    579,    737,   -468,
- -2288,    264,    634,    108,   -254,   4717,  -1286,   2885,
-   986,  -4944,    -98,   2007,    991,  -2252,  -2887,  -6141,
-  -605, -10474,    896,      6,    235,   -407,    -70,    478,
- -8392, -10870,    575,   -672,    103,    320,   -179,   -229,
-   445,   -380,   1124,   3271,  -1327,   -275,   -239, -10381,
- -9102,   1361,     96,  -1255,   -277,   9316,   -415,  -2258,
-  8992,   -117,   1625,   -704,   -980,    752,   9133,  -8792,
-  -423,   -272,   -865,  -2285,    443,  -2014,  -2592,   3180,
-  1198,   2570,   3360,  -7090,   3311,    697,   2229,     46,
-  -472,   6984,   -140,   -780,  10391,  -1078,     48,   -564,
- -5073,   1576,   -826,   -483,    952,   1099, -11536,   -652,
-   375,    440,  -7319,   2646,  -2089,   2804,   3795,  -6704,
-   251,    811,  -1224,  -1976,  -4943,  -6671,    780,  -2856,
- -7907,   2447,   3755,   -135,   1127,    328,    553,   3450,
-   351,  -5054,     -5,   1077,    109,   -254,   -391,   -511,
-   404,    -61,    510,    395,  -6044,  -7454,    364,   -575,
-    65,   -410,  -1921,   -248,    128,    311,  17131,  -2135,
-  -563,   -884,   2356,  -3951,  -1176, -16695,  -1534,   1977,
-   626,   2478,   1554,  -1070,     38,   -551,    370, -11053,
-  -331,   1062,  -1385,  -1681,   1028,   3350,    239,    -76,
-  -156,     49,    397,   7060,  -2834,  -6527,     22,   1920,
-  -951,    356,  -7674,  -8903,   -120,    317,   -303,    160,
-   530,   4611,   1083,    514, -12207,   -283,   1413,   -848,
-  -645,   -432,      0,   -192,   4780,  -3485,  -1192, -10574,
-  1274,  -3057,    475,   -188,    183,   7865, -11214,   -268,
-   491,   1422,    -28,    149,    515,  -1651,    670,   -450,
-  -958,  -4288,    567,   -182,    668,   4069,   -213,  -1176,
-   148,   8854,   -151,    474,    599,   1297,    237, -19186,
-  2993,   -482,   -591,  -1322,     25,   -628,   -828,   -203,
- -1500,   5519,    -84,    723,  -1137,   1217,  13045,   -707,
-  -372,   -200,  -4142,   -790,    188,  -6760,  -8288,    766,
-   366,    444,   -517,  -2679,  -1470,    -61,    161,  -3734,
-  3053,   2012,    439,    627,    524,   5538,    549,   -473,
- -2244,   8399,  -6395,   5811,    851,     58,  11376,     -6,
-  -337,   -689,  -1510,   -690,   -388,  -3587,   2665,   3371,
- -1850,   -953,   -513,    581, -10296,    548,   1092,    565,
- 18045,    215,  -1486,  -1270,    450,   -880,    407,  -6547,
-  8393,    206,   -515,  -1565,   -219,  -1872,   1479,    382,
-  -569,  -5002,  -1247,    -45,   -740,  -1791,  17177,  -1210,
-   761,    132,  -1627,   4970,   5563,    722,   5614,    430,
-  5659,    139,   1193,   1513,   1144,  -1319,    561,  -5145,
-  1010,    199,    656,  -3958,   3544,  -1758,    810,  -1578,
- 15976,   -139,  -1035,   -416,   -543,   -418,   2824,  -6541,
-    94,   -673,  11741,    426,    -15,  -5280,    780,   1795,
- -4616,   8192,   -297,   -206,    883,   2369,   -395,  -4266,
- -3120,   -199,    985,   1240,    352,    232,   -170,    176,
-   413,   -495,  -1399,    754,    618,  -6103,   -179,  -2546,
-   965,  -1362,   -806,    838,  -3912,  -1346,  -3135,   -937,
-   219,    307,  -3509,   1210,   2381,  -7923,   6358,   -885,
-  2902,    284,   2560,   1789,   6878,      6,  -4418,  -2206,
- -1091,   1840,   -118,  -2659,   1008,   2192,   1651,   1363,
- -7772,   1252,  -1200,    133,   -757,    501,    -98, -17197,
-    98,   -543,   1743,    621,   -809,  -1950,   -793,   1168,
-  -743,  -7124,    166,   7875,  -4466,    356,  -1430,   -467,
-  8589,   9931,    520,   -866,   1945,   -599,   -434,    113,
-   589,  -3456,    597,   6076,   1114,   9660,   1532,   2073,
-  -138,   -721,  -1030,  -1309,    625,  -4040,   1211, -18836,
- -3963,  -4468,    197,    600,  -1004,   -816,   -560,   -476,
- -2160,     -2,     26,   8162,   1057,   -178, -11739,  -1882,
-  1000,   -227,    109,  -1852,  -1163, -17143,    140,   -718,
- -1150,     33,   1397,    -45,   -205,    153,  -1494,  20509,
-   -51,   -904,   -599,   1915,    884,    504,  -1819,  -4487,
-  1252,  -1259,  -2200,  -5601,   -448,   -686,   5778,    873,
- -4282,   -533,    295,   -450,   1422,   2393,   3267,  -3911,
-   249,  -3605,  -3190,  -1096,  -2422,    274,  -1918,   4070,
-  -206,   -432,   1919,   -645,   -275,  12954,    311,   1479,
- -2664,   -852,  -4809,   1102,   -375,     20,   1659,  -1179,
-  1199,     44,  -5590,  -1112,   -566, -11369,   -125,   -871,
-   158,   1208,    265,   -519,   -405,   2439,  -1129,   1827,
- -9461,   8548,  -1606,    380,   4924,    662,   1314,   -391,
- -2024,    827, -13381,   -198,   -142,   1600,   3329,    125,
-  -672,   -220,    557,  18642,     60,   7296, -10472,   -712,
-  1188,    808,     64,    479,    555,    264,    394,   -611,
-  -810,  -7943,   -235,  -6889,  -1575,   1320,   -381,  -7414,
-  1740,   -744,    369,   -626,  -6899,  -2144,   -593,    668,
-  -351,  -3756,  -5143,  -1814,    806,   -475,    588,   -507,
- -9088,   -629,    154,  -6945,  -1105,  10658,   -435,    384,
-  -757,   1183,   3806,   -747,   -378,    535,  10224,    626,
-  -866,  -1931,  -1484,   5818,   -750,  -9628,   -250,    589,
-  -653,   -198,    104,   -934,   1207,     46,    960,  -1032,
-  4236,   4471,  -2896,   1551,  -7714,  -1921,    746,   -671,
-  5114,   5482,   -522,  -3344,  -1905,  -9220,   -663,  -1355,
-  -611,     65,   1368,    628,  -1276,  -6780,  -2623,   -661,
-  -117,   -437,   5507,   3205,    928,    537,  -9487,     80,
-  -102,   -538,   -277,    863,  -1421,   6054,   1227,    696,
-  3582,   -508,  -1757,    145,  -1705,  -1201,   4157,  -3314,
-  2291,   -834,    821,    552,   -724,    513,  -9730,  -8944,
-  1913,    501,   -216,    716,   2766,   -823,   2535,    314,
-  1774,  -3372,    235,    244,  -1216,   -710,    689,   6736,
-   -52,    218,  -8382,   -444,    920,    569,  -4890,  -2050,
-  -612,   1708,   -481, -15500,  -2878,   -691,    538,   -125,
-   -81,   -862, -10094,  12050,  -1392,   -326,    133,     61,
-   -50,    715,  -6662,   -673,  10745,   -596,     44,   3906,
-   247,   -745,   4950,   -210,    497,  -1875,   8197,   2141,
-  1454,    -23,  -1480,   2184,   -804,   5515,  -1311,  -8893,
- -2880,  -3606,   -282,   -116,   8084,    618,   -403,   1106,
--14405,   1159,    229,    742,   -184, -19445,   -329,   -747,
- -1240,   1487,  -1670,   -839,    -77,   -882, -10986,  -2851,
-   -24,   -747,  -3615,   1939,   1389,    132,   5367,   1355,
-   408,  -1272,  11388,    153,   2708,  -1503,    169,   7357,
-    51, -13586,   -404,   -304,    626,    163,  -1814,   -515,
-   445,    589,  -1194,    770,    555,    246,   -165, -21192,
-   184,   -265,  -1116,   -485,  -8107,  -1992, -10805,   -880,
- -1455, -15154,   2312,  -1712,    -11,  -1899,   -400,     -2,
-   314,   -318,   -280,   -658,  -1066,  -2584,   1027,    801,
--11960,   1519,   8873,    465,  -3229,   1801,   -348,    749,
-     7,   1079,  -2051,  11521,   -831, -13425,  -6315,  -1135,
-  1088,   1056,    -46,  -1006,    374,  -5065,   1163,   -402,
-   -50,  -1459,   9586,    514,  -1439,   -638,   -155,  -5289,
-  8043,   -612,    739,   1084,    -60,    891,    786,     -6,
- -1078,   2097,  -5333,   3497,     23,   -913,   1303,    957,
-   -35,  -6418,   -146,   -971,   2738,   9695,  -1722,  -2002,
-   905,  -1749,   -917,    122,    379,   -325,   -455,    230,
-   825,   -137,   -335,    -96,   -160,    390,    731,  -2621,
- -5889,  -3949,   5138,    839,  -1190,    -66,    961,  -4600,
-  2345,   1607,  -2448,  -6653,   -592,   -106,  -7619,   -794,
- -1186, -12587,    -11,  -2224,   -225,  -2903,    534,   1355,
- -7002,    314,    494,   1950,  -8545,  -2531,  -2438,    -77,
-   886,  -1851,    944, -10156,   3003,   1846,   1919,   2019,
-   471,    451,   -436,  -1012, -20121,    275,     98,   1776,
-   578,     96,    -16,   1156,   3689,      7,   -207,    920,
-   105,    -58,   -175,    163,    697,   -407,    -61,   1261,
-  1297,   5061,   5326,  -1126,    516,   1208, -11108,    441,
-     7,   -899,    -19,   -368,    438,  -1911,    602,    716,
-   313,    853,   1448,   -817,  -1453,   1384,  -4371,   1043,
-  1884,   1619,   2196,  10075,  -1548,  -1201,   -796,   5228,
-  2657,   8244,   -605,    422,   -693,   3171,    657,   5438,
-  -171,    633,   1579,  -1718, -12265,   1083,   -976,   -293,
- -3802,   -306,   -668,   7818,  -1340,   -402,   2231,  -4472
-},
-
-.shape44 = {
-   -40,   -282,   1366,  -1173,  -3484,    355,  -1078,   3800,
-  4386,    -35,  -4192,    523,   1291,    678,    156,   2272,
- -1043,   1075,  -1849,   -314,   -522,    392,   2098,    -79,
-   473,   -275,      2,   6398,    451,     94,    173,   -431,
-  1115, -10788,     35,   1823,  -3380,    -97,    -98,   -350,
-   -23,  -1264,   -308,   8948,   -695,    -79,   3520,    308,
-   340,   -362,   -547,   1207,  -1182, -10392,   -148,   3580,
-   481,   -425,    862,   4894,    736,   -152,   -626,     23,
- -5853,     39,   -143,    418,   -103,  -1457, -12826,   -122,
-   283,   -225,  10561,   -153,   8872,   -806,    -51,     93,
-   420,   -209,    345,  -7661,   -732,    -48,    479,   -225,
-   276,  13385, -12578,  -1440,   -265,   -274,   1105,  -3376,
-  -691,   -579,   -972,    300,    349,    362,    722,   -472,
-   185,    814,     14,   4746,    761,   -336,   1691,    888,
- -1669, -18717,    827,  -2605,    921,    155,     68,    112,
- -3032,   -287,    414,    -86,    -62,   -213,   -106,    807,
-  -619,    598,   -178,   3104,   -481,  -1553,   1250,  -8363,
-  -686,  -9608,    116,    -47,    321,    -89,    939,    -35,
- -7995, -10159,   -526,    145,    363,   2170,   1077,  -1223,
-  -738,    120,   -408,   -390,    -80,   -404,  -1607, -10187,
- -6432,    961,     94,  -1459,    489,   6641,    372,   1007,
-  5958,   -834,    222,     51,    282,  -1005,   4473,  -8841,
-   -73,   -477,   -557,    121,   -165,  -1195,    438,    139,
-  -190,  -4205,  -4278,  -4617,  -7592,     40,   -422,   -459,
-   594,   7331,    164,    297,   2631,  -9075,    -78,    372,
- -6213,  -1053,    182,    -71,   -386,   -604, -11720,    552,
-  -617,    413,   1292,      4,   -485,   1162,   6051,  -5168,
-  -181,   1024,   -630,   -275,  -4067,  -8627,   1386,    970,
-  -423,   2973,   2360,    363,   -274,    410,     48,    768,
-  2958,   -427,     86,     64,   -128,   -273,   -182,   -292,
-   868,    463,     73,   -116,  -6509,  -5295,    -37,    691,
-   344,   -120,    168,    419,    494,  -1175,  18896,   -135,
-  -376,   -218,   -453,   -916,  -1040, -22179,   -846,  -1005,
-   264,    159,    597,   -952,   -825,    393,   -328, -14694,
-   371,   -263,    740,     38,  -1001,   1289,   -668,    187,
-  -155,    143,    683,   7133,   -563,  -8383,   -291,    176,
-    75,    613,  -6965, -11480,    324,   -490,    586,    416,
-   762,   5777,     64,    -47,  -4124,  -1196,   -113,    701,
-  -211,   2335,    130,    684,   7278,   -158,   -213,    297,
- 10845,  -1439,   -465,     17,   -792,   6499, -10187,   -444,
- -1416,    482,    636,   1472,    752,    157,   -334,  -3230,
-   -19,  -6747,    660,  -3082,   4057,   6801,    -19,    635,
-    19,   9807,    526,    126,    444,   -190,   -418, -26754,
-  -202,    243,    597,     10,    345,    814,   -330,    160,
-   344,   3986,    470,    459,   2387,   -549,  11889,  -1837,
-   -30,   2608,    615,   2301,   -771,  -1589,  -6935,   1321,
-  4287,    295,   -558,  -1503,   -611,   2104,    411,   -218,
-  1145,   -426,     58,   -102,     13,   7499,    476,  -4032,
- -2237,  -2658,  -1943,   5268,   1039,    389,   7091,    -22,
-   156,   -186,   2432,   -878,    305,  -1726,   3209,    361,
- -1030,    505,    618,   -262,  -1877,    268,    757,     24,
- 24306,    102,    973,    142,   -953,  -1199,    116,   -255,
-  5370,   -347,   -365,    937,  -6939,  -1189,   -760,    531,
- -1759,   -705,   -557,   -620,   1151,    250,  21629,  -1532,
-  -128,   1421,   -211,    592,   5126,    197,   -716,   1113,
-  5844,   -266,    -12,   -813,     85,    994,  -2106,  -3915,
-  1402,    533,    521,   -883,     87,   -386,     -2,  -4350,
- 19790,   -180,   -363,     60,    101,  -1717,    119,   -381,
-   100,   -565,   3264,   3052,    200,  -7319,     26,    347,
-  -482,  10609,   -766,    526,   -623,   3495,    339,  -4406,
-   -59,   -213,    686,   -603,    133,     99,     48,   1716,
- -1214,   1397,  -2396,   -384,   -901,  -3750,   -660,  -4314,
-   313,    192,    292,    259,   -644,    176,   2099,   7961,
-   -29,    642,  -2970,   1792,    -61,  -4348,    578,   1867,
- -1868,     32,   5262,    137,   6109,    443,   -176,    351,
-   400,   1874,   -175,  -4065,    697,    292,   -744,    121,
- -5134,   6996,   -198,    628,   1073,   -599,   -116, -17900,
-   647,  -1049,   -663,   1427,    -94,    721,    311,    337,
-  1376,  -2784,   3947,   1342,   1577,   -406,   -260, -10228,
-   109,   2358,   2437,    346,   1261,   -308,  -2094,   1682,
-   144,   -675,    183,    428,   -950,   1249,  -1546,     33,
-  -254,    681,  -1264,   -964,   -310,    838,    100, -21952,
- -1484,  -1564,    339,    298,     67,   -338,     89,    709,
-    53,    258,   -359,   2803,   1553,   -312,  -7993,  -1627,
-  1189,    476,   -123,    336,   -767, -18522,    589,    942,
-  -645,   -381,  -1913,   -582,     55,   -876,   -509,  25143,
-   690,   -787,  -1136,    114,    162,    342,   -231,  -8742,
-    99,   -646,   -474,  -1384,   -110,    -98,   8634,    -14,
- -9676,   -312,    358,    496,   -676,    -97,   1904,  -2124,
-   -66,  -1868,    502,   -513,  -3244,   2079,  -1476,   5440,
-   -40,   -381,    500,   -238,   -471,  12160,    248,  -1005,
- -2886,    173,  -3369,   -355,   -256,   -117,   -474,  -1282,
-  -355,    130,  -4833,     31,   -232, -12931,   -826,    322,
-   839,   1537,     73,    226,  -1888,   -483,  -2848,   -190,
-  1271,   3597,  -4514,    -38,   6093,    347,    -68,   -415,
-  -105,  -1664, -11461,   -110,   -399,    389,   -511,    935,
-  -424,  -1708,  -1026,  23239,    298,   7363,  -9206,   -566,
-   259,   -412,  -1213,    335,    614,    928,    972,  -1919,
-  -407,    509,    303, -13762,   -524,  10360,   1318,  -2758,
-  2350,   -106,   -119,    -68,  -6155,   -255,   -448,    -34,
-   -64,  -4382,     47,    635,   -339,    406,   -447,   -445,
--10592,    233,    160,  -5515,  -1333,   6755,   -952,    172,
- -1260,   -294,   3480,   -352,   -231,    415,    482,   -498,
-  -191,  -2034,   7934,   7997,   -688,  -9503,    376,   -228,
-  -500,    222,  -1021,   -407,    261,    179,    622,   1217,
-  -443,   -763,   -508,   -719,  -4509,     91,    449,   -283,
-    91,    -39,    961, -10148,   1596,  -9161,   -327,    221,
-  -470,    676,     12,   1416,    984, -10988,  -5500,   -189,
-  -727,    226,   4691,    688,    759,    930,  -6444,   -114,
-  -539,   -526,    -21,  -1218,    650,   6088,    419,   6185,
- -1200,     84,  -1232,    -34,   -107,     60,   2248,    450,
-  1187,   1264,   -181,    857,   2235,  -2859, -13483,   -192,
-  -586,   -207,  -5569,    503,   3376,   1243,   -700,   2119,
- -2186,   -296,    896,    299,    177,    184,   1375,   2498,
-   161,    579,  -3683,    443,    -21,   -186,  -3474,    238,
-   274,    277,   -325,  -8325,   -223,    125,    191,    333,
-  -345,  -1391,  -7372,  11389,  -1055,   4066,  -1098,     87,
-  -203,    443,    363,   -959,  15395,   4016,   -254,   1611,
-  -168,  -1070,   2709,   -768,    506,  -1245,   5821,   2499,
-  1564,     27,     85,   1989,  -1092,    150,   -972,    660,
-   -33,    687,    545,  -1564,    720,   -196,    -52,  -1751,
--25380,  -1246,   -615,    391,   -512, -23289,    460,    360,
-   -85,   -723,   -250,   -163,    -48,   -921,  -3988,    425,
- -1268,  -1695,   3233,  -1093,  -1166,    198,   7602,     21,
-   354,    733,  12213,   -347,    532,   -427,     22,   2218,
-  -578,  -3382,   -474,   -625,     78,  -4546,    863,    -53,
-  -357,  -1529,   1014,    710,   1356,   -430,  -1633, -24823,
-    95,     26,    590,   -591,  -7833,  -1355,  -9771,   -502,
-  -907, -15433,    957,    463,     35,   -496,    294,   2129,
-  1274,   -160,    -83,    531,   -767,    285,    232,   5983,
- -6122,   1620,   4112,   -239,  -1733,    -46,  -1321,    467,
-   613,  -3747,  -2284,  13991,    373, -17357,   -219,    -80,
-  -210,   1462,     37,  -1692,    548,  -5845,    420,     54,
-  -350,   -285,   1981,    262,   -874,   2844,   -435,  -6305,
-  6449,     72,    631,    -94,     96,   -442,   1137,     89,
-   364,   3392,  -3512,   -387,   1055,    318,  -1111,  -6971,
-   344,  -9105,    -96,  -9362,    190,   -225,    370,    161,
-   -73,  -1830,    174,     48,   -518,  -3486,    137,   -235,
-   810,     23,     80,   -642,    -35,   -316,   -269,   -373,
- -2413,   -933,   2525,    267,   -508,   -200,    422,  -3470,
- -1273,    640,  -1956,    139,    394,  -1043, -11008,   -158,
- -1089,  -2023,    202,   -979,   -744,   -159,   -392,    -37,
- -1679,   2183,   1365,  -2883,  -4752,  -2255,    109,   1660,
-  -613,   -511,   1284,  -7331,    947,   7009,  -2072,   -321,
-  -936,   -551,   -875,    160, -27027,    654,    265,    164,
-   376,    726,   -149,   2813,    -94,   5728,    702,  -1118,
- -2555,    217,   -186,   -107,    146,    -83,    -62,   -196,
-   708,    146,   3729,   -416,    212,   -163,  -7861,    347,
-    83,  -1079,   -994,    271,  -1054,  -1647,    139,    -20,
-   354,   1298,  -3420,   1130,    161,    475,  -3913,    468,
-    23,    285,  -1699,   8234,   -947,    222,    260,   4276,
-  -341,   6387,     21,    490,  -1908,  -1654,    -60,   2471,
-   733,   -135,    109,  -1136, -14756,   4922,   1165,    149,
- -3976,    -66,   -594,   6181,   -110,    292,   1129,   -591
-},
-
-.lsp08 = {
- 0.2702,  0.5096,  0.6437,  0.7672,  0.9639,  1.0696,  1.2625,  1.5789,
- 1.9285,  2.2383,  2.5129,  2.8470,  0.1740,  0.3677,  0.6082,  0.8387,
- 1.1084,  1.3721,  1.6362,  1.8733,  2.0640,  2.3442,  2.6087,  2.8548,
- 0.1536,  0.3279,  0.5143,  0.6859,  0.9763,  1.2744,  1.5605,  1.8566,
- 2.1007,  2.3450,  2.6075,  2.8850,  0.2075,  0.4533,  0.7709,  1.0377,
- 1.2953,  1.5132,  1.7826,  2.0351,  2.2590,  2.4996,  2.6795,  2.8748,
- 0.1393,  0.2453,  0.3754,  0.5453,  0.8148,  1.1289,  1.4389,  1.7592,
- 2.0353,  2.3215,  2.5934,  2.8588,  0.1250,  0.3627,  0.7613,  1.1380,
- 1.4163,  1.5565,  1.6920,  1.8130,  1.8678,  2.0427,  2.4318,  2.8544,
- 0.2256,  0.4223,  0.6452,  0.8599,  1.0673,  1.3118,  1.5486,  1.8366,
- 2.0759,  2.3026,  2.5284,  2.8030,  0.2304,  0.4404,  0.6891,  0.8964,
- 1.1510,  1.4202,  1.6483,  1.8580,  2.1181,  2.3686,  2.6078,  2.9128,
- 0.2230,  0.3816,  0.5520,  0.6062,  0.7909,  1.0988,  1.4330,  1.7846,
- 2.0713,  2.3457,  2.6048,  2.8708,  0.2447,  0.5800,  0.8249,  0.9905,
- 1.1721,  1.3990,  1.6694,  1.9064,  2.1307,  2.4255,  2.6815,  2.9117,
- 0.1974,  0.3812,  0.5802,  0.7759,  0.9280,  1.1547,  1.4170,  1.6369,
- 1.8890,  2.2587,  2.5626,  2.8239,  0.1209,  0.2510,  0.4841,  0.8048,
- 1.1197,  1.3563,  1.6073,  1.8926,  2.1350,  2.3669,  2.6291,  2.8985,
- 0.2352,  0.4347,  0.6582,  0.8178,  0.9548,  1.1654,  1.4942,  1.8812,
- 2.1703,  2.3779,  2.6412,  2.8871,  0.2091,  0.4084,  0.6730,  0.9151,
- 1.1259,  1.3262,  1.5937,  1.8129,  2.0237,  2.3317,  2.5778,  2.8620,
- 0.1167,  0.2406,  0.4520,  0.7298,  0.9848,  1.2448,  1.5137,  1.7874,
- 2.0280,  2.3020,  2.5914,  2.8794,  0.3003,  0.4966,  0.6520,  0.8505,
- 1.1600,  1.3981,  1.5805,  1.8346,  2.0757,  2.3102,  2.5760,  2.8499,
- 0.2451,  0.4163,  0.5960,  0.7805,  0.9507,  1.2438,  1.5587,  1.8581,
- 2.0735,  2.3198,  2.5704,  2.8220,  0.3112,  0.5517,  0.7032,  0.8528,
- 1.1489,  1.4257,  1.6848,  1.9388,  2.1577,  2.4265,  2.6678,  2.9051,
- 0.2249,  0.3897,  0.5559,  0.7473,  1.0158,  1.3581,  1.6914,  1.9930,
- 2.1843,  2.3534,  2.5512,  2.8065,  0.2600,  0.4574,  0.7349,  0.9691,
- 1.1696,  1.3848,  1.6335,  1.9021,  2.1174,  2.3481,  2.5902,  2.8390,
- 0.2246,  0.3372,  0.4560,  0.5249,  0.7056,  1.0273,  1.3810,  1.7132,
- 1.9819,  2.2574,  2.5410,  2.8491,  0.1419,  0.4834,  0.8835,  1.1453,
- 1.2839,  1.4224,  1.5593,  1.7877,  2.1285,  2.4070,  2.6043,  2.8511,
- 0.1886,  0.3677,  0.5617,  0.8099,  1.1277,  1.3841,  1.5804,  1.8136,
- 2.0307,  2.2805,  2.5399,  2.8322,  0.2351,  0.4151,  0.6675,  0.8713,
- 1.0464,  1.3292,  1.6586,  1.9281,  2.1355,  2.3495,  2.6222,  2.8782,
- 0.2700,  0.4489,  0.6206,  0.7121,  0.7737,  0.9848,  1.3658,  1.7433,
- 2.0139,  2.2243,  2.4806,  2.8175,  0.2479,  0.4425,  0.6490,  0.8745,
- 1.1161,  1.3849,  1.6773,  1.9566,  2.1491,  2.3624,  2.5685,  2.8114,
- 0.2035,  0.3701,  0.5567,  0.7953,  1.0082,  1.2758,  1.5373,  1.7822,
- 2.0175,  2.2601,  2.4759,  2.7771,  0.1856,  0.3461,  0.5998,  0.9041,
- 1.2383,  1.4612,  1.6667,  1.9305,  2.1617,  2.4107,  2.6477,  2.8656,
- 0.2107,  0.3715,  0.5289,  0.6651,  0.8420,  1.1168,  1.4401,  1.7230,
- 1.9901,  2.2687,  2.5452,  2.8655,  0.1218,  0.2999,  0.6348,  0.9482,
- 1.2745,  1.5876,  1.9129,  2.2348,  2.4020,  2.4922,  2.6351,  2.8357,
- 0.1617,  0.3483,  0.5869,  0.8163,  1.0366,  1.2344,  1.4609,  1.7029,
- 1.9476,  2.2337,  2.5258,  2.8442,  0.2505,  0.4894,  0.7510,  0.9152,
- 1.0845,  1.3657,  1.6528,  1.8346,  2.0160,  2.2811,  2.5338,  2.8136,
- 0.0947,  0.1158,  0.0578, -0.0337, -0.0066,  0.0104, -0.0447, -0.0505,
--0.0778, -0.0293,  0.0251, -0.0143,  0.0349, -0.0227, -0.0909,  0.0523,
- 0.0325, -0.0410, -0.1045, -0.0899, -0.0009,  0.0075, -0.0575, -0.0855,
--0.0129,  0.0575,  0.0597,  0.0391,  0.0371, -0.0184, -0.0083,  0.0287,
- 0.0143,  0.0167,  0.0120, -0.0168,  0.0452,  0.0223, -0.0352,  0.0119,
--0.0496, -0.0965, -0.0661, -0.0072,  0.1099,  0.0843, -0.0087, -0.0478,
--0.0128, -0.0120, -0.0004,  0.0731,  0.1047,  0.0630,  0.0196, -0.0103,
--0.0399, -0.0986, -0.0912, -0.0390, -0.0247, -0.0694, -0.0749, -0.0066,
- 0.0223,  0.0634,  0.0343, -0.0134,  0.0727,  0.0241,  0.0066,  0.0437,
- 0.0610,  0.0364,  0.0248, -0.0358, -0.0686, -0.0104,  0.0426,  0.0088,
--0.0137, -0.0165,  0.0671,  0.0815, -0.0863, -0.0644, -0.0088,  0.0023,
- 0.0482,  0.1174,  0.1270,  0.0594,  0.0165,  0.0949,  0.1098,  0.0137,
- 0.4951,  0.4999,  0.4958,  0.4907,  0.4984,  0.4965,  0.4958,  0.4996,
- 0.4987,  0.4958,  0.4986,  0.4977,  0.2841,  0.2186,  0.1474,  0.1687,
- 0.2217,  0.2632,  0.2706,  0.2624,  0.2162,  0.2453,  0.2460,  0.2531
-},
-
-.lsp11 = {
- 0.1103,  0.3862,  0.6863,  0.8447,  0.9231,  1.0261,  1.1248,  1.4057,
- 1.6621,  1.8010,  1.8692,  2.0704,  2.3490,  2.6060,  2.7539,  2.8977,
- 0.1273,  0.2407,  0.3812,  0.6004,  0.7767,  0.9383,  1.1344,  1.3351,
- 1.5233,  1.7262,  1.9466,  2.1739,  2.3495,  2.5162,  2.7164,  2.9202,
- 0.2010,  0.3330,  0.4488,  0.6465,  0.8046,  0.9889,  1.1479,  1.2964,
- 1.4770,  1.6606,  1.8789,  2.1155,  2.3287,  2.5199,  2.7101,  2.9119,
- 0.1168,  0.2197,  0.3279,  0.4691,  0.6268,  0.8251,  1.0533,  1.2714,
- 1.4712,  1.6762,  1.8831,  2.1114,  2.3230,  2.5297,  2.7365,  2.9270,
- 0.1405,  0.3109,  0.4986,  0.6891,  0.8634,  1.0583,  1.2594,  1.4349,
- 1.6232,  1.8116,  1.9905,  2.1935,  2.3799,  2.5656,  2.7661,  2.9486,
- 0.1703,  0.3057,  0.4403,  0.5225,  0.5969,  0.8110,  1.0729,  1.3215,
- 1.5407,  1.7381,  1.9477,  2.1680,  2.3586,  2.5612,  2.7630,  2.9410,
- 0.1128,  0.2628,  0.4523,  0.6495,  0.8176,  0.9816,  1.1746,  1.3710,
- 1.5568,  1.7518,  1.9497,  2.1452,  2.3346,  2.5389,  2.7362,  2.9264,
- 0.1809,  0.3287,  0.5205,  0.7264,  0.9298,  1.1217,  1.2970,  1.4894,
- 1.6874,  1.8493,  2.0576,  2.2382,  2.4097,  2.6041,  2.7796,  2.9389,
- 0.2502,  0.4709,  0.6892,  0.8346,  0.9209,  1.0455,  1.2399,  1.4616,
- 1.6463,  1.8380,  2.0475,  2.2397,  2.4665,  2.6550,  2.7701,  2.8895,
- 0.1040,  0.2340,  0.3964,  0.5740,  0.7764,  0.9941,  1.2000,  1.4014,
- 1.6024,  1.7974,  1.9939,  2.1959,  2.3783,  2.5663,  2.7613,  2.9484,
- 0.1912,  0.3393,  0.4743,  0.6313,  0.8014,  0.9879,  1.1855,  1.3922,
- 1.5678,  1.7289,  1.9271,  2.1165,  2.3089,  2.5414,  2.7448,  2.9269,
- 0.0965,  0.2025,  0.3398,  0.4990,  0.6934,  0.9386,  1.1730,  1.3766,
- 1.5783,  1.7783,  1.9790,  2.1831,  2.3670,  2.5578,  2.7641,  2.9516,
- 0.2126,  0.3652,  0.5545,  0.7170,  0.8674,  1.0640,  1.2558,  1.4061,
- 1.5904,  1.8095,  1.9760,  2.1505,  2.3549,  2.5575,  2.7023,  2.8877,
- 0.1827,  0.3426,  0.4894,  0.6488,  0.7960,  0.9535,  1.1217,  1.2798,
- 1.4566,  1.6453,  1.8044,  2.0042,  2.2379,  2.4611,  2.6697,  2.8966,
- 0.2034,  0.3822,  0.5231,  0.6960,  0.9200,  1.0394,  1.1616,  1.3772,
- 1.5493,  1.7330,  1.9646,  2.1233,  2.3334,  2.5361,  2.7087,  2.9470,
- 0.1050,  0.2060,  0.3705,  0.5998,  0.8337,  1.0577,  1.2559,  1.4327,
- 1.6334,  1.8165,  1.9853,  2.2058,  2.4063,  2.5818,  2.7625,  2.9458,
- 0.1419,  0.4053,  0.6660,  0.8911,  1.0405,  1.1547,  1.2506,  1.3926,
- 1.5669,  1.7527,  1.9694,  2.2054,  2.3889,  2.5743,  2.7586,  2.9174,
- 0.1514,  0.2825,  0.4309,  0.5772,  0.7470,  0.9703,  1.1462,  1.3316,
- 1.5321,  1.7259,  1.9282,  2.1266,  2.3106,  2.5064,  2.7067,  2.9094,
- 0.1693,  0.3156,  0.4878,  0.6635,  0.8206,  0.9569,  1.1154,  1.3064,
- 1.5109,  1.7184,  1.9179,  2.1036,  2.2763,  2.4820,  2.6949,  2.9105,
- 0.1432,  0.2718,  0.4241,  0.5564,  0.6939,  0.9011,  1.1582,  1.3948,
- 1.6181,  1.8024,  1.9814,  2.1740,  2.3459,  2.5456,  2.7491,  2.9307,
- 0.2294,  0.3857,  0.5590,  0.7434,  0.9189,  1.0941,  1.2740,  1.4456,
- 1.6178,  1.7994,  1.9689,  2.1644,  2.3525,  2.5385,  2.7468,  2.9405,
- 0.1667,  0.3109,  0.4612,  0.6032,  0.7375,  0.8866,  1.0840,  1.3053,
- 1.4982,  1.7044,  1.9146,  2.1117,  2.2942,  2.4983,  2.7084,  2.9132,
- 0.1810,  0.3205,  0.4696,  0.6231,  0.7641,  0.9959,  1.2427,  1.4361,
- 1.5889,  1.7544,  1.9083,  2.0733,  2.2457,  2.4461,  2.6793,  2.9098,
- 0.1164,  0.3753,  0.6068,  0.7503,  1.0100,  1.2131,  1.3793,  1.5302,
- 1.6300,  1.7950,  1.9057,  2.1031,  2.3830,  2.5745,  2.6949,  2.8779,
- 0.1571,  0.4378,  0.6735,  0.8312,  0.8944,  0.9818,  1.1622,  1.4094,
- 1.6423,  1.8066,  1.9258,  2.1838,  2.4363,  2.6279,  2.7358,  2.8790,
- 0.1398,  0.2686,  0.4248,  0.6156,  0.7870,  1.0035,  1.2012,  1.3689,
- 1.5363,  1.7398,  1.9604,  2.1619,  2.3345,  2.5097,  2.7271,  2.9368,
- 0.1913,  0.3338,  0.4987,  0.6446,  0.7852,  1.0163,  1.1886,  1.3610,
- 1.5379,  1.7230,  1.8880,  2.0862,  2.2960,  2.4928,  2.7122,  2.9151,
- 0.0908,  0.1752,  0.2899,  0.5365,  0.7761,  1.0100,  1.2124,  1.4060,
- 1.6019,  1.8010,  1.9774,  2.1905,  2.3733,  2.5623,  2.7660,  2.9565,
- 0.1773,  0.3179,  0.4925,  0.6864,  0.8452,  0.9897,  1.1860,  1.3722,
- 1.5515,  1.7658,  1.9802,  2.1819,  2.3620,  2.5442,  2.7250,  2.9220,
- 0.1286,  0.2341,  0.3689,  0.5364,  0.7176,  0.9350,  1.1083,  1.2943,
- 1.4974,  1.7059,  1.9047,  2.1145,  2.3242,  2.5361,  2.7453,  2.9329,
- 0.2273,  0.3834,  0.5565,  0.7192,  0.8431,  0.9962,  1.1763,  1.3571,
- 1.5774,  1.7419,  1.9202,  2.1131,  2.2919,  2.4898,  2.6895,  2.9180,
- 0.1775,  0.3058,  0.4274,  0.6023,  0.8151,  1.0734,  1.3211,  1.5178,
- 1.6706,  1.8154,  1.9686,  2.1537,  2.3461,  2.5276,  2.7181,  2.9121,
- 0.1653,  0.4304,  0.6361,  0.7824,  0.9183,  1.0452,  1.2071,  1.4077,
- 1.6206,  1.8299,  2.0089,  2.1948,  2.3900,  2.5982,  2.7844,  2.9487,
- 0.1492,  0.2609,  0.3820,  0.5485,  0.7243,  0.9319,  1.1538,  1.3579,
- 1.5266,  1.7002,  1.8873,  2.1016,  2.3175,  2.5221,  2.7241,  2.9243,
- 0.2074,  0.3781,  0.5209,  0.6869,  0.8577,  0.9875,  1.1849,  1.3568,
- 1.4907,  1.7335,  1.8902,  2.1224,  2.3099,  2.4918,  2.7023,  2.8765,
- 0.1359,  0.2254,  0.3286,  0.4432,  0.6586,  0.8964,  1.1125,  1.3523,
- 1.5626,  1.7579,  1.9846,  2.1905,  2.3548,  2.5542,  2.7663,  2.9346,
- 0.1430,  0.2966,  0.4685,  0.6493,  0.8315,  1.0304,  1.2220,  1.4082,
- 1.5995,  1.7888,  1.9774,  2.1737,  2.3607,  2.5577,  2.7558,  2.9405,
- 0.1477,  0.2694,  0.4056,  0.5626,  0.7051,  0.8647,  1.0491,  1.2488,
- 1.4814,  1.7072,  1.9150,  2.1147,  2.3038,  2.5144,  2.7184,  2.9202,
- 0.1690,  0.3033,  0.4580,  0.6686,  0.8536,  1.0293,  1.2124,  1.3998,
- 1.5718,  1.7607,  1.9580,  2.1245,  2.2971,  2.4762,  2.6896,  2.9177,
- 0.1092,  0.2779,  0.4853,  0.6880,  0.9011,  1.0953,  1.2752,  1.4618,
- 1.6623,  1.8484,  2.0264,  2.2152,  2.4017,  2.5835,  2.7671,  2.9436,
- 0.1497,  0.3637,  0.6014,  0.8032,  0.9963,  1.1835,  1.3741,  1.5698,
- 1.7382,  1.9094,  2.0710,  2.2392,  2.4082,  2.5926,  2.7762,  2.9536,
- 0.1434,  0.2492,  0.3966,  0.5934,  0.8033,  1.0657,  1.2796,  1.4276,
- 1.5745,  1.7833,  1.9288,  2.1247,  2.3543,  2.5412,  2.7049,  2.8872,
- 0.1612,  0.2926,  0.4574,  0.6387,  0.8265,  1.0180,  1.1808,  1.3526,
- 1.5564,  1.7536,  1.9187,  2.1192,  2.3149,  2.5006,  2.7101,  2.9217,
- 0.0828,  0.1863,  0.3235,  0.5050,  0.7250,  0.9867,  1.2093,  1.3941,
- 1.5980,  1.7932,  1.9809,  2.1894,  2.3918,  2.5773,  2.7540,  2.9329,
- 0.2001,  0.3655,  0.5290,  0.6761,  0.8027,  0.9972,  1.2090,  1.4255,
- 1.6085,  1.7825,  1.9804,  2.1681,  2.3457,  2.5325,  2.7319,  2.9196,
- 0.1505,  0.2767,  0.4254,  0.6054,  0.7821,  0.9567,  1.1294,  1.3080,
- 1.4984,  1.6954,  1.8666,  2.0736,  2.2875,  2.4969,  2.7072,  2.9163,
- 0.1589,  0.4151,  0.5749,  0.6651,  0.8061,  1.0470,  1.2616,  1.3690,
- 1.4985,  1.7808,  1.9825,  2.1068,  2.2751,  2.5448,  2.7133,  2.8689,
- 0.0916,  0.1846,  0.3788,  0.6329,  0.8774,  1.0687,  1.2653,  1.4561,
- 1.6573,  1.8449,  2.0402,  2.2254,  2.3968,  2.5861,  2.7792,  2.9508,
- 0.2282,  0.4159,  0.5834,  0.6899,  0.8108,  1.0321,  1.2795,  1.5262,
- 1.6936,  1.8469,  2.0922,  2.2607,  2.3795,  2.5301,  2.7386,  2.9530,
- 0.1651,  0.3004,  0.4555,  0.6179,  0.7891,  0.9584,  1.1372,  1.3707,
- 1.5951,  1.7880,  1.9434,  2.1465,  2.3311,  2.5081,  2.6977,  2.8970,
- 0.1279,  0.3828,  0.6330,  0.8323,  0.9652,  1.1175,  1.2319,  1.3511,
- 1.5115,  1.6392,  1.7835,  1.9558,  2.2008,  2.4635,  2.6910,  2.9058,
- 0.1193,  0.2185,  0.3521,  0.5311,  0.7378,  0.9239,  1.1105,  1.3217,
- 1.5362,  1.7504,  1.9536,  2.1627,  2.3560,  2.5506,  2.7548,  2.9453,
- 0.1806,  0.3432,  0.4981,  0.6948,  0.8928,  1.0527,  1.2467,  1.4140,
- 1.6326,  1.7950,  1.9935,  2.1969,  2.3512,  2.5682,  2.7445,  2.9277,
- 0.1846,  0.3112,  0.4568,  0.5891,  0.7317,  0.8493,  1.0204,  1.2022,
- 1.3688,  1.6020,  1.8428,  2.0710,  2.2725,  2.4879,  2.7057,  2.9160,
- 0.0880,  0.2514,  0.5332,  0.7272,  0.8906,  1.1354,  1.3199,  1.4941,
- 1.6010,  1.7151,  1.8712,  2.0643,  2.2755,  2.5375,  2.7054,  2.8891,
- 0.1382,  0.2833,  0.4658,  0.6897,  0.9071,  1.0716,  1.2469,  1.4143,
- 1.5910,  1.7947,  1.9805,  2.1581,  2.3338,  2.5215,  2.7292,  2.9211,
- 0.1061,  0.3494,  0.6327,  0.8570,  0.9748,  1.0560,  1.1529,  1.3250,
- 1.6032,  1.8340,  1.9711,  2.1157,  2.3011,  2.5464,  2.8078,  2.9803,
- 0.1603,  0.2839,  0.4307,  0.5980,  0.7980,  1.0399,  1.1971,  1.3524,
- 1.5715,  1.7838,  1.9468,  2.1498,  2.3627,  2.5514,  2.7327,  2.9148,
- 0.1691,  0.3117,  0.4796,  0.6895,  0.8732,  1.0164,  1.1916,  1.3707,
- 1.5384,  1.7202,  1.8857,  2.0672,  2.2487,  2.4593,  2.6789,  2.8940,
- 0.0965,  0.1702,  0.3191,  0.5721,  0.8100,  1.0241,  1.2272,  1.4196,
- 1.6093,  1.8057,  1.9884,  2.2037,  2.3925,  2.5805,  2.7578,  2.9366,
- 0.1950,  0.3519,  0.5272,  0.6973,  0.8732,  1.0656,  1.2112,  1.3959,
- 1.6116,  1.7821,  1.9445,  2.1592,  2.3348,  2.5142,  2.7440,  2.9297,
- 0.1388,  0.2557,  0.4120,  0.5727,  0.7354,  0.9196,  1.0985,  1.2805,
- 1.4643,  1.6535,  1.8340,  2.0546,  2.2758,  2.4778,  2.6921,  2.9122,
- 0.1823,  0.3336,  0.4957,  0.6771,  0.8563,  1.0137,  1.2299,  1.3849,
- 1.5718,  1.7667,  1.9193,  2.1326,  2.3135,  2.5268,  2.7133,  2.8998,
- 0.0790,  0.1901,  0.4083,  0.6456,  0.8463,  1.0285,  1.2297,  1.4181,
- 1.6159,  1.8056,  1.9971,  2.1912,  2.3816,  2.5746,  2.7692,  2.9497,
- 0.0049,  0.0116,  0.0045,  0.0039, -0.0010, -0.0122, -0.0205, -0.0034,
--0.0140, -0.0041,  0.0191, -0.0322,  0.0002, -0.0124, -0.0269,  0.0059,
- 0.0586,  0.0339, -0.0389, -0.0319, -0.0079, -0.0205, -0.0363, -0.0211,
- 0.0241,  0.0595,  0.0469,  0.0283,  0.0176, -0.0183, -0.0173, -0.0004,
- 0.0024,  0.0145,  0.0534,  0.0197, -0.0065, -0.0067,  0.0133,  0.0358,
--0.0104, -0.0386, -0.0109, -0.0078,  0.0275,  0.0565,  0.0251, -0.0027,
--0.0053,  0.0171,  0.0088,  0.0495,  0.0141,  0.0039, -0.0445, -0.0426,
--0.0184, -0.0280, -0.0223,  0.0039, -0.0171, -0.0606, -0.0786, -0.0430,
- 0.0544,  0.0595,  0.0320, -0.0012,  0.0108,  0.0185,  0.0066,  0.0408,
- 0.0552, -0.0073, -0.0247, -0.0480, -0.0288,  0.0186,  0.0212, -0.0013,
- 0.0403,  0.0598,  0.0690,  0.0516, -0.0298, -0.0177,  0.0278,  0.0168,
--0.0106,  0.0251,  0.0386,  0.0331, -0.0052,  0.0133,  0.0291, -0.0158,
--0.0329, -0.0367,  0.0287,  0.0462, -0.0176,  0.0049,  0.0242, -0.0034,
- 0.0135,  0.0086, -0.0149,  0.0241,  0.0504,  0.0246, -0.0273, -0.0369,
--0.0108, -0.0449, -0.0625, -0.0414, -0.0292, -0.0571, -0.0440, -0.0088,
- 0.0098,  0.0009, -0.0004,  0.0007, -0.0314, -0.0208, -0.0138, -0.0277,
--0.0044,  0.0522,  0.0315, -0.0270, -0.0277, -0.0256, -0.0103, -0.0201,
--0.0287, -0.0279, -0.0182,  0.0472,  0.0613,  0.0450,  0.0413,  0.0333,
- 0.0444,  0.0223,  0.0061,  0.0316,  0.0321,  0.0501,  0.0460,  0.0250,
- 0.0227,  0.0235,  0.0099,  0.0185, -0.0347, -0.0684, -0.0189,  0.0242,
--0.0190, -0.0273, -0.0012, -0.0253,  0.0293, -0.0231, -0.0219, -0.0010,
- 0.0153,  0.0128, -0.0166, -0.0435, -0.0417, -0.0121, -0.0351, -0.0390,
- 0.0077, -0.0278, -0.0355,  0.0092, -0.0063,  0.0005,  0.0216,  0.0461,
- 0.0538,  0.0451,  0.0298, -0.0130,  0.0058,  0.0206,  0.0471,  0.0499,
- 0.0280,  0.0086, -0.0007, -0.0317,  0.0259,  0.0176,  0.0043,  0.0212,
- 0.0138,  0.0106,  0.0220, -0.0025,  0.0050,  0.0122, -0.0051, -0.0086,
--0.0472, -0.0005,  0.0193,  0.0032,  0.0246,  0.0222,  0.0090, -0.0320,
--0.0713, -0.0526, -0.0151, -0.0440, -0.0648, -0.0466, -0.0092,  0.0115,
--0.0129,  0.0053, -0.0344, -0.0385,  0.0392,  0.0599,  0.0414,  0.0165,
--0.0098, -0.0320, -0.0261, -0.0055, -0.0139, -0.0110,  0.0084,  0.0172,
--0.0492, -0.0537, -0.0320, -0.0036,  0.0265,  0.0385,  0.0064, -0.0280,
--0.0230,  0.0134,  0.0241,  0.0106,  0.0387,  0.0105,  0.0068,  0.0260,
- 0.4940,  0.4911,  0.4849,  0.4820,  0.4837,  0.4839,  0.4824,  0.4799,
- 0.4812,  0.4782,  0.4788,  0.4711,  0.4706,  0.4671,  0.4601,  0.4578,
- 0.2954,  0.2121,  0.1859,  0.1958,  0.1474,  0.1086,  0.1351,  0.1362,
- 0.1486,  0.1342,  0.1215,  0.1423,  0.1634,  0.1588,  0.1539,  0.1857
-},
-
-.lsp16 = {
- 0.1813,  0.3911,  0.6301,  0.8012,  1.0057,  1.2041,  1.4271,  1.6943,
- 1.9402,  2.1733,  2.3521,  2.4989,  2.5839,  2.6846,  2.7634,  2.8950,
- 0.1311,  0.3183,  0.4659,  0.5601,  0.6658,  0.7828,  1.0065,  1.2717,
- 1.5185,  1.7339,  1.9530,  2.2189,  2.3739,  2.4991,  2.6984,  2.9256,
- 0.1627,  0.4519,  0.6323,  0.7012,  0.7848,  0.9801,  1.1810,  1.3222,
- 1.5413,  1.8129,  1.9338,  2.0809,  2.3180,  2.5189,  2.7066,  2.9514,
- 0.1475,  0.2447,  0.4240,  0.5669,  0.7872,  0.9838,  1.1823,  1.3814,
- 1.5358,  1.6820,  1.8794,  2.1419,  2.4132,  2.6112,  2.7911,  2.9511,
- 0.1224,  0.2876,  0.5013,  0.6985,  0.8902,  1.0901,  1.2835,  1.4768,
- 1.6596,  1.8538,  2.0467,  2.2304,  2.4124,  2.5942,  2.7729,  2.9531,
- 0.1741,  0.3034,  0.4677,  0.5879,  0.7258,  0.9648,  1.1417,  1.3220,
- 1.5081,  1.7151,  1.9212,  2.1286,  2.3208,  2.4938,  2.6765,  2.8891,
- 0.1657,  0.3174,  0.4907,  0.6559,  0.8295,  1.0254,  1.2071,  1.3880,
- 1.5737,  1.7845,  1.9027,  2.1139,  2.3323,  2.5157,  2.7323,  2.9015,
- 0.1592,  0.2758,  0.4417,  0.6315,  0.8257,  0.9873,  1.1277,  1.2830,
- 1.4337,  1.6315,  1.8899,  2.1356,  2.3572,  2.5632,  2.7468,  2.9420,
- 0.1524,  0.4325,  0.5931,  0.7036,  0.7696,  0.8923,  1.1739,  1.4773,
- 1.6609,  1.7911,  1.9666,  2.1972,  2.3754,  2.5045,  2.6613,  2.8882,
- 0.2130,  0.3013,  0.3721,  0.4257,  0.5079,  0.7015,  0.9815,  1.2554,
- 1.4648,  1.6966,  1.9138,  2.1075,  2.3318,  2.5292,  2.7453,  2.9347,
- 0.1142,  0.3748,  0.6205,  0.7642,  0.8121,  0.9022,  0.9843,  1.1558,
- 1.4467,  1.7422,  1.9574,  2.1302,  2.3812,  2.5898,  2.7720,  2.9583,
- 0.1255,  0.2339,  0.3570,  0.5323,  0.7458,  1.0003,  1.1729,  1.3567,
- 1.5217,  1.6977,  1.8924,  2.0942,  2.3145,  2.5408,  2.7553,  2.9337,
- 0.1316,  0.2289,  0.4327,  0.6663,  0.8509,  0.9994,  1.1697,  1.3804,
- 1.5609,  1.6903,  1.8572,  2.1019,  2.3687,  2.5789,  2.7715,  2.9472,
- 0.1502,  0.2546,  0.3883,  0.5333,  0.6976,  0.9163,  1.1071,  1.3364,
- 1.5420,  1.7525,  1.8948,  2.0839,  2.2819,  2.4651,  2.6875,  2.8987,
- 0.1593,  0.3014,  0.4573,  0.6354,  0.8157,  0.9805,  1.1783,  1.3747,
- 1.5678,  1.7326,  1.9286,  2.1340,  2.3253,  2.5280,  2.7180,  2.9298,
- 0.1811,  0.3167,  0.4655,  0.6507,  0.8198,  1.0075,  1.1892,  1.3743,
- 1.5227,  1.7090,  1.8849,  2.0743,  2.2750,  2.4830,  2.6896,  2.8953,
- 0.1846,  0.3577,  0.5315,  0.7290,  0.9176,  1.1016,  1.2654,  1.4525,
- 1.6315,  1.8268,  2.0238,  2.1934,  2.3868,  2.5753,  2.7682,  2.9469,
- 0.0876,  0.1439,  0.2048,  0.3654,  0.6281,  0.8853,  1.0907,  1.2992,
- 1.5227,  1.7373,  1.9395,  2.1419,  2.3488,  2.5486,  2.7466,  2.9348,
- 0.1391,  0.4170,  0.6561,  0.7953,  0.8734,  0.9986,  1.1870,  1.4520,
- 1.6042,  1.7910,  2.0135,  2.1870,  2.3358,  2.5066,  2.7409,  2.9955,
- 0.0804,  0.1355,  0.2599,  0.4998,  0.7408,  0.9474,  1.1276,  1.3428,
- 1.5556,  1.7712,  1.9699,  2.1535,  2.3605,  2.5548,  2.7489,  2.9325,
- 0.1304,  0.3087,  0.4979,  0.6584,  0.8414,  1.0329,  1.2244,  1.4189,
- 1.6118,  1.8200,  1.9985,  2.1893,  2.3915,  2.5794,  2.7647,  2.9344,
- 0.1895,  0.2849,  0.3705,  0.4126,  0.6265,  0.9207,  1.1774,  1.3762,
- 1.5757,  1.7728,  1.9568,  2.1662,  2.3615,  2.5575,  2.7561,  2.9416,
- 0.1800,  0.3078,  0.4805,  0.6796,  0.8503,  1.0046,  1.1703,  1.3269,
- 1.4862,  1.6502,  1.8454,  2.0873,  2.3175,  2.5356,  2.7516,  2.9469,
- 0.1950,  0.3233,  0.4568,  0.5940,  0.7589,  0.9978,  1.1701,  1.3383,
- 1.5017,  1.6565,  1.8243,  2.0605,  2.2938,  2.5147,  2.7419,  2.9396,
- 0.2531,  0.4391,  0.5790,  0.7170,  0.8998,  1.1430,  1.3577,  1.5326,
- 1.6328,  1.7627,  1.9726,  2.1762,  2.3563,  2.5478,  2.7385,  2.9067,
- 0.1805,  0.2788,  0.3591,  0.3881,  0.5441,  0.8055,  1.0766,  1.3165,
- 1.5316,  1.7508,  1.9477,  2.1374,  2.3438,  2.5484,  2.7501,  2.9410,
- 0.2044,  0.3671,  0.5396,  0.7042,  0.8582,  0.9831,  1.1261,  1.3194,
- 1.4769,  1.6979,  1.8717,  2.0463,  2.2620,  2.4739,  2.7054,  2.9208,
- 0.1048,  0.2175,  0.4206,  0.5923,  0.7483,  0.9400,  1.1356,  1.3799,
- 1.5958,  1.7320,  1.8984,  2.1296,  2.3594,  2.5492,  2.7387,  2.9305,
- 0.0842,  0.1729,  0.3951,  0.6447,  0.8688,  1.0605,  1.2472,  1.4330,
- 1.6232,  1.8144,  2.0216,  2.1915,  2.3878,  2.5763,  2.7685,  2.9464,
- 0.1461,  0.2593,  0.4105,  0.5677,  0.7328,  0.8919,  1.0484,  1.2302,
- 1.4386,  1.6635,  1.8873,  2.1024,  2.3116,  2.5268,  2.7273,  2.9269,
- 0.1503,  0.3108,  0.4756,  0.6731,  0.8600,  1.0233,  1.2115,  1.3971,
- 1.5915,  1.7892,  1.9517,  2.1603,  2.3487,  2.5460,  2.7308,  2.8998,
- 0.2163,  0.3669,  0.5125,  0.6709,  0.8143,  0.9930,  1.2095,  1.4205,
- 1.6176,  1.7112,  1.8398,  2.0896,  2.3513,  2.5290,  2.6667,  2.8960,
- 0.2133,  0.4382,  0.6287,  0.8702,  1.1088,  1.3749,  1.6062,  1.7446,
- 1.8333,  1.9122,  1.9614,  2.0669,  2.1789,  2.3449,  2.6038,  2.8849,
- 0.1598,  0.2719,  0.3877,  0.4815,  0.5926,  0.7795,  1.0449,  1.3045,
- 1.5210,  1.7391,  1.9462,  2.1397,  2.3553,  2.5458,  2.7540,  2.9392,
- 0.2918,  0.5607,  0.6801,  0.7404,  0.8285,  0.9431,  1.1579,  1.4080,
- 1.6332,  1.8472,  1.9738,  2.0771,  2.2890,  2.5178,  2.7445,  2.9830,
- 0.1664,  0.2842,  0.3965,  0.5463,  0.8162,  1.0346,  1.1849,  1.3446,
- 1.5122,  1.7563,  1.9960,  2.2002,  2.3796,  2.5689,  2.7712,  2.9550,
- 0.0911,  0.2397,  0.5052,  0.7868,  1.0299,  1.1311,  1.2244,  1.3333,
- 1.4395,  1.6790,  1.9369,  2.1717,  2.3689,  2.5538,  2.7340,  2.9326,
- 0.1647,  0.2931,  0.3836,  0.4978,  0.6255,  0.9243,  1.1339,  1.3001,
- 1.5269,  1.8010,  1.9715,  2.1419,  2.3784,  2.5503,  2.6719,  2.8745,
- 0.2440,  0.3802,  0.4756,  0.6613,  0.8627,  1.0292,  1.2291,  1.4060,
- 1.5198,  1.7354,  1.9044,  2.1010,  2.3147,  2.4996,  2.7171,  2.9041,
- 0.1590,  0.2876,  0.4572,  0.5996,  0.7713,  0.9490,  1.1205,  1.2815,
- 1.4516,  1.6385,  1.8179,  2.0457,  2.2759,  2.4785,  2.6861,  2.9080,
- 0.2297,  0.4309,  0.5712,  0.6717,  0.8138,  1.0463,  1.2492,  1.4560,
- 1.6796,  1.8458,  1.9642,  2.1452,  2.3636,  2.5395,  2.7456,  2.9495,
- 0.2975,  0.4678,  0.4996,  0.5809,  0.6279,  0.6884,  0.8606,  1.1386,
- 1.4412,  1.6876,  1.8760,  2.0932,  2.3178,  2.5166,  2.7345,  2.9280,
- 0.1278,  0.3737,  0.6004,  0.7069,  0.8147,  1.0180,  1.2581,  1.3812,
- 1.4855,  1.7268,  1.9970,  2.1258,  2.2936,  2.5702,  2.7563,  2.8983,
- 0.1314,  0.2508,  0.3999,  0.5680,  0.7424,  0.9367,  1.1286,  1.3175,
- 1.5336,  1.7404,  1.9317,  2.1404,  2.3514,  2.5562,  2.7510,  2.9402,
- 0.1043,  0.2367,  0.4293,  0.6376,  0.8160,  0.9836,  1.1779,  1.3850,
- 1.5835,  1.7875,  1.9765,  2.1593,  2.3654,  2.5577,  2.7465,  2.9398,
- 0.1529,  0.2515,  0.3454,  0.4374,  0.7011,  0.9015,  1.0744,  1.3532,
- 1.5699,  1.7545,  2.0021,  2.1259,  2.2278,  2.4546,  2.7264,  2.9425,
- 0.1429,  0.2808,  0.4395,  0.6334,  0.8069,  0.9705,  1.1520,  1.3250,
- 1.5109,  1.7285,  1.9356,  2.1469,  2.3479,  2.5554,  2.7512,  2.9348,
- 0.1625,  0.3022,  0.4756,  0.6315,  0.8032,  0.9924,  1.1596,  1.3204,
- 1.4994,  1.6929,  1.8955,  2.1090,  2.3025,  2.5018,  2.6908,  2.8980,
- 0.1692,  0.3427,  0.5228,  0.7756,  0.9688,  1.0950,  1.3056,  1.4360,
- 1.5675,  1.8049,  1.9376,  2.1151,  2.3407,  2.5012,  2.7192,  2.9258,
- 0.0474,  0.1251,  0.1939,  0.3841,  0.6501,  0.9231,  1.1153,  1.3240,
- 1.5478,  1.7599,  1.9651,  2.1510,  2.3645,  2.5552,  2.7542,  2.9393,
- 0.2196,  0.4656,  0.7492,  0.9922,  1.1678,  1.2489,  1.3112,  1.3657,
- 1.4223,  1.5302,  1.7212,  1.9996,  2.2523,  2.4844,  2.7036,  2.9145,
- 0.1128,  0.2368,  0.3704,  0.5476,  0.7723,  0.9968,  1.1930,  1.3992,
- 1.6013,  1.7957,  1.9888,  2.1857,  2.3825,  2.5705,  2.7616,  2.9434,
- 0.1341,  0.2768,  0.4510,  0.6359,  0.8332,  1.0335,  1.2004,  1.3952,
- 1.5762,  1.7681,  1.9815,  2.1735,  2.3657,  2.5552,  2.7514,  2.9498,
- 0.1247,  0.2559,  0.3516,  0.4726,  0.6861,  0.9483,  1.1852,  1.3858,
- 1.5851,  1.7815,  1.9778,  2.1737,  2.3729,  2.5664,  2.7620,  2.9429,
- 0.1988,  0.3320,  0.4777,  0.6737,  0.8425,  1.0265,  1.1694,  1.3655,
- 1.5463,  1.7135,  1.9385,  2.1650,  2.3529,  2.5367,  2.7545,  2.9585,
- 0.1376,  0.2620,  0.4273,  0.6169,  0.7755,  0.9441,  1.1169,  1.3157,
- 1.5179,  1.7020,  1.8931,  2.1059,  2.3112,  2.5136,  2.7169,  2.9198,
- 0.2112,  0.4385,  0.6091,  0.7618,  0.9553,  1.1543,  1.3445,  1.5396,
- 1.7153,  1.9192,  2.1263,  2.3593,  2.5958,  2.8171,  2.9394,  3.0409,
- 0.1347,  0.2099,  0.2646,  0.3453,  0.5266,  0.7869,  1.0513,  1.2795,
- 1.4880,  1.7181,  1.9294,  2.1332,  2.3362,  2.5442,  2.7433,  2.9362,
- 0.3141,  0.5935,  0.7517,  0.8313,  0.8568,  0.9570,  1.0250,  1.1275,
- 1.3422,  1.6303,  1.8577,  2.0705,  2.2957,  2.5095,  2.7244,  2.9262,
- 0.0962,  0.2116,  0.3961,  0.5641,  0.7122,  0.8883,  1.1023,  1.3481,
- 1.5623,  1.7554,  1.9618,  2.1675,  2.3706,  2.5556,  2.7430,  2.9337,
- 0.0898,  0.1510,  0.3060,  0.5820,  0.8221,  1.0388,  1.2261,  1.4289,
- 1.6054,  1.8103,  1.9941,  2.1844,  2.3742,  2.5711,  2.7632,  2.9474,
- 0.1326,  0.2316,  0.3761,  0.5177,  0.6782,  0.8761,  1.0952,  1.3175,
- 1.5078,  1.7034,  1.9051,  2.1245,  2.3424,  2.5484,  2.7444,  2.9389,
- 0.1740,  0.3293,  0.5174,  0.6824,  0.8394,  1.0372,  1.2046,  1.3723,
- 1.5656,  1.7444,  1.9442,  2.1386,  2.3139,  2.4960,  2.7071,  2.9297,
- 0.2304,  0.3775,  0.4865,  0.6182,  0.7842,  0.9208,  1.1151,  1.2843,
- 1.4641,  1.6988,  1.9209,  2.1260,  2.3099,  2.5229,  2.7414,  2.9276,
- 0.0094,  0.0261, -0.0037,  0.0041, -0.0092, -0.0044, -0.0232, -0.0073,
--0.0047, -0.0021,  0.0250, -0.0580, -0.0140, -0.0342, -0.0586,  0.0020,
- 0.0449,  0.0155, -0.0523, -0.0279,  0.0299, -0.0183, -0.0736, -0.0639,
--0.0017,  0.0336,  0.0209,  0.0046,  0.0077, -0.0148, -0.0114, -0.0120,
- 0.0115, -0.0050,  0.0445,  0.0048,  0.0188, -0.0137, -0.0080,  0.0239,
--0.0184, -0.0524, -0.0195, -0.0126,  0.0284,  0.0632,  0.0141, -0.0093,
--0.0096,  0.0196,  0.0230,  0.0379,  0.0308,  0.0237, -0.0224, -0.0600,
--0.0755, -0.1074, -0.0988, -0.0606, -0.1038, -0.1552, -0.1480, -0.0672,
- 0.0504,  0.0676,  0.0336, -0.0042,  0.0729,  0.1013,  0.0868,  0.0846,
- 0.0954,  0.0515, -0.0066, -0.0851, -0.0485,  0.0294,  0.0395,  0.0087,
- 0.0078,  0.0446,  0.0881,  0.0672, -0.0384, -0.0025,  0.0415,  0.0353,
- 0.0080,  0.0052,  0.0190,  0.0182,  0.0069,  0.0168,  0.0374,  0.0037,
--0.0292, -0.0429,  0.0302,  0.0681, -0.0233, -0.0238, -0.0003, -0.0043,
- 0.0054, -0.0029, -0.0149,  0.0642,  0.0622,  0.0341, -0.0232, -0.0461,
--0.0082, -0.0469, -0.0618, -0.0326, -0.0452, -0.0649, -0.0597, -0.0398,
--0.0318, -0.0116,  0.0011,  0.0009, -0.0384, -0.0384, -0.0156, -0.0260,
--0.0007,  0.0473,  0.0111, -0.0358, -0.0484, -0.0204, -0.0029, -0.0090,
--0.0285, -0.0495, -0.0376,  0.0917,  0.1192,  0.1026,  0.0745,  0.0397,
- 0.0463,  0.0253,  0.0025,  0.0465,  0.0100,  0.0488,  0.0416,  0.0223,
- 0.0263,  0.0072, -0.0053,  0.0595,  0.0060, -0.0518, -0.0316, -0.0043,
--0.0133, -0.0233, -0.0075, -0.0251,  0.0277, -0.0067, -0.0136, -0.0004,
- 0.0235,  0.0112, -0.0182, -0.0324, -0.0210, -0.0035, -0.0395, -0.0384,
- 0.0005, -0.0150, -0.0356,  0.0127, -0.0033, -0.0034,  0.0205,  0.0747,
- 0.1138,  0.1015,  0.0995, -0.0161, -0.0045,  0.0129,  0.0472,  0.0575,
- 0.0222,  0.0091,  0.0037, -0.0471,  0.0371,  0.0132,  0.0208,  0.0247,
- 0.0117,  0.0164,  0.0225,  0.0124, -0.0023,  0.0088, -0.0046,  0.0047,
--0.0393,  0.0018,  0.0148,  0.0020,  0.0044,  0.0165,  0.0229, -0.0208,
--0.0477, -0.0310, -0.0164, -0.0390, -0.0764, -0.0525, -0.0094,  0.0075,
--0.0102, -0.0045, -0.0504, -0.0709,  0.0822,  0.0710,  0.0426,  0.0014,
--0.0371, -0.0400, -0.0157, -0.0155, -0.0173, -0.0138, -0.0015,  0.0134,
--0.0418, -0.0682, -0.0256,  0.0050,  0.0360,  0.0354,  0.0074, -0.0396,
--0.0235,  0.0284,  0.0494,  0.0153,  0.0448,  0.0025, -0.0061,  0.0252,
- 0.1000,  0.2260,  0.2158,  0.2116,  0.2198,  0.2055,  0.2110,  0.1873,
- 0.1907,  0.2071,  0.2164,  0.2009,  0.2059,  0.2124,  0.2141,  0.2093,
- 0.0875,  0.0981,  0.1177,  0.1071,  0.1033,  0.1248,  0.1048,  0.1238,
- 0.1166,  0.1008,  0.1062,  0.0992,  0.0994,  0.1067,  0.0999,  0.1187,
- 0.0750,  0.0794,  0.0828,  0.0854,  0.0859,  0.0801,  0.0891,  0.0933,
- 0.0969,  0.0920,  0.0915,  0.0862,  0.0868,  0.0891,  0.0842,  0.0824,
- 0.0625,  0.0930,  0.0815,  0.0853,  0.0898,  0.0828,  0.0822,  0.0910,
- 0.0873,  0.0906,  0.0856,  0.0840,  0.0774,  0.0785,  0.0684,  0.0711,
- 0.3319,  0.4219,  0.4588,  0.4090,  0.4092,  0.4014,  0.3548,  0.3353,
- 0.3708,  0.3352,  0.3720,  0.3538,  0.4084,  0.4289,  0.4060,  0.4210,
- 0.0588,  0.0209, -0.0082, -0.0115, -0.0343, -0.0621, -0.0541, -0.0346,
--0.0346, -0.0366, -0.0220, -0.0265, -0.0102,  0.0374,  0.0306,  0.0404,
- 0.0306,  0.0090, -0.0054,  0.0333,  0.0047,  0.0238,  0.0141,  0.0165,
- 0.0306,  0.0420,  0.0159,  0.0124,  0.0414,  0.0158, -0.0237,  0.0141,
- 0.0765,  0.0057, -0.0260, -0.0426, -0.0395, -0.0126, -0.0579, -0.0417
-},
-
-.lsp22_1 = {
- 0.0664,  0.1875,  0.4300,  0.6730,  0.8793,  1.0640,  1.2563,  1.4433,
- 1.6394,  1.8176,  2.0029,  2.1921,  2.3796,  2.5671,  2.7595,  2.9536,
- 0.2128,  0.4052,  0.5311,  0.6404,  0.7875,  0.8775,  1.0974,  1.3261,
- 1.5563,  1.6790,  1.8339,  2.1195,  2.3226,  2.4609,  2.6440,  2.8947,
- 0.2024,  0.3362,  0.4834,  0.6784,  0.9088,  1.0850,  1.2188,  1.4054,
- 1.6102,  1.7767,  1.9679,  2.1436,  2.3445,  2.5467,  2.7429,  2.9320,
- 0.1181,  0.2279,  0.4413,  0.6114,  0.7710,  0.9427,  1.1142,  1.2707,
- 1.4892,  1.7416,  1.9526,  2.1466,  2.3629,  2.5445,  2.7293,  2.9205,
- 0.1155,  0.2720,  0.4886,  0.6812,  0.8594,  1.0422,  1.2315,  1.4116,
- 1.6137,  1.8020,  1.9758,  2.1743,  2.3602,  2.5568,  2.7472,  2.9374,
- 0.1110,  0.3312,  0.4735,  0.5612,  0.7129,  0.8146,  1.0233,  1.3155,
- 1.5765,  1.7746,  1.9574,  2.1416,  2.3220,  2.5384,  2.7334,  2.9318,
- 0.1656,  0.3350,  0.4215,  0.5609,  0.6759,  0.8503,  1.1405,  1.4094,
- 1.6057,  1.6860,  1.7639,  2.0031,  2.2680,  2.5076,  2.7263,  2.9368,
- 0.1466,  0.3638,  0.4587,  0.5674,  0.7381,  0.8669,  0.9619,  1.1658,
- 1.4667,  1.7440,  1.9335,  2.1018,  2.3022,  2.5281,  2.7359,  2.9261,
- 0.1061,  0.2566,  0.4739,  0.6751,  0.8711,  1.0704,  1.2720,  1.4655,
- 1.6605,  1.8494,  2.0290,  2.2197,  2.4008,  2.5912,  2.7772,  2.9513,
- 0.1116,  0.2364,  0.3971,  0.6316,  0.8583,  1.0335,  1.1686,  1.3302,
- 1.5612,  1.7877,  1.9829,  2.2052,  2.3596,  2.5460,  2.7341,  2.9290,
- 0.2661,  0.4186,  0.5126,  0.6477,  0.8818,  1.1045,  1.2852,  1.4128,
- 1.5851,  1.7593,  1.9399,  2.1757,  2.3684,  2.5136,  2.6927,  2.9064,
- 0.1495,  0.2749,  0.4391,  0.6304,  0.8239,  1.0181,  1.1995,  1.3759,
- 1.5669,  1.7722,  1.9671,  2.1635,  2.3586,  2.5528,  2.7445,  2.9311,
- 0.0912,  0.1759,  0.3066,  0.5660,  0.8005,  0.9568,  1.1832,  1.4504,
- 1.6259,  1.7948,  2.0113,  2.2002,  2.3654,  2.5583,  2.7929,  2.9735,
- 0.1353,  0.2747,  0.4078,  0.5977,  0.7658,  0.9124,  1.1081,  1.3630,
- 1.5875,  1.7847,  1.9323,  2.1181,  2.3321,  2.5046,  2.7183,  2.9225,
- 0.1938,  0.4063,  0.4982,  0.6002,  0.7702,  0.9071,  1.1631,  1.3885,
- 1.6043,  1.8118,  1.9306,  2.0893,  2.2724,  2.4609,  2.6283,  2.8802,
- 0.1857,  0.3351,  0.4381,  0.6101,  0.7561,  0.8555,  1.0384,  1.3171,
- 1.5667,  1.6904,  1.7552,  1.9689,  2.2597,  2.5260,  2.7272,  2.9337,
- 0.1037,  0.2159,  0.4188,  0.6174,  0.8035,  1.0285,  1.2256,  1.4230,
- 1.6400,  1.8322,  2.0144,  2.1988,  2.3810,  2.5682,  2.7613,  2.9438,
- 0.1625,  0.2776,  0.4225,  0.6001,  0.7879,  0.9087,  1.0801,  1.2759,
- 1.4899,  1.7448,  1.9911,  2.1770,  2.3723,  2.5777,  2.7971,  2.9444,
- 0.2111,  0.3640,  0.5839,  0.7290,  0.8051,  1.0023,  1.2315,  1.4143,
- 1.5878,  1.7755,  1.9804,  2.1498,  2.3312,  2.5350,  2.7613,  2.9472,
- 0.1423,  0.2646,  0.4136,  0.6350,  0.8070,  0.9514,  1.1168,  1.3213,
- 1.5776,  1.7721,  1.9404,  2.1545,  2.3385,  2.5137,  2.7396,  2.9553,
- 0.1132,  0.2386,  0.4103,  0.5931,  0.7808,  0.9881,  1.1840,  1.3860,
- 1.6021,  1.7990,  1.9922,  2.1885,  2.3852,  2.5717,  2.7640,  2.9510,
- 0.1267,  0.2602,  0.3913,  0.5944,  0.7598,  0.9198,  1.0781,  1.2715,
- 1.5299,  1.7573,  1.9308,  2.1346,  2.3267,  2.5419,  2.7466,  2.9320,
- 0.2023,  0.3417,  0.4392,  0.6141,  0.7439,  0.8593,  1.1096,  1.3543,
- 1.5185,  1.6553,  1.7862,  2.0341,  2.2718,  2.4834,  2.7103,  2.9466,
- 0.1113,  0.2470,  0.3677,  0.5686,  0.7700,  0.9356,  1.0806,  1.2452,
- 1.4830,  1.7344,  1.9268,  2.1404,  2.3371,  2.5169,  2.7329,  2.9012,
- 0.1664,  0.3554,  0.5573,  0.7471,  0.9245,  1.0998,  1.2787,  1.4655,
- 1.6654,  1.8346,  2.0179,  2.2159,  2.4096,  2.5946,  2.7790,  2.9530,
- 0.1313,  0.2625,  0.4731,  0.6444,  0.8110,  0.9878,  1.1493,  1.3212,
- 1.5719,  1.8138,  1.9861,  2.1943,  2.3714,  2.5578,  2.7346,  2.9296,
- 0.1186,  0.3035,  0.5049,  0.6860,  0.8670,  0.9975,  1.1364,  1.3471,
- 1.5695,  1.7412,  1.9346,  2.1506,  2.3413,  2.5531,  2.7794,  2.9627,
- 0.1108,  0.2697,  0.4787,  0.6344,  0.7909,  0.9586,  1.1440,  1.3511,
- 1.5686,  1.7601,  1.9246,  2.1241,  2.3293,  2.5390,  2.7315,  2.9333,
- 0.0985,  0.2302,  0.3544,  0.5759,  0.7620,  0.9651,  1.1497,  1.3080,
- 1.5500,  1.7845,  1.9518,  2.1734,  2.3565,  2.5665,  2.7605,  2.9102,
- 0.1208,  0.2727,  0.4381,  0.5736,  0.7382,  0.8390,  1.0102,  1.2648,
- 1.5100,  1.7440,  1.9619,  2.1430,  2.3307,  2.5159,  2.7264,  2.9211,
- 0.1582,  0.2777,  0.4475,  0.6551,  0.8591,  1.0084,  1.1414,  1.3291,
- 1.5902,  1.7826,  1.9543,  2.1659,  2.3233,  2.5044,  2.6935,  2.9199,
- 0.1360,  0.2873,  0.4585,  0.6295,  0.7592,  0.9089,  1.0492,  1.2733,
- 1.5391,  1.7768,  1.9372,  2.1329,  2.3168,  2.5015,  2.6857,  2.8837,
- 0.0886,  0.1829,  0.3696,  0.6126,  0.8334,  1.0135,  1.2303,  1.4674,
- 1.6743,  1.8564,  2.0530,  2.2370,  2.3960,  2.5787,  2.7756,  2.9377,
- 0.2005,  0.3537,  0.4700,  0.6249,  0.7385,  0.9097,  1.1759,  1.3811,
- 1.5314,  1.6705,  1.8546,  2.1229,  2.3292,  2.5251,  2.7951,  2.9646,
- 0.1999,  0.3112,  0.4722,  0.7146,  0.8908,  1.0028,  1.1831,  1.3903,
- 1.6125,  1.7514,  1.9083,  2.1248,  2.3271,  2.5339,  2.6945,  2.8918,
- 0.1243,  0.2606,  0.4382,  0.5850,  0.7705,  0.9727,  1.1214,  1.3059,
- 1.5218,  1.7406,  1.9137,  2.1353,  2.3354,  2.5299,  2.7287,  2.9068,
- 0.1039,  0.2426,  0.4265,  0.6284,  0.8152,  0.9941,  1.2004,  1.4038,
- 1.5912,  1.7763,  1.9650,  2.1598,  2.3474,  2.5488,  2.7419,  2.9322,
- 0.1364,  0.2420,  0.3886,  0.5864,  0.7663,  0.8844,  1.0860,  1.3242,
- 1.5518,  1.7893,  2.0004,  2.1562,  2.3619,  2.5516,  2.7687,  2.9181,
- 0.1483,  0.2851,  0.4479,  0.6312,  0.7924,  0.9821,  1.1705,  1.3386,
- 1.5375,  1.7226,  1.9053,  2.0991,  2.2898,  2.4953,  2.7000,  2.9146,
- 0.2332,  0.4561,  0.5407,  0.6212,  0.7524,  0.8215,  0.9522,  1.1685,
- 1.5216,  1.7132,  1.8291,  2.0647,  2.2811,  2.4857,  2.7071,  2.9281,
- 0.1348,  0.3126,  0.5179,  0.7192,  0.9227,  1.1363,  1.3223,  1.4756,
- 1.6509,  1.8191,  1.9991,  2.1976,  2.3877,  2.5768,  2.7590,  2.9386,
- 0.1093,  0.2211,  0.4763,  0.6703,  0.8282,  0.9536,  1.1202,  1.3796,
- 1.6043,  1.8031,  1.9832,  2.1604,  2.3578,  2.5856,  2.7650,  2.9291,
- 0.1865,  0.3027,  0.4580,  0.6719,  0.8400,  1.0082,  1.1901,  1.3782,
- 1.5448,  1.6885,  1.9477,  2.1381,  2.2797,  2.5113,  2.7465,  2.9414,
- 0.1575,  0.3124,  0.4649,  0.6262,  0.8095,  0.9858,  1.1676,  1.3602,
- 1.5646,  1.7582,  1.9550,  2.1671,  2.3628,  2.5734,  2.7670,  2.9519,
- 0.1174,  0.2777,  0.4663,  0.6333,  0.8169,  1.0096,  1.1885,  1.3847,
- 1.5803,  1.7571,  1.9380,  2.1398,  2.3414,  2.5407,  2.7360,  2.9375,
- 0.1073,  0.2264,  0.4083,  0.5973,  0.7474,  0.9514,  1.1349,  1.3337,
- 1.5433,  1.7348,  1.9380,  2.1436,  2.3441,  2.5438,  2.7457,  2.9383,
- 0.1472,  0.2880,  0.4793,  0.6268,  0.8015,  1.0063,  1.1715,  1.3644,
- 1.5525,  1.7410,  1.9258,  2.1227,  2.3214,  2.5149,  2.7148,  2.9196,
- 0.1414,  0.2565,  0.4349,  0.6111,  0.7695,  0.9496,  1.1212,  1.3265,
- 1.5218,  1.7209,  1.9015,  2.0887,  2.3158,  2.5077,  2.7233,  2.9421,
- 0.1252,  0.2667,  0.4454,  0.6431,  0.8371,  1.0124,  1.2110,  1.4160,
- 1.6240,  1.8242,  2.0047,  2.1974,  2.3902,  2.5778,  2.7637,  2.9481,
- 0.1321,  0.2565,  0.3846,  0.5847,  0.7578,  0.9259,  1.0637,  1.2239,
- 1.4690,  1.7346,  1.9750,  2.1882,  2.3712,  2.5509,  2.7280,  2.8885,
- 0.1437,  0.2930,  0.4428,  0.6156,  0.8045,  0.9638,  1.1450,  1.3138,
- 1.5144,  1.7355,  1.9469,  2.1534,  2.3414,  2.5452,  2.7353,  2.9334,
- 0.1692,  0.2770,  0.3831,  0.6100,  0.7825,  0.9302,  1.0690,  1.2481,
- 1.4615,  1.6799,  1.9165,  2.1739,  2.3435,  2.5349,  2.7520,  2.9163,
- 0.1235,  0.2489,  0.4354,  0.6343,  0.8236,  1.0066,  1.1908,  1.3474,
- 1.5656,  1.8275,  2.0620,  2.2548,  2.4135,  2.5913,  2.7639,  2.9334,
- 0.1090,  0.1961,  0.3854,  0.5701,  0.7024,  0.8843,  1.1393,  1.3785,
- 1.5940,  1.7797,  1.9442,  2.1740,  2.3853,  2.5773,  2.7727,  2.9406,
- 0.1560,  0.3477,  0.5011,  0.6287,  0.7612,  0.9896,  1.1510,  1.3420,
- 1.5435,  1.6816,  1.8731,  2.0651,  2.2613,  2.4999,  2.7027,  2.8971,
- 0.1459,  0.2416,  0.3833,  0.5450,  0.7916,  0.9223,  1.0662,  1.1953,
- 1.4029,  1.6616,  1.9320,  2.1459,  2.3386,  2.5081,  2.6799,  2.9195,
- 0.1546,  0.3854,  0.6184,  0.8460,  1.0599,  1.2428,  1.3906,  1.5550,
- 1.7388,  1.8945,  2.0757,  2.2386,  2.4014,  2.5705,  2.7574,  2.9400,
- 0.1080,  0.2307,  0.4112,  0.6067,  0.7725,  0.9467,  1.1285,  1.3205,
- 1.5348,  1.7609,  1.9937,  2.1878,  2.3583,  2.5515,  2.7199,  2.9049,
- 0.1482,  0.3178,  0.4983,  0.6342,  0.7783,  0.9880,  1.2019,  1.3404,
- 1.5223,  1.7296,  1.9211,  2.0943,  2.2928,  2.5008,  2.7136,  2.9224,
- 0.1145,  0.2910,  0.4891,  0.6492,  0.8126,  0.9530,  1.1180,  1.3155,
- 1.5054,  1.6893,  1.8899,  2.1188,  2.3389,  2.5512,  2.7313,  2.9224,
- 0.0939,  0.1689,  0.3250,  0.5792,  0.7698,  0.9245,  1.1574,  1.3865,
- 1.5959,  1.7977,  1.9821,  2.1528,  2.3326,  2.5540,  2.7553,  2.9179,
- 0.1243,  0.2474,  0.3923,  0.6199,  0.7908,  0.9379,  1.1497,  1.3734,
- 1.5582,  1.7420,  1.9539,  2.1385,  2.3240,  2.5277,  2.7311,  2.9178,
- 0.1961,  0.3748,  0.5176,  0.6387,  0.8169,  1.0477,  1.2124,  1.3869,
- 1.5604,  1.7225,  1.8770,  2.0837,  2.2960,  2.5103,  2.6945,  2.8862,
- 0.1295,  0.2403,  0.4149,  0.6189,  0.7913,  0.9130,  1.0832,  1.2787,
- 1.4860,  1.7112,  1.9502,  2.1348,  2.2776,  2.4982,  2.7431,  2.9522,
- 0.0160,  0.0362,  0.0097,  0.0057, -0.0014, -0.0073, -0.0046, -0.0064,
--0.0121,  0.0019,  0.0149, -0.0440, -0.0479, -0.0382, -0.0480, -0.0182,
- 0.0170,  0.0114, -0.0298, -0.0175, -0.0033, -0.0354, -0.0510, -0.0025,
- 0.0307,  0.0351,  0.0338,  0.0420,  0.0138, -0.0175, -0.0102,  0.0053,
- 0.0084, -0.0003,  0.0412, -0.0027,  0.0145, -0.0039,  0.0083,  0.0400,
- 0.0001, -0.0262,  0.0055, -0.0082,  0.0348,  0.0433,  0.0137, -0.0024,
--0.0055,  0.0262,  0.0521,  0.0349,  0.0185,  0.0076, -0.0319, -0.0561,
--0.0460, -0.0253, -0.0097,  0.0163,  0.0184, -0.0037, -0.0480, -0.0371,
- 0.0628,  0.0665,  0.0296, -0.0057,  0.0253,  0.0227,  0.0350,  0.0692,
- 0.0545,  0.0218,  0.0094, -0.0449, -0.0372,  0.0005,  0.0258,  0.0118,
- 0.0285,  0.0760,  0.0822,  0.0527, -0.0299, -0.0049,  0.0170,  0.0195,
- 0.0136,  0.0286,  0.0289,  0.0139,  0.0054,  0.0152,  0.0244,  0.0028,
--0.0056, -0.0260,  0.0307,  0.0572, -0.0087,  0.0088,  0.0062,  0.0000,
- 0.0125,  0.0000, -0.0292,  0.0820,  0.0872,  0.0646,  0.0346,  0.0076,
--0.0022, -0.0253, -0.0567, -0.0188, -0.0336, -0.0673, -0.0549, -0.0166,
--0.0259, -0.0140,  0.0040, -0.0029, -0.0430, -0.0531, -0.0253, -0.0019,
--0.0071,  0.0393,  0.0072, -0.0327, -0.0236, -0.0235, -0.0177, -0.0186,
--0.0280, -0.0201, -0.0077,  0.0383,  0.0418,  0.0321,  0.0294,  0.0169,
- 0.0468,  0.0301,  0.0133,  0.0363,  0.0516,  0.0937,  0.1240,  0.1404,
- 0.1325,  0.1178,  0.0999,  0.0251, -0.0037, -0.0495, -0.0703, -0.0219,
--0.0261, -0.0304, -0.0204, -0.0372,  0.0355,  0.0131, -0.0093, -0.0099,
--0.0069, -0.0034, -0.0065, -0.0208, -0.0231, -0.0117, -0.0211, -0.0243,
- 0.0046, -0.0107, -0.0070,  0.0123,  0.0230,  0.0152,  0.0164,  0.0412,
- 0.0619,  0.0858,  0.0862, -0.0056,  0.0125,  0.0182,  0.0347,  0.0388,
- 0.0456,  0.0407, -0.0249, -0.0460,  0.0206,  0.0299,  0.0253,  0.0207,
- 0.0177,  0.0238,  0.0253,  0.0030,  0.0042,  0.0020, -0.0081, -0.0136,
--0.0290, -0.0042,  0.0122,  0.0051,  0.0107,  0.0228,  0.0211, -0.0068,
--0.0436, -0.0299, -0.0078, -0.0779, -0.1157, -0.0679,  0.0172,  0.0150,
--0.0051,  0.0081, -0.0512, -0.0616,  0.0576,  0.0799,  0.0803,  0.0336,
- 0.0001, -0.0298, -0.0747, -0.0115, -0.0101, -0.0170, -0.0050,  0.0174,
--0.0290, -0.0601, -0.0150,  0.0121,  0.0165,  0.0230,  0.0028, -0.0317,
--0.0165,  0.0356,  0.0451,  0.0120,  0.0321,  0.0084, -0.0058,  0.0122,
- 0.1935,  0.1802,  0.2195,  0.2410,  0.2201,  0.1915,  0.1840,  0.1935,
- 0.2213,  0.2079,  0.1858,  0.1974,  0.2239,  0.2173,  0.1840,  0.2120,
- 0.4912,  0.4777,  0.4607,  0.4395,  0.4426,  0.4388,  0.4416,  0.4345,
- 0.4239,  0.4331,  0.4522,  0.4423,  0.4475,  0.4387,  0.4525,  0.4446
-},
-
-.lsp22_2 = {
- 0.0712,  0.1830,  0.4167,  0.6669,  0.8738,  1.0696,  1.2555,  1.4426,
- 1.6427,  1.8138,  1.9966,  2.1925,  2.3872,  2.5748,  2.7713,  2.9597,
- 0.1894,  0.3942,  0.5418,  0.6747,  0.7517,  0.8763,  1.1189,  1.3072,
- 1.5011,  1.6790,  1.8342,  2.0781,  2.2929,  2.4566,  2.6613,  2.9204,
- 0.1767,  0.3403,  0.5173,  0.7055,  0.8899,  1.0696,  1.2302,  1.4111,
- 1.5989,  1.7751,  1.9618,  2.1544,  2.3454,  2.5356,  2.7362,  2.9315,
- 0.1240,  0.2361,  0.4423,  0.6326,  0.7729,  0.9387,  1.1142,  1.2847,
- 1.4746,  1.7126,  1.9482,  2.1642,  2.3536,  2.5506,  2.7593,  2.9197,
- 0.1213,  0.2782,  0.5011,  0.6910,  0.8564,  1.0462,  1.2315,  1.4232,
- 1.6178,  1.8028,  1.9813,  2.1766,  2.3670,  2.5591,  2.7475,  2.9403,
- 0.1382,  0.2995,  0.4693,  0.5874,  0.6929,  0.8102,  1.0094,  1.2960,
- 1.5511,  1.7607,  1.9699,  2.1680,  2.3367,  2.5459,  2.7370,  2.9105,
- 0.1428,  0.2690,  0.3713,  0.4757,  0.6664,  0.9019,  1.1276,  1.3674,
- 1.5471,  1.6695,  1.8261,  2.0572,  2.2753,  2.4963,  2.7187,  2.9114,
- 0.1669,  0.3085,  0.4489,  0.5724,  0.6934,  0.8465,  0.9680,  1.1641,
- 1.4320,  1.6841,  1.8977,  2.1061,  2.3118,  2.5152,  2.7329,  2.9274,
- 0.1128,  0.2709,  0.4803,  0.6878,  0.8673,  1.0693,  1.2749,  1.4657,
- 1.6650,  1.8434,  2.0339,  2.2300,  2.4003,  2.5951,  2.7762,  2.9465,
- 0.1201,  0.2345,  0.4021,  0.6379,  0.8651,  1.0256,  1.1630,  1.3250,
- 1.5395,  1.7808,  2.0011,  2.1997,  2.3618,  2.5505,  2.7561,  2.9351,
- 0.2575,  0.4163,  0.5081,  0.6484,  0.8570,  1.0832,  1.2732,  1.3933,
- 1.5497,  1.7725,  1.9945,  2.2098,  2.3514,  2.5216,  2.7146,  2.8969,
- 0.1367,  0.2656,  0.4470,  0.6398,  0.8146,  1.0125,  1.2142,  1.3960,
- 1.5558,  1.7338,  1.9465,  2.1769,  2.4031,  2.5746,  2.7335,  2.9046,
- 0.0868,  0.1723,  0.2785,  0.5071,  0.7732,  1.0024,  1.1924,  1.4220,
- 1.6149,  1.8064,  1.9951,  2.1935,  2.3777,  2.5748,  2.7661,  2.9488,
- 0.1428,  0.2592,  0.3875,  0.5810,  0.7513,  0.9334,  1.1096,  1.3565,
- 1.5869,  1.7788,  1.9036,  2.0893,  2.3332,  2.5289,  2.7204,  2.9053,
- 0.2313,  0.4066,  0.4960,  0.5853,  0.7799,  0.9201,  1.1365,  1.3499,
- 1.5119,  1.7641,  1.9095,  2.0911,  2.2653,  2.4587,  2.7010,  2.8900,
- 0.1927,  0.3424,  0.4682,  0.6035,  0.7330,  0.8492,  1.0477,  1.3083,
- 1.5602,  1.6945,  1.7806,  2.0066,  2.2566,  2.4864,  2.7021,  2.9180,
- 0.0962,  0.1933,  0.3968,  0.6077,  0.8083,  1.0224,  1.2307,  1.4344,
- 1.6350,  1.8173,  2.0024,  2.1894,  2.3812,  2.5648,  2.7535,  2.9483,
- 0.1469,  0.2679,  0.4272,  0.6080,  0.7949,  0.9247,  1.0741,  1.2722,
- 1.5144,  1.7679,  2.0030,  2.1944,  2.3890,  2.5928,  2.8116,  2.9555,
- 0.1618,  0.3917,  0.6111,  0.7511,  0.8325,  1.0010,  1.2397,  1.4147,
- 1.5764,  1.7359,  1.9300,  2.1325,  2.3096,  2.5480,  2.7725,  2.9697,
- 0.1561,  0.2634,  0.4062,  0.6139,  0.8059,  0.9618,  1.0948,  1.3179,
- 1.5846,  1.7622,  1.9399,  2.1476,  2.3330,  2.5232,  2.7412,  2.9554,
- 0.1076,  0.2320,  0.3977,  0.5798,  0.7707,  0.9975,  1.1884,  1.3793,
- 1.6059,  1.8038,  1.9928,  2.1942,  2.3881,  2.5742,  2.7717,  2.9547,
- 0.1360,  0.2493,  0.3827,  0.5644,  0.7384,  0.9087,  1.0865,  1.2902,
- 1.5185,  1.7246,  1.9170,  2.1175,  2.3324,  2.5442,  2.7441,  2.9437,
- 0.1684,  0.2990,  0.4406,  0.5834,  0.7305,  0.9028,  1.0801,  1.2756,
- 1.4646,  1.6514,  1.8346,  2.0493,  2.2594,  2.4765,  2.6985,  2.9089,
- 0.1145,  0.2295,  0.3421,  0.5032,  0.7007,  0.9057,  1.0830,  1.2733,
- 1.4885,  1.6897,  1.8933,  2.1128,  2.3188,  2.5271,  2.7284,  2.9266,
- 0.1705,  0.3815,  0.6120,  0.7964,  0.9342,  1.0926,  1.2741,  1.4645,
- 1.6552,  1.8040,  1.9778,  2.1931,  2.3836,  2.5827,  2.7905,  2.9494,
- 0.1284,  0.2622,  0.4714,  0.6559,  0.8004,  1.0005,  1.1416,  1.3163,
- 1.5773,  1.8144,  1.9947,  2.2001,  2.3836,  2.5710,  2.7447,  2.9262,
- 0.1164,  0.2882,  0.5349,  0.7310,  0.8483,  0.9729,  1.1331,  1.3350,
- 1.5307,  1.7306,  1.9409,  2.1275,  2.3229,  2.5358,  2.7455,  2.9447,
- 0.1159,  0.2646,  0.4677,  0.6375,  0.7771,  0.9557,  1.1398,  1.3514,
- 1.5717,  1.7512,  1.9337,  2.1323,  2.3272,  2.5409,  2.7377,  2.9212,
- 0.1080,  0.2143,  0.3475,  0.5307,  0.7358,  0.9681,  1.1489,  1.3289,
- 1.5553,  1.7664,  1.9696,  2.1780,  2.3676,  2.5568,  2.7493,  2.9347,
- 0.1331,  0.2430,  0.3879,  0.5092,  0.6324,  0.8119,  1.0327,  1.2657,
- 1.4999,  1.7107,  1.9178,  2.1272,  2.3296,  2.5340,  2.7372,  2.9353,
- 0.1557,  0.2873,  0.4558,  0.6548,  0.8472,  1.0106,  1.1480,  1.3281,
- 1.5856,  1.7740,  1.9564,  2.1651,  2.3295,  2.5207,  2.7005,  2.9151,
- 0.1397,  0.2761,  0.4533,  0.6374,  0.7510,  0.8767,  1.0408,  1.2909,
- 1.5368,  1.7560,  1.9424,  2.1332,  2.3210,  2.5116,  2.6924,  2.8886,
- 0.0945,  0.1653,  0.3601,  0.6129,  0.8378,  1.0333,  1.2417,  1.4539,
- 1.6507,  1.8304,  2.0286,  2.2157,  2.3975,  2.5865,  2.7721,  2.9426,
- 0.1892,  0.3863,  0.4896,  0.5909,  0.7294,  0.9483,  1.1575,  1.3542,
- 1.4796,  1.6535,  1.9070,  2.1435,  2.3281,  2.4967,  2.7039,  2.9222,
- 0.1614,  0.3129,  0.5086,  0.7048,  0.8730,  1.0239,  1.1905,  1.3799,
- 1.5697,  1.7503,  1.9103,  2.1115,  2.3235,  2.5234,  2.6973,  2.8957,
- 0.1199,  0.2590,  0.4273,  0.5935,  0.7542,  0.9625,  1.1225,  1.2998,
- 1.5361,  1.7102,  1.9097,  2.1269,  2.3157,  2.5304,  2.7212,  2.9175,
- 0.1087,  0.2373,  0.4261,  0.6277,  0.8092,  0.9884,  1.1954,  1.4077,
- 1.6048,  1.7799,  1.9693,  2.1662,  2.3426,  2.5501,  2.7459,  2.9257,
- 0.1262,  0.2216,  0.3857,  0.5799,  0.7148,  0.8610,  1.0752,  1.3306,
- 1.5549,  1.7605,  1.9727,  2.1580,  2.3612,  2.5602,  2.7554,  2.9372,
- 0.1445,  0.2832,  0.4469,  0.6283,  0.7991,  0.9796,  1.1504,  1.3323,
- 1.5313,  1.7140,  1.8968,  2.0990,  2.2826,  2.4903,  2.7003,  2.9031,
- 0.1647,  0.4068,  0.5428,  0.6539,  0.7682,  0.8479,  0.9372,  1.1691,
- 1.4776,  1.7314,  1.9071,  2.0918,  2.2774,  2.5029,  2.7152,  2.9221,
- 0.1274,  0.3052,  0.5238,  0.7280,  0.9229,  1.1211,  1.3071,  1.4784,
- 1.6564,  1.8235,  2.0028,  2.1999,  2.3763,  2.5608,  2.7510,  2.9356,
- 0.1076,  0.2195,  0.4815,  0.6873,  0.8241,  0.9443,  1.1066,  1.3687,
- 1.6087,  1.8105,  1.9857,  2.1486,  2.3505,  2.5854,  2.7785,  2.9376,
- 0.1755,  0.3089,  0.4695,  0.6648,  0.8315,  1.0202,  1.1774,  1.3554,
- 1.5393,  1.7141,  1.9247,  2.1284,  2.2983,  2.4975,  2.7296,  2.9401,
- 0.1636,  0.3166,  0.4594,  0.6199,  0.8161,  0.9879,  1.1738,  1.3642,
- 1.5680,  1.7633,  1.9598,  2.1695,  2.3692,  2.5846,  2.7809,  2.9563,
- 0.1219,  0.2662,  0.4620,  0.6491,  0.8353,  1.0150,  1.2065,  1.3944,
- 1.5785,  1.7631,  1.9389,  2.1434,  2.3400,  2.5316,  2.7359,  2.9513,
- 0.1072,  0.2258,  0.3968,  0.5642,  0.7222,  0.9367,  1.1458,  1.3347,
- 1.5424,  1.7373,  1.9303,  2.1432,  2.3451,  2.5415,  2.7444,  2.9394,
- 0.1393,  0.2950,  0.4724,  0.6407,  0.8034,  1.0031,  1.1712,  1.3552,
- 1.5519,  1.7411,  1.9198,  2.1160,  2.3238,  2.5119,  2.7134,  2.9205,
- 0.1358,  0.2613,  0.4239,  0.5991,  0.7643,  0.9379,  1.1213,  1.3115,
- 1.5067,  1.7031,  1.8768,  2.0836,  2.3092,  2.5134,  2.7237,  2.9286,
- 0.1267,  0.2695,  0.4524,  0.6591,  0.8396,  1.0173,  1.2183,  1.4205,
- 1.6306,  1.8162,  2.0106,  2.2082,  2.3773,  2.5787,  2.7551,  2.9387,
- 0.1314,  0.2529,  0.3837,  0.5494,  0.7446,  0.9097,  1.0489,  1.2385,
- 1.4691,  1.7170,  1.9600,  2.1770,  2.3594,  2.5356,  2.7215,  2.9088,
- 0.1538,  0.2931,  0.4449,  0.6041,  0.7959,  0.9666,  1.1355,  1.3214,
- 1.5150,  1.7230,  1.9433,  2.1408,  2.3459,  2.5476,  2.7273,  2.9330,
- 0.1771,  0.2834,  0.4136,  0.5856,  0.7516,  0.9363,  1.0596,  1.2462,
- 1.4737,  1.6627,  1.8810,  2.1150,  2.3202,  2.5274,  2.7403,  2.9490,
- 0.1248,  0.2494,  0.4397,  0.6352,  0.8226,  1.0015,  1.1799,  1.3458,
- 1.5654,  1.8228,  2.0646,  2.2550,  2.4161,  2.5964,  2.7675,  2.9383,
- 0.0933,  0.1993,  0.3105,  0.4371,  0.6417,  0.8935,  1.1244,  1.3508,
- 1.5649,  1.7595,  1.9581,  2.1648,  2.3639,  2.5569,  2.7573,  2.9468,
- 0.1794,  0.3229,  0.4758,  0.6238,  0.7821,  0.9640,  1.1205,  1.3116,
- 1.5054,  1.6803,  1.8658,  2.0651,  2.2793,  2.4856,  2.6867,  2.9105,
- 0.1252,  0.2397,  0.3844,  0.5398,  0.7044,  0.8799,  1.0526,  1.2270,
- 1.4269,  1.6412,  1.8532,  2.0784,  2.2957,  2.5051,  2.7139,  2.9210,
- 0.1391,  0.3494,  0.5738,  0.8024,  1.0098,  1.2094,  1.3830,  1.5509,
- 1.7222,  1.8782,  2.0604,  2.2479,  2.4154,  2.5968,  2.7767,  2.9450,
- 0.1122,  0.2180,  0.4175,  0.6074,  0.7559,  0.9465,  1.1513,  1.3340,
- 1.5215,  1.7491,  1.9911,  2.1894,  2.3433,  2.5377,  2.7380,  2.9183,
- 0.1595,  0.3029,  0.4842,  0.6324,  0.7874,  0.9814,  1.1992,  1.3554,
- 1.5017,  1.7274,  1.9168,  2.0853,  2.2964,  2.5300,  2.7187,  2.9041,
- 0.1350,  0.2747,  0.4791,  0.6638,  0.8050,  0.9644,  1.1238,  1.2987,
- 1.4844,  1.6754,  1.8778,  2.0987,  2.3279,  2.5424,  2.7410,  2.9356,
- 0.0914,  0.1727,  0.3143,  0.5124,  0.7123,  0.9323,  1.1706,  1.3821,
- 1.5864,  1.7828,  1.9701,  2.1560,  2.3445,  2.5486,  2.7433,  2.9372,
- 0.1222,  0.2359,  0.3931,  0.5912,  0.7776,  0.9505,  1.1623,  1.3723,
- 1.5484,  1.7316,  1.9321,  2.1283,  2.3148,  2.5269,  2.7299,  2.9213,
- 0.2089,  0.3872,  0.5090,  0.6413,  0.7967,  1.0226,  1.1897,  1.3908,
- 1.5954,  1.7202,  1.8614,  2.1030,  2.2973,  2.5079,  2.7491,  2.8944,
- 0.1288,  0.2423,  0.4108,  0.6062,  0.7688,  0.9188,  1.0876,  1.2866,
- 1.4897,  1.6910,  1.9219,  2.1076,  2.2805,  2.5023,  2.7155,  2.9203,
- 0.0192,  0.0462,  0.0128,  0.0054, -0.0156, -0.0118, -0.0135,  0.0030,
--0.0120,  0.0031,  0.0240, -0.0451, -0.0439, -0.0432, -0.0527, -0.0207,
- 0.0253,  0.0084, -0.0305, -0.0144,  0.0046, -0.0378, -0.0467, -0.0102,
- 0.0280,  0.0540,  0.0151,  0.0437,  0.0141, -0.0257, -0.0058,  0.0073,
- 0.0107,  0.0054,  0.0371, -0.0105,  0.0165, -0.0143,  0.0148,  0.0382,
--0.0054, -0.0284,  0.0001, -0.0218,  0.0258,  0.0517,  0.0157, -0.0032,
--0.0190,  0.0343,  0.0576,  0.0346,  0.0392, -0.0158, -0.0323, -0.0578,
--0.0617, -0.0242, -0.0144,  0.0188,  0.0249,  0.0021, -0.0422, -0.0420,
- 0.0750,  0.0762,  0.0325, -0.0066,  0.0332,  0.0376,  0.0388,  0.0630,
- 0.0525,  0.0196,  0.0051, -0.0484, -0.0322,  0.0059,  0.0132,  0.0079,
- 0.0237,  0.0774,  0.0697,  0.0184, -0.0321, -0.0327,  0.0274,  0.0284,
- 0.0057,  0.0289,  0.0478,  0.0142, -0.0053,  0.0114,  0.0292, -0.0032,
--0.0111, -0.0389,  0.0282,  0.0613,  0.0200, -0.0006,  0.0111,  0.0048,
- 0.0273,  0.0017, -0.0369,  0.0655,  0.0758,  0.0555,  0.0238, -0.0024,
--0.0100, -0.0419, -0.0696, -0.0158, -0.0479, -0.0744, -0.0356, -0.0245,
--0.0400, -0.0112,  0.0134,  0.0001, -0.0422, -0.0514, -0.0081,  0.0083,
--0.0151,  0.0323, -0.0001, -0.0444, -0.0406, -0.0214, -0.0050, -0.0235,
--0.0205, -0.0264, -0.0324,  0.0334,  0.0392,  0.0265,  0.0289,  0.0180,
- 0.0493,  0.0227,  0.0194,  0.0365,  0.0544,  0.0674,  0.0559,  0.0732,
- 0.0911,  0.0942,  0.0735,  0.0174, -0.0113, -0.0553, -0.0665, -0.0227,
--0.0259, -0.0266, -0.0239, -0.0379,  0.0329,  0.0173, -0.0210, -0.0114,
--0.0063,  0.0060, -0.0089, -0.0198, -0.0282, -0.0080, -0.0179, -0.0290,
- 0.0046, -0.0126, -0.0066,  0.0350,  0.0532,  0.0235,  0.0198,  0.0212,
- 0.0449,  0.0681,  0.0677, -0.0049,  0.0086,  0.0120,  0.0356,  0.0454,
- 0.0592,  0.0449, -0.0271, -0.0510, -0.0110,  0.0234,  0.0203,  0.0243,
- 0.0242,  0.0133,  0.0098,  0.0040,  0.0024, -0.0005, -0.0075, -0.0126,
--0.0393, -0.0052,  0.0165,  0.0016, -0.0193,  0.0239,  0.0336,  0.0029,
--0.0586, -0.0539, -0.0094, -0.0664, -0.0898, -0.0540, -0.0066,  0.0134,
--0.0074,  0.0067, -0.0521, -0.0431,  0.0104,  0.0690,  0.0663,  0.0197,
--0.0017, -0.0518, -0.0597, -0.0171, -0.0054, -0.0140, -0.0080,  0.0172,
--0.0362, -0.0713, -0.0310,  0.0096,  0.0243,  0.0381, -0.0062, -0.0392,
--0.0281,  0.0386,  0.0461,  0.0069,  0.0384,  0.0080, -0.0141,  0.0171,
- 0.3368,  0.3128,  0.3304,  0.3392,  0.3185,  0.3037,  0.2789,  0.2692,
- 0.2779,  0.2796,  0.2891,  0.2643,  0.2647,  0.2593,  0.2927,  0.3283,
- 0.4978,  0.4988,  0.4969,  0.4997,  0.4957,  0.4985,  0.4970,  0.4978,
- 0.4938,  0.4951,  0.4994,  0.4971,  0.4981,  0.4983,  0.4967,  0.4789
-},
-
-.lsp44 = {
- 0.0927,  0.2291,  0.4059,  0.5779,  0.7288,  0.8821,  1.0377,  1.1915,
- 1.3433,  1.4931,  1.6475,  1.7989,  1.9381,  2.0858,  2.2321,  2.3765,
- 2.5187,  2.6530,  2.7895,  2.9354,  0.0944,  0.1974,  0.3046,  0.4714,
- 0.6116,  0.7829,  0.9027,  1.0375,  1.1869,  1.3488,  1.5036,  1.6781,
- 1.8276,  1.9983,  2.1449,  2.3089,  2.4534,  2.6113,  2.7553,  2.9062,
- 0.1168,  0.2843,  0.4907,  0.6706,  0.8100,  0.9417,  1.0753,  1.2014,
- 1.3151,  1.4496,  1.5832,  1.7379,  1.8642,  2.0230,  2.1681,  2.3250,
- 2.4676,  2.6242,  2.7602,  2.9066,  0.1353,  0.2335,  0.3370,  0.4380,
- 0.5819,  0.7353,  0.8671,  1.0160,  1.1435,  1.2977,  1.4860,  1.6739,
- 1.8412,  2.0028,  2.1537,  2.3124,  2.4741,  2.6272,  2.7862,  2.9536,
- 0.1003,  0.2226,  0.3584,  0.4971,  0.6291,  0.7710,  0.9157,  1.0669,
- 1.2143,  1.3624,  1.5104,  1.6681,  1.8164,  1.9823,  2.1394,  2.3082,
- 2.4677,  2.6306,  2.7909,  2.9382,  0.1056,  0.2027,  0.2956,  0.4005,
- 0.5215,  0.6708,  0.8545,  1.0557,  1.2344,  1.4023,  1.5676,  1.7278,
- 1.8808,  2.0381,  2.1846,  2.3376,  2.4887,  2.6377,  2.7878,  2.9504,
- 0.1015,  0.2462,  0.4122,  0.5783,  0.7233,  0.8833,  1.0377,  1.1903,
- 1.3341,  1.4727,  1.6138,  1.7582,  1.8912,  2.0370,  2.1701,  2.3125,
- 2.4500,  2.6006,  2.7507,  2.9166,  0.1787,  0.2418,  0.3265,  0.5379,
- 0.6584,  0.7681,  0.9545,  1.1050,  1.2125,  1.3528,  1.4763,  1.6705,
- 1.8136,  1.9594,  2.0936,  2.2724,  2.4394,  2.5919,  2.7037,  2.8747,
- 0.0859,  0.1600,  0.2980,  0.4933,  0.6696,  0.8285,  0.9958,  1.1545,
- 1.3107,  1.4591,  1.6127,  1.7652,  1.9143,  2.0680,  2.2171,  2.3643,
- 2.5141,  2.6611,  2.8143,  2.9691,  0.0910,  0.2110,  0.3364,  0.4718,
- 0.5856,  0.7298,  0.8910,  1.0514,  1.1988,  1.3572,  1.5178,  1.6861,
- 1.8399,  2.0099,  2.1639,  2.3225,  2.4774,  2.6321,  2.7863,  2.9412,
- 0.1904,  0.2874,  0.3681,  0.4981,  0.6248,  0.7880,  0.9121,  1.0750,
- 1.2185,  1.3809,  1.5296,  1.7007,  1.8592,  2.0470,  2.1913,  2.3250,
- 2.4519,  2.5984,  2.7408,  2.9023,  0.0917,  0.2067,  0.3246,  0.4961,
- 0.6310,  0.8024,  0.9438,  1.1008,  1.2362,  1.3892,  1.5407,  1.7033,
- 1.8427,  2.0061,  2.1498,  2.3117,  2.4550,  2.6053,  2.7462,  2.9029,
- 0.0989,  0.2193,  0.3756,  0.5410,  0.6929,  0.8368,  0.9801,  1.1250,
- 1.2677,  1.4184,  1.5677,  1.7292,  1.8770,  2.0311,  2.1803,  2.3306,
- 2.4836,  2.6339,  2.7943,  2.9549,  0.0861,  0.1943,  0.3057,  0.4867,
- 0.6194,  0.7592,  0.9184,  1.1052,  1.2486,  1.4064,  1.5609,  1.7273,
- 1.8703,  2.0291,  2.1686,  2.3225,  2.4628,  2.6115,  2.7471,  2.9005,
- 0.0932,  0.2110,  0.3737,  0.5479,  0.7120,  0.8570,  0.9975,  1.1364,
- 1.2772,  1.4220,  1.5612,  1.7089,  1.8410,  1.9827,  2.1263,  2.2859,
- 2.4459,  2.6172,  2.7788,  2.9395,  0.1193,  0.2341,  0.3523,  0.5029,
- 0.6437,  0.7803,  0.9367,  1.1007,  1.2392,  1.3869,  1.5425,  1.7168,
- 1.8709,  2.0248,  2.1584,  2.2949,  2.4308,  2.5823,  2.7235,  2.9034,
- 0.0834,  0.1988,  0.3557,  0.5261,  0.6767,  0.8427,  1.0029,  1.1683,
- 1.3138,  1.4527,  1.6046,  1.7583,  1.9011,  2.0517,  2.1928,  2.3397,
- 2.4839,  2.6291,  2.7771,  2.9329,  0.0938,  0.1967,  0.3213,  0.4675,
- 0.6068,  0.7664,  0.9418,  1.1120,  1.2535,  1.3932,  1.5243,  1.6801,
- 1.8346,  1.9931,  2.1376,  2.3035,  2.4636,  2.6244,  2.7829,  2.9371,
- 0.1017,  0.2552,  0.4327,  0.6017,  0.7467,  0.8797,  1.0097,  1.1442,
- 1.2628,  1.4049,  1.5541,  1.7090,  1.8461,  1.9982,  2.1486,  2.3029,
- 2.4513,  2.6075,  2.7594,  2.9209,  0.1031,  0.2295,  0.3747,  0.5122,
- 0.6596,  0.7935,  0.9345,  1.1050,  1.2384,  1.3543,  1.4739,  1.6136,
- 1.7447,  1.8914,  2.0434,  2.1916,  2.3557,  2.5396,  2.7419,  2.9401,
- 0.1007,  0.2374,  0.3715,  0.5173,  0.6465,  0.8069,  0.9553,  1.1145,
- 1.2594,  1.4143,  1.5617,  1.7166,  1.8457,  2.0012,  2.1462,  2.2864,
- 2.4258,  2.5910,  2.7372,  2.9018,  0.0808,  0.1726,  0.2849,  0.4592,
- 0.6118,  0.7853,  0.9588,  1.1256,  1.2751,  1.4392,  1.5898,  1.7514,
- 1.8977,  2.0554,  2.1937,  2.3430,  2.4831,  2.6249,  2.7601,  2.9155,
- 0.1669,  0.2574,  0.3694,  0.5569,  0.6773,  0.8061,  1.0160,  1.1667,
- 1.2791,  1.4041,  1.5452,  1.7207,  1.8524,  2.0038,  2.1414,  2.3338,
- 2.4747,  2.6157,  2.7303,  2.8848,  0.1598,  0.2521,  0.3416,  0.5149,
- 0.6703,  0.7941,  0.9408,  1.1164,  1.2017,  1.3293,  1.4908,  1.6783,
- 1.8438,  1.9927,  2.1149,  2.2698,  2.4420,  2.6193,  2.7583,  2.9103,
- 0.0902,  0.1978,  0.3265,  0.4578,  0.5878,  0.7439,  0.9110,  1.0906,
- 1.2556,  1.4125,  1.5688,  1.7295,  1.8829,  2.0472,  2.2058,  2.3537,
- 2.5075,  2.6548,  2.8058,  2.9538,  0.0818,  0.1695,  0.2794,  0.4470,
- 0.6069,  0.7641,  0.9313,  1.0946,  1.2411,  1.4072,  1.5640,  1.7186,
- 1.8651,  2.0254,  2.1726,  2.3286,  2.4784,  2.6287,  2.7750,  2.9339,
- 0.1980,  0.3134,  0.4099,  0.4975,  0.6491,  0.8376,  0.9441,  1.0298,
- 1.1795,  1.3866,  1.5784,  1.7209,  1.8137,  1.9271,  2.0863,  2.2930,
- 2.4696,  2.6184,  2.7587,  2.9251,  0.1338,  0.2341,  0.3566,  0.4797,
- 0.6129,  0.7580,  0.9093,  1.0491,  1.1911,  1.3313,  1.4841,  1.6503,
- 1.8035,  1.9685,  2.1128,  2.2694,  2.4093,  2.5728,  2.7206,  2.8994,
- 0.0937,  0.2034,  0.3447,  0.5032,  0.6370,  0.7993,  0.9674,  1.1323,
- 1.2830,  1.4199,  1.5492,  1.7010,  1.8513,  2.0087,  2.1550,  2.3115,
- 2.4643,  2.6237,  2.7812,  2.9392,  0.1085,  0.2152,  0.3126,  0.4569,
- 0.5718,  0.7213,  0.8837,  1.0604,  1.2053,  1.3755,  1.5397,  1.7001,
- 1.8409,  2.0039,  2.1498,  2.3080,  2.4535,  2.6063,  2.7505,  2.9110,
- 0.0562,  0.2066,  0.4034,  0.5490,  0.6682,  0.7924,  0.9495,  1.0800,
- 1.1869,  1.3156,  1.4834,  1.6619,  1.8404,  2.0199,  2.1509,  2.2755,
- 2.4072,  2.5580,  2.6993,  2.8913,  0.0939,  0.2303,  0.3742,  0.5260,
- 0.6662,  0.8294,  0.9769,  1.1315,  1.2792,  1.4153,  1.5436,  1.6701,
- 1.8215,  1.9920,  2.1310,  2.3005,  2.4534,  2.5786,  2.7204,  2.9068,
- 0.1005,  0.2442,  0.3898,  0.5398,  0.6958,  0.8474,  1.0008,  1.1556,
- 1.3020,  1.4456,  1.5954,  1.7470,  1.8922,  2.0500,  2.2019,  2.3492,
- 2.4963,  2.6412,  2.7890,  2.9423,  0.1022,  0.2031,  0.3213,  0.4402,
- 0.5637,  0.7117,  0.8673,  1.0242,  1.1727,  1.3206,  1.4846,  1.6465,
- 1.8015,  1.9655,  2.1233,  2.2873,  2.4464,  2.6074,  2.7685,  2.9409,
- 0.1985,  0.3497,  0.4622,  0.5982,  0.7489,  0.8752,  0.9925,  1.1679,
- 1.3288,  1.4606,  1.5820,  1.7492,  1.8922,  2.0511,  2.1780,  2.3373,
- 2.4760,  2.6233,  2.7466,  2.8978,  0.1284,  0.2433,  0.3630,  0.4852,
- 0.6117,  0.7460,  0.8904,  1.0360,  1.1738,  1.3142,  1.4696,  1.6185,
- 1.7719,  1.9318,  2.0961,  2.2697,  2.4408,  2.6046,  2.7681,  2.9451,
- 0.1042,  0.2286,  0.3598,  0.5064,  0.6438,  0.7899,  0.9350,  1.0891,
- 1.2323,  1.3807,  1.5225,  1.6747,  1.8153,  1.9669,  2.1145,  2.2832,
- 2.4430,  2.6085,  2.7748,  2.9346,  0.0780,  0.1724,  0.2440,  0.3489,
- 0.5280,  0.7426,  0.9272,  1.0914,  1.2562,  1.4188,  1.5804,  1.7376,
- 1.8909,  2.0473,  2.1946,  2.3457,  2.4950,  2.6424,  2.7926,  2.9549,
- 0.1103,  0.2608,  0.4087,  0.5538,  0.6923,  0.8418,  0.9940,  1.1507,
- 1.2919,  1.4406,  1.5802,  1.7262,  1.8638,  2.0085,  2.1572,  2.2975,
- 2.4329,  2.5866,  2.7380,  2.9107,  0.1297,  0.2532,  0.4003,  0.5329,
- 0.6733,  0.7950,  0.9557,  1.0859,  1.2235,  1.3538,  1.5037,  1.6389,
- 1.7964,  1.9285,  2.0898,  2.2541,  2.4231,  2.5711,  2.6875,  2.8947,
- 0.0871,  0.1968,  0.3425,  0.4949,  0.6424,  0.7959,  0.9534,  1.1132,
- 1.2656,  1.4229,  1.5785,  1.7271,  1.8729,  2.0355,  2.1998,  2.3562,
- 2.5151,  2.6663,  2.8145,  2.9534,  0.1038,  0.2204,  0.3248,  0.4566,
- 0.5947,  0.7443,  0.8811,  1.0379,  1.2031,  1.3772,  1.5430,  1.7092,
- 1.8625,  2.0322,  2.1904,  2.3417,  2.4960,  2.6458,  2.7979,  2.9485,
- 0.1329,  0.2763,  0.3943,  0.5147,  0.6512,  0.8071,  0.9410,  1.0879,
- 1.2298,  1.3850,  1.5282,  1.6674,  1.8137,  1.9993,  2.1344,  2.2749,
- 2.4257,  2.5863,  2.7410,  2.9184,  0.1052,  0.2142,  0.3584,  0.5033,
- 0.6387,  0.7804,  0.9320,  1.0780,  1.2172,  1.3764,  1.5421,  1.6887,
- 1.8246,  1.9833,  2.1245,  2.2797,  2.4237,  2.5779,  2.7257,  2.9097,
- 0.1092,  0.2676,  0.4071,  0.5355,  0.6661,  0.8142,  0.9621,  1.1173,
- 1.2628,  1.4185,  1.5696,  1.7220,  1.8595,  2.0178,  2.1720,  2.3221,
- 2.4718,  2.6259,  2.7775,  2.9334,  0.0929,  0.2017,  0.3073,  0.4570,
- 0.5775,  0.7635,  0.9299,  1.0832,  1.2334,  1.3935,  1.5420,  1.7112,
- 1.8601,  2.0309,  2.1735,  2.3230,  2.4543,  2.6034,  2.7418,  2.8988,
- 0.0775,  0.2005,  0.3490,  0.5200,  0.6747,  0.8383,  0.9885,  1.1738,
- 1.3141,  1.4236,  1.5892,  1.7402,  1.8474,  2.0210,  2.1593,  2.2730,
- 2.4235,  2.5604,  2.7128,  2.9005,  0.1104,  0.2292,  0.3353,  0.4732,
- 0.6152,  0.7675,  0.9164,  1.0907,  1.2594,  1.4064,  1.5218,  1.6426,
- 1.8018,  1.9937,  2.1362,  2.2961,  2.4523,  2.6083,  2.7613,  2.9202,
- 0.0826,  0.2000,  0.3384,  0.5144,  0.6694,  0.8377,  0.9870,  1.1461,
- 1.2950,  1.4495,  1.5872,  1.7387,  1.8793,  2.0329,  2.1723,  2.3114,
- 2.4415,  2.5908,  2.7354,  2.9028,  0.1063,  0.2268,  0.3442,  0.4735,
- 0.6116,  0.7507,  0.9028,  1.0768,  1.2426,  1.4052,  1.5566,  1.7015,
- 1.8243,  1.9742,  2.1276,  2.2824,  2.4262,  2.5953,  2.7627,  2.9290,
- 0.1150,  0.2814,  0.4543,  0.6095,  0.7373,  0.8592,  0.9908,  1.1108,
- 1.2339,  1.3590,  1.4864,  1.6168,  1.7392,  1.8752,  2.0212,  2.1688,
- 2.3128,  2.4869,  2.7019,  2.9239,  0.0948,  0.2074,  0.3433,  0.4943,
- 0.6346,  0.7645,  0.8809,  1.0610,  1.2307,  1.3487,  1.4655,  1.6186,
- 1.7534,  1.8859,  2.0486,  2.2200,  2.3835,  2.5581,  2.7565,  2.9502,
- 0.1062,  0.2239,  0.3683,  0.5197,  0.6704,  0.8184,  0.9642,  1.1127,
- 1.2556,  1.3976,  1.5405,  1.6940,  1.8375,  1.9888,  2.1377,  2.2980,
- 2.4555,  2.6184,  2.7849,  2.9452,  0.0888,  0.2005,  0.2847,  0.4322,
- 0.5763,  0.7577,  0.9262,  1.1095,  1.2719,  1.4331,  1.5843,  1.7452,
- 1.8845,  2.0385,  2.1805,  2.3345,  2.4750,  2.6217,  2.7555,  2.9013,
- 0.1713,  0.2617,  0.3868,  0.5859,  0.7073,  0.8535,  1.0593,  1.1778,
- 1.3109,  1.4508,  1.5910,  1.7463,  1.8911,  2.0651,  2.2035,  2.3355,
- 2.4947,  2.6440,  2.7424,  2.8943,  0.1346,  0.2549,  0.4089,  0.5488,
- 0.6949,  0.8394,  0.9810,  1.1145,  1.2528,  1.4044,  1.5423,  1.6872,
- 1.8274,  1.9726,  2.1403,  2.2809,  2.4128,  2.5564,  2.6887,  2.8895,
- 0.0776,  0.1621,  0.2553,  0.4191,  0.5988,  0.7921,  0.9651,  1.1350,
- 1.2930,  1.4475,  1.6011,  1.7585,  1.9068,  2.0638,  2.2102,  2.3594,
- 2.5096,  2.6581,  2.8099,  2.9654,  0.0864,  0.1778,  0.2854,  0.4235,
- 0.5568,  0.7220,  0.8963,  1.0609,  1.2217,  1.3830,  1.5422,  1.7018,
- 1.8551,  2.0206,  2.1783,  2.3328,  2.4869,  2.6366,  2.7923,  2.9539,
- 0.1144,  0.2576,  0.4186,  0.5594,  0.6875,  0.8221,  0.9598,  1.0944,
- 1.2273,  1.3713,  1.5152,  1.6628,  1.8070,  1.9525,  2.0965,  2.2535,
- 2.4132,  2.5725,  2.7250,  2.9150,  0.1079,  0.2221,  0.3334,  0.4845,
- 0.6083,  0.7516,  0.9018,  1.0594,  1.2060,  1.3673,  1.5212,  1.6880,
- 1.8208,  1.9831,  2.1269,  2.2909,  2.4366,  2.6027,  2.7339,  2.8924,
- 0.0994,  0.2233,  0.3634,  0.5145,  0.6568,  0.8131,  0.9746,  1.1296,
- 1.2666,  1.4116,  1.5748,  1.7264,  1.8649,  2.0217,  2.1716,  2.3293,
- 2.4900,  2.6455,  2.7818,  2.9362,  0.1120,  0.2079,  0.3128,  0.4124,
- 0.5291,  0.6816,  0.8478,  1.0150,  1.1772,  1.3456,  1.5208,  1.6882,
- 1.8458,  2.0078,  2.1627,  2.3198,  2.4733,  2.6251,  2.7796,  2.9489,
- 0.0853,  0.2030,  0.3669,  0.5326,  0.6678,  0.8086,  0.9526,  1.1142,
- 1.2551,  1.4158,  1.5694,  1.7073,  1.8431,  1.9686,  2.1153,  2.2376,
- 2.3686,  2.5591,  2.7320,  2.9104,  0.0905,  0.2166,  0.3539,  0.5201,
- 0.6700,  0.8346,  0.9883,  1.1457,  1.2714,  1.3845,  1.5172,  1.6688,
- 1.8008,  1.9535,  2.1019,  2.2708,  2.4135,  2.5974,  2.7486,  2.9033,
- 0.0084,  0.0374,  0.0164, -0.0153,  0.0288,  0.0107, -0.0255, -0.0242,
- 0.0000, -0.0055, -0.0081, -0.0075, -0.0022, -0.0052, -0.0069, -0.0017,
- 0.0003,  0.0091,  0.0028, -0.0027,  0.0085,  0.0043, -0.0235, -0.0411,
- 0.0202,  0.0359,  0.0376,  0.0321,  0.0306, -0.0358, -0.0276, -0.0090,
- 0.0032,  0.0048,  0.0309,  0.0332,  0.0284,  0.0237,  0.0051, -0.0101,
--0.0233, -0.0428, -0.0585, -0.0387,  0.0039,  0.0081,  0.0029, -0.0017,
--0.0006, -0.0068,  0.0044,  0.0182,  0.0376,  0.0387, -0.0334, -0.0269,
--0.0182, -0.0069, -0.0026,  0.0035, -0.0049, -0.0212, -0.0408, -0.0245,
- 0.0186,  0.0189,  0.0153,  0.0120,  0.0157,  0.0055, -0.0046,  0.0179,
- 0.0284, -0.0032, -0.0261, -0.0205, -0.0039,  0.0174,  0.0299,  0.0207,
- 0.0012, -0.0056,  0.0010,  0.0141, -0.0119,  0.0190,  0.0315,  0.0033,
--0.0128,  0.0300,  0.0328,  0.0308,  0.0353,  0.0266,  0.0066, -0.0328,
--0.0273,  0.0054,  0.0145,  0.0175,  0.0015, -0.0171,  0.0062, -0.0164,
- 0.0045, -0.0071,  0.0025,  0.0278,  0.0283,  0.0117, -0.0026, -0.0285,
--0.0408, -0.0366, -0.0059, -0.0208, -0.0354, -0.0334, -0.0263, -0.0064,
- 0.0072, -0.0006, -0.0235, -0.0037, -0.0307, -0.0294, -0.0163, -0.0197,
--0.0235,  0.0192,  0.0013, -0.0219, -0.0123, -0.0004, -0.0081, -0.0096,
--0.0123, -0.0101,  0.0021,  0.0151,  0.0106,  0.0151,  0.0292,  0.0033,
- 0.0283,  0.0124,  0.0058, -0.0017, -0.0038,  0.0152,  0.0141,  0.0132,
- 0.0178,  0.0157,  0.0073,  0.0176,  0.0141,  0.0097, -0.0092, -0.0163,
--0.0230, -0.0134, -0.0099, -0.0147,  0.0040, -0.0183, -0.0175, -0.0080,
--0.0083, -0.0290, -0.0417, -0.0398, -0.0269, -0.0199, -0.0143, -0.0053,
--0.0099, -0.0054, -0.0199, -0.0219, -0.0170,  0.0107,  0.0194,  0.0035,
- 0.0437,  0.0406,  0.0215,  0.0120,  0.0053, -0.0028,  0.0238,  0.0337,
- 0.0217,  0.0011,  0.0227,  0.0244,  0.0327,  0.0378,  0.0437,  0.0356,
--0.0033,  0.0113,  0.0407,  0.0334, -0.0125, -0.0003, -0.0141, -0.0273,
--0.0137, -0.0079, -0.0145, -0.0071,  0.0114,  0.0181,  0.0150,  0.0085,
--0.0077, -0.0038, -0.0219, -0.0263, -0.0187, -0.0233,  0.0133,  0.0265,
--0.0156, -0.0091, -0.0110, -0.0016,  0.0143,  0.0177,  0.0240,  0.0082,
--0.0143, -0.0257, -0.0014,  0.0002,  0.0082,  0.0180,  0.0325,  0.0340,
--0.0153, -0.0389, -0.0240,  0.0082,  0.0140,  0.0046, -0.0138, -0.0378,
--0.0366,  0.0297,  0.0252,  0.0078,  0.0063,  0.0006,  0.0044,  0.0074,
- 0.0094,  0.0113,  0.0105,  0.0137,  0.0438,  0.0262, -0.0078, -0.0185,
--0.0215, -0.0407, -0.0435, -0.0208, -0.0004, -0.0144, -0.0205, -0.0248,
--0.0159, -0.0069, -0.0153,  0.0132,  0.0355,  0.0298,  0.0120,  0.0072,
- 0.0236,  0.0526,  0.0479,  0.0233, -0.0133, -0.0283, -0.0468, -0.0549,
--0.0370,  0.0032,  0.0056,  0.0023,  0.0050,  0.0024,  0.0279,  0.0116,
--0.0045, -0.0012,  0.0107,  0.0190,  0.0253,  0.0191,  0.0043,  0.0193,
--0.0348, -0.0246,  0.0123,  0.0210,  0.0135, -0.0096, -0.0109, -0.0076,
--0.0156, -0.0290,  0.0160,  0.0194,  0.0219,  0.0259,  0.0250,  0.0195,
- 0.4948,  0.4961,  0.4940,  0.4878,  0.4849,  0.4727,  0.4571,  0.4551,
- 0.4534,  0.4468,  0.4412,  0.4354,  0.4298,  0.4272,  0.4498,  0.4506,
- 0.4560,  0.4592,  0.4758,  0.4941,  0.2476,  0.1771,  0.1974,  0.1881,
- 0.1667,  0.1826,  0.2067,  0.2031,  0.1734,  0.1534,  0.1415,  0.1761,
- 0.1897,  0.1772,  0.1651,  0.1247,  0.1041,  0.1231,  0.1809,  0.2234
-    },
-};
-
-static const uint8_t tab7[][35] = {
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,
-      0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-      0, 0, 0 },
-    { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0 },
-    { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,
-      0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-      0, 0, 0 },
-    { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0 },
-    { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0 },
-    { 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0,
-      0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0,
-      1, 0, 1 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0 }
-};
-
-static const uint8_t tab8[][5] = {
-    { 0, 0, 0, 1, 1 },
-    { 0, 1, 0, 0, 1 },
-    { 1, 1, 0, 0, 0 },
-    { 1, 0, 0, 1, 0 },
-    { 0, 0, 0, 1, 1 },
-    { 0, 1, 0, 0, 1 },
-    { 1, 1, 0, 0, 0 },
-    { 1, 0, 0, 1, 0 },
-    { 0, 0, 0, 1, 1 },
-    { 0, 1, 0, 0, 1 },
-    { 1, 1, 0, 0, 0 },
-    { 0, 0, 0, 0, 0 },
-    { 0, 1, 0, 1, 0 }
-};
-
-static const uint8_t tab9[][45] = {
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1,
-      1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
-      0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-static const uint8_t tab10[][25] = {
-    { 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0,
-      0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0 },
-    { 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0,
-      0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 },
-    { 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
-      0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0 },
-    { 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
-      0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
-    { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
-      0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 },
-    { 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1,
-      0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1 },
-    { 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1,
-      0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
-    { 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0,
-      0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1 }
-};
-
-static const uint8_t tab11[][55] = {
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, },
-    { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
-    { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, },
-    { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
-    { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
-    { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, }
-};
-
-static const uint8_t tab12[][15] = {
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0 },
-    { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-    { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0 },
-    { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-    { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0 },
-    { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1 },
-};
-
-static const struct {
-    int size;
-    const uint8_t *tab;
-} tabs[] = {
-    {  0, NULL         },
-    {  5, &tab8[0][0]  }, {  5, &tab8[0][0]  }, { 15, &tab12[0][0] },
-    {  5, &tab8[0][0]  }, { 25, &tab10[0][0] }, { 15, &tab12[0][0] },
-    { 35, &tab7[0][0]  }, {  5, &tab8[0][0]  }, { 45, &tab9[0][0]  },
-    { 25, &tab10[0][0] }, { 55, &tab11[0][0] }, { 15, &tab12[0][0] }
-};
-
-#endif /* AVCODEC_TWINVQ_DATA_H */
diff --git a/deps/libav/libavcodec/twinvqdec.c b/deps/libav/libavcodec/twinvqdec.c
deleted file mode 100644
index 65028a6..0000000
--- a/deps/libav/libavcodec/twinvqdec.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * TwinVQ decoder
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <math.h>
-#include <stdint.h>
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "twinvq.h"
-#include "twinvq_data.h"
-
-static const TwinVQModeTab mode_08_08 = {
-    {
-        { 8, bark_tab_s08_64,  10, tab.fcb08s, 1, 5, tab.cb0808s0, tab.cb0808s1, 18 },
-        { 2, bark_tab_m08_256, 20, tab.fcb08m, 2, 5, tab.cb0808m0, tab.cb0808m1, 16 },
-        { 1, bark_tab_l08_512, 30, tab.fcb08l, 3, 6, tab.cb0808l0, tab.cb0808l1, 17 }
-    },
-    512, 12, tab.lsp08, 1, 5, 3, 3, tab.shape08, 8, 28, 20, 6, 40
-};
-
-static const TwinVQModeTab mode_11_08 = {
-    {
-        { 8, bark_tab_s11_64,  10, tab.fcb11s, 1, 5, tab.cb1108s0, tab.cb1108s1, 29 },
-        { 2, bark_tab_m11_256, 20, tab.fcb11m, 2, 5, tab.cb1108m0, tab.cb1108m1, 24 },
-        { 1, bark_tab_l11_512, 30, tab.fcb11l, 3, 6, tab.cb1108l0, tab.cb1108l1, 27 }
-    },
-    512, 16, tab.lsp11, 1, 6, 4, 3, tab.shape11, 9, 36, 30, 7, 90
-};
-
-static const TwinVQModeTab mode_11_10 = {
-    {
-        { 8, bark_tab_s11_64,  10, tab.fcb11s, 1, 5, tab.cb1110s0, tab.cb1110s1, 21 },
-        { 2, bark_tab_m11_256, 20, tab.fcb11m, 2, 5, tab.cb1110m0, tab.cb1110m1, 18 },
-        { 1, bark_tab_l11_512, 30, tab.fcb11l, 3, 6, tab.cb1110l0, tab.cb1110l1, 20 }
-    },
-    512, 16, tab.lsp11, 1, 6, 4, 3, tab.shape11, 9, 36, 30, 7, 90
-};
-
-static const TwinVQModeTab mode_16_16 = {
-    {
-        { 8, bark_tab_s16_128,  10, tab.fcb16s, 1, 5, tab.cb1616s0, tab.cb1616s1, 16 },
-        { 2, bark_tab_m16_512,  20, tab.fcb16m, 2, 5, tab.cb1616m0, tab.cb1616m1, 15 },
-        { 1, bark_tab_l16_1024, 30, tab.fcb16l, 3, 6, tab.cb1616l0, tab.cb1616l1, 16 }
-    },
-    1024, 16, tab.lsp16, 1, 6, 4, 3, tab.shape16, 9, 56, 60, 7, 180
-};
-
-static const TwinVQModeTab mode_22_20 = {
-    {
-        { 8, bark_tab_s22_128,  10, tab.fcb22s_1, 1, 6, tab.cb2220s0, tab.cb2220s1, 18 },
-        { 2, bark_tab_m22_512,  20, tab.fcb22m_1, 2, 6, tab.cb2220m0, tab.cb2220m1, 17 },
-        { 1, bark_tab_l22_1024, 32, tab.fcb22l_1, 4, 6, tab.cb2220l0, tab.cb2220l1, 18 }
-    },
-    1024, 16, tab.lsp22_1, 1, 6, 4, 3, tab.shape22_1, 9, 56, 36, 7, 144
-};
-
-static const TwinVQModeTab mode_22_24 = {
-    {
-        { 8, bark_tab_s22_128,  10, tab.fcb22s_1, 1, 6, tab.cb2224s0, tab.cb2224s1, 15 },
-        { 2, bark_tab_m22_512,  20, tab.fcb22m_1, 2, 6, tab.cb2224m0, tab.cb2224m1, 14 },
-        { 1, bark_tab_l22_1024, 32, tab.fcb22l_1, 4, 6, tab.cb2224l0, tab.cb2224l1, 15 }
-    },
-    1024, 16, tab.lsp22_1, 1, 6, 4, 3, tab.shape22_1, 9, 56, 36, 7, 144
-};
-
-static const TwinVQModeTab mode_22_32 = {
-    {
-        { 4, bark_tab_s22_128, 10, tab.fcb22s_2, 1, 6, tab.cb2232s0, tab.cb2232s1, 11 },
-        { 2, bark_tab_m22_256, 20, tab.fcb22m_2, 2, 6, tab.cb2232m0, tab.cb2232m1, 11 },
-        { 1, bark_tab_l22_512, 32, tab.fcb22l_2, 4, 6, tab.cb2232l0, tab.cb2232l1, 12 }
-    },
-    512, 16, tab.lsp22_2, 1, 6, 4, 4, tab.shape22_2, 9, 56, 36, 7, 72
-};
-
-static const TwinVQModeTab mode_44_40 = {
-    {
-        { 16, bark_tab_s44_128,  10, tab.fcb44s, 1, 6, tab.cb4440s0, tab.cb4440s1, 18 },
-        { 4,  bark_tab_m44_512,  20, tab.fcb44m, 2, 6, tab.cb4440m0, tab.cb4440m1, 17 },
-        { 1,  bark_tab_l44_2048, 40, tab.fcb44l, 4, 6, tab.cb4440l0, tab.cb4440l1, 17 }
-    },
-    2048, 20, tab.lsp44, 1, 6, 4, 4, tab.shape44, 9, 84, 54, 7, 432
-};
-
-static const TwinVQModeTab mode_44_48 = {
-    {
-        { 16, bark_tab_s44_128,  10, tab.fcb44s, 1, 6, tab.cb4448s0, tab.cb4448s1, 15 },
-        { 4,  bark_tab_m44_512,  20, tab.fcb44m, 2, 6, tab.cb4448m0, tab.cb4448m1, 14 },
-        { 1,  bark_tab_l44_2048, 40, tab.fcb44l, 4, 6, tab.cb4448l0, tab.cb4448l1, 14 }
-    },
-    2048, 20, tab.lsp44, 1, 6, 4, 4, tab.shape44, 9, 84, 54, 7, 432
-};
-
-/**
- * Evaluate a * b / 400 rounded to the nearest integer. When, for example,
- * a * b == 200 and the nearest integer is ill-defined, use a table to emulate
- * the following broken float-based implementation used by the binary decoder:
- *
- * @code
- * static int very_broken_op(int a, int b)
- * {
- *    static float test; // Ugh, force gcc to do the division first...
- *
- *    test = a / 400.0;
- *    return b * test + 0.5;
- * }
- * @endcode
- *
- * @note if this function is replaced by just ROUNDED_DIV(a * b, 400.0), the
- * stddev between the original file (before encoding with Yamaha encoder) and
- * the decoded output increases, which leads one to believe that the encoder
- * expects exactly this broken calculation.
- */
-static int very_broken_op(int a, int b)
-{
-    int x = a * b + 200;
-    int size;
-    const uint8_t *rtab;
-
-    if (x % 400 || b % 5)
-        return x / 400;
-
-    x /= 400;
-
-    size = tabs[b / 5].size;
-    rtab = tabs[b / 5].tab;
-    return x - rtab[size * av_log2(2 * (x - 1) / size) + (x - 1) % size];
-}
-
-/**
- * Sum to data a periodic peak of a given period, width and shape.
- *
- * @param period the period of the peak divised by 400.0
- */
-static void add_peak(int period, int width, const float *shape,
-                     float ppc_gain, float *speech, int len)
-{
-    int i, j;
-
-    const float *shape_end = shape + len;
-    int center;
-
-    // First peak centered around zero
-    for (i = 0; i < width / 2; i++)
-        speech[i] += ppc_gain * *shape++;
-
-    for (i = 1; i < ROUNDED_DIV(len, width); i++) {
-        center = very_broken_op(period, i);
-        for (j = -width / 2; j < (width + 1) / 2; j++)
-            speech[j + center] += ppc_gain * *shape++;
-    }
-
-    // For the last block, be careful not to go beyond the end of the buffer
-    center = very_broken_op(period, i);
-    for (j = -width / 2; j < (width + 1) / 2 && shape < shape_end; j++)
-        speech[j + center] += ppc_gain * *shape++;
-}
-
-static void decode_ppc(TwinVQContext *tctx, int period_coef, int g_coef,
-                       const float *shape, float *speech)
-{
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int isampf = tctx->avctx->sample_rate /  1000;
-    int ibps   = tctx->avctx->bit_rate    / (1000 * tctx->avctx->channels);
-    int min_period   = ROUNDED_DIV(40 * 2 * mtab->size, isampf);
-    int max_period   = ROUNDED_DIV(40 * 2 * mtab->size * 6, isampf);
-    int period_range = max_period - min_period;
-    float pgain_step = 25000.0 / ((1 << mtab->pgain_bit) - 1);
-    float ppc_gain   = 1.0 / 8192 *
-                       twinvq_mulawinv(pgain_step * g_coef +
-                                           pgain_step / 2,
-                                       25000.0, TWINVQ_PGAIN_MU);
-
-    // This is actually the period multiplied by 400. It is just linearly coded
-    // between its maximum and minimum value.
-    int period = min_period +
-                 ROUNDED_DIV(period_coef * period_range,
-                             (1 << mtab->ppc_period_bit) - 1);
-    int width;
-
-    if (isampf == 22 && ibps == 32) {
-        // For some unknown reason, NTT decided to code this case differently...
-        width = ROUNDED_DIV((period + 800) * mtab->peak_per2wid,
-                            400 * mtab->size);
-    } else
-        width = period * mtab->peak_per2wid / (400 * mtab->size);
-
-    add_peak(period, width, shape, ppc_gain, speech, mtab->ppc_shape_len);
-}
-
-static void dec_bark_env(TwinVQContext *tctx, const uint8_t *in, int use_hist,
-                         int ch, float *out, float gain,
-                         enum TwinVQFrameType ftype)
-{
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int i, j;
-    float *hist     = tctx->bark_hist[ftype][ch];
-    float val       = ((const float []) { 0.4, 0.35, 0.28 })[ftype];
-    int bark_n_coef = mtab->fmode[ftype].bark_n_coef;
-    int fw_cb_len   = mtab->fmode[ftype].bark_env_size / bark_n_coef;
-    int idx         = 0;
-
-    for (i = 0; i < fw_cb_len; i++)
-        for (j = 0; j < bark_n_coef; j++, idx++) {
-            float tmp2 = mtab->fmode[ftype].bark_cb[fw_cb_len * in[j] + i] *
-                         (1.0 / 4096);
-            float st   = use_hist ? (1.0 - val) * tmp2 + val * hist[idx] + 1.0
-                                  : tmp2 + 1.0;
-
-            hist[idx] = tmp2;
-            if (st < -1.0)
-                st = 1.0;
-
-            twinvq_memset_float(out, st * gain, mtab->fmode[ftype].bark_tab[idx]);
-            out += mtab->fmode[ftype].bark_tab[idx];
-        }
-}
-
-static void read_cb_data(TwinVQContext *tctx, GetBitContext *gb,
-                         uint8_t *dst, enum TwinVQFrameType ftype)
-{
-    int i;
-
-    for (i = 0; i < tctx->n_div[ftype]; i++) {
-        int bs_second_part = (i >= tctx->bits_main_spec_change[ftype]);
-
-        *dst++ = get_bits(gb, tctx->bits_main_spec[0][ftype][bs_second_part]);
-        *dst++ = get_bits(gb, tctx->bits_main_spec[1][ftype][bs_second_part]);
-    }
-}
-
-static int twinvq_read_bitstream(AVCodecContext *avctx, TwinVQContext *tctx,
-                                 const uint8_t *buf, int buf_size)
-{
-    TwinVQFrameData     *bits = &tctx->bits[0];
-    const TwinVQModeTab *mtab = tctx->mtab;
-    int channels              = tctx->avctx->channels;
-    int sub;
-    GetBitContext gb;
-    int i, j, k;
-
-    init_get_bits(&gb, buf, buf_size * 8);
-    skip_bits(&gb, get_bits(&gb, 8));
-
-    bits->window_type = get_bits(&gb, TWINVQ_WINDOW_TYPE_BITS);
-
-    if (bits->window_type > 8) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid window type, broken sample?\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    bits->ftype = ff_twinvq_wtype_to_ftype_table[tctx->bits[0].window_type];
-
-    sub = mtab->fmode[bits->ftype].sub;
-
-    read_cb_data(tctx, &gb, bits->main_coeffs, bits->ftype);
-
-    for (i = 0; i < channels; i++)
-        for (j = 0; j < sub; j++)
-            for (k = 0; k < mtab->fmode[bits->ftype].bark_n_coef; k++)
-                bits->bark1[i][j][k] =
-                    get_bits(&gb, mtab->fmode[bits->ftype].bark_n_bit);
-
-    for (i = 0; i < channels; i++)
-        for (j = 0; j < sub; j++)
-            bits->bark_use_hist[i][j] = get_bits1(&gb);
-
-    if (bits->ftype == TWINVQ_FT_LONG) {
-        for (i = 0; i < channels; i++)
-            bits->gain_bits[i] = get_bits(&gb, TWINVQ_GAIN_BITS);
-    } else {
-        for (i = 0; i < channels; i++) {
-            bits->gain_bits[i] = get_bits(&gb, TWINVQ_GAIN_BITS);
-            for (j = 0; j < sub; j++)
-                bits->sub_gain_bits[i * sub + j] = get_bits(&gb,
-                                                       TWINVQ_SUB_GAIN_BITS);
-        }
-    }
-
-    for (i = 0; i < channels; i++) {
-        bits->lpc_hist_idx[i] = get_bits(&gb, mtab->lsp_bit0);
-        bits->lpc_idx1[i]     = get_bits(&gb, mtab->lsp_bit1);
-
-        for (j = 0; j < mtab->lsp_split; j++)
-            bits->lpc_idx2[i][j] = get_bits(&gb, mtab->lsp_bit2);
-    }
-
-    if (bits->ftype == TWINVQ_FT_LONG) {
-        read_cb_data(tctx, &gb, bits->ppc_coeffs, 3);
-        for (i = 0; i < channels; i++) {
-            bits->p_coef[i] = get_bits(&gb, mtab->ppc_period_bit);
-            bits->g_coef[i] = get_bits(&gb, mtab->pgain_bit);
-        }
-    }
-
-    return 0;
-}
-
-static av_cold int twinvq_decode_init(AVCodecContext *avctx)
-{
-    int isampf, ibps;
-    TwinVQContext *tctx = avctx->priv_data;
-
-    if (!avctx->extradata || avctx->extradata_size < 12) {
-        av_log(avctx, AV_LOG_ERROR, "Missing or incomplete extradata\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->channels = AV_RB32(avctx->extradata)     + 1;
-    avctx->bit_rate = AV_RB32(avctx->extradata + 4) * 1000;
-    isampf          = AV_RB32(avctx->extradata + 8);
-
-    if (isampf < 8 || isampf > 44) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate\n");
-        return AVERROR_INVALIDDATA;
-    }
-    switch (isampf) {
-    case 44:
-        avctx->sample_rate = 44100;
-        break;
-    case 22:
-        avctx->sample_rate = 22050;
-        break;
-    case 11:
-        avctx->sample_rate = 11025;
-        break;
-    default:
-        avctx->sample_rate = isampf * 1000;
-        break;
-    }
-
-    if (avctx->channels <= 0 || avctx->channels > TWINVQ_CHANNELS_MAX) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %i\n",
-               avctx->channels);
-        return -1;
-    }
-    avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO
-                                                 : AV_CH_LAYOUT_STEREO;
-
-    ibps = avctx->bit_rate / (1000 * avctx->channels);
-    if (ibps < 8 || ibps > 48) {
-        av_log(avctx, AV_LOG_ERROR, "Bad bitrate per channel value %d\n", ibps);
-        return AVERROR_INVALIDDATA;
-    }
-
-    switch ((isampf << 8) + ibps) {
-    case (8 << 8) + 8:
-        tctx->mtab = &mode_08_08;
-        break;
-    case (11 << 8) + 8:
-        tctx->mtab = &mode_11_08;
-        break;
-    case (11 << 8) + 10:
-        tctx->mtab = &mode_11_10;
-        break;
-    case (16 << 8) + 16:
-        tctx->mtab = &mode_16_16;
-        break;
-    case (22 << 8) + 20:
-        tctx->mtab = &mode_22_20;
-        break;
-    case (22 << 8) + 24:
-        tctx->mtab = &mode_22_24;
-        break;
-    case (22 << 8) + 32:
-        tctx->mtab = &mode_22_32;
-        break;
-    case (44 << 8) + 40:
-        tctx->mtab = &mode_44_40;
-        break;
-    case (44 << 8) + 48:
-        tctx->mtab = &mode_44_48;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR,
-               "This version does not support %d kHz - %d kbit/s/ch mode.\n",
-               isampf, isampf);
-        return -1;
-    }
-
-    tctx->codec          = TWINVQ_CODEC_VQF;
-    tctx->read_bitstream = twinvq_read_bitstream;
-    tctx->dec_bark_env   = dec_bark_env;
-    tctx->decode_ppc     = decode_ppc;
-    tctx->frame_size     = avctx->bit_rate * tctx->mtab->size
-                                           / avctx->sample_rate + 8;
-    tctx->is_6kbps       = 0;
-    if (avctx->block_align && avctx->block_align * 8 / tctx->frame_size > 1) {
-        av_log(avctx, AV_LOG_ERROR,
-               "VQF TwinVQ should have only one frame per packet\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    return ff_twinvq_decode_init(avctx);
-}
-
-AVCodec ff_twinvq_decoder = {
-    .name           = "twinvq",
-    .long_name      = NULL_IF_CONFIG_SMALL("VQF TwinVQ"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_TWINVQ,
-    .priv_data_size = sizeof(TwinVQContext),
-    .init           = twinvq_decode_init,
-    .close          = ff_twinvq_decode_close,
-    .decode         = ff_twinvq_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/txd.c b/deps/libav/libavcodec/txd.c
deleted file mode 100644
index 8f12291..0000000
--- a/deps/libav/libavcodec/txd.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Renderware TeXture Dictionary (.txd) image decoder
- * Copyright (c) 2007 Ivo van Poorten
- *
- * See also: http://wiki.multimedia.cx/index.php?title=TXD
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "s3tc.h"
-
-static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                            AVPacket *avpkt) {
-    GetByteContext gb;
-    AVFrame * const p = data;
-    unsigned int version, w, h, d3d_format, depth, stride, flags;
-    unsigned int y, v;
-    uint8_t *ptr;
-    uint32_t *pal;
-    int ret;
-
-    bytestream2_init(&gb, avpkt->data, avpkt->size);
-    version         = bytestream2_get_le32(&gb);
-    bytestream2_skip(&gb, 72);
-    d3d_format      = bytestream2_get_le32(&gb);
-    w               = bytestream2_get_le16(&gb);
-    h               = bytestream2_get_le16(&gb);
-    depth           = bytestream2_get_byte(&gb);
-    bytestream2_skip(&gb, 2);
-    flags           = bytestream2_get_byte(&gb);
-
-    if (version < 8 || version > 9) {
-        av_log(avctx, AV_LOG_ERROR, "texture data version %i is unsupported\n",
-                                                                    version);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (depth == 8) {
-        avctx->pix_fmt = AV_PIX_FMT_PAL8;
-    } else if (depth == 16 || depth == 32) {
-        avctx->pix_fmt = AV_PIX_FMT_RGB32;
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "depth of %i is unsupported\n", depth);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
-        return ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    p->pict_type = AV_PICTURE_TYPE_I;
-
-    ptr    = p->data[0];
-    stride = p->linesize[0];
-
-    if (depth == 8) {
-        pal = (uint32_t *) p->data[1];
-        for (y = 0; y < 256; y++) {
-            v = bytestream2_get_be32(&gb);
-            pal[y] = (v >> 8) + (v << 24);
-        }
-        bytestream2_skip(&gb, 4);
-        for (y=0; y<h; y++) {
-            bytestream2_get_buffer(&gb, ptr, w);
-            ptr += stride;
-        }
-    } else if (depth == 16) {
-        bytestream2_skip(&gb, 4);
-        switch (d3d_format) {
-        case 0:
-            if (!(flags & 1))
-                goto unsupported;
-        case FF_S3TC_DXT1:
-            ff_decode_dxt1(&gb, ptr, w, h, stride);
-            break;
-        case FF_S3TC_DXT3:
-            ff_decode_dxt3(&gb, ptr, w, h, stride);
-            break;
-        default:
-            goto unsupported;
-        }
-    } else if (depth == 32) {
-        switch (d3d_format) {
-        case 0x15:
-        case 0x16:
-            for (y=0; y<h; y++) {
-                bytestream2_get_buffer(&gb, ptr, w * 4);
-                ptr += stride;
-            }
-            break;
-        default:
-            goto unsupported;
-        }
-    }
-
-    *got_frame = 1;
-
-    return avpkt->size;
-
-unsupported:
-    av_log(avctx, AV_LOG_ERROR, "unsupported d3d format (%08x)\n", d3d_format);
-    return AVERROR_PATCHWELCOME;
-}
-
-AVCodec ff_txd_decoder = {
-    .name           = "txd",
-    .long_name      = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_TXD,
-    .decode         = txd_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/ulti.c b/deps/libav/libavcodec/ulti.c
deleted file mode 100644
index 186f1a6..0000000
--- a/deps/libav/libavcodec/ulti.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * IBM Ultimotion Video Decoder
- * Copyright (C) 2004 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * IBM Ultimotion Video Decoder.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-#include "ulti_cb.h"
-
-typedef struct UltimotionDecodeContext {
-    AVCodecContext *avctx;
-    int width, height, blocks;
-    AVFrame *frame;
-    const uint8_t *ulti_codebook;
-    GetByteContext gb;
-} UltimotionDecodeContext;
-
-static av_cold int ulti_decode_init(AVCodecContext *avctx)
-{
-    UltimotionDecodeContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    s->width = avctx->width;
-    s->height = avctx->height;
-    s->blocks = (s->width / 8) * (s->height / 8);
-    avctx->pix_fmt = AV_PIX_FMT_YUV410P;
-    s->ulti_codebook = ulti_codebook;
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static av_cold int ulti_decode_end(AVCodecContext *avctx){
-    UltimotionDecodeContext *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-static const int block_coords[8] = // 4x4 block coords in 8x8 superblock
-    { 0, 0, 0, 4, 4, 4, 4, 0};
-
-static const int angle_by_index[4] = { 0, 2, 6, 12};
-
-/* Lookup tables for luma and chroma - used by ulti_convert_yuv() */
-static const uint8_t ulti_lumas[64] =
-    { 0x10, 0x13, 0x17, 0x1A, 0x1E, 0x21, 0x25, 0x28,
-      0x2C, 0x2F, 0x33, 0x36, 0x3A, 0x3D, 0x41, 0x44,
-      0x48, 0x4B, 0x4F, 0x52, 0x56, 0x59, 0x5C, 0x60,
-      0x63, 0x67, 0x6A, 0x6E, 0x71, 0x75, 0x78, 0x7C,
-      0x7F, 0x83, 0x86, 0x8A, 0x8D, 0x91, 0x94, 0x98,
-      0x9B, 0x9F, 0xA2, 0xA5, 0xA9, 0xAC, 0xB0, 0xB3,
-      0xB7, 0xBA, 0xBE, 0xC1, 0xC5, 0xC8, 0xCC, 0xCF,
-      0xD3, 0xD6, 0xDA, 0xDD, 0xE1, 0xE4, 0xE8, 0xEB};
-
-static const uint8_t ulti_chromas[16] =
-    { 0x60, 0x67, 0x6D, 0x73, 0x7A, 0x80, 0x86, 0x8D,
-      0x93, 0x99, 0xA0, 0xA6, 0xAC, 0xB3, 0xB9, 0xC0};
-
-/* convert Ultimotion YUV block (sixteen 6-bit Y samples and
- two 4-bit chroma samples) into standard YUV and put it into frame */
-static void ulti_convert_yuv(AVFrame *frame, int x, int y,
-                             uint8_t *luma,int chroma)
-{
-    uint8_t *y_plane, *cr_plane, *cb_plane;
-    int i;
-
-    y_plane = frame->data[0] + x + y * frame->linesize[0];
-    cr_plane = frame->data[1] + (x / 4) + (y / 4) * frame->linesize[1];
-    cb_plane = frame->data[2] + (x / 4) + (y / 4) * frame->linesize[2];
-
-    cr_plane[0] = ulti_chromas[chroma >> 4];
-
-    cb_plane[0] = ulti_chromas[chroma & 0xF];
-
-
-    for(i = 0; i < 16; i++){
-        y_plane[i & 3] = ulti_lumas[luma[i]];
-        if((i & 3) == 3) { //next row
-            y_plane += frame->linesize[0];
-        }
-    }
-}
-
-/* generate block like in MS Video1 */
-static void ulti_pattern(AVFrame *frame, int x, int y,
-                         int f0, int f1, int Y0, int Y1, int chroma)
-{
-    uint8_t Luma[16];
-    int mask, i;
-    for(mask = 0x80, i = 0; mask; mask >>= 1, i++) {
-        if(f0 & mask)
-            Luma[i] = Y1;
-        else
-            Luma[i] = Y0;
-    }
-
-    for(mask = 0x80, i = 8; mask; mask >>= 1, i++) {
-        if(f1 & mask)
-            Luma[i] = Y1;
-        else
-            Luma[i] = Y0;
-    }
-
-    ulti_convert_yuv(frame, x, y, Luma, chroma);
-}
-
-/* fill block with some gradient */
-static void ulti_grad(AVFrame *frame, int x, int y, uint8_t *Y, int chroma, int angle)
-{
-    uint8_t Luma[16];
-    if(angle & 8) { //reverse order
-        int t;
-        angle &= 0x7;
-        t = Y[0];
-        Y[0] = Y[3];
-        Y[3] = t;
-        t = Y[1];
-        Y[1] = Y[2];
-        Y[2] = t;
-    }
-    switch(angle){
-    case 0:
-        Luma[0]  = Y[0]; Luma[1]  = Y[1]; Luma[2]  = Y[2]; Luma[3]  = Y[3];
-        Luma[4]  = Y[0]; Luma[5]  = Y[1]; Luma[6]  = Y[2]; Luma[7]  = Y[3];
-        Luma[8]  = Y[0]; Luma[9]  = Y[1]; Luma[10] = Y[2]; Luma[11] = Y[3];
-        Luma[12] = Y[0]; Luma[13] = Y[1]; Luma[14] = Y[2]; Luma[15] = Y[3];
-        break;
-    case 1:
-        Luma[0]  = Y[1]; Luma[1]  = Y[2]; Luma[2]  = Y[3]; Luma[3]  = Y[3];
-        Luma[4]  = Y[0]; Luma[5]  = Y[1]; Luma[6]  = Y[2]; Luma[7]  = Y[3];
-        Luma[8]  = Y[0]; Luma[9]  = Y[1]; Luma[10] = Y[2]; Luma[11] = Y[3];
-        Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[1]; Luma[15] = Y[2];
-        break;
-    case 2:
-        Luma[0]  = Y[1]; Luma[1]  = Y[2]; Luma[2]  = Y[3]; Luma[3]  = Y[3];
-        Luma[4]  = Y[1]; Luma[5]  = Y[2]; Luma[6]  = Y[2]; Luma[7]  = Y[3];
-        Luma[8]  = Y[0]; Luma[9]  = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[2];
-        Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[1]; Luma[15] = Y[2];
-        break;
-    case 3:
-        Luma[0]  = Y[2]; Luma[1]  = Y[3]; Luma[2]  = Y[3]; Luma[3]  = Y[3];
-        Luma[4]  = Y[1]; Luma[5]  = Y[2]; Luma[6]  = Y[2]; Luma[7]  = Y[3];
-        Luma[8]  = Y[0]; Luma[9]  = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[2];
-        Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[1];
-        break;
-    case 4:
-        Luma[0]  = Y[3]; Luma[1]  = Y[3]; Luma[2]  = Y[3]; Luma[3]  = Y[3];
-        Luma[4]  = Y[2]; Luma[5]  = Y[2]; Luma[6]  = Y[2]; Luma[7]  = Y[2];
-        Luma[8]  = Y[1]; Luma[9]  = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[1];
-        Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[0];
-        break;
-    case 5:
-        Luma[0]  = Y[3]; Luma[1]  = Y[3]; Luma[2]  = Y[3]; Luma[3]  = Y[2];
-        Luma[4]  = Y[3]; Luma[5]  = Y[2]; Luma[6]  = Y[2]; Luma[7]  = Y[1];
-        Luma[8]  = Y[2]; Luma[9]  = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[0];
-        Luma[12] = Y[1]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[0];
-        break;
-    case 6:
-        Luma[0]  = Y[3]; Luma[1]  = Y[3]; Luma[2]  = Y[2]; Luma[3]  = Y[2];
-        Luma[4]  = Y[3]; Luma[5]  = Y[2]; Luma[6]  = Y[1]; Luma[7]  = Y[1];
-        Luma[8]  = Y[2]; Luma[9]  = Y[2]; Luma[10] = Y[1]; Luma[11] = Y[0];
-        Luma[12] = Y[1]; Luma[13] = Y[1]; Luma[14] = Y[0]; Luma[15] = Y[0];
-        break;
-    case 7:
-        Luma[0]  = Y[3]; Luma[1]  = Y[3]; Luma[2]  = Y[2]; Luma[3]  = Y[1];
-        Luma[4]  = Y[3]; Luma[5]  = Y[2]; Luma[6]  = Y[1]; Luma[7]  = Y[0];
-        Luma[8]  = Y[3]; Luma[9]  = Y[2]; Luma[10] = Y[1]; Luma[11] = Y[0];
-        Luma[12] = Y[2]; Luma[13] = Y[1]; Luma[14] = Y[0]; Luma[15] = Y[0];
-        break;
-    default:
-        Luma[0]  = Y[0]; Luma[1]  = Y[0]; Luma[2]  = Y[1]; Luma[3]  = Y[1];
-        Luma[4]  = Y[0]; Luma[5]  = Y[0]; Luma[6]  = Y[1]; Luma[7]  = Y[1];
-        Luma[8]  = Y[2]; Luma[9]  = Y[2]; Luma[10] = Y[3]; Luma[11] = Y[3];
-        Luma[12] = Y[2]; Luma[13] = Y[2]; Luma[14] = Y[3]; Luma[15] = Y[3];
-        break;
-    }
-
-    ulti_convert_yuv(frame, x, y, Luma, chroma);
-}
-
-static int ulti_decode_frame(AVCodecContext *avctx,
-                             void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    UltimotionDecodeContext *s=avctx->priv_data;
-    int modifier = 0;
-    int uniq = 0;
-    int mode = 0;
-    int blocks = 0;
-    int done = 0;
-    int x = 0, y = 0;
-    int i, ret;
-    int skip;
-    int tmp;
-
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    bytestream2_init(&s->gb, buf, buf_size);
-
-    while(!done) {
-        int idx;
-        if(blocks >= s->blocks || y >= s->height)
-            break;//all blocks decoded
-
-        if (bytestream2_get_bytes_left(&s->gb) < 1)
-            goto err;
-        idx = bytestream2_get_byteu(&s->gb);
-        if((idx & 0xF8) == 0x70) {
-            switch(idx) {
-            case 0x70: //change modifier
-                modifier = bytestream2_get_byte(&s->gb);
-                if(modifier>1)
-                    av_log(avctx, AV_LOG_INFO, "warning: modifier must be 0 or 1, got %i\n", modifier);
-                break;
-            case 0x71: // set uniq flag
-                uniq = 1;
-                break;
-            case 0x72: //toggle mode
-                mode = !mode;
-                break;
-            case 0x73: //end-of-frame
-                done = 1;
-                break;
-            case 0x74: //skip some blocks
-                skip = bytestream2_get_byte(&s->gb);
-                if ((blocks + skip) >= s->blocks)
-                    break;
-                blocks += skip;
-                x += skip * 8;
-                while(x >= s->width) {
-                    x -= s->width;
-                    y += 8;
-                }
-                break;
-            default:
-                av_log(avctx, AV_LOG_INFO, "warning: unknown escape 0x%02X\n", idx);
-            }
-        } else { //handle one block
-            int code;
-            int cf;
-            int angle = 0;
-            uint8_t Y[4]; // luma samples of block
-            int tx = 0, ty = 0; //coords of subblock
-            int chroma = 0;
-            if (mode || uniq) {
-                uniq = 0;
-                cf = 1;
-                chroma = 0;
-            } else {
-                cf = 0;
-                if (idx) {
-                    chroma = bytestream2_get_byte(&s->gb);
-                }
-            }
-            for (i = 0; i < 4; i++) { // for every subblock
-                code = (idx >> (6 - i*2)) & 3; //extract 2 bits
-                if(!code) //skip subblock
-                    continue;
-                if(cf) {
-                    chroma = bytestream2_get_byte(&s->gb);
-                }
-                tx = x + block_coords[i * 2];
-                ty = y + block_coords[(i * 2) + 1];
-                switch(code) {
-                case 1:
-                    tmp = bytestream2_get_byte(&s->gb);
-
-                    angle = angle_by_index[(tmp >> 6) & 0x3];
-
-                    Y[0] = tmp & 0x3F;
-                    Y[1] = Y[0];
-
-                    if (angle) {
-                        Y[2] = Y[0]+1;
-                        if (Y[2] > 0x3F)
-                            Y[2] = 0x3F;
-                        Y[3] = Y[2];
-                    } else {
-                        Y[2] = Y[0];
-                        Y[3] = Y[0];
-                    }
-                    break;
-
-                case 2:
-                    if (modifier) { // unpack four luma samples
-                        tmp = bytestream2_get_be24(&s->gb);
-
-                        Y[0] = (tmp >> 18) & 0x3F;
-                        Y[1] = (tmp >> 12) & 0x3F;
-                        Y[2] = (tmp >> 6) & 0x3F;
-                        Y[3] = tmp & 0x3F;
-                        angle = 16;
-                    } else { // retrieve luma samples from codebook
-                        tmp = bytestream2_get_be16(&s->gb);
-
-                        angle = (tmp >> 12) & 0xF;
-                        tmp &= 0xFFF;
-                        tmp <<= 2;
-                        Y[0] = s->ulti_codebook[tmp];
-                        Y[1] = s->ulti_codebook[tmp + 1];
-                        Y[2] = s->ulti_codebook[tmp + 2];
-                        Y[3] = s->ulti_codebook[tmp + 3];
-                    }
-                    break;
-
-                case 3:
-                    if (modifier) { // all 16 luma samples
-                        uint8_t Luma[16];
-
-                        if (bytestream2_get_bytes_left(&s->gb) < 12)
-                            goto err;
-                        tmp = bytestream2_get_be24u(&s->gb);
-                        Luma[0] = (tmp >> 18) & 0x3F;
-                        Luma[1] = (tmp >> 12) & 0x3F;
-                        Luma[2] = (tmp >> 6) & 0x3F;
-                        Luma[3] = tmp & 0x3F;
-
-                        tmp = bytestream2_get_be24u(&s->gb);
-                        Luma[4] = (tmp >> 18) & 0x3F;
-                        Luma[5] = (tmp >> 12) & 0x3F;
-                        Luma[6] = (tmp >> 6) & 0x3F;
-                        Luma[7] = tmp & 0x3F;
-
-                        tmp = bytestream2_get_be24u(&s->gb);
-                        Luma[8] = (tmp >> 18) & 0x3F;
-                        Luma[9] = (tmp >> 12) & 0x3F;
-                        Luma[10] = (tmp >> 6) & 0x3F;
-                        Luma[11] = tmp & 0x3F;
-
-                        tmp = bytestream2_get_be24u(&s->gb);
-                        Luma[12] = (tmp >> 18) & 0x3F;
-                        Luma[13] = (tmp >> 12) & 0x3F;
-                        Luma[14] = (tmp >> 6) & 0x3F;
-                        Luma[15] = tmp & 0x3F;
-
-                        ulti_convert_yuv(s->frame, tx, ty, Luma, chroma);
-                    } else {
-                        if (bytestream2_get_bytes_left(&s->gb) < 4)
-                            goto err;
-                        tmp = bytestream2_get_byteu(&s->gb);
-                        if(tmp & 0x80) {
-                            angle = (tmp >> 4) & 0x7;
-                            tmp = (tmp << 8) + bytestream2_get_byteu(&s->gb);
-                            Y[0] = (tmp >> 6) & 0x3F;
-                            Y[1] = tmp & 0x3F;
-                            Y[2] = bytestream2_get_byteu(&s->gb) & 0x3F;
-                            Y[3] = bytestream2_get_byteu(&s->gb) & 0x3F;
-                            ulti_grad(s->frame, tx, ty, Y, chroma, angle); //draw block
-                        } else { // some patterns
-                            int f0, f1;
-                            f0 = bytestream2_get_byteu(&s->gb);
-                            f1 = tmp;
-                            Y[0] = bytestream2_get_byteu(&s->gb) & 0x3F;
-                            Y[1] = bytestream2_get_byteu(&s->gb) & 0x3F;
-                            ulti_pattern(s->frame, tx, ty, f1, f0, Y[0], Y[1], chroma);
-                        }
-                    }
-                    break;
-                }
-                if(code != 3)
-                    ulti_grad(s->frame, tx, ty, Y, chroma, angle); // draw block
-            }
-            blocks++;
-                x += 8;
-            if(x >= s->width) {
-                x = 0;
-                y += 8;
-            }
-        }
-    }
-
-    *got_frame = 1;
-    if ((ret = av_frame_ref(data, s->frame)) < 0)
-        return ret;
-
-    return buf_size;
-
-err:
-    av_log(avctx, AV_LOG_ERROR,
-           "Insufficient data\n");
-    return AVERROR_INVALIDDATA;
-}
-
-AVCodec ff_ulti_decoder = {
-    .name           = "ultimotion",
-    .long_name      = NULL_IF_CONFIG_SMALL("IBM UltiMotion"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ULTI,
-    .priv_data_size = sizeof(UltimotionDecodeContext),
-    .init           = ulti_decode_init,
-    .close          = ulti_decode_end,
-    .decode         = ulti_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/ulti_cb.h b/deps/libav/libavcodec/ulti_cb.h
deleted file mode 100644
index 0bd83ff..0000000
--- a/deps/libav/libavcodec/ulti_cb.h
+++ /dev/null
@@ -1,4124 +0,0 @@
-/*
- * IBM Ultimotion Video Decoder
- * copyright (C) 2004 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_ULTI_CB_H
-#define AVCODEC_ULTI_CB_H
-
-static const unsigned char ulti_codebook[16384]={
-    0x00, 0x01, 0x01, 0x02,
-    0x00, 0x01, 0x02, 0x03,
-    0x00, 0x02, 0x03, 0x04,
-    0x00, 0x01, 0x03, 0x04,
-    0x00, 0x01, 0x02, 0x04,
-    0x00, 0x02, 0x03, 0x05,
-    0x00, 0x02, 0x04, 0x05,
-    0x00, 0x01, 0x04, 0x05,
-    0x00, 0x01, 0x03, 0x05,
-    0x00, 0x02, 0x04, 0x06,
-    0x00, 0x03, 0x05, 0x06,
-    0x00, 0x01, 0x05, 0x06,
-    0x00, 0x01, 0x03, 0x06,
-    0x00, 0x06, 0x06, 0x06,
-    0x00, 0x00, 0x06, 0x06,
-    0x00, 0x00, 0x00, 0x06,
-    0x00, 0x03, 0x04, 0x07,
-    0x00, 0x03, 0x06, 0x07,
-    0x00, 0x01, 0x06, 0x07,
-    0x00, 0x01, 0x04, 0x07,
-    0x00, 0x03, 0x05, 0x08,
-    0x00, 0x04, 0x06, 0x08,
-    0x00, 0x02, 0x06, 0x08,
-    0x00, 0x02, 0x04, 0x08,
-    0x00, 0x08, 0x08, 0x08,
-    0x00, 0x00, 0x08, 0x08,
-    0x00, 0x00, 0x00, 0x08,
-    0x00, 0x04, 0x07, 0x0B,
-    0x00, 0x05, 0x09, 0x0B,
-    0x00, 0x02, 0x09, 0x0B,
-    0x00, 0x02, 0x06, 0x0B,
-    0x00, 0x0B, 0x0B, 0x0B,
-    0x00, 0x00, 0x0B, 0x0B,
-    0x00, 0x00, 0x00, 0x0B,
-    0x00, 0x05, 0x09, 0x0E,
-    0x00, 0x07, 0x0B, 0x0E,
-    0x00, 0x03, 0x0B, 0x0E,
-    0x00, 0x03, 0x07, 0x0E,
-    0x00, 0x0E, 0x0E, 0x0E,
-    0x00, 0x00, 0x0E, 0x0E,
-    0x00, 0x00, 0x00, 0x0E,
-    0x00, 0x06, 0x0B, 0x11,
-    0x00, 0x08, 0x0D, 0x11,
-    0x00, 0x04, 0x0D, 0x11,
-    0x00, 0x04, 0x09, 0x11,
-    0x00, 0x11, 0x11, 0x11,
-    0x00, 0x00, 0x11, 0x11,
-    0x00, 0x00, 0x00, 0x11,
-    0x00, 0x07, 0x0D, 0x14,
-    0x00, 0x0A, 0x0F, 0x14,
-    0x00, 0x05, 0x0F, 0x14,
-    0x00, 0x05, 0x0A, 0x14,
-    0x00, 0x14, 0x14, 0x14,
-    0x00, 0x00, 0x14, 0x14,
-    0x00, 0x00, 0x00, 0x14,
-    0x00, 0x0B, 0x12, 0x17,
-    0x00, 0x05, 0x12, 0x17,
-    0x00, 0x05, 0x0C, 0x17,
-    0x00, 0x17, 0x17, 0x17,
-    0x00, 0x00, 0x17, 0x17,
-    0x00, 0x00, 0x00, 0x17,
-    0x00, 0x0D, 0x14, 0x1A,
-    0x00, 0x06, 0x14, 0x1A,
-    0x00, 0x06, 0x0D, 0x1A,
-    0x00, 0x1A, 0x1A, 0x1A,
-    0x00, 0x00, 0x1A, 0x1A,
-    0x00, 0x00, 0x00, 0x1A,
-    0x00, 0x0E, 0x16, 0x1D,
-    0x00, 0x07, 0x16, 0x1D,
-    0x00, 0x07, 0x0F, 0x1D,
-    0x00, 0x1D, 0x1D, 0x1D,
-    0x00, 0x00, 0x1D, 0x1D,
-    0x00, 0x00, 0x00, 0x1D,
-    0x00, 0x10, 0x18, 0x20,
-    0x00, 0x08, 0x18, 0x20,
-    0x00, 0x08, 0x10, 0x20,
-    0x00, 0x20, 0x20, 0x20,
-    0x00, 0x00, 0x20, 0x20,
-    0x00, 0x00, 0x00, 0x20,
-    0x00, 0x23, 0x23, 0x23,
-    0x00, 0x00, 0x23, 0x23,
-    0x00, 0x00, 0x00, 0x23,
-    0x00, 0x12, 0x1B, 0x24,
-    0x00, 0x09, 0x1B, 0x24,
-    0x00, 0x09, 0x12, 0x24,
-    0x00, 0x28, 0x28, 0x28,
-    0x00, 0x00, 0x28, 0x28,
-    0x00, 0x00, 0x00, 0x28,
-    0x00, 0x2E, 0x2E, 0x2E,
-    0x00, 0x00, 0x2E, 0x2E,
-    0x00, 0x00, 0x00, 0x2E,
-    0x01, 0x02, 0x02, 0x03,
-    0x01, 0x02, 0x03, 0x04,
-    0x01, 0x03, 0x04, 0x05,
-    0x01, 0x02, 0x04, 0x05,
-    0x01, 0x02, 0x03, 0x05,
-    0x01, 0x03, 0x04, 0x06,
-    0x01, 0x03, 0x05, 0x06,
-    0x01, 0x02, 0x05, 0x06,
-    0x01, 0x02, 0x04, 0x06,
-    0x01, 0x03, 0x05, 0x07,
-    0x01, 0x04, 0x06, 0x07,
-    0x01, 0x02, 0x06, 0x07,
-    0x01, 0x02, 0x04, 0x07,
-    0x01, 0x07, 0x07, 0x07,
-    0x01, 0x01, 0x07, 0x07,
-    0x01, 0x01, 0x01, 0x07,
-    0x01, 0x04, 0x05, 0x08,
-    0x01, 0x04, 0x07, 0x08,
-    0x01, 0x02, 0x07, 0x08,
-    0x01, 0x02, 0x05, 0x08,
-    0x01, 0x04, 0x06, 0x09,
-    0x01, 0x05, 0x07, 0x09,
-    0x01, 0x03, 0x07, 0x09,
-    0x01, 0x03, 0x05, 0x09,
-    0x01, 0x09, 0x09, 0x09,
-    0x01, 0x01, 0x09, 0x09,
-    0x01, 0x01, 0x01, 0x09,
-    0x01, 0x05, 0x08, 0x0C,
-    0x01, 0x06, 0x0A, 0x0C,
-    0x01, 0x03, 0x0A, 0x0C,
-    0x01, 0x03, 0x07, 0x0C,
-    0x01, 0x0C, 0x0C, 0x0C,
-    0x01, 0x01, 0x0C, 0x0C,
-    0x01, 0x01, 0x01, 0x0C,
-    0x01, 0x06, 0x0A, 0x0F,
-    0x01, 0x08, 0x0C, 0x0F,
-    0x01, 0x04, 0x0C, 0x0F,
-    0x01, 0x04, 0x08, 0x0F,
-    0x01, 0x0F, 0x0F, 0x0F,
-    0x01, 0x01, 0x0F, 0x0F,
-    0x01, 0x01, 0x01, 0x0F,
-    0x01, 0x07, 0x0C, 0x12,
-    0x01, 0x09, 0x0E, 0x12,
-    0x01, 0x05, 0x0E, 0x12,
-    0x01, 0x05, 0x0A, 0x12,
-    0x01, 0x12, 0x12, 0x12,
-    0x01, 0x01, 0x12, 0x12,
-    0x01, 0x01, 0x01, 0x12,
-    0x01, 0x08, 0x0E, 0x15,
-    0x01, 0x0B, 0x10, 0x15,
-    0x01, 0x06, 0x10, 0x15,
-    0x01, 0x06, 0x0B, 0x15,
-    0x01, 0x15, 0x15, 0x15,
-    0x01, 0x01, 0x15, 0x15,
-    0x01, 0x01, 0x01, 0x15,
-    0x01, 0x0C, 0x13, 0x18,
-    0x01, 0x06, 0x13, 0x18,
-    0x01, 0x06, 0x0D, 0x18,
-    0x01, 0x18, 0x18, 0x18,
-    0x01, 0x01, 0x18, 0x18,
-    0x01, 0x01, 0x01, 0x18,
-    0x01, 0x0E, 0x15, 0x1B,
-    0x01, 0x07, 0x15, 0x1B,
-    0x01, 0x07, 0x0E, 0x1B,
-    0x01, 0x1B, 0x1B, 0x1B,
-    0x01, 0x01, 0x1B, 0x1B,
-    0x01, 0x01, 0x01, 0x1B,
-    0x01, 0x0F, 0x17, 0x1E,
-    0x01, 0x08, 0x17, 0x1E,
-    0x01, 0x08, 0x10, 0x1E,
-    0x01, 0x1E, 0x1E, 0x1E,
-    0x01, 0x01, 0x1E, 0x1E,
-    0x01, 0x01, 0x01, 0x1E,
-    0x01, 0x11, 0x19, 0x21,
-    0x01, 0x09, 0x19, 0x21,
-    0x01, 0x09, 0x11, 0x21,
-    0x01, 0x21, 0x21, 0x21,
-    0x01, 0x01, 0x21, 0x21,
-    0x01, 0x01, 0x01, 0x21,
-    0x01, 0x24, 0x24, 0x24,
-    0x01, 0x01, 0x24, 0x24,
-    0x01, 0x01, 0x01, 0x24,
-    0x01, 0x13, 0x1C, 0x25,
-    0x01, 0x0A, 0x1C, 0x25,
-    0x01, 0x0A, 0x13, 0x25,
-    0x01, 0x29, 0x29, 0x29,
-    0x01, 0x01, 0x29, 0x29,
-    0x01, 0x01, 0x01, 0x29,
-    0x01, 0x2F, 0x2F, 0x2F,
-    0x01, 0x01, 0x2F, 0x2F,
-    0x01, 0x01, 0x01, 0x2F,
-    0x02, 0x03, 0x03, 0x04,
-    0x02, 0x03, 0x04, 0x05,
-    0x02, 0x04, 0x05, 0x06,
-    0x02, 0x03, 0x05, 0x06,
-    0x02, 0x03, 0x04, 0x06,
-    0x02, 0x04, 0x05, 0x07,
-    0x02, 0x04, 0x06, 0x07,
-    0x02, 0x03, 0x06, 0x07,
-    0x02, 0x03, 0x05, 0x07,
-    0x02, 0x04, 0x06, 0x08,
-    0x02, 0x05, 0x07, 0x08,
-    0x02, 0x03, 0x07, 0x08,
-    0x02, 0x03, 0x05, 0x08,
-    0x02, 0x08, 0x08, 0x08,
-    0x02, 0x02, 0x08, 0x08,
-    0x02, 0x02, 0x02, 0x08,
-    0x02, 0x05, 0x06, 0x09,
-    0x02, 0x05, 0x08, 0x09,
-    0x02, 0x03, 0x08, 0x09,
-    0x02, 0x03, 0x06, 0x09,
-    0x02, 0x05, 0x07, 0x0A,
-    0x02, 0x06, 0x08, 0x0A,
-    0x02, 0x04, 0x08, 0x0A,
-    0x02, 0x04, 0x06, 0x0A,
-    0x02, 0x0A, 0x0A, 0x0A,
-    0x02, 0x02, 0x0A, 0x0A,
-    0x02, 0x02, 0x02, 0x0A,
-    0x02, 0x06, 0x09, 0x0D,
-    0x02, 0x07, 0x0B, 0x0D,
-    0x02, 0x04, 0x0B, 0x0D,
-    0x02, 0x04, 0x08, 0x0D,
-    0x02, 0x0D, 0x0D, 0x0D,
-    0x02, 0x02, 0x0D, 0x0D,
-    0x02, 0x02, 0x02, 0x0D,
-    0x02, 0x07, 0x0B, 0x10,
-    0x02, 0x09, 0x0D, 0x10,
-    0x02, 0x05, 0x0D, 0x10,
-    0x02, 0x05, 0x09, 0x10,
-    0x02, 0x10, 0x10, 0x10,
-    0x02, 0x02, 0x10, 0x10,
-    0x02, 0x02, 0x02, 0x10,
-    0x02, 0x08, 0x0D, 0x13,
-    0x02, 0x0A, 0x0F, 0x13,
-    0x02, 0x06, 0x0F, 0x13,
-    0x02, 0x06, 0x0B, 0x13,
-    0x02, 0x13, 0x13, 0x13,
-    0x02, 0x02, 0x13, 0x13,
-    0x02, 0x02, 0x02, 0x13,
-    0x02, 0x09, 0x0F, 0x16,
-    0x02, 0x0C, 0x11, 0x16,
-    0x02, 0x07, 0x11, 0x16,
-    0x02, 0x07, 0x0C, 0x16,
-    0x02, 0x16, 0x16, 0x16,
-    0x02, 0x02, 0x16, 0x16,
-    0x02, 0x02, 0x02, 0x16,
-    0x02, 0x0D, 0x14, 0x19,
-    0x02, 0x07, 0x14, 0x19,
-    0x02, 0x07, 0x0E, 0x19,
-    0x02, 0x19, 0x19, 0x19,
-    0x02, 0x02, 0x19, 0x19,
-    0x02, 0x02, 0x02, 0x19,
-    0x02, 0x0F, 0x16, 0x1C,
-    0x02, 0x08, 0x16, 0x1C,
-    0x02, 0x08, 0x0F, 0x1C,
-    0x02, 0x1C, 0x1C, 0x1C,
-    0x02, 0x02, 0x1C, 0x1C,
-    0x02, 0x02, 0x02, 0x1C,
-    0x02, 0x10, 0x18, 0x1F,
-    0x02, 0x09, 0x18, 0x1F,
-    0x02, 0x09, 0x11, 0x1F,
-    0x02, 0x1F, 0x1F, 0x1F,
-    0x02, 0x02, 0x1F, 0x1F,
-    0x02, 0x02, 0x02, 0x1F,
-    0x02, 0x12, 0x1A, 0x22,
-    0x02, 0x0A, 0x1A, 0x22,
-    0x02, 0x0A, 0x12, 0x22,
-    0x02, 0x22, 0x22, 0x22,
-    0x02, 0x02, 0x22, 0x22,
-    0x02, 0x02, 0x02, 0x22,
-    0x02, 0x25, 0x25, 0x25,
-    0x02, 0x02, 0x25, 0x25,
-    0x02, 0x02, 0x02, 0x25,
-    0x02, 0x14, 0x1D, 0x26,
-    0x02, 0x0B, 0x1D, 0x26,
-    0x02, 0x0B, 0x14, 0x26,
-    0x02, 0x2A, 0x2A, 0x2A,
-    0x02, 0x02, 0x2A, 0x2A,
-    0x02, 0x02, 0x02, 0x2A,
-    0x02, 0x30, 0x30, 0x30,
-    0x02, 0x02, 0x30, 0x30,
-    0x02, 0x02, 0x02, 0x30,
-    0x03, 0x04, 0x04, 0x05,
-    0x03, 0x04, 0x05, 0x06,
-    0x03, 0x05, 0x06, 0x07,
-    0x03, 0x04, 0x06, 0x07,
-    0x03, 0x04, 0x05, 0x07,
-    0x03, 0x05, 0x06, 0x08,
-    0x03, 0x05, 0x07, 0x08,
-    0x03, 0x04, 0x07, 0x08,
-    0x03, 0x04, 0x06, 0x08,
-    0x03, 0x05, 0x07, 0x09,
-    0x03, 0x06, 0x08, 0x09,
-    0x03, 0x04, 0x08, 0x09,
-    0x03, 0x04, 0x06, 0x09,
-    0x03, 0x09, 0x09, 0x09,
-    0x03, 0x03, 0x09, 0x09,
-    0x03, 0x03, 0x03, 0x09,
-    0x03, 0x06, 0x07, 0x0A,
-    0x03, 0x06, 0x09, 0x0A,
-    0x03, 0x04, 0x09, 0x0A,
-    0x03, 0x04, 0x07, 0x0A,
-    0x03, 0x06, 0x08, 0x0B,
-    0x03, 0x07, 0x09, 0x0B,
-    0x03, 0x05, 0x09, 0x0B,
-    0x03, 0x05, 0x07, 0x0B,
-    0x03, 0x0B, 0x0B, 0x0B,
-    0x03, 0x03, 0x0B, 0x0B,
-    0x03, 0x03, 0x03, 0x0B,
-    0x03, 0x07, 0x0A, 0x0E,
-    0x03, 0x08, 0x0C, 0x0E,
-    0x03, 0x05, 0x0C, 0x0E,
-    0x03, 0x05, 0x09, 0x0E,
-    0x03, 0x0E, 0x0E, 0x0E,
-    0x03, 0x03, 0x0E, 0x0E,
-    0x03, 0x03, 0x03, 0x0E,
-    0x03, 0x08, 0x0C, 0x11,
-    0x03, 0x0A, 0x0E, 0x11,
-    0x03, 0x06, 0x0E, 0x11,
-    0x03, 0x06, 0x0A, 0x11,
-    0x03, 0x11, 0x11, 0x11,
-    0x03, 0x03, 0x11, 0x11,
-    0x03, 0x03, 0x03, 0x11,
-    0x03, 0x09, 0x0E, 0x14,
-    0x03, 0x0B, 0x10, 0x14,
-    0x03, 0x07, 0x10, 0x14,
-    0x03, 0x07, 0x0C, 0x14,
-    0x03, 0x14, 0x14, 0x14,
-    0x03, 0x03, 0x14, 0x14,
-    0x03, 0x03, 0x03, 0x14,
-    0x03, 0x0A, 0x10, 0x17,
-    0x03, 0x0D, 0x12, 0x17,
-    0x03, 0x08, 0x12, 0x17,
-    0x03, 0x08, 0x0D, 0x17,
-    0x03, 0x17, 0x17, 0x17,
-    0x03, 0x03, 0x17, 0x17,
-    0x03, 0x03, 0x03, 0x17,
-    0x03, 0x0E, 0x15, 0x1A,
-    0x03, 0x08, 0x15, 0x1A,
-    0x03, 0x08, 0x0F, 0x1A,
-    0x03, 0x1A, 0x1A, 0x1A,
-    0x03, 0x03, 0x1A, 0x1A,
-    0x03, 0x03, 0x03, 0x1A,
-    0x03, 0x10, 0x17, 0x1D,
-    0x03, 0x09, 0x17, 0x1D,
-    0x03, 0x09, 0x10, 0x1D,
-    0x03, 0x1D, 0x1D, 0x1D,
-    0x03, 0x03, 0x1D, 0x1D,
-    0x03, 0x03, 0x03, 0x1D,
-    0x03, 0x11, 0x19, 0x20,
-    0x03, 0x0A, 0x19, 0x20,
-    0x03, 0x0A, 0x12, 0x20,
-    0x03, 0x20, 0x20, 0x20,
-    0x03, 0x03, 0x20, 0x20,
-    0x03, 0x03, 0x03, 0x20,
-    0x03, 0x13, 0x1B, 0x23,
-    0x03, 0x0B, 0x1B, 0x23,
-    0x03, 0x0B, 0x13, 0x23,
-    0x03, 0x23, 0x23, 0x23,
-    0x03, 0x03, 0x23, 0x23,
-    0x03, 0x03, 0x03, 0x23,
-    0x03, 0x26, 0x26, 0x26,
-    0x03, 0x03, 0x26, 0x26,
-    0x03, 0x03, 0x03, 0x26,
-    0x03, 0x15, 0x1E, 0x27,
-    0x03, 0x0C, 0x1E, 0x27,
-    0x03, 0x0C, 0x15, 0x27,
-    0x03, 0x2B, 0x2B, 0x2B,
-    0x03, 0x03, 0x2B, 0x2B,
-    0x03, 0x03, 0x03, 0x2B,
-    0x03, 0x31, 0x31, 0x31,
-    0x03, 0x03, 0x31, 0x31,
-    0x03, 0x03, 0x03, 0x31,
-    0x04, 0x05, 0x05, 0x06,
-    0x04, 0x05, 0x06, 0x07,
-    0x04, 0x06, 0x07, 0x08,
-    0x04, 0x05, 0x07, 0x08,
-    0x04, 0x05, 0x06, 0x08,
-    0x04, 0x06, 0x07, 0x09,
-    0x04, 0x06, 0x08, 0x09,
-    0x04, 0x05, 0x08, 0x09,
-    0x04, 0x05, 0x07, 0x09,
-    0x04, 0x06, 0x08, 0x0A,
-    0x04, 0x07, 0x09, 0x0A,
-    0x04, 0x05, 0x09, 0x0A,
-    0x04, 0x05, 0x07, 0x0A,
-    0x04, 0x0A, 0x0A, 0x0A,
-    0x04, 0x04, 0x0A, 0x0A,
-    0x04, 0x04, 0x04, 0x0A,
-    0x04, 0x07, 0x08, 0x0B,
-    0x04, 0x07, 0x0A, 0x0B,
-    0x04, 0x05, 0x0A, 0x0B,
-    0x04, 0x05, 0x08, 0x0B,
-    0x04, 0x07, 0x09, 0x0C,
-    0x04, 0x08, 0x0A, 0x0C,
-    0x04, 0x06, 0x0A, 0x0C,
-    0x04, 0x06, 0x08, 0x0C,
-    0x04, 0x0C, 0x0C, 0x0C,
-    0x04, 0x04, 0x0C, 0x0C,
-    0x04, 0x04, 0x04, 0x0C,
-    0x04, 0x08, 0x0B, 0x0F,
-    0x04, 0x09, 0x0D, 0x0F,
-    0x04, 0x06, 0x0D, 0x0F,
-    0x04, 0x06, 0x0A, 0x0F,
-    0x04, 0x0F, 0x0F, 0x0F,
-    0x04, 0x04, 0x0F, 0x0F,
-    0x04, 0x04, 0x04, 0x0F,
-    0x04, 0x09, 0x0D, 0x12,
-    0x04, 0x0B, 0x0F, 0x12,
-    0x04, 0x07, 0x0F, 0x12,
-    0x04, 0x07, 0x0B, 0x12,
-    0x04, 0x12, 0x12, 0x12,
-    0x04, 0x04, 0x12, 0x12,
-    0x04, 0x04, 0x04, 0x12,
-    0x04, 0x0A, 0x0F, 0x15,
-    0x04, 0x0C, 0x11, 0x15,
-    0x04, 0x08, 0x11, 0x15,
-    0x04, 0x08, 0x0D, 0x15,
-    0x04, 0x15, 0x15, 0x15,
-    0x04, 0x04, 0x15, 0x15,
-    0x04, 0x04, 0x04, 0x15,
-    0x04, 0x0B, 0x11, 0x18,
-    0x04, 0x0E, 0x13, 0x18,
-    0x04, 0x09, 0x13, 0x18,
-    0x04, 0x09, 0x0E, 0x18,
-    0x04, 0x18, 0x18, 0x18,
-    0x04, 0x04, 0x18, 0x18,
-    0x04, 0x04, 0x04, 0x18,
-    0x04, 0x0F, 0x16, 0x1B,
-    0x04, 0x09, 0x16, 0x1B,
-    0x04, 0x09, 0x10, 0x1B,
-    0x04, 0x1B, 0x1B, 0x1B,
-    0x04, 0x04, 0x1B, 0x1B,
-    0x04, 0x04, 0x04, 0x1B,
-    0x04, 0x11, 0x18, 0x1E,
-    0x04, 0x0A, 0x18, 0x1E,
-    0x04, 0x0A, 0x11, 0x1E,
-    0x04, 0x1E, 0x1E, 0x1E,
-    0x04, 0x04, 0x1E, 0x1E,
-    0x04, 0x04, 0x04, 0x1E,
-    0x04, 0x12, 0x1A, 0x21,
-    0x04, 0x0B, 0x1A, 0x21,
-    0x04, 0x0B, 0x13, 0x21,
-    0x04, 0x21, 0x21, 0x21,
-    0x04, 0x04, 0x21, 0x21,
-    0x04, 0x04, 0x04, 0x21,
-    0x04, 0x14, 0x1C, 0x24,
-    0x04, 0x0C, 0x1C, 0x24,
-    0x04, 0x0C, 0x14, 0x24,
-    0x04, 0x24, 0x24, 0x24,
-    0x04, 0x04, 0x24, 0x24,
-    0x04, 0x04, 0x04, 0x24,
-    0x04, 0x27, 0x27, 0x27,
-    0x04, 0x04, 0x27, 0x27,
-    0x04, 0x04, 0x04, 0x27,
-    0x04, 0x16, 0x1F, 0x28,
-    0x04, 0x0D, 0x1F, 0x28,
-    0x04, 0x0D, 0x16, 0x28,
-    0x04, 0x2C, 0x2C, 0x2C,
-    0x04, 0x04, 0x2C, 0x2C,
-    0x04, 0x04, 0x04, 0x2C,
-    0x04, 0x32, 0x32, 0x32,
-    0x04, 0x04, 0x32, 0x32,
-    0x04, 0x04, 0x04, 0x32,
-    0x05, 0x06, 0x06, 0x07,
-    0x05, 0x06, 0x07, 0x08,
-    0x05, 0x07, 0x08, 0x09,
-    0x05, 0x06, 0x08, 0x09,
-    0x05, 0x06, 0x07, 0x09,
-    0x05, 0x07, 0x08, 0x0A,
-    0x05, 0x07, 0x09, 0x0A,
-    0x05, 0x06, 0x09, 0x0A,
-    0x05, 0x06, 0x08, 0x0A,
-    0x05, 0x07, 0x09, 0x0B,
-    0x05, 0x08, 0x0A, 0x0B,
-    0x05, 0x06, 0x0A, 0x0B,
-    0x05, 0x06, 0x08, 0x0B,
-    0x05, 0x0B, 0x0B, 0x0B,
-    0x05, 0x05, 0x0B, 0x0B,
-    0x05, 0x05, 0x05, 0x0B,
-    0x05, 0x08, 0x09, 0x0C,
-    0x05, 0x08, 0x0B, 0x0C,
-    0x05, 0x06, 0x0B, 0x0C,
-    0x05, 0x06, 0x09, 0x0C,
-    0x05, 0x08, 0x0A, 0x0D,
-    0x05, 0x09, 0x0B, 0x0D,
-    0x05, 0x07, 0x0B, 0x0D,
-    0x05, 0x07, 0x09, 0x0D,
-    0x05, 0x0D, 0x0D, 0x0D,
-    0x05, 0x05, 0x0D, 0x0D,
-    0x05, 0x05, 0x05, 0x0D,
-    0x05, 0x09, 0x0C, 0x10,
-    0x05, 0x0A, 0x0E, 0x10,
-    0x05, 0x07, 0x0E, 0x10,
-    0x05, 0x07, 0x0B, 0x10,
-    0x05, 0x10, 0x10, 0x10,
-    0x05, 0x05, 0x10, 0x10,
-    0x05, 0x05, 0x05, 0x10,
-    0x05, 0x0A, 0x0E, 0x13,
-    0x05, 0x0C, 0x10, 0x13,
-    0x05, 0x08, 0x10, 0x13,
-    0x05, 0x08, 0x0C, 0x13,
-    0x05, 0x13, 0x13, 0x13,
-    0x05, 0x05, 0x13, 0x13,
-    0x05, 0x05, 0x05, 0x13,
-    0x05, 0x0B, 0x10, 0x16,
-    0x05, 0x0D, 0x12, 0x16,
-    0x05, 0x09, 0x12, 0x16,
-    0x05, 0x09, 0x0E, 0x16,
-    0x05, 0x16, 0x16, 0x16,
-    0x05, 0x05, 0x16, 0x16,
-    0x05, 0x05, 0x05, 0x16,
-    0x05, 0x0C, 0x12, 0x19,
-    0x05, 0x0F, 0x14, 0x19,
-    0x05, 0x0A, 0x14, 0x19,
-    0x05, 0x0A, 0x0F, 0x19,
-    0x05, 0x19, 0x19, 0x19,
-    0x05, 0x05, 0x19, 0x19,
-    0x05, 0x05, 0x05, 0x19,
-    0x05, 0x10, 0x17, 0x1C,
-    0x05, 0x0A, 0x17, 0x1C,
-    0x05, 0x0A, 0x11, 0x1C,
-    0x05, 0x1C, 0x1C, 0x1C,
-    0x05, 0x05, 0x1C, 0x1C,
-    0x05, 0x05, 0x05, 0x1C,
-    0x05, 0x12, 0x19, 0x1F,
-    0x05, 0x0B, 0x19, 0x1F,
-    0x05, 0x0B, 0x12, 0x1F,
-    0x05, 0x1F, 0x1F, 0x1F,
-    0x05, 0x05, 0x1F, 0x1F,
-    0x05, 0x05, 0x05, 0x1F,
-    0x05, 0x13, 0x1B, 0x22,
-    0x05, 0x0C, 0x1B, 0x22,
-    0x05, 0x0C, 0x14, 0x22,
-    0x05, 0x22, 0x22, 0x22,
-    0x05, 0x05, 0x22, 0x22,
-    0x05, 0x05, 0x05, 0x22,
-    0x05, 0x15, 0x1D, 0x25,
-    0x05, 0x0D, 0x1D, 0x25,
-    0x05, 0x0D, 0x15, 0x25,
-    0x05, 0x25, 0x25, 0x25,
-    0x05, 0x05, 0x25, 0x25,
-    0x05, 0x05, 0x05, 0x25,
-    0x05, 0x28, 0x28, 0x28,
-    0x05, 0x05, 0x28, 0x28,
-    0x05, 0x05, 0x05, 0x28,
-    0x05, 0x17, 0x20, 0x29,
-    0x05, 0x0E, 0x20, 0x29,
-    0x05, 0x0E, 0x17, 0x29,
-    0x05, 0x2D, 0x2D, 0x2D,
-    0x05, 0x05, 0x2D, 0x2D,
-    0x05, 0x05, 0x05, 0x2D,
-    0x05, 0x33, 0x33, 0x33,
-    0x05, 0x05, 0x33, 0x33,
-    0x05, 0x05, 0x05, 0x33,
-    0x06, 0x07, 0x07, 0x08,
-    0x06, 0x07, 0x08, 0x09,
-    0x06, 0x08, 0x09, 0x0A,
-    0x06, 0x07, 0x09, 0x0A,
-    0x06, 0x07, 0x08, 0x0A,
-    0x06, 0x08, 0x09, 0x0B,
-    0x06, 0x08, 0x0A, 0x0B,
-    0x06, 0x07, 0x0A, 0x0B,
-    0x06, 0x07, 0x09, 0x0B,
-    0x06, 0x08, 0x0A, 0x0C,
-    0x06, 0x09, 0x0B, 0x0C,
-    0x06, 0x07, 0x0B, 0x0C,
-    0x06, 0x07, 0x09, 0x0C,
-    0x06, 0x0C, 0x0C, 0x0C,
-    0x06, 0x06, 0x0C, 0x0C,
-    0x06, 0x06, 0x06, 0x0C,
-    0x06, 0x09, 0x0A, 0x0D,
-    0x06, 0x09, 0x0C, 0x0D,
-    0x06, 0x07, 0x0C, 0x0D,
-    0x06, 0x07, 0x0A, 0x0D,
-    0x06, 0x09, 0x0B, 0x0E,
-    0x06, 0x0A, 0x0C, 0x0E,
-    0x06, 0x08, 0x0C, 0x0E,
-    0x06, 0x08, 0x0A, 0x0E,
-    0x06, 0x0E, 0x0E, 0x0E,
-    0x06, 0x06, 0x0E, 0x0E,
-    0x06, 0x06, 0x06, 0x0E,
-    0x06, 0x0A, 0x0D, 0x11,
-    0x06, 0x0B, 0x0F, 0x11,
-    0x06, 0x08, 0x0F, 0x11,
-    0x06, 0x08, 0x0C, 0x11,
-    0x06, 0x11, 0x11, 0x11,
-    0x06, 0x06, 0x11, 0x11,
-    0x06, 0x06, 0x06, 0x11,
-    0x06, 0x0B, 0x0F, 0x14,
-    0x06, 0x0D, 0x11, 0x14,
-    0x06, 0x09, 0x11, 0x14,
-    0x06, 0x09, 0x0D, 0x14,
-    0x06, 0x14, 0x14, 0x14,
-    0x06, 0x06, 0x14, 0x14,
-    0x06, 0x06, 0x06, 0x14,
-    0x06, 0x0C, 0x11, 0x17,
-    0x06, 0x0E, 0x13, 0x17,
-    0x06, 0x0A, 0x13, 0x17,
-    0x06, 0x0A, 0x0F, 0x17,
-    0x06, 0x17, 0x17, 0x17,
-    0x06, 0x06, 0x17, 0x17,
-    0x06, 0x06, 0x06, 0x17,
-    0x06, 0x0D, 0x13, 0x1A,
-    0x06, 0x10, 0x15, 0x1A,
-    0x06, 0x0B, 0x15, 0x1A,
-    0x06, 0x0B, 0x10, 0x1A,
-    0x06, 0x1A, 0x1A, 0x1A,
-    0x06, 0x06, 0x1A, 0x1A,
-    0x06, 0x06, 0x06, 0x1A,
-    0x06, 0x11, 0x18, 0x1D,
-    0x06, 0x0B, 0x18, 0x1D,
-    0x06, 0x0B, 0x12, 0x1D,
-    0x06, 0x1D, 0x1D, 0x1D,
-    0x06, 0x06, 0x1D, 0x1D,
-    0x06, 0x06, 0x06, 0x1D,
-    0x06, 0x13, 0x1A, 0x20,
-    0x06, 0x0C, 0x1A, 0x20,
-    0x06, 0x0C, 0x13, 0x20,
-    0x06, 0x20, 0x20, 0x20,
-    0x06, 0x06, 0x20, 0x20,
-    0x06, 0x06, 0x06, 0x20,
-    0x06, 0x14, 0x1C, 0x23,
-    0x06, 0x0D, 0x1C, 0x23,
-    0x06, 0x0D, 0x15, 0x23,
-    0x06, 0x23, 0x23, 0x23,
-    0x06, 0x06, 0x23, 0x23,
-    0x06, 0x06, 0x06, 0x23,
-    0x06, 0x16, 0x1E, 0x26,
-    0x06, 0x0E, 0x1E, 0x26,
-    0x06, 0x0E, 0x16, 0x26,
-    0x06, 0x26, 0x26, 0x26,
-    0x06, 0x06, 0x26, 0x26,
-    0x06, 0x06, 0x06, 0x26,
-    0x06, 0x29, 0x29, 0x29,
-    0x06, 0x06, 0x29, 0x29,
-    0x06, 0x06, 0x06, 0x29,
-    0x06, 0x18, 0x21, 0x2A,
-    0x06, 0x0F, 0x21, 0x2A,
-    0x06, 0x0F, 0x18, 0x2A,
-    0x06, 0x2E, 0x2E, 0x2E,
-    0x06, 0x06, 0x2E, 0x2E,
-    0x06, 0x06, 0x06, 0x2E,
-    0x06, 0x34, 0x34, 0x34,
-    0x06, 0x06, 0x34, 0x34,
-    0x06, 0x06, 0x06, 0x34,
-    0x07, 0x08, 0x08, 0x09,
-    0x07, 0x08, 0x09, 0x0A,
-    0x07, 0x09, 0x0A, 0x0B,
-    0x07, 0x08, 0x0A, 0x0B,
-    0x07, 0x08, 0x09, 0x0B,
-    0x07, 0x09, 0x0A, 0x0C,
-    0x07, 0x09, 0x0B, 0x0C,
-    0x07, 0x08, 0x0B, 0x0C,
-    0x07, 0x08, 0x0A, 0x0C,
-    0x07, 0x09, 0x0B, 0x0D,
-    0x07, 0x0A, 0x0C, 0x0D,
-    0x07, 0x08, 0x0C, 0x0D,
-    0x07, 0x08, 0x0A, 0x0D,
-    0x07, 0x0D, 0x0D, 0x0D,
-    0x07, 0x07, 0x0D, 0x0D,
-    0x07, 0x07, 0x07, 0x0D,
-    0x07, 0x0A, 0x0B, 0x0E,
-    0x07, 0x0A, 0x0D, 0x0E,
-    0x07, 0x08, 0x0D, 0x0E,
-    0x07, 0x08, 0x0B, 0x0E,
-    0x07, 0x0A, 0x0C, 0x0F,
-    0x07, 0x0B, 0x0D, 0x0F,
-    0x07, 0x09, 0x0D, 0x0F,
-    0x07, 0x09, 0x0B, 0x0F,
-    0x07, 0x0F, 0x0F, 0x0F,
-    0x07, 0x07, 0x0F, 0x0F,
-    0x07, 0x07, 0x07, 0x0F,
-    0x07, 0x0B, 0x0E, 0x12,
-    0x07, 0x0C, 0x10, 0x12,
-    0x07, 0x09, 0x10, 0x12,
-    0x07, 0x09, 0x0D, 0x12,
-    0x07, 0x12, 0x12, 0x12,
-    0x07, 0x07, 0x12, 0x12,
-    0x07, 0x07, 0x07, 0x12,
-    0x07, 0x0C, 0x10, 0x15,
-    0x07, 0x0E, 0x12, 0x15,
-    0x07, 0x0A, 0x12, 0x15,
-    0x07, 0x0A, 0x0E, 0x15,
-    0x07, 0x15, 0x15, 0x15,
-    0x07, 0x07, 0x15, 0x15,
-    0x07, 0x07, 0x07, 0x15,
-    0x07, 0x0D, 0x12, 0x18,
-    0x07, 0x0F, 0x14, 0x18,
-    0x07, 0x0B, 0x14, 0x18,
-    0x07, 0x0B, 0x10, 0x18,
-    0x07, 0x18, 0x18, 0x18,
-    0x07, 0x07, 0x18, 0x18,
-    0x07, 0x07, 0x07, 0x18,
-    0x07, 0x0E, 0x14, 0x1B,
-    0x07, 0x11, 0x16, 0x1B,
-    0x07, 0x0C, 0x16, 0x1B,
-    0x07, 0x0C, 0x11, 0x1B,
-    0x07, 0x1B, 0x1B, 0x1B,
-    0x07, 0x07, 0x1B, 0x1B,
-    0x07, 0x07, 0x07, 0x1B,
-    0x07, 0x12, 0x19, 0x1E,
-    0x07, 0x0C, 0x19, 0x1E,
-    0x07, 0x0C, 0x13, 0x1E,
-    0x07, 0x1E, 0x1E, 0x1E,
-    0x07, 0x07, 0x1E, 0x1E,
-    0x07, 0x07, 0x07, 0x1E,
-    0x07, 0x14, 0x1B, 0x21,
-    0x07, 0x0D, 0x1B, 0x21,
-    0x07, 0x0D, 0x14, 0x21,
-    0x07, 0x21, 0x21, 0x21,
-    0x07, 0x07, 0x21, 0x21,
-    0x07, 0x07, 0x07, 0x21,
-    0x07, 0x15, 0x1D, 0x24,
-    0x07, 0x0E, 0x1D, 0x24,
-    0x07, 0x0E, 0x16, 0x24,
-    0x07, 0x24, 0x24, 0x24,
-    0x07, 0x07, 0x24, 0x24,
-    0x07, 0x07, 0x07, 0x24,
-    0x07, 0x17, 0x1F, 0x27,
-    0x07, 0x0F, 0x1F, 0x27,
-    0x07, 0x0F, 0x17, 0x27,
-    0x07, 0x27, 0x27, 0x27,
-    0x07, 0x07, 0x27, 0x27,
-    0x07, 0x07, 0x07, 0x27,
-    0x07, 0x2A, 0x2A, 0x2A,
-    0x07, 0x07, 0x2A, 0x2A,
-    0x07, 0x07, 0x07, 0x2A,
-    0x07, 0x19, 0x22, 0x2B,
-    0x07, 0x10, 0x22, 0x2B,
-    0x07, 0x10, 0x19, 0x2B,
-    0x07, 0x2F, 0x2F, 0x2F,
-    0x07, 0x07, 0x2F, 0x2F,
-    0x07, 0x07, 0x07, 0x2F,
-    0x07, 0x35, 0x35, 0x35,
-    0x07, 0x07, 0x35, 0x35,
-    0x07, 0x07, 0x07, 0x35,
-    0x08, 0x09, 0x09, 0x0A,
-    0x08, 0x09, 0x0A, 0x0B,
-    0x08, 0x0A, 0x0B, 0x0C,
-    0x08, 0x09, 0x0B, 0x0C,
-    0x08, 0x09, 0x0A, 0x0C,
-    0x08, 0x0A, 0x0B, 0x0D,
-    0x08, 0x0A, 0x0C, 0x0D,
-    0x08, 0x09, 0x0C, 0x0D,
-    0x08, 0x09, 0x0B, 0x0D,
-    0x08, 0x0A, 0x0C, 0x0E,
-    0x08, 0x0B, 0x0D, 0x0E,
-    0x08, 0x09, 0x0D, 0x0E,
-    0x08, 0x09, 0x0B, 0x0E,
-    0x08, 0x0E, 0x0E, 0x0E,
-    0x08, 0x08, 0x0E, 0x0E,
-    0x08, 0x08, 0x08, 0x0E,
-    0x08, 0x0B, 0x0C, 0x0F,
-    0x08, 0x0B, 0x0E, 0x0F,
-    0x08, 0x09, 0x0E, 0x0F,
-    0x08, 0x09, 0x0C, 0x0F,
-    0x08, 0x0B, 0x0D, 0x10,
-    0x08, 0x0C, 0x0E, 0x10,
-    0x08, 0x0A, 0x0E, 0x10,
-    0x08, 0x0A, 0x0C, 0x10,
-    0x08, 0x10, 0x10, 0x10,
-    0x08, 0x08, 0x10, 0x10,
-    0x08, 0x08, 0x08, 0x10,
-    0x08, 0x0C, 0x0F, 0x13,
-    0x08, 0x0D, 0x11, 0x13,
-    0x08, 0x0A, 0x11, 0x13,
-    0x08, 0x0A, 0x0E, 0x13,
-    0x08, 0x13, 0x13, 0x13,
-    0x08, 0x08, 0x13, 0x13,
-    0x08, 0x08, 0x08, 0x13,
-    0x08, 0x0D, 0x11, 0x16,
-    0x08, 0x0F, 0x13, 0x16,
-    0x08, 0x0B, 0x13, 0x16,
-    0x08, 0x0B, 0x0F, 0x16,
-    0x08, 0x16, 0x16, 0x16,
-    0x08, 0x08, 0x16, 0x16,
-    0x08, 0x08, 0x08, 0x16,
-    0x08, 0x0E, 0x13, 0x19,
-    0x08, 0x10, 0x15, 0x19,
-    0x08, 0x0C, 0x15, 0x19,
-    0x08, 0x0C, 0x11, 0x19,
-    0x08, 0x19, 0x19, 0x19,
-    0x08, 0x08, 0x19, 0x19,
-    0x08, 0x08, 0x08, 0x19,
-    0x08, 0x0F, 0x15, 0x1C,
-    0x08, 0x12, 0x17, 0x1C,
-    0x08, 0x0D, 0x17, 0x1C,
-    0x08, 0x0D, 0x12, 0x1C,
-    0x08, 0x1C, 0x1C, 0x1C,
-    0x08, 0x08, 0x1C, 0x1C,
-    0x08, 0x08, 0x08, 0x1C,
-    0x08, 0x13, 0x1A, 0x1F,
-    0x08, 0x0D, 0x1A, 0x1F,
-    0x08, 0x0D, 0x14, 0x1F,
-    0x08, 0x1F, 0x1F, 0x1F,
-    0x08, 0x08, 0x1F, 0x1F,
-    0x08, 0x08, 0x08, 0x1F,
-    0x08, 0x15, 0x1C, 0x22,
-    0x08, 0x0E, 0x1C, 0x22,
-    0x08, 0x0E, 0x15, 0x22,
-    0x08, 0x22, 0x22, 0x22,
-    0x08, 0x08, 0x22, 0x22,
-    0x08, 0x08, 0x08, 0x22,
-    0x08, 0x16, 0x1E, 0x25,
-    0x08, 0x0F, 0x1E, 0x25,
-    0x08, 0x0F, 0x17, 0x25,
-    0x08, 0x25, 0x25, 0x25,
-    0x08, 0x08, 0x25, 0x25,
-    0x08, 0x08, 0x08, 0x25,
-    0x08, 0x18, 0x20, 0x28,
-    0x08, 0x10, 0x20, 0x28,
-    0x08, 0x10, 0x18, 0x28,
-    0x08, 0x28, 0x28, 0x28,
-    0x08, 0x08, 0x28, 0x28,
-    0x08, 0x08, 0x08, 0x28,
-    0x08, 0x2B, 0x2B, 0x2B,
-    0x08, 0x08, 0x2B, 0x2B,
-    0x08, 0x08, 0x08, 0x2B,
-    0x08, 0x1A, 0x23, 0x2C,
-    0x08, 0x11, 0x23, 0x2C,
-    0x08, 0x11, 0x1A, 0x2C,
-    0x08, 0x30, 0x30, 0x30,
-    0x08, 0x08, 0x30, 0x30,
-    0x08, 0x08, 0x08, 0x30,
-    0x08, 0x36, 0x36, 0x36,
-    0x08, 0x08, 0x36, 0x36,
-    0x08, 0x08, 0x08, 0x36,
-    0x09, 0x0A, 0x0A, 0x0B,
-    0x09, 0x0A, 0x0B, 0x0C,
-    0x09, 0x0B, 0x0C, 0x0D,
-    0x09, 0x0A, 0x0C, 0x0D,
-    0x09, 0x0A, 0x0B, 0x0D,
-    0x09, 0x0B, 0x0C, 0x0E,
-    0x09, 0x0B, 0x0D, 0x0E,
-    0x09, 0x0A, 0x0D, 0x0E,
-    0x09, 0x0A, 0x0C, 0x0E,
-    0x09, 0x0B, 0x0D, 0x0F,
-    0x09, 0x0C, 0x0E, 0x0F,
-    0x09, 0x0A, 0x0E, 0x0F,
-    0x09, 0x0A, 0x0C, 0x0F,
-    0x09, 0x0F, 0x0F, 0x0F,
-    0x09, 0x09, 0x0F, 0x0F,
-    0x09, 0x09, 0x09, 0x0F,
-    0x09, 0x0C, 0x0D, 0x10,
-    0x09, 0x0C, 0x0F, 0x10,
-    0x09, 0x0A, 0x0F, 0x10,
-    0x09, 0x0A, 0x0D, 0x10,
-    0x09, 0x0C, 0x0E, 0x11,
-    0x09, 0x0D, 0x0F, 0x11,
-    0x09, 0x0B, 0x0F, 0x11,
-    0x09, 0x0B, 0x0D, 0x11,
-    0x09, 0x11, 0x11, 0x11,
-    0x09, 0x09, 0x11, 0x11,
-    0x09, 0x09, 0x09, 0x11,
-    0x09, 0x0D, 0x10, 0x14,
-    0x09, 0x0E, 0x12, 0x14,
-    0x09, 0x0B, 0x12, 0x14,
-    0x09, 0x0B, 0x0F, 0x14,
-    0x09, 0x14, 0x14, 0x14,
-    0x09, 0x09, 0x14, 0x14,
-    0x09, 0x09, 0x09, 0x14,
-    0x09, 0x0E, 0x12, 0x17,
-    0x09, 0x10, 0x14, 0x17,
-    0x09, 0x0C, 0x14, 0x17,
-    0x09, 0x0C, 0x10, 0x17,
-    0x09, 0x17, 0x17, 0x17,
-    0x09, 0x09, 0x17, 0x17,
-    0x09, 0x09, 0x09, 0x17,
-    0x09, 0x0F, 0x14, 0x1A,
-    0x09, 0x11, 0x16, 0x1A,
-    0x09, 0x0D, 0x16, 0x1A,
-    0x09, 0x0D, 0x12, 0x1A,
-    0x09, 0x1A, 0x1A, 0x1A,
-    0x09, 0x09, 0x1A, 0x1A,
-    0x09, 0x09, 0x09, 0x1A,
-    0x09, 0x10, 0x16, 0x1D,
-    0x09, 0x13, 0x18, 0x1D,
-    0x09, 0x0E, 0x18, 0x1D,
-    0x09, 0x0E, 0x13, 0x1D,
-    0x09, 0x1D, 0x1D, 0x1D,
-    0x09, 0x09, 0x1D, 0x1D,
-    0x09, 0x09, 0x09, 0x1D,
-    0x09, 0x14, 0x1B, 0x20,
-    0x09, 0x0E, 0x1B, 0x20,
-    0x09, 0x0E, 0x15, 0x20,
-    0x09, 0x20, 0x20, 0x20,
-    0x09, 0x09, 0x20, 0x20,
-    0x09, 0x09, 0x09, 0x20,
-    0x09, 0x16, 0x1D, 0x23,
-    0x09, 0x0F, 0x1D, 0x23,
-    0x09, 0x0F, 0x16, 0x23,
-    0x09, 0x23, 0x23, 0x23,
-    0x09, 0x09, 0x23, 0x23,
-    0x09, 0x09, 0x09, 0x23,
-    0x09, 0x17, 0x1F, 0x26,
-    0x09, 0x10, 0x1F, 0x26,
-    0x09, 0x10, 0x18, 0x26,
-    0x09, 0x26, 0x26, 0x26,
-    0x09, 0x09, 0x26, 0x26,
-    0x09, 0x09, 0x09, 0x26,
-    0x09, 0x19, 0x21, 0x29,
-    0x09, 0x11, 0x21, 0x29,
-    0x09, 0x11, 0x19, 0x29,
-    0x09, 0x29, 0x29, 0x29,
-    0x09, 0x09, 0x29, 0x29,
-    0x09, 0x09, 0x09, 0x29,
-    0x09, 0x2C, 0x2C, 0x2C,
-    0x09, 0x09, 0x2C, 0x2C,
-    0x09, 0x09, 0x09, 0x2C,
-    0x09, 0x1B, 0x24, 0x2D,
-    0x09, 0x12, 0x24, 0x2D,
-    0x09, 0x12, 0x1B, 0x2D,
-    0x09, 0x31, 0x31, 0x31,
-    0x09, 0x09, 0x31, 0x31,
-    0x09, 0x09, 0x09, 0x31,
-    0x09, 0x37, 0x37, 0x37,
-    0x09, 0x09, 0x37, 0x37,
-    0x09, 0x09, 0x09, 0x37,
-    0x0A, 0x0B, 0x0B, 0x0C,
-    0x0A, 0x0B, 0x0C, 0x0D,
-    0x0A, 0x0C, 0x0D, 0x0E,
-    0x0A, 0x0B, 0x0D, 0x0E,
-    0x0A, 0x0B, 0x0C, 0x0E,
-    0x0A, 0x0C, 0x0D, 0x0F,
-    0x0A, 0x0C, 0x0E, 0x0F,
-    0x0A, 0x0B, 0x0E, 0x0F,
-    0x0A, 0x0B, 0x0D, 0x0F,
-    0x0A, 0x0C, 0x0E, 0x10,
-    0x0A, 0x0D, 0x0F, 0x10,
-    0x0A, 0x0B, 0x0F, 0x10,
-    0x0A, 0x0B, 0x0D, 0x10,
-    0x0A, 0x10, 0x10, 0x10,
-    0x0A, 0x0A, 0x10, 0x10,
-    0x0A, 0x0A, 0x0A, 0x10,
-    0x0A, 0x0D, 0x0E, 0x11,
-    0x0A, 0x0D, 0x10, 0x11,
-    0x0A, 0x0B, 0x10, 0x11,
-    0x0A, 0x0B, 0x0E, 0x11,
-    0x0A, 0x0D, 0x0F, 0x12,
-    0x0A, 0x0E, 0x10, 0x12,
-    0x0A, 0x0C, 0x10, 0x12,
-    0x0A, 0x0C, 0x0E, 0x12,
-    0x0A, 0x12, 0x12, 0x12,
-    0x0A, 0x0A, 0x12, 0x12,
-    0x0A, 0x0A, 0x0A, 0x12,
-    0x0A, 0x0E, 0x11, 0x15,
-    0x0A, 0x0F, 0x13, 0x15,
-    0x0A, 0x0C, 0x13, 0x15,
-    0x0A, 0x0C, 0x10, 0x15,
-    0x0A, 0x15, 0x15, 0x15,
-    0x0A, 0x0A, 0x15, 0x15,
-    0x0A, 0x0A, 0x0A, 0x15,
-    0x0A, 0x0F, 0x13, 0x18,
-    0x0A, 0x11, 0x15, 0x18,
-    0x0A, 0x0D, 0x15, 0x18,
-    0x0A, 0x0D, 0x11, 0x18,
-    0x0A, 0x18, 0x18, 0x18,
-    0x0A, 0x0A, 0x18, 0x18,
-    0x0A, 0x0A, 0x0A, 0x18,
-    0x0A, 0x10, 0x15, 0x1B,
-    0x0A, 0x12, 0x17, 0x1B,
-    0x0A, 0x0E, 0x17, 0x1B,
-    0x0A, 0x0E, 0x13, 0x1B,
-    0x0A, 0x1B, 0x1B, 0x1B,
-    0x0A, 0x0A, 0x1B, 0x1B,
-    0x0A, 0x0A, 0x0A, 0x1B,
-    0x0A, 0x11, 0x17, 0x1E,
-    0x0A, 0x14, 0x19, 0x1E,
-    0x0A, 0x0F, 0x19, 0x1E,
-    0x0A, 0x0F, 0x14, 0x1E,
-    0x0A, 0x1E, 0x1E, 0x1E,
-    0x0A, 0x0A, 0x1E, 0x1E,
-    0x0A, 0x0A, 0x0A, 0x1E,
-    0x0A, 0x15, 0x1C, 0x21,
-    0x0A, 0x0F, 0x1C, 0x21,
-    0x0A, 0x0F, 0x16, 0x21,
-    0x0A, 0x21, 0x21, 0x21,
-    0x0A, 0x0A, 0x21, 0x21,
-    0x0A, 0x0A, 0x0A, 0x21,
-    0x0A, 0x17, 0x1E, 0x24,
-    0x0A, 0x10, 0x1E, 0x24,
-    0x0A, 0x10, 0x17, 0x24,
-    0x0A, 0x24, 0x24, 0x24,
-    0x0A, 0x0A, 0x24, 0x24,
-    0x0A, 0x0A, 0x0A, 0x24,
-    0x0A, 0x18, 0x20, 0x27,
-    0x0A, 0x11, 0x20, 0x27,
-    0x0A, 0x11, 0x19, 0x27,
-    0x0A, 0x27, 0x27, 0x27,
-    0x0A, 0x0A, 0x27, 0x27,
-    0x0A, 0x0A, 0x0A, 0x27,
-    0x0A, 0x1A, 0x22, 0x2A,
-    0x0A, 0x12, 0x22, 0x2A,
-    0x0A, 0x12, 0x1A, 0x2A,
-    0x0A, 0x2A, 0x2A, 0x2A,
-    0x0A, 0x0A, 0x2A, 0x2A,
-    0x0A, 0x0A, 0x0A, 0x2A,
-    0x0A, 0x2D, 0x2D, 0x2D,
-    0x0A, 0x0A, 0x2D, 0x2D,
-    0x0A, 0x0A, 0x0A, 0x2D,
-    0x0A, 0x1C, 0x25, 0x2E,
-    0x0A, 0x13, 0x25, 0x2E,
-    0x0A, 0x13, 0x1C, 0x2E,
-    0x0A, 0x32, 0x32, 0x32,
-    0x0A, 0x0A, 0x32, 0x32,
-    0x0A, 0x0A, 0x0A, 0x32,
-    0x0A, 0x38, 0x38, 0x38,
-    0x0A, 0x0A, 0x38, 0x38,
-    0x0A, 0x0A, 0x0A, 0x38,
-    0x0B, 0x0C, 0x0C, 0x0D,
-    0x0B, 0x0C, 0x0D, 0x0E,
-    0x0B, 0x0D, 0x0E, 0x0F,
-    0x0B, 0x0C, 0x0E, 0x0F,
-    0x0B, 0x0C, 0x0D, 0x0F,
-    0x0B, 0x0D, 0x0E, 0x10,
-    0x0B, 0x0D, 0x0F, 0x10,
-    0x0B, 0x0C, 0x0F, 0x10,
-    0x0B, 0x0C, 0x0E, 0x10,
-    0x0B, 0x0D, 0x0F, 0x11,
-    0x0B, 0x0E, 0x10, 0x11,
-    0x0B, 0x0C, 0x10, 0x11,
-    0x0B, 0x0C, 0x0E, 0x11,
-    0x0B, 0x11, 0x11, 0x11,
-    0x0B, 0x0B, 0x11, 0x11,
-    0x0B, 0x0B, 0x0B, 0x11,
-    0x0B, 0x0E, 0x0F, 0x12,
-    0x0B, 0x0E, 0x11, 0x12,
-    0x0B, 0x0C, 0x11, 0x12,
-    0x0B, 0x0C, 0x0F, 0x12,
-    0x0B, 0x0E, 0x10, 0x13,
-    0x0B, 0x0F, 0x11, 0x13,
-    0x0B, 0x0D, 0x11, 0x13,
-    0x0B, 0x0D, 0x0F, 0x13,
-    0x0B, 0x13, 0x13, 0x13,
-    0x0B, 0x0B, 0x13, 0x13,
-    0x0B, 0x0B, 0x0B, 0x13,
-    0x0B, 0x0F, 0x12, 0x16,
-    0x0B, 0x10, 0x14, 0x16,
-    0x0B, 0x0D, 0x14, 0x16,
-    0x0B, 0x0D, 0x11, 0x16,
-    0x0B, 0x16, 0x16, 0x16,
-    0x0B, 0x0B, 0x16, 0x16,
-    0x0B, 0x0B, 0x0B, 0x16,
-    0x0B, 0x10, 0x14, 0x19,
-    0x0B, 0x12, 0x16, 0x19,
-    0x0B, 0x0E, 0x16, 0x19,
-    0x0B, 0x0E, 0x12, 0x19,
-    0x0B, 0x19, 0x19, 0x19,
-    0x0B, 0x0B, 0x19, 0x19,
-    0x0B, 0x0B, 0x0B, 0x19,
-    0x0B, 0x11, 0x16, 0x1C,
-    0x0B, 0x13, 0x18, 0x1C,
-    0x0B, 0x0F, 0x18, 0x1C,
-    0x0B, 0x0F, 0x14, 0x1C,
-    0x0B, 0x1C, 0x1C, 0x1C,
-    0x0B, 0x0B, 0x1C, 0x1C,
-    0x0B, 0x0B, 0x0B, 0x1C,
-    0x0B, 0x12, 0x18, 0x1F,
-    0x0B, 0x15, 0x1A, 0x1F,
-    0x0B, 0x10, 0x1A, 0x1F,
-    0x0B, 0x10, 0x15, 0x1F,
-    0x0B, 0x1F, 0x1F, 0x1F,
-    0x0B, 0x0B, 0x1F, 0x1F,
-    0x0B, 0x0B, 0x0B, 0x1F,
-    0x0B, 0x16, 0x1D, 0x22,
-    0x0B, 0x10, 0x1D, 0x22,
-    0x0B, 0x10, 0x17, 0x22,
-    0x0B, 0x22, 0x22, 0x22,
-    0x0B, 0x0B, 0x22, 0x22,
-    0x0B, 0x0B, 0x0B, 0x22,
-    0x0B, 0x18, 0x1F, 0x25,
-    0x0B, 0x11, 0x1F, 0x25,
-    0x0B, 0x11, 0x18, 0x25,
-    0x0B, 0x25, 0x25, 0x25,
-    0x0B, 0x0B, 0x25, 0x25,
-    0x0B, 0x0B, 0x0B, 0x25,
-    0x0B, 0x19, 0x21, 0x28,
-    0x0B, 0x12, 0x21, 0x28,
-    0x0B, 0x12, 0x1A, 0x28,
-    0x0B, 0x28, 0x28, 0x28,
-    0x0B, 0x0B, 0x28, 0x28,
-    0x0B, 0x0B, 0x0B, 0x28,
-    0x0B, 0x1B, 0x23, 0x2B,
-    0x0B, 0x13, 0x23, 0x2B,
-    0x0B, 0x13, 0x1B, 0x2B,
-    0x0B, 0x2B, 0x2B, 0x2B,
-    0x0B, 0x0B, 0x2B, 0x2B,
-    0x0B, 0x0B, 0x0B, 0x2B,
-    0x0B, 0x2E, 0x2E, 0x2E,
-    0x0B, 0x0B, 0x2E, 0x2E,
-    0x0B, 0x0B, 0x0B, 0x2E,
-    0x0B, 0x1D, 0x26, 0x2F,
-    0x0B, 0x14, 0x26, 0x2F,
-    0x0B, 0x14, 0x1D, 0x2F,
-    0x0B, 0x33, 0x33, 0x33,
-    0x0B, 0x0B, 0x33, 0x33,
-    0x0B, 0x0B, 0x0B, 0x33,
-    0x0B, 0x39, 0x39, 0x39,
-    0x0B, 0x0B, 0x39, 0x39,
-    0x0B, 0x0B, 0x0B, 0x39,
-    0x0C, 0x0D, 0x0D, 0x0E,
-    0x0C, 0x0D, 0x0E, 0x0F,
-    0x0C, 0x0E, 0x0F, 0x10,
-    0x0C, 0x0D, 0x0F, 0x10,
-    0x0C, 0x0D, 0x0E, 0x10,
-    0x0C, 0x0E, 0x0F, 0x11,
-    0x0C, 0x0E, 0x10, 0x11,
-    0x0C, 0x0D, 0x10, 0x11,
-    0x0C, 0x0D, 0x0F, 0x11,
-    0x0C, 0x0E, 0x10, 0x12,
-    0x0C, 0x0F, 0x11, 0x12,
-    0x0C, 0x0D, 0x11, 0x12,
-    0x0C, 0x0D, 0x0F, 0x12,
-    0x0C, 0x12, 0x12, 0x12,
-    0x0C, 0x0C, 0x12, 0x12,
-    0x0C, 0x0C, 0x0C, 0x12,
-    0x0C, 0x0F, 0x10, 0x13,
-    0x0C, 0x0F, 0x12, 0x13,
-    0x0C, 0x0D, 0x12, 0x13,
-    0x0C, 0x0D, 0x10, 0x13,
-    0x0C, 0x0F, 0x11, 0x14,
-    0x0C, 0x10, 0x12, 0x14,
-    0x0C, 0x0E, 0x12, 0x14,
-    0x0C, 0x0E, 0x10, 0x14,
-    0x0C, 0x14, 0x14, 0x14,
-    0x0C, 0x0C, 0x14, 0x14,
-    0x0C, 0x0C, 0x0C, 0x14,
-    0x0C, 0x10, 0x13, 0x17,
-    0x0C, 0x11, 0x15, 0x17,
-    0x0C, 0x0E, 0x15, 0x17,
-    0x0C, 0x0E, 0x12, 0x17,
-    0x0C, 0x17, 0x17, 0x17,
-    0x0C, 0x0C, 0x17, 0x17,
-    0x0C, 0x0C, 0x0C, 0x17,
-    0x0C, 0x11, 0x15, 0x1A,
-    0x0C, 0x13, 0x17, 0x1A,
-    0x0C, 0x0F, 0x17, 0x1A,
-    0x0C, 0x0F, 0x13, 0x1A,
-    0x0C, 0x1A, 0x1A, 0x1A,
-    0x0C, 0x0C, 0x1A, 0x1A,
-    0x0C, 0x0C, 0x0C, 0x1A,
-    0x0C, 0x12, 0x17, 0x1D,
-    0x0C, 0x14, 0x19, 0x1D,
-    0x0C, 0x10, 0x19, 0x1D,
-    0x0C, 0x10, 0x15, 0x1D,
-    0x0C, 0x1D, 0x1D, 0x1D,
-    0x0C, 0x0C, 0x1D, 0x1D,
-    0x0C, 0x0C, 0x0C, 0x1D,
-    0x0C, 0x13, 0x19, 0x20,
-    0x0C, 0x16, 0x1B, 0x20,
-    0x0C, 0x11, 0x1B, 0x20,
-    0x0C, 0x11, 0x16, 0x20,
-    0x0C, 0x20, 0x20, 0x20,
-    0x0C, 0x0C, 0x20, 0x20,
-    0x0C, 0x0C, 0x0C, 0x20,
-    0x0C, 0x17, 0x1E, 0x23,
-    0x0C, 0x11, 0x1E, 0x23,
-    0x0C, 0x11, 0x18, 0x23,
-    0x0C, 0x23, 0x23, 0x23,
-    0x0C, 0x0C, 0x23, 0x23,
-    0x0C, 0x0C, 0x0C, 0x23,
-    0x0C, 0x19, 0x20, 0x26,
-    0x0C, 0x12, 0x20, 0x26,
-    0x0C, 0x12, 0x19, 0x26,
-    0x0C, 0x26, 0x26, 0x26,
-    0x0C, 0x0C, 0x26, 0x26,
-    0x0C, 0x0C, 0x0C, 0x26,
-    0x0C, 0x1A, 0x22, 0x29,
-    0x0C, 0x13, 0x22, 0x29,
-    0x0C, 0x13, 0x1B, 0x29,
-    0x0C, 0x29, 0x29, 0x29,
-    0x0C, 0x0C, 0x29, 0x29,
-    0x0C, 0x0C, 0x0C, 0x29,
-    0x0C, 0x1C, 0x24, 0x2C,
-    0x0C, 0x14, 0x24, 0x2C,
-    0x0C, 0x14, 0x1C, 0x2C,
-    0x0C, 0x2C, 0x2C, 0x2C,
-    0x0C, 0x0C, 0x2C, 0x2C,
-    0x0C, 0x0C, 0x0C, 0x2C,
-    0x0C, 0x2F, 0x2F, 0x2F,
-    0x0C, 0x0C, 0x2F, 0x2F,
-    0x0C, 0x0C, 0x0C, 0x2F,
-    0x0C, 0x1E, 0x27, 0x30,
-    0x0C, 0x15, 0x27, 0x30,
-    0x0C, 0x15, 0x1E, 0x30,
-    0x0C, 0x34, 0x34, 0x34,
-    0x0C, 0x0C, 0x34, 0x34,
-    0x0C, 0x0C, 0x0C, 0x34,
-    0x0C, 0x3A, 0x3A, 0x3A,
-    0x0C, 0x0C, 0x3A, 0x3A,
-    0x0C, 0x0C, 0x0C, 0x3A,
-    0x0D, 0x0E, 0x0E, 0x0F,
-    0x0D, 0x0E, 0x0F, 0x10,
-    0x0D, 0x0F, 0x10, 0x11,
-    0x0D, 0x0E, 0x10, 0x11,
-    0x0D, 0x0E, 0x0F, 0x11,
-    0x0D, 0x0F, 0x10, 0x12,
-    0x0D, 0x0F, 0x11, 0x12,
-    0x0D, 0x0E, 0x11, 0x12,
-    0x0D, 0x0E, 0x10, 0x12,
-    0x0D, 0x0F, 0x11, 0x13,
-    0x0D, 0x10, 0x12, 0x13,
-    0x0D, 0x0E, 0x12, 0x13,
-    0x0D, 0x0E, 0x10, 0x13,
-    0x0D, 0x13, 0x13, 0x13,
-    0x0D, 0x0D, 0x13, 0x13,
-    0x0D, 0x0D, 0x0D, 0x13,
-    0x0D, 0x10, 0x11, 0x14,
-    0x0D, 0x10, 0x13, 0x14,
-    0x0D, 0x0E, 0x13, 0x14,
-    0x0D, 0x0E, 0x11, 0x14,
-    0x0D, 0x10, 0x12, 0x15,
-    0x0D, 0x11, 0x13, 0x15,
-    0x0D, 0x0F, 0x13, 0x15,
-    0x0D, 0x0F, 0x11, 0x15,
-    0x0D, 0x15, 0x15, 0x15,
-    0x0D, 0x0D, 0x15, 0x15,
-    0x0D, 0x0D, 0x0D, 0x15,
-    0x0D, 0x11, 0x14, 0x18,
-    0x0D, 0x12, 0x16, 0x18,
-    0x0D, 0x0F, 0x16, 0x18,
-    0x0D, 0x0F, 0x13, 0x18,
-    0x0D, 0x18, 0x18, 0x18,
-    0x0D, 0x0D, 0x18, 0x18,
-    0x0D, 0x0D, 0x0D, 0x18,
-    0x0D, 0x12, 0x16, 0x1B,
-    0x0D, 0x14, 0x18, 0x1B,
-    0x0D, 0x10, 0x18, 0x1B,
-    0x0D, 0x10, 0x14, 0x1B,
-    0x0D, 0x1B, 0x1B, 0x1B,
-    0x0D, 0x0D, 0x1B, 0x1B,
-    0x0D, 0x0D, 0x0D, 0x1B,
-    0x0D, 0x13, 0x18, 0x1E,
-    0x0D, 0x15, 0x1A, 0x1E,
-    0x0D, 0x11, 0x1A, 0x1E,
-    0x0D, 0x11, 0x16, 0x1E,
-    0x0D, 0x1E, 0x1E, 0x1E,
-    0x0D, 0x0D, 0x1E, 0x1E,
-    0x0D, 0x0D, 0x0D, 0x1E,
-    0x0D, 0x14, 0x1A, 0x21,
-    0x0D, 0x17, 0x1C, 0x21,
-    0x0D, 0x12, 0x1C, 0x21,
-    0x0D, 0x12, 0x17, 0x21,
-    0x0D, 0x21, 0x21, 0x21,
-    0x0D, 0x0D, 0x21, 0x21,
-    0x0D, 0x0D, 0x0D, 0x21,
-    0x0D, 0x18, 0x1F, 0x24,
-    0x0D, 0x12, 0x1F, 0x24,
-    0x0D, 0x12, 0x19, 0x24,
-    0x0D, 0x24, 0x24, 0x24,
-    0x0D, 0x0D, 0x24, 0x24,
-    0x0D, 0x0D, 0x0D, 0x24,
-    0x0D, 0x1A, 0x21, 0x27,
-    0x0D, 0x13, 0x21, 0x27,
-    0x0D, 0x13, 0x1A, 0x27,
-    0x0D, 0x27, 0x27, 0x27,
-    0x0D, 0x0D, 0x27, 0x27,
-    0x0D, 0x0D, 0x0D, 0x27,
-    0x0D, 0x1B, 0x23, 0x2A,
-    0x0D, 0x14, 0x23, 0x2A,
-    0x0D, 0x14, 0x1C, 0x2A,
-    0x0D, 0x2A, 0x2A, 0x2A,
-    0x0D, 0x0D, 0x2A, 0x2A,
-    0x0D, 0x0D, 0x0D, 0x2A,
-    0x0D, 0x1D, 0x25, 0x2D,
-    0x0D, 0x15, 0x25, 0x2D,
-    0x0D, 0x15, 0x1D, 0x2D,
-    0x0D, 0x2D, 0x2D, 0x2D,
-    0x0D, 0x0D, 0x2D, 0x2D,
-    0x0D, 0x0D, 0x0D, 0x2D,
-    0x0D, 0x30, 0x30, 0x30,
-    0x0D, 0x0D, 0x30, 0x30,
-    0x0D, 0x0D, 0x0D, 0x30,
-    0x0D, 0x1F, 0x28, 0x31,
-    0x0D, 0x16, 0x28, 0x31,
-    0x0D, 0x16, 0x1F, 0x31,
-    0x0D, 0x35, 0x35, 0x35,
-    0x0D, 0x0D, 0x35, 0x35,
-    0x0D, 0x0D, 0x0D, 0x35,
-    0x0D, 0x3B, 0x3B, 0x3B,
-    0x0D, 0x0D, 0x3B, 0x3B,
-    0x0D, 0x0D, 0x0D, 0x3B,
-    0x0E, 0x0F, 0x0F, 0x10,
-    0x0E, 0x0F, 0x10, 0x11,
-    0x0E, 0x10, 0x11, 0x12,
-    0x0E, 0x0F, 0x11, 0x12,
-    0x0E, 0x0F, 0x10, 0x12,
-    0x0E, 0x10, 0x11, 0x13,
-    0x0E, 0x10, 0x12, 0x13,
-    0x0E, 0x0F, 0x12, 0x13,
-    0x0E, 0x0F, 0x11, 0x13,
-    0x0E, 0x10, 0x12, 0x14,
-    0x0E, 0x11, 0x13, 0x14,
-    0x0E, 0x0F, 0x13, 0x14,
-    0x0E, 0x0F, 0x11, 0x14,
-    0x0E, 0x14, 0x14, 0x14,
-    0x0E, 0x0E, 0x14, 0x14,
-    0x0E, 0x0E, 0x0E, 0x14,
-    0x0E, 0x11, 0x12, 0x15,
-    0x0E, 0x11, 0x14, 0x15,
-    0x0E, 0x0F, 0x14, 0x15,
-    0x0E, 0x0F, 0x12, 0x15,
-    0x0E, 0x11, 0x13, 0x16,
-    0x0E, 0x12, 0x14, 0x16,
-    0x0E, 0x10, 0x14, 0x16,
-    0x0E, 0x10, 0x12, 0x16,
-    0x0E, 0x16, 0x16, 0x16,
-    0x0E, 0x0E, 0x16, 0x16,
-    0x0E, 0x0E, 0x0E, 0x16,
-    0x0E, 0x12, 0x15, 0x19,
-    0x0E, 0x13, 0x17, 0x19,
-    0x0E, 0x10, 0x17, 0x19,
-    0x0E, 0x10, 0x14, 0x19,
-    0x0E, 0x19, 0x19, 0x19,
-    0x0E, 0x0E, 0x19, 0x19,
-    0x0E, 0x0E, 0x0E, 0x19,
-    0x0E, 0x13, 0x17, 0x1C,
-    0x0E, 0x15, 0x19, 0x1C,
-    0x0E, 0x11, 0x19, 0x1C,
-    0x0E, 0x11, 0x15, 0x1C,
-    0x0E, 0x1C, 0x1C, 0x1C,
-    0x0E, 0x0E, 0x1C, 0x1C,
-    0x0E, 0x0E, 0x0E, 0x1C,
-    0x0E, 0x14, 0x19, 0x1F,
-    0x0E, 0x16, 0x1B, 0x1F,
-    0x0E, 0x12, 0x1B, 0x1F,
-    0x0E, 0x12, 0x17, 0x1F,
-    0x0E, 0x1F, 0x1F, 0x1F,
-    0x0E, 0x0E, 0x1F, 0x1F,
-    0x0E, 0x0E, 0x0E, 0x1F,
-    0x0E, 0x15, 0x1B, 0x22,
-    0x0E, 0x18, 0x1D, 0x22,
-    0x0E, 0x13, 0x1D, 0x22,
-    0x0E, 0x13, 0x18, 0x22,
-    0x0E, 0x22, 0x22, 0x22,
-    0x0E, 0x0E, 0x22, 0x22,
-    0x0E, 0x0E, 0x0E, 0x22,
-    0x0E, 0x19, 0x20, 0x25,
-    0x0E, 0x13, 0x20, 0x25,
-    0x0E, 0x13, 0x1A, 0x25,
-    0x0E, 0x25, 0x25, 0x25,
-    0x0E, 0x0E, 0x25, 0x25,
-    0x0E, 0x0E, 0x0E, 0x25,
-    0x0E, 0x1B, 0x22, 0x28,
-    0x0E, 0x14, 0x22, 0x28,
-    0x0E, 0x14, 0x1B, 0x28,
-    0x0E, 0x28, 0x28, 0x28,
-    0x0E, 0x0E, 0x28, 0x28,
-    0x0E, 0x0E, 0x0E, 0x28,
-    0x0E, 0x1C, 0x24, 0x2B,
-    0x0E, 0x15, 0x24, 0x2B,
-    0x0E, 0x15, 0x1D, 0x2B,
-    0x0E, 0x2B, 0x2B, 0x2B,
-    0x0E, 0x0E, 0x2B, 0x2B,
-    0x0E, 0x0E, 0x0E, 0x2B,
-    0x0E, 0x1E, 0x26, 0x2E,
-    0x0E, 0x16, 0x26, 0x2E,
-    0x0E, 0x16, 0x1E, 0x2E,
-    0x0E, 0x2E, 0x2E, 0x2E,
-    0x0E, 0x0E, 0x2E, 0x2E,
-    0x0E, 0x0E, 0x0E, 0x2E,
-    0x0E, 0x31, 0x31, 0x31,
-    0x0E, 0x0E, 0x31, 0x31,
-    0x0E, 0x0E, 0x0E, 0x31,
-    0x0E, 0x20, 0x29, 0x32,
-    0x0E, 0x17, 0x29, 0x32,
-    0x0E, 0x17, 0x20, 0x32,
-    0x0E, 0x36, 0x36, 0x36,
-    0x0E, 0x0E, 0x36, 0x36,
-    0x0E, 0x0E, 0x0E, 0x36,
-    0x0E, 0x3C, 0x3C, 0x3C,
-    0x0E, 0x0E, 0x3C, 0x3C,
-    0x0E, 0x0E, 0x0E, 0x3C,
-    0x0F, 0x10, 0x10, 0x11,
-    0x0F, 0x10, 0x11, 0x12,
-    0x0F, 0x11, 0x12, 0x13,
-    0x0F, 0x10, 0x12, 0x13,
-    0x0F, 0x10, 0x11, 0x13,
-    0x0F, 0x11, 0x12, 0x14,
-    0x0F, 0x11, 0x13, 0x14,
-    0x0F, 0x10, 0x13, 0x14,
-    0x0F, 0x10, 0x12, 0x14,
-    0x0F, 0x11, 0x13, 0x15,
-    0x0F, 0x12, 0x14, 0x15,
-    0x0F, 0x10, 0x14, 0x15,
-    0x0F, 0x10, 0x12, 0x15,
-    0x0F, 0x15, 0x15, 0x15,
-    0x0F, 0x0F, 0x15, 0x15,
-    0x0F, 0x0F, 0x0F, 0x15,
-    0x0F, 0x12, 0x13, 0x16,
-    0x0F, 0x12, 0x15, 0x16,
-    0x0F, 0x10, 0x15, 0x16,
-    0x0F, 0x10, 0x13, 0x16,
-    0x0F, 0x12, 0x14, 0x17,
-    0x0F, 0x13, 0x15, 0x17,
-    0x0F, 0x11, 0x15, 0x17,
-    0x0F, 0x11, 0x13, 0x17,
-    0x0F, 0x17, 0x17, 0x17,
-    0x0F, 0x0F, 0x17, 0x17,
-    0x0F, 0x0F, 0x0F, 0x17,
-    0x0F, 0x13, 0x16, 0x1A,
-    0x0F, 0x14, 0x18, 0x1A,
-    0x0F, 0x11, 0x18, 0x1A,
-    0x0F, 0x11, 0x15, 0x1A,
-    0x0F, 0x1A, 0x1A, 0x1A,
-    0x0F, 0x0F, 0x1A, 0x1A,
-    0x0F, 0x0F, 0x0F, 0x1A,
-    0x0F, 0x14, 0x18, 0x1D,
-    0x0F, 0x16, 0x1A, 0x1D,
-    0x0F, 0x12, 0x1A, 0x1D,
-    0x0F, 0x12, 0x16, 0x1D,
-    0x0F, 0x1D, 0x1D, 0x1D,
-    0x0F, 0x0F, 0x1D, 0x1D,
-    0x0F, 0x0F, 0x0F, 0x1D,
-    0x0F, 0x15, 0x1A, 0x20,
-    0x0F, 0x17, 0x1C, 0x20,
-    0x0F, 0x13, 0x1C, 0x20,
-    0x0F, 0x13, 0x18, 0x20,
-    0x0F, 0x20, 0x20, 0x20,
-    0x0F, 0x0F, 0x20, 0x20,
-    0x0F, 0x0F, 0x0F, 0x20,
-    0x0F, 0x16, 0x1C, 0x23,
-    0x0F, 0x19, 0x1E, 0x23,
-    0x0F, 0x14, 0x1E, 0x23,
-    0x0F, 0x14, 0x19, 0x23,
-    0x0F, 0x23, 0x23, 0x23,
-    0x0F, 0x0F, 0x23, 0x23,
-    0x0F, 0x0F, 0x0F, 0x23,
-    0x0F, 0x1A, 0x21, 0x26,
-    0x0F, 0x14, 0x21, 0x26,
-    0x0F, 0x14, 0x1B, 0x26,
-    0x0F, 0x26, 0x26, 0x26,
-    0x0F, 0x0F, 0x26, 0x26,
-    0x0F, 0x0F, 0x0F, 0x26,
-    0x0F, 0x1C, 0x23, 0x29,
-    0x0F, 0x15, 0x23, 0x29,
-    0x0F, 0x15, 0x1C, 0x29,
-    0x0F, 0x29, 0x29, 0x29,
-    0x0F, 0x0F, 0x29, 0x29,
-    0x0F, 0x0F, 0x0F, 0x29,
-    0x0F, 0x1D, 0x25, 0x2C,
-    0x0F, 0x16, 0x25, 0x2C,
-    0x0F, 0x16, 0x1E, 0x2C,
-    0x0F, 0x2C, 0x2C, 0x2C,
-    0x0F, 0x0F, 0x2C, 0x2C,
-    0x0F, 0x0F, 0x0F, 0x2C,
-    0x0F, 0x1F, 0x27, 0x2F,
-    0x0F, 0x17, 0x27, 0x2F,
-    0x0F, 0x17, 0x1F, 0x2F,
-    0x0F, 0x2F, 0x2F, 0x2F,
-    0x0F, 0x0F, 0x2F, 0x2F,
-    0x0F, 0x0F, 0x0F, 0x2F,
-    0x0F, 0x32, 0x32, 0x32,
-    0x0F, 0x0F, 0x32, 0x32,
-    0x0F, 0x0F, 0x0F, 0x32,
-    0x0F, 0x21, 0x2A, 0x33,
-    0x0F, 0x18, 0x2A, 0x33,
-    0x0F, 0x18, 0x21, 0x33,
-    0x0F, 0x37, 0x37, 0x37,
-    0x0F, 0x0F, 0x37, 0x37,
-    0x0F, 0x0F, 0x0F, 0x37,
-    0x0F, 0x3D, 0x3D, 0x3D,
-    0x0F, 0x0F, 0x3D, 0x3D,
-    0x0F, 0x0F, 0x0F, 0x3D,
-    0x10, 0x11, 0x11, 0x12,
-    0x10, 0x11, 0x12, 0x13,
-    0x10, 0x12, 0x13, 0x14,
-    0x10, 0x11, 0x13, 0x14,
-    0x10, 0x11, 0x12, 0x14,
-    0x10, 0x12, 0x13, 0x15,
-    0x10, 0x12, 0x14, 0x15,
-    0x10, 0x11, 0x14, 0x15,
-    0x10, 0x11, 0x13, 0x15,
-    0x10, 0x12, 0x14, 0x16,
-    0x10, 0x13, 0x15, 0x16,
-    0x10, 0x11, 0x15, 0x16,
-    0x10, 0x11, 0x13, 0x16,
-    0x10, 0x16, 0x16, 0x16,
-    0x10, 0x10, 0x16, 0x16,
-    0x10, 0x10, 0x10, 0x16,
-    0x10, 0x13, 0x14, 0x17,
-    0x10, 0x13, 0x16, 0x17,
-    0x10, 0x11, 0x16, 0x17,
-    0x10, 0x11, 0x14, 0x17,
-    0x10, 0x13, 0x15, 0x18,
-    0x10, 0x14, 0x16, 0x18,
-    0x10, 0x12, 0x16, 0x18,
-    0x10, 0x12, 0x14, 0x18,
-    0x10, 0x18, 0x18, 0x18,
-    0x10, 0x10, 0x18, 0x18,
-    0x10, 0x10, 0x10, 0x18,
-    0x10, 0x14, 0x17, 0x1B,
-    0x10, 0x15, 0x19, 0x1B,
-    0x10, 0x12, 0x19, 0x1B,
-    0x10, 0x12, 0x16, 0x1B,
-    0x10, 0x1B, 0x1B, 0x1B,
-    0x10, 0x10, 0x1B, 0x1B,
-    0x10, 0x10, 0x10, 0x1B,
-    0x10, 0x15, 0x19, 0x1E,
-    0x10, 0x17, 0x1B, 0x1E,
-    0x10, 0x13, 0x1B, 0x1E,
-    0x10, 0x13, 0x17, 0x1E,
-    0x10, 0x1E, 0x1E, 0x1E,
-    0x10, 0x10, 0x1E, 0x1E,
-    0x10, 0x10, 0x10, 0x1E,
-    0x10, 0x16, 0x1B, 0x21,
-    0x10, 0x18, 0x1D, 0x21,
-    0x10, 0x14, 0x1D, 0x21,
-    0x10, 0x14, 0x19, 0x21,
-    0x10, 0x21, 0x21, 0x21,
-    0x10, 0x10, 0x21, 0x21,
-    0x10, 0x10, 0x10, 0x21,
-    0x10, 0x17, 0x1D, 0x24,
-    0x10, 0x1A, 0x1F, 0x24,
-    0x10, 0x15, 0x1F, 0x24,
-    0x10, 0x15, 0x1A, 0x24,
-    0x10, 0x24, 0x24, 0x24,
-    0x10, 0x10, 0x24, 0x24,
-    0x10, 0x10, 0x10, 0x24,
-    0x10, 0x1B, 0x22, 0x27,
-    0x10, 0x15, 0x22, 0x27,
-    0x10, 0x15, 0x1C, 0x27,
-    0x10, 0x27, 0x27, 0x27,
-    0x10, 0x10, 0x27, 0x27,
-    0x10, 0x10, 0x10, 0x27,
-    0x10, 0x1D, 0x24, 0x2A,
-    0x10, 0x16, 0x24, 0x2A,
-    0x10, 0x16, 0x1D, 0x2A,
-    0x10, 0x2A, 0x2A, 0x2A,
-    0x10, 0x10, 0x2A, 0x2A,
-    0x10, 0x10, 0x10, 0x2A,
-    0x10, 0x1E, 0x26, 0x2D,
-    0x10, 0x17, 0x26, 0x2D,
-    0x10, 0x17, 0x1F, 0x2D,
-    0x10, 0x2D, 0x2D, 0x2D,
-    0x10, 0x10, 0x2D, 0x2D,
-    0x10, 0x10, 0x10, 0x2D,
-    0x10, 0x20, 0x28, 0x30,
-    0x10, 0x18, 0x28, 0x30,
-    0x10, 0x18, 0x20, 0x30,
-    0x10, 0x30, 0x30, 0x30,
-    0x10, 0x10, 0x30, 0x30,
-    0x10, 0x10, 0x10, 0x30,
-    0x10, 0x33, 0x33, 0x33,
-    0x10, 0x10, 0x33, 0x33,
-    0x10, 0x10, 0x10, 0x33,
-    0x10, 0x22, 0x2B, 0x34,
-    0x10, 0x19, 0x2B, 0x34,
-    0x10, 0x19, 0x22, 0x34,
-    0x10, 0x38, 0x38, 0x38,
-    0x10, 0x10, 0x38, 0x38,
-    0x10, 0x10, 0x10, 0x38,
-    0x10, 0x3E, 0x3E, 0x3E,
-    0x10, 0x10, 0x3E, 0x3E,
-    0x10, 0x10, 0x10, 0x3E,
-    0x11, 0x12, 0x12, 0x13,
-    0x11, 0x12, 0x13, 0x14,
-    0x11, 0x13, 0x14, 0x15,
-    0x11, 0x12, 0x14, 0x15,
-    0x11, 0x12, 0x13, 0x15,
-    0x11, 0x13, 0x14, 0x16,
-    0x11, 0x13, 0x15, 0x16,
-    0x11, 0x12, 0x15, 0x16,
-    0x11, 0x12, 0x14, 0x16,
-    0x11, 0x13, 0x15, 0x17,
-    0x11, 0x14, 0x16, 0x17,
-    0x11, 0x12, 0x16, 0x17,
-    0x11, 0x12, 0x14, 0x17,
-    0x11, 0x17, 0x17, 0x17,
-    0x11, 0x11, 0x17, 0x17,
-    0x11, 0x11, 0x11, 0x17,
-    0x11, 0x14, 0x15, 0x18,
-    0x11, 0x14, 0x17, 0x18,
-    0x11, 0x12, 0x17, 0x18,
-    0x11, 0x12, 0x15, 0x18,
-    0x11, 0x14, 0x16, 0x19,
-    0x11, 0x15, 0x17, 0x19,
-    0x11, 0x13, 0x17, 0x19,
-    0x11, 0x13, 0x15, 0x19,
-    0x11, 0x19, 0x19, 0x19,
-    0x11, 0x11, 0x19, 0x19,
-    0x11, 0x11, 0x11, 0x19,
-    0x11, 0x15, 0x18, 0x1C,
-    0x11, 0x16, 0x1A, 0x1C,
-    0x11, 0x13, 0x1A, 0x1C,
-    0x11, 0x13, 0x17, 0x1C,
-    0x11, 0x1C, 0x1C, 0x1C,
-    0x11, 0x11, 0x1C, 0x1C,
-    0x11, 0x11, 0x11, 0x1C,
-    0x11, 0x16, 0x1A, 0x1F,
-    0x11, 0x18, 0x1C, 0x1F,
-    0x11, 0x14, 0x1C, 0x1F,
-    0x11, 0x14, 0x18, 0x1F,
-    0x11, 0x1F, 0x1F, 0x1F,
-    0x11, 0x11, 0x1F, 0x1F,
-    0x11, 0x11, 0x11, 0x1F,
-    0x11, 0x17, 0x1C, 0x22,
-    0x11, 0x19, 0x1E, 0x22,
-    0x11, 0x15, 0x1E, 0x22,
-    0x11, 0x15, 0x1A, 0x22,
-    0x11, 0x22, 0x22, 0x22,
-    0x11, 0x11, 0x22, 0x22,
-    0x11, 0x11, 0x11, 0x22,
-    0x11, 0x18, 0x1E, 0x25,
-    0x11, 0x1B, 0x20, 0x25,
-    0x11, 0x16, 0x20, 0x25,
-    0x11, 0x16, 0x1B, 0x25,
-    0x11, 0x25, 0x25, 0x25,
-    0x11, 0x11, 0x25, 0x25,
-    0x11, 0x11, 0x11, 0x25,
-    0x11, 0x1C, 0x23, 0x28,
-    0x11, 0x16, 0x23, 0x28,
-    0x11, 0x16, 0x1D, 0x28,
-    0x11, 0x28, 0x28, 0x28,
-    0x11, 0x11, 0x28, 0x28,
-    0x11, 0x11, 0x11, 0x28,
-    0x11, 0x1E, 0x25, 0x2B,
-    0x11, 0x17, 0x25, 0x2B,
-    0x11, 0x17, 0x1E, 0x2B,
-    0x11, 0x2B, 0x2B, 0x2B,
-    0x11, 0x11, 0x2B, 0x2B,
-    0x11, 0x11, 0x11, 0x2B,
-    0x11, 0x1F, 0x27, 0x2E,
-    0x11, 0x18, 0x27, 0x2E,
-    0x11, 0x18, 0x20, 0x2E,
-    0x11, 0x2E, 0x2E, 0x2E,
-    0x11, 0x11, 0x2E, 0x2E,
-    0x11, 0x11, 0x11, 0x2E,
-    0x11, 0x21, 0x29, 0x31,
-    0x11, 0x19, 0x29, 0x31,
-    0x11, 0x19, 0x21, 0x31,
-    0x11, 0x31, 0x31, 0x31,
-    0x11, 0x11, 0x31, 0x31,
-    0x11, 0x11, 0x11, 0x31,
-    0x11, 0x34, 0x34, 0x34,
-    0x11, 0x11, 0x34, 0x34,
-    0x11, 0x11, 0x11, 0x34,
-    0x11, 0x23, 0x2C, 0x35,
-    0x11, 0x1A, 0x2C, 0x35,
-    0x11, 0x1A, 0x23, 0x35,
-    0x11, 0x39, 0x39, 0x39,
-    0x11, 0x11, 0x39, 0x39,
-    0x11, 0x11, 0x11, 0x39,
-    0x11, 0x3F, 0x3F, 0x3F,
-    0x11, 0x11, 0x3F, 0x3F,
-    0x11, 0x11, 0x11, 0x3F,
-    0x12, 0x13, 0x13, 0x14,
-    0x12, 0x13, 0x14, 0x15,
-    0x12, 0x14, 0x15, 0x16,
-    0x12, 0x13, 0x15, 0x16,
-    0x12, 0x13, 0x14, 0x16,
-    0x12, 0x14, 0x15, 0x17,
-    0x12, 0x14, 0x16, 0x17,
-    0x12, 0x13, 0x16, 0x17,
-    0x12, 0x13, 0x15, 0x17,
-    0x12, 0x14, 0x16, 0x18,
-    0x12, 0x15, 0x17, 0x18,
-    0x12, 0x13, 0x17, 0x18,
-    0x12, 0x13, 0x15, 0x18,
-    0x12, 0x18, 0x18, 0x18,
-    0x12, 0x12, 0x18, 0x18,
-    0x12, 0x12, 0x12, 0x18,
-    0x12, 0x15, 0x16, 0x19,
-    0x12, 0x15, 0x18, 0x19,
-    0x12, 0x13, 0x18, 0x19,
-    0x12, 0x13, 0x16, 0x19,
-    0x12, 0x15, 0x17, 0x1A,
-    0x12, 0x16, 0x18, 0x1A,
-    0x12, 0x14, 0x18, 0x1A,
-    0x12, 0x14, 0x16, 0x1A,
-    0x12, 0x1A, 0x1A, 0x1A,
-    0x12, 0x12, 0x1A, 0x1A,
-    0x12, 0x12, 0x12, 0x1A,
-    0x12, 0x16, 0x19, 0x1D,
-    0x12, 0x17, 0x1B, 0x1D,
-    0x12, 0x14, 0x1B, 0x1D,
-    0x12, 0x14, 0x18, 0x1D,
-    0x12, 0x1D, 0x1D, 0x1D,
-    0x12, 0x12, 0x1D, 0x1D,
-    0x12, 0x12, 0x12, 0x1D,
-    0x12, 0x17, 0x1B, 0x20,
-    0x12, 0x19, 0x1D, 0x20,
-    0x12, 0x15, 0x1D, 0x20,
-    0x12, 0x15, 0x19, 0x20,
-    0x12, 0x20, 0x20, 0x20,
-    0x12, 0x12, 0x20, 0x20,
-    0x12, 0x12, 0x12, 0x20,
-    0x12, 0x18, 0x1D, 0x23,
-    0x12, 0x1A, 0x1F, 0x23,
-    0x12, 0x16, 0x1F, 0x23,
-    0x12, 0x16, 0x1B, 0x23,
-    0x12, 0x23, 0x23, 0x23,
-    0x12, 0x12, 0x23, 0x23,
-    0x12, 0x12, 0x12, 0x23,
-    0x12, 0x19, 0x1F, 0x26,
-    0x12, 0x1C, 0x21, 0x26,
-    0x12, 0x17, 0x21, 0x26,
-    0x12, 0x17, 0x1C, 0x26,
-    0x12, 0x26, 0x26, 0x26,
-    0x12, 0x12, 0x26, 0x26,
-    0x12, 0x12, 0x12, 0x26,
-    0x12, 0x1D, 0x24, 0x29,
-    0x12, 0x17, 0x24, 0x29,
-    0x12, 0x17, 0x1E, 0x29,
-    0x12, 0x29, 0x29, 0x29,
-    0x12, 0x12, 0x29, 0x29,
-    0x12, 0x12, 0x12, 0x29,
-    0x12, 0x1F, 0x26, 0x2C,
-    0x12, 0x18, 0x26, 0x2C,
-    0x12, 0x18, 0x1F, 0x2C,
-    0x12, 0x2C, 0x2C, 0x2C,
-    0x12, 0x12, 0x2C, 0x2C,
-    0x12, 0x12, 0x12, 0x2C,
-    0x12, 0x20, 0x28, 0x2F,
-    0x12, 0x19, 0x28, 0x2F,
-    0x12, 0x19, 0x21, 0x2F,
-    0x12, 0x2F, 0x2F, 0x2F,
-    0x12, 0x12, 0x2F, 0x2F,
-    0x12, 0x12, 0x12, 0x2F,
-    0x12, 0x22, 0x2A, 0x32,
-    0x12, 0x1A, 0x2A, 0x32,
-    0x12, 0x1A, 0x22, 0x32,
-    0x12, 0x32, 0x32, 0x32,
-    0x12, 0x12, 0x32, 0x32,
-    0x12, 0x12, 0x12, 0x32,
-    0x12, 0x35, 0x35, 0x35,
-    0x12, 0x12, 0x35, 0x35,
-    0x12, 0x12, 0x12, 0x35,
-    0x12, 0x24, 0x2D, 0x36,
-    0x12, 0x1B, 0x2D, 0x36,
-    0x12, 0x1B, 0x24, 0x36,
-    0x12, 0x3A, 0x3A, 0x3A,
-    0x12, 0x12, 0x3A, 0x3A,
-    0x12, 0x12, 0x12, 0x3A,
-    0x13, 0x14, 0x14, 0x15,
-    0x13, 0x14, 0x15, 0x16,
-    0x13, 0x15, 0x16, 0x17,
-    0x13, 0x14, 0x16, 0x17,
-    0x13, 0x14, 0x15, 0x17,
-    0x13, 0x15, 0x16, 0x18,
-    0x13, 0x15, 0x17, 0x18,
-    0x13, 0x14, 0x17, 0x18,
-    0x13, 0x14, 0x16, 0x18,
-    0x13, 0x15, 0x17, 0x19,
-    0x13, 0x16, 0x18, 0x19,
-    0x13, 0x14, 0x18, 0x19,
-    0x13, 0x14, 0x16, 0x19,
-    0x13, 0x19, 0x19, 0x19,
-    0x13, 0x13, 0x19, 0x19,
-    0x13, 0x13, 0x13, 0x19,
-    0x13, 0x16, 0x17, 0x1A,
-    0x13, 0x16, 0x19, 0x1A,
-    0x13, 0x14, 0x19, 0x1A,
-    0x13, 0x14, 0x17, 0x1A,
-    0x13, 0x16, 0x18, 0x1B,
-    0x13, 0x17, 0x19, 0x1B,
-    0x13, 0x15, 0x19, 0x1B,
-    0x13, 0x15, 0x17, 0x1B,
-    0x13, 0x1B, 0x1B, 0x1B,
-    0x13, 0x13, 0x1B, 0x1B,
-    0x13, 0x13, 0x13, 0x1B,
-    0x13, 0x17, 0x1A, 0x1E,
-    0x13, 0x18, 0x1C, 0x1E,
-    0x13, 0x15, 0x1C, 0x1E,
-    0x13, 0x15, 0x19, 0x1E,
-    0x13, 0x1E, 0x1E, 0x1E,
-    0x13, 0x13, 0x1E, 0x1E,
-    0x13, 0x13, 0x13, 0x1E,
-    0x13, 0x18, 0x1C, 0x21,
-    0x13, 0x1A, 0x1E, 0x21,
-    0x13, 0x16, 0x1E, 0x21,
-    0x13, 0x16, 0x1A, 0x21,
-    0x13, 0x21, 0x21, 0x21,
-    0x13, 0x13, 0x21, 0x21,
-    0x13, 0x13, 0x13, 0x21,
-    0x13, 0x19, 0x1E, 0x24,
-    0x13, 0x1B, 0x20, 0x24,
-    0x13, 0x17, 0x20, 0x24,
-    0x13, 0x17, 0x1C, 0x24,
-    0x13, 0x24, 0x24, 0x24,
-    0x13, 0x13, 0x24, 0x24,
-    0x13, 0x13, 0x13, 0x24,
-    0x13, 0x1A, 0x20, 0x27,
-    0x13, 0x1D, 0x22, 0x27,
-    0x13, 0x18, 0x22, 0x27,
-    0x13, 0x18, 0x1D, 0x27,
-    0x13, 0x27, 0x27, 0x27,
-    0x13, 0x13, 0x27, 0x27,
-    0x13, 0x13, 0x13, 0x27,
-    0x13, 0x1E, 0x25, 0x2A,
-    0x13, 0x18, 0x25, 0x2A,
-    0x13, 0x18, 0x1F, 0x2A,
-    0x13, 0x2A, 0x2A, 0x2A,
-    0x13, 0x13, 0x2A, 0x2A,
-    0x13, 0x13, 0x13, 0x2A,
-    0x13, 0x20, 0x27, 0x2D,
-    0x13, 0x19, 0x27, 0x2D,
-    0x13, 0x19, 0x20, 0x2D,
-    0x13, 0x2D, 0x2D, 0x2D,
-    0x13, 0x13, 0x2D, 0x2D,
-    0x13, 0x13, 0x13, 0x2D,
-    0x13, 0x21, 0x29, 0x30,
-    0x13, 0x1A, 0x29, 0x30,
-    0x13, 0x1A, 0x22, 0x30,
-    0x13, 0x30, 0x30, 0x30,
-    0x13, 0x13, 0x30, 0x30,
-    0x13, 0x13, 0x13, 0x30,
-    0x13, 0x23, 0x2B, 0x33,
-    0x13, 0x1B, 0x2B, 0x33,
-    0x13, 0x1B, 0x23, 0x33,
-    0x13, 0x33, 0x33, 0x33,
-    0x13, 0x13, 0x33, 0x33,
-    0x13, 0x13, 0x13, 0x33,
-    0x13, 0x36, 0x36, 0x36,
-    0x13, 0x13, 0x36, 0x36,
-    0x13, 0x13, 0x13, 0x36,
-    0x13, 0x25, 0x2E, 0x37,
-    0x13, 0x1C, 0x2E, 0x37,
-    0x13, 0x1C, 0x25, 0x37,
-    0x13, 0x3B, 0x3B, 0x3B,
-    0x13, 0x13, 0x3B, 0x3B,
-    0x13, 0x13, 0x13, 0x3B,
-    0x14, 0x15, 0x15, 0x16,
-    0x14, 0x15, 0x16, 0x17,
-    0x14, 0x16, 0x17, 0x18,
-    0x14, 0x15, 0x17, 0x18,
-    0x14, 0x15, 0x16, 0x18,
-    0x14, 0x16, 0x17, 0x19,
-    0x14, 0x16, 0x18, 0x19,
-    0x14, 0x15, 0x18, 0x19,
-    0x14, 0x15, 0x17, 0x19,
-    0x14, 0x16, 0x18, 0x1A,
-    0x14, 0x17, 0x19, 0x1A,
-    0x14, 0x15, 0x19, 0x1A,
-    0x14, 0x15, 0x17, 0x1A,
-    0x14, 0x1A, 0x1A, 0x1A,
-    0x14, 0x14, 0x1A, 0x1A,
-    0x14, 0x14, 0x14, 0x1A,
-    0x14, 0x17, 0x18, 0x1B,
-    0x14, 0x17, 0x1A, 0x1B,
-    0x14, 0x15, 0x1A, 0x1B,
-    0x14, 0x15, 0x18, 0x1B,
-    0x14, 0x17, 0x19, 0x1C,
-    0x14, 0x18, 0x1A, 0x1C,
-    0x14, 0x16, 0x1A, 0x1C,
-    0x14, 0x16, 0x18, 0x1C,
-    0x14, 0x1C, 0x1C, 0x1C,
-    0x14, 0x14, 0x1C, 0x1C,
-    0x14, 0x14, 0x14, 0x1C,
-    0x14, 0x18, 0x1B, 0x1F,
-    0x14, 0x19, 0x1D, 0x1F,
-    0x14, 0x16, 0x1D, 0x1F,
-    0x14, 0x16, 0x1A, 0x1F,
-    0x14, 0x1F, 0x1F, 0x1F,
-    0x14, 0x14, 0x1F, 0x1F,
-    0x14, 0x14, 0x14, 0x1F,
-    0x14, 0x19, 0x1D, 0x22,
-    0x14, 0x1B, 0x1F, 0x22,
-    0x14, 0x17, 0x1F, 0x22,
-    0x14, 0x17, 0x1B, 0x22,
-    0x14, 0x22, 0x22, 0x22,
-    0x14, 0x14, 0x22, 0x22,
-    0x14, 0x14, 0x14, 0x22,
-    0x14, 0x1A, 0x1F, 0x25,
-    0x14, 0x1C, 0x21, 0x25,
-    0x14, 0x18, 0x21, 0x25,
-    0x14, 0x18, 0x1D, 0x25,
-    0x14, 0x25, 0x25, 0x25,
-    0x14, 0x14, 0x25, 0x25,
-    0x14, 0x14, 0x14, 0x25,
-    0x14, 0x1B, 0x21, 0x28,
-    0x14, 0x1E, 0x23, 0x28,
-    0x14, 0x19, 0x23, 0x28,
-    0x14, 0x19, 0x1E, 0x28,
-    0x14, 0x28, 0x28, 0x28,
-    0x14, 0x14, 0x28, 0x28,
-    0x14, 0x14, 0x14, 0x28,
-    0x14, 0x1F, 0x26, 0x2B,
-    0x14, 0x19, 0x26, 0x2B,
-    0x14, 0x19, 0x20, 0x2B,
-    0x14, 0x2B, 0x2B, 0x2B,
-    0x14, 0x14, 0x2B, 0x2B,
-    0x14, 0x14, 0x14, 0x2B,
-    0x14, 0x21, 0x28, 0x2E,
-    0x14, 0x1A, 0x28, 0x2E,
-    0x14, 0x1A, 0x21, 0x2E,
-    0x14, 0x2E, 0x2E, 0x2E,
-    0x14, 0x14, 0x2E, 0x2E,
-    0x14, 0x14, 0x14, 0x2E,
-    0x14, 0x22, 0x2A, 0x31,
-    0x14, 0x1B, 0x2A, 0x31,
-    0x14, 0x1B, 0x23, 0x31,
-    0x14, 0x31, 0x31, 0x31,
-    0x14, 0x14, 0x31, 0x31,
-    0x14, 0x14, 0x14, 0x31,
-    0x14, 0x24, 0x2C, 0x34,
-    0x14, 0x1C, 0x2C, 0x34,
-    0x14, 0x1C, 0x24, 0x34,
-    0x14, 0x34, 0x34, 0x34,
-    0x14, 0x14, 0x34, 0x34,
-    0x14, 0x14, 0x14, 0x34,
-    0x14, 0x37, 0x37, 0x37,
-    0x14, 0x14, 0x37, 0x37,
-    0x14, 0x14, 0x14, 0x37,
-    0x14, 0x26, 0x2F, 0x38,
-    0x14, 0x1D, 0x2F, 0x38,
-    0x14, 0x1D, 0x26, 0x38,
-    0x14, 0x3C, 0x3C, 0x3C,
-    0x14, 0x14, 0x3C, 0x3C,
-    0x14, 0x14, 0x14, 0x3C,
-    0x15, 0x16, 0x16, 0x17,
-    0x15, 0x16, 0x17, 0x18,
-    0x15, 0x17, 0x18, 0x19,
-    0x15, 0x16, 0x18, 0x19,
-    0x15, 0x16, 0x17, 0x19,
-    0x15, 0x17, 0x18, 0x1A,
-    0x15, 0x17, 0x19, 0x1A,
-    0x15, 0x16, 0x19, 0x1A,
-    0x15, 0x16, 0x18, 0x1A,
-    0x15, 0x17, 0x19, 0x1B,
-    0x15, 0x18, 0x1A, 0x1B,
-    0x15, 0x16, 0x1A, 0x1B,
-    0x15, 0x16, 0x18, 0x1B,
-    0x15, 0x1B, 0x1B, 0x1B,
-    0x15, 0x15, 0x1B, 0x1B,
-    0x15, 0x15, 0x15, 0x1B,
-    0x15, 0x18, 0x19, 0x1C,
-    0x15, 0x18, 0x1B, 0x1C,
-    0x15, 0x16, 0x1B, 0x1C,
-    0x15, 0x16, 0x19, 0x1C,
-    0x15, 0x18, 0x1A, 0x1D,
-    0x15, 0x19, 0x1B, 0x1D,
-    0x15, 0x17, 0x1B, 0x1D,
-    0x15, 0x17, 0x19, 0x1D,
-    0x15, 0x1D, 0x1D, 0x1D,
-    0x15, 0x15, 0x1D, 0x1D,
-    0x15, 0x15, 0x15, 0x1D,
-    0x15, 0x19, 0x1C, 0x20,
-    0x15, 0x1A, 0x1E, 0x20,
-    0x15, 0x17, 0x1E, 0x20,
-    0x15, 0x17, 0x1B, 0x20,
-    0x15, 0x20, 0x20, 0x20,
-    0x15, 0x15, 0x20, 0x20,
-    0x15, 0x15, 0x15, 0x20,
-    0x15, 0x1A, 0x1E, 0x23,
-    0x15, 0x1C, 0x20, 0x23,
-    0x15, 0x18, 0x20, 0x23,
-    0x15, 0x18, 0x1C, 0x23,
-    0x15, 0x23, 0x23, 0x23,
-    0x15, 0x15, 0x23, 0x23,
-    0x15, 0x15, 0x15, 0x23,
-    0x15, 0x1B, 0x20, 0x26,
-    0x15, 0x1D, 0x22, 0x26,
-    0x15, 0x19, 0x22, 0x26,
-    0x15, 0x19, 0x1E, 0x26,
-    0x15, 0x26, 0x26, 0x26,
-    0x15, 0x15, 0x26, 0x26,
-    0x15, 0x15, 0x15, 0x26,
-    0x15, 0x1C, 0x22, 0x29,
-    0x15, 0x1F, 0x24, 0x29,
-    0x15, 0x1A, 0x24, 0x29,
-    0x15, 0x1A, 0x1F, 0x29,
-    0x15, 0x29, 0x29, 0x29,
-    0x15, 0x15, 0x29, 0x29,
-    0x15, 0x15, 0x15, 0x29,
-    0x15, 0x20, 0x27, 0x2C,
-    0x15, 0x1A, 0x27, 0x2C,
-    0x15, 0x1A, 0x21, 0x2C,
-    0x15, 0x2C, 0x2C, 0x2C,
-    0x15, 0x15, 0x2C, 0x2C,
-    0x15, 0x15, 0x15, 0x2C,
-    0x15, 0x22, 0x29, 0x2F,
-    0x15, 0x1B, 0x29, 0x2F,
-    0x15, 0x1B, 0x22, 0x2F,
-    0x15, 0x2F, 0x2F, 0x2F,
-    0x15, 0x15, 0x2F, 0x2F,
-    0x15, 0x15, 0x15, 0x2F,
-    0x15, 0x23, 0x2B, 0x32,
-    0x15, 0x1C, 0x2B, 0x32,
-    0x15, 0x1C, 0x24, 0x32,
-    0x15, 0x32, 0x32, 0x32,
-    0x15, 0x15, 0x32, 0x32,
-    0x15, 0x15, 0x15, 0x32,
-    0x15, 0x25, 0x2D, 0x35,
-    0x15, 0x1D, 0x2D, 0x35,
-    0x15, 0x1D, 0x25, 0x35,
-    0x15, 0x35, 0x35, 0x35,
-    0x15, 0x15, 0x35, 0x35,
-    0x15, 0x15, 0x15, 0x35,
-    0x15, 0x38, 0x38, 0x38,
-    0x15, 0x15, 0x38, 0x38,
-    0x15, 0x15, 0x15, 0x38,
-    0x15, 0x27, 0x30, 0x39,
-    0x15, 0x1E, 0x30, 0x39,
-    0x15, 0x1E, 0x27, 0x39,
-    0x15, 0x3D, 0x3D, 0x3D,
-    0x15, 0x15, 0x3D, 0x3D,
-    0x15, 0x15, 0x15, 0x3D,
-    0x16, 0x17, 0x17, 0x18,
-    0x16, 0x17, 0x18, 0x19,
-    0x16, 0x18, 0x19, 0x1A,
-    0x16, 0x17, 0x19, 0x1A,
-    0x16, 0x17, 0x18, 0x1A,
-    0x16, 0x18, 0x19, 0x1B,
-    0x16, 0x18, 0x1A, 0x1B,
-    0x16, 0x17, 0x1A, 0x1B,
-    0x16, 0x17, 0x19, 0x1B,
-    0x16, 0x18, 0x1A, 0x1C,
-    0x16, 0x19, 0x1B, 0x1C,
-    0x16, 0x17, 0x1B, 0x1C,
-    0x16, 0x17, 0x19, 0x1C,
-    0x16, 0x1C, 0x1C, 0x1C,
-    0x16, 0x16, 0x1C, 0x1C,
-    0x16, 0x16, 0x16, 0x1C,
-    0x16, 0x19, 0x1A, 0x1D,
-    0x16, 0x19, 0x1C, 0x1D,
-    0x16, 0x17, 0x1C, 0x1D,
-    0x16, 0x17, 0x1A, 0x1D,
-    0x16, 0x19, 0x1B, 0x1E,
-    0x16, 0x1A, 0x1C, 0x1E,
-    0x16, 0x18, 0x1C, 0x1E,
-    0x16, 0x18, 0x1A, 0x1E,
-    0x16, 0x1E, 0x1E, 0x1E,
-    0x16, 0x16, 0x1E, 0x1E,
-    0x16, 0x16, 0x16, 0x1E,
-    0x16, 0x1A, 0x1D, 0x21,
-    0x16, 0x1B, 0x1F, 0x21,
-    0x16, 0x18, 0x1F, 0x21,
-    0x16, 0x18, 0x1C, 0x21,
-    0x16, 0x21, 0x21, 0x21,
-    0x16, 0x16, 0x21, 0x21,
-    0x16, 0x16, 0x16, 0x21,
-    0x16, 0x1B, 0x1F, 0x24,
-    0x16, 0x1D, 0x21, 0x24,
-    0x16, 0x19, 0x21, 0x24,
-    0x16, 0x19, 0x1D, 0x24,
-    0x16, 0x24, 0x24, 0x24,
-    0x16, 0x16, 0x24, 0x24,
-    0x16, 0x16, 0x16, 0x24,
-    0x16, 0x1C, 0x21, 0x27,
-    0x16, 0x1E, 0x23, 0x27,
-    0x16, 0x1A, 0x23, 0x27,
-    0x16, 0x1A, 0x1F, 0x27,
-    0x16, 0x27, 0x27, 0x27,
-    0x16, 0x16, 0x27, 0x27,
-    0x16, 0x16, 0x16, 0x27,
-    0x16, 0x1D, 0x23, 0x2A,
-    0x16, 0x20, 0x25, 0x2A,
-    0x16, 0x1B, 0x25, 0x2A,
-    0x16, 0x1B, 0x20, 0x2A,
-    0x16, 0x2A, 0x2A, 0x2A,
-    0x16, 0x16, 0x2A, 0x2A,
-    0x16, 0x16, 0x16, 0x2A,
-    0x16, 0x21, 0x28, 0x2D,
-    0x16, 0x1B, 0x28, 0x2D,
-    0x16, 0x1B, 0x22, 0x2D,
-    0x16, 0x2D, 0x2D, 0x2D,
-    0x16, 0x16, 0x2D, 0x2D,
-    0x16, 0x16, 0x16, 0x2D,
-    0x16, 0x23, 0x2A, 0x30,
-    0x16, 0x1C, 0x2A, 0x30,
-    0x16, 0x1C, 0x23, 0x30,
-    0x16, 0x30, 0x30, 0x30,
-    0x16, 0x16, 0x30, 0x30,
-    0x16, 0x16, 0x16, 0x30,
-    0x16, 0x24, 0x2C, 0x33,
-    0x16, 0x1D, 0x2C, 0x33,
-    0x16, 0x1D, 0x25, 0x33,
-    0x16, 0x33, 0x33, 0x33,
-    0x16, 0x16, 0x33, 0x33,
-    0x16, 0x16, 0x16, 0x33,
-    0x16, 0x26, 0x2E, 0x36,
-    0x16, 0x1E, 0x2E, 0x36,
-    0x16, 0x1E, 0x26, 0x36,
-    0x16, 0x36, 0x36, 0x36,
-    0x16, 0x16, 0x36, 0x36,
-    0x16, 0x16, 0x16, 0x36,
-    0x16, 0x39, 0x39, 0x39,
-    0x16, 0x16, 0x39, 0x39,
-    0x16, 0x16, 0x16, 0x39,
-    0x16, 0x28, 0x31, 0x3A,
-    0x16, 0x1F, 0x31, 0x3A,
-    0x16, 0x1F, 0x28, 0x3A,
-    0x16, 0x3E, 0x3E, 0x3E,
-    0x16, 0x16, 0x3E, 0x3E,
-    0x16, 0x16, 0x16, 0x3E,
-    0x17, 0x18, 0x18, 0x19,
-    0x17, 0x18, 0x19, 0x1A,
-    0x17, 0x19, 0x1A, 0x1B,
-    0x17, 0x18, 0x1A, 0x1B,
-    0x17, 0x18, 0x19, 0x1B,
-    0x17, 0x19, 0x1A, 0x1C,
-    0x17, 0x19, 0x1B, 0x1C,
-    0x17, 0x18, 0x1B, 0x1C,
-    0x17, 0x18, 0x1A, 0x1C,
-    0x17, 0x19, 0x1B, 0x1D,
-    0x17, 0x1A, 0x1C, 0x1D,
-    0x17, 0x18, 0x1C, 0x1D,
-    0x17, 0x18, 0x1A, 0x1D,
-    0x17, 0x1D, 0x1D, 0x1D,
-    0x17, 0x17, 0x1D, 0x1D,
-    0x17, 0x17, 0x17, 0x1D,
-    0x17, 0x1A, 0x1B, 0x1E,
-    0x17, 0x1A, 0x1D, 0x1E,
-    0x17, 0x18, 0x1D, 0x1E,
-    0x17, 0x18, 0x1B, 0x1E,
-    0x17, 0x1A, 0x1C, 0x1F,
-    0x17, 0x1B, 0x1D, 0x1F,
-    0x17, 0x19, 0x1D, 0x1F,
-    0x17, 0x19, 0x1B, 0x1F,
-    0x17, 0x1F, 0x1F, 0x1F,
-    0x17, 0x17, 0x1F, 0x1F,
-    0x17, 0x17, 0x17, 0x1F,
-    0x17, 0x1B, 0x1E, 0x22,
-    0x17, 0x1C, 0x20, 0x22,
-    0x17, 0x19, 0x20, 0x22,
-    0x17, 0x19, 0x1D, 0x22,
-    0x17, 0x22, 0x22, 0x22,
-    0x17, 0x17, 0x22, 0x22,
-    0x17, 0x17, 0x17, 0x22,
-    0x17, 0x1C, 0x20, 0x25,
-    0x17, 0x1E, 0x22, 0x25,
-    0x17, 0x1A, 0x22, 0x25,
-    0x17, 0x1A, 0x1E, 0x25,
-    0x17, 0x25, 0x25, 0x25,
-    0x17, 0x17, 0x25, 0x25,
-    0x17, 0x17, 0x17, 0x25,
-    0x17, 0x1D, 0x22, 0x28,
-    0x17, 0x1F, 0x24, 0x28,
-    0x17, 0x1B, 0x24, 0x28,
-    0x17, 0x1B, 0x20, 0x28,
-    0x17, 0x28, 0x28, 0x28,
-    0x17, 0x17, 0x28, 0x28,
-    0x17, 0x17, 0x17, 0x28,
-    0x17, 0x1E, 0x24, 0x2B,
-    0x17, 0x21, 0x26, 0x2B,
-    0x17, 0x1C, 0x26, 0x2B,
-    0x17, 0x1C, 0x21, 0x2B,
-    0x17, 0x2B, 0x2B, 0x2B,
-    0x17, 0x17, 0x2B, 0x2B,
-    0x17, 0x17, 0x17, 0x2B,
-    0x17, 0x22, 0x29, 0x2E,
-    0x17, 0x1C, 0x29, 0x2E,
-    0x17, 0x1C, 0x23, 0x2E,
-    0x17, 0x2E, 0x2E, 0x2E,
-    0x17, 0x17, 0x2E, 0x2E,
-    0x17, 0x17, 0x17, 0x2E,
-    0x17, 0x24, 0x2B, 0x31,
-    0x17, 0x1D, 0x2B, 0x31,
-    0x17, 0x1D, 0x24, 0x31,
-    0x17, 0x31, 0x31, 0x31,
-    0x17, 0x17, 0x31, 0x31,
-    0x17, 0x17, 0x17, 0x31,
-    0x17, 0x25, 0x2D, 0x34,
-    0x17, 0x1E, 0x2D, 0x34,
-    0x17, 0x1E, 0x26, 0x34,
-    0x17, 0x34, 0x34, 0x34,
-    0x17, 0x17, 0x34, 0x34,
-    0x17, 0x17, 0x17, 0x34,
-    0x17, 0x27, 0x2F, 0x37,
-    0x17, 0x1F, 0x2F, 0x37,
-    0x17, 0x1F, 0x27, 0x37,
-    0x17, 0x37, 0x37, 0x37,
-    0x17, 0x17, 0x37, 0x37,
-    0x17, 0x17, 0x17, 0x37,
-    0x17, 0x3A, 0x3A, 0x3A,
-    0x17, 0x17, 0x3A, 0x3A,
-    0x17, 0x17, 0x17, 0x3A,
-    0x17, 0x29, 0x32, 0x3B,
-    0x17, 0x20, 0x32, 0x3B,
-    0x17, 0x20, 0x29, 0x3B,
-    0x17, 0x3F, 0x3F, 0x3F,
-    0x17, 0x17, 0x3F, 0x3F,
-    0x17, 0x17, 0x17, 0x3F,
-    0x18, 0x19, 0x19, 0x1A,
-    0x18, 0x19, 0x1A, 0x1B,
-    0x18, 0x1A, 0x1B, 0x1C,
-    0x18, 0x19, 0x1B, 0x1C,
-    0x18, 0x19, 0x1A, 0x1C,
-    0x18, 0x1A, 0x1B, 0x1D,
-    0x18, 0x1A, 0x1C, 0x1D,
-    0x18, 0x19, 0x1C, 0x1D,
-    0x18, 0x19, 0x1B, 0x1D,
-    0x18, 0x1A, 0x1C, 0x1E,
-    0x18, 0x1B, 0x1D, 0x1E,
-    0x18, 0x19, 0x1D, 0x1E,
-    0x18, 0x19, 0x1B, 0x1E,
-    0x18, 0x1E, 0x1E, 0x1E,
-    0x18, 0x18, 0x1E, 0x1E,
-    0x18, 0x18, 0x18, 0x1E,
-    0x18, 0x1B, 0x1C, 0x1F,
-    0x18, 0x1B, 0x1E, 0x1F,
-    0x18, 0x19, 0x1E, 0x1F,
-    0x18, 0x19, 0x1C, 0x1F,
-    0x18, 0x1B, 0x1D, 0x20,
-    0x18, 0x1C, 0x1E, 0x20,
-    0x18, 0x1A, 0x1E, 0x20,
-    0x18, 0x1A, 0x1C, 0x20,
-    0x18, 0x20, 0x20, 0x20,
-    0x18, 0x18, 0x20, 0x20,
-    0x18, 0x18, 0x18, 0x20,
-    0x18, 0x1C, 0x1F, 0x23,
-    0x18, 0x1D, 0x21, 0x23,
-    0x18, 0x1A, 0x21, 0x23,
-    0x18, 0x1A, 0x1E, 0x23,
-    0x18, 0x23, 0x23, 0x23,
-    0x18, 0x18, 0x23, 0x23,
-    0x18, 0x18, 0x18, 0x23,
-    0x18, 0x1D, 0x21, 0x26,
-    0x18, 0x1F, 0x23, 0x26,
-    0x18, 0x1B, 0x23, 0x26,
-    0x18, 0x1B, 0x1F, 0x26,
-    0x18, 0x26, 0x26, 0x26,
-    0x18, 0x18, 0x26, 0x26,
-    0x18, 0x18, 0x18, 0x26,
-    0x18, 0x1E, 0x23, 0x29,
-    0x18, 0x20, 0x25, 0x29,
-    0x18, 0x1C, 0x25, 0x29,
-    0x18, 0x1C, 0x21, 0x29,
-    0x18, 0x29, 0x29, 0x29,
-    0x18, 0x18, 0x29, 0x29,
-    0x18, 0x18, 0x18, 0x29,
-    0x18, 0x1F, 0x25, 0x2C,
-    0x18, 0x22, 0x27, 0x2C,
-    0x18, 0x1D, 0x27, 0x2C,
-    0x18, 0x1D, 0x22, 0x2C,
-    0x18, 0x2C, 0x2C, 0x2C,
-    0x18, 0x18, 0x2C, 0x2C,
-    0x18, 0x18, 0x18, 0x2C,
-    0x18, 0x23, 0x2A, 0x2F,
-    0x18, 0x1D, 0x2A, 0x2F,
-    0x18, 0x1D, 0x24, 0x2F,
-    0x18, 0x2F, 0x2F, 0x2F,
-    0x18, 0x18, 0x2F, 0x2F,
-    0x18, 0x18, 0x18, 0x2F,
-    0x18, 0x25, 0x2C, 0x32,
-    0x18, 0x1E, 0x2C, 0x32,
-    0x18, 0x1E, 0x25, 0x32,
-    0x18, 0x32, 0x32, 0x32,
-    0x18, 0x18, 0x32, 0x32,
-    0x18, 0x18, 0x18, 0x32,
-    0x18, 0x26, 0x2E, 0x35,
-    0x18, 0x1F, 0x2E, 0x35,
-    0x18, 0x1F, 0x27, 0x35,
-    0x18, 0x35, 0x35, 0x35,
-    0x18, 0x18, 0x35, 0x35,
-    0x18, 0x18, 0x18, 0x35,
-    0x18, 0x28, 0x30, 0x38,
-    0x18, 0x20, 0x30, 0x38,
-    0x18, 0x20, 0x28, 0x38,
-    0x18, 0x38, 0x38, 0x38,
-    0x18, 0x18, 0x38, 0x38,
-    0x18, 0x18, 0x18, 0x38,
-    0x18, 0x3B, 0x3B, 0x3B,
-    0x18, 0x18, 0x3B, 0x3B,
-    0x18, 0x18, 0x18, 0x3B,
-    0x18, 0x2A, 0x33, 0x3C,
-    0x18, 0x21, 0x33, 0x3C,
-    0x18, 0x21, 0x2A, 0x3C,
-    0x19, 0x1A, 0x1A, 0x1B,
-    0x19, 0x1A, 0x1B, 0x1C,
-    0x19, 0x1B, 0x1C, 0x1D,
-    0x19, 0x1A, 0x1C, 0x1D,
-    0x19, 0x1A, 0x1B, 0x1D,
-    0x19, 0x1B, 0x1C, 0x1E,
-    0x19, 0x1B, 0x1D, 0x1E,
-    0x19, 0x1A, 0x1D, 0x1E,
-    0x19, 0x1A, 0x1C, 0x1E,
-    0x19, 0x1B, 0x1D, 0x1F,
-    0x19, 0x1C, 0x1E, 0x1F,
-    0x19, 0x1A, 0x1E, 0x1F,
-    0x19, 0x1A, 0x1C, 0x1F,
-    0x19, 0x1F, 0x1F, 0x1F,
-    0x19, 0x19, 0x1F, 0x1F,
-    0x19, 0x19, 0x19, 0x1F,
-    0x19, 0x1C, 0x1D, 0x20,
-    0x19, 0x1C, 0x1F, 0x20,
-    0x19, 0x1A, 0x1F, 0x20,
-    0x19, 0x1A, 0x1D, 0x20,
-    0x19, 0x1C, 0x1E, 0x21,
-    0x19, 0x1D, 0x1F, 0x21,
-    0x19, 0x1B, 0x1F, 0x21,
-    0x19, 0x1B, 0x1D, 0x21,
-    0x19, 0x21, 0x21, 0x21,
-    0x19, 0x19, 0x21, 0x21,
-    0x19, 0x19, 0x19, 0x21,
-    0x19, 0x1D, 0x20, 0x24,
-    0x19, 0x1E, 0x22, 0x24,
-    0x19, 0x1B, 0x22, 0x24,
-    0x19, 0x1B, 0x1F, 0x24,
-    0x19, 0x24, 0x24, 0x24,
-    0x19, 0x19, 0x24, 0x24,
-    0x19, 0x19, 0x19, 0x24,
-    0x19, 0x1E, 0x22, 0x27,
-    0x19, 0x20, 0x24, 0x27,
-    0x19, 0x1C, 0x24, 0x27,
-    0x19, 0x1C, 0x20, 0x27,
-    0x19, 0x27, 0x27, 0x27,
-    0x19, 0x19, 0x27, 0x27,
-    0x19, 0x19, 0x19, 0x27,
-    0x19, 0x1F, 0x24, 0x2A,
-    0x19, 0x21, 0x26, 0x2A,
-    0x19, 0x1D, 0x26, 0x2A,
-    0x19, 0x1D, 0x22, 0x2A,
-    0x19, 0x2A, 0x2A, 0x2A,
-    0x19, 0x19, 0x2A, 0x2A,
-    0x19, 0x19, 0x19, 0x2A,
-    0x19, 0x20, 0x26, 0x2D,
-    0x19, 0x23, 0x28, 0x2D,
-    0x19, 0x1E, 0x28, 0x2D,
-    0x19, 0x1E, 0x23, 0x2D,
-    0x19, 0x2D, 0x2D, 0x2D,
-    0x19, 0x19, 0x2D, 0x2D,
-    0x19, 0x19, 0x19, 0x2D,
-    0x19, 0x24, 0x2B, 0x30,
-    0x19, 0x1E, 0x2B, 0x30,
-    0x19, 0x1E, 0x25, 0x30,
-    0x19, 0x30, 0x30, 0x30,
-    0x19, 0x19, 0x30, 0x30,
-    0x19, 0x19, 0x19, 0x30,
-    0x19, 0x26, 0x2D, 0x33,
-    0x19, 0x1F, 0x2D, 0x33,
-    0x19, 0x1F, 0x26, 0x33,
-    0x19, 0x33, 0x33, 0x33,
-    0x19, 0x19, 0x33, 0x33,
-    0x19, 0x19, 0x19, 0x33,
-    0x19, 0x27, 0x2F, 0x36,
-    0x19, 0x20, 0x2F, 0x36,
-    0x19, 0x20, 0x28, 0x36,
-    0x19, 0x36, 0x36, 0x36,
-    0x19, 0x19, 0x36, 0x36,
-    0x19, 0x19, 0x19, 0x36,
-    0x19, 0x29, 0x31, 0x39,
-    0x19, 0x21, 0x31, 0x39,
-    0x19, 0x21, 0x29, 0x39,
-    0x19, 0x39, 0x39, 0x39,
-    0x19, 0x19, 0x39, 0x39,
-    0x19, 0x19, 0x19, 0x39,
-    0x19, 0x3C, 0x3C, 0x3C,
-    0x19, 0x19, 0x3C, 0x3C,
-    0x19, 0x19, 0x19, 0x3C,
-    0x19, 0x2B, 0x34, 0x3D,
-    0x19, 0x22, 0x34, 0x3D,
-    0x19, 0x22, 0x2B, 0x3D,
-    0x1A, 0x1B, 0x1B, 0x1C,
-    0x1A, 0x1B, 0x1C, 0x1D,
-    0x1A, 0x1C, 0x1D, 0x1E,
-    0x1A, 0x1B, 0x1D, 0x1E,
-    0x1A, 0x1B, 0x1C, 0x1E,
-    0x1A, 0x1C, 0x1D, 0x1F,
-    0x1A, 0x1C, 0x1E, 0x1F,
-    0x1A, 0x1B, 0x1E, 0x1F,
-    0x1A, 0x1B, 0x1D, 0x1F,
-    0x1A, 0x1C, 0x1E, 0x20,
-    0x1A, 0x1D, 0x1F, 0x20,
-    0x1A, 0x1B, 0x1F, 0x20,
-    0x1A, 0x1B, 0x1D, 0x20,
-    0x1A, 0x20, 0x20, 0x20,
-    0x1A, 0x1A, 0x20, 0x20,
-    0x1A, 0x1A, 0x1A, 0x20,
-    0x1A, 0x1D, 0x1E, 0x21,
-    0x1A, 0x1D, 0x20, 0x21,
-    0x1A, 0x1B, 0x20, 0x21,
-    0x1A, 0x1B, 0x1E, 0x21,
-    0x1A, 0x1D, 0x1F, 0x22,
-    0x1A, 0x1E, 0x20, 0x22,
-    0x1A, 0x1C, 0x20, 0x22,
-    0x1A, 0x1C, 0x1E, 0x22,
-    0x1A, 0x22, 0x22, 0x22,
-    0x1A, 0x1A, 0x22, 0x22,
-    0x1A, 0x1A, 0x1A, 0x22,
-    0x1A, 0x1E, 0x21, 0x25,
-    0x1A, 0x1F, 0x23, 0x25,
-    0x1A, 0x1C, 0x23, 0x25,
-    0x1A, 0x1C, 0x20, 0x25,
-    0x1A, 0x25, 0x25, 0x25,
-    0x1A, 0x1A, 0x25, 0x25,
-    0x1A, 0x1A, 0x1A, 0x25,
-    0x1A, 0x1F, 0x23, 0x28,
-    0x1A, 0x21, 0x25, 0x28,
-    0x1A, 0x1D, 0x25, 0x28,
-    0x1A, 0x1D, 0x21, 0x28,
-    0x1A, 0x28, 0x28, 0x28,
-    0x1A, 0x1A, 0x28, 0x28,
-    0x1A, 0x1A, 0x1A, 0x28,
-    0x1A, 0x20, 0x25, 0x2B,
-    0x1A, 0x22, 0x27, 0x2B,
-    0x1A, 0x1E, 0x27, 0x2B,
-    0x1A, 0x1E, 0x23, 0x2B,
-    0x1A, 0x2B, 0x2B, 0x2B,
-    0x1A, 0x1A, 0x2B, 0x2B,
-    0x1A, 0x1A, 0x1A, 0x2B,
-    0x1A, 0x21, 0x27, 0x2E,
-    0x1A, 0x24, 0x29, 0x2E,
-    0x1A, 0x1F, 0x29, 0x2E,
-    0x1A, 0x1F, 0x24, 0x2E,
-    0x1A, 0x2E, 0x2E, 0x2E,
-    0x1A, 0x1A, 0x2E, 0x2E,
-    0x1A, 0x1A, 0x1A, 0x2E,
-    0x1A, 0x25, 0x2C, 0x31,
-    0x1A, 0x1F, 0x2C, 0x31,
-    0x1A, 0x1F, 0x26, 0x31,
-    0x1A, 0x31, 0x31, 0x31,
-    0x1A, 0x1A, 0x31, 0x31,
-    0x1A, 0x1A, 0x1A, 0x31,
-    0x1A, 0x27, 0x2E, 0x34,
-    0x1A, 0x20, 0x2E, 0x34,
-    0x1A, 0x20, 0x27, 0x34,
-    0x1A, 0x34, 0x34, 0x34,
-    0x1A, 0x1A, 0x34, 0x34,
-    0x1A, 0x1A, 0x1A, 0x34,
-    0x1A, 0x28, 0x30, 0x37,
-    0x1A, 0x21, 0x30, 0x37,
-    0x1A, 0x21, 0x29, 0x37,
-    0x1A, 0x37, 0x37, 0x37,
-    0x1A, 0x1A, 0x37, 0x37,
-    0x1A, 0x1A, 0x1A, 0x37,
-    0x1A, 0x2A, 0x32, 0x3A,
-    0x1A, 0x22, 0x32, 0x3A,
-    0x1A, 0x22, 0x2A, 0x3A,
-    0x1A, 0x3A, 0x3A, 0x3A,
-    0x1A, 0x1A, 0x3A, 0x3A,
-    0x1A, 0x1A, 0x1A, 0x3A,
-    0x1A, 0x3D, 0x3D, 0x3D,
-    0x1A, 0x1A, 0x3D, 0x3D,
-    0x1A, 0x1A, 0x1A, 0x3D,
-    0x1A, 0x2C, 0x35, 0x3E,
-    0x1A, 0x23, 0x35, 0x3E,
-    0x1A, 0x23, 0x2C, 0x3E,
-    0x1B, 0x1C, 0x1C, 0x1D,
-    0x1B, 0x1C, 0x1D, 0x1E,
-    0x1B, 0x1D, 0x1E, 0x1F,
-    0x1B, 0x1C, 0x1E, 0x1F,
-    0x1B, 0x1C, 0x1D, 0x1F,
-    0x1B, 0x1D, 0x1E, 0x20,
-    0x1B, 0x1D, 0x1F, 0x20,
-    0x1B, 0x1C, 0x1F, 0x20,
-    0x1B, 0x1C, 0x1E, 0x20,
-    0x1B, 0x1D, 0x1F, 0x21,
-    0x1B, 0x1E, 0x20, 0x21,
-    0x1B, 0x1C, 0x20, 0x21,
-    0x1B, 0x1C, 0x1E, 0x21,
-    0x1B, 0x21, 0x21, 0x21,
-    0x1B, 0x1B, 0x21, 0x21,
-    0x1B, 0x1B, 0x1B, 0x21,
-    0x1B, 0x1E, 0x1F, 0x22,
-    0x1B, 0x1E, 0x21, 0x22,
-    0x1B, 0x1C, 0x21, 0x22,
-    0x1B, 0x1C, 0x1F, 0x22,
-    0x1B, 0x1E, 0x20, 0x23,
-    0x1B, 0x1F, 0x21, 0x23,
-    0x1B, 0x1D, 0x21, 0x23,
-    0x1B, 0x1D, 0x1F, 0x23,
-    0x1B, 0x23, 0x23, 0x23,
-    0x1B, 0x1B, 0x23, 0x23,
-    0x1B, 0x1B, 0x1B, 0x23,
-    0x1B, 0x1F, 0x22, 0x26,
-    0x1B, 0x20, 0x24, 0x26,
-    0x1B, 0x1D, 0x24, 0x26,
-    0x1B, 0x1D, 0x21, 0x26,
-    0x1B, 0x26, 0x26, 0x26,
-    0x1B, 0x1B, 0x26, 0x26,
-    0x1B, 0x1B, 0x1B, 0x26,
-    0x1B, 0x20, 0x24, 0x29,
-    0x1B, 0x22, 0x26, 0x29,
-    0x1B, 0x1E, 0x26, 0x29,
-    0x1B, 0x1E, 0x22, 0x29,
-    0x1B, 0x29, 0x29, 0x29,
-    0x1B, 0x1B, 0x29, 0x29,
-    0x1B, 0x1B, 0x1B, 0x29,
-    0x1B, 0x21, 0x26, 0x2C,
-    0x1B, 0x23, 0x28, 0x2C,
-    0x1B, 0x1F, 0x28, 0x2C,
-    0x1B, 0x1F, 0x24, 0x2C,
-    0x1B, 0x2C, 0x2C, 0x2C,
-    0x1B, 0x1B, 0x2C, 0x2C,
-    0x1B, 0x1B, 0x1B, 0x2C,
-    0x1B, 0x22, 0x28, 0x2F,
-    0x1B, 0x25, 0x2A, 0x2F,
-    0x1B, 0x20, 0x2A, 0x2F,
-    0x1B, 0x20, 0x25, 0x2F,
-    0x1B, 0x2F, 0x2F, 0x2F,
-    0x1B, 0x1B, 0x2F, 0x2F,
-    0x1B, 0x1B, 0x1B, 0x2F,
-    0x1B, 0x26, 0x2D, 0x32,
-    0x1B, 0x20, 0x2D, 0x32,
-    0x1B, 0x20, 0x27, 0x32,
-    0x1B, 0x32, 0x32, 0x32,
-    0x1B, 0x1B, 0x32, 0x32,
-    0x1B, 0x1B, 0x1B, 0x32,
-    0x1B, 0x28, 0x2F, 0x35,
-    0x1B, 0x21, 0x2F, 0x35,
-    0x1B, 0x21, 0x28, 0x35,
-    0x1B, 0x35, 0x35, 0x35,
-    0x1B, 0x1B, 0x35, 0x35,
-    0x1B, 0x1B, 0x1B, 0x35,
-    0x1B, 0x29, 0x31, 0x38,
-    0x1B, 0x22, 0x31, 0x38,
-    0x1B, 0x22, 0x2A, 0x38,
-    0x1B, 0x38, 0x38, 0x38,
-    0x1B, 0x1B, 0x38, 0x38,
-    0x1B, 0x1B, 0x1B, 0x38,
-    0x1B, 0x2B, 0x33, 0x3B,
-    0x1B, 0x23, 0x33, 0x3B,
-    0x1B, 0x23, 0x2B, 0x3B,
-    0x1B, 0x3B, 0x3B, 0x3B,
-    0x1B, 0x1B, 0x3B, 0x3B,
-    0x1B, 0x1B, 0x1B, 0x3B,
-    0x1B, 0x3E, 0x3E, 0x3E,
-    0x1B, 0x1B, 0x3E, 0x3E,
-    0x1B, 0x1B, 0x1B, 0x3E,
-    0x1B, 0x2D, 0x36, 0x3F,
-    0x1B, 0x24, 0x36, 0x3F,
-    0x1B, 0x24, 0x2D, 0x3F,
-    0x1C, 0x1D, 0x1D, 0x1E,
-    0x1C, 0x1D, 0x1E, 0x1F,
-    0x1C, 0x1E, 0x1F, 0x20,
-    0x1C, 0x1D, 0x1F, 0x20,
-    0x1C, 0x1D, 0x1E, 0x20,
-    0x1C, 0x1E, 0x1F, 0x21,
-    0x1C, 0x1E, 0x20, 0x21,
-    0x1C, 0x1D, 0x20, 0x21,
-    0x1C, 0x1D, 0x1F, 0x21,
-    0x1C, 0x1E, 0x20, 0x22,
-    0x1C, 0x1F, 0x21, 0x22,
-    0x1C, 0x1D, 0x21, 0x22,
-    0x1C, 0x1D, 0x1F, 0x22,
-    0x1C, 0x22, 0x22, 0x22,
-    0x1C, 0x1C, 0x22, 0x22,
-    0x1C, 0x1C, 0x1C, 0x22,
-    0x1C, 0x1F, 0x20, 0x23,
-    0x1C, 0x1F, 0x22, 0x23,
-    0x1C, 0x1D, 0x22, 0x23,
-    0x1C, 0x1D, 0x20, 0x23,
-    0x1C, 0x1F, 0x21, 0x24,
-    0x1C, 0x20, 0x22, 0x24,
-    0x1C, 0x1E, 0x22, 0x24,
-    0x1C, 0x1E, 0x20, 0x24,
-    0x1C, 0x24, 0x24, 0x24,
-    0x1C, 0x1C, 0x24, 0x24,
-    0x1C, 0x1C, 0x1C, 0x24,
-    0x1C, 0x20, 0x23, 0x27,
-    0x1C, 0x21, 0x25, 0x27,
-    0x1C, 0x1E, 0x25, 0x27,
-    0x1C, 0x1E, 0x22, 0x27,
-    0x1C, 0x27, 0x27, 0x27,
-    0x1C, 0x1C, 0x27, 0x27,
-    0x1C, 0x1C, 0x1C, 0x27,
-    0x1C, 0x21, 0x25, 0x2A,
-    0x1C, 0x23, 0x27, 0x2A,
-    0x1C, 0x1F, 0x27, 0x2A,
-    0x1C, 0x1F, 0x23, 0x2A,
-    0x1C, 0x2A, 0x2A, 0x2A,
-    0x1C, 0x1C, 0x2A, 0x2A,
-    0x1C, 0x1C, 0x1C, 0x2A,
-    0x1C, 0x22, 0x27, 0x2D,
-    0x1C, 0x24, 0x29, 0x2D,
-    0x1C, 0x20, 0x29, 0x2D,
-    0x1C, 0x20, 0x25, 0x2D,
-    0x1C, 0x2D, 0x2D, 0x2D,
-    0x1C, 0x1C, 0x2D, 0x2D,
-    0x1C, 0x1C, 0x1C, 0x2D,
-    0x1C, 0x23, 0x29, 0x30,
-    0x1C, 0x26, 0x2B, 0x30,
-    0x1C, 0x21, 0x2B, 0x30,
-    0x1C, 0x21, 0x26, 0x30,
-    0x1C, 0x30, 0x30, 0x30,
-    0x1C, 0x1C, 0x30, 0x30,
-    0x1C, 0x1C, 0x1C, 0x30,
-    0x1C, 0x27, 0x2E, 0x33,
-    0x1C, 0x21, 0x2E, 0x33,
-    0x1C, 0x21, 0x28, 0x33,
-    0x1C, 0x33, 0x33, 0x33,
-    0x1C, 0x1C, 0x33, 0x33,
-    0x1C, 0x1C, 0x1C, 0x33,
-    0x1C, 0x29, 0x30, 0x36,
-    0x1C, 0x22, 0x30, 0x36,
-    0x1C, 0x22, 0x29, 0x36,
-    0x1C, 0x36, 0x36, 0x36,
-    0x1C, 0x1C, 0x36, 0x36,
-    0x1C, 0x1C, 0x1C, 0x36,
-    0x1C, 0x2A, 0x32, 0x39,
-    0x1C, 0x23, 0x32, 0x39,
-    0x1C, 0x23, 0x2B, 0x39,
-    0x1C, 0x39, 0x39, 0x39,
-    0x1C, 0x1C, 0x39, 0x39,
-    0x1C, 0x1C, 0x1C, 0x39,
-    0x1C, 0x2C, 0x34, 0x3C,
-    0x1C, 0x24, 0x34, 0x3C,
-    0x1C, 0x24, 0x2C, 0x3C,
-    0x1C, 0x3C, 0x3C, 0x3C,
-    0x1C, 0x1C, 0x3C, 0x3C,
-    0x1C, 0x1C, 0x1C, 0x3C,
-    0x1C, 0x3F, 0x3F, 0x3F,
-    0x1C, 0x1C, 0x3F, 0x3F,
-    0x1C, 0x1C, 0x1C, 0x3F,
-    0x1D, 0x1E, 0x1E, 0x1F,
-    0x1D, 0x1E, 0x1F, 0x20,
-    0x1D, 0x1F, 0x20, 0x21,
-    0x1D, 0x1E, 0x20, 0x21,
-    0x1D, 0x1E, 0x1F, 0x21,
-    0x1D, 0x1F, 0x20, 0x22,
-    0x1D, 0x1F, 0x21, 0x22,
-    0x1D, 0x1E, 0x21, 0x22,
-    0x1D, 0x1E, 0x20, 0x22,
-    0x1D, 0x1F, 0x21, 0x23,
-    0x1D, 0x20, 0x22, 0x23,
-    0x1D, 0x1E, 0x22, 0x23,
-    0x1D, 0x1E, 0x20, 0x23,
-    0x1D, 0x23, 0x23, 0x23,
-    0x1D, 0x1D, 0x23, 0x23,
-    0x1D, 0x1D, 0x1D, 0x23,
-    0x1D, 0x20, 0x21, 0x24,
-    0x1D, 0x20, 0x23, 0x24,
-    0x1D, 0x1E, 0x23, 0x24,
-    0x1D, 0x1E, 0x21, 0x24,
-    0x1D, 0x20, 0x22, 0x25,
-    0x1D, 0x21, 0x23, 0x25,
-    0x1D, 0x1F, 0x23, 0x25,
-    0x1D, 0x1F, 0x21, 0x25,
-    0x1D, 0x25, 0x25, 0x25,
-    0x1D, 0x1D, 0x25, 0x25,
-    0x1D, 0x1D, 0x1D, 0x25,
-    0x1D, 0x21, 0x24, 0x28,
-    0x1D, 0x22, 0x26, 0x28,
-    0x1D, 0x1F, 0x26, 0x28,
-    0x1D, 0x1F, 0x23, 0x28,
-    0x1D, 0x28, 0x28, 0x28,
-    0x1D, 0x1D, 0x28, 0x28,
-    0x1D, 0x1D, 0x1D, 0x28,
-    0x1D, 0x22, 0x26, 0x2B,
-    0x1D, 0x24, 0x28, 0x2B,
-    0x1D, 0x20, 0x28, 0x2B,
-    0x1D, 0x20, 0x24, 0x2B,
-    0x1D, 0x2B, 0x2B, 0x2B,
-    0x1D, 0x1D, 0x2B, 0x2B,
-    0x1D, 0x1D, 0x1D, 0x2B,
-    0x1D, 0x23, 0x28, 0x2E,
-    0x1D, 0x25, 0x2A, 0x2E,
-    0x1D, 0x21, 0x2A, 0x2E,
-    0x1D, 0x21, 0x26, 0x2E,
-    0x1D, 0x2E, 0x2E, 0x2E,
-    0x1D, 0x1D, 0x2E, 0x2E,
-    0x1D, 0x1D, 0x1D, 0x2E,
-    0x1D, 0x24, 0x2A, 0x31,
-    0x1D, 0x27, 0x2C, 0x31,
-    0x1D, 0x22, 0x2C, 0x31,
-    0x1D, 0x22, 0x27, 0x31,
-    0x1D, 0x31, 0x31, 0x31,
-    0x1D, 0x1D, 0x31, 0x31,
-    0x1D, 0x1D, 0x1D, 0x31,
-    0x1D, 0x28, 0x2F, 0x34,
-    0x1D, 0x22, 0x2F, 0x34,
-    0x1D, 0x22, 0x29, 0x34,
-    0x1D, 0x34, 0x34, 0x34,
-    0x1D, 0x1D, 0x34, 0x34,
-    0x1D, 0x1D, 0x1D, 0x34,
-    0x1D, 0x2A, 0x31, 0x37,
-    0x1D, 0x23, 0x31, 0x37,
-    0x1D, 0x23, 0x2A, 0x37,
-    0x1D, 0x37, 0x37, 0x37,
-    0x1D, 0x1D, 0x37, 0x37,
-    0x1D, 0x1D, 0x1D, 0x37,
-    0x1D, 0x2B, 0x33, 0x3A,
-    0x1D, 0x24, 0x33, 0x3A,
-    0x1D, 0x24, 0x2C, 0x3A,
-    0x1D, 0x3A, 0x3A, 0x3A,
-    0x1D, 0x1D, 0x3A, 0x3A,
-    0x1D, 0x1D, 0x1D, 0x3A,
-    0x1D, 0x2D, 0x35, 0x3D,
-    0x1D, 0x25, 0x35, 0x3D,
-    0x1D, 0x25, 0x2D, 0x3D,
-    0x1D, 0x3D, 0x3D, 0x3D,
-    0x1D, 0x1D, 0x3D, 0x3D,
-    0x1D, 0x1D, 0x1D, 0x3D,
-    0x1E, 0x1F, 0x1F, 0x20,
-    0x1E, 0x1F, 0x20, 0x21,
-    0x1E, 0x20, 0x21, 0x22,
-    0x1E, 0x1F, 0x21, 0x22,
-    0x1E, 0x1F, 0x20, 0x22,
-    0x1E, 0x20, 0x21, 0x23,
-    0x1E, 0x20, 0x22, 0x23,
-    0x1E, 0x1F, 0x22, 0x23,
-    0x1E, 0x1F, 0x21, 0x23,
-    0x1E, 0x20, 0x22, 0x24,
-    0x1E, 0x21, 0x23, 0x24,
-    0x1E, 0x1F, 0x23, 0x24,
-    0x1E, 0x1F, 0x21, 0x24,
-    0x1E, 0x24, 0x24, 0x24,
-    0x1E, 0x1E, 0x24, 0x24,
-    0x1E, 0x1E, 0x1E, 0x24,
-    0x1E, 0x21, 0x22, 0x25,
-    0x1E, 0x21, 0x24, 0x25,
-    0x1E, 0x1F, 0x24, 0x25,
-    0x1E, 0x1F, 0x22, 0x25,
-    0x1E, 0x21, 0x23, 0x26,
-    0x1E, 0x22, 0x24, 0x26,
-    0x1E, 0x20, 0x24, 0x26,
-    0x1E, 0x20, 0x22, 0x26,
-    0x1E, 0x26, 0x26, 0x26,
-    0x1E, 0x1E, 0x26, 0x26,
-    0x1E, 0x1E, 0x1E, 0x26,
-    0x1E, 0x22, 0x25, 0x29,
-    0x1E, 0x23, 0x27, 0x29,
-    0x1E, 0x20, 0x27, 0x29,
-    0x1E, 0x20, 0x24, 0x29,
-    0x1E, 0x29, 0x29, 0x29,
-    0x1E, 0x1E, 0x29, 0x29,
-    0x1E, 0x1E, 0x1E, 0x29,
-    0x1E, 0x23, 0x27, 0x2C,
-    0x1E, 0x25, 0x29, 0x2C,
-    0x1E, 0x21, 0x29, 0x2C,
-    0x1E, 0x21, 0x25, 0x2C,
-    0x1E, 0x2C, 0x2C, 0x2C,
-    0x1E, 0x1E, 0x2C, 0x2C,
-    0x1E, 0x1E, 0x1E, 0x2C,
-    0x1E, 0x24, 0x29, 0x2F,
-    0x1E, 0x26, 0x2B, 0x2F,
-    0x1E, 0x22, 0x2B, 0x2F,
-    0x1E, 0x22, 0x27, 0x2F,
-    0x1E, 0x2F, 0x2F, 0x2F,
-    0x1E, 0x1E, 0x2F, 0x2F,
-    0x1E, 0x1E, 0x1E, 0x2F,
-    0x1E, 0x25, 0x2B, 0x32,
-    0x1E, 0x28, 0x2D, 0x32,
-    0x1E, 0x23, 0x2D, 0x32,
-    0x1E, 0x23, 0x28, 0x32,
-    0x1E, 0x32, 0x32, 0x32,
-    0x1E, 0x1E, 0x32, 0x32,
-    0x1E, 0x1E, 0x1E, 0x32,
-    0x1E, 0x29, 0x30, 0x35,
-    0x1E, 0x23, 0x30, 0x35,
-    0x1E, 0x23, 0x2A, 0x35,
-    0x1E, 0x35, 0x35, 0x35,
-    0x1E, 0x1E, 0x35, 0x35,
-    0x1E, 0x1E, 0x1E, 0x35,
-    0x1E, 0x2B, 0x32, 0x38,
-    0x1E, 0x24, 0x32, 0x38,
-    0x1E, 0x24, 0x2B, 0x38,
-    0x1E, 0x38, 0x38, 0x38,
-    0x1E, 0x1E, 0x38, 0x38,
-    0x1E, 0x1E, 0x1E, 0x38,
-    0x1E, 0x2C, 0x34, 0x3B,
-    0x1E, 0x25, 0x34, 0x3B,
-    0x1E, 0x25, 0x2D, 0x3B,
-    0x1E, 0x3B, 0x3B, 0x3B,
-    0x1E, 0x1E, 0x3B, 0x3B,
-    0x1E, 0x1E, 0x1E, 0x3B,
-    0x1E, 0x2E, 0x36, 0x3E,
-    0x1E, 0x26, 0x36, 0x3E,
-    0x1E, 0x26, 0x2E, 0x3E,
-    0x1E, 0x3E, 0x3E, 0x3E,
-    0x1E, 0x1E, 0x3E, 0x3E,
-    0x1E, 0x1E, 0x1E, 0x3E,
-    0x1F, 0x20, 0x20, 0x21,
-    0x1F, 0x20, 0x21, 0x22,
-    0x1F, 0x21, 0x22, 0x23,
-    0x1F, 0x20, 0x22, 0x23,
-    0x1F, 0x20, 0x21, 0x23,
-    0x1F, 0x21, 0x22, 0x24,
-    0x1F, 0x21, 0x23, 0x24,
-    0x1F, 0x20, 0x23, 0x24,
-    0x1F, 0x20, 0x22, 0x24,
-    0x1F, 0x21, 0x23, 0x25,
-    0x1F, 0x22, 0x24, 0x25,
-    0x1F, 0x20, 0x24, 0x25,
-    0x1F, 0x20, 0x22, 0x25,
-    0x1F, 0x25, 0x25, 0x25,
-    0x1F, 0x1F, 0x25, 0x25,
-    0x1F, 0x1F, 0x1F, 0x25,
-    0x1F, 0x22, 0x23, 0x26,
-    0x1F, 0x22, 0x25, 0x26,
-    0x1F, 0x20, 0x25, 0x26,
-    0x1F, 0x20, 0x23, 0x26,
-    0x1F, 0x22, 0x24, 0x27,
-    0x1F, 0x23, 0x25, 0x27,
-    0x1F, 0x21, 0x25, 0x27,
-    0x1F, 0x21, 0x23, 0x27,
-    0x1F, 0x27, 0x27, 0x27,
-    0x1F, 0x1F, 0x27, 0x27,
-    0x1F, 0x1F, 0x1F, 0x27,
-    0x1F, 0x23, 0x26, 0x2A,
-    0x1F, 0x24, 0x28, 0x2A,
-    0x1F, 0x21, 0x28, 0x2A,
-    0x1F, 0x21, 0x25, 0x2A,
-    0x1F, 0x2A, 0x2A, 0x2A,
-    0x1F, 0x1F, 0x2A, 0x2A,
-    0x1F, 0x1F, 0x1F, 0x2A,
-    0x1F, 0x24, 0x28, 0x2D,
-    0x1F, 0x26, 0x2A, 0x2D,
-    0x1F, 0x22, 0x2A, 0x2D,
-    0x1F, 0x22, 0x26, 0x2D,
-    0x1F, 0x2D, 0x2D, 0x2D,
-    0x1F, 0x1F, 0x2D, 0x2D,
-    0x1F, 0x1F, 0x1F, 0x2D,
-    0x1F, 0x25, 0x2A, 0x30,
-    0x1F, 0x27, 0x2C, 0x30,
-    0x1F, 0x23, 0x2C, 0x30,
-    0x1F, 0x23, 0x28, 0x30,
-    0x1F, 0x30, 0x30, 0x30,
-    0x1F, 0x1F, 0x30, 0x30,
-    0x1F, 0x1F, 0x1F, 0x30,
-    0x1F, 0x26, 0x2C, 0x33,
-    0x1F, 0x29, 0x2E, 0x33,
-    0x1F, 0x24, 0x2E, 0x33,
-    0x1F, 0x24, 0x29, 0x33,
-    0x1F, 0x33, 0x33, 0x33,
-    0x1F, 0x1F, 0x33, 0x33,
-    0x1F, 0x1F, 0x1F, 0x33,
-    0x1F, 0x2A, 0x31, 0x36,
-    0x1F, 0x24, 0x31, 0x36,
-    0x1F, 0x24, 0x2B, 0x36,
-    0x1F, 0x36, 0x36, 0x36,
-    0x1F, 0x1F, 0x36, 0x36,
-    0x1F, 0x1F, 0x1F, 0x36,
-    0x1F, 0x2C, 0x33, 0x39,
-    0x1F, 0x25, 0x33, 0x39,
-    0x1F, 0x25, 0x2C, 0x39,
-    0x1F, 0x39, 0x39, 0x39,
-    0x1F, 0x1F, 0x39, 0x39,
-    0x1F, 0x1F, 0x1F, 0x39,
-    0x1F, 0x2D, 0x35, 0x3C,
-    0x1F, 0x26, 0x35, 0x3C,
-    0x1F, 0x26, 0x2E, 0x3C,
-    0x1F, 0x3C, 0x3C, 0x3C,
-    0x1F, 0x1F, 0x3C, 0x3C,
-    0x1F, 0x1F, 0x1F, 0x3C,
-    0x1F, 0x2F, 0x37, 0x3F,
-    0x1F, 0x27, 0x37, 0x3F,
-    0x1F, 0x27, 0x2F, 0x3F,
-    0x1F, 0x3F, 0x3F, 0x3F,
-    0x1F, 0x1F, 0x3F, 0x3F,
-    0x1F, 0x1F, 0x1F, 0x3F,
-    0x20, 0x21, 0x21, 0x22,
-    0x20, 0x21, 0x22, 0x23,
-    0x20, 0x22, 0x23, 0x24,
-    0x20, 0x21, 0x23, 0x24,
-    0x20, 0x21, 0x22, 0x24,
-    0x20, 0x22, 0x23, 0x25,
-    0x20, 0x22, 0x24, 0x25,
-    0x20, 0x21, 0x24, 0x25,
-    0x20, 0x21, 0x23, 0x25,
-    0x20, 0x22, 0x24, 0x26,
-    0x20, 0x23, 0x25, 0x26,
-    0x20, 0x21, 0x25, 0x26,
-    0x20, 0x21, 0x23, 0x26,
-    0x20, 0x26, 0x26, 0x26,
-    0x20, 0x20, 0x26, 0x26,
-    0x20, 0x20, 0x20, 0x26,
-    0x20, 0x23, 0x24, 0x27,
-    0x20, 0x23, 0x26, 0x27,
-    0x20, 0x21, 0x26, 0x27,
-    0x20, 0x21, 0x24, 0x27,
-    0x20, 0x23, 0x25, 0x28,
-    0x20, 0x24, 0x26, 0x28,
-    0x20, 0x22, 0x26, 0x28,
-    0x20, 0x22, 0x24, 0x28,
-    0x20, 0x28, 0x28, 0x28,
-    0x20, 0x20, 0x28, 0x28,
-    0x20, 0x20, 0x20, 0x28,
-    0x20, 0x24, 0x27, 0x2B,
-    0x20, 0x25, 0x29, 0x2B,
-    0x20, 0x22, 0x29, 0x2B,
-    0x20, 0x22, 0x26, 0x2B,
-    0x20, 0x2B, 0x2B, 0x2B,
-    0x20, 0x20, 0x2B, 0x2B,
-    0x20, 0x20, 0x20, 0x2B,
-    0x20, 0x25, 0x29, 0x2E,
-    0x20, 0x27, 0x2B, 0x2E,
-    0x20, 0x23, 0x2B, 0x2E,
-    0x20, 0x23, 0x27, 0x2E,
-    0x20, 0x2E, 0x2E, 0x2E,
-    0x20, 0x20, 0x2E, 0x2E,
-    0x20, 0x20, 0x20, 0x2E,
-    0x20, 0x26, 0x2B, 0x31,
-    0x20, 0x28, 0x2D, 0x31,
-    0x20, 0x24, 0x2D, 0x31,
-    0x20, 0x24, 0x29, 0x31,
-    0x20, 0x31, 0x31, 0x31,
-    0x20, 0x20, 0x31, 0x31,
-    0x20, 0x20, 0x20, 0x31,
-    0x20, 0x27, 0x2D, 0x34,
-    0x20, 0x2A, 0x2F, 0x34,
-    0x20, 0x25, 0x2F, 0x34,
-    0x20, 0x25, 0x2A, 0x34,
-    0x20, 0x34, 0x34, 0x34,
-    0x20, 0x20, 0x34, 0x34,
-    0x20, 0x20, 0x20, 0x34,
-    0x20, 0x2B, 0x32, 0x37,
-    0x20, 0x25, 0x32, 0x37,
-    0x20, 0x25, 0x2C, 0x37,
-    0x20, 0x37, 0x37, 0x37,
-    0x20, 0x20, 0x37, 0x37,
-    0x20, 0x20, 0x20, 0x37,
-    0x20, 0x2D, 0x34, 0x3A,
-    0x20, 0x26, 0x34, 0x3A,
-    0x20, 0x26, 0x2D, 0x3A,
-    0x20, 0x3A, 0x3A, 0x3A,
-    0x20, 0x20, 0x3A, 0x3A,
-    0x20, 0x20, 0x20, 0x3A,
-    0x20, 0x2E, 0x36, 0x3D,
-    0x20, 0x27, 0x36, 0x3D,
-    0x20, 0x27, 0x2F, 0x3D,
-    0x20, 0x3D, 0x3D, 0x3D,
-    0x20, 0x20, 0x3D, 0x3D,
-    0x20, 0x20, 0x20, 0x3D,
-    0x21, 0x22, 0x22, 0x23,
-    0x21, 0x22, 0x23, 0x24,
-    0x21, 0x23, 0x24, 0x25,
-    0x21, 0x22, 0x24, 0x25,
-    0x21, 0x22, 0x23, 0x25,
-    0x21, 0x23, 0x24, 0x26,
-    0x21, 0x23, 0x25, 0x26,
-    0x21, 0x22, 0x25, 0x26,
-    0x21, 0x22, 0x24, 0x26,
-    0x21, 0x23, 0x25, 0x27,
-    0x21, 0x24, 0x26, 0x27,
-    0x21, 0x22, 0x26, 0x27,
-    0x21, 0x22, 0x24, 0x27,
-    0x21, 0x27, 0x27, 0x27,
-    0x21, 0x21, 0x27, 0x27,
-    0x21, 0x21, 0x21, 0x27,
-    0x21, 0x24, 0x25, 0x28,
-    0x21, 0x24, 0x27, 0x28,
-    0x21, 0x22, 0x27, 0x28,
-    0x21, 0x22, 0x25, 0x28,
-    0x21, 0x24, 0x26, 0x29,
-    0x21, 0x25, 0x27, 0x29,
-    0x21, 0x23, 0x27, 0x29,
-    0x21, 0x23, 0x25, 0x29,
-    0x21, 0x29, 0x29, 0x29,
-    0x21, 0x21, 0x29, 0x29,
-    0x21, 0x21, 0x21, 0x29,
-    0x21, 0x25, 0x28, 0x2C,
-    0x21, 0x26, 0x2A, 0x2C,
-    0x21, 0x23, 0x2A, 0x2C,
-    0x21, 0x23, 0x27, 0x2C,
-    0x21, 0x2C, 0x2C, 0x2C,
-    0x21, 0x21, 0x2C, 0x2C,
-    0x21, 0x21, 0x21, 0x2C,
-    0x21, 0x26, 0x2A, 0x2F,
-    0x21, 0x28, 0x2C, 0x2F,
-    0x21, 0x24, 0x2C, 0x2F,
-    0x21, 0x24, 0x28, 0x2F,
-    0x21, 0x2F, 0x2F, 0x2F,
-    0x21, 0x21, 0x2F, 0x2F,
-    0x21, 0x21, 0x21, 0x2F,
-    0x21, 0x27, 0x2C, 0x32,
-    0x21, 0x29, 0x2E, 0x32,
-    0x21, 0x25, 0x2E, 0x32,
-    0x21, 0x25, 0x2A, 0x32,
-    0x21, 0x32, 0x32, 0x32,
-    0x21, 0x21, 0x32, 0x32,
-    0x21, 0x21, 0x21, 0x32,
-    0x21, 0x28, 0x2E, 0x35,
-    0x21, 0x2B, 0x30, 0x35,
-    0x21, 0x26, 0x30, 0x35,
-    0x21, 0x26, 0x2B, 0x35,
-    0x21, 0x35, 0x35, 0x35,
-    0x21, 0x21, 0x35, 0x35,
-    0x21, 0x21, 0x21, 0x35,
-    0x21, 0x2C, 0x33, 0x38,
-    0x21, 0x26, 0x33, 0x38,
-    0x21, 0x26, 0x2D, 0x38,
-    0x21, 0x38, 0x38, 0x38,
-    0x21, 0x21, 0x38, 0x38,
-    0x21, 0x21, 0x21, 0x38,
-    0x21, 0x2E, 0x35, 0x3B,
-    0x21, 0x27, 0x35, 0x3B,
-    0x21, 0x27, 0x2E, 0x3B,
-    0x21, 0x3B, 0x3B, 0x3B,
-    0x21, 0x21, 0x3B, 0x3B,
-    0x21, 0x21, 0x21, 0x3B,
-    0x21, 0x2F, 0x37, 0x3E,
-    0x21, 0x28, 0x37, 0x3E,
-    0x21, 0x28, 0x30, 0x3E,
-    0x21, 0x3E, 0x3E, 0x3E,
-    0x21, 0x21, 0x3E, 0x3E,
-    0x21, 0x21, 0x21, 0x3E,
-    0x22, 0x23, 0x23, 0x24,
-    0x22, 0x23, 0x24, 0x25,
-    0x22, 0x24, 0x25, 0x26,
-    0x22, 0x23, 0x25, 0x26,
-    0x22, 0x23, 0x24, 0x26,
-    0x22, 0x24, 0x25, 0x27,
-    0x22, 0x24, 0x26, 0x27,
-    0x22, 0x23, 0x26, 0x27,
-    0x22, 0x23, 0x25, 0x27,
-    0x22, 0x24, 0x26, 0x28,
-    0x22, 0x25, 0x27, 0x28,
-    0x22, 0x23, 0x27, 0x28,
-    0x22, 0x23, 0x25, 0x28,
-    0x22, 0x28, 0x28, 0x28,
-    0x22, 0x22, 0x28, 0x28,
-    0x22, 0x22, 0x22, 0x28,
-    0x22, 0x25, 0x26, 0x29,
-    0x22, 0x25, 0x28, 0x29,
-    0x22, 0x23, 0x28, 0x29,
-    0x22, 0x23, 0x26, 0x29,
-    0x22, 0x25, 0x27, 0x2A,
-    0x22, 0x26, 0x28, 0x2A,
-    0x22, 0x24, 0x28, 0x2A,
-    0x22, 0x24, 0x26, 0x2A,
-    0x22, 0x2A, 0x2A, 0x2A,
-    0x22, 0x22, 0x2A, 0x2A,
-    0x22, 0x22, 0x22, 0x2A,
-    0x22, 0x26, 0x29, 0x2D,
-    0x22, 0x27, 0x2B, 0x2D,
-    0x22, 0x24, 0x2B, 0x2D,
-    0x22, 0x24, 0x28, 0x2D,
-    0x22, 0x2D, 0x2D, 0x2D,
-    0x22, 0x22, 0x2D, 0x2D,
-    0x22, 0x22, 0x22, 0x2D,
-    0x22, 0x27, 0x2B, 0x30,
-    0x22, 0x29, 0x2D, 0x30,
-    0x22, 0x25, 0x2D, 0x30,
-    0x22, 0x25, 0x29, 0x30,
-    0x22, 0x30, 0x30, 0x30,
-    0x22, 0x22, 0x30, 0x30,
-    0x22, 0x22, 0x22, 0x30,
-    0x22, 0x28, 0x2D, 0x33,
-    0x22, 0x2A, 0x2F, 0x33,
-    0x22, 0x26, 0x2F, 0x33,
-    0x22, 0x26, 0x2B, 0x33,
-    0x22, 0x33, 0x33, 0x33,
-    0x22, 0x22, 0x33, 0x33,
-    0x22, 0x22, 0x22, 0x33,
-    0x22, 0x29, 0x2F, 0x36,
-    0x22, 0x2C, 0x31, 0x36,
-    0x22, 0x27, 0x31, 0x36,
-    0x22, 0x27, 0x2C, 0x36,
-    0x22, 0x36, 0x36, 0x36,
-    0x22, 0x22, 0x36, 0x36,
-    0x22, 0x22, 0x22, 0x36,
-    0x22, 0x2D, 0x34, 0x39,
-    0x22, 0x27, 0x34, 0x39,
-    0x22, 0x27, 0x2E, 0x39,
-    0x22, 0x39, 0x39, 0x39,
-    0x22, 0x22, 0x39, 0x39,
-    0x22, 0x22, 0x22, 0x39,
-    0x22, 0x2F, 0x36, 0x3C,
-    0x22, 0x28, 0x36, 0x3C,
-    0x22, 0x28, 0x2F, 0x3C,
-    0x22, 0x3C, 0x3C, 0x3C,
-    0x22, 0x22, 0x3C, 0x3C,
-    0x22, 0x22, 0x22, 0x3C,
-    0x22, 0x30, 0x38, 0x3F,
-    0x22, 0x29, 0x38, 0x3F,
-    0x22, 0x29, 0x31, 0x3F,
-    0x22, 0x3F, 0x3F, 0x3F,
-    0x22, 0x22, 0x3F, 0x3F,
-    0x22, 0x22, 0x22, 0x3F,
-    0x23, 0x24, 0x24, 0x25,
-    0x23, 0x24, 0x25, 0x26,
-    0x23, 0x25, 0x26, 0x27,
-    0x23, 0x24, 0x26, 0x27,
-    0x23, 0x24, 0x25, 0x27,
-    0x23, 0x25, 0x26, 0x28,
-    0x23, 0x25, 0x27, 0x28,
-    0x23, 0x24, 0x27, 0x28,
-    0x23, 0x24, 0x26, 0x28,
-    0x23, 0x25, 0x27, 0x29,
-    0x23, 0x26, 0x28, 0x29,
-    0x23, 0x24, 0x28, 0x29,
-    0x23, 0x24, 0x26, 0x29,
-    0x23, 0x29, 0x29, 0x29,
-    0x23, 0x23, 0x29, 0x29,
-    0x23, 0x23, 0x23, 0x29,
-    0x23, 0x26, 0x27, 0x2A,
-    0x23, 0x26, 0x29, 0x2A,
-    0x23, 0x24, 0x29, 0x2A,
-    0x23, 0x24, 0x27, 0x2A,
-    0x23, 0x26, 0x28, 0x2B,
-    0x23, 0x27, 0x29, 0x2B,
-    0x23, 0x25, 0x29, 0x2B,
-    0x23, 0x25, 0x27, 0x2B,
-    0x23, 0x2B, 0x2B, 0x2B,
-    0x23, 0x23, 0x2B, 0x2B,
-    0x23, 0x23, 0x23, 0x2B,
-    0x23, 0x27, 0x2A, 0x2E,
-    0x23, 0x28, 0x2C, 0x2E,
-    0x23, 0x25, 0x2C, 0x2E,
-    0x23, 0x25, 0x29, 0x2E,
-    0x23, 0x2E, 0x2E, 0x2E,
-    0x23, 0x23, 0x2E, 0x2E,
-    0x23, 0x23, 0x23, 0x2E,
-    0x23, 0x28, 0x2C, 0x31,
-    0x23, 0x2A, 0x2E, 0x31,
-    0x23, 0x26, 0x2E, 0x31,
-    0x23, 0x26, 0x2A, 0x31,
-    0x23, 0x31, 0x31, 0x31,
-    0x23, 0x23, 0x31, 0x31,
-    0x23, 0x23, 0x23, 0x31,
-    0x23, 0x29, 0x2E, 0x34,
-    0x23, 0x2B, 0x30, 0x34,
-    0x23, 0x27, 0x30, 0x34,
-    0x23, 0x27, 0x2C, 0x34,
-    0x23, 0x34, 0x34, 0x34,
-    0x23, 0x23, 0x34, 0x34,
-    0x23, 0x23, 0x23, 0x34,
-    0x23, 0x2A, 0x30, 0x37,
-    0x23, 0x2D, 0x32, 0x37,
-    0x23, 0x28, 0x32, 0x37,
-    0x23, 0x28, 0x2D, 0x37,
-    0x23, 0x37, 0x37, 0x37,
-    0x23, 0x23, 0x37, 0x37,
-    0x23, 0x23, 0x23, 0x37,
-    0x23, 0x2E, 0x35, 0x3A,
-    0x23, 0x28, 0x35, 0x3A,
-    0x23, 0x28, 0x2F, 0x3A,
-    0x23, 0x3A, 0x3A, 0x3A,
-    0x23, 0x23, 0x3A, 0x3A,
-    0x23, 0x23, 0x23, 0x3A,
-    0x23, 0x30, 0x37, 0x3D,
-    0x23, 0x29, 0x37, 0x3D,
-    0x23, 0x29, 0x30, 0x3D,
-    0x23, 0x3D, 0x3D, 0x3D,
-    0x23, 0x23, 0x3D, 0x3D,
-    0x23, 0x23, 0x23, 0x3D,
-    0x24, 0x25, 0x25, 0x26,
-    0x24, 0x25, 0x26, 0x27,
-    0x24, 0x26, 0x27, 0x28,
-    0x24, 0x25, 0x27, 0x28,
-    0x24, 0x25, 0x26, 0x28,
-    0x24, 0x26, 0x27, 0x29,
-    0x24, 0x26, 0x28, 0x29,
-    0x24, 0x25, 0x28, 0x29,
-    0x24, 0x25, 0x27, 0x29,
-    0x24, 0x26, 0x28, 0x2A,
-    0x24, 0x27, 0x29, 0x2A,
-    0x24, 0x25, 0x29, 0x2A,
-    0x24, 0x25, 0x27, 0x2A,
-    0x24, 0x2A, 0x2A, 0x2A,
-    0x24, 0x24, 0x2A, 0x2A,
-    0x24, 0x24, 0x24, 0x2A,
-    0x24, 0x27, 0x28, 0x2B,
-    0x24, 0x27, 0x2A, 0x2B,
-    0x24, 0x25, 0x2A, 0x2B,
-    0x24, 0x25, 0x28, 0x2B,
-    0x24, 0x27, 0x29, 0x2C,
-    0x24, 0x28, 0x2A, 0x2C,
-    0x24, 0x26, 0x2A, 0x2C,
-    0x24, 0x26, 0x28, 0x2C,
-    0x24, 0x2C, 0x2C, 0x2C,
-    0x24, 0x24, 0x2C, 0x2C,
-    0x24, 0x24, 0x24, 0x2C,
-    0x24, 0x28, 0x2B, 0x2F,
-    0x24, 0x29, 0x2D, 0x2F,
-    0x24, 0x26, 0x2D, 0x2F,
-    0x24, 0x26, 0x2A, 0x2F,
-    0x24, 0x2F, 0x2F, 0x2F,
-    0x24, 0x24, 0x2F, 0x2F,
-    0x24, 0x24, 0x24, 0x2F,
-    0x24, 0x29, 0x2D, 0x32,
-    0x24, 0x2B, 0x2F, 0x32,
-    0x24, 0x27, 0x2F, 0x32,
-    0x24, 0x27, 0x2B, 0x32,
-    0x24, 0x32, 0x32, 0x32,
-    0x24, 0x24, 0x32, 0x32,
-    0x24, 0x24, 0x24, 0x32,
-    0x24, 0x2A, 0x2F, 0x35,
-    0x24, 0x2C, 0x31, 0x35,
-    0x24, 0x28, 0x31, 0x35,
-    0x24, 0x28, 0x2D, 0x35,
-    0x24, 0x35, 0x35, 0x35,
-    0x24, 0x24, 0x35, 0x35,
-    0x24, 0x24, 0x24, 0x35,
-    0x24, 0x2B, 0x31, 0x38,
-    0x24, 0x2E, 0x33, 0x38,
-    0x24, 0x29, 0x33, 0x38,
-    0x24, 0x29, 0x2E, 0x38,
-    0x24, 0x38, 0x38, 0x38,
-    0x24, 0x24, 0x38, 0x38,
-    0x24, 0x24, 0x24, 0x38,
-    0x24, 0x2F, 0x36, 0x3B,
-    0x24, 0x29, 0x36, 0x3B,
-    0x24, 0x29, 0x30, 0x3B,
-    0x24, 0x3B, 0x3B, 0x3B,
-    0x24, 0x24, 0x3B, 0x3B,
-    0x24, 0x24, 0x24, 0x3B,
-    0x24, 0x31, 0x38, 0x3E,
-    0x24, 0x2A, 0x38, 0x3E,
-    0x24, 0x2A, 0x31, 0x3E,
-    0x24, 0x3E, 0x3E, 0x3E,
-    0x24, 0x24, 0x3E, 0x3E,
-    0x24, 0x24, 0x24, 0x3E,
-    0x25, 0x26, 0x26, 0x27,
-    0x25, 0x26, 0x27, 0x28,
-    0x25, 0x27, 0x28, 0x29,
-    0x25, 0x26, 0x28, 0x29,
-    0x25, 0x26, 0x27, 0x29,
-    0x25, 0x27, 0x28, 0x2A,
-    0x25, 0x27, 0x29, 0x2A,
-    0x25, 0x26, 0x29, 0x2A,
-    0x25, 0x26, 0x28, 0x2A,
-    0x25, 0x27, 0x29, 0x2B,
-    0x25, 0x28, 0x2A, 0x2B,
-    0x25, 0x26, 0x2A, 0x2B,
-    0x25, 0x26, 0x28, 0x2B,
-    0x25, 0x2B, 0x2B, 0x2B,
-    0x25, 0x25, 0x2B, 0x2B,
-    0x25, 0x25, 0x25, 0x2B,
-    0x25, 0x28, 0x29, 0x2C,
-    0x25, 0x28, 0x2B, 0x2C,
-    0x25, 0x26, 0x2B, 0x2C,
-    0x25, 0x26, 0x29, 0x2C,
-    0x25, 0x28, 0x2A, 0x2D,
-    0x25, 0x29, 0x2B, 0x2D,
-    0x25, 0x27, 0x2B, 0x2D,
-    0x25, 0x27, 0x29, 0x2D,
-    0x25, 0x2D, 0x2D, 0x2D,
-    0x25, 0x25, 0x2D, 0x2D,
-    0x25, 0x25, 0x25, 0x2D,
-    0x25, 0x29, 0x2C, 0x30,
-    0x25, 0x2A, 0x2E, 0x30,
-    0x25, 0x27, 0x2E, 0x30,
-    0x25, 0x27, 0x2B, 0x30,
-    0x25, 0x30, 0x30, 0x30,
-    0x25, 0x25, 0x30, 0x30,
-    0x25, 0x25, 0x25, 0x30,
-    0x25, 0x2A, 0x2E, 0x33,
-    0x25, 0x2C, 0x30, 0x33,
-    0x25, 0x28, 0x30, 0x33,
-    0x25, 0x28, 0x2C, 0x33,
-    0x25, 0x33, 0x33, 0x33,
-    0x25, 0x25, 0x33, 0x33,
-    0x25, 0x25, 0x25, 0x33,
-    0x25, 0x2B, 0x30, 0x36,
-    0x25, 0x2D, 0x32, 0x36,
-    0x25, 0x29, 0x32, 0x36,
-    0x25, 0x29, 0x2E, 0x36,
-    0x25, 0x36, 0x36, 0x36,
-    0x25, 0x25, 0x36, 0x36,
-    0x25, 0x25, 0x25, 0x36,
-    0x25, 0x2C, 0x32, 0x39,
-    0x25, 0x2F, 0x34, 0x39,
-    0x25, 0x2A, 0x34, 0x39,
-    0x25, 0x2A, 0x2F, 0x39,
-    0x25, 0x39, 0x39, 0x39,
-    0x25, 0x25, 0x39, 0x39,
-    0x25, 0x25, 0x25, 0x39,
-    0x25, 0x30, 0x37, 0x3C,
-    0x25, 0x2A, 0x37, 0x3C,
-    0x25, 0x2A, 0x31, 0x3C,
-    0x25, 0x3C, 0x3C, 0x3C,
-    0x25, 0x25, 0x3C, 0x3C,
-    0x25, 0x25, 0x25, 0x3C,
-    0x25, 0x32, 0x39, 0x3F,
-    0x25, 0x2B, 0x39, 0x3F,
-    0x25, 0x2B, 0x32, 0x3F,
-    0x25, 0x3F, 0x3F, 0x3F,
-    0x25, 0x25, 0x3F, 0x3F,
-    0x25, 0x25, 0x25, 0x3F,
-    0x26, 0x27, 0x27, 0x28,
-    0x26, 0x27, 0x28, 0x29,
-    0x26, 0x28, 0x29, 0x2A,
-    0x26, 0x27, 0x29, 0x2A,
-    0x26, 0x27, 0x28, 0x2A,
-    0x26, 0x28, 0x29, 0x2B,
-    0x26, 0x28, 0x2A, 0x2B,
-    0x26, 0x27, 0x2A, 0x2B,
-    0x26, 0x27, 0x29, 0x2B,
-    0x26, 0x28, 0x2A, 0x2C,
-    0x26, 0x29, 0x2B, 0x2C,
-    0x26, 0x27, 0x2B, 0x2C,
-    0x26, 0x27, 0x29, 0x2C,
-    0x26, 0x2C, 0x2C, 0x2C,
-    0x26, 0x26, 0x2C, 0x2C,
-    0x26, 0x26, 0x26, 0x2C,
-    0x26, 0x29, 0x2A, 0x2D,
-    0x26, 0x29, 0x2C, 0x2D,
-    0x26, 0x27, 0x2C, 0x2D,
-    0x26, 0x27, 0x2A, 0x2D,
-    0x26, 0x29, 0x2B, 0x2E,
-    0x26, 0x2A, 0x2C, 0x2E,
-    0x26, 0x28, 0x2C, 0x2E,
-    0x26, 0x28, 0x2A, 0x2E,
-    0x26, 0x2E, 0x2E, 0x2E,
-    0x26, 0x26, 0x2E, 0x2E,
-    0x26, 0x26, 0x26, 0x2E,
-    0x26, 0x2A, 0x2D, 0x31,
-    0x26, 0x2B, 0x2F, 0x31,
-    0x26, 0x28, 0x2F, 0x31,
-    0x26, 0x28, 0x2C, 0x31,
-    0x26, 0x31, 0x31, 0x31,
-    0x26, 0x26, 0x31, 0x31,
-    0x26, 0x26, 0x26, 0x31,
-    0x26, 0x2B, 0x2F, 0x34,
-    0x26, 0x2D, 0x31, 0x34,
-    0x26, 0x29, 0x31, 0x34,
-    0x26, 0x29, 0x2D, 0x34,
-    0x26, 0x34, 0x34, 0x34,
-    0x26, 0x26, 0x34, 0x34,
-    0x26, 0x26, 0x26, 0x34,
-    0x26, 0x2C, 0x31, 0x37,
-    0x26, 0x2E, 0x33, 0x37,
-    0x26, 0x2A, 0x33, 0x37,
-    0x26, 0x2A, 0x2F, 0x37,
-    0x26, 0x37, 0x37, 0x37,
-    0x26, 0x26, 0x37, 0x37,
-    0x26, 0x26, 0x26, 0x37,
-    0x26, 0x2D, 0x33, 0x3A,
-    0x26, 0x30, 0x35, 0x3A,
-    0x26, 0x2B, 0x35, 0x3A,
-    0x26, 0x2B, 0x30, 0x3A,
-    0x26, 0x3A, 0x3A, 0x3A,
-    0x26, 0x26, 0x3A, 0x3A,
-    0x26, 0x26, 0x26, 0x3A,
-    0x26, 0x31, 0x38, 0x3D,
-    0x26, 0x2B, 0x38, 0x3D,
-    0x26, 0x2B, 0x32, 0x3D,
-    0x26, 0x3D, 0x3D, 0x3D,
-    0x26, 0x26, 0x3D, 0x3D,
-    0x26, 0x26, 0x26, 0x3D,
-    0x27, 0x28, 0x28, 0x29,
-    0x27, 0x28, 0x29, 0x2A,
-    0x27, 0x29, 0x2A, 0x2B,
-    0x27, 0x28, 0x2A, 0x2B,
-    0x27, 0x28, 0x29, 0x2B,
-    0x27, 0x29, 0x2A, 0x2C,
-    0x27, 0x29, 0x2B, 0x2C,
-    0x27, 0x28, 0x2B, 0x2C,
-    0x27, 0x28, 0x2A, 0x2C,
-    0x27, 0x29, 0x2B, 0x2D,
-    0x27, 0x2A, 0x2C, 0x2D,
-    0x27, 0x28, 0x2C, 0x2D,
-    0x27, 0x28, 0x2A, 0x2D,
-    0x27, 0x2D, 0x2D, 0x2D,
-    0x27, 0x27, 0x2D, 0x2D,
-    0x27, 0x27, 0x27, 0x2D,
-    0x27, 0x2A, 0x2B, 0x2E,
-    0x27, 0x2A, 0x2D, 0x2E,
-    0x27, 0x28, 0x2D, 0x2E,
-    0x27, 0x28, 0x2B, 0x2E,
-    0x27, 0x2A, 0x2C, 0x2F,
-    0x27, 0x2B, 0x2D, 0x2F,
-    0x27, 0x29, 0x2D, 0x2F,
-    0x27, 0x29, 0x2B, 0x2F,
-    0x27, 0x2F, 0x2F, 0x2F,
-    0x27, 0x27, 0x2F, 0x2F,
-    0x27, 0x27, 0x27, 0x2F,
-    0x27, 0x2B, 0x2E, 0x32,
-    0x27, 0x2C, 0x30, 0x32,
-    0x27, 0x29, 0x30, 0x32,
-    0x27, 0x29, 0x2D, 0x32,
-    0x27, 0x32, 0x32, 0x32,
-    0x27, 0x27, 0x32, 0x32,
-    0x27, 0x27, 0x27, 0x32,
-    0x27, 0x2C, 0x30, 0x35,
-    0x27, 0x2E, 0x32, 0x35,
-    0x27, 0x2A, 0x32, 0x35,
-    0x27, 0x2A, 0x2E, 0x35,
-    0x27, 0x35, 0x35, 0x35,
-    0x27, 0x27, 0x35, 0x35,
-    0x27, 0x27, 0x27, 0x35,
-    0x27, 0x2D, 0x32, 0x38,
-    0x27, 0x2F, 0x34, 0x38,
-    0x27, 0x2B, 0x34, 0x38,
-    0x27, 0x2B, 0x30, 0x38,
-    0x27, 0x38, 0x38, 0x38,
-    0x27, 0x27, 0x38, 0x38,
-    0x27, 0x27, 0x27, 0x38,
-    0x27, 0x2E, 0x34, 0x3B,
-    0x27, 0x31, 0x36, 0x3B,
-    0x27, 0x2C, 0x36, 0x3B,
-    0x27, 0x2C, 0x31, 0x3B,
-    0x27, 0x3B, 0x3B, 0x3B,
-    0x27, 0x27, 0x3B, 0x3B,
-    0x27, 0x27, 0x27, 0x3B,
-    0x27, 0x32, 0x39, 0x3E,
-    0x27, 0x2C, 0x39, 0x3E,
-    0x27, 0x2C, 0x33, 0x3E,
-    0x27, 0x3E, 0x3E, 0x3E,
-    0x27, 0x27, 0x3E, 0x3E,
-    0x27, 0x27, 0x27, 0x3E,
-    0x28, 0x29, 0x29, 0x2A,
-    0x28, 0x29, 0x2A, 0x2B,
-    0x28, 0x2A, 0x2B, 0x2C,
-    0x28, 0x29, 0x2B, 0x2C,
-    0x28, 0x29, 0x2A, 0x2C,
-    0x28, 0x2A, 0x2B, 0x2D,
-    0x28, 0x2A, 0x2C, 0x2D,
-    0x28, 0x29, 0x2C, 0x2D,
-    0x28, 0x29, 0x2B, 0x2D,
-    0x28, 0x2A, 0x2C, 0x2E,
-    0x28, 0x2B, 0x2D, 0x2E,
-    0x28, 0x29, 0x2D, 0x2E,
-    0x28, 0x29, 0x2B, 0x2E,
-    0x28, 0x2E, 0x2E, 0x2E,
-    0x28, 0x28, 0x2E, 0x2E,
-    0x28, 0x28, 0x28, 0x2E,
-    0x28, 0x2B, 0x2C, 0x2F,
-    0x28, 0x2B, 0x2E, 0x2F,
-    0x28, 0x29, 0x2E, 0x2F,
-    0x28, 0x29, 0x2C, 0x2F,
-    0x28, 0x2B, 0x2D, 0x30,
-    0x28, 0x2C, 0x2E, 0x30,
-    0x28, 0x2A, 0x2E, 0x30,
-    0x28, 0x2A, 0x2C, 0x30,
-    0x28, 0x30, 0x30, 0x30,
-    0x28, 0x28, 0x30, 0x30,
-    0x28, 0x28, 0x28, 0x30,
-    0x28, 0x2C, 0x2F, 0x33,
-    0x28, 0x2D, 0x31, 0x33,
-    0x28, 0x2A, 0x31, 0x33,
-    0x28, 0x2A, 0x2E, 0x33,
-    0x28, 0x33, 0x33, 0x33,
-    0x28, 0x28, 0x33, 0x33,
-    0x28, 0x28, 0x28, 0x33,
-    0x28, 0x2D, 0x31, 0x36,
-    0x28, 0x2F, 0x33, 0x36,
-    0x28, 0x2B, 0x33, 0x36,
-    0x28, 0x2B, 0x2F, 0x36,
-    0x28, 0x36, 0x36, 0x36,
-    0x28, 0x28, 0x36, 0x36,
-    0x28, 0x28, 0x28, 0x36,
-    0x28, 0x2E, 0x33, 0x39,
-    0x28, 0x30, 0x35, 0x39,
-    0x28, 0x2C, 0x35, 0x39,
-    0x28, 0x2C, 0x31, 0x39,
-    0x28, 0x39, 0x39, 0x39,
-    0x28, 0x28, 0x39, 0x39,
-    0x28, 0x28, 0x28, 0x39,
-    0x28, 0x2F, 0x35, 0x3C,
-    0x28, 0x32, 0x37, 0x3C,
-    0x28, 0x2D, 0x37, 0x3C,
-    0x28, 0x2D, 0x32, 0x3C,
-    0x28, 0x3C, 0x3C, 0x3C,
-    0x28, 0x28, 0x3C, 0x3C,
-    0x28, 0x28, 0x28, 0x3C,
-    0x28, 0x33, 0x3A, 0x3F,
-    0x28, 0x2D, 0x3A, 0x3F,
-    0x28, 0x2D, 0x34, 0x3F,
-    0x28, 0x3F, 0x3F, 0x3F,
-    0x28, 0x28, 0x3F, 0x3F,
-    0x28, 0x28, 0x28, 0x3F,
-    0x29, 0x2A, 0x2A, 0x2B,
-    0x29, 0x2A, 0x2B, 0x2C,
-    0x29, 0x2B, 0x2C, 0x2D,
-    0x29, 0x2A, 0x2C, 0x2D,
-    0x29, 0x2A, 0x2B, 0x2D,
-    0x29, 0x2B, 0x2C, 0x2E,
-    0x29, 0x2B, 0x2D, 0x2E,
-    0x29, 0x2A, 0x2D, 0x2E,
-    0x29, 0x2A, 0x2C, 0x2E,
-    0x29, 0x2B, 0x2D, 0x2F,
-    0x29, 0x2C, 0x2E, 0x2F,
-    0x29, 0x2A, 0x2E, 0x2F,
-    0x29, 0x2A, 0x2C, 0x2F,
-    0x29, 0x2F, 0x2F, 0x2F,
-    0x29, 0x29, 0x2F, 0x2F,
-    0x29, 0x29, 0x29, 0x2F,
-    0x29, 0x2C, 0x2D, 0x30,
-    0x29, 0x2C, 0x2F, 0x30,
-    0x29, 0x2A, 0x2F, 0x30,
-    0x29, 0x2A, 0x2D, 0x30,
-    0x29, 0x2C, 0x2E, 0x31,
-    0x29, 0x2D, 0x2F, 0x31,
-    0x29, 0x2B, 0x2F, 0x31,
-    0x29, 0x2B, 0x2D, 0x31,
-    0x29, 0x31, 0x31, 0x31,
-    0x29, 0x29, 0x31, 0x31,
-    0x29, 0x29, 0x29, 0x31,
-    0x29, 0x2D, 0x30, 0x34,
-    0x29, 0x2E, 0x32, 0x34,
-    0x29, 0x2B, 0x32, 0x34,
-    0x29, 0x2B, 0x2F, 0x34,
-    0x29, 0x34, 0x34, 0x34,
-    0x29, 0x29, 0x34, 0x34,
-    0x29, 0x29, 0x29, 0x34,
-    0x29, 0x2E, 0x32, 0x37,
-    0x29, 0x30, 0x34, 0x37,
-    0x29, 0x2C, 0x34, 0x37,
-    0x29, 0x2C, 0x30, 0x37,
-    0x29, 0x37, 0x37, 0x37,
-    0x29, 0x29, 0x37, 0x37,
-    0x29, 0x29, 0x29, 0x37,
-    0x29, 0x2F, 0x34, 0x3A,
-    0x29, 0x31, 0x36, 0x3A,
-    0x29, 0x2D, 0x36, 0x3A,
-    0x29, 0x2D, 0x32, 0x3A,
-    0x29, 0x3A, 0x3A, 0x3A,
-    0x29, 0x29, 0x3A, 0x3A,
-    0x29, 0x29, 0x29, 0x3A,
-    0x29, 0x30, 0x36, 0x3D,
-    0x29, 0x33, 0x38, 0x3D,
-    0x29, 0x2E, 0x38, 0x3D,
-    0x29, 0x2E, 0x33, 0x3D,
-    0x29, 0x3D, 0x3D, 0x3D,
-    0x29, 0x29, 0x3D, 0x3D,
-    0x29, 0x29, 0x29, 0x3D,
-    0x2A, 0x2B, 0x2B, 0x2C,
-    0x2A, 0x2B, 0x2C, 0x2D,
-    0x2A, 0x2C, 0x2D, 0x2E,
-    0x2A, 0x2B, 0x2D, 0x2E,
-    0x2A, 0x2B, 0x2C, 0x2E,
-    0x2A, 0x2C, 0x2D, 0x2F,
-    0x2A, 0x2C, 0x2E, 0x2F,
-    0x2A, 0x2B, 0x2E, 0x2F,
-    0x2A, 0x2B, 0x2D, 0x2F,
-    0x2A, 0x2C, 0x2E, 0x30,
-    0x2A, 0x2D, 0x2F, 0x30,
-    0x2A, 0x2B, 0x2F, 0x30,
-    0x2A, 0x2B, 0x2D, 0x30,
-    0x2A, 0x30, 0x30, 0x30,
-    0x2A, 0x2A, 0x30, 0x30,
-    0x2A, 0x2A, 0x2A, 0x30,
-    0x2A, 0x2D, 0x2E, 0x31,
-    0x2A, 0x2D, 0x30, 0x31,
-    0x2A, 0x2B, 0x30, 0x31,
-    0x2A, 0x2B, 0x2E, 0x31,
-    0x2A, 0x2D, 0x2F, 0x32,
-    0x2A, 0x2E, 0x30, 0x32,
-    0x2A, 0x2C, 0x30, 0x32,
-    0x2A, 0x2C, 0x2E, 0x32,
-    0x2A, 0x32, 0x32, 0x32,
-    0x2A, 0x2A, 0x32, 0x32,
-    0x2A, 0x2A, 0x2A, 0x32,
-    0x2A, 0x2E, 0x31, 0x35,
-    0x2A, 0x2F, 0x33, 0x35,
-    0x2A, 0x2C, 0x33, 0x35,
-    0x2A, 0x2C, 0x30, 0x35,
-    0x2A, 0x35, 0x35, 0x35,
-    0x2A, 0x2A, 0x35, 0x35,
-    0x2A, 0x2A, 0x2A, 0x35,
-    0x2A, 0x2F, 0x33, 0x38,
-    0x2A, 0x31, 0x35, 0x38,
-    0x2A, 0x2D, 0x35, 0x38,
-    0x2A, 0x2D, 0x31, 0x38,
-    0x2A, 0x38, 0x38, 0x38,
-    0x2A, 0x2A, 0x38, 0x38,
-    0x2A, 0x2A, 0x2A, 0x38,
-    0x2A, 0x30, 0x35, 0x3B,
-    0x2A, 0x32, 0x37, 0x3B,
-    0x2A, 0x2E, 0x37, 0x3B,
-    0x2A, 0x2E, 0x33, 0x3B,
-    0x2A, 0x3B, 0x3B, 0x3B,
-    0x2A, 0x2A, 0x3B, 0x3B,
-    0x2A, 0x2A, 0x2A, 0x3B,
-    0x2A, 0x31, 0x37, 0x3E,
-    0x2A, 0x34, 0x39, 0x3E,
-    0x2A, 0x2F, 0x39, 0x3E,
-    0x2A, 0x2F, 0x34, 0x3E,
-    0x2A, 0x3E, 0x3E, 0x3E,
-    0x2A, 0x2A, 0x3E, 0x3E,
-    0x2A, 0x2A, 0x2A, 0x3E,
-    0x2B, 0x2C, 0x2C, 0x2D,
-    0x2B, 0x2C, 0x2D, 0x2E,
-    0x2B, 0x2D, 0x2E, 0x2F,
-    0x2B, 0x2C, 0x2E, 0x2F,
-    0x2B, 0x2C, 0x2D, 0x2F,
-    0x2B, 0x2D, 0x2E, 0x30,
-    0x2B, 0x2D, 0x2F, 0x30,
-    0x2B, 0x2C, 0x2F, 0x30,
-    0x2B, 0x2C, 0x2E, 0x30,
-    0x2B, 0x2D, 0x2F, 0x31,
-    0x2B, 0x2E, 0x30, 0x31,
-    0x2B, 0x2C, 0x30, 0x31,
-    0x2B, 0x2C, 0x2E, 0x31,
-    0x2B, 0x31, 0x31, 0x31,
-    0x2B, 0x2B, 0x31, 0x31,
-    0x2B, 0x2B, 0x2B, 0x31,
-    0x2B, 0x2E, 0x2F, 0x32,
-    0x2B, 0x2E, 0x31, 0x32,
-    0x2B, 0x2C, 0x31, 0x32,
-    0x2B, 0x2C, 0x2F, 0x32,
-    0x2B, 0x2E, 0x30, 0x33,
-    0x2B, 0x2F, 0x31, 0x33,
-    0x2B, 0x2D, 0x31, 0x33,
-    0x2B, 0x2D, 0x2F, 0x33,
-    0x2B, 0x33, 0x33, 0x33,
-    0x2B, 0x2B, 0x33, 0x33,
-    0x2B, 0x2B, 0x2B, 0x33,
-    0x2B, 0x2F, 0x32, 0x36,
-    0x2B, 0x30, 0x34, 0x36,
-    0x2B, 0x2D, 0x34, 0x36,
-    0x2B, 0x2D, 0x31, 0x36,
-    0x2B, 0x36, 0x36, 0x36,
-    0x2B, 0x2B, 0x36, 0x36,
-    0x2B, 0x2B, 0x2B, 0x36,
-    0x2B, 0x30, 0x34, 0x39,
-    0x2B, 0x32, 0x36, 0x39,
-    0x2B, 0x2E, 0x36, 0x39,
-    0x2B, 0x2E, 0x32, 0x39,
-    0x2B, 0x39, 0x39, 0x39,
-    0x2B, 0x2B, 0x39, 0x39,
-    0x2B, 0x2B, 0x2B, 0x39,
-    0x2B, 0x31, 0x36, 0x3C,
-    0x2B, 0x33, 0x38, 0x3C,
-    0x2B, 0x2F, 0x38, 0x3C,
-    0x2B, 0x2F, 0x34, 0x3C,
-    0x2B, 0x3C, 0x3C, 0x3C,
-    0x2B, 0x2B, 0x3C, 0x3C,
-    0x2B, 0x2B, 0x2B, 0x3C,
-    0x2B, 0x32, 0x38, 0x3F,
-    0x2B, 0x35, 0x3A, 0x3F,
-    0x2B, 0x30, 0x3A, 0x3F,
-    0x2B, 0x30, 0x35, 0x3F,
-    0x2B, 0x3F, 0x3F, 0x3F,
-    0x2B, 0x2B, 0x3F, 0x3F,
-    0x2B, 0x2B, 0x2B, 0x3F,
-    0x2C, 0x2D, 0x2D, 0x2E,
-    0x2C, 0x2D, 0x2E, 0x2F,
-    0x2C, 0x2E, 0x2F, 0x30,
-    0x2C, 0x2D, 0x2F, 0x30,
-    0x2C, 0x2D, 0x2E, 0x30,
-    0x2C, 0x2E, 0x2F, 0x31,
-    0x2C, 0x2E, 0x30, 0x31,
-    0x2C, 0x2D, 0x30, 0x31,
-    0x2C, 0x2D, 0x2F, 0x31,
-    0x2C, 0x2E, 0x30, 0x32,
-    0x2C, 0x2F, 0x31, 0x32,
-    0x2C, 0x2D, 0x31, 0x32,
-    0x2C, 0x2D, 0x2F, 0x32,
-    0x2C, 0x32, 0x32, 0x32,
-    0x2C, 0x2C, 0x32, 0x32,
-    0x2C, 0x2C, 0x2C, 0x32,
-    0x2C, 0x2F, 0x30, 0x33,
-    0x2C, 0x2F, 0x32, 0x33,
-    0x2C, 0x2D, 0x32, 0x33,
-    0x2C, 0x2D, 0x30, 0x33,
-    0x2C, 0x2F, 0x31, 0x34,
-    0x2C, 0x30, 0x32, 0x34,
-    0x2C, 0x2E, 0x32, 0x34,
-    0x2C, 0x2E, 0x30, 0x34,
-    0x2C, 0x34, 0x34, 0x34,
-    0x2C, 0x2C, 0x34, 0x34,
-    0x2C, 0x2C, 0x2C, 0x34,
-    0x2C, 0x30, 0x33, 0x37,
-    0x2C, 0x31, 0x35, 0x37,
-    0x2C, 0x2E, 0x35, 0x37,
-    0x2C, 0x2E, 0x32, 0x37,
-    0x2C, 0x37, 0x37, 0x37,
-    0x2C, 0x2C, 0x37, 0x37,
-    0x2C, 0x2C, 0x2C, 0x37,
-    0x2C, 0x31, 0x35, 0x3A,
-    0x2C, 0x33, 0x37, 0x3A,
-    0x2C, 0x2F, 0x37, 0x3A,
-    0x2C, 0x2F, 0x33, 0x3A,
-    0x2C, 0x3A, 0x3A, 0x3A,
-    0x2C, 0x2C, 0x3A, 0x3A,
-    0x2C, 0x2C, 0x2C, 0x3A,
-    0x2C, 0x32, 0x37, 0x3D,
-    0x2C, 0x34, 0x39, 0x3D,
-    0x2C, 0x30, 0x39, 0x3D,
-    0x2C, 0x30, 0x35, 0x3D,
-    0x2C, 0x3D, 0x3D, 0x3D,
-    0x2C, 0x2C, 0x3D, 0x3D,
-    0x2C, 0x2C, 0x2C, 0x3D,
-    0x2D, 0x2E, 0x2E, 0x2F,
-    0x2D, 0x2E, 0x2F, 0x30,
-    0x2D, 0x2F, 0x30, 0x31,
-    0x2D, 0x2E, 0x30, 0x31,
-    0x2D, 0x2E, 0x2F, 0x31,
-    0x2D, 0x2F, 0x30, 0x32,
-    0x2D, 0x2F, 0x31, 0x32,
-    0x2D, 0x2E, 0x31, 0x32,
-    0x2D, 0x2E, 0x30, 0x32,
-    0x2D, 0x2F, 0x31, 0x33,
-    0x2D, 0x30, 0x32, 0x33,
-    0x2D, 0x2E, 0x32, 0x33,
-    0x2D, 0x2E, 0x30, 0x33,
-    0x2D, 0x33, 0x33, 0x33,
-    0x2D, 0x2D, 0x33, 0x33,
-    0x2D, 0x2D, 0x2D, 0x33,
-    0x2D, 0x30, 0x31, 0x34,
-    0x2D, 0x30, 0x33, 0x34,
-    0x2D, 0x2E, 0x33, 0x34,
-    0x2D, 0x2E, 0x31, 0x34,
-    0x2D, 0x30, 0x32, 0x35,
-    0x2D, 0x31, 0x33, 0x35,
-    0x2D, 0x2F, 0x33, 0x35,
-    0x2D, 0x2F, 0x31, 0x35,
-    0x2D, 0x35, 0x35, 0x35,
-    0x2D, 0x2D, 0x35, 0x35,
-    0x2D, 0x2D, 0x2D, 0x35,
-    0x2D, 0x31, 0x34, 0x38,
-    0x2D, 0x32, 0x36, 0x38,
-    0x2D, 0x2F, 0x36, 0x38,
-    0x2D, 0x2F, 0x33, 0x38,
-    0x2D, 0x38, 0x38, 0x38,
-    0x2D, 0x2D, 0x38, 0x38,
-    0x2D, 0x2D, 0x2D, 0x38,
-    0x2D, 0x32, 0x36, 0x3B,
-    0x2D, 0x34, 0x38, 0x3B,
-    0x2D, 0x30, 0x38, 0x3B,
-    0x2D, 0x30, 0x34, 0x3B,
-    0x2D, 0x3B, 0x3B, 0x3B,
-    0x2D, 0x2D, 0x3B, 0x3B,
-    0x2D, 0x2D, 0x2D, 0x3B,
-    0x2D, 0x33, 0x38, 0x3E,
-    0x2D, 0x35, 0x3A, 0x3E,
-    0x2D, 0x31, 0x3A, 0x3E,
-    0x2D, 0x31, 0x36, 0x3E,
-    0x2D, 0x3E, 0x3E, 0x3E,
-    0x2D, 0x2D, 0x3E, 0x3E,
-    0x2D, 0x2D, 0x2D, 0x3E,
-    0x2E, 0x2F, 0x2F, 0x30,
-    0x2E, 0x2F, 0x30, 0x31,
-    0x2E, 0x30, 0x31, 0x32,
-    0x2E, 0x2F, 0x31, 0x32,
-    0x2E, 0x2F, 0x30, 0x32,
-    0x2E, 0x30, 0x31, 0x33,
-    0x2E, 0x30, 0x32, 0x33,
-    0x2E, 0x2F, 0x32, 0x33,
-    0x2E, 0x2F, 0x31, 0x33,
-    0x2E, 0x30, 0x32, 0x34,
-    0x2E, 0x31, 0x33, 0x34,
-    0x2E, 0x2F, 0x33, 0x34,
-    0x2E, 0x2F, 0x31, 0x34,
-    0x2E, 0x34, 0x34, 0x34,
-    0x2E, 0x2E, 0x34, 0x34,
-    0x2E, 0x2E, 0x2E, 0x34,
-    0x2E, 0x31, 0x32, 0x35,
-    0x2E, 0x31, 0x34, 0x35,
-    0x2E, 0x2F, 0x34, 0x35,
-    0x2E, 0x2F, 0x32, 0x35,
-    0x2E, 0x31, 0x33, 0x36,
-    0x2E, 0x32, 0x34, 0x36,
-    0x2E, 0x30, 0x34, 0x36,
-    0x2E, 0x30, 0x32, 0x36,
-    0x2E, 0x36, 0x36, 0x36,
-    0x2E, 0x2E, 0x36, 0x36,
-    0x2E, 0x2E, 0x2E, 0x36,
-    0x2E, 0x32, 0x35, 0x39,
-    0x2E, 0x33, 0x37, 0x39,
-    0x2E, 0x30, 0x37, 0x39,
-    0x2E, 0x30, 0x34, 0x39,
-    0x2E, 0x39, 0x39, 0x39,
-    0x2E, 0x2E, 0x39, 0x39,
-    0x2E, 0x2E, 0x2E, 0x39,
-    0x2E, 0x33, 0x37, 0x3C,
-    0x2E, 0x35, 0x39, 0x3C,
-    0x2E, 0x31, 0x39, 0x3C,
-    0x2E, 0x31, 0x35, 0x3C,
-    0x2E, 0x3C, 0x3C, 0x3C,
-    0x2E, 0x2E, 0x3C, 0x3C,
-    0x2E, 0x2E, 0x2E, 0x3C,
-    0x2E, 0x34, 0x39, 0x3F,
-    0x2E, 0x36, 0x3B, 0x3F,
-    0x2E, 0x32, 0x3B, 0x3F,
-    0x2E, 0x32, 0x37, 0x3F,
-    0x2E, 0x3F, 0x3F, 0x3F,
-    0x2E, 0x2E, 0x3F, 0x3F,
-    0x2E, 0x2E, 0x2E, 0x3F,
-    0x2F, 0x30, 0x30, 0x31,
-    0x2F, 0x30, 0x31, 0x32,
-    0x2F, 0x31, 0x32, 0x33,
-    0x2F, 0x30, 0x32, 0x33,
-    0x2F, 0x30, 0x31, 0x33,
-    0x2F, 0x31, 0x32, 0x34,
-    0x2F, 0x31, 0x33, 0x34,
-    0x2F, 0x30, 0x33, 0x34,
-    0x2F, 0x30, 0x32, 0x34,
-    0x2F, 0x31, 0x33, 0x35,
-    0x2F, 0x32, 0x34, 0x35,
-    0x2F, 0x30, 0x34, 0x35,
-    0x2F, 0x30, 0x32, 0x35,
-    0x2F, 0x35, 0x35, 0x35,
-    0x2F, 0x2F, 0x35, 0x35,
-    0x2F, 0x2F, 0x2F, 0x35,
-    0x2F, 0x32, 0x33, 0x36,
-    0x2F, 0x32, 0x35, 0x36,
-    0x2F, 0x30, 0x35, 0x36,
-    0x2F, 0x30, 0x33, 0x36,
-    0x2F, 0x32, 0x34, 0x37,
-    0x2F, 0x33, 0x35, 0x37,
-    0x2F, 0x31, 0x35, 0x37,
-    0x2F, 0x31, 0x33, 0x37,
-    0x2F, 0x37, 0x37, 0x37,
-    0x2F, 0x2F, 0x37, 0x37,
-    0x2F, 0x2F, 0x2F, 0x37,
-    0x2F, 0x33, 0x36, 0x3A,
-    0x2F, 0x34, 0x38, 0x3A,
-    0x2F, 0x31, 0x38, 0x3A,
-    0x2F, 0x31, 0x35, 0x3A,
-    0x2F, 0x3A, 0x3A, 0x3A,
-    0x2F, 0x2F, 0x3A, 0x3A,
-    0x2F, 0x2F, 0x2F, 0x3A,
-    0x2F, 0x34, 0x38, 0x3D,
-    0x2F, 0x36, 0x3A, 0x3D,
-    0x2F, 0x32, 0x3A, 0x3D,
-    0x2F, 0x32, 0x36, 0x3D,
-    0x2F, 0x3D, 0x3D, 0x3D,
-    0x2F, 0x2F, 0x3D, 0x3D,
-    0x2F, 0x2F, 0x2F, 0x3D,
-    0x30, 0x31, 0x31, 0x32,
-    0x30, 0x31, 0x32, 0x33,
-    0x30, 0x32, 0x33, 0x34,
-    0x30, 0x31, 0x33, 0x34,
-    0x30, 0x31, 0x32, 0x34,
-    0x30, 0x32, 0x33, 0x35,
-    0x30, 0x32, 0x34, 0x35,
-    0x30, 0x31, 0x34, 0x35,
-    0x30, 0x31, 0x33, 0x35,
-    0x30, 0x32, 0x34, 0x36,
-    0x30, 0x33, 0x35, 0x36,
-    0x30, 0x31, 0x35, 0x36,
-    0x30, 0x31, 0x33, 0x36,
-    0x30, 0x36, 0x36, 0x36,
-    0x30, 0x30, 0x36, 0x36,
-    0x30, 0x30, 0x30, 0x36,
-    0x30, 0x33, 0x34, 0x37,
-    0x30, 0x33, 0x36, 0x37,
-    0x30, 0x31, 0x36, 0x37,
-    0x30, 0x31, 0x34, 0x37,
-    0x30, 0x33, 0x35, 0x38,
-    0x30, 0x34, 0x36, 0x38,
-    0x30, 0x32, 0x36, 0x38,
-    0x30, 0x32, 0x34, 0x38,
-    0x30, 0x38, 0x38, 0x38,
-    0x30, 0x30, 0x38, 0x38,
-    0x30, 0x30, 0x30, 0x38,
-    0x30, 0x34, 0x37, 0x3B,
-    0x30, 0x35, 0x39, 0x3B,
-    0x30, 0x32, 0x39, 0x3B,
-    0x30, 0x32, 0x36, 0x3B,
-    0x30, 0x3B, 0x3B, 0x3B,
-    0x30, 0x30, 0x3B, 0x3B,
-    0x30, 0x30, 0x30, 0x3B,
-    0x30, 0x35, 0x39, 0x3E,
-    0x30, 0x37, 0x3B, 0x3E,
-    0x30, 0x33, 0x3B, 0x3E,
-    0x30, 0x33, 0x37, 0x3E,
-    0x30, 0x3E, 0x3E, 0x3E,
-    0x30, 0x30, 0x3E, 0x3E,
-    0x30, 0x30, 0x30, 0x3E,
-    0x31, 0x32, 0x32, 0x33,
-    0x31, 0x32, 0x33, 0x34,
-    0x31, 0x33, 0x34, 0x35,
-    0x31, 0x32, 0x34, 0x35,
-    0x31, 0x32, 0x33, 0x35,
-    0x31, 0x33, 0x34, 0x36,
-    0x31, 0x33, 0x35, 0x36,
-    0x31, 0x32, 0x35, 0x36,
-    0x31, 0x32, 0x34, 0x36,
-    0x31, 0x33, 0x35, 0x37,
-    0x31, 0x34, 0x36, 0x37,
-    0x31, 0x32, 0x36, 0x37,
-    0x31, 0x32, 0x34, 0x37,
-    0x31, 0x37, 0x37, 0x37,
-    0x31, 0x31, 0x37, 0x37,
-    0x31, 0x31, 0x31, 0x37,
-    0x31, 0x34, 0x35, 0x38,
-    0x31, 0x34, 0x37, 0x38,
-    0x31, 0x32, 0x37, 0x38,
-    0x31, 0x32, 0x35, 0x38,
-    0x31, 0x34, 0x36, 0x39,
-    0x31, 0x35, 0x37, 0x39,
-    0x31, 0x33, 0x37, 0x39,
-    0x31, 0x33, 0x35, 0x39,
-    0x31, 0x39, 0x39, 0x39,
-    0x31, 0x31, 0x39, 0x39,
-    0x31, 0x31, 0x31, 0x39,
-    0x31, 0x35, 0x38, 0x3C,
-    0x31, 0x36, 0x3A, 0x3C,
-    0x31, 0x33, 0x3A, 0x3C,
-    0x31, 0x33, 0x37, 0x3C,
-    0x31, 0x3C, 0x3C, 0x3C,
-    0x31, 0x31, 0x3C, 0x3C,
-    0x31, 0x31, 0x31, 0x3C,
-    0x31, 0x36, 0x3A, 0x3F,
-    0x31, 0x38, 0x3C, 0x3F,
-    0x31, 0x34, 0x3C, 0x3F,
-    0x31, 0x34, 0x38, 0x3F,
-    0x31, 0x3F, 0x3F, 0x3F,
-    0x31, 0x31, 0x3F, 0x3F,
-    0x31, 0x31, 0x31, 0x3F,
-    0x32, 0x33, 0x33, 0x34,
-    0x32, 0x33, 0x34, 0x35,
-    0x32, 0x34, 0x35, 0x36,
-    0x32, 0x33, 0x35, 0x36,
-    0x32, 0x33, 0x34, 0x36,
-    0x32, 0x34, 0x35, 0x37,
-    0x32, 0x34, 0x36, 0x37,
-    0x32, 0x33, 0x36, 0x37,
-    0x32, 0x33, 0x35, 0x37,
-    0x32, 0x34, 0x36, 0x38,
-    0x32, 0x35, 0x37, 0x38,
-    0x32, 0x33, 0x37, 0x38,
-    0x32, 0x33, 0x35, 0x38,
-    0x32, 0x38, 0x38, 0x38,
-    0x32, 0x32, 0x38, 0x38,
-    0x32, 0x32, 0x32, 0x38,
-    0x32, 0x35, 0x36, 0x39,
-    0x32, 0x35, 0x38, 0x39,
-    0x32, 0x33, 0x38, 0x39,
-    0x32, 0x33, 0x36, 0x39,
-    0x32, 0x35, 0x37, 0x3A,
-    0x32, 0x36, 0x38, 0x3A,
-    0x32, 0x34, 0x38, 0x3A,
-    0x32, 0x34, 0x36, 0x3A,
-    0x32, 0x3A, 0x3A, 0x3A,
-    0x32, 0x32, 0x3A, 0x3A,
-    0x32, 0x32, 0x32, 0x3A,
-    0x32, 0x36, 0x39, 0x3D,
-    0x32, 0x37, 0x3B, 0x3D,
-    0x32, 0x34, 0x3B, 0x3D,
-    0x32, 0x34, 0x38, 0x3D,
-    0x32, 0x3D, 0x3D, 0x3D,
-    0x32, 0x32, 0x3D, 0x3D,
-    0x32, 0x32, 0x32, 0x3D,
-    0x33, 0x34, 0x34, 0x35,
-    0x33, 0x34, 0x35, 0x36,
-    0x33, 0x35, 0x36, 0x37,
-    0x33, 0x34, 0x36, 0x37,
-    0x33, 0x34, 0x35, 0x37,
-    0x33, 0x35, 0x36, 0x38,
-    0x33, 0x35, 0x37, 0x38,
-    0x33, 0x34, 0x37, 0x38,
-    0x33, 0x34, 0x36, 0x38,
-    0x33, 0x35, 0x37, 0x39,
-    0x33, 0x36, 0x38, 0x39,
-    0x33, 0x34, 0x38, 0x39,
-    0x33, 0x34, 0x36, 0x39,
-    0x33, 0x39, 0x39, 0x39,
-    0x33, 0x33, 0x39, 0x39,
-    0x33, 0x33, 0x33, 0x39,
-    0x33, 0x36, 0x37, 0x3A,
-    0x33, 0x36, 0x39, 0x3A,
-    0x33, 0x34, 0x39, 0x3A,
-    0x33, 0x34, 0x37, 0x3A,
-    0x33, 0x36, 0x38, 0x3B,
-    0x33, 0x37, 0x39, 0x3B,
-    0x33, 0x35, 0x39, 0x3B,
-    0x33, 0x35, 0x37, 0x3B,
-    0x33, 0x3B, 0x3B, 0x3B,
-    0x33, 0x33, 0x3B, 0x3B,
-    0x33, 0x33, 0x33, 0x3B,
-    0x33, 0x37, 0x3A, 0x3E,
-    0x33, 0x38, 0x3C, 0x3E,
-    0x33, 0x35, 0x3C, 0x3E,
-    0x33, 0x35, 0x39, 0x3E,
-    0x33, 0x3E, 0x3E, 0x3E,
-    0x33, 0x33, 0x3E, 0x3E,
-    0x33, 0x33, 0x33, 0x3E,
-    0x34, 0x35, 0x35, 0x36,
-    0x34, 0x35, 0x36, 0x37,
-    0x34, 0x36, 0x37, 0x38,
-    0x34, 0x35, 0x37, 0x38,
-    0x34, 0x35, 0x36, 0x38,
-    0x34, 0x36, 0x37, 0x39,
-    0x34, 0x36, 0x38, 0x39,
-    0x34, 0x35, 0x38, 0x39,
-    0x34, 0x35, 0x37, 0x39,
-    0x34, 0x36, 0x38, 0x3A,
-    0x34, 0x37, 0x39, 0x3A,
-    0x34, 0x35, 0x39, 0x3A,
-    0x34, 0x35, 0x37, 0x3A,
-    0x34, 0x3A, 0x3A, 0x3A,
-    0x34, 0x34, 0x3A, 0x3A,
-    0x34, 0x34, 0x34, 0x3A,
-    0x34, 0x37, 0x38, 0x3B,
-    0x34, 0x37, 0x3A, 0x3B,
-    0x34, 0x35, 0x3A, 0x3B,
-    0x34, 0x35, 0x38, 0x3B,
-    0x34, 0x37, 0x39, 0x3C,
-    0x34, 0x38, 0x3A, 0x3C,
-    0x34, 0x36, 0x3A, 0x3C,
-    0x34, 0x36, 0x38, 0x3C,
-    0x34, 0x3C, 0x3C, 0x3C,
-    0x34, 0x34, 0x3C, 0x3C,
-    0x34, 0x34, 0x34, 0x3C,
-    0x34, 0x38, 0x3B, 0x3F,
-    0x34, 0x39, 0x3D, 0x3F,
-    0x34, 0x36, 0x3D, 0x3F,
-    0x34, 0x36, 0x3A, 0x3F,
-    0x34, 0x3F, 0x3F, 0x3F,
-    0x34, 0x34, 0x3F, 0x3F,
-    0x34, 0x34, 0x34, 0x3F,
-    0x35, 0x36, 0x36, 0x37,
-    0x35, 0x36, 0x37, 0x38,
-    0x35, 0x37, 0x38, 0x39,
-    0x35, 0x36, 0x38, 0x39,
-    0x35, 0x36, 0x37, 0x39,
-    0x35, 0x37, 0x38, 0x3A,
-    0x35, 0x37, 0x39, 0x3A,
-    0x35, 0x36, 0x39, 0x3A,
-    0x35, 0x36, 0x38, 0x3A,
-    0x35, 0x37, 0x39, 0x3B,
-    0x35, 0x38, 0x3A, 0x3B,
-    0x35, 0x36, 0x3A, 0x3B,
-    0x35, 0x36, 0x38, 0x3B,
-    0x35, 0x3B, 0x3B, 0x3B,
-    0x35, 0x35, 0x3B, 0x3B,
-    0x35, 0x35, 0x35, 0x3B,
-    0x35, 0x38, 0x39, 0x3C,
-    0x35, 0x38, 0x3B, 0x3C,
-    0x35, 0x36, 0x3B, 0x3C,
-    0x35, 0x36, 0x39, 0x3C,
-    0x35, 0x38, 0x3A, 0x3D,
-    0x35, 0x39, 0x3B, 0x3D,
-    0x35, 0x37, 0x3B, 0x3D,
-    0x35, 0x37, 0x39, 0x3D,
-    0x35, 0x3D, 0x3D, 0x3D,
-    0x35, 0x35, 0x3D, 0x3D,
-    0x35, 0x35, 0x35, 0x3D,
-    0x36, 0x37, 0x37, 0x38,
-    0x36, 0x37, 0x38, 0x39,
-    0x36, 0x38, 0x39, 0x3A,
-    0x36, 0x37, 0x39, 0x3A,
-    0x36, 0x37, 0x38, 0x3A,
-    0x36, 0x38, 0x39, 0x3B,
-    0x36, 0x38, 0x3A, 0x3B,
-    0x36, 0x37, 0x3A, 0x3B,
-    0x36, 0x37, 0x39, 0x3B,
-    0x36, 0x38, 0x3A, 0x3C,
-    0x36, 0x39, 0x3B, 0x3C,
-    0x36, 0x37, 0x3B, 0x3C,
-    0x36, 0x37, 0x39, 0x3C,
-    0x36, 0x3C, 0x3C, 0x3C,
-    0x36, 0x36, 0x3C, 0x3C,
-    0x36, 0x36, 0x36, 0x3C,
-    0x36, 0x39, 0x3A, 0x3D,
-    0x36, 0x39, 0x3C, 0x3D,
-    0x36, 0x37, 0x3C, 0x3D,
-    0x36, 0x37, 0x3A, 0x3D,
-    0x36, 0x39, 0x3B, 0x3E,
-    0x36, 0x3A, 0x3C, 0x3E,
-    0x36, 0x38, 0x3C, 0x3E,
-    0x36, 0x38, 0x3A, 0x3E,
-    0x36, 0x3E, 0x3E, 0x3E,
-    0x36, 0x36, 0x3E, 0x3E,
-    0x36, 0x36, 0x36, 0x3E,
-    0x37, 0x38, 0x38, 0x39,
-    0x37, 0x38, 0x39, 0x3A,
-    0x37, 0x39, 0x3A, 0x3B,
-    0x37, 0x38, 0x3A, 0x3B,
-    0x37, 0x38, 0x39, 0x3B,
-    0x37, 0x39, 0x3A, 0x3C,
-    0x37, 0x39, 0x3B, 0x3C,
-    0x37, 0x38, 0x3B, 0x3C,
-    0x37, 0x38, 0x3A, 0x3C,
-    0x37, 0x39, 0x3B, 0x3D,
-    0x37, 0x3A, 0x3C, 0x3D,
-    0x37, 0x38, 0x3C, 0x3D,
-    0x37, 0x38, 0x3A, 0x3D,
-    0x37, 0x3D, 0x3D, 0x3D,
-    0x37, 0x37, 0x3D, 0x3D,
-    0x37, 0x37, 0x37, 0x3D,
-    0x37, 0x3A, 0x3B, 0x3E,
-    0x37, 0x3A, 0x3D, 0x3E,
-    0x37, 0x38, 0x3D, 0x3E,
-    0x37, 0x38, 0x3B, 0x3E,
-    0x37, 0x3A, 0x3C, 0x3F,
-    0x37, 0x3B, 0x3D, 0x3F,
-    0x37, 0x39, 0x3D, 0x3F,
-    0x37, 0x39, 0x3B, 0x3F,
-    0x37, 0x3F, 0x3F, 0x3F,
-    0x37, 0x37, 0x3F, 0x3F,
-    0x37, 0x37, 0x37, 0x3F,
-    0x38, 0x39, 0x39, 0x3A,
-    0x38, 0x39, 0x3A, 0x3B,
-    0x38, 0x3A, 0x3B, 0x3C,
-    0x38, 0x39, 0x3B, 0x3C,
-    0x38, 0x39, 0x3A, 0x3C,
-    0x38, 0x3A, 0x3B, 0x3D,
-    0x38, 0x3A, 0x3C, 0x3D,
-    0x38, 0x39, 0x3C, 0x3D,
-    0x38, 0x39, 0x3B, 0x3D,
-    0x38, 0x3A, 0x3C, 0x3E,
-    0x38, 0x3B, 0x3D, 0x3E,
-    0x38, 0x39, 0x3D, 0x3E,
-    0x38, 0x39, 0x3B, 0x3E,
-    0x38, 0x3E, 0x3E, 0x3E,
-    0x38, 0x38, 0x3E, 0x3E,
-    0x38, 0x38, 0x38, 0x3E,
-    0x38, 0x3B, 0x3C, 0x3F,
-    0x38, 0x3B, 0x3E, 0x3F,
-    0x38, 0x39, 0x3E, 0x3F,
-    0x38, 0x39, 0x3C, 0x3F,
-    0x39, 0x3A, 0x3A, 0x3B,
-    0x39, 0x3A, 0x3B, 0x3C,
-    0x39, 0x3B, 0x3C, 0x3D,
-    0x39, 0x3A, 0x3C, 0x3D,
-    0x39, 0x3A, 0x3B, 0x3D,
-    0x39, 0x3B, 0x3C, 0x3E,
-    0x39, 0x3B, 0x3D, 0x3E,
-    0x39, 0x3A, 0x3D, 0x3E,
-    0x39, 0x3A, 0x3C, 0x3E,
-    0x39, 0x3B, 0x3D, 0x3F,
-    0x39, 0x3C, 0x3E, 0x3F,
-    0x39, 0x3A, 0x3E, 0x3F,
-    0x39, 0x3A, 0x3C, 0x3F,
-    0x39, 0x3F, 0x3F, 0x3F,
-    0x39, 0x39, 0x3F, 0x3F,
-    0x39, 0x39, 0x39, 0x3F,
-    0x3A, 0x3B, 0x3B, 0x3C,
-    0x3A, 0x3B, 0x3C, 0x3D,
-    0x3A, 0x3C, 0x3D, 0x3E,
-    0x3A, 0x3B, 0x3D, 0x3E,
-    0x3A, 0x3B, 0x3C, 0x3E,
-    0x3A, 0x3C, 0x3D, 0x3F,
-    0x3A, 0x3C, 0x3E, 0x3F,
-    0x3A, 0x3B, 0x3E, 0x3F,
-    0x3A, 0x3B, 0x3D, 0x3F,
-    0x3B, 0x3C, 0x3C, 0x3D,
-    0x3B, 0x3C, 0x3D, 0x3E,
-    0x3B, 0x3D, 0x3E, 0x3F,
-    0x3B, 0x3C, 0x3E, 0x3F,
-    0x3B, 0x3C, 0x3D, 0x3F,
-    0x3C, 0x3D, 0x3D, 0x3E,
-    0x3C, 0x3D, 0x3E, 0x3F,
-    0x3D, 0x3E, 0x3E, 0x3F
-};
-
-#endif /* AVCODEC_ULTI_CB_H */
diff --git a/deps/libav/libavcodec/unary.h b/deps/libav/libavcodec/unary.h
deleted file mode 100644
index d14929f..0000000
--- a/deps/libav/libavcodec/unary.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * copyright (c) 2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_UNARY_H
-#define AVCODEC_UNARY_H
-
-#include "get_bits.h"
-
-/**
- * Get unary code of limited length
- * @param gb GetBitContext
- * @param[in] stop The bitstop value (unary code of 1's or 0's)
- * @param[in] len Maximum length
- * @return Unary length/index
- */
-static inline int get_unary(GetBitContext *gb, int stop, int len)
-{
-    int i;
-
-    for(i = 0; i < len && get_bits1(gb) != stop; i++);
-    return i;
-}
-
-/**
- * Get unary code terminated by a 0 with a maximum length of 33
- * @param gb GetBitContext
- * @return Unary length/index
- */
-static inline int get_unary_0_33(GetBitContext *gb)
-{
-    return get_unary(gb, 0, 33);
-}
-
-static inline int get_unary_0_9(GetBitContext *gb)
-{
-    return get_unary(gb, 0, 9);
-}
-
-#endif /* AVCODEC_UNARY_H */
diff --git a/deps/libav/libavcodec/utils.c b/deps/libav/libavcodec/utils.c
deleted file mode 100644
index b2b11ef..0000000
--- a/deps/libav/libavcodec/utils.c
+++ /dev/null
@@ -1,2333 +0,0 @@
-/*
- * utils for libavcodec
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * utils.
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/crc.h"
-#include "libavutil/frame.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/samplefmt.h"
-#include "libavutil/dict.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "libavutil/opt.h"
-#include "thread.h"
-#include "internal.h"
-#include "bytestream.h"
-#include "version.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <limits.h>
-#include <float.h>
-
-static int volatile entangled_thread_counter = 0;
-static int (*lockmgr_cb)(void **mutex, enum AVLockOp op);
-static void *codec_mutex;
-static void *avformat_mutex;
-
-#if FF_API_FAST_MALLOC && CONFIG_SHARED && HAVE_SYMVER
-FF_SYMVER(void*, av_fast_realloc, (void *ptr, unsigned int *size, size_t min_size), "LIBAVCODEC_55")
-{
-    return av_fast_realloc(ptr, size, min_size);
-}
-
-FF_SYMVER(void, av_fast_malloc, (void *ptr, unsigned int *size, size_t min_size), "LIBAVCODEC_55")
-{
-    av_fast_malloc(ptr, size, min_size);
-}
-#endif
-
-void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
-{
-    void **p = ptr;
-    if (min_size > SIZE_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
-        av_freep(p);
-        *size = 0;
-        return;
-    }
-    av_fast_malloc(p, size, min_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (*size)
-        memset((uint8_t *)*p + min_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-}
-
-/* encoder management */
-static AVCodec *first_avcodec = NULL;
-
-AVCodec *av_codec_next(const AVCodec *c)
-{
-    if (c)
-        return c->next;
-    else
-        return first_avcodec;
-}
-
-static av_cold void avcodec_init(void)
-{
-    static int initialized = 0;
-
-    if (initialized != 0)
-        return;
-    initialized = 1;
-
-    if (CONFIG_DSPUTIL)
-        ff_dsputil_static_init();
-}
-
-int av_codec_is_encoder(const AVCodec *codec)
-{
-    return codec && (codec->encode_sub || codec->encode2);
-}
-
-int av_codec_is_decoder(const AVCodec *codec)
-{
-    return codec && codec->decode;
-}
-
-av_cold void avcodec_register(AVCodec *codec)
-{
-    AVCodec **p;
-    avcodec_init();
-    p = &first_avcodec;
-    while (*p != NULL)
-        p = &(*p)->next;
-    *p          = codec;
-    codec->next = NULL;
-
-    if (codec->init_static_data)
-        codec->init_static_data(codec);
-}
-
-#if FF_API_EMU_EDGE
-unsigned avcodec_get_edge_width(void)
-{
-    return EDGE_WIDTH;
-}
-#endif
-
-#if FF_API_SET_DIMENSIONS
-void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
-{
-    ff_set_dimensions(s, width, height);
-}
-#endif
-
-int ff_set_dimensions(AVCodecContext *s, int width, int height)
-{
-    int ret = av_image_check_size(width, height, 0, s);
-
-    if (ret < 0)
-        width = height = 0;
-    s->width  = s->coded_width  = width;
-    s->height = s->coded_height = height;
-
-    return ret;
-}
-
-int ff_side_data_update_matrix_encoding(AVFrame *frame,
-                                        enum AVMatrixEncoding matrix_encoding)
-{
-    AVFrameSideData *side_data;
-    enum AVMatrixEncoding *data;
-
-    side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_MATRIXENCODING);
-    if (!side_data)
-        side_data = av_frame_new_side_data(frame, AV_FRAME_DATA_MATRIXENCODING,
-                                           sizeof(enum AVMatrixEncoding));
-
-    if (!side_data)
-        return AVERROR(ENOMEM);
-
-    data  = (enum AVMatrixEncoding*)side_data->data;
-    *data = matrix_encoding;
-
-    return 0;
-}
-
-#if HAVE_NEON || ARCH_PPC || HAVE_MMX
-#   define STRIDE_ALIGN 16
-#else
-#   define STRIDE_ALIGN 8
-#endif
-
-void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
-                               int linesize_align[AV_NUM_DATA_POINTERS])
-{
-    int i;
-    int w_align = 1;
-    int h_align = 1;
-
-    switch (s->pix_fmt) {
-    case AV_PIX_FMT_YUV420P:
-    case AV_PIX_FMT_YUYV422:
-    case AV_PIX_FMT_UYVY422:
-    case AV_PIX_FMT_YUV422P:
-    case AV_PIX_FMT_YUV440P:
-    case AV_PIX_FMT_YUV444P:
-    case AV_PIX_FMT_GBRP:
-    case AV_PIX_FMT_GRAY8:
-    case AV_PIX_FMT_GRAY16BE:
-    case AV_PIX_FMT_GRAY16LE:
-    case AV_PIX_FMT_YUVJ420P:
-    case AV_PIX_FMT_YUVJ422P:
-    case AV_PIX_FMT_YUVJ440P:
-    case AV_PIX_FMT_YUVJ444P:
-    case AV_PIX_FMT_YUVA420P:
-    case AV_PIX_FMT_YUVA422P:
-    case AV_PIX_FMT_YUVA444P:
-    case AV_PIX_FMT_YUV420P9LE:
-    case AV_PIX_FMT_YUV420P9BE:
-    case AV_PIX_FMT_YUV420P10LE:
-    case AV_PIX_FMT_YUV420P10BE:
-    case AV_PIX_FMT_YUV422P9LE:
-    case AV_PIX_FMT_YUV422P9BE:
-    case AV_PIX_FMT_YUV422P10LE:
-    case AV_PIX_FMT_YUV422P10BE:
-    case AV_PIX_FMT_YUVA422P10LE:
-    case AV_PIX_FMT_YUVA422P10BE:
-    case AV_PIX_FMT_YUV444P9LE:
-    case AV_PIX_FMT_YUV444P9BE:
-    case AV_PIX_FMT_YUV444P10LE:
-    case AV_PIX_FMT_YUV444P10BE:
-    case AV_PIX_FMT_YUVA444P10LE:
-    case AV_PIX_FMT_YUVA444P10BE:
-    case AV_PIX_FMT_GBRP9LE:
-    case AV_PIX_FMT_GBRP9BE:
-    case AV_PIX_FMT_GBRP10LE:
-    case AV_PIX_FMT_GBRP10BE:
-        w_align = 16; //FIXME assume 16 pixel per macroblock
-        h_align = 16 * 2; // interlaced needs 2 macroblocks height
-        break;
-    case AV_PIX_FMT_YUV411P:
-    case AV_PIX_FMT_UYYVYY411:
-        w_align = 32;
-        h_align = 8;
-        break;
-    case AV_PIX_FMT_YUV410P:
-        if (s->codec_id == AV_CODEC_ID_SVQ1) {
-            w_align = 64;
-            h_align = 64;
-        }
-    case AV_PIX_FMT_RGB555:
-        if (s->codec_id == AV_CODEC_ID_RPZA) {
-            w_align = 4;
-            h_align = 4;
-        }
-    case AV_PIX_FMT_PAL8:
-    case AV_PIX_FMT_BGR8:
-    case AV_PIX_FMT_RGB8:
-        if (s->codec_id == AV_CODEC_ID_SMC) {
-            w_align = 4;
-            h_align = 4;
-        }
-        break;
-    case AV_PIX_FMT_BGR24:
-        if ((s->codec_id == AV_CODEC_ID_MSZH) ||
-            (s->codec_id == AV_CODEC_ID_ZLIB)) {
-            w_align = 4;
-            h_align = 4;
-        }
-        break;
-    default:
-        w_align = 1;
-        h_align = 1;
-        break;
-    }
-
-    *width  = FFALIGN(*width, w_align);
-    *height = FFALIGN(*height, h_align);
-    if (s->codec_id == AV_CODEC_ID_H264)
-        // some of the optimized chroma MC reads one line too much
-        *height += 2;
-
-    for (i = 0; i < 4; i++)
-        linesize_align[i] = STRIDE_ALIGN;
-}
-
-void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt);
-    int chroma_shift = desc->log2_chroma_w;
-    int linesize_align[AV_NUM_DATA_POINTERS];
-    int align;
-
-    avcodec_align_dimensions2(s, width, height, linesize_align);
-    align               = FFMAX(linesize_align[0], linesize_align[3]);
-    linesize_align[1] <<= chroma_shift;
-    linesize_align[2] <<= chroma_shift;
-    align               = FFMAX3(align, linesize_align[1], linesize_align[2]);
-    *width              = FFALIGN(*width, align);
-}
-
-int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
-                             enum AVSampleFormat sample_fmt, const uint8_t *buf,
-                             int buf_size, int align)
-{
-    int ch, planar, needed_size, ret = 0;
-
-    needed_size = av_samples_get_buffer_size(NULL, nb_channels,
-                                             frame->nb_samples, sample_fmt,
-                                             align);
-    if (buf_size < needed_size)
-        return AVERROR(EINVAL);
-
-    planar = av_sample_fmt_is_planar(sample_fmt);
-    if (planar && nb_channels > AV_NUM_DATA_POINTERS) {
-        if (!(frame->extended_data = av_mallocz(nb_channels *
-                                                sizeof(*frame->extended_data))))
-            return AVERROR(ENOMEM);
-    } else {
-        frame->extended_data = frame->data;
-    }
-
-    if ((ret = av_samples_fill_arrays(frame->extended_data, &frame->linesize[0],
-                                      buf, nb_channels, frame->nb_samples,
-                                      sample_fmt, align)) < 0) {
-        if (frame->extended_data != frame->data)
-            av_free(frame->extended_data);
-        return ret;
-    }
-    if (frame->extended_data != frame->data) {
-        for (ch = 0; ch < AV_NUM_DATA_POINTERS; ch++)
-            frame->data[ch] = frame->extended_data[ch];
-    }
-
-    return ret;
-}
-
-static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame)
-{
-    FramePool *pool = avctx->internal->pool;
-    int i, ret;
-
-    switch (avctx->codec_type) {
-    case AVMEDIA_TYPE_VIDEO: {
-        AVPicture picture;
-        int size[4] = { 0 };
-        int w = frame->width;
-        int h = frame->height;
-        int tmpsize, unaligned;
-
-        if (pool->format == frame->format &&
-            pool->width == frame->width && pool->height == frame->height)
-            return 0;
-
-        avcodec_align_dimensions2(avctx, &w, &h, pool->stride_align);
-
-        if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
-            w += EDGE_WIDTH * 2;
-            h += EDGE_WIDTH * 2;
-        }
-
-        do {
-            // NOTE: do not align linesizes individually, this breaks e.g. assumptions
-            // that linesize[0] == 2*linesize[1] in the MPEG-encoder for 4:2:2
-            av_image_fill_linesizes(picture.linesize, avctx->pix_fmt, w);
-            // increase alignment of w for next try (rhs gives the lowest bit set in w)
-            w += w & ~(w - 1);
-
-            unaligned = 0;
-            for (i = 0; i < 4; i++)
-                unaligned |= picture.linesize[i] % pool->stride_align[i];
-        } while (unaligned);
-
-        tmpsize = av_image_fill_pointers(picture.data, avctx->pix_fmt, h,
-                                         NULL, picture.linesize);
-        if (tmpsize < 0)
-            return -1;
-
-        for (i = 0; i < 3 && picture.data[i + 1]; i++)
-            size[i] = picture.data[i + 1] - picture.data[i];
-        size[i] = tmpsize - (picture.data[i] - picture.data[0]);
-
-        for (i = 0; i < 4; i++) {
-            av_buffer_pool_uninit(&pool->pools[i]);
-            pool->linesize[i] = picture.linesize[i];
-            if (size[i]) {
-                pool->pools[i] = av_buffer_pool_init(size[i] + 16, NULL);
-                if (!pool->pools[i]) {
-                    ret = AVERROR(ENOMEM);
-                    goto fail;
-                }
-            }
-        }
-        pool->format = frame->format;
-        pool->width  = frame->width;
-        pool->height = frame->height;
-
-        break;
-        }
-    case AVMEDIA_TYPE_AUDIO: {
-        int ch     = av_get_channel_layout_nb_channels(frame->channel_layout);
-        int planar = av_sample_fmt_is_planar(frame->format);
-        int planes = planar ? ch : 1;
-
-        if (pool->format == frame->format && pool->planes == planes &&
-            pool->channels == ch && frame->nb_samples == pool->samples)
-            return 0;
-
-        av_buffer_pool_uninit(&pool->pools[0]);
-        ret = av_samples_get_buffer_size(&pool->linesize[0], ch,
-                                         frame->nb_samples, frame->format, 0);
-        if (ret < 0)
-            goto fail;
-
-        pool->pools[0] = av_buffer_pool_init(pool->linesize[0], NULL);
-        if (!pool->pools[0]) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        pool->format     = frame->format;
-        pool->planes     = planes;
-        pool->channels   = ch;
-        pool->samples = frame->nb_samples;
-        break;
-        }
-    default: av_assert0(0);
-    }
-    return 0;
-fail:
-    for (i = 0; i < 4; i++)
-        av_buffer_pool_uninit(&pool->pools[i]);
-    pool->format = -1;
-    pool->planes = pool->channels = pool->samples = 0;
-    pool->width  = pool->height = 0;
-    return ret;
-}
-
-static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame)
-{
-    FramePool *pool = avctx->internal->pool;
-    int planes = pool->planes;
-    int i;
-
-    frame->linesize[0] = pool->linesize[0];
-
-    if (planes > AV_NUM_DATA_POINTERS) {
-        frame->extended_data = av_mallocz(planes * sizeof(*frame->extended_data));
-        frame->nb_extended_buf = planes - AV_NUM_DATA_POINTERS;
-        frame->extended_buf  = av_mallocz(frame->nb_extended_buf *
-                                          sizeof(*frame->extended_buf));
-        if (!frame->extended_data || !frame->extended_buf) {
-            av_freep(&frame->extended_data);
-            av_freep(&frame->extended_buf);
-            return AVERROR(ENOMEM);
-        }
-    } else
-        frame->extended_data = frame->data;
-
-    for (i = 0; i < FFMIN(planes, AV_NUM_DATA_POINTERS); i++) {
-        frame->buf[i] = av_buffer_pool_get(pool->pools[0]);
-        if (!frame->buf[i])
-            goto fail;
-        frame->extended_data[i] = frame->data[i] = frame->buf[i]->data;
-    }
-    for (i = 0; i < frame->nb_extended_buf; i++) {
-        frame->extended_buf[i] = av_buffer_pool_get(pool->pools[0]);
-        if (!frame->extended_buf[i])
-            goto fail;
-        frame->extended_data[i + AV_NUM_DATA_POINTERS] = frame->extended_buf[i]->data;
-    }
-
-    if (avctx->debug & FF_DEBUG_BUFFERS)
-        av_log(avctx, AV_LOG_DEBUG, "default_get_buffer called on frame %p", frame);
-
-    return 0;
-fail:
-    av_frame_unref(frame);
-    return AVERROR(ENOMEM);
-}
-
-static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
-{
-    FramePool *pool = s->internal->pool;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pic->format);
-    int pixel_size = desc->comp[0].step_minus1 + 1;
-    int h_chroma_shift, v_chroma_shift;
-    int i;
-
-    if (pic->data[0] != NULL) {
-        av_log(s, AV_LOG_ERROR, "pic->data[0]!=NULL in avcodec_default_get_buffer\n");
-        return -1;
-    }
-
-    memset(pic->data, 0, sizeof(pic->data));
-    pic->extended_data = pic->data;
-
-    av_pix_fmt_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
-
-    for (i = 0; i < 4 && pool->pools[i]; i++) {
-        const int h_shift = i == 0 ? 0 : h_chroma_shift;
-        const int v_shift = i == 0 ? 0 : v_chroma_shift;
-
-        pic->linesize[i] = pool->linesize[i];
-
-        pic->buf[i] = av_buffer_pool_get(pool->pools[i]);
-        if (!pic->buf[i])
-            goto fail;
-
-        // no edge if EDGE EMU or not planar YUV
-        if ((s->flags & CODEC_FLAG_EMU_EDGE) || !pool->pools[2])
-            pic->data[i] = pic->buf[i]->data;
-        else {
-            pic->data[i] = pic->buf[i]->data +
-                FFALIGN((pic->linesize[i] * EDGE_WIDTH >> v_shift) +
-                        (pixel_size * EDGE_WIDTH >> h_shift), pool->stride_align[i]);
-        }
-    }
-    for (; i < AV_NUM_DATA_POINTERS; i++) {
-        pic->data[i] = NULL;
-        pic->linesize[i] = 0;
-    }
-    if (pic->data[1] && !pic->data[2])
-        avpriv_set_systematic_pal2((uint32_t *)pic->data[1], s->pix_fmt);
-
-    if (s->debug & FF_DEBUG_BUFFERS)
-        av_log(s, AV_LOG_DEBUG, "default_get_buffer called on pic %p\n", pic);
-
-    return 0;
-fail:
-    av_frame_unref(pic);
-    return AVERROR(ENOMEM);
-}
-
-int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags)
-{
-    int ret;
-
-    if ((ret = update_frame_pool(avctx, frame)) < 0)
-        return ret;
-
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-    frame->type = FF_BUFFER_TYPE_INTERNAL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-    switch (avctx->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-        return video_get_buffer(avctx, frame);
-    case AVMEDIA_TYPE_AUDIO:
-        return audio_get_buffer(avctx, frame);
-    default:
-        return -1;
-    }
-}
-
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
-{
-    return avcodec_default_get_buffer2(avctx, frame, 0);
-}
-
-typedef struct CompatReleaseBufPriv {
-    AVCodecContext avctx;
-    AVFrame frame;
-} CompatReleaseBufPriv;
-
-static void compat_free_buffer(void *opaque, uint8_t *data)
-{
-    CompatReleaseBufPriv *priv = opaque;
-    if (priv->avctx.release_buffer)
-        priv->avctx.release_buffer(&priv->avctx, &priv->frame);
-    av_freep(&priv);
-}
-
-static void compat_release_buffer(void *opaque, uint8_t *data)
-{
-    AVBufferRef *buf = opaque;
-    av_buffer_unref(&buf);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
-{
-    int override_dimensions = 1;
-    int ret;
-
-    switch (avctx->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-        if (frame->width <= 0 || frame->height <= 0) {
-            frame->width  = FFMAX(avctx->width, avctx->coded_width);
-            frame->height = FFMAX(avctx->height, avctx->coded_height);
-            override_dimensions = 0;
-        }
-        if (frame->format < 0)
-            frame->format              = avctx->pix_fmt;
-        if (!frame->sample_aspect_ratio.num)
-            frame->sample_aspect_ratio = avctx->sample_aspect_ratio;
-
-        if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
-            return ret;
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        if (!frame->sample_rate)
-            frame->sample_rate    = avctx->sample_rate;
-        if (frame->format < 0)
-            frame->format         = avctx->sample_fmt;
-        if (!frame->channel_layout) {
-            if (avctx->channel_layout) {
-                 if (av_get_channel_layout_nb_channels(avctx->channel_layout) !=
-                     avctx->channels) {
-                     av_log(avctx, AV_LOG_ERROR, "Inconsistent channel "
-                            "configuration.\n");
-                     return AVERROR(EINVAL);
-                 }
-
-                frame->channel_layout = avctx->channel_layout;
-            } else {
-                if (avctx->channels > FF_SANE_NB_CHANNELS) {
-                    av_log(avctx, AV_LOG_ERROR, "Too many channels: %d.\n",
-                           avctx->channels);
-                    return AVERROR(ENOSYS);
-                }
-
-                frame->channel_layout = av_get_default_channel_layout(avctx->channels);
-                if (!frame->channel_layout)
-                    frame->channel_layout = (1ULL << avctx->channels) - 1;
-            }
-        }
-        break;
-    default: return AVERROR(EINVAL);
-    }
-
-    frame->pkt_pts = avctx->internal->pkt ? avctx->internal->pkt->pts : AV_NOPTS_VALUE;
-    frame->reordered_opaque = avctx->reordered_opaque;
-
-#if FF_API_GET_BUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-    /*
-     * Wrap an old get_buffer()-allocated buffer in an bunch of AVBuffers.
-     * We wrap each plane in its own AVBuffer. Each of those has a reference to
-     * a dummy AVBuffer as its private data, unreffing it on free.
-     * When all the planes are freed, the dummy buffer's free callback calls
-     * release_buffer().
-     */
-    if (avctx->get_buffer) {
-        CompatReleaseBufPriv *priv = NULL;
-        AVBufferRef *dummy_buf = NULL;
-        int planes, i, ret;
-
-        if (flags & AV_GET_BUFFER_FLAG_REF)
-            frame->reference    = 1;
-
-        ret = avctx->get_buffer(avctx, frame);
-        if (ret < 0)
-            return ret;
-
-        /* return if the buffers are already set up
-         * this would happen e.g. when a custom get_buffer() calls
-         * avcodec_default_get_buffer
-         */
-        if (frame->buf[0])
-            return 0;
-
-        priv = av_mallocz(sizeof(*priv));
-        if (!priv) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        priv->avctx = *avctx;
-        priv->frame = *frame;
-
-        dummy_buf = av_buffer_create(NULL, 0, compat_free_buffer, priv, 0);
-        if (!dummy_buf) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-#define WRAP_PLANE(ref_out, data, data_size)                            \
-do {                                                                    \
-    AVBufferRef *dummy_ref = av_buffer_ref(dummy_buf);                  \
-    if (!dummy_ref) {                                                   \
-        ret = AVERROR(ENOMEM);                                          \
-        goto fail;                                                      \
-    }                                                                   \
-    ref_out = av_buffer_create(data, data_size, compat_release_buffer,  \
-                               dummy_ref, 0);                           \
-    if (!ref_out) {                                                     \
-        av_frame_unref(frame);                                          \
-        ret = AVERROR(ENOMEM);                                          \
-        goto fail;                                                      \
-    }                                                                   \
-} while (0)
-
-        if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
-            const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
-
-            planes = av_pix_fmt_count_planes(frame->format);
-            /* workaround for AVHWAccel plane count of 0, buf[0] is used as
-               check for allocated buffers: make libavcodec happy */
-            if (desc && desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
-                planes = 1;
-            if (!desc || planes <= 0) {
-                ret = AVERROR(EINVAL);
-                goto fail;
-            }
-
-            for (i = 0; i < planes; i++) {
-                int v_shift    = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
-                int plane_size = (frame->height >> v_shift) * frame->linesize[i];
-
-                WRAP_PLANE(frame->buf[i], frame->data[i], plane_size);
-            }
-        } else {
-            int planar = av_sample_fmt_is_planar(frame->format);
-            planes = planar ? avctx->channels : 1;
-
-            if (planes > FF_ARRAY_ELEMS(frame->buf)) {
-                frame->nb_extended_buf = planes - FF_ARRAY_ELEMS(frame->buf);
-                frame->extended_buf = av_malloc(sizeof(*frame->extended_buf) *
-                                                frame->nb_extended_buf);
-                if (!frame->extended_buf) {
-                    ret = AVERROR(ENOMEM);
-                    goto fail;
-                }
-            }
-
-            for (i = 0; i < FFMIN(planes, FF_ARRAY_ELEMS(frame->buf)); i++)
-                WRAP_PLANE(frame->buf[i], frame->extended_data[i], frame->linesize[0]);
-
-            for (i = 0; i < frame->nb_extended_buf; i++)
-                WRAP_PLANE(frame->extended_buf[i],
-                           frame->extended_data[i + FF_ARRAY_ELEMS(frame->buf)],
-                           frame->linesize[0]);
-        }
-
-        av_buffer_unref(&dummy_buf);
-
-        frame->width  = avctx->width;
-        frame->height = avctx->height;
-
-        return 0;
-
-fail:
-        avctx->release_buffer(avctx, frame);
-        av_freep(&priv);
-        av_buffer_unref(&dummy_buf);
-        return ret;
-    }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-    ret = avctx->get_buffer2(avctx, frame, flags);
-
-    if (avctx->codec_type == AVMEDIA_TYPE_VIDEO && !override_dimensions) {
-        frame->width  = avctx->width;
-        frame->height = avctx->height;
-    }
-
-    return ret;
-}
-
-int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
-{
-    AVFrame tmp;
-    int ret;
-
-    av_assert0(avctx->codec_type == AVMEDIA_TYPE_VIDEO);
-
-    if (!frame->data[0])
-        return ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);
-
-    if (av_frame_is_writable(frame)) {
-        frame->pkt_pts = avctx->internal->pkt ? avctx->internal->pkt->pts : AV_NOPTS_VALUE;
-        frame->reordered_opaque = avctx->reordered_opaque;
-        return 0;
-    }
-
-    av_frame_move_ref(&tmp, frame);
-
-    ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);
-    if (ret < 0) {
-        av_frame_unref(&tmp);
-        return ret;
-    }
-
-    av_image_copy(frame->data, frame->linesize, tmp.data, tmp.linesize,
-                  frame->format, frame->width, frame->height);
-
-    av_frame_unref(&tmp);
-
-    return 0;
-}
-
-#if FF_API_GET_BUFFER
-void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
-{
-    av_frame_unref(pic);
-}
-
-int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic)
-{
-    av_assert0(0);
-    return AVERROR_BUG;
-}
-#endif
-
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
-{
-    int i;
-
-    for (i = 0; i < count; i++) {
-        int r = func(c, (char *)arg + i * size);
-        if (ret)
-            ret[i] = r;
-    }
-    return 0;
-}
-
-int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int jobnr, int threadnr), void *arg, int *ret, int count)
-{
-    int i;
-
-    for (i = 0; i < count; i++) {
-        int r = func(c, arg, i, 0);
-        if (ret)
-            ret[i] = r;
-    }
-    return 0;
-}
-
-static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    return desc->flags & AV_PIX_FMT_FLAG_HWACCEL;
-}
-
-enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
-{
-    while (*fmt != AV_PIX_FMT_NONE && is_hwaccel_pix_fmt(*fmt))
-        ++fmt;
-    return fmt[0];
-}
-
-#if FF_API_AVFRAME_LAVC
-void avcodec_get_frame_defaults(AVFrame *frame)
-{
-    if (frame->extended_data != frame->data)
-        av_freep(&frame->extended_data);
-
-    memset(frame, 0, sizeof(AVFrame));
-
-    frame->pts                 = AV_NOPTS_VALUE;
-    frame->key_frame           = 1;
-    frame->sample_aspect_ratio = (AVRational) {0, 1 };
-    frame->format              = -1; /* unknown */
-    frame->extended_data       = frame->data;
-}
-
-AVFrame *avcodec_alloc_frame(void)
-{
-    AVFrame *frame = av_mallocz(sizeof(AVFrame));
-
-    if (frame == NULL)
-        return NULL;
-
-FF_DISABLE_DEPRECATION_WARNINGS
-    avcodec_get_frame_defaults(frame);
-FF_ENABLE_DEPRECATION_WARNINGS
-
-    return frame;
-}
-
-void avcodec_free_frame(AVFrame **frame)
-{
-    av_frame_free(frame);
-}
-#endif
-
-int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
-{
-    int ret = 0;
-    AVDictionary *tmp = NULL;
-
-    if (avcodec_is_open(avctx))
-        return 0;
-
-    if ((!codec && !avctx->codec)) {
-        av_log(avctx, AV_LOG_ERROR, "No codec provided to avcodec_open2().\n");
-        return AVERROR(EINVAL);
-    }
-    if ((codec && avctx->codec && codec != avctx->codec)) {
-        av_log(avctx, AV_LOG_ERROR, "This AVCodecContext was allocated for %s, "
-                                    "but %s passed to avcodec_open2().\n", avctx->codec->name, codec->name);
-        return AVERROR(EINVAL);
-    }
-    if (!codec)
-        codec = avctx->codec;
-
-    if (avctx->extradata_size < 0 || avctx->extradata_size >= FF_MAX_EXTRADATA_SIZE)
-        return AVERROR(EINVAL);
-
-    if (options)
-        av_dict_copy(&tmp, *options, 0);
-
-    /* If there is a user-supplied mutex locking routine, call it. */
-    if (lockmgr_cb) {
-        if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
-            return -1;
-    }
-
-    entangled_thread_counter++;
-    if (entangled_thread_counter != 1) {
-        av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n");
-        ret = -1;
-        goto end;
-    }
-
-    avctx->internal = av_mallocz(sizeof(AVCodecInternal));
-    if (!avctx->internal) {
-        ret = AVERROR(ENOMEM);
-        goto end;
-    }
-
-    avctx->internal->pool = av_mallocz(sizeof(*avctx->internal->pool));
-    if (!avctx->internal->pool) {
-        ret = AVERROR(ENOMEM);
-        goto free_and_end;
-    }
-
-    avctx->internal->to_free = av_frame_alloc();
-    if (!avctx->internal->to_free) {
-        ret = AVERROR(ENOMEM);
-        goto free_and_end;
-    }
-
-    if (codec->priv_data_size > 0) {
-        if (!avctx->priv_data) {
-            avctx->priv_data = av_mallocz(codec->priv_data_size);
-            if (!avctx->priv_data) {
-                ret = AVERROR(ENOMEM);
-                goto end;
-            }
-            if (codec->priv_class) {
-                *(const AVClass **)avctx->priv_data = codec->priv_class;
-                av_opt_set_defaults(avctx->priv_data);
-            }
-        }
-        if (codec->priv_class && (ret = av_opt_set_dict(avctx->priv_data, &tmp)) < 0)
-            goto free_and_end;
-    } else {
-        avctx->priv_data = NULL;
-    }
-    if ((ret = av_opt_set_dict(avctx, &tmp)) < 0)
-        goto free_and_end;
-
-    if (avctx->coded_width && avctx->coded_height && !avctx->width && !avctx->height)
-        ret = ff_set_dimensions(avctx, avctx->coded_width, avctx->coded_height);
-    else if (avctx->width && avctx->height)
-        ret = ff_set_dimensions(avctx, avctx->width, avctx->height);
-    if (ret < 0)
-        goto free_and_end;
-
-    if ((avctx->coded_width || avctx->coded_height || avctx->width || avctx->height)
-        && (  av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx) < 0
-           || av_image_check_size(avctx->width,       avctx->height,       0, avctx) < 0)) {
-        av_log(avctx, AV_LOG_WARNING, "ignoring invalid width/height values\n");
-        ff_set_dimensions(avctx, 0, 0);
-    }
-
-    /* if the decoder init function was already called previously,
-     * free the already allocated subtitle_header before overwriting it */
-    if (av_codec_is_decoder(codec))
-        av_freep(&avctx->subtitle_header);
-
-    if (avctx->channels > FF_SANE_NB_CHANNELS) {
-        ret = AVERROR(EINVAL);
-        goto free_and_end;
-    }
-
-    avctx->codec = codec;
-    if ((avctx->codec_type == AVMEDIA_TYPE_UNKNOWN || avctx->codec_type == codec->type) &&
-        avctx->codec_id == AV_CODEC_ID_NONE) {
-        avctx->codec_type = codec->type;
-        avctx->codec_id   = codec->id;
-    }
-    if (avctx->codec_id != codec->id || (avctx->codec_type != codec->type
-                                         && avctx->codec_type != AVMEDIA_TYPE_ATTACHMENT)) {
-        av_log(avctx, AV_LOG_ERROR, "codec type or id mismatches\n");
-        ret = AVERROR(EINVAL);
-        goto free_and_end;
-    }
-    avctx->frame_number = 0;
-
-    if (avctx->codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
-        avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
-        ret = AVERROR_EXPERIMENTAL;
-        goto free_and_end;
-    }
-
-    if (avctx->codec_type == AVMEDIA_TYPE_AUDIO &&
-        (!avctx->time_base.num || !avctx->time_base.den)) {
-        avctx->time_base.num = 1;
-        avctx->time_base.den = avctx->sample_rate;
-    }
-
-    if (HAVE_THREADS) {
-        ret = ff_thread_init(avctx);
-        if (ret < 0) {
-            goto free_and_end;
-        }
-    }
-    if (!HAVE_THREADS && !(codec->capabilities & CODEC_CAP_AUTO_THREADS))
-        avctx->thread_count = 1;
-
-    if (av_codec_is_encoder(avctx->codec)) {
-        int i;
-        if (avctx->codec->sample_fmts) {
-            for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) {
-                if (avctx->sample_fmt == avctx->codec->sample_fmts[i])
-                    break;
-                if (avctx->channels == 1 &&
-                    av_get_planar_sample_fmt(avctx->sample_fmt) ==
-                    av_get_planar_sample_fmt(avctx->codec->sample_fmts[i])) {
-                    avctx->sample_fmt = avctx->codec->sample_fmts[i];
-                    break;
-                }
-            }
-            if (avctx->codec->sample_fmts[i] == AV_SAMPLE_FMT_NONE) {
-                av_log(avctx, AV_LOG_ERROR, "Specified sample_fmt is not supported.\n");
-                ret = AVERROR(EINVAL);
-                goto free_and_end;
-            }
-        }
-        if (avctx->codec->pix_fmts) {
-            for (i = 0; avctx->codec->pix_fmts[i] != AV_PIX_FMT_NONE; i++)
-                if (avctx->pix_fmt == avctx->codec->pix_fmts[i])
-                    break;
-            if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_NONE) {
-                av_log(avctx, AV_LOG_ERROR, "Specified pix_fmt is not supported\n");
-                ret = AVERROR(EINVAL);
-                goto free_and_end;
-            }
-        }
-        if (avctx->codec->supported_samplerates) {
-            for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++)
-                if (avctx->sample_rate == avctx->codec->supported_samplerates[i])
-                    break;
-            if (avctx->codec->supported_samplerates[i] == 0) {
-                av_log(avctx, AV_LOG_ERROR, "Specified sample_rate is not supported\n");
-                ret = AVERROR(EINVAL);
-                goto free_and_end;
-            }
-        }
-        if (avctx->codec->channel_layouts) {
-            if (!avctx->channel_layout) {
-                av_log(avctx, AV_LOG_WARNING, "channel_layout not specified\n");
-            } else {
-                for (i = 0; avctx->codec->channel_layouts[i] != 0; i++)
-                    if (avctx->channel_layout == avctx->codec->channel_layouts[i])
-                        break;
-                if (avctx->codec->channel_layouts[i] == 0) {
-                    av_log(avctx, AV_LOG_ERROR, "Specified channel_layout is not supported\n");
-                    ret = AVERROR(EINVAL);
-                    goto free_and_end;
-                }
-            }
-        }
-        if (avctx->channel_layout && avctx->channels) {
-            if (av_get_channel_layout_nb_channels(avctx->channel_layout) != avctx->channels) {
-                av_log(avctx, AV_LOG_ERROR, "channel layout does not match number of channels\n");
-                ret = AVERROR(EINVAL);
-                goto free_and_end;
-            }
-        } else if (avctx->channel_layout) {
-            avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
-        }
-
-        if (!avctx->rc_initial_buffer_occupancy)
-            avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3 / 4;
-    }
-
-    if (avctx->codec->init && !(avctx->active_thread_type & FF_THREAD_FRAME)) {
-        ret = avctx->codec->init(avctx);
-        if (ret < 0) {
-            goto free_and_end;
-        }
-    }
-
-    if (av_codec_is_decoder(avctx->codec)) {
-        /* validate channel layout from the decoder */
-        if (avctx->channel_layout) {
-            int channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
-            if (!avctx->channels)
-                avctx->channels = channels;
-            else if (channels != avctx->channels) {
-                av_log(avctx, AV_LOG_WARNING,
-                       "channel layout does not match number of channels\n");
-                avctx->channel_layout = 0;
-            }
-        }
-        if (avctx->channels && avctx->channels < 0 ||
-            avctx->channels > FF_SANE_NB_CHANNELS) {
-            ret = AVERROR(EINVAL);
-            goto free_and_end;
-        }
-    }
-end:
-    entangled_thread_counter--;
-
-    /* Release any user-supplied mutex. */
-    if (lockmgr_cb) {
-        (*lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE);
-    }
-    if (options) {
-        av_dict_free(options);
-        *options = tmp;
-    }
-
-    return ret;
-free_and_end:
-    av_dict_free(&tmp);
-    av_freep(&avctx->priv_data);
-    if (avctx->internal) {
-        av_frame_free(&avctx->internal->to_free);
-        av_freep(&avctx->internal->pool);
-    }
-    av_freep(&avctx->internal);
-    avctx->codec = NULL;
-    goto end;
-}
-
-int ff_alloc_packet(AVPacket *avpkt, int size)
-{
-    if (size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
-        return AVERROR(EINVAL);
-
-    if (avpkt->data) {
-        AVBufferRef *buf = avpkt->buf;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-        void *destruct = avpkt->destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-        if (avpkt->size < size)
-            return AVERROR(EINVAL);
-
-        av_init_packet(avpkt);
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-        avpkt->destruct = destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-        avpkt->buf      = buf;
-        avpkt->size     = size;
-        return 0;
-    } else {
-        return av_new_packet(avpkt, size);
-    }
-}
-
-/**
- * Pad last frame with silence.
- */
-static int pad_last_frame(AVCodecContext *s, AVFrame **dst, const AVFrame *src)
-{
-    AVFrame *frame = NULL;
-    int ret;
-
-    if (!(frame = av_frame_alloc()))
-        return AVERROR(ENOMEM);
-
-    frame->format         = src->format;
-    frame->channel_layout = src->channel_layout;
-    frame->nb_samples     = s->frame_size;
-    ret = av_frame_get_buffer(frame, 32);
-    if (ret < 0)
-        goto fail;
-
-    ret = av_frame_copy_props(frame, src);
-    if (ret < 0)
-        goto fail;
-
-    if ((ret = av_samples_copy(frame->extended_data, src->extended_data, 0, 0,
-                               src->nb_samples, s->channels, s->sample_fmt)) < 0)
-        goto fail;
-    if ((ret = av_samples_set_silence(frame->extended_data, src->nb_samples,
-                                      frame->nb_samples - src->nb_samples,
-                                      s->channels, s->sample_fmt)) < 0)
-        goto fail;
-
-    *dst = frame;
-
-    return 0;
-
-fail:
-    av_frame_free(&frame);
-    return ret;
-}
-
-int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
-                                              AVPacket *avpkt,
-                                              const AVFrame *frame,
-                                              int *got_packet_ptr)
-{
-    AVFrame tmp;
-    AVFrame *padded_frame = NULL;
-    int ret;
-    int user_packet = !!avpkt->data;
-
-    *got_packet_ptr = 0;
-
-    if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
-        av_free_packet(avpkt);
-        av_init_packet(avpkt);
-        return 0;
-    }
-
-    /* ensure that extended_data is properly set */
-    if (frame && !frame->extended_data) {
-        if (av_sample_fmt_is_planar(avctx->sample_fmt) &&
-            avctx->channels > AV_NUM_DATA_POINTERS) {
-            av_log(avctx, AV_LOG_ERROR, "Encoding to a planar sample format, "
-                                        "with more than %d channels, but extended_data is not set.\n",
-                   AV_NUM_DATA_POINTERS);
-            return AVERROR(EINVAL);
-        }
-        av_log(avctx, AV_LOG_WARNING, "extended_data is not set.\n");
-
-        tmp = *frame;
-        tmp.extended_data = tmp.data;
-        frame = &tmp;
-    }
-
-    /* check for valid frame size */
-    if (frame) {
-        if (avctx->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
-            if (frame->nb_samples > avctx->frame_size)
-                return AVERROR(EINVAL);
-        } else if (!(avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)) {
-            if (frame->nb_samples < avctx->frame_size &&
-                !avctx->internal->last_audio_frame) {
-                ret = pad_last_frame(avctx, &padded_frame, frame);
-                if (ret < 0)
-                    return ret;
-
-                frame = padded_frame;
-                avctx->internal->last_audio_frame = 1;
-            }
-
-            if (frame->nb_samples != avctx->frame_size) {
-                ret = AVERROR(EINVAL);
-                goto end;
-            }
-        }
-    }
-
-    ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
-    if (!ret) {
-        if (*got_packet_ptr) {
-            if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
-                if (avpkt->pts == AV_NOPTS_VALUE)
-                    avpkt->pts = frame->pts;
-                if (!avpkt->duration)
-                    avpkt->duration = ff_samples_to_time_base(avctx,
-                                                              frame->nb_samples);
-            }
-            avpkt->dts = avpkt->pts;
-        } else {
-            avpkt->size = 0;
-        }
-
-        if (!user_packet && avpkt->size) {
-            ret = av_buffer_realloc(&avpkt->buf, avpkt->size);
-            if (ret >= 0)
-                avpkt->data = avpkt->buf->data;
-        }
-
-        avctx->frame_number++;
-    }
-
-    if (ret < 0 || !*got_packet_ptr) {
-        av_free_packet(avpkt);
-        av_init_packet(avpkt);
-        goto end;
-    }
-
-    /* NOTE: if we add any audio encoders which output non-keyframe packets,
-     *       this needs to be moved to the encoders, but for now we can do it
-     *       here to simplify things */
-    avpkt->flags |= AV_PKT_FLAG_KEY;
-
-end:
-    av_frame_free(&padded_frame);
-
-    return ret;
-}
-
-int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
-                                              AVPacket *avpkt,
-                                              const AVFrame *frame,
-                                              int *got_packet_ptr)
-{
-    int ret;
-    int user_packet = !!avpkt->data;
-
-    *got_packet_ptr = 0;
-
-    if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
-        av_free_packet(avpkt);
-        av_init_packet(avpkt);
-        avpkt->size = 0;
-        return 0;
-    }
-
-    if (av_image_check_size(avctx->width, avctx->height, 0, avctx))
-        return AVERROR(EINVAL);
-
-    av_assert0(avctx->codec->encode2);
-
-    ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
-    if (!ret) {
-        if (!*got_packet_ptr)
-            avpkt->size = 0;
-        else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
-            avpkt->pts = avpkt->dts = frame->pts;
-
-        if (!user_packet && avpkt->size) {
-            ret = av_buffer_realloc(&avpkt->buf, avpkt->size);
-            if (ret >= 0)
-                avpkt->data = avpkt->buf->data;
-        }
-
-        avctx->frame_number++;
-    }
-
-    if (ret < 0 || !*got_packet_ptr)
-        av_free_packet(avpkt);
-
-    emms_c();
-    return ret;
-}
-
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                            const AVSubtitle *sub)
-{
-    int ret;
-    if (sub->start_display_time) {
-        av_log(avctx, AV_LOG_ERROR, "start_display_time must be 0.\n");
-        return -1;
-    }
-    if (sub->num_rects == 0 || !sub->rects)
-        return -1;
-    ret = avctx->codec->encode_sub(avctx, buf, buf_size, sub);
-    avctx->frame_number++;
-    return ret;
-}
-
-static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
-{
-    int size = 0, ret;
-    const uint8_t *data;
-    uint32_t flags;
-
-    data = av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, &size);
-    if (!data)
-        return 0;
-
-    if (!(avctx->codec->capabilities & CODEC_CAP_PARAM_CHANGE)) {
-        av_log(avctx, AV_LOG_ERROR, "This decoder does not support parameter "
-               "changes, but PARAM_CHANGE side data was sent to it.\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (size < 4)
-        goto fail;
-
-    flags = bytestream_get_le32(&data);
-    size -= 4;
-
-    if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) {
-        if (size < 4)
-            goto fail;
-        avctx->channels = bytestream_get_le32(&data);
-        size -= 4;
-    }
-    if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) {
-        if (size < 8)
-            goto fail;
-        avctx->channel_layout = bytestream_get_le64(&data);
-        size -= 8;
-    }
-    if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) {
-        if (size < 4)
-            goto fail;
-        avctx->sample_rate = bytestream_get_le32(&data);
-        size -= 4;
-    }
-    if (flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) {
-        if (size < 8)
-            goto fail;
-        avctx->width  = bytestream_get_le32(&data);
-        avctx->height = bytestream_get_le32(&data);
-        size -= 8;
-        ret = ff_set_dimensions(avctx, avctx->width, avctx->height);
-        if (ret < 0)
-            return ret;
-    }
-
-    return 0;
-fail:
-    av_log(avctx, AV_LOG_ERROR, "PARAM_CHANGE side data too small.\n");
-    return AVERROR_INVALIDDATA;
-}
-
-static int unrefcount_frame(AVCodecInternal *avci, AVFrame *frame)
-{
-    int ret;
-
-    /* move the original frame to our backup */
-    av_frame_unref(avci->to_free);
-    av_frame_move_ref(avci->to_free, frame);
-
-    /* now copy everything except the AVBufferRefs back
-     * note that we make a COPY of the side data, so calling av_frame_free() on
-     * the caller's frame will work properly */
-    ret = av_frame_copy_props(frame, avci->to_free);
-    if (ret < 0)
-        return ret;
-
-    memcpy(frame->data,     avci->to_free->data,     sizeof(frame->data));
-    memcpy(frame->linesize, avci->to_free->linesize, sizeof(frame->linesize));
-    if (avci->to_free->extended_data != avci->to_free->data) {
-        int planes = av_get_channel_layout_nb_channels(avci->to_free->channel_layout);
-        int size   = planes * sizeof(*frame->extended_data);
-
-        if (!size) {
-            av_frame_unref(frame);
-            return AVERROR_BUG;
-        }
-
-        frame->extended_data = av_malloc(size);
-        if (!frame->extended_data) {
-            av_frame_unref(frame);
-            return AVERROR(ENOMEM);
-        }
-        memcpy(frame->extended_data, avci->to_free->extended_data,
-               size);
-    } else
-        frame->extended_data = frame->data;
-
-    frame->format         = avci->to_free->format;
-    frame->width          = avci->to_free->width;
-    frame->height         = avci->to_free->height;
-    frame->channel_layout = avci->to_free->channel_layout;
-    frame->nb_samples     = avci->to_free->nb_samples;
-
-    return 0;
-}
-
-int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
-                                              int *got_picture_ptr,
-                                              AVPacket *avpkt)
-{
-    AVCodecInternal *avci = avctx->internal;
-    int ret;
-
-    *got_picture_ptr = 0;
-    if ((avctx->coded_width || avctx->coded_height) && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx))
-        return -1;
-
-    avctx->internal->pkt = avpkt;
-    ret = apply_param_change(avctx, avpkt);
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error applying parameter changes.\n");
-        if (avctx->err_recognition & AV_EF_EXPLODE)
-            return ret;
-    }
-
-    av_frame_unref(picture);
-
-    if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
-        if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
-            ret = ff_thread_decode_frame(avctx, picture, got_picture_ptr,
-                                         avpkt);
-        else {
-            ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
-                                       avpkt);
-            picture->pkt_dts = avpkt->dts;
-            /* get_buffer is supposed to set frame parameters */
-            if (!(avctx->codec->capabilities & CODEC_CAP_DR1)) {
-                picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
-                picture->width               = avctx->width;
-                picture->height              = avctx->height;
-                picture->format              = avctx->pix_fmt;
-            }
-        }
-
-        emms_c(); //needed to avoid an emms_c() call before every return;
-
-        if (*got_picture_ptr) {
-            if (!avctx->refcounted_frames) {
-                int err = unrefcount_frame(avci, picture);
-                if (err < 0)
-                    return err;
-            }
-
-            avctx->frame_number++;
-        } else
-            av_frame_unref(picture);
-    } else
-        ret = 0;
-
-    return ret;
-}
-
-int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
-                                              AVFrame *frame,
-                                              int *got_frame_ptr,
-                                              AVPacket *avpkt)
-{
-    AVCodecInternal *avci = avctx->internal;
-    int ret = 0;
-
-    *got_frame_ptr = 0;
-
-    avctx->internal->pkt = avpkt;
-
-    if (!avpkt->data && avpkt->size) {
-        av_log(avctx, AV_LOG_ERROR, "invalid packet: NULL data, size != 0\n");
-        return AVERROR(EINVAL);
-    }
-
-    ret = apply_param_change(avctx, avpkt);
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error applying parameter changes.\n");
-        if (avctx->err_recognition & AV_EF_EXPLODE)
-            return ret;
-    }
-
-    av_frame_unref(frame);
-
-    if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size) {
-        ret = avctx->codec->decode(avctx, frame, got_frame_ptr, avpkt);
-        if (ret >= 0 && *got_frame_ptr) {
-            avctx->frame_number++;
-            frame->pkt_dts = avpkt->dts;
-            if (frame->format == AV_SAMPLE_FMT_NONE)
-                frame->format = avctx->sample_fmt;
-
-            if (!avctx->refcounted_frames) {
-                int err = unrefcount_frame(avci, frame);
-                if (err < 0)
-                    return err;
-            }
-        } else
-            av_frame_unref(frame);
-    }
-
-
-    return ret;
-}
-
-int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
-                             int *got_sub_ptr,
-                             AVPacket *avpkt)
-{
-    int ret;
-
-    avctx->internal->pkt = avpkt;
-    *got_sub_ptr = 0;
-    ret = avctx->codec->decode(avctx, sub, got_sub_ptr, avpkt);
-    if (*got_sub_ptr)
-        avctx->frame_number++;
-    return ret;
-}
-
-void avsubtitle_free(AVSubtitle *sub)
-{
-    int i;
-
-    for (i = 0; i < sub->num_rects; i++) {
-        av_freep(&sub->rects[i]->pict.data[0]);
-        av_freep(&sub->rects[i]->pict.data[1]);
-        av_freep(&sub->rects[i]->pict.data[2]);
-        av_freep(&sub->rects[i]->pict.data[3]);
-        av_freep(&sub->rects[i]->text);
-        av_freep(&sub->rects[i]->ass);
-        av_freep(&sub->rects[i]);
-    }
-
-    av_freep(&sub->rects);
-
-    memset(sub, 0, sizeof(AVSubtitle));
-}
-
-av_cold int avcodec_close(AVCodecContext *avctx)
-{
-    /* If there is a user-supplied mutex locking routine, call it. */
-    if (lockmgr_cb) {
-        if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
-            return -1;
-    }
-
-    entangled_thread_counter++;
-    if (entangled_thread_counter != 1) {
-        av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n");
-        entangled_thread_counter--;
-        return -1;
-    }
-
-    if (avcodec_is_open(avctx)) {
-        FramePool *pool = avctx->internal->pool;
-        int i;
-        if (HAVE_THREADS && avctx->internal->thread_ctx)
-            ff_thread_free(avctx);
-        if (avctx->codec && avctx->codec->close)
-            avctx->codec->close(avctx);
-        avctx->coded_frame = NULL;
-        av_frame_free(&avctx->internal->to_free);
-        for (i = 0; i < FF_ARRAY_ELEMS(pool->pools); i++)
-            av_buffer_pool_uninit(&pool->pools[i]);
-        av_freep(&avctx->internal->pool);
-        av_freep(&avctx->internal);
-    }
-
-    if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)
-        av_opt_free(avctx->priv_data);
-    av_opt_free(avctx);
-    av_freep(&avctx->priv_data);
-    if (av_codec_is_encoder(avctx->codec))
-        av_freep(&avctx->extradata);
-    avctx->codec = NULL;
-    avctx->active_thread_type = 0;
-    entangled_thread_counter--;
-
-    /* Release any user-supplied mutex. */
-    if (lockmgr_cb) {
-        (*lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE);
-    }
-    return 0;
-}
-
-static AVCodec *find_encdec(enum AVCodecID id, int encoder)
-{
-    AVCodec *p, *experimental = NULL;
-    p = first_avcodec;
-    while (p) {
-        if ((encoder ? av_codec_is_encoder(p) : av_codec_is_decoder(p)) &&
-            p->id == id) {
-            if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {
-                experimental = p;
-            } else
-                return p;
-        }
-        p = p->next;
-    }
-    return experimental;
-}
-
-AVCodec *avcodec_find_encoder(enum AVCodecID id)
-{
-    return find_encdec(id, 1);
-}
-
-AVCodec *avcodec_find_encoder_by_name(const char *name)
-{
-    AVCodec *p;
-    if (!name)
-        return NULL;
-    p = first_avcodec;
-    while (p) {
-        if (av_codec_is_encoder(p) && strcmp(name, p->name) == 0)
-            return p;
-        p = p->next;
-    }
-    return NULL;
-}
-
-AVCodec *avcodec_find_decoder(enum AVCodecID id)
-{
-    return find_encdec(id, 0);
-}
-
-AVCodec *avcodec_find_decoder_by_name(const char *name)
-{
-    AVCodec *p;
-    if (!name)
-        return NULL;
-    p = first_avcodec;
-    while (p) {
-        if (av_codec_is_decoder(p) && strcmp(name, p->name) == 0)
-            return p;
-        p = p->next;
-    }
-    return NULL;
-}
-
-static int get_bit_rate(AVCodecContext *ctx)
-{
-    int bit_rate;
-    int bits_per_sample;
-
-    switch (ctx->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-    case AVMEDIA_TYPE_DATA:
-    case AVMEDIA_TYPE_SUBTITLE:
-    case AVMEDIA_TYPE_ATTACHMENT:
-        bit_rate = ctx->bit_rate;
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        bits_per_sample = av_get_bits_per_sample(ctx->codec_id);
-        bit_rate = bits_per_sample ? ctx->sample_rate * ctx->channels * bits_per_sample : ctx->bit_rate;
-        break;
-    default:
-        bit_rate = 0;
-        break;
-    }
-    return bit_rate;
-}
-
-size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
-{
-    int i, len, ret = 0;
-
-#define TAG_PRINT(x)                                              \
-    (((x) >= '0' && (x) <= '9') ||                                \
-     ((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z') ||  \
-     ((x) == '.' || (x) == ' '))
-
-    for (i = 0; i < 4; i++) {
-        len = snprintf(buf, buf_size,
-                       TAG_PRINT(codec_tag & 0xFF) ? "%c" : "[%d]", codec_tag & 0xFF);
-        buf        += len;
-        buf_size    = buf_size > len ? buf_size - len : 0;
-        ret        += len;
-        codec_tag >>= 8;
-    }
-    return ret;
-}
-
-void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
-{
-    const char *codec_name;
-    const char *profile = NULL;
-    const AVCodec *p;
-    char buf1[32];
-    int bitrate;
-    AVRational display_aspect_ratio;
-
-    if (enc->codec)
-        p = enc->codec;
-    else if (encode)
-        p = avcodec_find_encoder(enc->codec_id);
-    else
-        p = avcodec_find_decoder(enc->codec_id);
-
-    if (p) {
-        codec_name = p->name;
-        profile = av_get_profile_name(p, enc->profile);
-    } else if (enc->codec_id == AV_CODEC_ID_MPEG2TS) {
-        /* fake mpeg2 transport stream codec (currently not
-         * registered) */
-        codec_name = "mpeg2ts";
-    } else if (enc->codec_name[0] != '\0') {
-        codec_name = enc->codec_name;
-    } else {
-        /* output avi tags */
-        char tag_buf[32];
-        av_get_codec_tag_string(tag_buf, sizeof(tag_buf), enc->codec_tag);
-        snprintf(buf1, sizeof(buf1), "%s / 0x%04X", tag_buf, enc->codec_tag);
-        codec_name = buf1;
-    }
-
-    switch (enc->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-        snprintf(buf, buf_size,
-                 "Video: %s%s",
-                 codec_name, enc->mb_decision ? " (hq)" : "");
-        if (profile)
-            snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                     " (%s)", profile);
-        if (enc->pix_fmt != AV_PIX_FMT_NONE) {
-            snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                     ", %s",
-                     av_get_pix_fmt_name(enc->pix_fmt));
-        }
-        if (enc->width) {
-            snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                     ", %dx%d",
-                     enc->width, enc->height);
-            if (enc->sample_aspect_ratio.num) {
-                av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
-                          enc->width * enc->sample_aspect_ratio.num,
-                          enc->height * enc->sample_aspect_ratio.den,
-                          1024 * 1024);
-                snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                         " [PAR %d:%d DAR %d:%d]",
-                         enc->sample_aspect_ratio.num, enc->sample_aspect_ratio.den,
-                         display_aspect_ratio.num, display_aspect_ratio.den);
-            }
-            if (av_log_get_level() >= AV_LOG_DEBUG) {
-                int g = av_gcd(enc->time_base.num, enc->time_base.den);
-                snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                         ", %d/%d",
-                         enc->time_base.num / g, enc->time_base.den / g);
-            }
-        }
-        if (encode) {
-            snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                     ", q=%d-%d", enc->qmin, enc->qmax);
-        }
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        snprintf(buf, buf_size,
-                 "Audio: %s",
-                 codec_name);
-        if (profile)
-            snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                     " (%s)", profile);
-        if (enc->sample_rate) {
-            snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                     ", %d Hz", enc->sample_rate);
-        }
-        av_strlcat(buf, ", ", buf_size);
-        av_get_channel_layout_string(buf + strlen(buf), buf_size - strlen(buf), enc->channels, enc->channel_layout);
-        if (enc->sample_fmt != AV_SAMPLE_FMT_NONE) {
-            snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                     ", %s", av_get_sample_fmt_name(enc->sample_fmt));
-        }
-        break;
-    case AVMEDIA_TYPE_DATA:
-        snprintf(buf, buf_size, "Data: %s", codec_name);
-        break;
-    case AVMEDIA_TYPE_SUBTITLE:
-        snprintf(buf, buf_size, "Subtitle: %s", codec_name);
-        break;
-    case AVMEDIA_TYPE_ATTACHMENT:
-        snprintf(buf, buf_size, "Attachment: %s", codec_name);
-        break;
-    default:
-        snprintf(buf, buf_size, "Invalid Codec type %d", enc->codec_type);
-        return;
-    }
-    if (encode) {
-        if (enc->flags & CODEC_FLAG_PASS1)
-            snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                     ", pass 1");
-        if (enc->flags & CODEC_FLAG_PASS2)
-            snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                     ", pass 2");
-    }
-    bitrate = get_bit_rate(enc);
-    if (bitrate != 0) {
-        snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                 ", %d kb/s", bitrate / 1000);
-    }
-}
-
-const char *av_get_profile_name(const AVCodec *codec, int profile)
-{
-    const AVProfile *p;
-    if (profile == FF_PROFILE_UNKNOWN || !codec->profiles)
-        return NULL;
-
-    for (p = codec->profiles; p->profile != FF_PROFILE_UNKNOWN; p++)
-        if (p->profile == profile)
-            return p->name;
-
-    return NULL;
-}
-
-unsigned avcodec_version(void)
-{
-    return LIBAVCODEC_VERSION_INT;
-}
-
-const char *avcodec_configuration(void)
-{
-    return LIBAV_CONFIGURATION;
-}
-
-const char *avcodec_license(void)
-{
-#define LICENSE_PREFIX "libavcodec license: "
-    return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
-}
-
-void avcodec_flush_buffers(AVCodecContext *avctx)
-{
-    if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
-        ff_thread_flush(avctx);
-    else if (avctx->codec->flush)
-        avctx->codec->flush(avctx);
-
-    if (!avctx->refcounted_frames)
-        av_frame_unref(avctx->internal->to_free);
-}
-
-int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
-{
-    switch (codec_id) {
-    case AV_CODEC_ID_ADPCM_CT:
-    case AV_CODEC_ID_ADPCM_IMA_APC:
-    case AV_CODEC_ID_ADPCM_IMA_EA_SEAD:
-    case AV_CODEC_ID_ADPCM_IMA_WS:
-    case AV_CODEC_ID_ADPCM_G722:
-    case AV_CODEC_ID_ADPCM_YAMAHA:
-        return 4;
-    case AV_CODEC_ID_PCM_ALAW:
-    case AV_CODEC_ID_PCM_MULAW:
-    case AV_CODEC_ID_PCM_S8:
-    case AV_CODEC_ID_PCM_U8:
-    case AV_CODEC_ID_PCM_ZORK:
-        return 8;
-    case AV_CODEC_ID_PCM_S16BE:
-    case AV_CODEC_ID_PCM_S16LE:
-    case AV_CODEC_ID_PCM_S16LE_PLANAR:
-    case AV_CODEC_ID_PCM_U16BE:
-    case AV_CODEC_ID_PCM_U16LE:
-        return 16;
-    case AV_CODEC_ID_PCM_S24DAUD:
-    case AV_CODEC_ID_PCM_S24BE:
-    case AV_CODEC_ID_PCM_S24LE:
-    case AV_CODEC_ID_PCM_S24LE_PLANAR:
-    case AV_CODEC_ID_PCM_U24BE:
-    case AV_CODEC_ID_PCM_U24LE:
-        return 24;
-    case AV_CODEC_ID_PCM_S32BE:
-    case AV_CODEC_ID_PCM_S32LE:
-    case AV_CODEC_ID_PCM_S32LE_PLANAR:
-    case AV_CODEC_ID_PCM_U32BE:
-    case AV_CODEC_ID_PCM_U32LE:
-    case AV_CODEC_ID_PCM_F32BE:
-    case AV_CODEC_ID_PCM_F32LE:
-        return 32;
-    case AV_CODEC_ID_PCM_F64BE:
-    case AV_CODEC_ID_PCM_F64LE:
-        return 64;
-    default:
-        return 0;
-    }
-}
-
-int av_get_bits_per_sample(enum AVCodecID codec_id)
-{
-    switch (codec_id) {
-    case AV_CODEC_ID_ADPCM_SBPRO_2:
-        return 2;
-    case AV_CODEC_ID_ADPCM_SBPRO_3:
-        return 3;
-    case AV_CODEC_ID_ADPCM_SBPRO_4:
-    case AV_CODEC_ID_ADPCM_IMA_WAV:
-    case AV_CODEC_ID_ADPCM_IMA_QT:
-    case AV_CODEC_ID_ADPCM_SWF:
-    case AV_CODEC_ID_ADPCM_MS:
-        return 4;
-    default:
-        return av_get_exact_bits_per_sample(codec_id);
-    }
-}
-
-int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
-{
-    int id, sr, ch, ba, tag, bps;
-
-    id  = avctx->codec_id;
-    sr  = avctx->sample_rate;
-    ch  = avctx->channels;
-    ba  = avctx->block_align;
-    tag = avctx->codec_tag;
-    bps = av_get_exact_bits_per_sample(avctx->codec_id);
-
-    /* codecs with an exact constant bits per sample */
-    if (bps > 0 && ch > 0 && frame_bytes > 0)
-        return (frame_bytes * 8) / (bps * ch);
-    bps = avctx->bits_per_coded_sample;
-
-    /* codecs with a fixed packet duration */
-    switch (id) {
-    case AV_CODEC_ID_ADPCM_ADX:    return   32;
-    case AV_CODEC_ID_ADPCM_IMA_QT: return   64;
-    case AV_CODEC_ID_ADPCM_EA_XAS: return  128;
-    case AV_CODEC_ID_AMR_NB:
-    case AV_CODEC_ID_GSM:
-    case AV_CODEC_ID_QCELP:
-    case AV_CODEC_ID_RA_144:
-    case AV_CODEC_ID_RA_288:       return  160;
-    case AV_CODEC_ID_IMC:          return  256;
-    case AV_CODEC_ID_AMR_WB:
-    case AV_CODEC_ID_GSM_MS:       return  320;
-    case AV_CODEC_ID_MP1:          return  384;
-    case AV_CODEC_ID_ATRAC1:       return  512;
-    case AV_CODEC_ID_ATRAC3:       return 1024;
-    case AV_CODEC_ID_MP2:
-    case AV_CODEC_ID_MUSEPACK7:    return 1152;
-    case AV_CODEC_ID_AC3:          return 1536;
-    }
-
-    if (sr > 0) {
-        /* calc from sample rate */
-        if (id == AV_CODEC_ID_TTA)
-            return 256 * sr / 245;
-
-        if (ch > 0) {
-            /* calc from sample rate and channels */
-            if (id == AV_CODEC_ID_BINKAUDIO_DCT)
-                return (480 << (sr / 22050)) / ch;
-        }
-    }
-
-    if (ba > 0) {
-        /* calc from block_align */
-        if (id == AV_CODEC_ID_SIPR) {
-            switch (ba) {
-            case 20: return 160;
-            case 19: return 144;
-            case 29: return 288;
-            case 37: return 480;
-            }
-        } else if (id == AV_CODEC_ID_ILBC) {
-            switch (ba) {
-            case 38: return 160;
-            case 50: return 240;
-            }
-        }
-    }
-
-    if (frame_bytes > 0) {
-        /* calc from frame_bytes only */
-        if (id == AV_CODEC_ID_TRUESPEECH)
-            return 240 * (frame_bytes / 32);
-        if (id == AV_CODEC_ID_NELLYMOSER)
-            return 256 * (frame_bytes / 64);
-
-        if (bps > 0) {
-            /* calc from frame_bytes and bits_per_coded_sample */
-            if (id == AV_CODEC_ID_ADPCM_G726)
-                return frame_bytes * 8 / bps;
-        }
-
-        if (ch > 0) {
-            /* calc from frame_bytes and channels */
-            switch (id) {
-            case AV_CODEC_ID_ADPCM_4XM:
-            case AV_CODEC_ID_ADPCM_IMA_ISS:
-                return (frame_bytes - 4 * ch) * 2 / ch;
-            case AV_CODEC_ID_ADPCM_IMA_SMJPEG:
-                return (frame_bytes - 4) * 2 / ch;
-            case AV_CODEC_ID_ADPCM_IMA_AMV:
-                return (frame_bytes - 8) * 2 / ch;
-            case AV_CODEC_ID_ADPCM_XA:
-                return (frame_bytes / 128) * 224 / ch;
-            case AV_CODEC_ID_INTERPLAY_DPCM:
-                return (frame_bytes - 6 - ch) / ch;
-            case AV_CODEC_ID_ROQ_DPCM:
-                return (frame_bytes - 8) / ch;
-            case AV_CODEC_ID_XAN_DPCM:
-                return (frame_bytes - 2 * ch) / ch;
-            case AV_CODEC_ID_MACE3:
-                return 3 * frame_bytes / ch;
-            case AV_CODEC_ID_MACE6:
-                return 6 * frame_bytes / ch;
-            case AV_CODEC_ID_PCM_LXF:
-                return 2 * (frame_bytes / (5 * ch));
-            }
-
-            if (tag) {
-                /* calc from frame_bytes, channels, and codec_tag */
-                if (id == AV_CODEC_ID_SOL_DPCM) {
-                    if (tag == 3)
-                        return frame_bytes / ch;
-                    else
-                        return frame_bytes * 2 / ch;
-                }
-            }
-
-            if (ba > 0) {
-                /* calc from frame_bytes, channels, and block_align */
-                int blocks = frame_bytes / ba;
-                switch (avctx->codec_id) {
-                case AV_CODEC_ID_ADPCM_IMA_WAV:
-                    return blocks * (1 + (ba - 4 * ch) / (4 * ch) * 8);
-                case AV_CODEC_ID_ADPCM_IMA_DK3:
-                    return blocks * (((ba - 16) * 2 / 3 * 4) / ch);
-                case AV_CODEC_ID_ADPCM_IMA_DK4:
-                    return blocks * (1 + (ba - 4 * ch) * 2 / ch);
-                case AV_CODEC_ID_ADPCM_MS:
-                    return blocks * (2 + (ba - 7 * ch) * 2 / ch);
-                }
-            }
-
-            if (bps > 0) {
-                /* calc from frame_bytes, channels, and bits_per_coded_sample */
-                switch (avctx->codec_id) {
-                case AV_CODEC_ID_PCM_DVD:
-                    return 2 * (frame_bytes / ((bps * 2 / 8) * ch));
-                case AV_CODEC_ID_PCM_BLURAY:
-                    return frame_bytes / ((FFALIGN(ch, 2) * bps) / 8);
-                case AV_CODEC_ID_S302M:
-                    return 2 * (frame_bytes / ((bps + 4) / 4)) / ch;
-                }
-            }
-        }
-    }
-
-    return 0;
-}
-
-#if !HAVE_THREADS
-int ff_thread_init(AVCodecContext *s)
-{
-    return -1;
-}
-
-#endif
-
-unsigned int av_xiphlacing(unsigned char *s, unsigned int v)
-{
-    unsigned int n = 0;
-
-    while (v >= 0xff) {
-        *s++ = 0xff;
-        v -= 0xff;
-        n++;
-    }
-    *s = v;
-    n++;
-    return n;
-}
-
-int ff_match_2uint16(const uint16_t(*tab)[2], int size, int a, int b)
-{
-    int i;
-    for (i = 0; i < size && !(tab[i][0] == a && tab[i][1] == b); i++) ;
-    return i;
-}
-
-#if FF_API_MISSING_SAMPLE
-FF_DISABLE_DEPRECATION_WARNINGS
-void av_log_missing_feature(void *avc, const char *feature, int want_sample)
-{
-    av_log(avc, AV_LOG_WARNING, "%s is not implemented. Update your Libav "
-            "version to the newest one from Git. If the problem still "
-            "occurs, it means that your file has a feature which has not "
-            "been implemented.\n", feature);
-    if(want_sample)
-        av_log_ask_for_sample(avc, NULL);
-}
-
-void av_log_ask_for_sample(void *avc, const char *msg, ...)
-{
-    va_list argument_list;
-
-    va_start(argument_list, msg);
-
-    if (msg)
-        av_vlog(avc, AV_LOG_WARNING, msg, argument_list);
-    av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample "
-            "of this file to ftp://upload.libav.org/incoming/ "
-            "and contact the libav-devel mailing list.\n");
-
-    va_end(argument_list);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_MISSING_SAMPLE */
-
-static AVHWAccel *first_hwaccel = NULL;
-
-void av_register_hwaccel(AVHWAccel *hwaccel)
-{
-    AVHWAccel **p = &first_hwaccel;
-    while (*p)
-        p = &(*p)->next;
-    *p = hwaccel;
-    hwaccel->next = NULL;
-}
-
-AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel)
-{
-    return hwaccel ? hwaccel->next : first_hwaccel;
-}
-
-AVHWAccel *ff_find_hwaccel(AVCodecContext *avctx)
-{
-    enum AVCodecID codec_id = avctx->codec->id;
-    enum AVPixelFormat pix_fmt = avctx->pix_fmt;
-
-    AVHWAccel *hwaccel = NULL;
-
-    while ((hwaccel = av_hwaccel_next(hwaccel)))
-        if (hwaccel->id == codec_id
-            && hwaccel->pix_fmt == pix_fmt)
-            return hwaccel;
-    return NULL;
-}
-
-int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op))
-{
-    if (lockmgr_cb) {
-        if (lockmgr_cb(&codec_mutex, AV_LOCK_DESTROY))
-            return -1;
-        if (lockmgr_cb(&avformat_mutex, AV_LOCK_DESTROY))
-            return -1;
-    }
-
-    lockmgr_cb = cb;
-
-    if (lockmgr_cb) {
-        if (lockmgr_cb(&codec_mutex, AV_LOCK_CREATE))
-            return -1;
-        if (lockmgr_cb(&avformat_mutex, AV_LOCK_CREATE))
-            return -1;
-    }
-    return 0;
-}
-
-int avpriv_lock_avformat(void)
-{
-    if (lockmgr_cb) {
-        if ((*lockmgr_cb)(&avformat_mutex, AV_LOCK_OBTAIN))
-            return -1;
-    }
-    return 0;
-}
-
-int avpriv_unlock_avformat(void)
-{
-    if (lockmgr_cb) {
-        if ((*lockmgr_cb)(&avformat_mutex, AV_LOCK_RELEASE))
-            return -1;
-    }
-    return 0;
-}
-
-unsigned int avpriv_toupper4(unsigned int x)
-{
-    return av_toupper(x & 0xFF) +
-          (av_toupper((x >>  8) & 0xFF) << 8)  +
-          (av_toupper((x >> 16) & 0xFF) << 16) +
-          (av_toupper((x >> 24) & 0xFF) << 24);
-}
-
-int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src)
-{
-    int ret;
-
-    dst->owner = src->owner;
-
-    ret = av_frame_ref(dst->f, src->f);
-    if (ret < 0)
-        return ret;
-
-    if (src->progress &&
-        !(dst->progress = av_buffer_ref(src->progress))) {
-        ff_thread_release_buffer(dst->owner, dst);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-#if !HAVE_THREADS
-
-int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
-{
-    f->owner = avctx;
-    return ff_get_buffer(avctx, f->f, flags);
-}
-
-void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
-{
-    av_frame_unref(f->f);
-}
-
-void ff_thread_finish_setup(AVCodecContext *avctx)
-{
-}
-
-void ff_thread_report_progress(ThreadFrame *f, int progress, int field)
-{
-}
-
-void ff_thread_await_progress(ThreadFrame *f, int progress, int field)
-{
-}
-
-#endif
-
-enum AVMediaType avcodec_get_type(enum AVCodecID codec_id)
-{
-    if (codec_id <= AV_CODEC_ID_NONE)
-        return AVMEDIA_TYPE_UNKNOWN;
-    else if (codec_id < AV_CODEC_ID_FIRST_AUDIO)
-        return AVMEDIA_TYPE_VIDEO;
-    else if (codec_id < AV_CODEC_ID_FIRST_SUBTITLE)
-        return AVMEDIA_TYPE_AUDIO;
-    else if (codec_id < AV_CODEC_ID_FIRST_UNKNOWN)
-        return AVMEDIA_TYPE_SUBTITLE;
-
-    return AVMEDIA_TYPE_UNKNOWN;
-}
-
-int avcodec_is_open(AVCodecContext *s)
-{
-    return !!s->internal;
-}
-
-const uint8_t *avpriv_find_start_code(const uint8_t *restrict p,
-                                      const uint8_t *end,
-                                      uint32_t * restrict state)
-{
-    int i;
-
-    assert(p <= end);
-    if (p >= end)
-        return end;
-
-    for (i = 0; i < 3; i++) {
-        uint32_t tmp = *state << 8;
-        *state = tmp + *(p++);
-        if (tmp == 0x100 || p == end)
-            return p;
-    }
-
-    while (p < end) {
-        if      (p[-1] > 1      ) p += 3;
-        else if (p[-2]          ) p += 2;
-        else if (p[-3]|(p[-1]-1)) p++;
-        else {
-            p++;
-            break;
-        }
-    }
-
-    p = FFMIN(p, end) - 4;
-    *state = AV_RB32(p);
-
-    return p + 4;
-}
diff --git a/deps/libav/libavcodec/utvideo.c b/deps/libav/libavcodec/utvideo.c
deleted file mode 100644
index eb5a924..0000000
--- a/deps/libav/libavcodec/utvideo.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Common Ut Video code
- * Copyright (c) 2011 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Common Ut Video code
- */
-
-#include "utvideo.h"
-
-const int ff_ut_pred_order[5] = {
-    PRED_LEFT, PRED_MEDIAN, PRED_MEDIAN, PRED_NONE, PRED_GRADIENT
-};
-
-const int ff_ut_rgb_order[4]  = { 1, 2, 0, 3 }; // G, B, R, A
-
-int ff_ut_huff_cmp_len(const void *a, const void *b)
-{
-    const HuffEntry *aa = a, *bb = b;
-    return (aa->len - bb->len)*256 + aa->sym - bb->sym;
-}
diff --git a/deps/libav/libavcodec/utvideo.h b/deps/libav/libavcodec/utvideo.h
deleted file mode 100644
index 0a1317e..0000000
--- a/deps/libav/libavcodec/utvideo.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Common Ut Video header
- * Copyright (c) 2011 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_UTVIDEO_H
-#define AVCODEC_UTVIDEO_H
-
-/**
- * @file
- * Common Ut Video header
- */
-
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-enum {
-    PRED_NONE = 0,
-    PRED_LEFT,
-    PRED_GRADIENT,
-    PRED_MEDIAN,
-};
-
-enum {
-    COMP_NONE = 0,
-    COMP_HUFF,
-};
-
-/*
- * "Original format" markers.
- * Based on values gotten from the official VFW encoder.
- * They are not used during decoding, but they do have
- * an informative role on seeing what was input
- * to the encoder.
- */
-enum {
-    UTVIDEO_RGB  = MKTAG(0x00, 0x00, 0x01, 0x18),
-    UTVIDEO_RGBA = MKTAG(0x00, 0x00, 0x02, 0x18),
-    UTVIDEO_420  = MKTAG('Y', 'V', '1', '2'),
-    UTVIDEO_422  = MKTAG('Y', 'U', 'Y', '2'),
-};
-
-/* Mapping of libavcodec prediction modes to Ut Video's */
-extern const int ff_ut_pred_order[5];
-
-/* Order of RGB(A) planes in Ut Video */
-extern const int ff_ut_rgb_order[4];
-
-typedef struct UtvideoContext {
-    AVCodecContext *avctx;
-    DSPContext     dsp;
-
-    uint32_t frame_info_size, flags, frame_info;
-    int      planes;
-    int      slices;
-    int      compression;
-    int      interlaced;
-    int      frame_pred;
-
-    int      slice_stride;
-    uint8_t *slice_bits, *slice_buffer[4];
-    int      slice_bits_size;
-} UtvideoContext;
-
-typedef struct HuffEntry {
-    uint8_t  sym;
-    uint8_t  len;
-    uint32_t code;
-} HuffEntry;
-
-/* Compare huffman tree nodes */
-int ff_ut_huff_cmp_len(const void *a, const void *b);
-
-#endif /* AVCODEC_UTVIDEO_H */
diff --git a/deps/libav/libavcodec/utvideodec.c b/deps/libav/libavcodec/utvideodec.c
deleted file mode 100644
index 3492595..0000000
--- a/deps/libav/libavcodec/utvideodec.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * Ut Video decoder
- * Copyright (c) 2011 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Ut Video decoder
- */
-
-#include <stdlib.h>
-
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "get_bits.h"
-#include "dsputil.h"
-#include "thread.h"
-#include "utvideo.h"
-
-static int build_huff(const uint8_t *src, VLC *vlc, int *fsym)
-{
-    int i;
-    HuffEntry he[256];
-    int last;
-    uint32_t codes[256];
-    uint8_t bits[256];
-    uint8_t syms[256];
-    uint32_t code;
-
-    *fsym = -1;
-    for (i = 0; i < 256; i++) {
-        he[i].sym = i;
-        he[i].len = *src++;
-    }
-    qsort(he, 256, sizeof(*he), ff_ut_huff_cmp_len);
-
-    if (!he[0].len) {
-        *fsym = he[0].sym;
-        return 0;
-    }
-    if (he[0].len > 32)
-        return -1;
-
-    last = 255;
-    while (he[last].len == 255 && last)
-        last--;
-
-    code = 1;
-    for (i = last; i >= 0; i--) {
-        codes[i] = code >> (32 - he[i].len);
-        bits[i]  = he[i].len;
-        syms[i]  = he[i].sym;
-        code += 0x80000000u >> (he[i].len - 1);
-    }
-
-    return ff_init_vlc_sparse(vlc, FFMIN(he[last].len, 9), last + 1,
-                              bits,  sizeof(*bits),  sizeof(*bits),
-                              codes, sizeof(*codes), sizeof(*codes),
-                              syms,  sizeof(*syms),  sizeof(*syms), 0);
-}
-
-static int decode_plane(UtvideoContext *c, int plane_no,
-                        uint8_t *dst, int step, int stride,
-                        int width, int height,
-                        const uint8_t *src, int use_pred)
-{
-    int i, j, slice, pix;
-    int sstart, send;
-    VLC vlc;
-    GetBitContext gb;
-    int prev, fsym;
-    const int cmask = ~(!plane_no && c->avctx->pix_fmt == AV_PIX_FMT_YUV420P);
-
-    if (build_huff(src, &vlc, &fsym)) {
-        av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (fsym >= 0) { // build_huff reported a symbol to fill slices with
-        send = 0;
-        for (slice = 0; slice < c->slices; slice++) {
-            uint8_t *dest;
-
-            sstart = send;
-            send   = (height * (slice + 1) / c->slices) & cmask;
-            dest   = dst + sstart * stride;
-
-            prev = 0x80;
-            for (j = sstart; j < send; j++) {
-                for (i = 0; i < width * step; i += step) {
-                    pix = fsym;
-                    if (use_pred) {
-                        prev += pix;
-                        pix   = prev;
-                    }
-                    dest[i] = pix;
-                }
-                dest += stride;
-            }
-        }
-        return 0;
-    }
-
-    src      += 256;
-
-    send = 0;
-    for (slice = 0; slice < c->slices; slice++) {
-        uint8_t *dest;
-        int slice_data_start, slice_data_end, slice_size;
-
-        sstart = send;
-        send   = (height * (slice + 1) / c->slices) & cmask;
-        dest   = dst + sstart * stride;
-
-        // slice offset and size validation was done earlier
-        slice_data_start = slice ? AV_RL32(src + slice * 4 - 4) : 0;
-        slice_data_end   = AV_RL32(src + slice * 4);
-        slice_size       = slice_data_end - slice_data_start;
-
-        if (!slice_size) {
-            av_log(c->avctx, AV_LOG_ERROR, "Plane has more than one symbol "
-                   "yet a slice has a length of zero.\n");
-            goto fail;
-        }
-
-        memcpy(c->slice_bits, src + slice_data_start + c->slices * 4,
-               slice_size);
-        memset(c->slice_bits + slice_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-        c->dsp.bswap_buf((uint32_t *) c->slice_bits, (uint32_t *) c->slice_bits,
-                         (slice_data_end - slice_data_start + 3) >> 2);
-        init_get_bits(&gb, c->slice_bits, slice_size * 8);
-
-        prev = 0x80;
-        for (j = sstart; j < send; j++) {
-            for (i = 0; i < width * step; i += step) {
-                if (get_bits_left(&gb) <= 0) {
-                    av_log(c->avctx, AV_LOG_ERROR,
-                           "Slice decoding ran out of bits\n");
-                    goto fail;
-                }
-                pix = get_vlc2(&gb, vlc.table, vlc.bits, 4);
-                if (pix < 0) {
-                    av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n");
-                    goto fail;
-                }
-                if (use_pred) {
-                    prev += pix;
-                    pix   = prev;
-                }
-                dest[i] = pix;
-            }
-            dest += stride;
-        }
-        if (get_bits_left(&gb) > 32)
-            av_log(c->avctx, AV_LOG_WARNING,
-                   "%d bits left after decoding slice\n", get_bits_left(&gb));
-    }
-
-    ff_free_vlc(&vlc);
-
-    return 0;
-fail:
-    ff_free_vlc(&vlc);
-    return AVERROR_INVALIDDATA;
-}
-
-static void restore_rgb_planes(uint8_t *src, int step, int stride, int width,
-                               int height)
-{
-    int i, j;
-    uint8_t r, g, b;
-
-    for (j = 0; j < height; j++) {
-        for (i = 0; i < width * step; i += step) {
-            r = src[i];
-            g = src[i + 1];
-            b = src[i + 2];
-            src[i]     = r + g - 0x80;
-            src[i + 2] = b + g - 0x80;
-        }
-        src += stride;
-    }
-}
-
-static void restore_median(uint8_t *src, int step, int stride,
-                           int width, int height, int slices, int rmode)
-{
-    int i, j, slice;
-    int A, B, C;
-    uint8_t *bsrc;
-    int slice_start, slice_height;
-    const int cmask = ~rmode;
-
-    for (slice = 0; slice < slices; slice++) {
-        slice_start  = ((slice * height) / slices) & cmask;
-        slice_height = ((((slice + 1) * height) / slices) & cmask) -
-                       slice_start;
-
-        bsrc = src + slice_start * stride;
-
-        // first line - left neighbour prediction
-        bsrc[0] += 0x80;
-        A = bsrc[0];
-        for (i = step; i < width * step; i += step) {
-            bsrc[i] += A;
-            A        = bsrc[i];
-        }
-        bsrc += stride;
-        if (slice_height == 1)
-            continue;
-        // second line - first element has top prediction, the rest uses median
-        C        = bsrc[-stride];
-        bsrc[0] += C;
-        A        = bsrc[0];
-        for (i = step; i < width * step; i += step) {
-            B        = bsrc[i - stride];
-            bsrc[i] += mid_pred(A, B, (uint8_t)(A + B - C));
-            C        = B;
-            A        = bsrc[i];
-        }
-        bsrc += stride;
-        // the rest of lines use continuous median prediction
-        for (j = 2; j < slice_height; j++) {
-            for (i = 0; i < width * step; i += step) {
-                B        = bsrc[i - stride];
-                bsrc[i] += mid_pred(A, B, (uint8_t)(A + B - C));
-                C        = B;
-                A        = bsrc[i];
-            }
-            bsrc += stride;
-        }
-    }
-}
-
-/* UtVideo interlaced mode treats every two lines as a single one,
- * so restoring function should take care of possible padding between
- * two parts of the same "line".
- */
-static void restore_median_il(uint8_t *src, int step, int stride,
-                              int width, int height, int slices, int rmode)
-{
-    int i, j, slice;
-    int A, B, C;
-    uint8_t *bsrc;
-    int slice_start, slice_height;
-    const int cmask   = ~(rmode ? 3 : 1);
-    const int stride2 = stride << 1;
-
-    for (slice = 0; slice < slices; slice++) {
-        slice_start    = ((slice * height) / slices) & cmask;
-        slice_height   = ((((slice + 1) * height) / slices) & cmask) -
-                         slice_start;
-        slice_height >>= 1;
-
-        bsrc = src + slice_start * stride;
-
-        // first line - left neighbour prediction
-        bsrc[0] += 0x80;
-        A        = bsrc[0];
-        for (i = step; i < width * step; i += step) {
-            bsrc[i] += A;
-            A        = bsrc[i];
-        }
-        for (i = 0; i < width * step; i += step) {
-            bsrc[stride + i] += A;
-            A                 = bsrc[stride + i];
-        }
-        bsrc += stride2;
-        if (slice_height == 1)
-            continue;
-        // second line - first element has top prediction, the rest uses median
-        C        = bsrc[-stride2];
-        bsrc[0] += C;
-        A        = bsrc[0];
-        for (i = step; i < width * step; i += step) {
-            B        = bsrc[i - stride2];
-            bsrc[i] += mid_pred(A, B, (uint8_t)(A + B - C));
-            C        = B;
-            A        = bsrc[i];
-        }
-        for (i = 0; i < width * step; i += step) {
-            B                 = bsrc[i - stride];
-            bsrc[stride + i] += mid_pred(A, B, (uint8_t)(A + B - C));
-            C                 = B;
-            A                 = bsrc[stride + i];
-        }
-        bsrc += stride2;
-        // the rest of lines use continuous median prediction
-        for (j = 2; j < slice_height; j++) {
-            for (i = 0; i < width * step; i += step) {
-                B        = bsrc[i - stride2];
-                bsrc[i] += mid_pred(A, B, (uint8_t)(A + B - C));
-                C        = B;
-                A        = bsrc[i];
-            }
-            for (i = 0; i < width * step; i += step) {
-                B                 = bsrc[i - stride];
-                bsrc[i + stride] += mid_pred(A, B, (uint8_t)(A + B - C));
-                C                 = B;
-                A                 = bsrc[i + stride];
-            }
-            bsrc += stride2;
-        }
-    }
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    UtvideoContext *c = avctx->priv_data;
-    int i, j;
-    const uint8_t *plane_start[5];
-    int plane_size, max_slice_size = 0, slice_start, slice_end, slice_size;
-    int ret;
-    GetByteContext gb;
-    ThreadFrame frame = { .f = data };
-
-    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    ff_thread_finish_setup(avctx);
-
-    /* parse plane structure to get frame flags and validate slice offsets */
-    bytestream2_init(&gb, buf, buf_size);
-    for (i = 0; i < c->planes; i++) {
-        plane_start[i] = gb.buffer;
-        if (bytestream2_get_bytes_left(&gb) < 256 + 4 * c->slices) {
-            av_log(avctx, AV_LOG_ERROR, "Insufficient data for a plane\n");
-            return AVERROR_INVALIDDATA;
-        }
-        bytestream2_skipu(&gb, 256);
-        slice_start = 0;
-        slice_end   = 0;
-        for (j = 0; j < c->slices; j++) {
-            slice_end   = bytestream2_get_le32u(&gb);
-            slice_size  = slice_end - slice_start;
-            if (slice_end < 0 || slice_size < 0 ||
-                bytestream2_get_bytes_left(&gb) < slice_end) {
-                av_log(avctx, AV_LOG_ERROR, "Incorrect slice size\n");
-                return AVERROR_INVALIDDATA;
-            }
-            slice_start = slice_end;
-            max_slice_size = FFMAX(max_slice_size, slice_size);
-        }
-        plane_size = slice_end;
-        bytestream2_skipu(&gb, plane_size);
-    }
-    plane_start[c->planes] = gb.buffer;
-    if (bytestream2_get_bytes_left(&gb) < c->frame_info_size) {
-        av_log(avctx, AV_LOG_ERROR, "Not enough data for frame information\n");
-        return AVERROR_INVALIDDATA;
-    }
-    c->frame_info = bytestream2_get_le32u(&gb);
-    av_log(avctx, AV_LOG_DEBUG, "frame information flags %X\n", c->frame_info);
-
-    c->frame_pred = (c->frame_info >> 8) & 3;
-
-    if (c->frame_pred == PRED_GRADIENT) {
-        avpriv_request_sample(avctx, "Frame with gradient prediction");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    av_fast_malloc(&c->slice_bits, &c->slice_bits_size,
-                   max_slice_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
-    if (!c->slice_bits) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
-        return AVERROR(ENOMEM);
-    }
-
-    switch (c->avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB24:
-    case AV_PIX_FMT_RGBA:
-        for (i = 0; i < c->planes; i++) {
-            ret = decode_plane(c, i, frame.f->data[0] + ff_ut_rgb_order[i],
-                               c->planes, frame.f->linesize[0], avctx->width,
-                               avctx->height, plane_start[i],
-                               c->frame_pred == PRED_LEFT);
-            if (ret)
-                return ret;
-            if (c->frame_pred == PRED_MEDIAN) {
-                if (!c->interlaced) {
-                    restore_median(frame.f->data[0] + ff_ut_rgb_order[i],
-                                   c->planes, frame.f->linesize[0], avctx->width,
-                                   avctx->height, c->slices, 0);
-                } else {
-                    restore_median_il(frame.f->data[0] + ff_ut_rgb_order[i],
-                                      c->planes, frame.f->linesize[0],
-                                      avctx->width, avctx->height, c->slices,
-                                      0);
-                }
-            }
-        }
-        restore_rgb_planes(frame.f->data[0], c->planes, frame.f->linesize[0],
-                           avctx->width, avctx->height);
-        break;
-    case AV_PIX_FMT_YUV420P:
-        for (i = 0; i < 3; i++) {
-            ret = decode_plane(c, i, frame.f->data[i], 1, frame.f->linesize[i],
-                               avctx->width >> !!i, avctx->height >> !!i,
-                               plane_start[i], c->frame_pred == PRED_LEFT);
-            if (ret)
-                return ret;
-            if (c->frame_pred == PRED_MEDIAN) {
-                if (!c->interlaced) {
-                    restore_median(frame.f->data[i], 1, frame.f->linesize[i],
-                                   avctx->width >> !!i, avctx->height >> !!i,
-                                   c->slices, !i);
-                } else {
-                    restore_median_il(frame.f->data[i], 1, frame.f->linesize[i],
-                                      avctx->width  >> !!i,
-                                      avctx->height >> !!i,
-                                      c->slices, !i);
-                }
-            }
-        }
-        break;
-    case AV_PIX_FMT_YUV422P:
-        for (i = 0; i < 3; i++) {
-            ret = decode_plane(c, i, frame.f->data[i], 1, frame.f->linesize[i],
-                               avctx->width >> !!i, avctx->height,
-                               plane_start[i], c->frame_pred == PRED_LEFT);
-            if (ret)
-                return ret;
-            if (c->frame_pred == PRED_MEDIAN) {
-                if (!c->interlaced) {
-                    restore_median(frame.f->data[i], 1, frame.f->linesize[i],
-                                   avctx->width >> !!i, avctx->height,
-                                   c->slices, 0);
-                } else {
-                    restore_median_il(frame.f->data[i], 1, frame.f->linesize[i],
-                                      avctx->width >> !!i, avctx->height,
-                                      c->slices, 0);
-                }
-            }
-        }
-        break;
-    }
-
-    frame.f->key_frame = 1;
-    frame.f->pict_type = AV_PICTURE_TYPE_I;
-    frame.f->interlaced_frame = !!c->interlaced;
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    UtvideoContext * const c = avctx->priv_data;
-
-    c->avctx = avctx;
-
-    ff_dsputil_init(&c->dsp, avctx);
-
-    if (avctx->extradata_size < 16) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Insufficient extradata size %d, should be at least 16\n",
-               avctx->extradata_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d.%d.%d\n",
-           avctx->extradata[3], avctx->extradata[2],
-           avctx->extradata[1], avctx->extradata[0]);
-    av_log(avctx, AV_LOG_DEBUG, "Original format %X\n",
-           AV_RB32(avctx->extradata + 4));
-    c->frame_info_size = AV_RL32(avctx->extradata + 8);
-    c->flags           = AV_RL32(avctx->extradata + 12);
-
-    if (c->frame_info_size != 4)
-        avpriv_request_sample(avctx, "Frame info not 4 bytes");
-    av_log(avctx, AV_LOG_DEBUG, "Encoding parameters %08X\n", c->flags);
-    c->slices      = (c->flags >> 24) + 1;
-    c->compression = c->flags & 1;
-    c->interlaced  = c->flags & 0x800;
-
-    c->slice_bits_size = 0;
-
-    switch (avctx->codec_tag) {
-    case MKTAG('U', 'L', 'R', 'G'):
-        c->planes      = 3;
-        avctx->pix_fmt = AV_PIX_FMT_RGB24;
-        break;
-    case MKTAG('U', 'L', 'R', 'A'):
-        c->planes      = 4;
-        avctx->pix_fmt = AV_PIX_FMT_RGBA;
-        break;
-    case MKTAG('U', 'L', 'Y', '0'):
-        c->planes      = 3;
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-        avctx->colorspace = AVCOL_SPC_BT470BG;
-        break;
-    case MKTAG('U', 'L', 'Y', '2'):
-        c->planes      = 3;
-        avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-        avctx->colorspace = AVCOL_SPC_BT470BG;
-        break;
-    case MKTAG('U', 'L', 'H', '0'):
-        c->planes      = 3;
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-        avctx->colorspace = AVCOL_SPC_BT709;
-        break;
-    case MKTAG('U', 'L', 'H', '2'):
-        c->planes      = 3;
-        avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-        avctx->colorspace = AVCOL_SPC_BT709;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown Ut Video FOURCC provided (%08X)\n",
-               avctx->codec_tag);
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    UtvideoContext * const c = avctx->priv_data;
-
-    av_freep(&c->slice_bits);
-
-    return 0;
-}
-
-AVCodec ff_utvideo_decoder = {
-    .name           = "utvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("Ut Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_UTVIDEO,
-    .priv_data_size = sizeof(UtvideoContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
-};
diff --git a/deps/libav/libavcodec/utvideoenc.c b/deps/libav/libavcodec/utvideoenc.c
deleted file mode 100644
index b63858d..0000000
--- a/deps/libav/libavcodec/utvideoenc.c
+++ /dev/null
@@ -1,650 +0,0 @@
-/*
- * Ut Video encoder
- * Copyright (c) 2012 Jan Ekström
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Ut Video encoder
- */
-
-#include "libavutil/imgutils.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "bytestream.h"
-#include "put_bits.h"
-#include "dsputil.h"
-#include "mathops.h"
-#include "utvideo.h"
-#include "huffman.h"
-
-/* Compare huffentry symbols */
-static int huff_cmp_sym(const void *a, const void *b)
-{
-    const HuffEntry *aa = a, *bb = b;
-    return aa->sym - bb->sym;
-}
-
-static av_cold int utvideo_encode_close(AVCodecContext *avctx)
-{
-    UtvideoContext *c = avctx->priv_data;
-    int i;
-
-    av_freep(&avctx->coded_frame);
-    av_freep(&c->slice_bits);
-    for (i = 0; i < 4; i++)
-        av_freep(&c->slice_buffer[i]);
-
-    return 0;
-}
-
-static av_cold int utvideo_encode_init(AVCodecContext *avctx)
-{
-    UtvideoContext *c = avctx->priv_data;
-    int i, subsampled_height;
-    uint32_t original_format;
-
-    c->avctx           = avctx;
-    c->frame_info_size = 4;
-    c->slice_stride    = FFALIGN(avctx->width, 32);
-
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB24:
-        c->planes        = 3;
-        avctx->codec_tag = MKTAG('U', 'L', 'R', 'G');
-        original_format  = UTVIDEO_RGB;
-        break;
-    case AV_PIX_FMT_RGBA:
-        c->planes        = 4;
-        avctx->codec_tag = MKTAG('U', 'L', 'R', 'A');
-        original_format  = UTVIDEO_RGBA;
-        break;
-    case AV_PIX_FMT_YUV420P:
-        if (avctx->width & 1 || avctx->height & 1) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "4:2:0 video requires even width and height.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        c->planes        = 3;
-        if (avctx->colorspace == AVCOL_SPC_BT709)
-            avctx->codec_tag = MKTAG('U', 'L', 'H', '0');
-        else
-            avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
-        original_format  = UTVIDEO_420;
-        break;
-    case AV_PIX_FMT_YUV422P:
-        if (avctx->width & 1) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "4:2:2 video requires even width.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        c->planes        = 3;
-        if (avctx->colorspace == AVCOL_SPC_BT709)
-            avctx->codec_tag = MKTAG('U', 'L', 'H', '2');
-        else
-            avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
-        original_format  = UTVIDEO_422;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown pixel format: %d\n",
-               avctx->pix_fmt);
-        return AVERROR_INVALIDDATA;
-    }
-
-    ff_dsputil_init(&c->dsp, avctx);
-
-    /* Check the prediction method, and error out if unsupported */
-    if (avctx->prediction_method < 0 || avctx->prediction_method > 4) {
-        av_log(avctx, AV_LOG_WARNING,
-               "Prediction method %d is not supported in Ut Video.\n",
-               avctx->prediction_method);
-        return AVERROR_OPTION_NOT_FOUND;
-    }
-
-    if (avctx->prediction_method == FF_PRED_PLANE) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Plane prediction is not supported in Ut Video.\n");
-        return AVERROR_OPTION_NOT_FOUND;
-    }
-
-    /* Convert from libavcodec prediction type to Ut Video's */
-    c->frame_pred = ff_ut_pred_order[avctx->prediction_method];
-
-    if (c->frame_pred == PRED_GRADIENT) {
-        av_log(avctx, AV_LOG_ERROR, "Gradient prediction is not supported.\n");
-        return AVERROR_OPTION_NOT_FOUND;
-    }
-
-    /*
-     * Check the asked slice count for obviously invalid
-     * values (> 256 or negative).
-     */
-    if (avctx->slices > 256 || avctx->slices < 0) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Slice count %d is not supported in Ut Video (theoretical range is 0-256).\n",
-               avctx->slices);
-        return AVERROR(EINVAL);
-    }
-
-    /* Check that the slice count is not larger than the subsampled height */
-    subsampled_height = avctx->height >> av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_h;
-    if (avctx->slices > subsampled_height) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Slice count %d is larger than the subsampling-applied height %d.\n",
-               avctx->slices, subsampled_height);
-        return AVERROR(EINVAL);
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-
-    if (!avctx->coded_frame) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
-        utvideo_encode_close(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    /* extradata size is 4 * 32bit */
-    avctx->extradata_size = 16;
-
-    avctx->extradata = av_mallocz(avctx->extradata_size +
-                                  FF_INPUT_BUFFER_PADDING_SIZE);
-
-    if (!avctx->extradata) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate extradata.\n");
-        utvideo_encode_close(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    for (i = 0; i < c->planes; i++) {
-        c->slice_buffer[i] = av_malloc(c->slice_stride * (avctx->height + 2) +
-                                       FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!c->slice_buffer[i]) {
-            av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 1.\n");
-            utvideo_encode_close(avctx);
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    /*
-     * Set the version of the encoder.
-     * Last byte is "implementation ID", which is
-     * obtained from the creator of the format.
-     * Libavcodec has been assigned with the ID 0xF0.
-     */
-    AV_WB32(avctx->extradata, MKTAG(1, 0, 0, 0xF0));
-
-    /*
-     * Set the "original format"
-     * Not used for anything during decoding.
-     */
-    AV_WL32(avctx->extradata + 4, original_format);
-
-    /* Write 4 as the 'frame info size' */
-    AV_WL32(avctx->extradata + 8, c->frame_info_size);
-
-    /*
-     * Set how many slices are going to be used.
-     * By default uses multiple slices depending on the subsampled height.
-     * This enables multithreading in the official decoder.
-     */
-    if (!avctx->slices) {
-        c->slices = subsampled_height / 120;
-
-        if (!c->slices)
-            c->slices = 1;
-        else if (c->slices > 256)
-            c->slices = 256;
-    } else {
-        c->slices = avctx->slices;
-    }
-
-    /* Set compression mode */
-    c->compression = COMP_HUFF;
-
-    /*
-     * Set the encoding flags:
-     * - Slice count minus 1
-     * - Interlaced encoding mode flag, set to zero for now.
-     * - Compression mode (none/huff)
-     * And write the flags.
-     */
-    c->flags  = (c->slices - 1) << 24;
-    c->flags |= 0 << 11; // bit field to signal interlaced encoding mode
-    c->flags |= c->compression;
-
-    AV_WL32(avctx->extradata + 12, c->flags);
-
-    return 0;
-}
-
-static void mangle_rgb_planes(uint8_t *dst[4], int dst_stride, uint8_t *src,
-                              int step, int stride, int width, int height)
-{
-    int i, j;
-    int k = 2 * dst_stride;
-    unsigned int g;
-
-    for (j = 0; j < height; j++) {
-        if (step == 3) {
-            for (i = 0; i < width * step; i += step) {
-                g         = src[i + 1];
-                dst[0][k] = g;
-                g        += 0x80;
-                dst[1][k] = src[i + 2] - g;
-                dst[2][k] = src[i + 0] - g;
-                k++;
-            }
-        } else {
-            for (i = 0; i < width * step; i += step) {
-                g         = src[i + 1];
-                dst[0][k] = g;
-                g        += 0x80;
-                dst[1][k] = src[i + 2] - g;
-                dst[2][k] = src[i + 0] - g;
-                dst[3][k] = src[i + 3];
-                k++;
-            }
-        }
-        k += dst_stride - width;
-        src += stride;
-    }
-}
-
-/* Write data to a plane with left prediction */
-static void left_predict(uint8_t *src, uint8_t *dst, int stride,
-                         int width, int height)
-{
-    int i, j;
-    uint8_t prev;
-
-    prev = 0x80; /* Set the initial value */
-    for (j = 0; j < height; j++) {
-        for (i = 0; i < width; i++) {
-            *dst++ = src[i] - prev;
-            prev   = src[i];
-        }
-        src += stride;
-    }
-}
-
-/* Write data to a plane with median prediction */
-static void median_predict(UtvideoContext *c, uint8_t *src, uint8_t *dst, int stride,
-                           int width, int height)
-{
-    int i, j;
-    int A, B;
-    uint8_t prev;
-
-    /* First line uses left neighbour prediction */
-    prev = 0x80; /* Set the initial value */
-    for (i = 0; i < width; i++) {
-        *dst++ = src[i] - prev;
-        prev   = src[i];
-    }
-
-    if (height == 1)
-        return;
-
-    src += stride;
-
-    /*
-     * Second line uses top prediction for the first sample,
-     * and median for the rest.
-     */
-    A = B = 0;
-
-    /* Rest of the coded part uses median prediction */
-    for (j = 1; j < height; j++) {
-        c->dsp.sub_hfyu_median_prediction(dst, src - stride, src, width, &A, &B);
-        dst += width;
-        src += stride;
-    }
-}
-
-/* Count the usage of values in a plane */
-static void count_usage(uint8_t *src, int width,
-                        int height, uint64_t *counts)
-{
-    int i, j;
-
-    for (j = 0; j < height; j++) {
-        for (i = 0; i < width; i++) {
-            counts[src[i]]++;
-        }
-        src += width;
-    }
-}
-
-/* Calculate the actual huffman codes from the code lengths */
-static void calculate_codes(HuffEntry *he)
-{
-    int last, i;
-    uint32_t code;
-
-    qsort(he, 256, sizeof(*he), ff_ut_huff_cmp_len);
-
-    last = 255;
-    while (he[last].len == 255 && last)
-        last--;
-
-    code = 1;
-    for (i = last; i >= 0; i--) {
-        he[i].code  = code >> (32 - he[i].len);
-        code       += 0x80000000u >> (he[i].len - 1);
-    }
-
-    qsort(he, 256, sizeof(*he), huff_cmp_sym);
-}
-
-/* Write huffman bit codes to a memory block */
-static int write_huff_codes(uint8_t *src, uint8_t *dst, int dst_size,
-                            int width, int height, HuffEntry *he)
-{
-    PutBitContext pb;
-    int i, j;
-    int count;
-
-    init_put_bits(&pb, dst, dst_size);
-
-    /* Write the codes */
-    for (j = 0; j < height; j++) {
-        for (i = 0; i < width; i++)
-            put_bits(&pb, he[src[i]].len, he[src[i]].code);
-
-        src += width;
-    }
-
-    /* Pad output to a 32bit boundary */
-    count = put_bits_count(&pb) & 0x1F;
-
-    if (count)
-        put_bits(&pb, 32 - count, 0);
-
-    /* Get the amount of bits written */
-    count = put_bits_count(&pb);
-
-    /* Flush the rest with zeroes */
-    flush_put_bits(&pb);
-
-    return count;
-}
-
-static int encode_plane(AVCodecContext *avctx, uint8_t *src,
-                        uint8_t *dst, int stride,
-                        int width, int height, PutByteContext *pb)
-{
-    UtvideoContext *c        = avctx->priv_data;
-    uint8_t  lengths[256];
-    uint64_t counts[256]     = { 0 };
-
-    HuffEntry he[256];
-
-    uint32_t offset = 0, slice_len = 0;
-    int      i, sstart, send = 0;
-    int      symbol;
-
-    /* Do prediction / make planes */
-    switch (c->frame_pred) {
-    case PRED_NONE:
-        for (i = 0; i < c->slices; i++) {
-            sstart = send;
-            send   = height * (i + 1) / c->slices;
-            av_image_copy_plane(dst + sstart * width, width,
-                                src + sstart * stride, stride,
-                                width, send - sstart);
-        }
-        break;
-    case PRED_LEFT:
-        for (i = 0; i < c->slices; i++) {
-            sstart = send;
-            send   = height * (i + 1) / c->slices;
-            left_predict(src + sstart * stride, dst + sstart * width,
-                         stride, width, send - sstart);
-        }
-        break;
-    case PRED_MEDIAN:
-        for (i = 0; i < c->slices; i++) {
-            sstart = send;
-            send   = height * (i + 1) / c->slices;
-            median_predict(c, src + sstart * stride, dst + sstart * width,
-                           stride, width, send - sstart);
-        }
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown prediction mode: %d\n",
-               c->frame_pred);
-        return AVERROR_OPTION_NOT_FOUND;
-    }
-
-    /* Count the usage of values */
-    count_usage(dst, width, height, counts);
-
-    /* Check for a special case where only one symbol was used */
-    for (symbol = 0; symbol < 256; symbol++) {
-        /* If non-zero count is found, see if it matches width * height */
-        if (counts[symbol]) {
-            /* Special case if only one symbol was used */
-            if (counts[symbol] == width * height) {
-                /*
-                 * Write a zero for the single symbol
-                 * used in the plane, else 0xFF.
-                 */
-                for (i = 0; i < 256; i++) {
-                    if (i == symbol)
-                        bytestream2_put_byte(pb, 0);
-                    else
-                        bytestream2_put_byte(pb, 0xFF);
-                }
-
-                /* Write zeroes for lengths */
-                for (i = 0; i < c->slices; i++)
-                    bytestream2_put_le32(pb, 0);
-
-                /* And that's all for that plane folks */
-                return 0;
-            }
-            break;
-        }
-    }
-
-    /* Calculate huffman lengths */
-    ff_huff_gen_len_table(lengths, counts);
-
-    /*
-     * Write the plane's header into the output packet:
-     * - huffman code lengths (256 bytes)
-     * - slice end offsets (gotten from the slice lengths)
-     */
-    for (i = 0; i < 256; i++) {
-        bytestream2_put_byte(pb, lengths[i]);
-
-        he[i].len = lengths[i];
-        he[i].sym = i;
-    }
-
-    /* Calculate the huffman codes themselves */
-    calculate_codes(he);
-
-    send = 0;
-    for (i = 0; i < c->slices; i++) {
-        sstart  = send;
-        send    = height * (i + 1) / c->slices;
-
-        /*
-         * Write the huffman codes to a buffer,
-         * get the offset in bits and convert to bytes.
-         */
-        offset += write_huff_codes(dst + sstart * width, c->slice_bits,
-                                   width * (send - sstart), width,
-                                   send - sstart, he) >> 3;
-
-        slice_len = offset - slice_len;
-
-        /* Byteswap the written huffman codes */
-        c->dsp.bswap_buf((uint32_t *) c->slice_bits,
-                         (uint32_t *) c->slice_bits,
-                         slice_len >> 2);
-
-        /* Write the offset to the stream */
-        bytestream2_put_le32(pb, offset);
-
-        /* Seek to the data part of the packet */
-        bytestream2_seek_p(pb, 4 * (c->slices - i - 1) +
-                           offset - slice_len, SEEK_CUR);
-
-        /* Write the slices' data into the output packet */
-        bytestream2_put_buffer(pb, c->slice_bits, slice_len);
-
-        /* Seek back to the slice offsets */
-        bytestream2_seek_p(pb, -4 * (c->slices - i - 1) - offset,
-                           SEEK_CUR);
-
-        slice_len = offset;
-    }
-
-    /* And at the end seek to the end of written slice(s) */
-    bytestream2_seek_p(pb, offset, SEEK_CUR);
-
-    return 0;
-}
-
-static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                                const AVFrame *pic, int *got_packet)
-{
-    UtvideoContext *c = avctx->priv_data;
-    PutByteContext pb;
-
-    uint32_t frame_info;
-
-    uint8_t *dst;
-
-    int width = avctx->width, height = avctx->height;
-    int i, ret = 0;
-
-    /* Allocate a new packet if needed, and set it to the pointer dst */
-    ret = ff_alloc_packet(pkt, (256 + 4 * c->slices + width * height) *
-                          c->planes + 4);
-
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Error allocating the output packet, or the provided packet "
-               "was too small.\n");
-        return ret;
-    }
-
-    dst = pkt->data;
-
-    bytestream2_init_writer(&pb, dst, pkt->size);
-
-    av_fast_malloc(&c->slice_bits, &c->slice_bits_size,
-                   width * height + FF_INPUT_BUFFER_PADDING_SIZE);
-
-    if (!c->slice_bits) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 2.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    /* In case of RGB, mangle the planes to Ut Video's format */
-    if (avctx->pix_fmt == AV_PIX_FMT_RGBA || avctx->pix_fmt == AV_PIX_FMT_RGB24)
-        mangle_rgb_planes(c->slice_buffer, c->slice_stride, pic->data[0],
-                          c->planes, pic->linesize[0], width, height);
-
-    /* Deal with the planes */
-    switch (avctx->pix_fmt) {
-    case AV_PIX_FMT_RGB24:
-    case AV_PIX_FMT_RGBA:
-        for (i = 0; i < c->planes; i++) {
-            ret = encode_plane(avctx, c->slice_buffer[i] + 2 * c->slice_stride,
-                               c->slice_buffer[i], c->slice_stride,
-                               width, height, &pb);
-
-            if (ret) {
-                av_log(avctx, AV_LOG_ERROR, "Error encoding plane %d.\n", i);
-                return ret;
-            }
-        }
-        break;
-    case AV_PIX_FMT_YUV422P:
-        for (i = 0; i < c->planes; i++) {
-            ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
-                               pic->linesize[i], width >> !!i, height, &pb);
-
-            if (ret) {
-                av_log(avctx, AV_LOG_ERROR, "Error encoding plane %d.\n", i);
-                return ret;
-            }
-        }
-        break;
-    case AV_PIX_FMT_YUV420P:
-        for (i = 0; i < c->planes; i++) {
-            ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
-                               pic->linesize[i], width >> !!i, height >> !!i,
-                               &pb);
-
-            if (ret) {
-                av_log(avctx, AV_LOG_ERROR, "Error encoding plane %d.\n", i);
-                return ret;
-            }
-        }
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown pixel format: %d\n",
-               avctx->pix_fmt);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /*
-     * Write frame information (LE 32bit unsigned)
-     * into the output packet.
-     * Contains the prediction method.
-     */
-    frame_info = c->frame_pred << 8;
-    bytestream2_put_le32(&pb, frame_info);
-
-    /*
-     * At least currently Ut Video is IDR only.
-     * Set flags accordingly.
-     */
-    avctx->coded_frame->key_frame = 1;
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
-    pkt->size   = bytestream2_tell_p(&pb);
-    pkt->flags |= AV_PKT_FLAG_KEY;
-
-    /* Packet should be done */
-    *got_packet = 1;
-
-    return 0;
-}
-
-AVCodec ff_utvideo_encoder = {
-    .name           = "utvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("Ut Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_UTVIDEO,
-    .priv_data_size = sizeof(UtvideoContext),
-    .init           = utvideo_encode_init,
-    .encode2        = utvideo_encode_frame,
-    .close          = utvideo_encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]) {
-                          AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_YUV422P,
-                          AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
-                      },
-};
diff --git a/deps/libav/libavcodec/v210dec.c b/deps/libav/libavcodec/v210dec.c
deleted file mode 100644
index 8827397..0000000
--- a/deps/libav/libavcodec/v210dec.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * V210 decoder
- *
- * Copyright (C) 2009 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/bswap.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    if (avctx->width & 1) {
-        av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avctx->pix_fmt             = AV_PIX_FMT_YUV422P10;
-    avctx->bits_per_raw_sample = 10;
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    int h, w, ret;
-    AVFrame *pic = data;
-    const uint8_t *psrc = avpkt->data;
-    uint16_t *y, *u, *v;
-    int aligned_width = ((avctx->width + 47) / 48) * 48;
-    int stride = aligned_width * 8 / 3;
-
-    if (avpkt->size < stride * avctx->height) {
-        av_log(avctx, AV_LOG_ERROR, "packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    y = (uint16_t*)pic->data[0];
-    u = (uint16_t*)pic->data[1];
-    v = (uint16_t*)pic->data[2];
-    pic->pict_type = AV_PICTURE_TYPE_I;
-    pic->key_frame = 1;
-
-#define READ_PIXELS(a, b, c)         \
-    do {                             \
-        val  = av_le2ne32(*src++);   \
-        *a++ =  val & 0x3FF;         \
-        *b++ = (val >> 10) & 0x3FF;  \
-        *c++ = (val >> 20) & 0x3FF;  \
-    } while (0)
-
-    for (h = 0; h < avctx->height; h++) {
-        const uint32_t *src = (const uint32_t*)psrc;
-        uint32_t val;
-        for (w = 0; w < avctx->width - 5; w += 6) {
-            READ_PIXELS(u, y, v);
-            READ_PIXELS(y, u, y);
-            READ_PIXELS(v, y, u);
-            READ_PIXELS(y, v, y);
-        }
-        if (w < avctx->width - 1) {
-            READ_PIXELS(u, y, v);
-
-            val  = av_le2ne32(*src++);
-            *y++ =  val & 0x3FF;
-        }
-        if (w < avctx->width - 3) {
-            *u++ = (val >> 10) & 0x3FF;
-            *y++ = (val >> 20) & 0x3FF;
-
-            val  = av_le2ne32(*src++);
-            *v++ =  val & 0x3FF;
-            *y++ = (val >> 10) & 0x3FF;
-        }
-
-        psrc += stride;
-        y += pic->linesize[0] / 2 - avctx->width;
-        u += pic->linesize[1] / 2 - avctx->width / 2;
-        v += pic->linesize[2] / 2 - avctx->width / 2;
-    }
-
-    *got_frame      = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_v210_decoder = {
-    .name           = "v210",
-    .long_name      = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_V210,
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/v210enc.c b/deps/libav/libavcodec/v210enc.c
deleted file mode 100644
index ef0d6ab..0000000
--- a/deps/libav/libavcodec/v210enc.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * V210 encoder
- *
- * Copyright (C) 2009 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    if (avctx->width & 1) {
-        av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (avctx->bits_per_raw_sample != 10)
-        av_log(avctx, AV_LOG_WARNING, "bits per raw sample: %d != 10-bit\n",
-               avctx->bits_per_raw_sample);
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
-    return 0;
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *pic, int *got_packet)
-{
-    int aligned_width = ((avctx->width + 47) / 48) * 48;
-    int stride = aligned_width * 8 / 3;
-    int line_padding = stride - ((avctx->width * 8 + 11) / 12) * 4;
-    int h, w, ret;
-    const uint16_t *y = (const uint16_t*)pic->data[0];
-    const uint16_t *u = (const uint16_t*)pic->data[1];
-    const uint16_t *v = (const uint16_t*)pic->data[2];
-    PutByteContext p;
-
-    if ((ret = ff_alloc_packet(pkt, avctx->height * stride)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    bytestream2_init_writer(&p, pkt->data, pkt->size);
-
-#define CLIP(v) av_clip(v, 4, 1019)
-
-#define WRITE_PIXELS(a, b, c)           \
-    do {                                \
-        val =   CLIP(*a++);             \
-        val |= (CLIP(*b++) << 10) |     \
-               (CLIP(*c++) << 20);      \
-        bytestream2_put_le32u(&p, val); \
-    } while (0)
-
-    for (h = 0; h < avctx->height; h++) {
-        uint32_t val;
-        for (w = 0; w < avctx->width - 5; w += 6) {
-            WRITE_PIXELS(u, y, v);
-            WRITE_PIXELS(y, u, y);
-            WRITE_PIXELS(v, y, u);
-            WRITE_PIXELS(y, v, y);
-        }
-        if (w < avctx->width - 1) {
-            WRITE_PIXELS(u, y, v);
-
-            val = CLIP(*y++);
-            if (w == avctx->width - 2)
-                bytestream2_put_le32u(&p, val);
-        }
-        if (w < avctx->width - 3) {
-            val |= (CLIP(*u++) << 10) | (CLIP(*y++) << 20);
-            bytestream2_put_le32u(&p, val);
-
-            val = CLIP(*v++) | (CLIP(*y++) << 10);
-            bytestream2_put_le32u(&p, val);
-        }
-
-        bytestream2_set_buffer(&p, 0, line_padding);
-
-        y += pic->linesize[0] / 2 - avctx->width;
-        u += pic->linesize[1] / 2 - avctx->width / 2;
-        v += pic->linesize[2] / 2 - avctx->width / 2;
-    }
-
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-static av_cold int encode_close(AVCodecContext *avctx)
-{
-    av_freep(&avctx->coded_frame);
-
-    return 0;
-}
-
-AVCodec ff_v210_encoder = {
-    .name           = "v210",
-    .long_name      = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_V210,
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = encode_close,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/v210x.c b/deps/libav/libavcodec/v210x.c
deleted file mode 100644
index 2922c05..0000000
--- a/deps/libav/libavcodec/v210x.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2009 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/bswap.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    if (avctx->width & 1) {
-        av_log(avctx, AV_LOG_ERROR, "v210x needs even width\n");
-        return AVERROR(EINVAL);
-    }
-    avctx->pix_fmt             = AV_PIX_FMT_YUV422P16;
-    avctx->bits_per_raw_sample = 10;
-
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint32_t *src = (const uint32_t *)avpkt->data;
-    AVFrame *pic        = data;
-    int width           = avctx->width;
-    int y               = 0;
-    uint16_t *ydst, *udst, *vdst, *yend;
-    int ret;
-
-    if (avpkt->size < avctx->width * avctx->height * 8 / 3) {
-        av_log(avctx, AV_LOG_ERROR, "Packet too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avpkt->size > avctx->width * avctx->height * 8 / 3) {
-        avpriv_request_sample(avctx, "(Probably) padded data");
-    }
-
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
-    ydst = (uint16_t *)pic->data[0];
-    udst = (uint16_t *)pic->data[1];
-    vdst = (uint16_t *)pic->data[2];
-    yend = ydst + width;
-    pic->pict_type = AV_PICTURE_TYPE_I;
-    pic->key_frame = 1;
-
-    for (;;) {
-        uint32_t v = av_be2ne32(*src++);
-        *udst++ = (v >> 16) & 0xFFC0;
-        *ydst++ = (v >> 6 ) & 0xFFC0;
-        *vdst++ = (v << 4 ) & 0xFFC0;
-
-        v       = av_be2ne32(*src++);
-        *ydst++ = (v >> 16) & 0xFFC0;
-
-        if (ydst >= yend) {
-            ydst += pic->linesize[0] / 2 - width;
-            udst += pic->linesize[1] / 2 - width / 2;
-            vdst += pic->linesize[2] / 2 - width / 2;
-            yend = ydst + width;
-            if (++y >= avctx->height)
-                break;
-        }
-
-        *udst++ = (v >> 6 ) & 0xFFC0;
-        *ydst++ = (v << 4 ) & 0xFFC0;
-
-        v = av_be2ne32(*src++);
-        *vdst++ = (v >> 16) & 0xFFC0;
-        *ydst++ = (v >> 6 ) & 0xFFC0;
-
-        if (ydst >= yend) {
-            ydst += pic->linesize[0] / 2 - width;
-            udst += pic->linesize[1] / 2 - width / 2;
-            vdst += pic->linesize[2] / 2 - width / 2;
-            yend  = ydst + width;
-            if (++y >= avctx->height)
-                break;
-        }
-
-        *udst++ = (v << 4 ) & 0xFFC0;
-
-        v = av_be2ne32(*src++);
-        *ydst++ = (v >> 16) & 0xFFC0;
-        *vdst++ = (v >> 6 ) & 0xFFC0;
-        *ydst++ = (v << 4 ) & 0xFFC0;
-        if (ydst >= yend) {
-            ydst += pic->linesize[0] / 2 - width;
-            udst += pic->linesize[1] / 2 - width / 2;
-            vdst += pic->linesize[2] / 2 - width / 2;
-            yend  = ydst + width;
-            if (++y >= avctx->height)
-                break;
-        }
-    }
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_v210x_decoder = {
-    .name           = "v210x",
-    .long_name      = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_V210X,
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/v410dec.c b/deps/libav/libavcodec/v410dec.c
deleted file mode 100644
index 07be502..0000000
--- a/deps/libav/libavcodec/v410dec.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * v410 decoder
- *
- * Copyright (c) 2011 Derek Buitenhuis
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-static av_cold int v410_decode_init(AVCodecContext *avctx)
-{
-    avctx->pix_fmt             = AV_PIX_FMT_YUV444P10;
-    avctx->bits_per_raw_sample = 10;
-
-    if (avctx->width & 1) {
-        if (avctx->err_recognition & AV_EF_EXPLODE) {
-            av_log(avctx, AV_LOG_ERROR, "v410 requires width to be even.\n");
-            return AVERROR_INVALIDDATA;
-        } else {
-            av_log(avctx, AV_LOG_WARNING, "v410 requires width to be even, continuing anyway.\n");
-        }
-    }
-
-    return 0;
-}
-
-static int v410_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame, AVPacket *avpkt)
-{
-    AVFrame *pic = data;
-    uint8_t *src = avpkt->data;
-    uint16_t *y, *u, *v;
-    uint32_t val;
-    int i, j;
-
-    if (avpkt->size < 4 * avctx->height * avctx->width) {
-        av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (ff_get_buffer(avctx, pic, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    pic->key_frame = 1;
-    pic->pict_type = AV_PICTURE_TYPE_I;
-
-    y = (uint16_t *)pic->data[0];
-    u = (uint16_t *)pic->data[1];
-    v = (uint16_t *)pic->data[2];
-
-    for (i = 0; i < avctx->height; i++) {
-        for (j = 0; j < avctx->width; j++) {
-            val = AV_RL32(src);
-
-            u[j] = (val >>  2) & 0x3FF;
-            y[j] = (val >> 12) & 0x3FF;
-            v[j] = (val >> 22);
-
-            src += 4;
-        }
-
-        y += pic->linesize[0] >> 1;
-        u += pic->linesize[1] >> 1;
-        v += pic->linesize[2] >> 1;
-    }
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_v410_decoder = {
-    .name         = "v410",
-    .long_name    = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"),
-    .type         = AVMEDIA_TYPE_VIDEO,
-    .id           = AV_CODEC_ID_V410,
-    .init         = v410_decode_init,
-    .decode       = v410_decode_frame,
-    .capabilities = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/v410enc.c b/deps/libav/libavcodec/v410enc.c
deleted file mode 100644
index 77b32d7..0000000
--- a/deps/libav/libavcodec/v410enc.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * v410 encoder
- *
- * Copyright (c) 2011 Derek Buitenhuis
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-static av_cold int v410_encode_init(AVCodecContext *avctx)
-{
-    if (avctx->width & 1) {
-        av_log(avctx, AV_LOG_ERROR, "v410 requires even width.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-
-    if (!avctx->coded_frame) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                             const AVFrame *pic, int *got_packet)
-{
-    uint8_t *dst;
-    uint16_t *y, *u, *v;
-    uint32_t val;
-    int i, j, ret;
-
-    if ((ret = ff_alloc_packet(pkt, avctx->width * avctx->height * 4)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-    dst = pkt->data;
-
-    avctx->coded_frame->key_frame = 1;
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
-    y = (uint16_t *)pic->data[0];
-    u = (uint16_t *)pic->data[1];
-    v = (uint16_t *)pic->data[2];
-
-    for (i = 0; i < avctx->height; i++) {
-        for (j = 0; j < avctx->width; j++) {
-            val  = u[j] << 2;
-            val |= y[j] << 12;
-            val |= (uint32_t) v[j] << 22;
-            AV_WL32(dst, val);
-            dst += 4;
-        }
-        y += pic->linesize[0] >> 1;
-        u += pic->linesize[1] >> 1;
-        v += pic->linesize[2] >> 1;
-    }
-
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-static av_cold int v410_encode_close(AVCodecContext *avctx)
-{
-    av_freep(&avctx->coded_frame);
-
-    return 0;
-}
-
-AVCodec ff_v410_encoder = {
-    .name         = "v410",
-    .long_name    = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"),
-    .type         = AVMEDIA_TYPE_VIDEO,
-    .id           = AV_CODEC_ID_V410,
-    .init         = v410_encode_init,
-    .encode2      = v410_encode_frame,
-    .close        = v410_encode_close,
-    .pix_fmts     = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/vaapi.c b/deps/libav/libavcodec/vaapi.c
deleted file mode 100644
index 0532daf..0000000
--- a/deps/libav/libavcodec/vaapi.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Video Acceleration API (video decoding)
- * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
- *
- * Copyright (C) 2008-2009 Splitted-Desktop Systems
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "h264.h"
-#include "vaapi_internal.h"
-
-/**
- * @addtogroup VAAPI_Decoding
- *
- * @{
- */
-
-static void destroy_buffers(VADisplay display, VABufferID *buffers, unsigned int n_buffers)
-{
-    unsigned int i;
-    for (i = 0; i < n_buffers; i++) {
-        if (buffers[i]) {
-            vaDestroyBuffer(display, buffers[i]);
-            buffers[i] = 0;
-        }
-    }
-}
-
-int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
-{
-    VABufferID va_buffers[3];
-    unsigned int n_va_buffers = 0;
-
-    vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
-    va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
-
-    if (vactx->iq_matrix_buf_id) {
-        vaUnmapBuffer(vactx->display, vactx->iq_matrix_buf_id);
-        va_buffers[n_va_buffers++] = vactx->iq_matrix_buf_id;
-    }
-
-    if (vactx->bitplane_buf_id) {
-        vaUnmapBuffer(vactx->display, vactx->bitplane_buf_id);
-        va_buffers[n_va_buffers++] = vactx->bitplane_buf_id;
-    }
-
-    if (vaBeginPicture(vactx->display, vactx->context_id,
-                       surface) != VA_STATUS_SUCCESS)
-        return -1;
-
-    if (vaRenderPicture(vactx->display, vactx->context_id,
-                        va_buffers, n_va_buffers) != VA_STATUS_SUCCESS)
-        return -1;
-
-    if (vaRenderPicture(vactx->display, vactx->context_id,
-                        vactx->slice_buf_ids,
-                        vactx->n_slice_buf_ids) != VA_STATUS_SUCCESS)
-        return -1;
-
-    if (vaEndPicture(vactx->display, vactx->context_id) != VA_STATUS_SUCCESS)
-        return -1;
-
-    return 0;
-}
-
-int ff_vaapi_commit_slices(struct vaapi_context *vactx)
-{
-    VABufferID *slice_buf_ids;
-    VABufferID slice_param_buf_id, slice_data_buf_id;
-
-    if (vactx->slice_count == 0)
-        return 0;
-
-    slice_buf_ids =
-        av_fast_realloc(vactx->slice_buf_ids,
-                        &vactx->slice_buf_ids_alloc,
-                        (vactx->n_slice_buf_ids + 2) * sizeof(slice_buf_ids[0]));
-    if (!slice_buf_ids)
-        return -1;
-    vactx->slice_buf_ids = slice_buf_ids;
-
-    slice_param_buf_id = 0;
-    if (vaCreateBuffer(vactx->display, vactx->context_id,
-                       VASliceParameterBufferType,
-                       vactx->slice_param_size,
-                       vactx->slice_count, vactx->slice_params,
-                       &slice_param_buf_id) != VA_STATUS_SUCCESS)
-        return -1;
-    vactx->slice_count = 0;
-
-    slice_data_buf_id = 0;
-    if (vaCreateBuffer(vactx->display, vactx->context_id,
-                       VASliceDataBufferType,
-                       vactx->slice_data_size,
-                       1, (void *)vactx->slice_data,
-                       &slice_data_buf_id) != VA_STATUS_SUCCESS)
-        return -1;
-    vactx->slice_data = NULL;
-    vactx->slice_data_size = 0;
-
-    slice_buf_ids[vactx->n_slice_buf_ids++] = slice_param_buf_id;
-    slice_buf_ids[vactx->n_slice_buf_ids++] = slice_data_buf_id;
-    return 0;
-}
-
-static void *alloc_buffer(struct vaapi_context *vactx, int type, unsigned int size, uint32_t *buf_id)
-{
-    void *data = NULL;
-
-    *buf_id = 0;
-    if (vaCreateBuffer(vactx->display, vactx->context_id,
-                       type, size, 1, NULL, buf_id) == VA_STATUS_SUCCESS)
-        vaMapBuffer(vactx->display, *buf_id, &data);
-
-    return data;
-}
-
-void *ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size)
-{
-    return alloc_buffer(vactx, VAPictureParameterBufferType, size, &vactx->pic_param_buf_id);
-}
-
-void *ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size)
-{
-    return alloc_buffer(vactx, VAIQMatrixBufferType, size, &vactx->iq_matrix_buf_id);
-}
-
-uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size)
-{
-    return alloc_buffer(vactx, VABitPlaneBufferType, size, &vactx->bitplane_buf_id);
-}
-
-VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context *vactx, const uint8_t *buffer, uint32_t size)
-{
-    uint8_t *slice_params;
-    VASliceParameterBufferBase *slice_param;
-
-    if (!vactx->slice_data)
-        vactx->slice_data = buffer;
-    if (vactx->slice_data + vactx->slice_data_size != buffer) {
-        if (ff_vaapi_commit_slices(vactx) < 0)
-            return NULL;
-        vactx->slice_data = buffer;
-    }
-
-    slice_params =
-        av_fast_realloc(vactx->slice_params,
-                        &vactx->slice_params_alloc,
-                        (vactx->slice_count + 1) * vactx->slice_param_size);
-    if (!slice_params)
-        return NULL;
-    vactx->slice_params = slice_params;
-
-    slice_param = (VASliceParameterBufferBase *)(slice_params + vactx->slice_count * vactx->slice_param_size);
-    slice_param->slice_data_size   = size;
-    slice_param->slice_data_offset = vactx->slice_data_size;
-    slice_param->slice_data_flag   = VA_SLICE_DATA_FLAG_ALL;
-
-    vactx->slice_count++;
-    vactx->slice_data_size += size;
-    return slice_param;
-}
-
-void ff_vaapi_common_end_frame(AVCodecContext *avctx)
-{
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
-
-    av_dlog(avctx, "ff_vaapi_common_end_frame()\n");
-
-    destroy_buffers(vactx->display, &vactx->pic_param_buf_id, 1);
-    destroy_buffers(vactx->display, &vactx->iq_matrix_buf_id, 1);
-    destroy_buffers(vactx->display, &vactx->bitplane_buf_id, 1);
-    destroy_buffers(vactx->display, vactx->slice_buf_ids, vactx->n_slice_buf_ids);
-    av_freep(&vactx->slice_buf_ids);
-    av_freep(&vactx->slice_params);
-    vactx->n_slice_buf_ids     = 0;
-    vactx->slice_buf_ids_alloc = 0;
-    vactx->slice_count         = 0;
-    vactx->slice_params_alloc  = 0;
-}
-
-int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
-{
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
-    MpegEncContext *s = avctx->priv_data;
-    int ret;
-
-    ret = ff_vaapi_commit_slices(vactx);
-    if (ret < 0)
-        goto finish;
-
-    ret = ff_vaapi_render_picture(vactx,
-                                  ff_vaapi_get_surface_id(s->current_picture_ptr));
-    if (ret < 0)
-        goto finish;
-
-    ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
-
-finish:
-    ff_vaapi_common_end_frame(avctx);
-    return ret;
-}
-
-/* @} */
diff --git a/deps/libav/libavcodec/vaapi.h b/deps/libav/libavcodec/vaapi.h
deleted file mode 100644
index 39e8825..0000000
--- a/deps/libav/libavcodec/vaapi.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Video Acceleration API (shared data between Libav and the video player)
- * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
- *
- * Copyright (C) 2008-2009 Splitted-Desktop Systems
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VAAPI_H
-#define AVCODEC_VAAPI_H
-
-/**
- * @file
- * @ingroup lavc_codec_hwaccel_vaapi
- * Public libavcodec VA API header.
- */
-
-#include <stdint.h>
-
-/**
- * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
- * @ingroup lavc_codec_hwaccel
- * @{
- */
-
-/**
- * This structure is used to share data between the Libav library and
- * the client video application.
- * This shall be zero-allocated and available as
- * AVCodecContext.hwaccel_context. All user members can be set once
- * during initialization or through each AVCodecContext.get_buffer()
- * function call. In any case, they must be valid prior to calling
- * decoding functions.
- */
-struct vaapi_context {
-    /**
-     * Window system dependent data
-     *
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    void *display;
-
-    /**
-     * Configuration ID
-     *
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    uint32_t config_id;
-
-    /**
-     * Context ID (video decode pipeline)
-     *
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    uint32_t context_id;
-
-    /**
-     * VAPictureParameterBuffer ID
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t pic_param_buf_id;
-
-    /**
-     * VAIQMatrixBuffer ID
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t iq_matrix_buf_id;
-
-    /**
-     * VABitPlaneBuffer ID (for VC-1 decoding)
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t bitplane_buf_id;
-
-    /**
-     * Slice parameter/data buffer IDs
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t *slice_buf_ids;
-
-    /**
-     * Number of effective slice buffer IDs to send to the HW
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int n_slice_buf_ids;
-
-    /**
-     * Size of pre-allocated slice_buf_ids
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_buf_ids_alloc;
-
-    /**
-     * Pointer to VASliceParameterBuffers
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    void *slice_params;
-
-    /**
-     * Size of a VASliceParameterBuffer element
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_param_size;
-
-    /**
-     * Size of pre-allocated slice_params
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_params_alloc;
-
-    /**
-     * Number of slices currently filled in
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    unsigned int slice_count;
-
-    /**
-     * Pointer to slice data buffer base
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    const uint8_t *slice_data;
-
-    /**
-     * Current size of slice data
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec
-     */
-    uint32_t slice_data_size;
-};
-
-/* @} */
-
-#endif /* AVCODEC_VAAPI_H */
diff --git a/deps/libav/libavcodec/vaapi_h264.c b/deps/libav/libavcodec/vaapi_h264.c
deleted file mode 100644
index dfa2ec7..0000000
--- a/deps/libav/libavcodec/vaapi_h264.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * H.264 HW decode acceleration through VA API
- *
- * Copyright (C) 2008-2009 Splitted-Desktop Systems
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "vaapi_internal.h"
-#include "h264.h"
-
-/**
- * @file
- * This file implements the glue code between Libav's and VA API's
- * structures for H.264 decoding.
- */
-
-/**
- * Initialize an empty VA API picture.
- *
- * VA API requires a fixed-size reference picture array.
- */
-static void init_vaapi_pic(VAPictureH264 *va_pic)
-{
-    va_pic->picture_id          = VA_INVALID_ID;
-    va_pic->flags               = VA_PICTURE_H264_INVALID;
-    va_pic->TopFieldOrderCnt    = 0;
-    va_pic->BottomFieldOrderCnt = 0;
-}
-
-/**
- * Translate an Libav Picture into its VA API form.
- *
- * @param[out] va_pic          A pointer to VA API's own picture struct
- * @param[in]  pic             A pointer to the Libav picture struct to convert
- * @param[in]  pic_structure   The picture field type (as defined in mpegvideo.h),
- *                             supersedes pic's field type if nonzero.
- */
-static void fill_vaapi_pic(VAPictureH264 *va_pic,
-                           Picture       *pic,
-                           int            pic_structure)
-{
-    if (pic_structure == 0)
-        pic_structure = pic->reference;
-    pic_structure &= PICT_FRAME; /* PICT_TOP_FIELD|PICT_BOTTOM_FIELD */
-
-    va_pic->picture_id = ff_vaapi_get_surface_id(pic);
-    va_pic->frame_idx  = pic->long_ref ? pic->pic_id : pic->frame_num;
-
-    va_pic->flags      = 0;
-    if (pic_structure != PICT_FRAME)
-        va_pic->flags |= (pic_structure & PICT_TOP_FIELD) ? VA_PICTURE_H264_TOP_FIELD : VA_PICTURE_H264_BOTTOM_FIELD;
-    if (pic->reference)
-        va_pic->flags |= pic->long_ref ? VA_PICTURE_H264_LONG_TERM_REFERENCE : VA_PICTURE_H264_SHORT_TERM_REFERENCE;
-
-    va_pic->TopFieldOrderCnt = 0;
-    if (pic->field_poc[0] != INT_MAX)
-        va_pic->TopFieldOrderCnt = pic->field_poc[0];
-
-    va_pic->BottomFieldOrderCnt = 0;
-    if (pic->field_poc[1] != INT_MAX)
-        va_pic->BottomFieldOrderCnt = pic->field_poc[1];
-}
-
-/** Decoded Picture Buffer (DPB). */
-typedef struct DPB {
-    int            size;        ///< Current number of reference frames in the DPB
-    int            max_size;    ///< Max number of reference frames. This is FF_ARRAY_ELEMS(VAPictureParameterBufferH264.ReferenceFrames)
-    VAPictureH264 *va_pics;     ///< Pointer to VAPictureParameterBufferH264.ReferenceFrames array
-} DPB;
-
-/**
- * Append picture to the decoded picture buffer, in a VA API form that
- * merges the second field picture attributes with the first, if
- * available.  The decoded picture buffer's size must be large enough
- * to receive the new VA API picture object.
- */
-static int dpb_add(DPB *dpb, Picture *pic)
-{
-    int i;
-
-    if (dpb->size >= dpb->max_size)
-        return -1;
-
-    for (i = 0; i < dpb->size; i++) {
-        VAPictureH264 * const va_pic = &dpb->va_pics[i];
-        if (va_pic->picture_id == ff_vaapi_get_surface_id(pic)) {
-            VAPictureH264 temp_va_pic;
-            fill_vaapi_pic(&temp_va_pic, pic, 0);
-
-            if ((temp_va_pic.flags ^ va_pic->flags) & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD)) {
-                va_pic->flags |= temp_va_pic.flags & (VA_PICTURE_H264_TOP_FIELD | VA_PICTURE_H264_BOTTOM_FIELD);
-                /* Merge second field */
-                if (temp_va_pic.flags & VA_PICTURE_H264_TOP_FIELD) {
-                    va_pic->TopFieldOrderCnt    = temp_va_pic.TopFieldOrderCnt;
-                } else {
-                    va_pic->BottomFieldOrderCnt = temp_va_pic.BottomFieldOrderCnt;
-                }
-            }
-            return 0;
-        }
-    }
-
-    fill_vaapi_pic(&dpb->va_pics[dpb->size++], pic, 0);
-    return 0;
-}
-
-/** Fill in VA API reference frames array. */
-static int fill_vaapi_ReferenceFrames(VAPictureParameterBufferH264 *pic_param,
-                                      H264Context                  *h)
-{
-    DPB dpb;
-    int i;
-
-    dpb.size     = 0;
-    dpb.max_size = FF_ARRAY_ELEMS(pic_param->ReferenceFrames);
-    dpb.va_pics  = pic_param->ReferenceFrames;
-    for (i = 0; i < dpb.max_size; i++)
-        init_vaapi_pic(&dpb.va_pics[i]);
-
-    for (i = 0; i < h->short_ref_count; i++) {
-        Picture * const pic = h->short_ref[i];
-        if (pic && pic->reference && dpb_add(&dpb, pic) < 0)
-            return -1;
-    }
-
-    for (i = 0; i < 16; i++) {
-        Picture * const pic = h->long_ref[i];
-        if (pic && pic->reference && dpb_add(&dpb, pic) < 0)
-            return -1;
-    }
-    return 0;
-}
-
-/**
- * Fill in VA API reference picture lists from the Libav reference
- * picture list.
- *
- * @param[out] RefPicList  VA API internal reference picture list
- * @param[in]  ref_list    A pointer to the Libav reference list
- * @param[in]  ref_count   The number of reference pictures in ref_list
- */
-static void fill_vaapi_RefPicList(VAPictureH264 RefPicList[32],
-                                  Picture      *ref_list,
-                                  unsigned int  ref_count)
-{
-    unsigned int i, n = 0;
-    for (i = 0; i < ref_count; i++)
-        if (ref_list[i].reference)
-            fill_vaapi_pic(&RefPicList[n++], &ref_list[i], 0);
-
-    for (; n < 32; n++)
-        init_vaapi_pic(&RefPicList[n]);
-}
-
-/**
- * Fill in prediction weight table.
- *
- * VA API requires a plain prediction weight table as it does not infer
- * any value.
- *
- * @param[in]  h                   A pointer to the current H.264 context
- * @param[in]  list                The reference frame list index to use
- * @param[out] luma_weight_flag    VA API plain luma weight flag
- * @param[out] luma_weight         VA API plain luma weight table
- * @param[out] luma_offset         VA API plain luma offset table
- * @param[out] chroma_weight_flag  VA API plain chroma weight flag
- * @param[out] chroma_weight       VA API plain chroma weight table
- * @param[out] chroma_offset       VA API plain chroma offset table
- */
-static void fill_vaapi_plain_pred_weight_table(H264Context   *h,
-                                               int            list,
-                                               unsigned char *luma_weight_flag,
-                                               short          luma_weight[32],
-                                               short          luma_offset[32],
-                                               unsigned char *chroma_weight_flag,
-                                               short          chroma_weight[32][2],
-                                               short          chroma_offset[32][2])
-{
-    unsigned int i, j;
-
-    *luma_weight_flag    = h->luma_weight_flag[list];
-    *chroma_weight_flag  = h->chroma_weight_flag[list];
-
-    for (i = 0; i < h->ref_count[list]; i++) {
-        /* VA API also wants the inferred (default) values, not
-           only what is available in the bitstream (7.4.3.2). */
-        if (h->luma_weight_flag[list]) {
-            luma_weight[i] = h->luma_weight[i][list][0];
-            luma_offset[i] = h->luma_weight[i][list][1];
-        } else {
-            luma_weight[i] = 1 << h->luma_log2_weight_denom;
-            luma_offset[i] = 0;
-        }
-        for (j = 0; j < 2; j++) {
-            if (h->chroma_weight_flag[list]) {
-                chroma_weight[i][j] = h->chroma_weight[i][list][j][0];
-                chroma_offset[i][j] = h->chroma_weight[i][list][j][1];
-            } else {
-                chroma_weight[i][j] = 1 << h->chroma_log2_weight_denom;
-                chroma_offset[i][j] = 0;
-            }
-        }
-    }
-}
-
-/** Initialize and start decoding a frame with VA API. */
-static int vaapi_h264_start_frame(AVCodecContext          *avctx,
-                                  av_unused const uint8_t *buffer,
-                                  av_unused uint32_t       size)
-{
-    H264Context * const h = avctx->priv_data;
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
-    VAPictureParameterBufferH264 *pic_param;
-    VAIQMatrixBufferH264 *iq_matrix;
-
-    av_dlog(avctx, "vaapi_h264_start_frame()\n");
-
-    vactx->slice_param_size = sizeof(VASliceParameterBufferH264);
-
-    /* Fill in VAPictureParameterBufferH264. */
-    pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VAPictureParameterBufferH264));
-    if (!pic_param)
-        return -1;
-    fill_vaapi_pic(&pic_param->CurrPic, h->cur_pic_ptr, h->picture_structure);
-    if (fill_vaapi_ReferenceFrames(pic_param, h) < 0)
-        return -1;
-    pic_param->picture_width_in_mbs_minus1                      = h->mb_width - 1;
-    pic_param->picture_height_in_mbs_minus1                     = h->mb_height - 1;
-    pic_param->bit_depth_luma_minus8                            = h->sps.bit_depth_luma - 8;
-    pic_param->bit_depth_chroma_minus8                          = h->sps.bit_depth_chroma - 8;
-    pic_param->num_ref_frames                                   = h->sps.ref_frame_count;
-    pic_param->seq_fields.value                                 = 0; /* reset all bits */
-    pic_param->seq_fields.bits.chroma_format_idc                = h->sps.chroma_format_idc;
-    pic_param->seq_fields.bits.residual_colour_transform_flag   = h->sps.residual_color_transform_flag; /* XXX: only for 4:4:4 high profile? */
-    pic_param->seq_fields.bits.gaps_in_frame_num_value_allowed_flag = h->sps.gaps_in_frame_num_allowed_flag;
-    pic_param->seq_fields.bits.frame_mbs_only_flag              = h->sps.frame_mbs_only_flag;
-    pic_param->seq_fields.bits.mb_adaptive_frame_field_flag     = h->sps.mb_aff;
-    pic_param->seq_fields.bits.direct_8x8_inference_flag        = h->sps.direct_8x8_inference_flag;
-    pic_param->seq_fields.bits.MinLumaBiPredSize8x8             = h->sps.level_idc >= 31; /* A.3.3.2 */
-    pic_param->seq_fields.bits.log2_max_frame_num_minus4        = h->sps.log2_max_frame_num - 4;
-    pic_param->seq_fields.bits.pic_order_cnt_type               = h->sps.poc_type;
-    pic_param->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 = h->sps.log2_max_poc_lsb - 4;
-    pic_param->seq_fields.bits.delta_pic_order_always_zero_flag = h->sps.delta_pic_order_always_zero_flag;
-    pic_param->num_slice_groups_minus1                          = h->pps.slice_group_count - 1;
-    pic_param->slice_group_map_type                             = h->pps.mb_slice_group_map_type;
-    pic_param->slice_group_change_rate_minus1                   = 0; /* XXX: unimplemented in Libav */
-    pic_param->pic_init_qp_minus26                              = h->pps.init_qp - 26;
-    pic_param->pic_init_qs_minus26                              = h->pps.init_qs - 26;
-    pic_param->chroma_qp_index_offset                           = h->pps.chroma_qp_index_offset[0];
-    pic_param->second_chroma_qp_index_offset                    = h->pps.chroma_qp_index_offset[1];
-    pic_param->pic_fields.value                                 = 0; /* reset all bits */
-    pic_param->pic_fields.bits.entropy_coding_mode_flag         = h->pps.cabac;
-    pic_param->pic_fields.bits.weighted_pred_flag               = h->pps.weighted_pred;
-    pic_param->pic_fields.bits.weighted_bipred_idc              = h->pps.weighted_bipred_idc;
-    pic_param->pic_fields.bits.transform_8x8_mode_flag          = h->pps.transform_8x8_mode;
-    pic_param->pic_fields.bits.field_pic_flag                   = h->picture_structure != PICT_FRAME;
-    pic_param->pic_fields.bits.constrained_intra_pred_flag      = h->pps.constrained_intra_pred;
-    pic_param->pic_fields.bits.pic_order_present_flag           = h->pps.pic_order_present;
-    pic_param->pic_fields.bits.deblocking_filter_control_present_flag = h->pps.deblocking_filter_parameters_present;
-    pic_param->pic_fields.bits.redundant_pic_cnt_present_flag   = h->pps.redundant_pic_cnt_present;
-    pic_param->pic_fields.bits.reference_pic_flag               = h->nal_ref_idc != 0;
-    pic_param->frame_num                                        = h->frame_num;
-
-    /* Fill in VAIQMatrixBufferH264. */
-    iq_matrix = ff_vaapi_alloc_iq_matrix(vactx, sizeof(VAIQMatrixBufferH264));
-    if (!iq_matrix)
-        return -1;
-    memcpy(iq_matrix->ScalingList4x4, h->pps.scaling_matrix4, sizeof(iq_matrix->ScalingList4x4));
-    memcpy(iq_matrix->ScalingList8x8, h->pps.scaling_matrix8, sizeof(iq_matrix->ScalingList8x8));
-    return 0;
-}
-
-/** End a hardware decoding based frame. */
-static int vaapi_h264_end_frame(AVCodecContext *avctx)
-{
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
-    H264Context * const h = avctx->priv_data;
-    int ret;
-
-    av_dlog(avctx, "vaapi_h264_end_frame()\n");
-    ret = ff_vaapi_commit_slices(vactx);
-    if (ret < 0)
-        goto finish;
-
-    ret = ff_vaapi_render_picture(vactx, ff_vaapi_get_surface_id(h->cur_pic_ptr));
-    if (ret < 0)
-        goto finish;
-
-    ff_h264_draw_horiz_band(h, 0, h->avctx->height);
-
-finish:
-    ff_vaapi_common_end_frame(avctx);
-    return ret;
-}
-
-/** Decode the given H.264 slice with VA API. */
-static int vaapi_h264_decode_slice(AVCodecContext *avctx,
-                                   const uint8_t  *buffer,
-                                   uint32_t        size)
-{
-    H264Context * const h = avctx->priv_data;
-    VASliceParameterBufferH264 *slice_param;
-
-    av_dlog(avctx, "vaapi_h264_decode_slice(): buffer %p, size %d\n",
-            buffer, size);
-
-    /* Fill in VASliceParameterBufferH264. */
-    slice_param = (VASliceParameterBufferH264 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
-    if (!slice_param)
-        return -1;
-    slice_param->slice_data_bit_offset          = get_bits_count(&h->gb) + 8; /* bit buffer started beyond nal_unit_type */
-    slice_param->first_mb_in_slice              = (h->mb_y >> FIELD_OR_MBAFF_PICTURE(h)) * h->mb_width + h->mb_x;
-    slice_param->slice_type                     = ff_h264_get_slice_type(h);
-    slice_param->direct_spatial_mv_pred_flag    = h->slice_type == AV_PICTURE_TYPE_B ? h->direct_spatial_mv_pred : 0;
-    slice_param->num_ref_idx_l0_active_minus1   = h->list_count > 0 ? h->ref_count[0] - 1 : 0;
-    slice_param->num_ref_idx_l1_active_minus1   = h->list_count > 1 ? h->ref_count[1] - 1 : 0;
-    slice_param->cabac_init_idc                 = h->cabac_init_idc;
-    slice_param->slice_qp_delta                 = h->qscale - h->pps.init_qp;
-    slice_param->disable_deblocking_filter_idc  = h->deblocking_filter < 2 ? !h->deblocking_filter : h->deblocking_filter;
-    slice_param->slice_alpha_c0_offset_div2     = h->slice_alpha_c0_offset / 2 - 26;
-    slice_param->slice_beta_offset_div2         = h->slice_beta_offset     / 2 - 26;
-    slice_param->luma_log2_weight_denom         = h->luma_log2_weight_denom;
-    slice_param->chroma_log2_weight_denom       = h->chroma_log2_weight_denom;
-
-    fill_vaapi_RefPicList(slice_param->RefPicList0, h->ref_list[0], h->list_count > 0 ? h->ref_count[0] : 0);
-    fill_vaapi_RefPicList(slice_param->RefPicList1, h->ref_list[1], h->list_count > 1 ? h->ref_count[1] : 0);
-
-    fill_vaapi_plain_pred_weight_table(h, 0,
-                                       &slice_param->luma_weight_l0_flag,   slice_param->luma_weight_l0,   slice_param->luma_offset_l0,
-                                       &slice_param->chroma_weight_l0_flag, slice_param->chroma_weight_l0, slice_param->chroma_offset_l0);
-    fill_vaapi_plain_pred_weight_table(h, 1,
-                                       &slice_param->luma_weight_l1_flag,   slice_param->luma_weight_l1,   slice_param->luma_offset_l1,
-                                       &slice_param->chroma_weight_l1_flag, slice_param->chroma_weight_l1, slice_param->chroma_offset_l1);
-    return 0;
-}
-
-AVHWAccel ff_h264_vaapi_hwaccel = {
-    .name           = "h264_vaapi",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H264,
-    .pix_fmt        = AV_PIX_FMT_VAAPI_VLD,
-    .start_frame    = vaapi_h264_start_frame,
-    .end_frame      = vaapi_h264_end_frame,
-    .decode_slice   = vaapi_h264_decode_slice,
-};
diff --git a/deps/libav/libavcodec/vaapi_internal.h b/deps/libav/libavcodec/vaapi_internal.h
deleted file mode 100644
index 0292654..0000000
--- a/deps/libav/libavcodec/vaapi_internal.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Video Acceleration API (video decoding)
- * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
- *
- * Copyright (C) 2008-2009 Splitted-Desktop Systems
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VAAPI_INTERNAL_H
-#define AVCODEC_VAAPI_INTERNAL_H
-
-#include <va/va.h>
-#include "vaapi.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-
-/**
- * @addtogroup VAAPI_Decoding
- *
- * @{
- */
-
-/** Extract VASurfaceID from a Picture */
-static inline VASurfaceID ff_vaapi_get_surface_id(Picture *pic)
-{
-    return (uintptr_t)pic->f.data[3];
-}
-
-/** Common AVHWAccel.end_frame() implementation */
-void ff_vaapi_common_end_frame(AVCodecContext *avctx);
-
-/** Allocate a new picture parameter buffer */
-void *ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size);
-
-/** Allocate a new IQ matrix buffer */
-void *ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size);
-
-/** Allocate a new bit-plane buffer */
-uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size);
-
-/**
- * Allocate a new slice descriptor for the input slice.
- *
- * @param vactx the VA API context
- * @param buffer the slice data buffer base
- * @param size the size of the slice in bytes
- * @return the newly allocated slice parameter
- */
-VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context *vactx, const uint8_t *buffer, uint32_t size);
-
-int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx);
-int ff_vaapi_commit_slices(struct vaapi_context *vactx);
-int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface);
-
-/* @} */
-
-#endif /* AVCODEC_VAAPI_INTERNAL_H */
diff --git a/deps/libav/libavcodec/vaapi_mpeg2.c b/deps/libav/libavcodec/vaapi_mpeg2.c
deleted file mode 100644
index cf0a4b5..0000000
--- a/deps/libav/libavcodec/vaapi_mpeg2.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * MPEG-2 HW decode acceleration through VA API
- *
- * Copyright (C) 2008-2009 Splitted-Desktop Systems
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "vaapi_internal.h"
-
-/** Reconstruct bitstream f_code */
-static inline int mpeg2_get_f_code(MpegEncContext *s)
-{
-    return (s->mpeg_f_code[0][0] << 12) | (s->mpeg_f_code[0][1] << 8) |
-           (s->mpeg_f_code[1][0] <<  4) |  s->mpeg_f_code[1][1];
-}
-
-/** Determine frame start: first field for field picture or frame picture */
-static inline int mpeg2_get_is_frame_start(MpegEncContext *s)
-{
-    return s->first_field || s->picture_structure == PICT_FRAME;
-}
-
-static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
-{
-    struct MpegEncContext * const s = avctx->priv_data;
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
-    VAPictureParameterBufferMPEG2 *pic_param;
-    VAIQMatrixBufferMPEG2 *iq_matrix;
-    int i;
-
-    av_dlog(avctx, "vaapi_mpeg2_start_frame()\n");
-
-    vactx->slice_param_size = sizeof(VASliceParameterBufferMPEG2);
-
-    /* Fill in VAPictureParameterBufferMPEG2 */
-    pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VAPictureParameterBufferMPEG2));
-    if (!pic_param)
-        return -1;
-    pic_param->horizontal_size                                  = s->width;
-    pic_param->vertical_size                                    = s->height;
-    pic_param->forward_reference_picture                        = VA_INVALID_ID;
-    pic_param->backward_reference_picture                       = VA_INVALID_ID;
-    pic_param->picture_coding_type                              = s->pict_type;
-    pic_param->f_code                                           = mpeg2_get_f_code(s);
-    pic_param->picture_coding_extension.value                   = 0; /* reset all bits */
-    pic_param->picture_coding_extension.bits.intra_dc_precision = s->intra_dc_precision;
-    pic_param->picture_coding_extension.bits.picture_structure  = s->picture_structure;
-    pic_param->picture_coding_extension.bits.top_field_first    = s->top_field_first;
-    pic_param->picture_coding_extension.bits.frame_pred_frame_dct = s->frame_pred_frame_dct;
-    pic_param->picture_coding_extension.bits.concealment_motion_vectors = s->concealment_motion_vectors;
-    pic_param->picture_coding_extension.bits.q_scale_type       = s->q_scale_type;
-    pic_param->picture_coding_extension.bits.intra_vlc_format   = s->intra_vlc_format;
-    pic_param->picture_coding_extension.bits.alternate_scan     = s->alternate_scan;
-    pic_param->picture_coding_extension.bits.repeat_first_field = s->repeat_first_field;
-    pic_param->picture_coding_extension.bits.progressive_frame  = s->progressive_frame;
-    pic_param->picture_coding_extension.bits.is_first_field     = mpeg2_get_is_frame_start(s);
-
-    switch (s->pict_type) {
-    case AV_PICTURE_TYPE_B:
-        pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
-        // fall-through
-    case AV_PICTURE_TYPE_P:
-        pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
-        break;
-    }
-
-    /* Fill in VAIQMatrixBufferMPEG2 */
-    iq_matrix = ff_vaapi_alloc_iq_matrix(vactx, sizeof(VAIQMatrixBufferMPEG2));
-    if (!iq_matrix)
-        return -1;
-    iq_matrix->load_intra_quantiser_matrix              = 1;
-    iq_matrix->load_non_intra_quantiser_matrix          = 1;
-    iq_matrix->load_chroma_intra_quantiser_matrix       = 1;
-    iq_matrix->load_chroma_non_intra_quantiser_matrix   = 1;
-
-    for (i = 0; i < 64; i++) {
-        int n = s->dsp.idct_permutation[ff_zigzag_direct[i]];
-        iq_matrix->intra_quantiser_matrix[i]            = s->intra_matrix[n];
-        iq_matrix->non_intra_quantiser_matrix[i]        = s->inter_matrix[n];
-        iq_matrix->chroma_intra_quantiser_matrix[i]     = s->chroma_intra_matrix[n];
-        iq_matrix->chroma_non_intra_quantiser_matrix[i] = s->chroma_inter_matrix[n];
-    }
-    return 0;
-}
-
-static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
-{
-    MpegEncContext * const s = avctx->priv_data;
-    VASliceParameterBufferMPEG2 *slice_param;
-    GetBitContext gb;
-    uint32_t quantiser_scale_code, intra_slice_flag, macroblock_offset;
-
-    av_dlog(avctx, "vaapi_mpeg2_decode_slice(): buffer %p, size %d\n", buffer, size);
-
-    /* Determine macroblock_offset */
-    init_get_bits(&gb, buffer, 8 * size);
-    if (get_bits_long(&gb, 32) >> 8 != 1) /* start code */
-        return AVERROR_INVALIDDATA;
-    quantiser_scale_code = get_bits(&gb, 5);
-    intra_slice_flag = get_bits1(&gb);
-    if (intra_slice_flag) {
-        skip_bits(&gb, 8);
-        while (get_bits1(&gb) != 0)
-            skip_bits(&gb, 8);
-    }
-    macroblock_offset = get_bits_count(&gb);
-
-    /* Fill in VASliceParameterBufferMPEG2 */
-    slice_param = (VASliceParameterBufferMPEG2 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
-    if (!slice_param)
-        return -1;
-    slice_param->macroblock_offset              = macroblock_offset;
-    slice_param->slice_horizontal_position      = s->mb_x;
-    slice_param->slice_vertical_position        = s->mb_y >> (s->picture_structure != PICT_FRAME);
-    slice_param->quantiser_scale_code           = quantiser_scale_code;
-    slice_param->intra_slice_flag               = intra_slice_flag;
-    return 0;
-}
-
-AVHWAccel ff_mpeg2_vaapi_hwaccel = {
-    .name           = "mpeg2_vaapi",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG2VIDEO,
-    .pix_fmt        = AV_PIX_FMT_VAAPI_VLD,
-    .start_frame    = vaapi_mpeg2_start_frame,
-    .end_frame      = ff_vaapi_mpeg_end_frame,
-    .decode_slice   = vaapi_mpeg2_decode_slice,
-};
diff --git a/deps/libav/libavcodec/vaapi_mpeg4.c b/deps/libav/libavcodec/vaapi_mpeg4.c
deleted file mode 100644
index b771482..0000000
--- a/deps/libav/libavcodec/vaapi_mpeg4.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * MPEG-4 / H.263 HW decode acceleration through VA API
- *
- * Copyright (C) 2008-2009 Splitted-Desktop Systems
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "vaapi_internal.h"
-#include "h263.h"
-#include "mpeg4video.h"
-
-/** Reconstruct bitstream intra_dc_vlc_thr */
-static int mpeg4_get_intra_dc_vlc_thr(Mpeg4DecContext *s)
-{
-    switch (s->intra_dc_threshold) {
-    case 99: return 0;
-    case 13: return 1;
-    case 15: return 2;
-    case 17: return 3;
-    case 19: return 4;
-    case 21: return 5;
-    case 23: return 6;
-    case 0:  return 7;
-    }
-    return 0;
-}
-
-static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
-{
-    Mpeg4DecContext *ctx = avctx->priv_data;
-    MpegEncContext * const s = &ctx->m;
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
-    VAPictureParameterBufferMPEG4 *pic_param;
-    VAIQMatrixBufferMPEG4 *iq_matrix;
-    int i;
-
-    av_dlog(avctx, "vaapi_mpeg4_start_frame()\n");
-
-    vactx->slice_param_size = sizeof(VASliceParameterBufferMPEG4);
-
-    /* Fill in VAPictureParameterBufferMPEG4 */
-    pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VAPictureParameterBufferMPEG4));
-    if (!pic_param)
-        return -1;
-    pic_param->vop_width                                = s->width;
-    pic_param->vop_height                               = s->height;
-    pic_param->forward_reference_picture                = VA_INVALID_ID;
-    pic_param->backward_reference_picture               = VA_INVALID_ID;
-    pic_param->vol_fields.value                         = 0; /* reset all bits */
-    pic_param->vol_fields.bits.short_video_header       = avctx->codec->id == AV_CODEC_ID_H263;
-    pic_param->vol_fields.bits.chroma_format            = CHROMA_420;
-    pic_param->vol_fields.bits.interlaced               = !s->progressive_sequence;
-    pic_param->vol_fields.bits.obmc_disable             = 1;
-    pic_param->vol_fields.bits.sprite_enable            = ctx->vol_sprite_usage;
-    pic_param->vol_fields.bits.sprite_warping_accuracy  = s->sprite_warping_accuracy;
-    pic_param->vol_fields.bits.quant_type               = s->mpeg_quant;
-    pic_param->vol_fields.bits.quarter_sample           = s->quarter_sample;
-    pic_param->vol_fields.bits.data_partitioned         = s->data_partitioning;
-    pic_param->vol_fields.bits.reversible_vlc           = ctx->rvlc;
-    pic_param->vol_fields.bits.resync_marker_disable    = !ctx->resync_marker;
-    pic_param->no_of_sprite_warping_points              = ctx->num_sprite_warping_points;
-    for (i = 0; i < ctx->num_sprite_warping_points && i < 3; i++) {
-        pic_param->sprite_trajectory_du[i]              = ctx->sprite_traj[i][0];
-        pic_param->sprite_trajectory_dv[i]              = ctx->sprite_traj[i][1];
-    }
-    pic_param->quant_precision                          = s->quant_precision;
-    pic_param->vop_fields.value                         = 0; /* reset all bits */
-    pic_param->vop_fields.bits.vop_coding_type          = s->pict_type - AV_PICTURE_TYPE_I;
-    pic_param->vop_fields.bits.backward_reference_vop_coding_type = s->pict_type == AV_PICTURE_TYPE_B ? s->next_picture.f.pict_type - AV_PICTURE_TYPE_I : 0;
-    pic_param->vop_fields.bits.vop_rounding_type        = s->no_rounding;
-    pic_param->vop_fields.bits.intra_dc_vlc_thr         = mpeg4_get_intra_dc_vlc_thr(ctx);
-    pic_param->vop_fields.bits.top_field_first          = s->top_field_first;
-    pic_param->vop_fields.bits.alternate_vertical_scan_flag = s->alternate_scan;
-    pic_param->vop_fcode_forward                        = s->f_code;
-    pic_param->vop_fcode_backward                       = s->b_code;
-    pic_param->vop_time_increment_resolution            = avctx->time_base.den;
-    pic_param->num_macroblocks_in_gob                   = s->mb_width * ff_h263_get_gob_height(s);
-    pic_param->num_gobs_in_vop                          = (s->mb_width * s->mb_height) / pic_param->num_macroblocks_in_gob;
-    pic_param->TRB                                      = s->pb_time;
-    pic_param->TRD                                      = s->pp_time;
-
-    if (s->pict_type == AV_PICTURE_TYPE_B)
-        pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
-    if (s->pict_type != AV_PICTURE_TYPE_I)
-        pic_param->forward_reference_picture  = ff_vaapi_get_surface_id(&s->last_picture);
-
-    /* Fill in VAIQMatrixBufferMPEG4 */
-    /* Only the first inverse quantisation method uses the weighting matrices */
-    if (pic_param->vol_fields.bits.quant_type) {
-        iq_matrix = ff_vaapi_alloc_iq_matrix(vactx, sizeof(VAIQMatrixBufferMPEG4));
-        if (!iq_matrix)
-            return -1;
-        iq_matrix->load_intra_quant_mat         = 1;
-        iq_matrix->load_non_intra_quant_mat     = 1;
-
-        for (i = 0; i < 64; i++) {
-            int n = s->dsp.idct_permutation[ff_zigzag_direct[i]];
-            iq_matrix->intra_quant_mat[i]       = s->intra_matrix[n];
-            iq_matrix->non_intra_quant_mat[i]   = s->inter_matrix[n];
-        }
-    }
-    return 0;
-}
-
-static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
-{
-    MpegEncContext * const s = avctx->priv_data;
-    VASliceParameterBufferMPEG4 *slice_param;
-
-    av_dlog(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
-
-    /* video_plane_with_short_video_header() contains all GOBs
-     * in-order, and this is what VA API (Intel backend) expects: only
-     * a single slice param. So fake macroblock_number for Libav so
-     * that we don't call vaapi_mpeg4_decode_slice() again
-     */
-    if (avctx->codec->id == AV_CODEC_ID_H263)
-        size = s->gb.buffer_end - buffer;
-
-    /* Fill in VASliceParameterBufferMPEG4 */
-    slice_param = (VASliceParameterBufferMPEG4 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
-    if (!slice_param)
-        return -1;
-    slice_param->macroblock_offset      = get_bits_count(&s->gb) % 8;
-    slice_param->macroblock_number      = s->mb_y * s->mb_width + s->mb_x;
-    slice_param->quant_scale            = s->qscale;
-
-    if (avctx->codec->id == AV_CODEC_ID_H263)
-        s->mb_y = s->mb_height;
-
-    return 0;
-}
-
-#if CONFIG_MPEG4_VAAPI_HWACCEL
-AVHWAccel ff_mpeg4_vaapi_hwaccel = {
-    .name           = "mpeg4_vaapi",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG4,
-    .pix_fmt        = AV_PIX_FMT_VAAPI_VLD,
-    .start_frame    = vaapi_mpeg4_start_frame,
-    .end_frame      = ff_vaapi_mpeg_end_frame,
-    .decode_slice   = vaapi_mpeg4_decode_slice,
-};
-#endif
-
-#if CONFIG_H263_VAAPI_HWACCEL
-AVHWAccel ff_h263_vaapi_hwaccel = {
-    .name           = "h263_vaapi",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H263,
-    .pix_fmt        = AV_PIX_FMT_VAAPI_VLD,
-    .start_frame    = vaapi_mpeg4_start_frame,
-    .end_frame      = ff_vaapi_mpeg_end_frame,
-    .decode_slice   = vaapi_mpeg4_decode_slice,
-};
-#endif
diff --git a/deps/libav/libavcodec/vaapi_vc1.c b/deps/libav/libavcodec/vaapi_vc1.c
deleted file mode 100644
index 50cba16..0000000
--- a/deps/libav/libavcodec/vaapi_vc1.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * VC-1 HW decode acceleration through VA API
- *
- * Copyright (C) 2008-2009 Splitted-Desktop Systems
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "vaapi_internal.h"
-#include "vc1.h"
-#include "vc1data.h"
-
-/** Translate Libav MV modes to VA API */
-static int get_VAMvModeVC1(enum MVModes mv_mode)
-{
-    switch (mv_mode) {
-    case MV_PMODE_1MV_HPEL_BILIN: return VAMvMode1MvHalfPelBilinear;
-    case MV_PMODE_1MV:            return VAMvMode1Mv;
-    case MV_PMODE_1MV_HPEL:       return VAMvMode1MvHalfPel;
-    case MV_PMODE_MIXED_MV:       return VAMvModeMixedMv;
-    case MV_PMODE_INTENSITY_COMP: return VAMvModeIntensityCompensation;
-    }
-    return 0;
-}
-
-/** Check whether the MVTYPEMB bitplane is present */
-static inline int vc1_has_MVTYPEMB_bitplane(VC1Context *v)
-{
-    if (v->mv_type_is_raw)
-        return 0;
-    return v->s.pict_type == AV_PICTURE_TYPE_P &&
-           (v->mv_mode == MV_PMODE_MIXED_MV ||
-            (v->mv_mode == MV_PMODE_INTENSITY_COMP &&
-             v->mv_mode2 == MV_PMODE_MIXED_MV));
-}
-
-/** Check whether the SKIPMB bitplane is present */
-static inline int vc1_has_SKIPMB_bitplane(VC1Context *v)
-{
-    if (v->skip_is_raw)
-        return 0;
-    return v->s.pict_type == AV_PICTURE_TYPE_P ||
-           (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type);
-}
-
-/** Check whether the DIRECTMB bitplane is present */
-static inline int vc1_has_DIRECTMB_bitplane(VC1Context *v)
-{
-    if (v->dmb_is_raw)
-        return 0;
-    return v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type;
-}
-
-/** Check whether the ACPRED bitplane is present */
-static inline int vc1_has_ACPRED_bitplane(VC1Context *v)
-{
-    if (v->acpred_is_raw)
-        return 0;
-    return v->profile == PROFILE_ADVANCED &&
-           (v->s.pict_type == AV_PICTURE_TYPE_I ||
-            (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type));
-}
-
-/** Check whether the OVERFLAGS bitplane is present */
-static inline int vc1_has_OVERFLAGS_bitplane(VC1Context *v)
-{
-    if (v->overflg_is_raw)
-        return 0;
-    return v->profile == PROFILE_ADVANCED &&
-           (v->s.pict_type == AV_PICTURE_TYPE_I ||
-            (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type)) &&
-           (v->overlap && v->pq <= 8) &&
-           v->condover == CONDOVER_SELECT;
-}
-
-/** Reconstruct bitstream PTYPE (7.1.1.4, index into Table-35) */
-static int vc1_get_PTYPE(VC1Context *v)
-{
-    MpegEncContext * const s = &v->s;
-    switch (s->pict_type) {
-    case AV_PICTURE_TYPE_I: return 0;
-    case AV_PICTURE_TYPE_P: return v->p_frame_skipped ? 4 : 1;
-    case AV_PICTURE_TYPE_B: return v->bi_type         ? 3 : 2;
-    }
-    return 0;
-}
-
-/** Reconstruct bitstream MVMODE (7.1.1.32) */
-static inline VAMvModeVC1 vc1_get_MVMODE(VC1Context *v)
-{
-    if (v->s.pict_type == AV_PICTURE_TYPE_P ||
-        (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type))
-        return get_VAMvModeVC1(v->mv_mode);
-    return 0;
-}
-
-/** Reconstruct bitstream MVMODE2 (7.1.1.33) */
-static inline VAMvModeVC1 vc1_get_MVMODE2(VC1Context *v)
-{
-    if (v->s.pict_type == AV_PICTURE_TYPE_P && v->mv_mode == MV_PMODE_INTENSITY_COMP)
-        return get_VAMvModeVC1(v->mv_mode2);
-    return 0;
-}
-
-/** Reconstruct bitstream TTFRM (7.1.1.41, Table-53) */
-static inline int vc1_get_TTFRM(VC1Context *v)
-{
-    switch (v->ttfrm) {
-    case TT_8X8: return 0;
-    case TT_8X4: return 1;
-    case TT_4X8: return 2;
-    case TT_4X4: return 3;
-    }
-    return 0;
-}
-
-/** Pack Libav bitplanes into a VABitPlaneBuffer element */
-static inline void vc1_pack_bitplanes(uint8_t *bitplane, int n, const uint8_t *ff_bp[3], int x, int y, int stride)
-{
-    const int bitplane_index = n / 2;
-    const int ff_bp_index = y * stride + x;
-    uint8_t v = 0;
-    if (ff_bp[0])
-        v = ff_bp[0][ff_bp_index];
-    if (ff_bp[1])
-        v |= ff_bp[1][ff_bp_index] << 1;
-    if (ff_bp[2])
-        v |= ff_bp[2][ff_bp_index] << 2;
-    bitplane[bitplane_index] = (bitplane[bitplane_index] << 4) | v;
-}
-
-static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
-{
-    VC1Context * const v = avctx->priv_data;
-    MpegEncContext * const s = &v->s;
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
-    VAPictureParameterBufferVC1 *pic_param;
-
-    av_dlog(avctx, "vaapi_vc1_start_frame()\n");
-
-    vactx->slice_param_size = sizeof(VASliceParameterBufferVC1);
-
-    /* Fill in VAPictureParameterBufferVC1 */
-    pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VAPictureParameterBufferVC1));
-    if (!pic_param)
-        return -1;
-    pic_param->forward_reference_picture                            = VA_INVALID_ID;
-    pic_param->backward_reference_picture                           = VA_INVALID_ID;
-    pic_param->inloop_decoded_picture                               = VA_INVALID_ID;
-    pic_param->sequence_fields.value                                = 0; /* reset all bits */
-    pic_param->sequence_fields.bits.pulldown                        = v->broadcast;
-    pic_param->sequence_fields.bits.interlace                       = v->interlace;
-    pic_param->sequence_fields.bits.tfcntrflag                      = v->tfcntrflag;
-    pic_param->sequence_fields.bits.finterpflag                     = v->finterpflag;
-    pic_param->sequence_fields.bits.psf                             = v->psf;
-    pic_param->sequence_fields.bits.multires                        = v->multires;
-    pic_param->sequence_fields.bits.overlap                         = v->overlap;
-    pic_param->sequence_fields.bits.syncmarker                      = v->resync_marker;
-    pic_param->sequence_fields.bits.rangered                        = v->rangered;
-    pic_param->sequence_fields.bits.max_b_frames                    = s->avctx->max_b_frames;
-#if VA_CHECK_VERSION(0,32,0)
-    pic_param->sequence_fields.bits.profile                         = v->profile;
-#endif
-    pic_param->coded_width                                          = s->avctx->coded_width;
-    pic_param->coded_height                                         = s->avctx->coded_height;
-    pic_param->entrypoint_fields.value                              = 0; /* reset all bits */
-    pic_param->entrypoint_fields.bits.broken_link                   = v->broken_link;
-    pic_param->entrypoint_fields.bits.closed_entry                  = v->closed_entry;
-    pic_param->entrypoint_fields.bits.panscan_flag                  = v->panscanflag;
-    pic_param->entrypoint_fields.bits.loopfilter                    = s->loop_filter;
-    pic_param->conditional_overlap_flag                             = v->condover;
-    pic_param->fast_uvmc_flag                                       = v->fastuvmc;
-    pic_param->range_mapping_fields.value                           = 0; /* reset all bits */
-    pic_param->range_mapping_fields.bits.luma_flag                  = v->range_mapy_flag;
-    pic_param->range_mapping_fields.bits.luma                       = v->range_mapy;
-    pic_param->range_mapping_fields.bits.chroma_flag                = v->range_mapuv_flag;
-    pic_param->range_mapping_fields.bits.chroma                     = v->range_mapuv;
-    pic_param->b_picture_fraction                                   = v->bfraction_lut_index;
-    pic_param->cbp_table                                            = v->cbpcy_vlc ? v->cbpcy_vlc - ff_vc1_cbpcy_p_vlc : 0;
-    pic_param->mb_mode_table                                        = 0; /* XXX: interlaced frame */
-    pic_param->range_reduction_frame                                = v->rangeredfrm;
-    pic_param->rounding_control                                     = v->rnd;
-    pic_param->post_processing                                      = v->postproc;
-    pic_param->picture_resolution_index                             = v->respic;
-    pic_param->luma_scale                                           = v->lumscale;
-    pic_param->luma_shift                                           = v->lumshift;
-    pic_param->picture_fields.value                                 = 0; /* reset all bits */
-    pic_param->picture_fields.bits.picture_type                     = vc1_get_PTYPE(v);
-    pic_param->picture_fields.bits.frame_coding_mode                = v->fcm;
-    pic_param->picture_fields.bits.top_field_first                  = v->tff;
-    pic_param->picture_fields.bits.is_first_field                   = v->fcm == 0; /* XXX: interlaced frame */
-    pic_param->picture_fields.bits.intensity_compensation           = v->mv_mode == MV_PMODE_INTENSITY_COMP;
-    pic_param->raw_coding.value                                     = 0; /* reset all bits */
-    pic_param->raw_coding.flags.mv_type_mb                          = v->mv_type_is_raw;
-    pic_param->raw_coding.flags.direct_mb                           = v->dmb_is_raw;
-    pic_param->raw_coding.flags.skip_mb                             = v->skip_is_raw;
-    pic_param->raw_coding.flags.field_tx                            = 0; /* XXX: interlaced frame */
-    pic_param->raw_coding.flags.forward_mb                          = 0; /* XXX: interlaced frame */
-    pic_param->raw_coding.flags.ac_pred                             = v->acpred_is_raw;
-    pic_param->raw_coding.flags.overflags                           = v->overflg_is_raw;
-    pic_param->bitplane_present.value                               = 0; /* reset all bits */
-    pic_param->bitplane_present.flags.bp_mv_type_mb                 = vc1_has_MVTYPEMB_bitplane(v);
-    pic_param->bitplane_present.flags.bp_direct_mb                  = vc1_has_DIRECTMB_bitplane(v);
-    pic_param->bitplane_present.flags.bp_skip_mb                    = vc1_has_SKIPMB_bitplane(v);
-    pic_param->bitplane_present.flags.bp_field_tx                   = 0; /* XXX: interlaced frame */
-    pic_param->bitplane_present.flags.bp_forward_mb                 = 0; /* XXX: interlaced frame */
-    pic_param->bitplane_present.flags.bp_ac_pred                    = vc1_has_ACPRED_bitplane(v);
-    pic_param->bitplane_present.flags.bp_overflags                  = vc1_has_OVERFLAGS_bitplane(v);
-    pic_param->reference_fields.value                               = 0; /* reset all bits */
-    pic_param->reference_fields.bits.reference_distance_flag        = v->refdist_flag;
-    pic_param->reference_fields.bits.reference_distance             = 0; /* XXX: interlaced frame */
-    pic_param->reference_fields.bits.num_reference_pictures         = 0; /* XXX: interlaced frame */
-    pic_param->reference_fields.bits.reference_field_pic_indicator  = 0; /* XXX: interlaced frame */
-    pic_param->mv_fields.value                                      = 0; /* reset all bits */
-    pic_param->mv_fields.bits.mv_mode                               = vc1_get_MVMODE(v);
-    pic_param->mv_fields.bits.mv_mode2                              = vc1_get_MVMODE2(v);
-    pic_param->mv_fields.bits.mv_table                              = s->mv_table_index;
-    pic_param->mv_fields.bits.two_mv_block_pattern_table            = 0; /* XXX: interlaced frame */
-    pic_param->mv_fields.bits.four_mv_switch                        = 0; /* XXX: interlaced frame */
-    pic_param->mv_fields.bits.four_mv_block_pattern_table           = 0; /* XXX: interlaced frame */
-    pic_param->mv_fields.bits.extended_mv_flag                      = v->extended_mv;
-    pic_param->mv_fields.bits.extended_mv_range                     = v->mvrange;
-    pic_param->mv_fields.bits.extended_dmv_flag                     = v->extended_dmv;
-    pic_param->mv_fields.bits.extended_dmv_range                    = 0; /* XXX: interlaced frame */
-    pic_param->pic_quantizer_fields.value                           = 0; /* reset all bits */
-    pic_param->pic_quantizer_fields.bits.dquant                     = v->dquant;
-    pic_param->pic_quantizer_fields.bits.quantizer                  = v->quantizer_mode;
-    pic_param->pic_quantizer_fields.bits.half_qp                    = v->halfpq;
-    pic_param->pic_quantizer_fields.bits.pic_quantizer_scale        = v->pq;
-    pic_param->pic_quantizer_fields.bits.pic_quantizer_type         = v->pquantizer;
-    pic_param->pic_quantizer_fields.bits.dq_frame                   = v->dquantfrm;
-    pic_param->pic_quantizer_fields.bits.dq_profile                 = v->dqprofile;
-    pic_param->pic_quantizer_fields.bits.dq_sb_edge                 = v->dqprofile == DQPROFILE_SINGLE_EDGE  ? v->dqsbedge : 0;
-    pic_param->pic_quantizer_fields.bits.dq_db_edge                 = v->dqprofile == DQPROFILE_DOUBLE_EDGES ? v->dqsbedge : 0;
-    pic_param->pic_quantizer_fields.bits.dq_binary_level            = v->dqbilevel;
-    pic_param->pic_quantizer_fields.bits.alt_pic_quantizer          = v->altpq;
-    pic_param->transform_fields.value                               = 0; /* reset all bits */
-    pic_param->transform_fields.bits.variable_sized_transform_flag  = v->vstransform;
-    pic_param->transform_fields.bits.mb_level_transform_type_flag   = v->ttmbf;
-    pic_param->transform_fields.bits.frame_level_transform_type     = vc1_get_TTFRM(v);
-    pic_param->transform_fields.bits.transform_ac_codingset_idx1    = v->c_ac_table_index;
-    pic_param->transform_fields.bits.transform_ac_codingset_idx2    = v->y_ac_table_index;
-    pic_param->transform_fields.bits.intra_transform_dc_table       = v->s.dc_table_index;
-
-    switch (s->pict_type) {
-    case AV_PICTURE_TYPE_B:
-        pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
-        // fall-through
-    case AV_PICTURE_TYPE_P:
-        pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
-        break;
-    }
-
-    if (pic_param->bitplane_present.value) {
-        uint8_t *bitplane;
-        const uint8_t *ff_bp[3];
-        int x, y, n;
-
-        switch (s->pict_type) {
-        case AV_PICTURE_TYPE_P:
-            ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb  ? v->direct_mb_plane    : NULL;
-            ff_bp[1] = pic_param->bitplane_present.flags.bp_skip_mb    ? s->mbskip_table       : NULL;
-            ff_bp[2] = pic_param->bitplane_present.flags.bp_mv_type_mb ? v->mv_type_mb_plane   : NULL;
-            break;
-        case AV_PICTURE_TYPE_B:
-            if (!v->bi_type) {
-                ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL;
-                ff_bp[1] = pic_param->bitplane_present.flags.bp_skip_mb   ? s->mbskip_table    : NULL;
-                ff_bp[2] = NULL; /* XXX: interlaced frame (FORWARD plane) */
-                break;
-            }
-            /* fall-through (BI-type) */
-        case AV_PICTURE_TYPE_I:
-            ff_bp[0] = NULL; /* XXX: interlaced frame (FIELDTX plane) */
-            ff_bp[1] = pic_param->bitplane_present.flags.bp_ac_pred    ? v->acpred_plane       : NULL;
-            ff_bp[2] = pic_param->bitplane_present.flags.bp_overflags  ? v->over_flags_plane   : NULL;
-            break;
-        default:
-            ff_bp[0] = NULL;
-            ff_bp[1] = NULL;
-            ff_bp[2] = NULL;
-            break;
-        }
-
-        bitplane = ff_vaapi_alloc_bitplane(vactx, (s->mb_width * s->mb_height + 1) / 2);
-        if (!bitplane)
-            return -1;
-
-        n = 0;
-        for (y = 0; y < s->mb_height; y++)
-            for (x = 0; x < s->mb_width; x++, n++)
-                vc1_pack_bitplanes(bitplane, n, ff_bp, x, y, s->mb_stride);
-        if (n & 1) /* move last nibble to the high order */
-            bitplane[n/2] <<= 4;
-    }
-    return 0;
-}
-
-static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
-{
-    VC1Context * const v = avctx->priv_data;
-    MpegEncContext * const s = &v->s;
-    VASliceParameterBufferVC1 *slice_param;
-
-    av_dlog(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size);
-
-    /* Current bit buffer is beyond any marker for VC-1, so skip it */
-    if (avctx->codec_id == AV_CODEC_ID_VC1 && IS_MARKER(AV_RB32(buffer))) {
-        buffer += 4;
-        size -= 4;
-    }
-
-    /* Fill in VASliceParameterBufferVC1 */
-    slice_param = (VASliceParameterBufferVC1 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
-    if (!slice_param)
-        return -1;
-    slice_param->macroblock_offset       = get_bits_count(&s->gb);
-    slice_param->slice_vertical_position = s->mb_y;
-    return 0;
-}
-
-#if CONFIG_WMV3_VAAPI_HWACCEL
-AVHWAccel ff_wmv3_vaapi_hwaccel = {
-    .name           = "wmv3_vaapi",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WMV3,
-    .pix_fmt        = AV_PIX_FMT_VAAPI_VLD,
-    .start_frame    = vaapi_vc1_start_frame,
-    .end_frame      = ff_vaapi_mpeg_end_frame,
-    .decode_slice   = vaapi_vc1_decode_slice,
-};
-#endif
-
-AVHWAccel ff_vc1_vaapi_hwaccel = {
-    .name           = "vc1_vaapi",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VC1,
-    .pix_fmt        = AV_PIX_FMT_VAAPI_VLD,
-    .start_frame    = vaapi_vc1_start_frame,
-    .end_frame      = ff_vaapi_mpeg_end_frame,
-    .decode_slice   = vaapi_vc1_decode_slice,
-};
diff --git a/deps/libav/libavcodec/vb.c b/deps/libav/libavcodec/vb.c
deleted file mode 100644
index 56094d8..0000000
--- a/deps/libav/libavcodec/vb.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Beam Software VB decoder
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VB Video decoder
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-enum VBFlags {
-    VB_HAS_GMC     = 0x01,
-    VB_HAS_AUDIO   = 0x04,
-    VB_HAS_VIDEO   = 0x08,
-    VB_HAS_PALETTE = 0x10,
-    VB_HAS_LENGTH  = 0x20
-};
-
-typedef struct VBDecContext {
-    AVCodecContext *avctx;
-
-    uint8_t *frame, *prev_frame;
-    uint32_t pal[AVPALETTE_COUNT];
-    GetByteContext stream;
-} VBDecContext;
-
-static const uint16_t vb_patterns[64] = {
-    0x0660, 0xFF00, 0xCCCC, 0xF000, 0x8888, 0x000F, 0x1111, 0xFEC8,
-    0x8CEF, 0x137F, 0xF731, 0xC800, 0x008C, 0x0013, 0x3100, 0xCC00,
-    0x00CC, 0x0033, 0x3300, 0x0FF0, 0x6666, 0x00F0, 0x0F00, 0x2222,
-    0x4444, 0xF600, 0x8CC8, 0x006F, 0x1331, 0x318C, 0xC813, 0x33CC,
-    0x6600, 0x0CC0, 0x0066, 0x0330, 0xF900, 0xC88C, 0x009F, 0x3113,
-    0x6000, 0x0880, 0x0006, 0x0110, 0xCC88, 0xFC00, 0x00CF, 0x88CC,
-    0x003F, 0x1133, 0x3311, 0xF300, 0x6FF6, 0x0603, 0x08C6, 0x8C63,
-    0xC631, 0x6310, 0xC060, 0x0136, 0x136C, 0x36C8, 0x6C80, 0x324C
-};
-
-static void vb_decode_palette(VBDecContext *c, int data_size)
-{
-    int start, size, i;
-
-    start = bytestream2_get_byte(&c->stream);
-    size  = (bytestream2_get_byte(&c->stream) - 1) & 0xFF;
-    if (start + size > 255) {
-        av_log(c->avctx, AV_LOG_ERROR, "Palette change runs beyond entry 256\n");
-        return;
-    }
-    if (size*3+2 > data_size) {
-        av_log(c->avctx, AV_LOG_ERROR, "Palette data runs beyond chunk size\n");
-        return;
-    }
-    for (i = start; i <= start + size; i++)
-        c->pal[i] = bytestream2_get_be24(&c->stream);
-}
-
-static inline int check_pixel(uint8_t *buf, uint8_t *start, uint8_t *end)
-{
-    return buf >= start && buf < end;
-}
-
-static inline int check_line(uint8_t *buf, uint8_t *start, uint8_t *end)
-{
-    return buf >= start && (buf + 4) <= end;
-}
-
-static int vb_decode_framedata(VBDecContext *c, int offset)
-{
-    GetByteContext g;
-    uint8_t *prev, *cur;
-    int blk, blocks, t, blk2;
-    int blocktypes = 0;
-    int x, y, a, b;
-    int pattype, pattern;
-    const int width = c->avctx->width;
-    uint8_t *pstart = c->prev_frame;
-    uint8_t *pend   = c->prev_frame + width*c->avctx->height;
-
-    g = c->stream;
-
-    prev = c->prev_frame + offset;
-    cur  = c->frame;
-
-    blocks = (c->avctx->width >> 2) * (c->avctx->height >> 2);
-    blk2   = 0;
-    for (blk = 0; blk < blocks; blk++) {
-        if (!(blk & 3)) {
-            blocktypes = bytestream2_get_byte(&g);
-        }
-        switch (blocktypes & 0xC0) {
-        case 0x00: //skip
-            for (y = 0; y < 4; y++)
-                if (check_line(prev + y*width, pstart, pend))
-                    memcpy(cur + y*width, prev + y*width, 4);
-                else
-                    memset(cur + y*width, 0, 4);
-            break;
-        case 0x40:
-            t = bytestream2_get_byte(&g);
-            if (!t) { //raw block
-                if (bytestream2_get_bytes_left(&g) < 16) {
-                    av_log(c->avctx, AV_LOG_ERROR, "Insufficient data\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                for (y = 0; y < 4; y++)
-                    bytestream2_get_buffer(&g, cur + y * width, 4);
-            } else { // motion compensation
-                x = ((t & 0xF)^8) - 8;
-                y = ((t >> 4) ^8) - 8;
-                t = x + y*width;
-                for (y = 0; y < 4; y++)
-                    if (check_line(prev + t + y*width, pstart, pend))
-                        memcpy(cur + y*width, prev + t + y*width, 4);
-                    else
-                        memset(cur + y*width, 0, 4);
-            }
-            break;
-        case 0x80: // fill
-            t = bytestream2_get_byte(&g);
-            for (y = 0; y < 4; y++)
-                memset(cur + y*width, t, 4);
-            break;
-        case 0xC0: // pattern fill
-            t       = bytestream2_get_byte(&g);
-            pattype = t >> 6;
-            pattern = vb_patterns[t & 0x3F];
-            switch (pattype) {
-            case 0:
-                a = bytestream2_get_byte(&g);
-                b = bytestream2_get_byte(&g);
-                for (y = 0; y < 4; y++)
-                    for (x = 0; x < 4; x++, pattern >>= 1)
-                        cur[x + y*width] = (pattern & 1) ? b : a;
-                break;
-            case 1:
-                pattern = ~pattern;
-            case 2:
-                a = bytestream2_get_byte(&g);
-                for (y = 0; y < 4; y++)
-                    for (x = 0; x < 4; x++, pattern >>= 1)
-                        if (pattern & 1 && check_pixel(prev + x + y*width, pstart, pend))
-                            cur[x + y*width] = prev[x + y*width];
-                        else
-                            cur[x + y*width] = a;
-                break;
-            case 3:
-                av_log(c->avctx, AV_LOG_ERROR, "Invalid opcode seen @%d\n", blk);
-                return AVERROR_INVALIDDATA;
-            }
-            break;
-        }
-        blocktypes <<= 2;
-        cur  += 4;
-        prev += 4;
-        blk2++;
-        if (blk2 == (width >> 2)) {
-            blk2  = 0;
-            cur  += width * 3;
-            prev += width * 3;
-        }
-    }
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    VBDecContext * const c = avctx->priv_data;
-    AVFrame *frame         = data;
-    uint8_t *outptr, *srcptr;
-    int i, j, ret;
-    int flags;
-    uint32_t size;
-    int offset = 0;
-
-    bytestream2_init(&c->stream, avpkt->data, avpkt->size);
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    flags = bytestream2_get_le16(&c->stream);
-
-    if (flags & VB_HAS_GMC) {
-        i = (int16_t)bytestream2_get_le16(&c->stream);
-        j = (int16_t)bytestream2_get_le16(&c->stream);
-        offset = i + j * avctx->width;
-    }
-    if (flags & VB_HAS_VIDEO) {
-        size = bytestream2_get_le32(&c->stream);
-        vb_decode_framedata(c, offset);
-        bytestream2_skip(&c->stream, size - 4);
-    }
-    if (flags & VB_HAS_PALETTE) {
-        size = bytestream2_get_le32(&c->stream);
-        vb_decode_palette(c, size);
-    }
-
-    memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
-    frame->palette_has_changed = flags & VB_HAS_PALETTE;
-
-    outptr = frame->data[0];
-    srcptr = c->frame;
-
-    for (i = 0; i < avctx->height; i++) {
-        memcpy(outptr, srcptr, avctx->width);
-        srcptr += avctx->width;
-        outptr += frame->linesize[0];
-    }
-
-    FFSWAP(uint8_t*, c->frame, c->prev_frame);
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return avpkt->size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    VBDecContext * const c = avctx->priv_data;
-
-    c->avctx       = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    c->frame      = av_mallocz(avctx->width * avctx->height);
-    c->prev_frame = av_mallocz(avctx->width * avctx->height);
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    VBDecContext *c = avctx->priv_data;
-
-    av_freep(&c->frame);
-    av_freep(&c->prev_frame);
-
-    return 0;
-}
-
-AVCodec ff_vb_decoder = {
-    .name           = "vb",
-    .long_name      = NULL_IF_CONFIG_SMALL("Beam Software VB"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VB,
-    .priv_data_size = sizeof(VBDecContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/vble.c b/deps/libav/libavcodec/vble.c
deleted file mode 100644
index a349d8f..0000000
--- a/deps/libav/libavcodec/vble.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * VBLE Decoder
- * Copyright (c) 2011 Derek Buitenhuis
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VBLE Decoder
- */
-
-#define BITSTREAM_READER_LE
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "mathops.h"
-
-typedef struct {
-    AVCodecContext *avctx;
-    DSPContext dsp;
-
-    int            size;
-    uint8_t        *val; /* First holds the lengths of vlc symbols and then their values */
-} VBLEContext;
-
-static uint8_t vble_read_reverse_unary(GetBitContext *gb)
-{
-    /* At most we need to read 9 bits total to get indices up to 8 */
-    uint8_t val = show_bits(gb, 8);
-
-    if (val) {
-        val = 7 - av_log2_16bit(ff_reverse[val]);
-        skip_bits(gb, val + 1);
-        return val;
-    } else {
-        skip_bits(gb, 8);
-        if (get_bits1(gb))
-            return 8;
-    }
-
-    /* Return something larger than 8 on error */
-    return UINT8_MAX;
-}
-
-static int vble_unpack(VBLEContext *ctx, GetBitContext *gb)
-{
-    int i;
-
-    /* Read all the lengths in first */
-    for (i = 0; i < ctx->size; i++) {
-        ctx->val[i] = vble_read_reverse_unary(gb);
-
-        if (ctx->val[i] == UINT8_MAX)
-            return -1;
-    }
-
-    for (i = 0; i < ctx->size; i++) {
-        /* Check we have enough bits left */
-        if (get_bits_left(gb) < ctx->val[i])
-            return -1;
-
-        /* get_bits can't take a length of 0 */
-        if (ctx->val[i])
-            ctx->val[i] = (1 << ctx->val[i]) + get_bits(gb, ctx->val[i]) - 1;
-    }
-
-    return 0;
-}
-
-static void vble_restore_plane(VBLEContext *ctx, AVFrame *pic,
-                               int plane, int offset,
-                               int width, int height)
-{
-    uint8_t *dst = pic->data[plane];
-    uint8_t *val = ctx->val + offset;
-    int stride = pic->linesize[plane];
-    int i, j, left, left_top;
-
-    for (i = 0; i < height; i++) {
-        for (j = 0; j < width; j++)
-            val[j] = (val[j] >> 1) ^ -(val[j] & 1);
-
-        if (i) {
-            left = 0;
-            left_top = dst[-stride];
-            ctx->dsp.add_hfyu_median_prediction(dst, dst-stride, val,
-                                                width, &left, &left_top);
-        } else {
-            dst[0] = val[0];
-            for (j = 1; j < width; j++)
-                dst[j] = val[j] + dst[j - 1];
-        }
-        dst += stride;
-        val += width;
-    }
-}
-
-static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    VBLEContext *ctx = avctx->priv_data;
-    AVFrame *pic     = data;
-    GetBitContext gb;
-    const uint8_t *src = avpkt->data;
-    int version;
-    int offset = 0;
-    int width_uv = avctx->width / 2, height_uv = avctx->height / 2;
-
-    /* Allocate buffer */
-    if (ff_get_buffer(avctx, pic, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    /* Set flags */
-    pic->key_frame = 1;
-    pic->pict_type = AV_PICTURE_TYPE_I;
-
-    /* Version should always be 1 */
-    version = AV_RL32(src);
-
-    if (version != 1)
-        av_log(avctx, AV_LOG_WARNING, "Unsupported VBLE Version: %d\n", version);
-
-    init_get_bits(&gb, src + 4, (avpkt->size - 4) * 8);
-
-    /* Unpack */
-    if (vble_unpack(ctx, &gb) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid Code\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Restore planes. Should be almost identical to Huffyuv's. */
-    vble_restore_plane(ctx, pic, 0, offset, avctx->width, avctx->height);
-
-    /* Chroma */
-    if (!(ctx->avctx->flags & CODEC_FLAG_GRAY)) {
-        offset += avctx->width * avctx->height;
-        vble_restore_plane(ctx, pic, 1, offset, width_uv, height_uv);
-
-        offset += width_uv * height_uv;
-        vble_restore_plane(ctx, pic, 2, offset, width_uv, height_uv);
-    }
-
-    *got_frame       = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int vble_decode_close(AVCodecContext *avctx)
-{
-    VBLEContext *ctx = avctx->priv_data;
-    av_freep(&ctx->val);
-
-    return 0;
-}
-
-static av_cold int vble_decode_init(AVCodecContext *avctx)
-{
-    VBLEContext *ctx = avctx->priv_data;
-
-    /* Stash for later use */
-    ctx->avctx = avctx;
-    ff_dsputil_init(&ctx->dsp, avctx);
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    avctx->bits_per_raw_sample = 8;
-
-    ctx->size = avpicture_get_size(avctx->pix_fmt,
-                                   avctx->width, avctx->height);
-
-    ctx->val = av_malloc(ctx->size * sizeof(*ctx->val));
-
-    if (!ctx->val) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate values buffer.\n");
-        vble_decode_close(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-AVCodec ff_vble_decoder = {
-    .name           = "vble",
-    .long_name      = NULL_IF_CONFIG_SMALL("VBLE Lossless Codec"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VBLE,
-    .priv_data_size = sizeof(VBLEContext),
-    .init           = vble_decode_init,
-    .close          = vble_decode_close,
-    .decode         = vble_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/vc1.c b/deps/libav/libavcodec/vc1.c
deleted file mode 100644
index a7f2aab..0000000
--- a/deps/libav/libavcodec/vc1.c
+++ /dev/null
@@ -1,1691 +0,0 @@
-/*
- * VC-1 and WMV3 decoder common code
- * Copyright (c) 2011 Mashiat Sarker Shakkhar
- * Copyright (c) 2006-2007 Konstantin Shishkov
- * Partly based on vc9.c (c) 2005 Anonymous, Alex Beregszaszi, Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VC-1 and WMV3 decoder common code
- *
- */
-
-#include "libavutil/attributes.h"
-#include "internal.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "vc1.h"
-#include "vc1data.h"
-#include "msmpeg4data.h"
-#include "unary.h"
-#include "simple_idct.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-/***********************************************************************/
-/**
- * @name VC-1 Bitplane decoding
- * @see 8.7, p56
- * @{
- */
-
-/**
- * Imode types
- * @{
- */
-enum Imode {
-    IMODE_RAW,
-    IMODE_NORM2,
-    IMODE_DIFF2,
-    IMODE_NORM6,
-    IMODE_DIFF6,
-    IMODE_ROWSKIP,
-    IMODE_COLSKIP
-};
-/** @} */ //imode defines
-
-/** Decode rows by checking if they are skipped
- * @param plane Buffer to store decoded bits
- * @param[in] width Width of this buffer
- * @param[in] height Height of this buffer
- * @param[in] stride of this buffer
- */
-static void decode_rowskip(uint8_t* plane, int width, int height, int stride,
-                           GetBitContext *gb)
-{
-    int x, y;
-
-    for (y = 0; y < height; y++) {
-        if (!get_bits1(gb)) //rowskip
-            memset(plane, 0, width);
-        else
-            for (x = 0; x < width; x++)
-                plane[x] = get_bits1(gb);
-        plane += stride;
-    }
-}
-
-/** Decode columns by checking if they are skipped
- * @param plane Buffer to store decoded bits
- * @param[in] width Width of this buffer
- * @param[in] height Height of this buffer
- * @param[in] stride of this buffer
- * @todo FIXME: Optimize
- */
-static void decode_colskip(uint8_t* plane, int width, int height, int stride,
-                           GetBitContext *gb)
-{
-    int x, y;
-
-    for (x = 0; x < width; x++) {
-        if (!get_bits1(gb)) //colskip
-            for (y = 0; y < height; y++)
-                plane[y*stride] = 0;
-        else
-            for (y = 0; y < height; y++)
-                plane[y*stride] = get_bits1(gb);
-        plane ++;
-    }
-}
-
-/** Decode a bitplane's bits
- * @param data bitplane where to store the decode bits
- * @param[out] raw_flag pointer to the flag indicating that this bitplane is not coded explicitly
- * @param v VC-1 context for bit reading and logging
- * @return Status
- * @todo FIXME: Optimize
- */
-static int bitplane_decoding(uint8_t* data, int *raw_flag, VC1Context *v)
-{
-    GetBitContext *gb = &v->s.gb;
-
-    int imode, x, y, code, offset;
-    uint8_t invert, *planep = data;
-    int width, height, stride;
-
-    width  = v->s.mb_width;
-    height = v->s.mb_height >> v->field_mode;
-    stride = v->s.mb_stride;
-    invert = get_bits1(gb);
-    imode = get_vlc2(gb, ff_vc1_imode_vlc.table, VC1_IMODE_VLC_BITS, 1);
-
-    *raw_flag = 0;
-    switch (imode) {
-    case IMODE_RAW:
-        //Data is actually read in the MB layer (same for all tests == "raw")
-        *raw_flag = 1; //invert ignored
-        return invert;
-    case IMODE_DIFF2:
-    case IMODE_NORM2:
-        if ((height * width) & 1) {
-            *planep++ = get_bits1(gb);
-            offset    = 1;
-        }
-        else
-            offset = 0;
-        // decode bitplane as one long line
-        for (y = offset; y < height * width; y += 2) {
-            code = get_vlc2(gb, ff_vc1_norm2_vlc.table, VC1_NORM2_VLC_BITS, 1);
-            *planep++ = code & 1;
-            offset++;
-            if (offset == width) {
-                offset  = 0;
-                planep += stride - width;
-            }
-            *planep++ = code >> 1;
-            offset++;
-            if (offset == width) {
-                offset  = 0;
-                planep += stride - width;
-            }
-        }
-        break;
-    case IMODE_DIFF6:
-    case IMODE_NORM6:
-        if (!(height % 3) && (width % 3)) { // use 2x3 decoding
-            for (y = 0; y < height; y += 3) {
-                for (x = width & 1; x < width; x += 2) {
-                    code = get_vlc2(gb, ff_vc1_norm6_vlc.table, VC1_NORM6_VLC_BITS, 2);
-                    if (code < 0) {
-                        av_log(v->s.avctx, AV_LOG_DEBUG, "invalid NORM-6 VLC\n");
-                        return -1;
-                    }
-                    planep[x + 0]              = (code >> 0) & 1;
-                    planep[x + 1]              = (code >> 1) & 1;
-                    planep[x + 0 + stride]     = (code >> 2) & 1;
-                    planep[x + 1 + stride]     = (code >> 3) & 1;
-                    planep[x + 0 + stride * 2] = (code >> 4) & 1;
-                    planep[x + 1 + stride * 2] = (code >> 5) & 1;
-                }
-                planep += stride * 3;
-            }
-            if (width & 1)
-                decode_colskip(data, 1, height, stride, &v->s.gb);
-        } else { // 3x2
-            planep += (height & 1) * stride;
-            for (y = height & 1; y < height; y += 2) {
-                for (x = width % 3; x < width; x += 3) {
-                    code = get_vlc2(gb, ff_vc1_norm6_vlc.table, VC1_NORM6_VLC_BITS, 2);
-                    if (code < 0) {
-                        av_log(v->s.avctx, AV_LOG_DEBUG, "invalid NORM-6 VLC\n");
-                        return -1;
-                    }
-                    planep[x + 0]          = (code >> 0) & 1;
-                    planep[x + 1]          = (code >> 1) & 1;
-                    planep[x + 2]          = (code >> 2) & 1;
-                    planep[x + 0 + stride] = (code >> 3) & 1;
-                    planep[x + 1 + stride] = (code >> 4) & 1;
-                    planep[x + 2 + stride] = (code >> 5) & 1;
-                }
-                planep += stride * 2;
-            }
-            x = width % 3;
-            if (x)
-                decode_colskip(data,             x, height, stride, &v->s.gb);
-            if (height & 1)
-                decode_rowskip(data + x, width - x,      1, stride, &v->s.gb);
-        }
-        break;
-    case IMODE_ROWSKIP:
-        decode_rowskip(data, width, height, stride, &v->s.gb);
-        break;
-    case IMODE_COLSKIP:
-        decode_colskip(data, width, height, stride, &v->s.gb);
-        break;
-    default:
-        break;
-    }
-
-    /* Applying diff operator */
-    if (imode == IMODE_DIFF2 || imode == IMODE_DIFF6) {
-        planep = data;
-        planep[0] ^= invert;
-        for (x = 1; x < width; x++)
-            planep[x] ^= planep[x-1];
-        for (y = 1; y < height; y++) {
-            planep += stride;
-            planep[0] ^= planep[-stride];
-            for (x = 1; x < width; x++) {
-                if (planep[x-1] != planep[x-stride]) planep[x] ^= invert;
-                else                                 planep[x] ^= planep[x-1];
-            }
-        }
-    } else if (invert) {
-        planep = data;
-        for (x = 0; x < stride * height; x++)
-            planep[x] = !planep[x]; //FIXME stride
-    }
-    return (imode << 1) + invert;
-}
-
-/** @} */ //Bitplane group
-
-/***********************************************************************/
-/** VOP Dquant decoding
- * @param v VC-1 Context
- */
-static int vop_dquant_decoding(VC1Context *v)
-{
-    GetBitContext *gb = &v->s.gb;
-    int pqdiff;
-
-    //variable size
-    if (v->dquant == 2) {
-        pqdiff = get_bits(gb, 3);
-        if (pqdiff == 7)
-            v->altpq = get_bits(gb, 5);
-        else
-            v->altpq = v->pq + pqdiff + 1;
-    } else {
-        v->dquantfrm = get_bits1(gb);
-        if (v->dquantfrm) {
-            v->dqprofile = get_bits(gb, 2);
-            switch (v->dqprofile) {
-            case DQPROFILE_SINGLE_EDGE:
-            case DQPROFILE_DOUBLE_EDGES:
-                v->dqsbedge = get_bits(gb, 2);
-                break;
-            case DQPROFILE_ALL_MBS:
-                v->dqbilevel = get_bits1(gb);
-                if (!v->dqbilevel)
-                    v->halfpq = 0;
-            default:
-                break; //Forbidden ?
-            }
-            if (v->dqbilevel || v->dqprofile != DQPROFILE_ALL_MBS) {
-                pqdiff = get_bits(gb, 3);
-                if (pqdiff == 7)
-                    v->altpq = get_bits(gb, 5);
-                else
-                    v->altpq = v->pq + pqdiff + 1;
-            }
-        }
-    }
-    return 0;
-}
-
-static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb);
-
-/**
- * Decode Simple/Main Profiles sequence header
- * @see Figure 7-8, p16-17
- * @param avctx Codec context
- * @param gb GetBit context initialized from Codec context extra_data
- * @return Status
- */
-int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
-{
-    av_log(avctx, AV_LOG_DEBUG, "Header: %0X\n", show_bits(gb, 32));
-    v->profile = get_bits(gb, 2);
-    if (v->profile == PROFILE_COMPLEX) {
-        av_log(avctx, AV_LOG_WARNING, "WMV3 Complex Profile is not fully supported\n");
-    }
-
-    if (v->profile == PROFILE_ADVANCED) {
-        v->zz_8x4 = ff_vc1_adv_progressive_8x4_zz;
-        v->zz_4x8 = ff_vc1_adv_progressive_4x8_zz;
-        return decode_sequence_header_adv(v, gb);
-    } else {
-        v->zz_8x4 = ff_wmv2_scantableA;
-        v->zz_4x8 = ff_wmv2_scantableB;
-        v->res_y411   = get_bits1(gb);
-        v->res_sprite = get_bits1(gb);
-        if (v->res_y411) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Old interlaced mode is not supported\n");
-            return -1;
-        }
-    }
-
-    // (fps-2)/4 (->30)
-    v->frmrtq_postproc = get_bits(gb, 3); //common
-    // (bitrate-32kbps)/64kbps
-    v->bitrtq_postproc = get_bits(gb, 5); //common
-    v->s.loop_filter   = get_bits1(gb); //common
-    if (v->s.loop_filter == 1 && v->profile == PROFILE_SIMPLE) {
-        av_log(avctx, AV_LOG_ERROR,
-               "LOOPFILTER shall not be enabled in Simple Profile\n");
-    }
-    if (v->s.avctx->skip_loop_filter >= AVDISCARD_ALL)
-        v->s.loop_filter = 0;
-
-    v->res_x8          = get_bits1(gb); //reserved
-    v->multires        = get_bits1(gb);
-    v->res_fasttx      = get_bits1(gb);
-    if (!v->res_fasttx) {
-        v->vc1dsp.vc1_inv_trans_8x8    = ff_simple_idct_8;
-        v->vc1dsp.vc1_inv_trans_8x4    = ff_simple_idct84_add;
-        v->vc1dsp.vc1_inv_trans_4x8    = ff_simple_idct48_add;
-        v->vc1dsp.vc1_inv_trans_4x4    = ff_simple_idct44_add;
-        v->vc1dsp.vc1_inv_trans_8x8_dc = ff_simple_idct_add_8;
-        v->vc1dsp.vc1_inv_trans_8x4_dc = ff_simple_idct84_add;
-        v->vc1dsp.vc1_inv_trans_4x8_dc = ff_simple_idct48_add;
-        v->vc1dsp.vc1_inv_trans_4x4_dc = ff_simple_idct44_add;
-    }
-
-    v->fastuvmc        = get_bits1(gb); //common
-    if (!v->profile && !v->fastuvmc) {
-        av_log(avctx, AV_LOG_ERROR,
-               "FASTUVMC unavailable in Simple Profile\n");
-        return -1;
-    }
-    v->extended_mv     = get_bits1(gb); //common
-    if (!v->profile && v->extended_mv)
-    {
-        av_log(avctx, AV_LOG_ERROR,
-               "Extended MVs unavailable in Simple Profile\n");
-        return -1;
-    }
-    v->dquant          = get_bits(gb, 2); //common
-    v->vstransform     = get_bits1(gb); //common
-
-    v->res_transtab    = get_bits1(gb);
-    if (v->res_transtab)
-    {
-        av_log(avctx, AV_LOG_ERROR,
-               "1 for reserved RES_TRANSTAB is forbidden\n");
-        return -1;
-    }
-
-    v->overlap         = get_bits1(gb); //common
-
-    v->resync_marker   = get_bits1(gb);
-    v->rangered        = get_bits1(gb);
-    if (v->rangered && v->profile == PROFILE_SIMPLE) {
-        av_log(avctx, AV_LOG_INFO,
-               "RANGERED should be set to 0 in Simple Profile\n");
-    }
-
-    v->s.max_b_frames = avctx->max_b_frames = get_bits(gb, 3); //common
-    v->quantizer_mode = get_bits(gb, 2); //common
-
-    v->finterpflag = get_bits1(gb); //common
-
-    if (v->res_sprite) {
-        v->s.avctx->width  = v->s.avctx->coded_width  = get_bits(gb, 11);
-        v->s.avctx->height = v->s.avctx->coded_height = get_bits(gb, 11);
-        skip_bits(gb, 5); //frame rate
-        v->res_x8 = get_bits1(gb);
-        if (get_bits1(gb)) { // something to do with DC VLC selection
-            av_log(avctx, AV_LOG_ERROR, "Unsupported sprite feature\n");
-            return -1;
-        }
-        skip_bits(gb, 3); //slice code
-        v->res_rtm_flag = 0;
-    } else {
-        v->res_rtm_flag = get_bits1(gb); //reserved
-    }
-    if (!v->res_rtm_flag) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Old WMV3 version detected, some frames may be decoded incorrectly\n");
-        //return -1;
-    }
-    //TODO: figure out what they mean (always 0x402F)
-    if (!v->res_fasttx)
-        skip_bits(gb, 16);
-    av_log(avctx, AV_LOG_DEBUG,
-           "Profile %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
-           "LoopFilter=%i, MultiRes=%i, FastUVMC=%i, Extended MV=%i\n"
-           "Rangered=%i, VSTransform=%i, Overlap=%i, SyncMarker=%i\n"
-           "DQuant=%i, Quantizer mode=%i, Max B frames=%i\n",
-           v->profile, v->frmrtq_postproc, v->bitrtq_postproc,
-           v->s.loop_filter, v->multires, v->fastuvmc, v->extended_mv,
-           v->rangered, v->vstransform, v->overlap, v->resync_marker,
-           v->dquant, v->quantizer_mode, avctx->max_b_frames);
-    return 0;
-}
-
-static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
-{
-    v->res_rtm_flag = 1;
-    v->level = get_bits(gb, 3);
-    if (v->level >= 5) {
-        av_log(v->s.avctx, AV_LOG_ERROR, "Reserved LEVEL %i\n",v->level);
-    }
-    v->chromaformat = get_bits(gb, 2);
-    if (v->chromaformat != 1) {
-        av_log(v->s.avctx, AV_LOG_ERROR,
-               "Only 4:2:0 chroma format supported\n");
-        return -1;
-    }
-
-    // (fps-2)/4 (->30)
-    v->frmrtq_postproc       = get_bits(gb, 3); //common
-    // (bitrate-32kbps)/64kbps
-    v->bitrtq_postproc       = get_bits(gb, 5); //common
-    v->postprocflag          = get_bits1(gb);   //common
-
-    v->s.avctx->coded_width  = (get_bits(gb, 12) + 1) << 1;
-    v->s.avctx->coded_height = (get_bits(gb, 12) + 1) << 1;
-    v->s.avctx->width        = v->s.avctx->coded_width;
-    v->s.avctx->height       = v->s.avctx->coded_height;
-    v->broadcast             = get_bits1(gb);
-    v->interlace             = get_bits1(gb);
-    v->tfcntrflag            = get_bits1(gb);
-    v->finterpflag           = get_bits1(gb);
-    skip_bits1(gb); // reserved
-
-    av_log(v->s.avctx, AV_LOG_DEBUG,
-           "Advanced Profile level %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
-           "LoopFilter=%i, ChromaFormat=%i, Pulldown=%i, Interlace: %i\n"
-           "TFCTRflag=%i, FINTERPflag=%i\n",
-           v->level, v->frmrtq_postproc, v->bitrtq_postproc,
-           v->s.loop_filter, v->chromaformat, v->broadcast, v->interlace,
-           v->tfcntrflag, v->finterpflag);
-
-    v->psf = get_bits1(gb);
-    if (v->psf) { //PsF, 6.1.13
-        av_log(v->s.avctx, AV_LOG_ERROR, "Progressive Segmented Frame mode: not supported (yet)\n");
-        return -1;
-    }
-    v->s.max_b_frames = v->s.avctx->max_b_frames = 7;
-    if (get_bits1(gb)) { //Display Info - decoding is not affected by it
-        int w, h, ar = 0;
-        av_log(v->s.avctx, AV_LOG_DEBUG, "Display extended info:\n");
-        w = get_bits(gb, 14) + 1;
-        h = get_bits(gb, 14) + 1;
-        av_log(v->s.avctx, AV_LOG_DEBUG, "Display dimensions: %ix%i\n", w, h);
-        if (get_bits1(gb))
-            ar = get_bits(gb, 4);
-        if (ar && ar < 14) {
-            v->s.avctx->sample_aspect_ratio = ff_vc1_pixel_aspect[ar];
-        } else if (ar == 15) {
-            w = get_bits(gb, 8) + 1;
-            h = get_bits(gb, 8) + 1;
-            v->s.avctx->sample_aspect_ratio = (AVRational){w, h};
-        } else {
-            av_reduce(&v->s.avctx->sample_aspect_ratio.num,
-                      &v->s.avctx->sample_aspect_ratio.den,
-                      v->s.avctx->height * w,
-                      v->s.avctx->width * h,
-                      1 << 30);
-        }
-        av_log(v->s.avctx, AV_LOG_DEBUG, "Aspect: %i:%i\n",
-               v->s.avctx->sample_aspect_ratio.num,
-               v->s.avctx->sample_aspect_ratio.den);
-
-        if (get_bits1(gb)) { //framerate stuff
-            if (get_bits1(gb)) {
-                v->s.avctx->time_base.num = 32;
-                v->s.avctx->time_base.den = get_bits(gb, 16) + 1;
-            } else {
-                int nr, dr;
-                nr = get_bits(gb, 8);
-                dr = get_bits(gb, 4);
-                if (nr > 0 && nr < 8 && dr > 0 && dr < 3) {
-                    v->s.avctx->time_base.num = ff_vc1_fps_dr[dr - 1];
-                    v->s.avctx->time_base.den = ff_vc1_fps_nr[nr - 1] * 1000;
-                }
-            }
-            if (v->broadcast) { // Pulldown may be present
-                v->s.avctx->time_base.den  *= 2;
-                v->s.avctx->ticks_per_frame = 2;
-            }
-        }
-
-        if (get_bits1(gb)) {
-            v->color_prim    = get_bits(gb, 8);
-            v->transfer_char = get_bits(gb, 8);
-            v->matrix_coef   = get_bits(gb, 8);
-        }
-    }
-
-    v->hrd_param_flag = get_bits1(gb);
-    if (v->hrd_param_flag) {
-        int i;
-        v->hrd_num_leaky_buckets = get_bits(gb, 5);
-        skip_bits(gb, 4); //bitrate exponent
-        skip_bits(gb, 4); //buffer size exponent
-        for (i = 0; i < v->hrd_num_leaky_buckets; i++) {
-            skip_bits(gb, 16); //hrd_rate[n]
-            skip_bits(gb, 16); //hrd_buffer[n]
-        }
-    }
-    return 0;
-}
-
-int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
-{
-    int i;
-
-    av_log(avctx, AV_LOG_DEBUG, "Entry point: %08X\n", show_bits_long(gb, 32));
-    v->broken_link    = get_bits1(gb);
-    v->closed_entry   = get_bits1(gb);
-    v->panscanflag    = get_bits1(gb);
-    v->refdist_flag   = get_bits1(gb);
-    v->s.loop_filter  = get_bits1(gb);
-    v->fastuvmc       = get_bits1(gb);
-    v->extended_mv    = get_bits1(gb);
-    v->dquant         = get_bits(gb, 2);
-    v->vstransform    = get_bits1(gb);
-    v->overlap        = get_bits1(gb);
-    v->quantizer_mode = get_bits(gb, 2);
-
-    if (v->hrd_param_flag) {
-        for (i = 0; i < v->hrd_num_leaky_buckets; i++) {
-            skip_bits(gb, 8); //hrd_full[n]
-        }
-    }
-
-    if (get_bits1(gb)) {
-        avctx->width  = avctx->coded_width  = (get_bits(gb, 12) + 1) << 1;
-        avctx->height = avctx->coded_height = (get_bits(gb, 12) + 1) << 1;
-    }
-    if (v->extended_mv)
-        v->extended_dmv = get_bits1(gb);
-    if ((v->range_mapy_flag = get_bits1(gb))) {
-        av_log(avctx, AV_LOG_ERROR, "Luma scaling is not supported, expect wrong picture\n");
-        v->range_mapy = get_bits(gb, 3);
-    }
-    if ((v->range_mapuv_flag = get_bits1(gb))) {
-        av_log(avctx, AV_LOG_ERROR, "Chroma scaling is not supported, expect wrong picture\n");
-        v->range_mapuv = get_bits(gb, 3);
-    }
-
-    av_log(avctx, AV_LOG_DEBUG, "Entry point info:\n"
-           "BrokenLink=%i, ClosedEntry=%i, PanscanFlag=%i\n"
-           "RefDist=%i, Postproc=%i, FastUVMC=%i, ExtMV=%i\n"
-           "DQuant=%i, VSTransform=%i, Overlap=%i, Qmode=%i\n",
-           v->broken_link, v->closed_entry, v->panscanflag, v->refdist_flag, v->s.loop_filter,
-           v->fastuvmc, v->extended_mv, v->dquant, v->vstransform, v->overlap, v->quantizer_mode);
-
-    return 0;
-}
-
-/* fill lookup tables for intensity compensation */
-#define INIT_LUT(lumscale, lumshift, luty, lutuv, chain) do {                 \
-        int scale, shift, i;                                                  \
-        if (!lumscale) {                                                      \
-            scale = -64;                                                      \
-            shift = (255 - lumshift * 2) << 6;                                \
-            if (lumshift > 31)                                                \
-                shift += 128 << 6;                                            \
-        } else {                                                              \
-            scale = lumscale + 32;                                            \
-            if (lumshift > 31)                                                \
-                shift = (lumshift - 64) << 6;                                 \
-            else                                                              \
-                shift = lumshift << 6;                                        \
-        }                                                                     \
-        for (i = 0; i < 256; i++) {                                           \
-            int iy = chain ? luty[i]  : i;                                    \
-            int iu = chain ? lutuv[i] : i;                                    \
-            luty[i]  = av_clip_uint8((scale * iy + shift + 32) >> 6);         \
-            lutuv[i] = av_clip_uint8((scale * (iu - 128) + 128*64 + 32) >> 6);\
-        }                                                                     \
-    } while(0)
-
-static void rotate_luts(VC1Context *v)
-{
-#define ROTATE(DEF, L, N, C, A) do {                          \
-        if (v->s.pict_type == AV_PICTURE_TYPE_BI || v->s.pict_type == AV_PICTURE_TYPE_B) { \
-            C = A;                                            \
-        } else {                                              \
-            DEF;                                              \
-            memcpy(&tmp, &L  , sizeof(tmp));                  \
-            memcpy(&L  , &N  , sizeof(tmp));                  \
-            memcpy(&N  , &tmp, sizeof(tmp));                  \
-            C = N;                                            \
-        }                                                     \
-    } while(0)
-
-    ROTATE(int tmp,             v->last_use_ic, v->next_use_ic, v->curr_use_ic, v->aux_use_ic);
-    ROTATE(uint8_t tmp[2][256], v->last_luty,   v->next_luty,   v->curr_luty,   v->aux_luty);
-    ROTATE(uint8_t tmp[2][256], v->last_lutuv,  v->next_lutuv,  v->curr_lutuv,  v->aux_lutuv);
-
-    INIT_LUT(32, 0, v->curr_luty[0], v->curr_lutuv[0], 0);
-    INIT_LUT(32, 0, v->curr_luty[1], v->curr_lutuv[1], 0);
-    v->curr_use_ic = 0;
-    if (v->curr_luty == v->next_luty) {
-        // If we just initialized next_lut, clear next_use_ic to match.
-        v->next_use_ic = 0;
-    }
-}
-
-int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
-{
-    int pqindex, lowquant, status;
-
-    if (v->finterpflag)
-        v->interpfrm = get_bits1(gb);
-    if (v->s.avctx->codec_id == AV_CODEC_ID_MSS2)
-        v->respic   =
-        v->rangered =
-        v->multires = get_bits(gb, 2) == 1;
-    else
-        skip_bits(gb, 2); //framecnt unused
-    v->rangeredfrm = 0;
-    if (v->rangered)
-        v->rangeredfrm = get_bits1(gb);
-    v->s.pict_type = get_bits1(gb);
-    if (v->s.avctx->max_b_frames) {
-        if (!v->s.pict_type) {
-            if (get_bits1(gb))
-                v->s.pict_type = AV_PICTURE_TYPE_I;
-            else
-                v->s.pict_type = AV_PICTURE_TYPE_B;
-        } else
-            v->s.pict_type = AV_PICTURE_TYPE_P;
-    } else
-        v->s.pict_type = v->s.pict_type ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
-
-    v->bi_type = 0;
-    if (v->s.pict_type == AV_PICTURE_TYPE_B) {
-        v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
-        v->bfraction           = ff_vc1_bfraction_lut[v->bfraction_lut_index];
-        if (v->bfraction == 0) {
-            v->s.pict_type = AV_PICTURE_TYPE_BI;
-        }
-    }
-    if (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)
-        skip_bits(gb, 7); // skip buffer fullness
-
-    if (v->parse_only)
-        return 0;
-
-    /* calculate RND */
-    if (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)
-        v->rnd = 1;
-    if (v->s.pict_type == AV_PICTURE_TYPE_P)
-        v->rnd ^= 1;
-
-    /* Quantizer stuff */
-    pqindex = get_bits(gb, 5);
-    if (!pqindex)
-        return -1;
-    if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
-        v->pq = ff_vc1_pquant_table[0][pqindex];
-    else
-        v->pq = ff_vc1_pquant_table[1][pqindex];
-
-    v->pquantizer = 1;
-    if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
-        v->pquantizer = pqindex < 9;
-    if (v->quantizer_mode == QUANT_NON_UNIFORM)
-        v->pquantizer = 0;
-    v->pqindex = pqindex;
-    if (pqindex < 9)
-        v->halfpq = get_bits1(gb);
-    else
-        v->halfpq = 0;
-    if (v->quantizer_mode == QUANT_FRAME_EXPLICIT)
-        v->pquantizer = get_bits1(gb);
-    v->dquantfrm = 0;
-    if (v->extended_mv == 1)
-        v->mvrange = get_unary(gb, 0, 3);
-    v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13
-    v->k_y = v->mvrange + 8; //k_y can be 8 9 10 11
-    v->range_x = 1 << (v->k_x - 1);
-    v->range_y = 1 << (v->k_y - 1);
-    if (v->multires && v->s.pict_type != AV_PICTURE_TYPE_B)
-        v->respic = get_bits(gb, 2);
-
-    if (v->res_x8 && (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)) {
-        v->x8_type = get_bits1(gb);
-    } else
-        v->x8_type = 0;
-    av_dlog(v->s.avctx, "%c Frame: QP=[%i]%i (+%i/2) %i\n",
-            (v->s.pict_type == AV_PICTURE_TYPE_P) ? 'P' : ((v->s.pict_type == AV_PICTURE_TYPE_I) ? 'I' : 'B'),
-            pqindex, v->pq, v->halfpq, v->rangeredfrm);
-
-    if (v->first_pic_header_flag)
-        rotate_luts(v);
-
-    switch (v->s.pict_type) {
-    case AV_PICTURE_TYPE_P:
-        if (v->pq < 5)       v->tt_index = 0;
-        else if (v->pq < 13) v->tt_index = 1;
-        else                 v->tt_index = 2;
-
-        lowquant = (v->pq > 12) ? 0 : 1;
-        v->mv_mode = ff_vc1_mv_pmode_table[lowquant][get_unary(gb, 1, 4)];
-        if (v->mv_mode == MV_PMODE_INTENSITY_COMP) {
-            v->mv_mode2 = ff_vc1_mv_pmode_table2[lowquant][get_unary(gb, 1, 3)];
-            v->lumscale = get_bits(gb, 6);
-            v->lumshift = get_bits(gb, 6);
-            v->last_use_ic = 1;
-            /* fill lookup tables for intensity compensation */
-            INIT_LUT(v->lumscale, v->lumshift, v->last_luty[0], v->last_lutuv[0], 1);
-            INIT_LUT(v->lumscale, v->lumshift, v->last_luty[1], v->last_lutuv[1], 1);
-        }
-        v->qs_last = v->s.quarter_sample;
-        if (v->mv_mode == MV_PMODE_1MV_HPEL || v->mv_mode == MV_PMODE_1MV_HPEL_BILIN)
-            v->s.quarter_sample = 0;
-        else if (v->mv_mode == MV_PMODE_INTENSITY_COMP) {
-            if (v->mv_mode2 == MV_PMODE_1MV_HPEL || v->mv_mode2 == MV_PMODE_1MV_HPEL_BILIN)
-                v->s.quarter_sample = 0;
-            else
-                v->s.quarter_sample = 1;
-        } else
-            v->s.quarter_sample = 1;
-        v->s.mspel = !(v->mv_mode == MV_PMODE_1MV_HPEL_BILIN || (v->mv_mode == MV_PMODE_INTENSITY_COMP && v->mv_mode2 == MV_PMODE_1MV_HPEL_BILIN));
-
-        if ((v->mv_mode  == MV_PMODE_INTENSITY_COMP &&
-             v->mv_mode2 == MV_PMODE_MIXED_MV)      ||
-            v->mv_mode   == MV_PMODE_MIXED_MV) {
-            status = bitplane_decoding(v->mv_type_mb_plane, &v->mv_type_is_raw, v);
-            if (status < 0)
-                return -1;
-            av_log(v->s.avctx, AV_LOG_DEBUG, "MB MV Type plane encoding: "
-                   "Imode: %i, Invert: %i\n", status>>1, status&1);
-        } else {
-            v->mv_type_is_raw = 0;
-            memset(v->mv_type_mb_plane, 0, v->s.mb_stride * v->s.mb_height);
-        }
-        status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
-        if (status < 0)
-            return -1;
-        av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
-               "Imode: %i, Invert: %i\n", status>>1, status&1);
-
-        /* Hopefully this is correct for P frames */
-        v->s.mv_table_index = get_bits(gb, 2); //but using ff_vc1_ tables
-        v->cbpcy_vlc = &ff_vc1_cbpcy_p_vlc[get_bits(gb, 2)];
-
-        if (v->dquant) {
-            av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
-            vop_dquant_decoding(v);
-        }
-
-        v->ttfrm = 0; //FIXME Is that so ?
-        if (v->vstransform) {
-            v->ttmbf = get_bits1(gb);
-            if (v->ttmbf) {
-                v->ttfrm = ff_vc1_ttfrm_to_tt[get_bits(gb, 2)];
-            }
-        } else {
-            v->ttmbf = 1;
-            v->ttfrm = TT_8X8;
-        }
-        break;
-    case AV_PICTURE_TYPE_B:
-        if (v->pq < 5)       v->tt_index = 0;
-        else if (v->pq < 13) v->tt_index = 1;
-        else                 v->tt_index = 2;
-
-        v->mv_mode          = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN;
-        v->qs_last          = v->s.quarter_sample;
-        v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV);
-        v->s.mspel          = v->s.quarter_sample;
-
-        status = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v);
-        if (status < 0)
-            return -1;
-        av_log(v->s.avctx, AV_LOG_DEBUG, "MB Direct Type plane encoding: "
-               "Imode: %i, Invert: %i\n", status>>1, status&1);
-        status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
-        if (status < 0)
-            return -1;
-        av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
-               "Imode: %i, Invert: %i\n", status>>1, status&1);
-
-        v->s.mv_table_index = get_bits(gb, 2);
-        v->cbpcy_vlc        = &ff_vc1_cbpcy_p_vlc[get_bits(gb, 2)];
-
-        if (v->dquant) {
-            av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
-            vop_dquant_decoding(v);
-        }
-
-        v->ttfrm = 0;
-        if (v->vstransform) {
-            v->ttmbf = get_bits1(gb);
-            if (v->ttmbf) {
-                v->ttfrm = ff_vc1_ttfrm_to_tt[get_bits(gb, 2)];
-            }
-        } else {
-            v->ttmbf = 1;
-            v->ttfrm = TT_8X8;
-        }
-        break;
-    }
-
-    if (!v->x8_type) {
-        /* AC Syntax */
-        v->c_ac_table_index = decode012(gb);
-        if (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI) {
-            v->y_ac_table_index = decode012(gb);
-        }
-        /* DC Syntax */
-        v->s.dc_table_index = get_bits1(gb);
-    }
-
-    if (v->s.pict_type == AV_PICTURE_TYPE_BI) {
-        v->s.pict_type = AV_PICTURE_TYPE_B;
-        v->bi_type     = 1;
-    }
-    return 0;
-}
-
-int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
-{
-    int pqindex, lowquant;
-    int status;
-    int mbmodetab, imvtab, icbptab, twomvbptab, fourmvbptab; /* useful only for debugging */
-    int field_mode, fcm;
-
-    v->numref          = 0;
-    v->p_frame_skipped = 0;
-    if (v->second_field) {
-        v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
-        if (v->fptype & 4)
-            v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_BI : AV_PICTURE_TYPE_B;
-        v->s.current_picture_ptr->f.pict_type = v->s.pict_type;
-        if (!v->pic_header_flag)
-            goto parse_common_info;
-    }
-
-    field_mode = 0;
-    if (v->interlace) {
-        fcm = decode012(gb);
-        if (fcm) {
-            if (fcm == ILACE_FIELD)
-                field_mode = 1;
-        }
-    } else {
-        fcm = PROGRESSIVE;
-    }
-    if (!v->first_pic_header_flag && v->field_mode != field_mode)
-        return AVERROR_INVALIDDATA;
-    v->field_mode = field_mode;
-    v->fcm = fcm;
-
-    if (v->field_mode) {
-        v->s.mb_height = FFALIGN(v->s.height + 15 >> 4, 2);
-        v->fptype = get_bits(gb, 3);
-        v->s.pict_type = (v->fptype & 2) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
-        if (v->fptype & 4) // B-picture
-            v->s.pict_type = (v->fptype & 2) ? AV_PICTURE_TYPE_BI : AV_PICTURE_TYPE_B;
-    } else {
-        v->s.mb_height = v->s.height + 15 >> 4;
-        switch (get_unary(gb, 0, 4)) {
-        case 0:
-            v->s.pict_type = AV_PICTURE_TYPE_P;
-            break;
-        case 1:
-            v->s.pict_type = AV_PICTURE_TYPE_B;
-            break;
-        case 2:
-            v->s.pict_type = AV_PICTURE_TYPE_I;
-            break;
-        case 3:
-            v->s.pict_type = AV_PICTURE_TYPE_BI;
-            break;
-        case 4:
-            v->s.pict_type = AV_PICTURE_TYPE_P; // skipped pic
-            v->p_frame_skipped = 1;
-            break;
-        }
-    }
-    if (v->tfcntrflag)
-        skip_bits(gb, 8);
-    if (v->broadcast) {
-        if (!v->interlace || v->psf) {
-            v->rptfrm = get_bits(gb, 2);
-        } else {
-            v->tff = get_bits1(gb);
-            v->rff = get_bits1(gb);
-        }
-    }
-    if (v->panscanflag) {
-        avpriv_report_missing_feature(v->s.avctx, "Pan-scan");
-        //...
-    }
-    if (v->p_frame_skipped) {
-        return 0;
-    }
-    v->rnd = get_bits1(gb);
-    if (v->interlace)
-        v->uvsamp = get_bits1(gb);
-    if (v->field_mode) {
-        if (!v->refdist_flag)
-            v->refdist = 0;
-        else if ((v->s.pict_type != AV_PICTURE_TYPE_B) && (v->s.pict_type != AV_PICTURE_TYPE_BI)) {
-            v->refdist = get_bits(gb, 2);
-            if (v->refdist == 3)
-                v->refdist += get_unary(gb, 0, 16);
-        }
-        if ((v->s.pict_type == AV_PICTURE_TYPE_B) || (v->s.pict_type == AV_PICTURE_TYPE_BI)) {
-            v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
-            v->bfraction           = ff_vc1_bfraction_lut[v->bfraction_lut_index];
-            v->frfd = (v->bfraction * v->refdist) >> 8;
-            v->brfd = v->refdist - v->frfd - 1;
-            if (v->brfd < 0)
-                v->brfd = 0;
-        }
-        goto parse_common_info;
-    }
-    if (v->fcm == PROGRESSIVE) {
-        if (v->finterpflag)
-            v->interpfrm = get_bits1(gb);
-        if (v->s.pict_type == AV_PICTURE_TYPE_B) {
-            v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
-            v->bfraction           = ff_vc1_bfraction_lut[v->bfraction_lut_index];
-            if (v->bfraction == 0) {
-                v->s.pict_type = AV_PICTURE_TYPE_BI; /* XXX: should not happen here */
-            }
-        }
-    }
-
-    parse_common_info:
-    if (v->field_mode)
-        v->cur_field_type = !(v->tff ^ v->second_field);
-    pqindex = get_bits(gb, 5);
-    if (!pqindex)
-        return -1;
-    v->pqindex = pqindex;
-    if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
-        v->pq = ff_vc1_pquant_table[0][pqindex];
-    else
-        v->pq = ff_vc1_pquant_table[1][pqindex];
-
-    v->pquantizer = 1;
-    if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
-        v->pquantizer = pqindex < 9;
-    if (v->quantizer_mode == QUANT_NON_UNIFORM)
-        v->pquantizer = 0;
-    v->pqindex = pqindex;
-    if (pqindex < 9)
-        v->halfpq = get_bits1(gb);
-    else
-        v->halfpq = 0;
-    if (v->quantizer_mode == QUANT_FRAME_EXPLICIT)
-        v->pquantizer = get_bits1(gb);
-    if (v->postprocflag)
-        v->postproc = get_bits(gb, 2);
-
-    if (v->parse_only)
-        return 0;
-
-    if (v->first_pic_header_flag)
-        rotate_luts(v);
-
-    switch (v->s.pict_type) {
-    case AV_PICTURE_TYPE_I:
-    case AV_PICTURE_TYPE_BI:
-        if (v->fcm == ILACE_FRAME) { //interlace frame picture
-            status = bitplane_decoding(v->fieldtx_plane, &v->fieldtx_is_raw, v);
-            if (status < 0)
-                return -1;
-            av_log(v->s.avctx, AV_LOG_DEBUG, "FIELDTX plane encoding: "
-                   "Imode: %i, Invert: %i\n", status>>1, status&1);
-        }
-        status = bitplane_decoding(v->acpred_plane, &v->acpred_is_raw, v);
-        if (status < 0)
-            return -1;
-        av_log(v->s.avctx, AV_LOG_DEBUG, "ACPRED plane encoding: "
-               "Imode: %i, Invert: %i\n", status>>1, status&1);
-        v->condover = CONDOVER_NONE;
-        if (v->overlap && v->pq <= 8) {
-            v->condover = decode012(gb);
-            if (v->condover == CONDOVER_SELECT) {
-                status = bitplane_decoding(v->over_flags_plane, &v->overflg_is_raw, v);
-                if (status < 0)
-                    return -1;
-                av_log(v->s.avctx, AV_LOG_DEBUG, "CONDOVER plane encoding: "
-                       "Imode: %i, Invert: %i\n", status>>1, status&1);
-            }
-        }
-        break;
-    case AV_PICTURE_TYPE_P:
-        if (v->field_mode) {
-            v->numref = get_bits1(gb);
-            if (!v->numref) {
-                v->reffield          = get_bits1(gb);
-                v->ref_field_type[0] = v->reffield ^ !v->cur_field_type;
-            }
-        }
-        if (v->extended_mv)
-            v->mvrange = get_unary(gb, 0, 3);
-        else
-            v->mvrange = 0;
-        if (v->interlace) {
-            if (v->extended_dmv)
-                v->dmvrange = get_unary(gb, 0, 3);
-            else
-                v->dmvrange = 0;
-            if (v->fcm == ILACE_FRAME) { // interlaced frame picture
-                v->fourmvswitch = get_bits1(gb);
-                v->intcomp      = get_bits1(gb);
-                if (v->intcomp) {
-                    v->lumscale = get_bits(gb, 6);
-                    v->lumshift = get_bits(gb, 6);
-                    INIT_LUT(v->lumscale, v->lumshift, v->last_luty[0], v->last_lutuv[0], 1);
-                    INIT_LUT(v->lumscale, v->lumshift, v->last_luty[1], v->last_lutuv[1], 1);
-                    v->last_use_ic = 1;
-                }
-                status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
-                av_log(v->s.avctx, AV_LOG_DEBUG, "SKIPMB plane encoding: "
-                       "Imode: %i, Invert: %i\n", status>>1, status&1);
-                mbmodetab = get_bits(gb, 2);
-                if (v->fourmvswitch)
-                    v->mbmode_vlc = &ff_vc1_intfr_4mv_mbmode_vlc[mbmodetab];
-                else
-                    v->mbmode_vlc = &ff_vc1_intfr_non4mv_mbmode_vlc[mbmodetab];
-                imvtab         = get_bits(gb, 2);
-                v->imv_vlc     = &ff_vc1_1ref_mvdata_vlc[imvtab];
-                // interlaced p-picture cbpcy range is [1, 63]
-                icbptab        = get_bits(gb, 3);
-                v->cbpcy_vlc   = &ff_vc1_icbpcy_vlc[icbptab];
-                twomvbptab     = get_bits(gb, 2);
-                v->twomvbp_vlc = &ff_vc1_2mv_block_pattern_vlc[twomvbptab];
-                if (v->fourmvswitch) {
-                    fourmvbptab     = get_bits(gb, 2);
-                    v->fourmvbp_vlc = &ff_vc1_4mv_block_pattern_vlc[fourmvbptab];
-                }
-            }
-        }
-        v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13
-        v->k_y = v->mvrange + 8; //k_y can be 8 9 10 11
-        v->range_x = 1 << (v->k_x - 1);
-        v->range_y = 1 << (v->k_y - 1);
-
-        if (v->pq < 5)
-            v->tt_index = 0;
-        else if (v->pq < 13)
-            v->tt_index = 1;
-        else
-            v->tt_index = 2;
-        if (v->fcm != ILACE_FRAME) {
-            int mvmode;
-            mvmode     = get_unary(gb, 1, 4);
-            lowquant   = (v->pq > 12) ? 0 : 1;
-            v->mv_mode = ff_vc1_mv_pmode_table[lowquant][mvmode];
-            if (v->mv_mode == MV_PMODE_INTENSITY_COMP) {
-                int mvmode2;
-                mvmode2 = get_unary(gb, 1, 3);
-                v->mv_mode2 = ff_vc1_mv_pmode_table2[lowquant][mvmode2];
-                if (v->field_mode) {
-                    v->intcompfield = decode210(gb) ^ 3;
-                } else
-                    v->intcompfield = 3;
-
-                v->lumscale2 = v->lumscale = 32;
-                v->lumshift2 = v->lumshift =  0;
-                if (v->intcompfield & 1) {
-                    v->lumscale = get_bits(gb, 6);
-                    v->lumshift = get_bits(gb, 6);
-                }
-                if ((v->intcompfield & 2) && v->field_mode) {
-                    v->lumscale2 = get_bits(gb, 6);
-                    v->lumshift2 = get_bits(gb, 6);
-                } else if(!v->field_mode) {
-                    v->lumscale2 = v->lumscale;
-                    v->lumshift2 = v->lumshift;
-                }
-                if (v->field_mode && v->second_field) {
-                    if (v->cur_field_type) {
-                        INIT_LUT(v->lumscale , v->lumshift , v->curr_luty[v->cur_field_type^1], v->curr_lutuv[v->cur_field_type^1], 0);
-                        INIT_LUT(v->lumscale2, v->lumshift2, v->last_luty[v->cur_field_type  ], v->last_lutuv[v->cur_field_type  ], 1);
-                    } else {
-                        INIT_LUT(v->lumscale2, v->lumshift2, v->curr_luty[v->cur_field_type^1], v->curr_lutuv[v->cur_field_type^1], 0);
-                        INIT_LUT(v->lumscale , v->lumshift , v->last_luty[v->cur_field_type  ], v->last_lutuv[v->cur_field_type  ], 1);
-                    }
-                    v->next_use_ic = v->curr_use_ic = 1;
-                } else {
-                    INIT_LUT(v->lumscale , v->lumshift , v->last_luty[0], v->last_lutuv[0], 1);
-                    INIT_LUT(v->lumscale2, v->lumshift2, v->last_luty[1], v->last_lutuv[1], 1);
-                }
-                v->last_use_ic = 1;
-            }
-            v->qs_last = v->s.quarter_sample;
-            if (v->mv_mode == MV_PMODE_1MV_HPEL || v->mv_mode == MV_PMODE_1MV_HPEL_BILIN)
-                v->s.quarter_sample = 0;
-            else if (v->mv_mode == MV_PMODE_INTENSITY_COMP) {
-                if (v->mv_mode2 == MV_PMODE_1MV_HPEL || v->mv_mode2 == MV_PMODE_1MV_HPEL_BILIN)
-                    v->s.quarter_sample = 0;
-                else
-                    v->s.quarter_sample = 1;
-            } else
-                v->s.quarter_sample = 1;
-            v->s.mspel = !(v->mv_mode == MV_PMODE_1MV_HPEL_BILIN
-                           || (v->mv_mode == MV_PMODE_INTENSITY_COMP
-                               && v->mv_mode2 == MV_PMODE_1MV_HPEL_BILIN));
-        }
-        if (v->fcm == PROGRESSIVE) { // progressive
-            if ((v->mv_mode == MV_PMODE_INTENSITY_COMP &&
-                 v->mv_mode2 == MV_PMODE_MIXED_MV)
-                || v->mv_mode == MV_PMODE_MIXED_MV) {
-                status = bitplane_decoding(v->mv_type_mb_plane, &v->mv_type_is_raw, v);
-                if (status < 0)
-                    return -1;
-                av_log(v->s.avctx, AV_LOG_DEBUG, "MB MV Type plane encoding: "
-                       "Imode: %i, Invert: %i\n", status>>1, status&1);
-            } else {
-                v->mv_type_is_raw = 0;
-                memset(v->mv_type_mb_plane, 0, v->s.mb_stride * v->s.mb_height);
-            }
-            status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
-            if (status < 0)
-                return -1;
-            av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
-                   "Imode: %i, Invert: %i\n", status>>1, status&1);
-
-            /* Hopefully this is correct for P frames */
-            v->s.mv_table_index = get_bits(gb, 2); //but using ff_vc1_ tables
-            v->cbpcy_vlc        = &ff_vc1_cbpcy_p_vlc[get_bits(gb, 2)];
-        } else if (v->fcm == ILACE_FRAME) { // frame interlaced
-            v->qs_last          = v->s.quarter_sample;
-            v->s.quarter_sample = 1;
-            v->s.mspel          = 1;
-        } else {    // field interlaced
-            mbmodetab = get_bits(gb, 3);
-            imvtab = get_bits(gb, 2 + v->numref);
-            if (!v->numref)
-                v->imv_vlc = &ff_vc1_1ref_mvdata_vlc[imvtab];
-            else
-                v->imv_vlc = &ff_vc1_2ref_mvdata_vlc[imvtab];
-            icbptab = get_bits(gb, 3);
-            v->cbpcy_vlc = &ff_vc1_icbpcy_vlc[icbptab];
-            if ((v->mv_mode == MV_PMODE_INTENSITY_COMP &&
-                v->mv_mode2 == MV_PMODE_MIXED_MV) || v->mv_mode == MV_PMODE_MIXED_MV) {
-                fourmvbptab     = get_bits(gb, 2);
-                v->fourmvbp_vlc = &ff_vc1_4mv_block_pattern_vlc[fourmvbptab];
-                v->mbmode_vlc = &ff_vc1_if_mmv_mbmode_vlc[mbmodetab];
-            } else {
-                v->mbmode_vlc = &ff_vc1_if_1mv_mbmode_vlc[mbmodetab];
-            }
-        }
-        if (v->dquant) {
-            av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
-            vop_dquant_decoding(v);
-        }
-
-        v->ttfrm = 0; //FIXME Is that so ?
-        if (v->vstransform) {
-            v->ttmbf = get_bits1(gb);
-            if (v->ttmbf) {
-                v->ttfrm = ff_vc1_ttfrm_to_tt[get_bits(gb, 2)];
-            }
-        } else {
-            v->ttmbf = 1;
-            v->ttfrm = TT_8X8;
-        }
-        break;
-    case AV_PICTURE_TYPE_B:
-        if (v->fcm == ILACE_FRAME) {
-            v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
-            v->bfraction           = ff_vc1_bfraction_lut[v->bfraction_lut_index];
-            if (v->bfraction == 0) {
-                return -1;
-            }
-        }
-        if (v->extended_mv)
-            v->mvrange = get_unary(gb, 0, 3);
-        else
-            v->mvrange = 0;
-        v->k_x     = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13
-        v->k_y     = v->mvrange + 8; //k_y can be 8 9 10 11
-        v->range_x = 1 << (v->k_x - 1);
-        v->range_y = 1 << (v->k_y - 1);
-
-        if (v->pq < 5)
-            v->tt_index = 0;
-        else if (v->pq < 13)
-            v->tt_index = 1;
-        else
-            v->tt_index = 2;
-
-        if (v->field_mode) {
-            int mvmode;
-            if (v->extended_dmv)
-                v->dmvrange = get_unary(gb, 0, 3);
-            mvmode = get_unary(gb, 1, 3);
-            lowquant = (v->pq > 12) ? 0 : 1;
-            v->mv_mode          = ff_vc1_mv_pmode_table2[lowquant][mvmode];
-            v->qs_last          = v->s.quarter_sample;
-            v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV || v->mv_mode == MV_PMODE_MIXED_MV);
-            v->s.mspel          = !(v->mv_mode == MV_PMODE_1MV_HPEL_BILIN || v->mv_mode == MV_PMODE_1MV_HPEL);
-            status = bitplane_decoding(v->forward_mb_plane, &v->fmb_is_raw, v);
-            if (status < 0)
-                return -1;
-            av_log(v->s.avctx, AV_LOG_DEBUG, "MB Forward Type plane encoding: "
-                   "Imode: %i, Invert: %i\n", status>>1, status&1);
-            mbmodetab = get_bits(gb, 3);
-            if (v->mv_mode == MV_PMODE_MIXED_MV)
-                v->mbmode_vlc = &ff_vc1_if_mmv_mbmode_vlc[mbmodetab];
-            else
-                v->mbmode_vlc = &ff_vc1_if_1mv_mbmode_vlc[mbmodetab];
-            imvtab       = get_bits(gb, 3);
-            v->imv_vlc   = &ff_vc1_2ref_mvdata_vlc[imvtab];
-            icbptab      = get_bits(gb, 3);
-            v->cbpcy_vlc = &ff_vc1_icbpcy_vlc[icbptab];
-            if (v->mv_mode == MV_PMODE_MIXED_MV) {
-                fourmvbptab     = get_bits(gb, 2);
-                v->fourmvbp_vlc = &ff_vc1_4mv_block_pattern_vlc[fourmvbptab];
-            }
-            v->numref = 1; // interlaced field B pictures are always 2-ref
-        } else if (v->fcm == ILACE_FRAME) {
-            if (v->extended_dmv)
-                v->dmvrange = get_unary(gb, 0, 3);
-            if (get_bits1(gb)) /* intcomp - present but shall always be 0 */
-                av_log(v->s.avctx, AV_LOG_WARNING, "Intensity compensation set for B picture\n");
-            v->intcomp          = 0;
-            v->mv_mode          = MV_PMODE_1MV;
-            v->fourmvswitch     = 0;
-            v->qs_last          = v->s.quarter_sample;
-            v->s.quarter_sample = 1;
-            v->s.mspel          = 1;
-            status              = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v);
-            if (status < 0)
-                return -1;
-            av_log(v->s.avctx, AV_LOG_DEBUG, "MB Direct Type plane encoding: "
-                   "Imode: %i, Invert: %i\n", status>>1, status&1);
-            status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
-            if (status < 0)
-                return -1;
-            av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
-                   "Imode: %i, Invert: %i\n", status>>1, status&1);
-            mbmodetab       = get_bits(gb, 2);
-            v->mbmode_vlc   = &ff_vc1_intfr_non4mv_mbmode_vlc[mbmodetab];
-            imvtab          = get_bits(gb, 2);
-            v->imv_vlc      = &ff_vc1_1ref_mvdata_vlc[imvtab];
-            // interlaced p/b-picture cbpcy range is [1, 63]
-            icbptab         = get_bits(gb, 3);
-            v->cbpcy_vlc    = &ff_vc1_icbpcy_vlc[icbptab];
-            twomvbptab      = get_bits(gb, 2);
-            v->twomvbp_vlc  = &ff_vc1_2mv_block_pattern_vlc[twomvbptab];
-            fourmvbptab     = get_bits(gb, 2);
-            v->fourmvbp_vlc = &ff_vc1_4mv_block_pattern_vlc[fourmvbptab];
-        } else {
-            v->mv_mode          = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN;
-            v->qs_last          = v->s.quarter_sample;
-            v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV);
-            v->s.mspel          = v->s.quarter_sample;
-            status              = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v);
-            if (status < 0)
-                return -1;
-            av_log(v->s.avctx, AV_LOG_DEBUG, "MB Direct Type plane encoding: "
-                   "Imode: %i, Invert: %i\n", status>>1, status&1);
-            status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
-            if (status < 0)
-                return -1;
-            av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
-                   "Imode: %i, Invert: %i\n", status>>1, status&1);
-            v->s.mv_table_index = get_bits(gb, 2);
-            v->cbpcy_vlc = &ff_vc1_cbpcy_p_vlc[get_bits(gb, 2)];
-        }
-
-        if (v->dquant) {
-            av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
-            vop_dquant_decoding(v);
-        }
-
-        v->ttfrm = 0;
-        if (v->vstransform) {
-            v->ttmbf = get_bits1(gb);
-            if (v->ttmbf) {
-                v->ttfrm = ff_vc1_ttfrm_to_tt[get_bits(gb, 2)];
-            }
-        } else {
-            v->ttmbf = 1;
-            v->ttfrm = TT_8X8;
-        }
-        break;
-    }
-
-    if (v->fcm != PROGRESSIVE && !v->s.quarter_sample) {
-        v->range_x <<= 1;
-        v->range_y <<= 1;
-    }
-
-    /* AC Syntax */
-    v->c_ac_table_index = decode012(gb);
-    if (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI) {
-        v->y_ac_table_index = decode012(gb);
-    }
-    /* DC Syntax */
-    v->s.dc_table_index = get_bits1(gb);
-    if ((v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)
-        && v->dquant) {
-        av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
-        vop_dquant_decoding(v);
-    }
-
-    v->bi_type = 0;
-    if (v->s.pict_type == AV_PICTURE_TYPE_BI) {
-        v->s.pict_type = AV_PICTURE_TYPE_B;
-        v->bi_type = 1;
-    }
-    return 0;
-}
-
-static const uint32_t vc1_ac_tables[AC_MODES][186][2] = {
-{
-{ 0x0001,  2}, { 0x0005,  3}, { 0x000D,  4}, { 0x0012,  5}, { 0x000E,  6}, { 0x0015,  7},
-{ 0x0013,  8}, { 0x003F,  8}, { 0x004B,  9}, { 0x011F,  9}, { 0x00B8, 10}, { 0x03E3, 10},
-{ 0x0172, 11}, { 0x024D, 12}, { 0x03DA, 12}, { 0x02DD, 13}, { 0x1F55, 13}, { 0x05B9, 14},
-{ 0x3EAE, 14}, { 0x0000,  4}, { 0x0010,  5}, { 0x0008,  7}, { 0x0020,  8}, { 0x0029,  9},
-{ 0x01F4,  9}, { 0x0233, 10}, { 0x01E0, 11}, { 0x012A, 12}, { 0x03DD, 12}, { 0x050A, 13},
-{ 0x1F29, 13}, { 0x0A42, 14}, { 0x1272, 15}, { 0x1737, 15}, { 0x0003,  5}, { 0x0011,  7},
-{ 0x00C4,  8}, { 0x004B, 10}, { 0x00B4, 11}, { 0x07D4, 11}, { 0x0345, 12}, { 0x02D7, 13},
-{ 0x07BF, 13}, { 0x0938, 14}, { 0x0BBB, 14}, { 0x095E, 15}, { 0x0013,  5}, { 0x0078,  7},
-{ 0x0069,  9}, { 0x0232, 10}, { 0x0461, 11}, { 0x03EC, 12}, { 0x0520, 13}, { 0x1F2A, 13},
-{ 0x3E50, 14}, { 0x3E51, 14}, { 0x1486, 15}, { 0x000C,  6}, { 0x0024,  9}, { 0x0094, 11},
-{ 0x08C0, 12}, { 0x0F09, 14}, { 0x1EF0, 15}, { 0x003D,  6}, { 0x0053,  9}, { 0x01A0, 11},
-{ 0x02D6, 13}, { 0x0F08, 14}, { 0x0013,  7}, { 0x007C,  9}, { 0x07C1, 11}, { 0x04AC, 14},
-{ 0x001B,  7}, { 0x00A0, 10}, { 0x0344, 12}, { 0x0F79, 14}, { 0x0079,  7}, { 0x03E1, 10},
-{ 0x02D4, 13}, { 0x2306, 14}, { 0x0021,  8}, { 0x023C, 10}, { 0x0FAE, 12}, { 0x23DE, 14},
-{ 0x0035,  8}, { 0x0175, 11}, { 0x07B3, 13}, { 0x00C5,  8}, { 0x0174, 11}, { 0x0785, 13},
-{ 0x0048,  9}, { 0x01A3, 11}, { 0x049E, 13}, { 0x002C,  9}, { 0x00FA, 10}, { 0x07D6, 11},
-{ 0x0092, 10}, { 0x05CC, 13}, { 0x1EF1, 15}, { 0x00A3, 10}, { 0x03ED, 12}, { 0x093E, 14},
-{ 0x01E2, 11}, { 0x1273, 15}, { 0x07C4, 11}, { 0x1487, 15}, { 0x0291, 12}, { 0x0293, 12},
-{ 0x0F8A, 12}, { 0x0509, 13}, { 0x0508, 13}, { 0x078D, 13}, { 0x07BE, 13}, { 0x078C, 13},
-{ 0x04AE, 14}, { 0x0BBA, 14}, { 0x2307, 14}, { 0x0B9A, 14}, { 0x1736, 15}, { 0x000E,  4},
-{ 0x0045,  7}, { 0x01F3,  9}, { 0x047A, 11}, { 0x05DC, 13}, { 0x23DF, 14}, { 0x0019,  5},
-{ 0x0028,  9}, { 0x0176, 11}, { 0x049D, 13}, { 0x23DD, 14}, { 0x0030,  6}, { 0x00A2, 10},
-{ 0x02EF, 12}, { 0x05B8, 14}, { 0x003F,  6}, { 0x00A5, 10}, { 0x03DB, 12}, { 0x093F, 14},
-{ 0x0044,  7}, { 0x07CB, 11}, { 0x095F, 15}, { 0x0063,  7}, { 0x03C3, 12}, { 0x0015,  8},
-{ 0x08F6, 12}, { 0x0017,  8}, { 0x0498, 13}, { 0x002C,  8}, { 0x07B2, 13}, { 0x002F,  8},
-{ 0x1F54, 13}, { 0x008D,  8}, { 0x07BD, 13}, { 0x008E,  8}, { 0x1182, 13}, { 0x00FB,  8},
-{ 0x050B, 13}, { 0x002D,  8}, { 0x07C0, 11}, { 0x0079,  9}, { 0x1F5F, 13}, { 0x007A,  9},
-{ 0x1F56, 13}, { 0x0231, 10}, { 0x03E4, 10}, { 0x01A1, 11}, { 0x0143, 11}, { 0x01F7, 11},
-{ 0x016F, 12}, { 0x0292, 12}, { 0x02E7, 12}, { 0x016C, 12}, { 0x016D, 12}, { 0x03DC, 12},
-{ 0x0F8B, 12}, { 0x0499, 13}, { 0x03D8, 12}, { 0x078E, 13}, { 0x02D5, 13}, { 0x1F5E, 13},
-{ 0x1F2B, 13}, { 0x078F, 13}, { 0x04AD, 14}, { 0x3EAF, 14}, { 0x23DC, 14}, { 0x004A,  9}
-},
-{
-{ 0x0000,  3}, { 0x0003,  4}, { 0x000B,  5}, { 0x0014,  6}, { 0x003F,  6}, { 0x005D,  7},
-{ 0x00A2,  8}, { 0x00AC,  9}, { 0x016E,  9}, { 0x020A, 10}, { 0x02E2, 10}, { 0x0432, 11},
-{ 0x05C9, 11}, { 0x0827, 12}, { 0x0B54, 12}, { 0x04E6, 13}, { 0x105F, 13}, { 0x172A, 13},
-{ 0x20B2, 14}, { 0x2D4E, 14}, { 0x39F0, 14}, { 0x4175, 15}, { 0x5A9E, 15}, { 0x0004,  4},
-{ 0x001E,  5}, { 0x0042,  7}, { 0x00B6,  8}, { 0x0173,  9}, { 0x0395, 10}, { 0x072E, 11},
-{ 0x0B94, 12}, { 0x16A4, 13}, { 0x20B3, 14}, { 0x2E45, 14}, { 0x0005,  5}, { 0x0040,  7},
-{ 0x0049,  9}, { 0x028F, 10}, { 0x05CB, 11}, { 0x048A, 13}, { 0x09DD, 14}, { 0x73E2, 15},
-{ 0x0018,  5}, { 0x0025,  8}, { 0x008A, 10}, { 0x051B, 11}, { 0x0E5F, 12}, { 0x09C9, 14},
-{ 0x139C, 15}, { 0x0029,  6}, { 0x004F,  9}, { 0x0412, 11}, { 0x048D, 13}, { 0x2E41, 14},
-{ 0x0038,  6}, { 0x010E,  9}, { 0x05A8, 11}, { 0x105C, 13}, { 0x39F2, 14}, { 0x0058,  7},
-{ 0x021F, 10}, { 0x0E7E, 12}, { 0x39FF, 14}, { 0x0023,  8}, { 0x02E3, 10}, { 0x04E5, 13},
-{ 0x2E40, 14}, { 0x00A1,  8}, { 0x05BE, 11}, { 0x09C8, 14}, { 0x0083,  8}, { 0x013A, 11},
-{ 0x1721, 13}, { 0x0044,  9}, { 0x0276, 12}, { 0x39F6, 14}, { 0x008B, 10}, { 0x04EF, 13},
-{ 0x5A9B, 15}, { 0x0208, 10}, { 0x1CFE, 13}, { 0x0399, 10}, { 0x1CB4, 13}, { 0x039E, 10},
-{ 0x39F3, 14}, { 0x05AB, 11}, { 0x73E3, 15}, { 0x0737, 11}, { 0x5A9F, 15}, { 0x082D, 12},
-{ 0x0E69, 12}, { 0x0E68, 12}, { 0x0433, 11}, { 0x0B7B, 12}, { 0x2DF8, 14}, { 0x2E56, 14},
-{ 0x2E57, 14}, { 0x39F7, 14}, { 0x51A5, 15}, { 0x0003,  3}, { 0x002A,  6}, { 0x00E4,  8},
-{ 0x028E, 10}, { 0x0735, 11}, { 0x1058, 13}, { 0x1CFA, 13}, { 0x2DF9, 14}, { 0x4174, 15},
-{ 0x0009,  4}, { 0x0054,  8}, { 0x0398, 10}, { 0x048B, 13}, { 0x139D, 15}, { 0x000D,  4},
-{ 0x00AD,  9}, { 0x0826, 12}, { 0x2D4C, 14}, { 0x0011,  5}, { 0x016B,  9}, { 0x0B7F, 12},
-{ 0x51A4, 15}, { 0x0019,  5}, { 0x021B, 10}, { 0x16FD, 13}, { 0x001D,  5}, { 0x0394, 10},
-{ 0x28D3, 14}, { 0x002B,  6}, { 0x05BC, 11}, { 0x5A9A, 15}, { 0x002F,  6}, { 0x0247, 12},
-{ 0x0010,  7}, { 0x0A35, 12}, { 0x003E,  6}, { 0x0B7A, 12}, { 0x0059,  7}, { 0x105E, 13},
-{ 0x0026,  8}, { 0x09CF, 14}, { 0x0055,  8}, { 0x1CB5, 13}, { 0x0057,  8}, { 0x0E5B, 12},
-{ 0x00A0,  8}, { 0x1468, 13}, { 0x0170,  9}, { 0x0090, 10}, { 0x01CE,  9}, { 0x021A, 10},
-{ 0x0218, 10}, { 0x0168,  9}, { 0x021E, 10}, { 0x0244, 12}, { 0x0736, 11}, { 0x0138, 11},
-{ 0x0519, 11}, { 0x0E5E, 12}, { 0x072C, 11}, { 0x0B55, 12}, { 0x09DC, 14}, { 0x20BB, 14},
-{ 0x048C, 13}, { 0x1723, 13}, { 0x2E44, 14}, { 0x16A5, 13}, { 0x0518, 11}, { 0x39FE, 14},
-{ 0x0169,  9}
-},
-{
-{ 0x0001,  2}, { 0x0006,  3}, { 0x000F,  4}, { 0x0016,  5}, { 0x0020,  6}, { 0x0018,  7},
-{ 0x0008,  8}, { 0x009A,  8}, { 0x0056,  9}, { 0x013E,  9}, { 0x00F0, 10}, { 0x03A5, 10},
-{ 0x0077, 11}, { 0x01EF, 11}, { 0x009A, 12}, { 0x005D, 13}, { 0x0001,  4}, { 0x0011,  5},
-{ 0x0002,  7}, { 0x000B,  8}, { 0x0012,  9}, { 0x01D6,  9}, { 0x027E, 10}, { 0x0191, 11},
-{ 0x00EA, 12}, { 0x03DC, 12}, { 0x013B, 13}, { 0x0004,  5}, { 0x0014,  7}, { 0x009E,  8},
-{ 0x0009, 10}, { 0x01AC, 11}, { 0x01E2, 11}, { 0x03CA, 12}, { 0x005F, 13}, { 0x0017,  5},
-{ 0x004E,  7}, { 0x005E,  9}, { 0x00F3, 10}, { 0x01AD, 11}, { 0x00EC, 12}, { 0x05F0, 13},
-{ 0x000E,  6}, { 0x00E1,  8}, { 0x03A4, 10}, { 0x009C, 12}, { 0x013D, 13}, { 0x003B,  6},
-{ 0x001C,  9}, { 0x0014, 11}, { 0x09BE, 12}, { 0x0006,  7}, { 0x007A,  9}, { 0x0190, 11},
-{ 0x0137, 13}, { 0x001B,  7}, { 0x0008, 10}, { 0x075C, 11}, { 0x0071,  7}, { 0x00D7, 10},
-{ 0x09BF, 12}, { 0x0007,  8}, { 0x00AF, 10}, { 0x04CC, 11}, { 0x0034,  8}, { 0x0265, 10},
-{ 0x009F, 12}, { 0x00E0,  8}, { 0x0016, 11}, { 0x0327, 12}, { 0x0015,  9}, { 0x017D, 11},
-{ 0x0EBB, 12}, { 0x0014,  9}, { 0x00F6, 10}, { 0x01E4, 11}, { 0x00CB, 10}, { 0x099D, 12},
-{ 0x00CA, 10}, { 0x02FC, 12}, { 0x017F, 11}, { 0x04CD, 11}, { 0x02FD, 12}, { 0x04FE, 11},
-{ 0x013A, 13}, { 0x000A,  4}, { 0x0042,  7}, { 0x01D3,  9}, { 0x04DD, 11}, { 0x0012,  5},
-{ 0x00E8,  8}, { 0x004C, 11}, { 0x0136, 13}, { 0x0039,  6}, { 0x0264, 10}, { 0x0EBA, 12},
-{ 0x0000,  7}, { 0x00AE, 10}, { 0x099C, 12}, { 0x001F,  7}, { 0x04DE, 11}, { 0x0043,  7},
-{ 0x04DC, 11}, { 0x0003,  8}, { 0x03CB, 12}, { 0x0006,  8}, { 0x099E, 12}, { 0x002A,  8},
-{ 0x05F1, 13}, { 0x000F,  8}, { 0x09FE, 12}, { 0x0033,  8}, { 0x09FF, 12}, { 0x0098,  8},
-{ 0x099F, 12}, { 0x00EA,  8}, { 0x013C, 13}, { 0x002E,  8}, { 0x0192, 11}, { 0x0136,  9},
-{ 0x006A,  9}, { 0x0015, 11}, { 0x03AF, 10}, { 0x01E3, 11}, { 0x0074, 11}, { 0x00EB, 12},
-{ 0x02F9, 12}, { 0x005C, 13}, { 0x00ED, 12}, { 0x03DD, 12}, { 0x0326, 12}, { 0x005E, 13},
-{ 0x0016,  7}
-},
-{
-{ 0x0004,  3}, { 0x0014,  5}, { 0x0017,  7}, { 0x007F,  8}, { 0x0154,  9}, { 0x01F2, 10},
-{ 0x00BF, 11}, { 0x0065, 12}, { 0x0AAA, 12}, { 0x0630, 13}, { 0x1597, 13}, { 0x03B7, 14},
-{ 0x2B22, 14}, { 0x0BE6, 15}, { 0x000B,  4}, { 0x0037,  7}, { 0x0062,  9}, { 0x0007, 11},
-{ 0x0166, 12}, { 0x00CE, 13}, { 0x1590, 13}, { 0x05F6, 14}, { 0x0BE7, 15}, { 0x0007,  5},
-{ 0x006D,  8}, { 0x0003, 11}, { 0x031F, 12}, { 0x05F2, 14}, { 0x0002,  6}, { 0x0061,  9},
-{ 0x0055, 12}, { 0x01DF, 14}, { 0x001A,  6}, { 0x001E, 10}, { 0x0AC9, 12}, { 0x2B23, 14},
-{ 0x001E,  6}, { 0x001F, 10}, { 0x0AC3, 12}, { 0x2B2B, 14}, { 0x0006,  7}, { 0x0004, 11},
-{ 0x02F8, 13}, { 0x0019,  7}, { 0x0006, 11}, { 0x063D, 13}, { 0x0057,  7}, { 0x0182, 11},
-{ 0x2AA2, 14}, { 0x0004,  8}, { 0x0180, 11}, { 0x059C, 14}, { 0x007D,  8}, { 0x0164, 12},
-{ 0x076D, 15}, { 0x0002,  9}, { 0x018D, 11}, { 0x1581, 13}, { 0x00AD,  8}, { 0x0060, 12},
-{ 0x0C67, 14}, { 0x001C,  9}, { 0x00EE, 13}, { 0x0003,  9}, { 0x02CF, 13}, { 0x00D9,  9},
-{ 0x1580, 13}, { 0x0002, 11}, { 0x0183, 11}, { 0x0057, 12}, { 0x0061, 12}, { 0x0031, 11},
-{ 0x0066, 12}, { 0x0631, 13}, { 0x0632, 13}, { 0x00AC, 13}, { 0x031D, 12}, { 0x0076, 12},
-{ 0x003A, 11}, { 0x0165, 12}, { 0x0C66, 14}, { 0x0003,  2}, { 0x0054,  7}, { 0x02AB, 10},
-{ 0x0016, 13}, { 0x05F7, 14}, { 0x0005,  4}, { 0x00F8,  9}, { 0x0AA9, 12}, { 0x005F, 15},
-{ 0x0004,  4}, { 0x001C, 10}, { 0x1550, 13}, { 0x0004,  5}, { 0x0077, 11}, { 0x076C, 15},
-{ 0x000E,  5}, { 0x000A, 12}, { 0x000C,  5}, { 0x0562, 11}, { 0x0004,  6}, { 0x031C, 12},
-{ 0x0006,  6}, { 0x00C8, 13}, { 0x000D,  6}, { 0x01DA, 13}, { 0x0007,  6}, { 0x00C9, 13},
-{ 0x0001,  7}, { 0x002E, 14}, { 0x0014,  7}, { 0x1596, 13}, { 0x000A,  7}, { 0x0AC2, 12},
-{ 0x0016,  7}, { 0x015B, 14}, { 0x0015,  7}, { 0x015A, 14}, { 0x000F,  8}, { 0x005E, 15},
-{ 0x007E,  8}, { 0x00AB,  8}, { 0x002D,  9}, { 0x00D8,  9}, { 0x000B,  9}, { 0x0014, 10},
-{ 0x02B3, 10}, { 0x01F3, 10}, { 0x003A, 10}, { 0x0000, 10}, { 0x0058, 10}, { 0x002E,  9},
-{ 0x005E, 10}, { 0x0563, 11}, { 0x00EC, 12}, { 0x0054, 12}, { 0x0AC1, 12}, { 0x1556, 13},
-{ 0x02FA, 13}, { 0x0181, 11}, { 0x1557, 13}, { 0x059D, 14}, { 0x2AA3, 14}, { 0x2B2A, 14},
-{ 0x01DE, 14}, { 0x063C, 13}, { 0x00CF, 13}, { 0x1594, 13}, { 0x000D,  9}
-},
-{
-{ 0x0002,  2}, { 0x0006,  3}, { 0x000F,  4}, { 0x000D,  5}, { 0x000C,  5}, { 0x0015,  6},
-{ 0x0013,  6}, { 0x0012,  6}, { 0x0017,  7}, { 0x001F,  8}, { 0x001E,  8}, { 0x001D,  8},
-{ 0x0025,  9}, { 0x0024,  9}, { 0x0023,  9}, { 0x0021,  9}, { 0x0021, 10}, { 0x0020, 10},
-{ 0x000F, 10}, { 0x000E, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, { 0x0021, 11},
-{ 0x0050, 12}, { 0x0051, 12}, { 0x0052, 12}, { 0x000E,  4}, { 0x0014,  6}, { 0x0016,  7},
-{ 0x001C,  8}, { 0x0020,  9}, { 0x001F,  9}, { 0x000D, 10}, { 0x0022, 11}, { 0x0053, 12},
-{ 0x0055, 12}, { 0x000B,  5}, { 0x0015,  7}, { 0x001E,  9}, { 0x000C, 10}, { 0x0056, 12},
-{ 0x0011,  6}, { 0x001B,  8}, { 0x001D,  9}, { 0x000B, 10}, { 0x0010,  6}, { 0x0022,  9},
-{ 0x000A, 10}, { 0x000D,  6}, { 0x001C,  9}, { 0x0008, 10}, { 0x0012,  7}, { 0x001B,  9},
-{ 0x0054, 12}, { 0x0014,  7}, { 0x001A,  9}, { 0x0057, 12}, { 0x0019,  8}, { 0x0009, 10},
-{ 0x0018,  8}, { 0x0023, 11}, { 0x0017,  8}, { 0x0019,  9}, { 0x0018,  9}, { 0x0007, 10},
-{ 0x0058, 12}, { 0x0007,  4}, { 0x000C,  6}, { 0x0016,  8}, { 0x0017,  9}, { 0x0006, 10},
-{ 0x0005, 11}, { 0x0004, 11}, { 0x0059, 12}, { 0x000F,  6}, { 0x0016,  9}, { 0x0005, 10},
-{ 0x000E,  6}, { 0x0004, 10}, { 0x0011,  7}, { 0x0024, 11}, { 0x0010,  7}, { 0x0025, 11},
-{ 0x0013,  7}, { 0x005A, 12}, { 0x0015,  8}, { 0x005B, 12}, { 0x0014,  8}, { 0x0013,  8},
-{ 0x001A,  8}, { 0x0015,  9}, { 0x0014,  9}, { 0x0013,  9}, { 0x0012,  9}, { 0x0011,  9},
-{ 0x0026, 11}, { 0x0027, 11}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12},
-{ 0x0003,  7}
-},
-{
-{ 0x0002,  2}, { 0x000F,  4}, { 0x0015,  6}, { 0x0017,  7}, { 0x001F,  8}, { 0x0025,  9},
-{ 0x0024,  9}, { 0x0021, 10}, { 0x0020, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11},
-{ 0x0006,  3}, { 0x0014,  6}, { 0x001E,  8}, { 0x000F, 10}, { 0x0021, 11}, { 0x0050, 12},
-{ 0x000E,  4}, { 0x001D,  8}, { 0x000E, 10}, { 0x0051, 12}, { 0x000D,  5}, { 0x0023,  9},
-{ 0x000D, 10}, { 0x000C,  5}, { 0x0022,  9}, { 0x0052, 12}, { 0x000B,  5}, { 0x000C, 10},
-{ 0x0053, 12}, { 0x0013,  6}, { 0x000B, 10}, { 0x0054, 12}, { 0x0012,  6}, { 0x000A, 10},
-{ 0x0011,  6}, { 0x0009, 10}, { 0x0010,  6}, { 0x0008, 10}, { 0x0016,  7}, { 0x0055, 12},
-{ 0x0015,  7}, { 0x0014,  7}, { 0x001C,  8}, { 0x001B,  8}, { 0x0021,  9}, { 0x0020,  9},
-{ 0x001F,  9}, { 0x001E,  9}, { 0x001D,  9}, { 0x001C,  9}, { 0x001B,  9}, { 0x001A,  9},
-{ 0x0022, 11}, { 0x0023, 11}, { 0x0056, 12}, { 0x0057, 12}, { 0x0007,  4}, { 0x0019,  9},
-{ 0x0005, 11}, { 0x000F,  6}, { 0x0004, 11}, { 0x000E,  6}, { 0x000D,  6}, { 0x000C,  6},
-{ 0x0013,  7}, { 0x0012,  7}, { 0x0011,  7}, { 0x0010,  7}, { 0x001A,  8}, { 0x0019,  8},
-{ 0x0018,  8}, { 0x0017,  8}, { 0x0016,  8}, { 0x0015,  8}, { 0x0014,  8}, { 0x0013,  8},
-{ 0x0018,  9}, { 0x0017,  9}, { 0x0016,  9}, { 0x0015,  9}, { 0x0014,  9}, { 0x0013,  9},
-{ 0x0012,  9}, { 0x0011,  9}, { 0x0007, 10}, { 0x0006, 10}, { 0x0005, 10}, { 0x0004, 10},
-{ 0x0024, 11}, { 0x0025, 11}, { 0x0026, 11}, { 0x0027, 11}, { 0x0058, 12}, { 0x0059, 12},
-{ 0x005A, 12}, { 0x005B, 12}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12},
-{ 0x0003,  7}
-},
-{
-{ 0x0000,  2}, { 0x0003,  3}, { 0x000D,  4}, { 0x0005,  4}, { 0x001C,  5}, { 0x0016,  5},
-{ 0x003F,  6}, { 0x003A,  6}, { 0x002E,  6}, { 0x0022,  6}, { 0x007B,  7}, { 0x0067,  7},
-{ 0x005F,  7}, { 0x0047,  7}, { 0x0026,  7}, { 0x00EF,  8}, { 0x00CD,  8}, { 0x00C1,  8},
-{ 0x00A9,  8}, { 0x004F,  8}, { 0x01F2,  9}, { 0x01DD,  9}, { 0x0199,  9}, { 0x0185,  9},
-{ 0x015D,  9}, { 0x011B,  9}, { 0x03EF, 10}, { 0x03E1, 10}, { 0x03C8, 10}, { 0x0331, 10},
-{ 0x0303, 10}, { 0x02F1, 10}, { 0x02A0, 10}, { 0x0233, 10}, { 0x0126, 10}, { 0x07C0, 11},
-{ 0x076F, 11}, { 0x076C, 11}, { 0x0661, 11}, { 0x0604, 11}, { 0x0572, 11}, { 0x0551, 11},
-{ 0x046A, 11}, { 0x0274, 11}, { 0x0F27, 12}, { 0x0F24, 12}, { 0x0EDB, 12}, { 0x0C8E, 12},
-{ 0x0C0B, 12}, { 0x0C0A, 12}, { 0x0AE3, 12}, { 0x08D6, 12}, { 0x0490, 12}, { 0x0495, 12},
-{ 0x1F19, 13}, { 0x1DB5, 13}, { 0x0009,  4}, { 0x0010,  5}, { 0x0029,  6}, { 0x0062,  7},
-{ 0x00F3,  8}, { 0x00AD,  8}, { 0x01E5,  9}, { 0x0179,  9}, { 0x009C,  9}, { 0x03B1, 10},
-{ 0x02AE, 10}, { 0x0127, 10}, { 0x076E, 11}, { 0x0570, 11}, { 0x0275, 11}, { 0x0F25, 12},
-{ 0x0EC0, 12}, { 0x0AA0, 12}, { 0x08D7, 12}, { 0x1E4C, 13}, { 0x0008,  5}, { 0x0063,  7},
-{ 0x00AF,  8}, { 0x017B,  9}, { 0x03B3, 10}, { 0x07DD, 11}, { 0x0640, 11}, { 0x0F8D, 12},
-{ 0x0BC1, 12}, { 0x0491, 12}, { 0x0028,  6}, { 0x00C3,  8}, { 0x0151,  9}, { 0x02A1, 10},
-{ 0x0573, 11}, { 0x0EC3, 12}, { 0x1F35, 13}, { 0x0065,  7}, { 0x01DA,  9}, { 0x02AF, 10},
-{ 0x0277, 11}, { 0x08C9, 12}, { 0x1781, 13}, { 0x0025,  7}, { 0x0118,  9}, { 0x0646, 11},
-{ 0x0AA6, 12}, { 0x1780, 13}, { 0x00C9,  8}, { 0x0321, 10}, { 0x0F9B, 12}, { 0x191E, 13},
-{ 0x0048,  8}, { 0x07CC, 11}, { 0x0AA1, 12}, { 0x0180,  9}, { 0x0465, 11}, { 0x1905, 13},
-{ 0x03E2, 10}, { 0x0EC1, 12}, { 0x3C9B, 14}, { 0x02F4, 10}, { 0x08C8, 12}, { 0x07C1, 11},
-{ 0x0928, 13}, { 0x05E1, 11}, { 0x320D, 14}, { 0x0EC2, 12}, { 0x6418, 15}, { 0x1F34, 13},
-{ 0x0078,  7}, { 0x0155,  9}, { 0x0552, 11}, { 0x191F, 13}, { 0x00FA,  8}, { 0x07DC, 11},
-{ 0x1907, 13}, { 0x00AC,  8}, { 0x0249, 11}, { 0x13B1, 14}, { 0x01F6,  9}, { 0x0AE2, 12},
-{ 0x01DC,  9}, { 0x04ED, 12}, { 0x0184,  9}, { 0x1904, 13}, { 0x0156,  9}, { 0x09D9, 13},
-{ 0x03E7, 10}, { 0x0929, 13}, { 0x03B2, 10}, { 0x3B68, 14}, { 0x02F5, 10}, { 0x13B0, 14},
-{ 0x0322, 10}, { 0x3B69, 14}, { 0x0234, 10}, { 0x7935, 15}, { 0x07C7, 11}, { 0xC833, 16},
-{ 0x0660, 11}, { 0x7934, 15}, { 0x024B, 11}, { 0xC832, 16}, { 0x0AA7, 12}, { 0x1F18, 13},
-{ 0x007A,  7}
-},
-{
-{ 0x0002,  2}, { 0x0000,  3}, { 0x001E,  5}, { 0x0004,  5}, { 0x0012,  6}, { 0x0070,  7},
-{ 0x001A,  7}, { 0x005F,  8}, { 0x0047,  8}, { 0x01D3,  9}, { 0x00B5,  9}, { 0x0057,  9},
-{ 0x03B5, 10}, { 0x016D, 10}, { 0x0162, 10}, { 0x07CE, 11}, { 0x0719, 11}, { 0x0691, 11},
-{ 0x02C6, 11}, { 0x0156, 11}, { 0x0F92, 12}, { 0x0D2E, 12}, { 0x0D20, 12}, { 0x059E, 12},
-{ 0x0468, 12}, { 0x02A6, 12}, { 0x1DA2, 13}, { 0x1C60, 13}, { 0x1A43, 13}, { 0x0B1D, 13},
-{ 0x08C0, 13}, { 0x055D, 13}, { 0x0003,  3}, { 0x000A,  5}, { 0x0077,  7}, { 0x00E5,  8},
-{ 0x01D9,  9}, { 0x03E5, 10}, { 0x0166, 10}, { 0x0694, 11}, { 0x0152, 11}, { 0x059F, 12},
-{ 0x1F3C, 13}, { 0x1A4B, 13}, { 0x055E, 13}, { 0x000C,  4}, { 0x007D,  7}, { 0x0044,  8},
-{ 0x03E0, 10}, { 0x0769, 11}, { 0x0E31, 12}, { 0x1F26, 13}, { 0x055C, 13}, { 0x001B,  5},
-{ 0x00E2,  8}, { 0x03A5, 10}, { 0x02C9, 11}, { 0x1F23, 13}, { 0x3B47, 14}, { 0x0007,  5},
-{ 0x01D8,  9}, { 0x02D8, 11}, { 0x1F27, 13}, { 0x3494, 14}, { 0x0035,  6}, { 0x03E1, 10},
-{ 0x059C, 12}, { 0x38C3, 14}, { 0x000C,  6}, { 0x0165, 10}, { 0x1D23, 13}, { 0x1638, 14},
-{ 0x0068,  7}, { 0x0693, 11}, { 0x3A45, 14}, { 0x0020,  7}, { 0x0F90, 12}, { 0x7CF6, 15},
-{ 0x00E8,  8}, { 0x058F, 12}, { 0x2CEF, 15}, { 0x0045,  8}, { 0x0B3A, 13}, { 0x01F1,  9},
-{ 0x3B46, 14}, { 0x01A7,  9}, { 0x1676, 14}, { 0x0056,  9}, { 0x692A, 15}, { 0x038D, 10},
-{ 0xE309, 16}, { 0x00AA, 10}, { 0x1C611, 17}, { 0x02DF, 11}, { 0xB3B9, 17}, { 0x02C8, 11},
-{ 0x38C20, 18}, { 0x01B0, 11}, { 0x16390, 18}, { 0x0F9F, 12}, { 0x16771, 18}, { 0x0ED0, 12},
-{ 0x71843, 19}, { 0x0D2A, 12}, { 0xF9E8C, 20}, { 0x0461, 12}, { 0xF9E8E, 20}, { 0x0B67, 13},
-{ 0x055F, 13}, { 0x003F,  6}, { 0x006D,  9}, { 0x0E90, 12}, { 0x054E, 13}, { 0x0013,  6},
-{ 0x0119, 10}, { 0x0B66, 13}, { 0x000B,  6}, { 0x0235, 11}, { 0x7CF5, 15}, { 0x0075,  7},
-{ 0x0D24, 12}, { 0xF9E9, 16}, { 0x002E,  7}, { 0x1F22, 13}, { 0x0021,  7}, { 0x054F, 13},
-{ 0x0014,  7}, { 0x3A44, 14}, { 0x00E4,  8}, { 0x7CF7, 15}, { 0x005E,  8}, { 0x7185, 15},
-{ 0x0037,  8}, { 0x2C73, 15}, { 0x01DB,  9}, { 0x59DD, 16}, { 0x01C7,  9}, { 0x692B, 15},
-{ 0x01A6,  9}, { 0x58E5, 16}, { 0x00B4,  9}, { 0x1F3D0, 17}, { 0x00B0,  9}, { 0xB1C9, 17},
-{ 0x03E6, 10}, { 0x16770, 18}, { 0x016E, 10}, { 0x3E7A2, 18}, { 0x011B, 10}, { 0xF9E8D, 20},
-{ 0x00D9, 10}, { 0xF9E8F, 20}, { 0x00A8, 10}, { 0x2C723, 19}, { 0x0749, 11}, { 0xE3084, 20},
-{ 0x0696, 11}, { 0x58E45, 20}, { 0x02DE, 11}, { 0xB1C88, 21}, { 0x0231, 11}, { 0x1C610A, 21},
-{ 0x01B1, 11}, { 0x71842D, 23}, { 0x0D2B, 12}, { 0x38C217, 22}, { 0x0D2F, 12}, { 0x163913, 22},
-{ 0x05B2, 12}, { 0x163912, 22}, { 0x0469, 12}, { 0x71842C, 23}, { 0x1A42, 13}, { 0x08C1, 13},
-{ 0x0073,  7}
-}
-};
-
-static const uint16_t vlc_offs[] = {
-        0,   520,   552,   616,  1128,  1160,  1224,  1740,  1772,  1836,  1900,  2436,
-     2986,  3050,  3610,  4154,  4218,  4746,  5326,  5390,  5902,  6554,  7658,  8342,
-     9304,  9988, 10630, 11234, 12174, 13006, 13560, 14232, 14786, 15432, 16350, 17522,
-    20372, 21818, 22330, 22394, 23166, 23678, 23742, 24820, 25332, 25396, 26460, 26980,
-    27048, 27592, 27600, 27608, 27616, 27624, 28224, 28258, 28290, 28802, 28834, 28866,
-    29378, 29412, 29444, 29960, 29994, 30026, 30538, 30572, 30604, 31120, 31154, 31186,
-    31714, 31746, 31778, 32306, 32340, 32372
-};
-
-/**
- * Init VC-1 specific tables and VC1Context members
- * @param v The VC1Context to initialize
- * @return Status
- */
-av_cold int ff_vc1_init_common(VC1Context *v)
-{
-    static int done = 0;
-    int i = 0;
-    static VLC_TYPE vlc_table[32372][2];
-
-    v->hrd_rate = v->hrd_buffer = NULL;
-
-    /* VLC tables */
-    if (!done) {
-        INIT_VLC_STATIC(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23,
-                        ff_vc1_bfraction_bits, 1, 1,
-                        ff_vc1_bfraction_codes, 1, 1, 1 << VC1_BFRACTION_VLC_BITS);
-        INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
-                        ff_vc1_norm2_bits, 1, 1,
-                        ff_vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);
-        INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64,
-                        ff_vc1_norm6_bits, 1, 1,
-                        ff_vc1_norm6_codes, 2, 2, 556);
-        INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7,
-                        ff_vc1_imode_bits, 1, 1,
-                        ff_vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS);
-        for (i = 0; i < 3; i++) {
-            ff_vc1_ttmb_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 0]];
-            ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0];
-            init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16,
-                     ff_vc1_ttmb_bits[i], 1, 1,
-                     ff_vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
-            ff_vc1_ttblk_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 1]];
-            ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1];
-            init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8,
-                     ff_vc1_ttblk_bits[i], 1, 1,
-                     ff_vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-            ff_vc1_subblkpat_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 2]];
-            ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2];
-            init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15,
-                     ff_vc1_subblkpat_bits[i], 1, 1,
-                     ff_vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-        }
-        for (i = 0; i < 4; i++) {
-            ff_vc1_4mv_block_pattern_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 9]];
-            ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9];
-            init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16,
-                     ff_vc1_4mv_block_pattern_bits[i], 1, 1,
-                     ff_vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-            ff_vc1_cbpcy_p_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 10]];
-            ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10];
-            init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64,
-                     ff_vc1_cbpcy_p_bits[i], 1, 1,
-                     ff_vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
-            ff_vc1_mv_diff_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 11]];
-            ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11];
-            init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73,
-                     ff_vc1_mv_diff_bits[i], 1, 1,
-                     ff_vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
-        }
-        for (i = 0; i < 8; i++) {
-            ff_vc1_ac_coeff_table[i].table           = &vlc_table[vlc_offs[i * 2 + 21]];
-            ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21];
-            init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i],
-                     &vc1_ac_tables[i][0][1], 8, 4,
-                     &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC);
-            /* initialize interlaced MVDATA tables (2-Ref) */
-            ff_vc1_2ref_mvdata_vlc[i].table           = &vlc_table[vlc_offs[i * 2 + 22]];
-            ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22];
-            init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126,
-                     ff_vc1_2ref_mvdata_bits[i], 1, 1,
-                     ff_vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
-        }
-        for (i = 0; i < 4; i++) {
-            /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */
-            ff_vc1_intfr_4mv_mbmode_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 37]];
-            ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37];
-            init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15,
-                     ff_vc1_intfr_4mv_mbmode_bits[i], 1, 1,
-                     ff_vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
-            /* initialize NON-4MV MBMODE VLC tables for the same */
-            ff_vc1_intfr_non4mv_mbmode_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 38]];
-            ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38];
-            init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9,
-                     ff_vc1_intfr_non4mv_mbmode_bits[i], 1, 1,
-                     ff_vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-            /* initialize interlaced MVDATA tables (1-Ref) */
-            ff_vc1_1ref_mvdata_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 39]];
-            ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39];
-            init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72,
-                     ff_vc1_1ref_mvdata_bits[i], 1, 1,
-                     ff_vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
-        }
-        for (i = 0; i < 4; i++) {
-            /* Initialize 2MV Block pattern VLC tables */
-            ff_vc1_2mv_block_pattern_vlc[i].table           = &vlc_table[vlc_offs[i + 49]];
-            ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49];
-            init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4,
-                     ff_vc1_2mv_block_pattern_bits[i], 1, 1,
-                     ff_vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-        }
-        for (i = 0; i < 8; i++) {
-            /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */
-            ff_vc1_icbpcy_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 53]];
-            ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53];
-            init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63,
-                     ff_vc1_icbpcy_p_bits[i], 1, 1,
-                     ff_vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
-            /* Initialize interlaced field picture MBMODE VLC tables */
-            ff_vc1_if_mmv_mbmode_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 54]];
-            ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54];
-            init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8,
-                     ff_vc1_if_mmv_mbmode_bits[i], 1, 1,
-                     ff_vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-            ff_vc1_if_1mv_mbmode_vlc[i].table           = &vlc_table[vlc_offs[i * 3 + 55]];
-            ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55];
-            init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6,
-                     ff_vc1_if_1mv_mbmode_bits[i], 1, 1,
-                     ff_vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
-        }
-        done = 1;
-    }
-
-    /* Other defaults */
-    v->pq      = -1;
-    v->mvrange = 0; /* 7.1.1.18, p80 */
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/vc1.h b/deps/libav/libavcodec/vc1.h
deleted file mode 100644
index 9db8edd..0000000
--- a/deps/libav/libavcodec/vc1.h
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * VC-1 and WMV3 decoder
- * Copyright (c) 2006-2007 Konstantin Shishkov
- * Partly based on vc9.c (c) 2005 Anonymous, Alex Beregszaszi, Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VC1_H
-#define AVCODEC_VC1_H
-
-#include "avcodec.h"
-#include "h264chroma.h"
-#include "mpegvideo.h"
-#include "intrax8.h"
-#include "vc1dsp.h"
-
-#define AC_VLC_BITS 9
-
-/** Markers used in VC-1 AP frame data */
-//@{
-enum VC1Code {
-    VC1_CODE_RES0       = 0x00000100,
-    VC1_CODE_ENDOFSEQ   = 0x0000010A,
-    VC1_CODE_SLICE,
-    VC1_CODE_FIELD,
-    VC1_CODE_FRAME,
-    VC1_CODE_ENTRYPOINT,
-    VC1_CODE_SEQHDR,
-};
-//@}
-
-#define IS_MARKER(x) (((x) & ~0xFF) == VC1_CODE_RES0)
-
-/** Available Profiles */
-//@{
-enum Profile {
-    PROFILE_SIMPLE,
-    PROFILE_MAIN,
-    PROFILE_COMPLEX, ///< TODO: WMV9 specific
-    PROFILE_ADVANCED
-};
-//@}
-
-/** Sequence quantizer mode */
-//@{
-enum QuantMode {
-    QUANT_FRAME_IMPLICIT,    ///< Implicitly specified at frame level
-    QUANT_FRAME_EXPLICIT,    ///< Explicitly specified at frame level
-    QUANT_NON_UNIFORM,       ///< Non-uniform quant used for all frames
-    QUANT_UNIFORM            ///< Uniform quant used for all frames
-};
-//@}
-
-/** Where quant can be changed */
-//@{
-enum DQProfile {
-    DQPROFILE_FOUR_EDGES,
-    DQPROFILE_DOUBLE_EDGES,
-    DQPROFILE_SINGLE_EDGE,
-    DQPROFILE_ALL_MBS
-};
-//@}
-
-/** @name Where quant can be changed
- */
-//@{
-enum DQSingleEdge {
-    DQSINGLE_BEDGE_LEFT,
-    DQSINGLE_BEDGE_TOP,
-    DQSINGLE_BEDGE_RIGHT,
-    DQSINGLE_BEDGE_BOTTOM
-};
-//@}
-
-/** Which pair of edges is quantized with ALTPQUANT */
-//@{
-enum DQDoubleEdge {
-    DQDOUBLE_BEDGE_TOPLEFT,
-    DQDOUBLE_BEDGE_TOPRIGHT,
-    DQDOUBLE_BEDGE_BOTTOMRIGHT,
-    DQDOUBLE_BEDGE_BOTTOMLEFT
-};
-//@}
-
-/** MV modes for P frames */
-//@{
-enum MVModes {
-    MV_PMODE_1MV_HPEL_BILIN,
-    MV_PMODE_1MV,
-    MV_PMODE_1MV_HPEL,
-    MV_PMODE_MIXED_MV,
-    MV_PMODE_INTENSITY_COMP
-};
-//@}
-
-/** MBMODE for interlaced frame P-picture */
-//@{
-enum MBModesIntfr {
-    MV_PMODE_INTFR_1MV,
-    MV_PMODE_INTFR_2MV_FIELD,
-    MV_PMODE_INTFR_2MV,
-    MV_PMODE_INTFR_4MV_FIELD,
-    MV_PMODE_INTFR_4MV,
-    MV_PMODE_INTFR_INTRA,
-};
-//@}
-
-/** @name MV types for B frames */
-//@{
-enum BMVTypes {
-    BMV_TYPE_BACKWARD,
-    BMV_TYPE_FORWARD,
-    BMV_TYPE_INTERPOLATED,
-    BMV_TYPE_DIRECT
-};
-//@}
-
-/** @name Block types for P/B frames */
-//@{
-enum TransformTypes {
-    TT_8X8,
-    TT_8X4_BOTTOM,
-    TT_8X4_TOP,
-    TT_8X4,         // both halves
-    TT_4X8_RIGHT,
-    TT_4X8_LEFT,
-    TT_4X8,         // both halves
-    TT_4X4
-};
-//@}
-
-enum CodingSet {
-    CS_HIGH_MOT_INTRA = 0,
-    CS_HIGH_MOT_INTER,
-    CS_LOW_MOT_INTRA,
-    CS_LOW_MOT_INTER,
-    CS_MID_RATE_INTRA,
-    CS_MID_RATE_INTER,
-    CS_HIGH_RATE_INTRA,
-    CS_HIGH_RATE_INTER
-};
-
-/** @name Overlap conditions for Advanced Profile */
-//@{
-enum COTypes {
-    CONDOVER_NONE = 0,
-    CONDOVER_ALL,
-    CONDOVER_SELECT
-};
-//@}
-
-/**
- * FCM Frame Coding Mode
- * @note some content might be marked interlaced
- * but have fcm set to 0 as well (e.g. HD-DVD)
- */
-enum FrameCodingMode {
-    PROGRESSIVE = 0,    ///<  in the bitstream is reported as 00b
-    ILACE_FRAME,        ///<  in the bitstream is reported as 10b
-    ILACE_FIELD         ///<  in the bitstream is reported as 11b
-};
-
-/** The VC1 Context
- * @todo Change size wherever another size is more efficient
- * Many members are only used for Advanced Profile
- */
-typedef struct VC1Context{
-    MpegEncContext s;
-    IntraX8Context x8;
-    H264ChromaContext h264chroma;
-    VC1DSPContext vc1dsp;
-
-    int bits;
-
-    /** Simple/Main Profile sequence header */
-    //@{
-    int res_sprite;       ///< reserved, sprite mode
-    int res_y411;         ///< reserved, old interlaced mode
-    int res_x8;           ///< reserved
-    int multires;         ///< frame-level RESPIC syntax element present
-    int res_fasttx;       ///< reserved, always 1
-    int res_transtab;     ///< reserved, always 0
-    int rangered;         ///< RANGEREDFRM (range reduction) syntax element present
-                          ///< at frame level
-    int res_rtm_flag;     ///< reserved, set to 1
-    int reserved;         ///< reserved
-    //@}
-
-    /** Advanced Profile */
-    //@{
-    int level;            ///< 3bits, for Advanced/Simple Profile, provided by TS layer
-    int chromaformat;     ///< 2bits, 2=4:2:0, only defined
-    int postprocflag;     ///< Per-frame processing suggestion flag present
-    int broadcast;        ///< TFF/RFF present
-    int interlace;        ///< Progressive/interlaced (RPTFTM syntax element)
-    int tfcntrflag;       ///< TFCNTR present
-    int panscanflag;      ///< NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present
-    int refdist_flag;     ///< REFDIST syntax element present in II, IP, PI or PP field picture headers
-    int extended_dmv;     ///< Additional extended dmv range at P/B frame-level
-    int color_prim;       ///< 8bits, chroma coordinates of the color primaries
-    int transfer_char;    ///< 8bits, Opto-electronic transfer characteristics
-    int matrix_coef;      ///< 8bits, Color primaries->YCbCr transform matrix
-    int hrd_param_flag;   ///< Presence of Hypothetical Reference
-                          ///< Decoder parameters
-    int psf;              ///< Progressive Segmented Frame
-    //@}
-
-    /** Sequence header data for all Profiles
-     * TODO: choose between ints, uint8_ts and monobit flags
-     */
-    //@{
-    int profile;          ///< 2bits, Profile
-    int frmrtq_postproc;  ///< 3bits,
-    int bitrtq_postproc;  ///< 5bits, quantized framerate-based postprocessing strength
-    int fastuvmc;         ///< Rounding of qpel vector to hpel ? (not in Simple)
-    int extended_mv;      ///< Ext MV in P/B (not in Simple)
-    int dquant;           ///< How qscale varies with MBs, 2bits (not in Simple)
-    int vstransform;      ///< variable-size [48]x[48] transform type + info
-    int overlap;          ///< overlapped transforms in use
-    int quantizer_mode;   ///< 2bits, quantizer mode used for sequence, see QUANT_*
-    int finterpflag;      ///< INTERPFRM present
-    //@}
-
-    /** Frame decoding info for all profiles */
-    //@{
-    uint8_t mv_mode;             ///< MV coding monde
-    uint8_t mv_mode2;            ///< Secondary MV coding mode (B frames)
-    int k_x;                     ///< Number of bits for MVs (depends on MV range)
-    int k_y;                     ///< Number of bits for MVs (depends on MV range)
-    int range_x, range_y;        ///< MV range
-    uint8_t pq, altpq;           ///< Current/alternate frame quantizer scale
-    uint8_t zz_8x8[4][64];       ///< Zigzag table for TT_8x8, permuted for IDCT
-    int left_blk_sh, top_blk_sh; ///< Either 3 or 0, positions of l/t in blk[]
-    const uint8_t* zz_8x4;       ///< Zigzag scan table for TT_8x4 coding mode
-    const uint8_t* zz_4x8;       ///< Zigzag scan table for TT_4x8 coding mode
-    /** pquant parameters */
-    //@{
-    uint8_t dquantfrm;
-    uint8_t dqprofile;
-    uint8_t dqsbedge;
-    uint8_t dqbilevel;
-    //@}
-    /** AC coding set indexes
-     * @see 8.1.1.10, p(1)10
-     */
-    //@{
-    int c_ac_table_index;    ///< Chroma index from ACFRM element
-    int y_ac_table_index;    ///< Luma index from AC2FRM element
-    //@}
-    int ttfrm;               ///< Transform type info present at frame level
-    uint8_t ttmbf;           ///< Transform type flag
-    int *ttblk_base, *ttblk; ///< Transform type at the block level
-    int codingset;           ///< index of current table set from 11.8 to use for luma block decoding
-    int codingset2;          ///< index of current table set from 11.8 to use for chroma block decoding
-    int pqindex;             ///< raw pqindex used in coding set selection
-    int a_avail, c_avail;
-    uint8_t *mb_type_base, *mb_type[3];
-
-
-    /** Luma compensation parameters */
-    //@{
-    uint8_t lumscale;
-    uint8_t lumshift;
-    //@}
-    int16_t bfraction;    ///< Relative position % anchors=> how to scale MVs
-    uint8_t halfpq;       ///< Uniform quant over image and qp+.5
-    uint8_t respic;       ///< Frame-level flag for resized images
-    int buffer_fullness;  ///< HRD info
-    /** Ranges:
-     * -# 0 -> [-64n 63.f] x [-32, 31.f]
-     * -# 1 -> [-128, 127.f] x [-64, 63.f]
-     * -# 2 -> [-512, 511.f] x [-128, 127.f]
-     * -# 3 -> [-1024, 1023.f] x [-256, 255.f]
-     */
-    uint8_t mvrange;                ///< Extended MV range flag
-    uint8_t pquantizer;             ///< Uniform (over sequence) quantizer in use
-    VLC *cbpcy_vlc;                 ///< CBPCY VLC table
-    int tt_index;                   ///< Index for Transform Type tables (to decode TTMB)
-    uint8_t* mv_type_mb_plane;      ///< bitplane for mv_type == (4MV)
-    uint8_t* direct_mb_plane;       ///< bitplane for "direct" MBs
-    uint8_t* forward_mb_plane;      ///< bitplane for "forward" MBs
-    int mv_type_is_raw;             ///< mv type mb plane is not coded
-    int dmb_is_raw;                 ///< direct mb plane is raw
-    int fmb_is_raw;                 ///< forward mb plane is raw
-    int skip_is_raw;                ///< skip mb plane is not coded
-    uint8_t last_luty[2][256], last_lutuv[2][256];  ///< lookup tables used for intensity compensation
-    uint8_t  aux_luty[2][256],  aux_lutuv[2][256];  ///< lookup tables used for intensity compensation
-    uint8_t next_luty[2][256], next_lutuv[2][256];  ///< lookup tables used for intensity compensation
-    uint8_t (*curr_luty)[256]  ,(*curr_lutuv)[256];
-    int last_use_ic, curr_use_ic, next_use_ic, aux_use_ic;
-    int rnd;                        ///< rounding control
-
-    /** Frame decoding info for S/M profiles only */
-    //@{
-    uint8_t rangeredfrm;            ///< out_sample = CLIP((in_sample-128)*2+128)
-    uint8_t interpfrm;
-    //@}
-
-    /** Frame decoding info for Advanced profile */
-    //@{
-    enum FrameCodingMode fcm;
-    uint8_t numpanscanwin;
-    uint8_t tfcntr;
-    uint8_t rptfrm, tff, rff;
-    uint16_t topleftx;
-    uint16_t toplefty;
-    uint16_t bottomrightx;
-    uint16_t bottomrighty;
-    uint8_t uvsamp;
-    uint8_t postproc;
-    int hrd_num_leaky_buckets;
-    uint8_t bit_rate_exponent;
-    uint8_t buffer_size_exponent;
-    uint8_t* acpred_plane;       ///< AC prediction flags bitplane
-    int acpred_is_raw;
-    uint8_t* over_flags_plane;   ///< Overflags bitplane
-    int overflg_is_raw;
-    uint8_t condover;
-    uint16_t *hrd_rate, *hrd_buffer;
-    uint8_t *hrd_fullness;
-    uint8_t range_mapy_flag;
-    uint8_t range_mapuv_flag;
-    uint8_t range_mapy;
-    uint8_t range_mapuv;
-    //@}
-
-    /** Frame decoding info for interlaced picture */
-    uint8_t dmvrange;   ///< Extended differential MV range flag
-    int fourmvswitch;
-    int intcomp;
-    uint8_t lumscale2;  ///< for interlaced field P picture
-    uint8_t lumshift2;
-    VLC* mbmode_vlc;
-    VLC* imv_vlc;
-    VLC* twomvbp_vlc;
-    VLC* fourmvbp_vlc;
-    uint8_t twomvbp;
-    uint8_t fourmvbp;
-    uint8_t* fieldtx_plane;
-    int fieldtx_is_raw;
-    int8_t zzi_8x8[64];
-    uint8_t *blk_mv_type_base, *blk_mv_type;    ///< 0: frame MV, 1: field MV (interlaced frame)
-    uint8_t *mv_f_base, *mv_f[2];               ///< 0: MV obtained from same field, 1: opposite field
-    uint8_t *mv_f_next_base, *mv_f_next[2];
-    int field_mode;         ///< 1 for interlaced field pictures
-    int fptype;
-    int second_field;
-    int refdist;            ///< distance of the current picture from reference
-    int numref;             ///< number of past field pictures used as reference
-                            // 0 corresponds to 1 and 1 corresponds to 2 references
-    int reffield;           ///< if numref = 0 (1 reference) then reffield decides which
-                            // field to use among the two fields from previous frame
-    int intcompfield;       ///< which of the two fields to be intensity compensated
-                            // 0: both fields, 1: bottom field, 2: top field
-    int cur_field_type;     ///< 0: top, 1: bottom
-    int ref_field_type[2];  ///< forward and backward reference field type (top or bottom)
-    int blocks_off, mb_off;
-    int qs_last;            ///< if qpel has been used in the previous (tr.) picture
-    int bmvtype;
-    int frfd, brfd;         ///< reference frame distance (forward or backward)
-    int first_pic_header_flag;
-    int pic_header_flag;
-
-    /** Frame decoding info for sprite modes */
-    //@{
-    int new_sprite;
-    int two_sprites;
-    AVFrame *sprite_output_frame;
-    int output_width, output_height, sprite_width, sprite_height;
-    uint8_t* sr_rows[2][2];      ///< Sprite resizer line cache
-    //@}
-
-    int p_frame_skipped;
-    int bi_type;
-    int x8_type;
-
-    int16_t (*block)[6][64];
-    int n_allocated_blks, cur_blk_idx, left_blk_idx, topleft_blk_idx, top_blk_idx;
-    uint32_t *cbp_base, *cbp;
-    uint8_t *is_intra_base, *is_intra;
-    int16_t (*luma_mv_base)[2], (*luma_mv)[2];
-    uint8_t bfraction_lut_index; ///< Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[])
-    uint8_t broken_link;         ///< Broken link flag (BROKEN_LINK syntax element)
-    uint8_t closed_entry;        ///< Closed entry point flag (CLOSED_ENTRY syntax element)
-
-    int end_mb_x;                ///< Horizontal macroblock limit (used only by mss2)
-
-    int parse_only;              ///< Context is used within parser
-    int resync_marker;           ///< could this stream contain resync markers
-} VC1Context;
-
-/** Find VC-1 marker in buffer
- * @return position where next marker starts or end of buffer if no marker found
- */
-static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, const uint8_t *end)
-{
-    uint32_t mrk = 0xFFFFFFFF;
-
-    if (end-src < 4)
-        return end;
-    while (src < end) {
-        mrk = (mrk << 8) | *src++;
-        if (IS_MARKER(mrk))
-            return src - 4;
-    }
-    return end;
-}
-
-static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, uint8_t *dst)
-{
-    int dsize = 0, i;
-
-    if (size < 4) {
-        for (dsize = 0; dsize < size; dsize++)
-            *dst++ = *src++;
-        return size;
-    }
-    for (i = 0; i < size; i++, src++) {
-        if (src[0] == 3 && i >= 2 && !src[-1] && !src[-2] && i < size-1 && src[1] < 4) {
-            dst[dsize++] = src[1];
-            src++;
-            i++;
-        } else
-            dst[dsize++] = *src;
-    }
-    return dsize;
-}
-
-/**
- * Decode Simple/Main Profiles sequence header
- * @see Figure 7-8, p16-17
- * @param avctx Codec context
- * @param gb GetBit context initialized from Codec context extra_data
- * @return Status
- */
-int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb);
-
-int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb);
-
-int ff_vc1_parse_frame_header    (VC1Context *v, GetBitContext *gb);
-int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb);
-int ff_vc1_init_common(VC1Context *v);
-
-int  ff_vc1_decode_init_alloc_tables(VC1Context *v);
-void ff_vc1_init_transposed_scantables(VC1Context *v);
-int  ff_vc1_decode_end(AVCodecContext *avctx);
-void ff_vc1_decode_blocks(VC1Context *v);
-
-#endif /* AVCODEC_VC1_H */
diff --git a/deps/libav/libavcodec/vc1_parser.c b/deps/libav/libavcodec/vc1_parser.c
deleted file mode 100644
index 1bedd98..0000000
--- a/deps/libav/libavcodec/vc1_parser.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * VC-1 and WMV3 parser
- * Copyright (c) 2006-2007 Konstantin Shishkov
- * Partly based on vc9.c (c) 2005 Anonymous, Alex Beregszaszi, Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VC-1 and WMV3 parser
- */
-
-#include "libavutil/attributes.h"
-#include "parser.h"
-#include "vc1.h"
-#include "get_bits.h"
-
-typedef struct {
-    ParseContext pc;
-    VC1Context v;
-} VC1ParseContext;
-
-static void vc1_extract_headers(AVCodecParserContext *s, AVCodecContext *avctx,
-                                const uint8_t *buf, int buf_size)
-{
-    VC1ParseContext *vpc = s->priv_data;
-    GetBitContext gb;
-    const uint8_t *start, *end, *next;
-    uint8_t *buf2 = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
-    vpc->v.s.avctx = avctx;
-    vpc->v.parse_only = 1;
-    next = buf;
-    s->repeat_pict = 0;
-
-    for(start = buf, end = buf + buf_size; next < end; start = next){
-        int buf2_size, size;
-
-        next = find_next_marker(start + 4, end);
-        size = next - start - 4;
-        buf2_size = vc1_unescape_buffer(start + 4, size, buf2);
-        init_get_bits(&gb, buf2, buf2_size * 8);
-        if(size <= 0) continue;
-        switch(AV_RB32(start)){
-        case VC1_CODE_SEQHDR:
-            ff_vc1_decode_sequence_header(avctx, &vpc->v, &gb);
-            break;
-        case VC1_CODE_ENTRYPOINT:
-            ff_vc1_decode_entry_point(avctx, &vpc->v, &gb);
-            break;
-        case VC1_CODE_FRAME:
-            if(vpc->v.profile < PROFILE_ADVANCED)
-                ff_vc1_parse_frame_header    (&vpc->v, &gb);
-            else
-                ff_vc1_parse_frame_header_adv(&vpc->v, &gb);
-
-            /* keep AV_PICTURE_TYPE_BI internal to VC1 */
-            if (vpc->v.s.pict_type == AV_PICTURE_TYPE_BI)
-                s->pict_type = AV_PICTURE_TYPE_B;
-            else
-                s->pict_type = vpc->v.s.pict_type;
-
-            if (avctx->ticks_per_frame > 1){
-                // process pulldown flags
-                s->repeat_pict = 1;
-                // Pulldown flags are only valid when 'broadcast' has been set.
-                // So ticks_per_frame will be 2
-                if (vpc->v.rff){
-                    // repeat field
-                    s->repeat_pict = 2;
-                }else if (vpc->v.rptfrm){
-                    // repeat frames
-                    s->repeat_pict = vpc->v.rptfrm * 2 + 1;
-                }
-            }
-
-            if (vpc->v.broadcast && vpc->v.interlace && !vpc->v.psf)
-                s->field_order = vpc->v.tff ? AV_FIELD_TT : AV_FIELD_BB;
-            else
-                s->field_order = AV_FIELD_PROGRESSIVE;
-
-            break;
-        }
-    }
-
-    av_free(buf2);
-}
-
-/**
- * Find the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int vc1_find_frame_end(ParseContext *pc, const uint8_t *buf,
-                               int buf_size) {
-    int pic_found, i;
-    uint32_t state;
-
-    pic_found= pc->frame_start_found;
-    state= pc->state;
-
-    i=0;
-    if(!pic_found){
-        for(i=0; i<buf_size; i++){
-            state= (state<<8) | buf[i];
-            if(state == VC1_CODE_FRAME || state == VC1_CODE_FIELD){
-                i++;
-                pic_found=1;
-                break;
-            }
-        }
-    }
-
-    if(pic_found){
-        /* EOF considered as end of frame */
-        if (buf_size == 0)
-            return 0;
-        for(; i<buf_size; i++){
-            state= (state<<8) | buf[i];
-            if(IS_MARKER(state) && state != VC1_CODE_FIELD && state != VC1_CODE_SLICE){
-                pc->frame_start_found=0;
-                pc->state=-1;
-                return i-3;
-            }
-        }
-    }
-    pc->frame_start_found= pic_found;
-    pc->state= state;
-    return END_NOT_FOUND;
-}
-
-static int vc1_parse(AVCodecParserContext *s,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
-{
-    VC1ParseContext *vpc = s->priv_data;
-    int next;
-
-    if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
-        next= buf_size;
-    }else{
-        next= vc1_find_frame_end(&vpc->pc, buf, buf_size);
-
-        if (ff_combine_frame(&vpc->pc, next, &buf, &buf_size) < 0) {
-            *poutbuf = NULL;
-            *poutbuf_size = 0;
-            return buf_size;
-        }
-    }
-
-    vc1_extract_headers(s, avctx, buf, buf_size);
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return next;
-}
-
-static int vc1_split(AVCodecContext *avctx,
-                           const uint8_t *buf, int buf_size)
-{
-    int i;
-    uint32_t state= -1;
-    int charged=0;
-
-    for(i=0; i<buf_size; i++){
-        state= (state<<8) | buf[i];
-        if(IS_MARKER(state)){
-            if(state == VC1_CODE_SEQHDR || state == VC1_CODE_ENTRYPOINT){
-                charged=1;
-            }else if(charged){
-                return i-3;
-            }
-        }
-    }
-    return 0;
-}
-
-static av_cold int vc1_parse_init(AVCodecParserContext *s)
-{
-    VC1ParseContext *vpc = s->priv_data;
-    vpc->v.s.slice_context_count = 1;
-    return ff_vc1_init_common(&vpc->v);
-}
-
-AVCodecParser ff_vc1_parser = {
-    .codec_ids      = { AV_CODEC_ID_VC1 },
-    .priv_data_size = sizeof(VC1ParseContext),
-    .parser_init    = vc1_parse_init,
-    .parser_parse   = vc1_parse,
-    .parser_close   = ff_parse_close,
-    .split          = vc1_split,
-};
diff --git a/deps/libav/libavcodec/vc1acdata.h b/deps/libav/libavcodec/vc1acdata.h
deleted file mode 100644
index 73ebe40..0000000
--- a/deps/libav/libavcodec/vc1acdata.h
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * VC-1 and WMV3 decoder
- * copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VC1ACDATA_H
-#define AVCODEC_VC1ACDATA_H
-
-#include <stdint.h>
-
-#include "vc1data.h"
-
-/* which indexes point to last=1 entries in tables */
-static const int vc1_last_decode_table[AC_MODES] = {
-    119, 99, 85, 81, 67, 58, 126, 109
-};
-
-static const uint8_t vc1_index_decode_table[AC_MODES][185][2] = {
-{
-{  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  0,  6}, {  0,  7}, {  0,  8},
-{  0,  9}, {  0, 10}, {  0, 11}, {  0, 12}, {  0, 13}, {  0, 14}, {  0, 15}, {  0, 16},
-{  0, 17}, {  0, 18}, {  0, 19}, {  1,  1}, {  1,  2}, {  1,  3}, {  1,  4}, {  1,  5},
-{  1,  6}, {  1,  7}, {  1,  8}, {  1,  9}, {  1, 10}, {  1, 11}, {  1, 12}, {  1, 13},
-{  1, 14}, {  1, 15}, {  2,  1}, {  2,  2}, {  2,  3}, {  2,  4}, {  2,  5}, {  2,  6},
-{  2,  7}, {  2,  8}, {  2,  9}, {  2, 10}, {  2, 11}, {  2, 12}, {  3,  1}, {  3,  2},
-{  3,  3}, {  3,  4}, {  3,  5}, {  3,  6}, {  3,  7}, {  3,  8}, {  3,  9}, {  3, 10},
-{  3, 11}, {  4,  1}, {  4,  2}, {  4,  3}, {  4,  4}, {  4,  5}, {  4,  6}, {  5,  1},
-{  5,  2}, {  5,  3}, {  5,  4}, {  5,  5}, {  6,  1}, {  6,  2}, {  6,  3}, {  6,  4},
-{  7,  1}, {  7,  2}, {  7,  3}, {  7,  4}, {  8,  1}, {  8,  2}, {  8,  3}, {  8,  4},
-{  9,  1}, {  9,  2}, {  9,  3}, {  9,  4}, { 10,  1}, { 10,  2}, { 10,  3}, { 11,  1},
-{ 11,  2}, { 11,  3}, { 12,  1}, { 12,  2}, { 12,  3}, { 13,  1}, { 13,  2}, { 13,  3},
-{ 14,  1}, { 14,  2}, { 14,  3}, { 15,  1}, { 15,  2}, { 15,  3}, { 16,  1}, { 16,  2},
-{ 17,  1}, { 17,  2}, { 18,  1}, { 19,  1}, { 20,  1}, { 21,  1}, { 22,  1}, { 23,  1},
-{ 24,  1}, { 25,  1}, { 26,  1}, { 27,  1}, { 28,  1}, { 29,  1}, { 30,  1}, {  0,  1},
-{  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  0,  6}, {  1,  1}, {  1,  2}, {  1,  3},
-{  1,  4}, {  1,  5}, {  2,  1}, {  2,  2}, {  2,  3}, {  2,  4}, {  3,  1}, {  3,  2},
-{  3,  3}, {  3,  4}, {  4,  1}, {  4,  2}, {  4,  3}, {  5,  1}, {  5,  2}, {  6,  1},
-{  6,  2}, {  7,  1}, {  7,  2}, {  8,  1}, {  8,  2}, {  9,  1}, {  9,  2}, { 10,  1},
-{ 10,  2}, { 11,  1}, { 11,  2}, { 12,  1}, { 12,  2}, { 13,  1}, { 13,  2}, { 14,  1},
-{ 14,  2}, { 15,  1}, { 15,  2}, { 16,  1}, { 17,  1}, { 18,  1}, { 19,  1}, { 20,  1},
-{ 21,  1}, { 22,  1}, { 23,  1}, { 24,  1}, { 25,  1}, { 26,  1}, { 27,  1}, { 28,  1},
-{ 29,  1}, { 30,  1}, { 31,  1}, { 32,  1}, { 33,  1}, { 34,  1}, { 35,  1}, { 36,  1},
-{ 37,  1}
-},
-{
-{  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  0,  6}, {  0,  7}, {  0,  8},
-{  0,  9}, {  0, 10}, {  0, 11}, {  0, 12}, {  0, 13}, {  0, 14}, {  0, 15}, {  0, 16},
-{  0, 17}, {  0, 18}, {  0, 19}, {  0, 20}, {  0, 21}, {  0, 22}, {  0, 23}, {  1,  1},
-{  1,  2}, {  1,  3}, {  1,  4}, {  1,  5}, {  1,  6}, {  1,  7}, {  1,  8}, {  1,  9},
-{  1, 10}, {  1, 11}, {  2,  1}, {  2,  2}, {  2,  3}, {  2,  4}, {  2,  5}, {  2,  6},
-{  2,  7}, {  2,  8}, {  3,  1}, {  3,  2}, {  3,  3}, {  3,  4}, {  3,  5}, {  3,  6},
-{  3,  7}, {  4,  1}, {  4,  2}, {  4,  3}, {  4,  4}, {  4,  5}, {  5,  1}, {  5,  2},
-{  5,  3}, {  5,  4}, {  5,  5}, {  6,  1}, {  6,  2}, {  6,  3}, {  6,  4}, {  7,  1},
-{  7,  2}, {  7,  3}, {  7,  4}, {  8,  1}, {  8,  2}, {  8,  3}, {  9,  1}, {  9,  2},
-{  9,  3}, { 10,  1}, { 10,  2}, { 10,  3}, { 11,  1}, { 11,  2}, { 11,  3}, { 12,  1},
-{ 12,  2}, { 13,  1}, { 13,  2}, { 14,  1}, { 14,  2}, { 15,  1}, { 15,  2}, { 16,  1},
-{ 16,  2}, { 17,  1}, { 18,  1}, { 19,  1}, { 20,  1}, { 21,  1}, { 22,  1}, { 23,  1},
-{ 24,  1}, { 25,  1}, { 26,  1}, {  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5},
-{  0,  6}, {  0,  7}, {  0,  8}, {  0,  9}, {  1,  1}, {  1,  2}, {  1,  3}, {  1,  4},
-{  1,  5}, {  2,  1}, {  2,  2}, {  2,  3}, {  2,  4}, {  3,  1}, {  3,  2}, {  3,  3},
-{  3,  4}, {  4,  1}, {  4,  2}, {  4,  3}, {  5,  1}, {  5,  2}, {  5,  3}, {  6,  1},
-{  6,  2}, {  6,  3}, {  7,  1}, {  7,  2}, {  8,  1}, {  8,  2}, {  9,  1}, {  9,  2},
-{ 10,  1}, { 10,  2}, { 11,  1}, { 11,  2}, { 12,  1}, { 12,  2}, { 13,  1}, { 13,  2},
-{ 14,  1}, { 14,  2}, { 15,  1}, { 16,  1}, { 17,  1}, { 18,  1}, { 19,  1}, { 20,  1},
-{ 21,  1}, { 22,  1}, { 23,  1}, { 24,  1}, { 25,  1}, { 26,  1}, { 27,  1}, { 28,  1},
-{ 29,  1}, { 30,  1}, { 31,  1}, { 32,  1}, { 33,  1}, { 34,  1}, { 35,  1}, { 36,  1}
-},
-{
-{  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  0,  6}, {  0,  7}, {  0,  8},
-{  0,  9}, {  0, 10}, {  0, 11}, {  0, 12}, {  0, 13}, {  0, 14}, {  0, 15}, {  0, 16},
-{  1,  1}, {  1,  2}, {  1,  3}, {  1,  4}, {  1,  5}, {  1,  6}, {  1,  7}, {  1,  8},
-{  1,  9}, {  1, 10}, {  1, 11}, {  2,  1}, {  2,  2}, {  2,  3}, {  2,  4}, {  2,  5},
-{  2,  6}, {  2,  7}, {  2,  8}, {  3,  1}, {  3,  2}, {  3,  3}, {  3,  4}, {  3,  5},
-{  3,  6}, {  3,  7}, {  4,  1}, {  4,  2}, {  4,  3}, {  4,  4}, {  4,  5}, {  5,  1},
-{  5,  2}, {  5,  3}, {  5,  4}, {  6,  1}, {  6,  2}, {  6,  3}, {  6,  4}, {  7,  1},
-{  7,  2}, {  7,  3}, {  8,  1}, {  8,  2}, {  8,  3}, {  9,  1}, {  9,  2}, {  9,  3},
-{ 10,  1}, { 10,  2}, { 10,  3}, { 11,  1}, { 11,  2}, { 11,  3}, { 12,  1}, { 12,  2},
-{ 12,  3}, { 13,  1}, { 13,  2}, { 13,  3}, { 14,  1}, { 14,  2}, { 15,  1}, { 15,  2},
-{ 16,  1}, { 17,  1}, { 18,  1}, { 19,  1}, { 20,  1}, {  0,  1}, {  0,  2}, {  0,  3},
-{  0,  4}, {  1,  1}, {  1,  2}, {  1,  3}, {  1,  4}, {  2,  1}, {  2,  2}, {  2,  3},
-{  3,  1}, {  3,  2}, {  3,  3}, {  4,  1}, {  4,  2}, {  5,  1}, {  5,  2}, {  6,  1},
-{  6,  2}, {  7,  1}, {  7,  2}, {  8,  1}, {  8,  2}, {  9,  1}, {  9,  2}, { 10,  1},
-{ 10,  2}, { 11,  1}, { 11,  2}, { 12,  1}, { 12,  2}, { 13,  1}, { 13,  2}, { 14,  1},
-{ 15,  1}, { 16,  1}, { 17,  1}, { 18,  1}, { 19,  1}, { 20,  1}, { 21,  1}, { 22,  1},
-{ 23,  1}, { 24,  1}, { 25,  1}, { 26,  1}
-},
-{
-{  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  0,  6}, {  0,  7}, {  0,  8},
-{  0,  9}, {  0, 10}, {  0, 11}, {  0, 12}, {  0, 13}, {  0, 14}, {  1,  1}, {  1,  2},
-{  1,  3}, {  1,  4}, {  1,  5}, {  1,  6}, {  1,  7}, {  1,  8}, {  1,  9}, {  2,  1},
-{  2,  2}, {  2,  3}, {  2,  4}, {  2,  5}, {  3,  1}, {  3,  2}, {  3,  3}, {  3,  4},
-{  4,  1}, {  4,  2}, {  4,  3}, {  4,  4}, {  5,  1}, {  5,  2}, {  5,  3}, {  5,  4},
-{  6,  1}, {  6,  2}, {  6,  3}, {  7,  1}, {  7,  2}, {  7,  3}, {  8,  1}, {  8,  2},
-{  8,  3}, {  9,  1}, {  9,  2}, {  9,  3}, { 10,  1}, { 10,  2}, { 10,  3}, { 11,  1},
-{ 11,  2}, { 11,  3}, { 12,  1}, { 12,  2}, { 12,  3}, { 13,  1}, { 13,  2}, { 14,  1},
-{ 14,  2}, { 15,  1}, { 15,  2}, { 16,  1}, { 17,  1}, { 18,  1}, { 19,  1}, { 20,  1},
-{ 21,  1}, { 22,  1}, { 23,  1}, { 24,  1}, { 25,  1}, { 26,  1}, { 27,  1}, { 28,  1},
-{ 29,  1}, {  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  1,  1}, {  1,  2},
-{  1,  3}, {  1,  4}, {  2,  1}, {  2,  2}, {  2,  3}, {  3,  1}, {  3,  2}, {  3,  3},
-{  4,  1}, {  4,  2}, {  5,  1}, {  5,  2}, {  6,  1}, {  6,  2}, {  7,  1}, {  7,  2},
-{  8,  1}, {  8,  2}, {  9,  1}, {  9,  2}, { 10,  1}, { 10,  2}, { 11,  1}, { 11,  2},
-{ 12,  1}, { 12,  2}, { 13,  1}, { 13,  2}, { 14,  1}, { 14,  2}, { 15,  1}, { 15,  2},
-{ 16,  1}, { 17,  1}, { 18,  1}, { 19,  1}, { 20,  1}, { 21,  1}, { 22,  1}, { 23,  1},
-{ 24,  1}, { 25,  1}, { 26,  1}, { 27,  1}, { 28,  1}, { 29,  1}, { 30,  1}, { 31,  1},
-{ 32,  1}, { 33,  1}, { 34,  1}, { 35,  1}, { 36,  1}, { 37,  1}, { 38,  1}, { 39,  1},
-{ 40,  1}, { 41,  1}, { 42,  1}, { 43,  1}
-},
-{
-{  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  0,  6}, {  0,  7}, {  0,  8},
-{  0,  9}, {  0, 10}, {  0, 11}, {  0, 12}, {  0, 13}, {  0, 14}, {  0, 15}, {  0, 16},
-{  0, 17}, {  0, 18}, {  0, 19}, {  0, 20}, {  0, 21}, {  0, 22}, {  0, 23}, {  0, 24},
-{  0, 25}, {  0, 26}, {  0, 27}, {  1,  1}, {  1,  2}, {  1,  3}, {  1,  4}, {  1,  5},
-{  1,  6}, {  1,  7}, {  1,  8}, {  1,  9}, {  1, 10}, {  2,  1}, {  2,  2}, {  2,  3},
-{  2,  4}, {  2,  5}, {  3,  1}, {  3,  2}, {  3,  3}, {  3,  4}, {  4,  1}, {  4,  2},
-{  4,  3}, {  5,  1}, {  5,  2}, {  5,  3}, {  6,  1}, {  6,  2}, {  6,  3}, {  7,  1},
-{  7,  2}, {  7,  3}, {  8,  1}, {  8,  2}, {  9,  1}, {  9,  2}, { 10,  1}, { 11,  1},
-{ 12,  1}, { 13,  1}, { 14,  1}, {  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5},
-{  0,  6}, {  0,  7}, {  0,  8}, {  1,  1}, {  1,  2}, {  1,  3}, {  2,  1}, {  2,  2},
-{  3,  1}, {  3,  2}, {  4,  1}, {  4,  2}, {  5,  1}, {  5,  2}, {  6,  1}, {  6,  2},
-{  7,  1}, {  8,  1}, {  9,  1}, { 10,  1}, { 11,  1}, { 12,  1}, { 13,  1}, { 14,  1},
-{ 15,  1}, { 16,  1}, { 17,  1}, { 18,  1}, { 19,  1}, { 20,  1}
-},
-{
-{  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  0,  6}, {  0,  7}, {  0,  8},
-{  0,  9}, {  0, 10}, {  0, 11}, {  0, 12}, {  1,  1}, {  1,  2}, {  1,  3}, {  1,  4},
-{  1,  5}, {  1,  6}, {  2,  1}, {  2,  2}, {  2,  3}, {  2,  4}, {  3,  1}, {  3,  2},
-{  3,  3}, {  4,  1}, {  4,  2}, {  4,  3}, {  5,  1}, {  5,  2}, {  5,  3}, {  6,  1},
-{  6,  2}, {  6,  3}, {  7,  1}, {  7,  2}, {  8,  1}, {  8,  2}, {  9,  1}, {  9,  2},
-{ 10,  1}, { 10,  2}, { 11,  1}, { 12,  1}, { 13,  1}, { 14,  1}, { 15,  1}, { 16,  1},
-{ 17,  1}, { 18,  1}, { 19,  1}, { 20,  1}, { 21,  1}, { 22,  1}, { 23,  1}, { 24,  1},
-{ 25,  1}, { 26,  1}, {  0,  1}, {  0,  2}, {  0,  3}, {  1,  1}, {  1,  2}, {  2,  1},
-{  3,  1}, {  4,  1}, {  5,  1}, {  6,  1}, {  7,  1}, {  8,  1}, {  9,  1}, { 10,  1},
-{ 11,  1}, { 12,  1}, { 13,  1}, { 14,  1}, { 15,  1}, { 16,  1}, { 17,  1}, { 18,  1},
-{ 19,  1}, { 20,  1}, { 21,  1}, { 22,  1}, { 23,  1}, { 24,  1}, { 25,  1}, { 26,  1},
-{ 27,  1}, { 28,  1}, { 29,  1}, { 30,  1}, { 31,  1}, { 32,  1}, { 33,  1}, { 34,  1},
-{ 35,  1}, { 36,  1}, { 37,  1}, { 38,  1}, { 39,  1}, { 40,  1}
-},
-{
-{  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  0,  6}, {  0,  7}, {  0,  8},
-{  0,  9}, {  0, 10}, {  0, 11}, {  0, 12}, {  0, 13}, {  0, 14}, {  0, 15}, {  0, 16},
-{  0, 17}, {  0, 18}, {  0, 19}, {  0, 20}, {  0, 21}, {  0, 22}, {  0, 23}, {  0, 24},
-{  0, 25}, {  0, 26}, {  0, 27}, {  0, 28}, {  0, 29}, {  0, 30}, {  0, 31}, {  0, 32},
-{  0, 33}, {  0, 34}, {  0, 35}, {  0, 36}, {  0, 37}, {  0, 38}, {  0, 39}, {  0, 40},
-{  0, 41}, {  0, 42}, {  0, 43}, {  0, 44}, {  0, 45}, {  0, 46}, {  0, 47}, {  0, 48},
-{  0, 49}, {  0, 50}, {  0, 51}, {  0, 52}, {  0, 53}, {  0, 54}, {  0, 55}, {  0, 56},
-{  1,  1}, {  1,  2}, {  1,  3}, {  1,  4}, {  1,  5}, {  1,  6}, {  1,  7}, {  1,  8},
-{  1,  9}, {  1, 10}, {  1, 11}, {  1, 12}, {  1, 13}, {  1, 14}, {  1, 15}, {  1, 16},
-{  1, 17}, {  1, 18}, {  1, 19}, {  1, 20}, {  2,  1}, {  2,  2}, {  2,  3}, {  2,  4},
-{  2,  5}, {  2,  6}, {  2,  7}, {  2,  8}, {  2,  9}, {  2, 10}, {  3,  1}, {  3,  2},
-{  3,  3}, {  3,  4}, {  3,  5}, {  3,  6}, {  3,  7}, {  4,  1}, {  4,  2}, {  4,  3},
-{  4,  4}, {  4,  5}, {  4,  6}, {  5,  1}, {  5,  2}, {  5,  3}, {  5,  4}, {  5,  5},
-{  6,  1}, {  6,  2}, {  6,  3}, {  6,  4}, {  7,  1}, {  7,  2}, {  7,  3}, {  8,  1},
-{  8,  2}, {  8,  3}, {  9,  1}, {  9,  2}, {  9,  3}, { 10,  1}, { 10,  2}, { 11,  1},
-{ 11,  2}, { 12,  1}, { 12,  2}, { 13,  1}, { 13,  2}, { 14,  1}, {  0,  1}, {  0,  2},
-{  0,  3}, {  0,  4}, {  1,  1}, {  1,  2}, {  1,  3}, {  2,  1}, {  2,  2}, {  2,  3},
-{  3,  1}, {  3,  2}, {  4,  1}, {  4,  2}, {  5,  1}, {  5,  2}, {  6,  1}, {  6,  2},
-{  7,  1}, {  7,  2}, {  8,  1}, {  8,  2}, {  9,  1}, {  9,  2}, { 10,  1}, { 10,  2},
-{ 11,  1}, { 11,  2}, { 12,  1}, { 12,  2}, { 13,  1}, { 13,  2}, { 14,  1}, { 14,  2},
-{ 15,  1}, { 16,  1}
-},
-{
-{  0,  1}, {  0,  2}, {  0,  3}, {  0,  4}, {  0,  5}, {  0,  6}, {  0,  7}, {  0,  8},
-{  0,  9}, {  0, 10}, {  0, 11}, {  0, 12}, {  0, 13}, {  0, 14}, {  0, 15}, {  0, 16},
-{  0, 17}, {  0, 18}, {  0, 19}, {  0, 20}, {  0, 21}, {  0, 22}, {  0, 23}, {  0, 24},
-{  0, 25}, {  0, 26}, {  0, 27}, {  0, 28}, {  0, 29}, {  0, 30}, {  0, 31}, {  0, 32},
-{  1,  1}, {  1,  2}, {  1,  3}, {  1,  4}, {  1,  5}, {  1,  6}, {  1,  7}, {  1,  8},
-{  1,  9}, {  1, 10}, {  1, 11}, {  1, 12}, {  1, 13}, {  2,  1}, {  2,  2}, {  2,  3},
-{  2,  4}, {  2,  5}, {  2,  6}, {  2,  7}, {  2,  8}, {  3,  1}, {  3,  2}, {  3,  3},
-{  3,  4}, {  3,  5}, {  3,  6}, {  4,  1}, {  4,  2}, {  4,  3}, {  4,  4}, {  4,  5},
-{  5,  1}, {  5,  2}, {  5,  3}, {  5,  4}, {  6,  1}, {  6,  2}, {  6,  3}, {  6,  4},
-{  7,  1}, {  7,  2}, {  7,  3}, {  8,  1}, {  8,  2}, {  8,  3}, {  9,  1}, {  9,  2},
-{  9,  3}, { 10,  1}, { 10,  2}, { 11,  1}, { 11,  2}, { 12,  1}, { 12,  2}, { 13,  1},
-{ 13,  2}, { 14,  1}, { 14,  2}, { 15,  1}, { 15,  2}, { 16,  1}, { 16,  2}, { 17,  1},
-{ 17,  2}, { 18,  1}, { 18,  2}, { 19,  1}, { 19,  2}, { 20,  1}, { 20,  2}, { 21,  1},
-{ 21,  2}, { 22,  1}, { 22,  2}, { 23,  1}, { 24,  1}, {  0,  1}, {  0,  2}, {  0,  3},
-{  0,  4}, {  1,  1}, {  1,  2}, {  1,  3}, {  2,  1}, {  2,  2}, {  2,  3}, {  3,  1},
-{  3,  2}, {  3,  3}, {  4,  1}, {  4,  2}, {  5,  1}, {  5,  2}, {  6,  1}, {  6,  2},
-{  7,  1}, {  7,  2}, {  8,  1}, {  8,  2}, {  9,  1}, {  9,  2}, { 10,  1}, { 10,  2},
-{ 11,  1}, { 11,  2}, { 12,  1}, { 12,  2}, { 13,  1}, { 13,  2}, { 14,  1}, { 14,  2},
-{ 15,  1}, { 15,  2}, { 16,  1}, { 16,  2}, { 17,  1}, { 17,  2}, { 18,  1}, { 18,  2},
-{ 19,  1}, { 19,  2}, { 20,  1}, { 20,  2}, { 21,  1}, { 21,  2}, { 22,  1}, { 22,  2},
-{ 23,  1}, { 23,  2}, { 24,  1}, { 24,  2}, { 25,  1}, { 25,  2}, { 26,  1}, { 26,  2},
-{ 27,  1}, { 27,  2}, { 28,  1}, { 28,  2}, { 29,  1}, { 30,  1}
-}
-};
-
-static const uint8_t vc1_delta_level_table[AC_MODES][31] = {
-{
-      19,    15,    12,    11,     6,     5,     4,     4,     4,     4,
-       3,     3,     3,     3,     3,     3,     2,     2,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1
-},
-{
-      23,    11,     8,     7,     5,     5,     4,     4,     3,     3,
-       3,     3,     2,     2,     2,     2,     2,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1
-},
-{
-      16,    11,     8,     7,     5,     4,     4,     3,     3,     3,
-       3,     3,     3,     3,     2,     2,     1,     1,     1,     1,
-       1
-},
-{
-      14,     9,     5,     4,     4,     4,     3,     3,     3,     3,
-       3,     3,     3,     2,     2,     2,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1
-},
-{
-      27,    10,     5,     4,     3,     3,     3,     3,     2,     2,
-       1,     1,     1,     1,     1
-},
-{
-      12,     6,     4,     3,     3,     3,     3,     2,     2,     2,
-       2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1
-},
-{
-      56,    20,    10,     7,     6,     5,     4,     3,     3,     3,
-       2,     2,     2,     2,     1
-},
-{
-      32,    13,     8,     6,     5,     4,     4,     3,     3,     3,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     1,     1
-}
-};
-
-static const uint8_t vc1_last_delta_level_table[AC_MODES][44] = {
-{
-       6,     5,     4,     4,     3,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1
-},
-{
-       9,     5,     4,     4,     3,     3,     3,     2,     2,     2,
-       2,     2,     2,     2,     2,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1
-},
-{
-       4,     4,     3,     3,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1
-},
-{
-       5,     4,     3,     3,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1
-},
-{
-       8,     3,     2,     2,     2,     2,     2,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1
-},
-{
-       3,     2,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1
-},
-{
-       4,     3,     3,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     1,     1
-},
-{
-       4,     3,     3,     3,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     1,
-       1
-}
-};
-
-static const uint8_t vc1_delta_run_table[AC_MODES][57] = {
-{
-      -1,    30,    17,    15,     9,     5,     4,     3,     3,     3,
-       3,     3,     2,     1,     1,     1,     0,     0,     0,
-       0
-},
-{
-      -1,    26,    16,    11,     7,     5,     3,     3,     2,     1,
-       1,     1,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0
-},
-{
-      -1,    20,    15,    13,     6,     4,     3,     3,     2,     1,
-       1,     1,     0,     0,     0,     0,     0
-},
-{
-      -1,    29,    15,    12,     5,     2,     1,     1,     1,     1,
-       0,     0,     0,     0,     0
-},
-{
-      -1,    14,     9,     7,     3,     2,     1,     1,     1,     1,
-       1,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0
-},
-{
-      -1,    26,    10,     6,     2,     1,     1,     0,     0,     0,
-       0,     0,     0
-},
-{
-      -1,    14,    13,     9,     6,     5,     4,     3,     2,     2,
-       2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0
-},
-{
-      -1,    24,    22,     9,     6,     4,     3,     2,     2,     1,
-       1,     1,     1,     1,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0
-}
-};
-
-static const uint8_t vc1_last_delta_run_table[AC_MODES][10] = {
-{
-      -1,    37,    15,     4,     3,     1,     0
-},
-{
-      -1,    36,    14,     6,     3,     1,     0,     0,     0,
-       0
-},
-{
-      -1,    26,    13,     3,     1
-},
-{
-      -1,    43,    15,     3,     1,     0
-},
-{
-      -1,    20,     6,     1,     0,     0,     0,     0,     0
-},
-{
-      -1,    40,     1,     0
-},
-{
-      -1,    16,    14,     2,     0
-},
-{
-      -1,    30,    28,     3,     0
-}
-};
-
-#endif /* AVCODEC_VC1ACDATA_H */
diff --git a/deps/libav/libavcodec/vc1data.c b/deps/libav/libavcodec/vc1data.c
deleted file mode 100644
index 70cead8..0000000
--- a/deps/libav/libavcodec/vc1data.c
+++ /dev/null
@@ -1,1135 +0,0 @@
-/*
- * VC-1 and WMV3 decoder
- * copyright (c) 2011 Mashiat Sarker Shakkhar
- * copyright (c) 2006 Konstantin Shishkov
- * (c) 2005 anonymous, Alex Beregszaszi, Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VC-1 tables.
- */
-
-#include "avcodec.h"
-#include "vc1.h"
-#include "vc1data.h"
-
-/** Table for conversion between TTBLK and TTMB */
-const int ff_vc1_ttblk_to_tt[3][8] = {
-    { TT_8X4, TT_4X8, TT_8X8, TT_4X4, TT_8X4_TOP, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT },
-    { TT_8X8, TT_4X8_RIGHT, TT_4X8_LEFT, TT_4X4, TT_8X4, TT_4X8, TT_8X4_BOTTOM, TT_8X4_TOP },
-    { TT_8X8, TT_4X8, TT_4X4, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT, TT_8X4, TT_8X4_TOP }
-};
-
-const int ff_vc1_ttfrm_to_tt[4] = { TT_8X8, TT_8X4, TT_4X8, TT_4X4 };
-
-/** MV P mode - the 5th element is only used for mode 1 */
-const uint8_t ff_vc1_mv_pmode_table[2][5] = {
-    { MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_MIXED_MV },
-    { MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_1MV_HPEL_BILIN }
-};
-const uint8_t ff_vc1_mv_pmode_table2[2][4] = {
-    { MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_MIXED_MV },
-    { MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_1MV_HPEL_BILIN }
-};
-
-/* MBMODE table for interlaced frame P-picture */
-const uint8_t ff_vc1_mbmode_intfrp[2][15][4] = {
-    { /* 1: 4-MV, 0: non-4-MV */
-        /* Type, FIELDTX, 1-MV Differential present, Residuals (CBP) present */
-        /* Table 164 - Table 167 */
-        { MV_PMODE_INTFR_1MV      , 0, 1, 1 },
-        { MV_PMODE_INTFR_1MV      , 1, 1, 1 },
-        { MV_PMODE_INTFR_1MV      , 0, 1, 0 },
-        { MV_PMODE_INTFR_1MV      , 0, 0, 1 },
-        { MV_PMODE_INTFR_1MV      , 1, 0, 1 },
-        { MV_PMODE_INTFR_2MV_FIELD, 0, 0, 1 },
-        { MV_PMODE_INTFR_2MV_FIELD, 1, 0, 1 },
-        { MV_PMODE_INTFR_2MV_FIELD, 0, 0, 0 },
-        { MV_PMODE_INTFR_INTRA    , 0, 0, 0 }
-    },
-    {
-        /* Table 160 - Table 163 */
-        { MV_PMODE_INTFR_1MV      , 0, 1, 1 },
-        { MV_PMODE_INTFR_1MV      , 1, 1, 1 },
-        { MV_PMODE_INTFR_1MV      , 0, 1, 0 },
-        { MV_PMODE_INTFR_1MV      , 0, 0, 1 },
-        { MV_PMODE_INTFR_1MV      , 1, 0, 1 },
-        { MV_PMODE_INTFR_2MV_FIELD, 0, 0, 1 },
-        { MV_PMODE_INTFR_2MV_FIELD, 1, 0, 1 },
-        { MV_PMODE_INTFR_2MV_FIELD, 0, 0, 0 },
-        { MV_PMODE_INTFR_4MV      , 0, 0, 1 },
-        { MV_PMODE_INTFR_4MV      , 1, 0, 1 },
-        { MV_PMODE_INTFR_4MV      , 0, 0, 0 },
-        { MV_PMODE_INTFR_4MV_FIELD, 0, 0, 1 },
-        { MV_PMODE_INTFR_4MV_FIELD, 1, 0, 1 },
-        { MV_PMODE_INTFR_4MV_FIELD, 0, 0, 0 },
-        { MV_PMODE_INTFR_INTRA    , 0, 0, 0 }
-    }
-};
-
-const int ff_vc1_fps_nr[7] = { 24, 25, 30, 50, 60, 48, 72 },
-          ff_vc1_fps_dr[2] = { 1000, 1001 };
-const uint8_t ff_vc1_pquant_table[3][32] = {
-    /* Implicit quantizer */
-    {  0,  1,  2,  3,  4,  5,  6,  7,  8,  6,  7,  8,  9, 10, 11, 12,
-      13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29, 31 },
-    /* Explicit quantizer, pquantizer uniform */
-    {  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-      16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 },
-    /* Explicit quantizer, pquantizer non-uniform */
-    {  0,  1,  1,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,
-      14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31 }
-};
-
-/** @name VC-1 VLC tables and defines
- *  @todo TODO move this into the context
- */
-//@{
-#define VC1_BFRACTION_VLC_BITS 7
-VLC ff_vc1_bfraction_vlc;
-#define VC1_IMODE_VLC_BITS 4
-VLC ff_vc1_imode_vlc;
-#define VC1_NORM2_VLC_BITS 3
-VLC ff_vc1_norm2_vlc;
-#define VC1_NORM6_VLC_BITS 9
-VLC ff_vc1_norm6_vlc;
-/* Could be optimized, one table only needs 8 bits */
-#define VC1_TTMB_VLC_BITS 9 //12
-VLC ff_vc1_ttmb_vlc[3];
-#define VC1_MV_DIFF_VLC_BITS 9 //15
-VLC ff_vc1_mv_diff_vlc[4];
-#define VC1_CBPCY_P_VLC_BITS 9 //14
-VLC ff_vc1_cbpcy_p_vlc[4];
-#define VC1_ICBPCY_VLC_BITS 9
-VLC ff_vc1_icbpcy_vlc[8];
-#define VC1_4MV_BLOCK_PATTERN_VLC_BITS 6
-VLC ff_vc1_4mv_block_pattern_vlc[4];
-#define VC1_2MV_BLOCK_PATTERN_VLC_BITS 3
-VLC ff_vc1_2mv_block_pattern_vlc[4];
-#define VC1_TTBLK_VLC_BITS 5
-VLC ff_vc1_ttblk_vlc[3];
-#define VC1_SUBBLKPAT_VLC_BITS 6
-VLC ff_vc1_subblkpat_vlc[3];
-#define VC1_INTFR_4MV_MBMODE_VLC_BITS 9
-VLC ff_vc1_intfr_4mv_mbmode_vlc[4];
-#define VC1_INTFR_NON4MV_MBMODE_VLC_BITS 6
-VLC ff_vc1_intfr_non4mv_mbmode_vlc[4];
-#define VC1_IF_MMV_MBMODE_VLC_BITS 5
-VLC ff_vc1_if_mmv_mbmode_vlc[8];
-#define VC1_IF_1MV_MBMODE_VLC_BITS 5
-VLC ff_vc1_if_1mv_mbmode_vlc[8];
-#define VC1_1REF_MVDATA_VLC_BITS 9
-VLC ff_vc1_1ref_mvdata_vlc[4];
-#define VC1_2REF_MVDATA_VLC_BITS 9
-VLC ff_vc1_2ref_mvdata_vlc[8];
-
-VLC ff_vc1_ac_coeff_table[8];
-
-#define VC1_IF_MBMODE_VLC_BITS 5    // as a placeholder for VC1_IF_MMV_MBMODE_VLC_BITS
-                                    // or VC1_IF_1MV_MBMODE_VLC_BITS since they are the same
-//@}
-
-
-#if B_FRACTION_DEN == 840 // original bfraction from vc9data.h, not conforming to standard
-/* bfraction is fractional, we scale to the GCD 3*5*7*8 = 840 */
-const int16_t ff_vc1_bfraction_lut[23] = {
-    420 /*1/2*/, 280 /*1/3*/, 560 /*2/3*/, 210 /*1/4*/,
-    630 /*3/4*/, 168 /*1/5*/, 336 /*2/5*/,
-    504 /*3/5*/, 672 /*4/5*/, 140 /*1/6*/, 700 /*5/6*/,
-    120 /*1/7*/, 240 /*2/7*/, 360 /*3/7*/, 480 /*4/7*/,
-    600 /*5/7*/, 720 /*6/7*/, 105 /*1/8*/, 315 /*3/8*/,
-    525 /*5/8*/, 735 /*7/8*/,
-    -1 /*inv.*/, 0 /*BI fm*/
-};
-#else
-/* pre-computed scales for all bfractions and base=256 */
-const int16_t ff_vc1_bfraction_lut[23] = {
-    128 /*1/2*/,  85 /*1/3*/, 170 /*2/3*/,  64 /*1/4*/,
-    192 /*3/4*/,  51 /*1/5*/, 102 /*2/5*/,
-    153 /*3/5*/, 204 /*4/5*/,  43 /*1/6*/, 215 /*5/6*/,
-     37 /*1/7*/,  74 /*2/7*/, 111 /*3/7*/, 148 /*4/7*/,
-    185 /*5/7*/, 222 /*6/7*/,  32 /*1/8*/,  96 /*3/8*/,
-    160 /*5/8*/, 224 /*7/8*/,
-    -1 /*inv.*/, 0 /*BI fm*/
-};
-#endif
-
-const uint8_t ff_vc1_bfraction_bits[23] = {
-    3, 3, 3, 3,
-    3, 3, 3,
-    7, 7, 7, 7,
-    7, 7, 7, 7,
-    7, 7, 7, 7,
-    7, 7,
-    7, 7
-};
-const uint8_t ff_vc1_bfraction_codes[23] = {
-      0,   1,   2,   3,
-      4,   5,   6,
-    112, 113, 114, 115,
-    116, 117, 118, 119,
-    120, 121, 122, 123,
-    124, 125,
-    126, 127
-};
-
-//Same as H.264
-const AVRational ff_vc1_pixel_aspect[16] = {
-    {   0,  1 },
-    {   1,  1 },
-    {  12, 11 },
-    {  10, 11 },
-    {  16, 11 },
-    {  40, 33 },
-    {  24, 11 },
-    {  20, 11 },
-    {  32, 11 },
-    {  80, 33 },
-    {  18, 11 },
-    {  15, 11 },
-    {  64, 33 },
-    { 160, 99 },
-    {   0,  1 },
-    {   0,  1 }
-};
-
-/* BitPlane IMODE - such a small table... */
-const uint8_t ff_vc1_imode_codes[7] = {
-    0, 2, 1, 3, 1, 2, 3
-};
-const uint8_t ff_vc1_imode_bits[7] = {
-    4, 2, 3, 2, 4, 3, 3
-};
-
-/* Normal-2 imode */
-const uint8_t ff_vc1_norm2_codes[4] = {
-    0, 4, 5, 3
-};
-const uint8_t ff_vc1_norm2_bits[4] = {
-    1, 3, 3, 2
-};
-
-const uint16_t ff_vc1_norm6_codes[64] = {
-    0x001, 0x002, 0x003, 0x000, 0x004, 0x001, 0x002, 0x047, 0x005, 0x003, 0x004, 0x04B, 0x005, 0x04D, 0x04E, 0x30E,
-    0x006, 0x006, 0x007, 0x053, 0x008, 0x055, 0x056, 0x30D, 0x009, 0x059, 0x05A, 0x30C, 0x05C, 0x30B, 0x30A, 0x037,
-    0x007, 0x00A, 0x00B, 0x043, 0x00C, 0x045, 0x046, 0x309, 0x00D, 0x049, 0x04A, 0x308, 0x04C, 0x307, 0x306, 0x036,
-    0x00E, 0x051, 0x052, 0x305, 0x054, 0x304, 0x303, 0x035, 0x058, 0x302, 0x301, 0x034, 0x300, 0x033, 0x032, 0x007,
-};
-
-const uint8_t ff_vc1_norm6_bits[64] = {
-    1,  4,  4,  8,  4,  8,  8, 10,  4,  8,  8, 10,  8, 10, 10, 13,
-    4,  8,  8, 10,  8, 10, 10, 13,  8, 10, 10, 13, 10, 13, 13,  9,
-    4,  8,  8, 10,  8, 10, 10, 13,  8, 10, 10, 13, 10, 13, 13,  9,
-    8, 10, 10, 13, 10, 13, 13,  9, 10, 13, 13,  9, 13,  9,  9,  6,
-};
-
-/* 4MV Block pattern VLC tables */
-const uint8_t ff_vc1_4mv_block_pattern_codes[4][16] = {
-    { 14, 58, 59, 25, 12, 26, 15, 15, 13, 24, 27,  0, 28,  1,  2,  2 },
-    {  8, 18, 19,  4, 20,  5, 30, 11, 21, 31,  6, 12,  7, 13, 14,  0 },
-    { 15,  6,  7,  2,  8,  3, 28,  9, 10, 29,  4, 11,  5, 12, 13,  0 },
-    {  0, 11, 12,  4, 13,  5, 30, 16, 14, 31,  6, 17,  7, 18, 19, 10 }
-};
-const uint8_t ff_vc1_4mv_block_pattern_bits[4][16] = {
-    { 5, 6, 6, 5, 5, 5, 5, 4, 5, 5, 5, 3, 5, 3, 3, 2 },
-    { 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2 },
-    { 4, 4, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 4, 3 },
-    { 2, 4, 4, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4 }
-};
-
-/* 2MV Block pattern VLC tables */
-const uint8_t ff_vc1_2mv_block_pattern_codes[4][4] = {
-    { 2, 1, 0, 3 }, { 1, 0, 2, 3 }, { 2, 0, 3, 1 }, { 1, 3, 2, 0 }
-};
-
-const uint8_t ff_vc1_2mv_block_pattern_bits[4][4] = {
-    { 2, 2, 2, 2 }, { 1, 2, 3, 3 }, { 3, 2, 3, 1 }, { 1, 3, 3, 2 }
-};
-
-/* Interlaced frame picture 4MV MBMODE VLC tables (p. 246, p. 360) */
-const uint16_t ff_vc1_intfr_4mv_mbmode_codes[4][15] = {
-    { 22,  17,  0, 47,  32, 10,  1,  3, 67,  133, 132,  92,  19,  93,   18 },
-    {  3,  45,  0,  7,  23,  6,  1,  2, 10,   39,  44,   8,  18,  77,   76 },
-    { 15,   6, 28,  9,  41,  6,  2, 15, 14,    8,  40,  29,   0,  21,   11 },
-    {  7, 198,  1,  2, 193, 13, 25,  0, 97, 1599,  98, 398, 798, 192, 1598 }
-};
-
-const uint8_t ff_vc1_intfr_4mv_mbmode_bits[4][15] = {
-    { 5, 5, 2, 6, 6, 4, 2, 2, 7,  8, 8,  7,  5, 7,  5 },
-    { 3, 6, 3, 3, 5, 3, 3, 3, 4,  6, 6,  4,  5, 7,  7 },
-    { 4, 3, 5, 5, 7, 4, 2, 5, 5,  5, 7,  5,  2, 6,  5 },
-    { 4, 9, 1, 3, 9, 5, 6, 2, 8, 12, 8, 10, 11, 9, 12 }
-};
-
-/* Interlaced frame picture NON-4MV MBMODE VLC tables (p. 363) */
-const uint8_t ff_vc1_intfr_non4mv_mbmode_codes[4][9] = {
-    {  9, 22,  0, 17, 16, 10,  1,  3, 23 },
-    {  7,  0,  5,  2,  1,  1,  6,  3,  4 },
-    {  1,  0, 10, 23, 44,  8,  3,  9, 45 },
-    {  7, 97,  1,  2, 49, 13, 25,  0, 96 }
-};
-
-const uint8_t ff_vc1_intfr_non4mv_mbmode_bits[4][9] = {
-    {  4,  5,  2,  5,  5,  4,  2,  2,  5 },
-    {  3,  4,  6,  2,  3,  2,  3,  5,  6 },
-    {  2,  2,  4,  5,  6,  4,  2,  4,  6 },
-    {  4,  8,  1,  3,  7,  5,  6,  2,  8 }
-};
-
-/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */
-/* mixed-MV */
-const uint8_t ff_vc1_if_mmv_mbmode_codes[8][8] = {
-    { 16, 17,  3,  3,  0,  5,  9,  2 },
-    {  8,  9,  3,  6,  7,  0,  5,  2 },
-    { 16, 17,  5,  3,  0,  3,  9,  2 },
-    { 56, 57, 15,  4,  5,  6, 29,  0 },
-    { 52, 53, 27, 14, 15,  2, 12,  0 },
-    { 56, 57, 29,  5,  6,  0, 15,  4 },
-    { 16, 17,  6,  7,  0,  1,  9,  5 },
-    { 56, 57,  0,  5,  6, 29,  4, 15 }
-};
-const uint8_t ff_vc1_if_mmv_mbmode_bits[8][8] = {
-    { 6, 6, 2, 3, 2, 4, 5, 2 },
-    { 5, 5, 3, 3, 3, 2, 4, 2 },
-    { 6, 6, 4, 3, 2, 2, 5, 2 },
-    { 6, 6, 4, 3, 3, 3, 5, 1 },
-    { 6, 6, 5, 4, 4, 2, 4, 1 },
-    { 6, 6, 5, 3, 3, 1, 4, 3 },
-    { 5, 5, 3, 3, 2, 2, 4, 3 },
-    { 6, 6, 1, 3, 3, 5, 3, 4 }
-};
-/* 1MV */
-const uint8_t ff_vc1_if_1mv_mbmode_codes[8][6] = {
-    {  0,  1,  1,  1,  1,  1 },
-    {  0,  1,  1,  1,  1,  1 },
-    { 16, 17,  3,  0,  9,  5 },
-    { 20, 21,  3, 11,  0,  4 },
-    {  4,  5,  2,  3,  3,  0 },
-    {  4,  5,  3,  2,  0,  3 },
-    {  0,  1,  1,  1,  1,  1 },
-    { 16, 17,  9,  5,  3,  0 }
-};
-const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6] = {
-    { 5, 5, 1, 3, 2, 4 },
-    { 5, 5, 1, 2, 3, 4 },
-    { 5, 5, 2, 1, 4, 3 },
-    { 5, 5, 2, 4, 1, 3 },
-    { 4, 4, 2, 3, 2, 2 },
-    { 4, 4, 3, 2, 2, 2 },
-    { 5, 5, 3, 4, 1, 2 },
-    { 5, 5, 4, 3, 2, 1 }
-};
-
-/* Interlaced frame/field picture MVDATA VLC tables */
-
-/* 1-reference tables */
-const uint32_t ff_vc1_1ref_mvdata_codes[4][72] = { /* uint32_t may be too big */
-  {
-    0x00005, 0x0000C, 0x0001E, 0x00012, 0x0000C, 0x00034, 0x00075, 0x00070,
-    0x00000, 0x00008, 0x0001B, 0x00008, 0x0001D, 0x0007C, 0x000D6, 0x001DE,
-    0x001AF, 0x00005, 0x0001B, 0x00026, 0x0001E, 0x00012, 0x00076, 0x0004D,
-    0x001F6, 0x001F4, 0x00039, 0x0007F, 0x00027, 0x0006A, 0x00071, 0x00035,
-    0x00071, 0x00068, 0x001DC, 0x00027, 0x00073, 0x000FF, 0x000E8, 0x000E9,
-    0x0007E, 0x001F9, 0x001F5, 0x001FD, 0x0003E, 0x001CA, 0x003F9, 0x0004C,
-    0x00069, 0x001FA, 0x001DF, 0x001F7, 0x00070, 0x001DD, 0x00E4D, 0x00727,
-    0x00392, 0x001C8, 0x001CB, 0x003F8, 0x001AE, 0x001F8, 0x001FB, 0x0E4CE,
-    0x0E4CF, 0x07260, 0x07261, 0x07262, 0x07263, 0x07264, 0x07265, 0x07266
-  },
-  {
-    0x00007, 0x00001, 0x00007, 0x00016, 0x00001, 0x00045, 0x00018, 0x002B6,
-    0x00006, 0x00004, 0x00017, 0x00010, 0x00029, 0x0002C, 0x0015A, 0x00066,
-    0x0019E, 0x00009, 0x00028, 0x00017, 0x00000, 0x0002A, 0x00004, 0x0005B,
-    0x000B5, 0x000CE, 0x00006, 0x00044, 0x0000F, 0x00046, 0x0000E, 0x000AC,
-    0x00032, 0x00037, 0x011EB, 0x0000A, 0x0001A, 0x0011F, 0x00016, 0x00014,
-    0x0002B, 0x00168, 0x00055, 0x023D5, 0x00057, 0x0002F, 0x00036, 0x0002E,
-    0x00169, 0x00054, 0x0047B, 0x0019F, 0x02B7D, 0x0008E, 0x00ADE, 0x00479,
-    0x0056E, 0x008F4, 0x015BF, 0x00478, 0x023D4, 0x0ADF1, 0x056F9, 0xADF0E,
-    0xADF0F, 0x56F80, 0x56F81, 0x56F82, 0x56F83, 0x56F84, 0x56F85, 0x56F86
-  },
-  {
-    0x00002, 0x00006, 0x00007, 0x0000D, 0x00007, 0x00030, 0x000FF, 0x001F0,
-    0x00002, 0x00000, 0x00005, 0x00019, 0x0001E, 0x00007, 0x00063, 0x000FD,
-    0x00023, 0x0000E, 0x0001B, 0x0001A, 0x00006, 0x00009, 0x00018, 0x000C5,
-    0x00033, 0x001F1, 0x00002, 0x003FB, 0x001F3, 0x00022, 0x001FC, 0x00042,
-    0x00623, 0x00083, 0x00620, 0x0007D, 0x00040, 0x00043, 0x003E4, 0x003E5,
-    0x00191, 0x00FE9, 0x00105, 0x00208, 0x000FC, 0x00624, 0x00622, 0x00190,
-    0x00626, 0x007F5, 0x00C4B, 0x01FD0, 0x0104D, 0x00065, 0x00C42, 0x000C9,
-    0x00627, 0x00C43, 0x00C4A, 0x0104E, 0x01FD1, 0x0104F, 0x00412, 0x104CE,
-    0x104CF, 0x08260, 0x08261, 0x08262, 0x08263, 0x08264, 0x08265, 0x08266
-  },
-  {
-    0x0000D, 0x00001, 0x00004, 0x00000, 0x00017, 0x00005, 0x0007F, 0x0004D,
-    0x00003, 0x00011, 0x0003E, 0x0003B, 0x00017, 0x00067, 0x0004A, 0x000C3,
-    0x000F2, 0x0000A, 0x0002C, 0x00032, 0x0003D, 0x00015, 0x00028, 0x00093,
-    0x000CC, 0x00096, 0x00003, 0x00075, 0x00020, 0x0002D, 0x00021, 0x00029,
-    0x00090, 0x001D0, 0x001FB, 0x0001C, 0x0004C, 0x00060, 0x00009, 0x00008,
-    0x0002D, 0x0009F, 0x001FA, 0x0013D, 0x00031, 0x000FC, 0x00058, 0x00092,
-    0x000F0, 0x000F1, 0x000CD, 0x00185, 0x00165, 0x0004E, 0x00091, 0x000E9,
-    0x00184, 0x001D1, 0x001E6, 0x00097, 0x001E7, 0x000B3, 0x0013C, 0x0164E,
-    0x0164F, 0x00B20, 0x00B21, 0x00B22, 0x00B23, 0x00B24, 0x00B25, 0x00B26
-  }
-};
-
-const uint8_t ff_vc1_1ref_mvdata_bits[4][72] = {
-  {
-     3,  4,  5,  5,  5,  6,  7,  7,  2,  4,  5,  5,  6,  7,  8,  9,  9,  4,
-     6,  6,  6,  6,  7,  8,  9,  9,  6,  8,  7,  7,  7,  7,  8,  8,  9,  6,
-     8,  8,  8,  8,  8,  9,  9,  9,  7, 10, 10,  8,  8,  9,  9,  9,  8,  9,
-    13, 12, 11, 10, 10, 10,  9,  9,  9, 17, 17, 16, 16, 16, 16, 16, 16, 16
-  },
-  {
-     3,  3,  4,  5,  5,  7,  8, 10,  3,  4,  5,  5,  6,  7,  9, 10, 12,  4,
-     6,  6,  5,  6,  6,  8,  9, 11,  4,  7,  7,  7,  7,  8,  9,  9, 13,  5,
-     8,  9,  8,  8,  9, 10, 10, 14,  7,  9,  9,  9, 10, 10, 11, 12, 14,  8,
-    12, 11, 11, 12, 13, 11, 14, 16, 15, 20, 20, 19, 19, 19, 19, 19, 19, 19
-  },
-  {
-     3,  4,  4,  4,  5,  6,  8,  9,  2,  4,  5,  5,  5,  6,  7,  8,  8,  4,
-     7,  7,  6,  6,  7,  8,  8,  9,  5, 10,  9,  8,  9,  9, 11, 10, 11,  7,
-     9,  9, 10, 10, 11, 12, 11, 12,  8, 11, 11, 11, 11, 11, 12, 13, 15,  9,
-    12, 10, 11, 12, 12, 15, 13, 15, 13, 19, 19, 18, 18, 18, 18, 18, 18, 18
-  },
-  {
-     4,  4,  4,  4,  5,  5,  7,  7,  3,  5,  6,  6,  6,  7,  7,  8,  8,  4,
-     6,  6,  6,  6,  7,  8,  8,  8,  4,  7,  6,  6,  6,  7,  8,  9,  9,  5,
-     7,  7,  6,  6,  7,  8,  9,  9,  6,  8,  8,  8,  8,  8,  8,  9, 10,  7,
-     8,  8,  9,  9,  9,  8,  9,  9,  9, 14, 14, 13, 13, 13, 13, 13, 13, 13
-  }
-};
-
-/* 2-reference tables */
-const uint32_t ff_vc1_2ref_mvdata_codes[8][126] = { /* table 132 - table 139 */
-  {
-    0x0000C, 0x0001C, 0x0000B, 0x00000, 0x0000E, 0x0002A, 0x00050, 0x00368,
-    0x00002, 0x0001A, 0x00004, 0x0003A, 0x0001D, 0x0006C, 0x000EF, 0x001BC,
-    0x0015F, 0x0000F, 0x00003, 0x0001C, 0x0000D, 0x0000B, 0x0003E, 0x000A7,
-    0x00146, 0x00199, 0x00006, 0x0001F, 0x00004, 0x0003C, 0x00007, 0x001BE,
-    0x0008B, 0x0002C, 0x007B3, 0x00005, 0x000DB, 0x00056, 0x000EC, 0x00052,
-    0x001BD, 0x00078, 0x000CF, 0x00573, 0x00009, 0x00023, 0x000ED, 0x00018,
-    0x00006, 0x00044, 0x000F5, 0x00079, 0x006D2, 0x0006E, 0x0002B, 0x0015D,
-    0x00017, 0x0037F, 0x00144, 0x000CE, 0x00028, 0x000AB, 0x00010, 0x001B5,
-    0x000F7, 0x000A6, 0x0007B, 0x00028, 0x001ED, 0x001E9, 0x006FD, 0x00004,
-    0x000F5, 0x00029, 0x0028A, 0x0028B, 0x0028F, 0x00DF9, 0x00335, 0x01E85,
-    0x000EE, 0x002BD, 0x0002B, 0x003D8, 0x003D1, 0x00198, 0x001E9, 0x0051D,
-    0x000B4, 0x0003F, 0x00455, 0x0022B, 0x00229, 0x00451, 0x00578, 0x007B2,
-    0x00570, 0x00155, 0x00032, 0x003D0, 0x00054, 0x006D3, 0x00571, 0x00454,
-    0x00334, 0x01BF1, 0x000B7, 0x00029, 0x01E84, 0x0016C, 0x0019B, 0x01BF0,
-    0x00579, 0x00F43, 0x000B5, 0x008A1, 0x0002A, 0x0016D, 0x008A0, 0x007A0,
-    0x003D1, 0x00AE5, 0x00154, 0x00AE4, 0x00A39, 0x00A38
-  },
-  {
-    0x00003, 0x00009, 0x00016, 0x00010, 0x000D7, 0x00335, 0x00574, 0x00555,
-    0x00000, 0x0001D, 0x00009, 0x00017, 0x0002C, 0x000AD, 0x00374, 0x006B3,
-    0x00577, 0x0000F, 0x00018, 0x0000A, 0x0002E, 0x00022, 0x0017C, 0x00E7B,
-    0x01B89, 0x015D8, 0x00008, 0x00034, 0x0006D, 0x00023, 0x001C2, 0x00376,
-    0x002D3, 0x01C4A, 0x0330A, 0x00014, 0x0006A, 0x00072, 0x0006C, 0x000E3,
-    0x0019B, 0x0073F, 0x01CF0, 0x00B41, 0x00032, 0x000E6, 0x000E0, 0x000CF,
-    0x000AB, 0x0019C, 0x002AB, 0x00E2B, 0x015D9, 0x0006F, 0x001C3, 0x000AF,
-    0x000BF, 0x000AC, 0x0017D, 0x006E3, 0x00E29, 0x01984, 0x00054, 0x000B5,
-    0x0017A, 0x001AD, 0x00199, 0x00178, 0x00358, 0x002D2, 0x01C4B, 0x0005B,
-    0x002A8, 0x00331, 0x00388, 0x0038B, 0x00370, 0x00713, 0x00CC3, 0x01CF1,
-    0x001B9, 0x005EF, 0x00738, 0x002F2, 0x0033B, 0x002B9, 0x006EB, 0x00570,
-    0x00E24, 0x0039D, 0x005A2, 0x005A3, 0x00E7D, 0x005EE, 0x00739, 0x00554,
-    0x00AA5, 0x00AA4, 0x00377, 0x01CF5, 0x00BCE, 0x00E79, 0x00660, 0x00674,
-    0x006EA, 0x00E7C, 0x00D65, 0x002F6, 0x015DA, 0x01B88, 0x005A1, 0x01CF4,
-    0x005E6, 0x00E28, 0x00575, 0x00D64, 0x00334, 0x0330B, 0x015DB, 0x00B40,
-    0x00BCF, 0x00DC5, 0x00E2A, 0x00675, 0x00571, 0x00553
-  },
-  {
-    0x00004, 0x00002, 0x00010, 0x00003, 0x00017, 0x00045, 0x0003E, 0x0007E,
-    0x00003, 0x00002, 0x00028, 0x0001E, 0x00015, 0x00047, 0x00002, 0x0014D,
-    0x00060, 0x0000B, 0x00026, 0x00024, 0x00014, 0x00032, 0x0006F, 0x000C3,
-    0x00531, 0x006E5, 0x00015, 0x0003F, 0x0002D, 0x00001, 0x0013E, 0x000DD,
-    0x000F6, 0x00305, 0x00331, 0x0000E, 0x00003, 0x00034, 0x00033, 0x0001A,
-    0x0014A, 0x000C5, 0x000F4, 0x006E4, 0x00001, 0x0003C, 0x0007D, 0x0008D,
-    0x0009D, 0x00031, 0x0006E, 0x00296, 0x000CD, 0x00025, 0x00149, 0x00032,
-    0x00089, 0x00036, 0x00088, 0x0006F, 0x00003, 0x0031D, 0x0000E, 0x001AA,
-    0x0027E, 0x00061, 0x0014E, 0x0014F, 0x00067, 0x000FF, 0x00183, 0x00036,
-    0x00357, 0x000F5, 0x000C6, 0x000C2, 0x00299, 0x00119, 0x00231, 0x00350,
-    0x0002C, 0x0018F, 0x00530, 0x00297, 0x00004, 0x001B8, 0x000C0, 0x0027A,
-    0x00311, 0x0009C, 0x00621, 0x00199, 0x0031C, 0x000F7, 0x003E3, 0x00356,
-    0x00189, 0x00005, 0x0006B, 0x008C2, 0x00330, 0x004FF, 0x004F0, 0x00351,
-    0x004F2, 0x001F2, 0x00373, 0x00000, 0x00C41, 0x008C3, 0x009EC, 0x003E2,
-    0x00304, 0x004F7, 0x004F1, 0x001F0, 0x00148, 0x00C40, 0x009ED, 0x008C0,
-    0x008C1, 0x004F3, 0x004FE, 0x000FE, 0x001F3, 0x001A9
-  },
-  {
-    0x00000, 0x00004, 0x0002F, 0x00052, 0x00010, 0x000AD, 0x0050B, 0x00190,
-    0x00003, 0x00016, 0x00007, 0x0000D, 0x000BB, 0x00173, 0x000C9, 0x0050F,
-    0x0172C, 0x00003, 0x00011, 0x00005, 0x00043, 0x00023, 0x0004B, 0x0032E,
-    0x02E5B, 0x00482, 0x00009, 0x0002A, 0x00014, 0x0002A, 0x00108, 0x005CA,
-    0x0065A, 0x02136, 0x02132, 0x0000B, 0x00013, 0x00041, 0x000B8, 0x00174,
-    0x00100, 0x014DA, 0x0404E, 0x01437, 0x0002B, 0x00085, 0x000A7, 0x000A0,
-    0x0014C, 0x0029A, 0x0032C, 0x02133, 0x0142A, 0x00051, 0x00284, 0x000AC,
-    0x00102, 0x00045, 0x00044, 0x0081B, 0x0065E, 0x00CB7, 0x00018, 0x0050C,
-    0x00212, 0x002E4, 0x00203, 0x00094, 0x00122, 0x0081A, 0x00655, 0x00033,
-    0x002BA, 0x00246, 0x00242, 0x00A6E, 0x0040C, 0x00808, 0x02134, 0x0404F,
-    0x00175, 0x00405, 0x00247, 0x0012A, 0x00A14, 0x002BB, 0x00191, 0x0084F,
-    0x01438, 0x000AF, 0x00B97, 0x00483, 0x0143B, 0x0032B, 0x00243, 0x0142B,
-    0x00958, 0x029BF, 0x00049, 0x00A6C, 0x014DB, 0x004AD, 0x014DE, 0x0084E,
-    0x01434, 0x00257, 0x02E5A, 0x00207, 0x01435, 0x01439, 0x00CB6, 0x0143A,
-    0x00194, 0x00654, 0x02135, 0x0537C, 0x0015C, 0x00240, 0x01012, 0x0537D,
-    0x00959, 0x01098, 0x01436, 0x0065F, 0x02026, 0x02137
-  },
-  {
-    0x00005, 0x00019, 0x00016, 0x00011, 0x0003E, 0x0005E, 0x000EF, 0x000E2,
-    0x00000, 0x00039, 0x0002B, 0x00026, 0x00028, 0x00012, 0x000C2, 0x000ED,
-    0x0011D, 0x0000D, 0x00031, 0x0002A, 0x00025, 0x00020, 0x0005C, 0x001ED,
-    0x0024D, 0x00770, 0x00006, 0x0007A, 0x00060, 0x0004F, 0x00048, 0x00039,
-    0x00186, 0x00213, 0x00EC6, 0x0000F, 0x00026, 0x0005F, 0x00075, 0x00070,
-    0x00027, 0x001DB, 0x003C6, 0x0078F, 0x0003F, 0x000A6, 0x000F0, 0x0003A,
-    0x00052, 0x0004E, 0x000E3, 0x001D9, 0x0030F, 0x00010, 0x001DD, 0x000A7,
-    0x000F7, 0x00022, 0x00092, 0x003C4, 0x002EF, 0x00762, 0x00079, 0x0008F,
-    0x001DA, 0x00087, 0x000E8, 0x000BA, 0x00176, 0x000EE, 0x003B0, 0x00085,
-    0x00119, 0x0030E, 0x00108, 0x001D2, 0x0010C, 0x00773, 0x00424, 0x00434,
-    0x00071, 0x005DD, 0x001C1, 0x003A7, 0x00127, 0x0008D, 0x0021B, 0x007B2,
-    0x001DF, 0x003D8, 0x00764, 0x00EE4, 0x003B3, 0x0074D, 0x001D8, 0x005DC,
-    0x0084A, 0x00499, 0x003C5, 0x01D8E, 0x00765, 0x00435, 0x00771, 0x001C2,
-    0x00118, 0x003BC, 0x00381, 0x00387, 0x07B33, 0x01097, 0x01096, 0x01ECD,
-    0x00E99, 0x00F1C, 0x00F1D, 0x00EE5, 0x0011C, 0x07B32, 0x03D98, 0x01D8F,
-    0x00E98, 0x00F67, 0x003BD, 0x00380, 0x00498, 0x00386
-  },
-  {
-    0x0000D, 0x00010, 0x0002E, 0x00039, 0x0000D, 0x00074, 0x000ED, 0x000B6,
-    0x00001, 0x00002, 0x00000, 0x00030, 0x00029, 0x00070, 0x000F3, 0x0008C,
-    0x00166, 0x00009, 0x00033, 0x00078, 0x00006, 0x000C4, 0x0000B, 0x00163,
-    0x000CC, 0x005BE, 0x0001F, 0x0002F, 0x00064, 0x00018, 0x000C6, 0x0000A,
-    0x00162, 0x002C0, 0x00EF3, 0x00007, 0x0000F, 0x000E3, 0x000CA, 0x000B2,
-    0x0018F, 0x003AE, 0x0075F, 0x00C51, 0x00015, 0x00047, 0x000EE, 0x000E2,
-    0x000EA, 0x00009, 0x0016A, 0x002C3, 0x0059D, 0x0003D, 0x00008, 0x001D9,
-    0x00032, 0x0000E, 0x0016E, 0x0032C, 0x0065B, 0x0196B, 0x00002, 0x0000F,
-    0x001D8, 0x0008D, 0x000B4, 0x001E4, 0x00067, 0x00317, 0x00794, 0x00022,
-    0x003BE, 0x00315, 0x00034, 0x00037, 0x002DE, 0x0006C, 0x00EFE, 0x0066C,
-    0x00028, 0x003CB, 0x003AC, 0x00035, 0x0016B, 0x003BD, 0x002C1, 0x0062C,
-    0x01DFE, 0x0000E, 0x0059E, 0x005BF, 0x000DA, 0x00629, 0x00584, 0x00EB7,
-    0x00B0A, 0x0066D, 0x0000C, 0x0077E, 0x0059C, 0x00778, 0x0075E, 0x0075A,
-    0x0062D, 0x00337, 0x00334, 0x00197, 0x01E57, 0x01DE4, 0x0196A, 0x01E56,
-    0x00C50, 0x00B3F, 0x01E54, 0x00B0B, 0x0018E, 0x001B6, 0x01E55, 0x00CB4,
-    0x00B3E, 0x00EB6, 0x01DE5, 0x01DFF, 0x00335, 0x001B7
-  },
-  {
-    0x00001, 0x0000B, 0x00019, 0x0006F, 0x0002A, 0x00075, 0x007EB, 0x00163,
-    0x00001, 0x0000E, 0x0001A, 0x0003E, 0x0001C, 0x0002D, 0x00164, 0x007EC,
-    0x00165, 0x00004, 0x00006, 0x00036, 0x0007F, 0x000AE, 0x00158, 0x0015C,
-    0x0056D, 0xFD510, 0x00000, 0x00004, 0x0007B, 0x000F3, 0x0003B, 0x007ED,
-    0x002B3, 0x002CC, 0x0056E, 0x00018, 0x0003E, 0x00017, 0x0001E, 0x000AF,
-    0x003F7, 0x0056F, 0x002CD, 0xFD511, 0x00014, 0x000AD, 0x000AA, 0x00014,
-    0x000A8, 0x00153, 0x000E8, 0x001FE, 0x00DCF, 0x00078, 0x001B8, 0x00152,
-    0x000FE, 0x002B1, 0x0015D, 0x00160, 0xFD512, 0xFD513, 0x0007A, 0x002B0,
-    0x001E5, 0x000E9, 0x000FC, 0x006E6, 0x00DC8, 0x00584, 0xFD514, 0x000AB,
-    0x00DDE, 0x00159, 0x003F4, 0x00DC9, 0x00DCA, 0x001FA, 0xFD515, 0xFD516,
-    0x000FC, 0x001FF, 0x001E4, 0x000AF, 0x0015A, 0x00167, 0x00DCB, 0x00585,
-    0xFD517, 0x003F7, 0x03F55, 0xFD518, 0x00DDC, 0x00586, 0x03F56, 0xFD519,
-    0x03F57, 0xFD51A, 0x001BA, 0x00587, 0x00588, 0x00DDF, 0x002B2, 0xFD51B,
-    0x00DCE, 0x003F6, 0xFD51C, 0x00FD4, 0xFD51D, 0xFD51E, 0xFD51F, 0x7EA80,
-    0x7EA81, 0x0056C, 0x7EA82, 0x7EA83, 0x00376, 0x00589, 0x0058A, 0x7EA84,
-    0x7EA85, 0x00DDD, 0x7EA86, 0x7EA87, 0x0058B, 0x07EA9
-  },
-  {
-    0x00003, 0x0000E, 0x0000F, 0x0007E, 0x00062, 0x000C6, 0x00CD9, 0x0063E,
-    0x00002, 0x00002, 0x00000, 0x00018, 0x0000C, 0x00069, 0x00039, 0x00707,
-    0x00C7E, 0x00002, 0x0000D, 0x0001B, 0x0000F, 0x0019A, 0x00647, 0x01A37,
-    0x346C4, 0x0346D, 0x00001, 0x0001E, 0x0007F, 0x0000A, 0x000E1, 0x00661,
-    0x00CE4, 0x346C5, 0x346C6, 0x0001D, 0x00030, 0x0000D, 0x000CB, 0x00199,
-    0x00320, 0x0008E, 0x0652E, 0x346C7, 0x0003E, 0x00039, 0x00035, 0x00033,
-    0x0019F, 0x001C0, 0x00CDA, 0x346C8, 0x346C9, 0x0000B, 0x000D0, 0x0019E,
-    0x00022, 0x00038, 0x0018E, 0x0031E, 0x03294, 0x0023C, 0x00032, 0x00012,
-    0x00013, 0x00071, 0x0019D, 0x00020, 0x00C87, 0x00CC0, 0x346CA, 0x00338,
-    0x00653, 0x001A2, 0x0032A, 0x00322, 0x00CE7, 0x00084, 0x0011F, 0x346CB,
-    0x00325, 0x00649, 0x0032B, 0x00077, 0x00648, 0x00642, 0x00C86, 0x00C8C,
-    0x346CC, 0x0003A, 0x019B7, 0x00043, 0x00327, 0x0008C, 0x0008D, 0x00C8D,
-    0x346CD, 0x346CE, 0x00337, 0x00CE5, 0x00085, 0x00326, 0x00347, 0x00CA4,
-    0x00C7F, 0x00D1A, 0x346CF, 0x00328, 0x1A360, 0x1A361, 0x00CD8, 0x0068C,
-    0x03295, 0x03296, 0x0652F, 0x066D8, 0x00331, 0x00706, 0x0023D, 0x00076,
-    0x00CC1, 0x00382, 0x00CE6, 0x066D9, 0x066DA, 0x066DB
-  }
-};
-
-const uint8_t ff_vc1_2ref_mvdata_bits[8][126] = {
-  {
-     4,  5,  5,  5,  6,  7,  8, 10,  2,  5,  5,  6,  6,  7,  8,  9,
-    10,  4,  5,  6,  6,  7,  8,  9, 10, 11,  4,  6,  6,  7,  7,  9,
-     9, 10, 12,  5,  8,  8,  8,  8,  9,  9, 10, 12,  5,  7,  8,  7,
-     7,  8,  9,  9, 11,  7,  9, 10,  9, 10, 10, 10, 10, 12,  6,  9,
-     9,  9,  9,  9, 10, 10, 11,  7, 10, 10, 11, 11, 11, 12, 12, 14,
-     8, 11, 10, 11, 11, 11, 11, 12, 12,  8, 12, 11, 11, 12, 12, 12,
-    12, 13,  8, 12, 11, 11, 12, 12, 12, 13, 12,  9, 14, 13, 11, 13,
-    12, 13, 12, 13,  9, 13, 13, 12, 12, 13, 13, 13, 13, 13
-  },
-  {
-     3,  4,  5,  6,  8, 10, 11, 11,  2,  5,  5,  6,  7,  8, 10, 11,
-    11,  4,  5,  5,  6,  7,  9, 12, 13, 13,  4,  6,  7,  7,  9, 10,
-    11, 13, 14,  5,  7,  7,  7,  8,  9, 11, 13, 13,  6,  8,  8,  8,
-     8,  9, 10, 12, 13,  7,  9,  8,  8,  8,  9, 11, 12, 13,  7,  9,
-     9,  9,  9,  9, 10, 11, 13,  8, 10, 10, 10, 10, 10, 11, 12, 13,
-     9, 11, 11, 10, 10, 10, 11, 11, 12, 10, 12, 12, 12, 11, 11, 11,
-    12, 12, 10, 13, 12, 12, 11, 11, 11, 12, 12, 10, 13, 13, 12, 13,
-    11, 12, 11, 12, 10, 14, 13, 13, 12, 12, 12, 11, 11, 11
-  },
-  {
-     4,  4,  5,  5,  6,  7,  8,  9,  2,  5,  6,  6,  6,  7,  7,  9,
-     9,  4,  6,  6,  6,  7,  8,  9, 11, 12,  5,  7,  7,  7,  9,  9,
-    10, 11, 12,  5,  7,  7,  7,  7,  9,  9, 10, 12,  5,  8,  8,  8,
-     8,  8,  9, 10, 10,  6,  9,  8,  8,  8,  8,  9,  9, 11,  6, 10,
-    10,  9,  9,  9,  9, 10, 10,  7, 11, 10,  9,  9, 10,  9, 10, 11,
-     7, 10, 11, 10, 10, 10,  9, 10, 11,  8, 12, 11, 11, 10, 11, 11,
-    10, 10,  8, 12, 12, 11, 11, 11, 11, 10, 11,  8, 13, 12, 12, 11,
-    11, 11, 11, 10,  9, 13, 12, 12, 12, 11, 11, 10, 10, 10
-  },
-  {
-     3,  4,  6,  7,  7,  9, 11, 11,  2,  5,  5,  6,  8,  9, 10, 11,
-    13,  3,  5,  5,  7,  8,  9, 12, 14, 13,  4,  6,  6,  7,  9, 11,
-    13, 14, 14,  5,  7,  7,  8,  9,  9, 13, 15, 13,  6,  8,  8,  8,
-     9, 10, 12, 14, 13,  7, 10,  9,  9,  9,  9, 12, 13, 14,  7, 11,
-    10, 10, 10, 10, 11, 12, 13,  8, 11, 12, 12, 12, 11, 12, 14, 15,
-     9, 11, 12, 11, 12, 11, 11, 12, 13,  9, 12, 13, 13, 12, 12, 13,
-    14, 14,  9, 12, 13, 13, 13, 12, 13, 12, 14, 10, 13, 13, 14, 13,
-    11, 13, 14, 15, 10, 12, 13, 15, 14, 13, 13, 13, 14, 14
-  },
-  {
-     4,  5,  5,  5,  6,  7,  8,  8,  2,  6,  6,  6,  6,  6,  8,  9,
-    10,  4,  6,  6,  6,  6,  7,  9, 10, 11,  4,  7,  7,  7,  7,  7,
-     9, 10, 12,  5,  7,  7,  7,  7,  7,  9, 10, 11,  6,  8,  8,  7,
-     7,  7,  8,  9, 10,  6,  9,  8,  8,  7,  8, 10, 10, 11,  7,  9,
-     9,  8,  8,  8,  9,  9, 10,  8, 10, 10,  9,  9,  9, 11, 11, 11,
-     8, 11, 10, 10,  9,  9, 10, 11, 10, 10, 12, 12, 11, 11, 10, 11,
-    12, 11, 10, 13, 12, 11, 11, 10, 10, 11, 11, 11, 15, 13, 13, 13,
-    12, 12, 12, 12, 10, 15, 14, 13, 12, 12, 11, 11, 11, 11
-  },
-  {
-     4,  5,  6,  6,  6,  7,  8,  8,  2,  4,  5,  6,  6,  7,  8,  8,
-     9,  4,  6,  7,  7,  8,  8,  9, 10, 11,  5,  6,  7,  7,  8,  8,
-     9, 10, 12,  5,  7,  8,  8,  8,  9, 10, 11, 12,  5,  7,  8,  8,
-     8,  8,  9, 10, 11,  6,  8,  9,  8,  8,  9, 10, 11, 13,  5,  8,
-     9,  8,  8,  9,  9, 10, 11,  6, 10, 10,  9,  9, 10, 10, 12, 13,
-     6, 10, 10,  9,  9, 10, 10, 11, 13,  7, 11, 11, 11, 11, 11, 12,
-    12, 13,  7, 11, 11, 11, 11, 11, 11, 12, 12,  9, 13, 13, 13, 13,
-    12, 12, 13, 12,  9, 12, 13, 12, 12, 12, 13, 13, 12, 12
-  },
-  {
-     3,  5,  6,  8,  9, 10, 12, 12,  1,  5,  6,  7,  8,  9, 12, 12,
-    12,  4,  6,  7,  8,  9, 12, 12, 14, 21,  4,  6,  8,  9,  9, 12,
-    13, 13, 14,  6,  9,  8,  8,  9, 13, 14, 13, 21,  6,  9,  9,  8,
-     9, 10, 11, 12, 13,  8, 10, 10, 11, 11, 12, 12, 21, 21,  8, 11,
-    10, 11, 11, 12, 13, 14, 21,  9, 13, 10, 11, 13, 13, 12, 21, 21,
-     9, 12, 10, 11, 12, 12, 13, 14, 21, 11, 15, 21, 13, 14, 15, 21,
-    15, 21, 10, 14, 14, 13, 13, 21, 13, 13, 21, 13, 21, 21, 21, 20,
-    20, 14, 20, 20, 11, 14, 14, 20, 20, 13, 20, 20, 14, 16
-  },
-  {
-     2,  5,  6,  8,  9, 10, 13, 13,  2,  4,  5,  6,  8,  9, 10, 13,
-    14,  3,  5,  7,  8, 10, 12, 15, 20, 16,  4,  6,  8,  8, 10, 12,
-    13, 20, 20,  7,  8,  8,  9, 10, 11, 12, 16, 20,  7,  8,  8,  8,
-    10, 11, 13, 20, 20,  8, 10, 10, 10, 10, 11, 12, 15, 14,  8,  9,
-     9,  9, 10, 10, 13, 13, 20, 11, 12, 11, 11, 11, 13, 12, 13, 20,
-    11, 12, 11, 11, 12, 12, 13, 13, 20, 10, 14, 11, 11, 12, 12, 13,
-    20, 20, 11, 13, 12, 11, 12, 13, 14, 14, 20, 11, 19, 19, 13, 13,
-    15, 15, 16, 16, 11, 13, 14, 11, 13, 12, 13, 16, 16, 16
-  }
-};
-
-const uint8_t ff_wmv3_dc_scale_table[32] = {
-     0,  2,  4,  8,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 13, 13,
-    14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21
-};
-
-/* P-Picture CBPCY VLC tables */
-// Looks like original tables are not conforming to standard at all. Are they used for old WMV?
-const uint16_t ff_vc1_cbpcy_p_codes[4][64] = {
-  {
-      0,   6,  15,  13,  13,  11,   3,  13,   5,   8,  49,  10,  12, 114, 102, 119,
-      1,  54,  96,   8,  10, 111,   5,  15,  12,  10,   2,  12,  13, 115,  53,  63,
-      1,   7,   1,   7,  14,  12,   4,  14,   1,   9,  97,  11,   7,  58,  52,  62,
-      4, 103,   1,   9,  11,  56, 101, 118,   4, 110, 100,  30,   2,   5,   4,   3
-  },
-  {
-      0,   9,   1,  18,   5,  14, 237,  26,   3, 121,   3,  22,  13,  16,   6,  30,
-      2,  10,   1,  20,  12, 241,   5,  28,  16,  12,   3,  24,  28, 124, 239, 247,
-      1, 240,   1,  19,  18,  15,   4,  27,   1, 122,   2,  23,   1,  17,   7,  31,
-      1,  11,   2,  21,  19, 246, 238,  29,  17,  13, 236,  25,  58,  63,   8, 125
-  },
-  {
-      0, 201,  25, 231,   5, 221,   1,   3,   2, 414,   2, 241,  16, 225, 195, 492,
-      2, 412,   1, 240,   7, 224,  98, 245,   1, 220,  96,   5,   9, 230, 101, 247,
-      1, 102,   1, 415,  24,   3,   2, 244,   3,  54,   3, 484,  17, 114, 200, 493,
-      3, 413,   1,   4,  13, 113,  99, 485,   4, 111, 194, 243,   5,  29,  26,  31
-  },
-  {
-      0,  28,  12,  44,   3,  36,  20,  52,   2,  32,  16,  48,   8,  40,  24,  28,
-      1,  30,  14,  46,   6,  38,  22,  54,   3,  34,  18,  50,  10,  42,  26,  30,
-      1,  29,  13,  45,   5,  37,  21,  53,   2,  33,  17,  49,   9,  41,  25,  29,
-      1,  31,  15,  47,   7,  39,  23,  55,   4,  35,  19,  51,  11,  43,  27,  31
-   }
-};
-
-const uint8_t ff_vc1_cbpcy_p_bits[4][64] = {
-  {
-    13,  13,   7,  13,   7,  13,  13,  12,   6,  13,   7,  12,   6,   8,   8,   8,
-     5,   7,   8,  12,   6,   8,  13,  12,   7,  13,  13,  12,   6,   8,   7,   7,
-     6,  13,   8,  12,   7,  13,  13,  12,   7,  13,   8,  12,   5,   7,   7,   7,
-     6,   8,  13,  12,   6,   7,   8,   8,   5,   8,   8,   6,   3,   3,   3,   2
-  },
-  {
-    14,  13,   8,  13,   3,  13,   8,  13,   3,   7,   8,  13,   4,  13,  13,  13,
-     3,  13,  13,  13,   4,   8,  13,  13,   5,  13,  13,  13,   5,   7,   8,   8,
-     3,   8,  14,  13,   5,  13,  13,  13,   4,   7,  13,  13,   6,  13,  13,  13,
-     5,  13,   8,  13,   5,   8,   8,  13,   5,  13,   8,  13,   6,   6,  13,   7
-  },
-  {
-    13,   8,   6,   8,   4,   8,  13,  12,   4,   9,   8,   8,   5,   8,   8,   9,
-     5,   9,  10,   8,   4,   8,   7,   8,   6,   8,   7,  13,   4,   8,   7,   8,
-     5,   7,   8,   9,   6,  13,  13,   8,   4,   6,   8,   9,   5,   7,   8,   9,
-     5,   9,   9,  13,   5,   7,   7,   9,   4,   7,   8,   8,   3,   5,   5,   5
-  },
-  {
-     9,   9,   9,   9,   2,   9,   9,   9,   2,   9,   9,   9,   9,   9,   9,   8,
-     3,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   8,
-     2,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   8,
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   8
-  }
-};
-
-/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */
-const uint16_t ff_vc1_icbpcy_p_codes[8][63] = {
-  {
-    0x2F1A, 0x2F1B, 0x178C, 0x0090, 0x02A8, 0x02A9, 0x0BC7, 0x0091,
-    0x02AA, 0x02AB, 0x05E0, 0x004A, 0x0096, 0x0097, 0x00BD, 0x0092,
-    0x02AC, 0x02AD, 0x05E1, 0x0098, 0x0132, 0x0133, 0x0179, 0x0134,
-    0x026A, 0x026B, 0x02FC, 0x004E, 0x0040, 0x0041, 0x002B, 0x0093,
-    0x02AE, 0x02AF, 0x05E2, 0x0136, 0x026E, 0x026F, 0x02FD, 0x009E,
-    0x013E, 0x013F, 0x017F, 0x0050, 0x0042, 0x0043, 0x002C, 0x0051,
-    0x00A4, 0x00A5, 0x00BE, 0x0053, 0x0044, 0x0045, 0x002D, 0x0054,
-    0x0046, 0x0047, 0x002E, 0x0003, 0x0000, 0x0001, 0x0001
-  },
-  {
-    0x0041, 0x0042, 0x0100, 0x0043, 0x0088, 0x0089, 0x0101, 0x0045,
-    0x008C, 0x008D, 0x0102, 0x0010, 0x0022, 0x0023, 0x0024, 0x0047,
-    0x0010, 0x0011, 0x0103, 0x0025, 0x0058, 0x0059, 0x005A, 0x005B,
-    0x005A, 0x005B, 0x005C, 0x000C, 0x0030, 0x0031, 0x0019, 0x0009,
-    0x0014, 0x0015, 0x002C, 0x005C, 0x005D, 0x005E, 0x005F, 0x0026,
-    0x005D, 0x005E, 0x005F, 0x000D, 0x0034, 0x0035, 0x001B, 0x0014,
-    0x0027, 0x002A, 0x002B, 0x000E, 0x0038, 0x0039, 0x001D, 0x000F,
-    0x003C, 0x003D, 0x001F, 0x0005, 0x0009, 0x0000, 0x0003
-  },
-  {
-    0x0032, 0x0033, 0x001A, 0x0026, 0x00E4, 0x00E5, 0x01E6, 0x0027,
-    0x00E6, 0x00E7, 0x01E7, 0x000E, 0x0063, 0x006C, 0x0077, 0x0028,
-    0x00E8, 0x00E9, 0x01E8, 0x007B, 0x00DA, 0x00DB, 0x00EC, 0x00F5,
-    0x01B8, 0x01B9, 0x01DA, 0x0021, 0x004B, 0x0054, 0x002B, 0x0029,
-    0x00EA, 0x00EB, 0x01E9, 0x004A, 0x01BA, 0x01BB, 0x01DB, 0x0020,
-    0x00DE, 0x00DF, 0x00F2, 0x0022, 0x0055, 0x0058, 0x002D, 0x000F,
-    0x0070, 0x0071, 0x0078, 0x0023, 0x0059, 0x005C, 0x002F, 0x0024,
-    0x005D, 0x0062, 0x0030, 0x0002, 0x001F, 0x0006, 0x0000
-  },
-  {
-    0x0028, 0x0029, 0x009D, 0x0000, 0x01EA, 0x01EB, 0x01EC, 0x0001,
-    0x01ED, 0x01EE, 0x01EF, 0x0005, 0x00F0, 0x00F1, 0x003B, 0x0002,
-    0x01F0, 0x01F1, 0x01F2, 0x003F, 0x015C, 0x015D, 0x0099, 0x0010,
-    0x03D0, 0x03D1, 0x0130, 0x000F, 0x009E, 0x009F, 0x00FB, 0x0003,
-    0x01F3, 0x01F4, 0x01F5, 0x0011, 0x03D2, 0x03D3, 0x0131, 0x0009,
-    0x015E, 0x015F, 0x009C, 0x0010, 0x00A8, 0x00A9, 0x0038, 0x0006,
-    0x00F2, 0x00F3, 0x004D, 0x0011, 0x00AA, 0x00AB, 0x0039, 0x0012,
-    0x00AC, 0x00AD, 0x003A, 0x0006, 0x0016, 0x0017, 0x000E
-  },
-  {
-    0x003C, 0x003D, 0x001F, 0x000A, 0x0061, 0x0062, 0x0002, 0x000B,
-    0x0063, 0x0064, 0x0003, 0x0007, 0x0003, 0x0004, 0x000B, 0x000C,
-    0x0065, 0x0066, 0x0004, 0x0012, 0x000A, 0x000B, 0x0014, 0x001B,
-    0x0018, 0x0019, 0x0034, 0x002C, 0x0067, 0x0068, 0x0035, 0x000D,
-    0x0069, 0x006C, 0x0005, 0x0060, 0x001A, 0x001B, 0x0035, 0x0013,
-    0x000E, 0x000F, 0x0015, 0x002D, 0x006D, 0x006E, 0x0038, 0x0008,
-    0x0008, 0x0009, 0x000C, 0x002E, 0x006F, 0x0072, 0x003A, 0x002F,
-    0x0073, 0x0000, 0x003B, 0x0007, 0x0014, 0x0015, 0x0004
-  },
-  {
-    0x0038, 0x0039, 0x009D, 0x000A, 0x0091, 0x0092, 0x0093, 0x000B,
-    0x0094, 0x0095, 0x0096, 0x0003, 0x00EE, 0x00EF, 0x0036, 0x000C,
-    0x0097, 0x0098, 0x0099, 0x0008, 0x01E4, 0x01E5, 0x006A, 0x0018,
-    0x03CC, 0x03CD, 0x00D6, 0x000E, 0x009E, 0x009F, 0x00F5, 0x000D,
-    0x009A, 0x009B, 0x009C, 0x0019, 0x03CE, 0x03CF, 0x00D7, 0x0009,
-    0x01E8, 0x01E9, 0x0090, 0x000F, 0x00E8, 0x00E9, 0x00F6, 0x0005,
-    0x00F0, 0x00F1, 0x0037, 0x0010, 0x00EA, 0x00EB, 0x00F7, 0x0011,
-    0x00EC, 0x00ED, 0x0034, 0x0000, 0x003E, 0x003F, 0x0002
-  },
-  {
-    0x003C, 0x003D, 0x01CF, 0x0000, 0x00BF, 0x00E0, 0x01FC, 0x0001,
-    0x00E1, 0x00E2, 0x01FD, 0x0009, 0x01F1, 0x01F2, 0x01F3, 0x0002,
-    0x00E3, 0x00E4, 0x01FE, 0x0011, 0x03EE, 0x03EF, 0x03F0, 0x0021,
-    0x07E2, 0x07E3, 0x07E4, 0x0018, 0x03F7, 0x03FE, 0x03FF, 0x0003,
-    0x00E5, 0x00E6, 0x0080, 0x002E, 0x07E5, 0x07E6, 0x07E7, 0x0016,
-    0x03F4, 0x03F5, 0x03F6, 0x0019, 0x0102, 0x0103, 0x0104, 0x000A,
-    0x01F4, 0x01F5, 0x01F6, 0x001A, 0x0105, 0x0106, 0x0107, 0x001B,
-    0x0178, 0x0179, 0x01CE, 0x001D, 0x00BD, 0x00BE, 0x01F0
-  },
-  {
-    0x0003, 0x0004, 0x01B6, 0x0004, 0x002E, 0x002F, 0x000E, 0x0005,
-    0x0030, 0x0031, 0x000F, 0x0003, 0x000A, 0x000B, 0x0014, 0x0006,
-    0x0032, 0x0033, 0x0010, 0x0005, 0x0030, 0x0031, 0x0032, 0x0009,
-    0x0066, 0x0067, 0x0068, 0x001D, 0x01B7, 0x01B8, 0x01B9, 0x0007,
-    0x0034, 0x0035, 0x0011, 0x0016, 0x0069, 0x006A, 0x006B, 0x000A,
-    0x0036, 0x0037, 0x00D8, 0x001E, 0x01BA, 0x01BB, 0x01BC, 0x0004,
-    0x0015, 0x0016, 0x0017, 0x001F, 0x01BD, 0x01BE, 0x01BF, 0x0000,
-    0x0010, 0x0011, 0x0012, 0x001C, 0x00D9, 0x00DA, 0x0013
-  }
-};
-
-const uint8_t ff_vc1_icbpcy_p_bits[8][63] = {
-  {
-    15, 15, 14,  9, 11, 11, 13,  9, 11, 11, 12,  8,  9,  9,  9,  9,
-    11, 11, 12,  9, 10, 10, 10, 10, 11, 11, 11,  8,  8,  8,  7,  9,
-    11, 11, 12, 10, 11, 11, 11,  9, 10, 10, 10,  8,  8,  8,  7,  8,
-     9,  9,  9,  8,  8,  8,  7,  8,  8,  8,  7,  3,  3,  3,  1
-  },
-  {
-     7,  7,  9,  7,  8,  8,  9,  7,  8,  8,  9,  6,  7,  7,  7,  7,
-     7,  7,  9,  7,  8,  8,  8,  8,  9,  9,  9,  6,  7,  7,  6,  6,
-     7,  7,  8,  8,  9,  9,  9,  7,  8,  8,  8,  6,  7,  7,  6,  6,
-     7,  7,  7,  6,  7,  7,  6,  6,  7,  7,  6,  3,  4,  3,  2
-  },
-  {
-     6,  6,  5,  6,  8,  8,  9,  6,  8,  8,  9,  5,  7,  7,  7,  6,
-     8,  8,  9,  7,  8,  8,  8,  8,  9,  9,  9,  6,  7,  7,  6,  6,
-     8,  8,  9,  7,  9,  9,  9,  6,  8,  8,  8,  6,  7,  7,  6,  5,
-     7,  7,  7,  6,  7,  7,  6,  6,  7,  7,  6,  3,  5,  4,  2
-  },
-  {
-     6,  6,  8,  4,  9,  9,  9,  4,  9,  9,  9,  4,  8,  8,  7,  4,
-     9,  9,  9,  6,  9,  9,  8,  6, 10, 10,  9,  5,  8,  8,  8,  4,
-     9,  9,  9,  6, 10, 10,  9,  5,  9,  9,  8,  5,  8,  8,  7,  4,
-     8,  8,  7,  5,  8,  8,  7,  5,  8,  8,  7,  3,  5,  5,  4
-  },
-  {
-     6,  6,  5,  5,  7,  7,  7,  5,  7,  7,  7,  5,  6,  6,  6,  5,
-     7,  7,  7,  6,  7,  7,  7,  7,  8,  8,  8,  6,  7,  7,  6,  5,
-     7,  7,  7,  7,  8,  8,  8,  6,  7,  7,  7,  6,  7,  7,  6,  5,
-     6,  6,  6,  6,  7,  7,  6,  6,  7,  6,  6,  4,  5,  5,  3
-  },
-  {
-     6,  6,  8,  4,  8,  8,  8,  4,  8,  8,  8,  4,  8,  8,  7,  4,
-     8,  8,  8,  5,  9,  9,  8,  6, 10, 10,  9,  5,  8,  8,  8,  4,
-     8,  8,  8,  6, 10, 10,  9,  5,  9,  9,  8,  5,  8,  8,  8,  4,
-     8,  8,  7,  5,  8,  8,  8,  5,  8,  8,  7,  3,  6,  6,  4
-  },
-  {
-     6,  6,  9,  3,  8,  8,  9,  3,  8,  8,  9,  4,  9,  9,  9,  3,
-     8,  8,  9,  5, 10, 10, 10,  6, 11, 11, 11,  5, 10, 10, 10,  3,
-     8,  8,  8,  6, 11, 11, 11,  5, 10, 10, 10,  5,  9,  9,  9,  4,
-     9,  9,  9,  5,  9,  9,  9,  5,  9,  9,  9,  5,  8,  8,  9
-  },
-  {
-     6,  6, 10,  3,  7,  7,  7,  3,  7,  7,  7,  4,  8,  8,  8,  3,
-     7,  7,  7,  5,  9,  9,  9,  6, 10, 10, 10,  6, 10, 10, 10,  3,
-     7,  7,  7,  6, 10, 10, 10,  5,  9,  9,  9,  6, 10, 10, 10,  4,
-     8,  8,  8,  6, 10, 10, 10,  5,  9,  9,  9,  6,  9,  9,  9
-  }
-};
-
-/* MacroBlock Transform Type: 7.1.3.11, p89
- * 8x8:B
- * 8x4:B:btm  8x4:B:top  8x4:B:both,
- * 4x8:B:right  4x8:B:left  4x8:B:both
- * 4x4:B  8x8:MB
- * 8x4:MB:btm  8x4:MB:top  8x4,MB,both
- * 4x8,MB,right  4x8,MB,left
- * 4x4,MB                               */
-const uint16_t ff_vc1_ttmb_codes[3][16] = {
-  {
-    0x0003,
-    0x002E, 0x005F, 0x0000,
-    0x0016, 0x0015, 0x0001,
-    0x0004, 0x0014,
-    0x02F1, 0x0179, 0x017B,
-    0x0BC0, 0x0BC1, 0x05E1,
-    0x017A
-  },
-  {
-    0x0006,
-    0x0006, 0x0003, 0x0007,
-    0x000F, 0x000E, 0x0000,
-    0x0002, 0x0002,
-    0x0014, 0x0011, 0x000B,
-    0x0009, 0x0021, 0x0015,
-    0x0020
-  },
-  {
-    0x0006,
-    0x0000, 0x000E, 0x0005,
-    0x0002, 0x0003, 0x0003,
-    0x000F, 0x0002,
-    0x0081, 0x0021, 0x0009,
-    0x0101, 0x0041, 0x0011,
-    0x0100
-  }
-};
-
-const uint8_t ff_vc1_ttmb_bits[3][16] = {
-  {
-     2,
-     6,  7,  2,
-     5,  5,  2,
-     3,  5,
-    10,  9,  9,
-    12, 12, 11,
-     9
-  },
-  {
-    3,
-    4, 4, 4,
-    4, 4, 3,
-    3, 2,
-    7, 7, 6,
-    6, 8, 7,
-    8
-  },
-  {
-     3,
-     3, 4, 5,
-     3, 3, 4,
-     4, 2,
-    10, 8, 6,
-    11, 9, 7,
-    11
-  }
-};
-
-/* TTBLK (Transform Type per Block) tables */
-const uint8_t ff_vc1_ttblk_codes[3][8] = {
-    {  0,  1,  3,  5, 16, 17, 18, 19 },
-    {  3,  0,  1,  2,  3,  5,  8,  9 },
-    {  1,  0,  1,  4,  6,  7, 10, 11 }
-};
-const uint8_t ff_vc1_ttblk_bits[3][8] = {
-    {  2,  2,  2,  3,  5,  5,  5,  5 },
-    {  2,  3,  3,  3,  3,  3,  4,  4 },
-    {  2,  3,  3,  3,  3,  3,  4,  4 }
-};
-
-/* SUBBLKPAT tables, p93-94, reordered */
-const uint8_t ff_vc1_subblkpat_codes[3][15] = {
-    { 14, 12,  7, 11,  9, 26,  2, 10, 27,  8,  0,  6,  1, 15,  1 },
-    { 14,  0,  8, 15, 10,  4, 23, 13,  5,  9, 25,  3, 24, 22,  1 },
-    {  5,  6,  2,  2,  8,  0, 28,  3,  1,  3, 29,  1, 19, 18, 15 }
-};
-const uint8_t ff_vc1_subblkpat_bits[3][15] = {
-    {  5,  5,  5,  5,  5,  6,  4,  5,  6,  5,  4,  5,  4,  5,  1},
-    {  4,  3,  4,  4,  4,  5,  5,  4,  5,  4,  5,  4,  5,  5,  2},
-    {  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4}
-};
-
-/* MV differential tables, p265 */
-const uint16_t ff_vc1_mv_diff_codes[4][73] = {
-  {
-       0,    2,    3,    8,  576,    3,    2,    6,
-       5,  577,  578,    7,    8,    9,   40,   19,
-      37,   82,   21,   22,   23,  579,  580,  166,
-      96,  167,   49,  194,  195,  581,  582,  583,
-     292,  293,  294,   13,    2,    7,   24,   50,
-     102,  295,   13,    7,    8,   18,   50,  103,
-      38,   20,   21,   22,   39,  204,  103,   23,
-      24,   25,  104,  410,  105,  106,  107,  108,
-     109,  220,  411,  442,  222,  443,  446,  447,
-       7 /* 73 elements */
-  },
-  {
-       0,    4,    5,    3,    4,    3,    4,    5,
-      20,    6,   21,   44,   45,   46, 3008,   95,
-     112,  113,   57, 3009, 3010,  116,  117, 3011,
-     118, 3012, 3013, 3014, 3015, 3016, 3017, 3018,
-    3019, 3020, 3021, 3022,    1,    4,   15,  160,
-     161,   41,    6,   11,   42,  162,   43,  119,
-      56,   57,   58,  163,  236,  237, 3023,  119,
-     120,  242,  122,  486, 1512,  487,  246,  494,
-    1513,  495, 1514, 1515, 1516, 1517, 1518, 1519,
-      31 /* 73 elements */
-  },
-  {
-       0,  512,  513,  514,  515,    2,    3,  258,
-     259,  260,  261,  262,  263,  264,  265,  266,
-     267,  268,  269,  270,  271,  272,  273,  274,
-     275,  276,  277,  278,  279,  280,  281,  282,
-     283,  284,  285,  286,    1,    5,  287,  288,
-     289,  290,    6,    7,  291,  292,  293,  294,
-     295,  296,  297,  298,  299,  300,  301,  302,
-     303,  304,  305,  306,  307,  308,  309,  310,
-     311,  312,  313,  314,  315,  316,  317,  318,
-     319 /* 73 elements */
-  },
-  {
-       0,    1,    1,    2,    3,    4,    1,    5,
-       4,    3,    5,    8,    6,    9,   10,   11,
-      12,    7,  104,   14,  105,    4,   10,   15,
-      11,    6,   14,    8,  106,  107,  108,   15,
-     109,    9,   55,   10,    1,    2,    1,    2,
-       3,   12,    6,    2,    6,    7,   28,    7,
-      15,    8,    5,   18,   29,  152,   77,   24,
-      25,   26,   39,  108,   13,  109,   55,   56,
-      57,  116,   11,  153,  234,  235,  118,  119,
-      15 /* 73 elements */
-  }
-};
-const uint8_t ff_vc1_mv_diff_bits[4][73] = {
-  {
-     6,  7,  7,  8, 14,  6,  5,  6,  7, 14, 14,  6,  6,  6,  8,  9,
-    10,  9,  7,  7,  7, 14, 14, 10,  9, 10,  8, 10, 10, 14, 14, 14,
-    13, 13, 13,  6,  3,  5,  6,  8,  9, 13,  5,  4,  4,  5,  7,  9,
-     6,  5,  5,  5,  6,  9,  8,  5,  5,  5,  7, 10,  7,  7,  7,  7,
-     7,  8, 10,  9,  8,  9,  9,  9,  3 /* 73 elements */
-  },
-  {
-     5,  7,  7,  6,  6,  5,  5,  6,  7,  5,  7,  8,  8,  8, 14,  9,
-     9,  9,  8, 14, 14,  9,  9, 14,  9, 14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14,  2,  3,  6,  8,  8,  6,  3,  4,  6,  8,  6,  9,
-     6,  6,  6,  8,  8,  8, 14,  7,  7,  8,  7,  9, 13,  9,  8,  9,
-    13,  9, 13, 13, 13, 13, 13, 13,  5 /* 73 elements */
-
-  },
-  {
-     3, 12, 12, 12, 12,  3,  4, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11,  1,  5, 11, 11, 11, 11,  4,  4, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11, 11 /* 73 elements */
-  },
-  {
-    15, 11, 15, 15, 15, 15, 12, 15, 12, 11, 12, 12, 15, 12, 12, 12,
-    12, 15, 15, 12, 15, 10, 11, 12, 11, 10, 11, 10, 15, 15, 15, 11,
-    15, 10, 14, 10,  4,  4,  5,  7,  8,  9,  5,  3,  4,  5,  6,  8,
-     5,  4,  3,  5,  6,  8,  7,  5,  5,  5,  6,  7,  9,  7,  6,  6,
-     6,  7, 10,  8,  8,  8,  7,  7,  4 /* 73 elements */
-  }
-};
-
-/* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */
-
-/* Table 232 */
-const int8_t ff_vc1_simple_progressive_4x4_zz [16] = {
-     0,     8,    16,     1,
-     9,    24,    17,     2,
-    10,    18,    25,     3,
-    11,    26,    19,    27
-};
-
-const int8_t ff_vc1_adv_progressive_8x4_zz [32] = { /* Table 233 */
-     0,     8,     1,    16,     2,     9,    10,     3,
-    24,    17,     4,    11,    18,    12,     5,    19,
-    25,    13,    20,    26,    27,     6,    21,    28,
-    14,    22,    29,     7,    30,    15,    23,    31
-};
-
-const int8_t ff_vc1_adv_progressive_4x8_zz [32] = { /* Table 234 */
-     0,     1,     8,     2,
-     9,    16,    17,    24,
-    10,    32,    25,    18,
-    40,     3,    33,    26,
-    48,    11,    56,    41,
-    34,    49,    57,    42,
-    19,    50,    27,    58,
-    35,    43,    51,    59
-};
-
-const int8_t ff_vc1_adv_interlaced_8x8_zz [64] = { /* Table 235 */
-     0,     8,     1,    16,    24,     9,     2,    32,
-    40,    48,    56,    17,    10,     3,    25,    18,
-    11,     4,    33,    41,    49,    57,    26,    34,
-    42,    50,    58,    19,    12,     5,    27,    20,
-    13,     6,    35,    28,    21,    14,     7,    15,
-    22,    29,    36,    43,    51,    59,    60,    52,
-    44,    37,    30,    23,    31,    38,    45,    53,
-    61,    62,    54,    46,    39,    47,    55,    63
-};
-
-const int8_t ff_vc1_adv_interlaced_8x4_zz [32] = { /* Table 236 */
-     0,     8,    16,    24,     1,     9,     2,    17,
-    25,    10,     3,    18,    26,     4,    11,    19,
-    12,     5,    13,    20,    27,     6,    21,    28,
-    14,    22,    29,     7,    30,    15,    23,    31
-};
-
-const int8_t ff_vc1_adv_interlaced_4x8_zz [32] = { /* Table 237 */
-     0,     1,     2,     8,
-    16,     9,    24,    17,
-    10,     3,    32,    40,
-    48,    56,    25,    18,
-    33,    26,    41,    34,
-    49,    57,    11,    42,
-    19,    50,    27,    58,
-    35,    43,    51,    59
-};
-
-const int8_t ff_vc1_adv_interlaced_4x4_zz [16] = { /* Table 238 */
-     0,     8,    16,    24,
-     1,     9,    17,     2,
-    25,    10,    18,     3,
-    26,    11,    19,    27
-};
-
-
-/* DQScale as specified in 8.1.3.9 - almost identical to 0x40000/i */
-const int32_t ff_vc1_dqscale[63] = {
-    0x40000, 0x20000, 0x15555, 0x10000, 0xCCCD, 0xAAAB, 0x9249, 0x8000,
-     0x71C7,  0x6666,  0x5D17,  0x5555, 0x4EC5, 0x4925, 0x4444, 0x4000,
-     0x3C3C,  0x38E4,  0x35E5,  0x3333, 0x30C3, 0x2E8C, 0x2C86, 0x2AAB,
-     0x28F6,  0x2762,  0x25ED,  0x2492, 0x234F, 0x2222, 0x2108, 0x2000,
-     0x1F08,  0x1E1E,  0x1D42,  0x1C72, 0x1BAD, 0x1AF3, 0x1A42, 0x199A,
-     0x18FA,  0x1862,  0x17D0,  0x1746, 0x16C1, 0x1643, 0x15CA, 0x1555,
-     0x14E6,  0x147B,  0x1414,  0x13B1, 0x1352, 0x12F7, 0x129E, 0x1249,
-     0x11F7,  0x11A8,  0x115B,  0x1111, 0x10C9, 0x1084, 0x1000
-};
-
-/* P Interlaced field picture MV predictor scaling values (Table 114) */
-const uint16_t ff_vc1_field_mvpred_scales[2][7][4] = {
-// Refdist:
-//      0       1       2       3 or greater
-  { // current field is first
-    { 128,    192,    213,    224 },   // SCALEOPP
-    { 512,    341,    307,    293 },   // SCALESAME1
-    { 219,    236,    242,    245 },   // SCALESAME2
-    {  32,     48,     53,     56 },   // SCALEZONE1_X
-    {   8,     12,     13,     14 },   // SCALEZONE1_Y
-    {  37,     20,     14,     11 },   // ZONE1OFFSET_X
-    {  10,      5,      4,      3 }    // ZONE1OFFSET_Y
-  },
-  { // current field is second
-    { 128,     64,     43,     32 },   // SCALEOPP
-    { 512,   1024,   1536,   2048 },   // SCALESAME1
-    { 219,    204,    200,    198 },   // SCALESAME2
-    {  32,     16,     11,      8 },   // SCALEZONE1_X
-    {   8,      4,      3,      2 },   // SCALEZONE1_Y
-    {  37,     52,     56,     58 },   // ZONE1OFFSET_X
-    {  10,     13,     14,     15 }    // ZONE1OFFSET_Y
-  }
-};
-
-/* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */
-const uint16_t ff_vc1_b_field_mvpred_scales[7][4] = {
-    // BRFD:
-    //  0       1       2       3 or greater
-    { 171,    205,    219,    228 },   // SCALESAME
-    { 384,    320,    299,    288 },   // SCALEOPP1
-    { 230,    239,    244,    246 },   // SCALEOPP2
-    {  43,     51,     55,     57 },   // SCALEZONE1_X
-    {  11,     13,     14,     14 },   // SCALEZONE1_Y
-    {  26,     17,     12,     10 },   // ZONE1OFFSET_X
-    {   7,      4,      3,      3 }    // ZONE1OFFSET_Y
-};
-
-const int ff_vc1_ac_sizes[AC_MODES] = {
-    186, 169, 133, 149, 103, 103, 163, 175
-};
diff --git a/deps/libav/libavcodec/vc1data.h b/deps/libav/libavcodec/vc1data.h
deleted file mode 100644
index 84e8188..0000000
--- a/deps/libav/libavcodec/vc1data.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * VC-1 and WMV3 decoder
- * copyright (c) 2006 Konstantin Shishkov
- * (c) 2005 anonymous, Alex Beregszaszi, Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VC-1 tables.
- */
-
-#ifndef AVCODEC_VC1DATA_H
-#define AVCODEC_VC1DATA_H
-
-#include <stdint.h>
-#include "libavutil/rational.h"
-#include "get_bits.h"
-
-/** Table for conversion between TTBLK and TTMB */
-extern const int ff_vc1_ttblk_to_tt[3][8];
-
-extern const int ff_vc1_ttfrm_to_tt[4];
-
-/** MV P mode - the 5th element is only used for mode 1 */
-extern const uint8_t ff_vc1_mv_pmode_table[2][5];
-extern const uint8_t ff_vc1_mv_pmode_table2[2][4];
-
-extern const int ff_vc1_fps_nr[7], ff_vc1_fps_dr[2];
-extern const uint8_t ff_vc1_pquant_table[3][32];
-
-/* MBMODE table for interlaced frame P-picture */
-extern const uint8_t ff_vc1_mbmode_intfrp[2][15][4];
-
-/** @name VC-1 VLC tables and defines
- *  @todo TODO move this into the context
- */
-//@{
-#define VC1_BFRACTION_VLC_BITS 7
-extern VLC ff_vc1_bfraction_vlc;
-#define VC1_IMODE_VLC_BITS 4
-extern VLC ff_vc1_imode_vlc;
-#define VC1_NORM2_VLC_BITS 3
-extern VLC ff_vc1_norm2_vlc;
-#define VC1_NORM6_VLC_BITS 9
-extern VLC ff_vc1_norm6_vlc;
-/* Could be optimized, one table only needs 8 bits */
-#define VC1_TTMB_VLC_BITS 9 //12
-extern VLC ff_vc1_ttmb_vlc[3];
-#define VC1_MV_DIFF_VLC_BITS 9 //15
-extern VLC ff_vc1_mv_diff_vlc[4];
-#define VC1_CBPCY_P_VLC_BITS 9 //14
-extern VLC ff_vc1_cbpcy_p_vlc[4];
-#define VC1_ICBPCY_VLC_BITS 9
-extern VLC ff_vc1_icbpcy_vlc[8];
-#define VC1_4MV_BLOCK_PATTERN_VLC_BITS 6
-extern VLC ff_vc1_4mv_block_pattern_vlc[4];
-#define VC1_2MV_BLOCK_PATTERN_VLC_BITS 3
-extern VLC ff_vc1_2mv_block_pattern_vlc[4];
-#define VC1_TTBLK_VLC_BITS 5
-extern VLC ff_vc1_ttblk_vlc[3];
-#define VC1_SUBBLKPAT_VLC_BITS 6
-extern VLC ff_vc1_subblkpat_vlc[3];
-#define VC1_INTFR_4MV_MBMODE_VLC_BITS 9
-extern VLC ff_vc1_intfr_4mv_mbmode_vlc[4];
-#define VC1_INTFR_NON4MV_MBMODE_VLC_BITS 6
-extern VLC ff_vc1_intfr_non4mv_mbmode_vlc[4];
-#define VC1_IF_MMV_MBMODE_VLC_BITS 5
-extern VLC ff_vc1_if_mmv_mbmode_vlc[8];
-#define VC1_IF_1MV_MBMODE_VLC_BITS 5
-extern VLC ff_vc1_if_1mv_mbmode_vlc[8];
-#define VC1_1REF_MVDATA_VLC_BITS 9
-extern VLC ff_vc1_1ref_mvdata_vlc[4];
-#define VC1_2REF_MVDATA_VLC_BITS 9
-extern VLC ff_vc1_2ref_mvdata_vlc[8];
-
-extern VLC ff_vc1_ac_coeff_table[8];
-
-#define VC1_IF_MBMODE_VLC_BITS 5
-//@}
-
-
-/* Denominator used for ff_vc1_bfraction_lut */
-#define B_FRACTION_DEN  256
-
-/* pre-computed scales for all bfractions and base=256 */
-extern const int16_t ff_vc1_bfraction_lut[23];
-extern const uint8_t ff_vc1_bfraction_bits[23];
-extern const uint8_t ff_vc1_bfraction_codes[23];
-
-//Same as H.264
-extern const AVRational ff_vc1_pixel_aspect[16];
-
-/* BitPlane IMODE - such a small table... */
-extern const uint8_t ff_vc1_imode_codes[7];
-extern const uint8_t ff_vc1_imode_bits[7];
-
-/* Normal-2 imode */
-extern const uint8_t ff_vc1_norm2_codes[4];
-extern const uint8_t ff_vc1_norm2_bits[4];
-extern const uint16_t ff_vc1_norm6_codes[64];
-extern const uint8_t ff_vc1_norm6_bits[64];
-/* Normal-6 imode */
-extern const uint8_t ff_vc1_norm6_spec[64][5];
-
-/* 4MV Block pattern VLC tables */
-extern const uint8_t ff_vc1_4mv_block_pattern_codes[4][16];
-extern const uint8_t ff_vc1_4mv_block_pattern_bits[4][16];
-
-/* 2MV Block pattern VLC tables */
-extern const uint8_t ff_vc1_2mv_block_pattern_codes[4][4];
-extern const uint8_t ff_vc1_2mv_block_pattern_bits[4][4];
-
-extern const uint8_t ff_wmv3_dc_scale_table[32];
-
-/* P-Picture CBPCY VLC tables */
-extern const uint16_t ff_vc1_cbpcy_p_codes[4][64];
-extern const uint8_t ff_vc1_cbpcy_p_bits[4][64];
-
-/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */
-extern const uint16_t ff_vc1_icbpcy_p_codes[8][63];
-extern const uint8_t ff_vc1_icbpcy_p_bits[8][63];
-
-/* MacroBlock Transform Type: 7.1.3.11, p89
- * 8x8:B
- * 8x4:B:btm  8x4:B:top  8x4:B:both,
- * 4x8:B:right  4x8:B:left  4x8:B:both
- * 4x4:B  8x8:MB
- * 8x4:MB:btm  8x4:MB:top  8x4,MB,both
- * 4x8,MB,right  4x8,MB,left
- * 4x4,MB                               */
-extern const uint16_t ff_vc1_ttmb_codes[3][16];
-
-extern const uint8_t ff_vc1_ttmb_bits[3][16];
-
-/* TTBLK (Transform Type per Block) tables */
-extern const uint8_t ff_vc1_ttblk_codes[3][8];
-extern const uint8_t ff_vc1_ttblk_bits[3][8];
-
-/* SUBBLKPAT tables, p93-94, reordered */
-extern const uint8_t ff_vc1_subblkpat_codes[3][15];
-extern const uint8_t ff_vc1_subblkpat_bits[3][15];
-
-/* MV differential tables, p265 */
-extern const uint16_t ff_vc1_mv_diff_codes[4][73];
-extern const uint8_t ff_vc1_mv_diff_bits[4][73];
-
-/* Interlaced frame picture MBMODE VLC tables (p. 246, p. 360) */
-extern const uint16_t ff_vc1_intfr_4mv_mbmode_codes[4][15];
-extern const uint8_t ff_vc1_intfr_4mv_mbmode_bits[4][15];
-extern const uint8_t ff_vc1_intfr_non4mv_mbmode_codes[4][9];
-extern const uint8_t ff_vc1_intfr_non4mv_mbmode_bits[4][9];
-
-/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */
-extern const uint8_t ff_vc1_if_mmv_mbmode_codes[8][8];
-extern const uint8_t ff_vc1_if_mmv_mbmode_bits[8][8];
-extern const uint8_t ff_vc1_if_1mv_mbmode_codes[8][6];
-extern const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6];
-
-/* Interlaced frame/field picture MVDATA VLC tables */
-/* 1-reference tables */
-extern const uint32_t ff_vc1_1ref_mvdata_codes[4][72];
-extern const uint8_t ff_vc1_1ref_mvdata_bits[4][72];
-/* 2-reference tables */
-extern const uint32_t ff_vc1_2ref_mvdata_codes[8][126];
-extern const uint8_t ff_vc1_2ref_mvdata_bits[8][126];
-
-/* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */
-
-/* Scantables/ZZ scan are at 11.9 (p262) and 8.1.1.12 (p10) */
-extern const int8_t ff_vc1_simple_progressive_4x4_zz [16];
-extern const int8_t ff_vc1_adv_progressive_8x4_zz [32];
-extern const int8_t ff_vc1_adv_progressive_4x8_zz [32];
-extern const int8_t ff_vc1_adv_interlaced_8x8_zz [64];
-extern const int8_t ff_vc1_adv_interlaced_8x4_zz [32];
-extern const int8_t ff_vc1_adv_interlaced_4x8_zz [32];
-extern const int8_t ff_vc1_adv_interlaced_4x4_zz [16];
-extern const int8_t ff_vc1_intra_horz_8x8_zz [64];
-extern const int8_t ff_vc1_intra_vert_8x8_zz [64];
-
-/* DQScale as specified in 8.1.3.9 - almost identical to 0x40000/i */
-extern const int32_t ff_vc1_dqscale[63];
-
-/* P Interlaced field picture MV predictor scaling values (Table 114) */
-extern const uint16_t ff_vc1_field_mvpred_scales[2][7][4];
-/* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */
-extern const uint16_t ff_vc1_b_field_mvpred_scales[7][4];
-
-#define AC_MODES 8
-
-extern const int ff_vc1_ac_sizes[AC_MODES];
-
-#endif /* AVCODEC_VC1DATA_H */
diff --git a/deps/libav/libavcodec/vc1dec.c b/deps/libav/libavcodec/vc1dec.c
deleted file mode 100644
index 403cbbc..0000000
--- a/deps/libav/libavcodec/vc1dec.c
+++ /dev/null
@@ -1,6199 +0,0 @@
-/*
- * VC-1 and WMV3 decoder
- * Copyright (c) 2011 Mashiat Sarker Shakkhar
- * Copyright (c) 2006-2007 Konstantin Shishkov
- * Partly based on vc9.c (c) 2005 Anonymous, Alex Beregszaszi, Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VC-1 and WMV3 decoder
- */
-
-#include "internal.h"
-#include "avcodec.h"
-#include "error_resilience.h"
-#include "mpegvideo.h"
-#include "h263.h"
-#include "h264chroma.h"
-#include "vc1.h"
-#include "vc1data.h"
-#include "vc1acdata.h"
-#include "msmpeg4data.h"
-#include "unary.h"
-#include "mathops.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-#define MB_INTRA_VLC_BITS 9
-#define DC_VLC_BITS 9
-
-
-// offset tables for interlaced picture MVDATA decoding
-static const int offset_table1[9] = {  0,  1,  2,  4,  8, 16, 32,  64, 128 };
-static const int offset_table2[9] = {  0,  1,  3,  7, 15, 31, 63, 127, 255 };
-
-/***********************************************************************/
-/**
- * @name VC-1 Bitplane decoding
- * @see 8.7, p56
- * @{
- */
-
-/**
- * Imode types
- * @{
- */
-enum Imode {
-    IMODE_RAW,
-    IMODE_NORM2,
-    IMODE_DIFF2,
-    IMODE_NORM6,
-    IMODE_DIFF6,
-    IMODE_ROWSKIP,
-    IMODE_COLSKIP
-};
-/** @} */ //imode defines
-
-static void init_block_index(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    ff_init_block_index(s);
-    if (v->field_mode && !(v->second_field ^ v->tff)) {
-        s->dest[0] += s->current_picture_ptr->f.linesize[0];
-        s->dest[1] += s->current_picture_ptr->f.linesize[1];
-        s->dest[2] += s->current_picture_ptr->f.linesize[2];
-    }
-}
-
-/** @} */ //Bitplane group
-
-static void vc1_put_signed_blocks_clamped(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    int topleft_mb_pos, top_mb_pos;
-    int stride_y, fieldtx = 0;
-    int v_dist;
-
-    /* The put pixels loop is always one MB row behind the decoding loop,
-     * because we can only put pixels when overlap filtering is done, and
-     * for filtering of the bottom edge of a MB, we need the next MB row
-     * present as well.
-     * Within the row, the put pixels loop is also one MB col behind the
-     * decoding loop. The reason for this is again, because for filtering
-     * of the right MB edge, we need the next MB present. */
-    if (!s->first_slice_line) {
-        if (s->mb_x) {
-            topleft_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x - 1;
-            if (v->fcm == ILACE_FRAME)
-                fieldtx = v->fieldtx_plane[topleft_mb_pos];
-            stride_y       = s->linesize << fieldtx;
-            v_dist         = (16 - fieldtx) >> (fieldtx == 0);
-            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][0],
-                                             s->dest[0] - 16 * s->linesize - 16,
-                                             stride_y);
-            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][1],
-                                             s->dest[0] - 16 * s->linesize - 8,
-                                             stride_y);
-            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][2],
-                                             s->dest[0] - v_dist * s->linesize - 16,
-                                             stride_y);
-            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][3],
-                                             s->dest[0] - v_dist * s->linesize - 8,
-                                             stride_y);
-            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][4],
-                                             s->dest[1] - 8 * s->uvlinesize - 8,
-                                             s->uvlinesize);
-            s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][5],
-                                             s->dest[2] - 8 * s->uvlinesize - 8,
-                                             s->uvlinesize);
-        }
-        if (s->mb_x == s->mb_width - 1) {
-            top_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x;
-            if (v->fcm == ILACE_FRAME)
-                fieldtx = v->fieldtx_plane[top_mb_pos];
-            stride_y   = s->linesize << fieldtx;
-            v_dist     = fieldtx ? 15 : 8;
-            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][0],
-                                             s->dest[0] - 16 * s->linesize,
-                                             stride_y);
-            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][1],
-                                             s->dest[0] - 16 * s->linesize + 8,
-                                             stride_y);
-            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][2],
-                                             s->dest[0] - v_dist * s->linesize,
-                                             stride_y);
-            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][3],
-                                             s->dest[0] - v_dist * s->linesize + 8,
-                                             stride_y);
-            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][4],
-                                             s->dest[1] - 8 * s->uvlinesize,
-                                             s->uvlinesize);
-            s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][5],
-                                             s->dest[2] - 8 * s->uvlinesize,
-                                             s->uvlinesize);
-        }
-    }
-
-#define inc_blk_idx(idx) do { \
-        idx++; \
-        if (idx >= v->n_allocated_blks) \
-            idx = 0; \
-    } while (0)
-
-    inc_blk_idx(v->topleft_blk_idx);
-    inc_blk_idx(v->top_blk_idx);
-    inc_blk_idx(v->left_blk_idx);
-    inc_blk_idx(v->cur_blk_idx);
-}
-
-static void vc1_loop_filter_iblk(VC1Context *v, int pq)
-{
-    MpegEncContext *s = &v->s;
-    int j;
-    if (!s->first_slice_line) {
-        v->vc1dsp.vc1_v_loop_filter16(s->dest[0], s->linesize, pq);
-        if (s->mb_x)
-            v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize, s->linesize, pq);
-        v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize + 8, s->linesize, pq);
-        for (j = 0; j < 2; j++) {
-            v->vc1dsp.vc1_v_loop_filter8(s->dest[j + 1], s->uvlinesize, pq);
-            if (s->mb_x)
-                v->vc1dsp.vc1_h_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize, s->uvlinesize, pq);
-        }
-    }
-    v->vc1dsp.vc1_v_loop_filter16(s->dest[0] + 8 * s->linesize, s->linesize, pq);
-
-    if (s->mb_y == s->end_mb_y - 1) {
-        if (s->mb_x) {
-            v->vc1dsp.vc1_h_loop_filter16(s->dest[0], s->linesize, pq);
-            v->vc1dsp.vc1_h_loop_filter8(s->dest[1], s->uvlinesize, pq);
-            v->vc1dsp.vc1_h_loop_filter8(s->dest[2], s->uvlinesize, pq);
-        }
-        v->vc1dsp.vc1_h_loop_filter16(s->dest[0] + 8, s->linesize, pq);
-    }
-}
-
-static void vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
-{
-    MpegEncContext *s = &v->s;
-    int j;
-
-    /* The loopfilter runs 1 row and 1 column behind the overlap filter, which
-     * means it runs two rows/cols behind the decoding loop. */
-    if (!s->first_slice_line) {
-        if (s->mb_x) {
-            if (s->mb_y >= s->start_mb_y + 2) {
-                v->vc1dsp.vc1_v_loop_filter16(s->dest[0] - 16 * s->linesize - 16, s->linesize, pq);
-
-                if (s->mb_x >= 2)
-                    v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize - 16, s->linesize, pq);
-                v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize - 8, s->linesize, pq);
-                for (j = 0; j < 2; j++) {
-                    v->vc1dsp.vc1_v_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize - 8, s->uvlinesize, pq);
-                    if (s->mb_x >= 2) {
-                        v->vc1dsp.vc1_h_loop_filter8(s->dest[j + 1] - 16 * s->uvlinesize - 8, s->uvlinesize, pq);
-                    }
-                }
-            }
-            v->vc1dsp.vc1_v_loop_filter16(s->dest[0] - 8 * s->linesize - 16, s->linesize, pq);
-        }
-
-        if (s->mb_x == s->mb_width - 1) {
-            if (s->mb_y >= s->start_mb_y + 2) {
-                v->vc1dsp.vc1_v_loop_filter16(s->dest[0] - 16 * s->linesize, s->linesize, pq);
-
-                if (s->mb_x)
-                    v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize, s->linesize, pq);
-                v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize + 8, s->linesize, pq);
-                for (j = 0; j < 2; j++) {
-                    v->vc1dsp.vc1_v_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize, s->uvlinesize, pq);
-                    if (s->mb_x >= 2) {
-                        v->vc1dsp.vc1_h_loop_filter8(s->dest[j + 1] - 16 * s->uvlinesize, s->uvlinesize, pq);
-                    }
-                }
-            }
-            v->vc1dsp.vc1_v_loop_filter16(s->dest[0] - 8 * s->linesize, s->linesize, pq);
-        }
-
-        if (s->mb_y == s->end_mb_y) {
-            if (s->mb_x) {
-                if (s->mb_x >= 2)
-                    v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize - 16, s->linesize, pq);
-                v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize - 8, s->linesize, pq);
-                if (s->mb_x >= 2) {
-                    for (j = 0; j < 2; j++) {
-                        v->vc1dsp.vc1_h_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize - 8, s->uvlinesize, pq);
-                    }
-                }
-            }
-
-            if (s->mb_x == s->mb_width - 1) {
-                if (s->mb_x)
-                    v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize, s->linesize, pq);
-                v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize + 8, s->linesize, pq);
-                if (s->mb_x) {
-                    for (j = 0; j < 2; j++) {
-                        v->vc1dsp.vc1_h_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize, s->uvlinesize, pq);
-                    }
-                }
-            }
-        }
-    }
-}
-
-static void vc1_smooth_overlap_filter_iblk(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    int mb_pos;
-
-    if (v->condover == CONDOVER_NONE)
-        return;
-
-    mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-
-    /* Within a MB, the horizontal overlap always runs before the vertical.
-     * To accomplish that, we run the H on left and internal borders of the
-     * currently decoded MB. Then, we wait for the next overlap iteration
-     * to do H overlap on the right edge of this MB, before moving over and
-     * running the V overlap. Therefore, the V overlap makes us trail by one
-     * MB col and the H overlap filter makes us trail by one MB row. This
-     * is reflected in the time at which we run the put_pixels loop. */
-    if (v->condover == CONDOVER_ALL || v->pq >= 9 || v->over_flags_plane[mb_pos]) {
-        if (s->mb_x && (v->condover == CONDOVER_ALL || v->pq >= 9 ||
-                        v->over_flags_plane[mb_pos - 1])) {
-            v->vc1dsp.vc1_h_s_overlap(v->block[v->left_blk_idx][1],
-                                      v->block[v->cur_blk_idx][0]);
-            v->vc1dsp.vc1_h_s_overlap(v->block[v->left_blk_idx][3],
-                                      v->block[v->cur_blk_idx][2]);
-            if (!(s->flags & CODEC_FLAG_GRAY)) {
-                v->vc1dsp.vc1_h_s_overlap(v->block[v->left_blk_idx][4],
-                                          v->block[v->cur_blk_idx][4]);
-                v->vc1dsp.vc1_h_s_overlap(v->block[v->left_blk_idx][5],
-                                          v->block[v->cur_blk_idx][5]);
-            }
-        }
-        v->vc1dsp.vc1_h_s_overlap(v->block[v->cur_blk_idx][0],
-                                  v->block[v->cur_blk_idx][1]);
-        v->vc1dsp.vc1_h_s_overlap(v->block[v->cur_blk_idx][2],
-                                  v->block[v->cur_blk_idx][3]);
-
-        if (s->mb_x == s->mb_width - 1) {
-            if (!s->first_slice_line && (v->condover == CONDOVER_ALL || v->pq >= 9 ||
-                                         v->over_flags_plane[mb_pos - s->mb_stride])) {
-                v->vc1dsp.vc1_v_s_overlap(v->block[v->top_blk_idx][2],
-                                          v->block[v->cur_blk_idx][0]);
-                v->vc1dsp.vc1_v_s_overlap(v->block[v->top_blk_idx][3],
-                                          v->block[v->cur_blk_idx][1]);
-                if (!(s->flags & CODEC_FLAG_GRAY)) {
-                    v->vc1dsp.vc1_v_s_overlap(v->block[v->top_blk_idx][4],
-                                              v->block[v->cur_blk_idx][4]);
-                    v->vc1dsp.vc1_v_s_overlap(v->block[v->top_blk_idx][5],
-                                              v->block[v->cur_blk_idx][5]);
-                }
-            }
-            v->vc1dsp.vc1_v_s_overlap(v->block[v->cur_blk_idx][0],
-                                      v->block[v->cur_blk_idx][2]);
-            v->vc1dsp.vc1_v_s_overlap(v->block[v->cur_blk_idx][1],
-                                      v->block[v->cur_blk_idx][3]);
-        }
-    }
-    if (s->mb_x && (v->condover == CONDOVER_ALL || v->over_flags_plane[mb_pos - 1])) {
-        if (!s->first_slice_line && (v->condover == CONDOVER_ALL || v->pq >= 9 ||
-                                     v->over_flags_plane[mb_pos - s->mb_stride - 1])) {
-            v->vc1dsp.vc1_v_s_overlap(v->block[v->topleft_blk_idx][2],
-                                      v->block[v->left_blk_idx][0]);
-            v->vc1dsp.vc1_v_s_overlap(v->block[v->topleft_blk_idx][3],
-                                      v->block[v->left_blk_idx][1]);
-            if (!(s->flags & CODEC_FLAG_GRAY)) {
-                v->vc1dsp.vc1_v_s_overlap(v->block[v->topleft_blk_idx][4],
-                                          v->block[v->left_blk_idx][4]);
-                v->vc1dsp.vc1_v_s_overlap(v->block[v->topleft_blk_idx][5],
-                                          v->block[v->left_blk_idx][5]);
-            }
-        }
-        v->vc1dsp.vc1_v_s_overlap(v->block[v->left_blk_idx][0],
-                                  v->block[v->left_blk_idx][2]);
-        v->vc1dsp.vc1_v_s_overlap(v->block[v->left_blk_idx][1],
-                                  v->block[v->left_blk_idx][3]);
-    }
-}
-
-/** Do motion compensation over 1 macroblock
- * Mostly adapted hpel_motion and qpel_motion from mpegvideo.c
- */
-static void vc1_mc_1mv(VC1Context *v, int dir)
-{
-    MpegEncContext *s = &v->s;
-    H264ChromaContext *h264chroma = &v->h264chroma;
-    uint8_t *srcY, *srcU, *srcV;
-    int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y;
-    int v_edge_pos = s->v_edge_pos >> v->field_mode;
-    int i;
-    uint8_t (*luty)[256], (*lutuv)[256];
-    int use_ic;
-
-    if ((!v->field_mode ||
-         (v->ref_field_type[dir] == 1 && v->cur_field_type == 1)) &&
-        !v->s.last_picture.f.data[0])
-        return;
-
-    mx = s->mv[dir][0][0];
-    my = s->mv[dir][0][1];
-
-    // store motion vectors for further use in B frames
-    if (s->pict_type == AV_PICTURE_TYPE_P) {
-        for (i = 0; i < 4; i++) {
-            s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][0] = mx;
-            s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][1] = my;
-        }
-    }
-
-    uvmx = (mx + ((mx & 3) == 3)) >> 1;
-    uvmy = (my + ((my & 3) == 3)) >> 1;
-    v->luma_mv[s->mb_x][0] = uvmx;
-    v->luma_mv[s->mb_x][1] = uvmy;
-
-    if (v->field_mode &&
-        v->cur_field_type != v->ref_field_type[dir]) {
-        my   = my   - 2 + 4 * v->cur_field_type;
-        uvmy = uvmy - 2 + 4 * v->cur_field_type;
-    }
-
-    // fastuvmc shall be ignored for interlaced frame picture
-    if (v->fastuvmc && (v->fcm != ILACE_FRAME)) {
-        uvmx = uvmx + ((uvmx < 0) ? (uvmx & 1) : -(uvmx & 1));
-        uvmy = uvmy + ((uvmy < 0) ? (uvmy & 1) : -(uvmy & 1));
-    }
-    if (!dir) {
-        if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) {
-            srcY = s->current_picture.f.data[0];
-            srcU = s->current_picture.f.data[1];
-            srcV = s->current_picture.f.data[2];
-            luty  = v->curr_luty;
-            lutuv = v->curr_lutuv;
-            use_ic = v->curr_use_ic;
-        } else {
-            srcY = s->last_picture.f.data[0];
-            srcU = s->last_picture.f.data[1];
-            srcV = s->last_picture.f.data[2];
-            luty  = v->last_luty;
-            lutuv = v->last_lutuv;
-            use_ic = v->last_use_ic;
-        }
-    } else {
-        srcY = s->next_picture.f.data[0];
-        srcU = s->next_picture.f.data[1];
-        srcV = s->next_picture.f.data[2];
-        luty  = v->next_luty;
-        lutuv = v->next_lutuv;
-        use_ic = v->next_use_ic;
-    }
-
-    if (!srcY || !srcU) {
-        av_log(v->s.avctx, AV_LOG_ERROR, "Referenced frame missing.\n");
-        return;
-    }
-
-    src_x   = s->mb_x * 16 + (mx   >> 2);
-    src_y   = s->mb_y * 16 + (my   >> 2);
-    uvsrc_x = s->mb_x *  8 + (uvmx >> 2);
-    uvsrc_y = s->mb_y *  8 + (uvmy >> 2);
-
-    if (v->profile != PROFILE_ADVANCED) {
-        src_x   = av_clip(  src_x, -16, s->mb_width  * 16);
-        src_y   = av_clip(  src_y, -16, s->mb_height * 16);
-        uvsrc_x = av_clip(uvsrc_x,  -8, s->mb_width  *  8);
-        uvsrc_y = av_clip(uvsrc_y,  -8, s->mb_height *  8);
-    } else {
-        src_x   = av_clip(  src_x, -17, s->avctx->coded_width);
-        src_y   = av_clip(  src_y, -18, s->avctx->coded_height + 1);
-        uvsrc_x = av_clip(uvsrc_x,  -8, s->avctx->coded_width  >> 1);
-        uvsrc_y = av_clip(uvsrc_y,  -8, s->avctx->coded_height >> 1);
-    }
-
-    srcY += src_y   * s->linesize   + src_x;
-    srcU += uvsrc_y * s->uvlinesize + uvsrc_x;
-    srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
-
-    if (v->field_mode && v->ref_field_type[dir]) {
-        srcY += s->current_picture_ptr->f.linesize[0];
-        srcU += s->current_picture_ptr->f.linesize[1];
-        srcV += s->current_picture_ptr->f.linesize[2];
-    }
-
-    /* for grayscale we should not try to read from unknown area */
-    if (s->flags & CODEC_FLAG_GRAY) {
-        srcU = s->edge_emu_buffer + 18 * s->linesize;
-        srcV = s->edge_emu_buffer + 18 * s->linesize;
-    }
-
-    if (v->rangeredfrm || use_ic
-        || s->h_edge_pos < 22 || v_edge_pos < 22
-        || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx&3) - 16 - s->mspel * 3
-        || (unsigned)(src_y - 1)        > v_edge_pos    - (my&3) - 16 - 3) {
-        uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize;
-
-        srcY -= s->mspel * (1 + s->linesize);
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
-                                 s->linesize, s->linesize,
-                                 17 + s->mspel * 2, 17 + s->mspel * 2,
-                                 src_x - s->mspel, src_y - s->mspel,
-                                 s->h_edge_pos, v_edge_pos);
-        srcY = s->edge_emu_buffer;
-        s->vdsp.emulated_edge_mc(uvbuf, srcU,
-                                 s->uvlinesize, s->uvlinesize,
-                                 8 + 1, 8 + 1,
-                                 uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1);
-        s->vdsp.emulated_edge_mc(uvbuf + 16, srcV,
-                                 s->uvlinesize, s->uvlinesize,
-                                 8 + 1, 8 + 1,
-                                 uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1);
-        srcU = uvbuf;
-        srcV = uvbuf + 16;
-        /* if we deal with range reduction we need to scale source blocks */
-        if (v->rangeredfrm) {
-            int i, j;
-            uint8_t *src, *src2;
-
-            src = srcY;
-            for (j = 0; j < 17 + s->mspel * 2; j++) {
-                for (i = 0; i < 17 + s->mspel * 2; i++)
-                    src[i] = ((src[i] - 128) >> 1) + 128;
-                src += s->linesize;
-            }
-            src  = srcU;
-            src2 = srcV;
-            for (j = 0; j < 9; j++) {
-                for (i = 0; i < 9; i++) {
-                    src[i]  = ((src[i]  - 128) >> 1) + 128;
-                    src2[i] = ((src2[i] - 128) >> 1) + 128;
-                }
-                src  += s->uvlinesize;
-                src2 += s->uvlinesize;
-            }
-        }
-        /* if we deal with intensity compensation we need to scale source blocks */
-        if (use_ic) {
-            int i, j;
-            uint8_t *src, *src2;
-
-            src = srcY;
-            for (j = 0; j < 17 + s->mspel * 2; j++) {
-                int f = v->field_mode ? v->ref_field_type[dir] : ((j + src_y - s->mspel) & 1) ;
-                for (i = 0; i < 17 + s->mspel * 2; i++)
-                    src[i] = luty[f][src[i]];
-                src += s->linesize;
-            }
-            src  = srcU;
-            src2 = srcV;
-            for (j = 0; j < 9; j++) {
-                int f = v->field_mode ? v->ref_field_type[dir] : ((j + uvsrc_y) & 1);
-                for (i = 0; i < 9; i++) {
-                    src[i]  = lutuv[f][src[i]];
-                    src2[i] = lutuv[f][src2[i]];
-                }
-                src  += s->uvlinesize;
-                src2 += s->uvlinesize;
-            }
-        }
-        srcY += s->mspel * (1 + s->linesize);
-    }
-
-    if (s->mspel) {
-        dxy = ((my & 3) << 2) | (mx & 3);
-        v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0]    , srcY    , s->linesize, v->rnd);
-        v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8, srcY + 8, s->linesize, v->rnd);
-        srcY += s->linesize * 8;
-        v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8 * s->linesize    , srcY    , s->linesize, v->rnd);
-        v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8 * s->linesize + 8, srcY + 8, s->linesize, v->rnd);
-    } else { // hpel mc - always used for luma
-        dxy = (my & 2) | ((mx & 2) >> 1);
-        if (!v->rnd)
-            s->hdsp.put_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
-        else
-            s->hdsp.put_no_rnd_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
-    }
-
-    if (s->flags & CODEC_FLAG_GRAY) return;
-    /* Chroma MC always uses qpel bilinear */
-    uvmx = (uvmx & 3) << 1;
-    uvmy = (uvmy & 3) << 1;
-    if (!v->rnd) {
-        h264chroma->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
-        h264chroma->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
-    } else {
-        v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
-        v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
-    }
-}
-
-static inline int median4(int a, int b, int c, int d)
-{
-    if (a < b) {
-        if (c < d) return (FFMIN(b, d) + FFMAX(a, c)) / 2;
-        else       return (FFMIN(b, c) + FFMAX(a, d)) / 2;
-    } else {
-        if (c < d) return (FFMIN(a, d) + FFMAX(b, c)) / 2;
-        else       return (FFMIN(a, c) + FFMAX(b, d)) / 2;
-    }
-}
-
-/** Do motion compensation for 4-MV macroblock - luminance block
- */
-static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
-{
-    MpegEncContext *s = &v->s;
-    uint8_t *srcY;
-    int dxy, mx, my, src_x, src_y;
-    int off;
-    int fieldmv = (v->fcm == ILACE_FRAME) ? v->blk_mv_type[s->block_index[n]] : 0;
-    int v_edge_pos = s->v_edge_pos >> v->field_mode;
-    uint8_t (*luty)[256];
-    int use_ic;
-
-    if ((!v->field_mode ||
-         (v->ref_field_type[dir] == 1 && v->cur_field_type == 1)) &&
-        !v->s.last_picture.f.data[0])
-        return;
-
-    mx = s->mv[dir][n][0];
-    my = s->mv[dir][n][1];
-
-    if (!dir) {
-        if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) {
-            srcY = s->current_picture.f.data[0];
-            luty = v->curr_luty;
-            use_ic = v->curr_use_ic;
-        } else {
-            srcY = s->last_picture.f.data[0];
-            luty = v->last_luty;
-            use_ic = v->last_use_ic;
-        }
-    } else {
-        srcY = s->next_picture.f.data[0];
-        luty = v->next_luty;
-        use_ic = v->next_use_ic;
-    }
-
-    if (!srcY) {
-        av_log(v->s.avctx, AV_LOG_ERROR, "Referenced frame missing.\n");
-        return;
-    }
-
-    if (v->field_mode) {
-        if (v->cur_field_type != v->ref_field_type[dir])
-            my = my - 2 + 4 * v->cur_field_type;
-    }
-
-    if (s->pict_type == AV_PICTURE_TYPE_P && n == 3 && v->field_mode) {
-        int same_count = 0, opp_count = 0, k;
-        int chosen_mv[2][4][2], f;
-        int tx, ty;
-        for (k = 0; k < 4; k++) {
-            f = v->mv_f[0][s->block_index[k] + v->blocks_off];
-            chosen_mv[f][f ? opp_count : same_count][0] = s->mv[0][k][0];
-            chosen_mv[f][f ? opp_count : same_count][1] = s->mv[0][k][1];
-            opp_count  += f;
-            same_count += 1 - f;
-        }
-        f = opp_count > same_count;
-        switch (f ? opp_count : same_count) {
-        case 4:
-            tx = median4(chosen_mv[f][0][0], chosen_mv[f][1][0],
-                         chosen_mv[f][2][0], chosen_mv[f][3][0]);
-            ty = median4(chosen_mv[f][0][1], chosen_mv[f][1][1],
-                         chosen_mv[f][2][1], chosen_mv[f][3][1]);
-            break;
-        case 3:
-            tx = mid_pred(chosen_mv[f][0][0], chosen_mv[f][1][0], chosen_mv[f][2][0]);
-            ty = mid_pred(chosen_mv[f][0][1], chosen_mv[f][1][1], chosen_mv[f][2][1]);
-            break;
-        case 2:
-            tx = (chosen_mv[f][0][0] + chosen_mv[f][1][0]) / 2;
-            ty = (chosen_mv[f][0][1] + chosen_mv[f][1][1]) / 2;
-            break;
-        }
-        s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx;
-        s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty;
-        for (k = 0; k < 4; k++)
-            v->mv_f[1][s->block_index[k] + v->blocks_off] = f;
-    }
-
-    if (v->fcm == ILACE_FRAME) {  // not sure if needed for other types of picture
-        int qx, qy;
-        int width  = s->avctx->coded_width;
-        int height = s->avctx->coded_height >> 1;
-        if (s->pict_type == AV_PICTURE_TYPE_P) {
-            s->current_picture.motion_val[1][s->block_index[n] + v->blocks_off][0] = mx;
-            s->current_picture.motion_val[1][s->block_index[n] + v->blocks_off][1] = my;
-        }
-        qx = (s->mb_x * 16) + (mx >> 2);
-        qy = (s->mb_y *  8) + (my >> 3);
-
-        if (qx < -17)
-            mx -= 4 * (qx + 17);
-        else if (qx > width)
-            mx -= 4 * (qx - width);
-        if (qy < -18)
-            my -= 8 * (qy + 18);
-        else if (qy > height + 1)
-            my -= 8 * (qy - height - 1);
-    }
-
-    if ((v->fcm == ILACE_FRAME) && fieldmv)
-        off = ((n > 1) ? s->linesize : 0) + (n & 1) * 8;
-    else
-        off = s->linesize * 4 * (n & 2) + (n & 1) * 8;
-
-    src_x = s->mb_x * 16 + (n & 1) * 8 + (mx >> 2);
-    if (!fieldmv)
-        src_y = s->mb_y * 16 + (n & 2) * 4 + (my >> 2);
-    else
-        src_y = s->mb_y * 16 + ((n > 1) ? 1 : 0) + (my >> 2);
-
-    if (v->profile != PROFILE_ADVANCED) {
-        src_x = av_clip(src_x, -16, s->mb_width  * 16);
-        src_y = av_clip(src_y, -16, s->mb_height * 16);
-    } else {
-        src_x = av_clip(src_x, -17, s->avctx->coded_width);
-        if (v->fcm == ILACE_FRAME) {
-            if (src_y & 1)
-                src_y = av_clip(src_y, -17, s->avctx->coded_height + 1);
-            else
-                src_y = av_clip(src_y, -18, s->avctx->coded_height);
-        } else {
-            src_y = av_clip(src_y, -18, s->avctx->coded_height + 1);
-        }
-    }
-
-    srcY += src_y * s->linesize + src_x;
-    if (v->field_mode && v->ref_field_type[dir])
-        srcY += s->current_picture_ptr->f.linesize[0];
-
-    if (fieldmv && !(src_y & 1))
-        v_edge_pos--;
-    if (fieldmv && (src_y & 1) && src_y < 4)
-        src_y--;
-    if (v->rangeredfrm || use_ic
-        || s->h_edge_pos < 13 || v_edge_pos < 23
-        || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx & 3) - 8 - s->mspel * 2
-        || (unsigned)(src_y - (s->mspel << fieldmv)) > v_edge_pos - (my & 3) - ((8 + s->mspel * 2) << fieldmv)) {
-        srcY -= s->mspel * (1 + (s->linesize << fieldmv));
-        /* check emulate edge stride and offset */
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
-                                 s->linesize, s->linesize,
-                                 9 + s->mspel * 2, (9 + s->mspel * 2) << fieldmv,
-                                 src_x - s->mspel, src_y - (s->mspel << fieldmv),
-                                 s->h_edge_pos, v_edge_pos);
-        srcY = s->edge_emu_buffer;
-        /* if we deal with range reduction we need to scale source blocks */
-        if (v->rangeredfrm) {
-            int i, j;
-            uint8_t *src;
-
-            src = srcY;
-            for (j = 0; j < 9 + s->mspel * 2; j++) {
-                for (i = 0; i < 9 + s->mspel * 2; i++)
-                    src[i] = ((src[i] - 128) >> 1) + 128;
-                src += s->linesize << fieldmv;
-            }
-        }
-        /* if we deal with intensity compensation we need to scale source blocks */
-        if (use_ic) {
-            int i, j;
-            uint8_t *src;
-
-            src = srcY;
-            for (j = 0; j < 9 + s->mspel * 2; j++) {
-                int f = v->field_mode ? v->ref_field_type[dir] : (((j<<fieldmv)+src_y - (s->mspel << fieldmv)) & 1);
-                for (i = 0; i < 9 + s->mspel * 2; i++)
-                    src[i] = luty[f][src[i]];
-                src += s->linesize << fieldmv;
-            }
-        }
-        srcY += s->mspel * (1 + (s->linesize << fieldmv));
-    }
-
-    if (s->mspel) {
-        dxy = ((my & 3) << 2) | (mx & 3);
-        if (avg)
-            v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off, srcY, s->linesize << fieldmv, v->rnd);
-        else
-            v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + off, srcY, s->linesize << fieldmv, v->rnd);
-    } else { // hpel mc - always used for luma
-        dxy = (my & 2) | ((mx & 2) >> 1);
-        if (!v->rnd)
-            s->hdsp.put_pixels_tab[1][dxy](s->dest[0] + off, srcY, s->linesize, 8);
-        else
-            s->hdsp.put_no_rnd_pixels_tab[1][dxy](s->dest[0] + off, srcY, s->linesize, 8);
-    }
-}
-
-static av_always_inline int get_chroma_mv(int *mvx, int *mvy, int *a, int flag, int *tx, int *ty)
-{
-    int idx, i;
-    static const int count[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
-
-    idx =  ((a[3] != flag) << 3)
-         | ((a[2] != flag) << 2)
-         | ((a[1] != flag) << 1)
-         |  (a[0] != flag);
-    if (!idx) {
-        *tx = median4(mvx[0], mvx[1], mvx[2], mvx[3]);
-        *ty = median4(mvy[0], mvy[1], mvy[2], mvy[3]);
-        return 4;
-    } else if (count[idx] == 1) {
-        switch (idx) {
-        case 0x1:
-            *tx = mid_pred(mvx[1], mvx[2], mvx[3]);
-            *ty = mid_pred(mvy[1], mvy[2], mvy[3]);
-            return 3;
-        case 0x2:
-            *tx = mid_pred(mvx[0], mvx[2], mvx[3]);
-            *ty = mid_pred(mvy[0], mvy[2], mvy[3]);
-            return 3;
-        case 0x4:
-            *tx = mid_pred(mvx[0], mvx[1], mvx[3]);
-            *ty = mid_pred(mvy[0], mvy[1], mvy[3]);
-            return 3;
-        case 0x8:
-            *tx = mid_pred(mvx[0], mvx[1], mvx[2]);
-            *ty = mid_pred(mvy[0], mvy[1], mvy[2]);
-            return 3;
-        }
-    } else if (count[idx] == 2) {
-        int t1 = 0, t2 = 0;
-        for (i = 0; i < 3; i++)
-            if (!a[i]) {
-                t1 = i;
-                break;
-            }
-        for (i = t1 + 1; i < 4; i++)
-            if (!a[i]) {
-                t2 = i;
-                break;
-            }
-        *tx = (mvx[t1] + mvx[t2]) / 2;
-        *ty = (mvy[t1] + mvy[t2]) / 2;
-        return 2;
-    } else {
-        return 0;
-    }
-    return -1;
-}
-
-/** Do motion compensation for 4-MV macroblock - both chroma blocks
- */
-static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
-{
-    MpegEncContext *s = &v->s;
-    H264ChromaContext *h264chroma = &v->h264chroma;
-    uint8_t *srcU, *srcV;
-    int uvmx, uvmy, uvsrc_x, uvsrc_y;
-    int k, tx = 0, ty = 0;
-    int mvx[4], mvy[4], intra[4], mv_f[4];
-    int valid_count;
-    int chroma_ref_type = v->cur_field_type;
-    int v_edge_pos = s->v_edge_pos >> v->field_mode;
-    uint8_t (*lutuv)[256];
-    int use_ic;
-
-    if (!v->field_mode && !v->s.last_picture.f.data[0])
-        return;
-    if (s->flags & CODEC_FLAG_GRAY)
-        return;
-
-    for (k = 0; k < 4; k++) {
-        mvx[k] = s->mv[dir][k][0];
-        mvy[k] = s->mv[dir][k][1];
-        intra[k] = v->mb_type[0][s->block_index[k]];
-        if (v->field_mode)
-            mv_f[k] = v->mv_f[dir][s->block_index[k] + v->blocks_off];
-    }
-
-    /* calculate chroma MV vector from four luma MVs */
-    if (!v->field_mode || (v->field_mode && !v->numref)) {
-        valid_count = get_chroma_mv(mvx, mvy, intra, 0, &tx, &ty);
-        chroma_ref_type = v->reffield;
-        if (!valid_count) {
-            s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0;
-            s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0;
-            v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0;
-            return; //no need to do MC for intra blocks
-        }
-    } else {
-        int dominant = 0;
-        if (mv_f[0] + mv_f[1] + mv_f[2] + mv_f[3] > 2)
-            dominant = 1;
-        valid_count = get_chroma_mv(mvx, mvy, mv_f, dominant, &tx, &ty);
-        if (dominant)
-            chroma_ref_type = !v->cur_field_type;
-    }
-    if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_picture.f.data[0])
-        return;
-    s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx;
-    s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty;
-    uvmx = (tx + ((tx & 3) == 3)) >> 1;
-    uvmy = (ty + ((ty & 3) == 3)) >> 1;
-
-    v->luma_mv[s->mb_x][0] = uvmx;
-    v->luma_mv[s->mb_x][1] = uvmy;
-
-    if (v->fastuvmc) {
-        uvmx = uvmx + ((uvmx < 0) ? (uvmx & 1) : -(uvmx & 1));
-        uvmy = uvmy + ((uvmy < 0) ? (uvmy & 1) : -(uvmy & 1));
-    }
-    // Field conversion bias
-    if (v->cur_field_type != chroma_ref_type)
-        uvmy += 2 - 4 * chroma_ref_type;
-
-    uvsrc_x = s->mb_x * 8 + (uvmx >> 2);
-    uvsrc_y = s->mb_y * 8 + (uvmy >> 2);
-
-    if (v->profile != PROFILE_ADVANCED) {
-        uvsrc_x = av_clip(uvsrc_x, -8, s->mb_width  * 8);
-        uvsrc_y = av_clip(uvsrc_y, -8, s->mb_height * 8);
-    } else {
-        uvsrc_x = av_clip(uvsrc_x, -8, s->avctx->coded_width  >> 1);
-        uvsrc_y = av_clip(uvsrc_y, -8, s->avctx->coded_height >> 1);
-    }
-
-    if (!dir) {
-        if (v->field_mode && (v->cur_field_type != chroma_ref_type) && v->second_field) {
-            srcU = s->current_picture.f.data[1];
-            srcV = s->current_picture.f.data[2];
-            lutuv = v->curr_lutuv;
-            use_ic = v->curr_use_ic;
-        } else {
-            srcU = s->last_picture.f.data[1];
-            srcV = s->last_picture.f.data[2];
-            lutuv = v->last_lutuv;
-            use_ic = v->last_use_ic;
-        }
-    } else {
-        srcU = s->next_picture.f.data[1];
-        srcV = s->next_picture.f.data[2];
-        lutuv = v->next_lutuv;
-        use_ic = v->next_use_ic;
-    }
-
-    if (!srcU) {
-        av_log(v->s.avctx, AV_LOG_ERROR, "Referenced frame missing.\n");
-        return;
-    }
-
-    srcU += uvsrc_y * s->uvlinesize + uvsrc_x;
-    srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
-
-    if (v->field_mode) {
-        if (chroma_ref_type) {
-            srcU += s->current_picture_ptr->f.linesize[1];
-            srcV += s->current_picture_ptr->f.linesize[2];
-        }
-    }
-
-    if (v->rangeredfrm || use_ic
-        || s->h_edge_pos < 18 || v_edge_pos < 18
-        || (unsigned)uvsrc_x > (s->h_edge_pos >> 1) - 9
-        || (unsigned)uvsrc_y > (v_edge_pos    >> 1) - 9) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcU,
-                                 s->uvlinesize, s->uvlinesize,
-                                 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
-                                 s->h_edge_pos >> 1, v_edge_pos >> 1);
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, srcV,
-                                 s->uvlinesize, s->uvlinesize,
-                                 8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
-                                 s->h_edge_pos >> 1, v_edge_pos >> 1);
-        srcU = s->edge_emu_buffer;
-        srcV = s->edge_emu_buffer + 16;
-
-        /* if we deal with range reduction we need to scale source blocks */
-        if (v->rangeredfrm) {
-            int i, j;
-            uint8_t *src, *src2;
-
-            src  = srcU;
-            src2 = srcV;
-            for (j = 0; j < 9; j++) {
-                for (i = 0; i < 9; i++) {
-                    src[i]  = ((src[i]  - 128) >> 1) + 128;
-                    src2[i] = ((src2[i] - 128) >> 1) + 128;
-                }
-                src  += s->uvlinesize;
-                src2 += s->uvlinesize;
-            }
-        }
-        /* if we deal with intensity compensation we need to scale source blocks */
-        if (use_ic) {
-            int i, j;
-            uint8_t *src, *src2;
-
-            src  = srcU;
-            src2 = srcV;
-            for (j = 0; j < 9; j++) {
-                int f = v->field_mode ? chroma_ref_type : ((j + uvsrc_y) & 1);
-                for (i = 0; i < 9; i++) {
-                    src[i]  = lutuv[f][src[i]];
-                    src2[i] = lutuv[f][src2[i]];
-                }
-                src  += s->uvlinesize;
-                src2 += s->uvlinesize;
-            }
-        }
-    }
-
-    /* Chroma MC always uses qpel bilinear */
-    uvmx = (uvmx & 3) << 1;
-    uvmy = (uvmy & 3) << 1;
-    if (!v->rnd) {
-        h264chroma->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
-        h264chroma->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
-    } else {
-        v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
-        v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
-    }
-}
-
-/** Do motion compensation for 4-MV interlaced frame chroma macroblock (both U and V)
- */
-static void vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg)
-{
-    MpegEncContext *s = &v->s;
-    H264ChromaContext *h264chroma = &v->h264chroma;
-    uint8_t *srcU, *srcV;
-    int uvsrc_x, uvsrc_y;
-    int uvmx_field[4], uvmy_field[4];
-    int i, off, tx, ty;
-    int fieldmv = v->blk_mv_type[s->block_index[0]];
-    static const int s_rndtblfield[16] = { 0, 0, 1, 2, 4, 4, 5, 6, 2, 2, 3, 8, 6, 6, 7, 12 };
-    int v_dist = fieldmv ? 1 : 4; // vertical offset for lower sub-blocks
-    int v_edge_pos = s->v_edge_pos >> 1;
-    int use_ic;
-    uint8_t (*lutuv)[256];
-
-    if (s->flags & CODEC_FLAG_GRAY)
-        return;
-
-    for (i = 0; i < 4; i++) {
-        int d = i < 2 ? dir: dir2;
-        tx = s->mv[d][i][0];
-        uvmx_field[i] = (tx + ((tx & 3) == 3)) >> 1;
-        ty = s->mv[d][i][1];
-        if (fieldmv)
-            uvmy_field[i] = (ty >> 4) * 8 + s_rndtblfield[ty & 0xF];
-        else
-            uvmy_field[i] = (ty + ((ty & 3) == 3)) >> 1;
-    }
-
-    for (i = 0; i < 4; i++) {
-        off = (i & 1) * 4 + ((i & 2) ? v_dist * s->uvlinesize : 0);
-        uvsrc_x = s->mb_x * 8 +  (i & 1) * 4           + (uvmx_field[i] >> 2);
-        uvsrc_y = s->mb_y * 8 + ((i & 2) ? v_dist : 0) + (uvmy_field[i] >> 2);
-        // FIXME: implement proper pull-back (see vc1cropmv.c, vc1CROPMV_ChromaPullBack())
-        uvsrc_x = av_clip(uvsrc_x, -8, s->avctx->coded_width  >> 1);
-        uvsrc_y = av_clip(uvsrc_y, -8, s->avctx->coded_height >> 1);
-        if (i < 2 ? dir : dir2) {
-            srcU = s->next_picture.f.data[1] + uvsrc_y * s->uvlinesize + uvsrc_x;
-            srcV = s->next_picture.f.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x;
-            lutuv  = v->next_lutuv;
-            use_ic = v->next_use_ic;
-        } else {
-            srcU = s->last_picture.f.data[1] + uvsrc_y * s->uvlinesize + uvsrc_x;
-            srcV = s->last_picture.f.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x;
-            lutuv  = v->last_lutuv;
-            use_ic = v->last_use_ic;
-        }
-        uvmx_field[i] = (uvmx_field[i] & 3) << 1;
-        uvmy_field[i] = (uvmy_field[i] & 3) << 1;
-
-        if (fieldmv && !(uvsrc_y & 1))
-            v_edge_pos--;
-        if (fieldmv && (uvsrc_y & 1) && uvsrc_y < 2)
-            uvsrc_y--;
-        if (use_ic
-            || s->h_edge_pos < 10 || v_edge_pos < (5 << fieldmv)
-            || (unsigned)uvsrc_x > (s->h_edge_pos >> 1) - 5
-            || (unsigned)uvsrc_y > v_edge_pos - (5 << fieldmv)) {
-            s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcU,
-                                     s->uvlinesize, s->uvlinesize,
-                                     5, (5 << fieldmv), uvsrc_x, uvsrc_y,
-                                     s->h_edge_pos >> 1, v_edge_pos);
-            s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, srcV,
-                                     s->uvlinesize, s->uvlinesize,
-                                     5, (5 << fieldmv), uvsrc_x, uvsrc_y,
-                                     s->h_edge_pos >> 1, v_edge_pos);
-            srcU = s->edge_emu_buffer;
-            srcV = s->edge_emu_buffer + 16;
-
-            /* if we deal with intensity compensation we need to scale source blocks */
-            if (use_ic) {
-                int i, j;
-                uint8_t *src, *src2;
-
-                src  = srcU;
-                src2 = srcV;
-                for (j = 0; j < 5; j++) {
-                    int f = (uvsrc_y + (j << fieldmv)) & 1;
-                    for (i = 0; i < 5; i++) {
-                        src[i]  = lutuv[f][src[i]];
-                        src2[i] = lutuv[f][src2[i]];
-                    }
-                    src  += s->uvlinesize << fieldmv;
-                    src2 += s->uvlinesize << fieldmv;
-                }
-            }
-        }
-        if (avg) {
-            if (!v->rnd) {
-                h264chroma->avg_h264_chroma_pixels_tab[1](s->dest[1] + off, srcU, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]);
-                h264chroma->avg_h264_chroma_pixels_tab[1](s->dest[2] + off, srcV, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]);
-            } else {
-                v->vc1dsp.avg_no_rnd_vc1_chroma_pixels_tab[1](s->dest[1] + off, srcU, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]);
-                v->vc1dsp.avg_no_rnd_vc1_chroma_pixels_tab[1](s->dest[2] + off, srcV, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]);
-            }
-        } else {
-            if (!v->rnd) {
-                h264chroma->put_h264_chroma_pixels_tab[1](s->dest[1] + off, srcU, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]);
-                h264chroma->put_h264_chroma_pixels_tab[1](s->dest[2] + off, srcV, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]);
-            } else {
-                v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[1](s->dest[1] + off, srcU, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]);
-                v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[1](s->dest[2] + off, srcV, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]);
-            }
-        }
-    }
-}
-
-/***********************************************************************/
-/**
- * @name VC-1 Block-level functions
- * @see 7.1.4, p91 and 8.1.1.7, p(1)04
- * @{
- */
-
-/**
- * @def GET_MQUANT
- * @brief Get macroblock-level quantizer scale
- */
-#define GET_MQUANT()                                           \
-    if (v->dquantfrm) {                                        \
-        int edges = 0;                                         \
-        if (v->dqprofile == DQPROFILE_ALL_MBS) {               \
-            if (v->dqbilevel) {                                \
-                mquant = (get_bits1(gb)) ? v->altpq : v->pq;   \
-            } else {                                           \
-                mqdiff = get_bits(gb, 3);                      \
-                if (mqdiff != 7)                               \
-                    mquant = v->pq + mqdiff;                   \
-                else                                           \
-                    mquant = get_bits(gb, 5);                  \
-            }                                                  \
-        }                                                      \
-        if (v->dqprofile == DQPROFILE_SINGLE_EDGE)             \
-            edges = 1 << v->dqsbedge;                          \
-        else if (v->dqprofile == DQPROFILE_DOUBLE_EDGES)       \
-            edges = (3 << v->dqsbedge) % 15;                   \
-        else if (v->dqprofile == DQPROFILE_FOUR_EDGES)         \
-            edges = 15;                                        \
-        if ((edges&1) && !s->mb_x)                             \
-            mquant = v->altpq;                                 \
-        if ((edges&2) && s->first_slice_line)                  \
-            mquant = v->altpq;                                 \
-        if ((edges&4) && s->mb_x == (s->mb_width - 1))         \
-            mquant = v->altpq;                                 \
-        if ((edges&8) && s->mb_y == (s->mb_height - 1))        \
-            mquant = v->altpq;                                 \
-        if (!mquant || mquant > 31) {                          \
-            av_log(v->s.avctx, AV_LOG_ERROR,                   \
-                   "Overriding invalid mquant %d\n", mquant);  \
-            mquant = 1;                                        \
-        }                                                      \
-    }
-
-/**
- * @def GET_MVDATA(_dmv_x, _dmv_y)
- * @brief Get MV differentials
- * @see MVDATA decoding from 8.3.5.2, p(1)20
- * @param _dmv_x Horizontal differential for decoded MV
- * @param _dmv_y Vertical differential for decoded MV
- */
-#define GET_MVDATA(_dmv_x, _dmv_y)                                      \
-    index = 1 + get_vlc2(gb, ff_vc1_mv_diff_vlc[s->mv_table_index].table, \
-                         VC1_MV_DIFF_VLC_BITS, 2);                      \
-    if (index > 36) {                                                   \
-        mb_has_coeffs = 1;                                              \
-        index -= 37;                                                    \
-    } else                                                              \
-        mb_has_coeffs = 0;                                              \
-    s->mb_intra = 0;                                                    \
-    if (!index) {                                                       \
-        _dmv_x = _dmv_y = 0;                                            \
-    } else if (index == 35) {                                           \
-        _dmv_x = get_bits(gb, v->k_x - 1 + s->quarter_sample);          \
-        _dmv_y = get_bits(gb, v->k_y - 1 + s->quarter_sample);          \
-    } else if (index == 36) {                                           \
-        _dmv_x = 0;                                                     \
-        _dmv_y = 0;                                                     \
-        s->mb_intra = 1;                                                \
-    } else {                                                            \
-        index1 = index % 6;                                             \
-        if (!s->quarter_sample && index1 == 5) val = 1;                 \
-        else                                   val = 0;                 \
-        if (size_table[index1] - val > 0)                               \
-            val = get_bits(gb, size_table[index1] - val);               \
-        else                                   val = 0;                 \
-        sign = 0 - (val&1);                                             \
-        _dmv_x = (sign ^ ((val>>1) + offset_table[index1])) - sign;     \
-                                                                        \
-        index1 = index / 6;                                             \
-        if (!s->quarter_sample && index1 == 5) val = 1;                 \
-        else                                   val = 0;                 \
-        if (size_table[index1] - val > 0)                               \
-            val = get_bits(gb, size_table[index1] - val);               \
-        else                                   val = 0;                 \
-        sign = 0 - (val & 1);                                           \
-        _dmv_y = (sign ^ ((val >> 1) + offset_table[index1])) - sign;   \
-    }
-
-static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x,
-                                                   int *dmv_y, int *pred_flag)
-{
-    int index, index1;
-    int extend_x = 0, extend_y = 0;
-    GetBitContext *gb = &v->s.gb;
-    int bits, esc;
-    int val, sign;
-    const int* offs_tab;
-
-    if (v->numref) {
-        bits = VC1_2REF_MVDATA_VLC_BITS;
-        esc  = 125;
-    } else {
-        bits = VC1_1REF_MVDATA_VLC_BITS;
-        esc  = 71;
-    }
-    switch (v->dmvrange) {
-    case 1:
-        extend_x = 1;
-        break;
-    case 2:
-        extend_y = 1;
-        break;
-    case 3:
-        extend_x = extend_y = 1;
-        break;
-    }
-    index = get_vlc2(gb, v->imv_vlc->table, bits, 3);
-    if (index == esc) {
-        *dmv_x = get_bits(gb, v->k_x);
-        *dmv_y = get_bits(gb, v->k_y);
-        if (v->numref) {
-            if (pred_flag) {
-                *pred_flag = *dmv_y & 1;
-                *dmv_y     = (*dmv_y + *pred_flag) >> 1;
-            } else {
-                *dmv_y     = (*dmv_y + (*dmv_y & 1)) >> 1;
-            }
-        }
-    }
-    else {
-        if (extend_x)
-            offs_tab = offset_table2;
-        else
-            offs_tab = offset_table1;
-        index1 = (index + 1) % 9;
-        if (index1 != 0) {
-            val    = get_bits(gb, index1 + extend_x);
-            sign   = 0 -(val & 1);
-            *dmv_x = (sign ^ ((val >> 1) + offs_tab[index1])) - sign;
-        } else
-            *dmv_x = 0;
-        if (extend_y)
-            offs_tab = offset_table2;
-        else
-            offs_tab = offset_table1;
-        index1 = (index + 1) / 9;
-        if (index1 > v->numref) {
-            val    = get_bits(gb, (index1 + (extend_y << v->numref)) >> v->numref);
-            sign   = 0 - (val & 1);
-            *dmv_y = (sign ^ ((val >> 1) + offs_tab[index1 >> v->numref])) - sign;
-        } else
-            *dmv_y = 0;
-        if (v->numref && pred_flag)
-            *pred_flag = index1 & 1;
-    }
-}
-
-static av_always_inline int scaleforsame_x(VC1Context *v, int n /* MV */, int dir)
-{
-    int scaledvalue, refdist;
-    int scalesame1, scalesame2;
-    int scalezone1_x, zone1offset_x;
-    int table_index = dir ^ v->second_field;
-
-    if (v->s.pict_type != AV_PICTURE_TYPE_B)
-        refdist = v->refdist;
-    else
-        refdist = dir ? v->brfd : v->frfd;
-    if (refdist > 3)
-        refdist = 3;
-    scalesame1    = ff_vc1_field_mvpred_scales[table_index][1][refdist];
-    scalesame2    = ff_vc1_field_mvpred_scales[table_index][2][refdist];
-    scalezone1_x  = ff_vc1_field_mvpred_scales[table_index][3][refdist];
-    zone1offset_x = ff_vc1_field_mvpred_scales[table_index][5][refdist];
-
-    if (FFABS(n) > 255)
-        scaledvalue = n;
-    else {
-        if (FFABS(n) < scalezone1_x)
-            scaledvalue = (n * scalesame1) >> 8;
-        else {
-            if (n < 0)
-                scaledvalue = ((n * scalesame2) >> 8) - zone1offset_x;
-            else
-                scaledvalue = ((n * scalesame2) >> 8) + zone1offset_x;
-        }
-    }
-    return av_clip(scaledvalue, -v->range_x, v->range_x - 1);
-}
-
-static av_always_inline int scaleforsame_y(VC1Context *v, int i, int n /* MV */, int dir)
-{
-    int scaledvalue, refdist;
-    int scalesame1, scalesame2;
-    int scalezone1_y, zone1offset_y;
-    int table_index = dir ^ v->second_field;
-
-    if (v->s.pict_type != AV_PICTURE_TYPE_B)
-        refdist = v->refdist;
-    else
-        refdist = dir ? v->brfd : v->frfd;
-    if (refdist > 3)
-        refdist = 3;
-    scalesame1    = ff_vc1_field_mvpred_scales[table_index][1][refdist];
-    scalesame2    = ff_vc1_field_mvpred_scales[table_index][2][refdist];
-    scalezone1_y  = ff_vc1_field_mvpred_scales[table_index][4][refdist];
-    zone1offset_y = ff_vc1_field_mvpred_scales[table_index][6][refdist];
-
-    if (FFABS(n) > 63)
-        scaledvalue = n;
-    else {
-        if (FFABS(n) < scalezone1_y)
-            scaledvalue = (n * scalesame1) >> 8;
-        else {
-            if (n < 0)
-                scaledvalue = ((n * scalesame2) >> 8) - zone1offset_y;
-            else
-                scaledvalue = ((n * scalesame2) >> 8) + zone1offset_y;
-        }
-    }
-
-    if (v->cur_field_type && !v->ref_field_type[dir])
-        return av_clip(scaledvalue, -v->range_y / 2 + 1, v->range_y / 2);
-    else
-        return av_clip(scaledvalue, -v->range_y / 2, v->range_y / 2 - 1);
-}
-
-static av_always_inline int scaleforopp_x(VC1Context *v, int n /* MV */)
-{
-    int scalezone1_x, zone1offset_x;
-    int scaleopp1, scaleopp2, brfd;
-    int scaledvalue;
-
-    brfd = FFMIN(v->brfd, 3);
-    scalezone1_x  = ff_vc1_b_field_mvpred_scales[3][brfd];
-    zone1offset_x = ff_vc1_b_field_mvpred_scales[5][brfd];
-    scaleopp1     = ff_vc1_b_field_mvpred_scales[1][brfd];
-    scaleopp2     = ff_vc1_b_field_mvpred_scales[2][brfd];
-
-    if (FFABS(n) > 255)
-        scaledvalue = n;
-    else {
-        if (FFABS(n) < scalezone1_x)
-            scaledvalue = (n * scaleopp1) >> 8;
-        else {
-            if (n < 0)
-                scaledvalue = ((n * scaleopp2) >> 8) - zone1offset_x;
-            else
-                scaledvalue = ((n * scaleopp2) >> 8) + zone1offset_x;
-        }
-    }
-    return av_clip(scaledvalue, -v->range_x, v->range_x - 1);
-}
-
-static av_always_inline int scaleforopp_y(VC1Context *v, int n /* MV */, int dir)
-{
-    int scalezone1_y, zone1offset_y;
-    int scaleopp1, scaleopp2, brfd;
-    int scaledvalue;
-
-    brfd = FFMIN(v->brfd, 3);
-    scalezone1_y  = ff_vc1_b_field_mvpred_scales[4][brfd];
-    zone1offset_y = ff_vc1_b_field_mvpred_scales[6][brfd];
-    scaleopp1     = ff_vc1_b_field_mvpred_scales[1][brfd];
-    scaleopp2     = ff_vc1_b_field_mvpred_scales[2][brfd];
-
-    if (FFABS(n) > 63)
-        scaledvalue = n;
-    else {
-        if (FFABS(n) < scalezone1_y)
-            scaledvalue = (n * scaleopp1) >> 8;
-        else {
-            if (n < 0)
-                scaledvalue = ((n * scaleopp2) >> 8) - zone1offset_y;
-            else
-                scaledvalue = ((n * scaleopp2) >> 8) + zone1offset_y;
-        }
-    }
-    if (v->cur_field_type && !v->ref_field_type[dir]) {
-        return av_clip(scaledvalue, -v->range_y / 2 + 1, v->range_y / 2);
-    } else {
-        return av_clip(scaledvalue, -v->range_y / 2, v->range_y / 2 - 1);
-    }
-}
-
-static av_always_inline int scaleforsame(VC1Context *v, int i, int n /* MV */,
-                                         int dim, int dir)
-{
-    int brfd, scalesame;
-    int hpel = 1 - v->s.quarter_sample;
-
-    n >>= hpel;
-    if (v->s.pict_type != AV_PICTURE_TYPE_B || v->second_field || !dir) {
-        if (dim)
-            n = scaleforsame_y(v, i, n, dir) << hpel;
-        else
-            n = scaleforsame_x(v, n, dir) << hpel;
-        return n;
-    }
-    brfd      = FFMIN(v->brfd, 3);
-    scalesame = ff_vc1_b_field_mvpred_scales[0][brfd];
-
-    n = (n * scalesame >> 8) << hpel;
-    return n;
-}
-
-static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */,
-                                        int dim, int dir)
-{
-    int refdist, scaleopp;
-    int hpel = 1 - v->s.quarter_sample;
-
-    n >>= hpel;
-    if (v->s.pict_type == AV_PICTURE_TYPE_B && !v->second_field && dir == 1) {
-        if (dim)
-            n = scaleforopp_y(v, n, dir) << hpel;
-        else
-            n = scaleforopp_x(v, n) << hpel;
-        return n;
-    }
-    if (v->s.pict_type != AV_PICTURE_TYPE_B)
-        refdist = FFMIN(v->refdist, 3);
-    else
-        refdist = dir ? v->brfd : v->frfd;
-    scaleopp = ff_vc1_field_mvpred_scales[dir ^ v->second_field][0][refdist];
-
-    n = (n * scaleopp >> 8) << hpel;
-    return n;
-}
-
-/** Predict and set motion vector
- */
-static inline void vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y,
-                               int mv1, int r_x, int r_y, uint8_t* is_intra,
-                               int pred_flag, int dir)
-{
-    MpegEncContext *s = &v->s;
-    int xy, wrap, off = 0;
-    int16_t *A, *B, *C;
-    int px, py;
-    int sum;
-    int mixedmv_pic, num_samefield = 0, num_oppfield = 0;
-    int opposite, a_f, b_f, c_f;
-    int16_t field_predA[2];
-    int16_t field_predB[2];
-    int16_t field_predC[2];
-    int a_valid, b_valid, c_valid;
-    int hybridmv_thresh, y_bias = 0;
-
-    if (v->mv_mode == MV_PMODE_MIXED_MV ||
-        ((v->mv_mode == MV_PMODE_INTENSITY_COMP) && (v->mv_mode2 == MV_PMODE_MIXED_MV)))
-        mixedmv_pic = 1;
-    else
-        mixedmv_pic = 0;
-    /* scale MV difference to be quad-pel */
-    dmv_x <<= 1 - s->quarter_sample;
-    dmv_y <<= 1 - s->quarter_sample;
-
-    wrap = s->b8_stride;
-    xy   = s->block_index[n];
-
-    if (s->mb_intra) {
-        s->mv[0][n][0] = s->current_picture.motion_val[0][xy + v->blocks_off][0] = 0;
-        s->mv[0][n][1] = s->current_picture.motion_val[0][xy + v->blocks_off][1] = 0;
-        s->current_picture.motion_val[1][xy + v->blocks_off][0] = 0;
-        s->current_picture.motion_val[1][xy + v->blocks_off][1] = 0;
-        if (mv1) { /* duplicate motion data for 1-MV block */
-            s->current_picture.motion_val[0][xy + 1 + v->blocks_off][0]        = 0;
-            s->current_picture.motion_val[0][xy + 1 + v->blocks_off][1]        = 0;
-            s->current_picture.motion_val[0][xy + wrap + v->blocks_off][0]     = 0;
-            s->current_picture.motion_val[0][xy + wrap + v->blocks_off][1]     = 0;
-            s->current_picture.motion_val[0][xy + wrap + 1 + v->blocks_off][0] = 0;
-            s->current_picture.motion_val[0][xy + wrap + 1 + v->blocks_off][1] = 0;
-            v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0;
-            s->current_picture.motion_val[1][xy + 1 + v->blocks_off][0]        = 0;
-            s->current_picture.motion_val[1][xy + 1 + v->blocks_off][1]        = 0;
-            s->current_picture.motion_val[1][xy + wrap][0]                     = 0;
-            s->current_picture.motion_val[1][xy + wrap + v->blocks_off][1]     = 0;
-            s->current_picture.motion_val[1][xy + wrap + 1 + v->blocks_off][0] = 0;
-            s->current_picture.motion_val[1][xy + wrap + 1 + v->blocks_off][1] = 0;
-        }
-        return;
-    }
-
-    C = s->current_picture.motion_val[dir][xy -    1 + v->blocks_off];
-    A = s->current_picture.motion_val[dir][xy - wrap + v->blocks_off];
-    if (mv1) {
-        if (v->field_mode && mixedmv_pic)
-            off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2;
-        else
-            off = (s->mb_x == (s->mb_width - 1)) ? -1 : 2;
-    } else {
-        //in 4-MV mode different blocks have different B predictor position
-        switch (n) {
-        case 0:
-            off = (s->mb_x > 0) ? -1 : 1;
-            break;
-        case 1:
-            off = (s->mb_x == (s->mb_width - 1)) ? -1 : 1;
-            break;
-        case 2:
-            off = 1;
-            break;
-        case 3:
-            off = -1;
-        }
-    }
-    B = s->current_picture.motion_val[dir][xy - wrap + off + v->blocks_off];
-
-    a_valid = !s->first_slice_line || (n == 2 || n == 3);
-    b_valid = a_valid && (s->mb_width > 1);
-    c_valid = s->mb_x || (n == 1 || n == 3);
-    if (v->field_mode) {
-        a_valid = a_valid && !is_intra[xy - wrap];
-        b_valid = b_valid && !is_intra[xy - wrap + off];
-        c_valid = c_valid && !is_intra[xy - 1];
-    }
-
-    if (a_valid) {
-        a_f = v->mv_f[dir][xy - wrap + v->blocks_off];
-        num_oppfield  += a_f;
-        num_samefield += 1 - a_f;
-        field_predA[0] = A[0];
-        field_predA[1] = A[1];
-    } else {
-        field_predA[0] = field_predA[1] = 0;
-        a_f = 0;
-    }
-    if (b_valid) {
-        b_f = v->mv_f[dir][xy - wrap + off + v->blocks_off];
-        num_oppfield  += b_f;
-        num_samefield += 1 - b_f;
-        field_predB[0] = B[0];
-        field_predB[1] = B[1];
-    } else {
-        field_predB[0] = field_predB[1] = 0;
-        b_f = 0;
-    }
-    if (c_valid) {
-        c_f = v->mv_f[dir][xy - 1 + v->blocks_off];
-        num_oppfield  += c_f;
-        num_samefield += 1 - c_f;
-        field_predC[0] = C[0];
-        field_predC[1] = C[1];
-    } else {
-        field_predC[0] = field_predC[1] = 0;
-        c_f = 0;
-    }
-
-    if (v->field_mode) {
-        if (!v->numref)
-            // REFFIELD determines if the last field or the second-last field is
-            // to be used as reference
-            opposite = 1 - v->reffield;
-        else {
-            if (num_samefield <= num_oppfield)
-                opposite = 1 - pred_flag;
-            else
-                opposite = pred_flag;
-        }
-    } else
-        opposite = 0;
-    if (opposite) {
-        if (a_valid && !a_f) {
-            field_predA[0] = scaleforopp(v, field_predA[0], 0, dir);
-            field_predA[1] = scaleforopp(v, field_predA[1], 1, dir);
-        }
-        if (b_valid && !b_f) {
-            field_predB[0] = scaleforopp(v, field_predB[0], 0, dir);
-            field_predB[1] = scaleforopp(v, field_predB[1], 1, dir);
-        }
-        if (c_valid && !c_f) {
-            field_predC[0] = scaleforopp(v, field_predC[0], 0, dir);
-            field_predC[1] = scaleforopp(v, field_predC[1], 1, dir);
-        }
-        v->mv_f[dir][xy + v->blocks_off] = 1;
-        v->ref_field_type[dir] = !v->cur_field_type;
-    } else {
-        if (a_valid && a_f) {
-            field_predA[0] = scaleforsame(v, n, field_predA[0], 0, dir);
-            field_predA[1] = scaleforsame(v, n, field_predA[1], 1, dir);
-        }
-        if (b_valid && b_f) {
-            field_predB[0] = scaleforsame(v, n, field_predB[0], 0, dir);
-            field_predB[1] = scaleforsame(v, n, field_predB[1], 1, dir);
-        }
-        if (c_valid && c_f) {
-            field_predC[0] = scaleforsame(v, n, field_predC[0], 0, dir);
-            field_predC[1] = scaleforsame(v, n, field_predC[1], 1, dir);
-        }
-        v->mv_f[dir][xy + v->blocks_off] = 0;
-        v->ref_field_type[dir] = v->cur_field_type;
-    }
-
-    if (a_valid) {
-        px = field_predA[0];
-        py = field_predA[1];
-    } else if (c_valid) {
-        px = field_predC[0];
-        py = field_predC[1];
-    } else if (b_valid) {
-        px = field_predB[0];
-        py = field_predB[1];
-    } else {
-        px = 0;
-        py = 0;
-    }
-
-    if (num_samefield + num_oppfield > 1) {
-        px = mid_pred(field_predA[0], field_predB[0], field_predC[0]);
-        py = mid_pred(field_predA[1], field_predB[1], field_predC[1]);
-    }
-
-    /* Pullback MV as specified in 8.3.5.3.4 */
-    if (!v->field_mode) {
-        int qx, qy, X, Y;
-        qx = (s->mb_x << 6) + ((n == 1 || n == 3) ? 32 : 0);
-        qy = (s->mb_y << 6) + ((n == 2 || n == 3) ? 32 : 0);
-        X  = (s->mb_width  << 6) - 4;
-        Y  = (s->mb_height << 6) - 4;
-        if (mv1) {
-            if (qx + px < -60) px = -60 - qx;
-            if (qy + py < -60) py = -60 - qy;
-        } else {
-            if (qx + px < -28) px = -28 - qx;
-            if (qy + py < -28) py = -28 - qy;
-        }
-        if (qx + px > X) px = X - qx;
-        if (qy + py > Y) py = Y - qy;
-    }
-
-    if (!v->field_mode || s->pict_type != AV_PICTURE_TYPE_B) {
-        /* Calculate hybrid prediction as specified in 8.3.5.3.5 (also 10.3.5.4.3.5) */
-        hybridmv_thresh = 32;
-        if (a_valid && c_valid) {
-            if (is_intra[xy - wrap])
-                sum = FFABS(px) + FFABS(py);
-            else
-                sum = FFABS(px - field_predA[0]) + FFABS(py - field_predA[1]);
-            if (sum > hybridmv_thresh) {
-                if (get_bits1(&s->gb)) {     // read HYBRIDPRED bit
-                    px = field_predA[0];
-                    py = field_predA[1];
-                } else {
-                    px = field_predC[0];
-                    py = field_predC[1];
-                }
-            } else {
-                if (is_intra[xy - 1])
-                    sum = FFABS(px) + FFABS(py);
-                else
-                    sum = FFABS(px - field_predC[0]) + FFABS(py - field_predC[1]);
-                if (sum > hybridmv_thresh) {
-                    if (get_bits1(&s->gb)) {
-                        px = field_predA[0];
-                        py = field_predA[1];
-                    } else {
-                        px = field_predC[0];
-                        py = field_predC[1];
-                    }
-                }
-            }
-        }
-    }
-
-    if (v->field_mode && v->numref)
-        r_y >>= 1;
-    if (v->field_mode && v->cur_field_type && v->ref_field_type[dir] == 0)
-        y_bias = 1;
-    /* store MV using signed modulus of MV range defined in 4.11 */
-    s->mv[dir][n][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x;
-    s->mv[dir][n][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1] = ((py + dmv_y + r_y - y_bias) & ((r_y << 1) - 1)) - r_y + y_bias;
-    if (mv1) { /* duplicate motion data for 1-MV block */
-        s->current_picture.motion_val[dir][xy +    1 +     v->blocks_off][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0];
-        s->current_picture.motion_val[dir][xy +    1 +     v->blocks_off][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1];
-        s->current_picture.motion_val[dir][xy + wrap +     v->blocks_off][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0];
-        s->current_picture.motion_val[dir][xy + wrap +     v->blocks_off][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1];
-        s->current_picture.motion_val[dir][xy + wrap + 1 + v->blocks_off][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0];
-        s->current_picture.motion_val[dir][xy + wrap + 1 + v->blocks_off][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1];
-        v->mv_f[dir][xy +    1 + v->blocks_off] = v->mv_f[dir][xy +            v->blocks_off];
-        v->mv_f[dir][xy + wrap + v->blocks_off] = v->mv_f[dir][xy + wrap + 1 + v->blocks_off] = v->mv_f[dir][xy + v->blocks_off];
-    }
-}
-
-/** Predict and set motion vector for interlaced frame picture MBs
- */
-static inline void vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y,
-                                     int mvn, int r_x, int r_y, uint8_t* is_intra, int dir)
-{
-    MpegEncContext *s = &v->s;
-    int xy, wrap, off = 0;
-    int A[2], B[2], C[2];
-    int px, py;
-    int a_valid = 0, b_valid = 0, c_valid = 0;
-    int field_a, field_b, field_c; // 0: same, 1: opposit
-    int total_valid, num_samefield, num_oppfield;
-    int pos_c, pos_b, n_adj;
-
-    wrap = s->b8_stride;
-    xy = s->block_index[n];
-
-    if (s->mb_intra) {
-        s->mv[0][n][0] = s->current_picture.motion_val[0][xy][0] = 0;
-        s->mv[0][n][1] = s->current_picture.motion_val[0][xy][1] = 0;
-        s->current_picture.motion_val[1][xy][0] = 0;
-        s->current_picture.motion_val[1][xy][1] = 0;
-        if (mvn == 1) { /* duplicate motion data for 1-MV block */
-            s->current_picture.motion_val[0][xy + 1][0]        = 0;
-            s->current_picture.motion_val[0][xy + 1][1]        = 0;
-            s->current_picture.motion_val[0][xy + wrap][0]     = 0;
-            s->current_picture.motion_val[0][xy + wrap][1]     = 0;
-            s->current_picture.motion_val[0][xy + wrap + 1][0] = 0;
-            s->current_picture.motion_val[0][xy + wrap + 1][1] = 0;
-            v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0;
-            s->current_picture.motion_val[1][xy + 1][0]        = 0;
-            s->current_picture.motion_val[1][xy + 1][1]        = 0;
-            s->current_picture.motion_val[1][xy + wrap][0]     = 0;
-            s->current_picture.motion_val[1][xy + wrap][1]     = 0;
-            s->current_picture.motion_val[1][xy + wrap + 1][0] = 0;
-            s->current_picture.motion_val[1][xy + wrap + 1][1] = 0;
-        }
-        return;
-    }
-
-    off = ((n == 0) || (n == 1)) ? 1 : -1;
-    /* predict A */
-    if (s->mb_x || (n == 1) || (n == 3)) {
-        if ((v->blk_mv_type[xy]) // current block (MB) has a field MV
-            || (!v->blk_mv_type[xy] && !v->blk_mv_type[xy - 1])) { // or both have frame MV
-            A[0] = s->current_picture.motion_val[dir][xy - 1][0];
-            A[1] = s->current_picture.motion_val[dir][xy - 1][1];
-            a_valid = 1;
-        } else { // current block has frame mv and cand. has field MV (so average)
-            A[0] = (s->current_picture.motion_val[dir][xy - 1][0]
-                    + s->current_picture.motion_val[dir][xy - 1 + off * wrap][0] + 1) >> 1;
-            A[1] = (s->current_picture.motion_val[dir][xy - 1][1]
-                    + s->current_picture.motion_val[dir][xy - 1 + off * wrap][1] + 1) >> 1;
-            a_valid = 1;
-        }
-        if (!(n & 1) && v->is_intra[s->mb_x - 1]) {
-            a_valid = 0;
-            A[0] = A[1] = 0;
-        }
-    } else
-        A[0] = A[1] = 0;
-    /* Predict B and C */
-    B[0] = B[1] = C[0] = C[1] = 0;
-    if (n == 0 || n == 1 || v->blk_mv_type[xy]) {
-        if (!s->first_slice_line) {
-            if (!v->is_intra[s->mb_x - s->mb_stride]) {
-                b_valid = 1;
-                n_adj   = n | 2;
-                pos_b   = s->block_index[n_adj] - 2 * wrap;
-                if (v->blk_mv_type[pos_b] && v->blk_mv_type[xy]) {
-                    n_adj = (n & 2) | (n & 1);
-                }
-                B[0] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap][0];
-                B[1] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap][1];
-                if (v->blk_mv_type[pos_b] && !v->blk_mv_type[xy]) {
-                    B[0] = (B[0] + s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][0] + 1) >> 1;
-                    B[1] = (B[1] + s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][1] + 1) >> 1;
-                }
-            }
-            if (s->mb_width > 1) {
-                if (!v->is_intra[s->mb_x - s->mb_stride + 1]) {
-                    c_valid = 1;
-                    n_adj   = 2;
-                    pos_c   = s->block_index[2] - 2 * wrap + 2;
-                    if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) {
-                        n_adj = n & 2;
-                    }
-                    C[0] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][0];
-                    C[1] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][1];
-                    if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) {
-                        C[0] = (1 + C[0] + (s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][0])) >> 1;
-                        C[1] = (1 + C[1] + (s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][1])) >> 1;
-                    }
-                    if (s->mb_x == s->mb_width - 1) {
-                        if (!v->is_intra[s->mb_x - s->mb_stride - 1]) {
-                            c_valid = 1;
-                            n_adj   = 3;
-                            pos_c   = s->block_index[3] - 2 * wrap - 2;
-                            if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) {
-                                n_adj = n | 1;
-                            }
-                            C[0] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][0];
-                            C[1] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][1];
-                            if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) {
-                                C[0] = (1 + C[0] + s->current_picture.motion_val[dir][s->block_index[1] - 2 * wrap - 2][0]) >> 1;
-                                C[1] = (1 + C[1] + s->current_picture.motion_val[dir][s->block_index[1] - 2 * wrap - 2][1]) >> 1;
-                            }
-                        } else
-                            c_valid = 0;
-                    }
-                }
-            }
-        }
-    } else {
-        pos_b   = s->block_index[1];
-        b_valid = 1;
-        B[0]    = s->current_picture.motion_val[dir][pos_b][0];
-        B[1]    = s->current_picture.motion_val[dir][pos_b][1];
-        pos_c   = s->block_index[0];
-        c_valid = 1;
-        C[0]    = s->current_picture.motion_val[dir][pos_c][0];
-        C[1]    = s->current_picture.motion_val[dir][pos_c][1];
-    }
-
-    total_valid = a_valid + b_valid + c_valid;
-    // check if predictor A is out of bounds
-    if (!s->mb_x && !(n == 1 || n == 3)) {
-        A[0] = A[1] = 0;
-    }
-    // check if predictor B is out of bounds
-    if ((s->first_slice_line && v->blk_mv_type[xy]) || (s->first_slice_line && !(n & 2))) {
-        B[0] = B[1] = C[0] = C[1] = 0;
-    }
-    if (!v->blk_mv_type[xy]) {
-        if (s->mb_width == 1) {
-            px = B[0];
-            py = B[1];
-        } else {
-            if (total_valid >= 2) {
-                px = mid_pred(A[0], B[0], C[0]);
-                py = mid_pred(A[1], B[1], C[1]);
-            } else if (total_valid) {
-                if (a_valid) { px = A[0]; py = A[1]; }
-                if (b_valid) { px = B[0]; py = B[1]; }
-                if (c_valid) { px = C[0]; py = C[1]; }
-            } else
-                px = py = 0;
-        }
-    } else {
-        if (a_valid)
-            field_a = (A[1] & 4) ? 1 : 0;
-        else
-            field_a = 0;
-        if (b_valid)
-            field_b = (B[1] & 4) ? 1 : 0;
-        else
-            field_b = 0;
-        if (c_valid)
-            field_c = (C[1] & 4) ? 1 : 0;
-        else
-            field_c = 0;
-
-        num_oppfield  = field_a + field_b + field_c;
-        num_samefield = total_valid - num_oppfield;
-        if (total_valid == 3) {
-            if ((num_samefield == 3) || (num_oppfield == 3)) {
-                px = mid_pred(A[0], B[0], C[0]);
-                py = mid_pred(A[1], B[1], C[1]);
-            } else if (num_samefield >= num_oppfield) {
-                /* take one MV from same field set depending on priority
-                the check for B may not be necessary */
-                px = !field_a ? A[0] : B[0];
-                py = !field_a ? A[1] : B[1];
-            } else {
-                px =  field_a ? A[0] : B[0];
-                py =  field_a ? A[1] : B[1];
-            }
-        } else if (total_valid == 2) {
-            if (num_samefield >= num_oppfield) {
-                if (!field_a && a_valid) {
-                    px = A[0];
-                    py = A[1];
-                } else if (!field_b && b_valid) {
-                    px = B[0];
-                    py = B[1];
-                } else if (c_valid) {
-                    px = C[0];
-                    py = C[1];
-                } else px = py = 0;
-            } else {
-                if (field_a && a_valid) {
-                    px = A[0];
-                    py = A[1];
-                } else if (field_b && b_valid) {
-                    px = B[0];
-                    py = B[1];
-                } else if (c_valid) {
-                    px = C[0];
-                    py = C[1];
-                }
-            }
-        } else if (total_valid == 1) {
-            px = (a_valid) ? A[0] : ((b_valid) ? B[0] : C[0]);
-            py = (a_valid) ? A[1] : ((b_valid) ? B[1] : C[1]);
-        } else
-            px = py = 0;
-    }
-
-    /* store MV using signed modulus of MV range defined in 4.11 */
-    s->mv[dir][n][0] = s->current_picture.motion_val[dir][xy][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x;
-    s->mv[dir][n][1] = s->current_picture.motion_val[dir][xy][1] = ((py + dmv_y + r_y) & ((r_y << 1) - 1)) - r_y;
-    if (mvn == 1) { /* duplicate motion data for 1-MV block */
-        s->current_picture.motion_val[dir][xy +    1    ][0] = s->current_picture.motion_val[dir][xy][0];
-        s->current_picture.motion_val[dir][xy +    1    ][1] = s->current_picture.motion_val[dir][xy][1];
-        s->current_picture.motion_val[dir][xy + wrap    ][0] = s->current_picture.motion_val[dir][xy][0];
-        s->current_picture.motion_val[dir][xy + wrap    ][1] = s->current_picture.motion_val[dir][xy][1];
-        s->current_picture.motion_val[dir][xy + wrap + 1][0] = s->current_picture.motion_val[dir][xy][0];
-        s->current_picture.motion_val[dir][xy + wrap + 1][1] = s->current_picture.motion_val[dir][xy][1];
-    } else if (mvn == 2) { /* duplicate motion data for 2-Field MV block */
-        s->current_picture.motion_val[dir][xy + 1][0] = s->current_picture.motion_val[dir][xy][0];
-        s->current_picture.motion_val[dir][xy + 1][1] = s->current_picture.motion_val[dir][xy][1];
-        s->mv[dir][n + 1][0] = s->mv[dir][n][0];
-        s->mv[dir][n + 1][1] = s->mv[dir][n][1];
-    }
-}
-
-/** Motion compensation for direct or interpolated blocks in B-frames
- */
-static void vc1_interp_mc(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    H264ChromaContext *h264chroma = &v->h264chroma;
-    uint8_t *srcY, *srcU, *srcV;
-    int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y;
-    int off, off_uv;
-    int v_edge_pos = s->v_edge_pos >> v->field_mode;
-    int use_ic = v->next_use_ic;
-
-    if (!v->field_mode && !v->s.next_picture.f.data[0])
-        return;
-
-    mx   = s->mv[1][0][0];
-    my   = s->mv[1][0][1];
-    uvmx = (mx + ((mx & 3) == 3)) >> 1;
-    uvmy = (my + ((my & 3) == 3)) >> 1;
-    if (v->field_mode) {
-        if (v->cur_field_type != v->ref_field_type[1])
-            my   = my   - 2 + 4 * v->cur_field_type;
-            uvmy = uvmy - 2 + 4 * v->cur_field_type;
-    }
-    if (v->fastuvmc) {
-        uvmx = uvmx + ((uvmx < 0) ? -(uvmx & 1) : (uvmx & 1));
-        uvmy = uvmy + ((uvmy < 0) ? -(uvmy & 1) : (uvmy & 1));
-    }
-    srcY = s->next_picture.f.data[0];
-    srcU = s->next_picture.f.data[1];
-    srcV = s->next_picture.f.data[2];
-
-    src_x   = s->mb_x * 16 + (mx   >> 2);
-    src_y   = s->mb_y * 16 + (my   >> 2);
-    uvsrc_x = s->mb_x *  8 + (uvmx >> 2);
-    uvsrc_y = s->mb_y *  8 + (uvmy >> 2);
-
-    if (v->profile != PROFILE_ADVANCED) {
-        src_x   = av_clip(  src_x, -16, s->mb_width  * 16);
-        src_y   = av_clip(  src_y, -16, s->mb_height * 16);
-        uvsrc_x = av_clip(uvsrc_x,  -8, s->mb_width  *  8);
-        uvsrc_y = av_clip(uvsrc_y,  -8, s->mb_height *  8);
-    } else {
-        src_x   = av_clip(  src_x, -17, s->avctx->coded_width);
-        src_y   = av_clip(  src_y, -18, s->avctx->coded_height + 1);
-        uvsrc_x = av_clip(uvsrc_x,  -8, s->avctx->coded_width  >> 1);
-        uvsrc_y = av_clip(uvsrc_y,  -8, s->avctx->coded_height >> 1);
-    }
-
-    srcY += src_y   * s->linesize   + src_x;
-    srcU += uvsrc_y * s->uvlinesize + uvsrc_x;
-    srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
-
-    if (v->field_mode && v->ref_field_type[1]) {
-        srcY += s->current_picture_ptr->f.linesize[0];
-        srcU += s->current_picture_ptr->f.linesize[1];
-        srcV += s->current_picture_ptr->f.linesize[2];
-    }
-
-    /* for grayscale we should not try to read from unknown area */
-    if (s->flags & CODEC_FLAG_GRAY) {
-        srcU = s->edge_emu_buffer + 18 * s->linesize;
-        srcV = s->edge_emu_buffer + 18 * s->linesize;
-    }
-
-    if (v->rangeredfrm || s->h_edge_pos < 22 || v_edge_pos < 22 || use_ic
-        || (unsigned)(src_x - 1) > s->h_edge_pos - (mx & 3) - 16 - 3
-        || (unsigned)(src_y - 1) > v_edge_pos    - (my & 3) - 16 - 3) {
-        uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize;
-
-        srcY -= s->mspel * (1 + s->linesize);
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
-                                 s->linesize, s->linesize,
-                                 17 + s->mspel * 2, 17 + s->mspel * 2,
-                                 src_x - s->mspel, src_y - s->mspel,
-                                 s->h_edge_pos, v_edge_pos);
-        srcY = s->edge_emu_buffer;
-        s->vdsp.emulated_edge_mc(uvbuf, srcU,
-                                 s->uvlinesize, s->uvlinesize,
-                                 8 + 1, 8 + 1,
-                                 uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1);
-        s->vdsp.emulated_edge_mc(uvbuf + 16, srcV,
-                                 s->uvlinesize, s->uvlinesize,
-                                 8 + 1, 8 + 1,
-                                 uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1);
-        srcU = uvbuf;
-        srcV = uvbuf + 16;
-        /* if we deal with range reduction we need to scale source blocks */
-        if (v->rangeredfrm) {
-            int i, j;
-            uint8_t *src, *src2;
-
-            src = srcY;
-            for (j = 0; j < 17 + s->mspel * 2; j++) {
-                for (i = 0; i < 17 + s->mspel * 2; i++)
-                    src[i] = ((src[i] - 128) >> 1) + 128;
-                src += s->linesize;
-            }
-            src = srcU;
-            src2 = srcV;
-            for (j = 0; j < 9; j++) {
-                for (i = 0; i < 9; i++) {
-                    src[i]  = ((src[i]  - 128) >> 1) + 128;
-                    src2[i] = ((src2[i] - 128) >> 1) + 128;
-                }
-                src  += s->uvlinesize;
-                src2 += s->uvlinesize;
-            }
-        }
-
-        if (use_ic) {
-            uint8_t (*luty )[256] = v->next_luty;
-            uint8_t (*lutuv)[256] = v->next_lutuv;
-            int i, j;
-            uint8_t *src, *src2;
-
-            src = srcY;
-            for (j = 0; j < 17 + s->mspel * 2; j++) {
-                int f = v->field_mode ? v->ref_field_type[1] : ((j+src_y - s->mspel) & 1);
-                for (i = 0; i < 17 + s->mspel * 2; i++)
-                    src[i] = luty[f][src[i]];
-                src += s->linesize;
-            }
-            src  = srcU;
-            src2 = srcV;
-            for (j = 0; j < 9; j++) {
-                int f = v->field_mode ? v->ref_field_type[1] : ((j+uvsrc_y) & 1);
-                for (i = 0; i < 9; i++) {
-                    src[i]  = lutuv[f][src[i]];
-                    src2[i] = lutuv[f][src2[i]];
-                }
-                src  += s->uvlinesize;
-                src2 += s->uvlinesize;
-            }
-        }
-        srcY += s->mspel * (1 + s->linesize);
-    }
-
-    off    = 0;
-    off_uv = 0;
-
-    if (s->mspel) {
-        dxy = ((my & 3) << 2) | (mx & 3);
-        v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off    , srcY    , s->linesize, v->rnd);
-        v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off + 8, srcY + 8, s->linesize, v->rnd);
-        srcY += s->linesize * 8;
-        v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off + 8 * s->linesize    , srcY    , s->linesize, v->rnd);
-        v->vc1dsp.avg_vc1_mspel_pixels_tab[dxy](s->dest[0] + off + 8 * s->linesize + 8, srcY + 8, s->linesize, v->rnd);
-    } else { // hpel mc
-        dxy = (my & 2) | ((mx & 2) >> 1);
-
-        if (!v->rnd)
-            s->hdsp.avg_pixels_tab[0][dxy](s->dest[0] + off, srcY, s->linesize, 16);
-        else
-            s->hdsp.avg_no_rnd_pixels_tab[dxy](s->dest[0] + off, srcY, s->linesize, 16);
-    }
-
-    if (s->flags & CODEC_FLAG_GRAY) return;
-    /* Chroma MC always uses qpel blilinear */
-    uvmx = (uvmx & 3) << 1;
-    uvmy = (uvmy & 3) << 1;
-    if (!v->rnd) {
-        h264chroma->avg_h264_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy);
-        h264chroma->avg_h264_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy);
-    } else {
-        v->vc1dsp.avg_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy);
-        v->vc1dsp.avg_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy);
-    }
-}
-
-static av_always_inline int scale_mv(int value, int bfrac, int inv, int qs)
-{
-    int n = bfrac;
-
-#if B_FRACTION_DEN==256
-    if (inv)
-        n -= 256;
-    if (!qs)
-        return 2 * ((value * n + 255) >> 9);
-    return (value * n + 128) >> 8;
-#else
-    if (inv)
-        n -= B_FRACTION_DEN;
-    if (!qs)
-        return 2 * ((value * n + B_FRACTION_DEN - 1) / (2 * B_FRACTION_DEN));
-    return (value * n + B_FRACTION_DEN/2) / B_FRACTION_DEN;
-#endif
-}
-
-/** Reconstruct motion vector for B-frame and do motion compensation
- */
-static inline void vc1_b_mc(VC1Context *v, int dmv_x[2], int dmv_y[2],
-                            int direct, int mode)
-{
-    if (direct) {
-        vc1_mc_1mv(v, 0);
-        vc1_interp_mc(v);
-        return;
-    }
-    if (mode == BMV_TYPE_INTERPOLATED) {
-        vc1_mc_1mv(v, 0);
-        vc1_interp_mc(v);
-        return;
-    }
-
-    vc1_mc_1mv(v, (mode == BMV_TYPE_BACKWARD));
-}
-
-static inline void vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2],
-                                 int direct, int mvtype)
-{
-    MpegEncContext *s = &v->s;
-    int xy, wrap, off = 0;
-    int16_t *A, *B, *C;
-    int px, py;
-    int sum;
-    int r_x, r_y;
-    const uint8_t *is_intra = v->mb_type[0];
-
-    r_x = v->range_x;
-    r_y = v->range_y;
-    /* scale MV difference to be quad-pel */
-    dmv_x[0] <<= 1 - s->quarter_sample;
-    dmv_y[0] <<= 1 - s->quarter_sample;
-    dmv_x[1] <<= 1 - s->quarter_sample;
-    dmv_y[1] <<= 1 - s->quarter_sample;
-
-    wrap = s->b8_stride;
-    xy = s->block_index[0];
-
-    if (s->mb_intra) {
-        s->current_picture.motion_val[0][xy + v->blocks_off][0] =
-        s->current_picture.motion_val[0][xy + v->blocks_off][1] =
-        s->current_picture.motion_val[1][xy + v->blocks_off][0] =
-        s->current_picture.motion_val[1][xy + v->blocks_off][1] = 0;
-        return;
-    }
-    if (!v->field_mode) {
-        s->mv[0][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 0, s->quarter_sample);
-        s->mv[0][0][1] = scale_mv(s->next_picture.motion_val[1][xy][1], v->bfraction, 0, s->quarter_sample);
-        s->mv[1][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 1, s->quarter_sample);
-        s->mv[1][0][1] = scale_mv(s->next_picture.motion_val[1][xy][1], v->bfraction, 1, s->quarter_sample);
-
-        /* Pullback predicted motion vectors as specified in 8.4.5.4 */
-        s->mv[0][0][0] = av_clip(s->mv[0][0][0], -60 - (s->mb_x << 6), (s->mb_width  << 6) - 4 - (s->mb_x << 6));
-        s->mv[0][0][1] = av_clip(s->mv[0][0][1], -60 - (s->mb_y << 6), (s->mb_height << 6) - 4 - (s->mb_y << 6));
-        s->mv[1][0][0] = av_clip(s->mv[1][0][0], -60 - (s->mb_x << 6), (s->mb_width  << 6) - 4 - (s->mb_x << 6));
-        s->mv[1][0][1] = av_clip(s->mv[1][0][1], -60 - (s->mb_y << 6), (s->mb_height << 6) - 4 - (s->mb_y << 6));
-    }
-    if (direct) {
-        s->current_picture.motion_val[0][xy + v->blocks_off][0] = s->mv[0][0][0];
-        s->current_picture.motion_val[0][xy + v->blocks_off][1] = s->mv[0][0][1];
-        s->current_picture.motion_val[1][xy + v->blocks_off][0] = s->mv[1][0][0];
-        s->current_picture.motion_val[1][xy + v->blocks_off][1] = s->mv[1][0][1];
-        return;
-    }
-
-    if ((mvtype == BMV_TYPE_FORWARD) || (mvtype == BMV_TYPE_INTERPOLATED)) {
-        C   = s->current_picture.motion_val[0][xy - 2];
-        A   = s->current_picture.motion_val[0][xy - wrap * 2];
-        off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2;
-        B   = s->current_picture.motion_val[0][xy - wrap * 2 + off];
-
-        if (!s->mb_x) C[0] = C[1] = 0;
-        if (!s->first_slice_line) { // predictor A is not out of bounds
-            if (s->mb_width == 1) {
-                px = A[0];
-                py = A[1];
-            } else {
-                px = mid_pred(A[0], B[0], C[0]);
-                py = mid_pred(A[1], B[1], C[1]);
-            }
-        } else if (s->mb_x) { // predictor C is not out of bounds
-            px = C[0];
-            py = C[1];
-        } else {
-            px = py = 0;
-        }
-        /* Pullback MV as specified in 8.3.5.3.4 */
-        {
-            int qx, qy, X, Y;
-            if (v->profile < PROFILE_ADVANCED) {
-                qx = (s->mb_x << 5);
-                qy = (s->mb_y << 5);
-                X  = (s->mb_width  << 5) - 4;
-                Y  = (s->mb_height << 5) - 4;
-                if (qx + px < -28) px = -28 - qx;
-                if (qy + py < -28) py = -28 - qy;
-                if (qx + px > X) px = X - qx;
-                if (qy + py > Y) py = Y - qy;
-            } else {
-                qx = (s->mb_x << 6);
-                qy = (s->mb_y << 6);
-                X  = (s->mb_width  << 6) - 4;
-                Y  = (s->mb_height << 6) - 4;
-                if (qx + px < -60) px = -60 - qx;
-                if (qy + py < -60) py = -60 - qy;
-                if (qx + px > X) px = X - qx;
-                if (qy + py > Y) py = Y - qy;
-            }
-        }
-        /* Calculate hybrid prediction as specified in 8.3.5.3.5 */
-        if (0 && !s->first_slice_line && s->mb_x) {
-            if (is_intra[xy - wrap])
-                sum = FFABS(px) + FFABS(py);
-            else
-                sum = FFABS(px - A[0]) + FFABS(py - A[1]);
-            if (sum > 32) {
-                if (get_bits1(&s->gb)) {
-                    px = A[0];
-                    py = A[1];
-                } else {
-                    px = C[0];
-                    py = C[1];
-                }
-            } else {
-                if (is_intra[xy - 2])
-                    sum = FFABS(px) + FFABS(py);
-                else
-                    sum = FFABS(px - C[0]) + FFABS(py - C[1]);
-                if (sum > 32) {
-                    if (get_bits1(&s->gb)) {
-                        px = A[0];
-                        py = A[1];
-                    } else {
-                        px = C[0];
-                        py = C[1];
-                    }
-                }
-            }
-        }
-        /* store MV using signed modulus of MV range defined in 4.11 */
-        s->mv[0][0][0] = ((px + dmv_x[0] + r_x) & ((r_x << 1) - 1)) - r_x;
-        s->mv[0][0][1] = ((py + dmv_y[0] + r_y) & ((r_y << 1) - 1)) - r_y;
-    }
-    if ((mvtype == BMV_TYPE_BACKWARD) || (mvtype == BMV_TYPE_INTERPOLATED)) {
-        C   = s->current_picture.motion_val[1][xy - 2];
-        A   = s->current_picture.motion_val[1][xy - wrap * 2];
-        off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2;
-        B   = s->current_picture.motion_val[1][xy - wrap * 2 + off];
-
-        if (!s->mb_x)
-            C[0] = C[1] = 0;
-        if (!s->first_slice_line) { // predictor A is not out of bounds
-            if (s->mb_width == 1) {
-                px = A[0];
-                py = A[1];
-            } else {
-                px = mid_pred(A[0], B[0], C[0]);
-                py = mid_pred(A[1], B[1], C[1]);
-            }
-        } else if (s->mb_x) { // predictor C is not out of bounds
-            px = C[0];
-            py = C[1];
-        } else {
-            px = py = 0;
-        }
-        /* Pullback MV as specified in 8.3.5.3.4 */
-        {
-            int qx, qy, X, Y;
-            if (v->profile < PROFILE_ADVANCED) {
-                qx = (s->mb_x << 5);
-                qy = (s->mb_y << 5);
-                X  = (s->mb_width  << 5) - 4;
-                Y  = (s->mb_height << 5) - 4;
-                if (qx + px < -28) px = -28 - qx;
-                if (qy + py < -28) py = -28 - qy;
-                if (qx + px > X) px = X - qx;
-                if (qy + py > Y) py = Y - qy;
-            } else {
-                qx = (s->mb_x << 6);
-                qy = (s->mb_y << 6);
-                X  = (s->mb_width  << 6) - 4;
-                Y  = (s->mb_height << 6) - 4;
-                if (qx + px < -60) px = -60 - qx;
-                if (qy + py < -60) py = -60 - qy;
-                if (qx + px > X) px = X - qx;
-                if (qy + py > Y) py = Y - qy;
-            }
-        }
-        /* Calculate hybrid prediction as specified in 8.3.5.3.5 */
-        if (0 && !s->first_slice_line && s->mb_x) {
-            if (is_intra[xy - wrap])
-                sum = FFABS(px) + FFABS(py);
-            else
-                sum = FFABS(px - A[0]) + FFABS(py - A[1]);
-            if (sum > 32) {
-                if (get_bits1(&s->gb)) {
-                    px = A[0];
-                    py = A[1];
-                } else {
-                    px = C[0];
-                    py = C[1];
-                }
-            } else {
-                if (is_intra[xy - 2])
-                    sum = FFABS(px) + FFABS(py);
-                else
-                    sum = FFABS(px - C[0]) + FFABS(py - C[1]);
-                if (sum > 32) {
-                    if (get_bits1(&s->gb)) {
-                        px = A[0];
-                        py = A[1];
-                    } else {
-                        px = C[0];
-                        py = C[1];
-                    }
-                }
-            }
-        }
-        /* store MV using signed modulus of MV range defined in 4.11 */
-
-        s->mv[1][0][0] = ((px + dmv_x[1] + r_x) & ((r_x << 1) - 1)) - r_x;
-        s->mv[1][0][1] = ((py + dmv_y[1] + r_y) & ((r_y << 1) - 1)) - r_y;
-    }
-    s->current_picture.motion_val[0][xy][0] = s->mv[0][0][0];
-    s->current_picture.motion_val[0][xy][1] = s->mv[0][0][1];
-    s->current_picture.motion_val[1][xy][0] = s->mv[1][0][0];
-    s->current_picture.motion_val[1][xy][1] = s->mv[1][0][1];
-}
-
-static inline void vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y, int mv1, int *pred_flag)
-{
-    int dir = (v->bmvtype == BMV_TYPE_BACKWARD) ? 1 : 0;
-    MpegEncContext *s = &v->s;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-
-    if (v->bmvtype == BMV_TYPE_DIRECT) {
-        int total_opp, k, f;
-        if (s->next_picture.mb_type[mb_pos + v->mb_off] != MB_TYPE_INTRA) {
-            s->mv[0][0][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][0],
-                                      v->bfraction, 0, s->quarter_sample);
-            s->mv[0][0][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][1],
-                                      v->bfraction, 0, s->quarter_sample);
-            s->mv[1][0][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][0],
-                                      v->bfraction, 1, s->quarter_sample);
-            s->mv[1][0][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][1],
-                                      v->bfraction, 1, s->quarter_sample);
-
-            total_opp = v->mv_f_next[0][s->block_index[0] + v->blocks_off]
-                      + v->mv_f_next[0][s->block_index[1] + v->blocks_off]
-                      + v->mv_f_next[0][s->block_index[2] + v->blocks_off]
-                      + v->mv_f_next[0][s->block_index[3] + v->blocks_off];
-            f = (total_opp > 2) ? 1 : 0;
-        } else {
-            s->mv[0][0][0] = s->mv[0][0][1] = 0;
-            s->mv[1][0][0] = s->mv[1][0][1] = 0;
-            f = 0;
-        }
-        v->ref_field_type[0] = v->ref_field_type[1] = v->cur_field_type ^ f;
-        for (k = 0; k < 4; k++) {
-            s->current_picture.motion_val[0][s->block_index[k] + v->blocks_off][0] = s->mv[0][0][0];
-            s->current_picture.motion_val[0][s->block_index[k] + v->blocks_off][1] = s->mv[0][0][1];
-            s->current_picture.motion_val[1][s->block_index[k] + v->blocks_off][0] = s->mv[1][0][0];
-            s->current_picture.motion_val[1][s->block_index[k] + v->blocks_off][1] = s->mv[1][0][1];
-            v->mv_f[0][s->block_index[k] + v->blocks_off] = f;
-            v->mv_f[1][s->block_index[k] + v->blocks_off] = f;
-        }
-        return;
-    }
-    if (v->bmvtype == BMV_TYPE_INTERPOLATED) {
-        vc1_pred_mv(v, 0, dmv_x[0], dmv_y[0],   1, v->range_x, v->range_y, v->mb_type[0], pred_flag[0], 0);
-        vc1_pred_mv(v, 0, dmv_x[1], dmv_y[1],   1, v->range_x, v->range_y, v->mb_type[0], pred_flag[1], 1);
-        return;
-    }
-    if (dir) { // backward
-        vc1_pred_mv(v, n, dmv_x[1], dmv_y[1], mv1, v->range_x, v->range_y, v->mb_type[0], pred_flag[1], 1);
-        if (n == 3 || mv1) {
-            vc1_pred_mv(v, 0, dmv_x[0], dmv_y[0],   1, v->range_x, v->range_y, v->mb_type[0], 0, 0);
-        }
-    } else { // forward
-        vc1_pred_mv(v, n, dmv_x[0], dmv_y[0], mv1, v->range_x, v->range_y, v->mb_type[0], pred_flag[0], 0);
-        if (n == 3 || mv1) {
-            vc1_pred_mv(v, 0, dmv_x[1], dmv_y[1],   1, v->range_x, v->range_y, v->mb_type[0], 0, 1);
-        }
-    }
-}
-
-/** Get predicted DC value for I-frames only
- * prediction dir: left=0, top=1
- * @param s MpegEncContext
- * @param overlap flag indicating that overlap filtering is used
- * @param pq integer part of picture quantizer
- * @param[in] n block index in the current MB
- * @param dc_val_ptr Pointer to DC predictor
- * @param dir_ptr Prediction direction for use in AC prediction
- */
-static inline int vc1_i_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
-                                int16_t **dc_val_ptr, int *dir_ptr)
-{
-    int a, b, c, wrap, pred, scale;
-    int16_t *dc_val;
-    static const uint16_t dcpred[32] = {
-        -1, 1024,  512,  341,  256,  205,  171,  146,  128,
-             114,  102,   93,   85,   79,   73,   68,   64,
-              60,   57,   54,   51,   49,   47,   45,   43,
-              41,   39,   38,   37,   35,   34,   33
-    };
-
-    /* find prediction - wmv3_dc_scale always used here in fact */
-    if (n < 4) scale = s->y_dc_scale;
-    else       scale = s->c_dc_scale;
-
-    wrap   = s->block_wrap[n];
-    dc_val = s->dc_val[0] + s->block_index[n];
-
-    /* B A
-     * C X
-     */
-    c = dc_val[ - 1];
-    b = dc_val[ - 1 - wrap];
-    a = dc_val[ - wrap];
-
-    if (pq < 9 || !overlap) {
-        /* Set outer values */
-        if (s->first_slice_line && (n != 2 && n != 3))
-            b = a = dcpred[scale];
-        if (s->mb_x == 0 && (n != 1 && n != 3))
-            b = c = dcpred[scale];
-    } else {
-        /* Set outer values */
-        if (s->first_slice_line && (n != 2 && n != 3))
-            b = a = 0;
-        if (s->mb_x == 0 && (n != 1 && n != 3))
-            b = c = 0;
-    }
-
-    if (abs(a - b) <= abs(b - c)) {
-        pred     = c;
-        *dir_ptr = 1; // left
-    } else {
-        pred     = a;
-        *dir_ptr = 0; // top
-    }
-
-    /* update predictor */
-    *dc_val_ptr = &dc_val[0];
-    return pred;
-}
-
-
-/** Get predicted DC value
- * prediction dir: left=0, top=1
- * @param s MpegEncContext
- * @param overlap flag indicating that overlap filtering is used
- * @param pq integer part of picture quantizer
- * @param[in] n block index in the current MB
- * @param a_avail flag indicating top block availability
- * @param c_avail flag indicating left block availability
- * @param dc_val_ptr Pointer to DC predictor
- * @param dir_ptr Prediction direction for use in AC prediction
- */
-static inline int vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
-                              int a_avail, int c_avail,
-                              int16_t **dc_val_ptr, int *dir_ptr)
-{
-    int a, b, c, wrap, pred;
-    int16_t *dc_val;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int q1, q2 = 0;
-    int dqscale_index;
-
-    wrap = s->block_wrap[n];
-    dc_val = s->dc_val[0] + s->block_index[n];
-
-    /* B A
-     * C X
-     */
-    c = dc_val[ - 1];
-    b = dc_val[ - 1 - wrap];
-    a = dc_val[ - wrap];
-    /* scale predictors if needed */
-    q1 = s->current_picture.qscale_table[mb_pos];
-    dqscale_index = s->y_dc_scale_table[q1] - 1;
-    if (dqscale_index < 0)
-        return 0;
-    if (c_avail && (n != 1 && n != 3)) {
-        q2 = s->current_picture.qscale_table[mb_pos - 1];
-        if (q2 && q2 != q1)
-            c = (c * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;
-    }
-    if (a_avail && (n != 2 && n != 3)) {
-        q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride];
-        if (q2 && q2 != q1)
-            a = (a * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;
-    }
-    if (a_avail && c_avail && (n != 3)) {
-        int off = mb_pos;
-        if (n != 1)
-            off--;
-        if (n != 2)
-            off -= s->mb_stride;
-        q2 = s->current_picture.qscale_table[off];
-        if (q2 && q2 != q1)
-            b = (b * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;
-    }
-
-    if (a_avail && c_avail) {
-        if (abs(a - b) <= abs(b - c)) {
-            pred     = c;
-            *dir_ptr = 1; // left
-        } else {
-            pred     = a;
-            *dir_ptr = 0; // top
-        }
-    } else if (a_avail) {
-        pred     = a;
-        *dir_ptr = 0; // top
-    } else if (c_avail) {
-        pred     = c;
-        *dir_ptr = 1; // left
-    } else {
-        pred     = 0;
-        *dir_ptr = 1; // left
-    }
-
-    /* update predictor */
-    *dc_val_ptr = &dc_val[0];
-    return pred;
-}
-
-/** @} */ // Block group
-
-/**
- * @name VC1 Macroblock-level functions in Simple/Main Profiles
- * @see 7.1.4, p91 and 8.1.1.7, p(1)04
- * @{
- */
-
-static inline int vc1_coded_block_pred(MpegEncContext * s, int n,
-                                       uint8_t **coded_block_ptr)
-{
-    int xy, wrap, pred, a, b, c;
-
-    xy   = s->block_index[n];
-    wrap = s->b8_stride;
-
-    /* B C
-     * A X
-     */
-    a = s->coded_block[xy - 1       ];
-    b = s->coded_block[xy - 1 - wrap];
-    c = s->coded_block[xy     - wrap];
-
-    if (b == c) {
-        pred = a;
-    } else {
-        pred = c;
-    }
-
-    /* store value */
-    *coded_block_ptr = &s->coded_block[xy];
-
-    return pred;
-}
-
-/**
- * Decode one AC coefficient
- * @param v The VC1 context
- * @param last Last coefficient
- * @param skip How much zero coefficients to skip
- * @param value Decoded AC coefficient value
- * @param codingset set of VLC to decode data
- * @see 8.1.3.4
- */
-static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip,
-                                int *value, int codingset)
-{
-    GetBitContext *gb = &v->s.gb;
-    int index, escape, run = 0, level = 0, lst = 0;
-
-    index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3);
-    if (index != ff_vc1_ac_sizes[codingset] - 1) {
-        run   = vc1_index_decode_table[codingset][index][0];
-        level = vc1_index_decode_table[codingset][index][1];
-        lst   = index >= vc1_last_decode_table[codingset] || get_bits_left(gb) < 0;
-        if (get_bits1(gb))
-            level = -level;
-    } else {
-        escape = decode210(gb);
-        if (escape != 2) {
-            index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3);
-            run   = vc1_index_decode_table[codingset][index][0];
-            level = vc1_index_decode_table[codingset][index][1];
-            lst   = index >= vc1_last_decode_table[codingset];
-            if (escape == 0) {
-                if (lst)
-                    level += vc1_last_delta_level_table[codingset][run];
-                else
-                    level += vc1_delta_level_table[codingset][run];
-            } else {
-                if (lst)
-                    run += vc1_last_delta_run_table[codingset][level] + 1;
-                else
-                    run += vc1_delta_run_table[codingset][level] + 1;
-            }
-            if (get_bits1(gb))
-                level = -level;
-        } else {
-            int sign;
-            lst = get_bits1(gb);
-            if (v->s.esc3_level_length == 0) {
-                if (v->pq < 8 || v->dquantfrm) { // table 59
-                    v->s.esc3_level_length = get_bits(gb, 3);
-                    if (!v->s.esc3_level_length)
-                        v->s.esc3_level_length = get_bits(gb, 2) + 8;
-                } else { // table 60
-                    v->s.esc3_level_length = get_unary(gb, 1, 6) + 2;
-                }
-                v->s.esc3_run_length = 3 + get_bits(gb, 2);
-            }
-            run   = get_bits(gb, v->s.esc3_run_length);
-            sign  = get_bits1(gb);
-            level = get_bits(gb, v->s.esc3_level_length);
-            if (sign)
-                level = -level;
-        }
-    }
-
-    *last  = lst;
-    *skip  = run;
-    *value = level;
-}
-
-/** Decode intra block in intra frames - should be faster than decode_intra_block
- * @param v VC1Context
- * @param block block to decode
- * @param[in] n subblock index
- * @param coded are AC coeffs present or not
- * @param codingset set of VLC to decode data
- */
-static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n,
-                              int coded, int codingset)
-{
-    GetBitContext *gb = &v->s.gb;
-    MpegEncContext *s = &v->s;
-    int dc_pred_dir = 0; /* Direction of the DC prediction used */
-    int i;
-    int16_t *dc_val;
-    int16_t *ac_val, *ac_val2;
-    int dcdiff;
-
-    /* Get DC differential */
-    if (n < 4) {
-        dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
-    } else {
-        dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
-    }
-    if (dcdiff < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n");
-        return -1;
-    }
-    if (dcdiff) {
-        if (dcdiff == 119 /* ESC index value */) {
-            /* TODO: Optimize */
-            if (v->pq == 1)      dcdiff = get_bits(gb, 10);
-            else if (v->pq == 2) dcdiff = get_bits(gb, 9);
-            else                 dcdiff = get_bits(gb, 8);
-        } else {
-            if (v->pq == 1)
-                dcdiff = (dcdiff << 2) + get_bits(gb, 2) - 3;
-            else if (v->pq == 2)
-                dcdiff = (dcdiff << 1) + get_bits1(gb)   - 1;
-        }
-        if (get_bits1(gb))
-            dcdiff = -dcdiff;
-    }
-
-    /* Prediction */
-    dcdiff += vc1_i_pred_dc(&v->s, v->overlap, v->pq, n, &dc_val, &dc_pred_dir);
-    *dc_val = dcdiff;
-
-    /* Store the quantized DC coeff, used for prediction */
-    if (n < 4) {
-        block[0] = dcdiff * s->y_dc_scale;
-    } else {
-        block[0] = dcdiff * s->c_dc_scale;
-    }
-    /* Skip ? */
-    if (!coded) {
-        goto not_coded;
-    }
-
-    // AC Decoding
-    i = 1;
-
-    {
-        int last = 0, skip, value;
-        const uint8_t *zz_table;
-        int scale;
-        int k;
-
-        scale = v->pq * 2 + v->halfpq;
-
-        if (v->s.ac_pred) {
-            if (!dc_pred_dir)
-                zz_table = v->zz_8x8[2];
-            else
-                zz_table = v->zz_8x8[3];
-        } else
-            zz_table = v->zz_8x8[1];
-
-        ac_val  = s->ac_val[0][0] + s->block_index[n] * 16;
-        ac_val2 = ac_val;
-        if (dc_pred_dir) // left
-            ac_val -= 16;
-        else // top
-            ac_val -= 16 * s->block_wrap[n];
-
-        while (!last) {
-            vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
-            i += skip;
-            if (i > 63)
-                break;
-            block[zz_table[i++]] = value;
-        }
-
-        /* apply AC prediction if needed */
-        if (s->ac_pred) {
-            if (dc_pred_dir) { // left
-                for (k = 1; k < 8; k++)
-                    block[k << v->left_blk_sh] += ac_val[k];
-            } else { // top
-                for (k = 1; k < 8; k++)
-                    block[k << v->top_blk_sh] += ac_val[k + 8];
-            }
-        }
-        /* save AC coeffs for further prediction */
-        for (k = 1; k < 8; k++) {
-            ac_val2[k]     = block[k << v->left_blk_sh];
-            ac_val2[k + 8] = block[k << v->top_blk_sh];
-        }
-
-        /* scale AC coeffs */
-        for (k = 1; k < 64; k++)
-            if (block[k]) {
-                block[k] *= scale;
-                if (!v->pquantizer)
-                    block[k] += (block[k] < 0) ? -v->pq : v->pq;
-            }
-
-        if (s->ac_pred) i = 63;
-    }
-
-not_coded:
-    if (!coded) {
-        int k, scale;
-        ac_val  = s->ac_val[0][0] + s->block_index[n] * 16;
-        ac_val2 = ac_val;
-
-        i = 0;
-        scale = v->pq * 2 + v->halfpq;
-        memset(ac_val2, 0, 16 * 2);
-        if (dc_pred_dir) { // left
-            ac_val -= 16;
-            if (s->ac_pred)
-                memcpy(ac_val2, ac_val, 8 * 2);
-        } else { // top
-            ac_val -= 16 * s->block_wrap[n];
-            if (s->ac_pred)
-                memcpy(ac_val2 + 8, ac_val + 8, 8 * 2);
-        }
-
-        /* apply AC prediction if needed */
-        if (s->ac_pred) {
-            if (dc_pred_dir) { //left
-                for (k = 1; k < 8; k++) {
-                    block[k << v->left_blk_sh] = ac_val[k] * scale;
-                    if (!v->pquantizer && block[k << v->left_blk_sh])
-                        block[k << v->left_blk_sh] += (block[k << v->left_blk_sh] < 0) ? -v->pq : v->pq;
-                }
-            } else { // top
-                for (k = 1; k < 8; k++) {
-                    block[k << v->top_blk_sh] = ac_val[k + 8] * scale;
-                    if (!v->pquantizer && block[k << v->top_blk_sh])
-                        block[k << v->top_blk_sh] += (block[k << v->top_blk_sh] < 0) ? -v->pq : v->pq;
-                }
-            }
-            i = 63;
-        }
-    }
-    s->block_last_index[n] = i;
-
-    return 0;
-}
-
-/** Decode intra block in intra frames - should be faster than decode_intra_block
- * @param v VC1Context
- * @param block block to decode
- * @param[in] n subblock number
- * @param coded are AC coeffs present or not
- * @param codingset set of VLC to decode data
- * @param mquant quantizer value for this macroblock
- */
-static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n,
-                                  int coded, int codingset, int mquant)
-{
-    GetBitContext *gb = &v->s.gb;
-    MpegEncContext *s = &v->s;
-    int dc_pred_dir = 0; /* Direction of the DC prediction used */
-    int i;
-    int16_t *dc_val;
-    int16_t *ac_val, *ac_val2;
-    int dcdiff;
-    int a_avail = v->a_avail, c_avail = v->c_avail;
-    int use_pred = s->ac_pred;
-    int scale;
-    int q1, q2 = 0;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-
-    /* Get DC differential */
-    if (n < 4) {
-        dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
-    } else {
-        dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
-    }
-    if (dcdiff < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n");
-        return -1;
-    }
-    if (dcdiff) {
-        if (dcdiff == 119 /* ESC index value */) {
-            /* TODO: Optimize */
-            if (mquant == 1)      dcdiff = get_bits(gb, 10);
-            else if (mquant == 2) dcdiff = get_bits(gb, 9);
-            else                  dcdiff = get_bits(gb, 8);
-        } else {
-            if (mquant == 1)
-                dcdiff = (dcdiff << 2) + get_bits(gb, 2) - 3;
-            else if (mquant == 2)
-                dcdiff = (dcdiff << 1) + get_bits1(gb)   - 1;
-        }
-        if (get_bits1(gb))
-            dcdiff = -dcdiff;
-    }
-
-    /* Prediction */
-    dcdiff += vc1_pred_dc(&v->s, v->overlap, mquant, n, v->a_avail, v->c_avail, &dc_val, &dc_pred_dir);
-    *dc_val = dcdiff;
-
-    /* Store the quantized DC coeff, used for prediction */
-    if (n < 4) {
-        block[0] = dcdiff * s->y_dc_scale;
-    } else {
-        block[0] = dcdiff * s->c_dc_scale;
-    }
-
-    //AC Decoding
-    i = 1;
-
-    /* check if AC is needed at all */
-    if (!a_avail && !c_avail)
-        use_pred = 0;
-    ac_val  = s->ac_val[0][0] + s->block_index[n] * 16;
-    ac_val2 = ac_val;
-
-    scale = mquant * 2 + ((mquant == v->pq) ? v->halfpq : 0);
-
-    if (dc_pred_dir) // left
-        ac_val -= 16;
-    else // top
-        ac_val -= 16 * s->block_wrap[n];
-
-    q1 = s->current_picture.qscale_table[mb_pos];
-    if ( dc_pred_dir && c_avail && mb_pos)
-        q2 = s->current_picture.qscale_table[mb_pos - 1];
-    if (!dc_pred_dir && a_avail && mb_pos >= s->mb_stride)
-        q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride];
-    if ( dc_pred_dir && n == 1)
-        q2 = q1;
-    if (!dc_pred_dir && n == 2)
-        q2 = q1;
-    if (n == 3)
-        q2 = q1;
-
-    if (coded) {
-        int last = 0, skip, value;
-        const uint8_t *zz_table;
-        int k;
-
-        if (v->s.ac_pred) {
-            if (!use_pred && v->fcm == ILACE_FRAME) {
-                zz_table = v->zzi_8x8;
-            } else {
-                if (!dc_pred_dir) // top
-                    zz_table = v->zz_8x8[2];
-                else // left
-                    zz_table = v->zz_8x8[3];
-            }
-        } else {
-            if (v->fcm != ILACE_FRAME)
-                zz_table = v->zz_8x8[1];
-            else
-                zz_table = v->zzi_8x8;
-        }
-
-        while (!last) {
-            vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
-            i += skip;
-            if (i > 63)
-                break;
-            block[zz_table[i++]] = value;
-        }
-
-        /* apply AC prediction if needed */
-        if (use_pred) {
-            /* scale predictors if needed*/
-            if (q2 && q1 != q2) {
-                q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
-                q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
-
-                if (q1 < 1)
-                    return AVERROR_INVALIDDATA;
-                if (dc_pred_dir) { // left
-                    for (k = 1; k < 8; k++)
-                        block[k << v->left_blk_sh] += (ac_val[k] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18;
-                } else { // top
-                    for (k = 1; k < 8; k++)
-                        block[k << v->top_blk_sh] += (ac_val[k + 8] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18;
-                }
-            } else {
-                if (dc_pred_dir) { //left
-                    for (k = 1; k < 8; k++)
-                        block[k << v->left_blk_sh] += ac_val[k];
-                } else { //top
-                    for (k = 1; k < 8; k++)
-                        block[k << v->top_blk_sh] += ac_val[k + 8];
-                }
-            }
-        }
-        /* save AC coeffs for further prediction */
-        for (k = 1; k < 8; k++) {
-            ac_val2[k    ] = block[k << v->left_blk_sh];
-            ac_val2[k + 8] = block[k << v->top_blk_sh];
-        }
-
-        /* scale AC coeffs */
-        for (k = 1; k < 64; k++)
-            if (block[k]) {
-                block[k] *= scale;
-                if (!v->pquantizer)
-                    block[k] += (block[k] < 0) ? -mquant : mquant;
-            }
-
-        if (use_pred) i = 63;
-    } else { // no AC coeffs
-        int k;
-
-        memset(ac_val2, 0, 16 * 2);
-        if (dc_pred_dir) { // left
-            if (use_pred) {
-                memcpy(ac_val2, ac_val, 8 * 2);
-                if (q2 && q1 != q2) {
-                    q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
-                    q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
-                    if (q1 < 1)
-                        return AVERROR_INVALIDDATA;
-                    for (k = 1; k < 8; k++)
-                        ac_val2[k] = (ac_val2[k] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18;
-                }
-            }
-        } else { // top
-            if (use_pred) {
-                memcpy(ac_val2 + 8, ac_val + 8, 8 * 2);
-                if (q2 && q1 != q2) {
-                    q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
-                    q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
-                    if (q1 < 1)
-                        return AVERROR_INVALIDDATA;
-                    for (k = 1; k < 8; k++)
-                        ac_val2[k + 8] = (ac_val2[k + 8] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18;
-                }
-            }
-        }
-
-        /* apply AC prediction if needed */
-        if (use_pred) {
-            if (dc_pred_dir) { // left
-                for (k = 1; k < 8; k++) {
-                    block[k << v->left_blk_sh] = ac_val2[k] * scale;
-                    if (!v->pquantizer && block[k << v->left_blk_sh])
-                        block[k << v->left_blk_sh] += (block[k << v->left_blk_sh] < 0) ? -mquant : mquant;
-                }
-            } else { // top
-                for (k = 1; k < 8; k++) {
-                    block[k << v->top_blk_sh] = ac_val2[k + 8] * scale;
-                    if (!v->pquantizer && block[k << v->top_blk_sh])
-                        block[k << v->top_blk_sh] += (block[k << v->top_blk_sh] < 0) ? -mquant : mquant;
-                }
-            }
-            i = 63;
-        }
-    }
-    s->block_last_index[n] = i;
-
-    return 0;
-}
-
-/** Decode intra block in inter frames - more generic version than vc1_decode_i_block
- * @param v VC1Context
- * @param block block to decode
- * @param[in] n subblock index
- * @param coded are AC coeffs present or not
- * @param mquant block quantizer
- * @param codingset set of VLC to decode data
- */
-static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n,
-                                  int coded, int mquant, int codingset)
-{
-    GetBitContext *gb = &v->s.gb;
-    MpegEncContext *s = &v->s;
-    int dc_pred_dir = 0; /* Direction of the DC prediction used */
-    int i;
-    int16_t *dc_val;
-    int16_t *ac_val, *ac_val2;
-    int dcdiff;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int a_avail = v->a_avail, c_avail = v->c_avail;
-    int use_pred = s->ac_pred;
-    int scale;
-    int q1, q2 = 0;
-
-    s->dsp.clear_block(block);
-
-    /* XXX: Guard against dumb values of mquant */
-    mquant = (mquant < 1) ? 0 : ((mquant > 31) ? 31 : mquant);
-
-    /* Set DC scale - y and c use the same */
-    s->y_dc_scale = s->y_dc_scale_table[mquant];
-    s->c_dc_scale = s->c_dc_scale_table[mquant];
-
-    /* Get DC differential */
-    if (n < 4) {
-        dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
-    } else {
-        dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
-    }
-    if (dcdiff < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n");
-        return -1;
-    }
-    if (dcdiff) {
-        if (dcdiff == 119 /* ESC index value */) {
-            /* TODO: Optimize */
-            if (mquant == 1)      dcdiff = get_bits(gb, 10);
-            else if (mquant == 2) dcdiff = get_bits(gb, 9);
-            else                  dcdiff = get_bits(gb, 8);
-        } else {
-            if (mquant == 1)
-                dcdiff = (dcdiff << 2) + get_bits(gb, 2) - 3;
-            else if (mquant == 2)
-                dcdiff = (dcdiff << 1) + get_bits1(gb)   - 1;
-        }
-        if (get_bits1(gb))
-            dcdiff = -dcdiff;
-    }
-
-    /* Prediction */
-    dcdiff += vc1_pred_dc(&v->s, v->overlap, mquant, n, a_avail, c_avail, &dc_val, &dc_pred_dir);
-    *dc_val = dcdiff;
-
-    /* Store the quantized DC coeff, used for prediction */
-
-    if (n < 4) {
-        block[0] = dcdiff * s->y_dc_scale;
-    } else {
-        block[0] = dcdiff * s->c_dc_scale;
-    }
-
-    //AC Decoding
-    i = 1;
-
-    /* check if AC is needed at all and adjust direction if needed */
-    if (!a_avail) dc_pred_dir = 1;
-    if (!c_avail) dc_pred_dir = 0;
-    if (!a_avail && !c_avail) use_pred = 0;
-    ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
-    ac_val2 = ac_val;
-
-    scale = mquant * 2 + v->halfpq;
-
-    if (dc_pred_dir) //left
-        ac_val -= 16;
-    else //top
-        ac_val -= 16 * s->block_wrap[n];
-
-    q1 = s->current_picture.qscale_table[mb_pos];
-    if (dc_pred_dir && c_avail && mb_pos)
-        q2 = s->current_picture.qscale_table[mb_pos - 1];
-    if (!dc_pred_dir && a_avail && mb_pos >= s->mb_stride)
-        q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride];
-    if ( dc_pred_dir && n == 1)
-        q2 = q1;
-    if (!dc_pred_dir && n == 2)
-        q2 = q1;
-    if (n == 3) q2 = q1;
-
-    if (coded) {
-        int last = 0, skip, value;
-        int k;
-
-        while (!last) {
-            vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
-            i += skip;
-            if (i > 63)
-                break;
-            if (v->fcm == PROGRESSIVE)
-                block[v->zz_8x8[0][i++]] = value;
-            else {
-                if (use_pred && (v->fcm == ILACE_FRAME)) {
-                    if (!dc_pred_dir) // top
-                        block[v->zz_8x8[2][i++]] = value;
-                    else // left
-                        block[v->zz_8x8[3][i++]] = value;
-                } else {
-                    block[v->zzi_8x8[i++]] = value;
-                }
-            }
-        }
-
-        /* apply AC prediction if needed */
-        if (use_pred) {
-            /* scale predictors if needed*/
-            if (q2 && q1 != q2) {
-                q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
-                q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
-
-                if (q1 < 1)
-                    return AVERROR_INVALIDDATA;
-                if (dc_pred_dir) { // left
-                    for (k = 1; k < 8; k++)
-                        block[k << v->left_blk_sh] += (ac_val[k] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18;
-                } else { //top
-                    for (k = 1; k < 8; k++)
-                        block[k << v->top_blk_sh] += (ac_val[k + 8] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18;
-                }
-            } else {
-                if (dc_pred_dir) { // left
-                    for (k = 1; k < 8; k++)
-                        block[k << v->left_blk_sh] += ac_val[k];
-                } else { // top
-                    for (k = 1; k < 8; k++)
-                        block[k << v->top_blk_sh] += ac_val[k + 8];
-                }
-            }
-        }
-        /* save AC coeffs for further prediction */
-        for (k = 1; k < 8; k++) {
-            ac_val2[k    ] = block[k << v->left_blk_sh];
-            ac_val2[k + 8] = block[k << v->top_blk_sh];
-        }
-
-        /* scale AC coeffs */
-        for (k = 1; k < 64; k++)
-            if (block[k]) {
-                block[k] *= scale;
-                if (!v->pquantizer)
-                    block[k] += (block[k] < 0) ? -mquant : mquant;
-            }
-
-        if (use_pred) i = 63;
-    } else { // no AC coeffs
-        int k;
-
-        memset(ac_val2, 0, 16 * 2);
-        if (dc_pred_dir) { // left
-            if (use_pred) {
-                memcpy(ac_val2, ac_val, 8 * 2);
-                if (q2 && q1 != q2) {
-                    q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
-                    q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
-                    if (q1 < 1)
-                        return AVERROR_INVALIDDATA;
-                    for (k = 1; k < 8; k++)
-                        ac_val2[k] = (ac_val2[k] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18;
-                }
-            }
-        } else { // top
-            if (use_pred) {
-                memcpy(ac_val2 + 8, ac_val + 8, 8 * 2);
-                if (q2 && q1 != q2) {
-                    q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
-                    q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
-                    if (q1 < 1)
-                        return AVERROR_INVALIDDATA;
-                    for (k = 1; k < 8; k++)
-                        ac_val2[k + 8] = (ac_val2[k + 8] * q2 * ff_vc1_dqscale[q1 - 1] + 0x20000) >> 18;
-                }
-            }
-        }
-
-        /* apply AC prediction if needed */
-        if (use_pred) {
-            if (dc_pred_dir) { // left
-                for (k = 1; k < 8; k++) {
-                    block[k << v->left_blk_sh] = ac_val2[k] * scale;
-                    if (!v->pquantizer && block[k << v->left_blk_sh])
-                        block[k << v->left_blk_sh] += (block[k << v->left_blk_sh] < 0) ? -mquant : mquant;
-                }
-            } else { // top
-                for (k = 1; k < 8; k++) {
-                    block[k << v->top_blk_sh] = ac_val2[k + 8] * scale;
-                    if (!v->pquantizer && block[k << v->top_blk_sh])
-                        block[k << v->top_blk_sh] += (block[k << v->top_blk_sh] < 0) ? -mquant : mquant;
-                }
-            }
-            i = 63;
-        }
-    }
-    s->block_last_index[n] = i;
-
-    return 0;
-}
-
-/** Decode P block
- */
-static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n,
-                              int mquant, int ttmb, int first_block,
-                              uint8_t *dst, int linesize, int skip_block,
-                              int *ttmb_out)
-{
-    MpegEncContext *s = &v->s;
-    GetBitContext *gb = &s->gb;
-    int i, j;
-    int subblkpat = 0;
-    int scale, off, idx, last, skip, value;
-    int ttblk = ttmb & 7;
-    int pat = 0;
-
-    s->dsp.clear_block(block);
-
-    if (ttmb == -1) {
-        ttblk = ff_vc1_ttblk_to_tt[v->tt_index][get_vlc2(gb, ff_vc1_ttblk_vlc[v->tt_index].table, VC1_TTBLK_VLC_BITS, 1)];
-    }
-    if (ttblk == TT_4X4) {
-        subblkpat = ~(get_vlc2(gb, ff_vc1_subblkpat_vlc[v->tt_index].table, VC1_SUBBLKPAT_VLC_BITS, 1) + 1);
-    }
-    if ((ttblk != TT_8X8 && ttblk != TT_4X4)
-        && ((v->ttmbf || (ttmb != -1 && (ttmb & 8) && !first_block))
-            || (!v->res_rtm_flag && !first_block))) {
-        subblkpat = decode012(gb);
-        if (subblkpat)
-            subblkpat ^= 3; // swap decoded pattern bits
-        if (ttblk == TT_8X4_TOP || ttblk == TT_8X4_BOTTOM)
-            ttblk = TT_8X4;
-        if (ttblk == TT_4X8_RIGHT || ttblk == TT_4X8_LEFT)
-            ttblk = TT_4X8;
-    }
-    scale = 2 * mquant + ((v->pq == mquant) ? v->halfpq : 0);
-
-    // convert transforms like 8X4_TOP to generic TT and SUBBLKPAT
-    if (ttblk == TT_8X4_TOP || ttblk == TT_8X4_BOTTOM) {
-        subblkpat = 2 - (ttblk == TT_8X4_TOP);
-        ttblk     = TT_8X4;
-    }
-    if (ttblk == TT_4X8_RIGHT || ttblk == TT_4X8_LEFT) {
-        subblkpat = 2 - (ttblk == TT_4X8_LEFT);
-        ttblk     = TT_4X8;
-    }
-    switch (ttblk) {
-    case TT_8X8:
-        pat  = 0xF;
-        i    = 0;
-        last = 0;
-        while (!last) {
-            vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
-            i += skip;
-            if (i > 63)
-                break;
-            if (!v->fcm)
-                idx = v->zz_8x8[0][i++];
-            else
-                idx = v->zzi_8x8[i++];
-            block[idx] = value * scale;
-            if (!v->pquantizer)
-                block[idx] += (block[idx] < 0) ? -mquant : mquant;
-        }
-        if (!skip_block) {
-            if (i == 1)
-                v->vc1dsp.vc1_inv_trans_8x8_dc(dst, linesize, block);
-            else {
-                v->vc1dsp.vc1_inv_trans_8x8(block);
-                s->dsp.add_pixels_clamped(block, dst, linesize);
-            }
-        }
-        break;
-    case TT_4X4:
-        pat = ~subblkpat & 0xF;
-        for (j = 0; j < 4; j++) {
-            last = subblkpat & (1 << (3 - j));
-            i    = 0;
-            off  = (j & 1) * 4 + (j & 2) * 16;
-            while (!last) {
-                vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
-                i += skip;
-                if (i > 15)
-                    break;
-                if (!v->fcm)
-                    idx = ff_vc1_simple_progressive_4x4_zz[i++];
-                else
-                    idx = ff_vc1_adv_interlaced_4x4_zz[i++];
-                block[idx + off] = value * scale;
-                if (!v->pquantizer)
-                    block[idx + off] += (block[idx + off] < 0) ? -mquant : mquant;
-            }
-            if (!(subblkpat & (1 << (3 - j))) && !skip_block) {
-                if (i == 1)
-                    v->vc1dsp.vc1_inv_trans_4x4_dc(dst + (j & 1) * 4 + (j & 2) * 2 * linesize, linesize, block + off);
-                else
-                    v->vc1dsp.vc1_inv_trans_4x4(dst + (j & 1) * 4 + (j & 2) *  2 * linesize, linesize, block + off);
-            }
-        }
-        break;
-    case TT_8X4:
-        pat = ~((subblkpat & 2) * 6 + (subblkpat & 1) * 3) & 0xF;
-        for (j = 0; j < 2; j++) {
-            last = subblkpat & (1 << (1 - j));
-            i    = 0;
-            off  = j * 32;
-            while (!last) {
-                vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
-                i += skip;
-                if (i > 31)
-                    break;
-                if (!v->fcm)
-                    idx = v->zz_8x4[i++] + off;
-                else
-                    idx = ff_vc1_adv_interlaced_8x4_zz[i++] + off;
-                block[idx] = value * scale;
-                if (!v->pquantizer)
-                    block[idx] += (block[idx] < 0) ? -mquant : mquant;
-            }
-            if (!(subblkpat & (1 << (1 - j))) && !skip_block) {
-                if (i == 1)
-                    v->vc1dsp.vc1_inv_trans_8x4_dc(dst + j * 4 * linesize, linesize, block + off);
-                else
-                    v->vc1dsp.vc1_inv_trans_8x4(dst + j * 4 * linesize, linesize, block + off);
-            }
-        }
-        break;
-    case TT_4X8:
-        pat = ~(subblkpat * 5) & 0xF;
-        for (j = 0; j < 2; j++) {
-            last = subblkpat & (1 << (1 - j));
-            i    = 0;
-            off  = j * 4;
-            while (!last) {
-                vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
-                i += skip;
-                if (i > 31)
-                    break;
-                if (!v->fcm)
-                    idx = v->zz_4x8[i++] + off;
-                else
-                    idx = ff_vc1_adv_interlaced_4x8_zz[i++] + off;
-                block[idx] = value * scale;
-                if (!v->pquantizer)
-                    block[idx] += (block[idx] < 0) ? -mquant : mquant;
-            }
-            if (!(subblkpat & (1 << (1 - j))) && !skip_block) {
-                if (i == 1)
-                    v->vc1dsp.vc1_inv_trans_4x8_dc(dst + j * 4, linesize, block + off);
-                else
-                    v->vc1dsp.vc1_inv_trans_4x8(dst + j*4, linesize, block + off);
-            }
-        }
-        break;
-    }
-    if (ttmb_out)
-        *ttmb_out |= ttblk << (n * 4);
-    return pat;
-}
-
-/** @} */ // Macroblock group
-
-static const int size_table  [6] = { 0, 2, 3, 4,  5,  8 };
-static const int offset_table[6] = { 0, 1, 3, 7, 15, 31 };
-
-static av_always_inline void vc1_apply_p_v_loop_filter(VC1Context *v, int block_num)
-{
-    MpegEncContext *s  = &v->s;
-    int mb_cbp         = v->cbp[s->mb_x - s->mb_stride],
-        block_cbp      = mb_cbp      >> (block_num * 4), bottom_cbp,
-        mb_is_intra    = v->is_intra[s->mb_x - s->mb_stride],
-        block_is_intra = mb_is_intra >> (block_num * 4), bottom_is_intra;
-    int idx, linesize  = block_num > 3 ? s->uvlinesize : s->linesize, ttblk;
-    uint8_t *dst;
-
-    if (block_num > 3) {
-        dst      = s->dest[block_num - 3];
-    } else {
-        dst      = s->dest[0] + (block_num & 1) * 8 + ((block_num & 2) * 4 - 8) * linesize;
-    }
-    if (s->mb_y != s->end_mb_y || block_num < 2) {
-        int16_t (*mv)[2];
-        int mv_stride;
-
-        if (block_num > 3) {
-            bottom_cbp      = v->cbp[s->mb_x]      >> (block_num * 4);
-            bottom_is_intra = v->is_intra[s->mb_x] >> (block_num * 4);
-            mv              = &v->luma_mv[s->mb_x - s->mb_stride];
-            mv_stride       = s->mb_stride;
-        } else {
-            bottom_cbp      = (block_num < 2) ? (mb_cbp               >> ((block_num + 2) * 4))
-                                              : (v->cbp[s->mb_x]      >> ((block_num - 2) * 4));
-            bottom_is_intra = (block_num < 2) ? (mb_is_intra          >> ((block_num + 2) * 4))
-                                              : (v->is_intra[s->mb_x] >> ((block_num - 2) * 4));
-            mv_stride       = s->b8_stride;
-            mv              = &s->current_picture.motion_val[0][s->block_index[block_num] - 2 * mv_stride];
-        }
-
-        if (bottom_is_intra & 1 || block_is_intra & 1 ||
-            mv[0][0] != mv[mv_stride][0] || mv[0][1] != mv[mv_stride][1]) {
-            v->vc1dsp.vc1_v_loop_filter8(dst, linesize, v->pq);
-        } else {
-            idx = ((bottom_cbp >> 2) | block_cbp) & 3;
-            if (idx == 3) {
-                v->vc1dsp.vc1_v_loop_filter8(dst, linesize, v->pq);
-            } else if (idx) {
-                if (idx == 1)
-                    v->vc1dsp.vc1_v_loop_filter4(dst + 4, linesize, v->pq);
-                else
-                    v->vc1dsp.vc1_v_loop_filter4(dst,     linesize, v->pq);
-            }
-        }
-    }
-
-    dst -= 4 * linesize;
-    ttblk = (v->ttblk[s->mb_x - s->mb_stride] >> (block_num * 4)) & 0xF;
-    if (ttblk == TT_4X4 || ttblk == TT_8X4) {
-        idx = (block_cbp | (block_cbp >> 2)) & 3;
-        if (idx == 3) {
-            v->vc1dsp.vc1_v_loop_filter8(dst, linesize, v->pq);
-        } else if (idx) {
-            if (idx == 1)
-                v->vc1dsp.vc1_v_loop_filter4(dst + 4, linesize, v->pq);
-            else
-                v->vc1dsp.vc1_v_loop_filter4(dst,     linesize, v->pq);
-        }
-    }
-}
-
-static av_always_inline void vc1_apply_p_h_loop_filter(VC1Context *v, int block_num)
-{
-    MpegEncContext *s  = &v->s;
-    int mb_cbp         = v->cbp[s->mb_x - 1 - s->mb_stride],
-        block_cbp      = mb_cbp      >> (block_num * 4), right_cbp,
-        mb_is_intra    = v->is_intra[s->mb_x - 1 - s->mb_stride],
-        block_is_intra = mb_is_intra >> (block_num * 4), right_is_intra;
-    int idx, linesize  = block_num > 3 ? s->uvlinesize : s->linesize, ttblk;
-    uint8_t *dst;
-
-    if (block_num > 3) {
-        dst = s->dest[block_num - 3] - 8 * linesize;
-    } else {
-        dst = s->dest[0] + (block_num & 1) * 8 + ((block_num & 2) * 4 - 16) * linesize - 8;
-    }
-
-    if (s->mb_x != s->mb_width || !(block_num & 5)) {
-        int16_t (*mv)[2];
-
-        if (block_num > 3) {
-            right_cbp      = v->cbp[s->mb_x - s->mb_stride] >> (block_num * 4);
-            right_is_intra = v->is_intra[s->mb_x - s->mb_stride] >> (block_num * 4);
-            mv             = &v->luma_mv[s->mb_x - s->mb_stride - 1];
-        } else {
-            right_cbp      = (block_num & 1) ? (v->cbp[s->mb_x - s->mb_stride]      >> ((block_num - 1) * 4))
-                                             : (mb_cbp                              >> ((block_num + 1) * 4));
-            right_is_intra = (block_num & 1) ? (v->is_intra[s->mb_x - s->mb_stride] >> ((block_num - 1) * 4))
-                                             : (mb_is_intra                         >> ((block_num + 1) * 4));
-            mv             = &s->current_picture.motion_val[0][s->block_index[block_num] - s->b8_stride * 2 - 2];
-        }
-        if (block_is_intra & 1 || right_is_intra & 1 || mv[0][0] != mv[1][0] || mv[0][1] != mv[1][1]) {
-            v->vc1dsp.vc1_h_loop_filter8(dst, linesize, v->pq);
-        } else {
-            idx = ((right_cbp >> 1) | block_cbp) & 5; // FIXME check
-            if (idx == 5) {
-                v->vc1dsp.vc1_h_loop_filter8(dst, linesize, v->pq);
-            } else if (idx) {
-                if (idx == 1)
-                    v->vc1dsp.vc1_h_loop_filter4(dst + 4 * linesize, linesize, v->pq);
-                else
-                    v->vc1dsp.vc1_h_loop_filter4(dst,                linesize, v->pq);
-            }
-        }
-    }
-
-    dst -= 4;
-    ttblk = (v->ttblk[s->mb_x - s->mb_stride - 1] >> (block_num * 4)) & 0xf;
-    if (ttblk == TT_4X4 || ttblk == TT_4X8) {
-        idx = (block_cbp | (block_cbp >> 1)) & 5;
-        if (idx == 5) {
-            v->vc1dsp.vc1_h_loop_filter8(dst, linesize, v->pq);
-        } else if (idx) {
-            if (idx == 1)
-                v->vc1dsp.vc1_h_loop_filter4(dst + linesize * 4, linesize, v->pq);
-            else
-                v->vc1dsp.vc1_h_loop_filter4(dst,                linesize, v->pq);
-        }
-    }
-}
-
-static void vc1_apply_p_loop_filter(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    int i;
-
-    for (i = 0; i < 6; i++) {
-        vc1_apply_p_v_loop_filter(v, i);
-    }
-
-    /* V always precedes H, therefore we run H one MB before V;
-     * at the end of a row, we catch up to complete the row */
-    if (s->mb_x) {
-        for (i = 0; i < 6; i++) {
-            vc1_apply_p_h_loop_filter(v, i);
-        }
-        if (s->mb_x == s->mb_width - 1) {
-            s->mb_x++;
-            ff_update_block_index(s);
-            for (i = 0; i < 6; i++) {
-                vc1_apply_p_h_loop_filter(v, i);
-            }
-        }
-    }
-}
-
-/** Decode one P-frame MB
- */
-static int vc1_decode_p_mb(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    GetBitContext *gb = &s->gb;
-    int i, j;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int cbp; /* cbp decoding stuff */
-    int mqdiff, mquant; /* MB quantization */
-    int ttmb = v->ttfrm; /* MB Transform type */
-
-    int mb_has_coeffs = 1; /* last_flag */
-    int dmv_x, dmv_y; /* Differential MV components */
-    int index, index1; /* LUT indexes */
-    int val, sign; /* temp values */
-    int first_block = 1;
-    int dst_idx, off;
-    int skipped, fourmv;
-    int block_cbp = 0, pat, block_tt = 0, block_intra = 0;
-
-    mquant = v->pq; /* lossy initialization */
-
-    if (v->mv_type_is_raw)
-        fourmv = get_bits1(gb);
-    else
-        fourmv = v->mv_type_mb_plane[mb_pos];
-    if (v->skip_is_raw)
-        skipped = get_bits1(gb);
-    else
-        skipped = v->s.mbskip_table[mb_pos];
-
-    if (!fourmv) { /* 1MV mode */
-        if (!skipped) {
-            GET_MVDATA(dmv_x, dmv_y);
-
-            if (s->mb_intra) {
-                s->current_picture.motion_val[1][s->block_index[0]][0] = 0;
-                s->current_picture.motion_val[1][s->block_index[0]][1] = 0;
-            }
-            s->current_picture.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16;
-            vc1_pred_mv(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 0, 0);
-
-            /* FIXME Set DC val for inter block ? */
-            if (s->mb_intra && !mb_has_coeffs) {
-                GET_MQUANT();
-                s->ac_pred = get_bits1(gb);
-                cbp        = 0;
-            } else if (mb_has_coeffs) {
-                if (s->mb_intra)
-                    s->ac_pred = get_bits1(gb);
-                cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-                GET_MQUANT();
-            } else {
-                mquant = v->pq;
-                cbp    = 0;
-            }
-            s->current_picture.qscale_table[mb_pos] = mquant;
-
-            if (!v->ttmbf && !s->mb_intra && mb_has_coeffs)
-                ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table,
-                                VC1_TTMB_VLC_BITS, 2);
-            if (!s->mb_intra) vc1_mc_1mv(v, 0);
-            dst_idx = 0;
-            for (i = 0; i < 6; i++) {
-                s->dc_val[0][s->block_index[i]] = 0;
-                dst_idx += i >> 2;
-                val = ((cbp >> (5 - i)) & 1);
-                off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
-                v->mb_type[0][s->block_index[i]] = s->mb_intra;
-                if (s->mb_intra) {
-                    /* check if prediction blocks A and C are available */
-                    v->a_avail = v->c_avail = 0;
-                    if (i == 2 || i == 3 || !s->first_slice_line)
-                        v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
-                    if (i == 1 || i == 3 || s->mb_x)
-                        v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
-                    vc1_decode_intra_block(v, s->block[i], i, val, mquant,
-                                           (i & 4) ? v->codingset2 : v->codingset);
-                    if ((i>3) && (s->flags & CODEC_FLAG_GRAY))
-                        continue;
-                    v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
-                    if (v->rangeredfrm)
-                        for (j = 0; j < 64; j++)
-                            s->block[i][j] <<= 1;
-                    s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
-                    if (v->pq >= 9 && v->overlap) {
-                        if (v->c_avail)
-                            v->vc1dsp.vc1_h_overlap(s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
-                        if (v->a_avail)
-                            v->vc1dsp.vc1_v_overlap(s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
-                    }
-                    block_cbp   |= 0xF << (i << 2);
-                    block_intra |= 1 << i;
-                } else if (val) {
-                    pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block,
-                                             s->dest[dst_idx] + off, (i & 4) ? s->uvlinesize : s->linesize,
-                                             (i & 4) && (s->flags & CODEC_FLAG_GRAY), &block_tt);
-                    block_cbp |= pat << (i << 2);
-                    if (!v->ttmbf && ttmb < 8)
-                        ttmb = -1;
-                    first_block = 0;
-                }
-            }
-        } else { // skipped
-            s->mb_intra = 0;
-            for (i = 0; i < 6; i++) {
-                v->mb_type[0][s->block_index[i]] = 0;
-                s->dc_val[0][s->block_index[i]]  = 0;
-            }
-            s->current_picture.mb_type[mb_pos]      = MB_TYPE_SKIP;
-            s->current_picture.qscale_table[mb_pos] = 0;
-            vc1_pred_mv(v, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0], 0, 0);
-            vc1_mc_1mv(v, 0);
-        }
-    } else { // 4MV mode
-        if (!skipped /* unskipped MB */) {
-            int intra_count = 0, coded_inter = 0;
-            int is_intra[6], is_coded[6];
-            /* Get CBPCY */
-            cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-            for (i = 0; i < 6; i++) {
-                val = ((cbp >> (5 - i)) & 1);
-                s->dc_val[0][s->block_index[i]] = 0;
-                s->mb_intra                     = 0;
-                if (i < 4) {
-                    dmv_x = dmv_y = 0;
-                    s->mb_intra   = 0;
-                    mb_has_coeffs = 0;
-                    if (val) {
-                        GET_MVDATA(dmv_x, dmv_y);
-                    }
-                    vc1_pred_mv(v, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0], 0, 0);
-                    if (!s->mb_intra)
-                        vc1_mc_4mv_luma(v, i, 0, 0);
-                    intra_count += s->mb_intra;
-                    is_intra[i]  = s->mb_intra;
-                    is_coded[i]  = mb_has_coeffs;
-                }
-                if (i & 4) {
-                    is_intra[i] = (intra_count >= 3);
-                    is_coded[i] = val;
-                }
-                if (i == 4)
-                    vc1_mc_4mv_chroma(v, 0);
-                v->mb_type[0][s->block_index[i]] = is_intra[i];
-                if (!coded_inter)
-                    coded_inter = !is_intra[i] & is_coded[i];
-            }
-            // if there are no coded blocks then don't do anything more
-            dst_idx = 0;
-            if (!intra_count && !coded_inter)
-                goto end;
-            GET_MQUANT();
-            s->current_picture.qscale_table[mb_pos] = mquant;
-            /* test if block is intra and has pred */
-            {
-                int intrapred = 0;
-                for (i = 0; i < 6; i++)
-                    if (is_intra[i]) {
-                        if (((!s->first_slice_line || (i == 2 || i == 3)) && v->mb_type[0][s->block_index[i] - s->block_wrap[i]])
-                            || ((s->mb_x || (i == 1 || i == 3)) && v->mb_type[0][s->block_index[i] - 1])) {
-                            intrapred = 1;
-                            break;
-                        }
-                    }
-                if (intrapred)
-                    s->ac_pred = get_bits1(gb);
-                else
-                    s->ac_pred = 0;
-            }
-            if (!v->ttmbf && coded_inter)
-                ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
-            for (i = 0; i < 6; i++) {
-                dst_idx    += i >> 2;
-                off         = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
-                s->mb_intra = is_intra[i];
-                if (is_intra[i]) {
-                    /* check if prediction blocks A and C are available */
-                    v->a_avail = v->c_avail = 0;
-                    if (i == 2 || i == 3 || !s->first_slice_line)
-                        v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
-                    if (i == 1 || i == 3 || s->mb_x)
-                        v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
-                    vc1_decode_intra_block(v, s->block[i], i, is_coded[i], mquant,
-                                           (i & 4) ? v->codingset2 : v->codingset);
-                    if ((i>3) && (s->flags & CODEC_FLAG_GRAY))
-                        continue;
-                    v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
-                    if (v->rangeredfrm)
-                        for (j = 0; j < 64; j++)
-                            s->block[i][j] <<= 1;
-                    s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off,
-                                                     (i & 4) ? s->uvlinesize : s->linesize);
-                    if (v->pq >= 9 && v->overlap) {
-                        if (v->c_avail)
-                            v->vc1dsp.vc1_h_overlap(s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
-                        if (v->a_avail)
-                            v->vc1dsp.vc1_v_overlap(s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
-                    }
-                    block_cbp   |= 0xF << (i << 2);
-                    block_intra |= 1 << i;
-                } else if (is_coded[i]) {
-                    pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
-                                             first_block, s->dest[dst_idx] + off,
-                                             (i & 4) ? s->uvlinesize : s->linesize,
-                                             (i & 4) && (s->flags & CODEC_FLAG_GRAY),
-                                             &block_tt);
-                    block_cbp |= pat << (i << 2);
-                    if (!v->ttmbf && ttmb < 8)
-                        ttmb = -1;
-                    first_block = 0;
-                }
-            }
-        } else { // skipped MB
-            s->mb_intra                               = 0;
-            s->current_picture.qscale_table[mb_pos] = 0;
-            for (i = 0; i < 6; i++) {
-                v->mb_type[0][s->block_index[i]] = 0;
-                s->dc_val[0][s->block_index[i]]  = 0;
-            }
-            for (i = 0; i < 4; i++) {
-                vc1_pred_mv(v, i, 0, 0, 0, v->range_x, v->range_y, v->mb_type[0], 0, 0);
-                vc1_mc_4mv_luma(v, i, 0, 0);
-            }
-            vc1_mc_4mv_chroma(v, 0);
-            s->current_picture.qscale_table[mb_pos] = 0;
-        }
-    }
-end:
-    v->cbp[s->mb_x]      = block_cbp;
-    v->ttblk[s->mb_x]    = block_tt;
-    v->is_intra[s->mb_x] = block_intra;
-
-    return 0;
-}
-
-/* Decode one macroblock in an interlaced frame p picture */
-
-static int vc1_decode_p_mb_intfr(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    GetBitContext *gb = &s->gb;
-    int i;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int cbp = 0; /* cbp decoding stuff */
-    int mqdiff, mquant; /* MB quantization */
-    int ttmb = v->ttfrm; /* MB Transform type */
-
-    int mb_has_coeffs = 1; /* last_flag */
-    int dmv_x, dmv_y; /* Differential MV components */
-    int val; /* temp value */
-    int first_block = 1;
-    int dst_idx, off;
-    int skipped, fourmv = 0, twomv = 0;
-    int block_cbp = 0, pat, block_tt = 0;
-    int idx_mbmode = 0, mvbp;
-    int stride_y, fieldtx;
-
-    mquant = v->pq; /* Loosy initialization */
-
-    if (v->skip_is_raw)
-        skipped = get_bits1(gb);
-    else
-        skipped = v->s.mbskip_table[mb_pos];
-    if (!skipped) {
-        if (v->fourmvswitch)
-            idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_INTFR_4MV_MBMODE_VLC_BITS, 2); // try getting this done
-        else
-            idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 2); // in a single line
-        switch (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0]) {
-        /* store the motion vector type in a flag (useful later) */
-        case MV_PMODE_INTFR_4MV:
-            fourmv = 1;
-            v->blk_mv_type[s->block_index[0]] = 0;
-            v->blk_mv_type[s->block_index[1]] = 0;
-            v->blk_mv_type[s->block_index[2]] = 0;
-            v->blk_mv_type[s->block_index[3]] = 0;
-            break;
-        case MV_PMODE_INTFR_4MV_FIELD:
-            fourmv = 1;
-            v->blk_mv_type[s->block_index[0]] = 1;
-            v->blk_mv_type[s->block_index[1]] = 1;
-            v->blk_mv_type[s->block_index[2]] = 1;
-            v->blk_mv_type[s->block_index[3]] = 1;
-            break;
-        case MV_PMODE_INTFR_2MV_FIELD:
-            twomv = 1;
-            v->blk_mv_type[s->block_index[0]] = 1;
-            v->blk_mv_type[s->block_index[1]] = 1;
-            v->blk_mv_type[s->block_index[2]] = 1;
-            v->blk_mv_type[s->block_index[3]] = 1;
-            break;
-        case MV_PMODE_INTFR_1MV:
-            v->blk_mv_type[s->block_index[0]] = 0;
-            v->blk_mv_type[s->block_index[1]] = 0;
-            v->blk_mv_type[s->block_index[2]] = 0;
-            v->blk_mv_type[s->block_index[3]] = 0;
-            break;
-        }
-        if (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_INTRA) { // intra MB
-            for (i = 0; i < 4; i++) {
-                s->current_picture.motion_val[1][s->block_index[i]][0] = 0;
-                s->current_picture.motion_val[1][s->block_index[i]][1] = 0;
-            }
-            s->current_picture.mb_type[mb_pos]                     = MB_TYPE_INTRA;
-            s->mb_intra = v->is_intra[s->mb_x] = 1;
-            for (i = 0; i < 6; i++)
-                v->mb_type[0][s->block_index[i]] = 1;
-            fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb);
-            mb_has_coeffs = get_bits1(gb);
-            if (mb_has_coeffs)
-                cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-            v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb);
-            GET_MQUANT();
-            s->current_picture.qscale_table[mb_pos] = mquant;
-            /* Set DC scale - y and c use the same (not sure if necessary here) */
-            s->y_dc_scale = s->y_dc_scale_table[mquant];
-            s->c_dc_scale = s->c_dc_scale_table[mquant];
-            dst_idx = 0;
-            for (i = 0; i < 6; i++) {
-                s->dc_val[0][s->block_index[i]] = 0;
-                dst_idx += i >> 2;
-                val = ((cbp >> (5 - i)) & 1);
-                v->mb_type[0][s->block_index[i]] = s->mb_intra;
-                v->a_avail = v->c_avail = 0;
-                if (i == 2 || i == 3 || !s->first_slice_line)
-                    v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
-                if (i == 1 || i == 3 || s->mb_x)
-                    v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
-                vc1_decode_intra_block(v, s->block[i], i, val, mquant,
-                                       (i & 4) ? v->codingset2 : v->codingset);
-                if ((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue;
-                v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
-                if (i < 4) {
-                    stride_y = s->linesize << fieldtx;
-                    off = (fieldtx) ? ((i & 1) * 8) + ((i & 2) >> 1) * s->linesize : (i & 1) * 8 + 4 * (i & 2) * s->linesize;
-                } else {
-                    stride_y = s->uvlinesize;
-                    off = 0;
-                }
-                s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, stride_y);
-                //TODO: loop filter
-            }
-
-        } else { // inter MB
-            mb_has_coeffs = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][3];
-            if (mb_has_coeffs)
-                cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-            if (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_2MV_FIELD) {
-                v->twomvbp = get_vlc2(gb, v->twomvbp_vlc->table, VC1_2MV_BLOCK_PATTERN_VLC_BITS, 1);
-            } else {
-                if ((ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_4MV)
-                    || (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_4MV_FIELD)) {
-                    v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1);
-                }
-            }
-            s->mb_intra = v->is_intra[s->mb_x] = 0;
-            for (i = 0; i < 6; i++)
-                v->mb_type[0][s->block_index[i]] = 0;
-            fieldtx = v->fieldtx_plane[mb_pos] = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][1];
-            /* for all motion vector read MVDATA and motion compensate each block */
-            dst_idx = 0;
-            if (fourmv) {
-                mvbp = v->fourmvbp;
-                for (i = 0; i < 6; i++) {
-                    if (i < 4) {
-                        dmv_x = dmv_y = 0;
-                        val   = ((mvbp >> (3 - i)) & 1);
-                        if (val) {
-                            get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-                        }
-                        vc1_pred_mv_intfr(v, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0], 0);
-                        vc1_mc_4mv_luma(v, i, 0, 0);
-                    } else if (i == 4) {
-                        vc1_mc_4mv_chroma4(v, 0, 0, 0);
-                    }
-                }
-            } else if (twomv) {
-                mvbp  = v->twomvbp;
-                dmv_x = dmv_y = 0;
-                if (mvbp & 2) {
-                    get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-                }
-                vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], 0);
-                vc1_mc_4mv_luma(v, 0, 0, 0);
-                vc1_mc_4mv_luma(v, 1, 0, 0);
-                dmv_x = dmv_y = 0;
-                if (mvbp & 1) {
-                    get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-                }
-                vc1_pred_mv_intfr(v, 2, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], 0);
-                vc1_mc_4mv_luma(v, 2, 0, 0);
-                vc1_mc_4mv_luma(v, 3, 0, 0);
-                vc1_mc_4mv_chroma4(v, 0, 0, 0);
-            } else {
-                mvbp = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][2];
-                dmv_x = dmv_y = 0;
-                if (mvbp) {
-                    get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-                }
-                vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 0);
-                vc1_mc_1mv(v, 0);
-            }
-            if (cbp)
-                GET_MQUANT();  // p. 227
-            s->current_picture.qscale_table[mb_pos] = mquant;
-            if (!v->ttmbf && cbp)
-                ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
-            for (i = 0; i < 6; i++) {
-                s->dc_val[0][s->block_index[i]] = 0;
-                dst_idx += i >> 2;
-                val = ((cbp >> (5 - i)) & 1);
-                if (!fieldtx)
-                    off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
-                else
-                    off = (i & 4) ? 0 : ((i & 1) * 8 + ((i > 1) * s->linesize));
-                if (val) {
-                    pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
-                                             first_block, s->dest[dst_idx] + off,
-                                             (i & 4) ? s->uvlinesize : (s->linesize << fieldtx),
-                                             (i & 4) && (s->flags & CODEC_FLAG_GRAY), &block_tt);
-                    block_cbp |= pat << (i << 2);
-                    if (!v->ttmbf && ttmb < 8)
-                        ttmb = -1;
-                    first_block = 0;
-                }
-            }
-        }
-    } else { // skipped
-        s->mb_intra = v->is_intra[s->mb_x] = 0;
-        for (i = 0; i < 6; i++) {
-            v->mb_type[0][s->block_index[i]] = 0;
-            s->dc_val[0][s->block_index[i]] = 0;
-        }
-        s->current_picture.mb_type[mb_pos]      = MB_TYPE_SKIP;
-        s->current_picture.qscale_table[mb_pos] = 0;
-        v->blk_mv_type[s->block_index[0]] = 0;
-        v->blk_mv_type[s->block_index[1]] = 0;
-        v->blk_mv_type[s->block_index[2]] = 0;
-        v->blk_mv_type[s->block_index[3]] = 0;
-        vc1_pred_mv_intfr(v, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0], 0);
-        vc1_mc_1mv(v, 0);
-    }
-    if (s->mb_x == s->mb_width - 1)
-        memmove(v->is_intra_base, v->is_intra, sizeof(v->is_intra_base[0])*s->mb_stride);
-    return 0;
-}
-
-static int vc1_decode_p_mb_intfi(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    GetBitContext *gb = &s->gb;
-    int i;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int cbp = 0; /* cbp decoding stuff */
-    int mqdiff, mquant; /* MB quantization */
-    int ttmb = v->ttfrm; /* MB Transform type */
-
-    int mb_has_coeffs = 1; /* last_flag */
-    int dmv_x, dmv_y; /* Differential MV components */
-    int val; /* temp values */
-    int first_block = 1;
-    int dst_idx, off;
-    int pred_flag;
-    int block_cbp = 0, pat, block_tt = 0;
-    int idx_mbmode = 0;
-
-    mquant = v->pq; /* Loosy initialization */
-
-    idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_IF_MBMODE_VLC_BITS, 2);
-    if (idx_mbmode <= 1) { // intra MB
-        s->mb_intra = v->is_intra[s->mb_x] = 1;
-        s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0;
-        s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0;
-        s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA;
-        GET_MQUANT();
-        s->current_picture.qscale_table[mb_pos] = mquant;
-        /* Set DC scale - y and c use the same (not sure if necessary here) */
-        s->y_dc_scale = s->y_dc_scale_table[mquant];
-        s->c_dc_scale = s->c_dc_scale_table[mquant];
-        v->s.ac_pred  = v->acpred_plane[mb_pos] = get_bits1(gb);
-        mb_has_coeffs = idx_mbmode & 1;
-        if (mb_has_coeffs)
-            cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_ICBPCY_VLC_BITS, 2);
-        dst_idx = 0;
-        for (i = 0; i < 6; i++) {
-            s->dc_val[0][s->block_index[i]]  = 0;
-            v->mb_type[0][s->block_index[i]] = 1;
-            dst_idx += i >> 2;
-            val = ((cbp >> (5 - i)) & 1);
-            v->a_avail = v->c_avail = 0;
-            if (i == 2 || i == 3 || !s->first_slice_line)
-                v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
-            if (i == 1 || i == 3 || s->mb_x)
-                v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
-            vc1_decode_intra_block(v, s->block[i], i, val, mquant,
-                                   (i & 4) ? v->codingset2 : v->codingset);
-            if ((i>3) && (s->flags & CODEC_FLAG_GRAY))
-                continue;
-            v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
-            off  = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
-            s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i & 4) ? s->uvlinesize : s->linesize);
-            // TODO: loop filter
-        }
-    } else {
-        s->mb_intra = v->is_intra[s->mb_x] = 0;
-        s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16;
-        for (i = 0; i < 6; i++) v->mb_type[0][s->block_index[i]] = 0;
-        if (idx_mbmode <= 5) { // 1-MV
-            dmv_x = dmv_y = pred_flag = 0;
-            if (idx_mbmode & 1) {
-                get_mvdata_interlaced(v, &dmv_x, &dmv_y, &pred_flag);
-            }
-            vc1_pred_mv(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], pred_flag, 0);
-            vc1_mc_1mv(v, 0);
-            mb_has_coeffs = !(idx_mbmode & 2);
-        } else { // 4-MV
-            v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1);
-            for (i = 0; i < 6; i++) {
-                if (i < 4) {
-                    dmv_x = dmv_y = pred_flag = 0;
-                    val   = ((v->fourmvbp >> (3 - i)) & 1);
-                    if (val) {
-                        get_mvdata_interlaced(v, &dmv_x, &dmv_y, &pred_flag);
-                    }
-                    vc1_pred_mv(v, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0], pred_flag, 0);
-                    vc1_mc_4mv_luma(v, i, 0, 0);
-                } else if (i == 4)
-                    vc1_mc_4mv_chroma(v, 0);
-            }
-            mb_has_coeffs = idx_mbmode & 1;
-        }
-        if (mb_has_coeffs)
-            cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-        if (cbp) {
-            GET_MQUANT();
-        }
-        s->current_picture.qscale_table[mb_pos] = mquant;
-        if (!v->ttmbf && cbp) {
-            ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
-        }
-        dst_idx = 0;
-        for (i = 0; i < 6; i++) {
-            s->dc_val[0][s->block_index[i]] = 0;
-            dst_idx += i >> 2;
-            val = ((cbp >> (5 - i)) & 1);
-            off = (i & 4) ? 0 : (i & 1) * 8 + (i & 2) * 4 * s->linesize;
-            if (val) {
-                pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
-                                         first_block, s->dest[dst_idx] + off,
-                                         (i & 4) ? s->uvlinesize : s->linesize,
-                                         (i & 4) && (s->flags & CODEC_FLAG_GRAY),
-                                         &block_tt);
-                block_cbp |= pat << (i << 2);
-                if (!v->ttmbf && ttmb < 8) ttmb = -1;
-                first_block = 0;
-            }
-        }
-    }
-    if (s->mb_x == s->mb_width - 1)
-        memmove(v->is_intra_base, v->is_intra, sizeof(v->is_intra_base[0]) * s->mb_stride);
-    return 0;
-}
-
-/** Decode one B-frame MB (in Main profile)
- */
-static void vc1_decode_b_mb(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    GetBitContext *gb = &s->gb;
-    int i, j;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int cbp = 0; /* cbp decoding stuff */
-    int mqdiff, mquant; /* MB quantization */
-    int ttmb = v->ttfrm; /* MB Transform type */
-    int mb_has_coeffs = 0; /* last_flag */
-    int index, index1; /* LUT indexes */
-    int val, sign; /* temp values */
-    int first_block = 1;
-    int dst_idx, off;
-    int skipped, direct;
-    int dmv_x[2], dmv_y[2];
-    int bmvtype = BMV_TYPE_BACKWARD;
-
-    mquant      = v->pq; /* lossy initialization */
-    s->mb_intra = 0;
-
-    if (v->dmb_is_raw)
-        direct = get_bits1(gb);
-    else
-        direct = v->direct_mb_plane[mb_pos];
-    if (v->skip_is_raw)
-        skipped = get_bits1(gb);
-    else
-        skipped = v->s.mbskip_table[mb_pos];
-
-    dmv_x[0] = dmv_x[1] = dmv_y[0] = dmv_y[1] = 0;
-    for (i = 0; i < 6; i++) {
-        v->mb_type[0][s->block_index[i]] = 0;
-        s->dc_val[0][s->block_index[i]]  = 0;
-    }
-    s->current_picture.qscale_table[mb_pos] = 0;
-
-    if (!direct) {
-        if (!skipped) {
-            GET_MVDATA(dmv_x[0], dmv_y[0]);
-            dmv_x[1] = dmv_x[0];
-            dmv_y[1] = dmv_y[0];
-        }
-        if (skipped || !s->mb_intra) {
-            bmvtype = decode012(gb);
-            switch (bmvtype) {
-            case 0:
-                bmvtype = (v->bfraction >= (B_FRACTION_DEN/2)) ? BMV_TYPE_BACKWARD : BMV_TYPE_FORWARD;
-                break;
-            case 1:
-                bmvtype = (v->bfraction >= (B_FRACTION_DEN/2)) ? BMV_TYPE_FORWARD : BMV_TYPE_BACKWARD;
-                break;
-            case 2:
-                bmvtype  = BMV_TYPE_INTERPOLATED;
-                dmv_x[0] = dmv_y[0] = 0;
-            }
-        }
-    }
-    for (i = 0; i < 6; i++)
-        v->mb_type[0][s->block_index[i]] = s->mb_intra;
-
-    if (skipped) {
-        if (direct)
-            bmvtype = BMV_TYPE_INTERPOLATED;
-        vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
-        vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
-        return;
-    }
-    if (direct) {
-        cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-        GET_MQUANT();
-        s->mb_intra = 0;
-        s->current_picture.qscale_table[mb_pos] = mquant;
-        if (!v->ttmbf)
-            ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
-        dmv_x[0] = dmv_y[0] = dmv_x[1] = dmv_y[1] = 0;
-        vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
-        vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
-    } else {
-        if (!mb_has_coeffs && !s->mb_intra) {
-            /* no coded blocks - effectively skipped */
-            vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
-            vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
-            return;
-        }
-        if (s->mb_intra && !mb_has_coeffs) {
-            GET_MQUANT();
-            s->current_picture.qscale_table[mb_pos] = mquant;
-            s->ac_pred = get_bits1(gb);
-            cbp = 0;
-            vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
-        } else {
-            if (bmvtype == BMV_TYPE_INTERPOLATED) {
-                GET_MVDATA(dmv_x[0], dmv_y[0]);
-                if (!mb_has_coeffs) {
-                    /* interpolated skipped block */
-                    vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
-                    vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
-                    return;
-                }
-            }
-            vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
-            if (!s->mb_intra) {
-                vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
-            }
-            if (s->mb_intra)
-                s->ac_pred = get_bits1(gb);
-            cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-            GET_MQUANT();
-            s->current_picture.qscale_table[mb_pos] = mquant;
-            if (!v->ttmbf && !s->mb_intra && mb_has_coeffs)
-                ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
-        }
-    }
-    dst_idx = 0;
-    for (i = 0; i < 6; i++) {
-        s->dc_val[0][s->block_index[i]] = 0;
-        dst_idx += i >> 2;
-        val = ((cbp >> (5 - i)) & 1);
-        off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
-        v->mb_type[0][s->block_index[i]] = s->mb_intra;
-        if (s->mb_intra) {
-            /* check if prediction blocks A and C are available */
-            v->a_avail = v->c_avail = 0;
-            if (i == 2 || i == 3 || !s->first_slice_line)
-                v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
-            if (i == 1 || i == 3 || s->mb_x)
-                v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
-            vc1_decode_intra_block(v, s->block[i], i, val, mquant,
-                                   (i & 4) ? v->codingset2 : v->codingset);
-            if ((i>3) && (s->flags & CODEC_FLAG_GRAY))
-                continue;
-            v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
-            if (v->rangeredfrm)
-                for (j = 0; j < 64; j++)
-                    s->block[i][j] <<= 1;
-            s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
-        } else if (val) {
-            vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
-                               first_block, s->dest[dst_idx] + off,
-                               (i & 4) ? s->uvlinesize : s->linesize,
-                               (i & 4) && (s->flags & CODEC_FLAG_GRAY), NULL);
-            if (!v->ttmbf && ttmb < 8)
-                ttmb = -1;
-            first_block = 0;
-        }
-    }
-}
-
-/** Decode one B-frame MB (in interlaced field B picture)
- */
-static void vc1_decode_b_mb_intfi(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    GetBitContext *gb = &s->gb;
-    int i, j;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int cbp = 0; /* cbp decoding stuff */
-    int mqdiff, mquant; /* MB quantization */
-    int ttmb = v->ttfrm; /* MB Transform type */
-    int mb_has_coeffs = 0; /* last_flag */
-    int val; /* temp value */
-    int first_block = 1;
-    int dst_idx, off;
-    int fwd;
-    int dmv_x[2], dmv_y[2], pred_flag[2];
-    int bmvtype = BMV_TYPE_BACKWARD;
-    int idx_mbmode, interpmvp;
-
-    mquant      = v->pq; /* Loosy initialization */
-    s->mb_intra = 0;
-
-    idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_IF_MBMODE_VLC_BITS, 2);
-    if (idx_mbmode <= 1) { // intra MB
-        s->mb_intra = v->is_intra[s->mb_x] = 1;
-        s->current_picture.motion_val[1][s->block_index[0]][0] = 0;
-        s->current_picture.motion_val[1][s->block_index[0]][1] = 0;
-        s->current_picture.mb_type[mb_pos + v->mb_off]         = MB_TYPE_INTRA;
-        GET_MQUANT();
-        s->current_picture.qscale_table[mb_pos] = mquant;
-        /* Set DC scale - y and c use the same (not sure if necessary here) */
-        s->y_dc_scale = s->y_dc_scale_table[mquant];
-        s->c_dc_scale = s->c_dc_scale_table[mquant];
-        v->s.ac_pred  = v->acpred_plane[mb_pos] = get_bits1(gb);
-        mb_has_coeffs = idx_mbmode & 1;
-        if (mb_has_coeffs)
-            cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_ICBPCY_VLC_BITS, 2);
-        dst_idx = 0;
-        for (i = 0; i < 6; i++) {
-            s->dc_val[0][s->block_index[i]] = 0;
-            dst_idx += i >> 2;
-            val = ((cbp >> (5 - i)) & 1);
-            v->mb_type[0][s->block_index[i]] = s->mb_intra;
-            v->a_avail                       = v->c_avail = 0;
-            if (i == 2 || i == 3 || !s->first_slice_line)
-                v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
-            if (i == 1 || i == 3 || s->mb_x)
-                v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
-            vc1_decode_intra_block(v, s->block[i], i, val, mquant,
-                                   (i & 4) ? v->codingset2 : v->codingset);
-            if ((i>3) && (s->flags & CODEC_FLAG_GRAY))
-                continue;
-            v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
-            if (v->rangeredfrm)
-                for (j = 0; j < 64; j++)
-                    s->block[i][j] <<= 1;
-            off  = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
-            s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i & 4) ? s->uvlinesize : s->linesize);
-            // TODO: yet to perform loop filter
-        }
-    } else {
-        s->mb_intra = v->is_intra[s->mb_x] = 0;
-        s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16;
-        for (i = 0; i < 6; i++) v->mb_type[0][s->block_index[i]] = 0;
-        if (v->fmb_is_raw)
-            fwd = v->forward_mb_plane[mb_pos] = get_bits1(gb);
-        else
-            fwd = v->forward_mb_plane[mb_pos];
-        if (idx_mbmode <= 5) { // 1-MV
-            dmv_x[0]     = dmv_x[1] = dmv_y[0] = dmv_y[1] = 0;
-            pred_flag[0] = pred_flag[1] = 0;
-            if (fwd)
-                bmvtype = BMV_TYPE_FORWARD;
-            else {
-                bmvtype = decode012(gb);
-                switch (bmvtype) {
-                case 0:
-                    bmvtype = BMV_TYPE_BACKWARD;
-                    break;
-                case 1:
-                    bmvtype = BMV_TYPE_DIRECT;
-                    break;
-                case 2:
-                    bmvtype   = BMV_TYPE_INTERPOLATED;
-                    interpmvp = get_bits1(gb);
-                }
-            }
-            v->bmvtype = bmvtype;
-            if (bmvtype != BMV_TYPE_DIRECT && idx_mbmode & 1) {
-                get_mvdata_interlaced(v, &dmv_x[bmvtype == BMV_TYPE_BACKWARD], &dmv_y[bmvtype == BMV_TYPE_BACKWARD], &pred_flag[bmvtype == BMV_TYPE_BACKWARD]);
-            }
-            if (bmvtype == BMV_TYPE_INTERPOLATED && interpmvp) {
-                get_mvdata_interlaced(v, &dmv_x[1], &dmv_y[1], &pred_flag[1]);
-            }
-            if (bmvtype == BMV_TYPE_DIRECT) {
-                dmv_x[0] = dmv_y[0] = pred_flag[0] = 0;
-                dmv_x[1] = dmv_y[1] = pred_flag[0] = 0;
-            }
-            vc1_pred_b_mv_intfi(v, 0, dmv_x, dmv_y, 1, pred_flag);
-            vc1_b_mc(v, dmv_x, dmv_y, (bmvtype == BMV_TYPE_DIRECT), bmvtype);
-            mb_has_coeffs = !(idx_mbmode & 2);
-        } else { // 4-MV
-            if (fwd)
-                bmvtype = BMV_TYPE_FORWARD;
-            v->bmvtype  = bmvtype;
-            v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1);
-            for (i = 0; i < 6; i++) {
-                if (i < 4) {
-                    dmv_x[0] = dmv_y[0] = pred_flag[0] = 0;
-                    dmv_x[1] = dmv_y[1] = pred_flag[1] = 0;
-                    val = ((v->fourmvbp >> (3 - i)) & 1);
-                    if (val) {
-                        get_mvdata_interlaced(v, &dmv_x[bmvtype == BMV_TYPE_BACKWARD],
-                                                 &dmv_y[bmvtype == BMV_TYPE_BACKWARD],
-                                             &pred_flag[bmvtype == BMV_TYPE_BACKWARD]);
-                    }
-                    vc1_pred_b_mv_intfi(v, i, dmv_x, dmv_y, 0, pred_flag);
-                    vc1_mc_4mv_luma(v, i, bmvtype == BMV_TYPE_BACKWARD, 0);
-                } else if (i == 4)
-                    vc1_mc_4mv_chroma(v, bmvtype == BMV_TYPE_BACKWARD);
-            }
-            mb_has_coeffs = idx_mbmode & 1;
-        }
-        if (mb_has_coeffs)
-            cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-        if (cbp) {
-            GET_MQUANT();
-        }
-        s->current_picture.qscale_table[mb_pos] = mquant;
-        if (!v->ttmbf && cbp) {
-            ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
-        }
-        dst_idx = 0;
-        for (i = 0; i < 6; i++) {
-            s->dc_val[0][s->block_index[i]] = 0;
-            dst_idx += i >> 2;
-            val = ((cbp >> (5 - i)) & 1);
-            off = (i & 4) ? 0 : (i & 1) * 8 + (i & 2) * 4 * s->linesize;
-            if (val) {
-                vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
-                                   first_block, s->dest[dst_idx] + off,
-                                   (i & 4) ? s->uvlinesize : s->linesize,
-                                   (i & 4) && (s->flags & CODEC_FLAG_GRAY), NULL);
-                if (!v->ttmbf && ttmb < 8)
-                    ttmb = -1;
-                first_block = 0;
-            }
-        }
-    }
-}
-
-/** Decode one B-frame MB (in interlaced frame B picture)
- */
-static int vc1_decode_b_mb_intfr(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    GetBitContext *gb = &s->gb;
-    int i, j;
-    int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int cbp = 0; /* cbp decoding stuff */
-    int mqdiff, mquant; /* MB quantization */
-    int ttmb = v->ttfrm; /* MB Transform type */
-    int mvsw = 0; /* motion vector switch */
-    int mb_has_coeffs = 1; /* last_flag */
-    int dmv_x, dmv_y; /* Differential MV components */
-    int val; /* temp value */
-    int first_block = 1;
-    int dst_idx, off;
-    int skipped, direct, twomv = 0;
-    int block_cbp = 0, pat, block_tt = 0;
-    int idx_mbmode = 0, mvbp;
-    int stride_y, fieldtx;
-    int bmvtype = BMV_TYPE_BACKWARD;
-    int dir, dir2;
-
-    mquant = v->pq; /* Lossy initialization */
-    s->mb_intra = 0;
-    if (v->skip_is_raw)
-        skipped = get_bits1(gb);
-    else
-        skipped = v->s.mbskip_table[mb_pos];
-
-    if (!skipped) {
-        idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 2);
-        if (ff_vc1_mbmode_intfrp[0][idx_mbmode][0] == MV_PMODE_INTFR_2MV_FIELD) {
-            twomv = 1;
-            v->blk_mv_type[s->block_index[0]] = 1;
-            v->blk_mv_type[s->block_index[1]] = 1;
-            v->blk_mv_type[s->block_index[2]] = 1;
-            v->blk_mv_type[s->block_index[3]] = 1;
-        } else {
-            v->blk_mv_type[s->block_index[0]] = 0;
-            v->blk_mv_type[s->block_index[1]] = 0;
-            v->blk_mv_type[s->block_index[2]] = 0;
-            v->blk_mv_type[s->block_index[3]] = 0;
-        }
-    }
-
-    if (v->dmb_is_raw)
-        direct = get_bits1(gb);
-    else
-        direct = v->direct_mb_plane[mb_pos];
-
-    if (direct) {
-        s->mv[0][0][0] = s->current_picture.motion_val[0][s->block_index[0]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][0], v->bfraction, 0, s->quarter_sample);
-        s->mv[0][0][1] = s->current_picture.motion_val[0][s->block_index[0]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][1], v->bfraction, 0, s->quarter_sample);
-        s->mv[1][0][0] = s->current_picture.motion_val[1][s->block_index[0]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][0], v->bfraction, 1, s->quarter_sample);
-        s->mv[1][0][1] = s->current_picture.motion_val[1][s->block_index[0]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][1], v->bfraction, 1, s->quarter_sample);
-
-        if (twomv) {
-            s->mv[0][2][0] = s->current_picture.motion_val[0][s->block_index[2]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][0], v->bfraction, 0, s->quarter_sample);
-            s->mv[0][2][1] = s->current_picture.motion_val[0][s->block_index[2]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][1], v->bfraction, 0, s->quarter_sample);
-            s->mv[1][2][0] = s->current_picture.motion_val[1][s->block_index[2]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][0], v->bfraction, 1, s->quarter_sample);
-            s->mv[1][2][1] = s->current_picture.motion_val[1][s->block_index[2]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][1], v->bfraction, 1, s->quarter_sample);
-
-            for (i = 1; i < 4; i += 2) {
-                s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = s->mv[0][i-1][0];
-                s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = s->mv[0][i-1][1];
-                s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = s->mv[1][i-1][0];
-                s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = s->mv[1][i-1][1];
-            }
-        } else {
-            for (i = 1; i < 4; i++) {
-                s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = s->mv[0][0][0];
-                s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = s->mv[0][0][1];
-                s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = s->mv[1][0][0];
-                s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = s->mv[1][0][1];
-            }
-        }
-    }
-
-    if (ff_vc1_mbmode_intfrp[0][idx_mbmode][0] == MV_PMODE_INTFR_INTRA) { // intra MB
-        for (i = 0; i < 4; i++) {
-            s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = 0;
-            s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = 0;
-            s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = 0;
-            s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = 0;
-        }
-        s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA;
-        s->mb_intra = v->is_intra[s->mb_x] = 1;
-        for (i = 0; i < 6; i++)
-            v->mb_type[0][s->block_index[i]] = 1;
-        fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb);
-        mb_has_coeffs = get_bits1(gb);
-        if (mb_has_coeffs)
-            cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-        v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb);
-        GET_MQUANT();
-        s->current_picture.qscale_table[mb_pos] = mquant;
-        /* Set DC scale - y and c use the same (not sure if necessary here) */
-        s->y_dc_scale = s->y_dc_scale_table[mquant];
-        s->c_dc_scale = s->c_dc_scale_table[mquant];
-        dst_idx = 0;
-        for (i = 0; i < 6; i++) {
-            s->dc_val[0][s->block_index[i]] = 0;
-            dst_idx += i >> 2;
-            val = ((cbp >> (5 - i)) & 1);
-            v->mb_type[0][s->block_index[i]] = s->mb_intra;
-            v->a_avail = v->c_avail = 0;
-            if (i == 2 || i == 3 || !s->first_slice_line)
-                v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
-            if (i == 1 || i == 3 || s->mb_x)
-                v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
-            vc1_decode_intra_block(v, s->block[i], i, val, mquant,
-                                   (i & 4) ? v->codingset2 : v->codingset);
-            if (i > 3 && (s->flags & CODEC_FLAG_GRAY))
-                continue;
-            v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
-            if (i < 4) {
-                stride_y = s->linesize << fieldtx;
-                off = (fieldtx) ? ((i & 1) * 8) + ((i & 2) >> 1) * s->linesize : (i & 1) * 8 + 4 * (i & 2) * s->linesize;
-            } else {
-                stride_y = s->uvlinesize;
-                off = 0;
-            }
-            s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, stride_y);
-        }
-    } else {
-        s->mb_intra = v->is_intra[s->mb_x] = 0;
-        if (!direct) {
-            if (skipped || !s->mb_intra) {
-                bmvtype = decode012(gb);
-                switch (bmvtype) {
-                case 0:
-                    bmvtype = (v->bfraction >= (B_FRACTION_DEN/2)) ? BMV_TYPE_BACKWARD : BMV_TYPE_FORWARD;
-                    break;
-                case 1:
-                    bmvtype = (v->bfraction >= (B_FRACTION_DEN/2)) ? BMV_TYPE_FORWARD : BMV_TYPE_BACKWARD;
-                    break;
-                case 2:
-                    bmvtype  = BMV_TYPE_INTERPOLATED;
-                }
-            }
-
-            if (twomv && bmvtype != BMV_TYPE_INTERPOLATED)
-                mvsw = get_bits1(gb);
-        }
-
-        if (!skipped) { // inter MB
-            mb_has_coeffs = ff_vc1_mbmode_intfrp[0][idx_mbmode][3];
-            if (mb_has_coeffs)
-                cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
-            if (!direct) {
-                if (bmvtype == BMV_TYPE_INTERPOLATED & twomv) {
-                    v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1);
-                } else if (bmvtype == BMV_TYPE_INTERPOLATED | twomv) {
-                    v->twomvbp = get_vlc2(gb, v->twomvbp_vlc->table, VC1_2MV_BLOCK_PATTERN_VLC_BITS, 1);
-                }
-            }
-
-            for (i = 0; i < 6; i++)
-                v->mb_type[0][s->block_index[i]] = 0;
-            fieldtx = v->fieldtx_plane[mb_pos] = ff_vc1_mbmode_intfrp[0][idx_mbmode][1];
-            /* for all motion vector read MVDATA and motion compensate each block */
-            dst_idx = 0;
-            if (direct) {
-                if (twomv) {
-                    for (i = 0; i < 4; i++) {
-                        vc1_mc_4mv_luma(v, i, 0, 0);
-                        vc1_mc_4mv_luma(v, i, 1, 1);
-                    }
-                    vc1_mc_4mv_chroma4(v, 0, 0, 0);
-                    vc1_mc_4mv_chroma4(v, 1, 1, 1);
-                } else {
-                    vc1_mc_1mv(v, 0);
-                    vc1_interp_mc(v);
-                }
-            } else if (twomv && bmvtype == BMV_TYPE_INTERPOLATED) {
-                mvbp = v->fourmvbp;
-                for (i = 0; i < 4; i++) {
-                    dir = i==1 || i==3;
-                    dmv_x = dmv_y = 0;
-                    val = ((mvbp >> (3 - i)) & 1);
-                    if (val)
-                        get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-                    j = i > 1 ? 2 : 0;
-                    vc1_pred_mv_intfr(v, j, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], dir);
-                    vc1_mc_4mv_luma(v, j, dir, dir);
-                    vc1_mc_4mv_luma(v, j+1, dir, dir);
-                }
-
-                vc1_mc_4mv_chroma4(v, 0, 0, 0);
-                vc1_mc_4mv_chroma4(v, 1, 1, 1);
-            } else if (bmvtype == BMV_TYPE_INTERPOLATED) {
-                mvbp = v->twomvbp;
-                dmv_x = dmv_y = 0;
-                if (mvbp & 2)
-                    get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-
-                vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 0);
-                vc1_mc_1mv(v, 0);
-
-                dmv_x = dmv_y = 0;
-                if (mvbp & 1)
-                    get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-
-                vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 1);
-                vc1_interp_mc(v);
-            } else if (twomv) {
-                dir = bmvtype == BMV_TYPE_BACKWARD;
-                dir2 = dir;
-                if (mvsw)
-                    dir2 = !dir;
-                mvbp = v->twomvbp;
-                dmv_x = dmv_y = 0;
-                if (mvbp & 2)
-                    get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-                vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], dir);
-
-                dmv_x = dmv_y = 0;
-                if (mvbp & 1)
-                    get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-                vc1_pred_mv_intfr(v, 2, dmv_x, dmv_y, 2, v->range_x, v->range_y, v->mb_type[0], dir2);
-
-                if (mvsw) {
-                    for (i = 0; i < 2; i++) {
-                        s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->current_picture.motion_val[dir][s->block_index[i+2]][0] = s->current_picture.motion_val[dir][s->block_index[i]][0];
-                        s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->current_picture.motion_val[dir][s->block_index[i+2]][1] = s->current_picture.motion_val[dir][s->block_index[i]][1];
-                        s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->current_picture.motion_val[dir2][s->block_index[i]][0] = s->current_picture.motion_val[dir2][s->block_index[i+2]][0];
-                        s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->current_picture.motion_val[dir2][s->block_index[i]][1] = s->current_picture.motion_val[dir2][s->block_index[i+2]][1];
-                    }
-                } else {
-                    vc1_pred_mv_intfr(v, 0, 0, 0, 2, v->range_x, v->range_y, v->mb_type[0], !dir);
-                    vc1_pred_mv_intfr(v, 2, 0, 0, 2, v->range_x, v->range_y, v->mb_type[0], !dir);
-                }
-
-                vc1_mc_4mv_luma(v, 0, dir, 0);
-                vc1_mc_4mv_luma(v, 1, dir, 0);
-                vc1_mc_4mv_luma(v, 2, dir2, 0);
-                vc1_mc_4mv_luma(v, 3, dir2, 0);
-                vc1_mc_4mv_chroma4(v, dir, dir2, 0);
-            } else {
-                dir = bmvtype == BMV_TYPE_BACKWARD;
-
-                mvbp = ff_vc1_mbmode_intfrp[0][idx_mbmode][2];
-                dmv_x = dmv_y = 0;
-                if (mvbp)
-                    get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0);
-
-                vc1_pred_mv_intfr(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], dir);
-                v->blk_mv_type[s->block_index[0]] = 1;
-                v->blk_mv_type[s->block_index[1]] = 1;
-                v->blk_mv_type[s->block_index[2]] = 1;
-                v->blk_mv_type[s->block_index[3]] = 1;
-                vc1_pred_mv_intfr(v, 0, 0, 0, 2, v->range_x, v->range_y, 0, !dir);
-                for (i = 0; i < 2; i++) {
-                    s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->current_picture.motion_val[!dir][s->block_index[i+2]][0] = s->current_picture.motion_val[!dir][s->block_index[i]][0];
-                    s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->current_picture.motion_val[!dir][s->block_index[i+2]][1] = s->current_picture.motion_val[!dir][s->block_index[i]][1];
-                }
-                vc1_mc_1mv(v, dir);
-            }
-
-            if (cbp)
-                GET_MQUANT();  // p. 227
-            s->current_picture.qscale_table[mb_pos] = mquant;
-            if (!v->ttmbf && cbp)
-                ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
-            for (i = 0; i < 6; i++) {
-                s->dc_val[0][s->block_index[i]] = 0;
-                dst_idx += i >> 2;
-                val = ((cbp >> (5 - i)) & 1);
-                if (!fieldtx)
-                    off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
-                else
-                    off = (i & 4) ? 0 : ((i & 1) * 8 + ((i > 1) * s->linesize));
-                if (val) {
-                    pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
-                                             first_block, s->dest[dst_idx] + off,
-                                             (i & 4) ? s->uvlinesize : (s->linesize << fieldtx),
-                                             (i & 4) && (s->flags & CODEC_FLAG_GRAY), &block_tt);
-                    block_cbp |= pat << (i << 2);
-                    if (!v->ttmbf && ttmb < 8)
-                        ttmb = -1;
-                    first_block = 0;
-                }
-            }
-
-        } else { // skipped
-            dir = 0;
-            for (i = 0; i < 6; i++) {
-                v->mb_type[0][s->block_index[i]] = 0;
-                s->dc_val[0][s->block_index[i]] = 0;
-            }
-            s->current_picture.mb_type[mb_pos]      = MB_TYPE_SKIP;
-            s->current_picture.qscale_table[mb_pos] = 0;
-            v->blk_mv_type[s->block_index[0]] = 0;
-            v->blk_mv_type[s->block_index[1]] = 0;
-            v->blk_mv_type[s->block_index[2]] = 0;
-            v->blk_mv_type[s->block_index[3]] = 0;
-
-            if (!direct) {
-                if (bmvtype == BMV_TYPE_INTERPOLATED) {
-                    vc1_pred_mv_intfr(v, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0], 0);
-                    vc1_pred_mv_intfr(v, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0], 1);
-                } else {
-                    dir = bmvtype == BMV_TYPE_BACKWARD;
-                    vc1_pred_mv_intfr(v, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0], dir);
-                    if (mvsw) {
-                        int dir2 = dir;
-                        if (mvsw)
-                            dir2 = !dir;
-                        for (i = 0; i < 2; i++) {
-                            s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->current_picture.motion_val[dir][s->block_index[i+2]][0] = s->current_picture.motion_val[dir][s->block_index[i]][0];
-                            s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->current_picture.motion_val[dir][s->block_index[i+2]][1] = s->current_picture.motion_val[dir][s->block_index[i]][1];
-                            s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->current_picture.motion_val[dir2][s->block_index[i]][0] = s->current_picture.motion_val[dir2][s->block_index[i+2]][0];
-                            s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->current_picture.motion_val[dir2][s->block_index[i]][1] = s->current_picture.motion_val[dir2][s->block_index[i+2]][1];
-                        }
-                    } else {
-                        v->blk_mv_type[s->block_index[0]] = 1;
-                        v->blk_mv_type[s->block_index[1]] = 1;
-                        v->blk_mv_type[s->block_index[2]] = 1;
-                        v->blk_mv_type[s->block_index[3]] = 1;
-                        vc1_pred_mv_intfr(v, 0, 0, 0, 2, v->range_x, v->range_y, 0, !dir);
-                        for (i = 0; i < 2; i++) {
-                            s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->current_picture.motion_val[!dir][s->block_index[i+2]][0] = s->current_picture.motion_val[!dir][s->block_index[i]][0];
-                            s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->current_picture.motion_val[!dir][s->block_index[i+2]][1] = s->current_picture.motion_val[!dir][s->block_index[i]][1];
-                        }
-                    }
-                }
-            }
-
-            vc1_mc_1mv(v, dir);
-            if (direct || bmvtype == BMV_TYPE_INTERPOLATED) {
-                vc1_interp_mc(v);
-            }
-        }
-    }
-    if (s->mb_x == s->mb_width - 1)
-        memmove(v->is_intra_base, v->is_intra, sizeof(v->is_intra_base[0]) * s->mb_stride);
-    v->cbp[s->mb_x]      = block_cbp;
-    v->ttblk[s->mb_x]    = block_tt;
-    return 0;
-}
-
-/** Decode blocks of I-frame
- */
-static void vc1_decode_i_blocks(VC1Context *v)
-{
-    int k, j;
-    MpegEncContext *s = &v->s;
-    int cbp, val;
-    uint8_t *coded_val;
-    int mb_pos;
-
-    /* select codingmode used for VLC tables selection */
-    switch (v->y_ac_table_index) {
-    case 0:
-        v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA;
-        break;
-    case 1:
-        v->codingset = CS_HIGH_MOT_INTRA;
-        break;
-    case 2:
-        v->codingset = CS_MID_RATE_INTRA;
-        break;
-    }
-
-    switch (v->c_ac_table_index) {
-    case 0:
-        v->codingset2 = (v->pqindex <= 8) ? CS_HIGH_RATE_INTER : CS_LOW_MOT_INTER;
-        break;
-    case 1:
-        v->codingset2 = CS_HIGH_MOT_INTER;
-        break;
-    case 2:
-        v->codingset2 = CS_MID_RATE_INTER;
-        break;
-    }
-
-    /* Set DC scale - y and c use the same */
-    s->y_dc_scale = s->y_dc_scale_table[v->pq];
-    s->c_dc_scale = s->c_dc_scale_table[v->pq];
-
-    //do frame decode
-    s->mb_x = s->mb_y = 0;
-    s->mb_intra         = 1;
-    s->first_slice_line = 1;
-    for (s->mb_y = 0; s->mb_y < s->end_mb_y; s->mb_y++) {
-        s->mb_x = 0;
-        init_block_index(v);
-        for (; s->mb_x < v->end_mb_x; s->mb_x++) {
-            uint8_t *dst[6];
-            ff_update_block_index(s);
-            dst[0] = s->dest[0];
-            dst[1] = dst[0] + 8;
-            dst[2] = s->dest[0] + s->linesize * 8;
-            dst[3] = dst[2] + 8;
-            dst[4] = s->dest[1];
-            dst[5] = s->dest[2];
-            s->dsp.clear_blocks(s->block[0]);
-            mb_pos = s->mb_x + s->mb_y * s->mb_width;
-            s->current_picture.mb_type[mb_pos]                     = MB_TYPE_INTRA;
-            s->current_picture.qscale_table[mb_pos]                = v->pq;
-            s->current_picture.motion_val[1][s->block_index[0]][0] = 0;
-            s->current_picture.motion_val[1][s->block_index[0]][1] = 0;
-
-            // do actual MB decoding and displaying
-            cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
-            v->s.ac_pred = get_bits1(&v->s.gb);
-
-            for (k = 0; k < 6; k++) {
-                val = ((cbp >> (5 - k)) & 1);
-
-                if (k < 4) {
-                    int pred   = vc1_coded_block_pred(&v->s, k, &coded_val);
-                    val        = val ^ pred;
-                    *coded_val = val;
-                }
-                cbp |= val << (5 - k);
-
-                vc1_decode_i_block(v, s->block[k], k, val, (k < 4) ? v->codingset : v->codingset2);
-
-                if (k > 3 && (s->flags & CODEC_FLAG_GRAY))
-                    continue;
-                v->vc1dsp.vc1_inv_trans_8x8(s->block[k]);
-                if (v->pq >= 9 && v->overlap) {
-                    if (v->rangeredfrm)
-                        for (j = 0; j < 64; j++)
-                            s->block[k][j] <<= 1;
-                    s->dsp.put_signed_pixels_clamped(s->block[k], dst[k], k & 4 ? s->uvlinesize : s->linesize);
-                } else {
-                    if (v->rangeredfrm)
-                        for (j = 0; j < 64; j++)
-                            s->block[k][j] = (s->block[k][j] - 64) << 1;
-                    s->dsp.put_pixels_clamped(s->block[k], dst[k], k & 4 ? s->uvlinesize : s->linesize);
-                }
-            }
-
-            if (v->pq >= 9 && v->overlap) {
-                if (s->mb_x) {
-                    v->vc1dsp.vc1_h_overlap(s->dest[0], s->linesize);
-                    v->vc1dsp.vc1_h_overlap(s->dest[0] + 8 * s->linesize, s->linesize);
-                    if (!(s->flags & CODEC_FLAG_GRAY)) {
-                        v->vc1dsp.vc1_h_overlap(s->dest[1], s->uvlinesize);
-                        v->vc1dsp.vc1_h_overlap(s->dest[2], s->uvlinesize);
-                    }
-                }
-                v->vc1dsp.vc1_h_overlap(s->dest[0] + 8, s->linesize);
-                v->vc1dsp.vc1_h_overlap(s->dest[0] + 8 * s->linesize + 8, s->linesize);
-                if (!s->first_slice_line) {
-                    v->vc1dsp.vc1_v_overlap(s->dest[0], s->linesize);
-                    v->vc1dsp.vc1_v_overlap(s->dest[0] + 8, s->linesize);
-                    if (!(s->flags & CODEC_FLAG_GRAY)) {
-                        v->vc1dsp.vc1_v_overlap(s->dest[1], s->uvlinesize);
-                        v->vc1dsp.vc1_v_overlap(s->dest[2], s->uvlinesize);
-                    }
-                }
-                v->vc1dsp.vc1_v_overlap(s->dest[0] + 8 * s->linesize, s->linesize);
-                v->vc1dsp.vc1_v_overlap(s->dest[0] + 8 * s->linesize + 8, s->linesize);
-            }
-            if (v->s.loop_filter) vc1_loop_filter_iblk(v, v->pq);
-
-            if (get_bits_count(&s->gb) > v->bits) {
-                ff_er_add_slice(&s->er, 0, 0, s->mb_x, s->mb_y, ER_MB_ERROR);
-                av_log(s->avctx, AV_LOG_ERROR, "Bits overconsumption: %i > %i\n",
-                       get_bits_count(&s->gb), v->bits);
-                return;
-            }
-        }
-        if (!v->s.loop_filter)
-            ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16);
-        else if (s->mb_y)
-            ff_mpeg_draw_horiz_band(s, (s->mb_y - 1) * 16, 16);
-
-        s->first_slice_line = 0;
-    }
-    if (v->s.loop_filter)
-        ff_mpeg_draw_horiz_band(s, (s->end_mb_y - 1) * 16, 16);
-
-    /* This is intentionally mb_height and not end_mb_y - unlike in advanced
-     * profile, these only differ are when decoding MSS2 rectangles. */
-    ff_er_add_slice(&s->er, 0, 0, s->mb_width - 1, s->mb_height - 1, ER_MB_END);
-}
-
-/** Decode blocks of I-frame for advanced profile
- */
-static void vc1_decode_i_blocks_adv(VC1Context *v)
-{
-    int k;
-    MpegEncContext *s = &v->s;
-    int cbp, val;
-    uint8_t *coded_val;
-    int mb_pos;
-    int mquant = v->pq;
-    int mqdiff;
-    GetBitContext *gb = &s->gb;
-
-    /* select codingmode used for VLC tables selection */
-    switch (v->y_ac_table_index) {
-    case 0:
-        v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA;
-        break;
-    case 1:
-        v->codingset = CS_HIGH_MOT_INTRA;
-        break;
-    case 2:
-        v->codingset = CS_MID_RATE_INTRA;
-        break;
-    }
-
-    switch (v->c_ac_table_index) {
-    case 0:
-        v->codingset2 = (v->pqindex <= 8) ? CS_HIGH_RATE_INTER : CS_LOW_MOT_INTER;
-        break;
-    case 1:
-        v->codingset2 = CS_HIGH_MOT_INTER;
-        break;
-    case 2:
-        v->codingset2 = CS_MID_RATE_INTER;
-        break;
-    }
-
-    // do frame decode
-    s->mb_x             = s->mb_y = 0;
-    s->mb_intra         = 1;
-    s->first_slice_line = 1;
-    s->mb_y             = s->start_mb_y;
-    if (s->start_mb_y) {
-        s->mb_x = 0;
-        init_block_index(v);
-        memset(&s->coded_block[s->block_index[0] - s->b8_stride], 0,
-               (1 + s->b8_stride) * sizeof(*s->coded_block));
-    }
-    for (; s->mb_y < s->end_mb_y; s->mb_y++) {
-        s->mb_x = 0;
-        init_block_index(v);
-        for (;s->mb_x < s->mb_width; s->mb_x++) {
-            int16_t (*block)[64] = v->block[v->cur_blk_idx];
-            ff_update_block_index(s);
-            s->dsp.clear_blocks(block[0]);
-            mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-            s->current_picture.mb_type[mb_pos + v->mb_off]                         = MB_TYPE_INTRA;
-            s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0;
-            s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0;
-
-            // do actual MB decoding and displaying
-            if (v->fieldtx_is_raw)
-                v->fieldtx_plane[mb_pos] = get_bits1(&v->s.gb);
-            cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
-            if ( v->acpred_is_raw)
-                v->s.ac_pred = get_bits1(&v->s.gb);
-            else
-                v->s.ac_pred = v->acpred_plane[mb_pos];
-
-            if (v->condover == CONDOVER_SELECT && v->overflg_is_raw)
-                v->over_flags_plane[mb_pos] = get_bits1(&v->s.gb);
-
-            GET_MQUANT();
-
-            s->current_picture.qscale_table[mb_pos] = mquant;
-            /* Set DC scale - y and c use the same */
-            s->y_dc_scale = s->y_dc_scale_table[mquant];
-            s->c_dc_scale = s->c_dc_scale_table[mquant];
-
-            for (k = 0; k < 6; k++) {
-                val = ((cbp >> (5 - k)) & 1);
-
-                if (k < 4) {
-                    int pred   = vc1_coded_block_pred(&v->s, k, &coded_val);
-                    val        = val ^ pred;
-                    *coded_val = val;
-                }
-                cbp |= val << (5 - k);
-
-                v->a_avail = !s->first_slice_line || (k == 2 || k == 3);
-                v->c_avail = !!s->mb_x || (k == 1 || k == 3);
-
-                vc1_decode_i_block_adv(v, block[k], k, val,
-                                       (k < 4) ? v->codingset : v->codingset2, mquant);
-
-                if (k > 3 && (s->flags & CODEC_FLAG_GRAY))
-                    continue;
-                v->vc1dsp.vc1_inv_trans_8x8(block[k]);
-            }
-
-            vc1_smooth_overlap_filter_iblk(v);
-            vc1_put_signed_blocks_clamped(v);
-            if (v->s.loop_filter) vc1_loop_filter_iblk_delayed(v, v->pq);
-
-            if (get_bits_count(&s->gb) > v->bits) {
-                // TODO: may need modification to handle slice coding
-                ff_er_add_slice(&s->er, 0, s->start_mb_y, s->mb_x, s->mb_y, ER_MB_ERROR);
-                av_log(s->avctx, AV_LOG_ERROR, "Bits overconsumption: %i > %i\n",
-                       get_bits_count(&s->gb), v->bits);
-                return;
-            }
-        }
-        if (!v->s.loop_filter)
-            ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16);
-        else if (s->mb_y)
-            ff_mpeg_draw_horiz_band(s, (s->mb_y-1) * 16, 16);
-        s->first_slice_line = 0;
-    }
-
-    /* raw bottom MB row */
-    s->mb_x = 0;
-    init_block_index(v);
-
-    for (;s->mb_x < s->mb_width; s->mb_x++) {
-        ff_update_block_index(s);
-        vc1_put_signed_blocks_clamped(v);
-        if (v->s.loop_filter)
-            vc1_loop_filter_iblk_delayed(v, v->pq);
-    }
-    if (v->s.loop_filter)
-        ff_mpeg_draw_horiz_band(s, (s->end_mb_y-1)*16, 16);
-    ff_er_add_slice(&s->er, 0, s->start_mb_y << v->field_mode, s->mb_width - 1,
-                    (s->end_mb_y << v->field_mode) - 1, ER_MB_END);
-}
-
-static void vc1_decode_p_blocks(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    int apply_loop_filter;
-
-    /* select codingmode used for VLC tables selection */
-    switch (v->c_ac_table_index) {
-    case 0:
-        v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA;
-        break;
-    case 1:
-        v->codingset = CS_HIGH_MOT_INTRA;
-        break;
-    case 2:
-        v->codingset = CS_MID_RATE_INTRA;
-        break;
-    }
-
-    switch (v->c_ac_table_index) {
-    case 0:
-        v->codingset2 = (v->pqindex <= 8) ? CS_HIGH_RATE_INTER : CS_LOW_MOT_INTER;
-        break;
-    case 1:
-        v->codingset2 = CS_HIGH_MOT_INTER;
-        break;
-    case 2:
-        v->codingset2 = CS_MID_RATE_INTER;
-        break;
-    }
-
-    apply_loop_filter   = s->loop_filter && !(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY) &&
-                          v->fcm == PROGRESSIVE;
-    s->first_slice_line = 1;
-    memset(v->cbp_base, 0, sizeof(v->cbp_base[0])*2*s->mb_stride);
-    for (s->mb_y = s->start_mb_y; s->mb_y < s->end_mb_y; s->mb_y++) {
-        s->mb_x = 0;
-        init_block_index(v);
-        for (; s->mb_x < s->mb_width; s->mb_x++) {
-            ff_update_block_index(s);
-
-            if (v->fcm == ILACE_FIELD)
-                vc1_decode_p_mb_intfi(v);
-            else if (v->fcm == ILACE_FRAME)
-                vc1_decode_p_mb_intfr(v);
-            else vc1_decode_p_mb(v);
-            if (s->mb_y != s->start_mb_y && apply_loop_filter)
-                vc1_apply_p_loop_filter(v);
-            if (get_bits_count(&s->gb) > v->bits || get_bits_count(&s->gb) < 0) {
-                // TODO: may need modification to handle slice coding
-                ff_er_add_slice(&s->er, 0, s->start_mb_y, s->mb_x, s->mb_y, ER_MB_ERROR);
-                av_log(s->avctx, AV_LOG_ERROR, "Bits overconsumption: %i > %i at %ix%i\n",
-                       get_bits_count(&s->gb), v->bits, s->mb_x, s->mb_y);
-                return;
-            }
-        }
-        memmove(v->cbp_base,      v->cbp,      sizeof(v->cbp_base[0])      * s->mb_stride);
-        memmove(v->ttblk_base,    v->ttblk,    sizeof(v->ttblk_base[0])    * s->mb_stride);
-        memmove(v->is_intra_base, v->is_intra, sizeof(v->is_intra_base[0]) * s->mb_stride);
-        memmove(v->luma_mv_base,  v->luma_mv,  sizeof(v->luma_mv_base[0])  * s->mb_stride);
-        if (s->mb_y != s->start_mb_y) ff_mpeg_draw_horiz_band(s, (s->mb_y - 1) * 16, 16);
-        s->first_slice_line = 0;
-    }
-    if (apply_loop_filter) {
-        s->mb_x = 0;
-        init_block_index(v);
-        for (; s->mb_x < s->mb_width; s->mb_x++) {
-            ff_update_block_index(s);
-            vc1_apply_p_loop_filter(v);
-        }
-    }
-    if (s->end_mb_y >= s->start_mb_y)
-        ff_mpeg_draw_horiz_band(s, (s->end_mb_y - 1) * 16, 16);
-    ff_er_add_slice(&s->er, 0, s->start_mb_y << v->field_mode, s->mb_width - 1,
-                    (s->end_mb_y << v->field_mode) - 1, ER_MB_END);
-}
-
-static void vc1_decode_b_blocks(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-
-    /* select codingmode used for VLC tables selection */
-    switch (v->c_ac_table_index) {
-    case 0:
-        v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA;
-        break;
-    case 1:
-        v->codingset = CS_HIGH_MOT_INTRA;
-        break;
-    case 2:
-        v->codingset = CS_MID_RATE_INTRA;
-        break;
-    }
-
-    switch (v->c_ac_table_index) {
-    case 0:
-        v->codingset2 = (v->pqindex <= 8) ? CS_HIGH_RATE_INTER : CS_LOW_MOT_INTER;
-        break;
-    case 1:
-        v->codingset2 = CS_HIGH_MOT_INTER;
-        break;
-    case 2:
-        v->codingset2 = CS_MID_RATE_INTER;
-        break;
-    }
-
-    s->first_slice_line = 1;
-    for (s->mb_y = s->start_mb_y; s->mb_y < s->end_mb_y; s->mb_y++) {
-        s->mb_x = 0;
-        init_block_index(v);
-        for (; s->mb_x < s->mb_width; s->mb_x++) {
-            ff_update_block_index(s);
-
-            if (v->fcm == ILACE_FIELD)
-                vc1_decode_b_mb_intfi(v);
-            else if (v->fcm == ILACE_FRAME)
-                vc1_decode_b_mb_intfr(v);
-            else
-                vc1_decode_b_mb(v);
-            if (get_bits_count(&s->gb) > v->bits || get_bits_count(&s->gb) < 0) {
-                // TODO: may need modification to handle slice coding
-                ff_er_add_slice(&s->er, 0, s->start_mb_y, s->mb_x, s->mb_y, ER_MB_ERROR);
-                av_log(s->avctx, AV_LOG_ERROR, "Bits overconsumption: %i > %i at %ix%i\n",
-                       get_bits_count(&s->gb), v->bits, s->mb_x, s->mb_y);
-                return;
-            }
-            if (v->s.loop_filter) vc1_loop_filter_iblk(v, v->pq);
-        }
-        if (!v->s.loop_filter)
-            ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16);
-        else if (s->mb_y)
-            ff_mpeg_draw_horiz_band(s, (s->mb_y - 1) * 16, 16);
-        s->first_slice_line = 0;
-    }
-    if (v->s.loop_filter)
-        ff_mpeg_draw_horiz_band(s, (s->end_mb_y - 1) * 16, 16);
-    ff_er_add_slice(&s->er, 0, s->start_mb_y << v->field_mode, s->mb_width - 1,
-                    (s->end_mb_y << v->field_mode) - 1, ER_MB_END);
-}
-
-static void vc1_decode_skip_blocks(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-
-    if (!v->s.last_picture.f.data[0])
-        return;
-
-    ff_er_add_slice(&s->er, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, ER_MB_END);
-    s->first_slice_line = 1;
-    for (s->mb_y = s->start_mb_y; s->mb_y < s->end_mb_y; s->mb_y++) {
-        s->mb_x = 0;
-        init_block_index(v);
-        ff_update_block_index(s);
-        memcpy(s->dest[0], s->last_picture.f.data[0] + s->mb_y * 16 * s->linesize,   s->linesize   * 16);
-        memcpy(s->dest[1], s->last_picture.f.data[1] + s->mb_y *  8 * s->uvlinesize, s->uvlinesize *  8);
-        memcpy(s->dest[2], s->last_picture.f.data[2] + s->mb_y *  8 * s->uvlinesize, s->uvlinesize *  8);
-        ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16);
-        s->first_slice_line = 0;
-    }
-    s->pict_type = AV_PICTURE_TYPE_P;
-}
-
-void ff_vc1_decode_blocks(VC1Context *v)
-{
-
-    v->s.esc3_level_length = 0;
-    if (v->x8_type) {
-        ff_intrax8_decode_picture(&v->x8, 2*v->pq + v->halfpq, v->pq * !v->pquantizer);
-    } else {
-        v->cur_blk_idx     =  0;
-        v->left_blk_idx    = -1;
-        v->topleft_blk_idx =  1;
-        v->top_blk_idx     =  2;
-        switch (v->s.pict_type) {
-        case AV_PICTURE_TYPE_I:
-            if (v->profile == PROFILE_ADVANCED)
-                vc1_decode_i_blocks_adv(v);
-            else
-                vc1_decode_i_blocks(v);
-            break;
-        case AV_PICTURE_TYPE_P:
-            if (v->p_frame_skipped)
-                vc1_decode_skip_blocks(v);
-            else
-                vc1_decode_p_blocks(v);
-            break;
-        case AV_PICTURE_TYPE_B:
-            if (v->bi_type) {
-                if (v->profile == PROFILE_ADVANCED)
-                    vc1_decode_i_blocks_adv(v);
-                else
-                    vc1_decode_i_blocks(v);
-            } else
-                vc1_decode_b_blocks(v);
-            break;
-        }
-    }
-}
-
-#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
-
-typedef struct {
-    /**
-     * Transform coefficients for both sprites in 16.16 fixed point format,
-     * in the order they appear in the bitstream:
-     *  x scale
-     *  rotation 1 (unused)
-     *  x offset
-     *  rotation 2 (unused)
-     *  y scale
-     *  y offset
-     *  alpha
-     */
-    int coefs[2][7];
-
-    int effect_type, effect_flag;
-    int effect_pcount1, effect_pcount2;   ///< amount of effect parameters stored in effect_params
-    int effect_params1[15], effect_params2[10]; ///< effect parameters in 16.16 fixed point format
-} SpriteData;
-
-static inline int get_fp_val(GetBitContext* gb)
-{
-    return (get_bits_long(gb, 30) - (1 << 29)) << 1;
-}
-
-static void vc1_sprite_parse_transform(GetBitContext* gb, int c[7])
-{
-    c[1] = c[3] = 0;
-
-    switch (get_bits(gb, 2)) {
-    case 0:
-        c[0] = 1 << 16;
-        c[2] = get_fp_val(gb);
-        c[4] = 1 << 16;
-        break;
-    case 1:
-        c[0] = c[4] = get_fp_val(gb);
-        c[2] = get_fp_val(gb);
-        break;
-    case 2:
-        c[0] = get_fp_val(gb);
-        c[2] = get_fp_val(gb);
-        c[4] = get_fp_val(gb);
-        break;
-    case 3:
-        c[0] = get_fp_val(gb);
-        c[1] = get_fp_val(gb);
-        c[2] = get_fp_val(gb);
-        c[3] = get_fp_val(gb);
-        c[4] = get_fp_val(gb);
-        break;
-    }
-    c[5] = get_fp_val(gb);
-    if (get_bits1(gb))
-        c[6] = get_fp_val(gb);
-    else
-        c[6] = 1 << 16;
-}
-
-static void vc1_parse_sprites(VC1Context *v, GetBitContext* gb, SpriteData* sd)
-{
-    AVCodecContext *avctx = v->s.avctx;
-    int sprite, i;
-
-    for (sprite = 0; sprite <= v->two_sprites; sprite++) {
-        vc1_sprite_parse_transform(gb, sd->coefs[sprite]);
-        if (sd->coefs[sprite][1] || sd->coefs[sprite][3])
-            avpriv_request_sample(avctx, "Non-zero rotation coefficients");
-        av_log(avctx, AV_LOG_DEBUG, sprite ? "S2:" : "S1:");
-        for (i = 0; i < 7; i++)
-            av_log(avctx, AV_LOG_DEBUG, " %d.%.3d",
-                   sd->coefs[sprite][i] / (1<<16),
-                   (abs(sd->coefs[sprite][i]) & 0xFFFF) * 1000 / (1 << 16));
-        av_log(avctx, AV_LOG_DEBUG, "\n");
-    }
-
-    skip_bits(gb, 2);
-    if (sd->effect_type = get_bits_long(gb, 30)) {
-        switch (sd->effect_pcount1 = get_bits(gb, 4)) {
-        case 7:
-            vc1_sprite_parse_transform(gb, sd->effect_params1);
-            break;
-        case 14:
-            vc1_sprite_parse_transform(gb, sd->effect_params1);
-            vc1_sprite_parse_transform(gb, sd->effect_params1 + 7);
-            break;
-        default:
-            for (i = 0; i < sd->effect_pcount1; i++)
-                sd->effect_params1[i] = get_fp_val(gb);
-        }
-        if (sd->effect_type != 13 || sd->effect_params1[0] != sd->coefs[0][6]) {
-            // effect 13 is simple alpha blending and matches the opacity above
-            av_log(avctx, AV_LOG_DEBUG, "Effect: %d; params: ", sd->effect_type);
-            for (i = 0; i < sd->effect_pcount1; i++)
-                av_log(avctx, AV_LOG_DEBUG, " %d.%.2d",
-                       sd->effect_params1[i] / (1 << 16),
-                       (abs(sd->effect_params1[i]) & 0xFFFF) * 1000 / (1 << 16));
-            av_log(avctx, AV_LOG_DEBUG, "\n");
-        }
-
-        sd->effect_pcount2 = get_bits(gb, 16);
-        if (sd->effect_pcount2 > 10) {
-            av_log(avctx, AV_LOG_ERROR, "Too many effect parameters\n");
-            return;
-        } else if (sd->effect_pcount2) {
-            i = -1;
-            av_log(avctx, AV_LOG_DEBUG, "Effect params 2: ");
-            while (++i < sd->effect_pcount2) {
-                sd->effect_params2[i] = get_fp_val(gb);
-                av_log(avctx, AV_LOG_DEBUG, " %d.%.2d",
-                       sd->effect_params2[i] / (1 << 16),
-                       (abs(sd->effect_params2[i]) & 0xFFFF) * 1000 / (1 << 16));
-            }
-            av_log(avctx, AV_LOG_DEBUG, "\n");
-        }
-    }
-    if (sd->effect_flag = get_bits1(gb))
-        av_log(avctx, AV_LOG_DEBUG, "Effect flag set\n");
-
-    if (get_bits_count(gb) >= gb->size_in_bits +
-       (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE ? 64 : 0))
-        av_log(avctx, AV_LOG_ERROR, "Buffer overrun\n");
-    if (get_bits_count(gb) < gb->size_in_bits - 8)
-        av_log(avctx, AV_LOG_WARNING, "Buffer not fully read\n");
-}
-
-static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
-{
-    int i, plane, row, sprite;
-    int sr_cache[2][2] = { { -1, -1 }, { -1, -1 } };
-    uint8_t* src_h[2][2];
-    int xoff[2], xadv[2], yoff[2], yadv[2], alpha;
-    int ysub[2];
-    MpegEncContext *s = &v->s;
-
-    for (i = 0; i < 2; i++) {
-        xoff[i] = av_clip(sd->coefs[i][2], 0, v->sprite_width-1 << 16);
-        xadv[i] = sd->coefs[i][0];
-        if (xadv[i] != 1<<16 || (v->sprite_width << 16) - (v->output_width << 16) - xoff[i])
-            xadv[i] = av_clip(xadv[i], 0, ((v->sprite_width<<16) - xoff[i] - 1) / v->output_width);
-
-        yoff[i] = av_clip(sd->coefs[i][5], 0, v->sprite_height-1 << 16);
-        yadv[i] = av_clip(sd->coefs[i][4], 0, ((v->sprite_height << 16) - yoff[i]) / v->output_height);
-    }
-    alpha = av_clip(sd->coefs[1][6], 0, (1<<16) - 1);
-
-    for (plane = 0; plane < (s->flags&CODEC_FLAG_GRAY ? 1 : 3); plane++) {
-        int width = v->output_width>>!!plane;
-
-        for (row = 0; row < v->output_height>>!!plane; row++) {
-            uint8_t *dst = v->sprite_output_frame->data[plane] +
-                           v->sprite_output_frame->linesize[plane] * row;
-
-            for (sprite = 0; sprite <= v->two_sprites; sprite++) {
-                uint8_t *iplane = s->current_picture.f.data[plane];
-                int      iline  = s->current_picture.f.linesize[plane];
-                int      ycoord = yoff[sprite] + yadv[sprite] * row;
-                int      yline  = ycoord >> 16;
-                int      next_line;
-                ysub[sprite] = ycoord & 0xFFFF;
-                if (sprite) {
-                    iplane = s->last_picture.f.data[plane];
-                    iline  = s->last_picture.f.linesize[plane];
-                }
-                next_line = FFMIN(yline + 1, (v->sprite_height >> !!plane) - 1) * iline;
-                if (!(xoff[sprite] & 0xFFFF) && xadv[sprite] == 1 << 16) {
-                        src_h[sprite][0] = iplane + (xoff[sprite] >> 16) +  yline      * iline;
-                    if (ysub[sprite])
-                        src_h[sprite][1] = iplane + (xoff[sprite] >> 16) + next_line;
-                } else {
-                    if (sr_cache[sprite][0] != yline) {
-                        if (sr_cache[sprite][1] == yline) {
-                            FFSWAP(uint8_t*, v->sr_rows[sprite][0], v->sr_rows[sprite][1]);
-                            FFSWAP(int,        sr_cache[sprite][0],   sr_cache[sprite][1]);
-                        } else {
-                            v->vc1dsp.sprite_h(v->sr_rows[sprite][0], iplane + yline * iline, xoff[sprite], xadv[sprite], width);
-                            sr_cache[sprite][0] = yline;
-                        }
-                    }
-                    if (ysub[sprite] && sr_cache[sprite][1] != yline + 1) {
-                        v->vc1dsp.sprite_h(v->sr_rows[sprite][1],
-                                           iplane + next_line, xoff[sprite],
-                                           xadv[sprite], width);
-                        sr_cache[sprite][1] = yline + 1;
-                    }
-                    src_h[sprite][0] = v->sr_rows[sprite][0];
-                    src_h[sprite][1] = v->sr_rows[sprite][1];
-                }
-            }
-
-            if (!v->two_sprites) {
-                if (ysub[0]) {
-                    v->vc1dsp.sprite_v_single(dst, src_h[0][0], src_h[0][1], ysub[0], width);
-                } else {
-                    memcpy(dst, src_h[0][0], width);
-                }
-            } else {
-                if (ysub[0] && ysub[1]) {
-                    v->vc1dsp.sprite_v_double_twoscale(dst, src_h[0][0], src_h[0][1], ysub[0],
-                                                       src_h[1][0], src_h[1][1], ysub[1], alpha, width);
-                } else if (ysub[0]) {
-                    v->vc1dsp.sprite_v_double_onescale(dst, src_h[0][0], src_h[0][1], ysub[0],
-                                                       src_h[1][0], alpha, width);
-                } else if (ysub[1]) {
-                    v->vc1dsp.sprite_v_double_onescale(dst, src_h[1][0], src_h[1][1], ysub[1],
-                                                       src_h[0][0], (1<<16)-1-alpha, width);
-                } else {
-                    v->vc1dsp.sprite_v_double_noscale(dst, src_h[0][0], src_h[1][0], alpha, width);
-                }
-            }
-        }
-
-        if (!plane) {
-            for (i = 0; i < 2; i++) {
-                xoff[i] >>= 1;
-                yoff[i] >>= 1;
-            }
-        }
-
-    }
-}
-
-
-static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
-{
-    MpegEncContext *s     = &v->s;
-    AVCodecContext *avctx = s->avctx;
-    SpriteData sd;
-
-    vc1_parse_sprites(v, gb, &sd);
-
-    if (!s->current_picture.f.data[0]) {
-        av_log(avctx, AV_LOG_ERROR, "Got no sprites\n");
-        return -1;
-    }
-
-    if (v->two_sprites && (!s->last_picture_ptr || !s->last_picture.f.data[0])) {
-        av_log(avctx, AV_LOG_WARNING, "Need two sprites, only got one\n");
-        v->two_sprites = 0;
-    }
-
-    av_frame_unref(v->sprite_output_frame);
-    if (ff_get_buffer(avctx, v->sprite_output_frame, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
-
-    vc1_draw_sprites(v, &sd);
-
-    return 0;
-}
-
-static void vc1_sprite_flush(AVCodecContext *avctx)
-{
-    VC1Context *v     = avctx->priv_data;
-    MpegEncContext *s = &v->s;
-    AVFrame *f = &s->current_picture.f;
-    int plane, i;
-
-    /* Windows Media Image codecs have a convergence interval of two keyframes.
-       Since we can't enforce it, clear to black the missing sprite. This is
-       wrong but it looks better than doing nothing. */
-
-    if (f->data[0])
-        for (plane = 0; plane < (s->flags&CODEC_FLAG_GRAY ? 1 : 3); plane++)
-            for (i = 0; i < v->sprite_height>>!!plane; i++)
-                memset(f->data[plane] + i * f->linesize[plane],
-                       plane ? 128 : 0, f->linesize[plane]);
-}
-
-#endif
-
-av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
-{
-    MpegEncContext *s = &v->s;
-    int i;
-    int mb_height = FFALIGN(s->mb_height, 2);
-
-    /* Allocate mb bitplanes */
-    v->mv_type_mb_plane = av_malloc (s->mb_stride * mb_height);
-    v->direct_mb_plane  = av_malloc (s->mb_stride * mb_height);
-    v->forward_mb_plane = av_malloc (s->mb_stride * mb_height);
-    v->fieldtx_plane    = av_mallocz(s->mb_stride * mb_height);
-    v->acpred_plane     = av_malloc (s->mb_stride * mb_height);
-    v->over_flags_plane = av_malloc (s->mb_stride * mb_height);
-
-    v->n_allocated_blks = s->mb_width + 2;
-    v->block            = av_malloc(sizeof(*v->block) * v->n_allocated_blks);
-    v->cbp_base         = av_malloc(sizeof(v->cbp_base[0]) * 2 * s->mb_stride);
-    v->cbp              = v->cbp_base + s->mb_stride;
-    v->ttblk_base       = av_malloc(sizeof(v->ttblk_base[0]) * 2 * s->mb_stride);
-    v->ttblk            = v->ttblk_base + s->mb_stride;
-    v->is_intra_base    = av_mallocz(sizeof(v->is_intra_base[0]) * 2 * s->mb_stride);
-    v->is_intra         = v->is_intra_base + s->mb_stride;
-    v->luma_mv_base     = av_malloc(sizeof(v->luma_mv_base[0]) * 2 * s->mb_stride);
-    v->luma_mv          = v->luma_mv_base + s->mb_stride;
-
-    /* allocate block type info in that way so it could be used with s->block_index[] */
-    v->mb_type_base = av_malloc(s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
-    v->mb_type[0]   = v->mb_type_base + s->b8_stride + 1;
-    v->mb_type[1]   = v->mb_type_base + s->b8_stride * (mb_height * 2 + 1) + s->mb_stride + 1;
-    v->mb_type[2]   = v->mb_type[1] + s->mb_stride * (mb_height + 1);
-
-    /* allocate memory to store block level MV info */
-    v->blk_mv_type_base = av_mallocz(     s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
-    v->blk_mv_type      = v->blk_mv_type_base + s->b8_stride + 1;
-    v->mv_f_base        = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2));
-    v->mv_f[0]          = v->mv_f_base + s->b8_stride + 1;
-    v->mv_f[1]          = v->mv_f[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
-    v->mv_f_next_base   = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2));
-    v->mv_f_next[0]     = v->mv_f_next_base + s->b8_stride + 1;
-    v->mv_f_next[1]     = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
-
-    /* Init coded blocks info */
-    if (v->profile == PROFILE_ADVANCED) {
-//        if (alloc_bitplane(&v->over_flags_plane, s->mb_width, s->mb_height) < 0)
-//            return -1;
-//        if (alloc_bitplane(&v->ac_pred_plane, s->mb_width, s->mb_height) < 0)
-//            return -1;
-    }
-
-    ff_intrax8_common_init(&v->x8,s);
-
-    if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
-        for (i = 0; i < 4; i++)
-            if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width))) return -1;
-    }
-
-    if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane ||
-        !v->block || !v->cbp_base || !v->ttblk_base || !v->is_intra_base || !v->luma_mv_base ||
-        !v->mb_type_base) {
-        av_freep(&v->mv_type_mb_plane);
-        av_freep(&v->direct_mb_plane);
-        av_freep(&v->acpred_plane);
-        av_freep(&v->over_flags_plane);
-        av_freep(&v->block);
-        av_freep(&v->cbp_base);
-        av_freep(&v->ttblk_base);
-        av_freep(&v->is_intra_base);
-        av_freep(&v->luma_mv_base);
-        av_freep(&v->mb_type_base);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-av_cold void ff_vc1_init_transposed_scantables(VC1Context *v)
-{
-    int i;
-    for (i = 0; i < 64; i++) {
-#define transpose(x) ((x >> 3) | ((x & 7) << 3))
-        v->zz_8x8[0][i] = transpose(ff_wmv1_scantable[0][i]);
-        v->zz_8x8[1][i] = transpose(ff_wmv1_scantable[1][i]);
-        v->zz_8x8[2][i] = transpose(ff_wmv1_scantable[2][i]);
-        v->zz_8x8[3][i] = transpose(ff_wmv1_scantable[3][i]);
-        v->zzi_8x8[i]   = transpose(ff_vc1_adv_interlaced_8x8_zz[i]);
-    }
-    v->left_blk_sh = 0;
-    v->top_blk_sh  = 3;
-}
-
-/** Initialize a VC1/WMV3 decoder
- * @todo TODO: Handle VC-1 IDUs (Transport level?)
- * @todo TODO: Decypher remaining bits in extra_data
- */
-static av_cold int vc1_decode_init(AVCodecContext *avctx)
-{
-    VC1Context *v = avctx->priv_data;
-    MpegEncContext *s = &v->s;
-    GetBitContext gb;
-
-    /* save the container output size for WMImage */
-    v->output_width  = avctx->width;
-    v->output_height = avctx->height;
-
-    if (!avctx->extradata_size || !avctx->extradata)
-        return -1;
-    if (!(avctx->flags & CODEC_FLAG_GRAY))
-        avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);
-    else
-        avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-    avctx->hwaccel = ff_find_hwaccel(avctx);
-    v->s.avctx = avctx;
-
-    if (ff_vc1_init_common(v) < 0)
-        return -1;
-    ff_h264chroma_init(&v->h264chroma, 8);
-    ff_vc1dsp_init(&v->vc1dsp);
-
-    if (avctx->codec_id == AV_CODEC_ID_WMV3 || avctx->codec_id == AV_CODEC_ID_WMV3IMAGE) {
-        int count = 0;
-
-        // looks like WMV3 has a sequence header stored in the extradata
-        // advanced sequence header may be before the first frame
-        // the last byte of the extradata is a version number, 1 for the
-        // samples we can decode
-
-        init_get_bits(&gb, avctx->extradata, avctx->extradata_size*8);
-
-        if (ff_vc1_decode_sequence_header(avctx, v, &gb) < 0)
-          return -1;
-
-        count = avctx->extradata_size*8 - get_bits_count(&gb);
-        if (count > 0) {
-            av_log(avctx, AV_LOG_INFO, "Extra data: %i bits left, value: %X\n",
-                   count, get_bits(&gb, count));
-        } else if (count < 0) {
-            av_log(avctx, AV_LOG_INFO, "Read %i bits in overflow\n", -count);
-        }
-    } else { // VC1/WVC1/WVP2
-        const uint8_t *start = avctx->extradata;
-        uint8_t *end = avctx->extradata + avctx->extradata_size;
-        const uint8_t *next;
-        int size, buf2_size;
-        uint8_t *buf2 = NULL;
-        int seq_initialized = 0, ep_initialized = 0;
-
-        if (avctx->extradata_size < 16) {
-            av_log(avctx, AV_LOG_ERROR, "Extradata size too small: %i\n", avctx->extradata_size);
-            return -1;
-        }
-
-        buf2  = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
-        start = find_next_marker(start, end); // in WVC1 extradata first byte is its size, but can be 0 in mkv
-        next  = start;
-        for (; next < end; start = next) {
-            next = find_next_marker(start + 4, end);
-            size = next - start - 4;
-            if (size <= 0)
-                continue;
-            buf2_size = vc1_unescape_buffer(start + 4, size, buf2);
-            init_get_bits(&gb, buf2, buf2_size * 8);
-            switch (AV_RB32(start)) {
-            case VC1_CODE_SEQHDR:
-                if (ff_vc1_decode_sequence_header(avctx, v, &gb) < 0) {
-                    av_free(buf2);
-                    return -1;
-                }
-                seq_initialized = 1;
-                break;
-            case VC1_CODE_ENTRYPOINT:
-                if (ff_vc1_decode_entry_point(avctx, v, &gb) < 0) {
-                    av_free(buf2);
-                    return -1;
-                }
-                ep_initialized = 1;
-                break;
-            }
-        }
-        av_free(buf2);
-        if (!seq_initialized || !ep_initialized) {
-            av_log(avctx, AV_LOG_ERROR, "Incomplete extradata\n");
-            return -1;
-        }
-        v->res_sprite = (avctx->codec_id == AV_CODEC_ID_VC1IMAGE);
-    }
-
-    v->sprite_output_frame = av_frame_alloc();
-    if (!v->sprite_output_frame)
-        return AVERROR(ENOMEM);
-
-    avctx->profile = v->profile;
-    if (v->profile == PROFILE_ADVANCED)
-        avctx->level = v->level;
-
-    avctx->has_b_frames = !!avctx->max_b_frames;
-
-    s->mb_width  = (avctx->coded_width  + 15) >> 4;
-    s->mb_height = (avctx->coded_height + 15) >> 4;
-
-    if (v->profile == PROFILE_ADVANCED || v->res_fasttx) {
-        ff_vc1_init_transposed_scantables(v);
-    } else {
-        memcpy(v->zz_8x8, ff_wmv1_scantable, 4*64);
-        v->left_blk_sh = 3;
-        v->top_blk_sh  = 0;
-    }
-
-    if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
-        v->sprite_width  = avctx->coded_width;
-        v->sprite_height = avctx->coded_height;
-
-        avctx->coded_width  = avctx->width  = v->output_width;
-        avctx->coded_height = avctx->height = v->output_height;
-
-        // prevent 16.16 overflows
-        if (v->sprite_width  > 1 << 14 ||
-            v->sprite_height > 1 << 14 ||
-            v->output_width  > 1 << 14 ||
-            v->output_height > 1 << 14) return -1;
-    }
-    return 0;
-}
-
-/** Close a VC1/WMV3 decoder
- * @warning Initial try at using MpegEncContext stuff
- */
-av_cold int ff_vc1_decode_end(AVCodecContext *avctx)
-{
-    VC1Context *v = avctx->priv_data;
-    int i;
-
-    av_frame_free(&v->sprite_output_frame);
-
-    for (i = 0; i < 4; i++)
-        av_freep(&v->sr_rows[i >> 1][i & 1]);
-    av_freep(&v->hrd_rate);
-    av_freep(&v->hrd_buffer);
-    ff_MPV_common_end(&v->s);
-    av_freep(&v->mv_type_mb_plane);
-    av_freep(&v->direct_mb_plane);
-    av_freep(&v->forward_mb_plane);
-    av_freep(&v->fieldtx_plane);
-    av_freep(&v->acpred_plane);
-    av_freep(&v->over_flags_plane);
-    av_freep(&v->mb_type_base);
-    av_freep(&v->blk_mv_type_base);
-    av_freep(&v->mv_f_base);
-    av_freep(&v->mv_f_next_base);
-    av_freep(&v->block);
-    av_freep(&v->cbp_base);
-    av_freep(&v->ttblk_base);
-    av_freep(&v->is_intra_base); // FIXME use v->mb_type[]
-    av_freep(&v->luma_mv_base);
-    ff_intrax8_common_end(&v->x8);
-    return 0;
-}
-
-
-/** Decode a VC1/WMV3 frame
- * @todo TODO: Handle VC-1 IDUs (Transport level?)
- */
-static int vc1_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size, n_slices = 0, i, ret;
-    VC1Context *v = avctx->priv_data;
-    MpegEncContext *s = &v->s;
-    AVFrame *pict = data;
-    uint8_t *buf2 = NULL;
-    const uint8_t *buf_start = buf;
-    int mb_height, n_slices1;
-    struct {
-        uint8_t *buf;
-        GetBitContext gb;
-        int mby_start;
-    } *slices = NULL, *tmp;
-
-    /* no supplementary picture */
-    if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == VC1_CODE_ENDOFSEQ)) {
-        /* special case for last picture */
-        if (s->low_delay == 0 && s->next_picture_ptr) {
-            if ((ret = av_frame_ref(pict, &s->next_picture_ptr->f)) < 0)
-                return ret;
-            s->next_picture_ptr = NULL;
-
-            *got_frame = 1;
-        }
-
-        return 0;
-    }
-
-    //for advanced profile we may need to parse and unescape data
-    if (avctx->codec_id == AV_CODEC_ID_VC1 || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
-        int buf_size2 = 0;
-        buf2 = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
-        if (IS_MARKER(AV_RB32(buf))) { /* frame starts with marker and needs to be parsed */
-            const uint8_t *start, *end, *next;
-            int size;
-
-            next = buf;
-            for (start = buf, end = buf + buf_size; next < end; start = next) {
-                next = find_next_marker(start + 4, end);
-                size = next - start - 4;
-                if (size <= 0) continue;
-                switch (AV_RB32(start)) {
-                case VC1_CODE_FRAME:
-                    if (avctx->hwaccel)
-                        buf_start = start;
-                    buf_size2 = vc1_unescape_buffer(start + 4, size, buf2);
-                    break;
-                case VC1_CODE_FIELD: {
-                    int buf_size3;
-                    tmp = av_realloc(slices, sizeof(*slices) * (n_slices+1));
-                    if (!tmp)
-                        goto err;
-                    slices = tmp;
-                    slices[n_slices].buf = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-                    if (!slices[n_slices].buf)
-                        goto err;
-                    buf_size3 = vc1_unescape_buffer(start + 4, size,
-                                                    slices[n_slices].buf);
-                    init_get_bits(&slices[n_slices].gb, slices[n_slices].buf,
-                                  buf_size3 << 3);
-                    /* assuming that the field marker is at the exact middle,
-                       hope it's correct */
-                    slices[n_slices].mby_start = s->mb_height >> 1;
-                    n_slices1 = n_slices - 1; // index of the last slice of the first field
-                    n_slices++;
-                    break;
-                }
-                case VC1_CODE_ENTRYPOINT: /* it should be before frame data */
-                    buf_size2 = vc1_unescape_buffer(start + 4, size, buf2);
-                    init_get_bits(&s->gb, buf2, buf_size2 * 8);
-                    ff_vc1_decode_entry_point(avctx, v, &s->gb);
-                    break;
-                case VC1_CODE_SLICE: {
-                    int buf_size3;
-                    tmp = av_realloc(slices, sizeof(*slices) * (n_slices+1));
-                    if (!tmp)
-                        goto err;
-                    slices = tmp;
-                    slices[n_slices].buf = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-                    if (!slices[n_slices].buf)
-                        goto err;
-                    buf_size3 = vc1_unescape_buffer(start + 4, size,
-                                                    slices[n_slices].buf);
-                    init_get_bits(&slices[n_slices].gb, slices[n_slices].buf,
-                                  buf_size3 << 3);
-                    slices[n_slices].mby_start = get_bits(&slices[n_slices].gb, 9);
-                    n_slices++;
-                    break;
-                }
-                }
-            }
-        } else if (v->interlace && ((buf[0] & 0xC0) == 0xC0)) { /* WVC1 interlaced stores both fields divided by marker */
-            const uint8_t *divider;
-            int buf_size3;
-
-            divider = find_next_marker(buf, buf + buf_size);
-            if ((divider == (buf + buf_size)) || AV_RB32(divider) != VC1_CODE_FIELD) {
-                av_log(avctx, AV_LOG_ERROR, "Error in WVC1 interlaced frame\n");
-                goto err;
-            } else { // found field marker, unescape second field
-                tmp = av_realloc(slices, sizeof(*slices) * (n_slices+1));
-                if (!tmp)
-                    goto err;
-                slices = tmp;
-                slices[n_slices].buf = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-                if (!slices[n_slices].buf)
-                    goto err;
-                buf_size3 = vc1_unescape_buffer(divider + 4, buf + buf_size - divider - 4, slices[n_slices].buf);
-                init_get_bits(&slices[n_slices].gb, slices[n_slices].buf,
-                              buf_size3 << 3);
-                slices[n_slices].mby_start = s->mb_height >> 1;
-                n_slices1 = n_slices - 1;
-                n_slices++;
-            }
-            buf_size2 = vc1_unescape_buffer(buf, divider - buf, buf2);
-        } else {
-            buf_size2 = vc1_unescape_buffer(buf, buf_size, buf2);
-        }
-        init_get_bits(&s->gb, buf2, buf_size2*8);
-    } else
-        init_get_bits(&s->gb, buf, buf_size*8);
-
-    if (v->res_sprite) {
-        v->new_sprite  = !get_bits1(&s->gb);
-        v->two_sprites =  get_bits1(&s->gb);
-        /* res_sprite means a Windows Media Image stream, AV_CODEC_ID_*IMAGE means
-           we're using the sprite compositor. These are intentionally kept separate
-           so you can get the raw sprites by using the wmv3 decoder for WMVP or
-           the vc1 one for WVP2 */
-        if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
-            if (v->new_sprite) {
-                // switch AVCodecContext parameters to those of the sprites
-                avctx->width  = avctx->coded_width  = v->sprite_width;
-                avctx->height = avctx->coded_height = v->sprite_height;
-            } else {
-                goto image;
-            }
-        }
-    }
-
-    if (s->context_initialized &&
-        (s->width  != avctx->coded_width ||
-         s->height != avctx->coded_height)) {
-        ff_vc1_decode_end(avctx);
-    }
-
-    if (!s->context_initialized) {
-        if (ff_msmpeg4_decode_init(avctx) < 0)
-            goto err;
-        if (ff_vc1_decode_init_alloc_tables(v) < 0) {
-            ff_MPV_common_end(s);
-            goto err;
-        }
-
-        s->low_delay = !avctx->has_b_frames || v->res_sprite;
-
-        if (v->profile == PROFILE_ADVANCED) {
-            s->h_edge_pos = avctx->coded_width;
-            s->v_edge_pos = avctx->coded_height;
-        }
-    }
-
-    // do parse frame header
-    v->pic_header_flag = 0;
-    v->first_pic_header_flag = 1;
-    if (v->profile < PROFILE_ADVANCED) {
-        if (ff_vc1_parse_frame_header(v, &s->gb) < 0) {
-            goto err;
-        }
-    } else {
-        if (ff_vc1_parse_frame_header_adv(v, &s->gb) < 0) {
-            goto err;
-        }
-    }
-    v->first_pic_header_flag = 0;
-
-    if ((avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE)
-        && s->pict_type != AV_PICTURE_TYPE_I) {
-        av_log(v->s.avctx, AV_LOG_ERROR, "Sprite decoder: expected I-frame\n");
-        goto err;
-    }
-
-    // for skipping the frame
-    s->current_picture.f.pict_type = s->pict_type;
-    s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
-
-    /* skip B-frames if we don't have reference frames */
-    if (s->last_picture_ptr == NULL && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) {
-        goto err;
-    }
-    if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
-        (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||
-         avctx->skip_frame >= AVDISCARD_ALL) {
-        goto end;
-    }
-
-    if (s->next_p_frame_damaged) {
-        if (s->pict_type == AV_PICTURE_TYPE_B)
-            goto end;
-        else
-            s->next_p_frame_damaged = 0;
-    }
-
-    if (ff_MPV_frame_start(s, avctx) < 0) {
-        goto err;
-    }
-
-    // process pulldown flags
-    s->current_picture_ptr->f.repeat_pict = 0;
-    // Pulldown flags are only valid when 'broadcast' has been set.
-    // So ticks_per_frame will be 2
-    if (v->rff) {
-        // repeat field
-        s->current_picture_ptr->f.repeat_pict = 1;
-    } else if (v->rptfrm) {
-        // repeat frames
-        s->current_picture_ptr->f.repeat_pict = v->rptfrm * 2;
-    }
-
-    s->me.qpel_put = s->dsp.put_qpel_pixels_tab;
-    s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab;
-
-    if (avctx->hwaccel) {
-        if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
-            goto err;
-        if (avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start) < 0)
-            goto err;
-        if (avctx->hwaccel->end_frame(avctx) < 0)
-            goto err;
-    } else {
-        int header_ret = 0;
-
-        ff_mpeg_er_frame_start(s);
-
-        v->bits = buf_size * 8;
-        v->end_mb_x = s->mb_width;
-        if (v->field_mode) {
-            s->current_picture.f.linesize[0] <<= 1;
-            s->current_picture.f.linesize[1] <<= 1;
-            s->current_picture.f.linesize[2] <<= 1;
-            s->linesize                      <<= 1;
-            s->uvlinesize                    <<= 1;
-        }
-        mb_height = s->mb_height >> v->field_mode;
-
-        if (!mb_height) {
-            av_log(v->s.avctx, AV_LOG_ERROR, "Invalid mb_height.\n");
-            goto err;
-        }
-
-        for (i = 0; i <= n_slices; i++) {
-            if (i > 0 &&  slices[i - 1].mby_start >= mb_height) {
-                if (v->field_mode <= 0) {
-                    av_log(v->s.avctx, AV_LOG_ERROR, "Slice %d starts beyond "
-                           "picture boundary (%d >= %d)\n", i,
-                           slices[i - 1].mby_start, mb_height);
-                    continue;
-                }
-                v->second_field = 1;
-                v->blocks_off   = s->mb_width  * s->mb_height << 1;
-                v->mb_off       = s->mb_stride * s->mb_height >> 1;
-            } else {
-                v->second_field = 0;
-                v->blocks_off   = 0;
-                v->mb_off       = 0;
-            }
-            if (i) {
-                v->pic_header_flag = 0;
-                if (v->field_mode && i == n_slices1 + 2) {
-                    if ((header_ret = ff_vc1_parse_frame_header_adv(v, &s->gb)) < 0) {
-                        av_log(v->s.avctx, AV_LOG_ERROR, "Field header damaged\n");
-                        if (avctx->err_recognition & AV_EF_EXPLODE)
-                            goto err;
-                        continue;
-                    }
-                } else if (get_bits1(&s->gb)) {
-                    v->pic_header_flag = 1;
-                    if ((header_ret = ff_vc1_parse_frame_header_adv(v, &s->gb)) < 0) {
-                        av_log(v->s.avctx, AV_LOG_ERROR, "Slice header damaged\n");
-                        if (avctx->err_recognition & AV_EF_EXPLODE)
-                            goto err;
-                        continue;
-                    }
-                }
-            }
-            if (header_ret < 0)
-                continue;
-            s->start_mb_y = (i == 0) ? 0 : FFMAX(0, slices[i-1].mby_start % mb_height);
-            if (!v->field_mode || v->second_field)
-                s->end_mb_y = (i == n_slices     ) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
-            else
-                s->end_mb_y = (i <= n_slices1 + 1) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
-            ff_vc1_decode_blocks(v);
-            if (i != n_slices)
-                s->gb = slices[i].gb;
-        }
-        if (v->field_mode) {
-            v->second_field = 0;
-            s->current_picture.f.linesize[0] >>= 1;
-            s->current_picture.f.linesize[1] >>= 1;
-            s->current_picture.f.linesize[2] >>= 1;
-            s->linesize                      >>= 1;
-            s->uvlinesize                    >>= 1;
-            if (v->s.pict_type != AV_PICTURE_TYPE_BI && v->s.pict_type != AV_PICTURE_TYPE_B) {
-                FFSWAP(uint8_t *, v->mv_f_next[0], v->mv_f[0]);
-                FFSWAP(uint8_t *, v->mv_f_next[1], v->mv_f[1]);
-            }
-        }
-        av_dlog(s->avctx, "Consumed %i/%i bits\n",
-                get_bits_count(&s->gb), s->gb.size_in_bits);
-//  if (get_bits_count(&s->gb) > buf_size * 8)
-//      return -1;
-        if (!v->field_mode)
-            ff_er_frame_end(&s->er);
-    }
-
-    ff_MPV_frame_end(s);
-
-    if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
-image:
-        avctx->width  = avctx->coded_width  = v->output_width;
-        avctx->height = avctx->coded_height = v->output_height;
-        if (avctx->skip_frame >= AVDISCARD_NONREF)
-            goto end;
-#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
-        if (vc1_decode_sprites(v, &s->gb))
-            goto err;
-#endif
-        if ((ret = av_frame_ref(pict, v->sprite_output_frame)) < 0)
-            goto err;
-        *got_frame = 1;
-    } else {
-        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
-            if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
-                goto err;
-            ff_print_debug_info(s, s->current_picture_ptr);
-            *got_frame = 1;
-        } else if (s->last_picture_ptr != NULL) {
-            if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
-                goto err;
-            ff_print_debug_info(s, s->last_picture_ptr);
-            *got_frame = 1;
-        }
-    }
-
-end:
-    av_free(buf2);
-    for (i = 0; i < n_slices; i++)
-        av_free(slices[i].buf);
-    av_free(slices);
-    return buf_size;
-
-err:
-    av_free(buf2);
-    for (i = 0; i < n_slices; i++)
-        av_free(slices[i].buf);
-    av_free(slices);
-    return -1;
-}
-
-
-static const AVProfile profiles[] = {
-    { FF_PROFILE_VC1_SIMPLE,   "Simple"   },
-    { FF_PROFILE_VC1_MAIN,     "Main"     },
-    { FF_PROFILE_VC1_COMPLEX,  "Complex"  },
-    { FF_PROFILE_VC1_ADVANCED, "Advanced" },
-    { FF_PROFILE_UNKNOWN },
-};
-
-static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = {
-#if CONFIG_DXVA2
-    AV_PIX_FMT_DXVA2_VLD,
-#endif
-#if CONFIG_VAAPI
-    AV_PIX_FMT_VAAPI_VLD,
-#endif
-#if CONFIG_VDPAU
-    AV_PIX_FMT_VDPAU,
-#endif
-    AV_PIX_FMT_YUV420P,
-    AV_PIX_FMT_NONE
-};
-
-AVCodec ff_vc1_decoder = {
-    .name           = "vc1",
-    .long_name      = NULL_IF_CONFIG_SMALL("SMPTE VC-1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VC1,
-    .priv_data_size = sizeof(VC1Context),
-    .init           = vc1_decode_init,
-    .close          = ff_vc1_decode_end,
-    .decode         = vc1_decode_frame,
-    .flush          = ff_mpeg_flush,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
-    .pix_fmts       = vc1_hwaccel_pixfmt_list_420,
-    .profiles       = NULL_IF_CONFIG_SMALL(profiles)
-};
-
-#if CONFIG_WMV3_DECODER
-AVCodec ff_wmv3_decoder = {
-    .name           = "wmv3",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Video 9"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WMV3,
-    .priv_data_size = sizeof(VC1Context),
-    .init           = vc1_decode_init,
-    .close          = ff_vc1_decode_end,
-    .decode         = vc1_decode_frame,
-    .flush          = ff_mpeg_flush,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
-    .pix_fmts       = vc1_hwaccel_pixfmt_list_420,
-    .profiles       = NULL_IF_CONFIG_SMALL(profiles)
-};
-#endif
-
-#if CONFIG_WMV3IMAGE_DECODER
-AVCodec ff_wmv3image_decoder = {
-    .name           = "wmv3image",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WMV3IMAGE,
-    .priv_data_size = sizeof(VC1Context),
-    .init           = vc1_decode_init,
-    .close          = ff_vc1_decode_end,
-    .decode         = vc1_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = vc1_sprite_flush,
-    .pix_fmts       = ff_pixfmt_list_420
-};
-#endif
-
-#if CONFIG_VC1IMAGE_DECODER
-AVCodec ff_vc1image_decoder = {
-    .name           = "vc1image",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image v2"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VC1IMAGE,
-    .priv_data_size = sizeof(VC1Context),
-    .init           = vc1_decode_init,
-    .close          = ff_vc1_decode_end,
-    .decode         = vc1_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .flush          = vc1_sprite_flush,
-    .pix_fmts       = ff_pixfmt_list_420
-};
-#endif
diff --git a/deps/libav/libavcodec/vc1dsp.c b/deps/libav/libavcodec/vc1dsp.c
deleted file mode 100644
index e47bd5a..0000000
--- a/deps/libav/libavcodec/vc1dsp.c
+++ /dev/null
@@ -1,945 +0,0 @@
-/*
- * VC-1 and WMV3 decoder - DSP functions
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VC-1 and WMV3 decoder
- *
- */
-
-#include "libavutil/common.h"
-#include "h264chroma.h"
-#include "vc1dsp.h"
-
-/* Apply overlap transform to horizontal edge */
-static void vc1_v_overlap_c(uint8_t *src, int stride)
-{
-    int i;
-    int a, b, c, d;
-    int d1, d2;
-    int rnd = 1;
-    for (i = 0; i < 8; i++) {
-        a  = src[-2 * stride];
-        b  = src[-stride];
-        c  = src[0];
-        d  = src[stride];
-        d1 = (a - d + 3 + rnd) >> 3;
-        d2 = (a - d + b - c + 4 - rnd) >> 3;
-
-        src[-2 * stride] = a - d1;
-        src[-stride]     = av_clip_uint8(b - d2);
-        src[0]           = av_clip_uint8(c + d2);
-        src[stride]      = d + d1;
-        src++;
-        rnd = !rnd;
-    }
-}
-
-/* Apply overlap transform to vertical edge */
-static void vc1_h_overlap_c(uint8_t *src, int stride)
-{
-    int i;
-    int a, b, c, d;
-    int d1, d2;
-    int rnd = 1;
-    for (i = 0; i < 8; i++) {
-        a  = src[-2];
-        b  = src[-1];
-        c  = src[0];
-        d  = src[1];
-        d1 = (a - d + 3 + rnd) >> 3;
-        d2 = (a - d + b - c + 4 - rnd) >> 3;
-
-        src[-2] = a - d1;
-        src[-1] = av_clip_uint8(b - d2);
-        src[0]  = av_clip_uint8(c + d2);
-        src[1]  = d + d1;
-        src    += stride;
-        rnd     = !rnd;
-    }
-}
-
-static void vc1_v_s_overlap_c(int16_t *top, int16_t *bottom)
-{
-    int i;
-    int a, b, c, d;
-    int d1, d2;
-    int rnd1 = 4, rnd2 = 3;
-    for (i = 0; i < 8; i++) {
-        a  = top[48];
-        b  = top[56];
-        c  = bottom[0];
-        d  = bottom[8];
-        d1 = a - d;
-        d2 = a - d + b - c;
-
-        top[48]   = ((a << 3) - d1 + rnd1) >> 3;
-        top[56]   = ((b << 3) - d2 + rnd2) >> 3;
-        bottom[0] = ((c << 3) + d2 + rnd1) >> 3;
-        bottom[8] = ((d << 3) + d1 + rnd2) >> 3;
-
-        bottom++;
-        top++;
-        rnd2 = 7 - rnd2;
-        rnd1 = 7 - rnd1;
-    }
-}
-
-static void vc1_h_s_overlap_c(int16_t *left, int16_t *right)
-{
-    int i;
-    int a, b, c, d;
-    int d1, d2;
-    int rnd1 = 4, rnd2 = 3;
-    for (i = 0; i < 8; i++) {
-        a  = left[6];
-        b  = left[7];
-        c  = right[0];
-        d  = right[1];
-        d1 = a - d;
-        d2 = a - d + b - c;
-
-        left[6]  = ((a << 3) - d1 + rnd1) >> 3;
-        left[7]  = ((b << 3) - d2 + rnd2) >> 3;
-        right[0] = ((c << 3) + d2 + rnd1) >> 3;
-        right[1] = ((d << 3) + d1 + rnd2) >> 3;
-
-        right += 8;
-        left  += 8;
-        rnd2   = 7 - rnd2;
-        rnd1   = 7 - rnd1;
-    }
-}
-
-/**
- * VC-1 in-loop deblocking filter for one line
- * @param src source block type
- * @param stride block stride
- * @param pq block quantizer
- * @return whether other 3 pairs should be filtered or not
- * @see 8.6
- */
-static av_always_inline int vc1_filter_line(uint8_t *src, int stride, int pq)
-{
-    int a0 = (2 * (src[-2 * stride] - src[1 * stride]) -
-              5 * (src[-1 * stride] - src[0 * stride]) + 4) >> 3;
-    int a0_sign = a0 >> 31;        /* Store sign */
-
-    a0 = (a0 ^ a0_sign) - a0_sign; /* a0 = FFABS(a0); */
-    if (a0 < pq) {
-        int a1 = FFABS((2 * (src[-4 * stride] - src[-1 * stride]) -
-                        5 * (src[-3 * stride] - src[-2 * stride]) + 4) >> 3);
-        int a2 = FFABS((2 * (src[ 0 * stride] - src[ 3 * stride]) -
-                        5 * (src[ 1 * stride] - src[ 2 * stride]) + 4) >> 3);
-        if (a1 < a0 || a2 < a0) {
-            int clip      = src[-1 * stride] - src[0 * stride];
-            int clip_sign = clip >> 31;
-
-            clip = ((clip ^ clip_sign) - clip_sign) >> 1;
-            if (clip) {
-                int a3     = FFMIN(a1, a2);
-                int d      = 5 * (a3 - a0);
-                int d_sign = (d >> 31);
-
-                d       = ((d ^ d_sign) - d_sign) >> 3;
-                d_sign ^= a0_sign;
-
-                if (d_sign ^ clip_sign)
-                    d = 0;
-                else {
-                    d = FFMIN(d, clip);
-                    d = (d ^ d_sign) - d_sign; /* Restore sign */
-                    src[-1 * stride] = av_clip_uint8(src[-1 * stride] - d);
-                    src[ 0 * stride] = av_clip_uint8(src[ 0 * stride] + d);
-                }
-                return 1;
-            }
-        }
-    }
-    return 0;
-}
-
-/**
- * VC-1 in-loop deblocking filter
- * @param src source block type
- * @param step distance between horizontally adjacent elements
- * @param stride distance between vertically adjacent elements
- * @param len edge length to filter (4 or 8 pixels)
- * @param pq block quantizer
- * @see 8.6
- */
-static inline void vc1_loop_filter(uint8_t *src, int step, int stride,
-                                   int len, int pq)
-{
-    int i;
-    int filt3;
-
-    for (i = 0; i < len; i += 4) {
-        filt3 = vc1_filter_line(src + 2 * step, stride, pq);
-        if (filt3) {
-            vc1_filter_line(src + 0 * step, stride, pq);
-            vc1_filter_line(src + 1 * step, stride, pq);
-            vc1_filter_line(src + 3 * step, stride, pq);
-        }
-        src += step * 4;
-    }
-}
-
-static void vc1_v_loop_filter4_c(uint8_t *src, int stride, int pq)
-{
-    vc1_loop_filter(src, 1, stride, 4, pq);
-}
-
-static void vc1_h_loop_filter4_c(uint8_t *src, int stride, int pq)
-{
-    vc1_loop_filter(src, stride, 1, 4, pq);
-}
-
-static void vc1_v_loop_filter8_c(uint8_t *src, int stride, int pq)
-{
-    vc1_loop_filter(src, 1, stride, 8, pq);
-}
-
-static void vc1_h_loop_filter8_c(uint8_t *src, int stride, int pq)
-{
-    vc1_loop_filter(src, stride, 1, 8, pq);
-}
-
-static void vc1_v_loop_filter16_c(uint8_t *src, int stride, int pq)
-{
-    vc1_loop_filter(src, 1, stride, 16, pq);
-}
-
-static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq)
-{
-    vc1_loop_filter(src, stride, 1, 16, pq);
-}
-
-/* Do inverse transform on 8x8 block */
-static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
-{
-    int i;
-    int dc = block[0];
-
-    dc = (3 * dc +  1) >> 1;
-    dc = (3 * dc + 16) >> 5;
-
-    for (i = 0; i < 8; i++) {
-        dest[0] = av_clip_uint8(dest[0] + dc);
-        dest[1] = av_clip_uint8(dest[1] + dc);
-        dest[2] = av_clip_uint8(dest[2] + dc);
-        dest[3] = av_clip_uint8(dest[3] + dc);
-        dest[4] = av_clip_uint8(dest[4] + dc);
-        dest[5] = av_clip_uint8(dest[5] + dc);
-        dest[6] = av_clip_uint8(dest[6] + dc);
-        dest[7] = av_clip_uint8(dest[7] + dc);
-        dest += linesize;
-    }
-}
-
-static void vc1_inv_trans_8x8_c(int16_t block[64])
-{
-    int i;
-    register int t1, t2, t3, t4, t5, t6, t7, t8;
-    int16_t *src, *dst, temp[64];
-
-    src = block;
-    dst = temp;
-    for (i = 0; i < 8; i++) {
-        t1 = 12 * (src[ 0] + src[32]) + 4;
-        t2 = 12 * (src[ 0] - src[32]) + 4;
-        t3 = 16 * src[16] +  6 * src[48];
-        t4 =  6 * src[16] - 16 * src[48];
-
-        t5 = t1 + t3;
-        t6 = t2 + t4;
-        t7 = t2 - t4;
-        t8 = t1 - t3;
-
-        t1 = 16 * src[ 8] + 15 * src[24] +  9 * src[40] +  4 * src[56];
-        t2 = 15 * src[ 8] -  4 * src[24] - 16 * src[40] -  9 * src[56];
-        t3 =  9 * src[ 8] - 16 * src[24] +  4 * src[40] + 15 * src[56];
-        t4 =  4 * src[ 8] -  9 * src[24] + 15 * src[40] - 16 * src[56];
-
-        dst[0] = (t5 + t1) >> 3;
-        dst[1] = (t6 + t2) >> 3;
-        dst[2] = (t7 + t3) >> 3;
-        dst[3] = (t8 + t4) >> 3;
-        dst[4] = (t8 - t4) >> 3;
-        dst[5] = (t7 - t3) >> 3;
-        dst[6] = (t6 - t2) >> 3;
-        dst[7] = (t5 - t1) >> 3;
-
-        src += 1;
-        dst += 8;
-    }
-
-    src = temp;
-    dst = block;
-    for (i = 0; i < 8; i++) {
-        t1 = 12 * (src[ 0] + src[32]) + 64;
-        t2 = 12 * (src[ 0] - src[32]) + 64;
-        t3 = 16 * src[16] +  6 * src[48];
-        t4 =  6 * src[16] - 16 * src[48];
-
-        t5 = t1 + t3;
-        t6 = t2 + t4;
-        t7 = t2 - t4;
-        t8 = t1 - t3;
-
-        t1 = 16 * src[ 8] + 15 * src[24] +  9 * src[40] +  4 * src[56];
-        t2 = 15 * src[ 8] -  4 * src[24] - 16 * src[40] -  9 * src[56];
-        t3 =  9 * src[ 8] - 16 * src[24] +  4 * src[40] + 15 * src[56];
-        t4 =  4 * src[ 8] -  9 * src[24] + 15 * src[40] - 16 * src[56];
-
-        dst[ 0] = (t5 + t1) >> 7;
-        dst[ 8] = (t6 + t2) >> 7;
-        dst[16] = (t7 + t3) >> 7;
-        dst[24] = (t8 + t4) >> 7;
-        dst[32] = (t8 - t4 + 1) >> 7;
-        dst[40] = (t7 - t3 + 1) >> 7;
-        dst[48] = (t6 - t2 + 1) >> 7;
-        dst[56] = (t5 - t1 + 1) >> 7;
-
-        src++;
-        dst++;
-    }
-}
-
-/* Do inverse transform on 8x4 part of block */
-static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
-{
-    int i;
-    int dc = block[0];
-
-    dc =  (3 * dc +  1) >> 1;
-    dc = (17 * dc + 64) >> 7;
-
-    for (i = 0; i < 4; i++) {
-        dest[0] = av_clip_uint8(dest[0] + dc);
-        dest[1] = av_clip_uint8(dest[1] + dc);
-        dest[2] = av_clip_uint8(dest[2] + dc);
-        dest[3] = av_clip_uint8(dest[3] + dc);
-        dest[4] = av_clip_uint8(dest[4] + dc);
-        dest[5] = av_clip_uint8(dest[5] + dc);
-        dest[6] = av_clip_uint8(dest[6] + dc);
-        dest[7] = av_clip_uint8(dest[7] + dc);
-        dest += linesize;
-    }
-}
-
-static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block)
-{
-    int i;
-    register int t1, t2, t3, t4, t5, t6, t7, t8;
-    int16_t *src, *dst;
-
-    src = block;
-    dst = block;
-
-    for (i = 0; i < 4; i++) {
-        t1 = 12 * (src[0] + src[4]) + 4;
-        t2 = 12 * (src[0] - src[4]) + 4;
-        t3 = 16 * src[2] +  6 * src[6];
-        t4 =  6 * src[2] - 16 * src[6];
-
-        t5 = t1 + t3;
-        t6 = t2 + t4;
-        t7 = t2 - t4;
-        t8 = t1 - t3;
-
-        t1 = 16 * src[1] + 15 * src[3] +  9 * src[5] +  4 * src[7];
-        t2 = 15 * src[1] -  4 * src[3] - 16 * src[5] -  9 * src[7];
-        t3 =  9 * src[1] - 16 * src[3] +  4 * src[5] + 15 * src[7];
-        t4 =  4 * src[1] -  9 * src[3] + 15 * src[5] - 16 * src[7];
-
-        dst[0] = (t5 + t1) >> 3;
-        dst[1] = (t6 + t2) >> 3;
-        dst[2] = (t7 + t3) >> 3;
-        dst[3] = (t8 + t4) >> 3;
-        dst[4] = (t8 - t4) >> 3;
-        dst[5] = (t7 - t3) >> 3;
-        dst[6] = (t6 - t2) >> 3;
-        dst[7] = (t5 - t1) >> 3;
-
-        src += 8;
-        dst += 8;
-    }
-
-    src = block;
-    for (i = 0; i < 8; i++) {
-        t1 = 17 * (src[ 0] + src[16]) + 64;
-        t2 = 17 * (src[ 0] - src[16]) + 64;
-        t3 = 22 * src[ 8] + 10 * src[24];
-        t4 = 22 * src[24] - 10 * src[ 8];
-
-        dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t1 + t3) >> 7));
-        dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t2 - t4) >> 7));
-        dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t2 + t4) >> 7));
-        dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t1 - t3) >> 7));
-
-        src++;
-        dest++;
-    }
-}
-
-/* Do inverse transform on 4x8 parts of block */
-static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
-{
-    int i;
-    int dc = block[0];
-
-    dc = (17 * dc +  4) >> 3;
-    dc = (12 * dc + 64) >> 7;
-
-    for (i = 0; i < 8; i++) {
-        dest[0] = av_clip_uint8(dest[0] + dc);
-        dest[1] = av_clip_uint8(dest[1] + dc);
-        dest[2] = av_clip_uint8(dest[2] + dc);
-        dest[3] = av_clip_uint8(dest[3] + dc);
-        dest += linesize;
-    }
-}
-
-static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block)
-{
-    int i;
-    register int t1, t2, t3, t4, t5, t6, t7, t8;
-    int16_t *src, *dst;
-
-    src = block;
-    dst = block;
-
-    for (i = 0; i < 8; i++) {
-        t1 = 17 * (src[0] + src[2]) + 4;
-        t2 = 17 * (src[0] - src[2]) + 4;
-        t3 = 22 * src[1] + 10 * src[3];
-        t4 = 22 * src[3] - 10 * src[1];
-
-        dst[0] = (t1 + t3) >> 3;
-        dst[1] = (t2 - t4) >> 3;
-        dst[2] = (t2 + t4) >> 3;
-        dst[3] = (t1 - t3) >> 3;
-
-        src += 8;
-        dst += 8;
-    }
-
-    src = block;
-    for (i = 0; i < 4; i++) {
-        t1 = 12 * (src[ 0] + src[32]) + 64;
-        t2 = 12 * (src[ 0] - src[32]) + 64;
-        t3 = 16 * src[16] +  6 * src[48];
-        t4 =  6 * src[16] - 16 * src[48];
-
-        t5 = t1 + t3;
-        t6 = t2 + t4;
-        t7 = t2 - t4;
-        t8 = t1 - t3;
-
-        t1 = 16 * src[ 8] + 15 * src[24] +  9 * src[40] +  4 * src[56];
-        t2 = 15 * src[ 8] -  4 * src[24] - 16 * src[40] -  9 * src[56];
-        t3 =  9 * src[ 8] - 16 * src[24] +  4 * src[40] + 15 * src[56];
-        t4 =  4 * src[ 8] -  9 * src[24] + 15 * src[40] - 16 * src[56];
-
-        dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t5 + t1)     >> 7));
-        dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t6 + t2)     >> 7));
-        dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t7 + t3)     >> 7));
-        dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t8 + t4)     >> 7));
-        dest[4 * linesize] = av_clip_uint8(dest[4 * linesize] + ((t8 - t4 + 1) >> 7));
-        dest[5 * linesize] = av_clip_uint8(dest[5 * linesize] + ((t7 - t3 + 1) >> 7));
-        dest[6 * linesize] = av_clip_uint8(dest[6 * linesize] + ((t6 - t2 + 1) >> 7));
-        dest[7 * linesize] = av_clip_uint8(dest[7 * linesize] + ((t5 - t1 + 1) >> 7));
-
-        src++;
-        dest++;
-    }
-}
-
-/* Do inverse transform on 4x4 part of block */
-static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
-{
-    int i;
-    int dc = block[0];
-
-    dc = (17 * dc +  4) >> 3;
-    dc = (17 * dc + 64) >> 7;
-
-    for (i = 0; i < 4; i++) {
-        dest[0] = av_clip_uint8(dest[0] + dc);
-        dest[1] = av_clip_uint8(dest[1] + dc);
-        dest[2] = av_clip_uint8(dest[2] + dc);
-        dest[3] = av_clip_uint8(dest[3] + dc);
-        dest += linesize;
-    }
-}
-
-static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, int16_t *block)
-{
-    int i;
-    register int t1, t2, t3, t4;
-    int16_t *src, *dst;
-
-    src = block;
-    dst = block;
-    for (i = 0; i < 4; i++) {
-        t1 = 17 * (src[0] + src[2]) + 4;
-        t2 = 17 * (src[0] - src[2]) + 4;
-        t3 = 22 * src[1] + 10 * src[3];
-        t4 = 22 * src[3] - 10 * src[1];
-
-        dst[0] = (t1 + t3) >> 3;
-        dst[1] = (t2 - t4) >> 3;
-        dst[2] = (t2 + t4) >> 3;
-        dst[3] = (t1 - t3) >> 3;
-
-        src += 8;
-        dst += 8;
-    }
-
-    src = block;
-    for (i = 0; i < 4; i++) {
-        t1 = 17 * (src[0] + src[16]) + 64;
-        t2 = 17 * (src[0] - src[16]) + 64;
-        t3 = 22 * src[8] + 10 * src[24];
-        t4 = 22 * src[24] - 10 * src[8];
-
-        dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t1 + t3) >> 7));
-        dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t2 - t4) >> 7));
-        dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t2 + t4) >> 7));
-        dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t1 - t3) >> 7));
-
-        src++;
-        dest++;
-    }
-}
-
-/* motion compensation functions */
-
-/* Filter in case of 2 filters */
-#define VC1_MSPEL_FILTER_16B(DIR, TYPE)                                       \
-static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src, \
-                                                                int stride,   \
-                                                                int mode)     \
-{                                                                             \
-    switch(mode) {                                                            \
-    case 0: /* no shift - should not occur */                                 \
-        return 0;                                                             \
-    case 1: /* 1/4 shift */                                                   \
-        return -4 * src[-stride] + 53 * src[0] +                              \
-               18 * src[stride]  -  3 * src[stride * 2];                      \
-    case 2: /* 1/2 shift */                                                   \
-        return -1 * src[-stride] +  9 * src[0] +                              \
-                9 * src[stride]  -  1 * src[stride * 2];                      \
-    case 3: /* 3/4 shift */                                                   \
-        return -3 * src[-stride] + 18 * src[0] +                              \
-               53 * src[stride]  -  4 * src[stride * 2];                      \
-    }                                                                         \
-    return 0; /* should not occur */                                          \
-}
-
-VC1_MSPEL_FILTER_16B(ver, uint8_t)
-VC1_MSPEL_FILTER_16B(hor, int16_t)
-
-/* Filter used to interpolate fractional pel values */
-static av_always_inline int vc1_mspel_filter(const uint8_t *src, int stride,
-                                             int mode, int r)
-{
-    switch (mode) {
-    case 0: // no shift
-        return src[0];
-    case 1: // 1/4 shift
-        return (-4 * src[-stride] + 53 * src[0] +
-                18 * src[stride]  -  3 * src[stride * 2] + 32 - r) >> 6;
-    case 2: // 1/2 shift
-        return (-1 * src[-stride] +  9 * src[0] +
-                 9 * src[stride]  -  1 * src[stride * 2] + 8 - r) >> 4;
-    case 3: // 3/4 shift
-        return (-3 * src[-stride] + 18 * src[0] +
-                53 * src[stride]  -  4 * src[stride * 2] + 32 - r) >> 6;
-    }
-    return 0; // should not occur
-}
-
-/* Function used to do motion compensation with bicubic interpolation */
-#define VC1_MSPEL_MC(OP, OPNAME)                                              \
-static av_always_inline void OPNAME ## vc1_mspel_mc(uint8_t *dst,             \
-                                                    const uint8_t *src,       \
-                                                    int stride,               \
-                                                    int hmode,                \
-                                                    int vmode,                \
-                                                    int rnd)                  \
-{                                                                             \
-    int i, j;                                                                 \
-                                                                              \
-    if (vmode) { /* Horizontal filter to apply */                             \
-        int r;                                                                \
-                                                                              \
-        if (hmode) { /* Vertical filter to apply, output to tmp */            \
-            static const int shift_value[] = { 0, 5, 1, 5 };                  \
-            int shift = (shift_value[hmode] + shift_value[vmode]) >> 1;       \
-            int16_t tmp[11 * 8], *tptr = tmp;                                 \
-                                                                              \
-            r = (1 << (shift - 1)) + rnd - 1;                                 \
-                                                                              \
-            src -= 1;                                                         \
-            for (j = 0; j < 8; j++) {                                         \
-                for (i = 0; i < 11; i++)                                      \
-                    tptr[i] = (vc1_mspel_ver_filter_16bits(src + i, stride, vmode) + r) >> shift; \
-                src  += stride;                                               \
-                tptr += 11;                                                   \
-            }                                                                 \
-                                                                              \
-            r    = 64 - rnd;                                                  \
-            tptr = tmp + 1;                                                   \
-            for (j = 0; j < 8; j++) {                                         \
-                for (i = 0; i < 8; i++)                                       \
-                    OP(dst[i], (vc1_mspel_hor_filter_16bits(tptr + i, 1, hmode) + r) >> 7); \
-                dst  += stride;                                               \
-                tptr += 11;                                                   \
-            }                                                                 \
-                                                                              \
-            return;                                                           \
-        } else { /* No horizontal filter, output 8 lines to dst */            \
-            r = 1 - rnd;                                                      \
-                                                                              \
-            for (j = 0; j < 8; j++) {                                         \
-                for (i = 0; i < 8; i++)                                       \
-                    OP(dst[i], vc1_mspel_filter(src + i, stride, vmode, r));  \
-                src += stride;                                                \
-                dst += stride;                                                \
-            }                                                                 \
-            return;                                                           \
-        }                                                                     \
-    }                                                                         \
-                                                                              \
-    /* Horizontal mode with no vertical mode */                               \
-    for (j = 0; j < 8; j++) {                                                 \
-        for (i = 0; i < 8; i++)                                               \
-            OP(dst[i], vc1_mspel_filter(src + i, 1, hmode, rnd));             \
-        dst += stride;                                                        \
-        src += stride;                                                        \
-    }                                                                         \
-}
-
-#define op_put(a, b) a = av_clip_uint8(b)
-#define op_avg(a, b) a = (a + av_clip_uint8(b) + 1) >> 1
-
-VC1_MSPEL_MC(op_put, put_)
-VC1_MSPEL_MC(op_avg, avg_)
-
-/* pixel functions - really are entry points to vc1_mspel_mc */
-
-#define PUT_VC1_MSPEL(a, b)                                                   \
-static void put_vc1_mspel_mc ## a ## b ## _c(uint8_t *dst,                    \
-                                             const uint8_t *src,              \
-                                             ptrdiff_t stride, int rnd)       \
-{                                                                             \
-    put_vc1_mspel_mc(dst, src, stride, a, b, rnd);                            \
-}                                                                             \
-static void avg_vc1_mspel_mc ## a ## b ## _c(uint8_t *dst,                    \
-                                             const uint8_t *src,              \
-                                             ptrdiff_t stride, int rnd)       \
-{                                                                             \
-    avg_vc1_mspel_mc(dst, src, stride, a, b, rnd);                            \
-}
-
-PUT_VC1_MSPEL(1, 0)
-PUT_VC1_MSPEL(2, 0)
-PUT_VC1_MSPEL(3, 0)
-
-PUT_VC1_MSPEL(0, 1)
-PUT_VC1_MSPEL(1, 1)
-PUT_VC1_MSPEL(2, 1)
-PUT_VC1_MSPEL(3, 1)
-
-PUT_VC1_MSPEL(0, 2)
-PUT_VC1_MSPEL(1, 2)
-PUT_VC1_MSPEL(2, 2)
-PUT_VC1_MSPEL(3, 2)
-
-PUT_VC1_MSPEL(0, 3)
-PUT_VC1_MSPEL(1, 3)
-PUT_VC1_MSPEL(2, 3)
-PUT_VC1_MSPEL(3, 3)
-
-#define chroma_mc(a) \
-    ((A * src[a] + B * src[a + 1] + \
-      C * src[stride + a] + D * src[stride + a + 1] + 32 - 4) >> 6)
-static void put_no_rnd_vc1_chroma_mc8_c(uint8_t *dst /* align 8 */,
-                                        uint8_t *src /* align 1 */,
-                                        int stride, int h, int x, int y)
-{
-    const int A = (8 - x) * (8 - y);
-    const int B =     (x) * (8 - y);
-    const int C = (8 - x) *     (y);
-    const int D =     (x) *     (y);
-    int i;
-
-    assert(x < 8 && y < 8 && x >= 0 && y >= 0);
-
-    for (i = 0; i < h; i++) {
-        dst[0] = chroma_mc(0);
-        dst[1] = chroma_mc(1);
-        dst[2] = chroma_mc(2);
-        dst[3] = chroma_mc(3);
-        dst[4] = chroma_mc(4);
-        dst[5] = chroma_mc(5);
-        dst[6] = chroma_mc(6);
-        dst[7] = chroma_mc(7);
-        dst += stride;
-        src += stride;
-    }
-}
-
-static void put_no_rnd_vc1_chroma_mc4_c(uint8_t *dst, uint8_t *src,
-                                        int stride, int h, int x, int y)
-{
-    const int A = (8 - x) * (8 - y);
-    const int B =     (x) * (8 - y);
-    const int C = (8 - x) *     (y);
-    const int D =     (x) *     (y);
-    int i;
-
-    assert(x < 8 && y < 8 && x >= 0 && y >= 0);
-
-    for (i = 0; i < h; i++) {
-        dst[0] = chroma_mc(0);
-        dst[1] = chroma_mc(1);
-        dst[2] = chroma_mc(2);
-        dst[3] = chroma_mc(3);
-        dst += stride;
-        src += stride;
-    }
-}
-
-#define avg2(a, b) (((a) + (b) + 1) >> 1)
-static void avg_no_rnd_vc1_chroma_mc8_c(uint8_t *dst /* align 8 */,
-                                        uint8_t *src /* align 1 */,
-                                        int stride, int h, int x, int y)
-{
-    const int A = (8 - x) * (8 - y);
-    const int B =     (x) * (8 - y);
-    const int C = (8 - x) *     (y);
-    const int D =     (x) *     (y);
-    int i;
-
-    assert(x < 8 && y < 8 && x >= 0 && y >= 0);
-
-    for (i = 0; i < h; i++) {
-        dst[0] = avg2(dst[0], chroma_mc(0));
-        dst[1] = avg2(dst[1], chroma_mc(1));
-        dst[2] = avg2(dst[2], chroma_mc(2));
-        dst[3] = avg2(dst[3], chroma_mc(3));
-        dst[4] = avg2(dst[4], chroma_mc(4));
-        dst[5] = avg2(dst[5], chroma_mc(5));
-        dst[6] = avg2(dst[6], chroma_mc(6));
-        dst[7] = avg2(dst[7], chroma_mc(7));
-        dst += stride;
-        src += stride;
-    }
-}
-
-static void avg_no_rnd_vc1_chroma_mc4_c(uint8_t *dst /* align 8 */,
-                                        uint8_t *src /* align 1 */,
-                                        int stride, int h, int x, int y)
-{
-    const int A = (8 - x) * (8 - y);
-    const int B = (    x) * (8 - y);
-    const int C = (8 - x) * (    y);
-    const int D = (    x) * (    y);
-    int i;
-
-    assert(x < 8 && y < 8 && x >= 0 && y >= 0);
-
-    for (i = 0; i < h; i++) {
-        dst[0] = avg2(dst[0], chroma_mc(0));
-        dst[1] = avg2(dst[1], chroma_mc(1));
-        dst[2] = avg2(dst[2], chroma_mc(2));
-        dst[3] = avg2(dst[3], chroma_mc(3));
-        dst += stride;
-        src += stride;
-    }
-}
-
-#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
-
-static void sprite_h_c(uint8_t *dst, const uint8_t *src, int offset,
-                       int advance, int count)
-{
-    while (count--) {
-        int a = src[(offset >> 16)];
-        int b = src[(offset >> 16) + 1];
-        *dst++  = a + ((b - a) * (offset & 0xFFFF) >> 16);
-        offset += advance;
-    }
-}
-
-static av_always_inline void sprite_v_template(uint8_t *dst,
-                                               const uint8_t *src1a,
-                                               const uint8_t *src1b,
-                                               int offset1,
-                                               int two_sprites,
-                                               const uint8_t *src2a,
-                                               const uint8_t *src2b,
-                                               int offset2,
-                                               int alpha, int scaled,
-                                               int width)
-{
-    int a1, b1, a2, b2;
-    while (width--) {
-        a1 = *src1a++;
-        if (scaled) {
-            b1 = *src1b++;
-            a1 = a1 + ((b1 - a1) * offset1 >> 16);
-        }
-        if (two_sprites) {
-            a2 = *src2a++;
-            if (scaled > 1) {
-                b2 = *src2b++;
-                a2 = a2 + ((b2 - a2) * offset2 >> 16);
-            }
-            a1 = a1 + ((a2 - a1) * alpha >> 16);
-        }
-        *dst++ = a1;
-    }
-}
-
-static void sprite_v_single_c(uint8_t *dst, const uint8_t *src1a,
-                              const uint8_t *src1b,
-                              int offset, int width)
-{
-    sprite_v_template(dst, src1a, src1b, offset, 0, NULL, NULL, 0, 0, 1, width);
-}
-
-static void sprite_v_double_noscale_c(uint8_t *dst, const uint8_t *src1a,
-                                      const uint8_t *src2a,
-                                      int alpha, int width)
-{
-    sprite_v_template(dst, src1a, NULL, 0, 1, src2a, NULL, 0, alpha, 0, width);
-}
-
-static void sprite_v_double_onescale_c(uint8_t *dst,
-                                       const uint8_t *src1a,
-                                       const uint8_t *src1b,
-                                       int offset1,
-                                       const uint8_t *src2a,
-                                       int alpha, int width)
-{
-    sprite_v_template(dst, src1a, src1b, offset1, 1, src2a, NULL, 0, alpha, 1,
-                      width);
-}
-
-static void sprite_v_double_twoscale_c(uint8_t *dst,
-                                       const uint8_t *src1a,
-                                       const uint8_t *src1b,
-                                       int offset1,
-                                       const uint8_t *src2a,
-                                       const uint8_t *src2b,
-                                       int offset2,
-                                       int alpha,
-                                       int width)
-{
-    sprite_v_template(dst, src1a, src1b, offset1, 1, src2a, src2b, offset2,
-                      alpha, 2, width);
-}
-
-#endif /* CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER */
-
-av_cold void ff_vc1dsp_init(VC1DSPContext *dsp)
-{
-    dsp->vc1_inv_trans_8x8    = vc1_inv_trans_8x8_c;
-    dsp->vc1_inv_trans_4x8    = vc1_inv_trans_4x8_c;
-    dsp->vc1_inv_trans_8x4    = vc1_inv_trans_8x4_c;
-    dsp->vc1_inv_trans_4x4    = vc1_inv_trans_4x4_c;
-    dsp->vc1_inv_trans_8x8_dc = vc1_inv_trans_8x8_dc_c;
-    dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_c;
-    dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_c;
-    dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_c;
-
-    dsp->vc1_h_overlap        = vc1_h_overlap_c;
-    dsp->vc1_v_overlap        = vc1_v_overlap_c;
-    dsp->vc1_h_s_overlap      = vc1_h_s_overlap_c;
-    dsp->vc1_v_s_overlap      = vc1_v_s_overlap_c;
-
-    dsp->vc1_v_loop_filter4   = vc1_v_loop_filter4_c;
-    dsp->vc1_h_loop_filter4   = vc1_h_loop_filter4_c;
-    dsp->vc1_v_loop_filter8   = vc1_v_loop_filter8_c;
-    dsp->vc1_h_loop_filter8   = vc1_h_loop_filter8_c;
-    dsp->vc1_v_loop_filter16  = vc1_v_loop_filter16_c;
-    dsp->vc1_h_loop_filter16  = vc1_h_loop_filter16_c;
-
-    dsp->put_vc1_mspel_pixels_tab[0]  = ff_put_pixels8x8_c;
-    dsp->put_vc1_mspel_pixels_tab[1]  = put_vc1_mspel_mc10_c;
-    dsp->put_vc1_mspel_pixels_tab[2]  = put_vc1_mspel_mc20_c;
-    dsp->put_vc1_mspel_pixels_tab[3]  = put_vc1_mspel_mc30_c;
-    dsp->put_vc1_mspel_pixels_tab[4]  = put_vc1_mspel_mc01_c;
-    dsp->put_vc1_mspel_pixels_tab[5]  = put_vc1_mspel_mc11_c;
-    dsp->put_vc1_mspel_pixels_tab[6]  = put_vc1_mspel_mc21_c;
-    dsp->put_vc1_mspel_pixels_tab[7]  = put_vc1_mspel_mc31_c;
-    dsp->put_vc1_mspel_pixels_tab[8]  = put_vc1_mspel_mc02_c;
-    dsp->put_vc1_mspel_pixels_tab[9]  = put_vc1_mspel_mc12_c;
-    dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_c;
-    dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_c;
-    dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_c;
-    dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_c;
-    dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_c;
-    dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_c;
-
-    dsp->avg_vc1_mspel_pixels_tab[0]  = ff_avg_pixels8x8_c;
-    dsp->avg_vc1_mspel_pixels_tab[1]  = avg_vc1_mspel_mc10_c;
-    dsp->avg_vc1_mspel_pixels_tab[2]  = avg_vc1_mspel_mc20_c;
-    dsp->avg_vc1_mspel_pixels_tab[3]  = avg_vc1_mspel_mc30_c;
-    dsp->avg_vc1_mspel_pixels_tab[4]  = avg_vc1_mspel_mc01_c;
-    dsp->avg_vc1_mspel_pixels_tab[5]  = avg_vc1_mspel_mc11_c;
-    dsp->avg_vc1_mspel_pixels_tab[6]  = avg_vc1_mspel_mc21_c;
-    dsp->avg_vc1_mspel_pixels_tab[7]  = avg_vc1_mspel_mc31_c;
-    dsp->avg_vc1_mspel_pixels_tab[8]  = avg_vc1_mspel_mc02_c;
-    dsp->avg_vc1_mspel_pixels_tab[9]  = avg_vc1_mspel_mc12_c;
-    dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_c;
-    dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_c;
-    dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_c;
-    dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_c;
-    dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_c;
-    dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_c;
-
-    dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_c;
-    dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_c;
-    dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = put_no_rnd_vc1_chroma_mc4_c;
-    dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = avg_no_rnd_vc1_chroma_mc4_c;
-
-#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
-    dsp->sprite_h                 = sprite_h_c;
-    dsp->sprite_v_single          = sprite_v_single_c;
-    dsp->sprite_v_double_noscale  = sprite_v_double_noscale_c;
-    dsp->sprite_v_double_onescale = sprite_v_double_onescale_c;
-    dsp->sprite_v_double_twoscale = sprite_v_double_twoscale_c;
-#endif /* CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER */
-
-    if (ARCH_AARCH64)
-        ff_vc1dsp_init_aarch64(dsp);
-    if (ARCH_ARM)
-        ff_vc1dsp_init_arm(dsp);
-    if (ARCH_PPC)
-        ff_vc1dsp_init_ppc(dsp);
-    if (ARCH_X86)
-        ff_vc1dsp_init_x86(dsp);
-}
diff --git a/deps/libav/libavcodec/vc1dsp.h b/deps/libav/libavcodec/vc1dsp.h
deleted file mode 100644
index 30be508..0000000
--- a/deps/libav/libavcodec/vc1dsp.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * VC-1 and WMV3 decoder - DSP functions
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VC-1 and WMV3 decoder
- *
- */
-
-#ifndef AVCODEC_VC1DSP_H
-#define AVCODEC_VC1DSP_H
-
-#include "dsputil.h"
-#include "hpeldsp.h"
-#include "h264chroma.h"
-
-typedef struct VC1DSPContext {
-    /* vc1 functions */
-    void (*vc1_inv_trans_8x8)(int16_t *b);
-    void (*vc1_inv_trans_8x4)(uint8_t *dest, int line_size, int16_t *block);
-    void (*vc1_inv_trans_4x8)(uint8_t *dest, int line_size, int16_t *block);
-    void (*vc1_inv_trans_4x4)(uint8_t *dest, int line_size, int16_t *block);
-    void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, int line_size, int16_t *block);
-    void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, int line_size, int16_t *block);
-    void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, int line_size, int16_t *block);
-    void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, int line_size, int16_t *block);
-    void (*vc1_v_overlap)(uint8_t *src, int stride);
-    void (*vc1_h_overlap)(uint8_t *src, int stride);
-    void (*vc1_v_s_overlap)(int16_t *top,  int16_t *bottom);
-    void (*vc1_h_s_overlap)(int16_t *left, int16_t *right);
-    void (*vc1_v_loop_filter4)(uint8_t *src, int stride, int pq);
-    void (*vc1_h_loop_filter4)(uint8_t *src, int stride, int pq);
-    void (*vc1_v_loop_filter8)(uint8_t *src, int stride, int pq);
-    void (*vc1_h_loop_filter8)(uint8_t *src, int stride, int pq);
-    void (*vc1_v_loop_filter16)(uint8_t *src, int stride, int pq);
-    void (*vc1_h_loop_filter16)(uint8_t *src, int stride, int pq);
-
-    /* put 8x8 block with bicubic interpolation and quarterpel precision
-     * last argument is actually round value instead of height
-     */
-    op_pixels_func put_vc1_mspel_pixels_tab[16];
-    op_pixels_func avg_vc1_mspel_pixels_tab[16];
-
-    /* This is really one func used in VC-1 decoding */
-    h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3];
-    h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3];
-
-    /* Windows Media Image functions */
-    void (*sprite_h)(uint8_t *dst, const uint8_t *src, int offset, int advance, int count);
-    void (*sprite_v_single)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset, int width);
-    void (*sprite_v_double_noscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src2a, int alpha, int width);
-    void (*sprite_v_double_onescale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
-                                                   const uint8_t *src2a, int alpha, int width);
-    void (*sprite_v_double_twoscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
-                                                   const uint8_t *src2a, const uint8_t *src2b, int offset2,
-                                     int alpha, int width);
-} VC1DSPContext;
-
-void ff_vc1dsp_init(VC1DSPContext* c);
-void ff_vc1dsp_init_aarch64(VC1DSPContext* dsp);
-void ff_vc1dsp_init_arm(VC1DSPContext* dsp);
-void ff_vc1dsp_init_ppc(VC1DSPContext *c);
-void ff_vc1dsp_init_x86(VC1DSPContext* dsp);
-
-#endif /* AVCODEC_VC1DSP_H */
diff --git a/deps/libav/libavcodec/vcr1.c b/deps/libav/libavcodec/vcr1.c
deleted file mode 100644
index 161704f..0000000
--- a/deps/libav/libavcodec/vcr1.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * ATI VCR1 codec
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ATI VCR1 codec
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/internal.h"
-
-typedef struct VCR1Context {
-    int delta[16];
-    int offset[4];
-} VCR1Context;
-
-static av_cold int vcr1_decode_init(AVCodecContext *avctx)
-{
-    avctx->pix_fmt = AV_PIX_FMT_YUV410P;
-
-    if (avctx->width & 7) {
-        av_log(avctx, AV_LOG_ERROR, "Width %d is not divisble by 8.\n", avctx->width);
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-static int vcr1_decode_frame(AVCodecContext *avctx, void *data,
-                             int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *buf        = avpkt->data;
-    int buf_size              = avpkt->size;
-    VCR1Context *const a      = avctx->priv_data;
-    AVFrame *const p          = data;
-    const uint8_t *bytestream = buf;
-    int i, x, y, ret;
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->key_frame = 1;
-
-    if (buf_size < 32)
-        goto packet_small;
-
-    for (i = 0; i < 16; i++) {
-        a->delta[i] = *bytestream++;
-        bytestream++;
-        buf_size--;
-    }
-
-    for (y = 0; y < avctx->height; y++) {
-        int offset;
-        uint8_t *luma = &p->data[0][y * p->linesize[0]];
-
-        if ((y & 3) == 0) {
-            uint8_t *cb = &p->data[1][(y >> 2) * p->linesize[1]];
-            uint8_t *cr = &p->data[2][(y >> 2) * p->linesize[2]];
-
-            if (buf_size < 4 + avctx->width)
-                goto packet_small;
-
-            for (i = 0; i < 4; i++)
-                a->offset[i] = *bytestream++;
-            buf_size -= 4;
-
-            offset = a->offset[0] - a->delta[bytestream[2] & 0xF];
-            for (x = 0; x < avctx->width; x += 4) {
-                luma[0]     = offset += a->delta[bytestream[2] & 0xF];
-                luma[1]     = offset += a->delta[bytestream[2] >>  4];
-                luma[2]     = offset += a->delta[bytestream[0] & 0xF];
-                luma[3]     = offset += a->delta[bytestream[0] >>  4];
-                luma       += 4;
-
-                *cb++       = bytestream[3];
-                *cr++       = bytestream[1];
-
-                bytestream += 4;
-                buf_size   -= 4;
-            }
-        } else {
-            if (buf_size < avctx->width / 2)
-                goto packet_small;
-
-            offset = a->offset[y & 3] - a->delta[bytestream[2] & 0xF];
-
-            for (x = 0; x < avctx->width; x += 8) {
-                luma[0]     = offset += a->delta[bytestream[2] & 0xF];
-                luma[1]     = offset += a->delta[bytestream[2] >>  4];
-                luma[2]     = offset += a->delta[bytestream[3] & 0xF];
-                luma[3]     = offset += a->delta[bytestream[3] >>  4];
-                luma[4]     = offset += a->delta[bytestream[0] & 0xF];
-                luma[5]     = offset += a->delta[bytestream[0] >>  4];
-                luma[6]     = offset += a->delta[bytestream[1] & 0xF];
-                luma[7]     = offset += a->delta[bytestream[1] >>  4];
-                luma       += 8;
-                bytestream += 4;
-                buf_size   -= 4;
-            }
-        }
-    }
-
-    *got_frame = 1;
-
-    return buf_size;
-packet_small:
-    av_log(avctx, AV_LOG_ERROR, "Input packet too small.\n");
-    return AVERROR_INVALIDDATA;
-}
-
-AVCodec ff_vcr1_decoder = {
-    .name           = "vcr1",
-    .long_name      = NULL_IF_CONFIG_SMALL("ATI VCR1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VCR1,
-    .priv_data_size = sizeof(VCR1Context),
-    .init           = vcr1_decode_init,
-    .decode         = vcr1_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/vda.h b/deps/libav/libavcodec/vda.h
deleted file mode 100644
index 987b94f..0000000
--- a/deps/libav/libavcodec/vda.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * VDA HW acceleration
- *
- * copyright (c) 2011 Sebastien Zwickert
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VDA_H
-#define AVCODEC_VDA_H
-
-/**
- * @file
- * @ingroup lavc_codec_hwaccel_vda
- * Public libavcodec VDA header.
- */
-
-#include "libavcodec/version.h"
-
-#include <stdint.h>
-
-// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
-// http://openradar.appspot.com/8026390
-#undef __GNUC_STDC_INLINE__
-
-#define Picture QuickdrawPicture
-#include <VideoDecodeAcceleration/VDADecoder.h>
-#undef Picture
-
-/**
- * @defgroup lavc_codec_hwaccel_vda VDA
- * @ingroup lavc_codec_hwaccel
- *
- * @{
- */
-
-/**
- * This structure is used to provide the necessary configurations and data
- * to the VDA Libav HWAccel implementation.
- *
- * The application must make it available as AVCodecContext.hwaccel_context.
- */
-struct vda_context {
-    /**
-     * VDA decoder object.
-     *
-     * - encoding: unused
-     * - decoding: Set/Unset by libavcodec.
-     */
-    VDADecoder          decoder;
-
-    /**
-     * The Core Video pixel buffer that contains the current image data.
-     *
-     * encoding: unused
-     * decoding: Set by libavcodec. Unset by user.
-     */
-    CVPixelBufferRef    cv_buffer;
-
-    /**
-     * Use the hardware decoder in synchronous mode.
-     *
-     * encoding: unused
-     * decoding: Set by user.
-     */
-    int                 use_sync_decoding;
-
-    /**
-     * The frame width.
-     *
-     * - encoding: unused
-     * - decoding: Set/Unset by user.
-     */
-    int                 width;
-
-    /**
-     * The frame height.
-     *
-     * - encoding: unused
-     * - decoding: Set/Unset by user.
-     */
-    int                 height;
-
-    /**
-     * The frame format.
-     *
-     * - encoding: unused
-     * - decoding: Set/Unset by user.
-     */
-    int                 format;
-
-    /**
-     * The pixel format for output image buffers.
-     *
-     * - encoding: unused
-     * - decoding: Set/Unset by user.
-     */
-    OSType              cv_pix_fmt_type;
-
-    /**
-     * The current bitstream buffer.
-     */
-    uint8_t             *priv_bitstream;
-
-    /**
-     * The current size of the bitstream.
-     */
-    int                 priv_bitstream_size;
-
-    /**
-     * The reference size used for fast reallocation.
-     */
-    int                 priv_allocated_size;
-};
-
-/** Create the video decoder. */
-int ff_vda_create_decoder(struct vda_context *vda_ctx,
-                          uint8_t *extradata,
-                          int extradata_size);
-
-/** Destroy the video decoder. */
-int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
-
-/**
- * @}
- */
-
-#endif /* AVCODEC_VDA_H */
diff --git a/deps/libav/libavcodec/vda_h264.c b/deps/libav/libavcodec/vda_h264.c
deleted file mode 100644
index 6c1845a..0000000
--- a/deps/libav/libavcodec/vda_h264.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * VDA H.264 hardware acceleration
- *
- * copyright (c) 2011 Sebastien Zwickert
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <CoreFoundation/CFNumber.h>
-#include <CoreFoundation/CFData.h>
-#include <CoreFoundation/CFString.h>
-
-#include "libavutil/avutil.h"
-#include "h264.h"
-#include "vda.h"
-
-/* Decoder callback that adds the VDA frame to the queue in display order. */
-static void vda_decoder_callback(void *vda_hw_ctx,
-                                 CFDictionaryRef user_info,
-                                 OSStatus status,
-                                 uint32_t infoFlags,
-                                 CVImageBufferRef image_buffer)
-{
-    struct vda_context *vda_ctx = vda_hw_ctx;
-
-    if (!image_buffer)
-        return;
-
-    if (vda_ctx->cv_pix_fmt_type != CVPixelBufferGetPixelFormatType(image_buffer))
-        return;
-
-    vda_ctx->cv_buffer = CVPixelBufferRetain(image_buffer);
-}
-
-static int vda_sync_decode(struct vda_context *vda_ctx)
-{
-    OSStatus status;
-    CFDataRef coded_frame;
-    uint32_t flush_flags = 1 << 0; ///< kVDADecoderFlush_emitFrames
-
-    coded_frame = CFDataCreate(kCFAllocatorDefault,
-                               vda_ctx->priv_bitstream,
-                               vda_ctx->priv_bitstream_size);
-
-    status = VDADecoderDecode(vda_ctx->decoder, 0, coded_frame, NULL);
-
-    if (kVDADecoderNoErr == status)
-        status = VDADecoderFlush(vda_ctx->decoder, flush_flags);
-
-    CFRelease(coded_frame);
-
-    return status;
-}
-
-
-static int vda_h264_start_frame(AVCodecContext *avctx,
-                                av_unused const uint8_t *buffer,
-                                av_unused uint32_t size)
-{
-    struct vda_context *vda_ctx         = avctx->hwaccel_context;
-
-    if (!vda_ctx->decoder)
-        return -1;
-
-    vda_ctx->priv_bitstream_size = 0;
-
-    return 0;
-}
-
-static int vda_h264_decode_slice(AVCodecContext *avctx,
-                                 const uint8_t *buffer,
-                                 uint32_t size)
-{
-    struct vda_context *vda_ctx         = avctx->hwaccel_context;
-    void *tmp;
-
-    if (!vda_ctx->decoder)
-        return -1;
-
-    tmp = av_fast_realloc(vda_ctx->priv_bitstream,
-                          &vda_ctx->priv_allocated_size,
-                          vda_ctx->priv_bitstream_size + size + 4);
-    if (!tmp)
-        return AVERROR(ENOMEM);
-
-    vda_ctx->priv_bitstream = tmp;
-
-    AV_WB32(vda_ctx->priv_bitstream + vda_ctx->priv_bitstream_size, size);
-    memcpy(vda_ctx->priv_bitstream + vda_ctx->priv_bitstream_size + 4, buffer, size);
-
-    vda_ctx->priv_bitstream_size += size + 4;
-
-    return 0;
-}
-
-static int vda_h264_end_frame(AVCodecContext *avctx)
-{
-    H264Context *h                      = avctx->priv_data;
-    struct vda_context *vda_ctx         = avctx->hwaccel_context;
-    AVFrame *frame                      = &h->cur_pic_ptr->f;
-    int status;
-
-    if (!vda_ctx->decoder || !vda_ctx->priv_bitstream)
-        return -1;
-
-    status = vda_sync_decode(vda_ctx);
-    frame->data[3] = (void*)vda_ctx->cv_buffer;
-
-    if (status)
-        av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);
-
-    return status;
-}
-
-int ff_vda_create_decoder(struct vda_context *vda_ctx,
-                          uint8_t *extradata,
-                          int extradata_size)
-{
-    OSStatus status = kVDADecoderNoErr;
-    CFNumberRef height;
-    CFNumberRef width;
-    CFNumberRef format;
-    CFDataRef avc_data;
-    CFMutableDictionaryRef config_info;
-    CFMutableDictionaryRef buffer_attributes;
-    CFMutableDictionaryRef io_surface_properties;
-    CFNumberRef cv_pix_fmt;
-
-    /* Each VCL NAL in the bistream sent to the decoder
-     * is preceded by a 4 bytes length header.
-     * Change the avcC atom header if needed, to signal headers of 4 bytes. */
-    if (extradata_size >= 4 && (extradata[4] & 0x03) != 0x03) {
-        uint8_t *rw_extradata;
-
-        if (!(rw_extradata = av_malloc(extradata_size)))
-            return AVERROR(ENOMEM);
-
-        memcpy(rw_extradata, extradata, extradata_size);
-
-        rw_extradata[4] |= 0x03;
-
-        avc_data = CFDataCreate(kCFAllocatorDefault, rw_extradata, extradata_size);
-
-        av_freep(&rw_extradata);
-    } else {
-        avc_data = CFDataCreate(kCFAllocatorDefault, extradata, extradata_size);
-    }
-
-    config_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
-                                            4,
-                                            &kCFTypeDictionaryKeyCallBacks,
-                                            &kCFTypeDictionaryValueCallBacks);
-
-    height   = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->height);
-    width    = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->width);
-    format   = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->format);
-
-    CFDictionarySetValue(config_info, kVDADecoderConfiguration_Height, height);
-    CFDictionarySetValue(config_info, kVDADecoderConfiguration_Width, width);
-    CFDictionarySetValue(config_info, kVDADecoderConfiguration_SourceFormat, format);
-    CFDictionarySetValue(config_info, kVDADecoderConfiguration_avcCData, avc_data);
-
-    buffer_attributes = CFDictionaryCreateMutable(kCFAllocatorDefault,
-                                                  2,
-                                                  &kCFTypeDictionaryKeyCallBacks,
-                                                  &kCFTypeDictionaryValueCallBacks);
-    io_surface_properties = CFDictionaryCreateMutable(kCFAllocatorDefault,
-                                                      0,
-                                                      &kCFTypeDictionaryKeyCallBacks,
-                                                      &kCFTypeDictionaryValueCallBacks);
-    cv_pix_fmt      = CFNumberCreate(kCFAllocatorDefault,
-                                     kCFNumberSInt32Type,
-                                     &vda_ctx->cv_pix_fmt_type);
-    CFDictionarySetValue(buffer_attributes,
-                         kCVPixelBufferPixelFormatTypeKey,
-                         cv_pix_fmt);
-    CFDictionarySetValue(buffer_attributes,
-                         kCVPixelBufferIOSurfacePropertiesKey,
-                         io_surface_properties);
-
-    status = VDADecoderCreate(config_info,
-                              buffer_attributes,
-                              vda_decoder_callback,
-                              vda_ctx,
-                              &vda_ctx->decoder);
-
-    CFRelease(height);
-    CFRelease(width);
-    CFRelease(format);
-    CFRelease(avc_data);
-    CFRelease(config_info);
-    CFRelease(io_surface_properties);
-    CFRelease(cv_pix_fmt);
-    CFRelease(buffer_attributes);
-
-    return status;
-}
-
-int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
-{
-    OSStatus status = kVDADecoderNoErr;
-
-    if (vda_ctx->decoder)
-        status = VDADecoderDestroy(vda_ctx->decoder);
-
-    av_freep(&vda_ctx->priv_bitstream);
-
-    return status;
-}
-
-AVHWAccel ff_h264_vda_hwaccel = {
-    .name           = "h264_vda",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H264,
-    .pix_fmt        = AV_PIX_FMT_VDA_VLD,
-    .start_frame    = vda_h264_start_frame,
-    .decode_slice   = vda_h264_decode_slice,
-    .end_frame      = vda_h264_end_frame,
-};
diff --git a/deps/libav/libavcodec/vdpau.c b/deps/libav/libavcodec/vdpau.c
deleted file mode 100644
index d8a35ee..0000000
--- a/deps/libav/libavcodec/vdpau.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Video Decode and Presentation API for UNIX (VDPAU) is used for
- * HW decode acceleration for MPEG-1/2, MPEG-4 ASP, H.264 and VC-1.
- *
- * Copyright (c) 2008 NVIDIA
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <limits.h>
-#include "avcodec.h"
-#include "h264.h"
-#include "vc1.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-#include "vdpau.h"
-#include "vdpau_internal.h"
-
-/**
- * @addtogroup VDPAU_Decoding
- *
- * @{
- */
-
-int ff_vdpau_common_start_frame(Picture *pic,
-                                av_unused const uint8_t *buffer,
-                                av_unused uint32_t size)
-{
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-
-    pic_ctx->bitstream_buffers_allocated = 0;
-    pic_ctx->bitstream_buffers_used      = 0;
-    pic_ctx->bitstream_buffers           = NULL;
-    return 0;
-}
-
-#if CONFIG_H263_VDPAU_HWACCEL  || CONFIG_MPEG1_VDPAU_HWACCEL || \
-    CONFIG_MPEG2_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL || \
-    CONFIG_VC1_VDPAU_HWACCEL   || CONFIG_WMV3_VDPAU_HWACCEL
-int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
-{
-    AVVDPAUContext *hwctx = avctx->hwaccel_context;
-    MpegEncContext *s = avctx->priv_data;
-    Picture *pic = s->current_picture_ptr;
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);
-
-    hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info,
-                  pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
-
-    ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
-    av_freep(&pic_ctx->bitstream_buffers);
-
-    return 0;
-}
-#endif
-
-int ff_vdpau_add_buffer(Picture *pic, const uint8_t *buf, uint32_t size)
-{
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    VdpBitstreamBuffer *buffers = pic_ctx->bitstream_buffers;
-
-    buffers = av_fast_realloc(buffers, &pic_ctx->bitstream_buffers_allocated,
-                              (pic_ctx->bitstream_buffers_used + 1) * sizeof(*buffers));
-    if (!buffers)
-        return AVERROR(ENOMEM);
-
-    pic_ctx->bitstream_buffers = buffers;
-    buffers += pic_ctx->bitstream_buffers_used++;
-
-    buffers->struct_version  = VDP_BITSTREAM_BUFFER_VERSION;
-    buffers->bitstream       = buf;
-    buffers->bitstream_bytes = size;
-    return 0;
-}
-
-int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile)
-{
-#define PROFILE(prof)       \
-do {                        \
-    *profile = prof;        \
-    return 0;               \
-} while (0)
-
-    switch (avctx->codec_id) {
-    case AV_CODEC_ID_MPEG1VIDEO:               PROFILE(VDP_DECODER_PROFILE_MPEG1);
-    case AV_CODEC_ID_MPEG2VIDEO:
-        switch (avctx->profile) {
-        case FF_PROFILE_MPEG2_MAIN:            PROFILE(VDP_DECODER_PROFILE_MPEG2_MAIN);
-        case FF_PROFILE_MPEG2_SIMPLE:          PROFILE(VDP_DECODER_PROFILE_MPEG2_SIMPLE);
-        default:                               return AVERROR(EINVAL);
-        }
-    case AV_CODEC_ID_H263:                     PROFILE(VDP_DECODER_PROFILE_MPEG4_PART2_ASP);
-    case AV_CODEC_ID_MPEG4:
-        switch (avctx->profile) {
-        case FF_PROFILE_MPEG4_SIMPLE:          PROFILE(VDP_DECODER_PROFILE_MPEG4_PART2_SP);
-        case FF_PROFILE_MPEG4_ADVANCED_SIMPLE: PROFILE(VDP_DECODER_PROFILE_MPEG4_PART2_ASP);
-        default:                               return AVERROR(EINVAL);
-        }
-    case AV_CODEC_ID_H264:
-        switch (avctx->profile) {
-        case FF_PROFILE_H264_CONSTRAINED_BASELINE:
-        case FF_PROFILE_H264_BASELINE:         PROFILE(VDP_DECODER_PROFILE_H264_BASELINE);
-        case FF_PROFILE_H264_MAIN:             PROFILE(VDP_DECODER_PROFILE_H264_MAIN);
-        case FF_PROFILE_H264_HIGH:             PROFILE(VDP_DECODER_PROFILE_H264_HIGH);
-        default:                               return AVERROR(EINVAL);
-        }
-    case AV_CODEC_ID_WMV3:
-    case AV_CODEC_ID_VC1:
-        switch (avctx->profile) {
-        case FF_PROFILE_VC1_SIMPLE:            PROFILE(VDP_DECODER_PROFILE_VC1_SIMPLE);
-        case FF_PROFILE_VC1_MAIN:              PROFILE(VDP_DECODER_PROFILE_VC1_MAIN);
-        case FF_PROFILE_VC1_ADVANCED:          PROFILE(VDP_DECODER_PROFILE_VC1_ADVANCED);
-        default:                               return AVERROR(EINVAL);
-        }
-    }
-    return AVERROR(EINVAL);
-}
-
-AVVDPAUContext *av_vdpau_alloc_context(void)
-{
-    return av_mallocz(sizeof(AVVDPAUContext));
-}
-
-/* @}*/
diff --git a/deps/libav/libavcodec/vdpau.h b/deps/libav/libavcodec/vdpau.h
deleted file mode 100644
index 75cb1bf..0000000
--- a/deps/libav/libavcodec/vdpau.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * The Video Decode and Presentation API for UNIX (VDPAU) is used for
- * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
- *
- * Copyright (C) 2008 NVIDIA
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VDPAU_H
-#define AVCODEC_VDPAU_H
-
-/**
- * @file
- * @ingroup lavc_codec_hwaccel_vdpau
- * Public libavcodec VDPAU header.
- */
-
-
-/**
- * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
- * @ingroup lavc_codec_hwaccel
- *
- * VDPAU hardware acceleration has two modules
- * - VDPAU decoding
- * - VDPAU presentation
- *
- * The VDPAU decoding module parses all headers using Libav
- * parsing mechanisms and uses VDPAU for the actual decoding.
- *
- * As per the current implementation, the actual decoding
- * and rendering (API calls) are done as part of the VDPAU
- * presentation (vo_vdpau.c) module.
- *
- * @{
- */
-
-#include <vdpau/vdpau.h>
-#include <vdpau/vdpau_x11.h>
-
-#include "libavutil/attributes.h"
-
-#include "avcodec.h"
-#include "version.h"
-
-#if FF_API_BUFS_VDPAU
-union AVVDPAUPictureInfo {
-    VdpPictureInfoH264        h264;
-    VdpPictureInfoMPEG1Or2    mpeg;
-    VdpPictureInfoVC1          vc1;
-    VdpPictureInfoMPEG4Part2 mpeg4;
-};
-#endif
-
-/**
- * This structure is used to share data between the libavcodec library and
- * the client video application.
- * The user shall zero-allocate the structure and make it available as
- * AVCodecContext.hwaccel_context. Members can be set by the user once
- * during initialization or through each AVCodecContext.get_buffer()
- * function call. In any case, they must be valid prior to calling
- * decoding functions.
- *
- * The size of this structure is not a part of the public ABI and must not
- * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an
- * AVVDPAUContext.
- */
-typedef struct AVVDPAUContext {
-    /**
-     * VDPAU decoder handle
-     *
-     * Set by user.
-     */
-    VdpDecoder decoder;
-
-    /**
-     * VDPAU decoder render callback
-     *
-     * Set by the user.
-     */
-    VdpDecoderRender *render;
-
-#if FF_API_BUFS_VDPAU
-    /**
-     * VDPAU picture information
-     *
-     * Set by libavcodec.
-     */
-    attribute_deprecated
-    union AVVDPAUPictureInfo info;
-
-    /**
-     * Allocated size of the bitstream_buffers table.
-     *
-     * Set by libavcodec.
-     */
-    attribute_deprecated
-    int bitstream_buffers_allocated;
-
-    /**
-     * Useful bitstream buffers in the bitstream buffers table.
-     *
-     * Set by libavcodec.
-     */
-    attribute_deprecated
-    int bitstream_buffers_used;
-
-   /**
-     * Table of bitstream buffers.
-     * The user is responsible for freeing this buffer using av_freep().
-     *
-     * Set by libavcodec.
-     */
-    attribute_deprecated
-    VdpBitstreamBuffer *bitstream_buffers;
-#endif
-} AVVDPAUContext;
-
-/**
- * Allocate an AVVDPAUContext.
- *
- * @return Newly-allocated AVVDPAUContext or NULL on failure.
- */
-AVVDPAUContext *av_vdpau_alloc_context(void);
-
-/**
- * Get a decoder profile that should be used for initializing a VDPAU decoder.
- * Should be called from the AVCodecContext.get_format() callback.
- *
- * @param avctx the codec context being used for decoding the stream
- * @param profile a pointer into which the result will be written on success.
- *                The contents of profile are undefined if this function returns
- *                an error.
- *
- * @return 0 on success (non-negative), a negative AVERROR on failure.
- */
-int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile);
-
-#if FF_API_CAP_VDPAU
-/** @brief The videoSurface is used for rendering. */
-#define FF_VDPAU_STATE_USED_FOR_RENDER 1
-
-/**
- * @brief The videoSurface is needed for reference/prediction.
- * The codec manipulates this.
- */
-#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
-
-/**
- * @brief This structure is used as a callback between the Libav
- * decoder (vd_) and presentation (vo_) module.
- * This is used for defining a video frame containing surface,
- * picture parameter, bitstream information etc which are passed
- * between the Libav decoder and its clients.
- */
-struct vdpau_render_state {
-    VdpVideoSurface surface; ///< Used as rendered surface, never changed.
-
-    int state; ///< Holds FF_VDPAU_STATE_* values.
-
-    /** picture parameter information for all supported codecs */
-    union AVVDPAUPictureInfo info;
-
-    /** Describe size/location of the compressed video data.
-        Set to 0 when freeing bitstream_buffers. */
-    int bitstream_buffers_allocated;
-    int bitstream_buffers_used;
-    /** The user is responsible for freeing this buffer using av_freep(). */
-    VdpBitstreamBuffer *bitstream_buffers;
-};
-#endif
-
-/* @}*/
-
-#endif /* AVCODEC_VDPAU_H */
diff --git a/deps/libav/libavcodec/vdpau_h264.c b/deps/libav/libavcodec/vdpau_h264.c
deleted file mode 100644
index 3e84644..0000000
--- a/deps/libav/libavcodec/vdpau_h264.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * MPEG-4 Part 10 / AVC / H.264 HW decode acceleration through VDPAU
- *
- * Copyright (c) 2008 NVIDIA
- * Copyright (c) 2013 Rémi Denis-Courmont
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <vdpau/vdpau.h>
-
-#include "avcodec.h"
-#include "h264.h"
-#include "vdpau.h"
-#include "vdpau_internal.h"
-
-static int32_t h264_foc(int foc)
-{
-    if (foc == INT_MAX)
-        foc = 0;
-    return foc;
-}
-
-static void vdpau_h264_clear_rf(VdpReferenceFrameH264 *rf)
-{
-    rf->surface             = VDP_INVALID_HANDLE;
-    rf->is_long_term        = VDP_FALSE;
-    rf->top_is_reference    = VDP_FALSE;
-    rf->bottom_is_reference = VDP_FALSE;
-    rf->field_order_cnt[0]  = 0;
-    rf->field_order_cnt[1]  = 0;
-    rf->frame_idx           = 0;
-}
-
-static void vdpau_h264_set_rf(VdpReferenceFrameH264 *rf, Picture *pic,
-                              int pic_structure)
-{
-    VdpVideoSurface surface = ff_vdpau_get_surface_id(pic);
-
-    if (pic_structure == 0)
-        pic_structure = pic->reference;
-
-    rf->surface             = surface;
-    rf->is_long_term        = pic->reference && pic->long_ref;
-    rf->top_is_reference    = (pic_structure & PICT_TOP_FIELD)    != 0;
-    rf->bottom_is_reference = (pic_structure & PICT_BOTTOM_FIELD) != 0;
-    rf->field_order_cnt[0]  = h264_foc(pic->field_poc[0]);
-    rf->field_order_cnt[1]  = h264_foc(pic->field_poc[1]);
-    rf->frame_idx           = pic->long_ref ? pic->pic_id : pic->frame_num;
-}
-
-static void vdpau_h264_set_reference_frames(AVCodecContext *avctx)
-{
-    H264Context * const h = avctx->priv_data;
-    struct vdpau_picture_context *pic_ctx = h->cur_pic_ptr->hwaccel_picture_private;
-    VdpPictureInfoH264 *info = &pic_ctx->info.h264;
-    int list;
-
-    VdpReferenceFrameH264 *rf = &info->referenceFrames[0];
-#define H264_RF_COUNT FF_ARRAY_ELEMS(info->referenceFrames)
-
-    for (list = 0; list < 2; ++list) {
-        Picture **lp = list ? h->long_ref : h->short_ref;
-        int i, ls    = list ? 16          : h->short_ref_count;
-
-        for (i = 0; i < ls; ++i) {
-            Picture *pic = lp[i];
-            VdpReferenceFrameH264 *rf2;
-            VdpVideoSurface surface_ref;
-            int pic_frame_idx;
-
-            if (!pic || !pic->reference)
-                continue;
-            pic_frame_idx = pic->long_ref ? pic->pic_id : pic->frame_num;
-            surface_ref = ff_vdpau_get_surface_id(pic);
-
-            rf2 = &info->referenceFrames[0];
-            while (rf2 != rf) {
-                if ((rf2->surface      == surface_ref)   &&
-                    (rf2->is_long_term == pic->long_ref) &&
-                    (rf2->frame_idx    == pic_frame_idx))
-                    break;
-                ++rf2;
-            }
-            if (rf2 != rf) {
-                rf2->top_is_reference    |= (pic->reference & PICT_TOP_FIELD)    ? VDP_TRUE : VDP_FALSE;
-                rf2->bottom_is_reference |= (pic->reference & PICT_BOTTOM_FIELD) ? VDP_TRUE : VDP_FALSE;
-                continue;
-            }
-
-            if (rf >= &info->referenceFrames[H264_RF_COUNT])
-                continue;
-
-            vdpau_h264_set_rf(rf, pic, pic->reference);
-            ++rf;
-        }
-    }
-
-    for (; rf < &info->referenceFrames[H264_RF_COUNT]; ++rf)
-        vdpau_h264_clear_rf(rf);
-}
-
-static int vdpau_h264_start_frame(AVCodecContext *avctx,
-                                  const uint8_t *buffer, uint32_t size)
-{
-    H264Context * const h = avctx->priv_data;
-    Picture *pic = h->cur_pic_ptr;
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    VdpPictureInfoH264 *info = &pic_ctx->info.h264;
-
-    /* init VdpPictureInfoH264 */
-    info->slice_count                            = 0;
-    info->field_order_cnt[0]                     = h264_foc(pic->field_poc[0]);
-    info->field_order_cnt[1]                     = h264_foc(pic->field_poc[1]);
-    info->is_reference                           = h->nal_ref_idc != 0;
-    info->frame_num                              = h->frame_num;
-    info->field_pic_flag                         = h->picture_structure != PICT_FRAME;
-    info->bottom_field_flag                      = h->picture_structure == PICT_BOTTOM_FIELD;
-    info->num_ref_frames                         = h->sps.ref_frame_count;
-    info->mb_adaptive_frame_field_flag           = h->sps.mb_aff && !info->field_pic_flag;
-    info->constrained_intra_pred_flag            = h->pps.constrained_intra_pred;
-    info->weighted_pred_flag                     = h->pps.weighted_pred;
-    info->weighted_bipred_idc                    = h->pps.weighted_bipred_idc;
-    info->frame_mbs_only_flag                    = h->sps.frame_mbs_only_flag;
-    info->transform_8x8_mode_flag                = h->pps.transform_8x8_mode;
-    info->chroma_qp_index_offset                 = h->pps.chroma_qp_index_offset[0];
-    info->second_chroma_qp_index_offset          = h->pps.chroma_qp_index_offset[1];
-    info->pic_init_qp_minus26                    = h->pps.init_qp - 26;
-    info->num_ref_idx_l0_active_minus1           = h->pps.ref_count[0] - 1;
-    info->num_ref_idx_l1_active_minus1           = h->pps.ref_count[1] - 1;
-    info->log2_max_frame_num_minus4              = h->sps.log2_max_frame_num - 4;
-    info->pic_order_cnt_type                     = h->sps.poc_type;
-    info->log2_max_pic_order_cnt_lsb_minus4      = h->sps.poc_type ? 0 : h->sps.log2_max_poc_lsb - 4;
-    info->delta_pic_order_always_zero_flag       = h->sps.delta_pic_order_always_zero_flag;
-    info->direct_8x8_inference_flag              = h->sps.direct_8x8_inference_flag;
-    info->entropy_coding_mode_flag               = h->pps.cabac;
-    info->pic_order_present_flag                 = h->pps.pic_order_present;
-    info->deblocking_filter_control_present_flag = h->pps.deblocking_filter_parameters_present;
-    info->redundant_pic_cnt_present_flag         = h->pps.redundant_pic_cnt_present;
-
-    memcpy(info->scaling_lists_4x4, h->pps.scaling_matrix4,
-           sizeof(info->scaling_lists_4x4));
-    memcpy(info->scaling_lists_8x8[0], h->pps.scaling_matrix8[0],
-           sizeof(info->scaling_lists_8x8[0]));
-    memcpy(info->scaling_lists_8x8[1], h->pps.scaling_matrix8[3],
-           sizeof(info->scaling_lists_8x8[1]));
-
-    vdpau_h264_set_reference_frames(avctx);
-
-    return ff_vdpau_common_start_frame(pic, buffer, size);
-}
-
-static const uint8_t start_code_prefix[3] = { 0x00, 0x00, 0x01 };
-
-static int vdpau_h264_decode_slice(AVCodecContext *avctx,
-                                   const uint8_t *buffer, uint32_t size)
-{
-    H264Context *h = avctx->priv_data;
-    Picture *pic   = h->cur_pic_ptr;
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    int val;
-
-    val = ff_vdpau_add_buffer(pic, start_code_prefix, 3);
-    if (val)
-        return val;
-
-    val = ff_vdpau_add_buffer(pic, buffer, size);
-    if (val)
-        return val;
-
-    pic_ctx->info.h264.slice_count++;
-    return 0;
-}
-
-static int vdpau_h264_end_frame(AVCodecContext *avctx)
-{
-    AVVDPAUContext *hwctx = avctx->hwaccel_context;
-    H264Context *h = avctx->priv_data;
-    Picture *pic   = h->cur_pic_ptr;
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);
-
-    hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info,
-                  pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
-
-    ff_h264_draw_horiz_band(h, 0, h->avctx->height);
-    av_freep(&pic_ctx->bitstream_buffers);
-
-    return 0;
-}
-
-AVHWAccel ff_h264_vdpau_hwaccel = {
-    .name           = "h264_vdpau",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H264,
-    .pix_fmt        = AV_PIX_FMT_VDPAU,
-    .start_frame    = vdpau_h264_start_frame,
-    .end_frame      = vdpau_h264_end_frame,
-    .decode_slice   = vdpau_h264_decode_slice,
-    .priv_data_size = sizeof(struct vdpau_picture_context),
-};
diff --git a/deps/libav/libavcodec/vdpau_internal.h b/deps/libav/libavcodec/vdpau_internal.h
deleted file mode 100644
index 50c4f5e..0000000
--- a/deps/libav/libavcodec/vdpau_internal.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Video Decode and Presentation API for UNIX (VDPAU) is used for
- * HW decode acceleration for MPEG-1/2, H.264 and VC-1.
- *
- * Copyright (C) 2008 NVIDIA
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VDPAU_INTERNAL_H
-#define AVCODEC_VDPAU_INTERNAL_H
-
-#include <stdint.h>
-#include <vdpau/vdpau.h>
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "version.h"
-
-/** Extract VdpVideoSurface from a Picture */
-static inline uintptr_t ff_vdpau_get_surface_id(Picture *pic)
-{
-    return (uintptr_t)pic->f.data[3];
-}
-
-#if !FF_API_BUFS_VDPAU
-union AVVDPAUPictureInfo {
-    VdpPictureInfoH264        h264;
-    VdpPictureInfoMPEG1Or2    mpeg;
-    VdpPictureInfoVC1          vc1;
-    VdpPictureInfoMPEG4Part2 mpeg4;
-};
-#else
-#include "vdpau.h"
-#endif
-
-struct vdpau_picture_context {
-    /**
-     * VDPAU picture information.
-     */
-    union AVVDPAUPictureInfo info;
-
-    /**
-     * Allocated size of the bitstream_buffers table.
-     */
-    int bitstream_buffers_allocated;
-
-    /**
-     * Useful bitstream buffers in the bitstream buffers table.
-     */
-    int bitstream_buffers_used;
-
-   /**
-     * Table of bitstream buffers.
-     */
-    VdpBitstreamBuffer *bitstream_buffers;
-};
-
-int ff_vdpau_common_start_frame(Picture *pic,
-                                const uint8_t *buffer, uint32_t size);
-int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx);
-int ff_vdpau_add_buffer(Picture *pic, const uint8_t *buf, uint32_t buf_size);
-
-#endif /* AVCODEC_VDPAU_INTERNAL_H */
diff --git a/deps/libav/libavcodec/vdpau_mpeg12.c b/deps/libav/libavcodec/vdpau_mpeg12.c
deleted file mode 100644
index 426d580..0000000
--- a/deps/libav/libavcodec/vdpau_mpeg12.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * MPEG-1/2 HW decode acceleration through VDPAU
- *
- * Copyright (c) 2008 NVIDIA
- * Copyright (c) 2013 Rémi Denis-Courmont
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <vdpau/vdpau.h>
-
-#include "avcodec.h"
-#include "vdpau.h"
-#include "vdpau_internal.h"
-
-static int vdpau_mpeg_start_frame(AVCodecContext *avctx,
-                                  const uint8_t *buffer, uint32_t size)
-{
-    MpegEncContext * const s = avctx->priv_data;
-    Picture *pic             = s->current_picture_ptr;
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    VdpPictureInfoMPEG1Or2 *info = &pic_ctx->info.mpeg;
-    VdpVideoSurface ref;
-    int i;
-
-    /* fill VdpPictureInfoMPEG1Or2 struct */
-    info->forward_reference  = VDP_INVALID_HANDLE;
-    info->backward_reference = VDP_INVALID_HANDLE;
-
-    switch (s->pict_type) {
-    case AV_PICTURE_TYPE_B:
-        ref = ff_vdpau_get_surface_id(&s->next_picture);
-        assert(ref != VDP_INVALID_HANDLE);
-        info->backward_reference = ref;
-        /* fall through to forward prediction */
-    case AV_PICTURE_TYPE_P:
-        ref = ff_vdpau_get_surface_id(&s->last_picture);
-        info->forward_reference  = ref;
-    }
-
-    info->slice_count                = 0;
-    info->picture_structure          = s->picture_structure;
-    info->picture_coding_type        = s->pict_type;
-    info->intra_dc_precision         = s->intra_dc_precision;
-    info->frame_pred_frame_dct       = s->frame_pred_frame_dct;
-    info->concealment_motion_vectors = s->concealment_motion_vectors;
-    info->intra_vlc_format           = s->intra_vlc_format;
-    info->alternate_scan             = s->alternate_scan;
-    info->q_scale_type               = s->q_scale_type;
-    info->top_field_first            = s->top_field_first;
-    // Both for MPEG-1 only, zero for MPEG-2:
-    info->full_pel_forward_vector    = s->full_pel[0];
-    info->full_pel_backward_vector   = s->full_pel[1];
-    // For MPEG-1 fill both horizontal & vertical:
-    info->f_code[0][0]               = s->mpeg_f_code[0][0];
-    info->f_code[0][1]               = s->mpeg_f_code[0][1];
-    info->f_code[1][0]               = s->mpeg_f_code[1][0];
-    info->f_code[1][1]               = s->mpeg_f_code[1][1];
-    for (i = 0; i < 64; ++i) {
-        info->intra_quantizer_matrix[i]     = s->intra_matrix[i];
-        info->non_intra_quantizer_matrix[i] = s->inter_matrix[i];
-    }
-
-    return ff_vdpau_common_start_frame(pic, buffer, size);
-}
-
-static int vdpau_mpeg_decode_slice(AVCodecContext *avctx,
-                                   const uint8_t *buffer, uint32_t size)
-{
-    MpegEncContext * const s = avctx->priv_data;
-    Picture *pic             = s->current_picture_ptr;
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    int val;
-
-    val = ff_vdpau_add_buffer(pic, buffer, size);
-    if (val < 0)
-        return val;
-
-    pic_ctx->info.mpeg.slice_count++;
-    return 0;
-}
-
-#if CONFIG_MPEG1_VDPAU_HWACCEL
-AVHWAccel ff_mpeg1_vdpau_hwaccel = {
-    .name           = "mpeg1_vdpau",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG1VIDEO,
-    .pix_fmt        = AV_PIX_FMT_VDPAU,
-    .start_frame    = vdpau_mpeg_start_frame,
-    .end_frame      = ff_vdpau_mpeg_end_frame,
-    .decode_slice   = vdpau_mpeg_decode_slice,
-    .priv_data_size = sizeof(struct vdpau_picture_context),
-};
-#endif
-
-#if CONFIG_MPEG2_VDPAU_HWACCEL
-AVHWAccel ff_mpeg2_vdpau_hwaccel = {
-    .name           = "mpeg2_vdpau",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG2VIDEO,
-    .pix_fmt        = AV_PIX_FMT_VDPAU,
-    .start_frame    = vdpau_mpeg_start_frame,
-    .end_frame      = ff_vdpau_mpeg_end_frame,
-    .decode_slice   = vdpau_mpeg_decode_slice,
-    .priv_data_size = sizeof(struct vdpau_picture_context),
-};
-#endif
diff --git a/deps/libav/libavcodec/vdpau_mpeg4.c b/deps/libav/libavcodec/vdpau_mpeg4.c
deleted file mode 100644
index 17205fe..0000000
--- a/deps/libav/libavcodec/vdpau_mpeg4.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * MPEG-4 Part 2 / H.263 decode acceleration through VDPAU
- *
- * Copyright (c) 2008 NVIDIA
- * Copyright (c) 2013 Rémi Denis-Courmont
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <vdpau/vdpau.h>
-
-#include "avcodec.h"
-#include "mpeg4video.h"
-#include "vdpau.h"
-#include "vdpau_internal.h"
-
-static int vdpau_mpeg4_start_frame(AVCodecContext *avctx,
-                                   const uint8_t *buffer, uint32_t size)
-{
-    Mpeg4DecContext *ctx = avctx->priv_data;
-    MpegEncContext * const s = &ctx->m;
-    Picture *pic             = s->current_picture_ptr;
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    VdpPictureInfoMPEG4Part2 *info = &pic_ctx->info.mpeg4;
-    VdpVideoSurface ref;
-    int i;
-
-    /* fill VdpPictureInfoMPEG4Part2 struct */
-    info->forward_reference  = VDP_INVALID_HANDLE;
-    info->backward_reference = VDP_INVALID_HANDLE;
-    info->vop_coding_type    = 0;
-
-    switch (s->pict_type) {
-    case AV_PICTURE_TYPE_B:
-        ref = ff_vdpau_get_surface_id(&s->next_picture);
-        assert(ref != VDP_INVALID_HANDLE);
-        info->backward_reference = ref;
-        info->vop_coding_type    = 2;
-        /* fall-through */
-    case AV_PICTURE_TYPE_P:
-        ref = ff_vdpau_get_surface_id(&s->last_picture);
-        assert(ref != VDP_INVALID_HANDLE);
-        info->forward_reference  = ref;
-    }
-
-    info->trd[0]                            = s->pp_time;
-    info->trb[0]                            = s->pb_time;
-    info->trd[1]                            = s->pp_field_time >> 1;
-    info->trb[1]                            = s->pb_field_time >> 1;
-    info->vop_time_increment_resolution     = s->avctx->time_base.den;
-    info->vop_fcode_forward                 = s->f_code;
-    info->vop_fcode_backward                = s->b_code;
-    info->resync_marker_disable             = !ctx->resync_marker;
-    info->interlaced                        = !s->progressive_sequence;
-    info->quant_type                        = s->mpeg_quant;
-    info->quarter_sample                    = s->quarter_sample;
-    info->short_video_header                = avctx->codec->id == AV_CODEC_ID_H263;
-    info->rounding_control                  = s->no_rounding;
-    info->alternate_vertical_scan_flag      = s->alternate_scan;
-    info->top_field_first                   = s->top_field_first;
-    for (i = 0; i < 64; ++i) {
-        info->intra_quantizer_matrix[i]     = s->intra_matrix[i];
-        info->non_intra_quantizer_matrix[i] = s->inter_matrix[i];
-    }
-
-    ff_vdpau_common_start_frame(pic, buffer, size);
-    return ff_vdpau_add_buffer(pic, buffer, size);
-}
-
-static int vdpau_mpeg4_decode_slice(av_unused AVCodecContext *avctx,
-                                    av_unused const uint8_t *buffer,
-                                    av_unused uint32_t size)
-{
-     return 0;
-}
-
-#if CONFIG_H263_VDPAU_HWACCEL
-AVHWAccel ff_h263_vdpau_hwaccel = {
-    .name           = "h263_vdpau",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H263,
-    .pix_fmt        = AV_PIX_FMT_VDPAU,
-    .start_frame    = vdpau_mpeg4_start_frame,
-    .end_frame      = ff_vdpau_mpeg_end_frame,
-    .decode_slice   = vdpau_mpeg4_decode_slice,
-    .priv_data_size = sizeof(struct vdpau_picture_context),
-};
-#endif
-
-#if CONFIG_MPEG4_VDPAU_HWACCEL
-AVHWAccel ff_mpeg4_vdpau_hwaccel = {
-    .name           = "mpeg4_vdpau",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_MPEG4,
-    .pix_fmt        = AV_PIX_FMT_VDPAU,
-    .start_frame    = vdpau_mpeg4_start_frame,
-    .end_frame      = ff_vdpau_mpeg_end_frame,
-    .decode_slice   = vdpau_mpeg4_decode_slice,
-    .priv_data_size = sizeof(struct vdpau_picture_context),
-};
-#endif
diff --git a/deps/libav/libavcodec/vdpau_vc1.c b/deps/libav/libavcodec/vdpau_vc1.c
deleted file mode 100644
index b401352..0000000
--- a/deps/libav/libavcodec/vdpau_vc1.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * VC-1 decode acceleration through VDPAU
- *
- * Copyright (c) 2008 NVIDIA
- * Copyright (c) 2013 Rémi Denis-Courmont
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <vdpau/vdpau.h>
-
-#include "avcodec.h"
-#include "vc1.h"
-#include "vdpau.h"
-#include "vdpau_internal.h"
-
-static int vdpau_vc1_start_frame(AVCodecContext *avctx,
-                                 const uint8_t *buffer, uint32_t size)
-{
-    VC1Context * const v  = avctx->priv_data;
-    MpegEncContext * const s = &v->s;
-    Picture *pic          = s->current_picture_ptr;
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    VdpPictureInfoVC1 *info = &pic_ctx->info.vc1;
-    VdpVideoSurface ref;
-
-    /*  fill LvPictureInfoVC1 struct */
-    info->forward_reference  = VDP_INVALID_HANDLE;
-    info->backward_reference = VDP_INVALID_HANDLE;
-
-    switch (s->pict_type) {
-    case AV_PICTURE_TYPE_B:
-        ref = ff_vdpau_get_surface_id(&s->next_picture);
-        assert(ref != VDP_INVALID_HANDLE);
-        info->backward_reference = ref;
-        /* fall-through */
-    case AV_PICTURE_TYPE_P:
-        ref = ff_vdpau_get_surface_id(&s->last_picture);
-        assert(ref != VDP_INVALID_HANDLE);
-        info->forward_reference  = ref;
-    }
-
-    info->slice_count       = 0;
-    if (v->bi_type)
-        info->picture_type  = 4;
-    else
-        info->picture_type  = s->pict_type - 1 + s->pict_type / 3;
-
-    info->frame_coding_mode = v->fcm ? (v->fcm + 1) : 0;
-    info->postprocflag      = v->postprocflag;
-    info->pulldown          = v->broadcast;
-    info->interlace         = v->interlace;
-    info->tfcntrflag        = v->tfcntrflag;
-    info->finterpflag       = v->finterpflag;
-    info->psf               = v->psf;
-    info->dquant            = v->dquant;
-    info->panscan_flag      = v->panscanflag;
-    info->refdist_flag      = v->refdist_flag;
-    info->quantizer         = v->quantizer_mode;
-    info->extended_mv       = v->extended_mv;
-    info->extended_dmv      = v->extended_dmv;
-    info->overlap           = v->overlap;
-    info->vstransform       = v->vstransform;
-    info->loopfilter        = v->s.loop_filter;
-    info->fastuvmc          = v->fastuvmc;
-    info->range_mapy_flag   = v->range_mapy_flag;
-    info->range_mapy        = v->range_mapy;
-    info->range_mapuv_flag  = v->range_mapuv_flag;
-    info->range_mapuv       = v->range_mapuv;
-    /* Specific to simple/main profile only */
-    info->multires          = v->multires;
-    info->syncmarker        = v->resync_marker;
-    info->rangered          = v->rangered | (v->rangeredfrm << 1);
-    info->maxbframes        = v->s.max_b_frames;
-    info->deblockEnable     = v->postprocflag & 1;
-    info->pquant            = v->pq;
-
-    return ff_vdpau_common_start_frame(pic, buffer, size);
-}
-
-static int vdpau_vc1_decode_slice(AVCodecContext *avctx,
-                                  const uint8_t *buffer, uint32_t size)
-{
-    VC1Context * const v  = avctx->priv_data;
-    MpegEncContext * const s = &v->s;
-    Picture *pic          = s->current_picture_ptr;
-    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
-    int val;
-
-    val = ff_vdpau_add_buffer(pic, buffer, size);
-    if (val < 0)
-        return val;
-
-    pic_ctx->info.vc1.slice_count++;
-    return 0;
-}
-
-#if CONFIG_WMV3_VDPAU_HWACCEL
-AVHWAccel ff_wmv3_vdpau_hwaccel = {
-    .name           = "wm3_vdpau",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WMV3,
-    .pix_fmt        = AV_PIX_FMT_VDPAU,
-    .start_frame    = vdpau_vc1_start_frame,
-    .end_frame      = ff_vdpau_mpeg_end_frame,
-    .decode_slice   = vdpau_vc1_decode_slice,
-    .priv_data_size = sizeof(struct vdpau_picture_context),
-};
-#endif
-
-AVHWAccel ff_vc1_vdpau_hwaccel = {
-    .name           = "vc1_vdpau",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VC1,
-    .pix_fmt        = AV_PIX_FMT_VDPAU,
-    .start_frame    = vdpau_vc1_start_frame,
-    .end_frame      = ff_vdpau_mpeg_end_frame,
-    .decode_slice   = vdpau_vc1_decode_slice,
-    .priv_data_size = sizeof(struct vdpau_picture_context),
-};
diff --git a/deps/libav/libavcodec/version.h b/deps/libav/libavcodec/version.h
deleted file mode 100644
index cdd5a61..0000000
--- a/deps/libav/libavcodec/version.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VERSION_H
-#define AVCODEC_VERSION_H
-
-/**
- * @file
- * @ingroup libavc
- * Libavcodec version macros.
- */
-
-#include "libavutil/version.h"
-
-#define LIBAVCODEC_VERSION_MAJOR 55
-#define LIBAVCODEC_VERSION_MINOR 34
-#define LIBAVCODEC_VERSION_MICRO  1
-
-#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-                                               LIBAVCODEC_VERSION_MINOR, \
-                                               LIBAVCODEC_VERSION_MICRO)
-#define LIBAVCODEC_VERSION      AV_VERSION(LIBAVCODEC_VERSION_MAJOR,    \
-                                           LIBAVCODEC_VERSION_MINOR,    \
-                                           LIBAVCODEC_VERSION_MICRO)
-#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
-
-#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
-
-/**
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- */
-
-#ifndef FF_API_REQUEST_CHANNELS
-#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_DEINTERLACE
-#define FF_API_DEINTERLACE       (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_DESTRUCT_PACKET
-#define FF_API_DESTRUCT_PACKET   (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_GET_BUFFER
-#define FF_API_GET_BUFFER        (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_MISSING_SAMPLE
-#define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_LOWRES
-#define FF_API_LOWRES            (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_CAP_VDPAU
-#define FF_API_CAP_VDPAU         (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_BUFS_VDPAU
-#define FF_API_BUFS_VDPAU        (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_VOXWARE
-#define FF_API_VOXWARE           (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_SET_DIMENSIONS
-#define FF_API_SET_DIMENSIONS    (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_DEBUG_MV
-#define FF_API_DEBUG_MV          (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_AC_VLC
-#define FF_API_AC_VLC            (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_OLD_MSMPEG4
-#define FF_API_OLD_MSMPEG4       (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_ASPECT_EXTENDED
-#define FF_API_ASPECT_EXTENDED   (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_THREAD_OPAQUE
-#define FF_API_THREAD_OPAQUE     (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_CODEC_PKT
-#define FF_API_CODEC_PKT         (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_ARCH_ALPHA
-#define FF_API_ARCH_ALPHA        (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_XVMC
-#define FF_API_XVMC              (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_ERROR_RATE
-#define FF_API_ERROR_RATE        (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_QSCALE_TYPE
-#define FF_API_QSCALE_TYPE       (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_MB_TYPE
-#define FF_API_MB_TYPE           (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_MAX_BFRAMES
-#define FF_API_MAX_BFRAMES       (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_FAST_MALLOC
-#define FF_API_FAST_MALLOC       (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_NEG_LINESIZES
-#define FF_API_NEG_LINESIZES     (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_EMU_EDGE
-#define FF_API_EMU_EDGE          (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-
-#endif /* AVCODEC_VERSION_H */
diff --git a/deps/libav/libavcodec/videodsp.c b/deps/libav/libavcodec/videodsp.c
deleted file mode 100644
index a6a1d37..0000000
--- a/deps/libav/libavcodec/videodsp.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2012 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "videodsp.h"
-
-#define BIT_DEPTH 8
-#include "videodsp_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 16
-#include "videodsp_template.c"
-#undef BIT_DEPTH
-
-static void just_return(uint8_t *buf, ptrdiff_t stride, int h)
-{
-}
-
-av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc)
-{
-    ctx->prefetch = just_return;
-    if (bpc <= 8) {
-        ctx->emulated_edge_mc = ff_emulated_edge_mc_8;
-    } else {
-        ctx->emulated_edge_mc = ff_emulated_edge_mc_16;
-    }
-
-    if (ARCH_ARM)
-        ff_videodsp_init_arm(ctx, bpc);
-    if (ARCH_PPC)
-        ff_videodsp_init_ppc(ctx, bpc);
-    if (ARCH_X86)
-        ff_videodsp_init_x86(ctx, bpc);
-}
diff --git a/deps/libav/libavcodec/videodsp.h b/deps/libav/libavcodec/videodsp.h
deleted file mode 100644
index 2211c5d..0000000
--- a/deps/libav/libavcodec/videodsp.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2012 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Core video DSP helper functions
- */
-
-#ifndef AVCODEC_VIDEODSP_H
-#define AVCODEC_VIDEODSP_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-typedef struct VideoDSPContext {
-    /**
-     * Copy a rectangular area of samples to a temporary buffer and replicate
-     * the border samples.
-     *
-     * @param buf destination buffer
-     * @param src source buffer
-     * @param buf_linesize number of bytes between 2 vertically adjacent
-     *                     samples in the destination buffer
-     * @param src_linesize number of bytes between 2 vertically adjacent
-     *                     samples in both the source buffer
-     * @param block_w width of block
-     * @param block_h height of block
-     * @param src_x x coordinate of the top left sample of the block in the
-     *                source buffer
-     * @param src_y y coordinate of the top left sample of the block in the
-     *                source buffer
-     * @param w width of the source buffer
-     * @param h height of the source buffer
-     */
-    void (*emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
-                             ptrdiff_t buf_linesize,
-                             ptrdiff_t src_linesize,
-                             int block_w, int block_h,
-                             int src_x, int src_y, int w, int h);
-
-    /**
-     * Prefetch memory into cache (if supported by hardware).
-     *
-     * @param buf    pointer to buffer to prefetch memory from
-     * @param stride distance between two lines of buf (in bytes)
-     * @param h      number of lines to prefetch
-     */
-    void (*prefetch)(uint8_t *buf, ptrdiff_t stride, int h);
-} VideoDSPContext;
-
-void ff_videodsp_init(VideoDSPContext *ctx, int bpc);
-
-/* for internal use only (i.e. called by ff_videodsp_init() */
-void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc);
-void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc);
-void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc);
-
-#endif /* AVCODEC_VIDEODSP_H */
diff --git a/deps/libav/libavcodec/videodsp_template.c b/deps/libav/libavcodec/videodsp_template.c
deleted file mode 100644
index 98313ac..0000000
--- a/deps/libav/libavcodec/videodsp_template.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2002-2004 Michael Niedermayer
- * Copyright (C) 2012 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "bit_depth_template.c"
-
-static void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
-                                      ptrdiff_t buf_linesize,
-                                      ptrdiff_t src_linesize,
-                                      int block_w, int block_h,
-                                      int src_x, int src_y, int w, int h)
-{
-    int x, y;
-    int start_y, start_x, end_y, end_x;
-
-    if (src_y >= h) {
-        src  += (h - 1 - src_y) * src_linesize;
-        src_y = h - 1;
-    } else if (src_y <= -block_h) {
-        src  += (1 - block_h - src_y) * src_linesize;
-        src_y = 1 - block_h;
-    }
-    if (src_x >= w) {
-        src  += (w - 1 - src_x) * sizeof(pixel);
-        src_x = w - 1;
-    } else if (src_x <= -block_w) {
-        src  += (1 - block_w - src_x) * sizeof(pixel);
-        src_x = 1 - block_w;
-    }
-
-    start_y = FFMAX(0, -src_y);
-    start_x = FFMAX(0, -src_x);
-    end_y = FFMIN(block_h, h-src_y);
-    end_x = FFMIN(block_w, w-src_x);
-    assert(start_y < end_y && block_h);
-    assert(start_x < end_x && block_w);
-
-    w    = end_x - start_x;
-    src += start_y * src_linesize + start_x * sizeof(pixel);
-    buf += start_x * sizeof(pixel);
-
-    // top
-    for (y = 0; y < start_y; y++) {
-        memcpy(buf, src, w * sizeof(pixel));
-        buf += buf_linesize;
-    }
-
-    // copy existing part
-    for (; y < end_y; y++) {
-        memcpy(buf, src, w * sizeof(pixel));
-        src += src_linesize;
-        buf += buf_linesize;
-    }
-
-    // bottom
-    src -= src_linesize;
-    for (; y < block_h; y++) {
-        memcpy(buf, src, w * sizeof(pixel));
-        buf += buf_linesize;
-    }
-
-    buf -= block_h * buf_linesize + start_x * sizeof(pixel);
-    while (block_h--) {
-        pixel *bufp = (pixel *) buf;
-
-        // left
-        for(x = 0; x < start_x; x++) {
-            bufp[x] = bufp[start_x];
-        }
-
-        // right
-        for (x = end_x; x < block_w; x++) {
-            bufp[x] = bufp[end_x - 1];
-        }
-        buf += buf_linesize;
-    }
-}
diff --git a/deps/libav/libavcodec/vmdav.c b/deps/libav/libavcodec/vmdav.c
deleted file mode 100644
index a1e39c0..0000000
--- a/deps/libav/libavcodec/vmdav.c
+++ /dev/null
@@ -1,681 +0,0 @@
-/*
- * Sierra VMD Audio & Video Decoders
- * Copyright (C) 2004 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sierra VMD audio & video decoders
- * by Vladimir "VAG" Gneushev (vagsoft at mail.ru)
- * for more information on the Sierra VMD format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *
- * The video decoder outputs PAL8 colorspace data. The decoder expects
- * a 0x330-byte VMD file header to be transmitted via extradata during
- * codec initialization. Each encoded frame that is sent to this decoder
- * is expected to be prepended with the appropriate 16-byte frame
- * information record from the VMD file.
- *
- * The audio decoder, like the video decoder, expects each encoded data
- * chunk to be prepended with the appropriate 16-byte frame information
- * record from the VMD file. It does not require the 0x330-byte VMD file
- * header, but it does need the audio setup parameters passed in through
- * normal libavcodec API means.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "bytestream.h"
-
-#define VMD_HEADER_SIZE 0x330
-#define PALETTE_COUNT 256
-
-/*
- * Video Decoder
- */
-
-typedef struct VmdVideoContext {
-
-    AVCodecContext *avctx;
-    AVFrame *prev_frame;
-
-    const unsigned char *buf;
-    int size;
-
-    unsigned char palette[PALETTE_COUNT * 4];
-    unsigned char *unpack_buffer;
-    int unpack_buffer_size;
-
-    int x_off, y_off;
-} VmdVideoContext;
-
-#define QUEUE_SIZE 0x1000
-#define QUEUE_MASK 0x0FFF
-
-static void lz_unpack(const unsigned char *src, int src_len,
-                      unsigned char *dest, int dest_len)
-{
-    unsigned char *d;
-    unsigned char *d_end;
-    unsigned char queue[QUEUE_SIZE];
-    unsigned int qpos;
-    unsigned int dataleft;
-    unsigned int chainofs;
-    unsigned int chainlen;
-    unsigned int speclen;
-    unsigned char tag;
-    unsigned int i, j;
-    GetByteContext gb;
-
-    bytestream2_init(&gb, src, src_len);
-    d = dest;
-    d_end = d + dest_len;
-    dataleft = bytestream2_get_le32(&gb);
-    memset(queue, 0x20, QUEUE_SIZE);
-    if (bytestream2_get_bytes_left(&gb) < 4)
-        return;
-    if (bytestream2_peek_le32(&gb) == 0x56781234) {
-        bytestream2_get_le32(&gb);
-        qpos = 0x111;
-        speclen = 0xF + 3;
-    } else {
-        qpos = 0xFEE;
-        speclen = 100;  /* no speclen */
-    }
-
-    while (dataleft > 0 && bytestream2_get_bytes_left(&gb) > 0) {
-        tag = bytestream2_get_byteu(&gb);
-        if ((tag == 0xFF) && (dataleft > 8)) {
-            if (d + 8 > d_end || bytestream2_get_bytes_left(&gb) < 8)
-                return;
-            for (i = 0; i < 8; i++) {
-                queue[qpos++] = *d++ = bytestream2_get_byteu(&gb);
-                qpos &= QUEUE_MASK;
-            }
-            dataleft -= 8;
-        } else {
-            for (i = 0; i < 8; i++) {
-                if (dataleft == 0)
-                    break;
-                if (tag & 0x01) {
-                    if (d + 1 > d_end || bytestream2_get_bytes_left(&gb) < 1)
-                        return;
-                    queue[qpos++] = *d++ = bytestream2_get_byte(&gb);
-                    qpos &= QUEUE_MASK;
-                    dataleft--;
-                } else {
-                    chainofs = bytestream2_get_byte(&gb);
-                    chainofs |= ((bytestream2_peek_byte(&gb) & 0xF0) << 4);
-                    chainlen = (bytestream2_get_byte(&gb) & 0x0F) + 3;
-                    if (chainlen == speclen) {
-                        chainlen = bytestream2_get_byte(&gb) + 0xF + 3;
-                    }
-                    if (d + chainlen > d_end)
-                        return;
-                    for (j = 0; j < chainlen; j++) {
-                        *d = queue[chainofs++ & QUEUE_MASK];
-                        queue[qpos++] = *d++;
-                        qpos &= QUEUE_MASK;
-                    }
-                    dataleft -= chainlen;
-                }
-                tag >>= 1;
-            }
-        }
-    }
-}
-
-static int rle_unpack(const unsigned char *src, unsigned char *dest,
-    int src_count, int src_size, int dest_len)
-{
-    unsigned char *pd;
-    int i, l, used = 0;
-    unsigned char *dest_end = dest + dest_len;
-    GetByteContext gb;
-    uint16_t run_val;
-
-    bytestream2_init(&gb, src, src_size);
-    pd = dest;
-    if (src_count & 1) {
-        if (bytestream2_get_bytes_left(&gb) < 1)
-            return 0;
-        *pd++ = bytestream2_get_byteu(&gb);
-        used++;
-    }
-
-    do {
-        if (bytestream2_get_bytes_left(&gb) < 1)
-            break;
-        l = bytestream2_get_byteu(&gb);
-        if (l & 0x80) {
-            l = (l & 0x7F) * 2;
-            if (pd + l > dest_end || bytestream2_get_bytes_left(&gb) < l)
-                return bytestream2_tell(&gb);
-            bytestream2_get_buffer(&gb, pd, l);
-            pd += l;
-        } else {
-            if (pd + l > dest_end || bytestream2_get_bytes_left(&gb) < 2)
-                return bytestream2_tell(&gb);
-            run_val = bytestream2_get_ne16(&gb);
-            for (i = 0; i < l; i++) {
-                AV_WN16(pd, run_val);
-                pd += 2;
-            }
-            l *= 2;
-        }
-        used += l;
-    } while (used < src_count);
-
-    return bytestream2_tell(&gb);
-}
-
-static int vmd_decode(VmdVideoContext *s, AVFrame *frame)
-{
-    int i;
-    unsigned int *palette32;
-    unsigned char r, g, b;
-
-    GetByteContext gb;
-
-    unsigned char meth;
-    unsigned char *dp;   /* pointer to current frame */
-    unsigned char *pp;   /* pointer to previous frame */
-    unsigned char len;
-    int ofs;
-
-    int frame_x, frame_y;
-    int frame_width, frame_height;
-
-    frame_x = AV_RL16(&s->buf[6]);
-    frame_y = AV_RL16(&s->buf[8]);
-    frame_width = AV_RL16(&s->buf[10]) - frame_x + 1;
-    frame_height = AV_RL16(&s->buf[12]) - frame_y + 1;
-    if (frame_x < 0 || frame_width < 0 ||
-        frame_x >= s->avctx->width ||
-        frame_width > s->avctx->width ||
-        frame_x + frame_width > s->avctx->width) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Invalid horizontal range %d-%d\n",
-               frame_x, frame_width);
-        return AVERROR_INVALIDDATA;
-    }
-    if (frame_y < 0 || frame_height < 0 ||
-        frame_y >= s->avctx->height ||
-        frame_height > s->avctx->height ||
-        frame_y + frame_height > s->avctx->height) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Invalid vertical range %d-%d\n",
-               frame_x, frame_width);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((frame_width == s->avctx->width && frame_height == s->avctx->height) &&
-        (frame_x || frame_y)) {
-
-        s->x_off = frame_x;
-        s->y_off = frame_y;
-    }
-    frame_x -= s->x_off;
-    frame_y -= s->y_off;
-
-    /* if only a certain region will be updated, copy the entire previous
-     * frame before the decode */
-    if (s->prev_frame->data[0] &&
-        (frame_x || frame_y || (frame_width != s->avctx->width) ||
-        (frame_height != s->avctx->height))) {
-
-        memcpy(frame->data[0], s->prev_frame->data[0],
-            s->avctx->height * frame->linesize[0]);
-    }
-
-    /* check if there is a new palette */
-    bytestream2_init(&gb, s->buf + 16, s->size - 16);
-    if (s->buf[15] & 0x02) {
-        bytestream2_skip(&gb, 2);
-        palette32 = (unsigned int *)s->palette;
-        if (bytestream2_get_bytes_left(&gb) >= PALETTE_COUNT * 3) {
-            for (i = 0; i < PALETTE_COUNT; i++) {
-                r = bytestream2_get_byteu(&gb) * 4;
-                g = bytestream2_get_byteu(&gb) * 4;
-                b = bytestream2_get_byteu(&gb) * 4;
-                palette32[i] = (r << 16) | (g << 8) | (b);
-            }
-        } else {
-            av_log(s->avctx, AV_LOG_ERROR, "Incomplete palette\n");
-            return AVERROR_INVALIDDATA;
-        }
-        s->size -= PALETTE_COUNT * 3 + 2;
-    }
-
-    if (!s->size)
-        return 0;
-
-    /* originally UnpackFrame in VAG's code */
-    if (bytestream2_get_bytes_left(&gb) < 1)
-        return AVERROR_INVALIDDATA;
-    meth = bytestream2_get_byteu(&gb);
-    if (meth & 0x80) {
-        if (!s->unpack_buffer_size) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Trying to unpack LZ-compressed frame with no LZ buffer\n");
-            return AVERROR_INVALIDDATA;
-        }
-        lz_unpack(gb.buffer, bytestream2_get_bytes_left(&gb),
-                  s->unpack_buffer, s->unpack_buffer_size);
-        meth &= 0x7F;
-        bytestream2_init(&gb, s->unpack_buffer, s->unpack_buffer_size);
-    }
-
-    dp = &frame->data[0][frame_y * frame->linesize[0] + frame_x];
-    pp = &s->prev_frame->data[0][frame_y * s->prev_frame->linesize[0] + frame_x];
-    switch (meth) {
-    case 1:
-        for (i = 0; i < frame_height; i++) {
-            ofs = 0;
-            do {
-                len = bytestream2_get_byte(&gb);
-                if (len & 0x80) {
-                    len = (len & 0x7F) + 1;
-                    if (ofs + len > frame_width ||
-                        bytestream2_get_bytes_left(&gb) < len)
-                        return AVERROR_INVALIDDATA;
-                    bytestream2_get_buffer(&gb, &dp[ofs], len);
-                    ofs += len;
-                } else {
-                    /* interframe pixel copy */
-                    if (ofs + len + 1 > frame_width || !s->prev_frame->data[0])
-                        return AVERROR_INVALIDDATA;
-                    memcpy(&dp[ofs], &pp[ofs], len + 1);
-                    ofs += len + 1;
-                }
-            } while (ofs < frame_width);
-            if (ofs > frame_width) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "VMD video: offset > width (%d > %d)\n",
-                       ofs, frame_width);
-                return AVERROR_INVALIDDATA;
-            }
-            dp += frame->linesize[0];
-            pp += s->prev_frame->linesize[0];
-        }
-        break;
-
-    case 2:
-        for (i = 0; i < frame_height; i++) {
-            bytestream2_get_buffer(&gb, dp, frame_width);
-            dp += frame->linesize[0];
-            pp += s->prev_frame->linesize[0];
-        }
-        break;
-
-    case 3:
-        for (i = 0; i < frame_height; i++) {
-            ofs = 0;
-            do {
-                len = bytestream2_get_byte(&gb);
-                if (len & 0x80) {
-                    len = (len & 0x7F) + 1;
-                    if (bytestream2_peek_byte(&gb) == 0xFF) {
-                        int slen = len;
-                        bytestream2_get_byte(&gb);
-                        len = rle_unpack(gb.buffer, &dp[ofs],
-                                         len, bytestream2_get_bytes_left(&gb),
-                                         frame_width - ofs);
-                        ofs += slen;
-                        bytestream2_skip(&gb, len);
-                    } else {
-                        bytestream2_get_buffer(&gb, &dp[ofs], len);
-                        ofs += len;
-                    }
-                } else {
-                    /* interframe pixel copy */
-                    if (ofs + len + 1 > frame_width || !s->prev_frame->data[0])
-                        return AVERROR_INVALIDDATA;
-                    memcpy(&dp[ofs], &pp[ofs], len + 1);
-                    ofs += len + 1;
-                }
-            } while (ofs < frame_width);
-            if (ofs > frame_width) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "VMD video: offset > width (%d > %d)\n",
-                       ofs, frame_width);
-                return AVERROR_INVALIDDATA;
-            }
-            dp += frame->linesize[0];
-            pp += s->prev_frame->linesize[0];
-        }
-        break;
-    }
-    return 0;
-}
-
-static av_cold int vmdvideo_decode_end(AVCodecContext *avctx)
-{
-    VmdVideoContext *s = avctx->priv_data;
-
-    av_frame_free(&s->prev_frame);
-    av_free(s->unpack_buffer);
-
-    return 0;
-}
-
-static av_cold int vmdvideo_decode_init(AVCodecContext *avctx)
-{
-    VmdVideoContext *s = avctx->priv_data;
-    int i;
-    unsigned int *palette32;
-    int palette_index = 0;
-    unsigned char r, g, b;
-    unsigned char *vmd_header;
-    unsigned char *raw_palette;
-
-    s->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    /* make sure the VMD header made it */
-    if (s->avctx->extradata_size != VMD_HEADER_SIZE) {
-        av_log(s->avctx, AV_LOG_ERROR, "VMD video: expected extradata size of %d\n",
-            VMD_HEADER_SIZE);
-        return -1;
-    }
-    vmd_header = (unsigned char *)avctx->extradata;
-
-    s->unpack_buffer_size = AV_RL32(&vmd_header[800]);
-    if (s->unpack_buffer_size) {
-        s->unpack_buffer = av_malloc(s->unpack_buffer_size);
-        if (!s->unpack_buffer)
-            return AVERROR(ENOMEM);
-    }
-
-    /* load up the initial palette */
-    raw_palette = &vmd_header[28];
-    palette32 = (unsigned int *)s->palette;
-    for (i = 0; i < PALETTE_COUNT; i++) {
-        r = raw_palette[palette_index++] * 4;
-        g = raw_palette[palette_index++] * 4;
-        b = raw_palette[palette_index++] * 4;
-        palette32[i] = (r << 16) | (g << 8) | (b);
-    }
-
-    s->prev_frame = av_frame_alloc();
-    if (!s->prev_frame) {
-        vmdvideo_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static int vmdvideo_decode_frame(AVCodecContext *avctx,
-                                 void *data, int *got_frame,
-                                 AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    VmdVideoContext *s = avctx->priv_data;
-    AVFrame *frame = data;
-    int ret;
-
-    s->buf = buf;
-    s->size = buf_size;
-
-    if (buf_size < 16)
-        return AVERROR_INVALIDDATA;
-
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "VMD Video: get_buffer() failed\n");
-        return ret;
-    }
-
-    if ((ret = vmd_decode(s, frame)) < 0)
-        return ret;
-
-    /* make the palette available on the way out */
-    memcpy(frame->data[1], s->palette, PALETTE_COUNT * 4);
-
-    /* shuffle frames */
-    av_frame_unref(s->prev_frame);
-    if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
-        return ret;
-
-    *got_frame      = 1;
-
-    /* report that the buffer was completely consumed */
-    return buf_size;
-}
-
-
-/*
- * Audio Decoder
- */
-
-#define BLOCK_TYPE_AUDIO    1
-#define BLOCK_TYPE_INITIAL  2
-#define BLOCK_TYPE_SILENCE  3
-
-typedef struct VmdAudioContext {
-    int out_bps;
-    int chunk_size;
-} VmdAudioContext;
-
-static const uint16_t vmdaudio_table[128] = {
-    0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080,
-    0x090, 0x0A0, 0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120,
-    0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0,
-    0x1D0, 0x1E0, 0x1F0, 0x200, 0x208, 0x210, 0x218, 0x220, 0x228, 0x230,
-    0x238, 0x240, 0x248, 0x250, 0x258, 0x260, 0x268, 0x270, 0x278, 0x280,
-    0x288, 0x290, 0x298, 0x2A0, 0x2A8, 0x2B0, 0x2B8, 0x2C0, 0x2C8, 0x2D0,
-    0x2D8, 0x2E0, 0x2E8, 0x2F0, 0x2F8, 0x300, 0x308, 0x310, 0x318, 0x320,
-    0x328, 0x330, 0x338, 0x340, 0x348, 0x350, 0x358, 0x360, 0x368, 0x370,
-    0x378, 0x380, 0x388, 0x390, 0x398, 0x3A0, 0x3A8, 0x3B0, 0x3B8, 0x3C0,
-    0x3C8, 0x3D0, 0x3D8, 0x3E0, 0x3E8, 0x3F0, 0x3F8, 0x400, 0x440, 0x480,
-    0x4C0, 0x500, 0x540, 0x580, 0x5C0, 0x600, 0x640, 0x680, 0x6C0, 0x700,
-    0x740, 0x780, 0x7C0, 0x800, 0x900, 0xA00, 0xB00, 0xC00, 0xD00, 0xE00,
-    0xF00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x3000, 0x4000
-};
-
-static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
-{
-    VmdAudioContext *s = avctx->priv_data;
-
-    if (avctx->channels < 1 || avctx->channels > 2) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n");
-        return AVERROR(EINVAL);
-    }
-    if (avctx->block_align < 1) {
-        av_log(avctx, AV_LOG_ERROR, "invalid block align\n");
-        return AVERROR(EINVAL);
-    }
-
-    avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO :
-                                                   AV_CH_LAYOUT_STEREO;
-
-    if (avctx->bits_per_coded_sample == 16)
-        avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-    else
-        avctx->sample_fmt = AV_SAMPLE_FMT_U8;
-    s->out_bps = av_get_bytes_per_sample(avctx->sample_fmt);
-
-    s->chunk_size = avctx->block_align + avctx->channels * (s->out_bps == 2);
-
-    av_log(avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, "
-           "block align = %d, sample rate = %d\n",
-           avctx->channels, avctx->bits_per_coded_sample, avctx->block_align,
-           avctx->sample_rate);
-
-    return 0;
-}
-
-static void decode_audio_s16(int16_t *out, const uint8_t *buf, int buf_size,
-                             int channels)
-{
-    int ch;
-    const uint8_t *buf_end = buf + buf_size;
-    int predictor[2];
-    int st = channels - 1;
-
-    /* decode initial raw sample */
-    for (ch = 0; ch < channels; ch++) {
-        predictor[ch] = (int16_t)AV_RL16(buf);
-        buf += 2;
-        *out++ = predictor[ch];
-    }
-
-    /* decode DPCM samples */
-    ch = 0;
-    while (buf < buf_end) {
-        uint8_t b = *buf++;
-        if (b & 0x80)
-            predictor[ch] -= vmdaudio_table[b & 0x7F];
-        else
-            predictor[ch] += vmdaudio_table[b];
-        predictor[ch] = av_clip_int16(predictor[ch]);
-        *out++ = predictor[ch];
-        ch ^= st;
-    }
-}
-
-static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data,
-                                 int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    const uint8_t *buf_end;
-    int buf_size = avpkt->size;
-    VmdAudioContext *s = avctx->priv_data;
-    int block_type, silent_chunks, audio_chunks;
-    int ret;
-    uint8_t *output_samples_u8;
-    int16_t *output_samples_s16;
-
-    if (buf_size < 16) {
-        av_log(avctx, AV_LOG_WARNING, "skipping small junk packet\n");
-        *got_frame_ptr = 0;
-        return buf_size;
-    }
-
-    block_type = buf[6];
-    if (block_type < BLOCK_TYPE_AUDIO || block_type > BLOCK_TYPE_SILENCE) {
-        av_log(avctx, AV_LOG_ERROR, "unknown block type: %d\n", block_type);
-        return AVERROR(EINVAL);
-    }
-    buf      += 16;
-    buf_size -= 16;
-
-    /* get number of silent chunks */
-    silent_chunks = 0;
-    if (block_type == BLOCK_TYPE_INITIAL) {
-        uint32_t flags;
-        if (buf_size < 4) {
-            av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
-            return AVERROR(EINVAL);
-        }
-        flags         = AV_RB32(buf);
-        silent_chunks = av_popcount(flags);
-        buf      += 4;
-        buf_size -= 4;
-    } else if (block_type == BLOCK_TYPE_SILENCE) {
-        silent_chunks = 1;
-        buf_size = 0; // should already be zero but set it just to be sure
-    }
-
-    /* ensure output buffer is large enough */
-    audio_chunks = buf_size / s->chunk_size;
-
-    /* drop incomplete chunks */
-    buf_size     = audio_chunks * s->chunk_size;
-
-    /* get output buffer */
-    frame->nb_samples = ((silent_chunks + audio_chunks) * avctx->block_align) /
-                        avctx->channels;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    output_samples_u8  =            frame->data[0];
-    output_samples_s16 = (int16_t *)frame->data[0];
-
-    /* decode silent chunks */
-    if (silent_chunks > 0) {
-        int silent_size = FFMIN(avctx->block_align * silent_chunks,
-                                frame->nb_samples * avctx->channels);
-        if (s->out_bps == 2) {
-            memset(output_samples_s16, 0x00, silent_size * 2);
-            output_samples_s16 += silent_size;
-        } else {
-            memset(output_samples_u8,  0x80, silent_size);
-            output_samples_u8 += silent_size;
-        }
-    }
-
-    /* decode audio chunks */
-    if (audio_chunks > 0) {
-        buf_end = buf + (buf_size & ~(avctx->channels > 1));
-        while (buf + s->chunk_size <= buf_end) {
-            if (s->out_bps == 2) {
-                decode_audio_s16(output_samples_s16, buf, s->chunk_size,
-                                 avctx->channels);
-                output_samples_s16 += avctx->block_align;
-            } else {
-                memcpy(output_samples_u8, buf, s->chunk_size);
-                output_samples_u8  += avctx->block_align;
-            }
-            buf += s->chunk_size;
-        }
-    }
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-
-/*
- * Public Data Structures
- */
-
-AVCodec ff_vmdvideo_decoder = {
-    .name           = "vmdvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sierra VMD video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VMDVIDEO,
-    .priv_data_size = sizeof(VmdVideoContext),
-    .init           = vmdvideo_decode_init,
-    .close          = vmdvideo_decode_end,
-    .decode         = vmdvideo_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-AVCodec ff_vmdaudio_decoder = {
-    .name           = "vmdaudio",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sierra VMD audio"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_VMDAUDIO,
-    .priv_data_size = sizeof(VmdAudioContext),
-    .init           = vmdaudio_decode_init,
-    .decode         = vmdaudio_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/vmnc.c b/deps/libav/libavcodec/vmnc.c
deleted file mode 100644
index 16984fb..0000000
--- a/deps/libav/libavcodec/vmnc.c
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- * VMware Screen Codec (VMnc) decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VMware Screen Codec (VMnc) decoder
- * As Alex Beregszaszi discovered, this is effectively RFB data dump
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "bytestream.h"
-
-enum EncTypes {
-    MAGIC_WMVd = 0x574D5664,
-    MAGIC_WMVe,
-    MAGIC_WMVf,
-    MAGIC_WMVg,
-    MAGIC_WMVh,
-    MAGIC_WMVi,
-    MAGIC_WMVj
-};
-
-enum HexTile_Flags {
-    HT_RAW =  1, // tile is raw
-    HT_BKG =  2, // background color is present
-    HT_FG  =  4, // foreground color is present
-    HT_SUB =  8, // subrects are present
-    HT_CLR = 16  // each subrect has own color
-};
-
-/*
- * Decoder context
- */
-typedef struct VmncContext {
-    AVCodecContext *avctx;
-    AVFrame *pic;
-
-    int bpp;
-    int bpp2;
-    int bigendian;
-    uint8_t pal[768];
-    int width, height;
-    GetByteContext gb;
-
-    /* cursor data */
-    int cur_w, cur_h;
-    int cur_x, cur_y;
-    int cur_hx, cur_hy;
-    uint8_t *curbits, *curmask;
-    uint8_t *screendta;
-} VmncContext;
-
-/* read pixel value from stream */
-static av_always_inline int vmnc_get_pixel(GetByteContext *gb, int bpp, int be)
-{
-    switch (bpp * 2 + be) {
-    case 2:
-    case 3:
-        return bytestream2_get_byte(gb);
-    case 4:
-        return bytestream2_get_le16(gb);
-    case 5:
-        return bytestream2_get_be16(gb);
-    case 8:
-        return bytestream2_get_le32(gb);
-    case 9:
-        return bytestream2_get_be32(gb);
-    default: return 0;
-    }
-}
-
-static void load_cursor(VmncContext *c)
-{
-    int i, j, p;
-    const int bpp   = c->bpp2;
-    uint8_t *dst8   =             c->curbits;
-    uint16_t *dst16 = (uint16_t *)c->curbits;
-    uint32_t *dst32 = (uint32_t *)c->curbits;
-
-    for (j = 0; j < c->cur_h; j++) {
-        for (i = 0; i < c->cur_w; i++) {
-            p = vmnc_get_pixel(&c->gb, bpp, c->bigendian);
-            if (bpp == 1)
-                *dst8++ = p;
-            if (bpp == 2)
-                *dst16++ = p;
-            if (bpp == 4)
-                *dst32++ = p;
-        }
-    }
-    dst8  =            c->curmask;
-    dst16 = (uint16_t*)c->curmask;
-    dst32 = (uint32_t*)c->curmask;
-    for (j = 0; j < c->cur_h; j++) {
-        for (i = 0; i < c->cur_w; i++) {
-            p = vmnc_get_pixel(&c->gb, bpp, c->bigendian);
-            if (bpp == 1)
-                *dst8++ = p;
-            if (bpp == 2)
-                *dst16++ = p;
-            if (bpp == 4)
-                *dst32++ = p;
-        }
-    }
-}
-
-static void put_cursor(uint8_t *dst, int stride, VmncContext *c, int dx, int dy)
-{
-    int i, j;
-    int w, h, x, y;
-    w = c->cur_w;
-    if (c->width < c->cur_x + c->cur_w)
-        w = c->width - c->cur_x;
-    h = c->cur_h;
-    if (c->height < c->cur_y + c->cur_h)
-        h = c->height - c->cur_y;
-    x = c->cur_x;
-    y = c->cur_y;
-    if (x < 0) {
-        w += x;
-        x  = 0;
-    }
-    if (y < 0) {
-        h += y;
-        y  = 0;
-    }
-
-    if ((w < 1) || (h < 1))
-        return;
-    dst += x * c->bpp2 + y * stride;
-
-    if (c->bpp2 == 1) {
-        uint8_t *cd = c->curbits, *msk = c->curmask;
-        for (j = 0; j < h; j++) {
-            for (i = 0; i < w; i++)
-                dst[i] = (dst[i] & cd[i]) ^ msk[i];
-            msk += c->cur_w;
-            cd  += c->cur_w;
-            dst += stride;
-        }
-    } else if (c->bpp2 == 2) {
-        uint16_t *cd = (uint16_t*)c->curbits, *msk = (uint16_t*)c->curmask;
-        uint16_t *dst2;
-        for (j = 0; j < h; j++) {
-            dst2 = (uint16_t*)dst;
-            for (i = 0; i < w; i++)
-                dst2[i] = (dst2[i] & cd[i]) ^ msk[i];
-            msk += c->cur_w;
-            cd  += c->cur_w;
-            dst += stride;
-        }
-    } else if (c->bpp2 == 4) {
-        uint32_t *cd = (uint32_t*)c->curbits, *msk = (uint32_t*)c->curmask;
-        uint32_t *dst2;
-        for (j = 0; j < h; j++) {
-            dst2 = (uint32_t*)dst;
-            for (i = 0; i < w; i++)
-                dst2[i] = (dst2[i] & cd[i]) ^ msk[i];
-            msk += c->cur_w;
-            cd  += c->cur_w;
-            dst += stride;
-        }
-    }
-}
-
-/* fill rectangle with given color */
-static av_always_inline void paint_rect(uint8_t *dst, int dx, int dy,
-                                        int w, int h, int color,
-                                        int bpp, int stride)
-{
-    int i, j;
-    dst += dx * bpp + dy * stride;
-    if (bpp == 1) {
-        for (j = 0; j < h; j++) {
-            memset(dst, color, w);
-            dst += stride;
-        }
-    } else if (bpp == 2) {
-        uint16_t *dst2;
-        for (j = 0; j < h; j++) {
-            dst2 = (uint16_t*)dst;
-            for (i = 0; i < w; i++)
-                *dst2++ = color;
-            dst += stride;
-        }
-    } else if (bpp == 4) {
-        uint32_t *dst2;
-        for (j = 0; j < h; j++) {
-            dst2 = (uint32_t*)dst;
-            for (i = 0; i < w; i++)
-                dst2[i] = color;
-            dst += stride;
-        }
-    }
-}
-
-static av_always_inline void paint_raw(uint8_t *dst, int w, int h,
-                                       GetByteContext *gb, int bpp,
-                                       int be, int stride)
-{
-    int i, j, p;
-    for (j = 0; j < h; j++) {
-        for (i = 0; i < w; i++) {
-            p = vmnc_get_pixel(gb, bpp, be);
-            switch (bpp) {
-            case 1:
-                dst[i] = p;
-                break;
-            case 2:
-                ((uint16_t*)dst)[i] = p;
-                break;
-            case 4:
-                ((uint32_t*)dst)[i] = p;
-                break;
-            }
-        }
-        dst += stride;
-    }
-}
-
-static int decode_hextile(VmncContext *c, uint8_t* dst, GetByteContext *gb,
-                          int w, int h, int stride)
-{
-    int i, j, k;
-    int bg = 0, fg = 0, rects, color, flags, xy, wh;
-    const int bpp = c->bpp2;
-    uint8_t *dst2;
-    int bw = 16, bh = 16;
-
-    for (j = 0; j < h; j += 16) {
-        dst2 = dst;
-        bw   = 16;
-        if (j + 16 > h)
-            bh = h - j;
-        for (i = 0; i < w; i += 16, dst2 += 16 * bpp) {
-            if (bytestream2_get_bytes_left(gb) <= 0) {
-                av_log(c->avctx, AV_LOG_ERROR, "Premature end of data!\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (i + 16 > w)
-                bw = w - i;
-            flags = bytestream2_get_byte(gb);
-            if (flags & HT_RAW) {
-                if (bytestream2_get_bytes_left(gb) < bw * bh * bpp) {
-                    av_log(c->avctx, AV_LOG_ERROR, "Premature end of data!\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                paint_raw(dst2, bw, bh, gb, bpp, c->bigendian, stride);
-            } else {
-                if (flags & HT_BKG)
-                    bg = vmnc_get_pixel(gb, bpp, c->bigendian);
-                if (flags & HT_FG)
-                    fg = vmnc_get_pixel(gb, bpp, c->bigendian);
-                rects = 0;
-                if (flags & HT_SUB)
-                    rects = bytestream2_get_byte(gb);
-                color = !!(flags & HT_CLR);
-
-                paint_rect(dst2, 0, 0, bw, bh, bg, bpp, stride);
-
-                if (bytestream2_get_bytes_left(gb) < rects * (color * bpp + 2)) {
-                    av_log(c->avctx, AV_LOG_ERROR, "Premature end of data!\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                for (k = 0; k < rects; k++) {
-                    if (color)
-                        fg = vmnc_get_pixel(gb, bpp, c->bigendian);
-                    xy = bytestream2_get_byte(gb);
-                    wh = bytestream2_get_byte(gb);
-                    paint_rect(dst2, xy >> 4, xy & 0xF,
-                               (wh>>4)+1, (wh & 0xF)+1, fg, bpp, stride);
-                }
-            }
-        }
-        dst += stride * 16;
-    }
-    return 0;
-}
-
-static void reset_buffers(VmncContext *c)
-{
-    av_freep(&c->curbits);
-    av_freep(&c->curmask);
-    av_freep(&c->screendta);
-    c->cur_w = c->cur_h = 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    VmncContext * const c = avctx->priv_data;
-    GetByteContext *gb = &c->gb;
-    uint8_t *outptr;
-    int dx, dy, w, h, depth, enc, chunks, res, size_left, ret;
-
-    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    bytestream2_init(gb, buf, buf_size);
-
-    c->pic->key_frame = 0;
-    c->pic->pict_type = AV_PICTURE_TYPE_P;
-
-    // restore screen after cursor
-    if (c->screendta) {
-        int i;
-        w = c->cur_w;
-        if (c->width < c->cur_x + w)
-            w = c->width - c->cur_x;
-        h = c->cur_h;
-        if (c->height < c->cur_y + h)
-            h = c->height - c->cur_y;
-        dx = c->cur_x;
-        if (dx < 0) {
-            w += dx;
-            dx = 0;
-        }
-        dy = c->cur_y;
-        if (dy < 0) {
-            h += dy;
-            dy = 0;
-        }
-        if ((w > 0) && (h > 0)) {
-            outptr = c->pic->data[0] + dx * c->bpp2 + dy * c->pic->linesize[0];
-            for (i = 0; i < h; i++) {
-                memcpy(outptr, c->screendta + i * c->cur_w * c->bpp2,
-                       w * c->bpp2);
-                outptr += c->pic->linesize[0];
-            }
-        }
-    }
-    bytestream2_skip(gb, 2);
-    chunks = bytestream2_get_be16(gb);
-    while (chunks--) {
-        dx  = bytestream2_get_be16(gb);
-        dy  = bytestream2_get_be16(gb);
-        w   = bytestream2_get_be16(gb);
-        h   = bytestream2_get_be16(gb);
-        enc = bytestream2_get_be32(gb);
-        outptr = c->pic->data[0] + dx * c->bpp2 + dy * c->pic->linesize[0];
-        size_left = bytestream2_get_bytes_left(gb);
-        switch (enc) {
-        case MAGIC_WMVd: // cursor
-            if (size_left < 2 + w * h * c->bpp2 * 2) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Premature end of data! (need %i got %i)\n",
-                       2 + w * h * c->bpp2 * 2, size_left);
-                return AVERROR_INVALIDDATA;
-            }
-            bytestream2_skip(gb, 2);
-            c->cur_w  = w;
-            c->cur_h  = h;
-            c->cur_hx = dx;
-            c->cur_hy = dy;
-            if ((c->cur_hx > c->cur_w) || (c->cur_hy > c->cur_h)) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Cursor hot spot is not in image: "
-                       "%ix%i of %ix%i cursor size\n",
-                       c->cur_hx, c->cur_hy, c->cur_w, c->cur_h);
-                c->cur_hx = c->cur_hy = 0;
-            }
-            if (c->cur_w * c->cur_h >= INT_MAX / c->bpp2) {
-                reset_buffers(c);
-                return AVERROR(EINVAL);
-            } else {
-                int screen_size = c->cur_w * c->cur_h * c->bpp2;
-                if ((ret = av_reallocp(&c->curbits, screen_size)) < 0 ||
-                    (ret = av_reallocp(&c->curmask, screen_size)) < 0 ||
-                    (ret = av_reallocp(&c->screendta, screen_size)) < 0) {
-                    reset_buffers(c);
-                    return ret;
-                }
-            }
-            load_cursor(c);
-            break;
-        case MAGIC_WMVe: // unknown
-            bytestream2_skip(gb, 2);
-            break;
-        case MAGIC_WMVf: // update cursor position
-            c->cur_x = dx - c->cur_hx;
-            c->cur_y = dy - c->cur_hy;
-            break;
-        case MAGIC_WMVg: // unknown
-            bytestream2_skip(gb, 10);
-            break;
-        case MAGIC_WMVh: // unknown
-            bytestream2_skip(gb, 4);
-            break;
-        case MAGIC_WMVi: // ServerInitialization struct
-            c->pic->key_frame = 1;
-            c->pic->pict_type = AV_PICTURE_TYPE_I;
-            depth = bytestream2_get_byte(gb);
-            if (depth != c->bpp) {
-                av_log(avctx, AV_LOG_INFO,
-                       "Depth mismatch. Container %i bpp, "
-                       "Frame data: %i bpp\n",
-                       c->bpp, depth);
-            }
-            bytestream2_skip(gb, 1);
-            c->bigendian = bytestream2_get_byte(gb);
-            if (c->bigendian & (~1)) {
-                av_log(avctx, AV_LOG_INFO,
-                       "Invalid header: bigendian flag = %i\n", c->bigendian);
-                return AVERROR_INVALIDDATA;
-            }
-            //skip the rest of pixel format data
-            bytestream2_skip(gb, 13);
-            break;
-        case MAGIC_WMVj: // unknown
-            bytestream2_skip(gb, 2);
-            break;
-        case 0x00000000: // raw rectangle data
-            if ((dx + w > c->width) || (dy + h > c->height)) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Incorrect frame size: %ix%i+%ix%i of %ix%i\n",
-                       w, h, dx, dy, c->width, c->height);
-                return AVERROR_INVALIDDATA;
-            }
-            if (size_left < w * h * c->bpp2) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Premature end of data! (need %i got %i)\n",
-                       w * h * c->bpp2, size_left);
-                return AVERROR_INVALIDDATA;
-            }
-            paint_raw(outptr, w, h, gb, c->bpp2, c->bigendian,
-                      c->pic->linesize[0]);
-            break;
-        case 0x00000005: // HexTile encoded rectangle
-            if ((dx + w > c->width) || (dy + h > c->height)) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Incorrect frame size: %ix%i+%ix%i of %ix%i\n",
-                       w, h, dx, dy, c->width, c->height);
-                return AVERROR_INVALIDDATA;
-            }
-            res = decode_hextile(c, outptr, gb, w, h, c->pic->linesize[0]);
-            if (res < 0)
-                return res;
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unsupported block type 0x%08X\n", enc);
-            chunks = 0; // leave chunks decoding loop
-        }
-    }
-    if (c->screendta) {
-        int i;
-        // save screen data before painting cursor
-        w = c->cur_w;
-        if (c->width < c->cur_x + w)
-            w = c->width - c->cur_x;
-        h = c->cur_h;
-        if (c->height < c->cur_y + h)
-            h = c->height - c->cur_y;
-        dx = c->cur_x;
-        if (dx < 0) {
-            w += dx;
-            dx = 0;
-        }
-        dy = c->cur_y;
-        if (dy < 0) {
-            h += dy;
-            dy = 0;
-        }
-        if ((w > 0) && (h > 0)) {
-            outptr = c->pic->data[0] + dx * c->bpp2 + dy * c->pic->linesize[0];
-            for (i = 0; i < h; i++) {
-                memcpy(c->screendta + i * c->cur_w * c->bpp2, outptr,
-                       w * c->bpp2);
-                outptr += c->pic->linesize[0];
-            }
-            outptr = c->pic->data[0];
-            put_cursor(outptr, c->pic->linesize[0], c, c->cur_x, c->cur_y);
-        }
-    }
-    *got_frame = 1;
-    if ((ret = av_frame_ref(data, c->pic)) < 0)
-        return ret;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    VmncContext * const c = avctx->priv_data;
-
-    c->avctx  = avctx;
-    c->width  = avctx->width;
-    c->height = avctx->height;
-    c->bpp    = avctx->bits_per_coded_sample;
-    c->bpp2   = c->bpp / 8;
-
-    switch (c->bpp) {
-    case 8:
-        avctx->pix_fmt = AV_PIX_FMT_PAL8;
-        break;
-    case 16:
-        avctx->pix_fmt = AV_PIX_FMT_RGB555;
-        break;
-    case 32:
-        avctx->pix_fmt = AV_PIX_FMT_RGB32;
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unsupported bitdepth %i\n", c->bpp);
-        return AVERROR_INVALIDDATA;
-    }
-
-    c->pic = av_frame_alloc();
-    if (!c->pic)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    VmncContext * const c = avctx->priv_data;
-
-    av_frame_free(&c->pic);
-
-    av_free(c->curbits);
-    av_free(c->curmask);
-    av_free(c->screendta);
-    return 0;
-}
-
-AVCodec ff_vmnc_decoder = {
-    .name           = "vmnc",
-    .long_name      = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VMNC,
-    .priv_data_size = sizeof(VmncContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/vorbis.c b/deps/libav/libavcodec/vorbis.c
deleted file mode 100644
index 66fa21b..0000000
--- a/deps/libav/libavcodec/vorbis.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Common code for Vorbis I encoder and decoder
- * @author Denes Balatoni  ( dbalatoni programozo hu )
- */
-
-#define BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "get_bits.h"
-
-#include "vorbis.h"
-
-
-/* Helper functions */
-
-// x^(1/n)
-unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n)
-{
-    unsigned int ret = 0, i, j;
-
-    do {
-        ++ret;
-        for (i = 0, j = ret; i < n - 1; i++)
-            j *= ret;
-    } while (j <= x);
-
-    return ret - 1;
-}
-
-// Generate vlc codes from vorbis huffman code lengths
-
-// the two bits[p] > 32 checks should be redundant, all calling code should
-// already ensure that, but since it allows overwriting the stack it seems
-// reasonable to check redundantly.
-int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
-{
-    uint32_t exit_at_level[33] = { 404 };
-
-    unsigned i, j, p, code;
-
-#ifdef DEBUG
-    GetBitContext gb;
-#endif
-
-    for (p = 0; (bits[p] == 0) && (p < num); ++p)
-        ;
-    if (p == num)
-        return 0;
-
-    codes[p] = 0;
-    if (bits[p] > 32)
-        return 1;
-    for (i = 0; i < bits[p]; ++i)
-        exit_at_level[i+1] = 1 << i;
-
-#ifdef DEBUG
-    av_log(NULL, AV_LOG_INFO, " %u. of %u code len %d code %d - ", p, num, bits[p], codes[p]);
-    init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
-    for (i = 0; i < bits[p]; ++i)
-        av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
-    av_log(NULL, AV_LOG_INFO, "\n");
-#endif
-
-    ++p;
-
-    for (; p < num; ++p) {
-        if (bits[p] > 32)
-             return 1;
-        if (bits[p] == 0)
-             continue;
-        // find corresponding exit(node which the tree can grow further from)
-        for (i = bits[p]; i > 0; --i)
-            if (exit_at_level[i])
-                break;
-        if (!i) // overspecified tree
-             return 1;
-        code = exit_at_level[i];
-        exit_at_level[i] = 0;
-        // construct code (append 0s to end) and introduce new exits
-        for (j = i + 1 ;j <= bits[p]; ++j)
-            exit_at_level[j] = code + (1 << (j - 1));
-        codes[p] = code;
-
-#ifdef DEBUG
-        av_log(NULL, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]);
-        init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
-        for (i = 0; i < bits[p]; ++i)
-            av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
-        av_log(NULL, AV_LOG_INFO, "\n");
-#endif
-
-    }
-
-    //no exits should be left (underspecified tree - ie. unused valid vlcs - not allowed by SPEC)
-    for (p = 1; p < 33; p++)
-        if (exit_at_level[p])
-            return 1;
-
-    return 0;
-}
-
-int ff_vorbis_ready_floor1_list(AVCodecContext *avctx,
-                                vorbis_floor1_entry *list, int values)
-{
-    int i;
-    list[0].sort = 0;
-    list[1].sort = 1;
-    for (i = 2; i < values; i++) {
-        int j;
-        list[i].low  = 0;
-        list[i].high = 1;
-        list[i].sort = i;
-        for (j = 2; j < i; j++) {
-            int tmp = list[j].x;
-            if (tmp < list[i].x) {
-                if (tmp > list[list[i].low].x)
-                    list[i].low  =  j;
-            } else {
-                if (tmp < list[list[i].high].x)
-                    list[i].high = j;
-            }
-        }
-    }
-    for (i = 0; i < values - 1; i++) {
-        int j;
-        for (j = i + 1; j < values; j++) {
-            if (list[i].x == list[j].x) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Duplicate value found in floor 1 X coordinates\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (list[list[i].sort].x > list[list[j].sort].x) {
-                int tmp = list[i].sort;
-                list[i].sort = list[j].sort;
-                list[j].sort = tmp;
-            }
-        }
-    }
-    return 0;
-}
-
-static inline void render_line_unrolled(intptr_t x, int y, int x1,
-                                        intptr_t sy, int ady, int adx,
-                                        float *buf)
-{
-    int err = -adx;
-    x -= x1 - 1;
-    buf += x1 - 1;
-    while (++x < 0) {
-        err += ady;
-        if (err >= 0) {
-            err += ady - adx;
-            y   += sy;
-            buf[x++] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y)];
-        }
-        buf[x] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y)];
-    }
-    if (x <= 0) {
-        if (err + ady >= 0)
-            y += sy;
-        buf[x] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y)];
-    }
-}
-
-static void render_line(int x0, int y0, int x1, int y1, float *buf)
-{
-    int dy  = y1 - y0;
-    int adx = x1 - x0;
-    int ady = FFABS(dy);
-    int sy  = dy < 0 ? -1 : 1;
-    buf[x0] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y0)];
-    if (ady*2 <= adx) { // optimized common case
-        render_line_unrolled(x0, y0, x1, sy, ady, adx, buf);
-    } else {
-        int base  = dy / adx;
-        int x     = x0;
-        int y     = y0;
-        int err   = -adx;
-        ady -= FFABS(base) * adx;
-        while (++x < x1) {
-            y += base;
-            err += ady;
-            if (err >= 0) {
-                err -= adx;
-                y   += sy;
-            }
-            buf[x] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y)];
-        }
-    }
-}
-
-void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
-                                  uint16_t *y_list, int *flag,
-                                  int multiplier, float *out, int samples)
-{
-    int lx, ly, i;
-    lx = 0;
-    ly = y_list[0] * multiplier;
-    for (i = 1; i < values; i++) {
-        int pos = list[i].sort;
-        if (flag[pos]) {
-            int x1 = list[pos].x;
-            int y1 = y_list[pos] * multiplier;
-            if (lx < samples)
-                render_line(lx, ly, FFMIN(x1,samples), y1, out);
-            lx = x1;
-            ly = y1;
-        }
-        if (lx >= samples)
-            break;
-    }
-    if (lx < samples)
-        render_line(lx, ly, samples, ly, out);
-}
diff --git a/deps/libav/libavcodec/vorbis.h b/deps/libav/libavcodec/vorbis.h
deleted file mode 100644
index 5ae20ac..0000000
--- a/deps/libav/libavcodec/vorbis.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * copyright (c) 2006 Oded Shimon <ods15 at ods15.dyndns.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VORBIS_H
-#define AVCODEC_VORBIS_H
-
-#include "avcodec.h"
-
-extern const float ff_vorbis_floor1_inverse_db_table[256];
-extern const float * const ff_vorbis_vwin[8];
-extern const uint8_t ff_vorbis_channel_layout_offsets[8][8];
-extern const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8];
-extern const uint64_t ff_vorbis_channel_layouts[9];
-
-typedef struct vorbis_floor1_entry {
-    uint16_t x;
-    uint16_t sort;
-    uint16_t low;
-    uint16_t high;
-} vorbis_floor1_entry;
-
-int ff_vorbis_ready_floor1_list(AVCodecContext *avctx,
-                                vorbis_floor1_entry *list, int values);
-unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n)
-int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num);
-void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
-                                  uint16_t *y_list, int *flag,
-                                  int multiplier, float * out, int samples);
-void ff_vorbis_inverse_coupling(float *mag, float *ang, intptr_t blocksize);
-
-#define ilog(i) av_log2(2*(i))
-
-#endif /* AVCODEC_VORBIS_H */
diff --git a/deps/libav/libavcodec/vorbis_data.c b/deps/libav/libavcodec/vorbis_data.c
deleted file mode 100644
index bafb77b..0000000
--- a/deps/libav/libavcodec/vorbis_data.c
+++ /dev/null
@@ -1,2193 +0,0 @@
-/*
- * copyright (c) 2005 Denes Balatoni ( dbalatoni programozo hu )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/mem.h"
-#include "vorbis.h"
-
-const uint8_t ff_vorbis_channel_layout_offsets[8][8] = {
-    { 0 },
-    { 0, 1 },
-    { 0, 2, 1 },
-    { 0, 1, 2, 3 },
-    { 0, 2, 1, 3, 4 },
-    { 0, 2, 1, 5, 3, 4 },
-    { 0, 2, 1, 6, 5, 3, 4 },
-    { 0, 2, 1, 7, 5, 6, 3, 4 },
-};
-
-const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8] = {
-    { 0 },
-    { 0, 1 },
-    { 0, 2, 1 },
-    { 0, 1, 2, 3 },
-    { 0, 2, 1, 3, 4 },
-    { 0, 2, 1, 4, 5, 3 },
-    { 0, 2, 1, 5, 6, 4, 3 },
-    { 0, 2, 1, 6, 7, 4, 5, 3 },
-};
-
-const uint64_t ff_vorbis_channel_layouts[9] = {
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_QUAD,
-    AV_CH_LAYOUT_5POINT0_BACK,
-    AV_CH_LAYOUT_5POINT1_BACK,
-    AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER,
-    AV_CH_LAYOUT_7POINT1,
-    0
-};
-
-DECLARE_ALIGNED(16, static const float, vwin64)[32] = {
-    0.0009460463F, 0.0085006468F, 0.0235352254F, 0.0458950567F,
-    0.0753351908F, 0.1115073077F, 0.1539457973F, 0.2020557475F,
-    0.2551056759F, 0.3122276645F, 0.3724270287F, 0.4346027792F,
-    0.4975789974F, 0.5601459521F, 0.6211085051F, 0.6793382689F,
-    0.7338252629F, 0.7837245849F, 0.8283939355F, 0.8674186656F,
-    0.9006222429F, 0.9280614787F, 0.9500073081F, 0.9669131782F,
-    0.9793740220F, 0.9880792941F, 0.9937636139F, 0.9971582668F,
-    0.9989462667F, 0.9997230082F, 0.9999638688F, 0.9999995525F,
-};
-
-DECLARE_ALIGNED(16, static const float, vwin128)[64] = {
-    0.0002365472F, 0.0021280687F, 0.0059065254F, 0.0115626550F,
-    0.0190823442F, 0.0284463735F, 0.0396300935F, 0.0526030430F,
-    0.0673285281F, 0.0837631763F, 0.1018564887F, 0.1215504095F,
-    0.1427789367F, 0.1654677960F, 0.1895342001F, 0.2148867160F,
-    0.2414252576F, 0.2690412240F, 0.2976177952F, 0.3270303960F,
-    0.3571473350F, 0.3878306189F, 0.4189369387F, 0.4503188188F,
-    0.4818259135F, 0.5133064334F, 0.5446086751F, 0.5755826278F,
-    0.6060816248F, 0.6359640047F, 0.6650947483F, 0.6933470543F,
-    0.7206038179F, 0.7467589810F, 0.7717187213F, 0.7954024542F,
-    0.8177436264F, 0.8386902831F, 0.8582053981F, 0.8762669622F,
-    0.8928678298F, 0.9080153310F, 0.9217306608F, 0.9340480615F,
-    0.9450138200F, 0.9546851041F, 0.9631286621F, 0.9704194171F,
-    0.9766389810F, 0.9818741197F, 0.9862151938F, 0.9897546035F,
-    0.9925852598F, 0.9947991032F, 0.9964856900F, 0.9977308602F,
-    0.9986155015F, 0.9992144193F, 0.9995953200F, 0.9998179155F,
-    0.9999331503F, 0.9999825563F, 0.9999977357F, 0.9999999720F,
-};
-
-DECLARE_ALIGNED(16, static const float, vwin256)[128] = {
-    0.0000591390F, 0.0005321979F, 0.0014780301F, 0.0028960636F,
-    0.0047854363F, 0.0071449926F, 0.0099732775F, 0.0132685298F,
-    0.0170286741F, 0.0212513119F, 0.0259337111F, 0.0310727950F,
-    0.0366651302F, 0.0427069140F, 0.0491939614F, 0.0561216907F,
-    0.0634851102F, 0.0712788035F, 0.0794969160F, 0.0881331402F,
-    0.0971807028F, 0.1066323515F, 0.1164803426F, 0.1267164297F,
-    0.1373318534F, 0.1483173323F, 0.1596630553F, 0.1713586755F,
-    0.1833933062F, 0.1957555184F, 0.2084333404F, 0.2214142599F,
-    0.2346852280F, 0.2482326664F, 0.2620424757F, 0.2761000481F,
-    0.2903902813F, 0.3048975959F, 0.3196059553F, 0.3344988887F,
-    0.3495595160F, 0.3647705766F, 0.3801144597F, 0.3955732382F,
-    0.4111287047F, 0.4267624093F, 0.4424557009F, 0.4581897696F,
-    0.4739456913F, 0.4897044744F, 0.5054471075F, 0.5211546088F,
-    0.5368080763F, 0.5523887395F, 0.5678780103F, 0.5832575361F,
-    0.5985092508F, 0.6136154277F, 0.6285587300F, 0.6433222619F,
-    0.6578896175F, 0.6722449294F, 0.6863729144F, 0.7002589187F,
-    0.7138889597F, 0.7272497662F, 0.7403288154F, 0.7531143679F,
-    0.7655954985F, 0.7777621249F, 0.7896050322F, 0.8011158947F,
-    0.8122872932F, 0.8231127294F, 0.8335866365F, 0.8437043850F,
-    0.8534622861F, 0.8628575905F, 0.8718884835F, 0.8805540765F,
-    0.8888543947F, 0.8967903616F, 0.9043637797F, 0.9115773078F,
-    0.9184344360F, 0.9249394562F, 0.9310974312F, 0.9369141608F,
-    0.9423961446F, 0.9475505439F, 0.9523851406F, 0.9569082947F,
-    0.9611289005F, 0.9650563408F, 0.9687004405F, 0.9720714191F,
-    0.9751798427F, 0.9780365753F, 0.9806527301F, 0.9830396204F,
-    0.9852087111F, 0.9871715701F, 0.9889398207F, 0.9905250941F,
-    0.9919389832F, 0.9931929973F, 0.9942985174F, 0.9952667537F,
-    0.9961087037F, 0.9968351119F, 0.9974564312F, 0.9979827858F,
-    0.9984239359F, 0.9987892441F, 0.9990876435F, 0.9993276081F,
-    0.9995171241F, 0.9996636648F, 0.9997741654F, 0.9998550016F,
-    0.9999119692F, 0.9999502656F, 0.9999744742F, 0.9999885497F,
-    0.9999958064F, 0.9999989077F, 0.9999998584F, 0.9999999983F,
-};
-
-DECLARE_ALIGNED(16, static const float, vwin512)[256] = {
-    0.0000147849F, 0.0001330607F, 0.0003695946F, 0.0007243509F,
-    0.0011972759F, 0.0017882983F, 0.0024973285F, 0.0033242588F,
-    0.0042689632F, 0.0053312973F, 0.0065110982F, 0.0078081841F,
-    0.0092223540F, 0.0107533880F, 0.0124010466F, 0.0141650703F,
-    0.0160451800F, 0.0180410758F, 0.0201524373F, 0.0223789233F,
-    0.0247201710F, 0.0271757958F, 0.0297453914F, 0.0324285286F,
-    0.0352247556F, 0.0381335972F, 0.0411545545F, 0.0442871045F,
-    0.0475306997F, 0.0508847676F, 0.0543487103F, 0.0579219038F,
-    0.0616036982F, 0.0653934164F, 0.0692903546F, 0.0732937809F,
-    0.0774029356F, 0.0816170305F, 0.0859352485F, 0.0903567428F,
-    0.0948806375F, 0.0995060259F, 0.1042319712F, 0.1090575056F,
-    0.1139816300F, 0.1190033137F, 0.1241214941F, 0.1293350764F,
-    0.1346429333F, 0.1400439046F, 0.1455367974F, 0.1511203852F,
-    0.1567934083F, 0.1625545735F, 0.1684025537F, 0.1743359881F,
-    0.1803534820F, 0.1864536069F, 0.1926349000F, 0.1988958650F,
-    0.2052349715F, 0.2116506555F, 0.2181413191F, 0.2247053313F,
-    0.2313410275F, 0.2380467105F, 0.2448206500F, 0.2516610835F,
-    0.2585662164F, 0.2655342226F, 0.2725632448F, 0.2796513950F,
-    0.2867967551F, 0.2939973773F, 0.3012512852F, 0.3085564739F,
-    0.3159109111F, 0.3233125375F, 0.3307592680F, 0.3382489922F,
-    0.3457795756F, 0.3533488602F, 0.3609546657F, 0.3685947904F,
-    0.3762670121F, 0.3839690896F, 0.3916987634F, 0.3994537572F,
-    0.4072317788F, 0.4150305215F, 0.4228476653F, 0.4306808783F,
-    0.4385278181F, 0.4463861329F, 0.4542534630F, 0.4621274424F,
-    0.4700057001F, 0.4778858615F, 0.4857655502F, 0.4936423891F,
-    0.5015140023F, 0.5093780165F, 0.5172320626F, 0.5250737772F,
-    0.5329008043F, 0.5407107971F, 0.5485014192F, 0.5562703465F,
-    0.5640152688F, 0.5717338914F, 0.5794239366F, 0.5870831457F,
-    0.5947092801F, 0.6023001235F, 0.6098534829F, 0.6173671907F,
-    0.6248391059F, 0.6322671161F, 0.6396491384F, 0.6469831217F,
-    0.6542670475F, 0.6614989319F, 0.6686768267F, 0.6757988210F,
-    0.6828630426F, 0.6898676592F, 0.6968108799F, 0.7036909564F,
-    0.7105061843F, 0.7172549043F, 0.7239355032F, 0.7305464154F,
-    0.7370861235F, 0.7435531598F, 0.7499461068F, 0.7562635986F,
-    0.7625043214F, 0.7686670148F, 0.7747504721F, 0.7807535410F,
-    0.7866751247F, 0.7925141825F, 0.7982697296F, 0.8039408387F,
-    0.8095266395F, 0.8150263196F, 0.8204391248F, 0.8257643590F,
-    0.8310013848F, 0.8361496236F, 0.8412085555F, 0.8461777194F,
-    0.8510567129F, 0.8558451924F, 0.8605428730F, 0.8651495278F,
-    0.8696649882F, 0.8740891432F, 0.8784219392F, 0.8826633797F,
-    0.8868135244F, 0.8908724888F, 0.8948404441F, 0.8987176157F,
-    0.9025042831F, 0.9062007791F, 0.9098074886F, 0.9133248482F,
-    0.9167533451F, 0.9200935163F, 0.9233459472F, 0.9265112712F,
-    0.9295901680F, 0.9325833632F, 0.9354916263F, 0.9383157705F,
-    0.9410566504F, 0.9437151618F, 0.9462922398F, 0.9487888576F,
-    0.9512060252F, 0.9535447882F, 0.9558062262F, 0.9579914516F,
-    0.9601016078F, 0.9621378683F, 0.9641014348F, 0.9659935361F,
-    0.9678154261F, 0.9695683830F, 0.9712537071F, 0.9728727198F,
-    0.9744267618F, 0.9759171916F, 0.9773453842F, 0.9787127293F,
-    0.9800206298F, 0.9812705006F, 0.9824637665F, 0.9836018613F,
-    0.9846862258F, 0.9857183066F, 0.9866995544F, 0.9876314227F,
-    0.9885153662F, 0.9893528393F, 0.9901452948F, 0.9908941823F,
-    0.9916009470F, 0.9922670279F, 0.9928938570F, 0.9934828574F,
-    0.9940354423F, 0.9945530133F, 0.9950369595F, 0.9954886562F,
-    0.9959094633F, 0.9963007242F, 0.9966637649F, 0.9969998925F,
-    0.9973103939F, 0.9975965351F, 0.9978595598F, 0.9981006885F,
-    0.9983211172F, 0.9985220166F, 0.9987045311F, 0.9988697776F,
-    0.9990188449F, 0.9991527924F, 0.9992726499F, 0.9993794157F,
-    0.9994740570F, 0.9995575079F, 0.9996306699F, 0.9996944099F,
-    0.9997495605F, 0.9997969190F, 0.9998372465F, 0.9998712678F,
-    0.9998996704F, 0.9999231041F, 0.9999421807F, 0.9999574732F,
-    0.9999695157F, 0.9999788026F, 0.9999857885F, 0.9999908879F,
-    0.9999944746F, 0.9999968817F, 0.9999984010F, 0.9999992833F,
-    0.9999997377F, 0.9999999317F, 0.9999999911F, 0.9999999999F,
-};
-
-DECLARE_ALIGNED(16, static const float, vwin1024)[512] = {
-    0.0000036962F, 0.0000332659F, 0.0000924041F, 0.0001811086F,
-    0.0002993761F, 0.0004472021F, 0.0006245811F, 0.0008315063F,
-    0.0010679699F, 0.0013339631F, 0.0016294757F, 0.0019544965F,
-    0.0023090133F, 0.0026930125F, 0.0031064797F, 0.0035493989F,
-    0.0040217533F, 0.0045235250F, 0.0050546946F, 0.0056152418F,
-    0.0062051451F, 0.0068243817F, 0.0074729278F, 0.0081507582F,
-    0.0088578466F, 0.0095941655F, 0.0103596863F, 0.0111543789F,
-    0.0119782122F, 0.0128311538F, 0.0137131701F, 0.0146242260F,
-    0.0155642855F, 0.0165333111F, 0.0175312640F, 0.0185581042F,
-    0.0196137903F, 0.0206982797F, 0.0218115284F, 0.0229534910F,
-    0.0241241208F, 0.0253233698F, 0.0265511886F, 0.0278075263F,
-    0.0290923308F, 0.0304055484F, 0.0317471241F, 0.0331170013F,
-    0.0345151222F, 0.0359414274F, 0.0373958560F, 0.0388783456F,
-    0.0403888325F, 0.0419272511F, 0.0434935347F, 0.0450876148F,
-    0.0467094213F, 0.0483588828F, 0.0500359261F, 0.0517404765F,
-    0.0534724575F, 0.0552317913F, 0.0570183983F, 0.0588321971F,
-    0.0606731048F, 0.0625410369F, 0.0644359070F, 0.0663576272F,
-    0.0683061077F, 0.0702812571F, 0.0722829821F, 0.0743111878F,
-    0.0763657775F, 0.0784466526F, 0.0805537129F, 0.0826868561F,
-    0.0848459782F, 0.0870309736F, 0.0892417345F, 0.0914781514F,
-    0.0937401128F, 0.0960275056F, 0.0983402145F, 0.1006781223F,
-    0.1030411101F, 0.1054290568F, 0.1078418397F, 0.1102793336F,
-    0.1127414119F, 0.1152279457F, 0.1177388042F, 0.1202738544F,
-    0.1228329618F, 0.1254159892F, 0.1280227980F, 0.1306532471F,
-    0.1333071937F, 0.1359844927F, 0.1386849970F, 0.1414085575F,
-    0.1441550230F, 0.1469242403F, 0.1497160539F, 0.1525303063F,
-    0.1553668381F, 0.1582254875F, 0.1611060909F, 0.1640084822F,
-    0.1669324936F, 0.1698779549F, 0.1728446939F, 0.1758325362F,
-    0.1788413055F, 0.1818708232F, 0.1849209084F, 0.1879913785F,
-    0.1910820485F, 0.1941927312F, 0.1973232376F, 0.2004733764F,
-    0.2036429541F, 0.2068317752F, 0.2100396421F, 0.2132663552F,
-    0.2165117125F, 0.2197755102F, 0.2230575422F, 0.2263576007F,
-    0.2296754753F, 0.2330109540F, 0.2363638225F, 0.2397338646F,
-    0.2431208619F, 0.2465245941F, 0.2499448389F, 0.2533813719F,
-    0.2568339669F, 0.2603023956F, 0.2637864277F, 0.2672858312F,
-    0.2708003718F, 0.2743298135F, 0.2778739186F, 0.2814324472F,
-    0.2850051576F, 0.2885918065F, 0.2921921485F, 0.2958059366F,
-    0.2994329219F, 0.3030728538F, 0.3067254799F, 0.3103905462F,
-    0.3140677969F, 0.3177569747F, 0.3214578205F, 0.3251700736F,
-    0.3288934718F, 0.3326277513F, 0.3363726468F, 0.3401278914F,
-    0.3438932168F, 0.3476683533F, 0.3514530297F, 0.3552469734F,
-    0.3590499106F, 0.3628615659F, 0.3666816630F, 0.3705099239F,
-    0.3743460698F, 0.3781898204F, 0.3820408945F, 0.3858990095F,
-    0.3897638820F, 0.3936352274F, 0.3975127601F, 0.4013961936F,
-    0.4052852405F, 0.4091796123F, 0.4130790198F, 0.4169831732F,
-    0.4208917815F, 0.4248045534F, 0.4287211965F, 0.4326414181F,
-    0.4365649248F, 0.4404914225F, 0.4444206167F, 0.4483522125F,
-    0.4522859146F, 0.4562214270F, 0.4601584538F, 0.4640966984F,
-    0.4680358644F, 0.4719756548F, 0.4759157726F, 0.4798559209F,
-    0.4837958024F, 0.4877351199F, 0.4916735765F, 0.4956108751F,
-    0.4995467188F, 0.5034808109F, 0.5074128550F, 0.5113425550F,
-    0.5152696149F, 0.5191937395F, 0.5231146336F, 0.5270320028F,
-    0.5309455530F, 0.5348549910F, 0.5387600239F, 0.5426603597F,
-    0.5465557070F, 0.5504457754F, 0.5543302752F, 0.5582089175F,
-    0.5620814145F, 0.5659474793F, 0.5698068262F, 0.5736591704F,
-    0.5775042283F, 0.5813417176F, 0.5851713571F, 0.5889928670F,
-    0.5928059689F, 0.5966103856F, 0.6004058415F, 0.6041920626F,
-    0.6079687761F, 0.6117357113F, 0.6154925986F, 0.6192391705F,
-    0.6229751612F, 0.6267003064F, 0.6304143441F, 0.6341170137F,
-    0.6378080569F, 0.6414872173F, 0.6451542405F, 0.6488088741F,
-    0.6524508681F, 0.6560799742F, 0.6596959469F, 0.6632985424F,
-    0.6668875197F, 0.6704626398F, 0.6740236662F, 0.6775703649F,
-    0.6811025043F, 0.6846198554F, 0.6881221916F, 0.6916092892F,
-    0.6950809269F, 0.6985368861F, 0.7019769510F, 0.7054009085F,
-    0.7088085484F, 0.7121996632F, 0.7155740484F, 0.7189315023F,
-    0.7222718263F, 0.7255948245F, 0.7289003043F, 0.7321880760F,
-    0.7354579530F, 0.7387097518F, 0.7419432921F, 0.7451583966F,
-    0.7483548915F, 0.7515326059F, 0.7546913723F, 0.7578310265F,
-    0.7609514077F, 0.7640523581F, 0.7671337237F, 0.7701953535F,
-    0.7732371001F, 0.7762588195F, 0.7792603711F, 0.7822416178F,
-    0.7852024259F, 0.7881426654F, 0.7910622097F, 0.7939609356F,
-    0.7968387237F, 0.7996954579F, 0.8025310261F, 0.8053453193F,
-    0.8081382324F, 0.8109096638F, 0.8136595156F, 0.8163876936F,
-    0.8190941071F, 0.8217786690F, 0.8244412960F, 0.8270819086F,
-    0.8297004305F, 0.8322967896F, 0.8348709171F, 0.8374227481F,
-    0.8399522213F, 0.8424592789F, 0.8449438672F, 0.8474059356F,
-    0.8498454378F, 0.8522623306F, 0.8546565748F, 0.8570281348F,
-    0.8593769787F, 0.8617030779F, 0.8640064080F, 0.8662869477F,
-    0.8685446796F, 0.8707795899F, 0.8729916682F, 0.8751809079F,
-    0.8773473059F, 0.8794908626F, 0.8816115819F, 0.8837094713F,
-    0.8857845418F, 0.8878368079F, 0.8898662874F, 0.8918730019F,
-    0.8938569760F, 0.8958182380F, 0.8977568194F, 0.8996727552F,
-    0.9015660837F, 0.9034368465F, 0.9052850885F, 0.9071108577F,
-    0.9089142057F, 0.9106951869F, 0.9124538591F, 0.9141902832F,
-    0.9159045233F, 0.9175966464F, 0.9192667228F, 0.9209148257F,
-    0.9225410313F, 0.9241454187F, 0.9257280701F, 0.9272890704F,
-    0.9288285075F, 0.9303464720F, 0.9318430576F, 0.9333183603F,
-    0.9347724792F, 0.9362055158F, 0.9376175745F, 0.9390087622F,
-    0.9403791881F, 0.9417289644F, 0.9430582055F, 0.9443670283F,
-    0.9456555521F, 0.9469238986F, 0.9481721917F, 0.9494005577F,
-    0.9506091252F, 0.9517980248F, 0.9529673894F, 0.9541173540F,
-    0.9552480557F, 0.9563596334F, 0.9574522282F, 0.9585259830F,
-    0.9595810428F, 0.9606175542F, 0.9616356656F, 0.9626355274F,
-    0.9636172915F, 0.9645811114F, 0.9655271425F, 0.9664555414F,
-    0.9673664664F, 0.9682600774F, 0.9691365355F, 0.9699960034F,
-    0.9708386448F, 0.9716646250F, 0.9724741103F, 0.9732672685F,
-    0.9740442683F, 0.9748052795F, 0.9755504729F, 0.9762800205F,
-    0.9769940950F, 0.9776928703F, 0.9783765210F, 0.9790452223F,
-    0.9796991504F, 0.9803384823F, 0.9809633954F, 0.9815740679F,
-    0.9821706784F, 0.9827534063F, 0.9833224312F, 0.9838779332F,
-    0.9844200928F, 0.9849490910F, 0.9854651087F, 0.9859683274F,
-    0.9864589286F, 0.9869370940F, 0.9874030054F, 0.9878568447F,
-    0.9882987937F, 0.9887290343F, 0.9891477481F, 0.9895551169F,
-    0.9899513220F, 0.9903365446F, 0.9907109658F, 0.9910747662F,
-    0.9914281260F, 0.9917712252F, 0.9921042433F, 0.9924273593F,
-    0.9927407516F, 0.9930445982F, 0.9933390763F, 0.9936243626F,
-    0.9939006331F, 0.9941680631F, 0.9944268269F, 0.9946770982F,
-    0.9949190498F, 0.9951528537F, 0.9953786808F, 0.9955967011F,
-    0.9958070836F, 0.9960099963F, 0.9962056061F, 0.9963940787F,
-    0.9965755786F, 0.9967502693F, 0.9969183129F, 0.9970798704F,
-    0.9972351013F, 0.9973841640F, 0.9975272151F, 0.9976644103F,
-    0.9977959036F, 0.9979218476F, 0.9980423932F, 0.9981576901F,
-    0.9982678862F, 0.9983731278F, 0.9984735596F, 0.9985693247F,
-    0.9986605645F, 0.9987474186F, 0.9988300248F, 0.9989085193F,
-    0.9989830364F, 0.9990537085F, 0.9991206662F, 0.9991840382F,
-    0.9992439513F, 0.9993005303F, 0.9993538982F, 0.9994041757F,
-    0.9994514817F, 0.9994959330F, 0.9995376444F, 0.9995767286F,
-    0.9996132960F, 0.9996474550F, 0.9996793121F, 0.9997089710F,
-    0.9997365339F, 0.9997621003F, 0.9997857677F, 0.9998076311F,
-    0.9998277836F, 0.9998463156F, 0.9998633155F, 0.9998788692F,
-    0.9998930603F, 0.9999059701F, 0.9999176774F, 0.9999282586F,
-    0.9999377880F, 0.9999463370F, 0.9999539749F, 0.9999607685F,
-    0.9999667820F, 0.9999720773F, 0.9999767136F, 0.9999807479F,
-    0.9999842344F, 0.9999872249F, 0.9999897688F, 0.9999919127F,
-    0.9999937009F, 0.9999951749F, 0.9999963738F, 0.9999973342F,
-    0.9999980900F, 0.9999986724F, 0.9999991103F, 0.9999994297F,
-    0.9999996543F, 0.9999998049F, 0.9999999000F, 0.9999999552F,
-    0.9999999836F, 0.9999999957F, 0.9999999994F, 1.0000000000F,
-};
-
-DECLARE_ALIGNED(16, static const float, vwin2048)[1024] = {
-    0.0000009241F, 0.0000083165F, 0.0000231014F, 0.0000452785F,
-    0.0000748476F, 0.0001118085F, 0.0001561608F, 0.0002079041F,
-    0.0002670379F, 0.0003335617F, 0.0004074748F, 0.0004887765F,
-    0.0005774661F, 0.0006735427F, 0.0007770054F, 0.0008878533F,
-    0.0010060853F, 0.0011317002F, 0.0012646969F, 0.0014050742F,
-    0.0015528307F, 0.0017079650F, 0.0018704756F, 0.0020403610F,
-    0.0022176196F, 0.0024022497F, 0.0025942495F, 0.0027936173F,
-    0.0030003511F, 0.0032144490F, 0.0034359088F, 0.0036647286F,
-    0.0039009061F, 0.0041444391F, 0.0043953253F, 0.0046535621F,
-    0.0049191472F, 0.0051920781F, 0.0054723520F, 0.0057599664F,
-    0.0060549184F, 0.0063572052F, 0.0066668239F, 0.0069837715F,
-    0.0073080449F, 0.0076396410F, 0.0079785566F, 0.0083247884F,
-    0.0086783330F, 0.0090391871F, 0.0094073470F, 0.0097828092F,
-    0.0101655700F, 0.0105556258F, 0.0109529726F, 0.0113576065F,
-    0.0117695237F, 0.0121887200F, 0.0126151913F, 0.0130489335F,
-    0.0134899422F, 0.0139382130F, 0.0143937415F, 0.0148565233F,
-    0.0153265536F, 0.0158038279F, 0.0162883413F, 0.0167800889F,
-    0.0172790660F, 0.0177852675F, 0.0182986882F, 0.0188193231F,
-    0.0193471668F, 0.0198822141F, 0.0204244594F, 0.0209738974F,
-    0.0215305225F, 0.0220943289F, 0.0226653109F, 0.0232434627F,
-    0.0238287784F, 0.0244212519F, 0.0250208772F, 0.0256276481F,
-    0.0262415582F, 0.0268626014F, 0.0274907711F, 0.0281260608F,
-    0.0287684638F, 0.0294179736F, 0.0300745833F, 0.0307382859F,
-    0.0314090747F, 0.0320869424F, 0.0327718819F, 0.0334638860F,
-    0.0341629474F, 0.0348690586F, 0.0355822122F, 0.0363024004F,
-    0.0370296157F, 0.0377638502F, 0.0385050960F, 0.0392533451F,
-    0.0400085896F, 0.0407708211F, 0.0415400315F, 0.0423162123F,
-    0.0430993552F, 0.0438894515F, 0.0446864926F, 0.0454904698F,
-    0.0463013742F, 0.0471191969F, 0.0479439288F, 0.0487755607F,
-    0.0496140836F, 0.0504594879F, 0.0513117642F, 0.0521709031F,
-    0.0530368949F, 0.0539097297F, 0.0547893979F, 0.0556758894F,
-    0.0565691941F, 0.0574693019F, 0.0583762026F, 0.0592898858F,
-    0.0602103410F, 0.0611375576F, 0.0620715250F, 0.0630122324F,
-    0.0639596688F, 0.0649138234F, 0.0658746848F, 0.0668422421F,
-    0.0678164838F, 0.0687973985F, 0.0697849746F, 0.0707792005F,
-    0.0717800645F, 0.0727875547F, 0.0738016591F, 0.0748223656F,
-    0.0758496620F, 0.0768835359F, 0.0779239751F, 0.0789709668F,
-    0.0800244985F, 0.0810845574F, 0.0821511306F, 0.0832242052F,
-    0.0843037679F, 0.0853898056F, 0.0864823050F, 0.0875812525F,
-    0.0886866347F, 0.0897984378F, 0.0909166480F, 0.0920412513F,
-    0.0931722338F, 0.0943095813F, 0.0954532795F, 0.0966033140F,
-    0.0977596702F, 0.0989223336F, 0.1000912894F, 0.1012665227F,
-    0.1024480185F, 0.1036357616F, 0.1048297369F, 0.1060299290F,
-    0.1072363224F, 0.1084489014F, 0.1096676504F, 0.1108925534F,
-    0.1121235946F, 0.1133607577F, 0.1146040267F, 0.1158533850F,
-    0.1171088163F, 0.1183703040F, 0.1196378312F, 0.1209113812F,
-    0.1221909370F, 0.1234764815F, 0.1247679974F, 0.1260654674F,
-    0.1273688740F, 0.1286781995F, 0.1299934263F, 0.1313145365F,
-    0.1326415121F, 0.1339743349F, 0.1353129866F, 0.1366574490F,
-    0.1380077035F, 0.1393637315F, 0.1407255141F, 0.1420930325F,
-    0.1434662677F, 0.1448452004F, 0.1462298115F, 0.1476200814F,
-    0.1490159906F, 0.1504175195F, 0.1518246482F, 0.1532373569F,
-    0.1546556253F, 0.1560794333F, 0.1575087606F, 0.1589435866F,
-    0.1603838909F, 0.1618296526F, 0.1632808509F, 0.1647374648F,
-    0.1661994731F, 0.1676668546F, 0.1691395880F, 0.1706176516F,
-    0.1721010238F, 0.1735896829F, 0.1750836068F, 0.1765827736F,
-    0.1780871610F, 0.1795967468F, 0.1811115084F, 0.1826314234F,
-    0.1841564689F, 0.1856866221F, 0.1872218600F, 0.1887621595F,
-    0.1903074974F, 0.1918578503F, 0.1934131947F, 0.1949735068F,
-    0.1965387630F, 0.1981089393F, 0.1996840117F, 0.2012639560F,
-    0.2028487479F, 0.2044383630F, 0.2060327766F, 0.2076319642F,
-    0.2092359007F, 0.2108445614F, 0.2124579211F, 0.2140759545F,
-    0.2156986364F, 0.2173259411F, 0.2189578432F, 0.2205943168F,
-    0.2222353361F, 0.2238808751F, 0.2255309076F, 0.2271854073F,
-    0.2288443480F, 0.2305077030F, 0.2321754457F, 0.2338475493F,
-    0.2355239869F, 0.2372047315F, 0.2388897560F, 0.2405790329F,
-    0.2422725350F, 0.2439702347F, 0.2456721043F, 0.2473781159F,
-    0.2490882418F, 0.2508024539F, 0.2525207240F, 0.2542430237F,
-    0.2559693248F, 0.2576995986F, 0.2594338166F, 0.2611719498F,
-    0.2629139695F, 0.2646598466F, 0.2664095520F, 0.2681630564F,
-    0.2699203304F, 0.2716813445F, 0.2734460691F, 0.2752144744F,
-    0.2769865307F, 0.2787622079F, 0.2805414760F, 0.2823243047F,
-    0.2841106637F, 0.2859005227F, 0.2876938509F, 0.2894906179F,
-    0.2912907928F, 0.2930943447F, 0.2949012426F, 0.2967114554F,
-    0.2985249520F, 0.3003417009F, 0.3021616708F, 0.3039848301F,
-    0.3058111471F, 0.3076405901F, 0.3094731273F, 0.3113087266F,
-    0.3131473560F, 0.3149889833F, 0.3168335762F, 0.3186811024F,
-    0.3205315294F, 0.3223848245F, 0.3242409552F, 0.3260998886F,
-    0.3279615918F, 0.3298260319F, 0.3316931758F, 0.3335629903F,
-    0.3354354423F, 0.3373104982F, 0.3391881247F, 0.3410682882F,
-    0.3429509551F, 0.3448360917F, 0.3467236642F, 0.3486136387F,
-    0.3505059811F, 0.3524006575F, 0.3542976336F, 0.3561968753F,
-    0.3580983482F, 0.3600020179F, 0.3619078499F, 0.3638158096F,
-    0.3657258625F, 0.3676379737F, 0.3695521086F, 0.3714682321F,
-    0.3733863094F, 0.3753063055F, 0.3772281852F, 0.3791519134F,
-    0.3810774548F, 0.3830047742F, 0.3849338362F, 0.3868646053F,
-    0.3887970459F, 0.3907311227F, 0.3926667998F, 0.3946040417F,
-    0.3965428125F, 0.3984830765F, 0.4004247978F, 0.4023679403F,
-    0.4043124683F, 0.4062583455F, 0.4082055359F, 0.4101540034F,
-    0.4121037117F, 0.4140546246F, 0.4160067058F, 0.4179599190F,
-    0.4199142277F, 0.4218695956F, 0.4238259861F, 0.4257833627F,
-    0.4277416888F, 0.4297009279F, 0.4316610433F, 0.4336219983F,
-    0.4355837562F, 0.4375462803F, 0.4395095337F, 0.4414734797F,
-    0.4434380815F, 0.4454033021F, 0.4473691046F, 0.4493354521F,
-    0.4513023078F, 0.4532696345F, 0.4552373954F, 0.4572055533F,
-    0.4591740713F, 0.4611429123F, 0.4631120393F, 0.4650814151F,
-    0.4670510028F, 0.4690207650F, 0.4709906649F, 0.4729606651F,
-    0.4749307287F, 0.4769008185F, 0.4788708972F, 0.4808409279F,
-    0.4828108732F, 0.4847806962F, 0.4867503597F, 0.4887198264F,
-    0.4906890593F, 0.4926580213F, 0.4946266753F, 0.4965949840F,
-    0.4985629105F, 0.5005304176F, 0.5024974683F, 0.5044640255F,
-    0.5064300522F, 0.5083955114F, 0.5103603659F, 0.5123245790F,
-    0.5142881136F, 0.5162509328F, 0.5182129997F, 0.5201742774F,
-    0.5221347290F, 0.5240943178F, 0.5260530070F, 0.5280107598F,
-    0.5299675395F, 0.5319233095F, 0.5338780330F, 0.5358316736F,
-    0.5377841946F, 0.5397355596F, 0.5416857320F, 0.5436346755F,
-    0.5455823538F, 0.5475287304F, 0.5494737691F, 0.5514174337F,
-    0.5533596881F, 0.5553004962F, 0.5572398218F, 0.5591776291F,
-    0.5611138821F, 0.5630485449F, 0.5649815818F, 0.5669129570F,
-    0.5688426349F, 0.5707705799F, 0.5726967564F, 0.5746211290F,
-    0.5765436624F, 0.5784643212F, 0.5803830702F, 0.5822998743F,
-    0.5842146984F, 0.5861275076F, 0.5880382669F, 0.5899469416F,
-    0.5918534968F, 0.5937578981F, 0.5956601107F, 0.5975601004F,
-    0.5994578326F, 0.6013532732F, 0.6032463880F, 0.6051371429F,
-    0.6070255039F, 0.6089114372F, 0.6107949090F, 0.6126758856F,
-    0.6145543334F, 0.6164302191F, 0.6183035092F, 0.6201741706F,
-    0.6220421700F, 0.6239074745F, 0.6257700513F, 0.6276298674F,
-    0.6294868903F, 0.6313410873F, 0.6331924262F, 0.6350408745F,
-    0.6368864001F, 0.6387289710F, 0.6405685552F, 0.6424051209F,
-    0.6442386364F, 0.6460690702F, 0.6478963910F, 0.6497205673F,
-    0.6515415682F, 0.6533593625F, 0.6551739194F, 0.6569852082F,
-    0.6587931984F, 0.6605978593F, 0.6623991609F, 0.6641970728F,
-    0.6659915652F, 0.6677826081F, 0.6695701718F, 0.6713542268F,
-    0.6731347437F, 0.6749116932F, 0.6766850461F, 0.6784547736F,
-    0.6802208469F, 0.6819832374F, 0.6837419164F, 0.6854968559F,
-    0.6872480275F, 0.6889954034F, 0.6907389556F, 0.6924786566F,
-    0.6942144788F, 0.6959463950F, 0.6976743780F, 0.6993984008F,
-    0.7011184365F, 0.7028344587F, 0.7045464407F, 0.7062543564F,
-    0.7079581796F, 0.7096578844F, 0.7113534450F, 0.7130448359F,
-    0.7147320316F, 0.7164150070F, 0.7180937371F, 0.7197681970F,
-    0.7214383620F, 0.7231042077F, 0.7247657098F, 0.7264228443F,
-    0.7280755871F, 0.7297239147F, 0.7313678035F, 0.7330072301F,
-    0.7346421715F, 0.7362726046F, 0.7378985069F, 0.7395198556F,
-    0.7411366285F, 0.7427488034F, 0.7443563584F, 0.7459592717F,
-    0.7475575218F, 0.7491510873F, 0.7507399471F, 0.7523240803F,
-    0.7539034661F, 0.7554780839F, 0.7570479136F, 0.7586129349F,
-    0.7601731279F, 0.7617284730F, 0.7632789506F, 0.7648245416F,
-    0.7663652267F, 0.7679009872F, 0.7694318044F, 0.7709576599F,
-    0.7724785354F, 0.7739944130F, 0.7755052749F, 0.7770111035F,
-    0.7785118815F, 0.7800075916F, 0.7814982170F, 0.7829837410F,
-    0.7844641472F, 0.7859394191F, 0.7874095408F, 0.7888744965F,
-    0.7903342706F, 0.7917888476F, 0.7932382124F, 0.7946823501F,
-    0.7961212460F, 0.7975548855F, 0.7989832544F, 0.8004063386F,
-    0.8018241244F, 0.8032365981F, 0.8046437463F, 0.8060455560F,
-    0.8074420141F, 0.8088331080F, 0.8102188253F, 0.8115991536F,
-    0.8129740810F, 0.8143435957F, 0.8157076861F, 0.8170663409F,
-    0.8184195489F, 0.8197672994F, 0.8211095817F, 0.8224463853F,
-    0.8237777001F, 0.8251035161F, 0.8264238235F, 0.8277386129F,
-    0.8290478750F, 0.8303516008F, 0.8316497814F, 0.8329424083F,
-    0.8342294731F, 0.8355109677F, 0.8367868841F, 0.8380572148F,
-    0.8393219523F, 0.8405810893F, 0.8418346190F, 0.8430825345F,
-    0.8443248294F, 0.8455614974F, 0.8467925323F, 0.8480179285F,
-    0.8492376802F, 0.8504517822F, 0.8516602292F, 0.8528630164F,
-    0.8540601391F, 0.8552515928F, 0.8564373733F, 0.8576174766F,
-    0.8587918990F, 0.8599606368F, 0.8611236868F, 0.8622810460F,
-    0.8634327113F, 0.8645786802F, 0.8657189504F, 0.8668535195F,
-    0.8679823857F, 0.8691055472F, 0.8702230025F, 0.8713347503F,
-    0.8724407896F, 0.8735411194F, 0.8746357394F, 0.8757246489F,
-    0.8768078479F, 0.8778853364F, 0.8789571146F, 0.8800231832F,
-    0.8810835427F, 0.8821381942F, 0.8831871387F, 0.8842303777F,
-    0.8852679127F, 0.8862997456F, 0.8873258784F, 0.8883463132F,
-    0.8893610527F, 0.8903700994F, 0.8913734562F, 0.8923711263F,
-    0.8933631129F, 0.8943494196F, 0.8953300500F, 0.8963050083F,
-    0.8972742985F, 0.8982379249F, 0.8991958922F, 0.9001482052F,
-    0.9010948688F, 0.9020358883F, 0.9029712690F, 0.9039010165F,
-    0.9048251367F, 0.9057436357F, 0.9066565195F, 0.9075637946F,
-    0.9084654678F, 0.9093615456F, 0.9102520353F, 0.9111369440F,
-    0.9120162792F, 0.9128900484F, 0.9137582595F, 0.9146209204F,
-    0.9154780394F, 0.9163296248F, 0.9171756853F, 0.9180162296F,
-    0.9188512667F, 0.9196808057F, 0.9205048559F, 0.9213234270F,
-    0.9221365285F, 0.9229441704F, 0.9237463629F, 0.9245431160F,
-    0.9253344404F, 0.9261203465F, 0.9269008453F, 0.9276759477F,
-    0.9284456648F, 0.9292100080F, 0.9299689889F, 0.9307226190F,
-    0.9314709103F, 0.9322138747F, 0.9329515245F, 0.9336838721F,
-    0.9344109300F, 0.9351327108F, 0.9358492275F, 0.9365604931F,
-    0.9372665208F, 0.9379673239F, 0.9386629160F, 0.9393533107F,
-    0.9400385220F, 0.9407185637F, 0.9413934501F, 0.9420631954F,
-    0.9427278141F, 0.9433873208F, 0.9440417304F, 0.9446910576F,
-    0.9453353176F, 0.9459745255F, 0.9466086968F, 0.9472378469F,
-    0.9478619915F, 0.9484811463F, 0.9490953274F, 0.9497045506F,
-    0.9503088323F, 0.9509081888F, 0.9515026365F, 0.9520921921F,
-    0.9526768723F, 0.9532566940F, 0.9538316742F, 0.9544018300F,
-    0.9549671786F, 0.9555277375F, 0.9560835241F, 0.9566345562F,
-    0.9571808513F, 0.9577224275F, 0.9582593027F, 0.9587914949F,
-    0.9593190225F, 0.9598419038F, 0.9603601571F, 0.9608738012F,
-    0.9613828546F, 0.9618873361F, 0.9623872646F, 0.9628826591F,
-    0.9633735388F, 0.9638599227F, 0.9643418303F, 0.9648192808F,
-    0.9652922939F, 0.9657608890F, 0.9662250860F, 0.9666849046F,
-    0.9671403646F, 0.9675914861F, 0.9680382891F, 0.9684807937F,
-    0.9689190202F, 0.9693529890F, 0.9697827203F, 0.9702082347F,
-    0.9706295529F, 0.9710466953F, 0.9714596828F, 0.9718685362F,
-    0.9722732762F, 0.9726739240F, 0.9730705005F, 0.9734630267F,
-    0.9738515239F, 0.9742360134F, 0.9746165163F, 0.9749930540F,
-    0.9753656481F, 0.9757343198F, 0.9760990909F, 0.9764599829F,
-    0.9768170175F, 0.9771702164F, 0.9775196013F, 0.9778651941F,
-    0.9782070167F, 0.9785450909F, 0.9788794388F, 0.9792100824F,
-    0.9795370437F, 0.9798603449F, 0.9801800080F, 0.9804960554F,
-    0.9808085092F, 0.9811173916F, 0.9814227251F, 0.9817245318F,
-    0.9820228343F, 0.9823176549F, 0.9826090160F, 0.9828969402F,
-    0.9831814498F, 0.9834625674F, 0.9837403156F, 0.9840147169F,
-    0.9842857939F, 0.9845535692F, 0.9848180654F, 0.9850793052F,
-    0.9853373113F, 0.9855921062F, 0.9858437127F, 0.9860921535F,
-    0.9863374512F, 0.9865796287F, 0.9868187085F, 0.9870547136F,
-    0.9872876664F, 0.9875175899F, 0.9877445067F, 0.9879684396F,
-    0.9881894112F, 0.9884074444F, 0.9886225619F, 0.9888347863F,
-    0.9890441404F, 0.9892506468F, 0.9894543284F, 0.9896552077F,
-    0.9898533074F, 0.9900486502F, 0.9902412587F, 0.9904311555F,
-    0.9906183633F, 0.9908029045F, 0.9909848019F, 0.9911640779F,
-    0.9913407550F, 0.9915148557F, 0.9916864025F, 0.9918554179F,
-    0.9920219241F, 0.9921859437F, 0.9923474989F, 0.9925066120F,
-    0.9926633054F, 0.9928176012F, 0.9929695218F, 0.9931190891F,
-    0.9932663254F, 0.9934112527F, 0.9935538932F, 0.9936942686F,
-    0.9938324012F, 0.9939683126F, 0.9941020248F, 0.9942335597F,
-    0.9943629388F, 0.9944901841F, 0.9946153170F, 0.9947383593F,
-    0.9948593325F, 0.9949782579F, 0.9950951572F, 0.9952100516F,
-    0.9953229625F, 0.9954339111F, 0.9955429186F, 0.9956500062F,
-    0.9957551948F, 0.9958585056F, 0.9959599593F, 0.9960595769F,
-    0.9961573792F, 0.9962533869F, 0.9963476206F, 0.9964401009F,
-    0.9965308483F, 0.9966198833F, 0.9967072261F, 0.9967928971F,
-    0.9968769164F, 0.9969593041F, 0.9970400804F, 0.9971192651F,
-    0.9971968781F, 0.9972729391F, 0.9973474680F, 0.9974204842F,
-    0.9974920074F, 0.9975620569F, 0.9976306521F, 0.9976978122F,
-    0.9977635565F, 0.9978279039F, 0.9978908736F, 0.9979524842F,
-    0.9980127547F, 0.9980717037F, 0.9981293499F, 0.9981857116F,
-    0.9982408073F, 0.9982946554F, 0.9983472739F, 0.9983986810F,
-    0.9984488947F, 0.9984979328F, 0.9985458132F, 0.9985925534F,
-    0.9986381711F, 0.9986826838F, 0.9987261086F, 0.9987684630F,
-    0.9988097640F, 0.9988500286F, 0.9988892738F, 0.9989275163F,
-    0.9989647727F, 0.9990010597F, 0.9990363938F, 0.9990707911F,
-    0.9991042679F, 0.9991368404F, 0.9991685244F, 0.9991993358F,
-    0.9992292905F, 0.9992584038F, 0.9992866914F, 0.9993141686F,
-    0.9993408506F, 0.9993667526F, 0.9993918895F, 0.9994162761F,
-    0.9994399273F, 0.9994628576F, 0.9994850815F, 0.9995066133F,
-    0.9995274672F, 0.9995476574F, 0.9995671978F, 0.9995861021F,
-    0.9996043841F, 0.9996220573F, 0.9996391352F, 0.9996556310F,
-    0.9996715579F, 0.9996869288F, 0.9997017568F, 0.9997160543F,
-    0.9997298342F, 0.9997431088F, 0.9997558905F, 0.9997681914F,
-    0.9997800236F, 0.9997913990F, 0.9998023292F, 0.9998128261F,
-    0.9998229009F, 0.9998325650F, 0.9998418296F, 0.9998507058F,
-    0.9998592044F, 0.9998673362F, 0.9998751117F, 0.9998825415F,
-    0.9998896358F, 0.9998964047F, 0.9999028584F, 0.9999090066F,
-    0.9999148590F, 0.9999204253F, 0.9999257148F, 0.9999307368F,
-    0.9999355003F, 0.9999400144F, 0.9999442878F, 0.9999483293F,
-    0.9999521472F, 0.9999557499F, 0.9999591457F, 0.9999623426F,
-    0.9999653483F, 0.9999681708F, 0.9999708175F, 0.9999732959F,
-    0.9999756132F, 0.9999777765F, 0.9999797928F, 0.9999816688F,
-    0.9999834113F, 0.9999850266F, 0.9999865211F, 0.9999879009F,
-    0.9999891721F, 0.9999903405F, 0.9999914118F, 0.9999923914F,
-    0.9999932849F, 0.9999940972F, 0.9999948336F, 0.9999954989F,
-    0.9999960978F, 0.9999966349F, 0.9999971146F, 0.9999975411F,
-    0.9999979185F, 0.9999982507F, 0.9999985414F, 0.9999987944F,
-    0.9999990129F, 0.9999992003F, 0.9999993596F, 0.9999994939F,
-    0.9999996059F, 0.9999996981F, 0.9999997732F, 0.9999998333F,
-    0.9999998805F, 0.9999999170F, 0.9999999444F, 0.9999999643F,
-    0.9999999784F, 0.9999999878F, 0.9999999937F, 0.9999999972F,
-    0.9999999990F, 0.9999999997F, 1.0000000000F, 1.0000000000F,
-};
-
-DECLARE_ALIGNED(16, static const float, vwin4096)[2048] = {
-    0.0000002310F, 0.0000020791F, 0.0000057754F, 0.0000113197F,
-    0.0000187121F, 0.0000279526F, 0.0000390412F, 0.0000519777F,
-    0.0000667623F, 0.0000833949F, 0.0001018753F, 0.0001222036F,
-    0.0001443798F, 0.0001684037F, 0.0001942754F, 0.0002219947F,
-    0.0002515616F, 0.0002829761F, 0.0003162380F, 0.0003513472F,
-    0.0003883038F, 0.0004271076F, 0.0004677584F, 0.0005102563F,
-    0.0005546011F, 0.0006007928F, 0.0006488311F, 0.0006987160F,
-    0.0007504474F, 0.0008040251F, 0.0008594490F, 0.0009167191F,
-    0.0009758351F, 0.0010367969F, 0.0010996044F, 0.0011642574F,
-    0.0012307558F, 0.0012990994F, 0.0013692880F, 0.0014413216F,
-    0.0015151998F, 0.0015909226F, 0.0016684898F, 0.0017479011F,
-    0.0018291565F, 0.0019122556F, 0.0019971983F, 0.0020839845F,
-    0.0021726138F, 0.0022630861F, 0.0023554012F, 0.0024495588F,
-    0.0025455588F, 0.0026434008F, 0.0027430847F, 0.0028446103F,
-    0.0029479772F, 0.0030531853F, 0.0031602342F, 0.0032691238F,
-    0.0033798538F, 0.0034924239F, 0.0036068338F, 0.0037230833F,
-    0.0038411721F, 0.0039610999F, 0.0040828664F, 0.0042064714F,
-    0.0043319145F, 0.0044591954F, 0.0045883139F, 0.0047192696F,
-    0.0048520622F, 0.0049866914F, 0.0051231569F, 0.0052614583F,
-    0.0054015953F, 0.0055435676F, 0.0056873748F, 0.0058330166F,
-    0.0059804926F, 0.0061298026F, 0.0062809460F, 0.0064339226F,
-    0.0065887320F, 0.0067453738F, 0.0069038476F, 0.0070641531F,
-    0.0072262899F, 0.0073902575F, 0.0075560556F, 0.0077236838F,
-    0.0078931417F, 0.0080644288F, 0.0082375447F, 0.0084124891F,
-    0.0085892615F, 0.0087678614F, 0.0089482885F, 0.0091305422F,
-    0.0093146223F, 0.0095005281F, 0.0096882592F, 0.0098778153F,
-    0.0100691958F, 0.0102624002F, 0.0104574281F, 0.0106542791F,
-    0.0108529525F, 0.0110534480F, 0.0112557651F, 0.0114599032F,
-    0.0116658618F, 0.0118736405F, 0.0120832387F, 0.0122946560F,
-    0.0125078917F, 0.0127229454F, 0.0129398166F, 0.0131585046F,
-    0.0133790090F, 0.0136013292F, 0.0138254647F, 0.0140514149F,
-    0.0142791792F, 0.0145087572F, 0.0147401481F, 0.0149733515F,
-    0.0152083667F, 0.0154451932F, 0.0156838304F, 0.0159242777F,
-    0.0161665345F, 0.0164106001F, 0.0166564741F, 0.0169041557F,
-    0.0171536443F, 0.0174049393F, 0.0176580401F, 0.0179129461F,
-    0.0181696565F, 0.0184281708F, 0.0186884883F, 0.0189506084F,
-    0.0192145303F, 0.0194802535F, 0.0197477772F, 0.0200171008F,
-    0.0202882236F, 0.0205611449F, 0.0208358639F, 0.0211123801F,
-    0.0213906927F, 0.0216708011F, 0.0219527043F, 0.0222364019F,
-    0.0225218930F, 0.0228091769F, 0.0230982529F, 0.0233891203F,
-    0.0236817782F, 0.0239762259F, 0.0242724628F, 0.0245704880F,
-    0.0248703007F, 0.0251719002F, 0.0254752858F, 0.0257804565F,
-    0.0260874117F, 0.0263961506F, 0.0267066722F, 0.0270189760F,
-    0.0273330609F, 0.0276489263F, 0.0279665712F, 0.0282859949F,
-    0.0286071966F, 0.0289301753F, 0.0292549303F, 0.0295814607F,
-    0.0299097656F, 0.0302398442F, 0.0305716957F, 0.0309053191F,
-    0.0312407135F, 0.0315778782F, 0.0319168122F, 0.0322575145F,
-    0.0325999844F, 0.0329442209F, 0.0332902231F, 0.0336379900F,
-    0.0339875208F, 0.0343388146F, 0.0346918703F, 0.0350466871F,
-    0.0354032640F, 0.0357616000F, 0.0361216943F, 0.0364835458F,
-    0.0368471535F, 0.0372125166F, 0.0375796339F, 0.0379485046F,
-    0.0383191276F, 0.0386915020F, 0.0390656267F, 0.0394415008F,
-    0.0398191231F, 0.0401984927F, 0.0405796086F, 0.0409624698F,
-    0.0413470751F, 0.0417334235F, 0.0421215141F, 0.0425113457F,
-    0.0429029172F, 0.0432962277F, 0.0436912760F, 0.0440880610F,
-    0.0444865817F, 0.0448868370F, 0.0452888257F, 0.0456925468F,
-    0.0460979992F, 0.0465051816F, 0.0469140931F, 0.0473247325F,
-    0.0477370986F, 0.0481511902F, 0.0485670064F, 0.0489845458F,
-    0.0494038074F, 0.0498247899F, 0.0502474922F, 0.0506719131F,
-    0.0510980514F, 0.0515259060F, 0.0519554756F, 0.0523867590F,
-    0.0528197550F, 0.0532544624F, 0.0536908800F, 0.0541290066F,
-    0.0545688408F, 0.0550103815F, 0.0554536274F, 0.0558985772F,
-    0.0563452297F, 0.0567935837F, 0.0572436377F, 0.0576953907F,
-    0.0581488412F, 0.0586039880F, 0.0590608297F, 0.0595193651F,
-    0.0599795929F, 0.0604415117F, 0.0609051202F, 0.0613704170F,
-    0.0618374009F, 0.0623060704F, 0.0627764243F, 0.0632484611F,
-    0.0637221795F, 0.0641975781F, 0.0646746555F, 0.0651534104F,
-    0.0656338413F, 0.0661159469F, 0.0665997257F, 0.0670851763F,
-    0.0675722973F, 0.0680610873F, 0.0685515448F, 0.0690436684F,
-    0.0695374567F, 0.0700329081F, 0.0705300213F, 0.0710287947F,
-    0.0715292269F, 0.0720313163F, 0.0725350616F, 0.0730404612F,
-    0.0735475136F, 0.0740562172F, 0.0745665707F, 0.0750785723F,
-    0.0755922207F, 0.0761075143F, 0.0766244515F, 0.0771430307F,
-    0.0776632505F, 0.0781851092F, 0.0787086052F, 0.0792337371F,
-    0.0797605032F, 0.0802889018F, 0.0808189315F, 0.0813505905F,
-    0.0818838773F, 0.0824187903F, 0.0829553277F, 0.0834934881F,
-    0.0840332697F, 0.0845746708F, 0.0851176899F, 0.0856623252F,
-    0.0862085751F, 0.0867564379F, 0.0873059119F, 0.0878569954F,
-    0.0884096867F, 0.0889639840F, 0.0895198858F, 0.0900773902F,
-    0.0906364955F, 0.0911972000F, 0.0917595019F, 0.0923233995F,
-    0.0928888909F, 0.0934559745F, 0.0940246485F, 0.0945949110F,
-    0.0951667604F, 0.0957401946F, 0.0963152121F, 0.0968918109F,
-    0.0974699893F, 0.0980497454F, 0.0986310773F, 0.0992139832F,
-    0.0997984614F, 0.1003845098F, 0.1009721267F, 0.1015613101F,
-    0.1021520582F, 0.1027443692F, 0.1033382410F, 0.1039336718F,
-    0.1045306597F, 0.1051292027F, 0.1057292990F, 0.1063309466F,
-    0.1069341435F, 0.1075388878F, 0.1081451776F, 0.1087530108F,
-    0.1093623856F, 0.1099732998F, 0.1105857516F, 0.1111997389F,
-    0.1118152597F, 0.1124323121F, 0.1130508939F, 0.1136710032F,
-    0.1142926379F, 0.1149157960F, 0.1155404755F, 0.1161666742F,
-    0.1167943901F, 0.1174236211F, 0.1180543652F, 0.1186866202F,
-    0.1193203841F, 0.1199556548F, 0.1205924300F, 0.1212307078F,
-    0.1218704860F, 0.1225117624F, 0.1231545349F, 0.1237988013F,
-    0.1244445596F, 0.1250918074F, 0.1257405427F, 0.1263907632F,
-    0.1270424667F, 0.1276956512F, 0.1283503142F, 0.1290064537F,
-    0.1296640674F, 0.1303231530F, 0.1309837084F, 0.1316457312F,
-    0.1323092193F, 0.1329741703F, 0.1336405820F, 0.1343084520F,
-    0.1349777782F, 0.1356485582F, 0.1363207897F, 0.1369944704F,
-    0.1376695979F, 0.1383461700F, 0.1390241842F, 0.1397036384F,
-    0.1403845300F, 0.1410668567F, 0.1417506162F, 0.1424358061F,
-    0.1431224240F, 0.1438104674F, 0.1444999341F, 0.1451908216F,
-    0.1458831274F, 0.1465768492F, 0.1472719844F, 0.1479685308F,
-    0.1486664857F, 0.1493658468F, 0.1500666115F, 0.1507687775F,
-    0.1514723422F, 0.1521773031F, 0.1528836577F, 0.1535914035F,
-    0.1543005380F, 0.1550110587F, 0.1557229631F, 0.1564362485F,
-    0.1571509124F, 0.1578669524F, 0.1585843657F, 0.1593031499F,
-    0.1600233024F, 0.1607448205F, 0.1614677017F, 0.1621919433F,
-    0.1629175428F, 0.1636444975F, 0.1643728047F, 0.1651024619F,
-    0.1658334665F, 0.1665658156F, 0.1672995067F, 0.1680345371F,
-    0.1687709041F, 0.1695086050F, 0.1702476372F, 0.1709879978F,
-    0.1717296843F, 0.1724726938F, 0.1732170237F, 0.1739626711F,
-    0.1747096335F, 0.1754579079F, 0.1762074916F, 0.1769583819F,
-    0.1777105760F, 0.1784640710F, 0.1792188642F, 0.1799749529F,
-    0.1807323340F, 0.1814910049F, 0.1822509628F, 0.1830122046F,
-    0.1837747277F, 0.1845385292F, 0.1853036062F, 0.1860699558F,
-    0.1868375751F, 0.1876064613F, 0.1883766114F, 0.1891480226F,
-    0.1899206919F, 0.1906946164F, 0.1914697932F, 0.1922462194F,
-    0.1930238919F, 0.1938028079F, 0.1945829643F, 0.1953643583F,
-    0.1961469868F, 0.1969308468F, 0.1977159353F, 0.1985022494F,
-    0.1992897859F, 0.2000785420F, 0.2008685145F, 0.2016597005F,
-    0.2024520968F, 0.2032457005F, 0.2040405084F, 0.2048365175F,
-    0.2056337247F, 0.2064321269F, 0.2072317211F, 0.2080325041F,
-    0.2088344727F, 0.2096376240F, 0.2104419547F, 0.2112474618F,
-    0.2120541420F, 0.2128619923F, 0.2136710094F, 0.2144811902F,
-    0.2152925315F, 0.2161050301F, 0.2169186829F, 0.2177334866F,
-    0.2185494381F, 0.2193665340F, 0.2201847712F, 0.2210041465F,
-    0.2218246565F, 0.2226462981F, 0.2234690680F, 0.2242929629F,
-    0.2251179796F, 0.2259441147F, 0.2267713650F, 0.2275997272F,
-    0.2284291979F, 0.2292597739F, 0.2300914518F, 0.2309242283F,
-    0.2317581001F, 0.2325930638F, 0.2334291160F, 0.2342662534F,
-    0.2351044727F, 0.2359437703F, 0.2367841431F, 0.2376255875F,
-    0.2384681001F, 0.2393116776F, 0.2401563165F, 0.2410020134F,
-    0.2418487649F, 0.2426965675F, 0.2435454178F, 0.2443953122F,
-    0.2452462474F, 0.2460982199F, 0.2469512262F, 0.2478052628F,
-    0.2486603262F, 0.2495164129F, 0.2503735194F, 0.2512316421F,
-    0.2520907776F, 0.2529509222F, 0.2538120726F, 0.2546742250F,
-    0.2555373760F, 0.2564015219F, 0.2572666593F, 0.2581327845F,
-    0.2589998939F, 0.2598679840F, 0.2607370510F, 0.2616070916F,
-    0.2624781019F, 0.2633500783F, 0.2642230173F, 0.2650969152F,
-    0.2659717684F, 0.2668475731F, 0.2677243257F, 0.2686020226F,
-    0.2694806601F, 0.2703602344F, 0.2712407419F, 0.2721221789F,
-    0.2730045417F, 0.2738878265F, 0.2747720297F, 0.2756571474F,
-    0.2765431760F, 0.2774301117F, 0.2783179508F, 0.2792066895F,
-    0.2800963240F, 0.2809868505F, 0.2818782654F, 0.2827705647F,
-    0.2836637447F, 0.2845578016F, 0.2854527315F, 0.2863485307F,
-    0.2872451953F, 0.2881427215F, 0.2890411055F, 0.2899403433F,
-    0.2908404312F, 0.2917413654F, 0.2926431418F, 0.2935457567F,
-    0.2944492061F, 0.2953534863F, 0.2962585932F, 0.2971645230F,
-    0.2980712717F, 0.2989788356F, 0.2998872105F, 0.3007963927F,
-    0.3017063781F, 0.3026171629F, 0.3035287430F, 0.3044411145F,
-    0.3053542736F, 0.3062682161F, 0.3071829381F, 0.3080984356F,
-    0.3090147047F, 0.3099317413F, 0.3108495414F, 0.3117681011F,
-    0.3126874163F, 0.3136074830F, 0.3145282972F, 0.3154498548F,
-    0.3163721517F, 0.3172951841F, 0.3182189477F, 0.3191434385F,
-    0.3200686525F, 0.3209945856F, 0.3219212336F, 0.3228485927F,
-    0.3237766585F, 0.3247054271F, 0.3256348943F, 0.3265650560F,
-    0.3274959081F, 0.3284274465F, 0.3293596671F, 0.3302925657F,
-    0.3312261382F, 0.3321603804F, 0.3330952882F, 0.3340308574F,
-    0.3349670838F, 0.3359039634F, 0.3368414919F, 0.3377796651F,
-    0.3387184789F, 0.3396579290F, 0.3405980113F, 0.3415387216F,
-    0.3424800556F, 0.3434220091F, 0.3443645779F, 0.3453077578F,
-    0.3462515446F, 0.3471959340F, 0.3481409217F, 0.3490865036F,
-    0.3500326754F, 0.3509794328F, 0.3519267715F, 0.3528746873F,
-    0.3538231759F, 0.3547722330F, 0.3557218544F, 0.3566720357F,
-    0.3576227727F, 0.3585740610F, 0.3595258964F, 0.3604782745F,
-    0.3614311910F, 0.3623846417F, 0.3633386221F, 0.3642931280F,
-    0.3652481549F, 0.3662036987F, 0.3671597548F, 0.3681163191F,
-    0.3690733870F, 0.3700309544F, 0.3709890167F, 0.3719475696F,
-    0.3729066089F, 0.3738661299F, 0.3748261285F, 0.3757866002F,
-    0.3767475406F, 0.3777089453F, 0.3786708100F, 0.3796331302F,
-    0.3805959014F, 0.3815591194F, 0.3825227796F, 0.3834868777F,
-    0.3844514093F, 0.3854163698F, 0.3863817549F, 0.3873475601F,
-    0.3883137810F, 0.3892804131F, 0.3902474521F, 0.3912148933F,
-    0.3921827325F, 0.3931509650F, 0.3941195865F, 0.3950885925F,
-    0.3960579785F, 0.3970277400F, 0.3979978725F, 0.3989683716F,
-    0.3999392328F, 0.4009104516F, 0.4018820234F, 0.4028539438F,
-    0.4038262084F, 0.4047988125F, 0.4057717516F, 0.4067450214F,
-    0.4077186172F, 0.4086925345F, 0.4096667688F, 0.4106413155F,
-    0.4116161703F, 0.4125913284F, 0.4135667854F, 0.4145425368F,
-    0.4155185780F, 0.4164949044F, 0.4174715116F, 0.4184483949F,
-    0.4194255498F, 0.4204029718F, 0.4213806563F, 0.4223585987F,
-    0.4233367946F, 0.4243152392F, 0.4252939281F, 0.4262728566F,
-    0.4272520202F, 0.4282314144F, 0.4292110345F, 0.4301908760F,
-    0.4311709343F, 0.4321512047F, 0.4331316828F, 0.4341123639F,
-    0.4350932435F, 0.4360743168F, 0.4370555794F, 0.4380370267F,
-    0.4390186540F, 0.4400004567F, 0.4409824303F, 0.4419645701F,
-    0.4429468716F, 0.4439293300F, 0.4449119409F, 0.4458946996F,
-    0.4468776014F, 0.4478606418F, 0.4488438162F, 0.4498271199F,
-    0.4508105483F, 0.4517940967F, 0.4527777607F, 0.4537615355F,
-    0.4547454165F, 0.4557293991F, 0.4567134786F, 0.4576976505F,
-    0.4586819101F, 0.4596662527F, 0.4606506738F, 0.4616351687F,
-    0.4626197328F, 0.4636043614F, 0.4645890499F, 0.4655737936F,
-    0.4665585880F, 0.4675434284F, 0.4685283101F, 0.4695132286F,
-    0.4704981791F, 0.4714831570F, 0.4724681577F, 0.4734531766F,
-    0.4744382089F, 0.4754232501F, 0.4764082956F, 0.4773933406F,
-    0.4783783806F, 0.4793634108F, 0.4803484267F, 0.4813334237F,
-    0.4823183969F, 0.4833033419F, 0.4842882540F, 0.4852731285F,
-    0.4862579608F, 0.4872427462F, 0.4882274802F, 0.4892121580F,
-    0.4901967751F, 0.4911813267F, 0.4921658083F, 0.4931502151F,
-    0.4941345427F, 0.4951187863F, 0.4961029412F, 0.4970870029F,
-    0.4980709667F, 0.4990548280F, 0.5000385822F, 0.5010222245F,
-    0.5020057505F, 0.5029891553F, 0.5039724345F, 0.5049555834F,
-    0.5059385973F, 0.5069214716F, 0.5079042018F, 0.5088867831F,
-    0.5098692110F, 0.5108514808F, 0.5118335879F, 0.5128155277F,
-    0.5137972956F, 0.5147788869F, 0.5157602971F, 0.5167415215F,
-    0.5177225555F, 0.5187033945F, 0.5196840339F, 0.5206644692F,
-    0.5216446956F, 0.5226247086F, 0.5236045035F, 0.5245840759F,
-    0.5255634211F, 0.5265425344F, 0.5275214114F, 0.5285000474F,
-    0.5294784378F, 0.5304565781F, 0.5314344637F, 0.5324120899F,
-    0.5333894522F, 0.5343665461F, 0.5353433670F, 0.5363199102F,
-    0.5372961713F, 0.5382721457F, 0.5392478287F, 0.5402232159F,
-    0.5411983027F, 0.5421730845F, 0.5431475569F, 0.5441217151F,
-    0.5450955548F, 0.5460690714F, 0.5470422602F, 0.5480151169F,
-    0.5489876368F, 0.5499598155F, 0.5509316484F, 0.5519031310F,
-    0.5528742587F, 0.5538450271F, 0.5548154317F, 0.5557854680F,
-    0.5567551314F, 0.5577244174F, 0.5586933216F, 0.5596618395F,
-    0.5606299665F, 0.5615976983F, 0.5625650302F, 0.5635319580F,
-    0.5644984770F, 0.5654645828F, 0.5664302709F, 0.5673955370F,
-    0.5683603765F, 0.5693247850F, 0.5702887580F, 0.5712522912F,
-    0.5722153800F, 0.5731780200F, 0.5741402069F, 0.5751019362F,
-    0.5760632034F, 0.5770240042F, 0.5779843341F, 0.5789441889F,
-    0.5799035639F, 0.5808624549F, 0.5818208575F, 0.5827787673F,
-    0.5837361800F, 0.5846930910F, 0.5856494961F, 0.5866053910F,
-    0.5875607712F, 0.5885156324F, 0.5894699703F, 0.5904237804F,
-    0.5913770586F, 0.5923298004F, 0.5932820016F, 0.5942336578F,
-    0.5951847646F, 0.5961353179F, 0.5970853132F, 0.5980347464F,
-    0.5989836131F, 0.5999319090F, 0.6008796298F, 0.6018267713F,
-    0.6027733292F, 0.6037192993F, 0.6046646773F, 0.6056094589F,
-    0.6065536400F, 0.6074972162F, 0.6084401833F, 0.6093825372F,
-    0.6103242736F, 0.6112653884F, 0.6122058772F, 0.6131457359F,
-    0.6140849604F, 0.6150235464F, 0.6159614897F, 0.6168987862F,
-    0.6178354318F, 0.6187714223F, 0.6197067535F, 0.6206414213F,
-    0.6215754215F, 0.6225087501F, 0.6234414028F, 0.6243733757F,
-    0.6253046646F, 0.6262352654F, 0.6271651739F, 0.6280943862F,
-    0.6290228982F, 0.6299507057F, 0.6308778048F, 0.6318041913F,
-    0.6327298612F, 0.6336548105F, 0.6345790352F, 0.6355025312F,
-    0.6364252945F, 0.6373473211F, 0.6382686070F, 0.6391891483F,
-    0.6401089409F, 0.6410279808F, 0.6419462642F, 0.6428637869F,
-    0.6437805452F, 0.6446965350F, 0.6456117524F, 0.6465261935F,
-    0.6474398544F, 0.6483527311F, 0.6492648197F, 0.6501761165F,
-    0.6510866174F, 0.6519963186F, 0.6529052162F, 0.6538133064F,
-    0.6547205854F, 0.6556270492F, 0.6565326941F, 0.6574375162F,
-    0.6583415117F, 0.6592446769F, 0.6601470079F, 0.6610485009F,
-    0.6619491521F, 0.6628489578F, 0.6637479143F, 0.6646460177F,
-    0.6655432643F, 0.6664396505F, 0.6673351724F, 0.6682298264F,
-    0.6691236087F, 0.6700165157F, 0.6709085436F, 0.6717996889F,
-    0.6726899478F, 0.6735793167F, 0.6744677918F, 0.6753553697F,
-    0.6762420466F, 0.6771278190F, 0.6780126832F, 0.6788966357F,
-    0.6797796728F, 0.6806617909F, 0.6815429866F, 0.6824232562F,
-    0.6833025961F, 0.6841810030F, 0.6850584731F, 0.6859350031F,
-    0.6868105894F, 0.6876852284F, 0.6885589168F, 0.6894316510F,
-    0.6903034275F, 0.6911742430F, 0.6920440939F, 0.6929129769F,
-    0.6937808884F, 0.6946478251F, 0.6955137837F, 0.6963787606F,
-    0.6972427525F, 0.6981057560F, 0.6989677678F, 0.6998287845F,
-    0.7006888028F, 0.7015478194F, 0.7024058309F, 0.7032628340F,
-    0.7041188254F, 0.7049738019F, 0.7058277601F, 0.7066806969F,
-    0.7075326089F, 0.7083834929F, 0.7092333457F, 0.7100821640F,
-    0.7109299447F, 0.7117766846F, 0.7126223804F, 0.7134670291F,
-    0.7143106273F, 0.7151531721F, 0.7159946602F, 0.7168350885F,
-    0.7176744539F, 0.7185127534F, 0.7193499837F, 0.7201861418F,
-    0.7210212247F, 0.7218552293F, 0.7226881526F, 0.7235199914F,
-    0.7243507428F, 0.7251804039F, 0.7260089715F, 0.7268364426F,
-    0.7276628144F, 0.7284880839F, 0.7293122481F, 0.7301353040F,
-    0.7309572487F, 0.7317780794F, 0.7325977930F, 0.7334163868F,
-    0.7342338579F, 0.7350502033F, 0.7358654202F, 0.7366795059F,
-    0.7374924573F, 0.7383042718F, 0.7391149465F, 0.7399244787F,
-    0.7407328655F, 0.7415401041F, 0.7423461920F, 0.7431511261F,
-    0.7439549040F, 0.7447575227F, 0.7455589797F, 0.7463592723F,
-    0.7471583976F, 0.7479563532F, 0.7487531363F, 0.7495487443F,
-    0.7503431745F, 0.7511364244F, 0.7519284913F, 0.7527193726F,
-    0.7535090658F, 0.7542975683F, 0.7550848776F, 0.7558709910F,
-    0.7566559062F, 0.7574396205F, 0.7582221314F, 0.7590034366F,
-    0.7597835334F, 0.7605624194F, 0.7613400923F, 0.7621165495F,
-    0.7628917886F, 0.7636658072F, 0.7644386030F, 0.7652101735F,
-    0.7659805164F, 0.7667496292F, 0.7675175098F, 0.7682841556F,
-    0.7690495645F, 0.7698137341F, 0.7705766622F, 0.7713383463F,
-    0.7720987844F, 0.7728579741F, 0.7736159132F, 0.7743725994F,
-    0.7751280306F, 0.7758822046F, 0.7766351192F, 0.7773867722F,
-    0.7781371614F, 0.7788862848F, 0.7796341401F, 0.7803807253F,
-    0.7811260383F, 0.7818700769F, 0.7826128392F, 0.7833543230F,
-    0.7840945263F, 0.7848334471F, 0.7855710833F, 0.7863074330F,
-    0.7870424941F, 0.7877762647F, 0.7885087428F, 0.7892399264F,
-    0.7899698137F, 0.7906984026F, 0.7914256914F, 0.7921516780F,
-    0.7928763607F, 0.7935997375F, 0.7943218065F, 0.7950425661F,
-    0.7957620142F, 0.7964801492F, 0.7971969692F, 0.7979124724F,
-    0.7986266570F, 0.7993395214F, 0.8000510638F, 0.8007612823F,
-    0.8014701754F, 0.8021777413F, 0.8028839784F, 0.8035888849F,
-    0.8042924592F, 0.8049946997F, 0.8056956048F, 0.8063951727F,
-    0.8070934020F, 0.8077902910F, 0.8084858381F, 0.8091800419F,
-    0.8098729007F, 0.8105644130F, 0.8112545774F, 0.8119433922F,
-    0.8126308561F, 0.8133169676F, 0.8140017251F, 0.8146851272F,
-    0.8153671726F, 0.8160478598F, 0.8167271874F, 0.8174051539F,
-    0.8180817582F, 0.8187569986F, 0.8194308741F, 0.8201033831F,
-    0.8207745244F, 0.8214442966F, 0.8221126986F, 0.8227797290F,
-    0.8234453865F, 0.8241096700F, 0.8247725781F, 0.8254341097F,
-    0.8260942636F, 0.8267530385F, 0.8274104334F, 0.8280664470F,
-    0.8287210782F, 0.8293743259F, 0.8300261889F, 0.8306766662F,
-    0.8313257566F, 0.8319734591F, 0.8326197727F, 0.8332646963F,
-    0.8339082288F, 0.8345503692F, 0.8351911167F, 0.8358304700F,
-    0.8364684284F, 0.8371049907F, 0.8377401562F, 0.8383739238F,
-    0.8390062927F, 0.8396372618F, 0.8402668305F, 0.8408949977F,
-    0.8415217626F, 0.8421471245F, 0.8427710823F, 0.8433936354F,
-    0.8440147830F, 0.8446345242F, 0.8452528582F, 0.8458697844F,
-    0.8464853020F, 0.8470994102F, 0.8477121084F, 0.8483233958F,
-    0.8489332718F, 0.8495417356F, 0.8501487866F, 0.8507544243F,
-    0.8513586479F, 0.8519614568F, 0.8525628505F, 0.8531628283F,
-    0.8537613897F, 0.8543585341F, 0.8549542611F, 0.8555485699F,
-    0.8561414603F, 0.8567329315F, 0.8573229832F, 0.8579116149F,
-    0.8584988262F, 0.8590846165F, 0.8596689855F, 0.8602519327F,
-    0.8608334577F, 0.8614135603F, 0.8619922399F, 0.8625694962F,
-    0.8631453289F, 0.8637197377F, 0.8642927222F, 0.8648642821F,
-    0.8654344172F, 0.8660031272F, 0.8665704118F, 0.8671362708F,
-    0.8677007039F, 0.8682637109F, 0.8688252917F, 0.8693854460F,
-    0.8699441737F, 0.8705014745F, 0.8710573485F, 0.8716117953F,
-    0.8721648150F, 0.8727164073F, 0.8732665723F, 0.8738153098F,
-    0.8743626197F, 0.8749085021F, 0.8754529569F, 0.8759959840F,
-    0.8765375835F, 0.8770777553F, 0.8776164996F, 0.8781538162F,
-    0.8786897054F, 0.8792241670F, 0.8797572013F, 0.8802888082F,
-    0.8808189880F, 0.8813477407F, 0.8818750664F, 0.8824009653F,
-    0.8829254375F, 0.8834484833F, 0.8839701028F, 0.8844902961F,
-    0.8850090636F, 0.8855264054F, 0.8860423218F, 0.8865568131F,
-    0.8870698794F, 0.8875815212F, 0.8880917386F, 0.8886005319F,
-    0.8891079016F, 0.8896138479F, 0.8901183712F, 0.8906214719F,
-    0.8911231503F, 0.8916234067F, 0.8921222417F, 0.8926196556F,
-    0.8931156489F, 0.8936102219F, 0.8941033752F, 0.8945951092F,
-    0.8950854244F, 0.8955743212F, 0.8960618003F, 0.8965478621F,
-    0.8970325071F, 0.8975157359F, 0.8979975490F, 0.8984779471F,
-    0.8989569307F, 0.8994345004F, 0.8999106568F, 0.9003854005F,
-    0.9008587323F, 0.9013306526F, 0.9018011623F, 0.9022702619F,
-    0.9027379521F, 0.9032042337F, 0.9036691074F, 0.9041325739F,
-    0.9045946339F, 0.9050552882F, 0.9055145376F, 0.9059723828F,
-    0.9064288246F, 0.9068838638F, 0.9073375013F, 0.9077897379F,
-    0.9082405743F, 0.9086900115F, 0.9091380503F, 0.9095846917F,
-    0.9100299364F, 0.9104737854F, 0.9109162397F, 0.9113573001F,
-    0.9117969675F, 0.9122352430F, 0.9126721275F, 0.9131076219F,
-    0.9135417273F, 0.9139744447F, 0.9144057750F, 0.9148357194F,
-    0.9152642787F, 0.9156914542F, 0.9161172468F, 0.9165416576F,
-    0.9169646877F, 0.9173863382F, 0.9178066102F, 0.9182255048F,
-    0.9186430232F, 0.9190591665F, 0.9194739359F, 0.9198873324F,
-    0.9202993574F, 0.9207100120F, 0.9211192973F, 0.9215272147F,
-    0.9219337653F, 0.9223389504F, 0.9227427713F, 0.9231452290F,
-    0.9235463251F, 0.9239460607F, 0.9243444371F, 0.9247414557F,
-    0.9251371177F, 0.9255314245F, 0.9259243774F, 0.9263159778F,
-    0.9267062270F, 0.9270951264F, 0.9274826774F, 0.9278688814F,
-    0.9282537398F, 0.9286372540F, 0.9290194254F, 0.9294002555F,
-    0.9297797458F, 0.9301578976F, 0.9305347125F, 0.9309101919F,
-    0.9312843373F, 0.9316571503F, 0.9320286323F, 0.9323987849F,
-    0.9327676097F, 0.9331351080F, 0.9335012816F, 0.9338661320F,
-    0.9342296607F, 0.9345918694F, 0.9349527596F, 0.9353123330F,
-    0.9356705911F, 0.9360275357F, 0.9363831683F, 0.9367374905F,
-    0.9370905042F, 0.9374422108F, 0.9377926122F, 0.9381417099F,
-    0.9384895057F, 0.9388360014F, 0.9391811985F, 0.9395250989F,
-    0.9398677043F, 0.9402090165F, 0.9405490371F, 0.9408877680F,
-    0.9412252110F, 0.9415613678F, 0.9418962402F, 0.9422298301F,
-    0.9425621392F, 0.9428931695F, 0.9432229226F, 0.9435514005F,
-    0.9438786050F, 0.9442045381F, 0.9445292014F, 0.9448525971F,
-    0.9451747268F, 0.9454955926F, 0.9458151963F, 0.9461335399F,
-    0.9464506253F, 0.9467664545F, 0.9470810293F, 0.9473943517F,
-    0.9477064238F, 0.9480172474F, 0.9483268246F, 0.9486351573F,
-    0.9489422475F, 0.9492480973F, 0.9495527087F, 0.9498560837F,
-    0.9501582243F, 0.9504591325F, 0.9507588105F, 0.9510572603F,
-    0.9513544839F, 0.9516504834F, 0.9519452609F, 0.9522388186F,
-    0.9525311584F, 0.9528222826F, 0.9531121932F, 0.9534008923F,
-    0.9536883821F, 0.9539746647F, 0.9542597424F, 0.9545436171F,
-    0.9548262912F, 0.9551077667F, 0.9553880459F, 0.9556671309F,
-    0.9559450239F, 0.9562217272F, 0.9564972429F, 0.9567715733F,
-    0.9570447206F, 0.9573166871F, 0.9575874749F, 0.9578570863F,
-    0.9581255236F, 0.9583927890F, 0.9586588849F, 0.9589238134F,
-    0.9591875769F, 0.9594501777F, 0.9597116180F, 0.9599719003F,
-    0.9602310267F, 0.9604889995F, 0.9607458213F, 0.9610014942F,
-    0.9612560206F, 0.9615094028F, 0.9617616433F, 0.9620127443F,
-    0.9622627083F, 0.9625115376F, 0.9627592345F, 0.9630058016F,
-    0.9632512411F, 0.9634955555F, 0.9637387471F, 0.9639808185F,
-    0.9642217720F, 0.9644616100F, 0.9647003349F, 0.9649379493F,
-    0.9651744556F, 0.9654098561F, 0.9656441534F, 0.9658773499F,
-    0.9661094480F, 0.9663404504F, 0.9665703593F, 0.9667991774F,
-    0.9670269071F, 0.9672535509F, 0.9674791114F, 0.9677035909F,
-    0.9679269921F, 0.9681493174F, 0.9683705694F, 0.9685907506F,
-    0.9688098636F, 0.9690279108F, 0.9692448948F, 0.9694608182F,
-    0.9696756836F, 0.9698894934F, 0.9701022503F, 0.9703139569F,
-    0.9705246156F, 0.9707342291F, 0.9709428000F, 0.9711503309F,
-    0.9713568243F, 0.9715622829F, 0.9717667093F, 0.9719701060F,
-    0.9721724757F, 0.9723738210F, 0.9725741446F, 0.9727734490F,
-    0.9729717369F, 0.9731690109F, 0.9733652737F, 0.9735605279F,
-    0.9737547762F, 0.9739480212F, 0.9741402656F, 0.9743315120F,
-    0.9745217631F, 0.9747110216F, 0.9748992901F, 0.9750865714F,
-    0.9752728681F, 0.9754581829F, 0.9756425184F, 0.9758258775F,
-    0.9760082627F, 0.9761896768F, 0.9763701224F, 0.9765496024F,
-    0.9767281193F, 0.9769056760F, 0.9770822751F, 0.9772579193F,
-    0.9774326114F, 0.9776063542F, 0.9777791502F, 0.9779510023F,
-    0.9781219133F, 0.9782918858F, 0.9784609226F, 0.9786290264F,
-    0.9787962000F, 0.9789624461F, 0.9791277676F, 0.9792921671F,
-    0.9794556474F, 0.9796182113F, 0.9797798615F, 0.9799406009F,
-    0.9801004321F, 0.9802593580F, 0.9804173813F, 0.9805745049F,
-    0.9807307314F, 0.9808860637F, 0.9810405046F, 0.9811940568F,
-    0.9813467232F, 0.9814985065F, 0.9816494095F, 0.9817994351F,
-    0.9819485860F, 0.9820968650F, 0.9822442750F, 0.9823908186F,
-    0.9825364988F, 0.9826813184F, 0.9828252801F, 0.9829683868F,
-    0.9831106413F, 0.9832520463F, 0.9833926048F, 0.9835323195F,
-    0.9836711932F, 0.9838092288F, 0.9839464291F, 0.9840827969F,
-    0.9842183351F, 0.9843530464F, 0.9844869337F, 0.9846199998F,
-    0.9847522475F, 0.9848836798F, 0.9850142993F, 0.9851441090F,
-    0.9852731117F, 0.9854013101F, 0.9855287073F, 0.9856553058F,
-    0.9857811087F, 0.9859061188F, 0.9860303388F, 0.9861537717F,
-    0.9862764202F, 0.9863982872F, 0.9865193756F, 0.9866396882F,
-    0.9867592277F, 0.9868779972F, 0.9869959993F, 0.9871132370F,
-    0.9872297131F, 0.9873454304F, 0.9874603918F, 0.9875746001F,
-    0.9876880581F, 0.9878007688F, 0.9879127348F, 0.9880239592F,
-    0.9881344447F, 0.9882441941F, 0.9883532104F, 0.9884614962F,
-    0.9885690546F, 0.9886758883F, 0.9887820001F, 0.9888873930F,
-    0.9889920697F, 0.9890960331F, 0.9891992859F, 0.9893018312F,
-    0.9894036716F, 0.9895048100F, 0.9896052493F, 0.9897049923F,
-    0.9898040418F, 0.9899024006F, 0.9900000717F, 0.9900970577F,
-    0.9901933616F, 0.9902889862F, 0.9903839343F, 0.9904782087F,
-    0.9905718122F, 0.9906647477F, 0.9907570180F, 0.9908486259F,
-    0.9909395742F, 0.9910298658F, 0.9911195034F, 0.9912084899F,
-    0.9912968281F, 0.9913845208F, 0.9914715708F, 0.9915579810F,
-    0.9916437540F, 0.9917288928F, 0.9918134001F, 0.9918972788F,
-    0.9919805316F, 0.9920631613F, 0.9921451707F, 0.9922265626F,
-    0.9923073399F, 0.9923875052F, 0.9924670615F, 0.9925460114F,
-    0.9926243577F, 0.9927021033F, 0.9927792508F, 0.9928558032F,
-    0.9929317631F, 0.9930071333F, 0.9930819167F, 0.9931561158F,
-    0.9932297337F, 0.9933027728F, 0.9933752362F, 0.9934471264F,
-    0.9935184462F, 0.9935891985F, 0.9936593859F, 0.9937290112F,
-    0.9937980771F, 0.9938665864F, 0.9939345418F, 0.9940019460F,
-    0.9940688018F, 0.9941351118F, 0.9942008789F, 0.9942661057F,
-    0.9943307950F, 0.9943949494F, 0.9944585717F, 0.9945216645F,
-    0.9945842307F, 0.9946462728F, 0.9947077936F, 0.9947687957F,
-    0.9948292820F, 0.9948892550F, 0.9949487174F, 0.9950076719F,
-    0.9950661212F, 0.9951240679F, 0.9951815148F, 0.9952384645F,
-    0.9952949196F, 0.9953508828F, 0.9954063568F, 0.9954613442F,
-    0.9955158476F, 0.9955698697F, 0.9956234132F, 0.9956764806F,
-    0.9957290746F, 0.9957811978F, 0.9958328528F, 0.9958840423F,
-    0.9959347688F, 0.9959850351F, 0.9960348435F, 0.9960841969F,
-    0.9961330977F, 0.9961815486F, 0.9962295521F, 0.9962771108F,
-    0.9963242274F, 0.9963709043F, 0.9964171441F, 0.9964629494F,
-    0.9965083228F, 0.9965532668F, 0.9965977840F, 0.9966418768F,
-    0.9966855479F, 0.9967287998F, 0.9967716350F, 0.9968140559F,
-    0.9968560653F, 0.9968976655F, 0.9969388591F, 0.9969796485F,
-    0.9970200363F, 0.9970600250F, 0.9970996170F, 0.9971388149F,
-    0.9971776211F, 0.9972160380F, 0.9972540683F, 0.9972917142F,
-    0.9973289783F, 0.9973658631F, 0.9974023709F, 0.9974385042F,
-    0.9974742655F, 0.9975096571F, 0.9975446816F, 0.9975793413F,
-    0.9976136386F, 0.9976475759F, 0.9976811557F, 0.9977143803F,
-    0.9977472521F, 0.9977797736F, 0.9978119470F, 0.9978437748F,
-    0.9978752593F, 0.9979064029F, 0.9979372079F, 0.9979676768F,
-    0.9979978117F, 0.9980276151F, 0.9980570893F, 0.9980862367F,
-    0.9981150595F, 0.9981435600F, 0.9981717406F, 0.9981996035F,
-    0.9982271511F, 0.9982543856F, 0.9982813093F, 0.9983079246F,
-    0.9983342336F, 0.9983602386F, 0.9983859418F, 0.9984113456F,
-    0.9984364522F, 0.9984612638F, 0.9984857825F, 0.9985100108F,
-    0.9985339507F, 0.9985576044F, 0.9985809743F, 0.9986040624F,
-    0.9986268710F, 0.9986494022F, 0.9986716583F, 0.9986936413F,
-    0.9987153535F, 0.9987367969F, 0.9987579738F, 0.9987788864F,
-    0.9987995366F, 0.9988199267F, 0.9988400587F, 0.9988599348F,
-    0.9988795572F, 0.9988989278F, 0.9989180487F, 0.9989369222F,
-    0.9989555501F, 0.9989739347F, 0.9989920780F, 0.9990099820F,
-    0.9990276487F, 0.9990450803F, 0.9990622787F, 0.9990792460F,
-    0.9990959841F, 0.9991124952F, 0.9991287812F, 0.9991448440F,
-    0.9991606858F, 0.9991763084F, 0.9991917139F, 0.9992069042F,
-    0.9992218813F, 0.9992366471F, 0.9992512035F, 0.9992655525F,
-    0.9992796961F, 0.9992936361F, 0.9993073744F, 0.9993209131F,
-    0.9993342538F, 0.9993473987F, 0.9993603494F, 0.9993731080F,
-    0.9993856762F, 0.9993980559F, 0.9994102490F, 0.9994222573F,
-    0.9994340827F, 0.9994457269F, 0.9994571918F, 0.9994684793F,
-    0.9994795910F, 0.9994905288F, 0.9995012945F, 0.9995118898F,
-    0.9995223165F, 0.9995325765F, 0.9995426713F, 0.9995526029F,
-    0.9995623728F, 0.9995719829F, 0.9995814349F, 0.9995907304F,
-    0.9995998712F, 0.9996088590F, 0.9996176954F, 0.9996263821F,
-    0.9996349208F, 0.9996433132F, 0.9996515609F, 0.9996596656F,
-    0.9996676288F, 0.9996754522F, 0.9996831375F, 0.9996906862F,
-    0.9996981000F, 0.9997053804F, 0.9997125290F, 0.9997195474F,
-    0.9997264371F, 0.9997331998F, 0.9997398369F, 0.9997463500F,
-    0.9997527406F, 0.9997590103F, 0.9997651606F, 0.9997711930F,
-    0.9997771089F, 0.9997829098F, 0.9997885973F, 0.9997941728F,
-    0.9997996378F, 0.9998049936F, 0.9998102419F, 0.9998153839F,
-    0.9998204211F, 0.9998253550F, 0.9998301868F, 0.9998349182F,
-    0.9998395503F, 0.9998440847F, 0.9998485226F, 0.9998528654F,
-    0.9998571146F, 0.9998612713F, 0.9998653370F, 0.9998693130F,
-    0.9998732007F, 0.9998770012F, 0.9998807159F, 0.9998843461F,
-    0.9998878931F, 0.9998913581F, 0.9998947424F, 0.9998980473F,
-    0.9999012740F, 0.9999044237F, 0.9999074976F, 0.9999104971F,
-    0.9999134231F, 0.9999162771F, 0.9999190601F, 0.9999217733F,
-    0.9999244179F, 0.9999269950F, 0.9999295058F, 0.9999319515F,
-    0.9999343332F, 0.9999366519F, 0.9999389088F, 0.9999411050F,
-    0.9999432416F, 0.9999453196F, 0.9999473402F, 0.9999493044F,
-    0.9999512132F, 0.9999530677F, 0.9999548690F, 0.9999566180F,
-    0.9999583157F, 0.9999599633F, 0.9999615616F, 0.9999631116F,
-    0.9999646144F, 0.9999660709F, 0.9999674820F, 0.9999688487F,
-    0.9999701719F, 0.9999714526F, 0.9999726917F, 0.9999738900F,
-    0.9999750486F, 0.9999761682F, 0.9999772497F, 0.9999782941F,
-    0.9999793021F, 0.9999802747F, 0.9999812126F, 0.9999821167F,
-    0.9999829878F, 0.9999838268F, 0.9999846343F, 0.9999854113F,
-    0.9999861584F, 0.9999868765F, 0.9999875664F, 0.9999882287F,
-    0.9999888642F, 0.9999894736F, 0.9999900577F, 0.9999906172F,
-    0.9999911528F, 0.9999916651F, 0.9999921548F, 0.9999926227F,
-    0.9999930693F, 0.9999934954F, 0.9999939015F, 0.9999942883F,
-    0.9999946564F, 0.9999950064F, 0.9999953390F, 0.9999956547F,
-    0.9999959541F, 0.9999962377F, 0.9999965062F, 0.9999967601F,
-    0.9999969998F, 0.9999972260F, 0.9999974392F, 0.9999976399F,
-    0.9999978285F, 0.9999980056F, 0.9999981716F, 0.9999983271F,
-    0.9999984724F, 0.9999986081F, 0.9999987345F, 0.9999988521F,
-    0.9999989613F, 0.9999990625F, 0.9999991562F, 0.9999992426F,
-    0.9999993223F, 0.9999993954F, 0.9999994625F, 0.9999995239F,
-    0.9999995798F, 0.9999996307F, 0.9999996768F, 0.9999997184F,
-    0.9999997559F, 0.9999997895F, 0.9999998195F, 0.9999998462F,
-    0.9999998698F, 0.9999998906F, 0.9999999088F, 0.9999999246F,
-    0.9999999383F, 0.9999999500F, 0.9999999600F, 0.9999999684F,
-    0.9999999754F, 0.9999999811F, 0.9999999858F, 0.9999999896F,
-    0.9999999925F, 0.9999999948F, 0.9999999965F, 0.9999999978F,
-    0.9999999986F, 0.9999999992F, 0.9999999996F, 0.9999999998F,
-    0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
-};
-
-DECLARE_ALIGNED(16, static const float, vwin8192)[4096] = {
-    0.0000000578F, 0.0000005198F, 0.0000014438F, 0.0000028299F,
-    0.0000046780F, 0.0000069882F, 0.0000097604F, 0.0000129945F,
-    0.0000166908F, 0.0000208490F, 0.0000254692F, 0.0000305515F,
-    0.0000360958F, 0.0000421021F, 0.0000485704F, 0.0000555006F,
-    0.0000628929F, 0.0000707472F, 0.0000790635F, 0.0000878417F,
-    0.0000970820F, 0.0001067842F, 0.0001169483F, 0.0001275744F,
-    0.0001386625F, 0.0001502126F, 0.0001622245F, 0.0001746984F,
-    0.0001876343F, 0.0002010320F, 0.0002148917F, 0.0002292132F,
-    0.0002439967F, 0.0002592421F, 0.0002749493F, 0.0002911184F,
-    0.0003077493F, 0.0003248421F, 0.0003423967F, 0.0003604132F,
-    0.0003788915F, 0.0003978316F, 0.0004172335F, 0.0004370971F,
-    0.0004574226F, 0.0004782098F, 0.0004994587F, 0.0005211694F,
-    0.0005433418F, 0.0005659759F, 0.0005890717F, 0.0006126292F,
-    0.0006366484F, 0.0006611292F, 0.0006860716F, 0.0007114757F,
-    0.0007373414F, 0.0007636687F, 0.0007904576F, 0.0008177080F,
-    0.0008454200F, 0.0008735935F, 0.0009022285F, 0.0009313250F,
-    0.0009608830F, 0.0009909025F, 0.0010213834F, 0.0010523257F,
-    0.0010837295F, 0.0011155946F, 0.0011479211F, 0.0011807090F,
-    0.0012139582F, 0.0012476687F, 0.0012818405F, 0.0013164736F,
-    0.0013515679F, 0.0013871235F, 0.0014231402F, 0.0014596182F,
-    0.0014965573F, 0.0015339576F, 0.0015718190F, 0.0016101415F,
-    0.0016489251F, 0.0016881698F, 0.0017278754F, 0.0017680421F,
-    0.0018086698F, 0.0018497584F, 0.0018913080F, 0.0019333185F,
-    0.0019757898F, 0.0020187221F, 0.0020621151F, 0.0021059690F,
-    0.0021502837F, 0.0021950591F, 0.0022402953F, 0.0022859921F,
-    0.0023321497F, 0.0023787679F, 0.0024258467F, 0.0024733861F,
-    0.0025213861F, 0.0025698466F, 0.0026187676F, 0.0026681491F,
-    0.0027179911F, 0.0027682935F, 0.0028190562F, 0.0028702794F,
-    0.0029219628F, 0.0029741066F, 0.0030267107F, 0.0030797749F,
-    0.0031332994F, 0.0031872841F, 0.0032417289F, 0.0032966338F,
-    0.0033519988F, 0.0034078238F, 0.0034641089F, 0.0035208539F,
-    0.0035780589F, 0.0036357237F, 0.0036938485F, 0.0037524331F,
-    0.0038114775F, 0.0038709817F, 0.0039309456F, 0.0039913692F,
-    0.0040522524F, 0.0041135953F, 0.0041753978F, 0.0042376599F,
-    0.0043003814F, 0.0043635624F, 0.0044272029F, 0.0044913028F,
-    0.0045558620F, 0.0046208806F, 0.0046863585F, 0.0047522955F,
-    0.0048186919F, 0.0048855473F, 0.0049528619F, 0.0050206356F,
-    0.0050888684F, 0.0051575601F, 0.0052267108F, 0.0052963204F,
-    0.0053663890F, 0.0054369163F, 0.0055079025F, 0.0055793474F,
-    0.0056512510F, 0.0057236133F, 0.0057964342F, 0.0058697137F,
-    0.0059434517F, 0.0060176482F, 0.0060923032F, 0.0061674166F,
-    0.0062429883F, 0.0063190183F, 0.0063955066F, 0.0064724532F,
-    0.0065498579F, 0.0066277207F, 0.0067060416F, 0.0067848205F,
-    0.0068640575F, 0.0069437523F, 0.0070239051F, 0.0071045157F,
-    0.0071855840F, 0.0072671102F, 0.0073490940F, 0.0074315355F,
-    0.0075144345F, 0.0075977911F, 0.0076816052F, 0.0077658768F,
-    0.0078506057F, 0.0079357920F, 0.0080214355F, 0.0081075363F,
-    0.0081940943F, 0.0082811094F, 0.0083685816F, 0.0084565108F,
-    0.0085448970F, 0.0086337401F, 0.0087230401F, 0.0088127969F,
-    0.0089030104F, 0.0089936807F, 0.0090848076F, 0.0091763911F,
-    0.0092684311F, 0.0093609276F, 0.0094538805F, 0.0095472898F,
-    0.0096411554F, 0.0097354772F, 0.0098302552F, 0.0099254894F,
-    0.0100211796F, 0.0101173259F, 0.0102139281F, 0.0103109863F,
-    0.0104085002F, 0.0105064700F, 0.0106048955F, 0.0107037766F,
-    0.0108031133F, 0.0109029056F, 0.0110031534F, 0.0111038565F,
-    0.0112050151F, 0.0113066289F, 0.0114086980F, 0.0115112222F,
-    0.0116142015F, 0.0117176359F, 0.0118215252F, 0.0119258695F,
-    0.0120306686F, 0.0121359225F, 0.0122416312F, 0.0123477944F,
-    0.0124544123F, 0.0125614847F, 0.0126690116F, 0.0127769928F,
-    0.0128854284F, 0.0129943182F, 0.0131036623F, 0.0132134604F,
-    0.0133237126F, 0.0134344188F, 0.0135455790F, 0.0136571929F,
-    0.0137692607F, 0.0138817821F, 0.0139947572F, 0.0141081859F,
-    0.0142220681F, 0.0143364037F, 0.0144511927F, 0.0145664350F,
-    0.0146821304F, 0.0147982791F, 0.0149148808F, 0.0150319355F,
-    0.0151494431F, 0.0152674036F, 0.0153858168F, 0.0155046828F,
-    0.0156240014F, 0.0157437726F, 0.0158639962F, 0.0159846723F,
-    0.0161058007F, 0.0162273814F, 0.0163494142F, 0.0164718991F,
-    0.0165948361F, 0.0167182250F, 0.0168420658F, 0.0169663584F,
-    0.0170911027F, 0.0172162987F, 0.0173419462F, 0.0174680452F,
-    0.0175945956F, 0.0177215974F, 0.0178490504F, 0.0179769545F,
-    0.0181053098F, 0.0182341160F, 0.0183633732F, 0.0184930812F,
-    0.0186232399F, 0.0187538494F, 0.0188849094F, 0.0190164200F,
-    0.0191483809F, 0.0192807923F, 0.0194136539F, 0.0195469656F,
-    0.0196807275F, 0.0198149394F, 0.0199496012F, 0.0200847128F,
-    0.0202202742F, 0.0203562853F, 0.0204927460F, 0.0206296561F,
-    0.0207670157F, 0.0209048245F, 0.0210430826F, 0.0211817899F,
-    0.0213209462F, 0.0214605515F, 0.0216006057F, 0.0217411086F,
-    0.0218820603F, 0.0220234605F, 0.0221653093F, 0.0223076066F,
-    0.0224503521F, 0.0225935459F, 0.0227371879F, 0.0228812779F,
-    0.0230258160F, 0.0231708018F, 0.0233162355F, 0.0234621169F,
-    0.0236084459F, 0.0237552224F, 0.0239024462F, 0.0240501175F,
-    0.0241982359F, 0.0243468015F, 0.0244958141F, 0.0246452736F,
-    0.0247951800F, 0.0249455331F, 0.0250963329F, 0.0252475792F,
-    0.0253992720F, 0.0255514111F, 0.0257039965F, 0.0258570281F,
-    0.0260105057F, 0.0261644293F, 0.0263187987F, 0.0264736139F,
-    0.0266288747F, 0.0267845811F, 0.0269407330F, 0.0270973302F,
-    0.0272543727F, 0.0274118604F, 0.0275697930F, 0.0277281707F,
-    0.0278869932F, 0.0280462604F, 0.0282059723F, 0.0283661287F,
-    0.0285267295F, 0.0286877747F, 0.0288492641F, 0.0290111976F,
-    0.0291735751F, 0.0293363965F, 0.0294996617F, 0.0296633706F,
-    0.0298275231F, 0.0299921190F, 0.0301571583F, 0.0303226409F,
-    0.0304885667F, 0.0306549354F, 0.0308217472F, 0.0309890017F,
-    0.0311566989F, 0.0313248388F, 0.0314934211F, 0.0316624459F,
-    0.0318319128F, 0.0320018220F, 0.0321721732F, 0.0323429663F,
-    0.0325142013F, 0.0326858779F, 0.0328579962F, 0.0330305559F,
-    0.0332035570F, 0.0333769994F, 0.0335508829F, 0.0337252074F,
-    0.0338999728F, 0.0340751790F, 0.0342508259F, 0.0344269134F,
-    0.0346034412F, 0.0347804094F, 0.0349578178F, 0.0351356663F,
-    0.0353139548F, 0.0354926831F, 0.0356718511F, 0.0358514588F,
-    0.0360315059F, 0.0362119924F, 0.0363929182F, 0.0365742831F,
-    0.0367560870F, 0.0369383297F, 0.0371210113F, 0.0373041315F,
-    0.0374876902F, 0.0376716873F, 0.0378561226F, 0.0380409961F,
-    0.0382263077F, 0.0384120571F, 0.0385982443F, 0.0387848691F,
-    0.0389719315F, 0.0391594313F, 0.0393473683F, 0.0395357425F,
-    0.0397245537F, 0.0399138017F, 0.0401034866F, 0.0402936080F,
-    0.0404841660F, 0.0406751603F, 0.0408665909F, 0.0410584576F,
-    0.0412507603F, 0.0414434988F, 0.0416366731F, 0.0418302829F,
-    0.0420243282F, 0.0422188088F, 0.0424137246F, 0.0426090755F,
-    0.0428048613F, 0.0430010819F, 0.0431977371F, 0.0433948269F,
-    0.0435923511F, 0.0437903095F, 0.0439887020F, 0.0441875285F,
-    0.0443867889F, 0.0445864830F, 0.0447866106F, 0.0449871717F,
-    0.0451881661F, 0.0453895936F, 0.0455914542F, 0.0457937477F,
-    0.0459964738F, 0.0461996326F, 0.0464032239F, 0.0466072475F,
-    0.0468117032F, 0.0470165910F, 0.0472219107F, 0.0474276622F,
-    0.0476338452F, 0.0478404597F, 0.0480475056F, 0.0482549827F,
-    0.0484628907F, 0.0486712297F, 0.0488799994F, 0.0490891998F,
-    0.0492988306F, 0.0495088917F, 0.0497193830F, 0.0499303043F,
-    0.0501416554F, 0.0503534363F, 0.0505656468F, 0.0507782867F,
-    0.0509913559F, 0.0512048542F, 0.0514187815F, 0.0516331376F,
-    0.0518479225F, 0.0520631358F, 0.0522787775F, 0.0524948475F,
-    0.0527113455F, 0.0529282715F, 0.0531456252F, 0.0533634066F,
-    0.0535816154F, 0.0538002515F, 0.0540193148F, 0.0542388051F,
-    0.0544587222F, 0.0546790660F, 0.0548998364F, 0.0551210331F,
-    0.0553426561F, 0.0555647051F, 0.0557871801F, 0.0560100807F,
-    0.0562334070F, 0.0564571587F, 0.0566813357F, 0.0569059378F,
-    0.0571309649F, 0.0573564168F, 0.0575822933F, 0.0578085942F,
-    0.0580353195F, 0.0582624689F, 0.0584900423F, 0.0587180396F,
-    0.0589464605F, 0.0591753049F, 0.0594045726F, 0.0596342635F,
-    0.0598643774F, 0.0600949141F, 0.0603258735F, 0.0605572555F,
-    0.0607890597F, 0.0610212862F, 0.0612539346F, 0.0614870049F,
-    0.0617204968F, 0.0619544103F, 0.0621887451F, 0.0624235010F,
-    0.0626586780F, 0.0628942758F, 0.0631302942F, 0.0633667331F,
-    0.0636035923F, 0.0638408717F, 0.0640785710F, 0.0643166901F,
-    0.0645552288F, 0.0647941870F, 0.0650335645F, 0.0652733610F,
-    0.0655135765F, 0.0657542108F, 0.0659952636F, 0.0662367348F,
-    0.0664786242F, 0.0667209316F, 0.0669636570F, 0.0672068000F,
-    0.0674503605F, 0.0676943384F, 0.0679387334F, 0.0681835454F,
-    0.0684287742F, 0.0686744196F, 0.0689204814F, 0.0691669595F,
-    0.0694138536F, 0.0696611637F, 0.0699088894F, 0.0701570307F,
-    0.0704055873F, 0.0706545590F, 0.0709039458F, 0.0711537473F,
-    0.0714039634F, 0.0716545939F, 0.0719056387F, 0.0721570975F,
-    0.0724089702F, 0.0726612565F, 0.0729139563F, 0.0731670694F,
-    0.0734205956F, 0.0736745347F, 0.0739288866F, 0.0741836510F,
-    0.0744388277F, 0.0746944166F, 0.0749504175F, 0.0752068301F,
-    0.0754636543F, 0.0757208899F, 0.0759785367F, 0.0762365946F,
-    0.0764950632F, 0.0767539424F, 0.0770132320F, 0.0772729319F,
-    0.0775330418F, 0.0777935616F, 0.0780544909F, 0.0783158298F,
-    0.0785775778F, 0.0788397349F, 0.0791023009F, 0.0793652755F,
-    0.0796286585F, 0.0798924498F, 0.0801566492F, 0.0804212564F,
-    0.0806862712F, 0.0809516935F, 0.0812175231F, 0.0814837597F,
-    0.0817504031F, 0.0820174532F, 0.0822849097F, 0.0825527724F,
-    0.0828210412F, 0.0830897158F, 0.0833587960F, 0.0836282816F,
-    0.0838981724F, 0.0841684682F, 0.0844391688F, 0.0847102740F,
-    0.0849817835F, 0.0852536973F, 0.0855260150F, 0.0857987364F,
-    0.0860718614F, 0.0863453897F, 0.0866193211F, 0.0868936554F,
-    0.0871683924F, 0.0874435319F, 0.0877190737F, 0.0879950175F,
-    0.0882713632F, 0.0885481105F, 0.0888252592F, 0.0891028091F,
-    0.0893807600F, 0.0896591117F, 0.0899378639F, 0.0902170165F,
-    0.0904965692F, 0.0907765218F, 0.0910568740F, 0.0913376258F,
-    0.0916187767F, 0.0919003268F, 0.0921822756F, 0.0924646230F,
-    0.0927473687F, 0.0930305126F, 0.0933140545F, 0.0935979940F,
-    0.0938823310F, 0.0941670653F, 0.0944521966F, 0.0947377247F,
-    0.0950236494F, 0.0953099704F, 0.0955966876F, 0.0958838007F,
-    0.0961713094F, 0.0964592136F, 0.0967475131F, 0.0970362075F,
-    0.0973252967F, 0.0976147805F, 0.0979046585F, 0.0981949307F,
-    0.0984855967F, 0.0987766563F, 0.0990681093F, 0.0993599555F,
-    0.0996521945F, 0.0999448263F, 0.1002378506F, 0.1005312671F,
-    0.1008250755F, 0.1011192757F, 0.1014138675F, 0.1017088505F,
-    0.1020042246F, 0.1022999895F, 0.1025961450F, 0.1028926909F,
-    0.1031896268F, 0.1034869526F, 0.1037846680F, 0.1040827729F,
-    0.1043812668F, 0.1046801497F, 0.1049794213F, 0.1052790813F,
-    0.1055791294F, 0.1058795656F, 0.1061803894F, 0.1064816006F,
-    0.1067831991F, 0.1070851846F, 0.1073875568F, 0.1076903155F,
-    0.1079934604F, 0.1082969913F, 0.1086009079F, 0.1089052101F,
-    0.1092098975F, 0.1095149699F, 0.1098204270F, 0.1101262687F,
-    0.1104324946F, 0.1107391045F, 0.1110460982F, 0.1113534754F,
-    0.1116612359F, 0.1119693793F, 0.1122779055F, 0.1125868142F,
-    0.1128961052F, 0.1132057781F, 0.1135158328F, 0.1138262690F,
-    0.1141370863F, 0.1144482847F, 0.1147598638F, 0.1150718233F,
-    0.1153841631F, 0.1156968828F, 0.1160099822F, 0.1163234610F,
-    0.1166373190F, 0.1169515559F, 0.1172661714F, 0.1175811654F,
-    0.1178965374F, 0.1182122874F, 0.1185284149F, 0.1188449198F,
-    0.1191618018F, 0.1194790606F, 0.1197966960F, 0.1201147076F,
-    0.1204330953F, 0.1207518587F, 0.1210709976F, 0.1213905118F,
-    0.1217104009F, 0.1220306647F, 0.1223513029F, 0.1226723153F,
-    0.1229937016F, 0.1233154615F, 0.1236375948F, 0.1239601011F,
-    0.1242829803F, 0.1246062319F, 0.1249298559F, 0.1252538518F,
-    0.1255782195F, 0.1259029586F, 0.1262280689F, 0.1265535501F,
-    0.1268794019F, 0.1272056241F, 0.1275322163F, 0.1278591784F,
-    0.1281865099F, 0.1285142108F, 0.1288422805F, 0.1291707190F,
-    0.1294995259F, 0.1298287009F, 0.1301582437F, 0.1304881542F,
-    0.1308184319F, 0.1311490766F, 0.1314800881F, 0.1318114660F,
-    0.1321432100F, 0.1324753200F, 0.1328077955F, 0.1331406364F,
-    0.1334738422F, 0.1338074129F, 0.1341413479F, 0.1344756472F,
-    0.1348103103F, 0.1351453370F, 0.1354807270F, 0.1358164801F,
-    0.1361525959F, 0.1364890741F, 0.1368259145F, 0.1371631167F,
-    0.1375006805F, 0.1378386056F, 0.1381768917F, 0.1385155384F,
-    0.1388545456F, 0.1391939129F, 0.1395336400F, 0.1398737266F,
-    0.1402141724F, 0.1405549772F, 0.1408961406F, 0.1412376623F,
-    0.1415795421F, 0.1419217797F, 0.1422643746F, 0.1426073268F,
-    0.1429506358F, 0.1432943013F, 0.1436383231F, 0.1439827008F,
-    0.1443274342F, 0.1446725229F, 0.1450179667F, 0.1453637652F,
-    0.1457099181F, 0.1460564252F, 0.1464032861F, 0.1467505006F,
-    0.1470980682F, 0.1474459888F, 0.1477942620F, 0.1481428875F,
-    0.1484918651F, 0.1488411942F, 0.1491908748F, 0.1495409065F,
-    0.1498912889F, 0.1502420218F, 0.1505931048F, 0.1509445376F,
-    0.1512963200F, 0.1516484516F, 0.1520009321F, 0.1523537612F,
-    0.1527069385F, 0.1530604638F, 0.1534143368F, 0.1537685571F,
-    0.1541231244F, 0.1544780384F, 0.1548332987F, 0.1551889052F,
-    0.1555448574F, 0.1559011550F, 0.1562577978F, 0.1566147853F,
-    0.1569721173F, 0.1573297935F, 0.1576878135F, 0.1580461771F,
-    0.1584048838F, 0.1587639334F, 0.1591233255F, 0.1594830599F,
-    0.1598431361F, 0.1602035540F, 0.1605643131F, 0.1609254131F,
-    0.1612868537F, 0.1616486346F, 0.1620107555F, 0.1623732160F,
-    0.1627360158F, 0.1630991545F, 0.1634626319F, 0.1638264476F,
-    0.1641906013F, 0.1645550926F, 0.1649199212F, 0.1652850869F,
-    0.1656505892F, 0.1660164278F, 0.1663826024F, 0.1667491127F,
-    0.1671159583F, 0.1674831388F, 0.1678506541F, 0.1682185036F,
-    0.1685866872F, 0.1689552044F, 0.1693240549F, 0.1696932384F,
-    0.1700627545F, 0.1704326029F, 0.1708027833F, 0.1711732952F,
-    0.1715441385F, 0.1719153127F, 0.1722868175F, 0.1726586526F,
-    0.1730308176F, 0.1734033121F, 0.1737761359F, 0.1741492886F,
-    0.1745227698F, 0.1748965792F, 0.1752707164F, 0.1756451812F,
-    0.1760199731F, 0.1763950918F, 0.1767705370F, 0.1771463083F,
-    0.1775224054F, 0.1778988279F, 0.1782755754F, 0.1786526477F,
-    0.1790300444F, 0.1794077651F, 0.1797858094F, 0.1801641771F,
-    0.1805428677F, 0.1809218810F, 0.1813012165F, 0.1816808739F,
-    0.1820608528F, 0.1824411530F, 0.1828217739F, 0.1832027154F,
-    0.1835839770F, 0.1839655584F, 0.1843474592F, 0.1847296790F,
-    0.1851122175F, 0.1854950744F, 0.1858782492F, 0.1862617417F,
-    0.1866455514F, 0.1870296780F, 0.1874141211F, 0.1877988804F,
-    0.1881839555F, 0.1885693461F, 0.1889550517F, 0.1893410721F,
-    0.1897274068F, 0.1901140555F, 0.1905010178F, 0.1908882933F,
-    0.1912758818F, 0.1916637828F, 0.1920519959F, 0.1924405208F,
-    0.1928293571F, 0.1932185044F, 0.1936079625F, 0.1939977308F,
-    0.1943878091F, 0.1947781969F, 0.1951688939F, 0.1955598998F,
-    0.1959512141F, 0.1963428364F, 0.1967347665F, 0.1971270038F,
-    0.1975195482F, 0.1979123990F, 0.1983055561F, 0.1986990190F,
-    0.1990927873F, 0.1994868607F, 0.1998812388F, 0.2002759212F,
-    0.2006709075F, 0.2010661974F, 0.2014617904F, 0.2018576862F,
-    0.2022538844F, 0.2026503847F, 0.2030471865F, 0.2034442897F,
-    0.2038416937F, 0.2042393982F, 0.2046374028F, 0.2050357071F,
-    0.2054343107F, 0.2058332133F, 0.2062324145F, 0.2066319138F,
-    0.2070317110F, 0.2074318055F, 0.2078321970F, 0.2082328852F,
-    0.2086338696F, 0.2090351498F, 0.2094367255F, 0.2098385962F,
-    0.2102407617F, 0.2106432213F, 0.2110459749F, 0.2114490220F,
-    0.2118523621F, 0.2122559950F, 0.2126599202F, 0.2130641373F,
-    0.2134686459F, 0.2138734456F, 0.2142785361F, 0.2146839168F,
-    0.2150895875F, 0.2154955478F, 0.2159017972F, 0.2163083353F,
-    0.2167151617F, 0.2171222761F, 0.2175296780F, 0.2179373670F,
-    0.2183453428F, 0.2187536049F, 0.2191621529F, 0.2195709864F,
-    0.2199801051F, 0.2203895085F, 0.2207991961F, 0.2212091677F,
-    0.2216194228F, 0.2220299610F, 0.2224407818F, 0.2228518850F,
-    0.2232632699F, 0.2236749364F, 0.2240868839F, 0.2244991121F,
-    0.2249116204F, 0.2253244086F, 0.2257374763F, 0.2261508229F,
-    0.2265644481F, 0.2269783514F, 0.2273925326F, 0.2278069911F,
-    0.2282217265F, 0.2286367384F, 0.2290520265F, 0.2294675902F,
-    0.2298834292F, 0.2302995431F, 0.2307159314F, 0.2311325937F,
-    0.2315495297F, 0.2319667388F, 0.2323842207F, 0.2328019749F,
-    0.2332200011F, 0.2336382988F, 0.2340568675F, 0.2344757070F,
-    0.2348948166F, 0.2353141961F, 0.2357338450F, 0.2361537629F,
-    0.2365739493F, 0.2369944038F, 0.2374151261F, 0.2378361156F,
-    0.2382573720F, 0.2386788948F, 0.2391006836F, 0.2395227380F,
-    0.2399450575F, 0.2403676417F, 0.2407904902F, 0.2412136026F,
-    0.2416369783F, 0.2420606171F, 0.2424845185F, 0.2429086820F,
-    0.2433331072F, 0.2437577936F, 0.2441827409F, 0.2446079486F,
-    0.2450334163F, 0.2454591435F, 0.2458851298F, 0.2463113747F,
-    0.2467378779F, 0.2471646389F, 0.2475916573F, 0.2480189325F,
-    0.2484464643F, 0.2488742521F, 0.2493022955F, 0.2497305940F,
-    0.2501591473F, 0.2505879549F, 0.2510170163F, 0.2514463311F,
-    0.2518758989F, 0.2523057193F, 0.2527357916F, 0.2531661157F,
-    0.2535966909F, 0.2540275169F, 0.2544585931F, 0.2548899193F,
-    0.2553214948F, 0.2557533193F, 0.2561853924F, 0.2566177135F,
-    0.2570502822F, 0.2574830981F, 0.2579161608F, 0.2583494697F,
-    0.2587830245F, 0.2592168246F, 0.2596508697F, 0.2600851593F,
-    0.2605196929F, 0.2609544701F, 0.2613894904F, 0.2618247534F,
-    0.2622602586F, 0.2626960055F, 0.2631319938F, 0.2635682230F,
-    0.2640046925F, 0.2644414021F, 0.2648783511F, 0.2653155391F,
-    0.2657529657F, 0.2661906305F, 0.2666285329F, 0.2670666725F,
-    0.2675050489F, 0.2679436616F, 0.2683825101F, 0.2688215940F,
-    0.2692609127F, 0.2697004660F, 0.2701402532F, 0.2705802739F,
-    0.2710205278F, 0.2714610142F, 0.2719017327F, 0.2723426830F,
-    0.2727838644F, 0.2732252766F, 0.2736669191F, 0.2741087914F,
-    0.2745508930F, 0.2749932235F, 0.2754357824F, 0.2758785693F,
-    0.2763215837F, 0.2767648251F, 0.2772082930F, 0.2776519870F,
-    0.2780959066F, 0.2785400513F, 0.2789844207F, 0.2794290143F,
-    0.2798738316F, 0.2803188722F, 0.2807641355F, 0.2812096211F,
-    0.2816553286F, 0.2821012574F, 0.2825474071F, 0.2829937773F,
-    0.2834403673F, 0.2838871768F, 0.2843342053F, 0.2847814523F,
-    0.2852289174F, 0.2856765999F, 0.2861244996F, 0.2865726159F,
-    0.2870209482F, 0.2874694962F, 0.2879182594F, 0.2883672372F,
-    0.2888164293F, 0.2892658350F, 0.2897154540F, 0.2901652858F,
-    0.2906153298F, 0.2910655856F, 0.2915160527F, 0.2919667306F,
-    0.2924176189F, 0.2928687171F, 0.2933200246F, 0.2937715409F,
-    0.2942232657F, 0.2946751984F, 0.2951273386F, 0.2955796856F,
-    0.2960322391F, 0.2964849986F, 0.2969379636F, 0.2973911335F,
-    0.2978445080F, 0.2982980864F, 0.2987518684F, 0.2992058534F,
-    0.2996600409F, 0.3001144305F, 0.3005690217F, 0.3010238139F,
-    0.3014788067F, 0.3019339995F, 0.3023893920F, 0.3028449835F,
-    0.3033007736F, 0.3037567618F, 0.3042129477F, 0.3046693306F,
-    0.3051259102F, 0.3055826859F, 0.3060396572F, 0.3064968236F,
-    0.3069541847F, 0.3074117399F, 0.3078694887F, 0.3083274307F,
-    0.3087855653F, 0.3092438920F, 0.3097024104F, 0.3101611199F,
-    0.3106200200F, 0.3110791103F, 0.3115383902F, 0.3119978592F,
-    0.3124575169F, 0.3129173627F, 0.3133773961F, 0.3138376166F,
-    0.3142980238F, 0.3147586170F, 0.3152193959F, 0.3156803598F,
-    0.3161415084F, 0.3166028410F, 0.3170643573F, 0.3175260566F,
-    0.3179879384F, 0.3184500023F, 0.3189122478F, 0.3193746743F,
-    0.3198372814F, 0.3203000685F, 0.3207630351F, 0.3212261807F,
-    0.3216895048F, 0.3221530069F, 0.3226166865F, 0.3230805430F,
-    0.3235445760F, 0.3240087849F, 0.3244731693F, 0.3249377285F,
-    0.3254024622F, 0.3258673698F, 0.3263324507F, 0.3267977045F,
-    0.3272631306F, 0.3277287286F, 0.3281944978F, 0.3286604379F,
-    0.3291265482F, 0.3295928284F, 0.3300592777F, 0.3305258958F,
-    0.3309926821F, 0.3314596361F, 0.3319267573F, 0.3323940451F,
-    0.3328614990F, 0.3333291186F, 0.3337969033F, 0.3342648525F,
-    0.3347329658F, 0.3352012427F, 0.3356696825F, 0.3361382849F,
-    0.3366070492F, 0.3370759749F, 0.3375450616F, 0.3380143087F,
-    0.3384837156F, 0.3389532819F, 0.3394230071F, 0.3398928905F,
-    0.3403629317F, 0.3408331302F, 0.3413034854F, 0.3417739967F,
-    0.3422446638F, 0.3427154860F, 0.3431864628F, 0.3436575938F,
-    0.3441288782F, 0.3446003158F, 0.3450719058F, 0.3455436478F,
-    0.3460155412F, 0.3464875856F, 0.3469597804F, 0.3474321250F,
-    0.3479046189F, 0.3483772617F, 0.3488500527F, 0.3493229914F,
-    0.3497960774F, 0.3502693100F, 0.3507426887F, 0.3512162131F,
-    0.3516898825F, 0.3521636965F, 0.3526376545F, 0.3531117559F,
-    0.3535860003F, 0.3540603870F, 0.3545349157F, 0.3550095856F,
-    0.3554843964F, 0.3559593474F, 0.3564344381F, 0.3569096680F,
-    0.3573850366F, 0.3578605432F, 0.3583361875F, 0.3588119687F,
-    0.3592878865F, 0.3597639402F, 0.3602401293F, 0.3607164533F,
-    0.3611929117F, 0.3616695038F, 0.3621462292F, 0.3626230873F,
-    0.3631000776F, 0.3635771995F, 0.3640544525F, 0.3645318360F,
-    0.3650093496F, 0.3654869926F, 0.3659647645F, 0.3664426648F,
-    0.3669206930F, 0.3673988484F, 0.3678771306F, 0.3683555390F,
-    0.3688340731F, 0.3693127322F, 0.3697915160F, 0.3702704237F,
-    0.3707494549F, 0.3712286091F, 0.3717078857F, 0.3721872840F,
-    0.3726668037F, 0.3731464441F, 0.3736262047F, 0.3741060850F,
-    0.3745860843F, 0.3750662023F, 0.3755464382F, 0.3760267915F,
-    0.3765072618F, 0.3769878484F, 0.3774685509F, 0.3779493686F,
-    0.3784303010F, 0.3789113475F, 0.3793925076F, 0.3798737809F,
-    0.3803551666F, 0.3808366642F, 0.3813182733F, 0.3817999932F,
-    0.3822818234F, 0.3827637633F, 0.3832458124F, 0.3837279702F,
-    0.3842102360F, 0.3846926093F, 0.3851750897F, 0.3856576764F,
-    0.3861403690F, 0.3866231670F, 0.3871060696F, 0.3875890765F,
-    0.3880721870F, 0.3885554007F, 0.3890387168F, 0.3895221349F,
-    0.3900056544F, 0.3904892748F, 0.3909729955F, 0.3914568160F,
-    0.3919407356F, 0.3924247539F, 0.3929088702F, 0.3933930841F,
-    0.3938773949F, 0.3943618021F, 0.3948463052F, 0.3953309035F,
-    0.3958155966F, 0.3963003838F, 0.3967852646F, 0.3972702385F,
-    0.3977553048F, 0.3982404631F, 0.3987257127F, 0.3992110531F,
-    0.3996964838F, 0.4001820041F, 0.4006676136F, 0.4011533116F,
-    0.4016390976F, 0.4021249710F, 0.4026109313F, 0.4030969779F,
-    0.4035831102F, 0.4040693277F, 0.4045556299F, 0.4050420160F,
-    0.4055284857F, 0.4060150383F, 0.4065016732F, 0.4069883899F,
-    0.4074751879F, 0.4079620665F, 0.4084490252F, 0.4089360635F,
-    0.4094231807F, 0.4099103763F, 0.4103976498F, 0.4108850005F,
-    0.4113724280F, 0.4118599315F, 0.4123475107F, 0.4128351648F,
-    0.4133228934F, 0.4138106959F, 0.4142985716F, 0.4147865201F,
-    0.4152745408F, 0.4157626330F, 0.4162507963F, 0.4167390301F,
-    0.4172273337F, 0.4177157067F, 0.4182041484F, 0.4186926583F,
-    0.4191812359F, 0.4196698805F, 0.4201585915F, 0.4206473685F,
-    0.4211362108F, 0.4216251179F, 0.4221140892F, 0.4226031241F,
-    0.4230922221F, 0.4235813826F, 0.4240706050F, 0.4245598887F,
-    0.4250492332F, 0.4255386379F, 0.4260281022F, 0.4265176256F,
-    0.4270072075F, 0.4274968473F, 0.4279865445F, 0.4284762984F,
-    0.4289661086F, 0.4294559743F, 0.4299458951F, 0.4304358704F,
-    0.4309258996F, 0.4314159822F, 0.4319061175F, 0.4323963050F,
-    0.4328865441F, 0.4333768342F, 0.4338671749F, 0.4343575654F,
-    0.4348480052F, 0.4353384938F, 0.4358290306F, 0.4363196149F,
-    0.4368102463F, 0.4373009241F, 0.4377916478F, 0.4382824168F,
-    0.4387732305F, 0.4392640884F, 0.4397549899F, 0.4402459343F,
-    0.4407369212F, 0.4412279499F, 0.4417190198F, 0.4422101305F,
-    0.4427012813F, 0.4431924717F, 0.4436837010F, 0.4441749686F,
-    0.4446662742F, 0.4451576169F, 0.4456489963F, 0.4461404118F,
-    0.4466318628F, 0.4471233487F, 0.4476148690F, 0.4481064230F,
-    0.4485980103F, 0.4490896302F, 0.4495812821F, 0.4500729654F,
-    0.4505646797F, 0.4510564243F, 0.4515481986F, 0.4520400021F,
-    0.4525318341F, 0.4530236942F, 0.4535155816F, 0.4540074959F,
-    0.4544994365F, 0.4549914028F, 0.4554833941F, 0.4559754100F,
-    0.4564674499F, 0.4569595131F, 0.4574515991F, 0.4579437074F,
-    0.4584358372F, 0.4589279881F, 0.4594201595F, 0.4599123508F,
-    0.4604045615F, 0.4608967908F, 0.4613890383F, 0.4618813034F,
-    0.4623735855F, 0.4628658841F, 0.4633581984F, 0.4638505281F,
-    0.4643428724F, 0.4648352308F, 0.4653276028F, 0.4658199877F,
-    0.4663123849F, 0.4668047940F, 0.4672972143F, 0.4677896451F,
-    0.4682820861F, 0.4687745365F, 0.4692669958F, 0.4697594634F,
-    0.4702519387F, 0.4707444211F, 0.4712369102F, 0.4717294052F,
-    0.4722219056F, 0.4727144109F, 0.4732069204F, 0.4736994336F,
-    0.4741919498F, 0.4746844686F, 0.4751769893F, 0.4756695113F,
-    0.4761620341F, 0.4766545571F, 0.4771470797F, 0.4776396013F,
-    0.4781321213F, 0.4786246392F, 0.4791171544F, 0.4796096663F,
-    0.4801021744F, 0.4805946779F, 0.4810871765F, 0.4815796694F,
-    0.4820721561F, 0.4825646360F, 0.4830571086F, 0.4835495732F,
-    0.4840420293F, 0.4845344763F, 0.4850269136F, 0.4855193407F,
-    0.4860117569F, 0.4865041617F, 0.4869965545F, 0.4874889347F,
-    0.4879813018F, 0.4884736551F, 0.4889659941F, 0.4894583182F,
-    0.4899506268F, 0.4904429193F, 0.4909351952F, 0.4914274538F,
-    0.4919196947F, 0.4924119172F, 0.4929041207F, 0.4933963046F,
-    0.4938884685F, 0.4943806116F, 0.4948727335F, 0.4953648335F,
-    0.4958569110F, 0.4963489656F, 0.4968409965F, 0.4973330032F,
-    0.4978249852F, 0.4983169419F, 0.4988088726F, 0.4993007768F,
-    0.4997926539F, 0.5002845034F, 0.5007763247F, 0.5012681171F,
-    0.5017598801F, 0.5022516132F, 0.5027433157F, 0.5032349871F,
-    0.5037266268F, 0.5042182341F, 0.5047098086F, 0.5052013497F,
-    0.5056928567F, 0.5061843292F, 0.5066757664F, 0.5071671679F,
-    0.5076585330F, 0.5081498613F, 0.5086411520F, 0.5091324047F,
-    0.5096236187F, 0.5101147934F, 0.5106059284F, 0.5110970230F,
-    0.5115880766F, 0.5120790887F, 0.5125700587F, 0.5130609860F,
-    0.5135518700F, 0.5140427102F, 0.5145335059F, 0.5150242566F,
-    0.5155149618F, 0.5160056208F, 0.5164962331F, 0.5169867980F,
-    0.5174773151F, 0.5179677837F, 0.5184582033F, 0.5189485733F,
-    0.5194388931F, 0.5199291621F, 0.5204193798F, 0.5209095455F,
-    0.5213996588F, 0.5218897190F, 0.5223797256F, 0.5228696779F,
-    0.5233595755F, 0.5238494177F, 0.5243392039F, 0.5248289337F,
-    0.5253186063F, 0.5258082213F, 0.5262977781F, 0.5267872760F,
-    0.5272767146F, 0.5277660932F, 0.5282554112F, 0.5287446682F,
-    0.5292338635F, 0.5297229965F, 0.5302120667F, 0.5307010736F,
-    0.5311900164F, 0.5316788947F, 0.5321677079F, 0.5326564554F,
-    0.5331451366F, 0.5336337511F, 0.5341222981F, 0.5346107771F,
-    0.5350991876F, 0.5355875290F, 0.5360758007F, 0.5365640021F,
-    0.5370521327F, 0.5375401920F, 0.5380281792F, 0.5385160939F,
-    0.5390039355F, 0.5394917034F, 0.5399793971F, 0.5404670159F,
-    0.5409545594F, 0.5414420269F, 0.5419294179F, 0.5424167318F,
-    0.5429039680F, 0.5433911261F, 0.5438782053F, 0.5443652051F,
-    0.5448521250F, 0.5453389644F, 0.5458257228F, 0.5463123995F,
-    0.5467989940F, 0.5472855057F, 0.5477719341F, 0.5482582786F,
-    0.5487445387F, 0.5492307137F, 0.5497168031F, 0.5502028063F,
-    0.5506887228F, 0.5511745520F, 0.5516602934F, 0.5521459463F,
-    0.5526315103F, 0.5531169847F, 0.5536023690F, 0.5540876626F,
-    0.5545728649F, 0.5550579755F, 0.5555429937F, 0.5560279189F,
-    0.5565127507F, 0.5569974884F, 0.5574821315F, 0.5579666794F,
-    0.5584511316F, 0.5589354875F, 0.5594197465F, 0.5599039080F,
-    0.5603879716F, 0.5608719367F, 0.5613558026F, 0.5618395689F,
-    0.5623232350F, 0.5628068002F, 0.5632902642F, 0.5637736262F,
-    0.5642568858F, 0.5647400423F, 0.5652230953F, 0.5657060442F,
-    0.5661888883F, 0.5666716272F, 0.5671542603F, 0.5676367870F,
-    0.5681192069F, 0.5686015192F, 0.5690837235F, 0.5695658192F,
-    0.5700478058F, 0.5705296827F, 0.5710114494F, 0.5714931052F,
-    0.5719746497F, 0.5724560822F, 0.5729374023F, 0.5734186094F,
-    0.5738997029F, 0.5743806823F, 0.5748615470F, 0.5753422965F,
-    0.5758229301F, 0.5763034475F, 0.5767838480F, 0.5772641310F,
-    0.5777442960F, 0.5782243426F, 0.5787042700F, 0.5791840778F,
-    0.5796637654F, 0.5801433322F, 0.5806227778F, 0.5811021016F,
-    0.5815813029F, 0.5820603814F, 0.5825393363F, 0.5830181673F,
-    0.5834968737F, 0.5839754549F, 0.5844539105F, 0.5849322399F,
-    0.5854104425F, 0.5858885179F, 0.5863664653F, 0.5868442844F,
-    0.5873219746F, 0.5877995353F, 0.5882769660F, 0.5887542661F,
-    0.5892314351F, 0.5897084724F, 0.5901853776F, 0.5906621500F,
-    0.5911387892F, 0.5916152945F, 0.5920916655F, 0.5925679016F,
-    0.5930440022F, 0.5935199669F, 0.5939957950F, 0.5944714861F,
-    0.5949470396F, 0.5954224550F, 0.5958977317F, 0.5963728692F,
-    0.5968478669F, 0.5973227244F, 0.5977974411F, 0.5982720163F,
-    0.5987464497F, 0.5992207407F, 0.5996948887F, 0.6001688932F,
-    0.6006427537F, 0.6011164696F, 0.6015900405F, 0.6020634657F,
-    0.6025367447F, 0.6030098770F, 0.6034828621F, 0.6039556995F,
-    0.6044283885F, 0.6049009288F, 0.6053733196F, 0.6058455606F,
-    0.6063176512F, 0.6067895909F, 0.6072613790F, 0.6077330152F,
-    0.6082044989F, 0.6086758295F, 0.6091470065F, 0.6096180294F,
-    0.6100888977F, 0.6105596108F, 0.6110301682F, 0.6115005694F,
-    0.6119708139F, 0.6124409011F, 0.6129108305F, 0.6133806017F,
-    0.6138502139F, 0.6143196669F, 0.6147889599F, 0.6152580926F,
-    0.6157270643F, 0.6161958746F, 0.6166645230F, 0.6171330088F,
-    0.6176013317F, 0.6180694910F, 0.6185374863F, 0.6190053171F,
-    0.6194729827F, 0.6199404828F, 0.6204078167F, 0.6208749841F,
-    0.6213419842F, 0.6218088168F, 0.6222754811F, 0.6227419768F,
-    0.6232083032F, 0.6236744600F, 0.6241404465F, 0.6246062622F,
-    0.6250719067F, 0.6255373795F, 0.6260026799F, 0.6264678076F,
-    0.6269327619F, 0.6273975425F, 0.6278621487F, 0.6283265800F,
-    0.6287908361F, 0.6292549163F, 0.6297188201F, 0.6301825471F,
-    0.6306460966F, 0.6311094683F, 0.6315726617F, 0.6320356761F,
-    0.6324985111F, 0.6329611662F, 0.6334236410F, 0.6338859348F,
-    0.6343480472F, 0.6348099777F, 0.6352717257F, 0.6357332909F,
-    0.6361946726F, 0.6366558704F, 0.6371168837F, 0.6375777122F,
-    0.6380383552F, 0.6384988123F, 0.6389590830F, 0.6394191668F,
-    0.6398790631F, 0.6403387716F, 0.6407982916F, 0.6412576228F,
-    0.6417167645F, 0.6421757163F, 0.6426344778F, 0.6430930483F,
-    0.6435514275F, 0.6440096149F, 0.6444676098F, 0.6449254119F,
-    0.6453830207F, 0.6458404356F, 0.6462976562F, 0.6467546820F,
-    0.6472115125F, 0.6476681472F, 0.6481245856F, 0.6485808273F,
-    0.6490368717F, 0.6494927183F, 0.6499483667F, 0.6504038164F,
-    0.6508590670F, 0.6513141178F, 0.6517689684F, 0.6522236185F,
-    0.6526780673F, 0.6531323146F, 0.6535863598F, 0.6540402024F,
-    0.6544938419F, 0.6549472779F, 0.6554005099F, 0.6558535373F,
-    0.6563063598F, 0.6567589769F, 0.6572113880F, 0.6576635927F,
-    0.6581155906F, 0.6585673810F, 0.6590189637F, 0.6594703380F,
-    0.6599215035F, 0.6603724598F, 0.6608232064F, 0.6612737427F,
-    0.6617240684F, 0.6621741829F, 0.6626240859F, 0.6630737767F,
-    0.6635232550F, 0.6639725202F, 0.6644215720F, 0.6648704098F,
-    0.6653190332F, 0.6657674417F, 0.6662156348F, 0.6666636121F,
-    0.6671113731F, 0.6675589174F, 0.6680062445F, 0.6684533538F,
-    0.6689002450F, 0.6693469177F, 0.6697933712F, 0.6702396052F,
-    0.6706856193F, 0.6711314129F, 0.6715769855F, 0.6720223369F,
-    0.6724674664F, 0.6729123736F, 0.6733570581F, 0.6738015194F,
-    0.6742457570F, 0.6746897706F, 0.6751335596F, 0.6755771236F,
-    0.6760204621F, 0.6764635747F, 0.6769064609F, 0.6773491204F,
-    0.6777915525F, 0.6782337570F, 0.6786757332F, 0.6791174809F,
-    0.6795589995F, 0.6800002886F, 0.6804413477F, 0.6808821765F,
-    0.6813227743F, 0.6817631409F, 0.6822032758F, 0.6826431785F,
-    0.6830828485F, 0.6835222855F, 0.6839614890F, 0.6844004585F,
-    0.6848391936F, 0.6852776939F, 0.6857159589F, 0.6861539883F,
-    0.6865917815F, 0.6870293381F, 0.6874666576F, 0.6879037398F,
-    0.6883405840F, 0.6887771899F, 0.6892135571F, 0.6896496850F,
-    0.6900855733F, 0.6905212216F, 0.6909566294F, 0.6913917963F,
-    0.6918267218F, 0.6922614055F, 0.6926958471F, 0.6931300459F,
-    0.6935640018F, 0.6939977141F, 0.6944311825F, 0.6948644066F,
-    0.6952973859F, 0.6957301200F, 0.6961626085F, 0.6965948510F,
-    0.6970268470F, 0.6974585961F, 0.6978900980F, 0.6983213521F,
-    0.6987523580F, 0.6991831154F, 0.6996136238F, 0.7000438828F,
-    0.7004738921F, 0.7009036510F, 0.7013331594F, 0.7017624166F,
-    0.7021914224F, 0.7026201763F, 0.7030486779F, 0.7034769268F,
-    0.7039049226F, 0.7043326648F, 0.7047601531F, 0.7051873870F,
-    0.7056143662F, 0.7060410902F, 0.7064675586F, 0.7068937711F,
-    0.7073197271F, 0.7077454264F, 0.7081708684F, 0.7085960529F,
-    0.7090209793F, 0.7094456474F, 0.7098700566F, 0.7102942066F,
-    0.7107180970F, 0.7111417274F, 0.7115650974F, 0.7119882066F,
-    0.7124110545F, 0.7128336409F, 0.7132559653F, 0.7136780272F,
-    0.7140998264F, 0.7145213624F, 0.7149426348F, 0.7153636433F,
-    0.7157843874F, 0.7162048668F, 0.7166250810F, 0.7170450296F,
-    0.7174647124F, 0.7178841289F, 0.7183032786F, 0.7187221613F,
-    0.7191407765F, 0.7195591239F, 0.7199772030F, 0.7203950135F,
-    0.7208125550F, 0.7212298271F, 0.7216468294F, 0.7220635616F,
-    0.7224800233F, 0.7228962140F, 0.7233121335F, 0.7237277813F,
-    0.7241431571F, 0.7245582604F, 0.7249730910F, 0.7253876484F,
-    0.7258019322F, 0.7262159422F, 0.7266296778F, 0.7270431388F,
-    0.7274563247F, 0.7278692353F, 0.7282818700F, 0.7286942287F,
-    0.7291063108F, 0.7295181160F, 0.7299296440F, 0.7303408944F,
-    0.7307518669F, 0.7311625609F, 0.7315729763F, 0.7319831126F,
-    0.7323929695F, 0.7328025466F, 0.7332118435F, 0.7336208600F,
-    0.7340295955F, 0.7344380499F, 0.7348462226F, 0.7352541134F,
-    0.7356617220F, 0.7360690478F, 0.7364760907F, 0.7368828502F,
-    0.7372893259F, 0.7376955176F, 0.7381014249F, 0.7385070475F,
-    0.7389123849F, 0.7393174368F, 0.7397222029F, 0.7401266829F,
-    0.7405308763F, 0.7409347829F, 0.7413384023F, 0.7417417341F,
-    0.7421447780F, 0.7425475338F, 0.7429500009F, 0.7433521791F,
-    0.7437540681F, 0.7441556674F, 0.7445569769F, 0.7449579960F,
-    0.7453587245F, 0.7457591621F, 0.7461593084F, 0.7465591631F,
-    0.7469587259F, 0.7473579963F, 0.7477569741F, 0.7481556590F,
-    0.7485540506F, 0.7489521486F, 0.7493499526F, 0.7497474623F,
-    0.7501446775F, 0.7505415977F, 0.7509382227F, 0.7513345521F,
-    0.7517305856F, 0.7521263229F, 0.7525217636F, 0.7529169074F,
-    0.7533117541F, 0.7537063032F, 0.7541005545F, 0.7544945076F,
-    0.7548881623F, 0.7552815182F, 0.7556745749F, 0.7560673323F,
-    0.7564597899F, 0.7568519474F, 0.7572438046F, 0.7576353611F,
-    0.7580266166F, 0.7584175708F, 0.7588082235F, 0.7591985741F,
-    0.7595886226F, 0.7599783685F, 0.7603678116F, 0.7607569515F,
-    0.7611457879F, 0.7615343206F, 0.7619225493F, 0.7623104735F,
-    0.7626980931F, 0.7630854078F, 0.7634724171F, 0.7638591209F,
-    0.7642455188F, 0.7646316106F, 0.7650173959F, 0.7654028744F,
-    0.7657880459F, 0.7661729100F, 0.7665574664F, 0.7669417150F,
-    0.7673256553F, 0.7677092871F, 0.7680926100F, 0.7684756239F,
-    0.7688583284F, 0.7692407232F, 0.7696228080F, 0.7700045826F,
-    0.7703860467F, 0.7707671999F, 0.7711480420F, 0.7715285728F,
-    0.7719087918F, 0.7722886989F, 0.7726682938F, 0.7730475762F,
-    0.7734265458F, 0.7738052023F, 0.7741835454F, 0.7745615750F,
-    0.7749392906F, 0.7753166921F, 0.7756937791F, 0.7760705514F,
-    0.7764470087F, 0.7768231508F, 0.7771989773F, 0.7775744880F,
-    0.7779496827F, 0.7783245610F, 0.7786991227F, 0.7790733676F,
-    0.7794472953F, 0.7798209056F, 0.7801941982F, 0.7805671729F,
-    0.7809398294F, 0.7813121675F, 0.7816841869F, 0.7820558873F,
-    0.7824272684F, 0.7827983301F, 0.7831690720F, 0.7835394940F,
-    0.7839095957F, 0.7842793768F, 0.7846488373F, 0.7850179767F,
-    0.7853867948F, 0.7857552914F, 0.7861234663F, 0.7864913191F,
-    0.7868588497F, 0.7872260578F, 0.7875929431F, 0.7879595055F,
-    0.7883257445F, 0.7886916601F, 0.7890572520F, 0.7894225198F,
-    0.7897874635F, 0.7901520827F, 0.7905163772F, 0.7908803468F,
-    0.7912439912F, 0.7916073102F, 0.7919703035F, 0.7923329710F,
-    0.7926953124F, 0.7930573274F, 0.7934190158F, 0.7937803774F,
-    0.7941414120F, 0.7945021193F, 0.7948624991F, 0.7952225511F,
-    0.7955822752F, 0.7959416711F, 0.7963007387F, 0.7966594775F,
-    0.7970178875F, 0.7973759685F, 0.7977337201F, 0.7980911422F,
-    0.7984482346F, 0.7988049970F, 0.7991614292F, 0.7995175310F,
-    0.7998733022F, 0.8002287426F, 0.8005838519F, 0.8009386299F,
-    0.8012930765F, 0.8016471914F, 0.8020009744F, 0.8023544253F,
-    0.8027075438F, 0.8030603298F, 0.8034127831F, 0.8037649035F,
-    0.8041166906F, 0.8044681445F, 0.8048192647F, 0.8051700512F,
-    0.8055205038F, 0.8058706222F, 0.8062204062F, 0.8065698556F,
-    0.8069189702F, 0.8072677499F, 0.8076161944F, 0.8079643036F,
-    0.8083120772F, 0.8086595151F, 0.8090066170F, 0.8093533827F,
-    0.8096998122F, 0.8100459051F, 0.8103916613F, 0.8107370806F,
-    0.8110821628F, 0.8114269077F, 0.8117713151F, 0.8121153849F,
-    0.8124591169F, 0.8128025108F, 0.8131455666F, 0.8134882839F,
-    0.8138306627F, 0.8141727027F, 0.8145144038F, 0.8148557658F,
-    0.8151967886F, 0.8155374718F, 0.8158778154F, 0.8162178192F,
-    0.8165574830F, 0.8168968067F, 0.8172357900F, 0.8175744328F,
-    0.8179127349F, 0.8182506962F, 0.8185883164F, 0.8189255955F,
-    0.8192625332F, 0.8195991295F, 0.8199353840F, 0.8202712967F,
-    0.8206068673F, 0.8209420958F, 0.8212769820F, 0.8216115256F,
-    0.8219457266F, 0.8222795848F, 0.8226131000F, 0.8229462721F,
-    0.8232791009F, 0.8236115863F, 0.8239437280F, 0.8242755260F,
-    0.8246069801F, 0.8249380901F, 0.8252688559F, 0.8255992774F,
-    0.8259293544F, 0.8262590867F, 0.8265884741F, 0.8269175167F,
-    0.8272462141F, 0.8275745663F, 0.8279025732F, 0.8282302344F,
-    0.8285575501F, 0.8288845199F, 0.8292111437F, 0.8295374215F,
-    0.8298633530F, 0.8301889382F, 0.8305141768F, 0.8308390688F,
-    0.8311636141F, 0.8314878124F, 0.8318116637F, 0.8321351678F,
-    0.8324583246F, 0.8327811340F, 0.8331035957F, 0.8334257098F,
-    0.8337474761F, 0.8340688944F, 0.8343899647F, 0.8347106867F,
-    0.8350310605F, 0.8353510857F, 0.8356707624F, 0.8359900904F,
-    0.8363090696F, 0.8366276999F, 0.8369459811F, 0.8372639131F,
-    0.8375814958F, 0.8378987292F, 0.8382156130F, 0.8385321472F,
-    0.8388483316F, 0.8391641662F, 0.8394796508F, 0.8397947853F,
-    0.8401095697F, 0.8404240037F, 0.8407380873F, 0.8410518204F,
-    0.8413652029F, 0.8416782347F, 0.8419909156F, 0.8423032456F,
-    0.8426152245F, 0.8429268523F, 0.8432381289F, 0.8435490541F,
-    0.8438596279F, 0.8441698502F, 0.8444797208F, 0.8447892396F,
-    0.8450984067F, 0.8454072218F, 0.8457156849F, 0.8460237959F,
-    0.8463315547F, 0.8466389612F, 0.8469460154F, 0.8472527170F,
-    0.8475590661F, 0.8478650625F, 0.8481707063F, 0.8484759971F,
-    0.8487809351F, 0.8490855201F, 0.8493897521F, 0.8496936308F,
-    0.8499971564F, 0.8503003286F, 0.8506031474F, 0.8509056128F,
-    0.8512077246F, 0.8515094828F, 0.8518108872F, 0.8521119379F,
-    0.8524126348F, 0.8527129777F, 0.8530129666F, 0.8533126015F,
-    0.8536118822F, 0.8539108087F, 0.8542093809F, 0.8545075988F,
-    0.8548054623F, 0.8551029712F, 0.8554001257F, 0.8556969255F,
-    0.8559933707F, 0.8562894611F, 0.8565851968F, 0.8568805775F,
-    0.8571756034F, 0.8574702743F, 0.8577645902F, 0.8580585509F,
-    0.8583521566F, 0.8586454070F, 0.8589383021F, 0.8592308420F,
-    0.8595230265F, 0.8598148556F, 0.8601063292F, 0.8603974473F,
-    0.8606882098F, 0.8609786167F, 0.8612686680F, 0.8615583636F,
-    0.8618477034F, 0.8621366874F, 0.8624253156F, 0.8627135878F,
-    0.8630015042F, 0.8632890646F, 0.8635762690F, 0.8638631173F,
-    0.8641496096F, 0.8644357457F, 0.8647215257F, 0.8650069495F,
-    0.8652920171F, 0.8655767283F, 0.8658610833F, 0.8661450820F,
-    0.8664287243F, 0.8667120102F, 0.8669949397F, 0.8672775127F,
-    0.8675597293F, 0.8678415894F, 0.8681230929F, 0.8684042398F,
-    0.8686850302F, 0.8689654640F, 0.8692455412F, 0.8695252617F,
-    0.8698046255F, 0.8700836327F, 0.8703622831F, 0.8706405768F,
-    0.8709185138F, 0.8711960940F, 0.8714733174F, 0.8717501840F,
-    0.8720266939F, 0.8723028469F, 0.8725786430F, 0.8728540824F,
-    0.8731291648F, 0.8734038905F, 0.8736782592F, 0.8739522711F,
-    0.8742259261F, 0.8744992242F, 0.8747721653F, 0.8750447496F,
-    0.8753169770F, 0.8755888475F, 0.8758603611F, 0.8761315177F,
-    0.8764023175F, 0.8766727603F, 0.8769428462F, 0.8772125752F,
-    0.8774819474F, 0.8777509626F, 0.8780196209F, 0.8782879224F,
-    0.8785558669F, 0.8788234546F, 0.8790906854F, 0.8793575594F,
-    0.8796240765F, 0.8798902368F, 0.8801560403F, 0.8804214870F,
-    0.8806865768F, 0.8809513099F, 0.8812156863F, 0.8814797059F,
-    0.8817433687F, 0.8820066749F, 0.8822696243F, 0.8825322171F,
-    0.8827944532F, 0.8830563327F, 0.8833178556F, 0.8835790219F,
-    0.8838398316F, 0.8841002848F, 0.8843603815F, 0.8846201217F,
-    0.8848795054F, 0.8851385327F, 0.8853972036F, 0.8856555182F,
-    0.8859134764F, 0.8861710783F, 0.8864283239F, 0.8866852133F,
-    0.8869417464F, 0.8871979234F, 0.8874537443F, 0.8877092090F,
-    0.8879643177F, 0.8882190704F, 0.8884734671F, 0.8887275078F,
-    0.8889811927F, 0.8892345216F, 0.8894874948F, 0.8897401122F,
-    0.8899923738F, 0.8902442798F, 0.8904958301F, 0.8907470248F,
-    0.8909978640F, 0.8912483477F, 0.8914984759F, 0.8917482487F,
-    0.8919976662F, 0.8922467284F, 0.8924954353F, 0.8927437871F,
-    0.8929917837F, 0.8932394252F, 0.8934867118F, 0.8937336433F,
-    0.8939802199F, 0.8942264417F, 0.8944723087F, 0.8947178210F,
-    0.8949629785F, 0.8952077815F, 0.8954522299F, 0.8956963239F,
-    0.8959400634F, 0.8961834486F, 0.8964264795F, 0.8966691561F,
-    0.8969114786F, 0.8971534470F, 0.8973950614F, 0.8976363219F,
-    0.8978772284F, 0.8981177812F, 0.8983579802F, 0.8985978256F,
-    0.8988373174F, 0.8990764556F, 0.8993152405F, 0.8995536720F,
-    0.8997917502F, 0.9000294751F, 0.9002668470F, 0.9005038658F,
-    0.9007405317F, 0.9009768446F, 0.9012128048F, 0.9014484123F,
-    0.9016836671F, 0.9019185693F, 0.9021531191F, 0.9023873165F,
-    0.9026211616F, 0.9028546546F, 0.9030877954F, 0.9033205841F,
-    0.9035530210F, 0.9037851059F, 0.9040168392F, 0.9042482207F,
-    0.9044792507F, 0.9047099293F, 0.9049402564F, 0.9051702323F,
-    0.9053998569F, 0.9056291305F, 0.9058580531F, 0.9060866248F,
-    0.9063148457F, 0.9065427159F, 0.9067702355F, 0.9069974046F,
-    0.9072242233F, 0.9074506917F, 0.9076768100F, 0.9079025782F,
-    0.9081279964F, 0.9083530647F, 0.9085777833F, 0.9088021523F,
-    0.9090261717F, 0.9092498417F, 0.9094731623F, 0.9096961338F,
-    0.9099187561F, 0.9101410295F, 0.9103629540F, 0.9105845297F,
-    0.9108057568F, 0.9110266354F, 0.9112471656F, 0.9114673475F,
-    0.9116871812F, 0.9119066668F, 0.9121258046F, 0.9123445945F,
-    0.9125630367F, 0.9127811314F, 0.9129988786F, 0.9132162785F,
-    0.9134333312F, 0.9136500368F, 0.9138663954F, 0.9140824073F,
-    0.9142980724F, 0.9145133910F, 0.9147283632F, 0.9149429890F,
-    0.9151572687F, 0.9153712023F, 0.9155847900F, 0.9157980319F,
-    0.9160109282F, 0.9162234790F, 0.9164356844F, 0.9166475445F,
-    0.9168590595F, 0.9170702296F, 0.9172810548F, 0.9174915354F,
-    0.9177016714F, 0.9179114629F, 0.9181209102F, 0.9183300134F,
-    0.9185387726F, 0.9187471879F, 0.9189552595F, 0.9191629876F,
-    0.9193703723F, 0.9195774136F, 0.9197841119F, 0.9199904672F,
-    0.9201964797F, 0.9204021495F, 0.9206074767F, 0.9208124616F,
-    0.9210171043F, 0.9212214049F, 0.9214253636F, 0.9216289805F,
-    0.9218322558F, 0.9220351896F, 0.9222377821F, 0.9224400335F,
-    0.9226419439F, 0.9228435134F, 0.9230447423F, 0.9232456307F,
-    0.9234461787F, 0.9236463865F, 0.9238462543F, 0.9240457822F,
-    0.9242449704F, 0.9244438190F, 0.9246423282F, 0.9248404983F,
-    0.9250383293F, 0.9252358214F, 0.9254329747F, 0.9256297896F,
-    0.9258262660F, 0.9260224042F, 0.9262182044F, 0.9264136667F,
-    0.9266087913F, 0.9268035783F, 0.9269980280F, 0.9271921405F,
-    0.9273859160F, 0.9275793546F, 0.9277724566F, 0.9279652221F,
-    0.9281576513F, 0.9283497443F, 0.9285415014F, 0.9287329227F,
-    0.9289240084F, 0.9291147586F, 0.9293051737F, 0.9294952536F,
-    0.9296849987F, 0.9298744091F, 0.9300634850F, 0.9302522266F,
-    0.9304406340F, 0.9306287074F, 0.9308164471F, 0.9310038532F,
-    0.9311909259F, 0.9313776654F, 0.9315640719F, 0.9317501455F,
-    0.9319358865F, 0.9321212951F, 0.9323063713F, 0.9324911155F,
-    0.9326755279F, 0.9328596085F, 0.9330433577F, 0.9332267756F,
-    0.9334098623F, 0.9335926182F, 0.9337750434F, 0.9339571380F,
-    0.9341389023F, 0.9343203366F, 0.9345014409F, 0.9346822155F,
-    0.9348626606F, 0.9350427763F, 0.9352225630F, 0.9354020207F,
-    0.9355811498F, 0.9357599503F, 0.9359384226F, 0.9361165667F,
-    0.9362943830F, 0.9364718716F, 0.9366490327F, 0.9368258666F,
-    0.9370023733F, 0.9371785533F, 0.9373544066F, 0.9375299335F,
-    0.9377051341F, 0.9378800087F, 0.9380545576F, 0.9382287809F,
-    0.9384026787F, 0.9385762515F, 0.9387494993F, 0.9389224223F,
-    0.9390950209F, 0.9392672951F, 0.9394392453F, 0.9396108716F,
-    0.9397821743F, 0.9399531536F, 0.9401238096F, 0.9402941427F,
-    0.9404641530F, 0.9406338407F, 0.9408032061F, 0.9409722495F,
-    0.9411409709F, 0.9413093707F, 0.9414774491F, 0.9416452062F,
-    0.9418126424F, 0.9419797579F, 0.9421465528F, 0.9423130274F,
-    0.9424791819F, 0.9426450166F, 0.9428105317F, 0.9429757274F,
-    0.9431406039F, 0.9433051616F, 0.9434694005F, 0.9436333209F,
-    0.9437969232F, 0.9439602074F, 0.9441231739F, 0.9442858229F,
-    0.9444481545F, 0.9446101691F, 0.9447718669F, 0.9449332481F,
-    0.9450943129F, 0.9452550617F, 0.9454154945F, 0.9455756118F,
-    0.9457354136F, 0.9458949003F, 0.9460540721F, 0.9462129292F,
-    0.9463714719F, 0.9465297003F, 0.9466876149F, 0.9468452157F,
-    0.9470025031F, 0.9471594772F, 0.9473161384F, 0.9474724869F,
-    0.9476285229F, 0.9477842466F, 0.9479396584F, 0.9480947585F,
-    0.9482495470F, 0.9484040243F, 0.9485581906F, 0.9487120462F,
-    0.9488655913F, 0.9490188262F, 0.9491717511F, 0.9493243662F,
-    0.9494766718F, 0.9496286683F, 0.9497803557F, 0.9499317345F,
-    0.9500828047F, 0.9502335668F, 0.9503840209F, 0.9505341673F,
-    0.9506840062F, 0.9508335380F, 0.9509827629F, 0.9511316810F,
-    0.9512802928F, 0.9514285984F, 0.9515765982F, 0.9517242923F,
-    0.9518716810F, 0.9520187646F, 0.9521655434F, 0.9523120176F,
-    0.9524581875F, 0.9526040534F, 0.9527496154F, 0.9528948739F,
-    0.9530398292F, 0.9531844814F, 0.9533288310F, 0.9534728780F,
-    0.9536166229F, 0.9537600659F, 0.9539032071F, 0.9540460470F,
-    0.9541885858F, 0.9543308237F, 0.9544727611F, 0.9546143981F,
-    0.9547557351F, 0.9548967723F, 0.9550375100F, 0.9551779485F,
-    0.9553180881F, 0.9554579290F, 0.9555974714F, 0.9557367158F,
-    0.9558756623F, 0.9560143112F, 0.9561526628F, 0.9562907174F,
-    0.9564284752F, 0.9565659366F, 0.9567031017F, 0.9568399710F,
-    0.9569765446F, 0.9571128229F, 0.9572488061F, 0.9573844944F,
-    0.9575198883F, 0.9576549879F, 0.9577897936F, 0.9579243056F,
-    0.9580585242F, 0.9581924497F, 0.9583260824F, 0.9584594226F,
-    0.9585924705F, 0.9587252264F, 0.9588576906F, 0.9589898634F,
-    0.9591217452F, 0.9592533360F, 0.9593846364F, 0.9595156465F,
-    0.9596463666F, 0.9597767971F, 0.9599069382F, 0.9600367901F,
-    0.9601663533F, 0.9602956279F, 0.9604246143F, 0.9605533128F,
-    0.9606817236F, 0.9608098471F, 0.9609376835F, 0.9610652332F,
-    0.9611924963F, 0.9613194733F, 0.9614461644F, 0.9615725699F,
-    0.9616986901F, 0.9618245253F, 0.9619500757F, 0.9620753418F,
-    0.9622003238F, 0.9623250219F, 0.9624494365F, 0.9625735679F,
-    0.9626974163F, 0.9628209821F, 0.9629442656F, 0.9630672671F,
-    0.9631899868F, 0.9633124251F, 0.9634345822F, 0.9635564585F,
-    0.9636780543F, 0.9637993699F, 0.9639204056F, 0.9640411616F,
-    0.9641616383F, 0.9642818359F, 0.9644017549F, 0.9645213955F,
-    0.9646407579F, 0.9647598426F, 0.9648786497F, 0.9649971797F,
-    0.9651154328F, 0.9652334092F, 0.9653511095F, 0.9654685337F,
-    0.9655856823F, 0.9657025556F, 0.9658191538F, 0.9659354773F,
-    0.9660515263F, 0.9661673013F, 0.9662828024F, 0.9663980300F,
-    0.9665129845F, 0.9666276660F, 0.9667420750F, 0.9668562118F,
-    0.9669700766F, 0.9670836698F, 0.9671969917F, 0.9673100425F,
-    0.9674228227F, 0.9675353325F, 0.9676475722F, 0.9677595422F,
-    0.9678712428F, 0.9679826742F, 0.9680938368F, 0.9682047309F,
-    0.9683153569F, 0.9684257150F, 0.9685358056F, 0.9686456289F,
-    0.9687551853F, 0.9688644752F, 0.9689734987F, 0.9690822564F,
-    0.9691907483F, 0.9692989750F, 0.9694069367F, 0.9695146337F,
-    0.9696220663F, 0.9697292349F, 0.9698361398F, 0.9699427813F,
-    0.9700491597F, 0.9701552754F, 0.9702611286F, 0.9703667197F,
-    0.9704720490F, 0.9705771169F, 0.9706819236F, 0.9707864695F,
-    0.9708907549F, 0.9709947802F, 0.9710985456F, 0.9712020514F,
-    0.9713052981F, 0.9714082859F, 0.9715110151F, 0.9716134862F,
-    0.9717156993F, 0.9718176549F, 0.9719193532F, 0.9720207946F,
-    0.9721219794F, 0.9722229080F, 0.9723235806F, 0.9724239976F,
-    0.9725241593F, 0.9726240661F, 0.9727237183F, 0.9728231161F,
-    0.9729222601F, 0.9730211503F, 0.9731197873F, 0.9732181713F,
-    0.9733163027F, 0.9734141817F, 0.9735118088F, 0.9736091842F,
-    0.9737063083F, 0.9738031814F, 0.9738998039F, 0.9739961760F,
-    0.9740922981F, 0.9741881706F, 0.9742837938F, 0.9743791680F,
-    0.9744742935F, 0.9745691707F, 0.9746637999F, 0.9747581814F,
-    0.9748523157F, 0.9749462029F, 0.9750398435F, 0.9751332378F,
-    0.9752263861F, 0.9753192887F, 0.9754119461F, 0.9755043585F,
-    0.9755965262F, 0.9756884496F, 0.9757801291F, 0.9758715650F,
-    0.9759627575F, 0.9760537071F, 0.9761444141F, 0.9762348789F,
-    0.9763251016F, 0.9764150828F, 0.9765048228F, 0.9765943218F,
-    0.9766835802F, 0.9767725984F, 0.9768613767F, 0.9769499154F,
-    0.9770382149F, 0.9771262755F, 0.9772140976F, 0.9773016815F,
-    0.9773890275F, 0.9774761360F, 0.9775630073F, 0.9776496418F,
-    0.9777360398F, 0.9778222016F, 0.9779081277F, 0.9779938182F,
-    0.9780792736F, 0.9781644943F, 0.9782494805F, 0.9783342326F,
-    0.9784187509F, 0.9785030359F, 0.9785870877F, 0.9786709069F,
-    0.9787544936F, 0.9788378484F, 0.9789209714F, 0.9790038631F,
-    0.9790865238F, 0.9791689538F, 0.9792511535F, 0.9793331232F,
-    0.9794148633F, 0.9794963742F, 0.9795776561F, 0.9796587094F,
-    0.9797395345F, 0.9798201316F, 0.9799005013F, 0.9799806437F,
-    0.9800605593F, 0.9801402483F, 0.9802197112F, 0.9802989483F,
-    0.9803779600F, 0.9804567465F, 0.9805353082F, 0.9806136455F,
-    0.9806917587F, 0.9807696482F, 0.9808473143F, 0.9809247574F,
-    0.9810019778F, 0.9810789759F, 0.9811557519F, 0.9812323064F,
-    0.9813086395F, 0.9813847517F, 0.9814606433F, 0.9815363147F,
-    0.9816117662F, 0.9816869981F, 0.9817620108F, 0.9818368047F,
-    0.9819113801F, 0.9819857374F, 0.9820598769F, 0.9821337989F,
-    0.9822075038F, 0.9822809920F, 0.9823542638F, 0.9824273195F,
-    0.9825001596F, 0.9825727843F, 0.9826451940F, 0.9827173891F,
-    0.9827893700F, 0.9828611368F, 0.9829326901F, 0.9830040302F,
-    0.9830751574F, 0.9831460720F, 0.9832167745F, 0.9832872652F,
-    0.9833575444F, 0.9834276124F, 0.9834974697F, 0.9835671166F,
-    0.9836365535F, 0.9837057806F, 0.9837747983F, 0.9838436071F,
-    0.9839122072F, 0.9839805990F, 0.9840487829F, 0.9841167591F,
-    0.9841845282F, 0.9842520903F, 0.9843194459F, 0.9843865953F,
-    0.9844535389F, 0.9845202771F, 0.9845868101F, 0.9846531383F,
-    0.9847192622F, 0.9847851820F, 0.9848508980F, 0.9849164108F,
-    0.9849817205F, 0.9850468276F, 0.9851117324F, 0.9851764352F,
-    0.9852409365F, 0.9853052366F, 0.9853693358F, 0.9854332344F,
-    0.9854969330F, 0.9855604317F, 0.9856237309F, 0.9856868310F,
-    0.9857497325F, 0.9858124355F, 0.9858749404F, 0.9859372477F,
-    0.9859993577F, 0.9860612707F, 0.9861229871F, 0.9861845072F,
-    0.9862458315F, 0.9863069601F, 0.9863678936F, 0.9864286322F,
-    0.9864891764F, 0.9865495264F, 0.9866096826F, 0.9866696454F,
-    0.9867294152F, 0.9867889922F, 0.9868483769F, 0.9869075695F,
-    0.9869665706F, 0.9870253803F, 0.9870839991F, 0.9871424273F,
-    0.9872006653F, 0.9872587135F, 0.9873165721F, 0.9873742415F,
-    0.9874317222F, 0.9874890144F, 0.9875461185F, 0.9876030348F,
-    0.9876597638F, 0.9877163057F, 0.9877726610F, 0.9878288300F,
-    0.9878848130F, 0.9879406104F, 0.9879962225F, 0.9880516497F,
-    0.9881068924F, 0.9881619509F, 0.9882168256F, 0.9882715168F,
-    0.9883260249F, 0.9883803502F, 0.9884344931F, 0.9884884539F,
-    0.9885422331F, 0.9885958309F, 0.9886492477F, 0.9887024838F,
-    0.9887555397F, 0.9888084157F, 0.9888611120F, 0.9889136292F,
-    0.9889659675F, 0.9890181273F, 0.9890701089F, 0.9891219128F,
-    0.9891735392F, 0.9892249885F, 0.9892762610F, 0.9893273572F,
-    0.9893782774F, 0.9894290219F, 0.9894795911F, 0.9895299853F,
-    0.9895802049F, 0.9896302502F, 0.9896801217F, 0.9897298196F,
-    0.9897793443F, 0.9898286961F, 0.9898778755F, 0.9899268828F,
-    0.9899757183F, 0.9900243823F, 0.9900728753F, 0.9901211976F,
-    0.9901693495F, 0.9902173314F, 0.9902651436F, 0.9903127865F,
-    0.9903602605F, 0.9904075659F, 0.9904547031F, 0.9905016723F,
-    0.9905484740F, 0.9905951086F, 0.9906415763F, 0.9906878775F,
-    0.9907340126F, 0.9907799819F, 0.9908257858F, 0.9908714247F,
-    0.9909168988F, 0.9909622086F, 0.9910073543F, 0.9910523364F,
-    0.9910971552F, 0.9911418110F, 0.9911863042F, 0.9912306351F,
-    0.9912748042F, 0.9913188117F, 0.9913626580F, 0.9914063435F,
-    0.9914498684F, 0.9914932333F, 0.9915364383F, 0.9915794839F,
-    0.9916223703F, 0.9916650981F, 0.9917076674F, 0.9917500787F,
-    0.9917923323F, 0.9918344286F, 0.9918763679F, 0.9919181505F,
-    0.9919597769F, 0.9920012473F, 0.9920425621F, 0.9920837217F,
-    0.9921247263F, 0.9921655765F, 0.9922062724F, 0.9922468145F,
-    0.9922872030F, 0.9923274385F, 0.9923675211F, 0.9924074513F,
-    0.9924472294F, 0.9924868557F, 0.9925263306F, 0.9925656544F,
-    0.9926048275F, 0.9926438503F, 0.9926827230F, 0.9927214461F,
-    0.9927600199F, 0.9927984446F, 0.9928367208F, 0.9928748486F,
-    0.9929128285F, 0.9929506608F, 0.9929883459F, 0.9930258841F,
-    0.9930632757F, 0.9931005211F, 0.9931376207F, 0.9931745747F,
-    0.9932113836F, 0.9932480476F, 0.9932845671F, 0.9933209425F,
-    0.9933571742F, 0.9933932623F, 0.9934292074F, 0.9934650097F,
-    0.9935006696F, 0.9935361874F, 0.9935715635F, 0.9936067982F,
-    0.9936418919F, 0.9936768448F, 0.9937116574F, 0.9937463300F,
-    0.9937808629F, 0.9938152565F, 0.9938495111F, 0.9938836271F,
-    0.9939176047F, 0.9939514444F, 0.9939851465F, 0.9940187112F,
-    0.9940521391F, 0.9940854303F, 0.9941185853F, 0.9941516044F,
-    0.9941844879F, 0.9942172361F, 0.9942498495F, 0.9942823283F,
-    0.9943146729F, 0.9943468836F, 0.9943789608F, 0.9944109047F,
-    0.9944427158F, 0.9944743944F, 0.9945059408F, 0.9945373553F,
-    0.9945686384F, 0.9945997902F, 0.9946308112F, 0.9946617017F,
-    0.9946924621F, 0.9947230926F, 0.9947535937F, 0.9947839656F,
-    0.9948142086F, 0.9948443232F, 0.9948743097F, 0.9949041683F,
-    0.9949338995F, 0.9949635035F, 0.9949929807F, 0.9950223315F,
-    0.9950515561F, 0.9950806549F, 0.9951096282F, 0.9951384764F,
-    0.9951671998F, 0.9951957987F, 0.9952242735F, 0.9952526245F,
-    0.9952808520F, 0.9953089564F, 0.9953369380F, 0.9953647971F,
-    0.9953925340F, 0.9954201491F, 0.9954476428F, 0.9954750153F,
-    0.9955022670F, 0.9955293981F, 0.9955564092F, 0.9955833003F,
-    0.9956100720F, 0.9956367245F, 0.9956632582F, 0.9956896733F,
-    0.9957159703F, 0.9957421494F, 0.9957682110F, 0.9957941553F,
-    0.9958199828F, 0.9958456937F, 0.9958712884F, 0.9958967672F,
-    0.9959221305F, 0.9959473784F, 0.9959725115F, 0.9959975300F,
-    0.9960224342F, 0.9960472244F, 0.9960719011F, 0.9960964644F,
-    0.9961209148F, 0.9961452525F, 0.9961694779F, 0.9961935913F,
-    0.9962175930F, 0.9962414834F, 0.9962652627F, 0.9962889313F,
-    0.9963124895F, 0.9963359377F, 0.9963592761F, 0.9963825051F,
-    0.9964056250F, 0.9964286361F, 0.9964515387F, 0.9964743332F,
-    0.9964970198F, 0.9965195990F, 0.9965420709F, 0.9965644360F,
-    0.9965866946F, 0.9966088469F, 0.9966308932F, 0.9966528340F,
-    0.9966746695F, 0.9966964001F, 0.9967180260F, 0.9967395475F,
-    0.9967609651F, 0.9967822789F, 0.9968034894F, 0.9968245968F,
-    0.9968456014F, 0.9968665036F, 0.9968873037F, 0.9969080019F,
-    0.9969285987F, 0.9969490942F, 0.9969694889F, 0.9969897830F,
-    0.9970099769F, 0.9970300708F, 0.9970500651F, 0.9970699601F,
-    0.9970897561F, 0.9971094533F, 0.9971290522F, 0.9971485531F,
-    0.9971679561F, 0.9971872617F, 0.9972064702F, 0.9972255818F,
-    0.9972445968F, 0.9972635157F, 0.9972823386F, 0.9973010659F,
-    0.9973196980F, 0.9973382350F, 0.9973566773F, 0.9973750253F,
-    0.9973932791F, 0.9974114392F, 0.9974295059F, 0.9974474793F,
-    0.9974653599F, 0.9974831480F, 0.9975008438F, 0.9975184476F,
-    0.9975359598F, 0.9975533806F, 0.9975707104F, 0.9975879495F,
-    0.9976050981F, 0.9976221566F, 0.9976391252F, 0.9976560043F,
-    0.9976727941F, 0.9976894950F, 0.9977061073F, 0.9977226312F,
-    0.9977390671F, 0.9977554152F, 0.9977716759F, 0.9977878495F,
-    0.9978039361F, 0.9978199363F, 0.9978358501F, 0.9978516780F,
-    0.9978674202F, 0.9978830771F, 0.9978986488F, 0.9979141358F,
-    0.9979295383F, 0.9979448566F, 0.9979600909F, 0.9979752417F,
-    0.9979903091F, 0.9980052936F, 0.9980201952F, 0.9980350145F,
-    0.9980497515F, 0.9980644067F, 0.9980789804F, 0.9980934727F,
-    0.9981078841F, 0.9981222147F, 0.9981364649F, 0.9981506350F,
-    0.9981647253F, 0.9981787360F, 0.9981926674F, 0.9982065199F,
-    0.9982202936F, 0.9982339890F, 0.9982476062F, 0.9982611456F,
-    0.9982746074F, 0.9982879920F, 0.9983012996F, 0.9983145304F,
-    0.9983276849F, 0.9983407632F, 0.9983537657F, 0.9983666926F,
-    0.9983795442F, 0.9983923208F, 0.9984050226F, 0.9984176501F,
-    0.9984302033F, 0.9984426827F, 0.9984550884F, 0.9984674208F,
-    0.9984796802F, 0.9984918667F, 0.9985039808F, 0.9985160227F,
-    0.9985279926F, 0.9985398909F, 0.9985517177F, 0.9985634734F,
-    0.9985751583F, 0.9985867727F, 0.9985983167F, 0.9986097907F,
-    0.9986211949F, 0.9986325297F, 0.9986437953F, 0.9986549919F,
-    0.9986661199F, 0.9986771795F, 0.9986881710F, 0.9986990946F,
-    0.9987099507F, 0.9987207394F, 0.9987314611F, 0.9987421161F,
-    0.9987527045F, 0.9987632267F, 0.9987736829F, 0.9987840734F,
-    0.9987943985F, 0.9988046584F, 0.9988148534F, 0.9988249838F,
-    0.9988350498F, 0.9988450516F, 0.9988549897F, 0.9988648641F,
-    0.9988746753F, 0.9988844233F, 0.9988941086F, 0.9989037313F,
-    0.9989132918F, 0.9989227902F, 0.9989322269F, 0.9989416021F,
-    0.9989509160F, 0.9989601690F, 0.9989693613F, 0.9989784931F,
-    0.9989875647F, 0.9989965763F, 0.9990055283F, 0.9990144208F,
-    0.9990232541F, 0.9990320286F, 0.9990407443F, 0.9990494016F,
-    0.9990580008F, 0.9990665421F, 0.9990750257F, 0.9990834519F,
-    0.9990918209F, 0.9991001331F, 0.9991083886F, 0.9991165877F,
-    0.9991247307F, 0.9991328177F, 0.9991408491F, 0.9991488251F,
-    0.9991567460F, 0.9991646119F, 0.9991724232F, 0.9991801801F,
-    0.9991878828F, 0.9991955316F, 0.9992031267F, 0.9992106684F,
-    0.9992181569F, 0.9992255925F, 0.9992329753F, 0.9992403057F,
-    0.9992475839F, 0.9992548101F, 0.9992619846F, 0.9992691076F,
-    0.9992761793F, 0.9992832001F, 0.9992901701F, 0.9992970895F,
-    0.9993039587F, 0.9993107777F, 0.9993175470F, 0.9993242667F,
-    0.9993309371F, 0.9993375583F, 0.9993441307F, 0.9993506545F,
-    0.9993571298F, 0.9993635570F, 0.9993699362F, 0.9993762678F,
-    0.9993825519F, 0.9993887887F, 0.9993949785F, 0.9994011216F,
-    0.9994072181F, 0.9994132683F, 0.9994192725F, 0.9994252307F,
-    0.9994311434F, 0.9994370107F, 0.9994428327F, 0.9994486099F,
-    0.9994543423F, 0.9994600303F, 0.9994656739F, 0.9994712736F,
-    0.9994768294F, 0.9994823417F, 0.9994878105F, 0.9994932363F,
-    0.9994986191F, 0.9995039592F, 0.9995092568F, 0.9995145122F,
-    0.9995197256F, 0.9995248971F, 0.9995300270F, 0.9995351156F,
-    0.9995401630F, 0.9995451695F, 0.9995501352F, 0.9995550604F,
-    0.9995599454F, 0.9995647903F, 0.9995695953F, 0.9995743607F,
-    0.9995790866F, 0.9995837734F, 0.9995884211F, 0.9995930300F,
-    0.9995976004F, 0.9996021324F, 0.9996066263F, 0.9996110822F,
-    0.9996155004F, 0.9996198810F, 0.9996242244F, 0.9996285306F,
-    0.9996327999F, 0.9996370326F, 0.9996412287F, 0.9996453886F,
-    0.9996495125F, 0.9996536004F, 0.9996576527F, 0.9996616696F,
-    0.9996656512F, 0.9996695977F, 0.9996735094F, 0.9996773865F,
-    0.9996812291F, 0.9996850374F, 0.9996888118F, 0.9996925523F,
-    0.9996962591F, 0.9996999325F, 0.9997035727F, 0.9997071798F,
-    0.9997107541F, 0.9997142957F, 0.9997178049F, 0.9997212818F,
-    0.9997247266F, 0.9997281396F, 0.9997315209F, 0.9997348708F,
-    0.9997381893F, 0.9997414767F, 0.9997447333F, 0.9997479591F,
-    0.9997511544F, 0.9997543194F, 0.9997574542F, 0.9997605591F,
-    0.9997636342F, 0.9997666797F, 0.9997696958F, 0.9997726828F,
-    0.9997756407F, 0.9997785698F, 0.9997814703F, 0.9997843423F,
-    0.9997871860F, 0.9997900016F, 0.9997927894F, 0.9997955494F,
-    0.9997982818F, 0.9998009869F, 0.9998036648F, 0.9998063157F,
-    0.9998089398F, 0.9998115373F, 0.9998141082F, 0.9998166529F,
-    0.9998191715F, 0.9998216642F, 0.9998241311F, 0.9998265724F,
-    0.9998289884F, 0.9998313790F, 0.9998337447F, 0.9998360854F,
-    0.9998384015F, 0.9998406930F, 0.9998429602F, 0.9998452031F,
-    0.9998474221F, 0.9998496171F, 0.9998517885F, 0.9998539364F,
-    0.9998560610F, 0.9998581624F, 0.9998602407F, 0.9998622962F,
-    0.9998643291F, 0.9998663394F, 0.9998683274F, 0.9998702932F,
-    0.9998722370F, 0.9998741589F, 0.9998760591F, 0.9998779378F,
-    0.9998797952F, 0.9998816313F, 0.9998834464F, 0.9998852406F,
-    0.9998870141F, 0.9998887670F, 0.9998904995F, 0.9998922117F,
-    0.9998939039F, 0.9998955761F, 0.9998972285F, 0.9998988613F,
-    0.9999004746F, 0.9999020686F, 0.9999036434F, 0.9999051992F,
-    0.9999067362F, 0.9999082544F, 0.9999097541F, 0.9999112354F,
-    0.9999126984F, 0.9999141433F, 0.9999155703F, 0.9999169794F,
-    0.9999183709F, 0.9999197449F, 0.9999211014F, 0.9999224408F,
-    0.9999237631F, 0.9999250684F, 0.9999263570F, 0.9999276289F,
-    0.9999288843F, 0.9999301233F, 0.9999313461F, 0.9999325529F,
-    0.9999337437F, 0.9999349187F, 0.9999360780F, 0.9999372218F,
-    0.9999383503F, 0.9999394635F, 0.9999405616F, 0.9999416447F,
-    0.9999427129F, 0.9999437665F, 0.9999448055F, 0.9999458301F,
-    0.9999468404F, 0.9999478365F, 0.9999488185F, 0.9999497867F,
-    0.9999507411F, 0.9999516819F, 0.9999526091F, 0.9999535230F,
-    0.9999544236F, 0.9999553111F, 0.9999561856F, 0.9999570472F,
-    0.9999578960F, 0.9999587323F, 0.9999595560F, 0.9999603674F,
-    0.9999611666F, 0.9999619536F, 0.9999627286F, 0.9999634917F,
-    0.9999642431F, 0.9999649828F, 0.9999657110F, 0.9999664278F,
-    0.9999671334F, 0.9999678278F, 0.9999685111F, 0.9999691835F,
-    0.9999698451F, 0.9999704960F, 0.9999711364F, 0.9999717662F,
-    0.9999723858F, 0.9999729950F, 0.9999735942F, 0.9999741834F,
-    0.9999747626F, 0.9999753321F, 0.9999758919F, 0.9999764421F,
-    0.9999769828F, 0.9999775143F, 0.9999780364F, 0.9999785495F,
-    0.9999790535F, 0.9999795485F, 0.9999800348F, 0.9999805124F,
-    0.9999809813F, 0.9999814417F, 0.9999818938F, 0.9999823375F,
-    0.9999827731F, 0.9999832005F, 0.9999836200F, 0.9999840316F,
-    0.9999844353F, 0.9999848314F, 0.9999852199F, 0.9999856008F,
-    0.9999859744F, 0.9999863407F, 0.9999866997F, 0.9999870516F,
-    0.9999873965F, 0.9999877345F, 0.9999880656F, 0.9999883900F,
-    0.9999887078F, 0.9999890190F, 0.9999893237F, 0.9999896220F,
-    0.9999899140F, 0.9999901999F, 0.9999904796F, 0.9999907533F,
-    0.9999910211F, 0.9999912830F, 0.9999915391F, 0.9999917896F,
-    0.9999920345F, 0.9999922738F, 0.9999925077F, 0.9999927363F,
-    0.9999929596F, 0.9999931777F, 0.9999933907F, 0.9999935987F,
-    0.9999938018F, 0.9999940000F, 0.9999941934F, 0.9999943820F,
-    0.9999945661F, 0.9999947456F, 0.9999949206F, 0.9999950912F,
-    0.9999952575F, 0.9999954195F, 0.9999955773F, 0.9999957311F,
-    0.9999958807F, 0.9999960265F, 0.9999961683F, 0.9999963063F,
-    0.9999964405F, 0.9999965710F, 0.9999966979F, 0.9999968213F,
-    0.9999969412F, 0.9999970576F, 0.9999971707F, 0.9999972805F,
-    0.9999973871F, 0.9999974905F, 0.9999975909F, 0.9999976881F,
-    0.9999977824F, 0.9999978738F, 0.9999979624F, 0.9999980481F,
-    0.9999981311F, 0.9999982115F, 0.9999982892F, 0.9999983644F,
-    0.9999984370F, 0.9999985072F, 0.9999985750F, 0.9999986405F,
-    0.9999987037F, 0.9999987647F, 0.9999988235F, 0.9999988802F,
-    0.9999989348F, 0.9999989873F, 0.9999990379F, 0.9999990866F,
-    0.9999991334F, 0.9999991784F, 0.9999992217F, 0.9999992632F,
-    0.9999993030F, 0.9999993411F, 0.9999993777F, 0.9999994128F,
-    0.9999994463F, 0.9999994784F, 0.9999995091F, 0.9999995384F,
-    0.9999995663F, 0.9999995930F, 0.9999996184F, 0.9999996426F,
-    0.9999996657F, 0.9999996876F, 0.9999997084F, 0.9999997282F,
-    0.9999997469F, 0.9999997647F, 0.9999997815F, 0.9999997973F,
-    0.9999998123F, 0.9999998265F, 0.9999998398F, 0.9999998524F,
-    0.9999998642F, 0.9999998753F, 0.9999998857F, 0.9999998954F,
-    0.9999999045F, 0.9999999130F, 0.9999999209F, 0.9999999282F,
-    0.9999999351F, 0.9999999414F, 0.9999999472F, 0.9999999526F,
-    0.9999999576F, 0.9999999622F, 0.9999999664F, 0.9999999702F,
-    0.9999999737F, 0.9999999769F, 0.9999999798F, 0.9999999824F,
-    0.9999999847F, 0.9999999868F, 0.9999999887F, 0.9999999904F,
-    0.9999999919F, 0.9999999932F, 0.9999999943F, 0.9999999953F,
-    0.9999999961F, 0.9999999969F, 0.9999999975F, 0.9999999980F,
-    0.9999999985F, 0.9999999988F, 0.9999999991F, 0.9999999993F,
-    0.9999999995F, 0.9999999997F, 0.9999999998F, 0.9999999999F,
-    0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
-    1.0000000000F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
-};
-
-const float ff_vorbis_floor1_inverse_db_table[256]={
-    1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F,
-    1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F,
-    1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F,
-    2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F,
-    2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F,
-    3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F,
-    4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F,
-    6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F,
-    7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F,
-    1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F,
-    1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F,
-    1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F,
-    2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F,
-    2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F,
-    3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F,
-    4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F,
-    5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F,
-    7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F,
-    9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F,
-    1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F,
-    1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F,
-    2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F,
-    2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F,
-    3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F,
-    4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F,
-    5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F,
-    7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F,
-    9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F,
-    0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F,
-    0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F,
-    0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F,
-    0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F,
-    0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F,
-    0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F,
-    0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F,
-    0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F,
-    0.00092223983F, 0.00098217216F, 0.0010459992F,  0.0011139742F,
-    0.0011863665F,  0.0012634633F,  0.0013455702F,  0.0014330129F,
-    0.0015261382F,  0.0016253153F,  0.0017309374F,  0.0018434235F,
-    0.0019632195F,  0.0020908006F,  0.0022266726F,  0.0023713743F,
-    0.0025254795F,  0.0026895994F,  0.0028643847F,  0.0030505286F,
-    0.0032487691F,  0.0034598925F,  0.0036847358F,  0.0039241906F,
-    0.0041792066F,  0.0044507950F,  0.0047400328F,  0.0050480668F,
-    0.0053761186F,  0.0057254891F,  0.0060975636F,  0.0064938176F,
-    0.0069158225F,  0.0073652516F,  0.0078438871F,  0.0083536271F,
-    0.0088964928F,  0.009474637F,   0.010090352F,   0.010746080F,
-    0.011444421F,   0.012188144F,   0.012980198F,   0.013823725F,
-    0.014722068F,   0.015678791F,   0.016697687F,   0.017782797F,
-    0.018938423F,   0.020169149F,   0.021479854F,   0.022875735F,
-    0.024362330F,   0.025945531F,   0.027631618F,   0.029427276F,
-    0.031339626F,   0.033376252F,   0.035545228F,   0.037855157F,
-    0.040315199F,   0.042935108F,   0.045725273F,   0.048696758F,
-    0.051861348F,   0.055231591F,   0.058820850F,   0.062643361F,
-    0.066714279F,   0.071049749F,   0.075666962F,   0.080584227F,
-    0.085821044F,   0.091398179F,   0.097337747F,   0.10366330F,
-    0.11039993F,    0.11757434F,    0.12521498F,    0.13335215F,
-    0.14201813F,    0.15124727F,    0.16107617F,    0.17154380F,
-    0.18269168F,    0.19456402F,    0.20720788F,    0.22067342F,
-    0.23501402F,    0.25028656F,    0.26655159F,    0.28387361F,
-    0.30232132F,    0.32196786F,    0.34289114F,    0.36517414F,
-    0.38890521F,    0.41417847F,    0.44109412F,    0.46975890F,
-    0.50028648F,    0.53279791F,    0.56742212F,    0.60429640F,
-    0.64356699F,    0.68538959F,    0.72993007F,    0.77736504F,
-    0.82788260F,    0.88168307F,    0.9389798F,     1.F,
-};
-
-const float * const ff_vorbis_vwin[8] = {
-      vwin64,  vwin128,  vwin256,  vwin512,
-    vwin1024, vwin2048, vwin4096, vwin8192
-};
diff --git a/deps/libav/libavcodec/vorbis_enc_data.h b/deps/libav/libavcodec/vorbis_enc_data.h
deleted file mode 100644
index a1e743e..0000000
--- a/deps/libav/libavcodec/vorbis_enc_data.h
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * copyright (c) 2006 Oded Shimon <ods15 at ods15.dyndns.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VORBIS_ENC_DATA_H
-#define AVCODEC_VORBIS_ENC_DATA_H
-
-#include <stdint.h>
-
-static const uint8_t codebook0[] = {
-    2, 10,  8, 14,  7, 12, 11, 14,  1,  5,  3,  7,  4,  9,  7, 13,
-};
-
-static const uint8_t codebook1[] = {
-    1,  4,  2,  6,  3,  7,  5,  7,
-};
-
-static const uint8_t codebook2[] = {
-     1,  5,  7, 21,  5,  8,  9, 21, 10,  9, 12, 20, 20, 16, 20,
-    20,  4,  8,  9, 20,  6,  8,  9, 20, 11, 11, 13, 20, 20, 15,
-    17, 20,  9, 11, 14, 20,  8, 10, 15, 20, 11, 13, 15, 20, 20,
-    20, 20, 20, 20, 20, 20, 20, 13, 20, 20, 20, 18, 18, 20, 20,
-    20, 20, 20, 20,  3,  6,  8, 20,  6,  7,  9, 20, 10,  9, 12,
-    20, 20, 20, 20, 20,  5,  7,  9, 20,  6,  6,  9, 20, 10,  9,
-    12, 20, 20, 20, 20, 20,  8, 10, 13, 20,  8,  9, 12, 20, 11,
-    10, 12, 20, 20, 20, 20, 20, 18, 20, 20, 20, 15, 17, 18, 20,
-    18, 17, 18, 20, 20, 20, 20, 20,  7, 10, 12, 20,  8,  9, 11,
-    20, 14, 13, 14, 20, 20, 20, 20, 20,  6,  9, 12, 20,  7,  8,
-    11, 20, 12, 11, 13, 20, 20, 20, 20, 20,  9, 11, 15, 20,  8,
-    10, 14, 20, 12, 11, 14, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-    20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 11, 16, 18,
-    20, 15, 15, 17, 20, 20, 17, 20, 20, 20, 20, 20, 20,  9, 14,
-    16, 20, 12, 12, 15, 20, 17, 15, 18, 20, 20, 20, 20, 20, 16,
-    19, 18, 20, 15, 16, 20, 20, 17, 17, 20, 20, 20, 20, 20, 20,
-    20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-    20,
-};
-
-static const uint8_t codebook3[] = {
-     2,  3,  7, 13,  4,  4,  7, 15,  8,  6,  9, 17, 21, 16, 15,
-    21,  2,  5,  7, 11,  5,  5,  7, 14,  9,  7, 10, 16, 17, 15,
-    16, 21,  4,  7, 10, 17,  7,  7,  9, 15, 11,  9, 11, 16, 21,
-    18, 15, 21, 18, 21, 21, 21, 15, 17, 17, 19, 21, 19, 18, 20,
-    21, 21, 21, 20,
-};
-
-static const uint8_t codebook4[] = {
-     5,  5,  5,  5,  6,  5,  6,  5,  6,  5,  6,  5,  6,  5,  6,
-     5,  6,  5,  6,  5,  6,  5,  6,  5,  7,  5,  7,  5,  7,  5,
-     7,  5,  8,  6,  8,  6,  8,  6,  9,  6,  9,  6, 10,  6, 10,
-     6, 11,  6, 11,  7, 11,  7, 12,  7, 12,  7, 12,  7, 12,  7,
-    12,  7, 12,  7, 12,  7, 12,  8, 13,  8, 12,  8, 12,  8, 13,
-     8, 13,  9, 13,  9, 13,  9, 13,  9, 12, 10, 12, 10, 13, 10,
-    14, 11, 14, 12, 14, 13, 14, 13, 14, 14, 15, 16, 15, 15, 15,
-    14, 15, 17, 21, 22, 22, 21, 22, 22, 22, 22, 22, 22, 21, 21,
-    21, 21, 21, 21, 21, 21, 21, 21,
-};
-
-static const uint8_t codebook5[] = {
-     2,  5,  5,  4,  5,  4,  5,  4,  5,  4,  6,  5,  6,  5,  6,
-     5,  6,  5,  7,  5,  7,  6,  8,  6,  8,  6,  8,  6,  9,  6,
-     9,  6,
-};
-
-static const uint8_t codebook6[] = {
-     8,  5,  8,  4,  9,  4,  9,  4,  9,  4,  9,  4,  9,  4,  9,
-     4,  9,  4,  9,  4,  9,  4,  8,  4,  8,  4,  9,  5,  9,  5,
-     9,  5,  9,  5,  9,  6, 10,  6, 10,  7, 10,  8, 11,  9, 11,
-    11, 12, 13, 12, 14, 13, 15, 13, 15, 14, 16, 14, 17, 15, 17,
-    15, 15, 16, 16, 15, 16, 16, 16, 15, 18, 16, 15, 17, 17, 19,
-    19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19,
-};
-
-static const uint8_t codebook7[] = {
-     1,  5,  5,  5,  5,  5,  5,  5,  6,  5,  6,  5,  6,  5,  6,
-     5,  6,  6,  7,  7,  7,  7,  8,  7,  8,  8,  9,  8, 10,  9,
-    10,  9,
-};
-
-static const uint8_t codebook8[] = {
-     4,  3,  4,  3,  4,  4,  5,  4,  5,  4,  5,  5,  6,  5,  6,
-     5,  7,  5,  7,  6,  7,  6,  8,  7,  8,  7,  8,  7,  9,  8,
-     9,  9,  9,  9, 10, 10, 10, 11,  9, 12,  9, 12,  9, 15, 10,
-    14,  9, 13, 10, 13, 10, 12, 10, 12, 10, 13, 10, 12, 11, 13,
-    11, 14, 12, 13, 13, 14, 14, 13, 14, 15, 14, 16, 13, 13, 14,
-    16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 15, 15,
-};
-
-static const uint8_t codebook9[] = {
-     4,  5,  4,  5,  3,  5,  3,  5,  3,  5,  4,  4,  4,  4,  5,
-     5,  5,
-};
-
-static const uint8_t codebook10[] = {
-     3,  3,  4,  3,  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  5,
-     7,  5,  8,  6,  8,  6,  9,  7, 10,  7, 10,  8, 10,  8, 11,
-     9, 11,
-};
-
-static const uint8_t codebook11[] = {
-   3,  7,  3,  8,  3, 10,  3,  8,  3,  9,  3,  8,  4,  9,  4,
-   9,  5,  9,  6, 10,  6,  9,  7, 11,  7, 12,  9, 13, 10, 13,
-  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-  12, 12, 12,
-};
-
-static const uint8_t codebook12[] = {
-     4,  5,  4,  5,  4,  5,  4,  5,  3,  5,  3,  5,  3,  5,  4,
-     5,  4,
-};
-
-static const uint8_t codebook13[] = {
-     4,  2,  4,  2,  5,  3,  5,  4,  6,  6,  6,  7,  7,  8,  7,
-     8,  7,  8,  7,  9,  8,  9,  8,  9,  8, 10,  8, 11,  9, 12,
-     9, 12,
-};
-
-static const uint8_t codebook14[] = {
-     2,  5,  2,  6,  3,  6,  4,  7,  4,  7,  5,  9,  5, 11,  6,
-    11,  6, 11,  7, 11,  6, 11,  6, 11,  9, 11,  8, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10,
-    10, 10, 10,
-};
-
-static const uint8_t codebook15[] = {
-     5,  6, 11, 11, 11, 11, 10, 10, 12, 11,  5,  2, 11,  5,  6,
-     6,  7,  9, 11, 13, 13, 10,  7, 11,  6,  7,  8,  9, 10, 12,
-    11,  5, 11,  6,  8,  7,  9, 11, 14, 15, 11,  6,  6,  8,  4,
-     5,  7,  8, 10, 13, 10,  5,  7,  7,  5,  5,  6,  8, 10, 11,
-    10,  7,  7,  8,  6,  5,  5,  7,  9,  9, 11,  8,  8, 11,  8,
-     7,  6,  6,  7,  9, 12, 11, 10, 13,  9,  9,  7,  7,  7,  9,
-    11, 13, 12, 15, 12, 11,  9,  8,  8,  8,
-};
-
-static const uint8_t codebook16[] = {
-     2,  4,  4,  0,  0,  0,  0,  0,  0,  5,  6,  6,  0,  0,  0,
-     0,  0,  0,  5,  6,  6,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  5,  7,  7,  0,  0,  0,  0,  0,  0,
-     7,  8,  8,  0,  0,  0,  0,  0,  0,  6,  7,  8,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  5,  7,  7,
-     0,  0,  0,  0,  0,  0,  6,  8,  7,  0,  0,  0,  0,  0,  0,
-     7,  8,  8,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  5,  7,  7,  0,  0,  0,
-     0,  0,  0,  7,  8,  8,  0,  0,  0,  0,  0,  0,  7,  8,  8,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     7,  8,  8,  0,  0,  0,  0,  0,  0,  8,  8,  9,  0,  0,  0,
-     0,  0,  0,  8,  9,  9,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  6,  8,  8,  0,  0,  0,  0,  0,  0,
-     7,  9,  8,  0,  0,  0,  0,  0,  0,  8,  9,  9,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  5,  7,  7,  0,  0,  0,  0,  0,  0,  7,  8,  8,
-     0,  0,  0,  0,  0,  0,  7,  8,  8,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  6,  8,  8,  0,  0,  0,
-     0,  0,  0,  8,  9,  9,  0,  0,  0,  0,  0,  0,  7,  8,  9,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     6,  8,  8,  0,  0,  0,  0,  0,  0,  8,  9,  9,  0,  0,  0,
-     0,  0,  0,  8,  9,  8,
-};
-
-static const uint8_t codebook17[] = {
-     2,  5,  5,  0,  0,  0,  5,  5,  0,  0,  0,  5,  5,  0,  0,
-     0,  7,  8,  0,  0,  0,  0,  0,  0,  0,  5,  6,  6,  0,  0,
-     0,  7,  7,  0,  0,  0,  7,  7,  0,  0,  0, 10, 10,  0,  0,
-     0,  0,  0,  0,  0,  5,  6,  6,  0,  0,  0,  7,  7,  0,  0,
-     0,  7,  7,  0,  0,  0, 10, 10,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     5,  7,  7,  0,  0,  0,  7,  7,  0,  0,  0,  7,  7,  0,  0,
-     0,  9,  9,  0,  0,  0,  0,  0,  0,  0,  5,  7,  7,  0,  0,
-     0,  7,  7,  0,  0,  0,  7,  7,  0,  0,  0,  9,  9,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  5,  7,  7,  0,  0,  0,  7,  7,  0,  0,
-     0,  7,  7,  0,  0,  0,  9,  9,  0,  0,  0,  0,  0,  0,  0,
-     5,  7,  7,  0,  0,  0,  7,  7,  0,  0,  0,  7,  7,  0,  0,
-     0,  9,  9,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  8, 10, 10,  0,  0,
-     0,  9,  9,  0,  0,  0,  9,  9,  0,  0,  0, 10, 10,  0,  0,
-     0,  0,  0,  0,  0,  8, 10, 10,  0,  0,  0,  9,  9,  0,  0,
-     0,  9,  9,  0,  0,  0, 10, 10,
-};
-
-static const uint8_t codebook18[] = {
-     2,  4,  3,  6,  6,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  4,  4,  4,  6,  6,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  4,  4,  4,  6,  6,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     6,  6,  6,  9,  9,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  6,  6,  7,  9,  9,
-};
-
-static const uint8_t codebook19[] = {
-     2,  3,  3,  6,  6,  0,  0,  0,  0,  0,  4,  4,  6,  6,  0,
-     0,  0,  0,  0,  4,  4,  6,  6,  0,  0,  0,  0,  0,  5,  5,
-     6,  6,  0,  0,  0,  0,  0,  0,  0,  6,  6,  0,  0,  0,  0,
-     0,  0,  0,  7,  8,  0,  0,  0,  0,  0,  0,  0,  7,  7,  0,
-     0,  0,  0,  0,  0,  0,  9,  9,
-};
-
-static const uint8_t codebook20[] = {
-     1,  3,  4,  6,  6,  7,  7,  9,  9,  0,  5,  5,  7,  7,  7,
-     8,  9,  9,  0,  5,  5,  7,  7,  8,  8,  9,  9,  0,  7,  7,
-     8,  8,  8,  8, 10, 10,  0,  0,  0,  8,  8,  8,  8, 10, 10,
-     0,  0,  0,  9,  9,  9,  9, 10, 10,  0,  0,  0,  9,  9,  9,
-     9, 10, 10,  0,  0,  0, 10, 10, 10, 10, 11, 11,  0,  0,  0,
-     0,  0, 10, 10, 11, 11,
-};
-
-static const uint8_t codebook21[] = {
-     2,  3,  3,  6,  6,  7,  7,  8,  8,  8,  8,  9,  9, 10, 10,
-    11, 10,  0,  5,  5,  7,  7,  8,  8,  9,  9,  9,  9, 10, 10,
-    10, 10, 11, 11,  0,  5,  5,  7,  7,  8,  8,  9,  9,  9,  9,
-    10, 10, 10, 10, 11, 11,  0,  6,  6,  7,  7,  8,  8,  9,  9,
-     9,  9, 10, 10, 11, 11, 11, 11,  0,  0,  0,  7,  7,  8,  8,
-     9,  9,  9,  9, 10, 10, 11, 11, 11, 12,  0,  0,  0,  8,  8,
-     8,  8,  9,  9,  9,  9, 10, 10, 11, 11, 12, 12,  0,  0,  0,
-     8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 11, 11, 12, 12,  0,
-     0,  0,  9,  9,  9,  9, 10, 10, 10, 10, 11, 10, 11, 11, 12,
-    12,  0,  0,  0,  0,  0,  9,  9, 10, 10, 10, 10, 11, 11, 11,
-    11, 12, 12,  0,  0,  0,  0,  0,  9,  8,  9,  9, 10, 10, 11,
-    11, 12, 12, 12, 12,  0,  0,  0,  0,  0,  8,  8,  9,  9, 10,
-    10, 11, 11, 12, 11, 12, 12,  0,  0,  0,  0,  0,  9, 10, 10,
-    10, 11, 11, 11, 11, 12, 12, 13, 13,  0,  0,  0,  0,  0,  0,
-     0, 10, 10, 10, 10, 11, 11, 12, 12, 13, 13,  0,  0,  0,  0,
-     0,  0,  0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13,  0,  0,
-     0,  0,  0,  0,  0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13,
-     0,  0,  0,  0,  0,  0,  0, 11, 11, 12, 12, 12, 12, 13, 13,
-    13, 13,  0,  0,  0,  0,  0,  0,  0,  0,  0, 12, 12, 12, 12,
-    13, 13, 13, 13,
-};
-
-static const uint8_t codebook22[] = {
-     1,  4,  4,  7,  6,  6,  7,  6,  6,  4,  7,  7, 10,  9,  9,
-    11,  9,  9,  4,  7,  7, 10,  9,  9, 11,  9,  9,  7, 10, 10,
-    11, 11, 10, 12, 11, 11,  6,  9,  9, 11, 10, 10, 11, 10, 10,
-     6,  9,  9, 11, 10, 10, 11, 10, 10,  7, 11, 11, 11, 11, 11,
-    12, 11, 11,  6,  9,  9, 11, 10, 10, 11, 10, 10,  6,  9,  9,
-    11, 10, 10, 11, 10, 10,
-};
-
-static const uint8_t codebook23[] = {
-     2,  4,  4,  6,  6,  7,  7,  7,  7,  8,  8, 10,  5,  5,  6,
-     6,  7,  7,  8,  8,  8,  8, 10,  5,  5,  6,  6,  7,  7,  8,
-     8,  8,  8, 10,  6,  6,  7,  7,  8,  8,  8,  8,  8,  8, 10,
-    10, 10,  7,  7,  8,  7,  8,  8,  8,  8, 10, 10, 10,  8,  8,
-     8,  8,  8,  8,  8,  8, 10, 10, 10,  7,  8,  8,  8,  8,  8,
-     8,  8, 10, 10, 10,  8,  8,  8,  8,  8,  8,  8,  8, 10, 10,
-    10, 10, 10,  8,  8,  8,  8,  8,  8, 10, 10, 10, 10, 10,  9,
-     9,  8,  8,  9,  8, 10, 10, 10, 10, 10,  8,  8,  8,  8,  8,
-     8,
-};
-
-static const uint8_t codebook24[] = {
-     1,  4,  4,  6,  6,  7,  7,  8,  8,  9,  9, 10, 10,  6,  5,
-     5,  7,  7,  8,  8,  8,  8,  9,  9, 10, 10,  7,  5,  5,  7,
-     7,  8,  8,  8,  8,  9,  9, 11, 10,  0,  8,  8,  8,  8,  9,
-     9,  9,  9, 10, 10, 11, 11,  0,  8,  8,  8,  8,  9,  9,  9,
-     9, 10, 10, 11, 11,  0, 12, 12,  9,  9, 10, 10, 10, 10, 11,
-    11, 11, 12,  0, 13, 13,  9,  9, 10, 10, 10, 10, 11, 11, 12,
-    12,  0,  0,  0, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12,  0,
-     0,  0, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12,  0,  0,  0,
-    14, 14, 11, 11, 11, 11, 12, 12, 13, 13,  0,  0,  0, 14, 14,
-    11, 11, 11, 11, 12, 12, 13, 13,  0,  0,  0,  0,  0, 12, 12,
-    12, 12, 13, 13, 14, 13,  0,  0,  0,  0,  0, 13, 13, 12, 12,
-    13, 12, 14, 13,
-};
-
-static const uint8_t codebook25[] = {
-     2,  4,  4,  5,  5,  6,  5,  5,  5,  5,  6,  4,  5,  5,  5,
-     6,  5,  5,  5,  5,  6,  6,  6,  5,  5,
-};
-
-static const uint8_t codebook26[] = {
-     1,  4,  4, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  4,  9,
-     8, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  2,  9,  7, 12,
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11,
-};
-
-static const uint8_t codebook27[] = {
-     1,  4,  4,  6,  6,  7,  7,  8,  7,  9,  9, 10, 10, 10, 10,
-     6,  5,  5,  7,  7,  8,  8, 10,  8, 11, 10, 12, 12, 13, 13,
-     6,  5,  5,  7,  7,  8,  8, 10,  9, 11, 11, 12, 12, 13, 12,
-    18,  8,  8,  8,  8,  9,  9, 10,  9, 11, 10, 12, 12, 13, 13,
-    18,  8,  8,  8,  8,  9,  9, 10, 10, 11, 11, 13, 12, 14, 13,
-    18, 11, 11,  9,  9, 10, 10, 11, 11, 11, 12, 13, 12, 13, 14,
-    18, 11, 11,  9,  8, 11, 10, 11, 11, 11, 11, 12, 12, 14, 13,
-    18, 18, 18, 10, 11, 10, 11, 12, 12, 12, 12, 13, 12, 14, 13,
-    18, 18, 18, 10, 11, 11,  9, 12, 11, 12, 12, 12, 13, 13, 13,
-    18, 18, 17, 14, 14, 11, 11, 12, 12, 13, 12, 14, 12, 14, 13,
-    18, 18, 18, 14, 14, 11, 10, 12,  9, 12, 13, 13, 13, 13, 13,
-    18, 18, 17, 16, 18, 13, 13, 12, 12, 13, 11, 14, 12, 14, 14,
-    17, 18, 18, 17, 18, 13, 12, 13, 10, 12, 11, 14, 14, 14, 14,
-    17, 18, 18, 18, 18, 15, 16, 12, 12, 13, 10, 14, 12, 14, 15,
-    18, 18, 18, 16, 17, 16, 14, 12, 11, 13, 10, 13, 13, 14, 15,
-};
-
-static const uint8_t codebook28[] = {
-     2,  5,  5,  6,  6,  7,  7,  7,  7,  7,  7,  8,  8,  8,  8,
-     8,  8, 10,  6,  6,  7,  7,  8,  7,  8,  8,  8,  8,  8,  9,
-     9,  9,  9,  9, 10,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,
-     9,  9,  9,  9,  9,  9, 10,  7,  7,  7,  7,  8,  8,  8,  8,
-     9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10,  7,  7,  8,  8,
-     8,  9,  9,  9,  9,  9,  9,  9,  9,  9, 11, 11, 11,  8,  8,
-     8,  8,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10,
-     8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, 10,
-    10, 10,  8,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, 10,
-     9, 10, 10, 10, 11, 11,  9,  9,  9,  9,  9,  9,  9,  9,  9,
-     9,  9,  9, 11, 10, 11, 11, 11,  9,  9,  9,  9,  9,  9, 10,
-    10,  9,  9, 10,  9, 11, 10, 11, 11, 11,  9,  9,  9,  9,  9,
-     9,  9,  9, 10, 10, 10,  9, 11, 11, 11, 11, 11,  9,  9,  9,
-     9, 10, 10,  9,  9,  9,  9, 10,  9, 11, 11, 11, 11, 11, 11,
-    11,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 11, 11, 11, 11,
-    11, 11, 11, 10,  9, 10, 10,  9, 10,  9,  9, 10,  9, 11, 10,
-    10, 11, 11, 11, 11,  9, 10,  9,  9,  9,  9, 10, 10, 10, 10,
-    11, 11, 11, 11, 11, 11, 10, 10, 10,  9,  9, 10,  9, 10,  9,
-    10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11,  9,  9,  9,  9,
-     9, 10, 10, 10,
-};
-
-static const struct {
-    int dim;
-    int len;
-    int real_len;
-    const uint8_t *clens;
-    int lookup;
-    float min;
-    float delta;
-    const uint8_t *quant;
-} cvectors[] = {
-    { 2,   16,   16, codebook0,  0 },
-    { 2,    8,    8, codebook1,  0 },
-    { 2,  256,  256, codebook2,  0 },
-    { 2,   64,   64, codebook3,  0 },
-    { 2,  128,  128, codebook4,  0 },
-    { 2,   32,   32, codebook5,  0 },
-    { 2,   96,   96, codebook6,  0 },
-    { 2,   32,   32, codebook7,  0 },
-    { 2,   96,   96, codebook8,  0 },
-    { 2,   17,   17, codebook9,  0 },
-    { 2,   32,   32, codebook10, 0 },
-    { 2,   78,   78, codebook11, 0 },
-    { 2,   17,   17, codebook12, 0 },
-    { 2,   32,   32, codebook13, 0 },
-    { 2,   78,   78, codebook14, 0 },
-    { 2,  100,  100, codebook15, 0 },
-    { 8, 1641, 6561, codebook16, 1,    -1.0,   1.0, (const uint8_t[]){ 1, 0, 2, } },
-    { 4,  443,  625, codebook17, 1,    -2.0,   1.0, (const uint8_t[]){ 2, 1, 3, 0, 4, } },
-    { 4,  105,  625, codebook18, 1,    -2.0,   1.0, (const uint8_t[]){ 2, 1, 3, 0, 4, } },
-    { 2,   68,   81, codebook19, 1,    -4.0,   1.0, (const uint8_t[]){ 4, 3, 5, 2, 6, 1, 7, 0, 8, } },
-    { 2,   81,   81, codebook20, 1,    -4.0,   1.0, (const uint8_t[]){ 4, 3, 5, 2, 6, 1, 7, 0, 8, } },
-    { 2,  289,  289, codebook21, 1,    -8.0,   1.0, (const uint8_t[]){ 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15, 0, 16, } },
-    { 4,   81,   81, codebook22, 1,   -11.0,  11.0, (const uint8_t[]){ 1, 0, 2, } },
-    { 2,  121,  121, codebook23, 1,    -5.0,   1.0, (const uint8_t[]){ 5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 10, } },
-    { 2,  169,  169, codebook24, 1,   -30.0,   5.0, (const uint8_t[]){ 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0, 12, } },
-    { 2,   25,   25, codebook25, 1,    -2.0,   1.0, (const uint8_t[]){ 2, 1, 3, 0, 4, } },
-    { 2,  169,  169, codebook26, 1, -1530.0, 255.0, (const uint8_t[]){ 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0, 12, } },
-    { 2,  225,  225, codebook27, 1,  -119.0,  17.0, (const uint8_t[]){ 7, 6, 8, 5, 9, 4, 10, 3, 11, 2, 12, 1, 13, 0, 14, } },
-    { 2,  289,  289, codebook28, 1,    -8.0,   1.0, (const uint8_t[]){ 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15, 0, 16, } },
-};
-
-static const struct {
-    int dim;
-    int subclass;
-    int masterbook;
-    const int *nbooks;
-} floor_classes[] = {
-    { 3, 0, 0, (const int[]){  4             } },
-    { 4, 1, 0, (const int[]){  5,  6         } },
-    { 3, 1, 1, (const int[]){  7,  8         } },
-    { 4, 2, 2, (const int[]){ -1,  9, 10, 11 } },
-    { 3, 2, 3, (const int[]){ -1, 12, 13, 14 } },
-};
-
-#endif /* AVCODEC_VORBIS_ENC_DATA_H */
diff --git a/deps/libav/libavcodec/vorbis_parser.c b/deps/libav/libavcodec/vorbis_parser.c
deleted file mode 100644
index c413135..0000000
--- a/deps/libav/libavcodec/vorbis_parser.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Vorbis audio parser
- *
- * Determines the duration for each packet.
- */
-
-#include "get_bits.h"
-#include "parser.h"
-#include "xiph.h"
-#include "vorbis_parser.h"
-
-static int parse_id_header(AVCodecContext *avctx, VorbisParseContext *s,
-                           const uint8_t *buf, int buf_size)
-{
-    /* Id header should be 30 bytes */
-    if (buf_size < 30) {
-        av_log(avctx, AV_LOG_ERROR, "Id header is too short\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* make sure this is the Id header */
-    if (buf[0] != 1) {
-        av_log(avctx, AV_LOG_ERROR, "Wrong packet type in Id header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* check for header signature */
-    if (memcmp(&buf[1], "vorbis", 6)) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid packet signature in Id header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!(buf[29] & 0x1)) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid framing bit in Id header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->blocksize[0] = 1 << (buf[28] & 0xF);
-    s->blocksize[1] = 1 << (buf[28] >>  4);
-
-    return 0;
-}
-
-static int parse_setup_header(AVCodecContext *avctx, VorbisParseContext *s,
-                              const uint8_t *buf, int buf_size)
-{
-    GetBitContext gb, gb0;
-    uint8_t *rev_buf;
-    int i, ret = 0;
-    int got_framing_bit, mode_count, got_mode_header, last_mode_count = 0;
-
-    /* avoid overread */
-    if (buf_size < 7) {
-        av_log(avctx, AV_LOG_ERROR, "Setup header is too short\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* make sure this is the Setup header */
-    if (buf[0] != 5) {
-        av_log(avctx, AV_LOG_ERROR, "Wrong packet type in Setup header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* check for header signature */
-    if (memcmp(&buf[1], "vorbis", 6)) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid packet signature in Setup header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* reverse bytes so we can easily read backwards with get_bits() */
-    if (!(rev_buf = av_malloc(buf_size))) {
-        av_log(avctx, AV_LOG_ERROR, "Out of memory\n");
-        return AVERROR(ENOMEM);
-    }
-    for (i = 0; i < buf_size; i++)
-        rev_buf[i] = buf[buf_size - 1 - i];
-    init_get_bits(&gb, rev_buf, buf_size * 8);
-
-    got_framing_bit = 0;
-    while (get_bits_left(&gb) > 97) {
-        if (get_bits1(&gb)) {
-            got_framing_bit = get_bits_count(&gb);
-            break;
-        }
-    }
-    if (!got_framing_bit) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid Setup header\n");
-        ret = AVERROR_INVALIDDATA;
-        goto bad_header;
-    }
-
-    /* Now we search backwards to find possible valid mode counts. This is not
-     * fool-proof because we could have false positive matches and read too
-     * far, but there isn't really any way to be sure without parsing through
-     * all the many variable-sized fields before the modes. This approach seems
-     * to work well in testing, and it is similar to how it is handled in
-     * liboggz. */
-    mode_count = 0;
-    got_mode_header = 0;
-    while (get_bits_left(&gb) >= 97) {
-        if (get_bits(&gb, 8) > 63 || get_bits(&gb, 16) || get_bits(&gb, 16))
-            break;
-        skip_bits(&gb, 1);
-        mode_count++;
-        if (mode_count > 64)
-            break;
-        gb0 = gb;
-        if (get_bits(&gb0, 6) + 1 == mode_count) {
-            got_mode_header = 1;
-            last_mode_count = mode_count;
-        }
-    }
-    if (!got_mode_header) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid Setup header\n");
-        ret = AVERROR_INVALIDDATA;
-        goto bad_header;
-    }
-    /* All samples I've seen use <= 2 modes, so ask for a sample if we find
-     * more than that, as it is most likely a false positive. If we get any
-     * we may need to approach this the long way and parse the whole Setup
-     * header, but I hope very much that it never comes to that. */
-    if (last_mode_count > 2) {
-        avpriv_request_sample(avctx,
-                              "%d modes (either a false positive or a "
-                              "sample from an unknown encoder)",
-                              last_mode_count);
-    }
-    /* We're limiting the mode count to 63 so that we know that the previous
-     * block flag will be in the first packet byte. */
-    if (last_mode_count > 63) {
-        av_log(avctx, AV_LOG_ERROR, "Unsupported mode count: %d\n",
-               last_mode_count);
-        ret = AVERROR_INVALIDDATA;
-        goto bad_header;
-    }
-    s->mode_count = mode_count = last_mode_count;
-    /* Determine the number of bits required to code the mode and turn that
-     * into a bitmask to directly access the mode from the first frame byte. */
-    s->mode_mask = ((1 << (av_log2(mode_count - 1) + 1)) - 1) << 1;
-    /* The previous window flag is the next bit after the mode */
-    s->prev_mask = (s->mode_mask | 0x1) + 1;
-
-    init_get_bits(&gb, rev_buf, buf_size * 8);
-    skip_bits_long(&gb, got_framing_bit);
-    for (i = mode_count - 1; i >= 0; i--) {
-        skip_bits_long(&gb, 40);
-        s->mode_blocksize[i] = s->blocksize[get_bits1(&gb)];
-    }
-
-bad_header:
-    av_free(rev_buf);
-    return ret;
-}
-
-int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s)
-{
-    uint8_t *header_start[3];
-    int header_len[3];
-    int ret;
-
-    s->avctx = avctx;
-    s->extradata_parsed = 1;
-
-    if ((ret = avpriv_split_xiph_headers(avctx->extradata,
-                                         avctx->extradata_size, 30,
-                                         header_start, header_len)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Extradata corrupt.\n");
-        return ret;
-    }
-
-    if ((ret = parse_id_header(avctx, s, header_start[0], header_len[0])) < 0)
-        return ret;
-
-    if ((ret = parse_setup_header(avctx, s, header_start[2], header_len[2])) < 0)
-        return ret;
-
-    s->valid_extradata = 1;
-    s->previous_blocksize = s->mode_blocksize[0];
-
-    return 0;
-}
-
-int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,
-                              int buf_size)
-{
-    int duration = 0;
-
-    if (s->valid_extradata && buf_size > 0) {
-        int mode, current_blocksize;
-        int previous_blocksize = s->previous_blocksize;
-
-        if (buf[0] & 1) {
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid packet\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (s->mode_count == 1)
-            mode = 0;
-        else
-            mode = (buf[0] & s->mode_mask) >> 1;
-        if (mode >= s->mode_count) {
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid mode in packet\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (mode) {
-            int flag = !!(buf[0] & s->prev_mask);
-            previous_blocksize = s->blocksize[flag];
-        }
-        current_blocksize     = s->mode_blocksize[mode];
-        duration              = (previous_blocksize + current_blocksize) >> 2;
-        s->previous_blocksize = current_blocksize;
-    }
-
-    return duration;
-}
-
-void avpriv_vorbis_parse_reset(VorbisParseContext *s)
-{
-    if (s->valid_extradata)
-        s->previous_blocksize = s->mode_blocksize[0];
-}
-
-#if CONFIG_VORBIS_PARSER
-static int vorbis_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
-                        const uint8_t **poutbuf, int *poutbuf_size,
-                        const uint8_t *buf, int buf_size)
-{
-    VorbisParseContext *s = s1->priv_data;
-    int duration;
-
-    if (!s->extradata_parsed && avctx->extradata && avctx->extradata_size)
-        if (avpriv_vorbis_parse_extradata(avctx, s))
-            goto end;
-
-    if ((duration = avpriv_vorbis_parse_frame(s, buf, buf_size)) >= 0)
-        s1->duration = duration;
-
-end:
-    /* always return the full packet. this parser isn't doing any splitting or
-       combining, only packet analysis */
-    *poutbuf      = buf;
-    *poutbuf_size = buf_size;
-    return buf_size;
-}
-
-AVCodecParser ff_vorbis_parser = {
-    .codec_ids      = { AV_CODEC_ID_VORBIS },
-    .priv_data_size = sizeof(VorbisParseContext),
-    .parser_parse   = vorbis_parse,
-};
-#endif /* CONFIG_VORBIS_PARSER */
diff --git a/deps/libav/libavcodec/vorbis_parser.h b/deps/libav/libavcodec/vorbis_parser.h
deleted file mode 100644
index 480a918..0000000
--- a/deps/libav/libavcodec/vorbis_parser.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Vorbis audio parser
- *
- * Determines the duration for each packet.
- */
-
-#ifndef AVCODEC_VORBIS_PARSER_H
-#define AVCODEC_VORBIS_PARSER_H
-
-#include "avcodec.h"
-
-typedef struct VorbisParseContext {
-    AVCodecContext *avctx;      ///< codec context
-    int extradata_parsed;       ///< we have attempted to parse extradata
-    int valid_extradata;        ///< extradata is valid, so we can calculate duration
-    int blocksize[2];           ///< short and long window sizes
-    int previous_blocksize;     ///< previous window size
-    int mode_blocksize[64];     ///< window size mapping for each mode
-    int mode_count;             ///< number of modes
-    int mode_mask;              ///< bitmask used to get the mode in each packet
-    int prev_mask;              ///< bitmask used to get the previous mode flag in each packet
-} VorbisParseContext;
-
-/**
- * Initialize the Vorbis parser using headers in the extradata.
- *
- * @param avctx codec context
- * @param s     Vorbis parser context
- */
-int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s);
-
-/**
- * Get the duration for a Vorbis packet.
- *
- * avpriv_vorbis_parse_extradata() must have been successfully called prior to
- * this in order for a correct duration to be returned.
- *
- * @param s        Vorbis parser context
- * @param buf      buffer containing a Vorbis frame
- * @param buf_size size of the buffer
- */
-int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,
-                              int buf_size);
-
-void avpriv_vorbis_parse_reset(VorbisParseContext *s);
-
-#endif /* AVCODEC_VORBIS_PARSER_H */
diff --git a/deps/libav/libavcodec/vorbisdec.c b/deps/libav/libavcodec/vorbisdec.c
deleted file mode 100644
index d7fec98..0000000
--- a/deps/libav/libavcodec/vorbisdec.c
+++ /dev/null
@@ -1,1776 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Vorbis I decoder
- * @author Denes Balatoni  ( dbalatoni programozo hu )
- */
-
-#include <inttypes.h>
-#include <math.h>
-
-#define BITSTREAM_READER_LE
-#include "libavutil/float_dsp.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "fft.h"
-#include "fmtconvert.h"
-#include "internal.h"
-
-#include "vorbis.h"
-#include "vorbisdsp.h"
-#include "xiph.h"
-
-#define V_NB_BITS 8
-#define V_NB_BITS2 11
-#define V_MAX_VLCS (1 << 16)
-#define V_MAX_PARTITIONS (1 << 20)
-
-typedef struct {
-    uint8_t      dimensions;
-    uint8_t      lookup_type;
-    uint8_t      maxdepth;
-    VLC          vlc;
-    float       *codevectors;
-    unsigned int nb_bits;
-} vorbis_codebook;
-
-typedef union  vorbis_floor_u  vorbis_floor_data;
-typedef struct vorbis_floor0_s vorbis_floor0;
-typedef struct vorbis_floor1_s vorbis_floor1;
-struct vorbis_context_s;
-typedef
-int (* vorbis_floor_decode_func)
-    (struct vorbis_context_s *, vorbis_floor_data *, float *);
-typedef struct {
-    uint8_t floor_type;
-    vorbis_floor_decode_func decode;
-    union vorbis_floor_u {
-        struct vorbis_floor0_s {
-            uint8_t       order;
-            uint16_t      rate;
-            uint16_t      bark_map_size;
-            int32_t      *map[2];
-            uint32_t      map_size[2];
-            uint8_t       amplitude_bits;
-            uint8_t       amplitude_offset;
-            uint8_t       num_books;
-            uint8_t      *book_list;
-            float        *lsp;
-        } t0;
-        struct vorbis_floor1_s {
-            uint8_t       partitions;
-            uint8_t       partition_class[32];
-            uint8_t       class_dimensions[16];
-            uint8_t       class_subclasses[16];
-            uint8_t       class_masterbook[16];
-            int16_t       subclass_books[16][8];
-            uint8_t       multiplier;
-            uint16_t      x_list_dim;
-            vorbis_floor1_entry *list;
-        } t1;
-    } data;
-} vorbis_floor;
-
-typedef struct {
-    uint16_t      type;
-    uint32_t      begin;
-    uint32_t      end;
-    unsigned      partition_size;
-    uint8_t       classifications;
-    uint8_t       classbook;
-    int16_t       books[64][8];
-    uint8_t       maxpass;
-    uint16_t      ptns_to_read;
-    uint8_t      *classifs;
-} vorbis_residue;
-
-typedef struct {
-    uint8_t       submaps;
-    uint16_t      coupling_steps;
-    uint8_t      *magnitude;
-    uint8_t      *angle;
-    uint8_t      *mux;
-    uint8_t       submap_floor[16];
-    uint8_t       submap_residue[16];
-} vorbis_mapping;
-
-typedef struct {
-    uint8_t       blockflag;
-    uint16_t      windowtype;
-    uint16_t      transformtype;
-    uint8_t       mapping;
-} vorbis_mode;
-
-typedef struct vorbis_context_s {
-    AVCodecContext *avctx;
-    GetBitContext gb;
-    VorbisDSPContext dsp;
-    AVFloatDSPContext fdsp;
-    FmtConvertContext fmt_conv;
-
-    FFTContext mdct[2];
-    uint8_t       first_frame;
-    uint32_t      version;
-    uint8_t       audio_channels;
-    uint32_t      audio_samplerate;
-    uint32_t      bitrate_maximum;
-    uint32_t      bitrate_nominal;
-    uint32_t      bitrate_minimum;
-    uint32_t      blocksize[2];
-    const float  *win[2];
-    uint16_t      codebook_count;
-    vorbis_codebook *codebooks;
-    uint8_t       floor_count;
-    vorbis_floor *floors;
-    uint8_t       residue_count;
-    vorbis_residue *residues;
-    uint8_t       mapping_count;
-    vorbis_mapping *mappings;
-    uint8_t       mode_count;
-    vorbis_mode  *modes;
-    uint8_t       mode_number; // mode number for the current packet
-    uint8_t       previous_window;
-    float        *channel_residues;
-    float        *saved;
-} vorbis_context;
-
-/* Helper functions */
-
-#define BARK(x) \
-    (13.1f * atan(0.00074f * (x)) + 2.24f * atan(1.85e-8f * (x) * (x)) + 1e-4f * (x))
-
-static const char idx_err_str[] = "Index value %d out of range (0 - %d) for %s at %s:%i\n";
-#define VALIDATE_INDEX(idx, limit) \
-    if (idx >= limit) {\
-        av_log(vc->avctx, AV_LOG_ERROR,\
-               idx_err_str,\
-               (int)(idx), (int)(limit - 1), #idx, __FILE__, __LINE__);\
-        return AVERROR_INVALIDDATA;\
-    }
-#define GET_VALIDATED_INDEX(idx, bits, limit) \
-    {\
-        idx = get_bits(gb, bits);\
-        VALIDATE_INDEX(idx, limit)\
-    }
-
-static float vorbisfloat2float(unsigned val)
-{
-    double mant = val & 0x1fffff;
-    long exp    = (val & 0x7fe00000L) >> 21;
-    if (val & 0x80000000)
-        mant = -mant;
-    return ldexp(mant, exp - 20 - 768);
-}
-
-
-// Free all allocated memory -----------------------------------------
-
-static void vorbis_free(vorbis_context *vc)
-{
-    int i;
-
-    av_freep(&vc->channel_residues);
-    av_freep(&vc->saved);
-
-    for (i = 0; i < vc->residue_count; i++)
-        av_free(vc->residues[i].classifs);
-    av_freep(&vc->residues);
-    av_freep(&vc->modes);
-
-    ff_mdct_end(&vc->mdct[0]);
-    ff_mdct_end(&vc->mdct[1]);
-
-    for (i = 0; i < vc->codebook_count; ++i) {
-        av_free(vc->codebooks[i].codevectors);
-        ff_free_vlc(&vc->codebooks[i].vlc);
-    }
-    av_freep(&vc->codebooks);
-
-    for (i = 0; i < vc->floor_count; ++i) {
-        if (vc->floors[i].floor_type == 0) {
-            av_free(vc->floors[i].data.t0.map[0]);
-            av_free(vc->floors[i].data.t0.map[1]);
-            av_free(vc->floors[i].data.t0.book_list);
-            av_free(vc->floors[i].data.t0.lsp);
-        } else {
-            av_free(vc->floors[i].data.t1.list);
-        }
-    }
-    av_freep(&vc->floors);
-
-    for (i = 0; i < vc->mapping_count; ++i) {
-        av_free(vc->mappings[i].magnitude);
-        av_free(vc->mappings[i].angle);
-        av_free(vc->mappings[i].mux);
-    }
-    av_freep(&vc->mappings);
-}
-
-// Parse setup header -------------------------------------------------
-
-// Process codebooks part
-
-static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
-{
-    unsigned cb;
-    uint8_t  *tmp_vlc_bits  = NULL;
-    uint32_t *tmp_vlc_codes = NULL;
-    GetBitContext *gb = &vc->gb;
-    uint16_t *codebook_multiplicands = NULL;
-    int ret = 0;
-
-    vc->codebook_count = get_bits(gb, 8) + 1;
-
-    av_dlog(NULL, " Codebooks: %d \n", vc->codebook_count);
-
-    vc->codebooks = av_mallocz(vc->codebook_count * sizeof(*vc->codebooks));
-    tmp_vlc_bits  = av_mallocz(V_MAX_VLCS * sizeof(*tmp_vlc_bits));
-    tmp_vlc_codes = av_mallocz(V_MAX_VLCS * sizeof(*tmp_vlc_codes));
-    codebook_multiplicands = av_malloc(V_MAX_VLCS * sizeof(*codebook_multiplicands));
-    if (!vc->codebooks ||
-        !tmp_vlc_bits || !tmp_vlc_codes || !codebook_multiplicands) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-
-    for (cb = 0; cb < vc->codebook_count; ++cb) {
-        vorbis_codebook *codebook_setup = &vc->codebooks[cb];
-        unsigned ordered, t, entries, used_entries = 0;
-
-        av_dlog(NULL, " %u. Codebook\n", cb);
-
-        if (get_bits(gb, 24) != 0x564342) {
-            av_log(vc->avctx, AV_LOG_ERROR,
-                   " %u. Codebook setup data corrupt.\n", cb);
-            ret = AVERROR_INVALIDDATA;
-            goto error;
-        }
-
-        codebook_setup->dimensions=get_bits(gb, 16);
-        if (codebook_setup->dimensions > 16 || codebook_setup->dimensions == 0) {
-            av_log(vc->avctx, AV_LOG_ERROR,
-                   " %u. Codebook's dimension is invalid (%d).\n",
-                   cb, codebook_setup->dimensions);
-            ret = AVERROR_INVALIDDATA;
-            goto error;
-        }
-        entries = get_bits(gb, 24);
-        if (entries > V_MAX_VLCS) {
-            av_log(vc->avctx, AV_LOG_ERROR,
-                   " %u. Codebook has too many entries (%u).\n",
-                   cb, entries);
-            ret = AVERROR_INVALIDDATA;
-            goto error;
-        }
-
-        ordered = get_bits1(gb);
-
-        av_dlog(NULL, " codebook_dimensions %d, codebook_entries %u\n",
-                codebook_setup->dimensions, entries);
-
-        if (!ordered) {
-            unsigned ce, flag;
-            unsigned sparse = get_bits1(gb);
-
-            av_dlog(NULL, " not ordered \n");
-
-            if (sparse) {
-                av_dlog(NULL, " sparse \n");
-
-                used_entries = 0;
-                for (ce = 0; ce < entries; ++ce) {
-                    flag = get_bits1(gb);
-                    if (flag) {
-                        tmp_vlc_bits[ce] = get_bits(gb, 5) + 1;
-                        ++used_entries;
-                    } else
-                        tmp_vlc_bits[ce] = 0;
-                }
-            } else {
-                av_dlog(NULL, " not sparse \n");
-
-                used_entries = entries;
-                for (ce = 0; ce < entries; ++ce)
-                    tmp_vlc_bits[ce] = get_bits(gb, 5) + 1;
-            }
-        } else {
-            unsigned current_entry  = 0;
-            unsigned current_length = get_bits(gb, 5) + 1;
-
-            av_dlog(NULL, " ordered, current length: %u\n", current_length);  //FIXME
-
-            used_entries = entries;
-            for (; current_entry < used_entries && current_length <= 32; ++current_length) {
-                unsigned i, number;
-
-                av_dlog(NULL, " number bits: %u ", ilog(entries - current_entry));
-
-                number = get_bits(gb, ilog(entries - current_entry));
-
-                av_dlog(NULL, " number: %u\n", number);
-
-                for (i = current_entry; i < number+current_entry; ++i)
-                    if (i < used_entries)
-                        tmp_vlc_bits[i] = current_length;
-
-                current_entry+=number;
-            }
-            if (current_entry>used_entries) {
-                av_log(vc->avctx, AV_LOG_ERROR, " More codelengths than codes in codebook. \n");
-                ret = AVERROR_INVALIDDATA;
-                goto error;
-            }
-        }
-
-        codebook_setup->lookup_type = get_bits(gb, 4);
-
-        av_dlog(NULL, " lookup type: %d : %s \n", codebook_setup->lookup_type,
-                codebook_setup->lookup_type ? "vq" : "no lookup");
-
-// If the codebook is used for (inverse) VQ, calculate codevectors.
-
-        if (codebook_setup->lookup_type == 1) {
-            unsigned i, j, k;
-            unsigned codebook_lookup_values = ff_vorbis_nth_root(entries, codebook_setup->dimensions);
-
-            float codebook_minimum_value = vorbisfloat2float(get_bits_long(gb, 32));
-            float codebook_delta_value   = vorbisfloat2float(get_bits_long(gb, 32));
-            unsigned codebook_value_bits = get_bits(gb, 4) + 1;
-            unsigned codebook_sequence_p = get_bits1(gb);
-
-            av_dlog(NULL, " We expect %d numbers for building the codevectors. \n",
-                    codebook_lookup_values);
-            av_dlog(NULL, "  delta %f minmum %f \n",
-                    codebook_delta_value, codebook_minimum_value);
-
-            for (i = 0; i < codebook_lookup_values; ++i) {
-                codebook_multiplicands[i] = get_bits(gb, codebook_value_bits);
-
-                av_dlog(NULL, " multiplicands*delta+minmum : %e \n",
-                        (float)codebook_multiplicands[i] * codebook_delta_value + codebook_minimum_value);
-                av_dlog(NULL, " multiplicand %u\n", codebook_multiplicands[i]);
-            }
-
-// Weed out unused vlcs and build codevector vector
-            codebook_setup->codevectors = used_entries ? av_mallocz(used_entries *
-                                                                    codebook_setup->dimensions *
-                                                                    sizeof(*codebook_setup->codevectors))
-                                                       : NULL;
-            for (j = 0, i = 0; i < entries; ++i) {
-                unsigned dim = codebook_setup->dimensions;
-
-                if (tmp_vlc_bits[i]) {
-                    float last = 0.0;
-                    unsigned lookup_offset = i;
-
-                    av_dlog(vc->avctx, "Lookup offset %u ,", i);
-
-                    for (k = 0; k < dim; ++k) {
-                        unsigned multiplicand_offset = lookup_offset % codebook_lookup_values;
-                        codebook_setup->codevectors[j * dim + k] = codebook_multiplicands[multiplicand_offset] * codebook_delta_value + codebook_minimum_value + last;
-                        if (codebook_sequence_p)
-                            last = codebook_setup->codevectors[j * dim + k];
-                        lookup_offset/=codebook_lookup_values;
-                    }
-                    tmp_vlc_bits[j] = tmp_vlc_bits[i];
-
-                    av_dlog(vc->avctx, "real lookup offset %u, vector: ", j);
-                    for (k = 0; k < dim; ++k)
-                        av_dlog(vc->avctx, " %f ",
-                                codebook_setup->codevectors[j * dim + k]);
-                    av_dlog(vc->avctx, "\n");
-
-                    ++j;
-                }
-            }
-            if (j != used_entries) {
-                av_log(vc->avctx, AV_LOG_ERROR, "Bug in codevector vector building code. \n");
-                ret = AVERROR_INVALIDDATA;
-                goto error;
-            }
-            entries = used_entries;
-        } else if (codebook_setup->lookup_type >= 2) {
-            av_log(vc->avctx, AV_LOG_ERROR, "Codebook lookup type not supported. \n");
-            ret = AVERROR_INVALIDDATA;
-            goto error;
-        }
-
-// Initialize VLC table
-        if (ff_vorbis_len2vlc(tmp_vlc_bits, tmp_vlc_codes, entries)) {
-            av_log(vc->avctx, AV_LOG_ERROR, " Invalid code lengths while generating vlcs. \n");
-            ret = AVERROR_INVALIDDATA;
-            goto error;
-        }
-        codebook_setup->maxdepth = 0;
-        for (t = 0; t < entries; ++t)
-            if (tmp_vlc_bits[t] >= codebook_setup->maxdepth)
-                codebook_setup->maxdepth = tmp_vlc_bits[t];
-
-        if (codebook_setup->maxdepth > 3 * V_NB_BITS)
-            codebook_setup->nb_bits = V_NB_BITS2;
-        else
-            codebook_setup->nb_bits = V_NB_BITS;
-
-        codebook_setup->maxdepth = (codebook_setup->maxdepth+codebook_setup->nb_bits - 1) / codebook_setup->nb_bits;
-
-        if ((ret = init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits,
-                            entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits),
-                            sizeof(*tmp_vlc_bits), tmp_vlc_codes,
-                            sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes),
-                            INIT_VLC_LE))) {
-            av_log(vc->avctx, AV_LOG_ERROR, " Error generating vlc tables. \n");
-            goto error;
-        }
-    }
-
-    av_free(tmp_vlc_bits);
-    av_free(tmp_vlc_codes);
-    av_free(codebook_multiplicands);
-    return 0;
-
-// Error:
-error:
-    av_free(tmp_vlc_bits);
-    av_free(tmp_vlc_codes);
-    av_free(codebook_multiplicands);
-    return ret;
-}
-
-// Process time domain transforms part (unused in Vorbis I)
-
-static int vorbis_parse_setup_hdr_tdtransforms(vorbis_context *vc)
-{
-    GetBitContext *gb = &vc->gb;
-    unsigned i, vorbis_time_count = get_bits(gb, 6) + 1;
-
-    for (i = 0; i < vorbis_time_count; ++i) {
-        unsigned vorbis_tdtransform = get_bits(gb, 16);
-
-        av_dlog(NULL, " Vorbis time domain transform %u: %u\n",
-                vorbis_time_count, vorbis_tdtransform);
-
-        if (vorbis_tdtransform) {
-            av_log(vc->avctx, AV_LOG_ERROR, "Vorbis time domain transform data nonzero. \n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    return 0;
-}
-
-// Process floors part
-
-static int vorbis_floor0_decode(vorbis_context *vc,
-                                vorbis_floor_data *vfu, float *vec);
-static int create_map(vorbis_context *vc, unsigned floor_number);
-static int vorbis_floor1_decode(vorbis_context *vc,
-                                vorbis_floor_data *vfu, float *vec);
-static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
-{
-    GetBitContext *gb = &vc->gb;
-    int i, j, k, ret;
-
-    vc->floor_count = get_bits(gb, 6) + 1;
-
-    vc->floors = av_mallocz(vc->floor_count * sizeof(*vc->floors));
-    if (!vc->floors)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < vc->floor_count; ++i) {
-        vorbis_floor *floor_setup = &vc->floors[i];
-
-        floor_setup->floor_type = get_bits(gb, 16);
-
-        av_dlog(NULL, " %d. floor type %d \n", i, floor_setup->floor_type);
-
-        if (floor_setup->floor_type == 1) {
-            int maximum_class = -1;
-            unsigned rangebits, rangemax, floor1_values = 2;
-
-            floor_setup->decode = vorbis_floor1_decode;
-
-            floor_setup->data.t1.partitions = get_bits(gb, 5);
-
-            av_dlog(NULL, " %d.floor: %d partitions \n",
-                    i, floor_setup->data.t1.partitions);
-
-            for (j = 0; j < floor_setup->data.t1.partitions; ++j) {
-                floor_setup->data.t1.partition_class[j] = get_bits(gb, 4);
-                if (floor_setup->data.t1.partition_class[j] > maximum_class)
-                    maximum_class = floor_setup->data.t1.partition_class[j];
-
-                av_dlog(NULL, " %d. floor %d partition class %d \n",
-                        i, j, floor_setup->data.t1.partition_class[j]);
-
-            }
-
-            av_dlog(NULL, " maximum class %d \n", maximum_class);
-
-            for (j = 0; j <= maximum_class; ++j) {
-                floor_setup->data.t1.class_dimensions[j] = get_bits(gb, 3) + 1;
-                floor_setup->data.t1.class_subclasses[j] = get_bits(gb, 2);
-
-                av_dlog(NULL, " %d floor %d class dim: %d subclasses %d \n", i, j,
-                        floor_setup->data.t1.class_dimensions[j],
-                        floor_setup->data.t1.class_subclasses[j]);
-
-                if (floor_setup->data.t1.class_subclasses[j]) {
-                    GET_VALIDATED_INDEX(floor_setup->data.t1.class_masterbook[j], 8, vc->codebook_count)
-
-                    av_dlog(NULL, "   masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]);
-                }
-
-                for (k = 0; k < (1 << floor_setup->data.t1.class_subclasses[j]); ++k) {
-                    int16_t bits = get_bits(gb, 8) - 1;
-                    if (bits != -1)
-                        VALIDATE_INDEX(bits, vc->codebook_count)
-                    floor_setup->data.t1.subclass_books[j][k] = bits;
-
-                    av_dlog(NULL, "    book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]);
-                }
-            }
-
-            floor_setup->data.t1.multiplier = get_bits(gb, 2) + 1;
-            floor_setup->data.t1.x_list_dim = 2;
-
-            for (j = 0; j < floor_setup->data.t1.partitions; ++j)
-                floor_setup->data.t1.x_list_dim+=floor_setup->data.t1.class_dimensions[floor_setup->data.t1.partition_class[j]];
-
-            floor_setup->data.t1.list = av_mallocz(floor_setup->data.t1.x_list_dim *
-                                                   sizeof(*floor_setup->data.t1.list));
-            if (!floor_setup->data.t1.list)
-                return AVERROR(ENOMEM);
-
-            rangebits = get_bits(gb, 4);
-            rangemax = (1 << rangebits);
-            if (rangemax > vc->blocksize[1] / 2) {
-                av_log(vc->avctx, AV_LOG_ERROR,
-                       "Floor value is too large for blocksize: %u (%"PRIu32")\n",
-                       rangemax, vc->blocksize[1] / 2);
-                return AVERROR_INVALIDDATA;
-            }
-            floor_setup->data.t1.list[0].x = 0;
-            floor_setup->data.t1.list[1].x = rangemax;
-
-            for (j = 0; j < floor_setup->data.t1.partitions; ++j) {
-                for (k = 0; k < floor_setup->data.t1.class_dimensions[floor_setup->data.t1.partition_class[j]]; ++k, ++floor1_values) {
-                    floor_setup->data.t1.list[floor1_values].x = get_bits(gb, rangebits);
-
-                    av_dlog(NULL, " %u. floor1 Y coord. %d\n", floor1_values,
-                            floor_setup->data.t1.list[floor1_values].x);
-                }
-            }
-
-// Precalculate order of x coordinates - needed for decode
-            if (ff_vorbis_ready_floor1_list(vc->avctx,
-                                            floor_setup->data.t1.list,
-                                            floor_setup->data.t1.x_list_dim)) {
-                return AVERROR_INVALIDDATA;
-            }
-        } else if (floor_setup->floor_type == 0) {
-            unsigned max_codebook_dim = 0;
-
-            floor_setup->decode = vorbis_floor0_decode;
-
-            floor_setup->data.t0.order          = get_bits(gb,  8);
-            if (!floor_setup->data.t0.order) {
-                av_log(vc->avctx, AV_LOG_ERROR, "Floor 0 order is 0.\n");
-                return AVERROR_INVALIDDATA;
-            }
-            floor_setup->data.t0.rate           = get_bits(gb, 16);
-            if (!floor_setup->data.t0.rate) {
-                av_log(vc->avctx, AV_LOG_ERROR, "Floor 0 rate is 0.\n");
-                return AVERROR_INVALIDDATA;
-            }
-            floor_setup->data.t0.bark_map_size  = get_bits(gb, 16);
-            if (!floor_setup->data.t0.bark_map_size) {
-                av_log(vc->avctx, AV_LOG_ERROR,
-                       "Floor 0 bark map size is 0.\n");
-                return AVERROR_INVALIDDATA;
-            }
-            floor_setup->data.t0.amplitude_bits = get_bits(gb,  6);
-            floor_setup->data.t0.amplitude_offset = get_bits(gb, 8);
-            floor_setup->data.t0.num_books        = get_bits(gb, 4) + 1;
-
-            /* allocate mem for booklist */
-            floor_setup->data.t0.book_list =
-                av_malloc(floor_setup->data.t0.num_books);
-            if (!floor_setup->data.t0.book_list)
-                return AVERROR(ENOMEM);
-            /* read book indexes */
-            {
-                int idx;
-                unsigned book_idx;
-                for (idx = 0; idx < floor_setup->data.t0.num_books; ++idx) {
-                    GET_VALIDATED_INDEX(book_idx, 8, vc->codebook_count)
-                    floor_setup->data.t0.book_list[idx] = book_idx;
-                    if (vc->codebooks[book_idx].dimensions > max_codebook_dim)
-                        max_codebook_dim = vc->codebooks[book_idx].dimensions;
-                }
-            }
-
-            if ((ret = create_map(vc, i)) < 0)
-                return ret;
-
-            /* codebook dim is for padding if codebook dim doesn't *
-             * divide order+1 then we need to read more data       */
-            floor_setup->data.t0.lsp =
-                av_malloc((floor_setup->data.t0.order + 1 + max_codebook_dim)
-                          * sizeof(*floor_setup->data.t0.lsp));
-            if (!floor_setup->data.t0.lsp)
-                return AVERROR(ENOMEM);
-
-            /* debug output parsed headers */
-            av_dlog(NULL, "floor0 order: %u\n", floor_setup->data.t0.order);
-            av_dlog(NULL, "floor0 rate: %u\n", floor_setup->data.t0.rate);
-            av_dlog(NULL, "floor0 bark map size: %u\n",
-                    floor_setup->data.t0.bark_map_size);
-            av_dlog(NULL, "floor0 amplitude bits: %u\n",
-                    floor_setup->data.t0.amplitude_bits);
-            av_dlog(NULL, "floor0 amplitude offset: %u\n",
-                    floor_setup->data.t0.amplitude_offset);
-            av_dlog(NULL, "floor0 number of books: %u\n",
-                    floor_setup->data.t0.num_books);
-            av_dlog(NULL, "floor0 book list pointer: %p\n",
-                    floor_setup->data.t0.book_list);
-            {
-                int idx;
-                for (idx = 0; idx < floor_setup->data.t0.num_books; ++idx) {
-                    av_dlog(NULL, "  Book %d: %u\n", idx + 1,
-                            floor_setup->data.t0.book_list[idx]);
-                }
-            }
-        } else {
-            av_log(vc->avctx, AV_LOG_ERROR, "Invalid floor type!\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    return 0;
-}
-
-// Process residues part
-
-static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
-{
-    GetBitContext *gb = &vc->gb;
-    unsigned i, j, k;
-
-    vc->residue_count = get_bits(gb, 6)+1;
-    vc->residues      = av_mallocz(vc->residue_count * sizeof(*vc->residues));
-    if (!vc->residues)
-        return AVERROR(ENOMEM);
-
-    av_dlog(NULL, " There are %d residues. \n", vc->residue_count);
-
-    for (i = 0; i < vc->residue_count; ++i) {
-        vorbis_residue *res_setup = &vc->residues[i];
-        uint8_t cascade[64];
-        unsigned high_bits, low_bits;
-
-        res_setup->type = get_bits(gb, 16);
-
-        av_dlog(NULL, " %u. residue type %d\n", i, res_setup->type);
-
-        res_setup->begin          = get_bits(gb, 24);
-        res_setup->end            = get_bits(gb, 24);
-        res_setup->partition_size = get_bits(gb, 24) + 1;
-        /* Validations to prevent a buffer overflow later. */
-        if (res_setup->begin>res_setup->end ||
-            res_setup->end > (res_setup->type == 2 ? vc->avctx->channels : 1) * vc->blocksize[1] / 2 ||
-            (res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
-            av_log(vc->avctx, AV_LOG_ERROR,
-                   "partition out of bounds: type, begin, end, size, blocksize: %"PRIu16", %"PRIu32", %"PRIu32", %u, %"PRIu32"\n",
-                   res_setup->type, res_setup->begin, res_setup->end,
-                   res_setup->partition_size, vc->blocksize[1] / 2);
-            return AVERROR_INVALIDDATA;
-        }
-
-        res_setup->classifications = get_bits(gb, 6) + 1;
-        GET_VALIDATED_INDEX(res_setup->classbook, 8, vc->codebook_count)
-
-        res_setup->ptns_to_read =
-            (res_setup->end - res_setup->begin) / res_setup->partition_size;
-        res_setup->classifs = av_malloc(res_setup->ptns_to_read *
-                                        vc->audio_channels *
-                                        sizeof(*res_setup->classifs));
-        if (!res_setup->classifs)
-            return AVERROR(ENOMEM);
-
-        av_dlog(NULL, "    begin %d end %d part.size %d classif.s %d classbook %d \n",
-                res_setup->begin, res_setup->end, res_setup->partition_size,
-                res_setup->classifications, res_setup->classbook);
-
-        for (j = 0; j < res_setup->classifications; ++j) {
-            high_bits = 0;
-            low_bits  = get_bits(gb, 3);
-            if (get_bits1(gb))
-                high_bits = get_bits(gb, 5);
-            cascade[j] = (high_bits << 3) + low_bits;
-
-            av_dlog(NULL, "     %u class cascade depth: %d\n", j, ilog(cascade[j]));
-        }
-
-        res_setup->maxpass = 0;
-        for (j = 0; j < res_setup->classifications; ++j) {
-            for (k = 0; k < 8; ++k) {
-                if (cascade[j]&(1 << k)) {
-                    GET_VALIDATED_INDEX(res_setup->books[j][k], 8, vc->codebook_count)
-
-                    av_dlog(NULL, "     %u class cascade depth %u book: %d\n",
-                            j, k, res_setup->books[j][k]);
-
-                    if (k>res_setup->maxpass)
-                        res_setup->maxpass = k;
-                } else {
-                    res_setup->books[j][k] = -1;
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-// Process mappings part
-
-static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
-{
-    GetBitContext *gb = &vc->gb;
-    unsigned i, j;
-
-    vc->mapping_count = get_bits(gb, 6)+1;
-    vc->mappings      = av_mallocz(vc->mapping_count * sizeof(*vc->mappings));
-    if (!vc->mappings)
-        return AVERROR(ENOMEM);
-
-    av_dlog(NULL, " There are %d mappings. \n", vc->mapping_count);
-
-    for (i = 0; i < vc->mapping_count; ++i) {
-        vorbis_mapping *mapping_setup = &vc->mappings[i];
-
-        if (get_bits(gb, 16)) {
-            av_log(vc->avctx, AV_LOG_ERROR, "Other mappings than type 0 are not compliant with the Vorbis I specification. \n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (get_bits1(gb)) {
-            mapping_setup->submaps = get_bits(gb, 4) + 1;
-        } else {
-            mapping_setup->submaps = 1;
-        }
-
-        if (get_bits1(gb)) {
-            mapping_setup->coupling_steps = get_bits(gb, 8) + 1;
-            mapping_setup->magnitude      = av_mallocz(mapping_setup->coupling_steps *
-                                                       sizeof(*mapping_setup->magnitude));
-            mapping_setup->angle          = av_mallocz(mapping_setup->coupling_steps *
-                                                       sizeof(*mapping_setup->angle));
-            if (!mapping_setup->angle || !mapping_setup->magnitude)
-                return AVERROR(ENOMEM);
-
-            for (j = 0; j < mapping_setup->coupling_steps; ++j) {
-                GET_VALIDATED_INDEX(mapping_setup->magnitude[j], ilog(vc->audio_channels - 1), vc->audio_channels)
-                GET_VALIDATED_INDEX(mapping_setup->angle[j],     ilog(vc->audio_channels - 1), vc->audio_channels)
-            }
-        } else {
-            mapping_setup->coupling_steps = 0;
-        }
-
-        av_dlog(NULL, "   %u mapping coupling steps: %d\n",
-                i, mapping_setup->coupling_steps);
-
-        if (get_bits(gb, 2)) {
-            av_log(vc->avctx, AV_LOG_ERROR, "%u. mapping setup data invalid.\n", i);
-            return AVERROR_INVALIDDATA; // following spec.
-        }
-
-        if (mapping_setup->submaps>1) {
-            mapping_setup->mux = av_mallocz(vc->audio_channels *
-                                            sizeof(*mapping_setup->mux));
-            if (!mapping_setup->mux)
-                return AVERROR(ENOMEM);
-
-            for (j = 0; j < vc->audio_channels; ++j)
-                mapping_setup->mux[j] = get_bits(gb, 4);
-        }
-
-        for (j = 0; j < mapping_setup->submaps; ++j) {
-            skip_bits(gb, 8); // FIXME check?
-            GET_VALIDATED_INDEX(mapping_setup->submap_floor[j],   8, vc->floor_count)
-            GET_VALIDATED_INDEX(mapping_setup->submap_residue[j], 8, vc->residue_count)
-
-            av_dlog(NULL, "   %u mapping %u submap : floor %d, residue %d\n", i, j,
-                    mapping_setup->submap_floor[j],
-                    mapping_setup->submap_residue[j]);
-        }
-    }
-    return 0;
-}
-
-// Process modes part
-
-static int create_map(vorbis_context *vc, unsigned floor_number)
-{
-    vorbis_floor *floors = vc->floors;
-    vorbis_floor0 *vf;
-    int idx;
-    int blockflag, n;
-    int32_t *map;
-
-    for (blockflag = 0; blockflag < 2; ++blockflag) {
-        n = vc->blocksize[blockflag] / 2;
-        floors[floor_number].data.t0.map[blockflag] =
-            av_malloc((n + 1) * sizeof(int32_t)); // n + sentinel
-        if (!floors[floor_number].data.t0.map[blockflag])
-            return AVERROR(ENOMEM);
-
-        map =  floors[floor_number].data.t0.map[blockflag];
-        vf  = &floors[floor_number].data.t0;
-
-        for (idx = 0; idx < n; ++idx) {
-            map[idx] = floor(BARK((vf->rate * idx) / (2.0f * n)) *
-                             (vf->bark_map_size / BARK(vf->rate / 2.0f)));
-            if (vf->bark_map_size-1 < map[idx])
-                map[idx] = vf->bark_map_size - 1;
-        }
-        map[n] = -1;
-        vf->map_size[blockflag] = n;
-    }
-
-    for (idx = 0; idx <= n; ++idx) {
-        av_dlog(NULL, "floor0 map: map at pos %d is %d\n", idx, map[idx]);
-    }
-
-    return 0;
-}
-
-static int vorbis_parse_setup_hdr_modes(vorbis_context *vc)
-{
-    GetBitContext *gb = &vc->gb;
-    unsigned i;
-
-    vc->mode_count = get_bits(gb, 6) + 1;
-    vc->modes      = av_mallocz(vc->mode_count * sizeof(*vc->modes));
-    if (!vc->modes)
-        return AVERROR(ENOMEM);
-
-    av_dlog(NULL, " There are %d modes.\n", vc->mode_count);
-
-    for (i = 0; i < vc->mode_count; ++i) {
-        vorbis_mode *mode_setup = &vc->modes[i];
-
-        mode_setup->blockflag     = get_bits1(gb);
-        mode_setup->windowtype    = get_bits(gb, 16); //FIXME check
-        mode_setup->transformtype = get_bits(gb, 16); //FIXME check
-        GET_VALIDATED_INDEX(mode_setup->mapping, 8, vc->mapping_count);
-
-        av_dlog(NULL, " %u mode: blockflag %d, windowtype %d, transformtype %d, mapping %d\n",
-                i, mode_setup->blockflag, mode_setup->windowtype,
-                mode_setup->transformtype, mode_setup->mapping);
-    }
-    return 0;
-}
-
-// Process the whole setup header using the functions above
-
-static int vorbis_parse_setup_hdr(vorbis_context *vc)
-{
-    GetBitContext *gb = &vc->gb;
-    int ret;
-
-    if ((get_bits(gb, 8) != 'v') || (get_bits(gb, 8) != 'o') ||
-        (get_bits(gb, 8) != 'r') || (get_bits(gb, 8) != 'b') ||
-        (get_bits(gb, 8) != 'i') || (get_bits(gb, 8) != 's')) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis setup header packet corrupt (no vorbis signature). \n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = vorbis_parse_setup_hdr_codebooks(vc))) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis setup header packet corrupt (codebooks). \n");
-        return ret;
-    }
-    if ((ret = vorbis_parse_setup_hdr_tdtransforms(vc))) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis setup header packet corrupt (time domain transforms). \n");
-        return ret;
-    }
-    if ((ret = vorbis_parse_setup_hdr_floors(vc))) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis setup header packet corrupt (floors). \n");
-        return ret;
-    }
-    if ((ret = vorbis_parse_setup_hdr_residues(vc))) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis setup header packet corrupt (residues). \n");
-        return ret;
-    }
-    if ((ret = vorbis_parse_setup_hdr_mappings(vc))) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis setup header packet corrupt (mappings). \n");
-        return ret;
-    }
-    if ((ret = vorbis_parse_setup_hdr_modes(vc))) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis setup header packet corrupt (modes). \n");
-        return ret;
-    }
-    if (!get_bits1(gb)) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis setup header packet corrupt (framing flag). \n");
-        return AVERROR_INVALIDDATA; // framing flag bit unset error
-    }
-
-    return 0;
-}
-
-// Process the identification header
-
-static int vorbis_parse_id_hdr(vorbis_context *vc)
-{
-    GetBitContext *gb = &vc->gb;
-    unsigned bl0, bl1;
-
-    if ((get_bits(gb, 8) != 'v') || (get_bits(gb, 8) != 'o') ||
-        (get_bits(gb, 8) != 'r') || (get_bits(gb, 8) != 'b') ||
-        (get_bits(gb, 8) != 'i') || (get_bits(gb, 8) != 's')) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis id header packet corrupt (no vorbis signature). \n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    vc->version        = get_bits_long(gb, 32);    //FIXME check 0
-    vc->audio_channels = get_bits(gb, 8);
-    if (vc->audio_channels <= 0) {
-        av_log(vc->avctx, AV_LOG_ERROR, "Invalid number of channels\n");
-        return AVERROR_INVALIDDATA;
-    }
-    vc->audio_samplerate = get_bits_long(gb, 32);
-    if (vc->audio_samplerate <= 0) {
-        av_log(vc->avctx, AV_LOG_ERROR, "Invalid samplerate\n");
-        return AVERROR_INVALIDDATA;
-    }
-    vc->bitrate_maximum = get_bits_long(gb, 32);
-    vc->bitrate_nominal = get_bits_long(gb, 32);
-    vc->bitrate_minimum = get_bits_long(gb, 32);
-    bl0 = get_bits(gb, 4);
-    bl1 = get_bits(gb, 4);
-    vc->blocksize[0] = (1 << bl0);
-    vc->blocksize[1] = (1 << bl1);
-    if (bl0 > 13 || bl0 < 6 || bl1 > 13 || bl1 < 6 || bl1 < bl0) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis id header packet corrupt (illegal blocksize). \n");
-        return AVERROR_INVALIDDATA;
-    }
-    vc->win[0] = ff_vorbis_vwin[bl0 - 6];
-    vc->win[1] = ff_vorbis_vwin[bl1 - 6];
-
-    if ((get_bits1(gb)) == 0) {
-        av_log(vc->avctx, AV_LOG_ERROR, " Vorbis id header packet corrupt (framing flag not set). \n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    vc->channel_residues =  av_malloc((vc->blocksize[1]  / 2) * vc->audio_channels * sizeof(*vc->channel_residues));
-    vc->saved            =  av_mallocz((vc->blocksize[1] / 4) * vc->audio_channels * sizeof(*vc->saved));
-    if (!vc->channel_residues || !vc->saved)
-        return AVERROR(ENOMEM);
-
-    vc->previous_window  = 0;
-
-    ff_mdct_init(&vc->mdct[0], bl0, 1, -1.0);
-    ff_mdct_init(&vc->mdct[1], bl1, 1, -1.0);
-
-    av_dlog(NULL, " vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",
-            vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize[0], vc->blocksize[1]);
-
-/*
-    BLK = vc->blocksize[0];
-    for (i = 0; i < BLK / 2; ++i) {
-        vc->win[0][i] = sin(0.5*3.14159265358*(sin(((float)i + 0.5) / (float)BLK*3.14159265358))*(sin(((float)i + 0.5) / (float)BLK*3.14159265358)));
-    }
-*/
-
-    return 0;
-}
-
-// Process the extradata using the functions above (identification header, setup header)
-
-static av_cold int vorbis_decode_init(AVCodecContext *avctx)
-{
-    vorbis_context *vc = avctx->priv_data;
-    uint8_t *headers   = avctx->extradata;
-    int headers_len    = avctx->extradata_size;
-    uint8_t *header_start[3];
-    int header_len[3];
-    GetBitContext *gb = &vc->gb;
-    int hdr_type, ret;
-
-    vc->avctx = avctx;
-    ff_vorbisdsp_init(&vc->dsp);
-    avpriv_float_dsp_init(&vc->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-    ff_fmt_convert_init(&vc->fmt_conv, avctx);
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    if (!headers_len) {
-        av_log(avctx, AV_LOG_ERROR, "Extradata missing.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = avpriv_split_xiph_headers(headers, headers_len, 30, header_start, header_len)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Extradata corrupt.\n");
-        return ret;
-    }
-
-    init_get_bits(gb, header_start[0], header_len[0]*8);
-    hdr_type = get_bits(gb, 8);
-    if (hdr_type != 1) {
-        av_log(avctx, AV_LOG_ERROR, "First header is not the id header.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if ((ret = vorbis_parse_id_hdr(vc))) {
-        av_log(avctx, AV_LOG_ERROR, "Id header corrupt.\n");
-        vorbis_free(vc);
-        return ret;
-    }
-
-    init_get_bits(gb, header_start[2], header_len[2]*8);
-    hdr_type = get_bits(gb, 8);
-    if (hdr_type != 5) {
-        av_log(avctx, AV_LOG_ERROR, "Third header is not the setup header.\n");
-        vorbis_free(vc);
-        return AVERROR_INVALIDDATA;
-    }
-    if ((ret = vorbis_parse_setup_hdr(vc))) {
-        av_log(avctx, AV_LOG_ERROR, "Setup header corrupt.\n");
-        vorbis_free(vc);
-        return ret;
-    }
-
-    if (vc->audio_channels > 8)
-        avctx->channel_layout = 0;
-    else
-        avctx->channel_layout = ff_vorbis_channel_layouts[vc->audio_channels - 1];
-
-    avctx->channels    = vc->audio_channels;
-    avctx->sample_rate = vc->audio_samplerate;
-
-    return 0;
-}
-
-// Decode audiopackets -------------------------------------------------
-
-// Read and decode floor
-
-static int vorbis_floor0_decode(vorbis_context *vc,
-                                vorbis_floor_data *vfu, float *vec)
-{
-    vorbis_floor0 *vf = &vfu->t0;
-    float *lsp = vf->lsp;
-    unsigned amplitude, book_idx;
-    unsigned blockflag = vc->modes[vc->mode_number].blockflag;
-
-    if (!vf->amplitude_bits)
-        return 1;
-
-    amplitude = get_bits(&vc->gb, vf->amplitude_bits);
-    if (amplitude > 0) {
-        float last = 0;
-        unsigned idx, lsp_len = 0;
-        vorbis_codebook codebook;
-
-        book_idx = get_bits(&vc->gb, ilog(vf->num_books));
-        if (book_idx >= vf->num_books) {
-            av_log(vc->avctx, AV_LOG_ERROR, "floor0 dec: booknumber too high!\n");
-            book_idx =  0;
-        }
-        av_dlog(NULL, "floor0 dec: booknumber: %u\n", book_idx);
-        codebook = vc->codebooks[vf->book_list[book_idx]];
-        /* Invalid codebook! */
-        if (!codebook.codevectors)
-            return AVERROR_INVALIDDATA;
-
-        while (lsp_len<vf->order) {
-            int vec_off;
-
-            av_dlog(NULL, "floor0 dec: book dimension: %d\n", codebook.dimensions);
-            av_dlog(NULL, "floor0 dec: maximum depth: %d\n", codebook.maxdepth);
-            /* read temp vector */
-            vec_off = get_vlc2(&vc->gb, codebook.vlc.table,
-                               codebook.nb_bits, codebook.maxdepth)
-                      * codebook.dimensions;
-            av_dlog(NULL, "floor0 dec: vector offset: %d\n", vec_off);
-            /* copy each vector component and add last to it */
-            for (idx = 0; idx < codebook.dimensions; ++idx)
-                lsp[lsp_len+idx] = codebook.codevectors[vec_off+idx] + last;
-            last = lsp[lsp_len+idx-1]; /* set last to last vector component */
-
-            lsp_len += codebook.dimensions;
-        }
-        /* DEBUG: output lsp coeffs */
-        {
-            int idx;
-            for (idx = 0; idx < lsp_len; ++idx)
-                av_dlog(NULL, "floor0 dec: coeff at %d is %f\n", idx, lsp[idx]);
-        }
-
-        /* synthesize floor output vector */
-        {
-            int i;
-            int order = vf->order;
-            float wstep = M_PI / vf->bark_map_size;
-
-            for (i = 0; i < order; i++)
-                lsp[i] = 2.0f * cos(lsp[i]);
-
-            av_dlog(NULL, "floor0 synth: map_size = %"PRIu32"; m = %d; wstep = %f\n",
-                    vf->map_size[blockflag], order, wstep);
-
-            i = 0;
-            while (i < vf->map_size[blockflag]) {
-                int j, iter_cond = vf->map[blockflag][i];
-                float p = 0.5f;
-                float q = 0.5f;
-                float two_cos_w = 2.0f * cos(wstep * iter_cond); // needed all times
-
-                /* similar part for the q and p products */
-                for (j = 0; j + 1 < order; j += 2) {
-                    q *= lsp[j]     - two_cos_w;
-                    p *= lsp[j + 1] - two_cos_w;
-                }
-                if (j == order) { // even order
-                    p *= p * (2.0f - two_cos_w);
-                    q *= q * (2.0f + two_cos_w);
-                } else { // odd order
-                    q *= two_cos_w-lsp[j]; // one more time for q
-
-                    /* final step and square */
-                    p *= p * (4.f - two_cos_w * two_cos_w);
-                    q *= q;
-                }
-
-                /* calculate linear floor value */
-                q = exp((((amplitude*vf->amplitude_offset) /
-                          (((1 << vf->amplitude_bits) - 1) * sqrt(p + q)))
-                         - vf->amplitude_offset) * .11512925f);
-
-                /* fill vector */
-                do {
-                    vec[i] = q; ++i;
-                } while (vf->map[blockflag][i] == iter_cond);
-            }
-        }
-    } else {
-        /* this channel is unused */
-        return 1;
-    }
-
-    av_dlog(NULL, " Floor0 decoded\n");
-
-    return 0;
-}
-
-static int vorbis_floor1_decode(vorbis_context *vc,
-                                vorbis_floor_data *vfu, float *vec)
-{
-    vorbis_floor1 *vf = &vfu->t1;
-    GetBitContext *gb = &vc->gb;
-    uint16_t range_v[4] = { 256, 128, 86, 64 };
-    unsigned range = range_v[vf->multiplier - 1];
-    uint16_t floor1_Y[258];
-    uint16_t floor1_Y_final[258];
-    int floor1_flag[258];
-    unsigned class, cdim, cbits, csub, cval, offset, i, j;
-    int book, adx, ady, dy, off, predicted, err;
-
-
-    if (!get_bits1(gb)) // silence
-        return 1;
-
-// Read values (or differences) for the floor's points
-
-    floor1_Y[0] = get_bits(gb, ilog(range - 1));
-    floor1_Y[1] = get_bits(gb, ilog(range - 1));
-
-    av_dlog(NULL, "floor 0 Y %d floor 1 Y %d \n", floor1_Y[0], floor1_Y[1]);
-
-    offset = 2;
-    for (i = 0; i < vf->partitions; ++i) {
-        class = vf->partition_class[i];
-        cdim   = vf->class_dimensions[class];
-        cbits  = vf->class_subclasses[class];
-        csub = (1 << cbits) - 1;
-        cval = 0;
-
-        av_dlog(NULL, "Cbits %u\n", cbits);
-
-        if (cbits) // this reads all subclasses for this partition's class
-            cval = get_vlc2(gb, vc->codebooks[vf->class_masterbook[class]].vlc.table,
-                            vc->codebooks[vf->class_masterbook[class]].nb_bits, 3);
-
-        for (j = 0; j < cdim; ++j) {
-            book = vf->subclass_books[class][cval & csub];
-
-            av_dlog(NULL, "book %d Cbits %u cval %u  bits:%d\n",
-                    book, cbits, cval, get_bits_count(gb));
-
-            cval = cval >> cbits;
-            if (book > -1) {
-                floor1_Y[offset+j] = get_vlc2(gb, vc->codebooks[book].vlc.table,
-                vc->codebooks[book].nb_bits, 3);
-            } else {
-                floor1_Y[offset+j] = 0;
-            }
-
-            av_dlog(NULL, " floor(%d) = %d \n",
-                    vf->list[offset+j].x, floor1_Y[offset+j]);
-        }
-        offset+=cdim;
-    }
-
-// Amplitude calculation from the differences
-
-    floor1_flag[0] = 1;
-    floor1_flag[1] = 1;
-    floor1_Y_final[0] = floor1_Y[0];
-    floor1_Y_final[1] = floor1_Y[1];
-
-    for (i = 2; i < vf->x_list_dim; ++i) {
-        unsigned val, highroom, lowroom, room, high_neigh_offs, low_neigh_offs;
-
-        low_neigh_offs  = vf->list[i].low;
-        high_neigh_offs = vf->list[i].high;
-        dy  = floor1_Y_final[high_neigh_offs] - floor1_Y_final[low_neigh_offs];  // render_point begin
-        adx = vf->list[high_neigh_offs].x - vf->list[low_neigh_offs].x;
-        ady = FFABS(dy);
-        err = ady * (vf->list[i].x - vf->list[low_neigh_offs].x);
-        off = err / adx;
-        if (dy < 0) {
-            predicted = floor1_Y_final[low_neigh_offs] - off;
-        } else {
-            predicted = floor1_Y_final[low_neigh_offs] + off;
-        } // render_point end
-
-        val = floor1_Y[i];
-        highroom = range-predicted;
-        lowroom  = predicted;
-        if (highroom < lowroom) {
-            room = highroom * 2;
-        } else {
-            room = lowroom * 2;   // SPEC misspelling
-        }
-        if (val) {
-            floor1_flag[low_neigh_offs]  = 1;
-            floor1_flag[high_neigh_offs] = 1;
-            floor1_flag[i]               = 1;
-            if (val >= room) {
-                if (highroom > lowroom) {
-                    floor1_Y_final[i] = av_clip_uint16(val - lowroom + predicted);
-                } else {
-                    floor1_Y_final[i] = av_clip_uint16(predicted - val + highroom - 1);
-                }
-            } else {
-                if (val & 1) {
-                    floor1_Y_final[i] = av_clip_uint16(predicted - (val + 1) / 2);
-                } else {
-                    floor1_Y_final[i] = av_clip_uint16(predicted + val / 2);
-                }
-            }
-        } else {
-            floor1_flag[i]    = 0;
-            floor1_Y_final[i] = av_clip_uint16(predicted);
-        }
-
-        av_dlog(NULL, " Decoded floor(%d) = %u / val %u\n",
-                vf->list[i].x, floor1_Y_final[i], val);
-    }
-
-// Curve synth - connect the calculated dots and convert from dB scale FIXME optimize ?
-
-    ff_vorbis_floor1_render_list(vf->list, vf->x_list_dim, floor1_Y_final, floor1_flag, vf->multiplier, vec, vf->list[1].x);
-
-    av_dlog(NULL, " Floor decoded\n");
-
-    return 0;
-}
-
-static av_always_inline int setup_classifs(vorbis_context *vc,
-                                           vorbis_residue *vr,
-                                           uint8_t *do_not_decode,
-                                           unsigned ch_used,
-                                           int partition_count)
-{
-    int p, j, i;
-    unsigned c_p_c         = vc->codebooks[vr->classbook].dimensions;
-    unsigned inverse_class = ff_inverse[vr->classifications];
-    unsigned temp, temp2;
-    for (p = 0, j = 0; j < ch_used; ++j) {
-        if (!do_not_decode[j]) {
-            temp = get_vlc2(&vc->gb, vc->codebooks[vr->classbook].vlc.table,
-                                     vc->codebooks[vr->classbook].nb_bits, 3);
-
-            av_dlog(NULL, "Classword: %u\n", temp);
-
-            if (temp <= 65536) {
-                for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
-                    temp2 = (((uint64_t)temp) * inverse_class) >> 32;
-
-                    if (i < vr->ptns_to_read)
-                        vr->classifs[p + i] = temp - temp2 * vr->classifications;
-                    temp = temp2;
-                }
-            } else {
-                for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
-                    temp2 = temp / vr->classifications;
-
-                    if (i < vr->ptns_to_read)
-                        vr->classifs[p + i] = temp - temp2 * vr->classifications;
-                    temp = temp2;
-                }
-            }
-        }
-        p += vr->ptns_to_read;
-    }
-    return 0;
-}
-// Read and decode residue
-
-static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
-                                                           vorbis_residue *vr,
-                                                           unsigned ch,
-                                                           uint8_t *do_not_decode,
-                                                           float *vec,
-                                                           unsigned vlen,
-                                                           unsigned ch_left,
-                                                           int vr_type)
-{
-    GetBitContext *gb = &vc->gb;
-    unsigned c_p_c        = vc->codebooks[vr->classbook].dimensions;
-    uint8_t *classifs = vr->classifs;
-    unsigned pass, ch_used, i, j, k, l;
-    unsigned max_output = (ch - 1) * vlen;
-    int ptns_to_read = vr->ptns_to_read;
-
-    if (vr_type == 2) {
-        for (j = 1; j < ch; ++j)
-            do_not_decode[0] &= do_not_decode[j];  // FIXME - clobbering input
-        if (do_not_decode[0])
-            return 0;
-        ch_used = 1;
-        max_output += vr->end / ch;
-    } else {
-        ch_used = ch;
-        max_output += vr->end;
-    }
-
-    if (max_output > ch_left * vlen) {
-        av_log(vc->avctx, AV_LOG_ERROR, "Insufficient output buffer\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    av_dlog(NULL, " residue type 0/1/2 decode begin, ch: %d  cpc %d  \n", ch, c_p_c);
-
-    for (pass = 0; pass <= vr->maxpass; ++pass) { // FIXME OPTIMIZE?
-        int voffset, partition_count, j_times_ptns_to_read;
-
-        voffset = vr->begin;
-        for (partition_count = 0; partition_count < ptns_to_read;) {  // SPEC        error
-            if (!pass) {
-                setup_classifs(vc, vr, do_not_decode, ch_used, partition_count);
-            }
-            for (i = 0; (i < c_p_c) && (partition_count < ptns_to_read); ++i) {
-                for (j_times_ptns_to_read = 0, j = 0; j < ch_used; ++j) {
-                    unsigned voffs;
-
-                    if (!do_not_decode[j]) {
-                        unsigned vqclass = classifs[j_times_ptns_to_read + partition_count];
-                        int vqbook  = vr->books[vqclass][pass];
-
-                        if (vqbook >= 0 && vc->codebooks[vqbook].codevectors) {
-                            unsigned coffs;
-                            unsigned dim  = vc->codebooks[vqbook].dimensions;
-                            unsigned step = FASTDIV(vr->partition_size << 1, dim << 1);
-                            vorbis_codebook codebook = vc->codebooks[vqbook];
-
-                            if (vr_type == 0) {
-
-                                voffs = voffset+j*vlen;
-                                for (k = 0; k < step; ++k) {
-                                    coffs = get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
-                                    for (l = 0; l < dim; ++l)
-                                        vec[voffs + k + l * step] += codebook.codevectors[coffs + l];
-                                }
-                            } else if (vr_type == 1) {
-                                voffs = voffset + j * vlen;
-                                for (k = 0; k < step; ++k) {
-                                    coffs = get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
-                                    for (l = 0; l < dim; ++l, ++voffs) {
-                                        vec[voffs]+=codebook.codevectors[coffs+l];
-
-                                        av_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d  \n",
-                                                pass, voffs, vec[voffs], codebook.codevectors[coffs+l], coffs);
-                                    }
-                                }
-                            } else if (vr_type == 2 && ch == 2 && (voffset & 1) == 0 && (dim & 1) == 0) { // most frequent case optimized
-                                voffs = voffset >> 1;
-
-                                if (dim == 2) {
-                                    for (k = 0; k < step; ++k) {
-                                        coffs = get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * 2;
-                                        vec[voffs + k       ] += codebook.codevectors[coffs    ];
-                                        vec[voffs + k + vlen] += codebook.codevectors[coffs + 1];
-                                    }
-                                } else if (dim == 4) {
-                                    for (k = 0; k < step; ++k, voffs += 2) {
-                                        coffs = get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * 4;
-                                        vec[voffs           ] += codebook.codevectors[coffs    ];
-                                        vec[voffs + 1       ] += codebook.codevectors[coffs + 2];
-                                        vec[voffs + vlen    ] += codebook.codevectors[coffs + 1];
-                                        vec[voffs + vlen + 1] += codebook.codevectors[coffs + 3];
-                                    }
-                                } else
-                                for (k = 0; k < step; ++k) {
-                                    coffs = get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
-                                    for (l = 0; l < dim; l += 2, voffs++) {
-                                        vec[voffs       ] += codebook.codevectors[coffs + l    ];
-                                        vec[voffs + vlen] += codebook.codevectors[coffs + l + 1];
-
-                                        av_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d+%d  \n",
-                                                pass, voffset / ch + (voffs % ch) * vlen,
-                                                vec[voffset / ch + (voffs % ch) * vlen],
-                                                codebook.codevectors[coffs + l], coffs, l);
-                                    }
-                                }
-
-                            } else if (vr_type == 2) {
-                                unsigned voffs_div = FASTDIV(voffset << 1, ch <<1);
-                                unsigned voffs_mod = voffset - voffs_div * ch;
-
-                                for (k = 0; k < step; ++k) {
-                                    coffs = get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
-                                    for (l = 0; l < dim; ++l) {
-                                        vec[voffs_div + voffs_mod * vlen] +=
-                                            codebook.codevectors[coffs + l];
-
-                                        av_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d+%d  \n",
-                                                pass, voffs_div + voffs_mod * vlen,
-                                                vec[voffs_div + voffs_mod * vlen],
-                                                codebook.codevectors[coffs + l], coffs, l);
-
-                                        if (++voffs_mod == ch) {
-                                            voffs_div++;
-                                            voffs_mod = 0;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    j_times_ptns_to_read += ptns_to_read;
-                }
-                ++partition_count;
-                voffset += vr->partition_size;
-            }
-        }
-    }
-    return 0;
-}
-
-static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,
-                                        unsigned ch,
-                                        uint8_t *do_not_decode,
-                                        float *vec, unsigned vlen,
-                                        unsigned ch_left)
-{
-    if (vr->type == 2)
-        return vorbis_residue_decode_internal(vc, vr, ch, do_not_decode, vec, vlen, ch_left, 2);
-    else if (vr->type == 1)
-        return vorbis_residue_decode_internal(vc, vr, ch, do_not_decode, vec, vlen, ch_left, 1);
-    else if (vr->type == 0)
-        return vorbis_residue_decode_internal(vc, vr, ch, do_not_decode, vec, vlen, ch_left, 0);
-    else {
-        av_log(vc->avctx, AV_LOG_ERROR, " Invalid residue type while residue decode?! \n");
-        return AVERROR_INVALIDDATA;
-    }
-}
-
-void ff_vorbis_inverse_coupling(float *mag, float *ang, intptr_t blocksize)
-{
-    int i;
-    for (i = 0;  i < blocksize;  i++) {
-        if (mag[i] > 0.0) {
-            if (ang[i] > 0.0) {
-                ang[i] = mag[i] - ang[i];
-            } else {
-                float temp = ang[i];
-                ang[i]     = mag[i];
-                mag[i]    += temp;
-            }
-        } else {
-            if (ang[i] > 0.0) {
-                ang[i] += mag[i];
-            } else {
-                float temp = ang[i];
-                ang[i]     = mag[i];
-                mag[i]    -= temp;
-            }
-        }
-    }
-}
-
-// Decode the audio packet using the functions above
-
-static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr)
-{
-    GetBitContext *gb = &vc->gb;
-    FFTContext *mdct;
-    unsigned previous_window = vc->previous_window;
-    unsigned mode_number, blockflag, blocksize;
-    int i, j;
-    uint8_t no_residue[255];
-    uint8_t do_not_decode[255];
-    vorbis_mapping *mapping;
-    float *ch_res_ptr   = vc->channel_residues;
-    uint8_t res_chan[255];
-    unsigned res_num = 0;
-    int retlen  = 0;
-    unsigned ch_left = vc->audio_channels;
-    unsigned vlen;
-
-    if (get_bits1(gb)) {
-        av_log(vc->avctx, AV_LOG_ERROR, "Not a Vorbis I audio packet.\n");
-        return AVERROR_INVALIDDATA; // packet type not audio
-    }
-
-    if (vc->mode_count == 1) {
-        mode_number = 0;
-    } else {
-        GET_VALIDATED_INDEX(mode_number, ilog(vc->mode_count-1), vc->mode_count)
-    }
-    vc->mode_number = mode_number;
-    mapping = &vc->mappings[vc->modes[mode_number].mapping];
-
-    av_dlog(NULL, " Mode number: %u , mapping: %d , blocktype %d\n", mode_number,
-            vc->modes[mode_number].mapping, vc->modes[mode_number].blockflag);
-
-    blockflag = vc->modes[mode_number].blockflag;
-    blocksize = vc->blocksize[blockflag];
-    vlen = blocksize / 2;
-    if (blockflag) {
-        previous_window = get_bits(gb, 1);
-        skip_bits1(gb); // next_window
-    }
-
-    memset(ch_res_ptr,   0, sizeof(float) * vc->audio_channels * vlen); //FIXME can this be removed ?
-    for (i = 0; i < vc->audio_channels; ++i)
-        memset(floor_ptr[i], 0, vlen * sizeof(floor_ptr[0][0])); //FIXME can this be removed ?
-
-// Decode floor
-
-    for (i = 0; i < vc->audio_channels; ++i) {
-        vorbis_floor *floor;
-        int ret;
-        if (mapping->submaps > 1) {
-            floor = &vc->floors[mapping->submap_floor[mapping->mux[i]]];
-        } else {
-            floor = &vc->floors[mapping->submap_floor[0]];
-        }
-
-        ret = floor->decode(vc, &floor->data, floor_ptr[i]);
-
-        if (ret < 0) {
-            av_log(vc->avctx, AV_LOG_ERROR, "Invalid codebook in vorbis_floor_decode.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        no_residue[i] = ret;
-    }
-
-// Nonzero vector propagate
-
-    for (i = mapping->coupling_steps - 1; i >= 0; --i) {
-        if (!(no_residue[mapping->magnitude[i]] & no_residue[mapping->angle[i]])) {
-            no_residue[mapping->magnitude[i]] = 0;
-            no_residue[mapping->angle[i]]     = 0;
-        }
-    }
-
-// Decode residue
-
-    for (i = 0; i < mapping->submaps; ++i) {
-        vorbis_residue *residue;
-        unsigned ch = 0;
-        int ret;
-
-        for (j = 0; j < vc->audio_channels; ++j) {
-            if ((mapping->submaps == 1) || (i == mapping->mux[j])) {
-                res_chan[j] = res_num;
-                if (no_residue[j]) {
-                    do_not_decode[ch] = 1;
-                } else {
-                    do_not_decode[ch] = 0;
-                }
-                ++ch;
-                ++res_num;
-            }
-        }
-        residue = &vc->residues[mapping->submap_residue[i]];
-        if (ch_left < ch) {
-            av_log(vc->avctx, AV_LOG_ERROR, "Too many channels in vorbis_floor_decode.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (ch) {
-            ret = vorbis_residue_decode(vc, residue, ch, do_not_decode, ch_res_ptr, vlen, ch_left);
-            if (ret < 0)
-                return ret;
-        }
-
-        ch_res_ptr += ch * vlen;
-        ch_left -= ch;
-    }
-
-    if (ch_left > 0)
-        return AVERROR_INVALIDDATA;
-
-// Inverse coupling
-
-    for (i = mapping->coupling_steps - 1; i >= 0; --i) { //warning: i has to be signed
-        float *mag, *ang;
-
-        mag = vc->channel_residues+res_chan[mapping->magnitude[i]] * blocksize / 2;
-        ang = vc->channel_residues+res_chan[mapping->angle[i]]     * blocksize / 2;
-        vc->dsp.vorbis_inverse_coupling(mag, ang, blocksize / 2);
-    }
-
-// Dotproduct, MDCT
-
-    mdct = &vc->mdct[blockflag];
-
-    for (j = vc->audio_channels-1;j >= 0; j--) {
-        ch_res_ptr   = vc->channel_residues + res_chan[j] * blocksize / 2;
-        vc->fdsp.vector_fmul(floor_ptr[j], floor_ptr[j], ch_res_ptr, blocksize / 2);
-        mdct->imdct_half(mdct, ch_res_ptr, floor_ptr[j]);
-    }
-
-// Overlap/add, save data for next overlapping
-
-    retlen = (blocksize + vc->blocksize[previous_window]) / 4;
-    for (j = 0; j < vc->audio_channels; j++) {
-        unsigned bs0 = vc->blocksize[0];
-        unsigned bs1 = vc->blocksize[1];
-        float *residue    = vc->channel_residues + res_chan[j] * blocksize / 2;
-        float *saved      = vc->saved + j * bs1 / 4;
-        float *ret        = floor_ptr[j];
-        float *buf        = residue;
-        const float *win  = vc->win[blockflag & previous_window];
-
-        if (blockflag == previous_window) {
-            vc->fdsp.vector_fmul_window(ret, saved, buf, win, blocksize / 4);
-        } else if (blockflag > previous_window) {
-            vc->fdsp.vector_fmul_window(ret, saved, buf, win, bs0 / 4);
-            memcpy(ret+bs0/2, buf+bs0/4, ((bs1-bs0)/4) * sizeof(float));
-        } else {
-            memcpy(ret, saved, ((bs1 - bs0) / 4) * sizeof(float));
-            vc->fdsp.vector_fmul_window(ret + (bs1 - bs0) / 4, saved + (bs1 - bs0) / 4, buf, win, bs0 / 4);
-        }
-        memcpy(saved, buf + blocksize / 4, blocksize / 4 * sizeof(float));
-    }
-
-    vc->previous_window = blockflag;
-    return retlen;
-}
-
-// Return the decoded audio packet through the standard api
-
-static int vorbis_decode_frame(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    vorbis_context *vc = avctx->priv_data;
-    AVFrame *frame     = data;
-    GetBitContext *gb = &vc->gb;
-    float *channel_ptrs[255];
-    int i, len, ret;
-
-    av_dlog(NULL, "packet length %d \n", buf_size);
-
-    /* get output buffer */
-    frame->nb_samples = vc->blocksize[1] / 2;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (vc->audio_channels > 8) {
-        for (i = 0; i < vc->audio_channels; i++)
-            channel_ptrs[i] = (float *)frame->extended_data[i];
-    } else {
-        for (i = 0; i < vc->audio_channels; i++) {
-            int ch = ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][i];
-            channel_ptrs[ch] = (float *)frame->extended_data[i];
-        }
-    }
-
-    init_get_bits(gb, buf, buf_size*8);
-
-    if ((len = vorbis_parse_audio_packet(vc, channel_ptrs)) <= 0)
-        return len;
-
-    if (!vc->first_frame) {
-        vc->first_frame = 1;
-        *got_frame_ptr = 0;
-        av_frame_unref(frame);
-        return buf_size;
-    }
-
-    av_dlog(NULL, "parsed %d bytes %d bits, returned %d samples (*ch*bits) \n",
-            get_bits_count(gb) / 8, get_bits_count(gb) % 8, len);
-
-    frame->nb_samples = len;
-    *got_frame_ptr    = 1;
-
-    return buf_size;
-}
-
-// Close decoder
-
-static av_cold int vorbis_decode_close(AVCodecContext *avctx)
-{
-    vorbis_context *vc = avctx->priv_data;
-
-    vorbis_free(vc);
-
-    return 0;
-}
-
-static av_cold void vorbis_decode_flush(AVCodecContext *avctx)
-{
-    vorbis_context *vc = avctx->priv_data;
-
-    if (vc->saved) {
-        memset(vc->saved, 0, (vc->blocksize[1] / 4) * vc->audio_channels *
-                             sizeof(*vc->saved));
-    }
-    vc->previous_window = 0;
-}
-
-AVCodec ff_vorbis_decoder = {
-    .name            = "vorbis",
-    .long_name       = NULL_IF_CONFIG_SMALL("Vorbis"),
-    .type            = AVMEDIA_TYPE_AUDIO,
-    .id              = AV_CODEC_ID_VORBIS,
-    .priv_data_size  = sizeof(vorbis_context),
-    .init            = vorbis_decode_init,
-    .close           = vorbis_decode_close,
-    .decode          = vorbis_decode_frame,
-    .flush           = vorbis_decode_flush,
-    .capabilities    = CODEC_CAP_DR1,
-    .channel_layouts = ff_vorbis_channel_layouts,
-    .sample_fmts     = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                       AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/vorbisdsp.c b/deps/libav/libavcodec/vorbisdsp.c
deleted file mode 100644
index 8e82c10..0000000
--- a/deps/libav/libavcodec/vorbisdsp.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "vorbisdsp.h"
-#include "vorbis.h"
-
-av_cold void ff_vorbisdsp_init(VorbisDSPContext *dsp)
-{
-    dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling;
-
-    if (ARCH_ARM)
-        ff_vorbisdsp_init_arm(dsp);
-    if (ARCH_PPC)
-        ff_vorbisdsp_init_ppc(dsp);
-    if (ARCH_X86)
-        ff_vorbisdsp_init_x86(dsp);
-}
diff --git a/deps/libav/libavcodec/vorbisdsp.h b/deps/libav/libavcodec/vorbisdsp.h
deleted file mode 100644
index 32fcfef..0000000
--- a/deps/libav/libavcodec/vorbisdsp.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VORBISDSP_H
-#define AVCODEC_VORBISDSP_H
-
-#include <stdint.h>
-
-typedef struct VorbisDSPContext {
-    /* assume len is a multiple of 4, and arrays are 16-byte aligned */
-    void (*vorbis_inverse_coupling)(float *mag, float *ang,
-                                    intptr_t blocksize);
-} VorbisDSPContext;
-
-void ff_vorbisdsp_init(VorbisDSPContext *dsp);
-
-/* for internal use only */
-void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp);
-void ff_vorbisdsp_init_arm(VorbisDSPContext *dsp);
-void ff_vorbisdsp_init_ppc(VorbisDSPContext *dsp);
-
-#endif /* AVCODEC_VORBISDSP_H */
diff --git a/deps/libav/libavcodec/vorbisenc.c b/deps/libav/libavcodec/vorbisenc.c
deleted file mode 100644
index f16060e..0000000
--- a/deps/libav/libavcodec/vorbisenc.c
+++ /dev/null
@@ -1,1208 +0,0 @@
-/*
- * copyright (c) 2006 Oded Shimon <ods15 at ods15.dyndns.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Native Vorbis encoder.
- * @author Oded Shimon <ods15 at ods15.dyndns.org>
- */
-
-#include <float.h>
-#include "avcodec.h"
-#include "internal.h"
-#include "fft.h"
-#include "vorbis.h"
-#include "vorbis_enc_data.h"
-
-#define BITSTREAM_WRITER_LE
-#include "put_bits.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-typedef struct {
-    int nentries;
-    uint8_t *lens;
-    uint32_t *codewords;
-    int ndimensions;
-    float min;
-    float delta;
-    int seq_p;
-    int lookup;
-    int *quantlist;
-    float *dimensions;
-    float *pow2;
-} vorbis_enc_codebook;
-
-typedef struct {
-    int dim;
-    int subclass;
-    int masterbook;
-    int *books;
-} vorbis_enc_floor_class;
-
-typedef struct {
-    int partitions;
-    int *partition_to_class;
-    int nclasses;
-    vorbis_enc_floor_class *classes;
-    int multiplier;
-    int rangebits;
-    int values;
-    vorbis_floor1_entry *list;
-} vorbis_enc_floor;
-
-typedef struct {
-    int type;
-    int begin;
-    int end;
-    int partition_size;
-    int classifications;
-    int classbook;
-    int8_t (*books)[8];
-    float (*maxes)[2];
-} vorbis_enc_residue;
-
-typedef struct {
-    int submaps;
-    int *mux;
-    int *floor;
-    int *residue;
-    int coupling_steps;
-    int *magnitude;
-    int *angle;
-} vorbis_enc_mapping;
-
-typedef struct {
-    int blockflag;
-    int mapping;
-} vorbis_enc_mode;
-
-typedef struct {
-    int channels;
-    int sample_rate;
-    int log2_blocksize[2];
-    FFTContext mdct[2];
-    const float *win[2];
-    int have_saved;
-    float *saved;
-    float *samples;
-    float *floor;  // also used for tmp values for mdct
-    float *coeffs; // also used for residue after floor
-    float quality;
-
-    int ncodebooks;
-    vorbis_enc_codebook *codebooks;
-
-    int nfloors;
-    vorbis_enc_floor *floors;
-
-    int nresidues;
-    vorbis_enc_residue *residues;
-
-    int nmappings;
-    vorbis_enc_mapping *mappings;
-
-    int nmodes;
-    vorbis_enc_mode *modes;
-
-    int64_t next_pts;
-} vorbis_enc_context;
-
-#define MAX_CHANNELS     2
-#define MAX_CODEBOOK_DIM 8
-
-#define MAX_FLOOR_CLASS_DIM  4
-#define NUM_FLOOR_PARTITIONS 8
-#define MAX_FLOOR_VALUES     (MAX_FLOOR_CLASS_DIM*NUM_FLOOR_PARTITIONS+2)
-
-#define RESIDUE_SIZE           1600
-#define RESIDUE_PART_SIZE      32
-#define NUM_RESIDUE_PARTITIONS (RESIDUE_SIZE/RESIDUE_PART_SIZE)
-
-static inline int put_codeword(PutBitContext *pb, vorbis_enc_codebook *cb,
-                               int entry)
-{
-    assert(entry >= 0);
-    assert(entry < cb->nentries);
-    assert(cb->lens[entry]);
-    if (pb->size_in_bits - put_bits_count(pb) < cb->lens[entry])
-        return AVERROR(EINVAL);
-    put_bits(pb, cb->lens[entry], cb->codewords[entry]);
-    return 0;
-}
-
-static int cb_lookup_vals(int lookup, int dimensions, int entries)
-{
-    if (lookup == 1)
-        return ff_vorbis_nth_root(entries, dimensions);
-    else if (lookup == 2)
-        return dimensions *entries;
-    return 0;
-}
-
-static int ready_codebook(vorbis_enc_codebook *cb)
-{
-    int i;
-
-    ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries);
-
-    if (!cb->lookup) {
-        cb->pow2 = cb->dimensions = NULL;
-    } else {
-        int vals = cb_lookup_vals(cb->lookup, cb->ndimensions, cb->nentries);
-        cb->dimensions = av_malloc(sizeof(float) * cb->nentries * cb->ndimensions);
-        cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
-        if (!cb->dimensions || !cb->pow2)
-            return AVERROR(ENOMEM);
-        for (i = 0; i < cb->nentries; i++) {
-            float last = 0;
-            int j;
-            int div = 1;
-            for (j = 0; j < cb->ndimensions; j++) {
-                int off;
-                if (cb->lookup == 1)
-                    off = (i / div) % vals; // lookup type 1
-                else
-                    off = i * cb->ndimensions + j; // lookup type 2
-
-                cb->dimensions[i * cb->ndimensions + j] = last + cb->min + cb->quantlist[off] * cb->delta;
-                if (cb->seq_p)
-                    last = cb->dimensions[i * cb->ndimensions + j];
-                cb->pow2[i] += cb->dimensions[i * cb->ndimensions + j] * cb->dimensions[i * cb->ndimensions + j];
-                div *= vals;
-            }
-            cb->pow2[i] /= 2.0;
-        }
-    }
-    return 0;
-}
-
-static int ready_residue(vorbis_enc_residue *rc, vorbis_enc_context *venc)
-{
-    int i;
-    assert(rc->type == 2);
-    rc->maxes = av_mallocz(sizeof(float[2]) * rc->classifications);
-    if (!rc->maxes)
-        return AVERROR(ENOMEM);
-    for (i = 0; i < rc->classifications; i++) {
-        int j;
-        vorbis_enc_codebook * cb;
-        for (j = 0; j < 8; j++)
-            if (rc->books[i][j] != -1)
-                break;
-        if (j == 8) // zero
-            continue;
-        cb = &venc->codebooks[rc->books[i][j]];
-        assert(cb->ndimensions >= 2);
-        assert(cb->lookup);
-
-        for (j = 0; j < cb->nentries; j++) {
-            float a;
-            if (!cb->lens[j])
-                continue;
-            a = fabs(cb->dimensions[j * cb->ndimensions]);
-            if (a > rc->maxes[i][0])
-                rc->maxes[i][0] = a;
-            a = fabs(cb->dimensions[j * cb->ndimensions + 1]);
-            if (a > rc->maxes[i][1])
-                rc->maxes[i][1] = a;
-        }
-    }
-    // small bias
-    for (i = 0; i < rc->classifications; i++) {
-        rc->maxes[i][0] += 0.8;
-        rc->maxes[i][1] += 0.8;
-    }
-    return 0;
-}
-
-static int create_vorbis_context(vorbis_enc_context *venc,
-                                 AVCodecContext *avctx)
-{
-    vorbis_enc_floor   *fc;
-    vorbis_enc_residue *rc;
-    vorbis_enc_mapping *mc;
-    int i, book, ret;
-
-    venc->channels    = avctx->channels;
-    venc->sample_rate = avctx->sample_rate;
-    venc->log2_blocksize[0] = venc->log2_blocksize[1] = 11;
-
-    venc->ncodebooks = FF_ARRAY_ELEMS(cvectors);
-    venc->codebooks  = av_malloc(sizeof(vorbis_enc_codebook) * venc->ncodebooks);
-    if (!venc->codebooks)
-        return AVERROR(ENOMEM);
-
-    // codebook 0..14 - floor1 book, values 0..255
-    // codebook 15 residue masterbook
-    // codebook 16..29 residue
-    for (book = 0; book < venc->ncodebooks; book++) {
-        vorbis_enc_codebook *cb = &venc->codebooks[book];
-        int vals;
-        cb->ndimensions = cvectors[book].dim;
-        cb->nentries    = cvectors[book].real_len;
-        cb->min         = cvectors[book].min;
-        cb->delta       = cvectors[book].delta;
-        cb->lookup      = cvectors[book].lookup;
-        cb->seq_p       = 0;
-
-        cb->lens      = av_malloc(sizeof(uint8_t)  * cb->nentries);
-        cb->codewords = av_malloc(sizeof(uint32_t) * cb->nentries);
-        if (!cb->lens || !cb->codewords)
-            return AVERROR(ENOMEM);
-        memcpy(cb->lens, cvectors[book].clens, cvectors[book].len);
-        memset(cb->lens + cvectors[book].len, 0, cb->nentries - cvectors[book].len);
-
-        if (cb->lookup) {
-            vals = cb_lookup_vals(cb->lookup, cb->ndimensions, cb->nentries);
-            cb->quantlist = av_malloc(sizeof(int) * vals);
-            if (!cb->quantlist)
-                return AVERROR(ENOMEM);
-            for (i = 0; i < vals; i++)
-                cb->quantlist[i] = cvectors[book].quant[i];
-        } else {
-            cb->quantlist = NULL;
-        }
-        if ((ret = ready_codebook(cb)) < 0)
-            return ret;
-    }
-
-    venc->nfloors = 1;
-    venc->floors  = av_malloc(sizeof(vorbis_enc_floor) * venc->nfloors);
-    if (!venc->floors)
-        return AVERROR(ENOMEM);
-
-    // just 1 floor
-    fc = &venc->floors[0];
-    fc->partitions         = NUM_FLOOR_PARTITIONS;
-    fc->partition_to_class = av_malloc(sizeof(int) * fc->partitions);
-    if (!fc->partition_to_class)
-        return AVERROR(ENOMEM);
-    fc->nclasses           = 0;
-    for (i = 0; i < fc->partitions; i++) {
-        static const int a[] = {0, 1, 2, 2, 3, 3, 4, 4};
-        fc->partition_to_class[i] = a[i];
-        fc->nclasses = FFMAX(fc->nclasses, fc->partition_to_class[i]);
-    }
-    fc->nclasses++;
-    fc->classes = av_malloc(sizeof(vorbis_enc_floor_class) * fc->nclasses);
-    if (!fc->classes)
-        return AVERROR(ENOMEM);
-    for (i = 0; i < fc->nclasses; i++) {
-        vorbis_enc_floor_class * c = &fc->classes[i];
-        int j, books;
-        c->dim        = floor_classes[i].dim;
-        c->subclass   = floor_classes[i].subclass;
-        c->masterbook = floor_classes[i].masterbook;
-        books         = (1 << c->subclass);
-        c->books      = av_malloc(sizeof(int) * books);
-        if (!c->books)
-            return AVERROR(ENOMEM);
-        for (j = 0; j < books; j++)
-            c->books[j] = floor_classes[i].nbooks[j];
-    }
-    fc->multiplier = 2;
-    fc->rangebits  = venc->log2_blocksize[0] - 1;
-
-    fc->values = 2;
-    for (i = 0; i < fc->partitions; i++)
-        fc->values += fc->classes[fc->partition_to_class[i]].dim;
-
-    fc->list = av_malloc(sizeof(vorbis_floor1_entry) * fc->values);
-    if (!fc->list)
-        return AVERROR(ENOMEM);
-    fc->list[0].x = 0;
-    fc->list[1].x = 1 << fc->rangebits;
-    for (i = 2; i < fc->values; i++) {
-        static const int a[] = {
-             93, 23,372,  6, 46,186,750, 14, 33, 65,
-            130,260,556,  3, 10, 18, 28, 39, 55, 79,
-            111,158,220,312,464,650,850
-        };
-        fc->list[i].x = a[i - 2];
-    }
-    if (ff_vorbis_ready_floor1_list(avctx, fc->list, fc->values))
-        return AVERROR_BUG;
-
-    venc->nresidues = 1;
-    venc->residues  = av_malloc(sizeof(vorbis_enc_residue) * venc->nresidues);
-    if (!venc->residues)
-        return AVERROR(ENOMEM);
-
-    // single residue
-    rc = &venc->residues[0];
-    rc->type            = 2;
-    rc->begin           = 0;
-    rc->end             = 1600;
-    rc->partition_size  = 32;
-    rc->classifications = 10;
-    rc->classbook       = 15;
-    rc->books           = av_malloc(sizeof(*rc->books) * rc->classifications);
-    if (!rc->books)
-        return AVERROR(ENOMEM);
-    {
-        static const int8_t a[10][8] = {
-            { -1, -1, -1, -1, -1, -1, -1, -1, },
-            { -1, -1, 16, -1, -1, -1, -1, -1, },
-            { -1, -1, 17, -1, -1, -1, -1, -1, },
-            { -1, -1, 18, -1, -1, -1, -1, -1, },
-            { -1, -1, 19, -1, -1, -1, -1, -1, },
-            { -1, -1, 20, -1, -1, -1, -1, -1, },
-            { -1, -1, 21, -1, -1, -1, -1, -1, },
-            { 22, 23, -1, -1, -1, -1, -1, -1, },
-            { 24, 25, -1, -1, -1, -1, -1, -1, },
-            { 26, 27, 28, -1, -1, -1, -1, -1, },
-        };
-        memcpy(rc->books, a, sizeof a);
-    }
-    if ((ret = ready_residue(rc, venc)) < 0)
-        return ret;
-
-    venc->nmappings = 1;
-    venc->mappings  = av_malloc(sizeof(vorbis_enc_mapping) * venc->nmappings);
-    if (!venc->mappings)
-        return AVERROR(ENOMEM);
-
-    // single mapping
-    mc = &venc->mappings[0];
-    mc->submaps = 1;
-    mc->mux     = av_malloc(sizeof(int) * venc->channels);
-    if (!mc->mux)
-        return AVERROR(ENOMEM);
-    for (i = 0; i < venc->channels; i++)
-        mc->mux[i] = 0;
-    mc->floor   = av_malloc(sizeof(int) * mc->submaps);
-    mc->residue = av_malloc(sizeof(int) * mc->submaps);
-    if (!mc->floor || !mc->residue)
-        return AVERROR(ENOMEM);
-    for (i = 0; i < mc->submaps; i++) {
-        mc->floor[i]   = 0;
-        mc->residue[i] = 0;
-    }
-    mc->coupling_steps = venc->channels == 2 ? 1 : 0;
-    mc->magnitude      = av_malloc(sizeof(int) * mc->coupling_steps);
-    mc->angle          = av_malloc(sizeof(int) * mc->coupling_steps);
-    if (!mc->magnitude || !mc->angle)
-        return AVERROR(ENOMEM);
-    if (mc->coupling_steps) {
-        mc->magnitude[0] = 0;
-        mc->angle[0]     = 1;
-    }
-
-    venc->nmodes = 1;
-    venc->modes  = av_malloc(sizeof(vorbis_enc_mode) * venc->nmodes);
-    if (!venc->modes)
-        return AVERROR(ENOMEM);
-
-    // single mode
-    venc->modes[0].blockflag = 0;
-    venc->modes[0].mapping   = 0;
-
-    venc->have_saved = 0;
-    venc->saved      = av_malloc(sizeof(float) * venc->channels * (1 << venc->log2_blocksize[1]) / 2);
-    venc->samples    = av_malloc(sizeof(float) * venc->channels * (1 << venc->log2_blocksize[1]));
-    venc->floor      = av_malloc(sizeof(float) * venc->channels * (1 << venc->log2_blocksize[1]) / 2);
-    venc->coeffs     = av_malloc(sizeof(float) * venc->channels * (1 << venc->log2_blocksize[1]) / 2);
-    if (!venc->saved || !venc->samples || !venc->floor || !venc->coeffs)
-        return AVERROR(ENOMEM);
-
-    venc->win[0] = ff_vorbis_vwin[venc->log2_blocksize[0] - 6];
-    venc->win[1] = ff_vorbis_vwin[venc->log2_blocksize[1] - 6];
-
-    if ((ret = ff_mdct_init(&venc->mdct[0], venc->log2_blocksize[0], 0, 1.0)) < 0)
-        return ret;
-    if ((ret = ff_mdct_init(&venc->mdct[1], venc->log2_blocksize[1], 0, 1.0)) < 0)
-        return ret;
-
-    return 0;
-}
-
-static void put_float(PutBitContext *pb, float f)
-{
-    int exp, mant;
-    uint32_t res = 0;
-    mant = (int)ldexp(frexp(f, &exp), 20);
-    exp += 788 - 20;
-    if (mant < 0) {
-        res |= (1U << 31);
-        mant = -mant;
-    }
-    res |= mant | (exp << 21);
-    put_bits32(pb, res);
-}
-
-static void put_codebook_header(PutBitContext *pb, vorbis_enc_codebook *cb)
-{
-    int i;
-    int ordered = 0;
-
-    put_bits(pb, 24, 0x564342); //magic
-    put_bits(pb, 16, cb->ndimensions);
-    put_bits(pb, 24, cb->nentries);
-
-    for (i = 1; i < cb->nentries; i++)
-        if (cb->lens[i] < cb->lens[i-1])
-            break;
-    if (i == cb->nentries)
-        ordered = 1;
-
-    put_bits(pb, 1, ordered);
-    if (ordered) {
-        int len = cb->lens[0];
-        put_bits(pb, 5, len - 1);
-        i = 0;
-        while (i < cb->nentries) {
-            int j;
-            for (j = 0; j+i < cb->nentries; j++)
-                if (cb->lens[j+i] != len)
-                    break;
-            put_bits(pb, ilog(cb->nentries - i), j);
-            i += j;
-            len++;
-        }
-    } else {
-        int sparse = 0;
-        for (i = 0; i < cb->nentries; i++)
-            if (!cb->lens[i])
-                break;
-        if (i != cb->nentries)
-            sparse = 1;
-        put_bits(pb, 1, sparse);
-
-        for (i = 0; i < cb->nentries; i++) {
-            if (sparse)
-                put_bits(pb, 1, !!cb->lens[i]);
-            if (cb->lens[i])
-                put_bits(pb, 5, cb->lens[i] - 1);
-        }
-    }
-
-    put_bits(pb, 4, cb->lookup);
-    if (cb->lookup) {
-        int tmp  = cb_lookup_vals(cb->lookup, cb->ndimensions, cb->nentries);
-        int bits = ilog(cb->quantlist[0]);
-
-        for (i = 1; i < tmp; i++)
-            bits = FFMAX(bits, ilog(cb->quantlist[i]));
-
-        put_float(pb, cb->min);
-        put_float(pb, cb->delta);
-
-        put_bits(pb, 4, bits - 1);
-        put_bits(pb, 1, cb->seq_p);
-
-        for (i = 0; i < tmp; i++)
-            put_bits(pb, bits, cb->quantlist[i]);
-    }
-}
-
-static void put_floor_header(PutBitContext *pb, vorbis_enc_floor *fc)
-{
-    int i;
-
-    put_bits(pb, 16, 1); // type, only floor1 is supported
-
-    put_bits(pb, 5, fc->partitions);
-
-    for (i = 0; i < fc->partitions; i++)
-        put_bits(pb, 4, fc->partition_to_class[i]);
-
-    for (i = 0; i < fc->nclasses; i++) {
-        int j, books;
-
-        put_bits(pb, 3, fc->classes[i].dim - 1);
-        put_bits(pb, 2, fc->classes[i].subclass);
-
-        if (fc->classes[i].subclass)
-            put_bits(pb, 8, fc->classes[i].masterbook);
-
-        books = (1 << fc->classes[i].subclass);
-
-        for (j = 0; j < books; j++)
-            put_bits(pb, 8, fc->classes[i].books[j] + 1);
-    }
-
-    put_bits(pb, 2, fc->multiplier - 1);
-    put_bits(pb, 4, fc->rangebits);
-
-    for (i = 2; i < fc->values; i++)
-        put_bits(pb, fc->rangebits, fc->list[i].x);
-}
-
-static void put_residue_header(PutBitContext *pb, vorbis_enc_residue *rc)
-{
-    int i;
-
-    put_bits(pb, 16, rc->type);
-
-    put_bits(pb, 24, rc->begin);
-    put_bits(pb, 24, rc->end);
-    put_bits(pb, 24, rc->partition_size - 1);
-    put_bits(pb, 6, rc->classifications - 1);
-    put_bits(pb, 8, rc->classbook);
-
-    for (i = 0; i < rc->classifications; i++) {
-        int j, tmp = 0;
-        for (j = 0; j < 8; j++)
-            tmp |= (rc->books[i][j] != -1) << j;
-
-        put_bits(pb, 3, tmp & 7);
-        put_bits(pb, 1, tmp > 7);
-
-        if (tmp > 7)
-            put_bits(pb, 5, tmp >> 3);
-    }
-
-    for (i = 0; i < rc->classifications; i++) {
-        int j;
-        for (j = 0; j < 8; j++)
-            if (rc->books[i][j] != -1)
-                put_bits(pb, 8, rc->books[i][j]);
-    }
-}
-
-static int put_main_header(vorbis_enc_context *venc, uint8_t **out)
-{
-    int i;
-    PutBitContext pb;
-    uint8_t buffer[50000] = {0}, *p = buffer;
-    int buffer_len = sizeof buffer;
-    int len, hlens[3];
-
-    // identification header
-    init_put_bits(&pb, p, buffer_len);
-    put_bits(&pb, 8, 1); //magic
-    for (i = 0; "vorbis"[i]; i++)
-        put_bits(&pb, 8, "vorbis"[i]);
-    put_bits32(&pb, 0); // version
-    put_bits(&pb,  8, venc->channels);
-    put_bits32(&pb, venc->sample_rate);
-    put_bits32(&pb, 0); // bitrate
-    put_bits32(&pb, 0); // bitrate
-    put_bits32(&pb, 0); // bitrate
-    put_bits(&pb,  4, venc->log2_blocksize[0]);
-    put_bits(&pb,  4, venc->log2_blocksize[1]);
-    put_bits(&pb,  1, 1); // framing
-
-    flush_put_bits(&pb);
-    hlens[0] = put_bits_count(&pb) >> 3;
-    buffer_len -= hlens[0];
-    p += hlens[0];
-
-    // comment header
-    init_put_bits(&pb, p, buffer_len);
-    put_bits(&pb, 8, 3); //magic
-    for (i = 0; "vorbis"[i]; i++)
-        put_bits(&pb, 8, "vorbis"[i]);
-    put_bits32(&pb, 0); // vendor length TODO
-    put_bits32(&pb, 0); // amount of comments
-    put_bits(&pb,  1, 1); // framing
-
-    flush_put_bits(&pb);
-    hlens[1] = put_bits_count(&pb) >> 3;
-    buffer_len -= hlens[1];
-    p += hlens[1];
-
-    // setup header
-    init_put_bits(&pb, p, buffer_len);
-    put_bits(&pb, 8, 5); //magic
-    for (i = 0; "vorbis"[i]; i++)
-        put_bits(&pb, 8, "vorbis"[i]);
-
-    // codebooks
-    put_bits(&pb, 8, venc->ncodebooks - 1);
-    for (i = 0; i < venc->ncodebooks; i++)
-        put_codebook_header(&pb, &venc->codebooks[i]);
-
-    // time domain, reserved, zero
-    put_bits(&pb,  6, 0);
-    put_bits(&pb, 16, 0);
-
-    // floors
-    put_bits(&pb, 6, venc->nfloors - 1);
-    for (i = 0; i < venc->nfloors; i++)
-        put_floor_header(&pb, &venc->floors[i]);
-
-    // residues
-    put_bits(&pb, 6, venc->nresidues - 1);
-    for (i = 0; i < venc->nresidues; i++)
-        put_residue_header(&pb, &venc->residues[i]);
-
-    // mappings
-    put_bits(&pb, 6, venc->nmappings - 1);
-    for (i = 0; i < venc->nmappings; i++) {
-        vorbis_enc_mapping *mc = &venc->mappings[i];
-        int j;
-        put_bits(&pb, 16, 0); // mapping type
-
-        put_bits(&pb, 1, mc->submaps > 1);
-        if (mc->submaps > 1)
-            put_bits(&pb, 4, mc->submaps - 1);
-
-        put_bits(&pb, 1, !!mc->coupling_steps);
-        if (mc->coupling_steps) {
-            put_bits(&pb, 8, mc->coupling_steps - 1);
-            for (j = 0; j < mc->coupling_steps; j++) {
-                put_bits(&pb, ilog(venc->channels - 1), mc->magnitude[j]);
-                put_bits(&pb, ilog(venc->channels - 1), mc->angle[j]);
-            }
-        }
-
-        put_bits(&pb, 2, 0); // reserved
-
-        if (mc->submaps > 1)
-            for (j = 0; j < venc->channels; j++)
-                put_bits(&pb, 4, mc->mux[j]);
-
-        for (j = 0; j < mc->submaps; j++) {
-            put_bits(&pb, 8, 0); // reserved time configuration
-            put_bits(&pb, 8, mc->floor[j]);
-            put_bits(&pb, 8, mc->residue[j]);
-        }
-    }
-
-    // modes
-    put_bits(&pb, 6, venc->nmodes - 1);
-    for (i = 0; i < venc->nmodes; i++) {
-        put_bits(&pb, 1, venc->modes[i].blockflag);
-        put_bits(&pb, 16, 0); // reserved window type
-        put_bits(&pb, 16, 0); // reserved transform type
-        put_bits(&pb, 8, venc->modes[i].mapping);
-    }
-
-    put_bits(&pb, 1, 1); // framing
-
-    flush_put_bits(&pb);
-    hlens[2] = put_bits_count(&pb) >> 3;
-
-    len = hlens[0] + hlens[1] + hlens[2];
-    p = *out = av_mallocz(64 + len + len/255);
-    if (!p)
-        return AVERROR(ENOMEM);
-
-    *p++ = 2;
-    p += av_xiphlacing(p, hlens[0]);
-    p += av_xiphlacing(p, hlens[1]);
-    buffer_len = 0;
-    for (i = 0; i < 3; i++) {
-        memcpy(p, buffer + buffer_len, hlens[i]);
-        p += hlens[i];
-        buffer_len += hlens[i];
-    }
-
-    return p - *out;
-}
-
-static float get_floor_average(vorbis_enc_floor * fc, float *coeffs, int i)
-{
-    int begin = fc->list[fc->list[FFMAX(i-1, 0)].sort].x;
-    int end   = fc->list[fc->list[FFMIN(i+1, fc->values - 1)].sort].x;
-    int j;
-    float average = 0;
-
-    for (j = begin; j < end; j++)
-        average += fabs(coeffs[j]);
-    return average / (end - begin);
-}
-
-static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc,
-                      float *coeffs, uint16_t *posts, int samples)
-{
-    int range = 255 / fc->multiplier + 1;
-    int i;
-    float tot_average = 0.0;
-    float averages[MAX_FLOOR_VALUES];
-    for (i = 0; i < fc->values; i++) {
-        averages[i] = get_floor_average(fc, coeffs, i);
-        tot_average += averages[i];
-    }
-    tot_average /= fc->values;
-    tot_average /= venc->quality;
-
-    for (i = 0; i < fc->values; i++) {
-        int position  = fc->list[fc->list[i].sort].x;
-        float average = averages[i];
-        int j;
-
-        average = sqrt(tot_average * average) * pow(1.25f, position*0.005f); // MAGIC!
-        for (j = 0; j < range - 1; j++)
-            if (ff_vorbis_floor1_inverse_db_table[j * fc->multiplier] > average)
-                break;
-        posts[fc->list[i].sort] = j;
-    }
-}
-
-static int render_point(int x0, int y0, int x1, int y1, int x)
-{
-    return y0 +  (x - x0) * (y1 - y0) / (x1 - x0);
-}
-
-static int floor_encode(vorbis_enc_context *venc, vorbis_enc_floor *fc,
-                        PutBitContext *pb, uint16_t *posts,
-                        float *floor, int samples)
-{
-    int range = 255 / fc->multiplier + 1;
-    int coded[MAX_FLOOR_VALUES]; // first 2 values are unused
-    int i, counter;
-
-    if (pb->size_in_bits - put_bits_count(pb) < 1 + 2 * ilog(range - 1))
-        return AVERROR(EINVAL);
-    put_bits(pb, 1, 1); // non zero
-    put_bits(pb, ilog(range - 1), posts[0]);
-    put_bits(pb, ilog(range - 1), posts[1]);
-    coded[0] = coded[1] = 1;
-
-    for (i = 2; i < fc->values; i++) {
-        int predicted = render_point(fc->list[fc->list[i].low].x,
-                                     posts[fc->list[i].low],
-                                     fc->list[fc->list[i].high].x,
-                                     posts[fc->list[i].high],
-                                     fc->list[i].x);
-        int highroom = range - predicted;
-        int lowroom = predicted;
-        int room = FFMIN(highroom, lowroom);
-        if (predicted == posts[i]) {
-            coded[i] = 0; // must be used later as flag!
-            continue;
-        } else {
-            if (!coded[fc->list[i].low ])
-                coded[fc->list[i].low ] = -1;
-            if (!coded[fc->list[i].high])
-                coded[fc->list[i].high] = -1;
-        }
-        if (posts[i] > predicted) {
-            if (posts[i] - predicted > room)
-                coded[i] = posts[i] - predicted + lowroom;
-            else
-                coded[i] = (posts[i] - predicted) << 1;
-        } else {
-            if (predicted - posts[i] > room)
-                coded[i] = predicted - posts[i] + highroom - 1;
-            else
-                coded[i] = ((predicted - posts[i]) << 1) - 1;
-        }
-    }
-
-    counter = 2;
-    for (i = 0; i < fc->partitions; i++) {
-        vorbis_enc_floor_class * c = &fc->classes[fc->partition_to_class[i]];
-        int k, cval = 0, csub = 1<<c->subclass;
-        if (c->subclass) {
-            vorbis_enc_codebook * book = &venc->codebooks[c->masterbook];
-            int cshift = 0;
-            for (k = 0; k < c->dim; k++) {
-                int l;
-                for (l = 0; l < csub; l++) {
-                    int maxval = 1;
-                    if (c->books[l] != -1)
-                        maxval = venc->codebooks[c->books[l]].nentries;
-                    // coded could be -1, but this still works, cause that is 0
-                    if (coded[counter + k] < maxval)
-                        break;
-                }
-                assert(l != csub);
-                cval   |= l << cshift;
-                cshift += c->subclass;
-            }
-            if (put_codeword(pb, book, cval))
-                return AVERROR(EINVAL);
-        }
-        for (k = 0; k < c->dim; k++) {
-            int book  = c->books[cval & (csub-1)];
-            int entry = coded[counter++];
-            cval >>= c->subclass;
-            if (book == -1)
-                continue;
-            if (entry == -1)
-                entry = 0;
-            if (put_codeword(pb, &venc->codebooks[book], entry))
-                return AVERROR(EINVAL);
-        }
-    }
-
-    ff_vorbis_floor1_render_list(fc->list, fc->values, posts, coded,
-                                 fc->multiplier, floor, samples);
-
-    return 0;
-}
-
-static float *put_vector(vorbis_enc_codebook *book, PutBitContext *pb,
-                         float *num)
-{
-    int i, entry = -1;
-    float distance = FLT_MAX;
-    assert(book->dimensions);
-    for (i = 0; i < book->nentries; i++) {
-        float * vec = book->dimensions + i * book->ndimensions, d = book->pow2[i];
-        int j;
-        if (!book->lens[i])
-            continue;
-        for (j = 0; j < book->ndimensions; j++)
-            d -= vec[j] * num[j];
-        if (distance > d) {
-            entry    = i;
-            distance = d;
-        }
-    }
-    if (put_codeword(pb, book, entry))
-        return NULL;
-    return &book->dimensions[entry * book->ndimensions];
-}
-
-static int residue_encode(vorbis_enc_context *venc, vorbis_enc_residue *rc,
-                          PutBitContext *pb, float *coeffs, int samples,
-                          int real_ch)
-{
-    int pass, i, j, p, k;
-    int psize      = rc->partition_size;
-    int partitions = (rc->end - rc->begin) / psize;
-    int channels   = (rc->type == 2) ? 1 : real_ch;
-    int classes[MAX_CHANNELS][NUM_RESIDUE_PARTITIONS];
-    int classwords = venc->codebooks[rc->classbook].ndimensions;
-
-    assert(rc->type == 2);
-    assert(real_ch == 2);
-    for (p = 0; p < partitions; p++) {
-        float max1 = 0.0, max2 = 0.0;
-        int s = rc->begin + p * psize;
-        for (k = s; k < s + psize; k += 2) {
-            max1 = FFMAX(max1, fabs(coeffs[          k / real_ch]));
-            max2 = FFMAX(max2, fabs(coeffs[samples + k / real_ch]));
-        }
-
-        for (i = 0; i < rc->classifications - 1; i++)
-            if (max1 < rc->maxes[i][0] && max2 < rc->maxes[i][1])
-                break;
-        classes[0][p] = i;
-    }
-
-    for (pass = 0; pass < 8; pass++) {
-        p = 0;
-        while (p < partitions) {
-            if (pass == 0)
-                for (j = 0; j < channels; j++) {
-                    vorbis_enc_codebook * book = &venc->codebooks[rc->classbook];
-                    int entry = 0;
-                    for (i = 0; i < classwords; i++) {
-                        entry *= rc->classifications;
-                        entry += classes[j][p + i];
-                    }
-                    if (put_codeword(pb, book, entry))
-                        return AVERROR(EINVAL);
-                }
-            for (i = 0; i < classwords && p < partitions; i++, p++) {
-                for (j = 0; j < channels; j++) {
-                    int nbook = rc->books[classes[j][p]][pass];
-                    vorbis_enc_codebook * book = &venc->codebooks[nbook];
-                    float *buf = coeffs + samples*j + rc->begin + p*psize;
-                    if (nbook == -1)
-                        continue;
-
-                    assert(rc->type == 0 || rc->type == 2);
-                    assert(!(psize % book->ndimensions));
-
-                    if (rc->type == 0) {
-                        for (k = 0; k < psize; k += book->ndimensions) {
-                            int l;
-                            float *a = put_vector(book, pb, &buf[k]);
-                            if (!a)
-                                return AVERROR(EINVAL);
-                            for (l = 0; l < book->ndimensions; l++)
-                                buf[k + l] -= a[l];
-                        }
-                    } else {
-                        int s = rc->begin + p * psize, a1, b1;
-                        a1 = (s % real_ch) * samples;
-                        b1 =  s / real_ch;
-                        s  = real_ch * samples;
-                        for (k = 0; k < psize; k += book->ndimensions) {
-                            int dim, a2 = a1, b2 = b1;
-                            float vec[MAX_CODEBOOK_DIM], *pv = vec;
-                            for (dim = book->ndimensions; dim--; ) {
-                                *pv++ = coeffs[a2 + b2];
-                                if ((a2 += samples) == s) {
-                                    a2 = 0;
-                                    b2++;
-                                }
-                            }
-                            pv = put_vector(book, pb, vec);
-                            if (!pv)
-                                return AVERROR(EINVAL);
-                            for (dim = book->ndimensions; dim--; ) {
-                                coeffs[a1 + b1] -= *pv++;
-                                if ((a1 += samples) == s) {
-                                    a1 = 0;
-                                    b1++;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-static int apply_window_and_mdct(vorbis_enc_context *venc,
-                                 float **audio, int samples)
-{
-    int i, channel;
-    const float * win = venc->win[0];
-    int window_len = 1 << (venc->log2_blocksize[0] - 1);
-    float n = (float)(1 << venc->log2_blocksize[0]) / 4.0;
-    // FIXME use dsp
-
-    if (!venc->have_saved && !samples)
-        return 0;
-
-    if (venc->have_saved) {
-        for (channel = 0; channel < venc->channels; channel++)
-            memcpy(venc->samples + channel * window_len * 2,
-                   venc->saved + channel * window_len, sizeof(float) * window_len);
-    } else {
-        for (channel = 0; channel < venc->channels; channel++)
-            memset(venc->samples + channel * window_len * 2, 0,
-                   sizeof(float) * window_len);
-    }
-
-    if (samples) {
-        for (channel = 0; channel < venc->channels; channel++) {
-            float * offset = venc->samples + channel*window_len*2 + window_len;
-            for (i = 0; i < samples; i++)
-                offset[i] = audio[channel][i] / n * win[window_len - i - 1];
-        }
-    } else {
-        for (channel = 0; channel < venc->channels; channel++)
-            memset(venc->samples + channel * window_len * 2 + window_len,
-                   0, sizeof(float) * window_len);
-    }
-
-    for (channel = 0; channel < venc->channels; channel++)
-        venc->mdct[0].mdct_calc(&venc->mdct[0], venc->coeffs + channel * window_len,
-                     venc->samples + channel * window_len * 2);
-
-    if (samples) {
-        for (channel = 0; channel < venc->channels; channel++) {
-            float *offset = venc->saved + channel * window_len;
-            for (i = 0; i < samples; i++)
-                offset[i] = audio[channel][i] / n * win[i];
-        }
-        venc->have_saved = 1;
-    } else {
-        venc->have_saved = 0;
-    }
-    return 1;
-}
-
-
-static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
-                               const AVFrame *frame, int *got_packet_ptr)
-{
-    vorbis_enc_context *venc = avctx->priv_data;
-    float **audio = frame ? (float **)frame->extended_data : NULL;
-    int samples = frame ? frame->nb_samples : 0;
-    vorbis_enc_mode *mode;
-    vorbis_enc_mapping *mapping;
-    PutBitContext pb;
-    int i, ret;
-
-    if (!apply_window_and_mdct(venc, audio, samples))
-        return 0;
-    samples = 1 << (venc->log2_blocksize[0] - 1);
-
-    if ((ret = ff_alloc_packet(avpkt, 8192))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-    init_put_bits(&pb, avpkt->data, avpkt->size);
-
-    if (pb.size_in_bits - put_bits_count(&pb) < 1 + ilog(venc->nmodes - 1)) {
-        av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n");
-        return AVERROR(EINVAL);
-    }
-
-    put_bits(&pb, 1, 0); // magic bit
-
-    put_bits(&pb, ilog(venc->nmodes - 1), 0); // 0 bits, the mode
-
-    mode    = &venc->modes[0];
-    mapping = &venc->mappings[mode->mapping];
-    if (mode->blockflag) {
-        put_bits(&pb, 1, 0);
-        put_bits(&pb, 1, 0);
-    }
-
-    for (i = 0; i < venc->channels; i++) {
-        vorbis_enc_floor *fc = &venc->floors[mapping->floor[mapping->mux[i]]];
-        uint16_t posts[MAX_FLOOR_VALUES];
-        floor_fit(venc, fc, &venc->coeffs[i * samples], posts, samples);
-        if (floor_encode(venc, fc, &pb, posts, &venc->floor[i * samples], samples)) {
-            av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n");
-            return AVERROR(EINVAL);
-        }
-    }
-
-    for (i = 0; i < venc->channels * samples; i++)
-        venc->coeffs[i] /= venc->floor[i];
-
-    for (i = 0; i < mapping->coupling_steps; i++) {
-        float *mag = venc->coeffs + mapping->magnitude[i] * samples;
-        float *ang = venc->coeffs + mapping->angle[i]     * samples;
-        int j;
-        for (j = 0; j < samples; j++) {
-            float a = ang[j];
-            ang[j] -= mag[j];
-            if (mag[j] > 0)
-                ang[j] = -ang[j];
-            if (ang[j] < 0)
-                mag[j] = a;
-        }
-    }
-
-    if (residue_encode(venc, &venc->residues[mapping->residue[mapping->mux[0]]],
-                       &pb, venc->coeffs, samples, venc->channels)) {
-        av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n");
-        return AVERROR(EINVAL);
-    }
-
-    flush_put_bits(&pb);
-    avpkt->size = put_bits_count(&pb) >> 3;
-
-    avpkt->duration = ff_samples_to_time_base(avctx, avctx->frame_size);
-    if (frame)
-        if (frame->pts != AV_NOPTS_VALUE)
-            avpkt->pts = ff_samples_to_time_base(avctx, frame->pts);
-    else
-        avpkt->pts = venc->next_pts;
-    if (avpkt->pts != AV_NOPTS_VALUE)
-        venc->next_pts = avpkt->pts + avpkt->duration;
-
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-
-static av_cold int vorbis_encode_close(AVCodecContext *avctx)
-{
-    vorbis_enc_context *venc = avctx->priv_data;
-    int i;
-
-    if (venc->codebooks)
-        for (i = 0; i < venc->ncodebooks; i++) {
-            av_freep(&venc->codebooks[i].lens);
-            av_freep(&venc->codebooks[i].codewords);
-            av_freep(&venc->codebooks[i].quantlist);
-            av_freep(&venc->codebooks[i].dimensions);
-            av_freep(&venc->codebooks[i].pow2);
-        }
-    av_freep(&venc->codebooks);
-
-    if (venc->floors)
-        for (i = 0; i < venc->nfloors; i++) {
-            int j;
-            if (venc->floors[i].classes)
-                for (j = 0; j < venc->floors[i].nclasses; j++)
-                    av_freep(&venc->floors[i].classes[j].books);
-            av_freep(&venc->floors[i].classes);
-            av_freep(&venc->floors[i].partition_to_class);
-            av_freep(&venc->floors[i].list);
-        }
-    av_freep(&venc->floors);
-
-    if (venc->residues)
-        for (i = 0; i < venc->nresidues; i++) {
-            av_freep(&venc->residues[i].books);
-            av_freep(&venc->residues[i].maxes);
-        }
-    av_freep(&venc->residues);
-
-    if (venc->mappings)
-        for (i = 0; i < venc->nmappings; i++) {
-            av_freep(&venc->mappings[i].mux);
-            av_freep(&venc->mappings[i].floor);
-            av_freep(&venc->mappings[i].residue);
-            av_freep(&venc->mappings[i].magnitude);
-            av_freep(&venc->mappings[i].angle);
-        }
-    av_freep(&venc->mappings);
-
-    av_freep(&venc->modes);
-
-    av_freep(&venc->saved);
-    av_freep(&venc->samples);
-    av_freep(&venc->floor);
-    av_freep(&venc->coeffs);
-
-    ff_mdct_end(&venc->mdct[0]);
-    ff_mdct_end(&venc->mdct[1]);
-
-    av_freep(&avctx->extradata);
-
-    return 0 ;
-}
-
-static av_cold int vorbis_encode_init(AVCodecContext *avctx)
-{
-    vorbis_enc_context *venc = avctx->priv_data;
-    int ret;
-
-    if (avctx->channels != 2) {
-        av_log(avctx, AV_LOG_ERROR, "Current Libav Vorbis encoder only supports 2 channels.\n");
-        return -1;
-    }
-
-    if ((ret = create_vorbis_context(venc, avctx)) < 0)
-        goto error;
-
-    avctx->bit_rate = 0;
-    if (avctx->flags & CODEC_FLAG_QSCALE)
-        venc->quality = avctx->global_quality / (float)FF_QP2LAMBDA;
-    else
-        venc->quality = 3.0;
-    venc->quality *= venc->quality;
-
-    if ((ret = put_main_header(venc, (uint8_t**)&avctx->extradata)) < 0)
-        goto error;
-    avctx->extradata_size = ret;
-
-    avctx->frame_size = 1 << (venc->log2_blocksize[0] - 1);
-
-    return 0;
-error:
-    vorbis_encode_close(avctx);
-    return ret;
-}
-
-AVCodec ff_vorbis_encoder = {
-    .name           = "vorbis",
-    .long_name      = NULL_IF_CONFIG_SMALL("Vorbis"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_VORBIS,
-    .priv_data_size = sizeof(vorbis_enc_context),
-    .init           = vorbis_encode_init,
-    .encode2        = vorbis_encode_frame,
-    .close          = vorbis_encode_close,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/vp3.c b/deps/libav/libavcodec/vp3.c
deleted file mode 100644
index adcecbc..0000000
--- a/deps/libav/libavcodec/vp3.c
+++ /dev/null
@@ -1,2458 +0,0 @@
-/*
- * Copyright (C) 2003-2004 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * On2 VP3 Video Decoder
- *
- * VP3 Video Decoder by Mike Melanson (mike at multimedia.cx)
- * For more information about the VP3 coding process, visit:
- *   http://wiki.multimedia.cx/index.php?title=On2_VP3
- *
- * Theora decoder by Alex Beregszaszi
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "dsputil.h"
-#include "get_bits.h"
-#include "hpeldsp.h"
-#include "videodsp.h"
-#include "vp3data.h"
-#include "vp3dsp.h"
-#include "xiph.h"
-#include "thread.h"
-
-#define FRAGMENT_PIXELS 8
-
-//FIXME split things out into their own arrays
-typedef struct Vp3Fragment {
-    int16_t dc;
-    uint8_t coding_method;
-    uint8_t qpi;
-} Vp3Fragment;
-
-#define SB_NOT_CODED        0
-#define SB_PARTIALLY_CODED  1
-#define SB_FULLY_CODED      2
-
-// This is the maximum length of a single long bit run that can be encoded
-// for superblock coding or block qps. Theora special-cases this to read a
-// bit instead of flipping the current bit to allow for runs longer than 4129.
-#define MAXIMUM_LONG_BIT_RUN 4129
-
-#define MODE_INTER_NO_MV      0
-#define MODE_INTRA            1
-#define MODE_INTER_PLUS_MV    2
-#define MODE_INTER_LAST_MV    3
-#define MODE_INTER_PRIOR_LAST 4
-#define MODE_USING_GOLDEN     5
-#define MODE_GOLDEN_MV        6
-#define MODE_INTER_FOURMV     7
-#define CODING_MODE_COUNT     8
-
-/* special internal mode */
-#define MODE_COPY             8
-
-/* There are 6 preset schemes, plus a free-form scheme */
-static const int ModeAlphabet[6][CODING_MODE_COUNT] =
-{
-    /* scheme 1: Last motion vector dominates */
-    {    MODE_INTER_LAST_MV,    MODE_INTER_PRIOR_LAST,
-         MODE_INTER_PLUS_MV,    MODE_INTER_NO_MV,
-         MODE_INTRA,            MODE_USING_GOLDEN,
-         MODE_GOLDEN_MV,        MODE_INTER_FOURMV },
-
-    /* scheme 2 */
-    {    MODE_INTER_LAST_MV,    MODE_INTER_PRIOR_LAST,
-         MODE_INTER_NO_MV,      MODE_INTER_PLUS_MV,
-         MODE_INTRA,            MODE_USING_GOLDEN,
-         MODE_GOLDEN_MV,        MODE_INTER_FOURMV },
-
-    /* scheme 3 */
-    {    MODE_INTER_LAST_MV,    MODE_INTER_PLUS_MV,
-         MODE_INTER_PRIOR_LAST, MODE_INTER_NO_MV,
-         MODE_INTRA,            MODE_USING_GOLDEN,
-         MODE_GOLDEN_MV,        MODE_INTER_FOURMV },
-
-    /* scheme 4 */
-    {    MODE_INTER_LAST_MV,    MODE_INTER_PLUS_MV,
-         MODE_INTER_NO_MV,      MODE_INTER_PRIOR_LAST,
-         MODE_INTRA,            MODE_USING_GOLDEN,
-         MODE_GOLDEN_MV,        MODE_INTER_FOURMV },
-
-    /* scheme 5: No motion vector dominates */
-    {    MODE_INTER_NO_MV,      MODE_INTER_LAST_MV,
-         MODE_INTER_PRIOR_LAST, MODE_INTER_PLUS_MV,
-         MODE_INTRA,            MODE_USING_GOLDEN,
-         MODE_GOLDEN_MV,        MODE_INTER_FOURMV },
-
-    /* scheme 6 */
-    {    MODE_INTER_NO_MV,      MODE_USING_GOLDEN,
-         MODE_INTER_LAST_MV,    MODE_INTER_PRIOR_LAST,
-         MODE_INTER_PLUS_MV,    MODE_INTRA,
-         MODE_GOLDEN_MV,        MODE_INTER_FOURMV },
-
-};
-
-static const uint8_t hilbert_offset[16][2] = {
-    {0,0}, {1,0}, {1,1}, {0,1},
-    {0,2}, {0,3}, {1,3}, {1,2},
-    {2,2}, {2,3}, {3,3}, {3,2},
-    {3,1}, {2,1}, {2,0}, {3,0}
-};
-
-#define MIN_DEQUANT_VAL 2
-
-typedef struct Vp3DecodeContext {
-    AVCodecContext *avctx;
-    int theora, theora_tables;
-    int version;
-    int width, height;
-    int chroma_x_shift, chroma_y_shift;
-    ThreadFrame golden_frame;
-    ThreadFrame last_frame;
-    ThreadFrame current_frame;
-    int keyframe;
-    uint8_t idct_permutation[64];
-    uint8_t idct_scantable[64];
-    HpelDSPContext hdsp;
-    VideoDSPContext vdsp;
-    VP3DSPContext vp3dsp;
-    DECLARE_ALIGNED(16, int16_t, block)[64];
-    int flipped_image;
-    int last_slice_end;
-    int skip_loop_filter;
-
-    int qps[3];
-    int nqps;
-    int last_qps[3];
-
-    int superblock_count;
-    int y_superblock_width;
-    int y_superblock_height;
-    int y_superblock_count;
-    int c_superblock_width;
-    int c_superblock_height;
-    int c_superblock_count;
-    int u_superblock_start;
-    int v_superblock_start;
-    unsigned char *superblock_coding;
-
-    int macroblock_count;
-    int macroblock_width;
-    int macroblock_height;
-
-    int fragment_count;
-    int fragment_width[2];
-    int fragment_height[2];
-
-    Vp3Fragment *all_fragments;
-    int fragment_start[3];
-    int data_offset[3];
-
-    int8_t (*motion_val[2])[2];
-
-    /* tables */
-    uint16_t coded_dc_scale_factor[64];
-    uint32_t coded_ac_scale_factor[64];
-    uint8_t base_matrix[384][64];
-    uint8_t qr_count[2][3];
-    uint8_t qr_size [2][3][64];
-    uint16_t qr_base[2][3][64];
-
-    /**
-     * This is a list of all tokens in bitstream order. Reordering takes place
-     * by pulling from each level during IDCT. As a consequence, IDCT must be
-     * in Hilbert order, making the minimum slice height 64 for 4:2:0 and 32
-     * otherwise. The 32 different tokens with up to 12 bits of extradata are
-     * collapsed into 3 types, packed as follows:
-     *   (from the low to high bits)
-     *
-     * 2 bits: type (0,1,2)
-     *   0: EOB run, 14 bits for run length (12 needed)
-     *   1: zero run, 7 bits for run length
-     *                7 bits for the next coefficient (3 needed)
-     *   2: coefficient, 14 bits (11 needed)
-     *
-     * Coefficients are signed, so are packed in the highest bits for automatic
-     * sign extension.
-     */
-    int16_t *dct_tokens[3][64];
-    int16_t *dct_tokens_base;
-#define TOKEN_EOB(eob_run)              ((eob_run) << 2)
-#define TOKEN_ZERO_RUN(coeff, zero_run) (((coeff) << 9) + ((zero_run) << 2) + 1)
-#define TOKEN_COEFF(coeff)              (((coeff) << 2) + 2)
-
-    /**
-     * number of blocks that contain DCT coefficients at the given level or higher
-     */
-    int num_coded_frags[3][64];
-    int total_num_coded_frags;
-
-    /* this is a list of indexes into the all_fragments array indicating
-     * which of the fragments are coded */
-    int *coded_fragment_list[3];
-
-    VLC dc_vlc[16];
-    VLC ac_vlc_1[16];
-    VLC ac_vlc_2[16];
-    VLC ac_vlc_3[16];
-    VLC ac_vlc_4[16];
-
-    VLC superblock_run_length_vlc;
-    VLC fragment_run_length_vlc;
-    VLC mode_code_vlc;
-    VLC motion_vector_vlc;
-
-    /* these arrays need to be on 16-byte boundaries since SSE2 operations
-     * index into them */
-    DECLARE_ALIGNED(16, int16_t, qmat)[3][2][3][64];     ///< qmat[qpi][is_inter][plane]
-
-    /* This table contains superblock_count * 16 entries. Each set of 16
-     * numbers corresponds to the fragment indexes 0..15 of the superblock.
-     * An entry will be -1 to indicate that no entry corresponds to that
-     * index. */
-    int *superblock_fragments;
-
-    /* This is an array that indicates how a particular macroblock
-     * is coded. */
-    unsigned char *macroblock_coding;
-
-    uint8_t *edge_emu_buffer;
-
-    /* Huffman decode */
-    int hti;
-    unsigned int hbits;
-    int entries;
-    int huff_code_size;
-    uint32_t huffman_table[80][32][2];
-
-    uint8_t filter_limit_values[64];
-    DECLARE_ALIGNED(8, int, bounding_values_array)[256+2];
-} Vp3DecodeContext;
-
-/************************************************************************
- * VP3 specific functions
- ************************************************************************/
-
-static void vp3_decode_flush(AVCodecContext *avctx)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-
-    if (s->golden_frame.f)
-        ff_thread_release_buffer(avctx, &s->golden_frame);
-    if (s->last_frame.f)
-        ff_thread_release_buffer(avctx, &s->last_frame);
-    if (s->current_frame.f)
-        ff_thread_release_buffer(avctx, &s->current_frame);
-}
-
-static av_cold int vp3_decode_end(AVCodecContext *avctx)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-    int i;
-
-    av_freep(&s->superblock_coding);
-    av_freep(&s->all_fragments);
-    av_freep(&s->coded_fragment_list[0]);
-    av_freep(&s->dct_tokens_base);
-    av_freep(&s->superblock_fragments);
-    av_freep(&s->macroblock_coding);
-    av_freep(&s->motion_val[0]);
-    av_freep(&s->motion_val[1]);
-    av_freep(&s->edge_emu_buffer);
-
-    /* release all frames */
-    vp3_decode_flush(avctx);
-    av_frame_free(&s->current_frame.f);
-    av_frame_free(&s->last_frame.f);
-    av_frame_free(&s->golden_frame.f);
-
-    if (avctx->internal->is_copy)
-        return 0;
-
-    for (i = 0; i < 16; i++) {
-        ff_free_vlc(&s->dc_vlc[i]);
-        ff_free_vlc(&s->ac_vlc_1[i]);
-        ff_free_vlc(&s->ac_vlc_2[i]);
-        ff_free_vlc(&s->ac_vlc_3[i]);
-        ff_free_vlc(&s->ac_vlc_4[i]);
-    }
-
-    ff_free_vlc(&s->superblock_run_length_vlc);
-    ff_free_vlc(&s->fragment_run_length_vlc);
-    ff_free_vlc(&s->mode_code_vlc);
-    ff_free_vlc(&s->motion_vector_vlc);
-
-
-    return 0;
-}
-
-/*
- * This function sets up all of the various blocks mappings:
- * superblocks <-> fragments, macroblocks <-> fragments,
- * superblocks <-> macroblocks
- *
- * @return 0 is successful; returns 1 if *anything* went wrong.
- */
-static int init_block_mapping(Vp3DecodeContext *s)
-{
-    int sb_x, sb_y, plane;
-    int x, y, i, j = 0;
-
-    for (plane = 0; plane < 3; plane++) {
-        int sb_width    = plane ? s->c_superblock_width  : s->y_superblock_width;
-        int sb_height   = plane ? s->c_superblock_height : s->y_superblock_height;
-        int frag_width  = s->fragment_width[!!plane];
-        int frag_height = s->fragment_height[!!plane];
-
-        for (sb_y = 0; sb_y < sb_height; sb_y++)
-            for (sb_x = 0; sb_x < sb_width; sb_x++)
-                for (i = 0; i < 16; i++) {
-                    x = 4*sb_x + hilbert_offset[i][0];
-                    y = 4*sb_y + hilbert_offset[i][1];
-
-                    if (x < frag_width && y < frag_height)
-                        s->superblock_fragments[j++] = s->fragment_start[plane] + y*frag_width + x;
-                    else
-                        s->superblock_fragments[j++] = -1;
-                }
-    }
-
-    return 0;  /* successful path out */
-}
-
-/*
- * This function sets up the dequantization tables used for a particular
- * frame.
- */
-static void init_dequantizer(Vp3DecodeContext *s, int qpi)
-{
-    int ac_scale_factor = s->coded_ac_scale_factor[s->qps[qpi]];
-    int dc_scale_factor = s->coded_dc_scale_factor[s->qps[qpi]];
-    int i, plane, inter, qri, bmi, bmj, qistart;
-
-    for(inter=0; inter<2; inter++){
-        for(plane=0; plane<3; plane++){
-            int sum=0;
-            for(qri=0; qri<s->qr_count[inter][plane]; qri++){
-                sum+= s->qr_size[inter][plane][qri];
-                if(s->qps[qpi] <= sum)
-                    break;
-            }
-            qistart= sum - s->qr_size[inter][plane][qri];
-            bmi= s->qr_base[inter][plane][qri  ];
-            bmj= s->qr_base[inter][plane][qri+1];
-            for(i=0; i<64; i++){
-                int coeff= (  2*(sum    -s->qps[qpi])*s->base_matrix[bmi][i]
-                            - 2*(qistart-s->qps[qpi])*s->base_matrix[bmj][i]
-                            + s->qr_size[inter][plane][qri])
-                           / (2*s->qr_size[inter][plane][qri]);
-
-                int qmin= 8<<(inter + !i);
-                int qscale= i ? ac_scale_factor : dc_scale_factor;
-
-                s->qmat[qpi][inter][plane][s->idct_permutation[i]] =
-                    av_clip((qscale * coeff) / 100 * 4, qmin, 4096);
-            }
-            // all DC coefficients use the same quant so as not to interfere with DC prediction
-            s->qmat[qpi][inter][plane][0] = s->qmat[0][inter][plane][0];
-        }
-    }
-}
-
-/*
- * This function initializes the loop filter boundary limits if the frame's
- * quality index is different from the previous frame's.
- *
- * The filter_limit_values may not be larger than 127.
- */
-static void init_loop_filter(Vp3DecodeContext *s)
-{
-    int *bounding_values= s->bounding_values_array+127;
-    int filter_limit;
-    int x;
-    int value;
-
-    filter_limit = s->filter_limit_values[s->qps[0]];
-    assert(filter_limit < 128);
-
-    /* set up the bounding values */
-    memset(s->bounding_values_array, 0, 256 * sizeof(int));
-    for (x = 0; x < filter_limit; x++) {
-        bounding_values[-x] = -x;
-        bounding_values[x] = x;
-    }
-    for (x = value = filter_limit; x < 128 && value; x++, value--) {
-        bounding_values[ x] =  value;
-        bounding_values[-x] = -value;
-    }
-    if (value)
-        bounding_values[128] = value;
-    bounding_values[129] = bounding_values[130] = filter_limit * 0x02020202;
-}
-
-/*
- * This function unpacks all of the superblock/macroblock/fragment coding
- * information from the bitstream.
- */
-static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
-{
-    int superblock_starts[3] = { 0, s->u_superblock_start, s->v_superblock_start };
-    int bit = 0;
-    int current_superblock = 0;
-    int current_run = 0;
-    int num_partial_superblocks = 0;
-
-    int i, j;
-    int current_fragment;
-    int plane;
-
-    if (s->keyframe) {
-        memset(s->superblock_coding, SB_FULLY_CODED, s->superblock_count);
-
-    } else {
-
-        /* unpack the list of partially-coded superblocks */
-        bit = get_bits1(gb) ^ 1;
-        current_run = 0;
-
-        while (current_superblock < s->superblock_count && get_bits_left(gb) > 0) {
-            if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
-                bit = get_bits1(gb);
-            else
-                bit ^= 1;
-
-                current_run = get_vlc2(gb,
-                    s->superblock_run_length_vlc.table, 6, 2) + 1;
-                if (current_run == 34)
-                    current_run += get_bits(gb, 12);
-
-            if (current_superblock + current_run > s->superblock_count) {
-                av_log(s->avctx, AV_LOG_ERROR, "Invalid partially coded superblock run length\n");
-                return -1;
-            }
-
-            memset(s->superblock_coding + current_superblock, bit, current_run);
-
-            current_superblock += current_run;
-            if (bit)
-                num_partial_superblocks += current_run;
-        }
-
-        /* unpack the list of fully coded superblocks if any of the blocks were
-         * not marked as partially coded in the previous step */
-        if (num_partial_superblocks < s->superblock_count) {
-            int superblocks_decoded = 0;
-
-            current_superblock = 0;
-            bit = get_bits1(gb) ^ 1;
-            current_run = 0;
-
-            while (superblocks_decoded < s->superblock_count - num_partial_superblocks
-                   && get_bits_left(gb) > 0) {
-
-                if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
-                    bit = get_bits1(gb);
-                else
-                    bit ^= 1;
-
-                        current_run = get_vlc2(gb,
-                            s->superblock_run_length_vlc.table, 6, 2) + 1;
-                        if (current_run == 34)
-                            current_run += get_bits(gb, 12);
-
-                for (j = 0; j < current_run; current_superblock++) {
-                    if (current_superblock >= s->superblock_count) {
-                        av_log(s->avctx, AV_LOG_ERROR, "Invalid fully coded superblock run length\n");
-                        return -1;
-                    }
-
-                /* skip any superblocks already marked as partially coded */
-                if (s->superblock_coding[current_superblock] == SB_NOT_CODED) {
-                    s->superblock_coding[current_superblock] = 2*bit;
-                    j++;
-                }
-                }
-                superblocks_decoded += current_run;
-            }
-        }
-
-        /* if there were partial blocks, initialize bitstream for
-         * unpacking fragment codings */
-        if (num_partial_superblocks) {
-
-            current_run = 0;
-            bit = get_bits1(gb);
-            /* toggle the bit because as soon as the first run length is
-             * fetched the bit will be toggled again */
-            bit ^= 1;
-        }
-    }
-
-    /* figure out which fragments are coded; iterate through each
-     * superblock (all planes) */
-    s->total_num_coded_frags = 0;
-    memset(s->macroblock_coding, MODE_COPY, s->macroblock_count);
-
-    for (plane = 0; plane < 3; plane++) {
-        int sb_start = superblock_starts[plane];
-        int sb_end = sb_start + (plane ? s->c_superblock_count : s->y_superblock_count);
-        int num_coded_frags = 0;
-
-    for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) {
-
-        /* iterate through all 16 fragments in a superblock */
-        for (j = 0; j < 16; j++) {
-
-            /* if the fragment is in bounds, check its coding status */
-            current_fragment = s->superblock_fragments[i * 16 + j];
-            if (current_fragment != -1) {
-                int coded = s->superblock_coding[i];
-
-                if (s->superblock_coding[i] == SB_PARTIALLY_CODED) {
-
-                    /* fragment may or may not be coded; this is the case
-                     * that cares about the fragment coding runs */
-                    if (current_run-- == 0) {
-                        bit ^= 1;
-                        current_run = get_vlc2(gb,
-                            s->fragment_run_length_vlc.table, 5, 2);
-                    }
-                    coded = bit;
-                }
-
-                    if (coded) {
-                        /* default mode; actual mode will be decoded in
-                         * the next phase */
-                        s->all_fragments[current_fragment].coding_method =
-                            MODE_INTER_NO_MV;
-                        s->coded_fragment_list[plane][num_coded_frags++] =
-                            current_fragment;
-                    } else {
-                        /* not coded; copy this fragment from the prior frame */
-                        s->all_fragments[current_fragment].coding_method =
-                            MODE_COPY;
-                    }
-            }
-        }
-    }
-        s->total_num_coded_frags += num_coded_frags;
-        for (i = 0; i < 64; i++)
-            s->num_coded_frags[plane][i] = num_coded_frags;
-        if (plane < 2)
-            s->coded_fragment_list[plane+1] = s->coded_fragment_list[plane] + num_coded_frags;
-    }
-    return 0;
-}
-
-/*
- * This function unpacks all the coding mode data for individual macroblocks
- * from the bitstream.
- */
-static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb)
-{
-    int i, j, k, sb_x, sb_y;
-    int scheme;
-    int current_macroblock;
-    int current_fragment;
-    int coding_mode;
-    int custom_mode_alphabet[CODING_MODE_COUNT];
-    const int *alphabet;
-    Vp3Fragment *frag;
-
-    if (s->keyframe) {
-        for (i = 0; i < s->fragment_count; i++)
-            s->all_fragments[i].coding_method = MODE_INTRA;
-
-    } else {
-
-        /* fetch the mode coding scheme for this frame */
-        scheme = get_bits(gb, 3);
-
-        /* is it a custom coding scheme? */
-        if (scheme == 0) {
-            for (i = 0; i < 8; i++)
-                custom_mode_alphabet[i] = MODE_INTER_NO_MV;
-            for (i = 0; i < 8; i++)
-                custom_mode_alphabet[get_bits(gb, 3)] = i;
-            alphabet = custom_mode_alphabet;
-        } else
-            alphabet = ModeAlphabet[scheme-1];
-
-        /* iterate through all of the macroblocks that contain 1 or more
-         * coded fragments */
-        for (sb_y = 0; sb_y < s->y_superblock_height; sb_y++) {
-            for (sb_x = 0; sb_x < s->y_superblock_width; sb_x++) {
-                if (get_bits_left(gb) <= 0)
-                    return -1;
-
-            for (j = 0; j < 4; j++) {
-                int mb_x = 2*sb_x +   (j>>1);
-                int mb_y = 2*sb_y + (((j>>1)+j)&1);
-                current_macroblock = mb_y * s->macroblock_width + mb_x;
-
-                if (mb_x >= s->macroblock_width || mb_y >= s->macroblock_height)
-                    continue;
-
-#define BLOCK_X (2*mb_x + (k&1))
-#define BLOCK_Y (2*mb_y + (k>>1))
-                /* coding modes are only stored if the macroblock has at least one
-                 * luma block coded, otherwise it must be INTER_NO_MV */
-                for (k = 0; k < 4; k++) {
-                    current_fragment = BLOCK_Y*s->fragment_width[0] + BLOCK_X;
-                    if (s->all_fragments[current_fragment].coding_method != MODE_COPY)
-                        break;
-                }
-                if (k == 4) {
-                    s->macroblock_coding[current_macroblock] = MODE_INTER_NO_MV;
-                    continue;
-                }
-
-                /* mode 7 means get 3 bits for each coding mode */
-                if (scheme == 7)
-                    coding_mode = get_bits(gb, 3);
-                else
-                    coding_mode = alphabet
-                        [get_vlc2(gb, s->mode_code_vlc.table, 3, 3)];
-
-                s->macroblock_coding[current_macroblock] = coding_mode;
-                for (k = 0; k < 4; k++) {
-                    frag = s->all_fragments + BLOCK_Y*s->fragment_width[0] + BLOCK_X;
-                    if (frag->coding_method != MODE_COPY)
-                        frag->coding_method = coding_mode;
-                }
-
-#define SET_CHROMA_MODES \
-    if (frag[s->fragment_start[1]].coding_method != MODE_COPY) \
-        frag[s->fragment_start[1]].coding_method = coding_mode;\
-    if (frag[s->fragment_start[2]].coding_method != MODE_COPY) \
-        frag[s->fragment_start[2]].coding_method = coding_mode;
-
-                if (s->chroma_y_shift) {
-                    frag = s->all_fragments + mb_y*s->fragment_width[1] + mb_x;
-                    SET_CHROMA_MODES
-                } else if (s->chroma_x_shift) {
-                    frag = s->all_fragments + 2*mb_y*s->fragment_width[1] + mb_x;
-                    for (k = 0; k < 2; k++) {
-                        SET_CHROMA_MODES
-                        frag += s->fragment_width[1];
-                    }
-                } else {
-                    for (k = 0; k < 4; k++) {
-                        frag = s->all_fragments + BLOCK_Y*s->fragment_width[1] + BLOCK_X;
-                        SET_CHROMA_MODES
-                    }
-                }
-            }
-            }
-        }
-    }
-
-    return 0;
-}
-
-/*
- * This function unpacks all the motion vectors for the individual
- * macroblocks from the bitstream.
- */
-static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
-{
-    int j, k, sb_x, sb_y;
-    int coding_mode;
-    int motion_x[4];
-    int motion_y[4];
-    int last_motion_x = 0;
-    int last_motion_y = 0;
-    int prior_last_motion_x = 0;
-    int prior_last_motion_y = 0;
-    int current_macroblock;
-    int current_fragment;
-    int frag;
-
-    if (s->keyframe)
-        return 0;
-
-    /* coding mode 0 is the VLC scheme; 1 is the fixed code scheme */
-    coding_mode = get_bits1(gb);
-
-    /* iterate through all of the macroblocks that contain 1 or more
-     * coded fragments */
-    for (sb_y = 0; sb_y < s->y_superblock_height; sb_y++) {
-        for (sb_x = 0; sb_x < s->y_superblock_width; sb_x++) {
-            if (get_bits_left(gb) <= 0)
-                return -1;
-
-        for (j = 0; j < 4; j++) {
-            int mb_x = 2*sb_x +   (j>>1);
-            int mb_y = 2*sb_y + (((j>>1)+j)&1);
-            current_macroblock = mb_y * s->macroblock_width + mb_x;
-
-            if (mb_x >= s->macroblock_width || mb_y >= s->macroblock_height ||
-                (s->macroblock_coding[current_macroblock] == MODE_COPY))
-                continue;
-
-            switch (s->macroblock_coding[current_macroblock]) {
-
-            case MODE_INTER_PLUS_MV:
-            case MODE_GOLDEN_MV:
-                /* all 6 fragments use the same motion vector */
-                if (coding_mode == 0) {
-                    motion_x[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
-                    motion_y[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
-                } else {
-                    motion_x[0] = fixed_motion_vector_table[get_bits(gb, 6)];
-                    motion_y[0] = fixed_motion_vector_table[get_bits(gb, 6)];
-                }
-
-                /* vector maintenance, only on MODE_INTER_PLUS_MV */
-                if (s->macroblock_coding[current_macroblock] ==
-                    MODE_INTER_PLUS_MV) {
-                    prior_last_motion_x = last_motion_x;
-                    prior_last_motion_y = last_motion_y;
-                    last_motion_x = motion_x[0];
-                    last_motion_y = motion_y[0];
-                }
-                break;
-
-            case MODE_INTER_FOURMV:
-                /* vector maintenance */
-                prior_last_motion_x = last_motion_x;
-                prior_last_motion_y = last_motion_y;
-
-                /* fetch 4 vectors from the bitstream, one for each
-                 * Y fragment, then average for the C fragment vectors */
-                for (k = 0; k < 4; k++) {
-                    current_fragment = BLOCK_Y*s->fragment_width[0] + BLOCK_X;
-                    if (s->all_fragments[current_fragment].coding_method != MODE_COPY) {
-                        if (coding_mode == 0) {
-                            motion_x[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
-                            motion_y[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
-                        } else {
-                            motion_x[k] = fixed_motion_vector_table[get_bits(gb, 6)];
-                            motion_y[k] = fixed_motion_vector_table[get_bits(gb, 6)];
-                        }
-                        last_motion_x = motion_x[k];
-                        last_motion_y = motion_y[k];
-                    } else {
-                        motion_x[k] = 0;
-                        motion_y[k] = 0;
-                    }
-                }
-                break;
-
-            case MODE_INTER_LAST_MV:
-                /* all 6 fragments use the last motion vector */
-                motion_x[0] = last_motion_x;
-                motion_y[0] = last_motion_y;
-
-                /* no vector maintenance (last vector remains the
-                 * last vector) */
-                break;
-
-            case MODE_INTER_PRIOR_LAST:
-                /* all 6 fragments use the motion vector prior to the
-                 * last motion vector */
-                motion_x[0] = prior_last_motion_x;
-                motion_y[0] = prior_last_motion_y;
-
-                /* vector maintenance */
-                prior_last_motion_x = last_motion_x;
-                prior_last_motion_y = last_motion_y;
-                last_motion_x = motion_x[0];
-                last_motion_y = motion_y[0];
-                break;
-
-            default:
-                /* covers intra, inter without MV, golden without MV */
-                motion_x[0] = 0;
-                motion_y[0] = 0;
-
-                /* no vector maintenance */
-                break;
-            }
-
-            /* assign the motion vectors to the correct fragments */
-            for (k = 0; k < 4; k++) {
-                current_fragment =
-                    BLOCK_Y*s->fragment_width[0] + BLOCK_X;
-                if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
-                    s->motion_val[0][current_fragment][0] = motion_x[k];
-                    s->motion_val[0][current_fragment][1] = motion_y[k];
-                } else {
-                    s->motion_val[0][current_fragment][0] = motion_x[0];
-                    s->motion_val[0][current_fragment][1] = motion_y[0];
-                }
-            }
-
-            if (s->chroma_y_shift) {
-                if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
-                    motion_x[0] = RSHIFT(motion_x[0] + motion_x[1] + motion_x[2] + motion_x[3], 2);
-                    motion_y[0] = RSHIFT(motion_y[0] + motion_y[1] + motion_y[2] + motion_y[3], 2);
-                }
-                motion_x[0] = (motion_x[0]>>1) | (motion_x[0]&1);
-                motion_y[0] = (motion_y[0]>>1) | (motion_y[0]&1);
-                frag = mb_y*s->fragment_width[1] + mb_x;
-                s->motion_val[1][frag][0] = motion_x[0];
-                s->motion_val[1][frag][1] = motion_y[0];
-            } else if (s->chroma_x_shift) {
-                if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
-                    motion_x[0] = RSHIFT(motion_x[0] + motion_x[1], 1);
-                    motion_y[0] = RSHIFT(motion_y[0] + motion_y[1], 1);
-                    motion_x[1] = RSHIFT(motion_x[2] + motion_x[3], 1);
-                    motion_y[1] = RSHIFT(motion_y[2] + motion_y[3], 1);
-                } else {
-                    motion_x[1] = motion_x[0];
-                    motion_y[1] = motion_y[0];
-                }
-                motion_x[0] = (motion_x[0]>>1) | (motion_x[0]&1);
-                motion_x[1] = (motion_x[1]>>1) | (motion_x[1]&1);
-
-                frag = 2*mb_y*s->fragment_width[1] + mb_x;
-                for (k = 0; k < 2; k++) {
-                    s->motion_val[1][frag][0] = motion_x[k];
-                    s->motion_val[1][frag][1] = motion_y[k];
-                    frag += s->fragment_width[1];
-                }
-            } else {
-                for (k = 0; k < 4; k++) {
-                    frag = BLOCK_Y*s->fragment_width[1] + BLOCK_X;
-                    if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) {
-                        s->motion_val[1][frag][0] = motion_x[k];
-                        s->motion_val[1][frag][1] = motion_y[k];
-                    } else {
-                        s->motion_val[1][frag][0] = motion_x[0];
-                        s->motion_val[1][frag][1] = motion_y[0];
-                    }
-                }
-            }
-        }
-        }
-    }
-
-    return 0;
-}
-
-static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb)
-{
-    int qpi, i, j, bit, run_length, blocks_decoded, num_blocks_at_qpi;
-    int num_blocks = s->total_num_coded_frags;
-
-    for (qpi = 0; qpi < s->nqps-1 && num_blocks > 0; qpi++) {
-        i = blocks_decoded = num_blocks_at_qpi = 0;
-
-        bit = get_bits1(gb) ^ 1;
-        run_length = 0;
-
-        do {
-            if (run_length == MAXIMUM_LONG_BIT_RUN)
-                bit = get_bits1(gb);
-            else
-                bit ^= 1;
-
-            run_length = get_vlc2(gb, s->superblock_run_length_vlc.table, 6, 2) + 1;
-            if (run_length == 34)
-                run_length += get_bits(gb, 12);
-            blocks_decoded += run_length;
-
-            if (!bit)
-                num_blocks_at_qpi += run_length;
-
-            for (j = 0; j < run_length; i++) {
-                if (i >= s->total_num_coded_frags)
-                    return -1;
-
-                if (s->all_fragments[s->coded_fragment_list[0][i]].qpi == qpi) {
-                    s->all_fragments[s->coded_fragment_list[0][i]].qpi += bit;
-                    j++;
-                }
-            }
-        } while (blocks_decoded < num_blocks && get_bits_left(gb) > 0);
-
-        num_blocks -= num_blocks_at_qpi;
-    }
-
-    return 0;
-}
-
-/*
- * This function is called by unpack_dct_coeffs() to extract the VLCs from
- * the bitstream. The VLCs encode tokens which are used to unpack DCT
- * data. This function unpacks all the VLCs for either the Y plane or both
- * C planes, and is called for DC coefficients or different AC coefficient
- * levels (since different coefficient types require different VLC tables.
- *
- * This function returns a residual eob run. E.g, if a particular token gave
- * instructions to EOB the next 5 fragments and there were only 2 fragments
- * left in the current fragment range, 3 would be returned so that it could
- * be passed into the next call to this same function.
- */
-static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
-                        VLC *table, int coeff_index,
-                        int plane,
-                        int eob_run)
-{
-    int i, j = 0;
-    int token;
-    int zero_run = 0;
-    int16_t coeff = 0;
-    int bits_to_get;
-    int blocks_ended;
-    int coeff_i = 0;
-    int num_coeffs = s->num_coded_frags[plane][coeff_index];
-    int16_t *dct_tokens = s->dct_tokens[plane][coeff_index];
-
-    /* local references to structure members to avoid repeated deferences */
-    int *coded_fragment_list = s->coded_fragment_list[plane];
-    Vp3Fragment *all_fragments = s->all_fragments;
-    VLC_TYPE (*vlc_table)[2] = table->table;
-
-    if (num_coeffs < 0)
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid number of coefficents at level %d\n", coeff_index);
-
-    if (eob_run > num_coeffs) {
-        coeff_i = blocks_ended = num_coeffs;
-        eob_run -= num_coeffs;
-    } else {
-        coeff_i = blocks_ended = eob_run;
-        eob_run = 0;
-    }
-
-    // insert fake EOB token to cover the split between planes or zzi
-    if (blocks_ended)
-        dct_tokens[j++] = blocks_ended << 2;
-
-    while (coeff_i < num_coeffs && get_bits_left(gb) > 0) {
-            /* decode a VLC into a token */
-            token = get_vlc2(gb, vlc_table, 11, 3);
-            /* use the token to get a zero run, a coefficient, and an eob run */
-            if ((unsigned) token <= 6U) {
-                eob_run = eob_run_base[token];
-                if (eob_run_get_bits[token])
-                    eob_run += get_bits(gb, eob_run_get_bits[token]);
-
-                // record only the number of blocks ended in this plane,
-                // any spill will be recorded in the next plane.
-                if (eob_run > num_coeffs - coeff_i) {
-                    dct_tokens[j++] = TOKEN_EOB(num_coeffs - coeff_i);
-                    blocks_ended   += num_coeffs - coeff_i;
-                    eob_run        -= num_coeffs - coeff_i;
-                    coeff_i         = num_coeffs;
-                } else {
-                    dct_tokens[j++] = TOKEN_EOB(eob_run);
-                    blocks_ended   += eob_run;
-                    coeff_i        += eob_run;
-                    eob_run = 0;
-                }
-            } else if (token >= 0) {
-                bits_to_get = coeff_get_bits[token];
-                if (bits_to_get)
-                    bits_to_get = get_bits(gb, bits_to_get);
-                coeff = coeff_tables[token][bits_to_get];
-
-                zero_run = zero_run_base[token];
-                if (zero_run_get_bits[token])
-                    zero_run += get_bits(gb, zero_run_get_bits[token]);
-
-                if (zero_run) {
-                    dct_tokens[j++] = TOKEN_ZERO_RUN(coeff, zero_run);
-                } else {
-                    // Save DC into the fragment structure. DC prediction is
-                    // done in raster order, so the actual DC can't be in with
-                    // other tokens. We still need the token in dct_tokens[]
-                    // however, or else the structure collapses on itself.
-                    if (!coeff_index)
-                        all_fragments[coded_fragment_list[coeff_i]].dc = coeff;
-
-                    dct_tokens[j++] = TOKEN_COEFF(coeff);
-                }
-
-                if (coeff_index + zero_run > 64) {
-                    av_log(s->avctx, AV_LOG_DEBUG, "Invalid zero run of %d with"
-                           " %d coeffs left\n", zero_run, 64-coeff_index);
-                    zero_run = 64 - coeff_index;
-                }
-
-                // zero runs code multiple coefficients,
-                // so don't try to decode coeffs for those higher levels
-                for (i = coeff_index+1; i <= coeff_index+zero_run; i++)
-                    s->num_coded_frags[plane][i]--;
-                coeff_i++;
-            } else {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "Invalid token %d\n", token);
-                return -1;
-            }
-    }
-
-    if (blocks_ended > s->num_coded_frags[plane][coeff_index])
-        av_log(s->avctx, AV_LOG_ERROR, "More blocks ended than coded!\n");
-
-    // decrement the number of blocks that have higher coeffecients for each
-    // EOB run at this level
-    if (blocks_ended)
-        for (i = coeff_index+1; i < 64; i++)
-            s->num_coded_frags[plane][i] -= blocks_ended;
-
-    // setup the next buffer
-    if (plane < 2)
-        s->dct_tokens[plane+1][coeff_index] = dct_tokens + j;
-    else if (coeff_index < 63)
-        s->dct_tokens[0][coeff_index+1] = dct_tokens + j;
-
-    return eob_run;
-}
-
-static void reverse_dc_prediction(Vp3DecodeContext *s,
-                                  int first_fragment,
-                                  int fragment_width,
-                                  int fragment_height);
-/*
- * This function unpacks all of the DCT coefficient data from the
- * bitstream.
- */
-static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
-{
-    int i;
-    int dc_y_table;
-    int dc_c_table;
-    int ac_y_table;
-    int ac_c_table;
-    int residual_eob_run = 0;
-    VLC *y_tables[64];
-    VLC *c_tables[64];
-
-    s->dct_tokens[0][0] = s->dct_tokens_base;
-
-    /* fetch the DC table indexes */
-    dc_y_table = get_bits(gb, 4);
-    dc_c_table = get_bits(gb, 4);
-
-    /* unpack the Y plane DC coefficients */
-    residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_y_table], 0,
-        0, residual_eob_run);
-    if (residual_eob_run < 0)
-        return residual_eob_run;
-
-    /* reverse prediction of the Y-plane DC coefficients */
-    reverse_dc_prediction(s, 0, s->fragment_width[0], s->fragment_height[0]);
-
-    /* unpack the C plane DC coefficients */
-    residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,
-        1, residual_eob_run);
-    if (residual_eob_run < 0)
-        return residual_eob_run;
-    residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,
-        2, residual_eob_run);
-    if (residual_eob_run < 0)
-        return residual_eob_run;
-
-    /* reverse prediction of the C-plane DC coefficients */
-    if (!(s->avctx->flags & CODEC_FLAG_GRAY))
-    {
-        reverse_dc_prediction(s, s->fragment_start[1],
-            s->fragment_width[1], s->fragment_height[1]);
-        reverse_dc_prediction(s, s->fragment_start[2],
-            s->fragment_width[1], s->fragment_height[1]);
-    }
-
-    /* fetch the AC table indexes */
-    ac_y_table = get_bits(gb, 4);
-    ac_c_table = get_bits(gb, 4);
-
-    /* build tables of AC VLC tables */
-    for (i = 1; i <= 5; i++) {
-        y_tables[i] = &s->ac_vlc_1[ac_y_table];
-        c_tables[i] = &s->ac_vlc_1[ac_c_table];
-    }
-    for (i = 6; i <= 14; i++) {
-        y_tables[i] = &s->ac_vlc_2[ac_y_table];
-        c_tables[i] = &s->ac_vlc_2[ac_c_table];
-    }
-    for (i = 15; i <= 27; i++) {
-        y_tables[i] = &s->ac_vlc_3[ac_y_table];
-        c_tables[i] = &s->ac_vlc_3[ac_c_table];
-    }
-    for (i = 28; i <= 63; i++) {
-        y_tables[i] = &s->ac_vlc_4[ac_y_table];
-        c_tables[i] = &s->ac_vlc_4[ac_c_table];
-    }
-
-    /* decode all AC coefficents */
-    for (i = 1; i <= 63; i++) {
-            residual_eob_run = unpack_vlcs(s, gb, y_tables[i], i,
-                0, residual_eob_run);
-            if (residual_eob_run < 0)
-                return residual_eob_run;
-
-            residual_eob_run = unpack_vlcs(s, gb, c_tables[i], i,
-                1, residual_eob_run);
-            if (residual_eob_run < 0)
-                return residual_eob_run;
-            residual_eob_run = unpack_vlcs(s, gb, c_tables[i], i,
-                2, residual_eob_run);
-            if (residual_eob_run < 0)
-                return residual_eob_run;
-    }
-
-    return 0;
-}
-
-/*
- * This function reverses the DC prediction for each coded fragment in
- * the frame. Much of this function is adapted directly from the original
- * VP3 source code.
- */
-#define COMPATIBLE_FRAME(x) \
-  (compatible_frame[s->all_fragments[x].coding_method] == current_frame_type)
-#define DC_COEFF(u) s->all_fragments[u].dc
-
-static void reverse_dc_prediction(Vp3DecodeContext *s,
-                                  int first_fragment,
-                                  int fragment_width,
-                                  int fragment_height)
-{
-
-#define PUL 8
-#define PU 4
-#define PUR 2
-#define PL 1
-
-    int x, y;
-    int i = first_fragment;
-
-    int predicted_dc;
-
-    /* DC values for the left, up-left, up, and up-right fragments */
-    int vl, vul, vu, vur;
-
-    /* indexes for the left, up-left, up, and up-right fragments */
-    int l, ul, u, ur;
-
-    /*
-     * The 6 fields mean:
-     *   0: up-left multiplier
-     *   1: up multiplier
-     *   2: up-right multiplier
-     *   3: left multiplier
-     */
-    static const int predictor_transform[16][4] = {
-        {  0,  0,  0,  0},
-        {  0,  0,  0,128},        // PL
-        {  0,  0,128,  0},        // PUR
-        {  0,  0, 53, 75},        // PUR|PL
-        {  0,128,  0,  0},        // PU
-        {  0, 64,  0, 64},        // PU|PL
-        {  0,128,  0,  0},        // PU|PUR
-        {  0,  0, 53, 75},        // PU|PUR|PL
-        {128,  0,  0,  0},        // PUL
-        {  0,  0,  0,128},        // PUL|PL
-        { 64,  0, 64,  0},        // PUL|PUR
-        {  0,  0, 53, 75},        // PUL|PUR|PL
-        {  0,128,  0,  0},        // PUL|PU
-       {-104,116,  0,116},        // PUL|PU|PL
-        { 24, 80, 24,  0},        // PUL|PU|PUR
-       {-104,116,  0,116}         // PUL|PU|PUR|PL
-    };
-
-    /* This table shows which types of blocks can use other blocks for
-     * prediction. For example, INTRA is the only mode in this table to
-     * have a frame number of 0. That means INTRA blocks can only predict
-     * from other INTRA blocks. There are 2 golden frame coding types;
-     * blocks encoding in these modes can only predict from other blocks
-     * that were encoded with these 1 of these 2 modes. */
-    static const unsigned char compatible_frame[9] = {
-        1,    /* MODE_INTER_NO_MV */
-        0,    /* MODE_INTRA */
-        1,    /* MODE_INTER_PLUS_MV */
-        1,    /* MODE_INTER_LAST_MV */
-        1,    /* MODE_INTER_PRIOR_MV */
-        2,    /* MODE_USING_GOLDEN */
-        2,    /* MODE_GOLDEN_MV */
-        1,    /* MODE_INTER_FOUR_MV */
-        3     /* MODE_COPY */
-    };
-    int current_frame_type;
-
-    /* there is a last DC predictor for each of the 3 frame types */
-    short last_dc[3];
-
-    int transform = 0;
-
-    vul = vu = vur = vl = 0;
-    last_dc[0] = last_dc[1] = last_dc[2] = 0;
-
-    /* for each fragment row... */
-    for (y = 0; y < fragment_height; y++) {
-
-        /* for each fragment in a row... */
-        for (x = 0; x < fragment_width; x++, i++) {
-
-            /* reverse prediction if this block was coded */
-            if (s->all_fragments[i].coding_method != MODE_COPY) {
-
-                current_frame_type =
-                    compatible_frame[s->all_fragments[i].coding_method];
-
-                transform= 0;
-                if(x){
-                    l= i-1;
-                    vl = DC_COEFF(l);
-                    if(COMPATIBLE_FRAME(l))
-                        transform |= PL;
-                }
-                if(y){
-                    u= i-fragment_width;
-                    vu = DC_COEFF(u);
-                    if(COMPATIBLE_FRAME(u))
-                        transform |= PU;
-                    if(x){
-                        ul= i-fragment_width-1;
-                        vul = DC_COEFF(ul);
-                        if(COMPATIBLE_FRAME(ul))
-                            transform |= PUL;
-                    }
-                    if(x + 1 < fragment_width){
-                        ur= i-fragment_width+1;
-                        vur = DC_COEFF(ur);
-                        if(COMPATIBLE_FRAME(ur))
-                            transform |= PUR;
-                    }
-                }
-
-                if (transform == 0) {
-
-                    /* if there were no fragments to predict from, use last
-                     * DC saved */
-                    predicted_dc = last_dc[current_frame_type];
-                } else {
-
-                    /* apply the appropriate predictor transform */
-                    predicted_dc =
-                        (predictor_transform[transform][0] * vul) +
-                        (predictor_transform[transform][1] * vu) +
-                        (predictor_transform[transform][2] * vur) +
-                        (predictor_transform[transform][3] * vl);
-
-                    predicted_dc /= 128;
-
-                    /* check for outranging on the [ul u l] and
-                     * [ul u ur l] predictors */
-                    if ((transform == 15) || (transform == 13)) {
-                        if (FFABS(predicted_dc - vu) > 128)
-                            predicted_dc = vu;
-                        else if (FFABS(predicted_dc - vl) > 128)
-                            predicted_dc = vl;
-                        else if (FFABS(predicted_dc - vul) > 128)
-                            predicted_dc = vul;
-                    }
-                }
-
-                /* at long last, apply the predictor */
-                DC_COEFF(i) += predicted_dc;
-                /* save the DC */
-                last_dc[current_frame_type] = DC_COEFF(i);
-            }
-        }
-    }
-}
-
-static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int yend)
-{
-    int x, y;
-    int *bounding_values= s->bounding_values_array+127;
-
-    int width           = s->fragment_width[!!plane];
-    int height          = s->fragment_height[!!plane];
-    int fragment        = s->fragment_start        [plane] + ystart * width;
-    ptrdiff_t stride    = s->current_frame.f->linesize[plane];
-    uint8_t *plane_data = s->current_frame.f->data    [plane];
-    if (!s->flipped_image) stride = -stride;
-    plane_data += s->data_offset[plane] + 8*ystart*stride;
-
-    for (y = ystart; y < yend; y++) {
-
-        for (x = 0; x < width; x++) {
-            /* This code basically just deblocks on the edges of coded blocks.
-             * However, it has to be much more complicated because of the
-             * braindamaged deblock ordering used in VP3/Theora. Order matters
-             * because some pixels get filtered twice. */
-            if( s->all_fragments[fragment].coding_method != MODE_COPY )
-            {
-                /* do not perform left edge filter for left columns frags */
-                if (x > 0) {
-                    s->vp3dsp.h_loop_filter(
-                        plane_data + 8*x,
-                        stride, bounding_values);
-                }
-
-                /* do not perform top edge filter for top row fragments */
-                if (y > 0) {
-                    s->vp3dsp.v_loop_filter(
-                        plane_data + 8*x,
-                        stride, bounding_values);
-                }
-
-                /* do not perform right edge filter for right column
-                 * fragments or if right fragment neighbor is also coded
-                 * in this frame (it will be filtered in next iteration) */
-                if ((x < width - 1) &&
-                    (s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
-                    s->vp3dsp.h_loop_filter(
-                        plane_data + 8*x + 8,
-                        stride, bounding_values);
-                }
-
-                /* do not perform bottom edge filter for bottom row
-                 * fragments or if bottom fragment neighbor is also coded
-                 * in this frame (it will be filtered in the next row) */
-                if ((y < height - 1) &&
-                    (s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
-                    s->vp3dsp.v_loop_filter(
-                        plane_data + 8*x + 8*stride,
-                        stride, bounding_values);
-                }
-            }
-
-            fragment++;
-        }
-        plane_data += 8*stride;
-    }
-}
-
-/**
- * Pull DCT tokens from the 64 levels to decode and dequant the coefficients
- * for the next block in coding order
- */
-static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag,
-                              int plane, int inter, int16_t block[64])
-{
-    int16_t *dequantizer = s->qmat[frag->qpi][inter][plane];
-    uint8_t *perm = s->idct_scantable;
-    int i = 0;
-
-    do {
-        int token = *s->dct_tokens[plane][i];
-        switch (token & 3) {
-        case 0: // EOB
-            if (--token < 4) // 0-3 are token types, so the EOB run must now be 0
-                s->dct_tokens[plane][i]++;
-            else
-                *s->dct_tokens[plane][i] = token & ~3;
-            goto end;
-        case 1: // zero run
-            s->dct_tokens[plane][i]++;
-            i += (token >> 2) & 0x7f;
-            if (i > 63) {
-                av_log(s->avctx, AV_LOG_ERROR, "Coefficient index overflow\n");
-                return i;
-            }
-            block[perm[i]] = (token >> 9) * dequantizer[perm[i]];
-            i++;
-            break;
-        case 2: // coeff
-            block[perm[i]] = (token >> 2) * dequantizer[perm[i]];
-            s->dct_tokens[plane][i++]++;
-            break;
-        default: // shouldn't happen
-            return i;
-        }
-    } while (i < 64);
-    // return value is expected to be a valid level
-    i--;
-end:
-    // the actual DC+prediction is in the fragment structure
-    block[0] = frag->dc * s->qmat[0][inter][plane][0];
-    return i;
-}
-
-/**
- * called when all pixels up to row y are complete
- */
-static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y)
-{
-    int h, cy, i;
-    int offset[AV_NUM_DATA_POINTERS];
-
-    if (HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) {
-        int y_flipped = s->flipped_image ? s->avctx->height-y : y;
-
-        // At the end of the frame, report INT_MAX instead of the height of the frame.
-        // This makes the other threads' ff_thread_await_progress() calls cheaper, because
-        // they don't have to clip their values.
-        ff_thread_report_progress(&s->current_frame, y_flipped==s->avctx->height ? INT_MAX : y_flipped-1, 0);
-    }
-
-    if(s->avctx->draw_horiz_band==NULL)
-        return;
-
-    h= y - s->last_slice_end;
-    s->last_slice_end= y;
-    y -= h;
-
-    if (!s->flipped_image) {
-        y = s->avctx->height - y - h;
-    }
-
-    cy = y >> s->chroma_y_shift;
-    offset[0] = s->current_frame.f->linesize[0]*y;
-    offset[1] = s->current_frame.f->linesize[1]*cy;
-    offset[2] = s->current_frame.f->linesize[2]*cy;
-    for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
-        offset[i] = 0;
-
-    emms_c();
-    s->avctx->draw_horiz_band(s->avctx, s->current_frame.f, offset, y, 3, h);
-}
-
-/**
- * Wait for the reference frame of the current fragment.
- * The progress value is in luma pixel rows.
- */
-static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, int motion_y, int y)
-{
-    ThreadFrame *ref_frame;
-    int ref_row;
-    int border = motion_y&1;
-
-    if (fragment->coding_method == MODE_USING_GOLDEN ||
-        fragment->coding_method == MODE_GOLDEN_MV)
-        ref_frame = &s->golden_frame;
-    else
-        ref_frame = &s->last_frame;
-
-    ref_row = y + (motion_y>>1);
-    ref_row = FFMAX(FFABS(ref_row), ref_row + 8 + border);
-
-    ff_thread_await_progress(ref_frame, ref_row, 0);
-}
-
-/*
- * Perform the final rendering for a particular slice of data.
- * The slice number ranges from 0..(c_superblock_height - 1).
- */
-static void render_slice(Vp3DecodeContext *s, int slice)
-{
-    int x, y, i, j, fragment;
-    int16_t *block = s->block;
-    int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef;
-    int motion_halfpel_index;
-    uint8_t *motion_source;
-    int plane, first_pixel;
-
-    if (slice >= s->c_superblock_height)
-        return;
-
-    for (plane = 0; plane < 3; plane++) {
-        uint8_t *output_plane = s->current_frame.f->data    [plane] + s->data_offset[plane];
-        uint8_t *  last_plane = s->   last_frame.f->data    [plane] + s->data_offset[plane];
-        uint8_t *golden_plane = s-> golden_frame.f->data    [plane] + s->data_offset[plane];
-        ptrdiff_t stride      = s->current_frame.f->linesize[plane];
-        int plane_width       = s->width  >> (plane && s->chroma_x_shift);
-        int plane_height      = s->height >> (plane && s->chroma_y_shift);
-        int8_t (*motion_val)[2] = s->motion_val[!!plane];
-
-        int sb_x, sb_y        = slice << (!plane && s->chroma_y_shift);
-        int slice_height      = sb_y + 1 + (!plane && s->chroma_y_shift);
-        int slice_width       = plane ? s->c_superblock_width : s->y_superblock_width;
-
-        int fragment_width    = s->fragment_width[!!plane];
-        int fragment_height   = s->fragment_height[!!plane];
-        int fragment_start    = s->fragment_start[plane];
-        int do_await          = !plane && HAVE_THREADS && (s->avctx->active_thread_type&FF_THREAD_FRAME);
-
-        if (!s->flipped_image) stride = -stride;
-        if (CONFIG_GRAY && plane && (s->avctx->flags & CODEC_FLAG_GRAY))
-            continue;
-
-        /* for each superblock row in the slice (both of them)... */
-        for (; sb_y < slice_height; sb_y++) {
-
-            /* for each superblock in a row... */
-            for (sb_x = 0; sb_x < slice_width; sb_x++) {
-
-                /* for each block in a superblock... */
-                for (j = 0; j < 16; j++) {
-                    x = 4*sb_x + hilbert_offset[j][0];
-                    y = 4*sb_y + hilbert_offset[j][1];
-                    fragment = y*fragment_width + x;
-
-                    i = fragment_start + fragment;
-
-                    // bounds check
-                    if (x >= fragment_width || y >= fragment_height)
-                        continue;
-
-                first_pixel = 8*y*stride + 8*x;
-
-                if (do_await && s->all_fragments[i].coding_method != MODE_INTRA)
-                    await_reference_row(s, &s->all_fragments[i], motion_val[fragment][1], (16*y) >> s->chroma_y_shift);
-
-                /* transform if this block was coded */
-                if (s->all_fragments[i].coding_method != MODE_COPY) {
-                    if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) ||
-                        (s->all_fragments[i].coding_method == MODE_GOLDEN_MV))
-                        motion_source= golden_plane;
-                    else
-                        motion_source= last_plane;
-
-                    motion_source += first_pixel;
-                    motion_halfpel_index = 0;
-
-                    /* sort out the motion vector if this fragment is coded
-                     * using a motion vector method */
-                    if ((s->all_fragments[i].coding_method > MODE_INTRA) &&
-                        (s->all_fragments[i].coding_method != MODE_USING_GOLDEN)) {
-                        int src_x, src_y;
-                        motion_x = motion_val[fragment][0];
-                        motion_y = motion_val[fragment][1];
-
-                        src_x= (motion_x>>1) + 8*x;
-                        src_y= (motion_y>>1) + 8*y;
-
-                        motion_halfpel_index = motion_x & 0x01;
-                        motion_source += (motion_x >> 1);
-
-                        motion_halfpel_index |= (motion_y & 0x01) << 1;
-                        motion_source += ((motion_y >> 1) * stride);
-
-                        if(src_x<0 || src_y<0 || src_x + 9 >= plane_width || src_y + 9 >= plane_height){
-                            uint8_t *temp= s->edge_emu_buffer;
-                            if(stride<0) temp -= 8*stride;
-
-                            s->vdsp.emulated_edge_mc(temp, motion_source,
-                                                     stride, stride,
-                                                     9, 9, src_x, src_y,
-                                                     plane_width,
-                                                     plane_height);
-                            motion_source= temp;
-                        }
-                    }
-
-
-                    /* first, take care of copying a block from either the
-                     * previous or the golden frame */
-                    if (s->all_fragments[i].coding_method != MODE_INTRA) {
-                        /* Note, it is possible to implement all MC cases with
-                           put_no_rnd_pixels_l2 which would look more like the
-                           VP3 source but this would be slower as
-                           put_no_rnd_pixels_tab is better optimzed */
-                        if(motion_halfpel_index != 3){
-                            s->hdsp.put_no_rnd_pixels_tab[1][motion_halfpel_index](
-                                output_plane + first_pixel,
-                                motion_source, stride, 8);
-                        }else{
-                            int d= (motion_x ^ motion_y)>>31; // d is 0 if motion_x and _y have the same sign, else -1
-                            s->vp3dsp.put_no_rnd_pixels_l2(
-                                output_plane + first_pixel,
-                                motion_source - d,
-                                motion_source + stride + 1 + d,
-                                stride, 8);
-                        }
-                    }
-
-                    /* invert DCT and place (or add) in final output */
-
-                    if (s->all_fragments[i].coding_method == MODE_INTRA) {
-                        int index;
-                        index = vp3_dequant(s, s->all_fragments + i, plane, 0, block);
-                        if (index > 63)
-                            continue;
-                        s->vp3dsp.idct_put(
-                            output_plane + first_pixel,
-                            stride,
-                            block);
-                    } else {
-                        int index = vp3_dequant(s, s->all_fragments + i, plane, 1, block);
-                        if (index > 63)
-                            continue;
-                        if (index > 0) {
-                        s->vp3dsp.idct_add(
-                            output_plane + first_pixel,
-                            stride,
-                            block);
-                        } else {
-                            s->vp3dsp.idct_dc_add(output_plane + first_pixel, stride, block);
-                        }
-                    }
-                } else {
-
-                    /* copy directly from the previous frame */
-                    s->hdsp.put_pixels_tab[1][0](
-                        output_plane + first_pixel,
-                        last_plane + first_pixel,
-                        stride, 8);
-
-                }
-                }
-            }
-
-            // Filter up to the last row in the superblock row
-            if (!s->skip_loop_filter)
-                apply_loop_filter(s, plane, 4*sb_y - !!sb_y, FFMIN(4*sb_y+3, fragment_height-1));
-        }
-    }
-
-     /* this looks like a good place for slice dispatch... */
-     /* algorithm:
-      *   if (slice == s->macroblock_height - 1)
-      *     dispatch (both last slice & 2nd-to-last slice);
-      *   else if (slice > 0)
-      *     dispatch (slice - 1);
-      */
-
-    vp3_draw_horiz_band(s, FFMIN((32 << s->chroma_y_shift) * (slice + 1) -16, s->height-16));
-}
-
-/// Allocate tables for per-frame data in Vp3DecodeContext
-static av_cold int allocate_tables(AVCodecContext *avctx)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-    int y_fragment_count, c_fragment_count;
-
-    y_fragment_count = s->fragment_width[0] * s->fragment_height[0];
-    c_fragment_count = s->fragment_width[1] * s->fragment_height[1];
-
-    s->superblock_coding = av_malloc(s->superblock_count);
-    s->all_fragments = av_malloc(s->fragment_count * sizeof(Vp3Fragment));
-    s->coded_fragment_list[0] = av_malloc(s->fragment_count * sizeof(int));
-    s->dct_tokens_base = av_malloc(64*s->fragment_count * sizeof(*s->dct_tokens_base));
-    s->motion_val[0] = av_malloc(y_fragment_count * sizeof(*s->motion_val[0]));
-    s->motion_val[1] = av_malloc(c_fragment_count * sizeof(*s->motion_val[1]));
-
-    /* work out the block mapping tables */
-    s->superblock_fragments = av_malloc(s->superblock_count * 16 * sizeof(int));
-    s->macroblock_coding = av_malloc(s->macroblock_count + 1);
-
-    if (!s->superblock_coding || !s->all_fragments || !s->dct_tokens_base ||
-        !s->coded_fragment_list[0] || !s->superblock_fragments || !s->macroblock_coding ||
-        !s->motion_val[0] || !s->motion_val[1]) {
-        vp3_decode_end(avctx);
-        return -1;
-    }
-
-    init_block_mapping(s);
-
-    return 0;
-}
-
-static av_cold int init_frames(Vp3DecodeContext *s)
-{
-    s->current_frame.f = av_frame_alloc();
-    s->last_frame.f    = av_frame_alloc();
-    s->golden_frame.f  = av_frame_alloc();
-
-    if (!s->current_frame.f || !s->last_frame.f || !s->golden_frame.f) {
-        av_frame_free(&s->current_frame.f);
-        av_frame_free(&s->last_frame.f);
-        av_frame_free(&s->golden_frame.f);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static av_cold int vp3_decode_init(AVCodecContext *avctx)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-    int i, inter, plane, ret;
-    int c_width;
-    int c_height;
-    int y_fragment_count, c_fragment_count;
-
-    ret = init_frames(s);
-    if (ret < 0)
-        return ret;
-
-    avctx->internal->allocate_progress = 1;
-
-    if (avctx->codec_tag == MKTAG('V','P','3','0'))
-        s->version = 0;
-    else
-        s->version = 1;
-
-    s->avctx = avctx;
-    s->width = FFALIGN(avctx->width, 16);
-    s->height = FFALIGN(avctx->height, 16);
-    if (avctx->pix_fmt == AV_PIX_FMT_NONE)
-        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
-    ff_hpeldsp_init(&s->hdsp, avctx->flags | CODEC_FLAG_BITEXACT);
-    ff_videodsp_init(&s->vdsp, 8);
-    ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
-
-    for (i = 0; i < 64; i++) {
-#define T(x) (x >> 3) | ((x & 7) << 3)
-        s->idct_permutation[i] = T(i);
-        s->idct_scantable[i] = T(ff_zigzag_direct[i]);
-#undef T
-    }
-
-    /* initialize to an impossible value which will force a recalculation
-     * in the first frame decode */
-    for (i = 0; i < 3; i++)
-        s->qps[i] = -1;
-
-    av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift,
-                                     &s->chroma_y_shift);
-
-    s->y_superblock_width = (s->width + 31) / 32;
-    s->y_superblock_height = (s->height + 31) / 32;
-    s->y_superblock_count = s->y_superblock_width * s->y_superblock_height;
-
-    /* work out the dimensions for the C planes */
-    c_width = s->width >> s->chroma_x_shift;
-    c_height = s->height >> s->chroma_y_shift;
-    s->c_superblock_width = (c_width + 31) / 32;
-    s->c_superblock_height = (c_height + 31) / 32;
-    s->c_superblock_count = s->c_superblock_width * s->c_superblock_height;
-
-    s->superblock_count = s->y_superblock_count + (s->c_superblock_count * 2);
-    s->u_superblock_start = s->y_superblock_count;
-    s->v_superblock_start = s->u_superblock_start + s->c_superblock_count;
-
-    s->macroblock_width = (s->width + 15) / 16;
-    s->macroblock_height = (s->height + 15) / 16;
-    s->macroblock_count = s->macroblock_width * s->macroblock_height;
-
-    s->fragment_width[0] = s->width / FRAGMENT_PIXELS;
-    s->fragment_height[0] = s->height / FRAGMENT_PIXELS;
-    s->fragment_width[1]  = s->fragment_width[0]  >> s->chroma_x_shift;
-    s->fragment_height[1] = s->fragment_height[0] >> s->chroma_y_shift;
-
-    /* fragment count covers all 8x8 blocks for all 3 planes */
-    y_fragment_count     = s->fragment_width[0] * s->fragment_height[0];
-    c_fragment_count     = s->fragment_width[1] * s->fragment_height[1];
-    s->fragment_count    = y_fragment_count + 2*c_fragment_count;
-    s->fragment_start[1] = y_fragment_count;
-    s->fragment_start[2] = y_fragment_count + c_fragment_count;
-
-    if (!s->theora_tables)
-    {
-        for (i = 0; i < 64; i++) {
-            s->coded_dc_scale_factor[i] = vp31_dc_scale_factor[i];
-            s->coded_ac_scale_factor[i] = vp31_ac_scale_factor[i];
-            s->base_matrix[0][i] = vp31_intra_y_dequant[i];
-            s->base_matrix[1][i] = vp31_intra_c_dequant[i];
-            s->base_matrix[2][i] = vp31_inter_dequant[i];
-            s->filter_limit_values[i] = vp31_filter_limit_values[i];
-        }
-
-        for(inter=0; inter<2; inter++){
-            for(plane=0; plane<3; plane++){
-                s->qr_count[inter][plane]= 1;
-                s->qr_size [inter][plane][0]= 63;
-                s->qr_base [inter][plane][0]=
-                s->qr_base [inter][plane][1]= 2*inter + (!!plane)*!inter;
-            }
-        }
-
-        /* init VLC tables */
-        for (i = 0; i < 16; i++) {
-
-            /* DC histograms */
-            init_vlc(&s->dc_vlc[i], 11, 32,
-                &dc_bias[i][0][1], 4, 2,
-                &dc_bias[i][0][0], 4, 2, 0);
-
-            /* group 1 AC histograms */
-            init_vlc(&s->ac_vlc_1[i], 11, 32,
-                &ac_bias_0[i][0][1], 4, 2,
-                &ac_bias_0[i][0][0], 4, 2, 0);
-
-            /* group 2 AC histograms */
-            init_vlc(&s->ac_vlc_2[i], 11, 32,
-                &ac_bias_1[i][0][1], 4, 2,
-                &ac_bias_1[i][0][0], 4, 2, 0);
-
-            /* group 3 AC histograms */
-            init_vlc(&s->ac_vlc_3[i], 11, 32,
-                &ac_bias_2[i][0][1], 4, 2,
-                &ac_bias_2[i][0][0], 4, 2, 0);
-
-            /* group 4 AC histograms */
-            init_vlc(&s->ac_vlc_4[i], 11, 32,
-                &ac_bias_3[i][0][1], 4, 2,
-                &ac_bias_3[i][0][0], 4, 2, 0);
-        }
-    } else {
-
-        for (i = 0; i < 16; i++) {
-            /* DC histograms */
-            if (init_vlc(&s->dc_vlc[i], 11, 32,
-                &s->huffman_table[i][0][1], 8, 4,
-                &s->huffman_table[i][0][0], 8, 4, 0) < 0)
-                goto vlc_fail;
-
-            /* group 1 AC histograms */
-            if (init_vlc(&s->ac_vlc_1[i], 11, 32,
-                &s->huffman_table[i+16][0][1], 8, 4,
-                &s->huffman_table[i+16][0][0], 8, 4, 0) < 0)
-                goto vlc_fail;
-
-            /* group 2 AC histograms */
-            if (init_vlc(&s->ac_vlc_2[i], 11, 32,
-                &s->huffman_table[i+16*2][0][1], 8, 4,
-                &s->huffman_table[i+16*2][0][0], 8, 4, 0) < 0)
-                goto vlc_fail;
-
-            /* group 3 AC histograms */
-            if (init_vlc(&s->ac_vlc_3[i], 11, 32,
-                &s->huffman_table[i+16*3][0][1], 8, 4,
-                &s->huffman_table[i+16*3][0][0], 8, 4, 0) < 0)
-                goto vlc_fail;
-
-            /* group 4 AC histograms */
-            if (init_vlc(&s->ac_vlc_4[i], 11, 32,
-                &s->huffman_table[i+16*4][0][1], 8, 4,
-                &s->huffman_table[i+16*4][0][0], 8, 4, 0) < 0)
-                goto vlc_fail;
-        }
-    }
-
-    init_vlc(&s->superblock_run_length_vlc, 6, 34,
-        &superblock_run_length_vlc_table[0][1], 4, 2,
-        &superblock_run_length_vlc_table[0][0], 4, 2, 0);
-
-    init_vlc(&s->fragment_run_length_vlc, 5, 30,
-        &fragment_run_length_vlc_table[0][1], 4, 2,
-        &fragment_run_length_vlc_table[0][0], 4, 2, 0);
-
-    init_vlc(&s->mode_code_vlc, 3, 8,
-        &mode_code_vlc_table[0][1], 2, 1,
-        &mode_code_vlc_table[0][0], 2, 1, 0);
-
-    init_vlc(&s->motion_vector_vlc, 6, 63,
-        &motion_vector_vlc_table[0][1], 2, 1,
-        &motion_vector_vlc_table[0][0], 2, 1, 0);
-
-    return allocate_tables(avctx);
-
-vlc_fail:
-    av_log(avctx, AV_LOG_FATAL, "Invalid huffman table\n");
-    return -1;
-}
-
-/// Release and shuffle frames after decode finishes
-static int update_frames(AVCodecContext *avctx)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-    int ret = 0;
-
-
-    /* shuffle frames (last = current) */
-    ff_thread_release_buffer(avctx, &s->last_frame);
-    ret = ff_thread_ref_frame(&s->last_frame, &s->current_frame);
-    if (ret < 0)
-        goto fail;
-
-    if (s->keyframe) {
-        ff_thread_release_buffer(avctx, &s->golden_frame);
-        ret = ff_thread_ref_frame(&s->golden_frame, &s->current_frame);
-    }
-
-fail:
-    ff_thread_release_buffer(avctx, &s->current_frame);
-    return ret;
-}
-
-static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, ThreadFrame *src)
-{
-    ff_thread_release_buffer(s->avctx, dst);
-    if (src->f->data[0])
-        return ff_thread_ref_frame(dst, src);
-    return 0;
-}
-
-static int ref_frames(Vp3DecodeContext *dst, Vp3DecodeContext *src)
-{
-    int ret;
-    if ((ret = ref_frame(dst, &dst->current_frame, &src->current_frame)) < 0 ||
-        (ret = ref_frame(dst, &dst->golden_frame,  &src->golden_frame)) < 0  ||
-        (ret = ref_frame(dst, &dst->last_frame,    &src->last_frame)) < 0)
-        return ret;
-    return 0;
-}
-
-static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
-{
-    Vp3DecodeContext *s = dst->priv_data, *s1 = src->priv_data;
-    int qps_changed = 0, i, err;
-
-#define copy_fields(to, from, start_field, end_field) memcpy(&to->start_field, &from->start_field, (char*)&to->end_field - (char*)&to->start_field)
-
-    if (!s1->current_frame.f->data[0]
-        ||s->width != s1->width
-        ||s->height!= s1->height) {
-        if (s != s1)
-            ref_frames(s, s1);
-        return -1;
-    }
-
-    if (s != s1) {
-        // init tables if the first frame hasn't been decoded
-        if (!s->current_frame.f->data[0]) {
-            int y_fragment_count, c_fragment_count;
-            s->avctx = dst;
-            err = allocate_tables(dst);
-            if (err)
-                return err;
-            y_fragment_count = s->fragment_width[0] * s->fragment_height[0];
-            c_fragment_count = s->fragment_width[1] * s->fragment_height[1];
-            memcpy(s->motion_val[0], s1->motion_val[0], y_fragment_count * sizeof(*s->motion_val[0]));
-            memcpy(s->motion_val[1], s1->motion_val[1], c_fragment_count * sizeof(*s->motion_val[1]));
-        }
-
-        // copy previous frame data
-        if ((err = ref_frames(s, s1)) < 0)
-            return err;
-
-        s->keyframe = s1->keyframe;
-
-        // copy qscale data if necessary
-        for (i = 0; i < 3; i++) {
-            if (s->qps[i] != s1->qps[1]) {
-                qps_changed = 1;
-                memcpy(&s->qmat[i], &s1->qmat[i], sizeof(s->qmat[i]));
-            }
-        }
-
-        if (s->qps[0] != s1->qps[0])
-            memcpy(&s->bounding_values_array, &s1->bounding_values_array, sizeof(s->bounding_values_array));
-
-        if (qps_changed)
-            copy_fields(s, s1, qps, superblock_count);
-#undef copy_fields
-    }
-
-    return update_frames(dst);
-}
-
-static int vp3_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    Vp3DecodeContext *s = avctx->priv_data;
-    GetBitContext gb;
-    int i, ret;
-
-    init_get_bits(&gb, buf, buf_size * 8);
-
-    if (s->theora && get_bits1(&gb))
-    {
-        av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n");
-        return -1;
-    }
-
-    s->keyframe = !get_bits1(&gb);
-    if (!s->theora)
-        skip_bits(&gb, 1);
-    for (i = 0; i < 3; i++)
-        s->last_qps[i] = s->qps[i];
-
-    s->nqps=0;
-    do{
-        s->qps[s->nqps++]= get_bits(&gb, 6);
-    } while(s->theora >= 0x030200 && s->nqps<3 && get_bits1(&gb));
-    for (i = s->nqps; i < 3; i++)
-        s->qps[i] = -1;
-
-    if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n",
-            s->keyframe?"key":"", avctx->frame_number+1, s->qps[0]);
-
-    s->skip_loop_filter = !s->filter_limit_values[s->qps[0]] ||
-        avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL : AVDISCARD_NONKEY);
-
-    if (s->qps[0] != s->last_qps[0])
-        init_loop_filter(s);
-
-    for (i = 0; i < s->nqps; i++)
-        // reinit all dequantizers if the first one changed, because
-        // the DC of the first quantizer must be used for all matrices
-        if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0])
-            init_dequantizer(s, i);
-
-    if (avctx->skip_frame >= AVDISCARD_NONKEY && !s->keyframe)
-        return buf_size;
-
-    s->current_frame.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
-    if (ff_thread_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        goto error;
-    }
-
-    if (!s->edge_emu_buffer)
-        s->edge_emu_buffer = av_malloc(9*FFABS(s->current_frame.f->linesize[0]));
-
-    if (s->keyframe) {
-        if (!s->theora)
-        {
-            skip_bits(&gb, 4); /* width code */
-            skip_bits(&gb, 4); /* height code */
-            if (s->version)
-            {
-                s->version = get_bits(&gb, 5);
-                if (avctx->frame_number == 0)
-                    av_log(s->avctx, AV_LOG_DEBUG, "VP version: %d\n", s->version);
-            }
-        }
-        if (s->version || s->theora)
-        {
-                if (get_bits1(&gb))
-                    av_log(s->avctx, AV_LOG_ERROR, "Warning, unsupported keyframe coding type?!\n");
-            skip_bits(&gb, 2); /* reserved? */
-        }
-    } else {
-        if (!s->golden_frame.f->data[0]) {
-            av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n");
-
-            s->golden_frame.f->pict_type = AV_PICTURE_TYPE_I;
-            if (ff_thread_get_buffer(avctx, &s->golden_frame, AV_GET_BUFFER_FLAG_REF) < 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                goto error;
-            }
-            ff_thread_release_buffer(avctx, &s->last_frame);
-            if ((ret = ff_thread_ref_frame(&s->last_frame, &s->golden_frame)) < 0)
-                goto error;
-            ff_thread_report_progress(&s->last_frame, INT_MAX, 0);
-        }
-    }
-
-    memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment));
-    ff_thread_finish_setup(avctx);
-
-    if (unpack_superblocks(s, &gb)){
-        av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n");
-        goto error;
-    }
-    if (unpack_modes(s, &gb)){
-        av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n");
-        goto error;
-    }
-    if (unpack_vectors(s, &gb)){
-        av_log(s->avctx, AV_LOG_ERROR, "error in unpack_vectors\n");
-        goto error;
-    }
-    if (unpack_block_qpis(s, &gb)){
-        av_log(s->avctx, AV_LOG_ERROR, "error in unpack_block_qpis\n");
-        goto error;
-    }
-    if (unpack_dct_coeffs(s, &gb)){
-        av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n");
-        goto error;
-    }
-
-    for (i = 0; i < 3; i++) {
-        int height = s->height >> (i && s->chroma_y_shift);
-        if (s->flipped_image)
-            s->data_offset[i] = 0;
-        else
-            s->data_offset[i] = (height-1) * s->current_frame.f->linesize[i];
-    }
-
-    s->last_slice_end = 0;
-    for (i = 0; i < s->c_superblock_height; i++)
-        render_slice(s, i);
-
-    // filter the last row
-    for (i = 0; i < 3; i++) {
-        int row = (s->height >> (3+(i && s->chroma_y_shift))) - 1;
-        apply_loop_filter(s, i, row, row+1);
-    }
-    vp3_draw_horiz_band(s, s->avctx->height);
-
-    if ((ret = av_frame_ref(data, s->current_frame.f)) < 0)
-        return ret;
-    *got_frame = 1;
-
-    if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME)) {
-        ret = update_frames(avctx);
-        if (ret < 0)
-            return ret;
-    }
-
-    return buf_size;
-
-error:
-    ff_thread_report_progress(&s->current_frame, INT_MAX, 0);
-
-    if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME))
-        av_frame_unref(s->current_frame.f);
-
-    return -1;
-}
-
-static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-
-    if (get_bits1(gb)) {
-        int token;
-        if (s->entries >= 32) { /* overflow */
-            av_log(avctx, AV_LOG_ERROR, "huffman tree overflow\n");
-            return -1;
-        }
-        token = get_bits(gb, 5);
-        av_dlog(avctx, "hti %d hbits %x token %d entry : %d size %d\n",
-                s->hti, s->hbits, token, s->entries, s->huff_code_size);
-        s->huffman_table[s->hti][token][0] = s->hbits;
-        s->huffman_table[s->hti][token][1] = s->huff_code_size;
-        s->entries++;
-    }
-    else {
-        if (s->huff_code_size >= 32) {/* overflow */
-            av_log(avctx, AV_LOG_ERROR, "huffman tree overflow\n");
-            return -1;
-        }
-        s->huff_code_size++;
-        s->hbits <<= 1;
-        if (read_huffman_tree(avctx, gb))
-            return -1;
-        s->hbits |= 1;
-        if (read_huffman_tree(avctx, gb))
-            return -1;
-        s->hbits >>= 1;
-        s->huff_code_size--;
-    }
-    return 0;
-}
-
-static int vp3_init_thread_copy(AVCodecContext *avctx)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-
-    s->superblock_coding      = NULL;
-    s->all_fragments          = NULL;
-    s->coded_fragment_list[0] = NULL;
-    s->dct_tokens_base        = NULL;
-    s->superblock_fragments   = NULL;
-    s->macroblock_coding      = NULL;
-    s->motion_val[0]          = NULL;
-    s->motion_val[1]          = NULL;
-    s->edge_emu_buffer        = NULL;
-
-    return init_frames(s);
-}
-
-#if CONFIG_THEORA_DECODER
-static const enum AVPixelFormat theora_pix_fmts[4] = {
-    AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P
-};
-
-static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-    int visible_width, visible_height, colorspace;
-    int offset_x = 0, offset_y = 0;
-    int ret;
-    AVRational fps, aspect;
-
-    s->theora = get_bits_long(gb, 24);
-    av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora);
-
-    /* 3.2.0 aka alpha3 has the same frame orientation as original vp3 */
-    /* but previous versions have the image flipped relative to vp3 */
-    if (s->theora < 0x030200)
-    {
-        s->flipped_image = 1;
-        av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n");
-    }
-
-    visible_width  = s->width  = get_bits(gb, 16) << 4;
-    visible_height = s->height = get_bits(gb, 16) << 4;
-
-    if (s->theora >= 0x030200) {
-        visible_width  = get_bits_long(gb, 24);
-        visible_height = get_bits_long(gb, 24);
-
-        offset_x = get_bits(gb, 8); /* offset x */
-        offset_y = get_bits(gb, 8); /* offset y, from bottom */
-    }
-
-    fps.num = get_bits_long(gb, 32);
-    fps.den = get_bits_long(gb, 32);
-    if (fps.num && fps.den) {
-        if (fps.num < 0 || fps.den < 0) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid framerate\n");
-            return AVERROR_INVALIDDATA;
-        }
-        av_reduce(&avctx->time_base.num, &avctx->time_base.den,
-                  fps.den, fps.num, 1<<30);
-    }
-
-    aspect.num = get_bits_long(gb, 24);
-    aspect.den = get_bits_long(gb, 24);
-    if (aspect.num && aspect.den) {
-        av_reduce(&avctx->sample_aspect_ratio.num,
-                  &avctx->sample_aspect_ratio.den,
-                  aspect.num, aspect.den, 1<<30);
-    }
-
-    if (s->theora < 0x030200)
-        skip_bits(gb, 5); /* keyframe frequency force */
-    colorspace = get_bits(gb, 8);
-    skip_bits(gb, 24); /* bitrate */
-
-    skip_bits(gb, 6); /* quality hint */
-
-    if (s->theora >= 0x030200)
-    {
-        skip_bits(gb, 5); /* keyframe frequency force */
-        avctx->pix_fmt = theora_pix_fmts[get_bits(gb, 2)];
-        skip_bits(gb, 3); /* reserved */
-    }
-
-//    align_get_bits(gb);
-
-    if (   visible_width  <= s->width  && visible_width  > s->width-16
-        && visible_height <= s->height && visible_height > s->height-16
-        && !offset_x && (offset_y == s->height - visible_height))
-        ret = ff_set_dimensions(avctx, visible_width, visible_height);
-    else
-        ret = ff_set_dimensions(avctx, s->width, s->height);
-    if (ret < 0)
-        return ret;
-
-    if (colorspace == 1) {
-        avctx->color_primaries = AVCOL_PRI_BT470M;
-    } else if (colorspace == 2) {
-        avctx->color_primaries = AVCOL_PRI_BT470BG;
-    }
-    if (colorspace == 1 || colorspace == 2) {
-        avctx->colorspace = AVCOL_SPC_BT470BG;
-        avctx->color_trc  = AVCOL_TRC_BT709;
-    }
-
-    return 0;
-}
-
-static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-    int i, n, matrices, inter, plane;
-
-    if (s->theora >= 0x030200) {
-        n = get_bits(gb, 3);
-        /* loop filter limit values table */
-        if (n)
-            for (i = 0; i < 64; i++)
-                s->filter_limit_values[i] = get_bits(gb, n);
-    }
-
-    if (s->theora >= 0x030200)
-        n = get_bits(gb, 4) + 1;
-    else
-        n = 16;
-    /* quality threshold table */
-    for (i = 0; i < 64; i++)
-        s->coded_ac_scale_factor[i] = get_bits(gb, n);
-
-    if (s->theora >= 0x030200)
-        n = get_bits(gb, 4) + 1;
-    else
-        n = 16;
-    /* dc scale factor table */
-    for (i = 0; i < 64; i++)
-        s->coded_dc_scale_factor[i] = get_bits(gb, n);
-
-    if (s->theora >= 0x030200)
-        matrices = get_bits(gb, 9) + 1;
-    else
-        matrices = 3;
-
-    if(matrices > 384){
-        av_log(avctx, AV_LOG_ERROR, "invalid number of base matrixes\n");
-        return -1;
-    }
-
-    for(n=0; n<matrices; n++){
-        for (i = 0; i < 64; i++)
-            s->base_matrix[n][i]= get_bits(gb, 8);
-    }
-
-    for (inter = 0; inter <= 1; inter++) {
-        for (plane = 0; plane <= 2; plane++) {
-            int newqr= 1;
-            if (inter || plane > 0)
-                newqr = get_bits1(gb);
-            if (!newqr) {
-                int qtj, plj;
-                if(inter && get_bits1(gb)){
-                    qtj = 0;
-                    plj = plane;
-                }else{
-                    qtj= (3*inter + plane - 1) / 3;
-                    plj= (plane + 2) % 3;
-                }
-                s->qr_count[inter][plane]= s->qr_count[qtj][plj];
-                memcpy(s->qr_size[inter][plane], s->qr_size[qtj][plj], sizeof(s->qr_size[0][0]));
-                memcpy(s->qr_base[inter][plane], s->qr_base[qtj][plj], sizeof(s->qr_base[0][0]));
-            } else {
-                int qri= 0;
-                int qi = 0;
-
-                for(;;){
-                    i= get_bits(gb, av_log2(matrices-1)+1);
-                    if(i>= matrices){
-                        av_log(avctx, AV_LOG_ERROR, "invalid base matrix index\n");
-                        return -1;
-                    }
-                    s->qr_base[inter][plane][qri]= i;
-                    if(qi >= 63)
-                        break;
-                    i = get_bits(gb, av_log2(63-qi)+1) + 1;
-                    s->qr_size[inter][plane][qri++]= i;
-                    qi += i;
-                }
-
-                if (qi > 63) {
-                    av_log(avctx, AV_LOG_ERROR, "invalid qi %d > 63\n", qi);
-                    return -1;
-                }
-                s->qr_count[inter][plane]= qri;
-            }
-        }
-    }
-
-    /* Huffman tables */
-    for (s->hti = 0; s->hti < 80; s->hti++) {
-        s->entries = 0;
-        s->huff_code_size = 1;
-        if (!get_bits1(gb)) {
-            s->hbits = 0;
-            if(read_huffman_tree(avctx, gb))
-                return -1;
-            s->hbits = 1;
-            if(read_huffman_tree(avctx, gb))
-                return -1;
-        }
-    }
-
-    s->theora_tables = 1;
-
-    return 0;
-}
-
-static av_cold int theora_decode_init(AVCodecContext *avctx)
-{
-    Vp3DecodeContext *s = avctx->priv_data;
-    GetBitContext gb;
-    int ptype;
-    uint8_t *header_start[3];
-    int header_len[3];
-    int i;
-
-    s->theora = 1;
-
-    if (!avctx->extradata_size)
-    {
-        av_log(avctx, AV_LOG_ERROR, "Missing extradata!\n");
-        return -1;
-    }
-
-    if (avpriv_split_xiph_headers(avctx->extradata, avctx->extradata_size,
-                              42, header_start, header_len) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Corrupt extradata\n");
-        return -1;
-    }
-
-  for(i=0;i<3;i++) {
-    if (header_len[i] <= 0)
-        continue;
-    init_get_bits(&gb, header_start[i], header_len[i] * 8);
-
-    ptype = get_bits(&gb, 8);
-
-     if (!(ptype & 0x80))
-     {
-        av_log(avctx, AV_LOG_ERROR, "Invalid extradata!\n");
-//        return -1;
-     }
-
-    // FIXME: Check for this as well.
-    skip_bits_long(&gb, 6*8); /* "theora" */
-
-    switch(ptype)
-    {
-        case 0x80:
-            theora_decode_header(avctx, &gb);
-                break;
-        case 0x81:
-// FIXME: is this needed? it breaks sometimes
-//            theora_decode_comments(avctx, gb);
-            break;
-        case 0x82:
-            if (theora_decode_tables(avctx, &gb))
-                return -1;
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Unknown Theora config packet: %d\n", ptype&~0x80);
-            break;
-    }
-    if(ptype != 0x81 && 8*header_len[i] != get_bits_count(&gb))
-        av_log(avctx, AV_LOG_WARNING, "%d bits left in packet %X\n", 8*header_len[i] - get_bits_count(&gb), ptype);
-    if (s->theora < 0x030200)
-        break;
-  }
-
-    return vp3_decode_init(avctx);
-}
-
-AVCodec ff_theora_decoder = {
-    .name                  = "theora",
-    .long_name             = NULL_IF_CONFIG_SMALL("Theora"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_THEORA,
-    .priv_data_size        = sizeof(Vp3DecodeContext),
-    .init                  = theora_decode_init,
-    .close                 = vp3_decode_end,
-    .decode                = vp3_decode_frame,
-    .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND |
-                             CODEC_CAP_FRAME_THREADS,
-    .flush                 = vp3_decode_flush,
-    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(vp3_init_thread_copy),
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context)
-};
-#endif
-
-AVCodec ff_vp3_decoder = {
-    .name                  = "vp3",
-    .long_name             = NULL_IF_CONFIG_SMALL("On2 VP3"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_VP3,
-    .priv_data_size        = sizeof(Vp3DecodeContext),
-    .init                  = vp3_decode_init,
-    .close                 = vp3_decode_end,
-    .decode                = vp3_decode_frame,
-    .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND |
-                             CODEC_CAP_FRAME_THREADS,
-    .flush                 = vp3_decode_flush,
-    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(vp3_init_thread_copy),
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context),
-};
diff --git a/deps/libav/libavcodec/vp3_parser.c b/deps/libav/libavcodec/vp3_parser.c
deleted file mode 100644
index ef2c55b..0000000
--- a/deps/libav/libavcodec/vp3_parser.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2008 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "parser.h"
-
-static int parse(AVCodecParserContext *s,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
-{
-    if(avctx->codec_id == AV_CODEC_ID_THEORA)
-        s->pict_type= (buf[0]&0x40) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
-    else
-        s->pict_type= (buf[0]&0x80) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return buf_size;
-}
-
-AVCodecParser ff_vp3_parser = {
-    .codec_ids      = { AV_CODEC_ID_THEORA, AV_CODEC_ID_VP3, AV_CODEC_ID_VP6,
-                        AV_CODEC_ID_VP6F,   AV_CODEC_ID_VP6A },
-    .parser_parse   = parse,
-};
diff --git a/deps/libav/libavcodec/vp3data.h b/deps/libav/libavcodec/vp3data.h
deleted file mode 100644
index 54d5a6c..0000000
--- a/deps/libav/libavcodec/vp3data.h
+++ /dev/null
@@ -1,3181 +0,0 @@
-/*
- * copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VP3DATA_H
-#define AVCODEC_VP3DATA_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-/* these coefficients dequantize intraframe Y plane coefficients
- * (note: same as JPEG) */
-static const int16_t vp31_intra_y_dequant[64] =
-{       16,  11,  10,  16,  24,  40,  51,  61,
-        12,  12,  14,  19,  26,  58,  60,  55,
-        14,  13,  16,  24,  40,  57,  69,  56,
-        14,  17,  22,  29,  51,  87,  80,  62,
-        18,  22,  37,  58,  68, 109, 103,  77,
-        24,  35,  55,  64,  81, 104, 113,  92,
-        49,  64,  78,  87, 103, 121, 120, 101,
-        72,  92,  95,  98, 112, 100, 103,  99
-};
-
-/* these coefficients dequantize intraframe C plane coefficients
- * (note: same as JPEG) */
-static const int16_t vp31_intra_c_dequant[64] =
-{       17,  18,     24,     47,     99,     99,     99,     99,
-        18,  21,     26,     66,     99,     99,     99,     99,
-        24,  26,     56,     99,     99,     99,     99,     99,
-        47,  66,     99,     99,     99,     99,     99,     99,
-        99,  99,     99,     99,     99,     99,     99,     99,
-        99,  99,     99,     99,     99,     99,     99,     99,
-        99,  99,     99,     99,     99,     99,     99,     99,
-        99,  99,     99,     99,     99,     99,     99,     99
-};
-
-/* these coefficients dequantize interframe coefficients (all planes) */
-static const int16_t vp31_inter_dequant[64] =
-{   16,  16,  16,  20,  24,  28,  32,  40,
-    16,  16,  20,  24,  28,  32,  40,  48,
-    16,  20,  24,  28,  32,  40,  48,  64,
-    20,  24,  28,  32,  40,  48,  64,  64,
-    24,  28,  32,  40,  48,  64,  64,  64,
-    28,  32,  40,  48,  64,  64,  64,  96,
-    32,  40,  48,  64,  64,  64,  96,  128,
-    40,  48,  64,  64,  64,  96,  128, 128
-};
-
-static const int16_t vp31_dc_scale_factor[64] =
-{ 220, 200, 190, 180, 170, 170, 160, 160,
-  150, 150, 140, 140, 130, 130, 120, 120,
-  110, 110, 100, 100, 90,  90,  90,  80,
-  80,  80,  70,  70,  70,  60,  60,  60,
-  60,  50,  50,  50,  50,  40,  40,  40,
-  40,  40,  30,  30,  30,  30,  30,  30,
-  30,  20,  20,  20,  20,  20,  20,  20,
-  20,  10,  10,  10,  10,  10,  10,  10
-};
-
-static const uint32_t vp31_ac_scale_factor[64] =
-{ 500,  450,  400,  370,  340,  310, 285, 265,
-  245,  225,  210,  195,  185,  180, 170, 160,
-  150,  145,  135,  130,  125,  115, 110, 107,
-  100,   96,   93,   89,   85,   82,  75,  74,
-   70,   68,   64,   60,   57,   56,  52,  50,
-   49,   45,   44,   43,   40,   38,  37,  35,
-   33,   32,   30,   29,   28,   25,  24,  22,
-   21,   19,   18,   17,   15,   13,  12,  10
-};
-
-static const uint8_t vp31_filter_limit_values[64] =
-{  30, 25, 20, 20, 15, 15, 14, 14,
-   13, 13, 12, 12, 11, 11, 10, 10,
-    9,  9,  8,  8,  7,  7,  7,  7,
-    6,  6,  6,  6,  5,  5,  5,  5,
-    4,  4,  4,  4,  3,  3,  3,  3,
-    2,  2,  2,  2,  2,  2,  2,  2,
-    0,  0,  0,  0,  0,  0,  0,  0,
-    0,  0,  0,  0,  0,  0,  0,  0
-};
-
-static const uint16_t superblock_run_length_vlc_table[34][2] = {
-    { 0, 1 },
-
-    { 4, 3 },    { 5, 3 },
-
-    { 0xC, 4 },  { 0xD, 4 },
-
-    { 0x38, 6 },    { 0x39, 6 },    { 0x3A, 6 },    { 0x3B, 6 },
-
-    { 0xF0, 8 },    { 0xF1, 8 },    { 0xF2, 8 },    { 0xF3, 8 },
-    { 0xF4, 8 },    { 0xF5, 8 },    { 0xF6, 8 },    { 0xF7, 8 },
-
-    { 0x3E0, 10 },    { 0x3E1, 10 },    { 0x3E2, 10 },    { 0x3E3, 10 },
-    { 0x3E4, 10 },    { 0x3E5, 10 },    { 0x3E6, 10 },    { 0x3E7, 10 },
-    { 0x3E8, 10 },    { 0x3E9, 10 },    { 0x3EA, 10 },    { 0x3EB, 10 },
-    { 0x3EC, 10 },    { 0x3ED, 10 },    { 0x3EE, 10 },    { 0x3EF, 10 },
-
-    { 0x3F, 6 }  /* this last VLC is a special case for reading 12 more
-                    bits from stream and adding the value 34 */
-};
-
-static const uint16_t fragment_run_length_vlc_table[30][2] = {
-    /* 1 -> 2 */
-    { 0x0, 2 },    { 0x1, 2 },
-
-    /* 3 -> 4 */
-    { 0x4, 3 },    { 0x5, 3 },
-
-    /* 5 -> 6 */
-    { 0xC, 4 },    { 0xD, 4 },
-
-    /* 7 -> 10 */
-    { 0x38, 6 },   { 0x39, 6 },
-    { 0x3A, 6 },   { 0x3B, 6 },
-
-    /* 11 -> 14 */
-    { 0x78, 7 },   { 0x79, 7 },
-    { 0x7A, 7 },   { 0x7B, 7 },
-
-    /* 15 -> 30 */
-    { 0x1F0, 9 },  { 0x1F1, 9 },  { 0x1F2, 9 },  { 0x1F3, 9 },
-    { 0x1F4, 9 },  { 0x1F5, 9 },  { 0x1F6, 9 },  { 0x1F7, 9 },
-    { 0x1F8, 9 },  { 0x1F9, 9 },  { 0x1FA, 9 },  { 0x1FB, 9 },
-    { 0x1FC, 9 },  { 0x1FD, 9 },  { 0x1FE, 9 },  { 0x1FF, 9 }
-};
-
-static const uint8_t mode_code_vlc_table[8][2] = {
-    { 0, 1 },      { 2, 2 },
-    { 6, 3 },      { 14, 4 },
-    { 30, 5 },     { 62, 6 },
-    { 126, 7 },    { 127, 7 }
-};
-
-static const uint8_t motion_vector_vlc_table[63][2] = {
-    { 0, 3 },
-    { 1, 3 },
-    { 2, 3 },
-
-    { 6, 4 },    { 7, 4 },
-
-    { 8, 4 },    { 9, 4 },
-
-    { 40, 6 },    { 41, 6 },    { 42, 6 },    { 43, 6 },
-    { 44, 6 },    { 45, 6 },    { 46, 6 },    { 47, 6 },
-
-    { 96, 7 },    { 97, 7 },    { 98, 7 },    { 99, 7 },
-    { 100, 7 },   { 101, 7 },   { 102, 7 },   { 103, 7 },
-    { 104, 7 },   { 105, 7 },   { 106, 7 },   { 107, 7 },
-    { 108, 7 },   { 109, 7 },   { 110, 7 },   { 111, 7 },
-
-    { 0xE0, 8 },  { 0xE1, 8 },  { 0xE2, 8 },  { 0xE3, 8 },
-    { 0xE4, 8 },  { 0xE5, 8 },  { 0xE6, 8 },  { 0xE7, 8 },
-    { 0xE8, 8 },  { 0xE9, 8 },  { 0xEA, 8 },  { 0xEB, 8 },
-    { 0xEC, 8 },  { 0xED, 8 },  { 0xEE, 8 },  { 0xEF, 8 },
-
-    { 0xF0, 8 },  { 0xF1, 8 },  { 0xF2, 8 },  { 0xF3, 8 },
-    { 0xF4, 8 },  { 0xF5, 8 },  { 0xF6, 8 },  { 0xF7, 8 },
-    { 0xF8, 8 },  { 0xF9, 8 },  { 0xFA, 8 },  { 0xFB, 8 },
-    { 0xFC, 8 },  { 0xFD, 8 },  { 0xFE, 8 },  { 0xFF, 8 }
-};
-
-static const int motion_vector_table[63] = {
-    0, 1, -1,
-    2, -2,
-    3, -3,
-    4, -4, 5, -5, 6, -6, 7, -7,
-    8, -8, 9, -9, 10, -10, 11, -11, 12, -12, 13, -13, 14, -14, 15, -15,
-    16, -16, 17, -17, 18, -18, 19, -19, 20, -20, 21, -21, 22, -22, 23, -23,
-    24, -24, 25, -25, 26, -26, 27, -27, 28, -28, 29, -29, 30, -30, 31, -31
-};
-
-static const int8_t fixed_motion_vector_table[64] = {
-   0,   0,   1,  -1,   2,  -2,   3,  -3,
-   4,  -4,   5,  -5,   6,  -6,   7,  -7,
-   8,  -8,   9,  -9,  10, -10,  11, -11,
-  12, -12,  13, -13,  14, -14,  15, -15,
-  16, -16,  17, -17,  18, -18,  19, -19,
-  20, -20,  21, -21,  22, -22,  23, -23,
-  24, -24,  25, -25,  26, -26,  27, -27,
-  28, -28,  29, -29,  30, -30,  31, -31
-};
-
-/* only tokens 0..6 indicate eob runs */
-static const int eob_run_base[7] = {
-    1, 2, 3, 4, 8, 16, 0
-};
-static const int eob_run_get_bits[7] = {
-    0, 0, 0, 2, 3, 4, 12
-};
-
-static const int zero_run_base[32] = {
-    0, 0, 0, 0, 0, 0, 0,  /* 0..6 are never used */
-    0, 0,  /* 7..8 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  /* 9..22 */
-    1, 2, 3, 4, 5,  /* 23..27 */
-    6, 10, 1, 2  /* 28..31 */
-};
-static const int zero_run_get_bits[32] = {
-    0, 0, 0, 0, 0, 0, 0,  /* 0..6 are never used */
-    3, 6,  /* 7..8 */
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  /* 9..22 */
-    0, 0, 0, 0, 0,  /* 23..27 */
-    2, 3, 0, 1  /* 28..31 */
-};
-
-static const int coeff_get_bits[32] = {
-    0, 0, 0, 0, 0, 0, 0,  /* 0..6 are never used */
-    0, 0, 0, 0, 0, 0,  /* 7..12 use constant coeffs */
-    1, 1, 1, 1,  /* 13..16 are constants but still need sign bit */
-    2, 3, 4, 5, 6, 10,  /* 17..22, for reading large coeffs */
-    1, 1, 1, 1, 1, 1, 1,  /* 23..29 are constants but still need sign bit */
-    2, 2  /* 30..31 */
-};
-
-static const int16_t coeff_table_token_7_8[1] = { 0 };
-static const int16_t coeff_table_token_9[1] = { 1 };
-static const int16_t coeff_table_token_10[1] = { -1 };
-static const int16_t coeff_table_token_11[1] = { 2 };
-static const int16_t coeff_table_token_12[1] = { -2 };
-
-static const int16_t coeff_table_token_13[2] = { 3, -3 };
-static const int16_t coeff_table_token_14[2] = { 4, -4 };
-static const int16_t coeff_table_token_15[2] = { 5, -5 };
-static const int16_t coeff_table_token_16[2] = { 6, -6 };
-
-static const int16_t coeff_table_token_23_24_25_26_27_28_29[2] = { 1, -1 };
-static const int16_t coeff_table_token_30[4] = { 2, 3, -2, -3 };
-static const int16_t coeff_table_token_31[4] = { 2, 3, -2, -3 };
-
-static const int16_t coeff_table_token_17[4] = {
-    7, 8, -7, -8
-};
-
-static const int16_t coeff_table_token_18[8] = {
-    9, 10, 11, 12, -9, -10, -11, -12
-};
-
-static const int16_t coeff_table_token_19[16] = {
-    13, 14, 15, 16, 17, 18, 19, 20, -13, -14, -15, -16, -17, -18, -19, -20
-};
-
-static const int16_t coeff_table_token_20[32] = {
-    21, 22, 23, 24, 25, 26, 27, 28,
-    29, 30, 31, 32, 33, 34, 35, 36,
-    -21, -22, -23, -24, -25, -26, -27, -28,
-    -29, -30, -31, -32, -33, -34, -35, -36
-};
-
-static const int16_t coeff_table_token_21[64] = {
-    37, 38, 39, 40, 41, 42, 43, 44,
-    45, 46, 47, 48, 49, 50, 51, 52,
-    53, 54, 55, 56, 57, 58, 59, 60,
-    61, 62, 63, 64, 65, 66, 67, 68,
-    -37, -38, -39, -40, -41, -42, -43, -44,
-    -45, -46, -47, -48, -49, -50, -51, -52,
-    -53, -54, -55, -56, -57, -58, -59, -60,
-    -61, -62, -63, -64, -65, -66, -67, -68
-};
-
-static const int16_t coeff_table_token_22[1024] = {
-    69, 70, 71, 72, 73, 74, 75, 76,
-    77, 78, 79, 80, 81, 82, 83, 84,
-    85, 86, 87, 88, 89, 90, 91, 92,
-    93, 94, 95, 96, 97, 98, 99, 100,
-    101, 102, 103, 104, 105, 106, 107, 108,
-    109, 110, 111, 112, 113, 114, 115, 116,
-    117, 118, 119, 120, 121, 122, 123, 124,
-    125, 126, 127, 128, 129, 130, 131, 132,
-    133, 134, 135, 136, 137, 138, 139, 140,
-    141, 142, 143, 144, 145, 146, 147, 148,
-    149, 150, 151, 152, 153, 154, 155, 156,
-    157, 158, 159, 160, 161, 162, 163, 164,
-    165, 166, 167, 168, 169, 170, 171, 172,
-    173, 174, 175, 176, 177, 178, 179, 180,
-    181, 182, 183, 184, 185, 186, 187, 188,
-    189, 190, 191, 192, 193, 194, 195, 196,
-    197, 198, 199, 200, 201, 202, 203, 204,
-    205, 206, 207, 208, 209, 210, 211, 212,
-    213, 214, 215, 216, 217, 218, 219, 220,
-    221, 222, 223, 224, 225, 226, 227, 228,
-    229, 230, 231, 232, 233, 234, 235, 236,
-    237, 238, 239, 240, 241, 242, 243, 244,
-    245, 246, 247, 248, 249, 250, 251, 252,
-    253, 254, 255, 256, 257, 258, 259, 260,
-    261, 262, 263, 264, 265, 266, 267, 268,
-    269, 270, 271, 272, 273, 274, 275, 276,
-    277, 278, 279, 280, 281, 282, 283, 284,
-    285, 286, 287, 288, 289, 290, 291, 292,
-    293, 294, 295, 296, 297, 298, 299, 300,
-    301, 302, 303, 304, 305, 306, 307, 308,
-    309, 310, 311, 312, 313, 314, 315, 316,
-    317, 318, 319, 320, 321, 322, 323, 324,
-    325, 326, 327, 328, 329, 330, 331, 332,
-    333, 334, 335, 336, 337, 338, 339, 340,
-    341, 342, 343, 344, 345, 346, 347, 348,
-    349, 350, 351, 352, 353, 354, 355, 356,
-    357, 358, 359, 360, 361, 362, 363, 364,
-    365, 366, 367, 368, 369, 370, 371, 372,
-    373, 374, 375, 376, 377, 378, 379, 380,
-    381, 382, 383, 384, 385, 386, 387, 388,
-    389, 390, 391, 392, 393, 394, 395, 396,
-    397, 398, 399, 400, 401, 402, 403, 404,
-    405, 406, 407, 408, 409, 410, 411, 412,
-    413, 414, 415, 416, 417, 418, 419, 420,
-    421, 422, 423, 424, 425, 426, 427, 428,
-    429, 430, 431, 432, 433, 434, 435, 436,
-    437, 438, 439, 440, 441, 442, 443, 444,
-    445, 446, 447, 448, 449, 450, 451, 452,
-    453, 454, 455, 456, 457, 458, 459, 460,
-    461, 462, 463, 464, 465, 466, 467, 468,
-    469, 470, 471, 472, 473, 474, 475, 476,
-    477, 478, 479, 480, 481, 482, 483, 484,
-    485, 486, 487, 488, 489, 490, 491, 492,
-    493, 494, 495, 496, 497, 498, 499, 500,
-    501, 502, 503, 504, 505, 506, 507, 508,
-    509, 510, 511, 512, 513, 514, 515, 516,
-    517, 518, 519, 520, 521, 522, 523, 524,
-    525, 526, 527, 528, 529, 530, 531, 532,
-    533, 534, 535, 536, 537, 538, 539, 540,
-    541, 542, 543, 544, 545, 546, 547, 548,
-    549, 550, 551, 552, 553, 554, 555, 556,
-    557, 558, 559, 560, 561, 562, 563, 564,
-    565, 566, 567, 568, 569, 570, 571, 572,
-    573, 574, 575, 576, 577, 578, 579, 580,
-    -69, -70, -71, -72, -73, -74, -75, -76,
-    -77, -78, -79, -80, -81, -82, -83, -84,
-    -85, -86, -87, -88, -89, -90, -91, -92,
-    -93, -94, -95, -96, -97, -98, -99, -100,
-    -101, -102, -103, -104, -105, -106, -107, -108,
-    -109, -110, -111, -112, -113, -114, -115, -116,
-    -117, -118, -119, -120, -121, -122, -123, -124,
-    -125, -126, -127, -128, -129, -130, -131, -132,
-    -133, -134, -135, -136, -137, -138, -139, -140,
-    -141, -142, -143, -144, -145, -146, -147, -148,
-    -149, -150, -151, -152, -153, -154, -155, -156,
-    -157, -158, -159, -160, -161, -162, -163, -164,
-    -165, -166, -167, -168, -169, -170, -171, -172,
-    -173, -174, -175, -176, -177, -178, -179, -180,
-    -181, -182, -183, -184, -185, -186, -187, -188,
-    -189, -190, -191, -192, -193, -194, -195, -196,
-    -197, -198, -199, -200, -201, -202, -203, -204,
-    -205, -206, -207, -208, -209, -210, -211, -212,
-    -213, -214, -215, -216, -217, -218, -219, -220,
-    -221, -222, -223, -224, -225, -226, -227, -228,
-    -229, -230, -231, -232, -233, -234, -235, -236,
-    -237, -238, -239, -240, -241, -242, -243, -244,
-    -245, -246, -247, -248, -249, -250, -251, -252,
-    -253, -254, -255, -256, -257, -258, -259, -260,
-    -261, -262, -263, -264, -265, -266, -267, -268,
-    -269, -270, -271, -272, -273, -274, -275, -276,
-    -277, -278, -279, -280, -281, -282, -283, -284,
-    -285, -286, -287, -288, -289, -290, -291, -292,
-    -293, -294, -295, -296, -297, -298, -299, -300,
-    -301, -302, -303, -304, -305, -306, -307, -308,
-    -309, -310, -311, -312, -313, -314, -315, -316,
-    -317, -318, -319, -320, -321, -322, -323, -324,
-    -325, -326, -327, -328, -329, -330, -331, -332,
-    -333, -334, -335, -336, -337, -338, -339, -340,
-    -341, -342, -343, -344, -345, -346, -347, -348,
-    -349, -350, -351, -352, -353, -354, -355, -356,
-    -357, -358, -359, -360, -361, -362, -363, -364,
-    -365, -366, -367, -368, -369, -370, -371, -372,
-    -373, -374, -375, -376, -377, -378, -379, -380,
-    -381, -382, -383, -384, -385, -386, -387, -388,
-    -389, -390, -391, -392, -393, -394, -395, -396,
-    -397, -398, -399, -400, -401, -402, -403, -404,
-    -405, -406, -407, -408, -409, -410, -411, -412,
-    -413, -414, -415, -416, -417, -418, -419, -420,
-    -421, -422, -423, -424, -425, -426, -427, -428,
-    -429, -430, -431, -432, -433, -434, -435, -436,
-    -437, -438, -439, -440, -441, -442, -443, -444,
-    -445, -446, -447, -448, -449, -450, -451, -452,
-    -453, -454, -455, -456, -457, -458, -459, -460,
-    -461, -462, -463, -464, -465, -466, -467, -468,
-    -469, -470, -471, -472, -473, -474, -475, -476,
-    -477, -478, -479, -480, -481, -482, -483, -484,
-    -485, -486, -487, -488, -489, -490, -491, -492,
-    -493, -494, -495, -496, -497, -498, -499, -500,
-    -501, -502, -503, -504, -505, -506, -507, -508,
-    -509, -510, -511, -512, -513, -514, -515, -516,
-    -517, -518, -519, -520, -521, -522, -523, -524,
-    -525, -526, -527, -528, -529, -530, -531, -532,
-    -533, -534, -535, -536, -537, -538, -539, -540,
-    -541, -542, -543, -544, -545, -546, -547, -548,
-    -549, -550, -551, -552, -553, -554, -555, -556,
-    -557, -558, -559, -560, -561, -562, -563, -564,
-    -565, -566, -567, -568, -569, -570, -571, -572,
-    -573, -574, -575, -576, -577, -578, -579, -580
-};
-
-static const int16_t *const coeff_tables[32] = {
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    coeff_table_token_7_8,
-
-    coeff_table_token_7_8,
-    coeff_table_token_9,
-    coeff_table_token_10,
-    coeff_table_token_11,
-    coeff_table_token_12,
-    coeff_table_token_13,
-    coeff_table_token_14,
-    coeff_table_token_15,
-
-    coeff_table_token_16,
-    coeff_table_token_17,
-    coeff_table_token_18,
-    coeff_table_token_19,
-    coeff_table_token_20,
-    coeff_table_token_21,
-    coeff_table_token_22,
-    coeff_table_token_23_24_25_26_27_28_29,
-
-    coeff_table_token_23_24_25_26_27_28_29,
-    coeff_table_token_23_24_25_26_27_28_29,
-    coeff_table_token_23_24_25_26_27_28_29,
-    coeff_table_token_23_24_25_26_27_28_29,
-    coeff_table_token_23_24_25_26_27_28_29,
-    coeff_table_token_23_24_25_26_27_28_29,
-    coeff_table_token_30,
-    coeff_table_token_31
-};
-
-static const uint16_t dc_bias[16][32][2] = {
-  {  /* DC bias table 0 */
-    { 0x2D, 6 },
-    { 0x26, 7 },
-    { 0x166, 9 },
-    { 0x4E, 8 },
-    { 0x2CE, 10 },
-    { 0x59E, 11 },
-    { 0x27D, 11 },
-    { 0x8, 5 },
-    { 0x4F9, 12 },
-    { 0xF, 4 },
-    { 0xE, 4 },
-    { 0x1B, 5 },
-    { 0x6, 4 },
-    { 0x8, 4 },
-    { 0x5, 4 },
-    { 0x1A, 5 },
-    { 0x15, 5 },
-    { 0x7, 4 },
-    { 0xC, 4 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0x9, 4 },
-    { 0x17, 5 },
-    { 0x29, 6 },
-    { 0x28, 6 },
-    { 0xB2, 8 },
-    { 0x4F8, 12 },
-    { 0x59F, 11 },
-    { 0x9E, 9 },
-    { 0x13F, 10 },
-    { 0x12, 6 },
-    { 0x58, 7 }
-  },
-  {  /* DC bias table 1 */
-    { 0x10, 5 },
-    { 0x47, 7 },
-    { 0x1FF, 9 },
-    { 0x8C, 8 },
-    { 0x3FC, 10 },
-    { 0x46A, 11 },
-    { 0x469, 11 },
-    { 0x22, 6 },
-    { 0x11A1, 13 },
-    { 0xE, 4 },
-    { 0xD, 4 },
-    { 0x4, 4 },
-    { 0x5, 4 },
-    { 0x9, 4 },
-    { 0x6, 4 },
-    { 0x1E, 5 },
-    { 0x16, 5 },
-    { 0x7, 4 },
-    { 0xC, 4 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0xA, 4 },
-    { 0x17, 5 },
-    { 0x7D, 7 },
-    { 0x7E, 7 },
-    { 0x11B, 9 },
-    { 0x8D1, 12 },
-    { 0x3FD, 10 },
-    { 0x46B, 11 },
-    { 0x11A0, 13 },
-    { 0x7C, 7 },
-    { 0xFE, 8 }
-  },
-  {  /* DC bias table 2 */
-    { 0x16, 5 },
-    { 0x20, 6 },
-    { 0x86, 8 },
-    { 0x87, 8 },
-    { 0x367, 10 },
-    { 0x6CC, 11 },
-    { 0x6CB, 11 },
-    { 0x6E, 7 },
-    { 0x366D, 14 },
-    { 0xF, 4 },
-    { 0xE, 4 },
-    { 0x4, 4 },
-    { 0x5, 4 },
-    { 0xA, 4 },
-    { 0x6, 4 },
-    { 0x1A, 5 },
-    { 0x11, 5 },
-    { 0x7, 4 },
-    { 0xC, 4 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0x9, 4 },
-    { 0x17, 5 },
-    { 0x6F, 7 },
-    { 0x6D, 7 },
-    { 0x364, 10 },
-    { 0xD9A, 12 },
-    { 0x6CA, 11 },
-    { 0x1B37, 13 },
-    { 0x366C, 14 },
-    { 0x42, 7 },
-    { 0xD8, 8 }
-  },
-  {  /* DC bias table 3 */
-    { 0x0, 4 },
-    { 0x2D, 6 },
-    { 0xF7, 8 },
-    { 0x58, 7 },
-    { 0x167, 9 },
-    { 0x2CB, 10 },
-    { 0x2CA, 10 },
-    { 0xE, 6 },
-    { 0x1661, 13 },
-    { 0x3, 3 },
-    { 0x2, 3 },
-    { 0x8, 4 },
-    { 0x9, 4 },
-    { 0xD, 4 },
-    { 0x2, 4 },
-    { 0x1F, 5 },
-    { 0x17, 5 },
-    { 0x1, 4 },
-    { 0xC, 4 },
-    { 0xE, 4 },
-    { 0xA, 4 },
-    { 0x6, 5 },
-    { 0x78, 7 },
-    { 0xF, 6 },
-    { 0x7A, 7 },
-    { 0x164, 9 },
-    { 0x599, 11 },
-    { 0x2CD, 10 },
-    { 0xB31, 12 },
-    { 0x1660, 13 },
-    { 0x79, 7 },
-    { 0xF6, 8 }
-  },
-  {  /* DC bias table 4 */
-    { 0x3, 4 },
-    { 0x3C, 6 },
-    { 0xF, 7 },
-    { 0x7A, 7 },
-    { 0x1D, 8 },
-    { 0x20, 9 },
-    { 0x72, 10 },
-    { 0x6, 6 },
-    { 0x399, 13 },
-    { 0x4, 3 },
-    { 0x5, 3 },
-    { 0x5, 4 },
-    { 0x6, 4 },
-    { 0xE, 4 },
-    { 0x4, 4 },
-    { 0x0, 4 },
-    { 0x19, 5 },
-    { 0x2, 4 },
-    { 0xD, 4 },
-    { 0x7, 4 },
-    { 0x1F, 5 },
-    { 0x30, 6 },
-    { 0x11, 8 },
-    { 0x31, 6 },
-    { 0x5, 6 },
-    { 0x21, 9 },
-    { 0xE7, 11 },
-    { 0x38, 9 },
-    { 0x1CD, 12 },
-    { 0x398, 13 },
-    { 0x7B, 7 },
-    { 0x9, 7 }
-  },
-  {  /* DC bias table 5 */
-    { 0x9, 4 },
-    { 0x2, 5 },
-    { 0x74, 7 },
-    { 0x7, 6 },
-    { 0xEC, 8 },
-    { 0xD1, 9 },
-    { 0x1A6, 10 },
-    { 0x6, 6 },
-    { 0xD21, 13 },
-    { 0x5, 3 },
-    { 0x6, 3 },
-    { 0x8, 4 },
-    { 0x7, 4 },
-    { 0xF, 4 },
-    { 0x4, 4 },
-    { 0x0, 4 },
-    { 0x1C, 5 },
-    { 0x2, 4 },
-    { 0x5, 4 },
-    { 0x3, 4 },
-    { 0xC, 5 },
-    { 0x35, 7 },
-    { 0x1A7, 10 },
-    { 0x1B, 6 },
-    { 0x77, 7 },
-    { 0x1A5, 10 },
-    { 0x349, 11 },
-    { 0xD0, 9 },
-    { 0x691, 12 },
-    { 0xD20, 13 },
-    { 0x75, 7 },
-    { 0xED, 8 }
-  },
-  {  /* DC bias table 6 */
-    { 0xA, 4 },
-    { 0xC, 5 },
-    { 0x12, 6 },
-    { 0x1B, 6 },
-    { 0xB7, 8 },
-    { 0x16C, 9 },
-    { 0x99, 9 },
-    { 0x5A, 7 },
-    { 0x16D8, 13 },
-    { 0x7, 3 },
-    { 0x6, 3 },
-    { 0x9, 4 },
-    { 0x8, 4 },
-    { 0x0, 3 },
-    { 0x5, 4 },
-    { 0x17, 5 },
-    { 0xE, 5 },
-    { 0x2, 4 },
-    { 0x3, 4 },
-    { 0xF, 5 },
-    { 0x1A, 6 },
-    { 0x4D, 8 },
-    { 0x2DB3, 14 },
-    { 0x2C, 6 },
-    { 0x11, 6 },
-    { 0x2DA, 10 },
-    { 0x5B7, 11 },
-    { 0x98, 9 },
-    { 0xB6D, 12 },
-    { 0x2DB2, 14 },
-    { 0x10, 6 },
-    { 0x27, 7 }
-  },
-  {  /* DC bias table 7 */
-    { 0xD, 4 },
-    { 0xF, 5 },
-    { 0x1D, 6 },
-    { 0x8, 5 },
-    { 0x51, 7 },
-    { 0x56, 8 },
-    { 0xAF, 9 },
-    { 0x2A, 7 },
-    { 0x148A, 13 },
-    { 0x7, 3 },
-    { 0x0, 2 },
-    { 0x8, 4 },
-    { 0x9, 4 },
-    { 0xC, 4 },
-    { 0x6, 4 },
-    { 0x17, 5 },
-    { 0xB, 5 },
-    { 0x16, 5 },
-    { 0x15, 5 },
-    { 0x9, 5 },
-    { 0x50, 7 },
-    { 0xAE, 9 },
-    { 0x2917, 14 },
-    { 0x1C, 6 },
-    { 0x14, 6 },
-    { 0x290, 10 },
-    { 0x523, 11 },
-    { 0x149, 9 },
-    { 0xA44, 12 },
-    { 0x2916, 14 },
-    { 0x53, 7 },
-    { 0xA5, 8 }
-  },
-  {  /* DC bias table 8 */
-    { 0x1, 4 },
-    { 0x1D, 6 },
-    { 0xF5, 8 },
-    { 0xF4, 8 },
-    { 0x24D, 10 },
-    { 0x499, 11 },
-    { 0x498, 11 },
-    { 0x1, 5 },
-    { 0x21, 6 },
-    { 0x6, 3 },
-    { 0x5, 3 },
-    { 0x6, 4 },
-    { 0x5, 4 },
-    { 0x2, 4 },
-    { 0x7, 5 },
-    { 0x25, 6 },
-    { 0x7B, 7 },
-    { 0x1C, 6 },
-    { 0x20, 6 },
-    { 0xD, 6 },
-    { 0x48, 7 },
-    { 0x92, 8 },
-    { 0x127, 9 },
-    { 0xE, 4 },
-    { 0x4, 4 },
-    { 0x11, 5 },
-    { 0xC, 6 },
-    { 0x3C, 6 },
-    { 0xF, 5 },
-    { 0x0, 5 },
-    { 0x1F, 5 },
-    { 0x13, 5 }
-  },
-  {  /* DC bias table 9 */
-    { 0x5, 4 },
-    { 0x3C, 6 },
-    { 0x40, 7 },
-    { 0xD, 7 },
-    { 0x31, 9 },
-    { 0x61, 10 },
-    { 0x60, 10 },
-    { 0x2, 5 },
-    { 0xF5, 8 },
-    { 0x6, 3 },
-    { 0x5, 3 },
-    { 0x7, 4 },
-    { 0x6, 4 },
-    { 0x2, 4 },
-    { 0x9, 5 },
-    { 0x25, 6 },
-    { 0x7, 6 },
-    { 0x21, 6 },
-    { 0x24, 6 },
-    { 0x10, 6 },
-    { 0x41, 7 },
-    { 0xF4, 8 },
-    { 0x19, 8 },
-    { 0xE, 4 },
-    { 0x3, 4 },
-    { 0x11, 5 },
-    { 0x11, 6 },
-    { 0x3F, 6 },
-    { 0x3E, 6 },
-    { 0x7B, 7 },
-    { 0x0, 4 },
-    { 0x13, 5 }
-  },
-  {  /* DC bias table 10 */
-    { 0xA, 4 },
-    { 0x7, 5 },
-    { 0x1, 6 },
-    { 0x9, 6 },
-    { 0x131, 9 },
-    { 0x261, 10 },
-    { 0x260, 10 },
-    { 0x15, 6 },
-    { 0x1, 7 },
-    { 0x7, 3 },
-    { 0x6, 3 },
-    { 0x8, 4 },
-    { 0x7, 4 },
-    { 0x6, 4 },
-    { 0x12, 5 },
-    { 0x2F, 6 },
-    { 0x14, 6 },
-    { 0x27, 6 },
-    { 0x2D, 6 },
-    { 0x16, 6 },
-    { 0x4D, 7 },
-    { 0x99, 8 },
-    { 0x0, 7 },
-    { 0x4, 4 },
-    { 0x1, 4 },
-    { 0x5, 5 },
-    { 0x17, 6 },
-    { 0x2E, 6 },
-    { 0x2C, 6 },
-    { 0x8, 6 },
-    { 0x6, 5 },
-    { 0x1, 5 }
-  },
-  {  /* DC bias table 11 */
-    { 0x0, 3 },
-    { 0xE, 5 },
-    { 0x17, 6 },
-    { 0x2A, 6 },
-    { 0x10, 7 },
-    { 0xF9, 10 },
-    { 0xF8, 10 },
-    { 0x1E, 7 },
-    { 0x3F, 8 },
-    { 0x7, 3 },
-    { 0x6, 3 },
-    { 0x9, 4 },
-    { 0x8, 4 },
-    { 0x6, 4 },
-    { 0xF, 5 },
-    { 0x5, 5 },
-    { 0x16, 6 },
-    { 0x29, 6 },
-    { 0x2B, 6 },
-    { 0x15, 6 },
-    { 0x50, 7 },
-    { 0x11, 7 },
-    { 0x7D, 9 },
-    { 0x4, 4 },
-    { 0x17, 5 },
-    { 0x6, 5 },
-    { 0x14, 6 },
-    { 0x2C, 6 },
-    { 0x2D, 6 },
-    { 0xE, 6 },
-    { 0x9, 6 },
-    { 0x51, 7 }
-  },
-  {  /* DC bias table 12 */
-    { 0x2, 3 },
-    { 0x18, 5 },
-    { 0x2F, 6 },
-    { 0xD, 5 },
-    { 0x53, 7 },
-    { 0x295, 10 },
-    { 0x294, 10 },
-    { 0xA4, 8 },
-    { 0x7C, 8 },
-    { 0x0, 2 },
-    { 0x7, 3 },
-    { 0x9, 4 },
-    { 0x8, 4 },
-    { 0x1B, 5 },
-    { 0xC, 5 },
-    { 0x28, 6 },
-    { 0x6A, 7 },
-    { 0x1E, 6 },
-    { 0x1D, 6 },
-    { 0x69, 7 },
-    { 0xD7, 8 },
-    { 0x7D, 8 },
-    { 0x14B, 9 },
-    { 0x19, 5 },
-    { 0x16, 5 },
-    { 0x2E, 6 },
-    { 0x1C, 6 },
-    { 0x2B, 6 },
-    { 0x2A, 6 },
-    { 0x68, 7 },
-    { 0x3F, 7 },
-    { 0xD6, 8 }
-  },
-  {  /* DC bias table 13 */
-    { 0x2, 3 },
-    { 0x1B, 5 },
-    { 0xC, 5 },
-    { 0x18, 5 },
-    { 0x29, 6 },
-    { 0x7F, 8 },
-    { 0x2F0, 10 },
-    { 0x198, 9 },
-    { 0x179, 9 },
-    { 0x0, 2 },
-    { 0x7, 3 },
-    { 0x9, 4 },
-    { 0x8, 4 },
-    { 0x1A, 5 },
-    { 0xD, 5 },
-    { 0x2A, 6 },
-    { 0x64, 7 },
-    { 0x1E, 6 },
-    { 0x67, 7 },
-    { 0x5F, 7 },
-    { 0xCD, 8 },
-    { 0x7E, 8 },
-    { 0x2F1, 10 },
-    { 0x16, 5 },
-    { 0xE, 5 },
-    { 0x2E, 6 },
-    { 0x65, 7 },
-    { 0x2B, 6 },
-    { 0x28, 6 },
-    { 0x3E, 7 },
-    { 0xBD, 8 },
-    { 0x199, 9 }
-  },
-  {  /* DC bias table 14 */
-    { 0x2, 3 },
-    { 0x7, 4 },
-    { 0x16, 5 },
-    { 0x6, 4 },
-    { 0x36, 6 },
-    { 0x5C, 7 },
-    { 0x15D, 9 },
-    { 0x15C, 9 },
-    { 0x2BF, 10 },
-    { 0x0, 2 },
-    { 0x7, 3 },
-    { 0x9, 4 },
-    { 0x8, 4 },
-    { 0x18, 5 },
-    { 0x34, 6 },
-    { 0x2A, 6 },
-    { 0x5E, 7 },
-    { 0x6A, 7 },
-    { 0x64, 7 },
-    { 0x5D, 7 },
-    { 0xCB, 8 },
-    { 0xAD, 8 },
-    { 0x2BE, 10 },
-    { 0x14, 5 },
-    { 0x33, 6 },
-    { 0x6E, 7 },
-    { 0x5F, 7 },
-    { 0x6F, 7 },
-    { 0x6B, 7 },
-    { 0xCA, 8 },
-    { 0xAC, 8 },
-    { 0x15E, 9 }
-  },
-  {  /* DC bias table 15 */
-    { 0xF, 4 },
-    { 0x1D, 5 },
-    { 0x18, 5 },
-    { 0xB, 4 },
-    { 0x19, 5 },
-    { 0x29, 6 },
-    { 0xD6, 8 },
-    { 0x551, 11 },
-    { 0xAA1, 12 },
-    { 0x1, 2 },
-    { 0x0, 2 },
-    { 0x9, 4 },
-    { 0x8, 4 },
-    { 0x1B, 5 },
-    { 0x38, 6 },
-    { 0x28, 6 },
-    { 0x57, 7 },
-    { 0x6A, 7 },
-    { 0x68, 7 },
-    { 0x56, 7 },
-    { 0xE5, 8 },
-    { 0x155, 9 },
-    { 0xAA0, 12 },
-    { 0x73, 7 },
-    { 0x69, 7 },
-    { 0xD7, 8 },
-    { 0xAB, 8 },
-    { 0xE4, 8 },
-    { 0xA9, 8 },
-    { 0x151, 9 },
-    { 0x150, 9 },
-    { 0x2A9, 10 }
-  }
-};
-
-static const uint16_t ac_bias_0[16][32][2] = {
-  {  /* AC bias group 1, table 0 */
-    { 0x8, 5 },
-    { 0x25, 7 },
-    { 0x17A, 9 },
-    { 0x2F7, 10 },
-    { 0xBDB, 12 },
-    { 0x17B4, 13 },
-    { 0x2F6B, 14 },
-    { 0x1D, 5 },
-    { 0x2F6A, 14 },
-    { 0x8, 4 },
-    { 0x7, 4 },
-    { 0x1, 4 },
-    { 0x2, 4 },
-    { 0xA, 4 },
-    { 0x6, 4 },
-    { 0x0, 4 },
-    { 0x1C, 5 },
-    { 0x9, 4 },
-    { 0xD, 4 },
-    { 0xF, 4 },
-    { 0xC, 4 },
-    { 0x3, 4 },
-    { 0xA, 5 },
-    { 0x16, 5 },
-    { 0x13, 6 },
-    { 0x5D, 7 },
-    { 0x24, 7 },
-    { 0xBC, 8 },
-    { 0x5C, 7 },
-    { 0x5EC, 11 },
-    { 0xB, 5 },
-    { 0x5F, 7 }
-  },
-  {  /* AC bias group 1, table 1 */
-    { 0xF, 5 },
-    { 0x10, 6 },
-    { 0x4B, 8 },
-    { 0xC6, 8 },
-    { 0x31D, 10 },
-    { 0xC71, 12 },
-    { 0xC70, 12 },
-    { 0x1, 4 },
-    { 0xC73, 12 },
-    { 0x8, 4 },
-    { 0x9, 4 },
-    { 0x2, 4 },
-    { 0x3, 4 },
-    { 0xB, 4 },
-    { 0x6, 4 },
-    { 0x0, 4 },
-    { 0x1C, 5 },
-    { 0x5, 4 },
-    { 0xD, 4 },
-    { 0xF, 4 },
-    { 0xA, 4 },
-    { 0x19, 5 },
-    { 0x13, 6 },
-    { 0x1D, 5 },
-    { 0x30, 6 },
-    { 0x62, 7 },
-    { 0x24, 7 },
-    { 0x4A, 8 },
-    { 0x18F, 9 },
-    { 0xC72, 12 },
-    { 0xE, 5 },
-    { 0x11, 6 }
-  },
-  {  /* AC bias group 1, table 2 */
-    { 0x1B, 5 },
-    { 0x3, 6 },
-    { 0x8D, 8 },
-    { 0x40, 7 },
-    { 0x239, 10 },
-    { 0x471, 11 },
-    { 0x8E0, 12 },
-    { 0x3, 4 },
-    { 0x11C3, 13 },
-    { 0xA, 4 },
-    { 0x9, 4 },
-    { 0x4, 4 },
-    { 0x5, 4 },
-    { 0xE, 4 },
-    { 0x7, 4 },
-    { 0x1, 4 },
-    { 0x1E, 5 },
-    { 0x6, 4 },
-    { 0xC, 4 },
-    { 0xB, 4 },
-    { 0x2, 4 },
-    { 0x0, 5 },
-    { 0x41, 7 },
-    { 0x1F, 5 },
-    { 0x22, 6 },
-    { 0x2, 6 },
-    { 0x8F, 8 },
-    { 0x8C, 8 },
-    { 0x11D, 9 },
-    { 0x11C2, 13 },
-    { 0x1A, 5 },
-    { 0x21, 6 }
-  },
-  {  /* AC bias group 1, table 3 */
-    { 0x1F, 5 },
-    { 0x3, 6 },
-    { 0x3, 7 },
-    { 0x43, 7 },
-    { 0xB, 9 },
-    { 0x15, 10 },
-    { 0x51, 12 },
-    { 0x3, 4 },
-    { 0x50, 12 },
-    { 0xD, 4 },
-    { 0xC, 4 },
-    { 0x4, 4 },
-    { 0x6, 4 },
-    { 0xE, 4 },
-    { 0xA, 4 },
-    { 0x1, 4 },
-    { 0x1E, 5 },
-    { 0x5, 4 },
-    { 0x9, 4 },
-    { 0x7, 4 },
-    { 0x11, 5 },
-    { 0x2, 6 },
-    { 0x4, 8 },
-    { 0x2, 4 },
-    { 0x2D, 6 },
-    { 0x20, 6 },
-    { 0x42, 7 },
-    { 0x1, 7 },
-    { 0x0, 7 },
-    { 0x29, 11 },
-    { 0x17, 5 },
-    { 0x2C, 6 }
-  },
-  {  /* AC bias group 1, table 4 */
-    { 0x3, 4 },
-    { 0x1F, 6 },
-    { 0x3A, 7 },
-    { 0x5D, 7 },
-    { 0x173, 9 },
-    { 0x2E4, 10 },
-    { 0x172D, 13 },
-    { 0x4, 4 },
-    { 0x172C, 13 },
-    { 0xF, 4 },
-    { 0xE, 4 },
-    { 0x9, 4 },
-    { 0x8, 4 },
-    { 0xC, 4 },
-    { 0xA, 4 },
-    { 0x1, 4 },
-    { 0x16, 5 },
-    { 0x2, 4 },
-    { 0x5, 4 },
-    { 0x1A, 5 },
-    { 0x2F, 6 },
-    { 0x38, 7 },
-    { 0x5CA, 11 },
-    { 0x6, 4 },
-    { 0x37, 6 },
-    { 0x1E, 6 },
-    { 0x3B, 7 },
-    { 0x39, 7 },
-    { 0xB8, 8 },
-    { 0xB97, 12 },
-    { 0x0, 4 },
-    { 0x36, 6 }
-  },
-  {  /* AC bias group 1, table 5 */
-    { 0x6, 4 },
-    { 0x37, 6 },
-    { 0x5D, 7 },
-    { 0xC, 6 },
-    { 0xB9, 8 },
-    { 0x2E3, 10 },
-    { 0x5C4, 11 },
-    { 0x4, 4 },
-    { 0x1715, 13 },
-    { 0x0, 3 },
-    { 0xF, 4 },
-    { 0x8, 4 },
-    { 0x7, 4 },
-    { 0xC, 4 },
-    { 0x9, 4 },
-    { 0x1D, 5 },
-    { 0x16, 5 },
-    { 0x1C, 5 },
-    { 0x1A, 5 },
-    { 0xB, 5 },
-    { 0x5E, 7 },
-    { 0x170, 9 },
-    { 0x1714, 13 },
-    { 0xA, 4 },
-    { 0xA, 5 },
-    { 0x36, 6 },
-    { 0x5F, 7 },
-    { 0x1B, 7 },
-    { 0x1A, 7 },
-    { 0xB8B, 12 },
-    { 0x2, 4 },
-    { 0x7, 5 }
-  },
-  {  /* AC bias group 1, table 6 */
-    { 0xC, 4 },
-    { 0xB, 5 },
-    { 0x79, 7 },
-    { 0x22, 6 },
-    { 0xF0, 8 },
-    { 0x119, 9 },
-    { 0x230, 10 },
-    { 0x1D, 5 },
-    { 0x8C4, 12 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0xA, 4 },
-    { 0x9, 4 },
-    { 0xB, 4 },
-    { 0x7, 4 },
-    { 0x1C, 5 },
-    { 0x3D, 6 },
-    { 0xD, 5 },
-    { 0x8, 5 },
-    { 0x15, 6 },
-    { 0x8D, 8 },
-    { 0x118B, 13 },
-    { 0x118A, 13 },
-    { 0xD, 4 },
-    { 0x10, 5 },
-    { 0x9, 5 },
-    { 0x14, 6 },
-    { 0x47, 7 },
-    { 0xF1, 8 },
-    { 0x463, 11 },
-    { 0x1F, 5 },
-    { 0xC, 5 }
-  },
-  {  /* AC bias group 1, table 7 */
-    { 0x0, 3 },
-    { 0x1A, 5 },
-    { 0x33, 6 },
-    { 0xC, 5 },
-    { 0x46, 7 },
-    { 0x1E3, 9 },
-    { 0x3C5, 10 },
-    { 0x17, 5 },
-    { 0x1E21, 13 },
-    { 0x2, 3 },
-    { 0x1, 3 },
-    { 0x9, 4 },
-    { 0xA, 4 },
-    { 0x7, 4 },
-    { 0x1B, 5 },
-    { 0x3D, 6 },
-    { 0x1B, 6 },
-    { 0x22, 6 },
-    { 0x79, 7 },
-    { 0xF0, 8 },
-    { 0x1E20, 13 },
-    { 0x1E23, 13 },
-    { 0x1E22, 13 },
-    { 0xE, 4 },
-    { 0x16, 5 },
-    { 0x18, 5 },
-    { 0x32, 6 },
-    { 0x1A, 6 },
-    { 0x47, 7 },
-    { 0x789, 11 },
-    { 0x1F, 5 },
-    { 0x10, 5 }
-  },
-  {  /* AC bias group 1, table 8 */
-    { 0x1D, 5 },
-    { 0x61, 7 },
-    { 0x4E, 8 },
-    { 0x9E, 9 },
-    { 0x27C, 11 },
-    { 0x9F5, 13 },
-    { 0x9F4, 13 },
-    { 0x3, 4 },
-    { 0x60, 7 },
-    { 0x0, 3 },
-    { 0xF, 4 },
-    { 0xB, 4 },
-    { 0xA, 4 },
-    { 0x9, 4 },
-    { 0x5, 4 },
-    { 0xD, 5 },
-    { 0x31, 6 },
-    { 0x8, 5 },
-    { 0x38, 6 },
-    { 0x12, 6 },
-    { 0x26, 7 },
-    { 0x13F, 10 },
-    { 0x4FB, 12 },
-    { 0xD, 4 },
-    { 0x2, 4 },
-    { 0xC, 5 },
-    { 0x39, 6 },
-    { 0x1C, 6 },
-    { 0xF, 5 },
-    { 0x1D, 6 },
-    { 0x8, 4 },
-    { 0x19, 5 }
-  },
-  {  /* AC bias group 1, table 9 */
-    { 0x7, 4 },
-    { 0x19, 6 },
-    { 0xAB, 8 },
-    { 0xAA, 8 },
-    { 0x119, 10 },
-    { 0x461, 12 },
-    { 0x460, 12 },
-    { 0x1B, 5 },
-    { 0x47, 8 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0xC, 4 },
-    { 0xB, 4 },
-    { 0x9, 4 },
-    { 0x5, 4 },
-    { 0xD, 5 },
-    { 0x35, 6 },
-    { 0x3D, 6 },
-    { 0x3C, 6 },
-    { 0x18, 6 },
-    { 0x22, 7 },
-    { 0x8D, 9 },
-    { 0x231, 11 },
-    { 0xE, 4 },
-    { 0x1F, 5 },
-    { 0x9, 5 },
-    { 0x2B, 6 },
-    { 0x10, 6 },
-    { 0x34, 6 },
-    { 0x54, 7 },
-    { 0x8, 4 },
-    { 0x14, 5 }
-  },
-  {  /* AC bias group 1, table 10 */
-    { 0xC, 4 },
-    { 0x5, 5 },
-    { 0x8, 6 },
-    { 0x5B, 7 },
-    { 0x4D, 9 },
-    { 0x131, 11 },
-    { 0x261, 12 },
-    { 0x1A, 5 },
-    { 0x12, 7 },
-    { 0x0, 3 },
-    { 0xF, 4 },
-    { 0xA, 4 },
-    { 0x9, 4 },
-    { 0x6, 4 },
-    { 0x1B, 5 },
-    { 0x6, 5 },
-    { 0x1C, 6 },
-    { 0x2C, 6 },
-    { 0x15, 6 },
-    { 0x5A, 7 },
-    { 0x27, 8 },
-    { 0x99, 10 },
-    { 0x260, 12 },
-    { 0xE, 4 },
-    { 0x4, 4 },
-    { 0xF, 5 },
-    { 0x7, 5 },
-    { 0x1D, 6 },
-    { 0xB, 5 },
-    { 0x14, 6 },
-    { 0x8, 4 },
-    { 0x17, 5 }
-  },
-  {  /* AC bias group 1, table 11 */
-    { 0xF, 4 },
-    { 0x13, 5 },
-    { 0x75, 7 },
-    { 0x24, 6 },
-    { 0x95, 8 },
-    { 0x251, 10 },
-    { 0x4A0, 11 },
-    { 0x10, 5 },
-    { 0xC8, 8 },
-    { 0x2, 3 },
-    { 0x1, 3 },
-    { 0x1, 4 },
-    { 0x0, 4 },
-    { 0x1A, 5 },
-    { 0x11, 5 },
-    { 0x2C, 6 },
-    { 0x65, 7 },
-    { 0x74, 7 },
-    { 0x4B, 7 },
-    { 0xC9, 8 },
-    { 0x129, 9 },
-    { 0x943, 12 },
-    { 0x942, 12 },
-    { 0x3, 3 },
-    { 0xA, 4 },
-    { 0x1C, 5 },
-    { 0x18, 5 },
-    { 0x33, 6 },
-    { 0x17, 5 },
-    { 0x2D, 6 },
-    { 0x1B, 5 },
-    { 0x3B, 6 }
-  },
-  {  /* AC bias group 1, table 12 */
-    { 0x3, 3 },
-    { 0x1A, 5 },
-    { 0x2D, 6 },
-    { 0x38, 6 },
-    { 0x28, 7 },
-    { 0x395, 10 },
-    { 0xE51, 12 },
-    { 0x37, 6 },
-    { 0xE4, 8 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0x1F, 5 },
-    { 0x1E, 5 },
-    { 0x17, 5 },
-    { 0x3A, 6 },
-    { 0x73, 7 },
-    { 0x2A, 7 },
-    { 0x2B, 7 },
-    { 0x29, 7 },
-    { 0x1CB, 9 },
-    { 0x729, 11 },
-    { 0x1CA1, 13 },
-    { 0x1CA0, 13 },
-    { 0x4, 3 },
-    { 0xA, 4 },
-    { 0x4, 4 },
-    { 0x18, 5 },
-    { 0x36, 6 },
-    { 0xB, 5 },
-    { 0x2C, 6 },
-    { 0x19, 5 },
-    { 0x3B, 6 }
-  },
-  {  /* AC bias group 1, table 13 */
-    { 0x4, 3 },
-    { 0x4, 4 },
-    { 0x3F, 6 },
-    { 0x17, 5 },
-    { 0x75, 7 },
-    { 0x1F5, 9 },
-    { 0x7D1, 11 },
-    { 0x17, 6 },
-    { 0x1F6, 9 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0x1B, 5 },
-    { 0x1A, 5 },
-    { 0xA, 5 },
-    { 0x32, 6 },
-    { 0x74, 7 },
-    { 0xF8, 8 },
-    { 0xF9, 8 },
-    { 0x1F7, 9 },
-    { 0x3E9, 10 },
-    { 0xFA0, 12 },
-    { 0x1F43, 13 },
-    { 0x1F42, 13 },
-    { 0x3, 3 },
-    { 0xA, 4 },
-    { 0x1E, 5 },
-    { 0x1C, 5 },
-    { 0x3B, 6 },
-    { 0x18, 5 },
-    { 0x16, 6 },
-    { 0x16, 5 },
-    { 0x33, 6 }
-  },
-  {  /* AC bias group 1, table 14 */
-    { 0x4, 3 },
-    { 0x7, 4 },
-    { 0x18, 5 },
-    { 0x1E, 5 },
-    { 0x36, 6 },
-    { 0x31, 7 },
-    { 0x177, 9 },
-    { 0x77, 7 },
-    { 0x176, 9 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0x1A, 5 },
-    { 0x19, 5 },
-    { 0x3A, 6 },
-    { 0x19, 6 },
-    { 0x5C, 7 },
-    { 0xBA, 8 },
-    { 0x61, 8 },
-    { 0xC1, 9 },
-    { 0x180, 10 },
-    { 0x302, 11 },
-    { 0x607, 12 },
-    { 0x606, 12 },
-    { 0x2, 3 },
-    { 0xA, 4 },
-    { 0x1F, 5 },
-    { 0x1C, 5 },
-    { 0x37, 6 },
-    { 0x16, 5 },
-    { 0x76, 7 },
-    { 0xD, 5 },
-    { 0x2F, 6 }
-  },
-  {  /* AC bias group 1, table 15 */
-    { 0x0, 3 },
-    { 0xA, 4 },
-    { 0x1A, 5 },
-    { 0xC, 4 },
-    { 0x1D, 5 },
-    { 0x39, 6 },
-    { 0x78, 7 },
-    { 0x5E, 7 },
-    { 0x393, 11 },
-    { 0x2, 3 },
-    { 0x1, 3 },
-    { 0x16, 5 },
-    { 0xF, 5 },
-    { 0x2E, 6 },
-    { 0x5F, 7 },
-    { 0x73, 8 },
-    { 0xE5, 9 },
-    { 0x1C8, 10 },
-    { 0xE4A, 13 },
-    { 0x1C97, 14 },
-    { 0x1C96, 14 },
-    { 0xE49, 13 },
-    { 0xE48, 13 },
-    { 0x4, 3 },
-    { 0x6, 4 },
-    { 0x1F, 5 },
-    { 0x1B, 5 },
-    { 0x1D, 6 },
-    { 0x38, 6 },
-    { 0x38, 7 },
-    { 0x3D, 6 },
-    { 0x79, 7 }
-  }
-};
-
-static const uint16_t ac_bias_1[16][32][2] = {
-  {  /* AC bias group 2, table 0 */
-    { 0xB, 5 },
-    { 0x2B, 7 },
-    { 0x54, 8 },
-    { 0x1B7, 9 },
-    { 0x6D9, 11 },
-    { 0xDB1, 12 },
-    { 0xDB0, 12 },
-    { 0x2, 4 },
-    { 0xAB, 9 },
-    { 0x9, 4 },
-    { 0xA, 4 },
-    { 0x7, 4 },
-    { 0x8, 4 },
-    { 0xF, 4 },
-    { 0xC, 4 },
-    { 0x3, 4 },
-    { 0x1D, 5 },
-    { 0x4, 4 },
-    { 0xB, 4 },
-    { 0x6, 4 },
-    { 0x1A, 5 },
-    { 0x3, 6 },
-    { 0xAA, 9 },
-    { 0x1, 4 },
-    { 0x0, 5 },
-    { 0x14, 6 },
-    { 0x6C, 7 },
-    { 0xDA, 8 },
-    { 0x2, 6 },
-    { 0x36D, 10 },
-    { 0x1C, 5 },
-    { 0x37, 6 }
-  },
-  {  /* AC bias group 2, table 1 */
-    { 0x1D, 5 },
-    { 0x4, 6 },
-    { 0xB6, 8 },
-    { 0x6A, 8 },
-    { 0x5B9, 11 },
-    { 0x16E1, 13 },
-    { 0x16E0, 13 },
-    { 0x7, 4 },
-    { 0x16F, 9 },
-    { 0xC, 4 },
-    { 0xD, 4 },
-    { 0x9, 4 },
-    { 0x8, 4 },
-    { 0xF, 4 },
-    { 0xA, 4 },
-    { 0x3, 4 },
-    { 0x17, 5 },
-    { 0x2, 4 },
-    { 0x4, 4 },
-    { 0x1C, 5 },
-    { 0x2C, 6 },
-    { 0x6B, 8 },
-    { 0xB71, 12 },
-    { 0x5, 4 },
-    { 0x3, 5 },
-    { 0x1B, 6 },
-    { 0x5A, 7 },
-    { 0x34, 7 },
-    { 0x5, 6 },
-    { 0x2DD, 10 },
-    { 0x0, 4 },
-    { 0xC, 5 }
-  },
-  {  /* AC bias group 2, table 2 */
-    { 0x3, 4 },
-    { 0x7F, 7 },
-    { 0xA1, 8 },
-    { 0xA0, 8 },
-    { 0x20C, 10 },
-    { 0x834, 12 },
-    { 0x106B, 13 },
-    { 0x7, 4 },
-    { 0x82, 8 },
-    { 0xE, 4 },
-    { 0xD, 4 },
-    { 0xB, 4 },
-    { 0xC, 4 },
-    { 0x0, 3 },
-    { 0x9, 4 },
-    { 0x2, 4 },
-    { 0x11, 5 },
-    { 0x1E, 5 },
-    { 0x15, 5 },
-    { 0x3E, 6 },
-    { 0x40, 7 },
-    { 0x41B, 11 },
-    { 0x106A, 13 },
-    { 0x6, 4 },
-    { 0xA, 5 },
-    { 0x29, 6 },
-    { 0x7E, 7 },
-    { 0x51, 7 },
-    { 0x21, 6 },
-    { 0x107, 9 },
-    { 0x4, 4 },
-    { 0xB, 5 }
-  },
-  {  /* AC bias group 2, table 3 */
-    { 0x7, 4 },
-    { 0x1B, 6 },
-    { 0xF6, 8 },
-    { 0xE9, 8 },
-    { 0x3A1, 10 },
-    { 0x740, 11 },
-    { 0xE82, 12 },
-    { 0x1F, 5 },
-    { 0x1EF, 9 },
-    { 0x1, 3 },
-    { 0x2, 3 },
-    { 0xB, 4 },
-    { 0xC, 4 },
-    { 0xD, 4 },
-    { 0x8, 4 },
-    { 0x1C, 5 },
-    { 0x3, 5 },
-    { 0x12, 5 },
-    { 0x2, 5 },
-    { 0x75, 7 },
-    { 0x1D1, 9 },
-    { 0x1D07, 13 },
-    { 0x1D06, 13 },
-    { 0xA, 4 },
-    { 0x13, 5 },
-    { 0x3B, 6 },
-    { 0x1A, 6 },
-    { 0x7A, 7 },
-    { 0x3C, 6 },
-    { 0x1EE, 9 },
-    { 0x0, 4 },
-    { 0xC, 5 }
-  },
-  {  /* AC bias group 2, table 4 */
-    { 0xD, 4 },
-    { 0x3D, 6 },
-    { 0x42, 7 },
-    { 0x37, 7 },
-    { 0xD9, 9 },
-    { 0x362, 11 },
-    { 0x6C6, 12 },
-    { 0x1F, 5 },
-    { 0x86, 8 },
-    { 0x1, 3 },
-    { 0x2, 3 },
-    { 0xC, 4 },
-    { 0xB, 4 },
-    { 0xA, 4 },
-    { 0x1, 4 },
-    { 0xF, 5 },
-    { 0x25, 6 },
-    { 0x3C, 6 },
-    { 0x1A, 6 },
-    { 0x87, 8 },
-    { 0x1B0, 10 },
-    { 0xD8F, 13 },
-    { 0xD8E, 13 },
-    { 0xE, 4 },
-    { 0x13, 5 },
-    { 0xC, 5 },
-    { 0x24, 6 },
-    { 0x20, 6 },
-    { 0x11, 5 },
-    { 0x6D, 8 },
-    { 0x0, 4 },
-    { 0xE, 5 }
-  },
-  {  /* AC bias group 2, table 5 */
-    { 0x0, 3 },
-    { 0x12, 5 },
-    { 0x76, 7 },
-    { 0x77, 7 },
-    { 0x14D, 9 },
-    { 0x533, 11 },
-    { 0x14C9, 13 },
-    { 0x13, 5 },
-    { 0xA5, 8 },
-    { 0x2, 3 },
-    { 0x3, 3 },
-    { 0xB, 4 },
-    { 0xC, 4 },
-    { 0x8, 4 },
-    { 0x1A, 5 },
-    { 0x2B, 6 },
-    { 0x75, 7 },
-    { 0x74, 7 },
-    { 0xA7, 8 },
-    { 0x298, 10 },
-    { 0x14C8, 13 },
-    { 0x14CB, 13 },
-    { 0x14CA, 13 },
-    { 0xF, 4 },
-    { 0x1C, 5 },
-    { 0x7, 5 },
-    { 0x2A, 6 },
-    { 0x28, 6 },
-    { 0x1B, 5 },
-    { 0xA4, 8 },
-    { 0x2, 4 },
-    { 0x6, 5 }
-  },
-  {  /* AC bias group 2, table 6 */
-    { 0x2, 3 },
-    { 0x1A, 5 },
-    { 0x2B, 6 },
-    { 0x3A, 6 },
-    { 0xED, 8 },
-    { 0x283, 10 },
-    { 0xA0A, 12 },
-    { 0x4, 5 },
-    { 0xA1, 8 },
-    { 0x4, 3 },
-    { 0x3, 3 },
-    { 0xB, 4 },
-    { 0xC, 4 },
-    { 0x1F, 5 },
-    { 0x6, 5 },
-    { 0x77, 7 },
-    { 0xA3, 8 },
-    { 0xA2, 8 },
-    { 0x140, 9 },
-    { 0x1417, 13 },
-    { 0x1416, 13 },
-    { 0xA09, 12 },
-    { 0xA08, 12 },
-    { 0x0, 3 },
-    { 0x1E, 5 },
-    { 0x7, 5 },
-    { 0x2A, 6 },
-    { 0x29, 6 },
-    { 0x1C, 5 },
-    { 0xEC, 8 },
-    { 0x1B, 5 },
-    { 0x5, 5 }
-  },
-  {  /* AC bias group 2, table 7 */
-    { 0x2, 3 },
-    { 0x2, 4 },
-    { 0x18, 5 },
-    { 0x1D, 5 },
-    { 0x35, 6 },
-    { 0xE4, 8 },
-    { 0x1CF, 11 },
-    { 0x1D, 7 },
-    { 0x72, 9 },
-    { 0x4, 3 },
-    { 0x5, 3 },
-    { 0x6, 4 },
-    { 0x7, 4 },
-    { 0x6, 5 },
-    { 0x73, 7 },
-    { 0x38, 8 },
-    { 0x1CE, 11 },
-    { 0x39B, 12 },
-    { 0x398, 12 },
-    { 0x733, 13 },
-    { 0x732, 13 },
-    { 0x735, 13 },
-    { 0x734, 13 },
-    { 0x0, 3 },
-    { 0x1F, 5 },
-    { 0x1B, 5 },
-    { 0x34, 6 },
-    { 0xF, 6 },
-    { 0x1E, 5 },
-    { 0xE5, 8 },
-    { 0x19, 5 },
-    { 0x38, 6 }
-  },
-  {  /* AC bias group 2, table 8 */
-    { 0x16, 5 },
-    { 0x50, 7 },
-    { 0x172, 9 },
-    { 0x2E7, 10 },
-    { 0x1732, 13 },
-    { 0x2E67, 14 },
-    { 0x2E66, 14 },
-    { 0x6, 4 },
-    { 0x51, 7 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0xD, 4 },
-    { 0xC, 4 },
-    { 0x9, 4 },
-    { 0x1C, 5 },
-    { 0x9, 5 },
-    { 0x1C, 6 },
-    { 0x1D, 6 },
-    { 0x5D, 7 },
-    { 0xB8, 8 },
-    { 0x5CD, 11 },
-    { 0x1731, 13 },
-    { 0x1730, 13 },
-    { 0xF, 4 },
-    { 0x5, 4 },
-    { 0xF, 5 },
-    { 0x8, 5 },
-    { 0x29, 6 },
-    { 0x1D, 5 },
-    { 0x2F, 6 },
-    { 0x8, 4 },
-    { 0x15, 5 }
-  },
-  {  /* AC bias group 2, table 9 */
-    { 0x9, 4 },
-    { 0x21, 6 },
-    { 0x40, 7 },
-    { 0xAD, 8 },
-    { 0x2B0, 10 },
-    { 0x1589, 13 },
-    { 0x1588, 13 },
-    { 0x1C, 5 },
-    { 0x5F, 7 },
-    { 0x0, 3 },
-    { 0xF, 4 },
-    { 0xD, 4 },
-    { 0xC, 4 },
-    { 0x6, 4 },
-    { 0x11, 5 },
-    { 0x2A, 6 },
-    { 0x57, 7 },
-    { 0x5E, 7 },
-    { 0x41, 7 },
-    { 0x159, 9 },
-    { 0x563, 11 },
-    { 0x158B, 13 },
-    { 0x158A, 13 },
-    { 0x1, 3 },
-    { 0x5, 4 },
-    { 0x14, 5 },
-    { 0x3B, 6 },
-    { 0x2E, 6 },
-    { 0x4, 4 },
-    { 0x3A, 6 },
-    { 0x7, 4 },
-    { 0x16, 5 }
-  },
-  {  /* AC bias group 2, table 10 */
-    { 0xE, 4 },
-    { 0x7, 5 },
-    { 0x46, 7 },
-    { 0x45, 7 },
-    { 0x64, 9 },
-    { 0x32A, 12 },
-    { 0x657, 13 },
-    { 0x18, 5 },
-    { 0xD, 6 },
-    { 0x0, 3 },
-    { 0xF, 4 },
-    { 0xA, 4 },
-    { 0xB, 4 },
-    { 0x1A, 5 },
-    { 0x36, 6 },
-    { 0x47, 7 },
-    { 0x44, 7 },
-    { 0x18, 7 },
-    { 0x33, 8 },
-    { 0xCB, 10 },
-    { 0x656, 13 },
-    { 0x329, 12 },
-    { 0x328, 12 },
-    { 0x2, 3 },
-    { 0x6, 4 },
-    { 0x19, 5 },
-    { 0xE, 5 },
-    { 0x37, 6 },
-    { 0x9, 4 },
-    { 0xF, 5 },
-    { 0x2, 4 },
-    { 0x10, 5 }
-  },
-  {  /* AC bias group 2, table 11 */
-    { 0x3, 3 },
-    { 0x18, 5 },
-    { 0x23, 6 },
-    { 0x77, 7 },
-    { 0x194, 9 },
-    { 0x1956, 13 },
-    { 0x32AF, 14 },
-    { 0x3A, 6 },
-    { 0x76, 7 },
-    { 0x2, 3 },
-    { 0x1, 3 },
-    { 0x1F, 5 },
-    { 0x1E, 5 },
-    { 0x14, 5 },
-    { 0x22, 6 },
-    { 0x64, 7 },
-    { 0x197, 9 },
-    { 0x196, 9 },
-    { 0x32B, 10 },
-    { 0x654, 11 },
-    { 0x32AE, 14 },
-    { 0x1955, 13 },
-    { 0x1954, 13 },
-    { 0x0, 3 },
-    { 0x9, 4 },
-    { 0x1C, 5 },
-    { 0x15, 5 },
-    { 0x10, 5 },
-    { 0xD, 4 },
-    { 0x17, 5 },
-    { 0x16, 5 },
-    { 0x33, 6 }
-  },
-  {  /* AC bias group 2, table 12 */
-    { 0x5, 3 },
-    { 0x6, 4 },
-    { 0x3E, 6 },
-    { 0x10, 5 },
-    { 0x48, 7 },
-    { 0x93F, 12 },
-    { 0x24FA, 14 },
-    { 0x32, 6 },
-    { 0x67, 7 },
-    { 0x2, 3 },
-    { 0x1, 3 },
-    { 0x1B, 5 },
-    { 0x1E, 5 },
-    { 0x34, 6 },
-    { 0x66, 7 },
-    { 0x92, 8 },
-    { 0x126, 9 },
-    { 0x24E, 10 },
-    { 0x49E, 11 },
-    { 0x49F7, 15 },
-    { 0x49F6, 15 },
-    { 0x24F9, 14 },
-    { 0x24F8, 14 },
-    { 0x0, 3 },
-    { 0x7, 4 },
-    { 0x18, 5 },
-    { 0x11, 5 },
-    { 0x3F, 6 },
-    { 0xE, 4 },
-    { 0x13, 5 },
-    { 0x35, 6 },
-    { 0x25, 6 }
-  },
-  {  /* AC bias group 2, table 13 */
-    { 0x5, 3 },
-    { 0x8, 4 },
-    { 0x12, 5 },
-    { 0x1C, 5 },
-    { 0x1C, 6 },
-    { 0xEA, 9 },
-    { 0x1D75, 14 },
-    { 0x1E, 6 },
-    { 0x66, 7 },
-    { 0x1, 3 },
-    { 0x2, 3 },
-    { 0x1B, 5 },
-    { 0x1A, 5 },
-    { 0x1F, 6 },
-    { 0x3B, 7 },
-    { 0x74, 8 },
-    { 0x1D6, 10 },
-    { 0x3AF, 11 },
-    { 0x1D74, 14 },
-    { 0x1D77, 14 },
-    { 0x1D76, 14 },
-    { 0xEB9, 13 },
-    { 0xEB8, 13 },
-    { 0xF, 4 },
-    { 0x6, 4 },
-    { 0x13, 5 },
-    { 0x3B, 6 },
-    { 0x3A, 6 },
-    { 0x0, 3 },
-    { 0x18, 5 },
-    { 0x32, 6 },
-    { 0x67, 7 }
-  },
-  {  /* AC bias group 2, table 14 */
-    { 0x4, 3 },
-    { 0xA, 4 },
-    { 0x1B, 5 },
-    { 0xC, 4 },
-    { 0xD, 5 },
-    { 0xE6, 8 },
-    { 0x684, 11 },
-    { 0x72, 7 },
-    { 0xE7, 8 },
-    { 0x2, 3 },
-    { 0x1, 3 },
-    { 0x17, 5 },
-    { 0x16, 5 },
-    { 0x18, 6 },
-    { 0xD1, 8 },
-    { 0x1A0, 9 },
-    { 0x686, 11 },
-    { 0xD0F, 12 },
-    { 0xD0A, 12 },
-    { 0x1A17, 13 },
-    { 0x1A16, 13 },
-    { 0x1A1D, 13 },
-    { 0x1A1C, 13 },
-    { 0xF, 4 },
-    { 0x1D, 5 },
-    { 0xE, 5 },
-    { 0x35, 6 },
-    { 0x38, 6 },
-    { 0x0, 3 },
-    { 0xF, 5 },
-    { 0x19, 6 },
-    { 0x69, 7 }
-  },
-  {  /* AC bias group 2, table 15 */
-    { 0x3, 3 },
-    { 0xC, 4 },
-    { 0x1B, 5 },
-    { 0x0, 3 },
-    { 0x3, 4 },
-    { 0x2E, 6 },
-    { 0x51, 9 },
-    { 0xBC, 8 },
-    { 0x53, 9 },
-    { 0x4, 3 },
-    { 0x2, 3 },
-    { 0x16, 5 },
-    { 0x15, 5 },
-    { 0x15, 7 },
-    { 0x50, 9 },
-    { 0xA4, 10 },
-    { 0x294, 12 },
-    { 0x52B, 13 },
-    { 0x52A, 13 },
-    { 0x52D, 13 },
-    { 0x52C, 13 },
-    { 0x52F, 13 },
-    { 0x52E, 13 },
-    { 0xE, 4 },
-    { 0x1A, 5 },
-    { 0x4, 5 },
-    { 0x28, 6 },
-    { 0x29, 6 },
-    { 0xF, 4 },
-    { 0xB, 6 },
-    { 0x5F, 7 },
-    { 0xBD, 8 }
-  }
-};
-
-static const uint16_t ac_bias_2[16][32][2] = {
-  {  /* AC bias group 3, table 0 */
-    { 0x3, 4 },
-    { 0x9, 6 },
-    { 0xD0, 8 },
-    { 0x1A3, 9 },
-    { 0x344, 10 },
-    { 0xD14, 12 },
-    { 0x1A2B, 13 },
-    { 0x4, 4 },
-    { 0x15, 7 },
-    { 0x0, 3 },
-    { 0xF, 4 },
-    { 0xB, 4 },
-    { 0xC, 4 },
-    { 0xE, 4 },
-    { 0x9, 4 },
-    { 0x1B, 5 },
-    { 0xA, 5 },
-    { 0x14, 5 },
-    { 0xD, 5 },
-    { 0x2A, 6 },
-    { 0x14, 7 },
-    { 0x68B, 11 },
-    { 0x1A2A, 13 },
-    { 0x8, 4 },
-    { 0xB, 5 },
-    { 0x2B, 6 },
-    { 0xB, 6 },
-    { 0x69, 7 },
-    { 0x35, 6 },
-    { 0x8, 6 },
-    { 0x7, 4 },
-    { 0xC, 5 }
-  },
-  {  /* AC bias group 3, table 1 */
-    { 0xA, 4 },
-    { 0x3C, 6 },
-    { 0x32, 7 },
-    { 0x30, 7 },
-    { 0xC5, 9 },
-    { 0x621, 12 },
-    { 0x620, 12 },
-    { 0x1F, 5 },
-    { 0x33, 7 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0xE, 4 },
-    { 0xD, 4 },
-    { 0xC, 4 },
-    { 0x4, 4 },
-    { 0xD, 5 },
-    { 0x26, 6 },
-    { 0x27, 6 },
-    { 0x14, 6 },
-    { 0x63, 8 },
-    { 0x189, 10 },
-    { 0x623, 12 },
-    { 0x622, 12 },
-    { 0xB, 4 },
-    { 0x12, 5 },
-    { 0x3D, 6 },
-    { 0x22, 6 },
-    { 0x15, 6 },
-    { 0xB, 5 },
-    { 0x23, 6 },
-    { 0x7, 4 },
-    { 0x10, 5 }
-  },
-  {  /* AC bias group 3, table 2 */
-    { 0xF, 4 },
-    { 0xC, 5 },
-    { 0x43, 7 },
-    { 0x10, 6 },
-    { 0x44, 8 },
-    { 0x114, 10 },
-    { 0x455, 12 },
-    { 0x18, 5 },
-    { 0x23, 7 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0xE, 4 },
-    { 0xD, 4 },
-    { 0x9, 4 },
-    { 0x19, 5 },
-    { 0x9, 5 },
-    { 0x17, 6 },
-    { 0x16, 6 },
-    { 0x42, 7 },
-    { 0x8B, 9 },
-    { 0x454, 12 },
-    { 0x457, 12 },
-    { 0x456, 12 },
-    { 0xB, 4 },
-    { 0x15, 5 },
-    { 0xA, 5 },
-    { 0x29, 6 },
-    { 0x20, 6 },
-    { 0xD, 5 },
-    { 0x28, 6 },
-    { 0x7, 4 },
-    { 0x11, 5 }
-  },
-  {  /* AC bias group 3, table 3 */
-    { 0x1, 3 },
-    { 0x1A, 5 },
-    { 0x29, 6 },
-    { 0x2A, 6 },
-    { 0xA0, 8 },
-    { 0x285, 10 },
-    { 0x1425, 13 },
-    { 0x2, 5 },
-    { 0x0, 7 },
-    { 0x2, 3 },
-    { 0x3, 3 },
-    { 0xC, 4 },
-    { 0xB, 4 },
-    { 0x8, 4 },
-    { 0x12, 5 },
-    { 0x1, 6 },
-    { 0x51, 7 },
-    { 0x1, 7 },
-    { 0x143, 9 },
-    { 0x508, 11 },
-    { 0x1424, 13 },
-    { 0x1427, 13 },
-    { 0x1426, 13 },
-    { 0xF, 4 },
-    { 0x1C, 5 },
-    { 0x3, 5 },
-    { 0x37, 6 },
-    { 0x2B, 6 },
-    { 0x13, 5 },
-    { 0x36, 6 },
-    { 0x1D, 5 },
-    { 0x1, 5 }
-  },
-  {  /* AC bias group 3, table 4 */
-    { 0x4, 3 },
-    { 0x1F, 5 },
-    { 0x3D, 6 },
-    { 0x6, 5 },
-    { 0x16, 7 },
-    { 0x53, 9 },
-    { 0x14A, 11 },
-    { 0x34, 6 },
-    { 0x2A, 8 },
-    { 0x2, 3 },
-    { 0x3, 3 },
-    { 0xB, 4 },
-    { 0xC, 4 },
-    { 0x1C, 5 },
-    { 0x37, 6 },
-    { 0x17, 7 },
-    { 0x2B, 8 },
-    { 0x28, 8 },
-    { 0xA4, 10 },
-    { 0x52D, 13 },
-    { 0x52C, 13 },
-    { 0x52F, 13 },
-    { 0x52E, 13 },
-    { 0x0, 3 },
-    { 0x1D, 5 },
-    { 0x7, 5 },
-    { 0x4, 5 },
-    { 0x35, 6 },
-    { 0x14, 5 },
-    { 0x36, 6 },
-    { 0x15, 5 },
-    { 0x3C, 6 }
-  },
-  {  /* AC bias group 3, table 5 */
-    { 0x4, 3 },
-    { 0xA, 4 },
-    { 0x7, 5 },
-    { 0x1D, 5 },
-    { 0x9, 6 },
-    { 0x1F3, 9 },
-    { 0x7C7, 11 },
-    { 0x8, 6 },
-    { 0x1F0, 9 },
-    { 0x3, 3 },
-    { 0x2, 3 },
-    { 0xD, 4 },
-    { 0xC, 4 },
-    { 0x17, 5 },
-    { 0x7D, 7 },
-    { 0x1F2, 9 },
-    { 0x7C6, 11 },
-    { 0x7C5, 11 },
-    { 0x1F12, 13 },
-    { 0x3E27, 14 },
-    { 0x3E26, 14 },
-    { 0x1F11, 13 },
-    { 0x1F10, 13 },
-    { 0x0, 3 },
-    { 0x1E, 5 },
-    { 0x6, 5 },
-    { 0x39, 6 },
-    { 0x38, 6 },
-    { 0x3F, 6 },
-    { 0x2C, 6 },
-    { 0x5, 5 },
-    { 0x2D, 6 }
-  },
-  {  /* AC bias group 3, table 6 */
-    { 0x2, 3 },
-    { 0x7, 4 },
-    { 0x18, 5 },
-    { 0x3, 4 },
-    { 0x5, 5 },
-    { 0x35, 7 },
-    { 0x4F, 9 },
-    { 0x12, 7 },
-    { 0x4E5, 13 },
-    { 0x5, 3 },
-    { 0x4, 3 },
-    { 0xD, 4 },
-    { 0xE, 4 },
-    { 0x33, 6 },
-    { 0x26, 8 },
-    { 0x9D, 10 },
-    { 0x4E4, 13 },
-    { 0x4E7, 13 },
-    { 0x4E6, 13 },
-    { 0x4E1, 13 },
-    { 0x4E0, 13 },
-    { 0x4E3, 13 },
-    { 0x4E2, 13 },
-    { 0x0, 3 },
-    { 0x1F, 5 },
-    { 0xC, 5 },
-    { 0x3D, 6 },
-    { 0x3C, 6 },
-    { 0x32, 6 },
-    { 0x34, 7 },
-    { 0x1B, 6 },
-    { 0x8, 6 }
-  },
-  {  /* AC bias group 3, table 7 */
-    { 0x0, 3 },
-    { 0x4, 4 },
-    { 0x1C, 5 },
-    { 0xF, 4 },
-    { 0x2, 4 },
-    { 0x7, 5 },
-    { 0x75, 7 },
-    { 0xE8, 8 },
-    { 0x1D2A, 13 },
-    { 0x5, 3 },
-    { 0x4, 3 },
-    { 0xD, 4 },
-    { 0xC, 4 },
-    { 0x77, 7 },
-    { 0xE96, 12 },
-    { 0x3A57, 14 },
-    { 0x3A56, 14 },
-    { 0x3A5D, 14 },
-    { 0x3A5C, 14 },
-    { 0x3A5F, 14 },
-    { 0x3A5E, 14 },
-    { 0x1D29, 13 },
-    { 0x1D28, 13 },
-    { 0x3, 3 },
-    { 0x6, 5 },
-    { 0xA, 5 },
-    { 0x2C, 7 },
-    { 0x17, 6 },
-    { 0x76, 7 },
-    { 0x1D3, 9 },
-    { 0x3A4, 10 },
-    { 0x2D, 7 }
-  },
-  {  /* AC bias group 3, table 8 */
-    { 0xA, 4 },
-    { 0x24, 6 },
-    { 0xBF, 8 },
-    { 0x85, 8 },
-    { 0x211, 10 },
-    { 0x842, 12 },
-    { 0x1087, 13 },
-    { 0x18, 5 },
-    { 0x20, 6 },
-    { 0x1, 3 },
-    { 0x2, 3 },
-    { 0xE, 4 },
-    { 0xD, 4 },
-    { 0x7, 4 },
-    { 0x13, 5 },
-    { 0x25, 6 },
-    { 0x5E, 7 },
-    { 0x43, 7 },
-    { 0xBE, 8 },
-    { 0x109, 9 },
-    { 0x1086, 13 },
-    { 0x841, 12 },
-    { 0x840, 12 },
-    { 0xF, 4 },
-    { 0x1, 4 },
-    { 0x11, 5 },
-    { 0x0, 5 },
-    { 0x2E, 6 },
-    { 0x19, 5 },
-    { 0x1, 5 },
-    { 0x6, 4 },
-    { 0x16, 5 }
-  },
-  {  /* AC bias group 3, table 9 */
-    { 0x2, 3 },
-    { 0xF, 5 },
-    { 0x6F, 7 },
-    { 0x61, 7 },
-    { 0x374, 10 },
-    { 0x1BA8, 13 },
-    { 0x3753, 14 },
-    { 0x12, 5 },
-    { 0x36, 6 },
-    { 0x0, 3 },
-    { 0x1, 3 },
-    { 0xA, 4 },
-    { 0xB, 4 },
-    { 0x1A, 5 },
-    { 0x31, 6 },
-    { 0x60, 7 },
-    { 0xDC, 8 },
-    { 0x1BB, 9 },
-    { 0x6EB, 11 },
-    { 0x1BAB, 13 },
-    { 0x3752, 14 },
-    { 0x3755, 14 },
-    { 0x3754, 14 },
-    { 0xE, 4 },
-    { 0x6, 4 },
-    { 0x13, 5 },
-    { 0xE, 5 },
-    { 0x3E, 6 },
-    { 0x8, 4 },
-    { 0x1E, 5 },
-    { 0x19, 5 },
-    { 0x3F, 6 }
-  },
-  {  /* AC bias group 3, table 10 */
-    { 0x3, 3 },
-    { 0x1C, 5 },
-    { 0x25, 6 },
-    { 0x24, 6 },
-    { 0x1DA, 9 },
-    { 0x1DBD, 13 },
-    { 0x3B7C, 14 },
-    { 0x3C, 6 },
-    { 0x3D, 6 },
-    { 0x0, 3 },
-    { 0x1, 3 },
-    { 0xB, 4 },
-    { 0xA, 4 },
-    { 0xB, 5 },
-    { 0x77, 7 },
-    { 0xEC, 8 },
-    { 0x3B6, 10 },
-    { 0x76E, 11 },
-    { 0x1DBF, 13 },
-    { 0x76FB, 15 },
-    { 0x76FA, 15 },
-    { 0x3B79, 14 },
-    { 0x3B78, 14 },
-    { 0xD, 4 },
-    { 0x1F, 5 },
-    { 0x13, 5 },
-    { 0xA, 5 },
-    { 0x8, 5 },
-    { 0xC, 4 },
-    { 0x8, 4 },
-    { 0x9, 5 },
-    { 0x3A, 6 }
-  },
-  {  /* AC bias group 3, table 11 */
-    { 0x5, 3 },
-    { 0x3, 4 },
-    { 0x4, 5 },
-    { 0x10, 5 },
-    { 0x8F, 8 },
-    { 0x475, 11 },
-    { 0x11D1, 13 },
-    { 0x79, 7 },
-    { 0x27, 6 },
-    { 0x2, 3 },
-    { 0x3, 3 },
-    { 0x1, 4 },
-    { 0x0, 4 },
-    { 0x26, 6 },
-    { 0x46, 7 },
-    { 0x11C, 9 },
-    { 0x477, 11 },
-    { 0x8ED, 12 },
-    { 0x11D0, 13 },
-    { 0x11D3, 13 },
-    { 0x11D2, 13 },
-    { 0x11D9, 13 },
-    { 0x11D8, 13 },
-    { 0xD, 4 },
-    { 0x1F, 5 },
-    { 0x12, 5 },
-    { 0x5, 5 },
-    { 0x3D, 6 },
-    { 0xC, 4 },
-    { 0xE, 4 },
-    { 0x22, 6 },
-    { 0x78, 7 }
-  },
-  {  /* AC bias group 3, table 12 */
-    { 0x5, 3 },
-    { 0xC, 4 },
-    { 0x1B, 5 },
-    { 0x0, 4 },
-    { 0x6, 6 },
-    { 0x3E2, 10 },
-    { 0x3E3D, 14 },
-    { 0xF, 7 },
-    { 0x34, 6 },
-    { 0x3, 3 },
-    { 0x2, 3 },
-    { 0x1E, 5 },
-    { 0x1D, 5 },
-    { 0x7D, 7 },
-    { 0x1F0, 9 },
-    { 0x7C6, 11 },
-    { 0x3E3C, 14 },
-    { 0x3E3F, 14 },
-    { 0x3E3E, 14 },
-    { 0x3E39, 14 },
-    { 0x3E38, 14 },
-    { 0x3E3B, 14 },
-    { 0x3E3A, 14 },
-    { 0x8, 4 },
-    { 0x1C, 5 },
-    { 0x2, 5 },
-    { 0x3F, 6 },
-    { 0x35, 6 },
-    { 0x9, 4 },
-    { 0x1, 3 },
-    { 0xE, 7 },
-    { 0xF9, 8 }
-  },
-  {  /* AC bias group 3, table 13 */
-    { 0x4, 3 },
-    { 0xB, 4 },
-    { 0x1, 4 },
-    { 0xA, 4 },
-    { 0x1E, 6 },
-    { 0xE0, 9 },
-    { 0xE1E, 13 },
-    { 0x71, 8 },
-    { 0x39, 7 },
-    { 0x7, 3 },
-    { 0x6, 3 },
-    { 0xD, 5 },
-    { 0xC, 5 },
-    { 0x20, 7 },
-    { 0x1C2, 10 },
-    { 0x1C3F, 14 },
-    { 0x1C3E, 14 },
-    { 0xE19, 13 },
-    { 0xE18, 13 },
-    { 0xE1B, 13 },
-    { 0xE1A, 13 },
-    { 0xE1D, 13 },
-    { 0xE1C, 13 },
-    { 0x0, 4 },
-    { 0x9, 5 },
-    { 0x1D, 6 },
-    { 0x1F, 6 },
-    { 0x11, 6 },
-    { 0x5, 4 },
-    { 0x1, 3 },
-    { 0x43, 8 },
-    { 0x42, 8 }
-  },
-  {  /* AC bias group 3, table 14 */
-    { 0x4, 3 },
-    { 0xD, 4 },
-    { 0x7, 4 },
-    { 0x2, 3 },
-    { 0x14, 5 },
-    { 0x16C, 9 },
-    { 0x16D1, 13 },
-    { 0x2DF, 10 },
-    { 0x16E, 9 },
-    { 0x0, 2 },
-    { 0x7, 3 },
-    { 0x2C, 6 },
-    { 0x2B, 6 },
-    { 0x2DE, 10 },
-    { 0x16D0, 13 },
-    { 0x16D3, 13 },
-    { 0x16D2, 13 },
-    { 0x2DB5, 14 },
-    { 0x2DB4, 14 },
-    { 0x2DB7, 14 },
-    { 0x2DB6, 14 },
-    { 0x16D9, 13 },
-    { 0x16D8, 13 },
-    { 0xC, 5 },
-    { 0x2A, 6 },
-    { 0x5A, 7 },
-    { 0x1B, 6 },
-    { 0x1A, 6 },
-    { 0x17, 5 },
-    { 0xC, 4 },
-    { 0x5B7, 11 },
-    { 0x5B5, 11 }
-  },
-  {  /* AC bias group 3, table 15 */
-    { 0x2, 2 },
-    { 0xF, 4 },
-    { 0x1C, 5 },
-    { 0xC, 4 },
-    { 0x3B, 6 },
-    { 0x1AC, 9 },
-    { 0x1AD8, 13 },
-    { 0x35B3, 14 },
-    { 0x35B2, 14 },
-    { 0x1, 2 },
-    { 0x0, 2 },
-    { 0x69, 7 },
-    { 0x68, 7 },
-    { 0x35BD, 14 },
-    { 0x35BC, 14 },
-    { 0x35BF, 14 },
-    { 0x35BE, 14 },
-    { 0x35B9, 14 },
-    { 0x35B8, 14 },
-    { 0x35BB, 14 },
-    { 0x35BA, 14 },
-    { 0x35B5, 14 },
-    { 0x35B4, 14 },
-    { 0x1A9, 9 },
-    { 0x1A8, 9 },
-    { 0x35A, 10 },
-    { 0xD7, 8 },
-    { 0xD5, 8 },
-    { 0x3A, 6 },
-    { 0x1B, 5 },
-    { 0x35B7, 14 },
-    { 0x35B6, 14 }
-  }
-};
-
-static const uint16_t ac_bias_3[16][32][2] = {
-  {  /* AC bias group 4, table 0 */
-    { 0x0, 3 },
-    { 0x10, 5 },
-    { 0x72, 7 },
-    { 0x71, 7 },
-    { 0x154, 9 },
-    { 0xAAB, 12 },
-    { 0xAA8, 12 },
-    { 0x14, 5 },
-    { 0x70, 7 },
-    { 0x2, 3 },
-    { 0x3, 3 },
-    { 0xC, 4 },
-    { 0xB, 4 },
-    { 0x3, 4 },
-    { 0x11, 5 },
-    { 0x73, 7 },
-    { 0x54, 7 },
-    { 0xAB, 8 },
-    { 0x2AB, 10 },
-    { 0x1553, 13 },
-    { 0x1552, 13 },
-    { 0x1555, 13 },
-    { 0x1554, 13 },
-    { 0xD, 4 },
-    { 0x1E, 5 },
-    { 0x12, 5 },
-    { 0x3E, 6 },
-    { 0x2B, 6 },
-    { 0x2, 4 },
-    { 0x3F, 6 },
-    { 0x1D, 5 },
-    { 0x13, 5 }
-  },
-  {  /* AC bias group 4, table 1 */
-    { 0x3, 3 },
-    { 0x1F, 5 },
-    { 0x29, 6 },
-    { 0x3D, 6 },
-    { 0xC, 7 },
-    { 0x69, 10 },
-    { 0x345, 13 },
-    { 0x2, 5 },
-    { 0x28, 6 },
-    { 0x2, 3 },
-    { 0x1, 3 },
-    { 0xE, 4 },
-    { 0xC, 4 },
-    { 0x15, 5 },
-    { 0x7, 6 },
-    { 0x1B, 8 },
-    { 0x6B, 10 },
-    { 0x6A, 10 },
-    { 0x344, 13 },
-    { 0x347, 13 },
-    { 0x346, 13 },
-    { 0x1A1, 12 },
-    { 0x1A0, 12 },
-    { 0xB, 4 },
-    { 0x1A, 5 },
-    { 0x12, 5 },
-    { 0x0, 5 },
-    { 0x3C, 6 },
-    { 0x8, 4 },
-    { 0x1B, 5 },
-    { 0x13, 5 },
-    { 0x1, 5 }
-  },
-  {  /* AC bias group 4, table 2 */
-    { 0x4, 3 },
-    { 0x4, 4 },
-    { 0x3F, 6 },
-    { 0x14, 5 },
-    { 0x56, 7 },
-    { 0x15C, 9 },
-    { 0x15D5, 13 },
-    { 0x3C, 6 },
-    { 0x2A, 6 },
-    { 0x0, 3 },
-    { 0x1, 3 },
-    { 0xE, 4 },
-    { 0xD, 4 },
-    { 0xC, 5 },
-    { 0xAF, 8 },
-    { 0x2BB, 10 },
-    { 0x15D4, 13 },
-    { 0x15D7, 13 },
-    { 0x15D6, 13 },
-    { 0x15D1, 13 },
-    { 0x15D0, 13 },
-    { 0x15D3, 13 },
-    { 0x15D2, 13 },
-    { 0xB, 4 },
-    { 0x19, 5 },
-    { 0xD, 5 },
-    { 0x3E, 6 },
-    { 0x31, 6 },
-    { 0x7, 4 },
-    { 0x5, 4 },
-    { 0x3D, 6 },
-    { 0x30, 6 }
-  },
-  {  /* AC bias group 4, table 3 */
-    { 0x5, 3 },
-    { 0x8, 4 },
-    { 0x1A, 5 },
-    { 0x0, 4 },
-    { 0x36, 6 },
-    { 0x11, 8 },
-    { 0x106, 12 },
-    { 0xA, 7 },
-    { 0x6E, 7 },
-    { 0x2, 3 },
-    { 0x3, 3 },
-    { 0x3, 4 },
-    { 0x2, 4 },
-    { 0x6F, 7 },
-    { 0x21, 9 },
-    { 0x20F, 13 },
-    { 0x20E, 13 },
-    { 0x101, 12 },
-    { 0x100, 12 },
-    { 0x103, 12 },
-    { 0x102, 12 },
-    { 0x105, 12 },
-    { 0x104, 12 },
-    { 0xC, 4 },
-    { 0x1E, 5 },
-    { 0x3, 5 },
-    { 0x3E, 6 },
-    { 0x3F, 6 },
-    { 0x9, 4 },
-    { 0xE, 4 },
-    { 0xB, 7 },
-    { 0x9, 7 }
-  },
-  {  /* AC bias group 4, table 4 */
-    { 0x2, 3 },
-    { 0xE, 4 },
-    { 0x1E, 5 },
-    { 0xC, 4 },
-    { 0x1F, 5 },
-    { 0x6E, 7 },
-    { 0xAD, 10 },
-    { 0xAF, 10 },
-    { 0x14, 7 },
-    { 0x4, 3 },
-    { 0x3, 3 },
-    { 0x1A, 5 },
-    { 0x17, 5 },
-    { 0x2A, 8 },
-    { 0x576, 13 },
-    { 0xAEF, 14 },
-    { 0xAEE, 14 },
-    { 0x571, 13 },
-    { 0x570, 13 },
-    { 0x573, 13 },
-    { 0x572, 13 },
-    { 0x575, 13 },
-    { 0x574, 13 },
-    { 0x3, 4 },
-    { 0x16, 5 },
-    { 0x4, 5 },
-    { 0x36, 6 },
-    { 0xB, 6 },
-    { 0xA, 4 },
-    { 0x0, 3 },
-    { 0x6F, 7 },
-    { 0xAC, 10 }
-  },
-  {  /* AC bias group 4, table 5 */
-    { 0x4, 3 },
-    { 0x5, 4 },
-    { 0x3, 3 },
-    { 0x1, 3 },
-    { 0x4, 4 },
-    { 0x2F, 6 },
-    { 0x526, 11 },
-    { 0x1495, 13 },
-    { 0xA6, 8 },
-    { 0x7, 3 },
-    { 0x6, 3 },
-    { 0x2D, 6 },
-    { 0x2C, 6 },
-    { 0x1494, 13 },
-    { 0x1497, 13 },
-    { 0x1496, 13 },
-    { 0x1491, 13 },
-    { 0x1490, 13 },
-    { 0x1493, 13 },
-    { 0x1492, 13 },
-    { 0x293D, 14 },
-    { 0x293C, 14 },
-    { 0x293F, 14 },
-    { 0x0, 3 },
-    { 0x28, 6 },
-    { 0xA5, 8 },
-    { 0x148, 9 },
-    { 0xA7, 8 },
-    { 0x2E, 6 },
-    { 0x15, 5 },
-    { 0xA4E, 12 },
-    { 0x293E, 14 }
-  },
-  {  /* AC bias group 4, table 6 */
-    { 0x4, 3 },
-    { 0x5, 4 },
-    { 0x3, 3 },
-    { 0x1, 3 },
-    { 0x4, 4 },
-    { 0x2F, 6 },
-    { 0x526, 11 },
-    { 0x1495, 13 },
-    { 0xA6, 8 },
-    { 0x7, 3 },
-    { 0x6, 3 },
-    { 0x2D, 6 },
-    { 0x2C, 6 },
-    { 0x1494, 13 },
-    { 0x1497, 13 },
-    { 0x1496, 13 },
-    { 0x1491, 13 },
-    { 0x1490, 13 },
-    { 0x1493, 13 },
-    { 0x1492, 13 },
-    { 0x293D, 14 },
-    { 0x293C, 14 },
-    { 0x293F, 14 },
-    { 0x0, 3 },
-    { 0x28, 6 },
-    { 0xA5, 8 },
-    { 0x148, 9 },
-    { 0xA7, 8 },
-    { 0x2E, 6 },
-    { 0x15, 5 },
-    { 0xA4E, 12 },
-    { 0x293E, 14 }
-  },
-  {  /* AC bias group 4, table 7 */
-    { 0x4, 3 },
-    { 0x5, 4 },
-    { 0x3, 3 },
-    { 0x1, 3 },
-    { 0x4, 4 },
-    { 0x2F, 6 },
-    { 0x526, 11 },
-    { 0x1495, 13 },
-    { 0xA6, 8 },
-    { 0x7, 3 },
-    { 0x6, 3 },
-    { 0x2D, 6 },
-    { 0x2C, 6 },
-    { 0x1494, 13 },
-    { 0x1497, 13 },
-    { 0x1496, 13 },
-    { 0x1491, 13 },
-    { 0x1490, 13 },
-    { 0x1493, 13 },
-    { 0x1492, 13 },
-    { 0x293D, 14 },
-    { 0x293C, 14 },
-    { 0x293F, 14 },
-    { 0x0, 3 },
-    { 0x28, 6 },
-    { 0xA5, 8 },
-    { 0x148, 9 },
-    { 0xA7, 8 },
-    { 0x2E, 6 },
-    { 0x15, 5 },
-    { 0xA4E, 12 },
-    { 0x293E, 14 }
-  },
-  {  /* AC bias group 4, table 8 */
-    { 0x3, 3 },
-    { 0x11, 5 },
-    { 0x20, 6 },
-    { 0x74, 7 },
-    { 0x10D, 9 },
-    { 0x863, 12 },
-    { 0x860, 12 },
-    { 0xA, 5 },
-    { 0x75, 7 },
-    { 0x1, 3 },
-    { 0x0, 3 },
-    { 0xB, 4 },
-    { 0xA, 4 },
-    { 0x18, 5 },
-    { 0x38, 6 },
-    { 0x42, 7 },
-    { 0x10F, 9 },
-    { 0x10E, 9 },
-    { 0x219, 10 },
-    { 0x10C3, 13 },
-    { 0x10C2, 13 },
-    { 0x10C5, 13 },
-    { 0x10C4, 13 },
-    { 0xF, 4 },
-    { 0x4, 4 },
-    { 0x19, 5 },
-    { 0xB, 5 },
-    { 0x39, 6 },
-    { 0x9, 4 },
-    { 0x1B, 5 },
-    { 0x1A, 5 },
-    { 0x3B, 6 }
-  },
-  {  /* AC bias group 4, table 9 */
-    { 0x5, 3 },
-    { 0x1, 4 },
-    { 0x3E, 6 },
-    { 0x1, 5 },
-    { 0xE2, 8 },
-    { 0x1C6F, 13 },
-    { 0x38D9, 14 },
-    { 0x39, 6 },
-    { 0x1F, 6 },
-    { 0x2, 3 },
-    { 0x1, 3 },
-    { 0x9, 4 },
-    { 0x8, 4 },
-    { 0x0, 5 },
-    { 0x70, 7 },
-    { 0x1C7, 9 },
-    { 0x38C, 10 },
-    { 0x71A, 11 },
-    { 0x38D8, 14 },
-    { 0x38DB, 14 },
-    { 0x38DA, 14 },
-    { 0x38DD, 14 },
-    { 0x38DC, 14 },
-    { 0xD, 4 },
-    { 0x1D, 5 },
-    { 0xE, 5 },
-    { 0x3F, 6 },
-    { 0x3C, 6 },
-    { 0xC, 4 },
-    { 0x6, 4 },
-    { 0x3D, 6 },
-    { 0x1E, 6 }
-  },
-  {  /* AC bias group 4, table 10 */
-    { 0x6, 3 },
-    { 0xB, 4 },
-    { 0x11, 5 },
-    { 0x1E, 5 },
-    { 0x74, 7 },
-    { 0x3AA, 10 },
-    { 0x1D5C, 13 },
-    { 0x1, 6 },
-    { 0x21, 6 },
-    { 0x1, 3 },
-    { 0x2, 3 },
-    { 0x7, 4 },
-    { 0x6, 4 },
-    { 0x3E, 6 },
-    { 0xEB, 8 },
-    { 0x1D4, 9 },
-    { 0xEAF, 12 },
-    { 0x3ABB, 14 },
-    { 0x3ABA, 14 },
-    { 0x1D59, 13 },
-    { 0x1D58, 13 },
-    { 0x1D5B, 13 },
-    { 0x1D5A, 13 },
-    { 0xA, 4 },
-    { 0x1C, 5 },
-    { 0x1, 5 },
-    { 0x3F, 6 },
-    { 0x3B, 6 },
-    { 0x1, 4 },
-    { 0x9, 4 },
-    { 0x20, 6 },
-    { 0x0, 6 }
-  },
-  {  /* AC bias group 4, table 11 */
-    { 0x4, 3 },
-    { 0xA, 4 },
-    { 0x17, 5 },
-    { 0x4, 4 },
-    { 0x16, 6 },
-    { 0x16A, 9 },
-    { 0x16B1, 13 },
-    { 0x17, 7 },
-    { 0x5B, 7 },
-    { 0x6, 3 },
-    { 0x7, 3 },
-    { 0x1, 4 },
-    { 0x0, 4 },
-    { 0xA, 6 },
-    { 0x2D7, 10 },
-    { 0xB5A, 12 },
-    { 0x16B0, 13 },
-    { 0x16B3, 13 },
-    { 0x16B2, 13 },
-    { 0x2D6D, 14 },
-    { 0x2D6C, 14 },
-    { 0x2D6F, 14 },
-    { 0x2D6E, 14 },
-    { 0x6, 4 },
-    { 0xA, 5 },
-    { 0x4, 5 },
-    { 0x2C, 6 },
-    { 0x17, 6 },
-    { 0x3, 4 },
-    { 0x7, 4 },
-    { 0x16, 7 },
-    { 0xB4, 8 }
-  },
-  {  /* AC bias group 4, table 12 */
-    { 0x5, 3 },
-    { 0xD, 4 },
-    { 0x5, 4 },
-    { 0x9, 4 },
-    { 0x33, 6 },
-    { 0x193, 9 },
-    { 0x192C, 13 },
-    { 0x61, 8 },
-    { 0x31, 7 },
-    { 0x0, 2 },
-    { 0x7, 3 },
-    { 0x10, 5 },
-    { 0x11, 5 },
-    { 0xC8, 8 },
-    { 0x192F, 13 },
-    { 0x325B, 14 },
-    { 0x325A, 14 },
-    { 0x1929, 13 },
-    { 0x1928, 13 },
-    { 0x192B, 13 },
-    { 0x192A, 13 },
-    { 0x325D, 14 },
-    { 0x325C, 14 },
-    { 0x18, 5 },
-    { 0x1A, 6 },
-    { 0x1B, 6 },
-    { 0x65, 7 },
-    { 0x19, 6 },
-    { 0x4, 4 },
-    { 0x7, 4 },
-    { 0x60, 8 },
-    { 0x324, 10 }
-  },
-  {  /* AC bias group 4, table 13 */
-    { 0x6, 3 },
-    { 0x0, 3 },
-    { 0x2, 4 },
-    { 0xF, 4 },
-    { 0x39, 6 },
-    { 0x1D9, 9 },
-    { 0x1D82, 13 },
-    { 0x761, 11 },
-    { 0x3BE, 10 },
-    { 0x1, 2 },
-    { 0x2, 2 },
-    { 0xF, 6 },
-    { 0xE, 6 },
-    { 0x762, 11 },
-    { 0x3B07, 14 },
-    { 0x3B06, 14 },
-    { 0x3B1D, 14 },
-    { 0x3B1C, 14 },
-    { 0x3B1F, 14 },
-    { 0x3B1E, 14 },
-    { 0x3B19, 14 },
-    { 0x3B18, 14 },
-    { 0x3B1B, 14 },
-    { 0x38, 6 },
-    { 0x1DE, 9 },
-    { 0xED, 8 },
-    { 0x3BF, 10 },
-    { 0xEE, 8 },
-    { 0x3A, 6 },
-    { 0x6, 5 },
-    { 0xEC0, 12 },
-    { 0x3B1A, 14 }
-  },
-  {  /* AC bias group 4, table 14 */
-    { 0x0, 2 },
-    { 0x2, 3 },
-    { 0xF, 5 },
-    { 0x6, 4 },
-    { 0x1C, 6 },
-    { 0x1D0, 10 },
-    { 0xE8C, 13 },
-    { 0x1D1B, 14 },
-    { 0x1D1A, 14 },
-    { 0x3, 2 },
-    { 0x2, 2 },
-    { 0xEA, 9 },
-    { 0xE9, 9 },
-    { 0xE89, 13 },
-    { 0xE88, 13 },
-    { 0xE8B, 13 },
-    { 0xE8A, 13 },
-    { 0x1D65, 14 },
-    { 0x1D64, 14 },
-    { 0x1D67, 14 },
-    { 0x1D66, 14 },
-    { 0x1D61, 14 },
-    { 0x1D60, 14 },
-    { 0x3AD, 11 },
-    { 0x1D63, 14 },
-    { 0x1D62, 14 },
-    { 0x1D1D, 14 },
-    { 0x1D1C, 14 },
-    { 0x3B, 7 },
-    { 0x1D7, 10 },
-    { 0x1D1F, 14 },
-    { 0x1D1E, 14 }
-  },
-  {  /* AC bias group 4, table 15 */
-    { 0x2, 2 },
-    { 0xF, 4 },
-    { 0x1C, 5 },
-    { 0xC, 4 },
-    { 0x3B, 6 },
-    { 0x1AC, 9 },
-    { 0x1AD8, 13 },
-    { 0x35B3, 14 },
-    { 0x35B2, 14 },
-    { 0x1, 2 },
-    { 0x0, 2 },
-    { 0x69, 7 },
-    { 0x68, 7 },
-    { 0x35BD, 14 },
-    { 0x35BC, 14 },
-    { 0x35BF, 14 },
-    { 0x35BE, 14 },
-    { 0x35B9, 14 },
-    { 0x35B8, 14 },
-    { 0x35BB, 14 },
-    { 0x35BA, 14 },
-    { 0x35B5, 14 },
-    { 0x35B4, 14 },
-    { 0x1A9, 9 },
-    { 0x1A8, 9 },
-    { 0x35A, 10 },
-    { 0xD7, 8 },
-    { 0xD5, 8 },
-    { 0x3A, 6 },
-    { 0x1B, 5 },
-    { 0x35B7, 14 },
-    { 0x35B6, 14 }
-  }
-};
-
-#endif /* AVCODEC_VP3DATA_H */
diff --git a/deps/libav/libavcodec/vp3dsp.c b/deps/libav/libavcodec/vp3dsp.c
deleted file mode 100644
index 94de0e5..0000000
--- a/deps/libav/libavcodec/vp3dsp.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (C) 2004 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Standard C DSP-oriented functions cribbed from the original VP3
- * source code.
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "rnd_avg.h"
-#include "vp3dsp.h"
-
-#define IdctAdjustBeforeShift 8
-#define xC1S7 64277
-#define xC2S6 60547
-#define xC3S5 54491
-#define xC4S4 46341
-#define xC5S3 36410
-#define xC6S2 25080
-#define xC7S1 12785
-
-#define M(a,b) (((a) * (b))>>16)
-
-static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type)
-{
-    int16_t *ip = input;
-
-    int A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H;
-    int Ed, Gd, Add, Bdd, Fd, Hd;
-
-    int i;
-
-    /* Inverse DCT on the rows now */
-    for (i = 0; i < 8; i++) {
-        /* Check for non-zero values */
-        if ( ip[0 * 8] | ip[1 * 8] | ip[2 * 8] | ip[3 * 8] |
-             ip[4 * 8] | ip[5 * 8] | ip[6 * 8] | ip[7 * 8] ) {
-            A = M(xC1S7, ip[1 * 8]) + M(xC7S1, ip[7 * 8]);
-            B = M(xC7S1, ip[1 * 8]) - M(xC1S7, ip[7 * 8]);
-            C = M(xC3S5, ip[3 * 8]) + M(xC5S3, ip[5 * 8]);
-            D = M(xC3S5, ip[5 * 8]) - M(xC5S3, ip[3 * 8]);
-
-            Ad = M(xC4S4, (A - C));
-            Bd = M(xC4S4, (B - D));
-
-            Cd = A + C;
-            Dd = B + D;
-
-            E = M(xC4S4, (ip[0 * 8] + ip[4 * 8]));
-            F = M(xC4S4, (ip[0 * 8] - ip[4 * 8]));
-
-            G = M(xC2S6, ip[2 * 8]) + M(xC6S2, ip[6 * 8]);
-            H = M(xC6S2, ip[2 * 8]) - M(xC2S6, ip[6 * 8]);
-
-            Ed = E - G;
-            Gd = E + G;
-
-            Add = F + Ad;
-            Bdd = Bd - H;
-
-            Fd = F - Ad;
-            Hd = Bd + H;
-
-            /*  Final sequence of operations over-write original inputs. */
-            ip[0 * 8] = Gd + Cd ;
-            ip[7 * 8] = Gd - Cd ;
-
-            ip[1 * 8] = Add + Hd;
-            ip[2 * 8] = Add - Hd;
-
-            ip[3 * 8] = Ed + Dd ;
-            ip[4 * 8] = Ed - Dd ;
-
-            ip[5 * 8] = Fd + Bdd;
-            ip[6 * 8] = Fd - Bdd;
-        }
-
-        ip += 1;            /* next row */
-    }
-
-    ip = input;
-
-    for ( i = 0; i < 8; i++) {
-        /* Check for non-zero values (bitwise or faster than ||) */
-        if ( ip[1] | ip[2] | ip[3] |
-             ip[4] | ip[5] | ip[6] | ip[7] ) {
-
-            A = M(xC1S7, ip[1]) + M(xC7S1, ip[7]);
-            B = M(xC7S1, ip[1]) - M(xC1S7, ip[7]);
-            C = M(xC3S5, ip[3]) + M(xC5S3, ip[5]);
-            D = M(xC3S5, ip[5]) - M(xC5S3, ip[3]);
-
-            Ad = M(xC4S4, (A - C));
-            Bd = M(xC4S4, (B - D));
-
-            Cd = A + C;
-            Dd = B + D;
-
-            E = M(xC4S4, (ip[0] + ip[4])) + 8;
-            F = M(xC4S4, (ip[0] - ip[4])) + 8;
-
-            if(type==1){  //HACK
-                E += 16*128;
-                F += 16*128;
-            }
-
-            G = M(xC2S6, ip[2]) + M(xC6S2, ip[6]);
-            H = M(xC6S2, ip[2]) - M(xC2S6, ip[6]);
-
-            Ed = E - G;
-            Gd = E + G;
-
-            Add = F + Ad;
-            Bdd = Bd - H;
-
-            Fd = F - Ad;
-            Hd = Bd + H;
-
-            /* Final sequence of operations over-write original inputs. */
-            if (type == 1) {
-                dst[0*stride] = av_clip_uint8((Gd + Cd )  >> 4);
-                dst[7*stride] = av_clip_uint8((Gd - Cd )  >> 4);
-
-                dst[1*stride] = av_clip_uint8((Add + Hd ) >> 4);
-                dst[2*stride] = av_clip_uint8((Add - Hd ) >> 4);
-
-                dst[3*stride] = av_clip_uint8((Ed + Dd )  >> 4);
-                dst[4*stride] = av_clip_uint8((Ed - Dd )  >> 4);
-
-                dst[5*stride] = av_clip_uint8((Fd + Bdd ) >> 4);
-                dst[6*stride] = av_clip_uint8((Fd - Bdd ) >> 4);
-            }else{
-                dst[0*stride] = av_clip_uint8(dst[0*stride] + ((Gd + Cd )  >> 4));
-                dst[7*stride] = av_clip_uint8(dst[7*stride] + ((Gd - Cd )  >> 4));
-
-                dst[1*stride] = av_clip_uint8(dst[1*stride] + ((Add + Hd ) >> 4));
-                dst[2*stride] = av_clip_uint8(dst[2*stride] + ((Add - Hd ) >> 4));
-
-                dst[3*stride] = av_clip_uint8(dst[3*stride] + ((Ed + Dd )  >> 4));
-                dst[4*stride] = av_clip_uint8(dst[4*stride] + ((Ed - Dd )  >> 4));
-
-                dst[5*stride] = av_clip_uint8(dst[5*stride] + ((Fd + Bdd ) >> 4));
-                dst[6*stride] = av_clip_uint8(dst[6*stride] + ((Fd - Bdd ) >> 4));
-            }
-
-        } else {
-            if (type == 1) {
-                dst[0*stride]=
-                dst[1*stride]=
-                dst[2*stride]=
-                dst[3*stride]=
-                dst[4*stride]=
-                dst[5*stride]=
-                dst[6*stride]=
-                dst[7*stride]= av_clip_uint8(128 + ((xC4S4 * ip[0] + (IdctAdjustBeforeShift<<16))>>20));
-            }else{
-                if(ip[0]){
-                    int v= ((xC4S4 * ip[0] + (IdctAdjustBeforeShift<<16))>>20);
-                    dst[0*stride] = av_clip_uint8(dst[0*stride] + v);
-                    dst[1*stride] = av_clip_uint8(dst[1*stride] + v);
-                    dst[2*stride] = av_clip_uint8(dst[2*stride] + v);
-                    dst[3*stride] = av_clip_uint8(dst[3*stride] + v);
-                    dst[4*stride] = av_clip_uint8(dst[4*stride] + v);
-                    dst[5*stride] = av_clip_uint8(dst[5*stride] + v);
-                    dst[6*stride] = av_clip_uint8(dst[6*stride] + v);
-                    dst[7*stride] = av_clip_uint8(dst[7*stride] + v);
-                }
-            }
-        }
-
-        ip += 8;            /* next column */
-        dst++;
-    }
-}
-
-static void vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size,
-                           int16_t *block/*align 16*/)
-{
-    idct(dest, line_size, block, 1);
-    memset(block, 0, sizeof(*block) * 64);
-}
-
-static void vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size,
-                           int16_t *block/*align 16*/)
-{
-    idct(dest, line_size, block, 2);
-    memset(block, 0, sizeof(*block) * 64);
-}
-
-static void vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size,
-                              int16_t *block/*align 16*/)
-{
-    int i, dc = (block[0] + 15) >> 5;
-
-    for(i = 0; i < 8; i++){
-        dest[0] = av_clip_uint8(dest[0] + dc);
-        dest[1] = av_clip_uint8(dest[1] + dc);
-        dest[2] = av_clip_uint8(dest[2] + dc);
-        dest[3] = av_clip_uint8(dest[3] + dc);
-        dest[4] = av_clip_uint8(dest[4] + dc);
-        dest[5] = av_clip_uint8(dest[5] + dc);
-        dest[6] = av_clip_uint8(dest[6] + dc);
-        dest[7] = av_clip_uint8(dest[7] + dc);
-        dest += line_size;
-    }
-    block[0] = 0;
-}
-
-static void vp3_v_loop_filter_c(uint8_t *first_pixel, int stride,
-                                int *bounding_values)
-{
-    unsigned char *end;
-    int filter_value;
-    const int nstride= -stride;
-
-    for (end= first_pixel + 8; first_pixel < end; first_pixel++) {
-        filter_value =
-            (first_pixel[2 * nstride] - first_pixel[ stride])
-         +3*(first_pixel[0          ] - first_pixel[nstride]);
-        filter_value = bounding_values[(filter_value + 4) >> 3];
-        first_pixel[nstride] = av_clip_uint8(first_pixel[nstride] + filter_value);
-        first_pixel[0] = av_clip_uint8(first_pixel[0] - filter_value);
-    }
-}
-
-static void vp3_h_loop_filter_c(uint8_t *first_pixel, int stride,
-                                int *bounding_values)
-{
-    unsigned char *end;
-    int filter_value;
-
-    for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) {
-        filter_value =
-            (first_pixel[-2] - first_pixel[ 1])
-         +3*(first_pixel[ 0] - first_pixel[-1]);
-        filter_value = bounding_values[(filter_value + 4) >> 3];
-        first_pixel[-1] = av_clip_uint8(first_pixel[-1] + filter_value);
-        first_pixel[ 0] = av_clip_uint8(first_pixel[ 0] - filter_value);
-    }
-}
-
-static void put_no_rnd_pixels_l2(uint8_t *dst, const uint8_t *src1,
-                                 const uint8_t *src2, ptrdiff_t stride, int h)
-{
-    int i;
-
-    for (i = 0; i < h; i++) {
-        uint32_t a, b;
-
-        a = AV_RN32(&src1[i * stride]);
-        b = AV_RN32(&src2[i * stride]);
-        AV_WN32A(&dst[i * stride], no_rnd_avg32(a, b));
-        a = AV_RN32(&src1[i * stride + 4]);
-        b = AV_RN32(&src2[i * stride + 4]);
-        AV_WN32A(&dst[i * stride + 4], no_rnd_avg32(a, b));
-    }
-}
-
-av_cold void ff_vp3dsp_init(VP3DSPContext *c, int flags)
-{
-    c->put_no_rnd_pixels_l2 = put_no_rnd_pixels_l2;
-
-    c->idct_put      = vp3_idct_put_c;
-    c->idct_add      = vp3_idct_add_c;
-    c->idct_dc_add   = vp3_idct_dc_add_c;
-    c->v_loop_filter = vp3_v_loop_filter_c;
-    c->h_loop_filter = vp3_h_loop_filter_c;
-
-    if (ARCH_ARM)
-        ff_vp3dsp_init_arm(c, flags);
-    if (ARCH_BFIN)
-        ff_vp3dsp_init_bfin(c, flags);
-    if (ARCH_PPC)
-        ff_vp3dsp_init_ppc(c, flags);
-    if (ARCH_X86)
-        ff_vp3dsp_init_x86(c, flags);
-}
diff --git a/deps/libav/libavcodec/vp3dsp.h b/deps/libav/libavcodec/vp3dsp.h
deleted file mode 100644
index 39c4408..0000000
--- a/deps/libav/libavcodec/vp3dsp.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VP3DSP_H
-#define AVCODEC_VP3DSP_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-typedef struct VP3DSPContext {
-    /**
-     * Copy 8xH pixels from source to destination buffer using a bilinear
-     * filter with no rounding (i.e. *dst = (*a + *b) >> 1).
-     *
-     * @param dst destination buffer, aligned by 8
-     * @param a first source buffer, no alignment
-     * @param b second source buffer, no alignment
-     * @param stride distance between two lines in source/dest buffers
-     * @param h height
-     */
-    void (*put_no_rnd_pixels_l2)(uint8_t *dst,
-                                 const uint8_t *a,
-                                 const uint8_t *b,
-                                 ptrdiff_t stride, int h);
-
-    void (*idct_put)(uint8_t *dest, int line_size, int16_t *block);
-    void (*idct_add)(uint8_t *dest, int line_size, int16_t *block);
-    void (*idct_dc_add)(uint8_t *dest, int line_size, int16_t *block);
-    void (*v_loop_filter)(uint8_t *src, int stride, int *bounding_values);
-    void (*h_loop_filter)(uint8_t *src, int stride, int *bounding_values);
-} VP3DSPContext;
-
-void ff_vp3dsp_init(VP3DSPContext *c, int flags);
-void ff_vp3dsp_init_arm(VP3DSPContext *c, int flags);
-void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags);
-void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags);
-void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags);
-
-#endif /* AVCODEC_VP3DSP_H */
diff --git a/deps/libav/libavcodec/vp5.c b/deps/libav/libavcodec/vp5.c
deleted file mode 100644
index b609282..0000000
--- a/deps/libav/libavcodec/vp5.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP5 compatible video decoder
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-
-#include "vp56.h"
-#include "vp56data.h"
-#include "vp5data.h"
-
-
-static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
-                            int *golden_frame)
-{
-    VP56RangeCoder *c = &s->c;
-    int rows, cols;
-
-    ff_vp56_init_range_decoder(&s->c, buf, buf_size);
-    s->frames[VP56_FRAME_CURRENT]->key_frame = !vp56_rac_get(c);
-    vp56_rac_get(c);
-    ff_vp56_init_dequant(s, vp56_rac_gets(c, 6));
-    if (s->frames[VP56_FRAME_CURRENT]->key_frame)
-    {
-        vp56_rac_gets(c, 8);
-        if(vp56_rac_gets(c, 5) > 5)
-            return AVERROR_INVALIDDATA;
-        vp56_rac_gets(c, 2);
-        if (vp56_rac_get(c)) {
-            av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n");
-            return AVERROR_PATCHWELCOME;
-        }
-        rows = vp56_rac_gets(c, 8);  /* number of stored macroblock rows */
-        cols = vp56_rac_gets(c, 8);  /* number of stored macroblock cols */
-        if (!rows || !cols) {
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid size %dx%d\n",
-                   cols << 4, rows << 4);
-            return AVERROR_INVALIDDATA;
-        }
-        vp56_rac_gets(c, 8);  /* number of displayed macroblock rows */
-        vp56_rac_gets(c, 8);  /* number of displayed macroblock cols */
-        vp56_rac_gets(c, 2);
-        if (!s->macroblocks || /* first frame */
-            16*cols != s->avctx->coded_width ||
-            16*rows != s->avctx->coded_height) {
-            int ret = ff_set_dimensions(s->avctx, 16 * cols, 16 * rows);
-            if (ret < 0)
-                return ret;
-            return VP56_SIZE_CHANGE;
-        }
-    } else if (!s->macroblocks)
-        return AVERROR_INVALIDDATA;
-    return 0;
-}
-
-static void vp5_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
-{
-    VP56RangeCoder *c = &s->c;
-    VP56Model *model = s->modelp;
-    int comp, di;
-
-    for (comp=0; comp<2; comp++) {
-        int delta = 0;
-        if (vp56_rac_get_prob(c, model->vector_dct[comp])) {
-            int sign = vp56_rac_get_prob(c, model->vector_sig[comp]);
-            di  = vp56_rac_get_prob(c, model->vector_pdi[comp][0]);
-            di |= vp56_rac_get_prob(c, model->vector_pdi[comp][1]) << 1;
-            delta = vp56_rac_get_tree(c, ff_vp56_pva_tree,
-                                      model->vector_pdv[comp]);
-            delta = di | (delta << 2);
-            delta = (delta ^ -sign) + sign;
-        }
-        if (!comp)
-            vect->x = delta;
-        else
-            vect->y = delta;
-    }
-}
-
-static void vp5_parse_vector_models(VP56Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-    VP56Model *model = s->modelp;
-    int comp, node;
-
-    for (comp=0; comp<2; comp++) {
-        if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][0]))
-            model->vector_dct[comp] = vp56_rac_gets_nn(c, 7);
-        if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][1]))
-            model->vector_sig[comp] = vp56_rac_gets_nn(c, 7);
-        if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][2]))
-            model->vector_pdi[comp][0] = vp56_rac_gets_nn(c, 7);
-        if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][3]))
-            model->vector_pdi[comp][1] = vp56_rac_gets_nn(c, 7);
-    }
-
-    for (comp=0; comp<2; comp++)
-        for (node=0; node<7; node++)
-            if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][4 + node]))
-                model->vector_pdv[comp][node] = vp56_rac_gets_nn(c, 7);
-}
-
-static int vp5_parse_coeff_models(VP56Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-    VP56Model *model = s->modelp;
-    uint8_t def_prob[11];
-    int node, cg, ctx;
-    int ct;    /* code type */
-    int pt;    /* plane type (0 for Y, 1 for U or V) */
-
-    memset(def_prob, 0x80, sizeof(def_prob));
-
-    for (pt=0; pt<2; pt++)
-        for (node=0; node<11; node++)
-            if (vp56_rac_get_prob(c, vp5_dccv_pct[pt][node])) {
-                def_prob[node] = vp56_rac_gets_nn(c, 7);
-                model->coeff_dccv[pt][node] = def_prob[node];
-            } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) {
-                model->coeff_dccv[pt][node] = def_prob[node];
-            }
-
-    for (ct=0; ct<3; ct++)
-        for (pt=0; pt<2; pt++)
-            for (cg=0; cg<6; cg++)
-                for (node=0; node<11; node++)
-                    if (vp56_rac_get_prob(c, vp5_ract_pct[ct][pt][cg][node])) {
-                        def_prob[node] = vp56_rac_gets_nn(c, 7);
-                        model->coeff_ract[pt][ct][cg][node] = def_prob[node];
-                    } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) {
-                        model->coeff_ract[pt][ct][cg][node] = def_prob[node];
-                    }
-
-    /* coeff_dcct is a linear combination of coeff_dccv */
-    for (pt=0; pt<2; pt++)
-        for (ctx=0; ctx<36; ctx++)
-            for (node=0; node<5; node++)
-                model->coeff_dcct[pt][ctx][node] = av_clip(((model->coeff_dccv[pt][node] * vp5_dccv_lc[node][ctx][0] + 128) >> 8) + vp5_dccv_lc[node][ctx][1], 1, 254);
-
-    /* coeff_acct is a linear combination of coeff_ract */
-    for (ct=0; ct<3; ct++)
-        for (pt=0; pt<2; pt++)
-            for (cg=0; cg<3; cg++)
-                for (ctx=0; ctx<6; ctx++)
-                    for (node=0; node<5; node++)
-                        model->coeff_acct[pt][ct][cg][ctx][node] = av_clip(((model->coeff_ract[pt][ct][cg][node] * vp5_ract_lc[ct][cg][node][ctx][0] + 128) >> 8) + vp5_ract_lc[ct][cg][node][ctx][1], 1, 254);
-    return 0;
-}
-
-static void vp5_parse_coeff(VP56Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-    VP56Model *model = s->modelp;
-    uint8_t *permute = s->idct_scantable;
-    uint8_t *model1, *model2;
-    int coeff, sign, coeff_idx;
-    int b, i, cg, idx, ctx, ctx_last;
-    int pt = 0;    /* plane type (0 for Y, 1 for U or V) */
-
-    for (b=0; b<6; b++) {
-        int ct = 1;    /* code type */
-
-        if (b > 3) pt = 1;
-
-        ctx = 6*s->coeff_ctx[ff_vp56_b6to4[b]][0]
-              + s->above_blocks[s->above_block_idx[b]].not_null_dc;
-        model1 = model->coeff_dccv[pt];
-        model2 = model->coeff_dcct[pt][ctx];
-
-        coeff_idx = 0;
-        for (;;) {
-            if (vp56_rac_get_prob(c, model2[0])) {
-                if (vp56_rac_get_prob(c, model2[2])) {
-                    if (vp56_rac_get_prob(c, model2[3])) {
-                        s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 4;
-                        idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1);
-                        sign = vp56_rac_get(c);
-                        coeff = ff_vp56_coeff_bias[idx+5];
-                        for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--)
-                            coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i;
-                    } else {
-                        if (vp56_rac_get_prob(c, model2[4])) {
-                            coeff = 3 + vp56_rac_get_prob(c, model1[5]);
-                            s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 3;
-                        } else {
-                            coeff = 2;
-                            s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 2;
-                        }
-                        sign = vp56_rac_get(c);
-                    }
-                    ct = 2;
-                } else {
-                    ct = 1;
-                    s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 1;
-                    sign = vp56_rac_get(c);
-                    coeff = 1;
-                }
-                coeff = (coeff ^ -sign) + sign;
-                if (coeff_idx)
-                    coeff *= s->dequant_ac;
-                s->block_coeff[b][permute[coeff_idx]] = coeff;
-            } else {
-                if (ct && !vp56_rac_get_prob(c, model2[1]))
-                    break;
-                ct = 0;
-                s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 0;
-            }
-            coeff_idx++;
-            if (coeff_idx >= 64)
-                break;
-
-            cg = vp5_coeff_groups[coeff_idx];
-            ctx = s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx];
-            model1 = model->coeff_ract[pt][ct][cg];
-            model2 = cg > 2 ? model1 : model->coeff_acct[pt][ct][cg][ctx];
-        }
-
-        ctx_last = FFMIN(s->coeff_ctx_last[ff_vp56_b6to4[b]], 24);
-        s->coeff_ctx_last[ff_vp56_b6to4[b]] = coeff_idx;
-        if (coeff_idx < ctx_last)
-            for (i=coeff_idx; i<=ctx_last; i++)
-                s->coeff_ctx[ff_vp56_b6to4[b]][i] = 5;
-        s->above_blocks[s->above_block_idx[b]].not_null_dc = s->coeff_ctx[ff_vp56_b6to4[b]][0];
-    }
-}
-
-static void vp5_default_models_init(VP56Context *s)
-{
-    VP56Model *model = s->modelp;
-    int i;
-
-    for (i=0; i<2; i++) {
-        model->vector_sig[i] = 0x80;
-        model->vector_dct[i] = 0x80;
-        model->vector_pdi[i][0] = 0x55;
-        model->vector_pdi[i][1] = 0x80;
-    }
-    memcpy(model->mb_types_stats, ff_vp56_def_mb_types_stats, sizeof(model->mb_types_stats));
-    memset(model->vector_pdv, 0x80, sizeof(model->vector_pdv));
-}
-
-static av_cold int vp5_decode_init(AVCodecContext *avctx)
-{
-    VP56Context *s = avctx->priv_data;
-    int ret;
-
-    if ((ret = ff_vp56_init(avctx, 1, 0)) < 0)
-        return ret;
-    s->vp56_coord_div = vp5_coord_div;
-    s->parse_vector_adjustment = vp5_parse_vector_adjustment;
-    s->parse_coeff = vp5_parse_coeff;
-    s->default_models_init = vp5_default_models_init;
-    s->parse_vector_models = vp5_parse_vector_models;
-    s->parse_coeff_models = vp5_parse_coeff_models;
-    s->parse_header = vp5_parse_header;
-
-    return 0;
-}
-
-AVCodec ff_vp5_decoder = {
-    .name           = "vp5",
-    .long_name      = NULL_IF_CONFIG_SMALL("On2 VP5"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VP5,
-    .priv_data_size = sizeof(VP56Context),
-    .init           = vp5_decode_init,
-    .close          = ff_vp56_free,
-    .decode         = ff_vp56_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/vp56.c b/deps/libav/libavcodec/vp56.c
deleted file mode 100644
index 7fbf9a0..0000000
--- a/deps/libav/libavcodec/vp56.c
+++ /dev/null
@@ -1,715 +0,0 @@
-/*
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP5 and VP6 compatible video decoder (common features)
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "h264chroma.h"
-#include "vp56.h"
-#include "vp56data.h"
-
-
-void ff_vp56_init_dequant(VP56Context *s, int quantizer)
-{
-    s->quantizer = quantizer;
-    s->dequant_dc = ff_vp56_dc_dequant[quantizer] << 2;
-    s->dequant_ac = ff_vp56_ac_dequant[quantizer] << 2;
-}
-
-static int vp56_get_vectors_predictors(VP56Context *s, int row, int col,
-                                       VP56Frame ref_frame)
-{
-    int nb_pred = 0;
-    VP56mv vect[2] = {{0,0}, {0,0}};
-    int pos, offset;
-    VP56mv mvp;
-
-    for (pos=0; pos<12; pos++) {
-        mvp.x = col + ff_vp56_candidate_predictor_pos[pos][0];
-        mvp.y = row + ff_vp56_candidate_predictor_pos[pos][1];
-        if (mvp.x < 0 || mvp.x >= s->mb_width ||
-            mvp.y < 0 || mvp.y >= s->mb_height)
-            continue;
-        offset = mvp.x + s->mb_width*mvp.y;
-
-        if (ff_vp56_reference_frame[s->macroblocks[offset].type] != ref_frame)
-            continue;
-        if ((s->macroblocks[offset].mv.x == vect[0].x &&
-             s->macroblocks[offset].mv.y == vect[0].y) ||
-            (s->macroblocks[offset].mv.x == 0 &&
-             s->macroblocks[offset].mv.y == 0))
-            continue;
-
-        vect[nb_pred++] = s->macroblocks[offset].mv;
-        if (nb_pred > 1) {
-            nb_pred = -1;
-            break;
-        }
-        s->vector_candidate_pos = pos;
-    }
-
-    s->vector_candidate[0] = vect[0];
-    s->vector_candidate[1] = vect[1];
-
-    return nb_pred+1;
-}
-
-static void vp56_parse_mb_type_models(VP56Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-    VP56Model *model = s->modelp;
-    int i, ctx, type;
-
-    for (ctx=0; ctx<3; ctx++) {
-        if (vp56_rac_get_prob(c, 174)) {
-            int idx = vp56_rac_gets(c, 4);
-            memcpy(model->mb_types_stats[ctx],
-                   ff_vp56_pre_def_mb_type_stats[idx][ctx],
-                   sizeof(model->mb_types_stats[ctx]));
-        }
-        if (vp56_rac_get_prob(c, 254)) {
-            for (type=0; type<10; type++) {
-                for(i=0; i<2; i++) {
-                    if (vp56_rac_get_prob(c, 205)) {
-                        int delta, sign = vp56_rac_get(c);
-
-                        delta = vp56_rac_get_tree(c, ff_vp56_pmbtm_tree,
-                                                  ff_vp56_mb_type_model_model);
-                        if (!delta)
-                            delta = 4 * vp56_rac_gets(c, 7);
-                        model->mb_types_stats[ctx][type][i] += (delta ^ -sign) + sign;
-                    }
-                }
-            }
-        }
-    }
-
-    /* compute MB type probability tables based on previous MB type */
-    for (ctx=0; ctx<3; ctx++) {
-        int p[10];
-
-        for (type=0; type<10; type++)
-            p[type] = 100 * model->mb_types_stats[ctx][type][1];
-
-        for (type=0; type<10; type++) {
-            int p02, p34, p0234, p17, p56, p89, p5689, p156789;
-
-            /* conservative MB type probability */
-            model->mb_type[ctx][type][0] = 255 - (255 * model->mb_types_stats[ctx][type][0]) / (1 + model->mb_types_stats[ctx][type][0] + model->mb_types_stats[ctx][type][1]);
-
-            p[type] = 0;    /* same MB type => weight is null */
-
-            /* binary tree parsing probabilities */
-            p02 = p[0] + p[2];
-            p34 = p[3] + p[4];
-            p0234 = p02 + p34;
-            p17 = p[1] + p[7];
-            p56 = p[5] + p[6];
-            p89 = p[8] + p[9];
-            p5689 = p56 + p89;
-            p156789 = p17 + p5689;
-
-            model->mb_type[ctx][type][1] = 1 + 255 * p0234/(1+p0234+p156789);
-            model->mb_type[ctx][type][2] = 1 + 255 * p02  / (1+p0234);
-            model->mb_type[ctx][type][3] = 1 + 255 * p17  / (1+p156789);
-            model->mb_type[ctx][type][4] = 1 + 255 * p[0] / (1+p02);
-            model->mb_type[ctx][type][5] = 1 + 255 * p[3] / (1+p34);
-            model->mb_type[ctx][type][6] = 1 + 255 * p[1] / (1+p17);
-            model->mb_type[ctx][type][7] = 1 + 255 * p56  / (1+p5689);
-            model->mb_type[ctx][type][8] = 1 + 255 * p[5] / (1+p56);
-            model->mb_type[ctx][type][9] = 1 + 255 * p[8] / (1+p89);
-
-            /* restore initial value */
-            p[type] = 100 * model->mb_types_stats[ctx][type][1];
-        }
-    }
-}
-
-static VP56mb vp56_parse_mb_type(VP56Context *s,
-                                 VP56mb prev_type, int ctx)
-{
-    uint8_t *mb_type_model = s->modelp->mb_type[ctx][prev_type];
-    VP56RangeCoder *c = &s->c;
-
-    if (vp56_rac_get_prob(c, mb_type_model[0]))
-        return prev_type;
-    else
-        return vp56_rac_get_tree(c, ff_vp56_pmbt_tree, mb_type_model);
-}
-
-static void vp56_decode_4mv(VP56Context *s, int row, int col)
-{
-    VP56mv mv = {0,0};
-    int type[4];
-    int b;
-
-    /* parse each block type */
-    for (b=0; b<4; b++) {
-        type[b] = vp56_rac_gets(&s->c, 2);
-        if (type[b])
-            type[b]++;  /* only returns 0, 2, 3 or 4 (all INTER_PF) */
-    }
-
-    /* get vectors */
-    for (b=0; b<4; b++) {
-        switch (type[b]) {
-            case VP56_MB_INTER_NOVEC_PF:
-                s->mv[b] = (VP56mv) {0,0};
-                break;
-            case VP56_MB_INTER_DELTA_PF:
-                s->parse_vector_adjustment(s, &s->mv[b]);
-                break;
-            case VP56_MB_INTER_V1_PF:
-                s->mv[b] = s->vector_candidate[0];
-                break;
-            case VP56_MB_INTER_V2_PF:
-                s->mv[b] = s->vector_candidate[1];
-                break;
-        }
-        mv.x += s->mv[b].x;
-        mv.y += s->mv[b].y;
-    }
-
-    /* this is the one selected for the whole MB for prediction */
-    s->macroblocks[row * s->mb_width + col].mv = s->mv[3];
-
-    /* chroma vectors are average luma vectors */
-    if (s->avctx->codec->id == AV_CODEC_ID_VP5) {
-        s->mv[4].x = s->mv[5].x = RSHIFT(mv.x,2);
-        s->mv[4].y = s->mv[5].y = RSHIFT(mv.y,2);
-    } else {
-        s->mv[4] = s->mv[5] = (VP56mv) {mv.x/4, mv.y/4};
-    }
-}
-
-static VP56mb vp56_decode_mv(VP56Context *s, int row, int col)
-{
-    VP56mv *mv, vect = {0,0};
-    int ctx, b;
-
-    ctx = vp56_get_vectors_predictors(s, row, col, VP56_FRAME_PREVIOUS);
-    s->mb_type = vp56_parse_mb_type(s, s->mb_type, ctx);
-    s->macroblocks[row * s->mb_width + col].type = s->mb_type;
-
-    switch (s->mb_type) {
-        case VP56_MB_INTER_V1_PF:
-            mv = &s->vector_candidate[0];
-            break;
-
-        case VP56_MB_INTER_V2_PF:
-            mv = &s->vector_candidate[1];
-            break;
-
-        case VP56_MB_INTER_V1_GF:
-            vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN);
-            mv = &s->vector_candidate[0];
-            break;
-
-        case VP56_MB_INTER_V2_GF:
-            vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN);
-            mv = &s->vector_candidate[1];
-            break;
-
-        case VP56_MB_INTER_DELTA_PF:
-            s->parse_vector_adjustment(s, &vect);
-            mv = &vect;
-            break;
-
-        case VP56_MB_INTER_DELTA_GF:
-            vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN);
-            s->parse_vector_adjustment(s, &vect);
-            mv = &vect;
-            break;
-
-        case VP56_MB_INTER_4V:
-            vp56_decode_4mv(s, row, col);
-            return s->mb_type;
-
-        default:
-            mv = &vect;
-            break;
-    }
-
-    s->macroblocks[row*s->mb_width + col].mv = *mv;
-
-    /* same vector for all blocks */
-    for (b=0; b<6; b++)
-        s->mv[b] = *mv;
-
-    return s->mb_type;
-}
-
-static void vp56_add_predictors_dc(VP56Context *s, VP56Frame ref_frame)
-{
-    int idx = s->idct_scantable[0];
-    int b;
-
-    for (b=0; b<6; b++) {
-        VP56RefDc *ab = &s->above_blocks[s->above_block_idx[b]];
-        VP56RefDc *lb = &s->left_block[ff_vp56_b6to4[b]];
-        int count = 0;
-        int dc = 0;
-        int i;
-
-        if (ref_frame == lb->ref_frame) {
-            dc += lb->dc_coeff;
-            count++;
-        }
-        if (ref_frame == ab->ref_frame) {
-            dc += ab->dc_coeff;
-            count++;
-        }
-        if (s->avctx->codec->id == AV_CODEC_ID_VP5)
-            for (i=0; i<2; i++)
-                if (count < 2 && ref_frame == ab[-1+2*i].ref_frame) {
-                    dc += ab[-1+2*i].dc_coeff;
-                    count++;
-                }
-        if (count == 0)
-            dc = s->prev_dc[ff_vp56_b2p[b]][ref_frame];
-        else if (count == 2)
-            dc /= 2;
-
-        s->block_coeff[b][idx] += dc;
-        s->prev_dc[ff_vp56_b2p[b]][ref_frame] = s->block_coeff[b][idx];
-        ab->dc_coeff = s->block_coeff[b][idx];
-        ab->ref_frame = ref_frame;
-        lb->dc_coeff = s->block_coeff[b][idx];
-        lb->ref_frame = ref_frame;
-        s->block_coeff[b][idx] *= s->dequant_dc;
-    }
-}
-
-static void vp56_deblock_filter(VP56Context *s, uint8_t *yuv,
-                                ptrdiff_t stride, int dx, int dy)
-{
-    int t = ff_vp56_filter_threshold[s->quantizer];
-    if (dx)  s->vp56dsp.edge_filter_hor(yuv +         10-dx , stride, t);
-    if (dy)  s->vp56dsp.edge_filter_ver(yuv + stride*(10-dy), stride, t);
-}
-
-static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
-                    ptrdiff_t stride, int x, int y)
-{
-    uint8_t *dst = s->frames[VP56_FRAME_CURRENT]->data[plane] + s->block_offset[b];
-    uint8_t *src_block;
-    int src_offset;
-    int overlap_offset = 0;
-    int mask = s->vp56_coord_div[b] - 1;
-    int deblock_filtering = s->deblock_filtering;
-    int dx;
-    int dy;
-
-    if (s->avctx->skip_loop_filter >= AVDISCARD_ALL ||
-        (s->avctx->skip_loop_filter >= AVDISCARD_NONKEY
-         && !s->frames[VP56_FRAME_CURRENT]->key_frame))
-        deblock_filtering = 0;
-
-    dx = s->mv[b].x / s->vp56_coord_div[b];
-    dy = s->mv[b].y / s->vp56_coord_div[b];
-
-    if (b >= 4) {
-        x /= 2;
-        y /= 2;
-    }
-    x += dx - 2;
-    y += dy - 2;
-
-    if (x<0 || x+12>=s->plane_width[plane] ||
-        y<0 || y+12>=s->plane_height[plane]) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
-                            src + s->block_offset[b] + (dy-2)*stride + (dx-2),
-                            stride, stride,
-                            12, 12, x, y,
-                            s->plane_width[plane],
-                            s->plane_height[plane]);
-        src_block = s->edge_emu_buffer;
-        src_offset = 2 + 2*stride;
-    } else if (deblock_filtering) {
-        /* only need a 12x12 block, but there is no such dsp function, */
-        /* so copy a 16x12 block */
-        s->hdsp.put_pixels_tab[0][0](s->edge_emu_buffer,
-                                     src + s->block_offset[b] + (dy-2)*stride + (dx-2),
-                                     stride, 12);
-        src_block = s->edge_emu_buffer;
-        src_offset = 2 + 2*stride;
-    } else {
-        src_block = src;
-        src_offset = s->block_offset[b] + dy*stride + dx;
-    }
-
-    if (deblock_filtering)
-        vp56_deblock_filter(s, src_block, stride, dx&7, dy&7);
-
-    if (s->mv[b].x & mask)
-        overlap_offset += (s->mv[b].x > 0) ? 1 : -1;
-    if (s->mv[b].y & mask)
-        overlap_offset += (s->mv[b].y > 0) ? stride : -stride;
-
-    if (overlap_offset) {
-        if (s->filter)
-            s->filter(s, dst, src_block, src_offset, src_offset+overlap_offset,
-                      stride, s->mv[b], mask, s->filter_selection, b<4);
-        else
-            s->vp3dsp.put_no_rnd_pixels_l2(dst, src_block+src_offset,
-                                           src_block+src_offset+overlap_offset,
-                                           stride, 8);
-    } else {
-        s->hdsp.put_pixels_tab[1][0](dst, src_block+src_offset, stride, 8);
-    }
-}
-
-static void vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
-{
-    AVFrame *frame_current, *frame_ref;
-    VP56mb mb_type;
-    VP56Frame ref_frame;
-    int b, ab, b_max, plane, off;
-
-    if (s->frames[VP56_FRAME_CURRENT]->key_frame)
-        mb_type = VP56_MB_INTRA;
-    else
-        mb_type = vp56_decode_mv(s, row, col);
-    ref_frame = ff_vp56_reference_frame[mb_type];
-
-    s->parse_coeff(s);
-
-    vp56_add_predictors_dc(s, ref_frame);
-
-    frame_current = s->frames[VP56_FRAME_CURRENT];
-    frame_ref = s->frames[ref_frame];
-    if (mb_type != VP56_MB_INTRA && !frame_ref->data[0])
-        return;
-
-    ab = 6*is_alpha;
-    b_max = 6 - 2*is_alpha;
-
-    switch (mb_type) {
-        case VP56_MB_INTRA:
-            for (b=0; b<b_max; b++) {
-                plane = ff_vp56_b2p[b+ab];
-                s->vp3dsp.idct_put(frame_current->data[plane] + s->block_offset[b],
-                                s->stride[plane], s->block_coeff[b]);
-            }
-            break;
-
-        case VP56_MB_INTER_NOVEC_PF:
-        case VP56_MB_INTER_NOVEC_GF:
-            for (b=0; b<b_max; b++) {
-                plane = ff_vp56_b2p[b+ab];
-                off = s->block_offset[b];
-                s->hdsp.put_pixels_tab[1][0](frame_current->data[plane] + off,
-                                             frame_ref->data[plane] + off,
-                                             s->stride[plane], 8);
-                s->vp3dsp.idct_add(frame_current->data[plane] + off,
-                                s->stride[plane], s->block_coeff[b]);
-            }
-            break;
-
-        case VP56_MB_INTER_DELTA_PF:
-        case VP56_MB_INTER_V1_PF:
-        case VP56_MB_INTER_V2_PF:
-        case VP56_MB_INTER_DELTA_GF:
-        case VP56_MB_INTER_4V:
-        case VP56_MB_INTER_V1_GF:
-        case VP56_MB_INTER_V2_GF:
-            for (b=0; b<b_max; b++) {
-                int x_off = b==1 || b==3 ? 8 : 0;
-                int y_off = b==2 || b==3 ? 8 : 0;
-                plane = ff_vp56_b2p[b+ab];
-                vp56_mc(s, b, plane, frame_ref->data[plane], s->stride[plane],
-                        16*col+x_off, 16*row+y_off);
-                s->vp3dsp.idct_add(frame_current->data[plane] + s->block_offset[b],
-                                s->stride[plane], s->block_coeff[b]);
-            }
-            break;
-    }
-
-    if (is_alpha) {
-        s->block_coeff[4][0] = 0;
-        s->block_coeff[5][0] = 0;
-    }
-}
-
-static int vp56_size_changed(AVCodecContext *avctx)
-{
-    VP56Context *s = avctx->priv_data;
-    int stride = s->frames[VP56_FRAME_CURRENT]->linesize[0];
-    int i;
-
-    s->plane_width[0]  = s->plane_width[3]  = avctx->coded_width;
-    s->plane_width[1]  = s->plane_width[2]  = avctx->coded_width/2;
-    s->plane_height[0] = s->plane_height[3] = avctx->coded_height;
-    s->plane_height[1] = s->plane_height[2] = avctx->coded_height/2;
-
-    for (i=0; i<4; i++)
-        s->stride[i] = s->flip * s->frames[VP56_FRAME_CURRENT]->linesize[i];
-
-    s->mb_width  = (avctx->coded_width +15) / 16;
-    s->mb_height = (avctx->coded_height+15) / 16;
-
-    if (s->mb_width > 1000 || s->mb_height > 1000) {
-        ff_set_dimensions(avctx, 0, 0);
-        av_log(avctx, AV_LOG_ERROR, "picture too big\n");
-        return -1;
-    }
-
-    s->above_blocks = av_realloc(s->above_blocks,
-                                 (4*s->mb_width+6) * sizeof(*s->above_blocks));
-    s->macroblocks = av_realloc(s->macroblocks,
-                                s->mb_width*s->mb_height*sizeof(*s->macroblocks));
-    av_free(s->edge_emu_buffer_alloc);
-    s->edge_emu_buffer_alloc = av_malloc(16*stride);
-    s->edge_emu_buffer = s->edge_emu_buffer_alloc;
-    if (s->flip < 0)
-        s->edge_emu_buffer += 15 * stride;
-
-    return 0;
-}
-
-int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                         AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    VP56Context *s = avctx->priv_data;
-    AVFrame *const p = s->frames[VP56_FRAME_CURRENT];
-    int remaining_buf_size = avpkt->size;
-    int is_alpha, av_uninit(alpha_offset);
-    int res;
-
-    if (s->has_alpha) {
-        if (remaining_buf_size < 3)
-            return -1;
-        alpha_offset = bytestream_get_be24(&buf);
-        remaining_buf_size -= 3;
-        if (remaining_buf_size < alpha_offset)
-            return -1;
-    }
-
-    for (is_alpha=0; is_alpha < 1+s->has_alpha; is_alpha++) {
-        int mb_row, mb_col, mb_row_flip, mb_offset = 0;
-        int block, y, uv;
-        ptrdiff_t stride_y, stride_uv;
-        int golden_frame = 0;
-
-        s->modelp = &s->models[is_alpha];
-
-        res = s->parse_header(s, buf, remaining_buf_size, &golden_frame);
-        if (res < 0) {
-            int i;
-            for (i = 0; i < 4; i++)
-                av_frame_unref(s->frames[i]);
-            return res;
-        }
-
-        if (res == VP56_SIZE_CHANGE) {
-            int i;
-            for (i = 0; i < 4; i++)
-                av_frame_unref(s->frames[i]);
-            if (is_alpha) {
-                ff_set_dimensions(avctx, 0, 0);
-                return -1;
-            }
-        }
-
-        if (!is_alpha) {
-            if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0) {
-                av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                return -1;
-            }
-
-            if (res == VP56_SIZE_CHANGE)
-                if (vp56_size_changed(avctx)) {
-                    av_frame_unref(p);
-                    return -1;
-                }
-        }
-
-        if (p->key_frame) {
-            p->pict_type = AV_PICTURE_TYPE_I;
-            s->default_models_init(s);
-            for (block=0; block<s->mb_height*s->mb_width; block++)
-                s->macroblocks[block].type = VP56_MB_INTRA;
-        } else {
-            p->pict_type = AV_PICTURE_TYPE_P;
-            vp56_parse_mb_type_models(s);
-            s->parse_vector_models(s);
-            s->mb_type = VP56_MB_INTER_NOVEC_PF;
-        }
-
-        if (s->parse_coeff_models(s))
-            goto next;
-
-        memset(s->prev_dc, 0, sizeof(s->prev_dc));
-        s->prev_dc[1][VP56_FRAME_CURRENT] = 128;
-        s->prev_dc[2][VP56_FRAME_CURRENT] = 128;
-
-        for (block=0; block < 4*s->mb_width+6; block++) {
-            s->above_blocks[block].ref_frame = VP56_FRAME_NONE;
-            s->above_blocks[block].dc_coeff = 0;
-            s->above_blocks[block].not_null_dc = 0;
-        }
-        s->above_blocks[2*s->mb_width + 2].ref_frame = VP56_FRAME_CURRENT;
-        s->above_blocks[3*s->mb_width + 4].ref_frame = VP56_FRAME_CURRENT;
-
-        stride_y  = p->linesize[0];
-        stride_uv = p->linesize[1];
-
-        if (s->flip < 0)
-            mb_offset = 7;
-
-        /* main macroblocks loop */
-        for (mb_row=0; mb_row<s->mb_height; mb_row++) {
-            if (s->flip < 0)
-                mb_row_flip = s->mb_height - mb_row - 1;
-            else
-                mb_row_flip = mb_row;
-
-            for (block=0; block<4; block++) {
-                s->left_block[block].ref_frame = VP56_FRAME_NONE;
-                s->left_block[block].dc_coeff = 0;
-                s->left_block[block].not_null_dc = 0;
-            }
-            memset(s->coeff_ctx, 0, sizeof(s->coeff_ctx));
-            memset(s->coeff_ctx_last, 24, sizeof(s->coeff_ctx_last));
-
-            s->above_block_idx[0] = 1;
-            s->above_block_idx[1] = 2;
-            s->above_block_idx[2] = 1;
-            s->above_block_idx[3] = 2;
-            s->above_block_idx[4] = 2*s->mb_width + 2 + 1;
-            s->above_block_idx[5] = 3*s->mb_width + 4 + 1;
-
-            s->block_offset[s->frbi] = (mb_row_flip*16 + mb_offset) * stride_y;
-            s->block_offset[s->srbi] = s->block_offset[s->frbi] + 8*stride_y;
-            s->block_offset[1] = s->block_offset[0] + 8;
-            s->block_offset[3] = s->block_offset[2] + 8;
-            s->block_offset[4] = (mb_row_flip*8 + mb_offset) * stride_uv;
-            s->block_offset[5] = s->block_offset[4];
-
-            for (mb_col=0; mb_col<s->mb_width; mb_col++) {
-                vp56_decode_mb(s, mb_row, mb_col, is_alpha);
-
-                for (y=0; y<4; y++) {
-                    s->above_block_idx[y] += 2;
-                    s->block_offset[y] += 16;
-                }
-
-                for (uv=4; uv<6; uv++) {
-                    s->above_block_idx[uv] += 1;
-                    s->block_offset[uv] += 8;
-                }
-            }
-        }
-
-    next:
-        if (p->key_frame || golden_frame) {
-            av_frame_unref(s->frames[VP56_FRAME_GOLDEN]);
-            if ((res = av_frame_ref(s->frames[VP56_FRAME_GOLDEN], p)) < 0)
-                return res;
-        }
-
-        if (s->has_alpha) {
-            FFSWAP(AVFrame *, s->frames[VP56_FRAME_GOLDEN],
-                              s->frames[VP56_FRAME_GOLDEN2]);
-            buf += alpha_offset;
-            remaining_buf_size -= alpha_offset;
-        }
-    }
-
-    av_frame_unref(s->frames[VP56_FRAME_PREVIOUS]);
-    FFSWAP(AVFrame *, s->frames[VP56_FRAME_CURRENT],
-                      s->frames[VP56_FRAME_PREVIOUS]);
-
-    if ((res = av_frame_ref(data, p)) < 0)
-        return res;
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-av_cold int ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha)
-{
-    VP56Context *s = avctx->priv_data;
-    int i;
-
-    s->avctx = avctx;
-    avctx->pix_fmt = has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
-
-    ff_h264chroma_init(&s->h264chroma, 8);
-    ff_hpeldsp_init(&s->hdsp, avctx->flags);
-    ff_videodsp_init(&s->vdsp, 8);
-    ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
-    ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
-    for (i = 0; i < 64; i++) {
-#define T(x) (x >> 3) | ((x & 7) << 3)
-        s->idct_scantable[i] = T(ff_zigzag_direct[i]);
-#undef T
-    }
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++) {
-        s->frames[i] = av_frame_alloc();
-        if (!s->frames[i]) {
-            ff_vp56_free(avctx);
-            return AVERROR(ENOMEM);
-        }
-    }
-    s->edge_emu_buffer_alloc = NULL;
-
-    s->above_blocks = NULL;
-    s->macroblocks = NULL;
-    s->quantizer = -1;
-    s->deblock_filtering = 1;
-
-    s->filter = NULL;
-
-    s->has_alpha = has_alpha;
-    if (flip) {
-        s->flip = -1;
-        s->frbi = 2;
-        s->srbi = 0;
-    } else {
-        s->flip = 1;
-        s->frbi = 0;
-        s->srbi = 2;
-    }
-
-    return 0;
-}
-
-av_cold int ff_vp56_free(AVCodecContext *avctx)
-{
-    VP56Context *s = avctx->priv_data;
-    int i;
-
-    av_freep(&s->above_blocks);
-    av_freep(&s->macroblocks);
-    av_freep(&s->edge_emu_buffer_alloc);
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++)
-        av_frame_free(&s->frames[i]);
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/vp56.h b/deps/libav/libavcodec/vp56.h
deleted file mode 100644
index f71b9a8..0000000
--- a/deps/libav/libavcodec/vp56.h
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP5 and VP6 compatible video decoder (common features)
- */
-
-#ifndef AVCODEC_VP56_H
-#define AVCODEC_VP56_H
-
-#include "dsputil.h"
-#include "get_bits.h"
-#include "hpeldsp.h"
-#include "bytestream.h"
-#include "h264chroma.h"
-#include "videodsp.h"
-#include "vp3dsp.h"
-#include "vp56dsp.h"
-
-typedef struct vp56_context VP56Context;
-
-typedef enum {
-    VP56_FRAME_NONE     =-1,
-    VP56_FRAME_CURRENT  = 0,
-    VP56_FRAME_PREVIOUS = 1,
-    VP56_FRAME_GOLDEN   = 2,
-    VP56_FRAME_GOLDEN2  = 3,
-} VP56Frame;
-
-typedef enum {
-    VP56_MB_INTER_NOVEC_PF = 0,  /**< Inter MB, no vector, from previous frame */
-    VP56_MB_INTRA          = 1,  /**< Intra MB */
-    VP56_MB_INTER_DELTA_PF = 2,  /**< Inter MB, above/left vector + delta, from previous frame */
-    VP56_MB_INTER_V1_PF    = 3,  /**< Inter MB, first vector, from previous frame */
-    VP56_MB_INTER_V2_PF    = 4,  /**< Inter MB, second vector, from previous frame */
-    VP56_MB_INTER_NOVEC_GF = 5,  /**< Inter MB, no vector, from golden frame */
-    VP56_MB_INTER_DELTA_GF = 6,  /**< Inter MB, above/left vector + delta, from golden frame */
-    VP56_MB_INTER_4V       = 7,  /**< Inter MB, 4 vectors, from previous frame */
-    VP56_MB_INTER_V1_GF    = 8,  /**< Inter MB, first vector, from golden frame */
-    VP56_MB_INTER_V2_GF    = 9,  /**< Inter MB, second vector, from golden frame */
-} VP56mb;
-
-typedef struct VP56Tree {
-  int8_t val;
-  int8_t prob_idx;
-} VP56Tree;
-
-typedef struct VP56mv {
-    DECLARE_ALIGNED(4, int16_t, x);
-    int16_t y;
-} VP56mv;
-
-#define VP56_SIZE_CHANGE 1
-
-typedef void (*VP56ParseVectorAdjustment)(VP56Context *s,
-                                          VP56mv *vect);
-typedef void (*VP56Filter)(VP56Context *s, uint8_t *dst, uint8_t *src,
-                           int offset1, int offset2, int stride,
-                           VP56mv mv, int mask, int select, int luma);
-typedef void (*VP56ParseCoeff)(VP56Context *s);
-typedef void (*VP56DefaultModelsInit)(VP56Context *s);
-typedef void (*VP56ParseVectorModels)(VP56Context *s);
-typedef int  (*VP56ParseCoeffModels)(VP56Context *s);
-typedef int  (*VP56ParseHeader)(VP56Context *s, const uint8_t *buf,
-                                int buf_size, int *golden_frame);
-
-typedef struct VP56RangeCoder {
-    int high;
-    int bits; /* stored negated (i.e. negative "bits" is a positive number of
-                 bits left) in order to eliminate a negate in cache refilling */
-    const uint8_t *buffer;
-    const uint8_t *end;
-    unsigned int code_word;
-} VP56RangeCoder;
-
-typedef struct VP56RefDc {
-    uint8_t not_null_dc;
-    VP56Frame ref_frame;
-    int16_t dc_coeff;
-} VP56RefDc;
-
-typedef struct VP56Macroblock {
-    uint8_t type;
-    VP56mv mv;
-} VP56Macroblock;
-
-typedef struct VP56Model {
-    uint8_t coeff_reorder[64];       /* used in vp6 only */
-    uint8_t coeff_index_to_pos[64];  /* used in vp6 only */
-    uint8_t vector_sig[2];           /* delta sign */
-    uint8_t vector_dct[2];           /* delta coding types */
-    uint8_t vector_pdi[2][2];        /* predefined delta init */
-    uint8_t vector_pdv[2][7];        /* predefined delta values */
-    uint8_t vector_fdv[2][8];        /* 8 bit delta value definition */
-    uint8_t coeff_dccv[2][11];       /* DC coeff value */
-    uint8_t coeff_ract[2][3][6][11]; /* Run/AC coding type and AC coeff value */
-    uint8_t coeff_acct[2][3][3][6][5];/* vp5 only AC coding type for coding group < 3 */
-    uint8_t coeff_dcct[2][36][5];    /* DC coeff coding type */
-    uint8_t coeff_runv[2][14];       /* run value (vp6 only) */
-    uint8_t mb_type[3][10][10];      /* model for decoding MB type */
-    uint8_t mb_types_stats[3][10][2];/* contextual, next MB type stats */
-} VP56Model;
-
-struct vp56_context {
-    AVCodecContext *avctx;
-    H264ChromaContext h264chroma;
-    HpelDSPContext hdsp;
-    VideoDSPContext vdsp;
-    VP3DSPContext vp3dsp;
-    VP56DSPContext vp56dsp;
-    uint8_t idct_scantable[64];
-    AVFrame *frames[4];
-    uint8_t *edge_emu_buffer_alloc;
-    uint8_t *edge_emu_buffer;
-    VP56RangeCoder c;
-    VP56RangeCoder cc;
-    VP56RangeCoder *ccp;
-    int sub_version;
-
-    /* frame info */
-    int plane_width[4];
-    int plane_height[4];
-    int mb_width;   /* number of horizontal MB */
-    int mb_height;  /* number of vertical MB */
-    int block_offset[6];
-
-    int quantizer;
-    uint16_t dequant_dc;
-    uint16_t dequant_ac;
-
-    /* DC predictors management */
-    VP56RefDc *above_blocks;
-    VP56RefDc left_block[4];
-    int above_block_idx[6];
-    int16_t prev_dc[3][3];    /* [plan][ref_frame] */
-
-    /* blocks / macroblock */
-    VP56mb mb_type;
-    VP56Macroblock *macroblocks;
-    DECLARE_ALIGNED(16, int16_t, block_coeff)[6][64];
-
-    /* motion vectors */
-    VP56mv mv[6];  /* vectors for each block in MB */
-    VP56mv vector_candidate[2];
-    int vector_candidate_pos;
-
-    /* filtering hints */
-    int filter_header;               /* used in vp6 only */
-    int deblock_filtering;
-    int filter_selection;
-    int filter_mode;
-    int max_vector_length;
-    int sample_variance_threshold;
-
-    uint8_t coeff_ctx[4][64];              /* used in vp5 only */
-    uint8_t coeff_ctx_last[4];             /* used in vp5 only */
-
-    int has_alpha;
-
-    /* upside-down flipping hints */
-    int flip;  /* are we flipping ? */
-    int frbi;  /* first row block index in MB */
-    int srbi;  /* second row block index in MB */
-    int stride[4];  /* stride for each plan */
-
-    const uint8_t *vp56_coord_div;
-    VP56ParseVectorAdjustment parse_vector_adjustment;
-    VP56Filter filter;
-    VP56ParseCoeff parse_coeff;
-    VP56DefaultModelsInit default_models_init;
-    VP56ParseVectorModels parse_vector_models;
-    VP56ParseCoeffModels parse_coeff_models;
-    VP56ParseHeader parse_header;
-
-    VP56Model *modelp;
-    VP56Model models[2];
-
-    /* huffman decoding */
-    int use_huffman;
-    GetBitContext gb;
-    VLC dccv_vlc[2];
-    VLC runv_vlc[2];
-    VLC ract_vlc[2][3][6];
-    unsigned int nb_null[2][2];       /* number of consecutive NULL DC/AC */
-};
-
-
-int ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha);
-int ff_vp56_free(AVCodecContext *avctx);
-void ff_vp56_init_dequant(VP56Context *s, int quantizer);
-int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                         AVPacket *avpkt);
-
-
-/**
- * vp56 specific range coder implementation
- */
-
-extern const uint8_t ff_vp56_norm_shift[256];
-void ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size);
-
-static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c)
-{
-    int shift = ff_vp56_norm_shift[c->high];
-    int bits = c->bits;
-    unsigned int code_word = c->code_word;
-
-    c->high   <<= shift;
-    code_word <<= shift;
-    bits       += shift;
-    if(bits >= 0 && c->buffer < c->end) {
-        code_word |= bytestream_get_be16(&c->buffer) << bits;
-        bits -= 16;
-    }
-    c->bits = bits;
-    return code_word;
-}
-
-#if   ARCH_ARM
-#include "arm/vp56_arith.h"
-#elif ARCH_X86
-#include "x86/vp56_arith.h"
-#endif
-
-#ifndef vp56_rac_get_prob
-#define vp56_rac_get_prob vp56_rac_get_prob
-static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
-{
-    unsigned int code_word = vp56_rac_renorm(c);
-    unsigned int low = 1 + (((c->high - 1) * prob) >> 8);
-    unsigned int low_shift = low << 16;
-    int bit = code_word >= low_shift;
-
-    c->high = bit ? c->high - low : low;
-    c->code_word = bit ? code_word - low_shift : code_word;
-
-    return bit;
-}
-#endif
-
-#ifndef vp56_rac_get_prob_branchy
-// branchy variant, to be used where there's a branch based on the bit decoded
-static av_always_inline int vp56_rac_get_prob_branchy(VP56RangeCoder *c, int prob)
-{
-    unsigned long code_word = vp56_rac_renorm(c);
-    unsigned low = 1 + (((c->high - 1) * prob) >> 8);
-    unsigned low_shift = low << 16;
-
-    if (code_word >= low_shift) {
-        c->high     -= low;
-        c->code_word = code_word - low_shift;
-        return 1;
-    }
-
-    c->high = low;
-    c->code_word = code_word;
-    return 0;
-}
-#endif
-
-static av_always_inline int vp56_rac_get(VP56RangeCoder *c)
-{
-    unsigned int code_word = vp56_rac_renorm(c);
-    /* equiprobable */
-    int low = (c->high + 1) >> 1;
-    unsigned int low_shift = low << 16;
-    int bit = code_word >= low_shift;
-    if (bit) {
-        c->high   -= low;
-        code_word -= low_shift;
-    } else {
-        c->high = low;
-    }
-
-    c->code_word = code_word;
-    return bit;
-}
-
-// rounding is different than vp56_rac_get, is vp56_rac_get wrong?
-static av_always_inline int vp8_rac_get(VP56RangeCoder *c)
-{
-    return vp56_rac_get_prob(c, 128);
-}
-
-static av_unused int vp56_rac_gets(VP56RangeCoder *c, int bits)
-{
-    int value = 0;
-
-    while (bits--) {
-        value = (value << 1) | vp56_rac_get(c);
-    }
-
-    return value;
-}
-
-static av_unused int vp8_rac_get_uint(VP56RangeCoder *c, int bits)
-{
-    int value = 0;
-
-    while (bits--) {
-        value = (value << 1) | vp8_rac_get(c);
-    }
-
-    return value;
-}
-
-// fixme: add 1 bit to all the calls to this?
-static av_unused int vp8_rac_get_sint(VP56RangeCoder *c, int bits)
-{
-    int v;
-
-    if (!vp8_rac_get(c))
-        return 0;
-
-    v = vp8_rac_get_uint(c, bits);
-
-    if (vp8_rac_get(c))
-        v = -v;
-
-    return v;
-}
-
-// P(7)
-static av_unused int vp56_rac_gets_nn(VP56RangeCoder *c, int bits)
-{
-    int v = vp56_rac_gets(c, 7) << 1;
-    return v + !v;
-}
-
-static av_unused int vp8_rac_get_nn(VP56RangeCoder *c)
-{
-    int v = vp8_rac_get_uint(c, 7) << 1;
-    return v + !v;
-}
-
-static av_always_inline
-int vp56_rac_get_tree(VP56RangeCoder *c,
-                      const VP56Tree *tree,
-                      const uint8_t *probs)
-{
-    while (tree->val > 0) {
-        if (vp56_rac_get_prob(c, probs[tree->prob_idx]))
-            tree += tree->val;
-        else
-            tree++;
-    }
-    return -tree->val;
-}
-
-/**
- * This is identical to vp8_rac_get_tree except for the possibility of starting
- * on a node other than the root node, needed for coeff decode where this is
- * used to save a bit after a 0 token (by disallowing EOB to immediately follow.)
- */
-static av_always_inline
-int vp8_rac_get_tree_with_offset(VP56RangeCoder *c, const int8_t (*tree)[2],
-                                 const uint8_t *probs, int i)
-{
-    do {
-        i = tree[i][vp56_rac_get_prob(c, probs[i])];
-    } while (i > 0);
-
-    return -i;
-}
-
-// how probabilities are associated with decisions is different I think
-// well, the new scheme fits in the old but this way has one fewer branches per decision
-static av_always_inline
-int vp8_rac_get_tree(VP56RangeCoder *c, const int8_t (*tree)[2],
-                     const uint8_t *probs)
-{
-    return vp8_rac_get_tree_with_offset(c, tree, probs, 0);
-}
-
-// DCTextra
-static av_always_inline int vp8_rac_get_coeff(VP56RangeCoder *c, const uint8_t *prob)
-{
-    int v = 0;
-
-    do {
-        v = (v<<1) + vp56_rac_get_prob(c, *prob++);
-    } while (*prob);
-
-    return v;
-}
-
-#endif /* AVCODEC_VP56_H */
diff --git a/deps/libav/libavcodec/vp56data.c b/deps/libav/libavcodec/vp56data.c
deleted file mode 100644
index 989c76a..0000000
--- a/deps/libav/libavcodec/vp56data.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP5 and VP6 compatible video decoder (common data)
- */
-
-#include "vp56data.h"
-
-const uint8_t ff_vp56_b2p[]   = { 0, 0, 0, 0, 1, 2, 3, 3, 3, 3 };
-const uint8_t ff_vp56_b6to4[] = { 0, 0, 1, 1, 2, 3 };
-
-const uint8_t ff_vp56_coeff_parse_table[6][11] = {
-    { 159,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0 },
-    { 145, 165,   0,   0,   0,   0,   0,   0,   0,   0,   0 },
-    { 140, 148, 173,   0,   0,   0,   0,   0,   0,   0,   0 },
-    { 135, 140, 155, 176,   0,   0,   0,   0,   0,   0,   0 },
-    { 130, 134, 141, 157, 180,   0,   0,   0,   0,   0,   0 },
-    { 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254 },
-};
-
-const uint8_t ff_vp56_def_mb_types_stats[3][10][2] = {
-    { {  69, 42 }, {   1,  2 }, {  1,   7 }, {  44, 42 }, {  6, 22 },
-      {   1,  3 }, {   0,  2 }, {  1,   5 }, {   0,  1 }, {  0,  0 }, },
-    { { 229,  8 }, {   1,  1 }, {  0,   8 }, {   0,  0 }, {  0,  0 },
-      {   1,  2 }, {   0,  1 }, {  0,   0 }, {   1,  1 }, {  0,  0 }, },
-    { { 122, 35 }, {   1,  1 }, {  1,   6 }, {  46, 34 }, {  0,  0 },
-      {   1,  2 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, },
-};
-
-const VP56Tree ff_vp56_pva_tree[] = {
-    { 8, 0},
-    { 4, 1},
-    { 2, 2}, {-0}, {-1},
-    { 2, 3}, {-2}, {-3},
-    { 4, 4},
-    { 2, 5}, {-4}, {-5},
-    { 2, 6}, {-6}, {-7},
-};
-
-const VP56Tree ff_vp56_pc_tree[] = {
-    { 4, 6},
-    { 2, 7}, {-0}, {-1},
-    { 4, 8},
-    { 2, 9}, {-2}, {-3},
-    { 2,10}, {-4}, {-5},
-};
-
-const uint8_t ff_vp56_coeff_bias[] = { 0, 1, 2, 3, 4, 5, 7, 11, 19, 35, 67 };
-const uint8_t ff_vp56_coeff_bit_length[] = { 0, 1, 2, 3, 4, 10 };
-
-const VP56Frame ff_vp56_reference_frame[] = {
-    VP56_FRAME_PREVIOUS,  /* VP56_MB_INTER_NOVEC_PF */
-    VP56_FRAME_CURRENT,   /* VP56_MB_INTRA */
-    VP56_FRAME_PREVIOUS,  /* VP56_MB_INTER_DELTA_PF */
-    VP56_FRAME_PREVIOUS,  /* VP56_MB_INTER_V1_PF */
-    VP56_FRAME_PREVIOUS,  /* VP56_MB_INTER_V2_PF */
-    VP56_FRAME_GOLDEN,    /* VP56_MB_INTER_NOVEC_GF */
-    VP56_FRAME_GOLDEN,    /* VP56_MB_INTER_DELTA_GF */
-    VP56_FRAME_PREVIOUS,  /* VP56_MB_INTER_4V */
-    VP56_FRAME_GOLDEN,    /* VP56_MB_INTER_V1_GF */
-    VP56_FRAME_GOLDEN,    /* VP56_MB_INTER_V2_GF */
-};
-
-const uint8_t ff_vp56_ac_dequant[64] = {
-    94, 92, 90, 88, 86, 82, 78, 74,
-    70, 66, 62, 58, 54, 53, 52, 51,
-    50, 49, 48, 47, 46, 45, 44, 43,
-    42, 40, 39, 37, 36, 35, 34, 33,
-    32, 31, 30, 29, 28, 27, 26, 25,
-    24, 23, 22, 21, 20, 19, 18, 17,
-    16, 15, 14, 13, 12, 11, 10,  9,
-     8,  7,  6,  5,  4,  3,  2,  1,
-};
-
-const uint8_t ff_vp56_dc_dequant[64] = {
-    47, 47, 47, 47, 45, 43, 43, 43,
-    43, 43, 42, 41, 41, 40, 40, 40,
-    40, 35, 35, 35, 35, 33, 33, 33,
-    33, 32, 32, 32, 27, 27, 26, 26,
-    25, 25, 24, 24, 23, 23, 19, 19,
-    19, 19, 18, 18, 17, 16, 16, 16,
-    16, 16, 15, 11, 11, 11, 10, 10,
-     9,  8,  7,  5,  3,  3,  2,  2,
-};
-
-const uint8_t ff_vp56_pre_def_mb_type_stats[16][3][10][2] = {
-  { { {   9, 15 }, {  32, 25 }, {  7,  19 }, {   9, 21 }, {  1, 12 },
-      {  14, 12 }, {   3, 18 }, { 14,  23 }, {   3, 10 }, {  0,  4 }, },
-    { {  41, 22 }, {   1,  0 }, {  1,  31 }, {   0,  0 }, {  0,  0 },
-      {   0,  1 }, {   1,  7 }, {  0,   1 }, {  98, 25 }, {  4, 10 }, },
-    { {   2,  3 }, {   2,  3 }, {  0,   2 }, {   0,  2 }, {  0,  0 },
-      {  11,  4 }, {   1,  4 }, {  0,   2 }, {   3,  2 }, {  0,  4 }, }, },
-  { { {  48, 39 }, {   1,  2 }, { 11,  27 }, {  29, 44 }, {  7, 27 },
-      {   1,  4 }, {   0,  3 }, {  1,   6 }, {   1,  2 }, {  0,  0 }, },
-    { { 123, 37 }, {   6,  4 }, {  1,  27 }, {   0,  0 }, {  0,  0 },
-      {   5,  8 }, {   1,  7 }, {  0,   1 }, {  12, 10 }, {  0,  2 }, },
-    { {  49, 46 }, {   3,  4 }, {  7,  31 }, {  42, 41 }, {  0,  0 },
-      {   2,  6 }, {   1,  7 }, {  1,   4 }, {   2,  4 }, {  0,  1 }, }, },
-  { { {  21, 32 }, {   1,  2 }, {  4,  10 }, {  32, 43 }, {  6, 23 },
-      {   2,  3 }, {   1, 19 }, {  1,   6 }, {  12, 21 }, {  0,  7 }, },
-    { {  26, 14 }, {  14, 12 }, {  0,  24 }, {   0,  0 }, {  0,  0 },
-      {  55, 17 }, {   1,  9 }, {  0,  36 }, {   5,  7 }, {  1,  3 }, },
-    { {  26, 25 }, {   1,  1 }, {  2,  10 }, {  67, 39 }, {  0,  0 },
-      {   1,  1 }, {   0, 14 }, {  0,   2 }, {  31, 26 }, {  1,  6 }, }, },
-  { { {  69, 83 }, {   0,  0 }, {  0,   2 }, {  10, 29 }, {  3, 12 },
-      {   0,  1 }, {   0,  3 }, {  0,   3 }, {   2,  2 }, {  0,  0 }, },
-    { { 209,  5 }, {   0,  0 }, {  0,  27 }, {   0,  0 }, {  0,  0 },
-      {   0,  1 }, {   0,  1 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, },
-    { { 103, 46 }, {   1,  2 }, {  2,  10 }, {  33, 42 }, {  0,  0 },
-      {   1,  4 }, {   0,  3 }, {  0,   1 }, {   1,  3 }, {  0,  0 }, }, },
-  { { {  11, 20 }, {   1,  4 }, { 18,  36 }, {  43, 48 }, { 13, 35 },
-      {   0,  2 }, {   0,  5 }, {  3,  12 }, {   1,  2 }, {  0,  0 }, },
-    { {   2,  5 }, {   4,  5 }, {  0, 121 }, {   0,  0 }, {  0,  0 },
-      {   0,  3 }, {   2,  4 }, {  1,   4 }, {   2,  2 }, {  0,  1 }, },
-    { {  14, 31 }, {   9, 13 }, { 14,  54 }, {  22, 29 }, {  0,  0 },
-      {   2,  6 }, {   4, 18 }, {  6,  13 }, {   1,  5 }, {  0,  1 }, }, },
-  { { {  70, 44 }, {   0,  1 }, {  2,  10 }, {  37, 46 }, {  8, 26 },
-      {   0,  2 }, {   0,  2 }, {  0,   2 }, {   0,  1 }, {  0,  0 }, },
-    { { 175,  5 }, {   0,  1 }, {  0,  48 }, {   0,  0 }, {  0,  0 },
-      {   0,  2 }, {   0,  1 }, {  0,   2 }, {   0,  1 }, {  0,  0 }, },
-    { {  85, 39 }, {   0,  0 }, {  1,   9 }, {  69, 40 }, {  0,  0 },
-      {   0,  1 }, {   0,  3 }, {  0,   1 }, {   2,  3 }, {  0,  0 }, }, },
-  { { {   8, 15 }, {   0,  1 }, {  8,  21 }, {  74, 53 }, { 22, 42 },
-      {   0,  1 }, {   0,  2 }, {  0,   3 }, {   1,  2 }, {  0,  0 }, },
-    { {  83,  5 }, {   2,  3 }, {  0, 102 }, {   0,  0 }, {  0,  0 },
-      {   1,  3 }, {   0,  2 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, },
-    { {  31, 28 }, {   0,  0 }, {  3,  14 }, { 130, 34 }, {  0,  0 },
-      {   0,  1 }, {   0,  3 }, {  0,   1 }, {   3,  3 }, {  0,  1 }, }, },
-  { { { 141, 42 }, {   0,  0 }, {  1,   4 }, {  11, 24 }, {  1, 11 },
-      {   0,  1 }, {   0,  1 }, {  0,   2 }, {   0,  0 }, {  0,  0 }, },
-    { { 233,  6 }, {   0,  0 }, {  0,   8 }, {   0,  0 }, {  0,  0 },
-      {   0,  1 }, {   0,  1 }, {  0,   0 }, {   0,  1 }, {  0,  0 }, },
-    { { 171, 25 }, {   0,  0 }, {  1,   5 }, {  25, 21 }, {  0,  0 },
-      {   0,  1 }, {   0,  1 }, {  0,   0 }, {   0,  0 }, {  0,  0 }, }, },
-  { { {   8, 19 }, {   4, 10 }, { 24,  45 }, {  21, 37 }, {  9, 29 },
-      {   0,  3 }, {   1,  7 }, { 11,  25 }, {   0,  2 }, {  0,  1 }, },
-    { {  34, 16 }, { 112, 21 }, {  1,  28 }, {   0,  0 }, {  0,  0 },
-      {   6,  8 }, {   1,  7 }, {  0,   3 }, {   2,  5 }, {  0,  2 }, },
-    { {  17, 21 }, {  68, 29 }, {  6,  15 }, {  13, 22 }, {  0,  0 },
-      {   6, 12 }, {   3, 14 }, {  4,  10 }, {   1,  7 }, {  0,  3 }, }, },
-  { { {  46, 42 }, {   0,  1 }, {  2,  10 }, {  54, 51 }, { 10, 30 },
-      {   0,  2 }, {   0,  2 }, {  0,   1 }, {   0,  1 }, {  0,  0 }, },
-    { { 159, 35 }, {   2,  2 }, {  0,  25 }, {   0,  0 }, {  0,  0 },
-      {   3,  6 }, {   0,  5 }, {  0,   1 }, {   4,  4 }, {  0,  1 }, },
-    { {  51, 39 }, {   0,  1 }, {  2,  12 }, {  91, 44 }, {  0,  0 },
-      {   0,  2 }, {   0,  3 }, {  0,   1 }, {   2,  3 }, {  0,  1 }, }, },
-  { { {  28, 32 }, {   0,  0 }, {  3,  10 }, {  75, 51 }, { 14, 33 },
-      {   0,  1 }, {   0,  2 }, {  0,   1 }, {   1,  2 }, {  0,  0 }, },
-    { {  75, 39 }, {   5,  7 }, {  2,  48 }, {   0,  0 }, {  0,  0 },
-      {   3, 11 }, {   2, 16 }, {  1,   4 }, {   7, 10 }, {  0,  2 }, },
-    { {  81, 25 }, {   0,  0 }, {  2,   9 }, { 106, 26 }, {  0,  0 },
-      {   0,  1 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, }, },
-  { { { 100, 46 }, {   0,  1 }, {  3,   9 }, {  21, 37 }, {  5, 20 },
-      {   0,  1 }, {   0,  2 }, {  1,   2 }, {   0,  1 }, {  0,  0 }, },
-    { { 212, 21 }, {   0,  1 }, {  0,   9 }, {   0,  0 }, {  0,  0 },
-      {   1,  2 }, {   0,  2 }, {  0,   0 }, {   2,  2 }, {  0,  0 }, },
-    { { 140, 37 }, {   0,  1 }, {  1,   8 }, {  24, 33 }, {  0,  0 },
-      {   1,  2 }, {   0,  2 }, {  0,   1 }, {   1,  2 }, {  0,  0 }, }, },
-  { { {  27, 29 }, {   0,  1 }, {  9,  25 }, {  53, 51 }, { 12, 34 },
-      {   0,  1 }, {   0,  3 }, {  1,   5 }, {   0,  2 }, {  0,  0 }, },
-    { {   4,  2 }, {   0,  0 }, {  0, 172 }, {   0,  0 }, {  0,  0 },
-      {   0,  1 }, {   0,  2 }, {  0,   0 }, {   2,  0 }, {  0,  0 }, },
-    { {  14, 23 }, {   1,  3 }, { 11,  53 }, {  90, 31 }, {  0,  0 },
-      {   0,  3 }, {   1,  5 }, {  2,   6 }, {   1,  2 }, {  0,  0 }, }, },
-  { { {  80, 38 }, {   0,  0 }, {  1,   4 }, {  69, 33 }, {  5, 16 },
-      {   0,  1 }, {   0,  1 }, {  0,   0 }, {   0,  1 }, {  0,  0 }, },
-    { { 187, 22 }, {   1,  1 }, {  0,  17 }, {   0,  0 }, {  0,  0 },
-      {   3,  6 }, {   0,  4 }, {  0,   1 }, {   4,  4 }, {  0,  1 }, },
-    { { 123, 29 }, {   0,  0 }, {  1,   7 }, {  57, 30 }, {  0,  0 },
-      {   0,  1 }, {   0,  1 }, {  0,   1 }, {   0,  1 }, {  0,  0 }, }, },
-  { { {  16, 20 }, {   0,  0 }, {  2,   8 }, { 104, 49 }, { 15, 33 },
-      {   0,  1 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, },
-    { { 133,  6 }, {   1,  2 }, {  1,  70 }, {   0,  0 }, {  0,  0 },
-      {   0,  2 }, {   0,  4 }, {  0,   3 }, {   1,  1 }, {  0,  0 }, },
-    { {  13, 14 }, {   0,  0 }, {  4,  20 }, { 175, 20 }, {  0,  0 },
-      {   0,  1 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, }, },
-  { { { 194, 16 }, {   0,  0 }, {  1,   1 }, {   1,  9 }, {  1,  3 },
-      {   0,  0 }, {   0,  1 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, },
-    { { 251,  1 }, {   0,  0 }, {  0,   2 }, {   0,  0 }, {  0,  0 },
-      {   0,  0 }, {   0,  0 }, {  0,   0 }, {   0,  0 }, {  0,  0 }, },
-    { { 202, 23 }, {   0,  0 }, {  1,   3 }, {   2,  9 }, {  0,  0 },
-      {   0,  1 }, {   0,  1 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, }, },
-};
-
-const uint8_t ff_vp56_filter_threshold[] = {
-    14, 14, 13, 13, 12, 12, 10, 10,
-    10, 10,  8,  8,  8,  8,  8,  8,
-     8,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  8,  8,  7,  7,  7,  7,
-     7,  7,  6,  6,  6,  6,  6,  6,
-     5,  5,  5,  5,  4,  4,  4,  4,
-     4,  4,  4,  3,  3,  3,  3,  2,
-};
-
-const uint8_t ff_vp56_mb_type_model_model[] = {
-    171, 83, 199, 140, 125, 104,
-};
-
-const VP56Tree ff_vp56_pmbtm_tree[] = {
-    { 4, 0},
-    { 2, 1}, {-8}, {-4},
-    { 8, 2},
-    { 6, 3},
-    { 4, 4},
-    { 2, 5}, {-24}, {-20}, {-16}, {-12}, {-0},
-};
-
-const VP56Tree ff_vp56_pmbt_tree[] = {
-    { 8, 1},
-    { 4, 2},
-    { 2, 4}, {-VP56_MB_INTER_NOVEC_PF}, {-VP56_MB_INTER_DELTA_PF},
-    { 2, 5}, {-VP56_MB_INTER_V1_PF},    {-VP56_MB_INTER_V2_PF},
-    { 4, 3},
-    { 2, 6}, {-VP56_MB_INTRA},          {-VP56_MB_INTER_4V},
-    { 4, 7},
-    { 2, 8}, {-VP56_MB_INTER_NOVEC_GF}, {-VP56_MB_INTER_DELTA_GF},
-    { 2, 9}, {-VP56_MB_INTER_V1_GF},    {-VP56_MB_INTER_V2_GF},
-};
-
-/* relative pos of surrounding blocks, from closest to farthest */
-const int8_t ff_vp56_candidate_predictor_pos[12][2] = {
-    {  0, -1 },
-    { -1,  0 },
-    { -1, -1 },
-    {  1, -1 },
-    {  0, -2 },
-    { -2,  0 },
-    { -2, -1 },
-    { -1, -2 },
-    {  1, -2 },
-    {  2, -1 },
-    { -2, -2 },
-    {  2, -2 },
-};
diff --git a/deps/libav/libavcodec/vp56data.h b/deps/libav/libavcodec/vp56data.h
deleted file mode 100644
index 21907bd..0000000
--- a/deps/libav/libavcodec/vp56data.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP5 and VP6 compatible video decoder (common data)
- */
-
-#ifndef AVCODEC_VP56DATA_H
-#define AVCODEC_VP56DATA_H
-
-#include "libavutil/common.h"
-#include "vp56.h"
-
-extern const uint8_t ff_vp56_b2p[];
-extern const uint8_t ff_vp56_b6to4[];
-extern const uint8_t ff_vp56_coeff_parse_table[6][11];
-extern const uint8_t ff_vp56_def_mb_types_stats[3][10][2];
-extern const VP56Tree ff_vp56_pva_tree[];
-extern const VP56Tree ff_vp56_pc_tree[];
-extern const uint8_t ff_vp56_coeff_bias[];
-extern const uint8_t ff_vp56_coeff_bit_length[];
-
-extern const VP56Frame ff_vp56_reference_frame[];
-extern const uint8_t ff_vp56_ac_dequant[64];
-extern const uint8_t ff_vp56_dc_dequant[64];
-extern const uint8_t ff_vp56_pre_def_mb_type_stats[16][3][10][2];
-extern const uint8_t ff_vp56_filter_threshold[];
-extern const uint8_t ff_vp56_mb_type_model_model[];
-extern const VP56Tree ff_vp56_pmbtm_tree[];
-extern const VP56Tree ff_vp56_pmbt_tree[];
-extern const int8_t ff_vp56_candidate_predictor_pos[12][2];
-
-#endif /* AVCODEC_VP56DATA_H */
diff --git a/deps/libav/libavcodec/vp56dsp.c b/deps/libav/libavcodec/vp56dsp.c
deleted file mode 100644
index 5e09d24..0000000
--- a/deps/libav/libavcodec/vp56dsp.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2006 Aurelien Jacobs <aurel at gnuage.org>
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "vp56dsp.h"
-#include "libavutil/common.h"
-
-/* Gives very similar result than the vp6 version except in a few cases */
-static int vp5_adjust(int v, int t)
-{
-    int s2, s1 = v >> 31;
-    v ^= s1;
-    v -= s1;
-    v *= v < 2*t;
-    v -= t;
-    s2 = v >> 31;
-    v ^= s2;
-    v -= s2;
-    v = t - v;
-    v += s1;
-    v ^= s1;
-    return v;
-}
-
-static int vp6_adjust(int v, int t)
-{
-    int V = v, s = v >> 31;
-    V ^= s;
-    V -= s;
-    if (V-t-1 >= (unsigned)(t-1))
-        return v;
-    V = 2*t - V;
-    V += s;
-    V ^= s;
-    return V;
-}
-
-
-#define VP56_EDGE_FILTER(pfx, suf, pix_inc, line_inc)                   \
-static void pfx##_edge_filter_##suf(uint8_t *yuv, int stride, int t)    \
-{                                                                       \
-    int pix2_inc = 2 * pix_inc;                                         \
-    int i, v;                                                           \
-                                                                        \
-    for (i=0; i<12; i++) {                                              \
-        v = (yuv[-pix2_inc] + 3*(yuv[0]-yuv[-pix_inc]) - yuv[pix_inc] + 4)>>3;\
-        v = pfx##_adjust(v, t);                                         \
-        yuv[-pix_inc] = av_clip_uint8(yuv[-pix_inc] + v);               \
-        yuv[0] = av_clip_uint8(yuv[0] - v);                             \
-        yuv += line_inc;                                                \
-    }                                                                   \
-}
-
-VP56_EDGE_FILTER(vp5, hor, 1, stride)
-VP56_EDGE_FILTER(vp5, ver, stride, 1)
-VP56_EDGE_FILTER(vp6, hor, 1, stride)
-VP56_EDGE_FILTER(vp6, ver, stride, 1)
-
-av_cold void ff_vp56dsp_init(VP56DSPContext *s, enum AVCodecID codec)
-{
-    if (codec == AV_CODEC_ID_VP5) {
-        s->edge_filter_hor = vp5_edge_filter_hor;
-        s->edge_filter_ver = vp5_edge_filter_ver;
-    } else {
-        s->edge_filter_hor = vp6_edge_filter_hor;
-        s->edge_filter_ver = vp6_edge_filter_ver;
-
-        if (CONFIG_VP6_DECODER) {
-            s->vp6_filter_diag4 = ff_vp6_filter_diag4_c;
-
-            if (ARCH_ARM)
-                ff_vp6dsp_init_arm(s, codec);
-            if (ARCH_X86)
-                ff_vp6dsp_init_x86(s, codec);
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/vp56dsp.h b/deps/libav/libavcodec/vp56dsp.h
deleted file mode 100644
index 389d359..0000000
--- a/deps/libav/libavcodec/vp56dsp.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VP56DSP_H
-#define AVCODEC_VP56DSP_H
-
-#include <stdint.h>
-#include "avcodec.h"
-
-typedef struct VP56DSPContext {
-    void (*edge_filter_hor)(uint8_t *yuv, int stride, int t);
-    void (*edge_filter_ver)(uint8_t *yuv, int stride, int t);
-
-    void (*vp6_filter_diag4)(uint8_t *dst, uint8_t *src, int stride,
-                             const int16_t *h_weights,const int16_t *v_weights);
-} VP56DSPContext;
-
-void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride,
-                           const int16_t *h_weights, const int16_t *v_weights);
-
-void ff_vp56dsp_init(VP56DSPContext *s, enum AVCodecID codec);
-void ff_vp6dsp_init_arm(VP56DSPContext *s, enum AVCodecID codec);
-void ff_vp6dsp_init_x86(VP56DSPContext* c, enum AVCodecID codec);
-
-#endif /* AVCODEC_VP56DSP_H */
diff --git a/deps/libav/libavcodec/vp56rac.c b/deps/libav/libavcodec/vp56rac.c
deleted file mode 100644
index c009cad..0000000
--- a/deps/libav/libavcodec/vp56rac.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * VP5/6/8 decoder
- * Copyright (c) 2010 Jason Garrett-Glaser <darkshikari at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "vp56.h"
-
-const uint8_t ff_vp56_norm_shift[256]= {
- 8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-
-void ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size)
-{
-    c->high = 255;
-    c->bits = -16;
-    c->buffer = buf;
-    c->end = buf + buf_size;
-    c->code_word = bytestream_get_be24(&c->buffer);
-}
diff --git a/deps/libav/libavcodec/vp5data.h b/deps/libav/libavcodec/vp5data.h
deleted file mode 100644
index b11b99d..0000000
--- a/deps/libav/libavcodec/vp5data.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP5 compatible video decoder
- */
-
-#ifndef AVCODEC_VP5DATA_H
-#define AVCODEC_VP5DATA_H
-
-#include <stdint.h>
-
-static const uint8_t vp5_coeff_groups[] = {
-    -1, 0, 1, 1, 2, 1, 1, 2,
-     2, 1, 1, 2, 2, 2, 1, 2,
-     2, 2, 2, 2, 1, 1, 2, 2,
-     3, 3, 4, 3, 4, 4, 4, 3,
-     3, 3, 3, 3, 4, 3, 3, 3,
-     4, 4, 4, 4, 4, 3, 3, 4,
-     4, 4, 3, 4, 4, 4, 4, 4,
-     4, 4, 5, 5, 5, 5, 5, 5,
-};
-
-static const uint8_t vp5_vmc_pct[2][11] = {
-    { 243, 220, 251, 253, 237, 232, 241, 245, 247, 251, 253 },
-    { 235, 211, 246, 249, 234, 231, 248, 249, 252, 252, 254 },
-};
-
-static const uint8_t vp5_dccv_pct[2][11] = {
-    { 146, 197, 181, 207, 232, 243, 238, 251, 244, 250, 249 },
-    { 179, 219, 214, 240, 250, 254, 244, 254, 254, 254, 254 },
-};
-
-static const uint8_t vp5_ract_pct[3][2][6][11] = {
-    { { { 227, 246, 230, 247, 244, 254, 254, 254, 254, 254, 254 },
-        { 202, 254, 209, 231, 231, 249, 249, 253, 254, 254, 254 },
-        { 206, 254, 225, 242, 241, 251, 253, 254, 254, 254, 254 },
-        { 235, 254, 241, 253, 252, 254, 254, 254, 254, 254, 254 },
-        { 234, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } },
-      { { 240, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 238, 254, 240, 253, 254, 254, 254, 254, 254, 254, 254 },
-        { 244, 254, 251, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } } },
-    { { { 206, 203, 227, 239, 247, 254, 253, 254, 254, 254, 254 },
-        { 207, 199, 220, 236, 243, 252, 252, 254, 254, 254, 254 },
-        { 212, 219, 230, 243, 244, 253, 252, 254, 254, 254, 254 },
-        { 236, 237, 247, 252, 253, 254, 254, 254, 254, 254, 254 },
-        { 240, 240, 248, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } },
-      { { 230, 233, 249, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 238, 238, 250, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 248, 251, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } } },
-    { { { 225, 239, 227, 231, 244, 253, 243, 254, 254, 253, 254 },
-        { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 254 },
-        { 235, 249, 238, 240, 251, 254, 249, 254, 253, 253, 254 },
-        { 249, 253, 251, 250, 254, 254, 254, 254, 254, 254, 254 },
-        { 251, 250, 249, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } },
-      { { 243, 244, 250, 250, 254, 254, 254, 254, 254, 254, 254 },
-        { 249, 248, 250, 253, 254, 254, 254, 254, 254, 254, 254 },
-        { 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
-        { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } } },
-};
-
-static const int16_t vp5_dccv_lc[5][36][2] = {
-    { {154,  61}, {141,  54}, { 90,  45}, { 54,  34}, { 54,  13}, {128, 109},
-      {136,  54}, {148,  45}, { 92,  41}, { 54,  33}, { 51,  15}, { 87, 113},
-      { 87,  44}, { 97,  40}, { 67,  36}, { 46,  29}, { 41,  15}, { 64,  80},
-      { 59,  33}, { 61,  31}, { 51,  28}, { 44,  22}, { 33,  12}, { 49,  63},
-      { 69,  12}, { 59,  16}, { 46,  14}, { 31,  13}, { 26,   6}, { 92,  26},
-      {128, 108}, { 77, 119}, { 54,  84}, { 26,  71}, { 87,  19}, { 95, 155} },
-    { {154,   4}, {182,   0}, {159,  -8}, {128,  -5}, {143,  -5}, {187,  55},
-      {182,   0}, {228,  -3}, {187,  -7}, {174,  -9}, {189, -11}, {169,  79},
-      {161,  -9}, {192,  -8}, {187,  -9}, {169, -10}, {136,  -9}, {184,  40},
-      {164, -11}, {179, -10}, {174, -10}, {161, -10}, {115,  -7}, {197,  20},
-      {195, -11}, {195, -11}, {146, -10}, {110,  -6}, { 95,  -4}, {195,  39},
-      {182,  55}, {172,  77}, {177,  37}, {169,  29}, {172,  52}, { 92, 162} },
-    { {174,  80}, {164,  80}, { 95,  80}, { 46,  66}, { 56,  24}, { 36, 193},
-      {164,  80}, {166,  77}, {105,  76}, { 49,  68}, { 46,  31}, { 49, 186},
-      { 97,  78}, {110,  74}, { 72,  72}, { 44,  60}, { 33,  30}, { 69, 131},
-      { 61,  61}, { 69,  63}, { 51,  57}, { 31,  48}, { 26,  27}, { 64,  89},
-      { 67,  23}, { 51,  32}, { 36,  33}, { 26,  28}, { 20,  12}, { 44,  68},
-      { 26, 197}, { 41, 189}, { 61, 129}, { 28, 103}, { 49,  52}, {-12, 245} },
-    { {102, 141}, { 79, 166}, { 72, 162}, { 97, 125}, {179,   4}, {307,   0},
-      { 72, 168}, { 69, 175}, { 84, 160}, {105, 127}, {148,  34}, {310,   0},
-      { 84, 151}, { 82, 161}, { 87, 153}, { 87, 135}, {115,  51}, {317,   0},
-      { 97, 125}, {102, 131}, {105, 125}, { 87, 122}, { 84,  64}, { 54, 184},
-      {166,  18}, {146,  43}, {125,  51}, { 90,  64}, { 95,   7}, { 38, 154},
-      {294,   0}, { 13, 225}, { 10, 225}, { 67, 168}, {  0, 167}, {161,  94} },
-    { {172,  76}, {172,  75}, {136,  80}, { 64,  98}, { 74,  67}, {315,   0},
-      {169,  76}, {207,  56}, {164,  66}, { 97,  80}, { 67,  72}, {328,   0},
-      {136,  80}, {187,  53}, {154,  62}, { 72,  85}, { -2, 105}, {305,   0},
-      { 74,  91}, {128,  64}, {113,  64}, { 61,  77}, { 41,  75}, {259,   0},
-      { 46,  84}, { 51,  81}, { 28,  89}, { 31,  78}, { 23,  77}, {202,   0},
-      {323,   0}, {323,   0}, {300,   0}, {236,   0}, {195,   0}, {328,   0} },
-};
-
-static const int16_t vp5_ract_lc[3][3][5][6][2] = {
-    { { { {276,  0}, {238,  0}, {195,  0}, {156,  0}, {113,  0}, {274,  0} },
-        { {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1} },
-        { {192, 59}, {182, 50}, {141, 48}, {110, 40}, { 92, 19}, {125,128} },
-        { {169, 87}, {169, 83}, {184, 62}, {220, 16}, {184,  0}, {264,  0} },
-        { {212, 40}, {212, 36}, {169, 49}, {174, 27}, {  8,120}, {182, 71} } },
-      { { {259, 10}, {197, 19}, {143, 22}, {123, 16}, {110,  8}, {133, 88} },
-        { {  0,  1}, {256,  0}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1} },
-        { {207, 46}, {187, 50}, { 97, 83}, { 23,100}, { 41, 56}, { 56,188} },
-        { {166, 90}, {146,108}, {161, 88}, {136, 95}, {174,  0}, {266,  0} },
-        { {264,  7}, {243, 18}, {184, 43}, {-14,154}, { 20,112}, { 20,199} } },
-      { { {230, 26}, {197, 22}, {159, 20}, {146, 12}, {136,  4}, { 54,162} },
-        { {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1} },
-        { {192, 59}, {156, 72}, { 84,101}, { 49,101}, { 79, 47}, { 79,167} },
-        { {138,115}, {136,116}, {166, 80}, {238,  0}, {195,  0}, {261,  0} },
-        { {225, 33}, {205, 42}, {159, 61}, { 79, 96}, { 92, 66}, { 28,195} } },
-    }, {
-      { { {200, 37}, {197, 18}, {159, 13}, {143,  7}, {102,  5}, {123,126} },
-        { {197,  3}, {220, -9}, {210,-12}, {187, -6}, {151, -2}, {174, 80} },
-        { {200, 53}, {187, 47}, {159, 40}, {118, 38}, {100, 18}, {141,111} },
-        { {179, 78}, {166, 86}, {197, 50}, {207, 27}, {187,  0}, {115,139} },
-        { {218, 34}, {220, 29}, {174, 46}, {128, 61}, { 54, 89}, {187, 65} } },
-      { { {238, 14}, {197, 18}, {125, 26}, { 90, 25}, { 82, 13}, {161, 86} },
-        { {189,  1}, {205, -2}, {156, -4}, {143, -4}, {146, -4}, {172, 72} },
-        { {230, 31}, {192, 45}, {102, 76}, { 38, 85}, { 56, 41}, { 64,173} },
-        { {166, 91}, {141,111}, {128,116}, {118,109}, {177,  0}, { 23,222} },
-        { {253, 14}, {236, 21}, {174, 49}, { 33,118}, { 44, 93}, { 23,187} } },
-      { { {218, 28}, {179, 28}, {118, 35}, { 95, 30}, { 72, 24}, {128,108} },
-        { {187,  1}, {174, -1}, {125, -1}, {110, -1}, {108, -1}, {202, 52} },
-        { {197, 53}, {146, 75}, { 46,118}, { 33,103}, { 64, 50}, {118,126} },
-        { {138,114}, {128,122}, {161, 86}, {243, -6}, {195,  0}, { 38,210} },
-        { {215, 39}, {179, 58}, { 97,101}, { 95, 85}, { 87, 70}, { 69,152} } },
-    }, {
-      { { {236, 24}, {205, 18}, {172, 12}, {154,  6}, {125,  1}, {169, 75} },
-        { {187,  4}, {230, -2}, {228, -4}, {236, -4}, {241, -2}, {192, 66} },
-        { {200, 46}, {187, 42}, {159, 34}, {136, 25}, {105, 10}, {179, 62} },
-        { {207, 55}, {192, 63}, {192, 54}, {195, 36}, {177,  1}, {143, 98} },
-        { {225, 27}, {207, 34}, {200, 30}, {131, 57}, { 97, 60}, {197, 45} } },
-      { { {271,  8}, {218, 13}, {133, 19}, { 90, 19}, { 72,  7}, {182, 51} },
-        { {179,  1}, {225, -1}, {154, -2}, {110, -1}, { 92,  0}, {195, 41} },
-        { {241, 26}, {189, 40}, { 82, 64}, { 33, 60}, { 67, 17}, {120, 94} },
-        { {192, 68}, {151, 94}, {146, 90}, {143, 72}, {161,  0}, {113,128} },
-        { {256, 12}, {218, 29}, {166, 48}, { 44, 99}, { 31, 87}, {148, 78} } },
-      { { {238, 20}, {184, 22}, {113, 27}, { 90, 22}, { 74,  9}, {192, 37} },
-        { {184,  0}, {215, -1}, {141, -1}, { 97,  0}, { 49,  0}, {264, 13} },
-        { {182, 51}, {138, 61}, { 95, 63}, { 54, 59}, { 64, 25}, {200, 45} },
-        { {179, 75}, {156, 87}, {174, 65}, {177, 44}, {174,  0}, {164, 85} },
-        { {195, 45}, {148, 65}, {105, 79}, { 95, 72}, { 87, 60}, {169, 63} } },
-    }
-};
-
-static const uint8_t vp5_coord_div[] = { 2, 2, 2, 2, 4, 4 };
-
-#endif /* AVCODEC_VP5DATA_H */
diff --git a/deps/libav/libavcodec/vp6.c b/deps/libav/libavcodec/vp6.c
deleted file mode 100644
index d10a640..0000000
--- a/deps/libav/libavcodec/vp6.c
+++ /dev/null
@@ -1,679 +0,0 @@
-/*
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP6 compatible video decoder
- *
- * The VP6F decoder accepts an optional 1 byte extradata. It is composed of:
- *  - upper 4 bits: difference between encoded width and visible width
- *  - lower 4 bits: difference between encoded height and visible height
- */
-
-#include <stdlib.h>
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "huffman.h"
-#include "internal.h"
-
-#include "vp56.h"
-#include "vp56data.h"
-#include "vp6data.h"
-
-#define VP6_MAX_HUFF_SIZE 12
-
-static void vp6_parse_coeff(VP56Context *s);
-static void vp6_parse_coeff_huffman(VP56Context *s);
-
-static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
-                            int *golden_frame)
-{
-    VP56RangeCoder *c = &s->c;
-    int parse_filter_info = 0;
-    int coeff_offset = 0;
-    int vrt_shift = 0;
-    int sub_version;
-    int rows, cols;
-    int res = 0;
-    int separated_coeff = buf[0] & 1;
-
-    s->frames[VP56_FRAME_CURRENT]->key_frame = !(buf[0] & 0x80);
-    ff_vp56_init_dequant(s, (buf[0] >> 1) & 0x3F);
-
-    if (s->frames[VP56_FRAME_CURRENT]->key_frame) {
-        sub_version = buf[1] >> 3;
-        if (sub_version > 8)
-            return AVERROR_INVALIDDATA;
-        s->filter_header = buf[1] & 0x06;
-        if (buf[1] & 1) {
-            avpriv_report_missing_feature(s->avctx, "Interlacing");
-            return AVERROR_PATCHWELCOME;
-        }
-        if (separated_coeff || !s->filter_header) {
-            coeff_offset = AV_RB16(buf+2) - 2;
-            buf += 2;
-            buf_size -= 2;
-        }
-
-        rows = buf[2];  /* number of stored macroblock rows */
-        cols = buf[3];  /* number of stored macroblock cols */
-        /* buf[4] is number of displayed macroblock rows */
-        /* buf[5] is number of displayed macroblock cols */
-        if (!rows || !cols) {
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid size %dx%d\n", cols << 4, rows << 4);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (!s->macroblocks || /* first frame */
-            16*cols != s->avctx->coded_width ||
-            16*rows != s->avctx->coded_height) {
-            if (s->avctx->extradata_size == 0 &&
-                FFALIGN(s->avctx->width,  16) == 16 * cols &&
-                FFALIGN(s->avctx->height, 16) == 16 * rows) {
-                // We assume this is properly signalled container cropping,
-                // in an F4V file. Just set the coded_width/height, don't
-                // touch the cropped ones.
-                s->avctx->coded_width  = 16 * cols;
-                s->avctx->coded_height = 16 * rows;
-            } else {
-                int ret = ff_set_dimensions(s->avctx, 16 * cols, 16 * rows);
-                if (ret < 0)
-                    return ret;
-
-                if (s->avctx->extradata_size == 1) {
-                    s->avctx->width  -= s->avctx->extradata[0] >> 4;
-                    s->avctx->height -= s->avctx->extradata[0] & 0x0F;
-                }
-            }
-            res = VP56_SIZE_CHANGE;
-        }
-
-        ff_vp56_init_range_decoder(c, buf+6, buf_size-6);
-        vp56_rac_gets(c, 2);
-
-        parse_filter_info = s->filter_header;
-        if (sub_version < 8)
-            vrt_shift = 5;
-        s->sub_version = sub_version;
-    } else {
-        if (!s->sub_version || !s->avctx->coded_width || !s->avctx->coded_height)
-            return AVERROR_INVALIDDATA;
-
-        if (separated_coeff || !s->filter_header) {
-            coeff_offset = AV_RB16(buf+1) - 2;
-            buf += 2;
-            buf_size -= 2;
-        }
-        ff_vp56_init_range_decoder(c, buf+1, buf_size-1);
-
-        *golden_frame = vp56_rac_get(c);
-        if (s->filter_header) {
-            s->deblock_filtering = vp56_rac_get(c);
-            if (s->deblock_filtering)
-                vp56_rac_get(c);
-            if (s->sub_version > 7)
-                parse_filter_info = vp56_rac_get(c);
-        }
-    }
-
-    if (parse_filter_info) {
-        if (vp56_rac_get(c)) {
-            s->filter_mode = 2;
-            s->sample_variance_threshold = vp56_rac_gets(c, 5) << vrt_shift;
-            s->max_vector_length = 2 << vp56_rac_gets(c, 3);
-        } else if (vp56_rac_get(c)) {
-            s->filter_mode = 1;
-        } else {
-            s->filter_mode = 0;
-        }
-        if (s->sub_version > 7)
-            s->filter_selection = vp56_rac_gets(c, 4);
-        else
-            s->filter_selection = 16;
-    }
-
-    s->use_huffman = vp56_rac_get(c);
-
-    s->parse_coeff = vp6_parse_coeff;
-    if (coeff_offset) {
-        buf      += coeff_offset;
-        buf_size -= coeff_offset;
-        if (buf_size < 0) {
-            if (s->frames[VP56_FRAME_CURRENT]->key_frame)
-                ff_set_dimensions(s->avctx, 0, 0);
-            return AVERROR_INVALIDDATA;
-        }
-        if (s->use_huffman) {
-            s->parse_coeff = vp6_parse_coeff_huffman;
-            init_get_bits(&s->gb, buf, buf_size<<3);
-        } else {
-            ff_vp56_init_range_decoder(&s->cc, buf, buf_size);
-            s->ccp = &s->cc;
-        }
-    } else {
-        s->ccp = &s->c;
-    }
-
-    return res;
-}
-
-static void vp6_coeff_order_table_init(VP56Context *s)
-{
-    int i, pos, idx = 1;
-
-    s->modelp->coeff_index_to_pos[0] = 0;
-    for (i=0; i<16; i++)
-        for (pos=1; pos<64; pos++)
-            if (s->modelp->coeff_reorder[pos] == i)
-                s->modelp->coeff_index_to_pos[idx++] = pos;
-}
-
-static void vp6_default_models_init(VP56Context *s)
-{
-    VP56Model *model = s->modelp;
-
-    model->vector_dct[0] = 0xA2;
-    model->vector_dct[1] = 0xA4;
-    model->vector_sig[0] = 0x80;
-    model->vector_sig[1] = 0x80;
-
-    memcpy(model->mb_types_stats, ff_vp56_def_mb_types_stats, sizeof(model->mb_types_stats));
-    memcpy(model->vector_fdv, vp6_def_fdv_vector_model, sizeof(model->vector_fdv));
-    memcpy(model->vector_pdv, vp6_def_pdv_vector_model, sizeof(model->vector_pdv));
-    memcpy(model->coeff_runv, vp6_def_runv_coeff_model, sizeof(model->coeff_runv));
-    memcpy(model->coeff_reorder, vp6_def_coeff_reorder, sizeof(model->coeff_reorder));
-
-    vp6_coeff_order_table_init(s);
-}
-
-static void vp6_parse_vector_models(VP56Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-    VP56Model *model = s->modelp;
-    int comp, node;
-
-    for (comp=0; comp<2; comp++) {
-        if (vp56_rac_get_prob(c, vp6_sig_dct_pct[comp][0]))
-            model->vector_dct[comp] = vp56_rac_gets_nn(c, 7);
-        if (vp56_rac_get_prob(c, vp6_sig_dct_pct[comp][1]))
-            model->vector_sig[comp] = vp56_rac_gets_nn(c, 7);
-    }
-
-    for (comp=0; comp<2; comp++)
-        for (node=0; node<7; node++)
-            if (vp56_rac_get_prob(c, vp6_pdv_pct[comp][node]))
-                model->vector_pdv[comp][node] = vp56_rac_gets_nn(c, 7);
-
-    for (comp=0; comp<2; comp++)
-        for (node=0; node<8; node++)
-            if (vp56_rac_get_prob(c, vp6_fdv_pct[comp][node]))
-                model->vector_fdv[comp][node] = vp56_rac_gets_nn(c, 7);
-}
-
-/* nodes must ascend by count, but with descending symbol order */
-static int vp6_huff_cmp(const void *va, const void *vb)
-{
-    const Node *a = va, *b = vb;
-    return (a->count - b->count)*16 + (b->sym - a->sym);
-}
-
-static int vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],
-                               const uint8_t *map, unsigned size, VLC *vlc)
-{
-    Node nodes[2*VP6_MAX_HUFF_SIZE], *tmp = &nodes[size];
-    int a, b, i;
-
-    /* first compute probabilities from model */
-    tmp[0].count = 256;
-    for (i=0; i<size-1; i++) {
-        a = tmp[i].count *        coeff_model[i]  >> 8;
-        b = tmp[i].count * (255 - coeff_model[i]) >> 8;
-        nodes[map[2*i  ]].count = a + !a;
-        nodes[map[2*i+1]].count = b + !b;
-    }
-
-    ff_free_vlc(vlc);
-    /* then build the huffman tree according to probabilities */
-    return ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp,
-                              FF_HUFFMAN_FLAG_HNODE_FIRST);
-}
-
-static int vp6_parse_coeff_models(VP56Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-    VP56Model *model = s->modelp;
-    int def_prob[11];
-    int node, cg, ctx, pos;
-    int ct;    /* code type */
-    int pt;    /* plane type (0 for Y, 1 for U or V) */
-
-    memset(def_prob, 0x80, sizeof(def_prob));
-
-    for (pt=0; pt<2; pt++)
-        for (node=0; node<11; node++)
-            if (vp56_rac_get_prob(c, vp6_dccv_pct[pt][node])) {
-                def_prob[node] = vp56_rac_gets_nn(c, 7);
-                model->coeff_dccv[pt][node] = def_prob[node];
-            } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) {
-                model->coeff_dccv[pt][node] = def_prob[node];
-            }
-
-    if (vp56_rac_get(c)) {
-        for (pos=1; pos<64; pos++)
-            if (vp56_rac_get_prob(c, vp6_coeff_reorder_pct[pos]))
-                model->coeff_reorder[pos] = vp56_rac_gets(c, 4);
-        vp6_coeff_order_table_init(s);
-    }
-
-    for (cg=0; cg<2; cg++)
-        for (node=0; node<14; node++)
-            if (vp56_rac_get_prob(c, vp6_runv_pct[cg][node]))
-                model->coeff_runv[cg][node] = vp56_rac_gets_nn(c, 7);
-
-    for (ct=0; ct<3; ct++)
-        for (pt=0; pt<2; pt++)
-            for (cg=0; cg<6; cg++)
-                for (node=0; node<11; node++)
-                    if (vp56_rac_get_prob(c, vp6_ract_pct[ct][pt][cg][node])) {
-                        def_prob[node] = vp56_rac_gets_nn(c, 7);
-                        model->coeff_ract[pt][ct][cg][node] = def_prob[node];
-                    } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) {
-                        model->coeff_ract[pt][ct][cg][node] = def_prob[node];
-                    }
-
-    if (s->use_huffman) {
-        for (pt=0; pt<2; pt++) {
-            if (vp6_build_huff_tree(s, model->coeff_dccv[pt],
-                                    vp6_huff_coeff_map, 12, &s->dccv_vlc[pt]))
-                return -1;
-            if (vp6_build_huff_tree(s, model->coeff_runv[pt],
-                                    vp6_huff_run_map, 9, &s->runv_vlc[pt]))
-                return -1;
-            for (ct=0; ct<3; ct++)
-                for (cg = 0; cg < 6; cg++)
-                    if (vp6_build_huff_tree(s, model->coeff_ract[pt][ct][cg],
-                                            vp6_huff_coeff_map, 12,
-                                            &s->ract_vlc[pt][ct][cg]))
-                        return -1;
-        }
-        memset(s->nb_null, 0, sizeof(s->nb_null));
-    } else {
-    /* coeff_dcct is a linear combination of coeff_dccv */
-    for (pt=0; pt<2; pt++)
-        for (ctx=0; ctx<3; ctx++)
-            for (node=0; node<5; node++)
-                model->coeff_dcct[pt][ctx][node] = av_clip(((model->coeff_dccv[pt][node] * vp6_dccv_lc[ctx][node][0] + 128) >> 8) + vp6_dccv_lc[ctx][node][1], 1, 255);
-    }
-    return 0;
-}
-
-static void vp6_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
-{
-    VP56RangeCoder *c = &s->c;
-    VP56Model *model = s->modelp;
-    int comp;
-
-    *vect = (VP56mv) {0,0};
-    if (s->vector_candidate_pos < 2)
-        *vect = s->vector_candidate[0];
-
-    for (comp=0; comp<2; comp++) {
-        int i, delta = 0;
-
-        if (vp56_rac_get_prob(c, model->vector_dct[comp])) {
-            static const uint8_t prob_order[] = {0, 1, 2, 7, 6, 5, 4};
-            for (i=0; i<sizeof(prob_order); i++) {
-                int j = prob_order[i];
-                delta |= vp56_rac_get_prob(c, model->vector_fdv[comp][j])<<j;
-            }
-            if (delta & 0xF0)
-                delta |= vp56_rac_get_prob(c, model->vector_fdv[comp][3])<<3;
-            else
-                delta |= 8;
-        } else {
-            delta = vp56_rac_get_tree(c, ff_vp56_pva_tree,
-                                      model->vector_pdv[comp]);
-        }
-
-        if (delta && vp56_rac_get_prob(c, model->vector_sig[comp]))
-            delta = -delta;
-
-        if (!comp)
-            vect->x += delta;
-        else
-            vect->y += delta;
-    }
-}
-
-/**
- * Read number of consecutive blocks with null DC or AC.
- * This value is < 74.
- */
-static unsigned vp6_get_nb_null(VP56Context *s)
-{
-    unsigned val = get_bits(&s->gb, 2);
-    if (val == 2)
-        val += get_bits(&s->gb, 2);
-    else if (val == 3) {
-        val = get_bits1(&s->gb) << 2;
-        val = 6+val + get_bits(&s->gb, 2+val);
-    }
-    return val;
-}
-
-static void vp6_parse_coeff_huffman(VP56Context *s)
-{
-    VP56Model *model = s->modelp;
-    uint8_t *permute = s->idct_scantable;
-    VLC *vlc_coeff;
-    int coeff, sign, coeff_idx;
-    int b, cg, idx;
-    int pt = 0;    /* plane type (0 for Y, 1 for U or V) */
-
-    for (b=0; b<6; b++) {
-        int ct = 0;    /* code type */
-        if (b > 3) pt = 1;
-        vlc_coeff = &s->dccv_vlc[pt];
-
-        for (coeff_idx = 0;;) {
-            int run = 1;
-            if (coeff_idx<2 && s->nb_null[coeff_idx][pt]) {
-                s->nb_null[coeff_idx][pt]--;
-                if (coeff_idx)
-                    break;
-            } else {
-                if (get_bits_left(&s->gb) <= 0)
-                    return;
-                coeff = get_vlc2(&s->gb, vlc_coeff->table, 9, 3);
-                if (coeff == 0) {
-                    if (coeff_idx) {
-                        int pt = (coeff_idx >= 6);
-                        run += get_vlc2(&s->gb, s->runv_vlc[pt].table, 9, 3);
-                        if (run >= 9)
-                            run += get_bits(&s->gb, 6);
-                    } else
-                        s->nb_null[0][pt] = vp6_get_nb_null(s);
-                    ct = 0;
-                } else if (coeff == 11) {  /* end of block */
-                    if (coeff_idx == 1)    /* first AC coeff ? */
-                        s->nb_null[1][pt] = vp6_get_nb_null(s);
-                    break;
-                } else {
-                    int coeff2 = ff_vp56_coeff_bias[coeff];
-                    if (coeff > 4)
-                        coeff2 += get_bits(&s->gb, coeff <= 9 ? coeff - 4 : 11);
-                    ct = 1 + (coeff2 > 1);
-                    sign = get_bits1(&s->gb);
-                    coeff2 = (coeff2 ^ -sign) + sign;
-                    if (coeff_idx)
-                        coeff2 *= s->dequant_ac;
-                    idx = model->coeff_index_to_pos[coeff_idx];
-                    s->block_coeff[b][permute[idx]] = coeff2;
-                }
-            }
-            coeff_idx+=run;
-            if (coeff_idx >= 64)
-                break;
-            cg = FFMIN(vp6_coeff_groups[coeff_idx], 3);
-            vlc_coeff = &s->ract_vlc[pt][ct][cg];
-        }
-    }
-}
-
-static void vp6_parse_coeff(VP56Context *s)
-{
-    VP56RangeCoder *c = s->ccp;
-    VP56Model *model = s->modelp;
-    uint8_t *permute = s->idct_scantable;
-    uint8_t *model1, *model2, *model3;
-    int coeff, sign, coeff_idx;
-    int b, i, cg, idx, ctx;
-    int pt = 0;    /* plane type (0 for Y, 1 for U or V) */
-
-    for (b=0; b<6; b++) {
-        int ct = 1;    /* code type */
-        int run = 1;
-
-        if (b > 3) pt = 1;
-
-        ctx = s->left_block[ff_vp56_b6to4[b]].not_null_dc
-              + s->above_blocks[s->above_block_idx[b]].not_null_dc;
-        model1 = model->coeff_dccv[pt];
-        model2 = model->coeff_dcct[pt][ctx];
-
-        coeff_idx = 0;
-        for (;;) {
-            if ((coeff_idx>1 && ct==0) || vp56_rac_get_prob(c, model2[0])) {
-                /* parse a coeff */
-                if (vp56_rac_get_prob(c, model2[2])) {
-                    if (vp56_rac_get_prob(c, model2[3])) {
-                        idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1);
-                        coeff = ff_vp56_coeff_bias[idx+5];
-                        for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--)
-                            coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i;
-                    } else {
-                        if (vp56_rac_get_prob(c, model2[4]))
-                            coeff = 3 + vp56_rac_get_prob(c, model1[5]);
-                        else
-                            coeff = 2;
-                    }
-                    ct = 2;
-                } else {
-                    ct = 1;
-                    coeff = 1;
-                }
-                sign = vp56_rac_get(c);
-                coeff = (coeff ^ -sign) + sign;
-                if (coeff_idx)
-                    coeff *= s->dequant_ac;
-                idx = model->coeff_index_to_pos[coeff_idx];
-                s->block_coeff[b][permute[idx]] = coeff;
-                run = 1;
-            } else {
-                /* parse a run */
-                ct = 0;
-                if (coeff_idx > 0) {
-                    if (!vp56_rac_get_prob(c, model2[1]))
-                        break;
-
-                    model3 = model->coeff_runv[coeff_idx >= 6];
-                    run = vp56_rac_get_tree(c, vp6_pcr_tree, model3);
-                    if (!run)
-                        for (run=9, i=0; i<6; i++)
-                            run += vp56_rac_get_prob(c, model3[i+8]) << i;
-                }
-            }
-            coeff_idx += run;
-            if (coeff_idx >= 64)
-                break;
-            cg = vp6_coeff_groups[coeff_idx];
-            model1 = model2 = model->coeff_ract[pt][ct][cg];
-        }
-
-        s->left_block[ff_vp56_b6to4[b]].not_null_dc =
-        s->above_blocks[s->above_block_idx[b]].not_null_dc = !!s->block_coeff[b][0];
-    }
-}
-
-static int vp6_block_variance(uint8_t *src, int stride)
-{
-    int sum = 0, square_sum = 0;
-    int y, x;
-
-    for (y=0; y<8; y+=2) {
-        for (x=0; x<8; x+=2) {
-            sum += src[x];
-            square_sum += src[x]*src[x];
-        }
-        src += 2*stride;
-    }
-    return (16*square_sum - sum*sum) >> 8;
-}
-
-static void vp6_filter_hv4(uint8_t *dst, uint8_t *src, int stride,
-                           int delta, const int16_t *weights)
-{
-    int x, y;
-
-    for (y=0; y<8; y++) {
-        for (x=0; x<8; x++) {
-            dst[x] = av_clip_uint8((  src[x-delta  ] * weights[0]
-                                 + src[x        ] * weights[1]
-                                 + src[x+delta  ] * weights[2]
-                                 + src[x+2*delta] * weights[3] + 64) >> 7);
-        }
-        src += stride;
-        dst += stride;
-    }
-}
-
-static void vp6_filter_diag2(VP56Context *s, uint8_t *dst, uint8_t *src,
-                             int stride, int h_weight, int v_weight)
-{
-    uint8_t *tmp = s->edge_emu_buffer+16;
-    s->h264chroma.put_h264_chroma_pixels_tab[0](tmp, src, stride, 9, h_weight, 0);
-    s->h264chroma.put_h264_chroma_pixels_tab[0](dst, tmp, stride, 8, 0, v_weight);
-}
-
-static void vp6_filter(VP56Context *s, uint8_t *dst, uint8_t *src,
-                       int offset1, int offset2, int stride,
-                       VP56mv mv, int mask, int select, int luma)
-{
-    int filter4 = 0;
-    int x8 = mv.x & mask;
-    int y8 = mv.y & mask;
-
-    if (luma) {
-        x8 *= 2;
-        y8 *= 2;
-        filter4 = s->filter_mode;
-        if (filter4 == 2) {
-            if (s->max_vector_length &&
-                (FFABS(mv.x) > s->max_vector_length ||
-                 FFABS(mv.y) > s->max_vector_length)) {
-                filter4 = 0;
-            } else if (s->sample_variance_threshold
-                       && (vp6_block_variance(src+offset1, stride)
-                           < s->sample_variance_threshold)) {
-                filter4 = 0;
-            }
-        }
-    }
-
-    if ((y8 && (offset2-offset1)*s->flip<0) || (!y8 && offset1 > offset2)) {
-        offset1 = offset2;
-    }
-
-    if (filter4) {
-        if (!y8) {                      /* left or right combine */
-            vp6_filter_hv4(dst, src+offset1, stride, 1,
-                           vp6_block_copy_filter[select][x8]);
-        } else if (!x8) {               /* above or below combine */
-            vp6_filter_hv4(dst, src+offset1, stride, stride,
-                           vp6_block_copy_filter[select][y8]);
-        } else {
-            s->vp56dsp.vp6_filter_diag4(dst, src+offset1+((mv.x^mv.y)>>31), stride,
-                             vp6_block_copy_filter[select][x8],
-                             vp6_block_copy_filter[select][y8]);
-        }
-    } else {
-        if (!x8 || !y8) {
-            s->h264chroma.put_h264_chroma_pixels_tab[0](dst, src + offset1, stride, 8, x8, y8);
-        } else {
-            vp6_filter_diag2(s, dst, src+offset1 + ((mv.x^mv.y)>>31), stride, x8, y8);
-        }
-    }
-}
-
-static av_cold int vp6_decode_init(AVCodecContext *avctx)
-{
-    VP56Context *s = avctx->priv_data;
-    int ret;
-
-    if ((ret = ff_vp56_init(avctx, avctx->codec->id == AV_CODEC_ID_VP6,
-                            avctx->codec->id == AV_CODEC_ID_VP6A)) < 0)
-        return ret;
-
-    s->vp56_coord_div = vp6_coord_div;
-    s->parse_vector_adjustment = vp6_parse_vector_adjustment;
-    s->filter = vp6_filter;
-    s->default_models_init = vp6_default_models_init;
-    s->parse_vector_models = vp6_parse_vector_models;
-    s->parse_coeff_models = vp6_parse_coeff_models;
-    s->parse_header = vp6_parse_header;
-
-    return 0;
-}
-
-static av_cold int vp6_decode_free(AVCodecContext *avctx)
-{
-    VP56Context *s = avctx->priv_data;
-    int pt, ct, cg;
-
-    ff_vp56_free(avctx);
-
-    for (pt=0; pt<2; pt++) {
-        ff_free_vlc(&s->dccv_vlc[pt]);
-        ff_free_vlc(&s->runv_vlc[pt]);
-        for (ct=0; ct<3; ct++)
-            for (cg=0; cg<6; cg++)
-                ff_free_vlc(&s->ract_vlc[pt][ct][cg]);
-    }
-    return 0;
-}
-
-AVCodec ff_vp6_decoder = {
-    .name           = "vp6",
-    .long_name      = NULL_IF_CONFIG_SMALL("On2 VP6"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VP6,
-    .priv_data_size = sizeof(VP56Context),
-    .init           = vp6_decode_init,
-    .close          = vp6_decode_free,
-    .decode         = ff_vp56_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-/* flash version, not flipped upside-down */
-AVCodec ff_vp6f_decoder = {
-    .name           = "vp6f",
-    .long_name      = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VP6F,
-    .priv_data_size = sizeof(VP56Context),
-    .init           = vp6_decode_init,
-    .close          = vp6_decode_free,
-    .decode         = ff_vp56_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
-
-/* flash version, not flipped upside-down, with alpha channel */
-AVCodec ff_vp6a_decoder = {
-    .name           = "vp6a",
-    .long_name      = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version, with alpha channel)"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VP6A,
-    .priv_data_size = sizeof(VP56Context),
-    .init           = vp6_decode_init,
-    .close          = vp6_decode_free,
-    .decode         = ff_vp56_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/vp6data.h b/deps/libav/libavcodec/vp6data.h
deleted file mode 100644
index 2de90e7..0000000
--- a/deps/libav/libavcodec/vp6data.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP6 compatible video decoder
- */
-
-#ifndef AVCODEC_VP6DATA_H
-#define AVCODEC_VP6DATA_H
-
-#include <stdint.h>
-
-#include "vp56.h"
-
-static const uint8_t vp6_def_fdv_vector_model[2][8] = {
-    { 247, 210, 135, 68, 138, 220, 239, 246 },
-    { 244, 184, 201, 44, 173, 221, 239, 253 },
-};
-
-static const uint8_t vp6_def_pdv_vector_model[2][7] = {
-    { 225, 146, 172, 147, 214,  39, 156 },
-    { 204, 170, 119, 235, 140, 230, 228 },
-};
-
-static const uint8_t vp6_def_coeff_reorder[] = {
-     0,  0,  1,  1,  1,  2,  2,  2,
-     2,  2,  2,  3,  3,  4,  4,  4,
-     5,  5,  5,  5,  6,  6,  7,  7,
-     7,  7,  7,  8,  8,  9,  9,  9,
-     9,  9,  9, 10, 10, 11, 11, 11,
-    11, 11, 11, 12, 12, 12, 12, 12,
-    12, 13, 13, 13, 13, 13, 14, 14,
-    14, 14, 15, 15, 15, 15, 15, 15,
-};
-
-static const uint8_t vp6_def_runv_coeff_model[2][14] = {
-    { 198, 197, 196, 146, 198, 204, 169, 142, 130, 136, 149, 149, 191, 249 },
-    { 135, 201, 181, 154,  98, 117, 132, 126, 146, 169, 184, 240, 246, 254 },
-};
-
-static const uint8_t vp6_sig_dct_pct[2][2] = {
-    { 237, 246 },
-    { 231, 243 },
-};
-
-static const uint8_t vp6_pdv_pct[2][7] = {
-    { 253, 253, 254, 254, 254, 254, 254 },
-    { 245, 253, 254, 254, 254, 254, 254 },
-};
-
-static const uint8_t vp6_fdv_pct[2][8] = {
-    { 254, 254, 254, 254, 254, 250, 250, 252 },
-    { 254, 254, 254, 254, 254, 251, 251, 254 },
-};
-
-static const uint8_t vp6_dccv_pct[2][11] = {
-    { 146, 255, 181, 207, 232, 243, 238, 251, 244, 250, 249 },
-    { 179, 255, 214, 240, 250, 255, 244, 255, 255, 255, 255 },
-};
-
-static const uint8_t vp6_coeff_reorder_pct[] =  {
-    255, 132, 132, 159, 153, 151, 161, 170,
-    164, 162, 136, 110, 103, 114, 129, 118,
-    124, 125, 132, 136, 114, 110, 142, 135,
-    134, 123, 143, 126, 153, 183, 166, 161,
-    171, 180, 179, 164, 203, 218, 225, 217,
-    215, 206, 203, 217, 229, 241, 248, 243,
-    253, 255, 253, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-};
-
-static const uint8_t vp6_runv_pct[2][14] = {
-  { 219, 246, 238, 249, 232, 239, 249, 255, 248, 253, 239, 244, 241, 248 },
-  { 198, 232, 251, 253, 219, 241, 253, 255, 248, 249, 244, 238, 251, 255 },
-};
-
-static const uint8_t vp6_ract_pct[3][2][6][11] = {
-  { { { 227, 246, 230, 247, 244, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 209, 231, 231, 249, 249, 253, 255, 255, 255 },
-      { 255, 255, 225, 242, 241, 251, 253, 255, 255, 255, 255 },
-      { 255, 255, 241, 253, 252, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
-    { { 240, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 240, 253, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } },
-  { { { 206, 203, 227, 239, 247, 255, 253, 255, 255, 255, 255 },
-      { 207, 199, 220, 236, 243, 252, 252, 255, 255, 255, 255 },
-      { 212, 219, 230, 243, 244, 253, 252, 255, 255, 255, 255 },
-      { 236, 237, 247, 252, 253, 255, 255, 255, 255, 255, 255 },
-      { 240, 240, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
-    { { 230, 233, 249, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 238, 238, 250, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 248, 251, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } },
-  { { { 225, 239, 227, 231, 244, 253, 243, 255, 255, 253, 255 },
-      { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 255 },
-      { 235, 249, 238, 240, 251, 255, 249, 255, 253, 253, 255 },
-      { 249, 253, 251, 250, 255, 255, 255, 255, 255, 255, 255 },
-      { 251, 250, 249, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
-    { { 243, 244, 250, 250, 255, 255, 255, 255, 255, 255, 255 },
-      { 249, 248, 250, 253, 255, 255, 255, 255, 255, 255, 255 },
-      { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } }
-};
-
-static const int vp6_dccv_lc[3][5][2] = {
-  { { 122, 133 }, { 0, 1 }, { 78,  171 }, { 139, 117 }, { 168, 79 } },
-  { { 133,  51 }, { 0, 1 }, { 169,  71 }, { 214,  44 }, { 210, 38 } },
-  { { 142, -16 }, { 0, 1 }, { 221, -30 }, { 246,  -3 }, { 203, 17 } },
-};
-
-static const uint8_t vp6_coeff_groups[] = {
-    0, 0, 1, 1, 1, 2, 2, 2,
-    2, 2, 2, 3, 3, 3, 3, 3,
-    3, 3, 3, 3, 3, 3, 4, 4,
-    4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 4, 4, 4, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5,
-    5, 5, 5, 5, 5, 5, 5, 5,
-};
-
-static const int16_t vp6_block_copy_filter[17][8][4] = {
-  { {   0, 128,   0,   0  },  /* 0 */
-    {  -3, 122,   9,   0  },
-    {  -4, 109,  24,  -1  },
-    {  -5,  91,  45,  -3  },
-    {  -4,  68,  68,  -4  },
-    {  -3,  45,  91,  -5  },
-    {  -1,  24, 109,  -4  },
-    {   0,   9, 122,  -3  } },
-  { {   0, 128,   0,   0  },  /* 1 */
-    {  -4, 124,   9,  -1  },
-    {  -5, 110,  25,  -2  },
-    {  -6,  91,  46,  -3  },
-    {  -5,  69,  69,  -5  },
-    {  -3,  46,  91,  -6  },
-    {  -2,  25, 110,  -5  },
-    {  -1,   9, 124,  -4  } },
-  { {   0, 128,   0,   0  },  /* 2 */
-    {  -4, 123,  10,  -1  },
-    {  -6, 110,  26,  -2  },
-    {  -7,  92,  47,  -4  },
-    {  -6,  70,  70,  -6  },
-    {  -4,  47,  92,  -7  },
-    {  -2,  26, 110,  -6  },
-    {  -1,  10, 123,  -4  } },
-  { {   0, 128,   0,   0  },  /* 3 */
-    {  -5, 124,  10,  -1  },
-    {  -7, 110,  27,  -2  },
-    {  -7,  91,  48,  -4  },
-    {  -6,  70,  70,  -6  },
-    {  -4,  48,  92,  -8  },
-    {  -2,  27, 110,  -7  },
-    {  -1,  10, 124,  -5  } },
-  { {   0, 128,   0,   0  },  /* 4 */
-    {  -6, 124,  11,  -1  },
-    {  -8, 111,  28,  -3  },
-    {  -8,  92,  49,  -5  },
-    {  -7,  71,  71,  -7  },
-    {  -5,  49,  92,  -8  },
-    {  -3,  28, 111,  -8  },
-    {  -1,  11, 124,  -6  } },
-  { {  0,  128,   0,   0  },  /* 5 */
-    {  -6, 123,  12,  -1  },
-    {  -9, 111,  29,  -3  },
-    {  -9,  93,  50,  -6  },
-    {  -8,  72,  72,  -8  },
-    {  -6,  50,  93,  -9  },
-    {  -3,  29, 111,  -9  },
-    {  -1,  12, 123,  -6  } },
-  { {   0, 128,   0,   0  },  /* 6 */
-    {  -7, 124,  12,  -1  },
-    { -10, 111,  30,  -3  },
-    { -10,  93,  51,  -6  },
-    {  -9,  73,  73,  -9  },
-    {  -6,  51,  93, -10  },
-    {  -3,  30, 111, -10  },
-    {  -1,  12, 124,  -7  } },
-  { {   0, 128,   0,   0  },  /* 7 */
-    {  -7, 123,  13,  -1  },
-    { -11, 112,  31,  -4  },
-    { -11,  94,  52,  -7  },
-    { -10,  74,  74, -10  },
-    {  -7,  52,  94, -11  },
-    {  -4,  31, 112, -11  },
-    {  -1,  13, 123,  -7  } },
-  { {   0, 128,   0,  0  },  /* 8 */
-    {  -8, 124,  13,  -1  },
-    { -12, 112,  32,  -4  },
-    { -12,  94,  53,  -7  },
-    { -10,  74,  74, -10  },
-    {  -7,  53,  94, -12  },
-    {  -4,  32, 112, -12  },
-    {  -1,  13, 124,  -8  } },
-  { {   0, 128,   0,   0  },  /* 9 */
-    {  -9, 124,  14,  -1  },
-    { -13, 112,  33,  -4  },
-    { -13,  95,  54,  -8  },
-    { -11,  75,  75, -11  },
-    {  -8,  54,  95, -13  },
-    {  -4,  33, 112, -13  },
-    {  -1,  14, 124,  -9  } },
-  { {   0, 128,   0,   0  },  /* 10 */
-    {  -9, 123,  15,  -1  },
-    { -14, 113,  34,  -5  },
-    { -14,  95,  55,  -8  },
-    { -12,  76,  76, -12  },
-    {  -8,  55,  95, -14  },
-    {  -5,  34, 112, -13  },
-    {  -1,  15, 123,  -9  } },
-  { {   0, 128,   0,   0  },  /* 11 */
-    { -10, 124,  15,  -1  },
-    { -14, 113,  34,  -5  },
-    { -15,  96,  56,  -9  },
-    { -13,  77,  77, -13  },
-    {  -9,  56,  96, -15  },
-    {  -5,  34, 113, -14  },
-    {  -1,  15, 124, -10  } },
-  { {   0, 128,   0,   0  },  /* 12 */
-    { -10, 123,  16,  -1  },
-    { -15, 113,  35,  -5  },
-    { -16,  98,  56, -10  },
-    { -14,  78,  78, -14  },
-    { -10,  56,  98, -16  },
-    {  -5,  35, 113, -15  },
-    {  -1,  16, 123, -10  } },
-  { {   0, 128,   0,   0  },  /* 13 */
-    { -11, 124,  17,  -2  },
-    { -16, 113,  36,  -5  },
-    { -17,  98,  57, -10  },
-    { -14,  78,  78, -14  },
-    { -10,  57,  98, -17  },
-    {  -5,  36, 113, -16  },
-    {  -2,  17, 124, -11  } },
-  { {   0, 128,   0,   0  },  /* 14 */
-    { -12, 125,  17,  -2  },
-    { -17, 114,  37,  -6  },
-    { -18,  99,  58, -11  },
-    { -15,  79,  79, -15  },
-    { -11,  58,  99, -18  },
-    {  -6,  37, 114, -17  },
-    {  -2,  17, 125, -12  } },
-  { {   0, 128,   0,   0  },  /* 15 */
-    { -12, 124,  18,  -2  },
-    { -18, 114,  38,  -6  },
-    { -19,  99,  59, -11  },
-    { -16,  80,  80, -16  },
-    { -11,  59,  99, -19  },
-    {  -6,  38, 114, -18  },
-    {  -2,  18, 124, -12  } },
-  { {   0, 128,   0,   0  },  /* 16 */
-    {  -4, 118,  16,  -2  },
-    {  -7, 106,  34,  -5  },
-    {  -8,  90,  53,  -7  },
-    {  -8,  72,  72,  -8  },
-    {  -7,  53,  90,  -8  },
-    {  -5,  34, 106,  -7  },
-    {  -2,  16, 118,  -4  } },
-};
-
-static const VP56Tree vp6_pcr_tree[] = {
-    { 8, 0},
-    { 4, 1},
-    { 2, 2}, {-1}, {-2},
-    { 2, 3}, {-3}, {-4},
-    { 8, 4},
-    { 4, 5},
-    { 2, 6}, {-5}, {-6},
-    { 2, 7}, {-7}, {-8},
-             {-0},
-};
-
-static const uint8_t vp6_coord_div[] = { 4, 4, 4, 4, 8, 8 };
-
-static const uint8_t vp6_huff_coeff_map[] = {
-    13, 14, 11, 0, 1, 15, 16, 18, 2, 17, 3, 4, 19, 20, 5, 6, 21, 22, 7, 8, 9, 10
-};
-
-static const uint8_t vp6_huff_run_map[] = {
-    10, 13, 11, 12, 0, 1, 2, 3, 14, 8, 15, 16, 4, 5, 6, 7
-};
-
-#endif /* AVCODEC_VP6DATA_H */
diff --git a/deps/libav/libavcodec/vp6dsp.c b/deps/libav/libavcodec/vp6dsp.c
deleted file mode 100644
index 54a96ed..0000000
--- a/deps/libav/libavcodec/vp6dsp.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP6 DSP-oriented functions
- */
-
-#include "libavutil/common.h"
-#include "vp56dsp.h"
-
-
-void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride,
-                           const int16_t *h_weights, const int16_t *v_weights)
-{
-    int x, y;
-    int tmp[8*11];
-    int *t = tmp;
-
-    src -= stride;
-
-    for (y=0; y<11; y++) {
-        for (x=0; x<8; x++) {
-            t[x] = av_clip_uint8((  src[x-1] * h_weights[0]
-                               + src[x  ] * h_weights[1]
-                               + src[x+1] * h_weights[2]
-                               + src[x+2] * h_weights[3] + 64) >> 7);
-        }
-        src += stride;
-        t += 8;
-    }
-
-    t = tmp + 8;
-    for (y=0; y<8; y++) {
-        for (x=0; x<8; x++) {
-            dst[x] = av_clip_uint8((  t[x-8 ] * v_weights[0]
-                                 + t[x   ] * v_weights[1]
-                                 + t[x+8 ] * v_weights[2]
-                                 + t[x+16] * v_weights[3] + 64) >> 7);
-        }
-        dst += stride;
-        t += 8;
-    }
-}
diff --git a/deps/libav/libavcodec/vp8.c b/deps/libav/libavcodec/vp8.c
deleted file mode 100644
index 30e24cc..0000000
--- a/deps/libav/libavcodec/vp8.c
+++ /dev/null
@@ -1,2085 +0,0 @@
-/*
- * VP8 compatible video decoder
- *
- * Copyright (C) 2010 David Conrad
- * Copyright (C) 2010 Ronald S. Bultje
- * Copyright (C) 2010 Jason Garrett-Glaser
- * Copyright (C) 2012 Daniel Kang
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "vp8.h"
-#include "vp8data.h"
-#include "rectangle.h"
-#include "thread.h"
-
-#if ARCH_ARM
-#   include "arm/vp8.h"
-#endif
-
-static void free_buffers(VP8Context *s)
-{
-    int i;
-    if (s->thread_data)
-        for (i = 0; i < MAX_THREADS; i++) {
-#if HAVE_THREADS
-            pthread_cond_destroy(&s->thread_data[i].cond);
-            pthread_mutex_destroy(&s->thread_data[i].lock);
-#endif
-            av_freep(&s->thread_data[i].filter_strength);
-        }
-    av_freep(&s->thread_data);
-    av_freep(&s->macroblocks_base);
-    av_freep(&s->intra4x4_pred_mode_top);
-    av_freep(&s->top_nnz);
-    av_freep(&s->top_border);
-
-    s->macroblocks = NULL;
-}
-
-static int vp8_alloc_frame(VP8Context *s, VP8Frame *f, int ref)
-{
-    int ret;
-    if ((ret = ff_thread_get_buffer(s->avctx, &f->tf,
-                                    ref ? AV_GET_BUFFER_FLAG_REF : 0)) < 0)
-        return ret;
-    if (!(f->seg_map = av_buffer_allocz(s->mb_width * s->mb_height))) {
-        ff_thread_release_buffer(s->avctx, &f->tf);
-        return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-static void vp8_release_frame(VP8Context *s, VP8Frame *f)
-{
-    av_buffer_unref(&f->seg_map);
-    ff_thread_release_buffer(s->avctx, &f->tf);
-}
-
-static int vp8_ref_frame(VP8Context *s, VP8Frame *dst, VP8Frame *src)
-{
-    int ret;
-
-    vp8_release_frame(s, dst);
-
-    if ((ret = ff_thread_ref_frame(&dst->tf, &src->tf)) < 0)
-        return ret;
-    if (src->seg_map &&
-        !(dst->seg_map = av_buffer_ref(src->seg_map))) {
-        vp8_release_frame(s, dst);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-
-static void vp8_decode_flush_impl(AVCodecContext *avctx, int free_mem)
-{
-    VP8Context *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++)
-        vp8_release_frame(s, &s->frames[i]);
-    memset(s->framep, 0, sizeof(s->framep));
-
-    if (free_mem)
-        free_buffers(s);
-}
-
-static void vp8_decode_flush(AVCodecContext *avctx)
-{
-    vp8_decode_flush_impl(avctx, 0);
-}
-
-static int update_dimensions(VP8Context *s, int width, int height)
-{
-    AVCodecContext *avctx = s->avctx;
-    int i, ret;
-
-    if (width  != s->avctx->width ||
-        height != s->avctx->height) {
-        vp8_decode_flush_impl(s->avctx, 1);
-
-        ret = ff_set_dimensions(s->avctx, width, height);
-        if (ret < 0)
-            return ret;
-    }
-
-    s->mb_width  = (s->avctx->coded_width +15) / 16;
-    s->mb_height = (s->avctx->coded_height+15) / 16;
-
-    s->mb_layout = (avctx->active_thread_type == FF_THREAD_SLICE) && (FFMIN(s->num_coeff_partitions, avctx->thread_count) > 1);
-    if (!s->mb_layout) { // Frame threading and one thread
-        s->macroblocks_base       = av_mallocz((s->mb_width+s->mb_height*2+1)*sizeof(*s->macroblocks));
-        s->intra4x4_pred_mode_top = av_mallocz(s->mb_width*4);
-    }
-    else // Sliced threading
-        s->macroblocks_base       = av_mallocz((s->mb_width+2)*(s->mb_height+2)*sizeof(*s->macroblocks));
-    s->top_nnz                    = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
-    s->top_border                 = av_mallocz((s->mb_width+1)*sizeof(*s->top_border));
-    s->thread_data                = av_mallocz(MAX_THREADS*sizeof(VP8ThreadData));
-
-    for (i = 0; i < MAX_THREADS; i++) {
-        s->thread_data[i].filter_strength = av_mallocz(s->mb_width*sizeof(*s->thread_data[0].filter_strength));
-#if HAVE_THREADS
-        pthread_mutex_init(&s->thread_data[i].lock, NULL);
-        pthread_cond_init(&s->thread_data[i].cond, NULL);
-#endif
-    }
-
-    if (!s->macroblocks_base || !s->top_nnz || !s->top_border ||
-        (!s->intra4x4_pred_mode_top && !s->mb_layout))
-        return AVERROR(ENOMEM);
-
-    s->macroblocks        = s->macroblocks_base + 1;
-
-    return 0;
-}
-
-static void parse_segment_info(VP8Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-    int i;
-
-    s->segmentation.update_map = vp8_rac_get(c);
-
-    if (vp8_rac_get(c)) { // update segment feature data
-        s->segmentation.absolute_vals = vp8_rac_get(c);
-
-        for (i = 0; i < 4; i++)
-            s->segmentation.base_quant[i]   = vp8_rac_get_sint(c, 7);
-
-        for (i = 0; i < 4; i++)
-            s->segmentation.filter_level[i] = vp8_rac_get_sint(c, 6);
-    }
-    if (s->segmentation.update_map)
-        for (i = 0; i < 3; i++)
-            s->prob->segmentid[i] = vp8_rac_get(c) ? vp8_rac_get_uint(c, 8) : 255;
-}
-
-static void update_lf_deltas(VP8Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-    int i;
-
-    for (i = 0; i < 4; i++) {
-        if (vp8_rac_get(c)) {
-            s->lf_delta.ref[i] = vp8_rac_get_uint(c, 6);
-
-            if (vp8_rac_get(c))
-                s->lf_delta.ref[i] = -s->lf_delta.ref[i];
-        }
-    }
-
-    for (i = MODE_I4x4; i <= VP8_MVMODE_SPLIT; i++) {
-        if (vp8_rac_get(c)) {
-            s->lf_delta.mode[i] = vp8_rac_get_uint(c, 6);
-
-            if (vp8_rac_get(c))
-                s->lf_delta.mode[i] = -s->lf_delta.mode[i];
-        }
-    }
-}
-
-static int setup_partitions(VP8Context *s, const uint8_t *buf, int buf_size)
-{
-    const uint8_t *sizes = buf;
-    int i;
-
-    s->num_coeff_partitions = 1 << vp8_rac_get_uint(&s->c, 2);
-
-    buf      += 3*(s->num_coeff_partitions-1);
-    buf_size -= 3*(s->num_coeff_partitions-1);
-    if (buf_size < 0)
-        return -1;
-
-    for (i = 0; i < s->num_coeff_partitions-1; i++) {
-        int size = AV_RL24(sizes + 3*i);
-        if (buf_size - size < 0)
-            return -1;
-
-        ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, size);
-        buf      += size;
-        buf_size -= size;
-    }
-    ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, buf_size);
-
-    return 0;
-}
-
-static void get_quants(VP8Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-    int i, base_qi;
-
-    int yac_qi     = vp8_rac_get_uint(c, 7);
-    int ydc_delta  = vp8_rac_get_sint(c, 4);
-    int y2dc_delta = vp8_rac_get_sint(c, 4);
-    int y2ac_delta = vp8_rac_get_sint(c, 4);
-    int uvdc_delta = vp8_rac_get_sint(c, 4);
-    int uvac_delta = vp8_rac_get_sint(c, 4);
-
-    for (i = 0; i < 4; i++) {
-        if (s->segmentation.enabled) {
-            base_qi = s->segmentation.base_quant[i];
-            if (!s->segmentation.absolute_vals)
-                base_qi += yac_qi;
-        } else
-            base_qi = yac_qi;
-
-        s->qmat[i].luma_qmul[0]    =           vp8_dc_qlookup[av_clip_uintp2(base_qi + ydc_delta , 7)];
-        s->qmat[i].luma_qmul[1]    =           vp8_ac_qlookup[av_clip_uintp2(base_qi             , 7)];
-        s->qmat[i].luma_dc_qmul[0] =       2 * vp8_dc_qlookup[av_clip_uintp2(base_qi + y2dc_delta, 7)];
-        /* 101581>>16 is equivalent to 155/100 */
-        s->qmat[i].luma_dc_qmul[1] = (101581 * vp8_ac_qlookup[av_clip_uintp2(base_qi + y2ac_delta, 7)]) >> 16;
-        s->qmat[i].chroma_qmul[0]  =           vp8_dc_qlookup[av_clip_uintp2(base_qi + uvdc_delta, 7)];
-        s->qmat[i].chroma_qmul[1]  =           vp8_ac_qlookup[av_clip_uintp2(base_qi + uvac_delta, 7)];
-
-        s->qmat[i].luma_dc_qmul[1] = FFMAX(s->qmat[i].luma_dc_qmul[1], 8);
-        s->qmat[i].chroma_qmul[0]  = FFMIN(s->qmat[i].chroma_qmul[0], 132);
-    }
-}
-
-/**
- * Determine which buffers golden and altref should be updated with after this frame.
- * The spec isn't clear here, so I'm going by my understanding of what libvpx does
- *
- * Intra frames update all 3 references
- * Inter frames update VP56_FRAME_PREVIOUS if the update_last flag is set
- * If the update (golden|altref) flag is set, it's updated with the current frame
- *      if update_last is set, and VP56_FRAME_PREVIOUS otherwise.
- * If the flag is not set, the number read means:
- *      0: no update
- *      1: VP56_FRAME_PREVIOUS
- *      2: update golden with altref, or update altref with golden
- */
-static VP56Frame ref_to_update(VP8Context *s, int update, VP56Frame ref)
-{
-    VP56RangeCoder *c = &s->c;
-
-    if (update)
-        return VP56_FRAME_CURRENT;
-
-    switch (vp8_rac_get_uint(c, 2)) {
-    case 1:
-        return VP56_FRAME_PREVIOUS;
-    case 2:
-        return (ref == VP56_FRAME_GOLDEN) ? VP56_FRAME_GOLDEN2 : VP56_FRAME_GOLDEN;
-    }
-    return VP56_FRAME_NONE;
-}
-
-static void update_refs(VP8Context *s)
-{
-    VP56RangeCoder *c = &s->c;
-
-    int update_golden = vp8_rac_get(c);
-    int update_altref = vp8_rac_get(c);
-
-    s->update_golden = ref_to_update(s, update_golden, VP56_FRAME_GOLDEN);
-    s->update_altref = ref_to_update(s, update_altref, VP56_FRAME_GOLDEN2);
-}
-
-static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
-{
-    VP56RangeCoder *c = &s->c;
-    int header_size, hscale, vscale, i, j, k, l, m, ret;
-    int width  = s->avctx->width;
-    int height = s->avctx->height;
-
-    s->keyframe  = !(buf[0] & 1);
-    s->profile   =  (buf[0]>>1) & 7;
-    s->invisible = !(buf[0] & 0x10);
-    header_size  = AV_RL24(buf) >> 5;
-    buf      += 3;
-    buf_size -= 3;
-
-    if (s->profile > 3)
-        av_log(s->avctx, AV_LOG_WARNING, "Unknown profile %d\n", s->profile);
-
-    if (!s->profile)
-        memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_epel_pixels_tab, sizeof(s->put_pixels_tab));
-    else    // profile 1-3 use bilinear, 4+ aren't defined so whatever
-        memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_bilinear_pixels_tab, sizeof(s->put_pixels_tab));
-
-    if (header_size > buf_size - 7*s->keyframe) {
-        av_log(s->avctx, AV_LOG_ERROR, "Header size larger than data provided\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->keyframe) {
-        if (AV_RL24(buf) != 0x2a019d) {
-            av_log(s->avctx, AV_LOG_ERROR, "Invalid start code 0x%x\n", AV_RL24(buf));
-            return AVERROR_INVALIDDATA;
-        }
-        width  = AV_RL16(buf+3) & 0x3fff;
-        height = AV_RL16(buf+5) & 0x3fff;
-        hscale = buf[4] >> 6;
-        vscale = buf[6] >> 6;
-        buf      += 7;
-        buf_size -= 7;
-
-        if (hscale || vscale)
-            avpriv_request_sample(s->avctx, "Upscaling");
-
-        s->update_golden = s->update_altref = VP56_FRAME_CURRENT;
-        for (i = 0; i < 4; i++)
-            for (j = 0; j < 16; j++)
-                memcpy(s->prob->token[i][j], vp8_token_default_probs[i][vp8_coeff_band[j]],
-                       sizeof(s->prob->token[i][j]));
-        memcpy(s->prob->pred16x16, vp8_pred16x16_prob_inter, sizeof(s->prob->pred16x16));
-        memcpy(s->prob->pred8x8c , vp8_pred8x8c_prob_inter , sizeof(s->prob->pred8x8c));
-        memcpy(s->prob->mvc      , vp8_mv_default_prob     , sizeof(s->prob->mvc));
-        memset(&s->segmentation, 0, sizeof(s->segmentation));
-        memset(&s->lf_delta, 0, sizeof(s->lf_delta));
-    }
-
-    ff_vp56_init_range_decoder(c, buf, header_size);
-    buf      += header_size;
-    buf_size -= header_size;
-
-    if (s->keyframe) {
-        if (vp8_rac_get(c))
-            av_log(s->avctx, AV_LOG_WARNING, "Unspecified colorspace\n");
-        vp8_rac_get(c); // whether we can skip clamping in dsp functions
-    }
-
-    if ((s->segmentation.enabled = vp8_rac_get(c)))
-        parse_segment_info(s);
-    else
-        s->segmentation.update_map = 0; // FIXME: move this to some init function?
-
-    s->filter.simple    = vp8_rac_get(c);
-    s->filter.level     = vp8_rac_get_uint(c, 6);
-    s->filter.sharpness = vp8_rac_get_uint(c, 3);
-
-    if ((s->lf_delta.enabled = vp8_rac_get(c)))
-        if (vp8_rac_get(c))
-            update_lf_deltas(s);
-
-    if (setup_partitions(s, buf, buf_size)) {
-        av_log(s->avctx, AV_LOG_ERROR, "Invalid partitions\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!s->macroblocks_base || /* first frame */
-        width != s->avctx->width || height != s->avctx->height) {
-        if ((ret = update_dimensions(s, width, height)) < 0)
-            return ret;
-    }
-
-    get_quants(s);
-
-    if (!s->keyframe) {
-        update_refs(s);
-        s->sign_bias[VP56_FRAME_GOLDEN]               = vp8_rac_get(c);
-        s->sign_bias[VP56_FRAME_GOLDEN2 /* altref */] = vp8_rac_get(c);
-    }
-
-    // if we aren't saving this frame's probabilities for future frames,
-    // make a copy of the current probabilities
-    if (!(s->update_probabilities = vp8_rac_get(c)))
-        s->prob[1] = s->prob[0];
-
-    s->update_last = s->keyframe || vp8_rac_get(c);
-
-    for (i = 0; i < 4; i++)
-        for (j = 0; j < 8; j++)
-            for (k = 0; k < 3; k++)
-                for (l = 0; l < NUM_DCT_TOKENS-1; l++)
-                    if (vp56_rac_get_prob_branchy(c, vp8_token_update_probs[i][j][k][l])) {
-                        int prob = vp8_rac_get_uint(c, 8);
-                        for (m = 0; vp8_coeff_band_indexes[j][m] >= 0; m++)
-                            s->prob->token[i][vp8_coeff_band_indexes[j][m]][k][l] = prob;
-                    }
-
-    if ((s->mbskip_enabled = vp8_rac_get(c)))
-        s->prob->mbskip = vp8_rac_get_uint(c, 8);
-
-    if (!s->keyframe) {
-        s->prob->intra  = vp8_rac_get_uint(c, 8);
-        s->prob->last   = vp8_rac_get_uint(c, 8);
-        s->prob->golden = vp8_rac_get_uint(c, 8);
-
-        if (vp8_rac_get(c))
-            for (i = 0; i < 4; i++)
-                s->prob->pred16x16[i] = vp8_rac_get_uint(c, 8);
-        if (vp8_rac_get(c))
-            for (i = 0; i < 3; i++)
-                s->prob->pred8x8c[i]  = vp8_rac_get_uint(c, 8);
-
-        // 17.2 MV probability update
-        for (i = 0; i < 2; i++)
-            for (j = 0; j < 19; j++)
-                if (vp56_rac_get_prob_branchy(c, vp8_mv_update_prob[i][j]))
-                    s->prob->mvc[i][j] = vp8_rac_get_nn(c);
-    }
-
-    return 0;
-}
-
-static av_always_inline void clamp_mv(VP8Context *s, VP56mv *dst, const VP56mv *src)
-{
-    dst->x = av_clip(src->x, s->mv_min.x, s->mv_max.x);
-    dst->y = av_clip(src->y, s->mv_min.y, s->mv_max.y);
-}
-
-/**
- * Motion vector coding, 17.1.
- */
-static int read_mv_component(VP56RangeCoder *c, const uint8_t *p)
-{
-    int bit, x = 0;
-
-    if (vp56_rac_get_prob_branchy(c, p[0])) {
-        int i;
-
-        for (i = 0; i < 3; i++)
-            x += vp56_rac_get_prob(c, p[9 + i]) << i;
-        for (i = 9; i > 3; i--)
-            x += vp56_rac_get_prob(c, p[9 + i]) << i;
-        if (!(x & 0xFFF0) || vp56_rac_get_prob(c, p[12]))
-            x += 8;
-    } else {
-        // small_mvtree
-        const uint8_t *ps = p+2;
-        bit = vp56_rac_get_prob(c, *ps);
-        ps += 1 + 3*bit;
-        x  += 4*bit;
-        bit = vp56_rac_get_prob(c, *ps);
-        ps += 1 + bit;
-        x  += 2*bit;
-        x  += vp56_rac_get_prob(c, *ps);
-    }
-
-    return (x && vp56_rac_get_prob(c, p[1])) ? -x : x;
-}
-
-static av_always_inline
-const uint8_t *get_submv_prob(uint32_t left, uint32_t top)
-{
-    if (left == top)
-        return vp8_submv_prob[4-!!left];
-    if (!top)
-        return vp8_submv_prob[2];
-    return vp8_submv_prob[1-!!left];
-}
-
-/**
- * Split motion vector prediction, 16.4.
- * @returns the number of motion vectors parsed (2, 4 or 16)
- */
-static av_always_inline
-int decode_splitmvs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, int layout)
-{
-    int part_idx;
-    int n, num;
-    VP8Macroblock *top_mb;
-    VP8Macroblock *left_mb = &mb[-1];
-    const uint8_t *mbsplits_left = vp8_mbsplits[left_mb->partitioning],
-                  *mbsplits_top,
-                  *mbsplits_cur, *firstidx;
-    VP56mv *top_mv;
-    VP56mv *left_mv = left_mb->bmv;
-    VP56mv *cur_mv  = mb->bmv;
-
-    if (!layout) // layout is inlined, s->mb_layout is not
-        top_mb = &mb[2];
-    else
-        top_mb = &mb[-s->mb_width-1];
-    mbsplits_top = vp8_mbsplits[top_mb->partitioning];
-    top_mv = top_mb->bmv;
-
-    if (vp56_rac_get_prob_branchy(c, vp8_mbsplit_prob[0])) {
-        if (vp56_rac_get_prob_branchy(c, vp8_mbsplit_prob[1])) {
-            part_idx = VP8_SPLITMVMODE_16x8 + vp56_rac_get_prob(c, vp8_mbsplit_prob[2]);
-        } else {
-            part_idx = VP8_SPLITMVMODE_8x8;
-        }
-    } else {
-        part_idx = VP8_SPLITMVMODE_4x4;
-    }
-
-    num = vp8_mbsplit_count[part_idx];
-    mbsplits_cur = vp8_mbsplits[part_idx],
-    firstidx = vp8_mbfirstidx[part_idx];
-    mb->partitioning = part_idx;
-
-    for (n = 0; n < num; n++) {
-        int k = firstidx[n];
-        uint32_t left, above;
-        const uint8_t *submv_prob;
-
-        if (!(k & 3))
-            left = AV_RN32A(&left_mv[mbsplits_left[k + 3]]);
-        else
-            left  = AV_RN32A(&cur_mv[mbsplits_cur[k - 1]]);
-        if (k <= 3)
-            above = AV_RN32A(&top_mv[mbsplits_top[k + 12]]);
-        else
-            above = AV_RN32A(&cur_mv[mbsplits_cur[k - 4]]);
-
-        submv_prob = get_submv_prob(left, above);
-
-        if (vp56_rac_get_prob_branchy(c, submv_prob[0])) {
-            if (vp56_rac_get_prob_branchy(c, submv_prob[1])) {
-                if (vp56_rac_get_prob_branchy(c, submv_prob[2])) {
-                    mb->bmv[n].y = mb->mv.y + read_mv_component(c, s->prob->mvc[0]);
-                    mb->bmv[n].x = mb->mv.x + read_mv_component(c, s->prob->mvc[1]);
-                } else {
-                    AV_ZERO32(&mb->bmv[n]);
-                }
-            } else {
-                AV_WN32A(&mb->bmv[n], above);
-            }
-        } else {
-            AV_WN32A(&mb->bmv[n], left);
-        }
-    }
-
-    return num;
-}
-
-static av_always_inline
-void decode_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout)
-{
-    VP8Macroblock *mb_edge[3] = { 0 /* top */,
-                                  mb - 1 /* left */,
-                                  0 /* top-left */ };
-    enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };
-    enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
-    int idx = CNT_ZERO;
-    int cur_sign_bias = s->sign_bias[mb->ref_frame];
-    int8_t *sign_bias = s->sign_bias;
-    VP56mv near_mv[4];
-    uint8_t cnt[4] = { 0 };
-    VP56RangeCoder *c = &s->c;
-
-    if (!layout) { // layout is inlined (s->mb_layout is not)
-        mb_edge[0] = mb + 2;
-        mb_edge[2] = mb + 1;
-    }
-    else {
-        mb_edge[0] = mb - s->mb_width-1;
-        mb_edge[2] = mb - s->mb_width-2;
-    }
-
-    AV_ZERO32(&near_mv[0]);
-    AV_ZERO32(&near_mv[1]);
-    AV_ZERO32(&near_mv[2]);
-
-    /* Process MB on top, left and top-left */
-    #define MV_EDGE_CHECK(n)\
-    {\
-        VP8Macroblock *edge = mb_edge[n];\
-        int edge_ref = edge->ref_frame;\
-        if (edge_ref != VP56_FRAME_CURRENT) {\
-            uint32_t mv = AV_RN32A(&edge->mv);\
-            if (mv) {\
-                if (cur_sign_bias != sign_bias[edge_ref]) {\
-                    /* SWAR negate of the values in mv. */\
-                    mv = ~mv;\
-                    mv = ((mv&0x7fff7fff) + 0x00010001) ^ (mv&0x80008000);\
-                }\
-                if (!n || mv != AV_RN32A(&near_mv[idx]))\
-                    AV_WN32A(&near_mv[++idx], mv);\
-                cnt[idx]      += 1 + (n != 2);\
-            } else\
-                cnt[CNT_ZERO] += 1 + (n != 2);\
-        }\
-    }
-
-    MV_EDGE_CHECK(0)
-    MV_EDGE_CHECK(1)
-    MV_EDGE_CHECK(2)
-
-    mb->partitioning = VP8_SPLITMVMODE_NONE;
-    if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_ZERO]][0])) {
-        mb->mode = VP8_MVMODE_MV;
-
-        /* If we have three distinct MVs, merge first and last if they're the same */
-        if (cnt[CNT_SPLITMV] && AV_RN32A(&near_mv[1 + VP8_EDGE_TOP]) == AV_RN32A(&near_mv[1 + VP8_EDGE_TOPLEFT]))
-            cnt[CNT_NEAREST] += 1;
-
-        /* Swap near and nearest if necessary */
-        if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) {
-            FFSWAP(uint8_t,     cnt[CNT_NEAREST],     cnt[CNT_NEAR]);
-            FFSWAP( VP56mv, near_mv[CNT_NEAREST], near_mv[CNT_NEAR]);
-        }
-
-        if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_NEAREST]][1])) {
-            if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_NEAR]][2])) {
-
-                /* Choose the best mv out of 0,0 and the nearest mv */
-                clamp_mv(s, &mb->mv, &near_mv[CNT_ZERO + (cnt[CNT_NEAREST] >= cnt[CNT_ZERO])]);
-                cnt[CNT_SPLITMV] = ((mb_edge[VP8_EDGE_LEFT]->mode    == VP8_MVMODE_SPLIT) +
-                                    (mb_edge[VP8_EDGE_TOP]->mode     == VP8_MVMODE_SPLIT)) * 2 +
-                                    (mb_edge[VP8_EDGE_TOPLEFT]->mode == VP8_MVMODE_SPLIT);
-
-                if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_SPLITMV]][3])) {
-                    mb->mode = VP8_MVMODE_SPLIT;
-                    mb->mv = mb->bmv[decode_splitmvs(s, c, mb, layout) - 1];
-                } else {
-                    mb->mv.y += read_mv_component(c, s->prob->mvc[0]);
-                    mb->mv.x += read_mv_component(c, s->prob->mvc[1]);
-                    mb->bmv[0] = mb->mv;
-                }
-            } else {
-                clamp_mv(s, &mb->mv, &near_mv[CNT_NEAR]);
-                mb->bmv[0] = mb->mv;
-            }
-        } else {
-            clamp_mv(s, &mb->mv, &near_mv[CNT_NEAREST]);
-            mb->bmv[0] = mb->mv;
-        }
-    } else {
-        mb->mode = VP8_MVMODE_ZERO;
-        AV_ZERO32(&mb->mv);
-        mb->bmv[0] = mb->mv;
-    }
-}
-
-static av_always_inline
-void decode_intra4x4_modes(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb,
-                           int mb_x, int keyframe, int layout)
-{
-    uint8_t *intra4x4 = mb->intra4x4_pred_mode_mb;
-
-    if (layout == 1) {
-        VP8Macroblock *mb_top = mb - s->mb_width - 1;
-        memcpy(mb->intra4x4_pred_mode_top, mb_top->intra4x4_pred_mode_top, 4);
-    }
-    if (keyframe) {
-        int x, y;
-        uint8_t* top;
-        uint8_t* const left = s->intra4x4_pred_mode_left;
-        if (layout == 1)
-            top = mb->intra4x4_pred_mode_top;
-        else
-            top = s->intra4x4_pred_mode_top + 4 * mb_x;
-        for (y = 0; y < 4; y++) {
-            for (x = 0; x < 4; x++) {
-                const uint8_t *ctx;
-                ctx = vp8_pred4x4_prob_intra[top[x]][left[y]];
-                *intra4x4 = vp8_rac_get_tree(c, vp8_pred4x4_tree, ctx);
-                left[y] = top[x] = *intra4x4;
-                intra4x4++;
-            }
-        }
-    } else {
-        int i;
-        for (i = 0; i < 16; i++)
-            intra4x4[i] = vp8_rac_get_tree(c, vp8_pred4x4_tree, vp8_pred4x4_prob_inter);
-    }
-}
-
-static av_always_inline
-void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
-                    uint8_t *segment, uint8_t *ref, int layout)
-{
-    VP56RangeCoder *c = &s->c;
-
-    if (s->segmentation.update_map)
-        *segment = vp8_rac_get_tree(c, vp8_segmentid_tree, s->prob->segmentid);
-    else if (s->segmentation.enabled)
-        *segment = ref ? *ref : *segment;
-    mb->segment = *segment;
-
-    mb->skip = s->mbskip_enabled ? vp56_rac_get_prob(c, s->prob->mbskip) : 0;
-
-    if (s->keyframe) {
-        mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_intra, vp8_pred16x16_prob_intra);
-
-        if (mb->mode == MODE_I4x4) {
-            decode_intra4x4_modes(s, c, mb, mb_x, 1, layout);
-        } else {
-            const uint32_t modes = vp8_pred4x4_mode[mb->mode] * 0x01010101u;
-            if (s->mb_layout == 1)
-                AV_WN32A(mb->intra4x4_pred_mode_top, modes);
-            else
-                AV_WN32A(s->intra4x4_pred_mode_top + 4 * mb_x, modes);
-            AV_WN32A( s->intra4x4_pred_mode_left, modes);
-        }
-
-        mb->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree, vp8_pred8x8c_prob_intra);
-        mb->ref_frame = VP56_FRAME_CURRENT;
-    } else if (vp56_rac_get_prob_branchy(c, s->prob->intra)) {
-        // inter MB, 16.2
-        if (vp56_rac_get_prob_branchy(c, s->prob->last))
-            mb->ref_frame = vp56_rac_get_prob(c, s->prob->golden) ?
-                VP56_FRAME_GOLDEN2 /* altref */ : VP56_FRAME_GOLDEN;
-        else
-            mb->ref_frame = VP56_FRAME_PREVIOUS;
-        s->ref_count[mb->ref_frame-1]++;
-
-        // motion vectors, 16.3
-        decode_mvs(s, mb, mb_x, mb_y, layout);
-    } else {
-        // intra MB, 16.1
-        mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_inter, s->prob->pred16x16);
-
-        if (mb->mode == MODE_I4x4)
-            decode_intra4x4_modes(s, c, mb, mb_x, 0, layout);
-
-        mb->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree, s->prob->pred8x8c);
-        mb->ref_frame = VP56_FRAME_CURRENT;
-        mb->partitioning = VP8_SPLITMVMODE_NONE;
-        AV_ZERO32(&mb->bmv[0]);
-    }
-}
-
-#ifndef decode_block_coeffs_internal
-/**
- * @param r arithmetic bitstream reader context
- * @param block destination for block coefficients
- * @param probs probabilities to use when reading trees from the bitstream
- * @param i initial coeff index, 0 unless a separate DC block is coded
- * @param qmul array holding the dc/ac dequant factor at position 0/1
- * @return 0 if no coeffs were decoded
- *         otherwise, the index of the last coeff decoded plus one
- */
-static int decode_block_coeffs_internal(VP56RangeCoder *r, int16_t block[16],
-                                        uint8_t probs[16][3][NUM_DCT_TOKENS-1],
-                                        int i, uint8_t *token_prob, int16_t qmul[2])
-{
-    VP56RangeCoder c = *r;
-    goto skip_eob;
-    do {
-        int coeff;
-        if (!vp56_rac_get_prob_branchy(&c, token_prob[0]))   // DCT_EOB
-            break;
-
-skip_eob:
-        if (!vp56_rac_get_prob_branchy(&c, token_prob[1])) { // DCT_0
-            if (++i == 16)
-                break; // invalid input; blocks should end with EOB
-            token_prob = probs[i][0];
-            goto skip_eob;
-        }
-
-        if (!vp56_rac_get_prob_branchy(&c, token_prob[2])) { // DCT_1
-            coeff = 1;
-            token_prob = probs[i+1][1];
-        } else {
-            if (!vp56_rac_get_prob_branchy(&c, token_prob[3])) { // DCT 2,3,4
-                coeff = vp56_rac_get_prob_branchy(&c, token_prob[4]);
-                if (coeff)
-                    coeff += vp56_rac_get_prob(&c, token_prob[5]);
-                coeff += 2;
-            } else {
-                // DCT_CAT*
-                if (!vp56_rac_get_prob_branchy(&c, token_prob[6])) {
-                    if (!vp56_rac_get_prob_branchy(&c, token_prob[7])) { // DCT_CAT1
-                        coeff  = 5 + vp56_rac_get_prob(&c, vp8_dct_cat1_prob[0]);
-                    } else {                                    // DCT_CAT2
-                        coeff  = 7;
-                        coeff += vp56_rac_get_prob(&c, vp8_dct_cat2_prob[0]) << 1;
-                        coeff += vp56_rac_get_prob(&c, vp8_dct_cat2_prob[1]);
-                    }
-                } else {    // DCT_CAT3 and up
-                    int a = vp56_rac_get_prob(&c, token_prob[8]);
-                    int b = vp56_rac_get_prob(&c, token_prob[9+a]);
-                    int cat = (a<<1) + b;
-                    coeff  = 3 + (8<<cat);
-                    coeff += vp8_rac_get_coeff(&c, ff_vp8_dct_cat_prob[cat]);
-                }
-            }
-            token_prob = probs[i+1][2];
-        }
-        block[zigzag_scan[i]] = (vp8_rac_get(&c) ? -coeff : coeff) * qmul[!!i];
-    } while (++i < 16);
-
-    *r = c;
-    return i;
-}
-#endif
-
-/**
- * @param c arithmetic bitstream reader context
- * @param block destination for block coefficients
- * @param probs probabilities to use when reading trees from the bitstream
- * @param i initial coeff index, 0 unless a separate DC block is coded
- * @param zero_nhood the initial prediction context for number of surrounding
- *                   all-zero blocks (only left/top, so 0-2)
- * @param qmul array holding the dc/ac dequant factor at position 0/1
- * @return 0 if no coeffs were decoded
- *         otherwise, the index of the last coeff decoded plus one
- */
-static av_always_inline
-int decode_block_coeffs(VP56RangeCoder *c, int16_t block[16],
-                        uint8_t probs[16][3][NUM_DCT_TOKENS-1],
-                        int i, int zero_nhood, int16_t qmul[2])
-{
-    uint8_t *token_prob = probs[i][zero_nhood];
-    if (!vp56_rac_get_prob_branchy(c, token_prob[0]))   // DCT_EOB
-        return 0;
-    return decode_block_coeffs_internal(c, block, probs, i, token_prob, qmul);
-}
-
-static av_always_inline
-void decode_mb_coeffs(VP8Context *s, VP8ThreadData *td, VP56RangeCoder *c, VP8Macroblock *mb,
-                      uint8_t t_nnz[9], uint8_t l_nnz[9])
-{
-    int i, x, y, luma_start = 0, luma_ctx = 3;
-    int nnz_pred, nnz, nnz_total = 0;
-    int segment = mb->segment;
-    int block_dc = 0;
-
-    if (mb->mode != MODE_I4x4 && mb->mode != VP8_MVMODE_SPLIT) {
-        nnz_pred = t_nnz[8] + l_nnz[8];
-
-        // decode DC values and do hadamard
-        nnz = decode_block_coeffs(c, td->block_dc, s->prob->token[1], 0, nnz_pred,
-                                  s->qmat[segment].luma_dc_qmul);
-        l_nnz[8] = t_nnz[8] = !!nnz;
-        if (nnz) {
-            nnz_total += nnz;
-            block_dc = 1;
-            if (nnz == 1)
-                s->vp8dsp.vp8_luma_dc_wht_dc(td->block, td->block_dc);
-            else
-                s->vp8dsp.vp8_luma_dc_wht(td->block, td->block_dc);
-        }
-        luma_start = 1;
-        luma_ctx = 0;
-    }
-
-    // luma blocks
-    for (y = 0; y < 4; y++)
-        for (x = 0; x < 4; x++) {
-            nnz_pred = l_nnz[y] + t_nnz[x];
-            nnz = decode_block_coeffs(c, td->block[y][x], s->prob->token[luma_ctx], luma_start,
-                                      nnz_pred, s->qmat[segment].luma_qmul);
-            // nnz+block_dc may be one more than the actual last index, but we don't care
-            td->non_zero_count_cache[y][x] = nnz + block_dc;
-            t_nnz[x] = l_nnz[y] = !!nnz;
-            nnz_total += nnz;
-        }
-
-    // chroma blocks
-    // TODO: what to do about dimensions? 2nd dim for luma is x,
-    // but for chroma it's (y<<1)|x
-    for (i = 4; i < 6; i++)
-        for (y = 0; y < 2; y++)
-            for (x = 0; x < 2; x++) {
-                nnz_pred = l_nnz[i+2*y] + t_nnz[i+2*x];
-                nnz = decode_block_coeffs(c, td->block[i][(y<<1)+x], s->prob->token[2], 0,
-                                          nnz_pred, s->qmat[segment].chroma_qmul);
-                td->non_zero_count_cache[i][(y<<1)+x] = nnz;
-                t_nnz[i+2*x] = l_nnz[i+2*y] = !!nnz;
-                nnz_total += nnz;
-            }
-
-    // if there were no coded coeffs despite the macroblock not being marked skip,
-    // we MUST not do the inner loop filter and should not do IDCT
-    // Since skip isn't used for bitstream prediction, just manually set it.
-    if (!nnz_total)
-        mb->skip = 1;
-}
-
-static av_always_inline
-void backup_mb_border(uint8_t *top_border, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr,
-                      int linesize, int uvlinesize, int simple)
-{
-    AV_COPY128(top_border, src_y + 15*linesize);
-    if (!simple) {
-        AV_COPY64(top_border+16, src_cb + 7*uvlinesize);
-        AV_COPY64(top_border+24, src_cr + 7*uvlinesize);
-    }
-}
-
-static av_always_inline
-void xchg_mb_border(uint8_t *top_border, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr,
-                    int linesize, int uvlinesize, int mb_x, int mb_y, int mb_width,
-                    int simple, int xchg)
-{
-    uint8_t *top_border_m1 = top_border-32;     // for TL prediction
-    src_y  -=   linesize;
-    src_cb -= uvlinesize;
-    src_cr -= uvlinesize;
-
-#define XCHG(a,b,xchg) do {                     \
-        if (xchg) AV_SWAP64(b,a);               \
-        else      AV_COPY64(b,a);               \
-    } while (0)
-
-    XCHG(top_border_m1+8, src_y-8, xchg);
-    XCHG(top_border,      src_y,   xchg);
-    XCHG(top_border+8,    src_y+8, 1);
-    if (mb_x < mb_width-1)
-        XCHG(top_border+32, src_y+16, 1);
-
-    // only copy chroma for normal loop filter
-    // or to initialize the top row to 127
-    if (!simple || !mb_y) {
-        XCHG(top_border_m1+16, src_cb-8, xchg);
-        XCHG(top_border_m1+24, src_cr-8, xchg);
-        XCHG(top_border+16,    src_cb, 1);
-        XCHG(top_border+24,    src_cr, 1);
-    }
-}
-
-static av_always_inline
-int check_dc_pred8x8_mode(int mode, int mb_x, int mb_y)
-{
-    if (!mb_x) {
-        return mb_y ? TOP_DC_PRED8x8 : DC_128_PRED8x8;
-    } else {
-        return mb_y ? mode : LEFT_DC_PRED8x8;
-    }
-}
-
-static av_always_inline
-int check_tm_pred8x8_mode(int mode, int mb_x, int mb_y)
-{
-    if (!mb_x) {
-        return mb_y ? VERT_PRED8x8 : DC_129_PRED8x8;
-    } else {
-        return mb_y ? mode : HOR_PRED8x8;
-    }
-}
-
-static av_always_inline
-int check_intra_pred8x8_mode_emuedge(int mode, int mb_x, int mb_y)
-{
-    switch (mode) {
-    case DC_PRED8x8:
-        return check_dc_pred8x8_mode(mode, mb_x, mb_y);
-    case VERT_PRED8x8:
-        return !mb_y ? DC_127_PRED8x8 : mode;
-    case HOR_PRED8x8:
-        return !mb_x ? DC_129_PRED8x8 : mode;
-    case PLANE_PRED8x8 /*TM*/:
-        return check_tm_pred8x8_mode(mode, mb_x, mb_y);
-    }
-    return mode;
-}
-
-static av_always_inline
-int check_tm_pred4x4_mode(int mode, int mb_x, int mb_y)
-{
-    if (!mb_x) {
-        return mb_y ? VERT_VP8_PRED : DC_129_PRED;
-    } else {
-        return mb_y ? mode : HOR_VP8_PRED;
-    }
-}
-
-static av_always_inline
-int check_intra_pred4x4_mode_emuedge(int mode, int mb_x, int mb_y, int *copy_buf)
-{
-    switch (mode) {
-    case VERT_PRED:
-        if (!mb_x && mb_y) {
-            *copy_buf = 1;
-            return mode;
-        }
-        /* fall-through */
-    case DIAG_DOWN_LEFT_PRED:
-    case VERT_LEFT_PRED:
-        return !mb_y ? DC_127_PRED : mode;
-    case HOR_PRED:
-        if (!mb_y) {
-            *copy_buf = 1;
-            return mode;
-        }
-        /* fall-through */
-    case HOR_UP_PRED:
-        return !mb_x ? DC_129_PRED : mode;
-    case TM_VP8_PRED:
-        return check_tm_pred4x4_mode(mode, mb_x, mb_y);
-    case DC_PRED: // 4x4 DC doesn't use the same "H.264-style" exceptions as 16x16/8x8 DC
-    case DIAG_DOWN_RIGHT_PRED:
-    case VERT_RIGHT_PRED:
-    case HOR_DOWN_PRED:
-        if (!mb_y || !mb_x)
-            *copy_buf = 1;
-        return mode;
-    }
-    return mode;
-}
-
-static av_always_inline
-void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
-                   VP8Macroblock *mb, int mb_x, int mb_y)
-{
-    int x, y, mode, nnz;
-    uint32_t tr;
-
-    // for the first row, we need to run xchg_mb_border to init the top edge to 127
-    // otherwise, skip it if we aren't going to deblock
-    if (mb_y && (s->deblock_filter || !mb_y) && td->thread_nr == 0)
-        xchg_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2],
-                       s->linesize, s->uvlinesize, mb_x, mb_y, s->mb_width,
-                       s->filter.simple, 1);
-
-    if (mb->mode < MODE_I4x4) {
-        mode = check_intra_pred8x8_mode_emuedge(mb->mode, mb_x, mb_y);
-        s->hpc.pred16x16[mode](dst[0], s->linesize);
-    } else {
-        uint8_t *ptr = dst[0];
-        uint8_t *intra4x4 = mb->intra4x4_pred_mode_mb;
-        uint8_t tr_top[4] = { 127, 127, 127, 127 };
-
-        // all blocks on the right edge of the macroblock use bottom edge
-        // the top macroblock for their topright edge
-        uint8_t *tr_right = ptr - s->linesize + 16;
-
-        // if we're on the right edge of the frame, said edge is extended
-        // from the top macroblock
-        if (mb_y &&
-            mb_x == s->mb_width-1) {
-            tr = tr_right[-1]*0x01010101u;
-            tr_right = (uint8_t *)&tr;
-        }
-
-        if (mb->skip)
-            AV_ZERO128(td->non_zero_count_cache);
-
-        for (y = 0; y < 4; y++) {
-            uint8_t *topright = ptr + 4 - s->linesize;
-            for (x = 0; x < 4; x++) {
-                int copy = 0, linesize = s->linesize;
-                uint8_t *dst = ptr+4*x;
-                DECLARE_ALIGNED(4, uint8_t, copy_dst)[5*8];
-
-                if ((y == 0 || x == 3) && mb_y == 0) {
-                    topright = tr_top;
-                } else if (x == 3)
-                    topright = tr_right;
-
-                mode = check_intra_pred4x4_mode_emuedge(intra4x4[x], mb_x + x, mb_y + y, &copy);
-                if (copy) {
-                    dst = copy_dst + 12;
-                    linesize = 8;
-                    if (!(mb_y + y)) {
-                        copy_dst[3] = 127U;
-                        AV_WN32A(copy_dst+4, 127U * 0x01010101U);
-                    } else {
-                        AV_COPY32(copy_dst+4, ptr+4*x-s->linesize);
-                        if (!(mb_x + x)) {
-                            copy_dst[3] = 129U;
-                        } else {
-                            copy_dst[3] = ptr[4*x-s->linesize-1];
-                        }
-                    }
-                    if (!(mb_x + x)) {
-                        copy_dst[11] =
-                        copy_dst[19] =
-                        copy_dst[27] =
-                        copy_dst[35] = 129U;
-                    } else {
-                        copy_dst[11] = ptr[4*x              -1];
-                        copy_dst[19] = ptr[4*x+s->linesize  -1];
-                        copy_dst[27] = ptr[4*x+s->linesize*2-1];
-                        copy_dst[35] = ptr[4*x+s->linesize*3-1];
-                    }
-                }
-                s->hpc.pred4x4[mode](dst, topright, linesize);
-                if (copy) {
-                    AV_COPY32(ptr+4*x              , copy_dst+12);
-                    AV_COPY32(ptr+4*x+s->linesize  , copy_dst+20);
-                    AV_COPY32(ptr+4*x+s->linesize*2, copy_dst+28);
-                    AV_COPY32(ptr+4*x+s->linesize*3, copy_dst+36);
-                }
-
-                nnz = td->non_zero_count_cache[y][x];
-                if (nnz) {
-                    if (nnz == 1)
-                        s->vp8dsp.vp8_idct_dc_add(ptr+4*x, td->block[y][x], s->linesize);
-                    else
-                        s->vp8dsp.vp8_idct_add(ptr+4*x, td->block[y][x], s->linesize);
-                }
-                topright += 4;
-            }
-
-            ptr   += 4*s->linesize;
-            intra4x4 += 4;
-        }
-    }
-
-    mode = check_intra_pred8x8_mode_emuedge(mb->chroma_pred_mode, mb_x, mb_y);
-    s->hpc.pred8x8[mode](dst[1], s->uvlinesize);
-    s->hpc.pred8x8[mode](dst[2], s->uvlinesize);
-
-    if (mb_y && (s->deblock_filter || !mb_y) && td->thread_nr == 0)
-        xchg_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2],
-                       s->linesize, s->uvlinesize, mb_x, mb_y, s->mb_width,
-                       s->filter.simple, 0);
-}
-
-static const uint8_t subpel_idx[3][8] = {
-    { 0, 1, 2, 1, 2, 1, 2, 1 }, // nr. of left extra pixels,
-                                // also function pointer index
-    { 0, 3, 5, 3, 5, 3, 5, 3 }, // nr. of extra pixels required
-    { 0, 2, 3, 2, 3, 2, 3, 2 }, // nr. of right extra pixels
-};
-
-/**
- * luma MC function
- *
- * @param s VP8 decoding context
- * @param dst target buffer for block data at block position
- * @param ref reference picture buffer at origin (0, 0)
- * @param mv motion vector (relative to block position) to get pixel data from
- * @param x_off horizontal position of block from origin (0, 0)
- * @param y_off vertical position of block from origin (0, 0)
- * @param block_w width of block (16, 8 or 4)
- * @param block_h height of block (always same as block_w)
- * @param width width of src/dst plane data
- * @param height height of src/dst plane data
- * @param linesize size of a single line of plane data, including padding
- * @param mc_func motion compensation function pointers (bilinear or sixtap MC)
- */
-static av_always_inline
-void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
-                 ThreadFrame *ref, const VP56mv *mv,
-                 int x_off, int y_off, int block_w, int block_h,
-                 int width, int height, ptrdiff_t linesize,
-                 vp8_mc_func mc_func[3][3])
-{
-    uint8_t *src = ref->f->data[0];
-
-    if (AV_RN32A(mv)) {
-        int src_linesize = linesize;
-
-        int mx = (mv->x << 1)&7, mx_idx = subpel_idx[0][mx];
-        int my = (mv->y << 1)&7, my_idx = subpel_idx[0][my];
-
-        x_off += mv->x >> 2;
-        y_off += mv->y >> 2;
-
-        // edge emulation
-        ff_thread_await_progress(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 4, 0);
-        src += y_off * linesize + x_off;
-        if (x_off < mx_idx || x_off >= width  - block_w - subpel_idx[2][mx] ||
-            y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
-            s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
-                                     src - my_idx * linesize - mx_idx,
-                                     EDGE_EMU_LINESIZE, linesize,
-                                     block_w + subpel_idx[1][mx], block_h + subpel_idx[1][my],
-                                     x_off - mx_idx, y_off - my_idx, width, height);
-            src = td->edge_emu_buffer + mx_idx + EDGE_EMU_LINESIZE * my_idx;
-            src_linesize = EDGE_EMU_LINESIZE;
-        }
-        mc_func[my_idx][mx_idx](dst, linesize, src, src_linesize, block_h, mx, my);
-    } else {
-        ff_thread_await_progress(ref, (3 + y_off + block_h) >> 4, 0);
-        mc_func[0][0](dst, linesize, src + y_off * linesize + x_off, linesize, block_h, 0, 0);
-    }
-}
-
-/**
- * chroma MC function
- *
- * @param s VP8 decoding context
- * @param dst1 target buffer for block data at block position (U plane)
- * @param dst2 target buffer for block data at block position (V plane)
- * @param ref reference picture buffer at origin (0, 0)
- * @param mv motion vector (relative to block position) to get pixel data from
- * @param x_off horizontal position of block from origin (0, 0)
- * @param y_off vertical position of block from origin (0, 0)
- * @param block_w width of block (16, 8 or 4)
- * @param block_h height of block (always same as block_w)
- * @param width width of src/dst plane data
- * @param height height of src/dst plane data
- * @param linesize size of a single line of plane data, including padding
- * @param mc_func motion compensation function pointers (bilinear or sixtap MC)
- */
-static av_always_inline
-void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1, uint8_t *dst2,
-                   ThreadFrame *ref, const VP56mv *mv, int x_off, int y_off,
-                   int block_w, int block_h, int width, int height, ptrdiff_t linesize,
-                   vp8_mc_func mc_func[3][3])
-{
-    uint8_t *src1 = ref->f->data[1], *src2 = ref->f->data[2];
-
-    if (AV_RN32A(mv)) {
-        int mx = mv->x&7, mx_idx = subpel_idx[0][mx];
-        int my = mv->y&7, my_idx = subpel_idx[0][my];
-
-        x_off += mv->x >> 3;
-        y_off += mv->y >> 3;
-
-        // edge emulation
-        src1 += y_off * linesize + x_off;
-        src2 += y_off * linesize + x_off;
-        ff_thread_await_progress(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 3, 0);
-        if (x_off < mx_idx || x_off >= width  - block_w - subpel_idx[2][mx] ||
-            y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
-            s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
-                                     src1 - my_idx * linesize - mx_idx,
-                                     EDGE_EMU_LINESIZE, linesize,
-                                     block_w + subpel_idx[1][mx], block_h + subpel_idx[1][my],
-                                     x_off - mx_idx, y_off - my_idx, width, height);
-            src1 = td->edge_emu_buffer + mx_idx + EDGE_EMU_LINESIZE * my_idx;
-            mc_func[my_idx][mx_idx](dst1, linesize, src1, EDGE_EMU_LINESIZE, block_h, mx, my);
-
-            s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
-                                     src2 - my_idx * linesize - mx_idx,
-                                     EDGE_EMU_LINESIZE, linesize,
-                                     block_w + subpel_idx[1][mx], block_h + subpel_idx[1][my],
-                                     x_off - mx_idx, y_off - my_idx, width, height);
-            src2 = td->edge_emu_buffer + mx_idx + EDGE_EMU_LINESIZE* my_idx;
-            mc_func[my_idx][mx_idx](dst2, linesize, src2, EDGE_EMU_LINESIZE, block_h, mx, my);
-        } else {
-            mc_func[my_idx][mx_idx](dst1, linesize, src1, linesize, block_h, mx, my);
-            mc_func[my_idx][mx_idx](dst2, linesize, src2, linesize, block_h, mx, my);
-        }
-    } else {
-        ff_thread_await_progress(ref, (3 + y_off + block_h) >> 3, 0);
-        mc_func[0][0](dst1, linesize, src1 + y_off * linesize + x_off, linesize, block_h, 0, 0);
-        mc_func[0][0](dst2, linesize, src2 + y_off * linesize + x_off, linesize, block_h, 0, 0);
-    }
-}
-
-static av_always_inline
-void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
-                 ThreadFrame *ref_frame, int x_off, int y_off,
-                 int bx_off, int by_off,
-                 int block_w, int block_h,
-                 int width, int height, VP56mv *mv)
-{
-    VP56mv uvmv = *mv;
-
-    /* Y */
-    vp8_mc_luma(s, td, dst[0] + by_off * s->linesize + bx_off,
-                ref_frame, mv, x_off + bx_off, y_off + by_off,
-                block_w, block_h, width, height, s->linesize,
-                s->put_pixels_tab[block_w == 8]);
-
-    /* U/V */
-    if (s->profile == 3) {
-        uvmv.x &= ~7;
-        uvmv.y &= ~7;
-    }
-    x_off   >>= 1; y_off   >>= 1;
-    bx_off  >>= 1; by_off  >>= 1;
-    width   >>= 1; height  >>= 1;
-    block_w >>= 1; block_h >>= 1;
-    vp8_mc_chroma(s, td, dst[1] + by_off * s->uvlinesize + bx_off,
-                  dst[2] + by_off * s->uvlinesize + bx_off, ref_frame,
-                  &uvmv, x_off + bx_off, y_off + by_off,
-                  block_w, block_h, width, height, s->uvlinesize,
-                  s->put_pixels_tab[1 + (block_w == 4)]);
-}
-
-/* Fetch pixels for estimated mv 4 macroblocks ahead.
- * Optimized for 64-byte cache lines.  Inspired by ffh264 prefetch_motion. */
-static av_always_inline void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int mb_xy, int ref)
-{
-    /* Don't prefetch refs that haven't been used very often this frame. */
-    if (s->ref_count[ref-1] > (mb_xy >> 5)) {
-        int x_off = mb_x << 4, y_off = mb_y << 4;
-        int mx = (mb->mv.x>>2) + x_off + 8;
-        int my = (mb->mv.y>>2) + y_off;
-        uint8_t **src= s->framep[ref]->tf.f->data;
-        int off= mx + (my + (mb_x&3)*4)*s->linesize + 64;
-        /* For threading, a ff_thread_await_progress here might be useful, but
-         * it actually slows down the decoder. Since a bad prefetch doesn't
-         * generate bad decoder output, we don't run it here. */
-        s->vdsp.prefetch(src[0]+off, s->linesize, 4);
-        off= (mx>>1) + ((my>>1) + (mb_x&7))*s->uvlinesize + 64;
-        s->vdsp.prefetch(src[1]+off, src[2]-src[1], 2);
-    }
-}
-
-/**
- * Apply motion vectors to prediction buffer, chapter 18.
- */
-static av_always_inline
-void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
-                   VP8Macroblock *mb, int mb_x, int mb_y)
-{
-    int x_off = mb_x << 4, y_off = mb_y << 4;
-    int width = 16*s->mb_width, height = 16*s->mb_height;
-    ThreadFrame *ref = &s->framep[mb->ref_frame]->tf;
-    VP56mv *bmv = mb->bmv;
-
-    switch (mb->partitioning) {
-    case VP8_SPLITMVMODE_NONE:
-        vp8_mc_part(s, td, dst, ref, x_off, y_off,
-                    0, 0, 16, 16, width, height, &mb->mv);
-        break;
-    case VP8_SPLITMVMODE_4x4: {
-        int x, y;
-        VP56mv uvmv;
-
-        /* Y */
-        for (y = 0; y < 4; y++) {
-            for (x = 0; x < 4; x++) {
-                vp8_mc_luma(s, td, dst[0] + 4*y*s->linesize + x*4,
-                            ref, &bmv[4*y + x],
-                            4*x + x_off, 4*y + y_off, 4, 4,
-                            width, height, s->linesize,
-                            s->put_pixels_tab[2]);
-            }
-        }
-
-        /* U/V */
-        x_off >>= 1; y_off >>= 1; width >>= 1; height >>= 1;
-        for (y = 0; y < 2; y++) {
-            for (x = 0; x < 2; x++) {
-                uvmv.x = mb->bmv[ 2*y    * 4 + 2*x  ].x +
-                         mb->bmv[ 2*y    * 4 + 2*x+1].x +
-                         mb->bmv[(2*y+1) * 4 + 2*x  ].x +
-                         mb->bmv[(2*y+1) * 4 + 2*x+1].x;
-                uvmv.y = mb->bmv[ 2*y    * 4 + 2*x  ].y +
-                         mb->bmv[ 2*y    * 4 + 2*x+1].y +
-                         mb->bmv[(2*y+1) * 4 + 2*x  ].y +
-                         mb->bmv[(2*y+1) * 4 + 2*x+1].y;
-                uvmv.x = (uvmv.x + 2 + (uvmv.x >> (INT_BIT-1))) >> 2;
-                uvmv.y = (uvmv.y + 2 + (uvmv.y >> (INT_BIT-1))) >> 2;
-                if (s->profile == 3) {
-                    uvmv.x &= ~7;
-                    uvmv.y &= ~7;
-                }
-                vp8_mc_chroma(s, td, dst[1] + 4*y*s->uvlinesize + x*4,
-                              dst[2] + 4*y*s->uvlinesize + x*4, ref, &uvmv,
-                              4*x + x_off, 4*y + y_off, 4, 4,
-                              width, height, s->uvlinesize,
-                              s->put_pixels_tab[2]);
-            }
-        }
-        break;
-    }
-    case VP8_SPLITMVMODE_16x8:
-        vp8_mc_part(s, td, dst, ref, x_off, y_off,
-                    0, 0, 16, 8, width, height, &bmv[0]);
-        vp8_mc_part(s, td, dst, ref, x_off, y_off,
-                    0, 8, 16, 8, width, height, &bmv[1]);
-        break;
-    case VP8_SPLITMVMODE_8x16:
-        vp8_mc_part(s, td, dst, ref, x_off, y_off,
-                    0, 0, 8, 16, width, height, &bmv[0]);
-        vp8_mc_part(s, td, dst, ref, x_off, y_off,
-                    8, 0, 8, 16, width, height, &bmv[1]);
-        break;
-    case VP8_SPLITMVMODE_8x8:
-        vp8_mc_part(s, td, dst, ref, x_off, y_off,
-                    0, 0, 8, 8, width, height, &bmv[0]);
-        vp8_mc_part(s, td, dst, ref, x_off, y_off,
-                    8, 0, 8, 8, width, height, &bmv[1]);
-        vp8_mc_part(s, td, dst, ref, x_off, y_off,
-                    0, 8, 8, 8, width, height, &bmv[2]);
-        vp8_mc_part(s, td, dst, ref, x_off, y_off,
-                    8, 8, 8, 8, width, height, &bmv[3]);
-        break;
-    }
-}
-
-static av_always_inline void idct_mb(VP8Context *s, VP8ThreadData *td,
-                                     uint8_t *dst[3], VP8Macroblock *mb)
-{
-    int x, y, ch;
-
-    if (mb->mode != MODE_I4x4) {
-        uint8_t *y_dst = dst[0];
-        for (y = 0; y < 4; y++) {
-            uint32_t nnz4 = AV_RL32(td->non_zero_count_cache[y]);
-            if (nnz4) {
-                if (nnz4&~0x01010101) {
-                    for (x = 0; x < 4; x++) {
-                        if ((uint8_t)nnz4 == 1)
-                            s->vp8dsp.vp8_idct_dc_add(y_dst+4*x, td->block[y][x], s->linesize);
-                        else if((uint8_t)nnz4 > 1)
-                            s->vp8dsp.vp8_idct_add(y_dst+4*x, td->block[y][x], s->linesize);
-                        nnz4 >>= 8;
-                        if (!nnz4)
-                            break;
-                    }
-                } else {
-                    s->vp8dsp.vp8_idct_dc_add4y(y_dst, td->block[y], s->linesize);
-                }
-            }
-            y_dst += 4*s->linesize;
-        }
-    }
-
-    for (ch = 0; ch < 2; ch++) {
-        uint32_t nnz4 = AV_RL32(td->non_zero_count_cache[4+ch]);
-        if (nnz4) {
-            uint8_t *ch_dst = dst[1+ch];
-            if (nnz4&~0x01010101) {
-                for (y = 0; y < 2; y++) {
-                    for (x = 0; x < 2; x++) {
-                        if ((uint8_t)nnz4 == 1)
-                            s->vp8dsp.vp8_idct_dc_add(ch_dst+4*x, td->block[4+ch][(y<<1)+x], s->uvlinesize);
-                        else if((uint8_t)nnz4 > 1)
-                            s->vp8dsp.vp8_idct_add(ch_dst+4*x, td->block[4+ch][(y<<1)+x], s->uvlinesize);
-                        nnz4 >>= 8;
-                        if (!nnz4)
-                            goto chroma_idct_end;
-                    }
-                    ch_dst += 4*s->uvlinesize;
-                }
-            } else {
-                s->vp8dsp.vp8_idct_dc_add4uv(ch_dst, td->block[4+ch], s->uvlinesize);
-            }
-        }
-chroma_idct_end: ;
-    }
-}
-
-static av_always_inline void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb, VP8FilterStrength *f )
-{
-    int interior_limit, filter_level;
-
-    if (s->segmentation.enabled) {
-        filter_level = s->segmentation.filter_level[mb->segment];
-        if (!s->segmentation.absolute_vals)
-            filter_level += s->filter.level;
-    } else
-        filter_level = s->filter.level;
-
-    if (s->lf_delta.enabled) {
-        filter_level += s->lf_delta.ref[mb->ref_frame];
-        filter_level += s->lf_delta.mode[mb->mode];
-    }
-
-    filter_level = av_clip_uintp2(filter_level, 6);
-
-    interior_limit = filter_level;
-    if (s->filter.sharpness) {
-        interior_limit >>= (s->filter.sharpness + 3) >> 2;
-        interior_limit = FFMIN(interior_limit, 9 - s->filter.sharpness);
-    }
-    interior_limit = FFMAX(interior_limit, 1);
-
-    f->filter_level = filter_level;
-    f->inner_limit = interior_limit;
-    f->inner_filter = !mb->skip || mb->mode == MODE_I4x4 || mb->mode == VP8_MVMODE_SPLIT;
-}
-
-static av_always_inline void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f, int mb_x, int mb_y)
-{
-    int mbedge_lim, bedge_lim, hev_thresh;
-    int filter_level = f->filter_level;
-    int inner_limit = f->inner_limit;
-    int inner_filter = f->inner_filter;
-    int linesize = s->linesize;
-    int uvlinesize = s->uvlinesize;
-    static const uint8_t hev_thresh_lut[2][64] = {
-        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
-          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-          3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-          3, 3, 3, 3 },
-        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
-          1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-          2, 2, 2, 2 }
-    };
-
-    if (!filter_level)
-        return;
-
-     bedge_lim = 2*filter_level + inner_limit;
-    mbedge_lim = bedge_lim + 4;
-
-    hev_thresh = hev_thresh_lut[s->keyframe][filter_level];
-
-    if (mb_x) {
-        s->vp8dsp.vp8_h_loop_filter16y(dst[0],     linesize,
-                                       mbedge_lim, inner_limit, hev_thresh);
-        s->vp8dsp.vp8_h_loop_filter8uv(dst[1],     dst[2],      uvlinesize,
-                                       mbedge_lim, inner_limit, hev_thresh);
-    }
-
-    if (inner_filter) {
-        s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0]+ 4, linesize, bedge_lim,
-                                             inner_limit, hev_thresh);
-        s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0]+ 8, linesize, bedge_lim,
-                                             inner_limit, hev_thresh);
-        s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0]+12, linesize, bedge_lim,
-                                             inner_limit, hev_thresh);
-        s->vp8dsp.vp8_h_loop_filter8uv_inner(dst[1] + 4, dst[2] + 4,
-                                             uvlinesize,  bedge_lim,
-                                             inner_limit, hev_thresh);
-    }
-
-    if (mb_y) {
-        s->vp8dsp.vp8_v_loop_filter16y(dst[0],     linesize,
-                                       mbedge_lim, inner_limit, hev_thresh);
-        s->vp8dsp.vp8_v_loop_filter8uv(dst[1],     dst[2],      uvlinesize,
-                                       mbedge_lim, inner_limit, hev_thresh);
-    }
-
-    if (inner_filter) {
-        s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0]+ 4*linesize,
-                                             linesize,    bedge_lim,
-                                             inner_limit, hev_thresh);
-        s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0]+ 8*linesize,
-                                             linesize,    bedge_lim,
-                                             inner_limit, hev_thresh);
-        s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0]+12*linesize,
-                                             linesize,    bedge_lim,
-                                             inner_limit, hev_thresh);
-        s->vp8dsp.vp8_v_loop_filter8uv_inner(dst[1] + 4 * uvlinesize,
-                                             dst[2] + 4 * uvlinesize,
-                                             uvlinesize,  bedge_lim,
-                                             inner_limit, hev_thresh);
-    }
-}
-
-static av_always_inline void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f, int mb_x, int mb_y)
-{
-    int mbedge_lim, bedge_lim;
-    int filter_level = f->filter_level;
-    int inner_limit = f->inner_limit;
-    int inner_filter = f->inner_filter;
-    int linesize = s->linesize;
-
-    if (!filter_level)
-        return;
-
-     bedge_lim = 2*filter_level + inner_limit;
-    mbedge_lim = bedge_lim + 4;
-
-    if (mb_x)
-        s->vp8dsp.vp8_h_loop_filter_simple(dst, linesize, mbedge_lim);
-    if (inner_filter) {
-        s->vp8dsp.vp8_h_loop_filter_simple(dst+ 4, linesize, bedge_lim);
-        s->vp8dsp.vp8_h_loop_filter_simple(dst+ 8, linesize, bedge_lim);
-        s->vp8dsp.vp8_h_loop_filter_simple(dst+12, linesize, bedge_lim);
-    }
-
-    if (mb_y)
-        s->vp8dsp.vp8_v_loop_filter_simple(dst, linesize, mbedge_lim);
-    if (inner_filter) {
-        s->vp8dsp.vp8_v_loop_filter_simple(dst+ 4*linesize, linesize, bedge_lim);
-        s->vp8dsp.vp8_v_loop_filter_simple(dst+ 8*linesize, linesize, bedge_lim);
-        s->vp8dsp.vp8_v_loop_filter_simple(dst+12*linesize, linesize, bedge_lim);
-    }
-}
-
-#define MARGIN (16 << 2)
-static void vp8_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
-                                   VP8Frame *prev_frame)
-{
-    VP8Context *s = avctx->priv_data;
-    int mb_x, mb_y;
-
-    s->mv_min.y = -MARGIN;
-    s->mv_max.y = ((s->mb_height - 1) << 6) + MARGIN;
-    for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
-        VP8Macroblock *mb = s->macroblocks_base + ((s->mb_width+1)*(mb_y + 1) + 1);
-        int mb_xy = mb_y*s->mb_width;
-
-        AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED*0x01010101);
-
-        s->mv_min.x = -MARGIN;
-        s->mv_max.x = ((s->mb_width - 1) << 6) + MARGIN;
-        for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) {
-            if (mb_y == 0)
-                AV_WN32A((mb-s->mb_width-1)->intra4x4_pred_mode_top, DC_PRED*0x01010101);
-            decode_mb_mode(s, mb, mb_x, mb_y, curframe->seg_map->data + mb_xy,
-                           prev_frame && prev_frame->seg_map ?
-                           prev_frame->seg_map->data + mb_xy : NULL, 1);
-            s->mv_min.x -= 64;
-            s->mv_max.x -= 64;
-        }
-        s->mv_min.y -= 64;
-        s->mv_max.y -= 64;
-    }
-}
-
-#if HAVE_THREADS
-#define check_thread_pos(td, otd, mb_x_check, mb_y_check)\
-    do {\
-        int tmp = (mb_y_check << 16) | (mb_x_check & 0xFFFF);\
-        if (otd->thread_mb_pos < tmp) {\
-            pthread_mutex_lock(&otd->lock);\
-            td->wait_mb_pos = tmp;\
-            do {\
-                if (otd->thread_mb_pos >= tmp)\
-                    break;\
-                pthread_cond_wait(&otd->cond, &otd->lock);\
-            } while (1);\
-            td->wait_mb_pos = INT_MAX;\
-            pthread_mutex_unlock(&otd->lock);\
-        }\
-    } while(0);
-
-#define update_pos(td, mb_y, mb_x)\
-    do {\
-    int pos              = (mb_y << 16) | (mb_x & 0xFFFF);\
-    int sliced_threading = (avctx->active_thread_type == FF_THREAD_SLICE) && (num_jobs > 1);\
-    int is_null          = (next_td == NULL) || (prev_td == NULL);\
-    int pos_check        = (is_null) ? 1 :\
-                            (next_td != td && pos >= next_td->wait_mb_pos) ||\
-                            (prev_td != td && pos >= prev_td->wait_mb_pos);\
-    td->thread_mb_pos = pos;\
-    if (sliced_threading && pos_check) {\
-        pthread_mutex_lock(&td->lock);\
-        pthread_cond_broadcast(&td->cond);\
-        pthread_mutex_unlock(&td->lock);\
-    }\
-    } while(0);
-#else
-#define check_thread_pos(td, otd, mb_x_check, mb_y_check)
-#define update_pos(td, mb_y, mb_x)
-#endif
-
-static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
-                                        int jobnr, int threadnr)
-{
-    VP8Context *s = avctx->priv_data;
-    VP8ThreadData *prev_td, *next_td, *td = &s->thread_data[threadnr];
-    int mb_y = td->thread_mb_pos>>16;
-    int mb_x, mb_xy = mb_y*s->mb_width;
-    int num_jobs = s->num_jobs;
-    VP8Frame *curframe = s->curframe, *prev_frame = s->prev_frame;
-    VP56RangeCoder *c = &s->coeff_partition[mb_y & (s->num_coeff_partitions-1)];
-    VP8Macroblock *mb;
-    uint8_t *dst[3] = {
-        curframe->tf.f->data[0] + 16*mb_y*s->linesize,
-        curframe->tf.f->data[1] +  8*mb_y*s->uvlinesize,
-        curframe->tf.f->data[2] +  8*mb_y*s->uvlinesize
-    };
-    if (mb_y == 0) prev_td = td;
-    else           prev_td = &s->thread_data[(jobnr + num_jobs - 1)%num_jobs];
-    if (mb_y == s->mb_height-1) next_td = td;
-    else                        next_td = &s->thread_data[(jobnr + 1)%num_jobs];
-    if (s->mb_layout == 1)
-        mb = s->macroblocks_base + ((s->mb_width+1)*(mb_y + 1) + 1);
-    else {
-        // Make sure the previous frame has read its segmentation map,
-        // if we re-use the same map.
-        if (prev_frame && s->segmentation.enabled &&
-            !s->segmentation.update_map)
-            ff_thread_await_progress(&prev_frame->tf, mb_y, 0);
-        mb = s->macroblocks + (s->mb_height - mb_y - 1)*2;
-        memset(mb - 1, 0, sizeof(*mb)); // zero left macroblock
-        AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED*0x01010101);
-    }
-
-    memset(td->left_nnz, 0, sizeof(td->left_nnz));
-
-    s->mv_min.x = -MARGIN;
-    s->mv_max.x = ((s->mb_width  - 1) << 6) + MARGIN;
-
-    for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) {
-        // Wait for previous thread to read mb_x+2, and reach mb_y-1.
-        if (prev_td != td) {
-            if (threadnr != 0) {
-                check_thread_pos(td, prev_td, mb_x+1, mb_y-1);
-            } else {
-                check_thread_pos(td, prev_td, (s->mb_width+3) + (mb_x+1), mb_y-1);
-            }
-        }
-
-        s->vdsp.prefetch(dst[0] + (mb_x&3)*4*s->linesize + 64, s->linesize, 4);
-        s->vdsp.prefetch(dst[1] + (mb_x&7)*s->uvlinesize + 64, dst[2] - dst[1], 2);
-
-        if (!s->mb_layout)
-            decode_mb_mode(s, mb, mb_x, mb_y, curframe->seg_map->data + mb_xy,
-                           prev_frame && prev_frame->seg_map ?
-                           prev_frame->seg_map->data + mb_xy : NULL, 0);
-
-        prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_PREVIOUS);
-
-        if (!mb->skip)
-            decode_mb_coeffs(s, td, c, mb, s->top_nnz[mb_x], td->left_nnz);
-
-        if (mb->mode <= MODE_I4x4)
-            intra_predict(s, td, dst, mb, mb_x, mb_y);
-        else
-            inter_predict(s, td, dst, mb, mb_x, mb_y);
-
-        prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_GOLDEN);
-
-        if (!mb->skip) {
-            idct_mb(s, td, dst, mb);
-        } else {
-            AV_ZERO64(td->left_nnz);
-            AV_WN64(s->top_nnz[mb_x], 0);   // array of 9, so unaligned
-
-            // Reset DC block predictors if they would exist if the mb had coefficients
-            if (mb->mode != MODE_I4x4 && mb->mode != VP8_MVMODE_SPLIT) {
-                td->left_nnz[8]     = 0;
-                s->top_nnz[mb_x][8] = 0;
-            }
-        }
-
-        if (s->deblock_filter)
-            filter_level_for_mb(s, mb, &td->filter_strength[mb_x]);
-
-        if (s->deblock_filter && num_jobs != 1 && threadnr == num_jobs-1) {
-            if (s->filter.simple)
-                backup_mb_border(s->top_border[mb_x+1], dst[0], NULL, NULL, s->linesize, 0, 1);
-            else
-                backup_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2], s->linesize, s->uvlinesize, 0);
-        }
-
-        prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_GOLDEN2);
-
-        dst[0] += 16;
-        dst[1] += 8;
-        dst[2] += 8;
-        s->mv_min.x -= 64;
-        s->mv_max.x -= 64;
-
-        if (mb_x == s->mb_width+1) {
-            update_pos(td, mb_y, s->mb_width+3);
-        } else {
-            update_pos(td, mb_y, mb_x);
-        }
-    }
-}
-
-static void vp8_filter_mb_row(AVCodecContext *avctx, void *tdata,
-                              int jobnr, int threadnr)
-{
-    VP8Context *s = avctx->priv_data;
-    VP8ThreadData *td = &s->thread_data[threadnr];
-    int mb_x, mb_y = td->thread_mb_pos>>16, num_jobs = s->num_jobs;
-    AVFrame *curframe = s->curframe->tf.f;
-    VP8Macroblock *mb;
-    VP8ThreadData *prev_td, *next_td;
-    uint8_t *dst[3] = {
-        curframe->data[0] + 16*mb_y*s->linesize,
-        curframe->data[1] +  8*mb_y*s->uvlinesize,
-        curframe->data[2] +  8*mb_y*s->uvlinesize
-    };
-
-    if (s->mb_layout == 1)
-        mb = s->macroblocks_base + ((s->mb_width+1)*(mb_y + 1) + 1);
-    else
-        mb = s->macroblocks + (s->mb_height - mb_y - 1)*2;
-
-    if (mb_y == 0) prev_td = td;
-    else           prev_td = &s->thread_data[(jobnr + num_jobs - 1)%num_jobs];
-    if (mb_y == s->mb_height-1) next_td = td;
-    else                        next_td = &s->thread_data[(jobnr + 1)%num_jobs];
-
-    for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb++) {
-        VP8FilterStrength *f = &td->filter_strength[mb_x];
-        if (prev_td != td) {
-            check_thread_pos(td, prev_td, (mb_x+1) + (s->mb_width+3), mb_y-1);
-        }
-        if (next_td != td)
-            if (next_td != &s->thread_data[0]) {
-                check_thread_pos(td, next_td, mb_x+1, mb_y+1);
-            }
-
-        if (num_jobs == 1) {
-            if (s->filter.simple)
-                backup_mb_border(s->top_border[mb_x+1], dst[0], NULL, NULL, s->linesize, 0, 1);
-            else
-                backup_mb_border(s->top_border[mb_x+1], dst[0], dst[1], dst[2], s->linesize, s->uvlinesize, 0);
-        }
-
-        if (s->filter.simple)
-            filter_mb_simple(s, dst[0], f, mb_x, mb_y);
-        else
-            filter_mb(s, dst, f, mb_x, mb_y);
-        dst[0] += 16;
-        dst[1] += 8;
-        dst[2] += 8;
-
-        update_pos(td, mb_y, (s->mb_width+3) + mb_x);
-    }
-}
-
-static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
-                                    int jobnr, int threadnr)
-{
-    VP8Context *s = avctx->priv_data;
-    VP8ThreadData *td = &s->thread_data[jobnr];
-    VP8ThreadData *next_td = NULL, *prev_td = NULL;
-    VP8Frame *curframe = s->curframe;
-    int mb_y, num_jobs = s->num_jobs;
-    td->thread_nr = threadnr;
-    for (mb_y = jobnr; mb_y < s->mb_height; mb_y += num_jobs) {
-        if (mb_y >= s->mb_height) break;
-        td->thread_mb_pos = mb_y<<16;
-        vp8_decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr);
-        if (s->deblock_filter)
-            vp8_filter_mb_row(avctx, tdata, jobnr, threadnr);
-        update_pos(td, mb_y, INT_MAX & 0xFFFF);
-
-        s->mv_min.y -= 64;
-        s->mv_max.y -= 64;
-
-        if (avctx->active_thread_type == FF_THREAD_FRAME)
-            ff_thread_report_progress(&curframe->tf, mb_y, 0);
-    }
-
-    return 0;
-}
-
-int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    VP8Context *s = avctx->priv_data;
-    int ret, i, referenced, num_jobs;
-    enum AVDiscard skip_thresh;
-    VP8Frame *av_uninit(curframe), *prev_frame;
-
-    if ((ret = decode_frame_header(s, avpkt->data, avpkt->size)) < 0)
-        goto err;
-
-    prev_frame = s->framep[VP56_FRAME_CURRENT];
-
-    referenced = s->update_last || s->update_golden == VP56_FRAME_CURRENT
-                                || s->update_altref == VP56_FRAME_CURRENT;
-
-    skip_thresh = !referenced ? AVDISCARD_NONREF :
-                    !s->keyframe ? AVDISCARD_NONKEY : AVDISCARD_ALL;
-
-    if (avctx->skip_frame >= skip_thresh) {
-        s->invisible = 1;
-        memcpy(&s->next_framep[0], &s->framep[0], sizeof(s->framep[0]) * 4);
-        goto skip_decode;
-    }
-    s->deblock_filter = s->filter.level && avctx->skip_loop_filter < skip_thresh;
-
-    // release no longer referenced frames
-    for (i = 0; i < 5; i++)
-        if (s->frames[i].tf.f->data[0] &&
-            &s->frames[i] != prev_frame &&
-            &s->frames[i] != s->framep[VP56_FRAME_PREVIOUS] &&
-            &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] &&
-            &s->frames[i] != s->framep[VP56_FRAME_GOLDEN2])
-            vp8_release_frame(s, &s->frames[i]);
-
-    // find a free buffer
-    for (i = 0; i < 5; i++)
-        if (&s->frames[i] != prev_frame &&
-            &s->frames[i] != s->framep[VP56_FRAME_PREVIOUS] &&
-            &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] &&
-            &s->frames[i] != s->framep[VP56_FRAME_GOLDEN2]) {
-            curframe = s->framep[VP56_FRAME_CURRENT] = &s->frames[i];
-            break;
-        }
-    if (i == 5) {
-        av_log(avctx, AV_LOG_FATAL, "Ran out of free frames!\n");
-        abort();
-    }
-    if (curframe->tf.f->data[0])
-        vp8_release_frame(s, curframe);
-
-    // Given that arithmetic probabilities are updated every frame, it's quite likely
-    // that the values we have on a random interframe are complete junk if we didn't
-    // start decode on a keyframe. So just don't display anything rather than junk.
-    if (!s->keyframe && (!s->framep[VP56_FRAME_PREVIOUS] ||
-                         !s->framep[VP56_FRAME_GOLDEN] ||
-                         !s->framep[VP56_FRAME_GOLDEN2])) {
-        av_log(avctx, AV_LOG_WARNING, "Discarding interframe without a prior keyframe!\n");
-        ret = AVERROR_INVALIDDATA;
-        goto err;
-    }
-
-    curframe->tf.f->key_frame = s->keyframe;
-    curframe->tf.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
-    if ((ret = vp8_alloc_frame(s, curframe, referenced))) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed!\n");
-        goto err;
-    }
-
-    // check if golden and altref are swapped
-    if (s->update_altref != VP56_FRAME_NONE) {
-        s->next_framep[VP56_FRAME_GOLDEN2]  = s->framep[s->update_altref];
-    } else {
-        s->next_framep[VP56_FRAME_GOLDEN2]  = s->framep[VP56_FRAME_GOLDEN2];
-    }
-    if (s->update_golden != VP56_FRAME_NONE) {
-        s->next_framep[VP56_FRAME_GOLDEN]   = s->framep[s->update_golden];
-    } else {
-        s->next_framep[VP56_FRAME_GOLDEN]   = s->framep[VP56_FRAME_GOLDEN];
-    }
-    if (s->update_last) {
-        s->next_framep[VP56_FRAME_PREVIOUS] = curframe;
-    } else {
-        s->next_framep[VP56_FRAME_PREVIOUS] = s->framep[VP56_FRAME_PREVIOUS];
-    }
-    s->next_framep[VP56_FRAME_CURRENT]      = curframe;
-
-    ff_thread_finish_setup(avctx);
-
-    s->linesize   = curframe->tf.f->linesize[0];
-    s->uvlinesize = curframe->tf.f->linesize[1];
-
-    memset(s->top_nnz, 0, s->mb_width*sizeof(*s->top_nnz));
-    /* Zero macroblock structures for top/top-left prediction from outside the frame. */
-    if (!s->mb_layout)
-        memset(s->macroblocks + s->mb_height*2 - 1, 0, (s->mb_width+1)*sizeof(*s->macroblocks));
-    if (!s->mb_layout && s->keyframe)
-        memset(s->intra4x4_pred_mode_top, DC_PRED, s->mb_width*4);
-
-    memset(s->ref_count, 0, sizeof(s->ref_count));
-
-
-    if (s->mb_layout == 1) {
-        // Make sure the previous frame has read its segmentation map,
-        // if we re-use the same map.
-        if (prev_frame && s->segmentation.enabled &&
-            !s->segmentation.update_map)
-            ff_thread_await_progress(&prev_frame->tf, 1, 0);
-        vp8_decode_mv_mb_modes(avctx, curframe, prev_frame);
-    }
-
-    if (avctx->active_thread_type == FF_THREAD_FRAME)
-        num_jobs = 1;
-    else
-        num_jobs = FFMIN(s->num_coeff_partitions, avctx->thread_count);
-    s->num_jobs   = num_jobs;
-    s->curframe   = curframe;
-    s->prev_frame = prev_frame;
-    s->mv_min.y   = -MARGIN;
-    s->mv_max.y   = ((s->mb_height - 1) << 6) + MARGIN;
-    for (i = 0; i < MAX_THREADS; i++) {
-        s->thread_data[i].thread_mb_pos = 0;
-        s->thread_data[i].wait_mb_pos = INT_MAX;
-    }
-    avctx->execute2(avctx, vp8_decode_mb_row_sliced, s->thread_data, NULL, num_jobs);
-
-    ff_thread_report_progress(&curframe->tf, INT_MAX, 0);
-    memcpy(&s->framep[0], &s->next_framep[0], sizeof(s->framep[0]) * 4);
-
-skip_decode:
-    // if future frames don't use the updated probabilities,
-    // reset them to the values we saved
-    if (!s->update_probabilities)
-        s->prob[0] = s->prob[1];
-
-    if (!s->invisible) {
-        if ((ret = av_frame_ref(data, curframe->tf.f)) < 0)
-            return ret;
-        *got_frame      = 1;
-    }
-
-    return avpkt->size;
-err:
-    memcpy(&s->next_framep[0], &s->framep[0], sizeof(s->framep[0]) * 4);
-    return ret;
-}
-
-av_cold int ff_vp8_decode_free(AVCodecContext *avctx)
-{
-    VP8Context *s = avctx->priv_data;
-    int i;
-
-    vp8_decode_flush_impl(avctx, 1);
-    for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++)
-        av_frame_free(&s->frames[i].tf.f);
-
-    return 0;
-}
-
-static av_cold int vp8_init_frames(VP8Context *s)
-{
-    int i;
-    for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++) {
-        s->frames[i].tf.f = av_frame_alloc();
-        if (!s->frames[i].tf.f)
-            return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-av_cold int ff_vp8_decode_init(AVCodecContext *avctx)
-{
-    VP8Context *s = avctx->priv_data;
-    int ret;
-
-    s->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-    avctx->internal->allocate_progress = 1;
-
-    ff_videodsp_init(&s->vdsp, 8);
-    ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);
-    ff_vp8dsp_init(&s->vp8dsp);
-
-    if ((ret = vp8_init_frames(s)) < 0) {
-        ff_vp8_decode_free(avctx);
-        return ret;
-    }
-
-    return 0;
-}
-
-static av_cold int vp8_decode_init_thread_copy(AVCodecContext *avctx)
-{
-    VP8Context *s = avctx->priv_data;
-    int ret;
-
-    s->avctx = avctx;
-
-    if ((ret = vp8_init_frames(s)) < 0) {
-        ff_vp8_decode_free(avctx);
-        return ret;
-    }
-
-    return 0;
-}
-
-#define REBASE(pic) \
-    pic ? pic - &s_src->frames[0] + &s->frames[0] : NULL
-
-static int vp8_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
-{
-    VP8Context *s = dst->priv_data, *s_src = src->priv_data;
-    int i;
-
-    if (s->macroblocks_base &&
-        (s_src->mb_width != s->mb_width || s_src->mb_height != s->mb_height)) {
-        free_buffers(s);
-        s->mb_width  = s_src->mb_width;
-        s->mb_height = s_src->mb_height;
-    }
-
-    s->prob[0] = s_src->prob[!s_src->update_probabilities];
-    s->segmentation = s_src->segmentation;
-    s->lf_delta = s_src->lf_delta;
-    memcpy(s->sign_bias, s_src->sign_bias, sizeof(s->sign_bias));
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s_src->frames); i++) {
-        if (s_src->frames[i].tf.f->data[0]) {
-            int ret = vp8_ref_frame(s, &s->frames[i], &s_src->frames[i]);
-            if (ret < 0)
-                return ret;
-        }
-    }
-
-    s->framep[0] = REBASE(s_src->next_framep[0]);
-    s->framep[1] = REBASE(s_src->next_framep[1]);
-    s->framep[2] = REBASE(s_src->next_framep[2]);
-    s->framep[3] = REBASE(s_src->next_framep[3]);
-
-    return 0;
-}
-
-AVCodec ff_vp8_decoder = {
-    .name                  = "vp8",
-    .long_name             = NULL_IF_CONFIG_SMALL("On2 VP8"),
-    .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_VP8,
-    .priv_data_size        = sizeof(VP8Context),
-    .init                  = ff_vp8_decode_init,
-    .close                 = ff_vp8_decode_free,
-    .decode                = ff_vp8_decode_frame,
-    .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
-    .flush                 = vp8_decode_flush,
-    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy),
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
-};
diff --git a/deps/libav/libavcodec/vp8.h b/deps/libav/libavcodec/vp8.h
deleted file mode 100644
index 6d864b9..0000000
--- a/deps/libav/libavcodec/vp8.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * VP8 compatible video decoder
- *
- * Copyright (C) 2010 David Conrad
- * Copyright (C) 2010 Ronald S. Bultje
- * Copyright (C) 2010 Jason Garrett-Glaser
- * Copyright (C) 2012 Daniel Kang
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VP8_H
-#define AVCODEC_VP8_H
-
-#include "libavutil/buffer.h"
-
-#include "vp56.h"
-#include "vp8dsp.h"
-#include "h264pred.h"
-#include "thread.h"
-#if HAVE_PTHREADS
-#include <pthread.h>
-#elif HAVE_W32THREADS
-#include "compat/w32pthreads.h"
-#endif
-
-#define VP8_MAX_QUANT 127
-
-enum dct_token {
-    DCT_0,
-    DCT_1,
-    DCT_2,
-    DCT_3,
-    DCT_4,
-    DCT_CAT1,
-    DCT_CAT2,
-    DCT_CAT3,
-    DCT_CAT4,
-    DCT_CAT5,
-    DCT_CAT6,
-    DCT_EOB,
-
-    NUM_DCT_TOKENS
-};
-
-// used to signal 4x4 intra pred in luma MBs
-#define MODE_I4x4 4
-
-enum inter_mvmode {
-    VP8_MVMODE_ZERO = MODE_I4x4 + 1,
-    VP8_MVMODE_MV,
-    VP8_MVMODE_SPLIT
-};
-
-enum inter_splitmvmode {
-    VP8_SPLITMVMODE_16x8 = 0,    ///< 2 16x8 blocks (vertical)
-    VP8_SPLITMVMODE_8x16,        ///< 2 8x16 blocks (horizontal)
-    VP8_SPLITMVMODE_8x8,         ///< 2x2 blocks of 8x8px each
-    VP8_SPLITMVMODE_4x4,         ///< 4x4 blocks of 4x4px each
-    VP8_SPLITMVMODE_NONE,        ///< (only used in prediction) no split MVs
-};
-
-typedef struct VP8FilterStrength {
-    uint8_t filter_level;
-    uint8_t inner_limit;
-    uint8_t inner_filter;
-} VP8FilterStrength;
-
-typedef struct VP8Macroblock {
-    uint8_t skip;
-    // todo: make it possible to check for at least (i4x4 or split_mv)
-    // in one op. are others needed?
-    uint8_t mode;
-    uint8_t ref_frame;
-    uint8_t partitioning;
-    uint8_t chroma_pred_mode;
-    uint8_t segment;
-    uint8_t intra4x4_pred_mode_mb[16];
-    uint8_t intra4x4_pred_mode_top[4];
-    VP56mv mv;
-    VP56mv bmv[16];
-} VP8Macroblock;
-
-typedef struct VP8ThreadData {
-    DECLARE_ALIGNED(16, int16_t, block)[6][4][16];
-    DECLARE_ALIGNED(16, int16_t, block_dc)[16];
-    /**
-     * This is the index plus one of the last non-zero coeff
-     * for each of the blocks in the current macroblock.
-     * So, 0 -> no coeffs
-     *     1 -> dc-only (special transform)
-     *     2+-> full transform
-     */
-    DECLARE_ALIGNED(16, uint8_t, non_zero_count_cache)[6][4];
-    /**
-     * For coeff decode, we need to know whether the above block had non-zero
-     * coefficients. This means for each macroblock, we need data for 4 luma
-     * blocks, 2 u blocks, 2 v blocks, and the luma dc block, for a total of 9
-     * per macroblock. We keep the last row in top_nnz.
-     */
-    DECLARE_ALIGNED(8, uint8_t, left_nnz)[9];
-    int thread_nr;
-#if HAVE_THREADS
-    pthread_mutex_t lock;
-    pthread_cond_t  cond;
-#endif
-    int thread_mb_pos; // (mb_y << 16) | (mb_x & 0xFFFF)
-    int wait_mb_pos; // What the current thread is waiting on.
-
-#define EDGE_EMU_LINESIZE 32
-    DECLARE_ALIGNED(16, uint8_t, edge_emu_buffer)[21 * EDGE_EMU_LINESIZE];
-    VP8FilterStrength *filter_strength;
-} VP8ThreadData;
-
-typedef struct VP8Frame {
-    ThreadFrame tf;
-    AVBufferRef *seg_map;
-} VP8Frame;
-
-#define MAX_THREADS 8
-typedef struct VP8Context {
-    VP8ThreadData *thread_data;
-    AVCodecContext *avctx;
-    VP8Frame *framep[4];
-    VP8Frame *next_framep[4];
-    VP8Frame *curframe;
-    VP8Frame *prev_frame;
-
-    uint16_t mb_width;   /* number of horizontal MB */
-    uint16_t mb_height;  /* number of vertical MB */
-    int linesize;
-    int uvlinesize;
-
-    uint8_t keyframe;
-    uint8_t deblock_filter;
-    uint8_t mbskip_enabled;
-    uint8_t profile;
-    VP56mv mv_min;
-    VP56mv mv_max;
-
-    int8_t sign_bias[4]; ///< one state [0, 1] per ref frame type
-    int ref_count[3];
-
-    /**
-     * Base parameters for segmentation, i.e. per-macroblock parameters.
-     * These must be kept unchanged even if segmentation is not used for
-     * a frame, since the values persist between interframes.
-     */
-    struct {
-        uint8_t enabled;
-        uint8_t absolute_vals;
-        uint8_t update_map;
-        int8_t base_quant[4];
-        int8_t filter_level[4];     ///< base loop filter level
-    } segmentation;
-
-    struct {
-        uint8_t simple;
-        uint8_t level;
-        uint8_t sharpness;
-    } filter;
-
-    VP8Macroblock *macroblocks;
-
-    uint8_t *intra4x4_pred_mode_top;
-    uint8_t intra4x4_pred_mode_left[4];
-
-    /**
-     * Macroblocks can have one of 4 different quants in a frame when
-     * segmentation is enabled.
-     * If segmentation is disabled, only the first segment's values are used.
-     */
-    struct {
-        // [0] - DC qmul  [1] - AC qmul
-        int16_t luma_qmul[2];
-        int16_t luma_dc_qmul[2];    ///< luma dc-only block quant
-        int16_t chroma_qmul[2];
-    } qmat[4];
-
-    struct {
-        uint8_t enabled;    ///< whether each mb can have a different strength based on mode/ref
-
-        /**
-         * filter strength adjustment for the following macroblock modes:
-         * [0-3] - i16x16 (always zero)
-         * [4]   - i4x4
-         * [5]   - zero mv
-         * [6]   - inter modes except for zero or split mv
-         * [7]   - split mv
-         *  i16x16 modes never have any adjustment
-         */
-        int8_t mode[VP8_MVMODE_SPLIT+1];
-
-        /**
-         * filter strength adjustment for macroblocks that reference:
-         * [0] - intra / VP56_FRAME_CURRENT
-         * [1] - VP56_FRAME_PREVIOUS
-         * [2] - VP56_FRAME_GOLDEN
-         * [3] - altref / VP56_FRAME_GOLDEN2
-         */
-        int8_t ref[4];
-    } lf_delta;
-
-    uint8_t (*top_border)[16+8+8];
-    uint8_t (*top_nnz)[9];
-
-    VP56RangeCoder c;   ///< header context, includes mb modes and motion vectors
-
-    /**
-     * These are all of the updatable probabilities for binary decisions.
-     * They are only implictly reset on keyframes, making it quite likely
-     * for an interframe to desync if a prior frame's header was corrupt
-     * or missing outright!
-     */
-    struct {
-        uint8_t segmentid[3];
-        uint8_t mbskip;
-        uint8_t intra;
-        uint8_t last;
-        uint8_t golden;
-        uint8_t pred16x16[4];
-        uint8_t pred8x8c[3];
-        uint8_t token[4][16][3][NUM_DCT_TOKENS-1];
-        uint8_t mvc[2][19];
-    } prob[2];
-
-    VP8Macroblock *macroblocks_base;
-    int invisible;
-    int update_last;    ///< update VP56_FRAME_PREVIOUS with the current one
-    int update_golden;  ///< VP56_FRAME_NONE if not updated, or which frame to copy if so
-    int update_altref;
-
-    /**
-     * If this flag is not set, all the probability updates
-     * are discarded after this frame is decoded.
-     */
-    int update_probabilities;
-
-    /**
-     * All coefficients are contained in separate arith coding contexts.
-     * There can be 1, 2, 4, or 8 of these after the header context.
-     */
-    int num_coeff_partitions;
-    VP56RangeCoder coeff_partition[8];
-    VideoDSPContext vdsp;
-    VP8DSPContext vp8dsp;
-    H264PredContext hpc;
-    vp8_mc_func put_pixels_tab[3][3][3];
-    VP8Frame frames[5];
-
-    int num_jobs;
-    /**
-     * This describes the macroblock memory layout.
-     * 0 -> Only width+height*2+1 macroblocks allocated (frame/single thread).
-     * 1 -> Macroblocks for entire frame alloced (sliced thread).
-     */
-    int mb_layout;
-} VP8Context;
-
-int ff_vp8_decode_init(AVCodecContext *avctx);
-
-int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                        AVPacket *avpkt);
-
-int ff_vp8_decode_free(AVCodecContext *avctx);
-
-#endif /* AVCODEC_VP8_H */
diff --git a/deps/libav/libavcodec/vp8_parser.c b/deps/libav/libavcodec/vp8_parser.c
deleted file mode 100644
index 196de83..0000000
--- a/deps/libav/libavcodec/vp8_parser.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2008 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "parser.h"
-
-static int parse(AVCodecParserContext *s,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
-{
-    s->pict_type= (buf[0]&0x01) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
-
-    *poutbuf = buf;
-    *poutbuf_size = buf_size;
-    return buf_size;
-}
-
-AVCodecParser ff_vp8_parser = {
-    .codec_ids      = { AV_CODEC_ID_VP8 },
-    .parser_parse   = parse,
-};
diff --git a/deps/libav/libavcodec/vp8data.h b/deps/libav/libavcodec/vp8data.h
deleted file mode 100644
index a48b0f6..0000000
--- a/deps/libav/libavcodec/vp8data.h
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- * Copyright (C) 2010 David Conrad
- * Copyright (C) 2010 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP8 compatible video decoder
- */
-
-#ifndef AVCODEC_VP8DATA_H
-#define AVCODEC_VP8DATA_H
-
-#include "vp8.h"
-#include "h264pred.h"
-
-static const uint8_t vp8_pred4x4_mode[] =
-{
-    [DC_PRED8x8]    = DC_PRED,
-    [VERT_PRED8x8]  = VERT_PRED,
-    [HOR_PRED8x8]   = HOR_PRED,
-    [PLANE_PRED8x8] = TM_VP8_PRED,
-};
-
-static const int8_t vp8_pred16x16_tree_intra[4][2] =
-{
-    { -MODE_I4x4, 1 },                      // '0'
-     { 2, 3 },
-      {  -DC_PRED8x8,  -VERT_PRED8x8 },     // '100', '101'
-      { -HOR_PRED8x8, -PLANE_PRED8x8 },     // '110', '111'
-};
-
-static const int8_t vp8_pred16x16_tree_inter[4][2] =
-{
-    { -DC_PRED8x8, 1 },                     // '0'
-     { 2, 3 },
-      {  -VERT_PRED8x8, -HOR_PRED8x8 },     // '100', '101'
-      { -PLANE_PRED8x8, -MODE_I4x4 },       // '110', '111'
-};
-
-static const int vp8_mode_contexts[6][4] = {
-    {   7,   1,   1, 143 },
-    {  14,  18,  14, 107 },
-    { 135,  64,  57,  68 },
-    {  60,  56, 128,  65 },
-    { 159, 134, 128,  34 },
-    { 234, 188, 128,  28 },
-};
-
-static const uint8_t vp8_mbsplits[5][16] = {
-    {  0,  0,  0,  0,  0,  0,  0,  0,
-       1,  1,  1,  1,  1,  1,  1,  1  },
-    {  0,  0,  1,  1,  0,  0,  1,  1,
-       0,  0,  1,  1,  0,  0,  1,  1  },
-    {  0,  0,  1,  1,  0,  0,  1,  1,
-       2,  2,  3,  3,  2,  2,  3,  3  },
-    {  0,  1,  2,  3,  4,  5,  6,  7,
-       8,  9, 10, 11, 12, 13, 14, 15  },
-    {  0,  0,  0,  0,  0,  0,  0,  0,
-       0,  0,  0,  0,  0,  0,  0,  0  }
-};
-
-static const uint8_t vp8_mbfirstidx[4][16] = {
-    {  0,  8 }, {  0,  2 }, {  0,  2,  8,  10 },
-    {  0,  1,  2,  3,  4,  5,  6,  7,
-       8,  9, 10, 11, 12, 13, 14, 15 }
-};
-
-static const uint8_t vp8_mbsplit_count[4] = {   2,   2,   4,  16 };
-static const uint8_t vp8_mbsplit_prob[3]  = { 110, 111, 150 };
-
-static const uint8_t vp8_submv_prob[5][3] = {
-    { 147, 136,  18 },
-    { 106, 145,   1 },
-    { 179, 121,   1 },
-    { 223,   1,  34 },
-    { 208,   1,   1 }
-};
-
-static const uint8_t vp8_pred16x16_prob_intra[4] = { 145, 156, 163, 128 };
-static const uint8_t vp8_pred16x16_prob_inter[4] = { 112,  86, 140,  37 };
-
-static const int8_t vp8_pred4x4_tree[9][2] =
-{
-    { -DC_PRED, 1 },                                    // '0'
-     { -TM_VP8_PRED, 2 },                               // '10'
-      { -VERT_PRED, 3 },                                // '110'
-       { 4, 6 },
-        { -HOR_PRED, 5 },                               // '11100'
-         { -DIAG_DOWN_RIGHT_PRED, -VERT_RIGHT_PRED },   // '111010', '111011'
-        { -DIAG_DOWN_LEFT_PRED, 7 },                    // '11110'
-         { -VERT_LEFT_PRED, 8 },                        // '111110'
-          { -HOR_DOWN_PRED, -HOR_UP_PRED },             // '1111110', '1111111'
-};
-
-static const int8_t vp8_pred8x8c_tree[3][2] =
-{
-    { -DC_PRED8x8, 1 },                 // '0'
-     { -VERT_PRED8x8, 2 },              // '10
-      { -HOR_PRED8x8, -PLANE_PRED8x8 }, // '110', '111'
-};
-
-static const uint8_t vp8_pred8x8c_prob_intra[3] = { 142, 114, 183 };
-static const uint8_t vp8_pred8x8c_prob_inter[3] = { 162, 101, 204 };
-
-static const uint8_t vp8_pred4x4_prob_inter[9] =
-{
-    120, 90, 79, 133, 87, 85, 80, 111, 151
-};
-
-static const uint8_t vp8_pred4x4_prob_intra[10][10][9] =
-{
-    {
-        {  39,  53, 200,  87,  26,  21,  43, 232, 171 },
-        {  56,  34,  51, 104, 114, 102,  29,  93,  77 },
-        {  88,  88, 147, 150,  42,  46,  45, 196, 205 },
-        { 107,  54,  32,  26,  51,   1,  81,  43,  31 },
-        {  39,  28,  85, 171,  58, 165,  90,  98,  64 },
-        {  34,  22, 116, 206,  23,  34,  43, 166,  73 },
-        {  34,  19,  21, 102, 132, 188,  16,  76, 124 },
-        {  68,  25, 106,  22,  64, 171,  36, 225, 114 },
-        {  62,  18,  78,  95,  85,  57,  50,  48,  51 },
-        {  43,  97, 183, 117,  85,  38,  35, 179,  61 },
-    },
-    {
-        { 112, 113,  77,  85, 179, 255,  38, 120, 114 },
-        {  40,  42,   1, 196, 245, 209,  10,  25, 109 },
-        { 193, 101,  35, 159, 215, 111,  89,  46, 111 },
-        { 100,  80,   8,  43, 154,   1,  51,  26,  71 },
-        {  88,  43,  29, 140, 166, 213,  37,  43, 154 },
-        {  61,  63,  30, 155,  67,  45,  68,   1, 209 },
-        {  41,  40,   5, 102, 211, 183,   4,   1, 221 },
-        { 142,  78,  78,  16, 255, 128,  34, 197, 171 },
-        {  51,  50,  17, 168, 209, 192,  23,  25,  82 },
-        {  60, 148,  31, 172, 219, 228,  21,  18, 111 },
-    },
-    {
-        { 175,  69, 143,  80,  85,  82,  72, 155, 103 },
-        {  56,  58,  10, 171, 218, 189,  17,  13, 152 },
-        { 231, 120,  48,  89, 115, 113, 120, 152, 112 },
-        { 144,  71,  10,  38, 171, 213, 144,  34,  26 },
-        { 114,  26,  17, 163,  44, 195,  21,  10, 173 },
-        { 121,  24,  80, 195,  26,  62,  44,  64,  85 },
-        {  63,  20,   8, 114, 114, 208,  12,   9, 226 },
-        { 170,  46,  55,  19, 136, 160,  33, 206,  71 },
-        {  81,  40,  11,  96, 182,  84,  29,  16,  36 },
-        { 152, 179,  64, 126, 170, 118,  46,  70,  95 },
-    },
-    {
-        {  75,  79, 123,  47,  51, 128,  81, 171,   1 },
-        {  57,  17,   5,  71, 102,  57,  53,  41,  49 },
-        { 125,  98,  42,  88, 104,  85, 117, 175,  82 },
-        { 115,  21,   2,  10, 102, 255, 166,  23,   6 },
-        {  38,  33,  13, 121,  57,  73,  26,   1,  85 },
-        {  41,  10,  67, 138,  77, 110,  90,  47, 114 },
-        {  57,  18,  10, 102, 102, 213,  34,  20,  43 },
-        { 101,  29,  16,  10,  85, 128, 101, 196,  26 },
-        { 117,  20,  15,  36, 163, 128,  68,   1,  26 },
-        {  95,  84,  53,  89, 128, 100, 113, 101,  45 },
-    },
-    {
-        {  63,  59,  90, 180,  59, 166,  93,  73, 154 },
-        {  40,  40,  21, 116, 143, 209,  34,  39, 175 },
-        { 138,  31,  36, 171,  27, 166,  38,  44, 229 },
-        {  57,  46,  22,  24, 128,   1,  54,  17,  37 },
-        {  47,  15,  16, 183,  34, 223,  49,  45, 183 },
-        {  46,  17,  33, 183,   6,  98,  15,  32, 183 },
-        {  40,   3,   9, 115,  51, 192,  18,   6, 223 },
-        {  65,  32,  73, 115,  28, 128,  23, 128, 205 },
-        {  87,  37,   9, 115,  59,  77,  64,  21,  47 },
-        {  67,  87,  58, 169,  82, 115,  26,  59, 179 },
-    },
-    {
-        {  54,  57, 112, 184,   5,  41,  38, 166, 213 },
-        {  30,  34,  26, 133, 152, 116,  10,  32, 134 },
-        { 104,  55,  44, 218,   9,  54,  53, 130, 226 },
-        {  75,  32,  12,  51, 192, 255, 160,  43,  51 },
-        {  39,  19,  53, 221,  26, 114,  32,  73, 255 },
-        {  31,   9,  65, 234,   2,  15,   1, 118,  73 },
-        {  56,  21,  23, 111,  59, 205,  45,  37, 192 },
-        {  88,  31,  35,  67, 102,  85,  55, 186,  85 },
-        {  55,  38,  70, 124,  73, 102,   1,  34,  98 },
-        {  64,  90,  70, 205,  40,  41,  23,  26,  57 },
-    },
-    {
-        {  86,  40,  64, 135, 148, 224,  45, 183, 128 },
-        {  22,  26,  17, 131, 240, 154,  14,   1, 209 },
-        { 164,  50,  31, 137, 154, 133,  25,  35, 218 },
-        {  83,  12,  13,  54, 192, 255,  68,  47,  28 },
-        {  45,  16,  21,  91,  64, 222,   7,   1, 197 },
-        {  56,  21,  39, 155,  60, 138,  23, 102, 213 },
-        {  18,  11,   7,  63, 144, 171,   4,   4, 246 },
-        {  85,  26,  85,  85, 128, 128,  32, 146, 171 },
-        {  35,  27,  10, 146, 174, 171,  12,  26, 128 },
-        {  51, 103,  44, 131, 131, 123,  31,   6, 158 },
-    },
-    {
-        {  68,  45, 128,  34,   1,  47,  11, 245, 171 },
-        {  62,  17,  19,  70, 146,  85,  55,  62,  70 },
-        { 102,  61,  71,  37,  34,  53,  31, 243, 192 },
-        {  75,  15,   9,   9,  64, 255, 184, 119,  16 },
-        {  37,  43,  37, 154, 100, 163,  85, 160,   1 },
-        {  63,   9,  92, 136,  28,  64,  32, 201,  85 },
-        {  56,   8,  17, 132, 137, 255,  55, 116, 128 },
-        {  86,   6,  28,   5,  64, 255,  25, 248,   1 },
-        {  58,  15,  20,  82, 135,  57,  26, 121,  40 },
-        {  69,  60,  71,  38,  73, 119,  28, 222,  37 },
-    },
-    {
-        { 101,  75, 128, 139, 118, 146, 116, 128,  85 },
-        {  56,  41,  15, 176, 236,  85,  37,   9,  62 },
-        { 190,  80,  35,  99, 180,  80, 126,  54,  45 },
-        { 146,  36,  19,  30, 171, 255,  97,  27,  20 },
-        {  71,  30,  17, 119, 118, 255,  17,  18, 138 },
-        { 101,  38,  60, 138,  55,  70,  43,  26, 142 },
-        {  32,  41,  20, 117, 151, 142,  20,  21, 163 },
-        { 138,  45,  61,  62, 219,   1,  81, 188,  64 },
-        { 112,  19,  12,  61, 195, 128,  48,   4,  24 },
-        {  85, 126,  47,  87, 176,  51,  41,  20,  32 },
-    },
-    {
-        {  66, 102, 167,  99,  74,  62,  40, 234, 128 },
-        {  41,  53,   9, 178, 241, 141,  26,   8, 107 },
-        { 134, 183,  89, 137,  98, 101, 106, 165, 148 },
-        { 104,  79,  12,  27, 217, 255,  87,  17,   7 },
-        {  74,  43,  26, 146,  73, 166,  49,  23, 157 },
-        {  65,  38, 105, 160,  51,  52,  31, 115, 128 },
-        {  47,  41,  14, 110, 182, 183,  21,  17, 194 },
-        {  87,  68,  71,  44, 114,  51,  15, 186,  23 },
-        {  66,  45,  25, 102, 197, 189,  23,  18,  22 },
-        {  72, 187, 100, 130, 157, 111,  32,  75,  80 },
-    },
-};
-
-static const int8_t vp8_segmentid_tree[][2] =
-{
-    { 1, 2 },
-     { -0, -1 },    // '00', '01'
-     { -2, -3 },    // '10', '11'
-};
-
-static const uint8_t vp8_coeff_band[16] =
-{
-    0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7
-};
-
-/* Inverse of vp8_coeff_band: mappings of bands to coefficient indexes.
- * Each list is -1-terminated. */
-static const int8_t vp8_coeff_band_indexes[8][10] =
-{
-    {0, -1},
-    {1, -1},
-    {2, -1},
-    {3, -1},
-    {5, -1},
-    {6, -1},
-    {4, 7, 8, 9, 10, 11, 12, 13, 14, -1},
-    {15, -1}
-};
-
-static const uint8_t vp8_dct_cat1_prob[] = { 159, 0 };
-static const uint8_t vp8_dct_cat2_prob[] = { 165, 145, 0 };
-static const uint8_t vp8_dct_cat3_prob[] = { 173, 148, 140, 0 };
-static const uint8_t vp8_dct_cat4_prob[] = { 176, 155, 140, 135, 0 };
-static const uint8_t vp8_dct_cat5_prob[] = { 180, 157, 141, 134, 130, 0 };
-static const uint8_t vp8_dct_cat6_prob[] = { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 };
-
-// only used for cat3 and above; cat 1 and 2 are referenced directly
-const uint8_t * const ff_vp8_dct_cat_prob[] =
-{
-    vp8_dct_cat3_prob,
-    vp8_dct_cat4_prob,
-    vp8_dct_cat5_prob,
-    vp8_dct_cat6_prob,
-};
-
-static const uint8_t vp8_token_default_probs[4][8][3][NUM_DCT_TOKENS-1] =
-{
-    {
-        {
-            { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
-        },
-        {
-            { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 },
-            { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 },
-            { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 },
-        },
-        {
-            {   1,  98, 248, 255, 236, 226, 255, 255, 128, 128, 128 },
-            { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 },
-            {  78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 },
-        },
-        {
-            {   1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 },
-            { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 },
-            {  77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 },
-        },
-        {
-            {   1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 },
-            { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 },
-            {  37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 },
-        },
-        {
-            {   1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 },
-            { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 },
-            { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 },
-        },
-        {
-            {   1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 },
-            { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 },
-            {  80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 },
-        },
-        {
-            {   1,   1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 246,   1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
-        },
-    },
-    {
-        {
-            { 198,  35, 237, 223, 193, 187, 162, 160, 145, 155,  62 },
-            { 131,  45, 198, 221, 172, 176, 220, 157, 252, 221,   1 },
-            {  68,  47, 146, 208, 149, 167, 221, 162, 255, 223, 128 },
-        },
-        {
-            {   1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 },
-            { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 },
-            {  81,  99, 181, 242, 176, 190, 249, 202, 255, 255, 128 },
-        },
-        {
-            {   1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 },
-            {  99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 },
-            {  23,  91, 163, 242, 170, 187, 247, 210, 255, 255, 128 },
-        },
-        {
-            {   1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 },
-            { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 },
-            {  44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 },
-        },
-        {
-            {   1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 },
-            {  94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 },
-            {  22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 },
-        },
-        {
-            {   1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 },
-            { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 },
-            {  35,  77, 181, 251, 193, 211, 255, 205, 128, 128, 128 },
-        },
-        {
-            {   1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 },
-            { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 },
-            {  45,  99, 188, 251, 195, 217, 255, 224, 128, 128, 128 },
-        },
-        {
-            {   1,   1, 251, 255, 213, 255, 128, 128, 128, 128, 128 },
-            { 203,   1, 248, 255, 255, 128, 128, 128, 128, 128, 128 },
-            { 137,   1, 177, 255, 224, 255, 128, 128, 128, 128, 128 },
-        },
-    },
-    {
-        {
-            { 253,   9, 248, 251, 207, 208, 255, 192, 128, 128, 128 },
-            { 175,  13, 224, 243, 193, 185, 249, 198, 255, 255, 128 },
-            {  73,  17, 171, 221, 161, 179, 236, 167, 255, 234, 128 },
-        },
-        {
-            {   1,  95, 247, 253, 212, 183, 255, 255, 128, 128, 128 },
-            { 239,  90, 244, 250, 211, 209, 255, 255, 128, 128, 128 },
-            { 155,  77, 195, 248, 188, 195, 255, 255, 128, 128, 128 },
-        },
-        {
-            {   1,  24, 239, 251, 218, 219, 255, 205, 128, 128, 128 },
-            { 201,  51, 219, 255, 196, 186, 128, 128, 128, 128, 128 },
-            {  69,  46, 190, 239, 201, 218, 255, 228, 128, 128, 128 },
-        },
-        {
-            {   1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 },
-            { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 },
-            { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 },
-        },
-        {
-            {   1,  16, 248, 255, 255, 128, 128, 128, 128, 128, 128 },
-            { 190,  36, 230, 255, 236, 255, 128, 128, 128, 128, 128 },
-            { 149,   1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-        },
-        {
-            {   1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-        },
-        {
-            {   1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 },
-            { 213,  62, 250, 255, 255, 128, 128, 128, 128, 128, 128 },
-            {  55,  93, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-        },
-        {
-            { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
-        },
-    },
-    {
-        {
-            { 202,  24, 213, 235, 186, 191, 220, 160, 240, 175, 255 },
-            { 126,  38, 182, 232, 169, 184, 228, 174, 255, 187, 128 },
-            {  61,  46, 138, 219, 151, 178, 240, 170, 255, 216, 128 },
-        },
-        {
-            {   1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 },
-            { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 },
-            {  39,  77, 162, 232, 172, 180, 245, 178, 255, 255, 128 },
-        },
-        {
-            {   1,  52, 220, 246, 198, 199, 249, 220, 255, 255, 128 },
-            { 124,  74, 191, 243, 183, 193, 250, 221, 255, 255, 128 },
-            {  24,  71, 130, 219, 154, 170, 243, 182, 255, 255, 128 },
-        },
-        {
-            {   1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 },
-            { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 },
-            {  28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 },
-        },
-        {
-            {   1,  81, 230, 252, 204, 203, 255, 192, 128, 128, 128 },
-            { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 },
-            {  20,  95, 153, 243, 164, 173, 255, 203, 128, 128, 128 },
-        },
-        {
-            {   1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 },
-            { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 },
-            {  47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 },
-        },
-        {
-            {   1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 },
-            { 141,  84, 213, 252, 201, 202, 255, 219, 128, 128, 128 },
-            {  42,  80, 160, 240, 162, 185, 255, 205, 128, 128, 128 },
-        },
-        {
-            {   1,   1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 244,   1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-            { 238,   1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
-        },
-    },
-};
-
-static const uint8_t vp8_token_update_probs[4][8][3][NUM_DCT_TOKENS-1] =
-{
-    {
-        {
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255 },
-            { 250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255 },
-            { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-    },
-    {
-        {
-            { 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255 },
-            { 234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255 },
-        },
-        {
-            { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-    },
-    {
-        {
-            { 186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255 },
-            { 251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-    },
-    {
-        {
-            { 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255 },
-            { 248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-        {
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-            { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
-        },
-    },
-};
-
-// fixme: copied from h264data.h
-static const uint8_t zigzag_scan[16]={
-    0+0*4, 1+0*4, 0+1*4, 0+2*4,
-    1+1*4, 2+0*4, 3+0*4, 2+1*4,
-    1+2*4, 0+3*4, 1+3*4, 2+2*4,
-    3+1*4, 3+2*4, 2+3*4, 3+3*4,
-};
-
-static const uint8_t vp8_dc_qlookup[VP8_MAX_QUANT+1] =
-{
-      4,   5,   6,   7,   8,   9,  10,  10,  11,  12,  13,  14,  15,  16,  17,  17,
-     18,  19,  20,  20,  21,  21,  22,  22,  23,  23,  24,  25,  25,  26,  27,  28,
-     29,  30,  31,  32,  33,  34,  35,  36,  37,  37,  38,  39,  40,  41,  42,  43,
-     44,  45,  46,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,
-     59,  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,  70,  71,  72,  73,  74,
-     75,  76,  76,  77,  78,  79,  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,
-     91,  93,  95,  96,  98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118,
-    122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157,
-};
-
-static const uint16_t vp8_ac_qlookup[VP8_MAX_QUANT+1] =
-{
-      4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,
-     20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,  32,  33,  34,  35,
-     36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,
-     52,  53,  54,  55,  56,  57,  58,  60,  62,  64,  66,  68,  70,  72,  74,  76,
-     78,  80,  82,  84,  86,  88,  90,  92,  94,  96,  98, 100, 102, 104, 106, 108,
-    110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152,
-    155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209,
-    213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284,
-};
-
-static const uint8_t vp8_mv_update_prob[2][19] = {
-    { 237,
-      246,
-      253, 253, 254, 254, 254, 254, 254,
-      254, 254, 254, 254, 254, 250, 250, 252, 254, 254 },
-    { 231,
-      243,
-      245, 253, 254, 254, 254, 254, 254,
-      254, 254, 254, 254, 254, 251, 251, 254, 254, 254 }
-};
-
-static const uint8_t vp8_mv_default_prob[2][19] = {
-    { 162,
-      128,
-      225, 146, 172, 147, 214, 39, 156,
-      128, 129, 132,  75, 145, 178, 206, 239, 254, 254 },
-    { 164,
-      128,
-      204, 170, 119, 235, 140, 230, 228,
-      128, 130, 130,  74, 148, 180, 203, 236, 254, 254 }
-};
-
-#endif /* AVCODEC_VP8DATA_H */
diff --git a/deps/libav/libavcodec/vp8dsp.c b/deps/libav/libavcodec/vp8dsp.c
deleted file mode 100644
index 0978da5..0000000
--- a/deps/libav/libavcodec/vp8dsp.c
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * Copyright (C) 2010 David Conrad
- * Copyright (C) 2010 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP8 compatible video decoder
- */
-
-#include "dsputil.h"
-#include "vp8dsp.h"
-#include "libavutil/common.h"
-
-// TODO: Maybe add dequant
-static void vp8_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16])
-{
-    int i, t0, t1, t2, t3;
-
-    for (i = 0; i < 4; i++) {
-        t0 = dc[0*4+i] + dc[3*4+i];
-        t1 = dc[1*4+i] + dc[2*4+i];
-        t2 = dc[1*4+i] - dc[2*4+i];
-        t3 = dc[0*4+i] - dc[3*4+i];
-
-        dc[0*4+i] = t0 + t1;
-        dc[1*4+i] = t3 + t2;
-        dc[2*4+i] = t0 - t1;
-        dc[3*4+i] = t3 - t2;
-    }
-
-    for (i = 0; i < 4; i++) {
-        t0 = dc[i*4+0] + dc[i*4+3] + 3; // rounding
-        t1 = dc[i*4+1] + dc[i*4+2];
-        t2 = dc[i*4+1] - dc[i*4+2];
-        t3 = dc[i*4+0] - dc[i*4+3] + 3; // rounding
-        dc[i*4+0] = 0;
-        dc[i*4+1] = 0;
-        dc[i*4+2] = 0;
-        dc[i*4+3] = 0;
-
-        block[i][0][0] = (t0 + t1) >> 3;
-        block[i][1][0] = (t3 + t2) >> 3;
-        block[i][2][0] = (t0 - t1) >> 3;
-        block[i][3][0] = (t3 - t2) >> 3;
-    }
-}
-
-static void vp8_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16])
-{
-    int i, val = (dc[0] + 3) >> 3;
-    dc[0] = 0;
-
-    for (i = 0; i < 4; i++) {
-        block[i][0][0] = val;
-        block[i][1][0] = val;
-        block[i][2][0] = val;
-        block[i][3][0] = val;
-    }
-}
-
-#define MUL_20091(a) ((((a)*20091) >> 16) + (a))
-#define MUL_35468(a)  (((a)*35468) >> 16)
-
-static void vp8_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride)
-{
-    int i, t0, t1, t2, t3;
-    int16_t tmp[16];
-
-    for (i = 0; i < 4; i++) {
-        t0 = block[0*4+i] + block[2*4+i];
-        t1 = block[0*4+i] - block[2*4+i];
-        t2 = MUL_35468(block[1*4+i]) - MUL_20091(block[3*4+i]);
-        t3 = MUL_20091(block[1*4+i]) + MUL_35468(block[3*4+i]);
-        block[0*4+i] = 0;
-        block[1*4+i] = 0;
-        block[2*4+i] = 0;
-        block[3*4+i] = 0;
-
-        tmp[i*4+0] = t0 + t3;
-        tmp[i*4+1] = t1 + t2;
-        tmp[i*4+2] = t1 - t2;
-        tmp[i*4+3] = t0 - t3;
-    }
-
-    for (i = 0; i < 4; i++) {
-        t0 = tmp[0*4+i] + tmp[2*4+i];
-        t1 = tmp[0*4+i] - tmp[2*4+i];
-        t2 = MUL_35468(tmp[1*4+i]) - MUL_20091(tmp[3*4+i]);
-        t3 = MUL_20091(tmp[1*4+i]) + MUL_35468(tmp[3*4+i]);
-
-        dst[0] = av_clip_uint8(dst[0] + ((t0 + t3 + 4) >> 3));
-        dst[1] = av_clip_uint8(dst[1] + ((t1 + t2 + 4) >> 3));
-        dst[2] = av_clip_uint8(dst[2] + ((t1 - t2 + 4) >> 3));
-        dst[3] = av_clip_uint8(dst[3] + ((t0 - t3 + 4) >> 3));
-        dst += stride;
-    }
-}
-
-static void vp8_idct_dc_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride)
-{
-    int i, dc = (block[0] + 4) >> 3;
-    block[0] = 0;
-
-    for (i = 0; i < 4; i++) {
-        dst[0] = av_clip_uint8(dst[0] + dc);
-        dst[1] = av_clip_uint8(dst[1] + dc);
-        dst[2] = av_clip_uint8(dst[2] + dc);
-        dst[3] = av_clip_uint8(dst[3] + dc);
-        dst += stride;
-    }
-}
-
-static void vp8_idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride)
-{
-    vp8_idct_dc_add_c(dst+stride*0+0, block[0], stride);
-    vp8_idct_dc_add_c(dst+stride*0+4, block[1], stride);
-    vp8_idct_dc_add_c(dst+stride*4+0, block[2], stride);
-    vp8_idct_dc_add_c(dst+stride*4+4, block[3], stride);
-}
-
-static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride)
-{
-    vp8_idct_dc_add_c(dst+ 0, block[0], stride);
-    vp8_idct_dc_add_c(dst+ 4, block[1], stride);
-    vp8_idct_dc_add_c(dst+ 8, block[2], stride);
-    vp8_idct_dc_add_c(dst+12, block[3], stride);
-}
-
-// because I like only having two parameters to pass functions...
-#define LOAD_PIXELS\
-    int av_unused p3 = p[-4*stride];\
-    int av_unused p2 = p[-3*stride];\
-    int av_unused p1 = p[-2*stride];\
-    int av_unused p0 = p[-1*stride];\
-    int av_unused q0 = p[ 0*stride];\
-    int av_unused q1 = p[ 1*stride];\
-    int av_unused q2 = p[ 2*stride];\
-    int av_unused q3 = p[ 3*stride];
-
-#define clip_int8(n) (cm[n+0x80]-0x80)
-
-static av_always_inline void filter_common(uint8_t *p, ptrdiff_t stride, int is4tap)
-{
-    LOAD_PIXELS
-    int a, f1, f2;
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
-    a = 3*(q0 - p0);
-
-    if (is4tap)
-        a += clip_int8(p1 - q1);
-
-    a = clip_int8(a);
-
-    // We deviate from the spec here with c(a+3) >> 3
-    // since that's what libvpx does.
-    f1 = FFMIN(a+4, 127) >> 3;
-    f2 = FFMIN(a+3, 127) >> 3;
-
-    // Despite what the spec says, we do need to clamp here to
-    // be bitexact with libvpx.
-    p[-1*stride] = cm[p0 + f2];
-    p[ 0*stride] = cm[q0 - f1];
-
-    // only used for _inner on blocks without high edge variance
-    if (!is4tap) {
-        a = (f1+1)>>1;
-        p[-2*stride] = cm[p1 + a];
-        p[ 1*stride] = cm[q1 - a];
-    }
-}
-
-static av_always_inline int simple_limit(uint8_t *p, ptrdiff_t stride, int flim)
-{
-    LOAD_PIXELS
-    return 2*FFABS(p0-q0) + (FFABS(p1-q1) >> 1) <= flim;
-}
-
-/**
- * E - limit at the macroblock edge
- * I - limit for interior difference
- */
-static av_always_inline int normal_limit(uint8_t *p, ptrdiff_t stride, int E, int I)
-{
-    LOAD_PIXELS
-    return simple_limit(p, stride, E)
-        && FFABS(p3-p2) <= I && FFABS(p2-p1) <= I && FFABS(p1-p0) <= I
-        && FFABS(q3-q2) <= I && FFABS(q2-q1) <= I && FFABS(q1-q0) <= I;
-}
-
-// high edge variance
-static av_always_inline int hev(uint8_t *p, ptrdiff_t stride, int thresh)
-{
-    LOAD_PIXELS
-    return FFABS(p1-p0) > thresh || FFABS(q1-q0) > thresh;
-}
-
-static av_always_inline void filter_mbedge(uint8_t *p, ptrdiff_t stride)
-{
-    int a0, a1, a2, w;
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
-    LOAD_PIXELS
-
-    w = clip_int8(p1-q1);
-    w = clip_int8(w + 3*(q0-p0));
-
-    a0 = (27*w + 63) >> 7;
-    a1 = (18*w + 63) >> 7;
-    a2 = ( 9*w + 63) >> 7;
-
-    p[-3*stride] = cm[p2 + a2];
-    p[-2*stride] = cm[p1 + a1];
-    p[-1*stride] = cm[p0 + a0];
-    p[ 0*stride] = cm[q0 - a0];
-    p[ 1*stride] = cm[q1 - a1];
-    p[ 2*stride] = cm[q2 - a2];
-}
-
-#define LOOP_FILTER(dir, size, stridea, strideb, maybe_inline) \
-static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _c(uint8_t *dst, ptrdiff_t stride,\
-                                     int flim_E, int flim_I, int hev_thresh)\
-{\
-    int i;\
-\
-    for (i = 0; i < size; i++)\
-        if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\
-            if (hev(dst+i*stridea, strideb, hev_thresh))\
-                filter_common(dst+i*stridea, strideb, 1);\
-            else\
-                filter_mbedge(dst+i*stridea, strideb);\
-        }\
-}\
-\
-static maybe_inline void vp8_ ## dir ## _loop_filter ## size ## _inner_c(uint8_t *dst, ptrdiff_t stride,\
-                                      int flim_E, int flim_I, int hev_thresh)\
-{\
-    int i;\
-\
-    for (i = 0; i < size; i++)\
-        if (normal_limit(dst+i*stridea, strideb, flim_E, flim_I)) {\
-            int hv = hev(dst+i*stridea, strideb, hev_thresh);\
-            if (hv) \
-                filter_common(dst+i*stridea, strideb, 1);\
-            else \
-                filter_common(dst+i*stridea, strideb, 0);\
-        }\
-}
-
-LOOP_FILTER(v, 16, 1, stride,)
-LOOP_FILTER(h, 16, stride, 1,)
-
-#define UV_LOOP_FILTER(dir, stridea, strideb) \
-LOOP_FILTER(dir, 8, stridea, strideb, av_always_inline) \
-static void vp8_ ## dir ## _loop_filter8uv_c(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,\
-                                      int fE, int fI, int hev_thresh)\
-{\
-  vp8_ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh);\
-  vp8_ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh);\
-}\
-static void vp8_ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,\
-                                      int fE, int fI, int hev_thresh)\
-{\
-  vp8_ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, hev_thresh);\
-  vp8_ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, hev_thresh);\
-}
-
-UV_LOOP_FILTER(v, 1, stride)
-UV_LOOP_FILTER(h, stride, 1)
-
-static void vp8_v_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, int flim)
-{
-    int i;
-
-    for (i = 0; i < 16; i++)
-        if (simple_limit(dst+i, stride, flim))
-            filter_common(dst+i, stride, 1);
-}
-
-static void vp8_h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, int flim)
-{
-    int i;
-
-    for (i = 0; i < 16; i++)
-        if (simple_limit(dst+i*stride, 1, flim))
-            filter_common(dst+i*stride, 1, 1);
-}
-
-static const uint8_t subpel_filters[7][6] = {
-    { 0,   6, 123,  12,   1,   0 },
-    { 2,  11, 108,  36,   8,   1 },
-    { 0,   9,  93,  50,   6,   0 },
-    { 3,  16,  77,  77,  16,   3 },
-    { 0,   6,  50,  93,   9,   0 },
-    { 1,   8,  36, 108,  11,   2 },
-    { 0,   1,  12, 123,   6,   0 },
-};
-
-#define PUT_PIXELS(WIDTH) \
-static void put_vp8_pixels ## WIDTH ##_c(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, int h, int x, int y) { \
-    int i; \
-    for (i = 0; i < h; i++, dst+= dststride, src+= srcstride) { \
-        memcpy(dst, src, WIDTH); \
-    } \
-}
-
-PUT_PIXELS(16)
-PUT_PIXELS(8)
-PUT_PIXELS(4)
-
-#define FILTER_6TAP(src, F, stride) \
-    cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + F[0]*src[x-2*stride] + \
-        F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + F[5]*src[x+3*stride] + 64) >> 7]
-
-#define FILTER_4TAP(src, F, stride) \
-    cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + \
-        F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + 64) >> 7]
-
-#define VP8_EPEL_H(SIZE, TAPS) \
-static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) \
-{ \
-    const uint8_t *filter = subpel_filters[mx-1]; \
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
-    int x, y; \
-\
-    for (y = 0; y < h; y++) { \
-        for (x = 0; x < SIZE; x++) \
-            dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \
-        dst += dststride; \
-        src += srcstride; \
-    } \
-}
-#define VP8_EPEL_V(SIZE, TAPS) \
-static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) \
-{ \
-    const uint8_t *filter = subpel_filters[my-1]; \
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
-    int x, y; \
-\
-    for (y = 0; y < h; y++) { \
-        for (x = 0; x < SIZE; x++) \
-            dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \
-        dst += dststride; \
-        src += srcstride; \
-    } \
-}
-#define VP8_EPEL_HV(SIZE, HTAPS, VTAPS) \
-static void put_vp8_epel ## SIZE ## _h ## HTAPS ## v ## VTAPS ## _c(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) \
-{ \
-    const uint8_t *filter = subpel_filters[mx-1]; \
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
-    int x, y; \
-    uint8_t tmp_array[(2*SIZE+VTAPS-1)*SIZE]; \
-    uint8_t *tmp = tmp_array; \
-    src -= (2-(VTAPS==4))*srcstride; \
-\
-    for (y = 0; y < h+VTAPS-1; y++) { \
-        for (x = 0; x < SIZE; x++) \
-            tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \
-        tmp += SIZE; \
-        src += srcstride; \
-    } \
-\
-    tmp = tmp_array + (2-(VTAPS==4))*SIZE; \
-    filter = subpel_filters[my-1]; \
-\
-    for (y = 0; y < h; y++) { \
-        for (x = 0; x < SIZE; x++) \
-            dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \
-        dst += dststride; \
-        tmp += SIZE; \
-    } \
-}
-
-VP8_EPEL_H(16, 4)
-VP8_EPEL_H(8,  4)
-VP8_EPEL_H(4,  4)
-VP8_EPEL_H(16, 6)
-VP8_EPEL_H(8,  6)
-VP8_EPEL_H(4,  6)
-VP8_EPEL_V(16, 4)
-VP8_EPEL_V(8,  4)
-VP8_EPEL_V(4,  4)
-VP8_EPEL_V(16, 6)
-VP8_EPEL_V(8,  6)
-VP8_EPEL_V(4,  6)
-VP8_EPEL_HV(16, 4, 4)
-VP8_EPEL_HV(8,  4, 4)
-VP8_EPEL_HV(4,  4, 4)
-VP8_EPEL_HV(16, 4, 6)
-VP8_EPEL_HV(8,  4, 6)
-VP8_EPEL_HV(4,  4, 6)
-VP8_EPEL_HV(16, 6, 4)
-VP8_EPEL_HV(8,  6, 4)
-VP8_EPEL_HV(4,  6, 4)
-VP8_EPEL_HV(16, 6, 6)
-VP8_EPEL_HV(8,  6, 6)
-VP8_EPEL_HV(4,  6, 6)
-
-#define VP8_BILINEAR(SIZE) \
-static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
-{ \
-    int a = 8-mx, b = mx; \
-    int x, y; \
-\
-    for (y = 0; y < h; y++) { \
-        for (x = 0; x < SIZE; x++) \
-            dst[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \
-        dst += dstride; \
-        src += sstride; \
-    } \
-} \
-static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
-{ \
-    int c = 8-my, d = my; \
-    int x, y; \
-\
-    for (y = 0; y < h; y++) { \
-        for (x = 0; x < SIZE; x++) \
-            dst[x] = (c*src[x] + d*src[x+sstride] + 4) >> 3; \
-        dst += dstride; \
-        src += sstride; \
-    } \
-} \
-\
-static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
-{ \
-    int a = 8-mx, b = mx; \
-    int c = 8-my, d = my; \
-    int x, y; \
-    uint8_t tmp_array[(2*SIZE+1)*SIZE]; \
-    uint8_t *tmp = tmp_array; \
-\
-    for (y = 0; y < h+1; y++) { \
-        for (x = 0; x < SIZE; x++) \
-            tmp[x] = (a*src[x] + b*src[x+1] + 4) >> 3; \
-        tmp += SIZE; \
-        src += sstride; \
-    } \
-\
-    tmp = tmp_array; \
-\
-    for (y = 0; y < h; y++) { \
-        for (x = 0; x < SIZE; x++) \
-            dst[x] = (c*tmp[x] + d*tmp[x+SIZE] + 4) >> 3; \
-        dst += dstride; \
-        tmp += SIZE; \
-    } \
-}
-
-VP8_BILINEAR(16)
-VP8_BILINEAR(8)
-VP8_BILINEAR(4)
-
-#define VP8_MC_FUNC(IDX, SIZE) \
-    dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
-    dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \
-    dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \
-    dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \
-    dsp->put_vp8_epel_pixels_tab[IDX][1][1] = put_vp8_epel ## SIZE ## _h4v4_c; \
-    dsp->put_vp8_epel_pixels_tab[IDX][1][2] = put_vp8_epel ## SIZE ## _h6v4_c; \
-    dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \
-    dsp->put_vp8_epel_pixels_tab[IDX][2][1] = put_vp8_epel ## SIZE ## _h4v6_c; \
-    dsp->put_vp8_epel_pixels_tab[IDX][2][2] = put_vp8_epel ## SIZE ## _h6v6_c
-
-#define VP8_BILINEAR_MC_FUNC(IDX, SIZE) \
-    dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
-    dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = put_vp8_bilinear ## SIZE ## _h_c; \
-    dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = put_vp8_bilinear ## SIZE ## _h_c; \
-    dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = put_vp8_bilinear ## SIZE ## _v_c; \
-    dsp->put_vp8_bilinear_pixels_tab[IDX][1][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
-    dsp->put_vp8_bilinear_pixels_tab[IDX][1][2] = put_vp8_bilinear ## SIZE ## _hv_c; \
-    dsp->put_vp8_bilinear_pixels_tab[IDX][2][0] = put_vp8_bilinear ## SIZE ## _v_c; \
-    dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
-    dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = put_vp8_bilinear ## SIZE ## _hv_c
-
-av_cold void ff_vp8dsp_init(VP8DSPContext *dsp)
-{
-    dsp->vp8_luma_dc_wht    = vp8_luma_dc_wht_c;
-    dsp->vp8_luma_dc_wht_dc = vp8_luma_dc_wht_dc_c;
-    dsp->vp8_idct_add       = vp8_idct_add_c;
-    dsp->vp8_idct_dc_add    = vp8_idct_dc_add_c;
-    dsp->vp8_idct_dc_add4y  = vp8_idct_dc_add4y_c;
-    dsp->vp8_idct_dc_add4uv = vp8_idct_dc_add4uv_c;
-
-    dsp->vp8_v_loop_filter16y = vp8_v_loop_filter16_c;
-    dsp->vp8_h_loop_filter16y = vp8_h_loop_filter16_c;
-    dsp->vp8_v_loop_filter8uv = vp8_v_loop_filter8uv_c;
-    dsp->vp8_h_loop_filter8uv = vp8_h_loop_filter8uv_c;
-
-    dsp->vp8_v_loop_filter16y_inner = vp8_v_loop_filter16_inner_c;
-    dsp->vp8_h_loop_filter16y_inner = vp8_h_loop_filter16_inner_c;
-    dsp->vp8_v_loop_filter8uv_inner = vp8_v_loop_filter8uv_inner_c;
-    dsp->vp8_h_loop_filter8uv_inner = vp8_h_loop_filter8uv_inner_c;
-
-    dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c;
-    dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c;
-
-    VP8_MC_FUNC(0, 16);
-    VP8_MC_FUNC(1, 8);
-    VP8_MC_FUNC(2, 4);
-
-    VP8_BILINEAR_MC_FUNC(0, 16);
-    VP8_BILINEAR_MC_FUNC(1, 8);
-    VP8_BILINEAR_MC_FUNC(2, 4);
-
-    if (ARCH_ARM)
-        ff_vp8dsp_init_arm(dsp);
-    if (ARCH_PPC)
-        ff_vp8dsp_init_ppc(dsp);
-    if (ARCH_X86)
-        ff_vp8dsp_init_x86(dsp);
-}
diff --git a/deps/libav/libavcodec/vp8dsp.h b/deps/libav/libavcodec/vp8dsp.h
deleted file mode 100644
index 877e264..0000000
--- a/deps/libav/libavcodec/vp8dsp.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2010 David Conrad
- * Copyright (C) 2010 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VP8 compatible video decoder
- */
-
-#ifndef AVCODEC_VP8DSP_H
-#define AVCODEC_VP8DSP_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-typedef void (*vp8_mc_func)(uint8_t *dst/*align 8*/, ptrdiff_t dstStride,
-                            uint8_t *src/*align 1*/, ptrdiff_t srcStride,
-                            int h, int x, int y);
-
-typedef struct VP8DSPContext {
-    void (*vp8_luma_dc_wht)(int16_t block[4][4][16], int16_t dc[16]);
-    void (*vp8_luma_dc_wht_dc)(int16_t block[4][4][16], int16_t dc[16]);
-    void (*vp8_idct_add)(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
-    void (*vp8_idct_dc_add)(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
-    void (*vp8_idct_dc_add4y)(uint8_t *dst, int16_t block[4][16],
-                              ptrdiff_t stride);
-    void (*vp8_idct_dc_add4uv)(uint8_t *dst, int16_t block[4][16],
-                               ptrdiff_t stride);
-
-    // loop filter applied to edges between macroblocks
-    void (*vp8_v_loop_filter16y)(uint8_t *dst, ptrdiff_t stride,
-                                 int flim_E, int flim_I, int hev_thresh);
-    void (*vp8_h_loop_filter16y)(uint8_t *dst, ptrdiff_t stride,
-                                 int flim_E, int flim_I, int hev_thresh);
-    void (*vp8_v_loop_filter8uv)(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,
-                                 int flim_E, int flim_I, int hev_thresh);
-    void (*vp8_h_loop_filter8uv)(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride,
-                                 int flim_E, int flim_I, int hev_thresh);
-
-    // loop filter applied to inner macroblock edges
-    void (*vp8_v_loop_filter16y_inner)(uint8_t *dst, ptrdiff_t stride,
-                                       int flim_E, int flim_I, int hev_thresh);
-    void (*vp8_h_loop_filter16y_inner)(uint8_t *dst, ptrdiff_t stride,
-                                       int flim_E, int flim_I, int hev_thresh);
-    void (*vp8_v_loop_filter8uv_inner)(uint8_t *dstU, uint8_t *dstV,
-                                       ptrdiff_t stride,
-                                       int flim_E, int flim_I, int hev_thresh);
-    void (*vp8_h_loop_filter8uv_inner)(uint8_t *dstU, uint8_t *dstV,
-                                       ptrdiff_t stride,
-                                       int flim_E, int flim_I, int hev_thresh);
-
-    void (*vp8_v_loop_filter_simple)(uint8_t *dst, ptrdiff_t stride, int flim);
-    void (*vp8_h_loop_filter_simple)(uint8_t *dst, ptrdiff_t stride, int flim);
-
-    /**
-     * first dimension: width>>3, height is assumed equal to width
-     * second dimension: 0 if no vertical interpolation is needed;
-     *                   1 4-tap vertical interpolation filter (my & 1)
-     *                   2 6-tap vertical interpolation filter (!(my & 1))
-     * third dimension: same as second dimension, for horizontal interpolation
-     * so something like put_vp8_epel_pixels_tab[width>>3][2*!!my-(my&1)][2*!!mx-(mx&1)](..., mx, my)
-     */
-    vp8_mc_func put_vp8_epel_pixels_tab[3][3][3];
-    vp8_mc_func put_vp8_bilinear_pixels_tab[3][3][3];
-} VP8DSPContext;
-
-void ff_put_vp8_pixels16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
-                           int h, int x, int y);
-void ff_put_vp8_pixels8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
-                          int h, int x, int y);
-void ff_put_vp8_pixels4_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
-                          int h, int x, int y);
-
-void ff_vp8dsp_init(VP8DSPContext *c);
-void ff_vp8dsp_init_x86(VP8DSPContext *c);
-void ff_vp8dsp_init_arm(VP8DSPContext *c);
-void ff_vp8dsp_init_ppc(VP8DSPContext *c);
-
-#endif /* AVCODEC_VP8DSP_H */
diff --git a/deps/libav/libavcodec/vp9.c b/deps/libav/libavcodec/vp9.c
deleted file mode 100644
index 2a6a138..0000000
--- a/deps/libav/libavcodec/vp9.c
+++ /dev/null
@@ -1,1279 +0,0 @@
-/*
- * VP9 compatible video decoder
- *
- * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
- * Copyright (C) 2013 Clément Bœsch <u pkh me>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avassert.h"
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "videodsp.h"
-#include "vp56.h"
-#include "vp9.h"
-#include "vp9data.h"
-
-#define VP9_SYNCCODE 0x498342
-#define MAX_PROB 255
-
-static void vp9_decode_flush(AVCodecContext *avctx)
-{
-    VP9Context *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->refs); i++)
-        av_frame_unref(s->refs[i]);
-}
-
-static int update_size(AVCodecContext *avctx, int w, int h)
-{
-    VP9Context *s = avctx->priv_data;
-    uint8_t *p;
-
-    if (s->above_partition_ctx && w == avctx->width && h == avctx->height)
-        return 0;
-
-    vp9_decode_flush(avctx);
-
-    if (w <= 0 || h <= 0)
-        return AVERROR_INVALIDDATA;
-
-    avctx->width  = w;
-    avctx->height = h;
-    s->sb_cols    = (w + 63) >> 6;
-    s->sb_rows    = (h + 63) >> 6;
-    s->cols       = (w +  7) >> 3;
-    s->rows       = (h +  7) >> 3;
-
-#define assign(var, type, n) var = (type)p; p += s->sb_cols * n * sizeof(*var)
-    av_free(s->above_partition_ctx);
-    p = av_malloc(s->sb_cols *
-                  (240 + sizeof(*s->lflvl) + 16 * sizeof(*s->above_mv_ctx) +
-                   64 * s->sb_rows * (1 + sizeof(*s->mv[0]) * 2)));
-    if (!p)
-        return AVERROR(ENOMEM);
-    assign(s->above_partition_ctx, uint8_t *,     8);
-    assign(s->above_skip_ctx,      uint8_t *,     8);
-    assign(s->above_txfm_ctx,      uint8_t *,     8);
-    assign(s->above_mode_ctx,      uint8_t *,    16);
-    assign(s->above_y_nnz_ctx,     uint8_t *,    16);
-    assign(s->above_uv_nnz_ctx[0], uint8_t *,     8);
-    assign(s->above_uv_nnz_ctx[1], uint8_t *,     8);
-    assign(s->intra_pred_data[0],  uint8_t *,    64);
-    assign(s->intra_pred_data[1],  uint8_t *,    32);
-    assign(s->intra_pred_data[2],  uint8_t *,    32);
-    assign(s->above_segpred_ctx,   uint8_t *,     8);
-    assign(s->above_intra_ctx,     uint8_t *,     8);
-    assign(s->above_comp_ctx,      uint8_t *,     8);
-    assign(s->above_ref_ctx,       uint8_t *,     8);
-    assign(s->above_filter_ctx,    uint8_t *,     8);
-    assign(s->lflvl,               VP9Filter *,   1);
-    assign(s->above_mv_ctx,        VP56mv(*)[2], 16);
-    assign(s->segmentation_map,    uint8_t *,      64 * s->sb_rows);
-    assign(s->mv[0],               VP9MVRefPair *, 64 * s->sb_rows);
-    assign(s->mv[1],               VP9MVRefPair *, 64 * s->sb_rows);
-#undef assign
-
-    return 0;
-}
-
-// The sign bit is at the end, not the start, of a bit sequence
-static av_always_inline int get_bits_with_sign(GetBitContext *gb, int n)
-{
-    int v = get_bits(gb, n);
-    return get_bits1(gb) ? -v : v;
-}
-
-static av_always_inline int inv_recenter_nonneg(int v, int m)
-{
-    if (v > 2 * m)
-        return v;
-    if (v & 1)
-        return m - ((v + 1) >> 1);
-    return m + (v >> 1);
-}
-
-// differential forward probability updates
-static int update_prob(VP56RangeCoder *c, int p)
-{
-    static const int inv_map_table[MAX_PROB - 1] = {
-          7,  20,  33,  46,  59,  72,  85,  98, 111, 124, 137, 150, 163, 176,
-        189, 202, 215, 228, 241, 254,   1,   2,   3,   4,   5,   6,   8,   9,
-         10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  21,  22,  23,  24,
-         25,  26,  27,  28,  29,  30,  31,  32,  34,  35,  36,  37,  38,  39,
-         40,  41,  42,  43,  44,  45,  47,  48,  49,  50,  51,  52,  53,  54,
-         55,  56,  57,  58,  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,
-         70,  71,  73,  74,  75,  76,  77,  78,  79,  80,  81,  82,  83,  84,
-         86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,  97,  99, 100,
-        101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 112, 113, 114, 115,
-        116, 117, 118, 119, 120, 121, 122, 123, 125, 126, 127, 128, 129, 130,
-        131, 132, 133, 134, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145,
-        146, 147, 148, 149, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160,
-        161, 162, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
-        177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 190, 191,
-        192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 203, 204, 205, 206,
-        207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 218, 219, 220, 221,
-        222, 223, 224, 225, 226, 227, 229, 230, 231, 232, 233, 234, 235, 236,
-        237, 238, 239, 240, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251,
-        252, 253,
-    };
-    int d;
-
-    /* This code is trying to do a differential probability update. For a
-     * current probability A in the range [1, 255], the difference to a new
-     * probability of any value can be expressed differentially as 1-A, 255-A
-     * where some part of this (absolute range) exists both in positive as
-     * well as the negative part, whereas another part only exists in one
-     * half. We're trying to code this shared part differentially, i.e.
-     * times two where the value of the lowest bit specifies the sign, and
-     * the single part is then coded on top of this. This absolute difference
-     * then again has a value of [0, 254], but a bigger value in this range
-     * indicates that we're further away from the original value A, so we
-     * can code this as a VLC code, since higher values are increasingly
-     * unlikely. The first 20 values in inv_map_table[] allow 'cheap, rough'
-     * updates vs. the 'fine, exact' updates further down the range, which
-     * adds one extra dimension to this differential update model. */
-
-    if (!vp8_rac_get(c)) {
-        d = vp8_rac_get_uint(c, 4) + 0;
-    } else if (!vp8_rac_get(c)) {
-        d = vp8_rac_get_uint(c, 4) + 16;
-    } else if (!vp8_rac_get(c)) {
-        d = vp8_rac_get_uint(c, 5) + 32;
-    } else {
-        d = vp8_rac_get_uint(c, 7);
-        if (d >= 65) {
-            d = (d << 1) - 65 + vp8_rac_get(c);
-            d = av_clip(d, 0, MAX_PROB - 65 - 1);
-        }
-        d += 64;
-    }
-
-    return p <= 128
-           ?   1 + inv_recenter_nonneg(inv_map_table[d], p - 1)
-           : 255 - inv_recenter_nonneg(inv_map_table[d], 255 - p);
-}
-
-static int decode_frame_header(AVCodecContext *avctx,
-                               const uint8_t *data, int size, int *ref)
-{
-    VP9Context *s = avctx->priv_data;
-    int c, i, j, k, l, m, n, w, h, max, size2, ret, sharp;
-    int last_invisible;
-    const uint8_t *data2;
-
-    /* general header */
-    if ((ret = init_get_bits8(&s->gb, data, size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to initialize bitstream reader\n");
-        return ret;
-    }
-    if (get_bits(&s->gb, 2) != 0x2) { // frame marker
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame marker\n");
-        return AVERROR_INVALIDDATA;
-    }
-    s->profile = get_bits1(&s->gb);
-    if (get_bits1(&s->gb)) { // reserved bit
-        av_log(avctx, AV_LOG_ERROR, "Reserved bit should be zero\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (get_bits1(&s->gb)) {
-        *ref = get_bits(&s->gb, 3);
-        return 0;
-    }
-
-    s->last_keyframe = s->keyframe;
-    s->keyframe      = !get_bits1(&s->gb);
-
-    last_invisible = s->invisible;
-    s->invisible   = !get_bits1(&s->gb);
-    s->errorres    = get_bits1(&s->gb);
-    // FIXME disable this upon resolution change
-    s->use_last_frame_mvs = !s->errorres && !last_invisible;
-
-    if (s->keyframe) {
-        if (get_bits_long(&s->gb, 24) != VP9_SYNCCODE) { // synccode
-            av_log(avctx, AV_LOG_ERROR, "Invalid sync code\n");
-            return AVERROR_INVALIDDATA;
-        }
-        s->colorspace = get_bits(&s->gb, 3);
-        if (s->colorspace == 7) { // RGB = profile 1
-            av_log(avctx, AV_LOG_ERROR, "RGB not supported in profile 0\n");
-            return AVERROR_INVALIDDATA;
-        }
-        s->fullrange = get_bits1(&s->gb);
-        // for profile 1, here follows the subsampling bits
-        s->refreshrefmask = 0xff;
-        w = get_bits(&s->gb, 16) + 1;
-        h = get_bits(&s->gb, 16) + 1;
-        if (get_bits1(&s->gb)) // display size
-            skip_bits(&s->gb, 32);
-    } else {
-        s->intraonly = s->invisible ? get_bits1(&s->gb) : 0;
-        s->resetctx  = s->errorres ? 0 : get_bits(&s->gb, 2);
-        if (s->intraonly) {
-            if (get_bits_long(&s->gb, 24) != VP9_SYNCCODE) { // synccode
-                av_log(avctx, AV_LOG_ERROR, "Invalid sync code\n");
-                return AVERROR_INVALIDDATA;
-            }
-            s->refreshrefmask = get_bits(&s->gb, 8);
-            w = get_bits(&s->gb, 16) + 1;
-            h = get_bits(&s->gb, 16) + 1;
-            if (get_bits1(&s->gb)) // display size
-                skip_bits(&s->gb, 32);
-        } else {
-            s->refreshrefmask = get_bits(&s->gb, 8);
-            s->refidx[0]      = get_bits(&s->gb, 3);
-            s->signbias[0]    = get_bits1(&s->gb);
-            s->refidx[1]      = get_bits(&s->gb, 3);
-            s->signbias[1]    = get_bits1(&s->gb);
-            s->refidx[2]      = get_bits(&s->gb, 3);
-            s->signbias[2]    = get_bits1(&s->gb);
-            if (!s->refs[s->refidx[0]]->buf[0] ||
-                !s->refs[s->refidx[1]]->buf[0] ||
-                !s->refs[s->refidx[2]]->buf[0]) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Not all references are available\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (get_bits1(&s->gb)) {
-                w = s->refs[s->refidx[0]]->width;
-                h = s->refs[s->refidx[0]]->height;
-            } else if (get_bits1(&s->gb)) {
-                w = s->refs[s->refidx[1]]->width;
-                h = s->refs[s->refidx[1]]->height;
-            } else if (get_bits1(&s->gb)) {
-                w = s->refs[s->refidx[2]]->width;
-                h = s->refs[s->refidx[2]]->height;
-            } else {
-                w = get_bits(&s->gb, 16) + 1;
-                h = get_bits(&s->gb, 16) + 1;
-            }
-            if (get_bits1(&s->gb)) // display size
-                skip_bits(&s->gb, 32);
-            s->highprecisionmvs = get_bits1(&s->gb);
-            s->filtermode       = get_bits1(&s->gb) ? FILTER_SWITCHABLE :
-                                  get_bits(&s->gb, 2);
-            s->allowcompinter   = s->signbias[0] != s->signbias[1] ||
-                                  s->signbias[0] != s->signbias[2];
-            if (s->allowcompinter) {
-                if (s->signbias[0] == s->signbias[1]) {
-                    s->fixcompref    = 2;
-                    s->varcompref[0] = 0;
-                    s->varcompref[1] = 1;
-                } else if (s->signbias[0] == s->signbias[2]) {
-                    s->fixcompref    = 1;
-                    s->varcompref[0] = 0;
-                    s->varcompref[1] = 2;
-                } else {
-                    s->fixcompref    = 0;
-                    s->varcompref[0] = 1;
-                    s->varcompref[1] = 2;
-                }
-            }
-        }
-    }
-
-    s->refreshctx   = s->errorres ? 0 : get_bits1(&s->gb);
-    s->parallelmode = s->errorres ? 1 : get_bits1(&s->gb);
-    s->framectxid   = c = get_bits(&s->gb, 2);
-
-    /* loopfilter header data */
-    s->filter.level = get_bits(&s->gb, 6);
-    sharp           = get_bits(&s->gb, 3);
-    /* If sharpness changed, reinit lim/mblim LUTs. if it didn't change,
-     * keep the old cache values since they are still valid. */
-    if (s->filter.sharpness != sharp)
-        memset(s->filter.lim_lut, 0, sizeof(s->filter.lim_lut));
-    s->filter.sharpness = sharp;
-    if ((s->lf_delta.enabled = get_bits1(&s->gb))) {
-        if (get_bits1(&s->gb)) {
-            for (i = 0; i < 4; i++)
-                if (get_bits1(&s->gb))
-                    s->lf_delta.ref[i] = get_bits_with_sign(&s->gb, 6);
-            for (i = 0; i < 2; i++)
-                if (get_bits1(&s->gb))
-                    s->lf_delta.mode[i] = get_bits_with_sign(&s->gb, 6);
-        }
-    } else {
-        memset(&s->lf_delta, 0, sizeof(s->lf_delta));
-    }
-
-    /* quantization header data */
-    s->yac_qi      = get_bits(&s->gb, 8);
-    s->ydc_qdelta  = get_bits1(&s->gb) ? get_bits_with_sign(&s->gb, 4) : 0;
-    s->uvdc_qdelta = get_bits1(&s->gb) ? get_bits_with_sign(&s->gb, 4) : 0;
-    s->uvac_qdelta = get_bits1(&s->gb) ? get_bits_with_sign(&s->gb, 4) : 0;
-    s->lossless    = s->yac_qi == 0 && s->ydc_qdelta == 0 &&
-                     s->uvdc_qdelta == 0 && s->uvac_qdelta == 0;
-
-    /* segmentation header info */
-    if ((s->segmentation.enabled = get_bits1(&s->gb))) {
-        if ((s->segmentation.update_map = get_bits1(&s->gb))) {
-            for (i = 0; i < 7; i++)
-                s->prob.seg[i] = get_bits1(&s->gb) ?
-                                 get_bits(&s->gb, 8) : 255;
-            if ((s->segmentation.temporal = get_bits1(&s->gb)))
-                for (i = 0; i < 3; i++)
-                    s->prob.segpred[i] = get_bits1(&s->gb) ?
-                                         get_bits(&s->gb, 8) : 255;
-        }
-
-        if (get_bits1(&s->gb)) {
-            s->segmentation.absolute_vals = get_bits1(&s->gb);
-            for (i = 0; i < 8; i++) {
-                if ((s->segmentation.feat[i].q_enabled = get_bits1(&s->gb)))
-                    s->segmentation.feat[i].q_val = get_bits_with_sign(&s->gb, 8);
-                if ((s->segmentation.feat[i].lf_enabled = get_bits1(&s->gb)))
-                    s->segmentation.feat[i].lf_val = get_bits_with_sign(&s->gb, 6);
-                if ((s->segmentation.feat[i].ref_enabled = get_bits1(&s->gb)))
-                    s->segmentation.feat[i].ref_val = get_bits(&s->gb, 2);
-                s->segmentation.feat[i].skip_enabled = get_bits1(&s->gb);
-            }
-        }
-    } else {
-        s->segmentation.feat[0].q_enabled    = 0;
-        s->segmentation.feat[0].lf_enabled   = 0;
-        s->segmentation.feat[0].skip_enabled = 0;
-        s->segmentation.feat[0].ref_enabled  = 0;
-    }
-
-    // set qmul[] based on Y/UV, AC/DC and segmentation Q idx deltas
-    for (i = 0; i < (s->segmentation.enabled ? 8 : 1); i++) {
-        int qyac, qydc, quvac, quvdc, lflvl, sh;
-
-        if (s->segmentation.feat[i].q_enabled) {
-            if (s->segmentation.absolute_vals)
-                qyac = s->segmentation.feat[i].q_val;
-            else
-                qyac = s->yac_qi + s->segmentation.feat[i].q_val;
-        } else {
-            qyac = s->yac_qi;
-        }
-        qydc  = av_clip_uintp2(qyac + s->ydc_qdelta, 8);
-        quvdc = av_clip_uintp2(qyac + s->uvdc_qdelta, 8);
-        quvac = av_clip_uintp2(qyac + s->uvac_qdelta, 8);
-        qyac  = av_clip_uintp2(qyac, 8);
-
-        s->segmentation.feat[i].qmul[0][0] = ff_vp9_dc_qlookup[qydc];
-        s->segmentation.feat[i].qmul[0][1] = ff_vp9_ac_qlookup[qyac];
-        s->segmentation.feat[i].qmul[1][0] = ff_vp9_dc_qlookup[quvdc];
-        s->segmentation.feat[i].qmul[1][1] = ff_vp9_ac_qlookup[quvac];
-
-        sh = s->filter.level >= 32;
-        if (s->segmentation.feat[i].lf_enabled) {
-            if (s->segmentation.absolute_vals)
-                lflvl = s->segmentation.feat[i].lf_val;
-            else
-                lflvl = s->filter.level + s->segmentation.feat[i].lf_val;
-        } else {
-            lflvl = s->filter.level;
-        }
-        s->segmentation.feat[i].lflvl[0][0] =
-        s->segmentation.feat[i].lflvl[0][1] =
-            av_clip_uintp2(lflvl + (s->lf_delta.ref[0] << sh), 6);
-        for (j = 1; j < 4; j++) {
-            s->segmentation.feat[i].lflvl[j][0] =
-                av_clip_uintp2(lflvl + ((s->lf_delta.ref[j] +
-                                         s->lf_delta.mode[0]) << sh), 6);
-            s->segmentation.feat[i].lflvl[j][1] =
-                av_clip_uintp2(lflvl + ((s->lf_delta.ref[j] +
-                                         s->lf_delta.mode[1]) << sh), 6);
-        }
-    }
-
-    /* tiling info */
-    if ((ret = update_size(avctx, w, h)) < 0) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Failed to initialize decoder for %dx%d\n", w, h);
-        return ret;
-    }
-    for (s->tiling.log2_tile_cols = 0;
-         (s->sb_cols >> s->tiling.log2_tile_cols) > 64;
-         s->tiling.log2_tile_cols++) ;
-    for (max = 0; (s->sb_cols >> max) >= 4; max++) ;
-    max = FFMAX(0, max - 1);
-    while (max > s->tiling.log2_tile_cols) {
-        if (get_bits1(&s->gb))
-            s->tiling.log2_tile_cols++;
-        else
-            break;
-    }
-    s->tiling.log2_tile_rows = decode012(&s->gb);
-    s->tiling.tile_rows      = 1 << s->tiling.log2_tile_rows;
-    if (s->tiling.tile_cols != (1 << s->tiling.log2_tile_cols)) {
-        s->tiling.tile_cols = 1 << s->tiling.log2_tile_cols;
-        s->c_b              = av_fast_realloc(s->c_b, &s->c_b_size,
-                                              sizeof(VP56RangeCoder) *
-                                              s->tiling.tile_cols);
-        if (!s->c_b) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Ran out of memory during range coder init\n");
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    if (s->keyframe || s->errorres || s->intraonly) {
-        s->prob_ctx[0].p =
-        s->prob_ctx[1].p =
-        s->prob_ctx[2].p =
-        s->prob_ctx[3].p = ff_vp9_default_probs;
-        memcpy(s->prob_ctx[0].coef, ff_vp9_default_coef_probs,
-               sizeof(ff_vp9_default_coef_probs));
-        memcpy(s->prob_ctx[1].coef, ff_vp9_default_coef_probs,
-               sizeof(ff_vp9_default_coef_probs));
-        memcpy(s->prob_ctx[2].coef, ff_vp9_default_coef_probs,
-               sizeof(ff_vp9_default_coef_probs));
-        memcpy(s->prob_ctx[3].coef, ff_vp9_default_coef_probs,
-               sizeof(ff_vp9_default_coef_probs));
-    }
-
-    // next 16 bits is size of the rest of the header (arith-coded)
-    size2 = get_bits(&s->gb, 16);
-    data2 = align_get_bits(&s->gb);
-    if (size2 > size - (data2 - data)) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid compressed header size\n");
-        return AVERROR_INVALIDDATA;
-    }
-    ff_vp56_init_range_decoder(&s->c, data2, size2);
-    if (vp56_rac_get_prob_branchy(&s->c, 128)) { // marker bit
-        av_log(avctx, AV_LOG_ERROR, "Marker bit was set\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->keyframe || s->intraonly)
-        memset(s->counts.coef, 0,
-               sizeof(s->counts.coef) + sizeof(s->counts.eob));
-    else
-        memset(&s->counts, 0, sizeof(s->counts));
-
-    /* FIXME is it faster to not copy here, but do it down in the fw updates
-     * as explicit copies if the fw update is missing (and skip the copy upon
-     * fw update)? */
-    s->prob.p = s->prob_ctx[c].p;
-
-    // txfm updates
-    if (s->lossless) {
-        s->txfmmode = TX_4X4;
-    } else {
-        s->txfmmode = vp8_rac_get_uint(&s->c, 2);
-        if (s->txfmmode == 3)
-            s->txfmmode += vp8_rac_get(&s->c);
-
-        if (s->txfmmode == TX_SWITCHABLE) {
-            for (i = 0; i < 2; i++)
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.tx8p[i] = update_prob(&s->c, s->prob.p.tx8p[i]);
-            for (i = 0; i < 2; i++)
-                for (j = 0; j < 2; j++)
-                    if (vp56_rac_get_prob_branchy(&s->c, 252))
-                        s->prob.p.tx16p[i][j] =
-                            update_prob(&s->c, s->prob.p.tx16p[i][j]);
-            for (i = 0; i < 2; i++)
-                for (j = 0; j < 3; j++)
-                    if (vp56_rac_get_prob_branchy(&s->c, 252))
-                        s->prob.p.tx32p[i][j] =
-                            update_prob(&s->c, s->prob.p.tx32p[i][j]);
-        }
-    }
-
-    // coef updates
-    for (i = 0; i < 4; i++) {
-        uint8_t (*ref)[2][6][6][3] = s->prob_ctx[c].coef[i];
-        if (vp8_rac_get(&s->c)) {
-            for (j = 0; j < 2; j++)
-                for (k = 0; k < 2; k++)
-                    for (l = 0; l < 6; l++)
-                        for (m = 0; m < 6; m++) {
-                            uint8_t *p = s->prob.coef[i][j][k][l][m];
-                            uint8_t *r = ref[j][k][l][m];
-                            if (m >= 3 && l == 0) // dc only has 3 pt
-                                break;
-                            for (n = 0; n < 3; n++) {
-                                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                                    p[n] = update_prob(&s->c, r[n]);
-                                else
-                                    p[n] = r[n];
-                            }
-                            p[3] = 0;
-                        }
-        } else {
-            for (j = 0; j < 2; j++)
-                for (k = 0; k < 2; k++)
-                    for (l = 0; l < 6; l++)
-                        for (m = 0; m < 6; m++) {
-                            uint8_t *p = s->prob.coef[i][j][k][l][m];
-                            uint8_t *r = ref[j][k][l][m];
-                            if (m > 3 && l == 0) // dc only has 3 pt
-                                break;
-                            memcpy(p, r, 3);
-                            p[3] = 0;
-                        }
-        }
-        if (s->txfmmode == i)
-            break;
-    }
-
-    // mode updates
-    for (i = 0; i < 3; i++)
-        if (vp56_rac_get_prob_branchy(&s->c, 252))
-            s->prob.p.skip[i] = update_prob(&s->c, s->prob.p.skip[i]);
-    if (!s->keyframe && !s->intraonly) {
-        for (i = 0; i < 7; i++)
-            for (j = 0; j < 3; j++)
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.mv_mode[i][j] =
-                        update_prob(&s->c, s->prob.p.mv_mode[i][j]);
-
-        if (s->filtermode == FILTER_SWITCHABLE)
-            for (i = 0; i < 4; i++)
-                for (j = 0; j < 2; j++)
-                    if (vp56_rac_get_prob_branchy(&s->c, 252))
-                        s->prob.p.filter[i][j] =
-                            update_prob(&s->c, s->prob.p.filter[i][j]);
-
-        for (i = 0; i < 4; i++)
-            if (vp56_rac_get_prob_branchy(&s->c, 252))
-                s->prob.p.intra[i] = update_prob(&s->c, s->prob.p.intra[i]);
-
-        if (s->allowcompinter) {
-            s->comppredmode = vp8_rac_get(&s->c);
-            if (s->comppredmode)
-                s->comppredmode += vp8_rac_get(&s->c);
-            if (s->comppredmode == PRED_SWITCHABLE)
-                for (i = 0; i < 5; i++)
-                    if (vp56_rac_get_prob_branchy(&s->c, 252))
-                        s->prob.p.comp[i] =
-                            update_prob(&s->c, s->prob.p.comp[i]);
-        } else {
-            s->comppredmode = PRED_SINGLEREF;
-        }
-
-        if (s->comppredmode != PRED_COMPREF) {
-            for (i = 0; i < 5; i++) {
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.single_ref[i][0] =
-                        update_prob(&s->c, s->prob.p.single_ref[i][0]);
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.single_ref[i][1] =
-                        update_prob(&s->c, s->prob.p.single_ref[i][1]);
-            }
-        }
-
-        if (s->comppredmode != PRED_SINGLEREF) {
-            for (i = 0; i < 5; i++)
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.comp_ref[i] =
-                        update_prob(&s->c, s->prob.p.comp_ref[i]);
-        }
-
-        for (i = 0; i < 4; i++)
-            for (j = 0; j < 9; j++)
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.y_mode[i][j] =
-                        update_prob(&s->c, s->prob.p.y_mode[i][j]);
-
-        for (i = 0; i < 4; i++)
-            for (j = 0; j < 4; j++)
-                for (k = 0; k < 3; k++)
-                    if (vp56_rac_get_prob_branchy(&s->c, 252))
-                        s->prob.p.partition[3 - i][j][k] =
-                            update_prob(&s->c,
-                                        s->prob.p.partition[3 - i][j][k]);
-
-        // mv fields don't use the update_prob subexp model for some reason
-        for (i = 0; i < 3; i++)
-            if (vp56_rac_get_prob_branchy(&s->c, 252))
-                s->prob.p.mv_joint[i] = (vp8_rac_get_uint(&s->c, 7) << 1) | 1;
-
-        for (i = 0; i < 2; i++) {
-            if (vp56_rac_get_prob_branchy(&s->c, 252))
-                s->prob.p.mv_comp[i].sign =
-                    (vp8_rac_get_uint(&s->c, 7) << 1) | 1;
-
-            for (j = 0; j < 10; j++)
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.mv_comp[i].classes[j] =
-                        (vp8_rac_get_uint(&s->c, 7) << 1) | 1;
-
-            if (vp56_rac_get_prob_branchy(&s->c, 252))
-                s->prob.p.mv_comp[i].class0 =
-                    (vp8_rac_get_uint(&s->c, 7) << 1) | 1;
-
-            for (j = 0; j < 10; j++)
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.mv_comp[i].bits[j] =
-                        (vp8_rac_get_uint(&s->c, 7) << 1) | 1;
-        }
-
-        for (i = 0; i < 2; i++) {
-            for (j = 0; j < 2; j++)
-                for (k = 0; k < 3; k++)
-                    if (vp56_rac_get_prob_branchy(&s->c, 252))
-                        s->prob.p.mv_comp[i].class0_fp[j][k] =
-                            (vp8_rac_get_uint(&s->c, 7) << 1) | 1;
-
-            for (j = 0; j < 3; j++)
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.mv_comp[i].fp[j] =
-                        (vp8_rac_get_uint(&s->c, 7) << 1) | 1;
-        }
-
-        if (s->highprecisionmvs) {
-            for (i = 0; i < 2; i++) {
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.mv_comp[i].class0_hp =
-                        (vp8_rac_get_uint(&s->c, 7) << 1) | 1;
-
-                if (vp56_rac_get_prob_branchy(&s->c, 252))
-                    s->prob.p.mv_comp[i].hp =
-                        (vp8_rac_get_uint(&s->c, 7) << 1) | 1;
-            }
-        }
-    }
-
-    return (data2 - data) + size2;
-}
-
-static int decode_subblock(AVCodecContext *avctx, int row, int col,
-                           VP9Filter *lflvl,
-                           ptrdiff_t yoff, ptrdiff_t uvoff, enum BlockLevel bl)
-{
-    VP9Context *s = avctx->priv_data;
-    int c = ((s->above_partition_ctx[col]       >> (3 - bl)) & 1) |
-            (((s->left_partition_ctx[row & 0x7] >> (3 - bl)) & 1) << 1);
-    int ret;
-    const uint8_t *p = s->keyframe ? ff_vp9_default_kf_partition_probs[bl][c]
-                                   : s->prob.p.partition[bl][c];
-    enum BlockPartition bp;
-    ptrdiff_t hbs = 4 >> bl;
-
-    if (bl == BL_8X8) {
-        bp  = vp8_rac_get_tree(&s->c, ff_vp9_partition_tree, p);
-        ret = ff_vp9_decode_block(avctx, row, col, lflvl, yoff, uvoff, bl, bp);
-    } else if (col + hbs < s->cols) {
-        if (row + hbs < s->rows) {
-            bp = vp8_rac_get_tree(&s->c, ff_vp9_partition_tree, p);
-            switch (bp) {
-            case PARTITION_NONE:
-                ret = ff_vp9_decode_block(avctx, row, col, lflvl, yoff, uvoff,
-                                          bl, bp);
-                break;
-            case PARTITION_H:
-                ret = ff_vp9_decode_block(avctx, row, col, lflvl, yoff, uvoff,
-                                          bl, bp);
-                if (!ret) {
-                    yoff  += hbs * 8 * s->cur_frame->linesize[0];
-                    uvoff += hbs * 4 * s->cur_frame->linesize[1];
-                    ret    = ff_vp9_decode_block(avctx, row + hbs, col, lflvl,
-                                                 yoff, uvoff, bl, bp);
-                }
-                break;
-            case PARTITION_V:
-                ret = ff_vp9_decode_block(avctx, row, col, lflvl, yoff, uvoff,
-                                          bl, bp);
-                if (!ret) {
-                    yoff  += hbs * 8;
-                    uvoff += hbs * 4;
-                    ret    = ff_vp9_decode_block(avctx, row, col + hbs, lflvl,
-                                                 yoff, uvoff, bl, bp);
-                }
-                break;
-            case PARTITION_SPLIT:
-                ret = decode_subblock(avctx, row, col, lflvl,
-                                      yoff, uvoff, bl + 1);
-                if (!ret) {
-                    ret = decode_subblock(avctx, row, col + hbs, lflvl,
-                                          yoff + 8 * hbs, uvoff + 4 * hbs,
-                                          bl + 1);
-                    if (!ret) {
-                        yoff  += hbs * 8 * s->cur_frame->linesize[0];
-                        uvoff += hbs * 4 * s->cur_frame->linesize[1];
-                        ret    = decode_subblock(avctx, row + hbs, col, lflvl,
-                                                 yoff, uvoff, bl + 1);
-                        if (!ret) {
-                            ret = decode_subblock(avctx, row + hbs, col + hbs,
-                                                  lflvl, yoff + 8 * hbs,
-                                                  uvoff + 4 * hbs, bl + 1);
-                        }
-                    }
-                }
-                break;
-            default:
-                av_log(avctx, AV_LOG_ERROR, "Unexpected partition %d.", bp);
-                return AVERROR_INVALIDDATA;
-            }
-        } else if (vp56_rac_get_prob_branchy(&s->c, p[1])) {
-            bp  = PARTITION_SPLIT;
-            ret = decode_subblock(avctx, row, col, lflvl, yoff, uvoff, bl + 1);
-            if (!ret)
-                ret = decode_subblock(avctx, row, col + hbs, lflvl,
-                                      yoff + 8 * hbs, uvoff + 4 * hbs, bl + 1);
-        } else {
-            bp  = PARTITION_H;
-            ret = ff_vp9_decode_block(avctx, row, col, lflvl, yoff, uvoff,
-                                      bl, bp);
-        }
-    } else if (row + hbs < s->rows) {
-        if (vp56_rac_get_prob_branchy(&s->c, p[2])) {
-            bp  = PARTITION_SPLIT;
-            ret = decode_subblock(avctx, row, col, lflvl, yoff, uvoff, bl + 1);
-            if (!ret) {
-                yoff  += hbs * 8 * s->cur_frame->linesize[0];
-                uvoff += hbs * 4 * s->cur_frame->linesize[1];
-                ret    = decode_subblock(avctx, row + hbs, col, lflvl,
-                                         yoff, uvoff, bl + 1);
-            }
-        } else {
-            bp  = PARTITION_V;
-            ret = ff_vp9_decode_block(avctx, row, col, lflvl, yoff, uvoff,
-                                      bl, bp);
-        }
-    } else {
-        bp  = PARTITION_SPLIT;
-        ret = decode_subblock(avctx, row, col, lflvl, yoff, uvoff, bl + 1);
-    }
-    s->counts.partition[bl][c][bp]++;
-
-    return ret;
-}
-
-static void loopfilter_subblock(AVCodecContext *avctx, VP9Filter *lflvl,
-                                int row, int col,
-                                ptrdiff_t yoff, ptrdiff_t uvoff)
-{
-    VP9Context *s = avctx->priv_data;
-    uint8_t *dst   = s->cur_frame->data[0] + yoff, *lvl = lflvl->level;
-    ptrdiff_t ls_y = s->cur_frame->linesize[0], ls_uv = s->cur_frame->linesize[1];
-    int y, x, p;
-
-    /* FIXME: In how far can we interleave the v/h loopfilter calls? E.g.
-     * if you think of them as acting on a 8x8 block max, we can interleave
-     * each v/h within the single x loop, but that only works if we work on
-     * 8 pixel blocks, and we won't always do that (we want at least 16px
-     * to use SSE2 optimizations, perhaps 32 for AVX2). */
-
-    // filter edges between columns, Y plane (e.g. block1 | block2)
-    for (y = 0; y < 8; y += 2, dst += 16 * ls_y, lvl += 16) {
-        uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[0][0][y];
-        uint8_t *hmask2 = lflvl->mask[0][0][y + 1];
-        unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2], hm13 = hmask1[3];
-        unsigned hm2 = hmask2[1] | hmask2[2], hm23 = hmask2[3];
-        unsigned hm  = hm1 | hm2 | hm13 | hm23;
-
-        for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 8, l++) {
-            if (hm1 & x) {
-                int L = *l, H = L >> 4;
-                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
-
-                if (col || x > 1) {
-                    if (hmask1[0] & x) {
-                        if (hmask2[0] & x) {
-                            av_assert2(l[8] == L);
-                            s->dsp.loop_filter_16[0](ptr, ls_y, E, I, H);
-                        } else {
-                            s->dsp.loop_filter_8[2][0](ptr, ls_y, E, I, H);
-                        }
-                    } else if (hm2 & x) {
-                        L  = l[8];
-                        H |= (L >> 4) << 8;
-                        E |= s->filter.mblim_lut[L] << 8;
-                        I |= s->filter.lim_lut[L] << 8;
-                        s->dsp.loop_filter_mix2[!!(hmask1[1] & x)]
-                                               [!!(hmask2[1] & x)]
-                                               [0](ptr, ls_y, E, I, H);
-                    } else {
-                        s->dsp.loop_filter_8[!!(hmask1[1] & x)]
-                                            [0](ptr, ls_y, E, I, H);
-                    }
-                }
-            } else if (hm2 & x) {
-                int L = l[8], H = L >> 4;
-                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
-
-                if (col || x > 1) {
-                    s->dsp.loop_filter_8[!!(hmask2[1] & x)]
-                                        [0](ptr + 8 * ls_y, ls_y, E, I, H);
-                }
-            }
-            if (hm13 & x) {
-                int L = *l, H = L >> 4;
-                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
-
-                if (hm23 & x) {
-                    L  = l[8];
-                    H |= (L >> 4) << 8;
-                    E |= s->filter.mblim_lut[L] << 8;
-                    I |= s->filter.lim_lut[L] << 8;
-                    s->dsp.loop_filter_mix2[0][0][0](ptr + 4, ls_y, E, I, H);
-                } else {
-                    s->dsp.loop_filter_8[0][0](ptr + 4, ls_y, E, I, H);
-                }
-            } else if (hm23 & x) {
-                int L = l[8], H = L >> 4;
-                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
-
-                s->dsp.loop_filter_8[0][0](ptr + 8 * ls_y + 4, ls_y, E, I, H);
-            }
-        }
-    }
-
-    //                                          block1
-    // filter edges between rows, Y plane (e.g. ------)
-    //                                          block2
-    dst = s->cur_frame->data[0] + yoff;
-    lvl = lflvl->level;
-    for (y = 0; y < 8; y++, dst += 8 * ls_y, lvl += 8) {
-        uint8_t *ptr = dst, *l = lvl, *vmask = lflvl->mask[0][1][y];
-        unsigned vm = vmask[0] | vmask[1] | vmask[2], vm3 = vmask[3];
-
-        for (x = 1; vm & ~(x - 1); x <<= 2, ptr += 16, l += 2) {
-            if (row || y) {
-                if (vm & x) {
-                    int L = *l, H = L >> 4;
-                    int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
-
-                    if (vmask[0] & x) {
-                        if (vmask[0] & (x << 1)) {
-                            av_assert2(l[1] == L);
-                            s->dsp.loop_filter_16[1](ptr, ls_y, E, I, H);
-                        } else {
-                            s->dsp.loop_filter_8[2][1](ptr, ls_y, E, I, H);
-                        }
-                    } else if (vm & (x << 1)) {
-                        L  = l[1];
-                        H |= (L >> 4) << 8;
-                        E |= s->filter.mblim_lut[L] << 8;
-                        I |= s->filter.lim_lut[L] << 8;
-                        s->dsp.loop_filter_mix2[!!(vmask[1] &  x)]
-                                               [!!(vmask[1] & (x << 1))]
-                                               [1](ptr, ls_y, E, I, H);
-                    } else {
-                        s->dsp.loop_filter_8[!!(vmask[1] & x)]
-                                            [1](ptr, ls_y, E, I, H);
-                    }
-                } else if (vm & (x << 1)) {
-                    int L = l[1], H = L >> 4;
-                    int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
-
-                    s->dsp.loop_filter_8[!!(vmask[1] & (x << 1))]
-                                        [1](ptr + 8, ls_y, E, I, H);
-                }
-            }
-            if (vm3 & x) {
-                int L = *l, H = L >> 4;
-                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
-
-                if (vm3 & (x << 1)) {
-                    L  = l[1];
-                    H |= (L >> 4) << 8;
-                    E |= s->filter.mblim_lut[L] << 8;
-                    I |= s->filter.lim_lut[L] << 8;
-                    s->dsp.loop_filter_mix2[0][0][1](ptr + ls_y * 4, ls_y, E, I, H);
-                } else {
-                    s->dsp.loop_filter_8[0][1](ptr + ls_y * 4, ls_y, E, I, H);
-                }
-            } else if (vm3 & (x << 1)) {
-                int L = l[1], H = L >> 4;
-                int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
-
-                s->dsp.loop_filter_8[0][1](ptr + ls_y * 4 + 8, ls_y, E, I, H);
-            }
-        }
-    }
-
-    // same principle but for U/V planes
-    for (p = 0; p < 2; p++) {
-        lvl = lflvl->level;
-        dst = s->cur_frame->data[1 + p] + uvoff;
-        for (y = 0; y < 8; y += 4, dst += 16 * ls_uv, lvl += 32) {
-            uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[1][0][y];
-            uint8_t *hmask2 = lflvl->mask[1][0][y + 2];
-            unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2];
-            unsigned hm2 = hmask2[1] | hmask2[2], hm = hm1 | hm2;
-
-            for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 4) {
-                if (col || x > 1) {
-                    if (hm1 & x) {
-                        int L = *l, H = L >> 4;
-                        int E = s->filter.mblim_lut[L];
-                        int I = s->filter.lim_lut[L];
-
-                        if (hmask1[0] & x) {
-                            if (hmask2[0] & x) {
-                                av_assert2(l[16] == L);
-                                s->dsp.loop_filter_16[0](ptr, ls_uv, E, I, H);
-                            } else {
-                                s->dsp.loop_filter_8[2][0](ptr, ls_uv, E, I, H);
-                            }
-                        } else if (hm2 & x) {
-                            L  = l[16];
-                            H |= (L >> 4) << 8;
-                            E |= s->filter.mblim_lut[L] << 8;
-                            I |= s->filter.lim_lut[L] << 8;
-                            s->dsp.loop_filter_mix2[!!(hmask1[1] & x)]
-                                                   [!!(hmask2[1] & x)]
-                                                   [0](ptr, ls_uv, E, I, H);
-                        } else {
-                            s->dsp.loop_filter_8[!!(hmask1[1] & x)]
-                                                [0](ptr, ls_uv, E, I, H);
-                        }
-                    } else if (hm2 & x) {
-                        int L = l[16], H = L >> 4;
-                        int E = s->filter.mblim_lut[L];
-                        int I = s->filter.lim_lut[L];
-
-                        s->dsp.loop_filter_8[!!(hmask2[1] & x)]
-                                            [0](ptr + 8 * ls_uv, ls_uv, E, I, H);
-                    }
-                }
-                if (x & 0xAA)
-                    l += 2;
-            }
-        }
-        lvl = lflvl->level;
-        dst = s->cur_frame->data[1 + p] + uvoff;
-        for (y = 0; y < 8; y++, dst += 4 * ls_uv) {
-            uint8_t *ptr = dst, *l = lvl, *vmask = lflvl->mask[1][1][y];
-            unsigned vm = vmask[0] | vmask[1] | vmask[2];
-
-            for (x = 1; vm & ~(x - 1); x <<= 4, ptr += 16, l += 4) {
-                if (row || y) {
-                    if (vm & x) {
-                        int L = *l, H = L >> 4;
-                        int E = s->filter.mblim_lut[L];
-                        int I = s->filter.lim_lut[L];
-
-                        if (vmask[0] & x) {
-                            if (vmask[0] & (x << 2)) {
-                                av_assert2(l[2] == L);
-                                s->dsp.loop_filter_16[1](ptr, ls_uv, E, I, H);
-                            } else {
-                                s->dsp.loop_filter_8[2][1](ptr, ls_uv, E, I, H);
-                            }
-                        } else if (vm & (x << 2)) {
-                            L  = l[2];
-                            H |= (L >> 4) << 8;
-                            E |= s->filter.mblim_lut[L] << 8;
-                            I |= s->filter.lim_lut[L] << 8;
-                            s->dsp.loop_filter_mix2[!!(vmask[1] &  x)]
-                                                   [!!(vmask[1] & (x << 2))]
-                                                   [1](ptr, ls_uv, E, I, H);
-                        } else {
-                            s->dsp.loop_filter_8[!!(vmask[1] & x)]
-                                                [1](ptr, ls_uv, E, I, H);
-                        }
-                    } else if (vm & (x << 2)) {
-                        int L = l[2], H = L >> 4;
-                        int E = s->filter.mblim_lut[L];
-                        int I = s->filter.lim_lut[L];
-
-                        s->dsp.loop_filter_8[!!(vmask[1] & (x << 2))]
-                                            [1](ptr + 8, ls_uv, E, I, H);
-                    }
-                }
-            }
-            if (y & 1)
-                lvl += 16;
-        }
-    }
-}
-
-static void set_tile_offset(int *start, int *end, int idx, int log2_n, int n)
-{
-    int sb_start =  (idx      * n) >> log2_n;
-    int sb_end   = ((idx + 1) * n) >> log2_n;
-    *start = FFMIN(sb_start, n) << 3;
-    *end   = FFMIN(sb_end,   n) << 3;
-}
-
-static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame,
-                            int *got_frame, const uint8_t *data, int size)
-{
-    VP9Context *s = avctx->priv_data;
-    int ret, tile_row, tile_col, i, ref = -1, row, col;
-    ptrdiff_t yoff = 0, uvoff = 0;
-
-    ret = decode_frame_header(avctx, data, size, &ref);
-    if (ret < 0) {
-        return ret;
-    } else if (!ret) {
-        if (!s->refs[ref]->buf[0]) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Requested reference %d not available\n", ref);
-            return AVERROR_INVALIDDATA;
-        }
-
-        ret = av_frame_ref(frame, s->refs[ref]);
-        if (ret < 0)
-            return ret;
-        *got_frame = 1;
-        return 0;
-    }
-    data += ret;
-    size -= ret;
-
-    s->cur_frame = frame;
-
-    av_frame_unref(s->cur_frame);
-    if ((ret = ff_get_buffer(avctx, s->cur_frame,
-                             s->refreshrefmask ? AV_GET_BUFFER_FLAG_REF : 0)) < 0)
-        return ret;
-    s->cur_frame->key_frame = s->keyframe;
-    s->cur_frame->pict_type = s->keyframe ? AV_PICTURE_TYPE_I
-                                          : AV_PICTURE_TYPE_P;
-
-    // main tile decode loop
-    memset(s->above_partition_ctx, 0, s->cols);
-    memset(s->above_skip_ctx, 0, s->cols);
-    if (s->keyframe || s->intraonly)
-        memset(s->above_mode_ctx, DC_PRED, s->cols * 2);
-    else
-        memset(s->above_mode_ctx, NEARESTMV, s->cols);
-    memset(s->above_y_nnz_ctx, 0, s->sb_cols * 16);
-    memset(s->above_uv_nnz_ctx[0], 0, s->sb_cols * 8);
-    memset(s->above_uv_nnz_ctx[1], 0, s->sb_cols * 8);
-    memset(s->above_segpred_ctx, 0, s->cols);
-    for (tile_row = 0; tile_row < s->tiling.tile_rows; tile_row++) {
-        set_tile_offset(&s->tiling.tile_row_start, &s->tiling.tile_row_end,
-                        tile_row, s->tiling.log2_tile_rows, s->sb_rows);
-        for (tile_col = 0; tile_col < s->tiling.tile_cols; tile_col++) {
-            int64_t tile_size;
-
-            if (tile_col == s->tiling.tile_cols - 1 &&
-                tile_row == s->tiling.tile_rows - 1) {
-                tile_size = size;
-            } else {
-                tile_size = AV_RB32(data);
-                data     += 4;
-                size     -= 4;
-            }
-            if (tile_size > size)
-                return AVERROR_INVALIDDATA;
-            ff_vp56_init_range_decoder(&s->c_b[tile_col], data, tile_size);
-            if (vp56_rac_get_prob_branchy(&s->c_b[tile_col], 128)) // marker bit
-                return AVERROR_INVALIDDATA;
-            data += tile_size;
-            size -= tile_size;
-        }
-
-        for (row = s->tiling.tile_row_start;
-             row < s->tiling.tile_row_end;
-             row += 8, yoff += s->cur_frame->linesize[0] * 64,
-             uvoff += s->cur_frame->linesize[1] * 32) {
-            VP9Filter *lflvl = s->lflvl;
-            ptrdiff_t yoff2 = yoff, uvoff2 = uvoff;
-
-            for (tile_col = 0; tile_col < s->tiling.tile_cols; tile_col++) {
-                set_tile_offset(&s->tiling.tile_col_start,
-                                &s->tiling.tile_col_end,
-                                tile_col, s->tiling.log2_tile_cols, s->sb_cols);
-
-                memset(s->left_partition_ctx, 0, 8);
-                memset(s->left_skip_ctx, 0, 8);
-                if (s->keyframe || s->intraonly)
-                    memset(s->left_mode_ctx, DC_PRED, 16);
-                else
-                    memset(s->left_mode_ctx, NEARESTMV, 8);
-                memset(s->left_y_nnz_ctx, 0, 16);
-                memset(s->left_uv_nnz_ctx, 0, 16);
-                memset(s->left_segpred_ctx, 0, 8);
-
-                memcpy(&s->c, &s->c_b[tile_col], sizeof(s->c));
-                for (col = s->tiling.tile_col_start;
-                     col < s->tiling.tile_col_end;
-                     col += 8, yoff2 += 64, uvoff2 += 32, lflvl++) {
-                    // FIXME integrate with lf code (i.e. zero after each
-                    // use, similar to invtxfm coefficients, or similar)
-                    memset(lflvl->mask, 0, sizeof(lflvl->mask));
-
-                    if ((ret = decode_subblock(avctx, row, col, lflvl,
-                                               yoff2, uvoff2, BL_64X64)) < 0)
-                        return ret;
-                }
-                memcpy(&s->c_b[tile_col], &s->c, sizeof(s->c));
-            }
-
-            // backup pre-loopfilter reconstruction data for intra
-            // prediction of next row of sb64s
-            if (row + 8 < s->rows) {
-                memcpy(s->intra_pred_data[0],
-                       s->cur_frame->data[0] + yoff +
-                       63 * s->cur_frame->linesize[0],
-                       8 * s->cols);
-                memcpy(s->intra_pred_data[1],
-                       s->cur_frame->data[1] + uvoff +
-                       31 * s->cur_frame->linesize[1],
-                       4 * s->cols);
-                memcpy(s->intra_pred_data[2],
-                       s->cur_frame->data[2] + uvoff +
-                       31 * s->cur_frame->linesize[2],
-                       4 * s->cols);
-            }
-
-            // loopfilter one row
-            if (s->filter.level) {
-                yoff2  = yoff;
-                uvoff2 = uvoff;
-                lflvl  = s->lflvl;
-                for (col = 0; col < s->cols;
-                     col += 8, yoff2 += 64, uvoff2 += 32, lflvl++)
-                    loopfilter_subblock(avctx, lflvl, row, col, yoff2, uvoff2);
-            }
-        }
-    }
-
-    // bw adaptivity (or in case of parallel decoding mode, fw adaptivity
-    // probability maintenance between frames)
-    if (s->refreshctx) {
-        if (s->parallelmode) {
-            int j, k, l, m;
-            for (i = 0; i < 4; i++) {
-                for (j = 0; j < 2; j++)
-                    for (k = 0; k < 2; k++)
-                        for (l = 0; l < 6; l++)
-                            for (m = 0; m < 6; m++)
-                                memcpy(s->prob_ctx[s->framectxid].coef[i][j][k][l][m],
-                                       s->prob.coef[i][j][k][l][m], 3);
-                if (s->txfmmode == i)
-                    break;
-            }
-            s->prob_ctx[s->framectxid].p = s->prob.p;
-        } else {
-            ff_vp9_adapt_probs(s);
-        }
-    }
-    FFSWAP(VP9MVRefPair *, s->mv[0], s->mv[1]);
-
-    // ref frame setup
-    for (i = 0; i < 8; i++)
-        if (s->refreshrefmask & (1 << i)) {
-            av_frame_unref(s->refs[i]);
-            ret = av_frame_ref(s->refs[i], s->cur_frame);
-            if (ret < 0)
-                return ret;
-        }
-
-    if (s->invisible)
-        av_frame_unref(s->cur_frame);
-    else
-        *got_frame = 1;
-
-    return 0;
-}
-
-static int vp9_decode_packet(AVCodecContext *avctx, void *frame,
-                             int *got_frame, AVPacket *avpkt)
-{
-    const uint8_t *data = avpkt->data;
-    int size            = avpkt->size;
-    int marker, ret;
-
-    /* Read superframe index - this is a collection of individual frames
-     * that together lead to one visible frame */
-    marker = data[size - 1];
-    if ((marker & 0xe0) == 0xc0) {
-        int nbytes   = 1 + ((marker >> 3) & 0x3);
-        int n_frames = 1 + (marker & 0x7);
-        int idx_sz   = 2 + n_frames * nbytes;
-
-        if (size >= idx_sz && data[size - idx_sz] == marker) {
-            const uint8_t *idx = data + size + 1 - idx_sz;
-
-            while (n_frames--) {
-                unsigned sz = AV_RL32(idx);
-
-                if (nbytes < 4)
-                    sz &= (1 << (8 * nbytes)) - 1;
-                idx += nbytes;
-
-                if (sz > size) {
-                    av_log(avctx, AV_LOG_ERROR,
-                           "Superframe packet size too big: %u > %d\n",
-                           sz, size);
-                    return AVERROR_INVALIDDATA;
-                }
-
-                ret = vp9_decode_frame(avctx, frame, got_frame, data, sz);
-                if (ret < 0)
-                    return ret;
-                data += sz;
-                size -= sz;
-            }
-            return size;
-        }
-    }
-
-    /* If we get here, there was no valid superframe index, i.e. this is just
-     * one whole single frame. Decode it as such from the complete input buf. */
-    if ((ret = vp9_decode_frame(avctx, frame, got_frame, data, size)) < 0)
-        return ret;
-    return size;
-}
-
-static av_cold int vp9_decode_free(AVCodecContext *avctx)
-{
-    VP9Context *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->refs); i++)
-        av_frame_free(&s->refs[i]);
-
-    av_freep(&s->c_b);
-    av_freep(&s->above_partition_ctx);
-
-    return 0;
-}
-
-static av_cold int vp9_decode_init(AVCodecContext *avctx)
-{
-    VP9Context *s = avctx->priv_data;
-    int i;
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    ff_vp9dsp_init(&s->dsp);
-    ff_videodsp_init(&s->vdsp, 8);
-
-    for (i = 0; i < FF_ARRAY_ELEMS(s->refs); i++) {
-        s->refs[i] = av_frame_alloc();
-        if (!s->refs[i]) {
-            vp9_decode_free(avctx);
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    s->filter.sharpness = -1;
-
-    return 0;
-}
-
-AVCodec ff_vp9_decoder = {
-    .name           = "vp9",
-    .long_name      = NULL_IF_CONFIG_SMALL("Google VP9"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_VP9,
-    .priv_data_size = sizeof(VP9Context),
-    .init           = vp9_decode_init,
-    .decode         = vp9_decode_packet,
-    .flush          = vp9_decode_flush,
-    .close          = vp9_decode_free,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/vp9.h b/deps/libav/libavcodec/vp9.h
deleted file mode 100644
index 0a6c6ee..0000000
--- a/deps/libav/libavcodec/vp9.h
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * VP9 compatible video decoder
- *
- * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
- * Copyright (C) 2013 Clément Bœsch <u pkh me>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VP9_H
-#define AVCODEC_VP9_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/internal.h"
-
-#include "avcodec.h"
-#include "vp56.h"
-
-enum TxfmMode {
-    TX_4X4,
-    TX_8X8,
-    TX_16X16,
-    TX_32X32,
-    N_TXFM_SIZES,
-    TX_SWITCHABLE = N_TXFM_SIZES,
-    N_TXFM_MODES
-};
-
-enum TxfmType {
-    DCT_DCT,
-    DCT_ADST,
-    ADST_DCT,
-    ADST_ADST,
-    N_TXFM_TYPES
-};
-
-enum IntraPredMode {
-    VERT_PRED,
-    HOR_PRED,
-    DC_PRED,
-    DIAG_DOWN_LEFT_PRED,
-    DIAG_DOWN_RIGHT_PRED,
-    VERT_RIGHT_PRED,
-    HOR_DOWN_PRED,
-    VERT_LEFT_PRED,
-    HOR_UP_PRED,
-    TM_VP8_PRED,
-    LEFT_DC_PRED,
-    TOP_DC_PRED,
-    DC_128_PRED,
-    DC_127_PRED,
-    DC_129_PRED,
-    N_INTRA_PRED_MODES
-};
-
-enum FilterMode {
-    FILTER_8TAP_SMOOTH,
-    FILTER_8TAP_REGULAR,
-    FILTER_8TAP_SHARP,
-    FILTER_BILINEAR,
-    FILTER_SWITCHABLE,
-};
-
-enum BlockPartition {
-    PARTITION_NONE,    // [ ] <-.
-    PARTITION_H,       // [-]   |
-    PARTITION_V,       // [|]   |
-    PARTITION_SPLIT,   // [+] --'
-};
-
-enum InterPredMode {
-    NEARESTMV = 10,
-    NEARMV    = 11,
-    ZEROMV    = 12,
-    NEWMV     = 13,
-};
-
-enum MVJoint {
-    MV_JOINT_ZERO,
-    MV_JOINT_H,
-    MV_JOINT_V,
-    MV_JOINT_HV,
-};
-
-typedef struct ProbContext {
-    uint8_t y_mode[4][9];
-    uint8_t uv_mode[10][9];
-    uint8_t filter[4][2];
-    uint8_t mv_mode[7][3];
-    uint8_t intra[4];
-    uint8_t comp[5];
-    uint8_t single_ref[5][2];
-    uint8_t comp_ref[5];
-    uint8_t tx32p[2][3];
-    uint8_t tx16p[2][2];
-    uint8_t tx8p[2];
-    uint8_t skip[3];
-    uint8_t mv_joint[3];
-    struct {
-        uint8_t sign;
-        uint8_t classes[10];
-        uint8_t class0;
-        uint8_t bits[10];
-        uint8_t class0_fp[2][3];
-        uint8_t fp[3];
-        uint8_t class0_hp;
-        uint8_t hp;
-    } mv_comp[2];
-    uint8_t partition[4][4][3];
-} ProbContext;
-
-typedef void (*vp9_mc_func)(uint8_t *dst, const uint8_t *ref,
-                            ptrdiff_t dst_stride,
-                            ptrdiff_t ref_stride,
-                            int h, int mx, int my);
-
-typedef struct VP9DSPContext {
-    /*
-     * dimension 1: 0=4x4, 1=8x8, 2=16x16, 3=32x32
-     * dimension 2: intra prediction modes
-     *
-     * dst/left/top is aligned by transform-size (i.e. 4, 8, 16 or 32 pixels)
-     * stride is aligned by 16 pixels
-     * top[-1] is top/left; top[4,7] is top-right for 4x4
-     */
-    // FIXME(rbultje) maybe replace left/top pointers with HAVE_TOP/
-    // HAVE_LEFT/HAVE_TOPRIGHT flags instead, and then handle it in-place?
-    // also needs to fit in with what h264/vp8/etc do
-    void (*intra_pred[N_TXFM_SIZES][N_INTRA_PRED_MODES])(uint8_t *dst,
-                                                         ptrdiff_t stride,
-                                                         const uint8_t *left,
-                                                         const uint8_t *top);
-
-    /*
-     * dimension 1: 0=4x4, 1=8x8, 2=16x16, 3=32x32, 4=lossless (3-4=dct only)
-     * dimension 2: 0=dct/dct, 1=dct/adst, 2=adst/dct, 3=adst/adst
-     *
-     * dst is aligned by transform-size (i.e. 4, 8, 16 or 32 pixels)
-     * stride is aligned by 16 pixels
-     * block is 16-byte aligned
-     * eob indicates the position (+1) of the last non-zero coefficient,
-     * in scan-order. This can be used to write faster versions, e.g. a
-     * dc-only 4x4/8x8/16x16/32x32, or a 4x4-only (eob<10) 8x8/16x16/32x32,
-     * etc.
-     */
-    // FIXME also write idct_add_block() versions for whole (inter) pred
-    // blocks, so we can do 2 4x4s at once
-    void (*itxfm_add[N_TXFM_SIZES + 1][N_TXFM_TYPES])(uint8_t *dst,
-                                                      ptrdiff_t stride,
-                                                      int16_t *block, int eob);
-
-    /*
-     * dimension 1: width of filter (0=4, 1=8, 2=16)
-     * dimension 2: 0=col-edge filter (h), 1=row-edge filter (v)
-     *
-     * dst/stride are aligned by 8
-     */
-    void (*loop_filter_8[3][2])(uint8_t *dst, ptrdiff_t stride,
-                                int mb_lim, int lim, int hev_thr);
-
-    /*
-     * dimension 1: 0=col-edge filter (h), 1=row-edge filter (v)
-     *
-     * The width of filter is assumed to be 16; dst/stride are aligned by 16
-     */
-    void (*loop_filter_16[2])(uint8_t *dst, ptrdiff_t stride,
-                              int mb_lim, int lim, int hev_thr);
-
-    /*
-     * dimension 1/2: width of filter (0=4, 1=8) for each filter half
-     * dimension 3: 0=col-edge filter (h), 1=row-edge filter (v)
-     *
-     * dst/stride are aligned by operation size
-     * this basically calls loop_filter[d1][d3][0](), followed by
-     * loop_filter[d2][d3][0]() on the next 8 pixels
-     * mb_lim/lim/hev_thr contain two values in the lowest two bytes of the
-     * integer.
-     */
-    // FIXME perhaps a mix4 that operates on 32px (for AVX2)
-    void (*loop_filter_mix2[2][2][2])(uint8_t *dst, ptrdiff_t stride,
-                                      int mb_lim, int lim, int hev_thr);
-
-    /*
-     * dimension 1: hsize (0: 64, 1: 32, 2: 16, 3: 8, 4: 4)
-     * dimension 2: filter type (0: smooth, 1: regular, 2: sharp, 3: bilin)
-     * dimension 3: averaging type (0: put, 1: avg)
-     * dimension 4: x subpel interpolation (0: none, 1: 8tap/bilin)
-     * dimension 5: y subpel interpolation (1: none, 1: 8tap/bilin)
-     *
-     * dst/stride are aligned by hsize
-     */
-    vp9_mc_func mc[5][4][2][2][2];
-} VP9DSPContext;
-
-enum CompPredMode {
-    PRED_SINGLEREF,
-    PRED_COMPREF,
-    PRED_SWITCHABLE,
-};
-
-typedef struct VP9MVRefPair {
-    VP56mv mv[2];
-    int8_t ref[2];
-} VP9MVRefPair;
-
-typedef struct VP9Filter {
-    uint8_t level[8 * 8];
-    uint8_t /* bit=col */ mask[2 /* 0=y, 1=uv */][2 /* 0=col, 1=row */]
-                              [8 /* rows */][4 /* 0=16, 1=8, 2=4, 3=inner4 */];
-} VP9Filter;
-
-enum BlockLevel {
-    BL_64X64,
-    BL_32X32,
-    BL_16X16,
-    BL_8X8,
-};
-
-enum BlockSize {
-    BS_64x64,
-    BS_64x32,
-    BS_32x64,
-    BS_32x32,
-    BS_32x16,
-    BS_16x32,
-    BS_16x16,
-    BS_16x8,
-    BS_8x16,
-    BS_8x8,
-    BS_8x4,
-    BS_4x8,
-    BS_4x4,
-    N_BS_SIZES,
-};
-
-typedef struct VP9Block {
-    uint8_t seg_id, intra, comp, ref[2], mode[4], uvmode, skip;
-    enum FilterMode filter;
-    VP56mv mv[4 /* b_idx */][2 /* ref */];
-    enum BlockSize bs;
-    enum TxfmMode tx, uvtx;
-
-    int row, row7, col, col7;
-    uint8_t *dst[3];
-    ptrdiff_t y_stride, uv_stride;
-} VP9Block;
-
-typedef struct VP9Context {
-    VP9DSPContext dsp;
-    VideoDSPContext vdsp;
-    GetBitContext gb;
-    VP56RangeCoder c;
-    VP56RangeCoder *c_b;
-    unsigned c_b_size;
-    VP9Block b;
-
-    // bitstream header
-    uint8_t profile;
-    uint8_t keyframe, last_keyframe;
-    uint8_t invisible;
-    uint8_t use_last_frame_mvs;
-    uint8_t errorres;
-    uint8_t colorspace;
-    uint8_t fullrange;
-    uint8_t intraonly;
-    uint8_t resetctx;
-    uint8_t refreshrefmask;
-    uint8_t highprecisionmvs;
-    enum FilterMode filtermode;
-    uint8_t allowcompinter;
-    uint8_t fixcompref;
-    uint8_t refreshctx;
-    uint8_t parallelmode;
-    uint8_t framectxid;
-    uint8_t refidx[3];
-    uint8_t signbias[3];
-    uint8_t varcompref[2];
-    AVFrame *refs[8];
-    AVFrame *cur_frame;
-
-    struct {
-        uint8_t level;
-        int8_t sharpness;
-        uint8_t lim_lut[64];
-        uint8_t mblim_lut[64];
-    } filter;
-    struct {
-        uint8_t enabled;
-        int8_t mode[2];
-        int8_t ref[4];
-    } lf_delta;
-    uint8_t yac_qi;
-    int8_t ydc_qdelta, uvdc_qdelta, uvac_qdelta;
-    uint8_t lossless;
-    struct {
-        uint8_t enabled;
-        uint8_t temporal;
-        uint8_t absolute_vals;
-        uint8_t update_map;
-        struct {
-            uint8_t q_enabled;
-            uint8_t lf_enabled;
-            uint8_t ref_enabled;
-            uint8_t skip_enabled;
-            uint8_t ref_val;
-            int16_t q_val;
-            int8_t lf_val;
-            int16_t qmul[2][2];
-            uint8_t lflvl[4][2];
-        } feat[8];
-    } segmentation;
-    struct {
-        unsigned log2_tile_cols, log2_tile_rows;
-        unsigned tile_cols, tile_rows;
-        unsigned tile_row_start, tile_row_end, tile_col_start, tile_col_end;
-    } tiling;
-    unsigned sb_cols, sb_rows, rows, cols;
-    struct {
-        ProbContext p;
-        uint8_t coef[4][2][2][6][6][3];
-    } prob_ctx[4];
-    struct {
-        ProbContext p;
-        uint8_t coef[4][2][2][6][6][11];
-        uint8_t seg[7];
-        uint8_t segpred[3];
-    } prob;
-    struct {
-        unsigned y_mode[4][10];
-        unsigned uv_mode[10][10];
-        unsigned filter[4][3];
-        unsigned mv_mode[7][4];
-        unsigned intra[4][2];
-        unsigned comp[5][2];
-        unsigned single_ref[5][2][2];
-        unsigned comp_ref[5][2];
-        unsigned tx32p[2][4];
-        unsigned tx16p[2][3];
-        unsigned tx8p[2][2];
-        unsigned skip[3][2];
-        unsigned mv_joint[4];
-        struct {
-            unsigned sign[2];
-            unsigned classes[11];
-            unsigned class0[2];
-            unsigned bits[10][2];
-            unsigned class0_fp[2][4];
-            unsigned fp[4];
-            unsigned class0_hp[2];
-            unsigned hp[2];
-        } mv_comp[2];
-        unsigned partition[4][4][4];
-        unsigned coef[4][2][2][6][6][3];
-        unsigned eob[4][2][2][6][6][2];
-    } counts;
-    enum TxfmMode txfmmode;
-    enum CompPredMode comppredmode;
-
-    // contextual (left/above) cache
-    uint8_t left_partition_ctx[8], *above_partition_ctx;
-    uint8_t left_mode_ctx[16], *above_mode_ctx;
-    // FIXME maybe merge some of the below in a flags field?
-    uint8_t left_y_nnz_ctx[16], *above_y_nnz_ctx;
-    uint8_t left_uv_nnz_ctx[2][8], *above_uv_nnz_ctx[2];
-    uint8_t left_skip_ctx[8], *above_skip_ctx; // 1bit
-    uint8_t left_txfm_ctx[8], *above_txfm_ctx; // 2bit
-    uint8_t left_segpred_ctx[8], *above_segpred_ctx; // 1bit
-    uint8_t left_intra_ctx[8], *above_intra_ctx; // 1bit
-    uint8_t left_comp_ctx[8], *above_comp_ctx; // 1bit
-    uint8_t left_ref_ctx[8], *above_ref_ctx; // 2bit
-    uint8_t left_filter_ctx[8], *above_filter_ctx;
-    VP56mv left_mv_ctx[16][2], (*above_mv_ctx)[2];
-
-    // whole-frame cache
-    uint8_t *intra_pred_data[3];
-    uint8_t *segmentation_map;
-    VP9MVRefPair *mv[2];
-    VP9Filter *lflvl;
-    DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer)[71 * 80];
-
-    // block reconstruction intermediates
-    DECLARE_ALIGNED(32, int16_t, block)[4096];
-    DECLARE_ALIGNED(32, int16_t, uvblock)[2][1024];
-    uint8_t eob[256];
-    uint8_t uveob[2][64];
-    VP56mv min_mv, max_mv;
-    DECLARE_ALIGNED(32, uint8_t, tmp_y)[64 * 64];
-    DECLARE_ALIGNED(32, uint8_t, tmp_uv)[2][32 * 32];
-} VP9Context;
-
-void ff_vp9dsp_init(VP9DSPContext *dsp);
-
-void ff_vp9dsp_init_x86(VP9DSPContext *dsp);
-
-void ff_vp9_fill_mv(VP9Context *s, VP56mv *mv, int mode, int sb);
-
-void ff_vp9_adapt_probs(VP9Context *s);
-
-int ff_vp9_decode_block(AVCodecContext *avctx, int row, int col,
-                        VP9Filter *lflvl, ptrdiff_t yoff, ptrdiff_t uvoff,
-                        enum BlockLevel bl, enum BlockPartition bp);
-
-#endif /* AVCODEC_VP9_H */
diff --git a/deps/libav/libavcodec/vp9block.c b/deps/libav/libavcodec/vp9block.c
deleted file mode 100644
index caf3bcc..0000000
--- a/deps/libav/libavcodec/vp9block.c
+++ /dev/null
@@ -1,1684 +0,0 @@
-/*
- * VP9 compatible video decoder
- *
- * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
- * Copyright (C) 2013 Clément Bœsch <u pkh me>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avassert.h"
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "videodsp.h"
-#include "vp56.h"
-#include "vp9.h"
-#include "vp9data.h"
-
-static const uint8_t bwh_tab[2][N_BS_SIZES][2] = {
-    {
-        { 16, 16 }, { 16, 8 }, { 8, 16 }, { 8, 8 }, { 8, 4 }, { 4, 8 },
-        {  4,  4 }, {  4, 2 }, { 2,  4 }, { 2, 2 }, { 2, 1 }, { 1, 2 }, { 1, 1 },
-    },  {
-        {  8,  8 }, {  8, 4 }, { 4,  8 }, { 4, 4 }, { 4, 2 }, { 2, 4 },
-        {  2,  2 }, {  2, 1 }, { 1,  2 }, { 1, 1 }, { 1, 1 }, { 1, 1 }, { 1, 1 },
-    }
-};
-
-// differential forward probability updates
-static void decode_mode(VP9Context *s, VP9Block *const b)
-{
-    static const uint8_t left_ctx[N_BS_SIZES] = {
-        0x0, 0x8, 0x0, 0x8, 0xc, 0x8, 0xc, 0xe, 0xc, 0xe, 0xf, 0xe, 0xf
-    };
-    static const uint8_t above_ctx[N_BS_SIZES] = {
-        0x0, 0x0, 0x8, 0x8, 0x8, 0xc, 0xc, 0xc, 0xe, 0xe, 0xe, 0xf, 0xf
-    };
-    static const uint8_t max_tx_for_bl_bp[N_BS_SIZES] = {
-        TX_32X32, TX_32X32, TX_32X32, TX_32X32, TX_16X16, TX_16X16,
-        TX_16X16, TX_8X8,   TX_8X8,   TX_8X8,   TX_4X4,   TX_4X4,  TX_4X4
-    };
-    int row = b->row, col = b->col, row7 = b->row7;
-    enum TxfmMode max_tx = max_tx_for_bl_bp[b->bs];
-    int w4 = FFMIN(s->cols - col, bwh_tab[1][b->bs][0]);
-    int h4 = FFMIN(s->rows - row, bwh_tab[1][b->bs][1]);
-    int have_a = row > 0, have_l = col > s->tiling.tile_col_start;
-    int y;
-
-    if (!s->segmentation.enabled) {
-        b->seg_id = 0;
-    } else if (s->keyframe || s->intraonly) {
-        b->seg_id = s->segmentation.update_map ?
-                    vp8_rac_get_tree(&s->c, ff_vp9_segmentation_tree, s->prob.seg) : 0;
-    } else if (!s->segmentation.update_map ||
-               (s->segmentation.temporal &&
-                vp56_rac_get_prob_branchy(&s->c,
-                                          s->prob.segpred[s->above_segpred_ctx[col] +
-                                                          s->left_segpred_ctx[row7]]))) {
-        int pred = 8, x;
-
-        for (y = 0; y < h4; y++)
-            for (x = 0; x < w4; x++)
-                pred = FFMIN(pred,
-                             s->segmentation_map[(y + row) * 8 * s->sb_cols + x + col]);
-        b->seg_id = pred;
-
-        memset(&s->above_segpred_ctx[col], 1, w4);
-        memset(&s->left_segpred_ctx[row7], 1, h4);
-    } else {
-        b->seg_id = vp8_rac_get_tree(&s->c, ff_vp9_segmentation_tree,
-                                     s->prob.seg);
-
-        memset(&s->above_segpred_ctx[col], 0, w4);
-        memset(&s->left_segpred_ctx[row7], 0, h4);
-    }
-    if ((s->segmentation.enabled && s->segmentation.update_map) || s->keyframe) {
-        for (y = 0; y < h4; y++)
-            memset(&s->segmentation_map[(y + row) * 8 * s->sb_cols + col],
-                   b->seg_id, w4);
-    }
-
-    b->skip = s->segmentation.enabled &&
-              s->segmentation.feat[b->seg_id].skip_enabled;
-    if (!b->skip) {
-        int c = s->left_skip_ctx[row7] + s->above_skip_ctx[col];
-        b->skip = vp56_rac_get_prob(&s->c, s->prob.p.skip[c]);
-        s->counts.skip[c][b->skip]++;
-    }
-
-    if (s->keyframe || s->intraonly) {
-        b->intra = 1;
-    } else if (s->segmentation.feat[b->seg_id].ref_enabled) {
-        b->intra = !s->segmentation.feat[b->seg_id].ref_val;
-    } else {
-        int c, bit;
-
-        if (have_a && have_l) {
-            c  = s->above_intra_ctx[col] + s->left_intra_ctx[row7];
-            c += (c == 2);
-        } else {
-            c = have_a ? 2 * s->above_intra_ctx[col] :
-                have_l ? 2 * s->left_intra_ctx[row7] : 0;
-        }
-        bit = vp56_rac_get_prob(&s->c, s->prob.p.intra[c]);
-        s->counts.intra[c][bit]++;
-        b->intra = !bit;
-    }
-
-    if ((b->intra || !b->skip) && s->txfmmode == TX_SWITCHABLE) {
-        int c;
-        if (have_a) {
-            if (have_l) {
-                c = (s->above_skip_ctx[col] ? max_tx :
-                     s->above_txfm_ctx[col]) +
-                    (s->left_skip_ctx[row7] ? max_tx :
-                     s->left_txfm_ctx[row7]) > max_tx;
-            } else {
-                c = s->above_skip_ctx[col] ? 1 :
-                    (s->above_txfm_ctx[col] * 2 > max_tx);
-            }
-        } else if (have_l) {
-            c = s->left_skip_ctx[row7] ? 1 :
-                (s->left_txfm_ctx[row7] * 2 > max_tx);
-        } else {
-            c = 1;
-        }
-        switch (max_tx) {
-        case TX_32X32:
-            b->tx = vp56_rac_get_prob(&s->c, s->prob.p.tx32p[c][0]);
-            if (b->tx) {
-                b->tx += vp56_rac_get_prob(&s->c, s->prob.p.tx32p[c][1]);
-                if (b->tx == 2)
-                    b->tx += vp56_rac_get_prob(&s->c, s->prob.p.tx32p[c][2]);
-            }
-            s->counts.tx32p[c][b->tx]++;
-            break;
-        case TX_16X16:
-            b->tx = vp56_rac_get_prob(&s->c, s->prob.p.tx16p[c][0]);
-            if (b->tx)
-                b->tx += vp56_rac_get_prob(&s->c, s->prob.p.tx16p[c][1]);
-            s->counts.tx16p[c][b->tx]++;
-            break;
-        case TX_8X8:
-            b->tx = vp56_rac_get_prob(&s->c, s->prob.p.tx8p[c]);
-            s->counts.tx8p[c][b->tx]++;
-            break;
-        case TX_4X4:
-            b->tx = TX_4X4;
-            break;
-        }
-    } else {
-        b->tx = FFMIN(max_tx, s->txfmmode);
-    }
-
-    if (s->keyframe || s->intraonly) {
-        uint8_t *a = &s->above_mode_ctx[col * 2];
-        uint8_t *l = &s->left_mode_ctx[(row7) << 1];
-
-        b->comp = 0;
-        if (b->bs > BS_8x8) {
-            // FIXME the memory storage intermediates here aren't really
-            // necessary, they're just there to make the code slightly
-            // simpler for now
-            b->mode[0] =
-            a[0]       = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                          ff_vp9_default_kf_ymode_probs[a[0]][l[0]]);
-            if (b->bs != BS_8x4) {
-                b->mode[1] = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                              ff_vp9_default_kf_ymode_probs[a[1]][b->mode[0]]);
-                l[0]       =
-                a[1]       = b->mode[1];
-            } else {
-                l[0]       =
-                a[1]       =
-                b->mode[1] = b->mode[0];
-            }
-            if (b->bs != BS_4x8) {
-                b->mode[2] =
-                a[0]       = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                              ff_vp9_default_kf_ymode_probs[a[0]][l[1]]);
-                if (b->bs != BS_8x4) {
-                    b->mode[3] = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                                  ff_vp9_default_kf_ymode_probs[a[1]][b->mode[2]]);
-                    l[1]       =
-                    a[1]       = b->mode[3];
-                } else {
-                    l[1]       =
-                    a[1]       =
-                    b->mode[3] = b->mode[2];
-                }
-            } else {
-                b->mode[2] = b->mode[0];
-                l[1]       =
-                a[1]       =
-                b->mode[3] = b->mode[1];
-            }
-        } else {
-            b->mode[0] = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                          ff_vp9_default_kf_ymode_probs[*a][*l]);
-            b->mode[3] =
-            b->mode[2] =
-            b->mode[1] = b->mode[0];
-            // FIXME this can probably be optimized
-            memset(a, b->mode[0], bwh_tab[0][b->bs][0]);
-            memset(l, b->mode[0], bwh_tab[0][b->bs][1]);
-        }
-        b->uvmode = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                     ff_vp9_default_kf_uvmode_probs[b->mode[3]]);
-    } else if (b->intra) {
-        b->comp = 0;
-        if (b->bs > BS_8x8) {
-            b->mode[0] = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                          s->prob.p.y_mode[0]);
-            s->counts.y_mode[0][b->mode[0]]++;
-            if (b->bs != BS_8x4) {
-                b->mode[1] = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                              s->prob.p.y_mode[0]);
-                s->counts.y_mode[0][b->mode[1]]++;
-            } else {
-                b->mode[1] = b->mode[0];
-            }
-            if (b->bs != BS_4x8) {
-                b->mode[2] = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                              s->prob.p.y_mode[0]);
-                s->counts.y_mode[0][b->mode[2]]++;
-                if (b->bs != BS_8x4) {
-                    b->mode[3] = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                                  s->prob.p.y_mode[0]);
-                    s->counts.y_mode[0][b->mode[3]]++;
-                } else {
-                    b->mode[3] = b->mode[2];
-                }
-            } else {
-                b->mode[2] = b->mode[0];
-                b->mode[3] = b->mode[1];
-            }
-        } else {
-            static const uint8_t size_group[10] = {
-                3, 3, 3, 3, 2, 2, 2, 1, 1, 1
-            };
-            int sz = size_group[b->bs];
-
-            b->mode[0] = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                          s->prob.p.y_mode[sz]);
-            b->mode[1] =
-            b->mode[2] =
-            b->mode[3] = b->mode[0];
-            s->counts.y_mode[sz][b->mode[3]]++;
-        }
-        b->uvmode = vp8_rac_get_tree(&s->c, ff_vp9_intramode_tree,
-                                     s->prob.p.uv_mode[b->mode[3]]);
-        s->counts.uv_mode[b->mode[3]][b->uvmode]++;
-    } else {
-        static const uint8_t inter_mode_ctx_lut[14][14] = {
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 },
-            { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 2, 1, 3 },
-            { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 2, 1, 3 },
-            { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 0, 3 },
-            { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 4 },
-        };
-
-        if (s->segmentation.feat[b->seg_id].ref_enabled) {
-            av_assert2(s->segmentation.feat[b->seg_id].ref_val != 0);
-            b->comp   = 0;
-            b->ref[0] = s->segmentation.feat[b->seg_id].ref_val - 1;
-        } else {
-            // read comp_pred flag
-            if (s->comppredmode != PRED_SWITCHABLE) {
-                b->comp = s->comppredmode == PRED_COMPREF;
-            } else {
-                int c;
-
-                // FIXME add intra as ref=0xff (or -1) to make these easier?
-                if (have_a) {
-                    if (have_l) {
-                        if (s->above_comp_ctx[col] && s->left_comp_ctx[row7]) {
-                            c = 4;
-                        } else if (s->above_comp_ctx[col]) {
-                            c = 2 + (s->left_intra_ctx[row7] ||
-                                     s->left_ref_ctx[row7] == s->fixcompref);
-                        } else if (s->left_comp_ctx[row7]) {
-                            c = 2 + (s->above_intra_ctx[col] ||
-                                     s->above_ref_ctx[col] == s->fixcompref);
-                        } else {
-                            c = (!s->above_intra_ctx[col] &&
-                                 s->above_ref_ctx[col] == s->fixcompref) ^
-                                (!s->left_intra_ctx[row7] &&
-                                 s->left_ref_ctx[row & 7] == s->fixcompref);
-                        }
-                    } else {
-                        c = s->above_comp_ctx[col] ? 3 :
-                            (!s->above_intra_ctx[col] && s->above_ref_ctx[col] == s->fixcompref);
-                    }
-                } else if (have_l) {
-                    c = s->left_comp_ctx[row7] ? 3 :
-                        (!s->left_intra_ctx[row7] && s->left_ref_ctx[row7] == s->fixcompref);
-                } else {
-                    c = 1;
-                }
-                b->comp = vp56_rac_get_prob(&s->c, s->prob.p.comp[c]);
-                s->counts.comp[c][b->comp]++;
-            }
-
-            // read actual references
-            // FIXME probably cache a few variables here to prevent repetitive
-            // memory accesses below
-            if (b->comp) { /* two references */
-                int fix_idx = s->signbias[s->fixcompref], var_idx = !fix_idx, c, bit;
-
-                b->ref[fix_idx] = s->fixcompref;
-                // FIXME can this codeblob be replaced by some sort of LUT?
-                if (have_a) {
-                    if (have_l) {
-                        if (s->above_intra_ctx[col]) {
-                            if (s->left_intra_ctx[row7]) {
-                                c = 2;
-                            } else {
-                                c = 1 + 2 * (s->left_ref_ctx[row7] != s->varcompref[1]);
-                            }
-                        } else if (s->left_intra_ctx[row7]) {
-                            c = 1 + 2 * (s->above_ref_ctx[col] != s->varcompref[1]);
-                        } else {
-                            int refl = s->left_ref_ctx[row7], refa = s->above_ref_ctx[col];
-
-                            if (refl == refa && refa == s->varcompref[1]) {
-                                c = 0;
-                            } else if (!s->left_comp_ctx[row7] && !s->above_comp_ctx[col]) {
-                                if ((refa == s->fixcompref && refl == s->varcompref[0]) ||
-                                    (refl == s->fixcompref && refa == s->varcompref[0])) {
-                                    c = 4;
-                                } else {
-                                    c = (refa == refl) ? 3 : 1;
-                                }
-                            } else if (!s->left_comp_ctx[row7]) {
-                                if (refa == s->varcompref[1] && refl != s->varcompref[1]) {
-                                    c = 1;
-                                } else {
-                                    c = (refl == s->varcompref[1] &&
-                                         refa != s->varcompref[1]) ? 2 : 4;
-                                }
-                            } else if (!s->above_comp_ctx[col]) {
-                                if (refl == s->varcompref[1] && refa != s->varcompref[1]) {
-                                    c = 1;
-                                } else {
-                                    c = (refa == s->varcompref[1] &&
-                                         refl != s->varcompref[1]) ? 2 : 4;
-                                }
-                            } else {
-                                c = (refl == refa) ? 4 : 2;
-                            }
-                        }
-                    } else {
-                        if (s->above_intra_ctx[col]) {
-                            c = 2;
-                        } else if (s->above_comp_ctx[col]) {
-                            c = 4 * (s->above_ref_ctx[col] != s->varcompref[1]);
-                        } else {
-                            c = 3 * (s->above_ref_ctx[col] != s->varcompref[1]);
-                        }
-                    }
-                } else if (have_l) {
-                    if (s->left_intra_ctx[row7]) {
-                        c = 2;
-                    } else if (s->left_comp_ctx[row7]) {
-                        c = 4 * (s->left_ref_ctx[row7] != s->varcompref[1]);
-                    } else {
-                        c = 3 * (s->left_ref_ctx[row7] != s->varcompref[1]);
-                    }
-                } else {
-                    c = 2;
-                }
-                bit = vp56_rac_get_prob(&s->c, s->prob.p.comp_ref[c]);
-                b->ref[var_idx] = s->varcompref[bit];
-                s->counts.comp_ref[c][bit]++;
-            } else { /* single reference */
-                int bit, c;
-
-                if (have_a && !s->above_intra_ctx[col]) {
-                    if (have_l && !s->left_intra_ctx[row7]) {
-                        if (s->left_comp_ctx[row7]) {
-                            if (s->above_comp_ctx[col]) {
-                                c = 1 + (!s->fixcompref || !s->left_ref_ctx[row7] ||
-                                         !s->above_ref_ctx[col]);
-                            } else {
-                                c = (3 * !s->above_ref_ctx[col]) +
-                                    (!s->fixcompref || !s->left_ref_ctx[row7]);
-                            }
-                        } else if (s->above_comp_ctx[col]) {
-                            c = (3 * !s->left_ref_ctx[row7]) +
-                                (!s->fixcompref || !s->above_ref_ctx[col]);
-                        } else {
-                            c = 2 * !s->left_ref_ctx[row7] + 2 * !s->above_ref_ctx[col];
-                        }
-                    } else if (s->above_intra_ctx[col]) {
-                        c = 2;
-                    } else if (s->above_comp_ctx[col]) {
-                        c = 1 + (!s->fixcompref || !s->above_ref_ctx[col]);
-                    } else {
-                        c = 4 * (!s->above_ref_ctx[col]);
-                    }
-                } else if (have_l && !s->left_intra_ctx[row7]) {
-                    if (s->left_intra_ctx[row7]) {
-                        c = 2;
-                    } else if (s->left_comp_ctx[row7]) {
-                        c = 1 + (!s->fixcompref || !s->left_ref_ctx[row7]);
-                    } else {
-                        c = 4 * (!s->left_ref_ctx[row7]);
-                    }
-                } else {
-                    c = 2;
-                }
-                bit = vp56_rac_get_prob(&s->c, s->prob.p.single_ref[c][0]);
-                s->counts.single_ref[c][0][bit]++;
-                if (!bit) {
-                    b->ref[0] = 0;
-                } else {
-                    // FIXME can this codeblob be replaced by some sort of LUT?
-                    if (have_a) {
-                        if (have_l) {
-                            if (s->left_intra_ctx[row7]) {
-                                if (s->above_intra_ctx[col]) {
-                                    c = 2;
-                                } else if (s->above_comp_ctx[col]) {
-                                    c = 1 + 2 * (s->fixcompref == 1 ||
-                                                 s->above_ref_ctx[col] == 1);
-                                } else if (!s->above_ref_ctx[col]) {
-                                    c = 3;
-                                } else {
-                                    c = 4 * (s->above_ref_ctx[col] == 1);
-                                }
-                            } else if (s->above_intra_ctx[col]) {
-                                if (s->left_intra_ctx[row7]) {
-                                    c = 2;
-                                } else if (s->left_comp_ctx[row7]) {
-                                    c = 1 + 2 * (s->fixcompref == 1 ||
-                                                 s->left_ref_ctx[row7] == 1);
-                                } else if (!s->left_ref_ctx[row7]) {
-                                    c = 3;
-                                } else {
-                                    c = 4 * (s->left_ref_ctx[row7] == 1);
-                                }
-                            } else if (s->above_comp_ctx[col]) {
-                                if (s->left_comp_ctx[row7]) {
-                                    if (s->left_ref_ctx[row7] == s->above_ref_ctx[col]) {
-                                        c = 3 * (s->fixcompref == 1 ||
-                                                 s->left_ref_ctx[row7] == 1);
-                                    } else {
-                                        c = 2;
-                                    }
-                                } else if (!s->left_ref_ctx[row7]) {
-                                    c = 1 + 2 * (s->fixcompref == 1 ||
-                                                 s->above_ref_ctx[col] == 1);
-                                } else {
-                                    c = 3 * (s->left_ref_ctx[row7] == 1) +
-                                        (s->fixcompref == 1 || s->above_ref_ctx[col] == 1);
-                                }
-                            } else if (s->left_comp_ctx[row7]) {
-                                if (!s->above_ref_ctx[col]) {
-                                    c = 1 + 2 * (s->fixcompref == 1 ||
-                                                 s->left_ref_ctx[row7] == 1);
-                                } else {
-                                    c = 3 * (s->above_ref_ctx[col] == 1) +
-                                        (s->fixcompref == 1 || s->left_ref_ctx[row7] == 1);
-                                }
-                            } else if (!s->above_ref_ctx[col]) {
-                                if (!s->left_ref_ctx[row7]) {
-                                    c = 3;
-                                } else {
-                                    c = 4 * (s->left_ref_ctx[row7] == 1);
-                                }
-                            } else if (!s->left_ref_ctx[row7]) {
-                                c = 4 * (s->above_ref_ctx[col] == 1);
-                            } else {
-                                c = 2 * (s->left_ref_ctx[row7] == 1) +
-                                    2 * (s->above_ref_ctx[col] == 1);
-                            }
-                        } else {
-                            if (s->above_intra_ctx[col] ||
-                                (!s->above_comp_ctx[col] && !s->above_ref_ctx[col])) {
-                                c = 2;
-                            } else if (s->above_comp_ctx[col]) {
-                                c = 3 * (s->fixcompref == 1 || s->above_ref_ctx[col] == 1);
-                            } else {
-                                c = 4 * (s->above_ref_ctx[col] == 1);
-                            }
-                        }
-                    } else if (have_l) {
-                        if (s->left_intra_ctx[row7] ||
-                            (!s->left_comp_ctx[row7] && !s->left_ref_ctx[row7])) {
-                            c = 2;
-                        } else if (s->left_comp_ctx[row7]) {
-                            c = 3 * (s->fixcompref == 1 || s->left_ref_ctx[row7] == 1);
-                        } else {
-                            c = 4 * (s->left_ref_ctx[row7] == 1);
-                        }
-                    } else {
-                        c = 2;
-                    }
-                    bit = vp56_rac_get_prob(&s->c, s->prob.p.single_ref[c][1]);
-                    s->counts.single_ref[c][1][bit]++;
-                    b->ref[0] = 1 + bit;
-                }
-            }
-        }
-
-        if (b->bs <= BS_8x8) {
-            if (s->segmentation.feat[b->seg_id].skip_enabled) {
-                b->mode[0] =
-                b->mode[1] =
-                b->mode[2] =
-                b->mode[3] = ZEROMV;
-            } else {
-                static const uint8_t off[10] = {
-                    3, 0, 0, 1, 0, 0, 0, 0, 0, 0
-                };
-
-                // FIXME this needs to use the LUT tables from find_ref_mvs
-                // because not all are -1,0/0,-1
-                int c = inter_mode_ctx_lut[s->above_mode_ctx[col + off[b->bs]]]
-                                          [s->left_mode_ctx[row7 + off[b->bs]]];
-
-                b->mode[0] = vp8_rac_get_tree(&s->c, ff_vp9_inter_mode_tree,
-                                              s->prob.p.mv_mode[c]);
-                b->mode[1] =
-                b->mode[2] =
-                b->mode[3] = b->mode[0];
-                s->counts.mv_mode[c][b->mode[0] - 10]++;
-            }
-        }
-
-        if (s->filtermode == FILTER_SWITCHABLE) {
-            int c;
-
-            if (have_a && s->above_mode_ctx[col] >= NEARESTMV) {
-                if (have_l && s->left_mode_ctx[row7] >= NEARESTMV) {
-                    c = s->above_filter_ctx[col] == s->left_filter_ctx[row7] ?
-                        s->left_filter_ctx[row7] : 3;
-                } else {
-                    c = s->above_filter_ctx[col];
-                }
-            } else if (have_l && s->left_mode_ctx[row7] >= NEARESTMV) {
-                c = s->left_filter_ctx[row7];
-            } else {
-                c = 3;
-            }
-
-            b->filter = vp8_rac_get_tree(&s->c, ff_vp9_filter_tree,
-                                         s->prob.p.filter[c]);
-            s->counts.filter[c][b->filter]++;
-        } else {
-            b->filter = s->filtermode;
-        }
-
-        if (b->bs > BS_8x8) {
-            int c = inter_mode_ctx_lut[s->above_mode_ctx[col]][s->left_mode_ctx[row7]];
-
-            b->mode[0] = vp8_rac_get_tree(&s->c, ff_vp9_inter_mode_tree,
-                                          s->prob.p.mv_mode[c]);
-            s->counts.mv_mode[c][b->mode[0] - 10]++;
-            ff_vp9_fill_mv(s, b->mv[0], b->mode[0], 0);
-
-            if (b->bs != BS_8x4) {
-                b->mode[1] = vp8_rac_get_tree(&s->c, ff_vp9_inter_mode_tree,
-                                              s->prob.p.mv_mode[c]);
-                s->counts.mv_mode[c][b->mode[1] - 10]++;
-                ff_vp9_fill_mv(s, b->mv[1], b->mode[1], 1);
-            } else {
-                b->mode[1] = b->mode[0];
-                AV_COPY32(&b->mv[1][0], &b->mv[0][0]);
-                AV_COPY32(&b->mv[1][1], &b->mv[0][1]);
-            }
-
-            if (b->bs != BS_4x8) {
-                b->mode[2] = vp8_rac_get_tree(&s->c, ff_vp9_inter_mode_tree,
-                                              s->prob.p.mv_mode[c]);
-                s->counts.mv_mode[c][b->mode[2] - 10]++;
-                ff_vp9_fill_mv(s, b->mv[2], b->mode[2], 2);
-
-                if (b->bs != BS_8x4) {
-                    b->mode[3] = vp8_rac_get_tree(&s->c, ff_vp9_inter_mode_tree,
-                                                  s->prob.p.mv_mode[c]);
-                    s->counts.mv_mode[c][b->mode[3] - 10]++;
-                    ff_vp9_fill_mv(s, b->mv[3], b->mode[3], 3);
-                } else {
-                    b->mode[3] = b->mode[2];
-                    AV_COPY32(&b->mv[3][0], &b->mv[2][0]);
-                    AV_COPY32(&b->mv[3][1], &b->mv[2][1]);
-                }
-            } else {
-                b->mode[2] = b->mode[0];
-                AV_COPY32(&b->mv[2][0], &b->mv[0][0]);
-                AV_COPY32(&b->mv[2][1], &b->mv[0][1]);
-                b->mode[3] = b->mode[1];
-                AV_COPY32(&b->mv[3][0], &b->mv[1][0]);
-                AV_COPY32(&b->mv[3][1], &b->mv[1][1]);
-            }
-        } else {
-            ff_vp9_fill_mv(s, b->mv[0], b->mode[0], -1);
-            AV_COPY32(&b->mv[1][0], &b->mv[0][0]);
-            AV_COPY32(&b->mv[2][0], &b->mv[0][0]);
-            AV_COPY32(&b->mv[3][0], &b->mv[0][0]);
-            AV_COPY32(&b->mv[1][1], &b->mv[0][1]);
-            AV_COPY32(&b->mv[2][1], &b->mv[0][1]);
-            AV_COPY32(&b->mv[3][1], &b->mv[0][1]);
-        }
-    }
-
-    // FIXME this can probably be optimized
-    memset(&s->above_skip_ctx[col], b->skip, w4);
-    memset(&s->left_skip_ctx[row7], b->skip, h4);
-    memset(&s->above_txfm_ctx[col], b->tx, w4);
-    memset(&s->left_txfm_ctx[row7], b->tx, h4);
-    memset(&s->above_partition_ctx[col], above_ctx[b->bs], w4);
-    memset(&s->left_partition_ctx[row7], left_ctx[b->bs], h4);
-    if (!s->keyframe && !s->intraonly) {
-        memset(&s->above_intra_ctx[col], b->intra, w4);
-        memset(&s->left_intra_ctx[row7], b->intra, h4);
-        memset(&s->above_comp_ctx[col], b->comp, w4);
-        memset(&s->left_comp_ctx[row7], b->comp, h4);
-        memset(&s->above_mode_ctx[col], b->mode[3], w4);
-        memset(&s->left_mode_ctx[row7], b->mode[3], h4);
-        if (s->filtermode == FILTER_SWITCHABLE && !b->intra) {
-            memset(&s->above_filter_ctx[col], b->filter, w4);
-            memset(&s->left_filter_ctx[row7], b->filter, h4);
-            b->filter = ff_vp9_filter_lut[b->filter];
-        }
-        if (b->bs > BS_8x8) {
-            int mv0 = AV_RN32A(&b->mv[3][0]), mv1 = AV_RN32A(&b->mv[3][1]);
-
-            AV_COPY32(&s->left_mv_ctx[row7 * 2 + 0][0], &b->mv[1][0]);
-            AV_COPY32(&s->left_mv_ctx[row7 * 2 + 0][1], &b->mv[1][1]);
-            AV_WN32A(&s->left_mv_ctx[row7 * 2 + 1][0], mv0);
-            AV_WN32A(&s->left_mv_ctx[row7 * 2 + 1][1], mv1);
-            AV_COPY32(&s->above_mv_ctx[col * 2 + 0][0], &b->mv[2][0]);
-            AV_COPY32(&s->above_mv_ctx[col * 2 + 0][1], &b->mv[2][1]);
-            AV_WN32A(&s->above_mv_ctx[col * 2 + 1][0], mv0);
-            AV_WN32A(&s->above_mv_ctx[col * 2 + 1][1], mv1);
-        } else {
-            int n, mv0 = AV_RN32A(&b->mv[3][0]), mv1 = AV_RN32A(&b->mv[3][1]);
-
-            for (n = 0; n < w4 * 2; n++) {
-                AV_WN32A(&s->above_mv_ctx[col * 2 + n][0], mv0);
-                AV_WN32A(&s->above_mv_ctx[col * 2 + n][1], mv1);
-            }
-            for (n = 0; n < h4 * 2; n++) {
-                AV_WN32A(&s->left_mv_ctx[row7 * 2 + n][0], mv0);
-                AV_WN32A(&s->left_mv_ctx[row7 * 2 + n][1], mv1);
-            }
-        }
-
-        if (!b->intra) { // FIXME write 0xff or -1 if intra, so we can use this
-                         // as a direct check in above branches
-            int vref = b->ref[b->comp ? s->signbias[s->varcompref[0]] : 0];
-
-            memset(&s->above_ref_ctx[col], vref, w4);
-            memset(&s->left_ref_ctx[row7], vref, h4);
-        }
-    }
-
-    // FIXME kinda ugly
-    for (y = 0; y < h4; y++) {
-        int x, o = (row + y) * s->sb_cols * 8 + col;
-
-        if (b->intra) {
-            for (x = 0; x < w4; x++) {
-                s->mv[0][o + x].ref[0] =
-                s->mv[0][o + x].ref[1] = -1;
-            }
-        } else if (b->comp) {
-            for (x = 0; x < w4; x++) {
-                s->mv[0][o + x].ref[0] = b->ref[0];
-                s->mv[0][o + x].ref[1] = b->ref[1];
-                AV_COPY32(&s->mv[0][o + x].mv[0], &b->mv[3][0]);
-                AV_COPY32(&s->mv[0][o + x].mv[1], &b->mv[3][1]);
-            }
-        } else {
-            for (x = 0; x < w4; x++) {
-                s->mv[0][o + x].ref[0] = b->ref[0];
-                s->mv[0][o + x].ref[1] = -1;
-                AV_COPY32(&s->mv[0][o + x].mv[0], &b->mv[3][0]);
-            }
-        }
-    }
-}
-
-// FIXME remove tx argument, and merge cnt/eob arguments?
-static int decode_block_coeffs(VP56RangeCoder *c, int16_t *coef, int n_coeffs,
-                               enum TxfmMode tx, unsigned (*cnt)[6][3],
-                               unsigned (*eob)[6][2], uint8_t(*p)[6][11],
-                               int nnz, const int16_t *scan,
-                               const int16_t(*nb)[2],
-                               const int16_t *band_counts, const int16_t *qmul)
-{
-    int i = 0, band = 0, band_left = band_counts[band];
-    uint8_t *tp = p[0][nnz];
-    uint8_t cache[1024];
-
-    do {
-        int val, rc;
-
-        val = vp56_rac_get_prob_branchy(c, tp[0]); // eob
-        eob[band][nnz][val]++;
-        if (!val)
-            break;
-
-skip_eob:
-        if (!vp56_rac_get_prob_branchy(c, tp[1])) { // zero
-            cnt[band][nnz][0]++;
-            if (!--band_left)
-                band_left = band_counts[++band];
-            cache[scan[i]] = 0;
-            nnz            = (1 + cache[nb[i][0]] + cache[nb[i][1]]) >> 1;
-            tp             = p[band][nnz];
-            if (++i == n_coeffs)
-                break;  //invalid input; blocks should end with EOB
-            goto skip_eob;
-        }
-
-        rc = scan[i];
-        if (!vp56_rac_get_prob_branchy(c, tp[2])) { // one
-            cnt[band][nnz][1]++;
-            val       = 1;
-            cache[rc] = 1;
-        } else {
-            // fill in p[3-10] (model fill) - only once per frame for each pos
-            if (!tp[3])
-                memcpy(&tp[3], ff_vp9_model_pareto8[tp[2]], 8);
-
-            cnt[band][nnz][2]++;
-            if (!vp56_rac_get_prob_branchy(c, tp[3])) { // 2, 3, 4
-                if (!vp56_rac_get_prob_branchy(c, tp[4])) {
-                    cache[rc] = val = 2;
-                } else {
-                    val       = 3 + vp56_rac_get_prob(c, tp[5]);
-                    cache[rc] = 3;
-                }
-            } else if (!vp56_rac_get_prob_branchy(c, tp[6])) { // cat1/2
-                cache[rc] = 4;
-                if (!vp56_rac_get_prob_branchy(c, tp[7])) {
-                    val  =  vp56_rac_get_prob(c, 159) + 5;
-                } else {
-                    val  = (vp56_rac_get_prob(c, 165) << 1) + 7;
-                    val +=  vp56_rac_get_prob(c, 145);
-                }
-            } else { // cat 3-6
-                cache[rc] = 5;
-                if (!vp56_rac_get_prob_branchy(c, tp[8])) {
-                    if (!vp56_rac_get_prob_branchy(c, tp[9])) {
-                        val  = (vp56_rac_get_prob(c, 173) << 2) + 11;
-                        val += (vp56_rac_get_prob(c, 148) << 1);
-                        val +=  vp56_rac_get_prob(c, 140);
-                    } else {
-                        val  = (vp56_rac_get_prob(c, 176) << 3) + 19;
-                        val += (vp56_rac_get_prob(c, 155) << 2);
-                        val += (vp56_rac_get_prob(c, 140) << 1);
-                        val +=  vp56_rac_get_prob(c, 135);
-                    }
-                } else if (!vp56_rac_get_prob_branchy(c, tp[10])) {
-                    val  = (vp56_rac_get_prob(c, 180) << 4) + 35;
-                    val += (vp56_rac_get_prob(c, 157) << 3);
-                    val += (vp56_rac_get_prob(c, 141) << 2);
-                    val += (vp56_rac_get_prob(c, 134) << 1);
-                    val +=  vp56_rac_get_prob(c, 130);
-                } else {
-                    val  = (vp56_rac_get_prob(c, 254) << 13) + 67;
-                    val += (vp56_rac_get_prob(c, 254) << 12);
-                    val += (vp56_rac_get_prob(c, 254) << 11);
-                    val += (vp56_rac_get_prob(c, 252) << 10);
-                    val += (vp56_rac_get_prob(c, 249) << 9);
-                    val += (vp56_rac_get_prob(c, 243) << 8);
-                    val += (vp56_rac_get_prob(c, 230) << 7);
-                    val += (vp56_rac_get_prob(c, 196) << 6);
-                    val += (vp56_rac_get_prob(c, 177) << 5);
-                    val += (vp56_rac_get_prob(c, 153) << 4);
-                    val += (vp56_rac_get_prob(c, 140) << 3);
-                    val += (vp56_rac_get_prob(c, 133) << 2);
-                    val += (vp56_rac_get_prob(c, 130) << 1);
-                    val +=  vp56_rac_get_prob(c, 129);
-                }
-            }
-        }
-        if (!--band_left)
-            band_left = band_counts[++band];
-        if (tx == TX_32X32) // FIXME slow
-            coef[rc] = ((vp8_rac_get(c) ? -val : val) * qmul[!!i]) / 2;
-        else
-            coef[rc] = (vp8_rac_get(c) ? -val : val) * qmul[!!i];
-        nnz = (1 + cache[nb[i][0]] + cache[nb[i][1]]) >> 1;
-        tp  = p[band][nnz];
-    } while (++i < n_coeffs);
-
-    return i;
-}
-
-static int decode_coeffs(AVCodecContext *avctx)
-{
-    VP9Context *s = avctx->priv_data;
-    VP9Block *const b = &s->b;
-    int row = b->row, col = b->col;
-    uint8_t (*p)[6][11] = s->prob.coef[b->tx][0 /* y */][!b->intra];
-    unsigned (*c)[6][3] = s->counts.coef[b->tx][0 /* y */][!b->intra];
-    unsigned (*e)[6][2] = s->counts.eob[b->tx][0 /* y */][!b->intra];
-    int w4 = bwh_tab[1][b->bs][0] << 1, h4 = bwh_tab[1][b->bs][1] << 1;
-    int end_x = FFMIN(2 * (s->cols - col), w4);
-    int end_y = FFMIN(2 * (s->rows - row), h4);
-    int n, pl, x, y, step1d = 1 << b->tx, step = 1 << (b->tx * 2);
-    int uvstep1d = 1 << b->uvtx, uvstep = 1 << (b->uvtx * 2), ret;
-    int16_t (*qmul)[2] = s->segmentation.feat[b->seg_id].qmul;
-    int tx = 4 * s->lossless + b->tx;
-    const int16_t **yscans = ff_vp9_scans[tx];
-    const int16_t (**ynbs)[2] = ff_vp9_scans_nb[tx];
-    const int16_t *uvscan = ff_vp9_scans[b->uvtx][DCT_DCT];
-    const int16_t (*uvnb)[2] = ff_vp9_scans_nb[b->uvtx][DCT_DCT];
-    uint8_t *a = &s->above_y_nnz_ctx[col * 2];
-    uint8_t *l = &s->left_y_nnz_ctx[(row & 7) << 1];
-    static const int16_t band_counts[4][8] = {
-        { 1, 2, 3, 4,  3,   16 - 13, 0 },
-        { 1, 2, 3, 4, 11,   64 - 21, 0 },
-        { 1, 2, 3, 4, 11,  256 - 21, 0 },
-        { 1, 2, 3, 4, 11, 1024 - 21, 0 },
-    };
-    const int16_t *y_band_counts  = band_counts[b->tx];
-    const int16_t *uv_band_counts = band_counts[b->uvtx];
-
-    /* y tokens */
-    if (b->tx > TX_4X4) { // FIXME slow
-        for (y = 0; y < end_y; y += step1d)
-            for (x = 1; x < step1d; x++)
-                l[y] |= l[y + x];
-        for (x = 0; x < end_x; x += step1d)
-            for (y = 1; y < step1d; y++)
-                a[x] |= a[x + y];
-    }
-    for (n = 0, y = 0; y < end_y; y += step1d) {
-        for (x = 0; x < end_x; x += step1d, n += step) {
-            enum TxfmType txtp = ff_vp9_intra_txfm_type[b->mode[b->tx == TX_4X4 &&
-                                                                b->bs > BS_8x8 ?
-                                                                n : 0]];
-            int nnz = a[x] + l[y];
-            if ((ret = decode_block_coeffs(&s->c, s->block + 16 * n, 16 * step,
-                                           b->tx, c, e, p, nnz, yscans[txtp],
-                                           ynbs[txtp], y_band_counts,
-                                           qmul[0])) < 0)
-                return ret;
-            a[x] = l[y] = !!ret;
-            if (b->tx > TX_8X8)
-                AV_WN16A(&s->eob[n], ret);
-            else
-                s->eob[n] = ret;
-        }
-    }
-    if (b->tx > TX_4X4) { // FIXME slow
-        for (y = 0; y < end_y; y += step1d)
-            memset(&l[y + 1], l[y], FFMIN(end_y - y - 1, step1d - 1));
-        for (x = 0; x < end_x; x += step1d)
-            memset(&a[x + 1], a[x], FFMIN(end_x - x - 1, step1d - 1));
-    }
-
-    p = s->prob.coef[b->uvtx][1 /* uv */][!b->intra];
-    c = s->counts.coef[b->uvtx][1 /* uv */][!b->intra];
-    e = s->counts.eob[b->uvtx][1 /* uv */][!b->intra];
-    w4    >>= 1;
-    h4    >>= 1;
-    end_x >>= 1;
-    end_y >>= 1;
-    for (pl = 0; pl < 2; pl++) {
-        a = &s->above_uv_nnz_ctx[pl][col];
-        l = &s->left_uv_nnz_ctx[pl][row & 7];
-        if (b->uvtx > TX_4X4) { // FIXME slow
-            for (y = 0; y < end_y; y += uvstep1d)
-                for (x = 1; x < uvstep1d; x++)
-                    l[y] |= l[y + x];
-            for (x = 0; x < end_x; x += uvstep1d)
-                for (y = 1; y < uvstep1d; y++)
-                    a[x] |= a[x + y];
-        }
-        for (n = 0, y = 0; y < end_y; y += uvstep1d) {
-            for (x = 0; x < end_x; x += uvstep1d, n += uvstep) {
-                int nnz = a[x] + l[y];
-                if ((ret = decode_block_coeffs(&s->c, s->uvblock[pl] + 16 * n,
-                                               16 * uvstep, b->uvtx, c, e, p,
-                                               nnz, uvscan, uvnb,
-                                               uv_band_counts, qmul[1])) < 0)
-                    return ret;
-                a[x] = l[y] = !!ret;
-                if (b->uvtx > TX_8X8)
-                    AV_WN16A(&s->uveob[pl][n], ret);
-                else
-                    s->uveob[pl][n] = ret;
-            }
-        }
-        if (b->uvtx > TX_4X4) { // FIXME slow
-            for (y = 0; y < end_y; y += uvstep1d)
-                memset(&l[y + 1], l[y], FFMIN(end_y - y - 1, uvstep1d - 1));
-            for (x = 0; x < end_x; x += uvstep1d)
-                memset(&a[x + 1], a[x], FFMIN(end_x - x - 1, uvstep1d - 1));
-        }
-    }
-
-    return 0;
-}
-
-static av_always_inline int check_intra_mode(VP9Context *s, int mode,
-                                             uint8_t **a,
-                                             uint8_t *dst_edge,
-                                             ptrdiff_t stride_edge,
-                                             uint8_t *dst_inner,
-                                             ptrdiff_t stride_inner,
-                                             uint8_t *l, int col, int x, int w,
-                                             int row, int y, enum TxfmMode tx,
-                                             int p)
-{
-    int have_top   = row > 0 || y > 0;
-    int have_left  = col > s->tiling.tile_col_start || x > 0;
-    int have_right = x < w - 1;
-    static const uint8_t mode_conv[10][2 /* have_left */][2 /* have_top */] = {
-        [VERT_PRED]            = { { DC_127_PRED,          VERT_PRED            },
-                                   { DC_127_PRED,          VERT_PRED            } },
-        [HOR_PRED]             = { { DC_129_PRED,          DC_129_PRED          },
-                                   { HOR_PRED,             HOR_PRED             } },
-        [DC_PRED]              = { { DC_128_PRED,          TOP_DC_PRED          },
-                                   { LEFT_DC_PRED,         DC_PRED              } },
-        [DIAG_DOWN_LEFT_PRED]  = { { DC_127_PRED,          DIAG_DOWN_LEFT_PRED  },
-                                   { DC_127_PRED,          DIAG_DOWN_LEFT_PRED  } },
-        [DIAG_DOWN_RIGHT_PRED] = { { DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_RIGHT_PRED },
-                                   { DIAG_DOWN_RIGHT_PRED, DIAG_DOWN_RIGHT_PRED } },
-        [VERT_RIGHT_PRED]      = { { VERT_RIGHT_PRED,      VERT_RIGHT_PRED      },
-                                   { VERT_RIGHT_PRED,      VERT_RIGHT_PRED      } },
-        [HOR_DOWN_PRED]        = { { HOR_DOWN_PRED,        HOR_DOWN_PRED        },
-                                   { HOR_DOWN_PRED,        HOR_DOWN_PRED        } },
-        [VERT_LEFT_PRED]       = { { DC_127_PRED,          VERT_LEFT_PRED       },
-                                   { DC_127_PRED,          VERT_LEFT_PRED       } },
-        [HOR_UP_PRED]          = { { DC_129_PRED,          DC_129_PRED          },
-                                   { HOR_UP_PRED,          HOR_UP_PRED          } },
-        [TM_VP8_PRED]          = { { DC_129_PRED,          VERT_PRED            },
-                                   { HOR_PRED,             TM_VP8_PRED          } },
-    };
-    static const struct {
-        uint8_t needs_left:1;
-        uint8_t needs_top:1;
-        uint8_t needs_topleft:1;
-        uint8_t needs_topright:1;
-    } edges[N_INTRA_PRED_MODES] = {
-        [VERT_PRED]            = { .needs_top  = 1 },
-        [HOR_PRED]             = { .needs_left = 1 },
-        [DC_PRED]              = { .needs_top  = 1, .needs_left = 1 },
-        [DIAG_DOWN_LEFT_PRED]  = { .needs_top  = 1, .needs_topright = 1 },
-        [DIAG_DOWN_RIGHT_PRED] = { .needs_left = 1, .needs_top = 1,
-                                   .needs_topleft = 1 },
-        [VERT_RIGHT_PRED]      = { .needs_left = 1, .needs_top = 1,
-                                   .needs_topleft = 1 },
-        [HOR_DOWN_PRED]        = { .needs_left = 1, .needs_top = 1,
-                                   .needs_topleft = 1 },
-        [VERT_LEFT_PRED]       = { .needs_top  = 1, .needs_topright = 1 },
-        [HOR_UP_PRED]          = { .needs_left = 1 },
-        [TM_VP8_PRED]          = { .needs_left = 1, .needs_top = 1,
-                                   .needs_topleft = 1 },
-        [LEFT_DC_PRED]         = { .needs_left = 1 },
-        [TOP_DC_PRED]          = { .needs_top  = 1 },
-        [DC_128_PRED]          = { 0 },
-        [DC_127_PRED]          = { 0 },
-        [DC_129_PRED]          = { 0 }
-    };
-
-    av_assert2(mode >= 0 && mode < 10);
-    mode = mode_conv[mode][have_left][have_top];
-    if (edges[mode].needs_top) {
-        uint8_t *top = NULL, *topleft = NULL;
-        int n_px_need = 4 << tx, n_px_have = (((s->cols - col) << !p) - x) * 4;
-        int n_px_need_tr = 0;
-
-        if (tx == TX_4X4 && edges[mode].needs_topright && have_right)
-            n_px_need_tr = 4;
-
-        // if top of sb64-row, use s->intra_pred_data[] instead of
-        // dst[-stride] for intra prediction (it contains pre- instead of
-        // post-loopfilter data)
-        if (have_top) {
-            top = !(row & 7) && !y ?
-                  s->intra_pred_data[p] + col * (8 >> !!p) + x * 4 :
-                  y == 0 ? &dst_edge[-stride_edge] : &dst_inner[-stride_inner];
-            if (have_left)
-                topleft = !(row & 7) && !y ?
-                          s->intra_pred_data[p] + col * (8 >> !!p) + x * 4 :
-                          y == 0 || x == 0 ? &dst_edge[-stride_edge] :
-                          &dst_inner[-stride_inner];
-        }
-
-        if (have_top &&
-            (!edges[mode].needs_topleft || (have_left && top == topleft)) &&
-            (tx != TX_4X4 || !edges[mode].needs_topright || have_right) &&
-            n_px_need + n_px_need_tr <= n_px_have) {
-            *a = top;
-        } else {
-            if (have_top) {
-                if (n_px_need <= n_px_have) {
-                    memcpy(*a, top, n_px_need);
-                } else {
-                    memcpy(*a, top, n_px_have);
-                    memset(&(*a)[n_px_have], (*a)[n_px_have - 1],
-                           n_px_need - n_px_have);
-                }
-            } else {
-                memset(*a, 127, n_px_need);
-            }
-            if (edges[mode].needs_topleft) {
-                if (have_left && have_top)
-                    (*a)[-1] = topleft[-1];
-                else
-                    (*a)[-1] = have_top ? 129 : 127;
-            }
-            if (tx == TX_4X4 && edges[mode].needs_topright) {
-                if (have_top && have_right &&
-                    n_px_need + n_px_need_tr <= n_px_have) {
-                    memcpy(&(*a)[4], &top[4], 4);
-                } else {
-                    memset(&(*a)[4], (*a)[3], 4);
-                }
-            }
-        }
-    }
-    if (edges[mode].needs_left) {
-        if (have_left) {
-            int i;
-            int n_px_need = 4 << tx;
-            int n_px_have = (((s->rows - row) << !p) - y) * 4;
-            uint8_t *dst     = x == 0 ? dst_edge : dst_inner;
-            ptrdiff_t stride = x == 0 ? stride_edge : stride_inner;
-
-            if (n_px_need <= n_px_have) {
-                for (i = 0; i < n_px_need; i++)
-                    l[i] = dst[i * stride - 1];
-            } else {
-                for (i = 0; i < n_px_have; i++)
-                    l[i] = dst[i * stride - 1];
-                memset(&l[i], l[i - 1], n_px_need - n_px_have);
-            }
-        } else {
-            memset(l, 129, 4 << tx);
-        }
-    }
-
-    return mode;
-}
-
-static void intra_recon(AVCodecContext *avctx, ptrdiff_t y_off, ptrdiff_t uv_off)
-{
-    VP9Context *s = avctx->priv_data;
-    VP9Block *const b = &s->b;
-    int row = b->row, col = b->col;
-    int w4 = bwh_tab[1][b->bs][0] << 1, step1d = 1 << b->tx, n;
-    int h4 = bwh_tab[1][b->bs][1] << 1, x, y, step = 1 << (b->tx * 2);
-    int end_x = FFMIN(2 * (s->cols - col), w4);
-    int end_y = FFMIN(2 * (s->rows - row), h4);
-    int tx = 4 * s->lossless + b->tx, uvtx = b->uvtx + 4 * s->lossless;
-    int uvstep1d = 1 << b->uvtx, p;
-    uint8_t *dst = b->dst[0], *dst_r = s->cur_frame->data[0] + y_off;
-
-    for (n = 0, y = 0; y < end_y; y += step1d) {
-        uint8_t *ptr = dst, *ptr_r = dst_r;
-        for (x = 0; x < end_x;
-             x += step1d, ptr += 4 * step1d, ptr_r += 4 * step1d, n += step) {
-            int mode = b->mode[b->bs > BS_8x8 && b->tx == TX_4X4 ?
-                               y * 2 + x : 0];
-            LOCAL_ALIGNED_16(uint8_t, a_buf, [48]);
-            uint8_t *a = &a_buf[16], l[32];
-            enum TxfmType txtp = ff_vp9_intra_txfm_type[mode];
-            int eob = b->tx > TX_8X8 ? AV_RN16A(&s->eob[n]) : s->eob[n];
-
-            mode = check_intra_mode(s, mode, &a, ptr_r,
-                                    s->cur_frame->linesize[0],
-                                    ptr, b->y_stride, l,
-                                    col, x, w4, row, y, b->tx, 0);
-            s->dsp.intra_pred[b->tx][mode](ptr, b->y_stride, l, a);
-            if (eob)
-                s->dsp.itxfm_add[tx][txtp](ptr, b->y_stride,
-                                           s->block + 16 * n, eob);
-        }
-        dst_r += 4 * s->cur_frame->linesize[0] * step1d;
-        dst   += 4 * b->y_stride * step1d;
-    }
-
-    // U/V
-    h4    >>= 1;
-    w4    >>= 1;
-    end_x >>= 1;
-    end_y >>= 1;
-    step    = 1 << (b->uvtx * 2);
-    for (p = 0; p < 2; p++) {
-        dst   = b->dst[1 + p];
-        dst_r = s->cur_frame->data[1 + p] + uv_off;
-        for (n = 0, y = 0; y < end_y; y += uvstep1d) {
-            uint8_t *ptr = dst, *ptr_r = dst_r;
-            for (x = 0; x < end_x;
-                 x += uvstep1d, ptr += 4 * uvstep1d,
-                 ptr_r += 4 * uvstep1d, n += step) {
-                int mode = b->uvmode;
-                LOCAL_ALIGNED_16(uint8_t, a_buf, [48]);
-                uint8_t *a = &a_buf[16], l[32];
-                int eob    = b->uvtx > TX_8X8 ? AV_RN16A(&s->uveob[p][n])
-                                              : s->uveob[p][n];
-
-                mode = check_intra_mode(s, mode, &a, ptr_r,
-                                        s->cur_frame->linesize[1],
-                                        ptr, b->uv_stride, l,
-                                        col, x, w4, row, y, b->uvtx, p + 1);
-                s->dsp.intra_pred[b->uvtx][mode](ptr, b->uv_stride, l, a);
-                if (eob)
-                    s->dsp.itxfm_add[uvtx][DCT_DCT](ptr, b->uv_stride,
-                                                    s->uvblock[p] + 16 * n,
-                                                    eob);
-            }
-            dst_r += 4 * uvstep1d * s->cur_frame->linesize[1];
-            dst   += 4 * uvstep1d * b->uv_stride;
-        }
-    }
-}
-
-static av_always_inline void mc_luma_dir(VP9Context *s, vp9_mc_func(*mc)[2],
-                                         uint8_t *dst, ptrdiff_t dst_stride,
-                                         const uint8_t *ref,
-                                         ptrdiff_t ref_stride,
-                                         ptrdiff_t y, ptrdiff_t x,
-                                         const VP56mv *mv,
-                                         int bw, int bh, int w, int h)
-{
-    int mx = mv->x, my = mv->y;
-
-    y   += my >> 3;
-    x   += mx >> 3;
-    ref += y * ref_stride + x;
-    mx  &= 7;
-    my  &= 7;
-    // FIXME bilinear filter only needs 0/1 pixels, not 3/4
-    if (x < !!mx * 3 || y < !!my * 3 ||
-        x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
-                                 ref - !!my * 3 * ref_stride - !!mx * 3,
-                                 80,
-                                 ref_stride,
-                                 bw + !!mx * 7, bh + !!my * 7,
-                                 x - !!mx * 3, y - !!my * 3, w, h);
-        ref        = s->edge_emu_buffer + !!my * 3 * 80 + !!mx * 3;
-        ref_stride = 80;
-    }
-    mc[!!mx][!!my](dst, ref, dst_stride, ref_stride, bh, mx << 1, my << 1);
-}
-
-static av_always_inline void mc_chroma_dir(VP9Context *s, vp9_mc_func(*mc)[2],
-                                           uint8_t *dst_u, uint8_t *dst_v,
-                                           ptrdiff_t dst_stride,
-                                           const uint8_t *ref_u,
-                                           ptrdiff_t src_stride_u,
-                                           const uint8_t *ref_v,
-                                           ptrdiff_t src_stride_v,
-                                           ptrdiff_t y, ptrdiff_t x,
-                                           const VP56mv *mv,
-                                           int bw, int bh, int w, int h)
-{
-    int mx = mv->x, my = mv->y;
-
-    y     += my >> 4;
-    x     += mx >> 4;
-    ref_u += y * src_stride_u + x;
-    ref_v += y * src_stride_v + x;
-    mx    &= 15;
-    my    &= 15;
-    // FIXME bilinear filter only needs 0/1 pixels, not 3/4
-    if (x < !!mx * 3 || y < !!my * 3 ||
-        x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
-                                 ref_u - !!my * 3 * src_stride_u - !!mx * 3,
-                                 80,
-                                 src_stride_u,
-                                 bw + !!mx * 7, bh + !!my * 7,
-                                 x - !!mx * 3, y - !!my * 3, w, h);
-        ref_u = s->edge_emu_buffer + !!my * 3 * 80 + !!mx * 3;
-        mc[!!mx][!!my](dst_u, ref_u, dst_stride, 80, bh, mx, my);
-
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
-                                 ref_v - !!my * 3 * src_stride_v - !!mx * 3,
-                                 80,
-                                 src_stride_v,
-                                 bw + !!mx * 7, bh + !!my * 7,
-                                 x - !!mx * 3, y - !!my * 3, w, h);
-        ref_v = s->edge_emu_buffer + !!my * 3 * 80 + !!mx * 3;
-        mc[!!mx][!!my](dst_v, ref_v, dst_stride, 80, bh, mx, my);
-    } else {
-        mc[!!mx][!!my](dst_u, ref_u, dst_stride, src_stride_u, bh, mx, my);
-        mc[!!mx][!!my](dst_v, ref_v, dst_stride, src_stride_v, bh, mx, my);
-    }
-}
-
-static int inter_recon(AVCodecContext *avctx)
-{
-    static const uint8_t bwlog_tab[2][N_BS_SIZES] = {
-        { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
-        { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 },
-    };
-    VP9Context *s = avctx->priv_data;
-    VP9Block *const b = &s->b;
-    int row = b->row, col = b->col;
-    AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]];
-    AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL;
-    int w = avctx->width, h = avctx->height;
-    ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride;
-
-    if (!ref1->data[0] || (b->comp && !ref2->data[0]))
-        return AVERROR_INVALIDDATA;
-
-    // y inter pred
-    if (b->bs > BS_8x8) {
-        if (b->bs == BS_8x4) {
-            mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y,
-                        ref1->data[0], ref1->linesize[0],
-                        row << 3, col << 3, &b->mv[0][0], 8, 4, w, h);
-            mc_luma_dir(s, s->dsp.mc[3][b->filter][0],
-                        b->dst[0] + 4 * ls_y, ls_y,
-                        ref1->data[0], ref1->linesize[0],
-                        (row << 3) + 4, col << 3, &b->mv[2][0], 8, 4, w, h);
-
-            if (b->comp) {
-                mc_luma_dir(s, s->dsp.mc[3][b->filter][1], b->dst[0], ls_y,
-                            ref2->data[0], ref2->linesize[0],
-                            row << 3, col << 3, &b->mv[0][1], 8, 4, w, h);
-                mc_luma_dir(s, s->dsp.mc[3][b->filter][1],
-                            b->dst[0] + 4 * ls_y, ls_y,
-                            ref2->data[0], ref2->linesize[0],
-                            (row << 3) + 4, col << 3, &b->mv[2][1], 8, 4, w, h);
-            }
-        } else if (b->bs == BS_4x8) {
-            mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y,
-                        ref1->data[0], ref1->linesize[0],
-                        row << 3, col << 3, &b->mv[0][0], 4, 8, w, h);
-            mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4, ls_y,
-                        ref1->data[0], ref1->linesize[0],
-                        row << 3, (col << 3) + 4, &b->mv[1][0], 4, 8, w, h);
-
-            if (b->comp) {
-                mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y,
-                            ref2->data[0], ref2->linesize[0],
-                            row << 3, col << 3, &b->mv[0][1], 4, 8, w, h);
-                mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4, ls_y,
-                            ref2->data[0], ref2->linesize[0],
-                            row << 3, (col << 3) + 4, &b->mv[1][1], 4, 8, w, h);
-            }
-        } else {
-            av_assert2(b->bs == BS_4x4);
-
-            // FIXME if two horizontally adjacent blocks have the same MV,
-            // do a w8 instead of a w4 call
-            mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y,
-                        ref1->data[0], ref1->linesize[0],
-                        row << 3, col << 3, &b->mv[0][0], 4, 4, w, h);
-            mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4, ls_y,
-                        ref1->data[0], ref1->linesize[0],
-                        row << 3, (col << 3) + 4, &b->mv[1][0], 4, 4, w, h);
-            mc_luma_dir(s, s->dsp.mc[4][b->filter][0],
-                        b->dst[0] + 4 * ls_y, ls_y,
-                        ref1->data[0], ref1->linesize[0],
-                        (row << 3) + 4, col << 3, &b->mv[2][0], 4, 4, w, h);
-            mc_luma_dir(s, s->dsp.mc[4][b->filter][0],
-                        b->dst[0] + 4 * ls_y + 4, ls_y,
-                        ref1->data[0], ref1->linesize[0],
-                        (row << 3) + 4, (col << 3) + 4, &b->mv[3][0], 4, 4, w, h);
-
-            if (b->comp) {
-                mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y,
-                            ref2->data[0], ref2->linesize[0],
-                            row << 3, col << 3, &b->mv[0][1], 4, 4, w, h);
-                mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4, ls_y,
-                            ref2->data[0], ref2->linesize[0],
-                            row << 3, (col << 3) + 4, &b->mv[1][1], 4, 4, w, h);
-                mc_luma_dir(s, s->dsp.mc[4][b->filter][1],
-                            b->dst[0] + 4 * ls_y, ls_y,
-                            ref2->data[0], ref2->linesize[0],
-                            (row << 3) + 4, col << 3, &b->mv[2][1], 4, 4, w, h);
-                mc_luma_dir(s, s->dsp.mc[4][b->filter][1],
-                            b->dst[0] + 4 * ls_y + 4, ls_y,
-                            ref2->data[0], ref2->linesize[0],
-                            (row << 3) + 4, (col << 3) + 4, &b->mv[3][1], 4, 4, w, h);
-            }
-        }
-    } else {
-        int bwl = bwlog_tab[0][b->bs];
-        int bw  = bwh_tab[0][b->bs][0] * 4;
-        int bh  = bwh_tab[0][b->bs][1] * 4;
-
-        mc_luma_dir(s, s->dsp.mc[bwl][b->filter][0], b->dst[0], ls_y,
-                    ref1->data[0], ref1->linesize[0],
-                    row << 3, col << 3, &b->mv[0][0], bw, bh, w, h);
-
-        if (b->comp)
-            mc_luma_dir(s, s->dsp.mc[bwl][b->filter][1], b->dst[0], ls_y,
-                        ref2->data[0], ref2->linesize[0],
-                        row << 3, col << 3, &b->mv[0][1], bw, bh, w, h);
-    }
-
-    // uv inter pred
-    {
-        int bwl = bwlog_tab[1][b->bs];
-        int bw  = bwh_tab[1][b->bs][0] * 4, bh = bwh_tab[1][b->bs][1] * 4;
-        VP56mv mvuv;
-
-        w = (w + 1) >> 1;
-        h = (h + 1) >> 1;
-        if (b->bs > BS_8x8) {
-            mvuv.x = ROUNDED_DIV(b->mv[0][0].x + b->mv[1][0].x +
-                                 b->mv[2][0].x + b->mv[3][0].x, 4);
-            mvuv.y = ROUNDED_DIV(b->mv[0][0].y + b->mv[1][0].y +
-                                 b->mv[2][0].y + b->mv[3][0].y, 4);
-        } else {
-            mvuv = b->mv[0][0];
-        }
-
-        mc_chroma_dir(s, s->dsp.mc[bwl][b->filter][0],
-                      b->dst[1], b->dst[2], ls_uv,
-                      ref1->data[1], ref1->linesize[1],
-                      ref1->data[2], ref1->linesize[2],
-                      row << 2, col << 2, &mvuv, bw, bh, w, h);
-
-        if (b->comp) {
-            if (b->bs > BS_8x8) {
-                mvuv.x = ROUNDED_DIV(b->mv[0][1].x + b->mv[1][1].x +
-                                     b->mv[2][1].x + b->mv[3][1].x, 4);
-                mvuv.y = ROUNDED_DIV(b->mv[0][1].y + b->mv[1][1].y +
-                                     b->mv[2][1].y + b->mv[3][1].y, 4);
-            } else {
-                mvuv = b->mv[0][1];
-            }
-            mc_chroma_dir(s, s->dsp.mc[bwl][b->filter][1],
-                          b->dst[1], b->dst[2], ls_uv,
-                          ref2->data[1], ref2->linesize[1],
-                          ref2->data[2], ref2->linesize[2],
-                          row << 2, col << 2, &mvuv, bw, bh, w, h);
-        }
-    }
-
-    if (!b->skip) {
-        /* mostly copied intra_reconn() */
-
-        int w4 = bwh_tab[1][b->bs][0] << 1, step1d = 1 << b->tx, n;
-        int h4 = bwh_tab[1][b->bs][1] << 1, x, y, step = 1 << (b->tx * 2);
-        int end_x = FFMIN(2 * (s->cols - col), w4);
-        int end_y = FFMIN(2 * (s->rows - row), h4);
-        int tx = 4 * s->lossless + b->tx, uvtx = b->uvtx + 4 * s->lossless;
-        int uvstep1d = 1 << b->uvtx, p;
-        uint8_t *dst = b->dst[0];
-
-        // y itxfm add
-        for (n = 0, y = 0; y < end_y; y += step1d) {
-            uint8_t *ptr = dst;
-            for (x = 0; x < end_x; x += step1d, ptr += 4 * step1d, n += step) {
-                int eob = b->tx > TX_8X8 ? AV_RN16A(&s->eob[n]) : s->eob[n];
-
-                if (eob)
-                    s->dsp.itxfm_add[tx][DCT_DCT](ptr, b->y_stride,
-                                                  s->block + 16 * n, eob);
-            }
-            dst += 4 * b->y_stride * step1d;
-        }
-
-        // uv itxfm add
-        h4    >>= 1;
-        w4    >>= 1;
-        end_x >>= 1;
-        end_y >>= 1;
-        step    = 1 << (b->uvtx * 2);
-        for (p = 0; p < 2; p++) {
-            dst = b->dst[p + 1];
-            for (n = 0, y = 0; y < end_y; y += uvstep1d) {
-                uint8_t *ptr = dst;
-                for (x = 0; x < end_x; x += uvstep1d, ptr += 4 * uvstep1d, n += step) {
-                    int eob = b->uvtx > TX_8X8 ? AV_RN16A(&s->uveob[p][n])
-                                               : s->uveob[p][n];
-                    if (eob)
-                        s->dsp.itxfm_add[uvtx][DCT_DCT](ptr, b->uv_stride,
-                                                        s->uvblock[p] + 16 * n, eob);
-                }
-                dst += 4 * uvstep1d * b->uv_stride;
-            }
-        }
-    }
-    return 0;
-}
-
-static av_always_inline void mask_edges(VP9Filter *lflvl, int is_uv,
-                                        int row_and_7, int col_and_7,
-                                        int w, int h, int col_end, int row_end,
-                                        enum TxfmMode tx, int skip_inter)
-{
-    // FIXME I'm pretty sure all loops can be replaced by a single LUT if
-    // we make VP9Filter.mask uint64_t (i.e. row/col all single variable)
-    // and make the LUT 5-indexed (bl, bp, is_uv, tx and row/col), and then
-    // use row_and_7/col_and_7 as shifts (1*col_and_7+8*row_and_7)
-
-    // the intended behaviour of the vp9 loopfilter is to work on 8-pixel
-    // edges. This means that for UV, we work on two subsampled blocks at
-    // a time, and we only use the topleft block's mode information to set
-    // things like block strength. Thus, for any block size smaller than
-    // 16x16, ignore the odd portion of the block.
-    if (tx == TX_4X4 && is_uv) {
-        if (h == 1) {
-            if (row_and_7 & 1)
-                return;
-            if (!row_end)
-                h += 1;
-        }
-        if (w == 1) {
-            if (col_and_7 & 1)
-                return;
-            if (!col_end)
-                w += 1;
-        }
-    }
-
-    if (tx == TX_4X4 && !skip_inter) {
-        int t = 1 << col_and_7, m_col = (t << w) - t, y;
-        int m_col_odd = (t << (w - 1)) - t;
-
-        // on 32-px edges, use the 8-px wide loopfilter; else, use 4-px wide
-        if (is_uv) {
-            int m_row_8 = m_col & 0x01, m_row_4 = m_col - m_row_8;
-
-            for (y = row_and_7; y < h + row_and_7; y++) {
-                int col_mask_id = 2 - !(y & 7);
-
-                lflvl->mask[is_uv][0][y][1] |= m_row_8;
-                lflvl->mask[is_uv][0][y][2] |= m_row_4;
-                // for odd lines, if the odd col is not being filtered,
-                // skip odd row also:
-                // .---. <-- a
-                // |   |
-                // |___| <-- b
-                // ^   ^
-                // c   d
-                //
-                // if a/c are even row/col and b/d are odd, and d is skipped,
-                // e.g. right edge of size-66x66.webm, then skip b also (bug)
-                if ((col_end & 1) && (y & 1)) {
-                    lflvl->mask[is_uv][1][y][col_mask_id] |= m_col_odd;
-                } else {
-                    lflvl->mask[is_uv][1][y][col_mask_id] |= m_col;
-                }
-            }
-        } else {
-            int m_row_8 = m_col & 0x11, m_row_4 = m_col - m_row_8;
-
-            for (y = row_and_7; y < h + row_and_7; y++) {
-                int col_mask_id = 2 - !(y & 3);
-
-                lflvl->mask[is_uv][0][y][1]           |= m_row_8; // row edge
-                lflvl->mask[is_uv][0][y][2]           |= m_row_4;
-                lflvl->mask[is_uv][1][y][col_mask_id] |= m_col; // col edge
-                lflvl->mask[is_uv][0][y][3]           |= m_col;
-                lflvl->mask[is_uv][1][y][3]           |= m_col;
-            }
-        }
-    } else {
-        int y, t = 1 << col_and_7, m_col = (t << w) - t;
-
-        if (!skip_inter) {
-            int mask_id = (tx == TX_8X8);
-            int l2 = tx + is_uv - 1, step1d = 1 << l2;
-            static const unsigned masks[4] = { 0xff, 0x55, 0x11, 0x01 };
-            int m_row = m_col & masks[l2];
-
-            // at odd UV col/row edges tx16/tx32 loopfilter edges, force
-            // 8wd loopfilter to prevent going off the visible edge.
-            if (is_uv && tx > TX_8X8 && (w ^ (w - 1)) == 1) {
-                int m_row_16 = ((t << (w - 1)) - t) & masks[l2];
-                int m_row_8  = m_row - m_row_16;
-
-                for (y = row_and_7; y < h + row_and_7; y++) {
-                    lflvl->mask[is_uv][0][y][0] |= m_row_16;
-                    lflvl->mask[is_uv][0][y][1] |= m_row_8;
-                }
-            } else {
-                for (y = row_and_7; y < h + row_and_7; y++)
-                    lflvl->mask[is_uv][0][y][mask_id] |= m_row;
-            }
-
-            if (is_uv && tx > TX_8X8 && (h ^ (h - 1)) == 1) {
-                for (y = row_and_7; y < h + row_and_7 - 1; y += step1d)
-                    lflvl->mask[is_uv][1][y][0] |= m_col;
-                if (y - row_and_7 == h - 1)
-                    lflvl->mask[is_uv][1][y][1] |= m_col;
-            } else {
-                for (y = row_and_7; y < h + row_and_7; y += step1d)
-                    lflvl->mask[is_uv][1][y][mask_id] |= m_col;
-            }
-        } else if (tx != TX_4X4) {
-            int mask_id;
-
-            mask_id = (tx == TX_8X8) || (is_uv && h == 1);
-            lflvl->mask[is_uv][1][row_and_7][mask_id] |= m_col;
-            mask_id = (tx == TX_8X8) || (is_uv && w == 1);
-            for (y = row_and_7; y < h + row_and_7; y++)
-                lflvl->mask[is_uv][0][y][mask_id] |= t;
-        } else if (is_uv) {
-            int t8 = t & 0x01, t4 = t - t8;
-
-            for (y = row_and_7; y < h + row_and_7; y++) {
-                lflvl->mask[is_uv][0][y][2] |= t4;
-                lflvl->mask[is_uv][0][y][1] |= t8;
-            }
-            lflvl->mask[is_uv][1][row_and_7][2 - !(row_and_7 & 7)] |= m_col;
-        } else {
-            int t8 = t & 0x11, t4 = t - t8;
-
-            for (y = row_and_7; y < h + row_and_7; y++) {
-                lflvl->mask[is_uv][0][y][2] |= t4;
-                lflvl->mask[is_uv][0][y][1] |= t8;
-            }
-            lflvl->mask[is_uv][1][row_and_7][2 - !(row_and_7 & 3)] |= m_col;
-        }
-    }
-}
-
-int ff_vp9_decode_block(AVCodecContext *avctx, int row, int col,
-                        VP9Filter *lflvl, ptrdiff_t yoff, ptrdiff_t uvoff,
-                        enum BlockLevel bl, enum BlockPartition bp)
-{
-    VP9Context *s = avctx->priv_data;
-    VP9Block *const b = &s->b;
-    enum BlockSize bs = bl * 3 + bp;
-    int ret, y, w4 = bwh_tab[1][bs][0], h4 = bwh_tab[1][bs][1], lvl;
-    int emu[2];
-
-    b->row  = row;
-    b->row7 = row & 7;
-    b->col  = col;
-    b->col7 = col & 7;
-
-    s->min_mv.x = -(128 + col * 64);
-    s->min_mv.y = -(128 + row * 64);
-    s->max_mv.x = 128 + (s->cols - col - w4) * 64;
-    s->max_mv.y = 128 + (s->rows - row - h4) * 64;
-
-    b->bs = bs;
-    decode_mode(s, b);
-    b->uvtx = b->tx - (w4 * 2 == (1 << b->tx) || h4 * 2 == (1 << b->tx));
-
-    if (!b->skip) {
-        if ((ret = decode_coeffs(avctx)) < 0)
-            return ret;
-    } else {
-        int pl;
-
-        memset(&s->above_y_nnz_ctx[col * 2], 0, w4 * 2);
-        memset(&s->left_y_nnz_ctx[(row & 7) << 1], 0, h4 * 2);
-        for (pl = 0; pl < 2; pl++) {
-            memset(&s->above_uv_nnz_ctx[pl][col], 0, w4);
-            memset(&s->left_uv_nnz_ctx[pl][row & 7], 0, h4);
-        }
-    }
-
-    /* Emulated overhangs if the stride of the target buffer can't hold.
-     * This allows to support emu-edge and so on even if we have large
-     * block overhangs. */
-    emu[0] = (col + w4) * 8 > s->cur_frame->linesize[0] ||
-             (row + h4) > s->rows;
-    emu[1] = (col + w4) * 4 > s->cur_frame->linesize[1] ||
-             (row + h4) > s->rows;
-    if (emu[0]) {
-        b->dst[0]   = s->tmp_y;
-        b->y_stride = 64;
-    } else {
-        b->dst[0]   = s->cur_frame->data[0] + yoff;
-        b->y_stride = s->cur_frame->linesize[0];
-    }
-    if (emu[1]) {
-        b->dst[1]    = s->tmp_uv[0];
-        b->dst[2]    = s->tmp_uv[1];
-        b->uv_stride = 32;
-    } else {
-        b->dst[1]    = s->cur_frame->data[1] + uvoff;
-        b->dst[2]    = s->cur_frame->data[2] + uvoff;
-        b->uv_stride = s->cur_frame->linesize[1];
-    }
-    if (b->intra) {
-        intra_recon(avctx, yoff, uvoff);
-    } else {
-        if ((ret = inter_recon(avctx)) < 0)
-            return ret;
-    }
-    if (emu[0]) {
-        int w = FFMIN(s->cols - col, w4) * 8;
-        int h = FFMIN(s->rows - row, h4) * 8;
-        int n, o = 0;
-
-        for (n = 0; o < w; n++) {
-            int bw = 64 >> n;
-
-            av_assert2(n <= 4);
-            if (w & bw) {
-                s->dsp.mc[n][0][0][0][0](s->cur_frame->data[0] + yoff + o,
-                                         s->tmp_y + o,
-                                         s->cur_frame->linesize[0],
-                                         64, h, 0, 0);
-                o += bw;
-            }
-        }
-    }
-    if (emu[1]) {
-        int w = FFMIN(s->cols - col, w4) * 4;
-        int h = FFMIN(s->rows - row, h4) * 4;
-        int n, o = 0;
-
-        for (n = 1; o < w; n++) {
-            int bw = 64 >> n;
-
-            av_assert2(n <= 4);
-            if (w & bw) {
-                s->dsp.mc[n][0][0][0][0](s->cur_frame->data[1] + uvoff + o,
-                                         s->tmp_uv[0] + o,
-                                         s->cur_frame->linesize[1],
-                                         32, h, 0, 0);
-                s->dsp.mc[n][0][0][0][0](s->cur_frame->data[2] + uvoff + o,
-                                         s->tmp_uv[1] + o,
-                                         s->cur_frame->linesize[2],
-                                         32, h, 0, 0);
-                o += bw;
-            }
-        }
-    }
-
-    // pick filter level and find edges to apply filter to
-    if (s->filter.level &&
-        (lvl = s->segmentation.feat[b->seg_id].lflvl[b->intra ? 0 : b->ref[0] + 1]
-                                                    [b->mode[3] != ZEROMV]) > 0) {
-        int x_end = FFMIN(s->cols - col, w4);
-        int y_end = FFMIN(s->rows - row, h4);
-        int skip_inter = !b->intra && b->skip;
-
-        for (y = 0; y < h4; y++)
-            memset(&lflvl->level[((row & 7) + y) * 8 + (col & 7)], lvl, w4);
-        mask_edges(lflvl, 0, row & 7, col & 7, x_end, y_end, 0, 0, b->tx, skip_inter);
-        mask_edges(lflvl, 1, row & 7, col & 7, x_end, y_end,
-                   s->cols & 1 && col + w4 >= s->cols ? s->cols & 7 : 0,
-                   s->rows & 1 && row + h4 >= s->rows ? s->rows & 7 : 0,
-                   b->uvtx, skip_inter);
-
-        if (!s->filter.lim_lut[lvl]) {
-            int sharp = s->filter.sharpness;
-            int limit = lvl;
-
-            if (sharp > 0) {
-                limit >>= (sharp + 3) >> 2;
-                limit   = FFMIN(limit, 9 - sharp);
-            }
-            limit = FFMAX(limit, 1);
-
-            s->filter.lim_lut[lvl]   = limit;
-            s->filter.mblim_lut[lvl] = 2 * (lvl + 2) + limit;
-        }
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/vp9data.c b/deps/libav/libavcodec/vp9data.c
deleted file mode 100644
index 374fa8b..0000000
--- a/deps/libav/libavcodec/vp9data.c
+++ /dev/null
@@ -1,2133 +0,0 @@
-/*
- * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
- * Copyright (C) 2013 Clément Bœsch <u pkh me>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "vp9.h"
-#include "vp9data.h"
-
-const int8_t ff_vp9_partition_tree[3][2] = {
-    { -PARTITION_NONE,                1 }, // '0'
-    {    -PARTITION_H,                2 }, // '10'
-    {    -PARTITION_V, -PARTITION_SPLIT }, // '110', '111'
-};
-
-const uint8_t ff_vp9_default_kf_partition_probs[4][4][3] = {
-    { /* 64x64 -> 32x32 */
-        { 174,  35,  49 } /* a/l both not split */,
-        {  68,  11,  27 } /* a split, l not split */,
-        {  57,  15,   9 } /* l split, a not split */,
-        {  12,   3,   3 } /* a/l both split */
-    }, { /* 32x32 -> 16x16 */
-        { 150,  40,  39 } /* a/l both not split */,
-        {  78,  12,  26 } /* a split, l not split */,
-        {  67,  33,  11 } /* l split, a not split */,
-        {  24,   7,   5 } /* a/l both split */,
-    }, { /* 16x16 -> 8x8 */
-        { 149,  53,  53 } /* a/l both not split */,
-        {  94,  20,  48 } /* a split, l not split */,
-        {  83,  53,  24 } /* l split, a not split */,
-        {  52,  18,  18 } /* a/l both split */,
-    }, { /* 8x8 -> 4x4 */
-        { 158,  97,  94 } /* a/l both not split */,
-        {  93,  24,  99 } /* a split, l not split */,
-        {  85, 119,  44 } /* l split, a not split */,
-        {  62,  59,  67 } /* a/l both split */,
-    },
-};
-
-const int8_t ff_vp9_segmentation_tree[7][2] = {
-    {  1,  2 },
-    {  3,  4 },
-    {  5,  6 },
-    { -0, -1 }, // '00x'
-    { -2, -3 }, // '01x'
-    { -4, -5 }, // '10x'
-    { -6, -7 }, // '11x'
-};
-
-const int8_t ff_vp9_intramode_tree[9][2] = {
-    {              -DC_PRED,                1 }, // '0'
-    {          -TM_VP8_PRED,                2 }, // '10'
-    {            -VERT_PRED,                3 }, // '110'
-    {                     4,                6 },
-    {             -HOR_PRED,                5 }, // '11100'
-    { -DIAG_DOWN_RIGHT_PRED, -VERT_RIGHT_PRED }, // '11101x'
-    {  -DIAG_DOWN_LEFT_PRED,                7 }, // '11110'
-    {       -VERT_LEFT_PRED,                8 }, // '111110'
-    {        -HOR_DOWN_PRED,     -HOR_UP_PRED }, // '111111x'
-};
-
-const uint8_t ff_vp9_default_kf_ymode_probs[10][10][9] = {
-    { /* above = v */
-        {  43,  46, 168, 134, 107, 128,  69, 142,  92 } /* left = v */,
-        {  44,  29,  68, 159, 201, 177,  50,  57,  77 } /* left = h */,
-        {  63,  36, 126, 146, 123, 158,  60,  90,  96 } /* left = dc */,
-        {  58,  38,  76, 114,  97, 172,  78, 133,  92 } /* left = d45 */,
-        {  46,  41,  76, 140,  63, 184,  69, 112,  57 } /* left = d135 */,
-        {  38,  32,  85, 140,  46, 112,  54, 151, 133 } /* left = d117 */,
-        {  39,  27,  61, 131, 110, 175,  44,  75, 136 } /* left = d153 */,
-        {  47,  35,  80, 100,  74, 143,  64, 163,  74 } /* left = d63 */,
-        {  52,  30,  74, 113, 130, 175,  51,  64,  58 } /* left = d27 */,
-        {  36,  61, 116, 114, 128, 162,  80, 125,  82 } /* left = tm */
-    }, { /* above = h */
-        {  55,  44,  68, 166, 179, 192,  57,  57, 108 } /* left = v */,
-        {  42,  26,  11, 199, 241, 228,  23,  15,  85 } /* left = h */,
-        {  82,  26,  26, 171, 208, 204,  44,  32, 105 } /* left = dc */,
-        {  68,  42,  19, 131, 160, 199,  55,  52,  83 } /* left = d45 */,
-        {  58,  50,  25, 139, 115, 232,  39,  52, 118 } /* left = d135 */,
-        {  50,  35,  33, 153, 104, 162,  64,  59, 131 } /* left = d117 */,
-        {  44,  24,  16, 150, 177, 202,  33,  19, 156 } /* left = d153 */,
-        {  53,  49,  21, 110, 116, 168,  59,  80,  76 } /* left = d63 */,
-        {  55,  27,  12, 153, 203, 218,  26,  27,  49 } /* left = d27 */,
-        {  38,  72,  19, 168, 203, 212,  50,  50, 107 } /* left = tm */
-    }, { /* above = dc */
-        {  92,  45, 102, 136, 116, 180,  74,  90, 100 } /* left = v */,
-        {  73,  32,  19, 187, 222, 215,  46,  34, 100 } /* left = h */,
-        { 137,  30,  42, 148, 151, 207,  70,  52,  91 } /* left = dc */,
-        {  91,  30,  32, 116, 121, 186,  93,  86,  94 } /* left = d45 */,
-        {  72,  35,  36, 149,  68, 206,  68,  63, 105 } /* left = d135 */,
-        {  73,  31,  28, 138,  57, 124,  55, 122, 151 } /* left = d117 */,
-        {  67,  23,  21, 140, 126, 197,  40,  37, 171 } /* left = d153 */,
-        {  74,  32,  27, 107,  86, 160,  63, 134, 102 } /* left = d63 */,
-        {  86,  27,  28, 128, 154, 212,  45,  43,  53 } /* left = d27 */,
-        {  59,  67,  44, 140, 161, 202,  78,  67, 119 } /* left = tm */
-    }, { /* above = d45 */
-        {  59,  38,  83, 112, 103, 162,  98, 136,  90 } /* left = v */,
-        {  62,  30,  23, 158, 200, 207,  59,  57,  50 } /* left = h */,
-        { 103,  26,  36, 129, 132, 201,  83,  80,  93 } /* left = dc */,
-        {  67,  30,  29,  84,  86, 191, 102,  91,  59 } /* left = d45 */,
-        {  60,  32,  33, 112,  71, 220,  64,  89, 104 } /* left = d135 */,
-        {  53,  26,  34, 130,  56, 149,  84, 120, 103 } /* left = d117 */,
-        {  53,  21,  23, 133, 109, 210,  56,  77, 172 } /* left = d153 */,
-        {  61,  29,  29,  93,  97, 165,  83, 175, 162 } /* left = d63 */,
-        {  77,  19,  29, 112, 142, 228,  55,  66,  36 } /* left = d27 */,
-        {  47,  47,  43, 114, 137, 181, 100,  99,  95 } /* left = tm */
-    }, { /* above = d135 */
-        {  53,  40,  55, 139,  69, 183,  61,  80, 110 } /* left = v */,
-        {  40,  29,  19, 161, 180, 207,  43,  24,  91 } /* left = h */,
-        {  69,  23,  29, 128,  83, 199,  46,  44, 101 } /* left = dc */,
-        {  60,  34,  19, 105,  61, 198,  53,  64,  89 } /* left = d45 */,
-        {  52,  31,  22, 158,  40, 209,  58,  62,  89 } /* left = d135 */,
-        {  44,  31,  29, 147,  46, 158,  56, 102, 198 } /* left = d117 */,
-        {  35,  19,  12, 135,  87, 209,  41,  45, 167 } /* left = d153 */,
-        {  51,  38,  25, 113,  58, 164,  70,  93,  97 } /* left = d63 */,
-        {  55,  25,  21, 118,  95, 215,  38,  39,  66 } /* left = d27 */,
-        {  47,  54,  34, 146, 108, 203,  72, 103, 151 } /* left = tm */
-    }, { /* above = d117 */
-        {  46,  27,  80, 150,  55, 124,  55, 121, 135 } /* left = v */,
-        {  36,  23,  27, 165, 149, 166,  54,  64, 118 } /* left = h */,
-        {  64,  19,  37, 156,  66, 138,  49,  95, 133 } /* left = dc */,
-        {  53,  21,  36, 131,  63, 163,  60, 109,  81 } /* left = d45 */,
-        {  40,  26,  35, 154,  40, 185,  51,  97, 123 } /* left = d135 */,
-        {  35,  19,  34, 179,  19,  97,  48, 129, 124 } /* left = d117 */,
-        {  36,  20,  26, 136,  62, 164,  33,  77, 154 } /* left = d153 */,
-        {  45,  26,  28, 129,  45, 129,  49, 147, 123 } /* left = d63 */,
-        {  45,  18,  32, 130,  90, 157,  40,  79,  91 } /* left = d27 */,
-        {  38,  44,  51, 136,  74, 162,  57,  97, 121 } /* left = tm */
-    }, { /* above = d153 */
-        {  56,  39,  58, 133, 117, 173,  48,  53, 187 } /* left = v */,
-        {  35,  21,  12, 161, 212, 207,  20,  23, 145 } /* left = h */,
-        {  75,  17,  22, 136, 138, 185,  32,  34, 166 } /* left = dc */,
-        {  56,  29,  19, 117, 109, 181,  55,  68, 112 } /* left = d45 */,
-        {  47,  29,  17, 153,  64, 220,  59,  51, 114 } /* left = d135 */,
-        {  46,  16,  24, 136,  76, 147,  41,  64, 172 } /* left = d117 */,
-        {  34,  17,  11, 108, 152, 187,  13,  15, 209 } /* left = d153 */,
-        {  55,  30,  18, 122,  79, 179,  44,  88, 116 } /* left = d63 */,
-        {  51,  24,  14, 115, 133, 209,  32,  26, 104 } /* left = d27 */,
-        {  37,  49,  25, 129, 168, 164,  41,  54, 148 } /* left = tm */
-    }, { /* above = d63 */
-        {  48,  34,  86, 101,  92, 146,  78, 179, 134 } /* left = v */,
-        {  47,  22,  24, 138, 187, 178,  68,  69,  59 } /* left = h */,
-        {  78,  23,  39, 111, 117, 170,  74, 124,  94 } /* left = dc */,
-        {  56,  25,  33, 105, 112, 187,  95, 177, 129 } /* left = d45 */,
-        {  48,  31,  27, 114,  63, 183,  82, 116,  56 } /* left = d135 */,
-        {  43,  28,  37, 121,  63, 123,  61, 192, 169 } /* left = d117 */,
-        {  42,  17,  24, 109,  97, 177,  56,  76, 122 } /* left = d153 */,
-        {  46,  23,  32,  74,  86, 150,  67, 183,  88 } /* left = d63 */,
-        {  58,  18,  28, 105, 139, 182,  70,  92,  63 } /* left = d27 */,
-        {  36,  38,  48,  92, 122, 165,  88, 137,  91 } /* left = tm */
-    }, { /* above = d27 */
-        {  62,  44,  61, 123, 105, 189,  48,  57,  64 } /* left = v */,
-        {  47,  25,  17, 175, 222, 220,  24,  30,  86 } /* left = h */,
-        {  82,  22,  32, 127, 143, 213,  39,  41,  70 } /* left = dc */,
-        {  68,  36,  17, 106, 102, 206,  59,  74,  74 } /* left = d45 */,
-        {  57,  39,  23, 151,  68, 216,  55,  63,  58 } /* left = d135 */,
-        {  49,  30,  35, 141,  70, 168,  82,  40, 115 } /* left = d117 */,
-        {  51,  25,  15, 136, 129, 202,  38,  35, 139 } /* left = d153 */,
-        {  59,  39,  19, 114,  75, 180,  77, 104,  42 } /* left = d63 */,
-        {  68,  26,  16, 111, 141, 215,  29,  28,  28 } /* left = d27 */,
-        {  40,  61,  26, 126, 152, 206,  61,  59,  93 } /* left = tm */
-    }, { /* above = tm */
-        {  44,  78, 115, 132, 119, 173,  71, 112,  93 } /* left = v */,
-        {  39,  38,  21, 184, 227, 206,  42,  32,  64 } /* left = h */,
-        {  65,  70,  60, 155, 159, 199,  61,  60,  81 } /* left = dc */,
-        {  58,  47,  36, 124, 137, 193,  80,  82,  78 } /* left = d45 */,
-        {  49,  50,  35, 144,  95, 205,  63,  78,  59 } /* left = d135 */,
-        {  41,  53,  52, 148,  71, 142,  65, 128,  51 } /* left = d117 */,
-        {  40,  36,  28, 143, 143, 202,  40,  55, 137 } /* left = d153 */,
-        {  42,  44,  44, 104, 105, 164,  64, 130,  80 } /* left = d63 */,
-        {  52,  34,  29, 129, 183, 227,  42,  35,  43 } /* left = d27 */,
-        {  43,  81,  53, 140, 169, 204,  68,  84,  72 } /* left = tm */
-    }
-};
-
-const uint8_t ff_vp9_default_kf_uvmode_probs[10][9] = {
-    { 118,  15, 123, 148, 131, 101,  44,  93, 131 } /* y = v */,
-    { 113,  12,  23, 188, 226, 142,  26,  32, 125 } /* y = h */,
-    { 144,  11,  54, 157, 195, 130,  46,  58, 108 } /* y = dc */,
-    { 120,  11,  50, 123, 163, 135,  64,  77, 103 } /* y = d45 */,
-    { 113,   9,  36, 155, 111, 157,  32,  44, 161 } /* y = d135 */,
-    { 116,   9,  55, 176,  76,  96,  37,  61, 149 } /* y = d117 */,
-    { 115,   9,  28, 141, 161, 167,  21,  25, 193 } /* y = d153 */,
-    { 116,  12,  64, 120, 140, 125,  49, 115, 121 } /* y = d63 */,
-    { 120,  12,  32, 145, 195, 142,  32,  38,  86 } /* y = d27 */,
-    { 102,  19,  66, 162, 182, 122,  35,  59, 128 } /* y = tm */
-};
-
-const int8_t ff_vp9_inter_mode_tree[3][2] = {
-    {    -ZEROMV,      1 }, // '0'
-    { -NEARESTMV,      2 }, // '10'
-    {    -NEARMV, -NEWMV }, // '11x'
-};
-
-const int8_t ff_vp9_filter_tree[2][2] = {
-    { -0,  1 },  // '0'
-    { -1, -2 },  // '1x'
-};
-
-const enum FilterMode ff_vp9_filter_lut[3] = {
-    FILTER_8TAP_REGULAR,
-    FILTER_8TAP_SMOOTH,
-    FILTER_8TAP_SHARP,
-};
-
-const int16_t ff_vp9_dc_qlookup[256] = {
-       4,    8,    8,    9,   10,   11,   12,   12,
-      13,   14,   15,   16,   17,   18,   19,   19,
-      20,   21,   22,   23,   24,   25,   26,   26,
-      27,   28,   29,   30,   31,   32,   32,   33,
-      34,   35,   36,   37,   38,   38,   39,   40,
-      41,   42,   43,   43,   44,   45,   46,   47,
-      48,   48,   49,   50,   51,   52,   53,   53,
-      54,   55,   56,   57,   57,   58,   59,   60,
-      61,   62,   62,   63,   64,   65,   66,   66,
-      67,   68,   69,   70,   70,   71,   72,   73,
-      74,   74,   75,   76,   77,   78,   78,   79,
-      80,   81,   81,   82,   83,   84,   85,   85,
-      87,   88,   90,   92,   93,   95,   96,   98,
-      99,  101,  102,  104,  105,  107,  108,  110,
-     111,  113,  114,  116,  117,  118,  120,  121,
-     123,  125,  127,  129,  131,  134,  136,  138,
-     140,  142,  144,  146,  148,  150,  152,  154,
-     156,  158,  161,  164,  166,  169,  172,  174,
-     177,  180,  182,  185,  187,  190,  192,  195,
-     199,  202,  205,  208,  211,  214,  217,  220,
-     223,  226,  230,  233,  237,  240,  243,  247,
-     250,  253,  257,  261,  265,  269,  272,  276,
-     280,  284,  288,  292,  296,  300,  304,  309,
-     313,  317,  322,  326,  330,  335,  340,  344,
-     349,  354,  359,  364,  369,  374,  379,  384,
-     389,  395,  400,  406,  411,  417,  423,  429,
-     435,  441,  447,  454,  461,  467,  475,  482,
-     489,  497,  505,  513,  522,  530,  539,  549,
-     559,  569,  579,  590,  602,  614,  626,  640,
-     654,  668,  684,  700,  717,  736,  755,  775,
-     796,  819,  843,  869,  896,  925,  955,  988,
-    1022, 1058, 1098, 1139, 1184, 1232, 1282, 1336,
-};
-
-const int16_t ff_vp9_ac_qlookup[256] = {
-       4,    8,    9,   10,   11,   12,   13,   14,
-      15,   16,   17,   18,   19,   20,   21,   22,
-      23,   24,   25,   26,   27,   28,   29,   30,
-      31,   32,   33,   34,   35,   36,   37,   38,
-      39,   40,   41,   42,   43,   44,   45,   46,
-      47,   48,   49,   50,   51,   52,   53,   54,
-      55,   56,   57,   58,   59,   60,   61,   62,
-      63,   64,   65,   66,   67,   68,   69,   70,
-      71,   72,   73,   74,   75,   76,   77,   78,
-      79,   80,   81,   82,   83,   84,   85,   86,
-      87,   88,   89,   90,   91,   92,   93,   94,
-      95,   96,   97,   98,   99,  100,  101,  102,
-     104,  106,  108,  110,  112,  114,  116,  118,
-     120,  122,  124,  126,  128,  130,  132,  134,
-     136,  138,  140,  142,  144,  146,  148,  150,
-     152,  155,  158,  161,  164,  167,  170,  173,
-     176,  179,  182,  185,  188,  191,  194,  197,
-     200,  203,  207,  211,  215,  219,  223,  227,
-     231,  235,  239,  243,  247,  251,  255,  260,
-     265,  270,  275,  280,  285,  290,  295,  300,
-     305,  311,  317,  323,  329,  335,  341,  347,
-     353,  359,  366,  373,  380,  387,  394,  401,
-     408,  416,  424,  432,  440,  448,  456,  465,
-     474,  483,  492,  501,  510,  520,  530,  540,
-     550,  560,  571,  582,  593,  604,  615,  627,
-     639,  651,  663,  676,  689,  702,  715,  729,
-     743,  757,  771,  786,  801,  816,  832,  848,
-     864,  881,  898,  915,  933,  951,  969,  988,
-    1007, 1026, 1046, 1066, 1087, 1108, 1129, 1151,
-    1173, 1196, 1219, 1243, 1267, 1292, 1317, 1343,
-    1369, 1396, 1423, 1451, 1479, 1508, 1537, 1567,
-    1597, 1628, 1660, 1692, 1725, 1759, 1793, 1828,
-};
-
-const enum TxfmType ff_vp9_intra_txfm_type[14] = {
-    [VERT_PRED]            = ADST_DCT,
-    [HOR_PRED]             = DCT_ADST,
-    [DC_PRED]              = DCT_DCT,
-    [DIAG_DOWN_LEFT_PRED]  = DCT_DCT,
-    [DIAG_DOWN_RIGHT_PRED] = ADST_ADST,
-    [VERT_RIGHT_PRED]      = ADST_DCT,
-    [HOR_DOWN_PRED]        = DCT_ADST,
-    [VERT_LEFT_PRED]       = ADST_DCT,
-    [HOR_UP_PRED]          = DCT_ADST,
-    [TM_VP8_PRED]          = ADST_ADST,
-    [NEARESTMV]            = DCT_DCT,
-    [NEARMV]               = DCT_DCT,
-    [ZEROMV]               = DCT_DCT,
-    [NEWMV]                = DCT_DCT,
-};
-
-const int16_t ff_vp9_default_scan_4x4[16] = {
-     0,  1,  4,  5,
-     2,  8,  3,  6,
-    12,  9,  7, 10,
-    13, 11, 14, 15,
-};
-
-const int16_t ff_vp9_col_scan_4x4[16] = {
-     0,  1,  2,  4,
-     3,  5,  6,  8,
-     7,  9, 10, 12,
-    13, 11, 14, 15,
-};
-
-const int16_t ff_vp9_row_scan_4x4[16] = {
-     0,  4,  1,  8,
-     5, 12,  9,  2,
-     6, 13,  3, 10,
-     7, 14, 11, 15,
-};
-
-const int16_t ff_vp9_default_scan_8x8[64] = {
-     0,  1,  8,  2,  9, 16, 10,  3,
-    17, 24, 18, 11,  4, 25, 32, 19,
-    12, 26,  5, 33, 20, 27, 40, 13,
-    34,  6, 41, 28, 21, 35, 42, 48,
-    14,  7, 36, 29, 43, 56, 49, 22,
-    15, 37, 50, 44, 57, 30, 23, 51,
-    45, 58, 38, 31, 52, 59, 39, 46,
-    53, 60, 47, 54, 61, 55, 62, 63,
-};
-
-const int16_t ff_vp9_col_scan_8x8[64] = {
-     0,  1,  2,  8,  3,  9,  4, 10,
-    16,  5, 11, 17, 12, 18,  6, 24,
-    19, 13, 25,  7, 26, 20, 32, 14,
-    27, 21, 33, 28, 34, 15, 22, 35,
-    40, 29, 41, 36, 23, 30, 42, 37,
-    48, 43, 31, 44, 49, 38, 50, 56,
-    45, 39, 51, 57, 52, 46, 58, 53,
-    59, 47, 60, 54, 61, 55, 62, 63,
-};
-
-const int16_t ff_vp9_row_scan_8x8[64] = {
-     0,  8, 16,  1,  9, 24,  2, 17,
-    32, 10, 25,  3, 40, 18, 11, 33,
-    26, 19,  4, 48, 41, 34, 12, 27,
-    56, 20,  5, 42, 35, 13, 49, 28,
-     6, 21, 43, 36, 14, 50, 29, 57,
-     7, 44, 22, 37, 51, 15, 58, 30,
-    23, 45, 52, 38, 59, 31, 46, 53,
-    39, 60, 47, 61, 54, 62, 55, 63,
-};
-
-const int16_t ff_vp9_default_scan_16x16[256] = {
-      0,   1,  16,   2,  17,  32,   3,  18,  33,  48,   4,  34,  19,  49,  20,   5,
-     35,  64,  50,  36,  65,  21,   6,  51,  80,  66,  37,  22,  52,   7,  81,  67,
-     38,  82,  53,  23,  96,  68,   8,  83,  97,  54,  39,  69, 112,  24,  98,  84,
-     70,  55,   9,  40,  85,  99, 113, 128,  25, 114, 100,  71,  86,  56,  10,  41,
-    115, 101, 129, 116,  72,  87,  26, 130, 144, 102,  57,  11,  42, 117, 131, 145,
-     88, 103,  27,  73, 132, 118, 146,  58, 160,  12,  43, 133, 147, 104,  89, 119,
-    161,  74, 148, 134,  28, 162,  59,  13, 176, 120, 149,  90, 135, 105, 163,  44,
-     75, 177, 164,  29, 150, 121, 136, 178, 165,  14, 106,  60,  91, 151,  45, 179,
-    192, 137, 166, 122,  76, 180, 152,  30,  61,  15, 107, 167, 181, 193,  92, 208,
-     46, 138, 123, 153, 194,  77, 168, 182,  31, 195, 209, 183, 108, 139,  62, 154,
-     47, 196,  93, 169, 210, 197, 224, 124, 184, 211,  78, 109, 170, 155,  63, 198,
-    212, 185, 225, 240, 140,  94, 199, 125,  79, 213, 226, 171, 186, 156, 214, 200,
-    110, 227, 141,  95, 241, 215, 228, 201, 126, 242, 187, 172, 157, 229, 111, 216,
-    243, 142, 202, 230, 127, 217, 244, 173, 188, 231, 158, 203, 143, 245, 218, 232,
-    189, 246, 159, 174, 233, 247, 219, 204, 175, 190, 248, 234, 205, 220, 249, 191,
-    235, 221, 250, 206, 222, 251, 236, 207, 237, 223, 252, 238, 253, 239, 254, 255,
-};
-
-const int16_t ff_vp9_col_scan_16x16[256] = {
-      0,   1,   2,   3,  16,   4,  17,   5,  18,   6,  19,  32,  20,   7,  33,  21,
-     34,   8,  35,  22,  48,  36,   9,  49,  23,  50,  37,  10,  38,  51,  24,  64,
-     52,  11,  65,  39,  25,  53,  66,  54,  40,  67,  12,  80,  26,  68,  55,  81,
-     41,  69,  13,  27,  82,  56,  70,  83,  42,  14,  84,  96,  71,  28,  57,  85,
-     97,  15,  72,  98,  43,  86,  58,  99,  29,  87, 100, 112,  73,  44, 101,  59,
-     30, 113,  88, 114,  74, 128, 102,  45,  31, 115,  60, 103,  89, 116,  75, 129,
-    117,  46, 104,  90,  61, 130, 118, 131, 132, 105,  76,  47, 119, 144,  91,  62,
-    133, 106, 145, 120, 146, 134,  77, 147, 121,  92, 135, 148,  63, 107, 136, 122,
-     93, 149, 160,  78, 150, 137, 108, 161, 162, 151, 123,  79, 138, 163, 152,  94,
-    164, 109, 165, 153, 124, 139, 176, 166,  95, 177, 167, 110, 154, 178, 125, 179,
-    140, 168, 155, 111, 180, 192, 181, 169, 141, 126, 182, 193, 194, 156, 183, 170,
-    195, 127, 142, 196, 184, 208, 197, 157, 171, 143, 185, 198, 209, 199, 210, 172,
-    158, 186, 211, 224, 212, 200, 240, 159, 213, 225, 187, 201, 173, 226, 214, 215,
-    227, 202, 228, 188, 241, 216, 174, 229, 242, 203, 243, 217, 230, 175, 189, 244,
-    231, 204, 218, 232, 245, 219, 246, 190, 233, 205, 191, 247, 234, 248, 220, 206,
-    249, 235, 221, 207, 250, 236, 222, 251, 223, 237, 238, 252, 239, 253, 254, 255,
-};
-
-const int16_t ff_vp9_row_scan_16x16[256] = {
-      0,  16,  32,   1,  48,  17,  64,  33,   2,  80,  18,  49,  96,  34,   3,  65,
-     19, 112,  50,  81,  35,   4, 128,  66,  20,  97,  51,  82,   5, 144,  36,  67,
-    113,  98,  21,  52, 160,  83, 129,  37,  68,   6, 114, 176,  99,  53,  22,  84,
-    145,  38,  69, 130,   7, 115, 192, 100,  54,  23,  85, 161, 146, 131,  39,  70,
-    208, 116,   8, 101, 177,  55,  86,  24, 162, 147, 132,  71, 224, 117,  40, 102,
-      9, 148,  56,  87, 193, 163, 240, 133, 178,  25, 118,  72,  41, 103, 164,  10,
-    149,  88, 134, 209, 179,  57, 119, 194,  26,  73, 165, 150, 104,  42, 135,  11,
-    180, 120,  89, 225, 195,  58,  27, 210, 151, 181, 166,  74,  43, 105,  12, 136,
-     90,  59, 241, 121,  28, 196, 167, 211, 152,  44, 182, 137,  75,  13, 226, 106,
-    122,  60, 197,  91, 168,  29, 183, 153,  14,  76, 212, 138,  45, 107,  15, 198,
-     92, 227, 169,  30, 123, 154,  61, 242, 184, 213, 139,  46,  77,  31, 108, 170,
-    199, 185, 124, 228,  93, 155, 214,  62, 140, 243,  78,  47, 200, 109, 186, 171,
-    201,  94,  63, 215, 229, 156,  79, 125, 141, 110, 216, 187, 172, 244, 202, 230,
-    217,  95, 157, 126, 245, 111, 142, 231, 188, 127, 158, 218, 173, 232, 246, 233,
-    203, 143, 247, 174, 189, 159, 219, 204, 248, 234, 249, 175, 190, 220, 205, 250,
-    235, 191, 221, 251, 236, 206, 252, 222, 207, 237, 223, 253, 238, 254, 239, 255,
-};
-
-const int16_t ff_vp9_default_scan_32x32[1024] = {
-       0,    1,   32,    2,   33,   64,    3,   34,   65,    4,   96,   35,   66,    5,   36,   97,
-      67,  128,   98,   68,   37,    6,  129,   99,    7,  160,   69,   38,  130,  100,  161,  131,
-      39,   70,    8,  101,  162,  132,  192,   71,   40,    9,  102,  163,  133,  193,   72,  224,
-     103,   41,  164,   10,  194,  134,  165,   73,  104,  135,  225,   42,  195,   11,  256,  166,
-     226,  196,   74,  105,  136,   43,   12,  167,  197,  227,  257,   75,  106,  137,  228,   44,
-     198,  168,  258,  288,   13,  229,   76,  107,  199,  138,  259,  169,  289,   45,  230,  260,
-     200,  108,   14,  170,  139,  320,  290,   77,  231,  261,   46,  201,  140,  291,  109,  232,
-     321,  262,  171,   78,  292,   15,  322,  202,  263,  352,  172,  293,  233,  141,  323,  110,
-      47,  203,  264,  234,  294,  353,  324,   16,   79,  204,  265,  295,  325,  173,  354,  142,
-     235,  384,   48,  296,  111,  266,  355,  326,   80,   17,  205,  236,  174,  356,  385,  327,
-     143,  297,  267,  357,  386,  112,   49,  328,  298,  206,  416,  237,  358,  387,   81,  175,
-      18,  329,  359,  388,  299,  330,  389,  113,  417,  238,  360,   50,  207,  418,  390,  331,
-      19,  448,  361,   82,  419,  391,  239,   51,  362,  420,  114,  449,  480,  421,   83,  363,
-     450,  422,  512,  451,  423,  115,  452,  481,  453,  482,  454,  544,  483,  455,  513,  484,
-     514,  485,  515,  486,  545,  576,  487,  546,  547,  608,  577,  578,  579,  609,  610,  611,
-      20,  144,  268,  392,  516,  640,   21,   52,  145,  176,  269,  300,  393,  424,  517,  548,
-     641,  672,   22,   53,   84,  146,  177,  208,  270,  301,  332,  394,  425,  456,  518,  549,
-     580,  642,  673,  704,   23,   54,   85,  116,  147,  178,  209,  240,  271,  302,  333,  364,
-     395,  426,  457,  488,  519,  550,  581,  612,  643,  674,  705,  736,   55,   86,  117,  179,
-     210,  241,  303,  334,  365,  427,  458,  489,  551,  582,  613,  675,  706,  737,   87,  118,
-     211,  242,  335,  366,  459,  490,  583,  614,  707,  738,  119,  243,  367,  491,  615,  739,
-      24,  148,  272,  396,  520,  644,  768,   25,   56,  149,  180,  273,  304,  397,  428,  521,
-     552,  645,  676,  769,  800,   26,   57,   88,  150,  181,  212,  274,  305,  336,  398,  429,
-     460,  522,  553,  584,  646,  677,  708,  770,  801,  832,   27,   58,   89,  120,  151,  182,
-     213,  244,  275,  306,  337,  368,  399,  430,  461,  492,  523,  554,  585,  616,  647,  678,
-     709,  740,  771,  802,  833,  864,   59,   90,  121,  183,  214,  245,  307,  338,  369,  431,
-     462,  493,  555,  586,  617,  679,  710,  741,  803,  834,  865,   91,  122,  215,  246,  339,
-     370,  463,  494,  587,  618,  711,  742,  835,  866,  123,  247,  371,  495,  619,  743,  867,
-      28,  152,  276,  400,  524,  648,  772,  896,   29,   60,  153,  184,  277,  308,  401,  432,
-     525,  556,  649,  680,  773,  804,  897,  928,   30,   61,   92,  154,  185,  216,  278,  309,
-     340,  402,  433,  464,  526,  557,  588,  650,  681,  712,  774,  805,  836,  898,  929,  960,
-      31,   62,   93,  124,  155,  186,  217,  248,  279,  310,  341,  372,  403,  434,  465,  496,
-     527,  558,  589,  620,  651,  682,  713,  744,  775,  806,  837,  868,  899,  930,  961,  992,
-      63,   94,  125,  187,  218,  249,  311,  342,  373,  435,  466,  497,  559,  590,  621,  683,
-     714,  745,  807,  838,  869,  931,  962,  993,   95,  126,  219,  250,  343,  374,  467,  498,
-     591,  622,  715,  746,  839,  870,  963,  994,  127,  251,  375,  499,  623,  747,  871,  995,
-     156,  280,  404,  528,  652,  776,  900,  157,  188,  281,  312,  405,  436,  529,  560,  653,
-     684,  777,  808,  901,  932,  158,  189,  220,  282,  313,  344,  406,  437,  468,  530,  561,
-     592,  654,  685,  716,  778,  809,  840,  902,  933,  964,  159,  190,  221,  252,  283,  314,
-     345,  376,  407,  438,  469,  500,  531,  562,  593,  624,  655,  686,  717,  748,  779,  810,
-     841,  872,  903,  934,  965,  996,  191,  222,  253,  315,  346,  377,  439,  470,  501,  563,
-     594,  625,  687,  718,  749,  811,  842,  873,  935,  966,  997,  223,  254,  347,  378,  471,
-     502,  595,  626,  719,  750,  843,  874,  967,  998,  255,  379,  503,  627,  751,  875,  999,
-     284,  408,  532,  656,  780,  904,  285,  316,  409,  440,  533,  564,  657,  688,  781,  812,
-     905,  936,  286,  317,  348,  410,  441,  472,  534,  565,  596,  658,  689,  720,  782,  813,
-     844,  906,  937,  968,  287,  318,  349,  380,  411,  442,  473,  504,  535,  566,  597,  628,
-     659,  690,  721,  752,  783,  814,  845,  876,  907,  938,  969, 1000,  319,  350,  381,  443,
-     474,  505,  567,  598,  629,  691,  722,  753,  815,  846,  877,  939,  970, 1001,  351,  382,
-     475,  506,  599,  630,  723,  754,  847,  878,  971, 1002,  383,  507,  631,  755,  879, 1003,
-     412,  536,  660,  784,  908,  413,  444,  537,  568,  661,  692,  785,  816,  909,  940,  414,
-     445,  476,  538,  569,  600,  662,  693,  724,  786,  817,  848,  910,  941,  972,  415,  446,
-     477,  508,  539,  570,  601,  632,  663,  694,  725,  756,  787,  818,  849,  880,  911,  942,
-     973, 1004,  447,  478,  509,  571,  602,  633,  695,  726,  757,  819,  850,  881,  943,  974,
-    1005,  479,  510,  603,  634,  727,  758,  851,  882,  975, 1006,  511,  635,  759,  883, 1007,
-     540,  664,  788,  912,  541,  572,  665,  696,  789,  820,  913,  944,  542,  573,  604,  666,
-     697,  728,  790,  821,  852,  914,  945,  976,  543,  574,  605,  636,  667,  698,  729,  760,
-     791,  822,  853,  884,  915,  946,  977, 1008,  575,  606,  637,  699,  730,  761,  823,  854,
-     885,  947,  978, 1009,  607,  638,  731,  762,  855,  886,  979, 1010,  639,  763,  887, 1011,
-     668,  792,  916,  669,  700,  793,  824,  917,  948,  670,  701,  732,  794,  825,  856,  918,
-     949,  980,  671,  702,  733,  764,  795,  826,  857,  888,  919,  950,  981, 1012,  703,  734,
-     765,  827,  858,  889,  951,  982, 1013,  735,  766,  859,  890,  983, 1014,  767,  891, 1015,
-     796,  920,  797,  828,  921,  952,  798,  829,  860,  922,  953,  984,  799,  830,  861,  892,
-     923,  954,  985, 1016,  831,  862,  893,  955,  986, 1017,  863,  894,  987, 1018,  895, 1019,
-     924,  925,  956,  926,  957,  988,  927,  958,  989, 1020,  959,  990, 1021,  991, 1022, 1023,
-};
-
-const int16_t *ff_vp9_scans[5][4] = {
-    {
-        ff_vp9_default_scan_4x4, ff_vp9_col_scan_4x4,
-        ff_vp9_row_scan_4x4, ff_vp9_default_scan_4x4
-    }, {
-        ff_vp9_default_scan_8x8, ff_vp9_col_scan_8x8,
-        ff_vp9_row_scan_8x8, ff_vp9_default_scan_8x8
-    }, {
-        ff_vp9_default_scan_16x16, ff_vp9_col_scan_16x16,
-        ff_vp9_row_scan_16x16, ff_vp9_default_scan_16x16
-    }, {
-        ff_vp9_default_scan_32x32, ff_vp9_default_scan_32x32,
-        ff_vp9_default_scan_32x32, ff_vp9_default_scan_32x32
-    }, { // lossless
-        ff_vp9_default_scan_4x4, ff_vp9_default_scan_4x4,
-        ff_vp9_default_scan_4x4, ff_vp9_default_scan_4x4
-    }
-};
-
-const int16_t ff_vp9_default_scan_4x4_nb[16][2] = {
-    {  0,  0 }, {  0,  0 }, {  4,  1 }, {  1,  1 },
-    {  4,  4 }, {  2,  2 }, {  5,  2 }, {  8,  8 },
-    {  8,  5 }, {  6,  3 }, {  9,  6 }, { 12,  9 },
-    { 10,  7 }, { 13, 10 }, { 14, 11 }, {  0,  0 },
-};
-
-const int16_t ff_vp9_col_scan_4x4_nb[16][2] = {
-    {  0,  0 }, {  1,  1 }, {  0,  0 }, {  2,  2 },
-    {  4,  4 }, {  5,  5 }, {  4,  4 }, {  6,  6 },
-    {  8,  8 }, {  9,  9 }, {  8,  8 }, { 12, 12 },
-    { 10, 10 }, { 13, 13 }, { 14, 14 }, {  0,  0 },
-};
-
-const int16_t ff_vp9_row_scan_4x4_nb[16][2] = {
-    {  0,  0 }, {  0,  0 }, {  4,  4 }, {  1,  1 },
-    {  8,  8 }, {  5,  5 }, {  1,  1 }, {  2,  2 },
-    {  9,  9 }, {  2,  2 }, {  6,  6 }, {  3,  3 },
-    { 10, 10 }, {  7,  7 }, { 11, 11 }, {  0,  0 },
-};
-
-const int16_t ff_vp9_default_scan_8x8_nb[64][2] = {
-    {  0,  0 }, {  0,  0 }, {  1,  1 }, {  8,  1 },
-    {  8,  8 }, {  9,  2 }, {  2,  2 }, { 16,  9 },
-    { 16, 16 }, { 17, 10 }, { 10,  3 }, {  3,  3 },
-    { 24, 17 }, { 24, 24 }, { 18, 11 }, { 11,  4 },
-    { 25, 18 }, {  4,  4 }, { 32, 25 }, { 19, 12 },
-    { 26, 19 }, { 32, 32 }, { 12,  5 }, { 33, 26 },
-    {  5,  5 }, { 40, 33 }, { 27, 20 }, { 20, 13 },
-    { 34, 27 }, { 41, 34 }, { 40, 40 }, { 13,  6 },
-    {  6,  6 }, { 35, 28 }, { 28, 21 }, { 42, 35 },
-    { 48, 48 }, { 48, 41 }, { 21, 14 }, { 14,  7 },
-    { 36, 29 }, { 49, 42 }, { 43, 36 }, { 56, 49 },
-    { 29, 22 }, { 22, 15 }, { 50, 43 }, { 44, 37 },
-    { 57, 50 }, { 37, 30 }, { 30, 23 }, { 51, 44 },
-    { 58, 51 }, { 38, 31 }, { 45, 38 }, { 52, 45 },
-    { 59, 52 }, { 46, 39 }, { 53, 46 }, { 60, 53 },
-    { 54, 47 }, { 61, 54 }, { 62, 55 }, {  0,  0 },
-};
-
-const int16_t ff_vp9_col_scan_8x8_nb[64][2] = {
-    {  0,  0 }, {  1,  1 }, {  0,  0 }, {  2,  2 },
-    {  8,  8 }, {  3,  3 }, {  9,  9 }, {  8,  8 },
-    {  4,  4 }, { 10, 10 }, { 16, 16 }, { 11, 11 },
-    { 17, 17 }, {  5,  5 }, { 16, 16 }, { 18, 18 },
-    { 12, 12 }, { 24, 24 }, {  6,  6 }, { 25, 25 },
-    { 19, 19 }, { 24, 24 }, { 13, 13 }, { 26, 26 },
-    { 20, 20 }, { 32, 32 }, { 27, 27 }, { 33, 33 },
-    { 14, 14 }, { 21, 21 }, { 34, 34 }, { 32, 32 },
-    { 28, 28 }, { 40, 40 }, { 35, 35 }, { 22, 22 },
-    { 29, 29 }, { 41, 41 }, { 36, 36 }, { 40, 40 },
-    { 42, 42 }, { 30, 30 }, { 43, 43 }, { 48, 48 },
-    { 37, 37 }, { 49, 49 }, { 48, 48 }, { 44, 44 },
-    { 38, 38 }, { 50, 50 }, { 56, 56 }, { 51, 51 },
-    { 45, 45 }, { 57, 57 }, { 52, 52 }, { 58, 58 },
-    { 46, 46 }, { 59, 59 }, { 53, 53 }, { 60, 60 },
-    { 54, 54 }, { 61, 61 }, { 62, 62 }, {  0,  0 },
-};
-
-const int16_t ff_vp9_row_scan_8x8_nb[64][2] = {
-    {  0,  0 }, {  8,  8 }, {  0,  0 }, {  1,  1 },
-    { 16, 16 }, {  1,  1 }, {  9,  9 }, { 24, 24 },
-    {  2,  2 }, { 17, 17 }, {  2,  2 }, { 32, 32 },
-    { 10, 10 }, {  3,  3 }, { 25, 25 }, { 18, 18 },
-    { 11, 11 }, {  3,  3 }, { 40, 40 }, { 33, 33 },
-    { 26, 26 }, {  4,  4 }, { 19, 19 }, { 48, 48 },
-    { 12, 12 }, {  4,  4 }, { 34, 34 }, { 27, 27 },
-    {  5,  5 }, { 41, 41 }, { 20, 20 }, {  5,  5 },
-    { 13, 13 }, { 35, 35 }, { 28, 28 }, {  6,  6 },
-    { 42, 42 }, { 21, 21 }, { 49, 49 }, {  6,  6 },
-    { 36, 36 }, { 14, 14 }, { 29, 29 }, { 43, 43 },
-    {  7,  7 }, { 50, 50 }, { 22, 22 }, { 15, 15 },
-    { 37, 37 }, { 44, 44 }, { 30, 30 }, { 51, 51 },
-    { 23, 23 }, { 38, 38 }, { 45, 45 }, { 31, 31 },
-    { 52, 52 }, { 39, 39 }, { 53, 53 }, { 46, 46 },
-    { 54, 54 }, { 47, 47 }, { 55, 55 }, {  0,  0 },
-};
-
-const int16_t ff_vp9_default_scan_16x16_nb[256][2] = {
-    {   0,   0 }, {   0,   0 }, {   1,   1 }, {  16,   1 },
-    {  16,  16 }, {   2,   2 }, {  17,   2 }, {  32,  17 },
-    {  32,  32 }, {   3,   3 }, {  33,  18 }, {  18,   3 },
-    {  48,  33 }, {  19,   4 }, {   4,   4 }, {  34,  19 },
-    {  48,  48 }, {  49,  34 }, {  35,  20 }, {  64,  49 },
-    {  20,   5 }, {   5,   5 }, {  50,  35 }, {  64,  64 },
-    {  65,  50 }, {  36,  21 }, {  21,   6 }, {  51,  36 },
-    {   6,   6 }, {  80,  65 }, {  66,  51 }, {  37,  22 },
-    {  81,  66 }, {  52,  37 }, {  22,   7 }, {  80,  80 },
-    {  67,  52 }, {   7,   7 }, {  82,  67 }, {  96,  81 },
-    {  53,  38 }, {  38,  23 }, {  68,  53 }, {  96,  96 },
-    {  23,   8 }, {  97,  82 }, {  83,  68 }, {  69,  54 },
-    {  54,  39 }, {   8,   8 }, {  39,  24 }, {  84,  69 },
-    {  98,  83 }, { 112,  97 }, { 112, 112 }, {  24,   9 },
-    { 113,  98 }, {  99,  84 }, {  70,  55 }, {  85,  70 },
-    {  55,  40 }, {   9,   9 }, {  40,  25 }, { 114,  99 },
-    { 100,  85 }, { 128, 113 }, { 115, 100 }, {  71,  56 },
-    {  86,  71 }, {  25,  10 }, { 129, 114 }, { 128, 128 },
-    { 101,  86 }, {  56,  41 }, {  10,  10 }, {  41,  26 },
-    { 116, 101 }, { 130, 115 }, { 144, 129 }, {  87,  72 },
-    { 102,  87 }, {  26,  11 }, {  72,  57 }, { 131, 116 },
-    { 117, 102 }, { 145, 130 }, {  57,  42 }, { 144, 144 },
-    {  11,  11 }, {  42,  27 }, { 132, 117 }, { 146, 131 },
-    { 103,  88 }, {  88,  73 }, { 118, 103 }, { 160, 145 },
-    {  73,  58 }, { 147, 132 }, { 133, 118 }, {  27,  12 },
-    { 161, 146 }, {  58,  43 }, {  12,  12 }, { 160, 160 },
-    { 119, 104 }, { 148, 133 }, {  89,  74 }, { 134, 119 },
-    { 104,  89 }, { 162, 147 }, {  43,  28 }, {  74,  59 },
-    { 176, 161 }, { 163, 148 }, {  28,  13 }, { 149, 134 },
-    { 120, 105 }, { 135, 120 }, { 177, 162 }, { 164, 149 },
-    {  13,  13 }, { 105,  90 }, {  59,  44 }, {  90,  75 },
-    { 150, 135 }, {  44,  29 }, { 178, 163 }, { 176, 176 },
-    { 136, 121 }, { 165, 150 }, { 121, 106 }, {  75,  60 },
-    { 179, 164 }, { 151, 136 }, {  29,  14 }, {  60,  45 },
-    {  14,  14 }, { 106,  91 }, { 166, 151 }, { 180, 165 },
-    { 192, 177 }, {  91,  76 }, { 192, 192 }, {  45,  30 },
-    { 137, 122 }, { 122, 107 }, { 152, 137 }, { 193, 178 },
-    {  76,  61 }, { 167, 152 }, { 181, 166 }, {  30,  15 },
-    { 194, 179 }, { 208, 193 }, { 182, 167 }, { 107,  92 },
-    { 138, 123 }, {  61,  46 }, { 153, 138 }, {  46,  31 },
-    { 195, 180 }, {  92,  77 }, { 168, 153 }, { 209, 194 },
-    { 196, 181 }, { 208, 208 }, { 123, 108 }, { 183, 168 },
-    { 210, 195 }, {  77,  62 }, { 108,  93 }, { 169, 154 },
-    { 154, 139 }, {  62,  47 }, { 197, 182 }, { 211, 196 },
-    { 184, 169 }, { 224, 209 }, { 224, 224 }, { 139, 124 },
-    {  93,  78 }, { 198, 183 }, { 124, 109 }, {  78,  63 },
-    { 212, 197 }, { 225, 210 }, { 170, 155 }, { 185, 170 },
-    { 155, 140 }, { 213, 198 }, { 199, 184 }, { 109,  94 },
-    { 226, 211 }, { 140, 125 }, {  94,  79 }, { 240, 225 },
-    { 214, 199 }, { 227, 212 }, { 200, 185 }, { 125, 110 },
-    { 241, 226 }, { 186, 171 }, { 171, 156 }, { 156, 141 },
-    { 228, 213 }, { 110,  95 }, { 215, 200 }, { 242, 227 },
-    { 141, 126 }, { 201, 186 }, { 229, 214 }, { 126, 111 },
-    { 216, 201 }, { 243, 228 }, { 172, 157 }, { 187, 172 },
-    { 230, 215 }, { 157, 142 }, { 202, 187 }, { 142, 127 },
-    { 244, 229 }, { 217, 202 }, { 231, 216 }, { 188, 173 },
-    { 245, 230 }, { 158, 143 }, { 173, 158 }, { 232, 217 },
-    { 246, 231 }, { 218, 203 }, { 203, 188 }, { 174, 159 },
-    { 189, 174 }, { 247, 232 }, { 233, 218 }, { 204, 189 },
-    { 219, 204 }, { 248, 233 }, { 190, 175 }, { 234, 219 },
-    { 220, 205 }, { 249, 234 }, { 205, 190 }, { 221, 206 },
-    { 250, 235 }, { 235, 220 }, { 206, 191 }, { 236, 221 },
-    { 222, 207 }, { 251, 236 }, { 237, 222 }, { 252, 237 },
-    { 238, 223 }, { 253, 238 }, { 254, 239 }, {   0,   0 },
-};
-
-const int16_t ff_vp9_col_scan_16x16_nb[256][2] = {
-    {   0,   0 }, {   1,   1 }, {   2,   2 }, {   0,   0 },
-    {   3,   3 }, {  16,  16 }, {   4,   4 }, {  17,  17 },
-    {   5,   5 }, {  18,  18 }, {  16,  16 }, {  19,  19 },
-    {   6,   6 }, {  32,  32 }, {  20,  20 }, {  33,  33 },
-    {   7,   7 }, {  34,  34 }, {  21,  21 }, {  32,  32 },
-    {  35,  35 }, {   8,   8 }, {  48,  48 }, {  22,  22 },
-    {  49,  49 }, {  36,  36 }, {   9,   9 }, {  37,  37 },
-    {  50,  50 }, {  23,  23 }, {  48,  48 }, {  51,  51 },
-    {  10,  10 }, {  64,  64 }, {  38,  38 }, {  24,  24 },
-    {  52,  52 }, {  65,  65 }, {  53,  53 }, {  39,  39 },
-    {  66,  66 }, {  11,  11 }, {  64,  64 }, {  25,  25 },
-    {  67,  67 }, {  54,  54 }, {  80,  80 }, {  40,  40 },
-    {  68,  68 }, {  12,  12 }, {  26,  26 }, {  81,  81 },
-    {  55,  55 }, {  69,  69 }, {  82,  82 }, {  41,  41 },
-    {  13,  13 }, {  83,  83 }, {  80,  80 }, {  70,  70 },
-    {  27,  27 }, {  56,  56 }, {  84,  84 }, {  96,  96 },
-    {  14,  14 }, {  71,  71 }, {  97,  97 }, {  42,  42 },
-    {  85,  85 }, {  57,  57 }, {  98,  98 }, {  28,  28 },
-    {  86,  86 }, {  99,  99 }, {  96,  96 }, {  72,  72 },
-    {  43,  43 }, { 100, 100 }, {  58,  58 }, {  29,  29 },
-    { 112, 112 }, {  87,  87 }, { 113, 113 }, {  73,  73 },
-    { 112, 112 }, { 101, 101 }, {  44,  44 }, {  30,  30 },
-    { 114, 114 }, {  59,  59 }, { 102, 102 }, {  88,  88 },
-    { 115, 115 }, {  74,  74 }, { 128, 128 }, { 116, 116 },
-    {  45,  45 }, { 103, 103 }, {  89,  89 }, {  60,  60 },
-    { 129, 129 }, { 117, 117 }, { 130, 130 }, { 131, 131 },
-    { 104, 104 }, {  75,  75 }, {  46,  46 }, { 118, 118 },
-    { 128, 128 }, {  90,  90 }, {  61,  61 }, { 132, 132 },
-    { 105, 105 }, { 144, 144 }, { 119, 119 }, { 145, 145 },
-    { 133, 133 }, {  76,  76 }, { 146, 146 }, { 120, 120 },
-    {  91,  91 }, { 134, 134 }, { 147, 147 }, {  62,  62 },
-    { 106, 106 }, { 135, 135 }, { 121, 121 }, {  92,  92 },
-    { 148, 148 }, { 144, 144 }, {  77,  77 }, { 149, 149 },
-    { 136, 136 }, { 107, 107 }, { 160, 160 }, { 161, 161 },
-    { 150, 150 }, { 122, 122 }, {  78,  78 }, { 137, 137 },
-    { 162, 162 }, { 151, 151 }, {  93,  93 }, { 163, 163 },
-    { 108, 108 }, { 164, 164 }, { 152, 152 }, { 123, 123 },
-    { 138, 138 }, { 160, 160 }, { 165, 165 }, {  94,  94 },
-    { 176, 176 }, { 166, 166 }, { 109, 109 }, { 153, 153 },
-    { 177, 177 }, { 124, 124 }, { 178, 178 }, { 139, 139 },
-    { 167, 167 }, { 154, 154 }, { 110, 110 }, { 179, 179 },
-    { 176, 176 }, { 180, 180 }, { 168, 168 }, { 140, 140 },
-    { 125, 125 }, { 181, 181 }, { 192, 192 }, { 193, 193 },
-    { 155, 155 }, { 182, 182 }, { 169, 169 }, { 194, 194 },
-    { 126, 126 }, { 141, 141 }, { 195, 195 }, { 183, 183 },
-    { 192, 192 }, { 196, 196 }, { 156, 156 }, { 170, 170 },
-    { 142, 142 }, { 184, 184 }, { 197, 197 }, { 208, 208 },
-    { 198, 198 }, { 209, 209 }, { 171, 171 }, { 157, 157 },
-    { 185, 185 }, { 210, 210 }, { 208, 208 }, { 211, 211 },
-    { 199, 199 }, { 224, 224 }, { 158, 158 }, { 212, 212 },
-    { 224, 224 }, { 186, 186 }, { 200, 200 }, { 172, 172 },
-    { 225, 225 }, { 213, 213 }, { 214, 214 }, { 226, 226 },
-    { 201, 201 }, { 227, 227 }, { 187, 187 }, { 240, 240 },
-    { 215, 215 }, { 173, 173 }, { 228, 228 }, { 241, 241 },
-    { 202, 202 }, { 242, 242 }, { 216, 216 }, { 229, 229 },
-    { 174, 174 }, { 188, 188 }, { 243, 243 }, { 230, 230 },
-    { 203, 203 }, { 217, 217 }, { 231, 231 }, { 244, 244 },
-    { 218, 218 }, { 245, 245 }, { 189, 189 }, { 232, 232 },
-    { 204, 204 }, { 190, 190 }, { 246, 246 }, { 233, 233 },
-    { 247, 247 }, { 219, 219 }, { 205, 205 }, { 248, 248 },
-    { 234, 234 }, { 220, 220 }, { 206, 206 }, { 249, 249 },
-    { 235, 235 }, { 221, 221 }, { 250, 250 }, { 222, 222 },
-    { 236, 236 }, { 237, 237 }, { 251, 251 }, { 238, 238 },
-    { 252, 252 }, { 253, 253 }, { 254, 254 }, {   0,   0 },
-};
-
-const int16_t ff_vp9_row_scan_16x16_nb[256][2] = {
-    {   0,   0 }, {  16,  16 }, {   0,   0 }, {  32,  32 },
-    {   1,   1 }, {  48,  48 }, {  17,  17 }, {   1,   1 },
-    {  64,  64 }, {   2,   2 }, {  33,  33 }, {  80,  80 },
-    {  18,  18 }, {   2,   2 }, {  49,  49 }, {   3,   3 },
-    {  96,  96 }, {  34,  34 }, {  65,  65 }, {  19,  19 },
-    {   3,   3 }, { 112, 112 }, {  50,  50 }, {   4,   4 },
-    {  81,  81 }, {  35,  35 }, {  66,  66 }, {   4,   4 },
-    { 128, 128 }, {  20,  20 }, {  51,  51 }, {  97,  97 },
-    {  82,  82 }, {   5,   5 }, {  36,  36 }, { 144, 144 },
-    {  67,  67 }, { 113, 113 }, {  21,  21 }, {  52,  52 },
-    {   5,   5 }, {  98,  98 }, { 160, 160 }, {  83,  83 },
-    {  37,  37 }, {   6,   6 }, {  68,  68 }, { 129, 129 },
-    {  22,  22 }, {  53,  53 }, { 114, 114 }, {   6,   6 },
-    {  99,  99 }, { 176, 176 }, {  84,  84 }, {  38,  38 },
-    {   7,   7 }, {  69,  69 }, { 145, 145 }, { 130, 130 },
-    { 115, 115 }, {  23,  23 }, {  54,  54 }, { 192, 192 },
-    { 100, 100 }, {   7,   7 }, {  85,  85 }, { 161, 161 },
-    {  39,  39 }, {  70,  70 }, {   8,   8 }, { 146, 146 },
-    { 131, 131 }, { 116, 116 }, {  55,  55 }, { 208, 208 },
-    { 101, 101 }, {  24,  24 }, {  86,  86 }, {   8,   8 },
-    { 132, 132 }, {  40,  40 }, {  71,  71 }, { 177, 177 },
-    { 147, 147 }, { 224, 224 }, { 117, 117 }, { 162, 162 },
-    {   9,   9 }, { 102, 102 }, {  56,  56 }, {  25,  25 },
-    {  87,  87 }, { 148, 148 }, {   9,   9 }, { 133, 133 },
-    {  72,  72 }, { 118, 118 }, { 193, 193 }, { 163, 163 },
-    {  41,  41 }, { 103, 103 }, { 178, 178 }, {  10,  10 },
-    {  57,  57 }, { 149, 149 }, { 134, 134 }, {  88,  88 },
-    {  26,  26 }, { 119, 119 }, {  10,  10 }, { 164, 164 },
-    { 104, 104 }, {  73,  73 }, { 209, 209 }, { 179, 179 },
-    {  42,  42 }, {  11,  11 }, { 194, 194 }, { 135, 135 },
-    { 165, 165 }, { 150, 150 }, {  58,  58 }, {  27,  27 },
-    {  89,  89 }, {  11,  11 }, { 120, 120 }, {  74,  74 },
-    {  43,  43 }, { 225, 225 }, { 105, 105 }, {  12,  12 },
-    { 180, 180 }, { 151, 151 }, { 195, 195 }, { 136, 136 },
-    {  28,  28 }, { 166, 166 }, { 121, 121 }, {  59,  59 },
-    {  12,  12 }, { 210, 210 }, {  90,  90 }, { 106, 106 },
-    {  44,  44 }, { 181, 181 }, {  75,  75 }, { 152, 152 },
-    {  13,  13 }, { 167, 167 }, { 137, 137 }, {  13,  13 },
-    {  60,  60 }, { 196, 196 }, { 122, 122 }, {  29,  29 },
-    {  91,  91 }, {  14,  14 }, { 182, 182 }, {  76,  76 },
-    { 211, 211 }, { 153, 153 }, {  14,  14 }, { 107, 107 },
-    { 138, 138 }, {  45,  45 }, { 226, 226 }, { 168, 168 },
-    { 197, 197 }, { 123, 123 }, {  30,  30 }, {  61,  61 },
-    {  15,  15 }, {  92,  92 }, { 154, 154 }, { 183, 183 },
-    { 169, 169 }, { 108, 108 }, { 212, 212 }, {  77,  77 },
-    { 139, 139 }, { 198, 198 }, {  46,  46 }, { 124, 124 },
-    { 227, 227 }, {  62,  62 }, {  31,  31 }, { 184, 184 },
-    {  93,  93 }, { 170, 170 }, { 155, 155 }, { 185, 185 },
-    {  78,  78 }, {  47,  47 }, { 199, 199 }, { 213, 213 },
-    { 140, 140 }, {  63,  63 }, { 109, 109 }, { 125, 125 },
-    {  94,  94 }, { 200, 200 }, { 171, 171 }, { 156, 156 },
-    { 228, 228 }, { 186, 186 }, { 214, 214 }, { 201, 201 },
-    {  79,  79 }, { 141, 141 }, { 110, 110 }, { 229, 229 },
-    {  95,  95 }, { 126, 126 }, { 215, 215 }, { 172, 172 },
-    { 111, 111 }, { 142, 142 }, { 202, 202 }, { 157, 157 },
-    { 216, 216 }, { 230, 230 }, { 217, 217 }, { 187, 187 },
-    { 127, 127 }, { 231, 231 }, { 158, 158 }, { 173, 173 },
-    { 143, 143 }, { 203, 203 }, { 188, 188 }, { 232, 232 },
-    { 218, 218 }, { 233, 233 }, { 159, 159 }, { 174, 174 },
-    { 204, 204 }, { 189, 189 }, { 234, 234 }, { 219, 219 },
-    { 175, 175 }, { 205, 205 }, { 235, 235 }, { 220, 220 },
-    { 190, 190 }, { 236, 236 }, { 206, 206 }, { 191, 191 },
-    { 221, 221 }, { 207, 207 }, { 237, 237 }, { 222, 222 },
-    { 238, 238 }, { 223, 223 }, { 239, 239 }, {   0,   0 },
-};
-
-const int16_t ff_vp9_default_scan_32x32_nb[1024][2] = {
-    {    0,    0 }, {    0,    0 }, {    1,    1 }, {   32,    1 },
-    {   32,   32 }, {    2,    2 }, {   33,    2 }, {   64,   33 },
-    {    3,    3 }, {   64,   64 }, {   34,    3 }, {   65,   34 },
-    {    4,    4 }, {   35,    4 }, {   96,   65 }, {   66,   35 },
-    {   96,   96 }, {   97,   66 }, {   67,   36 }, {   36,    5 },
-    {    5,    5 }, {  128,   97 }, {   98,   67 }, {    6,    6 },
-    {  128,  128 }, {   68,   37 }, {   37,    6 }, {  129,   98 },
-    {   99,   68 }, {  160,  129 }, {  130,   99 }, {   38,    7 },
-    {   69,   38 }, {    7,    7 }, {  100,   69 }, {  161,  130 },
-    {  131,  100 }, {  160,  160 }, {   70,   39 }, {   39,    8 },
-    {    8,    8 }, {  101,   70 }, {  162,  131 }, {  132,  101 },
-    {  192,  161 }, {   71,   40 }, {  192,  192 }, {  102,   71 },
-    {   40,    9 }, {  163,  132 }, {    9,    9 }, {  193,  162 },
-    {  133,  102 }, {  164,  133 }, {   72,   41 }, {  103,   72 },
-    {  134,  103 }, {  224,  193 }, {   41,   10 }, {  194,  163 },
-    {   10,   10 }, {  224,  224 }, {  165,  134 }, {  225,  194 },
-    {  195,  164 }, {   73,   42 }, {  104,   73 }, {  135,  104 },
-    {   42,   11 }, {   11,   11 }, {  166,  135 }, {  196,  165 },
-    {  226,  195 }, {  256,  225 }, {   74,   43 }, {  105,   74 },
-    {  136,  105 }, {  227,  196 }, {   43,   12 }, {  197,  166 },
-    {  167,  136 }, {  257,  226 }, {  256,  256 }, {   12,   12 },
-    {  228,  197 }, {   75,   44 }, {  106,   75 }, {  198,  167 },
-    {  137,  106 }, {  258,  227 }, {  168,  137 }, {  288,  257 },
-    {   44,   13 }, {  229,  198 }, {  259,  228 }, {  199,  168 },
-    {  107,   76 }, {   13,   13 }, {  169,  138 }, {  138,  107 },
-    {  288,  288 }, {  289,  258 }, {   76,   45 }, {  230,  199 },
-    {  260,  229 }, {   45,   14 }, {  200,  169 }, {  139,  108 },
-    {  290,  259 }, {  108,   77 }, {  231,  200 }, {  320,  289 },
-    {  261,  230 }, {  170,  139 }, {   77,   46 }, {  291,  260 },
-    {   14,   14 }, {  321,  290 }, {  201,  170 }, {  262,  231 },
-    {  320,  320 }, {  171,  140 }, {  292,  261 }, {  232,  201 },
-    {  140,  109 }, {  322,  291 }, {  109,   78 }, {   46,   15 },
-    {  202,  171 }, {  263,  232 }, {  233,  202 }, {  293,  262 },
-    {  352,  321 }, {  323,  292 }, {   15,   15 }, {   78,   47 },
-    {  203,  172 }, {  264,  233 }, {  294,  263 }, {  324,  293 },
-    {  172,  141 }, {  353,  322 }, {  141,  110 }, {  234,  203 },
-    {  352,  352 }, {   47,   16 }, {  295,  264 }, {  110,   79 },
-    {  265,  234 }, {  354,  323 }, {  325,  294 }, {   79,   48 },
-    {   16,   16 }, {  204,  173 }, {  235,  204 }, {  173,  142 },
-    {  355,  324 }, {  384,  353 }, {  326,  295 }, {  142,  111 },
-    {  296,  265 }, {  266,  235 }, {  356,  325 }, {  385,  354 },
-    {  111,   80 }, {   48,   17 }, {  327,  296 }, {  297,  266 },
-    {  205,  174 }, {  384,  384 }, {  236,  205 }, {  357,  326 },
-    {  386,  355 }, {   80,   49 }, {  174,  143 }, {   17,   17 },
-    {  328,  297 }, {  358,  327 }, {  387,  356 }, {  298,  267 },
-    {  329,  298 }, {  388,  357 }, {  112,   81 }, {  416,  385 },
-    {  237,  206 }, {  359,  328 }, {   49,   18 }, {  206,  175 },
-    {  417,  386 }, {  389,  358 }, {  330,  299 }, {   18,   18 },
-    {  416,  416 }, {  360,  329 }, {   81,   50 }, {  418,  387 },
-    {  390,  359 }, {  238,  207 }, {   50,   19 }, {  361,  330 },
-    {  419,  388 }, {  113,   82 }, {  448,  417 }, {  448,  448 },
-    {  420,  389 }, {   82,   51 }, {  362,  331 }, {  449,  418 },
-    {  421,  390 }, {  480,  480 }, {  450,  419 }, {  422,  391 },
-    {  114,   83 }, {  451,  420 }, {  480,  449 }, {  452,  421 },
-    {  481,  450 }, {  453,  422 }, {  512,  512 }, {  482,  451 },
-    {  454,  423 }, {  512,  481 }, {  483,  452 }, {  513,  482 },
-    {  484,  453 }, {  514,  483 }, {  485,  454 }, {  544,  513 },
-    {  544,  544 }, {  486,  455 }, {  545,  514 }, {  546,  515 },
-    {  576,  576 }, {  576,  545 }, {  577,  546 }, {  578,  547 },
-    {  608,  577 }, {  609,  578 }, {  610,  579 }, {   19,   19 },
-    {  143,  112 }, {  267,  236 }, {  391,  360 }, {  515,  484 },
-    {  608,  608 }, {   20,   20 }, {   51,   20 }, {  144,  113 },
-    {  175,  144 }, {  268,  237 }, {  299,  268 }, {  392,  361 },
-    {  423,  392 }, {  516,  485 }, {  547,  516 }, {  640,  609 },
-    {  640,  640 }, {   21,   21 }, {   52,   21 }, {   83,   52 },
-    {  145,  114 }, {  176,  145 }, {  207,  176 }, {  269,  238 },
-    {  300,  269 }, {  331,  300 }, {  393,  362 }, {  424,  393 },
-    {  455,  424 }, {  517,  486 }, {  548,  517 }, {  579,  548 },
-    {  641,  610 }, {  672,  641 }, {  672,  672 }, {   22,   22 },
-    {   53,   22 }, {   84,   53 }, {  115,   84 }, {  146,  115 },
-    {  177,  146 }, {  208,  177 }, {  239,  208 }, {  270,  239 },
-    {  301,  270 }, {  332,  301 }, {  363,  332 }, {  394,  363 },
-    {  425,  394 }, {  456,  425 }, {  487,  456 }, {  518,  487 },
-    {  549,  518 }, {  580,  549 }, {  611,  580 }, {  642,  611 },
-    {  673,  642 }, {  704,  673 }, {  704,  704 }, {   54,   23 },
-    {   85,   54 }, {  116,   85 }, {  178,  147 }, {  209,  178 },
-    {  240,  209 }, {  302,  271 }, {  333,  302 }, {  364,  333 },
-    {  426,  395 }, {  457,  426 }, {  488,  457 }, {  550,  519 },
-    {  581,  550 }, {  612,  581 }, {  674,  643 }, {  705,  674 },
-    {  736,  705 }, {   86,   55 }, {  117,   86 }, {  210,  179 },
-    {  241,  210 }, {  334,  303 }, {  365,  334 }, {  458,  427 },
-    {  489,  458 }, {  582,  551 }, {  613,  582 }, {  706,  675 },
-    {  737,  706 }, {  118,   87 }, {  242,  211 }, {  366,  335 },
-    {  490,  459 }, {  614,  583 }, {  738,  707 }, {   23,   23 },
-    {  147,  116 }, {  271,  240 }, {  395,  364 }, {  519,  488 },
-    {  643,  612 }, {  736,  736 }, {   24,   24 }, {   55,   24 },
-    {  148,  117 }, {  179,  148 }, {  272,  241 }, {  303,  272 },
-    {  396,  365 }, {  427,  396 }, {  520,  489 }, {  551,  520 },
-    {  644,  613 }, {  675,  644 }, {  768,  737 }, {  768,  768 },
-    {   25,   25 }, {   56,   25 }, {   87,   56 }, {  149,  118 },
-    {  180,  149 }, {  211,  180 }, {  273,  242 }, {  304,  273 },
-    {  335,  304 }, {  397,  366 }, {  428,  397 }, {  459,  428 },
-    {  521,  490 }, {  552,  521 }, {  583,  552 }, {  645,  614 },
-    {  676,  645 }, {  707,  676 }, {  769,  738 }, {  800,  769 },
-    {  800,  800 }, {   26,   26 }, {   57,   26 }, {   88,   57 },
-    {  119,   88 }, {  150,  119 }, {  181,  150 }, {  212,  181 },
-    {  243,  212 }, {  274,  243 }, {  305,  274 }, {  336,  305 },
-    {  367,  336 }, {  398,  367 }, {  429,  398 }, {  460,  429 },
-    {  491,  460 }, {  522,  491 }, {  553,  522 }, {  584,  553 },
-    {  615,  584 }, {  646,  615 }, {  677,  646 }, {  708,  677 },
-    {  739,  708 }, {  770,  739 }, {  801,  770 }, {  832,  801 },
-    {  832,  832 }, {   58,   27 }, {   89,   58 }, {  120,   89 },
-    {  182,  151 }, {  213,  182 }, {  244,  213 }, {  306,  275 },
-    {  337,  306 }, {  368,  337 }, {  430,  399 }, {  461,  430 },
-    {  492,  461 }, {  554,  523 }, {  585,  554 }, {  616,  585 },
-    {  678,  647 }, {  709,  678 }, {  740,  709 }, {  802,  771 },
-    {  833,  802 }, {  864,  833 }, {   90,   59 }, {  121,   90 },
-    {  214,  183 }, {  245,  214 }, {  338,  307 }, {  369,  338 },
-    {  462,  431 }, {  493,  462 }, {  586,  555 }, {  617,  586 },
-    {  710,  679 }, {  741,  710 }, {  834,  803 }, {  865,  834 },
-    {  122,   91 }, {  246,  215 }, {  370,  339 }, {  494,  463 },
-    {  618,  587 }, {  742,  711 }, {  866,  835 }, {   27,   27 },
-    {  151,  120 }, {  275,  244 }, {  399,  368 }, {  523,  492 },
-    {  647,  616 }, {  771,  740 }, {  864,  864 }, {   28,   28 },
-    {   59,   28 }, {  152,  121 }, {  183,  152 }, {  276,  245 },
-    {  307,  276 }, {  400,  369 }, {  431,  400 }, {  524,  493 },
-    {  555,  524 }, {  648,  617 }, {  679,  648 }, {  772,  741 },
-    {  803,  772 }, {  896,  865 }, {  896,  896 }, {   29,   29 },
-    {   60,   29 }, {   91,   60 }, {  153,  122 }, {  184,  153 },
-    {  215,  184 }, {  277,  246 }, {  308,  277 }, {  339,  308 },
-    {  401,  370 }, {  432,  401 }, {  463,  432 }, {  525,  494 },
-    {  556,  525 }, {  587,  556 }, {  649,  618 }, {  680,  649 },
-    {  711,  680 }, {  773,  742 }, {  804,  773 }, {  835,  804 },
-    {  897,  866 }, {  928,  897 }, {  928,  928 }, {   30,   30 },
-    {   61,   30 }, {   92,   61 }, {  123,   92 }, {  154,  123 },
-    {  185,  154 }, {  216,  185 }, {  247,  216 }, {  278,  247 },
-    {  309,  278 }, {  340,  309 }, {  371,  340 }, {  402,  371 },
-    {  433,  402 }, {  464,  433 }, {  495,  464 }, {  526,  495 },
-    {  557,  526 }, {  588,  557 }, {  619,  588 }, {  650,  619 },
-    {  681,  650 }, {  712,  681 }, {  743,  712 }, {  774,  743 },
-    {  805,  774 }, {  836,  805 }, {  867,  836 }, {  898,  867 },
-    {  929,  898 }, {  960,  929 }, {  960,  960 }, {   62,   31 },
-    {   93,   62 }, {  124,   93 }, {  186,  155 }, {  217,  186 },
-    {  248,  217 }, {  310,  279 }, {  341,  310 }, {  372,  341 },
-    {  434,  403 }, {  465,  434 }, {  496,  465 }, {  558,  527 },
-    {  589,  558 }, {  620,  589 }, {  682,  651 }, {  713,  682 },
-    {  744,  713 }, {  806,  775 }, {  837,  806 }, {  868,  837 },
-    {  930,  899 }, {  961,  930 }, {  992,  961 }, {   94,   63 },
-    {  125,   94 }, {  218,  187 }, {  249,  218 }, {  342,  311 },
-    {  373,  342 }, {  466,  435 }, {  497,  466 }, {  590,  559 },
-    {  621,  590 }, {  714,  683 }, {  745,  714 }, {  838,  807 },
-    {  869,  838 }, {  962,  931 }, {  993,  962 }, {  126,   95 },
-    {  250,  219 }, {  374,  343 }, {  498,  467 }, {  622,  591 },
-    {  746,  715 }, {  870,  839 }, {  994,  963 }, {  155,  124 },
-    {  279,  248 }, {  403,  372 }, {  527,  496 }, {  651,  620 },
-    {  775,  744 }, {  899,  868 }, {  156,  125 }, {  187,  156 },
-    {  280,  249 }, {  311,  280 }, {  404,  373 }, {  435,  404 },
-    {  528,  497 }, {  559,  528 }, {  652,  621 }, {  683,  652 },
-    {  776,  745 }, {  807,  776 }, {  900,  869 }, {  931,  900 },
-    {  157,  126 }, {  188,  157 }, {  219,  188 }, {  281,  250 },
-    {  312,  281 }, {  343,  312 }, {  405,  374 }, {  436,  405 },
-    {  467,  436 }, {  529,  498 }, {  560,  529 }, {  591,  560 },
-    {  653,  622 }, {  684,  653 }, {  715,  684 }, {  777,  746 },
-    {  808,  777 }, {  839,  808 }, {  901,  870 }, {  932,  901 },
-    {  963,  932 }, {  158,  127 }, {  189,  158 }, {  220,  189 },
-    {  251,  220 }, {  282,  251 }, {  313,  282 }, {  344,  313 },
-    {  375,  344 }, {  406,  375 }, {  437,  406 }, {  468,  437 },
-    {  499,  468 }, {  530,  499 }, {  561,  530 }, {  592,  561 },
-    {  623,  592 }, {  654,  623 }, {  685,  654 }, {  716,  685 },
-    {  747,  716 }, {  778,  747 }, {  809,  778 }, {  840,  809 },
-    {  871,  840 }, {  902,  871 }, {  933,  902 }, {  964,  933 },
-    {  995,  964 }, {  190,  159 }, {  221,  190 }, {  252,  221 },
-    {  314,  283 }, {  345,  314 }, {  376,  345 }, {  438,  407 },
-    {  469,  438 }, {  500,  469 }, {  562,  531 }, {  593,  562 },
-    {  624,  593 }, {  686,  655 }, {  717,  686 }, {  748,  717 },
-    {  810,  779 }, {  841,  810 }, {  872,  841 }, {  934,  903 },
-    {  965,  934 }, {  996,  965 }, {  222,  191 }, {  253,  222 },
-    {  346,  315 }, {  377,  346 }, {  470,  439 }, {  501,  470 },
-    {  594,  563 }, {  625,  594 }, {  718,  687 }, {  749,  718 },
-    {  842,  811 }, {  873,  842 }, {  966,  935 }, {  997,  966 },
-    {  254,  223 }, {  378,  347 }, {  502,  471 }, {  626,  595 },
-    {  750,  719 }, {  874,  843 }, {  998,  967 }, {  283,  252 },
-    {  407,  376 }, {  531,  500 }, {  655,  624 }, {  779,  748 },
-    {  903,  872 }, {  284,  253 }, {  315,  284 }, {  408,  377 },
-    {  439,  408 }, {  532,  501 }, {  563,  532 }, {  656,  625 },
-    {  687,  656 }, {  780,  749 }, {  811,  780 }, {  904,  873 },
-    {  935,  904 }, {  285,  254 }, {  316,  285 }, {  347,  316 },
-    {  409,  378 }, {  440,  409 }, {  471,  440 }, {  533,  502 },
-    {  564,  533 }, {  595,  564 }, {  657,  626 }, {  688,  657 },
-    {  719,  688 }, {  781,  750 }, {  812,  781 }, {  843,  812 },
-    {  905,  874 }, {  936,  905 }, {  967,  936 }, {  286,  255 },
-    {  317,  286 }, {  348,  317 }, {  379,  348 }, {  410,  379 },
-    {  441,  410 }, {  472,  441 }, {  503,  472 }, {  534,  503 },
-    {  565,  534 }, {  596,  565 }, {  627,  596 }, {  658,  627 },
-    {  689,  658 }, {  720,  689 }, {  751,  720 }, {  782,  751 },
-    {  813,  782 }, {  844,  813 }, {  875,  844 }, {  906,  875 },
-    {  937,  906 }, {  968,  937 }, {  999,  968 }, {  318,  287 },
-    {  349,  318 }, {  380,  349 }, {  442,  411 }, {  473,  442 },
-    {  504,  473 }, {  566,  535 }, {  597,  566 }, {  628,  597 },
-    {  690,  659 }, {  721,  690 }, {  752,  721 }, {  814,  783 },
-    {  845,  814 }, {  876,  845 }, {  938,  907 }, {  969,  938 },
-    { 1000,  969 }, {  350,  319 }, {  381,  350 }, {  474,  443 },
-    {  505,  474 }, {  598,  567 }, {  629,  598 }, {  722,  691 },
-    {  753,  722 }, {  846,  815 }, {  877,  846 }, {  970,  939 },
-    { 1001,  970 }, {  382,  351 }, {  506,  475 }, {  630,  599 },
-    {  754,  723 }, {  878,  847 }, { 1002,  971 }, {  411,  380 },
-    {  535,  504 }, {  659,  628 }, {  783,  752 }, {  907,  876 },
-    {  412,  381 }, {  443,  412 }, {  536,  505 }, {  567,  536 },
-    {  660,  629 }, {  691,  660 }, {  784,  753 }, {  815,  784 },
-    {  908,  877 }, {  939,  908 }, {  413,  382 }, {  444,  413 },
-    {  475,  444 }, {  537,  506 }, {  568,  537 }, {  599,  568 },
-    {  661,  630 }, {  692,  661 }, {  723,  692 }, {  785,  754 },
-    {  816,  785 }, {  847,  816 }, {  909,  878 }, {  940,  909 },
-    {  971,  940 }, {  414,  383 }, {  445,  414 }, {  476,  445 },
-    {  507,  476 }, {  538,  507 }, {  569,  538 }, {  600,  569 },
-    {  631,  600 }, {  662,  631 }, {  693,  662 }, {  724,  693 },
-    {  755,  724 }, {  786,  755 }, {  817,  786 }, {  848,  817 },
-    {  879,  848 }, {  910,  879 }, {  941,  910 }, {  972,  941 },
-    { 1003,  972 }, {  446,  415 }, {  477,  446 }, {  508,  477 },
-    {  570,  539 }, {  601,  570 }, {  632,  601 }, {  694,  663 },
-    {  725,  694 }, {  756,  725 }, {  818,  787 }, {  849,  818 },
-    {  880,  849 }, {  942,  911 }, {  973,  942 }, { 1004,  973 },
-    {  478,  447 }, {  509,  478 }, {  602,  571 }, {  633,  602 },
-    {  726,  695 }, {  757,  726 }, {  850,  819 }, {  881,  850 },
-    {  974,  943 }, { 1005,  974 }, {  510,  479 }, {  634,  603 },
-    {  758,  727 }, {  882,  851 }, { 1006,  975 }, {  539,  508 },
-    {  663,  632 }, {  787,  756 }, {  911,  880 }, {  540,  509 },
-    {  571,  540 }, {  664,  633 }, {  695,  664 }, {  788,  757 },
-    {  819,  788 }, {  912,  881 }, {  943,  912 }, {  541,  510 },
-    {  572,  541 }, {  603,  572 }, {  665,  634 }, {  696,  665 },
-    {  727,  696 }, {  789,  758 }, {  820,  789 }, {  851,  820 },
-    {  913,  882 }, {  944,  913 }, {  975,  944 }, {  542,  511 },
-    {  573,  542 }, {  604,  573 }, {  635,  604 }, {  666,  635 },
-    {  697,  666 }, {  728,  697 }, {  759,  728 }, {  790,  759 },
-    {  821,  790 }, {  852,  821 }, {  883,  852 }, {  914,  883 },
-    {  945,  914 }, {  976,  945 }, { 1007,  976 }, {  574,  543 },
-    {  605,  574 }, {  636,  605 }, {  698,  667 }, {  729,  698 },
-    {  760,  729 }, {  822,  791 }, {  853,  822 }, {  884,  853 },
-    {  946,  915 }, {  977,  946 }, { 1008,  977 }, {  606,  575 },
-    {  637,  606 }, {  730,  699 }, {  761,  730 }, {  854,  823 },
-    {  885,  854 }, {  978,  947 }, { 1009,  978 }, {  638,  607 },
-    {  762,  731 }, {  886,  855 }, { 1010,  979 }, {  667,  636 },
-    {  791,  760 }, {  915,  884 }, {  668,  637 }, {  699,  668 },
-    {  792,  761 }, {  823,  792 }, {  916,  885 }, {  947,  916 },
-    {  669,  638 }, {  700,  669 }, {  731,  700 }, {  793,  762 },
-    {  824,  793 }, {  855,  824 }, {  917,  886 }, {  948,  917 },
-    {  979,  948 }, {  670,  639 }, {  701,  670 }, {  732,  701 },
-    {  763,  732 }, {  794,  763 }, {  825,  794 }, {  856,  825 },
-    {  887,  856 }, {  918,  887 }, {  949,  918 }, {  980,  949 },
-    { 1011,  980 }, {  702,  671 }, {  733,  702 }, {  764,  733 },
-    {  826,  795 }, {  857,  826 }, {  888,  857 }, {  950,  919 },
-    {  981,  950 }, { 1012,  981 }, {  734,  703 }, {  765,  734 },
-    {  858,  827 }, {  889,  858 }, {  982,  951 }, { 1013,  982 },
-    {  766,  735 }, {  890,  859 }, { 1014,  983 }, {  795,  764 },
-    {  919,  888 }, {  796,  765 }, {  827,  796 }, {  920,  889 },
-    {  951,  920 }, {  797,  766 }, {  828,  797 }, {  859,  828 },
-    {  921,  890 }, {  952,  921 }, {  983,  952 }, {  798,  767 },
-    {  829,  798 }, {  860,  829 }, {  891,  860 }, {  922,  891 },
-    {  953,  922 }, {  984,  953 }, { 1015,  984 }, {  830,  799 },
-    {  861,  830 }, {  892,  861 }, {  954,  923 }, {  985,  954 },
-    { 1016,  985 }, {  862,  831 }, {  893,  862 }, {  986,  955 },
-    { 1017,  986 }, {  894,  863 }, { 1018,  987 }, {  923,  892 },
-    {  924,  893 }, {  955,  924 }, {  925,  894 }, {  956,  925 },
-    {  987,  956 }, {  926,  895 }, {  957,  926 }, {  988,  957 },
-    { 1019,  988 }, {  958,  927 }, {  989,  958 }, { 1020,  989 },
-    {  990,  959 }, { 1021,  990 }, { 1022,  991 }, {    0,    0 },
-};
-
-const int16_t (*ff_vp9_scans_nb[5][4])[2] = {
-    {
-        ff_vp9_default_scan_4x4_nb, ff_vp9_col_scan_4x4_nb,
-        ff_vp9_row_scan_4x4_nb, ff_vp9_default_scan_4x4_nb
-    }, {
-        ff_vp9_default_scan_8x8_nb, ff_vp9_col_scan_8x8_nb,
-        ff_vp9_row_scan_8x8_nb, ff_vp9_default_scan_8x8_nb
-    }, {
-        ff_vp9_default_scan_16x16_nb, ff_vp9_col_scan_16x16_nb,
-        ff_vp9_row_scan_16x16_nb, ff_vp9_default_scan_16x16_nb
-    }, {
-        ff_vp9_default_scan_32x32_nb, ff_vp9_default_scan_32x32_nb,
-        ff_vp9_default_scan_32x32_nb, ff_vp9_default_scan_32x32_nb
-    }, { // lossless
-        ff_vp9_default_scan_4x4_nb, ff_vp9_default_scan_4x4_nb,
-        ff_vp9_default_scan_4x4_nb, ff_vp9_default_scan_4x4_nb
-    }
-};
-
-const uint8_t ff_vp9_model_pareto8[256][8] = {
-    {   6,  86, 128,  11,  87,  42,  91,  52 },
-    {   3,  86, 128,   6,  86,  23,  88,  29 },
-    {   6,  86, 128,  11,  87,  42,  91,  52 },
-    {   9,  86, 129,  17,  88,  61,  94,  76 },
-    {  12,  86, 129,  22,  88,  77,  97,  93 },
-    {  15,  87, 129,  28,  89,  93, 100, 110 },
-    {  17,  87, 129,  33,  90, 105, 103, 123 },
-    {  20,  88, 130,  38,  91, 118, 106, 136 },
-    {  23,  88, 130,  43,  91, 128, 108, 146 },
-    {  26,  89, 131,  48,  92, 139, 111, 156 },
-    {  28,  89, 131,  53,  93, 147, 114, 163 },
-    {  31,  90, 131,  58,  94, 156, 117, 171 },
-    {  34,  90, 131,  62,  94, 163, 119, 177 },
-    {  37,  90, 132,  66,  95, 171, 122, 184 },
-    {  39,  90, 132,  70,  96, 177, 124, 189 },
-    {  42,  91, 132,  75,  97, 183, 127, 194 },
-    {  44,  91, 132,  79,  97, 188, 129, 198 },
-    {  47,  92, 133,  83,  98, 193, 132, 202 },
-    {  49,  92, 133,  86,  99, 197, 134, 205 },
-    {  52,  93, 133,  90, 100, 201, 137, 208 },
-    {  54,  93, 133,  94, 100, 204, 139, 211 },
-    {  57,  94, 134,  98, 101, 208, 142, 214 },
-    {  59,  94, 134, 101, 102, 211, 144, 216 },
-    {  62,  94, 135, 105, 103, 214, 146, 218 },
-    {  64,  94, 135, 108, 103, 216, 148, 220 },
-    {  66,  95, 135, 111, 104, 219, 151, 222 },
-    {  68,  95, 135, 114, 105, 221, 153, 223 },
-    {  71,  96, 136, 117, 106, 224, 155, 225 },
-    {  73,  96, 136, 120, 106, 225, 157, 226 },
-    {  76,  97, 136, 123, 107, 227, 159, 228 },
-    {  78,  97, 136, 126, 108, 229, 160, 229 },
-    {  80,  98, 137, 129, 109, 231, 162, 231 },
-    {  82,  98, 137, 131, 109, 232, 164, 232 },
-    {  84,  98, 138, 134, 110, 234, 166, 233 },
-    {  86,  98, 138, 137, 111, 235, 168, 234 },
-    {  89,  99, 138, 140, 112, 236, 170, 235 },
-    {  91,  99, 138, 142, 112, 237, 171, 235 },
-    {  93, 100, 139, 145, 113, 238, 173, 236 },
-    {  95, 100, 139, 147, 114, 239, 174, 237 },
-    {  97, 101, 140, 149, 115, 240, 176, 238 },
-    {  99, 101, 140, 151, 115, 241, 177, 238 },
-    { 101, 102, 140, 154, 116, 242, 179, 239 },
-    { 103, 102, 140, 156, 117, 242, 180, 239 },
-    { 105, 103, 141, 158, 118, 243, 182, 240 },
-    { 107, 103, 141, 160, 118, 243, 183, 240 },
-    { 109, 104, 141, 162, 119, 244, 185, 241 },
-    { 111, 104, 141, 164, 119, 244, 186, 241 },
-    { 113, 104, 142, 166, 120, 245, 187, 242 },
-    { 114, 104, 142, 168, 121, 245, 188, 242 },
-    { 116, 105, 143, 170, 122, 246, 190, 243 },
-    { 118, 105, 143, 171, 122, 246, 191, 243 },
-    { 120, 106, 143, 173, 123, 247, 192, 244 },
-    { 121, 106, 143, 175, 124, 247, 193, 244 },
-    { 123, 107, 144, 177, 125, 248, 195, 244 },
-    { 125, 107, 144, 178, 125, 248, 196, 244 },
-    { 127, 108, 145, 180, 126, 249, 197, 245 },
-    { 128, 108, 145, 181, 127, 249, 198, 245 },
-    { 130, 109, 145, 183, 128, 249, 199, 245 },
-    { 132, 109, 145, 184, 128, 249, 200, 245 },
-    { 134, 110, 146, 186, 129, 250, 201, 246 },
-    { 135, 110, 146, 187, 130, 250, 202, 246 },
-    { 137, 111, 147, 189, 131, 251, 203, 246 },
-    { 138, 111, 147, 190, 131, 251, 204, 246 },
-    { 140, 112, 147, 192, 132, 251, 205, 247 },
-    { 141, 112, 147, 193, 132, 251, 206, 247 },
-    { 143, 113, 148, 194, 133, 251, 207, 247 },
-    { 144, 113, 148, 195, 134, 251, 207, 247 },
-    { 146, 114, 149, 197, 135, 252, 208, 248 },
-    { 147, 114, 149, 198, 135, 252, 209, 248 },
-    { 149, 115, 149, 199, 136, 252, 210, 248 },
-    { 150, 115, 149, 200, 137, 252, 210, 248 },
-    { 152, 115, 150, 201, 138, 252, 211, 248 },
-    { 153, 115, 150, 202, 138, 252, 212, 248 },
-    { 155, 116, 151, 204, 139, 253, 213, 249 },
-    { 156, 116, 151, 205, 139, 253, 213, 249 },
-    { 158, 117, 151, 206, 140, 253, 214, 249 },
-    { 159, 117, 151, 207, 141, 253, 215, 249 },
-    { 161, 118, 152, 208, 142, 253, 216, 249 },
-    { 162, 118, 152, 209, 142, 253, 216, 249 },
-    { 163, 119, 153, 210, 143, 253, 217, 249 },
-    { 164, 119, 153, 211, 143, 253, 217, 249 },
-    { 166, 120, 153, 212, 144, 254, 218, 250 },
-    { 167, 120, 153, 212, 145, 254, 219, 250 },
-    { 168, 121, 154, 213, 146, 254, 220, 250 },
-    { 169, 121, 154, 214, 146, 254, 220, 250 },
-    { 171, 122, 155, 215, 147, 254, 221, 250 },
-    { 172, 122, 155, 216, 147, 254, 221, 250 },
-    { 173, 123, 155, 217, 148, 254, 222, 250 },
-    { 174, 123, 155, 217, 149, 254, 222, 250 },
-    { 176, 124, 156, 218, 150, 254, 223, 250 },
-    { 177, 124, 156, 219, 150, 254, 223, 250 },
-    { 178, 125, 157, 220, 151, 254, 224, 251 },
-    { 179, 125, 157, 220, 151, 254, 224, 251 },
-    { 180, 126, 157, 221, 152, 254, 225, 251 },
-    { 181, 126, 157, 221, 152, 254, 225, 251 },
-    { 183, 127, 158, 222, 153, 254, 226, 251 },
-    { 184, 127, 158, 223, 154, 254, 226, 251 },
-    { 185, 128, 159, 224, 155, 255, 227, 251 },
-    { 186, 128, 159, 224, 155, 255, 227, 251 },
-    { 187, 129, 160, 225, 156, 255, 228, 251 },
-    { 188, 130, 160, 225, 156, 255, 228, 251 },
-    { 189, 131, 160, 226, 157, 255, 228, 251 },
-    { 190, 131, 160, 226, 158, 255, 228, 251 },
-    { 191, 132, 161, 227, 159, 255, 229, 251 },
-    { 192, 132, 161, 227, 159, 255, 229, 251 },
-    { 193, 133, 162, 228, 160, 255, 230, 252 },
-    { 194, 133, 162, 229, 160, 255, 230, 252 },
-    { 195, 134, 163, 230, 161, 255, 231, 252 },
-    { 196, 134, 163, 230, 161, 255, 231, 252 },
-    { 197, 135, 163, 231, 162, 255, 231, 252 },
-    { 198, 135, 163, 231, 162, 255, 231, 252 },
-    { 199, 136, 164, 232, 163, 255, 232, 252 },
-    { 200, 136, 164, 232, 164, 255, 232, 252 },
-    { 201, 137, 165, 233, 165, 255, 233, 252 },
-    { 201, 137, 165, 233, 165, 255, 233, 252 },
-    { 202, 138, 166, 233, 166, 255, 233, 252 },
-    { 203, 138, 166, 233, 166, 255, 233, 252 },
-    { 204, 139, 166, 234, 167, 255, 234, 252 },
-    { 205, 139, 166, 234, 167, 255, 234, 252 },
-    { 206, 140, 167, 235, 168, 255, 235, 252 },
-    { 206, 140, 167, 235, 168, 255, 235, 252 },
-    { 207, 141, 168, 236, 169, 255, 235, 252 },
-    { 208, 141, 168, 236, 170, 255, 235, 252 },
-    { 209, 142, 169, 237, 171, 255, 236, 252 },
-    { 209, 143, 169, 237, 171, 255, 236, 252 },
-    { 210, 144, 169, 237, 172, 255, 236, 252 },
-    { 211, 144, 169, 237, 172, 255, 236, 252 },
-    { 212, 145, 170, 238, 173, 255, 237, 252 },
-    { 213, 145, 170, 238, 173, 255, 237, 252 },
-    { 214, 146, 171, 239, 174, 255, 237, 253 },
-    { 214, 146, 171, 239, 174, 255, 237, 253 },
-    { 215, 147, 172, 240, 175, 255, 238, 253 },
-    { 215, 147, 172, 240, 175, 255, 238, 253 },
-    { 216, 148, 173, 240, 176, 255, 238, 253 },
-    { 217, 148, 173, 240, 176, 255, 238, 253 },
-    { 218, 149, 173, 241, 177, 255, 239, 253 },
-    { 218, 149, 173, 241, 178, 255, 239, 253 },
-    { 219, 150, 174, 241, 179, 255, 239, 253 },
-    { 219, 151, 174, 241, 179, 255, 239, 253 },
-    { 220, 152, 175, 242, 180, 255, 240, 253 },
-    { 221, 152, 175, 242, 180, 255, 240, 253 },
-    { 222, 153, 176, 242, 181, 255, 240, 253 },
-    { 222, 153, 176, 242, 181, 255, 240, 253 },
-    { 223, 154, 177, 243, 182, 255, 240, 253 },
-    { 223, 154, 177, 243, 182, 255, 240, 253 },
-    { 224, 155, 178, 244, 183, 255, 241, 253 },
-    { 224, 155, 178, 244, 183, 255, 241, 253 },
-    { 225, 156, 178, 244, 184, 255, 241, 253 },
-    { 225, 157, 178, 244, 184, 255, 241, 253 },
-    { 226, 158, 179, 244, 185, 255, 242, 253 },
-    { 227, 158, 179, 244, 185, 255, 242, 253 },
-    { 228, 159, 180, 245, 186, 255, 242, 253 },
-    { 228, 159, 180, 245, 186, 255, 242, 253 },
-    { 229, 160, 181, 245, 187, 255, 242, 253 },
-    { 229, 160, 181, 245, 187, 255, 242, 253 },
-    { 230, 161, 182, 246, 188, 255, 243, 253 },
-    { 230, 162, 182, 246, 188, 255, 243, 253 },
-    { 231, 163, 183, 246, 189, 255, 243, 253 },
-    { 231, 163, 183, 246, 189, 255, 243, 253 },
-    { 232, 164, 184, 247, 190, 255, 243, 253 },
-    { 232, 164, 184, 247, 190, 255, 243, 253 },
-    { 233, 165, 185, 247, 191, 255, 244, 253 },
-    { 233, 165, 185, 247, 191, 255, 244, 253 },
-    { 234, 166, 185, 247, 192, 255, 244, 253 },
-    { 234, 167, 185, 247, 192, 255, 244, 253 },
-    { 235, 168, 186, 248, 193, 255, 244, 253 },
-    { 235, 168, 186, 248, 193, 255, 244, 253 },
-    { 236, 169, 187, 248, 194, 255, 244, 253 },
-    { 236, 169, 187, 248, 194, 255, 244, 253 },
-    { 236, 170, 188, 248, 195, 255, 245, 253 },
-    { 236, 170, 188, 248, 195, 255, 245, 253 },
-    { 237, 171, 189, 249, 196, 255, 245, 254 },
-    { 237, 172, 189, 249, 196, 255, 245, 254 },
-    { 238, 173, 190, 249, 197, 255, 245, 254 },
-    { 238, 173, 190, 249, 197, 255, 245, 254 },
-    { 239, 174, 191, 249, 198, 255, 245, 254 },
-    { 239, 174, 191, 249, 198, 255, 245, 254 },
-    { 240, 175, 192, 249, 199, 255, 246, 254 },
-    { 240, 176, 192, 249, 199, 255, 246, 254 },
-    { 240, 177, 193, 250, 200, 255, 246, 254 },
-    { 240, 177, 193, 250, 200, 255, 246, 254 },
-    { 241, 178, 194, 250, 201, 255, 246, 254 },
-    { 241, 178, 194, 250, 201, 255, 246, 254 },
-    { 242, 179, 195, 250, 202, 255, 246, 254 },
-    { 242, 180, 195, 250, 202, 255, 246, 254 },
-    { 242, 181, 196, 250, 203, 255, 247, 254 },
-    { 242, 181, 196, 250, 203, 255, 247, 254 },
-    { 243, 182, 197, 251, 204, 255, 247, 254 },
-    { 243, 183, 197, 251, 204, 255, 247, 254 },
-    { 244, 184, 198, 251, 205, 255, 247, 254 },
-    { 244, 184, 198, 251, 205, 255, 247, 254 },
-    { 244, 185, 199, 251, 206, 255, 247, 254 },
-    { 244, 185, 199, 251, 206, 255, 247, 254 },
-    { 245, 186, 200, 251, 207, 255, 247, 254 },
-    { 245, 187, 200, 251, 207, 255, 247, 254 },
-    { 246, 188, 201, 252, 207, 255, 248, 254 },
-    { 246, 188, 201, 252, 207, 255, 248, 254 },
-    { 246, 189, 202, 252, 208, 255, 248, 254 },
-    { 246, 190, 202, 252, 208, 255, 248, 254 },
-    { 247, 191, 203, 252, 209, 255, 248, 254 },
-    { 247, 191, 203, 252, 209, 255, 248, 254 },
-    { 247, 192, 204, 252, 210, 255, 248, 254 },
-    { 247, 193, 204, 252, 210, 255, 248, 254 },
-    { 248, 194, 205, 252, 211, 255, 248, 254 },
-    { 248, 194, 205, 252, 211, 255, 248, 254 },
-    { 248, 195, 206, 252, 212, 255, 249, 254 },
-    { 248, 196, 206, 252, 212, 255, 249, 254 },
-    { 249, 197, 207, 253, 213, 255, 249, 254 },
-    { 249, 197, 207, 253, 213, 255, 249, 254 },
-    { 249, 198, 208, 253, 214, 255, 249, 254 },
-    { 249, 199, 209, 253, 214, 255, 249, 254 },
-    { 250, 200, 210, 253, 215, 255, 249, 254 },
-    { 250, 200, 210, 253, 215, 255, 249, 254 },
-    { 250, 201, 211, 253, 215, 255, 249, 254 },
-    { 250, 202, 211, 253, 215, 255, 249, 254 },
-    { 250, 203, 212, 253, 216, 255, 249, 254 },
-    { 250, 203, 212, 253, 216, 255, 249, 254 },
-    { 251, 204, 213, 253, 217, 255, 250, 254 },
-    { 251, 205, 213, 253, 217, 255, 250, 254 },
-    { 251, 206, 214, 254, 218, 255, 250, 254 },
-    { 251, 206, 215, 254, 218, 255, 250, 254 },
-    { 252, 207, 216, 254, 219, 255, 250, 254 },
-    { 252, 208, 216, 254, 219, 255, 250, 254 },
-    { 252, 209, 217, 254, 220, 255, 250, 254 },
-    { 252, 210, 217, 254, 220, 255, 250, 254 },
-    { 252, 211, 218, 254, 221, 255, 250, 254 },
-    { 252, 212, 218, 254, 221, 255, 250, 254 },
-    { 253, 213, 219, 254, 222, 255, 250, 254 },
-    { 253, 213, 220, 254, 222, 255, 250, 254 },
-    { 253, 214, 221, 254, 223, 255, 250, 254 },
-    { 253, 215, 221, 254, 223, 255, 250, 254 },
-    { 253, 216, 222, 254, 224, 255, 251, 254 },
-    { 253, 217, 223, 254, 224, 255, 251, 254 },
-    { 253, 218, 224, 254, 225, 255, 251, 254 },
-    { 253, 219, 224, 254, 225, 255, 251, 254 },
-    { 254, 220, 225, 254, 225, 255, 251, 254 },
-    { 254, 221, 226, 254, 225, 255, 251, 254 },
-    { 254, 222, 227, 255, 226, 255, 251, 254 },
-    { 254, 223, 227, 255, 226, 255, 251, 254 },
-    { 254, 224, 228, 255, 227, 255, 251, 254 },
-    { 254, 225, 229, 255, 227, 255, 251, 254 },
-    { 254, 226, 230, 255, 228, 255, 251, 254 },
-    { 254, 227, 230, 255, 229, 255, 251, 254 },
-    { 255, 228, 231, 255, 230, 255, 251, 254 },
-    { 255, 229, 232, 255, 230, 255, 251, 254 },
-    { 255, 230, 233, 255, 231, 255, 252, 254 },
-    { 255, 231, 234, 255, 231, 255, 252, 254 },
-    { 255, 232, 235, 255, 232, 255, 252, 254 },
-    { 255, 233, 236, 255, 232, 255, 252, 254 },
-    { 255, 235, 237, 255, 233, 255, 252, 254 },
-    { 255, 236, 238, 255, 234, 255, 252, 254 },
-    { 255, 238, 240, 255, 235, 255, 252, 255 },
-    { 255, 239, 241, 255, 235, 255, 252, 254 },
-    { 255, 241, 243, 255, 236, 255, 252, 254 },
-    { 255, 243, 245, 255, 237, 255, 252, 254 },
-    { 255, 246, 247, 255, 239, 255, 253, 255 },
-};
-
-const ProbContext ff_vp9_default_probs = {
-    { /* y_mode */
-        {  65,  32,  18, 144, 162, 194,  41,  51,  98 } /* bsize < 8x8 */,
-        { 132,  68,  18, 165, 217, 196,  45,  40,  78 } /* bsize < 16x16 */,
-        { 173,  80,  19, 176, 240, 193,  64,  35,  46 } /* bsize < 32x32 */,
-        { 221, 135,  38, 194, 248, 121,  96,  85,  29 } /* bsize >= 32x32 */
-    }, { /* uv_mode */
-        {  48,  12, 154, 155, 139,  90,  34, 117, 119 } /* y = v */,
-        {  67,   6,  25, 204, 243, 158,  13,  21,  96 } /* y = h */,
-        { 120,   7,  76, 176, 208, 126,  28,  54, 103 } /* y = dc */,
-        {  97,   5,  44, 131, 176, 139,  48,  68,  97 } /* y = d45 */,
-        {  83,   5,  42, 156, 111, 152,  26,  49, 152 } /* y = d135 */,
-        {  80,   5,  58, 178,  74,  83,  33,  62, 145 } /* y = d117 */,
-        {  86,   5,  32, 154, 192, 168,  14,  22, 163 } /* y = d153 */,
-        {  77,   7,  64, 116, 132, 122,  37, 126, 120 } /* y = d63 */,
-        {  85,   5,  32, 156, 216, 148,  19,  29,  73 } /* y = d27 */,
-        { 101,  21, 107, 181, 192, 103,  19,  67, 125 } /* y = tm */
-    }, { /* filter */
-        { 235, 162, },
-        {  36, 255, },
-        {  34,   3, },
-        { 149, 144, },
-    }, { /* mv_mode */
-        {  2, 173,  34 },  // 0 = both zero mv
-        {  7, 145,  85 },  // 1 = one zero mv + one a predicted mv
-        {  7, 166,  63 },  // 2 = two predicted mvs
-        {  7,  94,  66 },  // 3 = one predicted/zero and one new mv
-        {  8,  64,  46 },  // 4 = two new mvs
-        { 17,  81,  31 },  // 5 = one intra neighbor + x
-        { 25,  29,  30 },  // 6 = two intra neighbors
-    }, { /* intra */
-        9, 102, 187, 225
-    }, { /* comp */
-        239, 183, 119,  96,  41
-    }, { /* single_ref */
-        {  33,  16 },
-        {  77,  74 },
-        { 142, 142 },
-        { 172, 170 },
-        { 238, 247 }
-    }, { /* comp_ref */
-        50, 126, 123, 221, 226
-    }, { /* tx32p */
-        { 3, 136, 37, },
-        { 5,  52, 13, },
-    }, { /* tx16p */
-        { 20, 152, },
-        { 15, 101, },
-    }, { /* tx8p */
-        100, 66
-    }, { /* skip */
-        192, 128, 64
-    }, { /* mv_joint */
-        32, 64, 96
-    }, {
-        { /* mv vertical component */
-            128, /* sign */
-            { 224, 144, 192, 168, 192, 176, 192, 198, 198, 245 }, /* class */
-            216, /* class0 */
-            { 136, 140, 148, 160, 176, 192, 224, 234, 234, 240 }, /* bits */
-            { /* class0_fp */
-                { 128, 128, 64 },
-                {  96, 112, 64 }
-            },
-            { 64, 96, 64 }, /* fp */
-            160, /* class0_hp bit */
-            128, /* hp */
-        }, { /* mv horizontal component */
-            128, /* sign */
-            { 216, 128, 176, 160, 176, 176, 192, 198, 198, 208 }, /* class */
-            208, /* class0 */
-            { 136, 140, 148, 160, 176, 192, 224, 234, 234, 240 }, /* bits */
-            { /* class0_fp */
-                { 128, 128, 64 },
-                {  96, 112, 64 }
-            },
-            { 64, 96, 64 }, /* fp */
-            160, /* class0_hp bit */
-            128, /* hp */
-        }
-    }, { /* partition */
-        { /* 64x64 -> 32x32 */
-            { 222,  34,  30 } /* a/l both not split */,
-            {  72,  16,  44 } /* a split, l not split */,
-            {  58,  32,  12 } /* l split, a not split */,
-            {  10,   7,   6 } /* a/l both split */,
-        }, { /* 32x32 -> 16x16 */
-            { 177,  58,  59 } /* a/l both not split */,
-            {  68,  26,  63 } /* a split, l not split */,
-            {  52,  79,  25 } /* l split, a not split */,
-            {  17,  14,  12 } /* a/l both split */,
-        }, { /* 16x16 -> 8x8 */
-            { 174,  73,  87 } /* a/l both not split */,
-            {  92,  41,  83 } /* a split, l not split */,
-            {  82,  99,  50 } /* l split, a not split */,
-            {  53,  39,  39 } /* a/l both split */,
-        }, { /* 8x8 -> 4x4 */
-            { 199, 122, 141 } /* a/l both not split */,
-            { 147,  63, 159 } /* a split, l not split */,
-            { 148, 133, 118 } /* l split, a not split */,
-            { 121, 104, 114 } /* a/l both split */,
-        }
-    },
-};
-
-const uint8_t ff_vp9_default_coef_probs[4][2][2][6][6][3] = {
-    { /* tx = 4x4 */
-        { /* block Type 0 */
-            { /* Intra */
-                { /* Coeff Band 0 */
-                    { 195,  29, 183 },
-                    {  84,  49, 136 },
-                    {   8,  42,  71 }
-                }, { /* Coeff Band 1 */
-                    {  31, 107, 169 },
-                    {  35,  99, 159 },
-                    {  17,  82, 140 },
-                    {   8,  66, 114 },
-                    {   2,  44,  76 },
-                    {   1,  19,  32 }
-                }, { /* Coeff Band 2 */
-                    {  40, 132, 201 },
-                    {  29, 114, 187 },
-                    {  13,  91, 157 },
-                    {   7,  75, 127 },
-                    {   3,  58,  95 },
-                    {   1,  28,  47 }
-                }, { /* Coeff Band 3 */
-                    {  69, 142, 221 },
-                    {  42, 122, 201 },
-                    {  15,  91, 159 },
-                    {   6,  67, 121 },
-                    {   1,  42,  77 },
-                    {   1,  17,  31 }
-                }, { /* Coeff Band 4 */
-                    { 102, 148, 228 },
-                    {  67, 117, 204 },
-                    {  17,  82, 154 },
-                    {   6,  59, 114 },
-                    {   2,  39,  75 },
-                    {   1,  15,  29 }
-                }, { /* Coeff Band 5 */
-                    { 156,  57, 233 },
-                    { 119,  57, 212 },
-                    {  58,  48, 163 },
-                    {  29,  40, 124 },
-                    {  12,  30,  81 },
-                    {   3,  12,  31 }
-                }
-            }, { /* Inter */
-                { /* Coeff Band 0 */
-                    { 191, 107, 226 },
-                    { 124, 117, 204 },
-                    {  25,  99, 155 }
-                }, { /* Coeff Band 1 */
-                    {  29, 148, 210 },
-                    {  37, 126, 194 },
-                    {   8,  93, 157 },
-                    {   2,  68, 118 },
-                    {   1,  39,  69 },
-                    {   1,  17,  33 }
-                }, { /* Coeff Band 2 */
-                    {  41, 151, 213 },
-                    {  27, 123, 193 },
-                    {   3,  82, 144 },
-                    {   1,  58, 105 },
-                    {   1,  32,  60 },
-                    {   1,  13,  26 }
-                }, { /* Coeff Band 3 */
-                    {  59, 159, 220 },
-                    {  23, 126, 198 },
-                    {   4,  88, 151 },
-                    {   1,  66, 114 },
-                    {   1,  38,  71 },
-                    {   1,  18,  34 }
-                }, { /* Coeff Band 4 */
-                    { 114, 136, 232 },
-                    {  51, 114, 207 },
-                    {  11,  83, 155 },
-                    {   3,  56, 105 },
-                    {   1,  33,  65 },
-                    {   1,  17,  34 }
-                }, { /* Coeff Band 5 */
-                    { 149,  65, 234 },
-                    { 121,  57, 215 },
-                    {  61,  49, 166 },
-                    {  28,  36, 114 },
-                    {  12,  25,  76 },
-                    {   3,  16,  42 }
-                }
-            }
-        }, { /* block Type 1 */
-            { /* Intra */
-                { /* Coeff Band 0 */
-                    { 214,  49, 220 },
-                    { 132,  63, 188 },
-                    {  42,  65, 137 }
-                }, { /* Coeff Band 1 */
-                    {  85, 137, 221 },
-                    { 104, 131, 216 },
-                    {  49, 111, 192 },
-                    {  21,  87, 155 },
-                    {   2,  49,  87 },
-                    {   1,  16,  28 }
-                }, { /* Coeff Band 2 */
-                    {  89, 163, 230 },
-                    {  90, 137, 220 },
-                    {  29, 100, 183 },
-                    {  10,  70, 135 },
-                    {   2,  42,  81 },
-                    {   1,  17,  33 }
-                }, { /* Coeff Band 3 */
-                    { 108, 167, 237 },
-                    {  55, 133, 222 },
-                    {  15,  97, 179 },
-                    {   4,  72, 135 },
-                    {   1,  45,  85 },
-                    {   1,  19,  38 }
-                }, { /* Coeff Band 4 */
-                    { 124, 146, 240 },
-                    {  66, 124, 224 },
-                    {  17,  88, 175 },
-                    {   4,  58, 122 },
-                    {   1,  36,  75 },
-                    {   1,  18,  37 }
-                }, { /* Coeff Band 5 */
-                    { 141,  79, 241 },
-                    { 126,  70, 227 },
-                    {  66,  58, 182 },
-                    {  30,  44, 136 },
-                    {  12,  34,  96 },
-                    {   2,  20,  47 }
-                }
-            }, { /* Inter */
-                { /* Coeff Band 0 */
-                    { 229,  99, 249 },
-                    { 143, 111, 235 },
-                    {  46, 109, 192 }
-                }, { /* Coeff Band 1 */
-                    {  82, 158, 236 },
-                    {  94, 146, 224 },
-                    {  25, 117, 191 },
-                    {   9,  87, 149 },
-                    {   3,  56,  99 },
-                    {   1,  33,  57 }
-                }, { /* Coeff Band 2 */
-                    {  83, 167, 237 },
-                    {  68, 145, 222 },
-                    {  10, 103, 177 },
-                    {   2,  72, 131 },
-                    {   1,  41,  79 },
-                    {   1,  20,  39 }
-                }, { /* Coeff Band 3 */
-                    {  99, 167, 239 },
-                    {  47, 141, 224 },
-                    {  10, 104, 178 },
-                    {   2,  73, 133 },
-                    {   1,  44,  85 },
-                    {   1,  22,  47 }
-                }, { /* Coeff Band 4 */
-                    { 127, 145, 243 },
-                    {  71, 129, 228 },
-                    {  17,  93, 177 },
-                    {   3,  61, 124 },
-                    {   1,  41,  84 },
-                    {   1,  21,  52 }
-                }, { /* Coeff Band 5 */
-                    { 157,  78, 244 },
-                    { 140,  72, 231 },
-                    {  69,  58, 184 },
-                    {  31,  44, 137 },
-                    {  14,  38, 105 },
-                    {   8,  23,  61 }
-                }
-            }
-        }
-    }, { /* tx = 8x8 */
-        { /* block Type 0 */
-            { /* Intra */
-                { /* Coeff Band 0 */
-                    { 125,  34, 187 },
-                    {  52,  41, 133 },
-                    {   6,  31,  56 }
-                }, { /* Coeff Band 1 */
-                    {  37, 109, 153 },
-                    {  51, 102, 147 },
-                    {  23,  87, 128 },
-                    {   8,  67, 101 },
-                    {   1,  41,  63 },
-                    {   1,  19,  29 }
-                }, { /* Coeff Band 2 */
-                    {  31, 154, 185 },
-                    {  17, 127, 175 },
-                    {   6,  96, 145 },
-                    {   2,  73, 114 },
-                    {   1,  51,  82 },
-                    {   1,  28,  45 }
-                }, { /* Coeff Band 3 */
-                    {  23, 163, 200 },
-                    {  10, 131, 185 },
-                    {   2,  93, 148 },
-                    {   1,  67, 111 },
-                    {   1,  41,  69 },
-                    {   1,  14,  24 }
-                }, { /* Coeff Band 4 */
-                    {  29, 176, 217 },
-                    {  12, 145, 201 },
-                    {   3, 101, 156 },
-                    {   1,  69, 111 },
-                    {   1,  39,  63 },
-                    {   1,  14,  23 }
-                }, { /* Coeff Band 5 */
-                    {  57, 192, 233 },
-                    {  25, 154, 215 },
-                    {   6, 109, 167 },
-                    {   3,  78, 118 },
-                    {   1,  48,  69 },
-                    {   1,  21,  29 }
-                }
-            }, { /* Inter */
-                { /* Coeff Band 0 */
-                    { 202, 105, 245 },
-                    { 108, 106, 216 },
-                    {  18,  90, 144 }
-                }, { /* Coeff Band 1 */
-                    {  33, 172, 219 },
-                    {  64, 149, 206 },
-                    {  14, 117, 177 },
-                    {   5,  90, 141 },
-                    {   2,  61,  95 },
-                    {   1,  37,  57 }
-                }, { /* Coeff Band 2 */
-                    {  33, 179, 220 },
-                    {  11, 140, 198 },
-                    {   1,  89, 148 },
-                    {   1,  60, 104 },
-                    {   1,  33,  57 },
-                    {   1,  12,  21 }
-                }, { /* Coeff Band 3 */
-                    {  30, 181, 221 },
-                    {   8, 141, 198 },
-                    {   1,  87, 145 },
-                    {   1,  58, 100 },
-                    {   1,  31,  55 },
-                    {   1,  12,  20 }
-                }, { /* Coeff Band 4 */
-                    {  32, 186, 224 },
-                    {   7, 142, 198 },
-                    {   1,  86, 143 },
-                    {   1,  58, 100 },
-                    {   1,  31,  55 },
-                    {   1,  12,  22 }
-                }, { /* Coeff Band 5 */
-                    {  57, 192, 227 },
-                    {  20, 143, 204 },
-                    {   3,  96, 154 },
-                    {   1,  68, 112 },
-                    {   1,  42,  69 },
-                    {   1,  19,  32 }
-                }
-            }
-        }, { /* block Type 1 */
-            { /* Intra */
-                { /* Coeff Band 0 */
-                    { 212,  35, 215 },
-                    { 113,  47, 169 },
-                    {  29,  48, 105 }
-                }, { /* Coeff Band 1 */
-                    {  74, 129, 203 },
-                    { 106, 120, 203 },
-                    {  49, 107, 178 },
-                    {  19,  84, 144 },
-                    {   4,  50,  84 },
-                    {   1,  15,  25 }
-                }, { /* Coeff Band 2 */
-                    {  71, 172, 217 },
-                    {  44, 141, 209 },
-                    {  15, 102, 173 },
-                    {   6,  76, 133 },
-                    {   2,  51,  89 },
-                    {   1,  24,  42 }
-                }, { /* Coeff Band 3 */
-                    {  64, 185, 231 },
-                    {  31, 148, 216 },
-                    {   8, 103, 175 },
-                    {   3,  74, 131 },
-                    {   1,  46,  81 },
-                    {   1,  18,  30 }
-                }, { /* Coeff Band 4 */
-                    {  65, 196, 235 },
-                    {  25, 157, 221 },
-                    {   5, 105, 174 },
-                    {   1,  67, 120 },
-                    {   1,  38,  69 },
-                    {   1,  15,  30 }
-                }, { /* Coeff Band 5 */
-                    {  65, 204, 238 },
-                    {  30, 156, 224 },
-                    {   7, 107, 177 },
-                    {   2,  70, 124 },
-                    {   1,  42,  73 },
-                    {   1,  18,  34 }
-                }
-            }, { /* Inter */
-                { /* Coeff Band 0 */
-                    { 225,  86, 251 },
-                    { 144, 104, 235 },
-                    {  42,  99, 181 }
-                }, { /* Coeff Band 1 */
-                    {  85, 175, 239 },
-                    { 112, 165, 229 },
-                    {  29, 136, 200 },
-                    {  12, 103, 162 },
-                    {   6,  77, 123 },
-                    {   2,  53,  84 }
-                }, { /* Coeff Band 2 */
-                    {  75, 183, 239 },
-                    {  30, 155, 221 },
-                    {   3, 106, 171 },
-                    {   1,  74, 128 },
-                    {   1,  44,  76 },
-                    {   1,  17,  28 }
-                }, { /* Coeff Band 3 */
-                    {  73, 185, 240 },
-                    {  27, 159, 222 },
-                    {   2, 107, 172 },
-                    {   1,  75, 127 },
-                    {   1,  42,  73 },
-                    {   1,  17,  29 }
-                }, { /* Coeff Band 4 */
-                    {  62, 190, 238 },
-                    {  21, 159, 222 },
-                    {   2, 107, 172 },
-                    {   1,  72, 122 },
-                    {   1,  40,  71 },
-                    {   1,  18,  32 }
-                }, { /* Coeff Band 5 */
-                    {  61, 199, 240 },
-                    {  27, 161, 226 },
-                    {   4, 113, 180 },
-                    {   1,  76, 129 },
-                    {   1,  46,  80 },
-                    {   1,  23,  41 }
-                }
-            }
-        }
-    }, { /* tx = 16x16 */
-        { /* block Type 0 */
-            { /* Intra */
-                { /* Coeff Band 0 */
-                    {   7,  27, 153 },
-                    {   5,  30,  95 },
-                    {   1,  16,  30 }
-                }, { /* Coeff Band 1 */
-                    {  50,  75, 127 },
-                    {  57,  75, 124 },
-                    {  27,  67, 108 },
-                    {  10,  54,  86 },
-                    {   1,  33,  52 },
-                    {   1,  12,  18 }
-                }, { /* Coeff Band 2 */
-                    {  43, 125, 151 },
-                    {  26, 108, 148 },
-                    {   7,  83, 122 },
-                    {   2,  59,  89 },
-                    {   1,  38,  60 },
-                    {   1,  17,  27 }
-                }, { /* Coeff Band 3 */
-                    {  23, 144, 163 },
-                    {  13, 112, 154 },
-                    {   2,  75, 117 },
-                    {   1,  50,  81 },
-                    {   1,  31,  51 },
-                    {   1,  14,  23 }
-                }, { /* Coeff Band 4 */
-                    {  18, 162, 185 },
-                    {   6, 123, 171 },
-                    {   1,  78, 125 },
-                    {   1,  51,  86 },
-                    {   1,  31,  54 },
-                    {   1,  14,  23 }
-                }, { /* Coeff Band 5 */
-                    {  15, 199, 227 },
-                    {   3, 150, 204 },
-                    {   1,  91, 146 },
-                    {   1,  55,  95 },
-                    {   1,  30,  53 },
-                    {   1,  11,  20 }
-                }
-            }, { /* Inter */
-                { /* Coeff Band 0 */
-                    {  19,  55, 240 },
-                    {  19,  59, 196 },
-                    {   3,  52, 105 }
-                }, { /* Coeff Band 1 */
-                    {  41, 166, 207 },
-                    { 104, 153, 199 },
-                    {  31, 123, 181 },
-                    {  14, 101, 152 },
-                    {   5,  72, 106 },
-                    {   1,  36,  52 }
-                }, { /* Coeff Band 2 */
-                    {  35, 176, 211 },
-                    {  12, 131, 190 },
-                    {   2,  88, 144 },
-                    {   1,  60, 101 },
-                    {   1,  36,  60 },
-                    {   1,  16,  28 }
-                }, { /* Coeff Band 3 */
-                    {  28, 183, 213 },
-                    {   8, 134, 191 },
-                    {   1,  86, 142 },
-                    {   1,  56,  96 },
-                    {   1,  30,  53 },
-                    {   1,  12,  20 }
-                }, { /* Coeff Band 4 */
-                    {  20, 190, 215 },
-                    {   4, 135, 192 },
-                    {   1,  84, 139 },
-                    {   1,  53,  91 },
-                    {   1,  28,  49 },
-                    {   1,  11,  20 }
-                }, { /* Coeff Band 5 */
-                    {  13, 196, 216 },
-                    {   2, 137, 192 },
-                    {   1,  86, 143 },
-                    {   1,  57,  99 },
-                    {   1,  32,  56 },
-                    {   1,  13,  24 }
-                }
-            }
-        }, { /* block Type 1 */
-            { /* Intra */
-                { /* Coeff Band 0 */
-                    { 211,  29, 217 },
-                    {  96,  47, 156 },
-                    {  22,  43,  87 }
-                }, { /* Coeff Band 1 */
-                    {  78, 120, 193 },
-                    { 111, 116, 186 },
-                    {  46, 102, 164 },
-                    {  15,  80, 128 },
-                    {   2,  49,  76 },
-                    {   1,  18,  28 }
-                }, { /* Coeff Band 2 */
-                    {  71, 161, 203 },
-                    {  42, 132, 192 },
-                    {  10,  98, 150 },
-                    {   3,  69, 109 },
-                    {   1,  44,  70 },
-                    {   1,  18,  29 }
-                }, { /* Coeff Band 3 */
-                    {  57, 186, 211 },
-                    {  30, 140, 196 },
-                    {   4,  93, 146 },
-                    {   1,  62, 102 },
-                    {   1,  38,  65 },
-                    {   1,  16,  27 }
-                }, { /* Coeff Band 4 */
-                    {  47, 199, 217 },
-                    {  14, 145, 196 },
-                    {   1,  88, 142 },
-                    {   1,  57,  98 },
-                    {   1,  36,  62 },
-                    {   1,  15,  26 }
-                }, { /* Coeff Band 5 */
-                    {  26, 219, 229 },
-                    {   5, 155, 207 },
-                    {   1,  94, 151 },
-                    {   1,  60, 104 },
-                    {   1,  36,  62 },
-                    {   1,  16,  28 }
-                }
-            }, { /* Inter */
-                { /* Coeff Band 0 */
-                    { 233,  29, 248 },
-                    { 146,  47, 220 },
-                    {  43,  52, 140 }
-                }, { /* Coeff Band 1 */
-                    { 100, 163, 232 },
-                    { 179, 161, 222 },
-                    {  63, 142, 204 },
-                    {  37, 113, 174 },
-                    {  26,  89, 137 },
-                    {  18,  68,  97 }
-                }, { /* Coeff Band 2 */
-                    {  85, 181, 230 },
-                    {  32, 146, 209 },
-                    {   7, 100, 164 },
-                    {   3,  71, 121 },
-                    {   1,  45,  77 },
-                    {   1,  18,  30 }
-                }, { /* Coeff Band 3 */
-                    {  65, 187, 230 },
-                    {  20, 148, 207 },
-                    {   2,  97, 159 },
-                    {   1,  68, 116 },
-                    {   1,  40,  70 },
-                    {   1,  14,  29 }
-                }, { /* Coeff Band 4 */
-                    {  40, 194, 227 },
-                    {   8, 147, 204 },
-                    {   1,  94, 155 },
-                    {   1,  65, 112 },
-                    {   1,  39,  66 },
-                    {   1,  14,  26 }
-                }, { /* Coeff Band 5 */
-                    {  16, 208, 228 },
-                    {   3, 151, 207 },
-                    {   1,  98, 160 },
-                    {   1,  67, 117 },
-                    {   1,  41,  74 },
-                    {   1,  17,  31 }
-                }
-            }
-        }
-    }, { /* tx = 32x32 */
-        { /* block Type 0 */
-            { /* Intra */
-                { /* Coeff Band 0 */
-                    {  17,  38, 140 },
-                    {   7,  34,  80 },
-                    {   1,  17,  29 }
-                }, { /* Coeff Band 1 */
-                    {  37,  75, 128 },
-                    {  41,  76, 128 },
-                    {  26,  66, 116 },
-                    {  12,  52,  94 },
-                    {   2,  32,  55 },
-                    {   1,  10,  16 }
-                }, { /* Coeff Band 2 */
-                    {  50, 127, 154 },
-                    {  37, 109, 152 },
-                    {  16,  82, 121 },
-                    {   5,  59,  85 },
-                    {   1,  35,  54 },
-                    {   1,  13,  20 }
-                }, { /* Coeff Band 3 */
-                    {  40, 142, 167 },
-                    {  17, 110, 157 },
-                    {   2,  71, 112 },
-                    {   1,  44,  72 },
-                    {   1,  27,  45 },
-                    {   1,  11,  17 }
-                }, { /* Coeff Band 4 */
-                    {  30, 175, 188 },
-                    {   9, 124, 169 },
-                    {   1,  74, 116 },
-                    {   1,  48,  78 },
-                    {   1,  30,  49 },
-                    {   1,  11,  18 }
-                }, { /* Coeff Band 5 */
-                    {  10, 222, 223 },
-                    {   2, 150, 194 },
-                    {   1,  83, 128 },
-                    {   1,  48,  79 },
-                    {   1,  27,  45 },
-                    {   1,  11,  17 }
-                }
-            }, { /* Inter */
-                { /* Coeff Band 0 */
-                    {  36,  41, 235 },
-                    {  29,  36, 193 },
-                    {  10,  27, 111 }
-                }, { /* Coeff Band 1 */
-                    {  85, 165, 222 },
-                    { 177, 162, 215 },
-                    { 110, 135, 195 },
-                    {  57, 113, 168 },
-                    {  23,  83, 120 },
-                    {  10,  49,  61 }
-                }, { /* Coeff Band 2 */
-                    {  85, 190, 223 },
-                    {  36, 139, 200 },
-                    {   5,  90, 146 },
-                    {   1,  60, 103 },
-                    {   1,  38,  65 },
-                    {   1,  18,  30 }
-                }, { /* Coeff Band 3 */
-                    {  72, 202, 223 },
-                    {  23, 141, 199 },
-                    {   2,  86, 140 },
-                    {   1,  56,  97 },
-                    {   1,  36,  61 },
-                    {   1,  16,  27 }
-                }, { /* Coeff Band 4 */
-                    {  55, 218, 225 },
-                    {  13, 145, 200 },
-                    {   1,  86, 141 },
-                    {   1,  57,  99 },
-                    {   1,  35,  61 },
-                    {   1,  13,  22 }
-                }, { /* Coeff Band 5 */
-                    {  15, 235, 212 },
-                    {   1, 132, 184 },
-                    {   1,  84, 139 },
-                    {   1,  57,  97 },
-                    {   1,  34,  56 },
-                    {   1,  14,  23 }
-                }
-            }
-        }, { /* block Type 1 */
-            { /* Intra */
-                { /* Coeff Band 0 */
-                    { 181,  21, 201 },
-                    {  61,  37, 123 },
-                    {  10,  38,  71 }
-                }, { /* Coeff Band 1 */
-                    {  47, 106, 172 },
-                    {  95, 104, 173 },
-                    {  42,  93, 159 },
-                    {  18,  77, 131 },
-                    {   4,  50,  81 },
-                    {   1,  17,  23 }
-                }, { /* Coeff Band 2 */
-                    {  62, 147, 199 },
-                    {  44, 130, 189 },
-                    {  28, 102, 154 },
-                    {  18,  75, 115 },
-                    {   2,  44,  65 },
-                    {   1,  12,  19 }
-                }, { /* Coeff Band 3 */
-                    {  55, 153, 210 },
-                    {  24, 130, 194 },
-                    {   3,  93, 146 },
-                    {   1,  61,  97 },
-                    {   1,  31,  50 },
-                    {   1,  10,  16 }
-                }, { /* Coeff Band 4 */
-                    {  49, 186, 223 },
-                    {  17, 148, 204 },
-                    {   1,  96, 142 },
-                    {   1,  53,  83 },
-                    {   1,  26,  44 },
-                    {   1,  11,  17 }
-                }, { /* Coeff Band 5 */
-                    {  13, 217, 212 },
-                    {   2, 136, 180 },
-                    {   1,  78, 124 },
-                    {   1,  50,  83 },
-                    {   1,  29,  49 },
-                    {   1,  14,  23 }
-                }
-            }, { /* Inter */
-                { /* Coeff Band 0 */
-                    { 197,  13, 247 },
-                    {  82,  17, 222 },
-                    {  25,  17, 162 }
-                }, { /* Coeff Band 1 */
-                    { 126, 186, 247 },
-                    { 234, 191, 243 },
-                    { 176, 177, 234 },
-                    { 104, 158, 220 },
-                    {  66, 128, 186 },
-                    {  55,  90, 137 }
-                }, { /* Coeff Band 2 */
-                    { 111, 197, 242 },
-                    {  46, 158, 219 },
-                    {   9, 104, 171 },
-                    {   2,  65, 125 },
-                    {   1,  44,  80 },
-                    {   1,  17,  91 }
-                }, { /* Coeff Band 3 */
-                    { 104, 208, 245 },
-                    {  39, 168, 224 },
-                    {   3, 109, 162 },
-                    {   1,  79, 124 },
-                    {   1,  50, 102 },
-                    {   1,  43, 102 }
-                }, { /* Coeff Band 4 */
-                    {  84, 220, 246 },
-                    {  31, 177, 231 },
-                    {   2, 115, 180 },
-                    {   1,  79, 134 },
-                    {   1,  55,  77 },
-                    {   1,  60,  79 }
-                }, { /* Coeff Band 5 */
-                    {  43, 243, 240 },
-                    {   8, 180, 217 },
-                    {   1, 115, 166 },
-                    {   1,  84, 121 },
-                    {   1,  51,  67 },
-                    {   1,  16,   6 }
-                }
-            }
-        }
-    }
-};
-
-const int8_t ff_vp9_mv_joint_tree[3][2] = {
-    { -MV_JOINT_ZERO,            1 }, // '0'
-    {    -MV_JOINT_H,            2 }, // '10'
-    {    -MV_JOINT_V, -MV_JOINT_HV }, // '11x'
-};
-
-const int8_t ff_vp9_mv_class_tree[10][2] = {
-    { -0,   1 }, // '0'
-    { -1,   2 }, // '10'
-    {  3,   4 },
-    { -2,  -3 }, // '110x'
-    {  5,   6 },
-    { -4,  -5 }, // '1110x'
-    { -6,   7 }, // '11110'
-    {  8,   9 },
-    { -7,  -8 }, // '111110x'
-    { -9, -10 }, // '111111x'
-};
-
-const int8_t ff_vp9_mv_fp_tree[3][2] = {
-    { -0,  1 },   // '0'
-    { -1,  2 },   // '10'
-    { -2, -3 },   // '11x'
-};
diff --git a/deps/libav/libavcodec/vp9data.h b/deps/libav/libavcodec/vp9data.h
deleted file mode 100644
index a52cc0a..0000000
--- a/deps/libav/libavcodec/vp9data.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
- * Copyright (C) 2013 Clément Bœsch <u pkh me>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VP9DATA_H
-#define AVCODEC_VP9DATA_H
-
-#include <stdint.h>
-
-#include "vp9.h"
-
-extern const int8_t ff_vp9_partition_tree[3][2];
-extern const uint8_t ff_vp9_default_kf_partition_probs[4][4][3];
-extern const int8_t ff_vp9_segmentation_tree[7][2];
-extern const int8_t ff_vp9_intramode_tree[9][2];
-extern const uint8_t ff_vp9_default_kf_ymode_probs[10][10][9];
-extern const uint8_t ff_vp9_default_kf_uvmode_probs[10][9];
-extern const int8_t ff_vp9_inter_mode_tree[3][2];
-extern const int8_t ff_vp9_filter_tree[2][2];
-extern const enum FilterMode ff_vp9_filter_lut[3];
-extern const int16_t ff_vp9_dc_qlookup[256];
-extern const int16_t ff_vp9_ac_qlookup[256];
-extern const enum TxfmType ff_vp9_intra_txfm_type[14];
-extern const int16_t ff_vp9_default_scan_4x4[16];
-extern const int16_t ff_vp9_col_scan_4x4[16];
-extern const int16_t ff_vp9_row_scan_4x4[16];
-extern const int16_t ff_vp9_default_scan_8x8[64];
-extern const int16_t ff_vp9_col_scan_8x8[64];
-extern const int16_t ff_vp9_row_scan_8x8[64];
-extern const int16_t ff_vp9_default_scan_16x16[256];
-extern const int16_t ff_vp9_col_scan_16x16[256];
-extern const int16_t ff_vp9_row_scan_16x16[256];
-extern const int16_t ff_vp9_default_scan_32x32[1024];
-extern const int16_t *ff_vp9_scans[5][4];
-extern const int16_t ff_vp9_default_scan_4x4_nb[16][2];
-extern const int16_t ff_vp9_col_scan_4x4_nb[16][2];
-extern const int16_t ff_vp9_row_scan_4x4_nb[16][2];
-extern const int16_t ff_vp9_default_scan_8x8_nb[64][2];
-extern const int16_t ff_vp9_col_scan_8x8_nb[64][2];
-extern const int16_t ff_vp9_row_scan_8x8_nb[64][2];
-extern const int16_t ff_vp9_default_scan_16x16_nb[256][2];
-extern const int16_t ff_vp9_col_scan_16x16_nb[256][2];
-extern const int16_t ff_vp9_row_scan_16x16_nb[256][2];
-extern const int16_t ff_vp9_default_scan_32x32_nb[1024][2];
-extern const int16_t (*ff_vp9_scans_nb[5][4])[2];
-extern const uint8_t ff_vp9_model_pareto8[256][8];
-extern const ProbContext ff_vp9_default_probs;
-extern const uint8_t ff_vp9_default_coef_probs[4][2][2][6][6][3];
-extern const int8_t ff_vp9_mv_joint_tree[3][2];
-extern const int8_t ff_vp9_mv_class_tree[10][2];
-extern const int8_t ff_vp9_mv_fp_tree[3][2];
-
-#endif /* AVCODEC_VP9DATA_H */
diff --git a/deps/libav/libavcodec/vp9dsp.c b/deps/libav/libavcodec/vp9dsp.c
deleted file mode 100644
index c83defe..0000000
--- a/deps/libav/libavcodec/vp9dsp.c
+++ /dev/null
@@ -1,2174 +0,0 @@
-/*
- * VP9 compatible video decoder
- *
- * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
- * Copyright (C) 2013 Clément Bœsch <u pkh me>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-
-#include "rnd_avg.h"
-#include "vp9.h"
-
-// FIXME see whether we can merge parts of this (perhaps at least 4x4 and 8x8)
-// back with h264pred.[ch]
-
-static void vert_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                       const uint8_t *left, const uint8_t *top)
-{
-    unsigned p4 = AV_RN32A(top);
-
-    AV_WN32A(dst + stride * 0, p4);
-    AV_WN32A(dst + stride * 1, p4);
-    AV_WN32A(dst + stride * 2, p4);
-    AV_WN32A(dst + stride * 3, p4);
-}
-
-static void vert_8x8_c(uint8_t *dst, ptrdiff_t stride,
-                       const uint8_t *left, const uint8_t *top)
-{
-    uint64_t p8 = AV_RN64A(top);
-    int y;
-
-    for (y = 0; y < 8; y++) {
-        AV_WN64A(dst, p8);
-        dst += stride;
-    }
-}
-
-static void vert_16x16_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    uint64_t p8a = AV_RN64A(top + 0), p8b = AV_RN64A(top + 8);
-    int y;
-
-    for (y = 0; y < 16; y++) {
-        AV_WN64A(dst + 0, p8a);
-        AV_WN64A(dst + 8, p8b);
-        dst += stride;
-    }
-}
-
-static void vert_32x32_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    uint64_t p8a = AV_RN64A(top + 0),  p8b = AV_RN64A(top + 8),
-             p8c = AV_RN64A(top + 16), p8d = AV_RN64A(top + 24);
-    int y;
-
-    for (y = 0; y < 32; y++) {
-        AV_WN64A(dst +  0, p8a);
-        AV_WN64A(dst +  8, p8b);
-        AV_WN64A(dst + 16, p8c);
-        AV_WN64A(dst + 24, p8d);
-        dst += stride;
-    }
-}
-
-static void hor_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                      const uint8_t *left, const uint8_t *top)
-{
-    AV_WN32A(dst + stride * 0, left[0] * 0x01010101U);
-    AV_WN32A(dst + stride * 1, left[1] * 0x01010101U);
-    AV_WN32A(dst + stride * 2, left[2] * 0x01010101U);
-    AV_WN32A(dst + stride * 3, left[3] * 0x01010101U);
-}
-
-static void hor_8x8_c(uint8_t *dst, ptrdiff_t stride,
-                      const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 8; y++) {
-        AV_WN64A(dst, left[y] * 0x0101010101010101ULL);
-        dst += stride;
-    }
-}
-
-static void hor_16x16_c(uint8_t *dst, ptrdiff_t stride,
-                        const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 16; y++) {
-        uint64_t p8 = left[y] * 0x0101010101010101ULL;
-
-        AV_WN64A(dst + 0, p8);
-        AV_WN64A(dst + 8, p8);
-        dst += stride;
-    }
-}
-
-static void hor_32x32_c(uint8_t *dst, ptrdiff_t stride,
-                        const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 32; y++) {
-        uint64_t p8 = left[y] * 0x0101010101010101ULL;
-
-        AV_WN64A(dst +  0, p8);
-        AV_WN64A(dst +  8, p8);
-        AV_WN64A(dst + 16, p8);
-        AV_WN64A(dst + 24, p8);
-        dst += stride;
-    }
-}
-
-static void tm_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                     const uint8_t *left, const uint8_t *top)
-{
-    int y, tl = top[-1];
-
-    for (y = 0; y < 4; y++) {
-        int l_m_tl = left[y] - tl;
-
-        dst[0] = av_clip_uint8(top[0] + l_m_tl);
-        dst[1] = av_clip_uint8(top[1] + l_m_tl);
-        dst[2] = av_clip_uint8(top[2] + l_m_tl);
-        dst[3] = av_clip_uint8(top[3] + l_m_tl);
-        dst   += stride;
-    }
-}
-
-static void tm_8x8_c(uint8_t *dst, ptrdiff_t stride,
-                     const uint8_t *left, const uint8_t *top)
-{
-    int y, tl = top[-1];
-
-    for (y = 0; y < 8; y++) {
-        int l_m_tl = left[y] - tl;
-
-        dst[0] = av_clip_uint8(top[0] + l_m_tl);
-        dst[1] = av_clip_uint8(top[1] + l_m_tl);
-        dst[2] = av_clip_uint8(top[2] + l_m_tl);
-        dst[3] = av_clip_uint8(top[3] + l_m_tl);
-        dst[4] = av_clip_uint8(top[4] + l_m_tl);
-        dst[5] = av_clip_uint8(top[5] + l_m_tl);
-        dst[6] = av_clip_uint8(top[6] + l_m_tl);
-        dst[7] = av_clip_uint8(top[7] + l_m_tl);
-        dst   += stride;
-    }
-}
-
-static void tm_16x16_c(uint8_t *dst, ptrdiff_t stride,
-                       const uint8_t *left, const uint8_t *top)
-{
-    int y, tl = top[-1];
-
-    for (y = 0; y < 16; y++) {
-        int l_m_tl = left[y] - tl;
-
-        dst[0]  = av_clip_uint8(top[0]  + l_m_tl);
-        dst[1]  = av_clip_uint8(top[1]  + l_m_tl);
-        dst[2]  = av_clip_uint8(top[2]  + l_m_tl);
-        dst[3]  = av_clip_uint8(top[3]  + l_m_tl);
-        dst[4]  = av_clip_uint8(top[4]  + l_m_tl);
-        dst[5]  = av_clip_uint8(top[5]  + l_m_tl);
-        dst[6]  = av_clip_uint8(top[6]  + l_m_tl);
-        dst[7]  = av_clip_uint8(top[7]  + l_m_tl);
-        dst[8]  = av_clip_uint8(top[8]  + l_m_tl);
-        dst[9]  = av_clip_uint8(top[9]  + l_m_tl);
-        dst[10] = av_clip_uint8(top[10] + l_m_tl);
-        dst[11] = av_clip_uint8(top[11] + l_m_tl);
-        dst[12] = av_clip_uint8(top[12] + l_m_tl);
-        dst[13] = av_clip_uint8(top[13] + l_m_tl);
-        dst[14] = av_clip_uint8(top[14] + l_m_tl);
-        dst[15] = av_clip_uint8(top[15] + l_m_tl);
-        dst    += stride;
-    }
-}
-
-static void tm_32x32_c(uint8_t *dst, ptrdiff_t stride,
-                       const uint8_t *left, const uint8_t *top)
-{
-    int y, tl = top[-1];
-
-    for (y = 0; y < 32; y++) {
-        int l_m_tl = left[y] - tl;
-
-        dst[0]  = av_clip_uint8(top[0]  + l_m_tl);
-        dst[1]  = av_clip_uint8(top[1]  + l_m_tl);
-        dst[2]  = av_clip_uint8(top[2]  + l_m_tl);
-        dst[3]  = av_clip_uint8(top[3]  + l_m_tl);
-        dst[4]  = av_clip_uint8(top[4]  + l_m_tl);
-        dst[5]  = av_clip_uint8(top[5]  + l_m_tl);
-        dst[6]  = av_clip_uint8(top[6]  + l_m_tl);
-        dst[7]  = av_clip_uint8(top[7]  + l_m_tl);
-        dst[8]  = av_clip_uint8(top[8]  + l_m_tl);
-        dst[9]  = av_clip_uint8(top[9]  + l_m_tl);
-        dst[10] = av_clip_uint8(top[10] + l_m_tl);
-        dst[11] = av_clip_uint8(top[11] + l_m_tl);
-        dst[12] = av_clip_uint8(top[12] + l_m_tl);
-        dst[13] = av_clip_uint8(top[13] + l_m_tl);
-        dst[14] = av_clip_uint8(top[14] + l_m_tl);
-        dst[15] = av_clip_uint8(top[15] + l_m_tl);
-        dst[16] = av_clip_uint8(top[16] + l_m_tl);
-        dst[17] = av_clip_uint8(top[17] + l_m_tl);
-        dst[18] = av_clip_uint8(top[18] + l_m_tl);
-        dst[19] = av_clip_uint8(top[19] + l_m_tl);
-        dst[20] = av_clip_uint8(top[20] + l_m_tl);
-        dst[21] = av_clip_uint8(top[21] + l_m_tl);
-        dst[22] = av_clip_uint8(top[22] + l_m_tl);
-        dst[23] = av_clip_uint8(top[23] + l_m_tl);
-        dst[24] = av_clip_uint8(top[24] + l_m_tl);
-        dst[25] = av_clip_uint8(top[25] + l_m_tl);
-        dst[26] = av_clip_uint8(top[26] + l_m_tl);
-        dst[27] = av_clip_uint8(top[27] + l_m_tl);
-        dst[28] = av_clip_uint8(top[28] + l_m_tl);
-        dst[29] = av_clip_uint8(top[29] + l_m_tl);
-        dst[30] = av_clip_uint8(top[30] + l_m_tl);
-        dst[31] = av_clip_uint8(top[31] + l_m_tl);
-        dst    += stride;
-    }
-}
-
-static void dc_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                     const uint8_t *left, const uint8_t *top)
-{
-    unsigned dc = 0x01010101U *
-                  ((left[0] + left[1] + left[2] + left[3] +
-                    top[0]  + top[1]  + top[2]  + top[3]  + 4) >> 3);
-
-    AV_WN32A(dst + stride * 0, dc);
-    AV_WN32A(dst + stride * 1, dc);
-    AV_WN32A(dst + stride * 2, dc);
-    AV_WN32A(dst + stride * 3, dc);
-}
-
-static void dc_8x8_c(uint8_t *dst, ptrdiff_t stride,
-                     const uint8_t *left, const uint8_t *top)
-{
-    uint64_t dc = 0x0101010101010101ULL *
-                  ((left[0] + left[1] + left[2] + left[3] +
-                    left[4] + left[5] + left[6] + left[7] +
-                    top[0]  + top[1]  + top[2]  + top[3]  +
-                    top[4]  + top[5]  + top[6]  + top[7]  + 8) >> 4);
-    int y;
-
-    for (y = 0; y < 8; y++) {
-        AV_WN64A(dst, dc);
-        dst += stride;
-    }
-}
-
-static void dc_16x16_c(uint8_t *dst, ptrdiff_t stride,
-                       const uint8_t *left, const uint8_t *top)
-{
-    uint64_t dc = 0x0101010101010101ULL *
-                  ((left[0]  + left[1]  + left[2]  + left[3]  +
-                    left[4]  + left[5]  + left[6]  + left[7]  +
-                    left[8]  + left[9]  + left[10] + left[11] +
-                    left[12] + left[13] + left[14] + left[15] +
-                    top[0]   + top[1]   + top[2]   + top[3]   +
-                    top[4]   + top[5]   + top[6]   + top[7]   +
-                    top[8]   + top[9]   + top[10]  + top[11]  +
-                    top[12]  + top[13]  + top[14]  + top[15]  + 16) >> 5);
-    int y;
-
-    for (y = 0; y < 16; y++) {
-        AV_WN64A(dst + 0, dc);
-        AV_WN64A(dst + 8, dc);
-        dst += stride;
-    }
-}
-
-static void dc_32x32_c(uint8_t *dst, ptrdiff_t stride,
-                       const uint8_t *left, const uint8_t *top)
-{
-    uint64_t dc = 0x0101010101010101ULL *
-                  ((left[0]  + left[1]  + left[2]  + left[3]  +
-                    left[4]  + left[5]  + left[6]  + left[7]  +
-                    left[8]  + left[9]  + left[10] + left[11] +
-                    left[12] + left[13] + left[14] + left[15] +
-                    left[16] + left[17] + left[18] + left[19] +
-                    left[20] + left[21] + left[22] + left[23] +
-                    left[24] + left[25] + left[26] + left[27] +
-                    left[28] + left[29] + left[30] + left[31] +
-                    top[0]   + top[1]   + top[2]   + top[3]   +
-                    top[4]   + top[5]   + top[6]   + top[7]   +
-                    top[8]   + top[9]   + top[10]  + top[11]  +
-                    top[12]  + top[13]  + top[14]  + top[15]  +
-                    top[16]  + top[17]  + top[18]  + top[19]  +
-                    top[20]  + top[21]  + top[22]  + top[23]  +
-                    top[24]  + top[25]  + top[26]  + top[27]  +
-                    top[28]  + top[29]  + top[30]  + top[31]  + 32) >> 6);
-    int y;
-
-    for (y = 0; y < 32; y++) {
-        AV_WN64A(dst +  0, dc);
-        AV_WN64A(dst +  8, dc);
-        AV_WN64A(dst + 16, dc);
-        AV_WN64A(dst + 24, dc);
-        dst += stride;
-    }
-}
-
-static void dc_left_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                          const uint8_t *left, const uint8_t *top)
-{
-    unsigned dc = 0x01010101U *
-                  ((left[0] + left[1] + left[2] + left[3] + 2) >> 2);
-
-    AV_WN32A(dst + stride * 0, dc);
-    AV_WN32A(dst + stride * 1, dc);
-    AV_WN32A(dst + stride * 2, dc);
-    AV_WN32A(dst + stride * 3, dc);
-}
-
-static void dc_left_8x8_c(uint8_t *dst, ptrdiff_t stride,
-                          const uint8_t *left, const uint8_t *top)
-{
-    uint64_t dc = 0x0101010101010101ULL *
-                  ((left[0] + left[1] + left[2] + left[3] +
-                    left[4] + left[5] + left[6] + left[7] + 4) >> 3);
-    int y;
-
-    for (y = 0; y < 8; y++) {
-        AV_WN64A(dst, dc);
-        dst += stride;
-    }
-}
-
-static void dc_left_16x16_c(uint8_t *dst, ptrdiff_t stride,
-                            const uint8_t *left, const uint8_t *top)
-{
-    uint64_t dc = 0x0101010101010101ULL *
-                  ((left[0]  + left[1]  + left[2]  + left[3]  +
-                    left[4]  + left[5]  + left[6]  + left[7]  +
-                    left[8]  + left[9]  + left[10] + left[11] +
-                    left[12] + left[13] + left[14] + left[15] + 8) >> 4);
-    int y;
-
-    for (y = 0; y < 16; y++) {
-        AV_WN64A(dst + 0, dc);
-        AV_WN64A(dst + 8, dc);
-        dst += stride;
-    }
-}
-
-static void dc_left_32x32_c(uint8_t *dst, ptrdiff_t stride,
-                            const uint8_t *left, const uint8_t *top)
-{
-    uint64_t dc = 0x0101010101010101ULL *
-                  ((left[0]  + left[1]  + left[2]  + left[3]  +
-                    left[4]  + left[5]  + left[6]  + left[7]  +
-                    left[8]  + left[9]  + left[10] + left[11] +
-                    left[12] + left[13] + left[14] + left[15] +
-                    left[16] + left[17] + left[18] + left[19] +
-                    left[20] + left[21] + left[22] + left[23] +
-                    left[24] + left[25] + left[26] + left[27] +
-                    left[28] + left[29] + left[30] + left[31] + 16) >> 5);
-    int y;
-
-    for (y = 0; y < 32; y++) {
-        AV_WN64A(dst +  0, dc);
-        AV_WN64A(dst +  8, dc);
-        AV_WN64A(dst + 16, dc);
-        AV_WN64A(dst + 24, dc);
-        dst += stride;
-    }
-}
-
-static void dc_top_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    unsigned dc = 0x01010101U * ((top[0] + top[1] + top[2] + top[3] + 2) >> 2);
-
-    AV_WN32A(dst + stride * 0, dc);
-    AV_WN32A(dst + stride * 1, dc);
-    AV_WN32A(dst + stride * 2, dc);
-    AV_WN32A(dst + stride * 3, dc);
-}
-
-static void dc_top_8x8_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    uint64_t dc = 0x0101010101010101ULL *
-                  ((top[0] + top[1] + top[2] + top[3] +
-                    top[4] + top[5] + top[6] + top[7] + 4) >> 3);
-    int y;
-
-    for (y = 0; y < 8; y++) {
-        AV_WN64A(dst, dc);
-        dst += stride;
-    }
-}
-
-static void dc_top_16x16_c(uint8_t *dst, ptrdiff_t stride,
-                           const uint8_t *left, const uint8_t *top)
-{
-    uint64_t dc = 0x0101010101010101ULL *
-                  ((top[0]  + top[1]  + top[2]  + top[3]  +
-                    top[4]  + top[5]  + top[6]  + top[7]  +
-                    top[8]  + top[9]  + top[10] + top[11] +
-                    top[12] + top[13] + top[14] + top[15] + 8) >> 4);
-    int y;
-
-    for (y = 0; y < 16; y++) {
-        AV_WN64A(dst + 0, dc);
-        AV_WN64A(dst + 8, dc);
-        dst += stride;
-    }
-}
-
-static void dc_top_32x32_c(uint8_t *dst, ptrdiff_t stride,
-                           const uint8_t *left, const uint8_t *top)
-{
-    uint64_t dc = 0x0101010101010101ULL *
-                  ((top[0]  + top[1]  + top[2]  + top[3]  +
-                    top[4]  + top[5]  + top[6]  + top[7]  +
-                    top[8]  + top[9]  + top[10] + top[11] +
-                    top[12] + top[13] + top[14] + top[15] +
-                    top[16] + top[17] + top[18] + top[19] +
-                    top[20] + top[21] + top[22] + top[23] +
-                    top[24] + top[25] + top[26] + top[27] +
-                    top[28] + top[29] + top[30] + top[31] + 16) >> 5);
-    int y;
-
-    for (y = 0; y < 32; y++) {
-        AV_WN64A(dst +  0, dc);
-        AV_WN64A(dst +  8, dc);
-        AV_WN64A(dst + 16, dc);
-        AV_WN64A(dst + 24, dc);
-        dst += stride;
-    }
-}
-
-static void dc_128_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    AV_WN32A(dst + stride * 0, 0x80808080U);
-    AV_WN32A(dst + stride * 1, 0x80808080U);
-    AV_WN32A(dst + stride * 2, 0x80808080U);
-    AV_WN32A(dst + stride * 3, 0x80808080U);
-}
-
-static void dc_128_8x8_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 8; y++) {
-        AV_WN64A(dst, 0x8080808080808080ULL);
-        dst += stride;
-    }
-}
-
-static void dc_128_16x16_c(uint8_t *dst, ptrdiff_t stride,
-                           const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 16; y++) {
-        AV_WN64A(dst + 0, 0x8080808080808080ULL);
-        AV_WN64A(dst + 8, 0x8080808080808080ULL);
-        dst += stride;
-    }
-}
-
-static void dc_128_32x32_c(uint8_t *dst, ptrdiff_t stride,
-                           const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 32; y++) {
-        AV_WN64A(dst +  0, 0x8080808080808080ULL);
-        AV_WN64A(dst +  8, 0x8080808080808080ULL);
-        AV_WN64A(dst + 16, 0x8080808080808080ULL);
-        AV_WN64A(dst + 24, 0x8080808080808080ULL);
-        dst += stride;
-    }
-}
-
-static void dc_127_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    AV_WN32A(dst + stride * 0, 0x7F7F7F7FU);
-    AV_WN32A(dst + stride * 1, 0x7F7F7F7FU);
-    AV_WN32A(dst + stride * 2, 0x7F7F7F7FU);
-    AV_WN32A(dst + stride * 3, 0x7F7F7F7FU);
-}
-
-static void dc_127_8x8_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 8; y++) {
-        AV_WN64A(dst, 0x7F7F7F7F7F7F7F7FULL);
-        dst += stride;
-    }
-}
-
-static void dc_127_16x16_c(uint8_t *dst, ptrdiff_t stride,
-                           const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 16; y++) {
-        AV_WN64A(dst + 0, 0x7F7F7F7F7F7F7F7FULL);
-        AV_WN64A(dst + 8, 0x7F7F7F7F7F7F7F7FULL);
-        dst += stride;
-    }
-}
-
-static void dc_127_32x32_c(uint8_t *dst, ptrdiff_t stride,
-                           const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 32; y++) {
-        AV_WN64A(dst +  0, 0x7F7F7F7F7F7F7F7FULL);
-        AV_WN64A(dst +  8, 0x7F7F7F7F7F7F7F7FULL);
-        AV_WN64A(dst + 16, 0x7F7F7F7F7F7F7F7FULL);
-        AV_WN64A(dst + 24, 0x7F7F7F7F7F7F7F7FULL);
-        dst += stride;
-    }
-}
-
-static void dc_129_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    AV_WN32A(dst + stride * 0, 0x81818181U);
-    AV_WN32A(dst + stride * 1, 0x81818181U);
-    AV_WN32A(dst + stride * 2, 0x81818181U);
-    AV_WN32A(dst + stride * 3, 0x81818181U);
-}
-
-static void dc_129_8x8_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 8; y++) {
-        AV_WN64A(dst, 0x8181818181818181ULL);
-        dst += stride;
-    }
-}
-
-static void dc_129_16x16_c(uint8_t *dst, ptrdiff_t stride,
-                           const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 16; y++) {
-        AV_WN64A(dst + 0, 0x8181818181818181ULL);
-        AV_WN64A(dst + 8, 0x8181818181818181ULL);
-        dst += stride;
-    }
-}
-
-static void dc_129_32x32_c(uint8_t *dst, ptrdiff_t stride,
-                           const uint8_t *left, const uint8_t *top)
-{
-    int y;
-
-    for (y = 0; y < 32; y++) {
-        AV_WN64A(dst +  0, 0x8181818181818181ULL);
-        AV_WN64A(dst +  8, 0x8181818181818181ULL);
-        AV_WN64A(dst + 16, 0x8181818181818181ULL);
-        AV_WN64A(dst + 24, 0x8181818181818181ULL);
-        dst += stride;
-    }
-}
-
-#define DST(x, y) dst[(x) + (y) * stride]
-
-static void diag_downleft_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                                const uint8_t *left, const uint8_t *top)
-{
-    int a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
-        a4 = top[4], a5 = top[5], a6 = top[6], a7 = top[7];
-
-    DST(0, 0) = (a0 + a1 * 2 + a2 + 2) >> 2;
-    DST(1, 0) =
-    DST(0, 1) = (a1 + a2 * 2 + a3 + 2) >> 2;
-    DST(2, 0) =
-    DST(1, 1) =
-    DST(0, 2) = (a2 + a3 * 2 + a4 + 2) >> 2;
-    DST(3, 0) =
-    DST(2, 1) =
-    DST(1, 2) =
-    DST(0, 3) = (a3 + a4 * 2 + a5 + 2) >> 2;
-    DST(3, 1) =
-    DST(2, 2) =
-    DST(1, 3) = (a4 + a5 * 2 + a6 + 2) >> 2;
-    DST(3, 2) =
-    DST(2, 3) = (a5 + a6 * 2 + a7 + 2) >> 2;
-    DST(3, 3) = a7;  // note: this is different from vp8 and such
-}
-
-#define def_diag_downleft(size)                                             \
-static void diag_downleft_ ## size ## x ## size ## _c(uint8_t *dst,         \
-                                                      ptrdiff_t stride,     \
-                                                      const uint8_t *left,  \
-                                                      const uint8_t *top)   \
-{                                                                           \
-    int i, j;                                                               \
-    uint8_t v[size - 1];                                                    \
-                                                                            \
-    for (i = 0; i < size - 2; i++)                                          \
-        v[i] = (top[i] + top[i + 1] * 2 + top[i + 2] + 2) >> 2;             \
-    v[size - 2] = (top[size - 2] + top[size - 1] * 3 + 2) >> 2;             \
-                                                                            \
-    for (j = 0; j < size; j++) {                                            \
-        memcpy(dst + j * stride, v + j, size - 1 - j);                      \
-        memset(dst + j * stride + size - 1 - j, top[size - 1], j + 1);      \
-    }                                                                       \
-}
-
-def_diag_downleft(8)
-def_diag_downleft(16)
-def_diag_downleft(32)
-
-static void diag_downright_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                                 const uint8_t *left, const uint8_t *top)
-{
-    int tl = top[-1], a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
-        l0 = left[0], l1 = left[1], l2 = left[2], l3 = left[3];
-
-    DST(0, 3) = (l1 + l2 * 2 + l3 + 2) >> 2;
-    DST(0, 2) =
-    DST(1, 3) = (l0 + l1 * 2 + l2 + 2) >> 2;
-    DST(0, 1) =
-    DST(1, 2) =
-    DST(2, 3) = (tl + l0 * 2 + l1 + 2) >> 2;
-    DST(0, 0) =
-    DST(1, 1) =
-    DST(2, 2) =
-    DST(3, 3) = (l0 + tl * 2 + a0 + 2) >> 2;
-    DST(1, 0) =
-    DST(2, 1) =
-    DST(3, 2) = (tl + a0 * 2 + a1 + 2) >> 2;
-    DST(2, 0) =
-    DST(3, 1) = (a0 + a1 * 2 + a2 + 2) >> 2;
-    DST(3, 0) = (a1 + a2 * 2 + a3 + 2) >> 2;
-}
-
-#define def_diag_downright(size)                                            \
-static void diag_downright_ ## size ## x ## size ## _c(uint8_t *dst,        \
-                                                       ptrdiff_t stride,    \
-                                                       const uint8_t *left, \
-                                                       const uint8_t *top)  \
-{                                                                           \
-    int i, j;                                                               \
-    uint8_t v[size + size - 1];                                             \
-                                                                            \
-    for (i = 0; i < size - 2; i++) {                                        \
-        v[i]            = (left[size - 1 - i] +                             \
-                           left[size - 2 - i] * 2 +                         \
-                           left[size - 3 - i] + 2) >> 2;                    \
-        v[size + 1 + i] = (top[i]             +                             \
-                           top[i + 1]         * 2 +                         \
-                           top[i + 2]         + 2) >> 2;                    \
-    }                                                                       \
-    v[size - 2] = (left[1] + left[0] * 2 + top[-1] + 2) >> 2;               \
-    v[size - 1] = (left[0] + top[-1] * 2 + top[0]  + 2) >> 2;               \
-    v[size]     = (top[-1] + top[0]  * 2 + top[1]  + 2) >> 2;               \
-                                                                            \
-    for (j = 0; j < size; j++)                                              \
-        memcpy(dst + j * stride, v + size - 1 - j, size);                   \
-}
-
-def_diag_downright(8)
-def_diag_downright(16)
-def_diag_downright(32)
-
-static void vert_right_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                             const uint8_t *left, const uint8_t *top)
-{
-    int tl = top[-1], a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
-        l0 = left[0], l1 = left[1], l2 = left[2];
-
-    DST(0, 3) = (l0 + l1 * 2 + l2 + 2) >> 2;
-    DST(0, 2) = (tl + l0 * 2 + l1 + 2) >> 2;
-    DST(0, 0) =
-    DST(1, 2) = (tl + a0          + 1) >> 1;
-    DST(0, 1) =
-    DST(1, 3) = (l0 + tl * 2 + a0 + 2) >> 2;
-    DST(1, 0) =
-    DST(2, 2) = (a0 + a1          + 1) >> 1;
-    DST(1, 1) =
-    DST(2, 3) = (tl + a0 * 2 + a1 + 2) >> 2;
-    DST(2, 0) =
-    DST(3, 2) = (a1 + a2          + 1) >> 1;
-    DST(2, 1) =
-    DST(3, 3) = (a0 + a1 * 2 + a2 + 2) >> 2;
-    DST(3, 0) = (a2 + a3          + 1) >> 1;
-    DST(3, 1) = (a1 + a2 * 2 + a3 + 2) >> 2;
-}
-
-#define def_vert_right(size)                                                \
-static void vert_right_ ## size ## x ## size ## _c(uint8_t *dst,            \
-                                                   ptrdiff_t stride,        \
-                                                   const uint8_t *left,     \
-                                                   const uint8_t *top)      \
-{                                                                           \
-    int i, j;                                                               \
-    uint8_t ve[size + size / 2 - 1], vo[size + size / 2 - 1];               \
-                                                                            \
-    for (i = 0; i < size / 2 - 2; i++) {                                    \
-        vo[i] = (left[size - 4 - i * 2] +                                   \
-                 left[size - 3 - i * 2] * 2 +                               \
-                 left[size - 2 - i * 2] + 2) >> 2;                          \
-        ve[i] = (left[size - 5 - i * 2] +                                   \
-                 left[size - 4 - i * 2] * 2 +                               \
-                 left[size - 3 - i * 2] + 2) >> 2;                          \
-    }                                                                       \
-    vo[size / 2 - 2] = (left[0] + left[1] * 2 + left[2] + 2) >> 2;          \
-    ve[size / 2 - 2] = (top[-1] + left[0] * 2 + left[1] + 2) >> 2;          \
-                                                                            \
-    ve[size / 2 - 1] = (top[-1] + top[0] + 1) >> 1;                         \
-    vo[size / 2 - 1] = (left[0] + top[-1] * 2 + top[0] + 2) >> 2;           \
-    for (i = 0; i < size - 1; i++) {                                        \
-        ve[size / 2 + i] = (top[i] + top[i + 1] + 1) >> 1;                  \
-        vo[size / 2 + i] = (top[i - 1] + top[i] * 2 + top[i + 1] + 2) >> 2; \
-    }                                                                       \
-                                                                            \
-    for (j = 0; j < size / 2; j++) {                                        \
-        memcpy(dst +  j * 2      * stride, ve + size / 2 - 1 - j, size);    \
-        memcpy(dst + (j * 2 + 1) * stride, vo + size / 2 - 1 - j, size);    \
-    }                                                                       \
-}
-
-def_vert_right(8)
-def_vert_right(16)
-def_vert_right(32)
-
-static void hor_down_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                           const uint8_t *left, const uint8_t *top)
-{
-    int l0 = left[0], l1 = left[1], l2 = left[2], l3 = left[3],
-        tl = top[-1], a0 = top[0], a1 = top[1], a2 = top[2];
-
-    DST(2, 0) = (tl + a0 * 2 + a1 + 2) >> 2;
-    DST(3, 0) = (a0 + a1 * 2 + a2 + 2) >> 2;
-    DST(0, 0) =
-    DST(2, 1) = (tl + l0          + 1) >> 1;
-    DST(1, 0) =
-    DST(3, 1) = (a0 + tl * 2 + l0 + 2) >> 2;
-    DST(0, 1) =
-    DST(2, 2) = (l0 + l1          + 1) >> 1;
-    DST(1, 1) =
-    DST(3, 2) = (tl + l0 * 2 + l1 + 2) >> 2;
-    DST(0, 2) =
-    DST(2, 3) = (l1 + l2          + 1) >> 1;
-    DST(1, 2) =
-    DST(3, 3) = (l0 + l1 * 2 + l2 + 2) >> 2;
-    DST(0, 3) = (l2 + l3          + 1) >> 1;
-    DST(1, 3) = (l1 + l2 * 2 + l3 + 2) >> 2;
-}
-
-#define def_hor_down(size)                                              \
-static void hor_down_ ## size ## x ## size ## _c(uint8_t *dst,          \
-                                                 ptrdiff_t stride,      \
-                                                 const uint8_t *left,   \
-                                                 const uint8_t *top)    \
-{                                                                       \
-    int i, j;                                                           \
-    uint8_t v[size * 3 - 2];                                            \
-                                                                        \
-    for (i = 0; i < size - 2; i++) {                                    \
-        v[i * 2]        = (left[size - 2 - i] +                         \
-                           left[size - 1 - i] + 1) >> 1;                \
-        v[i * 2    + 1] = (left[size - 3 - i] +                         \
-                           left[size - 2 - i] * 2 +                     \
-                           left[size - 1 - i] + 2) >> 2;                \
-        v[size * 2 + i] = (top[i - 1] +                                 \
-                           top[i] * 2 +                                 \
-                           top[i + 1] + 2) >> 2;                        \
-    }                                                                   \
-    v[size * 2 - 2] = (top[-1] + left[0] + 1) >> 1;                     \
-    v[size * 2 - 4] = (left[0] + left[1] + 1) >> 1;                     \
-    v[size * 2 - 1] = (top[0]  + top[-1] * 2 + left[0] + 2) >> 2;       \
-    v[size * 2 - 3] = (top[-1] + left[0] * 2 + left[1] + 2) >> 2;       \
-                                                                        \
-    for (j = 0; j < size; j++)                                          \
-        memcpy(dst + j * stride, v + size * 2 - 2 - j * 2, size);       \
-}
-
-def_hor_down(8)
-def_hor_down(16)
-def_hor_down(32)
-
-static void vert_left_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                            const uint8_t *left, const uint8_t *top)
-{
-    int a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
-        a4 = top[4], a5 = top[5], a6 = top[6];
-
-    DST(0, 0) = (a0 + a1          + 1) >> 1;
-    DST(0, 1) = (a0 + a1 * 2 + a2 + 2) >> 2;
-    DST(1, 0) =
-    DST(0, 2) = (a1 + a2          + 1) >> 1;
-    DST(1, 1) =
-    DST(0, 3) = (a1 + a2 * 2 + a3 + 2) >> 2;
-    DST(2, 0) =
-    DST(1, 2) = (a2 + a3          + 1) >> 1;
-    DST(2, 1) =
-    DST(1, 3) = (a2 + a3 * 2 + a4 + 2) >> 2;
-    DST(3, 0) =
-    DST(2, 2) = (a3 + a4          + 1) >> 1;
-    DST(3, 1) =
-    DST(2, 3) = (a3 + a4 * 2 + a5 + 2) >> 2;
-    DST(3, 2) = (a4 + a5          + 1) >> 1;
-    DST(3, 3) = (a4 + a5 * 2 + a6 + 2) >> 2;
-}
-
-#define def_vert_left(size)                                             \
-static void vert_left_ ## size ## x ## size ## _c(uint8_t *dst,         \
-                                                  ptrdiff_t stride,     \
-                                                  const uint8_t *left,  \
-                                                  const uint8_t *top)   \
-{                                                                       \
-    int i, j;                                                           \
-    uint8_t ve[size - 1], vo[size - 1];                                 \
-                                                                        \
-    for (i = 0; i < size - 2; i++) {                                    \
-        ve[i] = (top[i] + top[i + 1] + 1) >> 1;                         \
-        vo[i] = (top[i] + top[i + 1] * 2 + top[i + 2] + 2) >> 2;        \
-    }                                                                   \
-    ve[size - 2] = (top[size - 2] + top[size - 1] + 1) >> 1;            \
-    vo[size - 2] = (top[size - 2] + top[size - 1] * 3 + 2) >> 2;        \
-                                                                        \
-    for (j = 0; j < size / 2; j++) {                                    \
-        memcpy(dst +  j * 2      * stride, ve + j, size - (j + 1));     \
-        memset(dst +  j * 2      * stride + size - j - 1,               \
-               top[size - 1], j + 1);                                   \
-        memcpy(dst + (j * 2 + 1) * stride, vo + j, size - (j + 1));     \
-        memset(dst + (j * 2 + 1) * stride + size - j - 1,               \
-               top[size - 1], j + 1);                                   \
-    }                                                                   \
-}
-
-def_vert_left(8)
-def_vert_left(16)
-def_vert_left(32)
-
-static void hor_up_4x4_c(uint8_t *dst, ptrdiff_t stride,
-                         const uint8_t *left, const uint8_t *top)
-{
-    int l0 = left[0], l1 = left[1], l2 = left[2], l3 = left[3];
-
-    DST(0, 0) = (l0 + l1          + 1) >> 1;
-    DST(1, 0) = (l0 + l1 * 2 + l2 + 2) >> 2;
-    DST(0, 1) =
-    DST(2, 0) = (l1 + l2          + 1) >> 1;
-    DST(1, 1) =
-    DST(3, 0) = (l1 + l2 * 2 + l3 + 2) >> 2;
-    DST(0, 2) =
-    DST(2, 1) = (l2 + l3          + 1) >> 1;
-    DST(1, 2) =
-    DST(3, 1) = (l2 + l3 * 3      + 2) >> 2;
-    DST(0, 3) =
-    DST(1, 3) =
-    DST(2, 2) =
-    DST(2, 3) =
-    DST(3, 2) =
-    DST(3, 3) = l3;
-}
-
-#define def_hor_up(size)                                                    \
-static void hor_up_ ## size ## x ## size ## _c(uint8_t *dst,                \
-                                               ptrdiff_t stride,            \
-                                               const uint8_t *left,         \
-                                               const uint8_t *top)          \
-{                                                                           \
-    int i, j;                                                               \
-    uint8_t v[size * 2 - 2];                                                \
-                                                                            \
-    for (i = 0; i < size - 2; i++) {                                        \
-        v[i * 2]     = (left[i] + left[i + 1] + 1) >> 1;                    \
-        v[i * 2 + 1] = (left[i] + left[i + 1] * 2 + left[i + 2] + 2) >> 2;  \
-    }                                                                       \
-    v[size * 2 - 4] = (left[size - 2] + left[size - 1]     + 1) >> 1;       \
-    v[size * 2 - 3] = (left[size - 2] + left[size - 1] * 3 + 2) >> 2;       \
-                                                                            \
-    for (j = 0; j < size / 2; j++)                                          \
-        memcpy(dst + j * stride, v + j * 2, size);                          \
-    for (j = size / 2; j < size; j++) {                                     \
-        memcpy(dst + j * stride, v + j * 2, size * 2 - 2 - j * 2);          \
-        memset(dst + j * stride + size * 2 - 2 - j * 2, left[size - 1],     \
-               2 + j * 2 - size);                                           \
-    }                                                                       \
-}
-
-def_hor_up(8)
-def_hor_up(16)
-def_hor_up(32)
-
-#undef DST
-
-static av_cold void vp9dsp_intrapred_init(VP9DSPContext *dsp)
-{
-#define init_intra_pred(tx, sz)                                              \
-    dsp->intra_pred[tx][VERT_PRED]            = vert_           ## sz ## _c; \
-    dsp->intra_pred[tx][HOR_PRED]             = hor_            ## sz ## _c; \
-    dsp->intra_pred[tx][DC_PRED]              = dc_             ## sz ## _c; \
-    dsp->intra_pred[tx][DIAG_DOWN_LEFT_PRED]  = diag_downleft_  ## sz ## _c; \
-    dsp->intra_pred[tx][DIAG_DOWN_RIGHT_PRED] = diag_downright_ ## sz ## _c; \
-    dsp->intra_pred[tx][VERT_RIGHT_PRED]      = vert_right_     ## sz ## _c; \
-    dsp->intra_pred[tx][HOR_DOWN_PRED]        = hor_down_       ## sz ## _c; \
-    dsp->intra_pred[tx][VERT_LEFT_PRED]       = vert_left_      ## sz ## _c; \
-    dsp->intra_pred[tx][HOR_UP_PRED]          = hor_up_         ## sz ## _c; \
-    dsp->intra_pred[tx][TM_VP8_PRED]          = tm_             ## sz ## _c; \
-    dsp->intra_pred[tx][LEFT_DC_PRED]         = dc_left_        ## sz ## _c; \
-    dsp->intra_pred[tx][TOP_DC_PRED]          = dc_top_         ## sz ## _c; \
-    dsp->intra_pred[tx][DC_128_PRED]          = dc_128_         ## sz ## _c; \
-    dsp->intra_pred[tx][DC_127_PRED]          = dc_127_         ## sz ## _c; \
-    dsp->intra_pred[tx][DC_129_PRED]          = dc_129_         ## sz ## _c
-
-    init_intra_pred(TX_4X4,   4x4);
-    init_intra_pred(TX_8X8,   8x8);
-    init_intra_pred(TX_16X16, 16x16);
-    init_intra_pred(TX_32X32, 32x32);
-
-#undef init_intra_pred
-}
-
-#define itxfm_wrapper(type_a, type_b, sz, bits)                             \
-static void                                                                 \
-type_a ## _ ## type_b ## _ ## sz ## x ## sz ## _add_c(uint8_t *dst,         \
-                                                      ptrdiff_t stride,     \
-                                                      int16_t *block,       \
-                                                      int eob)              \
-{                                                                           \
-    int i, j;                                                               \
-    int16_t tmp[sz * sz], out[sz];                                          \
-    for (i = 0; i < sz; i++)                                                \
-        type_a ## sz ## _1d(tmp + i * sz, block + i, sz, 0);                \
-    memset(block, 0, sz * sz * sizeof(*block));                             \
-    for (i = 0; i < sz; i++) {                                              \
-        type_b ## sz ## _1d(out, tmp + i, sz, 1);                           \
-        for (j = 0; j < sz; j++)                                            \
-            dst[j * stride] =                                               \
-                av_clip_uint8(dst[j * stride] +                             \
-                              (bits ? (out[j] + (1 << (bits - 1))) >> bits  \
-                                    : out[j]));                             \
-        dst++;                                                              \
-    }                                                                       \
-}
-
-#define itxfm_wrap(sz, bits)             \
-    itxfm_wrapper(idct, idct, sz, bits)  \
-    itxfm_wrapper(iadst, idct, sz, bits) \
-    itxfm_wrapper(idct, iadst, sz, bits) \
-    itxfm_wrapper(iadst, iadst, sz, bits)
-
-#define IN(x) in[x * stride]
-
-static av_always_inline void idct4_1d(int16_t *out, const int16_t *in,
-                                      ptrdiff_t stride, int pass)
-{
-    int t0, t1, t2, t3;
-
-    t0 = ((IN(0)        + IN(2)) * 11585 + (1 << 13)) >> 14;
-    t1 = ((IN(0)        - IN(2)) * 11585 + (1 << 13)) >> 14;
-    t2 = (IN(1) *  6270 - IN(3)  * 15137 + (1 << 13)) >> 14;
-    t3 = (IN(1) * 15137 + IN(3)  *  6270 + (1 << 13)) >> 14;
-
-    out[0] = t0 + t3;
-    out[1] = t1 + t2;
-    out[2] = t1 - t2;
-    out[3] = t0 - t3;
-}
-
-static av_always_inline void iadst4_1d(int16_t *out, const int16_t *in,
-                                       ptrdiff_t stride, int pass)
-{
-    int t0, t1, t2, t3;
-
-    t0 =  5283 * IN(0) + 15212 * IN(2) +  9929 * IN(3);
-    t1 =  9929 * IN(0) -  5283 * IN(2) - 15212 * IN(3);
-    t2 = 13377 * (IN(0) - IN(2) + IN(3));
-    t3 = 13377 * IN(1);
-
-    out[0] = (t0 + t3      + (1 << 13)) >> 14;
-    out[1] = (t1 + t3      + (1 << 13)) >> 14;
-    out[2] = (t2           + (1 << 13)) >> 14;
-    out[3] = (t0 + t1 - t3 + (1 << 13)) >> 14;
-}
-
-itxfm_wrap(4, 4)
-
-static av_always_inline void idct8_1d(int16_t *out, const int16_t *in,
-                                      ptrdiff_t stride, int pass)
-{
-    int t0, t0a, t1, t1a, t2, t2a, t3, t3a, t4, t4a, t5, t5a, t6, t6a, t7, t7a;
-
-    t0a = ((IN(0)        + IN(4)) * 11585 + (1 << 13)) >> 14;
-    t1a = ((IN(0)        - IN(4)) * 11585 + (1 << 13)) >> 14;
-    t2a = (IN(2) *  6270 - IN(6)  * 15137 + (1 << 13)) >> 14;
-    t3a = (IN(2) * 15137 + IN(6)  *  6270 + (1 << 13)) >> 14;
-    t4a = (IN(1) *  3196 - IN(7)  * 16069 + (1 << 13)) >> 14;
-    t5a = (IN(5) * 13623 - IN(3)  *  9102 + (1 << 13)) >> 14;
-    t6a = (IN(5) *  9102 + IN(3)  * 13623 + (1 << 13)) >> 14;
-    t7a = (IN(1) * 16069 + IN(7)  *  3196 + (1 << 13)) >> 14;
-
-    t0  = t0a + t3a;
-    t1  = t1a + t2a;
-    t2  = t1a - t2a;
-    t3  = t0a - t3a;
-    t4  = t4a + t5a;
-    t5a = t4a - t5a;
-    t7  = t7a + t6a;
-    t6a = t7a - t6a;
-
-    t5  = ((t6a - t5a) * 11585 + (1 << 13)) >> 14;
-    t6  = ((t6a + t5a) * 11585 + (1 << 13)) >> 14;
-
-    out[0] = t0 + t7;
-    out[1] = t1 + t6;
-    out[2] = t2 + t5;
-    out[3] = t3 + t4;
-    out[4] = t3 - t4;
-    out[5] = t2 - t5;
-    out[6] = t1 - t6;
-    out[7] = t0 - t7;
-}
-
-static av_always_inline void iadst8_1d(int16_t *out, const int16_t *in,
-                                       ptrdiff_t stride, int pass)
-{
-    int t0, t0a, t1, t1a, t2, t2a, t3, t3a, t4, t4a, t5, t5a, t6, t6a, t7, t7a;
-
-    t0a = 16305 * IN(7) +  1606 * IN(0);
-    t1a =  1606 * IN(7) - 16305 * IN(0);
-    t2a = 14449 * IN(5) +  7723 * IN(2);
-    t3a =  7723 * IN(5) - 14449 * IN(2);
-    t4a = 10394 * IN(3) + 12665 * IN(4);
-    t5a = 12665 * IN(3) - 10394 * IN(4);
-    t6a =  4756 * IN(1) + 15679 * IN(6);
-    t7a = 15679 * IN(1) -  4756 * IN(6);
-
-    t0  = (t0a + t4a + (1 << 13)) >> 14;
-    t1  = (t1a + t5a + (1 << 13)) >> 14;
-    t2  = (t2a + t6a + (1 << 13)) >> 14;
-    t3  = (t3a + t7a + (1 << 13)) >> 14;
-    t4  = (t0a - t4a + (1 << 13)) >> 14;
-    t5  = (t1a - t5a + (1 << 13)) >> 14;
-    t6  = (t2a - t6a + (1 << 13)) >> 14;
-    t7  = (t3a - t7a + (1 << 13)) >> 14;
-
-    t4a = 15137 * t4 +  6270 * t5;
-    t5a =  6270 * t4 - 15137 * t5;
-    t6a = 15137 * t7 -  6270 * t6;
-    t7a =  6270 * t7 + 15137 * t6;
-
-    out[0] =   t0 + t2;
-    out[7] = -(t1 + t3);
-    t2     =   t0 - t2;
-    t3     =   t1 - t3;
-
-    out[1] = -((t4a + t6a + (1 << 13)) >> 14);
-    out[6] =   (t5a + t7a + (1 << 13)) >> 14;
-    t6     =   (t4a - t6a + (1 << 13)) >> 14;
-    t7     =   (t5a - t7a + (1 << 13)) >> 14;
-
-    out[3] = -(((t2 + t3) * 11585 + (1 << 13)) >> 14);
-    out[4] =   ((t2 - t3) * 11585 + (1 << 13)) >> 14;
-    out[2] =   ((t6 + t7) * 11585 + (1 << 13)) >> 14;
-    out[5] = -(((t6 - t7) * 11585 + (1 << 13)) >> 14);
-}
-
-itxfm_wrap(8, 5)
-
-static av_always_inline void idct16_1d(int16_t *out, const int16_t *in,
-                                       ptrdiff_t stride, int pass)
-{
-    int t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15;
-    int t0a, t1a, t2a, t3a, t4a, t5a, t6a, t7a;
-    int t8a, t9a, t10a, t11a, t12a, t13a, t14a, t15a;
-
-    t0a  = ((IN(0)         + IN(8)) * 11585 + (1 << 13)) >> 14;
-    t1a  = ((IN(0)         - IN(8)) * 11585 + (1 << 13)) >> 14;
-    t2a  = (IN(4)  *  6270 - IN(12) * 15137 + (1 << 13)) >> 14;
-    t3a  = (IN(4)  * 15137 + IN(12) *  6270 + (1 << 13)) >> 14;
-    t4a  = (IN(2)  *  3196 - IN(14) * 16069 + (1 << 13)) >> 14;
-    t7a  = (IN(2)  * 16069 + IN(14) *  3196 + (1 << 13)) >> 14;
-    t5a  = (IN(10) * 13623 - IN(6)  *  9102 + (1 << 13)) >> 14;
-    t6a  = (IN(10) *  9102 + IN(6)  * 13623 + (1 << 13)) >> 14;
-    t8a  = (IN(1)  *  1606 - IN(15) * 16305 + (1 << 13)) >> 14;
-    t15a = (IN(1)  * 16305 + IN(15) *  1606 + (1 << 13)) >> 14;
-    t9a  = (IN(9)  * 12665 - IN(7)  * 10394 + (1 << 13)) >> 14;
-    t14a = (IN(9)  * 10394 + IN(7)  * 12665 + (1 << 13)) >> 14;
-    t10a = (IN(5)  *  7723 - IN(11) * 14449 + (1 << 13)) >> 14;
-    t13a = (IN(5)  * 14449 + IN(11) *  7723 + (1 << 13)) >> 14;
-    t11a = (IN(13) * 15679 - IN(3)  *  4756 + (1 << 13)) >> 14;
-    t12a = (IN(13) *  4756 + IN(3)  * 15679 + (1 << 13)) >> 14;
-
-    t0   = t0a  + t3a;
-    t1   = t1a  + t2a;
-    t2   = t1a  - t2a;
-    t3   = t0a  - t3a;
-    t4   = t4a  + t5a;
-    t5   = t4a  - t5a;
-    t6   = t7a  - t6a;
-    t7   = t7a  + t6a;
-    t8   = t8a  + t9a;
-    t9   = t8a  - t9a;
-    t10  = t11a - t10a;
-    t11  = t11a + t10a;
-    t12  = t12a + t13a;
-    t13  = t12a - t13a;
-    t14  = t15a - t14a;
-    t15  = t15a + t14a;
-
-    t5a  =   ((t6         - t5) * 11585  + (1 << 13)) >> 14;
-    t6a  =   ((t6         + t5) * 11585  + (1 << 13)) >> 14;
-    t9a  =   (t14 *  6270 - t9  * 15137  + (1 << 13)) >> 14;
-    t14a =   (t14 * 15137 + t9  *  6270  + (1 << 13)) >> 14;
-    t10a = (-(t13 * 15137 + t10 *  6270) + (1 << 13)) >> 14;
-    t13a =   (t13 *  6270 - t10 * 15137  + (1 << 13)) >> 14;
-
-    t0a  = t0   + t7;
-    t1a  = t1   + t6a;
-    t2a  = t2   + t5a;
-    t3a  = t3   + t4;
-    t4   = t3   - t4;
-    t5   = t2   - t5a;
-    t6   = t1   - t6a;
-    t7   = t0   - t7;
-    t8a  = t8   + t11;
-    t9   = t9a  + t10a;
-    t10  = t9a  - t10a;
-    t11a = t8   - t11;
-    t12a = t15  - t12;
-    t13  = t14a - t13a;
-    t14  = t14a + t13a;
-    t15a = t15  + t12;
-
-    t10a = ((t13  - t10)  * 11585 + (1 << 13)) >> 14;
-    t13a = ((t13  + t10)  * 11585 + (1 << 13)) >> 14;
-    t11  = ((t12a - t11a) * 11585 + (1 << 13)) >> 14;
-    t12  = ((t12a + t11a) * 11585 + (1 << 13)) >> 14;
-
-    out[0]  = t0a + t15a;
-    out[1]  = t1a + t14;
-    out[2]  = t2a + t13a;
-    out[3]  = t3a + t12;
-    out[4]  = t4  + t11;
-    out[5]  = t5  + t10a;
-    out[6]  = t6  + t9;
-    out[7]  = t7  + t8a;
-    out[8]  = t7  - t8a;
-    out[9]  = t6  - t9;
-    out[10] = t5  - t10a;
-    out[11] = t4  - t11;
-    out[12] = t3a - t12;
-    out[13] = t2a - t13a;
-    out[14] = t1a - t14;
-    out[15] = t0a - t15a;
-}
-
-static av_always_inline void iadst16_1d(int16_t *out, const int16_t *in,
-                                        ptrdiff_t stride, int pass)
-{
-    int t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15;
-    int t0a, t1a, t2a, t3a, t4a, t5a, t6a, t7a;
-    int t8a, t9a, t10a, t11a, t12a, t13a, t14a, t15a;
-
-    t0  = IN(15) * 16364 + IN(0)  *   804;
-    t1  = IN(15) *   804 - IN(0)  * 16364;
-    t2  = IN(13) * 15893 + IN(2)  *  3981;
-    t3  = IN(13) *  3981 - IN(2)  * 15893;
-    t4  = IN(11) * 14811 + IN(4)  *  7005;
-    t5  = IN(11) *  7005 - IN(4)  * 14811;
-    t6  = IN(9)  * 13160 + IN(6)  *  9760;
-    t7  = IN(9)  *  9760 - IN(6)  * 13160;
-    t8  = IN(7)  * 11003 + IN(8)  * 12140;
-    t9  = IN(7)  * 12140 - IN(8)  * 11003;
-    t10 = IN(5)  *  8423 + IN(10) * 14053;
-    t11 = IN(5)  * 14053 - IN(10) *  8423;
-    t12 = IN(3)  *  5520 + IN(12) * 15426;
-    t13 = IN(3)  * 15426 - IN(12) *  5520;
-    t14 = IN(1)  *  2404 + IN(14) * 16207;
-    t15 = IN(1)  * 16207 - IN(14) *  2404;
-
-    t0a  = (t0 + t8  + (1 << 13)) >> 14;
-    t1a  = (t1 + t9  + (1 << 13)) >> 14;
-    t2a  = (t2 + t10 + (1 << 13)) >> 14;
-    t3a  = (t3 + t11 + (1 << 13)) >> 14;
-    t4a  = (t4 + t12 + (1 << 13)) >> 14;
-    t5a  = (t5 + t13 + (1 << 13)) >> 14;
-    t6a  = (t6 + t14 + (1 << 13)) >> 14;
-    t7a  = (t7 + t15 + (1 << 13)) >> 14;
-    t8a  = (t0 - t8  + (1 << 13)) >> 14;
-    t9a  = (t1 - t9  + (1 << 13)) >> 14;
-    t10a = (t2 - t10 + (1 << 13)) >> 14;
-    t11a = (t3 - t11 + (1 << 13)) >> 14;
-    t12a = (t4 - t12 + (1 << 13)) >> 14;
-    t13a = (t5 - t13 + (1 << 13)) >> 14;
-    t14a = (t6 - t14 + (1 << 13)) >> 14;
-    t15a = (t7 - t15 + (1 << 13)) >> 14;
-
-    t8   = t8a  * 16069 + t9a  *  3196;
-    t9   = t8a  *  3196 - t9a  * 16069;
-    t10  = t10a *  9102 + t11a * 13623;
-    t11  = t10a * 13623 - t11a *  9102;
-    t12  = t13a * 16069 - t12a *  3196;
-    t13  = t13a *  3196 + t12a * 16069;
-    t14  = t15a *  9102 - t14a * 13623;
-    t15  = t15a * 13623 + t14a *  9102;
-
-    t0   = t0a  + t4a;
-    t1   = t1a  + t5a;
-    t2   = t2a  + t6a;
-    t3   = t3a  + t7a;
-    t4   = t0a  - t4a;
-    t5   = t1a  - t5a;
-    t6   = t2a  - t6a;
-    t7   = t3a  - t7a;
-    t8a  = (t8  + t12 + (1 << 13)) >> 14;
-    t9a  = (t9  + t13 + (1 << 13)) >> 14;
-    t10a = (t10 + t14 + (1 << 13)) >> 14;
-    t11a = (t11 + t15 + (1 << 13)) >> 14;
-    t12a = (t8  - t12 + (1 << 13)) >> 14;
-    t13a = (t9  - t13 + (1 << 13)) >> 14;
-    t14a = (t10 - t14 + (1 << 13)) >> 14;
-    t15a = (t11 - t15 + (1 << 13)) >> 14;
-
-    t4a  = t4   * 15137 + t5   *  6270;
-    t5a  = t4   *  6270 - t5   * 15137;
-    t6a  = t7   * 15137 - t6   *  6270;
-    t7a  = t7   *  6270 + t6   * 15137;
-    t12  = t12a * 15137 + t13a *  6270;
-    t13  = t12a *  6270 - t13a * 15137;
-    t14  = t15a * 15137 - t14a *  6270;
-    t15  = t15a *  6270 + t14a * 15137;
-
-    out[0]  =     t0 + t2;
-    out[15] =   -(t1 + t3);
-    t2a     =     t0 - t2;
-    t3a     =     t1 - t3;
-    out[3]  = -((t4a + t6a + (1 << 13)) >> 14);
-    out[12] =   (t5a + t7a + (1 << 13)) >> 14;
-    t6      =   (t4a - t6a + (1 << 13)) >> 14;
-    t7      =   (t5a - t7a + (1 << 13)) >> 14;
-    out[1]  =  -(t8a + t10a);
-    out[14] =    t9a + t11a;
-    t10     =    t8a - t10a;
-    t11     =    t9a - t11a;
-    out[2]  =   (t12 + t14 + (1 << 13)) >> 14;
-    out[13] = -((t13 + t15 + (1 << 13)) >> 14);
-    t14a    =   (t12 - t14 + (1 << 13)) >> 14;
-    t15a    =   (t13 - t15 + (1 << 13)) >> 14;
-
-    out[7]  = ((t2a  + t3a)  * -11585 + (1 << 13)) >> 14;
-    out[8]  = ((t2a  - t3a)  *  11585 + (1 << 13)) >> 14;
-    out[4]  = ((t7   + t6)   *  11585 + (1 << 13)) >> 14;
-    out[11] = ((t7   - t6)   *  11585 + (1 << 13)) >> 14;
-    out[6]  = ((t11  + t10)  *  11585 + (1 << 13)) >> 14;
-    out[9]  = ((t11  - t10)  *  11585 + (1 << 13)) >> 14;
-    out[5]  = ((t14a + t15a) * -11585 + (1 << 13)) >> 14;
-    out[10] = ((t14a - t15a) *  11585 + (1 << 13)) >> 14;
-}
-
-itxfm_wrap(16, 6)
-
-static av_always_inline void idct32_1d(int16_t *out, const int16_t *in,
-                                       ptrdiff_t stride, int pass)
-{
-    int t0a  = ((IN(0)         + IN(16)) * 11585 + (1 << 13)) >> 14;
-    int t1a  = ((IN(0)         - IN(16)) * 11585 + (1 << 13)) >> 14;
-    int t2a  = (IN(8)  *  6270 - IN(24)  * 15137 + (1 << 13)) >> 14;
-    int t3a  = (IN(8)  * 15137 + IN(24)  *  6270 + (1 << 13)) >> 14;
-    int t4a  = (IN(4)  *  3196 - IN(28)  * 16069 + (1 << 13)) >> 14;
-    int t7a  = (IN(4)  * 16069 + IN(28)  *  3196 + (1 << 13)) >> 14;
-    int t5a  = (IN(20) * 13623 - IN(12)  *  9102 + (1 << 13)) >> 14;
-    int t6a  = (IN(20) *  9102 + IN(12)  * 13623 + (1 << 13)) >> 14;
-    int t8a  = (IN(2)  *  1606 - IN(30)  * 16305 + (1 << 13)) >> 14;
-    int t15a = (IN(2)  * 16305 + IN(30)  *  1606 + (1 << 13)) >> 14;
-    int t9a  = (IN(18) * 12665 - IN(14)  * 10394 + (1 << 13)) >> 14;
-    int t14a = (IN(18) * 10394 + IN(14)  * 12665 + (1 << 13)) >> 14;
-    int t10a = (IN(10) *  7723 - IN(22)  * 14449 + (1 << 13)) >> 14;
-    int t13a = (IN(10) * 14449 + IN(22)  *  7723 + (1 << 13)) >> 14;
-    int t11a = (IN(26) * 15679 - IN(6)   *  4756 + (1 << 13)) >> 14;
-    int t12a = (IN(26) *  4756 + IN(6)   * 15679 + (1 << 13)) >> 14;
-    int t16a = (IN(1)  *   804 - IN(31)  * 16364 + (1 << 13)) >> 14;
-    int t31a = (IN(1)  * 16364 + IN(31)  *   804 + (1 << 13)) >> 14;
-    int t17a = (IN(17) * 12140 - IN(15)  * 11003 + (1 << 13)) >> 14;
-    int t30a = (IN(17) * 11003 + IN(15)  * 12140 + (1 << 13)) >> 14;
-    int t18a = (IN(9)  *  7005 - IN(23)  * 14811 + (1 << 13)) >> 14;
-    int t29a = (IN(9)  * 14811 + IN(23)  *  7005 + (1 << 13)) >> 14;
-    int t19a = (IN(25) * 15426 - IN(7)   *  5520 + (1 << 13)) >> 14;
-    int t28a = (IN(25) *  5520 + IN(7)   * 15426 + (1 << 13)) >> 14;
-    int t20a = (IN(5)  *  3981 - IN(27)  * 15893 + (1 << 13)) >> 14;
-    int t27a = (IN(5)  * 15893 + IN(27)  *  3981 + (1 << 13)) >> 14;
-    int t21a = (IN(21) * 14053 - IN(11)  *  8423 + (1 << 13)) >> 14;
-    int t26a = (IN(21) *  8423 + IN(11)  * 14053 + (1 << 13)) >> 14;
-    int t22a = (IN(13) *  9760 - IN(19)  * 13160 + (1 << 13)) >> 14;
-    int t25a = (IN(13) * 13160 + IN(19)  *  9760 + (1 << 13)) >> 14;
-    int t23a = (IN(29) * 16207 - IN(3)   *  2404 + (1 << 13)) >> 14;
-    int t24a = (IN(29) *  2404 + IN(3)   * 16207 + (1 << 13)) >> 14;
-
-    int t0  = t0a  + t3a;
-    int t1  = t1a  + t2a;
-    int t2  = t1a  - t2a;
-    int t3  = t0a  - t3a;
-    int t4  = t4a  + t5a;
-    int t5  = t4a  - t5a;
-    int t6  = t7a  - t6a;
-    int t7  = t7a  + t6a;
-    int t8  = t8a  + t9a;
-    int t9  = t8a  - t9a;
-    int t10 = t11a - t10a;
-    int t11 = t11a + t10a;
-    int t12 = t12a + t13a;
-    int t13 = t12a - t13a;
-    int t14 = t15a - t14a;
-    int t15 = t15a + t14a;
-    int t16 = t16a + t17a;
-    int t17 = t16a - t17a;
-    int t18 = t19a - t18a;
-    int t19 = t19a + t18a;
-    int t20 = t20a + t21a;
-    int t21 = t20a - t21a;
-    int t22 = t23a - t22a;
-    int t23 = t23a + t22a;
-    int t24 = t24a + t25a;
-    int t25 = t24a - t25a;
-    int t26 = t27a - t26a;
-    int t27 = t27a + t26a;
-    int t28 = t28a + t29a;
-    int t29 = t28a - t29a;
-    int t30 = t31a - t30a;
-    int t31 = t31a + t30a;
-
-    t5a  =   ((t6         - t5) * 11585  + (1 << 13)) >> 14;
-    t6a  =   ((t6         + t5) * 11585  + (1 << 13)) >> 14;
-    t9a  =   (t14 *  6270 - t9  * 15137  + (1 << 13)) >> 14;
-    t14a =   (t14 * 15137 + t9  *  6270  + (1 << 13)) >> 14;
-    t10a = (-(t13 * 15137 + t10 *  6270) + (1 << 13)) >> 14;
-    t13a =   (t13 *  6270 - t10 * 15137  + (1 << 13)) >> 14;
-    t17a =   (t30 *  3196 - t17 * 16069  + (1 << 13)) >> 14;
-    t30a =   (t30 * 16069 + t17 *  3196  + (1 << 13)) >> 14;
-    t18a = (-(t29 * 16069 + t18 *  3196) + (1 << 13)) >> 14;
-    t29a =   (t29 *  3196 - t18 * 16069  + (1 << 13)) >> 14;
-    t21a =   (t26 * 13623 - t21 *  9102  + (1 << 13)) >> 14;
-    t26a =   (t26 *  9102 + t21 * 13623  + (1 << 13)) >> 14;
-    t22a = (-(t25 *  9102 + t22 * 13623) + (1 << 13)) >> 14;
-    t25a =   (t25 * 13623 - t22 *  9102  + (1 << 13)) >> 14;
-
-    t0a  = t0   + t7;
-    t1a  = t1   + t6a;
-    t2a  = t2   + t5a;
-    t3a  = t3   + t4;
-    t4a  = t3   - t4;
-    t5   = t2   - t5a;
-    t6   = t1   - t6a;
-    t7a  = t0   - t7;
-    t8a  = t8   + t11;
-    t9   = t9a  + t10a;
-    t10  = t9a  - t10a;
-    t11a = t8   - t11;
-    t12a = t15  - t12;
-    t13  = t14a - t13a;
-    t14  = t14a + t13a;
-    t15a = t15  + t12;
-    t16a = t16  + t19;
-    t17  = t17a + t18a;
-    t18  = t17a - t18a;
-    t19a = t16  - t19;
-    t20a = t23  - t20;
-    t21  = t22a - t21a;
-    t22  = t22a + t21a;
-    t23a = t23  + t20;
-    t24a = t24  + t27;
-    t25  = t25a + t26a;
-    t26  = t25a - t26a;
-    t27a = t24  - t27;
-    t28a = t31  - t28;
-    t29  = t30a - t29a;
-    t30  = t30a + t29a;
-    t31a = t31  + t28;
-
-    t10a = ((t13           - t10)  * 11585  + (1 << 13)) >> 14;
-    t13a = ((t13           + t10)  * 11585  + (1 << 13)) >> 14;
-    t11  = ((t12a          - t11a) * 11585  + (1 << 13)) >> 14;
-    t12  = ((t12a          + t11a) * 11585  + (1 << 13)) >> 14;
-    t18a =   (t29  *  6270 - t18   * 15137  + (1 << 13)) >> 14;
-    t29a =   (t29  * 15137 + t18   *  6270  + (1 << 13)) >> 14;
-    t19  =   (t28a *  6270 - t19a  * 15137  + (1 << 13)) >> 14;
-    t28  =   (t28a * 15137 + t19a  *  6270  + (1 << 13)) >> 14;
-    t20  = (-(t27a * 15137 + t20a  *  6270) + (1 << 13)) >> 14;
-    t27  =   (t27a *  6270 - t20a  * 15137  + (1 << 13)) >> 14;
-    t21a = (-(t26  * 15137 + t21   *  6270) + (1 << 13)) >> 14;
-    t26a =   (t26  *  6270 - t21   * 15137  + (1 << 13)) >> 14;
-
-    t0   = t0a  + t15a;
-    t1   = t1a  + t14;
-    t2   = t2a  + t13a;
-    t3   = t3a  + t12;
-    t4   = t4a  + t11;
-    t5a  = t5   + t10a;
-    t6a  = t6   + t9;
-    t7   = t7a  + t8a;
-    t8   = t7a  - t8a;
-    t9a  = t6   - t9;
-    t10  = t5   - t10a;
-    t11a = t4a  - t11;
-    t12a = t3a  - t12;
-    t13  = t2a  - t13a;
-    t14a = t1a  - t14;
-    t15  = t0a  - t15a;
-    t16  = t16a + t23a;
-    t17a = t17  + t22;
-    t18  = t18a + t21a;
-    t19a = t19  + t20;
-    t20a = t19  - t20;
-    t21  = t18a - t21a;
-    t22a = t17  - t22;
-    t23  = t16a - t23a;
-    t24  = t31a - t24a;
-    t25a = t30  - t25;
-    t26  = t29a - t26a;
-    t27a = t28  - t27;
-    t28a = t28  + t27;
-    t29  = t29a + t26a;
-    t30a = t30  + t25;
-    t31  = t31a + t24a;
-
-    t20  = ((t27a - t20a) * 11585 + (1 << 13)) >> 14;
-    t27  = ((t27a + t20a) * 11585 + (1 << 13)) >> 14;
-    t21a = ((t26  - t21)  * 11585 + (1 << 13)) >> 14;
-    t26a = ((t26  + t21)  * 11585 + (1 << 13)) >> 14;
-    t22  = ((t25a - t22a) * 11585 + (1 << 13)) >> 14;
-    t25  = ((t25a + t22a) * 11585 + (1 << 13)) >> 14;
-    t23a = ((t24  - t23)  * 11585 + (1 << 13)) >> 14;
-    t24a = ((t24  + t23)  * 11585 + (1 << 13)) >> 14;
-
-    out[0]  = t0   + t31;
-    out[1]  = t1   + t30a;
-    out[2]  = t2   + t29;
-    out[3]  = t3   + t28a;
-    out[4]  = t4   + t27;
-    out[5]  = t5a  + t26a;
-    out[6]  = t6a  + t25;
-    out[7]  = t7   + t24a;
-    out[8]  = t8   + t23a;
-    out[9]  = t9a  + t22;
-    out[10] = t10  + t21a;
-    out[11] = t11a + t20;
-    out[12] = t12a + t19a;
-    out[13] = t13  + t18;
-    out[14] = t14a + t17a;
-    out[15] = t15  + t16;
-    out[16] = t15  - t16;
-    out[17] = t14a - t17a;
-    out[18] = t13  - t18;
-    out[19] = t12a - t19a;
-    out[20] = t11a - t20;
-    out[21] = t10  - t21a;
-    out[22] = t9a  - t22;
-    out[23] = t8   - t23a;
-    out[24] = t7   - t24a;
-    out[25] = t6a  - t25;
-    out[26] = t5a  - t26a;
-    out[27] = t4   - t27;
-    out[28] = t3   - t28a;
-    out[29] = t2   - t29;
-    out[30] = t1   - t30a;
-    out[31] = t0   - t31;
-}
-
-itxfm_wrapper(idct, idct, 32, 6)
-
-static av_always_inline void iwht4_1d(int16_t *out, const int16_t *in,
-                                      ptrdiff_t stride, int pass)
-{
-    int t0, t1, t2, t3, t4;
-
-    if (pass == 0) {
-        t0 = IN(0) >> 2;
-        t1 = IN(3) >> 2;
-        t2 = IN(1) >> 2;
-        t3 = IN(2) >> 2;
-    } else {
-        t0 = IN(0);
-        t1 = IN(3);
-        t2 = IN(1);
-        t3 = IN(2);
-    }
-
-    t0 += t2;
-    t3 -= t1;
-    t4 = (t0 - t3) >> 1;
-    t1 = t4 - t1;
-    t2 = t4 - t2;
-    t0 -= t1;
-    t3 += t2;
-
-    out[0] = t0;
-    out[1] = t1;
-    out[2] = t2;
-    out[3] = t3;
-}
-
-itxfm_wrapper(iwht, iwht, 4, 0)
-
-#undef IN
-#undef itxfm_wrapper
-#undef itxfm_wrap
-
-static av_cold void vp9dsp_itxfm_init(VP9DSPContext *dsp)
-{
-#define init_itxfm(tx, sz)                                        \
-    dsp->itxfm_add[tx][DCT_DCT]   = idct_idct_   ## sz ## _add_c; \
-    dsp->itxfm_add[tx][DCT_ADST]  = iadst_idct_  ## sz ## _add_c; \
-    dsp->itxfm_add[tx][ADST_DCT]  = idct_iadst_  ## sz ## _add_c; \
-    dsp->itxfm_add[tx][ADST_ADST] = iadst_iadst_ ## sz ## _add_c
-
-#define init_idct(tx, nm)                               \
-    dsp->itxfm_add[tx][DCT_DCT]   =                     \
-    dsp->itxfm_add[tx][ADST_DCT]  =                     \
-    dsp->itxfm_add[tx][DCT_ADST]  =                     \
-    dsp->itxfm_add[tx][ADST_ADST] = nm ## _add_c
-
-    init_itxfm(TX_4X4, 4x4);
-    init_itxfm(TX_8X8, 8x8);
-    init_itxfm(TX_16X16, 16x16);
-    init_idct(TX_32X32, idct_idct_32x32);
-    init_idct(4 /* lossless */, iwht_iwht_4x4);
-
-#undef init_itxfm
-#undef init_idct
-}
-
-static av_always_inline void loop_filter(uint8_t *dst, ptrdiff_t stride,
-                                         int E, int I, int H,
-                                         ptrdiff_t stridea, ptrdiff_t strideb,
-                                         int wd)
-{
-    int i;
-
-    for (i = 0; i < 8; i++, dst += stridea) {
-        int p7, p6, p5, p4;
-        int p3 = dst[strideb * -4], p2 = dst[strideb * -3];
-        int p1 = dst[strideb * -2], p0 = dst[strideb * -1];
-        int q0 = dst[strideb * +0], q1 = dst[strideb * +1];
-        int q2 = dst[strideb * +2], q3 = dst[strideb * +3];
-        int q4, q5, q6, q7;
-        int fm = FFABS(p3 - p2) <= I && FFABS(p2 - p1) <= I &&
-                 FFABS(p1 - p0) <= I && FFABS(q1 - q0) <= I &&
-                 FFABS(q2 - q1) <= I && FFABS(q3 - q2) <= I &&
-                 FFABS(p0 - q0) * 2 + (FFABS(p1 - q1) >> 1) <= E;
-        int flat8out, flat8in;
-
-        if (!fm)
-            continue;
-
-        if (wd >= 16) {
-            p7 = dst[strideb * -8];
-            p6 = dst[strideb * -7];
-            p5 = dst[strideb * -6];
-            p4 = dst[strideb * -5];
-            q4 = dst[strideb * +4];
-            q5 = dst[strideb * +5];
-            q6 = dst[strideb * +6];
-            q7 = dst[strideb * +7];
-
-            flat8out = FFABS(p7 - p0) <= 1 && FFABS(p6 - p0) <= 1 &&
-                       FFABS(p5 - p0) <= 1 && FFABS(p4 - p0) <= 1 &&
-                       FFABS(q4 - q0) <= 1 && FFABS(q5 - q0) <= 1 &&
-                       FFABS(q6 - q0) <= 1 && FFABS(q7 - q0) <= 1;
-        }
-
-        if (wd >= 8)
-            flat8in = FFABS(p3 - p0) <= 1 && FFABS(p2 - p0) <= 1 &&
-                      FFABS(p1 - p0) <= 1 && FFABS(q1 - q0) <= 1 &&
-                      FFABS(q2 - q0) <= 1 && FFABS(q3 - q0) <= 1;
-
-        if (wd >= 16 && flat8out && flat8in) {
-            dst[strideb * -7] = (p7 + p7 + p7 + p7 + p7 + p7 + p7 + p6 * 2 +
-                                 p5 + p4 + p3 + p2 + p1 + p0 + q0 + 8) >> 4;
-            dst[strideb * -6] = (p7 + p7 + p7 + p7 + p7 + p7 + p6 + p5 * 2 +
-                                 p4 + p3 + p2 + p1 + p0 + q0 + q1 + 8) >> 4;
-            dst[strideb * -5] = (p7 + p7 + p7 + p7 + p7 + p6 + p5 + p4 * 2 +
-                                 p3 + p2 + p1 + p0 + q0 + q1 + q2 + 8) >> 4;
-            dst[strideb * -4] = (p7 + p7 + p7 + p7 + p6 + p5 + p4 + p3 * 2 +
-                                 p2 + p1 + p0 + q0 + q1 + q2 + q3 + 8) >> 4;
-            dst[strideb * -3] = (p7 + p7 + p7 + p6 + p5 + p4 + p3 + p2 * 2 +
-                                 p1 + p0 + q0 + q1 + q2 + q3 + q4 + 8) >> 4;
-            dst[strideb * -2] = (p7 + p7 + p6 + p5 + p4 + p3 + p2 + p1 * 2 +
-                                 p0 + q0 + q1 + q2 + q3 + q4 + q5 + 8) >> 4;
-            dst[strideb * -1] = (p7 + p6 + p5 + p4 + p3 + p2 + p1 + p0 * 2 +
-                                 q0 + q1 + q2 + q3 + q4 + q5 + q6 + 8) >> 4;
-            dst[strideb * +0] = (p6 + p5 + p4 + p3 + p2 + p1 + p0 + q0 * 2 +
-                                 q1 + q2 + q3 + q4 + q5 + q6 + q7 + 8) >> 4;
-            dst[strideb * +1] = (p5 + p4 + p3 + p2 + p1 + p0 + q0 + q1 * 2 +
-                                 q2 + q3 + q4 + q5 + q6 + q7 + q7 + 8) >> 4;
-            dst[strideb * +2] = (p4 + p3 + p2 + p1 + p0 + q0 + q1 + q2 * 2 +
-                                 q3 + q4 + q5 + q6 + q7 + q7 + q7 + 8) >> 4;
-            dst[strideb * +3] = (p3 + p2 + p1 + p0 + q0 + q1 + q2 + q3 * 2 +
-                                 q4 + q5 + q6 + q7 + q7 + q7 + q7 + 8) >> 4;
-            dst[strideb * +4] = (p2 + p1 + p0 + q0 + q1 + q2 + q3 + q4 * 2 +
-                                 q5 + q6 + q7 + q7 + q7 + q7 + q7 + 8) >> 4;
-            dst[strideb * +5] = (p1 + p0 + q0 + q1 + q2 + q3 + q4 + q5 * 2 +
-                                 q6 + q7 + q7 + q7 + q7 + q7 + q7 + 8) >> 4;
-            dst[strideb * +6] = (p0 + q0 + q1 + q2 + q3 + q4 + q5 + q6 * 2 +
-                                 q7 + q7 + q7 + q7 + q7 + q7 + q7 + 8) >> 4;
-        } else if (wd >= 8 && flat8in) {
-            dst[strideb * -3] = (p3 + p3 + p3 + 2 * p2 + p1 + p0 + q0 + 4) >> 3;
-            dst[strideb * -2] = (p3 + p3 + p2 + 2 * p1 + p0 + q0 + q1 + 4) >> 3;
-            dst[strideb * -1] = (p3 + p2 + p1 + 2 * p0 + q0 + q1 + q2 + 4) >> 3;
-            dst[strideb * +0] = (p2 + p1 + p0 + 2 * q0 + q1 + q2 + q3 + 4) >> 3;
-            dst[strideb * +1] = (p1 + p0 + q0 + 2 * q1 + q2 + q3 + q3 + 4) >> 3;
-            dst[strideb * +2] = (p0 + q0 + q1 + 2 * q2 + q3 + q3 + q3 + 4) >> 3;
-        } else {
-            int hev = FFABS(p1 - p0) > H || FFABS(q1 - q0) > H;
-
-            if (hev) {
-                int f = av_clip_int8(3 * (q0 - p0) + av_clip_int8(p1 - q1));
-                int f1 = FFMIN(f + 4, 127) >> 3;
-                int f2 = FFMIN(f + 3, 127) >> 3;
-
-                dst[strideb * -1] = av_clip_uint8(p0 + f2);
-                dst[strideb * +0] = av_clip_uint8(q0 - f1);
-            } else {
-                int f = av_clip_int8(3 * (q0 - p0));
-                int f1 = FFMIN(f + 4, 127) >> 3;
-                int f2 = FFMIN(f + 3, 127) >> 3;
-
-                dst[strideb * -1] = av_clip_uint8(p0 + f2);
-                dst[strideb * +0] = av_clip_uint8(q0 - f1);
-
-                f = (f1 + 1) >> 1;
-                dst[strideb * -2] = av_clip_uint8(p1 + f);
-                dst[strideb * +1] = av_clip_uint8(q1 - f);
-            }
-        }
-    }
-}
-
-#define lf_8_fn(dir, wd, stridea, strideb)                                  \
-static void loop_filter_ ## dir ## _ ## wd  ## _8_c(uint8_t *dst,           \
-                                                    ptrdiff_t stride,       \
-                                                    int E, int I, int H)    \
-{                                                                           \
-    loop_filter(dst, stride, E, I, H, stridea, strideb, wd);                \
-}
-
-#define lf_8_fns(wd)          \
-    lf_8_fn(h, wd, stride, 1) \
-    lf_8_fn(v, wd, 1, stride)
-
-lf_8_fns(4)
-lf_8_fns(8)
-lf_8_fns(16)
-
-#undef lf_8_fn
-#undef lf_8_fns
-
-#define lf_16_fn(dir, stridea)                                          \
-static void loop_filter_ ## dir ## _16_16_c(uint8_t *dst,               \
-                                            ptrdiff_t stride,           \
-                                            int E, int I, int H)        \
-{                                                                       \
-    loop_filter_ ## dir ## _16_8_c(dst, stride, E, I, H);               \
-    loop_filter_ ## dir ## _16_8_c(dst + 8 * stridea, stride, E, I, H); \
-}
-
-lf_16_fn(h, stride)
-lf_16_fn(v, 1)
-
-#undef lf_16_fn
-
-#define lf_mix_fn(dir, wd1, wd2, stridea)                                     \
-static void loop_filter_ ## dir ## _ ## wd1 ## wd2 ## _16_c(uint8_t *dst,     \
-                                                            ptrdiff_t stride, \
-                                                            int E, int I,     \
-                                                            int H)            \
-{                                                                             \
-    loop_filter_ ## dir ## _ ## wd1 ## _8_c(dst, stride, E & 0xff,            \
-                                            I & 0xff, H & 0xff);              \
-    loop_filter_ ## dir ## _ ## wd2 ## _8_c(dst + 8 * stridea, stride,        \
-                                            E >> 8, I >> 8, H >> 8);          \
-}
-
-#define lf_mix_fns(wd1, wd2)       \
-    lf_mix_fn(h, wd1, wd2, stride) \
-    lf_mix_fn(v, wd1, wd2, 1)
-
-lf_mix_fns(4, 4)
-lf_mix_fns(4, 8)
-lf_mix_fns(8, 4)
-lf_mix_fns(8, 8)
-
-#undef lf_mix_fn
-#undef lf_mix_fns
-
-static av_cold void vp9dsp_loopfilter_init(VP9DSPContext *dsp)
-{
-    dsp->loop_filter_8[0][0] = loop_filter_h_4_8_c;
-    dsp->loop_filter_8[0][1] = loop_filter_v_4_8_c;
-    dsp->loop_filter_8[1][0] = loop_filter_h_8_8_c;
-    dsp->loop_filter_8[1][1] = loop_filter_v_8_8_c;
-    dsp->loop_filter_8[2][0] = loop_filter_h_16_8_c;
-    dsp->loop_filter_8[2][1] = loop_filter_v_16_8_c;
-
-    dsp->loop_filter_16[0] = loop_filter_h_16_16_c;
-    dsp->loop_filter_16[1] = loop_filter_v_16_16_c;
-
-    dsp->loop_filter_mix2[0][0][0] = loop_filter_h_44_16_c;
-    dsp->loop_filter_mix2[0][0][1] = loop_filter_v_44_16_c;
-    dsp->loop_filter_mix2[0][1][0] = loop_filter_h_48_16_c;
-    dsp->loop_filter_mix2[0][1][1] = loop_filter_v_48_16_c;
-    dsp->loop_filter_mix2[1][0][0] = loop_filter_h_84_16_c;
-    dsp->loop_filter_mix2[1][0][1] = loop_filter_v_84_16_c;
-    dsp->loop_filter_mix2[1][1][0] = loop_filter_h_88_16_c;
-    dsp->loop_filter_mix2[1][1][1] = loop_filter_v_88_16_c;
-}
-
-static av_always_inline void copy_c(uint8_t *dst, const uint8_t *src,
-                                    ptrdiff_t dst_stride,
-                                    ptrdiff_t src_stride,
-                                    int w, int h)
-{
-    do {
-        memcpy(dst, src, w);
-
-        dst += dst_stride;
-        src += src_stride;
-    } while (--h);
-}
-
-static av_always_inline void avg_c(uint8_t *dst, const uint8_t *src,
-                                   ptrdiff_t dst_stride,
-                                   ptrdiff_t src_stride,
-                                   int w, int h)
-{
-    do {
-        int x;
-
-        for (x = 0; x < w; x += 4)
-            AV_WN32A(&dst[x], rnd_avg32(AV_RN32A(&dst[x]), AV_RN32(&src[x])));
-
-        dst += dst_stride;
-        src += src_stride;
-    } while (--h);
-}
-
-#define fpel_fn(type, sz)                                      \
-static void type ## sz ## _c(uint8_t *dst, const uint8_t *src, \
-                             ptrdiff_t dst_stride,             \
-                             ptrdiff_t src_stride,             \
-                             int h, int mx, int my)            \
-{                                                              \
-    type ## _c(dst, src, dst_stride, src_stride, sz, h);       \
-}
-
-#define copy_avg_fn(sz) \
-    fpel_fn(copy, sz)   \
-    fpel_fn(avg, sz)
-
-copy_avg_fn(64)
-copy_avg_fn(32)
-copy_avg_fn(16)
-copy_avg_fn(8)
-copy_avg_fn(4)
-
-#undef fpel_fn
-#undef copy_avg_fn
-
-static const int8_t vp9_subpel_filters[3][15][8] = {
-    [FILTER_8TAP_REGULAR] = {
-        {  0,  1,  -5, 126,   8,  -3,  1,  0 },
-        { -1,  3, -10, 122,  18,  -6,  2,  0 },
-        { -1,  4, -13, 118,  27,  -9,  3, -1 },
-        { -1,  4, -16, 112,  37, -11,  4, -1 },
-        { -1,  5, -18, 105,  48, -14,  4, -1 },
-        { -1,  5, -19,  97,  58, -16,  5, -1 },
-        { -1,  6, -19,  88,  68, -18,  5, -1 },
-        { -1,  6, -19,  78,  78, -19,  6, -1 },
-        { -1,  5, -18,  68,  88, -19,  6, -1 },
-        { -1,  5, -16,  58,  97, -19,  5, -1 },
-        { -1,  4, -14,  48, 105, -18,  5, -1 },
-        { -1,  4, -11,  37, 112, -16,  4, -1 },
-        { -1,  3,  -9,  27, 118, -13,  4, -1 },
-        {  0,  2,  -6,  18, 122, -10,  3, -1 },
-        {  0,  1,  -3,   8, 126,  -5,  1,  0 },
-    }, [FILTER_8TAP_SHARP] = {
-        { -1,  3,  -7, 127,   8,  -3,  1,  0 },
-        { -2,  5, -13, 125,  17,  -6,  3, -1 },
-        { -3,  7, -17, 121,  27, -10,  5, -2 },
-        { -4,  9, -20, 115,  37, -13,  6, -2 },
-        { -4, 10, -23, 108,  48, -16,  8, -3 },
-        { -4, 10, -24, 100,  59, -19,  9, -3 },
-        { -4, 11, -24,  90,  70, -21, 10, -4 },
-        { -4, 11, -23,  80,  80, -23, 11, -4 },
-        { -4, 10, -21,  70,  90, -24, 11, -4 },
-        { -3,  9, -19,  59, 100, -24, 10, -4 },
-        { -3,  8, -16,  48, 108, -23, 10, -4 },
-        { -2,  6, -13,  37, 115, -20,  9, -4 },
-        { -2,  5, -10,  27, 121, -17,  7, -3 },
-        { -1,  3,  -6,  17, 125, -13,  5, -2 },
-        {  0,  1,  -3,   8, 127,  -7,  3, -1 },
-    }, [FILTER_8TAP_SMOOTH] = {
-        { -3, -1,  32,  64,  38,   1, -3,  0 },
-        { -2, -2,  29,  63,  41,   2, -3,  0 },
-        { -2, -2,  26,  63,  43,   4, -4,  0 },
-        { -2, -3,  24,  62,  46,   5, -4,  0 },
-        { -2, -3,  21,  60,  49,   7, -4,  0 },
-        { -1, -4,  18,  59,  51,   9, -4,  0 },
-        { -1, -4,  16,  57,  53,  12, -4, -1 },
-        { -1, -4,  14,  55,  55,  14, -4, -1 },
-        { -1, -4,  12,  53,  57,  16, -4, -1 },
-        {  0, -4,   9,  51,  59,  18, -4, -1 },
-        {  0, -4,   7,  49,  60,  21, -3, -2 },
-        {  0, -4,   5,  46,  62,  24, -3, -2 },
-        {  0, -4,   4,  43,  63,  26, -2, -2 },
-        {  0, -3,   2,  41,  63,  29, -2, -2 },
-        {  0, -3,   1,  38,  64,  32, -1, -3 },
-    }
-};
-
-#define FILTER_8TAP(src, x, F, stride)              \
-    av_clip_uint8((F[0] * src[x + -3 * stride] +    \
-                   F[1] * src[x + -2 * stride] +    \
-                   F[2] * src[x + -1 * stride] +    \
-                   F[3] * src[x + +0 * stride] +    \
-                   F[4] * src[x + +1 * stride] +    \
-                   F[5] * src[x + +2 * stride] +    \
-                   F[6] * src[x + +3 * stride] +    \
-                   F[7] * src[x + +4 * stride] + 64) >> 7)
-
-static av_always_inline void do_8tap_1d_c(uint8_t *dst, const uint8_t *src,
-                                          ptrdiff_t dst_stride,
-                                          ptrdiff_t src_stride,
-                                          int w, int h, ptrdiff_t ds,
-                                          const int8_t *filter, int avg)
-{
-    do {
-        int x;
-
-        for (x = 0; x < w; x++)
-            if (avg)
-                dst[x] = (dst[x] + FILTER_8TAP(src, x, filter, ds) + 1) >> 1;
-            else
-                dst[x] = FILTER_8TAP(src, x, filter, ds);
-
-        dst += dst_stride;
-        src += src_stride;
-    } while (--h);
-}
-
-#define filter_8tap_1d_fn(opn, opa, dir, ds)                                \
-static av_noinline void opn ## _8tap_1d_ ## dir ## _c(uint8_t *dst,         \
-                                                      const uint8_t *src,   \
-                                                      ptrdiff_t dst_stride, \
-                                                      ptrdiff_t src_stride, \
-                                                      int w, int h,         \
-                                                      const int8_t *filter) \
-{                                                                           \
-    do_8tap_1d_c(dst, src, dst_stride, src_stride, w, h, ds, filter, opa);  \
-}
-
-filter_8tap_1d_fn(put, 0, v, src_stride)
-filter_8tap_1d_fn(put, 0, h, 1)
-filter_8tap_1d_fn(avg, 1, v, src_stride)
-filter_8tap_1d_fn(avg, 1, h, 1)
-
-#undef filter_8tap_1d_fn
-
-static av_always_inline void do_8tap_2d_c(uint8_t *dst, const uint8_t *src,
-                                          ptrdiff_t dst_stride,
-                                          ptrdiff_t src_stride,
-                                          int w, int h, const int8_t *filterx,
-                                          const int8_t *filtery, int avg)
-{
-    int tmp_h = h + 7;
-    uint8_t tmp[64 * 71], *tmp_ptr = tmp;
-
-    src -= src_stride * 3;
-    do {
-        int x;
-
-        for (x = 0; x < w; x++)
-            tmp_ptr[x] = FILTER_8TAP(src, x, filterx, 1);
-
-        tmp_ptr += 64;
-        src     += src_stride;
-    } while (--tmp_h);
-
-    tmp_ptr = tmp + 64 * 3;
-    do {
-        int x;
-
-        for (x = 0; x < w; x++)
-            if (avg)
-                dst[x] = (dst[x] + FILTER_8TAP(tmp_ptr, x, filtery, 64) + 1) >> 1;
-            else
-                dst[x] = FILTER_8TAP(tmp_ptr, x, filtery, 64);
-
-        tmp_ptr += 64;
-        dst += dst_stride;
-    } while (--h);
-}
-
-#define filter_8tap_2d_fn(opn, opa)                                     \
-static av_noinline void opn ## _8tap_2d_hv_c(uint8_t *dst,              \
-                                             const uint8_t *src,        \
-                                             ptrdiff_t dst_stride,      \
-                                             ptrdiff_t src_stride,      \
-                                             int w, int h,              \
-                                             const int8_t *filterx,     \
-                                             const int8_t *filtery)     \
-{                                                                       \
-    do_8tap_2d_c(dst, src, dst_stride, src_stride,                      \
-                 w, h, filterx, filtery, opa);                          \
-}
-
-filter_8tap_2d_fn(put, 0)
-filter_8tap_2d_fn(avg, 1)
-
-#undef filter_8tap_2d_fn
-
-#undef FILTER_8TAP
-
-#define filter_fn_1d(sz, dir, dir_m, type, type_idx, avg)                   \
-static void                                                                 \
-avg ## _8tap_ ## type ## _ ## sz ## dir ## _c(uint8_t *dst,                 \
-                                              const uint8_t *src,           \
-                                              ptrdiff_t dst_stride,         \
-                                              ptrdiff_t src_stride,         \
-                                              int h, int mx, int my)        \
-{                                                                           \
-    avg ## _8tap_1d_ ## dir ## _c(dst, src, dst_stride, src_stride, sz, h,  \
-                                  vp9_subpel_filters[type_idx][dir_m - 1]); \
-}
-
-#define filter_fn_2d(sz, type, type_idx, avg)                               \
-static void avg ## _8tap_ ## type ## _ ## sz ## hv_c(uint8_t *dst,          \
-                                                     const uint8_t *src,    \
-                                                     ptrdiff_t dst_stride,  \
-                                                     ptrdiff_t src_stride,  \
-                                                     int h, int mx, int my) \
-{                                                                           \
-    avg ## _8tap_2d_hv_c(dst, src, dst_stride, src_stride, sz, h,           \
-                         vp9_subpel_filters[type_idx][mx - 1],              \
-                         vp9_subpel_filters[type_idx][my - 1]);             \
-}
-
-#define FILTER_BILIN(src, x, mxy, stride)                       \
-    (src[x] + ((mxy * (src[x + stride] - src[x]) + 8) >> 4))
-
-static av_always_inline void do_bilin_1d_c(uint8_t *dst,
-                                           const uint8_t *src,
-                                           ptrdiff_t dst_stride,
-                                           ptrdiff_t src_stride,
-                                           int w, int h, ptrdiff_t ds,
-                                           int mxy, int avg)
-{
-    do {
-        int x;
-
-        for (x = 0; x < w; x++)
-            if (avg)
-                dst[x] = (dst[x] + FILTER_BILIN(src, x, mxy, ds) + 1) >> 1;
-            else
-                dst[x] = FILTER_BILIN(src, x, mxy, ds);
-
-        dst += dst_stride;
-        src += src_stride;
-    } while (--h);
-}
-
-#define bilin_1d_fn(opn, opa, dir, ds)                                        \
-static av_noinline void opn ## _bilin_1d_ ## dir ## _c(uint8_t *dst,          \
-                                                       const uint8_t *src,    \
-                                                       ptrdiff_t dst_stride,  \
-                                                       ptrdiff_t src_stride,  \
-                                                       int w, int h, int mxy) \
-{                                                                             \
-    do_bilin_1d_c(dst, src, dst_stride, src_stride, w, h, ds, mxy, opa);      \
-}
-
-bilin_1d_fn(put, 0, v, src_stride)
-bilin_1d_fn(put, 0, h, 1)
-bilin_1d_fn(avg, 1, v, src_stride)
-bilin_1d_fn(avg, 1, h, 1)
-
-#undef bilin_1d_fn
-
-static av_always_inline void do_bilin_2d_c(uint8_t *dst,
-                                           const uint8_t *src,
-                                           ptrdiff_t dst_stride,
-                                           ptrdiff_t src_stride,
-                                           int w, int h, int mx, int my,
-                                           int avg)
-{
-    uint8_t tmp[64 * 65], *tmp_ptr = tmp;
-    int tmp_h = h + 1;
-
-    do {
-        int x;
-
-        for (x = 0; x < w; x++)
-            tmp_ptr[x] = FILTER_BILIN(src, x, mx, 1);
-
-        tmp_ptr += 64;
-        src     += src_stride;
-    } while (--tmp_h);
-
-    tmp_ptr = tmp;
-    do {
-        int x;
-
-        for (x = 0; x < w; x++)
-            if (avg)
-                dst[x] = (dst[x] + FILTER_BILIN(tmp_ptr, x, my, 64) + 1) >> 1;
-            else
-                dst[x] = FILTER_BILIN(tmp_ptr, x, my, 64);
-
-        tmp_ptr += 64;
-        dst += dst_stride;
-    } while (--h);
-}
-
-#define bilin_2d_fn(opn, opa)                                           \
-static av_noinline void opn ## _bilin_2d_hv_c(uint8_t *dst,             \
-                                              const uint8_t *src,       \
-                                              ptrdiff_t dst_stride,     \
-                                              ptrdiff_t src_stride,     \
-                                              int w, int h,             \
-                                              int mx, int my)           \
-{                                                                       \
-    do_bilin_2d_c(dst, src, dst_stride, src_stride, w, h, mx, my, opa); \
-}
-
-bilin_2d_fn(put, 0)
-bilin_2d_fn(avg, 1)
-
-#undef bilin_2d_fn
-
-#undef FILTER_BILIN
-
-#define bilinf_fn_1d(sz, dir, dir_m, avg)                               \
-static void avg ## _bilin_ ## sz ## dir ## _c(uint8_t *dst,             \
-                                              const uint8_t *src,       \
-                                              ptrdiff_t dst_stride,     \
-                                              ptrdiff_t src_stride,     \
-                                              int h, int mx, int my)    \
-{                                                                       \
-    avg ## _bilin_1d_ ## dir ## _c(dst, src, dst_stride, src_stride,    \
-                                   sz, h, dir_m);                       \
-}
-
-#define bilinf_fn_2d(sz, avg)                                        \
-static void avg ## _bilin_ ## sz ## hv_c(uint8_t *dst,               \
-                                         const uint8_t *src,         \
-                                         ptrdiff_t dst_stride,       \
-                                         ptrdiff_t src_stride,       \
-                                         int h, int mx, int my)      \
-{                                                                    \
-    avg ## _bilin_2d_hv_c(dst, src, dst_stride, src_stride,          \
-                          sz, h, mx, my);                            \
-}
-
-#define filter_fn(sz, avg)                                     \
-    filter_fn_1d(sz, h, mx, regular, FILTER_8TAP_REGULAR, avg) \
-    filter_fn_1d(sz, v, my, regular, FILTER_8TAP_REGULAR, avg) \
-    filter_fn_2d(sz, regular, FILTER_8TAP_REGULAR, avg)        \
-    filter_fn_1d(sz, h, mx, smooth, FILTER_8TAP_SMOOTH, avg)   \
-    filter_fn_1d(sz, v, my, smooth, FILTER_8TAP_SMOOTH, avg)   \
-    filter_fn_2d(sz, smooth, FILTER_8TAP_SMOOTH, avg)          \
-    filter_fn_1d(sz, h, mx, sharp, FILTER_8TAP_SHARP, avg)     \
-    filter_fn_1d(sz, v, my, sharp, FILTER_8TAP_SHARP, avg)     \
-    filter_fn_2d(sz, sharp, FILTER_8TAP_SHARP, avg)            \
-    bilinf_fn_1d(sz, h, mx, avg)                               \
-    bilinf_fn_1d(sz, v, my, avg)                               \
-    bilinf_fn_2d(sz, avg)
-
-#define filter_fn_set(avg) \
-    filter_fn(64, avg)     \
-    filter_fn(32, avg)     \
-    filter_fn(16, avg)     \
-    filter_fn(8, avg)      \
-    filter_fn(4, avg)
-
-filter_fn_set(put)
-filter_fn_set(avg)
-
-#undef filter_fn
-#undef filter_fn_set
-#undef filter_fn_1d
-#undef filter_fn_2d
-#undef bilinf_fn_1d
-#undef bilinf_fn_2d
-
-static av_cold void vp9dsp_mc_init(VP9DSPContext *dsp)
-{
-#define init_fpel(idx1, idx2, sz, type)                                \
-    dsp->mc[idx1][FILTER_8TAP_SMOOTH][idx2][0][0]  = type ## sz ## _c; \
-    dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][0][0] = type ## sz ## _c; \
-    dsp->mc[idx1][FILTER_8TAP_SHARP][idx2][0][0]   = type ## sz ## _c; \
-    dsp->mc[idx1][FILTER_BILINEAR][idx2][0][0]     = type ## sz ## _c
-
-#define init_copy_avg(idx, sz)          \
-    init_fpel(idx, 0, sz, copy);        \
-    init_fpel(idx, 1, sz, avg)
-
-    init_copy_avg(0, 64);
-    init_copy_avg(1, 32);
-    init_copy_avg(2, 16);
-    init_copy_avg(3,  8);
-    init_copy_avg(4,  4);
-
-#undef init_copy_avg
-#undef init_fpel
-
-#define init_subpel1(idx1, idx2, idxh, idxv, sz, dir, type)             \
-    dsp->mc[idx1][FILTER_8TAP_SMOOTH][idx2][idxh][idxv]  = type ## _8tap_smooth_  ## sz ## dir ## _c; \
-    dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][idxh][idxv] = type ## _8tap_regular_ ## sz ## dir ## _c; \
-    dsp->mc[idx1][FILTER_8TAP_SHARP][idx2][idxh][idxv]   = type ## _8tap_sharp_   ## sz ## dir ## _c; \
-    dsp->mc[idx1][FILTER_BILINEAR][idx2][idxh][idxv]     = type ## _bilin_        ## sz ## dir ## _c
-
-#define init_subpel2(idx, idxh, idxv, dir, type)     \
-    init_subpel1(0, idx, idxh, idxv, 64, dir, type); \
-    init_subpel1(1, idx, idxh, idxv, 32, dir, type); \
-    init_subpel1(2, idx, idxh, idxv, 16, dir, type); \
-    init_subpel1(3, idx, idxh, idxv,  8, dir, type); \
-    init_subpel1(4, idx, idxh, idxv,  4, dir, type)
-
-#define init_subpel3(idx, type)         \
-    init_subpel2(idx, 1, 1, hv, type);  \
-    init_subpel2(idx, 0, 1, v, type);   \
-    init_subpel2(idx, 1, 0, h, type)
-
-    init_subpel3(0, put);
-    init_subpel3(1, avg);
-
-#undef init_subpel1
-#undef init_subpel2
-#undef init_subpel3
-}
-
-av_cold void ff_vp9dsp_init(VP9DSPContext *dsp)
-{
-    vp9dsp_intrapred_init(dsp);
-    vp9dsp_itxfm_init(dsp);
-    vp9dsp_loopfilter_init(dsp);
-    vp9dsp_mc_init(dsp);
-
-    if (ARCH_X86)
-        ff_vp9dsp_init_x86(dsp);
-}
diff --git a/deps/libav/libavcodec/vp9mvs.c b/deps/libav/libavcodec/vp9mvs.c
deleted file mode 100644
index 1f65aaa..0000000
--- a/deps/libav/libavcodec/vp9mvs.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * VP9 compatible video decoder
- *
- * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
- * Copyright (C) 2013 Clément Bœsch <u pkh me>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "internal.h"
-#include "vp56.h"
-#include "vp9.h"
-#include "vp9data.h"
-
-static av_always_inline void clamp_mv(VP56mv *dst, const VP56mv *src,
-                                      VP9Context *s)
-{
-    dst->x = av_clip(src->x, s->min_mv.x, s->max_mv.x);
-    dst->y = av_clip(src->y, s->min_mv.y, s->max_mv.y);
-}
-
-static void find_ref_mvs(VP9Context *s,
-                         VP56mv *pmv, int ref, int z, int idx, int sb)
-{
-    static const int8_t mv_ref_blk_off[N_BS_SIZES][8][2] = {
-        [BS_64x64] = { {  3, -1 }, { -1,  3 }, {  4, -1 }, { -1,  4 },
-                       { -1, -1 }, {  0, -1 }, { -1,  0 }, {  6, -1 } },
-        [BS_64x32] = { {  0, -1 }, { -1,  0 }, {  4, -1 }, { -1,  2 },
-                       { -1, -1 }, {  0, -3 }, { -3,  0 }, {  2, -1 } },
-        [BS_32x64] = { { -1,  0 }, {  0, -1 }, { -1,  4 }, {  2, -1 },
-                       { -1, -1 }, { -3,  0 }, {  0, -3 }, { -1,  2 } },
-        [BS_32x32] = { {  1, -1 }, { -1,  1 }, {  2, -1 }, { -1,  2 },
-                       { -1, -1 }, {  0, -3 }, { -3,  0 }, { -3, -3 } },
-        [BS_32x16] = { {  0, -1 }, { -1,  0 }, {  2, -1 }, { -1, -1 },
-                       { -1,  1 }, {  0, -3 }, { -3,  0 }, { -3, -3 } },
-        [BS_16x32] = { { -1,  0 }, {  0, -1 }, { -1,  2 }, { -1, -1 },
-                       {  1, -1 }, { -3,  0 }, {  0, -3 }, { -3, -3 } },
-        [BS_16x16] = { {  0, -1 }, { -1,  0 }, {  1, -1 }, { -1,  1 },
-                       { -1, -1 }, {  0, -3 }, { -3,  0 }, { -3, -3 } },
-        [BS_16x8]  = { {  0, -1 }, { -1,  0 }, {  1, -1 }, { -1, -1 },
-                       {  0, -2 }, { -2,  0 }, { -2, -1 }, { -1, -2 } },
-        [BS_8x16]  = { { -1,  0 }, {  0, -1 }, { -1,  1 }, { -1, -1 },
-                       { -2,  0 }, {  0, -2 }, { -1, -2 }, { -2, -1 } },
-        [BS_8x8]   = { {  0, -1 }, { -1,  0 }, { -1, -1 }, {  0, -2 },
-                       { -2,  0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } },
-        [BS_8x4]   = { {  0, -1 }, { -1,  0 }, { -1, -1 }, {  0, -2 },
-                       { -2,  0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } },
-        [BS_4x8]   = { {  0, -1 }, { -1,  0 }, { -1, -1 }, {  0, -2 },
-                       { -2,  0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } },
-        [BS_4x4]   = { {  0, -1 }, { -1,  0 }, { -1, -1 }, {  0, -2 },
-                       { -2,  0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } },
-    };
-    VP9Block *const b = &s->b;
-    int row = b->row, col = b->col, row7 = b->row7;
-    const int8_t (*p)[2] = mv_ref_blk_off[b->bs];
-#define INVALID_MV 0x80008000U
-    uint32_t mem = INVALID_MV;
-    int i;
-
-#define RETURN_DIRECT_MV(mv)                    \
-    do {                                        \
-        uint32_t m = AV_RN32A(&mv);             \
-        if (!idx) {                             \
-            AV_WN32A(pmv, m);                   \
-            return;                             \
-        } else if (mem == INVALID_MV) {         \
-            mem = m;                            \
-        } else if (m != mem) {                  \
-            AV_WN32A(pmv, m);                   \
-            return;                             \
-        }                                       \
-    } while (0)
-
-    if (sb >= 0) {
-        if (sb == 2 || sb == 1) {
-            RETURN_DIRECT_MV(b->mv[0][z]);
-        } else if (sb == 3) {
-            RETURN_DIRECT_MV(b->mv[2][z]);
-            RETURN_DIRECT_MV(b->mv[1][z]);
-            RETURN_DIRECT_MV(b->mv[0][z]);
-        }
-
-#define RETURN_MV(mv)                           \
-    do {                                        \
-        if (sb > 0) {                           \
-            VP56mv tmp;                         \
-            uint32_t m;                         \
-            clamp_mv(&tmp, &mv, s);             \
-            m = AV_RN32A(&tmp);                 \
-            if (!idx) {                         \
-                AV_WN32A(pmv, m);               \
-                return;                         \
-            } else if (mem == INVALID_MV) {     \
-                mem = m;                        \
-            } else if (m != mem) {              \
-                AV_WN32A(pmv, m);               \
-                return;                         \
-            }                                   \
-        } else {                                \
-            uint32_t m = AV_RN32A(&mv);         \
-            if (!idx) {                         \
-                clamp_mv(pmv, &mv, s);          \
-                return;                         \
-            } else if (mem == INVALID_MV) {     \
-                mem = m;                        \
-            } else if (m != mem) {              \
-                clamp_mv(pmv, &mv, s);          \
-                return;                         \
-            }                                   \
-        }                                       \
-    } while (0)
-
-        if (row > 0) {
-            VP9MVRefPair *mv = &s->mv[0][(row - 1) * s->sb_cols * 8 + col];
-
-            if (mv->ref[0] == ref)
-                RETURN_MV(s->above_mv_ctx[2 * col + (sb & 1)][0]);
-            else if (mv->ref[1] == ref)
-                RETURN_MV(s->above_mv_ctx[2 * col + (sb & 1)][1]);
-        }
-        if (col > s->tiling.tile_col_start) {
-            VP9MVRefPair *mv = &s->mv[0][row * s->sb_cols * 8 + col - 1];
-
-            if (mv->ref[0] == ref)
-                RETURN_MV(s->left_mv_ctx[2 * row7 + (sb >> 1)][0]);
-            else if (mv->ref[1] == ref)
-                RETURN_MV(s->left_mv_ctx[2 * row7 + (sb >> 1)][1]);
-        }
-        i = 2;
-    } else {
-        i = 0;
-    }
-
-    // previously coded MVs in the neighborhood, using same reference frame
-    for (; i < 8; i++) {
-        int c = p[i][0] + col, r = p[i][1] + row;
-
-        if (c >= s->tiling.tile_col_start && c < s->cols &&
-            r >= 0 && r < s->rows) {
-            VP9MVRefPair *mv = &s->mv[0][r * s->sb_cols * 8 + c];
-
-            if (mv->ref[0] == ref)
-                RETURN_MV(mv->mv[0]);
-            else if (mv->ref[1] == ref)
-                RETURN_MV(mv->mv[1]);
-        }
-    }
-
-    // MV at this position in previous frame, using same reference frame
-    if (s->use_last_frame_mvs) {
-        VP9MVRefPair *mv = &s->mv[1][row * s->sb_cols * 8 + col];
-
-        if (mv->ref[0] == ref)
-            RETURN_MV(mv->mv[0]);
-        else if (mv->ref[1] == ref)
-            RETURN_MV(mv->mv[1]);
-    }
-
-#define RETURN_SCALE_MV(mv, scale)              \
-    do {                                        \
-        if (scale) {                            \
-            VP56mv mv_temp = { -mv.x, -mv.y };  \
-            RETURN_MV(mv_temp);                 \
-        } else {                                \
-            RETURN_MV(mv);                      \
-        }                                       \
-    } while (0)
-
-    // previously coded MVs in the neighborhood, using different reference frame
-    for (i = 0; i < 8; i++) {
-        int c = p[i][0] + col, r = p[i][1] + row;
-
-        if (c >= s->tiling.tile_col_start && c < s->cols &&
-            r >= 0 && r < s->rows) {
-            VP9MVRefPair *mv = &s->mv[0][r * s->sb_cols * 8 + c];
-
-            if (mv->ref[0] != ref && mv->ref[0] >= 0)
-                RETURN_SCALE_MV(mv->mv[0],
-                                s->signbias[mv->ref[0]] != s->signbias[ref]);
-            if (mv->ref[1] != ref && mv->ref[1] >= 0 &&
-                // BUG - libvpx has this condition regardless of whether
-                // we used the first ref MV and pre-scaling
-                AV_RN32A(&mv->mv[0]) != AV_RN32A(&mv->mv[1])) {
-                RETURN_SCALE_MV(mv->mv[1],
-                                s->signbias[mv->ref[1]] != s->signbias[ref]);
-            }
-        }
-    }
-
-    // MV at this position in previous frame, using different reference frame
-    if (s->use_last_frame_mvs) {
-        VP9MVRefPair *mv = &s->mv[1][row * s->sb_cols * 8 + col];
-
-        if (mv->ref[0] != ref && mv->ref[0] >= 0)
-            RETURN_SCALE_MV(mv->mv[0],
-                            s->signbias[mv->ref[0]] != s->signbias[ref]);
-        if (mv->ref[1] != ref && mv->ref[1] >= 0 &&
-            // BUG - libvpx has this condition regardless of whether
-            // we used the first ref MV and pre-scaling
-            AV_RN32A(&mv->mv[0]) != AV_RN32A(&mv->mv[1])) {
-            RETURN_SCALE_MV(mv->mv[1],
-                            s->signbias[mv->ref[1]] != s->signbias[ref]);
-        }
-    }
-
-    AV_ZERO32(pmv);
-#undef INVALID_MV
-#undef RETURN_MV
-#undef RETURN_SCALE_MV
-}
-
-static av_always_inline int read_mv_component(VP9Context *s, int idx, int hp)
-{
-    int bit, sign = vp56_rac_get_prob(&s->c, s->prob.p.mv_comp[idx].sign);
-    int n, c = vp8_rac_get_tree(&s->c, ff_vp9_mv_class_tree,
-                                s->prob.p.mv_comp[idx].classes);
-
-    s->counts.mv_comp[idx].sign[sign]++;
-    s->counts.mv_comp[idx].classes[c]++;
-    if (c) {
-        int m;
-
-        for (n = 0, m = 0; m < c; m++) {
-            bit = vp56_rac_get_prob(&s->c, s->prob.p.mv_comp[idx].bits[m]);
-            n  |= bit << m;
-            s->counts.mv_comp[idx].bits[m][bit]++;
-        }
-        n <<= 3;
-        bit = vp8_rac_get_tree(&s->c, ff_vp9_mv_fp_tree,
-                               s->prob.p.mv_comp[idx].fp);
-        n  |= bit << 1;
-        s->counts.mv_comp[idx].fp[bit]++;
-        if (hp) {
-            bit = vp56_rac_get_prob(&s->c, s->prob.p.mv_comp[idx].hp);
-            s->counts.mv_comp[idx].hp[bit]++;
-            n |= bit;
-        } else {
-            n |= 1;
-            // bug in libvpx - we count for bw entropy purposes even if the
-            // bit wasn't coded
-            s->counts.mv_comp[idx].hp[1]++;
-        }
-        n += 8 << c;
-    } else {
-        n = vp56_rac_get_prob(&s->c, s->prob.p.mv_comp[idx].class0);
-        s->counts.mv_comp[idx].class0[n]++;
-        bit = vp8_rac_get_tree(&s->c, ff_vp9_mv_fp_tree,
-                               s->prob.p.mv_comp[idx].class0_fp[n]);
-        s->counts.mv_comp[idx].class0_fp[n][bit]++;
-        n = (n << 3) | (bit << 1);
-        if (hp) {
-            bit = vp56_rac_get_prob(&s->c, s->prob.p.mv_comp[idx].class0_hp);
-            s->counts.mv_comp[idx].class0_hp[bit]++;
-            n |= bit;
-        } else {
-            n |= 1;
-            // bug in libvpx - we count for bw entropy purposes even if the
-            // bit wasn't coded
-            s->counts.mv_comp[idx].class0_hp[1]++;
-        }
-    }
-
-    return sign ? -(n + 1) : (n + 1);
-}
-
-void ff_vp9_fill_mv(VP9Context *s, VP56mv *mv, int mode, int sb)
-{
-    VP9Block *const b = &s->b;
-
-    if (mode == ZEROMV) {
-        memset(mv, 0, sizeof(*mv) * 2);
-    } else {
-        int hp;
-
-        // FIXME cache this value and reuse for other subblocks
-        find_ref_mvs(s, &mv[0], b->ref[0], 0, mode == NEARMV,
-                     mode == NEWMV ? -1 : sb);
-        // FIXME maybe move this code into find_ref_mvs()
-        if ((mode == NEWMV || sb == -1) &&
-            !(hp = s->highprecisionmvs &&
-              abs(mv[0].x) < 64 && abs(mv[0].y) < 64)) {
-            if (mv[0].y & 1) {
-                if (mv[0].y < 0)
-                    mv[0].y++;
-                else
-                    mv[0].y--;
-            }
-            if (mv[0].x & 1) {
-                if (mv[0].x < 0)
-                    mv[0].x++;
-                else
-                    mv[0].x--;
-            }
-        }
-        if (mode == NEWMV) {
-            enum MVJoint j = vp8_rac_get_tree(&s->c, ff_vp9_mv_joint_tree,
-                                              s->prob.p.mv_joint);
-
-            s->counts.mv_joint[j]++;
-            if (j >= MV_JOINT_V)
-                mv[0].y += read_mv_component(s, 0, hp);
-            if (j & 1)
-                mv[0].x += read_mv_component(s, 1, hp);
-        }
-
-        if (b->comp) {
-            // FIXME cache this value and reuse for other subblocks
-            find_ref_mvs(s, &mv[1], b->ref[1], 1, mode == NEARMV,
-                         mode == NEWMV ? -1 : sb);
-            if ((mode == NEWMV || sb == -1) &&
-                !(hp = s->highprecisionmvs &&
-                  abs(mv[1].x) < 64 && abs(mv[1].y) < 64)) {
-                if (mv[1].y & 1) {
-                    if (mv[1].y < 0)
-                        mv[1].y++;
-                    else
-                        mv[1].y--;
-                }
-                if (mv[1].x & 1) {
-                    if (mv[1].x < 0)
-                        mv[1].x++;
-                    else
-                        mv[1].x--;
-                }
-            }
-            if (mode == NEWMV) {
-                enum MVJoint j = vp8_rac_get_tree(&s->c, ff_vp9_mv_joint_tree,
-                                                  s->prob.p.mv_joint);
-
-                s->counts.mv_joint[j]++;
-                if (j >= MV_JOINT_V)
-                    mv[1].y += read_mv_component(s, 0, hp);
-                if (j & 1)
-                    mv[1].x += read_mv_component(s, 1, hp);
-            }
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/vp9prob.c b/deps/libav/libavcodec/vp9prob.c
deleted file mode 100644
index b8a7c22..0000000
--- a/deps/libav/libavcodec/vp9prob.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * VP9 compatible video decoder
- *
- * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
- * Copyright (C) 2013 Clément Bœsch <u pkh me>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "vp56.h"
-#include "vp9.h"
-#include "vp9data.h"
-
-static av_always_inline void adapt_prob(uint8_t *p, unsigned ct0, unsigned ct1,
-                                        int max_count, int update_factor)
-{
-    unsigned ct = ct0 + ct1, p2, p1;
-
-    if (!ct)
-        return;
-
-    p1 = *p;
-    p2 = ((ct0 << 8) + (ct >> 1)) / ct;
-    p2 = av_clip(p2, 1, 255);
-    ct = FFMIN(ct, max_count);
-    update_factor = FASTDIV(update_factor * ct, max_count);
-
-    // (p1 * (256 - update_factor) + p2 * update_factor + 128) >> 8
-    *p = p1 + (((p2 - p1) * update_factor + 128) >> 8);
-}
-
-void ff_vp9_adapt_probs(VP9Context *s)
-{
-    int i, j, k, l, m;
-    ProbContext *p = &s->prob_ctx[s->framectxid].p;
-    int uf = (s->keyframe || s->intraonly || !s->last_keyframe) ? 112 : 128;
-
-    // coefficients
-    for (i = 0; i < 4; i++)
-        for (j = 0; j < 2; j++)
-            for (k = 0; k < 2; k++)
-                for (l = 0; l < 6; l++)
-                    for (m = 0; m < 6; m++) {
-                        uint8_t *pp = s->prob_ctx[s->framectxid].coef[i][j][k][l][m];
-                        unsigned *e = s->counts.eob[i][j][k][l][m];
-                        unsigned *c = s->counts.coef[i][j][k][l][m];
-
-                        if (l == 0 && m >= 3) // dc only has 3 pt
-                            break;
-
-                        adapt_prob(&pp[0], e[0], e[1], 24, uf);
-                        adapt_prob(&pp[1], c[0], c[1] + c[2], 24, uf);
-                        adapt_prob(&pp[2], c[1], c[2], 24, uf);
-                    }
-
-    if (s->keyframe || s->intraonly) {
-        memcpy(p->skip,  s->prob.p.skip,  sizeof(p->skip));
-        memcpy(p->tx32p, s->prob.p.tx32p, sizeof(p->tx32p));
-        memcpy(p->tx16p, s->prob.p.tx16p, sizeof(p->tx16p));
-        memcpy(p->tx8p,  s->prob.p.tx8p,  sizeof(p->tx8p));
-        return;
-    }
-
-    // skip flag
-    for (i = 0; i < 3; i++)
-        adapt_prob(&p->skip[i], s->counts.skip[i][0],
-                   s->counts.skip[i][1], 20, 128);
-
-    // intra/inter flag
-    for (i = 0; i < 4; i++)
-        adapt_prob(&p->intra[i], s->counts.intra[i][0],
-                   s->counts.intra[i][1], 20, 128);
-
-    // comppred flag
-    if (s->comppredmode == PRED_SWITCHABLE) {
-        for (i = 0; i < 5; i++)
-            adapt_prob(&p->comp[i], s->counts.comp[i][0],
-                       s->counts.comp[i][1], 20, 128);
-    }
-
-    // reference frames
-    if (s->comppredmode != PRED_SINGLEREF) {
-        for (i = 0; i < 5; i++)
-            adapt_prob(&p->comp_ref[i], s->counts.comp_ref[i][0],
-                       s->counts.comp_ref[i][1], 20, 128);
-    }
-
-    if (s->comppredmode != PRED_COMPREF) {
-        for (i = 0; i < 5; i++) {
-            uint8_t *pp = p->single_ref[i];
-            unsigned (*c)[2] = s->counts.single_ref[i];
-
-            adapt_prob(&pp[0], c[0][0], c[0][1], 20, 128);
-            adapt_prob(&pp[1], c[1][0], c[1][1], 20, 128);
-        }
-    }
-
-    // block partitioning
-    for (i = 0; i < 4; i++)
-        for (j = 0; j < 4; j++) {
-            uint8_t *pp = p->partition[i][j];
-            unsigned *c = s->counts.partition[i][j];
-
-            adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);
-            adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);
-            adapt_prob(&pp[2], c[2], c[3], 20, 128);
-        }
-
-    // tx size
-    if (s->txfmmode == TX_SWITCHABLE) {
-        for (i = 0; i < 2; i++) {
-            unsigned *c16 = s->counts.tx16p[i], *c32 = s->counts.tx32p[i];
-
-            adapt_prob(&p->tx8p[i], s->counts.tx8p[i][0],
-                       s->counts.tx8p[i][1], 20, 128);
-            adapt_prob(&p->tx16p[i][0], c16[0], c16[1] + c16[2], 20, 128);
-            adapt_prob(&p->tx16p[i][1], c16[1], c16[2], 20, 128);
-            adapt_prob(&p->tx32p[i][0], c32[0], c32[1] + c32[2] + c32[3], 20, 128);
-            adapt_prob(&p->tx32p[i][1], c32[1], c32[2] + c32[3], 20, 128);
-            adapt_prob(&p->tx32p[i][2], c32[2], c32[3], 20, 128);
-        }
-    }
-
-    // interpolation filter
-    if (s->filtermode == FILTER_SWITCHABLE) {
-        for (i = 0; i < 4; i++) {
-            uint8_t *pp = p->filter[i];
-            unsigned *c = s->counts.filter[i];
-
-            adapt_prob(&pp[0], c[0], c[1] + c[2], 20, 128);
-            adapt_prob(&pp[1], c[1], c[2], 20, 128);
-        }
-    }
-
-    // inter modes
-    for (i = 0; i < 7; i++) {
-        uint8_t *pp = p->mv_mode[i];
-        unsigned *c = s->counts.mv_mode[i];
-
-        adapt_prob(&pp[0], c[2], c[1] + c[0] + c[3], 20, 128);
-        adapt_prob(&pp[1], c[0], c[1] + c[3], 20, 128);
-        adapt_prob(&pp[2], c[1], c[3], 20, 128);
-    }
-
-    // mv joints
-    {
-        uint8_t *pp = p->mv_joint;
-        unsigned *c = s->counts.mv_joint;
-
-        adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);
-        adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);
-        adapt_prob(&pp[2], c[2], c[3], 20, 128);
-    }
-
-    // mv components
-    for (i = 0; i < 2; i++) {
-        uint8_t *pp;
-        unsigned *c, (*c2)[2], sum;
-
-        adapt_prob(&p->mv_comp[i].sign, s->counts.mv_comp[i].sign[0],
-                   s->counts.mv_comp[i].sign[1], 20, 128);
-
-        pp  = p->mv_comp[i].classes;
-        c   = s->counts.mv_comp[i].classes;
-        sum = c[1] + c[2] + c[3] + c[4] + c[5] +
-              c[6] + c[7] + c[8] + c[9] + c[10];
-        adapt_prob(&pp[0], c[0], sum, 20, 128);
-        sum -= c[1];
-        adapt_prob(&pp[1], c[1], sum, 20, 128);
-        sum -= c[2] + c[3];
-        adapt_prob(&pp[2], c[2] + c[3], sum, 20, 128);
-        adapt_prob(&pp[3], c[2], c[3], 20, 128);
-        sum -= c[4] + c[5];
-        adapt_prob(&pp[4], c[4] + c[5], sum, 20, 128);
-        adapt_prob(&pp[5], c[4], c[5], 20, 128);
-        sum -= c[6];
-        adapt_prob(&pp[6], c[6], sum, 20, 128);
-        adapt_prob(&pp[7], c[7] + c[8], c[9] + c[10], 20, 128);
-        adapt_prob(&pp[8], c[7], c[8], 20, 128);
-        adapt_prob(&pp[9], c[9], c[10], 20, 128);
-
-        adapt_prob(&p->mv_comp[i].class0, s->counts.mv_comp[i].class0[0],
-                   s->counts.mv_comp[i].class0[1], 20, 128);
-        pp = p->mv_comp[i].bits;
-        c2 = s->counts.mv_comp[i].bits;
-        for (j = 0; j < 10; j++)
-            adapt_prob(&pp[j], c2[j][0], c2[j][1], 20, 128);
-
-        for (j = 0; j < 2; j++) {
-            pp = p->mv_comp[i].class0_fp[j];
-            c  = s->counts.mv_comp[i].class0_fp[j];
-            adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);
-            adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);
-            adapt_prob(&pp[2], c[2], c[3], 20, 128);
-        }
-        pp = p->mv_comp[i].fp;
-        c  = s->counts.mv_comp[i].fp;
-        adapt_prob(&pp[0], c[0], c[1] + c[2] + c[3], 20, 128);
-        adapt_prob(&pp[1], c[1], c[2] + c[3], 20, 128);
-        adapt_prob(&pp[2], c[2], c[3], 20, 128);
-
-        if (s->highprecisionmvs) {
-            adapt_prob(&p->mv_comp[i].class0_hp,
-                       s->counts.mv_comp[i].class0_hp[0],
-                       s->counts.mv_comp[i].class0_hp[1], 20, 128);
-            adapt_prob(&p->mv_comp[i].hp, s->counts.mv_comp[i].hp[0],
-                       s->counts.mv_comp[i].hp[1], 20, 128);
-        }
-    }
-
-    // y intra modes
-    for (i = 0; i < 4; i++) {
-        uint8_t *pp = p->y_mode[i];
-        unsigned *c = s->counts.y_mode[i], sum, s2;
-
-        sum = c[0] + c[1] + c[3] + c[4] + c[5] + c[6] + c[7] + c[8] + c[9];
-        adapt_prob(&pp[0], c[DC_PRED], sum, 20, 128);
-        sum -= c[TM_VP8_PRED];
-        adapt_prob(&pp[1], c[TM_VP8_PRED], sum, 20, 128);
-        sum -= c[VERT_PRED];
-        adapt_prob(&pp[2], c[VERT_PRED], sum, 20, 128);
-        s2   = c[HOR_PRED] + c[DIAG_DOWN_RIGHT_PRED] + c[VERT_RIGHT_PRED];
-        sum -= s2;
-        adapt_prob(&pp[3], s2, sum, 20, 128);
-        s2 -= c[HOR_PRED];
-        adapt_prob(&pp[4], c[HOR_PRED], s2, 20, 128);
-        adapt_prob(&pp[5], c[DIAG_DOWN_RIGHT_PRED], c[VERT_RIGHT_PRED],
-                   20, 128);
-        sum -= c[DIAG_DOWN_LEFT_PRED];
-        adapt_prob(&pp[6], c[DIAG_DOWN_LEFT_PRED], sum, 20, 128);
-        sum -= c[VERT_LEFT_PRED];
-        adapt_prob(&pp[7], c[VERT_LEFT_PRED], sum, 20, 128);
-        adapt_prob(&pp[8], c[HOR_DOWN_PRED], c[HOR_UP_PRED], 20, 128);
-    }
-
-    // uv intra modes
-    for (i = 0; i < 10; i++) {
-        uint8_t *pp = p->uv_mode[i];
-        unsigned *c = s->counts.uv_mode[i], sum, s2;
-
-        sum = c[0] + c[1] + c[3] + c[4] + c[5] + c[6] + c[7] + c[8] + c[9];
-        adapt_prob(&pp[0], c[DC_PRED], sum, 20, 128);
-        sum -= c[TM_VP8_PRED];
-        adapt_prob(&pp[1], c[TM_VP8_PRED], sum, 20, 128);
-        sum -= c[VERT_PRED];
-        adapt_prob(&pp[2], c[VERT_PRED], sum, 20, 128);
-        s2   = c[HOR_PRED] + c[DIAG_DOWN_RIGHT_PRED] + c[VERT_RIGHT_PRED];
-        sum -= s2;
-        adapt_prob(&pp[3], s2, sum, 20, 128);
-        s2 -= c[HOR_PRED];
-        adapt_prob(&pp[4], c[HOR_PRED], s2, 20, 128);
-        adapt_prob(&pp[5], c[DIAG_DOWN_RIGHT_PRED], c[VERT_RIGHT_PRED],
-                   20, 128);
-        sum -= c[DIAG_DOWN_LEFT_PRED];
-        adapt_prob(&pp[6], c[DIAG_DOWN_LEFT_PRED], sum, 20, 128);
-        sum -= c[VERT_LEFT_PRED];
-        adapt_prob(&pp[7], c[VERT_LEFT_PRED], sum, 20, 128);
-        adapt_prob(&pp[8], c[HOR_DOWN_PRED], c[HOR_UP_PRED], 20, 128);
-    }
-}
diff --git a/deps/libav/libavcodec/vqavideo.c b/deps/libav/libavcodec/vqavideo.c
deleted file mode 100644
index 86f2fcf..0000000
--- a/deps/libav/libavcodec/vqavideo.c
+++ /dev/null
@@ -1,650 +0,0 @@
-/*
- * Westwood Studios VQA Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VQA Video Decoder
- * @author Mike Melanson (melanson at pcisys.net)
- * @see http://wiki.multimedia.cx/index.php?title=VQA
- *
- * The VQA video decoder outputs PAL8 or RGB555 colorspace data, depending
- * on the type of data in the file.
- *
- * This decoder needs the 42-byte VQHD header from the beginning
- * of the VQA file passed through the extradata field. The VQHD header
- * is laid out as:
- *
- *   bytes 0-3   chunk fourcc: 'VQHD'
- *   bytes 4-7   chunk size in big-endian format, should be 0x0000002A
- *   bytes 8-49  VQHD chunk data
- *
- * Bytes 8-49 are what this decoder expects to see.
- *
- * Briefly, VQA is a vector quantized animation format that operates in a
- * VGA palettized colorspace. It operates on pixel vectors (blocks)
- * of either 4x2 or 4x4 in size. Compressed VQA chunks can contain vector
- * codebooks, palette information, and code maps for rendering vectors onto
- * frames. Any of these components can also be compressed with a run-length
- * encoding (RLE) algorithm commonly referred to as "format80".
- *
- * VQA takes a novel approach to rate control. Each group of n frames
- * (usually, n = 8) relies on a different vector codebook. Rather than
- * transporting an entire codebook every 8th frame, the new codebook is
- * broken up into 8 pieces and sent along with the compressed video chunks
- * for each of the 8 frames preceding the 8 frames which require the
- * codebook. A full codebook is also sent on the very first frame of a
- * file. This is an interesting technique, although it makes random file
- * seeking difficult despite the fact that the frames are all intracoded.
- *
- * V1,2 VQA uses 12-bit codebook indexes. If the 12-bit indexes were
- * packed into bytes and then RLE compressed, bytewise, the results would
- * be poor. That is why the coding method divides each index into 2 parts,
- * the top 4 bits and the bottom 8 bits, then RL encodes the 4-bit pieces
- * together and the 8-bit pieces together. If most of the vectors are
- * clustered into one group of 256 vectors, most of the 4-bit index pieces
- * should be the same.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-
-#define PALETTE_COUNT 256
-#define VQA_HEADER_SIZE 0x2A
-
-/* allocate the maximum vector space, regardless of the file version:
- * (0xFF00 codebook vectors + 0x100 solid pixel vectors) * (4x4 pixels/block) */
-#define MAX_CODEBOOK_VECTORS 0xFF00
-#define SOLID_PIXEL_VECTORS 0x100
-#define MAX_VECTORS (MAX_CODEBOOK_VECTORS + SOLID_PIXEL_VECTORS)
-#define MAX_CODEBOOK_SIZE (MAX_VECTORS * 4 * 4)
-
-#define CBF0_TAG MKBETAG('C', 'B', 'F', '0')
-#define CBFZ_TAG MKBETAG('C', 'B', 'F', 'Z')
-#define CBP0_TAG MKBETAG('C', 'B', 'P', '0')
-#define CBPZ_TAG MKBETAG('C', 'B', 'P', 'Z')
-#define CPL0_TAG MKBETAG('C', 'P', 'L', '0')
-#define CPLZ_TAG MKBETAG('C', 'P', 'L', 'Z')
-#define VPTZ_TAG MKBETAG('V', 'P', 'T', 'Z')
-
-typedef struct VqaContext {
-
-    AVCodecContext *avctx;
-    GetByteContext gb;
-
-    uint32_t palette[PALETTE_COUNT];
-
-    int width;   /* width of a frame */
-    int height;   /* height of a frame */
-    int vector_width;  /* width of individual vector */
-    int vector_height;  /* height of individual vector */
-    int vqa_version;  /* this should be either 1, 2 or 3 */
-
-    unsigned char *codebook;         /* the current codebook */
-    int codebook_size;
-    unsigned char *next_codebook_buffer;  /* accumulator for next codebook */
-    int next_codebook_buffer_index;
-
-    unsigned char *decode_buffer;
-    int decode_buffer_size;
-
-    /* number of frames to go before replacing codebook */
-    int partial_countdown;
-    int partial_count;
-
-} VqaContext;
-
-static av_cold int vqa_decode_init(AVCodecContext *avctx)
-{
-    VqaContext *s = avctx->priv_data;
-    int i, j, codebook_index, ret;
-
-    s->avctx = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    /* make sure the extradata made it */
-    if (s->avctx->extradata_size != VQA_HEADER_SIZE) {
-        av_log(s->avctx, AV_LOG_ERROR, "  VQA video: expected extradata size of %d\n", VQA_HEADER_SIZE);
-        return AVERROR(EINVAL);
-    }
-
-    /* load up the VQA parameters from the header */
-    s->vqa_version = s->avctx->extradata[0];
-    switch (s->vqa_version) {
-    case 1:
-    case 2:
-        break;
-    case 3:
-        avpriv_report_missing_feature(avctx, "VQA Version %d", s->vqa_version);
-        return AVERROR_PATCHWELCOME;
-    default:
-        avpriv_request_sample(avctx, "VQA Version %i", s->vqa_version);
-        return AVERROR_PATCHWELCOME;
-    }
-    s->width = AV_RL16(&s->avctx->extradata[6]);
-    s->height = AV_RL16(&s->avctx->extradata[8]);
-    if ((ret = av_image_check_size(s->width, s->height, 0, avctx)) < 0) {
-        s->width= s->height= 0;
-        return ret;
-    }
-    s->vector_width = s->avctx->extradata[10];
-    s->vector_height = s->avctx->extradata[11];
-    s->partial_count = s->partial_countdown = s->avctx->extradata[13];
-
-    /* the vector dimensions have to meet very stringent requirements */
-    if ((s->vector_width != 4) ||
-        ((s->vector_height != 2) && (s->vector_height != 4))) {
-        /* return without further initialization */
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->width  & (s->vector_width  - 1) ||
-        s->height & (s->vector_height - 1)) {
-        av_log(avctx, AV_LOG_ERROR, "Image size not multiple of block size\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* allocate codebooks */
-    s->codebook_size = MAX_CODEBOOK_SIZE;
-    s->codebook = av_malloc(s->codebook_size);
-    if (!s->codebook)
-        goto fail;
-    s->next_codebook_buffer = av_malloc(s->codebook_size);
-    if (!s->next_codebook_buffer)
-        goto fail;
-
-    /* allocate decode buffer */
-    s->decode_buffer_size = (s->width / s->vector_width) *
-        (s->height / s->vector_height) * 2;
-    s->decode_buffer = av_malloc(s->decode_buffer_size);
-    if (!s->decode_buffer)
-        goto fail;
-
-    /* initialize the solid-color vectors */
-    if (s->vector_height == 4) {
-        codebook_index = 0xFF00 * 16;
-        for (i = 0; i < 256; i++)
-            for (j = 0; j < 16; j++)
-                s->codebook[codebook_index++] = i;
-    } else {
-        codebook_index = 0xF00 * 8;
-        for (i = 0; i < 256; i++)
-            for (j = 0; j < 8; j++)
-                s->codebook[codebook_index++] = i;
-    }
-    s->next_codebook_buffer_index = 0;
-
-    return 0;
-fail:
-    av_freep(&s->codebook);
-    av_freep(&s->next_codebook_buffer);
-    av_freep(&s->decode_buffer);
-    return AVERROR(ENOMEM);
-}
-
-#define CHECK_COUNT() \
-    if (dest_index + count > dest_size) { \
-        av_log(NULL, AV_LOG_ERROR, "  VQA video: decode_format80 problem: next op would overflow dest_index\n"); \
-        av_log(NULL, AV_LOG_ERROR, "  VQA video: current dest_index = %d, count = %d, dest_size = %d\n", \
-            dest_index, count, dest_size); \
-        return AVERROR_INVALIDDATA; \
-    }
-
-#define CHECK_COPY(idx) \
-    if (idx < 0 || idx + count > dest_size) { \
-        av_log(NULL, AV_LOG_ERROR, "  VQA video: decode_format80 problem: next op would overflow dest_index\n"); \
-        av_log(NULL, AV_LOG_ERROR, "  VQA video: current src_pos = %d, count = %d, dest_size = %d\n", \
-            src_pos, count, dest_size); \
-        return AVERROR_INVALIDDATA; \
-    }
-
-
-static int decode_format80(GetByteContext *gb, int src_size,
-    unsigned char *dest, int dest_size, int check_size) {
-
-    int dest_index = 0;
-    int count, opcode, start;
-    int src_pos;
-    unsigned char color;
-    int i;
-
-    start = bytestream2_tell(gb);
-    while (bytestream2_tell(gb) - start < src_size) {
-        opcode = bytestream2_get_byte(gb);
-        av_dlog(NULL, "      opcode %02X: ", opcode);
-
-        /* 0x80 means that frame is finished */
-        if (opcode == 0x80)
-            return 0;
-
-        if (dest_index >= dest_size) {
-            av_log(NULL, AV_LOG_ERROR, "  VQA video: decode_format80 problem: dest_index (%d) exceeded dest_size (%d)\n",
-                dest_index, dest_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (opcode == 0xFF) {
-
-            count   = bytestream2_get_le16(gb);
-            src_pos = bytestream2_get_le16(gb);
-            av_dlog(NULL, "(1) copy %X bytes from absolute pos %X\n", count, src_pos);
-            CHECK_COUNT();
-            CHECK_COPY(src_pos);
-            for (i = 0; i < count; i++)
-                dest[dest_index + i] = dest[src_pos + i];
-            dest_index += count;
-
-        } else if (opcode == 0xFE) {
-
-            count = bytestream2_get_le16(gb);
-            color = bytestream2_get_byte(gb);
-            av_dlog(NULL, "(2) set %X bytes to %02X\n", count, color);
-            CHECK_COUNT();
-            memset(&dest[dest_index], color, count);
-            dest_index += count;
-
-        } else if ((opcode & 0xC0) == 0xC0) {
-
-            count = (opcode & 0x3F) + 3;
-            src_pos = bytestream2_get_le16(gb);
-            av_dlog(NULL, "(3) copy %X bytes from absolute pos %X\n", count, src_pos);
-            CHECK_COUNT();
-            CHECK_COPY(src_pos);
-            for (i = 0; i < count; i++)
-                dest[dest_index + i] = dest[src_pos + i];
-            dest_index += count;
-
-        } else if (opcode > 0x80) {
-
-            count = opcode & 0x3F;
-            av_dlog(NULL, "(4) copy %X bytes from source to dest\n", count);
-            CHECK_COUNT();
-            bytestream2_get_buffer(gb, &dest[dest_index], count);
-            dest_index += count;
-
-        } else {
-
-            count = ((opcode & 0x70) >> 4) + 3;
-            src_pos = bytestream2_get_byte(gb) | ((opcode & 0x0F) << 8);
-            av_dlog(NULL, "(5) copy %X bytes from relpos %X\n", count, src_pos);
-            CHECK_COUNT();
-            CHECK_COPY(dest_index - src_pos);
-            for (i = 0; i < count; i++)
-                dest[dest_index + i] = dest[dest_index - src_pos + i];
-            dest_index += count;
-        }
-    }
-
-    /* validate that the entire destination buffer was filled; this is
-     * important for decoding frame maps since each vector needs to have a
-     * codebook entry; it is not important for compressed codebooks because
-     * not every entry needs to be filled */
-    if (check_size)
-        if (dest_index < dest_size)
-            av_log(NULL, AV_LOG_ERROR, "  VQA video: decode_format80 problem: decode finished with dest_index (%d) < dest_size (%d)\n",
-                dest_index, dest_size);
-
-    return 0; // let's display what we decoded anyway
-}
-
-static int vqa_decode_chunk(VqaContext *s, AVFrame *frame)
-{
-    unsigned int chunk_type;
-    unsigned int chunk_size;
-    int byte_skip;
-    unsigned int index = 0;
-    int i;
-    unsigned char r, g, b;
-    int index_shift;
-    int res;
-
-    int cbf0_chunk = -1;
-    int cbfz_chunk = -1;
-    int cbp0_chunk = -1;
-    int cbpz_chunk = -1;
-    int cpl0_chunk = -1;
-    int cplz_chunk = -1;
-    int vptz_chunk = -1;
-
-    int x, y;
-    int lines = 0;
-    int pixel_ptr;
-    int vector_index = 0;
-    int lobyte = 0;
-    int hibyte = 0;
-    int lobytes = 0;
-    int hibytes = s->decode_buffer_size / 2;
-
-    /* first, traverse through the frame and find the subchunks */
-    while (bytestream2_get_bytes_left(&s->gb) >= 8) {
-
-        chunk_type = bytestream2_get_be32u(&s->gb);
-        index      = bytestream2_tell(&s->gb);
-        chunk_size = bytestream2_get_be32u(&s->gb);
-
-        switch (chunk_type) {
-
-        case CBF0_TAG:
-            cbf0_chunk = index;
-            break;
-
-        case CBFZ_TAG:
-            cbfz_chunk = index;
-            break;
-
-        case CBP0_TAG:
-            cbp0_chunk = index;
-            break;
-
-        case CBPZ_TAG:
-            cbpz_chunk = index;
-            break;
-
-        case CPL0_TAG:
-            cpl0_chunk = index;
-            break;
-
-        case CPLZ_TAG:
-            cplz_chunk = index;
-            break;
-
-        case VPTZ_TAG:
-            vptz_chunk = index;
-            break;
-
-        default:
-            av_log(s->avctx, AV_LOG_ERROR, "  VQA video: Found unknown chunk type: %c%c%c%c (%08X)\n",
-            (chunk_type >> 24) & 0xFF,
-            (chunk_type >> 16) & 0xFF,
-            (chunk_type >>  8) & 0xFF,
-            (chunk_type >>  0) & 0xFF,
-            chunk_type);
-            break;
-        }
-
-        byte_skip = chunk_size & 0x01;
-        bytestream2_skip(&s->gb, chunk_size + byte_skip);
-    }
-
-    /* next, deal with the palette */
-    if ((cpl0_chunk != -1) && (cplz_chunk != -1)) {
-
-        /* a chunk should not have both chunk types */
-        av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: found both CPL0 and CPLZ chunks\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* decompress the palette chunk */
-    if (cplz_chunk != -1) {
-
-/* yet to be handled */
-
-    }
-
-    /* convert the RGB palette into the machine's endian format */
-    if (cpl0_chunk != -1) {
-
-        bytestream2_seek(&s->gb, cpl0_chunk, SEEK_SET);
-        chunk_size = bytestream2_get_be32(&s->gb);
-        /* sanity check the palette size */
-        if (chunk_size / 3 > 256 || chunk_size > bytestream2_get_bytes_left(&s->gb)) {
-            av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: found a palette chunk with %d colors\n",
-                chunk_size / 3);
-            return AVERROR_INVALIDDATA;
-        }
-        for (i = 0; i < chunk_size / 3; i++) {
-            /* scale by 4 to transform 6-bit palette -> 8-bit */
-            r = bytestream2_get_byteu(&s->gb) * 4;
-            g = bytestream2_get_byteu(&s->gb) * 4;
-            b = bytestream2_get_byteu(&s->gb) * 4;
-            s->palette[i] = (r << 16) | (g << 8) | (b);
-        }
-    }
-
-    /* next, look for a full codebook */
-    if ((cbf0_chunk != -1) && (cbfz_chunk != -1)) {
-
-        /* a chunk should not have both chunk types */
-        av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: found both CBF0 and CBFZ chunks\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* decompress the full codebook chunk */
-    if (cbfz_chunk != -1) {
-
-        bytestream2_seek(&s->gb, cbfz_chunk, SEEK_SET);
-        chunk_size = bytestream2_get_be32(&s->gb);
-        if ((res = decode_format80(&s->gb, chunk_size, s->codebook,
-                                   s->codebook_size, 0)) < 0)
-            return res;
-    }
-
-    /* copy a full codebook */
-    if (cbf0_chunk != -1) {
-
-        bytestream2_seek(&s->gb, cbf0_chunk, SEEK_SET);
-        chunk_size = bytestream2_get_be32(&s->gb);
-        /* sanity check the full codebook size */
-        if (chunk_size > MAX_CODEBOOK_SIZE) {
-            av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: CBF0 chunk too large (0x%X bytes)\n",
-                chunk_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        bytestream2_get_buffer(&s->gb, s->codebook, chunk_size);
-    }
-
-    /* decode the frame */
-    if (vptz_chunk == -1) {
-
-        /* something is wrong if there is no VPTZ chunk */
-        av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: no VPTZ chunk found\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    bytestream2_seek(&s->gb, vptz_chunk, SEEK_SET);
-    chunk_size = bytestream2_get_be32(&s->gb);
-    if ((res = decode_format80(&s->gb, chunk_size,
-                               s->decode_buffer, s->decode_buffer_size, 1)) < 0)
-        return res;
-
-    /* render the final PAL8 frame */
-    if (s->vector_height == 4)
-        index_shift = 4;
-    else
-        index_shift = 3;
-    for (y = 0; y < s->height; y += s->vector_height) {
-        for (x = 0; x < s->width; x += 4, lobytes++, hibytes++) {
-            pixel_ptr = y * frame->linesize[0] + x;
-
-            /* get the vector index, the method for which varies according to
-             * VQA file version */
-            switch (s->vqa_version) {
-
-            case 1:
-                lobyte = s->decode_buffer[lobytes * 2];
-                hibyte = s->decode_buffer[(lobytes * 2) + 1];
-                vector_index = ((hibyte << 8) | lobyte) >> 3;
-                vector_index <<= index_shift;
-                lines = s->vector_height;
-                /* uniform color fill - a quick hack */
-                if (hibyte == 0xFF) {
-                    while (lines--) {
-                        frame->data[0][pixel_ptr + 0] = 255 - lobyte;
-                        frame->data[0][pixel_ptr + 1] = 255 - lobyte;
-                        frame->data[0][pixel_ptr + 2] = 255 - lobyte;
-                        frame->data[0][pixel_ptr + 3] = 255 - lobyte;
-                        pixel_ptr += frame->linesize[0];
-                    }
-                    lines=0;
-                }
-                break;
-
-            case 2:
-                lobyte = s->decode_buffer[lobytes];
-                hibyte = s->decode_buffer[hibytes];
-                vector_index = (hibyte << 8) | lobyte;
-                vector_index <<= index_shift;
-                lines = s->vector_height;
-                break;
-
-            case 3:
-/* not implemented yet */
-                lines = 0;
-                break;
-            }
-
-            while (lines--) {
-                frame->data[0][pixel_ptr + 0] = s->codebook[vector_index++];
-                frame->data[0][pixel_ptr + 1] = s->codebook[vector_index++];
-                frame->data[0][pixel_ptr + 2] = s->codebook[vector_index++];
-                frame->data[0][pixel_ptr + 3] = s->codebook[vector_index++];
-                pixel_ptr += frame->linesize[0];
-            }
-        }
-    }
-
-    /* handle partial codebook */
-    if ((cbp0_chunk != -1) && (cbpz_chunk != -1)) {
-        /* a chunk should not have both chunk types */
-        av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: found both CBP0 and CBPZ chunks\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (cbp0_chunk != -1) {
-
-        bytestream2_seek(&s->gb, cbp0_chunk, SEEK_SET);
-        chunk_size = bytestream2_get_be32(&s->gb);
-
-        if (chunk_size > MAX_CODEBOOK_SIZE - s->next_codebook_buffer_index) {
-            av_log(s->avctx, AV_LOG_ERROR, "cbp0 chunk too large (%u bytes)\n",
-                   chunk_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        /* accumulate partial codebook */
-        bytestream2_get_buffer(&s->gb, &s->next_codebook_buffer[s->next_codebook_buffer_index],
-                               chunk_size);
-        s->next_codebook_buffer_index += chunk_size;
-
-        s->partial_countdown--;
-        if (s->partial_countdown == 0) {
-
-            /* time to replace codebook */
-            memcpy(s->codebook, s->next_codebook_buffer,
-                s->next_codebook_buffer_index);
-
-            /* reset accounting */
-            s->next_codebook_buffer_index = 0;
-            s->partial_countdown = s->partial_count;
-        }
-    }
-
-    if (cbpz_chunk != -1) {
-
-        bytestream2_seek(&s->gb, cbpz_chunk, SEEK_SET);
-        chunk_size = bytestream2_get_be32(&s->gb);
-
-        if (chunk_size > MAX_CODEBOOK_SIZE - s->next_codebook_buffer_index) {
-            av_log(s->avctx, AV_LOG_ERROR, "cbpz chunk too large (%u bytes)\n",
-                   chunk_size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        /* accumulate partial codebook */
-        bytestream2_get_buffer(&s->gb, &s->next_codebook_buffer[s->next_codebook_buffer_index],
-                               chunk_size);
-        s->next_codebook_buffer_index += chunk_size;
-
-        s->partial_countdown--;
-        if (s->partial_countdown == 0) {
-            GetByteContext gb;
-
-            bytestream2_init(&gb, s->next_codebook_buffer, s->next_codebook_buffer_index);
-            /* decompress codebook */
-            if ((res = decode_format80(&gb, s->next_codebook_buffer_index,
-                                       s->codebook, s->codebook_size, 0)) < 0)
-                return res;
-
-            /* reset accounting */
-            s->next_codebook_buffer_index = 0;
-            s->partial_countdown = s->partial_count;
-        }
-    }
-
-    return 0;
-}
-
-static int vqa_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    VqaContext *s = avctx->priv_data;
-    AVFrame *frame = data;
-    int res;
-
-    if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "  VQA Video: get_buffer() failed\n");
-        return res;
-    }
-
-    bytestream2_init(&s->gb, avpkt->data, avpkt->size);
-    if ((res = vqa_decode_chunk(s, frame)) < 0)
-        return res;
-
-    /* make the palette available on the way out */
-    memcpy(frame->data[1], s->palette, PALETTE_COUNT * 4);
-    frame->palette_has_changed = 1;
-
-    *got_frame      = 1;
-
-    /* report that the buffer was completely consumed */
-    return avpkt->size;
-}
-
-static av_cold int vqa_decode_end(AVCodecContext *avctx)
-{
-    VqaContext *s = avctx->priv_data;
-
-    av_freep(&s->codebook);
-    av_freep(&s->next_codebook_buffer);
-    av_freep(&s->decode_buffer);
-
-    return 0;
-}
-
-AVCodec ff_vqa_decoder = {
-    .name           = "vqavideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("Westwood Studios VQA (Vector Quantized Animation) video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WS_VQA,
-    .priv_data_size = sizeof(VqaContext),
-    .init           = vqa_decode_init,
-    .close          = vqa_decode_end,
-    .decode         = vqa_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/wavpack.c b/deps/libav/libavcodec/wavpack.c
deleted file mode 100644
index cbc5b04..0000000
--- a/deps/libav/libavcodec/wavpack.c
+++ /dev/null
@@ -1,1238 +0,0 @@
-/*
- * WavPack lossless audio decoder
- * Copyright (c) 2006,2011 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define BITSTREAM_READER_LE
-
-#include "libavutil/channel_layout.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "unary.h"
-#include "bytestream.h"
-
-/**
- * @file
- * WavPack lossless audio decoder
- */
-
-#define WV_HEADER_SIZE    32
-
-#define WV_MONO           0x00000004
-#define WV_JOINT_STEREO   0x00000010
-#define WV_FALSE_STEREO   0x40000000
-
-#define WV_HYBRID_MODE    0x00000008
-#define WV_HYBRID_SHAPE   0x00000008
-#define WV_HYBRID_BITRATE 0x00000200
-#define WV_HYBRID_BALANCE 0x00000400
-#define WV_INITIAL_BLOCK  0x00000800
-#define WV_FINAL_BLOCK    0x00001000
-
-#define WV_SINGLE_BLOCK (WV_INITIAL_BLOCK | WV_FINAL_BLOCK)
-
-#define WV_FLT_SHIFT_ONES 0x01
-#define WV_FLT_SHIFT_SAME 0x02
-#define WV_FLT_SHIFT_SENT 0x04
-#define WV_FLT_ZERO_SENT  0x08
-#define WV_FLT_ZERO_SIGN  0x10
-
-enum WP_ID_Flags {
-    WP_IDF_MASK   = 0x3F,
-    WP_IDF_IGNORE = 0x20,
-    WP_IDF_ODD    = 0x40,
-    WP_IDF_LONG   = 0x80
-};
-
-enum WP_ID {
-    WP_ID_DUMMY = 0,
-    WP_ID_ENCINFO,
-    WP_ID_DECTERMS,
-    WP_ID_DECWEIGHTS,
-    WP_ID_DECSAMPLES,
-    WP_ID_ENTROPY,
-    WP_ID_HYBRID,
-    WP_ID_SHAPING,
-    WP_ID_FLOATINFO,
-    WP_ID_INT32INFO,
-    WP_ID_DATA,
-    WP_ID_CORR,
-    WP_ID_EXTRABITS,
-    WP_ID_CHANINFO,
-    WP_ID_SAMPLE_RATE = 0x27,
-};
-
-typedef struct SavedContext {
-    int offset;
-    int size;
-    int bits_used;
-    uint32_t crc;
-} SavedContext;
-
-#define MAX_TERMS 16
-
-typedef struct Decorr {
-    int delta;
-    int value;
-    int weightA;
-    int weightB;
-    int samplesA[8];
-    int samplesB[8];
-} Decorr;
-
-typedef struct WvChannel {
-    int median[3];
-    int slow_level, error_limit;
-    int bitrate_acc, bitrate_delta;
-} WvChannel;
-
-typedef struct WavpackFrameContext {
-    AVCodecContext *avctx;
-    int frame_flags;
-    int stereo, stereo_in;
-    int joint;
-    uint32_t CRC;
-    GetBitContext gb;
-    int got_extra_bits;
-    uint32_t crc_extra_bits;
-    GetBitContext gb_extra_bits;
-    int data_size; // in bits
-    int samples;
-    int terms;
-    Decorr decorr[MAX_TERMS];
-    int zero, one, zeroes;
-    int extra_bits;
-    int and, or, shift;
-    int post_shift;
-    int hybrid, hybrid_bitrate;
-    int hybrid_maxclip, hybrid_minclip;
-    int float_flag;
-    int float_shift;
-    int float_max_exp;
-    WvChannel ch[2];
-    int pos;
-    SavedContext sc, extra_sc;
-} WavpackFrameContext;
-
-#define WV_MAX_FRAME_DECODERS 14
-
-typedef struct WavpackContext {
-    AVCodecContext *avctx;
-
-    WavpackFrameContext *fdec[WV_MAX_FRAME_DECODERS];
-    int fdec_num;
-
-    int block;
-    int samples;
-    int ch_offset;
-} WavpackContext;
-
-static const int wv_rates[16] = {
-     6000,  8000,  9600, 11025, 12000, 16000,  22050, 24000,
-    32000, 44100, 48000, 64000, 88200, 96000, 192000,     0
-};
-
-// exponent table copied from WavPack source
-static const uint8_t wp_exp2_table[256] = {
-    0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 0x08, 0x08, 0x09, 0x0a, 0x0b,
-    0x0b, 0x0c, 0x0d, 0x0e, 0x0e, 0x0f, 0x10, 0x10, 0x11, 0x12, 0x13, 0x13, 0x14, 0x15, 0x16, 0x16,
-    0x17, 0x18, 0x19, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1d, 0x1e, 0x1f, 0x20, 0x20, 0x21, 0x22, 0x23,
-    0x24, 0x24, 0x25, 0x26, 0x27, 0x28, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
-    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3a, 0x3b, 0x3c, 0x3d,
-    0x3e, 0x3f, 0x40, 0x41, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x48, 0x49, 0x4a, 0x4b,
-    0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a,
-    0x5b, 0x5c, 0x5d, 0x5e, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
-    0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
-    0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x87, 0x88, 0x89, 0x8a,
-    0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b,
-    0x9c, 0x9d, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad,
-    0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0,
-    0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc8, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf, 0xd0, 0xd2, 0xd3, 0xd4,
-    0xd6, 0xd7, 0xd8, 0xd9, 0xdb, 0xdc, 0xdd, 0xde, 0xe0, 0xe1, 0xe2, 0xe4, 0xe5, 0xe6, 0xe8, 0xe9,
-    0xea, 0xec, 0xed, 0xee, 0xf0, 0xf1, 0xf2, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfc, 0xfd, 0xff
-};
-
-static const uint8_t wp_log2_table [] = {
-    0x00, 0x01, 0x03, 0x04, 0x06, 0x07, 0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x10, 0x11, 0x12, 0x14, 0x15,
-    0x16, 0x18, 0x19, 0x1a, 0x1c, 0x1d, 0x1e, 0x20, 0x21, 0x22, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2a,
-    0x2c, 0x2d, 0x2e, 0x2f, 0x31, 0x32, 0x33, 0x34, 0x36, 0x37, 0x38, 0x39, 0x3b, 0x3c, 0x3d, 0x3e,
-    0x3f, 0x41, 0x42, 0x43, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4d, 0x4e, 0x4f, 0x50, 0x51,
-    0x52, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63,
-    0x64, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x74, 0x75,
-    0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
-    0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95,
-    0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4,
-    0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb2,
-    0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc0,
-    0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcb, 0xcc, 0xcd, 0xce,
-    0xcf, 0xd0, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd8, 0xd9, 0xda, 0xdb,
-    0xdc, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe4, 0xe5, 0xe6, 0xe7, 0xe7,
-    0xe8, 0xe9, 0xea, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xee, 0xef, 0xf0, 0xf1, 0xf1, 0xf2, 0xf3, 0xf4,
-    0xf4, 0xf5, 0xf6, 0xf7, 0xf7, 0xf8, 0xf9, 0xf9, 0xfa, 0xfb, 0xfc, 0xfc, 0xfd, 0xfe, 0xff, 0xff
-};
-
-static av_always_inline int wp_exp2(int16_t val)
-{
-    int res, neg = 0;
-
-    if (val < 0) {
-        val = -val;
-        neg = 1;
-    }
-
-    res   = wp_exp2_table[val & 0xFF] | 0x100;
-    val >>= 8;
-    res   = (val > 9) ? (res << (val - 9)) : (res >> (9 - val));
-    return neg ? -res : res;
-}
-
-static av_always_inline int wp_log2(int32_t val)
-{
-    int bits;
-
-    if (!val)
-        return 0;
-    if (val == 1)
-        return 256;
-    val += val >> 9;
-    bits = av_log2(val) + 1;
-    if (bits < 9)
-        return (bits << 8) + wp_log2_table[(val << (9 - bits)) & 0xFF];
-    else
-        return (bits << 8) + wp_log2_table[(val >> (bits - 9)) & 0xFF];
-}
-
-#define LEVEL_DECAY(a)  ((a + 0x80) >> 8)
-
-// macros for manipulating median values
-#define GET_MED(n) ((c->median[n] >> 4) + 1)
-#define DEC_MED(n) c->median[n] -= ((c->median[n] + (128 >> n) - 2) / (128 >> n)) * 2
-#define INC_MED(n) c->median[n] += ((c->median[n] + (128 >> n)    ) / (128 >> n)) * 5
-
-// macros for applying weight
-#define UPDATE_WEIGHT_CLIP(weight, delta, samples, in) \
-    if (samples && in) { \
-        if ((samples ^ in) < 0) { \
-            weight -= delta; \
-            if (weight < -1024) \
-                weight = -1024; \
-        } else { \
-            weight += delta; \
-            if (weight > 1024) \
-                weight = 1024; \
-        } \
-    }
-
-static av_always_inline int get_tail(GetBitContext *gb, int k)
-{
-    int p, e, res;
-
-    if (k < 1)
-        return 0;
-    p   = av_log2(k);
-    e   = (1 << (p + 1)) - k - 1;
-    res = p ? get_bits(gb, p) : 0;
-    if (res >= e)
-        res = (res << 1) - e + get_bits1(gb);
-    return res;
-}
-
-static void update_error_limit(WavpackFrameContext *ctx)
-{
-    int i, br[2], sl[2];
-
-    for (i = 0; i <= ctx->stereo_in; i++) {
-        ctx->ch[i].bitrate_acc += ctx->ch[i].bitrate_delta;
-        br[i]                   = ctx->ch[i].bitrate_acc >> 16;
-        sl[i]                   = LEVEL_DECAY(ctx->ch[i].slow_level);
-    }
-    if (ctx->stereo_in && ctx->hybrid_bitrate) {
-        int balance = (sl[1] - sl[0] + br[1] + 1) >> 1;
-        if (balance > br[0]) {
-            br[1] = br[0] << 1;
-            br[0] = 0;
-        } else if (-balance > br[0]) {
-            br[0] <<= 1;
-            br[1]   = 0;
-        } else {
-            br[1] = br[0] + balance;
-            br[0] = br[0] - balance;
-        }
-    }
-    for (i = 0; i <= ctx->stereo_in; i++) {
-        if (ctx->hybrid_bitrate) {
-            if (sl[i] - br[i] > -0x100)
-                ctx->ch[i].error_limit = wp_exp2(sl[i] - br[i] + 0x100);
-            else
-                ctx->ch[i].error_limit = 0;
-        } else {
-            ctx->ch[i].error_limit = wp_exp2(br[i]);
-        }
-    }
-}
-
-static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
-                        int channel, int *last)
-{
-    int t, t2;
-    int sign, base, add, ret;
-    WvChannel *c = &ctx->ch[channel];
-
-    *last = 0;
-
-    if ((ctx->ch[0].median[0] < 2U) && (ctx->ch[1].median[0] < 2U) &&
-        !ctx->zero && !ctx->one) {
-        if (ctx->zeroes) {
-            ctx->zeroes--;
-            if (ctx->zeroes) {
-                c->slow_level -= LEVEL_DECAY(c->slow_level);
-                return 0;
-            }
-        } else {
-            t = get_unary_0_33(gb);
-            if (t >= 2) {
-                if (get_bits_left(gb) < t - 1)
-                    goto error;
-                t = get_bits(gb, t - 1) | (1 << (t - 1));
-            } else {
-                if (get_bits_left(gb) < 0)
-                    goto error;
-            }
-            ctx->zeroes = t;
-            if (ctx->zeroes) {
-                memset(ctx->ch[0].median, 0, sizeof(ctx->ch[0].median));
-                memset(ctx->ch[1].median, 0, sizeof(ctx->ch[1].median));
-                c->slow_level -= LEVEL_DECAY(c->slow_level);
-                return 0;
-            }
-        }
-    }
-
-    if (ctx->zero) {
-        t         = 0;
-        ctx->zero = 0;
-    } else {
-        t = get_unary_0_33(gb);
-        if (get_bits_left(gb) < 0)
-            goto error;
-        if (t == 16) {
-            t2 = get_unary_0_33(gb);
-            if (t2 < 2) {
-                if (get_bits_left(gb) < 0)
-                    goto error;
-                t += t2;
-            } else {
-                if (get_bits_left(gb) < t2 - 1)
-                    goto error;
-                t += get_bits(gb, t2 - 1) | (1 << (t2 - 1));
-            }
-        }
-
-        if (ctx->one) {
-            ctx->one = t & 1;
-            t        = (t >> 1) + 1;
-        } else {
-            ctx->one = t & 1;
-            t      >>= 1;
-        }
-        ctx->zero = !ctx->one;
-    }
-
-    if (ctx->hybrid && !channel)
-        update_error_limit(ctx);
-
-    if (!t) {
-        base = 0;
-        add  = GET_MED(0) - 1;
-        DEC_MED(0);
-    } else if (t == 1) {
-        base = GET_MED(0);
-        add  = GET_MED(1) - 1;
-        INC_MED(0);
-        DEC_MED(1);
-    } else if (t == 2) {
-        base = GET_MED(0) + GET_MED(1);
-        add  = GET_MED(2) - 1;
-        INC_MED(0);
-        INC_MED(1);
-        DEC_MED(2);
-    } else {
-        base = GET_MED(0) + GET_MED(1) + GET_MED(2) * (t - 2);
-        add  = GET_MED(2) - 1;
-        INC_MED(0);
-        INC_MED(1);
-        INC_MED(2);
-    }
-    if (!c->error_limit) {
-        ret = base + get_tail(gb, add);
-        if (get_bits_left(gb) <= 0)
-            goto error;
-    } else {
-        int mid = (base * 2 + add + 1) >> 1;
-        while (add > c->error_limit) {
-            if (get_bits_left(gb) <= 0)
-                goto error;
-            if (get_bits1(gb)) {
-                add -= (mid - base);
-                base = mid;
-            } else
-                add = mid - base - 1;
-            mid = (base * 2 + add + 1) >> 1;
-        }
-        ret = mid;
-    }
-    sign = get_bits1(gb);
-    if (ctx->hybrid_bitrate)
-        c->slow_level += wp_log2(ret) - LEVEL_DECAY(c->slow_level);
-    return sign ? ~ret : ret;
-
-error:
-    *last = 1;
-    return 0;
-}
-
-static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc,
-                                       int S)
-{
-    int bit;
-
-    if (s->extra_bits) {
-        S <<= s->extra_bits;
-
-        if (s->got_extra_bits &&
-            get_bits_left(&s->gb_extra_bits) >= s->extra_bits) {
-            S   |= get_bits(&s->gb_extra_bits, s->extra_bits);
-            *crc = *crc * 9 + (S & 0xffff) * 3 + ((unsigned)S >> 16);
-        }
-    }
-
-    bit = (S & s->and) | s->or;
-    bit = ((S + bit) << s->shift) - bit;
-
-    if (s->hybrid)
-        bit = av_clip(bit, s->hybrid_minclip, s->hybrid_maxclip);
-
-    return bit << s->post_shift;
-}
-
-static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S)
-{
-    union {
-        float    f;
-        uint32_t u;
-    } value;
-
-    unsigned int sign;
-    int exp = s->float_max_exp;
-
-    if (s->got_extra_bits) {
-        const int max_bits  = 1 + 23 + 8 + 1;
-        const int left_bits = get_bits_left(&s->gb_extra_bits);
-
-        if (left_bits + 8 * FF_INPUT_BUFFER_PADDING_SIZE < max_bits)
-            return 0.0;
-    }
-
-    if (S) {
-        S  <<= s->float_shift;
-        sign = S < 0;
-        if (sign)
-            S = -S;
-        if (S >= 0x1000000) {
-            if (s->got_extra_bits && get_bits1(&s->gb_extra_bits))
-                S = get_bits(&s->gb_extra_bits, 23);
-            else
-                S = 0;
-            exp = 255;
-        } else if (exp) {
-            int shift = 23 - av_log2(S);
-            exp = s->float_max_exp;
-            if (exp <= shift)
-                shift = --exp;
-            exp -= shift;
-
-            if (shift) {
-                S <<= shift;
-                if ((s->float_flag & WV_FLT_SHIFT_ONES) ||
-                    (s->got_extra_bits &&
-                     (s->float_flag & WV_FLT_SHIFT_SAME) &&
-                     get_bits1(&s->gb_extra_bits))) {
-                    S |= (1 << shift) - 1;
-                } else if (s->got_extra_bits &&
-                           (s->float_flag & WV_FLT_SHIFT_SENT)) {
-                    S |= get_bits(&s->gb_extra_bits, shift);
-                }
-            }
-        } else {
-            exp = s->float_max_exp;
-        }
-        S &= 0x7fffff;
-    } else {
-        sign = 0;
-        exp  = 0;
-        if (s->got_extra_bits && (s->float_flag & WV_FLT_ZERO_SENT)) {
-            if (get_bits1(&s->gb_extra_bits)) {
-                S = get_bits(&s->gb_extra_bits, 23);
-                if (s->float_max_exp >= 25)
-                    exp = get_bits(&s->gb_extra_bits, 8);
-                sign = get_bits1(&s->gb_extra_bits);
-            } else {
-                if (s->float_flag & WV_FLT_ZERO_SIGN)
-                    sign = get_bits1(&s->gb_extra_bits);
-            }
-        }
-    }
-
-    *crc = *crc * 27 + S * 9 + exp * 3 + sign;
-
-    value.u = (sign << 31) | (exp << 23) | S;
-    return value.f;
-}
-
-static void wv_reset_saved_context(WavpackFrameContext *s)
-{
-    s->pos    = 0;
-    s->sc.crc = s->extra_sc.crc = 0xFFFFFFFF;
-}
-
-static inline int wv_check_crc(WavpackFrameContext *s, uint32_t crc,
-                               uint32_t crc_extra_bits)
-{
-    if (crc != s->CRC) {
-        av_log(s->avctx, AV_LOG_ERROR, "CRC error\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (s->got_extra_bits && crc_extra_bits != s->crc_extra_bits) {
-        av_log(s->avctx, AV_LOG_ERROR, "Extra bits CRC error\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb,
-                                   void *dst_l, void *dst_r, const int type)
-{
-    int i, j, count = 0;
-    int last, t;
-    int A, B, L, L2, R, R2;
-    int pos                 = s->pos;
-    uint32_t crc            = s->sc.crc;
-    uint32_t crc_extra_bits = s->extra_sc.crc;
-    int16_t *dst16_l        = dst_l;
-    int16_t *dst16_r        = dst_r;
-    int32_t *dst32_l        = dst_l;
-    int32_t *dst32_r        = dst_r;
-    float *dstfl_l          = dst_l;
-    float *dstfl_r          = dst_r;
-
-    s->one = s->zero = s->zeroes = 0;
-    do {
-        L = wv_get_value(s, gb, 0, &last);
-        if (last)
-            break;
-        R = wv_get_value(s, gb, 1, &last);
-        if (last)
-            break;
-        for (i = 0; i < s->terms; i++) {
-            t = s->decorr[i].value;
-            if (t > 0) {
-                if (t > 8) {
-                    if (t & 1) {
-                        A = 2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];
-                        B = 2 * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1];
-                    } else {
-                        A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;
-                        B = (3 * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]) >> 1;
-                    }
-                    s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];
-                    s->decorr[i].samplesB[1] = s->decorr[i].samplesB[0];
-                    j                        = 0;
-                } else {
-                    A = s->decorr[i].samplesA[pos];
-                    B = s->decorr[i].samplesB[pos];
-                    j = (pos + t) & 7;
-                }
-                if (type != AV_SAMPLE_FMT_S16P) {
-                    L2 = L + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10);
-                    R2 = R + ((s->decorr[i].weightB * (int64_t)B + 512) >> 10);
-                } else {
-                    L2 = L + ((s->decorr[i].weightA * A + 512) >> 10);
-                    R2 = R + ((s->decorr[i].weightB * B + 512) >> 10);
-                }
-                if (A && L)
-                    s->decorr[i].weightA -= ((((L ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;
-                if (B && R)
-                    s->decorr[i].weightB -= ((((R ^ B) >> 30) & 2) - 1) * s->decorr[i].delta;
-                s->decorr[i].samplesA[j] = L = L2;
-                s->decorr[i].samplesB[j] = R = R2;
-            } else if (t == -1) {
-                if (type != AV_SAMPLE_FMT_S16P)
-                    L2 = L + ((s->decorr[i].weightA * (int64_t)s->decorr[i].samplesA[0] + 512) >> 10);
-                else
-                    L2 = L + ((s->decorr[i].weightA * s->decorr[i].samplesA[0] + 512) >> 10);
-                UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, s->decorr[i].samplesA[0], L);
-                L = L2;
-                if (type != AV_SAMPLE_FMT_S16P)
-                    R2 = R + ((s->decorr[i].weightB * (int64_t)L2 + 512) >> 10);
-                else
-                    R2 = R + ((s->decorr[i].weightB * L2 + 512) >> 10);
-                UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, L2, R);
-                R                        = R2;
-                s->decorr[i].samplesA[0] = R;
-            } else {
-                if (type != AV_SAMPLE_FMT_S16P)
-                    R2 = R + ((s->decorr[i].weightB * (int64_t)s->decorr[i].samplesB[0] + 512) >> 10);
-                else
-                    R2 = R + ((s->decorr[i].weightB * s->decorr[i].samplesB[0] + 512) >> 10);
-                UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, s->decorr[i].samplesB[0], R);
-                R = R2;
-
-                if (t == -3) {
-                    R2                       = s->decorr[i].samplesA[0];
-                    s->decorr[i].samplesA[0] = R;
-                }
-
-                if (type != AV_SAMPLE_FMT_S16P)
-                    L2 = L + ((s->decorr[i].weightA * (int64_t)R2 + 512) >> 10);
-                else
-                    L2 = L + ((s->decorr[i].weightA * R2 + 512) >> 10);
-                UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, R2, L);
-                L                        = L2;
-                s->decorr[i].samplesB[0] = L;
-            }
-        }
-        pos = (pos + 1) & 7;
-        if (s->joint)
-            L += (R -= (L >> 1));
-        crc = (crc * 3 + L) * 3 + R;
-
-        if (type == AV_SAMPLE_FMT_FLTP) {
-            *dstfl_l++ = wv_get_value_float(s, &crc_extra_bits, L);
-            *dstfl_r++ = wv_get_value_float(s, &crc_extra_bits, R);
-        } else if (type == AV_SAMPLE_FMT_S32P) {
-            *dst32_l++ = wv_get_value_integer(s, &crc_extra_bits, L);
-            *dst32_r++ = wv_get_value_integer(s, &crc_extra_bits, R);
-        } else {
-            *dst16_l++ = wv_get_value_integer(s, &crc_extra_bits, L);
-            *dst16_r++ = wv_get_value_integer(s, &crc_extra_bits, R);
-        }
-        count++;
-    } while (!last && count < s->samples);
-
-    wv_reset_saved_context(s);
-    if ((s->avctx->err_recognition & AV_EF_CRCCHECK) &&
-        wv_check_crc(s, crc, crc_extra_bits))
-        return AVERROR_INVALIDDATA;
-
-    return 0;
-}
-
-static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb,
-                                 void *dst, const int type)
-{
-    int i, j, count = 0;
-    int last, t;
-    int A, S, T;
-    int pos                  = s->pos;
-    uint32_t crc             = s->sc.crc;
-    uint32_t crc_extra_bits  = s->extra_sc.crc;
-    int16_t *dst16           = dst;
-    int32_t *dst32           = dst;
-    float *dstfl             = dst;
-
-    s->one = s->zero = s->zeroes = 0;
-    do {
-        T = wv_get_value(s, gb, 0, &last);
-        S = 0;
-        if (last)
-            break;
-        for (i = 0; i < s->terms; i++) {
-            t = s->decorr[i].value;
-            if (t > 8) {
-                if (t & 1)
-                    A =  2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];
-                else
-                    A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;
-                s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];
-                j                        = 0;
-            } else {
-                A = s->decorr[i].samplesA[pos];
-                j = (pos + t) & 7;
-            }
-            if (type != AV_SAMPLE_FMT_S16P)
-                S = T + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10);
-            else
-                S = T + ((s->decorr[i].weightA * A + 512) >> 10);
-            if (A && T)
-                s->decorr[i].weightA -= ((((T ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;
-            s->decorr[i].samplesA[j] = T = S;
-        }
-        pos = (pos + 1) & 7;
-        crc = crc * 3 + S;
-
-        if (type == AV_SAMPLE_FMT_FLTP) {
-            *dstfl++ = wv_get_value_float(s, &crc_extra_bits, S);
-        } else if (type == AV_SAMPLE_FMT_S32P) {
-            *dst32++ = wv_get_value_integer(s, &crc_extra_bits, S);
-        } else {
-            *dst16++ = wv_get_value_integer(s, &crc_extra_bits, S);
-        }
-        count++;
-    } while (!last && count < s->samples);
-
-    wv_reset_saved_context(s);
-    if (s->avctx->err_recognition & AV_EF_CRCCHECK) {
-        int ret = wv_check_crc(s, crc, crc_extra_bits);
-        if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE)
-            return ret;
-    }
-
-    return 0;
-}
-
-static av_cold int wv_alloc_frame_context(WavpackContext *c)
-{
-    if (c->fdec_num == WV_MAX_FRAME_DECODERS)
-        return -1;
-
-    c->fdec[c->fdec_num] = av_mallocz(sizeof(**c->fdec));
-    if (!c->fdec[c->fdec_num])
-        return -1;
-    c->fdec_num++;
-    c->fdec[c->fdec_num - 1]->avctx = c->avctx;
-    wv_reset_saved_context(c->fdec[c->fdec_num - 1]);
-
-    return 0;
-}
-
-static av_cold int wavpack_decode_init(AVCodecContext *avctx)
-{
-    WavpackContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    s->fdec_num = 0;
-
-    return 0;
-}
-
-static av_cold int wavpack_decode_end(AVCodecContext *avctx)
-{
-    WavpackContext *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < s->fdec_num; i++)
-        av_freep(&s->fdec[i]);
-    s->fdec_num = 0;
-
-    return 0;
-}
-
-static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
-                                AVFrame *frame, const uint8_t *buf, int buf_size)
-{
-    WavpackContext *wc = avctx->priv_data;
-    WavpackFrameContext *s;
-    GetByteContext gb;
-    void *samples_l, *samples_r;
-    int ret;
-    int got_terms   = 0, got_weights = 0, got_samples = 0,
-        got_entropy = 0, got_bs      = 0, got_float   = 0, got_hybrid = 0;
-    int i, j, id, size, ssize, weights, t;
-    int bpp, chan = 0, chmask = 0, orig_bpp, sample_rate = 0;
-    int multiblock;
-
-    if (block_no >= wc->fdec_num && wv_alloc_frame_context(wc) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error creating frame decode context\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s = wc->fdec[block_no];
-    if (!s) {
-        av_log(avctx, AV_LOG_ERROR, "Context for block %d is not present\n",
-               block_no);
-        return AVERROR_INVALIDDATA;
-    }
-
-    memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr));
-    memset(s->ch, 0, sizeof(s->ch));
-    s->extra_bits     = 0;
-    s->and            = s->or = s->shift = 0;
-    s->got_extra_bits = 0;
-
-    bytestream2_init(&gb, buf, buf_size);
-
-    s->samples = bytestream2_get_le32(&gb);
-    if (s->samples != wc->samples) {
-        av_log(avctx, AV_LOG_ERROR, "Mismatching number of samples in "
-               "a sequence: %d and %d\n", wc->samples, s->samples);
-        return AVERROR_INVALIDDATA;
-    }
-    s->frame_flags = bytestream2_get_le32(&gb);
-    bpp            = av_get_bytes_per_sample(avctx->sample_fmt);
-    orig_bpp       = ((s->frame_flags & 0x03) + 1) << 3;
-    multiblock     = (s->frame_flags & WV_SINGLE_BLOCK) != WV_SINGLE_BLOCK;
-
-    s->stereo         = !(s->frame_flags & WV_MONO);
-    s->stereo_in      =  (s->frame_flags & WV_FALSE_STEREO) ? 0 : s->stereo;
-    s->joint          =   s->frame_flags & WV_JOINT_STEREO;
-    s->hybrid         =   s->frame_flags & WV_HYBRID_MODE;
-    s->hybrid_bitrate =   s->frame_flags & WV_HYBRID_BITRATE;
-    s->post_shift     = bpp * 8 - orig_bpp + ((s->frame_flags >> 13) & 0x1f);
-    s->hybrid_maxclip =  ((1LL << (orig_bpp - 1)) - 1);
-    s->hybrid_minclip = ((-1LL << (orig_bpp - 1)));
-    s->CRC            = bytestream2_get_le32(&gb);
-
-    // parse metadata blocks
-    while (bytestream2_get_bytes_left(&gb)) {
-        id   = bytestream2_get_byte(&gb);
-        size = bytestream2_get_byte(&gb);
-        if (id & WP_IDF_LONG) {
-            size |= (bytestream2_get_byte(&gb)) << 8;
-            size |= (bytestream2_get_byte(&gb)) << 16;
-        }
-        size <<= 1; // size is specified in words
-        ssize  = size;
-        if (id & WP_IDF_ODD)
-            size--;
-        if (size < 0) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Got incorrect block %02X with size %i\n", id, size);
-            break;
-        }
-        if (bytestream2_get_bytes_left(&gb) < ssize) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Block size %i is out of bounds\n", size);
-            break;
-        }
-        switch (id & WP_IDF_MASK) {
-        case WP_ID_DECTERMS:
-            if (size > MAX_TERMS) {
-                av_log(avctx, AV_LOG_ERROR, "Too many decorrelation terms\n");
-                s->terms = 0;
-                bytestream2_skip(&gb, ssize);
-                continue;
-            }
-            s->terms = size;
-            for (i = 0; i < s->terms; i++) {
-                uint8_t val = bytestream2_get_byte(&gb);
-                s->decorr[s->terms - i - 1].value = (val & 0x1F) - 5;
-                s->decorr[s->terms - i - 1].delta =  val >> 5;
-            }
-            got_terms = 1;
-            break;
-        case WP_ID_DECWEIGHTS:
-            if (!got_terms) {
-                av_log(avctx, AV_LOG_ERROR, "No decorrelation terms met\n");
-                continue;
-            }
-            weights = size >> s->stereo_in;
-            if (weights > MAX_TERMS || weights > s->terms) {
-                av_log(avctx, AV_LOG_ERROR, "Too many decorrelation weights\n");
-                bytestream2_skip(&gb, ssize);
-                continue;
-            }
-            for (i = 0; i < weights; i++) {
-                t = (int8_t)bytestream2_get_byte(&gb);
-                s->decorr[s->terms - i - 1].weightA = t << 3;
-                if (s->decorr[s->terms - i - 1].weightA > 0)
-                    s->decorr[s->terms - i - 1].weightA +=
-                        (s->decorr[s->terms - i - 1].weightA + 64) >> 7;
-                if (s->stereo_in) {
-                    t = (int8_t)bytestream2_get_byte(&gb);
-                    s->decorr[s->terms - i - 1].weightB = t << 3;
-                    if (s->decorr[s->terms - i - 1].weightB > 0)
-                        s->decorr[s->terms - i - 1].weightB +=
-                            (s->decorr[s->terms - i - 1].weightB + 64) >> 7;
-                }
-            }
-            got_weights = 1;
-            break;
-        case WP_ID_DECSAMPLES:
-            if (!got_terms) {
-                av_log(avctx, AV_LOG_ERROR, "No decorrelation terms met\n");
-                continue;
-            }
-            t = 0;
-            for (i = s->terms - 1; (i >= 0) && (t < size); i--) {
-                if (s->decorr[i].value > 8) {
-                    s->decorr[i].samplesA[0] =
-                        wp_exp2(bytestream2_get_le16(&gb));
-                    s->decorr[i].samplesA[1] =
-                        wp_exp2(bytestream2_get_le16(&gb));
-
-                    if (s->stereo_in) {
-                        s->decorr[i].samplesB[0] =
-                            wp_exp2(bytestream2_get_le16(&gb));
-                        s->decorr[i].samplesB[1] =
-                            wp_exp2(bytestream2_get_le16(&gb));
-                        t                       += 4;
-                    }
-                    t += 4;
-                } else if (s->decorr[i].value < 0) {
-                    s->decorr[i].samplesA[0] =
-                        wp_exp2(bytestream2_get_le16(&gb));
-                    s->decorr[i].samplesB[0] =
-                        wp_exp2(bytestream2_get_le16(&gb));
-                    t                       += 4;
-                } else {
-                    for (j = 0; j < s->decorr[i].value; j++) {
-                        s->decorr[i].samplesA[j] =
-                            wp_exp2(bytestream2_get_le16(&gb));
-                        if (s->stereo_in) {
-                            s->decorr[i].samplesB[j] =
-                                wp_exp2(bytestream2_get_le16(&gb));
-                        }
-                    }
-                    t += s->decorr[i].value * 2 * (s->stereo_in + 1);
-                }
-            }
-            got_samples = 1;
-            break;
-        case WP_ID_ENTROPY:
-            if (size != 6 * (s->stereo_in + 1)) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Entropy vars size should be %i, got %i",
-                       6 * (s->stereo_in + 1), size);
-                bytestream2_skip(&gb, ssize);
-                continue;
-            }
-            for (j = 0; j <= s->stereo_in; j++)
-                for (i = 0; i < 3; i++) {
-                    s->ch[j].median[i] = wp_exp2(bytestream2_get_le16(&gb));
-                }
-            got_entropy = 1;
-            break;
-        case WP_ID_HYBRID:
-            if (s->hybrid_bitrate) {
-                for (i = 0; i <= s->stereo_in; i++) {
-                    s->ch[i].slow_level = wp_exp2(bytestream2_get_le16(&gb));
-                    size               -= 2;
-                }
-            }
-            for (i = 0; i < (s->stereo_in + 1); i++) {
-                s->ch[i].bitrate_acc = bytestream2_get_le16(&gb) << 16;
-                size                -= 2;
-            }
-            if (size > 0) {
-                for (i = 0; i < (s->stereo_in + 1); i++) {
-                    s->ch[i].bitrate_delta =
-                        wp_exp2((int16_t)bytestream2_get_le16(&gb));
-                }
-            } else {
-                for (i = 0; i < (s->stereo_in + 1); i++)
-                    s->ch[i].bitrate_delta = 0;
-            }
-            got_hybrid = 1;
-            break;
-        case WP_ID_INT32INFO: {
-            uint8_t val[4];
-            if (size != 4) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Invalid INT32INFO, size = %i\n",
-                       size);
-                bytestream2_skip(&gb, ssize - 4);
-                continue;
-            }
-            bytestream2_get_buffer(&gb, val, 4);
-            if (val[0]) {
-                s->extra_bits = val[0];
-            } else if (val[1]) {
-                s->shift = val[1];
-            } else if (val[2]) {
-                s->and   = s->or = 1;
-                s->shift = val[2];
-            } else if (val[3]) {
-                s->and   = 1;
-                s->shift = val[3];
-            }
-            /* original WavPack decoder forces 32-bit lossy sound to be treated
-             * as 24-bit one in order to have proper clipping */
-            if (s->hybrid && bpp == 4 && s->post_shift < 8 && s->shift > 8) {
-                s->post_shift      += 8;
-                s->shift           -= 8;
-                s->hybrid_maxclip >>= 8;
-                s->hybrid_minclip >>= 8;
-            }
-            break;
-        }
-        case WP_ID_FLOATINFO:
-            if (size != 4) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Invalid FLOATINFO, size = %i\n", size);
-                bytestream2_skip(&gb, ssize);
-                continue;
-            }
-            s->float_flag    = bytestream2_get_byte(&gb);
-            s->float_shift   = bytestream2_get_byte(&gb);
-            s->float_max_exp = bytestream2_get_byte(&gb);
-            got_float        = 1;
-            bytestream2_skip(&gb, 1);
-            break;
-        case WP_ID_DATA:
-            s->sc.offset = bytestream2_tell(&gb);
-            s->sc.size   = size * 8;
-            init_get_bits(&s->gb, gb.buffer, size * 8);
-            s->data_size = size * 8;
-            bytestream2_skip(&gb, size);
-            got_bs       = 1;
-            break;
-        case WP_ID_EXTRABITS:
-            if (size <= 4) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid EXTRABITS, size = %i\n",
-                       size);
-                bytestream2_skip(&gb, size);
-                continue;
-            }
-            s->extra_sc.offset = bytestream2_tell(&gb);
-            s->extra_sc.size   = size * 8;
-            init_get_bits(&s->gb_extra_bits, gb.buffer, size * 8);
-            s->crc_extra_bits  = get_bits_long(&s->gb_extra_bits, 32);
-            bytestream2_skip(&gb, size);
-            s->got_extra_bits  = 1;
-            break;
-        case WP_ID_CHANINFO:
-            if (size <= 1) {
-                av_log(avctx, AV_LOG_ERROR,
-                       "Insufficient channel information\n");
-                return AVERROR_INVALIDDATA;
-            }
-            chan = bytestream2_get_byte(&gb);
-            switch (size - 2) {
-            case 0:
-                chmask = bytestream2_get_byte(&gb);
-                break;
-            case 1:
-                chmask = bytestream2_get_le16(&gb);
-                break;
-            case 2:
-                chmask = bytestream2_get_le24(&gb);
-                break;
-            case 3:
-                chmask = bytestream2_get_le32(&gb);;
-                break;
-            case 5:
-                bytestream2_skip(&gb, 1);
-                chan  |= (bytestream2_get_byte(&gb) & 0xF) << 8;
-                chmask = bytestream2_get_le16(&gb);
-                break;
-            default:
-                av_log(avctx, AV_LOG_ERROR, "Invalid channel info size %d\n",
-                       size);
-                chan   = avctx->channels;
-                chmask = avctx->channel_layout;
-            }
-            break;
-        case WP_ID_SAMPLE_RATE:
-            if (size != 3) {
-                av_log(avctx, AV_LOG_ERROR, "Invalid custom sample rate.\n");
-                return AVERROR_INVALIDDATA;
-            }
-            sample_rate = bytestream2_get_le24(&gb);
-            break;
-        default:
-            bytestream2_skip(&gb, size);
-        }
-        if (id & WP_IDF_ODD)
-            bytestream2_skip(&gb, 1);
-    }
-
-    if (!got_terms) {
-        av_log(avctx, AV_LOG_ERROR, "No block with decorrelation terms\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (!got_weights) {
-        av_log(avctx, AV_LOG_ERROR, "No block with decorrelation weights\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (!got_samples) {
-        av_log(avctx, AV_LOG_ERROR, "No block with decorrelation samples\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (!got_entropy) {
-        av_log(avctx, AV_LOG_ERROR, "No block with entropy info\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (s->hybrid && !got_hybrid) {
-        av_log(avctx, AV_LOG_ERROR, "Hybrid config not found\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (!got_bs) {
-        av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (!got_float && avctx->sample_fmt == AV_SAMPLE_FMT_FLTP) {
-        av_log(avctx, AV_LOG_ERROR, "Float information not found\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (s->got_extra_bits && avctx->sample_fmt != AV_SAMPLE_FMT_FLTP) {
-        const int size   = get_bits_left(&s->gb_extra_bits);
-        const int wanted = s->samples * s->extra_bits << s->stereo_in;
-        if (size < wanted) {
-            av_log(avctx, AV_LOG_ERROR, "Too small EXTRABITS\n");
-            s->got_extra_bits = 0;
-        }
-    }
-
-    if (!wc->ch_offset) {
-        int sr = (s->frame_flags >> 23) & 0xf;
-        if (sr == 0xf) {
-            if (!sample_rate) {
-                av_log(avctx, AV_LOG_ERROR, "Custom sample rate missing.\n");
-                return AVERROR_INVALIDDATA;
-            }
-            avctx->sample_rate = sample_rate;
-        } else
-            avctx->sample_rate = wv_rates[sr];
-
-        if (multiblock) {
-            if (chan)
-                avctx->channels = chan;
-            if (chmask)
-                avctx->channel_layout = chmask;
-        } else {
-            avctx->channels       = s->stereo ? 2 : 1;
-            avctx->channel_layout = s->stereo ? AV_CH_LAYOUT_STEREO :
-                                                AV_CH_LAYOUT_MONO;
-        }
-
-        /* get output buffer */
-        frame->nb_samples = s->samples;
-        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return ret;
-        }
-    }
-
-    if (wc->ch_offset + s->stereo >= avctx->channels) {
-        av_log(avctx, AV_LOG_WARNING, "Too many channels coded in a packet.\n");
-        return (avctx->err_recognition & AV_EF_EXPLODE) ? AVERROR_INVALIDDATA : 0;
-    }
-
-    samples_l = frame->extended_data[wc->ch_offset];
-    if (s->stereo)
-        samples_r = frame->extended_data[wc->ch_offset + 1];
-
-    wc->ch_offset += 1 + s->stereo;
-
-    if (s->stereo_in) {
-        ret = wv_unpack_stereo(s, &s->gb, samples_l, samples_r, avctx->sample_fmt);
-        if (ret < 0)
-            return ret;
-    } else {
-        ret = wv_unpack_mono(s, &s->gb, samples_l, avctx->sample_fmt);
-        if (ret < 0)
-            return ret;
-
-        if (s->stereo)
-            memcpy(samples_r, samples_l, bpp * s->samples);
-    }
-
-    return 0;
-}
-
-static void wavpack_decode_flush(AVCodecContext *avctx)
-{
-    WavpackContext *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < s->fdec_num; i++)
-        wv_reset_saved_context(s->fdec[i]);
-}
-
-static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
-                                int *got_frame_ptr, AVPacket *avpkt)
-{
-    WavpackContext *s  = avctx->priv_data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    AVFrame *frame     = data;
-    int frame_size, ret, frame_flags;
-
-    if (avpkt->size <= WV_HEADER_SIZE)
-        return AVERROR_INVALIDDATA;
-
-    s->block     = 0;
-    s->ch_offset = 0;
-
-    /* determine number of samples */
-    s->samples  = AV_RL32(buf + 20);
-    frame_flags = AV_RL32(buf + 24);
-    if (s->samples <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid number of samples: %d\n",
-               s->samples);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (frame_flags & 0x80) {
-        avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-    } else if ((frame_flags & 0x03) <= 1) {
-        avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-    } else {
-        avctx->sample_fmt          = AV_SAMPLE_FMT_S32P;
-        avctx->bits_per_raw_sample = ((frame_flags & 0x03) + 1) << 3;
-    }
-
-    while (buf_size > 0) {
-        if (buf_size <= WV_HEADER_SIZE)
-            break;
-        frame_size = AV_RL32(buf + 4) - 12;
-        buf       += 20;
-        buf_size  -= 20;
-        if (frame_size <= 0 || frame_size > buf_size) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Block %d has invalid size (size %d vs. %d bytes left)\n",
-                   s->block, frame_size, buf_size);
-            wavpack_decode_flush(avctx);
-            return AVERROR_INVALIDDATA;
-        }
-        if ((ret = wavpack_decode_block(avctx, s->block,
-                                        frame, buf, frame_size)) < 0) {
-            wavpack_decode_flush(avctx);
-            return ret;
-        }
-        s->block++;
-        buf      += frame_size;
-        buf_size -= frame_size;
-    }
-
-    if (s->ch_offset != avctx->channels) {
-        av_log(avctx, AV_LOG_ERROR, "Not enough channels coded in a packet.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    *got_frame_ptr = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_wavpack_decoder = {
-    .name           = "wavpack",
-    .long_name      = NULL_IF_CONFIG_SMALL("WavPack"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_WAVPACK,
-    .priv_data_size = sizeof(WavpackContext),
-    .init           = wavpack_decode_init,
-    .close          = wavpack_decode_end,
-    .decode         = wavpack_decode_frame,
-    .flush          = wavpack_decode_flush,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/webp.c b/deps/libav/libavcodec/webp.c
deleted file mode 100644
index f9f8bfc..0000000
--- a/deps/libav/libavcodec/webp.c
+++ /dev/null
@@ -1,1467 +0,0 @@
-/*
- * WebP (.webp) image decoder
- * Copyright (c) 2013 Aneesh Dogra <aneesh at sugarlabs.org>
- * Copyright (c) 2013 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * WebP image decoder
- *
- * @author Aneesh Dogra <aneesh at sugarlabs.org>
- * Container and Lossy decoding
- *
- * @author Justin Ruggles <justin.ruggles at gmail.com>
- * Lossless decoder
- * Compressed alpha for lossy
- *
- * Unimplemented:
- *   - Animation
- *   - ICC profile
- *   - Exif and XMP metadata
- */
-
-#define BITSTREAM_READER_LE
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "thread.h"
-#include "vp8.h"
-
-#define VP8X_FLAG_ANIMATION             0x02
-#define VP8X_FLAG_XMP_METADATA          0x04
-#define VP8X_FLAG_EXIF_METADATA         0x08
-#define VP8X_FLAG_ALPHA                 0x10
-#define VP8X_FLAG_ICC                   0x20
-
-#define MAX_PALETTE_SIZE                256
-#define MAX_CACHE_BITS                  11
-#define NUM_CODE_LENGTH_CODES           19
-#define HUFFMAN_CODES_PER_META_CODE     5
-#define NUM_LITERAL_CODES               256
-#define NUM_LENGTH_CODES                24
-#define NUM_DISTANCE_CODES              40
-#define NUM_SHORT_DISTANCES             120
-#define MAX_HUFFMAN_CODE_LENGTH         15
-
-static const uint16_t alphabet_sizes[HUFFMAN_CODES_PER_META_CODE] = {
-    NUM_LITERAL_CODES + NUM_LENGTH_CODES,
-    NUM_LITERAL_CODES, NUM_LITERAL_CODES, NUM_LITERAL_CODES,
-    NUM_DISTANCE_CODES
-};
-
-static const uint8_t code_length_code_order[NUM_CODE_LENGTH_CODES] = {
-    17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
-};
-
-static const int8_t lz77_distance_offsets[NUM_SHORT_DISTANCES][2] = {
-    {  0, 1 }, {  1, 0 }, {  1, 1 }, { -1, 1 }, {  0, 2 }, {  2, 0 }, {  1, 2 }, { -1, 2 },
-    {  2, 1 }, { -2, 1 }, {  2, 2 }, { -2, 2 }, {  0, 3 }, {  3, 0 }, {  1, 3 }, { -1, 3 },
-    {  3, 1 }, { -3, 1 }, {  2, 3 }, { -2, 3 }, {  3, 2 }, { -3, 2 }, {  0, 4 }, {  4, 0 },
-    {  1, 4 }, { -1, 4 }, {  4, 1 }, { -4, 1 }, {  3, 3 }, { -3, 3 }, {  2, 4 }, { -2, 4 },
-    {  4, 2 }, { -4, 2 }, {  0, 5 }, {  3, 4 }, { -3, 4 }, {  4, 3 }, { -4, 3 }, {  5, 0 },
-    {  1, 5 }, { -1, 5 }, {  5, 1 }, { -5, 1 }, {  2, 5 }, { -2, 5 }, {  5, 2 }, { -5, 2 },
-    {  4, 4 }, { -4, 4 }, {  3, 5 }, { -3, 5 }, {  5, 3 }, { -5, 3 }, {  0, 6 }, {  6, 0 },
-    {  1, 6 }, { -1, 6 }, {  6, 1 }, { -6, 1 }, {  2, 6 }, { -2, 6 }, {  6, 2 }, { -6, 2 },
-    {  4, 5 }, { -4, 5 }, {  5, 4 }, { -5, 4 }, {  3, 6 }, { -3, 6 }, {  6, 3 }, { -6, 3 },
-    {  0, 7 }, {  7, 0 }, {  1, 7 }, { -1, 7 }, {  5, 5 }, { -5, 5 }, {  7, 1 }, { -7, 1 },
-    {  4, 6 }, { -4, 6 }, {  6, 4 }, { -6, 4 }, {  2, 7 }, { -2, 7 }, {  7, 2 }, { -7, 2 },
-    {  3, 7 }, { -3, 7 }, {  7, 3 }, { -7, 3 }, {  5, 6 }, { -5, 6 }, {  6, 5 }, { -6, 5 },
-    {  8, 0 }, {  4, 7 }, { -4, 7 }, {  7, 4 }, { -7, 4 }, {  8, 1 }, {  8, 2 }, {  6, 6 },
-    { -6, 6 }, {  8, 3 }, {  5, 7 }, { -5, 7 }, {  7, 5 }, { -7, 5 }, {  8, 4 }, {  6, 7 },
-    { -6, 7 }, {  7, 6 }, { -7, 6 }, {  8, 5 }, {  7, 7 }, { -7, 7 }, {  8, 6 }, {  8, 7 }
-};
-
-enum AlphaCompression {
-    ALPHA_COMPRESSION_NONE,
-    ALPHA_COMPRESSION_VP8L,
-};
-
-enum AlphaFilter {
-    ALPHA_FILTER_NONE,
-    ALPHA_FILTER_HORIZONTAL,
-    ALPHA_FILTER_VERTICAL,
-    ALPHA_FILTER_GRADIENT,
-};
-
-enum TransformType {
-    PREDICTOR_TRANSFORM      = 0,
-    COLOR_TRANSFORM          = 1,
-    SUBTRACT_GREEN           = 2,
-    COLOR_INDEXING_TRANSFORM = 3,
-};
-
-enum PredictionMode {
-    PRED_MODE_BLACK,
-    PRED_MODE_L,
-    PRED_MODE_T,
-    PRED_MODE_TR,
-    PRED_MODE_TL,
-    PRED_MODE_AVG_T_AVG_L_TR,
-    PRED_MODE_AVG_L_TL,
-    PRED_MODE_AVG_L_T,
-    PRED_MODE_AVG_TL_T,
-    PRED_MODE_AVG_T_TR,
-    PRED_MODE_AVG_AVG_L_TL_AVG_T_TR,
-    PRED_MODE_SELECT,
-    PRED_MODE_ADD_SUBTRACT_FULL,
-    PRED_MODE_ADD_SUBTRACT_HALF,
-};
-
-enum HuffmanIndex {
-    HUFF_IDX_GREEN = 0,
-    HUFF_IDX_RED   = 1,
-    HUFF_IDX_BLUE  = 2,
-    HUFF_IDX_ALPHA = 3,
-    HUFF_IDX_DIST  = 4
-};
-
-/* The structure of WebP lossless is an optional series of transformation data,
- * followed by the primary image. The primary image also optionally contains
- * an entropy group mapping if there are multiple entropy groups. There is a
- * basic image type called an "entropy coded image" that is used for all of
- * these. The type of each entropy coded image is referred to by the
- * specification as its role. */
-enum ImageRole {
-    /* Primary Image: Stores the actual pixels of the image. */
-    IMAGE_ROLE_ARGB,
-
-    /* Entropy Image: Defines which Huffman group to use for different areas of
-     *                the primary image. */
-    IMAGE_ROLE_ENTROPY,
-
-    /* Predictors: Defines which predictor type to use for different areas of
-     *             the primary image. */
-    IMAGE_ROLE_PREDICTOR,
-
-    /* Color Transform Data: Defines the color transformation for different
-     *                       areas of the primary image. */
-    IMAGE_ROLE_COLOR_TRANSFORM,
-
-    /* Color Index: Stored as an image of height == 1. */
-    IMAGE_ROLE_COLOR_INDEXING,
-
-    IMAGE_ROLE_NB,
-};
-
-typedef struct HuffReader {
-    VLC vlc;                            /* Huffman decoder context */
-    int simple;                         /* whether to use simple mode */
-    int nb_symbols;                     /* number of coded symbols */
-    uint16_t simple_symbols[2];         /* symbols for simple mode */
-} HuffReader;
-
-typedef struct ImageContext {
-    enum ImageRole role;                /* role of this image */
-    AVFrame *frame;                     /* AVFrame for data */
-    int color_cache_bits;               /* color cache size, log2 */
-    uint32_t *color_cache;              /* color cache data */
-    int nb_huffman_groups;              /* number of huffman groups */
-    HuffReader *huffman_groups;         /* reader for each huffman group */
-    int size_reduction;                 /* relative size compared to primary image, log2 */
-    int is_alpha_primary;
-} ImageContext;
-
-typedef struct WebPContext {
-    VP8Context v;                       /* VP8 Context used for lossy decoding */
-    GetBitContext gb;                   /* bitstream reader for main image chunk */
-    AVFrame *alpha_frame;               /* AVFrame for alpha data decompressed from VP8L */
-    AVCodecContext *avctx;              /* parent AVCodecContext */
-    int initialized;                    /* set once the VP8 context is initialized */
-    int has_alpha;                      /* has a separate alpha chunk */
-    enum AlphaCompression alpha_compression; /* compression type for alpha chunk */
-    enum AlphaFilter alpha_filter;      /* filtering method for alpha chunk */
-    uint8_t *alpha_data;                /* alpha chunk data */
-    int alpha_data_size;                /* alpha chunk data size */
-    int width;                          /* image width */
-    int height;                         /* image height */
-    int lossless;                       /* indicates lossless or lossy */
-
-    int nb_transforms;                  /* number of transforms */
-    enum TransformType transforms[4];   /* transformations used in the image, in order */
-    int reduced_width;                  /* reduced width for index image, if applicable */
-    int nb_huffman_groups;              /* number of huffman groups in the primary image */
-    ImageContext image[IMAGE_ROLE_NB];  /* image context for each role */
-} WebPContext;
-
-#define GET_PIXEL(frame, x, y) \
-    ((frame)->data[0] + (y) * frame->linesize[0] + 4 * (x))
-
-#define GET_PIXEL_COMP(frame, x, y, c) \
-    (*((frame)->data[0] + (y) * frame->linesize[0] + 4 * (x) + c))
-
-static void image_ctx_free(ImageContext *img)
-{
-    int i, j;
-
-    av_free(img->color_cache);
-    if (img->role != IMAGE_ROLE_ARGB && !img->is_alpha_primary)
-        av_frame_free(&img->frame);
-    if (img->huffman_groups) {
-        for (i = 0; i < img->nb_huffman_groups; i++) {
-            for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; j++)
-                ff_free_vlc(&img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE + j].vlc);
-        }
-        av_free(img->huffman_groups);
-    }
-    memset(img, 0, sizeof(*img));
-}
-
-
-/* Differs from get_vlc2() in the following ways:
- *   - codes are bit-reversed
- *   - assumes 8-bit table to make reversal simpler
- *   - assumes max depth of 2 since the max code length for WebP is 15
- */
-static av_always_inline int webp_get_vlc(GetBitContext *gb, VLC_TYPE (*table)[2])
-{
-    int n, nb_bits;
-    unsigned int index;
-    int code;
-
-    OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
-
-    index = SHOW_UBITS(re, gb, 8);
-    index = ff_reverse[index];
-    code  = table[index][0];
-    n     = table[index][1];
-
-    if (n < 0) {
-        LAST_SKIP_BITS(re, gb, 8);
-        UPDATE_CACHE(re, gb);
-
-        nb_bits = -n;
-
-        index = SHOW_UBITS(re, gb, nb_bits);
-        index = (ff_reverse[index] >> (8 - nb_bits)) + code;
-        code  = table[index][0];
-        n     = table[index][1];
-    }
-    SKIP_BITS(re, gb, n);
-
-    CLOSE_READER(re, gb);
-
-    return code;
-}
-
-static int huff_reader_get_symbol(HuffReader *r, GetBitContext *gb)
-{
-    if (r->simple) {
-        if (r->nb_symbols == 1)
-            return r->simple_symbols[0];
-        else
-            return r->simple_symbols[get_bits1(gb)];
-    } else
-        return webp_get_vlc(gb, r->vlc.table);
-}
-
-static int huff_reader_build_canonical(HuffReader *r, int *code_lengths,
-                                       int alphabet_size)
-{
-    int len = 0, sym, code = 0, ret;
-    int max_code_length = 0;
-    uint16_t *codes;
-
-    /* special-case 1 symbol since the vlc reader cannot handle it */
-    for (sym = 0; sym < alphabet_size; sym++) {
-        if (code_lengths[sym] > 0) {
-            len++;
-            code = sym;
-            if (len > 1)
-                break;
-        }
-    }
-    if (len == 1) {
-        r->nb_symbols = 1;
-        r->simple_symbols[0] = code;
-        r->simple = 1;
-        return 0;
-    }
-
-    for (sym = 0; sym < alphabet_size; sym++)
-        max_code_length = FFMAX(max_code_length, code_lengths[sym]);
-
-    if (max_code_length == 0 || max_code_length > MAX_HUFFMAN_CODE_LENGTH)
-        return AVERROR(EINVAL);
-
-    codes = av_malloc(alphabet_size * sizeof(*codes));
-    if (!codes)
-        return AVERROR(ENOMEM);
-
-    code = 0;
-    r->nb_symbols = 0;
-    for (len = 1; len <= max_code_length; len++) {
-        for (sym = 0; sym < alphabet_size; sym++) {
-            if (code_lengths[sym] != len)
-                continue;
-            codes[sym] = code++;
-            r->nb_symbols++;
-        }
-        code <<= 1;
-    }
-    if (!r->nb_symbols) {
-        av_free(codes);
-        return AVERROR_INVALIDDATA;
-    }
-
-    ret = init_vlc(&r->vlc, 8, alphabet_size,
-                   code_lengths, sizeof(*code_lengths), sizeof(*code_lengths),
-                   codes, sizeof(*codes), sizeof(*codes), 0);
-    if (ret < 0) {
-        av_free(codes);
-        return ret;
-    }
-    r->simple = 0;
-
-    av_free(codes);
-    return 0;
-}
-
-static void read_huffman_code_simple(WebPContext *s, HuffReader *hc)
-{
-    hc->nb_symbols = get_bits1(&s->gb) + 1;
-
-    if (get_bits1(&s->gb))
-        hc->simple_symbols[0] = get_bits(&s->gb, 8);
-    else
-        hc->simple_symbols[0] = get_bits1(&s->gb);
-
-    if (hc->nb_symbols == 2)
-        hc->simple_symbols[1] = get_bits(&s->gb, 8);
-
-    hc->simple = 1;
-}
-
-static int read_huffman_code_normal(WebPContext *s, HuffReader *hc,
-                                    int alphabet_size)
-{
-    HuffReader code_len_hc = { { 0 }, 0, 0, { 0 } };
-    int *code_lengths = NULL;
-    int code_length_code_lengths[NUM_CODE_LENGTH_CODES] = { 0 };
-    int i, symbol, max_symbol, prev_code_len, ret;
-    int num_codes = 4 + get_bits(&s->gb, 4);
-
-    if (num_codes > NUM_CODE_LENGTH_CODES)
-        return AVERROR_INVALIDDATA;
-
-    for (i = 0; i < num_codes; i++)
-        code_length_code_lengths[code_length_code_order[i]] = get_bits(&s->gb, 3);
-
-    ret = huff_reader_build_canonical(&code_len_hc, code_length_code_lengths,
-                                      NUM_CODE_LENGTH_CODES);
-    if (ret < 0)
-        goto finish;
-
-    code_lengths = av_mallocz_array(alphabet_size, sizeof(*code_lengths));
-    if (!code_lengths) {
-        ret = AVERROR(ENOMEM);
-        goto finish;
-    }
-
-    if (get_bits1(&s->gb)) {
-        int bits   = 2 + 2 * get_bits(&s->gb, 3);
-        max_symbol = 2 + get_bits(&s->gb, bits);
-        if (max_symbol > alphabet_size) {
-            av_log(s->avctx, AV_LOG_ERROR, "max symbol %d > alphabet size %d\n",
-                   max_symbol, alphabet_size);
-            ret = AVERROR_INVALIDDATA;
-            goto finish;
-        }
-    } else {
-        max_symbol = alphabet_size;
-    }
-
-    prev_code_len = 8;
-    symbol        = 0;
-    while (symbol < alphabet_size) {
-        int code_len;
-
-        if (!max_symbol--)
-            break;
-        code_len = huff_reader_get_symbol(&code_len_hc, &s->gb);
-        if (code_len < 16) {
-            /* Code length code [0..15] indicates literal code lengths. */
-            code_lengths[symbol++] = code_len;
-            if (code_len)
-                prev_code_len = code_len;
-        } else {
-            int repeat = 0, length = 0;
-            switch (code_len) {
-            case 16:
-                /* Code 16 repeats the previous non-zero value [3..6] times,
-                 * i.e., 3 + ReadBits(2) times. If code 16 is used before a
-                 * non-zero value has been emitted, a value of 8 is repeated. */
-                repeat = 3 + get_bits(&s->gb, 2);
-                length = prev_code_len;
-                break;
-            case 17:
-                /* Code 17 emits a streak of zeros [3..10], i.e.,
-                 * 3 + ReadBits(3) times. */
-                repeat = 3 + get_bits(&s->gb, 3);
-                break;
-            case 18:
-                /* Code 18 emits a streak of zeros of length [11..138], i.e.,
-                 * 11 + ReadBits(7) times. */
-                repeat = 11 + get_bits(&s->gb, 7);
-                break;
-            }
-            if (symbol + repeat > alphabet_size) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "invalid symbol %d + repeat %d > alphabet size %d\n",
-                       symbol, repeat, alphabet_size);
-                ret = AVERROR_INVALIDDATA;
-                goto finish;
-            }
-            while (repeat-- > 0)
-                code_lengths[symbol++] = length;
-        }
-    }
-
-    ret = huff_reader_build_canonical(hc, code_lengths, alphabet_size);
-
-finish:
-    ff_free_vlc(&code_len_hc.vlc);
-    av_free(code_lengths);
-    return ret;
-}
-
-static int decode_entropy_coded_image(WebPContext *s, enum ImageRole role,
-                                      int w, int h);
-
-#define PARSE_BLOCK_SIZE(w, h) do {                                         \
-    block_bits = get_bits(&s->gb, 3) + 2;                                   \
-    blocks_w   = FFALIGN((w), 1 << block_bits) >> block_bits;               \
-    blocks_h   = FFALIGN((h), 1 << block_bits) >> block_bits;               \
-} while (0)
-
-static int decode_entropy_image(WebPContext *s)
-{
-    ImageContext *img;
-    int ret, block_bits, width, blocks_w, blocks_h, x, y, max;
-
-    width = s->width;
-    if (s->reduced_width > 0)
-        width = s->reduced_width;
-
-    PARSE_BLOCK_SIZE(width, s->height);
-
-    ret = decode_entropy_coded_image(s, IMAGE_ROLE_ENTROPY, blocks_w, blocks_h);
-    if (ret < 0)
-        return ret;
-
-    img = &s->image[IMAGE_ROLE_ENTROPY];
-    img->size_reduction = block_bits;
-
-    /* the number of huffman groups is determined by the maximum group number
-     * coded in the entropy image */
-    max = 0;
-    for (y = 0; y < img->frame->height; y++) {
-        for (x = 0; x < img->frame->width; x++) {
-            int p = GET_PIXEL_COMP(img->frame, x, y, 2);
-            max = FFMAX(max, p);
-        }
-    }
-    s->nb_huffman_groups = max + 1;
-
-    return 0;
-}
-
-static int parse_transform_predictor(WebPContext *s)
-{
-    int block_bits, blocks_w, blocks_h, ret;
-
-    PARSE_BLOCK_SIZE(s->width, s->height);
-
-    ret = decode_entropy_coded_image(s, IMAGE_ROLE_PREDICTOR, blocks_w,
-                                     blocks_h);
-    if (ret < 0)
-        return ret;
-
-    s->image[IMAGE_ROLE_PREDICTOR].size_reduction = block_bits;
-
-    return 0;
-}
-
-static int parse_transform_color(WebPContext *s)
-{
-    int block_bits, blocks_w, blocks_h, ret;
-
-    PARSE_BLOCK_SIZE(s->width, s->height);
-
-    ret = decode_entropy_coded_image(s, IMAGE_ROLE_COLOR_TRANSFORM, blocks_w,
-                                     blocks_h);
-    if (ret < 0)
-        return ret;
-
-    s->image[IMAGE_ROLE_COLOR_TRANSFORM].size_reduction = block_bits;
-
-    return 0;
-}
-
-static int parse_transform_color_indexing(WebPContext *s)
-{
-    ImageContext *img;
-    int width_bits, index_size, ret, x;
-    uint8_t *ct;
-
-    index_size = get_bits(&s->gb, 8) + 1;
-
-    if (index_size <= 2)
-        width_bits = 3;
-    else if (index_size <= 4)
-        width_bits = 2;
-    else if (index_size <= 16)
-        width_bits = 1;
-    else
-        width_bits = 0;
-
-    ret = decode_entropy_coded_image(s, IMAGE_ROLE_COLOR_INDEXING,
-                                     index_size, 1);
-    if (ret < 0)
-        return ret;
-
-    img = &s->image[IMAGE_ROLE_COLOR_INDEXING];
-    img->size_reduction = width_bits;
-    if (width_bits > 0)
-        s->reduced_width = (s->width + ((1 << width_bits) - 1)) >> width_bits;
-
-    /* color index values are delta-coded */
-    ct  = img->frame->data[0] + 4;
-    for (x = 4; x < img->frame->width * 4; x++, ct++)
-        ct[0] += ct[-4];
-
-    return 0;
-}
-
-static HuffReader *get_huffman_group(WebPContext *s, ImageContext *img,
-                                     int x, int y)
-{
-    ImageContext *gimg = &s->image[IMAGE_ROLE_ENTROPY];
-    int group = 0;
-
-    if (gimg->size_reduction > 0) {
-        int group_x = x >> gimg->size_reduction;
-        int group_y = y >> gimg->size_reduction;
-        group       = GET_PIXEL_COMP(gimg->frame, group_x, group_y, 2);
-    }
-
-    return &img->huffman_groups[group * HUFFMAN_CODES_PER_META_CODE];
-}
-
-static av_always_inline void color_cache_put(ImageContext *img, uint32_t c)
-{
-    uint32_t cache_idx = (0x1E35A7BD * c) >> (32 - img->color_cache_bits);
-    img->color_cache[cache_idx] = c;
-}
-
-static int decode_entropy_coded_image(WebPContext *s, enum ImageRole role,
-                                      int w, int h)
-{
-    ImageContext *img;
-    HuffReader *hg;
-    int i, j, ret, x, y, width;
-
-    img       = &s->image[role];
-    img->role = role;
-
-    if (!img->frame) {
-        img->frame = av_frame_alloc();
-        if (!img->frame)
-            return AVERROR(ENOMEM);
-    }
-
-    img->frame->format = AV_PIX_FMT_ARGB;
-    img->frame->width  = w;
-    img->frame->height = h;
-
-    if (role == IMAGE_ROLE_ARGB && !img->is_alpha_primary) {
-        ThreadFrame pt = { .f = img->frame };
-        ret = ff_thread_get_buffer(s->avctx, &pt, 0);
-    } else
-        ret = av_frame_get_buffer(img->frame, 1);
-    if (ret < 0)
-        return ret;
-
-    if (get_bits1(&s->gb)) {
-        img->color_cache_bits = get_bits(&s->gb, 4);
-        if (img->color_cache_bits < 1 || img->color_cache_bits > 11) {
-            av_log(s->avctx, AV_LOG_ERROR, "invalid color cache bits: %d\n",
-                   img->color_cache_bits);
-            return AVERROR_INVALIDDATA;
-        }
-        img->color_cache = av_mallocz_array(1 << img->color_cache_bits,
-                                            sizeof(*img->color_cache));
-        if (!img->color_cache)
-            return AVERROR(ENOMEM);
-    } else {
-        img->color_cache_bits = 0;
-    }
-
-    img->nb_huffman_groups = 1;
-    if (role == IMAGE_ROLE_ARGB && get_bits1(&s->gb)) {
-        ret = decode_entropy_image(s);
-        if (ret < 0)
-            return ret;
-        img->nb_huffman_groups = s->nb_huffman_groups;
-    }
-    img->huffman_groups = av_mallocz_array(img->nb_huffman_groups *
-                                           HUFFMAN_CODES_PER_META_CODE,
-                                           sizeof(*img->huffman_groups));
-    if (!img->huffman_groups)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < img->nb_huffman_groups; i++) {
-        hg = &img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE];
-        for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; j++) {
-            int alphabet_size = alphabet_sizes[j];
-            if (!j && img->color_cache_bits > 0)
-                alphabet_size += 1 << img->color_cache_bits;
-
-            if (get_bits1(&s->gb)) {
-                read_huffman_code_simple(s, &hg[j]);
-            } else {
-                ret = read_huffman_code_normal(s, &hg[j], alphabet_size);
-                if (ret < 0)
-                    return ret;
-            }
-        }
-    }
-
-    width = img->frame->width;
-    if (role == IMAGE_ROLE_ARGB && s->reduced_width > 0)
-        width = s->reduced_width;
-
-    x = 0; y = 0;
-    while (y < img->frame->height) {
-        int v;
-
-        hg = get_huffman_group(s, img, x, y);
-        v = huff_reader_get_symbol(&hg[HUFF_IDX_GREEN], &s->gb);
-        if (v < NUM_LITERAL_CODES) {
-            /* literal pixel values */
-            uint8_t *p = GET_PIXEL(img->frame, x, y);
-            p[2] = v;
-            p[1] = huff_reader_get_symbol(&hg[HUFF_IDX_RED],   &s->gb);
-            p[3] = huff_reader_get_symbol(&hg[HUFF_IDX_BLUE],  &s->gb);
-            p[0] = huff_reader_get_symbol(&hg[HUFF_IDX_ALPHA], &s->gb);
-            if (img->color_cache_bits)
-                color_cache_put(img, AV_RB32(p));
-            x++;
-            if (x == width) {
-                x = 0;
-                y++;
-            }
-        } else if (v < NUM_LITERAL_CODES + NUM_LENGTH_CODES) {
-            /* LZ77 backwards mapping */
-            int prefix_code, length, distance, ref_x, ref_y;
-
-            /* parse length and distance */
-            prefix_code = v - NUM_LITERAL_CODES;
-            if (prefix_code < 4) {
-                length = prefix_code + 1;
-            } else {
-                int extra_bits = (prefix_code - 2) >> 1;
-                int offset     = 2 + (prefix_code & 1) << extra_bits;
-                length = offset + get_bits(&s->gb, extra_bits) + 1;
-            }
-            prefix_code = huff_reader_get_symbol(&hg[HUFF_IDX_DIST], &s->gb);
-            if (prefix_code < 4) {
-                distance = prefix_code + 1;
-            } else {
-                int extra_bits = prefix_code - 2 >> 1;
-                int offset     = 2 + (prefix_code & 1) << extra_bits;
-                distance = offset + get_bits(&s->gb, extra_bits) + 1;
-            }
-
-            /* find reference location */
-            if (distance <= NUM_SHORT_DISTANCES) {
-                int xi = lz77_distance_offsets[distance - 1][0];
-                int yi = lz77_distance_offsets[distance - 1][1];
-                distance = FFMAX(1, xi + yi * width);
-            } else {
-                distance -= NUM_SHORT_DISTANCES;
-            }
-            ref_x = x;
-            ref_y = y;
-            if (distance <= x) {
-                ref_x -= distance;
-                distance = 0;
-            } else {
-                ref_x = 0;
-                distance -= x;
-            }
-            while (distance >= width) {
-                ref_y--;
-                distance -= width;
-            }
-            if (distance > 0) {
-                ref_x = width - distance;
-                ref_y--;
-            }
-            ref_x = FFMAX(0, ref_x);
-            ref_y = FFMAX(0, ref_y);
-
-            /* copy pixels
-             * source and dest regions can overlap and wrap lines, so just
-             * copy per-pixel */
-            for (i = 0; i < length; i++) {
-                uint8_t *p_ref = GET_PIXEL(img->frame, ref_x, ref_y);
-                uint8_t *p     = GET_PIXEL(img->frame,     x,     y);
-
-                AV_COPY32(p, p_ref);
-                if (img->color_cache_bits)
-                    color_cache_put(img, AV_RB32(p));
-                x++;
-                ref_x++;
-                if (x == width) {
-                    x = 0;
-                    y++;
-                }
-                if (ref_x == width) {
-                    ref_x = 0;
-                    ref_y++;
-                }
-                if (y == img->frame->height || ref_y == img->frame->height)
-                    break;
-            }
-        } else {
-            /* read from color cache */
-            uint8_t *p = GET_PIXEL(img->frame, x, y);
-            int cache_idx = v - (NUM_LITERAL_CODES + NUM_LENGTH_CODES);
-
-            if (!img->color_cache_bits) {
-                av_log(s->avctx, AV_LOG_ERROR, "color cache not found\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (cache_idx >= 1 << img->color_cache_bits) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "color cache index out-of-bounds\n");
-                return AVERROR_INVALIDDATA;
-            }
-            AV_WB32(p, img->color_cache[cache_idx]);
-            x++;
-            if (x == width) {
-                x = 0;
-                y++;
-            }
-        }
-    }
-
-    return 0;
-}
-
-/* PRED_MODE_BLACK */
-static void inv_predict_0(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    AV_WB32(p, 0xFF000000);
-}
-
-/* PRED_MODE_L */
-static void inv_predict_1(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    AV_COPY32(p, p_l);
-}
-
-/* PRED_MODE_T */
-static void inv_predict_2(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    AV_COPY32(p, p_t);
-}
-
-/* PRED_MODE_TR */
-static void inv_predict_3(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    AV_COPY32(p, p_tr);
-}
-
-/* PRED_MODE_TL */
-static void inv_predict_4(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    AV_COPY32(p, p_tl);
-}
-
-/* PRED_MODE_AVG_T_AVG_L_TR */
-static void inv_predict_5(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    p[0] = p_t[0] + (p_l[0] + p_tr[0] >> 1) >> 1;
-    p[1] = p_t[1] + (p_l[1] + p_tr[1] >> 1) >> 1;
-    p[2] = p_t[2] + (p_l[2] + p_tr[2] >> 1) >> 1;
-    p[3] = p_t[3] + (p_l[3] + p_tr[3] >> 1) >> 1;
-}
-
-/* PRED_MODE_AVG_L_TL */
-static void inv_predict_6(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    p[0] = p_l[0] + p_tl[0] >> 1;
-    p[1] = p_l[1] + p_tl[1] >> 1;
-    p[2] = p_l[2] + p_tl[2] >> 1;
-    p[3] = p_l[3] + p_tl[3] >> 1;
-}
-
-/* PRED_MODE_AVG_L_T */
-static void inv_predict_7(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    p[0] = p_l[0] + p_t[0] >> 1;
-    p[1] = p_l[1] + p_t[1] >> 1;
-    p[2] = p_l[2] + p_t[2] >> 1;
-    p[3] = p_l[3] + p_t[3] >> 1;
-}
-
-/* PRED_MODE_AVG_TL_T */
-static void inv_predict_8(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    p[0] = p_tl[0] + p_t[0] >> 1;
-    p[1] = p_tl[1] + p_t[1] >> 1;
-    p[2] = p_tl[2] + p_t[2] >> 1;
-    p[3] = p_tl[3] + p_t[3] >> 1;
-}
-
-/* PRED_MODE_AVG_T_TR */
-static void inv_predict_9(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                          const uint8_t *p_t, const uint8_t *p_tr)
-{
-    p[0] = p_t[0] + p_tr[0] >> 1;
-    p[1] = p_t[1] + p_tr[1] >> 1;
-    p[2] = p_t[2] + p_tr[2] >> 1;
-    p[3] = p_t[3] + p_tr[3] >> 1;
-}
-
-/* PRED_MODE_AVG_AVG_L_TL_AVG_T_TR */
-static void inv_predict_10(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                           const uint8_t *p_t, const uint8_t *p_tr)
-{
-    p[0] = (p_l[0] + p_tl[0] >> 1) + (p_t[0] + p_tr[0] >> 1) >> 1;
-    p[1] = (p_l[1] + p_tl[1] >> 1) + (p_t[1] + p_tr[1] >> 1) >> 1;
-    p[2] = (p_l[2] + p_tl[2] >> 1) + (p_t[2] + p_tr[2] >> 1) >> 1;
-    p[3] = (p_l[3] + p_tl[3] >> 1) + (p_t[3] + p_tr[3] >> 1) >> 1;
-}
-
-/* PRED_MODE_SELECT */
-static void inv_predict_11(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                           const uint8_t *p_t, const uint8_t *p_tr)
-{
-    int diff = (FFABS(p_l[0] - p_tl[0]) - FFABS(p_t[0] - p_tl[0])) +
-               (FFABS(p_l[1] - p_tl[1]) - FFABS(p_t[1] - p_tl[1])) +
-               (FFABS(p_l[2] - p_tl[2]) - FFABS(p_t[2] - p_tl[2])) +
-               (FFABS(p_l[3] - p_tl[3]) - FFABS(p_t[3] - p_tl[3]));
-    if (diff <= 0)
-        AV_COPY32(p, p_t);
-    else
-        AV_COPY32(p, p_l);
-}
-
-/* PRED_MODE_ADD_SUBTRACT_FULL */
-static void inv_predict_12(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                           const uint8_t *p_t, const uint8_t *p_tr)
-{
-    p[0] = av_clip_uint8(p_l[0] + p_t[0] - p_tl[0]);
-    p[1] = av_clip_uint8(p_l[1] + p_t[1] - p_tl[1]);
-    p[2] = av_clip_uint8(p_l[2] + p_t[2] - p_tl[2]);
-    p[3] = av_clip_uint8(p_l[3] + p_t[3] - p_tl[3]);
-}
-
-static av_always_inline uint8_t clamp_add_subtract_half(int a, int b, int c)
-{
-    int d = a + b >> 1;
-    return av_clip_uint8(d + (d - c) / 2);
-}
-
-/* PRED_MODE_ADD_SUBTRACT_HALF */
-static void inv_predict_13(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl,
-                           const uint8_t *p_t, const uint8_t *p_tr)
-{
-    p[0] = clamp_add_subtract_half(p_l[0], p_t[0], p_tl[0]);
-    p[1] = clamp_add_subtract_half(p_l[1], p_t[1], p_tl[1]);
-    p[2] = clamp_add_subtract_half(p_l[2], p_t[2], p_tl[2]);
-    p[3] = clamp_add_subtract_half(p_l[3], p_t[3], p_tl[3]);
-}
-
-typedef void (*inv_predict_func)(uint8_t *p, const uint8_t *p_l,
-                                 const uint8_t *p_tl, const uint8_t *p_t,
-                                 const uint8_t *p_tr);
-
-static const inv_predict_func inverse_predict[14] = {
-    inv_predict_0,  inv_predict_1,  inv_predict_2,  inv_predict_3,
-    inv_predict_4,  inv_predict_5,  inv_predict_6,  inv_predict_7,
-    inv_predict_8,  inv_predict_9,  inv_predict_10, inv_predict_11,
-    inv_predict_12, inv_predict_13,
-};
-
-static void inverse_prediction(AVFrame *frame, enum PredictionMode m, int x, int y)
-{
-    uint8_t *dec, *p_l, *p_tl, *p_t, *p_tr;
-    uint8_t p[4];
-
-    dec  = GET_PIXEL(frame, x,     y);
-    p_l  = GET_PIXEL(frame, x - 1, y);
-    p_tl = GET_PIXEL(frame, x - 1, y - 1);
-    p_t  = GET_PIXEL(frame, x,     y - 1);
-    if (x == frame->width - 1)
-        p_tr = GET_PIXEL(frame, 0, y);
-    else
-        p_tr = GET_PIXEL(frame, x + 1, y - 1);
-
-    inverse_predict[m](p, p_l, p_tl, p_t, p_tr);
-
-    dec[0] += p[0];
-    dec[1] += p[1];
-    dec[2] += p[2];
-    dec[3] += p[3];
-}
-
-static int apply_predictor_transform(WebPContext *s)
-{
-    ImageContext *img  = &s->image[IMAGE_ROLE_ARGB];
-    ImageContext *pimg = &s->image[IMAGE_ROLE_PREDICTOR];
-    int x, y;
-
-    for (y = 0; y < img->frame->height; y++) {
-        for (x = 0; x < img->frame->width; x++) {
-            int tx = x >> pimg->size_reduction;
-            int ty = y >> pimg->size_reduction;
-            enum PredictionMode m = GET_PIXEL_COMP(pimg->frame, tx, ty, 2);
-
-            if (x == 0) {
-                if (y == 0)
-                    m = PRED_MODE_BLACK;
-                else
-                    m = PRED_MODE_T;
-            } else if (y == 0)
-                m = PRED_MODE_L;
-
-            if (m > 13) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "invalid predictor mode: %d\n", m);
-                return AVERROR_INVALIDDATA;
-            }
-            inverse_prediction(img->frame, m, x, y);
-        }
-    }
-    return 0;
-}
-
-static av_always_inline uint8_t color_transform_delta(uint8_t color_pred,
-                                                      uint8_t color)
-{
-    return (int)ff_u8_to_s8(color_pred) * ff_u8_to_s8(color) >> 5;
-}
-
-static int apply_color_transform(WebPContext *s)
-{
-    ImageContext *img, *cimg;
-    int x, y, cx, cy;
-    uint8_t *p, *cp;
-
-    img  = &s->image[IMAGE_ROLE_ARGB];
-    cimg = &s->image[IMAGE_ROLE_COLOR_TRANSFORM];
-
-    for (y = 0; y < img->frame->height; y++) {
-        for (x = 0; x < img->frame->width; x++) {
-            cx = x >> cimg->size_reduction;
-            cy = y >> cimg->size_reduction;
-            cp = GET_PIXEL(cimg->frame, cx, cy);
-            p  = GET_PIXEL(img->frame,   x,  y);
-
-            p[1] += color_transform_delta(cp[3], p[2]);
-            p[3] += color_transform_delta(cp[2], p[2]) +
-                    color_transform_delta(cp[1], p[1]);
-        }
-    }
-    return 0;
-}
-
-static int apply_subtract_green_transform(WebPContext *s)
-{
-    int x, y;
-    ImageContext *img = &s->image[IMAGE_ROLE_ARGB];
-
-    for (y = 0; y < img->frame->height; y++) {
-        for (x = 0; x < img->frame->width; x++) {
-            uint8_t *p = GET_PIXEL(img->frame, x, y);
-            p[1] += p[2];
-            p[3] += p[2];
-        }
-    }
-    return 0;
-}
-
-static int apply_color_indexing_transform(WebPContext *s)
-{
-    ImageContext *img;
-    ImageContext *pal;
-    int i, x, y;
-    uint8_t *p, *pi;
-
-    img = &s->image[IMAGE_ROLE_ARGB];
-    pal = &s->image[IMAGE_ROLE_COLOR_INDEXING];
-
-    if (pal->size_reduction > 0) {
-        GetBitContext gb_g;
-        uint8_t *line;
-        int pixel_bits = 8 >> pal->size_reduction;
-
-        line = av_malloc(img->frame->linesize[0]);
-        if (!line)
-            return AVERROR(ENOMEM);
-
-        for (y = 0; y < img->frame->height; y++) {
-            p = GET_PIXEL(img->frame, 0, y);
-            memcpy(line, p, img->frame->linesize[0]);
-            init_get_bits(&gb_g, line, img->frame->linesize[0] * 8);
-            skip_bits(&gb_g, 16);
-            i = 0;
-            for (x = 0; x < img->frame->width; x++) {
-                p    = GET_PIXEL(img->frame, x, y);
-                p[2] = get_bits(&gb_g, pixel_bits);
-                i++;
-                if (i == 1 << pal->size_reduction) {
-                    skip_bits(&gb_g, 24);
-                    i = 0;
-                }
-            }
-        }
-        av_free(line);
-    }
-
-    for (y = 0; y < img->frame->height; y++) {
-        for (x = 0; x < img->frame->width; x++) {
-            p = GET_PIXEL(img->frame, x, y);
-            i = p[2];
-            if (i >= pal->frame->width) {
-                av_log(s->avctx, AV_LOG_ERROR, "invalid palette index %d\n", i);
-                return AVERROR_INVALIDDATA;
-            }
-            pi = GET_PIXEL(pal->frame, i, 0);
-            AV_COPY32(p, pi);
-        }
-    }
-
-    return 0;
-}
-
-static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
-                                     int *got_frame, uint8_t *data_start,
-                                     unsigned int data_size, int is_alpha_chunk)
-{
-    WebPContext *s = avctx->priv_data;
-    int w, h, ret, i;
-
-    if (!is_alpha_chunk) {
-        s->lossless = 1;
-        avctx->pix_fmt = AV_PIX_FMT_ARGB;
-    }
-
-    ret = init_get_bits(&s->gb, data_start, data_size * 8);
-    if (ret < 0)
-        return ret;
-
-    if (!is_alpha_chunk) {
-        if (get_bits(&s->gb, 8) != 0x2F) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid WebP Lossless signature\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        w = get_bits(&s->gb, 14) + 1;
-        h = get_bits(&s->gb, 14) + 1;
-        if (s->width && s->width != w) {
-            av_log(avctx, AV_LOG_WARNING, "Width mismatch. %d != %d\n",
-                   s->width, w);
-        }
-        s->width = w;
-        if (s->height && s->height != h) {
-            av_log(avctx, AV_LOG_WARNING, "Height mismatch. %d != %d\n",
-                   s->width, w);
-        }
-        s->height = h;
-
-        ret = ff_set_dimensions(avctx, s->width, s->height);
-        if (ret < 0)
-            return ret;
-
-        s->has_alpha = get_bits1(&s->gb);
-
-        if (get_bits(&s->gb, 3) != 0x0) {
-            av_log(avctx, AV_LOG_ERROR, "Invalid WebP Lossless version\n");
-            return AVERROR_INVALIDDATA;
-        }
-    } else {
-        if (!s->width || !s->height)
-            return AVERROR_BUG;
-        w = s->width;
-        h = s->height;
-    }
-
-    /* parse transformations */
-    s->nb_transforms = 0;
-    s->reduced_width = 0;
-    while (get_bits1(&s->gb)) {
-        enum TransformType transform = get_bits(&s->gb, 2);
-        s->transforms[s->nb_transforms++] = transform;
-        switch (transform) {
-        case PREDICTOR_TRANSFORM:
-            ret = parse_transform_predictor(s);
-            break;
-        case COLOR_TRANSFORM:
-            ret = parse_transform_color(s);
-            break;
-        case COLOR_INDEXING_TRANSFORM:
-            ret = parse_transform_color_indexing(s);
-            break;
-        }
-        if (ret < 0)
-            goto free_and_return;
-    }
-
-    /* decode primary image */
-    s->image[IMAGE_ROLE_ARGB].frame = p;
-    if (is_alpha_chunk)
-        s->image[IMAGE_ROLE_ARGB].is_alpha_primary = 1;
-    ret = decode_entropy_coded_image(s, IMAGE_ROLE_ARGB, w, h);
-    if (ret < 0)
-        goto free_and_return;
-
-    /* apply transformations */
-    for (i = s->nb_transforms - 1; i >= 0; i--) {
-        switch (s->transforms[i]) {
-        case PREDICTOR_TRANSFORM:
-            ret = apply_predictor_transform(s);
-            break;
-        case COLOR_TRANSFORM:
-            ret = apply_color_transform(s);
-            break;
-        case SUBTRACT_GREEN:
-            ret = apply_subtract_green_transform(s);
-            break;
-        case COLOR_INDEXING_TRANSFORM:
-            ret = apply_color_indexing_transform(s);
-            break;
-        }
-        if (ret < 0)
-            goto free_and_return;
-    }
-
-    *got_frame   = 1;
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->key_frame = 1;
-    ret          = data_size;
-
-free_and_return:
-    for (i = 0; i < IMAGE_ROLE_NB; i++)
-        image_ctx_free(&s->image[i]);
-
-    return ret;
-}
-
-static void alpha_inverse_prediction(AVFrame *frame, enum AlphaFilter m)
-{
-    int x, y, ls;
-    uint8_t *dec;
-
-    ls = frame->linesize[3];
-
-    /* filter first row using horizontal filter */
-    dec = frame->data[3] + 1;
-    for (x = 1; x < frame->width; x++, dec++)
-        *dec += *(dec - 1);
-
-    /* filter first column using vertical filter */
-    dec = frame->data[3] + ls;
-    for (y = 1; y < frame->height; y++, dec += ls)
-        *dec += *(dec - ls);
-
-    /* filter the rest using the specified filter */
-    switch (m) {
-    case ALPHA_FILTER_HORIZONTAL:
-        for (y = 1; y < frame->height; y++) {
-            dec = frame->data[3] + y * ls + 1;
-            for (x = 1; x < frame->width; x++, dec++)
-                *dec += *(dec - 1);
-        }
-        break;
-    case ALPHA_FILTER_VERTICAL:
-        for (y = 1; y < frame->height; y++) {
-            dec = frame->data[3] + y * ls + 1;
-            for (x = 1; x < frame->width; x++, dec++)
-                *dec += *(dec - ls);
-        }
-        break;
-    case ALPHA_FILTER_GRADIENT:
-        for (y = 1; y < frame->height; y++) {
-            dec = frame->data[3] + y * ls + 1;
-            for (x = 1; x < frame->width; x++, dec++)
-                dec[0] += av_clip_uint8(*(dec - 1) + *(dec - ls) - *(dec - ls - 1));
-        }
-        break;
-    }
-}
-
-static int vp8_lossy_decode_alpha(AVCodecContext *avctx, AVFrame *p,
-                                  uint8_t *data_start,
-                                  unsigned int data_size)
-{
-    WebPContext *s = avctx->priv_data;
-    int x, y, ret;
-
-    if (s->alpha_compression == ALPHA_COMPRESSION_NONE) {
-        GetByteContext gb;
-
-        bytestream2_init(&gb, data_start, data_size);
-        for (y = 0; y < s->height; y++)
-            bytestream2_get_buffer(&gb, p->data[3] + p->linesize[3] * y,
-                                   s->width);
-    } else if (s->alpha_compression == ALPHA_COMPRESSION_VP8L) {
-        uint8_t *ap, *pp;
-        int alpha_got_frame = 0;
-
-        s->alpha_frame = av_frame_alloc();
-        if (!s->alpha_frame)
-            return AVERROR(ENOMEM);
-
-        ret = vp8_lossless_decode_frame(avctx, s->alpha_frame, &alpha_got_frame,
-                                        data_start, data_size, 1);
-        if (ret < 0) {
-            av_frame_free(&s->alpha_frame);
-            return ret;
-        }
-        if (!alpha_got_frame) {
-            av_frame_free(&s->alpha_frame);
-            return AVERROR_INVALIDDATA;
-        }
-
-        /* copy green component of alpha image to alpha plane of primary image */
-        for (y = 0; y < s->height; y++) {
-            ap = GET_PIXEL(s->alpha_frame, 0, y) + 2;
-            pp = p->data[3] + p->linesize[3] * y;
-            for (x = 0; x < s->width; x++) {
-                *pp = *ap;
-                pp++;
-                ap += 4;
-            }
-        }
-        av_frame_free(&s->alpha_frame);
-    }
-
-    /* apply alpha filtering */
-    if (s->alpha_filter)
-        alpha_inverse_prediction(p, s->alpha_filter);
-
-    return 0;
-}
-
-static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p,
-                                  int *got_frame, uint8_t *data_start,
-                                  unsigned int data_size)
-{
-    WebPContext *s = avctx->priv_data;
-    AVPacket pkt;
-    int ret;
-
-    if (!s->initialized) {
-        ff_vp8_decode_init(avctx);
-        s->initialized = 1;
-        if (s->has_alpha)
-            avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
-    }
-    s->lossless = 0;
-
-    if (data_size > INT_MAX) {
-        av_log(avctx, AV_LOG_ERROR, "unsupported chunk size\n");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    av_init_packet(&pkt);
-    pkt.data = data_start;
-    pkt.size = data_size;
-
-    ret = ff_vp8_decode_frame(avctx, p, got_frame, &pkt);
-    if (s->has_alpha) {
-        ret = vp8_lossy_decode_alpha(avctx, p, s->alpha_data,
-                                     s->alpha_data_size);
-        if (ret < 0)
-            return ret;
-    }
-    return ret;
-}
-
-static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                             AVPacket *avpkt)
-{
-    AVFrame * const p = data;
-    WebPContext *s = avctx->priv_data;
-    GetByteContext gb;
-    int ret;
-    uint32_t chunk_type, chunk_size;
-    int vp8x_flags = 0;
-
-    s->avctx     = avctx;
-    s->width     = 0;
-    s->height    = 0;
-    *got_frame   = 0;
-    s->has_alpha = 0;
-    bytestream2_init(&gb, avpkt->data, avpkt->size);
-
-    if (bytestream2_get_bytes_left(&gb) < 12)
-        return AVERROR_INVALIDDATA;
-
-    if (bytestream2_get_le32(&gb) != MKTAG('R', 'I', 'F', 'F')) {
-        av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    chunk_size = bytestream2_get_le32(&gb);
-    if (bytestream2_get_bytes_left(&gb) < chunk_size)
-        return AVERROR_INVALIDDATA;
-
-    if (bytestream2_get_le32(&gb) != MKTAG('W', 'E', 'B', 'P')) {
-        av_log(avctx, AV_LOG_ERROR, "missing WEBP tag\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    while (bytestream2_get_bytes_left(&gb) > 0) {
-        char chunk_str[5] = { 0 };
-
-        chunk_type = bytestream2_get_le32(&gb);
-        chunk_size = bytestream2_get_le32(&gb);
-        if (chunk_size == UINT32_MAX)
-            return AVERROR_INVALIDDATA;
-        chunk_size += chunk_size & 1;
-
-        if (bytestream2_get_bytes_left(&gb) < chunk_size)
-            return AVERROR_INVALIDDATA;
-
-        switch (chunk_type) {
-        case MKTAG('V', 'P', '8', ' '):
-            if (!*got_frame) {
-                ret = vp8_lossy_decode_frame(avctx, p, got_frame,
-                                             avpkt->data + bytestream2_tell(&gb),
-                                             chunk_size);
-                if (ret < 0)
-                    return ret;
-            }
-            bytestream2_skip(&gb, chunk_size);
-            break;
-        case MKTAG('V', 'P', '8', 'L'):
-            if (!*got_frame) {
-                ret = vp8_lossless_decode_frame(avctx, p, got_frame,
-                                                avpkt->data + bytestream2_tell(&gb),
-                                                chunk_size, 0);
-                if (ret < 0)
-                    return ret;
-            }
-            bytestream2_skip(&gb, chunk_size);
-            break;
-        case MKTAG('V', 'P', '8', 'X'):
-            vp8x_flags = bytestream2_get_byte(&gb);
-            bytestream2_skip(&gb, 3);
-            s->width  = bytestream2_get_le24(&gb) + 1;
-            s->height = bytestream2_get_le24(&gb) + 1;
-            ret = av_image_check_size(s->width, s->height, 0, avctx);
-            if (ret < 0)
-                return ret;
-            break;
-        case MKTAG('A', 'L', 'P', 'H'): {
-            int alpha_header, filter_m, compression;
-
-            if (!(vp8x_flags & VP8X_FLAG_ALPHA)) {
-                av_log(avctx, AV_LOG_WARNING,
-                       "ALPHA chunk present, but alpha bit not set in the "
-                       "VP8X header\n");
-            }
-            if (chunk_size == 0) {
-                av_log(avctx, AV_LOG_ERROR, "invalid ALPHA chunk size\n");
-                return AVERROR_INVALIDDATA;
-            }
-            alpha_header       = bytestream2_get_byte(&gb);
-            s->alpha_data      = avpkt->data + bytestream2_tell(&gb);
-            s->alpha_data_size = chunk_size - 1;
-            bytestream2_skip(&gb, s->alpha_data_size);
-
-            filter_m    = (alpha_header >> 2) & 0x03;
-            compression =  alpha_header       & 0x03;
-
-            if (compression > ALPHA_COMPRESSION_VP8L) {
-                av_log(avctx, AV_LOG_VERBOSE,
-                       "skipping unsupported ALPHA chunk\n");
-            } else {
-                s->has_alpha         = 1;
-                s->alpha_compression = compression;
-                s->alpha_filter      = filter_m;
-            }
-
-            break;
-        }
-        case MKTAG('I', 'C', 'C', 'P'):
-        case MKTAG('A', 'N', 'I', 'M'):
-        case MKTAG('A', 'N', 'M', 'F'):
-        case MKTAG('E', 'X', 'I', 'F'):
-        case MKTAG('X', 'M', 'P', ' '):
-            AV_WL32(chunk_str, chunk_type);
-            av_log(avctx, AV_LOG_VERBOSE, "skipping unsupported chunk: %s\n",
-                   chunk_str);
-            bytestream2_skip(&gb, chunk_size);
-            break;
-        default:
-            AV_WL32(chunk_str, chunk_type);
-            av_log(avctx, AV_LOG_VERBOSE, "skipping unknown chunk: %s\n",
-                   chunk_str);
-            bytestream2_skip(&gb, chunk_size);
-            break;
-        }
-    }
-
-    if (!*got_frame) {
-        av_log(avctx, AV_LOG_ERROR, "image data not found\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    return avpkt->size;
-}
-
-static av_cold int webp_decode_close(AVCodecContext *avctx)
-{
-    WebPContext *s = avctx->priv_data;
-
-    if (s->initialized)
-        return ff_vp8_decode_free(avctx);
-
-    return 0;
-}
-
-AVCodec ff_webp_decoder = {
-    .name           = "webp",
-    .long_name      = NULL_IF_CONFIG_SMALL("WebP image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WEBP,
-    .priv_data_size = sizeof(WebPContext),
-    .decode         = webp_decode_frame,
-    .close          = webp_decode_close,
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
-};
diff --git a/deps/libav/libavcodec/wma.c b/deps/libav/libavcodec/wma.c
deleted file mode 100644
index f5ea64a..0000000
--- a/deps/libav/libavcodec/wma.c
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * WMA compatible codec
- * Copyright (c) 2002-2007 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "sinewin.h"
-#include "wma.h"
-#include "wma_common.h"
-#include "wmadata.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-/* XXX: use same run/length optimization as mpeg decoders */
-//FIXME maybe split decode / encode or pass flag
-static av_cold void init_coef_vlc(VLC *vlc, uint16_t **prun_table,
-                                  float **plevel_table, uint16_t **pint_table,
-                                  const CoefVLCTable *vlc_table)
-{
-    int n = vlc_table->n;
-    const uint8_t  *table_bits   = vlc_table->huffbits;
-    const uint32_t *table_codes  = vlc_table->huffcodes;
-    const uint16_t *levels_table = vlc_table->levels;
-    uint16_t *run_table, *level_table, *int_table;
-    float *flevel_table;
-    int i, l, j, k, level;
-
-    init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
-
-    run_table   = av_malloc(n * sizeof(uint16_t));
-    level_table = av_malloc(n * sizeof(uint16_t));
-    flevel_table= av_malloc(n * sizeof(*flevel_table));
-    int_table   = av_malloc(n * sizeof(uint16_t));
-    i = 2;
-    level = 1;
-    k = 0;
-    while (i < n) {
-        int_table[k] = i;
-        l = levels_table[k++];
-        for (j = 0; j < l; j++) {
-            run_table[i]   = j;
-            level_table[i] = level;
-            flevel_table[i]= level;
-            i++;
-        }
-        level++;
-    }
-    *prun_table   = run_table;
-    *plevel_table = flevel_table;
-    *pint_table   = int_table;
-    av_free(level_table);
-}
-
-av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
-{
-    WMACodecContext *s = avctx->priv_data;
-    int i;
-    float bps1, high_freq;
-    volatile float bps;
-    int sample_rate1;
-    int coef_vlc_table;
-
-    if (   avctx->sample_rate <= 0 || avctx->sample_rate > 50000
-        || avctx->channels    <= 0 || avctx->channels    > 2
-        || avctx->bit_rate    <= 0)
-        return -1;
-
-    ff_fmt_convert_init(&s->fmt_conv, avctx);
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    if (avctx->codec->id == AV_CODEC_ID_WMAV1) {
-        s->version = 1;
-    } else {
-        s->version = 2;
-    }
-
-    /* compute MDCT block size */
-    s->frame_len_bits = ff_wma_get_frame_len_bits(avctx->sample_rate,
-                                                  s->version, 0);
-    s->next_block_len_bits = s->frame_len_bits;
-    s->prev_block_len_bits = s->frame_len_bits;
-    s->block_len_bits      = s->frame_len_bits;
-
-    s->frame_len = 1 << s->frame_len_bits;
-    if (s->use_variable_block_len) {
-        int nb_max, nb;
-        nb = ((flags2 >> 3) & 3) + 1;
-        if ((avctx->bit_rate / avctx->channels) >= 32000)
-            nb += 2;
-        nb_max = s->frame_len_bits - BLOCK_MIN_BITS;
-        if (nb > nb_max)
-            nb = nb_max;
-        s->nb_block_sizes = nb + 1;
-    } else {
-        s->nb_block_sizes = 1;
-    }
-
-    /* init rate dependent parameters */
-    s->use_noise_coding = 1;
-    high_freq = avctx->sample_rate * 0.5;
-
-    /* if version 2, then the rates are normalized */
-    sample_rate1 = avctx->sample_rate;
-    if (s->version == 2) {
-        if (sample_rate1 >= 44100) {
-            sample_rate1 = 44100;
-        } else if (sample_rate1 >= 22050) {
-            sample_rate1 = 22050;
-        } else if (sample_rate1 >= 16000) {
-            sample_rate1 = 16000;
-        } else if (sample_rate1 >= 11025) {
-            sample_rate1 = 11025;
-        } else if (sample_rate1 >= 8000) {
-            sample_rate1 = 8000;
-        }
-    }
-
-    bps = (float)avctx->bit_rate / (float)(avctx->channels * avctx->sample_rate);
-    s->byte_offset_bits = av_log2((int)(bps * s->frame_len / 8.0 + 0.5)) + 2;
-
-    /* compute high frequency value and choose if noise coding should
-       be activated */
-    bps1 = bps;
-    if (avctx->channels == 2)
-        bps1 = bps * 1.6;
-    if (sample_rate1 == 44100) {
-        if (bps1 >= 0.61) {
-            s->use_noise_coding = 0;
-        } else {
-            high_freq = high_freq * 0.4;
-        }
-    } else if (sample_rate1 == 22050) {
-        if (bps1 >= 1.16) {
-            s->use_noise_coding = 0;
-        } else if (bps1 >= 0.72) {
-            high_freq = high_freq * 0.7;
-        } else {
-            high_freq = high_freq * 0.6;
-        }
-    } else if (sample_rate1 == 16000) {
-        if (bps > 0.5) {
-            high_freq = high_freq * 0.5;
-        } else {
-            high_freq = high_freq * 0.3;
-        }
-    } else if (sample_rate1 == 11025) {
-        high_freq = high_freq * 0.7;
-    } else if (sample_rate1 == 8000) {
-        if (bps <= 0.625) {
-            high_freq = high_freq * 0.5;
-        } else if (bps > 0.75) {
-            s->use_noise_coding = 0;
-        } else {
-            high_freq = high_freq * 0.65;
-        }
-    } else {
-        if (bps >= 0.8) {
-            high_freq = high_freq * 0.75;
-        } else if (bps >= 0.6) {
-            high_freq = high_freq * 0.6;
-        } else {
-            high_freq = high_freq * 0.5;
-        }
-    }
-    av_dlog(s->avctx, "flags2=0x%x\n", flags2);
-    av_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
-            s->version, avctx->channels, avctx->sample_rate, avctx->bit_rate,
-            avctx->block_align);
-    av_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
-            bps, bps1, high_freq, s->byte_offset_bits);
-    av_dlog(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
-            s->use_noise_coding, s->use_exp_vlc, s->nb_block_sizes);
-
-    /* compute the scale factor band sizes for each MDCT block size */
-    {
-        int a, b, pos, lpos, k, block_len, i, j, n;
-        const uint8_t *table;
-
-        if (s->version == 1) {
-            s->coefs_start = 3;
-        } else {
-            s->coefs_start = 0;
-        }
-        for (k = 0; k < s->nb_block_sizes; k++) {
-            block_len = s->frame_len >> k;
-
-            if (s->version == 1) {
-                lpos = 0;
-                for (i = 0; i < 25; i++) {
-                    a = ff_wma_critical_freqs[i];
-                    b = avctx->sample_rate;
-                    pos = ((block_len * 2 * a) + (b >> 1)) / b;
-                    if (pos > block_len)
-                        pos = block_len;
-                    s->exponent_bands[0][i] = pos - lpos;
-                    if (pos >= block_len) {
-                        i++;
-                        break;
-                    }
-                    lpos = pos;
-                }
-                s->exponent_sizes[0] = i;
-            } else {
-                /* hardcoded tables */
-                table = NULL;
-                a = s->frame_len_bits - BLOCK_MIN_BITS - k;
-                if (a < 3) {
-                    if (avctx->sample_rate >= 44100) {
-                        table = exponent_band_44100[a];
-                    } else if (avctx->sample_rate >= 32000) {
-                        table = exponent_band_32000[a];
-                    } else if (avctx->sample_rate >= 22050) {
-                        table = exponent_band_22050[a];
-                    }
-                }
-                if (table) {
-                    n = *table++;
-                    for (i = 0; i < n; i++)
-                        s->exponent_bands[k][i] = table[i];
-                    s->exponent_sizes[k] = n;
-                } else {
-                    j = 0;
-                    lpos = 0;
-                    for (i = 0; i < 25; i++) {
-                        a = ff_wma_critical_freqs[i];
-                        b = avctx->sample_rate;
-                        pos = ((block_len * 2 * a) + (b << 1)) / (4 * b);
-                        pos <<= 2;
-                        if (pos > block_len)
-                            pos = block_len;
-                        if (pos > lpos)
-                            s->exponent_bands[k][j++] = pos - lpos;
-                        if (pos >= block_len)
-                            break;
-                        lpos = pos;
-                    }
-                    s->exponent_sizes[k] = j;
-                }
-            }
-
-            /* max number of coefs */
-            s->coefs_end[k] = (s->frame_len - ((s->frame_len * 9) / 100)) >> k;
-            /* high freq computation */
-            s->high_band_start[k] = (int)((block_len * 2 * high_freq) /
-                                          avctx->sample_rate + 0.5);
-            n = s->exponent_sizes[k];
-            j = 0;
-            pos = 0;
-            for (i = 0; i < n; i++) {
-                int start, end;
-                start = pos;
-                pos += s->exponent_bands[k][i];
-                end = pos;
-                if (start < s->high_band_start[k])
-                    start = s->high_band_start[k];
-                if (end > s->coefs_end[k])
-                    end = s->coefs_end[k];
-                if (end > start)
-                    s->exponent_high_bands[k][j++] = end - start;
-            }
-            s->exponent_high_sizes[k] = j;
-#if 0
-            tprintf(s->avctx, "%5d: coefs_end=%d high_band_start=%d nb_high_bands=%d: ",
-                    s->frame_len >> k,
-                    s->coefs_end[k],
-                    s->high_band_start[k],
-                    s->exponent_high_sizes[k]);
-            for (j = 0; j < s->exponent_high_sizes[k]; j++)
-                tprintf(s->avctx, " %d", s->exponent_high_bands[k][j]);
-            tprintf(s->avctx, "\n");
-#endif
-        }
-    }
-
-#ifdef TRACE
-    {
-        int i, j;
-        for (i = 0; i < s->nb_block_sizes; i++) {
-            tprintf(s->avctx, "%5d: n=%2d:",
-                    s->frame_len >> i,
-                    s->exponent_sizes[i]);
-            for (j = 0; j < s->exponent_sizes[i]; j++)
-                tprintf(s->avctx, " %d", s->exponent_bands[i][j]);
-            tprintf(s->avctx, "\n");
-        }
-    }
-#endif
-
-    /* init MDCT windows : simple sine window */
-    for (i = 0; i < s->nb_block_sizes; i++) {
-        ff_init_ff_sine_windows(s->frame_len_bits - i);
-        s->windows[i] = ff_sine_windows[s->frame_len_bits - i];
-    }
-
-    s->reset_block_lengths = 1;
-
-    if (s->use_noise_coding) {
-
-        /* init the noise generator */
-        if (s->use_exp_vlc) {
-            s->noise_mult = 0.02;
-        } else {
-            s->noise_mult = 0.04;
-        }
-
-#ifdef TRACE
-        for (i = 0; i < NOISE_TAB_SIZE; i++)
-            s->noise_table[i] = 1.0 * s->noise_mult;
-#else
-        {
-            unsigned int seed;
-            float norm;
-            seed = 1;
-            norm = (1.0 / (float)(1LL << 31)) * sqrt(3) * s->noise_mult;
-            for (i = 0; i < NOISE_TAB_SIZE; i++) {
-                seed = seed * 314159 + 1;
-                s->noise_table[i] = (float)((int)seed) * norm;
-            }
-        }
-#endif
-    }
-
-    /* choose the VLC tables for the coefficients */
-    coef_vlc_table = 2;
-    if (avctx->sample_rate >= 32000) {
-        if (bps1 < 0.72) {
-            coef_vlc_table = 0;
-        } else if (bps1 < 1.16) {
-            coef_vlc_table = 1;
-        }
-    }
-    s->coef_vlcs[0]= &coef_vlcs[coef_vlc_table * 2    ];
-    s->coef_vlcs[1]= &coef_vlcs[coef_vlc_table * 2 + 1];
-    init_coef_vlc(&s->coef_vlc[0], &s->run_table[0], &s->level_table[0], &s->int_table[0],
-                  s->coef_vlcs[0]);
-    init_coef_vlc(&s->coef_vlc[1], &s->run_table[1], &s->level_table[1], &s->int_table[1],
-                  s->coef_vlcs[1]);
-
-    return 0;
-}
-
-int ff_wma_total_gain_to_bits(int total_gain)
-{
-         if (total_gain < 15) return 13;
-    else if (total_gain < 32) return 12;
-    else if (total_gain < 40) return 11;
-    else if (total_gain < 45) return 10;
-    else                      return  9;
-}
-
-int ff_wma_end(AVCodecContext *avctx)
-{
-    WMACodecContext *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < s->nb_block_sizes; i++)
-        ff_mdct_end(&s->mdct_ctx[i]);
-
-    if (s->use_exp_vlc) {
-        ff_free_vlc(&s->exp_vlc);
-    }
-    if (s->use_noise_coding) {
-        ff_free_vlc(&s->hgain_vlc);
-    }
-    for (i = 0; i < 2; i++) {
-        ff_free_vlc(&s->coef_vlc[i]);
-        av_free(s->run_table[i]);
-        av_free(s->level_table[i]);
-        av_free(s->int_table[i]);
-    }
-
-    return 0;
-}
-
-/**
- * Decode an uncompressed coefficient.
- * @param gb GetBitContext
- * @return the decoded coefficient
- */
-unsigned int ff_wma_get_large_val(GetBitContext* gb)
-{
-    /** consumes up to 34 bits */
-    int n_bits = 8;
-    /** decode length */
-    if (get_bits1(gb)) {
-        n_bits += 8;
-        if (get_bits1(gb)) {
-            n_bits += 8;
-            if (get_bits1(gb)) {
-                n_bits += 7;
-            }
-        }
-    }
-    return get_bits_long(gb, n_bits);
-}
-
-/**
- * Decode run level compressed coefficients.
- * @param avctx codec context
- * @param gb bitstream reader context
- * @param vlc vlc table for get_vlc2
- * @param level_table level codes
- * @param run_table run codes
- * @param version 0 for wma1,2 1 for wmapro
- * @param ptr output buffer
- * @param offset offset in the output buffer
- * @param num_coefs number of input coefficents
- * @param block_len input buffer length (2^n)
- * @param frame_len_bits number of bits for escaped run codes
- * @param coef_nb_bits number of bits for escaped level codes
- * @return 0 on success, -1 otherwise
- */
-int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb,
-                            VLC *vlc,
-                            const float *level_table, const uint16_t *run_table,
-                            int version, WMACoef *ptr, int offset,
-                            int num_coefs, int block_len, int frame_len_bits,
-                            int coef_nb_bits)
-{
-    int code, level, sign;
-    const uint32_t *ilvl = (const uint32_t*)level_table;
-    uint32_t *iptr = (uint32_t*)ptr;
-    const unsigned int coef_mask = block_len - 1;
-    for (; offset < num_coefs; offset++) {
-        code = get_vlc2(gb, vlc->table, VLCBITS, VLCMAX);
-        if (code > 1) {
-            /** normal code */
-            offset += run_table[code];
-            sign = get_bits1(gb) - 1;
-            iptr[offset & coef_mask] = ilvl[code] ^ sign<<31;
-        } else if (code == 1) {
-            /** EOB */
-            break;
-        } else {
-            /** escape */
-            if (!version) {
-                level = get_bits(gb, coef_nb_bits);
-                /** NOTE: this is rather suboptimal. reading
-                    block_len_bits would be better */
-                offset += get_bits(gb, frame_len_bits);
-            } else {
-                level = ff_wma_get_large_val(gb);
-                /** escape decode */
-                if (get_bits1(gb)) {
-                    if (get_bits1(gb)) {
-                        if (get_bits1(gb)) {
-                            av_log(avctx,AV_LOG_ERROR,
-                                "broken escape sequence\n");
-                            return -1;
-                        } else
-                            offset += get_bits(gb, frame_len_bits) + 4;
-                    } else
-                        offset += get_bits(gb, 2) + 1;
-                }
-            }
-            sign = get_bits1(gb) - 1;
-            ptr[offset & coef_mask] = (level^sign) - sign;
-        }
-    }
-    /** NOTE: EOB can be omitted */
-    if (offset > num_coefs) {
-        av_log(avctx, AV_LOG_ERROR, "overflow in spectral RLE, ignoring\n");
-        return -1;
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavcodec/wma.h b/deps/libav/libavcodec/wma.h
deleted file mode 100644
index 513ba3f..0000000
--- a/deps/libav/libavcodec/wma.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * WMA compatible codec
- * Copyright (c) 2002-2007 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_WMA_H
-#define AVCODEC_WMA_H
-
-#include "libavutil/float_dsp.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "fft.h"
-#include "fmtconvert.h"
-
-/* size of blocks */
-#define BLOCK_MIN_BITS 7
-#define BLOCK_MAX_BITS 11
-#define BLOCK_MAX_SIZE (1 << BLOCK_MAX_BITS)
-
-#define BLOCK_NB_SIZES (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1)
-
-/* XXX: find exact max size */
-#define HIGH_BAND_MAX_SIZE 16
-
-#define NB_LSP_COEFS 10
-
-/* XXX: is it a suitable value ? */
-#define MAX_CODED_SUPERFRAME_SIZE 16384
-
-#define MAX_CHANNELS 2
-
-#define NOISE_TAB_SIZE 8192
-
-#define LSP_POW_BITS 7
-
-//FIXME should be in wmadec
-#define VLCBITS 9
-#define VLCMAX ((22+VLCBITS-1)/VLCBITS)
-
-typedef float WMACoef;          ///< type for decoded coefficients, int16_t would be enough for wma 1/2
-
-typedef struct CoefVLCTable {
-    int n;                      ///< total number of codes
-    int max_level;
-    const uint32_t *huffcodes;  ///< VLC bit values
-    const uint8_t *huffbits;    ///< VLC bit size
-    const uint16_t *levels;     ///< table to build run/level tables
-} CoefVLCTable;
-
-typedef struct WMACodecContext {
-    AVCodecContext* avctx;
-    GetBitContext gb;
-    PutBitContext pb;
-    int version;                            ///< 1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2)
-    int use_bit_reservoir;
-    int use_variable_block_len;
-    int use_exp_vlc;                        ///< exponent coding: 0 = lsp, 1 = vlc + delta
-    int use_noise_coding;                   ///< true if perceptual noise is added
-    int byte_offset_bits;
-    VLC exp_vlc;
-    int exponent_sizes[BLOCK_NB_SIZES];
-    uint16_t exponent_bands[BLOCK_NB_SIZES][25];
-    int high_band_start[BLOCK_NB_SIZES];    ///< index of first coef in high band
-    int coefs_start;                        ///< first coded coef
-    int coefs_end[BLOCK_NB_SIZES];          ///< max number of coded coefficients
-    int exponent_high_sizes[BLOCK_NB_SIZES];
-    int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE];
-    VLC hgain_vlc;
-
-    /* coded values in high bands */
-    int high_band_coded[MAX_CHANNELS][HIGH_BAND_MAX_SIZE];
-    int high_band_values[MAX_CHANNELS][HIGH_BAND_MAX_SIZE];
-
-    /* there are two possible tables for spectral coefficients */
-//FIXME the following 3 tables should be shared between decoders
-    VLC coef_vlc[2];
-    uint16_t *run_table[2];
-    float *level_table[2];
-    uint16_t *int_table[2];
-    const CoefVLCTable *coef_vlcs[2];
-    /* frame info */
-    int frame_len;                          ///< frame length in samples
-    int frame_len_bits;                     ///< frame_len = 1 << frame_len_bits
-    int nb_block_sizes;                     ///< number of block sizes
-    /* block info */
-    int reset_block_lengths;
-    int block_len_bits;                     ///< log2 of current block length
-    int next_block_len_bits;                ///< log2 of next block length
-    int prev_block_len_bits;                ///< log2 of prev block length
-    int block_len;                          ///< block length in samples
-    int block_num;                          ///< block number in current frame
-    int block_pos;                          ///< current position in frame
-    uint8_t ms_stereo;                      ///< true if mid/side stereo mode
-    uint8_t channel_coded[MAX_CHANNELS];    ///< true if channel is coded
-    int exponents_bsize[MAX_CHANNELS];      ///< log2 ratio frame/exp. length
-    DECLARE_ALIGNED(32, float, exponents)[MAX_CHANNELS][BLOCK_MAX_SIZE];
-    float max_exponent[MAX_CHANNELS];
-    WMACoef coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE];
-    DECLARE_ALIGNED(32, float, coefs)[MAX_CHANNELS][BLOCK_MAX_SIZE];
-    DECLARE_ALIGNED(32, FFTSample, output)[BLOCK_MAX_SIZE * 2];
-    FFTContext mdct_ctx[BLOCK_NB_SIZES];
-    float *windows[BLOCK_NB_SIZES];
-    /* output buffer for one frame and the last for IMDCT windowing */
-    DECLARE_ALIGNED(32, float, frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE * 2];
-    /* last frame info */
-    uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; /* padding added */
-    int last_bitoffset;
-    int last_superframe_len;
-    float noise_table[NOISE_TAB_SIZE];
-    int noise_index;
-    float noise_mult; /* XXX: suppress that and integrate it in the noise array */
-    /* lsp_to_curve tables */
-    float lsp_cos_table[BLOCK_MAX_SIZE];
-    float lsp_pow_e_table[256];
-    float lsp_pow_m_table1[(1 << LSP_POW_BITS)];
-    float lsp_pow_m_table2[(1 << LSP_POW_BITS)];
-    FmtConvertContext fmt_conv;
-    AVFloatDSPContext fdsp;
-
-#ifdef TRACE
-    int frame_count;
-#endif
-} WMACodecContext;
-
-extern const uint16_t ff_wma_critical_freqs[25];
-extern const uint16_t ff_wma_hgain_huffcodes[37];
-extern const uint8_t ff_wma_hgain_huffbits[37];
-extern const float ff_wma_lsp_codebook[NB_LSP_COEFS][16];
-extern const uint32_t ff_aac_scalefactor_code[121];
-extern const uint8_t  ff_aac_scalefactor_bits[121];
-
-int ff_wma_init(AVCodecContext * avctx, int flags2);
-int ff_wma_total_gain_to_bits(int total_gain);
-int ff_wma_end(AVCodecContext *avctx);
-unsigned int ff_wma_get_large_val(GetBitContext* gb);
-int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb,
-                            VLC *vlc,
-                            const float *level_table, const uint16_t *run_table,
-                            int version, WMACoef *ptr, int offset,
-                            int num_coefs, int block_len, int frame_len_bits,
-                            int coef_nb_bits);
-
-#endif /* AVCODEC_WMA_H */
diff --git a/deps/libav/libavcodec/wma_common.c b/deps/libav/libavcodec/wma_common.c
deleted file mode 100644
index d1d8045..0000000
--- a/deps/libav/libavcodec/wma_common.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * common code shared by all WMA variants
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "wma_common.h"
-
-/**
- *@brief Get the samples per frame for this stream.
- *@param sample_rate output sample_rate
- *@param version wma version
- *@param decode_flags codec compression features
- *@return log2 of the number of output samples per frame
- */
-av_cold int ff_wma_get_frame_len_bits(int sample_rate, int version,
-                                      unsigned int decode_flags)
-{
-
-    int frame_len_bits;
-
-    if (sample_rate <= 16000) {
-        frame_len_bits = 9;
-    } else if (sample_rate <= 22050 ||
-             (sample_rate <= 32000 && version == 1)) {
-        frame_len_bits = 10;
-    } else if (sample_rate <= 48000 || version < 3) {
-        frame_len_bits = 11;
-    } else if (sample_rate <= 96000) {
-        frame_len_bits = 12;
-    } else {
-        frame_len_bits = 13;
-    }
-
-    if (version == 3) {
-        int tmp = decode_flags & 0x6;
-        if (tmp == 0x2) {
-            ++frame_len_bits;
-        } else if (tmp == 0x4) {
-            --frame_len_bits;
-        } else if (tmp == 0x6) {
-            frame_len_bits -= 2;
-        }
-    }
-
-    return frame_len_bits;
-}
diff --git a/deps/libav/libavcodec/wma_common.h b/deps/libav/libavcodec/wma_common.h
deleted file mode 100644
index 61b1a35..0000000
--- a/deps/libav/libavcodec/wma_common.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * common code shared by all WMA variants
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_WMA_COMMON_H
-#define AVCODEC_WMA_COMMON_H
-
-int ff_wma_get_frame_len_bits(int sample_rate, int version,
-                              unsigned int decode_flags);
-
-#endif /* AVCODEC_WMA_COMMON_H */
diff --git a/deps/libav/libavcodec/wmadata.h b/deps/libav/libavcodec/wmadata.h
deleted file mode 100644
index 07a1afe..0000000
--- a/deps/libav/libavcodec/wmadata.h
+++ /dev/null
@@ -1,1403 +0,0 @@
-/*
- * WMA compatible decoder
- * copyright (c) 2002 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Various WMA tables.
- */
-
-#ifndef AVCODEC_WMADATA_H
-#define AVCODEC_WMADATA_H
-
-#include <stdint.h>
-#include "wma.h"
-
-const uint16_t ff_wma_critical_freqs[25] = {
-    100,   200,  300, 400,   510,  630,  770,    920,
-    1080, 1270, 1480, 1720, 2000, 2320, 2700,   3150,
-    3700, 4400, 5300, 6400, 7700, 9500, 12000, 15500,
-    24500,
-};
-
-/* first value is number of bands */
-static const uint8_t exponent_band_22050[3][25] = {
-    { 10, 4, 8, 4, 8, 8, 12, 20, 24, 24, 16, },
-    { 14, 4, 8, 8, 4, 12, 12, 16, 24, 16, 20, 24, 32, 40, 36, },
-    { 23, 4, 4, 4, 8, 4, 4, 8, 8, 8, 8, 8, 12, 12, 16, 16, 24, 24, 32, 44, 48, 60, 84, 72, },
-};
-
-static const uint8_t exponent_band_32000[3][25] = {
-    { 11, 4, 4, 8, 4, 4, 12, 16, 24, 20, 28, 4, },
-    { 15, 4, 8, 4, 4, 8, 8, 16, 20, 12, 20, 20, 28, 40, 56, 8, },
-    { 16, 8, 4, 8, 8, 12, 16, 20, 24, 40, 32, 32, 44, 56, 80, 112, 16, },
-};
-
-static const uint8_t exponent_band_44100[3][25] = {
-    { 12,  4,   4,   4,   4,   4,   8,   8,   8,  12,  16,  20,  36, },
-    { 15,  4,   8,   4,   8,   8,   4,   8,   8,  12,  12,  12,  24,  28,  40,  76, },
-    { 17,  4,   8,   8,   4,  12,  12,   8,   8,  24,  16,  20,  24,  32,  40,  60,  80, 152, },
-};
-
-const uint16_t ff_wma_hgain_huffcodes[37] = {
- 0x00003, 0x002e7, 0x00001, 0x005cd, 0x0005d, 0x005c9, 0x0005e, 0x00003,
- 0x00016, 0x0000b, 0x00001, 0x00006, 0x00001, 0x00006, 0x00004, 0x00005,
- 0x00004, 0x00007, 0x00003, 0x00007, 0x00004, 0x0000a, 0x0000a, 0x00002,
- 0x00003, 0x00000, 0x00005, 0x00002, 0x0005f, 0x00004, 0x00003, 0x00002,
- 0x005c8, 0x000b8, 0x005ca, 0x005cb, 0x005cc,
-};
-
-const uint8_t ff_wma_hgain_huffbits[37] = {
- 10, 12, 10, 13,  9, 13,  9,  8,
-  7,  5,  5,  4,  4,  3,  3,  3,
-  4,  3,  4,  4,  5,  5,  6,  8,
-  7, 10,  8, 10,  9,  8,  9,  9,
- 13, 10, 13, 13, 13,
-};
-
-const float ff_wma_lsp_codebook[NB_LSP_COEFS][16] = {
- { 1.98732877, 1.97944528, 1.97179088, 1.96260549, 1.95038374, 1.93336114, 1.90719232, 1.86191415, },
- { 1.97260000, 1.96083160, 1.94982586, 1.93806164, 1.92516608, 1.91010199, 1.89232331, 1.87149812,
-   1.84564818, 1.81358067, 1.77620070, 1.73265264, 1.67907855, 1.60959081, 1.50829650, 1.33120330, },
- { 1.90109110, 1.86482426, 1.83419671, 1.80168452, 1.76650116, 1.72816320, 1.68502700, 1.63738256,
-   1.58501580, 1.51795181, 1.43679906, 1.33950585, 1.24176208, 1.12260729, 0.96749668, 0.74048265, },
- { 1.76943864, 1.67822463, 1.59946365, 1.53560582, 1.47470796, 1.41210167, 1.34509536, 1.27339507,
-   1.19303814, 1.09765169, 0.98818722, 0.87239446, 0.74369172, 0.59768184, 0.43168630, 0.17977021, },
- { 1.43428349, 1.32038354, 1.21074086, 1.10577988, 1.00561746, 0.90335924, 0.80437489, 0.70709671,
-   0.60427395, 0.49814048, 0.38509539, 0.27106800, 0.14407416, 0.00219910, -0.16725141, -0.36936085, },
- { 0.99895687, 0.84188166, 0.70753739, 0.57906595, 0.47055563, 0.36966965, 0.26826648, 0.17163380,
-   0.07208392, -0.03062936, -1.40037388, -0.25128968, -0.37213937, -0.51075646, -0.64887512, -0.80308031, },
- { 0.26515280, 0.06313551, -0.08872080, -0.21103548, -0.31069678, -0.39680323, -0.47223474, -0.54167135,
-   -0.61444740, -0.68943343, -0.76580211, -0.85170082, -0.95289061, -1.06514703, -1.20510707, -1.37617746, },
- { -0.53940301, -0.73770929, -0.88424876, -1.01117930, -1.13389091, -1.26830073, -1.42041987, -1.62033919,
-   -1.10158808, -1.16512566, -1.23337128, -1.30414401, -1.37663312, -1.46853845, -1.57625798, -1.66893638, },
- { -0.38601997, -0.56009350, -0.66978483, -0.76028471, -0.83846064, -0.90868087, -0.97408881, -1.03694962, },
- { -1.56144989, -1.65944032, -1.72689685, -1.77857740, -1.82203011, -1.86220079, -1.90283983, -1.94820479, },
-};
-
-static const uint32_t coef0_huffcodes[666] = {
- 0x00258, 0x0003d, 0x00000, 0x00005, 0x00008, 0x00008, 0x0000c, 0x0001b,
- 0x0001f, 0x00015, 0x00024, 0x00032, 0x0003a, 0x00026, 0x0002c, 0x0002f,
- 0x0004a, 0x0004d, 0x00061, 0x00070, 0x00073, 0x00048, 0x00052, 0x0005a,
- 0x0005d, 0x0006e, 0x00099, 0x0009e, 0x000c1, 0x000ce, 0x000e4, 0x000f0,
- 0x00093, 0x0009e, 0x000a2, 0x000a1, 0x000b8, 0x000d2, 0x000d3, 0x0012e,
- 0x00130, 0x000de, 0x0012d, 0x0019b, 0x001e4, 0x00139, 0x0013a, 0x0013f,
- 0x0014f, 0x0016d, 0x001a2, 0x0027c, 0x0027e, 0x00332, 0x0033c, 0x0033f,
- 0x0038b, 0x00396, 0x003c5, 0x00270, 0x0027c, 0x0025a, 0x00395, 0x00248,
- 0x004bd, 0x004fb, 0x00662, 0x00661, 0x0071b, 0x004e6, 0x004ff, 0x00666,
- 0x0071c, 0x0071a, 0x0071f, 0x00794, 0x00536, 0x004e2, 0x0078e, 0x004ee,
- 0x00518, 0x00535, 0x004fb, 0x0078d, 0x00530, 0x00680, 0x0068f, 0x005cb,
- 0x00965, 0x006a6, 0x00967, 0x0097f, 0x00682, 0x006ae, 0x00cd0, 0x00e28,
- 0x00f13, 0x00f1f, 0x009f5, 0x00cd3, 0x00f11, 0x00926, 0x00964, 0x00f32,
- 0x00f12, 0x00f30, 0x00966, 0x00d0b, 0x00a68, 0x00b91, 0x009c7, 0x00b73,
- 0x012fa, 0x0131d, 0x013f9, 0x01ca0, 0x0199c, 0x01c7a, 0x0198c, 0x01248,
- 0x01c74, 0x01c64, 0x0139e, 0x012fd, 0x00a77, 0x012fc, 0x01c7b, 0x012ca,
- 0x014cc, 0x014d2, 0x014e3, 0x014dc, 0x012dc, 0x03344, 0x02598, 0x0263c,
- 0x0333b, 0x025e6, 0x01a1c, 0x01e3c, 0x014e2, 0x033d4, 0x01a11, 0x03349,
- 0x03cce, 0x014e1, 0x01a34, 0x0273e, 0x02627, 0x0273f, 0x038ee, 0x03971,
- 0x03c67, 0x03c61, 0x0333d, 0x038c2, 0x0263f, 0x038cd, 0x02638, 0x02e41,
- 0x0351f, 0x03348, 0x03c66, 0x03562, 0x02989, 0x027d5, 0x0333c, 0x02e4f,
- 0x0343b, 0x02ddf, 0x04bc8, 0x029c0, 0x02e57, 0x04c72, 0x025b7, 0x03547,
- 0x03540, 0x029d3, 0x04c45, 0x025bb, 0x06600, 0x04c73, 0x04bce, 0x0357b,
- 0x029a6, 0x029d2, 0x0263e, 0x0298a, 0x07183, 0x06602, 0x07958, 0x04b66,
- 0x0537d, 0x05375, 0x04fe9, 0x04b67, 0x0799f, 0x04bc9, 0x051fe, 0x06a3b,
- 0x05bb6, 0x04fa8, 0x0728f, 0x05376, 0x0492c, 0x0537e, 0x0795a, 0x06a3c,
- 0x0e515, 0x07887, 0x0683a, 0x051f9, 0x051fd, 0x0cc6a, 0x06a8a, 0x0cc6d,
- 0x05bb3, 0x0683b, 0x051fc, 0x05378, 0x0728e, 0x07886, 0x05bb7, 0x0f2a4,
- 0x0795b, 0x0683c, 0x09fc1, 0x0683d, 0x0b752, 0x09678, 0x0a3e8, 0x06ac7,
- 0x051f0, 0x0b759, 0x06af3, 0x04b6b, 0x0f2a0, 0x0f2ad, 0x096c3, 0x0e518,
- 0x0b75c, 0x0d458, 0x0cc6b, 0x0537c, 0x067aa, 0x04fea, 0x0343a, 0x0cc71,
- 0x0967f, 0x09fc4, 0x096c2, 0x0e516, 0x0f2a1, 0x0d45c, 0x0d45d, 0x0d45e,
- 0x12fb9, 0x0967e, 0x1982f, 0x09883, 0x096c4, 0x0b753, 0x12fb8, 0x0f2a8,
- 0x1ca21, 0x096c5, 0x0e51a, 0x1ca27, 0x12f3c, 0x0d471, 0x0f2aa, 0x0b75b,
- 0x12fbb, 0x0f2a9, 0x0f2ac, 0x0d45a, 0x0b74f, 0x096c8, 0x16e91, 0x096ca,
- 0x12fbf, 0x0d0a7, 0x13103, 0x0d516, 0x16e99, 0x12cbd, 0x0a3ea, 0x19829,
- 0x0b755, 0x29ba7, 0x1ca28, 0x29ba5, 0x16e93, 0x1982c, 0x19828, 0x25994,
- 0x0a3eb, 0x1ca29, 0x16e90, 0x1ca25, 0x1982d, 0x1ca26, 0x16e9b, 0x0b756,
- 0x0967c, 0x25997, 0x0b75f, 0x198d3, 0x0b757, 0x19a2a, 0x0d45b, 0x0e517,
- 0x1ca24, 0x1ca23, 0x1ca22, 0x0b758, 0x16e97, 0x0cd14, 0x13100, 0x00007,
- 0x0003b, 0x0006b, 0x00097, 0x00138, 0x00125, 0x00173, 0x00258, 0x00335,
- 0x0028e, 0x004c6, 0x00715, 0x00729, 0x004ef, 0x00519, 0x004ed, 0x00532,
- 0x0068c, 0x00686, 0x00978, 0x00e5d, 0x00e31, 0x009f4, 0x00b92, 0x012f8,
- 0x00d06, 0x00a67, 0x00d44, 0x00a76, 0x00d59, 0x012cd, 0x01c78, 0x01c75,
- 0x0199f, 0x0198f, 0x01c67, 0x014c6, 0x01c79, 0x01c76, 0x00b94, 0x00d1b,
- 0x01e32, 0x01e31, 0x01ab0, 0x01a05, 0x01aa1, 0x0333a, 0x025e5, 0x02626,
- 0x03541, 0x03544, 0x03421, 0x03546, 0x02e55, 0x02e56, 0x0492d, 0x02dde,
- 0x0299b, 0x02ddc, 0x0357a, 0x0249c, 0x0668b, 0x1c77f, 0x1ca20, 0x0d45f,
- 0x09886, 0x16e9a, 0x0f2a7, 0x0b751, 0x0a3ee, 0x0cf59, 0x0cf57, 0x0b754,
- 0x0d0a6, 0x16e98, 0x0b760, 0x06ac6, 0x0a3f0, 0x12fbe, 0x13104, 0x0f2a5,
- 0x0a3ef, 0x0d472, 0x12cba, 0x1982e, 0x16e9c, 0x1c77e, 0x198d0, 0x13105,
- 0x16e92, 0x0b75d, 0x0d459, 0x0001a, 0x000c0, 0x0016c, 0x003cd, 0x00350,
- 0x0067b, 0x0051e, 0x006a9, 0x009f4, 0x00b72, 0x00d09, 0x01249, 0x01e3d,
- 0x01ca1, 0x01a1f, 0x01721, 0x01a8a, 0x016e8, 0x03347, 0x01a35, 0x0249d,
- 0x0299a, 0x02596, 0x02e4e, 0x0298b, 0x07182, 0x04c46, 0x025ba, 0x02e40,
- 0x027d6, 0x04fe8, 0x06607, 0x05310, 0x09884, 0x072e1, 0x06a3d, 0x04b6a,
- 0x04c7a, 0x06603, 0x04c7b, 0x03428, 0x06605, 0x09664, 0x09fc0, 0x071de,
- 0x06601, 0x05bb2, 0x09885, 0x0a3e2, 0x1c61f, 0x12cbb, 0x0b750, 0x0cf58,
- 0x0967d, 0x25995, 0x668ad, 0x0b75a, 0x09fc2, 0x0537f, 0x0b75e, 0x13fae,
- 0x12fbc, 0x00031, 0x001c4, 0x004c5, 0x005b8, 0x00cf4, 0x0096f, 0x00d46,
- 0x01e57, 0x01a04, 0x02625, 0x03346, 0x028f9, 0x04c47, 0x072e0, 0x04b69,
- 0x03420, 0x07957, 0x06639, 0x0799e, 0x07959, 0x07881, 0x04b68, 0x09fc3,
- 0x09fd6, 0x0cc70, 0x0a3f1, 0x12cbe, 0x0e30e, 0x0e51b, 0x06af2, 0x12cbc,
- 0x1c77d, 0x0f2ab, 0x12fbd, 0x1aa2f, 0x0a3ec, 0x0d473, 0x05377, 0x0a3e9,
- 0x1982b, 0x0e300, 0x12f3f, 0x0cf5f, 0x096c0, 0x38c3c, 0x16e94, 0x16e95,
- 0x12f3d, 0x29ba4, 0x29ba6, 0x1c77c, 0x6a8ba, 0x3545c, 0x33457, 0x668ac,
- 0x6a8bb, 0x16e9d, 0x0e519, 0x25996, 0x12f3e, 0x00036, 0x0033e, 0x006ad,
- 0x00d03, 0x012c8, 0x0124a, 0x03c42, 0x03ccd, 0x06606, 0x07880, 0x06852,
- 0x06a3a, 0x05bb4, 0x0f2a2, 0x09fc7, 0x12cb9, 0x0cc6c, 0x0a6e8, 0x096c1,
- 0x0004a, 0x00355, 0x012f9, 0x014e8, 0x01abe, 0x025b6, 0x0492e, 0x09fc6,
- 0x051ff, 0x0cc6f, 0x096cb, 0x0d071, 0x198d1, 0x12cb8, 0x38c3d, 0x13faf,
- 0x096c9, 0x0009d, 0x00539, 0x012ce, 0x0341f, 0x029c1, 0x04b33, 0x0a3e3,
- 0x0d070, 0x16e96, 0x0b763, 0x000a0, 0x009ce, 0x038cc, 0x0343d, 0x051fa,
- 0x09888, 0x12fba, 0x000df, 0x00a75, 0x029a7, 0x09fc5, 0x0e301, 0x0967b,
- 0x001e7, 0x012c9, 0x051fb, 0x09889, 0x0f2a6, 0x0016f, 0x01cb9, 0x0cf5a,
- 0x12cbf, 0x09679, 0x00272, 0x01a15, 0x0967a, 0x003cb, 0x025f6, 0x0b762,
- 0x0028d, 0x03c60, 0x0cf5e, 0x00352, 0x03ccc, 0x0072f, 0x07186, 0x004ec,
- 0x05379, 0x0068e, 0x09887, 0x006a7, 0x06af1, 0x00e29, 0x0cf5b, 0x00f31,
- 0x0d470, 0x009c6, 0x013fb, 0x13102, 0x019a5, 0x13101, 0x01983, 0x01c65,
- 0x0124f, 0x014c7, 0x01726, 0x01abf, 0x03304, 0x02624, 0x03c41, 0x027d7,
- 0x02ddd, 0x02e54, 0x0343c, 0x06604, 0x07181, 0x0663a, 0x04fa9, 0x0663b,
- 0x05311, 0x0537a, 0x06839, 0x05bb5, 0x0492f, 0x06af0, 0x096c7, 0x0cc6e,
- 0x0537b, 0x0cf5c, 0x0cf56, 0x198d2, 0x0cf5d, 0x0a3ed, 0x0f2a3, 0x1982a,
- 0x0b761, 0x096c6,
-};
-
-static const uint8_t coef0_huffbits[666] = {
- 11,  6,  2,  3,  4,  5,  5,  5,
-  5,  6,  6,  6,  6,  7,  7,  7,
-  7,  7,  7,  7,  7,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9,  9,  9,  9, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 10, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 12, 12, 11, 12,
- 12, 12, 12, 11, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 13, 13, 12,
- 12, 12, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 13, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 15, 14, 14, 15, 15, 15, 14, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 14, 15, 15, 15, 15, 16,
- 16, 16, 15, 16, 15, 15, 16, 16,
- 16, 16, 15, 16, 16, 16, 15, 16,
- 16, 15, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 15, 15, 16, 16,
- 15, 16, 16, 16, 17, 17, 17, 16,
- 16, 17, 16, 16, 16, 16, 17, 16,
- 17, 17, 16, 16, 15, 15, 15, 16,
- 17, 16, 17, 16, 16, 17, 17, 17,
- 17, 17, 17, 16, 17, 17, 17, 16,
- 17, 17, 16, 17, 17, 17, 16, 17,
- 17, 16, 16, 17, 17, 17, 18, 17,
- 17, 17, 17, 17, 18, 18, 17, 17,
- 17, 19, 17, 19, 18, 17, 17, 18,
- 17, 17, 18, 17, 17, 17, 18, 17,
- 17, 18, 17, 17, 17, 17, 17, 16,
- 17, 17, 17, 17, 18, 16, 17,  4,
-  6,  8,  9,  9, 10, 10, 10, 10,
- 11, 11, 11, 11, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 14, 13, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 14,
- 15, 15, 15, 15, 15, 15, 16, 15,
- 15, 15, 15, 15, 15, 17, 17, 17,
- 16, 18, 16, 17, 17, 16, 16, 17,
- 17, 18, 17, 16, 17, 17, 17, 16,
- 17, 17, 18, 17, 18, 17, 17, 17,
- 18, 17, 17,  5,  8, 10, 10, 11,
- 11, 12, 12, 12, 13, 13, 14, 13,
- 13, 14, 14, 14, 14, 14, 14, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 16, 16, 15, 16, 16,
- 15, 15, 15, 15, 15, 16, 16, 15,
- 15, 16, 16, 17, 17, 18, 17, 16,
- 17, 18, 19, 17, 16, 16, 17, 17,
- 17,  6,  9, 11, 12, 12, 13, 13,
- 13, 14, 14, 14, 15, 15, 15, 16,
- 15, 15, 15, 15, 15, 15, 16, 16,
- 16, 16, 17, 18, 16, 16, 16, 18,
- 17, 16, 17, 18, 17, 17, 16, 17,
- 17, 16, 17, 16, 17, 18, 18, 18,
- 17, 19, 19, 17, 20, 19, 18, 19,
- 20, 18, 16, 18, 17,  7, 10, 12,
- 13, 13, 14, 14, 14, 15, 15, 16,
- 16, 16, 16, 16, 18, 16, 17, 17,
-  8, 11, 13, 14, 14, 15, 16, 16,
- 16, 16, 17, 17, 17, 18, 18, 17,
- 17,  8, 12, 14, 15, 15, 15, 17,
- 17, 18, 17,  9, 12, 14, 15, 16,
- 16, 17,  9, 13, 15, 16, 16, 17,
-  9, 13, 16, 16, 16, 10, 13, 16,
- 18, 17, 10, 14, 17, 10, 14, 17,
- 11, 14, 16, 11, 14, 11, 15, 12,
- 16, 12, 16, 12, 16, 12, 16, 12,
- 17, 13, 13, 17, 13, 17, 13, 13,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 15, 15, 15, 15, 15, 15, 16, 15,
- 16, 16, 16, 16, 16, 16, 17, 16,
- 16, 16, 16, 17, 16, 17, 16, 17,
- 17, 17,
-};
-
-static const uint32_t coef1_huffcodes[555] = {
- 0x00115, 0x00002, 0x00001, 0x00000, 0x0000d, 0x00007, 0x00013, 0x0001d,
- 0x00008, 0x0000c, 0x00023, 0x0002b, 0x0003f, 0x00017, 0x0001b, 0x00043,
- 0x00049, 0x00050, 0x00055, 0x00054, 0x00067, 0x00064, 0x0007b, 0x0002d,
- 0x00028, 0x0002a, 0x00085, 0x00089, 0x0002b, 0x00035, 0x00090, 0x00091,
- 0x00094, 0x00088, 0x000c1, 0x000c6, 0x000f2, 0x000e3, 0x000c5, 0x000e2,
- 0x00036, 0x000f0, 0x000a7, 0x000cd, 0x000fb, 0x00059, 0x00116, 0x00103,
- 0x00108, 0x0012b, 0x0012d, 0x00188, 0x0012e, 0x0014c, 0x001c3, 0x00187,
- 0x001e7, 0x0006f, 0x00094, 0x00069, 0x001e6, 0x001ca, 0x00147, 0x00195,
- 0x000a7, 0x00213, 0x00209, 0x00303, 0x00295, 0x00289, 0x0028c, 0x0028d,
- 0x00312, 0x00330, 0x0029b, 0x00308, 0x00328, 0x0029a, 0x0025e, 0x003c5,
- 0x00384, 0x0039f, 0x00397, 0x00296, 0x0032e, 0x00332, 0x003c6, 0x003e6,
- 0x0012d, 0x000d1, 0x00402, 0x000dd, 0x00161, 0x0012b, 0x00127, 0x0045d,
- 0x00601, 0x004ab, 0x0045f, 0x00410, 0x004bf, 0x00528, 0x0045c, 0x00424,
- 0x00400, 0x00511, 0x00618, 0x0073d, 0x0063a, 0x00614, 0x0073c, 0x007c0,
- 0x007cf, 0x00802, 0x00966, 0x00964, 0x00951, 0x008a0, 0x00346, 0x00803,
- 0x00a52, 0x0024a, 0x007c1, 0x0063f, 0x00126, 0x00406, 0x00789, 0x008a2,
- 0x00960, 0x00967, 0x00c05, 0x00c70, 0x00c79, 0x00a5d, 0x00c26, 0x00c4d,
- 0x00372, 0x008a5, 0x00c08, 0x002c5, 0x00f11, 0x00cc4, 0x00f8e, 0x00e16,
- 0x00496, 0x00e77, 0x00f9c, 0x00c25, 0x00f1e, 0x00c27, 0x00f1f, 0x00e17,
- 0x00ccd, 0x00355, 0x00c09, 0x00c78, 0x00f90, 0x00521, 0x00357, 0x00356,
- 0x0068e, 0x00f9d, 0x00c04, 0x00e58, 0x00a20, 0x00a2c, 0x00c4c, 0x0052f,
- 0x00f8d, 0x01178, 0x01053, 0x01097, 0x0180f, 0x0180d, 0x012fb, 0x012aa,
- 0x0202a, 0x00a40, 0x018ed, 0x01ceb, 0x01455, 0x018e3, 0x012a1, 0x00354,
- 0x00353, 0x00f1c, 0x00c7b, 0x00c37, 0x0101d, 0x012cb, 0x01142, 0x0197d,
- 0x01095, 0x01e3b, 0x0186b, 0x00588, 0x01c2a, 0x014b8, 0x01e3a, 0x018ec,
- 0x01f46, 0x012fa, 0x00a53, 0x01ce8, 0x00a55, 0x01c29, 0x0117b, 0x01052,
- 0x012a0, 0x00589, 0x00950, 0x01c2b, 0x00a50, 0x0208b, 0x0180e, 0x02027,
- 0x02556, 0x01e20, 0x006e7, 0x01c28, 0x0197a, 0x00684, 0x020a2, 0x01f22,
- 0x03018, 0x039cf, 0x03e25, 0x02557, 0x0294c, 0x028a6, 0x00d11, 0x028a9,
- 0x02979, 0x00d46, 0x00a56, 0x039ce, 0x030cc, 0x0329a, 0x0149d, 0x0510f,
- 0x0451c, 0x02028, 0x03299, 0x01ced, 0x014b9, 0x00f85, 0x00c7a, 0x01800,
- 0x00341, 0x012ca, 0x039c8, 0x0329d, 0x00d0d, 0x03e20, 0x05144, 0x00d45,
- 0x030d0, 0x0186d, 0x030d5, 0x00d0f, 0x00d40, 0x04114, 0x020a1, 0x0297f,
- 0x03e24, 0x032f1, 0x04047, 0x030d4, 0x028a8, 0x00d0e, 0x0451d, 0x04044,
- 0x0297e, 0x04042, 0x030d2, 0x030cf, 0x03e21, 0x03e26, 0x028a5, 0x0451a,
- 0x00d48, 0x01a16, 0x00d44, 0x04518, 0x0149b, 0x039ca, 0x01498, 0x0403d,
- 0x0451b, 0x0149c, 0x032f3, 0x030cb, 0x08073, 0x03e22, 0x0529a, 0x020aa,
- 0x039cc, 0x0738a, 0x06530, 0x07389, 0x06193, 0x08071, 0x04043, 0x030ce,
- 0x05147, 0x07388, 0x05145, 0x08072, 0x04521, 0x00d47, 0x0297c, 0x030cd,
- 0x030ca, 0x0000b, 0x0000c, 0x00083, 0x000e4, 0x00048, 0x00102, 0x001cc,
- 0x001f5, 0x00097, 0x0020b, 0x00124, 0x00453, 0x00627, 0x00639, 0x00605,
- 0x00517, 0x001b8, 0x00663, 0x00667, 0x007c3, 0x00823, 0x00961, 0x00963,
- 0x00e5a, 0x00e59, 0x00a2b, 0x00cbf, 0x00292, 0x00a2d, 0x007d0, 0x00953,
- 0x00cc5, 0x00f84, 0x004ab, 0x014a7, 0x0068a, 0x0117a, 0x0052e, 0x01442,
- 0x0052c, 0x00c77, 0x00f8f, 0x004aa, 0x01094, 0x01801, 0x012c4, 0x0297b,
- 0x00952, 0x01f19, 0x006a5, 0x01149, 0x012c5, 0x01803, 0x022f2, 0x0329b,
- 0x04520, 0x0149e, 0x00d13, 0x01f16, 0x01ce9, 0x0101c, 0x006e6, 0x039c9,
- 0x06191, 0x07c8e, 0x06192, 0x0ca63, 0x039cd, 0x06190, 0x06884, 0x06885,
- 0x07382, 0x00d49, 0x00d41, 0x0450c, 0x0149a, 0x030d1, 0x08077, 0x03e23,
- 0x01a15, 0x0e701, 0x0e702, 0x08079, 0x0822a, 0x0a218, 0x07887, 0x0403f,
- 0x0520b, 0x0529b, 0x0e700, 0x04519, 0x00007, 0x000e0, 0x000d0, 0x0039b,
- 0x003e5, 0x00163, 0x0063e, 0x007c9, 0x00806, 0x00954, 0x01044, 0x01f44,
- 0x0197c, 0x01f45, 0x00a51, 0x01f47, 0x00951, 0x0052d, 0x02291, 0x0092f,
- 0x00a54, 0x00d12, 0x0297d, 0x00d0c, 0x01499, 0x0329e, 0x032f0, 0x02025,
- 0x039c6, 0x00a57, 0x03e46, 0x00d42, 0x0738b, 0x05146, 0x04046, 0x08078,
- 0x0510e, 0x07886, 0x02904, 0x04156, 0x04157, 0x06032, 0x030d3, 0x08bce,
- 0x04040, 0x0403e, 0x0a414, 0x10457, 0x08075, 0x06887, 0x07c8f, 0x039c7,
- 0x07387, 0x08070, 0x08bcf, 0x1482a, 0x10456, 0x1482b, 0x01a17, 0x06886,
- 0x0450d, 0x00013, 0x0006b, 0x00615, 0x0080b, 0x0082b, 0x00952, 0x00e5b,
- 0x018e2, 0x0186c, 0x01f18, 0x0329f, 0x00d43, 0x03e29, 0x05140, 0x05141,
- 0x0ca62, 0x06033, 0x03c42, 0x03e28, 0x0450f, 0x0a21a, 0x07384, 0x0a219,
- 0x0e703, 0x0a21b, 0x01a14, 0x07383, 0x045e6, 0x0007a, 0x0012c, 0x00ccc,
- 0x0068f, 0x01802, 0x00a52, 0x00953, 0x04045, 0x01a20, 0x0451f, 0x000a4,
- 0x00735, 0x01cec, 0x02029, 0x020a3, 0x0451e, 0x00069, 0x00c24, 0x02024,
- 0x032f2, 0x05142, 0x00196, 0x00523, 0x000a6, 0x0197b, 0x0030b, 0x0092e,
- 0x003e9, 0x03e27, 0x00160, 0x05143, 0x00652, 0x04041, 0x00734, 0x028a7,
- 0x0080f, 0x01483, 0x0097c, 0x00340, 0x0068b, 0x00522, 0x01054, 0x01096,
- 0x01f17, 0x0202b, 0x01cea, 0x020a0, 0x02978, 0x02026, 0x0297a, 0x039cb,
- 0x03e2b, 0x0149f, 0x0329c, 0x07385, 0x08074, 0x0450e, 0x03e2a, 0x05149,
- 0x08076, 0x07386, 0x05148,
-};
-
-static const uint8_t coef1_huffbits[555] = {
-  9,  5,  2,  4,  4,  5,  5,  5,
-  6,  6,  6,  6,  6,  7,  7,  7,
-  7,  7,  7,  7,  7,  7,  7,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  8,  8,  8,  8,  8,  8,  8,  8,
-  9,  8,  8,  8,  8,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9, 10, 10, 10,  9,  9,  9,  9,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 11, 11, 11, 11, 11, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 13, 12, 12, 12, 12, 12, 12, 12,
- 13, 12, 12, 12, 12, 12, 12, 12,
- 12, 13, 12, 12, 12, 13, 13, 13,
- 13, 12, 12, 12, 12, 12, 12, 13,
- 12, 13, 13, 13, 13, 13, 13, 13,
- 14, 14, 13, 13, 13, 13, 13, 13,
- 13, 12, 12, 12, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 14, 13, 14, 13, 13, 13,
- 13, 13, 14, 13, 14, 14, 13, 14,
- 14, 13, 14, 13, 13, 14, 14, 13,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 15, 14, 14, 14, 14, 15, 15,
- 15, 14, 14, 13, 13, 12, 12, 13,
- 13, 13, 14, 14, 15, 14, 15, 15,
- 14, 13, 14, 15, 15, 15, 14, 14,
- 14, 14, 15, 14, 14, 15, 15, 15,
- 14, 15, 14, 14, 14, 14, 14, 15,
- 15, 16, 15, 15, 15, 14, 15, 15,
- 15, 15, 14, 14, 16, 14, 15, 14,
- 14, 15, 15, 15, 15, 16, 15, 14,
- 15, 15, 15, 16, 15, 15, 14, 14,
- 14,  4,  7,  8,  8,  9,  9,  9,
-  9, 10, 10, 11, 11, 11, 11, 11,
- 11, 12, 11, 11, 11, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 11, 12,
- 12, 12, 13, 13, 13, 13, 13, 13,
- 13, 12, 12, 13, 13, 13, 13, 14,
- 14, 13, 14, 13, 13, 13, 14, 14,
- 15, 15, 14, 13, 13, 13, 14, 14,
- 15, 15, 15, 16, 14, 15, 17, 17,
- 15, 15, 15, 15, 15, 14, 16, 14,
- 16, 16, 16, 16, 16, 16, 15, 15,
- 17, 15, 16, 15,  6,  8, 10, 10,
- 10, 11, 11, 11, 12, 12, 13, 13,
- 13, 13, 14, 13, 14, 13, 14, 14,
- 14, 14, 14, 15, 15, 14, 14, 14,
- 14, 14, 14, 15, 15, 15, 15, 16,
- 15, 15, 16, 15, 15, 15, 14, 16,
- 15, 15, 18, 17, 16, 17, 15, 14,
- 15, 16, 16, 19, 17, 19, 16, 17,
- 15,  7, 10, 11, 12, 12, 12, 12,
- 13, 13, 13, 14, 15, 14, 15, 15,
- 16, 15, 14, 14, 15, 16, 15, 16,
- 16, 16, 16, 15, 15,  7, 11, 12,
- 13, 13, 14, 14, 15, 15, 15,  8,
- 11, 13, 14, 14, 15,  9, 12, 14,
- 14, 15,  9, 13, 10, 13, 10, 14,
- 10, 14, 11, 15, 11, 15, 11, 14,
- 12, 15, 12, 13, 13, 13, 13, 13,
- 13, 14, 13, 14, 14, 14, 14, 14,
- 14, 15, 14, 15, 16, 15, 14, 15,
- 16, 15, 15,
-};
-
-static const uint32_t coef2_huffcodes[1336] = {
- 0x003e6, 0x000f6, 0x00000, 0x00002, 0x00006, 0x0000f, 0x0001b, 0x00028,
- 0x00039, 0x0003f, 0x0006b, 0x00076, 0x000b7, 0x000e8, 0x000ef, 0x00169,
- 0x001a7, 0x001d4, 0x001dc, 0x002c4, 0x00349, 0x00355, 0x00391, 0x003dc,
- 0x00581, 0x005b2, 0x00698, 0x0070c, 0x00755, 0x0073a, 0x00774, 0x007cf,
- 0x00b0a, 0x00b66, 0x00d2e, 0x00d5e, 0x00e1b, 0x00eac, 0x00e5a, 0x00f7e,
- 0x00fa1, 0x0163e, 0x01a37, 0x01a52, 0x01c39, 0x01ab3, 0x01d5f, 0x01cb6,
- 0x01f52, 0x01dd9, 0x02c04, 0x02c2e, 0x02c2d, 0x02c23, 0x03467, 0x034a3,
- 0x0351b, 0x03501, 0x03a5d, 0x0351c, 0x03875, 0x03dea, 0x0397b, 0x039db,
- 0x03df1, 0x039d8, 0x03bb4, 0x0580a, 0x0584d, 0x05842, 0x05b13, 0x058ea,
- 0x0697d, 0x06a06, 0x068cc, 0x06ac7, 0x06a96, 0x072f4, 0x07543, 0x072b4,
- 0x07d20, 0x0b003, 0x073b5, 0x07be6, 0x0d180, 0x07bd1, 0x07cb8, 0x07d06,
- 0x07d25, 0x0d2f2, 0x0d19a, 0x0d334, 0x0e1dc, 0x0d529, 0x0d584, 0x0e1d2,
- 0x0e5e3, 0x0eec4, 0x0e564, 0x0fa49, 0x16001, 0x0eedc, 0x0f7fa, 0x1a32c,
- 0x16131, 0x16003, 0x0f9c8, 0x1ef80, 0x1d2a0, 0x1aa4b, 0x0f7ce, 0x1abfe,
- 0x1aa50, 0x1a458, 0x1a816, 0x1cae4, 0x1d2fe, 0x1d52e, 0x1aa4c, 0x2c245,
- 0x1d2a1, 0x1a35d, 0x1ca1b, 0x1d5d8, 0x1f531, 0x1ca1c, 0x1f389, 0x1f4af,
- 0x3a5e7, 0x351fb, 0x2c24b, 0x34bce, 0x2c24d, 0x2c249, 0x2c24a, 0x72dfc,
- 0x357ef, 0x35002, 0x3a5e6, 0x39431, 0x5843b, 0x34a77, 0x58431, 0x3a5f3,
- 0x3a5dd, 0x3e5e5, 0x356bd, 0x3976e, 0x6a3d2, 0x3500d, 0x694c4, 0x580bd,
- 0x3e5e8, 0x74b95, 0x34a6e, 0x3977c, 0x39432, 0x5b0d2, 0x6a3d8, 0x580b8,
- 0x5b0cb, 0x5b0d7, 0x72dee, 0x72ded, 0x72dec, 0x74b9c, 0x3977f, 0x72dea,
- 0x74b9e, 0x7be7d, 0x580bf, 0x5b0d5, 0x7cba8, 0x74b91, 0x3e5dd, 0xb6171,
- 0xd46b3, 0xd46b9, 0x7cba1, 0x74b9f, 0x72de1, 0xe59f5, 0x3e5eb, 0x00004,
- 0x00015, 0x00038, 0x00075, 0x000e8, 0x001d3, 0x00347, 0x0039c, 0x00690,
- 0x0074a, 0x00b60, 0x00e93, 0x00f74, 0x0163d, 0x01a5a, 0x01d24, 0x01cbe,
- 0x01f4b, 0x03468, 0x03562, 0x03947, 0x03e82, 0x05804, 0x05b12, 0x05803,
- 0x0696d, 0x06a9e, 0x0697c, 0x06978, 0x06afb, 0x074b2, 0x072f5, 0x073c0,
- 0x07541, 0x06944, 0x074b7, 0x070d3, 0x07ba9, 0x0b0b1, 0x0d1af, 0x0e1dd,
- 0x0e5e2, 0x0e1a3, 0x0eec3, 0x1612f, 0x0e961, 0x0eeda, 0x0e78e, 0x0fa48,
- 0x1612c, 0x0e511, 0x0e565, 0x0e953, 0x1aa4a, 0x0e59d, 0x1d52c, 0x1a811,
- 0x1cae7, 0x1abfc, 0x1d52d, 0x1cacf, 0x1cf05, 0x2c254, 0x34a72, 0x1f4ac,
- 0x3976b, 0x34a71, 0x2c6d9, 0x2d873, 0x34a6a, 0x357e7, 0x3464c, 0x3e5f5,
- 0x58433, 0x1f53a, 0x3500a, 0x357ea, 0x34a73, 0x3942f, 0x357e5, 0x39775,
- 0x694cd, 0x39772, 0x7cba5, 0x6a3ef, 0x35483, 0x74b98, 0x5b0c1, 0x39770,
- 0x3a5d7, 0x39433, 0x39434, 0x694ce, 0x580be, 0x3e5ff, 0x6a3ec, 0xb616f,
- 0xd46b1, 0x6a3d1, 0x72de5, 0x74b6e, 0x72de9, 0x3e700, 0xd46b6, 0x6a3e9,
- 0x74b69, 0xe5675, 0xd46b8, 0x7cbaa, 0x3a5d1, 0x0000c, 0x0003c, 0x000eb,
- 0x001f1, 0x003a4, 0x006a8, 0x007d5, 0x00d43, 0x00e77, 0x016c5, 0x01cb1,
- 0x02c5d, 0x03a55, 0x03a56, 0x03e51, 0x03bb5, 0x05b0a, 0x06a9f, 0x074b8,
- 0x07d28, 0x0d187, 0x0d40e, 0x0d52e, 0x0d425, 0x0eae3, 0x0e1d3, 0x1612e,
- 0x0e59e, 0x0eec2, 0x0e578, 0x0e51a, 0x0e579, 0x0e515, 0x0e960, 0x0d183,
- 0x0d220, 0x0d2cb, 0x0e512, 0x16c3e, 0x16002, 0x16c42, 0x1cae9, 0x3461a,
- 0x1d2fa, 0x1a308, 0x1a849, 0x1cf07, 0x1f38f, 0x34b65, 0x2c253, 0x1ef9e,
- 0x1cbc3, 0x1cbc1, 0x2c255, 0x1f384, 0x58435, 0x2c5cd, 0x3a5f7, 0x2c252,
- 0x3959c, 0x2c6d8, 0x3a5d3, 0x6ad78, 0x6a3f2, 0x7cba9, 0xb6176, 0x72deb,
- 0x39764, 0x3e5f6, 0x3a5d8, 0x74a8c, 0x6a3e6, 0x694d1, 0x6ad79, 0x1a4592,
- 0xe59fb, 0x7cbb3, 0x5b0cd, 0x00017, 0x000b5, 0x002c3, 0x005b7, 0x00b1c,
- 0x00e5c, 0x0163f, 0x01ab2, 0x01efa, 0x0348a, 0x0396e, 0x058da, 0x06963,
- 0x06a30, 0x072cd, 0x073cf, 0x07ce7, 0x0d2ca, 0x0d2d8, 0x0e764, 0x0e794,
- 0x16008, 0x16167, 0x1617e, 0x1aa49, 0x1a30b, 0x1a813, 0x2c6da, 0x1a580,
- 0x1cbc2, 0x0f9ca, 0x1617f, 0x1d2fe, 0x0f7fc, 0x16c40, 0x0e513, 0x0eec5,
- 0x0f7c3, 0x1d508, 0x1a81e, 0x1d2fd, 0x39430, 0x35486, 0x3e5fd, 0x2c24c,
- 0x2c75a, 0x34a74, 0x3a5f4, 0x3464d, 0x694ca, 0x3a5f1, 0x1d509, 0x1d5c0,
- 0x34648, 0x3464e, 0x6a3d5, 0x6a3e8, 0x6a3e7, 0x5b0c3, 0x2c248, 0x1f38a,
- 0x3a5f2, 0x6a3e5, 0x00029, 0x00168, 0x0058c, 0x00b67, 0x00f9d, 0x01c3d,
- 0x01cbf, 0x02c20, 0x0351d, 0x03df6, 0x06af9, 0x072b5, 0x0b1d7, 0x0b0b2,
- 0x0d40a, 0x0d52b, 0x0e952, 0x0e797, 0x163c3, 0x1c3a0, 0x1f386, 0x1ca21,
- 0x34655, 0x2c247, 0x1f53b, 0x2c250, 0x2c24f, 0x1f385, 0x1ef5d, 0x1cf15,
- 0x1caea, 0x1ab0a, 0x1cf19, 0x1f53d, 0x1d5c2, 0x1d2fb, 0x1ef58, 0x34a78,
- 0x357ec, 0x1f533, 0x3a5e1, 0x694d2, 0x58482, 0x3a5ee, 0x2c6dc, 0x357eb,
- 0x5b0c4, 0x39778, 0x6a3e1, 0x7cbb4, 0x3a5e1, 0x74b68, 0x3a5ef, 0x3a5d2,
- 0x39424, 0x72de2, 0xe59f6, 0xe59f7, 0x3e702, 0x3e5ec, 0x1f38b, 0x0003b,
- 0x001f0, 0x00777, 0x00fa8, 0x01cb2, 0x02d84, 0x03a57, 0x03dd6, 0x06917,
- 0x06a11, 0x07d07, 0x0eae2, 0x0e796, 0x0f9c9, 0x0f7fb, 0x16166, 0x16160,
- 0x1ab1b, 0x1abfa, 0x2d87b, 0x1d2f7, 0x39768, 0x1f38c, 0x34653, 0x34651,
- 0x6a3d9, 0x35001, 0x3abbd, 0x38742, 0x39426, 0x34a76, 0x3a5ec, 0x34a75,
- 0x35000, 0x35488, 0x1cf10, 0x2c6db, 0x357ed, 0x357e8, 0x357e9, 0x3a5f0,
- 0x694c2, 0xb6178, 0x72df5, 0x39425, 0x3942b, 0x74b6d, 0x74b6f, 0xb6177,
- 0xb6179, 0x74b6a, 0xb6172, 0x58487, 0x3e5ee, 0x3e5ed, 0x72df2, 0x72df4,
- 0x7cbae, 0x6a3ca, 0x70e86, 0x34bcf, 0x6a3c8, 0x00059, 0x00384, 0x00d5b,
- 0x01c38, 0x03560, 0x0395b, 0x0584e, 0x06964, 0x073cd, 0x0b1e7, 0x0e798,
- 0x0e78d, 0x0fa43, 0x1a848, 0x1a32f, 0x1aa4e, 0x3464a, 0x1f4ab, 0x1f38d,
- 0x3a5eb, 0x3a5d4, 0x3548a, 0x6a3c7, 0x5b0d0, 0x6a3c5, 0x7cbb0, 0x694cb,
- 0x3a5e5, 0x3e5e2, 0x3942c, 0x2d872, 0x1f4ae, 0x3a5d5, 0x694d3, 0x58481,
- 0x35009, 0x39774, 0x58432, 0xb616c, 0x5b0db, 0x3548b, 0xb6174, 0x1d5d95,
- 0xb004c, 0x7cbb2, 0x3a5e5, 0x74a8f, 0xe59f9, 0x72df6, 0xe59fd, 0x7cbad,
- 0xd427d, 0x72cff, 0x3977a, 0x5b0d9, 0xb616d, 0xb616b, 0x1a4593, 0x7cbaf,
- 0x5b0da, 0x00071, 0x003eb, 0x01603, 0x02c6c, 0x03961, 0x068c8, 0x06a31,
- 0x072bd, 0x0d2c2, 0x0e51b, 0x0e5e6, 0x1abfb, 0x1d2ff, 0x1cae5, 0x1ef5c,
- 0x1ef5e, 0x1cf13, 0x34a6d, 0x3976d, 0xb616a, 0x3e5f2, 0x6a3c4, 0xb6169,
- 0x3e5dc, 0x580b9, 0x74b99, 0x75764, 0x58434, 0x3a5d9, 0x6945a, 0x69459,
- 0x3548c, 0x3a5e9, 0x69457, 0x72df1, 0x6945e, 0x6a35e, 0x3e701, 0xb6168,
- 0x5b0dd, 0x3a5de, 0x6a3c2, 0xd4278, 0x6a3cc, 0x72dfd, 0xb6165, 0x16009a,
- 0x7cbb1, 0xd427c, 0xb6162, 0xe765e, 0x1cecbe, 0x7cbb6, 0x69454, 0xb6160,
- 0xd427a, 0x1d5d96, 0xb1d6d, 0xe59f4, 0x72de8, 0x3a5db, 0x0007a, 0x006ae,
- 0x01c3c, 0x03aba, 0x058e9, 0x072cc, 0x0d2dd, 0x0d22d, 0x0eec1, 0x0eedb,
- 0x1d2a2, 0x1ef5b, 0x357e2, 0x3abbf, 0x1d2f9, 0x35004, 0x3a5dc, 0x351fc,
- 0x3976c, 0x6a3c6, 0x6a3cb, 0x3e5ea, 0xe59f3, 0x6a3ce, 0x69452, 0xe59f0,
- 0x74b90, 0xd4279, 0xd427b, 0x7cbb5, 0x5b0c5, 0x3a5e3, 0x3a5e2, 0x000d0,
- 0x00775, 0x01efe, 0x03dd5, 0x0728c, 0x07cb9, 0x0e1a2, 0x0ea85, 0x0eed8,
- 0x1a30a, 0x1aa4f, 0x3a5df, 0x35008, 0x3a5e0, 0x3e5f4, 0x3e5f7, 0xb1d6c,
- 0x5843e, 0x34a70, 0x72df8, 0x74b6b, 0xd427f, 0x72df0, 0x5b0bf, 0x5b0c0,
- 0xd46b0, 0x72def, 0xe59f8, 0x162e64, 0xb1d6f, 0x3a5e0, 0x39427, 0x69166,
- 0x6a3e2, 0x6a3e3, 0x74a8d, 0xd427e, 0x1d5d97, 0xd46b4, 0x5b0d8, 0x6a3d3,
- 0x000e0, 0x00b63, 0x034cc, 0x06a33, 0x073c9, 0x0e1a0, 0x0f7fd, 0x0f9cc,
- 0x1617d, 0x1caeb, 0x1f4a9, 0x3abb3, 0x69450, 0x39420, 0x39777, 0x3e5e0,
- 0x6a3d4, 0x6a3ed, 0xb6166, 0xe59f1, 0xb1d6e, 0xe5676, 0x6a3ea, 0xe5674,
- 0xb6163, 0xd46b7, 0x7cba6, 0xd46ba, 0x1d5d94, 0xb6164, 0x6a3f1, 0x7cba2,
- 0x69451, 0x72dfa, 0xd46bb, 0x72df7, 0x74b94, 0x1cecbf, 0xe59fa, 0x16009b,
- 0x6a3e4, 0x000e6, 0x00e94, 0x03876, 0x070ef, 0x0d52a, 0x16015, 0x16014,
- 0x1abf9, 0x1cf17, 0x34a79, 0x34650, 0x3e705, 0x6a3d0, 0x58430, 0x74b9d,
- 0x7be7e, 0x5b0be, 0x39773, 0x6a3de, 0x000fb, 0x00f7b, 0x03dd7, 0x07bd0,
- 0x0e59c, 0x0f9cd, 0x1cf18, 0x1d2ff, 0x34a7a, 0x39429, 0x3500c, 0x72de0,
- 0x69456, 0x7be7c, 0xd46b5, 0xd46b2, 0x6a3dd, 0x001a2, 0x0163b, 0x06913,
- 0x0b016, 0x0fa42, 0x1a32d, 0x1cf06, 0x34a7c, 0x34a7d, 0xb6161, 0x35481,
- 0x3e5fa, 0x7cba0, 0x7be7f, 0x7cba3, 0x7cba7, 0x5b0d3, 0x72de6, 0x6a3dc,
- 0x001a9, 0x01ab4, 0x06a34, 0x0d46a, 0x16130, 0x1ef5f, 0x1f532, 0x1f536,
- 0x3942e, 0x58436, 0x6a3db, 0x6945b, 0x001c9, 0x01ca0, 0x0728b, 0x0eed9,
- 0x1f539, 0x1ca1d, 0x39765, 0x39766, 0x58439, 0x6945d, 0x39767, 0x001d3,
- 0x01f2c, 0x07bfc, 0x16161, 0x34652, 0x3a5ed, 0x3548d, 0x58438, 0x6a3da,
- 0x002c1, 0x02c5e, 0x0d335, 0x1ab1a, 0x2d874, 0x35006, 0x35484, 0x5b0cc,
- 0x74b9a, 0x72df3, 0x6a3d6, 0x002da, 0x034b3, 0x0d5ae, 0x1caee, 0x2d871,
- 0x357e3, 0x74b97, 0x72df9, 0x580ba, 0x5b0d4, 0x0034d, 0x0354e, 0x0f750,
- 0x1cbc0, 0x3a5e7, 0x3a5e4, 0x00385, 0x03a58, 0x16c41, 0x2c5cf, 0x3e5e1,
- 0x74b6c, 0xe5677, 0x6a3df, 0x00390, 0x03e50, 0x163c2, 0x2d876, 0x35482,
- 0x5b0d6, 0x5843a, 0x0039f, 0x0585e, 0x1a583, 0x3500f, 0x74b93, 0x39771,
- 0x003e4, 0x06912, 0x16c43, 0x357e1, 0x0058a, 0x0696f, 0x1f538, 0x5b0c9,
- 0x6a3cf, 0x005b6, 0x06af8, 0x1f534, 0x58483, 0x6a3e0, 0x00695, 0x07d02,
- 0x1cae8, 0x58485, 0x006a2, 0x0754a, 0x357ee, 0x3977b, 0x00748, 0x074b2,
- 0x34a7b, 0x00729, 0x0b1e0, 0x34649, 0x3e5e3, 0x0073d, 0x0d2c4, 0x3e5e6,
- 0x007bb, 0x0b099, 0x39762, 0x5b0ce, 0x6945f, 0x007d1, 0x0d5ab, 0x39779,
- 0x007d3, 0x0d52f, 0x39763, 0x6945c, 0x00b1a, 0x0d2c5, 0x35489, 0x00d23,
- 0x0eaed, 0x3e5f8, 0x00d32, 0x16016, 0x3e5fb, 0x00d41, 0x0e768, 0x3a5ed,
- 0x00e1f, 0x16017, 0x58027, 0x00ead, 0x0fa07, 0x69455, 0x00e54, 0x1612b,
- 0x00e55, 0x1a581, 0x00f78, 0x1a32b, 0x580bc, 0x6a3ee, 0x00f79, 0x1abfd,
- 0x00f95, 0x1ab18, 0x6a3f0, 0x01637, 0x1aa4d, 0x0162d, 0x1f53c, 0x6a3f3,
- 0x01a31, 0x1a810, 0x39769, 0x01a50, 0x1caef, 0x01a36, 0x1a32e, 0x01a67,
- 0x1f38e, 0x01a85, 0x1ef59, 0x01aa6, 0x1ef83, 0x01d51, 0x2c012, 0x01d53,
- 0x2d879, 0x01d5e, 0x35005, 0x01cba, 0x1cf04, 0x69453, 0x01d2d, 0x351ff,
- 0x01f2d, 0x2d86f, 0x01f29, 0x35007, 0x02c22, 0x351fa, 0x02c03, 0x3a5ec,
- 0x02c5f, 0x3a5eb, 0x02c58, 0x34a6b, 0x03469, 0x356be, 0x02c59, 0x34a6c,
- 0x0346a, 0x3a5ea, 0x034bd, 0x034bf, 0x356bf, 0x0386a, 0x03ab9, 0x5843f,
- 0x0386b, 0x3a5f5, 0x03a4b, 0x39421, 0x03aa4, 0x3a5e9, 0x03a5a, 0x03960,
- 0x3977e, 0x03de9, 0x03958, 0x03df7, 0x039e1, 0x3e5e4, 0x0395f, 0x69458,
- 0x03e91, 0x03df2, 0x39428, 0x058f2, 0x03e80, 0x6a3c3, 0x03e93, 0x694c0,
- 0x058b8, 0x5b0ca, 0x0584f, 0x694c1, 0x058f1, 0x068d6, 0x06a10, 0x06ac3,
- 0x06a32, 0x070d2, 0x06911, 0x074b1, 0x07494, 0x06ad4, 0x06ad6, 0x072b8,
- 0x06afa, 0x074b3, 0x07540, 0x073ce, 0x0b005, 0x074b3, 0x07495, 0x074b9,
- 0x0d336, 0x07bff, 0x07763, 0x073c8, 0x07d29, 0x0b622, 0x0d221, 0x0d181,
- 0x0b1d1, 0x074b8, 0x0b1d0, 0x0d19b, 0x0d2c3, 0x0b172, 0x0d2dc, 0x0b623,
- 0x0d5aa, 0x0d426, 0x0d182, 0x0e795, 0x0e1d1, 0x0d337, 0x0e96c, 0x0e5e4,
- 0x0e514, 0x0eaee, 0x16000, 0x0e767, 0x0e1a1, 0x0e78f, 0x16004, 0x0f7c2,
- 0x0e799, 0x0e5e7, 0x0e566, 0x0e769, 0x0f751, 0x0eede, 0x0fa06, 0x16005,
- 0x0fa9f, 0x1a5e6, 0x0e766, 0x1636f, 0x0eedd, 0x0eec0, 0x1a309, 0x1ceca,
- 0x163cd, 0x0f9cb, 0x0eedf, 0x1a582, 0x1612d, 0x0e5e5, 0x1abf8, 0x1a30c,
- 0x1ca1f, 0x163cc, 0x1a35c, 0x1ca1e, 0x1aa51, 0x163ac, 0x1a84e, 0x1a53f,
- 0x1cf16, 0x1d2fc, 0x1a5b3, 0x1ab19, 0x1a81f, 0x1d5c3, 0x16c3f, 0x1d5c1,
- 0x1d2fc, 0x1f4aa, 0x1a812, 0x1f535, 0x1cf12, 0x1a817, 0x1617c, 0x1ab0b,
- 0x1d2f8, 0x1ef82, 0x2d87a, 0x1d52f, 0x1f530, 0x1aa48, 0x35487, 0x1d2fd,
- 0x1f4ad, 0x1cf11, 0x3461b, 0x35485, 0x1ca20, 0x1caed, 0x1cae6, 0x1abff,
- 0x3464f, 0x34a6f, 0x1ef81, 0x3464b, 0x39d96, 0x1f383, 0x1f537, 0x1cf14,
- 0x2c5ce, 0x3500e, 0x2c251, 0x1caec, 0x1f387, 0x34654, 0x357e4, 0x2d878,
- 0x3500b, 0x35480, 0x3a5e8, 0x3548e, 0x34b64, 0x1f4a8, 0x35003, 0x3e5df,
- 0x2d870, 0x357e6, 0x3e5f0, 0x1ef5a, 0x3a5ea, 0x1f388, 0x3e703, 0x2c24e,
- 0x3a5e2, 0x351fd, 0x2c6dd, 0x3e704, 0x351fe, 0x2d875, 0x5b0c7, 0x3976a,
- 0x3a5e6, 0x39423, 0x58480, 0x2c246, 0x3a5e3, 0x2d877, 0x3e5f1, 0x3abbe,
- 0x58489, 0x3e5f9, 0x357e0, 0x3abbc, 0x5b0c6, 0x69167, 0x69165, 0x3e5e9,
- 0x39422, 0x3976f, 0x3977d, 0x3e5de, 0x6a3c9, 0x58b98, 0x3a5f6, 0x3a5d0,
- 0x58486, 0x6a3c1, 0x3e5fc, 0x5b0dc, 0x3548f, 0x3942d, 0x694c9, 0x58484,
- 0x3a5e8, 0x74b9b, 0x74b96, 0x694d0, 0x58488, 0x3a5e4, 0x3942a, 0x72ec2,
- 0x39776, 0x5b0d1, 0x5b0cf, 0x3a5d6, 0xe59fc, 0x5b0c8, 0x3e5e7, 0x7cbb7,
- 0x70e87, 0x7cbab, 0x5b0c2, 0x694c3, 0x74a8e, 0x3e5f3, 0x6a3cd, 0x72dfe,
- 0x73b2e, 0x72ec0, 0x694c5, 0x58437, 0x694c8, 0x72dff, 0x39435, 0x5843d,
- 0x6a3d7, 0x72ec1, 0xd22c8, 0x694cf, 0xb6173, 0x3e5fe, 0x580bb, 0xe59f2,
- 0xb616e, 0xb6175, 0x3a5da, 0x5b0bd, 0x694cc, 0x5843c, 0x694c7, 0x74b92,
- 0x72ec3, 0x694c6, 0xb6170, 0x7cbac, 0xb1733, 0x7cba4, 0xb6167, 0x72de7,
- 0x72de4, 0x6a3c0, 0x3e5ef, 0x162e65, 0x72de3, 0x72dfb, 0x6a35f, 0x6a3eb,
-};
-
-static const uint8_t coef2_huffbits[1336] = {
- 11,  9,  2,  3,  4,  4,  5,  6,
-  6,  7,  7,  8,  8,  8,  9,  9,
-  9,  9, 10, 10, 10, 10, 11, 11,
- 11, 11, 11, 11, 11, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 16, 15, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 18, 17, 17, 17, 17,
- 17, 17, 17, 18, 18, 17, 17, 18,
- 17, 17, 18, 17, 18, 18, 18, 18,
- 19, 18, 18, 18, 18, 18, 18, 20,
- 18, 18, 18, 19, 19, 18, 19, 18,
- 19, 19, 18, 19, 19, 18, 19, 19,
- 19, 19, 18, 19, 19, 19, 19, 19,
- 19, 19, 20, 20, 20, 19, 19, 20,
- 19, 20, 19, 19, 20, 19, 19, 20,
- 20, 20, 20, 19, 20, 21, 19,  3,
-  5,  7,  8,  9,  9, 10, 11, 11,
- 12, 12, 12, 13, 13, 13, 13, 14,
- 14, 14, 14, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 16, 16,
- 15, 15, 15, 15, 16, 16, 16, 16,
- 17, 16, 17, 17, 16, 17, 17, 17,
- 17, 17, 17, 16, 17, 17, 17, 17,
- 18, 17, 17, 18, 18, 18, 18, 18,
- 19, 18, 18, 18, 18, 18, 18, 19,
- 19, 18, 18, 18, 18, 19, 18, 19,
- 19, 19, 20, 19, 18, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 20,
- 20, 19, 20, 19, 20, 19, 20, 19,
- 19, 21, 20, 20, 19,  4,  7,  8,
- 10, 11, 11, 12, 12, 13, 13, 14,
- 14, 14, 14, 15, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 16, 17,
- 17, 17, 17, 17, 17, 17, 16, 16,
- 16, 16, 17, 17, 17, 17, 18, 18,
- 18, 17, 17, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 19, 18, 18, 18,
- 19, 18, 19, 19, 19, 20, 20, 20,
- 19, 19, 19, 19, 19, 19, 19, 21,
- 21, 20, 19,  5,  8, 10, 11, 12,
- 13, 13, 13, 14, 14, 15, 15, 15,
- 15, 16, 16, 16, 16, 16, 17, 17,
- 17, 17, 17, 17, 17, 17, 18, 17,
- 18, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 19, 18, 19, 18,
- 18, 18, 18, 18, 19, 18, 17, 17,
- 18, 18, 19, 19, 19, 19, 18, 18,
- 18, 19,  6,  9, 11, 12, 13, 13,
- 14, 14, 14, 15, 15, 16, 16, 16,
- 16, 16, 16, 17, 17, 17, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 17, 18, 18, 17, 18, 18, 18,
- 18, 18, 18, 19, 19, 18, 18, 18,
- 19, 19, 19, 20, 19, 19, 18, 19,
- 19, 20, 21, 21, 19, 19, 18,  6,
- 10, 12, 13, 14, 14, 14, 15, 15,
- 15, 16, 16, 17, 17, 17, 17, 17,
- 17, 17, 18, 18, 19, 18, 18, 18,
- 19, 18, 18, 18, 19, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 19, 20, 20, 19, 19, 19, 19, 20,
- 20, 19, 20, 19, 19, 19, 20, 20,
- 20, 19, 19, 18, 19,  7, 10, 12,
- 13, 14, 15, 15, 15, 16, 16, 17,
- 17, 17, 17, 17, 17, 18, 18, 18,
- 18, 19, 18, 19, 19, 19, 20, 19,
- 18, 19, 19, 18, 18, 19, 19, 19,
- 18, 19, 19, 20, 19, 18, 20, 21,
- 20, 20, 19, 19, 21, 20, 21, 20,
- 20, 20, 19, 19, 20, 20, 21, 20,
- 19,  7, 11, 13, 14, 15, 15, 15,
- 16, 16, 17, 17, 17, 17, 18, 18,
- 18, 18, 18, 19, 20, 19, 19, 20,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 18, 18, 19, 20, 19, 19, 19, 20,
- 19, 19, 19, 20, 19, 20, 20, 21,
- 20, 20, 20, 21, 22, 20, 19, 20,
- 20, 21, 20, 21, 20, 19,  8, 11,
- 13, 14, 15, 16, 16, 16, 17, 17,
- 17, 18, 18, 18, 18, 18, 19, 18,
- 19, 19, 19, 19, 21, 19, 19, 21,
- 19, 20, 20, 20, 19, 18, 18,  8,
- 12, 14, 15, 16, 16, 16, 16, 17,
- 17, 17, 19, 18, 18, 19, 19, 20,
- 19, 18, 20, 19, 20, 20, 19, 19,
- 20, 20, 21, 21, 20, 19, 19, 19,
- 19, 19, 19, 20, 21, 20, 19, 19,
-  8, 12, 14, 15, 16, 16, 17, 17,
- 17, 18, 18, 18, 19, 19, 19, 19,
- 19, 19, 20, 21, 20, 21, 19, 21,
- 20, 20, 20, 20, 21, 20, 19, 20,
- 19, 20, 20, 20, 19, 22, 21, 21,
- 19,  9, 12, 14, 15, 16, 17, 17,
- 17, 18, 18, 18, 19, 19, 19, 19,
- 20, 19, 19, 19,  9, 13, 15, 16,
- 17, 17, 18, 18, 18, 19, 18, 20,
- 19, 20, 20, 20, 19,  9, 13, 15,
- 16, 17, 17, 18, 18, 18, 20, 18,
- 19, 20, 20, 20, 20, 19, 20, 19,
-  9, 13, 15, 16, 17, 18, 18, 18,
- 19, 19, 19, 19, 10, 14, 16, 17,
- 18, 18, 19, 19, 19, 19, 19, 10,
- 14, 16, 17, 18, 18, 18, 19, 19,
- 10, 14, 16, 17, 18, 18, 18, 19,
- 19, 20, 19, 10, 14, 16, 18, 18,
- 18, 19, 20, 19, 19, 10, 14, 17,
- 18, 18, 18, 10, 15, 17, 18, 19,
- 19, 21, 19, 11, 15, 17, 18, 18,
- 19, 19, 11, 15, 17, 18, 19, 19,
- 11, 15, 17, 18, 11, 15, 18, 19,
- 19, 11, 15, 18, 19, 19, 11, 16,
- 18, 19, 11, 15, 18, 19, 11, 16,
- 18, 12, 16, 18, 19, 12, 16, 19,
- 12, 16, 19, 19, 19, 12, 16, 19,
- 12, 16, 19, 19, 12, 16, 18, 12,
- 16, 19, 12, 17, 19, 12, 17, 19,
- 12, 17, 19, 12, 17, 19, 13, 17,
- 13, 17, 13, 17, 19, 19, 13, 17,
- 13, 17, 19, 13, 17, 13, 18, 19,
- 13, 17, 19, 13, 18, 13, 17, 13,
- 18, 13, 18, 13, 18, 13, 18, 13,
- 18, 13, 18, 14, 18, 19, 14, 18,
- 14, 18, 14, 18, 14, 18, 14, 19,
- 14, 19, 14, 18, 14, 18, 14, 18,
- 14, 19, 14, 14, 18, 14, 14, 19,
- 14, 18, 14, 19, 14, 19, 14, 15,
- 19, 15, 15, 15, 15, 19, 15, 19,
- 15, 15, 19, 15, 15, 19, 15, 19,
- 15, 19, 15, 19, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 16,
- 15, 15, 15, 16, 16, 16, 15, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 17, 16, 16, 16, 17,
- 17, 16, 17, 17, 16, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 18,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 18, 17, 17, 18, 17, 17, 17, 17,
- 18, 18, 17, 17, 17, 17, 17, 17,
- 17, 18, 17, 18, 18, 17, 17, 17,
- 18, 18, 18, 17, 18, 17, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 17,
- 18, 18, 18, 18, 19, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 19,
- 18, 18, 19, 18, 18, 18, 19, 18,
- 19, 18, 18, 19, 18, 18, 19, 19,
- 19, 19, 19, 18, 19, 18, 19, 18,
- 19, 19, 18, 18, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 18, 19,
- 19, 19, 19, 19, 18, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 20,
- 19, 19, 19, 19, 21, 19, 19, 20,
- 19, 20, 19, 19, 19, 19, 19, 20,
- 20, 20, 19, 19, 19, 20, 19, 19,
- 19, 20, 20, 19, 20, 19, 19, 21,
- 20, 20, 19, 19, 19, 19, 19, 19,
- 20, 19, 20, 20, 20, 20, 20, 20,
- 20, 19, 19, 21, 20, 20, 19, 19,
-};
-
-static const uint32_t coef3_huffcodes[1072] = {
- 0x001b2, 0x00069, 0x00000, 0x00004, 0x00006, 0x0000e, 0x00014, 0x00019,
- 0x00016, 0x0002b, 0x00030, 0x0003d, 0x0003c, 0x0005a, 0x0005f, 0x0006d,
- 0x0007e, 0x0005f, 0x0007f, 0x000b6, 0x000bc, 0x000d8, 0x000f2, 0x000fe,
- 0x000bc, 0x000fc, 0x00161, 0x0016e, 0x00174, 0x00176, 0x001a2, 0x001e3,
- 0x001f3, 0x00174, 0x0017a, 0x001ea, 0x002a8, 0x002c4, 0x002e6, 0x00314,
- 0x00346, 0x00367, 0x003e9, 0x002e5, 0x002ee, 0x003d6, 0x00555, 0x00554,
- 0x00557, 0x005c3, 0x005d6, 0x006e0, 0x0062f, 0x006e2, 0x00799, 0x00789,
- 0x007fa, 0x005ce, 0x007fe, 0x005ec, 0x007cc, 0x007af, 0x00aa7, 0x00b19,
- 0x00b94, 0x00b85, 0x00b9f, 0x00c48, 0x00c45, 0x00dd8, 0x00c4c, 0x00c4b,
- 0x00d99, 0x00d1f, 0x00dc2, 0x00f95, 0x00fa2, 0x00bb5, 0x00b9f, 0x00f5d,
- 0x00bbf, 0x00f47, 0x0154a, 0x00fd5, 0x00f45, 0x00f7f, 0x0160d, 0x01889,
- 0x01757, 0x01722, 0x018b3, 0x0172d, 0x01a39, 0x01a18, 0x01bb3, 0x01b30,
- 0x01e63, 0x0173c, 0x01b35, 0x01723, 0x01e80, 0x01fee, 0x01761, 0x01ffc,
- 0x01f7f, 0x02c7c, 0x01fa1, 0x0177b, 0x01755, 0x0175a, 0x01fa6, 0x02eab,
- 0x0310a, 0x02c69, 0x03669, 0x03127, 0x03103, 0x02e43, 0x03662, 0x03165,
- 0x03124, 0x0313b, 0x03111, 0x03668, 0x0343b, 0x03c52, 0x03efc, 0x02e6c,
- 0x03fda, 0x03ef8, 0x02e7b, 0x03ee2, 0x03cc5, 0x03d72, 0x058c0, 0x03df8,
- 0x02ea9, 0x03e7e, 0x0556d, 0x05c82, 0x03d71, 0x03e7b, 0x03c42, 0x058d7,
- 0x03f4e, 0x06200, 0x03d70, 0x05cb2, 0x05c96, 0x05cb0, 0x03f45, 0x05cb1,
- 0x02e6d, 0x03110, 0x02f68, 0x05c90, 0x07ca6, 0x07c88, 0x06204, 0x062c8,
- 0x078a6, 0x07986, 0x079d5, 0x0b1ad, 0x07989, 0x0b079, 0x05cdd, 0x0aad4,
- 0x05de8, 0x07dcd, 0x07987, 0x05d67, 0x05d99, 0x0b91d, 0x07cf1, 0x05d9b,
- 0x079d7, 0x0b07b, 0x05c85, 0x05d9a, 0x07dcc, 0x07ebf, 0x07dce, 0x07dfb,
- 0x07ec0, 0x07d1a, 0x07a07, 0x05c84, 0x0c471, 0x07cf2, 0x0baef, 0x0b9d2,
- 0x05deb, 0x07bd6, 0x0b845, 0x05d98, 0x0b91a, 0x0bae8, 0x0c4e0, 0x0dc31,
- 0x0f93d, 0x0bbce, 0x0d1d2, 0x0f7a9, 0x0d9b9, 0x0bbcb, 0x0b900, 0x0aad7,
- 0x0babd, 0x0c4e1, 0x0f46f, 0x0c588, 0x0c58b, 0x160e6, 0x0bbcf, 0x0bac3,
- 0x0f945, 0x0f7a3, 0x0d1c1, 0x0fb8e, 0x0f7a4, 0x0fb8c, 0x0f40c, 0x0c473,
- 0x0fd72, 0x0bbcd, 0x0fffa, 0x0f940, 0x0bbc9, 0x0f7a8, 0x1a1ed, 0x0bbc5,
- 0x1f26f, 0x163fd, 0x160c7, 0x1a1f5, 0x0f947, 0x163fc, 0x154b3, 0x0fff6,
- 0x163f6, 0x160e9, 0x1a1f0, 0x0bab9, 0x0baba, 0x17086, 0x0b903, 0x0fd75,
- 0x0f308, 0x176f3, 0x163ff, 0x0fd7d, 0x1bb78, 0x163fb, 0x188db, 0x1a1f7,
- 0x154b2, 0x172fd, 0x163f4, 0x1bb73, 0x172ff, 0x0babc, 0x0f97d, 0x1a1f3,
- 0x1bb6d, 0x1ffd5, 0x1a1f4, 0x1f272, 0x17380, 0x17382, 0x1ffe7, 0x0bac8,
- 0x0bbc4, 0x188d3, 0x160e0, 0x0fd7b, 0x1725f, 0x172f5, 0x1bb79, 0x1fad9,
- 0x1f269, 0x188d0, 0x0bac4, 0x0bac5, 0x31185, 0x188d2, 0x188cc, 0x31187,
- 0x3e7fe, 0x188d1, 0x1bb6c, 0x1f268, 0x1fad2, 0x1ffd9, 0x1a1ea, 0x1bb68,
- 0x1facb, 0x3fdb2, 0x1e81a, 0x188ce, 0x172fb, 0x1a1ef, 0x1face, 0x1bb70,
- 0x0bac1, 0x1bb6b, 0x172f8, 0x1bb66, 0x1ffdf, 0x1bb6a, 0x1ffd7, 0x1f266,
- 0x176f8, 0x37653, 0x1fa7e, 0x31182, 0x1fac8, 0x2c7e3, 0x370ee, 0x176ec,
- 0x176e9, 0x2e4bc, 0x160c5, 0x3765a, 0x3ce9c, 0x17373, 0x176e8, 0x188d4,
- 0x176f1, 0x176ef, 0x37659, 0x1bb7c, 0x1ffde, 0x176f2, 0x3118b, 0x2c7d4,
- 0x37651, 0x5ce9f, 0x37650, 0x31191, 0x3f4f6, 0x3f4f5, 0x7a06c, 0x1fac1,
- 0x5c97b, 0x2c7e0, 0x79d3a, 0x3e7fd, 0x2c7df, 0x3f4f0, 0x7a06d, 0x376c1,
- 0x79d3b, 0x00004, 0x00014, 0x00059, 0x000ab, 0x000b8, 0x00177, 0x001f5,
- 0x001f2, 0x00315, 0x003fc, 0x005bd, 0x0062d, 0x006e8, 0x007dd, 0x00b04,
- 0x007cd, 0x00b1e, 0x00d1e, 0x00f15, 0x00f3b, 0x00f41, 0x01548, 0x018b0,
- 0x0173b, 0x01884, 0x01a1c, 0x01bb4, 0x01f25, 0x017b5, 0x0176d, 0x01ef8,
- 0x02e73, 0x03107, 0x03125, 0x03105, 0x02e49, 0x03ce8, 0x03ef9, 0x03e5e,
- 0x02e72, 0x03471, 0x03fd9, 0x0623f, 0x078a0, 0x06867, 0x05cb3, 0x06272,
- 0x068ec, 0x06e9a, 0x079d4, 0x06e98, 0x0b1aa, 0x06e1a, 0x07985, 0x068ee,
- 0x06e9b, 0x05c88, 0x0b1ac, 0x07dfa, 0x05d65, 0x07cf0, 0x07cbf, 0x0c475,
- 0x160eb, 0x1bb7e, 0x0f7a6, 0x1fedd, 0x160e3, 0x0fffb, 0x0fb8d, 0x0fff9,
- 0x0d1c0, 0x0c58c, 0x1a1e9, 0x0bab8, 0x0f5cf, 0x0fff5, 0x376c5, 0x1a1ec,
- 0x160ed, 0x1fede, 0x1fac9, 0x1a1eb, 0x1f224, 0x176ee, 0x0fd79, 0x17080,
- 0x17387, 0x1bb7a, 0x1ffe9, 0x176f7, 0x17385, 0x17781, 0x2c7d5, 0x17785,
- 0x1ffe3, 0x163f5, 0x1fac2, 0x3e7f9, 0x3118d, 0x3fdb1, 0x1ffe2, 0x1f226,
- 0x3118a, 0x2c7d9, 0x31190, 0x3118c, 0x3f4f3, 0x1bb7f, 0x1bb72, 0x31184,
- 0xb92f4, 0x3e7fb, 0x6e1d9, 0x1faca, 0x62300, 0x3fdb8, 0x3d037, 0x3e7fc,
- 0x62301, 0x3f4f2, 0x1f26a, 0x0000e, 0x00063, 0x000f8, 0x001ee, 0x00377,
- 0x003f7, 0x006e3, 0x005cc, 0x00b05, 0x00dd2, 0x00fd4, 0x0172e, 0x0172a,
- 0x01e23, 0x01f2d, 0x01763, 0x01769, 0x0176c, 0x02e75, 0x03104, 0x02ec1,
- 0x03e58, 0x0583f, 0x03f62, 0x03f44, 0x058c5, 0x0623c, 0x05cf4, 0x07bd7,
- 0x05d9d, 0x0aad2, 0x05d66, 0x0b1a9, 0x0b078, 0x07cfe, 0x0b918, 0x0c46f,
- 0x0b919, 0x0b847, 0x06e1b, 0x0b84b, 0x0aad8, 0x0fd74, 0x172f4, 0x17081,
- 0x0f97c, 0x1f273, 0x0f7a0, 0x0fd7c, 0x172f7, 0x0fd7a, 0x1bb77, 0x172fe,
- 0x1f270, 0x0fd73, 0x1bb7b, 0x1a1bc, 0x1bb7d, 0x0bbc3, 0x172f6, 0x0baeb,
- 0x0fb8f, 0x3f4f4, 0x3fdb4, 0x376c8, 0x3e7fa, 0x1ffd0, 0x62303, 0xb92f5,
- 0x1f261, 0x31189, 0x3fdb5, 0x2c7db, 0x376c9, 0x1fad6, 0x1fad1, 0x00015,
- 0x000f0, 0x002e0, 0x0058e, 0x005d7, 0x00c4d, 0x00fa1, 0x00bdb, 0x01756,
- 0x01f70, 0x02c19, 0x0313c, 0x0370f, 0x03cc0, 0x02ea8, 0x058c6, 0x058c7,
- 0x02eb7, 0x058d0, 0x07d18, 0x0aa58, 0x0b848, 0x05d9e, 0x05d6c, 0x0b84c,
- 0x0c589, 0x0b901, 0x163f8, 0x0bac9, 0x0b9c5, 0x0f93c, 0x188d8, 0x0bbc7,
- 0x160ec, 0x0fd6f, 0x188d9, 0x160ea, 0x0f7a7, 0x0f944, 0x0baab, 0x0dc3a,
- 0x188cf, 0x176fb, 0x2c7d8, 0x2c7d7, 0x1bb75, 0x5ce9e, 0x62302, 0x370ed,
- 0x176f4, 0x1ffd1, 0x370ef, 0x3f4f8, 0x376c7, 0x1ffe1, 0x376c6, 0x176ff,
- 0x6e1d8, 0x176f6, 0x17087, 0x0f5cd, 0x00035, 0x001a0, 0x0058b, 0x00aac,
- 0x00b9a, 0x0175f, 0x01e22, 0x01e8c, 0x01fb2, 0x0310b, 0x058d1, 0x0552e,
- 0x05c27, 0x0686e, 0x07ca7, 0x0c474, 0x0dc33, 0x07bf2, 0x05de9, 0x07a35,
- 0x0baaa, 0x0b9eb, 0x0fb95, 0x0b9b8, 0x17381, 0x1f262, 0x188cd, 0x17088,
- 0x172fa, 0x0f7a2, 0x1fad3, 0x0bac0, 0x3765c, 0x1fedf, 0x1f225, 0x1fad4,
- 0x2c7da, 0x5ce9d, 0x3e7f8, 0x1e203, 0x188d7, 0x00054, 0x002c0, 0x007a1,
- 0x00f78, 0x01b36, 0x01fa3, 0x0313a, 0x03436, 0x0343a, 0x07d1d, 0x07bd8,
- 0x05cdf, 0x0b846, 0x0b189, 0x0d9b8, 0x0fff8, 0x0d9be, 0x0c58a, 0x05dea,
- 0x0d1d3, 0x160e4, 0x1f26b, 0x188da, 0x1e202, 0x2c7d2, 0x163fe, 0x31193,
- 0x17782, 0x376c2, 0x2c7d1, 0x3fdb0, 0x3765d, 0x2c7d0, 0x1fad0, 0x1e201,
- 0x188dd, 0x2c7e2, 0x37657, 0x37655, 0x376c4, 0x376c0, 0x176ea, 0x0006f,
- 0x003cf, 0x00dd5, 0x01f23, 0x02c61, 0x02ed0, 0x05d54, 0x0552d, 0x07883,
- 0x0b1a8, 0x0b91c, 0x0babf, 0x0b902, 0x0f7aa, 0x0f7a5, 0x1a1e8, 0x1ffd6,
- 0x0babe, 0x1a1bf, 0x163f3, 0x1ffd8, 0x1fad7, 0x1f275, 0x1ffdc, 0x0007d,
- 0x005bc, 0x01549, 0x02a99, 0x03def, 0x06273, 0x079d6, 0x07d1b, 0x0aad3,
- 0x0d0fc, 0x2c7dd, 0x188d6, 0x0bac2, 0x2c7e1, 0x1bb76, 0x1a1bd, 0x31186,
- 0x0fd78, 0x1a1be, 0x31183, 0x3fdb6, 0x3f4f1, 0x37652, 0x1fad5, 0x3f4f9,
- 0x3e7ff, 0x5ce9c, 0x3765b, 0x31188, 0x17372, 0x000bd, 0x0078b, 0x01f21,
- 0x03c43, 0x03ded, 0x0aad6, 0x07ec1, 0x0f942, 0x05c86, 0x17089, 0x0babb,
- 0x1ffe8, 0x2c7de, 0x1f26e, 0x1fac4, 0x3f4f7, 0x37656, 0x1fa7d, 0x376c3,
- 0x3fdb3, 0x3118f, 0x1fac6, 0x000f8, 0x007ed, 0x01efd, 0x03e7a, 0x05c91,
- 0x0aad9, 0x0baec, 0x0dc32, 0x0f46e, 0x1e200, 0x176fa, 0x3765e, 0x3fdb7,
- 0x2c7d6, 0x3fdb9, 0x37654, 0x37658, 0x3118e, 0x1ffdb, 0x000f6, 0x00c43,
- 0x03106, 0x068ef, 0x0b84d, 0x0b188, 0x0bbcc, 0x1f264, 0x1bb69, 0x17386,
- 0x1fac0, 0x00171, 0x00f39, 0x03e41, 0x068ed, 0x0d9bc, 0x0f7a1, 0x1bb67,
- 0x1ffdd, 0x176f9, 0x001b9, 0x00f7d, 0x03f63, 0x0d0fd, 0x0b9ea, 0x188dc,
- 0x1fac3, 0x1a1f2, 0x31192, 0x1ffe4, 0x001f6, 0x01754, 0x06865, 0x0f309,
- 0x160e5, 0x176f5, 0x3765f, 0x1facc, 0x001e9, 0x01a1a, 0x06201, 0x0f105,
- 0x176f0, 0x002df, 0x01756, 0x05d6d, 0x163fa, 0x176ed, 0x00342, 0x02e40,
- 0x0d0ff, 0x17082, 0x003cd, 0x02a98, 0x0fffc, 0x2c7dc, 0x1fa7f, 0x003fe,
- 0x03764, 0x0fffd, 0x176fc, 0x1fac5, 0x002f7, 0x02ed1, 0x0fb97, 0x0058a,
- 0x02edc, 0x0bbc8, 0x005d4, 0x0623d, 0x160e8, 0x0062e, 0x05830, 0x163f9,
- 0x006eb, 0x06205, 0x1f274, 0x007de, 0x062c9, 0x1f265, 0x005c9, 0x05cde,
- 0x1ffd3, 0x005d4, 0x07988, 0x007ce, 0x0b849, 0x00b1b, 0x05c89, 0x1fac7,
- 0x00b93, 0x05c83, 0x00b9e, 0x0f14f, 0x00c4a, 0x0b9c7, 0x00dd4, 0x0c470,
- 0x1f271, 0x00f38, 0x0fb96, 0x176eb, 0x00fa0, 0x163f7, 0x00bb2, 0x0b91b,
- 0x00bbe, 0x0f102, 0x00f44, 0x0f946, 0x1facd, 0x00f79, 0x0d9bd, 0x0154d,
- 0x0bbc6, 0x00fd2, 0x160e7, 0x0172b, 0x188cb, 0x0175e, 0x0fd76, 0x0175c,
- 0x1bb71, 0x0189f, 0x1a1ee, 0x01f24, 0x1a1f6, 0x01ba7, 0x0bbca, 0x01f7d,
- 0x0ffff, 0x01f2e, 0x1bb65, 0x01bb5, 0x172f9, 0x01fef, 0x1f26c, 0x01f3e,
- 0x0fd77, 0x01762, 0x1bb6e, 0x01ef9, 0x172fc, 0x01fa0, 0x02ab7, 0x02e4a,
- 0x1f267, 0x01fb3, 0x1ffda, 0x02e42, 0x03101, 0x17780, 0x0313d, 0x03475,
- 0x17784, 0x03126, 0x1facf, 0x03c51, 0x17783, 0x03e40, 0x1ffe5, 0x03663,
- 0x1ffe0, 0x03e8f, 0x1f26d, 0x0343c, 0x03cc1, 0x176fd, 0x03e45, 0x02ec0,
- 0x03f61, 0x03dee, 0x03fd8, 0x0583e, 0x02e45, 0x03e59, 0x03d02, 0x05ce8,
- 0x05568, 0x176fe, 0x02f69, 0x1fad8, 0x058c1, 0x05c83, 0x1ffe6, 0x06271,
- 0x06e1c, 0x062c7, 0x068e1, 0x0552f, 0x06864, 0x06866, 0x06e99, 0x05cbc,
- 0x07ca5, 0x078a1, 0x05c82, 0x07dcf, 0x0623b, 0x0623e, 0x068e8, 0x07a36,
- 0x05d9c, 0x0b077, 0x07cf3, 0x07a34, 0x07ca4, 0x07d19, 0x079d2, 0x07d1c,
- 0x07bd9, 0x0b84a, 0x0fb94, 0x0aad5, 0x0dc30, 0x07bf3, 0x0baee, 0x0b07a,
- 0x0c472, 0x0b91e, 0x0d9ba, 0x05d9f, 0x0d0fe, 0x0b9c6, 0x05c87, 0x0f14e,
- 0x0baed, 0x0b92e, 0x0f103, 0x0b9c4, 0x0fb91, 0x0d9bb, 0x0b1ab, 0x0c58d,
- 0x0fffe, 0x0f93b, 0x0f941, 0x0baea, 0x0b91f, 0x0f5cc, 0x0d9bf, 0x0f943,
- 0x0f104, 0x1f260, 0x0fb92, 0x0f93f, 0x0f3a6, 0x0bac7, 0x0f7ab, 0x0bac6,
- 0x17383, 0x0fd6d, 0x0bae9, 0x0fd6e, 0x1e74f, 0x188ca, 0x1f227, 0x0fb93,
- 0x0fb90, 0x0fff7, 0x17085, 0x17083, 0x160e1, 0x17084, 0x0f93e, 0x160e2,
- 0x160c6, 0x1a1f1, 0x1bb6f, 0x17384, 0x0fd70, 0x1f263, 0x188d5, 0x173a6,
- 0x0f5ce, 0x163f2, 0x0fd71, 0x1ffd2, 0x160c4, 0x1ffd4, 0x2c7d3, 0x1bb74,
-};
-
-static const uint8_t coef3_huffbits[1072] = {
-  9,  7,  2,  3,  4,  4,  5,  5,
-  6,  6,  6,  6,  7,  7,  7,  7,
-  7,  8,  8,  8,  8,  8,  8,  8,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 12, 11, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 14, 13, 14, 14, 13, 14, 13,
- 13, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 14, 14, 15, 14, 14, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 14, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 14, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 16, 15, 16, 16, 16,
- 16, 15, 15, 16, 16, 16, 16, 16,
- 15, 16, 16, 16, 15, 16, 15, 15,
- 16, 15, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 17, 16, 17, 16, 17, 17, 16,
- 17, 16, 17, 16, 16, 17, 17, 17,
- 16, 17, 16, 16, 17, 16, 17, 16,
- 17, 17, 16, 16, 17, 17, 17, 17,
- 17, 17, 17, 17, 16, 17, 17, 16,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 16, 18, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 16, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 18,
- 17, 17, 17, 17, 18, 17, 17, 18,
- 19, 17, 17, 17, 18, 17, 17, 17,
- 18, 18, 18, 17, 17, 17, 18, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 17, 18, 18, 18, 18, 17,
- 18, 18, 18, 17, 17, 18, 18, 18,
- 18, 19, 18, 18, 19, 19, 20, 18,
- 19, 18, 19, 19, 18, 19, 20, 18,
- 19,  4,  6,  7,  8,  9,  9,  9,
- 10, 10, 10, 11, 11, 11, 11, 12,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 16, 15, 15, 15,
- 15, 16, 16, 15, 16, 16, 15, 16,
- 17, 17, 17, 17, 17, 16, 16, 16,
- 16, 16, 17, 17, 17, 16, 18, 17,
- 17, 17, 18, 17, 17, 18, 17, 17,
- 17, 17, 17, 18, 17, 18, 18, 18,
- 17, 17, 18, 19, 18, 18, 17, 17,
- 18, 18, 18, 18, 19, 17, 17, 18,
- 20, 19, 19, 18, 19, 18, 19, 19,
- 19, 19, 17,  5,  7,  9, 10, 10,
- 11, 11, 12, 12, 12, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 15,
- 14, 15, 15, 15, 15, 15, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 15, 16, 16, 17, 17, 17,
- 16, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 16,
- 16, 19, 18, 18, 19, 17, 19, 20,
- 17, 18, 18, 18, 18, 18, 18,  6,
-  8, 10, 11, 12, 12, 12, 13, 13,
- 13, 14, 14, 14, 14, 15, 15, 15,
- 15, 15, 15, 16, 16, 16, 16, 16,
- 16, 17, 17, 17, 16, 16, 17, 17,
- 17, 17, 17, 17, 17, 16, 16, 16,
- 17, 18, 18, 18, 17, 19, 19, 18,
- 18, 17, 18, 19, 18, 17, 18, 18,
- 19, 18, 17, 17,  6,  9, 11, 12,
- 13, 13, 13, 14, 14, 14, 15, 15,
- 15, 15, 15, 16, 16, 16, 16, 16,
- 16, 17, 16, 17, 17, 17, 17, 17,
- 17, 17, 18, 17, 18, 17, 17, 18,
- 18, 19, 19, 17, 17,  7, 10, 12,
- 13, 13, 14, 14, 14, 14, 15, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 17, 17, 17, 17, 18, 17, 18,
- 18, 18, 18, 18, 18, 18, 18, 17,
- 17, 18, 18, 18, 18, 18, 18,  7,
- 10, 12, 13, 14, 15, 15, 15, 15,
- 16, 16, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 18, 17, 17,  8,
- 11, 13, 14, 15, 15, 15, 15, 16,
- 16, 18, 17, 17, 18, 17, 17, 18,
- 17, 17, 18, 18, 19, 18, 18, 19,
- 19, 19, 18, 18, 18,  8, 11, 13,
- 14, 15, 16, 16, 16, 16, 17, 17,
- 17, 18, 17, 18, 19, 18, 18, 18,
- 18, 18, 18,  8, 12, 14, 15, 15,
- 16, 16, 16, 17, 17, 18, 18, 18,
- 18, 18, 18, 18, 18, 17,  9, 12,
- 14, 15, 16, 16, 17, 17, 17, 17,
- 18,  9, 12, 14, 15, 16, 17, 17,
- 17, 18,  9, 13, 15, 16, 17, 17,
- 18, 17, 18, 17,  9, 13, 15, 16,
- 17, 18, 18, 18, 10, 13, 15, 16,
- 18, 10, 14, 16, 17, 18, 10, 14,
- 16, 17, 10, 14, 16, 18, 18, 10,
- 14, 16, 18, 18, 11, 15, 16, 11,
- 15, 17, 11, 15, 17, 11, 15, 17,
- 11, 15, 17, 11, 15, 17, 12, 16,
- 17, 12, 15, 12, 16, 12, 16, 18,
- 12, 16, 12, 16, 12, 16, 12, 16,
- 17, 12, 16, 18, 12, 17, 13, 16,
- 13, 16, 13, 16, 18, 13, 16, 13,
- 17, 13, 17, 13, 17, 13, 17, 13,
- 17, 13, 17, 13, 17, 13, 17, 13,
- 16, 13, 17, 13, 17, 13, 17, 14,
- 17, 14, 17, 14, 17, 14, 14, 14,
- 17, 14, 17, 14, 14, 18, 14, 14,
- 18, 14, 18, 14, 18, 14, 17, 14,
- 17, 14, 17, 14, 14, 18, 14, 15,
- 15, 15, 14, 15, 15, 14, 15, 15,
- 15, 18, 15, 18, 15, 15, 17, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 16, 15, 15, 15, 15, 16,
- 16, 16, 16, 16, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 17, 16, 16,
- 16, 17, 16, 16, 16, 17, 17, 17,
- 17, 17, 16, 17, 17, 17, 17, 16,
- 16, 16, 17, 17, 17, 17, 16, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 18, 17,
-};
-
-static const uint32_t coef4_huffcodes[476] = {
- 0x00f01, 0x0001e, 0x00000, 0x00004, 0x00006, 0x0000d, 0x0000a, 0x00017,
- 0x0001d, 0x00017, 0x0002c, 0x00031, 0x00039, 0x0003e, 0x00039, 0x0005a,
- 0x00066, 0x00070, 0x0007b, 0x00070, 0x00077, 0x000af, 0x000c9, 0x000f2,
- 0x000f4, 0x000b2, 0x000e3, 0x0015b, 0x0015d, 0x00181, 0x0019d, 0x001e3,
- 0x001c5, 0x002b5, 0x002db, 0x00338, 0x003c3, 0x003cc, 0x003f0, 0x002cd,
- 0x003fa, 0x003a1, 0x005b4, 0x00657, 0x007ab, 0x0074d, 0x0074c, 0x00ac1,
- 0x00ac5, 0x0076b, 0x00ca8, 0x00f04, 0x00f00, 0x00fe3, 0x00f3c, 0x00f10,
- 0x00f39, 0x00fe6, 0x00e26, 0x00e90, 0x016c5, 0x01827, 0x01954, 0x015c5,
- 0x01958, 0x01f8a, 0x01c4a, 0x02b0f, 0x02b41, 0x02b0e, 0x033c6, 0x03050,
- 0x01c4f, 0x02d88, 0x0305c, 0x03c18, 0x02b4f, 0x02cc2, 0x03a47, 0x05680,
- 0x0569d, 0x06442, 0x06443, 0x06446, 0x0656e, 0x06444, 0x07120, 0x0748a,
- 0x0c1ba, 0x07e22, 0x07aa6, 0x07f25, 0x07aa7, 0x07e20, 0x0c11b, 0x0c118,
- 0x07aa5, 0x0ad0a, 0x0f389, 0x19ebb, 0x0caad, 0x0fe42, 0x0fe40, 0x16c34,
- 0x2b4e5, 0x33d65, 0x16c30, 0x1e7ae, 0x1e25c, 0x18370, 0x1e703, 0x19eba,
- 0x16c37, 0x0e234, 0x16c6e, 0x00004, 0x0002a, 0x00061, 0x00075, 0x000cb,
- 0x000ff, 0x00190, 0x001eb, 0x001d1, 0x002b9, 0x00307, 0x00339, 0x0033f,
- 0x003fb, 0x003b4, 0x0060c, 0x00679, 0x00645, 0x0067d, 0x0078a, 0x007e3,
- 0x00749, 0x00ac4, 0x00ad2, 0x00ae3, 0x00c10, 0x00c16, 0x00ad1, 0x00cf4,
- 0x00fe2, 0x01586, 0x00e9d, 0x019f1, 0x01664, 0x01e26, 0x01d38, 0x02b4d,
- 0x033c5, 0x01fc2, 0x01fc3, 0x01d28, 0x03c1d, 0x0598e, 0x0f094, 0x07aa4,
- 0x0ad38, 0x0ac0c, 0x0c11a, 0x079ea, 0x0c881, 0x0fe44, 0x0b635, 0x0ac0d,
- 0x0b61e, 0x05987, 0x07121, 0x0f382, 0x0f387, 0x0e237, 0x0fe47, 0x0f383,
- 0x0f091, 0x0f385, 0x0e233, 0x182ee, 0x19eb8, 0x1663e, 0x0f093, 0x00014,
- 0x00058, 0x00159, 0x00167, 0x00300, 0x003d4, 0x005b5, 0x0079d, 0x0076a,
- 0x00b67, 0x00b60, 0x00f05, 0x00cf0, 0x00f17, 0x00e95, 0x01822, 0x01913,
- 0x016c2, 0x0182f, 0x01959, 0x01fcb, 0x01e27, 0x01c40, 0x033c7, 0x01e7b,
- 0x01c49, 0x02d89, 0x01e23, 0x01660, 0x03f12, 0x02cc6, 0x033e1, 0x05b34,
- 0x0609a, 0x06569, 0x07488, 0x07e21, 0x0cf5f, 0x0712c, 0x0389d, 0x067cf,
- 0x07f28, 0x1663f, 0x33d67, 0x1663d, 0x1e25d, 0x3c1ab, 0x15c44, 0x16c36,
- 0x0001f, 0x000ec, 0x00323, 0x005b2, 0x0079f, 0x00ac2, 0x00f16, 0x00e9e,
- 0x01956, 0x01e0f, 0x019ea, 0x01666, 0x02b89, 0x02b02, 0x02d8c, 0x03c1b,
- 0x03c19, 0x032b5, 0x03f9c, 0x02ccf, 0x03897, 0x05b35, 0x0ad02, 0x07f29,
- 0x06441, 0x03884, 0x07888, 0x0784e, 0x06568, 0x0c1bb, 0x05986, 0x067cc,
- 0x0fe49, 0x0fe48, 0x0c1bc, 0x0fe41, 0x18371, 0x1663c, 0x0e231, 0x0711e,
- 0x0ad09, 0x0f092, 0x0002d, 0x001db, 0x00781, 0x00c1a, 0x00f55, 0x01580,
- 0x01ea8, 0x02d9b, 0x032af, 0x03f16, 0x03c1c, 0x07834, 0x03c45, 0x0389c,
- 0x067ce, 0x06445, 0x0c1b9, 0x07889, 0x07f3a, 0x0784f, 0x07f2b, 0x0ad0b,
- 0x0f090, 0x0c11d, 0x0e94e, 0x0711f, 0x0e9f1, 0x0f38e, 0x079e9, 0x0ad03,
- 0x0f09b, 0x0caae, 0x0fe46, 0x2b4e6, 0x0e9f0, 0x19eb6, 0x67ac1, 0x67ac0,
- 0x33d66, 0x0f388, 0x00071, 0x003a0, 0x00ca9, 0x01829, 0x01d39, 0x02b43,
- 0x02cc4, 0x06554, 0x0f09a, 0x0b61f, 0x067cd, 0x0711c, 0x0b636, 0x07f2a,
- 0x0b634, 0x0c11f, 0x0cf5e, 0x0b61d, 0x0f06b, 0x0caab, 0x0c1be, 0x0e94c,
- 0x0f099, 0x182ed, 0x0e94f, 0x0c119, 0x0e232, 0x2b4e4, 0x0f38a, 0x19eb4,
- 0x1e25f, 0x0e94d, 0x000b7, 0x00785, 0x016cc, 0x03051, 0x033c4, 0x0656f,
- 0x03891, 0x0711d, 0x0caaf, 0x0f097, 0x07489, 0x0f098, 0x0c880, 0x0caaa,
- 0x0f386, 0x19eb7, 0x16c6f, 0x0f384, 0x182e8, 0x182e9, 0x0e230, 0x1e700,
- 0x33d62, 0x33d63, 0x33d64, 0x16c33, 0x0e216, 0x000fd, 0x00c15, 0x01665,
- 0x03c4a, 0x07f3b, 0x07896, 0x0c11c, 0x0e215, 0x16c32, 0x0f38b, 0x0f38d,
- 0x182ea, 0x1e701, 0x712df, 0x15c46, 0x00194, 0x00fe0, 0x03f13, 0x0748b,
- 0x0f096, 0x0cf80, 0x1e25e, 0xe25bd, 0x33d61, 0x16c31, 0x001f9, 0x01912,
- 0x05710, 0x0f3d0, 0x0c1bf, 0x00301, 0x01e24, 0x0ad08, 0x003cd, 0x01c41,
- 0x0c1bd, 0x00563, 0x03a52, 0x0f3d1, 0x00570, 0x02cce, 0x0e217, 0x0067b,
- 0x0655d, 0x0074b, 0x06447, 0x00c12, 0x074fb, 0x00f08, 0x0b61c, 0x00e22,
- 0x0fe43, 0x016c7, 0x01836, 0x019f2, 0x01c43, 0x01d3f, 0x01fcf, 0x02b4c,
- 0x0304c, 0x032b6, 0x03a46, 0x05607, 0x03f17, 0x02cc5, 0x0609b, 0x0655c,
- 0x07e23, 0x067c1, 0x07f26, 0x07f27, 0x0f095, 0x0e9f3, 0x0cf81, 0x0c11e,
- 0x0caac, 0x0f38f, 0x0e9f2, 0x074fa, 0x0e236, 0x0fe45, 0x1c428, 0x0e235,
- 0x182ef, 0x19eb5, 0x0f3d6, 0x182ec, 0x16c35, 0x0f38c, 0x2b4e7, 0x15c47,
- 0xe25bc, 0x1e702, 0x1c4b6, 0x0e25a, 0x3c1aa, 0x15c45, 0x1c429, 0x19eb9,
- 0x1e7af, 0x182eb, 0x1e0d4, 0x3896e,
-};
-
-static const uint8_t coef4_huffbits[476] = {
- 12,  6,  2,  3,  4,  4,  5,  5,
-  5,  6,  6,  6,  6,  6,  7,  7,
-  7,  7,  7,  8,  8,  8,  8,  8,
-  8,  9,  9,  9,  9,  9,  9,  9,
- 10, 10, 10, 10, 10, 10, 10, 11,
- 10, 11, 11, 11, 11, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 13, 13, 13, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 16, 16,
- 16, 15, 15, 15, 15, 15, 16, 16,
- 15, 16, 16, 17, 16, 16, 16, 17,
- 18, 18, 17, 17, 17, 17, 17, 17,
- 17, 17, 17,  4,  6,  7,  8,  8,
-  8,  9,  9, 10, 10, 10, 10, 10,
- 10, 11, 11, 11, 11, 11, 11, 11,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 13, 13, 13, 14, 13, 14, 14,
- 14, 13, 13, 14, 14, 16, 16, 15,
- 16, 16, 16, 15, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 17, 16, 16,
- 16, 16, 17, 17, 17, 18, 16,  5,
-  8,  9, 10, 10, 10, 11, 11, 12,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 14, 14, 13,
- 14, 14, 13, 14, 14, 15, 14, 15,
- 15, 15, 16, 15, 16, 16, 15, 15,
- 15, 18, 18, 18, 17, 18, 17, 17,
-  6,  9, 10, 11, 11, 12, 12, 13,
- 13, 13, 13, 14, 14, 14, 14, 14,
- 14, 14, 14, 15, 15, 15, 16, 15,
- 15, 15, 15, 15, 15, 16, 16, 15,
- 16, 16, 16, 16, 17, 18, 17, 16,
- 16, 16,  7, 10, 11, 12, 12, 13,
- 13, 14, 14, 14, 14, 15, 14, 15,
- 15, 15, 16, 15, 15, 15, 15, 16,
- 16, 16, 17, 16, 17, 16, 15, 16,
- 16, 16, 16, 18, 17, 17, 19, 19,
- 18, 16,  7, 11, 12, 13, 14, 14,
- 15, 15, 16, 16, 15, 16, 16, 15,
- 16, 16, 16, 16, 16, 16, 16, 17,
- 16, 17, 17, 16, 17, 18, 16, 17,
- 17, 17,  8, 11, 13, 14, 14, 15,
- 15, 16, 16, 16, 16, 16, 16, 16,
- 16, 17, 17, 16, 17, 17, 17, 17,
- 18, 18, 18, 17, 17,  8, 12, 14,
- 14, 15, 15, 16, 17, 17, 16, 16,
- 17, 17, 20, 17,  9, 12, 14, 16,
- 16, 16, 17, 21, 18, 17,  9, 13,
- 15, 16, 16, 10, 13, 16, 10, 14,
- 16, 11, 15, 16, 11, 15, 17, 11,
- 15, 12, 15, 12, 16, 12, 16, 13,
- 16, 13, 13, 13, 14, 14, 13, 14,
- 14, 14, 15, 15, 14, 15, 15, 15,
- 15, 15, 15, 15, 16, 17, 16, 16,
- 16, 16, 17, 16, 17, 16, 18, 17,
- 17, 17, 16, 17, 17, 16, 18, 17,
- 21, 17, 18, 17, 18, 17, 18, 17,
- 17, 17, 17, 19,
-};
-
-static const uint32_t coef5_huffcodes[435] = {
- 0x00347, 0x0000b, 0x00001, 0x00001, 0x0000c, 0x00004, 0x00010, 0x00015,
- 0x0001f, 0x0000b, 0x00023, 0x00026, 0x00029, 0x00035, 0x00037, 0x00001,
- 0x00015, 0x0001a, 0x0001d, 0x0001c, 0x0001e, 0x0004e, 0x00049, 0x00051,
- 0x00078, 0x00004, 0x00000, 0x00008, 0x0000d, 0x0007b, 0x00005, 0x00032,
- 0x00095, 0x00091, 0x00096, 0x000a1, 0x000d9, 0x00003, 0x00019, 0x00061,
- 0x00066, 0x00060, 0x00017, 0x0000e, 0x00063, 0x001a0, 0x001b7, 0x001e6,
- 0x001e7, 0x001b6, 0x00018, 0x001e8, 0x00038, 0x00031, 0x00005, 0x0003d,
- 0x00027, 0x001ea, 0x0001a, 0x000c5, 0x000f9, 0x000ff, 0x000db, 0x00250,
- 0x000fc, 0x0025c, 0x00008, 0x00075, 0x003d7, 0x003d3, 0x001b0, 0x0007c,
- 0x003ca, 0x00036, 0x00189, 0x004a6, 0x004a2, 0x004fb, 0x000c0, 0x0007f,
- 0x0009a, 0x00311, 0x0006e, 0x0009b, 0x0068c, 0x006c0, 0x00484, 0x00012,
- 0x000c3, 0x0094f, 0x00979, 0x009f9, 0x00d09, 0x00da6, 0x00da8, 0x00901,
- 0x000c1, 0x00373, 0x00d08, 0x009fa, 0x00d8b, 0x00d85, 0x00d86, 0x000df,
- 0x006e2, 0x000ce, 0x00f24, 0x009fe, 0x001f7, 0x007c1, 0x000cf, 0x009fc,
- 0x009ff, 0x00d89, 0x00da9, 0x009fd, 0x001f8, 0x01a36, 0x0128c, 0x0129d,
- 0x01a37, 0x00196, 0x003ea, 0x00f8b, 0x00d93, 0x01e45, 0x01e58, 0x01e4b,
- 0x01e59, 0x013f1, 0x00309, 0x00265, 0x00308, 0x0243a, 0x027e1, 0x00f89,
- 0x00324, 0x03cbc, 0x03c86, 0x03695, 0x0243c, 0x0243b, 0x0243e, 0x01e4a,
- 0x003a5, 0x03468, 0x03428, 0x03c84, 0x027e0, 0x025e2, 0x01880, 0x00197,
- 0x00325, 0x03cb7, 0x0791e, 0x007ec, 0x06c75, 0x004c8, 0x04bc7, 0x004c6,
- 0x00983, 0x0481e, 0x01b53, 0x0251b, 0x01b58, 0x00984, 0x04fa8, 0x03cbb,
- 0x00f8a, 0x00322, 0x0346a, 0x0243d, 0x00326, 0x03469, 0x0481f, 0x0481d,
- 0x00746, 0x09032, 0x01b50, 0x01d13, 0x0d8e4, 0x0481b, 0x06c74, 0x0796b,
- 0x07969, 0x00985, 0x0d8e3, 0x00986, 0x00fa2, 0x01301, 0x06c7c, 0x00987,
- 0x03cb8, 0x0f4af, 0x00e88, 0x1b1c0, 0x00fce, 0x033eb, 0x03f6a, 0x03f69,
- 0x00fcf, 0x0791f, 0x004c9, 0x04871, 0x00fcd, 0x00982, 0x00fcc, 0x00fa3,
- 0x01d12, 0x0796c, 0x01b47, 0x00321, 0x0796a, 0x0d8e2, 0x04872, 0x04873,
- 0x0000e, 0x00014, 0x0000a, 0x000a0, 0x00012, 0x0007d, 0x001a2, 0x0003b,
- 0x0025f, 0x000dd, 0x0027c, 0x00343, 0x00368, 0x0036b, 0x0003e, 0x001fa,
- 0x00485, 0x001b3, 0x0007f, 0x001b1, 0x0019e, 0x004ba, 0x007ad, 0x00339,
- 0x00066, 0x007a4, 0x00793, 0x006c6, 0x0007e, 0x000f1, 0x00372, 0x009fb,
- 0x00d83, 0x00d8a, 0x00947, 0x009f4, 0x001d0, 0x01b09, 0x01b4b, 0x007ec,
- 0x003e1, 0x000ca, 0x003ec, 0x02539, 0x04fa9, 0x01b57, 0x03429, 0x03d2a,
- 0x00d97, 0x003a7, 0x00dc0, 0x00d96, 0x00dc1, 0x007eb, 0x03cba, 0x00c43,
- 0x00c41, 0x01b52, 0x007ef, 0x00323, 0x03cb9, 0x03c83, 0x007d0, 0x007ed,
- 0x06c7f, 0x09033, 0x03f6c, 0x36383, 0x1e95d, 0x06c78, 0x00747, 0x01b51,
- 0x00022, 0x00016, 0x00039, 0x00252, 0x00079, 0x00486, 0x00338, 0x00369,
- 0x00d88, 0x00026, 0x00d87, 0x00f4b, 0x00d82, 0x00027, 0x001e1, 0x01a15,
- 0x007c7, 0x012f0, 0x001e0, 0x006d0, 0x01a16, 0x01e44, 0x01e5f, 0x03690,
- 0x00d90, 0x00c42, 0x00daf, 0x00d92, 0x00f80, 0x00cfb, 0x0342f, 0x0487f,
- 0x01b46, 0x07968, 0x00d95, 0x00d91, 0x01b55, 0x03f68, 0x04bc6, 0x03cbd,
- 0x00f81, 0x00320, 0x00069, 0x000fe, 0x006d5, 0x0033f, 0x000de, 0x007c6,
- 0x01e40, 0x00d94, 0x00f88, 0x03c8e, 0x03694, 0x00dae, 0x00dad, 0x00267,
- 0x003a6, 0x00327, 0x0487e, 0x007ee, 0x00749, 0x004c7, 0x03692, 0x01b56,
- 0x00fd1, 0x07a56, 0x06c77, 0x09031, 0x00748, 0x06c7a, 0x0796d, 0x033ea,
- 0x06c76, 0x00fd0, 0x36382, 0x1e417, 0x00745, 0x04faf, 0x0d8e1, 0x03f6b,
- 0x1e95c, 0x04fad, 0x0009e, 0x004bd, 0x0067c, 0x01b08, 0x003eb, 0x01b45,
- 0x03691, 0x0d8e5, 0x07904, 0x00981, 0x007ea, 0x019f4, 0x06c7d, 0x04fab,
- 0x04fac, 0x06c7e, 0x01300, 0x06c7b, 0x0006f, 0x003f7, 0x03c85, 0x004c4,
- 0x0001e, 0x006e1, 0x03693, 0x01b44, 0x00241, 0x01e46, 0x0019d, 0x00266,
- 0x004bb, 0x02538, 0x007ac, 0x01b54, 0x00902, 0x04870, 0x00da7, 0x00900,
- 0x00185, 0x06c79, 0x006e3, 0x003e9, 0x01e94, 0x003ed, 0x003f2, 0x0342e,
- 0x0346b, 0x0251a, 0x004c5, 0x01881, 0x0481c, 0x01b59, 0x03c87, 0x04fae,
- 0x007e9, 0x03f6d, 0x0f20a, 0x09030, 0x04faa, 0x0d8e6, 0x03f6f, 0x0481a,
- 0x03f6e, 0x1e416, 0x0d8e7,
-};
-
-static const uint8_t coef5_huffbits[435] = {
- 10,  4,  2,  4,  4,  5,  5,  5,
-  5,  6,  6,  6,  6,  6,  6,  7,
-  7,  7,  7,  7,  7,  7,  7,  7,
-  7,  8,  8,  8,  8,  7,  8,  8,
-  8,  8,  8,  8,  8,  9,  9,  9,
-  9,  9,  9,  9,  9,  9,  9,  9,
-  9,  9, 10,  9, 10, 10, 10, 10,
- 10,  9, 10, 10, 10, 10, 10, 10,
- 10, 10, 11, 11, 10, 10, 11, 11,
- 10, 11, 11, 11, 11, 11, 12, 12,
- 12, 12, 12, 12, 11, 11, 11, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 13,
- 13, 13, 12, 12, 13, 13, 13, 12,
- 12, 12, 12, 12, 13, 13, 13, 13,
- 13, 14, 14, 14, 14, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 14,
- 15, 14, 14, 14, 14, 14, 14, 13,
- 14, 14, 14, 14, 14, 14, 15, 14,
- 15, 14, 15, 15, 15, 15, 15, 15,
- 16, 15, 15, 14, 15, 16, 15, 14,
- 14, 15, 14, 14, 15, 14, 15, 15,
- 15, 16, 15, 17, 16, 15, 15, 15,
- 15, 16, 16, 16, 16, 17, 15, 16,
- 14, 16, 16, 17, 16, 16, 16, 16,
- 16, 15, 15, 15, 16, 16, 16, 16,
- 17, 15, 15, 15, 15, 16, 15, 15,
-  4,  7,  8,  8,  9,  9,  9, 10,
- 10, 10, 10, 10, 10, 10, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 12,
- 12, 11, 11, 11, 12, 12, 12, 12,
- 12, 12, 12, 12, 13, 13, 13, 13,
- 12, 13, 14, 14, 15, 15, 14, 14,
- 14, 14, 14, 14, 14, 15, 14, 14,
- 14, 15, 15, 15, 14, 14, 15, 15,
- 15, 16, 16, 18, 17, 15, 15, 15,
-  6,  9, 10, 10, 11, 11, 12, 12,
- 12, 13, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 15, 15, 14, 14, 15, 16, 15, 14,
- 14, 15,  7, 10, 11, 12, 13, 13,
- 13, 14, 14, 14, 14, 14, 14, 14,
- 14, 15, 15, 15, 15, 15, 14, 15,
- 16, 15, 15, 16, 15, 15, 15, 16,
- 15, 16, 18, 17, 15, 15, 16, 16,
- 17, 15,  8, 11, 13, 13, 14, 15,
- 14, 16, 15, 16, 15, 15, 15, 15,
- 15, 15, 17, 15,  9, 12, 14, 15,
- 10, 13, 14, 15, 10, 13, 11, 14,
- 11, 14, 11, 15, 12, 15, 12, 12,
- 13, 15, 13, 14, 13, 14, 14, 14,
- 14, 14, 15, 15, 15, 15, 14, 15,
- 15, 16, 16, 16, 15, 16, 16, 15,
- 16, 17, 16,
-};
-
-static const uint16_t levels0[60] = {
-317, 92, 62, 60, 19, 17, 10,  7,
-  6,  5,  5,  3,  3,  3,  2,  2,
-  2,  2,  2,  2,  2,  1,  2,  2,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,
-};
-
-static const uint16_t levels1[40] = {
-311, 91, 61, 28, 10,  6,  5,  2,
-  2,  2,  2,  2,  2,  2,  2,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-};
-
-static const uint16_t levels2[340] = {
-181,110, 78, 63, 61, 62, 60, 61,
- 33, 41, 41, 19, 17, 19, 12, 11,
-  9, 11, 10,  6,  8,  7,  6,  4,
-  5,  5,  4,  4,  3,  4,  3,  5,
-  3,  4,  3,  3,  3,  3,  3,  3,
-  2,  2,  4,  2,  3,  2,  3,  3,
-  2,  2,  2,  2,  2,  2,  2,  2,
-  3,  2,  2,  2,  2,  2,  2,  2,
-  2,  2,  2,  1,  2,  1,  2,  2,
-  2,  2,  1,  2,  1,  1,  1,  2,
-  2,  1,  2,  1,  2,  2,  2,  2,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,
-};
-
-static const uint16_t levels3[180] = {
-351,122, 76, 61, 41, 42, 24, 30,
- 22, 19, 11,  9, 10,  8,  5,  5,
-  4,  5,  5,  3,  3,  3,  3,  3,
-  3,  3,  2,  2,  3,  2,  2,  2,
-  3,  3,  2,  2,  2,  3,  2,  2,
-  2,  2,  2,  2,  2,  2,  2,  2,
-  2,  2,  2,  2,  2,  2,  1,  1,
-  2,  2,  1,  2,  1,  2,  2,  2,
-  2,  2,  2,  1,  2,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  2,
-  2,  1,  2,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,
-};
-
-static const uint16_t levels4[70] = {
-113, 68, 49, 42, 40, 32, 27, 15,
- 10,  5,  3,  3,  3,  3,  2,  2,
-  2,  2,  2,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,
-};
-
-static const uint16_t levels5[40] = {
-214, 72, 42, 40, 18,  4,  4,  2,
-  2,  2,  2,  2,  1,  1,  2,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-  1,  1,  1,  1,  1,  1,  1,  1,
-};
-
-static const CoefVLCTable coef_vlcs[6] = {
-    {
-        sizeof(coef0_huffbits), sizeof(levels0)/2, coef0_huffcodes, coef0_huffbits, levels0,
-    },
-    {
-        sizeof(coef1_huffbits), sizeof(levels1)/2, coef1_huffcodes, coef1_huffbits, levels1,
-    },
-    {
-        sizeof(coef2_huffbits), sizeof(levels2)/2, coef2_huffcodes, coef2_huffbits, levels2,
-    },
-    {
-        sizeof(coef3_huffbits), sizeof(levels3)/2, coef3_huffcodes, coef3_huffbits, levels3,
-    },
-    {
-        sizeof(coef4_huffbits), sizeof(levels4)/2, coef4_huffcodes, coef4_huffbits, levels4,
-    },
-    {
-        sizeof(coef5_huffbits), sizeof(levels5)/2, coef5_huffcodes, coef5_huffbits, levels5,
-    },
-};
-
-#endif /* AVCODEC_WMADATA_H */
diff --git a/deps/libav/libavcodec/wmadec.c b/deps/libav/libavcodec/wmadec.c
deleted file mode 100644
index 2dd5898..0000000
--- a/deps/libav/libavcodec/wmadec.c
+++ /dev/null
@@ -1,957 +0,0 @@
-/*
- * WMA compatible decoder
- * Copyright (c) 2002 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * WMA compatible decoder.
- * This decoder handles Microsoft Windows Media Audio data, versions 1 & 2.
- * WMA v1 is identified by audio format 0x160 in Microsoft media files
- * (ASF/AVI/WAV). WMA v2 is identified by audio format 0x161.
- *
- * To use this decoder, a calling application must supply the extra data
- * bytes provided with the WMA data. These are the extra, codec-specific
- * bytes at the end of a WAVEFORMATEX data structure. Transmit these bytes
- * to the decoder using the extradata[_size] fields in AVCodecContext. There
- * should be 4 extra bytes for v1 data and 6 extra bytes for v2 data.
- */
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "wma.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-#define EXPVLCBITS 8
-#define EXPMAX ((19+EXPVLCBITS-1)/EXPVLCBITS)
-
-#define HGAINVLCBITS 9
-#define HGAINMAX ((13+HGAINVLCBITS-1)/HGAINVLCBITS)
-
-static void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len);
-
-#ifdef TRACE
-static void dump_floats(WMACodecContext *s, const char *name, int prec, const float *tab, int n)
-{
-    int i;
-
-    tprintf(s->avctx, "%s[%d]:\n", name, n);
-    for(i=0;i<n;i++) {
-        if ((i & 7) == 0)
-            tprintf(s->avctx, "%4d: ", i);
-        tprintf(s->avctx, " %8.*f", prec, tab[i]);
-        if ((i & 7) == 7)
-            tprintf(s->avctx, "\n");
-    }
-    if ((i & 7) != 0)
-        tprintf(s->avctx, "\n");
-}
-#endif
-
-static av_cold int wma_decode_init(AVCodecContext * avctx)
-{
-    WMACodecContext *s = avctx->priv_data;
-    int i, flags2;
-    uint8_t *extradata;
-
-    if (!avctx->block_align) {
-        av_log(avctx, AV_LOG_ERROR, "block_align is not set\n");
-        return AVERROR(EINVAL);
-    }
-
-    s->avctx = avctx;
-
-    /* extract flag infos */
-    flags2 = 0;
-    extradata = avctx->extradata;
-    if (avctx->codec->id == AV_CODEC_ID_WMAV1 && avctx->extradata_size >= 4) {
-        flags2 = AV_RL16(extradata+2);
-    } else if (avctx->codec->id == AV_CODEC_ID_WMAV2 && avctx->extradata_size >= 6) {
-        flags2 = AV_RL16(extradata+4);
-    }
-
-    s->use_exp_vlc = flags2 & 0x0001;
-    s->use_bit_reservoir = flags2 & 0x0002;
-    s->use_variable_block_len = flags2 & 0x0004;
-
-    if(ff_wma_init(avctx, flags2)<0)
-        return -1;
-
-    /* init MDCT */
-    for(i = 0; i < s->nb_block_sizes; i++)
-        ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 1, 1.0 / 32768.0);
-
-    if (s->use_noise_coding) {
-        init_vlc(&s->hgain_vlc, HGAINVLCBITS, sizeof(ff_wma_hgain_huffbits),
-                 ff_wma_hgain_huffbits, 1, 1,
-                 ff_wma_hgain_huffcodes, 2, 2, 0);
-    }
-
-    if (s->use_exp_vlc) {
-        init_vlc(&s->exp_vlc, EXPVLCBITS, sizeof(ff_aac_scalefactor_bits), //FIXME move out of context
-                 ff_aac_scalefactor_bits, 1, 1,
-                 ff_aac_scalefactor_code, 4, 4, 0);
-    } else {
-        wma_lsp_to_curve_init(s, s->frame_len);
-    }
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    return 0;
-}
-
-/**
- * compute x^-0.25 with an exponent and mantissa table. We use linear
- * interpolation to reduce the mantissa table size at a small speed
- * expense (linear interpolation approximately doubles the number of
- * bits of precision).
- */
-static inline float pow_m1_4(WMACodecContext *s, float x)
-{
-    union {
-        float f;
-        unsigned int v;
-    } u, t;
-    unsigned int e, m;
-    float a, b;
-
-    u.f = x;
-    e = u.v >> 23;
-    m = (u.v >> (23 - LSP_POW_BITS)) & ((1 << LSP_POW_BITS) - 1);
-    /* build interpolation scale: 1 <= t < 2. */
-    t.v = ((u.v << LSP_POW_BITS) & ((1 << 23) - 1)) | (127 << 23);
-    a = s->lsp_pow_m_table1[m];
-    b = s->lsp_pow_m_table2[m];
-    return s->lsp_pow_e_table[e] * (a + b * t.f);
-}
-
-static av_cold void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len)
-{
-    float wdel, a, b;
-    int i, e, m;
-
-    wdel = M_PI / frame_len;
-    for(i=0;i<frame_len;i++)
-        s->lsp_cos_table[i] = 2.0f * cos(wdel * i);
-
-    /* tables for x^-0.25 computation */
-    for(i=0;i<256;i++) {
-        e = i - 126;
-        s->lsp_pow_e_table[i] = pow(2.0, e * -0.25);
-    }
-
-    /* NOTE: these two tables are needed to avoid two operations in
-       pow_m1_4 */
-    b = 1.0;
-    for(i=(1 << LSP_POW_BITS) - 1;i>=0;i--) {
-        m = (1 << LSP_POW_BITS) + i;
-        a = (float)m * (0.5 / (1 << LSP_POW_BITS));
-        a = pow(a, -0.25);
-        s->lsp_pow_m_table1[i] = 2 * a - b;
-        s->lsp_pow_m_table2[i] = b - a;
-        b = a;
-    }
-}
-
-/**
- * NOTE: We use the same code as Vorbis here
- * @todo optimize it further with SSE/3Dnow
- */
-static void wma_lsp_to_curve(WMACodecContext *s,
-                             float *out, float *val_max_ptr,
-                             int n, float *lsp)
-{
-    int i, j;
-    float p, q, w, v, val_max;
-
-    val_max = 0;
-    for(i=0;i<n;i++) {
-        p = 0.5f;
-        q = 0.5f;
-        w = s->lsp_cos_table[i];
-        for(j=1;j<NB_LSP_COEFS;j+=2){
-            q *= w - lsp[j - 1];
-            p *= w - lsp[j];
-        }
-        p *= p * (2.0f - w);
-        q *= q * (2.0f + w);
-        v = p + q;
-        v = pow_m1_4(s, v);
-        if (v > val_max)
-            val_max = v;
-        out[i] = v;
-    }
-    *val_max_ptr = val_max;
-}
-
-/**
- * decode exponents coded with LSP coefficients (same idea as Vorbis)
- */
-static void decode_exp_lsp(WMACodecContext *s, int ch)
-{
-    float lsp_coefs[NB_LSP_COEFS];
-    int val, i;
-
-    for(i = 0; i < NB_LSP_COEFS; i++) {
-        if (i == 0 || i >= 8)
-            val = get_bits(&s->gb, 3);
-        else
-            val = get_bits(&s->gb, 4);
-        lsp_coefs[i] = ff_wma_lsp_codebook[i][val];
-    }
-
-    wma_lsp_to_curve(s, s->exponents[ch], &s->max_exponent[ch],
-                     s->block_len, lsp_coefs);
-}
-
-/** pow(10, i / 16.0) for i in -60..95 */
-static const float pow_tab[] = {
-    1.7782794100389e-04, 2.0535250264571e-04,
-    2.3713737056617e-04, 2.7384196342644e-04,
-    3.1622776601684e-04, 3.6517412725484e-04,
-    4.2169650342858e-04, 4.8696752516586e-04,
-    5.6234132519035e-04, 6.4938163157621e-04,
-    7.4989420933246e-04, 8.6596432336006e-04,
-    1.0000000000000e-03, 1.1547819846895e-03,
-    1.3335214321633e-03, 1.5399265260595e-03,
-    1.7782794100389e-03, 2.0535250264571e-03,
-    2.3713737056617e-03, 2.7384196342644e-03,
-    3.1622776601684e-03, 3.6517412725484e-03,
-    4.2169650342858e-03, 4.8696752516586e-03,
-    5.6234132519035e-03, 6.4938163157621e-03,
-    7.4989420933246e-03, 8.6596432336006e-03,
-    1.0000000000000e-02, 1.1547819846895e-02,
-    1.3335214321633e-02, 1.5399265260595e-02,
-    1.7782794100389e-02, 2.0535250264571e-02,
-    2.3713737056617e-02, 2.7384196342644e-02,
-    3.1622776601684e-02, 3.6517412725484e-02,
-    4.2169650342858e-02, 4.8696752516586e-02,
-    5.6234132519035e-02, 6.4938163157621e-02,
-    7.4989420933246e-02, 8.6596432336007e-02,
-    1.0000000000000e-01, 1.1547819846895e-01,
-    1.3335214321633e-01, 1.5399265260595e-01,
-    1.7782794100389e-01, 2.0535250264571e-01,
-    2.3713737056617e-01, 2.7384196342644e-01,
-    3.1622776601684e-01, 3.6517412725484e-01,
-    4.2169650342858e-01, 4.8696752516586e-01,
-    5.6234132519035e-01, 6.4938163157621e-01,
-    7.4989420933246e-01, 8.6596432336007e-01,
-    1.0000000000000e+00, 1.1547819846895e+00,
-    1.3335214321633e+00, 1.5399265260595e+00,
-    1.7782794100389e+00, 2.0535250264571e+00,
-    2.3713737056617e+00, 2.7384196342644e+00,
-    3.1622776601684e+00, 3.6517412725484e+00,
-    4.2169650342858e+00, 4.8696752516586e+00,
-    5.6234132519035e+00, 6.4938163157621e+00,
-    7.4989420933246e+00, 8.6596432336007e+00,
-    1.0000000000000e+01, 1.1547819846895e+01,
-    1.3335214321633e+01, 1.5399265260595e+01,
-    1.7782794100389e+01, 2.0535250264571e+01,
-    2.3713737056617e+01, 2.7384196342644e+01,
-    3.1622776601684e+01, 3.6517412725484e+01,
-    4.2169650342858e+01, 4.8696752516586e+01,
-    5.6234132519035e+01, 6.4938163157621e+01,
-    7.4989420933246e+01, 8.6596432336007e+01,
-    1.0000000000000e+02, 1.1547819846895e+02,
-    1.3335214321633e+02, 1.5399265260595e+02,
-    1.7782794100389e+02, 2.0535250264571e+02,
-    2.3713737056617e+02, 2.7384196342644e+02,
-    3.1622776601684e+02, 3.6517412725484e+02,
-    4.2169650342858e+02, 4.8696752516586e+02,
-    5.6234132519035e+02, 6.4938163157621e+02,
-    7.4989420933246e+02, 8.6596432336007e+02,
-    1.0000000000000e+03, 1.1547819846895e+03,
-    1.3335214321633e+03, 1.5399265260595e+03,
-    1.7782794100389e+03, 2.0535250264571e+03,
-    2.3713737056617e+03, 2.7384196342644e+03,
-    3.1622776601684e+03, 3.6517412725484e+03,
-    4.2169650342858e+03, 4.8696752516586e+03,
-    5.6234132519035e+03, 6.4938163157621e+03,
-    7.4989420933246e+03, 8.6596432336007e+03,
-    1.0000000000000e+04, 1.1547819846895e+04,
-    1.3335214321633e+04, 1.5399265260595e+04,
-    1.7782794100389e+04, 2.0535250264571e+04,
-    2.3713737056617e+04, 2.7384196342644e+04,
-    3.1622776601684e+04, 3.6517412725484e+04,
-    4.2169650342858e+04, 4.8696752516586e+04,
-    5.6234132519035e+04, 6.4938163157621e+04,
-    7.4989420933246e+04, 8.6596432336007e+04,
-    1.0000000000000e+05, 1.1547819846895e+05,
-    1.3335214321633e+05, 1.5399265260595e+05,
-    1.7782794100389e+05, 2.0535250264571e+05,
-    2.3713737056617e+05, 2.7384196342644e+05,
-    3.1622776601684e+05, 3.6517412725484e+05,
-    4.2169650342858e+05, 4.8696752516586e+05,
-    5.6234132519035e+05, 6.4938163157621e+05,
-    7.4989420933246e+05, 8.6596432336007e+05,
-};
-
-/**
- * decode exponents coded with VLC codes
- */
-static int decode_exp_vlc(WMACodecContext *s, int ch)
-{
-    int last_exp, n, code;
-    const uint16_t *ptr;
-    float v, max_scale;
-    uint32_t *q, *q_end, iv;
-    const float *ptab = pow_tab + 60;
-    const uint32_t *iptab = (const uint32_t*)ptab;
-
-    ptr = s->exponent_bands[s->frame_len_bits - s->block_len_bits];
-    q = (uint32_t *)s->exponents[ch];
-    q_end = q + s->block_len;
-    max_scale = 0;
-    if (s->version == 1) {
-        last_exp = get_bits(&s->gb, 5) + 10;
-        v = ptab[last_exp];
-        iv = iptab[last_exp];
-        max_scale = v;
-        n = *ptr++;
-        switch (n & 3) do {
-        case 0: *q++ = iv;
-        case 3: *q++ = iv;
-        case 2: *q++ = iv;
-        case 1: *q++ = iv;
-        } while ((n -= 4) > 0);
-    }else
-        last_exp = 36;
-
-    while (q < q_end) {
-        code = get_vlc2(&s->gb, s->exp_vlc.table, EXPVLCBITS, EXPMAX);
-        if (code < 0){
-            av_log(s->avctx, AV_LOG_ERROR, "Exponent vlc invalid\n");
-            return -1;
-        }
-        /* NOTE: this offset is the same as MPEG4 AAC ! */
-        last_exp += code - 60;
-        if ((unsigned)last_exp + 60 >= FF_ARRAY_ELEMS(pow_tab)) {
-            av_log(s->avctx, AV_LOG_ERROR, "Exponent out of range: %d\n",
-                   last_exp);
-            return -1;
-        }
-        v = ptab[last_exp];
-        iv = iptab[last_exp];
-        if (v > max_scale)
-            max_scale = v;
-        n = *ptr++;
-        switch (n & 3) do {
-        case 0: *q++ = iv;
-        case 3: *q++ = iv;
-        case 2: *q++ = iv;
-        case 1: *q++ = iv;
-        } while ((n -= 4) > 0);
-    }
-    s->max_exponent[ch] = max_scale;
-    return 0;
-}
-
-
-/**
- * Apply MDCT window and add into output.
- *
- * We ensure that when the windows overlap their squared sum
- * is always 1 (MDCT reconstruction rule).
- */
-static void wma_window(WMACodecContext *s, float *out)
-{
-    float *in = s->output;
-    int block_len, bsize, n;
-
-    /* left part */
-    if (s->block_len_bits <= s->prev_block_len_bits) {
-        block_len = s->block_len;
-        bsize = s->frame_len_bits - s->block_len_bits;
-
-        s->fdsp.vector_fmul_add(out, in, s->windows[bsize],
-                                out, block_len);
-
-    } else {
-        block_len = 1 << s->prev_block_len_bits;
-        n = (s->block_len - block_len) / 2;
-        bsize = s->frame_len_bits - s->prev_block_len_bits;
-
-        s->fdsp.vector_fmul_add(out+n, in+n, s->windows[bsize],
-                                out+n, block_len);
-
-        memcpy(out+n+block_len, in+n+block_len, n*sizeof(float));
-    }
-
-    out += s->block_len;
-    in += s->block_len;
-
-    /* right part */
-    if (s->block_len_bits <= s->next_block_len_bits) {
-        block_len = s->block_len;
-        bsize = s->frame_len_bits - s->block_len_bits;
-
-        s->fdsp.vector_fmul_reverse(out, in, s->windows[bsize], block_len);
-
-    } else {
-        block_len = 1 << s->next_block_len_bits;
-        n = (s->block_len - block_len) / 2;
-        bsize = s->frame_len_bits - s->next_block_len_bits;
-
-        memcpy(out, in, n*sizeof(float));
-
-        s->fdsp.vector_fmul_reverse(out+n, in+n, s->windows[bsize], block_len);
-
-        memset(out+n+block_len, 0, n*sizeof(float));
-    }
-}
-
-
-/**
- * @return 0 if OK. 1 if last block of frame. return -1 if
- * unrecorrable error.
- */
-static int wma_decode_block(WMACodecContext *s)
-{
-    int n, v, a, ch, bsize;
-    int coef_nb_bits, total_gain;
-    int nb_coefs[MAX_CHANNELS];
-    float mdct_norm;
-    FFTContext *mdct;
-
-#ifdef TRACE
-    tprintf(s->avctx, "***decode_block: %d:%d\n", s->frame_count - 1, s->block_num);
-#endif
-
-    /* compute current block length */
-    if (s->use_variable_block_len) {
-        n = av_log2(s->nb_block_sizes - 1) + 1;
-
-        if (s->reset_block_lengths) {
-            s->reset_block_lengths = 0;
-            v = get_bits(&s->gb, n);
-            if (v >= s->nb_block_sizes){
-                av_log(s->avctx, AV_LOG_ERROR, "prev_block_len_bits %d out of range\n", s->frame_len_bits - v);
-                return -1;
-            }
-            s->prev_block_len_bits = s->frame_len_bits - v;
-            v = get_bits(&s->gb, n);
-            if (v >= s->nb_block_sizes){
-                av_log(s->avctx, AV_LOG_ERROR, "block_len_bits %d out of range\n", s->frame_len_bits - v);
-                return -1;
-            }
-            s->block_len_bits = s->frame_len_bits - v;
-        } else {
-            /* update block lengths */
-            s->prev_block_len_bits = s->block_len_bits;
-            s->block_len_bits = s->next_block_len_bits;
-        }
-        v = get_bits(&s->gb, n);
-        if (v >= s->nb_block_sizes){
-            av_log(s->avctx, AV_LOG_ERROR, "next_block_len_bits %d out of range\n", s->frame_len_bits - v);
-            return -1;
-        }
-        s->next_block_len_bits = s->frame_len_bits - v;
-    } else {
-        /* fixed block len */
-        s->next_block_len_bits = s->frame_len_bits;
-        s->prev_block_len_bits = s->frame_len_bits;
-        s->block_len_bits = s->frame_len_bits;
-    }
-
-    /* now check if the block length is coherent with the frame length */
-    s->block_len = 1 << s->block_len_bits;
-    if ((s->block_pos + s->block_len) > s->frame_len){
-        av_log(s->avctx, AV_LOG_ERROR, "frame_len overflow\n");
-        return -1;
-    }
-
-    if (s->avctx->channels == 2) {
-        s->ms_stereo = get_bits1(&s->gb);
-    }
-    v = 0;
-    for(ch = 0; ch < s->avctx->channels; ch++) {
-        a = get_bits1(&s->gb);
-        s->channel_coded[ch] = a;
-        v |= a;
-    }
-
-    bsize = s->frame_len_bits - s->block_len_bits;
-
-    /* if no channel coded, no need to go further */
-    /* XXX: fix potential framing problems */
-    if (!v)
-        goto next;
-
-    /* read total gain and extract corresponding number of bits for
-       coef escape coding */
-    total_gain = 1;
-    for(;;) {
-        a = get_bits(&s->gb, 7);
-        total_gain += a;
-        if (a != 127)
-            break;
-    }
-
-    coef_nb_bits= ff_wma_total_gain_to_bits(total_gain);
-
-    /* compute number of coefficients */
-    n = s->coefs_end[bsize] - s->coefs_start;
-    for(ch = 0; ch < s->avctx->channels; ch++)
-        nb_coefs[ch] = n;
-
-    /* complex coding */
-    if (s->use_noise_coding) {
-
-        for(ch = 0; ch < s->avctx->channels; ch++) {
-            if (s->channel_coded[ch]) {
-                int i, n, a;
-                n = s->exponent_high_sizes[bsize];
-                for(i=0;i<n;i++) {
-                    a = get_bits1(&s->gb);
-                    s->high_band_coded[ch][i] = a;
-                    /* if noise coding, the coefficients are not transmitted */
-                    if (a)
-                        nb_coefs[ch] -= s->exponent_high_bands[bsize][i];
-                }
-            }
-        }
-        for(ch = 0; ch < s->avctx->channels; ch++) {
-            if (s->channel_coded[ch]) {
-                int i, n, val, code;
-
-                n = s->exponent_high_sizes[bsize];
-                val = (int)0x80000000;
-                for(i=0;i<n;i++) {
-                    if (s->high_band_coded[ch][i]) {
-                        if (val == (int)0x80000000) {
-                            val = get_bits(&s->gb, 7) - 19;
-                        } else {
-                            code = get_vlc2(&s->gb, s->hgain_vlc.table, HGAINVLCBITS, HGAINMAX);
-                            if (code < 0){
-                                av_log(s->avctx, AV_LOG_ERROR, "hgain vlc invalid\n");
-                                return -1;
-                            }
-                            val += code - 18;
-                        }
-                        s->high_band_values[ch][i] = val;
-                    }
-                }
-            }
-        }
-    }
-
-    /* exponents can be reused in short blocks. */
-    if ((s->block_len_bits == s->frame_len_bits) ||
-        get_bits1(&s->gb)) {
-        for(ch = 0; ch < s->avctx->channels; ch++) {
-            if (s->channel_coded[ch]) {
-                if (s->use_exp_vlc) {
-                    if (decode_exp_vlc(s, ch) < 0)
-                        return -1;
-                } else {
-                    decode_exp_lsp(s, ch);
-                }
-                s->exponents_bsize[ch] = bsize;
-            }
-        }
-    }
-
-    /* parse spectral coefficients : just RLE encoding */
-    for (ch = 0; ch < s->avctx->channels; ch++) {
-        if (s->channel_coded[ch]) {
-            int tindex;
-            WMACoef* ptr = &s->coefs1[ch][0];
-
-            /* special VLC tables are used for ms stereo because
-               there is potentially less energy there */
-            tindex = (ch == 1 && s->ms_stereo);
-            memset(ptr, 0, s->block_len * sizeof(WMACoef));
-            ff_wma_run_level_decode(s->avctx, &s->gb, &s->coef_vlc[tindex],
-                  s->level_table[tindex], s->run_table[tindex],
-                  0, ptr, 0, nb_coefs[ch],
-                  s->block_len, s->frame_len_bits, coef_nb_bits);
-        }
-        if (s->version == 1 && s->avctx->channels >= 2) {
-            align_get_bits(&s->gb);
-        }
-    }
-
-    /* normalize */
-    {
-        int n4 = s->block_len / 2;
-        mdct_norm = 1.0 / (float)n4;
-        if (s->version == 1) {
-            mdct_norm *= sqrt(n4);
-        }
-    }
-
-    /* finally compute the MDCT coefficients */
-    for (ch = 0; ch < s->avctx->channels; ch++) {
-        if (s->channel_coded[ch]) {
-            WMACoef *coefs1;
-            float *coefs, *exponents, mult, mult1, noise;
-            int i, j, n, n1, last_high_band, esize;
-            float exp_power[HIGH_BAND_MAX_SIZE];
-
-            coefs1 = s->coefs1[ch];
-            exponents = s->exponents[ch];
-            esize = s->exponents_bsize[ch];
-            mult = pow(10, total_gain * 0.05) / s->max_exponent[ch];
-            mult *= mdct_norm;
-            coefs = s->coefs[ch];
-            if (s->use_noise_coding) {
-                mult1 = mult;
-                /* very low freqs : noise */
-                for(i = 0;i < s->coefs_start; i++) {
-                    *coefs++ = s->noise_table[s->noise_index] *
-                      exponents[i<<bsize>>esize] * mult1;
-                    s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
-                }
-
-                n1 = s->exponent_high_sizes[bsize];
-
-                /* compute power of high bands */
-                exponents = s->exponents[ch] +
-                    (s->high_band_start[bsize]<<bsize>>esize);
-                last_high_band = 0; /* avoid warning */
-                for(j=0;j<n1;j++) {
-                    n = s->exponent_high_bands[s->frame_len_bits -
-                                              s->block_len_bits][j];
-                    if (s->high_band_coded[ch][j]) {
-                        float e2, v;
-                        e2 = 0;
-                        for(i = 0;i < n; i++) {
-                            v = exponents[i<<bsize>>esize];
-                            e2 += v * v;
-                        }
-                        exp_power[j] = e2 / n;
-                        last_high_band = j;
-                        tprintf(s->avctx, "%d: power=%f (%d)\n", j, exp_power[j], n);
-                    }
-                    exponents += n<<bsize>>esize;
-                }
-
-                /* main freqs and high freqs */
-                exponents = s->exponents[ch] + (s->coefs_start<<bsize>>esize);
-                for(j=-1;j<n1;j++) {
-                    if (j < 0) {
-                        n = s->high_band_start[bsize] -
-                            s->coefs_start;
-                    } else {
-                        n = s->exponent_high_bands[s->frame_len_bits -
-                                                  s->block_len_bits][j];
-                    }
-                    if (j >= 0 && s->high_band_coded[ch][j]) {
-                        /* use noise with specified power */
-                        mult1 = sqrt(exp_power[j] / exp_power[last_high_band]);
-                        /* XXX: use a table */
-                        mult1 = mult1 * pow(10, s->high_band_values[ch][j] * 0.05);
-                        mult1 = mult1 / (s->max_exponent[ch] * s->noise_mult);
-                        mult1 *= mdct_norm;
-                        for(i = 0;i < n; i++) {
-                            noise = s->noise_table[s->noise_index];
-                            s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
-                            *coefs++ =  noise *
-                                exponents[i<<bsize>>esize] * mult1;
-                        }
-                        exponents += n<<bsize>>esize;
-                    } else {
-                        /* coded values + small noise */
-                        for(i = 0;i < n; i++) {
-                            noise = s->noise_table[s->noise_index];
-                            s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
-                            *coefs++ = ((*coefs1++) + noise) *
-                                exponents[i<<bsize>>esize] * mult;
-                        }
-                        exponents += n<<bsize>>esize;
-                    }
-                }
-
-                /* very high freqs : noise */
-                n = s->block_len - s->coefs_end[bsize];
-                mult1 = mult * exponents[((-1<<bsize))>>esize];
-                for(i = 0; i < n; i++) {
-                    *coefs++ = s->noise_table[s->noise_index] * mult1;
-                    s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
-                }
-            } else {
-                /* XXX: optimize more */
-                for(i = 0;i < s->coefs_start; i++)
-                    *coefs++ = 0.0;
-                n = nb_coefs[ch];
-                for(i = 0;i < n; i++) {
-                    *coefs++ = coefs1[i] * exponents[i<<bsize>>esize] * mult;
-                }
-                n = s->block_len - s->coefs_end[bsize];
-                for(i = 0;i < n; i++)
-                    *coefs++ = 0.0;
-            }
-        }
-    }
-
-#ifdef TRACE
-    for (ch = 0; ch < s->avctx->channels; ch++) {
-        if (s->channel_coded[ch]) {
-            dump_floats(s, "exponents", 3, s->exponents[ch], s->block_len);
-            dump_floats(s, "coefs", 1, s->coefs[ch], s->block_len);
-        }
-    }
-#endif
-
-    if (s->ms_stereo && s->channel_coded[1]) {
-        /* nominal case for ms stereo: we do it before mdct */
-        /* no need to optimize this case because it should almost
-           never happen */
-        if (!s->channel_coded[0]) {
-            tprintf(s->avctx, "rare ms-stereo case happened\n");
-            memset(s->coefs[0], 0, sizeof(float) * s->block_len);
-            s->channel_coded[0] = 1;
-        }
-
-        s->fdsp.butterflies_float(s->coefs[0], s->coefs[1], s->block_len);
-    }
-
-next:
-    mdct = &s->mdct_ctx[bsize];
-
-    for (ch = 0; ch < s->avctx->channels; ch++) {
-        int n4, index;
-
-        n4 = s->block_len / 2;
-        if(s->channel_coded[ch]){
-            mdct->imdct_calc(mdct, s->output, s->coefs[ch]);
-        }else if(!(s->ms_stereo && ch==1))
-            memset(s->output, 0, sizeof(s->output));
-
-        /* multiply by the window and add in the frame */
-        index = (s->frame_len / 2) + s->block_pos - n4;
-        wma_window(s, &s->frame_out[ch][index]);
-    }
-
-    /* update block number */
-    s->block_num++;
-    s->block_pos += s->block_len;
-    if (s->block_pos >= s->frame_len)
-        return 1;
-    else
-        return 0;
-}
-
-/* decode a frame of frame_len samples */
-static int wma_decode_frame(WMACodecContext *s, float **samples,
-                            int samples_offset)
-{
-    int ret, ch;
-
-#ifdef TRACE
-    tprintf(s->avctx, "***decode_frame: %d size=%d\n", s->frame_count++, s->frame_len);
-#endif
-
-    /* read each block */
-    s->block_num = 0;
-    s->block_pos = 0;
-    for(;;) {
-        ret = wma_decode_block(s);
-        if (ret < 0)
-            return -1;
-        if (ret)
-            break;
-    }
-
-    for (ch = 0; ch < s->avctx->channels; ch++) {
-        /* copy current block to output */
-        memcpy(samples[ch] + samples_offset, s->frame_out[ch],
-               s->frame_len * sizeof(*s->frame_out[ch]));
-        /* prepare for next block */
-        memmove(&s->frame_out[ch][0], &s->frame_out[ch][s->frame_len],
-                s->frame_len * sizeof(*s->frame_out[ch]));
-
-#ifdef TRACE
-        dump_floats(s, "samples", 6, samples[ch] + samples_offset, s->frame_len);
-#endif
-    }
-
-    return 0;
-}
-
-static int wma_decode_superframe(AVCodecContext *avctx, void *data,
-                                 int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    WMACodecContext *s = avctx->priv_data;
-    int nb_frames, bit_offset, i, pos, len, ret;
-    uint8_t *q;
-    float **samples;
-    int samples_offset;
-
-    tprintf(avctx, "***decode_superframe:\n");
-
-    if(buf_size==0){
-        s->last_superframe_len = 0;
-        return 0;
-    }
-    if (buf_size < avctx->block_align) {
-        av_log(avctx, AV_LOG_ERROR,
-               "Input packet size too small (%d < %d)\n",
-               buf_size, avctx->block_align);
-        return AVERROR_INVALIDDATA;
-    }
-    buf_size = avctx->block_align;
-
-    init_get_bits(&s->gb, buf, buf_size*8);
-
-    if (s->use_bit_reservoir) {
-        /* read super frame header */
-        skip_bits(&s->gb, 4); /* super frame index */
-        nb_frames = get_bits(&s->gb, 4) - (s->last_superframe_len <= 0);
-    } else {
-        nb_frames = 1;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = nb_frames * s->frame_len;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples = (float **)frame->extended_data;
-    samples_offset = 0;
-
-    if (s->use_bit_reservoir) {
-        bit_offset = get_bits(&s->gb, s->byte_offset_bits + 3);
-        if (bit_offset > get_bits_left(&s->gb)) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Invalid last frame bit offset %d > buf size %d (%d)\n",
-                   bit_offset, get_bits_left(&s->gb), buf_size);
-            goto fail;
-        }
-
-        if (s->last_superframe_len > 0) {
-            /* add bit_offset bits to last frame */
-            if ((s->last_superframe_len + ((bit_offset + 7) >> 3)) >
-                MAX_CODED_SUPERFRAME_SIZE)
-                goto fail;
-            q = s->last_superframe + s->last_superframe_len;
-            len = bit_offset;
-            while (len > 7) {
-                *q++ = (get_bits)(&s->gb, 8);
-                len -= 8;
-            }
-            if (len > 0) {
-                *q++ = (get_bits)(&s->gb, len) << (8 - len);
-            }
-            memset(q, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-            /* XXX: bit_offset bits into last frame */
-            init_get_bits(&s->gb, s->last_superframe, s->last_superframe_len * 8 + bit_offset);
-            /* skip unused bits */
-            if (s->last_bitoffset > 0)
-                skip_bits(&s->gb, s->last_bitoffset);
-            /* this frame is stored in the last superframe and in the
-               current one */
-            if (wma_decode_frame(s, samples, samples_offset) < 0)
-                goto fail;
-            samples_offset += s->frame_len;
-            nb_frames--;
-        }
-
-        /* read each frame starting from bit_offset */
-        pos = bit_offset + 4 + 4 + s->byte_offset_bits + 3;
-        if (pos >= MAX_CODED_SUPERFRAME_SIZE * 8 || pos > buf_size * 8)
-            return AVERROR_INVALIDDATA;
-        init_get_bits(&s->gb, buf + (pos >> 3), (buf_size - (pos >> 3))*8);
-        len = pos & 7;
-        if (len > 0)
-            skip_bits(&s->gb, len);
-
-        s->reset_block_lengths = 1;
-        for(i=0;i<nb_frames;i++) {
-            if (wma_decode_frame(s, samples, samples_offset) < 0)
-                goto fail;
-            samples_offset += s->frame_len;
-        }
-
-        /* we copy the end of the frame in the last frame buffer */
-        pos = get_bits_count(&s->gb) + ((bit_offset + 4 + 4 + s->byte_offset_bits + 3) & ~7);
-        s->last_bitoffset = pos & 7;
-        pos >>= 3;
-        len = buf_size - pos;
-        if (len > MAX_CODED_SUPERFRAME_SIZE || len < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "len %d invalid\n", len);
-            goto fail;
-        }
-        s->last_superframe_len = len;
-        memcpy(s->last_superframe, buf + pos, len);
-    } else {
-        /* single frame decode */
-        if (wma_decode_frame(s, samples, samples_offset) < 0)
-            goto fail;
-        samples_offset += s->frame_len;
-    }
-
-    av_dlog(s->avctx, "%d %d %d %d outbytes:%td eaten:%d\n",
-            s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len,
-            (int8_t *)samples - (int8_t *)data, avctx->block_align);
-
-    *got_frame_ptr = 1;
-
-    return avctx->block_align;
- fail:
-    /* when error, we reset the bit reservoir */
-    s->last_superframe_len = 0;
-    return -1;
-}
-
-static av_cold void flush(AVCodecContext *avctx)
-{
-    WMACodecContext *s = avctx->priv_data;
-
-    s->last_bitoffset=
-    s->last_superframe_len= 0;
-}
-
-AVCodec ff_wmav1_decoder = {
-    .name           = "wmav1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_WMAV1,
-    .priv_data_size = sizeof(WMACodecContext),
-    .init           = wma_decode_init,
-    .close          = ff_wma_end,
-    .decode         = wma_decode_superframe,
-    .flush          = flush,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
-
-AVCodec ff_wmav2_decoder = {
-    .name           = "wmav2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_WMAV2,
-    .priv_data_size = sizeof(WMACodecContext),
-    .init           = wma_decode_init,
-    .close          = ff_wma_end,
-    .decode         = wma_decode_superframe,
-    .flush          = flush,
-    .capabilities   = CODEC_CAP_DR1,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/wmaenc.c b/deps/libav/libavcodec/wmaenc.c
deleted file mode 100644
index 899cae0..0000000
--- a/deps/libav/libavcodec/wmaenc.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * WMA compatible encoder
- * Copyright (c) 2007 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "wma.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    WMACodecContext *s = avctx->priv_data;
-    int i, flags1, flags2, block_align;
-    uint8_t *extradata;
-
-    s->avctx = avctx;
-
-    if(avctx->channels > MAX_CHANNELS) {
-        av_log(avctx, AV_LOG_ERROR, "too many channels: got %i, need %i or fewer",
-               avctx->channels, MAX_CHANNELS);
-        return AVERROR(EINVAL);
-    }
-
-    if (avctx->sample_rate > 48000) {
-        av_log(avctx, AV_LOG_ERROR, "sample rate is too high: %d > 48kHz",
-               avctx->sample_rate);
-        return AVERROR(EINVAL);
-    }
-
-    if(avctx->bit_rate < 24*1000) {
-        av_log(avctx, AV_LOG_ERROR, "bitrate too low: got %i, need 24000 or higher\n",
-               avctx->bit_rate);
-        return AVERROR(EINVAL);
-    }
-
-    /* extract flag infos */
-    flags1 = 0;
-    flags2 = 1;
-    if (avctx->codec->id == AV_CODEC_ID_WMAV1) {
-        extradata= av_malloc(4);
-        avctx->extradata_size= 4;
-        AV_WL16(extradata, flags1);
-        AV_WL16(extradata+2, flags2);
-    } else if (avctx->codec->id == AV_CODEC_ID_WMAV2) {
-        extradata= av_mallocz(10);
-        avctx->extradata_size= 10;
-        AV_WL32(extradata, flags1);
-        AV_WL16(extradata+4, flags2);
-    }else
-        assert(0);
-    avctx->extradata= extradata;
-    s->use_exp_vlc = flags2 & 0x0001;
-    s->use_bit_reservoir = flags2 & 0x0002;
-    s->use_variable_block_len = flags2 & 0x0004;
-    if (avctx->channels == 2)
-        s->ms_stereo = 1;
-
-    ff_wma_init(avctx, flags2);
-
-    /* init MDCT */
-    for(i = 0; i < s->nb_block_sizes; i++)
-        ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0, 1.0);
-
-    block_align        = avctx->bit_rate * (int64_t)s->frame_len /
-                         (avctx->sample_rate * 8);
-    block_align        = FFMIN(block_align, MAX_CODED_SUPERFRAME_SIZE);
-    avctx->block_align = block_align;
-    avctx->bit_rate    = avctx->block_align * 8LL * avctx->sample_rate /
-                         s->frame_len;
-    avctx->frame_size = avctx->delay = s->frame_len;
-
-    return 0;
-}
-
-
-static void apply_window_and_mdct(AVCodecContext * avctx, const AVFrame *frame)
-{
-    WMACodecContext *s = avctx->priv_data;
-    float **audio      = (float **)frame->extended_data;
-    int len            = frame->nb_samples;
-    int window_index= s->frame_len_bits - s->block_len_bits;
-    FFTContext *mdct = &s->mdct_ctx[window_index];
-    int ch;
-    const float * win = s->windows[window_index];
-    int window_len = 1 << s->block_len_bits;
-    float n = 2.0 * 32768.0 / window_len;
-
-    for (ch = 0; ch < avctx->channels; ch++) {
-        memcpy(s->output, s->frame_out[ch], window_len * sizeof(*s->output));
-        s->fdsp.vector_fmul_scalar(s->frame_out[ch], audio[ch], n, len);
-        s->fdsp.vector_fmul_reverse(&s->output[window_len], s->frame_out[ch], win, len);
-        s->fdsp.vector_fmul(s->frame_out[ch], s->frame_out[ch], win, len);
-        mdct->mdct_calc(mdct, s->coefs[ch], s->output);
-    }
-}
-
-//FIXME use for decoding too
-static void init_exp(WMACodecContext *s, int ch, const int *exp_param){
-    int n;
-    const uint16_t *ptr;
-    float v, *q, max_scale, *q_end;
-
-    ptr = s->exponent_bands[s->frame_len_bits - s->block_len_bits];
-    q = s->exponents[ch];
-    q_end = q + s->block_len;
-    max_scale = 0;
-    while (q < q_end) {
-        /* XXX: use a table */
-        v = pow(10, *exp_param++ * (1.0 / 16.0));
-        max_scale= FFMAX(max_scale, v);
-        n = *ptr++;
-        do {
-            *q++ = v;
-        } while (--n);
-    }
-    s->max_exponent[ch] = max_scale;
-}
-
-static void encode_exp_vlc(WMACodecContext *s, int ch, const int *exp_param){
-    int last_exp;
-    const uint16_t *ptr;
-    float *q, *q_end;
-
-    ptr = s->exponent_bands[s->frame_len_bits - s->block_len_bits];
-    q = s->exponents[ch];
-    q_end = q + s->block_len;
-    if (s->version == 1) {
-        last_exp= *exp_param++;
-        assert(last_exp-10 >= 0 && last_exp-10 < 32);
-        put_bits(&s->pb, 5, last_exp - 10);
-        q+= *ptr++;
-    }else
-        last_exp = 36;
-    while (q < q_end) {
-        int exp = *exp_param++;
-        int code = exp - last_exp + 60;
-        assert(code >= 0 && code < 120);
-        put_bits(&s->pb, ff_aac_scalefactor_bits[code], ff_aac_scalefactor_code[code]);
-        /* XXX: use a table */
-        q+= *ptr++;
-        last_exp= exp;
-    }
-}
-
-static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE], int total_gain){
-    int v, bsize, ch, coef_nb_bits, parse_exponents;
-    float mdct_norm;
-    int nb_coefs[MAX_CHANNELS];
-    static const int fixed_exp[25]={20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20};
-
-    //FIXME remove duplication relative to decoder
-    if (s->use_variable_block_len) {
-        assert(0); //FIXME not implemented
-    }else{
-        /* fixed block len */
-        s->next_block_len_bits = s->frame_len_bits;
-        s->prev_block_len_bits = s->frame_len_bits;
-        s->block_len_bits = s->frame_len_bits;
-    }
-
-    s->block_len = 1 << s->block_len_bits;
-//     assert((s->block_pos + s->block_len) <= s->frame_len);
-    bsize = s->frame_len_bits - s->block_len_bits;
-
-    //FIXME factor
-    v = s->coefs_end[bsize] - s->coefs_start;
-    for (ch = 0; ch < s->avctx->channels; ch++)
-        nb_coefs[ch] = v;
-    {
-        int n4 = s->block_len / 2;
-        mdct_norm = 1.0 / (float)n4;
-        if (s->version == 1) {
-            mdct_norm *= sqrt(n4);
-        }
-    }
-
-    if (s->avctx->channels == 2) {
-        put_bits(&s->pb, 1, !!s->ms_stereo);
-    }
-
-    for (ch = 0; ch < s->avctx->channels; ch++) {
-        s->channel_coded[ch] = 1; //FIXME only set channel_coded when needed, instead of always
-        if (s->channel_coded[ch]) {
-            init_exp(s, ch, fixed_exp);
-        }
-    }
-
-    for (ch = 0; ch < s->avctx->channels; ch++) {
-        if (s->channel_coded[ch]) {
-            WMACoef *coefs1;
-            float *coefs, *exponents, mult;
-            int i, n;
-
-            coefs1 = s->coefs1[ch];
-            exponents = s->exponents[ch];
-            mult = pow(10, total_gain * 0.05) / s->max_exponent[ch];
-            mult *= mdct_norm;
-            coefs = src_coefs[ch];
-            if (s->use_noise_coding && 0) {
-                assert(0); //FIXME not implemented
-            } else {
-                coefs += s->coefs_start;
-                n = nb_coefs[ch];
-                for(i = 0;i < n; i++){
-                    double t= *coefs++ / (exponents[i] * mult);
-                    if(t<-32768 || t>32767)
-                        return -1;
-
-                    coefs1[i] = lrint(t);
-                }
-            }
-        }
-    }
-
-    v = 0;
-    for (ch = 0; ch < s->avctx->channels; ch++) {
-        int a = s->channel_coded[ch];
-        put_bits(&s->pb, 1, a);
-        v |= a;
-    }
-
-    if (!v)
-        return 1;
-
-    for(v= total_gain-1; v>=127; v-= 127)
-        put_bits(&s->pb, 7, 127);
-    put_bits(&s->pb, 7, v);
-
-    coef_nb_bits= ff_wma_total_gain_to_bits(total_gain);
-
-    if (s->use_noise_coding) {
-        for (ch = 0; ch < s->avctx->channels; ch++) {
-            if (s->channel_coded[ch]) {
-                int i, n;
-                n = s->exponent_high_sizes[bsize];
-                for(i=0;i<n;i++) {
-                    put_bits(&s->pb, 1, s->high_band_coded[ch][i]= 0);
-                    if (0)
-                        nb_coefs[ch] -= s->exponent_high_bands[bsize][i];
-                }
-            }
-        }
-    }
-
-    parse_exponents = 1;
-    if (s->block_len_bits != s->frame_len_bits) {
-        put_bits(&s->pb, 1, parse_exponents);
-    }
-
-    if (parse_exponents) {
-        for (ch = 0; ch < s->avctx->channels; ch++) {
-            if (s->channel_coded[ch]) {
-                if (s->use_exp_vlc) {
-                    encode_exp_vlc(s, ch, fixed_exp);
-                } else {
-                    assert(0); //FIXME not implemented
-//                    encode_exp_lsp(s, ch);
-                }
-            }
-        }
-    } else {
-        assert(0); //FIXME not implemented
-    }
-
-    for (ch = 0; ch < s->avctx->channels; ch++) {
-        if (s->channel_coded[ch]) {
-            int run, tindex;
-            WMACoef *ptr, *eptr;
-            tindex = (ch == 1 && s->ms_stereo);
-            ptr = &s->coefs1[ch][0];
-            eptr = ptr + nb_coefs[ch];
-
-            run=0;
-            for(;ptr < eptr; ptr++){
-                if(*ptr){
-                    int level= *ptr;
-                    int abs_level= FFABS(level);
-                    int code= 0;
-                    if(abs_level <= s->coef_vlcs[tindex]->max_level){
-                        if(run < s->coef_vlcs[tindex]->levels[abs_level-1])
-                            code= run + s->int_table[tindex][abs_level-1];
-                    }
-
-                    assert(code < s->coef_vlcs[tindex]->n);
-                    put_bits(&s->pb, s->coef_vlcs[tindex]->huffbits[code], s->coef_vlcs[tindex]->huffcodes[code]);
-
-                    if(code == 0){
-                        if(1<<coef_nb_bits <= abs_level)
-                            return -1;
-
-                        put_bits(&s->pb, coef_nb_bits, abs_level);
-                        put_bits(&s->pb, s->frame_len_bits, run);
-                    }
-                    put_bits(&s->pb, 1, level < 0); //FIXME the sign is fliped somewhere
-                    run=0;
-                }else{
-                    run++;
-                }
-            }
-            if(run)
-                put_bits(&s->pb, s->coef_vlcs[tindex]->huffbits[1], s->coef_vlcs[tindex]->huffcodes[1]);
-        }
-        if (s->version == 1 && s->avctx->channels >= 2) {
-            avpriv_align_put_bits(&s->pb);
-        }
-    }
-    return 0;
-}
-
-static int encode_frame(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE], uint8_t *buf, int buf_size, int total_gain){
-    init_put_bits(&s->pb, buf, buf_size);
-
-    if (s->use_bit_reservoir) {
-        assert(0);//FIXME not implemented
-    }else{
-        if(encode_block(s, src_coefs, total_gain) < 0)
-            return INT_MAX;
-    }
-
-    avpriv_align_put_bits(&s->pb);
-
-    return put_bits_count(&s->pb) / 8 - s->avctx->block_align;
-}
-
-static int encode_superframe(AVCodecContext *avctx, AVPacket *avpkt,
-                             const AVFrame *frame, int *got_packet_ptr)
-{
-    WMACodecContext *s = avctx->priv_data;
-    int i, total_gain, ret;
-
-    s->block_len_bits= s->frame_len_bits; //required by non variable block len
-    s->block_len = 1 << s->block_len_bits;
-
-    apply_window_and_mdct(avctx, frame);
-
-    if (s->ms_stereo) {
-        float a, b;
-        int i;
-
-        for(i = 0; i < s->block_len; i++) {
-            a = s->coefs[0][i]*0.5;
-            b = s->coefs[1][i]*0.5;
-            s->coefs[0][i] = a + b;
-            s->coefs[1][i] = a - b;
-        }
-    }
-
-    if ((ret = ff_alloc_packet(avpkt, 2 * MAX_CODED_SUPERFRAME_SIZE))) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
-        return ret;
-    }
-
-#if 1
-    total_gain= 128;
-    for(i=64; i; i>>=1){
-        int error = encode_frame(s, s->coefs, avpkt->data, avpkt->size,
-                                 total_gain - i);
-        if(error<0)
-            total_gain-= i;
-    }
-#else
-    total_gain= 90;
-    best = encode_frame(s, s->coefs, avpkt->data, avpkt->size, total_gain);
-    for(i=32; i; i>>=1){
-        int scoreL = encode_frame(s, s->coefs, avpkt->data, avpkt->size, total_gain - i);
-        int scoreR = encode_frame(s, s->coefs, avpkt->data, avpkt->size, total_gain + i);
-        av_log(NULL, AV_LOG_ERROR, "%d %d %d (%d)\n", scoreL, best, scoreR, total_gain);
-        if(scoreL < FFMIN(best, scoreR)){
-            best = scoreL;
-            total_gain -= i;
-        }else if(scoreR < best){
-            best = scoreR;
-            total_gain += i;
-        }
-    }
-#endif
-
-    if ((i = encode_frame(s, s->coefs, avpkt->data, avpkt->size, total_gain)) >= 0) {
-        av_log(avctx, AV_LOG_ERROR, "required frame size too large. please "
-               "use a higher bit rate.\n");
-        return AVERROR(EINVAL);
-    }
-    assert((put_bits_count(&s->pb) & 7) == 0);
-    while (i++)
-        put_bits(&s->pb, 8, 'N');
-
-    flush_put_bits(&s->pb);
-
-    if (frame->pts != AV_NOPTS_VALUE)
-        avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
-
-    avpkt->size = avctx->block_align;
-    *got_packet_ptr = 1;
-    return 0;
-}
-
-AVCodec ff_wmav1_encoder = {
-    .name           = "wmav1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_WMAV1,
-    .priv_data_size = sizeof(WMACodecContext),
-    .init           = encode_init,
-    .encode2        = encode_superframe,
-    .close          = ff_wma_end,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
-                                                     AV_SAMPLE_FMT_NONE },
-};
-
-AVCodec ff_wmav2_encoder = {
-    .name           = "wmav2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_WMAV2,
-    .priv_data_size = sizeof(WMACodecContext),
-    .init           = encode_init,
-    .encode2        = encode_superframe,
-    .close          = ff_wma_end,
-    .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
-                                                     AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/wmalosslessdec.c b/deps/libav/libavcodec/wmalosslessdec.c
deleted file mode 100644
index 2f341c0..0000000
--- a/deps/libav/libavcodec/wmalosslessdec.c
+++ /dev/null
@@ -1,1314 +0,0 @@
-/*
- * Windows Media Audio Lossless decoder
- * Copyright (c) 2007 Baptiste Coudurier, Benjamin Larsson, Ulion
- * Copyright (c) 2008 - 2011 Sascha Sommer, Benjamin Larsson
- * Copyright (c) 2011 Andreas Öman
- * Copyright (c) 2011 - 2012 Mashiat Sarker Shakkhar
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
-
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "wma.h"
-#include "wma_common.h"
-
-/** current decoder limitations */
-#define WMALL_MAX_CHANNELS      8                       ///< max number of handled channels
-#define MAX_SUBFRAMES          32                       ///< max number of subframes per channel
-#define MAX_BANDS              29                       ///< max number of scale factor bands
-#define MAX_FRAMESIZE       32768                       ///< maximum compressed frame size
-#define MAX_ORDER             256
-
-#define WMALL_BLOCK_MIN_BITS    6                       ///< log2 of min block size
-#define WMALL_BLOCK_MAX_BITS   14                       ///< log2 of max block size
-#define WMALL_BLOCK_MAX_SIZE (1 << WMALL_BLOCK_MAX_BITS)    ///< maximum block size
-#define WMALL_BLOCK_SIZES    (WMALL_BLOCK_MAX_BITS - WMALL_BLOCK_MIN_BITS + 1) ///< possible block sizes
-
-
-/**
- * @brief frame-specific decoder context for a single channel
- */
-typedef struct {
-    int16_t     prev_block_len;                         ///< length of the previous block
-    uint8_t     transmit_coefs;
-    uint8_t     num_subframes;
-    uint16_t    subframe_len[MAX_SUBFRAMES];            ///< subframe length in samples
-    uint16_t    subframe_offsets[MAX_SUBFRAMES];        ///< subframe positions in the current frame
-    uint8_t     cur_subframe;                           ///< current subframe number
-    uint16_t    decoded_samples;                        ///< number of already processed samples
-    int         quant_step;                             ///< quantization step for the current subframe
-    int         transient_counter;                      ///< number of transient samples from the beginning of the transient zone
-} WmallChannelCtx;
-
-/**
- * @brief main decoder context
- */
-typedef struct WmallDecodeCtx {
-    /* generic decoder variables */
-    AVCodecContext  *avctx;
-    AVFrame         *frame;
-    uint8_t         frame_data[MAX_FRAMESIZE + FF_INPUT_BUFFER_PADDING_SIZE];  ///< compressed frame data
-    PutBitContext   pb;                             ///< context for filling the frame_data buffer
-
-    /* frame size dependent frame information (set during initialization) */
-    uint32_t        decode_flags;                   ///< used compression features
-    int             len_prefix;                     ///< frame is prefixed with its length
-    int             dynamic_range_compression;      ///< frame contains DRC data
-    uint8_t         bits_per_sample;                ///< integer audio sample size for the unscaled IMDCT output (used to scale to [-1.0, 1.0])
-    uint16_t        samples_per_frame;              ///< number of samples to output
-    uint16_t        log2_frame_size;
-    int8_t          num_channels;                   ///< number of channels in the stream (same as AVCodecContext.num_channels)
-    int8_t          lfe_channel;                    ///< lfe channel index
-    uint8_t         max_num_subframes;
-    uint8_t         subframe_len_bits;              ///< number of bits used for the subframe length
-    uint8_t         max_subframe_len_bit;           ///< flag indicating that the subframe is of maximum size when the first subframe length bit is 1
-    uint16_t        min_samples_per_subframe;
-
-    /* packet decode state */
-    GetBitContext   pgb;                            ///< bitstream reader context for the packet
-    int             next_packet_start;              ///< start offset of the next WMA packet in the demuxer packet
-    uint8_t         packet_offset;                  ///< offset to the frame in the packet
-    uint8_t         packet_sequence_number;         ///< current packet number
-    int             num_saved_bits;                 ///< saved number of bits
-    int             frame_offset;                   ///< frame offset in the bit reservoir
-    int             subframe_offset;                ///< subframe offset in the bit reservoir
-    uint8_t         packet_loss;                    ///< set in case of bitstream error
-    uint8_t         packet_done;                    ///< set when a packet is fully decoded
-
-    /* frame decode state */
-    uint32_t        frame_num;                      ///< current frame number (not used for decoding)
-    GetBitContext   gb;                             ///< bitstream reader context
-    int             buf_bit_size;                   ///< buffer size in bits
-    int16_t         *samples_16[WMALL_MAX_CHANNELS]; ///< current samplebuffer pointer (16-bit)
-    int32_t         *samples_32[WMALL_MAX_CHANNELS]; ///< current samplebuffer pointer (24-bit)
-    uint8_t         drc_gain;                       ///< gain for the DRC tool
-    int8_t          skip_frame;                     ///< skip output step
-    int8_t          parsed_all_subframes;           ///< all subframes decoded?
-
-    /* subframe/block decode state */
-    int16_t         subframe_len;                   ///< current subframe length
-    int8_t          channels_for_cur_subframe;      ///< number of channels that contain the subframe
-    int8_t          channel_indexes_for_cur_subframe[WMALL_MAX_CHANNELS];
-
-    WmallChannelCtx channel[WMALL_MAX_CHANNELS];    ///< per channel data
-
-    // WMA Lossless-specific
-
-    uint8_t do_arith_coding;
-    uint8_t do_ac_filter;
-    uint8_t do_inter_ch_decorr;
-    uint8_t do_mclms;
-    uint8_t do_lpc;
-
-    int8_t  acfilter_order;
-    int8_t  acfilter_scaling;
-    int64_t acfilter_coeffs[16];
-    int     acfilter_prevvalues[2][16];
-
-    int8_t  mclms_order;
-    int8_t  mclms_scaling;
-    int16_t mclms_coeffs[128];
-    int16_t mclms_coeffs_cur[4];
-    int16_t mclms_prevvalues[WMALL_MAX_CHANNELS * 2 * 32];
-    int16_t mclms_updates[WMALL_MAX_CHANNELS * 2 * 32];
-    int     mclms_recent;
-
-    int     movave_scaling;
-    int     quant_stepsize;
-
-    struct {
-        int order;
-        int scaling;
-        int coefsend;
-        int bitsend;
-        int16_t coefs[MAX_ORDER];
-        int16_t lms_prevvalues[MAX_ORDER * 2];
-        int16_t lms_updates[MAX_ORDER * 2];
-        int recent;
-    } cdlms[2][9];
-
-    int cdlms_ttl[2];
-
-    int bV3RTM;
-
-    int is_channel_coded[2];
-    int update_speed[2];
-
-    int transient[2];
-    int transient_pos[2];
-    int seekable_tile;
-
-    int ave_sum[2];
-
-    int channel_residues[2][WMALL_BLOCK_MAX_SIZE];
-
-    int lpc_coefs[2][40];
-    int lpc_order;
-    int lpc_scaling;
-    int lpc_intbits;
-
-    int channel_coeffs[2][WMALL_BLOCK_MAX_SIZE];
-} WmallDecodeCtx;
-
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    WmallDecodeCtx *s  = avctx->priv_data;
-    uint8_t *edata_ptr = avctx->extradata;
-    unsigned int channel_mask;
-    int i, log2_max_num_subframes;
-
-    s->avctx = avctx;
-    init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
-
-    if (avctx->extradata_size >= 18) {
-        s->decode_flags    = AV_RL16(edata_ptr + 14);
-        channel_mask       = AV_RL32(edata_ptr +  2);
-        s->bits_per_sample = AV_RL16(edata_ptr);
-        if (s->bits_per_sample == 16)
-            avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
-        else if (s->bits_per_sample == 24) {
-            avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
-            avpriv_report_missing_feature(avctx, "Bit-depth higher than 16");
-            return AVERROR_PATCHWELCOME;
-        } else {
-            av_log(avctx, AV_LOG_ERROR, "Unknown bit-depth: %d\n",
-                   s->bits_per_sample);
-            return AVERROR_INVALIDDATA;
-        }
-        /* dump the extradata */
-        for (i = 0; i < avctx->extradata_size; i++)
-            av_dlog(avctx, "[%x] ", avctx->extradata[i]);
-        av_dlog(avctx, "\n");
-
-    } else {
-        avpriv_request_sample(avctx, "Unsupported extradata size");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* generic init */
-    s->log2_frame_size = av_log2(avctx->block_align) + 4;
-
-    /* frame info */
-    s->skip_frame  = 1; /* skip first frame */
-    s->packet_loss = 1;
-    s->len_prefix  = s->decode_flags & 0x40;
-
-    /* get frame len */
-    s->samples_per_frame = 1 << ff_wma_get_frame_len_bits(avctx->sample_rate,
-                                                          3, s->decode_flags);
-    av_assert0(s->samples_per_frame <= WMALL_BLOCK_MAX_SIZE);
-
-    /* init previous block len */
-    for (i = 0; i < avctx->channels; i++)
-        s->channel[i].prev_block_len = s->samples_per_frame;
-
-    /* subframe info */
-    log2_max_num_subframes  = (s->decode_flags & 0x38) >> 3;
-    s->max_num_subframes    = 1 << log2_max_num_subframes;
-    s->max_subframe_len_bit = 0;
-    s->subframe_len_bits    = av_log2(log2_max_num_subframes) + 1;
-
-    s->min_samples_per_subframe  = s->samples_per_frame / s->max_num_subframes;
-    s->dynamic_range_compression = s->decode_flags & 0x80;
-    s->bV3RTM                    = s->decode_flags & 0x100;
-
-    if (s->max_num_subframes > MAX_SUBFRAMES) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %i\n",
-               s->max_num_subframes);
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->num_channels = avctx->channels;
-
-    /* extract lfe channel position */
-    s->lfe_channel = -1;
-
-    if (channel_mask & 8) {
-        unsigned int mask;
-        for (mask = 1; mask < 16; mask <<= 1)
-            if (channel_mask & mask)
-                ++s->lfe_channel;
-    }
-
-    if (s->num_channels < 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n",
-               s->num_channels);
-        return AVERROR_INVALIDDATA;
-    } else if (s->num_channels > WMALL_MAX_CHANNELS) {
-        avpriv_request_sample(avctx,
-                              "More than %d channels", WMALL_MAX_CHANNELS);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    s->frame = av_frame_alloc();
-    if (!s->frame)
-        return AVERROR(ENOMEM);
-
-    avctx->channel_layout = channel_mask;
-    return 0;
-}
-
-/**
- * @brief Decode the subframe length.
- * @param s      context
- * @param offset sample offset in the frame
- * @return decoded subframe length on success, < 0 in case of an error
- */
-static int decode_subframe_length(WmallDecodeCtx *s, int offset)
-{
-    int frame_len_ratio, subframe_len, len;
-
-    /* no need to read from the bitstream when only one length is possible */
-    if (offset == s->samples_per_frame - s->min_samples_per_subframe)
-        return s->min_samples_per_subframe;
-
-    len             = av_log2(s->max_num_subframes - 1) + 1;
-    frame_len_ratio = get_bits(&s->gb, len);
-    subframe_len    = s->min_samples_per_subframe * (frame_len_ratio + 1);
-
-    /* sanity check the length */
-    if (subframe_len < s->min_samples_per_subframe ||
-        subframe_len > s->samples_per_frame) {
-        av_log(s->avctx, AV_LOG_ERROR, "broken frame: subframe_len %i\n",
-               subframe_len);
-        return AVERROR_INVALIDDATA;
-    }
-    return subframe_len;
-}
-
-/**
- * @brief Decode how the data in the frame is split into subframes.
- *       Every WMA frame contains the encoded data for a fixed number of
- *       samples per channel. The data for every channel might be split
- *       into several subframes. This function will reconstruct the list of
- *       subframes for every channel.
- *
- *       If the subframes are not evenly split, the algorithm estimates the
- *       channels with the lowest number of total samples.
- *       Afterwards, for each of these channels a bit is read from the
- *       bitstream that indicates if the channel contains a subframe with the
- *       next subframe size that is going to be read from the bitstream or not.
- *       If a channel contains such a subframe, the subframe size gets added to
- *       the channel's subframe list.
- *       The algorithm repeats these steps until the frame is properly divided
- *       between the individual channels.
- *
- * @param s context
- * @return 0 on success, < 0 in case of an error
- */
-static int decode_tilehdr(WmallDecodeCtx *s)
-{
-    uint16_t num_samples[WMALL_MAX_CHANNELS] = { 0 }; /* sum of samples for all currently known subframes of a channel */
-    uint8_t  contains_subframe[WMALL_MAX_CHANNELS];   /* flag indicating if a channel contains the current subframe */
-    int channels_for_cur_subframe = s->num_channels;  /* number of channels that contain the current subframe */
-    int fixed_channel_layout = 0;                     /* flag indicating that all channels use the same subfra2me offsets and sizes */
-    int min_channel_len = 0;                          /* smallest sum of samples (channels with this length will be processed first) */
-    int c, tile_aligned;
-
-    /* reset tiling information */
-    for (c = 0; c < s->num_channels; c++)
-        s->channel[c].num_subframes = 0;
-
-    tile_aligned = get_bits1(&s->gb);
-    if (s->max_num_subframes == 1 || tile_aligned)
-        fixed_channel_layout = 1;
-
-    /* loop until the frame data is split between the subframes */
-    do {
-        int subframe_len, in_use = 0;
-
-        /* check which channels contain the subframe */
-        for (c = 0; c < s->num_channels; c++) {
-            if (num_samples[c] == min_channel_len) {
-                if (fixed_channel_layout || channels_for_cur_subframe == 1 ||
-                   (min_channel_len == s->samples_per_frame - s->min_samples_per_subframe)) {
-                    contains_subframe[c] = in_use = 1;
-                } else {
-                    if (get_bits1(&s->gb))
-                        contains_subframe[c] = in_use = 1;
-                }
-            } else
-                contains_subframe[c] = 0;
-        }
-
-        if (!in_use) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Found empty subframe\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        /* get subframe length, subframe_len == 0 is not allowed */
-        if ((subframe_len = decode_subframe_length(s, min_channel_len)) <= 0)
-            return AVERROR_INVALIDDATA;
-        /* add subframes to the individual channels and find new min_channel_len */
-        min_channel_len += subframe_len;
-        for (c = 0; c < s->num_channels; c++) {
-            WmallChannelCtx *chan = &s->channel[c];
-
-            if (contains_subframe[c]) {
-                if (chan->num_subframes >= MAX_SUBFRAMES) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "broken frame: num subframes > 31\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                chan->subframe_len[chan->num_subframes] = subframe_len;
-                num_samples[c] += subframe_len;
-                ++chan->num_subframes;
-                if (num_samples[c] > s->samples_per_frame) {
-                    av_log(s->avctx, AV_LOG_ERROR, "broken frame: "
-                           "channel len(%d) > samples_per_frame(%d)\n",
-                           num_samples[c], s->samples_per_frame);
-                    return AVERROR_INVALIDDATA;
-                }
-            } else if (num_samples[c] <= min_channel_len) {
-                if (num_samples[c] < min_channel_len) {
-                    channels_for_cur_subframe = 0;
-                    min_channel_len = num_samples[c];
-                }
-                ++channels_for_cur_subframe;
-            }
-        }
-    } while (min_channel_len < s->samples_per_frame);
-
-    for (c = 0; c < s->num_channels; c++) {
-        int i, offset = 0;
-        for (i = 0; i < s->channel[c].num_subframes; i++) {
-            s->channel[c].subframe_offsets[i] = offset;
-            offset += s->channel[c].subframe_len[i];
-        }
-    }
-
-    return 0;
-}
-
-static void decode_ac_filter(WmallDecodeCtx *s)
-{
-    int i;
-    s->acfilter_order   = get_bits(&s->gb, 4) + 1;
-    s->acfilter_scaling = get_bits(&s->gb, 4);
-
-    for (i = 0; i < s->acfilter_order; i++)
-        s->acfilter_coeffs[i] = (s->acfilter_scaling ?
-                                 get_bits(&s->gb, s->acfilter_scaling) : 0) + 1;
-}
-
-static void decode_mclms(WmallDecodeCtx *s)
-{
-    s->mclms_order   = (get_bits(&s->gb, 4) + 1) * 2;
-    s->mclms_scaling = get_bits(&s->gb, 4);
-    if (get_bits1(&s->gb)) {
-        int i, send_coef_bits;
-        int cbits = av_log2(s->mclms_scaling + 1);
-        if (1 << cbits < s->mclms_scaling + 1)
-            cbits++;
-
-        send_coef_bits = (cbits ? get_bits(&s->gb, cbits) : 0) + 2;
-
-        for (i = 0; i < s->mclms_order * s->num_channels * s->num_channels; i++)
-            s->mclms_coeffs[i] = get_bits(&s->gb, send_coef_bits);
-
-        for (i = 0; i < s->num_channels; i++) {
-            int c;
-            for (c = 0; c < i; c++)
-                s->mclms_coeffs_cur[i * s->num_channels + c] = get_bits(&s->gb, send_coef_bits);
-        }
-    }
-}
-
-static int decode_cdlms(WmallDecodeCtx *s)
-{
-    int c, i;
-    int cdlms_send_coef = get_bits1(&s->gb);
-
-    for (c = 0; c < s->num_channels; c++) {
-        s->cdlms_ttl[c] = get_bits(&s->gb, 3) + 1;
-        for (i = 0; i < s->cdlms_ttl[c]; i++) {
-            s->cdlms[c][i].order = (get_bits(&s->gb, 7) + 1) * 8;
-            if (s->cdlms[c][i].order > MAX_ORDER) {
-                av_log(s->avctx, AV_LOG_ERROR,
-                       "Order[%d][%d] %d > max (%d), not supported\n",
-                       c, i, s->cdlms[c][i].order, MAX_ORDER);
-                s->cdlms[0][0].order = 0;
-                return AVERROR_INVALIDDATA;
-            }
-        }
-
-        for (i = 0; i < s->cdlms_ttl[c]; i++)
-            s->cdlms[c][i].scaling = get_bits(&s->gb, 4);
-
-        if (cdlms_send_coef) {
-            for (i = 0; i < s->cdlms_ttl[c]; i++) {
-                int cbits, shift_l, shift_r, j;
-                cbits = av_log2(s->cdlms[c][i].order);
-                if ((1 << cbits) < s->cdlms[c][i].order)
-                    cbits++;
-                s->cdlms[c][i].coefsend = get_bits(&s->gb, cbits) + 1;
-
-                cbits = av_log2(s->cdlms[c][i].scaling + 1);
-                if ((1 << cbits) < s->cdlms[c][i].scaling + 1)
-                    cbits++;
-
-                s->cdlms[c][i].bitsend = get_bits(&s->gb, cbits) + 2;
-                shift_l = 32 - s->cdlms[c][i].bitsend;
-                shift_r = 32 - s->cdlms[c][i].scaling - 2;
-                for (j = 0; j < s->cdlms[c][i].coefsend; j++)
-                    s->cdlms[c][i].coefs[j] =
-                        (get_bits(&s->gb, s->cdlms[c][i].bitsend) << shift_l) >> shift_r;
-            }
-        }
-    }
-
-    return 0;
-}
-
-static int decode_channel_residues(WmallDecodeCtx *s, int ch, int tile_size)
-{
-    int i = 0;
-    unsigned int ave_mean;
-    s->transient[ch] = get_bits1(&s->gb);
-    if (s->transient[ch]) {
-        s->transient_pos[ch] = get_bits(&s->gb, av_log2(tile_size));
-        if (s->transient_pos[ch])
-            s->transient[ch] = 0;
-        s->channel[ch].transient_counter =
-            FFMAX(s->channel[ch].transient_counter, s->samples_per_frame / 2);
-    } else if (s->channel[ch].transient_counter)
-        s->transient[ch] = 1;
-
-    if (s->seekable_tile) {
-        ave_mean = get_bits(&s->gb, s->bits_per_sample);
-        s->ave_sum[ch] = ave_mean << (s->movave_scaling + 1);
-    }
-
-    if (s->seekable_tile) {
-        if (s->do_inter_ch_decorr)
-            s->channel_residues[ch][0] = get_sbits(&s->gb, s->bits_per_sample + 1);
-        else
-            s->channel_residues[ch][0] = get_sbits(&s->gb, s->bits_per_sample);
-        i++;
-    }
-    for (; i < tile_size; i++) {
-        int quo = 0, rem, rem_bits, residue;
-        while(get_bits1(&s->gb)) {
-            quo++;
-            if (get_bits_left(&s->gb) <= 0)
-                return -1;
-        }
-        if (quo >= 32)
-            quo += get_bits_long(&s->gb, get_bits(&s->gb, 5) + 1);
-
-        ave_mean = (s->ave_sum[ch] + (1 << s->movave_scaling)) >> (s->movave_scaling + 1);
-        if (ave_mean <= 1)
-            residue = quo;
-        else {
-            rem_bits = av_ceil_log2(ave_mean);
-            rem      = rem_bits ? get_bits_long(&s->gb, rem_bits) : 0;
-            residue  = (quo << rem_bits) + rem;
-        }
-
-        s->ave_sum[ch] = residue + s->ave_sum[ch] -
-                         (s->ave_sum[ch] >> s->movave_scaling);
-
-        if (residue & 1)
-            residue = -(residue >> 1) - 1;
-        else
-            residue = residue >> 1;
-        s->channel_residues[ch][i] = residue;
-    }
-
-    return 0;
-
-}
-
-static void decode_lpc(WmallDecodeCtx *s)
-{
-    int ch, i, cbits;
-    s->lpc_order   = get_bits(&s->gb, 5) + 1;
-    s->lpc_scaling = get_bits(&s->gb, 4);
-    s->lpc_intbits = get_bits(&s->gb, 3) + 1;
-    cbits = s->lpc_scaling + s->lpc_intbits;
-    for (ch = 0; ch < s->num_channels; ch++)
-        for (i = 0; i < s->lpc_order; i++)
-            s->lpc_coefs[ch][i] = get_sbits(&s->gb, cbits);
-}
-
-static void clear_codec_buffers(WmallDecodeCtx *s)
-{
-    int ich, ilms;
-
-    memset(s->acfilter_coeffs,     0, sizeof(s->acfilter_coeffs));
-    memset(s->acfilter_prevvalues, 0, sizeof(s->acfilter_prevvalues));
-    memset(s->lpc_coefs,           0, sizeof(s->lpc_coefs));
-
-    memset(s->mclms_coeffs,     0, sizeof(s->mclms_coeffs));
-    memset(s->mclms_coeffs_cur, 0, sizeof(s->mclms_coeffs_cur));
-    memset(s->mclms_prevvalues, 0, sizeof(s->mclms_prevvalues));
-    memset(s->mclms_updates,    0, sizeof(s->mclms_updates));
-
-    for (ich = 0; ich < s->num_channels; ich++) {
-        for (ilms = 0; ilms < s->cdlms_ttl[ich]; ilms++) {
-            memset(s->cdlms[ich][ilms].coefs, 0,
-                   sizeof(s->cdlms[ich][ilms].coefs));
-            memset(s->cdlms[ich][ilms].lms_prevvalues, 0,
-                   sizeof(s->cdlms[ich][ilms].lms_prevvalues));
-            memset(s->cdlms[ich][ilms].lms_updates, 0,
-                   sizeof(s->cdlms[ich][ilms].lms_updates));
-        }
-        s->ave_sum[ich] = 0;
-    }
-}
-
-/**
- * @brief Reset filter parameters and transient area at new seekable tile.
- */
-static void reset_codec(WmallDecodeCtx *s)
-{
-    int ich, ilms;
-    s->mclms_recent = s->mclms_order * s->num_channels;
-    for (ich = 0; ich < s->num_channels; ich++) {
-        for (ilms = 0; ilms < s->cdlms_ttl[ich]; ilms++)
-            s->cdlms[ich][ilms].recent = s->cdlms[ich][ilms].order;
-        /* first sample of a seekable subframe is considered as the starting of
-            a transient area which is samples_per_frame samples long */
-        s->channel[ich].transient_counter = s->samples_per_frame;
-        s->transient[ich]     = 1;
-        s->transient_pos[ich] = 0;
-    }
-}
-
-static void mclms_update(WmallDecodeCtx *s, int icoef, int *pred)
-{
-    int i, j, ich, pred_error;
-    int order        = s->mclms_order;
-    int num_channels = s->num_channels;
-    int range        = 1 << (s->bits_per_sample - 1);
-
-    for (ich = 0; ich < num_channels; ich++) {
-        pred_error = s->channel_residues[ich][icoef] - pred[ich];
-        if (pred_error > 0) {
-            for (i = 0; i < order * num_channels; i++)
-                s->mclms_coeffs[i + ich * order * num_channels] +=
-                    s->mclms_updates[s->mclms_recent + i];
-            for (j = 0; j < ich; j++) {
-                if (s->channel_residues[j][icoef] > 0)
-                    s->mclms_coeffs_cur[ich * num_channels + j] += 1;
-                else if (s->channel_residues[j][icoef] < 0)
-                    s->mclms_coeffs_cur[ich * num_channels + j] -= 1;
-            }
-        } else if (pred_error < 0) {
-            for (i = 0; i < order * num_channels; i++)
-                s->mclms_coeffs[i + ich * order * num_channels] -=
-                    s->mclms_updates[s->mclms_recent + i];
-            for (j = 0; j < ich; j++) {
-                if (s->channel_residues[j][icoef] > 0)
-                    s->mclms_coeffs_cur[ich * num_channels + j] -= 1;
-                else if (s->channel_residues[j][icoef] < 0)
-                    s->mclms_coeffs_cur[ich * num_channels + j] += 1;
-            }
-        }
-    }
-
-    for (ich = num_channels - 1; ich >= 0; ich--) {
-        s->mclms_recent--;
-        s->mclms_prevvalues[s->mclms_recent] = s->channel_residues[ich][icoef];
-        if (s->channel_residues[ich][icoef] > range - 1)
-            s->mclms_prevvalues[s->mclms_recent] = range - 1;
-        else if (s->channel_residues[ich][icoef] < -range)
-            s->mclms_prevvalues[s->mclms_recent] = -range;
-
-        s->mclms_updates[s->mclms_recent] = 0;
-        if (s->channel_residues[ich][icoef] > 0)
-            s->mclms_updates[s->mclms_recent] = 1;
-        else if (s->channel_residues[ich][icoef] < 0)
-            s->mclms_updates[s->mclms_recent] = -1;
-    }
-
-    if (s->mclms_recent == 0) {
-        memcpy(&s->mclms_prevvalues[order * num_channels],
-               s->mclms_prevvalues,
-               2 * order * num_channels);
-        memcpy(&s->mclms_updates[order * num_channels],
-               s->mclms_updates,
-               2 * order * num_channels);
-        s->mclms_recent = num_channels * order;
-    }
-}
-
-static void mclms_predict(WmallDecodeCtx *s, int icoef, int *pred)
-{
-    int ich, i;
-    int order        = s->mclms_order;
-    int num_channels = s->num_channels;
-
-    for (ich = 0; ich < num_channels; ich++) {
-        pred[ich] = 0;
-        if (!s->is_channel_coded[ich])
-            continue;
-        for (i = 0; i < order * num_channels; i++)
-            pred[ich] += s->mclms_prevvalues[i + s->mclms_recent] *
-                         s->mclms_coeffs[i + order * num_channels * ich];
-        for (i = 0; i < ich; i++)
-            pred[ich] += s->channel_residues[i][icoef] *
-                         s->mclms_coeffs_cur[i + num_channels * ich];
-        pred[ich] += 1 << s->mclms_scaling - 1;
-        pred[ich] >>= s->mclms_scaling;
-        s->channel_residues[ich][icoef] += pred[ich];
-    }
-}
-
-static void revert_mclms(WmallDecodeCtx *s, int tile_size)
-{
-    int icoef, pred[WMALL_MAX_CHANNELS] = { 0 };
-    for (icoef = 0; icoef < tile_size; icoef++) {
-        mclms_predict(s, icoef, pred);
-        mclms_update(s, icoef, pred);
-    }
-}
-
-static int lms_predict(WmallDecodeCtx *s, int ich, int ilms)
-{
-    int pred = 0, icoef;
-    int recent = s->cdlms[ich][ilms].recent;
-
-    for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
-        pred += s->cdlms[ich][ilms].coefs[icoef] *
-                s->cdlms[ich][ilms].lms_prevvalues[icoef + recent];
-
-    return pred;
-}
-
-static void lms_update(WmallDecodeCtx *s, int ich, int ilms,
-                       int input, int residue)
-{
-    int icoef;
-    int recent = s->cdlms[ich][ilms].recent;
-    int range  = 1 << s->bits_per_sample - 1;
-
-    if (residue < 0) {
-        for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
-            s->cdlms[ich][ilms].coefs[icoef] -=
-                s->cdlms[ich][ilms].lms_updates[icoef + recent];
-    } else if (residue > 0) {
-        for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
-            s->cdlms[ich][ilms].coefs[icoef] +=
-                s->cdlms[ich][ilms].lms_updates[icoef + recent];
-    }
-
-    if (recent)
-        recent--;
-    else {
-        memcpy(&s->cdlms[ich][ilms].lms_prevvalues[s->cdlms[ich][ilms].order],
-               s->cdlms[ich][ilms].lms_prevvalues,
-               2 * s->cdlms[ich][ilms].order);
-        memcpy(&s->cdlms[ich][ilms].lms_updates[s->cdlms[ich][ilms].order],
-               s->cdlms[ich][ilms].lms_updates,
-               2 * s->cdlms[ich][ilms].order);
-        recent = s->cdlms[ich][ilms].order - 1;
-    }
-
-    s->cdlms[ich][ilms].lms_prevvalues[recent] = av_clip(input, -range, range - 1);
-    if (!input)
-        s->cdlms[ich][ilms].lms_updates[recent] = 0;
-    else if (input < 0)
-        s->cdlms[ich][ilms].lms_updates[recent] = -s->update_speed[ich];
-    else
-        s->cdlms[ich][ilms].lms_updates[recent] = s->update_speed[ich];
-
-    s->cdlms[ich][ilms].lms_updates[recent + (s->cdlms[ich][ilms].order >> 4)] >>= 2;
-    s->cdlms[ich][ilms].lms_updates[recent + (s->cdlms[ich][ilms].order >> 3)] >>= 1;
-    s->cdlms[ich][ilms].recent = recent;
-}
-
-static void use_high_update_speed(WmallDecodeCtx *s, int ich)
-{
-    int ilms, recent, icoef;
-    for (ilms = s->cdlms_ttl[ich] - 1; ilms >= 0; ilms--) {
-        recent = s->cdlms[ich][ilms].recent;
-        if (s->update_speed[ich] == 16)
-            continue;
-        if (s->bV3RTM) {
-            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
-                s->cdlms[ich][ilms].lms_updates[icoef + recent] *= 2;
-        } else {
-            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
-                s->cdlms[ich][ilms].lms_updates[icoef] *= 2;
-        }
-    }
-    s->update_speed[ich] = 16;
-}
-
-static void use_normal_update_speed(WmallDecodeCtx *s, int ich)
-{
-    int ilms, recent, icoef;
-    for (ilms = s->cdlms_ttl[ich] - 1; ilms >= 0; ilms--) {
-        recent = s->cdlms[ich][ilms].recent;
-        if (s->update_speed[ich] == 8)
-            continue;
-        if (s->bV3RTM)
-            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
-                s->cdlms[ich][ilms].lms_updates[icoef + recent] /= 2;
-        else
-            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
-                s->cdlms[ich][ilms].lms_updates[icoef] /= 2;
-    }
-    s->update_speed[ich] = 8;
-}
-
-static void revert_cdlms(WmallDecodeCtx *s, int ch,
-                         int coef_begin, int coef_end)
-{
-    int icoef, pred, ilms, num_lms, residue, input;
-
-    num_lms = s->cdlms_ttl[ch];
-    for (ilms = num_lms - 1; ilms >= 0; ilms--) {
-        for (icoef = coef_begin; icoef < coef_end; icoef++) {
-            pred = 1 << (s->cdlms[ch][ilms].scaling - 1);
-            residue = s->channel_residues[ch][icoef];
-            pred += lms_predict(s, ch, ilms);
-            input = residue + (pred >> s->cdlms[ch][ilms].scaling);
-            lms_update(s, ch, ilms, input, residue);
-            s->channel_residues[ch][icoef] = input;
-        }
-    }
-}
-
-static void revert_inter_ch_decorr(WmallDecodeCtx *s, int tile_size)
-{
-    if (s->num_channels != 2)
-        return;
-    else if (s->is_channel_coded[0] || s->is_channel_coded[1]) {
-        int icoef;
-        for (icoef = 0; icoef < tile_size; icoef++) {
-            s->channel_residues[0][icoef] -= s->channel_residues[1][icoef] >> 1;
-            s->channel_residues[1][icoef] += s->channel_residues[0][icoef];
-        }
-    }
-}
-
-static void revert_acfilter(WmallDecodeCtx *s, int tile_size)
-{
-    int ich, pred, i, j;
-    int64_t *filter_coeffs = s->acfilter_coeffs;
-    int scaling            = s->acfilter_scaling;
-    int order              = s->acfilter_order;
-
-    for (ich = 0; ich < s->num_channels; ich++) {
-        int *prevvalues = s->acfilter_prevvalues[ich];
-        for (i = 0; i < order; i++) {
-            pred = 0;
-            for (j = 0; j < order; j++) {
-                if (i <= j)
-                    pred += filter_coeffs[j] * prevvalues[j - i];
-                else
-                    pred += s->channel_residues[ich][i - j - 1] * filter_coeffs[j];
-            }
-            pred >>= scaling;
-            s->channel_residues[ich][i] += pred;
-        }
-        for (i = order; i < tile_size; i++) {
-            pred = 0;
-            for (j = 0; j < order; j++)
-                pred += s->channel_residues[ich][i - j - 1] * filter_coeffs[j];
-            pred >>= scaling;
-            s->channel_residues[ich][i] += pred;
-        }
-        for (j = 0; j < order; j++)
-            prevvalues[j] = s->channel_residues[ich][tile_size - j - 1];
-    }
-}
-
-static int decode_subframe(WmallDecodeCtx *s)
-{
-    int offset        = s->samples_per_frame;
-    int subframe_len  = s->samples_per_frame;
-    int total_samples = s->samples_per_frame * s->num_channels;
-    int i, j, rawpcm_tile, padding_zeroes, res;
-
-    s->subframe_offset = get_bits_count(&s->gb);
-
-    /* reset channel context and find the next block offset and size
-        == the next block of the channel with the smallest number of
-        decoded samples */
-    for (i = 0; i < s->num_channels; i++) {
-        if (offset > s->channel[i].decoded_samples) {
-            offset = s->channel[i].decoded_samples;
-            subframe_len =
-                s->channel[i].subframe_len[s->channel[i].cur_subframe];
-        }
-    }
-
-    /* get a list of all channels that contain the estimated block */
-    s->channels_for_cur_subframe = 0;
-    for (i = 0; i < s->num_channels; i++) {
-        const int cur_subframe = s->channel[i].cur_subframe;
-        /* subtract already processed samples */
-        total_samples -= s->channel[i].decoded_samples;
-
-        /* and count if there are multiple subframes that match our profile */
-        if (offset == s->channel[i].decoded_samples &&
-            subframe_len == s->channel[i].subframe_len[cur_subframe]) {
-            total_samples -= s->channel[i].subframe_len[cur_subframe];
-            s->channel[i].decoded_samples +=
-                s->channel[i].subframe_len[cur_subframe];
-            s->channel_indexes_for_cur_subframe[s->channels_for_cur_subframe] = i;
-            ++s->channels_for_cur_subframe;
-        }
-    }
-
-    /* check if the frame will be complete after processing the
-        estimated block */
-    if (!total_samples)
-        s->parsed_all_subframes = 1;
-
-
-    s->seekable_tile = get_bits1(&s->gb);
-    if (s->seekable_tile) {
-        clear_codec_buffers(s);
-
-        s->do_arith_coding    = get_bits1(&s->gb);
-        if (s->do_arith_coding) {
-            avpriv_request_sample(s->avctx, "Arithmetic coding");
-            return AVERROR_PATCHWELCOME;
-        }
-        s->do_ac_filter       = get_bits1(&s->gb);
-        s->do_inter_ch_decorr = get_bits1(&s->gb);
-        s->do_mclms           = get_bits1(&s->gb);
-
-        if (s->do_ac_filter)
-            decode_ac_filter(s);
-
-        if (s->do_mclms)
-            decode_mclms(s);
-
-        if ((res = decode_cdlms(s)) < 0)
-            return res;
-        s->movave_scaling = get_bits(&s->gb, 3);
-        s->quant_stepsize = get_bits(&s->gb, 8) + 1;
-
-        reset_codec(s);
-    } else if (!s->cdlms[0][0].order) {
-        av_log(s->avctx, AV_LOG_DEBUG,
-               "Waiting for seekable tile\n");
-        av_frame_unref(s->frame);
-        return -1;
-    }
-
-    rawpcm_tile = get_bits1(&s->gb);
-
-    for (i = 0; i < s->num_channels; i++)
-        s->is_channel_coded[i] = 1;
-
-    if (!rawpcm_tile) {
-        for (i = 0; i < s->num_channels; i++)
-            s->is_channel_coded[i] = get_bits1(&s->gb);
-
-        if (s->bV3RTM) {
-            // LPC
-            s->do_lpc = get_bits1(&s->gb);
-            if (s->do_lpc) {
-                decode_lpc(s);
-                avpriv_request_sample(s->avctx, "Expect wrong output since "
-                                      "inverse LPC filter");
-            }
-        } else
-            s->do_lpc = 0;
-    }
-
-
-    if (get_bits1(&s->gb))
-        padding_zeroes = get_bits(&s->gb, 5);
-    else
-        padding_zeroes = 0;
-
-    if (rawpcm_tile) {
-        int bits = s->bits_per_sample - padding_zeroes;
-        if (bits <= 0) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Invalid number of padding bits in raw PCM tile\n");
-            return AVERROR_INVALIDDATA;
-        }
-        av_dlog(s->avctx, "RAWPCM %d bits per sample. "
-                "total %d bits, remain=%d\n", bits,
-                bits * s->num_channels * subframe_len, get_bits_count(&s->gb));
-        for (i = 0; i < s->num_channels; i++)
-            for (j = 0; j < subframe_len; j++)
-                s->channel_coeffs[i][j] = get_sbits(&s->gb, bits);
-    } else {
-        for (i = 0; i < s->num_channels; i++)
-            if (s->is_channel_coded[i]) {
-                decode_channel_residues(s, i, subframe_len);
-                if (s->seekable_tile)
-                    use_high_update_speed(s, i);
-                else
-                    use_normal_update_speed(s, i);
-                revert_cdlms(s, i, 0, subframe_len);
-            } else {
-                memset(s->channel_residues[i], 0, sizeof(**s->channel_residues) * subframe_len);
-            }
-    }
-    if (s->do_mclms)
-        revert_mclms(s, subframe_len);
-    if (s->do_inter_ch_decorr)
-        revert_inter_ch_decorr(s, subframe_len);
-    if (s->do_ac_filter)
-        revert_acfilter(s, subframe_len);
-
-    /* Dequantize */
-    if (s->quant_stepsize != 1)
-        for (i = 0; i < s->num_channels; i++)
-            for (j = 0; j < subframe_len; j++)
-                s->channel_residues[i][j] *= s->quant_stepsize;
-
-    /* Write to proper output buffer depending on bit-depth */
-    for (i = 0; i < s->channels_for_cur_subframe; i++) {
-        int c = s->channel_indexes_for_cur_subframe[i];
-        int subframe_len = s->channel[c].subframe_len[s->channel[c].cur_subframe];
-
-        for (j = 0; j < subframe_len; j++) {
-            if (s->bits_per_sample == 16) {
-                *s->samples_16[c]++ = (int16_t) s->channel_residues[c][j] << padding_zeroes;
-            } else {
-                *s->samples_32[c]++ = s->channel_residues[c][j] << padding_zeroes;
-            }
-        }
-    }
-
-    /* handled one subframe */
-    for (i = 0; i < s->channels_for_cur_subframe; i++) {
-        int c = s->channel_indexes_for_cur_subframe[i];
-        if (s->channel[c].cur_subframe >= s->channel[c].num_subframes) {
-            av_log(s->avctx, AV_LOG_ERROR, "broken subframe\n");
-            return AVERROR_INVALIDDATA;
-        }
-        ++s->channel[c].cur_subframe;
-    }
-    return 0;
-}
-
-/**
- * @brief Decode one WMA frame.
- * @param s codec context
- * @return 0 if the trailer bit indicates that this is the last frame,
- *         1 if there are additional frames
- */
-static int decode_frame(WmallDecodeCtx *s)
-{
-    GetBitContext* gb = &s->gb;
-    int more_frames = 0, len = 0, i, ret;
-
-    s->frame->nb_samples = s->samples_per_frame;
-    if ((ret = ff_get_buffer(s->avctx, s->frame, 0)) < 0) {
-        /* return an error if no frame could be decoded at all */
-        av_log(s->avctx, AV_LOG_ERROR,
-               "not enough space for the output samples\n");
-        s->packet_loss = 1;
-        return ret;
-    }
-    for (i = 0; i < s->num_channels; i++) {
-        s->samples_16[i] = (int16_t *)s->frame->extended_data[i];
-        s->samples_32[i] = (int32_t *)s->frame->extended_data[i];
-    }
-
-    /* get frame length */
-    if (s->len_prefix)
-        len = get_bits(gb, s->log2_frame_size);
-
-    /* decode tile information */
-    if (decode_tilehdr(s)) {
-        s->packet_loss = 1;
-        return 0;
-    }
-
-    /* read drc info */
-    if (s->dynamic_range_compression)
-        s->drc_gain = get_bits(gb, 8);
-
-    /* no idea what these are for, might be the number of samples
-       that need to be skipped at the beginning or end of a stream */
-    if (get_bits1(gb)) {
-        int av_unused skip;
-
-        /* usually true for the first frame */
-        if (get_bits1(gb)) {
-            skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            av_dlog(s->avctx, "start skip: %i\n", skip);
-        }
-
-        /* sometimes true for the last frame */
-        if (get_bits1(gb)) {
-            skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            av_dlog(s->avctx, "end skip: %i\n", skip);
-        }
-
-    }
-
-    /* reset subframe states */
-    s->parsed_all_subframes = 0;
-    for (i = 0; i < s->num_channels; i++) {
-        s->channel[i].decoded_samples = 0;
-        s->channel[i].cur_subframe    = 0;
-    }
-
-    /* decode all subframes */
-    while (!s->parsed_all_subframes) {
-        if (decode_subframe(s) < 0) {
-            s->packet_loss = 1;
-            return 0;
-        }
-    }
-
-    av_dlog(s->avctx, "Frame done\n");
-
-    if (s->skip_frame)
-        s->skip_frame = 0;
-
-    if (s->len_prefix) {
-        if (len != (get_bits_count(gb) - s->frame_offset) + 2) {
-            /* FIXME: not sure if this is always an error */
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "frame[%i] would have to skip %i bits\n", s->frame_num,
-                   len - (get_bits_count(gb) - s->frame_offset) - 1);
-            s->packet_loss = 1;
-            return 0;
-        }
-
-        /* skip the rest of the frame data */
-        skip_bits_long(gb, len - (get_bits_count(gb) - s->frame_offset) - 1);
-    }
-
-    /* decode trailer bit */
-    more_frames = get_bits1(gb);
-    ++s->frame_num;
-    return more_frames;
-}
-
-/**
- * @brief Calculate remaining input buffer length.
- * @param s  codec context
- * @param gb bitstream reader context
- * @return remaining size in bits
- */
-static int remaining_bits(WmallDecodeCtx *s, GetBitContext *gb)
-{
-    return s->buf_bit_size - get_bits_count(gb);
-}
-
-/**
- * @brief Fill the bit reservoir with a (partial) frame.
- * @param s      codec context
- * @param gb     bitstream reader context
- * @param len    length of the partial frame
- * @param append decides whether to reset the buffer or not
- */
-static void save_bits(WmallDecodeCtx *s, GetBitContext* gb, int len,
-                      int append)
-{
-    int buflen;
-    PutBitContext tmp;
-
-    /* when the frame data does not need to be concatenated, the input buffer
-        is reset and additional bits from the previous frame are copied
-        and skipped later so that a fast byte copy is possible */
-
-    if (!append) {
-        s->frame_offset   = get_bits_count(gb) & 7;
-        s->num_saved_bits = s->frame_offset;
-        init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
-    }
-
-    buflen = (s->num_saved_bits + len + 8) >> 3;
-
-    if (len <= 0 || buflen > MAX_FRAMESIZE) {
-        avpriv_request_sample(s->avctx, "Too small input buffer");
-        s->packet_loss = 1;
-        return;
-    }
-
-    s->num_saved_bits += len;
-    if (!append) {
-        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3),
-                         s->num_saved_bits);
-    } else {
-        int align = 8 - (get_bits_count(gb) & 7);
-        align = FFMIN(align, len);
-        put_bits(&s->pb, align, get_bits(gb, align));
-        len -= align;
-        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len);
-    }
-    skip_bits_long(gb, len);
-
-    tmp = s->pb;
-    flush_put_bits(&tmp);
-
-    init_get_bits(&s->gb, s->frame_data, s->num_saved_bits);
-    skip_bits(&s->gb, s->frame_offset);
-}
-
-static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
-                         AVPacket* avpkt)
-{
-    WmallDecodeCtx *s = avctx->priv_data;
-    GetBitContext* gb  = &s->pgb;
-    const uint8_t* buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    int num_bits_prev_frame, packet_sequence_number, spliced_packet;
-
-    s->frame->nb_samples = 0;
-
-    if (s->packet_done || s->packet_loss) {
-        s->packet_done = 0;
-
-        /* sanity check for the buffer length */
-        if (buf_size < avctx->block_align)
-            return 0;
-
-        s->next_packet_start = buf_size - avctx->block_align;
-        buf_size             = avctx->block_align;
-        s->buf_bit_size      = buf_size << 3;
-
-        /* parse packet header */
-        init_get_bits(gb, buf, s->buf_bit_size);
-        packet_sequence_number = get_bits(gb, 4);
-        skip_bits(gb, 1);   // Skip seekable_frame_in_packet, currently ununused
-        spliced_packet = get_bits1(gb);
-        if (spliced_packet)
-            avpriv_request_sample(avctx, "Bitstream splicing");
-
-        /* get number of bits that need to be added to the previous frame */
-        num_bits_prev_frame = get_bits(gb, s->log2_frame_size);
-
-        /* check for packet loss */
-        if (!s->packet_loss &&
-            ((s->packet_sequence_number + 1) & 0xF) != packet_sequence_number) {
-            s->packet_loss = 1;
-            av_log(avctx, AV_LOG_ERROR, "Packet loss detected! seq %x vs %x\n",
-                   s->packet_sequence_number, packet_sequence_number);
-        }
-        s->packet_sequence_number = packet_sequence_number;
-
-        if (num_bits_prev_frame > 0) {
-            int remaining_packet_bits = s->buf_bit_size - get_bits_count(gb);
-            if (num_bits_prev_frame >= remaining_packet_bits) {
-                num_bits_prev_frame = remaining_packet_bits;
-                s->packet_done = 1;
-            }
-
-            /* Append the previous frame data to the remaining data from the
-             * previous packet to create a full frame. */
-            save_bits(s, gb, num_bits_prev_frame, 1);
-
-            /* decode the cross packet frame if it is valid */
-            if (num_bits_prev_frame < remaining_packet_bits && !s->packet_loss)
-                decode_frame(s);
-        } else if (s->num_saved_bits - s->frame_offset) {
-            av_dlog(avctx, "ignoring %x previously saved bits\n",
-                    s->num_saved_bits - s->frame_offset);
-        }
-
-        if (s->packet_loss) {
-            /* Reset number of saved bits so that the decoder does not start
-             * to decode incomplete frames in the s->len_prefix == 0 case. */
-            s->num_saved_bits = 0;
-            s->packet_loss    = 0;
-            init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
-        }
-
-    } else {
-        int frame_size;
-
-        s->buf_bit_size = (avpkt->size - s->next_packet_start) << 3;
-        init_get_bits(gb, avpkt->data, s->buf_bit_size);
-        skip_bits(gb, s->packet_offset);
-
-        if (s->len_prefix && remaining_bits(s, gb) > s->log2_frame_size &&
-            (frame_size = show_bits(gb, s->log2_frame_size)) &&
-            frame_size <= remaining_bits(s, gb)) {
-            save_bits(s, gb, frame_size, 0);
-            s->packet_done = !decode_frame(s);
-        } else if (!s->len_prefix
-                   && s->num_saved_bits > get_bits_count(&s->gb)) {
-            /* when the frames do not have a length prefix, we don't know the
-             * compressed length of the individual frames however, we know what
-             * part of a new packet belongs to the previous frame therefore we
-             * save the incoming packet first, then we append the "previous
-             * frame" data from the next packet so that we get a buffer that
-             * only contains full frames */
-            s->packet_done = !decode_frame(s);
-        } else {
-            s->packet_done = 1;
-        }
-    }
-
-    if (s->packet_done && !s->packet_loss &&
-        remaining_bits(s, gb) > 0) {
-        /* save the rest of the data so that it can be decoded
-         * with the next packet */
-        save_bits(s, gb, remaining_bits(s, gb), 0);
-    }
-
-    *got_frame_ptr   = s->frame->nb_samples > 0;
-    av_frame_move_ref(data, s->frame);
-
-    s->packet_offset = get_bits_count(gb) & 7;
-
-    return (s->packet_loss) ? AVERROR_INVALIDDATA : get_bits_count(gb) >> 3;
-}
-
-static void flush(AVCodecContext *avctx)
-{
-    WmallDecodeCtx *s    = avctx->priv_data;
-    s->packet_loss       = 1;
-    s->packet_done       = 0;
-    s->num_saved_bits    = 0;
-    s->frame_offset      = 0;
-    s->next_packet_start = 0;
-    s->cdlms[0][0].order = 0;
-    s->frame->nb_samples = 0;
-    init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
-}
-
-static av_cold int decode_close(AVCodecContext *avctx)
-{
-    WmallDecodeCtx *s = avctx->priv_data;
-
-    av_frame_free(&s->frame);
-
-    return 0;
-}
-
-AVCodec ff_wmalossless_decoder = {
-    .name           = "wmalossless",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Audio Lossless"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_WMALOSSLESS,
-    .priv_data_size = sizeof(WmallDecodeCtx),
-    .init           = decode_init,
-    .close          = decode_close,
-    .decode         = decode_packet,
-    .flush          = flush,
-    .capabilities   = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
-                                                      AV_SAMPLE_FMT_S32P,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/wmaprodata.h b/deps/libav/libavcodec/wmaprodata.h
deleted file mode 100644
index f8a52bf..0000000
--- a/deps/libav/libavcodec/wmaprodata.h
+++ /dev/null
@@ -1,604 +0,0 @@
-/*
- * WMA 9/3/PRO compatible decoder
- * Copyright (c) 2007 Baptiste Coudurier, Benjamin Larsson, Ulion
- * Copyright (c) 2008 - 2009 Sascha Sommer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief tables for wmapro decoding
- */
-
-#ifndef AVCODEC_WMAPRODATA_H
-#define AVCODEC_WMAPRODATA_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-/**
- * @brief frequencies to divide the frequency spectrum into scale factor bands
- */
-static const uint16_t critical_freq[] = {
-     100,   200,    300,    400,    510,    630,    770,
-     920,  1080,   1270,   1480,   1720,   2000,   2320,
-    2700,  3150,   3700,   4400,   5300,   6400,   7700,
-    9500, 12000,  15500,  20675,  28575,  41375,  63875,
-};
-
-
-/**
- * @name Huffman tables for DPCM-coded scale factors
- * @{
- */
-#define HUFF_SCALE_SIZE    121
-#define HUFF_SCALE_MAXBITS  19
-static const uint16_t scale_huffcodes[HUFF_SCALE_SIZE] = {
-    0xE639, 0xE6C2, 0xE6C1, 0xE6C0, 0xE63F, 0xE63E, 0xE63D, 0xE63C,
-    0xE63B, 0xE63A, 0xE638, 0xE637, 0xE636, 0xE635, 0xE634, 0xE632,
-    0xE633, 0xE620, 0x737B, 0xE610, 0xE611, 0xE612, 0xE613, 0xE614,
-    0xE615, 0xE616, 0xE617, 0xE618, 0xE619, 0xE61A, 0xE61B, 0xE61C,
-    0xE61D, 0xE61E, 0xE61F, 0xE6C3, 0xE621, 0xE622, 0xE623, 0xE624,
-    0xE625, 0xE626, 0xE627, 0xE628, 0xE629, 0xE62A, 0xE62B, 0xE62C,
-    0xE62D, 0xE62E, 0xE62F, 0xE630, 0xE631, 0x1CDF, 0x0E60, 0x0399,
-    0x00E7, 0x001D, 0x0000, 0x0001, 0x0001, 0x0001, 0x0002, 0x0006,
-    0x0002, 0x0007, 0x0006, 0x000F, 0x0038, 0x0072, 0x039A, 0xE6C4,
-    0xE6C5, 0xE6C6, 0xE6C7, 0xE6C8, 0xE6C9, 0xE6CA, 0xE6CB, 0xE6CC,
-    0xE6CD, 0xE6CE, 0xE6CF, 0xE6D0, 0xE6D1, 0xE6D2, 0xE6D3, 0xE6D4,
-    0xE6D5, 0xE6D6, 0xE6D7, 0xE6D8, 0xE6D9, 0xE6DA, 0xE6DB, 0xE6DC,
-    0xE6DD, 0xE6DE, 0xE6DF, 0xE6E0, 0xE6E1, 0xE6E2, 0xE6E3, 0xE6E4,
-    0xE6E5, 0xE6E6, 0xE6E7, 0xE6E8, 0xE6E9, 0xE6EA, 0xE6EB, 0xE6EC,
-    0xE6ED, 0xE6EE, 0xE6EF, 0xE6F0, 0xE6F1, 0xE6F2, 0xE6F3, 0xE6F4,
-    0xE6F5,
-};
-
-static const uint8_t scale_huffbits[HUFF_SCALE_SIZE] = {
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 18, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 16, 15, 13,
-    11,  8,  5,  2,  1,  3,  5,  6,
-     6,  7,  7,  7,  9, 10, 13, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19,
-};
-/** @} */
-
-
-/**
- * @name Huffman, run and level tables for runlevel-coded scale factors
- * @{
- */
-#define HUFF_SCALE_RL_SIZE    120
-#define HUFF_SCALE_RL_MAXBITS  21
-static const uint32_t scale_rl_huffcodes[HUFF_SCALE_RL_SIZE] = {
-    0x00010C, 0x000001, 0x10FE2A, 0x000003, 0x000003, 0x000001, 0x000013,
-    0x000020, 0x000029, 0x000014, 0x000016, 0x000045, 0x000049, 0x00002F,
-    0x000042, 0x00008E, 0x00008F, 0x000129, 0x000009, 0x00000D, 0x0004AC,
-    0x00002C, 0x000561, 0x0002E6, 0x00087C, 0x0002E2, 0x00095C, 0x000018,
-    0x000001, 0x000016, 0x000044, 0x00002A, 0x000007, 0x000159, 0x000143,
-    0x000128, 0x00015A, 0x00012D, 0x00002B, 0x0000A0, 0x000142, 0x00012A,
-    0x0002EF, 0x0004AF, 0x00087D, 0x004AE9, 0x0043F9, 0x000067, 0x000199,
-    0x002B05, 0x001583, 0x0021FE, 0x10FE2C, 0x000004, 0x00002E, 0x00010D,
-    0x00000A, 0x000244, 0x000017, 0x000245, 0x000011, 0x00010E, 0x00012C,
-    0x00002A, 0x00002F, 0x000121, 0x000046, 0x00087E, 0x0000BA, 0x000032,
-    0x0087F0, 0x0056DC, 0x0002EC, 0x0043FA, 0x002B6F, 0x004AE8, 0x0002B7,
-    0x10FE2B, 0x000001, 0x000051, 0x000010, 0x0002EE, 0x000B9C, 0x002576,
-    0x000198, 0x0056DD, 0x0000CD, 0x000AC0, 0x000170, 0x004AEF, 0x00002D,
-    0x0004AD, 0x0021FF, 0x0005CF, 0x002B04, 0x10FE29, 0x10FE28, 0x0002ED,
-    0x002E74, 0x021FC4, 0x004AEE, 0x010FE3, 0x087F17, 0x000000, 0x000097,
-    0x0002E3, 0x000ADA, 0x002575, 0x00173B, 0x0043FB, 0x002E75, 0x10FE2D,
-    0x0015B6, 0x00056C, 0x000057, 0x000123, 0x000120, 0x00021E, 0x000172,
-    0x0002B1,
-};
-
-static const uint8_t scale_rl_huffbits[HUFF_SCALE_RL_SIZE] = {
-     9,  2, 21,  2,  4,  5,  5,
-     6,  6,  7,  7,  7,  7,  6,
-     7,  8,  8,  9, 10, 10, 11,
-    12, 11, 12, 12, 12, 12, 11,
-     4,  5,  7,  8,  9,  9,  9,
-     9,  9,  9,  8,  8,  9,  9,
-    12, 11, 12, 15, 15, 13, 15,
-    14, 13, 14, 21,  5,  6,  9,
-    10, 10, 11, 10, 11,  9,  9,
-     6,  8,  9,  7, 12, 10, 12,
-    16, 15, 12, 15, 14, 15, 10,
-    21,  6,  7, 11, 12, 14, 14,
-    15, 15, 14, 12, 11, 15, 12,
-    11, 14, 13, 14, 21, 21, 12,
-    16, 18, 15, 17, 20,  7,  8,
-    12, 12, 14, 15, 15, 16, 21,
-    13, 11,  7,  9,  9, 10, 11,
-    10,
-};
-
-
-static const uint8_t scale_rl_run[HUFF_SCALE_RL_SIZE] = {
-     0,  0,  0,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
-    10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,  0,  1,  2,  3,
-     4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
-    23, 24,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
-    17, 18, 19, 20, 21, 22, 23, 24,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10,
-     0,  1,  0,  1,  0,  1,
-};
-
-static const uint8_t scale_rl_level[HUFF_SCALE_RL_SIZE] = {
-     0,  0,  1,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
-     3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,  4,
-     4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
-     4,  4,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
-     5,  5,  5,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,
-     7,  7,  8,  8,  9,  9,
-};
-/** @} */
-
-
-/**
- * @name Huffman, run and level codes for runlevel-coded coefficients
- * @{
- */
-#define HUFF_COEF0_SIZE    272
-#define HUFF_COEF0_MAXBITS  21
-static const uint32_t coef0_huffcodes[HUFF_COEF0_SIZE] = {
-    0x00004A, 0x00002B, 0x000000, 0x000003, 0x000006, 0x000009, 0x00000F,
-    0x000010, 0x000016, 0x000011, 0x000016, 0x000028, 0x00002F, 0x000026,
-    0x000029, 0x000045, 0x000055, 0x00005D, 0x000042, 0x00004E, 0x000051,
-    0x00005E, 0x00008D, 0x0000A8, 0x0000AD, 0x000080, 0x000096, 0x00009F,
-    0x0000AA, 0x0000BE, 0x00011C, 0x000153, 0x000158, 0x000170, 0x000104,
-    0x00010D, 0x000105, 0x000103, 0x00012F, 0x000177, 0x000175, 0x000157,
-    0x000174, 0x000225, 0x00023B, 0x00020D, 0x00021F, 0x000281, 0x00027B,
-    0x000282, 0x0002AC, 0x0002FD, 0x00044F, 0x000478, 0x00044D, 0x0002EC,
-    0x00044E, 0x000564, 0x000409, 0x00040B, 0x000501, 0x000545, 0x0004F3,
-    0x000541, 0x00043B, 0x0004F1, 0x0004F4, 0x0008FD, 0x000A94, 0x000811,
-    0x000B88, 0x000B91, 0x000B93, 0x0008EA, 0x000899, 0x000B8A, 0x000972,
-    0x0009E5, 0x000A8F, 0x000A84, 0x000A8E, 0x000A00, 0x000830, 0x0008E8,
-    0x000B95, 0x000871, 0x00083A, 0x000814, 0x000873, 0x000BFE, 0x001728,
-    0x001595, 0x001712, 0x00102A, 0x001021, 0x001729, 0x00152E, 0x0013C3,
-    0x001721, 0x001597, 0x00151B, 0x0010F2, 0x001403, 0x001703, 0x001503,
-    0x001708, 0x0013C1, 0x00170E, 0x00170C, 0x0010E1, 0x0011EA, 0x001020,
-    0x001500, 0x0017FA, 0x001704, 0x001705, 0x0017F0, 0x0017FB, 0x0021E6,
-    0x002B2D, 0x0020C6, 0x002B29, 0x002E4A, 0x0023AC, 0x001519, 0x0023F3,
-    0x002B2C, 0x0021C0, 0x0017FE, 0x0023D7, 0x0017F9, 0x0012E7, 0x0013C0,
-    0x002261, 0x0023D3, 0x002057, 0x002056, 0x0021D2, 0x0020C7, 0x0023D2,
-    0x0020EC, 0x0044C0, 0x002FE2, 0x00475B, 0x002A03, 0x002FE3, 0x0021E2,
-    0x0021D0, 0x002A31, 0x002E13, 0x002E05, 0x0047E5, 0x00000E, 0x000024,
-    0x000088, 0x0000B9, 0x00010C, 0x000224, 0x0002B3, 0x000283, 0x0002ED,
-    0x00047B, 0x00041E, 0x00043D, 0x0004F5, 0x0005FD, 0x000A92, 0x000B96,
-    0x000838, 0x000971, 0x000B83, 0x000B80, 0x000BF9, 0x0011D3, 0x0011E8,
-    0x0011D7, 0x001527, 0x0011F8, 0x001073, 0x0010F0, 0x0010E4, 0x0017F8,
-    0x001062, 0x001402, 0x0017E3, 0x00151A, 0x001077, 0x00152B, 0x00170D,
-    0x0021D3, 0x002E41, 0x0013C2, 0x000029, 0x0000A9, 0x00025D, 0x000419,
-    0x000544, 0x000B8B, 0x0009E4, 0x0011D2, 0x001526, 0x001724, 0x0012E6,
-    0x00150B, 0x0017FF, 0x002E26, 0x002E4B, 0x002B28, 0x0021E3, 0x002A14,
-    0x00475A, 0x002E12, 0x000057, 0x00023E, 0x000A90, 0x000BF0, 0x001072,
-    0x001502, 0x0023D6, 0x0020ED, 0x002A30, 0x0044C7, 0x00008C, 0x00047F,
-    0x00152A, 0x002262, 0x002E04, 0x0000A1, 0x0005F9, 0x000173, 0x000875,
-    0x000171, 0x00152D, 0x0002E3, 0x0017E2, 0x0002AD, 0x0021C1, 0x000479,
-    0x0021E7, 0x00041F, 0x005C4E, 0x000543, 0x005C4F, 0x000A91, 0x00898D,
-    0x000B97, 0x008746, 0x000970, 0x008745, 0x000B85, 0x00A856, 0x00152F,
-    0x010E8E, 0x0010E5, 0x00A857, 0x00170F, 0x021D11, 0x002A58, 0x010E8F,
-    0x002E40, 0x021D13, 0x002A59, 0x043A25, 0x002A02, 0x043A21, 0x0044C1,
-    0x087448, 0x0047E4, 0x043A20, 0x00542A, 0x087449, 0x00898C,
-};
-
-static const uint8_t coef0_huffbits[HUFF_COEF0_SIZE] = {
-     8,  7,  2,  3,  3,  4,  4,
-     5,  5,  6,  6,  6,  6,  7,
-     7,  7,  7,  7,  8,  8,  8,
-     8,  8,  8,  8,  9,  9,  9,
-     9,  9,  9,  9,  9,  9, 10,
-    10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11,
-    11, 11, 12, 12, 12, 12, 12,
-    12, 12, 12, 12, 12, 12, 13,
-    12, 12, 12, 12, 12, 12, 13,
-    13, 13, 13, 13, 13, 13, 12,
-    12, 13, 13, 13, 13, 13, 13,
-    13, 13, 14, 14, 13, 13, 14,
-    13, 13, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 13, 14,
-    14, 14, 14, 14, 14, 14, 15,
-    14, 15, 14, 14, 14, 14, 14,
-    14, 15, 14, 14, 14, 14, 14,
-    14, 14, 15, 15, 15, 15, 14,
-    15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15,  4,  7,
-     8,  9, 10, 10, 10, 11, 11,
-    11, 12, 12, 12, 12, 12, 12,
-    13, 13, 13, 13, 13, 13, 13,
-    13, 13, 13, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 13, 14,
-    15, 14, 14,  6,  9, 11, 12,
-    12, 12, 13, 13, 13, 13, 14,
-    14, 14, 14, 14, 14, 15, 15,
-    15, 15,  7, 10, 12, 13, 14,
-    14, 14, 15, 15, 15,  8, 11,
-    13, 14, 15,  9, 12,  9, 13,
-    10, 13, 10, 14, 11, 15, 11,
-    15, 12, 15, 12, 15, 12, 16,
-    12, 17, 13, 17, 13, 17, 13,
-    18, 14, 17, 14, 19, 14, 18,
-    14, 19, 14, 20, 15, 20, 15,
-    21, 15, 20, 16, 21, 16,
-};
-
-
-#define HUFF_COEF1_SIZE    244
-#define HUFF_COEF1_MAXBITS  22
-static const uint32_t coef1_huffcodes[HUFF_COEF1_SIZE] = {
-    0x0001E2, 0x00007F, 0x000000, 0x000002, 0x000008, 0x00000E, 0x000019,
-    0x00002F, 0x000037, 0x000060, 0x00006C, 0x000095, 0x0000C6, 0x0000F0,
-    0x00012E, 0x000189, 0x0001A5, 0x0001F8, 0x000253, 0x00030A, 0x000344,
-    0x00034D, 0x0003F2, 0x0004BD, 0x0005D7, 0x00062A, 0x00068B, 0x000693,
-    0x000797, 0x00097D, 0x000BAB, 0x000C52, 0x000C5E, 0x000D21, 0x000D20,
-    0x000F1A, 0x000FCE, 0x000FD1, 0x0012F1, 0x001759, 0x0018AC, 0x0018A7,
-    0x0018BF, 0x001A2B, 0x001E52, 0x001E50, 0x001E31, 0x001FB8, 0x0025E6,
-    0x0025E7, 0x002EB4, 0x002EB7, 0x003169, 0x00315B, 0x00317C, 0x00316C,
-    0x0034CA, 0x00348D, 0x003F40, 0x003CA2, 0x003F76, 0x004BC3, 0x004BE5,
-    0x003F73, 0x004BF8, 0x004BF9, 0x006131, 0x00628B, 0x006289, 0x0062DA,
-    0x00628A, 0x0062D4, 0x006997, 0x0062B4, 0x006918, 0x00794D, 0x007E7B,
-    0x007E87, 0x007EEA, 0x00794E, 0x00699D, 0x007967, 0x00699F, 0x0062DB,
-    0x007E7A, 0x007EEB, 0x00BAC0, 0x0097C9, 0x00C537, 0x00C5AB, 0x00D233,
-    0x00D338, 0x00BAC1, 0x00D23D, 0x012F91, 0x00D339, 0x00FDC8, 0x00D23C,
-    0x00FDDC, 0x00FDC9, 0x00FDDD, 0x00D33C, 0x000003, 0x000016, 0x00003E,
-    0x0000C3, 0x0001A1, 0x000347, 0x00062E, 0x000BAA, 0x000F2D, 0x001A2A,
-    0x001E58, 0x00309B, 0x003CA3, 0x005D6A, 0x00629A, 0x006996, 0x00794F,
-    0x007EE5, 0x00BAD7, 0x00C5AA, 0x00C5F4, 0x00FDDF, 0x00FDDE, 0x018A20,
-    0x018A6D, 0x01A67B, 0x01A464, 0x025F21, 0x01F9E2, 0x01F9E3, 0x00000A,
-    0x00003D, 0x000128, 0x0003C7, 0x000C24, 0x0018A3, 0x002EB1, 0x003CB2,
-    0x00691F, 0x007E79, 0x000013, 0x0000BB, 0x00034E, 0x000D14, 0x0025FD,
-    0x004BE7, 0x000024, 0x000188, 0x0007EF, 0x000035, 0x000308, 0x0012F2,
-    0x00005C, 0x0003F6, 0x0025E0, 0x00006D, 0x000698, 0x000096, 0x000C25,
-    0x0000C7, 0x000F1B, 0x0000F3, 0x0012FF, 0x000174, 0x001A66, 0x0001A0,
-    0x003099, 0x0001E4, 0x00316B, 0x000252, 0x003F31, 0x00030B, 0x004BE6,
-    0x000346, 0x0062FB, 0x00034F, 0x007966, 0x0003F5, 0x007E86, 0x0005D4,
-    0x00C511, 0x00062C, 0x00C5F5, 0x000692, 0x00F299, 0x000795, 0x00F298,
-    0x0007E9, 0x018A21, 0x00097E, 0x0175AD, 0x000C27, 0x01A67A, 0x000C57,
-    0x02EB59, 0x000D22, 0x0314D9, 0x000F19, 0x03F3C2, 0x000FCD, 0x0348CB,
-    0x0012F8, 0x04BE41, 0x0018A0, 0x03F3C1, 0x0018A1, 0x04BE40, 0x0018B7,
-    0x0629B0, 0x001A64, 0x0D2329, 0x001E30, 0x03F3C3, 0x001F9F, 0x0BAD62,
-    0x001F99, 0x0FCF00, 0x00309A, 0x0629B1, 0x002EB6, 0x175AC3, 0x00314C,
-    0x069195, 0x003168, 0x0BAD63, 0x00348E, 0x175AC1, 0x003F30, 0x07E781,
-    0x003F41, 0x0D2328, 0x003F42, 0x1F9E03, 0x004BC2, 0x175AC2, 0x003F74,
-    0x175AC0, 0x005D61, 0x3F3C05, 0x006130, 0x3F3C04, 0x0062B5,
-};
-
-static const uint8_t coef1_huffbits[HUFF_COEF1_SIZE] = {
-     9,  7,  2,  3,  4,  4,  5,
-     6,  6,  7,  7,  8,  8,  8,
-     9,  9,  9,  9, 10, 10, 10,
-    10, 10, 11, 11, 11, 11, 11,
-    11, 12, 12, 12, 12, 12, 12,
-    12, 12, 12, 13, 13, 13, 13,
-    13, 13, 13, 13, 13, 13, 14,
-    14, 14, 14, 14, 14, 14, 14,
-    14, 14, 14, 14, 14, 15, 15,
-    14, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15,
-    15, 15, 16, 16, 16, 16, 16,
-    16, 16, 16, 17, 16, 16, 16,
-    16, 16, 16, 16,  3,  5,  6,
-     8,  9, 10, 11, 12, 12, 13,
-    13, 14, 14, 15, 15, 15, 15,
-    15, 16, 16, 16, 16, 16, 17,
-    17, 17, 17, 18, 17, 17,  4,
-     6,  9, 10, 12, 13, 14, 14,
-    15, 15,  5,  8, 10, 12, 14,
-    15,  6,  9, 11,  6, 10, 13,
-     7, 10, 14,  7, 11,  8, 12,
-     8, 12,  8, 13,  9, 13,  9,
-    14,  9, 14, 10, 14, 10, 15,
-    10, 15, 10, 15, 10, 15, 11,
-    16, 11, 16, 11, 16, 11, 16,
-    11, 17, 12, 17, 12, 17, 12,
-    18, 12, 18, 12, 18, 12, 18,
-    13, 19, 13, 18, 13, 19, 13,
-    19, 13, 20, 13, 18, 13, 20,
-    13, 20, 14, 19, 14, 21, 14,
-    19, 14, 20, 14, 21, 14, 19,
-    14, 20, 14, 21, 15, 21, 14,
-    21, 15, 22, 15, 22, 15,
-};
-
-
-static const uint16_t coef0_run[HUFF_COEF0_SIZE] = {
-      0,   0,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,
-     12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,
-     26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,
-     40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,
-     54,  55,  56,  57,  58,  59,  60,  61,  62,  63,  64,  65,  66,  67,
-     68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,  81,
-     82,  83,  84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,
-     96,  97,  98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
-    110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
-    124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
-    138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,   0,   1,
-      2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
-     16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,
-     30,  31,  32,  33,  34,  35,  36,  37,  38,  39,   0,   1,   2,   3,
-      4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,
-     18,  19,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   1,
-      2,   3,   4,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,
-      1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,
-      1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,
-      1,   0,   1,   0,   1,   0,
-};
-
-static const float coef0_level[HUFF_COEF0_SIZE] = {
-      0,   0,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-      1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   2,   2,
-      2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,
-      2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,
-      2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   3,   3,   3,   3,
-      3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,
-      3,   3,   4,   4,   4,   4,   4,   4,   4,   4,   4,   4,   5,   5,
-      5,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,
-     11,  12,  12,  13,  13,  14,  14,  15,  15,  16,  16,  17,  17,  18,
-     18,  19,  19,  20,  20,  21,  21,  22,  22,  23,  23,  24,  24,  25,
-     25,  26,  26,  27,  27,  28,
-};
-
-
-static const uint16_t coef1_run[HUFF_COEF1_SIZE] = {
-     0,  0,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
-    34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
-    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
-    70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
-    88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,  0,  1,  2,  3,  4,  5,
-     6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
-    24, 25, 26, 27, 28, 29,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  0,  1,
-     2,  3,  4,  5,  0,  1,  2,  0,  1,  2,  0,  1,  2,  0,  1,  0,  1,  0,
-     1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,
-     1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,
-     1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,
-     1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1,  0,
-     1,  0,  1,  0,  1,  0,  1,  0,  0,  0,
-};
-
-static const float coef1_level[HUFF_COEF1_SIZE] = {
-     0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-     1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
-     2,  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,
-     4,  4,  4,  4,  5,  5,  5,  6,  6,  6,  7,  7,  7,  8,  8,  9,  9, 10,
-    10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19,
-    19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28,
-    28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37,
-    37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46,
-    46, 47, 47, 48, 48, 49, 49, 50, 51, 52,
-};
-/** @} */
-
-
-/**
- * @name Huffman and vector lookup tables for vector-coded coefficients
- * @{
- */
-#define HUFF_VEC4_SIZE    127
-#define HUFF_VEC4_MAXBITS  14
-static const uint16_t vec4_huffcodes[HUFF_VEC4_SIZE] = {
-    0x0019, 0x0027, 0x00F2, 0x03BA, 0x0930, 0x1267, 0x0031, 0x0030,
-    0x0097, 0x0221, 0x058B, 0x0124, 0x00EB, 0x01D4, 0x03D8, 0x0584,
-    0x0364, 0x045F, 0x0F66, 0x0931, 0x24CD, 0x002F, 0x0039, 0x00E8,
-    0x02C3, 0x078A, 0x0037, 0x0029, 0x0084, 0x01B1, 0x00ED, 0x0086,
-    0x00F9, 0x03AB, 0x01EB, 0x08BC, 0x011E, 0x00F3, 0x0220, 0x058A,
-    0x00EC, 0x008E, 0x012B, 0x01EA, 0x0119, 0x04B0, 0x04B1, 0x03B8,
-    0x0691, 0x0365, 0x01ED, 0x049A, 0x0EA9, 0x0EA8, 0x08BD, 0x24CC,
-    0x0026, 0x0035, 0x00DB, 0x02C4, 0x07B2, 0x0038, 0x002B, 0x007F,
-    0x01B3, 0x00F4, 0x0091, 0x0116, 0x03BB, 0x0215, 0x0932, 0x002D,
-    0x002A, 0x008A, 0x01DE, 0x0028, 0x0020, 0x005C, 0x0090, 0x0068,
-    0x01EE, 0x00E9, 0x008D, 0x012A, 0x0087, 0x005D, 0x0118, 0x0349,
-    0x01EF, 0x01E3, 0x08B9, 0x00F0, 0x00D3, 0x0214, 0x049B, 0x00DA,
-    0x0089, 0x0125, 0x0217, 0x012D, 0x0690, 0x0094, 0x007D, 0x011F,
-    0x007E, 0x0059, 0x0127, 0x01A5, 0x0111, 0x00F8, 0x045D, 0x03B9,
-    0x0259, 0x0580, 0x02C1, 0x01DF, 0x0585, 0x0216, 0x0163, 0x01B0,
-    0x03C4, 0x08B8, 0x078B, 0x0755, 0x0581, 0x0F67, 0x0000,
-};
-
-static const uint8_t vec4_huffbits[HUFF_VEC4_SIZE] = {
-     5,  6,  8, 10, 12, 13,  6,  6,
-     8, 10, 11,  9,  8,  9, 10, 11,
-    10, 11, 12, 12, 14,  6,  6,  8,
-    10, 11,  6,  6,  8,  9,  8,  8,
-     8, 10,  9, 12,  9,  8, 10, 11,
-     8,  8,  9,  9,  9, 11, 11, 10,
-    11, 10,  9, 11, 12, 12, 12, 14,
-     6,  6,  8, 10, 11,  6,  6,  7,
-     9,  8,  8,  9, 10, 10, 12,  6,
-     6,  8,  9,  6,  6,  7,  8,  7,
-     9,  8,  8,  9,  8,  7,  9, 10,
-     9,  9, 12,  8,  8, 10, 11,  8,
-     8,  9, 10,  9, 11,  8,  7,  9,
-     7,  7,  9,  9,  9,  8, 11, 10,
-    10, 11, 10,  9, 11, 10,  9,  9,
-    10, 12, 11, 11, 11, 12,  1,
-};
-
-
-#define HUFF_VEC2_SIZE    137
-#define HUFF_VEC2_MAXBITS  12
-static const uint16_t vec2_huffcodes[HUFF_VEC2_SIZE] = {
-    0x055, 0x01C, 0x01A, 0x02B, 0x028, 0x067, 0x08B, 0x039,
-    0x170, 0x10D, 0x2A5, 0x047, 0x464, 0x697, 0x523, 0x8CB,
-    0x01B, 0x00E, 0x000, 0x010, 0x012, 0x036, 0x048, 0x04C,
-    0x0C2, 0x09B, 0x171, 0x03B, 0x224, 0x34A, 0x2D6, 0x019,
-    0x00F, 0x002, 0x014, 0x017, 0x006, 0x05D, 0x054, 0x0C7,
-    0x0B4, 0x192, 0x10E, 0x233, 0x043, 0x02C, 0x00F, 0x013,
-    0x006, 0x02F, 0x02C, 0x068, 0x077, 0x0DF, 0x111, 0x1A4,
-    0x16A, 0x2A4, 0x027, 0x011, 0x018, 0x02D, 0x00F, 0x04A,
-    0x040, 0x097, 0x01F, 0x11B, 0x022, 0x16D, 0x066, 0x035,
-    0x005, 0x02B, 0x049, 0x009, 0x075, 0x0CB, 0x0AA, 0x187,
-    0x106, 0x08A, 0x047, 0x060, 0x06E, 0x01D, 0x074, 0x0C4,
-    0x01E, 0x118, 0x1A7, 0x038, 0x042, 0x053, 0x076, 0x0A8,
-    0x0CA, 0x082, 0x110, 0x18D, 0x12D, 0x0B9, 0x0C8, 0x0DE,
-    0x01C, 0x0AB, 0x113, 0x18C, 0x10F, 0x09A, 0x0A5, 0x0B7,
-    0x11A, 0x186, 0x1A6, 0x259, 0x153, 0x18A, 0x193, 0x020,
-    0x10C, 0x046, 0x03A, 0x107, 0x149, 0x16C, 0x2D7, 0x225,
-    0x258, 0x316, 0x696, 0x317, 0x042, 0x522, 0x290, 0x8CA,
-    0x001,
-};
-
-static const uint8_t vec2_huffbits[HUFF_VEC2_SIZE] = {
-     7,  6,  6,  6,  7,  7,  8,  9,
-     9, 10, 10, 11, 11, 11, 12, 12,
-     6,  4,  5,  5,  6,  6,  7,  8,
-     8,  9,  9, 10, 10, 10, 11,  6,
-     4,  5,  5,  6,  7,  7,  8,  8,
-     9,  9, 10, 10, 11,  6,  5,  5,
-     6,  6,  7,  7,  8,  8,  9,  9,
-    10, 10,  7,  6,  6,  6,  7,  7,
-     8,  8,  9,  9, 10, 10,  7,  6,
-     7,  7,  7,  8,  8,  8,  9,  9,
-    10,  8,  7,  7,  7,  8,  8,  8,
-     9,  9,  9,  9,  8,  8,  8,  8,
-     8,  9,  9,  9,  9,  8,  8,  8,
-     9,  9,  9,  9, 10,  9,  9,  9,
-     9,  9,  9, 10,  9,  9,  9, 10,
-    10, 11, 10, 10, 10, 10, 11, 10,
-    10, 10, 11, 10, 11, 12, 11, 12,
-     3,
-};
-
-
-#define HUFF_VEC1_SIZE    101
-#define HUFF_VEC1_MAXBITS  11
-static const uint16_t vec1_huffcodes[HUFF_VEC1_SIZE] = {
-    0x01A, 0x003, 0x017, 0x010, 0x00C, 0x009, 0x005, 0x000,
-    0x00D, 0x00A, 0x009, 0x00C, 0x00F, 0x002, 0x004, 0x007,
-    0x00B, 0x00F, 0x01C, 0x006, 0x010, 0x015, 0x01C, 0x022,
-    0x03B, 0x00E, 0x019, 0x023, 0x034, 0x036, 0x03A, 0x047,
-    0x008, 0x00A, 0x01E, 0x031, 0x037, 0x050, 0x053, 0x06B,
-    0x06F, 0x08C, 0x0E8, 0x0EA, 0x0EB, 0x016, 0x03E, 0x03F,
-    0x06C, 0x089, 0x08A, 0x0A3, 0x0A4, 0x0D4, 0x0DD, 0x0EC,
-    0x0EE, 0x11A, 0x1D2, 0x024, 0x025, 0x02E, 0x027, 0x0C2,
-    0x0C0, 0x0DA, 0x0DB, 0x111, 0x144, 0x116, 0x14A, 0x145,
-    0x1B8, 0x1AB, 0x1DA, 0x1DE, 0x1DB, 0x1DF, 0x236, 0x237,
-    0x3A6, 0x3A7, 0x04D, 0x04C, 0x05E, 0x05F, 0x183, 0x182,
-    0x186, 0x221, 0x187, 0x220, 0x22E, 0x22F, 0x296, 0x354,
-    0x297, 0x355, 0x372, 0x373, 0x016,
-};
-
-static const uint8_t vec1_huffbits[HUFF_VEC1_SIZE] = {
-     7,  6,  5,  5,  5,  5,  5,  5,
-     4,  4,  4,  4,  4,  5,  5,  5,
-     5,  5,  5,  6,  6,  6,  6,  6,
-     6,  7,  7,  7,  7,  7,  7,  7,
-     8,  8,  8,  8,  8,  8,  8,  8,
-     8,  8,  8,  8,  8,  9,  9,  9,
-     9,  9,  9,  9,  9,  9,  9,  9,
-     9,  9,  9, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11,  5,
-};
-
-
-static const uint16_t symbol_to_vec4[HUFF_VEC4_SIZE] = {
-        0,    1,      2,     3,     4,     5,    16,    17,    18,    19,
-       20,   32,     33,    34,    35,    48,    49,    50,    64,    65,
-       80,   256,   257,   258,   259,   260,   272,   273,   274,   275,
-      288,   289,   290,   304,   305,   320,   512,   513,   514,   515,
-      528,   529,   530,   544,   545,   560,   768,   769,   770,   784,
-      785,   800,  1024,  1025,  1040,  1280,  4096,  4097,  4098,  4099,
-     4100,  4112,  4113,  4114,  4115,  4128,  4129,  4130,  4144,  4145,
-     4160,  4352,  4353,  4354,  4355,  4368,  4369,  4370,  4384,  4385,
-     4400,  4608,  4609,  4610,  4624,  4625,  4640,  4864,  4865,  4880,
-     5120,  8192,  8193,  8194,  8195,  8208,  8209,  8210,  8224,  8225,
-     8240,  8448,  8449,  8450,  8464,  8465,  8480,  8704,  8705,  8720,
-     8960, 12288, 12289, 12290, 12304, 12305, 12320, 12544, 12545, 12560,
-    12800, 16384, 16385, 16400, 16640, 20480,     0,
-};
-
-
-static const uint8_t symbol_to_vec2[HUFF_VEC2_SIZE] = {
-      0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,
-     15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,
-     30,  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,
-     48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,  60,  64,  65,
-     66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  80,  81,  82,  83,  84,
-     85,  86,  87,  88,  89,  90,  96,  97,  98,  99, 100, 101, 102, 103, 104,
-    105, 112, 113, 114, 115, 116, 117, 118, 119, 120, 128, 129, 130, 131, 132,
-    133, 134, 135, 144, 145, 146, 147, 148, 149, 150, 160, 161, 162, 163, 164,
-    165, 176, 177, 178, 179, 180, 192, 193, 194, 195, 208, 209, 210, 224, 225,
-    240,   0,
-};
-/** @} */
-
-
-/**
- * @brief decorrelation matrix for multichannel streams
- **/
-static const float default_decorrelation_matrices[] = {
-    1.000000,  0.707031, -0.707031,  0.707031,  0.707031,  0.578125,  0.707031,
-    0.410156,  0.578125, -0.707031,  0.410156,  0.578125,  0.000000, -0.816406,
-    0.500000,  0.652344,  0.500000,  0.269531,  0.500000,  0.269531, -0.500000,
-   -0.652344,  0.500000, -0.269531, -0.500000,  0.652344,  0.500000, -0.652344,
-    0.500000, -0.269531,  0.445312,  0.601562,  0.511719,  0.371094,  0.195312,
-    0.445312,  0.371094, -0.195312, -0.601562, -0.511719,  0.445312,  0.000000,
-   -0.632812,  0.000000,  0.632812,  0.445312, -0.371094, -0.195312,  0.601562,
-   -0.511719,  0.445312, -0.601562,  0.511719, -0.371094,  0.195312,  0.410156,
-    0.558594,  0.500000,  0.410156,  0.289062,  0.148438,  0.410156,  0.410156,
-    0.000000, -0.410156, -0.578125, -0.410156,  0.410156,  0.148438, -0.500000,
-   -0.410156,  0.289062,  0.558594,  0.410156, -0.148438, -0.500000,  0.410156,
-    0.289062, -0.558594,  0.410156, -0.410156,  0.000000,  0.410156, -0.578125,
-    0.410156,  0.410156, -0.558594,  0.500000, -0.410156,  0.289062, -0.148438,
-};
-
-/**
- * @brief default decorrelation matrix offsets
- */
-static const float * const default_decorrelation[] = {
-    NULL,
-    &default_decorrelation_matrices[0],
-    &default_decorrelation_matrices[1],
-    &default_decorrelation_matrices[5],
-    &default_decorrelation_matrices[14],
-    &default_decorrelation_matrices[30],
-    &default_decorrelation_matrices[55]
-};
-
-#endif /* AVCODEC_WMAPRODATA_H */
diff --git a/deps/libav/libavcodec/wmaprodec.c b/deps/libav/libavcodec/wmaprodec.c
deleted file mode 100644
index 2657a0e..0000000
--- a/deps/libav/libavcodec/wmaprodec.c
+++ /dev/null
@@ -1,1654 +0,0 @@
-/*
- * Wmapro compatible decoder
- * Copyright (c) 2007 Baptiste Coudurier, Benjamin Larsson, Ulion
- * Copyright (c) 2008 - 2011 Sascha Sommer, Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief wmapro decoder implementation
- * Wmapro is an MDCT based codec comparable to wma standard or AAC.
- * The decoding therefore consists of the following steps:
- * - bitstream decoding
- * - reconstruction of per-channel data
- * - rescaling and inverse quantization
- * - IMDCT
- * - windowing and overlapp-add
- *
- * The compressed wmapro bitstream is split into individual packets.
- * Every such packet contains one or more wma frames.
- * The compressed frames may have a variable length and frames may
- * cross packet boundaries.
- * Common to all wmapro frames is the number of samples that are stored in
- * a frame.
- * The number of samples and a few other decode flags are stored
- * as extradata that has to be passed to the decoder.
- *
- * The wmapro frames themselves are again split into a variable number of
- * subframes. Every subframe contains the data for 2^N time domain samples
- * where N varies between 7 and 12.
- *
- * Example wmapro bitstream (in samples):
- *
- * ||   packet 0           || packet 1 || packet 2      packets
- * ---------------------------------------------------
- * || frame 0      || frame 1       || frame 2    ||    frames
- * ---------------------------------------------------
- * ||   |      |   ||   |   |   |   ||            ||    subframes of channel 0
- * ---------------------------------------------------
- * ||      |   |   ||   |   |   |   ||            ||    subframes of channel 1
- * ---------------------------------------------------
- *
- * The frame layouts for the individual channels of a wma frame does not need
- * to be the same.
- *
- * However, if the offsets and lengths of several subframes of a frame are the
- * same, the subframes of the channels can be grouped.
- * Every group may then use special coding techniques like M/S stereo coding
- * to improve the compression ratio. These channel transformations do not
- * need to be applied to a whole subframe. Instead, they can also work on
- * individual scale factor bands (see below).
- * The coefficients that carry the audio signal in the frequency domain
- * are transmitted as huffman-coded vectors with 4, 2 and 1 elements.
- * In addition to that, the encoder can switch to a runlevel coding scheme
- * by transmitting subframe_length / 128 zero coefficients.
- *
- * Before the audio signal can be converted to the time domain, the
- * coefficients have to be rescaled and inverse quantized.
- * A subframe is therefore split into several scale factor bands that get
- * scaled individually.
- * Scale factors are submitted for every frame but they might be shared
- * between the subframes of a channel. Scale factors are initially DPCM-coded.
- * Once scale factors are shared, the differences are transmitted as runlevel
- * codes.
- * Every subframe length and offset combination in the frame layout shares a
- * common quantization factor that can be adjusted for every channel by a
- * modifier.
- * After the inverse quantization, the coefficients get processed by an IMDCT.
- * The resulting values are then windowed with a sine window and the first half
- * of the values are added to the second half of the output from the previous
- * subframe in order to reconstruct the output samples.
- */
-
-#include "libavutil/float_dsp.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "wmaprodata.h"
-#include "sinewin.h"
-#include "wma.h"
-#include "wma_common.h"
-
-/** current decoder limitations */
-#define WMAPRO_MAX_CHANNELS    8                             ///< max number of handled channels
-#define MAX_SUBFRAMES  32                                    ///< max number of subframes per channel
-#define MAX_BANDS      29                                    ///< max number of scale factor bands
-#define MAX_FRAMESIZE  32768                                 ///< maximum compressed frame size
-
-#define WMAPRO_BLOCK_MIN_BITS  6                                           ///< log2 of min block size
-#define WMAPRO_BLOCK_MAX_BITS 13                                           ///< log2 of max block size
-#define WMAPRO_BLOCK_MIN_SIZE (1 << WMAPRO_BLOCK_MIN_BITS)                 ///< minimum block size
-#define WMAPRO_BLOCK_MAX_SIZE (1 << WMAPRO_BLOCK_MAX_BITS)                 ///< maximum block size
-#define WMAPRO_BLOCK_SIZES    (WMAPRO_BLOCK_MAX_BITS - WMAPRO_BLOCK_MIN_BITS + 1) ///< possible block sizes
-
-
-#define VLCBITS            9
-#define SCALEVLCBITS       8
-#define VEC4MAXDEPTH    ((HUFF_VEC4_MAXBITS+VLCBITS-1)/VLCBITS)
-#define VEC2MAXDEPTH    ((HUFF_VEC2_MAXBITS+VLCBITS-1)/VLCBITS)
-#define VEC1MAXDEPTH    ((HUFF_VEC1_MAXBITS+VLCBITS-1)/VLCBITS)
-#define SCALEMAXDEPTH   ((HUFF_SCALE_MAXBITS+SCALEVLCBITS-1)/SCALEVLCBITS)
-#define SCALERLMAXDEPTH ((HUFF_SCALE_RL_MAXBITS+VLCBITS-1)/VLCBITS)
-
-static VLC              sf_vlc;           ///< scale factor DPCM vlc
-static VLC              sf_rl_vlc;        ///< scale factor run length vlc
-static VLC              vec4_vlc;         ///< 4 coefficients per symbol
-static VLC              vec2_vlc;         ///< 2 coefficients per symbol
-static VLC              vec1_vlc;         ///< 1 coefficient per symbol
-static VLC              coef_vlc[2];      ///< coefficient run length vlc codes
-static float            sin64[33];        ///< sine table for decorrelation
-
-/**
- * @brief frame specific decoder context for a single channel
- */
-typedef struct {
-    int16_t  prev_block_len;                          ///< length of the previous block
-    uint8_t  transmit_coefs;
-    uint8_t  num_subframes;
-    uint16_t subframe_len[MAX_SUBFRAMES];             ///< subframe length in samples
-    uint16_t subframe_offset[MAX_SUBFRAMES];          ///< subframe positions in the current frame
-    uint8_t  cur_subframe;                            ///< current subframe number
-    uint16_t decoded_samples;                         ///< number of already processed samples
-    uint8_t  grouped;                                 ///< channel is part of a group
-    int      quant_step;                              ///< quantization step for the current subframe
-    int8_t   reuse_sf;                                ///< share scale factors between subframes
-    int8_t   scale_factor_step;                       ///< scaling step for the current subframe
-    int      max_scale_factor;                        ///< maximum scale factor for the current subframe
-    int      saved_scale_factors[2][MAX_BANDS];       ///< resampled and (previously) transmitted scale factor values
-    int8_t   scale_factor_idx;                        ///< index for the transmitted scale factor values (used for resampling)
-    int*     scale_factors;                           ///< pointer to the scale factor values used for decoding
-    uint8_t  table_idx;                               ///< index in sf_offsets for the scale factor reference block
-    float*   coeffs;                                  ///< pointer to the subframe decode buffer
-    uint16_t num_vec_coeffs;                          ///< number of vector coded coefficients
-    DECLARE_ALIGNED(32, float, out)[WMAPRO_BLOCK_MAX_SIZE + WMAPRO_BLOCK_MAX_SIZE / 2]; ///< output buffer
-} WMAProChannelCtx;
-
-/**
- * @brief channel group for channel transformations
- */
-typedef struct {
-    uint8_t num_channels;                                     ///< number of channels in the group
-    int8_t  transform;                                        ///< transform on / off
-    int8_t  transform_band[MAX_BANDS];                        ///< controls if the transform is enabled for a certain band
-    float   decorrelation_matrix[WMAPRO_MAX_CHANNELS*WMAPRO_MAX_CHANNELS];
-    float*  channel_data[WMAPRO_MAX_CHANNELS];                ///< transformation coefficients
-} WMAProChannelGrp;
-
-/**
- * @brief main decoder context
- */
-typedef struct WMAProDecodeCtx {
-    /* generic decoder variables */
-    AVCodecContext*  avctx;                         ///< codec context for av_log
-    AVFloatDSPContext fdsp;
-    uint8_t          frame_data[MAX_FRAMESIZE +
-                      FF_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data
-    PutBitContext    pb;                            ///< context for filling the frame_data buffer
-    FFTContext       mdct_ctx[WMAPRO_BLOCK_SIZES];  ///< MDCT context per block size
-    DECLARE_ALIGNED(32, float, tmp)[WMAPRO_BLOCK_MAX_SIZE]; ///< IMDCT output buffer
-    float*           windows[WMAPRO_BLOCK_SIZES];   ///< windows for the different block sizes
-
-    /* frame size dependent frame information (set during initialization) */
-    uint32_t         decode_flags;                  ///< used compression features
-    uint8_t          len_prefix;                    ///< frame is prefixed with its length
-    uint8_t          dynamic_range_compression;     ///< frame contains DRC data
-    uint8_t          bits_per_sample;               ///< integer audio sample size for the unscaled IMDCT output (used to scale to [-1.0, 1.0])
-    uint16_t         samples_per_frame;             ///< number of samples to output
-    uint16_t         log2_frame_size;
-    int8_t           lfe_channel;                   ///< lfe channel index
-    uint8_t          max_num_subframes;
-    uint8_t          subframe_len_bits;             ///< number of bits used for the subframe length
-    uint8_t          max_subframe_len_bit;          ///< flag indicating that the subframe is of maximum size when the first subframe length bit is 1
-    uint16_t         min_samples_per_subframe;
-    int8_t           num_sfb[WMAPRO_BLOCK_SIZES];   ///< scale factor bands per block size
-    int16_t          sfb_offsets[WMAPRO_BLOCK_SIZES][MAX_BANDS];                    ///< scale factor band offsets (multiples of 4)
-    int8_t           sf_offsets[WMAPRO_BLOCK_SIZES][WMAPRO_BLOCK_SIZES][MAX_BANDS]; ///< scale factor resample matrix
-    int16_t          subwoofer_cutoffs[WMAPRO_BLOCK_SIZES]; ///< subwoofer cutoff values
-
-    /* packet decode state */
-    GetBitContext    pgb;                           ///< bitstream reader context for the packet
-    int              next_packet_start;             ///< start offset of the next wma packet in the demuxer packet
-    uint8_t          packet_offset;                 ///< frame offset in the packet
-    uint8_t          packet_sequence_number;        ///< current packet number
-    int              num_saved_bits;                ///< saved number of bits
-    int              frame_offset;                  ///< frame offset in the bit reservoir
-    int              subframe_offset;               ///< subframe offset in the bit reservoir
-    uint8_t          packet_loss;                   ///< set in case of bitstream error
-    uint8_t          packet_done;                   ///< set when a packet is fully decoded
-
-    /* frame decode state */
-    uint32_t         frame_num;                     ///< current frame number (not used for decoding)
-    GetBitContext    gb;                            ///< bitstream reader context
-    int              buf_bit_size;                  ///< buffer size in bits
-    uint8_t          drc_gain;                      ///< gain for the DRC tool
-    int8_t           skip_frame;                    ///< skip output step
-    int8_t           parsed_all_subframes;          ///< all subframes decoded?
-
-    /* subframe/block decode state */
-    int16_t          subframe_len;                  ///< current subframe length
-    int8_t           channels_for_cur_subframe;     ///< number of channels that contain the subframe
-    int8_t           channel_indexes_for_cur_subframe[WMAPRO_MAX_CHANNELS];
-    int8_t           num_bands;                     ///< number of scale factor bands
-    int8_t           transmit_num_vec_coeffs;       ///< number of vector coded coefficients is part of the bitstream
-    int16_t*         cur_sfb_offsets;               ///< sfb offsets for the current block
-    uint8_t          table_idx;                     ///< index for the num_sfb, sfb_offsets, sf_offsets and subwoofer_cutoffs tables
-    int8_t           esc_len;                       ///< length of escaped coefficients
-
-    uint8_t          num_chgroups;                  ///< number of channel groups
-    WMAProChannelGrp chgroup[WMAPRO_MAX_CHANNELS];  ///< channel group information
-
-    WMAProChannelCtx channel[WMAPRO_MAX_CHANNELS];  ///< per channel data
-} WMAProDecodeCtx;
-
-
-/**
- *@brief helper function to print the most important members of the context
- *@param s context
- */
-static av_cold void dump_context(WMAProDecodeCtx *s)
-{
-#define PRINT(a, b)     av_log(s->avctx, AV_LOG_DEBUG, " %s = %d\n", a, b);
-#define PRINT_HEX(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %x\n", a, b);
-
-    PRINT("ed sample bit depth", s->bits_per_sample);
-    PRINT_HEX("ed decode flags", s->decode_flags);
-    PRINT("samples per frame",   s->samples_per_frame);
-    PRINT("log2 frame size",     s->log2_frame_size);
-    PRINT("max num subframes",   s->max_num_subframes);
-    PRINT("len prefix",          s->len_prefix);
-    PRINT("num channels",        s->avctx->channels);
-}
-
-/**
- *@brief Uninitialize the decoder and free all resources.
- *@param avctx codec context
- *@return 0 on success, < 0 otherwise
- */
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    WMAProDecodeCtx *s = avctx->priv_data;
-    int i;
-
-    for (i = 0; i < WMAPRO_BLOCK_SIZES; i++)
-        ff_mdct_end(&s->mdct_ctx[i]);
-
-    return 0;
-}
-
-/**
- *@brief Initialize the decoder.
- *@param avctx codec context
- *@return 0 on success, -1 otherwise
- */
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    WMAProDecodeCtx *s = avctx->priv_data;
-    uint8_t *edata_ptr = avctx->extradata;
-    unsigned int channel_mask;
-    int i, bits;
-    int log2_max_num_subframes;
-    int num_possible_block_sizes;
-
-    if (!avctx->block_align) {
-        av_log(avctx, AV_LOG_ERROR, "block_align is not set\n");
-        return AVERROR(EINVAL);
-    }
-
-    s->avctx = avctx;
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
-
-    init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
-
-    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
-
-    if (avctx->extradata_size >= 18) {
-        s->decode_flags    = AV_RL16(edata_ptr+14);
-        channel_mask       = AV_RL32(edata_ptr+2);
-        s->bits_per_sample = AV_RL16(edata_ptr);
-        /** dump the extradata */
-        for (i = 0; i < avctx->extradata_size; i++)
-            av_dlog(avctx, "[%x] ", avctx->extradata[i]);
-        av_dlog(avctx, "\n");
-
-    } else {
-        avpriv_request_sample(avctx, "Unknown extradata size");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /** generic init */
-    s->log2_frame_size = av_log2(avctx->block_align) + 4;
-
-    /** frame info */
-    s->skip_frame  = 1; /* skip first frame */
-    s->packet_loss = 1;
-    s->len_prefix  = (s->decode_flags & 0x40);
-
-    /** get frame len */
-    bits = ff_wma_get_frame_len_bits(avctx->sample_rate, 3, s->decode_flags);
-    if (bits > WMAPRO_BLOCK_MAX_BITS) {
-        avpriv_request_sample(avctx, "14-bit block sizes");
-        return AVERROR_PATCHWELCOME;
-    }
-    s->samples_per_frame = 1 << bits;
-
-    /** subframe info */
-    log2_max_num_subframes       = ((s->decode_flags & 0x38) >> 3);
-    s->max_num_subframes         = 1 << log2_max_num_subframes;
-    if (s->max_num_subframes == 16 || s->max_num_subframes == 4)
-        s->max_subframe_len_bit = 1;
-    s->subframe_len_bits = av_log2(log2_max_num_subframes) + 1;
-
-    num_possible_block_sizes     = log2_max_num_subframes + 1;
-    s->min_samples_per_subframe  = s->samples_per_frame / s->max_num_subframes;
-    s->dynamic_range_compression = (s->decode_flags & 0x80);
-
-    if (s->max_num_subframes > MAX_SUBFRAMES) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of subframes %i\n",
-               s->max_num_subframes);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->min_samples_per_subframe < WMAPRO_BLOCK_MIN_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid minimum block size %i\n",
-               s->max_num_subframes);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->avctx->sample_rate <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avctx->channels < 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n",
-               avctx->channels);
-        return AVERROR_INVALIDDATA;
-    } else if (avctx->channels > WMAPRO_MAX_CHANNELS) {
-        avpriv_request_sample(avctx,
-                              "More than %d channels", WMAPRO_MAX_CHANNELS);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /** init previous block len */
-    for (i = 0; i < avctx->channels; i++)
-        s->channel[i].prev_block_len = s->samples_per_frame;
-
-    /** extract lfe channel position */
-    s->lfe_channel = -1;
-
-    if (channel_mask & 8) {
-        unsigned int mask;
-        for (mask = 1; mask < 16; mask <<= 1) {
-            if (channel_mask & mask)
-                ++s->lfe_channel;
-        }
-    }
-
-    INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE,
-                    scale_huffbits, 1, 1,
-                    scale_huffcodes, 2, 2, 616);
-
-    INIT_VLC_STATIC(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE,
-                    scale_rl_huffbits, 1, 1,
-                    scale_rl_huffcodes, 4, 4, 1406);
-
-    INIT_VLC_STATIC(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE,
-                    coef0_huffbits, 1, 1,
-                    coef0_huffcodes, 4, 4, 2108);
-
-    INIT_VLC_STATIC(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE,
-                    coef1_huffbits, 1, 1,
-                    coef1_huffcodes, 4, 4, 3912);
-
-    INIT_VLC_STATIC(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE,
-                    vec4_huffbits, 1, 1,
-                    vec4_huffcodes, 2, 2, 604);
-
-    INIT_VLC_STATIC(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE,
-                    vec2_huffbits, 1, 1,
-                    vec2_huffcodes, 2, 2, 562);
-
-    INIT_VLC_STATIC(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE,
-                    vec1_huffbits, 1, 1,
-                    vec1_huffcodes, 2, 2, 562);
-
-    /** calculate number of scale factor bands and their offsets
-        for every possible block size */
-    for (i = 0; i < num_possible_block_sizes; i++) {
-        int subframe_len = s->samples_per_frame >> i;
-        int x;
-        int band = 1;
-
-        s->sfb_offsets[i][0] = 0;
-
-        for (x = 0; x < MAX_BANDS-1 && s->sfb_offsets[i][band - 1] < subframe_len; x++) {
-            int offset = (subframe_len * 2 * critical_freq[x])
-                          / s->avctx->sample_rate + 2;
-            offset &= ~3;
-            if (offset > s->sfb_offsets[i][band - 1])
-                s->sfb_offsets[i][band++] = offset;
-        }
-        s->sfb_offsets[i][band - 1] = subframe_len;
-        s->num_sfb[i]               = band - 1;
-    }
-
-
-    /** Scale factors can be shared between blocks of different size
-        as every block has a different scale factor band layout.
-        The matrix sf_offsets is needed to find the correct scale factor.
-     */
-
-    for (i = 0; i < num_possible_block_sizes; i++) {
-        int b;
-        for (b = 0; b < s->num_sfb[i]; b++) {
-            int x;
-            int offset = ((s->sfb_offsets[i][b]
-                           + s->sfb_offsets[i][b + 1] - 1) << i) >> 1;
-            for (x = 0; x < num_possible_block_sizes; x++) {
-                int v = 0;
-                while (s->sfb_offsets[x][v + 1] << x < offset)
-                    if (++v >= MAX_BANDS)
-                        return AVERROR_INVALIDDATA;
-                s->sf_offsets[i][x][b] = v;
-            }
-        }
-    }
-
-    /** init MDCT, FIXME: only init needed sizes */
-    for (i = 0; i < WMAPRO_BLOCK_SIZES; i++)
-        ff_mdct_init(&s->mdct_ctx[i], WMAPRO_BLOCK_MIN_BITS+1+i, 1,
-                     1.0 / (1 << (WMAPRO_BLOCK_MIN_BITS + i - 1))
-                     / (1 << (s->bits_per_sample - 1)));
-
-    /** init MDCT windows: simple sine window */
-    for (i = 0; i < WMAPRO_BLOCK_SIZES; i++) {
-        const int win_idx = WMAPRO_BLOCK_MAX_BITS - i;
-        ff_init_ff_sine_windows(win_idx);
-        s->windows[WMAPRO_BLOCK_SIZES - i - 1] = ff_sine_windows[win_idx];
-    }
-
-    /** calculate subwoofer cutoff values */
-    for (i = 0; i < num_possible_block_sizes; i++) {
-        int block_size = s->samples_per_frame >> i;
-        int cutoff = (440*block_size + 3 * (s->avctx->sample_rate >> 1) - 1)
-                     / s->avctx->sample_rate;
-        s->subwoofer_cutoffs[i] = av_clip(cutoff, 4, block_size);
-    }
-
-    /** calculate sine values for the decorrelation matrix */
-    for (i = 0; i < 33; i++)
-        sin64[i] = sin(i*M_PI / 64.0);
-
-    if (avctx->debug & FF_DEBUG_BITSTREAM)
-        dump_context(s);
-
-    avctx->channel_layout = channel_mask;
-
-    return 0;
-}
-
-/**
- *@brief Decode the subframe length.
- *@param s context
- *@param offset sample offset in the frame
- *@return decoded subframe length on success, < 0 in case of an error
- */
-static int decode_subframe_length(WMAProDecodeCtx *s, int offset)
-{
-    int frame_len_shift = 0;
-    int subframe_len;
-
-    /** no need to read from the bitstream when only one length is possible */
-    if (offset == s->samples_per_frame - s->min_samples_per_subframe)
-        return s->min_samples_per_subframe;
-
-    /** 1 bit indicates if the subframe is of maximum length */
-    if (s->max_subframe_len_bit) {
-        if (get_bits1(&s->gb))
-            frame_len_shift = 1 + get_bits(&s->gb, s->subframe_len_bits-1);
-    } else
-        frame_len_shift = get_bits(&s->gb, s->subframe_len_bits);
-
-    subframe_len = s->samples_per_frame >> frame_len_shift;
-
-    /** sanity check the length */
-    if (subframe_len < s->min_samples_per_subframe ||
-        subframe_len > s->samples_per_frame) {
-        av_log(s->avctx, AV_LOG_ERROR, "broken frame: subframe_len %i\n",
-               subframe_len);
-        return AVERROR_INVALIDDATA;
-    }
-    return subframe_len;
-}
-
-/**
- *@brief Decode how the data in the frame is split into subframes.
- *       Every WMA frame contains the encoded data for a fixed number of
- *       samples per channel. The data for every channel might be split
- *       into several subframes. This function will reconstruct the list of
- *       subframes for every channel.
- *
- *       If the subframes are not evenly split, the algorithm estimates the
- *       channels with the lowest number of total samples.
- *       Afterwards, for each of these channels a bit is read from the
- *       bitstream that indicates if the channel contains a subframe with the
- *       next subframe size that is going to be read from the bitstream or not.
- *       If a channel contains such a subframe, the subframe size gets added to
- *       the channel's subframe list.
- *       The algorithm repeats these steps until the frame is properly divided
- *       between the individual channels.
- *
- *@param s context
- *@return 0 on success, < 0 in case of an error
- */
-static int decode_tilehdr(WMAProDecodeCtx *s)
-{
-    uint16_t num_samples[WMAPRO_MAX_CHANNELS] = { 0 };/**< sum of samples for all currently known subframes of a channel */
-    uint8_t  contains_subframe[WMAPRO_MAX_CHANNELS];  /**< flag indicating if a channel contains the current subframe */
-    int channels_for_cur_subframe = s->avctx->channels; /**< number of channels that contain the current subframe */
-    int fixed_channel_layout = 0;                     /**< flag indicating that all channels use the same subframe offsets and sizes */
-    int min_channel_len = 0;                          /**< smallest sum of samples (channels with this length will be processed first) */
-    int c;
-
-    /* Should never consume more than 3073 bits (256 iterations for the
-     * while loop when always the minimum amount of 128 samples is subtracted
-     * from missing samples in the 8 channel case).
-     * 1 + BLOCK_MAX_SIZE * MAX_CHANNELS / BLOCK_MIN_SIZE * (MAX_CHANNELS  + 4)
-     */
-
-    /** reset tiling information */
-    for (c = 0; c < s->avctx->channels; c++)
-        s->channel[c].num_subframes = 0;
-
-    if (s->max_num_subframes == 1 || get_bits1(&s->gb))
-        fixed_channel_layout = 1;
-
-    /** loop until the frame data is split between the subframes */
-    do {
-        int subframe_len;
-
-        /** check which channels contain the subframe */
-        for (c = 0; c < s->avctx->channels; c++) {
-            if (num_samples[c] == min_channel_len) {
-                if (fixed_channel_layout || channels_for_cur_subframe == 1 ||
-                   (min_channel_len == s->samples_per_frame - s->min_samples_per_subframe))
-                    contains_subframe[c] = 1;
-                else
-                    contains_subframe[c] = get_bits1(&s->gb);
-            } else
-                contains_subframe[c] = 0;
-        }
-
-        /** get subframe length, subframe_len == 0 is not allowed */
-        if ((subframe_len = decode_subframe_length(s, min_channel_len)) <= 0)
-            return AVERROR_INVALIDDATA;
-
-        /** add subframes to the individual channels and find new min_channel_len */
-        min_channel_len += subframe_len;
-        for (c = 0; c < s->avctx->channels; c++) {
-            WMAProChannelCtx* chan = &s->channel[c];
-
-            if (contains_subframe[c]) {
-                if (chan->num_subframes >= MAX_SUBFRAMES) {
-                    av_log(s->avctx, AV_LOG_ERROR,
-                           "broken frame: num subframes > 31\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                chan->subframe_len[chan->num_subframes] = subframe_len;
-                num_samples[c] += subframe_len;
-                ++chan->num_subframes;
-                if (num_samples[c] > s->samples_per_frame) {
-                    av_log(s->avctx, AV_LOG_ERROR, "broken frame: "
-                           "channel len > samples_per_frame\n");
-                    return AVERROR_INVALIDDATA;
-                }
-            } else if (num_samples[c] <= min_channel_len) {
-                if (num_samples[c] < min_channel_len) {
-                    channels_for_cur_subframe = 0;
-                    min_channel_len = num_samples[c];
-                }
-                ++channels_for_cur_subframe;
-            }
-        }
-    } while (min_channel_len < s->samples_per_frame);
-
-    for (c = 0; c < s->avctx->channels; c++) {
-        int i;
-        int offset = 0;
-        for (i = 0; i < s->channel[c].num_subframes; i++) {
-            av_dlog(s->avctx, "frame[%i] channel[%i] subframe[%i]"
-                    " len %i\n", s->frame_num, c, i,
-                    s->channel[c].subframe_len[i]);
-            s->channel[c].subframe_offset[i] = offset;
-            offset += s->channel[c].subframe_len[i];
-        }
-    }
-
-    return 0;
-}
-
-/**
- *@brief Calculate a decorrelation matrix from the bitstream parameters.
- *@param s codec context
- *@param chgroup channel group for which the matrix needs to be calculated
- */
-static void decode_decorrelation_matrix(WMAProDecodeCtx *s,
-                                        WMAProChannelGrp *chgroup)
-{
-    int i;
-    int offset = 0;
-    int8_t rotation_offset[WMAPRO_MAX_CHANNELS * WMAPRO_MAX_CHANNELS];
-    memset(chgroup->decorrelation_matrix, 0, s->avctx->channels *
-           s->avctx->channels * sizeof(*chgroup->decorrelation_matrix));
-
-    for (i = 0; i < chgroup->num_channels * (chgroup->num_channels - 1) >> 1; i++)
-        rotation_offset[i] = get_bits(&s->gb, 6);
-
-    for (i = 0; i < chgroup->num_channels; i++)
-        chgroup->decorrelation_matrix[chgroup->num_channels * i + i] =
-            get_bits1(&s->gb) ? 1.0 : -1.0;
-
-    for (i = 1; i < chgroup->num_channels; i++) {
-        int x;
-        for (x = 0; x < i; x++) {
-            int y;
-            for (y = 0; y < i + 1; y++) {
-                float v1 = chgroup->decorrelation_matrix[x * chgroup->num_channels + y];
-                float v2 = chgroup->decorrelation_matrix[i * chgroup->num_channels + y];
-                int n = rotation_offset[offset + x];
-                float sinv;
-                float cosv;
-
-                if (n < 32) {
-                    sinv = sin64[n];
-                    cosv = sin64[32 - n];
-                } else {
-                    sinv =  sin64[64 -  n];
-                    cosv = -sin64[n  - 32];
-                }
-
-                chgroup->decorrelation_matrix[y + x * chgroup->num_channels] =
-                                               (v1 * sinv) - (v2 * cosv);
-                chgroup->decorrelation_matrix[y + i * chgroup->num_channels] =
-                                               (v1 * cosv) + (v2 * sinv);
-            }
-        }
-        offset += i;
-    }
-}
-
-/**
- *@brief Decode channel transformation parameters
- *@param s codec context
- *@return 0 in case of success, < 0 in case of bitstream errors
- */
-static int decode_channel_transform(WMAProDecodeCtx* s)
-{
-    int i;
-    /* should never consume more than 1921 bits for the 8 channel case
-     * 1 + MAX_CHANNELS * (MAX_CHANNELS + 2 + 3 * MAX_CHANNELS * MAX_CHANNELS
-     * + MAX_CHANNELS + MAX_BANDS + 1)
-     */
-
-    /** in the one channel case channel transforms are pointless */
-    s->num_chgroups = 0;
-    if (s->avctx->channels > 1) {
-        int remaining_channels = s->channels_for_cur_subframe;
-
-        if (get_bits1(&s->gb)) {
-            avpriv_request_sample(s->avctx,
-                                  "Channel transform bit");
-            return AVERROR_PATCHWELCOME;
-        }
-
-        for (s->num_chgroups = 0; remaining_channels &&
-             s->num_chgroups < s->channels_for_cur_subframe; s->num_chgroups++) {
-            WMAProChannelGrp* chgroup = &s->chgroup[s->num_chgroups];
-            float** channel_data = chgroup->channel_data;
-            chgroup->num_channels = 0;
-            chgroup->transform = 0;
-
-            /** decode channel mask */
-            if (remaining_channels > 2) {
-                for (i = 0; i < s->channels_for_cur_subframe; i++) {
-                    int channel_idx = s->channel_indexes_for_cur_subframe[i];
-                    if (!s->channel[channel_idx].grouped
-                        && get_bits1(&s->gb)) {
-                        ++chgroup->num_channels;
-                        s->channel[channel_idx].grouped = 1;
-                        *channel_data++ = s->channel[channel_idx].coeffs;
-                    }
-                }
-            } else {
-                chgroup->num_channels = remaining_channels;
-                for (i = 0; i < s->channels_for_cur_subframe; i++) {
-                    int channel_idx = s->channel_indexes_for_cur_subframe[i];
-                    if (!s->channel[channel_idx].grouped)
-                        *channel_data++ = s->channel[channel_idx].coeffs;
-                    s->channel[channel_idx].grouped = 1;
-                }
-            }
-
-            /** decode transform type */
-            if (chgroup->num_channels == 2) {
-                if (get_bits1(&s->gb)) {
-                    if (get_bits1(&s->gb)) {
-                        avpriv_request_sample(s->avctx,
-                                              "Unknown channel transform type");
-                        return AVERROR_PATCHWELCOME;
-                    }
-                } else {
-                    chgroup->transform = 1;
-                    if (s->avctx->channels == 2) {
-                        chgroup->decorrelation_matrix[0] =  1.0;
-                        chgroup->decorrelation_matrix[1] = -1.0;
-                        chgroup->decorrelation_matrix[2] =  1.0;
-                        chgroup->decorrelation_matrix[3] =  1.0;
-                    } else {
-                        /** cos(pi/4) */
-                        chgroup->decorrelation_matrix[0] =  0.70703125;
-                        chgroup->decorrelation_matrix[1] = -0.70703125;
-                        chgroup->decorrelation_matrix[2] =  0.70703125;
-                        chgroup->decorrelation_matrix[3] =  0.70703125;
-                    }
-                }
-            } else if (chgroup->num_channels > 2) {
-                if (get_bits1(&s->gb)) {
-                    chgroup->transform = 1;
-                    if (get_bits1(&s->gb)) {
-                        decode_decorrelation_matrix(s, chgroup);
-                    } else {
-                        /** FIXME: more than 6 coupled channels not supported */
-                        if (chgroup->num_channels > 6) {
-                            avpriv_request_sample(s->avctx,
-                                                  "Coupled channels > 6");
-                        } else {
-                            memcpy(chgroup->decorrelation_matrix,
-                                   default_decorrelation[chgroup->num_channels],
-                                   chgroup->num_channels * chgroup->num_channels *
-                                   sizeof(*chgroup->decorrelation_matrix));
-                        }
-                    }
-                }
-            }
-
-            /** decode transform on / off */
-            if (chgroup->transform) {
-                if (!get_bits1(&s->gb)) {
-                    int i;
-                    /** transform can be enabled for individual bands */
-                    for (i = 0; i < s->num_bands; i++) {
-                        chgroup->transform_band[i] = get_bits1(&s->gb);
-                    }
-                } else {
-                    memset(chgroup->transform_band, 1, s->num_bands);
-                }
-            }
-            remaining_channels -= chgroup->num_channels;
-        }
-    }
-    return 0;
-}
-
-/**
- *@brief Extract the coefficients from the bitstream.
- *@param s codec context
- *@param c current channel number
- *@return 0 on success, < 0 in case of bitstream errors
- */
-static int decode_coeffs(WMAProDecodeCtx *s, int c)
-{
-    /* Integers 0..15 as single-precision floats.  The table saves a
-       costly int to float conversion, and storing the values as
-       integers allows fast sign-flipping. */
-    static const uint32_t fval_tab[16] = {
-        0x00000000, 0x3f800000, 0x40000000, 0x40400000,
-        0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
-        0x41000000, 0x41100000, 0x41200000, 0x41300000,
-        0x41400000, 0x41500000, 0x41600000, 0x41700000,
-    };
-    int vlctable;
-    VLC* vlc;
-    WMAProChannelCtx* ci = &s->channel[c];
-    int rl_mode = 0;
-    int cur_coeff = 0;
-    int num_zeros = 0;
-    const uint16_t* run;
-    const float* level;
-
-    av_dlog(s->avctx, "decode coefficients for channel %i\n", c);
-
-    vlctable = get_bits1(&s->gb);
-    vlc = &coef_vlc[vlctable];
-
-    if (vlctable) {
-        run = coef1_run;
-        level = coef1_level;
-    } else {
-        run = coef0_run;
-        level = coef0_level;
-    }
-
-    /** decode vector coefficients (consumes up to 167 bits per iteration for
-      4 vector coded large values) */
-    while ((s->transmit_num_vec_coeffs || !rl_mode) &&
-           (cur_coeff + 3 < ci->num_vec_coeffs)) {
-        uint32_t vals[4];
-        int i;
-        unsigned int idx;
-
-        idx = get_vlc2(&s->gb, vec4_vlc.table, VLCBITS, VEC4MAXDEPTH);
-
-        if (idx == HUFF_VEC4_SIZE - 1) {
-            for (i = 0; i < 4; i += 2) {
-                idx = get_vlc2(&s->gb, vec2_vlc.table, VLCBITS, VEC2MAXDEPTH);
-                if (idx == HUFF_VEC2_SIZE - 1) {
-                    uint32_t v0, v1;
-                    v0 = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
-                    if (v0 == HUFF_VEC1_SIZE - 1)
-                        v0 += ff_wma_get_large_val(&s->gb);
-                    v1 = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
-                    if (v1 == HUFF_VEC1_SIZE - 1)
-                        v1 += ff_wma_get_large_val(&s->gb);
-                    vals[i  ] = av_float2int(v0);
-                    vals[i+1] = av_float2int(v1);
-                } else {
-                    vals[i]   = fval_tab[symbol_to_vec2[idx] >> 4 ];
-                    vals[i+1] = fval_tab[symbol_to_vec2[idx] & 0xF];
-                }
-            }
-        } else {
-            vals[0] = fval_tab[ symbol_to_vec4[idx] >> 12      ];
-            vals[1] = fval_tab[(symbol_to_vec4[idx] >> 8) & 0xF];
-            vals[2] = fval_tab[(symbol_to_vec4[idx] >> 4) & 0xF];
-            vals[3] = fval_tab[ symbol_to_vec4[idx]       & 0xF];
-        }
-
-        /** decode sign */
-        for (i = 0; i < 4; i++) {
-            if (vals[i]) {
-                uint32_t sign = get_bits1(&s->gb) - 1;
-                AV_WN32A(&ci->coeffs[cur_coeff], vals[i] ^ sign << 31);
-                num_zeros = 0;
-            } else {
-                ci->coeffs[cur_coeff] = 0;
-                /** switch to run level mode when subframe_len / 128 zeros
-                    were found in a row */
-                rl_mode |= (++num_zeros > s->subframe_len >> 8);
-            }
-            ++cur_coeff;
-        }
-    }
-
-    /** decode run level coded coefficients */
-    if (cur_coeff < s->subframe_len) {
-        memset(&ci->coeffs[cur_coeff], 0,
-               sizeof(*ci->coeffs) * (s->subframe_len - cur_coeff));
-        if (ff_wma_run_level_decode(s->avctx, &s->gb, vlc,
-                                    level, run, 1, ci->coeffs,
-                                    cur_coeff, s->subframe_len,
-                                    s->subframe_len, s->esc_len, 0))
-            return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-/**
- *@brief Extract scale factors from the bitstream.
- *@param s codec context
- *@return 0 on success, < 0 in case of bitstream errors
- */
-static int decode_scale_factors(WMAProDecodeCtx* s)
-{
-    int i;
-
-    /** should never consume more than 5344 bits
-     *  MAX_CHANNELS * (1 +  MAX_BANDS * 23)
-     */
-
-    for (i = 0; i < s->channels_for_cur_subframe; i++) {
-        int c = s->channel_indexes_for_cur_subframe[i];
-        int* sf;
-        int* sf_end;
-        s->channel[c].scale_factors = s->channel[c].saved_scale_factors[!s->channel[c].scale_factor_idx];
-        sf_end = s->channel[c].scale_factors + s->num_bands;
-
-        /** resample scale factors for the new block size
-         *  as the scale factors might need to be resampled several times
-         *  before some  new values are transmitted, a backup of the last
-         *  transmitted scale factors is kept in saved_scale_factors
-         */
-        if (s->channel[c].reuse_sf) {
-            const int8_t* sf_offsets = s->sf_offsets[s->table_idx][s->channel[c].table_idx];
-            int b;
-            for (b = 0; b < s->num_bands; b++)
-                s->channel[c].scale_factors[b] =
-                    s->channel[c].saved_scale_factors[s->channel[c].scale_factor_idx][*sf_offsets++];
-        }
-
-        if (!s->channel[c].cur_subframe || get_bits1(&s->gb)) {
-
-            if (!s->channel[c].reuse_sf) {
-                int val;
-                /** decode DPCM coded scale factors */
-                s->channel[c].scale_factor_step = get_bits(&s->gb, 2) + 1;
-                val = 45 / s->channel[c].scale_factor_step;
-                for (sf = s->channel[c].scale_factors; sf < sf_end; sf++) {
-                    val += get_vlc2(&s->gb, sf_vlc.table, SCALEVLCBITS, SCALEMAXDEPTH) - 60;
-                    *sf = val;
-                }
-            } else {
-                int i;
-                /** run level decode differences to the resampled factors */
-                for (i = 0; i < s->num_bands; i++) {
-                    int idx;
-                    int skip;
-                    int val;
-                    int sign;
-
-                    idx = get_vlc2(&s->gb, sf_rl_vlc.table, VLCBITS, SCALERLMAXDEPTH);
-
-                    if (!idx) {
-                        uint32_t code = get_bits(&s->gb, 14);
-                        val  =  code >> 6;
-                        sign = (code & 1) - 1;
-                        skip = (code & 0x3f) >> 1;
-                    } else if (idx == 1) {
-                        break;
-                    } else {
-                        skip = scale_rl_run[idx];
-                        val  = scale_rl_level[idx];
-                        sign = get_bits1(&s->gb)-1;
-                    }
-
-                    i += skip;
-                    if (i >= s->num_bands) {
-                        av_log(s->avctx, AV_LOG_ERROR,
-                               "invalid scale factor coding\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    s->channel[c].scale_factors[i] += (val ^ sign) - sign;
-                }
-            }
-            /** swap buffers */
-            s->channel[c].scale_factor_idx = !s->channel[c].scale_factor_idx;
-            s->channel[c].table_idx = s->table_idx;
-            s->channel[c].reuse_sf  = 1;
-        }
-
-        /** calculate new scale factor maximum */
-        s->channel[c].max_scale_factor = s->channel[c].scale_factors[0];
-        for (sf = s->channel[c].scale_factors + 1; sf < sf_end; sf++) {
-            s->channel[c].max_scale_factor =
-                FFMAX(s->channel[c].max_scale_factor, *sf);
-        }
-
-    }
-    return 0;
-}
-
-/**
- *@brief Reconstruct the individual channel data.
- *@param s codec context
- */
-static void inverse_channel_transform(WMAProDecodeCtx *s)
-{
-    int i;
-
-    for (i = 0; i < s->num_chgroups; i++) {
-        if (s->chgroup[i].transform) {
-            float data[WMAPRO_MAX_CHANNELS];
-            const int num_channels = s->chgroup[i].num_channels;
-            float** ch_data = s->chgroup[i].channel_data;
-            float** ch_end = ch_data + num_channels;
-            const int8_t* tb = s->chgroup[i].transform_band;
-            int16_t* sfb;
-
-            /** multichannel decorrelation */
-            for (sfb = s->cur_sfb_offsets;
-                 sfb < s->cur_sfb_offsets + s->num_bands; sfb++) {
-                int y;
-                if (*tb++ == 1) {
-                    /** multiply values with the decorrelation_matrix */
-                    for (y = sfb[0]; y < FFMIN(sfb[1], s->subframe_len); y++) {
-                        const float* mat = s->chgroup[i].decorrelation_matrix;
-                        const float* data_end = data + num_channels;
-                        float* data_ptr = data;
-                        float** ch;
-
-                        for (ch = ch_data; ch < ch_end; ch++)
-                            *data_ptr++ = (*ch)[y];
-
-                        for (ch = ch_data; ch < ch_end; ch++) {
-                            float sum = 0;
-                            data_ptr = data;
-                            while (data_ptr < data_end)
-                                sum += *data_ptr++ * *mat++;
-
-                            (*ch)[y] = sum;
-                        }
-                    }
-                } else if (s->avctx->channels == 2) {
-                    int len = FFMIN(sfb[1], s->subframe_len) - sfb[0];
-                    s->fdsp.vector_fmul_scalar(ch_data[0] + sfb[0],
-                                               ch_data[0] + sfb[0],
-                                               181.0 / 128, len);
-                    s->fdsp.vector_fmul_scalar(ch_data[1] + sfb[0],
-                                               ch_data[1] + sfb[0],
-                                               181.0 / 128, len);
-                }
-            }
-        }
-    }
-}
-
-/**
- *@brief Apply sine window and reconstruct the output buffer.
- *@param s codec context
- */
-static void wmapro_window(WMAProDecodeCtx *s)
-{
-    int i;
-    for (i = 0; i < s->channels_for_cur_subframe; i++) {
-        int c = s->channel_indexes_for_cur_subframe[i];
-        float* window;
-        int winlen = s->channel[c].prev_block_len;
-        float* start = s->channel[c].coeffs - (winlen >> 1);
-
-        if (s->subframe_len < winlen) {
-            start += (winlen - s->subframe_len) >> 1;
-            winlen = s->subframe_len;
-        }
-
-        window = s->windows[av_log2(winlen) - WMAPRO_BLOCK_MIN_BITS];
-
-        winlen >>= 1;
-
-        s->fdsp.vector_fmul_window(start, start, start + winlen,
-                                   window, winlen);
-
-        s->channel[c].prev_block_len = s->subframe_len;
-    }
-}
-
-/**
- *@brief Decode a single subframe (block).
- *@param s codec context
- *@return 0 on success, < 0 when decoding failed
- */
-static int decode_subframe(WMAProDecodeCtx *s)
-{
-    int offset = s->samples_per_frame;
-    int subframe_len = s->samples_per_frame;
-    int i;
-    int total_samples   = s->samples_per_frame * s->avctx->channels;
-    int transmit_coeffs = 0;
-    int cur_subwoofer_cutoff;
-
-    s->subframe_offset = get_bits_count(&s->gb);
-
-    /** reset channel context and find the next block offset and size
-        == the next block of the channel with the smallest number of
-        decoded samples
-    */
-    for (i = 0; i < s->avctx->channels; i++) {
-        s->channel[i].grouped = 0;
-        if (offset > s->channel[i].decoded_samples) {
-            offset = s->channel[i].decoded_samples;
-            subframe_len =
-                s->channel[i].subframe_len[s->channel[i].cur_subframe];
-        }
-    }
-
-    av_dlog(s->avctx,
-            "processing subframe with offset %i len %i\n", offset, subframe_len);
-
-    /** get a list of all channels that contain the estimated block */
-    s->channels_for_cur_subframe = 0;
-    for (i = 0; i < s->avctx->channels; i++) {
-        const int cur_subframe = s->channel[i].cur_subframe;
-        /** subtract already processed samples */
-        total_samples -= s->channel[i].decoded_samples;
-
-        /** and count if there are multiple subframes that match our profile */
-        if (offset == s->channel[i].decoded_samples &&
-            subframe_len == s->channel[i].subframe_len[cur_subframe]) {
-            total_samples -= s->channel[i].subframe_len[cur_subframe];
-            s->channel[i].decoded_samples +=
-                s->channel[i].subframe_len[cur_subframe];
-            s->channel_indexes_for_cur_subframe[s->channels_for_cur_subframe] = i;
-            ++s->channels_for_cur_subframe;
-        }
-    }
-
-    /** check if the frame will be complete after processing the
-        estimated block */
-    if (!total_samples)
-        s->parsed_all_subframes = 1;
-
-
-    av_dlog(s->avctx, "subframe is part of %i channels\n",
-            s->channels_for_cur_subframe);
-
-    /** calculate number of scale factor bands and their offsets */
-    s->table_idx         = av_log2(s->samples_per_frame/subframe_len);
-    s->num_bands         = s->num_sfb[s->table_idx];
-    s->cur_sfb_offsets   = s->sfb_offsets[s->table_idx];
-    cur_subwoofer_cutoff = s->subwoofer_cutoffs[s->table_idx];
-
-    /** configure the decoder for the current subframe */
-    offset += s->samples_per_frame >> 1;
-
-    for (i = 0; i < s->channels_for_cur_subframe; i++) {
-        int c = s->channel_indexes_for_cur_subframe[i];
-
-        s->channel[c].coeffs = &s->channel[c].out[offset];
-    }
-
-    s->subframe_len = subframe_len;
-    s->esc_len = av_log2(s->subframe_len - 1) + 1;
-
-    /** skip extended header if any */
-    if (get_bits1(&s->gb)) {
-        int num_fill_bits;
-        if (!(num_fill_bits = get_bits(&s->gb, 2))) {
-            int len = get_bits(&s->gb, 4);
-            num_fill_bits = get_bits(&s->gb, len) + 1;
-        }
-
-        if (num_fill_bits >= 0) {
-            if (get_bits_count(&s->gb) + num_fill_bits > s->num_saved_bits) {
-                av_log(s->avctx, AV_LOG_ERROR, "invalid number of fill bits\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            skip_bits_long(&s->gb, num_fill_bits);
-        }
-    }
-
-    /** no idea for what the following bit is used */
-    if (get_bits1(&s->gb)) {
-        avpriv_request_sample(s->avctx, "Reserved bit");
-        return AVERROR_PATCHWELCOME;
-    }
-
-
-    if (decode_channel_transform(s) < 0)
-        return AVERROR_INVALIDDATA;
-
-
-    for (i = 0; i < s->channels_for_cur_subframe; i++) {
-        int c = s->channel_indexes_for_cur_subframe[i];
-        if ((s->channel[c].transmit_coefs = get_bits1(&s->gb)))
-            transmit_coeffs = 1;
-    }
-
-    if (transmit_coeffs) {
-        int step;
-        int quant_step = 90 * s->bits_per_sample >> 4;
-
-        /** decode number of vector coded coefficients */
-        if ((s->transmit_num_vec_coeffs = get_bits1(&s->gb))) {
-            int num_bits = av_log2((s->subframe_len + 3)/4) + 1;
-            for (i = 0; i < s->channels_for_cur_subframe; i++) {
-                int c = s->channel_indexes_for_cur_subframe[i];
-                int num_vec_coeffs = get_bits(&s->gb, num_bits) << 2;
-                if (num_vec_coeffs + offset > FF_ARRAY_ELEMS(s->channel[c].out)) {
-                    av_log(s->avctx, AV_LOG_ERROR, "num_vec_coeffs %d is too large\n", num_vec_coeffs);
-                    return AVERROR_INVALIDDATA;
-                }
-                s->channel[c].num_vec_coeffs = num_vec_coeffs;
-            }
-        } else {
-            for (i = 0; i < s->channels_for_cur_subframe; i++) {
-                int c = s->channel_indexes_for_cur_subframe[i];
-                s->channel[c].num_vec_coeffs = s->subframe_len;
-            }
-        }
-        /** decode quantization step */
-        step = get_sbits(&s->gb, 6);
-        quant_step += step;
-        if (step == -32 || step == 31) {
-            const int sign = (step == 31) - 1;
-            int quant = 0;
-            while (get_bits_count(&s->gb) + 5 < s->num_saved_bits &&
-                   (step = get_bits(&s->gb, 5)) == 31) {
-                quant += 31;
-            }
-            quant_step += ((quant + step) ^ sign) - sign;
-        }
-        if (quant_step < 0) {
-            av_log(s->avctx, AV_LOG_DEBUG, "negative quant step\n");
-        }
-
-        /** decode quantization step modifiers for every channel */
-
-        if (s->channels_for_cur_subframe == 1) {
-            s->channel[s->channel_indexes_for_cur_subframe[0]].quant_step = quant_step;
-        } else {
-            int modifier_len = get_bits(&s->gb, 3);
-            for (i = 0; i < s->channels_for_cur_subframe; i++) {
-                int c = s->channel_indexes_for_cur_subframe[i];
-                s->channel[c].quant_step = quant_step;
-                if (get_bits1(&s->gb)) {
-                    if (modifier_len) {
-                        s->channel[c].quant_step += get_bits(&s->gb, modifier_len) + 1;
-                    } else
-                        ++s->channel[c].quant_step;
-                }
-            }
-        }
-
-        /** decode scale factors */
-        if (decode_scale_factors(s) < 0)
-            return AVERROR_INVALIDDATA;
-    }
-
-    av_dlog(s->avctx, "BITSTREAM: subframe header length was %i\n",
-            get_bits_count(&s->gb) - s->subframe_offset);
-
-    /** parse coefficients */
-    for (i = 0; i < s->channels_for_cur_subframe; i++) {
-        int c = s->channel_indexes_for_cur_subframe[i];
-        if (s->channel[c].transmit_coefs &&
-            get_bits_count(&s->gb) < s->num_saved_bits) {
-            decode_coeffs(s, c);
-        } else
-            memset(s->channel[c].coeffs, 0,
-                   sizeof(*s->channel[c].coeffs) * subframe_len);
-    }
-
-    av_dlog(s->avctx, "BITSTREAM: subframe length was %i\n",
-            get_bits_count(&s->gb) - s->subframe_offset);
-
-    if (transmit_coeffs) {
-        FFTContext *mdct = &s->mdct_ctx[av_log2(subframe_len) - WMAPRO_BLOCK_MIN_BITS];
-        /** reconstruct the per channel data */
-        inverse_channel_transform(s);
-        for (i = 0; i < s->channels_for_cur_subframe; i++) {
-            int c = s->channel_indexes_for_cur_subframe[i];
-            const int* sf = s->channel[c].scale_factors;
-            int b;
-
-            if (c == s->lfe_channel)
-                memset(&s->tmp[cur_subwoofer_cutoff], 0, sizeof(*s->tmp) *
-                       (subframe_len - cur_subwoofer_cutoff));
-
-            /** inverse quantization and rescaling */
-            for (b = 0; b < s->num_bands; b++) {
-                const int end = FFMIN(s->cur_sfb_offsets[b+1], s->subframe_len);
-                const int exp = s->channel[c].quant_step -
-                            (s->channel[c].max_scale_factor - *sf++) *
-                            s->channel[c].scale_factor_step;
-                const float quant = pow(10.0, exp / 20.0);
-                int start = s->cur_sfb_offsets[b];
-                s->fdsp.vector_fmul_scalar(s->tmp + start,
-                                           s->channel[c].coeffs + start,
-                                           quant, end - start);
-            }
-
-            /** apply imdct (imdct_half == DCTIV with reverse) */
-            mdct->imdct_half(mdct, s->channel[c].coeffs, s->tmp);
-        }
-    }
-
-    /** window and overlapp-add */
-    wmapro_window(s);
-
-    /** handled one subframe */
-    for (i = 0; i < s->channels_for_cur_subframe; i++) {
-        int c = s->channel_indexes_for_cur_subframe[i];
-        if (s->channel[c].cur_subframe >= s->channel[c].num_subframes) {
-            av_log(s->avctx, AV_LOG_ERROR, "broken subframe\n");
-            return AVERROR_INVALIDDATA;
-        }
-        ++s->channel[c].cur_subframe;
-    }
-
-    return 0;
-}
-
-/**
- *@brief Decode one WMA frame.
- *@param s codec context
- *@return 0 if the trailer bit indicates that this is the last frame,
- *        1 if there are additional frames
- */
-static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
-{
-    AVCodecContext *avctx = s->avctx;
-    GetBitContext* gb = &s->gb;
-    int more_frames = 0;
-    int len = 0;
-    int i, ret;
-
-    /** get frame length */
-    if (s->len_prefix)
-        len = get_bits(gb, s->log2_frame_size);
-
-    av_dlog(s->avctx, "decoding frame with length %x\n", len);
-
-    /** decode tile information */
-    if (decode_tilehdr(s)) {
-        s->packet_loss = 1;
-        return 0;
-    }
-
-    /** read postproc transform */
-    if (s->avctx->channels > 1 && get_bits1(gb)) {
-        if (get_bits1(gb)) {
-            for (i = 0; i < avctx->channels * avctx->channels; i++)
-                skip_bits(gb, 4);
-        }
-    }
-
-    /** read drc info */
-    if (s->dynamic_range_compression) {
-        s->drc_gain = get_bits(gb, 8);
-        av_dlog(s->avctx, "drc_gain %i\n", s->drc_gain);
-    }
-
-    /** no idea what these are for, might be the number of samples
-        that need to be skipped at the beginning or end of a stream */
-    if (get_bits1(gb)) {
-        int av_unused skip;
-
-        /** usually true for the first frame */
-        if (get_bits1(gb)) {
-            skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            av_dlog(s->avctx, "start skip: %i\n", skip);
-        }
-
-        /** sometimes true for the last frame */
-        if (get_bits1(gb)) {
-            skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            av_dlog(s->avctx, "end skip: %i\n", skip);
-        }
-
-    }
-
-    av_dlog(s->avctx, "BITSTREAM: frame header length was %i\n",
-            get_bits_count(gb) - s->frame_offset);
-
-    /** reset subframe states */
-    s->parsed_all_subframes = 0;
-    for (i = 0; i < avctx->channels; i++) {
-        s->channel[i].decoded_samples = 0;
-        s->channel[i].cur_subframe    = 0;
-        s->channel[i].reuse_sf        = 0;
-    }
-
-    /** decode all subframes */
-    while (!s->parsed_all_subframes) {
-        if (decode_subframe(s) < 0) {
-            s->packet_loss = 1;
-            return 0;
-        }
-    }
-
-    /* get output buffer */
-    frame->nb_samples = s->samples_per_frame;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        s->packet_loss = 1;
-        return 0;
-    }
-
-    /** copy samples to the output buffer */
-    for (i = 0; i < avctx->channels; i++)
-        memcpy(frame->extended_data[i], s->channel[i].out,
-               s->samples_per_frame * sizeof(*s->channel[i].out));
-
-    for (i = 0; i < avctx->channels; i++) {
-        /** reuse second half of the IMDCT output for the next frame */
-        memcpy(&s->channel[i].out[0],
-               &s->channel[i].out[s->samples_per_frame],
-               s->samples_per_frame * sizeof(*s->channel[i].out) >> 1);
-    }
-
-    if (s->skip_frame) {
-        s->skip_frame = 0;
-        *got_frame_ptr = 0;
-        av_frame_unref(frame);
-    } else {
-        *got_frame_ptr = 1;
-    }
-
-    if (s->len_prefix) {
-        if (len != (get_bits_count(gb) - s->frame_offset) + 2) {
-            /** FIXME: not sure if this is always an error */
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "frame[%i] would have to skip %i bits\n", s->frame_num,
-                   len - (get_bits_count(gb) - s->frame_offset) - 1);
-            s->packet_loss = 1;
-            return 0;
-        }
-
-        /** skip the rest of the frame data */
-        skip_bits_long(gb, len - (get_bits_count(gb) - s->frame_offset) - 1);
-    } else {
-        while (get_bits_count(gb) < s->num_saved_bits && get_bits1(gb) == 0) {
-        }
-    }
-
-    /** decode trailer bit */
-    more_frames = get_bits1(gb);
-
-    ++s->frame_num;
-    return more_frames;
-}
-
-/**
- *@brief Calculate remaining input buffer length.
- *@param s codec context
- *@param gb bitstream reader context
- *@return remaining size in bits
- */
-static int remaining_bits(WMAProDecodeCtx *s, GetBitContext *gb)
-{
-    return s->buf_bit_size - get_bits_count(gb);
-}
-
-/**
- *@brief Fill the bit reservoir with a (partial) frame.
- *@param s codec context
- *@param gb bitstream reader context
- *@param len length of the partial frame
- *@param append decides whether to reset the buffer or not
- */
-static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
-                      int append)
-{
-    int buflen;
-
-    /** when the frame data does not need to be concatenated, the input buffer
-        is resetted and additional bits from the previous frame are copyed
-        and skipped later so that a fast byte copy is possible */
-
-    if (!append) {
-        s->frame_offset = get_bits_count(gb) & 7;
-        s->num_saved_bits = s->frame_offset;
-        init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
-    }
-
-    buflen = (s->num_saved_bits + len + 8) >> 3;
-
-    if (len <= 0 || buflen > MAX_FRAMESIZE) {
-        avpriv_request_sample(s->avctx, "Too small input buffer");
-        s->packet_loss = 1;
-        return;
-    }
-
-    if (len > put_bits_left(&s->pb)) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "Cannot append %d bits, only %d bits available.\n",
-               len, put_bits_left(&s->pb));
-        s->packet_loss = 1;
-        return;
-    }
-
-    s->num_saved_bits += len;
-    if (!append) {
-        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3),
-                     s->num_saved_bits);
-    } else {
-        int align = 8 - (get_bits_count(gb) & 7);
-        align = FFMIN(align, len);
-        put_bits(&s->pb, align, get_bits(gb, align));
-        len -= align;
-        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len);
-    }
-    skip_bits_long(gb, len);
-
-    {
-        PutBitContext tmp = s->pb;
-        flush_put_bits(&tmp);
-    }
-
-    init_get_bits(&s->gb, s->frame_data, s->num_saved_bits);
-    skip_bits(&s->gb, s->frame_offset);
-}
-
-/**
- *@brief Decode a single WMA packet.
- *@param avctx codec context
- *@param data the output buffer
- *@param avpkt input packet
- *@return number of bytes that were read from the input buffer
- */
-static int decode_packet(AVCodecContext *avctx, void *data,
-                         int *got_frame_ptr, AVPacket* avpkt)
-{
-    WMAProDecodeCtx *s = avctx->priv_data;
-    GetBitContext* gb  = &s->pgb;
-    const uint8_t* buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    int num_bits_prev_frame;
-    int packet_sequence_number;
-
-    *got_frame_ptr = 0;
-
-    if (s->packet_done || s->packet_loss) {
-        s->packet_done = 0;
-
-        /** sanity check for the buffer length */
-        if (buf_size < avctx->block_align) {
-            av_log(avctx, AV_LOG_ERROR, "Input packet too small (%d < %d)\n",
-                   buf_size, avctx->block_align);
-            return AVERROR_INVALIDDATA;
-        }
-
-        s->next_packet_start = buf_size - avctx->block_align;
-        buf_size = avctx->block_align;
-        s->buf_bit_size = buf_size << 3;
-
-        /** parse packet header */
-        init_get_bits(gb, buf, s->buf_bit_size);
-        packet_sequence_number = get_bits(gb, 4);
-        skip_bits(gb, 2);
-
-        /** get number of bits that need to be added to the previous frame */
-        num_bits_prev_frame = get_bits(gb, s->log2_frame_size);
-        av_dlog(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number,
-                num_bits_prev_frame);
-
-        /** check for packet loss */
-        if (!s->packet_loss &&
-            ((s->packet_sequence_number + 1) & 0xF) != packet_sequence_number) {
-            s->packet_loss = 1;
-            av_log(avctx, AV_LOG_ERROR, "Packet loss detected! seq %x vs %x\n",
-                   s->packet_sequence_number, packet_sequence_number);
-        }
-        s->packet_sequence_number = packet_sequence_number;
-
-        if (num_bits_prev_frame > 0) {
-            int remaining_packet_bits = s->buf_bit_size - get_bits_count(gb);
-            if (num_bits_prev_frame >= remaining_packet_bits) {
-                num_bits_prev_frame = remaining_packet_bits;
-                s->packet_done = 1;
-            }
-
-            /** append the previous frame data to the remaining data from the
-                previous packet to create a full frame */
-            save_bits(s, gb, num_bits_prev_frame, 1);
-            av_dlog(avctx, "accumulated %x bits of frame data\n",
-                    s->num_saved_bits - s->frame_offset);
-
-            /** decode the cross packet frame if it is valid */
-            if (!s->packet_loss)
-                decode_frame(s, data, got_frame_ptr);
-        } else if (s->num_saved_bits - s->frame_offset) {
-            av_dlog(avctx, "ignoring %x previously saved bits\n",
-                    s->num_saved_bits - s->frame_offset);
-        }
-
-        if (s->packet_loss) {
-            /** reset number of saved bits so that the decoder
-                does not start to decode incomplete frames in the
-                s->len_prefix == 0 case */
-            s->num_saved_bits = 0;
-            s->packet_loss = 0;
-        }
-
-    } else {
-        int frame_size;
-        s->buf_bit_size = (avpkt->size - s->next_packet_start) << 3;
-        init_get_bits(gb, avpkt->data, s->buf_bit_size);
-        skip_bits(gb, s->packet_offset);
-        if (s->len_prefix && remaining_bits(s, gb) > s->log2_frame_size &&
-            (frame_size = show_bits(gb, s->log2_frame_size)) &&
-            frame_size <= remaining_bits(s, gb)) {
-            save_bits(s, gb, frame_size, 0);
-            s->packet_done = !decode_frame(s, data, got_frame_ptr);
-        } else if (!s->len_prefix
-                   && s->num_saved_bits > get_bits_count(&s->gb)) {
-            /** when the frames do not have a length prefix, we don't know
-                the compressed length of the individual frames
-                however, we know what part of a new packet belongs to the
-                previous frame
-                therefore we save the incoming packet first, then we append
-                the "previous frame" data from the next packet so that
-                we get a buffer that only contains full frames */
-            s->packet_done = !decode_frame(s, data, got_frame_ptr);
-        } else
-            s->packet_done = 1;
-    }
-
-    if (s->packet_done && !s->packet_loss &&
-        remaining_bits(s, gb) > 0) {
-        /** save the rest of the data so that it can be decoded
-            with the next packet */
-        save_bits(s, gb, remaining_bits(s, gb), 0);
-    }
-
-    s->packet_offset = get_bits_count(gb) & 7;
-    if (s->packet_loss)
-        return AVERROR_INVALIDDATA;
-
-    return get_bits_count(gb) >> 3;
-}
-
-/**
- *@brief Clear decoder buffers (for seeking).
- *@param avctx codec context
- */
-static void flush(AVCodecContext *avctx)
-{
-    WMAProDecodeCtx *s = avctx->priv_data;
-    int i;
-    /** reset output buffer as a part of it is used during the windowing of a
-        new frame */
-    for (i = 0; i < avctx->channels; i++)
-        memset(s->channel[i].out, 0, s->samples_per_frame *
-               sizeof(*s->channel[i].out));
-    s->packet_loss = 1;
-}
-
-
-/**
- *@brief wmapro decoder
- */
-AVCodec ff_wmapro_decoder = {
-    .name           = "wmapro",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Audio 9 Professional"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_WMAPRO,
-    .priv_data_size = sizeof(WMAProDecodeCtx),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_packet,
-    .capabilities   = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
-    .flush          = flush,
-    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
-                                                      AV_SAMPLE_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/wmavoice.c b/deps/libav/libavcodec/wmavoice.c
deleted file mode 100644
index 0d91077..0000000
--- a/deps/libav/libavcodec/wmavoice.c
+++ /dev/null
@@ -1,2079 +0,0 @@
-/*
- * Windows Media Audio Voice decoder.
- * Copyright (c) 2009 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Windows Media Audio Voice compatible decoder
- * @author Ronald S. Bultje <rsbultje at gmail.com>
- */
-
-#define UNCHECKED_BITSTREAM_READER 1
-
-#include <math.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-#include "internal.h"
-#include "get_bits.h"
-#include "put_bits.h"
-#include "wmavoice_data.h"
-#include "celp_filters.h"
-#include "acelp_vectors.h"
-#include "acelp_filters.h"
-#include "lsp.h"
-#include "dct.h"
-#include "rdft.h"
-#include "sinewin.h"
-
-#define MAX_BLOCKS           8   ///< maximum number of blocks per frame
-#define MAX_LSPS             16  ///< maximum filter order
-#define MAX_LSPS_ALIGN16     16  ///< same as #MAX_LSPS; needs to be multiple
-                                 ///< of 16 for ASM input buffer alignment
-#define MAX_FRAMES           3   ///< maximum number of frames per superframe
-#define MAX_FRAMESIZE        160 ///< maximum number of samples per frame
-#define MAX_SIGNAL_HISTORY   416 ///< maximum excitation signal history
-#define MAX_SFRAMESIZE       (MAX_FRAMESIZE * MAX_FRAMES)
-                                 ///< maximum number of samples per superframe
-#define SFRAME_CACHE_MAXSIZE 256 ///< maximum cache size for frame data that
-                                 ///< was split over two packets
-#define VLC_NBITS            6   ///< number of bits to read per VLC iteration
-
-/**
- * Frame type VLC coding.
- */
-static VLC frame_type_vlc;
-
-/**
- * Adaptive codebook types.
- */
-enum {
-    ACB_TYPE_NONE       = 0, ///< no adaptive codebook (only hardcoded fixed)
-    ACB_TYPE_ASYMMETRIC = 1, ///< adaptive codebook with per-frame pitch, which
-                             ///< we interpolate to get a per-sample pitch.
-                             ///< Signal is generated using an asymmetric sinc
-                             ///< window function
-                             ///< @note see #wmavoice_ipol1_coeffs
-    ACB_TYPE_HAMMING    = 2  ///< Per-block pitch with signal generation using
-                             ///< a Hamming sinc window function
-                             ///< @note see #wmavoice_ipol2_coeffs
-};
-
-/**
- * Fixed codebook types.
- */
-enum {
-    FCB_TYPE_SILENCE    = 0, ///< comfort noise during silence
-                             ///< generated from a hardcoded (fixed) codebook
-                             ///< with per-frame (low) gain values
-    FCB_TYPE_HARDCODED  = 1, ///< hardcoded (fixed) codebook with per-block
-                             ///< gain values
-    FCB_TYPE_AW_PULSES  = 2, ///< Pitch-adaptive window (AW) pulse signals,
-                             ///< used in particular for low-bitrate streams
-    FCB_TYPE_EXC_PULSES = 3, ///< Innovation (fixed) codebook pulse sets in
-                             ///< combinations of either single pulses or
-                             ///< pulse pairs
-};
-
-/**
- * Description of frame types.
- */
-static const struct frame_type_desc {
-    uint8_t n_blocks;     ///< amount of blocks per frame (each block
-                          ///< (contains 160/#n_blocks samples)
-    uint8_t log_n_blocks; ///< log2(#n_blocks)
-    uint8_t acb_type;     ///< Adaptive codebook type (ACB_TYPE_*)
-    uint8_t fcb_type;     ///< Fixed codebook type (FCB_TYPE_*)
-    uint8_t dbl_pulses;   ///< how many pulse vectors have pulse pairs
-                          ///< (rather than just one single pulse)
-                          ///< only if #fcb_type == #FCB_TYPE_EXC_PULSES
-    uint16_t frame_size;  ///< the amount of bits that make up the block
-                          ///< data (per frame)
-} frame_descs[17] = {
-    { 1, 0, ACB_TYPE_NONE,       FCB_TYPE_SILENCE,    0,   0 },
-    { 2, 1, ACB_TYPE_NONE,       FCB_TYPE_HARDCODED,  0,  28 },
-    { 2, 1, ACB_TYPE_ASYMMETRIC, FCB_TYPE_AW_PULSES,  0,  46 },
-    { 2, 1, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 2,  80 },
-    { 2, 1, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 5, 104 },
-    { 4, 2, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 0, 108 },
-    { 4, 2, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 2, 132 },
-    { 4, 2, ACB_TYPE_ASYMMETRIC, FCB_TYPE_EXC_PULSES, 5, 168 },
-    { 2, 1, ACB_TYPE_HAMMING,    FCB_TYPE_EXC_PULSES, 0,  64 },
-    { 2, 1, ACB_TYPE_HAMMING,    FCB_TYPE_EXC_PULSES, 2,  80 },
-    { 2, 1, ACB_TYPE_HAMMING,    FCB_TYPE_EXC_PULSES, 5, 104 },
-    { 4, 2, ACB_TYPE_HAMMING,    FCB_TYPE_EXC_PULSES, 0, 108 },
-    { 4, 2, ACB_TYPE_HAMMING,    FCB_TYPE_EXC_PULSES, 2, 132 },
-    { 4, 2, ACB_TYPE_HAMMING,    FCB_TYPE_EXC_PULSES, 5, 168 },
-    { 8, 3, ACB_TYPE_HAMMING,    FCB_TYPE_EXC_PULSES, 0, 176 },
-    { 8, 3, ACB_TYPE_HAMMING,    FCB_TYPE_EXC_PULSES, 2, 208 },
-    { 8, 3, ACB_TYPE_HAMMING,    FCB_TYPE_EXC_PULSES, 5, 256 }
-};
-
-/**
- * WMA Voice decoding context.
- */
-typedef struct {
-    /**
-     * @name Global values specified in the stream header / extradata or used all over.
-     * @{
-     */
-    GetBitContext gb;             ///< packet bitreader. During decoder init,
-                                  ///< it contains the extradata from the
-                                  ///< demuxer. During decoding, it contains
-                                  ///< packet data.
-    int8_t vbm_tree[25];          ///< converts VLC codes to frame type
-
-    int spillover_bitsize;        ///< number of bits used to specify
-                                  ///< #spillover_nbits in the packet header
-                                  ///< = ceil(log2(ctx->block_align << 3))
-    int history_nsamples;         ///< number of samples in history for signal
-                                  ///< prediction (through ACB)
-
-    /* postfilter specific values */
-    int do_apf;                   ///< whether to apply the averaged
-                                  ///< projection filter (APF)
-    int denoise_strength;         ///< strength of denoising in Wiener filter
-                                  ///< [0-11]
-    int denoise_tilt_corr;        ///< Whether to apply tilt correction to the
-                                  ///< Wiener filter coefficients (postfilter)
-    int dc_level;                 ///< Predicted amount of DC noise, based
-                                  ///< on which a DC removal filter is used
-
-    int lsps;                     ///< number of LSPs per frame [10 or 16]
-    int lsp_q_mode;               ///< defines quantizer defaults [0, 1]
-    int lsp_def_mode;             ///< defines different sets of LSP defaults
-                                  ///< [0, 1]
-    int frame_lsp_bitsize;        ///< size (in bits) of LSPs, when encoded
-                                  ///< per-frame (independent coding)
-    int sframe_lsp_bitsize;       ///< size (in bits) of LSPs, when encoded
-                                  ///< per superframe (residual coding)
-
-    int min_pitch_val;            ///< base value for pitch parsing code
-    int max_pitch_val;            ///< max value + 1 for pitch parsing
-    int pitch_nbits;              ///< number of bits used to specify the
-                                  ///< pitch value in the frame header
-    int block_pitch_nbits;        ///< number of bits used to specify the
-                                  ///< first block's pitch value
-    int block_pitch_range;        ///< range of the block pitch
-    int block_delta_pitch_nbits;  ///< number of bits used to specify the
-                                  ///< delta pitch between this and the last
-                                  ///< block's pitch value, used in all but
-                                  ///< first block
-    int block_delta_pitch_hrange; ///< 1/2 range of the delta (full range is
-                                  ///< from -this to +this-1)
-    uint16_t block_conv_table[4]; ///< boundaries for block pitch unit/scale
-                                  ///< conversion
-
-    /**
-     * @}
-     *
-     * @name Packet values specified in the packet header or related to a packet.
-     *
-     * A packet is considered to be a single unit of data provided to this
-     * decoder by the demuxer.
-     * @{
-     */
-    int spillover_nbits;          ///< number of bits of the previous packet's
-                                  ///< last superframe preceding this
-                                  ///< packet's first full superframe (useful
-                                  ///< for re-synchronization also)
-    int has_residual_lsps;        ///< if set, superframes contain one set of
-                                  ///< LSPs that cover all frames, encoded as
-                                  ///< independent and residual LSPs; if not
-                                  ///< set, each frame contains its own, fully
-                                  ///< independent, LSPs
-    int skip_bits_next;           ///< number of bits to skip at the next call
-                                  ///< to #wmavoice_decode_packet() (since
-                                  ///< they're part of the previous superframe)
-
-    uint8_t sframe_cache[SFRAME_CACHE_MAXSIZE + FF_INPUT_BUFFER_PADDING_SIZE];
-                                  ///< cache for superframe data split over
-                                  ///< multiple packets
-    int sframe_cache_size;        ///< set to >0 if we have data from an
-                                  ///< (incomplete) superframe from a previous
-                                  ///< packet that spilled over in the current
-                                  ///< packet; specifies the amount of bits in
-                                  ///< #sframe_cache
-    PutBitContext pb;             ///< bitstream writer for #sframe_cache
-
-    /**
-     * @}
-     *
-     * @name Frame and superframe values
-     * Superframe and frame data - these can change from frame to frame,
-     * although some of them do in that case serve as a cache / history for
-     * the next frame or superframe.
-     * @{
-     */
-    double prev_lsps[MAX_LSPS];   ///< LSPs of the last frame of the previous
-                                  ///< superframe
-    int last_pitch_val;           ///< pitch value of the previous frame
-    int last_acb_type;            ///< frame type [0-2] of the previous frame
-    int pitch_diff_sh16;          ///< ((cur_pitch_val - #last_pitch_val)
-                                  ///< << 16) / #MAX_FRAMESIZE
-    float silence_gain;           ///< set for use in blocks if #ACB_TYPE_NONE
-
-    int aw_idx_is_ext;            ///< whether the AW index was encoded in
-                                  ///< 8 bits (instead of 6)
-    int aw_pulse_range;           ///< the range over which #aw_pulse_set1()
-                                  ///< can apply the pulse, relative to the
-                                  ///< value in aw_first_pulse_off. The exact
-                                  ///< position of the first AW-pulse is within
-                                  ///< [pulse_off, pulse_off + this], and
-                                  ///< depends on bitstream values; [16 or 24]
-    int aw_n_pulses[2];           ///< number of AW-pulses in each block; note
-                                  ///< that this number can be negative (in
-                                  ///< which case it basically means "zero")
-    int aw_first_pulse_off[2];    ///< index of first sample to which to
-                                  ///< apply AW-pulses, or -0xff if unset
-    int aw_next_pulse_off_cache;  ///< the position (relative to start of the
-                                  ///< second block) at which pulses should
-                                  ///< start to be positioned, serves as a
-                                  ///< cache for pitch-adaptive window pulses
-                                  ///< between blocks
-
-    int frame_cntr;               ///< current frame index [0 - 0xFFFE]; is
-                                  ///< only used for comfort noise in #pRNG()
-    float gain_pred_err[6];       ///< cache for gain prediction
-    float excitation_history[MAX_SIGNAL_HISTORY];
-                                  ///< cache of the signal of previous
-                                  ///< superframes, used as a history for
-                                  ///< signal generation
-    float synth_history[MAX_LSPS]; ///< see #excitation_history
-    /**
-     * @}
-     *
-     * @name Postfilter values
-     *
-     * Variables used for postfilter implementation, mostly history for
-     * smoothing and so on, and context variables for FFT/iFFT.
-     * @{
-     */
-    RDFTContext rdft, irdft;      ///< contexts for FFT-calculation in the
-                                  ///< postfilter (for denoise filter)
-    DCTContext dct, dst;          ///< contexts for phase shift (in Hilbert
-                                  ///< transform, part of postfilter)
-    float sin[511], cos[511];     ///< 8-bit cosine/sine windows over [-pi,pi]
-                                  ///< range
-    float postfilter_agc;         ///< gain control memory, used in
-                                  ///< #adaptive_gain_control()
-    float dcf_mem[2];             ///< DC filter history
-    float zero_exc_pf[MAX_SIGNAL_HISTORY + MAX_SFRAMESIZE];
-                                  ///< zero filter output (i.e. excitation)
-                                  ///< by postfilter
-    float denoise_filter_cache[MAX_FRAMESIZE];
-    int   denoise_filter_cache_size; ///< samples in #denoise_filter_cache
-    DECLARE_ALIGNED(32, float, tilted_lpcs_pf)[0x80];
-                                  ///< aligned buffer for LPC tilting
-    DECLARE_ALIGNED(32, float, denoise_coeffs_pf)[0x80];
-                                  ///< aligned buffer for denoise coefficients
-    DECLARE_ALIGNED(32, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16];
-                                  ///< aligned buffer for postfilter speech
-                                  ///< synthesis
-    /**
-     * @}
-     */
-} WMAVoiceContext;
-
-/**
- * Set up the variable bit mode (VBM) tree from container extradata.
- * @param gb bit I/O context.
- *           The bit context (s->gb) should be loaded with byte 23-46 of the
- *           container extradata (i.e. the ones containing the VBM tree).
- * @param vbm_tree pointer to array to which the decoded VBM tree will be
- *                 written.
- * @return 0 on success, <0 on error.
- */
-static av_cold int decode_vbmtree(GetBitContext *gb, int8_t vbm_tree[25])
-{
-    int cntr[8] = { 0 }, n, res;
-
-    memset(vbm_tree, 0xff, sizeof(vbm_tree[0]) * 25);
-    for (n = 0; n < 17; n++) {
-        res = get_bits(gb, 3);
-        if (cntr[res] > 3) // should be >= 3 + (res == 7))
-            return -1;
-        vbm_tree[res * 3 + cntr[res]++] = n;
-    }
-    return 0;
-}
-
-static av_cold void wmavoice_init_static_data(AVCodec *codec)
-{
-    static const uint8_t bits[] = {
-         2,  2,  2,  4,  4,  4,
-         6,  6,  6,  8,  8,  8,
-        10, 10, 10, 12, 12, 12,
-        14, 14, 14, 14
-    };
-    static const uint16_t codes[] = {
-          0x0000, 0x0001, 0x0002,        //              00/01/10
-          0x000c, 0x000d, 0x000e,        //           11+00/01/10
-          0x003c, 0x003d, 0x003e,        //         1111+00/01/10
-          0x00fc, 0x00fd, 0x00fe,        //       111111+00/01/10
-          0x03fc, 0x03fd, 0x03fe,        //     11111111+00/01/10
-          0x0ffc, 0x0ffd, 0x0ffe,        //   1111111111+00/01/10
-          0x3ffc, 0x3ffd, 0x3ffe, 0x3fff // 111111111111+xx
-    };
-
-    INIT_VLC_STATIC(&frame_type_vlc, VLC_NBITS, sizeof(bits),
-                    bits, 1, 1, codes, 2, 2, 132);
-}
-
-/**
- * Set up decoder with parameters from demuxer (extradata etc.).
- */
-static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
-{
-    int n, flags, pitch_range, lsp16_flag;
-    WMAVoiceContext *s = ctx->priv_data;
-
-    /**
-     * Extradata layout:
-     * - byte  0-18: WMAPro-in-WMAVoice extradata (see wmaprodec.c),
-     * - byte 19-22: flags field (annoyingly in LE; see below for known
-     *               values),
-     * - byte 23-46: variable bitmode tree (really just 17 * 3 bits,
-     *               rest is 0).
-     */
-    if (ctx->extradata_size != 46) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid extradata size %d (should be 46)\n",
-               ctx->extradata_size);
-        return AVERROR_INVALIDDATA;
-    }
-    flags                = AV_RL32(ctx->extradata + 18);
-    s->spillover_bitsize = 3 + av_ceil_log2(ctx->block_align);
-    s->do_apf            =    flags & 0x1;
-    if (s->do_apf) {
-        ff_rdft_init(&s->rdft,  7, DFT_R2C);
-        ff_rdft_init(&s->irdft, 7, IDFT_C2R);
-        ff_dct_init(&s->dct,  6, DCT_I);
-        ff_dct_init(&s->dst,  6, DST_I);
-
-        ff_sine_window_init(s->cos, 256);
-        memcpy(&s->sin[255], s->cos, 256 * sizeof(s->cos[0]));
-        for (n = 0; n < 255; n++) {
-            s->sin[n]       = -s->sin[510 - n];
-            s->cos[510 - n] =  s->cos[n];
-        }
-    }
-    s->denoise_strength  =   (flags >> 2) & 0xF;
-    if (s->denoise_strength >= 12) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid denoise filter strength %d (max=11)\n",
-               s->denoise_strength);
-        return AVERROR_INVALIDDATA;
-    }
-    s->denoise_tilt_corr = !!(flags & 0x40);
-    s->dc_level          =   (flags >> 7) & 0xF;
-    s->lsp_q_mode        = !!(flags & 0x2000);
-    s->lsp_def_mode      = !!(flags & 0x4000);
-    lsp16_flag           =    flags & 0x1000;
-    if (lsp16_flag) {
-        s->lsps               = 16;
-        s->frame_lsp_bitsize  = 34;
-        s->sframe_lsp_bitsize = 60;
-    } else {
-        s->lsps               = 10;
-        s->frame_lsp_bitsize  = 24;
-        s->sframe_lsp_bitsize = 48;
-    }
-    for (n = 0; n < s->lsps; n++)
-        s->prev_lsps[n] = M_PI * (n + 1.0) / (s->lsps + 1.0);
-
-    init_get_bits(&s->gb, ctx->extradata + 22, (ctx->extradata_size - 22) << 3);
-    if (decode_vbmtree(&s->gb, s->vbm_tree) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid VBM tree; broken extradata?\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->min_pitch_val    = ((ctx->sample_rate << 8)      /  400 + 50) >> 8;
-    s->max_pitch_val    = ((ctx->sample_rate << 8) * 37 / 2000 + 50) >> 8;
-    pitch_range         = s->max_pitch_val - s->min_pitch_val;
-    if (pitch_range <= 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid pitch range; broken extradata?\n");
-        return AVERROR_INVALIDDATA;
-    }
-    s->pitch_nbits      = av_ceil_log2(pitch_range);
-    s->last_pitch_val   = 40;
-    s->last_acb_type    = ACB_TYPE_NONE;
-    s->history_nsamples = s->max_pitch_val + 8;
-
-    if (s->min_pitch_val < 1 || s->history_nsamples > MAX_SIGNAL_HISTORY) {
-        int min_sr = ((((1 << 8) - 50) * 400) + 0xFF) >> 8,
-            max_sr = ((((MAX_SIGNAL_HISTORY - 8) << 8) + 205) * 2000 / 37) >> 8;
-
-        av_log(ctx, AV_LOG_ERROR,
-               "Unsupported samplerate %d (min=%d, max=%d)\n",
-               ctx->sample_rate, min_sr, max_sr); // 322-22097 Hz
-
-        return AVERROR(ENOSYS);
-    }
-
-    s->block_conv_table[0]      = s->min_pitch_val;
-    s->block_conv_table[1]      = (pitch_range * 25) >> 6;
-    s->block_conv_table[2]      = (pitch_range * 44) >> 6;
-    s->block_conv_table[3]      = s->max_pitch_val - 1;
-    s->block_delta_pitch_hrange = (pitch_range >> 3) & ~0xF;
-    if (s->block_delta_pitch_hrange <= 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid delta pitch hrange; broken extradata?\n");
-        return AVERROR_INVALIDDATA;
-    }
-    s->block_delta_pitch_nbits  = 1 + av_ceil_log2(s->block_delta_pitch_hrange);
-    s->block_pitch_range        = s->block_conv_table[2] +
-                                  s->block_conv_table[3] + 1 +
-                                  2 * (s->block_conv_table[1] - 2 * s->min_pitch_val);
-    s->block_pitch_nbits        = av_ceil_log2(s->block_pitch_range);
-
-    ctx->channels               = 1;
-    ctx->channel_layout         = AV_CH_LAYOUT_MONO;
-    ctx->sample_fmt             = AV_SAMPLE_FMT_FLT;
-
-    return 0;
-}
-
-/**
- * @name Postfilter functions
- * Postfilter functions (gain control, wiener denoise filter, DC filter,
- * kalman smoothening, plus surrounding code to wrap it)
- * @{
- */
-/**
- * Adaptive gain control (as used in postfilter).
- *
- * Identical to #ff_adaptive_gain_control() in acelp_vectors.c, except
- * that the energy here is calculated using sum(abs(...)), whereas the
- * other codecs (e.g. AMR-NB, SIPRO) use sqrt(dotproduct(...)).
- *
- * @param out output buffer for filtered samples
- * @param in input buffer containing the samples as they are after the
- *           postfilter steps so far
- * @param speech_synth input buffer containing speech synth before postfilter
- * @param size input buffer size
- * @param alpha exponential filter factor
- * @param gain_mem pointer to filter memory (single float)
- */
-static void adaptive_gain_control(float *out, const float *in,
-                                  const float *speech_synth,
-                                  int size, float alpha, float *gain_mem)
-{
-    int i;
-    float speech_energy = 0.0, postfilter_energy = 0.0, gain_scale_factor;
-    float mem = *gain_mem;
-
-    for (i = 0; i < size; i++) {
-        speech_energy     += fabsf(speech_synth[i]);
-        postfilter_energy += fabsf(in[i]);
-    }
-    gain_scale_factor = (1.0 - alpha) * speech_energy / postfilter_energy;
-
-    for (i = 0; i < size; i++) {
-        mem = alpha * mem + gain_scale_factor;
-        out[i] = in[i] * mem;
-    }
-
-    *gain_mem = mem;
-}
-
-/**
- * Kalman smoothing function.
- *
- * This function looks back pitch +/- 3 samples back into history to find
- * the best fitting curve (that one giving the optimal gain of the two
- * signals, i.e. the highest dot product between the two), and then
- * uses that signal history to smoothen the output of the speech synthesis
- * filter.
- *
- * @param s WMA Voice decoding context
- * @param pitch pitch of the speech signal
- * @param in input speech signal
- * @param out output pointer for smoothened signal
- * @param size input/output buffer size
- *
- * @returns -1 if no smoothening took place, e.g. because no optimal
- *          fit could be found, or 0 on success.
- */
-static int kalman_smoothen(WMAVoiceContext *s, int pitch,
-                           const float *in, float *out, int size)
-{
-    int n;
-    float optimal_gain = 0, dot;
-    const float *ptr = &in[-FFMAX(s->min_pitch_val, pitch - 3)],
-                *end = &in[-FFMIN(s->max_pitch_val, pitch + 3)],
-                *best_hist_ptr;
-
-    /* find best fitting point in history */
-    do {
-        dot = avpriv_scalarproduct_float_c(in, ptr, size);
-        if (dot > optimal_gain) {
-            optimal_gain  = dot;
-            best_hist_ptr = ptr;
-        }
-    } while (--ptr >= end);
-
-    if (optimal_gain <= 0)
-        return -1;
-    dot = avpriv_scalarproduct_float_c(best_hist_ptr, best_hist_ptr, size);
-    if (dot <= 0) // would be 1.0
-        return -1;
-
-    if (optimal_gain <= dot) {
-        dot = dot / (dot + 0.6 * optimal_gain); // 0.625-1.000
-    } else
-        dot = 0.625;
-
-    /* actual smoothing */
-    for (n = 0; n < size; n++)
-        out[n] = best_hist_ptr[n] + dot * (in[n] - best_hist_ptr[n]);
-
-    return 0;
-}
-
-/**
- * Get the tilt factor of a formant filter from its transfer function
- * @see #tilt_factor() in amrnbdec.c, which does essentially the same,
- *      but somehow (??) it does a speech synthesis filter in the
- *      middle, which is missing here
- *
- * @param lpcs LPC coefficients
- * @param n_lpcs Size of LPC buffer
- * @returns the tilt factor
- */
-static float tilt_factor(const float *lpcs, int n_lpcs)
-{
-    float rh0, rh1;
-
-    rh0 = 1.0     + avpriv_scalarproduct_float_c(lpcs,  lpcs,    n_lpcs);
-    rh1 = lpcs[0] + avpriv_scalarproduct_float_c(lpcs, &lpcs[1], n_lpcs - 1);
-
-    return rh1 / rh0;
-}
-
-/**
- * Derive denoise filter coefficients (in real domain) from the LPCs.
- */
-static void calc_input_response(WMAVoiceContext *s, float *lpcs,
-                                int fcb_type, float *coeffs, int remainder)
-{
-    float last_coeff, min = 15.0, max = -15.0;
-    float irange, angle_mul, gain_mul, range, sq;
-    int n, idx;
-
-    /* Create frequency power spectrum of speech input (i.e. RDFT of LPCs) */
-    s->rdft.rdft_calc(&s->rdft, lpcs);
-#define log_range(var, assign) do { \
-        float tmp = log10f(assign);  var = tmp; \
-        max       = FFMAX(max, tmp); min = FFMIN(min, tmp); \
-    } while (0)
-    log_range(last_coeff,  lpcs[1]         * lpcs[1]);
-    for (n = 1; n < 64; n++)
-        log_range(lpcs[n], lpcs[n * 2]     * lpcs[n * 2] +
-                           lpcs[n * 2 + 1] * lpcs[n * 2 + 1]);
-    log_range(lpcs[0],     lpcs[0]         * lpcs[0]);
-#undef log_range
-    range    = max - min;
-    lpcs[64] = last_coeff;
-
-    /* Now, use this spectrum to pick out these frequencies with higher
-     * (relative) power/energy (which we then take to be "not noise"),
-     * and set up a table (still in lpc[]) of (relative) gains per frequency.
-     * These frequencies will be maintained, while others ("noise") will be
-     * decreased in the filter output. */
-    irange    = 64.0 / range; // so irange*(max-value) is in the range [0, 63]
-    gain_mul  = range * (fcb_type == FCB_TYPE_HARDCODED ? (5.0 / 13.0) :
-                                                          (5.0 / 14.7));
-    angle_mul = gain_mul * (8.0 * M_LN10 / M_PI);
-    for (n = 0; n <= 64; n++) {
-        float pwr;
-
-        idx = FFMAX(0, lrint((max - lpcs[n]) * irange) - 1);
-        pwr = wmavoice_denoise_power_table[s->denoise_strength][idx];
-        lpcs[n] = angle_mul * pwr;
-
-        /* 70.57 =~ 1/log10(1.0331663) */
-        idx = (pwr * gain_mul - 0.0295) * 70.570526123;
-        if (idx > 127) { // fall back if index falls outside table range
-            coeffs[n] = wmavoice_energy_table[127] *
-                        powf(1.0331663, idx - 127);
-        } else
-            coeffs[n] = wmavoice_energy_table[FFMAX(0, idx)];
-    }
-
-    /* calculate the Hilbert transform of the gains, which we do (since this
-     * is a sine input) by doing a phase shift (in theory, H(sin())=cos()).
-     * Hilbert_Transform(RDFT(x)) = Laplace_Transform(x), which calculates the
-     * "moment" of the LPCs in this filter. */
-    s->dct.dct_calc(&s->dct, lpcs);
-    s->dst.dct_calc(&s->dst, lpcs);
-
-    /* Split out the coefficient indexes into phase/magnitude pairs */
-    idx = 255 + av_clip(lpcs[64],               -255, 255);
-    coeffs[0]  = coeffs[0]  * s->cos[idx];
-    idx = 255 + av_clip(lpcs[64] - 2 * lpcs[63], -255, 255);
-    last_coeff = coeffs[64] * s->cos[idx];
-    for (n = 63;; n--) {
-        idx = 255 + av_clip(-lpcs[64] - 2 * lpcs[n - 1], -255, 255);
-        coeffs[n * 2 + 1] = coeffs[n] * s->sin[idx];
-        coeffs[n * 2]     = coeffs[n] * s->cos[idx];
-
-        if (!--n) break;
-
-        idx = 255 + av_clip( lpcs[64] - 2 * lpcs[n - 1], -255, 255);
-        coeffs[n * 2 + 1] = coeffs[n] * s->sin[idx];
-        coeffs[n * 2]     = coeffs[n] * s->cos[idx];
-    }
-    coeffs[1] = last_coeff;
-
-    /* move into real domain */
-    s->irdft.rdft_calc(&s->irdft, coeffs);
-
-    /* tilt correction and normalize scale */
-    memset(&coeffs[remainder], 0, sizeof(coeffs[0]) * (128 - remainder));
-    if (s->denoise_tilt_corr) {
-        float tilt_mem = 0;
-
-        coeffs[remainder - 1] = 0;
-        ff_tilt_compensation(&tilt_mem,
-                             -1.8 * tilt_factor(coeffs, remainder - 1),
-                             coeffs, remainder);
-    }
-    sq = (1.0 / 64.0) * sqrtf(1 / avpriv_scalarproduct_float_c(coeffs, coeffs,
-                                                               remainder));
-    for (n = 0; n < remainder; n++)
-        coeffs[n] *= sq;
-}
-
-/**
- * This function applies a Wiener filter on the (noisy) speech signal as
- * a means to denoise it.
- *
- * - take RDFT of LPCs to get the power spectrum of the noise + speech;
- * - using this power spectrum, calculate (for each frequency) the Wiener
- *    filter gain, which depends on the frequency power and desired level
- *    of noise subtraction (when set too high, this leads to artifacts)
- *    We can do this symmetrically over the X-axis (so 0-4kHz is the inverse
- *    of 4-8kHz);
- * - by doing a phase shift, calculate the Hilbert transform of this array
- *    of per-frequency filter-gains to get the filtering coefficients;
- * - smoothen/normalize/de-tilt these filter coefficients as desired;
- * - take RDFT of noisy sound, apply the coefficients and take its IRDFT
- *    to get the denoised speech signal;
- * - the leftover (i.e. output of the IRDFT on denoised speech data beyond
- *    the frame boundary) are saved and applied to subsequent frames by an
- *    overlap-add method (otherwise you get clicking-artifacts).
- *
- * @param s WMA Voice decoding context
- * @param fcb_type Frame (codebook) type
- * @param synth_pf input: the noisy speech signal, output: denoised speech
- *                 data; should be 16-byte aligned (for ASM purposes)
- * @param size size of the speech data
- * @param lpcs LPCs used to synthesize this frame's speech data
- */
-static void wiener_denoise(WMAVoiceContext *s, int fcb_type,
-                           float *synth_pf, int size,
-                           const float *lpcs)
-{
-    int remainder, lim, n;
-
-    if (fcb_type != FCB_TYPE_SILENCE) {
-        float *tilted_lpcs = s->tilted_lpcs_pf,
-              *coeffs = s->denoise_coeffs_pf, tilt_mem = 0;
-
-        tilted_lpcs[0]           = 1.0;
-        memcpy(&tilted_lpcs[1], lpcs, sizeof(lpcs[0]) * s->lsps);
-        memset(&tilted_lpcs[s->lsps + 1], 0,
-               sizeof(tilted_lpcs[0]) * (128 - s->lsps - 1));
-        ff_tilt_compensation(&tilt_mem, 0.7 * tilt_factor(lpcs, s->lsps),
-                             tilted_lpcs, s->lsps + 2);
-
-        /* The IRDFT output (127 samples for 7-bit filter) beyond the frame
-         * size is applied to the next frame. All input beyond this is zero,
-         * and thus all output beyond this will go towards zero, hence we can
-         * limit to min(size-1, 127-size) as a performance consideration. */
-        remainder = FFMIN(127 - size, size - 1);
-        calc_input_response(s, tilted_lpcs, fcb_type, coeffs, remainder);
-
-        /* apply coefficients (in frequency spectrum domain), i.e. complex
-         * number multiplication */
-        memset(&synth_pf[size], 0, sizeof(synth_pf[0]) * (128 - size));
-        s->rdft.rdft_calc(&s->rdft, synth_pf);
-        s->rdft.rdft_calc(&s->rdft, coeffs);
-        synth_pf[0] *= coeffs[0];
-        synth_pf[1] *= coeffs[1];
-        for (n = 1; n < 64; n++) {
-            float v1 = synth_pf[n * 2], v2 = synth_pf[n * 2 + 1];
-            synth_pf[n * 2]     = v1 * coeffs[n * 2] - v2 * coeffs[n * 2 + 1];
-            synth_pf[n * 2 + 1] = v2 * coeffs[n * 2] + v1 * coeffs[n * 2 + 1];
-        }
-        s->irdft.rdft_calc(&s->irdft, synth_pf);
-    }
-
-    /* merge filter output with the history of previous runs */
-    if (s->denoise_filter_cache_size) {
-        lim = FFMIN(s->denoise_filter_cache_size, size);
-        for (n = 0; n < lim; n++)
-            synth_pf[n] += s->denoise_filter_cache[n];
-        s->denoise_filter_cache_size -= lim;
-        memmove(s->denoise_filter_cache, &s->denoise_filter_cache[size],
-                sizeof(s->denoise_filter_cache[0]) * s->denoise_filter_cache_size);
-    }
-
-    /* move remainder of filter output into a cache for future runs */
-    if (fcb_type != FCB_TYPE_SILENCE) {
-        lim = FFMIN(remainder, s->denoise_filter_cache_size);
-        for (n = 0; n < lim; n++)
-            s->denoise_filter_cache[n] += synth_pf[size + n];
-        if (lim < remainder) {
-            memcpy(&s->denoise_filter_cache[lim], &synth_pf[size + lim],
-                   sizeof(s->denoise_filter_cache[0]) * (remainder - lim));
-            s->denoise_filter_cache_size = remainder;
-        }
-    }
-}
-
-/**
- * Averaging projection filter, the postfilter used in WMAVoice.
- *
- * This uses the following steps:
- * - A zero-synthesis filter (generate excitation from synth signal)
- * - Kalman smoothing on excitation, based on pitch
- * - Re-synthesized smoothened output
- * - Iterative Wiener denoise filter
- * - Adaptive gain filter
- * - DC filter
- *
- * @param s WMAVoice decoding context
- * @param synth Speech synthesis output (before postfilter)
- * @param samples Output buffer for filtered samples
- * @param size Buffer size of synth & samples
- * @param lpcs Generated LPCs used for speech synthesis
- * @param zero_exc_pf destination for zero synthesis filter (16-byte aligned)
- * @param fcb_type Frame type (silence, hardcoded, AW-pulses or FCB-pulses)
- * @param pitch Pitch of the input signal
- */
-static void postfilter(WMAVoiceContext *s, const float *synth,
-                       float *samples,    int size,
-                       const float *lpcs, float *zero_exc_pf,
-                       int fcb_type,      int pitch)
-{
-    float synth_filter_in_buf[MAX_FRAMESIZE / 2],
-          *synth_pf = &s->synth_filter_out_buf[MAX_LSPS_ALIGN16],
-          *synth_filter_in = zero_exc_pf;
-
-    assert(size <= MAX_FRAMESIZE / 2);
-
-    /* generate excitation from input signal */
-    ff_celp_lp_zero_synthesis_filterf(zero_exc_pf, lpcs, synth, size, s->lsps);
-
-    if (fcb_type >= FCB_TYPE_AW_PULSES &&
-        !kalman_smoothen(s, pitch, zero_exc_pf, synth_filter_in_buf, size))
-        synth_filter_in = synth_filter_in_buf;
-
-    /* re-synthesize speech after smoothening, and keep history */
-    ff_celp_lp_synthesis_filterf(synth_pf, lpcs,
-                                 synth_filter_in, size, s->lsps);
-    memcpy(&synth_pf[-s->lsps], &synth_pf[size - s->lsps],
-           sizeof(synth_pf[0]) * s->lsps);
-
-    wiener_denoise(s, fcb_type, synth_pf, size, lpcs);
-
-    adaptive_gain_control(samples, synth_pf, synth, size, 0.99,
-                          &s->postfilter_agc);
-
-    if (s->dc_level > 8) {
-        /* remove ultra-low frequency DC noise / highpass filter;
-         * coefficients are identical to those used in SIPR decoding,
-         * and very closely resemble those used in AMR-NB decoding. */
-        ff_acelp_apply_order_2_transfer_function(samples, samples,
-            (const float[2]) { -1.99997,      1.0 },
-            (const float[2]) { -1.9330735188, 0.93589198496 },
-            0.93980580475, s->dcf_mem, size);
-    }
-}
-/**
- * @}
- */
-
-/**
- * Dequantize LSPs
- * @param lsps output pointer to the array that will hold the LSPs
- * @param num number of LSPs to be dequantized
- * @param values quantized values, contains n_stages values
- * @param sizes range (i.e. max value) of each quantized value
- * @param n_stages number of dequantization runs
- * @param table dequantization table to be used
- * @param mul_q LSF multiplier
- * @param base_q base (lowest) LSF values
- */
-static void dequant_lsps(double *lsps, int num,
-                         const uint16_t *values,
-                         const uint16_t *sizes,
-                         int n_stages, const uint8_t *table,
-                         const double *mul_q,
-                         const double *base_q)
-{
-    int n, m;
-
-    memset(lsps, 0, num * sizeof(*lsps));
-    for (n = 0; n < n_stages; n++) {
-        const uint8_t *t_off = &table[values[n] * num];
-        double base = base_q[n], mul = mul_q[n];
-
-        for (m = 0; m < num; m++)
-            lsps[m] += base + mul * t_off[m];
-
-        table += sizes[n] * num;
-    }
-}
-
-/**
- * @name LSP dequantization routines
- * LSP dequantization routines, for 10/16LSPs and independent/residual coding.
- * @note we assume enough bits are available, caller should check.
- * lsp10i() consumes 24 bits; lsp10r() consumes an additional 24 bits;
- * lsp16i() consumes 34 bits; lsp16r() consumes an additional 26 bits.
- * @{
- */
-/**
- * Parse 10 independently-coded LSPs.
- */
-static void dequant_lsp10i(GetBitContext *gb, double *lsps)
-{
-    static const uint16_t vec_sizes[4] = { 256, 64, 32, 32 };
-    static const double mul_lsf[4] = {
-        5.2187144800e-3,    1.4626986422e-3,
-        9.6179549166e-4,    1.1325736225e-3
-    };
-    static const double base_lsf[4] = {
-        M_PI * -2.15522e-1, M_PI * -6.1646e-2,
-        M_PI * -3.3486e-2,  M_PI * -5.7408e-2
-    };
-    uint16_t v[4];
-
-    v[0] = get_bits(gb, 8);
-    v[1] = get_bits(gb, 6);
-    v[2] = get_bits(gb, 5);
-    v[3] = get_bits(gb, 5);
-
-    dequant_lsps(lsps, 10, v, vec_sizes, 4, wmavoice_dq_lsp10i,
-                 mul_lsf, base_lsf);
-}
-
-/**
- * Parse 10 independently-coded LSPs, and then derive the tables to
- * generate LSPs for the other frames from them (residual coding).
- */
-static void dequant_lsp10r(GetBitContext *gb,
-                           double *i_lsps, const double *old,
-                           double *a1, double *a2, int q_mode)
-{
-    static const uint16_t vec_sizes[3] = { 128, 64, 64 };
-    static const double mul_lsf[3] = {
-        2.5807601174e-3,    1.2354460219e-3,   1.1763821673e-3
-    };
-    static const double base_lsf[3] = {
-        M_PI * -1.07448e-1, M_PI * -5.2706e-2, M_PI * -5.1634e-2
-    };
-    const float (*ipol_tab)[2][10] = q_mode ?
-        wmavoice_lsp10_intercoeff_b : wmavoice_lsp10_intercoeff_a;
-    uint16_t interpol, v[3];
-    int n;
-
-    dequant_lsp10i(gb, i_lsps);
-
-    interpol = get_bits(gb, 5);
-    v[0]     = get_bits(gb, 7);
-    v[1]     = get_bits(gb, 6);
-    v[2]     = get_bits(gb, 6);
-
-    for (n = 0; n < 10; n++) {
-        double delta = old[n] - i_lsps[n];
-        a1[n]        = ipol_tab[interpol][0][n] * delta + i_lsps[n];
-        a1[10 + n]   = ipol_tab[interpol][1][n] * delta + i_lsps[n];
-    }
-
-    dequant_lsps(a2, 20, v, vec_sizes, 3, wmavoice_dq_lsp10r,
-                 mul_lsf, base_lsf);
-}
-
-/**
- * Parse 16 independently-coded LSPs.
- */
-static void dequant_lsp16i(GetBitContext *gb, double *lsps)
-{
-    static const uint16_t vec_sizes[5] = { 256, 64, 128, 64, 128 };
-    static const double mul_lsf[5] = {
-        3.3439586280e-3,    6.9908173703e-4,
-        3.3216608306e-3,    1.0334960326e-3,
-        3.1899104283e-3
-    };
-    static const double base_lsf[5] = {
-        M_PI * -1.27576e-1, M_PI * -2.4292e-2,
-        M_PI * -1.28094e-1, M_PI * -3.2128e-2,
-        M_PI * -1.29816e-1
-    };
-    uint16_t v[5];
-
-    v[0] = get_bits(gb, 8);
-    v[1] = get_bits(gb, 6);
-    v[2] = get_bits(gb, 7);
-    v[3] = get_bits(gb, 6);
-    v[4] = get_bits(gb, 7);
-
-    dequant_lsps( lsps,     5,  v,     vec_sizes,    2,
-                 wmavoice_dq_lsp16i1,  mul_lsf,     base_lsf);
-    dequant_lsps(&lsps[5],  5, &v[2], &vec_sizes[2], 2,
-                 wmavoice_dq_lsp16i2, &mul_lsf[2], &base_lsf[2]);
-    dequant_lsps(&lsps[10], 6, &v[4], &vec_sizes[4], 1,
-                 wmavoice_dq_lsp16i3, &mul_lsf[4], &base_lsf[4]);
-}
-
-/**
- * Parse 16 independently-coded LSPs, and then derive the tables to
- * generate LSPs for the other frames from them (residual coding).
- */
-static void dequant_lsp16r(GetBitContext *gb,
-                           double *i_lsps, const double *old,
-                           double *a1, double *a2, int q_mode)
-{
-    static const uint16_t vec_sizes[3] = { 128, 128, 128 };
-    static const double mul_lsf[3] = {
-        1.2232979501e-3,   1.4062241527e-3,   1.6114744851e-3
-    };
-    static const double base_lsf[3] = {
-        M_PI * -5.5830e-2, M_PI * -5.2908e-2, M_PI * -5.4776e-2
-    };
-    const float (*ipol_tab)[2][16] = q_mode ?
-        wmavoice_lsp16_intercoeff_b : wmavoice_lsp16_intercoeff_a;
-    uint16_t interpol, v[3];
-    int n;
-
-    dequant_lsp16i(gb, i_lsps);
-
-    interpol = get_bits(gb, 5);
-    v[0]     = get_bits(gb, 7);
-    v[1]     = get_bits(gb, 7);
-    v[2]     = get_bits(gb, 7);
-
-    for (n = 0; n < 16; n++) {
-        double delta = old[n] - i_lsps[n];
-        a1[n]        = ipol_tab[interpol][0][n] * delta + i_lsps[n];
-        a1[16 + n]   = ipol_tab[interpol][1][n] * delta + i_lsps[n];
-    }
-
-    dequant_lsps( a2,     10,  v,     vec_sizes,    1,
-                 wmavoice_dq_lsp16r1,  mul_lsf,     base_lsf);
-    dequant_lsps(&a2[10], 10, &v[1], &vec_sizes[1], 1,
-                 wmavoice_dq_lsp16r2, &mul_lsf[1], &base_lsf[1]);
-    dequant_lsps(&a2[20], 12, &v[2], &vec_sizes[2], 1,
-                 wmavoice_dq_lsp16r3, &mul_lsf[2], &base_lsf[2]);
-}
-
-/**
- * @}
- * @name Pitch-adaptive window coding functions
- * The next few functions are for pitch-adaptive window coding.
- * @{
- */
-/**
- * Parse the offset of the first pitch-adaptive window pulses, and
- * the distribution of pulses between the two blocks in this frame.
- * @param s WMA Voice decoding context private data
- * @param gb bit I/O context
- * @param pitch pitch for each block in this frame
- */
-static void aw_parse_coords(WMAVoiceContext *s, GetBitContext *gb,
-                            const int *pitch)
-{
-    static const int16_t start_offset[94] = {
-        -11,  -9,  -7,  -5,  -3,  -1,   1,   3,   5,   7,   9,  11,
-         13,  15,  18,  17,  19,  20,  21,  22,  23,  24,  25,  26,
-         27,  28,  29,  30,  31,  32,  33,  35,  37,  39,  41,  43,
-         45,  47,  49,  51,  53,  55,  57,  59,  61,  63,  65,  67,
-         69,  71,  73,  75,  77,  79,  81,  83,  85,  87,  89,  91,
-         93,  95,  97,  99, 101, 103, 105, 107, 109, 111, 113, 115,
-        117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139,
-        141, 143, 145, 147, 149, 151, 153, 155, 157, 159
-    };
-    int bits, offset;
-
-    /* position of pulse */
-    s->aw_idx_is_ext = 0;
-    if ((bits = get_bits(gb, 6)) >= 54) {
-        s->aw_idx_is_ext = 1;
-        bits += (bits - 54) * 3 + get_bits(gb, 2);
-    }
-
-    /* for a repeated pulse at pulse_off with a pitch_lag of pitch[], count
-     * the distribution of the pulses in each block contained in this frame. */
-    s->aw_pulse_range        = FFMIN(pitch[0], pitch[1]) > 32 ? 24 : 16;
-    for (offset = start_offset[bits]; offset < 0; offset += pitch[0]) ;
-    s->aw_n_pulses[0]        = (pitch[0] - 1 + MAX_FRAMESIZE / 2 - offset) / pitch[0];
-    s->aw_first_pulse_off[0] = offset - s->aw_pulse_range / 2;
-    offset                  += s->aw_n_pulses[0] * pitch[0];
-    s->aw_n_pulses[1]        = (pitch[1] - 1 + MAX_FRAMESIZE - offset) / pitch[1];
-    s->aw_first_pulse_off[1] = offset - (MAX_FRAMESIZE + s->aw_pulse_range) / 2;
-
-    /* if continuing from a position before the block, reset position to
-     * start of block (when corrected for the range over which it can be
-     * spread in aw_pulse_set1()). */
-    if (start_offset[bits] < MAX_FRAMESIZE / 2) {
-        while (s->aw_first_pulse_off[1] - pitch[1] + s->aw_pulse_range > 0)
-            s->aw_first_pulse_off[1] -= pitch[1];
-        if (start_offset[bits] < 0)
-            while (s->aw_first_pulse_off[0] - pitch[0] + s->aw_pulse_range > 0)
-                s->aw_first_pulse_off[0] -= pitch[0];
-    }
-}
-
-/**
- * Apply second set of pitch-adaptive window pulses.
- * @param s WMA Voice decoding context private data
- * @param gb bit I/O context
- * @param block_idx block index in frame [0, 1]
- * @param fcb structure containing fixed codebook vector info
- * @return -1 on error, 0 otherwise
- */
-static int aw_pulse_set2(WMAVoiceContext *s, GetBitContext *gb,
-                         int block_idx, AMRFixed *fcb)
-{
-    uint16_t use_mask_mem[9]; // only 5 are used, rest is padding
-    uint16_t *use_mask = use_mask_mem + 2;
-    /* in this function, idx is the index in the 80-bit (+ padding) use_mask
-     * bit-array. Since use_mask consists of 16-bit values, the lower 4 bits
-     * of idx are the position of the bit within a particular item in the
-     * array (0 being the most significant bit, and 15 being the least
-     * significant bit), and the remainder (>> 4) is the index in the
-     * use_mask[]-array. This is faster and uses less memory than using a
-     * 80-byte/80-int array. */
-    int pulse_off = s->aw_first_pulse_off[block_idx],
-        pulse_start, n, idx, range, aidx, start_off = 0;
-
-    /* set offset of first pulse to within this block */
-    if (s->aw_n_pulses[block_idx] > 0)
-        while (pulse_off + s->aw_pulse_range < 1)
-            pulse_off += fcb->pitch_lag;
-
-    /* find range per pulse */
-    if (s->aw_n_pulses[0] > 0) {
-        if (block_idx == 0) {
-            range = 32;
-        } else /* block_idx = 1 */ {
-            range = 8;
-            if (s->aw_n_pulses[block_idx] > 0)
-                pulse_off = s->aw_next_pulse_off_cache;
-        }
-    } else
-        range = 16;
-    pulse_start = s->aw_n_pulses[block_idx] > 0 ? pulse_off - range / 2 : 0;
-
-    /* aw_pulse_set1() already applies pulses around pulse_off (to be exactly,
-     * in the range of [pulse_off, pulse_off + s->aw_pulse_range], and thus
-     * we exclude that range from being pulsed again in this function. */
-    memset(&use_mask[-2], 0, 2 * sizeof(use_mask[0]));
-    memset( use_mask,   -1, 5 * sizeof(use_mask[0]));
-    memset(&use_mask[5], 0, 2 * sizeof(use_mask[0]));
-    if (s->aw_n_pulses[block_idx] > 0)
-        for (idx = pulse_off; idx < MAX_FRAMESIZE / 2; idx += fcb->pitch_lag) {
-            int excl_range         = s->aw_pulse_range; // always 16 or 24
-            uint16_t *use_mask_ptr = &use_mask[idx >> 4];
-            int first_sh           = 16 - (idx & 15);
-            *use_mask_ptr++       &= 0xFFFFu << first_sh;
-            excl_range            -= first_sh;
-            if (excl_range >= 16) {
-                *use_mask_ptr++    = 0;
-                *use_mask_ptr     &= 0xFFFF >> (excl_range - 16);
-            } else
-                *use_mask_ptr     &= 0xFFFF >> excl_range;
-        }
-
-    /* find the 'aidx'th offset that is not excluded */
-    aidx = get_bits(gb, s->aw_n_pulses[0] > 0 ? 5 - 2 * block_idx : 4);
-    for (n = 0; n <= aidx; pulse_start++) {
-        for (idx = pulse_start; idx < 0; idx += fcb->pitch_lag) ;
-        if (idx >= MAX_FRAMESIZE / 2) { // find from zero
-            if (use_mask[0])      idx = 0x0F;
-            else if (use_mask[1]) idx = 0x1F;
-            else if (use_mask[2]) idx = 0x2F;
-            else if (use_mask[3]) idx = 0x3F;
-            else if (use_mask[4]) idx = 0x4F;
-            else return -1;
-            idx -= av_log2_16bit(use_mask[idx >> 4]);
-        }
-        if (use_mask[idx >> 4] & (0x8000 >> (idx & 15))) {
-            use_mask[idx >> 4] &= ~(0x8000 >> (idx & 15));
-            n++;
-            start_off = idx;
-        }
-    }
-
-    fcb->x[fcb->n] = start_off;
-    fcb->y[fcb->n] = get_bits1(gb) ? -1.0 : 1.0;
-    fcb->n++;
-
-    /* set offset for next block, relative to start of that block */
-    n = (MAX_FRAMESIZE / 2 - start_off) % fcb->pitch_lag;
-    s->aw_next_pulse_off_cache = n ? fcb->pitch_lag - n : 0;
-    return 0;
-}
-
-/**
- * Apply first set of pitch-adaptive window pulses.
- * @param s WMA Voice decoding context private data
- * @param gb bit I/O context
- * @param block_idx block index in frame [0, 1]
- * @param fcb storage location for fixed codebook pulse info
- */
-static void aw_pulse_set1(WMAVoiceContext *s, GetBitContext *gb,
-                          int block_idx, AMRFixed *fcb)
-{
-    int val = get_bits(gb, 12 - 2 * (s->aw_idx_is_ext && !block_idx));
-    float v;
-
-    if (s->aw_n_pulses[block_idx] > 0) {
-        int n, v_mask, i_mask, sh, n_pulses;
-
-        if (s->aw_pulse_range == 24) { // 3 pulses, 1:sign + 3:index each
-            n_pulses = 3;
-            v_mask   = 8;
-            i_mask   = 7;
-            sh       = 4;
-        } else { // 4 pulses, 1:sign + 2:index each
-            n_pulses = 4;
-            v_mask   = 4;
-            i_mask   = 3;
-            sh       = 3;
-        }
-
-        for (n = n_pulses - 1; n >= 0; n--, val >>= sh) {
-            fcb->y[fcb->n] = (val & v_mask) ? -1.0 : 1.0;
-            fcb->x[fcb->n] = (val & i_mask) * n_pulses + n +
-                                 s->aw_first_pulse_off[block_idx];
-            while (fcb->x[fcb->n] < 0)
-                fcb->x[fcb->n] += fcb->pitch_lag;
-            if (fcb->x[fcb->n] < MAX_FRAMESIZE / 2)
-                fcb->n++;
-        }
-    } else {
-        int num2 = (val & 0x1FF) >> 1, delta, idx;
-
-        if (num2 < 1 * 79)      { delta = 1; idx = num2 + 1; }
-        else if (num2 < 2 * 78) { delta = 3; idx = num2 + 1 - 1 * 77; }
-        else if (num2 < 3 * 77) { delta = 5; idx = num2 + 1 - 2 * 76; }
-        else                    { delta = 7; idx = num2 + 1 - 3 * 75; }
-        v = (val & 0x200) ? -1.0 : 1.0;
-
-        fcb->no_repeat_mask |= 3 << fcb->n;
-        fcb->x[fcb->n]       = idx - delta;
-        fcb->y[fcb->n]       = v;
-        fcb->x[fcb->n + 1]   = idx;
-        fcb->y[fcb->n + 1]   = (val & 1) ? -v : v;
-        fcb->n              += 2;
-    }
-}
-
-/**
- * @}
- *
- * Generate a random number from frame_cntr and block_idx, which will lief
- * in the range [0, 1000 - block_size] (so it can be used as an index in a
- * table of size 1000 of which you want to read block_size entries).
- *
- * @param frame_cntr current frame number
- * @param block_num current block index
- * @param block_size amount of entries we want to read from a table
- *                   that has 1000 entries
- * @return a (non-)random number in the [0, 1000 - block_size] range.
- */
-static int pRNG(int frame_cntr, int block_num, int block_size)
-{
-    /* array to simplify the calculation of z:
-     * y = (x % 9) * 5 + 6;
-     * z = (49995 * x) / y;
-     * Since y only has 9 values, we can remove the division by using a
-     * LUT and using FASTDIV-style divisions. For each of the 9 values
-     * of y, we can rewrite z as:
-     * z = x * (49995 / y) + x * ((49995 % y) / y)
-     * In this table, each col represents one possible value of y, the
-     * first number is 49995 / y, and the second is the FASTDIV variant
-     * of 49995 % y / y. */
-    static const unsigned int div_tbl[9][2] = {
-        { 8332,  3 * 715827883U }, // y =  6
-        { 4545,  0 * 390451573U }, // y = 11
-        { 3124, 11 * 268435456U }, // y = 16
-        { 2380, 15 * 204522253U }, // y = 21
-        { 1922, 23 * 165191050U }, // y = 26
-        { 1612, 23 * 138547333U }, // y = 31
-        { 1388, 27 * 119304648U }, // y = 36
-        { 1219, 16 * 104755300U }, // y = 41
-        { 1086, 39 *  93368855U }  // y = 46
-    };
-    unsigned int z, y, x = MUL16(block_num, 1877) + frame_cntr;
-    if (x >= 0xFFFF) x -= 0xFFFF;   // max value of x is 8*1877+0xFFFE=0x13AA6,
-                                    // so this is effectively a modulo (%)
-    y = x - 9 * MULH(477218589, x); // x % 9
-    z = (uint16_t) (x * div_tbl[y][0] + UMULH(x, div_tbl[y][1]));
-                                    // z = x * 49995 / (y * 5 + 6)
-    return z % (1000 - block_size);
-}
-
-/**
- * Parse hardcoded signal for a single block.
- * @note see #synth_block().
- */
-static void synth_block_hardcoded(WMAVoiceContext *s, GetBitContext *gb,
-                                 int block_idx, int size,
-                                 const struct frame_type_desc *frame_desc,
-                                 float *excitation)
-{
-    float gain;
-    int n, r_idx;
-
-    assert(size <= MAX_FRAMESIZE);
-
-    /* Set the offset from which we start reading wmavoice_std_codebook */
-    if (frame_desc->fcb_type == FCB_TYPE_SILENCE) {
-        r_idx = pRNG(s->frame_cntr, block_idx, size);
-        gain  = s->silence_gain;
-    } else /* FCB_TYPE_HARDCODED */ {
-        r_idx = get_bits(gb, 8);
-        gain  = wmavoice_gain_universal[get_bits(gb, 6)];
-    }
-
-    /* Clear gain prediction parameters */
-    memset(s->gain_pred_err, 0, sizeof(s->gain_pred_err));
-
-    /* Apply gain to hardcoded codebook and use that as excitation signal */
-    for (n = 0; n < size; n++)
-        excitation[n] = wmavoice_std_codebook[r_idx + n] * gain;
-}
-
-/**
- * Parse FCB/ACB signal for a single block.
- * @note see #synth_block().
- */
-static void synth_block_fcb_acb(WMAVoiceContext *s, GetBitContext *gb,
-                                int block_idx, int size,
-                                int block_pitch_sh2,
-                                const struct frame_type_desc *frame_desc,
-                                float *excitation)
-{
-    static const float gain_coeff[6] = {
-        0.8169, -0.06545, 0.1726, 0.0185, -0.0359, 0.0458
-    };
-    float pulses[MAX_FRAMESIZE / 2], pred_err, acb_gain, fcb_gain;
-    int n, idx, gain_weight;
-    AMRFixed fcb;
-
-    assert(size <= MAX_FRAMESIZE / 2);
-    memset(pulses, 0, sizeof(*pulses) * size);
-
-    fcb.pitch_lag      = block_pitch_sh2 >> 2;
-    fcb.pitch_fac      = 1.0;
-    fcb.no_repeat_mask = 0;
-    fcb.n              = 0;
-
-    /* For the other frame types, this is where we apply the innovation
-     * (fixed) codebook pulses of the speech signal. */
-    if (frame_desc->fcb_type == FCB_TYPE_AW_PULSES) {
-        aw_pulse_set1(s, gb, block_idx, &fcb);
-        if (aw_pulse_set2(s, gb, block_idx, &fcb)) {
-            /* Conceal the block with silence and return.
-             * Skip the correct amount of bits to read the next
-             * block from the correct offset. */
-            int r_idx = pRNG(s->frame_cntr, block_idx, size);
-
-            for (n = 0; n < size; n++)
-                excitation[n] =
-                    wmavoice_std_codebook[r_idx + n] * s->silence_gain;
-            skip_bits(gb, 7 + 1);
-            return;
-        }
-    } else /* FCB_TYPE_EXC_PULSES */ {
-        int offset_nbits = 5 - frame_desc->log_n_blocks;
-
-        fcb.no_repeat_mask = -1;
-        /* similar to ff_decode_10_pulses_35bits(), but with single pulses
-         * (instead of double) for a subset of pulses */
-        for (n = 0; n < 5; n++) {
-            float sign;
-            int pos1, pos2;
-
-            sign           = get_bits1(gb) ? 1.0 : -1.0;
-            pos1           = get_bits(gb, offset_nbits);
-            fcb.x[fcb.n]   = n + 5 * pos1;
-            fcb.y[fcb.n++] = sign;
-            if (n < frame_desc->dbl_pulses) {
-                pos2           = get_bits(gb, offset_nbits);
-                fcb.x[fcb.n]   = n + 5 * pos2;
-                fcb.y[fcb.n++] = (pos1 < pos2) ? -sign : sign;
-            }
-        }
-    }
-    ff_set_fixed_vector(pulses, &fcb, 1.0, size);
-
-    /* Calculate gain for adaptive & fixed codebook signal.
-     * see ff_amr_set_fixed_gain(). */
-    idx = get_bits(gb, 7);
-    fcb_gain = expf(avpriv_scalarproduct_float_c(s->gain_pred_err,
-                                                 gain_coeff, 6) -
-                    5.2409161640 + wmavoice_gain_codebook_fcb[idx]);
-    acb_gain = wmavoice_gain_codebook_acb[idx];
-    pred_err = av_clipf(wmavoice_gain_codebook_fcb[idx],
-                        -2.9957322736 /* log(0.05) */,
-                         1.6094379124 /* log(5.0)  */);
-
-    gain_weight = 8 >> frame_desc->log_n_blocks;
-    memmove(&s->gain_pred_err[gain_weight], s->gain_pred_err,
-            sizeof(*s->gain_pred_err) * (6 - gain_weight));
-    for (n = 0; n < gain_weight; n++)
-        s->gain_pred_err[n] = pred_err;
-
-    /* Calculation of adaptive codebook */
-    if (frame_desc->acb_type == ACB_TYPE_ASYMMETRIC) {
-        int len;
-        for (n = 0; n < size; n += len) {
-            int next_idx_sh16;
-            int abs_idx    = block_idx * size + n;
-            int pitch_sh16 = (s->last_pitch_val << 16) +
-                             s->pitch_diff_sh16 * abs_idx;
-            int pitch      = (pitch_sh16 + 0x6FFF) >> 16;
-            int idx_sh16   = ((pitch << 16) - pitch_sh16) * 8 + 0x58000;
-            idx            = idx_sh16 >> 16;
-            if (s->pitch_diff_sh16) {
-                if (s->pitch_diff_sh16 > 0) {
-                    next_idx_sh16 = (idx_sh16) &~ 0xFFFF;
-                } else
-                    next_idx_sh16 = (idx_sh16 + 0x10000) &~ 0xFFFF;
-                len = av_clip((idx_sh16 - next_idx_sh16) / s->pitch_diff_sh16 / 8,
-                              1, size - n);
-            } else
-                len = size;
-
-            ff_acelp_interpolatef(&excitation[n], &excitation[n - pitch],
-                                  wmavoice_ipol1_coeffs, 17,
-                                  idx, 9, len);
-        }
-    } else /* ACB_TYPE_HAMMING */ {
-        int block_pitch = block_pitch_sh2 >> 2;
-        idx             = block_pitch_sh2 & 3;
-        if (idx) {
-            ff_acelp_interpolatef(excitation, &excitation[-block_pitch],
-                                  wmavoice_ipol2_coeffs, 4,
-                                  idx, 8, size);
-        } else
-            av_memcpy_backptr((uint8_t *) excitation, sizeof(float) * block_pitch,
-                              sizeof(float) * size);
-    }
-
-    /* Interpolate ACB/FCB and use as excitation signal */
-    ff_weighted_vector_sumf(excitation, excitation, pulses,
-                            acb_gain, fcb_gain, size);
-}
-
-/**
- * Parse data in a single block.
- * @note we assume enough bits are available, caller should check.
- *
- * @param s WMA Voice decoding context private data
- * @param gb bit I/O context
- * @param block_idx index of the to-be-read block
- * @param size amount of samples to be read in this block
- * @param block_pitch_sh2 pitch for this block << 2
- * @param lsps LSPs for (the end of) this frame
- * @param prev_lsps LSPs for the last frame
- * @param frame_desc frame type descriptor
- * @param excitation target memory for the ACB+FCB interpolated signal
- * @param synth target memory for the speech synthesis filter output
- * @return 0 on success, <0 on error.
- */
-static void synth_block(WMAVoiceContext *s, GetBitContext *gb,
-                        int block_idx, int size,
-                        int block_pitch_sh2,
-                        const double *lsps, const double *prev_lsps,
-                        const struct frame_type_desc *frame_desc,
-                        float *excitation, float *synth)
-{
-    double i_lsps[MAX_LSPS];
-    float lpcs[MAX_LSPS];
-    float fac;
-    int n;
-
-    if (frame_desc->acb_type == ACB_TYPE_NONE)
-        synth_block_hardcoded(s, gb, block_idx, size, frame_desc, excitation);
-    else
-        synth_block_fcb_acb(s, gb, block_idx, size, block_pitch_sh2,
-                            frame_desc, excitation);
-
-    /* convert interpolated LSPs to LPCs */
-    fac = (block_idx + 0.5) / frame_desc->n_blocks;
-    for (n = 0; n < s->lsps; n++) // LSF -> LSP
-        i_lsps[n] = cos(prev_lsps[n] + fac * (lsps[n] - prev_lsps[n]));
-    ff_acelp_lspd2lpc(i_lsps, lpcs, s->lsps >> 1);
-
-    /* Speech synthesis */
-    ff_celp_lp_synthesis_filterf(synth, lpcs, excitation, size, s->lsps);
-}
-
-/**
- * Synthesize output samples for a single frame.
- * @note we assume enough bits are available, caller should check.
- *
- * @param ctx WMA Voice decoder context
- * @param gb bit I/O context (s->gb or one for cross-packet superframes)
- * @param frame_idx Frame number within superframe [0-2]
- * @param samples pointer to output sample buffer, has space for at least 160
- *                samples
- * @param lsps LSP array
- * @param prev_lsps array of previous frame's LSPs
- * @param excitation target buffer for excitation signal
- * @param synth target buffer for synthesized speech data
- * @return 0 on success, <0 on error.
- */
-static int synth_frame(AVCodecContext *ctx, GetBitContext *gb, int frame_idx,
-                       float *samples,
-                       const double *lsps, const double *prev_lsps,
-                       float *excitation, float *synth)
-{
-    WMAVoiceContext *s = ctx->priv_data;
-    int n, n_blocks_x2, log_n_blocks_x2, cur_pitch_val;
-    int pitch[MAX_BLOCKS], last_block_pitch;
-
-    /* Parse frame type ("frame header"), see frame_descs */
-    int bd_idx = s->vbm_tree[get_vlc2(gb, frame_type_vlc.table, 6, 3)], block_nsamples;
-
-    if (bd_idx < 0) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid frame type VLC code, skipping\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    block_nsamples = MAX_FRAMESIZE / frame_descs[bd_idx].n_blocks;
-
-    /* Pitch calculation for ACB_TYPE_ASYMMETRIC ("pitch-per-frame") */
-    if (frame_descs[bd_idx].acb_type == ACB_TYPE_ASYMMETRIC) {
-        /* Pitch is provided per frame, which is interpreted as the pitch of
-         * the last sample of the last block of this frame. We can interpolate
-         * the pitch of other blocks (and even pitch-per-sample) by gradually
-         * incrementing/decrementing prev_frame_pitch to cur_pitch_val. */
-        n_blocks_x2      = frame_descs[bd_idx].n_blocks << 1;
-        log_n_blocks_x2  = frame_descs[bd_idx].log_n_blocks + 1;
-        cur_pitch_val    = s->min_pitch_val + get_bits(gb, s->pitch_nbits);
-        cur_pitch_val    = FFMIN(cur_pitch_val, s->max_pitch_val - 1);
-        if (s->last_acb_type == ACB_TYPE_NONE ||
-            20 * abs(cur_pitch_val - s->last_pitch_val) >
-                (cur_pitch_val + s->last_pitch_val))
-            s->last_pitch_val = cur_pitch_val;
-
-        /* pitch per block */
-        for (n = 0; n < frame_descs[bd_idx].n_blocks; n++) {
-            int fac = n * 2 + 1;
-
-            pitch[n] = (MUL16(fac,                 cur_pitch_val) +
-                        MUL16((n_blocks_x2 - fac), s->last_pitch_val) +
-                        frame_descs[bd_idx].n_blocks) >> log_n_blocks_x2;
-        }
-
-        /* "pitch-diff-per-sample" for calculation of pitch per sample */
-        s->pitch_diff_sh16 =
-            ((cur_pitch_val - s->last_pitch_val) << 16) / MAX_FRAMESIZE;
-    }
-
-    /* Global gain (if silence) and pitch-adaptive window coordinates */
-    switch (frame_descs[bd_idx].fcb_type) {
-    case FCB_TYPE_SILENCE:
-        s->silence_gain = wmavoice_gain_silence[get_bits(gb, 8)];
-        break;
-    case FCB_TYPE_AW_PULSES:
-        aw_parse_coords(s, gb, pitch);
-        break;
-    }
-
-    for (n = 0; n < frame_descs[bd_idx].n_blocks; n++) {
-        int bl_pitch_sh2;
-
-        /* Pitch calculation for ACB_TYPE_HAMMING ("pitch-per-block") */
-        switch (frame_descs[bd_idx].acb_type) {
-        case ACB_TYPE_HAMMING: {
-            /* Pitch is given per block. Per-block pitches are encoded as an
-             * absolute value for the first block, and then delta values
-             * relative to this value) for all subsequent blocks. The scale of
-             * this pitch value is semi-logaritmic compared to its use in the
-             * decoder, so we convert it to normal scale also. */
-            int block_pitch,
-                t1 = (s->block_conv_table[1] - s->block_conv_table[0]) << 2,
-                t2 = (s->block_conv_table[2] - s->block_conv_table[1]) << 1,
-                t3 =  s->block_conv_table[3] - s->block_conv_table[2] + 1;
-
-            if (n == 0) {
-                block_pitch = get_bits(gb, s->block_pitch_nbits);
-            } else
-                block_pitch = last_block_pitch - s->block_delta_pitch_hrange +
-                                 get_bits(gb, s->block_delta_pitch_nbits);
-            /* Convert last_ so that any next delta is within _range */
-            last_block_pitch = av_clip(block_pitch,
-                                       s->block_delta_pitch_hrange,
-                                       s->block_pitch_range -
-                                           s->block_delta_pitch_hrange);
-
-            /* Convert semi-log-style scale back to normal scale */
-            if (block_pitch < t1) {
-                bl_pitch_sh2 = (s->block_conv_table[0] << 2) + block_pitch;
-            } else {
-                block_pitch -= t1;
-                if (block_pitch < t2) {
-                    bl_pitch_sh2 =
-                        (s->block_conv_table[1] << 2) + (block_pitch << 1);
-                } else {
-                    block_pitch -= t2;
-                    if (block_pitch < t3) {
-                        bl_pitch_sh2 =
-                            (s->block_conv_table[2] + block_pitch) << 2;
-                    } else
-                        bl_pitch_sh2 = s->block_conv_table[3] << 2;
-                }
-            }
-            pitch[n] = bl_pitch_sh2 >> 2;
-            break;
-        }
-
-        case ACB_TYPE_ASYMMETRIC: {
-            bl_pitch_sh2 = pitch[n] << 2;
-            break;
-        }
-
-        default: // ACB_TYPE_NONE has no pitch
-            bl_pitch_sh2 = 0;
-            break;
-        }
-
-        synth_block(s, gb, n, block_nsamples, bl_pitch_sh2,
-                    lsps, prev_lsps, &frame_descs[bd_idx],
-                    &excitation[n * block_nsamples],
-                    &synth[n * block_nsamples]);
-    }
-
-    /* Averaging projection filter, if applicable. Else, just copy samples
-     * from synthesis buffer */
-    if (s->do_apf) {
-        double i_lsps[MAX_LSPS];
-        float lpcs[MAX_LSPS];
-
-        for (n = 0; n < s->lsps; n++) // LSF -> LSP
-            i_lsps[n] = cos(0.5 * (prev_lsps[n] + lsps[n]));
-        ff_acelp_lspd2lpc(i_lsps, lpcs, s->lsps >> 1);
-        postfilter(s, synth, samples, 80, lpcs,
-                   &s->zero_exc_pf[s->history_nsamples + MAX_FRAMESIZE * frame_idx],
-                   frame_descs[bd_idx].fcb_type, pitch[0]);
-
-        for (n = 0; n < s->lsps; n++) // LSF -> LSP
-            i_lsps[n] = cos(lsps[n]);
-        ff_acelp_lspd2lpc(i_lsps, lpcs, s->lsps >> 1);
-        postfilter(s, &synth[80], &samples[80], 80, lpcs,
-                   &s->zero_exc_pf[s->history_nsamples + MAX_FRAMESIZE * frame_idx + 80],
-                   frame_descs[bd_idx].fcb_type, pitch[0]);
-    } else
-        memcpy(samples, synth, 160 * sizeof(synth[0]));
-
-    /* Cache values for next frame */
-    s->frame_cntr++;
-    if (s->frame_cntr >= 0xFFFF) s->frame_cntr -= 0xFFFF; // i.e. modulo (%)
-    s->last_acb_type = frame_descs[bd_idx].acb_type;
-    switch (frame_descs[bd_idx].acb_type) {
-    case ACB_TYPE_NONE:
-        s->last_pitch_val = 0;
-        break;
-    case ACB_TYPE_ASYMMETRIC:
-        s->last_pitch_val = cur_pitch_val;
-        break;
-    case ACB_TYPE_HAMMING:
-        s->last_pitch_val = pitch[frame_descs[bd_idx].n_blocks - 1];
-        break;
-    }
-
-    return 0;
-}
-
-/**
- * Ensure minimum value for first item, maximum value for last value,
- * proper spacing between each value and proper ordering.
- *
- * @param lsps array of LSPs
- * @param num size of LSP array
- *
- * @note basically a double version of #ff_acelp_reorder_lsf(), might be
- *       useful to put in a generic location later on. Parts are also
- *       present in #ff_set_min_dist_lsf() + #ff_sort_nearly_sorted_floats(),
- *       which is in float.
- */
-static void stabilize_lsps(double *lsps, int num)
-{
-    int n, m, l;
-
-    /* set minimum value for first, maximum value for last and minimum
-     * spacing between LSF values.
-     * Very similar to ff_set_min_dist_lsf(), but in double. */
-    lsps[0]       = FFMAX(lsps[0],       0.0015 * M_PI);
-    for (n = 1; n < num; n++)
-        lsps[n]   = FFMAX(lsps[n],       lsps[n - 1] + 0.0125 * M_PI);
-    lsps[num - 1] = FFMIN(lsps[num - 1], 0.9985 * M_PI);
-
-    /* reorder (looks like one-time / non-recursed bubblesort).
-     * Very similar to ff_sort_nearly_sorted_floats(), but in double. */
-    for (n = 1; n < num; n++) {
-        if (lsps[n] < lsps[n - 1]) {
-            for (m = 1; m < num; m++) {
-                double tmp = lsps[m];
-                for (l = m - 1; l >= 0; l--) {
-                    if (lsps[l] <= tmp) break;
-                    lsps[l + 1] = lsps[l];
-                }
-                lsps[l + 1] = tmp;
-            }
-            break;
-        }
-    }
-}
-
-/**
- * Test if there's enough bits to read 1 superframe.
- *
- * @param orig_gb bit I/O context used for reading. This function
- *                does not modify the state of the bitreader; it
- *                only uses it to copy the current stream position
- * @param s WMA Voice decoding context private data
- * @return < 0 on error, 1 on not enough bits or 0 if OK.
- */
-static int check_bits_for_superframe(GetBitContext *orig_gb,
-                                     WMAVoiceContext *s)
-{
-    GetBitContext s_gb, *gb = &s_gb;
-    int n, need_bits, bd_idx;
-    const struct frame_type_desc *frame_desc;
-
-    /* initialize a copy */
-    init_get_bits(gb, orig_gb->buffer, orig_gb->size_in_bits);
-    skip_bits_long(gb, get_bits_count(orig_gb));
-    assert(get_bits_left(gb) == get_bits_left(orig_gb));
-
-    /* superframe header */
-    if (get_bits_left(gb) < 14)
-        return 1;
-    if (!get_bits1(gb))
-        return AVERROR(ENOSYS);           // WMAPro-in-WMAVoice superframe
-    if (get_bits1(gb)) skip_bits(gb, 12); // number of  samples in superframe
-    if (s->has_residual_lsps) {           // residual LSPs (for all frames)
-        if (get_bits_left(gb) < s->sframe_lsp_bitsize)
-            return 1;
-        skip_bits_long(gb, s->sframe_lsp_bitsize);
-    }
-
-    /* frames */
-    for (n = 0; n < MAX_FRAMES; n++) {
-        int aw_idx_is_ext = 0;
-
-        if (!s->has_residual_lsps) {     // independent LSPs (per-frame)
-           if (get_bits_left(gb) < s->frame_lsp_bitsize) return 1;
-           skip_bits_long(gb, s->frame_lsp_bitsize);
-        }
-        bd_idx = s->vbm_tree[get_vlc2(gb, frame_type_vlc.table, 6, 3)];
-        if (bd_idx < 0)
-            return AVERROR_INVALIDDATA; // invalid frame type VLC code
-        frame_desc = &frame_descs[bd_idx];
-        if (frame_desc->acb_type == ACB_TYPE_ASYMMETRIC) {
-            if (get_bits_left(gb) < s->pitch_nbits)
-                return 1;
-            skip_bits_long(gb, s->pitch_nbits);
-        }
-        if (frame_desc->fcb_type == FCB_TYPE_SILENCE) {
-            skip_bits(gb, 8);
-        } else if (frame_desc->fcb_type == FCB_TYPE_AW_PULSES) {
-            int tmp = get_bits(gb, 6);
-            if (tmp >= 0x36) {
-                skip_bits(gb, 2);
-                aw_idx_is_ext = 1;
-            }
-        }
-
-        /* blocks */
-        if (frame_desc->acb_type == ACB_TYPE_HAMMING) {
-            need_bits = s->block_pitch_nbits +
-                (frame_desc->n_blocks - 1) * s->block_delta_pitch_nbits;
-        } else if (frame_desc->fcb_type == FCB_TYPE_AW_PULSES) {
-            need_bits = 2 * !aw_idx_is_ext;
-        } else
-            need_bits = 0;
-        need_bits += frame_desc->frame_size;
-        if (get_bits_left(gb) < need_bits)
-            return 1;
-        skip_bits_long(gb, need_bits);
-    }
-
-    return 0;
-}
-
-/**
- * Synthesize output samples for a single superframe. If we have any data
- * cached in s->sframe_cache, that will be used instead of whatever is loaded
- * in s->gb.
- *
- * WMA Voice superframes contain 3 frames, each containing 160 audio samples,
- * to give a total of 480 samples per frame. See #synth_frame() for frame
- * parsing. In addition to 3 frames, superframes can also contain the LSPs
- * (if these are globally specified for all frames (residually); they can
- * also be specified individually per-frame. See the s->has_residual_lsps
- * option), and can specify the number of samples encoded in this superframe
- * (if less than 480), usually used to prevent blanks at track boundaries.
- *
- * @param ctx WMA Voice decoder context
- * @return 0 on success, <0 on error or 1 if there was not enough data to
- *         fully parse the superframe
- */
-static int synth_superframe(AVCodecContext *ctx, AVFrame *frame,
-                            int *got_frame_ptr)
-{
-    WMAVoiceContext *s = ctx->priv_data;
-    GetBitContext *gb = &s->gb, s_gb;
-    int n, res, n_samples = 480;
-    double lsps[MAX_FRAMES][MAX_LSPS];
-    const double *mean_lsf = s->lsps == 16 ?
-        wmavoice_mean_lsf16[s->lsp_def_mode] : wmavoice_mean_lsf10[s->lsp_def_mode];
-    float excitation[MAX_SIGNAL_HISTORY + MAX_SFRAMESIZE + 12];
-    float synth[MAX_LSPS + MAX_SFRAMESIZE];
-    float *samples;
-
-    memcpy(synth,      s->synth_history,
-           s->lsps             * sizeof(*synth));
-    memcpy(excitation, s->excitation_history,
-           s->history_nsamples * sizeof(*excitation));
-
-    if (s->sframe_cache_size > 0) {
-        gb = &s_gb;
-        init_get_bits(gb, s->sframe_cache, s->sframe_cache_size);
-        s->sframe_cache_size = 0;
-    }
-
-    if ((res = check_bits_for_superframe(gb, s)) == 1) {
-        *got_frame_ptr = 0;
-        return 1;
-    } else if (res < 0)
-        return res;
-
-    /* First bit is speech/music bit, it differentiates between WMAVoice
-     * speech samples (the actual codec) and WMAVoice music samples, which
-     * are really WMAPro-in-WMAVoice-superframes. I've never seen those in
-     * the wild yet. */
-    if (!get_bits1(gb)) {
-        avpriv_request_sample(ctx, "WMAPro-in-WMAVoice");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* (optional) nr. of samples in superframe; always <= 480 and >= 0 */
-    if (get_bits1(gb)) {
-        if ((n_samples = get_bits(gb, 12)) > 480) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Superframe encodes >480 samples (%d), not allowed\n",
-                   n_samples);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    /* Parse LSPs, if global for the superframe (can also be per-frame). */
-    if (s->has_residual_lsps) {
-        double prev_lsps[MAX_LSPS], a1[MAX_LSPS * 2], a2[MAX_LSPS * 2];
-
-        for (n = 0; n < s->lsps; n++)
-            prev_lsps[n] = s->prev_lsps[n] - mean_lsf[n];
-
-        if (s->lsps == 10) {
-            dequant_lsp10r(gb, lsps[2], prev_lsps, a1, a2, s->lsp_q_mode);
-        } else /* s->lsps == 16 */
-            dequant_lsp16r(gb, lsps[2], prev_lsps, a1, a2, s->lsp_q_mode);
-
-        for (n = 0; n < s->lsps; n++) {
-            lsps[0][n]  = mean_lsf[n] + (a1[n]           - a2[n * 2]);
-            lsps[1][n]  = mean_lsf[n] + (a1[s->lsps + n] - a2[n * 2 + 1]);
-            lsps[2][n] += mean_lsf[n];
-        }
-        for (n = 0; n < 3; n++)
-            stabilize_lsps(lsps[n], s->lsps);
-    }
-
-    /* get output buffer */
-    frame->nb_samples = 480;
-    if ((res = ff_get_buffer(ctx, frame, 0)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return res;
-    }
-    frame->nb_samples = n_samples;
-    samples = (float *)frame->data[0];
-
-    /* Parse frames, optionally preceded by per-frame (independent) LSPs. */
-    for (n = 0; n < 3; n++) {
-        if (!s->has_residual_lsps) {
-            int m;
-
-            if (s->lsps == 10) {
-                dequant_lsp10i(gb, lsps[n]);
-            } else /* s->lsps == 16 */
-                dequant_lsp16i(gb, lsps[n]);
-
-            for (m = 0; m < s->lsps; m++)
-                lsps[n][m] += mean_lsf[m];
-            stabilize_lsps(lsps[n], s->lsps);
-        }
-
-        if ((res = synth_frame(ctx, gb, n,
-                               &samples[n * MAX_FRAMESIZE],
-                               lsps[n], n == 0 ? s->prev_lsps : lsps[n - 1],
-                               &excitation[s->history_nsamples + n * MAX_FRAMESIZE],
-                               &synth[s->lsps + n * MAX_FRAMESIZE]))) {
-            *got_frame_ptr = 0;
-            return res;
-        }
-    }
-
-    /* Statistics? FIXME - we don't check for length, a slight overrun
-     * will be caught by internal buffer padding, and anything else
-     * will be skipped, not read. */
-    if (get_bits1(gb)) {
-        res = get_bits(gb, 4);
-        skip_bits(gb, 10 * (res + 1));
-    }
-
-    *got_frame_ptr = 1;
-
-    /* Update history */
-    memcpy(s->prev_lsps,           lsps[2],
-           s->lsps             * sizeof(*s->prev_lsps));
-    memcpy(s->synth_history,      &synth[MAX_SFRAMESIZE],
-           s->lsps             * sizeof(*synth));
-    memcpy(s->excitation_history, &excitation[MAX_SFRAMESIZE],
-           s->history_nsamples * sizeof(*excitation));
-    if (s->do_apf)
-        memmove(s->zero_exc_pf,       &s->zero_exc_pf[MAX_SFRAMESIZE],
-                s->history_nsamples * sizeof(*s->zero_exc_pf));
-
-    return 0;
-}
-
-/**
- * Parse the packet header at the start of each packet (input data to this
- * decoder).
- *
- * @param s WMA Voice decoding context private data
- * @return 1 if not enough bits were available, or 0 on success.
- */
-static int parse_packet_header(WMAVoiceContext *s)
-{
-    GetBitContext *gb = &s->gb;
-    unsigned int res;
-
-    if (get_bits_left(gb) < 11)
-        return 1;
-    skip_bits(gb, 4);          // packet sequence number
-    s->has_residual_lsps = get_bits1(gb);
-    do {
-        res = get_bits(gb, 6); // number of superframes per packet
-                               // (minus first one if there is spillover)
-        if (get_bits_left(gb) < 6 * (res == 0x3F) + s->spillover_bitsize)
-            return 1;
-    } while (res == 0x3F);
-    s->spillover_nbits   = get_bits(gb, s->spillover_bitsize);
-
-    return 0;
-}
-
-/**
- * Copy (unaligned) bits from gb/data/size to pb.
- *
- * @param pb target buffer to copy bits into
- * @param data source buffer to copy bits from
- * @param size size of the source data, in bytes
- * @param gb bit I/O context specifying the current position in the source.
- *           data. This function might use this to align the bit position to
- *           a whole-byte boundary before calling #avpriv_copy_bits() on aligned
- *           source data
- * @param nbits the amount of bits to copy from source to target
- *
- * @note after calling this function, the current position in the input bit
- *       I/O context is undefined.
- */
-static void copy_bits(PutBitContext *pb,
-                      const uint8_t *data, int size,
-                      GetBitContext *gb, int nbits)
-{
-    int rmn_bytes, rmn_bits;
-
-    rmn_bits = rmn_bytes = get_bits_left(gb);
-    if (rmn_bits < nbits)
-        return;
-    if (nbits > pb->size_in_bits - put_bits_count(pb))
-        return;
-    rmn_bits &= 7; rmn_bytes >>= 3;
-    if ((rmn_bits = FFMIN(rmn_bits, nbits)) > 0)
-        put_bits(pb, rmn_bits, get_bits(gb, rmn_bits));
-    avpriv_copy_bits(pb, data + size - rmn_bytes,
-                 FFMIN(nbits - rmn_bits, rmn_bytes << 3));
-}
-
-/**
- * Packet decoding: a packet is anything that the (ASF) demuxer contains,
- * and we expect that the demuxer / application provides it to us as such
- * (else you'll probably get garbage as output). Every packet has a size of
- * ctx->block_align bytes, starts with a packet header (see
- * #parse_packet_header()), and then a series of superframes. Superframe
- * boundaries may exceed packets, i.e. superframes can split data over
- * multiple (two) packets.
- *
- * For more information about frames, see #synth_superframe().
- */
-static int wmavoice_decode_packet(AVCodecContext *ctx, void *data,
-                                  int *got_frame_ptr, AVPacket *avpkt)
-{
-    WMAVoiceContext *s = ctx->priv_data;
-    GetBitContext *gb = &s->gb;
-    int size, res, pos;
-
-    /* Packets are sometimes a multiple of ctx->block_align, with a packet
-     * header at each ctx->block_align bytes. However, Libav's ASF demuxer
-     * feeds us ASF packets, which may concatenate multiple "codec" packets
-     * in a single "muxer" packet, so we artificially emulate that by
-     * capping the packet size at ctx->block_align. */
-    for (size = avpkt->size; size > ctx->block_align; size -= ctx->block_align);
-    if (!size) {
-        *got_frame_ptr = 0;
-        return 0;
-    }
-    init_get_bits(&s->gb, avpkt->data, size << 3);
-
-    /* size == ctx->block_align is used to indicate whether we are dealing with
-     * a new packet or a packet of which we already read the packet header
-     * previously. */
-    if (size == ctx->block_align) { // new packet header
-        if ((res = parse_packet_header(s)) < 0)
-            return res;
-
-        /* If the packet header specifies a s->spillover_nbits, then we want
-         * to push out all data of the previous packet (+ spillover) before
-         * continuing to parse new superframes in the current packet. */
-        if (s->spillover_nbits > 0) {
-            if (s->sframe_cache_size > 0) {
-                int cnt = get_bits_count(gb);
-                copy_bits(&s->pb, avpkt->data, size, gb, s->spillover_nbits);
-                flush_put_bits(&s->pb);
-                s->sframe_cache_size += s->spillover_nbits;
-                if ((res = synth_superframe(ctx, data, got_frame_ptr)) == 0 &&
-                    *got_frame_ptr) {
-                    cnt += s->spillover_nbits;
-                    s->skip_bits_next = cnt & 7;
-                    return cnt >> 3;
-                } else
-                    skip_bits_long (gb, s->spillover_nbits - cnt +
-                                    get_bits_count(gb)); // resync
-            } else
-                skip_bits_long(gb, s->spillover_nbits);  // resync
-        }
-    } else if (s->skip_bits_next)
-        skip_bits(gb, s->skip_bits_next);
-
-    /* Try parsing superframes in current packet */
-    s->sframe_cache_size = 0;
-    s->skip_bits_next = 0;
-    pos = get_bits_left(gb);
-    if ((res = synth_superframe(ctx, data, got_frame_ptr)) < 0) {
-        return res;
-    } else if (*got_frame_ptr) {
-        int cnt = get_bits_count(gb);
-        s->skip_bits_next = cnt & 7;
-        return cnt >> 3;
-    } else if ((s->sframe_cache_size = pos) > 0) {
-        /* rewind bit reader to start of last (incomplete) superframe... */
-        init_get_bits(gb, avpkt->data, size << 3);
-        skip_bits_long(gb, (size << 3) - pos);
-        assert(get_bits_left(gb) == pos);
-
-        /* ...and cache it for spillover in next packet */
-        init_put_bits(&s->pb, s->sframe_cache, SFRAME_CACHE_MAXSIZE);
-        copy_bits(&s->pb, avpkt->data, size, gb, s->sframe_cache_size);
-        // FIXME bad - just copy bytes as whole and add use the
-        // skip_bits_next field
-    }
-
-    return size;
-}
-
-static av_cold int wmavoice_decode_end(AVCodecContext *ctx)
-{
-    WMAVoiceContext *s = ctx->priv_data;
-
-    if (s->do_apf) {
-        ff_rdft_end(&s->rdft);
-        ff_rdft_end(&s->irdft);
-        ff_dct_end(&s->dct);
-        ff_dct_end(&s->dst);
-    }
-
-    return 0;
-}
-
-static av_cold void wmavoice_flush(AVCodecContext *ctx)
-{
-    WMAVoiceContext *s = ctx->priv_data;
-    int n;
-
-    s->postfilter_agc    = 0;
-    s->sframe_cache_size = 0;
-    s->skip_bits_next    = 0;
-    for (n = 0; n < s->lsps; n++)
-        s->prev_lsps[n] = M_PI * (n + 1.0) / (s->lsps + 1.0);
-    memset(s->excitation_history, 0,
-           sizeof(*s->excitation_history) * MAX_SIGNAL_HISTORY);
-    memset(s->synth_history,      0,
-           sizeof(*s->synth_history)      * MAX_LSPS);
-    memset(s->gain_pred_err,      0,
-           sizeof(s->gain_pred_err));
-
-    if (s->do_apf) {
-        memset(&s->synth_filter_out_buf[MAX_LSPS_ALIGN16 - s->lsps], 0,
-               sizeof(*s->synth_filter_out_buf) * s->lsps);
-        memset(s->dcf_mem,              0,
-               sizeof(*s->dcf_mem)              * 2);
-        memset(s->zero_exc_pf,          0,
-               sizeof(*s->zero_exc_pf)          * s->history_nsamples);
-        memset(s->denoise_filter_cache, 0, sizeof(s->denoise_filter_cache));
-    }
-}
-
-AVCodec ff_wmavoice_decoder = {
-    .name             = "wmavoice",
-    .long_name        = NULL_IF_CONFIG_SMALL("Windows Media Audio Voice"),
-    .type             = AVMEDIA_TYPE_AUDIO,
-    .id               = AV_CODEC_ID_WMAVOICE,
-    .priv_data_size   = sizeof(WMAVoiceContext),
-    .init             = wmavoice_decode_init,
-    .init_static_data = wmavoice_init_static_data,
-    .close            = wmavoice_decode_end,
-    .decode           = wmavoice_decode_packet,
-    .capabilities     = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
-    .flush            = wmavoice_flush,
-};
diff --git a/deps/libav/libavcodec/wmavoice_data.h b/deps/libav/libavcodec/wmavoice_data.h
deleted file mode 100644
index 7f14fb8..0000000
--- a/deps/libav/libavcodec/wmavoice_data.h
+++ /dev/null
@@ -1,3259 +0,0 @@
-/*
- * Windows Media Voice (WMAVoice) tables.
- * Copyright (c) 2009 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Windows Media Voice (WMAVoice) tables
- * @author Ronald S. Bultje <rsbultje at gmail.com>
- */
-
-#ifndef AVCODEC_WMAVOICE_DATA_H
-#define AVCODEC_WMAVOICE_DATA_H
-
-#include <stdint.h>
-
-static const uint8_t wmavoice_dq_lsp10i[0xf00] = {
-    125, 109,  84,  55,  34,  51, 109, 112, 118, 132,
-    122, 102,  78,  80, 132, 119, 132, 132, 125, 131,
-    109,  91, 131, 131, 136, 136, 137, 137, 140, 145,
-    140, 143, 117, 136, 122, 106, 109,  91, 115, 119,
-    133, 117, 103,  80,  55, 117, 123, 102,  93,  80,
-    139, 116,  70,  39,  95,  89, 103, 113, 112, 122,
-    135, 244, 229, 215, 199, 181, 163, 150, 146, 144,
-    143, 173, 171, 154, 155, 154, 151, 148, 145, 143,
-    132, 138, 116,  85, 117,  94, 108, 117, 107, 116,
-    132, 118, 123, 119,  88,  67,  49,  95,  84,  95,
-    121, 103,  74,  70, 179, 164, 141, 126, 107, 112,
-    119,  95, 103, 149, 139, 148, 144, 147, 148, 141,
-    151, 133, 142, 129, 111, 131, 108, 128, 122, 108,
-    121,  96, 115, 138, 116,  93, 105, 115, 115, 123,
-    129, 106, 136, 180, 147, 130, 108, 141, 131, 118,
-    136, 155, 176, 156, 135, 129, 140, 146, 142, 134,
-    141, 130, 109,  80,  52,  38,  18,  47, 118, 134,
-    155, 141, 100,  78,  72,  89,  79,  96,  92,  98,
-    133, 111,  83,  91,  72,  58, 105, 115, 112, 120,
-    145, 127, 135, 113, 113, 105, 105,  85,  69,  61,
-    115,  96, 116, 145, 159, 170, 175, 175, 168, 155,
-    140, 120,  84,  52,  80, 145, 125, 127, 116, 126,
-    128, 108, 101, 198, 227, 200, 178, 159, 147, 148,
-    121,  88,  46, 109, 124, 126, 126, 137, 147, 147,
-    129, 107, 164, 148, 127, 117, 134, 120, 111, 116,
-    120, 103,  98,  73,  66,  61,  70, 115, 116, 125,
-    126, 100,  77, 188, 162, 140, 114, 128, 139, 123,
-    145, 165, 164, 134, 109, 100, 108, 118, 127, 130,
-    156, 182, 190, 173, 167, 165, 162, 157, 152, 147,
-    150, 164, 179, 183, 173, 155, 140, 136, 134, 135,
-    122,  92,  69, 140, 132, 118, 108, 128, 138, 132,
-    123, 127, 148, 137, 150, 149, 139, 127, 124, 130,
-    136, 138, 112,  70,  41,  37, 132, 140, 129, 125,
-    130, 111,  78,  33,  51, 161, 141, 136, 120, 122,
-    126, 110,  87, 106,  85,  68,  48,  81, 112, 113,
-    135, 125,  98,  85, 102,  80, 100,  87,  86, 116,
-    142, 133, 110,  66,  48, 152, 139, 135, 136, 123,
-    128, 116,  89, 102, 128,  99,  83,  61, 105, 124,
-    120,  94,  73,  83,  78, 100, 122, 124, 128, 132,
-    144, 137, 116, 102,  75, 144, 136, 127, 140, 127,
-    154, 144, 118,  99,  90,  90,  89,  75,  68,  83,
-    123, 103,  89, 198, 180, 154, 138, 122, 136, 120,
-    138, 118, 121, 136, 110, 105,  85, 111, 101, 104,
-    121, 126, 139, 115,  99, 101, 107, 110, 123, 126,
-    127, 115,  88, 109, 164, 134, 138, 138, 120, 121,
-    130, 202, 195, 202, 199, 201, 181, 164, 159, 148,
-    120, 116, 194, 199, 186, 171, 154, 142, 137, 133,
-    137, 129, 112, 149, 134, 112, 149, 138, 120, 134,
-    119, 102, 107,  83,  79, 114, 119, 127, 128, 128,
-    144, 148, 165, 155, 161, 150, 135, 122, 116, 115,
-    120,  99,  80, 120, 123, 124, 111,  89,  70, 108,
-    118,  95,  66,  53, 105, 126, 125, 105,  83, 111,
-    129, 197, 191, 197, 206, 213, 216, 208, 196, 169,
-    133, 109, 127, 164, 134, 121,  99,  92,  82,  71,
-    131, 121,  93,  91, 136, 105, 115, 140, 120, 110,
-    150, 164, 139, 108,  87,  81,  93,  92, 104, 116,
-    133, 114, 125, 126, 111, 136, 110, 156, 147, 133,
-    113,  94, 118, 120, 115, 125, 124, 126, 127, 134,
-    116, 131, 161, 158, 166, 157, 150, 150, 144, 141,
-    125, 185, 169, 142, 140, 143, 139, 131, 134, 138,
-    179, 188, 170, 150, 134, 140, 144, 133, 127, 127,
-    150, 177, 204, 184, 192, 194, 190, 193, 177, 158,
-    114, 113, 138, 116, 137, 135, 132, 131, 127, 134,
-    120, 147, 163, 135, 133, 137, 136, 136, 133, 135,
-    137, 120,  95,  73,  46,  48, 111,  97,  97, 123,
-    139, 130, 109,  76,  52,  72,  61,  61, 125, 127,
-    132, 119, 119,  90,  66,  41,  64, 156, 143, 129,
-    131, 106,  58,  25,  99, 115, 122, 136, 129, 132,
-    134, 123,  97,  53,  27, 114, 125, 114, 120, 123,
-    122, 107,  93,  57,  47, 133, 128, 138, 141, 131,
-    145, 132, 122, 110,  79,  57,  30,  73, 153, 144,
-    150, 132,  85,  59, 133, 125, 130, 115, 100,  96,
-    148, 127, 111,  86,  61,  38, 110, 121, 108,  99,
-    157, 143, 105,  77, 116, 118, 115, 131, 122, 122,
-    133, 119, 134, 108,  86,  61, 129, 165, 143, 127,
-    125, 105,  89, 111,  97,  85, 113,  99,  98, 117,
-    149, 131, 101, 106,  88,  95,  79, 119, 123, 120,
-    125, 109,  81, 100, 201, 183, 156, 138, 115, 116,
-    141, 119, 129, 105,  76,  60, 110,  99,  92,  82,
-    150, 156, 129,  95,  69, 115, 115, 113, 134, 125,
-    118,  97,  67,  96, 203, 197, 171, 151, 133, 125,
-    143, 131, 120, 134, 105,  80,  51,  60, 139, 134,
-    129, 160, 223, 219, 219, 212, 197, 173, 157, 146,
-    132, 112, 164, 144, 119, 102,  92,  76,  73,  94,
-    132, 112, 124, 114,  93,  92,  83,  73,  69,  99,
-    129, 103, 188, 163, 142, 132, 127, 101,  82,  59,
-    140, 141, 111,  74,  46, 105, 113,  99, 127, 122,
-    125,  94,  63, 112, 116, 101,  81, 120, 136, 134,
-    133, 190, 224, 193, 179, 158, 146, 143, 140, 136,
-    152, 161, 132, 120, 112,  94, 114, 102,  92, 116,
-    129, 194, 196, 202, 211, 212, 210, 190, 169, 152,
-    166, 166, 145, 111,  91, 132, 133, 128, 136, 130,
-    118,  94,  72,  74,  92,  86,  89,  92, 106, 123,
-    126, 100,  86, 137, 117,  92,  76, 104, 106, 114,
-    133, 109, 204, 192, 166, 148, 138, 128, 111,  81,
-    118,  99,  79, 146, 169, 141, 123, 102, 131, 120,
-    127, 105, 136, 204, 170, 154, 131, 145, 135, 119,
-    117,  95,  64,  83, 141, 136, 118,  96,  99, 126,
-    115,  93,  98, 102,  95, 105, 106, 114, 119, 128,
-    131, 121,  98, 139, 149, 119, 109,  86, 105, 129,
-    134, 119, 104, 169, 185, 155, 141, 122, 107, 127,
-    136, 115,  85, 108,  87, 126, 102, 128, 136, 129,
-    125,  99, 126, 158, 133, 139, 132, 113,  91, 107,
-    141, 122, 128, 161, 130, 127, 105, 120, 118, 106,
-    122, 140, 161, 168, 187, 184, 176, 158, 144, 140,
-    127, 111,  89, 130, 132, 105, 134, 121, 100, 122,
-    129, 110, 128, 115, 129, 116, 132, 118, 114, 119,
-    138, 133, 132, 188, 183, 159, 161, 147, 134, 140,
-    132, 113,  84, 167, 147, 132, 124, 109, 133, 121,
-    132, 128, 116, 121,  98, 101, 145, 129, 128, 129,
-    124, 112, 152, 158, 136, 161, 139, 165, 158, 142,
-    139, 138, 110, 127, 148, 117, 126, 118, 101, 116,
-    155, 168, 154, 128, 120, 152, 150, 141, 140, 135,
-    127, 111, 109, 134, 104, 133, 110, 112, 132, 114,
-    111,  87,  68,  89, 107, 121, 121, 126, 126, 129,
-    120, 148, 169, 163, 173, 178, 185, 188, 178, 163,
-    122,  97,  86, 117, 101, 138, 118, 142, 155, 139,
-    125, 114, 131, 138, 153, 149, 163, 150, 143, 141,
-    157, 161, 138, 152, 134, 121, 122, 109, 110, 124,
-    151, 171, 196, 168, 145, 139, 147, 151, 146, 139,
-    134, 169, 179, 170, 175, 178, 177, 173, 165, 154,
-    120, 151, 118, 107, 125, 129, 133, 133, 136, 139,
-    119, 141, 159, 151, 160, 165, 168, 169, 162, 152,
-    115, 111, 119,  94, 117, 121, 127, 127, 132, 136,
-    134, 153, 147, 142, 142, 147, 159, 159, 154, 147,
-    110, 106, 139, 135, 143, 142, 147, 146, 147, 147,
-    115, 133, 151, 133, 141, 142, 151, 152, 147, 144,
-    115, 132, 144, 131, 125, 126, 128, 130, 131, 136,
-    138, 118,  96,  71,  48,  26,  43, 130, 125, 125,
-    134, 122,  98,  54,  28,  84,  77,  73, 109, 125,
-    133, 112,  67,  48, 141, 129, 126, 113, 112, 118,
-    143, 123,  89,  54,  71,  73,  75, 131, 123, 123,
-    126, 109,  81,  31,  15,  94, 110, 109, 119, 128,
-    132, 122,  97,  92,  73,  50,  27,  22, 104, 133,
-    133, 119,  94,  48,  34, 168, 160, 154, 151, 130,
-    147, 133,  90,  54,  71, 123, 106, 105,  93, 117,
-    143, 132, 107,  69,  45,  78, 178, 169, 150, 139,
-    138, 123, 116,  96,  69,  49,  32, 113, 103, 112,
-    154, 151, 125,  79,  60, 152, 160, 154, 155, 137,
-    142, 151, 124,  88,  66,  59,  94,  87,  95, 119,
-    166, 154, 122,  92, 138, 132, 124, 114,  97,  97,
-    122,  99,  98, 219, 191, 176, 165, 159, 153, 131,
-    130, 119,  91,  51,  24,  41, 144, 156, 147, 139,
-    139, 122,  81,  65, 124, 111, 104,  90,  94,  98,
-    138, 120, 112,  91,  63,  65,  89,  75,  78, 106,
-    126, 107,  91,  85,  69,  95,  90,  84, 108, 120,
-    155, 139, 100,  78, 120, 110, 109,  91,  77,  73,
-    144, 130, 135, 112,  88,  65,  62, 142, 129, 126,
-    170, 154, 150, 131, 121, 116, 100,  92,  83,  86,
-    131, 122,  98, 107, 102,  75,  54,  38, 117, 130,
-    146, 139, 117, 107,  86,  66,  44,  30,  97, 128,
-    129, 116, 100,  59, 108, 127, 119, 139, 129, 129,
-    124, 106,  79,  49, 154, 190, 166, 152, 133, 123,
-    141, 149, 123,  89,  61,  70, 143, 132, 125, 126,
-    136, 113, 177, 166, 141, 123, 109, 108, 105,  93,
-    137, 117, 147, 123,  99,  85, 109,  98,  91,  75,
-    129, 121, 102,  78,  53,  90, 149, 136, 134, 135,
-    144, 136, 126,  90, 114, 152, 137, 152, 138, 128,
-    133, 115, 107, 129,  99,  78,  60, 129, 125, 118,
-    147, 141, 119, 124, 110,  91,  79,  64, 106, 117,
-    134, 111, 164, 143, 123, 113, 116,  95,  76,  56,
-    147, 159, 140, 109,  83,  84, 140, 135, 127, 129,
-    123, 104, 116,  99,  91,  87,  80, 110, 113, 121,
-    124, 106, 174, 174, 152, 141, 132, 134, 126, 124,
-    140, 190, 240, 215, 212, 189, 173, 158, 144, 137,
-    123,  97,  79, 102, 110, 111,  90,  75, 126, 124,
-    134, 121, 104, 145, 127, 100,  77,  65, 120, 118,
-    123, 106,  87,  41,  68, 119, 106, 115, 109, 119,
-    137, 232, 241, 225, 217, 202, 183, 169, 156, 145,
-    161, 146, 127, 110,  97, 107,  88, 114, 108, 106,
-    141, 244, 216, 192, 172, 163, 148, 143, 144, 144,
-    128, 127, 109,  89,  77,  68, 124, 120, 121, 125,
-    125,  94,  48,  71, 116, 113, 104, 120, 142, 137,
-    133, 129, 115,  82,  68, 120,  99, 133, 134, 124,
-    130, 106, 108, 160, 130, 111,  89, 129, 124, 119,
-    134, 120, 149, 143, 116,  95,  87, 142, 132, 122,
-    126, 114, 108, 107,  80, 141, 133, 123, 137, 124,
-    117,  95,  69,  43,  62,  98, 114, 116, 112, 120,
-    122,  99,  87, 164, 145, 123,  99,  95, 118, 105,
-    126, 101, 102, 120, 113, 110,  92, 139, 134, 126,
-    148, 194, 241, 219, 221, 215, 200, 193, 174, 151,
-    127, 104, 122, 136, 113, 106, 110,  95,  78, 106,
-    131, 163, 217, 199, 194, 175, 164, 155, 142, 138,
-    139, 124,  88,  57, 161, 161, 145, 139, 124, 116,
-    127, 110,  91,  98, 126, 104, 113,  98,  94,  94,
-    145, 138, 114,  90,  75, 130, 117, 107,  99,  90,
-    119,  98,  86, 101, 148, 133, 103,  83, 124, 131,
-    143, 168, 169, 133, 110, 117, 139, 149, 147, 137,
-    124, 106,  80, 138, 194, 163, 142, 119, 106, 130,
-    136, 125, 105, 114,  87, 113, 101,  89, 108, 102,
-    114,  90,  53,  46, 105, 116, 126, 122, 118, 122,
-    124, 102,  92, 195, 167, 160, 144, 154, 154, 132,
-    118,  97,  88,  72,  98, 120, 112,  98,  79, 117,
-    114, 107, 185, 191, 191, 188, 175, 165, 153, 143,
-    119,  97,  90,  89, 120, 151, 136, 113,  99, 112,
-    141, 121, 144, 122, 125, 113, 133, 111,  92,  69,
-    120,  98,  78, 109, 151, 145, 157, 157, 151, 143,
-    130, 110, 120, 188, 159, 141, 119, 112, 109,  98,
-    126, 112,  83, 110, 169, 139, 127, 105,  93, 123,
-    141, 145, 117, 106,  91,  78, 123, 107, 101, 125,
-    117,  95,  71, 147, 176, 153, 148, 133, 135, 127,
-    124, 106,  79,  64, 115,  96, 108, 115, 106, 105,
-    127, 115,  90,  98, 105,  81, 144, 135, 117, 125,
-    126, 104,  98, 165, 138, 136, 112, 149, 148, 131,
-    119, 144, 186, 185, 204, 202, 209, 200, 182, 161,
-    123, 153, 190, 189, 199, 194, 191, 176, 157, 147,
-    121, 103, 119,  98, 100, 120, 106,  97,  95, 126,
-    137, 130, 102, 117, 117,  92, 126, 114, 101, 118,
-    131, 219, 190, 167, 153, 151, 144, 140, 142, 143,
-    114, 102, 151, 152, 132, 120, 112, 120, 127, 131,
-    138, 122,  91, 143, 118, 120, 114, 104, 124, 117,
-    148, 142, 117, 126,  97, 125, 108, 116, 142, 125,
-    126, 106,  91, 169, 208, 178, 158, 138, 127, 135,
-    133, 126, 101,  83, 147, 130, 125, 117, 114, 117,
-    120, 103,  94, 149, 136, 129, 139, 118, 133, 133,
-    147, 152, 126, 132, 119,  97, 132, 129, 114, 126,
-    112, 107, 148, 125, 112, 114, 124, 125, 129, 135,
-    139, 121, 157, 151, 131, 140, 118, 147, 136, 121,
-    115, 105, 159, 167, 185, 191, 196, 190, 176, 160,
-    124, 106, 104, 122, 130, 114, 152, 144, 134, 136,
-    136, 152, 159, 153, 131, 114, 116, 126, 129, 129,
-    124, 109,  87, 131, 107, 115, 130, 107, 144, 131,
-    126, 162, 176, 175, 180, 176, 160, 141, 134, 134,
-    136, 127, 108, 161, 162, 133, 141, 124, 112, 128,
-    130, 115, 110, 140, 107, 155, 134, 131, 156, 137,
-    122, 106, 116, 127, 118, 161, 150, 170, 167, 152,
-    139, 177, 203, 176, 155, 139, 130, 128, 129, 132,
-    137, 119, 125, 103, 110, 123, 107, 120, 108, 101,
-    113, 107, 160, 154, 160, 166, 169, 176, 168, 156,
-    115,  90,  65, 115, 115, 104, 120, 112, 109, 124,
-    131, 123, 100, 109, 185, 158, 141, 132, 116, 119,
-    139, 130, 119, 156, 124, 138, 127, 116, 141, 128,
-    133, 118, 115, 180, 149, 151, 135, 130, 147, 129,
-    117,  90,  80, 119, 124, 128, 132, 130, 128, 135,
-    112,  97, 142, 161, 167, 165, 154, 142, 136, 135,
-    118, 141, 193, 172, 157, 152, 148, 145, 146, 141,
-    125, 147, 165, 166, 149, 133, 123, 122, 128, 131,
-    128, 193, 177, 174, 182, 186, 197, 193, 191, 173,
-    124, 144, 162, 133, 113, 113, 123, 128, 129, 130,
-    117,  98, 121, 122, 137, 132, 110,  97, 111, 130,
-    128, 176, 151, 125, 126, 134, 130, 121, 127, 130,
-    122, 151, 142, 111, 106, 121, 126, 126, 130, 134,
-    148, 167, 186, 153, 129, 122, 124, 128, 130, 128,
-    148, 172, 206, 178, 171, 182, 169, 180, 172, 156,
-    133, 164, 174, 160, 155, 163, 163, 172, 169, 158,
-    132, 150, 147, 142, 152, 140, 140, 140, 134, 135,
-    137, 158, 167, 172, 163, 153, 169, 158, 146, 147,
-    150, 161, 162, 172, 153, 133, 140, 144, 136, 135,
-    109,  84, 101, 120, 129, 134, 133, 136, 137, 143,
-    112, 114, 157, 147, 141, 136, 135, 133, 135, 138,
-    121, 154, 161, 150, 149, 154, 151, 144, 146, 144,
-    111, 117, 125, 125, 130, 131, 135, 137, 143, 148,
-    121, 141, 146, 131, 138, 126, 118, 111, 119, 130,
-    120, 135, 145, 121, 140, 134, 138, 137, 131, 134,
-    115, 137, 132, 137, 139, 138, 138, 139, 145, 149,
-    131, 149, 147, 133, 132, 126, 131, 134, 130, 133,
-    110,  98,  84, 141, 107, 169, 169, 123, 125, 126,
-    118, 210,  98, 126, 132, 138, 128, 139, 156, 157,
-    140, 142, 129,  95, 192, 178, 182, 186, 183, 159,
-    135, 134, 144, 124, 100, 228, 203, 161, 122, 104,
-    139, 159, 134, 161, 121, 126, 192, 152, 218, 180,
-    132, 132, 119,  99,  96,  97,  80,  53, 134, 143,
-    102, 114, 133, 114, 127,  83,  77, 126,  85, 107,
-    110, 114, 194, 186, 139, 116, 147, 104, 129, 138,
-    126, 133, 109, 144, 115,  45, 130,  97, 159, 155,
-    157, 162, 189, 185, 168, 163, 151, 151, 142, 135,
-    144, 147, 120,  74, 192, 186, 149, 118,  71,  84,
-    143, 156, 133, 178, 168, 107, 119, 149, 105, 112,
-    182, 184, 158, 118, 118, 148, 128, 177, 171, 152,
-    139, 135, 126, 209, 171, 150, 123, 100, 190, 158,
-    166,  97, 136, 123, 136, 139, 128, 138, 126, 121,
-    132, 131, 128,  95,  60, 168, 127, 140, 208, 161,
-    109, 102, 119, 162, 150, 137, 107, 200, 156, 136,
-    136, 128, 103,  95,  74,  91, 220, 173, 152, 138,
-    139, 129, 140, 136, 122,  82, 180, 115,  53,  90,
-    121, 107,  99, 148, 116, 139, 100,  63, 191, 155,
-    130, 129, 163, 155,  98, 175,  95, 151, 127, 107,
-    124, 124, 116,  88,  71, 164, 148,  96,  57,  89,
-    125, 117,  77,  63, 162, 144, 113, 109, 137, 134,
-    134, 130, 149, 174, 158, 158, 130,  81,  28,  67,
-    142, 139, 129, 100, 194, 134,  68, 175, 131, 103,
-    136, 132, 122,  96, 119,  82, 115, 249, 215, 168,
-    125, 139, 199,  96, 146, 123, 136, 179, 142, 137,
-    181, 166, 106,  86, 122, 106, 123, 131, 106, 119,
-    129, 189, 188, 147, 126, 110, 101, 114, 147, 136,
-    132, 106,  72, 175, 148,  99, 130, 153, 125, 136,
-    123, 119, 147, 170, 157, 126, 209, 188, 158, 152,
-    101,  89, 142, 131, 161, 150, 148, 124,  89, 119,
-    141, 137, 131, 103,  81,  85,  64, 175, 129, 121,
-    137, 144, 142, 145, 119, 205, 148,  80, 165, 138,
-    143, 137, 167, 165, 148, 149, 110, 234, 217, 170,
-    167, 152,  75, 140, 155, 155, 175, 129, 136, 134,
-    136, 152, 161, 131, 140, 121,  91,  79, 255, 209,
-    132, 147, 120, 114, 177, 128, 110,  61,  89, 131,
-    125, 127,  93,  87, 167, 115, 186, 162, 107, 106,
-    134, 162, 151, 100,  79,  67, 151, 116, 130, 142,
-    162, 153, 155, 143, 122,  85, 202, 187, 135, 125,
-    158, 155, 103, 129,  74, 149, 130,  98, 129, 126,
-    148, 152, 153, 133, 118,  94,  80,  70,  47,  90,
-    124, 118, 143, 184, 158, 126,  70,  82, 111, 113,
-    126, 135, 175, 141, 203, 166, 123, 123, 134, 133,
-    113, 111, 128,  76, 128, 177, 151, 178, 134, 125,
-    120, 120, 193, 106,  98, 134, 101,  86, 101, 114,
-    136, 127, 134, 196,  86, 105, 145, 128, 119, 137,
-    138, 126, 230, 161, 141, 128, 129, 136,  88,  83,
-    103, 118, 178, 123,  89, 101, 161, 173, 165, 147,
-    130, 123, 171, 158, 131,  81,  50, 177, 162, 136,
-    125, 115,  82, 173, 195, 168, 130, 112, 112, 121,
-    152, 148, 167,  87,  82, 161, 142, 147,  98,  89,
-    168, 138,  97, 157, 132, 114,  74, 126, 161, 141,
-    135, 123,  68, 137, 124, 118, 112,  92,  65,  96,
-    191, 181, 161, 151, 141, 145, 129, 102,  97, 111,
-    144, 128,  55, 128, 115, 155, 129, 184, 167, 147,
-    131, 141, 125,  33, 127, 111, 127, 131, 125, 130,
-    137, 130, 121, 195, 172, 177, 176, 149,  98,  97,
-    126, 106, 168, 159, 144, 185, 156, 151, 182, 158,
-    123,  93, 110, 116,  98,  99, 125, 136, 139, 148,
-     79, 112, 149, 128, 147, 136, 118, 105, 166, 152,
-    117, 115,  92, 128, 148, 132, 170, 143, 226, 190,
-    122, 192, 165, 121, 143, 144, 174, 124, 113, 124,
-    122, 135,  34,  93, 118, 111, 111, 136, 123, 116,
-     99, 195, 139,  99, 114, 102,  96, 108, 111, 112,
-    113, 129, 172, 137, 105, 139, 154,  86, 113, 108,
-    132,  79,  63, 120,  93, 162,  90, 103,  94,  95,
-    117, 127, 104, 100, 142, 129,  93,  27, 196, 153,
-    113,  91, 101,  90,  84,  68, 138,  38, 118, 148,
-     87, 103, 125, 109,  96, 152, 100,  56,  31,  62,
-    176, 129, 124, 115, 103,  92, 100, 121, 130, 125,
-    128,  71,  82,  71, 152,  85, 107, 116, 138, 133,
-    103, 116, 139, 144,  72,  37, 118, 141, 109,  95,
-     86,  92, 121, 167, 156, 104,  92,  91, 122, 114,
-     89,  61, 172, 128,  95, 103,  84, 101,  88,  84,
-    116, 125, 108,  62,  74, 108, 160, 143, 189, 164,
-     91, 115, 144,  43, 116,  79, 106, 108,  74,  83,
-     87,  90,  61,  71,  76,  76,  95, 130,  89,  94,
-    114, 107, 101, 145, 161, 147, 143, 163, 147, 129,
-    101,  73, 111, 108,  93, 104, 186, 141,  99,  89,
-    112, 126, 111, 113, 152,  41, 159, 115, 131, 124,
-    117, 101, 115, 130, 124,  87,  59, 177,  63,  85,
-    109, 116, 103,  68, 145, 132,  29, 119,  96,  89,
-    117,  90, 181, 103, 101, 111,  97,  96, 199, 171,
-    113, 120,  93, 119, 101,  64,  56,  55,  63,  90,
-    105, 101,  86,  45, 136, 179, 142, 102, 115, 114,
-    113, 108, 121,  84,  23, 125,  76, 102, 119, 107,
-    120, 104,  73, 177,  83, 114, 128,  85, 152, 126,
-    137, 115, 149, 109, 163, 133, 110,  98,  54,  61,
-     95, 111, 135, 103,  88, 164, 115, 187, 122,  98,
-    129, 132,  95,  86,  71, 119, 146, 111,  38,  67,
-    102, 100,  66, 148, 137, 103, 145,  95,  35,  85,
-     44, 136, 102, 111, 108, 115, 136, 105, 120, 110,
-    108, 147, 112, 169, 116, 146,  81, 120,  94,  84,
-     93,  97,  90, 119, 102,  91,  48, 147, 204, 151,
-    148, 160, 144, 131, 144, 175, 158, 133, 212, 163,
-    172, 152, 151, 112, 148, 151, 145, 179, 160, 124,
-    164, 164, 167, 161, 141, 120, 131, 141, 198, 177,
-    169, 156, 146, 156, 124, 185, 164, 195, 181, 193,
-    201, 147, 148, 168, 165, 159, 162, 148, 150, 148,
-    146, 157, 158, 149, 164, 129, 160, 214, 174, 166,
-    154, 176, 146, 141, 155, 140, 140, 169, 106, 155,
-    166, 162, 134, 193, 157, 155, 146, 196, 171, 107,
-    177, 174, 163, 155, 147, 203, 162, 146, 150,  83,
-    157, 170, 180, 178, 159, 157, 151, 117, 115, 183,
-    170, 180, 174, 150, 177, 173, 136, 181, 196, 184,
-    164, 168, 165, 148, 175, 168, 209, 189, 159, 114,
-    157, 158, 141, 168, 170, 139, 175, 128, 151,  39,
-    128, 154, 159, 161, 148, 180, 131, 165, 159, 131,
-    163, 150, 174, 178, 178, 198, 172, 138, 184, 191,
-    143, 164, 161, 163, 210, 171, 155, 168, 150, 116,
-    182, 170, 145, 152, 141, 139, 191, 149, 160, 202,
-    145, 169, 145, 181, 148, 183, 197, 165, 146, 171,
-    161, 153, 157, 170, 164, 149, 183, 167, 246, 235,
-    162, 144, 170, 152, 173, 150, 113, 135, 156, 154,
-    158, 148, 178, 159, 161, 114, 180, 156, 116, 163,
-    164, 161, 122, 164, 164, 183, 135, 135, 144, 182,
-    160, 147, 163, 152, 169, 185, 159, 177,  99, 211,
-    168, 167, 215, 170, 150, 157, 154, 176, 154, 143,
-    163, 117, 178, 160, 163, 165, 164, 166, 174, 136,
-    159, 169, 152, 123, 199, 149, 169, 140, 159, 208,
-    155, 161, 186, 122, 134, 167, 171, 145, 148, 176,
-    148, 137, 114, 160, 166, 153, 162, 156, 164, 172,
-    155, 148, 155, 182, 114, 150, 157, 154, 140, 159,
-    166, 160, 169, 206, 182, 145, 157, 165, 147, 202,
-    131, 154, 193, 162, 162, 149, 167, 157, 191, 188,
-    149, 205, 147, 166, 150, 150, 159, 153, 171, 160
-};
-
-static const uint8_t wmavoice_dq_lsp16i1[0x640] = {
-    142, 121, 141, 112,  99, 119,  92, 122, 183, 155,
-    122,  98,  75,  78,  85, 101, 108, 134, 128, 123,
-    115,  90,  79,  58,  73, 127, 106,  60,  97, 107,
-    141, 163, 130, 123, 136, 156, 201, 189, 204, 206,
-    140, 116,  69,  60, 117, 123, 106, 124,  91,  63,
-    150, 144, 110,  80,  63, 112,  80,  70,  76,  63,
-    114,  86, 147, 165, 137, 125, 120, 140, 115, 101,
-    101,  99, 166, 158, 158, 104, 126, 131, 134, 143,
-    121, 102,  73,  36,  83, 132, 113,  76,  38,  20,
-    132, 111,  78,  73,  51, 131, 108, 131, 105,  80,
-    148, 138, 101,  65,  47, 115,  86,  50, 124, 129,
-    116,  89,  85,  87,  64, 111,  74,  39, 115, 113,
-    112,  83,  75, 122, 127, 114,  91, 106, 125, 130,
-    131, 108,  79, 136, 112, 110, 147, 164, 144, 124,
-    121, 236, 218, 190, 168, 106, 101, 160, 172, 191,
-    113, 138, 102,  91, 109, 100,  71,  85, 112, 119,
-    121,  96,  51,  64, 126, 135, 114,  76,  34, 104,
-    145, 127,  90,  56, 131, 142, 131,  92, 123, 102,
-    128, 105,  63,  24,  95, 115,  87,  49, 156, 174,
-    123, 105,  88,  58,  55, 141, 119,  99,  75,  81,
-    137, 117, 114,  80,  56, 119,  91, 106, 166, 135,
-    114,  84,  38,  93, 116, 129, 103,  97,  87,  97,
-    115, 184, 193, 173, 157, 117,  88, 114, 151, 121,
-    126, 111,  75, 129, 133, 130, 107,  71, 115,  92,
-    128, 108, 120, 100,  97, 111,  80, 119, 122,  91,
-    114,  94, 149, 129, 136, 114,  88, 132, 110,  85,
-    116,  99, 101,  71,  71, 110, 140, 142, 131, 110,
-    122,  98,  83, 127, 100, 106, 130, 123, 114, 103,
-    113,  87, 140, 116, 113, 140, 161, 171, 145, 129,
-    115, 178, 158, 161, 160, 118, 195, 209, 221, 228,
-     99,  83, 140, 134, 140, 127, 186, 168, 187, 187,
-    107, 114, 100, 111, 111, 104, 130, 131, 116, 128,
-    128, 104,  64,  18,  49, 126, 107,  69,  56, 153,
-    154, 142, 110, 113,  89, 120,  93,  73, 190, 172,
-    119,  96,  57,  21,  60, 126, 122,  81,  99, 117,
-    159, 141, 108,  88, 120, 144, 125,  89,  44,  94,
-    147, 131,  93,  81,  61, 133, 113,  85,  47,  62,
-    123, 121,  87,  53,  90, 120,  94,  76,  70,  48,
-    125, 103,  93,  64,  35, 140, 129,  88,  47,  30,
-    127, 104,  58,  51, 103, 124, 100, 102,  76,  47,
-    115,  87,  54,  46,  77, 182, 218, 174, 163, 145,
-    140, 126,  89, 105,  82, 125, 119, 101,  69,  58,
-    125, 107, 172, 145, 128, 138, 113, 109,  92,  90,
-    117,  93,  83,  93, 132, 125, 102,  67, 148, 161,
-    131, 110,  96,  99,  74, 119,  92,  54,  84,  81,
-    110, 152, 120, 106, 131, 108,  74,  68,  99, 107,
-    121,  97, 120, 101,  78, 132, 110, 127, 164, 134,
-    111, 159, 204, 189, 178, 158, 183, 146, 144, 137,
-    123, 106, 136, 108, 135, 117,  91, 163, 135, 113,
-    119, 177, 134, 122, 121, 132, 109, 157, 131, 113,
-    115,  87,  87, 100,  92, 120,  95,  59, 146, 139,
-    129, 101, 135, 122, 101, 119, 100, 112,  88,  99,
-    118,  90, 123, 125, 107, 121,  98,  73, 104,  80,
-    112,  79,  86, 122,  96, 104,  81, 107,  90,  93,
-    112, 150, 140, 109, 115, 113,  86,  73,  76, 112,
-    130, 111, 101, 112,  84, 123,  97,  63, 134, 115,
-    109,  77, 128, 141, 119, 125, 101, 108, 147, 119,
-    134, 149, 150, 127, 115, 136, 244, 220, 210, 189,
-    105, 138, 171, 156, 174, 117, 162, 133, 146, 141,
-    115,  93, 119,  98, 122, 114, 106, 154, 145, 162,
-    107, 131, 189, 165, 152, 101, 107, 129, 114, 139,
-    116, 186, 186, 161, 180, 100,  89, 137, 116, 116,
-    106, 130, 194, 196, 207, 110, 156, 157, 138, 149,
-    102,  93, 159, 138, 120, 109, 132, 105, 122, 135,
-    148, 128,  85,  76, 102, 168, 154, 141, 117, 100,
-    125, 106,  62, 101, 146, 124, 102,  65,  25,  15,
-    120,  94,  46,  21,  94, 149, 128, 115,  85,  92,
-    119,  93,  70,  52,  30, 162, 151, 123,  91,  80,
-    126, 112,  84,  47,  33, 138, 114,  73,  60,  87,
-    126, 211, 174, 158, 143, 129, 106,  65,  31, 133,
-    119,  95,  52,  99, 173, 123,  96, 119, 206, 178,
-    127, 104,  60,  61,  67, 152, 136, 104,  63,  83,
-    133, 130,  92,  64,  45, 120,  96,  53,  30, 130,
-    128, 103,  74,  59,  35, 135, 114,  77,  30,  57,
-    108, 130, 123,  90,  87, 143, 125,  93,  54,  60,
-    133, 118,  79,  87,  95, 115,  89, 111,  88,  65,
-    124, 102,  70,  40,  47, 148, 131, 123, 130, 104,
-    127, 109,  87,  56, 121, 147, 123, 121, 107,  85,
-    178, 237, 200, 193, 170, 139, 118, 100,  75, 110,
-    133, 121,  81,  73,  68, 120, 195, 157, 141, 131,
-    127, 102, 107,  88,  60, 136, 113, 100,  69,  45,
-    128, 105,  93,  77,  67, 131, 116, 149, 184, 156,
-    115,  85,  35,  45, 112, 128, 108,  68,  73, 111,
-    118,  93, 187, 162, 139, 136, 115,  84,  57,  37,
-    131, 133, 125,  98,  85, 138, 115,  92,  86,  61,
-    116,  96,  70,  52, 110, 115, 109, 135, 104,  88,
-    136, 159, 122, 109, 115, 122, 110,  98,  70,  95,
-    112,  81,  68,  85,  90, 124, 101,  87,  56,  89,
-    109,  82,  98, 100, 115, 124, 102,  76,  88,  63,
-    111,  78,  42,  78, 102, 110,  71,  64, 131, 111,
-    125, 104, 107,  87, 123, 129, 131,  99,  85,  68,
-    147, 137, 102,  99,  75, 120, 155, 142, 109,  91,
-    132, 109, 131, 141, 113, 136, 119,  94, 152, 128,
-    127, 102,  79, 159, 134, 111,  78,  98, 109,  80,
-    115,  86,  51,  63, 103, 116,  86, 170, 149, 123,
-    135, 178, 159, 125, 114, 113, 189, 226, 203, 202,
-    140, 117, 116,  94,  70, 128, 103,  94, 174, 149,
-    118,  98,  83,  84, 106, 115, 157, 120,  94,  95,
-    131, 112,  75,  96,  74, 121,  97, 144, 117,  95,
-    120,  90, 140, 138, 110, 119,  93,  55,  92, 114,
-    114,  87, 151, 125, 100, 111,  82,  83, 160, 139,
-    114,  86,  56,  90, 138, 104, 109, 101,  77, 118,
-    140, 142, 143, 148, 126, 121, 102, 129, 107, 111,
-    113,  79,  58, 111,  91, 120,  94,  63, 115,  98,
-    121,  94,  99,  97,  78, 120,  92,  68, 173, 148,
-    122, 114, 109,  87,  82, 132, 229, 192, 176, 155,
-    137, 116, 123,  97, 115, 132, 115,  86, 120,  95,
-    135, 116, 101, 136, 108, 109,  74, 100, 125, 115,
-    112, 158, 144, 124, 134, 114,  83,  73, 147, 120,
-    120, 104, 150, 122, 116, 110, 104, 192, 183, 174,
-    134, 112, 116, 120,  93, 121, 101,  93, 110,  90,
-    121,  93, 147, 152, 122, 115, 153, 171, 161, 142,
-    123,  95, 116, 114,  93, 113,  89,  96,  77,  93,
-    113, 174, 180, 143, 138, 116,  86, 100, 135, 106,
-    103, 121, 149, 115, 103, 121,  95,  82, 149, 121,
-    117,  92,  93, 111, 114, 123, 209, 196, 193, 183,
-    125, 102, 107, 130, 104, 115,  91, 113, 103,  99,
-    114,  86,  68, 108, 110, 111, 159, 162, 125, 113,
-    125, 235, 234, 225, 214,  99,  74, 118, 121, 127,
-    104, 123, 158, 128, 127, 113,  96, 116, 136, 158,
-    100,  80, 138, 155, 166, 118, 143, 115, 125, 114,
-    119, 137, 133, 136, 139, 151, 188, 172, 174, 173,
-    138, 161, 158, 158, 155, 121, 198, 194, 211, 202,
-    100,  90, 112, 110, 122, 100,  91, 122, 128, 135,
-    101, 109, 127, 101, 114, 105, 126, 160, 147, 143,
-    109, 138, 142, 158, 163, 113, 174, 185, 188, 206,
-    112, 154, 166, 176, 183, 101, 108, 140, 140, 143,
-    106, 135, 130, 137, 126, 103, 114, 115, 128, 126,
-    107,  86,  21, 115,  75, 117, 139,  97,  65, 105,
-     64, 191, 101, 106, 139, 107,  98, 218, 132, 104,
-     73, 136, 165,  84, 118, 150, 111,  58, 130, 107,
-     99, 136, 132,  56,  52, 102, 136,  69,  78, 163,
-     85, 173, 148, 138,  85,  69, 106, 128, 133, 155,
-    104,  91, 149,  56, 104, 103, 101, 172,  96,  57,
-    104,  97, 125, 197, 166, 107, 169,  47, 120, 103,
-    150,  89,  99, 139, 162, 101,  69, 137, 158, 126,
-    191, 173, 127,  79, 155,  51, 131, 112,  86,  74,
-    135,  61, 114,  81, 125, 117, 112,  72, 175,  72,
-    127, 123, 142, 132,  78, 116, 158, 111, 121, 143,
-    108, 102,  89,  20, 194,  81,  99, 107,  65, 150,
-    103,  78,  91,  69,  96, 104, 116, 116, 103, 105,
-    107, 117, 110, 130,  28,  88, 103,  62,  72,  85,
-    125, 126, 141, 126, 178, 121, 102,  57,  46, 124,
-     97,  91,  89, 138,  95,  98, 143,  99, 169, 123,
-    140, 119, 113,  82, 140, 118, 112,  91,  92, 241,
-    134,  89,  95, 112,  78, 167, 140, 145, 121, 100,
-    109, 205, 144,  91, 100, 113, 103, 142, 175,  95,
-    117, 121,  35, 121, 127, 159, 129,  85,  64,  75,
-    116,  98, 103, 127, 129,  66,  68, 110,  96,  86,
-     79, 100, 156, 133,  92, 135,  96, 164, 132, 121,
-     93, 163, 134,  91, 208, 104,  77, 126, 116,  58,
-    136, 118, 132,  81,  61,  73, 115,  66, 129, 123,
-    111,  85,  42, 178, 134, 108, 132, 159,  45, 157,
-    105, 164, 100,  94,  60,  96,  57, 154, 105, 102,
-    103, 114,  96,  12,  91, 119, 115,  67,  92,  64,
-     94,  61, 106, 106, 165, 105,  94,  98,  68,  30,
-    146, 130, 107, 173, 140, 102,  90, 163, 106, 184,
-    100,  53,  68, 131,  92, 105, 111,  68, 153, 186,
-    101,  82,  48,  99, 147, 122, 136, 176,  96,  96,
-    104, 132, 167, 149, 136, 138, 144,  97, 120,  92
-};
-
-static const uint8_t wmavoice_dq_lsp16i2[0x3c0] = {
-     23,  12, 107, 119, 110, 205, 214, 212, 208, 201,
-    102,  95,  69, 117, 107, 118, 123, 118, 123, 121,
-     82,  58,  83,  95,  84, 139, 145, 153, 161, 169,
-    102, 100, 138, 121, 101, 129, 130, 138, 150, 139,
-     76, 104,  86, 112, 133, 113,  91,  63,  73, 129,
-    199, 193, 182, 181, 172, 119, 101,  83,  94,  76,
-    161, 157, 152, 157, 158, 110,  90, 121,  96,  79,
-    124, 107, 114,  88,  73, 152, 137, 121, 107,  99,
-     57,  50, 100,  81,  74, 115,  96,  72,  49,  69,
-     83,  68,  40,  53, 103,  36, 131, 107,  84,  64,
-    236, 245, 242, 231, 213,  95, 109,  88,  69, 110,
-    228, 221, 204, 182, 170, 129, 110,  97, 118, 104,
-     98,  76,  98,  75,  61,  93,  77, 113,  91,  72,
-    116,  94, 106, 134, 118, 177, 188, 169, 162, 153,
-    163, 149, 131, 131, 132, 177, 163, 173, 168, 158,
-    113, 131, 107, 113, 100, 132, 143, 131, 134, 142,
-     45,  36, 121, 113, 102,  43,  95,  84,  67,  56,
-     76,  82,  68,  48,  33,  55,  58,  59,  43,  65,
-     66,  85,  66,  81,  94, 102,  82,  54,  33,  94,
-    113, 111,  89,  60,  34, 138, 120, 101, 101,  86,
-     88,  73,  55, 114, 115,  92,  74,  93,  77, 123,
-     90, 117,  99,  79,  59,  97,  75,  97, 122, 104,
-    233, 237, 227, 208, 190, 209, 230, 233, 240, 241,
-    195, 197, 188, 167, 147, 204, 185, 168, 162, 157,
-    142, 124, 119, 123, 106, 117, 110,  81, 121, 123,
-     74, 116, 124, 119, 120, 178, 168, 146, 132, 125,
-    102, 104, 105, 110, 114, 104,  82,  78, 100,  86,
-    120, 102, 105,  93, 143, 127, 108, 128, 106,  88,
-    177, 189, 203, 207, 215, 101, 131, 119,  95,  73,
-    149, 139, 135, 147, 153, 160, 167, 165, 174, 177,
-    120, 109, 134, 140, 145, 131, 130, 142, 139, 161,
-    143, 158, 148, 145, 145, 123, 142, 132, 116, 102,
-     40,  23,  79,  82,  84,  26,  83, 141, 130, 122,
-     65,  46,  43,  89,  86,  28,  75,  80,  79,  98,
-     84,  65,  47,  26,  44,  49, 112, 101, 100,  94,
-     88,  76,  75,  48,  82, 104, 100,  75,  45,  15,
-     99,  83,  63,  34,  30,  66,  55,  94, 118, 113,
-    122, 106,  91,  68,  60, 135, 122, 104,  77,  59,
-     82, 102,  84,  62,  46,  92,  74,  55,  82,  71,
-    145, 134, 118,  93,  75,  79,  62,  83,  65,  55,
-     91,  94,  64,  70,  98,  89, 117, 110,  87,  97,
-    210, 223, 225, 223, 213,  83, 103,  86, 101,  85,
-    126, 106,  81,  79, 105, 216, 219, 217, 199, 179,
-     86,  78, 115, 138, 135, 102,  84,  87,  59,  46,
-    219, 206, 184, 167, 158, 201, 188, 165, 145, 135,
-     87, 113, 142, 152, 155, 190, 170, 153, 149, 146,
-    205, 208, 201, 185, 167,  84,  73, 124, 104,  96,
-     76,  88,  99,  74,  80, 110, 125, 122,  99, 112,
-    108,  84,  70, 130, 137, 161, 152, 136, 119, 105,
-    110,  91, 101,  74,  96, 111, 101,  93, 153, 149,
-    133, 124, 102,  97, 120, 101,  93,  75,  81,  64,
-    111,  94, 107,  79,  58, 188, 206, 215, 221, 232,
-    163, 175, 165, 150, 136, 103, 106, 123, 133, 132,
-    168, 184, 191, 183, 170, 110, 117,  90,  98,  93,
-    104,  87, 122,  98, 127, 129, 110, 127, 113, 125,
-    134, 118, 102, 140, 132, 186, 199, 202, 198, 188,
-    149, 147, 175, 185, 186, 117,  93,  99, 112,  93,
-    107, 138, 138, 129, 128,  96, 129, 104, 118, 134,
-    145, 136, 115, 121, 129, 138, 155, 148, 134, 120,
-    170, 151, 150, 145, 138, 168, 173, 185, 194, 200,
-    144, 159, 172, 168, 156, 121, 121, 138, 173, 168,
-    126, 111, 140, 139, 117, 149, 133, 142, 137, 130,
-    143, 139, 158, 158, 146, 119, 128, 121, 132, 145,
-    122, 136, 159, 153, 141, 133, 133, 130, 129, 126,
-    120,  76,  50, 149, 109,  92, 155, 118,  90,  66,
-    132, 117,  87, 156, 117, 119, 102,  44,  83,  91,
-    109,  73, 106,  84,  29,  55, 130, 112,  81, 241,
-     75,  40,  91,  89,  67, 112,  90, 149,  81,  72,
-    128,  90,  71,  28, 160,  73, 157, 123, 143, 108,
-     63,  88,  70,  81,  97,  75, 111, 149, 113,  96,
-     78, 104,  83, 179,  95, 105, 106,  65, 130,  66,
-     51, 118,  92,  53,  68, 105,  75, 176, 151, 115,
-     94,  75,  68,  95, 220, 103, 125, 105,  43,  95,
-     39, 114,  65, 145, 135,  33, 142, 138, 103,  52,
-     82,  85, 117, 110,  67, 102,  74,  42,  62, 118,
-    144, 121,  82,  57, 102,  67,  75,  44, 129,  96,
-     75,  63,  88,  48, 116, 135,  94,  85, 102,  66,
-    122,  77, 105, 122, 152, 120,  56,  90,  83, 100,
-     90, 128,  63,  80, 103, 126, 117, 103,  80, 193,
-     42,  73, 117,  93,  91,  95, 128, 100, 128, 162,
-     70, 120, 126,  73, 123,  99,  99,  91,  75, 135,
-     81, 125, 111,  77,  13,  94,  78,  85, 187, 157,
-     11, 143, 109,  99, 119,  53, 141,  82, 122,  68,
-    132,  89, 136, 119,  88,  75,  49, 174, 119,  70,
-    138, 121, 108,  78,  52, 104,  90,  96,  93,  93,
-    114,  90,  78,  46,  58,  62, 114,  69,  44, 162,
-    103,  58,  98, 141,  83, 137,  95, 119,  73, 111,
-     81,  46, 126, 111, 123, 107, 117, 122, 121,  54,
-    106, 104,  59, 110, 148,  97, 155,  97,  83, 133,
-     97,  71,  57,  91,  58,  52,  79, 127, 152, 109,
-     96,  92, 145, 107, 149, 102,  61, 125,  61, 170,
-     56,  89,  77, 106,  38, 147,  96,  77, 105, 123,
-     85,  83, 117,  63,  69, 126, 133,  93, 107,  92,
-     77, 115,  95, 111, 103,  61,  87, 103,  98, 155,
-     94, 111,  80,  78,  54, 117, 128, 130,  99, 109,
-    106,  99, 113, 133, 115,  89,  65,  74, 112, 127
-};
-
-static const uint8_t wmavoice_dq_lsp16i3[0x300] = {
-     70, 100, 121, 129, 132, 132, 201, 188, 165, 145, 144, 136,
-    112, 127, 116, 125, 130, 129, 124, 135, 135, 146, 129, 128,
-    162, 158, 144, 151, 135, 129, 103,  86, 111, 113, 112, 122,
-     90, 139, 129, 117, 126, 129, 142, 145, 167, 147, 124, 124,
-    230, 209, 189, 175, 156, 141,  64,  80,  86, 108, 121, 129,
-     44,  79, 115, 113, 115, 128, 133, 106,  79, 109, 125, 127,
-    171, 156, 132, 109, 103, 115, 106,  70,  93, 145, 141, 128,
-    148, 125, 122, 107, 110, 117, 146, 145, 128, 110,  98, 111,
-    237, 212, 185, 156, 139, 133,  84,  55,  26,  77, 114, 127,
-    172, 170, 171, 168, 162, 143,  82,  82,  76,  70, 104, 126,
-     17,  95, 109, 111, 120, 132,  81,  74,  57, 126, 141, 131,
-    110, 127, 162, 148, 129, 123, 177, 172, 155, 151, 145, 134,
-    144, 123,  90,  66, 109, 130,  82, 127, 103, 123, 132, 131,
-    127,  97,  97, 142, 140, 128, 159, 134, 136, 123, 113, 117,
-    131, 140, 154, 169, 158, 134,  96, 109, 150, 122, 105, 120,
-    120, 150, 152, 122, 119, 125, 123, 126, 124, 107, 100, 113,
-    248, 233, 216, 189, 160, 142,  58,  24,  13,  77, 111, 127,
-    183, 189, 182, 157, 140, 131,  96,  83,  59,  43,  73, 119,
-    222, 196, 171, 146, 129, 128,  32,  13,  53, 101, 114, 127,
-    119, 101,  70,  70, 110, 127,  77,  86, 161, 148, 130, 118,
-    199, 183, 170, 167, 156, 141,  30, 115, 142, 133, 131, 130,
-    101, 103, 181, 176, 152, 126,  66,  44,  73,  94, 111, 128,
-    150, 122, 100, 101, 104, 118,  61, 110,  87,  76,  93, 125,
-    190, 170, 150, 134, 135, 129, 112,  89,  63, 123, 141, 132,
-    175, 154, 136, 142, 140, 132, 117, 143, 129, 128, 136, 132,
-    168, 142, 112, 113, 128, 128, 155, 169, 159, 144, 139, 131,
-     61, 136, 144, 124, 112, 123,  86,  81, 104, 121, 129, 130,
-    160, 127, 118, 150, 151, 134, 126, 115, 121, 132, 134, 131,
-    137, 148, 144, 139, 140, 134, 106, 102, 105,  90,  87, 113,
-    134, 129, 128, 121, 121, 123, 153, 151, 129, 139, 142, 134,
-    150, 142, 141, 148, 149, 141, 100, 121, 133, 147, 150, 134,
-    163, 158, 147, 132, 141, 132, 142, 127, 141, 136, 136, 132,
-    232, 218, 205, 189, 169, 146, 243, 224, 201, 171, 147, 138,
-    224, 196, 169, 162, 154, 140,  51,  20,  59, 111, 121, 128,
-    203, 197, 193, 177, 162, 145,  75,  40,  47, 122, 130, 129,
-    102,  77,  47,  83, 121, 129, 111, 108,  84,  56,  63, 114,
-    211, 181, 154, 137, 126, 125, 213, 198, 186, 162, 144, 138,
-     41,  45,  90, 110, 118, 130,  83,  63, 130, 164, 153, 128,
-    195, 167, 142, 123, 113, 119,  19,  42, 105, 113, 120, 132,
-     50,  63,  49,  64, 112, 128, 114,  90, 132, 171, 162, 134,
-    129, 128, 107,  83,  74, 110,  50, 116, 109, 120, 128, 132,
-     94,  59,  73, 111, 117, 126, 197, 170, 166, 153, 138, 132,
-     65,  48, 109, 133, 131, 128, 170, 163, 172, 158, 138, 130,
-     66, 126, 147, 160, 151, 132,  42, 129, 117,  95,  91, 120,
-     97, 165, 164, 142, 133, 125, 163, 142, 114,  88,  97, 122,
-    104,  77, 142, 143, 128, 120, 136, 160, 188, 169, 149, 130,
-    113,  83,  85, 102, 114, 125, 164, 169, 142, 120, 122, 124,
-     98, 152, 132, 105,  92, 117,  42,  71, 125, 155, 151, 137,
-     94, 105,  81, 107, 118, 126,  84,  56, 123, 117, 108, 122,
-    174, 179, 166, 137, 118, 121, 130, 103, 147, 152, 134, 124,
-    148, 127,  94, 117, 144, 134, 129, 106, 102,  95, 106, 118,
-    147, 157, 153, 125, 103, 117, 155, 128, 113, 132, 120, 122,
-    181, 151, 136, 126, 122, 122, 110, 111, 109, 108, 120, 124,
-     97, 130, 103,  89, 107, 124, 179, 158, 158, 142, 131, 128,
-    142, 111, 115, 122, 126, 125, 145, 145, 134, 115, 129, 128,
-    130, 139, 112,  99, 121, 125,  79, 104, 119, 102, 105, 123,
-    116, 121, 136, 125, 126, 127, 124, 100, 122, 119, 111, 119,
-    159, 140, 139, 128, 138, 131, 105, 100, 116, 128, 135, 132,
-    159, 142, 156, 147, 140, 134, 130, 150, 129, 126, 114, 120,
-    138, 124, 146, 131, 109, 119,  93, 115, 125, 131, 125, 129,
-    125, 121, 101, 119, 114, 120, 163, 154, 151, 153, 153, 139,
-    166, 153, 150, 133, 119, 121, 159, 151, 128, 130, 122, 123,
-    147, 154, 144, 133, 128, 127, 129, 131, 134, 140, 148, 138,
-    138, 136, 120, 131, 135, 131, 150, 140, 137, 144, 129, 129
-};
-
-static const uint8_t wmavoice_dq_lsp10r[0x1400] = {
-    128, 128, 129, 129, 130, 130, 131, 130, 129, 129,
-    134, 133, 127, 125, 136, 135, 135, 134, 173, 172,
-    133, 139, 136, 165, 133, 176, 137, 159, 135, 152,
-    147, 161, 147, 152, 149, 156, 146, 146, 140, 136,
-    134, 135, 136, 140, 139, 155, 123, 133, 132, 142,
-    132, 148, 143, 177, 124, 143, 123, 136, 126, 134,
-    126, 125, 125, 124, 129, 128, 123, 123, 133, 133,
-    116, 116, 121, 121, 121, 120, 129, 128, 131, 131,
-    132, 133, 132, 129, 138, 124, 138, 124, 132, 100,
-    135,  94, 149, 111, 152, 115, 150, 128, 141, 133,
-    129, 129, 130, 129, 147, 145, 136, 137, 120, 122,
-    120, 122, 127, 129, 104, 108, 113, 115, 124, 124,
-    140, 139, 147, 145, 132, 130, 184, 177, 201, 196,
-    170, 171, 160, 161, 145, 147, 137, 145, 131, 131,
-    130, 130, 130, 130, 130, 130, 132, 134, 131, 132,
-    131, 133, 141, 144, 142, 149,  84,  93, 103, 104,
-    139, 139, 142, 140, 147, 147, 172, 165, 122, 121,
-     98, 100, 101, 106, 112, 117, 122, 124, 124, 124,
-    134, 133, 133, 133, 146, 142, 147, 145, 156, 156,
-    143, 146, 119, 124, 129, 132, 151, 149, 136, 135,
-    147, 148, 181, 180, 199, 188, 190, 173, 166, 161,
-    147, 142, 153, 149, 154, 146, 150, 146, 138, 134,
-    131, 135,  96, 136,  48, 138,  56, 131,  63, 124,
-     85, 128, 103, 132, 117, 134, 120, 132, 125, 129,
-    131, 130, 129, 128, 129, 128, 163, 168, 117, 120,
-    121, 121, 136, 138, 131, 132, 135, 136, 131, 133,
-    133, 133, 133, 134, 117, 118, 105, 109, 142, 151,
-    144, 159, 131, 138, 121, 126, 123, 123, 121, 124,
-    131, 131, 129, 129, 141, 140, 142, 134,  87,  90,
-    109, 109, 130, 127, 139, 143, 133, 131, 127, 126,
-    134, 135, 134, 136,  97,  98, 130, 132, 134, 137,
-    115, 119, 125, 130, 107, 109, 119, 118, 126, 127,
-    134, 135, 127, 132, 172, 203, 160, 196, 152, 179,
-    152, 172, 148, 168, 153, 172, 145, 156, 137, 140,
-    102, 116,  42,  56,  74,  61,  82,  70,  86,  78,
-    101,  97, 104, 100, 115, 108, 116, 108, 123, 118,
-    149, 143, 166, 129, 168,  96, 142,  95, 135,  98,
-    117,  86, 116,  93, 121, 108, 119, 107, 121, 117,
-    135, 135, 127, 138,  72, 132,  99, 136, 112, 147,
-    120, 152, 136, 155, 138, 146, 140, 142, 134, 139,
-    163, 145, 192, 130, 147, 124, 147, 125, 133, 125,
-    127, 124, 128, 123, 129, 122, 130, 122, 130, 125,
-    130, 137, 135, 180, 124, 133, 130, 129, 132, 133,
-    124, 124, 131, 130, 132, 136, 126, 124, 127, 125,
-    132, 132, 133, 133, 144, 140, 143, 142, 137, 135,
-    143, 138, 152, 149, 221, 219, 158, 161, 143, 141,
-    130, 129, 140, 135, 170, 145, 193, 156, 186, 152,
-    167, 139, 151, 131, 142, 127, 134, 120, 131, 125,
-    135, 133, 141, 125, 199, 109, 137, 126, 134, 123,
-    130, 129, 132, 123, 128, 125, 122, 126, 125, 125,
-    130, 128,  91,  89, 138, 135, 139, 134, 133, 129,
-    132, 130, 125, 128, 136, 135, 129, 127, 126, 126,
-    132, 131, 133, 131, 128, 120, 132, 126, 126, 119,
-    134, 130, 131, 123, 104,  95, 140, 141, 136, 137,
-    133, 133, 133, 134, 117,  98,  74,  49, 112, 111,
-    123, 122, 126, 127, 131, 131, 127, 126, 128, 129,
-    130, 131, 124, 127, 101, 107, 108, 109, 115, 115,
-    100,  99, 130, 128, 134, 136, 125, 127, 128, 130,
-    136, 137, 145, 150, 149, 164, 136, 151, 114, 111,
-    124, 125, 143, 150, 162, 174, 158, 169, 136, 137,
-    131, 131, 131, 131, 132, 133, 111, 110, 122, 121,
-    136, 136, 134, 133, 131, 132, 127, 127, 125, 125,
-    128, 129, 129, 130, 125, 127, 140, 140, 148, 149,
-    133, 136, 146, 153, 110, 118, 127, 129, 128, 129,
-    131, 133, 127, 131, 140, 161, 167, 224, 131, 139,
-    136, 143, 135, 139, 138, 143, 149, 155, 141, 143,
-    134, 132, 120, 111,  83,  83, 121, 126, 102, 107,
-    112, 115,  97, 104, 120, 115, 129, 123, 122, 122,
-    134, 135, 122, 131, 102, 124, 114, 119,  93, 103,
-     78,  79,  67,  72,  66,  73,  78,  82, 103, 102,
-    144, 135, 165, 139, 165, 129, 160, 126, 153, 127,
-    161, 134, 160, 142, 160, 143, 148, 140, 138, 135,
-    138,  95, 147,  54, 143,  78, 140, 112, 142, 113,
-    140, 121, 135, 117, 135, 122, 136, 131, 131, 132,
-    147, 159, 140, 156, 127,  81, 142, 128, 146, 127,
-    144, 125, 146, 128, 149, 130, 144, 135, 133, 128,
-    130, 131, 131, 131, 134, 139, 126, 134, 141, 154,
-    168, 205, 153, 176, 148, 163, 147, 158, 141, 143,
-    131, 135, 126, 146, 108, 157, 107, 156, 119, 146,
-    100, 138, 104, 125, 119, 134, 101, 122, 113, 122,
-     95, 133,  52, 140,  83, 136, 110, 133, 114, 131,
-    123, 131, 133, 131, 138, 135, 132, 132, 127, 127,
-    129, 128, 124, 122, 128, 126, 145, 170, 143, 172,
-    141, 163, 143, 176, 138, 164, 139, 155, 135, 145,
-    135, 136, 136, 127, 132,  76, 128,  76, 127,  63,
-    125,  66, 123,  67, 120,  71, 124,  92, 122, 111,
-    133, 133, 135, 136, 139, 140, 147, 147, 150, 144,
-    156, 147, 150, 145, 154, 146, 120, 123, 123, 124,
-    137, 133, 170, 141, 124, 124, 135, 134, 134, 135,
-    132, 132, 129, 129, 130, 130, 136, 136, 130, 132,
-    147, 159, 135, 158, 115, 146, 120, 148, 117, 136,
-    115, 137, 113, 132, 133, 142, 140, 144, 132, 134,
-    134, 135, 134, 137, 137, 147, 162, 178, 136, 147,
-    134, 144, 123, 132, 111, 113, 113, 113, 124, 124,
-    132, 131, 126, 126, 117, 114, 100,  95, 130, 125,
-    157, 145, 164, 156, 163, 158, 145, 145, 133, 134,
-    134, 134, 127, 126, 113, 102, 136, 130, 124, 122,
-    143, 145, 127, 131, 135, 143, 133, 137, 132, 132,
-     92,  94, 122, 125, 128, 129, 131, 130, 134, 135,
-    132, 128, 129, 127, 132, 132, 131, 129, 127, 127,
-    129, 129, 132, 131, 139, 131, 137, 132, 216, 178,
-    146, 134, 147, 137, 151, 142, 148, 139, 144, 138,
-    128, 127, 129, 129, 123, 131,  71,  91, 126, 128,
-    130, 134, 117, 123, 125, 125, 135, 140, 129, 132,
-    132, 132, 133, 134, 124, 130, 127, 133, 133, 138,
-    142, 149, 135, 141, 145, 149, 154, 164, 135, 138,
-    135, 135, 141, 142, 138, 137, 116,  96, 105,  86,
-    127, 118, 128, 120, 124, 117, 125, 117, 125, 121,
-    131, 131, 132, 134, 144, 145, 112, 112, 121, 123,
-    113, 116, 121, 123, 139, 138, 128, 128, 131, 131,
-    134, 132, 132, 132, 125, 128, 127, 130, 125, 131,
-    120, 128,  90, 119,  68,  98,  99, 112, 115, 124,
-    135, 135, 134, 134, 128, 129, 137, 137, 137, 138,
-    110, 114, 129, 130, 144, 145, 123, 125, 129, 129,
-    132, 133, 129, 130, 168, 187, 140, 149, 137, 144,
-    129, 130, 129, 134, 133, 138, 118, 118, 122, 120,
-    131, 130, 129, 128, 133, 133, 125, 125, 124, 123,
-    181, 179, 129, 129, 131, 127, 139, 136, 130, 128,
-    133, 133, 132, 132, 121, 120, 122, 119, 132, 129,
-    129, 125, 107,  96, 136, 137, 150, 146, 135, 134,
-    131, 131, 130, 130, 126, 123, 126, 123, 128, 125,
-    130, 123, 134, 127, 183, 159, 143, 135, 137, 134,
-    129, 129, 128, 128, 134, 133, 139, 138, 133, 132,
-    129, 127, 154, 151, 150, 144, 146, 146, 141, 142,
-    132, 132, 131, 131, 130, 130, 132, 133, 114, 115,
-    132, 132, 122, 122, 132, 131, 115, 117, 120, 120,
-    129, 129, 130, 130, 130, 129, 130, 131, 129, 131,
-    130, 130, 129, 129, 133, 132, 143, 144,  91,  91,
-    137, 136, 118, 107,  60,  45,  56,  49,  57,  52,
-     60,  56,  71,  75,  77,  80,  92,  97, 106, 106,
-    112, 131,  58, 121,  19,  65,  84, 101, 108, 122,
-    121, 127, 112, 117, 106, 112, 117, 124, 126, 127,
-    130, 129, 138, 133, 166, 155, 192, 179, 192, 177,
-    208, 191, 204, 192, 186, 179, 163, 163, 138, 142,
-    134, 134, 144, 142, 243, 236, 148, 146, 141, 137,
-    145, 141, 151, 144, 147, 143, 135, 139, 134, 133,
-    134, 128, 138,  88, 142,  10, 127,  76, 130,  96,
-    129, 102, 128, 108, 123, 111, 127, 119, 127, 124,
-    136, 136, 139, 139, 142, 140, 246, 241, 158, 167,
-    143, 145, 146, 149, 143, 145, 148, 152, 133, 134,
-    139, 135, 135, 136,  99, 137,  95, 133,  75, 138,
-     67, 135,  73, 128,  83, 132,  96, 126, 115, 127,
-    130, 132, 137, 136, 140, 135, 134, 130, 137, 131,
-    159, 151, 215, 197, 181, 170, 160, 149, 150, 143,
-    145, 148, 186, 207, 141, 147, 135, 137, 122, 122,
-    126, 125, 128, 126, 127, 127, 134, 126, 131, 123,
-    133, 133, 126, 122, 128, 122,  99,  93,  59,  60,
-     82,  82, 106, 107, 119, 123, 124, 128, 128, 129,
-    134, 137, 133, 139, 133, 136, 141, 132, 139, 122,
-    142,  97, 130,  81, 128,  89, 129, 101, 125, 112,
-    137, 140, 129, 148, 101, 159, 118, 180, 122, 178,
-    120, 178, 116, 168, 118, 153, 127, 151, 126, 136,
-    132, 134, 125, 126, 118, 105, 156, 124, 180, 132,
-    163, 124, 148, 121, 131, 112, 127, 115, 125, 122,
-    129, 131, 128, 129, 136, 134, 142, 141, 165, 158,
-    203, 182, 141, 136, 132, 130, 135, 135, 130, 130,
-    133, 133, 132, 132, 127, 126, 106, 105, 112, 110,
-    106, 105,  80,  84, 100, 101, 122, 125, 126, 128,
-    101, 109,  46,  59, 114, 112, 119, 119, 126, 121,
-    129, 124, 128, 125, 125, 122, 123, 120, 125, 122,
-    135, 134, 121, 134,  56, 139, 131, 145, 135, 138,
-    136, 139, 126, 130, 122, 132, 126, 129, 124, 129,
-    153, 169, 146, 179, 138, 139, 151, 143, 148, 138,
-    153, 137, 142, 129, 144, 126, 140, 128, 133, 126,
-    136, 134, 154, 149, 173, 157, 152, 144, 149, 141,
-    137, 136, 127, 121, 123, 121, 121, 126, 120, 123,
-    157, 143, 166, 135, 120, 122, 112, 118, 102, 118,
-    111, 124, 134, 131, 141, 138, 135, 134, 126, 129,
-    140, 123, 152,  76, 131, 116, 138, 136, 126, 134,
-    130, 142, 126, 136, 120, 132, 126, 128, 124, 127,
-    131, 138,  80, 147, 126, 138, 130, 140, 129, 134,
-    133, 135, 131, 132, 126, 127, 127, 125, 125, 123,
-    132, 132, 130, 132, 123, 130, 102, 102, 107, 110,
-    116, 127, 132, 152, 142, 160, 143, 151, 142, 146,
-    132, 132, 132, 132, 125, 126, 132, 140, 158, 199,
-    135, 149, 134, 140, 135, 131, 129, 120, 127, 121,
-    129, 130, 122, 123, 125, 124, 138, 138, 138, 135,
-    140, 141, 101,  94, 105,  98, 121, 122, 127, 128,
-    126, 127, 119, 121, 133, 156, 132, 159, 130, 148,
-    137, 164, 127, 138, 130, 137, 135, 140, 126, 126,
-    128, 129, 129, 129, 126, 124, 130, 128, 143, 138,
-    149, 143, 185, 170, 129, 127, 138, 133, 138, 135,
-    132, 134, 137, 144, 139, 183, 131, 145, 127, 128,
-    128, 127, 128, 122, 129, 125, 145, 139, 135, 131,
-    132, 133, 132, 130, 152,  96, 159,  85, 150, 105,
-    154, 115, 143, 120, 138, 126, 134, 124, 130, 126,
-    128, 127, 121, 123, 122, 123, 116, 125,  84,  87,
-    133, 135, 129, 131, 123, 126, 133, 135, 131, 130,
-    136, 134, 129, 119,  79,  63, 116, 116, 136, 133,
-    133, 130, 140, 143, 127, 127, 124, 125, 127, 128,
-    128, 126, 124, 120, 139, 128, 153, 134, 151, 134,
-    174, 145, 159, 136, 165, 144, 171, 149, 143, 135,
-    134, 134, 133, 133, 121, 119, 177, 162, 166, 154,
-    127, 130, 132, 132, 136, 137, 142, 143, 138, 137,
-    167, 151, 162, 142, 128, 136, 142, 148, 128, 143,
-    145, 153, 140, 149, 132, 141, 128, 139, 127, 133,
-    156, 169, 131, 129, 126, 120, 127, 125, 129, 120,
-    131, 126, 126, 123, 124, 121, 122, 121, 123, 123,
-    138, 140, 149, 156, 145, 152, 105, 102, 131, 126,
-    151, 146, 147, 139, 144, 137, 143, 133, 135, 130,
-    132, 130, 131, 129, 126, 130, 126, 129, 110, 135,
-    115, 139, 108, 146, 105, 147, 121, 134, 124, 133,
-    137, 137, 135, 134, 143, 142, 146, 146, 120, 121,
-    139, 137, 133, 129, 149, 145, 139, 133, 130, 127,
-    134, 134, 134, 134, 125, 124, 117, 119, 120, 113,
-     84,  80, 122, 125, 108, 112,  97, 102, 118, 120,
-    124, 123, 115, 116, 110, 111,  98,  97, 127, 124,
-    129, 127, 120, 117, 114, 109, 106, 104, 116, 116,
-    138, 138, 139, 141, 142, 146, 127, 125, 133, 130,
-    134, 128, 134, 127, 116,  91, 105,  84, 114, 106,
-    128, 128, 126, 126, 131, 137, 126, 129, 133, 139,
-    134, 145, 132, 143, 150, 192, 131, 142, 138, 141,
-    132, 130, 132, 130, 149, 138, 196, 152, 137, 125,
-    134, 125, 139, 128, 133, 125, 141, 134, 134, 135,
-    134, 135, 134, 135, 131, 130, 136, 133, 110, 106,
-    142, 144, 153, 162, 131, 129, 134, 132, 131, 130,
-    126, 125, 132, 130, 168, 153, 126, 124, 130, 126,
-    140, 135, 140, 134, 138, 133, 145, 137, 135, 134,
-    130, 130, 132, 131, 133, 132, 129, 129, 125, 128,
-    128, 130, 133, 139, 143, 152, 193, 215, 152, 160,
-    130, 131, 129, 131, 130, 131, 135, 136, 136, 141,
-     83,  81, 121, 120, 136, 130, 150, 145, 147, 145,
-    134, 133, 135, 133, 146, 142, 135, 131, 127, 128,
-    134, 135,  93, 102, 126, 132, 131, 133, 127, 129,
-    124, 125, 120, 122, 103, 106, 128, 129, 139, 138,
-    127, 128, 134, 134, 143, 138, 139, 134, 135, 133,
-    131, 130, 133, 131, 139, 134, 138, 136, 166, 156,
-    119, 116, 121, 122, 126, 124, 116, 117, 123, 124,
-    131, 131, 129, 129, 130, 128, 141, 138, 135, 132,
-    154, 145, 137, 129, 131, 125, 146, 137, 138, 135,
-    131, 131, 131, 132, 129, 130, 134, 138, 111, 116,
-    113, 118, 123, 125, 122, 124, 143, 147, 138, 140,
-    116, 113, 114, 112, 130, 126, 117, 115, 127, 126,
-    139, 137, 141, 139, 131, 132, 143, 144, 139, 140,
-    130, 130, 129, 128, 136, 134, 119, 117, 152, 143,
-    155, 143, 120, 119, 142, 139, 124, 130, 126, 128,
-    112, 110, 112, 109, 136, 132, 125, 118, 121, 115,
-    103, 101, 109, 100, 125, 120, 121, 117, 122, 121,
-    128, 128, 127, 127, 124, 124, 128, 127, 131, 129,
-    142, 138, 147, 141, 115, 108, 113, 109, 122, 119,
-    136, 133, 150, 139, 142, 131, 119, 111, 151, 137,
-    121, 116, 146, 134, 137, 129, 121, 123, 127, 129,
-    130, 130, 130, 130, 136, 137, 126, 126, 136, 136,
-    133, 133, 139, 139, 142, 143, 119, 120, 134, 134,
-    132, 132, 133, 133, 135, 138, 129, 131, 133, 134,
-    135, 138, 126, 130, 117, 118, 131, 132, 135, 135,
-    129, 129, 128, 128, 126, 129, 127, 129, 123, 125,
-    115, 117, 156, 157, 127, 131, 129, 129, 128, 129,
-    129, 130, 131, 131, 126, 127, 135, 134, 136, 135,
-    140, 136, 117, 113, 132, 128, 104,  97, 109, 106,
-    131, 131, 131, 131, 121, 123, 124, 125, 126, 127,
-    127, 127, 135, 135, 128, 128, 130, 130, 141, 140,
-    129, 129, 129, 129, 129, 127, 127, 125, 149, 146,
-    125, 123, 134, 133, 134, 132, 152, 150, 138, 138,
-    128, 128, 126, 125, 132, 133, 141, 143, 136, 136,
-    126, 127, 126, 127, 129, 131, 128, 129, 135, 134,
-    176, 139, 192, 135, 145, 122, 149, 117, 155, 134,
-    169, 133, 157, 139, 142, 136, 151, 152, 142, 147,
-    166, 174, 103, 107, 141, 134, 140, 136, 144, 135,
-    147, 135, 156, 131, 153, 127, 133, 126, 130, 124,
-    127, 130, 123, 124, 114, 105, 195, 193, 156, 157,
-    165, 158, 126, 122, 149, 141, 174, 173, 152, 147,
-    136, 139, 131, 138, 163, 169, 103, 124,  80, 102,
-    153, 186, 121, 151, 134, 161, 156, 190, 141, 151,
-    121, 123, 124, 127, 119, 127, 133, 134, 157, 156,
-     81,  69, 136, 134, 160, 169, 118, 114, 135, 128,
-    114, 116,  97,  97, 117, 122, 152, 161, 115, 121,
-    106, 122, 135, 137, 111, 113, 125, 135, 141, 145,
-    143, 146, 143, 150, 132, 136, 142, 150, 151, 167,
-    101, 107, 155, 173, 112, 124, 105, 100, 128, 126,
-    127, 130, 133, 134, 142, 121, 131, 116, 176, 145,
-    161, 120, 209, 150, 196, 133, 147, 115, 149, 130,
-    144, 145, 144, 145, 120, 119, 163, 160, 117, 118,
-    123, 117, 154, 119, 193,  98, 149, 101, 137, 116,
-    133, 135, 140, 143, 144, 156, 131, 146, 186, 201,
-    140, 139, 123, 125, 158, 169, 157, 166, 142, 143,
-    130, 131, 132, 132, 128, 128, 141, 142, 147, 149,
-    145, 148, 137, 139, 129, 129, 107, 108, 157, 157,
-    120, 121, 119, 119, 140, 132, 137, 131, 118, 113,
-    143, 136, 134, 135, 164, 158, 133, 125, 127, 124,
-    148, 122, 197, 130, 173, 145, 110, 139, 123, 165,
-     83, 158,  90, 167,  93, 142, 136, 169, 134, 152,
-    130, 126, 154, 138, 227, 150, 156, 114, 147, 114,
-    142, 109, 135, 110, 166, 135, 176, 150, 152, 142,
-    132, 132, 136, 136, 130, 135, 143, 152, 136, 144,
-    152, 160, 177, 185, 112, 112, 165, 166, 160, 161,
-    145, 145, 138, 139, 116, 118, 127, 131,  66,  80,
-    132, 142, 119, 127, 101, 108, 120, 130, 126, 130,
-    135, 135, 142, 139, 153, 137,  55,  30, 142, 139,
-    139, 143, 135, 133, 129, 133, 109, 108, 129, 129,
-    136, 135, 134, 131, 129, 132, 132, 134, 135, 149,
-     79, 206, 123, 137, 135, 143, 130, 140, 131, 134,
-    100,  99, 165, 164, 142, 123, 148, 133, 133, 122,
-    142, 133, 138, 125, 119, 111, 129, 123, 137, 130,
-    131, 132, 123, 129, 174, 185, 196, 181, 127, 111,
-    156, 141, 132, 114, 129, 106, 132, 107, 126, 117,
-    134, 140, 131, 136, 119, 146,  92, 246, 128, 132,
-    125, 129, 132, 140, 128, 141, 126, 145, 137, 142,
-    130, 130, 110, 115, 124, 139, 127, 151, 118, 152,
-     98, 146,  36, 108, 126, 158, 112, 146, 112, 130,
-    138, 136, 145, 138, 153, 145, 116, 125,  90, 103,
-    137, 138, 189, 185, 141, 151,  86,  93, 111, 111,
-    133, 171, 125, 209, 140, 132, 130, 134, 129, 101,
-    142, 120, 142, 132, 135, 126, 141, 140, 140, 134,
-    128, 123, 131, 123, 138, 118, 163, 133, 240, 197,
-    176, 151, 126, 123,  81,  94, 109, 118, 124, 133,
-    135, 133, 137, 134, 154, 135, 140, 155,  69, 190,
-    119, 149, 141, 151, 142, 123, 135, 125, 129, 130,
-    127, 125, 132, 127, 107,  80, 123, 103, 145, 131,
-    133, 107, 140, 103, 135, 106, 170, 145, 159, 143,
-    136, 137, 127, 130, 105, 119, 129, 134, 141, 151,
-    116, 127, 119, 140,  75, 119, 152, 162, 149, 152,
-     72, 138,   9, 143, 118, 160, 126, 134, 141, 147,
-    135, 131, 129, 129, 135, 129, 136, 126, 133, 125,
-    137, 135, 146, 141, 145, 139, 141, 140, 133, 130,
-    213, 208, 139, 130, 139, 136, 117, 117, 126, 125,
-    133, 130, 138, 131, 141, 100, 145,  93, 159, 121,
-    144, 132, 117, 160, 102, 187,  99, 162, 117, 144,
-    132, 132, 134, 134, 140, 141, 127, 126, 128, 131,
-    116, 116, 121, 127, 119, 126, 114, 114,  99, 100,
-    141, 144, 148, 159, 179, 224,  95, 131, 100, 125,
-     87, 110, 112, 132, 134, 147, 111, 125, 122, 122,
-    137, 140, 141, 129, 169,  12, 144, 132, 133, 144,
-    141, 146, 137, 147, 136, 122, 133, 130, 131, 128,
-    141, 142, 128, 139,  15,  69, 160, 159, 142, 130,
-    137, 126, 159, 141, 145, 143, 128, 125, 134, 128,
-    131, 130, 127, 127, 114, 104, 119,  98,  83,  68,
-    139, 120, 173, 142, 199, 154, 191, 153, 158, 145,
-    128, 130, 127, 127, 148, 150, 110,  99, 119, 109,
-    120, 113, 163, 154, 110,  90, 138, 129, 149, 144,
-    131, 134, 124, 142,  76, 217, 130, 129, 140, 138,
-    133, 135, 145, 150, 136, 138, 127, 130, 130, 134,
-    144, 119, 178,  70, 143, 130, 115, 136, 139, 138,
-    129, 109, 136, 116, 147, 122, 126, 112, 126, 123,
-    132, 139, 128, 144, 107, 156,  75, 163, 120, 164,
-    151, 136, 151,  99, 160, 112, 159, 126, 143, 126,
-    140, 138, 137, 135, 152, 108, 251,  85, 138, 116,
-    137, 118, 141, 119, 136, 121, 150, 134, 138, 131,
-    137, 137, 143, 144, 150, 153, 148, 154, 152, 151,
-    117, 104, 124,  96,  93,  67, 146, 138, 149, 148,
-    149, 153, 172, 193, 108, 114, 125, 128, 145, 165,
-    149, 160, 121, 130, 115, 120, 110, 112, 121, 118,
-    145, 146, 141, 142, 127, 127, 103,  95, 138, 143,
-    114, 126, 109, 115, 143, 136, 153, 149, 144, 142,
-    140, 138, 150, 144, 128, 116, 142, 136, 135, 122,
-     93,  88, 164, 163, 141, 142, 171, 182, 154, 160,
-    124, 125, 122, 123, 158, 155, 111,  97, 138, 130,
-    157, 134, 101,  65, 129, 118, 121, 114, 124, 119,
-    131, 133, 125, 129, 136, 147, 135, 152, 131, 133,
-    110, 115, 118, 114, 161, 159, 233, 218, 172, 166,
-    140, 107, 125,   0, 140, 103, 140, 115, 125, 113,
-    132, 135, 128, 133, 138, 146, 131, 145, 127, 133,
-    131, 131, 122, 122, 135, 132, 126, 124, 132, 133,
-    164, 167, 121, 127, 117, 120, 167, 162, 145, 143,
-    135, 134, 136, 134, 156, 146, 195, 177, 127, 139,
-    108, 140, 141, 173, 141, 178, 131, 155, 129, 141,
-    134, 134, 119, 114, 184, 184, 127, 126, 147, 151,
-    130, 140, 146, 159, 134, 145, 131, 136, 137, 142,
-    135, 137, 128, 136,  83, 108,  97,  98, 152, 119,
-    207, 144, 142, 121, 144, 129, 131, 127, 130, 132,
-    124, 125, 108, 107,  94, 116,  81, 114, 139, 173,
-    131, 158, 145, 177, 141, 163, 136, 140, 143, 144,
-    135, 141, 132, 136, 134, 142, 142, 136, 173,  50,
-    143, 106, 142, 127, 134, 139, 127, 133, 125, 125,
-    129, 130, 131, 133, 132, 148, 110, 138, 113, 135,
-    138, 175, 108, 151,  55, 119,  51, 100,  93, 116,
-    121, 121, 146, 151,  99, 120, 127, 137, 107, 122,
-    125, 139, 110, 132, 135, 156, 141, 156, 148, 157,
-    137, 137, 141, 140, 139, 137, 130, 128, 138, 136,
-    132, 134, 115, 110, 177, 179,  81,  86, 100,  98,
-     84,  83, 121, 121, 148, 157, 127, 133, 146, 156,
-    127, 136, 143, 151, 135, 139, 138, 142, 136, 136,
-    201, 164, 151, 129, 123, 136, 147, 148, 127, 142,
-    128, 143, 101, 126, 119, 133, 114, 131, 116, 126,
-    132, 133, 140, 140, 126, 125, 156, 153, 142, 129,
-    140, 130,  77,  69, 134, 132, 146, 148, 135, 136,
-    133, 132, 123, 116, 116, 103, 150, 135, 144, 127,
-    130, 117, 136, 122, 122, 106,  48,  38,  81,  78,
-    145, 146, 135, 136, 123, 122, 126, 133, 133, 138,
-    145, 145, 144, 150, 160, 181, 142, 139, 150, 150,
-    136, 136, 139, 139, 133, 133, 139, 135, 134, 129,
-    140, 137, 153, 145, 132, 131, 151, 144,  68,  66,
-    137, 137, 139, 139, 146, 146, 142, 139, 129, 128,
-    131, 129, 133, 132, 135, 134, 135, 134, 201, 200,
-    137, 136, 146, 143, 155, 153, 157, 158, 131, 138,
-    140, 139, 143, 144, 128, 123, 216, 192, 159, 150,
-    137, 138, 136, 142, 145, 148, 126, 162, 140, 170,
-    186,  95, 131, 140, 143, 148, 133, 128, 130, 133,
-    141, 139, 153, 150, 122, 122, 134, 144, 124, 130,
-    159, 166, 133, 139, 151, 150, 138, 139, 131, 134,
-    121, 121, 131, 129, 148, 180, 121, 135, 118, 131,
-    124, 148, 119, 119, 129, 126, 150, 156, 155, 160,
-     40, 154, 115, 157, 133, 129, 140, 133, 143, 133,
-    143, 132, 144, 130, 141, 131, 134, 130, 137, 133,
-    134, 136, 141, 140, 145, 137, 152, 124, 183,  91,
-    118, 154, 123, 158, 136, 134, 140, 142, 138, 142,
-    138, 135, 131, 131, 138, 129, 121, 128, 146, 219,
-    124, 123, 125, 135, 120, 126, 127, 141, 133, 136,
-    127, 124, 120, 107, 152, 125, 149, 108, 158, 144,
-    196, 185, 174, 164, 151, 149, 138, 131, 140, 137,
-    149, 148, 144, 145, 143, 145, 140, 143, 141, 147,
-    112, 125, 113, 113, 149, 155, 143, 149, 146, 151,
-    138, 138, 141, 138, 144, 129, 134, 125, 143, 140,
-    153, 154, 142, 123, 162,  42, 154, 106, 153, 130,
-    153, 153, 137, 137, 144, 144, 142, 140, 165, 151,
-    161, 140, 144, 134, 156, 124, 167, 143, 166, 155,
-    132, 132, 137, 138, 137, 132, 124, 127, 140, 144,
-    134, 140, 162, 180, 127, 131, 152, 169, 145, 156,
-    133, 134, 131, 133, 130, 132, 147, 149, 125, 117,
-    127, 118, 159, 155, 147, 142, 122, 117, 145, 144,
-    138, 137, 130, 133, 113, 149, 168, 224, 166, 201,
-    129, 151, 147, 154, 136, 135, 140, 136, 152, 141,
-    120, 112, 140, 127, 161, 100, 132, 115, 118, 125,
-    115, 133, 115, 157, 144, 146, 114, 135, 127, 139,
-    138, 141, 135, 135, 137, 136, 147, 142, 143, 144,
-    139, 152, 142, 136, 147, 143, 177,  39, 125,  71,
-    147, 143,  66,  88, 132, 158, 123, 126, 116, 135,
-    119, 124, 128, 135, 133, 140, 137, 126, 137, 130,
-    155,  38, 149, 103, 130, 135, 139, 143, 127, 137,
-    135, 141, 138, 148, 131, 148, 136, 147, 132, 139,
-    136, 140, 115, 129, 115, 151, 136, 160,  87, 131,
-    157, 176, 150, 164, 140, 141, 135, 119, 137, 133,
-    141, 140, 140, 139, 134, 134, 142, 144, 131, 132,
-    131, 134, 131, 132, 116, 114, 129, 133, 205, 207,
-    130, 133, 160, 170, 137, 127, 124, 112, 158, 146,
-    155, 137, 134, 136, 137, 142, 177, 184, 149, 152,
-    135, 134, 133, 132, 135, 129, 144, 136, 139, 134,
-    161, 155, 126, 109, 215, 186, 177, 153, 160, 149,
-    139, 139, 136, 140, 140, 142, 186,  71, 129, 144,
-    131, 165, 142, 152, 140, 151, 141, 143, 137, 139,
-    144, 138, 150, 135, 133, 126, 136, 143,  99, 152,
-    139, 131, 190, 118, 122, 147, 134, 155, 136, 143,
-    138, 135, 137, 132, 147, 144, 150, 144, 138, 134,
-    129, 133, 130, 138,  56, 175, 129, 166, 147, 165,
-    140, 138, 144, 137, 141, 133, 150, 139, 129, 135,
-     40,  83, 126, 130, 110, 120, 100, 110, 126, 128,
-    141, 142, 217, 175, 172, 151, 146, 153, 125, 132,
-    128, 137, 141, 141, 145, 145, 140, 133, 132, 131,
-    129, 144, 128, 177, 133, 195, 147, 120, 138, 131,
-    161, 114, 166, 134, 162, 118, 161, 115, 155, 129,
-    137, 136, 141, 129, 141, 132,  55, 168, 121, 126,
-    136, 139, 120, 133, 149, 147, 132, 141, 131, 136,
-    147, 150, 151, 132, 101,  31, 117, 101, 129, 132,
-    122, 138, 128, 137, 140, 170, 131, 143, 131, 134,
-    149, 192, 122, 158, 136, 146, 133, 166, 143, 141,
-    141, 136, 141, 129, 125, 155, 140, 138, 137, 131,
-    111, 112, 131, 132, 120, 127, 149, 148, 151, 141,
-    156, 148, 133, 129, 127, 124, 144, 137, 142, 139,
-    134, 133, 141, 138, 133, 135, 124,  96, 226, 152,
-    116, 108, 128, 105, 155, 130, 153, 138, 144, 139,
-    142, 141, 137, 135, 142, 143, 156, 162, 136,  89,
-    188, 145, 181, 152, 138, 146, 146, 154, 145, 149,
-    152, 133, 158, 133,  42, 153, 117, 144, 149, 139,
-    125, 139, 134, 128, 150, 128, 143, 125, 135, 132,
-    143, 141, 143, 141, 164, 173, 141, 142, 156, 155,
-    154, 154, 169, 170,  77,  80, 112, 105, 135, 134,
-    126, 143, 120, 172, 111, 144, 120, 154, 107, 153,
-     95, 134, 104, 134, 128, 116, 163, 131, 151, 136,
-    135, 133, 142, 143, 152, 204, 149, 112, 156, 128,
-    150, 126, 127, 129, 139, 175, 143, 141, 138, 135,
-    168, 148, 152, 105, 164, 121, 134, 122, 119, 109,
-    122, 148, 136, 143, 153, 132, 158, 148, 149, 150,
-    133, 131, 142, 141, 150, 149, 156, 173, 138, 155,
-    129, 144, 111, 107, 130, 129,  96,  89, 106, 104,
-    135, 135, 144, 146, 131, 153, 134, 154, 146, 166,
-    117, 138, 163, 187, 190, 216, 149, 156, 149, 152,
-    142, 142, 153, 154, 109, 145,  40, 102, 116, 126,
-    137, 139, 149, 157, 108, 124, 139, 146, 142, 147,
-    130, 126, 120, 111, 172, 146, 169, 136, 150, 135,
-    126,  96, 159, 143, 150, 122, 162, 129, 156, 142,
-    135, 142, 144, 138, 222, 109, 137, 145, 144, 142,
-    141, 143, 138, 136, 124, 150, 133, 144, 137, 145,
-    141, 144, 139, 144, 134, 154, 114, 136, 145, 173,
-    151, 215, 110, 115, 127, 134, 145, 150, 145, 144,
-    144, 142, 139, 131, 147, 132, 141, 119, 143, 106,
-    165,  41, 147, 129, 129, 144, 138, 135, 138, 140,
-    128, 150,  89, 163, 154, 115, 141, 127, 132, 145,
-    135, 157, 143, 145, 140, 141, 127, 135, 127, 129,
-    142, 147, 116, 147, 104, 162, 153, 143, 146, 130,
-    144, 110, 133, 123, 130, 137, 118, 198, 126, 152,
-    154, 146, 139, 127, 147, 112, 207, 151, 156, 136,
-    162, 137, 108, 121, 130, 135, 125, 131, 131, 134,
-    134, 134, 141, 144, 107, 143, 137, 144, 124, 136,
-    115, 147, 130, 157, 119, 167,  71, 144,  97, 128,
-    134, 138, 132, 133, 138, 138, 146, 146, 147, 131,
-    141, 138, 185,  65, 145, 123, 139, 130, 142, 128,
-    139, 136, 157, 147, 124, 119, 164, 148, 170, 154,
-    133, 130, 157, 148, 140, 141, 130, 135, 134, 137,
-    136, 137, 143, 144, 144, 144, 178, 186,  71,  73,
-    120, 118, 127, 124, 152, 151, 155, 146, 141, 138,
-    142, 143, 139, 143, 133, 134, 139, 140, 138, 135,
-    146, 141,  78, 198, 129, 139, 141, 141, 134, 141,
-    137, 136, 120, 120, 124, 118, 143, 148, 148, 152,
-    131, 143, 129, 137, 152, 158, 157, 160, 175, 178,
-    137, 139, 131, 133, 146, 152, 121, 147, 142, 143,
-    129, 136, 149, 145, 197, 114, 103, 141, 124, 140,
-    141, 140, 129, 129, 127, 130, 131, 124, 123, 117,
-    150, 139, 120, 109, 119, 120, 163, 163, 117, 121,
-    139, 139, 136, 136,  94,  74, 150, 145, 126, 127,
-    147, 150, 158, 162,  84,  74, 136, 129, 140, 132,
-    136, 135, 146, 145, 124, 116, 129, 120, 130, 129,
-    130, 109, 122, 111, 160, 141, 135, 113, 131, 121,
-    136, 135, 135, 135, 147, 147, 140, 140, 144, 145,
-    139, 142, 131, 137, 145, 145, 143, 153,  48,  49,
-    145, 143, 151, 147, 158, 146, 135, 124, 124, 116,
-    159, 140, 131, 126, 123, 120, 103, 117, 113, 119,
-    148, 146, 128, 124, 123, 126, 123, 120, 158, 141,
-    148, 137, 146, 143, 125, 143,  89, 107, 116, 123,
-    149, 147, 141, 139, 149, 153, 118, 121, 139, 138,
-    105, 119, 168, 147, 139, 141, 143, 138, 133, 130,
-    126, 126, 143, 142, 146, 144, 124, 123, 143, 145,
-    149, 148, 147, 141, 151, 143, 118, 113, 175, 171
-};
-
-static const uint8_t wmavoice_dq_lsp16r1[0x500] = {
-    147, 145, 193, 168, 188, 156, 141, 145, 141, 139,
-    148, 149, 148, 149, 153, 157, 144, 144, 152, 152,
-    141, 145, 153, 143, 243, 134, 151, 133, 166, 135,
-    150, 149, 135, 132,  32,  39, 110, 111, 109, 114,
-    126, 127, 147, 146, 177, 169, 162, 156, 210, 187,
-    141, 147,  95, 150, 127, 155, 108, 133, 139, 148,
-    138, 138, 140, 140, 147, 146, 134, 130, 136, 134,
-    147, 146, 142, 150,  62, 174, 126, 151, 122, 156,
-    154, 156, 179, 184, 115, 107, 105,  99, 127, 124,
-    146, 131, 140,  44, 132, 125, 156, 146, 153, 153,
-    136, 137, 145, 144, 141, 139, 158, 152, 138, 132,
-    145, 145, 147, 145, 146, 141, 144, 140, 110,  97,
-    140, 141, 143, 142, 130, 123, 127, 117, 126, 120,
-    147, 146, 161, 155, 169, 135, 122, 117, 166, 155,
-    144, 144, 142, 142, 125, 122, 137, 128, 194, 172,
-    127,  85, 148, 143, 153, 141, 147, 147, 140, 143,
-    118, 140,   0,  69,  51,  60, 111, 123, 137, 135,
-    146, 146, 164, 165, 207, 214, 145, 143, 149, 147,
-    178, 168, 197, 170, 134, 154, 148, 159, 115, 140,
-    103, 118,  13,  38, 139, 138, 135, 138, 140, 141,
-    144, 144, 140, 140, 150, 150, 156, 157, 164, 171,
-    143, 143, 140, 142, 118, 120, 172, 172, 160, 163,
-    146, 147, 150, 151, 176, 176, 230, 237, 153, 153,
-    168, 156, 173, 149, 164, 148, 162, 146, 178, 158,
-    147, 145, 143, 145, 111, 126, 111, 130,  89, 118,
-    153, 158, 122, 120, 142, 125, 124, 105, 148, 138,
-    145, 144, 156, 151, 193, 154, 146, 147, 119, 135,
-    142, 141, 145, 145, 152, 147, 142, 141, 146, 146,
-    139, 138, 154, 154, 148, 150, 147, 149, 144, 145,
-    134, 134, 141, 140, 135, 134, 145, 147, 160, 163,
-    144, 145, 149, 146, 115,  67, 127, 119, 141, 135,
-    145, 141, 130, 124, 143, 144, 151, 165, 141, 144,
-    154, 152, 160, 136, 115,  82,  64,  71,  64,  65,
-    143, 143, 151, 149, 240, 251, 165, 173, 173, 179,
-    148, 134, 156,  55, 160, 105, 133,  91, 129,  96,
-    149, 149, 145, 144, 160, 154, 171, 159, 140, 142,
-    154, 163, 178, 244, 147, 140, 153, 150, 137, 121,
-    145, 144, 145, 146, 138, 139, 149, 152, 189, 198,
-    148, 148, 156, 158, 168, 182, 165, 182, 172, 201,
-    143, 142,  99,  92, 152, 152, 143, 143, 127, 127,
-    165, 148, 173, 124, 113, 122, 134, 142, 127, 142,
-    124, 126, 137, 137, 131, 132, 144, 142, 141, 138,
-    172, 176, 138, 111, 152, 136, 167, 154, 156, 137,
-    140, 150,  78, 145, 158, 157, 161, 154, 155, 147,
-    153, 164, 156, 191, 129, 109, 153, 146, 153, 141,
-    138, 137, 141, 138, 115,  94, 144, 141, 155, 147,
-    144, 142, 144, 137, 168, 113, 141, 134, 145, 137,
-    146, 144, 150, 148, 140, 155, 103, 178, 137, 149,
-    145, 147, 148, 153, 175, 201, 138, 146, 110, 108,
-    143, 146, 124, 134, 124, 127, 164, 158, 127, 135,
-    145, 146, 150, 150, 145, 147,  95,  80, 150, 151,
-    149, 149, 162, 162, 144, 152, 170, 169, 145, 154,
-    145, 149, 143, 146, 142, 145, 152, 146, 160,  98,
-    141, 141, 153, 153, 140, 137, 131, 131, 145, 146,
-    133, 132, 127, 124, 158, 150, 173, 164, 178, 167,
-    146, 146, 154, 155, 117, 127, 143, 147, 147, 156,
-    142, 143, 144, 145, 146, 152, 170, 199, 151, 165,
-    146, 147, 139, 140, 147, 149, 132, 134, 147, 149,
-    138, 139, 142, 143, 162, 188, 145, 149, 160, 164,
-    150, 150, 139, 139, 143, 142, 146, 146, 137, 138,
-    142, 142, 141, 140, 152, 153, 164, 171, 110, 112,
-    139, 139, 143, 143, 138, 138, 142, 142, 143, 143,
-    137, 140, 142, 142, 145, 141, 149, 141, 182, 135,
-    146, 146, 150, 150, 144, 145, 150, 151, 135, 137,
-    137, 145,  51,  62,  68,  54,  69,  57,  62,  41,
-    137, 139, 139, 144, 135, 150, 225, 232, 208, 197,
-    136, 135, 141, 143, 145, 150, 160, 169, 213, 247,
-    142, 137,  72,  54, 110, 107, 105, 107, 127, 130,
-    145, 143, 169, 155, 219, 174, 195, 164, 183, 157,
-    155, 157, 239, 232, 169, 164, 170, 172, 156, 159,
-    142, 143, 136, 144,  59, 100, 139, 142, 130, 138,
-    147, 146, 150, 161, 128, 235, 143, 155, 146, 167,
-    154, 149, 128, 151,  42, 149,  55, 136,  59, 127,
-    128, 126,  74,  92, 143, 153, 140, 150, 166, 176,
-    146, 152, 150, 145, 140, 100, 140, 105, 124,  59,
-    195, 191, 146, 148, 144, 136, 136, 133, 129, 122,
-    133, 148,  40, 147, 102, 140, 123, 148, 118, 136,
-    143, 143, 150, 148, 184, 153, 160, 147, 166, 149,
-     58,  68, 127, 135, 141, 145, 143, 147, 150, 151,
-    140, 143, 137, 137, 120, 114,  71,  65, 125, 123,
-    153, 148, 215, 159, 136, 135, 150, 146, 150, 150,
-    148, 138, 166,  94, 150, 145, 145, 139, 147, 145,
-    146, 147, 150, 139, 171,  63, 158, 142, 153, 133,
-    147, 148, 143, 143,  76,  72, 155, 159, 164, 176,
-    149, 149, 173, 195, 145, 165, 138, 144, 150, 167,
-    180, 169, 146, 151, 146, 166, 147, 166, 149, 171,
-    157, 156, 168, 166, 147, 149, 121, 122, 116, 124,
-    145, 145, 147, 148, 172, 189, 168, 180, 144, 146,
-    139, 145, 141, 150, 115, 172, 141, 146, 143, 148,
-    145, 145, 142, 143, 145, 147, 138, 143,  58,  73,
-    141, 142, 146, 145, 163, 149, 218, 161, 147, 132,
-    152, 147, 146, 147, 140, 150, 141, 152,  89, 150,
-     78, 134, 135, 137, 139, 142, 140, 137, 137, 130,
-    144, 144, 152, 151, 145, 140, 181, 170, 191, 168,
-    164, 166, 136, 148, 112, 124, 139, 144, 146, 149,
-    142, 151, 113, 182, 137, 150, 143, 156, 138, 147,
-    154, 156, 108, 102, 118, 119, 133, 139, 113, 111,
-    145, 144, 150, 147, 175, 151, 104, 106, 116, 114,
-    143, 144, 151, 157, 151, 191, 135, 113, 138, 123,
-    146, 146, 155, 157, 106, 145, 132, 127, 140, 125,
-    161, 165, 146, 150, 151, 154, 139, 140, 142, 143,
-    144, 148, 145, 149, 147, 138, 168, 104, 146, 136,
-    138, 140,  91, 108, 111, 110, 145, 140, 158, 154,
-    130, 112, 122, 118, 136, 135, 119, 118, 141, 140,
-    147, 146, 146, 145, 138, 138, 182, 188, 132, 132,
-    144, 144, 156, 155, 168, 172, 123, 128, 144, 151,
-    142, 140, 145, 145, 137, 144, 141, 152, 128, 188,
-    149, 149, 160, 161, 160, 160, 166, 163, 130, 107,
-    143, 143, 142, 142, 149, 149, 132, 132, 170, 174,
-    148, 148, 154, 153, 118, 111, 157, 155, 114, 109,
-    140, 139, 138, 137, 205, 187, 137, 133, 147, 144,
-    144, 145, 147, 149, 105, 125, 108, 117, 155, 162,
-    146, 146, 162, 157, 144, 122, 154, 143, 161, 139,
-    141, 142, 130, 131, 144, 144, 142, 141, 144, 142,
-    132, 132, 141, 141, 150, 151, 139, 141, 151, 153,
-    142, 142, 154, 154, 150, 150, 148, 148, 166, 165,
-    143, 142, 144, 144, 132, 132, 142, 144, 130, 128,
-    142, 142, 143, 143, 153, 153, 147, 142, 129, 125,
-    142, 141, 143, 142, 143, 147, 105, 122, 135, 140,
-    141, 140, 140, 140, 151, 151, 156, 155, 146, 146,
-    133, 134, 140, 142, 142, 145, 141, 146, 112, 133,
-    142, 142, 145, 145, 137, 138, 155, 157, 149, 150,
-    144, 144, 139, 138, 130, 128, 132, 131, 147, 147,
-    139, 140, 142, 143, 115, 121, 141, 143, 137, 141,
-    146, 146, 150, 150, 145, 144, 133, 133, 133, 135,
-    143, 144, 144, 144, 166, 167, 139, 142, 139, 140,
-    150, 149, 138, 138, 142, 140, 148, 147, 160, 155,
-    146, 146, 147, 147, 138, 137, 143, 142, 151, 150
-};
-
-static const uint8_t wmavoice_dq_lsp16r2[0x500] = {
-     98,  98, 119, 121, 109, 112, 128, 135, 115, 121,
-    159, 113, 113, 106, 127, 114, 101, 102, 105, 111,
-    161, 162, 137, 138, 161, 159, 152, 150, 150, 148,
-    128,  79, 131, 102, 142, 120, 133, 119, 130, 117,
-    121, 115, 142, 133, 186, 155, 179, 144, 169, 135,
-    107, 103, 106, 106, 122, 122, 111, 112, 112, 115,
-    127, 123, 118, 115, 128, 125, 123, 119, 115, 109,
-    124, 130, 117, 126, 121, 133,  84, 144,  99, 114,
-    122, 125, 123, 131, 124, 135, 176, 200, 158, 176,
-     68,  74,  86,  87, 117, 115, 119, 116, 135, 128,
-    115, 116, 102, 104, 119, 123, 133, 148, 102, 109,
-     71, 121, 106, 117, 107, 127, 106, 122, 100, 110,
-    117, 115, 129, 128,  87,  84, 116, 116, 151, 157,
-    116, 128, 110, 117, 119, 134, 100, 114, 120, 129,
-    142, 141, 146, 151,  94,  91, 114, 114, 118, 118,
-    114, 112, 112, 109, 115, 112, 123, 123, 147, 148,
-    110, 164, 106, 152, 110, 158, 106, 151, 105, 135,
-     85,  51,  71,  27,  71,  34,  74,  45,  85,  53,
-    145, 134, 140, 130, 136, 134, 118, 122, 118, 126,
-    117,  84, 121,  81, 106,  80, 109, 106, 121, 127,
-     95,  94, 112, 110,  90,  94, 109, 107, 114, 109,
-    117, 118, 118, 123, 107, 107,  86,  93,  29,  31,
-    125, 112, 104,  60, 121, 111, 127, 116, 133, 130,
-    118, 117, 148, 145, 122, 126, 124, 127,  90,  91,
-    113, 110, 119, 118, 152, 147, 115, 112, 132, 131,
-    129, 140,  98, 112,  73,  85, 109, 115, 122, 126,
-    123, 122, 122, 122, 126, 125, 137, 140, 203, 210,
-    164, 176, 114, 114, 125, 122, 119, 112, 125, 120,
-    124, 122, 118, 115,  95,  96, 141, 144, 132, 131,
-    127, 130, 132, 134, 116, 114, 122, 123, 137, 134,
-    111, 111, 112, 116, 106, 118,  77, 101, 104, 115,
-    111, 111, 125, 126, 118, 121, 113, 115, 113, 113,
-    171, 170, 202, 199, 221, 206, 199, 184, 177, 167,
-     73,  90,  61,  93,  43,  74,  51,  71,  51,  72,
-    130, 130, 140, 137, 134, 132, 164, 160, 118, 111,
-    123, 136, 133, 154, 130, 158, 106, 110, 110, 114,
-     97,  97,  91,  94,  70,  69, 125, 123, 141, 140,
-    119, 100, 116,  77, 111,  67, 105,  52,  95,  34,
-    100, 122,  90, 124,  68, 120,  43, 117,  50, 112,
-    130, 129, 192, 188, 123, 118, 124, 117, 121, 115,
-    122, 111, 129, 111, 157,  85, 125, 109, 125, 119,
-    143, 152, 119, 128, 114, 116, 129, 136, 148, 157,
-    119, 117, 115, 115, 150, 148, 163, 154, 109, 102,
-    120, 126,  73, 119, 106, 121, 102, 122,  96, 113,
-     84,  83, 117, 115, 122, 117, 154, 143, 159, 142,
-    118, 122, 114, 117, 115, 122, 114, 130,  99, 156,
-    123, 120, 122, 116, 100,  81,  99,  91, 121, 112,
-    139, 131, 164, 142, 132, 119, 145, 133, 157, 141,
-    112, 109, 118, 116, 142, 134, 108, 110,  96,  99,
-    111, 110, 113, 112, 111, 104,  98,  94, 131, 131,
-    115, 114, 121, 118, 120, 115, 173, 148, 123, 117,
-    121, 124, 122, 124, 140, 146,  78,  82,  96,  93,
-     86,  90, 124, 125, 121, 123, 105, 106, 134, 135,
-    107, 109, 132, 141, 100,  95, 113, 114, 102, 105,
-    113, 130,  98, 145, 116, 115, 124, 117, 115, 105,
-    120, 123,  89,  87, 109, 108, 102, 101, 117, 117,
-    113, 122, 132, 138,  77, 116,  86,  99, 118, 126,
-    123, 120, 117, 111, 124, 119, 129, 118,  63,  58,
-    141, 135, 108, 106, 109, 111, 108, 110, 135, 138,
-    117, 114, 134, 127, 139, 129, 138, 130, 126, 122,
-    121, 118, 124, 121, 133, 130,  98,  85, 130, 123,
-    147, 129, 118, 112, 148, 130, 136, 123, 148, 131,
-    113, 112, 123, 118, 123, 115, 147,  95, 117, 110,
-    118, 119, 112, 113, 112, 113, 119, 119, 120, 120,
-    158, 133, 198, 145, 188, 129, 197, 137, 195, 133,
-    132, 140, 140, 139, 158, 156, 223, 217, 233, 233,
-     48,  56,  34,  37,  82,  84, 102, 102, 108, 110,
-    120, 142, 136, 169, 146, 195, 136, 186, 140, 182,
-    196, 186, 158, 155, 142, 134, 132, 125, 120, 119,
-     97, 105,  72,  75,  82,  85,  81,  84, 107, 109,
-     67, 121,  43, 119,  69, 124,  87, 129,  88, 128,
-     53,  57,  93,  98,  91,  94,  93,  98, 104, 104,
-    124, 123, 133, 133, 182, 181, 119, 121, 114, 116,
-    128, 105, 134, 112, 131,  72, 119,  59, 111,  84,
-    132, 142, 145, 180, 124, 132, 131, 143, 122, 134,
-     88,  85, 103, 103, 136, 140, 131, 143, 114, 132,
-    116,  57, 113,  57, 121,  76, 126,  80, 118,  86,
-    127, 112, 127,  97, 131, 100, 149,  91, 163,  86,
-    122, 119, 128, 121, 128, 116, 142, 127, 173, 139,
-    162, 116, 166, 107, 149, 103, 152, 107, 141, 108,
-    114, 113, 118, 116,  56,  43,  90,  90, 105, 105,
-    132, 134, 110, 107, 106, 105,  82,  84,  84,  84,
-    102, 106,  79,  89,  99,  99, 127, 129, 114, 118,
-    139, 157, 116, 123, 116, 123,  87,  89, 110, 113,
-    119, 126,  97,  97, 155, 163, 142, 153, 143, 146,
-    117, 114,  66,  67, 125, 126, 127, 128, 114, 113,
-    111, 114, 127, 133, 123, 132, 143, 162, 133, 148,
-    105, 108, 114, 114, 110, 109,  57,  48, 109, 106,
-    113, 130, 104, 131,  88, 139, 102, 169, 100, 172,
-    129, 114, 150,  97, 114, 112, 117, 119, 109, 116,
-     92, 107,  96, 116,  90, 125, 101, 122, 125, 140,
-    125, 133, 122, 129, 136, 153, 125, 135, 131, 139,
-     84,  71, 129, 123, 135, 120, 114, 103, 112, 101,
-    108, 121, 115, 156, 106, 123, 116, 131, 127, 139,
-    137, 147, 109, 117, 119, 126, 135, 144, 117, 119,
-    120, 127,  76, 105, 111, 116, 120, 125, 141, 138,
-    107, 104, 162, 155, 135, 130, 127, 123, 127, 121,
-    102, 104,  84,  87, 112, 115,  97, 102,  78,  82,
-    119, 118, 120, 123,  91, 105, 114, 119, 119, 126,
-    130, 126, 134, 126, 158, 134, 133,  99, 116, 100,
-    125, 122, 145, 143, 126, 117,  98,  96, 121, 120,
-    152, 148, 131, 126, 130, 129, 126, 119,  87,  87,
-    131, 131, 139, 137, 101, 102, 104, 105,  86,  83,
-     92,  89, 111, 105, 121, 115, 137, 124,  96,  84,
-    100,  96, 122, 119, 107, 108,  93,  96,  79,  82,
-    128, 123, 108, 106, 123, 120, 150, 150, 143, 140,
-    121, 120,  97,  99,  79,  80, 116, 116,  88,  90,
-    128, 131, 101,  97, 140, 140, 117, 116, 116, 118,
-    137, 135, 100,  91, 115, 112, 134, 121, 107,  99,
-    120, 122, 122, 125, 124, 126, 136, 141,  89,  95,
-    103, 119, 103, 116, 122, 139, 125, 137, 152, 170,
-    121, 122, 124, 124,  98,  97, 137, 140,  96,  92,
-    115, 113, 136, 136, 128, 132, 122, 124, 151, 158,
-    100, 107, 121, 131, 131, 158, 119, 130, 113, 114,
-    114, 109, 148, 130, 103,  95, 127, 116, 137, 120,
-    103, 108,  97,  97, 133, 128, 113, 109, 136, 128,
-    125, 124, 118, 118, 122, 121, 101,  99, 157, 152,
-    138, 134, 124, 115, 113, 101, 123, 112, 124, 110,
-    116, 113, 128, 121, 119, 110, 124, 113, 128,  67,
-    114, 118, 114, 123, 109, 121, 102, 123,  56, 116,
-    117, 111, 112,  99, 124, 114, 112,  79, 114,  88,
-    112, 113, 115, 117, 126, 127, 130, 132, 123, 122,
-    111, 104, 111, 102, 112, 102, 129, 118, 129, 115,
-    123, 124, 130, 133, 114, 117, 125, 127, 112, 117,
-    124, 125, 119, 120, 117, 116, 105, 104, 110, 110,
-    125, 124, 118, 116, 124, 123, 124, 121, 133, 132,
-    111, 111, 124, 124, 120, 119, 116, 116, 134, 130,
-    114, 116, 112, 113, 109, 111, 116, 118,  95,  98
-};
-
-static const uint8_t wmavoice_dq_lsp16r3[0x600] = {
-     84,  82,  95,  94, 125, 131,  98, 102,  94,  93, 104, 104,
-    127, 113,  87,  77, 125, 114, 109,  94,  94,  91, 106, 105,
-    168, 125, 163, 120, 128, 100, 119,  99, 108,  97, 108, 106,
-     86,  85, 128, 125,  79,  73, 103, 102, 123, 123, 116, 117,
-     84,  76, 135, 131, 133, 133, 129, 130, 125, 123, 115, 114,
-     94,  97,  79,  81, 115, 115,  94,  93, 128, 127, 126, 125,
-    124, 111, 105, 114, 104, 117, 109, 110, 124, 125, 118, 117,
-    107, 110, 106, 110,  93,  93, 149, 148, 118, 119, 111, 110,
-    147, 157, 143, 156, 134, 136, 118, 121, 106, 107, 105, 105,
-    114,  83, 114,  46, 106,  53, 110,  83, 107,  94, 105, 103,
-     92,  90, 109, 106, 172, 160, 114, 110, 109, 110, 110, 109,
-     90,  98,  98, 109, 102,  98,  97,  92, 100, 100, 101, 102,
-    123, 117, 124,  98,  82,  80, 117, 115, 112, 110, 109, 108,
-    107, 111, 100, 115, 105, 120, 104, 105,  83,  82,  95,  96,
-    109, 120,  72,  71,  97, 104,  69,  74,  99, 102, 118, 117,
-    137, 133, 142, 135, 105, 110, 121, 121, 125, 122, 114, 112,
-    151, 186, 115, 132, 103, 111, 100, 104,  99, 101, 104, 105,
-     18,  38,  56,  65,  76,  83,  85,  91, 101, 103, 108, 110,
-    144, 135, 126, 121, 115, 113,  79,  80, 118, 117, 117, 117,
-    117, 124, 115, 115, 126, 113, 130, 116, 112, 106, 108, 105,
-     77,  76,  76,  80, 109, 109, 125, 129, 130, 133, 116, 118,
-     96,  86, 109,  99, 102,  69,  84,  69, 107, 103, 114, 113,
-     78, 118,  82, 114,  84, 129,  69, 112,  78,  98,  96, 103,
-     89, 137,  96, 111, 105,  97,  93,  93, 101, 105, 105, 105,
-    141, 123, 102,  93,  91,  79,  87,  81, 102,  99, 109, 108,
-     94,  92, 124, 123, 130, 134, 100, 107,  71,  75,  92,  91,
-     94, 104, 107,  83, 106, 101, 113, 114, 122, 122, 114, 114,
-    118, 124, 103, 106,  95, 116,  90,  93, 107, 104, 109, 107,
-    116, 118,  76,  72,  88,  88, 132, 132, 140, 141, 116, 116,
-     90,  81, 111,  95, 139,  97, 123,  96, 112, 100, 110, 108,
-    112, 116, 133, 140, 112, 120,  80,  85,  55,  55,  85,  84,
-    125,  94, 111, 104, 116, 103, 112,  86,  93,  84,  99,  98,
-    180, 179, 197, 197, 169, 163, 149, 146, 130, 124, 116, 115,
-     76,  47,  36,  11,  43,  28,  66,  53,  82,  80, 102,  99,
-    119, 123, 176, 201, 113, 120, 112, 111, 103, 105, 106, 110,
-    145, 114, 112,  89, 120,  93, 123, 104, 131, 123, 113, 111,
-     97, 109,  82, 106,  75, 104, 103, 115, 120, 124, 111, 114,
-    114, 111, 113, 105,  34,  33,  63,  63, 105, 106, 122, 122,
-     51,  41,  96,  92, 125, 125, 118, 118, 118, 119, 113, 113,
-    111, 180, 108, 178, 107, 171, 110, 160, 105, 136, 102, 117,
-     76,  79,  90,  92,  80,  88,  88,  93, 123, 124, 122, 122,
-    131, 128, 123, 122, 151, 158, 108, 107, 129, 128, 119, 119,
-     97,  99, 114, 120, 121, 125, 151, 157,  82,  89,  95,  96,
-    128,  94, 130,  95, 149, 113, 149, 120, 127, 115, 113, 109,
-    167, 171,  83,  80,  84,  79, 106, 106, 112, 110, 107, 108,
-    130, 139,  81,  88, 107, 106, 112, 112, 119, 118, 114, 112,
-    108, 105, 100,  98, 120, 116, 122, 117,  38,  37,  72,  73,
-    118, 125, 110, 120, 114, 126, 135, 142, 139, 142, 118, 119,
-    119, 119, 156, 145,  78,  75,  94,  94, 112, 110, 113, 113,
-    101, 108,  98, 104, 103, 109, 117, 118, 167, 167, 132, 132,
-    116, 108, 118, 111, 149, 136,  85,  74,  95,  92, 113, 112,
-     74,  69, 104, 107,  96, 100, 117, 121, 103, 105, 103, 103,
-    110, 106, 111, 101,  82,  72,  96,  92, 132, 130, 120, 121,
-    116, 113, 138, 139, 104, 103, 131, 131,  68,  69,  92,  92,
-     97,  97, 146, 151, 122, 132,  97,  95, 117, 116, 115, 116,
-    139, 134, 110, 110, 124, 129, 100, 110,  86,  91, 100, 102,
-    116, 136,  88,  90, 137, 139, 103, 114, 114, 117, 111, 110,
-     82,  83, 104, 102,  97,  99,  97,  97,  58,  56,  84,  84,
-     83, 122,  76, 105, 112, 126, 120, 134, 112, 120, 108, 110,
-    114, 128,  73,  90,  72,  76,  98, 100,  95,  96, 101, 102,
-    101, 108, 118, 126,  94, 102,  81,  83, 138, 140, 131, 130,
-     88, 100, 112, 124, 105, 106, 122, 123, 121, 121, 114, 114,
-     76, 108,  73,  83,  93,  95, 110, 111,  98,  99, 103, 103,
-    105, 112,  98, 108, 114,  95, 117,  98, 120, 116, 116, 115,
-    231, 238, 150, 146, 124, 126, 115, 122, 117, 121, 112, 112,
-     74,  73,  72,  74,  60,  61,  62,  61,  85,  85, 101, 101,
-     67,  69,  50,  51,  83,  83, 110, 110, 118, 113, 112, 111,
-    199, 124, 184, 115, 176, 117, 165, 120, 138, 115, 116, 114,
-     52, 116,  36, 107,  49,  99,  72, 106,  91, 107, 104, 105,
-    140, 138, 141, 135, 154, 147, 166, 159, 139, 136, 116, 115,
-    130, 119, 180, 157, 183, 149, 136, 121, 119, 114, 111, 110,
-    104, 129, 113, 154, 111, 148, 108, 132, 105, 117, 106, 111,
-    114,  35,  99,  65, 113,  94, 110,  98, 111, 107, 107, 106,
-    106, 110, 128, 135, 162, 175, 143, 155, 115, 116, 109, 109,
-    168, 155, 112, 109, 125, 125, 126, 122, 126, 124, 111, 112,
-    128,  96, 160,  77, 151,  77, 121,  80, 114,  94, 107, 103,
-     97, 104, 101, 116,  56,  79,  74,  83,  92,  95, 104, 106,
-     63,  68,  76,  77, 110, 107,  96,  90,  85,  83,  97,  96,
-    116, 110,  46,  42, 103, 100, 122, 120, 102, 101, 104, 104,
-    106, 101, 109,  98,  96,  61,  67,  35,  72,  61,  96,  93,
-     88,  80,  81,  76, 113, 110, 144, 143,  88,  89,  93,  94,
-     95,  96, 100, 101, 136, 132, 166, 160, 148, 147, 115, 116,
-     80,  78, 130, 129, 120, 108,  91,  85,  95,  91, 104, 102,
-    151, 147, 106, 109, 110, 110,  64,  69,  68,  67,  96,  96,
-     90, 166,  97, 128,  99, 120, 104, 121, 109, 118, 105, 109,
-    122, 138, 110, 143,  75,  97,  83,  94,  89,  94, 102, 103,
-    136, 142, 103, 110,  83,  89,  99, 101, 138, 138, 120, 122,
-    168,  88, 105,  90, 109, 107, 110, 111, 106, 105, 103, 102,
-     68,  72, 102, 104,  92, 102,  65,  75,  89,  94, 106, 106,
-     83,  74,  93,  85,  73,  66, 106, 102, 100,  92,  99,  97,
-     93,  99, 101,  96, 116, 112, 125, 120,  88,  88,  96,  96,
-     44,  98,  93, 115, 104, 116, 103, 107, 112, 113, 107, 107,
-     93,  83, 105,  99,  93,  84, 127, 125, 141, 143, 117, 118,
-    106, 103, 126, 121, 137, 123, 123, 114, 147, 142, 127, 123,
-    103, 110,  89,  91, 121, 124,  66,  71,  68,  69,  96,  97,
-    114, 105,  68,  65,  69,  67,  96,  94, 131, 130, 123, 121,
-    111, 104, 130, 121,  95,  95,  72,  74,  88,  88, 105, 104,
-    135, 124, 110,  98, 114, 111, 159, 158, 111, 113, 104, 106,
-    103, 108,  94, 107,  55,  57, 115, 118, 121, 122, 111, 111,
-     97,  99, 106, 111, 119, 126,  59,  62, 111, 112, 124, 125,
-     86,  93, 100, 110, 118, 145, 113, 132, 120, 125, 112, 112,
-    101, 115,  78, 149,  81, 114, 111, 121, 108, 112, 107, 108,
-    104, 104,  94,  96,  84,  83, 135, 132,  71,  69,  88,  86,
-    100,  98,  62,  60,  81,  80,  90,  89,  63,  66,  89,  90,
-    123, 116, 108,  99,  90,  86,  91,  92,  65,  65,  88,  88,
-     84,  79, 115, 109, 123, 111,  99,  99, 134, 136, 121, 123,
-    127, 137,  84,  88, 104, 107, 128, 130,  74,  69,  89,  89,
-    118, 112, 143, 132, 141, 131, 113, 113,  99, 102, 104, 105,
-    117, 115, 100,  99, 131, 126,  90,  88, 145, 144, 128, 127,
-    112, 114, 131, 133,  85,  84, 118, 119, 151, 152, 117, 117,
-    110, 105, 162, 140, 116, 107, 140, 134, 124, 122, 113, 113,
-    107, 110, 124, 133,  98, 103,  99, 107, 109, 113, 112, 112,
-    115, 105,  82,  77, 125, 122, 133, 132, 118, 120, 113, 113,
-    101,  88,  84,  80,  97,  99,  91,  91,  94,  94, 101, 100,
-    121,  86, 139, 108, 106,  93, 103,  99, 112, 108, 108, 107,
-    113,  83, 105, 102, 125, 125, 114, 115, 110, 112, 108, 109,
-     93, 112, 113, 121, 125, 131, 101, 101, 107, 109, 111, 111,
-     98, 102, 117, 126,  80,  84, 107, 109,  83,  84,  96,  97,
-    132, 136, 112, 118,  94,  93, 121, 118,  99,  98, 102, 103,
-    122, 127, 128, 133, 118, 104, 102,  88, 100,  94, 104, 102,
-    115, 116, 102, 105, 140, 142, 135, 130,  90,  88, 100, 101,
-     94,  86, 112, 112,  89, 121,  92, 101, 109, 108, 110, 112,
-     99,  93, 129, 114, 109,  99, 131, 119, 102,  97, 103, 103,
-    103, 116, 124, 101, 115,  95, 105, 101,  94,  91, 100, 100,
-    113,  90,  94,  86,  92,  92, 117, 111, 106, 103, 106, 105,
-    115,  99, 110,  91, 107, 104,  81,  90, 108, 113, 112, 113,
-    113, 114,  93, 101, 101, 102, 101, 126,  93, 103, 104, 105,
-    117, 106, 124, 107, 104, 119, 108, 133, 104, 111, 104, 106
-};
-
-static const float wmavoice_lsp10_intercoeff_a[32][2][10] = {
-    { {  0.5108627081,  0.0480548441, -1.5099149644,  0.6736935377,
-         0.7536551058,  0.7651474178,  0.8510628343,  0.6667704582,
-         0.7576012611,  0.7091397047 },
-      {  0.1351471841, -0.1965375543, -1.6313457787,  0.3218626380,
-         0.4132472873,  0.4663473070,  0.5805781186,  0.3962165117,
-         0.4818550050,  0.4907165468 } },
-    { {  0.8556320667,  0.7774704993, -0.0175759494, -0.1882298589,
-         0.1892164350,  0.4850396216,  0.6270319819,  0.6327089071,
-         0.6513319910,  0.6075088978 },
-      {  0.4374088347,  0.3505934179, -0.0762144327, -0.2830760479,
-        -0.0626451969,  0.1500318050,  0.2602472305,  0.2781780064,
-         0.3167395592,  0.3596626520 } },
-    { {  0.1899779737,  0.0650856197,  0.1699010432,  0.9122628570,
-         0.9097705483,  0.7433397174,  0.6304935217,  0.5164704025,
-         0.4174703658,  0.5215242505 },
-      {  0.0704856217,  0.0169009864,  0.0188394487,  0.5587704182,
-         0.5194473267,  0.3539164960,  0.2426626086,  0.1721164286,
-         0.1371548772,  0.2594856918 } },
-    { {  0.8858859241,  0.9100474715,  0.8921859264,  0.9332397878,
-         1.0225475132,  1.0555013716,  1.0983552337,  1.1290244758,
-         1.0363244414,  0.9277705550 },
-      {  0.4810934663,  0.5782935023,  0.6835935414,  0.7650781870,
-         0.9018090069,  0.9996321201,  1.0219936669,  1.0474705994,
-         0.9109474719,  0.7774704993 } },
-    { {  0.4359549880,  0.2275702953,  0.0993548632,  0.1763395071,
-         0.1055856347,  0.1018471718,  0.1170087159,  0.1221317947,
-         0.1834010482,  0.2988780141 },
-      {  0.1573702693,  0.1041317880,  0.0506856143,  0.0781702399,
-         0.0058932900, -0.0026913285, -0.0031067133,  0.0070702136,
-         0.0116394460,  0.0566394627 } },
-    { {  0.8528628349,  0.8028782010,  0.4680088460,  0.9055474699,
-         1.3742399514,  1.1093629301,  0.4122780561,  0.4003703594,
-         0.6360319853,  0.6415704489 },
-      {  0.4252934456,  0.3823703527,  0.1676856577,  0.5241550207,
-         1.1995706558,  0.9088013172,  0.1224087179,  0.0730471611,
-         0.3071857095,  0.3772472739 } },
-    { {  0.5508781075,  0.2829549313, -0.0022067130,  0.1042702496,
-         1.0318244398,  1.3258476257,  1.3550630212,  0.9931936562,
-         0.7195243239,  0.6807550788 },
-      {  0.2679318488,  0.0960317850, -0.1357529163, -0.1291759908,
-         0.6451012194,  0.9968628883,  0.9510321021,  0.6608166099,
-         0.3799472749,  0.3735780418 } },
-    { {  0.9967244267,  1.0255244374,  0.9800398052,  0.7939474285,
-         0.8288397491,  0.8390166759,  0.8660166860,  0.9247936308,
-         0.9127474725,  0.8684397638 },
-      {  0.7921474278,  0.9416859448,  0.8547320664,  0.5348165631,
-         0.6231550574,  0.6703012288,  0.6987550855,  0.8147858977,
-         0.7406397164,  0.6496012211 } },
-    { {  0.1439394951, -0.3193529844, -0.2024914026, -0.1854606271,
-         0.0877240896,  0.1617318094,  0.3087087870,  0.3777318895,
-         0.3910242021,  0.4797780812 },
-      { -0.0157067180, -0.1778452396, -0.1554836929, -0.1759760082,
-        -0.0607759655, -0.0161221027,  0.0393317640,  0.0758856237,
-         0.1163856387,  0.1947548985 } },
-    { {  1.1021629274,  0.9958244264,  0.4658626914,  0.3089164793,
-         0.3740626574,  0.2962472439,  0.3170857131,  0.2420395315,
-         0.2649549246,  0.2936857045 },
-      {  0.4700857699,  0.1809087396,  0.0311625302,  0.0106009841,
-         0.0311625302,  0.0266625285,  0.0221625268,  0.0156548321,
-         0.0551163852,  0.1010164022 } },
-    { {  0.2925087810,  0.3418011069,  0.7339243293,  0.7322627902,
-         0.7288704813,  0.7924935818,  0.7724166512,  0.7819012702,
-         0.8325782120,  0.7954705060 },
-      {  0.0559471548, -0.0456144214, -0.0462374985, -0.1005144417,
-        -0.0511528850, -0.0455451906, -0.0044220984,  0.0451471508,
-         0.1232394874,  0.2085318267 } },
-    { {  0.2230702937, -0.9052532017,  1.2441552877,  1.0825706124,
-         0.9088705480,  0.8797243834,  0.8648397624,  0.8091089725,
-         0.7633474171,  0.7468704879 },
-      { -0.2030452490, -1.4167303145,  1.3542322516,  0.8369397521,
-         0.6148473620,  0.5560704172,  0.5450627208,  0.4978473186,
-         0.4200319052,  0.4904396236 } },
-    { {  0.6088242829,  0.5965704322,  0.6547242999,  0.8554936051,
-        -0.2989298999,  0.2404472232,  0.3573780358,  0.7499166429,
-         0.7691628039,  0.6824858487 },
-      {  0.2582395375,  0.2721549273,  0.3462318778,  0.4820626974,
-        -0.4780299664, -0.0712990463,  0.0200163722,  0.4246703684,
-         0.4660011530,  0.4172626734 } },
-    { {  1.1749937236,  1.0773090720,  1.0566782951,  1.0249013603,
-         0.9947167337,  0.9626628757,  0.9562244117,  0.9072782397,
-         0.7654243410,  0.6448935270 },
-      {  1.1595552564,  0.9340013266,  0.3959395885,  0.3693549633,
-         0.3915780485,  0.3104395568,  0.3499011099,  0.2236933708,
-         0.1638087332,  0.1811856627 } },
-    { {  0.9572628736,  0.9389859438,  0.6619243026,  0.6849089265,
-         0.7276935577,  0.7839781940,  0.7987243533,  0.7748397291,
-         0.7101089358,  0.7277627885 },
-      {  0.5809935033,  0.5575934947,  0.3544703424,  0.3636780381,
-         0.3736472726,  0.4486242235,  0.4684934616,  0.4481396079,
-         0.3456780314,  0.4478626847 } },
-    { {  0.1259394884,  1.3096476197,  1.0794552267,  1.0009475052,
-         0.9061013162,  0.9216782451,  0.8954397738,  0.9160013199,
-         0.8575012982,  0.7479089499 },
-      { -0.3689222336,  1.5293861628,  0.7323320210,  0.4102703631,
-         0.3825780451,  0.2828164697,  0.2644010782,  0.2455010712,
-         0.2482010722,  0.2335241437 } },
-    { {  0.5380704105,  0.1600702703, -0.0657605827, -0.2390452623,
-        -0.3885837793, -0.4150299430, -0.3001760542, -0.1451683044,
-         0.1312010288,  0.2798395455 },
-      {  0.2074933648,  0.0560163856, -0.0956682861, -0.2893068194,
-        -0.3889991641, -0.3918376267, -0.3550068438, -0.2649375796,
-        -0.0554451942,  0.1167317927 } },
-    { {  0.6092396677,  0.5101011693,  0.4012011290,  0.5416011810,
-         0.5715781152,  0.6476627588,  0.6988243163,  0.7306012511,
-         0.7531704903,  0.6534781456 },
-      {  0.2060395181,  0.1409625709,  0.1024702489,  0.1834010482,
-         0.1946856678,  0.2547779977,  0.3134857118,  0.3283011019,
-         0.3837549686,  0.3501780331 } },
-    { {  0.4516011477,  0.5351627171,  0.8068243563,  0.7049858570,
-         0.7165473998,  0.6005858183,  0.4870473146,  0.2500010729,
-         0.3132087886,  0.4462703764 },
-      {  0.1053087115,  0.1348702610,  0.4457857609,  0.3499703407,
-         0.3537780344,  0.2628780007,  0.1665087342,  0.0200856030,
-         0.0329625309,  0.1525241137 } },
-    { {  0.7058166265,  0.7305320203,  1.1684860289,  1.4524707496,
-         1.3212091625,  1.2613245249,  1.1712552607,  1.1154552400,
-         1.0487167537,  0.9153782427 },
-      {  0.2286087573,  0.2851703167,  1.2016475797,  1.5154707730,
-         1.2726091444,  1.1459167898,  0.9801090360,  0.9296397865,
-         0.8490551412,  0.6772243083 } },
-    { {  0.6686396897,  0.5728935003,  0.4734780788,  0.6970243156,
-         0.5852165818, -0.0762836635, -0.2054683268, -0.1380375326,
-         0.1282933354,  0.3467164934 },
-      {  0.2925087810,  0.2344933748,  0.1677548885,  0.2747856975,
-         0.2097087502, -0.2795452774, -0.3761222363, -0.3183837533,
-        -0.0834836662,  0.1482318044 } },
-    { {  0.6559704542,  0.7737320364,  0.9867551923,  0.9912551939,
-         0.9508936405,  0.9114320874,  0.8336859047,  0.7905551195,
-         0.7672935724,  0.7532397211 },
-      {  0.1843702793,  0.2565087676,  0.7571858764,  0.7545551062,
-         0.6793704629,  0.5981627405,  0.5078165531,  0.4282011390,
-         0.3948318958,  0.4502165318 } },
-    { {  0.4430857599,  0.6102781296,  0.8485012949,  0.8573628366,
-         0.9078320861,  0.9979705811,  1.0411013663,  1.0524552166,
-         1.0194321275,  0.9023628533 },
-      {  0.0070009828,  0.0084548295,  0.1613856554,  0.3484472632,
-         0.4385857582,  0.5895088911,  0.6367935240,  0.6736935377,
-         0.7026320100,  0.5924165845 } },
-    { {  1.0532859862,  1.1059706211,  1.1311013997,  1.1250783205,
-         1.0425552130,  0.9993551970,  0.9673013389,  0.9386397898,
-         0.8836013079,  0.8336859047 },
-      {  0.9791398048,  1.1481321752,  1.1275706291,  1.0082167387,
-         0.8809705377,  0.8031551242,  0.7287320197,  0.6496704519,
-         0.5211088657,  0.4734088480 } },
-    { { -0.0251221061, -0.0443682671,  0.1282241046,  0.3850703537,
-         0.4252934456,  0.4547857642,  0.4690473080,  0.4873242378,
-         0.6001012027,  0.5882627368 },
-      { -0.0562759638, -0.0246374905,  0.0070009828,  0.0971394777,
-         0.1232394874,  0.1278779507,  0.1302317977,  0.1462241113,
-         0.2073549032,  0.2446010709 } },
-    { {  1.1749244928,  1.1155937016,  0.9236167073,  0.6288319826,
-         0.6515396833,  0.5391781032,  0.5398011804,  0.4997165501,
-         0.4066703618,  0.3998857439 },
-      {  0.9403013289,  0.7346166372,  0.1841625869,  0.1319625676,
-         0.1395087242,  0.0857856274,  0.0952702463,  0.0860625505,
-         0.0829471648,  0.1132010221 } },
-    { {  0.9047167003,  0.9840551913,  0.9933321178,  0.9360090196,
-         0.9164859354,  0.9213320911,  0.8701705337,  0.8815936148,
-         0.8414397538,  0.8188012838 },
-      {  0.0961010158, -0.0147374868,  0.0202240646,  0.1002548635,
-         0.1407548785,  0.1837472022,  0.1858241260,  0.2064549029,
-         0.2228626013,  0.2859318554 } },
-    { {  0.4034165144,  0.1918472052,  2.1959402561,  0.4763165414,
-         0.6577012241,  0.7036704719,  0.6626858413,  0.7650089562,
-         0.7702704966,  0.6543781459 },
-      {  0.0940933228, -0.1222529113,  2.3491480052,  0.1385394931,
-         0.3052472472,  0.3665857315,  0.3350857198,  0.4722319245,
-         0.4313857555,  0.3846549690 } },
-    { {  0.8215012848,  0.8613782227,  1.0399936736,  1.4082322717,
-         0.4075011313,  0.4091626704,  0.5230473280,  0.6101396680,
-         0.7510243356,  0.7237474024 },
-      {  0.4810934663,  0.5670088828,  0.9207782447,  1.3007860780,
-         0.0453548431,  0.0858548582,  0.1803548932,  0.2790087759,
-         0.3974626660,  0.4581780732 } },
-    { {  1.5921784937,  1.4987169206,  1.1321398616,  0.8235089779,
-         0.6888550818,  0.6621319950,  0.6192089021,  0.6533396840,
-         0.7196627855,  0.6549319923 },
-      {  1.5911400318,  1.4768399894,  0.9358705580,  0.4674549997,
-         0.3522549570,  0.3144549429,  0.2985318601,  0.3559241891,
-         0.4061857462,  0.3958703578 } },
-    { {  0.7975474298,  0.8712782264,  0.8974474669,  0.3008164763,
-         0.5562088788,  0.6655935347,  0.8921166956,  1.0918475389,
-         0.9544936419,  0.8554936051 },
-      {  0.3769703507,  0.4930703938,  0.6619243026, -0.0382759571,
-         0.1766856611,  0.3015780151,  0.5952550471,  0.8903859258,
-         0.7395320237,  0.6205935180 } },
-    { {  0.2206472158,  2.4467634261,  1.2920629978,  1.0239321291,
-         0.9014628530,  0.8552166820,  0.8219859004,  0.9005628526,
-         0.7614781857,  0.7763628066 },
-      { -0.2722068131,  2.8967635930,  1.3039706945,  0.7695089579,
-         0.6132550538,  0.5701242685,  0.5737935007,  0.6533396840,
-         0.5422934890,  0.5150857866 } },
-};
-
-static const float wmavoice_lsp10_intercoeff_b[32][2][10] = {
-    { {  0.4881048799, -0.1998192370, -0.3872502148,  0.0109423101,
-         0.0406953394,  0.1788437665,  0.1673750877,  0.3409781158,
-         0.4061202109,  0.5221177042 },
-      {  0.1492218077, -0.1372330189, -0.2683691680, -0.0621950924,
-        -0.0624572337, -0.0068177581, -0.0076041818,  0.0680235624,
-         0.1055752933,  0.1199930608 } },
-    { {  0.7934338748,  0.0012430847,  0.4239458144,  0.5521328747,
-         0.6497149467,  0.6423749924,  0.7170197070,  0.7169541717,
-         0.7778364718,  0.8397018015 },
-      {  0.2768190503, -0.0491535664, -0.0325731337,  0.0261465013,
-         0.0469867289,  0.0649434030,  0.0781815350,  0.1031504869,
-         0.1194687784,  0.2451654971 } },
-    { {  0.7212139666,  0.1658677757,  0.0101558864,  0.5636015534,
-         1.3175852597,  1.1911676526,  1.1266809106,  0.8230558336,
-         0.8604109585,  0.8094900250 },
-      {  0.3658815324,  0.0816549063, -0.2092563212,  0.1946377754,
-         1.0856558084,  0.9491457641,  0.8461242616,  0.5193652213,
-         0.5975488424,  0.5293265879 } },
-    { {  0.9507186115,  0.9078585207,  0.8773190677,  0.8677509129,
-         0.8024122119,  0.8127667904,  0.8246286809,  0.8779088855,
-         0.9454102516,  0.9863698184 },
-      {  0.6883807778,  0.6900191605,  0.7059442401,  0.6552854478,
-         0.5843107104,  0.5553441048,  0.5887671113,  0.6494528055,
-         0.7725936472,  0.7792782485 } },
-    { {  0.2399882078,  0.1938513517,  0.4441962242,  0.4475385249,
-         0.3055235147,  0.1745184362,  0.1174371839,  0.0679580271,
-         0.0782470703,  0.1695377529 },
-      {  0.0170370936,  0.0253600776,  0.2072205544,  0.1907711923,
-         0.1096384823,  0.0327000320, -0.0134368241, -0.0461389422,
-        -0.0372916758, -0.0243156850 } },
-    { {  0.5457104146,  0.3774812818,  0.5235594809,  0.2994287312,
-         0.2394639254,  0.5731041729,  0.9971176088,  1.1646913886,
-         0.9028123021,  0.7777709365 },
-      {  0.2288472056,  0.1181580722,  0.2074171603,  0.0355180502,
-        -0.0024924278,  0.2596487999,  0.7474936247,  0.9103488624,
-         0.5927647650,  0.4772915542 } },
-    { {  0.6541713476,  0.6412608922,  0.7625012100,  0.7826205492,
-         0.4839106202,  0.3311478198,  0.4577620327,  0.8572652638,
-         0.9442306161,  0.8282986581 },
-      {  0.2852075696,  0.2614837885,  0.4221763611,  0.4314823747,
-         0.1434547007,  0.0435788929,  0.1397191882,  0.5525916219,
-         0.6752081811,  0.5487250388 } },
-    { {  0.6742251515,  1.0610800683,  1.0500701368,  0.9570100009,
-         0.9325653315,  0.9243078828,  0.9148707986,  0.8317720294,
-         0.7696445584,  0.6784849465 },
-      {  0.2283884585,  0.9739181101,  0.5336519182,  0.4974764287,
-         0.3998288214,  0.3674543798,  0.2719694376,  0.2608939707,
-         0.2087934017,  0.1675716937 } },
-    { {  0.3736146986, -1.5457833707,  0.9216864705,  0.7959242165,
-         0.7358283401,  0.7233110964,  0.7271121442,  0.6852350831,
-         0.6891672015,  0.6589554250 },
-      {  0.1246460676, -1.7167649865,  0.7037160397,  0.4803061783,
-         0.4694928527,  0.4654951990,  0.5208069980,  0.5305717587,
-         0.5288023055,  0.5278192759 } },
-    { {  1.0116009116,  0.9882703424,  0.8393741250,  0.8889843524,
-         0.8934407532,  0.8906227350,  0.9222107530,  0.8973073363,
-         0.9257496595,  0.9306648076 },
-      {  0.5097970665, -0.0106843412,  0.1419473886,  0.2804890275,
-         0.3719763160,  0.3694859743,  0.4640534222,  0.5034401417,
-         0.5592106879,  0.6652468145 } },
-    { {  0.9718209803,  0.7615181804,  0.2172474563,  0.4920369983,
-         0.4310891628,  0.5038333535,  0.4668059051,  0.5339140594,
-         0.4453758597,  0.4050061107 },
-      {  0.6543679535,  0.1205173433, -0.0050483048,  0.1580035388,
-         0.1308719218,  0.1700620353,  0.1740596890,  0.2179683447,
-         0.1967349052,  0.1703897119 } },
-    { {  0.7663022578,  0.4025157690,  1.3811545074,  1.1642981768,
-         1.0709758997,  0.9812580645,  1.0092416406,  0.9089070857,
-         0.7776398659,  0.8189926445 },
-      {  0.3471384346,  0.0602248609,  1.3968829811,  1.0841484964,
-         0.8940305710,  0.7313719392,  0.7345176339,  0.5304406881,
-         0.4076275229,  0.4535677731 } },
-    { {  0.1300854981,  0.1323136985,  0.7564064264,  0.7335346043,
-         0.7924508452,  0.6039057672,  0.6896914840,  0.3694859743,
-         0.2825861573,  0.3179096878 },
-      { -0.0208423138, -0.0530856848,  0.3449102342,  0.3819376826,
-         0.4466865659,  0.2807511687,  0.3842969537,  0.1144880950,
-         0.0617321730,  0.0767397583 } },
-    { {  0.7559476793,  0.8462553322,  0.6452585459,  1.1308751702,
-         1.0606868565,  0.9498666525,  0.7425129414,  0.6221901178,
-         0.6574481130,  0.6976212561 },
-      {  0.3420922160,  0.4310236275,  0.2800958157,  0.9317133725,
-         0.8210897744,  0.6144569516,  0.3227593005,  0.2464762032,
-         0.2769501209,  0.3521846533 } },
-    { {  0.7609938979,  0.6943444908,  1.1490939856,  0.4350868165,
-         0.6101971567,  0.6246149242,  0.7370079756,  0.6522052884,
-         0.6966382265,  0.7565374970 },
-      {  0.3939306438,  0.3449102342,  0.9874839187,  0.0910919905,
-         0.2804234922,  0.2888775468,  0.4060546756,  0.3284608722,
-         0.3483836055,  0.4819445610 } },
-    { {  0.7828826904,  1.1833034158,  1.9916158915,  0.8667678833,
-         0.9218830764,  0.8856420517,  0.9373494089,  0.7415299118,
-         0.7450032830,  0.7074515522 },
-      {  0.4685098231,  1.1713104546,  1.9853245020,  0.6206828058,
-         0.6664264500,  0.6033814847,  0.6089519858,  0.3784643114,
-         0.4212588668,  0.3441893458 } },
-    { {  0.4671335816,  0.4177199602,  0.0804097354, -0.1836975515,
-        -0.1802241802, -0.0775958896, -0.0250365734,  0.0884050429,
-         0.2136430144,  0.3472039700 },
-      {  0.1187478900,  0.1122598946, -0.0381436348, -0.2284581661,
-        -0.2302276194, -0.1738672554, -0.1350048184, -0.0547896028,
-         0.0000634491,  0.0545888245 } },
-    { {  0.5545576811,  0.4791920781,  0.8204999566,  0.8462553322,
-         0.9212277234,  0.8946203887,  0.9659883380,  0.9137566984,
-         0.9225384295,  0.9207034409 },
-      {  0.1176993251, -0.0429277122, -0.0330318809,  0.0566859543,
-         0.0983008742,  0.1593797803,  0.1732077301,  0.2320584357,
-         0.2739354968,  0.3753186166 } },
-    { {  0.7157745361,  0.6367389560, -1.2036890686,  0.7107283175,
-         0.6885118484,  0.7332724631,  0.7436270416,  0.7113181353,
-         0.5935511887,  0.6023984551 },
-      {  0.3664058149,  0.3280676603, -1.3082178831,  0.3909815550,
-         0.3641776145,  0.3926854730,  0.3898674548,  0.4086760879,
-         0.3127979338,  0.3949792087 } },
-    { {  1.0267395675,  1.0621941686,  1.0415505469,  0.9971176088,
-         0.9764739871,  0.9904330075,  0.9591071308,  0.9338760376,
-         0.9026156962,  0.9073997736 },
-      {  0.9855833948,  1.0548542142,  0.9787021875,  0.8573307991,
-         0.8360973597,  0.8193203211,  0.7386463583,  0.7038471103,
-         0.6333966553,  0.6434235573 } },
-    { {  0.6235008240,  0.7635497749,  0.8094900250,  0.7227212787,
-        -0.0610809922, -0.1357912421, -0.2359291911,  0.0800165236,
-         0.3972729445,  0.5078965425 },
-      {  0.2983146310,  0.4983939230,  0.4145742655,  0.3284608722,
-        -0.3203386664, -0.3495018780, -0.4734291434, -0.1808139980,
-         0.1211071610,  0.2001427412 } },
-    { {  0.8925887942,  0.8804647624,  0.6153089106,  0.6760601401,
-         0.7887153327,  1.0065546930,  1.0829033256,  1.0347348750,
-         0.9800128937,  0.9125770628 },
-      {  0.5955827832,  0.6195687056,  0.2924164534,  0.3553958833,
-         0.5417127609,  0.8713553548,  0.9977729619,  0.8817754686,
-         0.7645328045,  0.6604627371 } },
-    { {  1.1581378579,  1.0359145105,  0.7731179297,  0.6839243770,
-         0.6839899123,  0.6664264500,  0.6910677254,  0.6579068601,
-         0.6779606640,  0.6243527830 },
-      {  1.1508634388,  0.8400294781,  0.2358594835,  0.2542749047,
-         0.2484422624,  0.2620736063,  0.2676441073,  0.2713796198,
-         0.3068997562,  0.3223005533 } },
-    { {  0.1376220584,  1.2572927773,  0.8593623936,  0.6218624413,
-         0.5128116906,  0.5393534899,  0.4436064065,  0.4334484339,
-         0.4494390488,  0.4002220333 },
-      { -0.1159995794,  1.2433337569,  0.4805027843,  0.2632532418,
-         0.1769432425,  0.1868390739,  0.1555131972,  0.1530228555,
-         0.1490252018,  0.1559064090 } },
-    { {  0.1817273200, -0.0085216761,  0.0739872754,  0.1808098257,
-         0.2770811915,  0.3344901204,  0.4292541742,  0.5404020548,
-         0.5780193210,  0.5707449019 },
-      { -0.0035409927, -0.0188107193, -0.0057691932,  0.0132360458,
-         0.0560961366,  0.0534747243,  0.1002013981,  0.1737320125,
-         0.1706518531,  0.1637706459 } },
-    { {  0.9648087025,  1.0030813217,  0.9501943290,  0.8381944895,
-         0.7545059025,  0.7621735334,  0.7121700943,  0.7328792512,
-         0.7534573376,  0.7414643764 },
-      {  0.1872322857, -0.0081939995,  0.0663851798,  0.0963348150,
-         0.0509188473,  0.0565548837,  0.0471833348,  0.0809340179,
-         0.1049199402,  0.1751082540 } },
-    { {  0.6792713702,  0.9521603882,  0.5296542645,  0.3657504618,
-         0.3905883431,  0.3121425807,  0.2726903260,  0.3156159520,
-         0.2859284580,  0.3179096878 },
-      {  0.2307477295,  0.3771536052,  0.0743804872,  0.0260154307,
-         0.0477731526,  0.0391880274,  0.0228042006,  0.0572757721,
-         0.0337485969,  0.0492149293 } },
-    { {  0.8649328947,  0.9505875409,  1.0443030298,  1.1704584956,
-         1.2709241211,  1.3232212961,  1.2477901578,  1.1513877213,
-         1.0346038043,  0.9695272446 },
-      {  0.4620873630,  0.5685822368,  0.8975039423,  1.0476453304,
-         1.2278674245,  1.2290470600,  1.1962138712,  1.0051129162,
-         0.8706344664,  0.7477557659 } },
-    { {  0.4188340604,  0.6011532843,  0.4726385474,  0.6389671564,
-         0.6753392518,  0.7842589319,  0.6147846282,  0.6708828509,
-         0.6406055391,  0.5398777723 },
-      {  0.1012499630,  0.2312064767,  0.1773364544,  0.2800302804,
-         0.3348177969,  0.4343003929,  0.2822584808,  0.3293128312,
-         0.3024433553,  0.2401848137 } },
-    { {  0.5049474537,  0.7943513691,  0.9536021650,  0.9407572448,
-         0.9823721647,  0.9747045338,  1.0145500004,  0.9629737139,
-         0.9526191354,  0.9283710718 },
-      {  0.0566204190,  0.0973178446,  0.5812305510,  0.5687133074,
-         0.6834000945,  0.6616423726,  0.7611905038,  0.6683925092,
-         0.6463071108,  0.6118355393 } },
-    { {  0.8969141245,  0.9359731674,  0.8756151497,  0.8419300020,
-         0.8353109360,  0.6807131469,  0.3358008265,  0.3386188447,
-         0.3524467945,  0.4495045841 },
-      {  0.5298508704,  0.4606455863,  0.4934132397,  0.4415748119,
-         0.4015327394,  0.2052544951, -0.0329663455, -0.0154684186,
-         0.0418094397,  0.1631152928 } },
-    { {  0.6345762908,  2.5209445655,  1.0373562872,  0.9166402519,
-         0.8865595460,  0.8907538056,  0.8522190452,  0.7290782034,
-         0.7385808229,  0.6345107555 },
-      {  0.2641707361,  2.5696372986,  0.8539884984,  0.6532538533,
-         0.6087553799,  0.5851626694,  0.5276226699,  0.4330552220,
-         0.3971418738,  0.3599833548 } },
-};
-
-static const float wmavoice_lsp16_intercoeff_a[32][2][16] = {
-    { {  0.5337238312,  0.4810695648, -0.3766536713, -0.1204767227,
-        -0.0898437500, -0.0070896149,  0.1134738922,  0.1337728500,
-         0.3739156723,  0.3849058151,  0.4220180511,  0.5404901505,
-         0.5224876404,  0.5502910614,  0.5313453674,  0.4405946732 },
-      {  0.1775283813,  0.1679325104, -0.2702789307, -0.1359367371,
-        -0.1452455521, -0.0888595581, -0.0256662369, -0.0023736954,
-         0.1074047089,  0.1431636810,  0.1357412338,  0.2045526505,
-         0.2686481476,  0.3404531479,  0.3209333420,  0.1493968964 } },
-    { {  0.7402400970,  0.0838251114,  0.6486282349,  0.6145095825,
-         0.7331047058,  0.7183008194,  0.7436847687,  0.7627944946,
-         0.7653779984,  0.7795667648,  0.8399305344,  0.8393154144,
-         0.8219690323,  0.7474164963,  0.6681070328,  0.6490793228 },
-      {  0.2850513458, -0.0544128418, -0.0300130844,  0.0204677582,
-         0.0328931808,  0.0589332581,  0.0796422958,  0.1187639236,
-         0.1320505142,  0.1539077759,  0.2189874649,  0.2865276337,
-         0.2973947525,  0.2614307404,  0.2416648865,  0.2428951263 } },
-    { {  0.6129922867,  0.7300701141,  0.2073822021,  0.5005893707,
-         0.5713691711,  0.5374965668,  0.6293134689,  0.5639057159,
-         0.7402811050,  0.6982889175,  0.4668397903,  0.6698703766,
-         0.8758535385,  0.8678569794,  0.8678569794,  0.7810840607 },
-      {  0.2986249924,  0.3269615173,  0.0096416473,  0.1800708771,
-         0.2474060059,  0.2203407288,  0.3007984161,  0.2674179077,
-         0.4424810410,  0.4046306610,  0.2063980103,  0.4230022430,
-         0.6222190857,  0.6574449539,  0.6776618958,  0.6604385376 } },
-    { {  0.7258052826,  0.5073966980, -0.3947381973,  0.5254812241,
-         1.0561246872,  0.9706230164,  0.9727144241,  0.9185838699,
-         0.8184833527,  0.9093980789,  0.8645353317,  0.7870302200,
-         0.6347675323,  0.5123996735,  0.2846002579,  0.3252801895 },
-      {  0.4306297302,  0.2182903290, -0.4902458191,  0.1783485413,
-         0.7783365250,  0.7152252197,  0.7404451370,  0.6012639999,
-         0.5421304703,  0.6619558334,  0.6316919327,  0.5596818924,
-         0.3952398300,  0.3567333221,  0.1505041122,  0.1290159225 } },
-    { {  0.3077287674,  0.2543363571,  0.2834520340,  0.5282287598,
-         0.5350360870,  0.4943971634,  0.4521999359,  0.3086309433,
-         0.2372770309,  0.0819387436, -0.1385612488, -0.0848407745,
-        -0.0380916595,  0.1192150116,  0.3228197098,  0.3012905121 },
-      {  0.0567188263,  0.0196886063,  0.0682420731,  0.2102527618,
-         0.2452325821,  0.2060699463,  0.1620273590,  0.0784120560,
-         0.0418329239, -0.0508041382, -0.2193880081, -0.1644783020,
-        -0.1361827850, -0.0307512283,  0.1486587524,  0.2356367111 } },
-    { {  0.4387903214,  0.5723943710,  0.6147556305,  0.9973602295,
-         1.1645498276,  1.1898927689,  1.0326681137,  0.6939010620,
-         0.6064310074,  0.4686441422,  0.4646663666,  0.4895582199,
-         0.5654230118,  0.6004848480,  0.6179132462,  0.6439123154 },
-      {  0.1324195862,  0.2426080704,  0.3132238388,  0.7359752655,
-         0.9749288559,  0.9535636902,  0.8105278015,  0.4118890762,
-         0.3013315201,  0.2006158829,  0.2331352234,  0.2535161972,
-         0.3375005722,  0.4103307724,  0.4102897644,  0.4529380798 } },
-    { {  0.7335557938,  0.9203472137,  0.4852113724,  0.8646993637,
-         0.7304391861,  0.7503690720,  0.6289854050,  0.6900463104,
-         0.6421079636,  0.5184278488,  0.4444904327,  0.2660236359,
-         0.2143125534,  0.2406396866,  0.4836940765,  0.5597229004 },
-      {  0.3689947128,  0.4967346191,  0.1176567078,  0.5127687454,
-         0.3235168457,  0.3426265717,  0.2417469025,  0.3310623169,
-         0.2629890442,  0.2130823135,  0.1329116821,  0.0468769073,
-        -0.0081968307,  0.0146446228,  0.2440433502,  0.3408632278 } },
-    { {  0.9425325394,  0.9597969055,  0.6160678864,  0.7050962448,
-         0.8063859940,  0.9063224792,  0.9890356064,  1.0038805008,
-         1.0338163376,  0.9453620911,  0.9634056091,  0.8068370819,
-         0.6859455109,  0.8909034729,  0.9990415573,  1.0122871399 },
-      {  0.6895952225,  0.6451835632,  0.3169965744,  0.4268569946,
-         0.5666122437,  0.7722673416,  0.8845882416,  0.9061584473,
-         0.9550399780,  0.8118810654,  0.8601064682,  0.6129922867,
-         0.5069866180,  0.7065315247,  0.7862920761,  0.7766551971 } },
-    { {  0.5641517639, -0.0941905975,  0.0412998199,  0.1810550690,
-         0.3459482193,  0.4213209152,  0.4401025772,  0.5397109985,
-         0.5607891083,  0.6348905563,  0.6861915588,  0.7280607224,
-         0.7267074585,  0.6447324753,  0.5948257446,  0.5475025177 },
-      {  0.1906919479, -0.0519113541, -0.0608100891, -0.0018815994,
-         0.0383062363,  0.0362558365,  0.0529870987,  0.0692672729,
-         0.0953073502,  0.1327886581,  0.1390628815,  0.1904459000,
-         0.2362518311,  0.2063980103,  0.2311668396,  0.2291574478 } },
-    { {  0.9901428223,  0.9589767456,  0.9012374878,  0.8017930984,
-         0.8929538727,  0.8512077332,  0.8790111542,  0.8832759857,
-         0.8949632645,  0.9159183502,  0.9293279648,  0.9152622223,
-         0.9247350693,  0.8753614426,  0.8730239868,  0.8066730499 },
-      {  0.4230432510, -0.0464572906,  0.0182533264,  0.1159753799,
-         0.2349395752,  0.2740612030,  0.2987070084,  0.3620643616,
-         0.3923282623,  0.4694643021,  0.5202322006,  0.5356512070,
-         0.5564012527,  0.5362663269,  0.4791831970,  0.5046901703 } },
-    { {  0.9785375595,  0.8820457458,  0.3965110779,  0.4790191650,
-         0.3907699585,  0.4195575714,  0.2938270569,  0.4091415405,
-         0.3659191132,  0.4030723572,  0.4168510437,  0.5030908585,
-         0.5023117065,  0.5511522293,  0.5354051590,  0.5563192368 },
-      {  0.6592903137,  0.2933759689,  0.0562677383,  0.1286878586,
-         0.0758285522,  0.1192560196,  0.0508956909,  0.1175336838,
-         0.0684061050,  0.0988750458,  0.0923957825,  0.1819572449,
-         0.1965150833,  0.2257537842,  0.3049812317,  0.2993221283 } },
-    { {  0.7120265961,  0.7847747803,  0.6065950394,  0.7235908508,
-         0.6740531921,  0.6535081863,  0.3734235764,  0.4788551331,
-         0.4410867691,  0.6927528381,  1.0758495331,  1.1148891449,
-         1.0708875656,  0.8896322250,  0.6401805878,  0.5057153702 },
-      {  0.4210338593,  0.4763126373,  0.3229017258,  0.4079113007,
-         0.3922462463,  0.3529195786,  0.1258993149,  0.2168960571,
-         0.2207508087,  0.4605655670,  0.8759355545,  0.9526205063,
-         0.8843832016,  0.7001342773,  0.4503545761,  0.3484086990 } },
-    { {  0.5254402161,  0.5349540710,  0.7036199570,  0.6240234375,
-         0.6464548111,  0.7537727356,  0.8311548233,  0.7334327698,
-         0.3484907150,  0.1846637726,  0.0894021988,  0.3977823257,
-         0.7672233582,  0.9224796295,  0.8818407059,  0.7453250885 },
-      {  0.2587652206,  0.2524499893,  0.4135704041,  0.3129367828,
-         0.3403711319,  0.4473199844,  0.5330266953,  0.4227561951,
-         0.1080198288, -0.0044651031, -0.0727024078,  0.1583776474,
-         0.5302381516,  0.7313823700,  0.6735610962,  0.5630855560 } },
-    { {  0.7936325073,  0.8551034927,  0.9755849838,  0.8953323364,
-         0.9345769882,  0.7202281952,  0.8388233185,  0.7941656113,
-         0.7550849915,  0.7894906998,  0.8590402603,  0.7813711166,
-         0.8483371735,  0.8652324677,  0.8586711884,  0.9584846497 },
-      {  0.4781579971,  0.4731960297,  0.8289403915,  0.6175031662,
-         0.7262973785,  0.3638277054,  0.5544328690,  0.4761896133,
-         0.4388723373,  0.5021476746,  0.5630445480,  0.4562187195,
-         0.5190429688,  0.5937595367,  0.6121721268,  0.6973457336 } },
-    { {  1.0724458694,  1.0449705124,  0.8594503403,  0.7604160309,
-         0.7837905884,  0.8136444092,  0.7623023987,  0.6098756790,
-         0.6432561874,  0.6395244598,  0.6853713989,  0.7401580811,
-         0.7399530411,  0.7652549744,  0.7675104141,  0.7393789291 },
-      {  0.9382266998,  0.8419809341,  0.3087539673,  0.3620233536,
-         0.3547649384,  0.4241094589,  0.2857894897,  0.2123851776,
-         0.2355957031,  0.2794332504,  0.3219995499,  0.3898267746,
-         0.3937635422,  0.4058198929,  0.4228382111,  0.4181222916 } },
-    { {  1.0275421143,  1.0940570831,  1.0164289474,  0.9097671509,
-         0.9400720596,  0.8976287842,  0.9175586700,  0.8900833130,
-         0.9154262543,  0.9492578506,  1.0011329651,  1.0361537933,
-         1.0359487534,  0.9320344925,  0.8974237442,  0.8811845779 },
-      {  1.0046186447,  1.0860195160,  0.9442958832,  0.7473344803,
-         0.7876043320,  0.7410602570,  0.7422084808,  0.6844692230,
-         0.7256412506,  0.8455486298,  0.8969316483,  0.9362173080,
-         0.9092340469,  0.8227071762,  0.7481546402,  0.7088689804 } },
-    { {  0.2205047607, -0.0129537582,  0.0972347260,  0.1154832840,
-         0.0951843262,  0.1532516479,  0.1288108826,  0.1749858856,
-         0.1591157913,  0.2134923935,  0.2477340698,  0.2634811401,
-         0.3032999039,  0.3272485733,  0.3170785904,  0.3172016144 },
-      {  0.0032854080, -0.0446119308,  0.0284643173,  0.0155467987,
-        -0.0063104630,  0.0226001740,  0.0086984634,  0.0262088776,
-         0.0173921585,  0.0360507965,  0.0366659164,  0.0215339661,
-         0.0412178040,  0.1047391891,  0.1258172989,  0.0609836578 } },
-    { {  0.1495609283,  0.3275766373,  0.8598194122,  0.6847562790,
-         0.7550849915,  0.5662431717,  0.6930398941,  0.7526245117,
-         0.7300291061,  0.7284708023,  0.6608896255,  0.5224056244,
-         0.4273900986,  0.5757160187,  0.4625749588,  0.5123586655 },
-      { -0.0352210999, -0.0428895950,  0.3110914230,  0.2699604034,
-         0.3307752609,  0.2059469223,  0.2332172394,  0.3204412460,
-         0.2846412659,  0.3354911804,  0.2448635101,  0.1514062881,
-         0.1062564850,  0.2613077164,  0.2123441696,  0.3000602722 } },
-    { {  0.6218910217,  0.6033554077,  0.4551525116,  0.3161764145,
-         0.2864866257,  0.6195125580,  0.7577505112,  1.0062179565,
-         0.8485012054,  0.6777849197,  0.7455301285,  0.3630485535,
-         0.2327661514,  0.5563192368,  0.4448595047,  0.3806819916 },
-      {  0.2624969482,  0.2679510117,  0.1839666367,  0.0335903168,
-         0.0294075012,  0.2902593613,  0.4959144592,  0.7905979156,
-         0.5748548508,  0.3753919601,  0.4855394363,  0.1089630127,
-         0.0362968445,  0.3632535934,  0.2681150436,  0.2735691071 } },
-    { {  0.7064495087,  0.4431781769,  0.7628355026,  0.7271585464,
-         0.7812070847,  0.7806739807,  0.8909854889,  0.8958654404,
-         0.9126787186,  0.9038209915,  0.9246120453,  0.9624624252,
-         0.9732475281,  0.7420034409,  0.5060844421,  0.5189199448 },
-      {  0.3457021713, -0.0149221420,  0.3174476624,  0.3580865860,
-         0.4243965149,  0.4275541306,  0.5887155533,  0.6478490829,
-         0.6320610046,  0.6627349854,  0.6868886948,  0.7396659851,
-         0.7551259995,  0.5275316238,  0.3075237274,  0.3806819916 } },
-    { {  0.4376831055,  0.4904603958,  0.6262788773,  0.5901098251,
-         0.4176712036,  0.0221490860, -0.1612796783, -0.2236118317,
-        -0.1087894440, -0.0022506714,  0.1051902771,  0.3307752609,
-         0.4167690277,  0.4997692108,  0.4645843506,  0.5228567123 },
-      {  0.1228237152,  0.1671123505,  0.2931299210,  0.2549924850,
-         0.1435737610, -0.1124801636, -0.2181987762, -0.2723293304,
-        -0.1573429108, -0.0837745667, -0.0325555801,  0.1024427414,
-         0.1938495636,  0.2825498581,  0.2247285843,  0.2879629135 } },
-    { {  0.6100807190,  0.7900238037,  0.9581155777,  0.8999662399,
-         0.9277286530,  0.9720993042,  0.9966220856,  0.9630365372,
-         0.9571723938,  0.8992280960,  0.8370189667,  0.7417984009,
-         0.7174396515,  0.6122951508,  0.6746683121,  0.7030458450 },
-      {  0.0859165192,  0.0914115906,  0.6077432632,  0.5471334457,
-         0.5943746567,  0.6805324554,  0.6680250168,  0.6033554077,
-         0.6302976608,  0.4874258041,  0.3647298813,  0.2770137787,
-         0.2544183731,  0.2608156204,  0.3331537247,  0.4950942993 } },
-    { {  0.4051227570,  1.1022176743,  0.8262338638,  0.6573219299,
-         0.5948667526,  0.5426225662,  0.4987850189,  0.4370269775,
-         0.4421119690,  0.3837165833,  0.3728494644,  0.3706760406,
-         0.4169740677,  0.3559951782,  0.2994041443,  0.3896217346 },
-      {  0.0716867447,  0.9253911972,  0.2780799866,  0.2460117340,
-         0.1675224304,  0.1527595520,  0.1278266907,  0.1226596832,
-         0.1165084839,  0.0982189178,  0.0952253342,  0.1113414764,
-         0.1498889923,  0.0940361023,  0.0802984238,  0.1560811996 } },
-    { {  0.7024717331,  0.7363853455,  0.9629545212,  0.9635286331,
-         1.0819597244,  1.1529855728,  1.2984409332,  1.2693252563,
-         1.2848672867,  1.2877378464,  1.2133083344,  1.0696573257,
-         1.0864706039,  0.9851808548,  0.8312368393,  0.8047866821 },
-      {  0.3001422882,  0.2273120880,  0.6279602051,  0.6936140060,
-         0.8097076416,  0.9440498352,  1.1028738022,  1.1766471863,
-         1.1199741364,  1.1608181000,  1.0665817261,  0.8872537613,
-         0.9082908630,  0.7602519989,  0.6542053223,  0.7317514420 } },
-    { {  0.0643463135, -0.6808919907,  0.2889881134,  0.6142225266,
-         0.6356697083,  0.6825828552,  0.6259508133,  0.4945611954,
-         0.5866651535,  0.6357517242,  0.5208883286,  0.4207878113,
-         0.5125637054,  0.3758020401,  0.5424175262,  0.6172571182 },
-      { -0.0636806488, -0.7585611343,  0.0850553513,  0.2996912003,
-         0.3620643616,  0.4444084167,  0.4597454071,  0.3120756149,
-         0.4016780853,  0.5026807785,  0.4111919403,  0.3183498383,
-         0.3666572571,  0.1829824448,  0.3269205093,  0.4095926285 } },
-    { {  0.9277286530,  0.9651279449,  0.9602069855,  0.9327726364,
-         0.9208393097,  0.8868436813,  0.9011554718,  0.8569488525,
-         0.9015245438,  0.8969726562,  0.9367094040,  0.9445009232,
-         0.8617057800,  0.8215589523,  0.8333692551,  0.7939195633 },
-      {  0.1719102859,  0.1142530441,  0.1245460510,  0.1646108627,
-         0.1408672333,  0.0949792862,  0.0271930695,  0.0265779495,
-        -0.0064334869, -0.0109033585,  0.0152187347,  0.0252656937,
-         0.0166950226,  0.0736141205,  0.1205682755,  0.1895437241 } },
-    { {  0.5964250565,  0.6065130234,  0.7228116989,  0.7348270416,
-         0.0718097687,  0.2369899750,  0.2456426620,  0.4961194992,
-         0.6410417557,  0.6765956879,  0.6771287918,  0.7285938263,
-         0.6706905365,  0.5105543137,  0.5068635941,  0.5430326462 },
-      {  0.2782440186,  0.2620048523,  0.4424400330,  0.4124631882,
-        -0.1158838272,  0.0186223984,  0.0059919357,  0.1853609085,
-         0.3568563461,  0.3791646957,  0.4100847244,  0.4654865265,
-         0.4614677429,  0.3209743500,  0.3199081421,  0.3836755753 } },
-    { {  0.8051557541,  0.8506336212,  0.9544658661,  0.5584516525,
-         0.5874032974,  0.5727224350,  0.6177902222,  0.7659521103,
-         0.9526205063,  1.0424280167,  1.0705595016,  1.0042905807,
-         0.6005258560,  0.3886785507,  0.4739751816,  0.6542463303 },
-      {  0.4775428772,  0.5541868210,  0.7128057480,  0.2146816254,
-         0.2502765656,  0.2488822937,  0.3009214401,  0.4667987823,
-         0.6929988861,  0.8599834442,  0.8784780502,  0.7463912964,
-         0.3217535019,  0.1274986267,  0.2767267227,  0.5119485855 } },
-    { {  0.5978193283,  0.5092830658,  1.0738401413,  0.7688636780,
-         0.8214769363,  0.7682075500,  0.4970626831,  0.2783260345,
-         0.2652854919,  0.3625154495,  0.5700569153,  0.5044031143,
-         0.4003248215,  0.5162544250,  0.5727634430,  0.5538587570 },
-      {  0.2752094269,  0.1747808456,  0.8557186127,  0.4280872345,
-         0.5143680573,  0.4139804840,  0.1810960770,  0.0109539032,
-         0.0317039490,  0.0842351913,  0.3129367828,  0.2614717484,
-         0.1564092636,  0.2352676392,  0.3249931335,  0.3505821228 } },
-    { {  0.7093610764,  0.7587757111,  1.8517618179,  1.0092525482,
-         0.8078622818,  0.8792982101,  0.8210668564,  0.8600654602,
-         0.6913585663,  0.6436662674,  0.6216859818,  0.6123771667,
-         0.5940465927,  0.5910940170,  0.6505966187,  0.5801038742 },
-      {  0.3370904922,  0.4681930542,  1.9236078262,  0.8053607941,
-         0.5321245193,  0.6342344284,  0.5054693222,  0.5788326263,
-         0.4400615692,  0.4086904526,  0.3924102783,  0.4220180511,
-         0.3835115433,  0.4230432510,  0.5190839767,  0.3990535736 } },
-    { {  0.6277141571,  1.1122236252,  1.0259838104,  0.9486427307,
-         0.9184608459,  0.9059944153,  0.9080038071,  0.8282022476,
-         0.8440313339,  0.7887935638,  0.7468013763,  0.6746683121,
-         0.6319379807,  0.6246795654,  0.7263793945,  0.7349090576 },
-      {  0.2427721024,  1.0851583481,  0.6180362701,  0.5837125778,
-         0.4324750900,  0.4684801102,  0.3745307922,  0.3027257919,
-         0.3646888733,  0.2409267426,  0.2158298492,  0.2052907944,
-         0.2100887299,  0.2276401520,  0.3409452438,  0.4045896530 } },
-    { {  0.8391513824,  0.8713426590,  1.1366233826,  1.1440868378,
-         1.1443738937,  1.0877418518,  1.0516138077,  1.0099496841,
-         0.9216184616,  0.8990640640,  0.9001302719,  0.8993101120,
-         0.8055248260,  0.8150796890,  0.7272815704,  0.7196130753 },
-      {  0.4634771347,  0.5807189941,  1.1287908554,  1.1066875458,
-         1.0765056610,  0.9287538528,  0.8956193924,  0.8026132584,
-         0.6725769043,  0.5856809616,  0.5527515411,  0.5183868408,
-         0.4529380798,  0.5074377060,  0.4632720947,  0.5554990768 } },
-};
-
-static const float wmavoice_lsp16_intercoeff_b[32][2][16] = {
-    { {  0.5431776047, -0.1212130189, -0.2471650839,  0.0683670044,
-         0.1418520808,  0.2518971562,  0.3708084226,  0.4141484499,
-         0.5712364912,  0.5852659345,  0.5670641661,  0.6401320100,
-         0.6447737217,  0.6726239920,  0.4994724989,  0.5574678183 },
-      {  0.2040718794, -0.1271064281, -0.2266163826, -0.0406349897,
-        -0.0145058036,  0.0283126831,  0.0851084590,  0.0913147926,
-         0.1307432652,  0.1926501393,  0.2310355306,  0.2828245163,
-         0.3171940446,  0.4424681067,  0.2960716486,  0.3510941863 } },
-    { {  0.8073900938,  0.0403081179,  0.5392660499,  0.6928597689,
-         0.6499369740,  0.7328097820,  0.7755761147,  0.7766191959,
-         0.8820225596,  0.8423333168,  0.8898978233,  0.8488525748,
-         0.8654375672,  0.6728326082,  0.6169234514,  0.6755967736 },
-      {  0.3653843999, -0.0846008658, -0.0224332213,  0.1120721102,
-         0.1020585299,  0.1741876006,  0.2129902244,  0.2160151601,
-         0.3619422317,  0.4185815454,  0.5455245376,  0.5363975763,
-         0.5429168344,  0.3505726457,  0.3296067119,  0.3620986938 } },
-    { {  0.1843576431,  0.0179861784,  0.3122915626,  0.3600125313,
-         0.2466817498,  0.2172668576,  0.1975526214,  0.1177569032,
-         0.1196866035,  0.0849519968,  0.0962694287,  0.1591672301,
-         0.2300446033,  0.3082756996,  0.4047607183,  0.3925045133 },
-      { -0.0275964737, -0.0794897676,  0.1168181300,  0.1591150761,
-         0.0915755630,  0.0460972190,  0.0562151074,  0.0084419847,
-        -0.0095511675, -0.0408957601, -0.0376100540, -0.0166962743,
-         0.0656028390,  0.1226072311,  0.2293144464,  0.2142419219 } },
-    { {  0.4781936407, -1.2478972673,  0.4884679914,  0.7755239606,
-         0.6785174012,  0.6590117812,  0.6177057624,  0.6427918673,
-         0.5402048230,  0.5512614846,  0.6424267888,  0.4229103327,
-         0.5106334686,  0.5136062503,  0.4490395188,  0.4753251672 },
-      {  0.2852236032, -1.3815159798,  0.1904075146,  0.4874770641,
-         0.4593138695,  0.4182686210,  0.4174863100,  0.4604612589,
-         0.4089330435,  0.3891666532,  0.4700576067,  0.2383370996,
-         0.2801646590,  0.3398289084,  0.2766703367,  0.3374298215 } },
-    { {  0.5925153494,  0.3858809471,  1.0754098296,  0.5752002001,
-         0.5516265631,  0.4853909016,  0.4719351530,  0.5018194318,
-         0.3037382960,  0.5154316425,  0.8809794784,  0.7755761147,
-         0.5941321254,  0.3974069953,  0.5925675035,  0.6097261906 },
-      {  0.3008176684,  0.0706617832,  0.8484353423,  0.2574254870,
-         0.2815728188,  0.1930673718,  0.2523665428,  0.2691601515,
-         0.1271967888,  0.2653007507,  0.6473292708,  0.5275835395,
-         0.3928174376,  0.2405275702,  0.4008491635,  0.4556109309 } },
-    { {  0.7339050174,  0.4290645123,  0.6859754324,  0.6349166036,
-         0.8034263849,  0.8509387374,  0.8591269255,  1.1049811840,
-         1.3928194642,  1.3423343301,  1.0849018693,  0.8943830729,
-         0.8579795361,  0.6920774579,  0.5613272190,  0.4303162098 },
-      {  0.4534726143,  0.0901674032,  0.3465046287,  0.3470261693,
-         0.5217422843,  0.5874564052,  0.6014336944,  0.9161834717,
-         1.2823571563,  1.2193550467,  0.8868207335,  0.6514494419,
-         0.6249030232,  0.4453887343,  0.3665317893,  0.2242033482 } },
-    { {  0.4293252826,  0.3303368688,  0.6181751490,  0.9884168506,
-         0.9915460944,  0.7939864993,  0.3019129038,  0.2443348169,
-         0.4543070793,  0.5617444515,  0.4895110726,  0.6600027084,
-         0.6290231943,  0.5580936670,  0.5459417701,  0.4647378922 },
-      {  0.1409133077, -0.0050137639,  0.2551307082,  0.6764833927,
-         0.7112701535,  0.4648943543,  0.0301380754, -0.0235806108,
-         0.1018499136,  0.2422486544,  0.2406318784,  0.4000146985,
-         0.3713299632,  0.3259559274,  0.3820737004,  0.2888743877 } },
-    { {  0.7733334899,  0.8321111202,  1.3098945022,  1.0331128836,
-         1.0380675197,  0.9479974508,  0.9740223289,  0.9442945123,
-         0.8926619887,  0.8719046712,  0.8640815616,  0.8404036164,
-         0.8359183669,  0.7675965428,  0.6895219088,  0.7266034484 },
-      {  0.3655408621,  0.4643206596,  1.2171645761,  0.8341451287,
-         0.8387868404,  0.6713201404,  0.6814901829,  0.6294404268,
-         0.5172048807,  0.5205948949,  0.5408828259,  0.5298783183,
-         0.5781729817,  0.5000983477,  0.4727174640,  0.4326109886 } },
-    { {  0.8902629018,  0.4598354101,  0.6392975450,  0.4483093619,
-         0.6220867038,  0.6323089004,  0.7063676715,  0.3717993498,
-         0.6718416810,  0.7876758575,  0.2807383537,  0.3118221760,
-         0.6703813672,  0.7662405372,  0.7122610807,  0.7851724625 },
-      {  0.6301705837,  0.1221378446,  0.3532846570,  0.1412783861,
-         0.3471826315,  0.3435318470,  0.4466925859,  0.1390357614,
-         0.4092981219,  0.5406742096,  0.0690450072,  0.0829179883,
-         0.4625995755,  0.5700891018,  0.5542864203,  0.6545265317 } },
-    { { -0.1100520492,  0.3803526163,  0.8075987101,  0.6903563738,
-         0.8012359142,  0.7835035324,  0.8195941448,  0.8381088376,
-         0.8033220768,  0.7511680126,  0.6393496990,  0.6096218824,
-         0.6934856176,  0.6690253615,  0.6401841640,  0.5600233674 },
-      { -0.1776958704, -0.0293175578,  0.1520742774,  0.1746048331,
-         0.2222214937,  0.3052507639,  0.2977927327,  0.3797789216,
-         0.3395681381,  0.2976884246,  0.2516885400,  0.2403711081,
-         0.3567789793,  0.3302847147,  0.3368039727,  0.3310148716 } },
-    { {  0.5587195158,  0.4676063657,  0.1392965317, -0.0990996957,
-        -0.0816280842, -0.1146416068, -0.0116894841,  0.0521992445,
-         0.1626615524,  0.2923687100,  0.4029874802,  0.4528989196,
-         0.4694839120,  0.5058352947,  0.5369191170,  0.5105291605 },
-      {  0.2193530202,  0.1211469173,  0.0179861784, -0.2022604346,
-        -0.1409794092, -0.2121175528, -0.1152674556, -0.0594626069,
-        -0.0122110248,  0.0274260640,  0.1414870024,  0.2044369578,
-         0.2167974710,  0.2615978122,  0.3348221183,  0.3707562685 } },
-    { {  0.5948622823,  0.7065241337,  0.9414781928,  0.9340723157,
-         0.8835350275,  0.9730835557,  0.8503650427,  0.8902629018,
-         0.8746688366,  0.6910865307,  0.6404449344,  0.6976057887,
-         0.5916287303,  0.6022160053,  0.7729684114,  0.6096740365 },
-      {  0.1262058616,  0.1300652623,  0.6594290137,  0.6535877585,
-         0.5639349222,  0.6982316375,  0.4828875065,  0.5577285886,
-         0.4591052532,  0.2964367270,  0.2695252299,  0.3324751854,
-         0.2860580683,  0.2902825475,  0.4623388052,  0.3369604349 } },
-    { {  0.8821268678,  0.8539636731,  0.2898653150,  0.7478301525,
-         0.5109463930,  0.8577187657,  0.4884679914,  0.7846509218,
-         0.7684310079,  0.7032384276,  0.6691296697,  0.8593355417,
-         0.9383489490,  0.9808023572,  0.6804992557,  0.6403927803 },
-      {  0.5590324402,  0.4209806323,  0.0259135962,  0.4318808317,
-         0.2104346752,  0.5453680754,  0.1783599257,  0.4467447400,
-         0.4352708459,  0.4089330435,  0.3994410038,  0.5984609127,
-         0.6872792840,  0.7321317792,  0.4408513308,  0.4542027712 } },
-    { {  0.6371070743,  0.6311093569,  0.7152860165,  0.6929640770,
-         0.2292101383,  0.3234525323,  0.9644259810,  0.9881039262,
-         0.8722697496,  0.4370440841,  0.4051779509,  0.4944135547,
-         0.5392660499,  0.5969484448,  0.4268740416,  0.4990552664 },
-      {  0.4233797193,  0.3647063971,  0.4345406890,  0.4180078506,
-        -0.0006328225,  0.0586141944,  0.7620160580,  0.8152132034,
-         0.6707985997,  0.2095480561,  0.2178405523,  0.2776612639,
-         0.3142212629,  0.3808741570,  0.2676998377,  0.2804775834 } },
-    { {  0.4509170651,  0.9490405321,  0.8557890654,  0.8271043301,
-         0.6915559173,  0.7321839333,  0.6257896423,  0.6274064183,
-         0.5238284469,  0.5194996595,  0.4116972089,  0.3382642865,
-         0.3755022883,  0.4867990613,  0.5686287880,  0.5106856227 },
-      {  0.0989292860,  0.6244857907,  0.4700576067,  0.3905226588,
-         0.2630059719,  0.3009741306,  0.2150763869,  0.2067838907,
-         0.1533781290,  0.1815934777,  0.1023714542,  0.0373874903,
-         0.0897501707,  0.1849313378,  0.2852757573,  0.2625887394 } },
-    { {  0.9954054952,  0.9554033279,  0.8237664700,  0.9780903459,
-         0.7261862159,  0.7884581685,  0.7933084965,  0.7393290401,
-         0.8783196211,  1.0409359932,  1.0217954516,  0.9159227014,
-         0.8698185086,  0.7057939768,  0.7662926912,  0.7339571714 },
-      {  0.7913266420,  0.6739278436,  0.5061482191,  0.7058982849,
-         0.3480692506,  0.4338105321,  0.4428853393,  0.3758152127,
-         0.5962182879,  0.7925261855,  0.7968549728,  0.6629754901,
-         0.6325175166,  0.4598354101,  0.5310778618,  0.5518873334 } },
-    { {  0.4638512731,  0.0604917407,  0.1897295117,  0.3403504491,
-         0.4708399177,  0.5241413713,  0.6061275601,  0.6446694136,
-         0.7313494682,  0.7208143473,  0.6268848777,  0.6081094146,
-         0.4913364649,  0.3529717326,  0.4954566360,  0.5767126679 },
-      {  0.1353849769, -0.0274400115,  0.0002537966,  0.0272174478,
-         0.0555371046,  0.0652899146,  0.1010676026,  0.1073260903,
-         0.1568724513,  0.2207611799,  0.1434167027,  0.2262373567,
-         0.1177047491,  0.0162650943,  0.2529402375,  0.4087765813 } },
-    { {  0.9700064659,  0.9917025566,  0.9159227014,  0.9309430718,
-         0.8991290927,  0.9314124584,  0.9059612751,  0.9473194480,
-         0.9604622722,  0.9377752542,  0.9197821021,  0.8869771957,
-         0.8506779671,  0.8594920039,  0.8320589662,  0.8739908338 },
-      {  0.2892394662,  0.0551198721,  0.0892807841,  0.1158793569,
-         0.0905846357,  0.0738953352,  0.0395258069,  0.0240360498,
-         0.0477139950,  0.0751470327,  0.1171310544,  0.1555164456,
-         0.1384620667,  0.1818542480,  0.2104868293,  0.1288135648 } },
-    { {  0.4101847410,  0.3326316476,  0.4666675925,  0.5077128410,
-         0.5892296433,  0.4272912741,  0.0603352785, -0.8668596745,
-        -1.1103670001, -0.0900248885,  0.1626615524,  0.1487885714,
-         0.4130010605,  0.5119373202,  0.5820323825,  0.5486016273 },
-      {  0.0383262634,  0.1300652623,  0.2295230627,  0.2706204653,
-         0.3722165823,  0.1698066592, -0.0934670568, -0.8677462935,
-        -1.0724509954, -0.2164463401, -0.0056917667, -0.0301520228,
-         0.1299088001,  0.2579991817,  0.3482257128,  0.2469425201 } },
-    { {  0.6031547785,  0.5515222549,  0.4292209744,  0.5027582049,
-         0.8167778254,  1.0925685167,  0.9878953099,  0.7019345760,
-         0.2509583831,  0.2475162148,  0.5660732388,  0.5145971775,
-         0.4824181199,  0.5970005989,  0.5996604562,  0.5384315848 },
-      {  0.3677313328,  0.2650399804,  0.1585935354,  0.2213348746,
-         0.5566333532,  0.8425940871,  0.7604514360,  0.4523773789,
-         0.0681062341,  0.0737388730,  0.3169854283,  0.2868403792,
-         0.2661873698,  0.3635068536,  0.4300554395,  0.3743027449 } },
-    { {  0.5017672777,  0.6634970307,  0.6869142056,  0.7066284418,
-         0.5669598579,  0.0621085167,  0.0634645224,  0.2321307659,
-         0.8322675824,  0.9855483770,  0.8296598792,  0.6140028238,
-         0.5462546945,  0.6730412245,  0.6856103539,  0.5975221395 },
-      {  0.2680649161,  0.3324230313,  0.3688787222,  0.3886451125,
-         0.2774004936, -0.1695076823, -0.1353467703,  0.0159000158,
-         0.5895425677,  0.7586781979,  0.5639870763,  0.3687744141,
-         0.3401418328,  0.4477356672,  0.4782979488,  0.4034568667 } },
-    { {  0.8838479519,  0.9025712609,  0.7326533198,  0.8124490380,
-         0.8956347704,  1.1007045507,  1.2731780410,  1.2029786706,
-         1.0839109421,  0.9664078355,  0.7356782556,  0.6942157745,
-         0.6917645335,  0.6383587718,  0.6503020525,  0.5989302993 },
-      {  0.5576764345,  0.4596789479,  0.3790487647,  0.5514179468,
-         0.7333834767,  0.9612445831,  1.1976589561,  1.1094664335,
-         0.8868207335,  0.6789346337,  0.4643206596,  0.4029353261,
-         0.4384522438,  0.3871847987,  0.4326109886,  0.3691916466 } },
-    { {  0.8520861268,  0.8413423896,  0.7238392830,  0.9103943706,
-         0.7072542906,  0.6479029655,  0.4557673931,  0.1908247471,
-        -0.0569070578, -0.1013423204,  0.2517406940,  0.4854952097,
-         0.5820845366,  0.5886037946,  0.6177579165,  0.6226603985 },
-      {  0.6160889864,  0.4592095613,  0.4752208591,  0.6685559750,
-         0.4326109886,  0.4077335000,  0.2314006090,  0.0173603296,
-        -0.2208272815, -0.3014574647,  0.0321199298,  0.2559130192,
-         0.3603254557,  0.3466089368,  0.4072119594,  0.4776199460 } },
-    { {  0.7083495259,  0.9001721740,  0.6795083284,  1.2743254304,
-         1.3672639728,  1.2563322783,  0.8557369113,  0.8287732601,
-         0.7942472696,  0.8006622195,  0.7034991980,  0.5479236245,
-         0.6391932368,  0.6248508692,  0.5495925546,  0.4719351530 },
-      {  0.4000146985,  0.6493632793,  0.4583229423,  1.1484255195,
-         1.2521599531,  1.1232351065,  0.6150459051,  0.5347808003,
-         0.4726653099,  0.5269576907,  0.4278128147,  0.2745841742,
-         0.3868718743,  0.4183729291,  0.3474434018,  0.3150035739 } },
-    { {  0.9070043564,  0.7648323774,  0.4281778932,  0.5475063920,
-         0.4134704471,  0.4706834555,  0.4549329281,  0.4648422003,
-         0.4572798610,  0.4823138118,  0.4666154385,  0.4841913581,
-         0.4018922448,  0.4297946692,  0.4646857381,  0.6091003418 },
-      {  0.4925360084,  0.2065231204,  0.0948612690,  0.1716842055,
-         0.0992422104,  0.1332988143,  0.1255800128,  0.1257364750,
-         0.0955392718,  0.1118634939,  0.1372103691,  0.1525958180,
-         0.0902717113,  0.1591672301,  0.2335910797,  0.3767018318 } },
-    { {  0.3185500503,  0.8677845001,  0.7776622772,  0.8160476685,
-         0.8624126315,  0.8057211637,  0.8852561116,  0.8471314907,
-         0.9145145416,  0.8945916891,  0.8638729453,  0.8531292081,
-         0.7425104380,  0.6215651631,  0.6501455903,  0.6341864467 },
-      { -0.0499705672,  0.0687842369,  0.3051464558,  0.3368039727,
-         0.4942049384,  0.3823344707,  0.5683158636,  0.5044271350,
-         0.6278236508,  0.5777035952,  0.5745221972,  0.5502184033,
-         0.4244228005,  0.3163595796,  0.3525545001,  0.3582914472 } },
-    { {  0.3200625181,  0.9415303469,  0.6067534089,  0.3568832874,
-         0.1600538492,  0.2938811779,  0.2037589550,  0.3017564416,
-         0.2572168708,  0.4796018004,  0.6938506961,  0.6847758889,
-         0.7232134342,  0.6111343503,  0.5159531832,  0.4856516719 },
-      {  0.0680540800,  0.6285016537,  0.2514277697,  0.0790064335,
-        -0.0687981844,  0.0521992445, -0.0055874586,  0.0537117124,
-         0.0188206434,  0.1883213520,  0.4493002892,  0.4300554395,
-         0.4750122428,  0.3658016324,  0.3119786382,  0.2818335891 } },
-    { {  0.6864969730,  1.0815640092,  0.9838794470,  0.8845259547,
-         0.9438772798,  0.8888025880,  0.8178730607,  0.8581881523,
-         0.7128347754,  0.7120524645,  0.7345308661,  0.7945601940,
-         0.7854853868,  0.8261655569,  0.6941114664,  0.6646444201 },
-      {  0.2847542167,  0.9535257816,  0.6691818237,  0.5026538968,
-         0.5945493579,  0.4125838280,  0.3886451125,  0.3740941286,
-         0.2453778982,  0.2928902507,  0.3219922185,  0.4065861106,
-         0.3838469386,  0.4289602041,  0.3910441995,  0.3821780086 } },
-    { {  1.1335094571,  1.0390062928,  0.7019867301,  0.6203134656,
-         0.6951545477,  0.4863818288,  0.6171320677,  0.6247465611,
-         0.5907421112,  0.6711115241,  0.7322882414,  0.7042293549,
-         0.5635698438,  0.6174449921,  0.6727283001,  0.6431047916 },
-      {  1.0146503448,  0.7762541175,  0.2200310230,  0.2459515929,
-         0.2703596950,  0.1376276016,  0.2522100806,  0.2622758150,
-         0.2389107943,  0.2956544161,  0.3799875379,  0.3653843999,
-         0.2561216354,  0.2842326760,  0.4034568667,  0.3700782657 } },
-    { {  0.6342907548,  0.9627570510,  0.5214815140, -0.0226939917,
-         0.5616401434,  0.7231091261,  0.7417802811,  0.9092991352,
-         0.9739701748,  0.7804785967,  0.6771092415,  0.6352295280,
-         0.4660417438,  0.5869870186,  0.6692339778,  0.5986173749 },
-      {  0.3988673091,  0.6997441053,  0.2316613793, -0.2566571236,
-         0.2685343027,  0.4484136701,  0.4490395188,  0.6886874437,
-         0.7703085542,  0.5847443938,  0.4539941549,  0.4098196626,
-         0.2579991817,  0.3376384377,  0.4754816294,  0.5095382333 } },
-    { {  0.4443456531,  2.0296727419,  0.6569256186,  0.6439914107,
-         0.6436263323,  0.5507399440,  0.6095175743,  0.6066491008,
-         0.5347808003,  0.2529402375,  0.4443978071,  0.7000570297,
-         0.8259569407,  0.5927761197,  0.5078171492,  0.4418422580 },
-      {  0.2430831194,  1.9133691788,  0.3723730445,  0.3764410615,
-         0.3874977231,  0.3212099075,  0.3832210898,  0.4474227428,
-         0.3644977808,  0.0814055204,  0.2752621770,  0.4647378922,
-         0.6619845629,  0.4304205179,  0.3143777251,  0.2705683112 } },
-    { {  0.9740744829,  1.0730628967,  0.9743352532,  0.9098728299,
-         0.9453375936,  0.9661470652,  0.9270836711,  0.9643738270,
-         0.9989519715,  0.9627048969,  0.9348546267,  0.9865393043,
-         0.9399657249,  0.9752218723,  0.8440544009,  0.8819182515 },
-      {  0.9258319736,  1.0357205868,  0.8463491797,  0.8108844161,
-         0.8391519189,  0.8566235304,  0.8305986524,  0.8880724311,
-         0.9181653261,  0.8670021892,  0.8305986524,  0.8995984793,
-         0.8300249577,  0.8711223602,  0.7195626497,  0.8138571978 } },
-};
-
-static const double wmavoice_mean_lsf10[2][10] = {
-    { 0.2235394066, 0.4097484909, 0.7025292732, 1.1077160169,
-      1.3939179044, 1.6741291716, 1.9552949226, 2.2199793918,
-      2.5103400247, 2.7829212906 },
-    { 0.1493683393, 0.3714357373, 0.7702730245, 1.0609411394,
-      1.3270362536, 1.5806033119, 1.8398507524, 2.1116740248,
-      2.3823505771, 2.6865718527 }
-};
-
-static const double wmavoice_mean_lsf16[2][16] = {
-    { 0.0999206754, 0.2345933590, 0.4621011210, 0.6772546160,
-      0.8346396060, 1.0067495130, 1.1571691668, 1.3292508688,
-      1.4941465650, 1.6600755584, 1.8461284908, 2.0529487333,
-      2.2690810112, 2.4949894820, 2.7172752965, 2.9164840903 },
-    { 0.0918298402, 0.2475621892, 0.4782937721, 0.6284774045,
-      0.7861951264, 0.9303736000, 1.0940441024, 1.2521029300,
-      1.4434732098, 1.6551410742, 1.8917962963, 2.0967280403,
-      2.2981430375, 2.4826173497, 2.6827972461, 2.8811350800 }
-};
-
-static const float wmavoice_std_codebook[1000] = {
-    -0.185013, -0.150405, -0.707267, -0.284100,  0.882898,
-    -0.788627,  0.061005,  0.374431,  0.053843, -0.909826,
-     0.543602,  0.219326,  0.285698,  0.154709, -0.455005,
-     0.426276, -0.868852, -0.952324, -0.550001,  0.813814,
-    -0.352815,  0.242122,  0.820495, -0.189574, -0.449538,
-     0.499132, -0.247783,  0.598159,  0.732040, -0.564406,
-    -0.631788, -0.452973,  0.285189, -0.339055,  0.262927,
-     0.168087, -0.127682, -0.676067, -0.457481,  0.926161,
-    -0.585893, -0.913880,  0.145487,  0.699804,  0.240829,
-     0.690482,  0.126081,  0.371977,  0.738158,  0.576080,
-     0.185791, -0.614657, -0.181799,  0.006285,  0.195768,
-     0.368663, -0.494583,  0.947985, -0.033178, -0.762543,
-    -0.616421,  0.335034, -0.215516,  0.668769,  0.995979,
-    -0.952588, -0.163144, -0.131704, -0.628655,  0.379374,
-    -0.205543, -0.214549,  0.465494,  0.939944, -0.514744,
-    -0.293676,  0.630426,  0.611336, -0.921699,  0.368584,
-     0.187416,  0.264092,  0.753927, -0.994382, -0.729623,
-    -0.050304,  0.374280, -0.224205, -0.102319, -0.658897,
-     0.013252,  0.281260,  0.676137,  0.797736, -0.049971,
-     0.672115,  0.845148,  0.786885, -0.459588, -0.783507,
-     0.166259,  0.334869,  0.001944, -0.368247,  0.274813,
-     0.487200,  0.338077, -0.094761,  0.098536,  0.416378,
-    -0.726176, -0.714048, -0.319530, -0.972249, -0.708430,
-    -0.049153, -0.022553,  0.665850,  0.726642,  0.875127,
-    -0.993047, -0.260106,  0.156387,  0.683090, -0.462370,
-    -0.893584,  0.355205, -0.617222,  0.893301,  0.895617,
-    -0.400729,  0.059559,  0.230486,  0.601215,  0.691313,
-    -0.494701,  0.088415,  0.029390,  0.410539, -0.813049,
-    -0.554232,  0.684362, -0.527097,  0.126238,  0.712113,
-    -0.235528, -0.922915, -0.310440, -0.569678,  0.803727,
-    -0.435313, -0.562725, -0.456380,  0.721075, -0.879635,
-     0.081250,  0.827491,  0.475570,  0.464029,  0.720792,
-     0.371187, -0.936700, -0.219649, -0.398327,  0.664515,
-    -0.528336,  0.106972, -0.247070,  0.501053, -0.482490,
-    -0.060119,  0.946821, -0.798127,  0.412784,  0.073058,
-     0.913986, -0.822744,  0.150143, -0.396453, -0.392421,
-    -0.046130,  0.168234,  0.044854,  0.497490, -0.110691,
-     0.165219, -0.421259, -0.283200, -0.359212, -0.957231,
-    -0.562409, -0.988025, -0.893931,  0.217942, -0.386352,
-     0.770585,  0.689606,  0.720620, -0.476485,  0.190659,
-    -0.761870,  0.463395,  0.137480, -0.559997, -0.123821,
-    -0.789461, -0.646011,  0.053435,  0.360682, -0.042464,
-     0.661014, -0.685448, -0.874230, -0.294133,  0.812042,
-     0.015078,  0.871086, -0.609218,  0.731878, -0.488126,
-    -0.566448, -0.830530, -0.476150, -0.460379,  0.387412,
-     0.137497, -0.689794,  0.077018, -0.141883, -0.166280,
-    -0.732322,  0.096247, -0.702884,  0.405158,  0.536250,
-     0.173295,  0.615696,  0.890239, -0.773270, -0.023622,
-    -0.152226,  0.887744,  0.290930, -0.026456, -0.406389,
-     0.102972,  0.988622, -0.535303,  0.493754,  0.720500,
-    -0.023428,  0.927306,  0.889970,  0.500421, -0.533073,
-     0.277382, -0.362081, -0.222867, -0.645599,  0.496035,
-     0.610853, -0.377922, -0.407718,  0.907969, -0.972764,
-    -0.871468,  0.081264,  0.642933, -0.981230,  0.307994,
-    -0.380689, -0.133456,  0.195738,  0.910241,  0.840088,
-     0.789349,  0.013213,  0.828710, -0.745954, -0.493033,
-     0.549210,  0.230618, -0.565727,  0.439180, -0.268961,
-    -0.098800, -0.283438,  0.368958,  0.678333,  0.070963,
-    -0.135007,  0.289186,  0.693041,  0.457275,  0.197155,
-     0.720277,  0.585807, -0.721581,  0.363210,  0.604577,
-     0.586413,  0.982521, -0.528878, -0.217849,  0.892762,
-    -0.688791, -0.428500, -0.094025, -0.860081, -0.174454,
-     0.412942,  0.689129, -0.943836,  0.847215,  0.128309,
-    -0.212797, -0.251585,  0.844871, -0.843839, -0.573252,
-    -0.084167,  0.021154,  0.715935, -0.391126, -0.521570,
-    -0.086910, -0.670848, -0.935763,  0.191509,  0.692361,
-     0.668814, -0.222078,  0.674882, -0.860064,  0.560073,
-     0.567644, -0.548855, -0.868427, -0.526382, -0.408936,
-    -0.042881,  0.886560, -0.719807,  0.013283,  0.733775,
-     0.408502,  0.800487, -0.517810,  0.253372,  0.956648,
-    -0.091062, -0.830794, -0.022198, -0.375127, -0.221920,
-     0.456232,  0.537963,  0.107232,  0.520469, -0.270529,
-    -0.200406,  0.189284,  0.507393, -0.525524,  0.329220,
-     0.067466, -0.957881,  0.780365,  0.199039, -0.484262,
-    -0.628570, -0.843843, -0.597703, -0.348377,  0.169441,
-    -0.863928, -0.939875, -0.030073, -0.381738,  0.313497,
-    -0.073425,  0.527200,  0.482703,  0.904377, -0.847927,
-    -0.739217,  0.360609,  0.690035,  0.368015, -0.118921,
-    -0.580493, -0.832391, -0.929638,  0.926900, -0.357915,
-     0.399582, -0.005634, -0.315796,  0.179947, -0.806596,
-     0.393360,  0.732931, -0.415833, -0.724526,  0.957347,
-    -0.892887,  0.475366,  0.173583, -0.418554, -0.302536,
-     0.627315,  0.782000,  0.497542,  0.139082,  0.570111,
-     0.732375, -0.454643,  0.302218, -0.019505,  0.881778,
-    -0.057606,  0.273041,  0.414170, -0.503501, -0.079602,
-    -0.083941,  0.007178, -0.171925,  0.506856,  0.520953,
-     0.631684, -0.099784,  0.253885, -0.784149,  0.175691,
-     0.211231, -0.677036, -0.348943, -0.615186, -0.095591,
-     0.348521, -0.987871, -0.313590, -0.153938,  0.151210,
-    -0.743479, -0.421562,  0.696567,  0.558739,  0.558933,
-     0.578346, -0.498867, -0.168026, -0.007485, -0.002368,
-     0.752372,  0.908575, -0.995190, -0.419553,  0.415430,
-     0.525763, -0.787869, -0.684353, -0.220353, -0.572018,
-     0.491337,  0.990879, -0.249054, -0.857606, -0.624307,
-     0.655355,  0.490915, -0.612178, -0.658235, -0.663023,
-     0.539032, -0.401714, -0.084585,  0.235599, -0.842975,
-    -0.525653, -0.186055, -0.341841,  0.306321,  0.806460,
-     0.655791,  0.058693,  0.715035,  0.660601,  0.639140,
-     0.130465,  0.186363,  0.851271,  0.446112,  0.966011,
-    -0.720746, -0.062551,  0.956890,  0.030200,  0.079843,
-    -0.667418, -0.314445, -0.429243, -0.279596,  0.027320,
-    -0.092266, -0.740564,  0.625606,  0.823149,  0.495035,
-     0.782632, -0.702504, -0.691020, -0.559209,  0.603818,
-    -0.884560, -0.903419, -0.337489,  0.830475,  0.757182,
-    -0.698349, -0.039060, -0.056455, -0.847078, -0.592948,
-    -0.090444, -0.567824,  0.344501, -0.133554,  0.462375,
-    -0.575656,  0.199028, -0.852070, -0.004899,  0.919432,
-     0.175251,  0.902835, -0.821132, -0.199143,  0.725984,
-     0.673903, -0.416511, -0.976519,  0.982883,  0.024279,
-     0.627298, -0.901677,  0.120861, -0.710191,  0.928798,
-    -0.121958, -0.408540, -0.110261,  0.821588, -0.255618,
-     0.296790, -0.268856,  0.176557, -0.358709,  0.597589,
-    -0.361067,  0.065635, -0.203382, -0.213137, -0.939264,
-    -0.283951,  0.962113,  0.963571, -0.105083, -0.237030,
-     0.689556, -0.431180,  0.346459,  0.713037, -0.448297,
-    -0.629262,  0.340335, -0.349973,  0.491599,  0.630144,
-    -0.421175, -0.630359, -0.778396,  0.468564, -0.808771,
-    -0.034014, -0.234646, -0.077627, -0.857457,  0.406645,
-    -0.480038, -0.218524, -0.527720,  0.316580,  0.568338,
-    -0.466984, -0.967371,  0.530452, -0.503413, -0.072454,
-    -0.706578, -0.813857,  0.496366,  0.639881,  0.899179,
-    -0.951931, -0.989381,  0.239514, -0.301904,  0.502218,
-    -0.130341,  0.276921,  0.871860,  0.091262, -0.254515,
-    -0.936911, -0.942752,  0.510839, -0.014539, -0.800209,
-    -0.082516,  0.505423, -0.018733,  0.389763, -0.177997,
-    -0.450395,  0.922779, -0.145368, -0.919943, -0.580634,
-     0.782178, -0.626521, -0.394491,  0.278545, -0.986640,
-    -0.495312,  0.326614, -0.976021,  0.744203, -0.975290,
-     0.526197, -0.386139,  0.301631,  0.398057,  0.705124,
-    -0.952884,  0.461146,  0.762372,  0.557954, -0.553393,
-     0.962163, -0.524562,  0.952030, -0.056570,  0.865202,
-    -0.225967,  0.493035,  0.787981,  0.628665,  0.573093,
-    -0.792653,  0.410844,  0.946571, -0.187144, -0.310612,
-     0.959931,  0.317544, -0.983998,  0.983911,  0.061747,
-    -0.959287,  0.510108,  0.675608,  0.342344, -0.091835,
-     0.380731,  0.389460, -0.630689,  0.143103, -0.052586,
-    -0.184083,  0.105266,  0.422852, -0.232052, -0.951303,
-     0.288054,  0.541981,  0.541732,  0.076035,  0.170646,
-     0.114825,  0.283382, -0.418510,  0.061396, -0.903763,
-     0.270879,  0.021327,  0.413782,  0.286881,  0.005238,
-    -0.524472,  0.327594, -0.484654, -0.848864, -0.330063,
-     0.423511,  0.531868, -0.940603,  0.792822, -0.325029,
-     0.006811, -0.391261,  0.780237, -0.570337,  0.376687,
-     0.828934,  0.717717, -0.081333,  0.370666, -0.206248,
-    -0.910686, -0.514510, -0.922867, -0.329196,  0.546886,
-    -0.826629,  0.941683, -0.431786,  0.587152,  0.228564,
-     0.573452, -0.937320, -0.443843, -0.911202, -0.786184,
-     0.226094,  0.512309,  0.745684,  0.285491,  0.305131,
-    -0.579345, -0.707698,  0.913870, -0.799108, -0.278035,
-     0.290556, -0.970174, -0.560318, -0.790776,  0.400492,
-     0.233434, -0.701462,  0.885982,  0.310567, -0.030658,
-     0.432868,  0.483938, -0.088976, -0.998918,  0.071090,
-    -0.860412,  0.574534,  0.133770, -0.304255,  0.663332,
-     0.347586,  0.921839,  0.175641,  0.093270,  0.207330,
-    -0.519228,  0.513925,  0.499633, -0.605358,  0.714817,
-    -0.778402,  0.685198,  0.744643, -0.338720,  0.894422,
-     0.145135,  0.894714, -0.807041,  0.031117,  0.205281,
-     0.162301, -0.536015, -0.310781, -0.926675, -0.534932,
-     0.760308, -0.787088, -0.960398, -0.105922, -0.091343,
-     0.702934, -0.758336, -0.169504, -0.121425,  0.334935,
-    -0.962173,  0.359347, -0.151140,  0.537460,  0.753989,
-    -0.436323,  0.759058,  0.439187, -0.691680, -0.579662,
-     0.333608,  0.453454, -0.684948,  0.526567, -0.515429,
-     0.520333, -0.311132, -0.051443, -0.790448, -0.237807,
-     0.413625,  0.969861, -0.024895,  0.453226, -0.136061,
-     0.883762,  0.156160,  0.105603, -0.285741, -0.965264,
-    -0.559462, -0.247914,  0.394083,  0.289398, -0.710455,
-     0.148072,  0.853074, -0.951397, -0.412742, -0.838606,
-    -0.531059,  0.920866,  0.614848, -0.216007,  0.447434,
-    -0.900580, -0.695673, -0.863698,  0.047977, -0.486121,
-    -0.101505, -0.538399, -0.516261,  0.873600,  0.914828,
-     0.347678,  0.757362,  0.070988, -0.546718, -0.528380,
-     0.105724, -0.106180,  0.223706, -0.500194, -0.816782,
-     0.513251,  0.647878, -0.963708,  0.561854, -0.764864,
-    -0.802314, -0.969205, -0.843997,  0.812534, -0.185212,
-     0.603436,  0.911954,  0.119114,  0.739738, -0.040069,
-     0.632993, -0.361767,  0.421532, -0.883268, -0.488168,
-     0.336360,  0.464411, -0.730806, -0.592652,  0.917693,
-    -0.259186,  0.513071, -0.188487,  0.964520, -0.987122,
-    -0.005270,  0.477771,  0.660756,  0.031023,  0.039625,
-     0.895892,  0.228709,  0.070419, -0.948105,  0.041243,
-     0.885207,  0.655331, -0.046803,  0.004321,  0.395069,
-     0.913128, -0.362686, -0.966698,  0.334661, -0.245954,
-    -0.454865, -0.328980, -0.781543, -0.185671,  0.078368,
-    -0.863850,  0.555143, -0.408560, -0.052338,  0.519663,
-    -0.395683,  0.942393, -0.002565, -0.734927, -0.026585,
-    -0.962941, -0.839035, -0.797876,  0.107479, -0.787140,
-     0.243367, -0.007314,  0.868191, -0.803435,  0.997007,
-     0.263261, -0.890307, -0.365679,  0.296563,  0.444354,
-     0.388367,  0.841698, -0.884626,  0.606824, -0.343973,
-     0.193743,  0.742974, -0.788830,  0.785182, -0.309364,
-     0.730833, -0.610500, -0.366971, -0.271732, -0.345427,
-     0.606444, -0.234673, -0.184462,  0.808568,  0.872806,
-     0.028398,  0.051936, -0.134508, -0.103410,  0.248500,
-    -0.137501, -0.840150,  0.358194,  0.496819,  0.456413,
-    -0.197453, -0.114814,  0.298111, -0.082078, -0.507990,
-     0.954138, -0.888336, -0.765016, -0.834692,  0.896847,
-    -0.074380,  0.896141, -0.713654,  0.558649, -0.375591,
-    -0.059081,  0.165093,  0.389736,  0.756458, -0.026339,
-     0.262542, -0.215144, -0.974403, -0.871966,  0.681446
-};
-
-static const float wmavoice_gain_silence[256] = {
-    0.0000188351, 0.0000249147, 0.0000294447, 0.0000365973,
-    0.0000423193, 0.0000464916, 0.0000498295, 0.0000525713,
-    0.0000550747, 0.0000574589, 0.0000596046, 0.0000615120,
-    0.0000634193, 0.0000649691, 0.0000665188, 0.0000679493,
-    0.0000692606, 0.0000704527, 0.0000716448, 0.0000728369,
-    0.0000737906, 0.0000747442, 0.0000755787, 0.0000762939,
-    0.0000770092, 0.0000778437, 0.0000785589, 0.0000792742,
-    0.0000799894, 0.0000807047, 0.0000814199, 0.0000822544,
-    0.0000829697, 0.0000838041, 0.0000845194, 0.0000854731,
-    0.0000865459, 0.0000876188, 0.0000889301, 0.0000904799,
-    0.0000923872, 0.0000950098, 0.0000988245, 0.0001032352,
-    0.0001088381, 0.0001147985, 0.0001225471, 0.0001319647,
-    0.0001431704, 0.0001568794, 0.0001744032, 0.0001952648,
-    0.0002206564, 0.0002535582, 0.0002965927, 0.0003464222,
-    0.0004109144, 0.0004891157, 0.0005909204, 0.0007261038,
-    0.0008867979, 0.0010721684, 0.0012696981, 0.0015079975,
-    0.0017461777, 0.0019979477, 0.0022052526, 0.0023679733,
-    0.0025173426, 0.0026556253, 0.0027927160, 0.0029264688,
-    0.0030447245, 0.0031807423, 0.0033060312, 0.0034313202,
-    0.0035454035, 0.0036598444, 0.0037686825, 0.0038731098,
-    0.0039769411, 0.0040702820, 0.0041661263, 0.0042562485,
-    0.0043400526, 0.0044249296, 0.0045082569, 0.0045900345,
-    0.0046693087, 0.0047430992, 0.0048171282, 0.0048881769,
-    0.0049589872, 0.0050252676, 0.0050880909, 0.0051497221,
-    0.0052082539, 0.0052671432, 0.0053246021, 0.0053800344,
-    0.0054348707, 0.0054861307, 0.0055367947, 0.0055862665,
-    0.0056355000, 0.0056805611, 0.0057252645, 0.0057705641,
-    0.0058110952, 0.0058538914, 0.0058966875, 0.0059366226,
-    0.0059723854, 0.0060091019, 0.0060437918, 0.0060794353,
-    0.0061159134, 0.0061485767, 0.0061824322, 0.0062153339,
-    0.0062497854, 0.0062820911, 0.0063197613, 0.0063550472,
-    0.0063927174, 0.0064336061, 0.0064769983, 0.0065194368,
-    0.0065603256, 0.0066006184, 0.0066410303, 0.0066826344,
-    0.0067234039, 0.0067654848, 0.0068060160, 0.0068466663,
-    0.0068866014, 0.0069231987, 0.0069609880, 0.0069983006,
-    0.0070366859, 0.0070750713, 0.0071122646, 0.0071535110,
-    0.0071973801, 0.0072410107, 0.0072846413, 0.0073343515,
-    0.0073832273, 0.0074360371, 0.0074878931, 0.0075426102,
-    0.0076007843, 0.0076560974, 0.0077134371, 0.0077683926,
-    0.0078265667, 0.0078855753, 0.0079488754, 0.0080170631,
-    0.0080827475, 0.0081528425, 0.0082212687, 0.0082877874,
-    0.0083510876, 0.0084129572, 0.0084775686, 0.0085455179,
-    0.0086110830, 0.0086781979, 0.0087503195, 0.0088242292,
-    0.0089002848, 0.0089734793, 0.0090423822, 0.0091133118,
-    0.0091816187, 0.0092473030, 0.0093164444, 0.0093911886,
-    0.0094678402, 0.0095427036, 0.0096175671, 0.0096931458,
-    0.0097666979, 0.0098397732, 0.0099166632, 0.0099946260,
-    0.0100749731, 0.0101612806, 0.0102528334, 0.0103493929,
-    0.0104434490, 0.0105448961, 0.0106583834, 0.0107737780,
-    0.0108981133, 0.0110142231, 0.0111318827, 0.0112472773,
-    0.0113576651, 0.0114786625, 0.0116028786, 0.0117331743,
-    0.0118676424, 0.0120122433, 0.0121580362, 0.0123010874,
-    0.0124633312, 0.0126402378, 0.0128232241, 0.0130140781,
-    0.0132108927, 0.0134289265, 0.0136625767, 0.0138912201,
-    0.0141364336, 0.0144006014, 0.0146615505, 0.0149335861,
-    0.0152134895, 0.0155050755, 0.0158376694, 0.0162067413,
-    0.0165973902, 0.0169926882, 0.0174319744, 0.0179271698,
-    0.0184448957, 0.0190744400, 0.0197248459, 0.0204203129,
-    0.0212460756, 0.0221523046, 0.0231562853, 0.0243031979,
-    0.0256397724, 0.0271918774, 0.0289602280, 0.0310072899,
-    0.0333702564, 0.0363805294, 0.0401413441, 0.0443998575,
-    0.0498176813, 0.0562580824, 0.0640066862, 0.0732775927,
-    0.0836604834, 0.0962959528, 0.1122496128, 0.1335854530,
-    0.1608980894, 0.1990102530, 0.2616490126, 0.3926030397
-};
-
-static const float wmavoice_gain_universal[64] = {
-    0.0000000000, 0.0000000000, 0.0000015497, 0.0000015497,
-    0.0000095367, 0.0000164509, 0.0000379086, 0.0000494719,
-    0.0000799894, 0.0001058578, 0.0001349449, 0.0001627207,
-    0.0001972914, 0.0002325773, 0.0002671480, 0.0003106594,
-    0.0003589392, 0.0004127026, 0.0004582405, 0.0005071163,
-    0.0005759001, 0.0006588697, 0.0007554293, 0.0008602142,
-    0.0009772778, 0.0011068583, 0.0012603998, 0.0013889074,
-    0.0015437603, 0.0016924143, 0.0018980503, 0.0021264553,
-    0.0023632050, 0.0025693178, 0.0028522015, 0.0031896830,
-    0.0034654140, 0.0037885904, 0.0041683912, 0.0046081543,
-    0.0050576925, 0.0055632591, 0.0061818361, 0.0068151951,
-    0.0073953867, 0.0081818104, 0.0091186762, 0.0102789402,
-    0.0119919777, 0.0134155750, 0.0154829025, 0.0173798800,
-    0.0199711323, 0.0229473114, 0.0268185139, 0.0319474936,
-    0.0393068790, 0.0460114479, 0.0523469448, 0.0637906790,
-    0.0845471621, 0.1105458736, 0.1499300003, 0.2219169140
-};
-
-static const float wmavoice_gain_codebook_acb[128] = {
-    0.05, 0.14, 0.16, 0.05, 0.17, 0.25, 0.07, 0.21,
-    0.12, 0.22, 0.23, 0.13, 0.24, 0.32, 0.14, 0.29,
-    0.31, 0.41, 0.43, 0.32, 0.43, 0.51, 0.34, 0.48,
-    0.38, 0.47, 0.49, 0.38, 0.49, 0.57, 0.40, 0.54,
-    0.49, 0.59, 0.61, 0.50, 0.61, 0.69, 0.52, 0.66,
-    0.56, 0.65, 0.67, 0.56, 0.67, 0.75, 0.58, 0.72,
-    0.65, 0.74, 0.76, 0.65, 0.76, 0.84, 0.67, 0.81,
-    0.71, 0.80, 0.82, 0.71, 0.82, 0.90, 0.73, 0.87,
-    0.81, 0.90, 0.92, 0.81, 0.93, 1.01, 0.83, 0.97,
-    0.87, 0.96, 0.98, 0.87, 0.98, 1.06, 0.89, 1.03,
-    0.92, 1.02, 1.04, 0.93, 1.04, 1.12, 0.95, 1.09,
-    0.93, 1.02, 1.04, 0.93, 1.04, 1.12, 0.95, 1.09,
-    0.94, 1.04, 1.05, 0.10, 1.06, 1.14, 0.96, 1.11,
-    0.98, 1.08, 1.10, 0.99, 1.10, 1.18, 1.01, 1.15,
-    1.06, 1.15, 1.17, 1.06, 1.17, 1.25, 1.08, 1.22,
-    1.16, 1.25, 1.27, 1.16, 1.28, 1.36, 1.18, 1.32
-};
-
-static const float wmavoice_gain_codebook_fcb[128] = {
-    -0.8439700703 /* log(0.430) */, -0.6143360001 /* log(0.541) */,
-    -0.1531511795 /* log(0.858) */, -0.0998203353 /* log(0.905) */,
-     0.3213585988 /* log(1.379) */,  0.3777512695 /* log(1.459) */,
-     0.7158866675 /* log(2.046) */,  1.2700414043 /* log(3.561) */,
-    -1.6873994539 /* log(0.185) */, -1.2173958247 /* log(0.296) */,
-    -0.4893903430 /* log(0.613) */, -0.4155154440 /* log(0.660) */,
-     0.1257512053 /* log(1.134) */,  0.1947440768 /* log(1.215) */,
-     0.5883420662 /* log(1.801) */,  1.1987592373 /* log(3.316) */,
-    -1.3586791941 /* log(0.257) */, -0.9996723408 /* log(0.368) */,
-    -0.3768776513 /* log(0.686) */, -0.3119747650 /* log(0.732) */,
-     0.1881379421 /* log(1.207) */,  0.2523139286 /* log(1.287) */,
-     0.6280751838 /* log(1.874) */,  1.2202397768 /* log(3.388) */,
-    -0.7381445465 /* log(0.478) */, -0.5310283311 /* log(0.588) */,
-    -0.0987159729 /* log(0.906) */, -0.0491902442 /* log(0.952) */,
-     0.3555743385 /* log(1.427) */,  0.4101209196 /* log(1.507) */,
-     0.7390761124 /* log(2.094) */,  1.2831536022 /* log(3.608) */,
-    -0.2497442331 /* log(0.779) */, -0.1165338163 /* log(0.890) */,
-     0.1881379421 /* log(1.207) */,  0.2255406759 /* log(1.253) */,
-     0.5469646704 /* log(1.728) */,  0.5922212620 /* log(1.808) */,
-     0.8733832309 /* log(2.395) */,  1.3632815868 /* log(3.909) */,
-    -1.3903023825 /* log(0.249) */, -1.0216512475 /* log(0.360) */,
-    -0.3900840061 /* log(0.677) */, -0.3229638866 /* log(0.724) */,
-     0.1806534997 /* log(1.198) */,  0.2460785226 /* log(1.279) */,
-     0.6232610531 /* log(1.865) */,  1.2178757095 /* log(3.380) */,
-    -0.6033064766 /* log(0.547) */, -0.4185503477 /* log(0.658) */,
-    -0.0253178080 /* log(0.975) */,  0.0217614918 /* log(1.022) */,
-     0.4027948796 /* log(1.496) */,  0.4555243080 /* log(1.577) */,
-     0.7714961470 /* log(2.163) */,  1.3023691262 /* log(3.678) */,
-    -1.1056369036 /* log(0.331) */, -0.8164453969 /* log(0.442) */,
-    -0.2757535016 /* log(0.759) */, -0.2156715365 /* log(0.806) */,
-     0.2468600779 /* log(1.280) */,  0.3082197237 /* log(1.361) */,
-     0.6662897264 /* log(1.947) */,  1.2418464568 /* log(3.462) */,
-    -0.5395680926 /* log(0.583) */, -0.3652833185 /* log(0.694) */,
-     0.0109399400 /* log(1.011) */,  0.0554347069 /* log(1.057) */,
-     0.4265740713 /* log(1.532) */,  0.4774756441 /* log(1.612) */,
-     0.7880027116 /* log(2.199) */,  1.3118401752 /* log(3.713) */,
-    -0.9571127264 /* log(0.384) */, -0.7031975164 /* log(0.495) */,
-    -0.2082549388 /* log(0.812) */, -0.1519863570 /* log(0.859) */,
-     0.2874320412 /* log(1.333) */,  0.3464225675 /* log(1.414) */,
-     0.6931471806 /* log(2.000) */,  1.2570395253 /* log(3.515) */,
-    -0.2420715612 /* log(0.785) */, -0.1098148660 /* log(0.896) */,
-     0.1930966300 /* log(1.213) */,  0.2311117210 /* log(1.260) */,
-     0.5504308784 /* log(1.734) */,  0.5960854677 /* log(1.815) */,
-     0.8758853172 /* log(2.401) */,  1.3650707247 /* log(3.916) */,
-     0.6564831962 /* log(1.928) */,  0.7124594916 /* log(2.039) */,
-     0.8569652658 /* log(2.356) */,  0.8767179568 /* log(2.403) */,
-     1.0567480846 /* log(2.877) */,  1.0841752409 /* log(2.957) */,
-     1.2652560327 /* log(3.544) */,  1.6211688353 /* log(5.059) */,
-    -1.5417792640 /* log(0.214) */, -1.1239300967 /* log(0.325) */,
-    -0.4431669753 /* log(0.642) */, -5.2983173665 /* log(0.005) */,
-     0.1510028735 /* log(1.163) */,  0.2183319943 /* log(1.244) */,
-     0.6043159669 /* log(1.830) */,  1.2074666936 /* log(3.345) */,
-    -0.5124936809 /* log(0.599) */, -0.3424903089 /* log(0.710) */,
-     0.0266419309 /* log(1.027) */,  0.0713899961 /* log(1.074) */,
-     0.4369637752 /* log(1.548) */,  0.4879663296 /* log(1.629) */,
-     0.7952524035 /* log(2.215) */,  1.3164082337 /* log(3.730) */,
-    -0.8867319296 /* log(0.412) */, -0.6481738149 /* log(0.523) */,
-    -0.1743533871 /* log(0.840) */, -0.1199102967 /* log(0.887) */,
-     0.3089542077 /* log(1.362) */,  0.3660310389 /* log(1.442) */,
-     0.7075430608 /* log(2.029) */,  1.2649738259 /* log(3.543) */,
-    -0.0943106795 /* log(0.910) */,  0.0207825392 /* log(1.021) */,
-     0.2911759617 /* log(1.338) */,  0.3249778572 /* log(1.384) */,
-     0.6200387087 /* log(1.859) */,  0.6621723763 /* log(1.939) */,
-     0.9266370239 /* log(2.526) */,  1.3962446920 /* log(4.040) */
-};
-
-static const float wmavoice_ipol1_coeffs[17*9] = {
-     0,
-     0.6308171151,  0.7613050340,  0.8632577061,  0.9280143976,
-     0.9499985575,  0.9273047447,  0.8618999123,  0.7594153284,
-    -0.1791058179, -0.1351341452, -0.0589959878,  0.0472882274,
-     0.1784339990,  0.3262237605,  0.4801855979,  0.6285545824,
-     0,
-    -0.1921342459, -0.1786532696, -0.1341681625, -0.0575229186,
-     0.0492091286,  0.1806929555,  0.3286687729,  0.4826357064,
-     0.0807464118,  0.0506337392,  0.0080115446, -0.0428523305,
-    -0.0958572026, -0.1436148431, -0.1782128509, -0.1921164688,
-     0,
-     0.0960653644,  0.0803771760,  0.0500416081,  0.0072485465,
-    -0.0437018941, -0.0966834794, -0.1442930843, -0.1786170151,
-    -0.0391932014, -0.0189622506,  0.0070230183,  0.0356589290,
-     0.0630142610,  0.0847979258,  0.0969368290,  0.0961942221,
-     0,
-    -0.0515680681, -0.0389267015, -0.0185848991,  0.0074699190,
-     0.0361179407,  0.0634181346,  0.0850781347,  0.0970333587,
-     0.0178811825,  0.0048708571, -0.0108041526, -0.0271167825,
-    -0.0416534986, -0.0519338618, -0.0557823736, -0.0517020743,
-     0,
-     0.0267091128,  0.0177022810,  0.0046363524, -0.0110662053,
-    -0.0273700613, -0.0418578978, -0.0520511451, -0.0557823028,
-    -0.0069270437,  0.0008217385,  0.0097293532,  0.0185749526,
-     0.0259542684,  0.0304777338,  0.0309953480,  0.0268154419,
-     0,
-    -0.0125539196, -0.0068173436,  0.0009580161,  0.0098749646,
-     0.0187084037,  0.0260526291,  0.0305201071,  0.0309665180,
-     0.0019149571, -0.0022503408, -0.0068592466, -0.0112465904,
-    -0.0146595868, -0.0163685936, -0.0157934162, -0.0126258885,
-     0,
-     0.0050976076,  0.0018546581, -0.0023221741, -0.0069331308,
-    -0.0113109085, -0.0147021576, -0.0163786146, -0.0157635096,
-    -0.0001162733,  0.0019313511,  0.0040823850,  0.0060192454,
-     0.0073876535,  0.0078486321,  0.0071403184,  0.0051400312,
-     0,
-    -0.0017920607, -0.0000857157,  0.0019657183,  0.0041159806,
-     0.0060465694,  0.0074030068,  0.0078470460,  0.0071185785,
-    -0.0004100171, -0.0015364708, -0.0025490071, -0.0033188616,
-    -0.0037196307, -0.0036417283, -0.0030119629, -0.0018155784,
-     0,
-     0.0006907531, -0.0004282868, -0.0015539061, -0.0025635813,
-    -0.0033285026, -0.0037224069, -0.0036361245, -0.0029972247,
-     0, 0, 0, 0, 0, 0, 0, 0
-};
-
-/**
- * Hamming-window sinc function (num = 32, x = [ 0, 31 ]):
- * (0.54 + 0.46 * cos(2 * M_PI * x / (num - 1))) *
- *     sin(x * M_PI / 4) / (x * M_PI / 4)
- */
-static const float wmavoice_ipol2_coeffs[32] = {
-    1,  0.8563459515,  0.5888634918,  0.2648358640,
-    0, -0.1360490318, -0.1434589471, -0.0758505310,
-    0,  0.0410402636,  0.0412485781,  0.0200064587,
-    0, -0.0081391358, -0.0068223253, -0.0029313546,
-    0,  0.0025864919,  0.0053062555,  0.0055688801,
-    0, -0.0104795941, -0.0187493577, -0.0160592399,
-    0,  0.0212381664,  0.0331059131,  0.0251942366,
-    0, -0.0273968070, -0.0392575669, -0.0276240534
-};
-
-/**
- * LUT for 1.071575641632 * pow(1.0331663, n - 127)
- */
-static const float wmavoice_energy_table[128] = {
-    0.0169982178, 0.0175619858, 0.0181444519, 0.0187462362,
-    0.0193679795, 0.0200103437, 0.0206740128, 0.0213596933,
-    0.0220681153, 0.0228000330, 0.0235562258, 0.0243374986,
-    0.0251446834, 0.0259786395, 0.0268402549, 0.0277304468,
-    0.0286501631, 0.0296003830, 0.0305821182, 0.0315964139,
-    0.0326443501, 0.0337270424, 0.0348456436, 0.0360013446,
-    0.0371953760, 0.0384290090, 0.0397035571, 0.0410203772,
-    0.0423808713, 0.0437864880, 0.0452387238, 0.0467391249,
-    0.0482892887, 0.0498908657, 0.0515455612, 0.0532551367,
-    0.0550214125, 0.0568462692, 0.0587316496, 0.0606795611,
-    0.0626920777, 0.0647713419, 0.0669195677, 0.0691390421,
-    0.0714321284, 0.0738012678, 0.0762489827, 0.0787778794,
-    0.0813906502, 0.0840900769, 0.0868790336, 0.0897604897,
-    0.0927375130, 0.0958132732, 0.0989910450, 0.1022742117,
-    0.1056662688, 0.1091708280, 0.1127916204, 0.1165325012,
-    0.1203974531, 0.1243905911, 0.1285161668, 0.1327785725,
-    0.1371823465, 0.1417321773, 0.1464329093, 0.1512895470,
-    0.1563072616, 0.1614913951, 0.1668474671, 0.1723811803,
-    0.1780984262, 0.1840052921, 0.1901080668, 0.1964132480,
-    0.2029275487, 0.2096579046, 0.2166114816, 0.2237956830,
-    0.2312181577, 0.2388868085, 0.2468098001, 0.2549955679,
-    0.2634528274, 0.2721905830, 0.2812181375, 0.2905451026,
-    0.3001814086, 0.3101373153, 0.3204234225, 0.3310506819,
-    0.3420304081, 0.3533742912, 0.3650944090, 0.3772032397,
-    0.3897136755, 0.4026390362, 0.4159930832, 0.4297900346,
-    0.4440445799, 0.4587718956, 0.4739876619, 0.4897080789,
-    0.5059498840, 0.5227303696, 0.5400674019, 0.5579794393,
-    0.5764855528, 0.5956054456, 0.6153594745, 0.6357686714,
-    0.6568547659, 0.6786402082, 0.7011481929, 0.7244026842,
-    0.7484284410, 0.7732510432, 0.7988969192, 0.8253933741,
-    0.8527686184, 0.8810517982, 0.9102730265, 0.9404634147,
-    0.9716551065, 1.0038813113, 1.0371763400, 1.0715756416
-};
-
-/**
- * LUT for f(x,y) = pow((y + 6.9) / 64, 0.025 * (x + 1)).
- */
-static const float wmavoice_denoise_power_table[12][64] = {
-    { 0.9458379339, 0.9490436287, 0.9518757236, 0.9544130754,
-      0.9567118717, 0.9588135761, 0.9607496688, 0.9625446194,
-      0.9642178285, 0.9657849396, 0.9672587526, 0.9686498743,
-      0.9699671937, 0.9712182343, 0.9724094211, 0.9735462842,
-      0.9746336187, 0.9756756090, 0.9766759291, 0.9776378218,
-      0.9785641645, 0.9794575217, 0.9803201890, 0.9811542296,
-      0.9819615045, 0.9827436985, 0.9835023412, 0.9842388263,
-      0.9849544265, 0.9856503078, 0.9863275406, 0.9869871101,
-      0.9876299254, 0.9882568267, 0.9888685922, 0.9894659445,
-      0.9900495551, 0.9906200497, 0.9911780119, 0.9917239872,
-      0.9922584859, 0.9927819864, 0.9932949377, 0.9937977618,
-      0.9942908555, 0.9947745929, 0.9952493267, 0.9957153901,
-      0.9961730980, 0.9966227482, 0.9970646231, 0.9974989903,
-      0.9979261037, 0.9983462046, 0.9987595223, 0.9991662752,
-      0.9995666709, 0.9999609077, 1.0003491745, 1.0007316515,
-      1.0011085110, 1.0014799178, 1.0018460292, 1.0022069960 },
-    { 0.8946093973, 0.9006838092, 0.9060673931, 0.9109043185,
-      0.9152976055, 0.9193234737, 0.9230399260, 0.9264921443,
-      0.9297160207, 0.9327405496, 0.9355894944, 0.9382825789,
-      0.9408363568, 0.9432648587, 0.9455800822, 0.9477923675,
-      0.9499106907, 0.9519428941, 0.9538958704, 0.9557757107,
-      0.9575878241, 0.9593370368, 0.9610276730, 0.9626636222,
-      0.9642483964, 0.9657851769, 0.9672768552, 0.9687260672,
-      0.9701352224, 0.9715065293, 0.9728420173, 0.9741435556,
-      0.9754128696, 0.9766515555, 0.9778610927, 0.9790428553,
-      0.9801981216, 0.9813280829, 0.9824338513, 0.9835164667,
-      0.9845769028, 0.9856160726, 0.9866348334, 0.9876339913,
-      0.9886143053, 0.9895764906, 0.9905212223, 0.9914491381,
-      0.9923608411, 0.9932569022, 0.9941378627, 0.9950042356,
-      0.9958565084, 0.9966951442, 0.9975205834, 0.9983332454,
-      0.9991335296, 0.9999218170, 1.0006984708, 1.0014638383,
-      1.0022182509, 1.0029620257, 1.0036954662, 1.0044188628 },
-    { 0.8461555040, 0.8547882305, 0.8624635555, 0.8693789920,
-      0.8756760853, 0.8814598273, 0.8868103032, 0.8917900284,
-      0.8964487626, 0.9008267754, 0.9049571273, 0.9088673021,
-      0.9125804007, 0.9161160306, 0.9194909803, 0.9227197376,
-      0.9258148939, 0.9287874629, 0.9316471355, 0.9344024839,
-      0.9370611291, 0.9396298766, 0.9421148300, 0.9445214846,
-      0.9468548060, 0.9491192967, 0.9513190517, 0.9534578074,
-      0.9555389816, 0.9575657096, 0.9595408742, 0.9614671327,
-      0.9633469396, 0.9651825670, 0.9669761222, 0.9687295635,
-      0.9704447142, 0.9721232742, 0.9737668316, 0.9753768718,
-      0.9769547868, 0.9785018824, 0.9800193854, 0.9815084500,
-      0.9829701633, 0.9844055505, 0.9858155796, 0.9872011653,
-      0.9885631734, 0.9899024236, 0.9912196934, 0.9925157203,
-      0.9937912053, 0.9950468143, 0.9962831814, 0.9975009102,
-      0.9987005760, 0.9998827277, 1.0010478892, 1.0021965608,
-      1.0033292209, 1.0044463270, 1.0055483173, 1.0066356112 },
-    { 0.8003259737, 0.8112313241, 0.8209581209, 0.8297466775,
-      0.8377697066, 0.8451556492, 0.8520027051, 0.8583876935,
-      0.8643718792, 0.8700049328, 0.8753277020, 0.8803741979,
-      0.8851730502, 0.8897485937, 0.8941216918, 0.8983103719,
-      0.9023303202, 0.9061952736, 0.9099173316, 0.9135072091,
-      0.9169744409, 0.9203275502, 0.9235741882, 0.9267212496,
-      0.9297749699, 0.9327410079, 0.9356245146, 0.9384301933,
-      0.9411623497, 0.9438249364, 0.9464215906, 0.9489556668,
-      0.9514302661, 0.9538482608, 0.9562123167, 0.9585249126,
-      0.9607883576, 0.9630048062, 0.9651762722, 0.9673046403,
-      0.9693916775, 0.9714390425, 0.9734482944, 0.9754209007,
-      0.9773582446, 0.9792616307, 0.9811322918, 0.9829713934,
-      0.9847800389, 0.9865592739, 0.9883100900, 0.9900334289,
-      0.9917301853, 0.9934012104, 0.9950473143, 0.9966692689,
-      0.9982678100, 0.9998436400, 1.0013974295, 1.0029298194,
-      1.0044414224, 1.0059328250, 1.0074045889, 1.0088572520 },
-    { 0.7569786654, 0.7698939195, 0.7814501054, 0.7919210783,
-      0.8015042240, 0.8103467104, 0.8185613167, 0.8262364557,
-      0.8334427763, 0.8402376615, 0.8466683811, 0.8527743561,
-      0.8585888194, 0.8641400582, 0.8694523567, 0.8745467247,
-      0.8794414652, 0.8841526254, 0.8886943552, 0.8930791981,
-      0.8973183276, 0.9014217415, 0.9053984227, 0.9092564737,
-      0.9130032283, 0.9166453478, 0.9201889007, 0.9236394320,
-      0.9270020224, 0.9302813390, 0.9334816797, 0.9366070112,
-      0.9396610028, 0.9426470554, 0.9455683275, 0.9484277579,
-      0.9512280860, 0.9539718690, 0.9566614986, 0.9592992147,
-      0.9618871182, 0.9644271823, 0.9669212630, 0.9693711079,
-      0.9717783651, 0.9741445900, 0.9764712529, 0.9787597445,
-      0.9810113822, 0.9832274148, 0.9854090274, 0.9875573457,
-      0.9896734398, 0.9917583281, 0.9938129803, 0.9958383209,
-      0.9978352315, 0.9998045539, 1.0017470919, 1.0036636145,
-      1.0055548568, 1.0074215229, 1.0092642871, 1.0110837959 },
-    { 0.7159791370, 0.7306629191, 0.7438433845, 0.7558198318,
-      0.7668086064, 0.7769714272, 0.7864325139, 0.7952894548,
-      0.8036203840, 0.8114888792, 0.8189474022, 0.8260397728,
-      0.8328029877, 0.8392685815, 0.8454636629, 0.8514117142,
-      0.8571332177, 0.8626461513, 0.8679663850, 0.8731080020,
-      0.8780835596, 0.8829043049, 0.8875803529, 0.8921208349,
-      0.8965340237, 0.9008274393, 0.9050079382, 0.9090817905,
-      0.9130547454, 0.9169320882, 0.9207186893, 0.9244190474,
-      0.9280373261, 0.9315773876, 0.9350428208, 0.9384369673,
-      0.9417629433, 0.9450236603, 0.9482218422, 0.9513600421,
-      0.9544406555, 0.9574659338, 0.9604379957, 0.9633588374,
-      0.9662303420, 0.9690542879, 0.9718323569, 0.9745661408,
-      0.9772571477, 0.9799068082, 0.9825164805, 0.9850874551,
-      0.9876209597, 0.9901181627, 0.9925801775, 0.9950080658,
-      0.9974028405, 0.9997654692, 1.0020968764, 1.0043979464,
-      1.0066695255, 1.0089124239, 1.0111274185, 1.0133152537 },
-    { 0.6772002277, 0.6934309881, 0.7080464599, 0.7213643301,
-      0.7336148970, 0.7449707526, 0.7555647772, 0.7655015856,
-      0.7748651015, 0.7837237382, 0.7921340426, 0.8001433220,
-      0.8077915768, 0.8151129499, 0.8221368310, 0.8288887107,
-      0.8353908496, 0.8416628090, 0.8477218755, 0.8535834053,
-      0.8592611049, 0.8647672624, 0.8701129393, 0.8753081305,
-      0.8803618988, 0.8852824894, 0.8900774261, 0.8947535945,
-      0.8993173131, 0.9037743949, 0.9081302004, 0.9123896841,
-      0.9165574352, 0.9206377129, 0.9246344779, 0.9285514202,
-      0.9323919830, 0.9361593853, 0.9398566405, 0.9434865742,
-      0.9470518396, 0.9505549317, 0.9539981992, 0.9573838564,
-      0.9607139933, 0.9639905847, 0.9672154989, 0.9703905051,
-      0.9735172803, 0.9765974162, 0.9796324243, 0.9826237418,
-      0.9855727362, 0.9884807098, 0.9913489039, 0.9941785028,
-      0.9969706369, 0.9997263861, 1.0024467831, 1.0051328157,
-      1.0077854297, 1.0104055314, 1.0129939892, 1.0155516364 },
-    { 0.6405216642, 0.6580962612, 0.6739722363, 0.6884795488,
-      0.7018580813, 0.7142880714, 0.7259086094, 0.7368294324,
-      0.7471387455, 0.7569085832, 0.7661985859, 0.7750587283,
-      0.7835313288, 0.7916525600, 0.7994535998, 0.8069615243,
-      0.8142000068, 0.8211898738, 0.8279495504, 0.8344954211,
-      0.8408421252, 0.8470027997, 0.8529892811, 0.8588122744,
-      0.8644814947, 0.8700057878, 0.8753932324, 0.8806512276,
-      0.8857865684, 0.8908055105, 0.8957138271, 0.9005168576,
-      0.9052195513, 0.9098265046, 0.9143419945, 0.9187700080,
-      0.9231142680, 0.9273782568, 0.9315652364, 0.9356782672,
-      0.9397202245, 0.9436938133, 0.9476015819, 0.9514459336,
-      0.9552291382, 0.9589533414, 0.9626205741, 0.9662327603,
-      0.9697917251, 0.9732992008, 0.9767568340, 0.9801661903,
-      0.9835287605, 0.9868459649, 0.9901191578, 0.9933496315,
-      0.9965386205, 0.9996873045, 1.0027968119, 1.0058682226,
-      1.0089025710, 1.0119008485, 1.0148640056, 1.0177929548 },
-    { 0.6058296875, 0.6245620637, 0.6415378101, 0.6570938835,
-      0.6714759586, 0.6848691001, 0.6974164561, 0.7092312055,
-      0.7204044988, 0.7310109103, 0.7411122884, 0.7507605397,
-      0.7599996842, 0.7688674015, 0.7773962122, 0.7856143935,
-      0.7935466990, 0.8012149303, 0.8086383963, 0.8158342858,
-      0.8228179717, 0.8296032631, 0.8362026133, 0.8426272954,
-      0.8488875492, 0.8549927056, 0.8609512936, 0.8667711307,
-      0.8724594015, 0.8780227256, 0.8834672161, 0.8887985309,
-      0.8940219180, 0.8991422543, 0.9041640810, 0.9090916337,
-      0.9139288704, 0.9186794948, 0.9233469789, 0.9279345818,
-      0.9324453671, 0.9368822185, 0.9412478543, 0.9455448393,
-      0.9497755970, 0.9539424198, 0.9580474782, 0.9620928299,
-      0.9660804271, 0.9700121244, 0.9738896845, 0.9777147851,
-      0.9814890239, 0.9852139236, 0.9888909370, 0.9925214512,
-      0.9961067913, 0.9996482244, 1.0031469629, 1.0066041676,
-      1.0100209506, 1.0133983785, 1.0167374742, 1.0200392198 },
-    { 0.5730166999, 0.5927366473, 0.6106642672, 0.6271389942,
-      0.6424090212, 0.6566617910, 0.6700426292, 0.6826666808,
-      0.6946268614, 0.7059993279, 0.7168473476, 0.7272241023,
-      0.7371747608, 0.7467380401, 0.7559474006, 0.7648319736,
-      0.7734172908, 0.7817258650, 0.7897776570, 0.7975904541,
-      0.8051801811, 0.8125611560, 0.8197463039, 0.8267473349,
-      0.8335748949, 0.8402386937, 0.8467476129, 0.8531098003,
-      0.8593327495, 0.8654233698, 0.8713880464, 0.8772326935,
-      0.8829628002, 0.8885834710, 0.8940994619, 0.8995152120,
-      0.9048348715, 0.9100623268, 0.9152012229, 0.9202549833,
-      0.9252268281, 0.9301197899, 0.9349367288, 0.9396803449,
-      0.9443531909, 0.9489576823, 0.9534961076, 0.9579706374,
-      0.9623833320, 0.9667361492, 0.9710309512, 0.9752695109,
-      0.9794535174, 0.9835845813, 0.9876642399, 0.9916939614,
-      0.9956751493, 0.9996091459, 1.0034972362, 1.0073406510,
-      1.0111405700, 1.0148981248, 1.0186144013, 1.0222904422 },
-    { 0.5419809316, 0.5625329386, 0.5812764912, 0.5985496562,
-      0.6146003370, 0.6296162401, 0.6437432340, 0.6570971404,
-      0.6697716039, 0.6818435182, 0.6933768712, 0.7044255353,
-      0.7150353340, 0.7252456009, 0.7350903742, 0.7445993259,
-      0.7537984929, 0.7627108595, 0.7713568269, 0.7797545943,
-      0.7879204712, 0.7958691361, 0.8036138516, 0.8111666444,
-      0.8185384580, 0.8257392814, 0.8327782597, 0.8396637886,
-      0.8464035955, 0.8530048108, 0.8594740287, 0.8658173611,
-      0.8720404845, 0.8781486812, 0.8841468762, 0.8900396688,
-      0.8958313620, 0.9015259874, 0.9071273286, 0.9126389413,
-      0.9180641715, 0.9234061727, 0.9286679198, 0.9338522236,
-      0.9389617420, 0.9439989920, 0.9489663591, 0.9538661069,
-      0.9587003852, 0.9634712378, 0.9681806094, 0.9728303524,
-      0.9774222323, 0.9819579336, 0.9864390644, 0.9908671615,
-      0.9952436943, 0.9995700689, 1.0038476318, 1.0080776733,
-      1.0122614305, 1.0164000906, 1.0204947932, 1.0245466331 },
-    { 0.5126261246, 0.5338683013, 0.5533029807, 0.5712636181,
-      0.5879954388, 0.6036845987, 0.6184760989, 0.6324853169,
-      0.6458057215, 0.6585142011, 0.6706748475, 0.6823417062,
-      0.6935608163, 0.7043717519, 0.7148088052, 0.7249019070,
-      0.7346773529, 0.7441583823, 0.7533656456, 0.7623175831,
-      0.7710307376, 0.7795200117, 0.7877988829, 0.7958795841,
-      0.8037732557, 0.8114900754, 0.8190393682, 0.8264297018,
-      0.8336689680, 0.8407644543, 0.8477229049, 0.8545505751,
-      0.8612532786, 0.8678364291, 0.8743050768, 0.8806639416,
-      0.8869174414, 0.8930697184, 0.8991246621, 0.9050859297,
-      0.9109569648, 0.9167410144, 0.9224411436, 0.9280602496,
-      0.9336010737, 0.9390662129, 0.9444581300, 0.9497791628,
-      0.9550315328, 0.9602173528, 0.9653386345, 0.9703972943,
-      0.9753951600, 0.9803339761, 0.9852154088, 0.9900410510,
-      0.9948124263, 0.9995309934, 1.0041981497, 1.0088152348,
-      1.0133835335, 1.0179042791, 1.0223786564, 1.0268078035 },
-};
-
-#endif /* AVCODEC_WMAVOICE_DATA_H */
diff --git a/deps/libav/libavcodec/wmv2.c b/deps/libav/libavcodec/wmv2.c
deleted file mode 100644
index 9ba9451..0000000
--- a/deps/libav/libavcodec/wmv2.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2002 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "msmpeg4data.h"
-#include "simple_idct.h"
-#include "wmv2.h"
-
-
-av_cold void ff_wmv2_common_init(Wmv2Context * w){
-    MpegEncContext * const s= &w->s;
-
-    ff_wmv2dsp_init(&w->wdsp);
-    s->dsp.idct_permutation_type = w->wdsp.idct_perm;
-    ff_init_scantable_permutation(s->dsp.idct_permutation,
-                                  w->wdsp.idct_perm);
-    ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0],
-                      ff_wmv2_scantableA);
-    ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1],
-                      ff_wmv2_scantableB);
-    ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable,
-                      ff_wmv1_scantable[1]);
-    ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable,
-                      ff_wmv1_scantable[2]);
-    ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable,
-                      ff_wmv1_scantable[3]);
-    ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable,
-                      ff_wmv1_scantable[0]);
-    s->dsp.idct_put = w->wdsp.idct_put;
-    s->dsp.idct_add = w->wdsp.idct_add;
-    s->dsp.idct     = NULL;
-}
-
-static void wmv2_add_block(Wmv2Context *w, int16_t *block1, uint8_t *dst, int stride, int n){
-    MpegEncContext * const s= &w->s;
-
-  if (s->block_last_index[n] >= 0) {
-    switch(w->abt_type_table[n]){
-    case 0:
-        w->wdsp.idct_add(dst, stride, block1);
-        break;
-    case 1:
-        ff_simple_idct84_add(dst           , stride, block1);
-        ff_simple_idct84_add(dst + 4*stride, stride, w->abt_block2[n]);
-        s->dsp.clear_block(w->abt_block2[n]);
-        break;
-    case 2:
-        ff_simple_idct48_add(dst           , stride, block1);
-        ff_simple_idct48_add(dst + 4       , stride, w->abt_block2[n]);
-        s->dsp.clear_block(w->abt_block2[n]);
-        break;
-    default:
-        av_log(s->avctx, AV_LOG_ERROR, "internal error in WMV2 abt\n");
-    }
-  }
-}
-
-void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr){
-    Wmv2Context * const w= (Wmv2Context*)s;
-
-    wmv2_add_block(w, block1[0], dest_y                    , s->linesize, 0);
-    wmv2_add_block(w, block1[1], dest_y + 8                , s->linesize, 1);
-    wmv2_add_block(w, block1[2], dest_y +     8*s->linesize, s->linesize, 2);
-    wmv2_add_block(w, block1[3], dest_y + 8 + 8*s->linesize, s->linesize, 3);
-
-    if(s->flags&CODEC_FLAG_GRAY) return;
-
-    wmv2_add_block(w, block1[4], dest_cb                   , s->uvlinesize, 4);
-    wmv2_add_block(w, block1[5], dest_cr                   , s->uvlinesize, 5);
-}
-
-void ff_mspel_motion(MpegEncContext *s,
-                               uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
-                               uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
-                               int motion_x, int motion_y, int h)
-{
-    Wmv2Context * const w= (Wmv2Context*)s;
-    uint8_t *ptr;
-    int dxy, offset, mx, my, src_x, src_y, v_edge_pos;
-    ptrdiff_t linesize, uvlinesize;
-    int emu=0;
-
-    dxy = ((motion_y & 1) << 1) | (motion_x & 1);
-    dxy = 2*dxy + w->hshift;
-    src_x = s->mb_x * 16 + (motion_x >> 1);
-    src_y = s->mb_y * 16 + (motion_y >> 1);
-
-    /* WARNING: do no forget half pels */
-    v_edge_pos = s->v_edge_pos;
-    src_x = av_clip(src_x, -16, s->width);
-    src_y = av_clip(src_y, -16, s->height);
-
-    if(src_x<=-16 || src_x >= s->width)
-        dxy &= ~3;
-    if(src_y<=-16 || src_y >= s->height)
-        dxy &= ~4;
-
-    linesize   = s->linesize;
-    uvlinesize = s->uvlinesize;
-    ptr = ref_picture[0] + (src_y * linesize) + src_x;
-
-    if(src_x<1 || src_y<1 || src_x + 17  >= s->h_edge_pos
-                          || src_y + h+1 >= v_edge_pos){
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
-                                 ptr - 1 - s->linesize,
-                                 s->linesize, s->linesize,
-                                 19, 19,
-                                 src_x - 1, src_y - 1,
-                                 s->h_edge_pos, s->v_edge_pos);
-        ptr= s->edge_emu_buffer + 1 + s->linesize;
-        emu=1;
-    }
-
-    s->dsp.put_mspel_pixels_tab[dxy](dest_y             , ptr             , linesize);
-    s->dsp.put_mspel_pixels_tab[dxy](dest_y+8           , ptr+8           , linesize);
-    s->dsp.put_mspel_pixels_tab[dxy](dest_y  +8*linesize, ptr  +8*linesize, linesize);
-    s->dsp.put_mspel_pixels_tab[dxy](dest_y+8+8*linesize, ptr+8+8*linesize, linesize);
-
-    if(s->flags&CODEC_FLAG_GRAY) return;
-
-    if (s->out_format == FMT_H263) {
-        dxy = 0;
-        if ((motion_x & 3) != 0)
-            dxy |= 1;
-        if ((motion_y & 3) != 0)
-            dxy |= 2;
-        mx = motion_x >> 2;
-        my = motion_y >> 2;
-    } else {
-        mx = motion_x / 2;
-        my = motion_y / 2;
-        dxy = ((my & 1) << 1) | (mx & 1);
-        mx >>= 1;
-        my >>= 1;
-    }
-
-    src_x = s->mb_x * 8 + mx;
-    src_y = s->mb_y * 8 + my;
-    src_x = av_clip(src_x, -8, s->width >> 1);
-    if (src_x == (s->width >> 1))
-        dxy &= ~1;
-    src_y = av_clip(src_y, -8, s->height >> 1);
-    if (src_y == (s->height >> 1))
-        dxy &= ~2;
-    offset = (src_y * uvlinesize) + src_x;
-    ptr = ref_picture[1] + offset;
-    if(emu){
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
-                                 s->uvlinesize, s->uvlinesize,
-                                 9, 9,
-                                 src_x, src_y,
-                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-        ptr= s->edge_emu_buffer;
-    }
-    pix_op[1][dxy](dest_cb, ptr, uvlinesize, h >> 1);
-
-    ptr = ref_picture[2] + offset;
-    if(emu){
-        s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
-                                 s->uvlinesize, s->uvlinesize,
-                                 9, 9,
-                                 src_x, src_y,
-                                 s->h_edge_pos >> 1, s->v_edge_pos >> 1);
-        ptr= s->edge_emu_buffer;
-    }
-    pix_op[1][dxy](dest_cr, ptr, uvlinesize, h >> 1);
-}
diff --git a/deps/libav/libavcodec/wmv2.h b/deps/libav/libavcodec/wmv2.h
deleted file mode 100644
index e01f6c1..0000000
--- a/deps/libav/libavcodec/wmv2.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2002 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_WMV2_H
-#define AVCODEC_WMV2_H
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "intrax8.h"
-#include "wmv2dsp.h"
-
-#define SKIP_TYPE_NONE 0
-#define SKIP_TYPE_MPEG 1
-#define SKIP_TYPE_ROW  2
-#define SKIP_TYPE_COL  3
-
-
-typedef struct Wmv2Context{
-    MpegEncContext s;
-    IntraX8Context x8;
-    WMV2DSPContext wdsp;
-    int j_type_bit;
-    int j_type;
-    int abt_flag;
-    int abt_type;
-    int abt_type_table[6];
-    int per_mb_abt;
-    int per_block_abt;
-    int mspel_bit;
-    int cbp_table_index;
-    int top_left_mv_flag;
-    int per_mb_rl_bit;
-    int skip_type;
-    int hshift;
-
-    ScanTable abt_scantable[2];
-    DECLARE_ALIGNED(16, int16_t, abt_block2)[6][64];
-}Wmv2Context;
-
-void ff_wmv2_common_init(Wmv2Context * w);
-
-#endif /* AVCODEC_WMV2_H */
diff --git a/deps/libav/libavcodec/wmv2dec.c b/deps/libav/libavcodec/wmv2dec.c
deleted file mode 100644
index 740636c..0000000
--- a/deps/libav/libavcodec/wmv2dec.c
+++ /dev/null
@@ -1,478 +0,0 @@
-/*
- * Copyright (c) 2002 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h263.h"
-#include "mathops.h"
-#include "msmpeg4.h"
-#include "msmpeg4data.h"
-#include "intrax8.h"
-#include "wmv2.h"
-
-
-static void parse_mb_skip(Wmv2Context * w){
-    int mb_x, mb_y;
-    MpegEncContext * const s= &w->s;
-    uint32_t * const mb_type = s->current_picture_ptr->mb_type;
-
-    w->skip_type= get_bits(&s->gb, 2);
-    switch(w->skip_type){
-    case SKIP_TYPE_NONE:
-        for(mb_y=0; mb_y<s->mb_height; mb_y++){
-            for(mb_x=0; mb_x<s->mb_width; mb_x++){
-                mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_16x16 | MB_TYPE_L0;
-            }
-        }
-        break;
-    case SKIP_TYPE_MPEG:
-        for(mb_y=0; mb_y<s->mb_height; mb_y++){
-            for(mb_x=0; mb_x<s->mb_width; mb_x++){
-                mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
-            }
-        }
-        break;
-    case SKIP_TYPE_ROW:
-        for(mb_y=0; mb_y<s->mb_height; mb_y++){
-            if(get_bits1(&s->gb)){
-                for(mb_x=0; mb_x<s->mb_width; mb_x++){
-                    mb_type[mb_y*s->mb_stride + mb_x]=  MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
-                }
-            }else{
-                for(mb_x=0; mb_x<s->mb_width; mb_x++){
-                    mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
-                }
-            }
-        }
-        break;
-    case SKIP_TYPE_COL:
-        for(mb_x=0; mb_x<s->mb_width; mb_x++){
-            if(get_bits1(&s->gb)){
-                for(mb_y=0; mb_y<s->mb_height; mb_y++){
-                    mb_type[mb_y*s->mb_stride + mb_x]=  MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
-                }
-            }else{
-                for(mb_y=0; mb_y<s->mb_height; mb_y++){
-                    mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
-                }
-            }
-        }
-        break;
-    }
-}
-
-static int decode_ext_header(Wmv2Context *w){
-    MpegEncContext * const s= &w->s;
-    GetBitContext gb;
-    int fps;
-    int code;
-
-    if(s->avctx->extradata_size<4) return -1;
-
-    init_get_bits(&gb, s->avctx->extradata, 32);
-
-    fps                = get_bits(&gb, 5);
-    s->bit_rate        = get_bits(&gb, 11)*1024;
-    w->mspel_bit       = get_bits1(&gb);
-    s->loop_filter     = get_bits1(&gb);
-    w->abt_flag        = get_bits1(&gb);
-    w->j_type_bit      = get_bits1(&gb);
-    w->top_left_mv_flag= get_bits1(&gb);
-    w->per_mb_rl_bit   = get_bits1(&gb);
-    code               = get_bits(&gb, 3);
-
-    if(code==0) return -1;
-
-    s->slice_height = s->mb_height / code;
-
-    if(s->avctx->debug&FF_DEBUG_PICT_INFO){
-        av_log(s->avctx, AV_LOG_DEBUG, "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, slices:%d\n",
-        fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit, w->top_left_mv_flag, w->per_mb_rl_bit, code, s->loop_filter,
-        code);
-    }
-    return 0;
-}
-
-int ff_wmv2_decode_picture_header(MpegEncContext * s)
-{
-    Wmv2Context * const w= (Wmv2Context*)s;
-    int code;
-
-    if(s->picture_number==0)
-        decode_ext_header(w);
-
-    s->pict_type = get_bits1(&s->gb) + 1;
-    if(s->pict_type == AV_PICTURE_TYPE_I){
-        code = get_bits(&s->gb, 7);
-        av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
-    }
-    s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
-    if(s->qscale <= 0)
-       return -1;
-
-    return 0;
-}
-
-int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s)
-{
-    Wmv2Context * const w= (Wmv2Context*)s;
-
-    if (s->pict_type == AV_PICTURE_TYPE_I) {
-        if(w->j_type_bit) w->j_type= get_bits1(&s->gb);
-        else              w->j_type= 0; //FIXME check
-
-        if(!w->j_type){
-            if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
-            else                 s->per_mb_rl_table= 0;
-
-            if(!s->per_mb_rl_table){
-                s->rl_chroma_table_index = decode012(&s->gb);
-                s->rl_table_index = decode012(&s->gb);
-            }
-
-            s->dc_table_index = get_bits1(&s->gb);
-        }
-        s->inter_intra_pred= 0;
-        s->no_rounding = 1;
-        if(s->avctx->debug&FF_DEBUG_PICT_INFO){
-            av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
-                s->qscale,
-                s->rl_chroma_table_index,
-                s->rl_table_index,
-                s->dc_table_index,
-                s->per_mb_rl_table,
-                w->j_type);
-        }
-    }else{
-        int cbp_index;
-        w->j_type=0;
-
-        parse_mb_skip(w);
-        cbp_index= decode012(&s->gb);
-        if(s->qscale <= 10){
-            int map[3]= {0,2,1};
-            w->cbp_table_index= map[cbp_index];
-        }else if(s->qscale <= 20){
-            int map[3]= {1,0,2};
-            w->cbp_table_index= map[cbp_index];
-        }else{
-            int map[3]= {2,1,0};
-            w->cbp_table_index= map[cbp_index];
-        }
-
-        if(w->mspel_bit) s->mspel= get_bits1(&s->gb);
-        else             s->mspel= 0; //FIXME check
-
-        if(w->abt_flag){
-            w->per_mb_abt= get_bits1(&s->gb)^1;
-            if(!w->per_mb_abt){
-                w->abt_type= decode012(&s->gb);
-            }
-        }
-
-        if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
-        else                 s->per_mb_rl_table= 0;
-
-        if(!s->per_mb_rl_table){
-            s->rl_table_index = decode012(&s->gb);
-            s->rl_chroma_table_index = s->rl_table_index;
-        }
-
-        s->dc_table_index = get_bits1(&s->gb);
-        s->mv_table_index = get_bits1(&s->gb);
-
-        s->inter_intra_pred= 0;//(s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
-        s->no_rounding ^= 1;
-
-        if(s->avctx->debug&FF_DEBUG_PICT_INFO){
-            av_log(s->avctx, AV_LOG_DEBUG, "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
-                s->rl_table_index,
-                s->rl_chroma_table_index,
-                s->dc_table_index,
-                s->mv_table_index,
-                s->per_mb_rl_table,
-                s->qscale,
-                s->mspel,
-                w->per_mb_abt,
-                w->abt_type,
-                w->cbp_table_index,
-                s->inter_intra_pred);
-        }
-    }
-    s->esc3_level_length= 0;
-    s->esc3_run_length= 0;
-
-s->picture_number++; //FIXME ?
-
-
-    if(w->j_type){
-        ff_intrax8_decode_picture(&w->x8, 2*s->qscale, (s->qscale-1)|1 );
-        return 1;
-    }
-
-    return 0;
-}
-
-static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){
-    MpegEncContext * const s= &w->s;
-    int ret;
-
-    ret= ff_msmpeg4_decode_motion(s, mx_ptr, my_ptr);
-
-    if(ret<0) return -1;
-
-    if((((*mx_ptr)|(*my_ptr)) & 1) && s->mspel)
-        w->hshift= get_bits1(&s->gb);
-    else
-        w->hshift= 0;
-
-    return 0;
-}
-
-static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py){
-    MpegEncContext * const s= &w->s;
-    int xy, wrap, diff, type;
-    int16_t *A, *B, *C, *mot_val;
-
-    wrap = s->b8_stride;
-    xy = s->block_index[0];
-
-    mot_val = s->current_picture.motion_val[0][xy];
-
-    A = s->current_picture.motion_val[0][xy - 1];
-    B = s->current_picture.motion_val[0][xy - wrap];
-    C = s->current_picture.motion_val[0][xy + 2 - wrap];
-
-    if(s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
-        diff= FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1]));
-    else
-        diff=0;
-
-    if(diff >= 8)
-        type= get_bits1(&s->gb);
-    else
-        type= 2;
-
-    if(type == 0){
-        *px= A[0];
-        *py= A[1];
-    }else if(type == 1){
-        *px= B[0];
-        *py= B[1];
-    }else{
-        /* special case for first (slice) line */
-        if (s->first_slice_line) {
-            *px = A[0];
-            *py = A[1];
-        } else {
-            *px = mid_pred(A[0], B[0], C[0]);
-            *py = mid_pred(A[1], B[1], C[1]);
-        }
-    }
-
-    return mot_val;
-}
-
-static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block, int n, int cbp){
-    MpegEncContext * const s= &w->s;
-    static const int sub_cbp_table[3]= {2,3,1};
-    int sub_cbp;
-
-    if(!cbp){
-        s->block_last_index[n] = -1;
-
-        return 0;
-    }
-
-    if(w->per_block_abt)
-        w->abt_type= decode012(&s->gb);
-    w->abt_type_table[n]= w->abt_type;
-
-    if(w->abt_type){
-//        const uint8_t *scantable= w->abt_scantable[w->abt_type-1].permutated;
-        const uint8_t *scantable= w->abt_scantable[w->abt_type-1].scantable;
-//        const uint8_t *scantable= w->abt_type-1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable;
-
-        sub_cbp= sub_cbp_table[ decode012(&s->gb) ];
-
-        if(sub_cbp&1){
-            if (ff_msmpeg4_decode_block(s, block, n, 1, scantable) < 0)
-                return -1;
-        }
-
-        if(sub_cbp&2){
-            if (ff_msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable) < 0)
-                return -1;
-        }
-        s->block_last_index[n] = 63;
-
-        return 0;
-    }else{
-        return ff_msmpeg4_decode_block(s, block, n, 1, s->inter_scantable.permutated);
-    }
-}
-
-
-int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
-{
-    Wmv2Context * const w= (Wmv2Context*)s;
-    int cbp, code, i;
-    uint8_t *coded_val;
-
-    if(w->j_type) return 0;
-
-    if (s->pict_type == AV_PICTURE_TYPE_P) {
-        if (IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])) {
-            /* skip mb */
-            s->mb_intra = 0;
-            for(i=0;i<6;i++)
-                s->block_last_index[i] = -1;
-            s->mv_dir = MV_DIR_FORWARD;
-            s->mv_type = MV_TYPE_16X16;
-            s->mv[0][0][0] = 0;
-            s->mv[0][0][1] = 0;
-            s->mb_skipped = 1;
-            w->hshift=0;
-            return 0;
-        }
-
-        code = get_vlc2(&s->gb, ff_mb_non_intra_vlc[w->cbp_table_index].table, MB_NON_INTRA_VLC_BITS, 3);
-        if (code < 0)
-            return -1;
-        s->mb_intra = (~code & 0x40) >> 6;
-
-        cbp = code & 0x3f;
-    } else {
-        s->mb_intra = 1;
-        code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
-        if (code < 0){
-            av_log(s->avctx, AV_LOG_ERROR, "II-cbp illegal at %d %d\n", s->mb_x, s->mb_y);
-            return -1;
-        }
-        /* predict coded block pattern */
-        cbp = 0;
-        for(i=0;i<6;i++) {
-            int val = ((code >> (5 - i)) & 1);
-            if (i < 4) {
-                int pred = ff_msmpeg4_coded_block_pred(s, i, &coded_val);
-                val = val ^ pred;
-                *coded_val = val;
-            }
-            cbp |= val << (5 - i);
-        }
-    }
-
-    if (!s->mb_intra) {
-        int mx, my;
-        wmv2_pred_motion(w, &mx, &my);
-
-        if(cbp){
-            s->dsp.clear_blocks(s->block[0]);
-            if(s->per_mb_rl_table){
-                s->rl_table_index = decode012(&s->gb);
-                s->rl_chroma_table_index = s->rl_table_index;
-            }
-
-            if(w->abt_flag && w->per_mb_abt){
-                w->per_block_abt= get_bits1(&s->gb);
-                if(!w->per_block_abt)
-                    w->abt_type= decode012(&s->gb);
-            }else
-                w->per_block_abt=0;
-        }
-
-        if (wmv2_decode_motion(w, &mx, &my) < 0)
-            return -1;
-
-        s->mv_dir = MV_DIR_FORWARD;
-        s->mv_type = MV_TYPE_16X16;
-        s->mv[0][0][0] = mx;
-        s->mv[0][0][1] = my;
-
-        for (i = 0; i < 6; i++) {
-            if (wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1) < 0)
-            {
-                av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding inter block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
-                return -1;
-            }
-        }
-    } else {
-        if (s->pict_type==AV_PICTURE_TYPE_P)
-            av_dlog(s->avctx, "%d%d ", s->inter_intra_pred, cbp);
-        av_dlog(s->avctx, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
-                ((cbp & 3) ? 1 : 0) +((cbp & 0x3C)? 2 : 0),
-                show_bits(&s->gb, 24));
-        s->ac_pred = get_bits1(&s->gb);
-        if(s->inter_intra_pred){
-            s->h263_aic_dir= get_vlc2(&s->gb, ff_inter_intra_vlc.table, INTER_INTRA_VLC_BITS, 1);
-            av_dlog(s->avctx, "%d%d %d %d/",
-                    s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
-        }
-        if(s->per_mb_rl_table && cbp){
-            s->rl_table_index = decode012(&s->gb);
-            s->rl_chroma_table_index = s->rl_table_index;
-        }
-
-        s->dsp.clear_blocks(s->block[0]);
-        for (i = 0; i < 6; i++) {
-            if (ff_msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
-            {
-                av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding intra block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
-                return -1;
-            }
-        }
-    }
-
-    return 0;
-}
-
-static av_cold int wmv2_decode_init(AVCodecContext *avctx){
-    Wmv2Context * const w= avctx->priv_data;
-
-    if(ff_msmpeg4_decode_init(avctx) < 0)
-        return -1;
-
-    ff_wmv2_common_init(w);
-
-    ff_intrax8_common_init(&w->x8,&w->s);
-
-    return 0;
-}
-
-static av_cold int wmv2_decode_end(AVCodecContext *avctx)
-{
-    Wmv2Context *w = avctx->priv_data;
-
-    ff_intrax8_common_end(&w->x8);
-    return ff_h263_decode_end(avctx);
-}
-
-AVCodec ff_wmv2_decoder = {
-    .name           = "wmv2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WMV2,
-    .priv_data_size = sizeof(Wmv2Context),
-    .init           = wmv2_decode_init,
-    .close          = wmv2_decode_end,
-    .decode         = ff_h263_decode_frame,
-    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-    .pix_fmts       = ff_pixfmt_list_420,
-};
diff --git a/deps/libav/libavcodec/wmv2dsp.c b/deps/libav/libavcodec/wmv2dsp.c
deleted file mode 100644
index 72dfe78..0000000
--- a/deps/libav/libavcodec/wmv2dsp.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "wmv2dsp.h"
-
-#define W0 2048
-#define W1 2841 /* 2048*sqrt (2)*cos (1*pi/16) */
-#define W2 2676 /* 2048*sqrt (2)*cos (2*pi/16) */
-#define W3 2408 /* 2048*sqrt (2)*cos (3*pi/16) */
-#define W4 2048 /* 2048*sqrt (2)*cos (4*pi/16) */
-#define W5 1609 /* 2048*sqrt (2)*cos (5*pi/16) */
-#define W6 1108 /* 2048*sqrt (2)*cos (6*pi/16) */
-#define W7 565  /* 2048*sqrt (2)*cos (7*pi/16) */
-
-static void wmv2_idct_row(short * b)
-{
-    int s1, s2;
-    int a0, a1, a2, a3, a4, a5, a6, a7;
-
-    /* step 1 */
-    a1 = W1 * b[1] + W7 * b[7];
-    a7 = W7 * b[1] - W1 * b[7];
-    a5 = W5 * b[5] + W3 * b[3];
-    a3 = W3 * b[5] - W5 * b[3];
-    a2 = W2 * b[2] + W6 * b[6];
-    a6 = W6 * b[2] - W2 * b[6];
-    a0 = W0 * b[0] + W0 * b[4];
-    a4 = W0 * b[0] - W0 * b[4];
-
-    /* step 2 */
-    s1 = (181 * (a1 - a5 + a7 - a3) + 128) >> 8; // 1, 3, 5, 7
-    s2 = (181 * (a1 - a5 - a7 + a3) + 128) >> 8;
-
-    /* step 3 */
-    b[0] = (a0 + a2 + a1 + a5 + (1 << 7)) >> 8;
-    b[1] = (a4 + a6 + s1      + (1 << 7)) >> 8;
-    b[2] = (a4 - a6 + s2      + (1 << 7)) >> 8;
-    b[3] = (a0 - a2 + a7 + a3 + (1 << 7)) >> 8;
-    b[4] = (a0 - a2 - a7 - a3 + (1 << 7)) >> 8;
-    b[5] = (a4 - a6 - s2      + (1 << 7)) >> 8;
-    b[6] = (a4 + a6 - s1      + (1 << 7)) >> 8;
-    b[7] = (a0 + a2 - a1 - a5 + (1 << 7)) >> 8;
-}
-
-static void wmv2_idct_col(short * b)
-{
-    int s1, s2;
-    int a0, a1, a2, a3, a4, a5, a6, a7;
-
-    /* step 1, with extended precision */
-    a1 = (W1 * b[8 * 1] + W7 * b[8 * 7] + 4) >> 3;
-    a7 = (W7 * b[8 * 1] - W1 * b[8 * 7] + 4) >> 3;
-    a5 = (W5 * b[8 * 5] + W3 * b[8 * 3] + 4) >> 3;
-    a3 = (W3 * b[8 * 5] - W5 * b[8 * 3] + 4) >> 3;
-    a2 = (W2 * b[8 * 2] + W6 * b[8 * 6] + 4) >> 3;
-    a6 = (W6 * b[8 * 2] - W2 * b[8 * 6] + 4) >> 3;
-    a0 = (W0 * b[8 * 0] + W0 * b[8 * 4]    ) >> 3;
-    a4 = (W0 * b[8 * 0] - W0 * b[8 * 4]    ) >> 3;
-
-    /* step 2 */
-    s1 = (181 * (a1 - a5 + a7 - a3) + 128) >> 8;
-    s2 = (181 * (a1 - a5 - a7 + a3) + 128) >> 8;
-
-    /* step 3 */
-    b[8 * 0] = (a0 + a2 + a1 + a5 + (1 << 13)) >> 14;
-    b[8 * 1] = (a4 + a6 + s1      + (1 << 13)) >> 14;
-    b[8 * 2] = (a4 - a6 + s2      + (1 << 13)) >> 14;
-    b[8 * 3] = (a0 - a2 + a7 + a3 + (1 << 13)) >> 14;
-
-    b[8 * 4] = (a0 - a2 - a7 - a3 + (1 << 13)) >> 14;
-    b[8 * 5] = (a4 - a6 - s2      + (1 << 13)) >> 14;
-    b[8 * 6] = (a4 + a6 - s1      + (1 << 13)) >> 14;
-    b[8 * 7] = (a0 + a2 - a1 - a5 + (1 << 13)) >> 14;
-}
-
-static void wmv2_idct_add_c(uint8_t *dest, int line_size, int16_t *block)
-{
-    int i;
-
-    for (i = 0; i < 64; i += 8)
-        wmv2_idct_row(block + i);
-    for (i = 0; i < 8; i++)
-        wmv2_idct_col(block + i);
-
-    for (i = 0; i < 8; i++) {
-        dest[0] = av_clip_uint8(dest[0] + block[0]);
-        dest[1] = av_clip_uint8(dest[1] + block[1]);
-        dest[2] = av_clip_uint8(dest[2] + block[2]);
-        dest[3] = av_clip_uint8(dest[3] + block[3]);
-        dest[4] = av_clip_uint8(dest[4] + block[4]);
-        dest[5] = av_clip_uint8(dest[5] + block[5]);
-        dest[6] = av_clip_uint8(dest[6] + block[6]);
-        dest[7] = av_clip_uint8(dest[7] + block[7]);
-        dest += line_size;
-        block += 8;
-    }
-}
-
-static void wmv2_idct_put_c(uint8_t *dest, int line_size, int16_t *block)
-{
-    int i;
-
-    for (i = 0; i < 64; i += 8)
-        wmv2_idct_row(block + i);
-    for (i = 0; i < 8; i++)
-        wmv2_idct_col(block + i);
-
-    for (i = 0; i < 8; i++) {
-        dest[0] = av_clip_uint8(block[0]);
-        dest[1] = av_clip_uint8(block[1]);
-        dest[2] = av_clip_uint8(block[2]);
-        dest[3] = av_clip_uint8(block[3]);
-        dest[4] = av_clip_uint8(block[4]);
-        dest[5] = av_clip_uint8(block[5]);
-        dest[6] = av_clip_uint8(block[6]);
-        dest[7] = av_clip_uint8(block[7]);
-        dest += line_size;
-        block += 8;
-    }
-}
-
-av_cold void ff_wmv2dsp_init(WMV2DSPContext *c)
-{
-    c->idct_add  = wmv2_idct_add_c;
-    c->idct_put  = wmv2_idct_put_c;
-    c->idct_perm = FF_NO_IDCT_PERM;
-}
diff --git a/deps/libav/libavcodec/wmv2dsp.h b/deps/libav/libavcodec/wmv2dsp.h
deleted file mode 100644
index 3368b3a..0000000
--- a/deps/libav/libavcodec/wmv2dsp.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_WMV2DSP_H
-#define AVCODEC_WMV2DSP_H
-
-#include <stdint.h>
-
-typedef struct WMV2DSPContext {
-    void (*idct_add)(uint8_t *dest, int line_size, int16_t *block);
-    void (*idct_put)(uint8_t *dest, int line_size, int16_t *block);
-
-    int idct_perm;
-} WMV2DSPContext;
-
-void ff_wmv2dsp_init(WMV2DSPContext *c);
-
-#endif /* AVCODEC_WMV2DSP_H */
diff --git a/deps/libav/libavcodec/wmv2enc.c b/deps/libav/libavcodec/wmv2enc.c
deleted file mode 100644
index 256c4e5..0000000
--- a/deps/libav/libavcodec/wmv2enc.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 2002 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "msmpeg4.h"
-#include "msmpeg4data.h"
-#include "h263.h"
-#include "wmv2.h"
-
-
-static int encode_ext_header(Wmv2Context *w){
-    MpegEncContext * const s= &w->s;
-    PutBitContext pb;
-    int code;
-
-    init_put_bits(&pb, s->avctx->extradata, s->avctx->extradata_size);
-
-    put_bits(&pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); //yes 29.97 -> 29
-    put_bits(&pb, 11, FFMIN(s->bit_rate/1024, 2047));
-
-    put_bits(&pb, 1, w->mspel_bit=1);
-    put_bits(&pb, 1, s->loop_filter);
-    put_bits(&pb, 1, w->abt_flag=1);
-    put_bits(&pb, 1, w->j_type_bit=1);
-    put_bits(&pb, 1, w->top_left_mv_flag=0);
-    put_bits(&pb, 1, w->per_mb_rl_bit=1);
-    put_bits(&pb, 3, code=1);
-
-    flush_put_bits(&pb);
-
-    s->slice_height = s->mb_height / code;
-
-    return 0;
-}
-
-static av_cold int wmv2_encode_init(AVCodecContext *avctx){
-    Wmv2Context * const w= avctx->priv_data;
-
-    if(ff_MPV_encode_init(avctx) < 0)
-        return -1;
-
-    ff_wmv2_common_init(w);
-
-    avctx->extradata_size= 4;
-    avctx->extradata= av_mallocz(avctx->extradata_size + 10);
-    encode_ext_header(w);
-
-    return 0;
-}
-
-int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number)
-{
-    Wmv2Context * const w= (Wmv2Context*)s;
-
-    put_bits(&s->pb, 1, s->pict_type - 1);
-    if(s->pict_type == AV_PICTURE_TYPE_I){
-        put_bits(&s->pb, 7, 0);
-    }
-    put_bits(&s->pb, 5, s->qscale);
-
-    s->dc_table_index = 1;
-    s->mv_table_index = 1; /* only if P frame */
-    s->per_mb_rl_table = 0;
-    s->mspel= 0;
-    w->per_mb_abt=0;
-    w->abt_type=0;
-    w->j_type=0;
-
-    assert(s->flipflop_rounding);
-
-    if (s->pict_type == AV_PICTURE_TYPE_I) {
-        assert(s->no_rounding==1);
-        if(w->j_type_bit) put_bits(&s->pb, 1, w->j_type);
-
-        if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table);
-
-        if(!s->per_mb_rl_table){
-            ff_msmpeg4_code012(&s->pb, s->rl_chroma_table_index);
-            ff_msmpeg4_code012(&s->pb, s->rl_table_index);
-        }
-
-        put_bits(&s->pb, 1, s->dc_table_index);
-
-        s->inter_intra_pred= 0;
-    }else{
-        int cbp_index;
-
-        put_bits(&s->pb, 2, SKIP_TYPE_NONE);
-
-        ff_msmpeg4_code012(&s->pb, cbp_index=0);
-        if(s->qscale <= 10){
-            int map[3]= {0,2,1};
-            w->cbp_table_index= map[cbp_index];
-        }else if(s->qscale <= 20){
-            int map[3]= {1,0,2};
-            w->cbp_table_index= map[cbp_index];
-        }else{
-            int map[3]= {2,1,0};
-            w->cbp_table_index= map[cbp_index];
-        }
-
-        if(w->mspel_bit) put_bits(&s->pb, 1, s->mspel);
-
-        if(w->abt_flag){
-            put_bits(&s->pb, 1, w->per_mb_abt^1);
-            if(!w->per_mb_abt){
-                ff_msmpeg4_code012(&s->pb, w->abt_type);
-            }
-        }
-
-        if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table);
-
-        if(!s->per_mb_rl_table){
-            ff_msmpeg4_code012(&s->pb, s->rl_table_index);
-            s->rl_chroma_table_index = s->rl_table_index;
-        }
-        put_bits(&s->pb, 1, s->dc_table_index);
-        put_bits(&s->pb, 1, s->mv_table_index);
-
-        s->inter_intra_pred= 0;//(s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
-    }
-    s->esc3_level_length= 0;
-    s->esc3_run_length= 0;
-
-    return 0;
-}
-
-/* Nearly identical to wmv1 but that is just because we do not use the
- * useless M$ crap features. It is duplicated here in case someone wants
- * to add support for these crap features. */
-void ff_wmv2_encode_mb(MpegEncContext * s,
-                       int16_t block[6][64],
-                       int motion_x, int motion_y)
-{
-    Wmv2Context * const w= (Wmv2Context*)s;
-    int cbp, coded_cbp, i;
-    int pred_x, pred_y;
-    uint8_t *coded_block;
-
-    ff_msmpeg4_handle_slices(s);
-
-    if (!s->mb_intra) {
-        /* compute cbp */
-        cbp = 0;
-        for (i = 0; i < 6; i++) {
-            if (s->block_last_index[i] >= 0)
-                cbp |= 1 << (5 - i);
-        }
-
-        put_bits(&s->pb,
-                 ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][1],
-                 ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][0]);
-
-        /* motion vector */
-        ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-        ff_msmpeg4_encode_motion(s, motion_x - pred_x,
-                              motion_y - pred_y);
-    } else {
-        /* compute cbp */
-        cbp = 0;
-        coded_cbp = 0;
-        for (i = 0; i < 6; i++) {
-            int val, pred;
-            val = (s->block_last_index[i] >= 1);
-            cbp |= val << (5 - i);
-            if (i < 4) {
-                /* predict value for close blocks only for luma */
-                pred = ff_msmpeg4_coded_block_pred(s, i, &coded_block);
-                *coded_block = val;
-                val = val ^ pred;
-            }
-            coded_cbp |= val << (5 - i);
-        }
-
-        if (s->pict_type == AV_PICTURE_TYPE_I) {
-            put_bits(&s->pb,
-                     ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
-        } else {
-            put_bits(&s->pb,
-                     ff_wmv2_inter_table[w->cbp_table_index][cbp][1],
-                     ff_wmv2_inter_table[w->cbp_table_index][cbp][0]);
-        }
-        put_bits(&s->pb, 1, 0);         /* no AC prediction yet */
-        if(s->inter_intra_pred){
-            s->h263_aic_dir=0;
-            put_bits(&s->pb, ff_table_inter_intra[s->h263_aic_dir][1], ff_table_inter_intra[s->h263_aic_dir][0]);
-        }
-    }
-
-    for (i = 0; i < 6; i++) {
-        ff_msmpeg4_encode_block(s, block[i], i);
-    }
-}
-
-AVCodec ff_wmv2_encoder = {
-    .name           = "wmv2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WMV2,
-    .priv_data_size = sizeof(Wmv2Context),
-    .init           = wmv2_encode_init,
-    .encode2        = ff_MPV_encode_picture,
-    .close          = ff_MPV_encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/wnv1.c b/deps/libav/libavcodec/wnv1.c
deleted file mode 100644
index 7676c89..0000000
--- a/deps/libav/libavcodec/wnv1.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Winnov WNV1 codec
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Winnov WNV1 codec.
- */
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-#include "mathops.h"
-
-
-typedef struct WNV1Context {
-    AVCodecContext *avctx;
-
-    int shift;
-    GetBitContext gb;
-} WNV1Context;
-
-static const uint16_t code_tab[16][2] = {
-    { 0x1FD, 9 }, { 0xFD, 8 }, { 0x7D, 7 }, { 0x3D, 6 }, { 0x1D, 5 }, { 0x0D, 4 }, { 0x005, 3 },
-    { 0x000, 1 },
-    { 0x004, 3 }, { 0x0C, 4 }, { 0x1C, 5 }, { 0x3C, 6 }, { 0x7C, 7 }, { 0xFC, 8 }, { 0x1FC, 9 }, { 0xFF, 8 }
-};
-
-#define CODE_VLC_BITS 9
-static VLC code_vlc;
-
-/* returns modified base_value */
-static inline int wnv1_get_code(WNV1Context *w, int base_value)
-{
-    int v = get_vlc2(&w->gb, code_vlc.table, CODE_VLC_BITS, 1);
-
-    if (v == 15)
-        return ff_reverse[get_bits(&w->gb, 8 - w->shift)];
-    else
-        return base_value + ((v - 7) << w->shift);
-}
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    WNV1Context * const l = avctx->priv_data;
-    const uint8_t *buf    = avpkt->data;
-    int buf_size          = avpkt->size;
-    AVFrame * const p     = data;
-    unsigned char *Y,*U,*V;
-    int i, j, ret;
-    int prev_y = 0, prev_u = 0, prev_v = 0;
-    uint8_t *rbuf;
-
-    if (buf_size < 8) {
-        av_log(avctx, AV_LOG_ERROR, "Packet is too short\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!rbuf) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
-        return AVERROR(ENOMEM);
-    }
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        av_free(rbuf);
-        return ret;
-    }
-    p->key_frame = 1;
-
-    for (i = 8; i < buf_size; i++)
-        rbuf[i] = ff_reverse[buf[i]];
-    init_get_bits(&l->gb, rbuf + 8, (buf_size - 8) * 8);
-
-    if (buf[2] >> 4 == 6)
-        l->shift = 2;
-    else {
-        l->shift = 8 - (buf[2] >> 4);
-        if (l->shift > 4) {
-            avpriv_request_sample(avctx,
-                                  "Unknown WNV1 frame header value %i",
-                                  buf[2] >> 4);
-            l->shift = 4;
-        }
-        if (l->shift < 1) {
-            avpriv_request_sample(avctx,
-                                  "Unknown WNV1 frame header value %i",
-                                  buf[2] >> 4);
-            l->shift = 1;
-        }
-    }
-
-    Y = p->data[0];
-    U = p->data[1];
-    V = p->data[2];
-    for (j = 0; j < avctx->height; j++) {
-        for (i = 0; i < avctx->width / 2; i++) {
-            Y[i * 2] = wnv1_get_code(l, prev_y);
-            prev_u = U[i] = wnv1_get_code(l, prev_u);
-            prev_y = Y[(i * 2) + 1] = wnv1_get_code(l, Y[i * 2]);
-            prev_v = V[i] = wnv1_get_code(l, prev_v);
-        }
-        Y += p->linesize[0];
-        U += p->linesize[1];
-        V += p->linesize[2];
-    }
-
-
-    *got_frame      = 1;
-    av_free(rbuf);
-
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    WNV1Context * const l = avctx->priv_data;
-    static VLC_TYPE code_table[1 << CODE_VLC_BITS][2];
-
-    l->avctx       = avctx;
-    avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-
-    code_vlc.table           = code_table;
-    code_vlc.table_allocated = 1 << CODE_VLC_BITS;
-    init_vlc(&code_vlc, CODE_VLC_BITS, 16,
-             &code_tab[0][1], 4, 2,
-             &code_tab[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
-
-    return 0;
-}
-
-AVCodec ff_wnv1_decoder = {
-    .name           = "wnv1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Winnov WNV1"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_WNV1,
-    .priv_data_size = sizeof(WNV1Context),
-    .init           = decode_init,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/ws-snd1.c b/deps/libav/libavcodec/ws-snd1.c
deleted file mode 100644
index fe6f812..0000000
--- a/deps/libav/libavcodec/ws-snd1.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Westwood SNDx codecs
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-/**
- * @file
- * Westwood SNDx codecs
- *
- * Reference documents about VQA format and its audio codecs
- * can be found here:
- * http://www.multimedia.cx
- */
-
-static const int8_t ws_adpcm_4bit[] = {
-    -9, -8, -6, -5, -4, -3, -2, -1,
-     0,  1,  2,  3,  4,  5,  6,  8
-};
-
-static av_cold int ws_snd_decode_init(AVCodecContext *avctx)
-{
-    avctx->channels       = 1;
-    avctx->channel_layout = AV_CH_LAYOUT_MONO;
-    avctx->sample_fmt     = AV_SAMPLE_FMT_U8;
-
-    return 0;
-}
-
-static int ws_snd_decode_frame(AVCodecContext *avctx, void *data,
-                               int *got_frame_ptr, AVPacket *avpkt)
-{
-    AVFrame *frame     = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-
-    int in_size, out_size, ret;
-    int sample = 128;
-    uint8_t *samples;
-    uint8_t *samples_end;
-
-    if (!buf_size)
-        return 0;
-
-    if (buf_size < 4) {
-        av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
-        return AVERROR(EINVAL);
-    }
-
-    out_size = AV_RL16(&buf[0]);
-    in_size  = AV_RL16(&buf[2]);
-    buf += 4;
-
-    if (in_size > buf_size) {
-        av_log(avctx, AV_LOG_ERROR, "Frame data is larger than input buffer\n");
-        return -1;
-    }
-
-    /* get output buffer */
-    frame->nb_samples = out_size;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    samples     = frame->data[0];
-    samples_end = samples + out_size;
-
-    if (in_size == out_size) {
-        memcpy(samples, buf, out_size);
-        *got_frame_ptr = 1;
-        return buf_size;
-    }
-
-    while (samples < samples_end && buf - avpkt->data < buf_size) {
-        int code, smp, size;
-        uint8_t count;
-        code  = *buf >> 6;
-        count = *buf & 0x3F;
-        buf++;
-
-        /* make sure we don't write past the output buffer */
-        switch (code) {
-        case 0:  smp = 4 * (count + 1);                break;
-        case 1:  smp = 2 * (count + 1);                break;
-        case 2:  smp = (count & 0x20) ? 1 : count + 1; break;
-        default: smp = count + 1;                      break;
-        }
-        if (samples_end - samples < smp)
-            break;
-
-        /* make sure we don't read past the input buffer */
-        size = ((code == 2 && (count & 0x20)) || code == 3) ? 0 : count + 1;
-        if ((buf - avpkt->data) + size > buf_size)
-            break;
-
-        switch (code) {
-        case 0: /* ADPCM 2-bit */
-            for (count++; count > 0; count--) {
-                code = *buf++;
-                sample += ( code       & 0x3) - 2;
-                sample = av_clip_uint8(sample);
-                *samples++ = sample;
-                sample += ((code >> 2) & 0x3) - 2;
-                sample = av_clip_uint8(sample);
-                *samples++ = sample;
-                sample += ((code >> 4) & 0x3) - 2;
-                sample = av_clip_uint8(sample);
-                *samples++ = sample;
-                sample +=  (code >> 6)        - 2;
-                sample = av_clip_uint8(sample);
-                *samples++ = sample;
-            }
-            break;
-        case 1: /* ADPCM 4-bit */
-            for (count++; count > 0; count--) {
-                code = *buf++;
-                sample += ws_adpcm_4bit[code & 0xF];
-                sample = av_clip_uint8(sample);
-                *samples++ = sample;
-                sample += ws_adpcm_4bit[code >> 4];
-                sample = av_clip_uint8(sample);
-                *samples++ = sample;
-            }
-            break;
-        case 2: /* no compression */
-            if (count & 0x20) { /* big delta */
-                int8_t t;
-                t = count;
-                t <<= 3;
-                sample += t >> 3;
-                sample = av_clip_uint8(sample);
-                *samples++ = sample;
-            } else { /* copy */
-                memcpy(samples, buf, smp);
-                samples += smp;
-                buf     += smp;
-                sample = buf[-1];
-            }
-            break;
-        default: /* run */
-            memset(samples, sample, smp);
-            samples += smp;
-        }
-    }
-
-    frame->nb_samples = samples - frame->data[0];
-    *got_frame_ptr    = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_ws_snd1_decoder = {
-    .name           = "ws_snd1",
-    .long_name      = NULL_IF_CONFIG_SMALL("Westwood Audio (SND1)"),
-    .type           = AVMEDIA_TYPE_AUDIO,
-    .id             = AV_CODEC_ID_WESTWOOD_SND1,
-    .init           = ws_snd_decode_init,
-    .decode         = ws_snd_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/x86/Makefile b/deps/libav/libavcodec/x86/Makefile
deleted file mode 100644
index f985525..0000000
--- a/deps/libav/libavcodec/x86/Makefile
+++ /dev/null
@@ -1,96 +0,0 @@
-OBJS                                   += x86/constants.o               \
-                                          x86/fmtconvert_init.o         \
-
-OBJS-$(CONFIG_AAC_DECODER)             += x86/sbrdsp_init.o
-OBJS-$(CONFIG_AC3DSP)                  += x86/ac3dsp_init.o
-OBJS-$(CONFIG_CAVS_DECODER)            += x86/cavsdsp.o
-OBJS-$(CONFIG_DCA_DECODER)             += x86/dcadsp_init.o
-OBJS-$(CONFIG_DCT)                     += x86/dct_init.o
-OBJS-$(CONFIG_DNXHD_ENCODER)           += x86/dnxhdenc.o
-OBJS-$(CONFIG_DSPUTIL)                 += x86/dsputil_init.o            \
-                                          x86/dsputil_x86.o
-OBJS-$(CONFIG_ENCODERS)                += x86/dsputilenc_mmx.o          \
-                                          x86/fdct.o                    \
-                                          x86/motion_est.o
-OBJS-$(CONFIG_FFT)                     += x86/fft_init.o
-OBJS-$(CONFIG_H263DSP)                 += x86/h263dsp_init.o
-OBJS-$(CONFIG_H264CHROMA)              += x86/h264chroma_init.o
-OBJS-$(CONFIG_H264DSP)                 += x86/h264dsp_init.o
-OBJS-$(CONFIG_H264PRED)                += x86/h264_intrapred_init.o
-OBJS-$(CONFIG_H264QPEL)                += x86/h264_qpel.o
-OBJS-$(CONFIG_HPELDSP)                 += x86/hpeldsp_init.o
-OBJS-$(CONFIG_LPC)                     += x86/lpc.o
-OBJS-$(CONFIG_MLP_DECODER)             += x86/mlpdsp.o
-OBJS-$(CONFIG_MPEGAUDIODSP)            += x86/mpegaudiodsp.o
-OBJS-$(CONFIG_MPEGVIDEO)               += x86/mpegvideo.o
-OBJS-$(CONFIG_MPEGVIDEOENC)            += x86/mpegvideoenc.o
-OBJS-$(CONFIG_PNG_DECODER)             += x86/pngdsp_init.o
-OBJS-$(CONFIG_PRORES_DECODER)          += x86/proresdsp_init.o
-OBJS-$(CONFIG_RV30_DECODER)            += x86/rv34dsp_init.o
-OBJS-$(CONFIG_RV40_DECODER)            += x86/rv34dsp_init.o            \
-                                          x86/rv40dsp_init.o
-OBJS-$(CONFIG_TRUEHD_DECODER)          += x86/mlpdsp.o
-OBJS-$(CONFIG_VC1_DECODER)             += x86/vc1dsp_init.o
-OBJS-$(CONFIG_VIDEODSP)                += x86/videodsp_init.o
-OBJS-$(CONFIG_VORBIS_DECODER)          += x86/vorbisdsp_init.o
-OBJS-$(CONFIG_VP3DSP)                  += x86/vp3dsp_init.o
-OBJS-$(CONFIG_VP6_DECODER)             += x86/vp6dsp_init.o
-OBJS-$(CONFIG_VP8_DECODER)             += x86/vp8dsp_init.o
-OBJS-$(CONFIG_VP9_DECODER)             += x86/vp9dsp_init.o
-OBJS-$(CONFIG_XMM_CLOBBER_TEST)        += x86/w64xmmtest.o
-
-MMX-OBJS-$(CONFIG_DSPUTIL)             += x86/dsputil_mmx.o             \
-                                          x86/fpel_mmx.o                \
-                                          x86/idct_mmx_xvid.o           \
-                                          x86/idct_sse2_xvid.o          \
-                                          x86/rnd_mmx.o                 \
-                                          x86/simple_idct.o
-MMX-OBJS-$(CONFIG_HPELDSP)             += x86/fpel_mmx.o                \
-                                          x86/hpeldsp_mmx.o             \
-                                          x86/rnd_mmx.o
-MMX-OBJS-$(CONFIG_VC1_DECODER)         += x86/vc1dsp_mmx.o
-
-YASM-OBJS                              += x86/deinterlace.o             \
-                                          x86/fmtconvert.o              \
-
-YASM-OBJS-$(CONFIG_AAC_DECODER)        += x86/sbrdsp.o
-YASM-OBJS-$(CONFIG_AC3DSP)             += x86/ac3dsp.o
-YASM-OBJS-$(CONFIG_DCA_DECODER)        += x86/dcadsp.o
-YASM-OBJS-$(CONFIG_DCT)                += x86/dct32.o
-YASM-OBJS-$(CONFIG_DSPUTIL)            += x86/dsputil.o                 \
-                                          x86/fpel.o                    \
-                                          x86/mpeg4qpel.o               \
-                                          x86/qpel.o
-YASM-OBJS-$(CONFIG_ENCODERS)           += x86/dsputilenc.o
-YASM-OBJS-$(CONFIG_FFT)                += x86/fft.o
-YASM-OBJS-$(CONFIG_H263DSP)            += x86/h263_loopfilter.o
-YASM-OBJS-$(CONFIG_H264CHROMA)         += x86/h264_chromamc.o           \
-                                          x86/h264_chromamc_10bit.o
-YASM-OBJS-$(CONFIG_H264DSP)            += x86/h264_deblock.o            \
-                                          x86/h264_deblock_10bit.o      \
-                                          x86/h264_idct.o               \
-                                          x86/h264_idct_10bit.o         \
-                                          x86/h264_weight.o             \
-                                          x86/h264_weight_10bit.o
-YASM-OBJS-$(CONFIG_H264PRED)           += x86/h264_intrapred.o          \
-                                          x86/h264_intrapred_10bit.o
-YASM-OBJS-$(CONFIG_H264QPEL)           += x86/h264_qpel_8bit.o          \
-                                          x86/h264_qpel_10bit.o         \
-                                          x86/fpel.o                    \
-                                          x86/qpel.o
-YASM-OBJS-$(CONFIG_HPELDSP)            += x86/fpel.o                    \
-                                          x86/hpeldsp.o
-YASM-OBJS-$(CONFIG_MPEGAUDIODSP)       += x86/imdct36.o
-YASM-OBJS-$(CONFIG_PNG_DECODER)        += x86/pngdsp.o
-YASM-OBJS-$(CONFIG_PRORES_DECODER)     += x86/proresdsp.o
-YASM-OBJS-$(CONFIG_RV30_DECODER)       += x86/rv34dsp.o
-YASM-OBJS-$(CONFIG_RV40_DECODER)       += x86/rv34dsp.o                 \
-                                          x86/rv40dsp.o
-YASM-OBJS-$(CONFIG_VC1_DECODER)        += x86/vc1dsp.o
-YASM-OBJS-$(CONFIG_VIDEODSP)           += x86/videodsp.o
-YASM-OBJS-$(CONFIG_VORBIS_DECODER)     += x86/vorbisdsp.o
-YASM-OBJS-$(CONFIG_VP3DSP)             += x86/vp3dsp.o
-YASM-OBJS-$(CONFIG_VP6_DECODER)        += x86/vp6dsp.o
-YASM-OBJS-$(CONFIG_VP8_DECODER)        += x86/vp8dsp.o                  \
-                                          x86/vp8dsp_loopfilter.o
-YASM-OBJS-$(CONFIG_VP9_DECODER)        += x86/vp9dsp.o
diff --git a/deps/libav/libavcodec/x86/ac3dsp.asm b/deps/libav/libavcodec/x86/ac3dsp.asm
deleted file mode 100644
index b432318..0000000
--- a/deps/libav/libavcodec/x86/ac3dsp.asm
+++ /dev/null
@@ -1,421 +0,0 @@
-;*****************************************************************************
-;* x86-optimized AC-3 DSP utils
-;* Copyright (c) 2011 Justin Ruggles
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-; 16777216.0f - used in ff_float_to_fixed24()
-pf_1_24: times 4 dd 0x4B800000
-
-; used in ff_ac3_compute_mantissa_size()
-cextern ac3_bap_bits
-pw_bap_mul1: dw 21846, 21846, 0, 32768, 21846, 21846, 0, 32768
-pw_bap_mul2: dw 5, 7, 0, 7, 5, 7, 0, 7
-
-; used in ff_ac3_extract_exponents()
-pd_1:   times 4 dd 1
-pd_151: times 4 dd 151
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; void ff_ac3_exponent_min(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
-;-----------------------------------------------------------------------------
-
-%macro AC3_EXPONENT_MIN 0
-cglobal ac3_exponent_min, 3, 4, 2, exp, reuse_blks, expn, offset
-    shl  reuse_blksq, 8
-    jz .end
-    LOOP_ALIGN
-.nextexp:
-    mov      offsetq, reuse_blksq
-    mova          m0, [expq+offsetq]
-    sub      offsetq, 256
-    LOOP_ALIGN
-.nextblk:
-    PMINUB        m0, [expq+offsetq], m1
-    sub      offsetq, 256
-    jae .nextblk
-    mova      [expq], m0
-    add         expq, mmsize
-    sub        expnq, mmsize
-    jg .nextexp
-.end:
-    REP_RET
-%endmacro
-
-%define LOOP_ALIGN
-INIT_MMX mmx
-AC3_EXPONENT_MIN
-%if HAVE_MMXEXT_EXTERNAL
-%define LOOP_ALIGN ALIGN 16
-INIT_MMX mmxext
-AC3_EXPONENT_MIN
-%endif
-%if HAVE_SSE2_EXTERNAL
-INIT_XMM sse2
-AC3_EXPONENT_MIN
-%endif
-%undef LOOP_ALIGN
-
-;-----------------------------------------------------------------------------
-; int ff_ac3_max_msb_abs_int16(const int16_t *src, int len)
-;
-; This function uses 2 different methods to calculate a valid result.
-; 1) logical 'or' of abs of each element
-;        This is used for ssse3 because of the pabsw instruction.
-;        It is also used for mmx because of the lack of min/max instructions.
-; 2) calculate min/max for the array, then or(abs(min),abs(max))
-;        This is used for mmxext and sse2 because they have pminsw/pmaxsw.
-;-----------------------------------------------------------------------------
-
-; logical 'or' of 4 or 8 words in an mmx or xmm register into the low word
-%macro OR_WORDS_HORIZ 2 ; src, tmp
-%if cpuflag(sse2)
-    movhlps     %2, %1
-    por         %1, %2
-    pshuflw     %2, %1, q0032
-    por         %1, %2
-    pshuflw     %2, %1, q0001
-    por         %1, %2
-%elif cpuflag(mmxext)
-    pshufw      %2, %1, q0032
-    por         %1, %2
-    pshufw      %2, %1, q0001
-    por         %1, %2
-%else ; mmx
-    movq        %2, %1
-    psrlq       %2, 32
-    por         %1, %2
-    movq        %2, %1
-    psrlq       %2, 16
-    por         %1, %2
-%endif
-%endmacro
-
-%macro AC3_MAX_MSB_ABS_INT16 1
-cglobal ac3_max_msb_abs_int16, 2,2,5, src, len
-    pxor        m2, m2
-    pxor        m3, m3
-.loop:
-%ifidn %1, min_max
-    mova        m0, [srcq]
-    mova        m1, [srcq+mmsize]
-    pminsw      m2, m0
-    pminsw      m2, m1
-    pmaxsw      m3, m0
-    pmaxsw      m3, m1
-%else ; or_abs
-%if notcpuflag(ssse3)
-    mova        m0, [srcq]
-    mova        m1, [srcq+mmsize]
-    ABS2        m0, m1, m3, m4
-%else ; ssse3
-    ; using memory args is faster for ssse3
-    pabsw       m0, [srcq]
-    pabsw       m1, [srcq+mmsize]
-%endif
-    por         m2, m0
-    por         m2, m1
-%endif
-    add       srcq, mmsize*2
-    sub       lend, mmsize
-    ja .loop
-%ifidn %1, min_max
-    ABS2        m2, m3, m0, m1
-    por         m2, m3
-%endif
-    OR_WORDS_HORIZ m2, m0
-    movd       eax, m2
-    and        eax, 0xFFFF
-    RET
-%endmacro
-
-INIT_MMX mmx
-AC3_MAX_MSB_ABS_INT16 or_abs
-INIT_MMX mmxext
-AC3_MAX_MSB_ABS_INT16 min_max
-INIT_XMM sse2
-AC3_MAX_MSB_ABS_INT16 min_max
-INIT_XMM ssse3
-AC3_MAX_MSB_ABS_INT16 or_abs
-
-;-----------------------------------------------------------------------------
-; macro used for ff_ac3_lshift_int16() and ff_ac3_rshift_int32()
-;-----------------------------------------------------------------------------
-
-%macro AC3_SHIFT 3 ; l/r, 16/32, shift instruction, instruction set
-cglobal ac3_%1shift_int%2, 3, 3, 5, src, len, shift
-    movd      m0, shiftd
-.loop:
-    mova      m1, [srcq         ]
-    mova      m2, [srcq+mmsize  ]
-    mova      m3, [srcq+mmsize*2]
-    mova      m4, [srcq+mmsize*3]
-    %3        m1, m0
-    %3        m2, m0
-    %3        m3, m0
-    %3        m4, m0
-    mova  [srcq         ], m1
-    mova  [srcq+mmsize  ], m2
-    mova  [srcq+mmsize*2], m3
-    mova  [srcq+mmsize*3], m4
-    add     srcq, mmsize*4
-    sub     lend, mmsize*32/%2
-    ja .loop
-.end:
-    REP_RET
-%endmacro
-
-;-----------------------------------------------------------------------------
-; void ff_ac3_lshift_int16(int16_t *src, unsigned int len, unsigned int shift)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmx
-AC3_SHIFT l, 16, psllw
-INIT_XMM sse2
-AC3_SHIFT l, 16, psllw
-
-;-----------------------------------------------------------------------------
-; void ff_ac3_rshift_int32(int32_t *src, unsigned int len, unsigned int shift)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmx
-AC3_SHIFT r, 32, psrad
-INIT_XMM sse2
-AC3_SHIFT r, 32, psrad
-
-;-----------------------------------------------------------------------------
-; void ff_float_to_fixed24(int32_t *dst, const float *src, unsigned int len)
-;-----------------------------------------------------------------------------
-
-; The 3DNow! version is not bit-identical because pf2id uses truncation rather
-; than round-to-nearest.
-INIT_MMX 3dnow
-cglobal float_to_fixed24, 3, 3, 0, dst, src, len
-    movq   m0, [pf_1_24]
-.loop:
-    movq   m1, [srcq   ]
-    movq   m2, [srcq+8 ]
-    movq   m3, [srcq+16]
-    movq   m4, [srcq+24]
-    pfmul  m1, m0
-    pfmul  m2, m0
-    pfmul  m3, m0
-    pfmul  m4, m0
-    pf2id  m1, m1
-    pf2id  m2, m2
-    pf2id  m3, m3
-    pf2id  m4, m4
-    movq  [dstq   ], m1
-    movq  [dstq+8 ], m2
-    movq  [dstq+16], m3
-    movq  [dstq+24], m4
-    add  srcq, 32
-    add  dstq, 32
-    sub  lend, 8
-    ja .loop
-    femms
-    RET
-
-INIT_XMM sse
-cglobal float_to_fixed24, 3, 3, 3, dst, src, len
-    movaps     m0, [pf_1_24]
-.loop:
-    movaps     m1, [srcq   ]
-    movaps     m2, [srcq+16]
-    mulps      m1, m0
-    mulps      m2, m0
-    cvtps2pi  mm0, m1
-    movhlps    m1, m1
-    cvtps2pi  mm1, m1
-    cvtps2pi  mm2, m2
-    movhlps    m2, m2
-    cvtps2pi  mm3, m2
-    movq  [dstq   ], mm0
-    movq  [dstq+ 8], mm1
-    movq  [dstq+16], mm2
-    movq  [dstq+24], mm3
-    add      srcq, 32
-    add      dstq, 32
-    sub      lend, 8
-    ja .loop
-    emms
-    RET
-
-INIT_XMM sse2
-cglobal float_to_fixed24, 3, 3, 9, dst, src, len
-    movaps     m0, [pf_1_24]
-.loop:
-    movaps     m1, [srcq    ]
-    movaps     m2, [srcq+16 ]
-    movaps     m3, [srcq+32 ]
-    movaps     m4, [srcq+48 ]
-%ifdef m8
-    movaps     m5, [srcq+64 ]
-    movaps     m6, [srcq+80 ]
-    movaps     m7, [srcq+96 ]
-    movaps     m8, [srcq+112]
-%endif
-    mulps      m1, m0
-    mulps      m2, m0
-    mulps      m3, m0
-    mulps      m4, m0
-%ifdef m8
-    mulps      m5, m0
-    mulps      m6, m0
-    mulps      m7, m0
-    mulps      m8, m0
-%endif
-    cvtps2dq   m1, m1
-    cvtps2dq   m2, m2
-    cvtps2dq   m3, m3
-    cvtps2dq   m4, m4
-%ifdef m8
-    cvtps2dq   m5, m5
-    cvtps2dq   m6, m6
-    cvtps2dq   m7, m7
-    cvtps2dq   m8, m8
-%endif
-    movdqa  [dstq    ], m1
-    movdqa  [dstq+16 ], m2
-    movdqa  [dstq+32 ], m3
-    movdqa  [dstq+48 ], m4
-%ifdef m8
-    movdqa  [dstq+64 ], m5
-    movdqa  [dstq+80 ], m6
-    movdqa  [dstq+96 ], m7
-    movdqa  [dstq+112], m8
-    add      srcq, 128
-    add      dstq, 128
-    sub      lenq, 32
-%else
-    add      srcq, 64
-    add      dstq, 64
-    sub      lenq, 16
-%endif
-    ja .loop
-    REP_RET
-
-;------------------------------------------------------------------------------
-; int ff_ac3_compute_mantissa_size(uint16_t mant_cnt[6][16])
-;------------------------------------------------------------------------------
-
-%macro PHADDD4 2 ; xmm src, xmm tmp
-    movhlps  %2, %1
-    paddd    %1, %2
-    pshufd   %2, %1, 0x1
-    paddd    %1, %2
-%endmacro
-
-INIT_XMM sse2
-cglobal ac3_compute_mantissa_size, 1, 2, 4, mant_cnt, sum
-    movdqa      m0, [mant_cntq      ]
-    movdqa      m1, [mant_cntq+ 1*16]
-    paddw       m0, [mant_cntq+ 2*16]
-    paddw       m1, [mant_cntq+ 3*16]
-    paddw       m0, [mant_cntq+ 4*16]
-    paddw       m1, [mant_cntq+ 5*16]
-    paddw       m0, [mant_cntq+ 6*16]
-    paddw       m1, [mant_cntq+ 7*16]
-    paddw       m0, [mant_cntq+ 8*16]
-    paddw       m1, [mant_cntq+ 9*16]
-    paddw       m0, [mant_cntq+10*16]
-    paddw       m1, [mant_cntq+11*16]
-    pmaddwd     m0, [ac3_bap_bits   ]
-    pmaddwd     m1, [ac3_bap_bits+16]
-    paddd       m0, m1
-    PHADDD4     m0, m1
-    movd      sumd, m0
-    movdqa      m3, [pw_bap_mul1]
-    movhpd      m0, [mant_cntq     +2]
-    movlpd      m0, [mant_cntq+1*32+2]
-    movhpd      m1, [mant_cntq+2*32+2]
-    movlpd      m1, [mant_cntq+3*32+2]
-    movhpd      m2, [mant_cntq+4*32+2]
-    movlpd      m2, [mant_cntq+5*32+2]
-    pmulhuw     m0, m3
-    pmulhuw     m1, m3
-    pmulhuw     m2, m3
-    paddusw     m0, m1
-    paddusw     m0, m2
-    pmaddwd     m0, [pw_bap_mul2]
-    PHADDD4     m0, m1
-    movd       eax, m0
-    add        eax, sumd
-    RET
-
-;------------------------------------------------------------------------------
-; void ff_ac3_extract_exponents(uint8_t *exp, int32_t *coef, int nb_coefs)
-;------------------------------------------------------------------------------
-
-%macro PABSD 1-2 ; src/dst, unused
-%if cpuflag(ssse3)
-    pabsd    %1, %1
-%else ; src/dst, tmp
-    pxor     %2, %2
-    pcmpgtd  %2, %1
-    pxor     %1, %2
-    psubd    %1, %2
-%endif
-%endmacro
-
-%macro AC3_EXTRACT_EXPONENTS 0
-cglobal ac3_extract_exponents, 3, 3, 4, exp, coef, len
-    add     expq, lenq
-    lea    coefq, [coefq+4*lenq]
-    neg     lenq
-    mova      m2, [pd_1]
-    mova      m3, [pd_151]
-.loop:
-    ; move 4 32-bit coefs to xmm0
-    mova      m0, [coefq+4*lenq]
-    ; absolute value
-    PABSD     m0, m1
-    ; convert to float and extract exponents
-    pslld     m0, 1
-    por       m0, m2
-    cvtdq2ps  m1, m0
-    psrld     m1, 23
-    mova      m0, m3
-    psubd     m0, m1
-    ; move the lowest byte in each of 4 dwords to the low dword
-    ; NOTE: We cannot just extract the low bytes with pshufb because the dword
-    ;       result for 16777215 is -1 due to float inaccuracy. Using packuswb
-    ;       clips this to 0, which is the correct exponent.
-    packssdw  m0, m0
-    packuswb  m0, m0
-    movd  [expq+lenq], m0
-
-    add     lenq, 4
-    jl .loop
-    REP_RET
-%endmacro
-
-%if HAVE_SSE2_EXTERNAL
-INIT_XMM sse2
-AC3_EXTRACT_EXPONENTS
-%endif
-%if HAVE_SSSE3_EXTERNAL
-INIT_XMM ssse3
-AC3_EXTRACT_EXPONENTS
-%endif
diff --git a/deps/libav/libavcodec/x86/ac3dsp_init.c b/deps/libav/libavcodec/x86/ac3dsp_init.c
deleted file mode 100644
index f3a9213..0000000
--- a/deps/libav/libavcodec/x86/ac3dsp_init.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * x86-optimized AC-3 DSP utils
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "dsputil_x86.h"
-#include "libavcodec/ac3.h"
-#include "libavcodec/ac3dsp.h"
-
-void ff_ac3_exponent_min_mmx   (uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-void ff_ac3_exponent_min_mmxext(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-void ff_ac3_exponent_min_sse2  (uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-
-int ff_ac3_max_msb_abs_int16_mmx  (const int16_t *src, int len);
-int ff_ac3_max_msb_abs_int16_mmxext(const int16_t *src, int len);
-int ff_ac3_max_msb_abs_int16_sse2 (const int16_t *src, int len);
-int ff_ac3_max_msb_abs_int16_ssse3(const int16_t *src, int len);
-
-void ff_ac3_lshift_int16_mmx (int16_t *src, unsigned int len, unsigned int shift);
-void ff_ac3_lshift_int16_sse2(int16_t *src, unsigned int len, unsigned int shift);
-
-void ff_ac3_rshift_int32_mmx (int32_t *src, unsigned int len, unsigned int shift);
-void ff_ac3_rshift_int32_sse2(int32_t *src, unsigned int len, unsigned int shift);
-
-void ff_float_to_fixed24_3dnow(int32_t *dst, const float *src, unsigned int len);
-void ff_float_to_fixed24_sse  (int32_t *dst, const float *src, unsigned int len);
-void ff_float_to_fixed24_sse2 (int32_t *dst, const float *src, unsigned int len);
-
-int ff_ac3_compute_mantissa_size_sse2(uint16_t mant_cnt[6][16]);
-
-void ff_ac3_extract_exponents_3dnow(uint8_t *exp, int32_t *coef, int nb_coefs);
-void ff_ac3_extract_exponents_sse2 (uint8_t *exp, int32_t *coef, int nb_coefs);
-void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs);
-
-void ff_apply_window_int16_round_mmxext(int16_t *output, const int16_t *input,
-                                        const int16_t *window, unsigned int len);
-void ff_apply_window_int16_round_sse2(int16_t *output, const int16_t *input,
-                                      const int16_t *window, unsigned int len);
-void ff_apply_window_int16_mmxext(int16_t *output, const int16_t *input,
-                                  const int16_t *window, unsigned int len);
-void ff_apply_window_int16_sse2(int16_t *output, const int16_t *input,
-                                const int16_t *window, unsigned int len);
-void ff_apply_window_int16_ssse3(int16_t *output, const int16_t *input,
-                                 const int16_t *window, unsigned int len);
-void ff_apply_window_int16_ssse3_atom(int16_t *output, const int16_t *input,
-                                      const int16_t *window, unsigned int len);
-
-#if HAVE_SSE_INLINE && HAVE_7REGS
-
-#define IF1(x) x
-#define IF0(x)
-
-#define MIX5(mono, stereo)                                      \
-    __asm__ volatile (                                          \
-        "movss           0(%1), %%xmm5          \n"             \
-        "movss           8(%1), %%xmm6          \n"             \
-        "movss          24(%1), %%xmm7          \n"             \
-        "shufps     $0, %%xmm5, %%xmm5          \n"             \
-        "shufps     $0, %%xmm6, %%xmm6          \n"             \
-        "shufps     $0, %%xmm7, %%xmm7          \n"             \
-        "1:                                     \n"             \
-        "movaps       (%0, %2), %%xmm0          \n"             \
-        "movaps       (%0, %3), %%xmm1          \n"             \
-        "movaps       (%0, %4), %%xmm2          \n"             \
-        "movaps       (%0, %5), %%xmm3          \n"             \
-        "movaps       (%0, %6), %%xmm4          \n"             \
-        "mulps          %%xmm5, %%xmm0          \n"             \
-        "mulps          %%xmm6, %%xmm1          \n"             \
-        "mulps          %%xmm5, %%xmm2          \n"             \
-        "mulps          %%xmm7, %%xmm3          \n"             \
-        "mulps          %%xmm7, %%xmm4          \n"             \
- stereo("addps          %%xmm1, %%xmm0          \n")            \
-        "addps          %%xmm1, %%xmm2          \n"             \
-        "addps          %%xmm3, %%xmm0          \n"             \
-        "addps          %%xmm4, %%xmm2          \n"             \
-   mono("addps          %%xmm2, %%xmm0          \n")            \
-        "movaps         %%xmm0, (%0, %2)        \n"             \
- stereo("movaps         %%xmm2, (%0, %3)        \n")            \
-        "add               $16, %0              \n"             \
-        "jl                 1b                  \n"             \
-        : "+&r"(i)                                              \
-        : "r"(matrix),                                          \
-          "r"(samples[0] + len),                                \
-          "r"(samples[1] + len),                                \
-          "r"(samples[2] + len),                                \
-          "r"(samples[3] + len),                                \
-          "r"(samples[4] + len)                                 \
-        : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3",      \
-                      "%xmm4", "%xmm5", "%xmm6", "%xmm7",)      \
-         "memory"                                               \
-    );
-
-#define MIX_MISC(stereo)                                        \
-    __asm__ volatile (                                          \
-        "mov              %5, %2            \n"                 \
-        "1:                                 \n"                 \
-        "mov -%c7(%6, %2, %c8), %3          \n"                 \
-        "movaps     (%3, %0), %%xmm0        \n"                 \
- stereo("movaps       %%xmm0, %%xmm1        \n")                \
-        "mulps        %%xmm4, %%xmm0        \n"                 \
- stereo("mulps        %%xmm5, %%xmm1        \n")                \
-        "2:                                 \n"                 \
-        "mov   (%6, %2, %c8), %1            \n"                 \
-        "movaps     (%1, %0), %%xmm2        \n"                 \
- stereo("movaps       %%xmm2, %%xmm3        \n")                \
-        "mulps   (%4, %2, 8), %%xmm2        \n"                 \
- stereo("mulps 16(%4, %2, 8), %%xmm3        \n")                \
-        "addps        %%xmm2, %%xmm0        \n"                 \
- stereo("addps        %%xmm3, %%xmm1        \n")                \
-        "add              $4, %2            \n"                 \
-        "jl               2b                \n"                 \
-        "mov              %5, %2            \n"                 \
- stereo("mov   (%6, %2, %c8), %1            \n")                \
-        "movaps       %%xmm0, (%3, %0)      \n"                 \
- stereo("movaps       %%xmm1, (%1, %0)      \n")                \
-        "add             $16, %0            \n"                 \
-        "jl               1b                \n"                 \
-        : "+&r"(i), "=&r"(j), "=&r"(k), "=&r"(m)                \
-        : "r"(matrix_simd + in_ch),                             \
-          "g"((intptr_t) - 4 * (in_ch - 1)),                    \
-          "r"(samp + in_ch),                                    \
-          "i"(sizeof(float *)), "i"(sizeof(float *)/4)          \
-        : "memory"                                              \
-    );
-
-static void ac3_downmix_sse(float **samples, float (*matrix)[2],
-                            int out_ch, int in_ch, int len)
-{
-    int (*matrix_cmp)[2] = (int(*)[2])matrix;
-    intptr_t i, j, k, m;
-
-    i = -len * sizeof(float);
-    if (in_ch == 5 && out_ch == 2 &&
-        !(matrix_cmp[0][1] | matrix_cmp[2][0]   |
-          matrix_cmp[3][1] | matrix_cmp[4][0]   |
-          (matrix_cmp[1][0] ^ matrix_cmp[1][1]) |
-          (matrix_cmp[0][0] ^ matrix_cmp[2][1]))) {
-        MIX5(IF0, IF1);
-    } else if (in_ch == 5 && out_ch == 1 &&
-               matrix_cmp[0][0] == matrix_cmp[2][0] &&
-               matrix_cmp[3][0] == matrix_cmp[4][0]) {
-        MIX5(IF1, IF0);
-    } else {
-        DECLARE_ALIGNED(16, float, matrix_simd)[AC3_MAX_CHANNELS][2][4];
-        float *samp[AC3_MAX_CHANNELS];
-
-        for (j = 0; j < in_ch; j++)
-            samp[j] = samples[j] + len;
-
-        j = 2 * in_ch * sizeof(float);
-        __asm__ volatile (
-            "1:                                 \n"
-            "sub             $8, %0             \n"
-            "movss     (%2, %0), %%xmm4         \n"
-            "movss    4(%2, %0), %%xmm5         \n"
-            "shufps          $0, %%xmm4, %%xmm4 \n"
-            "shufps          $0, %%xmm5, %%xmm5 \n"
-            "movaps      %%xmm4,   (%1, %0, 4)  \n"
-            "movaps      %%xmm5, 16(%1, %0, 4)  \n"
-            "jg              1b                 \n"
-            : "+&r"(j)
-            : "r"(matrix_simd), "r"(matrix)
-            : "memory"
-        );
-        if (out_ch == 2) {
-            MIX_MISC(IF1);
-        } else {
-            MIX_MISC(IF0);
-        }
-    }
-}
-
-#endif /* HAVE_SSE_INLINE && HAVE_7REGS */
-
-av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->ac3_exponent_min = ff_ac3_exponent_min_mmx;
-        c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_mmx;
-        c->ac3_lshift_int16 = ff_ac3_lshift_int16_mmx;
-        c->ac3_rshift_int32 = ff_ac3_rshift_int32_mmx;
-    }
-    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-        if (!bit_exact) {
-            c->float_to_fixed24 = ff_float_to_fixed24_3dnow;
-        }
-    }
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        c->ac3_exponent_min = ff_ac3_exponent_min_mmxext;
-        c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_mmxext;
-        if (bit_exact) {
-            c->apply_window_int16 = ff_apply_window_int16_mmxext;
-        } else {
-            c->apply_window_int16 = ff_apply_window_int16_round_mmxext;
-        }
-    }
-    if (EXTERNAL_SSE(cpu_flags)) {
-        c->float_to_fixed24 = ff_float_to_fixed24_sse;
-    }
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        c->ac3_exponent_min = ff_ac3_exponent_min_sse2;
-        c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_sse2;
-        c->float_to_fixed24 = ff_float_to_fixed24_sse2;
-        c->compute_mantissa_size = ff_ac3_compute_mantissa_size_sse2;
-        c->extract_exponents = ff_ac3_extract_exponents_sse2;
-        if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
-            c->ac3_lshift_int16 = ff_ac3_lshift_int16_sse2;
-            c->ac3_rshift_int32 = ff_ac3_rshift_int32_sse2;
-        }
-        if (bit_exact) {
-            c->apply_window_int16 = ff_apply_window_int16_sse2;
-        } else if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
-            c->apply_window_int16 = ff_apply_window_int16_round_sse2;
-        }
-    }
-    if (EXTERNAL_SSSE3(cpu_flags)) {
-        c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_ssse3;
-        if (cpu_flags & AV_CPU_FLAG_ATOM) {
-            c->apply_window_int16 = ff_apply_window_int16_ssse3_atom;
-        } else {
-            c->extract_exponents = ff_ac3_extract_exponents_ssse3;
-            c->apply_window_int16 = ff_apply_window_int16_ssse3;
-        }
-    }
-
-#if HAVE_SSE_INLINE && HAVE_7REGS
-    if (INLINE_SSE(cpu_flags)) {
-        c->downmix = ac3_downmix_sse;
-    }
-#endif
-}
diff --git a/deps/libav/libavcodec/x86/cabac.h b/deps/libav/libavcodec/x86/cabac.h
deleted file mode 100644
index fdb0a29..0000000
--- a/deps/libav/libavcodec/x86/cabac.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_X86_CABAC_H
-#define AVCODEC_X86_CABAC_H
-
-#include "libavcodec/cabac.h"
-#include "libavutil/attributes.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/internal.h"
-#include "config.h"
-
-#if HAVE_INLINE_ASM
-
-#ifdef BROKEN_RELOCATIONS
-#define TABLES_ARG , "r"(tables)
-
-#if HAVE_FAST_CMOV
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, retq, low, range, tmp) \
-        "cmp    "low"       , "tmp"                        \n\t"\
-        "cmova  %%ecx       , "range"                      \n\t"\
-        "sbb    %%rcx       , %%rcx                        \n\t"\
-        "and    %%ecx       , "tmp"                        \n\t"\
-        "xor    %%rcx       , "retq"                       \n\t"\
-        "sub    "tmp"       , "low"                        \n\t"
-#else /* HAVE_FAST_CMOV */
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, retq, low, range, tmp) \
-/* P4 Prescott has crappy cmov,sbb,64bit shift so avoid them */ \
-        "sub    "low"       , "tmp"                        \n\t"\
-        "sar    $31         , "tmp"                        \n\t"\
-        "sub    %%ecx       , "range"                      \n\t"\
-        "and    "tmp"       , "range"                      \n\t"\
-        "add    %%ecx       , "range"                      \n\t"\
-        "shl    $17         , %%ecx                        \n\t"\
-        "and    "tmp"       , %%ecx                        \n\t"\
-        "sub    %%ecx       , "low"                        \n\t"\
-        "xor    "tmp"       , "ret"                        \n\t"\
-        "movslq "ret"       , "retq"                       \n\t"
-#endif /* HAVE_FAST_CMOV */
-
-#define BRANCHLESS_GET_CABAC(ret, retq, statep, low, lowword, range, rangeq, tmp, tmpbyte, byte, end, norm_off, lps_off, mlps_off, tables) \
-        "movzbl "statep"    , "ret"                                     \n\t"\
-        "mov    "range"     , "tmp"                                     \n\t"\
-        "and    $0xC0       , "range"                                   \n\t"\
-        "lea    ("ret", "range", 2), %%ecx                              \n\t"\
-        "movzbl "lps_off"("tables", %%rcx), "range"                     \n\t"\
-        "sub    "range"     , "tmp"                                     \n\t"\
-        "mov    "tmp"       , %%ecx                                     \n\t"\
-        "shl    $17         , "tmp"                                     \n\t"\
-        BRANCHLESS_GET_CABAC_UPDATE(ret, retq, low, range, tmp)              \
-        "movzbl "norm_off"("tables", "rangeq"), %%ecx                   \n\t"\
-        "shl    %%cl        , "range"                                   \n\t"\
-        "movzbl "mlps_off"+128("tables", "retq"), "tmp"                 \n\t"\
-        "shl    %%cl        , "low"                                     \n\t"\
-        "mov    "tmpbyte"   , "statep"                                  \n\t"\
-        "test   "lowword"   , "lowword"                                 \n\t"\
-        "jnz    2f                                                      \n\t"\
-        "mov    "byte"      , %%"REG_c"                                 \n\t"\
-        "cmp    "end"       , %%"REG_c"                                 \n\t"\
-        "jge    1f                                                      \n\t"\
-        "add"OPSIZE" $2     , "byte"                                    \n\t"\
-        "1:                                                             \n\t"\
-        "movzwl (%%"REG_c") , "tmp"                                     \n\t"\
-        "lea    -1("low")   , %%ecx                                     \n\t"\
-        "xor    "low"       , %%ecx                                     \n\t"\
-        "shr    $15         , %%ecx                                     \n\t"\
-        "bswap  "tmp"                                                   \n\t"\
-        "shr    $15         , "tmp"                                     \n\t"\
-        "movzbl "norm_off"("tables", %%rcx), %%ecx                      \n\t"\
-        "sub    $0xFFFF     , "tmp"                                     \n\t"\
-        "neg    %%ecx                                                   \n\t"\
-        "add    $7          , %%ecx                                     \n\t"\
-        "shl    %%cl        , "tmp"                                     \n\t"\
-        "add    "tmp"       , "low"                                     \n\t"\
-        "2:                                                             \n\t"
-
-#else /* BROKEN_RELOCATIONS */
-#define TABLES_ARG
-
-#if HAVE_FAST_CMOV
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, low, range, tmp)\
-        "mov    "tmp"       , %%ecx     \n\t"\
-        "shl    $17         , "tmp"     \n\t"\
-        "cmp    "low"       , "tmp"     \n\t"\
-        "cmova  %%ecx       , "range"   \n\t"\
-        "sbb    %%ecx       , %%ecx     \n\t"\
-        "and    %%ecx       , "tmp"     \n\t"\
-        "xor    %%ecx       , "ret"     \n\t"\
-        "sub    "tmp"       , "low"     \n\t"
-#else /* HAVE_FAST_CMOV */
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, low, range, tmp)\
-        "mov    "tmp"       , %%ecx     \n\t"\
-        "shl    $17         , "tmp"     \n\t"\
-        "sub    "low"       , "tmp"     \n\t"\
-        "sar    $31         , "tmp"     \n\t" /*lps_mask*/\
-        "sub    %%ecx       , "range"   \n\t" /*RangeLPS - range*/\
-        "and    "tmp"       , "range"   \n\t" /*(RangeLPS - range)&lps_mask*/\
-        "add    %%ecx       , "range"   \n\t" /*new range*/\
-        "shl    $17         , %%ecx     \n\t"\
-        "and    "tmp"       , %%ecx     \n\t"\
-        "sub    %%ecx       , "low"     \n\t"\
-        "xor    "tmp"       , "ret"     \n\t"
-#endif /* HAVE_FAST_CMOV */
-
-#define BRANCHLESS_GET_CABAC(ret, retq, statep, low, lowword, range, rangeq, tmp, tmpbyte, byte, end, norm_off, lps_off, mlps_off, tables) \
-        "movzbl "statep"    , "ret"                                     \n\t"\
-        "mov    "range"     , "tmp"                                     \n\t"\
-        "and    $0xC0       , "range"                                   \n\t"\
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"lps_off"("ret", "range", 2), "range" \n\t"\
-        "sub    "range"     , "tmp"                                     \n\t"\
-        BRANCHLESS_GET_CABAC_UPDATE(ret, low, range, tmp)                    \
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"norm_off"("range"), %%ecx    \n\t"\
-        "shl    %%cl        , "range"                                   \n\t"\
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"mlps_off"+128("ret"), "tmp"  \n\t"\
-        "shl    %%cl        , "low"                                     \n\t"\
-        "mov    "tmpbyte"   , "statep"                                  \n\t"\
-        "test   "lowword"   , "lowword"                                 \n\t"\
-        " jnz   2f                                                      \n\t"\
-        "mov    "byte"      , %%"REG_c"                                 \n\t"\
-        "cmp    "end"       , %%"REG_c"                                 \n\t"\
-        "jge    1f                                                      \n\t"\
-        "add"OPSIZE" $2     , "byte"                                    \n\t"\
-        "1:                                                             \n\t"\
-        "movzwl (%%"REG_c")     , "tmp"                                 \n\t"\
-        "lea    -1("low")   , %%ecx                                     \n\t"\
-        "xor    "low"       , %%ecx                                     \n\t"\
-        "shr    $15         , %%ecx                                     \n\t"\
-        "bswap  "tmp"                                                   \n\t"\
-        "shr    $15         , "tmp"                                     \n\t"\
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+"norm_off"(%%ecx), %%ecx \n\t"\
-        "sub    $0xFFFF     , "tmp"                                     \n\t"\
-        "neg    %%ecx                                                   \n\t"\
-        "add    $7          , %%ecx                                     \n\t"\
-        "shl    %%cl        , "tmp"                                     \n\t"\
-        "add    "tmp"       , "low"                                     \n\t"\
-        "2:                                                             \n\t"
-
-#endif /* BROKEN_RELOCATIONS */
-
-
-#if HAVE_7REGS
-#define get_cabac_inline get_cabac_inline_x86
-static av_always_inline int get_cabac_inline_x86(CABACContext *c,
-                                                 uint8_t *const state)
-{
-    int bit, tmp;
-#ifdef BROKEN_RELOCATIONS
-    void *tables;
-
-    __asm__ volatile(
-        "lea    "MANGLE(ff_h264_cabac_tables)", %0      \n\t"
-        : "=&r"(tables)
-    );
-#endif
-
-    __asm__ volatile(
-        BRANCHLESS_GET_CABAC("%0", "%q0", "(%4)", "%1", "%w1",
-                             "%2", "%q2", "%3", "%b3",
-                             "%c6(%5)", "%c7(%5)",
-                             AV_STRINGIFY(H264_NORM_SHIFT_OFFSET),
-                             AV_STRINGIFY(H264_LPS_RANGE_OFFSET),
-                             AV_STRINGIFY(H264_MLPS_STATE_OFFSET),
-                             "%8")
-        : "=&r"(bit), "+&r"(c->low), "+&r"(c->range), "=&q"(tmp)
-        : "r"(state), "r"(c),
-          "i"(offsetof(CABACContext, bytestream)),
-          "i"(offsetof(CABACContext, bytestream_end))
-          TABLES_ARG
-        : "%"REG_c, "memory"
-    );
-    return bit & 1;
-}
-#endif /* HAVE_7REGS */
-
-#define get_cabac_bypass_sign get_cabac_bypass_sign_x86
-static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
-{
-    x86_reg tmp;
-    __asm__ volatile(
-        "movl        %c6(%2), %k1       \n\t"
-        "movl        %c3(%2), %%eax     \n\t"
-        "shl             $17, %k1       \n\t"
-        "add           %%eax, %%eax     \n\t"
-        "sub             %k1, %%eax     \n\t"
-        "cltd                           \n\t"
-        "and           %%edx, %k1       \n\t"
-        "add             %k1, %%eax     \n\t"
-        "xor           %%edx, %%ecx     \n\t"
-        "sub           %%edx, %%ecx     \n\t"
-        "test           %%ax, %%ax      \n\t"
-        "jnz              1f            \n\t"
-        "mov         %c4(%2), %1        \n\t"
-        "subl        $0xFFFF, %%eax     \n\t"
-        "movzwl         (%1), %%edx     \n\t"
-        "bswap         %%edx            \n\t"
-        "shrl            $15, %%edx     \n\t"
-        "addl          %%edx, %%eax     \n\t"
-        "cmp         %c5(%2), %1        \n\t"
-        "jge              1f            \n\t"
-        "add"OPSIZE"      $2, %c4(%2)   \n\t"
-        "1:                             \n\t"
-        "movl          %%eax, %c3(%2)   \n\t"
-
-        : "+c"(val), "=&r"(tmp)
-        : "r"(c),
-          "i"(offsetof(CABACContext, low)),
-          "i"(offsetof(CABACContext, bytestream)),
-          "i"(offsetof(CABACContext, bytestream_end)),
-          "i"(offsetof(CABACContext, range))
-        : "%eax", "%edx", "memory"
-    );
-    return val;
-}
-
-#define get_cabac_bypass get_cabac_bypass_x86
-static av_always_inline int get_cabac_bypass_x86(CABACContext *c)
-{
-    x86_reg tmp;
-    int res;
-    __asm__ volatile(
-        "movl        %c6(%2), %k1       \n\t"
-        "movl        %c3(%2), %%eax     \n\t"
-        "shl             $17, %k1       \n\t"
-        "add           %%eax, %%eax     \n\t"
-        "sub             %k1, %%eax     \n\t"
-        "cltd                           \n\t"
-        "and           %%edx, %k1       \n\t"
-        "add             %k1, %%eax     \n\t"
-        "inc           %%edx            \n\t"
-        "test           %%ax, %%ax      \n\t"
-        "jnz              1f            \n\t"
-        "mov         %c4(%2), %1        \n\t"
-        "subl        $0xFFFF, %%eax     \n\t"
-        "movzwl         (%1), %%ecx     \n\t"
-        "bswap         %%ecx            \n\t"
-        "shrl            $15, %%ecx     \n\t"
-        "addl          %%ecx, %%eax     \n\t"
-        "cmp         %c5(%2), %1        \n\t"
-        "jge              1f            \n\t"
-        "add"OPSIZE"      $2, %c4(%2)   \n\t"
-        "1:                             \n\t"
-        "movl          %%eax, %c3(%2)   \n\t"
-
-        : "=&d"(res), "=&r"(tmp)
-        : "r"(c),
-          "i"(offsetof(CABACContext, low)),
-          "i"(offsetof(CABACContext, bytestream)),
-          "i"(offsetof(CABACContext, bytestream_end)),
-          "i"(offsetof(CABACContext, range))
-        : "%eax", "%ecx", "memory"
-    );
-    return res;
-}
-
-#endif /* HAVE_INLINE_ASM */
-#endif /* AVCODEC_X86_CABAC_H */
diff --git a/deps/libav/libavcodec/x86/cavsdsp.c b/deps/libav/libavcodec/x86/cavsdsp.c
deleted file mode 100644
index bc9cbf7..0000000
--- a/deps/libav/libavcodec/x86/cavsdsp.c
+++ /dev/null
@@ -1,558 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
- * Copyright (c) 2006  Stefan Gehrer <stefan.gehrer at gmx.de>
- *
- * MMX-optimized DSP functions, based on H.264 optimizations by
- * Michael Niedermayer and Loren Merritt
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/cavsdsp.h"
-#include "constants.h"
-#include "dsputil_x86.h"
-#include "config.h"
-
-#if HAVE_MMX_INLINE
-
-/* in/out: mma=mma+mmb, mmb=mmb-mma */
-#define SUMSUB_BA( a, b ) \
-    "paddw "#b", "#a" \n\t"\
-    "paddw "#b", "#b" \n\t"\
-    "psubw "#a", "#b" \n\t"
-
-/*****************************************************************************
- *
- * inverse transform
- *
- ****************************************************************************/
-
-static inline void cavs_idct8_1d(int16_t *block, uint64_t bias)
-{
-    __asm__ volatile(
-        "movq 112(%0), %%mm4  \n\t" /* mm4 = src7 */
-        "movq  16(%0), %%mm5  \n\t" /* mm5 = src1 */
-        "movq  80(%0), %%mm2  \n\t" /* mm2 = src5 */
-        "movq  48(%0), %%mm7  \n\t" /* mm7 = src3 */
-        "movq   %%mm4, %%mm0  \n\t"
-        "movq   %%mm5, %%mm3  \n\t"
-        "movq   %%mm2, %%mm6  \n\t"
-        "movq   %%mm7, %%mm1  \n\t"
-
-        "paddw  %%mm4, %%mm4  \n\t" /* mm4 = 2*src7 */
-        "paddw  %%mm3, %%mm3  \n\t" /* mm3 = 2*src1 */
-        "paddw  %%mm6, %%mm6  \n\t" /* mm6 = 2*src5 */
-        "paddw  %%mm1, %%mm1  \n\t" /* mm1 = 2*src3 */
-        "paddw  %%mm4, %%mm0  \n\t" /* mm0 = 3*src7 */
-        "paddw  %%mm3, %%mm5  \n\t" /* mm5 = 3*src1 */
-        "paddw  %%mm6, %%mm2  \n\t" /* mm2 = 3*src5 */
-        "paddw  %%mm1, %%mm7  \n\t" /* mm7 = 3*src3 */
-        "psubw  %%mm4, %%mm5  \n\t" /* mm5 = 3*src1 - 2*src7 = a0 */
-        "paddw  %%mm6, %%mm7  \n\t" /* mm7 = 3*src3 + 2*src5 = a1 */
-        "psubw  %%mm2, %%mm1  \n\t" /* mm1 = 2*src3 - 3*src5 = a2 */
-        "paddw  %%mm0, %%mm3  \n\t" /* mm3 = 2*src1 + 3*src7 = a3 */
-
-        "movq   %%mm5, %%mm4  \n\t"
-        "movq   %%mm7, %%mm6  \n\t"
-        "movq   %%mm3, %%mm0  \n\t"
-        "movq   %%mm1, %%mm2  \n\t"
-        SUMSUB_BA( %%mm7, %%mm5 )   /* mm7 = a0 + a1  mm5 = a0 - a1 */
-        "paddw  %%mm3, %%mm7  \n\t" /* mm7 = a0 + a1 + a3 */
-        "paddw  %%mm1, %%mm5  \n\t" /* mm5 = a0 - a1 + a2 */
-        "paddw  %%mm7, %%mm7  \n\t"
-        "paddw  %%mm5, %%mm5  \n\t"
-        "paddw  %%mm6, %%mm7  \n\t" /* mm7 = b4 */
-        "paddw  %%mm4, %%mm5  \n\t" /* mm5 = b5 */
-
-        SUMSUB_BA( %%mm1, %%mm3 )   /* mm1 = a3 + a2  mm3 = a3 - a2 */
-        "psubw  %%mm1, %%mm4  \n\t" /* mm4 = a0 - a2 - a3 */
-        "movq   %%mm4, %%mm1  \n\t" /* mm1 = a0 - a2 - a3 */
-        "psubw  %%mm6, %%mm3  \n\t" /* mm3 = a3 - a2 - a1 */
-        "paddw  %%mm1, %%mm1  \n\t"
-        "paddw  %%mm3, %%mm3  \n\t"
-        "psubw  %%mm2, %%mm1  \n\t" /* mm1 = b7 */
-        "paddw  %%mm0, %%mm3  \n\t" /* mm3 = b6 */
-
-        "movq  32(%0), %%mm2  \n\t" /* mm2 = src2 */
-        "movq  96(%0), %%mm6  \n\t" /* mm6 = src6 */
-        "movq   %%mm2, %%mm4  \n\t"
-        "movq   %%mm6, %%mm0  \n\t"
-        "psllw  $2,    %%mm4  \n\t" /* mm4 = 4*src2 */
-        "psllw  $2,    %%mm6  \n\t" /* mm6 = 4*src6 */
-        "paddw  %%mm4, %%mm2  \n\t" /* mm2 = 5*src2 */
-        "paddw  %%mm6, %%mm0  \n\t" /* mm0 = 5*src6 */
-        "paddw  %%mm2, %%mm2  \n\t"
-        "paddw  %%mm0, %%mm0  \n\t"
-        "psubw  %%mm0, %%mm4  \n\t" /* mm4 = 4*src2 - 10*src6 = a7 */
-        "paddw  %%mm2, %%mm6  \n\t" /* mm6 = 4*src6 + 10*src2 = a6 */
-
-        "movq    (%0), %%mm2  \n\t" /* mm2 = src0 */
-        "movq  64(%0), %%mm0  \n\t" /* mm0 = src4 */
-        SUMSUB_BA( %%mm0, %%mm2 )   /* mm0 = src0+src4  mm2 = src0-src4 */
-        "psllw  $3,    %%mm0  \n\t"
-        "psllw  $3,    %%mm2  \n\t"
-        "paddw  %1,    %%mm0  \n\t" /* add rounding bias */
-        "paddw  %1,    %%mm2  \n\t" /* add rounding bias */
-
-        SUMSUB_BA( %%mm6, %%mm0 )   /* mm6 = a4 + a6  mm0 = a4 - a6 */
-        SUMSUB_BA( %%mm4, %%mm2 )   /* mm4 = a5 + a7  mm2 = a5 - a7 */
-        SUMSUB_BA( %%mm7, %%mm6 )   /* mm7 = dst0  mm6 = dst7 */
-        SUMSUB_BA( %%mm5, %%mm4 )   /* mm5 = dst1  mm4 = dst6 */
-        SUMSUB_BA( %%mm3, %%mm2 )   /* mm3 = dst2  mm2 = dst5 */
-        SUMSUB_BA( %%mm1, %%mm0 )   /* mm1 = dst3  mm0 = dst4 */
-        :: "r"(block), "m"(bias)
-    );
-}
-
-#define SBUTTERFLY(a,b,t,n,m)\
-    "mov" #m " " #a ", " #t "         \n\t" /* abcd */\
-    "punpckl" #n " " #b ", " #a "     \n\t" /* aebf */\
-    "punpckh" #n " " #b ", " #t "     \n\t" /* cgdh */\
-
-#define TRANSPOSE4(a,b,c,d,t)\
-    SBUTTERFLY(a,b,t,wd,q) /* a=aebf t=cgdh */\
-    SBUTTERFLY(c,d,b,wd,q) /* c=imjn b=kolp */\
-    SBUTTERFLY(a,c,d,dq,q) /* a=aeim d=bfjn */\
-    SBUTTERFLY(t,b,c,dq,q) /* t=cgko c=dhlp */
-
-static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
-{
-    int i;
-    DECLARE_ALIGNED(8, int16_t, b2)[64];
-
-    for(i=0; i<2; i++){
-        DECLARE_ALIGNED(8, uint64_t, tmp);
-
-        cavs_idct8_1d(block+4*i, ff_pw_4.a);
-
-        __asm__ volatile(
-            "psraw     $3, %%mm7  \n\t"
-            "psraw     $3, %%mm6  \n\t"
-            "psraw     $3, %%mm5  \n\t"
-            "psraw     $3, %%mm4  \n\t"
-            "psraw     $3, %%mm3  \n\t"
-            "psraw     $3, %%mm2  \n\t"
-            "psraw     $3, %%mm1  \n\t"
-            "psraw     $3, %%mm0  \n\t"
-            "movq   %%mm7,    %0   \n\t"
-            TRANSPOSE4( %%mm0, %%mm2, %%mm4, %%mm6, %%mm7 )
-            "movq   %%mm0,  8(%1)  \n\t"
-            "movq   %%mm6, 24(%1)  \n\t"
-            "movq   %%mm7, 40(%1)  \n\t"
-            "movq   %%mm4, 56(%1)  \n\t"
-            "movq    %0,    %%mm7  \n\t"
-            TRANSPOSE4( %%mm7, %%mm5, %%mm3, %%mm1, %%mm0 )
-            "movq   %%mm7,   (%1)  \n\t"
-            "movq   %%mm1, 16(%1)  \n\t"
-            "movq   %%mm0, 32(%1)  \n\t"
-            "movq   %%mm3, 48(%1)  \n\t"
-            : "=m"(tmp)
-            : "r"(b2+32*i)
-            : "memory"
-        );
-    }
-
-    for(i=0; i<2; i++){
-        cavs_idct8_1d(b2+4*i, ff_pw_64.a);
-
-        __asm__ volatile(
-            "psraw     $7, %%mm7  \n\t"
-            "psraw     $7, %%mm6  \n\t"
-            "psraw     $7, %%mm5  \n\t"
-            "psraw     $7, %%mm4  \n\t"
-            "psraw     $7, %%mm3  \n\t"
-            "psraw     $7, %%mm2  \n\t"
-            "psraw     $7, %%mm1  \n\t"
-            "psraw     $7, %%mm0  \n\t"
-            "movq   %%mm7,    (%0)  \n\t"
-            "movq   %%mm5,  16(%0)  \n\t"
-            "movq   %%mm3,  32(%0)  \n\t"
-            "movq   %%mm1,  48(%0)  \n\t"
-            "movq   %%mm0,  64(%0)  \n\t"
-            "movq   %%mm2,  80(%0)  \n\t"
-            "movq   %%mm4,  96(%0)  \n\t"
-            "movq   %%mm6, 112(%0)  \n\t"
-            :: "r"(b2+4*i)
-            : "memory"
-        );
-    }
-
-    ff_add_pixels_clamped_mmx(b2, dst, stride);
-}
-
-#endif /* HAVE_MMX_INLINE */
-
-#if (HAVE_MMXEXT_INLINE || HAVE_AMD3DNOW_INLINE)
-
-/*****************************************************************************
- *
- * motion compensation
- *
- ****************************************************************************/
-
-/* vertical filter [-1 -2 96 42 -7  0]  */
-#define QPEL_CAVSV1(A,B,C,D,E,F,OP,MUL2) \
-        "movd (%0), "#F"            \n\t"\
-        "movq "#C", %%mm6           \n\t"\
-        "pmullw %5, %%mm6           \n\t"\
-        "movq "#D", %%mm7           \n\t"\
-        "pmullw "MANGLE(MUL2)", %%mm7\n\t"\
-        "psllw $3, "#E"             \n\t"\
-        "psubw "#E", %%mm6          \n\t"\
-        "psraw $3, "#E"             \n\t"\
-        "paddw %%mm7, %%mm6         \n\t"\
-        "paddw "#E", %%mm6          \n\t"\
-        "paddw "#B", "#B"           \n\t"\
-        "pxor %%mm7, %%mm7          \n\t"\
-        "add %2, %0                 \n\t"\
-        "punpcklbw %%mm7, "#F"      \n\t"\
-        "psubw "#B", %%mm6          \n\t"\
-        "psraw $1, "#B"             \n\t"\
-        "psubw "#A", %%mm6          \n\t"\
-        "paddw %4, %%mm6            \n\t"\
-        "psraw $7, %%mm6            \n\t"\
-        "packuswb %%mm6, %%mm6      \n\t"\
-        OP(%%mm6, (%1), A, d)            \
-        "add %3, %1                 \n\t"
-
-/* vertical filter [ 0 -1  5  5 -1  0]  */
-#define QPEL_CAVSV2(A,B,C,D,E,F,OP,MUL2) \
-        "movd (%0), "#F"            \n\t"\
-        "movq "#C", %%mm6           \n\t"\
-        "paddw "#D", %%mm6          \n\t"\
-        "pmullw %5, %%mm6           \n\t"\
-        "add %2, %0                 \n\t"\
-        "punpcklbw %%mm7, "#F"      \n\t"\
-        "psubw "#B", %%mm6          \n\t"\
-        "psubw "#E", %%mm6          \n\t"\
-        "paddw %4, %%mm6            \n\t"\
-        "psraw $3, %%mm6            \n\t"\
-        "packuswb %%mm6, %%mm6      \n\t"\
-        OP(%%mm6, (%1), A, d)            \
-        "add %3, %1                 \n\t"
-
-/* vertical filter [ 0 -7 42 96 -2 -1]  */
-#define QPEL_CAVSV3(A,B,C,D,E,F,OP,MUL2) \
-        "movd (%0), "#F"            \n\t"\
-        "movq "#C", %%mm6           \n\t"\
-        "pmullw "MANGLE(MUL2)", %%mm6\n\t"\
-        "movq "#D", %%mm7           \n\t"\
-        "pmullw %5, %%mm7           \n\t"\
-        "psllw $3, "#B"             \n\t"\
-        "psubw "#B", %%mm6          \n\t"\
-        "psraw $3, "#B"             \n\t"\
-        "paddw %%mm7, %%mm6         \n\t"\
-        "paddw "#B", %%mm6          \n\t"\
-        "paddw "#E", "#E"           \n\t"\
-        "pxor %%mm7, %%mm7          \n\t"\
-        "add %2, %0                 \n\t"\
-        "punpcklbw %%mm7, "#F"      \n\t"\
-        "psubw "#E", %%mm6          \n\t"\
-        "psraw $1, "#E"             \n\t"\
-        "psubw "#F", %%mm6          \n\t"\
-        "paddw %4, %%mm6            \n\t"\
-        "psraw $7, %%mm6            \n\t"\
-        "packuswb %%mm6, %%mm6      \n\t"\
-        OP(%%mm6, (%1), A, d)            \
-        "add %3, %1                 \n\t"
-
-
-#define QPEL_CAVSVNUM(VOP,OP,ADD,MUL1,MUL2)\
-    int w= 2;\
-    src -= 2*srcStride;\
-    \
-    while(w--){\
-      __asm__ volatile(\
-        "pxor %%mm7, %%mm7          \n\t"\
-        "movd (%0), %%mm0           \n\t"\
-        "add %2, %0                 \n\t"\
-        "movd (%0), %%mm1           \n\t"\
-        "add %2, %0                 \n\t"\
-        "movd (%0), %%mm2           \n\t"\
-        "add %2, %0                 \n\t"\
-        "movd (%0), %%mm3           \n\t"\
-        "add %2, %0                 \n\t"\
-        "movd (%0), %%mm4           \n\t"\
-        "add %2, %0                 \n\t"\
-        "punpcklbw %%mm7, %%mm0     \n\t"\
-        "punpcklbw %%mm7, %%mm1     \n\t"\
-        "punpcklbw %%mm7, %%mm2     \n\t"\
-        "punpcklbw %%mm7, %%mm3     \n\t"\
-        "punpcklbw %%mm7, %%mm4     \n\t"\
-        VOP(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP, MUL2)\
-        VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP, MUL2)\
-        VOP(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP, MUL2)\
-        VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP, MUL2)\
-        VOP(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP, MUL2)\
-        VOP(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP, MUL2)\
-        VOP(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP, MUL2)\
-        VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP, MUL2)\
-        \
-        : "+a"(src), "+c"(dst)\
-        : "S"((x86_reg)srcStride), "r"((x86_reg)dstStride), "m"(ADD), "m"(MUL1)\
-        : "memory"\
-     );\
-     if(h==16){\
-        __asm__ volatile(\
-            VOP(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP, MUL2)\
-            VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP, MUL2)\
-            VOP(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP, MUL2)\
-            VOP(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP, MUL2)\
-            VOP(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP, MUL2)\
-            VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP, MUL2)\
-            VOP(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP, MUL2)\
-            VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP, MUL2)\
-            \
-           : "+a"(src), "+c"(dst)\
-           : "S"((x86_reg)srcStride), "r"((x86_reg)dstStride), "m"(ADD),  "m"(MUL1)\
-           : "memory"\
-        );\
-     }\
-     src += 4-(h+5)*srcStride;\
-     dst += 4-h*dstStride;\
-   }
-
-#define QPEL_CAVS(OPNAME, OP, MMX)\
-static void OPNAME ## cavs_qpel8_h_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    int h=8;\
-    __asm__ volatile(\
-        "pxor %%mm7, %%mm7          \n\t"\
-        "movq %5, %%mm6             \n\t"\
-        "1:                         \n\t"\
-        "movq    (%0), %%mm0        \n\t"\
-        "movq   1(%0), %%mm2        \n\t"\
-        "movq %%mm0, %%mm1          \n\t"\
-        "movq %%mm2, %%mm3          \n\t"\
-        "punpcklbw %%mm7, %%mm0     \n\t"\
-        "punpckhbw %%mm7, %%mm1     \n\t"\
-        "punpcklbw %%mm7, %%mm2     \n\t"\
-        "punpckhbw %%mm7, %%mm3     \n\t"\
-        "paddw %%mm2, %%mm0         \n\t"\
-        "paddw %%mm3, %%mm1         \n\t"\
-        "pmullw %%mm6, %%mm0        \n\t"\
-        "pmullw %%mm6, %%mm1        \n\t"\
-        "movq   -1(%0), %%mm2       \n\t"\
-        "movq    2(%0), %%mm4       \n\t"\
-        "movq %%mm2, %%mm3          \n\t"\
-        "movq %%mm4, %%mm5          \n\t"\
-        "punpcklbw %%mm7, %%mm2     \n\t"\
-        "punpckhbw %%mm7, %%mm3     \n\t"\
-        "punpcklbw %%mm7, %%mm4     \n\t"\
-        "punpckhbw %%mm7, %%mm5     \n\t"\
-        "paddw %%mm4, %%mm2         \n\t"\
-        "paddw %%mm3, %%mm5         \n\t"\
-        "psubw %%mm2, %%mm0         \n\t"\
-        "psubw %%mm5, %%mm1         \n\t"\
-        "movq %6, %%mm5             \n\t"\
-        "paddw %%mm5, %%mm0         \n\t"\
-        "paddw %%mm5, %%mm1         \n\t"\
-        "psraw $3, %%mm0            \n\t"\
-        "psraw $3, %%mm1            \n\t"\
-        "packuswb %%mm1, %%mm0      \n\t"\
-        OP(%%mm0, (%1),%%mm5, q)         \
-        "add %3, %0                 \n\t"\
-        "add %4, %1                 \n\t"\
-        "decl %2                    \n\t"\
-        " jnz 1b                    \n\t"\
-        : "+a"(src), "+c"(dst), "+m"(h)\
-        : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_4)\
-        : "memory"\
-    );\
-}\
-\
-static inline void OPNAME ## cavs_qpel8or16_v1_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
-  QPEL_CAVSVNUM(QPEL_CAVSV1,OP,ff_pw_64,ff_pw_96,ff_pw_42)      \
-}\
-\
-static inline void OPNAME ## cavs_qpel8or16_v2_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
-  QPEL_CAVSVNUM(QPEL_CAVSV2,OP,ff_pw_4,ff_pw_5,ff_pw_5)         \
-}\
-\
-static inline void OPNAME ## cavs_qpel8or16_v3_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
-  QPEL_CAVSVNUM(QPEL_CAVSV3,OP,ff_pw_64,ff_pw_96,ff_pw_42)      \
-}\
-\
-static void OPNAME ## cavs_qpel8_v1_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## cavs_qpel8or16_v1_ ## MMX(dst  , src  , dstStride, srcStride, 8);\
-}\
-static void OPNAME ## cavs_qpel16_v1_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## cavs_qpel8or16_v1_ ## MMX(dst  , src  , dstStride, srcStride, 16);\
-    OPNAME ## cavs_qpel8or16_v1_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
-}\
-\
-static void OPNAME ## cavs_qpel8_v2_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## cavs_qpel8or16_v2_ ## MMX(dst  , src  , dstStride, srcStride, 8);\
-}\
-static void OPNAME ## cavs_qpel16_v2_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## cavs_qpel8or16_v2_ ## MMX(dst  , src  , dstStride, srcStride, 16);\
-    OPNAME ## cavs_qpel8or16_v2_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
-}\
-\
-static void OPNAME ## cavs_qpel8_v3_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## cavs_qpel8or16_v3_ ## MMX(dst  , src  , dstStride, srcStride, 8);\
-}\
-static void OPNAME ## cavs_qpel16_v3_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## cavs_qpel8or16_v3_ ## MMX(dst  , src  , dstStride, srcStride, 16);\
-    OPNAME ## cavs_qpel8or16_v3_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
-}\
-\
-static void OPNAME ## cavs_qpel16_h_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    OPNAME ## cavs_qpel8_h_ ## MMX(dst  , src  , dstStride, srcStride);\
-    OPNAME ## cavs_qpel8_h_ ## MMX(dst+8, src+8, dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    OPNAME ## cavs_qpel8_h_ ## MMX(dst  , src  , dstStride, srcStride);\
-    OPNAME ## cavs_qpel8_h_ ## MMX(dst+8, src+8, dstStride, srcStride);\
-}\
-
-#define CAVS_MC(OPNAME, SIZE, MMX) \
-static void OPNAME ## cavs_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_qpel ## SIZE ## _h_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_qpel ## SIZE ## _v1_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_qpel ## SIZE ## _v2_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## cavs_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    OPNAME ## cavs_qpel ## SIZE ## _v3_ ## MMX(dst, src, stride, stride);\
-}\
-
-#define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b "    \n\t"
-#define AVG_3DNOW_OP(a,b,temp, size) \
-"mov" #size " " #b ", " #temp "   \n\t"\
-"pavgusb " #temp ", " #a "        \n\t"\
-"mov" #size " " #a ", " #b "      \n\t"
-#define AVG_MMXEXT_OP(a, b, temp, size) \
-"mov" #size " " #b ", " #temp "   \n\t"\
-"pavgb " #temp ", " #a "          \n\t"\
-"mov" #size " " #a ", " #b "      \n\t"
-
-#endif /* (HAVE_MMXEXT_INLINE || HAVE_AMD3DNOW_INLINE) */
-
-#if HAVE_MMX_INLINE
-static void put_cavs_qpel8_mc00_mmx(uint8_t *dst, uint8_t *src,
-                                    ptrdiff_t stride)
-{
-    ff_put_pixels8_mmx(dst, src, stride, 8);
-}
-
-static void avg_cavs_qpel8_mc00_mmx(uint8_t *dst, uint8_t *src,
-                                    ptrdiff_t stride)
-{
-    ff_avg_pixels8_mmx(dst, src, stride, 8);
-}
-
-static void put_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src,
-                                     ptrdiff_t stride)
-{
-    ff_put_pixels16_mmx(dst, src, stride, 16);
-}
-
-static void avg_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src,
-                                     ptrdiff_t stride)
-{
-    ff_avg_pixels16_mmx(dst, src, stride, 16);
-}
-
-static av_cold void cavsdsp_init_mmx(CAVSDSPContext *c,
-                                     AVCodecContext *avctx)
-{
-    c->put_cavs_qpel_pixels_tab[0][0] = put_cavs_qpel16_mc00_mmx;
-    c->put_cavs_qpel_pixels_tab[1][0] = put_cavs_qpel8_mc00_mmx;
-    c->avg_cavs_qpel_pixels_tab[0][0] = avg_cavs_qpel16_mc00_mmx;
-    c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmx;
-
-    c->cavs_idct8_add = cavs_idct8_add_mmx;
-    c->idct_perm      = FF_TRANSPOSE_IDCT_PERM;
-}
-#endif /* HAVE_MMX_INLINE */
-
-#define DSPFUNC(PFX, IDX, NUM, EXT)                                                       \
-    c->PFX ## _cavs_qpel_pixels_tab[IDX][ 2] = PFX ## _cavs_qpel ## NUM ## _mc20_ ## EXT; \
-    c->PFX ## _cavs_qpel_pixels_tab[IDX][ 4] = PFX ## _cavs_qpel ## NUM ## _mc01_ ## EXT; \
-    c->PFX ## _cavs_qpel_pixels_tab[IDX][ 8] = PFX ## _cavs_qpel ## NUM ## _mc02_ ## EXT; \
-    c->PFX ## _cavs_qpel_pixels_tab[IDX][12] = PFX ## _cavs_qpel ## NUM ## _mc03_ ## EXT; \
-
-#if HAVE_MMXEXT_INLINE
-QPEL_CAVS(put_,        PUT_OP, mmxext)
-QPEL_CAVS(avg_, AVG_MMXEXT_OP, mmxext)
-
-CAVS_MC(put_,  8, mmxext)
-CAVS_MC(put_, 16, mmxext)
-CAVS_MC(avg_,  8, mmxext)
-CAVS_MC(avg_, 16, mmxext)
-
-static av_cold void cavsdsp_init_mmxext(CAVSDSPContext *c,
-                                        AVCodecContext *avctx)
-{
-    DSPFUNC(put, 0, 16, mmxext);
-    DSPFUNC(put, 1,  8, mmxext);
-    DSPFUNC(avg, 0, 16, mmxext);
-    DSPFUNC(avg, 1,  8, mmxext);
-}
-#endif /* HAVE_MMXEXT_INLINE */
-
-#if HAVE_AMD3DNOW_INLINE
-QPEL_CAVS(put_,       PUT_OP, 3dnow)
-QPEL_CAVS(avg_, AVG_3DNOW_OP, 3dnow)
-
-CAVS_MC(put_, 8, 3dnow)
-CAVS_MC(put_, 16,3dnow)
-CAVS_MC(avg_, 8, 3dnow)
-CAVS_MC(avg_, 16,3dnow)
-
-static av_cold void cavsdsp_init_3dnow(CAVSDSPContext *c,
-                                       AVCodecContext *avctx)
-{
-    DSPFUNC(put, 0, 16, 3dnow);
-    DSPFUNC(put, 1,  8, 3dnow);
-    DSPFUNC(avg, 0, 16, 3dnow);
-    DSPFUNC(avg, 1,  8, 3dnow);
-}
-#endif /* HAVE_AMD3DNOW_INLINE */
-
-av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c, AVCodecContext *avctx)
-{
-#if HAVE_MMX_INLINE
-    int cpu_flags = av_get_cpu_flags();
-
-    if (INLINE_MMX(cpu_flags))
-        cavsdsp_init_mmx(c, avctx);
-#endif /* HAVE_MMX_INLINE */
-#if HAVE_AMD3DNOW_INLINE
-    if (INLINE_AMD3DNOW(cpu_flags))
-        cavsdsp_init_3dnow(c, avctx);
-#endif /* HAVE_AMD3DNOW_INLINE */
-#if HAVE_MMXEXT_INLINE
-    if (INLINE_MMXEXT(cpu_flags))
-        cavsdsp_init_mmxext(c, avctx);
-#endif /* HAVE_MMXEXT_INLINE */
-}
diff --git a/deps/libav/libavcodec/x86/constants.c b/deps/libav/libavcodec/x86/constants.c
deleted file mode 100644
index 5b8d1b2..0000000
--- a/deps/libav/libavcodec/x86/constants.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * MMX/SSE constants used across x86 dsp optimizations.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h" // for xmm_reg
-#include "constants.h"
-
-DECLARE_ALIGNED(8,  const uint64_t, ff_wtwo) = 0x0002000200020002ULL;
-
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_1)    = { 0x0001000100010001ULL, 0x0001000100010001ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_2)    = { 0x0002000200020002ULL, 0x0002000200020002ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_3)    = { 0x0003000300030003ULL, 0x0003000300030003ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_4)    = { 0x0004000400040004ULL, 0x0004000400040004ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_5)    = { 0x0005000500050005ULL, 0x0005000500050005ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_8)    = { 0x0008000800080008ULL, 0x0008000800080008ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_9)    = { 0x0009000900090009ULL, 0x0009000900090009ULL };
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_15)   =   0x000F000F000F000FULL;
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_16)   = { 0x0010001000100010ULL, 0x0010001000100010ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_17)   = { 0x0011001100110011ULL, 0x0011001100110011ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_18)   = { 0x0012001200120012ULL, 0x0012001200120012ULL };
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_20)   =   0x0014001400140014ULL;
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_32)   = { 0x0020002000200020ULL, 0x0020002000200020ULL };
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_42)   =   0x002A002A002A002AULL;
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_53)   =   0x0035003500350035ULL;
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_64)   = { 0x0040004000400040ULL, 0x0040004000400040ULL };
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_96)   =   0x0060006000600060ULL;
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_128)  =   0x0080008000800080ULL;
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_255)  =   0x00ff00ff00ff00ffULL;
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_512)  = { 0x0200020002000200ULL, 0x0200020002000200ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_1019) = { 0x03FB03FB03FB03FBULL, 0x03FB03FB03FB03FBULL };
-
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pb_0)    = { 0x0000000000000000ULL, 0x0000000000000000ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pb_1)    = { 0x0101010101010101ULL, 0x0101010101010101ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pb_3)    = { 0x0303030303030303ULL, 0x0303030303030303ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pb_80)   = { 0x8080808080808080ULL, 0x8080808080808080ULL };
-DECLARE_ALIGNED(8,  const uint64_t, ff_pb_FC)   =   0xFCFCFCFCFCFCFCFCULL;
diff --git a/deps/libav/libavcodec/x86/constants.h b/deps/libav/libavcodec/x86/constants.h
deleted file mode 100644
index f38fbe3..0000000
--- a/deps/libav/libavcodec/x86/constants.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * MMX/SSE constants used across x86 dsp optimizations.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_X86_CONSTANTS_H
-#define AVCODEC_X86_CONSTANTS_H
-
-#include <stdint.h>
-
-#include "libavutil/x86/asm.h"
-
-extern const uint64_t ff_wtwo;
-
-extern const xmm_reg  ff_pw_3;
-extern const xmm_reg  ff_pw_4;
-extern const xmm_reg  ff_pw_5;
-extern const xmm_reg  ff_pw_8;
-extern const uint64_t ff_pw_15;
-extern const xmm_reg  ff_pw_16;
-extern const xmm_reg  ff_pw_18;
-extern const uint64_t ff_pw_20;
-extern const xmm_reg  ff_pw_32;
-extern const uint64_t ff_pw_42;
-extern const uint64_t ff_pw_53;
-extern const xmm_reg  ff_pw_64;
-extern const uint64_t ff_pw_96;
-extern const uint64_t ff_pw_128;
-extern const uint64_t ff_pw_255;
-
-extern const xmm_reg  ff_pb_1;
-extern const xmm_reg  ff_pb_3;
-extern const xmm_reg  ff_pb_F8;
-extern const uint64_t ff_pb_FC;
-
-#endif /* AVCODEC_X86_CONSTANTS_H */
diff --git a/deps/libav/libavcodec/x86/dca.h b/deps/libav/libavcodec/x86/dca.h
deleted file mode 100644
index 11d45ae..0000000
--- a/deps/libav/libavcodec/x86/dca.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2012-2014 Christophe Gisquet <christophe.gisquet at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_X86_DCA_H
-#define AVCODEC_X86_DCA_H
-
-#include "config.h"
-
-#if ARCH_X86_64 && HAVE_SSE2_INLINE
-# include "libavutil/x86/asm.h"
-# include "libavutil/mem.h"
-#include "libavcodec/dcadsp.h"
-
-# define int8x8_fmul_int32 int8x8_fmul_int32
-static inline void int8x8_fmul_int32(av_unused DCADSPContext *dsp,
-                                     float *dst, const int8_t *src, int scale)
-{
-    DECLARE_ALIGNED(16, static const uint32_t, inverse16) = 0x3D800000;
-    __asm__ volatile (
-        "cvtsi2ss        %2, %%xmm0 \n\t"
-        "mulss           %3, %%xmm0 \n\t"
-        "movq          (%1), %%xmm1 \n\t"
-        "punpcklbw   %%xmm1, %%xmm1 \n\t"
-        "movaps      %%xmm1, %%xmm2 \n\t"
-        "punpcklwd   %%xmm1, %%xmm1 \n\t"
-        "punpckhwd   %%xmm2, %%xmm2 \n\t"
-        "psrad          $24, %%xmm1 \n\t"
-        "psrad          $24, %%xmm2 \n\t"
-        "shufps  $0, %%xmm0, %%xmm0 \n\t"
-        "cvtdq2ps    %%xmm1, %%xmm1 \n\t"
-        "cvtdq2ps    %%xmm2, %%xmm2 \n\t"
-        "mulps       %%xmm0, %%xmm1 \n\t"
-        "mulps       %%xmm0, %%xmm2 \n\t"
-        "movaps      %%xmm1,  0(%0) \n\t"
-        "movaps      %%xmm2, 16(%0) \n\t"
-        :: "r"(dst), "r"(src), "m"(scale), "m"(inverse16)
-        XMM_CLOBBERS_ONLY("xmm0", "xmm1", "xmm2")
-    );
-}
-
-#endif /* ARCH_X86_64 && HAVE_SSE2_INLINE */
-
-#endif /* AVCODEC_X86_DCA_H */
diff --git a/deps/libav/libavcodec/x86/dcadsp.asm b/deps/libav/libavcodec/x86/dcadsp.asm
deleted file mode 100644
index 214f514..0000000
--- a/deps/libav/libavcodec/x86/dcadsp.asm
+++ /dev/null
@@ -1,90 +0,0 @@
-;******************************************************************************
-;* SSE-optimized functions for the DCA decoder
-;* Copyright (C) 2012-2014 Christophe Gisquet <christophe.gisquet at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-pf_inv16:  times 4 dd 0x3D800000 ; 1/16
-
-SECTION_TEXT
-
-; void int8x8_fmul_int32_sse2(float *dst, const int8_t *src, int scale)
-%macro INT8X8_FMUL_INT32 0
-cglobal int8x8_fmul_int32, 3,3,5, dst, src, scale
-    cvtsi2ss    m0, scalem
-    mulss       m0, [pf_inv16]
-    shufps      m0, m0, 0
-%if cpuflag(sse2)
-%if cpuflag(sse4)
-    pmovsxbd    m1, [srcq+0]
-    pmovsxbd    m2, [srcq+4]
-%else
-    movq        m1, [srcq]
-    punpcklbw   m1, m1
-    mova        m2, m1
-    punpcklwd   m1, m1
-    punpckhwd   m2, m2
-    psrad       m1, 24
-    psrad       m2, 24
-%endif
-    cvtdq2ps    m1, m1
-    cvtdq2ps    m2, m2
-%else
-    movd       mm0, [srcq+0]
-    movd       mm1, [srcq+4]
-    punpcklbw  mm0, mm0
-    punpcklbw  mm1, mm1
-    movq       mm2, mm0
-    movq       mm3, mm1
-    punpcklwd  mm0, mm0
-    punpcklwd  mm1, mm1
-    punpckhwd  mm2, mm2
-    punpckhwd  mm3, mm3
-    psrad      mm0, 24
-    psrad      mm1, 24
-    psrad      mm2, 24
-    psrad      mm3, 24
-    cvtpi2ps    m1, mm0
-    cvtpi2ps    m2, mm1
-    cvtpi2ps    m3, mm2
-    cvtpi2ps    m4, mm3
-    shufps      m0, m0, 0
-    emms
-    shufps      m1, m3, q1010
-    shufps      m2, m4, q1010
-%endif
-    mulps       m1, m0
-    mulps       m2, m0
-    mova [dstq+ 0], m1
-    mova [dstq+16], m2
-    REP_RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_XMM sse
-INT8X8_FMUL_INT32
-%endif
-
-INIT_XMM sse2
-INT8X8_FMUL_INT32
-
-INIT_XMM sse4
-INT8X8_FMUL_INT32
diff --git a/deps/libav/libavcodec/x86/dcadsp_init.c b/deps/libav/libavcodec/x86/dcadsp_init.c
deleted file mode 100644
index 976d8a3..0000000
--- a/deps/libav/libavcodec/x86/dcadsp_init.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2012-2014 Christophe Gisquet <christophe.gisquet at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/dcadsp.h"
-
-void ff_int8x8_fmul_int32_sse(float *dst, const int8_t *src, int scale);
-void ff_int8x8_fmul_int32_sse2(float *dst, const int8_t *src, int scale);
-void ff_int8x8_fmul_int32_sse4(float *dst, const int8_t *src, int scale);
-
-av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_SSE(cpu_flags)) {
-#if ARCH_X86_32
-        s->int8x8_fmul_int32 = ff_int8x8_fmul_int32_sse;
-#endif
-    }
-
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        s->int8x8_fmul_int32 = ff_int8x8_fmul_int32_sse2;
-    }
-
-    if (EXTERNAL_SSE4(cpu_flags)) {
-        s->int8x8_fmul_int32 = ff_int8x8_fmul_int32_sse4;
-    }
-}
diff --git a/deps/libav/libavcodec/x86/dct32.asm b/deps/libav/libavcodec/x86/dct32.asm
deleted file mode 100644
index 9c147b9..0000000
--- a/deps/libav/libavcodec/x86/dct32.asm
+++ /dev/null
@@ -1,488 +0,0 @@
-;******************************************************************************
-;* 32 point SSE-optimized DCT transform
-;* Copyright (c) 2010 Vitor Sessak
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA 32
-
-align 32
-ps_cos_vec: dd   0.500603,  0.505471,  0.515447,  0.531043
-            dd   0.553104,  0.582935,  0.622504,  0.674808
-            dd -10.190008, -3.407609, -2.057781, -1.484165
-            dd  -1.169440, -0.972568, -0.839350, -0.744536
-            dd   0.502419,  0.522499,  0.566944,  0.646822
-            dd   0.788155,  1.060678,  1.722447,  5.101149
-            dd   0.509796,  0.601345,  0.899976,  2.562916
-            dd   0.509796,  0.601345,  0.899976,  2.562916
-            dd   1.000000,  1.000000,  1.306563,  0.541196
-            dd   1.000000,  1.000000,  1.306563,  0.541196
-            dd   1.000000,  0.707107,  1.000000, -0.707107
-            dd   1.000000,  0.707107,  1.000000, -0.707107
-            dd   0.707107,  0.707107,  0.707107,  0.707107
-
-align 32
-ps_p1p1m1m1: dd 0, 0, 0x80000000, 0x80000000, 0, 0, 0x80000000, 0x80000000
-
-%macro BUTTERFLY 4
-    subps  %4, %1, %2
-    addps  %2, %2, %1
-    mulps  %1, %4, %3
-%endmacro
-
-%macro BUTTERFLY0 5
-%if cpuflag(sse2) && notcpuflag(avx)
-    pshufd %4, %1, %5
-    xorps  %1, %2
-    addps  %1, %4
-    mulps  %1, %3
-%else
-    shufps %4, %1, %1, %5
-    xorps  %1, %1, %2
-    addps  %4, %4, %1
-    mulps  %1, %4, %3
-%endif
-%endmacro
-
-%macro BUTTERFLY2 4
-    BUTTERFLY0 %1, %2, %3, %4, 0x1b
-%endmacro
-
-%macro BUTTERFLY3 4
-    BUTTERFLY0 %1, %2, %3, %4, 0xb1
-%endmacro
-
-%macro BUTTERFLY3V 5
-    movaps m%5, m%1
-    addps  m%1, m%2
-    subps  m%5, m%2
-    SWAP %2, %5
-    mulps  m%2, [ps_cos_vec+192]
-    movaps m%5, m%3
-    addps  m%3, m%4
-    subps  m%4, m%5
-    mulps  m%4, [ps_cos_vec+192]
-%endmacro
-
-%macro PASS6_AND_PERMUTE 0
-    mov         tmpd, [outq+4]
-    movss         m7, [outq+72]
-    addss         m7, [outq+76]
-    movss         m3, [outq+56]
-    addss         m3, [outq+60]
-    addss         m4, m3
-    movss         m2, [outq+52]
-    addss         m2, m3
-    movss         m3, [outq+104]
-    addss         m3, [outq+108]
-    addss         m1, m3
-    addss         m5, m4
-    movss [outq+ 16], m1
-    movss         m1, [outq+100]
-    addss         m1, m3
-    movss         m3, [outq+40]
-    movss [outq+ 48], m1
-    addss         m3, [outq+44]
-    movss         m1, [outq+100]
-    addss         m4, m3
-    addss         m3, m2
-    addss         m1, [outq+108]
-    movss [outq+ 40], m3
-    addss         m2, [outq+36]
-    movss         m3, [outq+8]
-    movss [outq+ 56], m2
-    addss         m3, [outq+12]
-    movss [outq+ 32], m3
-    movss         m3, [outq+80]
-    movss [outq+  8], m5
-    movss [outq+ 80], m1
-    movss         m2, [outq+52]
-    movss         m5, [outq+120]
-    addss         m5, [outq+124]
-    movss         m1, [outq+64]
-    addss         m2, [outq+60]
-    addss         m0, m5
-    addss         m5, [outq+116]
-    mov    [outq+64], tmpd
-    addss         m6, m0
-    addss         m1, m6
-    mov         tmpd, [outq+12]
-    mov   [outq+ 96], tmpd
-    movss [outq+  4], m1
-    movss         m1, [outq+24]
-    movss [outq+ 24], m4
-    movss         m4, [outq+88]
-    addss         m4, [outq+92]
-    addss         m3, m4
-    addss         m4, [outq+84]
-    mov         tmpd, [outq+108]
-    addss         m1, [outq+28]
-    addss         m0, m1
-    addss         m1, m5
-    addss         m6, m3
-    addss         m3, m0
-    addss         m0, m7
-    addss         m5, [outq+20]
-    addss         m7, m1
-    movss [outq+ 12], m6
-    mov   [outq+112], tmpd
-    movss         m6, [outq+28]
-    movss [outq+ 28], m0
-    movss         m0, [outq+36]
-    movss [outq+ 36], m7
-    addss         m1, m4
-    movss         m7, [outq+116]
-    addss         m0, m2
-    addss         m7, [outq+124]
-    movss [outq+ 72], m0
-    movss         m0, [outq+44]
-    addss         m2, m0
-    movss [outq+ 44], m1
-    movss [outq+ 88], m2
-    addss         m0, [outq+60]
-    mov         tmpd, [outq+60]
-    mov   [outq+120], tmpd
-    movss [outq+104], m0
-    addss         m4, m5
-    addss         m5, [outq+68]
-    movss  [outq+52], m4
-    movss  [outq+60], m5
-    movss         m4, [outq+68]
-    movss         m5, [outq+20]
-    movss [outq+ 20], m3
-    addss         m5, m7
-    addss         m7, m6
-    addss         m4, m5
-    movss         m2, [outq+84]
-    addss         m2, [outq+92]
-    addss         m5, m2
-    movss [outq+ 68], m4
-    addss         m2, m7
-    movss         m4, [outq+76]
-    movss [outq+ 84], m2
-    movss [outq+ 76], m5
-    addss         m7, m4
-    addss         m6, [outq+124]
-    addss         m4, m6
-    addss         m6, [outq+92]
-    movss [outq+100], m4
-    movss [outq+108], m6
-    movss         m6, [outq+92]
-    movss  [outq+92], m7
-    addss         m6, [outq+124]
-    movss [outq+116], m6
-%endmacro
-
-INIT_YMM avx
-SECTION_TEXT
-; void ff_dct32_float_avx(FFTSample *out, const FFTSample *in)
-cglobal dct32_float, 2,3,8, out, in, tmp
-    ; pass 1
-    vmovaps     m4, [inq+0]
-    vinsertf128 m5, m5, [inq+96], 1
-    vinsertf128 m5, m5, [inq+112], 0
-    vshufps     m5, m5, m5, 0x1b
-    BUTTERFLY   m4, m5, [ps_cos_vec], m6
-
-    vmovaps     m2, [inq+64]
-    vinsertf128 m6, m6, [inq+32], 1
-    vinsertf128 m6, m6, [inq+48], 0
-    vshufps     m6, m6, m6, 0x1b
-    BUTTERFLY   m2, m6, [ps_cos_vec+32], m0
-
-    ; pass 2
-
-    BUTTERFLY  m5, m6, [ps_cos_vec+64], m0
-    BUTTERFLY  m4, m2, [ps_cos_vec+64], m7
-
-
-    ; pass 3
-    vperm2f128  m3, m6, m4, 0x31
-    vperm2f128  m1, m6, m4, 0x20
-    vshufps     m3, m3, m3, 0x1b
-
-    BUTTERFLY   m1, m3, [ps_cos_vec+96], m6
-
-
-    vperm2f128  m4, m5, m2, 0x20
-    vperm2f128  m5, m5, m2, 0x31
-    vshufps     m5, m5, m5, 0x1b
-
-    BUTTERFLY   m4, m5, [ps_cos_vec+96], m6
-
-    ; pass 4
-    vmovaps m6, [ps_p1p1m1m1+0]
-    vmovaps m2, [ps_cos_vec+128]
-
-    BUTTERFLY2  m5, m6, m2, m7
-    BUTTERFLY2  m4, m6, m2, m7
-    BUTTERFLY2  m1, m6, m2, m7
-    BUTTERFLY2  m3, m6, m2, m7
-
-
-    ; pass 5
-    vshufps m6, m6, m6, 0xcc
-    vmovaps m2, [ps_cos_vec+160]
-
-    BUTTERFLY3  m5, m6, m2, m7
-    BUTTERFLY3  m4, m6, m2, m7
-    BUTTERFLY3  m1, m6, m2, m7
-    BUTTERFLY3  m3, m6, m2, m7
-
-    vperm2f128  m6, m3, m3, 0x31
-    vmovaps [outq], m3
-
-    vextractf128  [outq+64], m5, 1
-    vextractf128  [outq+32], m5, 0
-
-    vextractf128  [outq+80], m4, 1
-    vextractf128  [outq+48], m4, 0
-
-    vperm2f128  m0, m1, m1, 0x31
-    vmovaps [outq+96], m1
-
-    vzeroupper
-
-    ;    pass 6, no SIMD...
-INIT_XMM
-    PASS6_AND_PERMUTE
-    RET
-
-%if ARCH_X86_64
-%define SPILL SWAP
-%define UNSPILL SWAP
-
-%macro PASS5 0
-    nop ; FIXME code alignment
-    SWAP 5, 8
-    SWAP 4, 12
-    SWAP 6, 14
-    SWAP 7, 13
-    SWAP 0, 15
-    PERMUTE 9,10, 10,12, 11,14, 12,9, 13,11, 14,13
-    TRANSPOSE4x4PS 8, 9, 10, 11, 0
-    BUTTERFLY3V    8, 9, 10, 11, 0
-    addps   m10, m11
-    TRANSPOSE4x4PS 12, 13, 14, 15, 0
-    BUTTERFLY3V    12, 13, 14, 15, 0
-    addps   m14, m15
-    addps   m12, m14
-    addps   m14, m13
-    addps   m13, m15
-%endmacro
-
-%macro PASS6 0
-    SWAP 9, 12
-    SWAP 11, 14
-    movss [outq+0x00], m8
-    pshuflw m0, m8, 0xe
-    movss [outq+0x10], m9
-    pshuflw m1, m9, 0xe
-    movss [outq+0x20], m10
-    pshuflw m2, m10, 0xe
-    movss [outq+0x30], m11
-    pshuflw m3, m11, 0xe
-    movss [outq+0x40], m12
-    pshuflw m4, m12, 0xe
-    movss [outq+0x50], m13
-    pshuflw m5, m13, 0xe
-    movss [outq+0x60], m14
-    pshuflw m6, m14, 0xe
-    movaps [outq+0x70], m15
-    pshuflw m7, m15, 0xe
-    addss   m0, m1
-    addss   m1, m2
-    movss [outq+0x08], m0
-    addss   m2, m3
-    movss [outq+0x18], m1
-    addss   m3, m4
-    movss [outq+0x28], m2
-    addss   m4, m5
-    movss [outq+0x38], m3
-    addss   m5, m6
-    movss [outq+0x48], m4
-    addss   m6, m7
-    movss [outq+0x58], m5
-    movss [outq+0x68], m6
-    movss [outq+0x78], m7
-
-    PERMUTE 1,8, 3,9, 5,10, 7,11, 9,12, 11,13, 13,14, 8,1, 10,3, 12,5, 14,7
-    movhlps m0, m1
-    pshufd  m1, m1, 3
-    SWAP 0, 2, 4, 6, 8, 10, 12, 14
-    SWAP 1, 3, 5, 7, 9, 11, 13, 15
-%rep 7
-    movhlps m0, m1
-    pshufd  m1, m1, 3
-    addss   m15, m1
-    SWAP 0, 2, 4, 6, 8, 10, 12, 14
-    SWAP 1, 3, 5, 7, 9, 11, 13, 15
-%endrep
-%assign i 4
-%rep 15
-    addss m0, m1
-    movss [outq+i], m0
-    SWAP 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
-    %assign i i+8
-%endrep
-%endmacro
-
-%else ; ARCH_X86_32
-%macro SPILL 2 ; xmm#, mempos
-    movaps [outq+(%2-8)*16], m%1
-%endmacro
-%macro UNSPILL 2
-    movaps m%1, [outq+(%2-8)*16]
-%endmacro
-
-%define PASS6 PASS6_AND_PERMUTE
-%macro PASS5 0
-    movaps      m2, [ps_cos_vec+160]
-    shufps      m3, m3, 0xcc
-
-    BUTTERFLY3  m5, m3, m2, m1
-    SPILL 5, 8
-
-    UNSPILL 1, 9
-    BUTTERFLY3  m1, m3, m2, m5
-    SPILL 1, 14
-
-    BUTTERFLY3  m4, m3, m2, m5
-    SPILL 4, 12
-
-    BUTTERFLY3  m7, m3, m2, m5
-    SPILL 7, 13
-
-    UNSPILL 5, 10
-    BUTTERFLY3  m5, m3, m2, m7
-    SPILL 5, 10
-
-    UNSPILL 4, 11
-    BUTTERFLY3  m4, m3, m2, m7
-    SPILL 4, 11
-
-    BUTTERFLY3  m6, m3, m2, m7
-    SPILL 6, 9
-
-    BUTTERFLY3  m0, m3, m2, m7
-    SPILL 0, 15
-%endmacro
-%endif
-
-
-; void ff_dct32_float_sse(FFTSample *out, const FFTSample *in)
-%macro DCT32_FUNC 0
-cglobal dct32_float, 2, 3, 16, out, in, tmp
-    ; pass 1
-
-    movaps      m0, [inq+0]
-    LOAD_INV    m1, [inq+112]
-    BUTTERFLY   m0, m1, [ps_cos_vec], m3
-
-    movaps      m7, [inq+64]
-    LOAD_INV    m4, [inq+48]
-    BUTTERFLY   m7, m4, [ps_cos_vec+32], m3
-
-    ; pass 2
-    movaps      m2, [ps_cos_vec+64]
-    BUTTERFLY   m1, m4, m2, m3
-    SPILL 1, 11
-    SPILL 4, 8
-
-    ; pass 1
-    movaps      m1, [inq+16]
-    LOAD_INV    m6, [inq+96]
-    BUTTERFLY   m1, m6, [ps_cos_vec+16], m3
-
-    movaps      m4, [inq+80]
-    LOAD_INV    m5, [inq+32]
-    BUTTERFLY   m4, m5, [ps_cos_vec+48], m3
-
-    ; pass 2
-    BUTTERFLY   m0, m7, m2, m3
-
-    movaps      m2, [ps_cos_vec+80]
-    BUTTERFLY   m6, m5, m2, m3
-
-    BUTTERFLY   m1, m4, m2, m3
-
-    ; pass 3
-    movaps      m2, [ps_cos_vec+96]
-    shufps      m1, m1, 0x1b
-    BUTTERFLY   m0, m1, m2, m3
-    SPILL 0, 15
-    SPILL 1, 14
-
-    UNSPILL 0, 8
-    shufps      m5, m5, 0x1b
-    BUTTERFLY   m0, m5, m2, m3
-
-    UNSPILL 1, 11
-    shufps      m6, m6, 0x1b
-    BUTTERFLY   m1, m6, m2, m3
-    SPILL 1, 11
-
-    shufps      m4, m4, 0x1b
-    BUTTERFLY   m7, m4, m2, m3
-
-    ; pass 4
-    movaps      m3, [ps_p1p1m1m1+0]
-    movaps      m2, [ps_cos_vec+128]
-
-    BUTTERFLY2  m5, m3, m2, m1
-
-    BUTTERFLY2  m0, m3, m2, m1
-    SPILL 0, 9
-
-    BUTTERFLY2  m6, m3, m2, m1
-    SPILL 6, 10
-
-    UNSPILL 0, 11
-    BUTTERFLY2  m0, m3, m2, m1
-    SPILL 0, 11
-
-    BUTTERFLY2  m4, m3, m2, m1
-
-    BUTTERFLY2  m7, m3, m2, m1
-
-    UNSPILL 6, 14
-    BUTTERFLY2  m6, m3, m2, m1
-
-    UNSPILL 0, 15
-    BUTTERFLY2  m0, m3, m2, m1
-
-    PASS5
-    PASS6
-    RET
-%endmacro
-
-%macro LOAD_INV 2
-%if cpuflag(sse2)
-    pshufd      %1, %2, 0x1b
-%elif cpuflag(sse)
-    movaps      %1, %2
-    shufps      %1, %1, 0x1b
-%endif
-%endmacro
-
-INIT_XMM sse
-DCT32_FUNC
-INIT_XMM sse2
-DCT32_FUNC
diff --git a/deps/libav/libavcodec/x86/dct_init.c b/deps/libav/libavcodec/x86/dct_init.c
deleted file mode 100644
index 7bda5e8..0000000
--- a/deps/libav/libavcodec/x86/dct_init.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/dct.h"
-
-void ff_dct32_float_sse(FFTSample *out, const FFTSample *in);
-void ff_dct32_float_sse2(FFTSample *out, const FFTSample *in);
-void ff_dct32_float_avx(FFTSample *out, const FFTSample *in);
-
-av_cold void ff_dct_init_x86(DCTContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_SSE(cpu_flags))
-        s->dct32 = ff_dct32_float_sse;
-    if (EXTERNAL_SSE2(cpu_flags))
-        s->dct32 = ff_dct32_float_sse2;
-    if (EXTERNAL_AVX(cpu_flags))
-        s->dct32 = ff_dct32_float_avx;
-}
diff --git a/deps/libav/libavcodec/x86/deinterlace.asm b/deps/libav/libavcodec/x86/deinterlace.asm
deleted file mode 100644
index b2828f3..0000000
--- a/deps/libav/libavcodec/x86/deinterlace.asm
+++ /dev/null
@@ -1,82 +0,0 @@
-;******************************************************************************
-;* MMX optimized deinterlacing functions
-;* Copyright (c) 2010 Vitor Sessak
-;* Copyright (c) 2002 Michael Niedermayer
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-cextern pw_4
-
-SECTION .text
-
-%macro DEINTERLACE 1
-%ifidn %1, inplace
-;void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum,  int size)
-cglobal deinterlace_line_inplace_mmx, 6,6,7,      lum_m4, lum_m3, lum_m2, lum_m1, lum, size
-%else
-;void ff_deinterlace_line_mmx(uint8_t *dst, const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum,  int size)
-cglobal deinterlace_line_mmx,         7,7,7, dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size
-%endif
-    pxor  mm7, mm7
-    movq  mm6, [pw_4]
-.nextrow:
-    movd  mm0, [lum_m4q]
-    movd  mm1, [lum_m3q]
-    movd  mm2, [lum_m2q]
-%ifidn %1, inplace
-    movd [lum_m4q], mm2
-%endif
-    movd  mm3, [lum_m1q]
-    movd  mm4, [lumq]
-    punpcklbw mm0, mm7
-    punpcklbw mm1, mm7
-    punpcklbw mm2, mm7
-    punpcklbw mm3, mm7
-    punpcklbw mm4, mm7
-    paddw     mm1, mm3
-    psllw     mm2, 1
-    paddw     mm0, mm4
-    psllw     mm1, 2
-    paddw     mm2, mm6
-    paddw     mm1, mm2
-    psubusw   mm1, mm0
-    psrlw     mm1, 3
-    packuswb  mm1, mm7
-%ifidn %1, inplace
-    movd [lum_m2q], mm1
-%else
-    movd   [dstq], mm1
-    add       dstq, 4
-%endif
-    add    lum_m4q, 4
-    add    lum_m3q, 4
-    add    lum_m2q, 4
-    add    lum_m1q, 4
-    add       lumq, 4
-    sub      sized, 4
-    jg .nextrow
-    REP_RET
-%endmacro
-
-DEINTERLACE ""
-
-DEINTERLACE inplace
diff --git a/deps/libav/libavcodec/x86/dnxhdenc.c b/deps/libav/libavcodec/x86/dnxhdenc.c
deleted file mode 100644
index 0bab69f..0000000
--- a/deps/libav/libavcodec/x86/dnxhdenc.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * VC3/DNxHD SIMD functions
- * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- *
- * VC-3 encoder funded by the British Broadcasting Corporation
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/dnxhdenc.h"
-
-#if HAVE_SSE2_INLINE
-
-static void get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels, int line_size)
-{
-    __asm__ volatile(
-        "pxor %%xmm5,      %%xmm5       \n\t"
-        "movq (%0),        %%xmm0       \n\t"
-        "add  %2,          %0           \n\t"
-        "movq (%0),        %%xmm1       \n\t"
-        "movq (%0, %2),    %%xmm2       \n\t"
-        "movq (%0, %2,2),  %%xmm3       \n\t"
-        "punpcklbw %%xmm5, %%xmm0       \n\t"
-        "punpcklbw %%xmm5, %%xmm1       \n\t"
-        "punpcklbw %%xmm5, %%xmm2       \n\t"
-        "punpcklbw %%xmm5, %%xmm3       \n\t"
-        "movdqa %%xmm0,      (%1)       \n\t"
-        "movdqa %%xmm1,    16(%1)       \n\t"
-        "movdqa %%xmm2,    32(%1)       \n\t"
-        "movdqa %%xmm3,    48(%1)       \n\t"
-        "movdqa %%xmm3 ,   64(%1)       \n\t"
-        "movdqa %%xmm2 ,   80(%1)       \n\t"
-        "movdqa %%xmm1 ,   96(%1)       \n\t"
-        "movdqa %%xmm0,   112(%1)       \n\t"
-        : "+r" (pixels)
-        : "r" (block), "r" ((x86_reg)line_size)
-    );
-}
-
-#endif /* HAVE_SSE2_INLINE */
-
-av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
-{
-#if HAVE_SSE2_INLINE
-    if (INLINE_SSE2(av_get_cpu_flags())) {
-        if (ctx->cid_table->bit_depth == 8)
-            ctx->get_pixels_8x4_sym = get_pixels_8x4_sym_sse2;
-    }
-#endif /* HAVE_SSE2_INLINE */
-}
diff --git a/deps/libav/libavcodec/x86/dsputil.asm b/deps/libav/libavcodec/x86/dsputil.asm
deleted file mode 100644
index 5d73ff8..0000000
--- a/deps/libav/libavcodec/x86/dsputil.asm
+++ /dev/null
@@ -1,650 +0,0 @@
-;******************************************************************************
-;* MMX optimized DSP utils
-;* Copyright (c) 2008 Loren Merritt
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-pb_f: times 16 db 15
-pb_zzzzzzzz77777777: times 8 db -1
-pb_7: times 8 db 7
-pb_zzzz3333zzzzbbbb: db -1,-1,-1,-1,3,3,3,3,-1,-1,-1,-1,11,11,11,11
-pb_zz11zz55zz99zzdd: db -1,-1,1,1,-1,-1,5,5,-1,-1,9,9,-1,-1,13,13
-pb_revwords: SHUFFLE_MASK_W 7, 6, 5, 4, 3, 2, 1, 0
-pd_16384: times 4 dd 16384
-pb_bswap32: db 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
-
-SECTION_TEXT
-
-%macro SCALARPRODUCT 0
-; int scalarproduct_int16(int16_t *v1, int16_t *v2, int order)
-cglobal scalarproduct_int16, 3,3,3, v1, v2, order
-    shl orderq, 1
-    add v1q, orderq
-    add v2q, orderq
-    neg orderq
-    pxor    m2, m2
-.loop:
-    movu    m0, [v1q + orderq]
-    movu    m1, [v1q + orderq + mmsize]
-    pmaddwd m0, [v2q + orderq]
-    pmaddwd m1, [v2q + orderq + mmsize]
-    paddd   m2, m0
-    paddd   m2, m1
-    add     orderq, mmsize*2
-    jl .loop
-%if mmsize == 16
-    movhlps m0, m2
-    paddd   m2, m0
-    pshuflw m0, m2, 0x4e
-%else
-    pshufw  m0, m2, 0x4e
-%endif
-    paddd   m2, m0
-    movd   eax, m2
-    RET
-
-; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
-cglobal scalarproduct_and_madd_int16, 4,4,8, v1, v2, v3, order, mul
-    shl orderq, 1
-    movd    m7, mulm
-%if mmsize == 16
-    pshuflw m7, m7, 0
-    punpcklqdq m7, m7
-%else
-    pshufw  m7, m7, 0
-%endif
-    pxor    m6, m6
-    add v1q, orderq
-    add v2q, orderq
-    add v3q, orderq
-    neg orderq
-.loop:
-    movu    m0, [v2q + orderq]
-    movu    m1, [v2q + orderq + mmsize]
-    mova    m4, [v1q + orderq]
-    mova    m5, [v1q + orderq + mmsize]
-    movu    m2, [v3q + orderq]
-    movu    m3, [v3q + orderq + mmsize]
-    pmaddwd m0, m4
-    pmaddwd m1, m5
-    pmullw  m2, m7
-    pmullw  m3, m7
-    paddd   m6, m0
-    paddd   m6, m1
-    paddw   m2, m4
-    paddw   m3, m5
-    mova    [v1q + orderq], m2
-    mova    [v1q + orderq + mmsize], m3
-    add     orderq, mmsize*2
-    jl .loop
-%if mmsize == 16
-    movhlps m0, m6
-    paddd   m6, m0
-    pshuflw m0, m6, 0x4e
-%else
-    pshufw  m0, m6, 0x4e
-%endif
-    paddd   m6, m0
-    movd   eax, m6
-    RET
-%endmacro
-
-INIT_MMX mmxext
-SCALARPRODUCT
-INIT_XMM sse2
-SCALARPRODUCT
-
-%macro SCALARPRODUCT_LOOP 1
-align 16
-.loop%1:
-    sub     orderq, mmsize*2
-%if %1
-    mova    m1, m4
-    mova    m4, [v2q + orderq]
-    mova    m0, [v2q + orderq + mmsize]
-    palignr m1, m0, %1
-    palignr m0, m4, %1
-    mova    m3, m5
-    mova    m5, [v3q + orderq]
-    mova    m2, [v3q + orderq + mmsize]
-    palignr m3, m2, %1
-    palignr m2, m5, %1
-%else
-    mova    m0, [v2q + orderq]
-    mova    m1, [v2q + orderq + mmsize]
-    mova    m2, [v3q + orderq]
-    mova    m3, [v3q + orderq + mmsize]
-%endif
-    %define t0  [v1q + orderq]
-    %define t1  [v1q + orderq + mmsize]
-%if ARCH_X86_64
-    mova    m8, t0
-    mova    m9, t1
-    %define t0  m8
-    %define t1  m9
-%endif
-    pmaddwd m0, t0
-    pmaddwd m1, t1
-    pmullw  m2, m7
-    pmullw  m3, m7
-    paddw   m2, t0
-    paddw   m3, t1
-    paddd   m6, m0
-    paddd   m6, m1
-    mova    [v1q + orderq], m2
-    mova    [v1q + orderq + mmsize], m3
-    jg .loop%1
-%if %1
-    jmp .end
-%endif
-%endmacro
-
-; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
-INIT_XMM ssse3
-cglobal scalarproduct_and_madd_int16, 4,5,10, v1, v2, v3, order, mul
-    shl orderq, 1
-    movd    m7, mulm
-    pshuflw m7, m7, 0
-    punpcklqdq m7, m7
-    pxor    m6, m6
-    mov    r4d, v2d
-    and    r4d, 15
-    and    v2q, ~15
-    and    v3q, ~15
-    mova    m4, [v2q + orderq]
-    mova    m5, [v3q + orderq]
-    ; linear is faster than branch tree or jump table, because the branches taken are cyclic (i.e. predictable)
-    cmp    r4d, 0
-    je .loop0
-    cmp    r4d, 2
-    je .loop2
-    cmp    r4d, 4
-    je .loop4
-    cmp    r4d, 6
-    je .loop6
-    cmp    r4d, 8
-    je .loop8
-    cmp    r4d, 10
-    je .loop10
-    cmp    r4d, 12
-    je .loop12
-SCALARPRODUCT_LOOP 14
-SCALARPRODUCT_LOOP 12
-SCALARPRODUCT_LOOP 10
-SCALARPRODUCT_LOOP 8
-SCALARPRODUCT_LOOP 6
-SCALARPRODUCT_LOOP 4
-SCALARPRODUCT_LOOP 2
-SCALARPRODUCT_LOOP 0
-.end:
-    movhlps m0, m6
-    paddd   m6, m0
-    pshuflw m0, m6, 0x4e
-    paddd   m6, m0
-    movd   eax, m6
-    RET
-
-
-;-----------------------------------------------------------------------------
-; void ff_apply_window_int16(int16_t *output, const int16_t *input,
-;                            const int16_t *window, unsigned int len)
-;-----------------------------------------------------------------------------
-
-%macro REVERSE_WORDS 1-2
-%if cpuflag(ssse3) && notcpuflag(atom)
-    pshufb  %1, %2
-%elif cpuflag(sse2)
-    pshuflw  %1, %1, 0x1B
-    pshufhw  %1, %1, 0x1B
-    pshufd   %1, %1, 0x4E
-%elif cpuflag(mmxext)
-    pshufw   %1, %1, 0x1B
-%endif
-%endmacro
-
-%macro MUL16FIXED 3
-%if cpuflag(ssse3) ; dst, src, unused
-; dst = ((dst * src) + (1<<14)) >> 15
-    pmulhrsw   %1, %2
-%elif cpuflag(mmxext) ; dst, src, temp
-; dst = (dst * src) >> 15
-; pmulhw cuts off the bottom bit, so we have to lshift by 1 and add it back
-; in from the pmullw result.
-    mova    %3, %1
-    pmulhw  %1, %2
-    pmullw  %3, %2
-    psrlw   %3, 15
-    psllw   %1, 1
-    por     %1, %3
-%endif
-%endmacro
-
-%macro APPLY_WINDOW_INT16 1 ; %1 bitexact version
-%if %1
-cglobal apply_window_int16, 4,5,6, output, input, window, offset, offset2
-%else
-cglobal apply_window_int16_round, 4,5,6, output, input, window, offset, offset2
-%endif
-    lea     offset2q, [offsetq-mmsize]
-%if cpuflag(ssse3) && notcpuflag(atom)
-    mova          m5, [pb_revwords]
-    ALIGN 16
-%elif %1
-    mova          m5, [pd_16384]
-%endif
-.loop:
-%if cpuflag(ssse3)
-    ; This version does the 16x16->16 multiplication in-place without expanding
-    ; to 32-bit. The ssse3 version is bit-identical.
-    mova          m0, [windowq+offset2q]
-    mova          m1, [ inputq+offset2q]
-    pmulhrsw      m1, m0
-    REVERSE_WORDS m0, m5
-    pmulhrsw      m0, [ inputq+offsetq ]
-    mova  [outputq+offset2q], m1
-    mova  [outputq+offsetq ], m0
-%elif %1
-    ; This version expands 16-bit to 32-bit, multiplies by the window,
-    ; adds 16384 for rounding, right shifts 15, then repacks back to words to
-    ; save to the output. The window is reversed for the second half.
-    mova          m3, [windowq+offset2q]
-    mova          m4, [ inputq+offset2q]
-    pxor          m0, m0
-    punpcklwd     m0, m3
-    punpcklwd     m1, m4
-    pmaddwd       m0, m1
-    paddd         m0, m5
-    psrad         m0, 15
-    pxor          m2, m2
-    punpckhwd     m2, m3
-    punpckhwd     m1, m4
-    pmaddwd       m2, m1
-    paddd         m2, m5
-    psrad         m2, 15
-    packssdw      m0, m2
-    mova  [outputq+offset2q], m0
-    REVERSE_WORDS m3
-    mova          m4, [ inputq+offsetq]
-    pxor          m0, m0
-    punpcklwd     m0, m3
-    punpcklwd     m1, m4
-    pmaddwd       m0, m1
-    paddd         m0, m5
-    psrad         m0, 15
-    pxor          m2, m2
-    punpckhwd     m2, m3
-    punpckhwd     m1, m4
-    pmaddwd       m2, m1
-    paddd         m2, m5
-    psrad         m2, 15
-    packssdw      m0, m2
-    mova  [outputq+offsetq], m0
-%else
-    ; This version does the 16x16->16 multiplication in-place without expanding
-    ; to 32-bit. The mmxext and sse2 versions do not use rounding, and
-    ; therefore are not bit-identical to the C version.
-    mova          m0, [windowq+offset2q]
-    mova          m1, [ inputq+offset2q]
-    mova          m2, [ inputq+offsetq ]
-    MUL16FIXED    m1, m0, m3
-    REVERSE_WORDS m0
-    MUL16FIXED    m2, m0, m3
-    mova  [outputq+offset2q], m1
-    mova  [outputq+offsetq ], m2
-%endif
-    add      offsetd, mmsize
-    sub     offset2d, mmsize
-    jae .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-APPLY_WINDOW_INT16 0
-INIT_XMM sse2
-APPLY_WINDOW_INT16 0
-
-INIT_MMX mmxext
-APPLY_WINDOW_INT16 1
-INIT_XMM sse2
-APPLY_WINDOW_INT16 1
-INIT_XMM ssse3
-APPLY_WINDOW_INT16 1
-INIT_XMM ssse3, atom
-APPLY_WINDOW_INT16 1
-
-
-; void add_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top)
-INIT_MMX mmxext
-cglobal add_hfyu_median_prediction, 6,6,0, dst, top, diff, w, left, left_top
-    movq    mm0, [topq]
-    movq    mm2, mm0
-    movd    mm4, [left_topq]
-    psllq   mm2, 8
-    movq    mm1, mm0
-    por     mm4, mm2
-    movd    mm3, [leftq]
-    psubb   mm0, mm4 ; t-tl
-    add    dstq, wq
-    add    topq, wq
-    add   diffq, wq
-    neg      wq
-    jmp .skip
-.loop:
-    movq    mm4, [topq+wq]
-    movq    mm0, mm4
-    psllq   mm4, 8
-    por     mm4, mm1
-    movq    mm1, mm0 ; t
-    psubb   mm0, mm4 ; t-tl
-.skip:
-    movq    mm2, [diffq+wq]
-%assign i 0
-%rep 8
-    movq    mm4, mm0
-    paddb   mm4, mm3 ; t-tl+l
-    movq    mm5, mm3
-    pmaxub  mm3, mm1
-    pminub  mm5, mm1
-    pminub  mm3, mm4
-    pmaxub  mm3, mm5 ; median
-    paddb   mm3, mm2 ; +residual
-%if i==0
-    movq    mm7, mm3
-    psllq   mm7, 56
-%else
-    movq    mm6, mm3
-    psrlq   mm7, 8
-    psllq   mm6, 56
-    por     mm7, mm6
-%endif
-%if i<7
-    psrlq   mm0, 8
-    psrlq   mm1, 8
-    psrlq   mm2, 8
-%endif
-%assign i i+1
-%endrep
-    movq [dstq+wq], mm7
-    add      wq, 8
-    jl .loop
-    movzx   r2d, byte [dstq-1]
-    mov [leftq], r2d
-    movzx   r2d, byte [topq-1]
-    mov [left_topq], r2d
-    RET
-
-
-%macro ADD_HFYU_LEFT_LOOP 2 ; %1 = dst_is_aligned, %2 = src_is_aligned
-    add     srcq, wq
-    add     dstq, wq
-    neg     wq
-%%.loop:
-%if %2
-    mova    m1, [srcq+wq]
-%else
-    movu    m1, [srcq+wq]
-%endif
-    mova    m2, m1
-    psllw   m1, 8
-    paddb   m1, m2
-    mova    m2, m1
-    pshufb  m1, m3
-    paddb   m1, m2
-    pshufb  m0, m5
-    mova    m2, m1
-    pshufb  m1, m4
-    paddb   m1, m2
-%if mmsize == 16
-    mova    m2, m1
-    pshufb  m1, m6
-    paddb   m1, m2
-%endif
-    paddb   m0, m1
-%if %1
-    mova    [dstq+wq], m0
-%else
-    movq    [dstq+wq], m0
-    movhps  [dstq+wq+8], m0
-%endif
-    add     wq, mmsize
-    jl %%.loop
-    mov     eax, mmsize-1
-    sub     eax, wd
-    movd    m1, eax
-    pshufb  m0, m1
-    movd    eax, m0
-    RET
-%endmacro
-
-; int add_hfyu_left_prediction(uint8_t *dst, const uint8_t *src, int w, int left)
-INIT_MMX ssse3
-cglobal add_hfyu_left_prediction, 3,3,7, dst, src, w, left
-.skip_prologue:
-    mova    m5, [pb_7]
-    mova    m4, [pb_zzzz3333zzzzbbbb]
-    mova    m3, [pb_zz11zz55zz99zzdd]
-    movd    m0, leftm
-    psllq   m0, 56
-    ADD_HFYU_LEFT_LOOP 1, 1
-
-INIT_XMM sse4
-cglobal add_hfyu_left_prediction, 3,3,7, dst, src, w, left
-    mova    m5, [pb_f]
-    mova    m6, [pb_zzzzzzzz77777777]
-    mova    m4, [pb_zzzz3333zzzzbbbb]
-    mova    m3, [pb_zz11zz55zz99zzdd]
-    movd    m0, leftm
-    pslldq  m0, 15
-    test    srcq, 15
-    jnz .src_unaligned
-    test    dstq, 15
-    jnz .dst_unaligned
-    ADD_HFYU_LEFT_LOOP 1, 1
-.dst_unaligned:
-    ADD_HFYU_LEFT_LOOP 0, 1
-.src_unaligned:
-    ADD_HFYU_LEFT_LOOP 0, 0
-
-;-----------------------------------------------------------------------------
-; void ff_vector_clip_int32(int32_t *dst, const int32_t *src, int32_t min,
-;                           int32_t max, unsigned int len)
-;-----------------------------------------------------------------------------
-
-; %1 = number of xmm registers used
-; %2 = number of inline load/process/store loops per asm loop
-; %3 = process 4*mmsize (%3=0) or 8*mmsize (%3=1) bytes per loop
-; %4 = CLIPD function takes min/max as float instead of int (CLIPD_SSE2)
-; %5 = suffix
-%macro VECTOR_CLIP_INT32 4-5
-cglobal vector_clip_int32%5, 5,5,%1, dst, src, min, max, len
-%if %4
-    cvtsi2ss  m4, minm
-    cvtsi2ss  m5, maxm
-%else
-    movd      m4, minm
-    movd      m5, maxm
-%endif
-    SPLATD    m4
-    SPLATD    m5
-.loop:
-%assign %%i 1
-%rep %2
-    mova      m0,  [srcq+mmsize*0*%%i]
-    mova      m1,  [srcq+mmsize*1*%%i]
-    mova      m2,  [srcq+mmsize*2*%%i]
-    mova      m3,  [srcq+mmsize*3*%%i]
-%if %3
-    mova      m7,  [srcq+mmsize*4*%%i]
-    mova      m8,  [srcq+mmsize*5*%%i]
-    mova      m9,  [srcq+mmsize*6*%%i]
-    mova      m10, [srcq+mmsize*7*%%i]
-%endif
-    CLIPD  m0,  m4, m5, m6
-    CLIPD  m1,  m4, m5, m6
-    CLIPD  m2,  m4, m5, m6
-    CLIPD  m3,  m4, m5, m6
-%if %3
-    CLIPD  m7,  m4, m5, m6
-    CLIPD  m8,  m4, m5, m6
-    CLIPD  m9,  m4, m5, m6
-    CLIPD  m10, m4, m5, m6
-%endif
-    mova  [dstq+mmsize*0*%%i], m0
-    mova  [dstq+mmsize*1*%%i], m1
-    mova  [dstq+mmsize*2*%%i], m2
-    mova  [dstq+mmsize*3*%%i], m3
-%if %3
-    mova  [dstq+mmsize*4*%%i], m7
-    mova  [dstq+mmsize*5*%%i], m8
-    mova  [dstq+mmsize*6*%%i], m9
-    mova  [dstq+mmsize*7*%%i], m10
-%endif
-%assign %%i %%i+1
-%endrep
-    add     srcq, mmsize*4*(%2+%3)
-    add     dstq, mmsize*4*(%2+%3)
-    sub     lend, mmsize*(%2+%3)
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-%define CLIPD CLIPD_MMX
-VECTOR_CLIP_INT32 0, 1, 0, 0
-INIT_XMM sse2
-VECTOR_CLIP_INT32 6, 1, 0, 0, _int
-%define CLIPD CLIPD_SSE2
-VECTOR_CLIP_INT32 6, 2, 0, 1
-INIT_XMM sse4
-%define CLIPD CLIPD_SSE41
-%ifdef m8
-VECTOR_CLIP_INT32 11, 1, 1, 0
-%else
-VECTOR_CLIP_INT32 6, 1, 0, 0
-%endif
-
-; %1 = aligned/unaligned
-%macro BSWAP_LOOPS  1
-    mov      r3, r2
-    sar      r2, 3
-    jz       .left4_%1
-.loop8_%1:
-    mov%1    m0, [r1 +  0]
-    mov%1    m1, [r1 + 16]
-%if cpuflag(ssse3)
-    pshufb   m0, m2
-    pshufb   m1, m2
-    mov%1    [r0 +  0], m0
-    mov%1    [r0 + 16], m1
-%else
-    pshuflw  m0, m0, 10110001b
-    pshuflw  m1, m1, 10110001b
-    pshufhw  m0, m0, 10110001b
-    pshufhw  m1, m1, 10110001b
-    mova     m2, m0
-    mova     m3, m1
-    psllw    m0, 8
-    psllw    m1, 8
-    psrlw    m2, 8
-    psrlw    m3, 8
-    por      m2, m0
-    por      m3, m1
-    mov%1    [r0 +  0], m2
-    mov%1    [r0 + 16], m3
-%endif
-    add      r0, 32
-    add      r1, 32
-    dec      r2
-    jnz      .loop8_%1
-.left4_%1:
-    mov      r2, r3
-    and      r3, 4
-    jz       .left
-    mov%1    m0, [r1]
-%if cpuflag(ssse3)
-    pshufb   m0, m2
-    mov%1    [r0], m0
-%else
-    pshuflw  m0, m0, 10110001b
-    pshufhw  m0, m0, 10110001b
-    mova     m2, m0
-    psllw    m0, 8
-    psrlw    m2, 8
-    por      m2, m0
-    mov%1    [r0], m2
-%endif
-    add      r1, 16
-    add      r0, 16
-%endmacro
-
-; void bswap_buf(uint32_t *dst, const uint32_t *src, int w);
-%macro BSWAP32_BUF 0
-%if cpuflag(ssse3)
-cglobal bswap32_buf, 3,4,3
-    mov      r3, r1
-    mova     m2, [pb_bswap32]
-%else
-cglobal bswap32_buf, 3,4,5
-    mov      r3, r1
-%endif
-    and      r3, 15
-    jz       .start_align
-    BSWAP_LOOPS  u
-    jmp      .left
-.start_align:
-    BSWAP_LOOPS  a
-.left:
-%if cpuflag(ssse3)
-    mov      r3, r2
-    and      r2, 2
-    jz       .left1
-    movq     m0, [r1]
-    pshufb   m0, m2
-    movq     [r0], m0
-    add      r1, 8
-    add      r0, 8
-.left1:
-    and      r3, 1
-    jz       .end
-    mov      r2d, [r1]
-    bswap    r2d
-    mov      [r0], r2d
-%else
-    and      r2, 3
-    jz       .end
-.loop2:
-    mov      r3d, [r1]
-    bswap    r3d
-    mov      [r0], r3d
-    add      r1, 4
-    add      r0, 4
-    dec      r2
-    jnz      .loop2
-%endif
-.end:
-    RET
-%endmacro
-
-INIT_XMM sse2
-BSWAP32_BUF
-
-INIT_XMM ssse3
-BSWAP32_BUF
diff --git a/deps/libav/libavcodec/x86/dsputil_init.c b/deps/libav/libavcodec/x86/dsputil_init.c
deleted file mode 100644
index 82864e8..0000000
--- a/deps/libav/libavcodec/x86/dsputil_init.c
+++ /dev/null
@@ -1,690 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/internal.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/dsputil.h"
-#include "libavcodec/simple_idct.h"
-#include "libavcodec/version.h"
-#include "dsputil_x86.h"
-#include "idct_xvid.h"
-
-void ff_put_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                              int dstStride, int src1Stride, int h);
-void ff_put_no_rnd_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1,
-                                     uint8_t *src2, int dstStride,
-                                     int src1Stride, int h);
-void ff_avg_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                              int dstStride, int src1Stride, int h);
-void ff_put_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                               int dstStride, int src1Stride, int h);
-void ff_avg_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                               int dstStride, int src1Stride, int h);
-void ff_put_no_rnd_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                                      int dstStride, int src1Stride, int h);
-void ff_put_mpeg4_qpel16_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                         int dstStride, int srcStride, int h);
-void ff_avg_mpeg4_qpel16_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                         int dstStride, int srcStride, int h);
-void ff_put_no_rnd_mpeg4_qpel16_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                                 int dstStride, int srcStride,
-                                                 int h);
-void ff_put_mpeg4_qpel8_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                        int dstStride, int srcStride, int h);
-void ff_avg_mpeg4_qpel8_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                        int dstStride, int srcStride, int h);
-void ff_put_no_rnd_mpeg4_qpel8_h_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                                int dstStride, int srcStride,
-                                                int h);
-void ff_put_mpeg4_qpel16_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                         int dstStride, int srcStride);
-void ff_avg_mpeg4_qpel16_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                         int dstStride, int srcStride);
-void ff_put_no_rnd_mpeg4_qpel16_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                                 int dstStride, int srcStride);
-void ff_put_mpeg4_qpel8_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                        int dstStride, int srcStride);
-void ff_avg_mpeg4_qpel8_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                        int dstStride, int srcStride);
-void ff_put_no_rnd_mpeg4_qpel8_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
-                                                int dstStride, int srcStride);
-#define ff_put_no_rnd_pixels16_mmxext ff_put_pixels16_mmxext
-#define ff_put_no_rnd_pixels8_mmxext ff_put_pixels8_mmxext
-
-int32_t ff_scalarproduct_int16_mmxext(const int16_t *v1, const int16_t *v2,
-                                      int order);
-int32_t ff_scalarproduct_int16_sse2(const int16_t *v1, const int16_t *v2,
-                                    int order);
-int32_t ff_scalarproduct_and_madd_int16_mmxext(int16_t *v1, const int16_t *v2,
-                                               const int16_t *v3,
-                                               int order, int mul);
-int32_t ff_scalarproduct_and_madd_int16_sse2(int16_t *v1, const int16_t *v2,
-                                             const int16_t *v3,
-                                             int order, int mul);
-int32_t ff_scalarproduct_and_madd_int16_ssse3(int16_t *v1, const int16_t *v2,
-                                              const int16_t *v3,
-                                              int order, int mul);
-
-void ff_bswap32_buf_ssse3(uint32_t *dst, const uint32_t *src, int w);
-void ff_bswap32_buf_sse2(uint32_t *dst, const uint32_t *src, int w);
-
-void ff_add_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *top,
-                                          const uint8_t *diff, int w,
-                                          int *left, int *left_top);
-int  ff_add_hfyu_left_prediction_ssse3(uint8_t *dst, const uint8_t *src,
-                                       int w, int left);
-int  ff_add_hfyu_left_prediction_sse4(uint8_t *dst, const uint8_t *src,
-                                      int w, int left);
-
-void ff_vector_clip_int32_mmx     (int32_t *dst, const int32_t *src,
-                                   int32_t min, int32_t max, unsigned int len);
-void ff_vector_clip_int32_sse2    (int32_t *dst, const int32_t *src,
-                                   int32_t min, int32_t max, unsigned int len);
-void ff_vector_clip_int32_int_sse2(int32_t *dst, const int32_t *src,
-                                   int32_t min, int32_t max, unsigned int len);
-void ff_vector_clip_int32_sse4    (int32_t *dst, const int32_t *src,
-                                   int32_t min, int32_t max, unsigned int len);
-
-#if HAVE_YASM
-
-PIXELS16(static, ff_avg, , , _mmxext)
-PIXELS16(static, ff_put, , , _mmxext)
-
-#define QPEL_OP(OPNAME, RND, MMX)                                       \
-static void OPNAME ## qpel8_mc00_ ## MMX (uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    ff_ ## OPNAME ## pixels8_ ## MMX(dst, src, stride, 8);              \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc10_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t temp[8];                                                   \
-    uint8_t * const half = (uint8_t*)temp;                              \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8,        \
-                                                   stride, 8);          \
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, src, half,                 \
-                                        stride, stride, 8);             \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc20_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    ff_ ## OPNAME ## mpeg4_qpel8_h_lowpass_ ## MMX(dst, src, stride,    \
-                                                   stride, 8);          \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc30_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t temp[8];                                                   \
-    uint8_t * const half = (uint8_t*)temp;                              \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8,        \
-                                                   stride, 8);          \
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, src + 1, half, stride,     \
-                                        stride, 8);                     \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc01_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t temp[8];                                                   \
-    uint8_t * const half = (uint8_t*)temp;                              \
-    ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src,           \
-                                                   8, stride);          \
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, src, half,                 \
-                                        stride, stride, 8);             \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc02_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    ff_ ## OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, src,            \
-                                                   stride, stride);     \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc03_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t temp[8];                                                   \
-    uint8_t * const half = (uint8_t*)temp;                              \
-    ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src,           \
-                                                   8, stride);          \
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, src + stride, half, stride,\
-                                        stride, 8);                     \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc11_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t half[8 + 9];                                               \
-    uint8_t * const halfH  = ((uint8_t*)half) + 64;                     \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8,       \
-                                                   stride, 9);          \
-    ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8,           \
-                                        stride, 9);                     \
-    ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV,             \
-                                        stride, 8, 8);                  \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc31_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t half[8 + 9];                                               \
-    uint8_t * const halfH  = ((uint8_t*)half) + 64;                     \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8,       \
-                                                   stride, 9);          \
-    ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src + 1, halfH, 8,       \
-                                        stride, 9);                     \
-    ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV,             \
-                                        stride, 8, 8);                  \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc13_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t half[8 + 9];                                               \
-    uint8_t * const halfH  = ((uint8_t*)half) + 64;                     \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8,       \
-                                                   stride, 9);          \
-    ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8,           \
-                                        stride, 9);                     \
-    ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, halfH + 8, halfHV,         \
-                                        stride, 8, 8);                  \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc33_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t half[8 + 9];                                               \
-    uint8_t * const halfH  = ((uint8_t*)half) + 64;                     \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8,       \
-                                                   stride, 9);          \
-    ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src + 1, halfH, 8,       \
-                                        stride, 9);                     \
-    ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, halfH + 8, halfHV,         \
-                                        stride, 8, 8);                  \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc21_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t half[8 + 9];                                               \
-    uint8_t * const halfH  = ((uint8_t*)half) + 64;                     \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8,       \
-                                                   stride, 9);          \
-    ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV,             \
-                                        stride, 8, 8);                  \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc23_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t half[8 + 9];                                               \
-    uint8_t * const halfH  = ((uint8_t*)half) + 64;                     \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8,       \
-                                                   stride, 9);          \
-    ff_put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
-    ff_ ## OPNAME ## pixels8_l2_ ## MMX(dst, halfH + 8, halfHV,         \
-                                        stride, 8, 8);                  \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc12_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t half[8 + 9];                                               \
-    uint8_t * const halfH = ((uint8_t*)half);                           \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8,       \
-                                                   stride, 9);          \
-    ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH,              \
-                                        8, stride, 9);                  \
-    ff_ ## OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH,          \
-                                                   stride, 8);          \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc32_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t half[8 + 9];                                               \
-    uint8_t * const halfH = ((uint8_t*)half);                           \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8,       \
-                                                   stride, 9);          \
-    ff_put ## RND ## pixels8_l2_ ## MMX(halfH, src + 1, halfH, 8,       \
-                                        stride, 9);                     \
-    ff_ ## OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH,          \
-                                                   stride, 8);          \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel8_mc22_ ## MMX(uint8_t *dst, uint8_t *src,    \
-                                         ptrdiff_t stride)              \
-{                                                                       \
-    uint64_t half[9];                                                   \
-    uint8_t * const halfH = ((uint8_t*)half);                           \
-    ff_put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8,       \
-                                                   stride, 9);          \
-    ff_ ## OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH,          \
-                                                   stride, 8);          \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc00_ ## MMX (uint8_t *dst, uint8_t *src,  \
-                                           ptrdiff_t stride)            \
-{                                                                       \
-    ff_ ## OPNAME ## pixels16_ ## MMX(dst, src, stride, 16);            \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc10_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t temp[32];                                                  \
-    uint8_t * const half = (uint8_t*)temp;                              \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16,      \
-                                                    stride, 16);        \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride,        \
-                                         stride, 16);                   \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc20_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    ff_ ## OPNAME ## mpeg4_qpel16_h_lowpass_ ## MMX(dst, src,           \
-                                                    stride, stride, 16);\
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc30_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t temp[32];                                                  \
-    uint8_t * const half = (uint8_t*)temp;                              \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16,      \
-                                                    stride, 16);        \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, src + 1, half,            \
-                                         stride, stride, 16);           \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc01_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t temp[32];                                                  \
-    uint8_t * const half = (uint8_t*)temp;                              \
-    ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16,      \
-                                                    stride);            \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride,        \
-                                         stride, 16);                   \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc02_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    ff_ ## OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, src,           \
-                                                    stride, stride);    \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc03_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t temp[32];                                                  \
-    uint8_t * const half = (uint8_t*)temp;                              \
-    ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16,      \
-                                                    stride);            \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, src+stride, half,         \
-                                         stride, stride, 16);           \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc11_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t half[16 * 2 + 17 * 2];                                     \
-    uint8_t * const halfH  = ((uint8_t*)half) + 256;                    \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16,     \
-                                                    stride, 17);        \
-    ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16,         \
-                                         stride, 17);                   \
-    ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH,      \
-                                                    16, 16);            \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV,            \
-                                         stride, 16, 16);               \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc31_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t half[16 * 2 + 17 * 2];                                     \
-    uint8_t * const halfH  = ((uint8_t*)half) + 256;                    \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16,     \
-                                                    stride, 17);        \
-    ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src + 1, halfH, 16,     \
-                                         stride, 17);                   \
-    ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH,      \
-                                                    16, 16);            \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV,            \
-                                         stride, 16, 16);               \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc13_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t half[16 * 2 + 17 * 2];                                     \
-    uint8_t * const halfH  = ((uint8_t*)half) + 256;                    \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16,     \
-                                                    stride, 17);        \
-    ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16,         \
-                                         stride, 17);                   \
-    ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH,      \
-                                                    16, 16);            \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, halfH + 16, halfHV,       \
-                                         stride, 16, 16);               \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc33_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t half[16 * 2 + 17 * 2];                                     \
-    uint8_t * const halfH  = ((uint8_t*)half) + 256;                    \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16,     \
-                                                    stride, 17);        \
-    ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src + 1, halfH, 16,     \
-                                         stride, 17);                   \
-    ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH,      \
-                                                    16, 16);            \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, halfH + 16, halfHV,       \
-                                         stride, 16, 16);               \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc21_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t half[16 * 2 + 17 * 2];                                     \
-    uint8_t * const halfH  = ((uint8_t*)half) + 256;                    \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16,     \
-                                                    stride, 17);        \
-    ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH,      \
-                                                    16, 16);            \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV,            \
-                                         stride, 16, 16);               \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc23_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t half[16 * 2 + 17 * 2];                                     \
-    uint8_t * const halfH  = ((uint8_t*)half) + 256;                    \
-    uint8_t * const halfHV = ((uint8_t*)half);                          \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16,     \
-                                                    stride, 17);        \
-    ff_put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH,      \
-                                                    16, 16);            \
-    ff_ ## OPNAME ## pixels16_l2_ ## MMX(dst, halfH + 16, halfHV,       \
-                                         stride, 16, 16);               \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc12_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t half[17 * 2];                                              \
-    uint8_t * const halfH = ((uint8_t*)half);                           \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16,     \
-                                                    stride, 17);        \
-    ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16,         \
-                                         stride, 17);                   \
-    ff_ ## OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH,         \
-                                                    stride, 16);        \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc32_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t half[17 * 2];                                              \
-    uint8_t * const halfH = ((uint8_t*)half);                           \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16,     \
-                                                    stride, 17);        \
-    ff_put ## RND ## pixels16_l2_ ## MMX(halfH, src + 1, halfH, 16,     \
-                                         stride, 17);                   \
-    ff_ ## OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH,         \
-                                                    stride, 16);        \
-}                                                                       \
-                                                                        \
-static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src,   \
-                                          ptrdiff_t stride)             \
-{                                                                       \
-    uint64_t half[17 * 2];                                              \
-    uint8_t * const halfH = ((uint8_t*)half);                           \
-    ff_put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16,     \
-                                                    stride, 17);        \
-    ff_ ## OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH,         \
-                                                    stride, 16);        \
-}
-
-QPEL_OP(put_,        _,        mmxext)
-QPEL_OP(avg_,        _,        mmxext)
-QPEL_OP(put_no_rnd_, _no_rnd_, mmxext)
-#endif /* HAVE_YASM */
-
-#define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU, PREFIX)                          \
-    do {                                                                     \
-    c->PFX ## _pixels_tab[IDX][ 0] = PREFIX ## PFX ## SIZE ## _mc00_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 1] = PREFIX ## PFX ## SIZE ## _mc10_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 2] = PREFIX ## PFX ## SIZE ## _mc20_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 3] = PREFIX ## PFX ## SIZE ## _mc30_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 4] = PREFIX ## PFX ## SIZE ## _mc01_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 5] = PREFIX ## PFX ## SIZE ## _mc11_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 6] = PREFIX ## PFX ## SIZE ## _mc21_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 7] = PREFIX ## PFX ## SIZE ## _mc31_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 8] = PREFIX ## PFX ## SIZE ## _mc02_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 9] = PREFIX ## PFX ## SIZE ## _mc12_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][10] = PREFIX ## PFX ## SIZE ## _mc22_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][11] = PREFIX ## PFX ## SIZE ## _mc32_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][12] = PREFIX ## PFX ## SIZE ## _mc03_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][13] = PREFIX ## PFX ## SIZE ## _mc13_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][14] = PREFIX ## PFX ## SIZE ## _mc23_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][15] = PREFIX ## PFX ## SIZE ## _mc33_ ## CPU; \
-    } while (0)
-
-static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
-                                     int cpu_flags)
-{
-#if HAVE_MMX_INLINE
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    c->put_pixels_clamped        = ff_put_pixels_clamped_mmx;
-    c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmx;
-    c->add_pixels_clamped        = ff_add_pixels_clamped_mmx;
-
-    if (!high_bit_depth) {
-        c->clear_block  = ff_clear_block_mmx;
-        c->clear_blocks = ff_clear_blocks_mmx;
-        c->draw_edges   = ff_draw_edges_mmx;
-
-        switch (avctx->idct_algo) {
-        case FF_IDCT_AUTO:
-        case FF_IDCT_SIMPLEMMX:
-            c->idct_put              = ff_simple_idct_put_mmx;
-            c->idct_add              = ff_simple_idct_add_mmx;
-            c->idct                  = ff_simple_idct_mmx;
-            c->idct_permutation_type = FF_SIMPLE_IDCT_PERM;
-            break;
-        case FF_IDCT_XVIDMMX:
-            c->idct_put              = ff_idct_xvid_mmx_put;
-            c->idct_add              = ff_idct_xvid_mmx_add;
-            c->idct                  = ff_idct_xvid_mmx;
-            break;
-        }
-    }
-
-    c->gmc = ff_gmc_mmx;
-
-    c->add_bytes = ff_add_bytes_mmx;
-#endif /* HAVE_MMX_INLINE */
-
-#if HAVE_MMX_EXTERNAL
-    c->vector_clip_int32 = ff_vector_clip_int32_mmx;
-#endif /* HAVE_MMX_EXTERNAL */
-}
-
-static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
-                                        int cpu_flags)
-{
-#if HAVE_MMXEXT_INLINE
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
-        c->idct_put = ff_idct_xvid_mmxext_put;
-        c->idct_add = ff_idct_xvid_mmxext_add;
-        c->idct     = ff_idct_xvid_mmxext;
-    }
-#endif /* HAVE_MMXEXT_INLINE */
-
-#if HAVE_MMXEXT_EXTERNAL
-    SET_QPEL_FUNCS(avg_qpel,        0, 16, mmxext, );
-    SET_QPEL_FUNCS(avg_qpel,        1,  8, mmxext, );
-
-    SET_QPEL_FUNCS(put_qpel,        0, 16, mmxext, );
-    SET_QPEL_FUNCS(put_qpel,        1,  8, mmxext, );
-    SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmxext, );
-    SET_QPEL_FUNCS(put_no_rnd_qpel, 1,  8, mmxext, );
-
-    /* slower than cmov version on AMD */
-    if (!(cpu_flags & AV_CPU_FLAG_3DNOW))
-        c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_mmxext;
-
-    c->scalarproduct_int16          = ff_scalarproduct_int16_mmxext;
-    c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_mmxext;
-#endif /* HAVE_MMXEXT_EXTERNAL */
-}
-
-static av_cold void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx,
-                                     int cpu_flags)
-{
-#if HAVE_SSE_INLINE
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    c->vector_clipf = ff_vector_clipf_sse;
-
-#if FF_API_XVMC
-FF_DISABLE_DEPRECATION_WARNINGS
-    /* XvMCCreateBlocks() may not allocate 16-byte aligned blocks */
-    if (CONFIG_MPEG_XVMC_DECODER && avctx->xvmc_acceleration > 1)
-        return;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_XVMC */
-
-    if (!high_bit_depth) {
-        c->clear_block  = ff_clear_block_sse;
-        c->clear_blocks = ff_clear_blocks_sse;
-    }
-#endif /* HAVE_SSE_INLINE */
-}
-
-static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
-                                      int cpu_flags)
-{
-#if HAVE_SSE2_INLINE
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
-        c->idct_put              = ff_idct_xvid_sse2_put;
-        c->idct_add              = ff_idct_xvid_sse2_add;
-        c->idct                  = ff_idct_xvid_sse2;
-        c->idct_permutation_type = FF_SSE2_IDCT_PERM;
-    }
-#endif /* HAVE_SSE2_INLINE */
-
-#if HAVE_SSE2_EXTERNAL
-    c->scalarproduct_int16          = ff_scalarproduct_int16_sse2;
-    c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_sse2;
-    if (cpu_flags & AV_CPU_FLAG_ATOM) {
-        c->vector_clip_int32 = ff_vector_clip_int32_int_sse2;
-    } else {
-        c->vector_clip_int32 = ff_vector_clip_int32_sse2;
-    }
-    c->bswap_buf = ff_bswap32_buf_sse2;
-#endif /* HAVE_SSE2_EXTERNAL */
-}
-
-static av_cold void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx,
-                                       int cpu_flags)
-{
-#if HAVE_SSSE3_EXTERNAL
-    c->add_hfyu_left_prediction = ff_add_hfyu_left_prediction_ssse3;
-    if (cpu_flags & AV_CPU_FLAG_SSE4) // not really SSE4, just slow on Conroe
-        c->add_hfyu_left_prediction = ff_add_hfyu_left_prediction_sse4;
-
-    if (!(cpu_flags & (AV_CPU_FLAG_SSE42 | AV_CPU_FLAG_3DNOW))) // cachesplit
-        c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_ssse3;
-    c->bswap_buf = ff_bswap32_buf_ssse3;
-#endif /* HAVE_SSSE3_EXTERNAL */
-}
-
-static av_cold void dsputil_init_sse4(DSPContext *c, AVCodecContext *avctx,
-                                      int cpu_flags)
-{
-#if HAVE_SSE4_EXTERNAL
-    c->vector_clip_int32 = ff_vector_clip_int32_sse4;
-#endif /* HAVE_SSE4_EXTERNAL */
-}
-
-av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-#if HAVE_7REGS && HAVE_INLINE_ASM
-    if (cpu_flags & AV_CPU_FLAG_CMOV)
-        c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_cmov;
-#endif
-
-    if (X86_MMX(cpu_flags))
-        dsputil_init_mmx(c, avctx, cpu_flags);
-
-    if (X86_MMXEXT(cpu_flags))
-        dsputil_init_mmxext(c, avctx, cpu_flags);
-
-    if (X86_SSE(cpu_flags))
-        dsputil_init_sse(c, avctx, cpu_flags);
-
-    if (X86_SSE2(cpu_flags))
-        dsputil_init_sse2(c, avctx, cpu_flags);
-
-    if (EXTERNAL_SSSE3(cpu_flags))
-        dsputil_init_ssse3(c, avctx, cpu_flags);
-
-    if (EXTERNAL_SSE4(cpu_flags))
-        dsputil_init_sse4(c, avctx, cpu_flags);
-
-    if (CONFIG_ENCODERS)
-        ff_dsputilenc_init_mmx(c, avctx);
-}
diff --git a/deps/libav/libavcodec/x86/dsputil_mmx.c b/deps/libav/libavcodec/x86/dsputil_mmx.c
deleted file mode 100644
index 885c10a..0000000
--- a/deps/libav/libavcodec/x86/dsputil_mmx.c
+++ /dev/null
@@ -1,498 +0,0 @@
-/*
- * MMX optimized DSP utils
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * MMX optimization by Nick Kurshev <nickols_k at mail.ru>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "constants.h"
-#include "dsputil_x86.h"
-
-#if HAVE_INLINE_ASM
-
-void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size)
-{
-    const int16_t *p;
-    uint8_t *pix;
-
-    /* read the pixels */
-    p   = block;
-    pix = pixels;
-    /* unrolled loop */
-    __asm__ volatile (
-        "movq      (%3), %%mm0          \n\t"
-        "movq     8(%3), %%mm1          \n\t"
-        "movq    16(%3), %%mm2          \n\t"
-        "movq    24(%3), %%mm3          \n\t"
-        "movq    32(%3), %%mm4          \n\t"
-        "movq    40(%3), %%mm5          \n\t"
-        "movq    48(%3), %%mm6          \n\t"
-        "movq    56(%3), %%mm7          \n\t"
-        "packuswb %%mm1, %%mm0          \n\t"
-        "packuswb %%mm3, %%mm2          \n\t"
-        "packuswb %%mm5, %%mm4          \n\t"
-        "packuswb %%mm7, %%mm6          \n\t"
-        "movq     %%mm0, (%0)           \n\t"
-        "movq     %%mm2, (%0, %1)       \n\t"
-        "movq     %%mm4, (%0, %1, 2)    \n\t"
-        "movq     %%mm6, (%0, %2)       \n\t"
-        :: "r"(pix), "r"((x86_reg)line_size), "r"((x86_reg)line_size * 3),
-           "r"(p)
-        : "memory");
-    pix += line_size * 4;
-    p   += 32;
-
-    // if here would be an exact copy of the code above
-    // compiler would generate some very strange code
-    // thus using "r"
-    __asm__ volatile (
-        "movq       (%3), %%mm0         \n\t"
-        "movq      8(%3), %%mm1         \n\t"
-        "movq     16(%3), %%mm2         \n\t"
-        "movq     24(%3), %%mm3         \n\t"
-        "movq     32(%3), %%mm4         \n\t"
-        "movq     40(%3), %%mm5         \n\t"
-        "movq     48(%3), %%mm6         \n\t"
-        "movq     56(%3), %%mm7         \n\t"
-        "packuswb  %%mm1, %%mm0         \n\t"
-        "packuswb  %%mm3, %%mm2         \n\t"
-        "packuswb  %%mm5, %%mm4         \n\t"
-        "packuswb  %%mm7, %%mm6         \n\t"
-        "movq      %%mm0, (%0)          \n\t"
-        "movq      %%mm2, (%0, %1)      \n\t"
-        "movq      %%mm4, (%0, %1, 2)   \n\t"
-        "movq      %%mm6, (%0, %2)      \n\t"
-        :: "r"(pix), "r"((x86_reg)line_size), "r"((x86_reg)line_size * 3), "r"(p)
-        : "memory");
-}
-
-#define put_signed_pixels_clamped_mmx_half(off)             \
-    "movq          "#off"(%2), %%mm1        \n\t"           \
-    "movq     16 + "#off"(%2), %%mm2        \n\t"           \
-    "movq     32 + "#off"(%2), %%mm3        \n\t"           \
-    "movq     48 + "#off"(%2), %%mm4        \n\t"           \
-    "packsswb  8 + "#off"(%2), %%mm1        \n\t"           \
-    "packsswb 24 + "#off"(%2), %%mm2        \n\t"           \
-    "packsswb 40 + "#off"(%2), %%mm3        \n\t"           \
-    "packsswb 56 + "#off"(%2), %%mm4        \n\t"           \
-    "paddb              %%mm0, %%mm1        \n\t"           \
-    "paddb              %%mm0, %%mm2        \n\t"           \
-    "paddb              %%mm0, %%mm3        \n\t"           \
-    "paddb              %%mm0, %%mm4        \n\t"           \
-    "movq               %%mm1, (%0)         \n\t"           \
-    "movq               %%mm2, (%0, %3)     \n\t"           \
-    "movq               %%mm3, (%0, %3, 2)  \n\t"           \
-    "movq               %%mm4, (%0, %1)     \n\t"
-
-void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                                      int line_size)
-{
-    x86_reg line_skip = line_size;
-    x86_reg line_skip3;
-
-    __asm__ volatile (
-        "movq "MANGLE(ff_pb_80)", %%mm0     \n\t"
-        "lea         (%3, %3, 2), %1        \n\t"
-        put_signed_pixels_clamped_mmx_half(0)
-        "lea         (%0, %3, 4), %0        \n\t"
-        put_signed_pixels_clamped_mmx_half(64)
-        : "+&r"(pixels), "=&r"(line_skip3)
-        : "r"(block), "r"(line_skip)
-        : "memory");
-}
-
-void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size)
-{
-    const int16_t *p;
-    uint8_t *pix;
-    int i;
-
-    /* read the pixels */
-    p   = block;
-    pix = pixels;
-    MOVQ_ZERO(mm7);
-    i = 4;
-    do {
-        __asm__ volatile (
-            "movq        (%2), %%mm0    \n\t"
-            "movq       8(%2), %%mm1    \n\t"
-            "movq      16(%2), %%mm2    \n\t"
-            "movq      24(%2), %%mm3    \n\t"
-            "movq          %0, %%mm4    \n\t"
-            "movq          %1, %%mm6    \n\t"
-            "movq       %%mm4, %%mm5    \n\t"
-            "punpcklbw  %%mm7, %%mm4    \n\t"
-            "punpckhbw  %%mm7, %%mm5    \n\t"
-            "paddsw     %%mm4, %%mm0    \n\t"
-            "paddsw     %%mm5, %%mm1    \n\t"
-            "movq       %%mm6, %%mm5    \n\t"
-            "punpcklbw  %%mm7, %%mm6    \n\t"
-            "punpckhbw  %%mm7, %%mm5    \n\t"
-            "paddsw     %%mm6, %%mm2    \n\t"
-            "paddsw     %%mm5, %%mm3    \n\t"
-            "packuswb   %%mm1, %%mm0    \n\t"
-            "packuswb   %%mm3, %%mm2    \n\t"
-            "movq       %%mm0, %0       \n\t"
-            "movq       %%mm2, %1       \n\t"
-            : "+m"(*pix), "+m"(*(pix + line_size))
-            : "r"(p)
-            : "memory");
-        pix += line_size * 2;
-        p   += 16;
-    } while (--i);
-}
-
-#define CLEAR_BLOCKS(name, n)                           \
-void name(int16_t *blocks)                              \
-{                                                       \
-    __asm__ volatile (                                  \
-        "pxor %%mm7, %%mm7              \n\t"           \
-        "mov     %1,        %%"REG_a"   \n\t"           \
-        "1:                             \n\t"           \
-        "movq %%mm7,   (%0, %%"REG_a")  \n\t"           \
-        "movq %%mm7,  8(%0, %%"REG_a")  \n\t"           \
-        "movq %%mm7, 16(%0, %%"REG_a")  \n\t"           \
-        "movq %%mm7, 24(%0, %%"REG_a")  \n\t"           \
-        "add    $32, %%"REG_a"          \n\t"           \
-        "js      1b                     \n\t"           \
-        :: "r"(((uint8_t *)blocks) + 128 * n),          \
-           "i"(-128 * n)                                \
-        : "%"REG_a                                      \
-        );                                              \
-}
-CLEAR_BLOCKS(ff_clear_blocks_mmx, 6)
-CLEAR_BLOCKS(ff_clear_block_mmx, 1)
-
-void ff_clear_block_sse(int16_t *block)
-{
-    __asm__ volatile (
-        "xorps  %%xmm0, %%xmm0          \n"
-        "movaps %%xmm0,    (%0)         \n"
-        "movaps %%xmm0,  16(%0)         \n"
-        "movaps %%xmm0,  32(%0)         \n"
-        "movaps %%xmm0,  48(%0)         \n"
-        "movaps %%xmm0,  64(%0)         \n"
-        "movaps %%xmm0,  80(%0)         \n"
-        "movaps %%xmm0,  96(%0)         \n"
-        "movaps %%xmm0, 112(%0)         \n"
-        :: "r"(block)
-        : "memory"
-    );
-}
-
-void ff_clear_blocks_sse(int16_t *blocks)
-{
-    __asm__ volatile (
-        "xorps  %%xmm0, %%xmm0              \n"
-        "mov        %1,         %%"REG_a"   \n"
-        "1:                                 \n"
-        "movaps %%xmm0,    (%0, %%"REG_a")  \n"
-        "movaps %%xmm0,  16(%0, %%"REG_a")  \n"
-        "movaps %%xmm0,  32(%0, %%"REG_a")  \n"
-        "movaps %%xmm0,  48(%0, %%"REG_a")  \n"
-        "movaps %%xmm0,  64(%0, %%"REG_a")  \n"
-        "movaps %%xmm0,  80(%0, %%"REG_a")  \n"
-        "movaps %%xmm0,  96(%0, %%"REG_a")  \n"
-        "movaps %%xmm0, 112(%0, %%"REG_a")  \n"
-        "add      $128,         %%"REG_a"   \n"
-        "js         1b                      \n"
-        :: "r"(((uint8_t *)blocks) + 128 * 6),
-           "i"(-128 * 6)
-        : "%"REG_a
-    );
-}
-
-void ff_add_bytes_mmx(uint8_t *dst, uint8_t *src, int w)
-{
-    x86_reg i = 0;
-    __asm__ volatile (
-        "jmp          2f                \n\t"
-        "1:                             \n\t"
-        "movq   (%1, %0), %%mm0         \n\t"
-        "movq   (%2, %0), %%mm1         \n\t"
-        "paddb     %%mm0, %%mm1         \n\t"
-        "movq      %%mm1, (%2, %0)      \n\t"
-        "movq  8(%1, %0), %%mm0         \n\t"
-        "movq  8(%2, %0), %%mm1         \n\t"
-        "paddb     %%mm0, %%mm1         \n\t"
-        "movq      %%mm1, 8(%2, %0)     \n\t"
-        "add         $16, %0            \n\t"
-        "2:                             \n\t"
-        "cmp          %3, %0            \n\t"
-        "js           1b                \n\t"
-        : "+r"(i)
-        : "r"(src), "r"(dst), "r"((x86_reg)w - 15)
-    );
-    for ( ; i < w; i++)
-        dst[i + 0] += src[i + 0];
-}
-
-/* Draw the edges of width 'w' of an image of size width, height
- * this MMX version can only handle w == 8 || w == 16. */
-void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
-                       int w, int h, int sides)
-{
-    uint8_t *ptr, *last_line;
-    int i;
-
-    last_line = buf + (height - 1) * wrap;
-    /* left and right */
-    ptr = buf;
-    if (w == 8) {
-        __asm__ volatile (
-            "1:                             \n\t"
-            "movd            (%0), %%mm0    \n\t"
-            "punpcklbw      %%mm0, %%mm0    \n\t"
-            "punpcklwd      %%mm0, %%mm0    \n\t"
-            "punpckldq      %%mm0, %%mm0    \n\t"
-            "movq           %%mm0, -8(%0)   \n\t"
-            "movq      -8(%0, %2), %%mm1    \n\t"
-            "punpckhbw      %%mm1, %%mm1    \n\t"
-            "punpckhwd      %%mm1, %%mm1    \n\t"
-            "punpckhdq      %%mm1, %%mm1    \n\t"
-            "movq           %%mm1, (%0, %2) \n\t"
-            "add               %1, %0       \n\t"
-            "cmp               %3, %0       \n\t"
-            "jb                1b           \n\t"
-            : "+r"(ptr)
-            : "r"((x86_reg)wrap), "r"((x86_reg)width), "r"(ptr + wrap * height)
-            );
-    } else {
-        __asm__ volatile (
-            "1:                                 \n\t"
-            "movd            (%0), %%mm0        \n\t"
-            "punpcklbw      %%mm0, %%mm0        \n\t"
-            "punpcklwd      %%mm0, %%mm0        \n\t"
-            "punpckldq      %%mm0, %%mm0        \n\t"
-            "movq           %%mm0, -8(%0)       \n\t"
-            "movq           %%mm0, -16(%0)      \n\t"
-            "movq      -8(%0, %2), %%mm1        \n\t"
-            "punpckhbw      %%mm1, %%mm1        \n\t"
-            "punpckhwd      %%mm1, %%mm1        \n\t"
-            "punpckhdq      %%mm1, %%mm1        \n\t"
-            "movq           %%mm1,  (%0, %2)    \n\t"
-            "movq           %%mm1, 8(%0, %2)    \n\t"
-            "add               %1, %0           \n\t"
-            "cmp               %3, %0           \n\t"
-            "jb                1b               \n\t"
-            : "+r"(ptr)
-            : "r"((x86_reg)wrap), "r"((x86_reg)width), "r"(ptr + wrap * height)
-            );
-    }
-
-    /* top and bottom (and hopefully also the corners) */
-    if (sides & EDGE_TOP) {
-        for (i = 0; i < h; i += 4) {
-            ptr = buf - (i + 1) * wrap - w;
-            __asm__ volatile (
-                "1:                             \n\t"
-                "movq (%1, %0), %%mm0           \n\t"
-                "movq    %%mm0, (%0)            \n\t"
-                "movq    %%mm0, (%0, %2)        \n\t"
-                "movq    %%mm0, (%0, %2, 2)     \n\t"
-                "movq    %%mm0, (%0, %3)        \n\t"
-                "add        $8, %0              \n\t"
-                "cmp        %4, %0              \n\t"
-                "jb         1b                  \n\t"
-                : "+r"(ptr)
-                : "r"((x86_reg)buf - (x86_reg)ptr - w), "r"((x86_reg) -wrap),
-                  "r"((x86_reg) -wrap * 3), "r"(ptr + width + 2 * w)
-                );
-        }
-    }
-
-    if (sides & EDGE_BOTTOM) {
-        for (i = 0; i < h; i += 4) {
-            ptr = last_line + (i + 1) * wrap - w;
-            __asm__ volatile (
-                "1:                             \n\t"
-                "movq (%1, %0), %%mm0           \n\t"
-                "movq    %%mm0, (%0)            \n\t"
-                "movq    %%mm0, (%0, %2)        \n\t"
-                "movq    %%mm0, (%0, %2, 2)     \n\t"
-                "movq    %%mm0, (%0, %3)        \n\t"
-                "add        $8, %0              \n\t"
-                "cmp        %4, %0              \n\t"
-                "jb         1b                  \n\t"
-                : "+r"(ptr)
-                : "r"((x86_reg)last_line - (x86_reg)ptr - w),
-                  "r"((x86_reg)wrap), "r"((x86_reg)wrap * 3),
-                  "r"(ptr + width + 2 * w)
-                );
-        }
-    }
-}
-
-void ff_gmc_mmx(uint8_t *dst, uint8_t *src,
-                int stride, int h, int ox, int oy,
-                int dxx, int dxy, int dyx, int dyy,
-                int shift, int r, int width, int height)
-{
-    const int w    = 8;
-    const int ix   = ox  >> (16 + shift);
-    const int iy   = oy  >> (16 + shift);
-    const int oxs  = ox  >> 4;
-    const int oys  = oy  >> 4;
-    const int dxxs = dxx >> 4;
-    const int dxys = dxy >> 4;
-    const int dyxs = dyx >> 4;
-    const int dyys = dyy >> 4;
-    const uint16_t r4[4]   = { r, r, r, r };
-    const uint16_t dxy4[4] = { dxys, dxys, dxys, dxys };
-    const uint16_t dyy4[4] = { dyys, dyys, dyys, dyys };
-    const uint64_t shift2 = 2 * shift;
-    int x, y;
-
-    const int dxw = (dxx - (1 << (16 + shift))) * (w - 1);
-    const int dyh = (dyy - (1 << (16 + shift))) * (h - 1);
-    const int dxh = dxy * (h - 1);
-    const int dyw = dyx * (w - 1);
-    if ( // non-constant fullpel offset (3% of blocks)
-        ((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) |
-         (oy ^ (oy + dyw)) | (oy ^ (oy + dyh)) | (oy ^ (oy + dyw + dyh))) >> (16 + shift)
-        // uses more than 16 bits of subpel mv (only at huge resolution)
-        || (dxx | dxy | dyx | dyy) & 15 ||
-        (unsigned)ix >= width  - w ||
-        (unsigned)iy >= height - h) {
-        // FIXME could still use mmx for some of the rows
-        ff_gmc_c(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy,
-                 shift, r, width, height);
-        return;
-    }
-
-    src += ix + iy * stride;
-
-    __asm__ volatile (
-        "movd         %0, %%mm6         \n\t"
-        "pxor      %%mm7, %%mm7         \n\t"
-        "punpcklwd %%mm6, %%mm6         \n\t"
-        "punpcklwd %%mm6, %%mm6         \n\t"
-        :: "r"(1<<shift)
-    );
-
-    for (x = 0; x < w; x += 4) {
-        uint16_t dx4[4] = { oxs - dxys + dxxs * (x + 0),
-                            oxs - dxys + dxxs * (x + 1),
-                            oxs - dxys + dxxs * (x + 2),
-                            oxs - dxys + dxxs * (x + 3) };
-        uint16_t dy4[4] = { oys - dyys + dyxs * (x + 0),
-                            oys - dyys + dyxs * (x + 1),
-                            oys - dyys + dyxs * (x + 2),
-                            oys - dyys + dyxs * (x + 3) };
-
-        for (y = 0; y < h; y++) {
-            __asm__ volatile (
-                "movq      %0, %%mm4    \n\t"
-                "movq      %1, %%mm5    \n\t"
-                "paddw     %2, %%mm4    \n\t"
-                "paddw     %3, %%mm5    \n\t"
-                "movq   %%mm4, %0       \n\t"
-                "movq   %%mm5, %1       \n\t"
-                "psrlw    $12, %%mm4    \n\t"
-                "psrlw    $12, %%mm5    \n\t"
-                : "+m"(*dx4), "+m"(*dy4)
-                : "m"(*dxy4), "m"(*dyy4)
-            );
-
-            __asm__ volatile (
-                "movq      %%mm6, %%mm2 \n\t"
-                "movq      %%mm6, %%mm1 \n\t"
-                "psubw     %%mm4, %%mm2 \n\t"
-                "psubw     %%mm5, %%mm1 \n\t"
-                "movq      %%mm2, %%mm0 \n\t"
-                "movq      %%mm4, %%mm3 \n\t"
-                "pmullw    %%mm1, %%mm0 \n\t" // (s - dx) * (s - dy)
-                "pmullw    %%mm5, %%mm3 \n\t" // dx * dy
-                "pmullw    %%mm5, %%mm2 \n\t" // (s - dx) * dy
-                "pmullw    %%mm4, %%mm1 \n\t" // dx * (s - dy)
-
-                "movd         %4, %%mm5 \n\t"
-                "movd         %3, %%mm4 \n\t"
-                "punpcklbw %%mm7, %%mm5 \n\t"
-                "punpcklbw %%mm7, %%mm4 \n\t"
-                "pmullw    %%mm5, %%mm3 \n\t" // src[1, 1] * dx * dy
-                "pmullw    %%mm4, %%mm2 \n\t" // src[0, 1] * (s - dx) * dy
-
-                "movd         %2, %%mm5 \n\t"
-                "movd         %1, %%mm4 \n\t"
-                "punpcklbw %%mm7, %%mm5 \n\t"
-                "punpcklbw %%mm7, %%mm4 \n\t"
-                "pmullw    %%mm5, %%mm1 \n\t" // src[1, 0] * dx * (s - dy)
-                "pmullw    %%mm4, %%mm0 \n\t" // src[0, 0] * (s - dx) * (s - dy)
-                "paddw        %5, %%mm1 \n\t"
-                "paddw     %%mm3, %%mm2 \n\t"
-                "paddw     %%mm1, %%mm0 \n\t"
-                "paddw     %%mm2, %%mm0 \n\t"
-
-                "psrlw        %6, %%mm0 \n\t"
-                "packuswb  %%mm0, %%mm0 \n\t"
-                "movd      %%mm0, %0    \n\t"
-
-                : "=m"(dst[x + y * stride])
-                : "m"(src[0]), "m"(src[1]),
-                  "m"(src[stride]), "m"(src[stride + 1]),
-                  "m"(*r4), "m"(shift2)
-            );
-            src += stride;
-        }
-        src += 4 - h * stride;
-    }
-}
-
-void ff_vector_clipf_sse(float *dst, const float *src,
-                         float min, float max, int len)
-{
-    x86_reg i = (len - 16) * 4;
-    __asm__ volatile (
-        "movss          %3, %%xmm4      \n\t"
-        "movss          %4, %%xmm5      \n\t"
-        "shufps $0, %%xmm4, %%xmm4      \n\t"
-        "shufps $0, %%xmm5, %%xmm5      \n\t"
-        "1:                             \n\t"
-        "movaps   (%2, %0), %%xmm0      \n\t" // 3/1 on intel
-        "movaps 16(%2, %0), %%xmm1      \n\t"
-        "movaps 32(%2, %0), %%xmm2      \n\t"
-        "movaps 48(%2, %0), %%xmm3      \n\t"
-        "maxps      %%xmm4, %%xmm0      \n\t"
-        "maxps      %%xmm4, %%xmm1      \n\t"
-        "maxps      %%xmm4, %%xmm2      \n\t"
-        "maxps      %%xmm4, %%xmm3      \n\t"
-        "minps      %%xmm5, %%xmm0      \n\t"
-        "minps      %%xmm5, %%xmm1      \n\t"
-        "minps      %%xmm5, %%xmm2      \n\t"
-        "minps      %%xmm5, %%xmm3      \n\t"
-        "movaps     %%xmm0,   (%1, %0)  \n\t"
-        "movaps     %%xmm1, 16(%1, %0)  \n\t"
-        "movaps     %%xmm2, 32(%1, %0)  \n\t"
-        "movaps     %%xmm3, 48(%1, %0)  \n\t"
-        "sub           $64, %0          \n\t"
-        "jge            1b              \n\t"
-        : "+&r"(i)
-        : "r"(dst), "r"(src), "m"(min), "m"(max)
-        : "memory"
-    );
-}
-
-#endif /* HAVE_INLINE_ASM */
diff --git a/deps/libav/libavcodec/x86/dsputil_qns_template.c b/deps/libav/libavcodec/x86/dsputil_qns_template.c
deleted file mode 100644
index 20a40a1..0000000
--- a/deps/libav/libavcodec/x86/dsputil_qns_template.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * DSP utils : QNS functions are compiled 3 times for mmx/3dnow/ssse3
- * Copyright (c) 2004 Michael Niedermayer
- *
- * MMX optimization by Michael Niedermayer <michaelni at gmx.at>
- * 3DNow! and SSSE3 optimization by Zuxy Meng <zuxy.meng at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define MAX_ABS (512 >> (SCALE_OFFSET>0 ? SCALE_OFFSET : 0))
-
-static int DEF(try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale)
-{
-    x86_reg i=0;
-
-    assert(FFABS(scale) < MAX_ABS);
-    scale<<= 16 + SCALE_OFFSET - BASIS_SHIFT + RECON_SHIFT;
-
-    SET_RND(mm6);
-    __asm__ volatile(
-        "pxor %%mm7, %%mm7              \n\t"
-        "movd  %4, %%mm5                \n\t"
-        "punpcklwd %%mm5, %%mm5         \n\t"
-        "punpcklwd %%mm5, %%mm5         \n\t"
-        ".p2align 4                     \n\t"
-        "1:                             \n\t"
-        "movq  (%1, %0), %%mm0          \n\t"
-        "movq  8(%1, %0), %%mm1         \n\t"
-        PMULHRW(%%mm0, %%mm1, %%mm5, %%mm6)
-        "paddw (%2, %0), %%mm0          \n\t"
-        "paddw 8(%2, %0), %%mm1         \n\t"
-        "psraw $6, %%mm0                \n\t"
-        "psraw $6, %%mm1                \n\t"
-        "pmullw (%3, %0), %%mm0         \n\t"
-        "pmullw 8(%3, %0), %%mm1        \n\t"
-        "pmaddwd %%mm0, %%mm0           \n\t"
-        "pmaddwd %%mm1, %%mm1           \n\t"
-        "paddd %%mm1, %%mm0             \n\t"
-        "psrld $4, %%mm0                \n\t"
-        "paddd %%mm0, %%mm7             \n\t"
-        "add $16, %0                    \n\t"
-        "cmp $128, %0                   \n\t" //FIXME optimize & bench
-        " jb 1b                         \n\t"
-        PHADDD(%%mm7, %%mm6)
-        "psrld $2, %%mm7                \n\t"
-        "movd %%mm7, %0                 \n\t"
-
-        : "+r" (i)
-        : "r"(basis), "r"(rem), "r"(weight), "g"(scale)
-    );
-    return i;
-}
-
-static void DEF(add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale)
-{
-    x86_reg i=0;
-
-    if(FFABS(scale) < MAX_ABS){
-        scale<<= 16 + SCALE_OFFSET - BASIS_SHIFT + RECON_SHIFT;
-        SET_RND(mm6);
-        __asm__ volatile(
-                "movd  %3, %%mm5        \n\t"
-                "punpcklwd %%mm5, %%mm5 \n\t"
-                "punpcklwd %%mm5, %%mm5 \n\t"
-                ".p2align 4             \n\t"
-                "1:                     \n\t"
-                "movq  (%1, %0), %%mm0  \n\t"
-                "movq  8(%1, %0), %%mm1 \n\t"
-                PMULHRW(%%mm0, %%mm1, %%mm5, %%mm6)
-                "paddw (%2, %0), %%mm0  \n\t"
-                "paddw 8(%2, %0), %%mm1 \n\t"
-                "movq %%mm0, (%2, %0)   \n\t"
-                "movq %%mm1, 8(%2, %0)  \n\t"
-                "add $16, %0            \n\t"
-                "cmp $128, %0           \n\t" // FIXME optimize & bench
-                " jb 1b                 \n\t"
-
-                : "+r" (i)
-                : "r"(basis), "r"(rem), "g"(scale)
-        );
-    }else{
-        for(i=0; i<8*8; i++){
-            rem[i] += (basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT);
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/x86/dsputil_x86.c b/deps/libav/libavcodec/x86/dsputil_x86.c
deleted file mode 100644
index 144339b..0000000
--- a/deps/libav/libavcodec/x86/dsputil_x86.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2009 Loren Merritt <lorenm at u.washington.edu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/x86/asm.h"
-#include "dsputil_x86.h"
-
-#if HAVE_INLINE_ASM
-
-#if HAVE_7REGS
-void ff_add_hfyu_median_prediction_cmov(uint8_t *dst, const uint8_t *top,
-                                        const uint8_t *diff, int w,
-                                        int *left, int *left_top)
-{
-    x86_reg w2 = -w;
-    x86_reg x;
-    int l  = *left     & 0xff;
-    int tl = *left_top & 0xff;
-    int t;
-    __asm__ volatile (
-        "mov          %7, %3            \n"
-        "1:                             \n"
-        "movzbl (%3, %4), %2            \n"
-        "mov          %2, %k3           \n"
-        "sub         %b1, %b3           \n"
-        "add         %b0, %b3           \n"
-        "mov          %2, %1            \n"
-        "cmp          %0, %2            \n"
-        "cmovg        %0, %2            \n"
-        "cmovg        %1, %0            \n"
-        "cmp         %k3, %0            \n"
-        "cmovg       %k3, %0            \n"
-        "mov          %7, %3            \n"
-        "cmp          %2, %0            \n"
-        "cmovl        %2, %0            \n"
-        "add    (%6, %4), %b0           \n"
-        "mov         %b0, (%5, %4)      \n"
-        "inc          %4                \n"
-        "jl           1b                \n"
-        : "+&q"(l), "+&q"(tl), "=&r"(t), "=&q"(x), "+&r"(w2)
-        : "r"(dst + w), "r"(diff + w), "rm"(top + w)
-    );
-    *left     = l;
-    *left_top = tl;
-}
-#endif
-
-#endif /* HAVE_INLINE_ASM */
diff --git a/deps/libav/libavcodec/x86/dsputil_x86.h b/deps/libav/libavcodec/x86/dsputil_x86.h
deleted file mode 100644
index c003cee..0000000
--- a/deps/libav/libavcodec/x86/dsputil_x86.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * MMX optimized DSP utils
- * Copyright (c) 2007  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_X86_DSPUTIL_X86_H
-#define AVCODEC_X86_DSPUTIL_X86_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavcodec/dsputil.h"
-#include "libavutil/x86/asm.h"
-#include "constants.h"
-
-#define MOVQ_WONE(regd) \
-    __asm__ volatile ( \
-    "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
-    "psrlw $15, %%" #regd ::)
-
-#define JUMPALIGN()     __asm__ volatile (".p2align 3"::)
-#define MOVQ_ZERO(regd) __asm__ volatile ("pxor %%"#regd", %%"#regd ::)
-
-#define MOVQ_BFE(regd)                                  \
-    __asm__ volatile (                                  \
-        "pcmpeqd %%"#regd", %%"#regd"   \n\t"           \
-        "paddb   %%"#regd", %%"#regd"   \n\t" ::)
-
-#ifndef PIC
-#define MOVQ_WTWO(regd) __asm__ volatile ("movq %0, %%"#regd" \n\t" :: "m"(ff_wtwo))
-#else
-// for shared library it's better to use this way for accessing constants
-// pcmpeqd -> -1
-#define MOVQ_WTWO(regd)                                 \
-    __asm__ volatile (                                  \
-        "pcmpeqd %%"#regd", %%"#regd"   \n\t"           \
-        "psrlw         $15, %%"#regd"   \n\t"           \
-        "psllw          $1, %%"#regd"   \n\t"::)
-
-#endif
-
-// using regr as temporary and for the output result
-// first argument is unmodifed and second is trashed
-// regfe is supposed to contain 0xfefefefefefefefe
-#define PAVGB_MMX_NO_RND(rega, regb, regr, regfe)                \
-    "movq   "#rega", "#regr"            \n\t"                    \
-    "pand   "#regb", "#regr"            \n\t"                    \
-    "pxor   "#rega", "#regb"            \n\t"                    \
-    "pand  "#regfe", "#regb"            \n\t"                    \
-    "psrlq       $1, "#regb"            \n\t"                    \
-    "paddb  "#regb", "#regr"            \n\t"
-
-#define PAVGB_MMX(rega, regb, regr, regfe)                       \
-    "movq   "#rega", "#regr"            \n\t"                    \
-    "por    "#regb", "#regr"            \n\t"                    \
-    "pxor   "#rega", "#regb"            \n\t"                    \
-    "pand  "#regfe", "#regb"            \n\t"                    \
-    "psrlq       $1, "#regb"            \n\t"                    \
-    "psubb  "#regb", "#regr"            \n\t"
-
-// mm6 is supposed to contain 0xfefefefefefefefe
-#define PAVGBP_MMX_NO_RND(rega, regb, regr,  regc, regd, regp)   \
-    "movq  "#rega", "#regr"             \n\t"                    \
-    "movq  "#regc", "#regp"             \n\t"                    \
-    "pand  "#regb", "#regr"             \n\t"                    \
-    "pand  "#regd", "#regp"             \n\t"                    \
-    "pxor  "#rega", "#regb"             \n\t"                    \
-    "pxor  "#regc", "#regd"             \n\t"                    \
-    "pand    %%mm6, "#regb"             \n\t"                    \
-    "pand    %%mm6, "#regd"             \n\t"                    \
-    "psrlq      $1, "#regb"             \n\t"                    \
-    "psrlq      $1, "#regd"             \n\t"                    \
-    "paddb "#regb", "#regr"             \n\t"                    \
-    "paddb "#regd", "#regp"             \n\t"
-
-#define PAVGBP_MMX(rega, regb, regr, regc, regd, regp)           \
-    "movq  "#rega", "#regr"             \n\t"                    \
-    "movq  "#regc", "#regp"             \n\t"                    \
-    "por   "#regb", "#regr"             \n\t"                    \
-    "por   "#regd", "#regp"             \n\t"                    \
-    "pxor  "#rega", "#regb"             \n\t"                    \
-    "pxor  "#regc", "#regd"             \n\t"                    \
-    "pand    %%mm6, "#regb"             \n\t"                    \
-    "pand    %%mm6, "#regd"             \n\t"                    \
-    "psrlq      $1, "#regd"             \n\t"                    \
-    "psrlq      $1, "#regb"             \n\t"                    \
-    "psubb "#regb", "#regr"             \n\t"                    \
-    "psubb "#regd", "#regp"             \n\t"
-
-void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
-
-void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
-void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
-void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
-
-void ff_clear_block_mmx(int16_t *block);
-void ff_clear_block_sse(int16_t *block);
-void ff_clear_blocks_mmx(int16_t *blocks);
-void ff_clear_blocks_sse(int16_t *blocks);
-
-void ff_add_bytes_mmx(uint8_t *dst, uint8_t *src, int w);
-
-void ff_add_hfyu_median_prediction_cmov(uint8_t *dst, const uint8_t *top,
-                                        const uint8_t *diff, int w,
-                                        int *left, int *left_top);
-
-void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
-                       int w, int h, int sides);
-
-void ff_gmc_mmx(uint8_t *dst, uint8_t *src,
-                int stride, int h, int ox, int oy,
-                int dxx, int dxy, int dyx, int dyy,
-                int shift, int r, int width, int height);
-
-void ff_vector_clipf_sse(float *dst, const float *src,
-                         float min, float max, int len);
-
-void ff_avg_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
-                        ptrdiff_t line_size, int h);
-void ff_avg_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
-                         ptrdiff_t line_size, int h);
-void ff_put_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
-                        ptrdiff_t line_size, int h);
-void ff_put_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
-                         ptrdiff_t line_size, int h);
-void ff_avg_pixels8_mmxext(uint8_t *block, const uint8_t *pixels,
-                           ptrdiff_t line_size, int h);
-void ff_put_pixels8_mmxext(uint8_t *block, const uint8_t *pixels,
-                           ptrdiff_t line_size, int h);
-void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
-                          ptrdiff_t line_size, int h);
-void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
-                          ptrdiff_t line_size, int h);
-
-void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels,
-                           ptrdiff_t line_size, int h);
-
-void ff_avg_pixels8_xy2_mmx(uint8_t *block, const uint8_t *pixels,
-                            ptrdiff_t line_size, int h);
-void ff_avg_pixels16_xy2_mmx(uint8_t *block, const uint8_t *pixels,
-                             ptrdiff_t line_size, int h);
-
-void ff_put_pixels8_xy2_mmx(uint8_t *block, const uint8_t *pixels,
-                            ptrdiff_t line_size, int h);
-void ff_put_pixels16_xy2_mmx(uint8_t *block, const uint8_t *pixels,
-                             ptrdiff_t line_size, int h);
-
-void ff_deinterlace_line_mmx(uint8_t *dst,
-                             const uint8_t *lum_m4, const uint8_t *lum_m3,
-                             const uint8_t *lum_m2, const uint8_t *lum_m1,
-                             const uint8_t *lum,
-                             int size);
-
-void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4,
-                                     const uint8_t *lum_m3,
-                                     const uint8_t *lum_m2,
-                                     const uint8_t *lum_m1,
-                                     const uint8_t *lum, int size);
-
-#define PIXELS16(STATIC, PFX1, PFX2, TYPE, CPUEXT)                      \
-STATIC void PFX1 ## _pixels16 ## TYPE ## CPUEXT(uint8_t *block,         \
-                                                const uint8_t *pixels,  \
-                                                ptrdiff_t line_size,    \
-                                                int h)                  \
-{                                                                       \
-    PFX2 ## PFX1 ## _pixels8 ## TYPE ## CPUEXT(block,      pixels,      \
-                                               line_size, h);           \
-    PFX2 ## PFX1 ## _pixels8 ## TYPE ## CPUEXT(block + 8,  pixels + 8,  \
-                                               line_size, h);           \
-}
-
-#endif /* AVCODEC_X86_DSPUTIL_X86_H */
diff --git a/deps/libav/libavcodec/x86/dsputilenc.asm b/deps/libav/libavcodec/x86/dsputilenc.asm
deleted file mode 100644
index 7e4fd81..0000000
--- a/deps/libav/libavcodec/x86/dsputilenc.asm
+++ /dev/null
@@ -1,487 +0,0 @@
-;*****************************************************************************
-;* MMX optimized DSP utils
-;*****************************************************************************
-;* Copyright (c) 2000, 2001 Fabrice Bellard
-;* Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;*****************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION .text
-
-%macro DIFF_PIXELS_1 4
-    movh            %1, %3
-    movh            %2, %4
-    punpcklbw       %2, %1
-    punpcklbw       %1, %1
-    psubw           %1, %2
-%endmacro
-
-; %1=uint8_t *pix1, %2=uint8_t *pix2, %3=static offset, %4=stride, %5=stride*3
-; %6=temporary storage location
-; this macro requires $mmsize stack space (aligned) on %6 (except on SSE+x86-64)
-%macro DIFF_PIXELS_8 6
-    DIFF_PIXELS_1   m0, m7, [%1     +%3], [%2     +%3]
-    DIFF_PIXELS_1   m1, m7, [%1+%4  +%3], [%2+%4  +%3]
-    DIFF_PIXELS_1   m2, m7, [%1+%4*2+%3], [%2+%4*2+%3]
-    add             %1, %5
-    add             %2, %5
-    DIFF_PIXELS_1   m3, m7, [%1     +%3], [%2     +%3]
-    DIFF_PIXELS_1   m4, m7, [%1+%4  +%3], [%2+%4  +%3]
-    DIFF_PIXELS_1   m5, m7, [%1+%4*2+%3], [%2+%4*2+%3]
-    DIFF_PIXELS_1   m6, m7, [%1+%5  +%3], [%2+%5  +%3]
-%ifdef m8
-    DIFF_PIXELS_1   m7, m8, [%1+%4*4+%3], [%2+%4*4+%3]
-%else
-    mova          [%6], m0
-    DIFF_PIXELS_1   m7, m0, [%1+%4*4+%3], [%2+%4*4+%3]
-    mova            m0, [%6]
-%endif
-    sub             %1, %5
-    sub             %2, %5
-%endmacro
-
-%macro HADAMARD8 0
-    SUMSUB_BADC       w, 0, 1, 2, 3
-    SUMSUB_BADC       w, 4, 5, 6, 7
-    SUMSUB_BADC       w, 0, 2, 1, 3
-    SUMSUB_BADC       w, 4, 6, 5, 7
-    SUMSUB_BADC       w, 0, 4, 1, 5
-    SUMSUB_BADC       w, 2, 6, 3, 7
-%endmacro
-
-%macro ABS1_SUM 3
-    ABS1            %1, %2
-    paddusw         %3, %1
-%endmacro
-
-%macro ABS2_SUM 6
-    ABS2            %1, %2, %3, %4
-    paddusw         %5, %1
-    paddusw         %6, %2
-%endmacro
-
-%macro ABS_SUM_8x8_64 1
-    ABS2            m0, m1, m8, m9
-    ABS2_SUM        m2, m3, m8, m9, m0, m1
-    ABS2_SUM        m4, m5, m8, m9, m0, m1
-    ABS2_SUM        m6, m7, m8, m9, m0, m1
-    paddusw         m0, m1
-%endmacro
-
-%macro ABS_SUM_8x8_32 1
-    mova          [%1], m7
-    ABS1            m0, m7
-    ABS1            m1, m7
-    ABS1_SUM        m2, m7, m0
-    ABS1_SUM        m3, m7, m1
-    ABS1_SUM        m4, m7, m0
-    ABS1_SUM        m5, m7, m1
-    ABS1_SUM        m6, m7, m0
-    mova            m2, [%1]
-    ABS1_SUM        m2, m7, m1
-    paddusw         m0, m1
-%endmacro
-
-; FIXME: HSUM saturates at 64k, while an 8x8 hadamard or dct block can get up to
-; about 100k on extreme inputs. But that's very unlikely to occur in natural video,
-; and it's even more unlikely to not have any alternative mvs/modes with lower cost.
-%macro HSUM 3
-%if cpuflag(sse2)
-    movhlps         %2, %1
-    paddusw         %1, %2
-    pshuflw         %2, %1, 0xE
-    paddusw         %1, %2
-    pshuflw         %2, %1, 0x1
-    paddusw         %1, %2
-    movd            %3, %1
-%elif cpuflag(mmxext)
-    pshufw          %2, %1, 0xE
-    paddusw         %1, %2
-    pshufw          %2, %1, 0x1
-    paddusw         %1, %2
-    movd            %3, %1
-%elif cpuflag(mmx)
-    mova            %2, %1
-    psrlq           %1, 32
-    paddusw         %1, %2
-    mova            %2, %1
-    psrlq           %1, 16
-    paddusw         %1, %2
-    movd            %3, %1
-%endif
-%endmacro
-
-%macro STORE4 5
-    mova [%1+mmsize*0], %2
-    mova [%1+mmsize*1], %3
-    mova [%1+mmsize*2], %4
-    mova [%1+mmsize*3], %5
-%endmacro
-
-%macro LOAD4 5
-    mova            %2, [%1+mmsize*0]
-    mova            %3, [%1+mmsize*1]
-    mova            %4, [%1+mmsize*2]
-    mova            %5, [%1+mmsize*3]
-%endmacro
-
-%macro hadamard8_16_wrapper 2
-cglobal hadamard8_diff, 4, 4, %1
-%ifndef m8
-    %assign pad %2*mmsize-(4+stack_offset&(mmsize-1))
-    SUB            rsp, pad
-%endif
-    call hadamard8x8_diff %+ SUFFIX
-%ifndef m8
-    ADD            rsp, pad
-%endif
-    RET
-
-cglobal hadamard8_diff16, 5, 6, %1
-%ifndef m8
-    %assign pad %2*mmsize-(4+stack_offset&(mmsize-1))
-    SUB            rsp, pad
-%endif
-
-    call hadamard8x8_diff %+ SUFFIX
-    mov            r5d, eax
-
-    add             r1, 8
-    add             r2, 8
-    call hadamard8x8_diff %+ SUFFIX
-    add            r5d, eax
-
-    cmp            r4d, 16
-    jne .done
-
-    lea             r1, [r1+r3*8-8]
-    lea             r2, [r2+r3*8-8]
-    call hadamard8x8_diff %+ SUFFIX
-    add            r5d, eax
-
-    add             r1, 8
-    add             r2, 8
-    call hadamard8x8_diff %+ SUFFIX
-    add            r5d, eax
-
-.done:
-    mov            eax, r5d
-%ifndef m8
-    ADD            rsp, pad
-%endif
-    RET
-%endmacro
-
-%macro HADAMARD8_DIFF 0-1
-%if cpuflag(sse2)
-hadamard8x8_diff %+ SUFFIX:
-    lea                          r0, [r3*3]
-    DIFF_PIXELS_8                r1, r2,  0, r3, r0, rsp+gprsize
-    HADAMARD8
-%if ARCH_X86_64
-    TRANSPOSE8x8W                 0,  1,  2,  3,  4,  5,  6,  7,  8
-%else
-    TRANSPOSE8x8W                 0,  1,  2,  3,  4,  5,  6,  7, [rsp+gprsize], [rsp+mmsize+gprsize]
-%endif
-    HADAMARD8
-    ABS_SUM_8x8         rsp+gprsize
-    HSUM                        m0, m1, eax
-    and                         eax, 0xFFFF
-    ret
-
-hadamard8_16_wrapper %1, 3
-%elif cpuflag(mmx)
-ALIGN 16
-; int hadamard8_diff_##cpu(void *s, uint8_t *src1, uint8_t *src2,
-;                          int stride, int h)
-; r0 = void *s = unused, int h = unused (always 8)
-; note how r1, r2 and r3 are not clobbered in this function, so 16x16
-; can simply call this 2x2x (and that's why we access rsp+gprsize
-; everywhere, which is rsp of calling func
-hadamard8x8_diff %+ SUFFIX:
-    lea                          r0, [r3*3]
-
-    ; first 4x8 pixels
-    DIFF_PIXELS_8                r1, r2,  0, r3, r0, rsp+gprsize+0x60
-    HADAMARD8
-    mova         [rsp+gprsize+0x60], m7
-    TRANSPOSE4x4W                 0,  1,  2,  3,  7
-    STORE4              rsp+gprsize, m0, m1, m2, m3
-    mova                         m7, [rsp+gprsize+0x60]
-    TRANSPOSE4x4W                 4,  5,  6,  7,  0
-    STORE4         rsp+gprsize+0x40, m4, m5, m6, m7
-
-    ; second 4x8 pixels
-    DIFF_PIXELS_8                r1, r2,  4, r3, r0, rsp+gprsize+0x60
-    HADAMARD8
-    mova         [rsp+gprsize+0x60], m7
-    TRANSPOSE4x4W                 0,  1,  2,  3,  7
-    STORE4         rsp+gprsize+0x20, m0, m1, m2, m3
-    mova                         m7, [rsp+gprsize+0x60]
-    TRANSPOSE4x4W                 4,  5,  6,  7,  0
-
-    LOAD4          rsp+gprsize+0x40, m0, m1, m2, m3
-    HADAMARD8
-    ABS_SUM_8x8_32 rsp+gprsize+0x60
-    mova         [rsp+gprsize+0x60], m0
-
-    LOAD4          rsp+gprsize     , m0, m1, m2, m3
-    LOAD4          rsp+gprsize+0x20, m4, m5, m6, m7
-    HADAMARD8
-    ABS_SUM_8x8_32 rsp+gprsize
-    paddusw                      m0, [rsp+gprsize+0x60]
-
-    HSUM                         m0, m1, eax
-    and                         rax, 0xFFFF
-    ret
-
-hadamard8_16_wrapper 0, 14
-%endif
-%endmacro
-
-INIT_MMX mmx
-HADAMARD8_DIFF
-
-INIT_MMX mmxext
-HADAMARD8_DIFF
-
-INIT_XMM sse2
-%if ARCH_X86_64
-%define ABS_SUM_8x8 ABS_SUM_8x8_64
-%else
-%define ABS_SUM_8x8 ABS_SUM_8x8_32
-%endif
-HADAMARD8_DIFF 10
-
-INIT_XMM ssse3
-%define ABS_SUM_8x8 ABS_SUM_8x8_64
-HADAMARD8_DIFF 9
-
-INIT_XMM sse2
-; sse16_sse2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h)
-cglobal sse16, 5, 5, 8
-    shr      r4d, 1
-    pxor      m0, m0         ; mm0 = 0
-    pxor      m7, m7         ; mm7 holds the sum
-
-.next2lines: ; FIXME why are these unaligned movs? pix1[] is aligned
-    movu      m1, [r1   ]    ; mm1 = pix1[0][0-15]
-    movu      m2, [r2   ]    ; mm2 = pix2[0][0-15]
-    movu      m3, [r1+r3]    ; mm3 = pix1[1][0-15]
-    movu      m4, [r2+r3]    ; mm4 = pix2[1][0-15]
-
-    ; todo: mm1-mm2, mm3-mm4
-    ; algo: subtract mm1 from mm2 with saturation and vice versa
-    ;       OR the result to get the absolute difference
-    mova      m5, m1
-    mova      m6, m3
-    psubusb   m1, m2
-    psubusb   m3, m4
-    psubusb   m2, m5
-    psubusb   m4, m6
-
-    por       m2, m1
-    por       m4, m3
-
-    ; now convert to 16-bit vectors so we can square them
-    mova      m1, m2
-    mova      m3, m4
-
-    punpckhbw m2, m0
-    punpckhbw m4, m0
-    punpcklbw m1, m0         ; mm1 not spread over (mm1,mm2)
-    punpcklbw m3, m0         ; mm4 not spread over (mm3,mm4)
-
-    pmaddwd   m2, m2
-    pmaddwd   m4, m4
-    pmaddwd   m1, m1
-    pmaddwd   m3, m3
-
-    lea       r1, [r1+r3*2]  ; pix1 += 2*line_size
-    lea       r2, [r2+r3*2]  ; pix2 += 2*line_size
-
-    paddd     m1, m2
-    paddd     m3, m4
-    paddd     m7, m1
-    paddd     m7, m3
-
-    dec       r4
-    jnz .next2lines
-
-    mova      m1, m7
-    psrldq    m7, 8          ; shift hi qword to lo
-    paddd     m7, m1
-    mova      m1, m7
-    psrldq    m7, 4          ; shift hi dword to lo
-    paddd     m7, m1
-    movd     eax, m7         ; return value
-    RET
-
-INIT_MMX mmx
-; get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size)
-cglobal get_pixels, 3,4
-    movsxdifnidn r2, r2d
-    add          r0, 128
-    mov          r3, -128
-    pxor         m7, m7
-.loop:
-    mova         m0, [r1]
-    mova         m2, [r1+r2]
-    mova         m1, m0
-    mova         m3, m2
-    punpcklbw    m0, m7
-    punpckhbw    m1, m7
-    punpcklbw    m2, m7
-    punpckhbw    m3, m7
-    mova [r0+r3+ 0], m0
-    mova [r0+r3+ 8], m1
-    mova [r0+r3+16], m2
-    mova [r0+r3+24], m3
-    lea          r1, [r1+r2*2]
-    add          r3, 32
-    js .loop
-    REP_RET
-
-INIT_XMM sse2
-cglobal get_pixels, 3, 4
-    movsxdifnidn r2, r2d
-    lea          r3, [r2*3]
-    pxor         m4, m4
-    movh         m0, [r1]
-    movh         m1, [r1+r2]
-    movh         m2, [r1+r2*2]
-    movh         m3, [r1+r3]
-    lea          r1, [r1+r2*4]
-    punpcklbw    m0, m4
-    punpcklbw    m1, m4
-    punpcklbw    m2, m4
-    punpcklbw    m3, m4
-    mova       [r0], m0
-    mova  [r0+0x10], m1
-    mova  [r0+0x20], m2
-    mova  [r0+0x30], m3
-    movh         m0, [r1]
-    movh         m1, [r1+r2*1]
-    movh         m2, [r1+r2*2]
-    movh         m3, [r1+r3]
-    punpcklbw    m0, m4
-    punpcklbw    m1, m4
-    punpcklbw    m2, m4
-    punpcklbw    m3, m4
-    mova  [r0+0x40], m0
-    mova  [r0+0x50], m1
-    mova  [r0+0x60], m2
-    mova  [r0+0x70], m3
-    RET
-
-INIT_MMX mmx
-; diff_pixels_mmx(int16_t *block, const uint8_t *s1, const unint8_t *s2, stride)
-cglobal diff_pixels, 4,5
-    movsxdifnidn r3, r3d
-    pxor         m7, m7
-    add          r0,  128
-    mov          r4, -128
-.loop:
-    mova         m0, [r1]
-    mova         m2, [r2]
-    mova         m1, m0
-    mova         m3, m2
-    punpcklbw    m0, m7
-    punpckhbw    m1, m7
-    punpcklbw    m2, m7
-    punpckhbw    m3, m7
-    psubw        m0, m2
-    psubw        m1, m3
-    mova  [r0+r4+0], m0
-    mova  [r0+r4+8], m1
-    add          r1, r3
-    add          r2, r3
-    add          r4, 16
-    jne .loop
-    REP_RET
-
-INIT_MMX mmx
-; pix_sum16_mmx(uint8_t * pix, int line_size)
-cglobal pix_sum16, 2, 3
-    movsxdifnidn r1, r1d
-    mov          r2, r1
-    neg          r2
-    shl          r2, 4
-    sub          r0, r2
-    pxor         m7, m7
-    pxor         m6, m6
-.loop:
-    mova         m0, [r0+r2+0]
-    mova         m1, [r0+r2+0]
-    mova         m2, [r0+r2+8]
-    mova         m3, [r0+r2+8]
-    punpcklbw    m0, m7
-    punpckhbw    m1, m7
-    punpcklbw    m2, m7
-    punpckhbw    m3, m7
-    paddw        m1, m0
-    paddw        m3, m2
-    paddw        m3, m1
-    paddw        m6, m3
-    add          r2, r1
-    js .loop
-    mova         m5, m6
-    psrlq        m6, 32
-    paddw        m6, m5
-    mova         m5, m6
-    psrlq        m6, 16
-    paddw        m6, m5
-    movd        eax, m6
-    and         eax, 0xffff
-    RET
-
-INIT_MMX mmx
-; pix_norm1_mmx(uint8_t *pix, int line_size)
-cglobal pix_norm1, 2, 4
-    movsxdifnidn r1, r1d
-    mov          r2, 16
-    pxor         m0, m0
-    pxor         m7, m7
-.loop:
-    mova         m2, [r0+0]
-    mova         m3, [r0+8]
-    mova         m1, m2
-    punpckhbw    m1, m0
-    punpcklbw    m2, m0
-    mova         m4, m3
-    punpckhbw    m3, m0
-    punpcklbw    m4, m0
-    pmaddwd      m1, m1
-    pmaddwd      m2, m2
-    pmaddwd      m3, m3
-    pmaddwd      m4, m4
-    paddd        m2, m1
-    paddd        m4, m3
-    paddd        m7, m2
-    add          r0, r1
-    paddd        m7, m4
-    dec r2
-    jne .loop
-    mova         m1, m7
-    psrlq        m7, 32
-    paddd        m1, m7
-    movd        eax, m1
-    RET
-
diff --git a/deps/libav/libavcodec/x86/dsputilenc_mmx.c b/deps/libav/libavcodec/x86/dsputilenc_mmx.c
deleted file mode 100644
index a1f80af..0000000
--- a/deps/libav/libavcodec/x86/dsputilenc_mmx.c
+++ /dev/null
@@ -1,1060 +0,0 @@
-/*
- * MMX optimized DSP utils
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * MMX optimization by Nick Kurshev <nickols_k at mail.ru>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/dct.h"
-#include "libavcodec/dsputil.h"
-#include "libavcodec/mpegvideo.h"
-#include "libavcodec/mathops.h"
-#include "dsputil_x86.h"
-
-void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size);
-void ff_get_pixels_sse2(int16_t *block, const uint8_t *pixels, int line_size);
-void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride);
-int ff_pix_sum16_mmx(uint8_t * pix, int line_size);
-int ff_pix_norm1_mmx(uint8_t *pix, int line_size);
-
-#if HAVE_INLINE_ASM
-
-static int sse8_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
-    int tmp;
-  __asm__ volatile (
-      "movl %4,%%ecx\n"
-      "shr $1,%%ecx\n"
-      "pxor %%mm0,%%mm0\n"      /* mm0 = 0 */
-      "pxor %%mm7,%%mm7\n"      /* mm7 holds the sum */
-      "1:\n"
-      "movq (%0),%%mm1\n"       /* mm1 = pix1[0][0-7] */
-      "movq (%1),%%mm2\n"       /* mm2 = pix2[0][0-7] */
-      "movq (%0,%3),%%mm3\n"    /* mm3 = pix1[1][0-7] */
-      "movq (%1,%3),%%mm4\n"    /* mm4 = pix2[1][0-7] */
-
-      /* todo: mm1-mm2, mm3-mm4 */
-      /* algo: subtract mm1 from mm2 with saturation and vice versa */
-      /*       OR the results to get absolute difference */
-      "movq %%mm1,%%mm5\n"
-      "movq %%mm3,%%mm6\n"
-      "psubusb %%mm2,%%mm1\n"
-      "psubusb %%mm4,%%mm3\n"
-      "psubusb %%mm5,%%mm2\n"
-      "psubusb %%mm6,%%mm4\n"
-
-      "por %%mm1,%%mm2\n"
-      "por %%mm3,%%mm4\n"
-
-      /* now convert to 16-bit vectors so we can square them */
-      "movq %%mm2,%%mm1\n"
-      "movq %%mm4,%%mm3\n"
-
-      "punpckhbw %%mm0,%%mm2\n"
-      "punpckhbw %%mm0,%%mm4\n"
-      "punpcklbw %%mm0,%%mm1\n" /* mm1 now spread over (mm1,mm2) */
-      "punpcklbw %%mm0,%%mm3\n" /* mm4 now spread over (mm3,mm4) */
-
-      "pmaddwd %%mm2,%%mm2\n"
-      "pmaddwd %%mm4,%%mm4\n"
-      "pmaddwd %%mm1,%%mm1\n"
-      "pmaddwd %%mm3,%%mm3\n"
-
-      "lea (%0,%3,2), %0\n"     /* pix1 += 2*line_size */
-      "lea (%1,%3,2), %1\n"     /* pix2 += 2*line_size */
-
-      "paddd %%mm2,%%mm1\n"
-      "paddd %%mm4,%%mm3\n"
-      "paddd %%mm1,%%mm7\n"
-      "paddd %%mm3,%%mm7\n"
-
-      "decl %%ecx\n"
-      "jnz 1b\n"
-
-      "movq %%mm7,%%mm1\n"
-      "psrlq $32, %%mm7\n"      /* shift hi dword to lo */
-      "paddd %%mm7,%%mm1\n"
-      "movd %%mm1,%2\n"
-      : "+r" (pix1), "+r" (pix2), "=r"(tmp)
-      : "r" ((x86_reg)line_size) , "m" (h)
-      : "%ecx");
-    return tmp;
-}
-
-static int sse16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
-    int tmp;
-  __asm__ volatile (
-      "movl %4,%%ecx\n"
-      "pxor %%mm0,%%mm0\n"      /* mm0 = 0 */
-      "pxor %%mm7,%%mm7\n"      /* mm7 holds the sum */
-      "1:\n"
-      "movq (%0),%%mm1\n"       /* mm1 = pix1[0-7] */
-      "movq (%1),%%mm2\n"       /* mm2 = pix2[0-7] */
-      "movq 8(%0),%%mm3\n"      /* mm3 = pix1[8-15] */
-      "movq 8(%1),%%mm4\n"      /* mm4 = pix2[8-15] */
-
-      /* todo: mm1-mm2, mm3-mm4 */
-      /* algo: subtract mm1 from mm2 with saturation and vice versa */
-      /*       OR the results to get absolute difference */
-      "movq %%mm1,%%mm5\n"
-      "movq %%mm3,%%mm6\n"
-      "psubusb %%mm2,%%mm1\n"
-      "psubusb %%mm4,%%mm3\n"
-      "psubusb %%mm5,%%mm2\n"
-      "psubusb %%mm6,%%mm4\n"
-
-      "por %%mm1,%%mm2\n"
-      "por %%mm3,%%mm4\n"
-
-      /* now convert to 16-bit vectors so we can square them */
-      "movq %%mm2,%%mm1\n"
-      "movq %%mm4,%%mm3\n"
-
-      "punpckhbw %%mm0,%%mm2\n"
-      "punpckhbw %%mm0,%%mm4\n"
-      "punpcklbw %%mm0,%%mm1\n" /* mm1 now spread over (mm1,mm2) */
-      "punpcklbw %%mm0,%%mm3\n" /* mm4 now spread over (mm3,mm4) */
-
-      "pmaddwd %%mm2,%%mm2\n"
-      "pmaddwd %%mm4,%%mm4\n"
-      "pmaddwd %%mm1,%%mm1\n"
-      "pmaddwd %%mm3,%%mm3\n"
-
-      "add %3,%0\n"
-      "add %3,%1\n"
-
-      "paddd %%mm2,%%mm1\n"
-      "paddd %%mm4,%%mm3\n"
-      "paddd %%mm1,%%mm7\n"
-      "paddd %%mm3,%%mm7\n"
-
-      "decl %%ecx\n"
-      "jnz 1b\n"
-
-      "movq %%mm7,%%mm1\n"
-      "psrlq $32, %%mm7\n"      /* shift hi dword to lo */
-      "paddd %%mm7,%%mm1\n"
-      "movd %%mm1,%2\n"
-      : "+r" (pix1), "+r" (pix2), "=r"(tmp)
-      : "r" ((x86_reg)line_size) , "m" (h)
-      : "%ecx");
-    return tmp;
-}
-
-static int hf_noise8_mmx(uint8_t * pix1, int line_size, int h) {
-    int tmp;
-  __asm__ volatile (
-      "movl %3,%%ecx\n"
-      "pxor %%mm7,%%mm7\n"
-      "pxor %%mm6,%%mm6\n"
-
-      "movq (%0),%%mm0\n"
-      "movq %%mm0, %%mm1\n"
-      "psllq $8, %%mm0\n"
-      "psrlq $8, %%mm1\n"
-      "psrlq $8, %%mm0\n"
-      "movq %%mm0, %%mm2\n"
-      "movq %%mm1, %%mm3\n"
-      "punpcklbw %%mm7,%%mm0\n"
-      "punpcklbw %%mm7,%%mm1\n"
-      "punpckhbw %%mm7,%%mm2\n"
-      "punpckhbw %%mm7,%%mm3\n"
-      "psubw %%mm1, %%mm0\n"
-      "psubw %%mm3, %%mm2\n"
-
-      "add %2,%0\n"
-
-      "movq (%0),%%mm4\n"
-      "movq %%mm4, %%mm1\n"
-      "psllq $8, %%mm4\n"
-      "psrlq $8, %%mm1\n"
-      "psrlq $8, %%mm4\n"
-      "movq %%mm4, %%mm5\n"
-      "movq %%mm1, %%mm3\n"
-      "punpcklbw %%mm7,%%mm4\n"
-      "punpcklbw %%mm7,%%mm1\n"
-      "punpckhbw %%mm7,%%mm5\n"
-      "punpckhbw %%mm7,%%mm3\n"
-      "psubw %%mm1, %%mm4\n"
-      "psubw %%mm3, %%mm5\n"
-      "psubw %%mm4, %%mm0\n"
-      "psubw %%mm5, %%mm2\n"
-      "pxor %%mm3, %%mm3\n"
-      "pxor %%mm1, %%mm1\n"
-      "pcmpgtw %%mm0, %%mm3\n\t"
-      "pcmpgtw %%mm2, %%mm1\n\t"
-      "pxor %%mm3, %%mm0\n"
-      "pxor %%mm1, %%mm2\n"
-      "psubw %%mm3, %%mm0\n"
-      "psubw %%mm1, %%mm2\n"
-      "paddw %%mm0, %%mm2\n"
-      "paddw %%mm2, %%mm6\n"
-
-      "add %2,%0\n"
-      "1:\n"
-
-      "movq (%0),%%mm0\n"
-      "movq %%mm0, %%mm1\n"
-      "psllq $8, %%mm0\n"
-      "psrlq $8, %%mm1\n"
-      "psrlq $8, %%mm0\n"
-      "movq %%mm0, %%mm2\n"
-      "movq %%mm1, %%mm3\n"
-      "punpcklbw %%mm7,%%mm0\n"
-      "punpcklbw %%mm7,%%mm1\n"
-      "punpckhbw %%mm7,%%mm2\n"
-      "punpckhbw %%mm7,%%mm3\n"
-      "psubw %%mm1, %%mm0\n"
-      "psubw %%mm3, %%mm2\n"
-      "psubw %%mm0, %%mm4\n"
-      "psubw %%mm2, %%mm5\n"
-      "pxor %%mm3, %%mm3\n"
-      "pxor %%mm1, %%mm1\n"
-      "pcmpgtw %%mm4, %%mm3\n\t"
-      "pcmpgtw %%mm5, %%mm1\n\t"
-      "pxor %%mm3, %%mm4\n"
-      "pxor %%mm1, %%mm5\n"
-      "psubw %%mm3, %%mm4\n"
-      "psubw %%mm1, %%mm5\n"
-      "paddw %%mm4, %%mm5\n"
-      "paddw %%mm5, %%mm6\n"
-
-      "add %2,%0\n"
-
-      "movq (%0),%%mm4\n"
-      "movq %%mm4, %%mm1\n"
-      "psllq $8, %%mm4\n"
-      "psrlq $8, %%mm1\n"
-      "psrlq $8, %%mm4\n"
-      "movq %%mm4, %%mm5\n"
-      "movq %%mm1, %%mm3\n"
-      "punpcklbw %%mm7,%%mm4\n"
-      "punpcklbw %%mm7,%%mm1\n"
-      "punpckhbw %%mm7,%%mm5\n"
-      "punpckhbw %%mm7,%%mm3\n"
-      "psubw %%mm1, %%mm4\n"
-      "psubw %%mm3, %%mm5\n"
-      "psubw %%mm4, %%mm0\n"
-      "psubw %%mm5, %%mm2\n"
-      "pxor %%mm3, %%mm3\n"
-      "pxor %%mm1, %%mm1\n"
-      "pcmpgtw %%mm0, %%mm3\n\t"
-      "pcmpgtw %%mm2, %%mm1\n\t"
-      "pxor %%mm3, %%mm0\n"
-      "pxor %%mm1, %%mm2\n"
-      "psubw %%mm3, %%mm0\n"
-      "psubw %%mm1, %%mm2\n"
-      "paddw %%mm0, %%mm2\n"
-      "paddw %%mm2, %%mm6\n"
-
-      "add %2,%0\n"
-      "subl $2, %%ecx\n"
-      " jnz 1b\n"
-
-      "movq %%mm6, %%mm0\n"
-      "punpcklwd %%mm7,%%mm0\n"
-      "punpckhwd %%mm7,%%mm6\n"
-      "paddd %%mm0, %%mm6\n"
-
-      "movq %%mm6,%%mm0\n"
-      "psrlq $32, %%mm6\n"
-      "paddd %%mm6,%%mm0\n"
-      "movd %%mm0,%1\n"
-      : "+r" (pix1), "=r"(tmp)
-      : "r" ((x86_reg)line_size) , "g" (h-2)
-      : "%ecx");
-      return tmp;
-}
-
-static int hf_noise16_mmx(uint8_t * pix1, int line_size, int h) {
-    int tmp;
-    uint8_t * pix= pix1;
-  __asm__ volatile (
-      "movl %3,%%ecx\n"
-      "pxor %%mm7,%%mm7\n"
-      "pxor %%mm6,%%mm6\n"
-
-      "movq (%0),%%mm0\n"
-      "movq 1(%0),%%mm1\n"
-      "movq %%mm0, %%mm2\n"
-      "movq %%mm1, %%mm3\n"
-      "punpcklbw %%mm7,%%mm0\n"
-      "punpcklbw %%mm7,%%mm1\n"
-      "punpckhbw %%mm7,%%mm2\n"
-      "punpckhbw %%mm7,%%mm3\n"
-      "psubw %%mm1, %%mm0\n"
-      "psubw %%mm3, %%mm2\n"
-
-      "add %2,%0\n"
-
-      "movq (%0),%%mm4\n"
-      "movq 1(%0),%%mm1\n"
-      "movq %%mm4, %%mm5\n"
-      "movq %%mm1, %%mm3\n"
-      "punpcklbw %%mm7,%%mm4\n"
-      "punpcklbw %%mm7,%%mm1\n"
-      "punpckhbw %%mm7,%%mm5\n"
-      "punpckhbw %%mm7,%%mm3\n"
-      "psubw %%mm1, %%mm4\n"
-      "psubw %%mm3, %%mm5\n"
-      "psubw %%mm4, %%mm0\n"
-      "psubw %%mm5, %%mm2\n"
-      "pxor %%mm3, %%mm3\n"
-      "pxor %%mm1, %%mm1\n"
-      "pcmpgtw %%mm0, %%mm3\n\t"
-      "pcmpgtw %%mm2, %%mm1\n\t"
-      "pxor %%mm3, %%mm0\n"
-      "pxor %%mm1, %%mm2\n"
-      "psubw %%mm3, %%mm0\n"
-      "psubw %%mm1, %%mm2\n"
-      "paddw %%mm0, %%mm2\n"
-      "paddw %%mm2, %%mm6\n"
-
-      "add %2,%0\n"
-      "1:\n"
-
-      "movq (%0),%%mm0\n"
-      "movq 1(%0),%%mm1\n"
-      "movq %%mm0, %%mm2\n"
-      "movq %%mm1, %%mm3\n"
-      "punpcklbw %%mm7,%%mm0\n"
-      "punpcklbw %%mm7,%%mm1\n"
-      "punpckhbw %%mm7,%%mm2\n"
-      "punpckhbw %%mm7,%%mm3\n"
-      "psubw %%mm1, %%mm0\n"
-      "psubw %%mm3, %%mm2\n"
-      "psubw %%mm0, %%mm4\n"
-      "psubw %%mm2, %%mm5\n"
-      "pxor %%mm3, %%mm3\n"
-      "pxor %%mm1, %%mm1\n"
-      "pcmpgtw %%mm4, %%mm3\n\t"
-      "pcmpgtw %%mm5, %%mm1\n\t"
-      "pxor %%mm3, %%mm4\n"
-      "pxor %%mm1, %%mm5\n"
-      "psubw %%mm3, %%mm4\n"
-      "psubw %%mm1, %%mm5\n"
-      "paddw %%mm4, %%mm5\n"
-      "paddw %%mm5, %%mm6\n"
-
-      "add %2,%0\n"
-
-      "movq (%0),%%mm4\n"
-      "movq 1(%0),%%mm1\n"
-      "movq %%mm4, %%mm5\n"
-      "movq %%mm1, %%mm3\n"
-      "punpcklbw %%mm7,%%mm4\n"
-      "punpcklbw %%mm7,%%mm1\n"
-      "punpckhbw %%mm7,%%mm5\n"
-      "punpckhbw %%mm7,%%mm3\n"
-      "psubw %%mm1, %%mm4\n"
-      "psubw %%mm3, %%mm5\n"
-      "psubw %%mm4, %%mm0\n"
-      "psubw %%mm5, %%mm2\n"
-      "pxor %%mm3, %%mm3\n"
-      "pxor %%mm1, %%mm1\n"
-      "pcmpgtw %%mm0, %%mm3\n\t"
-      "pcmpgtw %%mm2, %%mm1\n\t"
-      "pxor %%mm3, %%mm0\n"
-      "pxor %%mm1, %%mm2\n"
-      "psubw %%mm3, %%mm0\n"
-      "psubw %%mm1, %%mm2\n"
-      "paddw %%mm0, %%mm2\n"
-      "paddw %%mm2, %%mm6\n"
-
-      "add %2,%0\n"
-      "subl $2, %%ecx\n"
-      " jnz 1b\n"
-
-      "movq %%mm6, %%mm0\n"
-      "punpcklwd %%mm7,%%mm0\n"
-      "punpckhwd %%mm7,%%mm6\n"
-      "paddd %%mm0, %%mm6\n"
-
-      "movq %%mm6,%%mm0\n"
-      "psrlq $32, %%mm6\n"
-      "paddd %%mm6,%%mm0\n"
-      "movd %%mm0,%1\n"
-      : "+r" (pix1), "=r"(tmp)
-      : "r" ((x86_reg)line_size) , "g" (h-2)
-      : "%ecx");
-      return tmp + hf_noise8_mmx(pix+8, line_size, h);
-}
-
-static int nsse16_mmx(void *p, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
-    MpegEncContext *c = p;
-    int score1, score2;
-
-    if(c) score1 = c->dsp.sse[0](c, pix1, pix2, line_size, h);
-    else  score1 = sse16_mmx(c, pix1, pix2, line_size, h);
-    score2= hf_noise16_mmx(pix1, line_size, h) - hf_noise16_mmx(pix2, line_size, h);
-
-    if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
-    else  return score1 + FFABS(score2)*8;
-}
-
-static int nsse8_mmx(void *p, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
-    MpegEncContext *c = p;
-    int score1= sse8_mmx(c, pix1, pix2, line_size, h);
-    int score2= hf_noise8_mmx(pix1, line_size, h) - hf_noise8_mmx(pix2, line_size, h);
-
-    if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
-    else  return score1 + FFABS(score2)*8;
-}
-
-static int vsad_intra16_mmx(void *v, uint8_t * pix, uint8_t * dummy, int line_size, int h) {
-    int tmp;
-
-    assert( (((int)pix) & 7) == 0);
-    assert((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
-      "movq (%0), %%mm2\n"\
-      "movq 8(%0), %%mm3\n"\
-      "add %2,%0\n"\
-      "movq %%mm2, " #out0 "\n"\
-      "movq %%mm3, " #out1 "\n"\
-      "psubusb " #in0 ", %%mm2\n"\
-      "psubusb " #in1 ", %%mm3\n"\
-      "psubusb " #out0 ", " #in0 "\n"\
-      "psubusb " #out1 ", " #in1 "\n"\
-      "por %%mm2, " #in0 "\n"\
-      "por %%mm3, " #in1 "\n"\
-      "movq " #in0 ", %%mm2\n"\
-      "movq " #in1 ", %%mm3\n"\
-      "punpcklbw %%mm7, " #in0 "\n"\
-      "punpcklbw %%mm7, " #in1 "\n"\
-      "punpckhbw %%mm7, %%mm2\n"\
-      "punpckhbw %%mm7, %%mm3\n"\
-      "paddw " #in1 ", " #in0 "\n"\
-      "paddw %%mm3, %%mm2\n"\
-      "paddw %%mm2, " #in0 "\n"\
-      "paddw " #in0 ", %%mm6\n"
-
-
-  __asm__ volatile (
-      "movl %3,%%ecx\n"
-      "pxor %%mm6,%%mm6\n"
-      "pxor %%mm7,%%mm7\n"
-      "movq (%0),%%mm0\n"
-      "movq 8(%0),%%mm1\n"
-      "add %2,%0\n"
-      "jmp 2f\n"
-      "1:\n"
-
-      SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-      "2:\n"
-      SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
-      "subl $2, %%ecx\n"
-      "jnz 1b\n"
-
-      "movq %%mm6,%%mm0\n"
-      "psrlq $32, %%mm6\n"
-      "paddw %%mm6,%%mm0\n"
-      "movq %%mm0,%%mm6\n"
-      "psrlq $16, %%mm0\n"
-      "paddw %%mm6,%%mm0\n"
-      "movd %%mm0,%1\n"
-      : "+r" (pix), "=r"(tmp)
-      : "r" ((x86_reg)line_size) , "m" (h)
-      : "%ecx");
-    return tmp & 0xFFFF;
-}
-#undef SUM
-
-static int vsad_intra16_mmxext(void *v, uint8_t *pix, uint8_t *dummy,
-                               int line_size, int h)
-{
-    int tmp;
-
-    assert( (((int)pix) & 7) == 0);
-    assert((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
-      "movq (%0), " #out0 "\n"\
-      "movq 8(%0), " #out1 "\n"\
-      "add %2,%0\n"\
-      "psadbw " #out0 ", " #in0 "\n"\
-      "psadbw " #out1 ", " #in1 "\n"\
-      "paddw " #in1 ", " #in0 "\n"\
-      "paddw " #in0 ", %%mm6\n"
-
-  __asm__ volatile (
-      "movl %3,%%ecx\n"
-      "pxor %%mm6,%%mm6\n"
-      "pxor %%mm7,%%mm7\n"
-      "movq (%0),%%mm0\n"
-      "movq 8(%0),%%mm1\n"
-      "add %2,%0\n"
-      "jmp 2f\n"
-      "1:\n"
-
-      SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-      "2:\n"
-      SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
-      "subl $2, %%ecx\n"
-      "jnz 1b\n"
-
-      "movd %%mm6,%1\n"
-      : "+r" (pix), "=r"(tmp)
-      : "r" ((x86_reg)line_size) , "m" (h)
-      : "%ecx");
-    return tmp;
-}
-#undef SUM
-
-static int vsad16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
-    int tmp;
-
-    assert( (((int)pix1) & 7) == 0);
-    assert( (((int)pix2) & 7) == 0);
-    assert((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
-      "movq (%0),%%mm2\n"\
-      "movq (%1)," #out0 "\n"\
-      "movq 8(%0),%%mm3\n"\
-      "movq 8(%1)," #out1 "\n"\
-      "add %3,%0\n"\
-      "add %3,%1\n"\
-      "psubb " #out0 ", %%mm2\n"\
-      "psubb " #out1 ", %%mm3\n"\
-      "pxor %%mm7, %%mm2\n"\
-      "pxor %%mm7, %%mm3\n"\
-      "movq %%mm2, " #out0 "\n"\
-      "movq %%mm3, " #out1 "\n"\
-      "psubusb " #in0 ", %%mm2\n"\
-      "psubusb " #in1 ", %%mm3\n"\
-      "psubusb " #out0 ", " #in0 "\n"\
-      "psubusb " #out1 ", " #in1 "\n"\
-      "por %%mm2, " #in0 "\n"\
-      "por %%mm3, " #in1 "\n"\
-      "movq " #in0 ", %%mm2\n"\
-      "movq " #in1 ", %%mm3\n"\
-      "punpcklbw %%mm7, " #in0 "\n"\
-      "punpcklbw %%mm7, " #in1 "\n"\
-      "punpckhbw %%mm7, %%mm2\n"\
-      "punpckhbw %%mm7, %%mm3\n"\
-      "paddw " #in1 ", " #in0 "\n"\
-      "paddw %%mm3, %%mm2\n"\
-      "paddw %%mm2, " #in0 "\n"\
-      "paddw " #in0 ", %%mm6\n"
-
-
-  __asm__ volatile (
-      "movl %4,%%ecx\n"
-      "pxor %%mm6,%%mm6\n"
-      "pcmpeqw %%mm7,%%mm7\n"
-      "psllw $15, %%mm7\n"
-      "packsswb %%mm7, %%mm7\n"
-      "movq (%0),%%mm0\n"
-      "movq (%1),%%mm2\n"
-      "movq 8(%0),%%mm1\n"
-      "movq 8(%1),%%mm3\n"
-      "add %3,%0\n"
-      "add %3,%1\n"
-      "psubb %%mm2, %%mm0\n"
-      "psubb %%mm3, %%mm1\n"
-      "pxor %%mm7, %%mm0\n"
-      "pxor %%mm7, %%mm1\n"
-      "jmp 2f\n"
-      "1:\n"
-
-      SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-      "2:\n"
-      SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
-      "subl $2, %%ecx\n"
-      "jnz 1b\n"
-
-      "movq %%mm6,%%mm0\n"
-      "psrlq $32, %%mm6\n"
-      "paddw %%mm6,%%mm0\n"
-      "movq %%mm0,%%mm6\n"
-      "psrlq $16, %%mm0\n"
-      "paddw %%mm6,%%mm0\n"
-      "movd %%mm0,%2\n"
-      : "+r" (pix1), "+r" (pix2), "=r"(tmp)
-      : "r" ((x86_reg)line_size) , "m" (h)
-      : "%ecx");
-    return tmp & 0x7FFF;
-}
-#undef SUM
-
-static int vsad16_mmxext(void *v, uint8_t *pix1, uint8_t *pix2,
-                         int line_size, int h)
-{
-    int tmp;
-
-    assert( (((int)pix1) & 7) == 0);
-    assert( (((int)pix2) & 7) == 0);
-    assert((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
-      "movq (%0)," #out0 "\n"\
-      "movq (%1),%%mm2\n"\
-      "movq 8(%0)," #out1 "\n"\
-      "movq 8(%1),%%mm3\n"\
-      "add %3,%0\n"\
-      "add %3,%1\n"\
-      "psubb %%mm2, " #out0 "\n"\
-      "psubb %%mm3, " #out1 "\n"\
-      "pxor %%mm7, " #out0 "\n"\
-      "pxor %%mm7, " #out1 "\n"\
-      "psadbw " #out0 ", " #in0 "\n"\
-      "psadbw " #out1 ", " #in1 "\n"\
-      "paddw " #in1 ", " #in0 "\n"\
-      "paddw " #in0 ", %%mm6\n"
-
-  __asm__ volatile (
-      "movl %4,%%ecx\n"
-      "pxor %%mm6,%%mm6\n"
-      "pcmpeqw %%mm7,%%mm7\n"
-      "psllw $15, %%mm7\n"
-      "packsswb %%mm7, %%mm7\n"
-      "movq (%0),%%mm0\n"
-      "movq (%1),%%mm2\n"
-      "movq 8(%0),%%mm1\n"
-      "movq 8(%1),%%mm3\n"
-      "add %3,%0\n"
-      "add %3,%1\n"
-      "psubb %%mm2, %%mm0\n"
-      "psubb %%mm3, %%mm1\n"
-      "pxor %%mm7, %%mm0\n"
-      "pxor %%mm7, %%mm1\n"
-      "jmp 2f\n"
-      "1:\n"
-
-      SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-      "2:\n"
-      SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
-      "subl $2, %%ecx\n"
-      "jnz 1b\n"
-
-      "movd %%mm6,%2\n"
-      : "+r" (pix1), "+r" (pix2), "=r"(tmp)
-      : "r" ((x86_reg)line_size) , "m" (h)
-      : "%ecx");
-    return tmp;
-}
-#undef SUM
-
-static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
-    x86_reg i=0;
-    __asm__ volatile(
-        "1:                             \n\t"
-        "movq  (%2, %0), %%mm0          \n\t"
-        "movq  (%1, %0), %%mm1          \n\t"
-        "psubb %%mm0, %%mm1             \n\t"
-        "movq %%mm1, (%3, %0)           \n\t"
-        "movq 8(%2, %0), %%mm0          \n\t"
-        "movq 8(%1, %0), %%mm1          \n\t"
-        "psubb %%mm0, %%mm1             \n\t"
-        "movq %%mm1, 8(%3, %0)          \n\t"
-        "add $16, %0                    \n\t"
-        "cmp %4, %0                     \n\t"
-        " jb 1b                         \n\t"
-        : "+r" (i)
-        : "r"(src1), "r"(src2), "r"(dst), "r"((x86_reg)w-15)
-    );
-    for(; i<w; i++)
-        dst[i+0] = src1[i+0]-src2[i+0];
-}
-
-static void sub_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *src1,
-                                              const uint8_t *src2, int w,
-                                              int *left, int *left_top)
-{
-    x86_reg i=0;
-    uint8_t l, lt;
-
-    __asm__ volatile(
-        "movq  (%1, %0), %%mm0          \n\t" // LT
-        "psllq $8, %%mm0                \n\t"
-        "1:                             \n\t"
-        "movq  (%1, %0), %%mm1          \n\t" // T
-        "movq  -1(%2, %0), %%mm2        \n\t" // L
-        "movq  (%2, %0), %%mm3          \n\t" // X
-        "movq %%mm2, %%mm4              \n\t" // L
-        "psubb %%mm0, %%mm2             \n\t"
-        "paddb %%mm1, %%mm2             \n\t" // L + T - LT
-        "movq %%mm4, %%mm5              \n\t" // L
-        "pmaxub %%mm1, %%mm4            \n\t" // max(T, L)
-        "pminub %%mm5, %%mm1            \n\t" // min(T, L)
-        "pminub %%mm2, %%mm4            \n\t"
-        "pmaxub %%mm1, %%mm4            \n\t"
-        "psubb %%mm4, %%mm3             \n\t" // dst - pred
-        "movq %%mm3, (%3, %0)           \n\t"
-        "add $8, %0                     \n\t"
-        "movq -1(%1, %0), %%mm0         \n\t" // LT
-        "cmp %4, %0                     \n\t"
-        " jb 1b                         \n\t"
-        : "+r" (i)
-        : "r"(src1), "r"(src2), "r"(dst), "r"((x86_reg)w)
-    );
-
-    l= *left;
-    lt= *left_top;
-
-    dst[0]= src2[0] - mid_pred(l, src1[0], (l + src1[0] - lt)&0xFF);
-
-    *left_top= src1[w-1];
-    *left    = src2[w-1];
-}
-
-#define MMABS_MMX(a,z)\
-    "pxor " #z ", " #z "              \n\t"\
-    "pcmpgtw " #a ", " #z "           \n\t"\
-    "pxor " #z ", " #a "              \n\t"\
-    "psubw " #z ", " #a "             \n\t"
-
-#define MMABS_MMXEXT(a, z)                 \
-    "pxor " #z ", " #z "              \n\t"\
-    "psubw " #a ", " #z "             \n\t"\
-    "pmaxsw " #z ", " #a "            \n\t"
-
-#define MMABS_SSSE3(a,z)\
-    "pabsw " #a ", " #a "             \n\t"
-
-#define MMABS_SUM(a,z, sum)\
-    MMABS(a,z)\
-    "paddusw " #a ", " #sum "         \n\t"
-
-/* FIXME: HSUM_* saturates at 64k, while an 8x8 hadamard or dct block can get up to
- * about 100k on extreme inputs. But that's very unlikely to occur in natural video,
- * and it's even more unlikely to not have any alternative mvs/modes with lower cost. */
-#define HSUM_MMX(a, t, dst)\
-    "movq "#a", "#t"                  \n\t"\
-    "psrlq $32, "#a"                  \n\t"\
-    "paddusw "#t", "#a"               \n\t"\
-    "movq "#a", "#t"                  \n\t"\
-    "psrlq $16, "#a"                  \n\t"\
-    "paddusw "#t", "#a"               \n\t"\
-    "movd "#a", "#dst"                \n\t"\
-
-#define HSUM_MMXEXT(a, t, dst)             \
-    "pshufw $0x0E, "#a", "#t"         \n\t"\
-    "paddusw "#t", "#a"               \n\t"\
-    "pshufw $0x01, "#a", "#t"         \n\t"\
-    "paddusw "#t", "#a"               \n\t"\
-    "movd "#a", "#dst"                \n\t"\
-
-#define HSUM_SSE2(a, t, dst)\
-    "movhlps "#a", "#t"               \n\t"\
-    "paddusw "#t", "#a"               \n\t"\
-    "pshuflw $0x0E, "#a", "#t"        \n\t"\
-    "paddusw "#t", "#a"               \n\t"\
-    "pshuflw $0x01, "#a", "#t"        \n\t"\
-    "paddusw "#t", "#a"               \n\t"\
-    "movd "#a", "#dst"                \n\t"\
-
-#define DCT_SAD4(m,mm,o)\
-    "mov"#m" "#o"+ 0(%1), "#mm"2      \n\t"\
-    "mov"#m" "#o"+16(%1), "#mm"3      \n\t"\
-    "mov"#m" "#o"+32(%1), "#mm"4      \n\t"\
-    "mov"#m" "#o"+48(%1), "#mm"5      \n\t"\
-    MMABS_SUM(mm##2, mm##6, mm##0)\
-    MMABS_SUM(mm##3, mm##7, mm##1)\
-    MMABS_SUM(mm##4, mm##6, mm##0)\
-    MMABS_SUM(mm##5, mm##7, mm##1)\
-
-#define DCT_SAD_MMX\
-    "pxor %%mm0, %%mm0                \n\t"\
-    "pxor %%mm1, %%mm1                \n\t"\
-    DCT_SAD4(q, %%mm, 0)\
-    DCT_SAD4(q, %%mm, 8)\
-    DCT_SAD4(q, %%mm, 64)\
-    DCT_SAD4(q, %%mm, 72)\
-    "paddusw %%mm1, %%mm0             \n\t"\
-    HSUM(%%mm0, %%mm1, %0)
-
-#define DCT_SAD_SSE2\
-    "pxor %%xmm0, %%xmm0              \n\t"\
-    "pxor %%xmm1, %%xmm1              \n\t"\
-    DCT_SAD4(dqa, %%xmm, 0)\
-    DCT_SAD4(dqa, %%xmm, 64)\
-    "paddusw %%xmm1, %%xmm0           \n\t"\
-    HSUM(%%xmm0, %%xmm1, %0)
-
-#define DCT_SAD_FUNC(cpu) \
-static int sum_abs_dctelem_##cpu(int16_t *block){\
-    int sum;\
-    __asm__ volatile(\
-        DCT_SAD\
-        :"=r"(sum)\
-        :"r"(block)\
-    );\
-    return sum&0xFFFF;\
-}
-
-#define DCT_SAD       DCT_SAD_MMX
-#define HSUM(a,t,dst) HSUM_MMX(a,t,dst)
-#define MMABS(a,z)    MMABS_MMX(a,z)
-DCT_SAD_FUNC(mmx)
-#undef MMABS
-#undef HSUM
-
-#define HSUM(a,t,dst) HSUM_MMXEXT(a,t,dst)
-#define MMABS(a,z)    MMABS_MMXEXT(a,z)
-DCT_SAD_FUNC(mmxext)
-#undef HSUM
-#undef DCT_SAD
-
-#define DCT_SAD       DCT_SAD_SSE2
-#define HSUM(a,t,dst) HSUM_SSE2(a,t,dst)
-DCT_SAD_FUNC(sse2)
-#undef MMABS
-
-#if HAVE_SSSE3_INLINE
-#define MMABS(a,z)    MMABS_SSSE3(a,z)
-DCT_SAD_FUNC(ssse3)
-#undef MMABS
-#endif
-#undef HSUM
-#undef DCT_SAD
-
-static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int size){
-    int sum;
-    x86_reg i=size;
-    __asm__ volatile(
-        "pxor %%mm4, %%mm4 \n"
-        "1: \n"
-        "sub $8, %0 \n"
-        "movq (%2,%0), %%mm2 \n"
-        "movq (%3,%0,2), %%mm0 \n"
-        "movq 8(%3,%0,2), %%mm1 \n"
-        "punpckhbw %%mm2, %%mm3 \n"
-        "punpcklbw %%mm2, %%mm2 \n"
-        "psraw $8, %%mm3 \n"
-        "psraw $8, %%mm2 \n"
-        "psubw %%mm3, %%mm1 \n"
-        "psubw %%mm2, %%mm0 \n"
-        "pmaddwd %%mm1, %%mm1 \n"
-        "pmaddwd %%mm0, %%mm0 \n"
-        "paddd %%mm1, %%mm4 \n"
-        "paddd %%mm0, %%mm4 \n"
-        "jg 1b \n"
-        "movq %%mm4, %%mm3 \n"
-        "psrlq $32, %%mm3 \n"
-        "paddd %%mm3, %%mm4 \n"
-        "movd %%mm4, %1 \n"
-        :"+r"(i), "=r"(sum)
-        :"r"(pix1), "r"(pix2)
-    );
-    return sum;
-}
-
-#define PHADDD(a, t)\
-    "movq "#a", "#t"                  \n\t"\
-    "psrlq $32, "#a"                  \n\t"\
-    "paddd "#t", "#a"                 \n\t"
-/*
-   pmulhw: dst[0-15]=(src[0-15]*dst[0-15])[16-31]
-   pmulhrw: dst[0-15]=(src[0-15]*dst[0-15] + 0x8000)[16-31]
-   pmulhrsw: dst[0-15]=(src[0-15]*dst[0-15] + 0x4000)[15-30]
- */
-#define PMULHRW(x, y, s, o)\
-    "pmulhw " #s ", "#x "            \n\t"\
-    "pmulhw " #s ", "#y "            \n\t"\
-    "paddw " #o ", "#x "             \n\t"\
-    "paddw " #o ", "#y "             \n\t"\
-    "psraw $1, "#x "                 \n\t"\
-    "psraw $1, "#y "                 \n\t"
-#define DEF(x) x ## _mmx
-#define SET_RND MOVQ_WONE
-#define SCALE_OFFSET 1
-
-#include "dsputil_qns_template.c"
-
-#undef DEF
-#undef SET_RND
-#undef SCALE_OFFSET
-#undef PMULHRW
-
-#define DEF(x) x ## _3dnow
-#define SET_RND(x)
-#define SCALE_OFFSET 0
-#define PMULHRW(x, y, s, o)\
-    "pmulhrw " #s ", "#x "           \n\t"\
-    "pmulhrw " #s ", "#y "           \n\t"
-
-#include "dsputil_qns_template.c"
-
-#undef DEF
-#undef SET_RND
-#undef SCALE_OFFSET
-#undef PMULHRW
-
-#if HAVE_SSSE3_INLINE
-#undef PHADDD
-#define DEF(x) x ## _ssse3
-#define SET_RND(x)
-#define SCALE_OFFSET -1
-#define PHADDD(a, t)\
-    "pshufw $0x0E, "#a", "#t"         \n\t"\
-    "paddd "#t", "#a"                 \n\t" /* faster than phaddd on core2 */
-#define PMULHRW(x, y, s, o)\
-    "pmulhrsw " #s ", "#x "          \n\t"\
-    "pmulhrsw " #s ", "#y "          \n\t"
-
-#include "dsputil_qns_template.c"
-
-#undef DEF
-#undef SET_RND
-#undef SCALE_OFFSET
-#undef PMULHRW
-#undef PHADDD
-#endif /* HAVE_SSSE3_INLINE */
-
-#endif /* HAVE_INLINE_ASM */
-
-int ff_sse16_sse2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
-
-#define hadamard_func(cpu) \
-int ff_hadamard8_diff_##cpu  (void *s, uint8_t *src1, uint8_t *src2, \
-                              int stride, int h); \
-int ff_hadamard8_diff16_##cpu(void *s, uint8_t *src1, uint8_t *src2, \
-                              int stride, int h);
-
-hadamard_func(mmx)
-hadamard_func(mmxext)
-hadamard_func(sse2)
-hadamard_func(ssse3)
-
-av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
-{
-    int cpu_flags = av_get_cpu_flags();
-    const int dct_algo = avctx->dct_algo;
-
-#if HAVE_YASM
-    int bit_depth = avctx->bits_per_raw_sample;
-
-    if (EXTERNAL_MMX(cpu_flags)) {
-        if (bit_depth <= 8)
-            c->get_pixels = ff_get_pixels_mmx;
-        c->diff_pixels = ff_diff_pixels_mmx;
-        c->pix_sum = ff_pix_sum16_mmx;
-
-        c->pix_norm1 = ff_pix_norm1_mmx;
-    }
-    if (EXTERNAL_SSE2(cpu_flags))
-        if (bit_depth <= 8)
-            c->get_pixels = ff_get_pixels_sse2;
-#endif /* HAVE_YASM */
-
-#if HAVE_INLINE_ASM
-    if (INLINE_MMX(cpu_flags)) {
-        if (avctx->bits_per_raw_sample <= 8 &&
-            (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
-            c->fdct = ff_fdct_mmx;
-
-        c->diff_bytes= diff_bytes_mmx;
-        c->sum_abs_dctelem= sum_abs_dctelem_mmx;
-
-        c->sse[0] = sse16_mmx;
-        c->sse[1] = sse8_mmx;
-        c->vsad[4]= vsad_intra16_mmx;
-
-        c->nsse[0] = nsse16_mmx;
-        c->nsse[1] = nsse8_mmx;
-        if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
-            c->vsad[0] = vsad16_mmx;
-        }
-
-        if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
-            c->try_8x8basis= try_8x8basis_mmx;
-        }
-        c->add_8x8basis= add_8x8basis_mmx;
-
-        c->ssd_int8_vs_int16 = ssd_int8_vs_int16_mmx;
-    }
-
-    if (INLINE_AMD3DNOW(cpu_flags)) {
-        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
-            c->try_8x8basis = try_8x8basis_3dnow;
-        }
-        c->add_8x8basis = add_8x8basis_3dnow;
-    }
-
-    if (INLINE_MMXEXT(cpu_flags)) {
-        if (avctx->bits_per_raw_sample <= 8 &&
-            (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
-            c->fdct = ff_fdct_mmxext;
-
-        c->sum_abs_dctelem = sum_abs_dctelem_mmxext;
-        c->vsad[4]         = vsad_intra16_mmxext;
-
-        if (!(avctx->flags & CODEC_FLAG_BITEXACT)){
-            c->vsad[0] = vsad16_mmxext;
-        }
-
-        c->sub_hfyu_median_prediction = sub_hfyu_median_prediction_mmxext;
-    }
-
-    if (INLINE_SSE2(cpu_flags)) {
-        if (avctx->bits_per_raw_sample <= 8 &&
-            (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
-            c->fdct = ff_fdct_sse2;
-
-        c->sum_abs_dctelem= sum_abs_dctelem_sse2;
-    }
-
-#if HAVE_SSSE3_INLINE
-    if (INLINE_SSSE3(cpu_flags)) {
-        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
-            c->try_8x8basis = try_8x8basis_ssse3;
-        }
-        c->add_8x8basis    = add_8x8basis_ssse3;
-        c->sum_abs_dctelem = sum_abs_dctelem_ssse3;
-    }
-#endif
-#endif /* HAVE_INLINE_ASM */
-
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->hadamard8_diff[0] = ff_hadamard8_diff16_mmx;
-        c->hadamard8_diff[1] = ff_hadamard8_diff_mmx;
-    }
-
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        c->hadamard8_diff[0] = ff_hadamard8_diff16_mmxext;
-        c->hadamard8_diff[1] = ff_hadamard8_diff_mmxext;
-    }
-
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        c->sse[0] = ff_sse16_sse2;
-
-#if HAVE_ALIGNED_STACK
-        c->hadamard8_diff[0] = ff_hadamard8_diff16_sse2;
-        c->hadamard8_diff[1] = ff_hadamard8_diff_sse2;
-#endif
-    }
-
-    if (EXTERNAL_SSSE3(cpu_flags) && HAVE_ALIGNED_STACK) {
-        c->hadamard8_diff[0] = ff_hadamard8_diff16_ssse3;
-        c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
-    }
-
-    ff_dsputil_init_pix_mmx(c, avctx);
-}
diff --git a/deps/libav/libavcodec/x86/fdct.c b/deps/libav/libavcodec/x86/fdct.c
deleted file mode 100644
index 6d595aa..0000000
--- a/deps/libav/libavcodec/x86/fdct.c
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- * MMX optimized forward DCT
- * The gcc porting is Copyright (c) 2001 Fabrice Bellard.
- * cleanup/optimizations are Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- * SSE2 optimization is Copyright (c) 2004 Denes Balatoni.
- *
- * from  fdctam32.c - AP922 MMX(3D-Now) forward-DCT
- *
- *  Intel Application Note AP-922 - fast, precise implementation of DCT
- *        http://developer.intel.com/vtune/cbts/appnotes.htm
- *
- * Also of inspiration:
- * a page about fdct at http://www.geocities.com/ssavekar/dct.htm
- * Skal's fdct at http://skal.planet-d.net/coding/dct.html
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/x86/asm.h"
-#include "libavcodec/dct.h"
-
-#if HAVE_MMX_INLINE
-
-//////////////////////////////////////////////////////////////////////
-//
-// constants for the forward DCT
-// -----------------------------
-//
-// Be sure to check that your compiler is aligning all constants to QWORD
-// (8-byte) memory boundaries!  Otherwise the unaligned memory access will
-// severely stall MMX execution.
-//
-//////////////////////////////////////////////////////////////////////
-
-#define BITS_FRW_ACC   3 //; 2 or 3 for accuracy
-#define SHIFT_FRW_COL  BITS_FRW_ACC
-#define SHIFT_FRW_ROW  (BITS_FRW_ACC + 17 - 3)
-#define RND_FRW_ROW    (1 << (SHIFT_FRW_ROW-1))
-//#define RND_FRW_COL    (1 << (SHIFT_FRW_COL-1))
-
-#define X8(x) x,x,x,x,x,x,x,x
-
-//concatenated table, for forward DCT transformation
-DECLARE_ALIGNED(16, static const int16_t, fdct_tg_all_16)[24] = {
-    X8(13036),  // tg * (2<<16) + 0.5
-    X8(27146),  // tg * (2<<16) + 0.5
-    X8(-21746)  // tg * (2<<16) + 0.5
-};
-
-DECLARE_ALIGNED(16, static const int16_t, ocos_4_16)[8] = {
-    X8(23170)   //cos * (2<<15) + 0.5
-};
-
-DECLARE_ALIGNED(16, static const int16_t, fdct_one_corr)[8] = { X8(1) };
-
-DECLARE_ALIGNED(8, static const int32_t, fdct_r_row)[2] = {RND_FRW_ROW, RND_FRW_ROW };
-
-static struct
-{
- DECLARE_ALIGNED(16, const int32_t, fdct_r_row_sse2)[4];
-} fdct_r_row_sse2 =
-{{
- RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW
-}};
-//DECLARE_ALIGNED(16, static const long, fdct_r_row_sse2)[4] = {RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW};
-
-DECLARE_ALIGNED(8, static const int16_t, tab_frw_01234567)[] = {  // forward_dct coeff table
-  16384,   16384,   22725,   19266,
-  16384,   16384,   12873,    4520,
-  21407,    8867,   19266,   -4520,
-  -8867,  -21407,  -22725,  -12873,
-  16384,  -16384,   12873,  -22725,
- -16384,   16384,    4520,   19266,
-   8867,  -21407,    4520,  -12873,
-  21407,   -8867,   19266,  -22725,
-
-  22725,   22725,   31521,   26722,
-  22725,   22725,   17855,    6270,
-  29692,   12299,   26722,   -6270,
- -12299,  -29692,  -31521,  -17855,
-  22725,  -22725,   17855,  -31521,
- -22725,   22725,    6270,   26722,
-  12299,  -29692,    6270,  -17855,
-  29692,  -12299,   26722,  -31521,
-
-  21407,   21407,   29692,   25172,
-  21407,   21407,   16819,    5906,
-  27969,   11585,   25172,   -5906,
- -11585,  -27969,  -29692,  -16819,
-  21407,  -21407,   16819,  -29692,
- -21407,   21407,    5906,   25172,
-  11585,  -27969,    5906,  -16819,
-  27969,  -11585,   25172,  -29692,
-
-  19266,   19266,   26722,   22654,
-  19266,   19266,   15137,    5315,
-  25172,   10426,   22654,   -5315,
- -10426,  -25172,  -26722,  -15137,
-  19266,  -19266,   15137,  -26722,
- -19266,   19266,    5315,   22654,
-  10426,  -25172,    5315,  -15137,
-  25172,  -10426,   22654,  -26722,
-
-  16384,   16384,   22725,   19266,
-  16384,   16384,   12873,    4520,
-  21407,    8867,   19266,   -4520,
-  -8867,  -21407,  -22725,  -12873,
-  16384,  -16384,   12873,  -22725,
- -16384,   16384,    4520,   19266,
-   8867,  -21407,    4520,  -12873,
-  21407,   -8867,   19266,  -22725,
-
-  19266,   19266,   26722,   22654,
-  19266,   19266,   15137,    5315,
-  25172,   10426,   22654,   -5315,
- -10426,  -25172,  -26722,  -15137,
-  19266,  -19266,   15137,  -26722,
- -19266,   19266,    5315,   22654,
-  10426,  -25172,    5315,  -15137,
-  25172,  -10426,   22654,  -26722,
-
-  21407,   21407,   29692,   25172,
-  21407,   21407,   16819,    5906,
-  27969,   11585,   25172,   -5906,
- -11585,  -27969,  -29692,  -16819,
-  21407,  -21407,   16819,  -29692,
- -21407,   21407,    5906,   25172,
-  11585,  -27969,    5906,  -16819,
-  27969,  -11585,   25172,  -29692,
-
-  22725,   22725,   31521,   26722,
-  22725,   22725,   17855,    6270,
-  29692,   12299,   26722,   -6270,
- -12299,  -29692,  -31521,  -17855,
-  22725,  -22725,   17855,  -31521,
- -22725,   22725,    6270,   26722,
-  12299,  -29692,    6270,  -17855,
-  29692,  -12299,   26722,  -31521,
-};
-
-static struct
-{
- DECLARE_ALIGNED(16, const int16_t, tab_frw_01234567_sse2)[256];
-} tab_frw_01234567_sse2 =
-{{
-//DECLARE_ALIGNED(16, static const int16_t, tab_frw_01234567_sse2)[] = {  // forward_dct coeff table
-#define TABLE_SSE2 C4,  C4,  C1,  C3, -C6, -C2, -C1, -C5, \
-                   C4,  C4,  C5,  C7,  C2,  C6,  C3, -C7, \
-                  -C4,  C4,  C7,  C3,  C6, -C2,  C7, -C5, \
-                   C4, -C4,  C5, -C1,  C2, -C6,  C3, -C1,
-// c1..c7 * cos(pi/4) * 2^15
-#define C1 22725
-#define C2 21407
-#define C3 19266
-#define C4 16384
-#define C5 12873
-#define C6 8867
-#define C7 4520
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 31521
-#define C2 29692
-#define C3 26722
-#define C4 22725
-#define C5 17855
-#define C6 12299
-#define C7 6270
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 29692
-#define C2 27969
-#define C3 25172
-#define C4 21407
-#define C5 16819
-#define C6 11585
-#define C7 5906
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 26722
-#define C2 25172
-#define C3 22654
-#define C4 19266
-#define C5 15137
-#define C6 10426
-#define C7 5315
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 22725
-#define C2 21407
-#define C3 19266
-#define C4 16384
-#define C5 12873
-#define C6 8867
-#define C7 4520
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 26722
-#define C2 25172
-#define C3 22654
-#define C4 19266
-#define C5 15137
-#define C6 10426
-#define C7 5315
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 29692
-#define C2 27969
-#define C3 25172
-#define C4 21407
-#define C5 16819
-#define C6 11585
-#define C7 5906
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 31521
-#define C2 29692
-#define C3 26722
-#define C4 22725
-#define C5 17855
-#define C6 12299
-#define C7 6270
-TABLE_SSE2
-}};
-
-#define S(s) AV_TOSTRING(s) //AV_STRINGIFY is too long
-
-#define FDCT_COL(cpu, mm, mov)\
-static av_always_inline void fdct_col_##cpu(const int16_t *in, int16_t *out, int offset)\
-{\
-    __asm__ volatile (\
-        #mov"      16(%0),  %%"#mm"0 \n\t" \
-        #mov"      96(%0),  %%"#mm"1 \n\t" \
-        #mov"    %%"#mm"0,  %%"#mm"2 \n\t" \
-        #mov"      32(%0),  %%"#mm"3 \n\t" \
-        "paddsw  %%"#mm"1,  %%"#mm"0 \n\t" \
-        #mov"      80(%0),  %%"#mm"4 \n\t" \
-        "psllw  $"S(SHIFT_FRW_COL)", %%"#mm"0 \n\t" \
-        #mov"        (%0),  %%"#mm"5 \n\t" \
-        "paddsw  %%"#mm"3,  %%"#mm"4 \n\t" \
-        "paddsw   112(%0),  %%"#mm"5 \n\t" \
-        "psllw  $"S(SHIFT_FRW_COL)", %%"#mm"4 \n\t" \
-        #mov"    %%"#mm"0,  %%"#mm"6 \n\t" \
-        "psubsw  %%"#mm"1,  %%"#mm"2 \n\t" \
-        #mov"      16(%1),  %%"#mm"1 \n\t" \
-        "psubsw  %%"#mm"4,  %%"#mm"0 \n\t" \
-        #mov"      48(%0),  %%"#mm"7 \n\t" \
-        "pmulhw  %%"#mm"0,  %%"#mm"1 \n\t" \
-        "paddsw    64(%0),  %%"#mm"7 \n\t" \
-        "psllw  $"S(SHIFT_FRW_COL)", %%"#mm"5 \n\t" \
-        "paddsw  %%"#mm"4,  %%"#mm"6 \n\t" \
-        "psllw  $"S(SHIFT_FRW_COL)", %%"#mm"7 \n\t" \
-        #mov"    %%"#mm"5,  %%"#mm"4 \n\t" \
-        "psubsw  %%"#mm"7,  %%"#mm"5 \n\t" \
-        "paddsw  %%"#mm"5,  %%"#mm"1 \n\t" \
-        "paddsw  %%"#mm"7,  %%"#mm"4 \n\t" \
-        "por         (%2),  %%"#mm"1 \n\t" \
-        "psllw  $"S(SHIFT_FRW_COL)"+1, %%"#mm"2 \n\t" \
-        "pmulhw    16(%1),  %%"#mm"5 \n\t" \
-        #mov"    %%"#mm"4,  %%"#mm"7 \n\t" \
-        "psubsw    80(%0),  %%"#mm"3 \n\t" \
-        "psubsw  %%"#mm"6,  %%"#mm"4 \n\t" \
-        #mov"    %%"#mm"1,    32(%3) \n\t" \
-        "paddsw  %%"#mm"6,  %%"#mm"7 \n\t" \
-        #mov"      48(%0),  %%"#mm"1 \n\t" \
-        "psllw  $"S(SHIFT_FRW_COL)"+1, %%"#mm"3 \n\t" \
-        "psubsw    64(%0),  %%"#mm"1 \n\t" \
-        #mov"    %%"#mm"2,  %%"#mm"6 \n\t" \
-        #mov"    %%"#mm"4,    64(%3) \n\t" \
-        "paddsw  %%"#mm"3,  %%"#mm"2 \n\t" \
-        "pmulhw      (%4),  %%"#mm"2 \n\t" \
-        "psubsw  %%"#mm"3,  %%"#mm"6 \n\t" \
-        "pmulhw      (%4),  %%"#mm"6 \n\t" \
-        "psubsw  %%"#mm"0,  %%"#mm"5 \n\t" \
-        "por         (%2),  %%"#mm"5 \n\t" \
-        "psllw  $"S(SHIFT_FRW_COL)", %%"#mm"1 \n\t" \
-        "por         (%2),  %%"#mm"2 \n\t" \
-        #mov"    %%"#mm"1,  %%"#mm"4 \n\t" \
-        #mov"        (%0),  %%"#mm"3 \n\t" \
-        "paddsw  %%"#mm"6,  %%"#mm"1 \n\t" \
-        "psubsw   112(%0),  %%"#mm"3 \n\t" \
-        "psubsw  %%"#mm"6,  %%"#mm"4 \n\t" \
-        #mov"        (%1),  %%"#mm"0 \n\t" \
-        "psllw  $"S(SHIFT_FRW_COL)", %%"#mm"3 \n\t" \
-        #mov"      32(%1),  %%"#mm"6 \n\t" \
-        "pmulhw  %%"#mm"1,  %%"#mm"0 \n\t" \
-        #mov"    %%"#mm"7,      (%3) \n\t" \
-        "pmulhw  %%"#mm"4,  %%"#mm"6 \n\t" \
-        #mov"    %%"#mm"5,    96(%3) \n\t" \
-        #mov"    %%"#mm"3,  %%"#mm"7 \n\t" \
-        #mov"      32(%1),  %%"#mm"5 \n\t" \
-        "psubsw  %%"#mm"2,  %%"#mm"7 \n\t" \
-        "paddsw  %%"#mm"2,  %%"#mm"3 \n\t" \
-        "pmulhw  %%"#mm"7,  %%"#mm"5 \n\t" \
-        "paddsw  %%"#mm"3,  %%"#mm"0 \n\t" \
-        "paddsw  %%"#mm"4,  %%"#mm"6 \n\t" \
-        "pmulhw      (%1),  %%"#mm"3 \n\t" \
-        "por         (%2),  %%"#mm"0 \n\t" \
-        "paddsw  %%"#mm"7,  %%"#mm"5 \n\t" \
-        "psubsw  %%"#mm"6,  %%"#mm"7 \n\t" \
-        #mov"    %%"#mm"0,    16(%3) \n\t" \
-        "paddsw  %%"#mm"4,  %%"#mm"5 \n\t" \
-        #mov"    %%"#mm"7,    48(%3) \n\t" \
-        "psubsw  %%"#mm"1,  %%"#mm"3 \n\t" \
-        #mov"    %%"#mm"5,    80(%3) \n\t" \
-        #mov"    %%"#mm"3,   112(%3) \n\t" \
-        : \
-        : "r" (in  + offset), "r" (fdct_tg_all_16), "r" (fdct_one_corr), \
-          "r" (out + offset), "r" (ocos_4_16)); \
-}
-
-FDCT_COL(mmx, mm, movq)
-FDCT_COL(sse2, xmm, movdqa)
-
-static av_always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
-{
-    __asm__ volatile(
-#define FDCT_ROW_SSE2_H1(i,t)                    \
-        "movq      " #i "(%0), %%xmm2      \n\t" \
-        "movq      " #i "+8(%0), %%xmm0    \n\t" \
-        "movdqa    " #t "+32(%1), %%xmm3   \n\t" \
-        "movdqa    " #t "+48(%1), %%xmm7   \n\t" \
-        "movdqa    " #t "(%1), %%xmm4      \n\t" \
-        "movdqa    " #t "+16(%1), %%xmm5   \n\t"
-
-#define FDCT_ROW_SSE2_H2(i,t)                    \
-        "movq      " #i "(%0), %%xmm2      \n\t" \
-        "movq      " #i "+8(%0), %%xmm0    \n\t" \
-        "movdqa    " #t "+32(%1), %%xmm3   \n\t" \
-        "movdqa    " #t "+48(%1), %%xmm7   \n\t"
-
-#define FDCT_ROW_SSE2(i)                      \
-        "movq      %%xmm2, %%xmm1       \n\t" \
-        "pshuflw   $27, %%xmm0, %%xmm0  \n\t" \
-        "paddsw    %%xmm0, %%xmm1       \n\t" \
-        "psubsw    %%xmm0, %%xmm2       \n\t" \
-        "punpckldq %%xmm2, %%xmm1       \n\t" \
-        "pshufd    $78, %%xmm1, %%xmm2  \n\t" \
-        "pmaddwd   %%xmm2, %%xmm3       \n\t" \
-        "pmaddwd   %%xmm1, %%xmm7       \n\t" \
-        "pmaddwd   %%xmm5, %%xmm2       \n\t" \
-        "pmaddwd   %%xmm4, %%xmm1       \n\t" \
-        "paddd     %%xmm7, %%xmm3       \n\t" \
-        "paddd     %%xmm2, %%xmm1       \n\t" \
-        "paddd     %%xmm6, %%xmm3       \n\t" \
-        "paddd     %%xmm6, %%xmm1       \n\t" \
-        "psrad     %3, %%xmm3           \n\t" \
-        "psrad     %3, %%xmm1           \n\t" \
-        "packssdw  %%xmm3, %%xmm1       \n\t" \
-        "movdqa    %%xmm1, " #i "(%4)   \n\t"
-
-        "movdqa    (%2), %%xmm6         \n\t"
-        FDCT_ROW_SSE2_H1(0,0)
-        FDCT_ROW_SSE2(0)
-        FDCT_ROW_SSE2_H2(64,0)
-        FDCT_ROW_SSE2(64)
-
-        FDCT_ROW_SSE2_H1(16,64)
-        FDCT_ROW_SSE2(16)
-        FDCT_ROW_SSE2_H2(112,64)
-        FDCT_ROW_SSE2(112)
-
-        FDCT_ROW_SSE2_H1(32,128)
-        FDCT_ROW_SSE2(32)
-        FDCT_ROW_SSE2_H2(96,128)
-        FDCT_ROW_SSE2(96)
-
-        FDCT_ROW_SSE2_H1(48,192)
-        FDCT_ROW_SSE2(48)
-        FDCT_ROW_SSE2_H2(80,192)
-        FDCT_ROW_SSE2(80)
-        :
-        : "r" (in), "r" (tab_frw_01234567_sse2.tab_frw_01234567_sse2),
-          "r" (fdct_r_row_sse2.fdct_r_row_sse2), "i" (SHIFT_FRW_ROW), "r" (out)
-          XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
-                            "%xmm4", "%xmm5", "%xmm6", "%xmm7")
-    );
-}
-
-static av_always_inline void fdct_row_mmxext(const int16_t *in, int16_t *out,
-                                             const int16_t *table)
-{
-    __asm__ volatile (
-        "pshufw    $0x1B, 8(%0), %%mm5 \n\t"
-        "movq       (%0), %%mm0 \n\t"
-        "movq      %%mm0, %%mm1 \n\t"
-        "paddsw    %%mm5, %%mm0 \n\t"
-        "psubsw    %%mm5, %%mm1 \n\t"
-        "movq      %%mm0, %%mm2 \n\t"
-        "punpckldq %%mm1, %%mm0 \n\t"
-        "punpckhdq %%mm1, %%mm2 \n\t"
-        "movq       (%1), %%mm1 \n\t"
-        "movq      8(%1), %%mm3 \n\t"
-        "movq     16(%1), %%mm4 \n\t"
-        "movq     24(%1), %%mm5 \n\t"
-        "movq     32(%1), %%mm6 \n\t"
-        "movq     40(%1), %%mm7 \n\t"
-        "pmaddwd   %%mm0, %%mm1 \n\t"
-        "pmaddwd   %%mm2, %%mm3 \n\t"
-        "pmaddwd   %%mm0, %%mm4 \n\t"
-        "pmaddwd   %%mm2, %%mm5 \n\t"
-        "pmaddwd   %%mm0, %%mm6 \n\t"
-        "pmaddwd   %%mm2, %%mm7 \n\t"
-        "pmaddwd  48(%1), %%mm0 \n\t"
-        "pmaddwd  56(%1), %%mm2 \n\t"
-        "paddd     %%mm1, %%mm3 \n\t"
-        "paddd     %%mm4, %%mm5 \n\t"
-        "paddd     %%mm6, %%mm7 \n\t"
-        "paddd     %%mm0, %%mm2 \n\t"
-        "movq       (%2), %%mm0 \n\t"
-        "paddd     %%mm0, %%mm3 \n\t"
-        "paddd     %%mm0, %%mm5 \n\t"
-        "paddd     %%mm0, %%mm7 \n\t"
-        "paddd     %%mm0, %%mm2 \n\t"
-        "psrad $"S(SHIFT_FRW_ROW)", %%mm3 \n\t"
-        "psrad $"S(SHIFT_FRW_ROW)", %%mm5 \n\t"
-        "psrad $"S(SHIFT_FRW_ROW)", %%mm7 \n\t"
-        "psrad $"S(SHIFT_FRW_ROW)", %%mm2 \n\t"
-        "packssdw  %%mm5, %%mm3 \n\t"
-        "packssdw  %%mm2, %%mm7 \n\t"
-        "movq      %%mm3,  (%3) \n\t"
-        "movq      %%mm7, 8(%3) \n\t"
-        :
-        : "r" (in), "r" (table), "r" (fdct_r_row), "r" (out));
-}
-
-static av_always_inline void fdct_row_mmx(const int16_t *in, int16_t *out, const int16_t *table)
-{
-    //FIXME reorder (I do not have an old MMX-only CPU here to benchmark ...)
-    __asm__ volatile(
-        "movd     12(%0), %%mm1 \n\t"
-        "punpcklwd 8(%0), %%mm1 \n\t"
-        "movq      %%mm1, %%mm2 \n\t"
-        "psrlq     $0x20, %%mm1 \n\t"
-        "movq      0(%0), %%mm0 \n\t"
-        "punpcklwd %%mm2, %%mm1 \n\t"
-        "movq      %%mm0, %%mm5 \n\t"
-        "paddsw    %%mm1, %%mm0 \n\t"
-        "psubsw    %%mm1, %%mm5 \n\t"
-        "movq      %%mm0, %%mm2 \n\t"
-        "punpckldq %%mm5, %%mm0 \n\t"
-        "punpckhdq %%mm5, %%mm2 \n\t"
-        "movq      0(%1), %%mm1 \n\t"
-        "movq      8(%1), %%mm3 \n\t"
-        "movq     16(%1), %%mm4 \n\t"
-        "movq     24(%1), %%mm5 \n\t"
-        "movq     32(%1), %%mm6 \n\t"
-        "movq     40(%1), %%mm7 \n\t"
-        "pmaddwd   %%mm0, %%mm1 \n\t"
-        "pmaddwd   %%mm2, %%mm3 \n\t"
-        "pmaddwd   %%mm0, %%mm4 \n\t"
-        "pmaddwd   %%mm2, %%mm5 \n\t"
-        "pmaddwd   %%mm0, %%mm6 \n\t"
-        "pmaddwd   %%mm2, %%mm7 \n\t"
-        "pmaddwd  48(%1), %%mm0 \n\t"
-        "pmaddwd  56(%1), %%mm2 \n\t"
-        "paddd     %%mm1, %%mm3 \n\t"
-        "paddd     %%mm4, %%mm5 \n\t"
-        "paddd     %%mm6, %%mm7 \n\t"
-        "paddd     %%mm0, %%mm2 \n\t"
-        "movq       (%2), %%mm0 \n\t"
-        "paddd     %%mm0, %%mm3 \n\t"
-        "paddd     %%mm0, %%mm5 \n\t"
-        "paddd     %%mm0, %%mm7 \n\t"
-        "paddd     %%mm0, %%mm2 \n\t"
-        "psrad $"S(SHIFT_FRW_ROW)", %%mm3 \n\t"
-        "psrad $"S(SHIFT_FRW_ROW)", %%mm5 \n\t"
-        "psrad $"S(SHIFT_FRW_ROW)", %%mm7 \n\t"
-        "psrad $"S(SHIFT_FRW_ROW)", %%mm2 \n\t"
-        "packssdw  %%mm5, %%mm3 \n\t"
-        "packssdw  %%mm2, %%mm7 \n\t"
-        "movq      %%mm3, 0(%3) \n\t"
-        "movq      %%mm7, 8(%3) \n\t"
-        :
-        : "r" (in), "r" (table), "r" (fdct_r_row), "r" (out));
-}
-
-void ff_fdct_mmx(int16_t *block)
-{
-    DECLARE_ALIGNED(8, int64_t, align_tmp)[16];
-    int16_t * block1= (int16_t*)align_tmp;
-    const int16_t *table= tab_frw_01234567;
-    int i;
-
-    fdct_col_mmx(block, block1, 0);
-    fdct_col_mmx(block, block1, 4);
-
-    for(i=8;i>0;i--) {
-        fdct_row_mmx(block1, block, table);
-        block1 += 8;
-        table += 32;
-        block += 8;
-    }
-}
-
-#endif /* HAVE_MMX_INLINE */
-
-#if HAVE_MMXEXT_INLINE
-
-void ff_fdct_mmxext(int16_t *block)
-{
-    DECLARE_ALIGNED(8, int64_t, align_tmp)[16];
-    int16_t *block1= (int16_t*)align_tmp;
-    const int16_t *table= tab_frw_01234567;
-    int i;
-
-    fdct_col_mmx(block, block1, 0);
-    fdct_col_mmx(block, block1, 4);
-
-    for(i=8;i>0;i--) {
-        fdct_row_mmxext(block1, block, table);
-        block1 += 8;
-        table += 32;
-        block += 8;
-    }
-}
-
-#endif /* HAVE_MMXEXT_INLINE */
-
-#if HAVE_SSE2_INLINE
-
-void ff_fdct_sse2(int16_t *block)
-{
-    DECLARE_ALIGNED(16, int64_t, align_tmp)[16];
-    int16_t * const block1= (int16_t*)align_tmp;
-
-    fdct_col_sse2(block, block1, 0);
-    fdct_row_sse2(block1, block);
-}
-
-#endif /* HAVE_SSE2_INLINE */
diff --git a/deps/libav/libavcodec/x86/fft.asm b/deps/libav/libavcodec/x86/fft.asm
deleted file mode 100644
index e4744a3..0000000
--- a/deps/libav/libavcodec/x86/fft.asm
+++ /dev/null
@@ -1,1083 +0,0 @@
-;******************************************************************************
-;* FFT transform with SSE/3DNow optimizations
-;* Copyright (c) 2008 Loren Merritt
-;* Copyright (c) 2011 Vitor Sessak
-;*
-;* This algorithm (though not any of the implementation details) is
-;* based on libdjbfft by D. J. Bernstein.
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-; These functions are not individually interchangeable with the C versions.
-; While C takes arrays of FFTComplex, SSE/3DNow leave intermediate results
-; in blocks as conventient to the vector size.
-; i.e. {4x real, 4x imaginary, 4x real, ...} (or 2x respectively)
-
-%include "libavutil/x86/x86util.asm"
-
-%if ARCH_X86_64
-%define pointer resq
-%else
-%define pointer resd
-%endif
-
-struc FFTContext
-    .nbits:    resd 1
-    .reverse:  resd 1
-    .revtab:   pointer 1
-    .tmpbuf:   pointer 1
-    .mdctsize: resd 1
-    .mdctbits: resd 1
-    .tcos:     pointer 1
-    .tsin:     pointer 1
-    .fftperm:  pointer 1
-    .fftcalc:  pointer 1
-    .imdctcalc:pointer 1
-    .imdcthalf:pointer 1
-endstruc
-
-SECTION_RODATA
-
-%define M_SQRT1_2 0.70710678118654752440
-%define M_COS_PI_1_8 0.923879532511287
-%define M_COS_PI_3_8 0.38268343236509
-
-align 32
-ps_cos16_1: dd 1.0, M_COS_PI_1_8, M_SQRT1_2, M_COS_PI_3_8, 1.0, M_COS_PI_1_8, M_SQRT1_2, M_COS_PI_3_8
-ps_cos16_2: dd 0, M_COS_PI_3_8, M_SQRT1_2, M_COS_PI_1_8, 0, -M_COS_PI_3_8, -M_SQRT1_2, -M_COS_PI_1_8
-
-ps_root2: times 8 dd M_SQRT1_2
-ps_root2mppm: dd -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2, -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2
-ps_p1p1m1p1: dd 0, 0, 1<<31, 0, 0, 0, 1<<31, 0
-
-perm1: dd 0x00, 0x02, 0x03, 0x01, 0x03, 0x00, 0x02, 0x01
-perm2: dd 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x03
-ps_p1p1m1p1root2: dd 1.0, 1.0, -1.0, 1.0, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2
-ps_m1m1p1m1p1m1m1m1: dd 1<<31, 1<<31, 0, 1<<31, 0, 1<<31, 1<<31, 1<<31
-ps_m1m1m1m1: times 4 dd 1<<31
-ps_m1p1: dd 1<<31, 0
-
-%assign i 16
-%rep 13
-cextern cos_ %+ i
-%assign i i<<1
-%endrep
-
-%if ARCH_X86_64
-    %define pointer dq
-%else
-    %define pointer dd
-%endif
-
-%macro IF0 1+
-%endmacro
-%macro IF1 1+
-    %1
-%endmacro
-
-SECTION_TEXT
-
-%macro T2_3DNOW 4 ; z0, z1, mem0, mem1
-    mova     %1, %3
-    mova     %2, %1
-    pfadd    %1, %4
-    pfsub    %2, %4
-%endmacro
-
-%macro T4_3DNOW 6 ; z0, z1, z2, z3, tmp0, tmp1
-    mova     %5, %3
-    pfsub    %3, %4
-    pfadd    %5, %4 ; {t6,t5}
-    pxor     %3, [ps_m1p1] ; {t8,t7}
-    mova     %6, %1
-    movd [r0+12], %3
-    punpckhdq %3, [r0+8]
-    pfadd    %1, %5 ; {r0,i0}
-    pfsub    %6, %5 ; {r2,i2}
-    mova     %4, %2
-    pfadd    %2, %3 ; {r1,i1}
-    pfsub    %4, %3 ; {r3,i3}
-    SWAP     %3, %6
-%endmacro
-
-;  in: %1 = {r0,i0,r2,i2,r4,i4,r6,i6}
-;      %2 = {r1,i1,r3,i3,r5,i5,r7,i7}
-;      %3, %4, %5 tmp
-; out: %1 = {r0,r1,r2,r3,i0,i1,i2,i3}
-;      %2 = {r4,r5,r6,r7,i4,i5,i6,i7}
-%macro T8_AVX 5
-    vsubps     %5, %1, %2       ; v  = %1 - %2
-    vaddps     %3, %1, %2       ; w  = %1 + %2
-    vmulps     %2, %5, [ps_p1p1m1p1root2]  ; v *= vals1
-    vpermilps  %2, %2, [perm1]
-    vblendps   %1, %2, %3, 0x33 ; q = {w1,w2,v4,v2,w5,w6,v7,v6}
-    vshufps    %5, %3, %2, 0x4e ; r = {w3,w4,v1,v3,w7,w8,v8,v5}
-    vsubps     %4, %5, %1       ; s = r - q
-    vaddps     %1, %5, %1       ; u = r + q
-    vpermilps  %1, %1, [perm2]  ; k  = {u1,u2,u3,u4,u6,u5,u7,u8}
-    vshufps    %5, %4, %1, 0xbb
-    vshufps    %3, %4, %1, 0xee
-    vperm2f128 %3, %3, %5, 0x13
-    vxorps     %4, %4, [ps_m1m1p1m1p1m1m1m1]  ; s *= {1,1,-1,-1,1,-1,-1,-1}
-    vshufps    %2, %1, %4, 0xdd
-    vshufps    %1, %1, %4, 0x88
-    vperm2f128 %4, %2, %1, 0x02 ; v  = {k1,k3,s1,s3,k2,k4,s2,s4}
-    vperm2f128 %1, %1, %2, 0x13 ; w  = {k6,k8,s6,s8,k5,k7,s5,s7}
-    vsubps     %5, %1, %3
-    vblendps   %1, %5, %1, 0x55 ; w -= {0,s7,0,k7,0,s8,0,k8}
-    vsubps     %2, %4, %1       ; %2 = v - w
-    vaddps     %1, %4, %1       ; %1 = v + w
-%endmacro
-
-; In SSE mode do one fft4 transforms
-; in:  %1={r0,i0,r2,i2} %2={r1,i1,r3,i3}
-; out: %1={r0,r1,r2,r3} %2={i0,i1,i2,i3}
-;
-; In AVX mode do two fft4 transforms
-; in:  %1={r0,i0,r2,i2,r4,i4,r6,i6} %2={r1,i1,r3,i3,r5,i5,r7,i7}
-; out: %1={r0,r1,r2,r3,r4,r5,r6,r7} %2={i0,i1,i2,i3,i4,i5,i6,i7}
-%macro T4_SSE 3
-    subps    %3, %1, %2       ; {t3,t4,-t8,t7}
-    addps    %1, %1, %2       ; {t1,t2,t6,t5}
-    xorps    %3, %3, [ps_p1p1m1p1]
-    shufps   %2, %1, %3, 0xbe ; {t6,t5,t7,t8}
-    shufps   %1, %1, %3, 0x44 ; {t1,t2,t3,t4}
-    subps    %3, %1, %2       ; {r2,i2,r3,i3}
-    addps    %1, %1, %2       ; {r0,i0,r1,i1}
-    shufps   %2, %1, %3, 0xdd ; {i0,i1,i2,i3}
-    shufps   %1, %1, %3, 0x88 ; {r0,r1,r2,r3}
-%endmacro
-
-; In SSE mode do one FFT8
-; in:  %1={r0,r1,r2,r3} %2={i0,i1,i2,i3} %3={r4,i4,r6,i6} %4={r5,i5,r7,i7}
-; out: %1={r0,r1,r2,r3} %2={i0,i1,i2,i3} %1={r4,r5,r6,r7} %2={i4,i5,i6,i7}
-;
-; In AVX mode do two FFT8
-; in:  %1={r0,i0,r2,i2,r8, i8, r10,i10} %2={r1,i1,r3,i3,r9, i9, r11,i11}
-;      %3={r4,i4,r6,i6,r12,i12,r14,i14} %4={r5,i5,r7,i7,r13,i13,r15,i15}
-; out: %1={r0,r1,r2,r3,r8, r9, r10,r11} %2={i0,i1,i2,i3,i8, i9, i10,i11}
-;      %3={r4,r5,r6,r7,r12,r13,r14,r15} %4={i4,i5,i6,i7,i12,i13,i14,i15}
-%macro T8_SSE 6
-    addps    %6, %3, %4       ; {t1,t2,t3,t4}
-    subps    %3, %3, %4       ; {r5,i5,r7,i7}
-    shufps   %4, %3, %3, 0xb1 ; {i5,r5,i7,r7}
-    mulps    %3, %3, [ps_root2mppm] ; {-r5,i5,r7,-i7}
-    mulps    %4, %4, [ps_root2]
-    addps    %3, %3, %4       ; {t8,t7,ta,t9}
-    shufps   %4, %6, %3, 0x9c ; {t1,t4,t7,ta}
-    shufps   %6, %6, %3, 0x36 ; {t3,t2,t9,t8}
-    subps    %3, %6, %4       ; {t6,t5,tc,tb}
-    addps    %6, %6, %4       ; {t1,t2,t9,ta}
-    shufps   %5, %6, %3, 0x8d ; {t2,ta,t6,tc}
-    shufps   %6, %6, %3, 0xd8 ; {t1,t9,t5,tb}
-    subps    %3, %1, %6       ; {r4,r5,r6,r7}
-    addps    %1, %1, %6       ; {r0,r1,r2,r3}
-    subps    %4, %2, %5       ; {i4,i5,i6,i7}
-    addps    %2, %2, %5       ; {i0,i1,i2,i3}
-%endmacro
-
-; scheduled for cpu-bound sizes
-%macro PASS_SMALL 3 ; (to load m4-m7), wre, wim
-IF%1 mova    m4, Z(4)
-IF%1 mova    m5, Z(5)
-    mova     m0, %2 ; wre
-    mova     m1, %3 ; wim
-    mulps    m2, m4, m0 ; r2*wre
-IF%1 mova    m6, Z2(6)
-    mulps    m3, m5, m1 ; i2*wim
-IF%1 mova    m7, Z2(7)
-    mulps    m4, m4, m1 ; r2*wim
-    mulps    m5, m5, m0 ; i2*wre
-    addps    m2, m2, m3 ; r2*wre + i2*wim
-    mulps    m3, m1, m7 ; i3*wim
-    subps    m5, m5, m4 ; i2*wre - r2*wim
-    mulps    m1, m1, m6 ; r3*wim
-    mulps    m4, m0, m6 ; r3*wre
-    mulps    m0, m0, m7 ; i3*wre
-    subps    m4, m4, m3 ; r3*wre - i3*wim
-    mova     m3, Z(0)
-    addps    m0, m0, m1 ; i3*wre + r3*wim
-    subps    m1, m4, m2 ; t3
-    addps    m4, m4, m2 ; t5
-    subps    m3, m3, m4 ; r2
-    addps    m4, m4, Z(0) ; r0
-    mova     m6, Z(2)
-    mova   Z(4), m3
-    mova   Z(0), m4
-    subps    m3, m5, m0 ; t4
-    subps    m4, m6, m3 ; r3
-    addps    m3, m3, m6 ; r1
-    mova  Z2(6), m4
-    mova   Z(2), m3
-    mova     m2, Z(3)
-    addps    m3, m5, m0 ; t6
-    subps    m2, m2, m1 ; i3
-    mova     m7, Z(1)
-    addps    m1, m1, Z(3) ; i1
-    mova  Z2(7), m2
-    mova   Z(3), m1
-    subps    m4, m7, m3 ; i2
-    addps    m3, m3, m7 ; i0
-    mova   Z(5), m4
-    mova   Z(1), m3
-%endmacro
-
-; scheduled to avoid store->load aliasing
-%macro PASS_BIG 1 ; (!interleave)
-    mova     m4, Z(4) ; r2
-    mova     m5, Z(5) ; i2
-    mova     m0, [wq] ; wre
-    mova     m1, [wq+o1q] ; wim
-    mulps    m2, m4, m0 ; r2*wre
-    mova     m6, Z2(6) ; r3
-    mulps    m3, m5, m1 ; i2*wim
-    mova     m7, Z2(7) ; i3
-    mulps    m4, m4, m1 ; r2*wim
-    mulps    m5, m5, m0 ; i2*wre
-    addps    m2, m2, m3 ; r2*wre + i2*wim
-    mulps    m3, m1, m7 ; i3*wim
-    mulps    m1, m1, m6 ; r3*wim
-    subps    m5, m5, m4 ; i2*wre - r2*wim
-    mulps    m4, m0, m6 ; r3*wre
-    mulps    m0, m0, m7 ; i3*wre
-    subps    m4, m4, m3 ; r3*wre - i3*wim
-    mova     m3, Z(0)
-    addps    m0, m0, m1 ; i3*wre + r3*wim
-    subps    m1, m4, m2 ; t3
-    addps    m4, m4, m2 ; t5
-    subps    m3, m3, m4 ; r2
-    addps    m4, m4, Z(0) ; r0
-    mova     m6, Z(2)
-    mova   Z(4), m3
-    mova   Z(0), m4
-    subps    m3, m5, m0 ; t4
-    subps    m4, m6, m3 ; r3
-    addps    m3, m3, m6 ; r1
-IF%1 mova Z2(6), m4
-IF%1 mova  Z(2), m3
-    mova     m2, Z(3)
-    addps    m5, m5, m0 ; t6
-    subps    m2, m2, m1 ; i3
-    mova     m7, Z(1)
-    addps    m1, m1, Z(3) ; i1
-IF%1 mova Z2(7), m2
-IF%1 mova  Z(3), m1
-    subps    m6, m7, m5 ; i2
-    addps    m5, m5, m7 ; i0
-IF%1 mova  Z(5), m6
-IF%1 mova  Z(1), m5
-%if %1==0
-    INTERL m1, m3, m7, Z, 2
-    INTERL m2, m4, m0, Z2, 6
-
-    mova     m1, Z(0)
-    mova     m2, Z(4)
-
-    INTERL m5, m1, m3, Z, 0
-    INTERL m6, m2, m7, Z, 4
-%endif
-%endmacro
-
-%macro PUNPCK 3
-    mova      %3, %1
-    punpckldq %1, %2
-    punpckhdq %3, %2
-%endmacro
-
-%define Z(x) [r0+mmsize*x]
-%define Z2(x) [r0+mmsize*x]
-%define ZH(x) [r0+mmsize*x+mmsize/2]
-
-INIT_YMM avx
-
-align 16
-fft8_avx:
-    mova      m0, Z(0)
-    mova      m1, Z(1)
-    T8_AVX    m0, m1, m2, m3, m4
-    mova      Z(0), m0
-    mova      Z(1), m1
-    ret
-
-
-align 16
-fft16_avx:
-    mova       m2, Z(2)
-    mova       m3, Z(3)
-    T4_SSE     m2, m3, m7
-
-    mova       m0, Z(0)
-    mova       m1, Z(1)
-    T8_AVX     m0, m1, m4, m5, m7
-
-    mova       m4, [ps_cos16_1]
-    mova       m5, [ps_cos16_2]
-    vmulps     m6, m2, m4
-    vmulps     m7, m3, m5
-    vaddps     m7, m7, m6
-    vmulps     m2, m2, m5
-    vmulps     m3, m3, m4
-    vsubps     m3, m3, m2
-    vblendps   m2, m7, m3, 0xf0
-    vperm2f128 m3, m7, m3, 0x21
-    vaddps     m4, m2, m3
-    vsubps     m2, m3, m2
-    vperm2f128 m2, m2, m2, 0x01
-    vsubps     m3, m1, m2
-    vaddps     m1, m1, m2
-    vsubps     m5, m0, m4
-    vaddps     m0, m0, m4
-    vextractf128   Z(0), m0, 0
-    vextractf128  ZH(0), m1, 0
-    vextractf128   Z(1), m0, 1
-    vextractf128  ZH(1), m1, 1
-    vextractf128   Z(2), m5, 0
-    vextractf128  ZH(2), m3, 0
-    vextractf128   Z(3), m5, 1
-    vextractf128  ZH(3), m3, 1
-    ret
-
-align 16
-fft32_avx:
-    call fft16_avx
-
-    mova m0, Z(4)
-    mova m1, Z(5)
-
-    T4_SSE      m0, m1, m4
-
-    mova m2, Z(6)
-    mova m3, Z(7)
-
-    T8_SSE      m0, m1, m2, m3, m4, m6
-    ; m0={r0,r1,r2,r3,r8, r9, r10,r11} m1={i0,i1,i2,i3,i8, i9, i10,i11}
-    ; m2={r4,r5,r6,r7,r12,r13,r14,r15} m3={i4,i5,i6,i7,i12,i13,i14,i15}
-
-    vperm2f128  m4, m0, m2, 0x20
-    vperm2f128  m5, m1, m3, 0x20
-    vperm2f128  m6, m0, m2, 0x31
-    vperm2f128  m7, m1, m3, 0x31
-
-    PASS_SMALL 0, [cos_32], [cos_32+32]
-
-    ret
-
-fft32_interleave_avx:
-    call fft32_avx
-    mov r2d, 32
-.deint_loop:
-    mova     m2, Z(0)
-    mova     m3, Z(1)
-    vunpcklps      m0, m2, m3
-    vunpckhps      m1, m2, m3
-    vextractf128   Z(0), m0, 0
-    vextractf128  ZH(0), m1, 0
-    vextractf128   Z(1), m0, 1
-    vextractf128  ZH(1), m1, 1
-    add r0, mmsize*2
-    sub r2d, mmsize/4
-    jg .deint_loop
-    ret
-
-INIT_XMM sse
-
-align 16
-fft4_avx:
-fft4_sse:
-    mova     m0, Z(0)
-    mova     m1, Z(1)
-    T4_SSE   m0, m1, m2
-    mova   Z(0), m0
-    mova   Z(1), m1
-    ret
-
-align 16
-fft8_sse:
-    mova     m0, Z(0)
-    mova     m1, Z(1)
-    T4_SSE   m0, m1, m2
-    mova     m2, Z(2)
-    mova     m3, Z(3)
-    T8_SSE   m0, m1, m2, m3, m4, m5
-    mova   Z(0), m0
-    mova   Z(1), m1
-    mova   Z(2), m2
-    mova   Z(3), m3
-    ret
-
-align 16
-fft16_sse:
-    mova     m0, Z(0)
-    mova     m1, Z(1)
-    T4_SSE   m0, m1, m2
-    mova     m2, Z(2)
-    mova     m3, Z(3)
-    T8_SSE   m0, m1, m2, m3, m4, m5
-    mova     m4, Z(4)
-    mova     m5, Z(5)
-    mova   Z(0), m0
-    mova   Z(1), m1
-    mova   Z(2), m2
-    mova   Z(3), m3
-    T4_SSE   m4, m5, m6
-    mova     m6, Z2(6)
-    mova     m7, Z2(7)
-    T4_SSE   m6, m7, m0
-    PASS_SMALL 0, [cos_16], [cos_16+16]
-    ret
-
-
-%macro FFT48_3DNOW 0
-align 16
-fft4 %+ SUFFIX:
-    T2_3DNOW m0, m1, Z(0), Z(1)
-    mova     m2, Z(2)
-    mova     m3, Z(3)
-    T4_3DNOW m0, m1, m2, m3, m4, m5
-    PUNPCK   m0, m1, m4
-    PUNPCK   m2, m3, m5
-    mova   Z(0), m0
-    mova   Z(1), m4
-    mova   Z(2), m2
-    mova   Z(3), m5
-    ret
-
-align 16
-fft8 %+ SUFFIX:
-    T2_3DNOW m0, m1, Z(0), Z(1)
-    mova     m2, Z(2)
-    mova     m3, Z(3)
-    T4_3DNOW m0, m1, m2, m3, m4, m5
-    mova   Z(0), m0
-    mova   Z(2), m2
-    T2_3DNOW m4, m5,  Z(4),  Z(5)
-    T2_3DNOW m6, m7, Z2(6), Z2(7)
-    PSWAPD   m0, m5
-    PSWAPD   m2, m7
-    pxor     m0, [ps_m1p1]
-    pxor     m2, [ps_m1p1]
-    pfsub    m5, m0
-    pfadd    m7, m2
-    pfmul    m5, [ps_root2]
-    pfmul    m7, [ps_root2]
-    T4_3DNOW m1, m3, m5, m7, m0, m2
-    mova   Z(5), m5
-    mova  Z2(7), m7
-    mova     m0, Z(0)
-    mova     m2, Z(2)
-    T4_3DNOW m0, m2, m4, m6, m5, m7
-    PUNPCK   m0, m1, m5
-    PUNPCK   m2, m3, m7
-    mova   Z(0), m0
-    mova   Z(1), m5
-    mova   Z(2), m2
-    mova   Z(3), m7
-    PUNPCK   m4,  Z(5), m5
-    PUNPCK   m6, Z2(7), m7
-    mova   Z(4), m4
-    mova   Z(5), m5
-    mova  Z2(6), m6
-    mova  Z2(7), m7
-    ret
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX 3dnowext
-FFT48_3DNOW
-
-INIT_MMX 3dnow
-FFT48_3DNOW
-%endif
-
-%define Z(x) [zcq + o1q*(x&6) + mmsize*(x&1)]
-%define Z2(x) [zcq + o3q + mmsize*(x&1)]
-%define ZH(x) [zcq + o1q*(x&6) + mmsize*(x&1) + mmsize/2]
-%define Z2H(x) [zcq + o3q + mmsize*(x&1) + mmsize/2]
-
-%macro DECL_PASS 2+ ; name, payload
-align 16
-%1:
-DEFINE_ARGS zc, w, n, o1, o3
-    lea o3q, [nq*3]
-    lea o1q, [nq*8]
-    shl o3q, 4
-.loop:
-    %2
-    add zcq, mmsize*2
-    add  wq, mmsize
-    sub  nd, mmsize/8
-    jg .loop
-    rep ret
-%endmacro
-
-%macro FFT_DISPATCH 2; clobbers 5 GPRs, 8 XMMs
-    lea r2, [dispatch_tab%1]
-    mov r2, [r2 + (%2q-2)*gprsize]
-%ifdef PIC
-    lea r3, [$$]
-    add r2, r3
-%endif
-    call r2
-%endmacro ; FFT_DISPATCH
-
-INIT_YMM avx
-
-%macro INTERL_AVX 5
-    vunpckhps      %3, %2, %1
-    vunpcklps      %2, %2, %1
-    vextractf128   %4(%5), %2, 0
-    vextractf128  %4 %+ H(%5), %3, 0
-    vextractf128   %4(%5 + 1), %2, 1
-    vextractf128  %4 %+ H(%5 + 1), %3, 1
-%endmacro
-
-%define INTERL INTERL_AVX
-
-DECL_PASS pass_avx, PASS_BIG 1
-DECL_PASS pass_interleave_avx, PASS_BIG 0
-
-cglobal fft_calc, 2,5,8
-    mov     r3d, [r0 + FFTContext.nbits]
-    mov     r0, r1
-    mov     r1, r3
-    FFT_DISPATCH _interleave %+ SUFFIX, r1
-    REP_RET
-
-
-INIT_XMM sse
-
-%macro INTERL_SSE 5
-    mova     %3, %2
-    unpcklps %2, %1
-    unpckhps %3, %1
-    mova  %4(%5), %2
-    mova  %4(%5+1), %3
-%endmacro
-
-%define INTERL INTERL_SSE
-
-DECL_PASS pass_sse, PASS_BIG 1
-DECL_PASS pass_interleave_sse, PASS_BIG 0
-
-%macro FFT_CALC_FUNC 0
-cglobal fft_calc, 2,5,8
-    mov     r3d, [r0 + FFTContext.nbits]
-    PUSH    r1
-    PUSH    r3
-    mov     r0, r1
-    mov     r1, r3
-    FFT_DISPATCH _interleave %+ SUFFIX, r1
-    POP     rcx
-    POP     r4
-    cmp     rcx, 3+(mmsize/16)
-    jg      .end
-    mov     r2, -1
-    add     rcx, 3
-    shl     r2, cl
-    sub     r4, r2
-.loop:
-%if mmsize == 8
-    PSWAPD  m0, [r4 + r2 + 4]
-    mova [r4 + r2 + 4], m0
-%else
-    movaps   xmm0, [r4 + r2]
-    movaps   xmm1, xmm0
-    unpcklps xmm0, [r4 + r2 + 16]
-    unpckhps xmm1, [r4 + r2 + 16]
-    movaps   [r4 + r2],      xmm0
-    movaps   [r4 + r2 + 16], xmm1
-%endif
-    add      r2, mmsize*2
-    jl       .loop
-.end:
-%if cpuflag(3dnow)
-    femms
-    RET
-%else
-    REP_RET
-%endif
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX 3dnow
-FFT_CALC_FUNC
-INIT_MMX 3dnowext
-FFT_CALC_FUNC
-%endif
-INIT_XMM sse
-FFT_CALC_FUNC
-
-cglobal fft_permute, 2,7,1
-    mov     r4,  [r0 + FFTContext.revtab]
-    mov     r5,  [r0 + FFTContext.tmpbuf]
-    mov     ecx, [r0 + FFTContext.nbits]
-    mov     r2, 1
-    shl     r2, cl
-    xor     r0, r0
-%if ARCH_X86_32
-    mov     r1, r1m
-%endif
-.loop:
-    movaps  xmm0, [r1 + 8*r0]
-    movzx   r6, word [r4 + 2*r0]
-    movzx   r3, word [r4 + 2*r0 + 2]
-    movlps  [r5 + 8*r6], xmm0
-    movhps  [r5 + 8*r3], xmm0
-    add     r0, 2
-    cmp     r0, r2
-    jl      .loop
-    shl     r2, 3
-    add     r1, r2
-    add     r5, r2
-    neg     r2
-; nbits >= 2 (FFT4) and sizeof(FFTComplex)=8 => at least 32B
-.loopcopy:
-    movaps  xmm0, [r5 + r2]
-    movaps  xmm1, [r5 + r2 + 16]
-    movaps  [r1 + r2], xmm0
-    movaps  [r1 + r2 + 16], xmm1
-    add     r2, 32
-    jl      .loopcopy
-    REP_RET
-
-%macro IMDCT_CALC_FUNC 0
-cglobal imdct_calc, 3,5,3
-    mov     r3d, [r0 + FFTContext.mdctsize]
-    mov     r4,  [r0 + FFTContext.imdcthalf]
-    add     r1,  r3
-    PUSH    r3
-    PUSH    r1
-%if ARCH_X86_32
-    push    r2
-    push    r1
-    push    r0
-%else
-    sub     rsp, 8+32*WIN64 ; allocate win64 shadow space
-%endif
-    call    r4
-%if ARCH_X86_32
-    add     esp, 12
-%else
-    add     rsp, 8+32*WIN64
-%endif
-    POP     r1
-    POP     r3
-    lea     r0, [r1 + 2*r3]
-    mov     r2, r3
-    sub     r3, mmsize
-    neg     r2
-    mova    m2, [ps_m1m1m1m1]
-.loop:
-%if mmsize == 8
-    PSWAPD  m0, [r1 + r3]
-    PSWAPD  m1, [r0 + r2]
-    pxor    m0, m2
-%else
-    mova    m0, [r1 + r3]
-    mova    m1, [r0 + r2]
-    shufps  m0, m0, 0x1b
-    shufps  m1, m1, 0x1b
-    xorps   m0, m2
-%endif
-    mova [r0 + r3], m1
-    mova [r1 + r2], m0
-    sub     r3, mmsize
-    add     r2, mmsize
-    jl      .loop
-%if cpuflag(3dnow)
-    femms
-    RET
-%else
-    REP_RET
-%endif
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX 3dnow
-IMDCT_CALC_FUNC
-INIT_MMX 3dnowext
-IMDCT_CALC_FUNC
-%endif
-
-INIT_XMM sse
-IMDCT_CALC_FUNC
-
-%if ARCH_X86_32
-INIT_MMX 3dnow
-%define mulps pfmul
-%define addps pfadd
-%define subps pfsub
-%define unpcklps punpckldq
-%define unpckhps punpckhdq
-DECL_PASS pass_3dnow, PASS_SMALL 1, [wq], [wq+o1q]
-DECL_PASS pass_interleave_3dnow, PASS_BIG 0
-%define pass_3dnowext pass_3dnow
-%define pass_interleave_3dnowext pass_interleave_3dnow
-%endif
-
-%ifdef PIC
-%define SECTION_REL - $$
-%else
-%define SECTION_REL
-%endif
-
-%macro DECL_FFT 1-2 ; nbits, suffix
-%ifidn %0, 1
-%xdefine fullsuffix SUFFIX
-%else
-%xdefine fullsuffix %2 %+ SUFFIX
-%endif
-%xdefine list_of_fft fft4 %+ SUFFIX SECTION_REL, fft8 %+ SUFFIX SECTION_REL
-%if %1>=5
-%xdefine list_of_fft list_of_fft, fft16 %+ SUFFIX SECTION_REL
-%endif
-%if %1>=6
-%xdefine list_of_fft list_of_fft, fft32 %+ fullsuffix SECTION_REL
-%endif
-
-%assign n 1<<%1
-%rep 17-%1
-%assign n2 n/2
-%assign n4 n/4
-%xdefine list_of_fft list_of_fft, fft %+ n %+ fullsuffix SECTION_REL
-
-align 16
-fft %+ n %+ fullsuffix:
-    call fft %+ n2 %+ SUFFIX
-    add r0, n*4 - (n&(-2<<%1))
-    call fft %+ n4 %+ SUFFIX
-    add r0, n*2 - (n2&(-2<<%1))
-    call fft %+ n4 %+ SUFFIX
-    sub r0, n*6 + (n2&(-2<<%1))
-    lea r1, [cos_ %+ n]
-    mov r2d, n4/2
-    jmp pass %+ fullsuffix
-
-%assign n n*2
-%endrep
-%undef n
-
-align 8
-dispatch_tab %+ fullsuffix: pointer list_of_fft
-%endmacro ; DECL_FFT
-
-INIT_YMM avx
-DECL_FFT 6
-DECL_FFT 6, _interleave
-INIT_XMM sse
-DECL_FFT 5
-DECL_FFT 5, _interleave
-%if ARCH_X86_32
-INIT_MMX 3dnow
-DECL_FFT 4
-DECL_FFT 4, _interleave
-INIT_MMX 3dnowext
-DECL_FFT 4
-DECL_FFT 4, _interleave
-%endif
-
-INIT_XMM sse
-%undef mulps
-%undef addps
-%undef subps
-%undef unpcklps
-%undef unpckhps
-
-%macro PREROTATER 5 ;-2*k, 2*k, input+n4, tcos+n8, tsin+n8
-%if mmsize == 8 ; j*2+2-n4, n4-2-j*2, input+n4, tcos+n8, tsin+n8
-    PSWAPD     m0, [%3+%2*4]
-    movq       m2, [%3+%1*4-8]
-    movq       m3, m0
-    punpckldq  m0, m2
-    punpckhdq  m2, m3
-    movd       m1, [%4+%1*2-4] ; tcos[j]
-    movd       m3, [%4+%2*2]   ; tcos[n4-j-1]
-    punpckldq  m1, [%5+%1*2-4] ; tsin[j]
-    punpckldq  m3, [%5+%2*2]   ; tsin[n4-j-1]
-
-    mova       m4, m0
-    PSWAPD     m5, m1
-    pfmul      m0, m1
-    pfmul      m4, m5
-    mova       m6, m2
-    PSWAPD     m5, m3
-    pfmul      m2, m3
-    pfmul      m6, m5
-%if cpuflag(3dnowext)
-    pfpnacc    m0, m4
-    pfpnacc    m2, m6
-%else
-    SBUTTERFLY dq, 0, 4, 1
-    SBUTTERFLY dq, 2, 6, 3
-    pxor       m4, m7
-    pxor       m6, m7
-    pfadd      m0, m4
-    pfadd      m2, m6
-%endif
-%else
-    movaps   xmm0, [%3+%2*4]
-    movaps   xmm1, [%3+%1*4-0x10]
-    movaps   xmm2, xmm0
-    shufps   xmm0, xmm1, 0x88
-    shufps   xmm1, xmm2, 0x77
-    movlps   xmm4, [%4+%2*2]
-    movlps   xmm5, [%5+%2*2+0x0]
-    movhps   xmm4, [%4+%1*2-0x8]
-    movhps   xmm5, [%5+%1*2-0x8]
-    movaps   xmm2, xmm0
-    movaps   xmm3, xmm1
-    mulps    xmm0, xmm5
-    mulps    xmm1, xmm4
-    mulps    xmm2, xmm4
-    mulps    xmm3, xmm5
-    subps    xmm1, xmm0
-    addps    xmm2, xmm3
-    movaps   xmm0, xmm1
-    unpcklps xmm1, xmm2
-    unpckhps xmm0, xmm2
-%endif
-%endmacro
-
-%macro CMUL 6 ;j, xmm0, xmm1, 3, 4, 5
-    mulps      m6, %3, [%5+%1]
-    mulps      m7, %2, [%5+%1]
-    mulps      %2, %2, [%6+%1]
-    mulps      %3, %3, [%6+%1]
-    subps      %2, %2, m6
-    addps      %3, %3, m7
-%endmacro
-
-%macro POSROTATESHUF_AVX 5 ;j, k, z+n8, tcos+n8, tsin+n8
-.post:
-    vmovaps      ymm1,   [%3+%1*2]
-    vmovaps      ymm0,   [%3+%1*2+0x20]
-    vmovaps      ymm3,   [%3+%2*2]
-    vmovaps      ymm2,   [%3+%2*2+0x20]
-
-    CMUL         %1, ymm0, ymm1, %3, %4, %5
-    CMUL         %2, ymm2, ymm3, %3, %4, %5
-    vshufps      ymm1, ymm1, ymm1, 0x1b
-    vshufps      ymm3, ymm3, ymm3, 0x1b
-    vperm2f128   ymm1, ymm1, ymm1, 0x01
-    vperm2f128   ymm3, ymm3, ymm3, 0x01
-    vunpcklps    ymm6, ymm2, ymm1
-    vunpckhps    ymm4, ymm2, ymm1
-    vunpcklps    ymm7, ymm0, ymm3
-    vunpckhps    ymm5, ymm0, ymm3
-
-    vextractf128 [%3+%1*2],      ymm7, 0
-    vextractf128 [%3+%1*2+0x10], ymm5, 0
-    vextractf128 [%3+%1*2+0x20], ymm7, 1
-    vextractf128 [%3+%1*2+0x30], ymm5, 1
-
-    vextractf128 [%3+%2*2],      ymm6, 0
-    vextractf128 [%3+%2*2+0x10], ymm4, 0
-    vextractf128 [%3+%2*2+0x20], ymm6, 1
-    vextractf128 [%3+%2*2+0x30], ymm4, 1
-    sub      %2,   0x20
-    add      %1,   0x20
-    jl       .post
-%endmacro
-
-%macro POSROTATESHUF 5 ;j, k, z+n8, tcos+n8, tsin+n8
-.post:
-    movaps   xmm1, [%3+%1*2]
-    movaps   xmm0, [%3+%1*2+0x10]
-    CMUL     %1,   xmm0, xmm1, %3, %4, %5
-    movaps   xmm5, [%3+%2*2]
-    movaps   xmm4, [%3+%2*2+0x10]
-    CMUL     %2,   xmm4, xmm5, %3, %4, %5
-    shufps   xmm1, xmm1, 0x1b
-    shufps   xmm5, xmm5, 0x1b
-    movaps   xmm6, xmm4
-    unpckhps xmm4, xmm1
-    unpcklps xmm6, xmm1
-    movaps   xmm2, xmm0
-    unpcklps xmm0, xmm5
-    unpckhps xmm2, xmm5
-    movaps   [%3+%2*2],      xmm6
-    movaps   [%3+%2*2+0x10], xmm4
-    movaps   [%3+%1*2],      xmm0
-    movaps   [%3+%1*2+0x10], xmm2
-    sub      %2,   0x10
-    add      %1,   0x10
-    jl       .post
-%endmacro
-
-%macro CMUL_3DNOW 6
-    mova       m6, [%1+%2*2]
-    mova       %3, [%1+%2*2+8]
-    mova       %4, m6
-    mova       m7, %3
-    pfmul      m6, [%5+%2]
-    pfmul      %3, [%6+%2]
-    pfmul      %4, [%6+%2]
-    pfmul      m7, [%5+%2]
-    pfsub      %3, m6
-    pfadd      %4, m7
-%endmacro
-
-%macro POSROTATESHUF_3DNOW 5 ;j, k, z+n8, tcos+n8, tsin+n8
-.post:
-    CMUL_3DNOW %3, %1, m0, m1, %4, %5
-    CMUL_3DNOW %3, %2, m2, m3, %4, %5
-    movd  [%3+%1*2+ 0], m0
-    movd  [%3+%2*2+12], m1
-    movd  [%3+%2*2+ 0], m2
-    movd  [%3+%1*2+12], m3
-    psrlq      m0, 32
-    psrlq      m1, 32
-    psrlq      m2, 32
-    psrlq      m3, 32
-    movd  [%3+%1*2+ 8], m0
-    movd  [%3+%2*2+ 4], m1
-    movd  [%3+%2*2+ 8], m2
-    movd  [%3+%1*2+ 4], m3
-    sub        %2, 8
-    add        %1, 8
-    jl         .post
-%endmacro
-
-%macro DECL_IMDCT 1
-cglobal imdct_half, 3,12,8; FFTContext *s, FFTSample *output, const FFTSample *input
-%if ARCH_X86_64
-%define rrevtab r7
-%define rtcos   r8
-%define rtsin   r9
-%else
-%define rrevtab r6
-%define rtsin   r6
-%define rtcos   r5
-%endif
-    mov   r3d, [r0+FFTContext.mdctsize]
-    add   r2, r3
-    shr   r3, 1
-    mov   rtcos, [r0+FFTContext.tcos]
-    mov   rtsin, [r0+FFTContext.tsin]
-    add   rtcos, r3
-    add   rtsin, r3
-%if ARCH_X86_64 == 0
-    push  rtcos
-    push  rtsin
-%endif
-    shr   r3, 1
-    mov   rrevtab, [r0+FFTContext.revtab]
-    add   rrevtab, r3
-%if ARCH_X86_64 == 0
-    push  rrevtab
-%endif
-
-%if mmsize == 8
-    sub   r3, 2
-%else
-    sub   r3, 4
-%endif
-%if ARCH_X86_64 || mmsize == 8
-    xor   r4, r4
-    sub   r4, r3
-%endif
-%if notcpuflag(3dnowext) && mmsize == 8
-    movd  m7, [ps_m1m1m1m1]
-%endif
-.pre:
-%if ARCH_X86_64 == 0
-;unspill
-%if mmsize != 8
-    xor   r4, r4
-    sub   r4, r3
-%endif
-    mov   rtcos, [esp+8]
-    mov   rtsin, [esp+4]
-%endif
-
-    PREROTATER r4, r3, r2, rtcos, rtsin
-%if mmsize == 8
-    mov    r6, [esp]                ; rrevtab = ptr+n8
-    movzx  r5,  word [rrevtab+r4-2] ; rrevtab[j]
-    movzx  r6,  word [rrevtab+r3]   ; rrevtab[n4-j-1]
-    mova [r1+r5*8], m0
-    mova [r1+r6*8], m2
-    add    r4, 2
-    sub    r3, 2
-%else
-%if ARCH_X86_64
-    movzx  r5,  word [rrevtab+r4-4]
-    movzx  r6,  word [rrevtab+r4-2]
-    movzx  r10, word [rrevtab+r3]
-    movzx  r11, word [rrevtab+r3+2]
-    movlps [r1+r5 *8], xmm0
-    movhps [r1+r6 *8], xmm0
-    movlps [r1+r10*8], xmm1
-    movhps [r1+r11*8], xmm1
-    add    r4, 4
-%else
-    mov    r6, [esp]
-    movzx  r5, word [r6+r4-4]
-    movzx  r4, word [r6+r4-2]
-    movlps [r1+r5*8], xmm0
-    movhps [r1+r4*8], xmm0
-    movzx  r5, word [r6+r3]
-    movzx  r4, word [r6+r3+2]
-    movlps [r1+r5*8], xmm1
-    movhps [r1+r4*8], xmm1
-%endif
-    sub    r3, 4
-%endif
-    jns    .pre
-
-    mov  r5, r0
-    mov  r6, r1
-    mov  r0, r1
-    mov  r1d, [r5+FFTContext.nbits]
-
-    FFT_DISPATCH SUFFIX, r1
-
-    mov  r0d, [r5+FFTContext.mdctsize]
-    add  r6, r0
-    shr  r0, 1
-%if ARCH_X86_64 == 0
-%define rtcos r2
-%define rtsin r3
-    mov  rtcos, [esp+8]
-    mov  rtsin, [esp+4]
-%endif
-    neg  r0
-    mov  r1, -mmsize
-    sub  r1, r0
-    %1 r0, r1, r6, rtcos, rtsin
-%if ARCH_X86_64 == 0
-    add esp, 12
-%endif
-%if mmsize == 8
-    femms
-%endif
-    RET
-%endmacro
-
-DECL_IMDCT POSROTATESHUF
-
-%if ARCH_X86_32
-INIT_MMX 3dnow
-DECL_IMDCT POSROTATESHUF_3DNOW
-
-INIT_MMX 3dnowext
-DECL_IMDCT POSROTATESHUF_3DNOW
-%endif
-
-INIT_YMM avx
-DECL_IMDCT POSROTATESHUF_AVX
diff --git a/deps/libav/libavcodec/x86/fft.h b/deps/libav/libavcodec/x86/fft.h
deleted file mode 100644
index a604956..0000000
--- a/deps/libav/libavcodec/x86/fft.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_X86_FFT_H
-#define AVCODEC_X86_FFT_H
-
-#include "libavcodec/fft.h"
-
-void ff_fft_permute_sse(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_avx(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_sse(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_3dnow(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_3dnowext(FFTContext *s, FFTComplex *z);
-
-void ff_imdct_calc_3dnow(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_3dnow(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_calc_3dnowext(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_3dnowext(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_sse(FFTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half_avx(FFTContext *s, FFTSample *output, const FFTSample *input);
-
-#endif /* AVCODEC_X86_FFT_H */
diff --git a/deps/libav/libavcodec/x86/fft_init.c b/deps/libav/libavcodec/x86/fft_init.c
deleted file mode 100644
index 7ca72c5..0000000
--- a/deps/libav/libavcodec/x86/fft_init.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "fft.h"
-
-av_cold void ff_fft_init_x86(FFTContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-#if ARCH_X86_32
-    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-        /* 3DNow! for K6-2/3 */
-        s->imdct_calc = ff_imdct_calc_3dnow;
-        s->imdct_half = ff_imdct_half_3dnow;
-        s->fft_calc   = ff_fft_calc_3dnow;
-    }
-    if (EXTERNAL_AMD3DNOWEXT(cpu_flags)) {
-        /* 3DNowEx for K7 */
-        s->imdct_calc = ff_imdct_calc_3dnowext;
-        s->imdct_half = ff_imdct_half_3dnowext;
-        s->fft_calc   = ff_fft_calc_3dnowext;
-    }
-#endif
-    if (EXTERNAL_SSE(cpu_flags)) {
-        /* SSE for P3/P4/K8 */
-        s->imdct_calc  = ff_imdct_calc_sse;
-        s->imdct_half  = ff_imdct_half_sse;
-        s->fft_permute = ff_fft_permute_sse;
-        s->fft_calc    = ff_fft_calc_sse;
-        s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
-    }
-    if (EXTERNAL_AVX(cpu_flags) && s->nbits >= 5) {
-        /* AVX for SB */
-        s->imdct_half      = ff_imdct_half_avx;
-        s->fft_calc        = ff_fft_calc_avx;
-        s->fft_permutation = FF_FFT_PERM_AVX;
-    }
-}
diff --git a/deps/libav/libavcodec/x86/fmtconvert.asm b/deps/libav/libavcodec/x86/fmtconvert.asm
deleted file mode 100644
index e7803df..0000000
--- a/deps/libav/libavcodec/x86/fmtconvert.asm
+++ /dev/null
@@ -1,429 +0,0 @@
-;******************************************************************************
-;* x86 optimized Format Conversion Utils
-;* Copyright (c) 2008 Loren Merritt
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_TEXT
-
-%macro CVTPS2PI 2
-%if cpuflag(sse)
-    cvtps2pi %1, %2
-%elif cpuflag(3dnow)
-    pf2id %1, %2
-%endif
-%endmacro
-
-;---------------------------------------------------------------------------------
-; void int32_to_float_fmul_scalar(float *dst, const int32_t *src, float mul, int len);
-;---------------------------------------------------------------------------------
-%macro INT32_TO_FLOAT_FMUL_SCALAR 1
-%if UNIX64
-cglobal int32_to_float_fmul_scalar, 3, 3, %1, dst, src, len
-%else
-cglobal int32_to_float_fmul_scalar, 4, 4, %1, dst, src, mul, len
-%endif
-%if WIN64
-    SWAP 0, 2
-%elif ARCH_X86_32
-    movss   m0, mulm
-%endif
-    SPLATD  m0
-    shl     lenq, 2
-    add     srcq, lenq
-    add     dstq, lenq
-    neg     lenq
-.loop:
-%if cpuflag(sse2)
-    cvtdq2ps  m1, [srcq+lenq   ]
-    cvtdq2ps  m2, [srcq+lenq+16]
-%else
-    cvtpi2ps  m1, [srcq+lenq   ]
-    cvtpi2ps  m3, [srcq+lenq+ 8]
-    cvtpi2ps  m2, [srcq+lenq+16]
-    cvtpi2ps  m4, [srcq+lenq+24]
-    movlhps   m1, m3
-    movlhps   m2, m4
-%endif
-    mulps     m1, m0
-    mulps     m2, m0
-    mova  [dstq+lenq   ], m1
-    mova  [dstq+lenq+16], m2
-    add     lenq, 32
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-INT32_TO_FLOAT_FMUL_SCALAR 5
-INIT_XMM sse2
-INT32_TO_FLOAT_FMUL_SCALAR 3
-
-
-;------------------------------------------------------------------------------
-; void ff_float_to_int16(int16_t *dst, const float *src, long len);
-;------------------------------------------------------------------------------
-%macro FLOAT_TO_INT16 1
-cglobal float_to_int16, 3, 3, %1, dst, src, len
-    add       lenq, lenq
-    lea       srcq, [srcq+2*lenq]
-    add       dstq, lenq
-    neg       lenq
-.loop:
-%if cpuflag(sse2)
-    cvtps2dq    m0, [srcq+2*lenq   ]
-    cvtps2dq    m1, [srcq+2*lenq+16]
-    packssdw    m0, m1
-    mova  [dstq+lenq], m0
-%else
-    CVTPS2PI    m0, [srcq+2*lenq   ]
-    CVTPS2PI    m1, [srcq+2*lenq+ 8]
-    CVTPS2PI    m2, [srcq+2*lenq+16]
-    CVTPS2PI    m3, [srcq+2*lenq+24]
-    packssdw    m0, m1
-    packssdw    m2, m3
-    mova  [dstq+lenq  ], m0
-    mova  [dstq+lenq+8], m2
-%endif
-    add       lenq, 16
-    js .loop
-%if mmsize == 8
-    emms
-%endif
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-FLOAT_TO_INT16 2
-INIT_MMX sse
-FLOAT_TO_INT16 0
-INIT_MMX 3dnow
-FLOAT_TO_INT16 0
-
-;------------------------------------------------------------------------------
-; void ff_float_to_int16_step(int16_t *dst, const float *src, long len, long step);
-;------------------------------------------------------------------------------
-%macro FLOAT_TO_INT16_STEP 1
-cglobal float_to_int16_step, 4, 7, %1, dst, src, len, step, step3, v1, v2
-    add       lenq, lenq
-    lea       srcq, [srcq+2*lenq]
-    lea     step3q, [stepq*3]
-    neg       lenq
-.loop:
-%if cpuflag(sse2)
-    cvtps2dq    m0, [srcq+2*lenq   ]
-    cvtps2dq    m1, [srcq+2*lenq+16]
-    packssdw    m0, m1
-    movd       v1d, m0
-    psrldq      m0, 4
-    movd       v2d, m0
-    psrldq      m0, 4
-    mov     [dstq], v1w
-    mov  [dstq+stepq*4], v2w
-    shr        v1d, 16
-    shr        v2d, 16
-    mov  [dstq+stepq*2], v1w
-    mov  [dstq+step3q*2], v2w
-    lea       dstq, [dstq+stepq*8]
-    movd       v1d, m0
-    psrldq      m0, 4
-    movd       v2d, m0
-    mov     [dstq], v1w
-    mov  [dstq+stepq*4], v2w
-    shr        v1d, 16
-    shr        v2d, 16
-    mov  [dstq+stepq*2], v1w
-    mov  [dstq+step3q*2], v2w
-    lea       dstq, [dstq+stepq*8]
-%else
-    CVTPS2PI    m0, [srcq+2*lenq   ]
-    CVTPS2PI    m1, [srcq+2*lenq+ 8]
-    CVTPS2PI    m2, [srcq+2*lenq+16]
-    CVTPS2PI    m3, [srcq+2*lenq+24]
-    packssdw    m0, m1
-    packssdw    m2, m3
-    movd       v1d, m0
-    psrlq       m0, 32
-    movd       v2d, m0
-    mov     [dstq], v1w
-    mov  [dstq+stepq*4], v2w
-    shr        v1d, 16
-    shr        v2d, 16
-    mov  [dstq+stepq*2], v1w
-    mov  [dstq+step3q*2], v2w
-    lea       dstq, [dstq+stepq*8]
-    movd       v1d, m2
-    psrlq       m2, 32
-    movd       v2d, m2
-    mov     [dstq], v1w
-    mov  [dstq+stepq*4], v2w
-    shr        v1d, 16
-    shr        v2d, 16
-    mov  [dstq+stepq*2], v1w
-    mov  [dstq+step3q*2], v2w
-    lea       dstq, [dstq+stepq*8]
-%endif
-    add       lenq, 16
-    js .loop
-%if mmsize == 8
-    emms
-%endif
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-FLOAT_TO_INT16_STEP 2
-INIT_MMX sse
-FLOAT_TO_INT16_STEP 0
-INIT_MMX 3dnow
-FLOAT_TO_INT16_STEP 0
-
-;-------------------------------------------------------------------------------
-; void ff_float_to_int16_interleave2(int16_t *dst, const float **src, long len);
-;-------------------------------------------------------------------------------
-%macro FLOAT_TO_INT16_INTERLEAVE2 0
-cglobal float_to_int16_interleave2, 3, 4, 2, dst, src0, src1, len
-    lea      lenq, [4*r2q]
-    mov     src1q, [src0q+gprsize]
-    mov     src0q, [src0q]
-    add      dstq, lenq
-    add     src0q, lenq
-    add     src1q, lenq
-    neg      lenq
-.loop:
-%if cpuflag(sse2)
-    cvtps2dq   m0, [src0q+lenq]
-    cvtps2dq   m1, [src1q+lenq]
-    packssdw   m0, m1
-    movhlps    m1, m0
-    punpcklwd  m0, m1
-    mova  [dstq+lenq], m0
-%else
-    CVTPS2PI   m0, [src0q+lenq  ]
-    CVTPS2PI   m1, [src0q+lenq+8]
-    CVTPS2PI   m2, [src1q+lenq  ]
-    CVTPS2PI   m3, [src1q+lenq+8]
-    packssdw   m0, m1
-    packssdw   m2, m3
-    mova       m1, m0
-    punpcklwd  m0, m2
-    punpckhwd  m1, m2
-    mova  [dstq+lenq  ], m0
-    mova  [dstq+lenq+8], m1
-%endif
-    add      lenq, 16
-    js .loop
-%if mmsize == 8
-    emms
-%endif
-    REP_RET
-%endmacro
-
-INIT_MMX 3dnow
-FLOAT_TO_INT16_INTERLEAVE2
-INIT_MMX sse
-FLOAT_TO_INT16_INTERLEAVE2
-INIT_XMM sse2
-FLOAT_TO_INT16_INTERLEAVE2
-
-%macro FLOAT_TO_INT16_INTERLEAVE6 0
-; void float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len)
-cglobal float_to_int16_interleave6, 2, 8, 0, dst, src, src1, src2, src3, src4, src5, len
-%if ARCH_X86_64
-    mov     lend, r2d
-%else
-    %define lend dword r2m
-%endif
-    mov src1q, [srcq+1*gprsize]
-    mov src2q, [srcq+2*gprsize]
-    mov src3q, [srcq+3*gprsize]
-    mov src4q, [srcq+4*gprsize]
-    mov src5q, [srcq+5*gprsize]
-    mov srcq,  [srcq]
-    sub src1q, srcq
-    sub src2q, srcq
-    sub src3q, srcq
-    sub src4q, srcq
-    sub src5q, srcq
-.loop:
-    CVTPS2PI   mm0, [srcq]
-    CVTPS2PI   mm1, [srcq+src1q]
-    CVTPS2PI   mm2, [srcq+src2q]
-    CVTPS2PI   mm3, [srcq+src3q]
-    CVTPS2PI   mm4, [srcq+src4q]
-    CVTPS2PI   mm5, [srcq+src5q]
-    packssdw   mm0, mm3
-    packssdw   mm1, mm4
-    packssdw   mm2, mm5
-    PSWAPD     mm3, mm0
-    punpcklwd  mm0, mm1
-    punpckhwd  mm1, mm2
-    punpcklwd  mm2, mm3
-    PSWAPD     mm3, mm0
-    punpckldq  mm0, mm2
-    punpckhdq  mm2, mm1
-    punpckldq  mm1, mm3
-    movq [dstq   ], mm0
-    movq [dstq+16], mm2
-    movq [dstq+ 8], mm1
-    add srcq, 8
-    add dstq, 24
-    sub lend, 2
-    jg .loop
-    emms
-    RET
-%endmacro ; FLOAT_TO_INT16_INTERLEAVE6
-
-INIT_MMX sse
-FLOAT_TO_INT16_INTERLEAVE6
-INIT_MMX 3dnow
-FLOAT_TO_INT16_INTERLEAVE6
-INIT_MMX 3dnowext
-FLOAT_TO_INT16_INTERLEAVE6
-
-;-----------------------------------------------------------------------------
-; void ff_float_interleave6(float *dst, const float **src, unsigned int len);
-;-----------------------------------------------------------------------------
-
-%macro FLOAT_INTERLEAVE6 1
-cglobal float_interleave6, 2, 8, %1, dst, src, src1, src2, src3, src4, src5, len
-%if ARCH_X86_64
-    mov     lend, r2d
-%else
-    %define lend dword r2m
-%endif
-    mov    src1q, [srcq+1*gprsize]
-    mov    src2q, [srcq+2*gprsize]
-    mov    src3q, [srcq+3*gprsize]
-    mov    src4q, [srcq+4*gprsize]
-    mov    src5q, [srcq+5*gprsize]
-    mov     srcq, [srcq]
-    sub    src1q, srcq
-    sub    src2q, srcq
-    sub    src3q, srcq
-    sub    src4q, srcq
-    sub    src5q, srcq
-.loop:
-%if cpuflag(sse)
-    movaps    m0, [srcq]
-    movaps    m1, [srcq+src1q]
-    movaps    m2, [srcq+src2q]
-    movaps    m3, [srcq+src3q]
-    movaps    m4, [srcq+src4q]
-    movaps    m5, [srcq+src5q]
-
-    SBUTTERFLYPS 0, 1, 6
-    SBUTTERFLYPS 2, 3, 6
-    SBUTTERFLYPS 4, 5, 6
-
-    movaps    m6, m4
-    shufps    m4, m0, 0xe4
-    movlhps   m0, m2
-    movhlps   m6, m2
-    movaps [dstq   ], m0
-    movaps [dstq+16], m4
-    movaps [dstq+32], m6
-
-    movaps    m6, m5
-    shufps    m5, m1, 0xe4
-    movlhps   m1, m3
-    movhlps   m6, m3
-    movaps [dstq+48], m1
-    movaps [dstq+64], m5
-    movaps [dstq+80], m6
-%else ; mmx
-    movq       m0, [srcq]
-    movq       m1, [srcq+src1q]
-    movq       m2, [srcq+src2q]
-    movq       m3, [srcq+src3q]
-    movq       m4, [srcq+src4q]
-    movq       m5, [srcq+src5q]
-
-    SBUTTERFLY dq, 0, 1, 6
-    SBUTTERFLY dq, 2, 3, 6
-    SBUTTERFLY dq, 4, 5, 6
-    movq [dstq   ], m0
-    movq [dstq+ 8], m2
-    movq [dstq+16], m4
-    movq [dstq+24], m1
-    movq [dstq+32], m3
-    movq [dstq+40], m5
-%endif
-    add      srcq, mmsize
-    add      dstq, mmsize*6
-    sub      lend, mmsize/4
-    jg .loop
-%if mmsize == 8
-    emms
-%endif
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-FLOAT_INTERLEAVE6 0
-INIT_XMM sse
-FLOAT_INTERLEAVE6 7
-
-;-----------------------------------------------------------------------------
-; void ff_float_interleave2(float *dst, const float **src, unsigned int len);
-;-----------------------------------------------------------------------------
-
-%macro FLOAT_INTERLEAVE2 1
-cglobal float_interleave2, 3, 4, %1, dst, src, len, src1
-    mov     src1q, [srcq+gprsize]
-    mov      srcq, [srcq        ]
-    sub     src1q, srcq
-.loop:
-    mova       m0, [srcq             ]
-    mova       m1, [srcq+src1q       ]
-    mova       m3, [srcq      +mmsize]
-    mova       m4, [srcq+src1q+mmsize]
-
-    mova       m2, m0
-    PUNPCKLDQ  m0, m1
-    PUNPCKHDQ  m2, m1
-
-    mova       m1, m3
-    PUNPCKLDQ  m3, m4
-    PUNPCKHDQ  m1, m4
-
-    mova  [dstq         ], m0
-    mova  [dstq+1*mmsize], m2
-    mova  [dstq+2*mmsize], m3
-    mova  [dstq+3*mmsize], m1
-
-    add      srcq, mmsize*2
-    add      dstq, mmsize*4
-    sub      lend, mmsize/2
-    jg .loop
-%if mmsize == 8
-    emms
-%endif
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-%define PUNPCKLDQ punpckldq
-%define PUNPCKHDQ punpckhdq
-FLOAT_INTERLEAVE2 0
-INIT_XMM sse
-%define PUNPCKLDQ unpcklps
-%define PUNPCKHDQ unpckhps
-FLOAT_INTERLEAVE2 5
diff --git a/deps/libav/libavcodec/x86/fmtconvert_init.c b/deps/libav/libavcodec/x86/fmtconvert_init.c
deleted file mode 100644
index 3d75df9..0000000
--- a/deps/libav/libavcodec/x86/fmtconvert_init.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Format Conversion Utils
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * MMX optimization by Nick Kurshev <nickols_k at mail.ru>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/fmtconvert.h"
-
-#if HAVE_YASM
-
-void ff_int32_to_float_fmul_scalar_sse (float *dst, const int32_t *src, float mul, int len);
-void ff_int32_to_float_fmul_scalar_sse2(float *dst, const int32_t *src, float mul, int len);
-
-void ff_float_to_int16_3dnow(int16_t *dst, const float *src, long len);
-void ff_float_to_int16_sse  (int16_t *dst, const float *src, long len);
-void ff_float_to_int16_sse2 (int16_t *dst, const float *src, long len);
-
-void ff_float_to_int16_step_3dnow(int16_t *dst, const float *src, long len, long step);
-void ff_float_to_int16_step_sse  (int16_t *dst, const float *src, long len, long step);
-void ff_float_to_int16_step_sse2 (int16_t *dst, const float *src, long len, long step);
-
-void ff_float_to_int16_interleave2_3dnow(int16_t *dst, const float **src, long len);
-void ff_float_to_int16_interleave2_sse  (int16_t *dst, const float **src, long len);
-void ff_float_to_int16_interleave2_sse2 (int16_t *dst, const float **src, long len);
-
-void ff_float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len);
-void ff_float_to_int16_interleave6_3dnow(int16_t *dst, const float **src, int len);
-void ff_float_to_int16_interleave6_3dnowext(int16_t *dst, const float **src, int len);
-
-#define ff_float_to_int16_interleave6_sse2 ff_float_to_int16_interleave6_sse
-
-#define FLOAT_TO_INT16_INTERLEAVE(cpu) \
-/* gcc pessimizes register allocation if this is in the same function as float_to_int16_interleave_sse2*/\
-static av_noinline void float_to_int16_interleave_misc_##cpu(int16_t *dst, const float **src, long len, int channels){\
-    int c;\
-    for(c=0; c<channels; c++){\
-        ff_float_to_int16_step_##cpu(dst+c, src[c], len, channels);\
-    }\
-}\
-\
-static void float_to_int16_interleave_##cpu(int16_t *dst, const float **src, long len, int channels){\
-    if(channels==1)\
-        ff_float_to_int16_##cpu(dst, src[0], len);\
-    else if(channels==2){\
-        ff_float_to_int16_interleave2_##cpu(dst, src, len);\
-    }else if(channels==6){\
-        ff_float_to_int16_interleave6_##cpu(dst, src, len);\
-    }else\
-        float_to_int16_interleave_misc_##cpu(dst, src, len, channels);\
-}
-
-FLOAT_TO_INT16_INTERLEAVE(3dnow)
-FLOAT_TO_INT16_INTERLEAVE(sse)
-FLOAT_TO_INT16_INTERLEAVE(sse2)
-
-static void float_to_int16_interleave_3dnowext(int16_t *dst, const float **src,
-                                               long len, int channels)
-{
-    if(channels==6)
-        ff_float_to_int16_interleave6_3dnowext(dst, src, len);
-    else
-        float_to_int16_interleave_3dnow(dst, src, len, channels);
-}
-
-void ff_float_interleave2_mmx(float *dst, const float **src, unsigned int len);
-void ff_float_interleave2_sse(float *dst, const float **src, unsigned int len);
-
-void ff_float_interleave6_mmx(float *dst, const float **src, unsigned int len);
-void ff_float_interleave6_sse(float *dst, const float **src, unsigned int len);
-
-static void float_interleave_mmx(float *dst, const float **src,
-                                 unsigned int len, int channels)
-{
-    if (channels == 2) {
-        ff_float_interleave2_mmx(dst, src, len);
-    } else if (channels == 6)
-        ff_float_interleave6_mmx(dst, src, len);
-    else
-        ff_float_interleave_c(dst, src, len, channels);
-}
-
-static void float_interleave_sse(float *dst, const float **src,
-                                 unsigned int len, int channels)
-{
-    if (channels == 2) {
-        ff_float_interleave2_sse(dst, src, len);
-    } else if (channels == 6)
-        ff_float_interleave6_sse(dst, src, len);
-    else
-        ff_float_interleave_c(dst, src, len, channels);
-}
-#endif /* HAVE_YASM */
-
-av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx)
-{
-#if HAVE_YASM
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->float_interleave = float_interleave_mmx;
-    }
-    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
-            c->float_to_int16            = ff_float_to_int16_3dnow;
-            c->float_to_int16_interleave = float_to_int16_interleave_3dnow;
-        }
-    }
-    if (EXTERNAL_AMD3DNOWEXT(cpu_flags)) {
-        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
-            c->float_to_int16_interleave = float_to_int16_interleave_3dnowext;
-        }
-    }
-    if (EXTERNAL_SSE(cpu_flags)) {
-        c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse;
-        c->float_to_int16             = ff_float_to_int16_sse;
-        c->float_to_int16_interleave  = float_to_int16_interleave_sse;
-        c->float_interleave           = float_interleave_sse;
-    }
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2;
-        c->float_to_int16             = ff_float_to_int16_sse2;
-        c->float_to_int16_interleave  = float_to_int16_interleave_sse2;
-    }
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavcodec/x86/fpel.asm b/deps/libav/libavcodec/x86/fpel.asm
deleted file mode 100644
index 43b039d..0000000
--- a/deps/libav/libavcodec/x86/fpel.asm
+++ /dev/null
@@ -1,106 +0,0 @@
-;******************************************************************************
-;* MMX optimized DSP utils
-;* Copyright (c) 2008 Loren Merritt
-;* Copyright (c) 2003-2013 Michael Niedermayer
-;* Copyright (c) 2013 Daniel Kang
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION .text
-
-INIT_MMX mmxext
-; void pixels(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro PIXELS48 2
-%if %2 == 4
-%define OP movh
-%else
-%define OP mova
-%endif
-cglobal %1_pixels%2, 4,5
-    movsxdifnidn r2, r2d
-    lea          r4, [r2*3]
-.loop:
-    OP           m0, [r1]
-    OP           m1, [r1+r2]
-    OP           m2, [r1+r2*2]
-    OP           m3, [r1+r4]
-    lea          r1, [r1+r2*4]
-%ifidn %1, avg
-    pavgb        m0, [r0]
-    pavgb        m1, [r0+r2]
-    pavgb        m2, [r0+r2*2]
-    pavgb        m3, [r0+r4]
-%endif
-    OP         [r0], m0
-    OP      [r0+r2], m1
-    OP    [r0+r2*2], m2
-    OP      [r0+r4], m3
-    sub         r3d, 4
-    lea          r0, [r0+r2*4]
-    jne       .loop
-    RET
-%endmacro
-
-PIXELS48 put, 4
-PIXELS48 avg, 4
-PIXELS48 put, 8
-PIXELS48 avg, 8
-
-
-INIT_XMM sse2
-; void put_pixels16_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-cglobal put_pixels16, 4,5,4
-    lea          r4, [r2*3]
-.loop:
-    movu         m0, [r1]
-    movu         m1, [r1+r2]
-    movu         m2, [r1+r2*2]
-    movu         m3, [r1+r4]
-    lea          r1, [r1+r2*4]
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    mova  [r0+r2*2], m2
-    mova    [r0+r4], m3
-    sub         r3d, 4
-    lea          r0, [r0+r2*4]
-    jnz       .loop
-    REP_RET
-
-; void avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-cglobal avg_pixels16, 4,5,4
-    lea          r4, [r2*3]
-.loop:
-    movu         m0, [r1]
-    movu         m1, [r1+r2]
-    movu         m2, [r1+r2*2]
-    movu         m3, [r1+r4]
-    lea          r1, [r1+r2*4]
-    pavgb        m0, [r0]
-    pavgb        m1, [r0+r2]
-    pavgb        m2, [r0+r2*2]
-    pavgb        m3, [r0+r4]
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    mova  [r0+r2*2], m2
-    mova    [r0+r4], m3
-    sub         r3d, 4
-    lea          r0, [r0+r2*4]
-    jnz       .loop
-    REP_RET
diff --git a/deps/libav/libavcodec/x86/fpel_mmx.c b/deps/libav/libavcodec/x86/fpel_mmx.c
deleted file mode 100644
index 1ae8f86..0000000
--- a/deps/libav/libavcodec/x86/fpel_mmx.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * MMX-optimized avg/put pixel routines
- *
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "config.h"
-#include "dsputil_x86.h"
-
-#if HAVE_MMX_INLINE
-
-// in case more speed is needed - unrolling would certainly help
-void ff_avg_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
-                        ptrdiff_t line_size, int h)
-{
-    MOVQ_BFE(mm6);
-    JUMPALIGN();
-    do {
-        __asm__ volatile(
-             "movq  %0, %%mm0           \n\t"
-             "movq  %1, %%mm1           \n\t"
-             PAVGB_MMX(%%mm0, %%mm1, %%mm2, %%mm6)
-             "movq  %%mm2, %0           \n\t"
-             :"+m"(*block)
-             :"m"(*pixels)
-             :"memory");
-        pixels += line_size;
-        block += line_size;
-    }
-    while (--h);
-}
-
-void ff_avg_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
-                         ptrdiff_t line_size, int h)
-{
-    MOVQ_BFE(mm6);
-    JUMPALIGN();
-    do {
-        __asm__ volatile(
-             "movq  %0, %%mm0           \n\t"
-             "movq  %1, %%mm1           \n\t"
-             PAVGB_MMX(%%mm0, %%mm1, %%mm2, %%mm6)
-             "movq  %%mm2, %0           \n\t"
-             "movq  8%0, %%mm0          \n\t"
-             "movq  8%1, %%mm1          \n\t"
-             PAVGB_MMX(%%mm0, %%mm1, %%mm2, %%mm6)
-             "movq  %%mm2, 8%0          \n\t"
-             :"+m"(*block)
-             :"m"(*pixels)
-             :"memory");
-        pixels += line_size;
-        block += line_size;
-    }
-    while (--h);
-}
-
-void ff_put_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
-                        ptrdiff_t line_size, int h)
-{
-    __asm__ volatile (
-        "lea   (%3, %3), %%"REG_a"      \n\t"
-        ".p2align     3                 \n\t"
-        "1:                             \n\t"
-        "movq  (%1    ), %%mm0          \n\t"
-        "movq  (%1, %3), %%mm1          \n\t"
-        "movq     %%mm0, (%2)           \n\t"
-        "movq     %%mm1, (%2, %3)       \n\t"
-        "add  %%"REG_a", %1             \n\t"
-        "add  %%"REG_a", %2             \n\t"
-        "movq  (%1    ), %%mm0          \n\t"
-        "movq  (%1, %3), %%mm1          \n\t"
-        "movq     %%mm0, (%2)           \n\t"
-        "movq     %%mm1, (%2, %3)       \n\t"
-        "add  %%"REG_a", %1             \n\t"
-        "add  %%"REG_a", %2             \n\t"
-        "subl        $4, %0             \n\t"
-        "jnz         1b                 \n\t"
-        : "+g"(h), "+r"(pixels),  "+r"(block)
-        : "r"((x86_reg)line_size)
-        : "%"REG_a, "memory"
-        );
-}
-
-void ff_put_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
-                         ptrdiff_t line_size, int h)
-{
-    __asm__ volatile (
-        "lea   (%3, %3), %%"REG_a"      \n\t"
-        ".p2align     3                 \n\t"
-        "1:                             \n\t"
-        "movq  (%1    ), %%mm0          \n\t"
-        "movq 8(%1    ), %%mm4          \n\t"
-        "movq  (%1, %3), %%mm1          \n\t"
-        "movq 8(%1, %3), %%mm5          \n\t"
-        "movq     %%mm0,  (%2)          \n\t"
-        "movq     %%mm4, 8(%2)          \n\t"
-        "movq     %%mm1,  (%2, %3)      \n\t"
-        "movq     %%mm5, 8(%2, %3)      \n\t"
-        "add  %%"REG_a", %1             \n\t"
-        "add  %%"REG_a", %2             \n\t"
-        "movq  (%1    ), %%mm0          \n\t"
-        "movq 8(%1    ), %%mm4          \n\t"
-        "movq  (%1, %3), %%mm1          \n\t"
-        "movq 8(%1, %3), %%mm5          \n\t"
-        "movq     %%mm0,  (%2)          \n\t"
-        "movq     %%mm4, 8(%2)          \n\t"
-        "movq     %%mm1,  (%2, %3)      \n\t"
-        "movq     %%mm5, 8(%2, %3)      \n\t"
-        "add  %%"REG_a", %1             \n\t"
-        "add  %%"REG_a", %2             \n\t"
-        "subl        $4, %0             \n\t"
-        "jnz         1b                 \n\t"
-        : "+g"(h), "+r"(pixels),  "+r"(block)
-        : "r"((x86_reg)line_size)
-        : "%"REG_a, "memory"
-        );
-}
-
-#endif /* HAVE_MMX_INLINE */
diff --git a/deps/libav/libavcodec/x86/h263_loopfilter.asm b/deps/libav/libavcodec/x86/h263_loopfilter.asm
deleted file mode 100644
index a940aad..0000000
--- a/deps/libav/libavcodec/x86/h263_loopfilter.asm
+++ /dev/null
@@ -1,187 +0,0 @@
-;******************************************************************************
-;* MMX-optimized H.263 loop filter
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-cextern pb_FC
-cextern h263_loop_filter_strength
-
-SECTION_TEXT
-
-%macro H263_LOOP_FILTER 5
-    pxor         m7, m7
-    mova         m0, [%1]
-    mova         m1, [%1]
-    mova         m2, [%4]
-    mova         m3, [%4]
-    punpcklbw    m0, m7
-    punpckhbw    m1, m7
-    punpcklbw    m2, m7
-    punpckhbw    m3, m7
-    psubw        m0, m2
-    psubw        m1, m3
-    mova         m2, [%2]
-    mova         m3, [%2]
-    mova         m4, [%3]
-    mova         m5, [%3]
-    punpcklbw    m2, m7
-    punpckhbw    m3, m7
-    punpcklbw    m4, m7
-    punpckhbw    m5, m7
-    psubw        m4, m2
-    psubw        m5, m3
-    psllw        m4, 2
-    psllw        m5, 2
-    paddw        m4, m0
-    paddw        m5, m1
-    pxor         m6, m6
-    pcmpgtw      m6, m4
-    pcmpgtw      m7, m5
-    pxor         m4, m6
-    pxor         m5, m7
-    psubw        m4, m6
-    psubw        m5, m7
-    psrlw        m4, 3
-    psrlw        m5, 3
-    packuswb     m4, m5
-    packsswb     m6, m7
-    pxor         m7, m7
-    movd         m2, %5
-    punpcklbw    m2, m2
-    punpcklbw    m2, m2
-    punpcklbw    m2, m2
-    psubusb      m2, m4
-    mova         m3, m2
-    psubusb      m3, m4
-    psubb        m2, m3
-    mova         m3, [%2]
-    mova         m4, [%3]
-    pxor         m3, m6
-    pxor         m4, m6
-    paddusb      m3, m2
-    psubusb      m4, m2
-    pxor         m3, m6
-    pxor         m4, m6
-    paddusb      m2, m2
-    packsswb     m0, m1
-    pcmpgtb      m7, m0
-    pxor         m0, m7
-    psubb        m0, m7
-    mova         m1, m0
-    psubusb      m0, m2
-    psubb        m1, m0
-    pand         m1, [pb_FC]
-    psrlw        m1, 2
-    pxor         m1, m7
-    psubb        m1, m7
-    mova         m5, [%1]
-    mova         m6, [%4]
-    psubb        m5, m1
-    paddb        m6, m1
-%endmacro
-
-INIT_MMX mmx
-; void h263_v_loop_filter(uint8_t *src, int stride, int qscale)
-cglobal h263_v_loop_filter, 3,5
-    movsxdifnidn r1, r1d
-    movsxdifnidn r2, r2d
-
-    lea          r4, [h263_loop_filter_strength]
-    movzx       r3d, BYTE [r4+r2]
-    movsx        r2, r3b
-    shl          r2, 1
-
-    mov          r3, r0
-    sub          r3, r1
-    mov          r4, r3
-    sub          r4, r1
-    H263_LOOP_FILTER r4, r3, r0, r0+r1, r2d
-
-    mova       [r3], m3
-    mova       [r0], m4
-    mova       [r4], m5
-    mova    [r0+r1], m6
-    RET
-
-%macro TRANSPOSE4X4 2
-    movd      m0, [%1]
-    movd      m1, [%1+r1]
-    movd      m2, [%1+r1*2]
-    movd      m3, [%1+r3]
-    punpcklbw m0, m1
-    punpcklbw m2, m3
-    mova      m1, m0
-    punpcklwd m0, m2
-    punpckhwd m1, m2
-    movd [%2+ 0], m0
-    punpckhdq m0, m0
-    movd [%2+ 8], m0
-    movd [%2+16], m1
-    punpckhdq m1, m1
-    movd [%2+24], m1
-%endmacro
-
-
-; void h263_h_loop_filter(uint8_t *src, int stride, int qscale)
-INIT_MMX mmx
-cglobal h263_h_loop_filter, 3,5,0,32
-    movsxdifnidn r1, r1d
-    movsxdifnidn r2, r2d
-
-    lea          r4, [h263_loop_filter_strength]
-    movzx       r3d, BYTE [r4+r2]
-    movsx        r2, r3b
-    shl          r2, 1
-
-    sub          r0, 2
-    lea          r3, [r1*3]
-
-    TRANSPOSE4X4 r0, rsp
-    lea          r4, [r0+r1*4]
-    TRANSPOSE4X4 r4, rsp+4
-
-    H263_LOOP_FILTER rsp, rsp+8, rsp+16, rsp+24, r2d
-
-    mova         m1, m5
-    mova         m0, m4
-    punpcklbw    m5, m3
-    punpcklbw    m4, m6
-    punpckhbw    m1, m3
-    punpckhbw    m0, m6
-    mova         m3, m5
-    mova         m6, m1
-    punpcklwd    m5, m4
-    punpcklwd    m1, m0
-    punpckhwd    m3, m4
-    punpckhwd    m6, m0
-    movd       [r0], m5
-    punpckhdq    m5, m5
-    movd  [r0+r1*1], m5
-    movd  [r0+r1*2], m3
-    punpckhdq    m3, m3
-    movd    [r0+r3], m3
-    movd       [r4], m1
-    punpckhdq    m1, m1
-    movd  [r4+r1*1], m1
-    movd  [r4+r1*2], m6
-    punpckhdq    m6, m6
-    movd    [r4+r3], m6
-    RET
diff --git a/deps/libav/libavcodec/x86/h263dsp_init.c b/deps/libav/libavcodec/x86/h263dsp_init.c
deleted file mode 100644
index d4fab98..0000000
--- a/deps/libav/libavcodec/x86/h263dsp_init.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2013 Diego Biurrun <diego at biurrun.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/h263dsp.h"
-
-void ff_h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale);
-void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale);
-
-av_cold void ff_h263dsp_init_x86(H263DSPContext *c)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx;
-        c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx;
-    }
-}
diff --git a/deps/libav/libavcodec/x86/h264_chromamc.asm b/deps/libav/libavcodec/x86/h264_chromamc.asm
deleted file mode 100644
index b7b18e0..0000000
--- a/deps/libav/libavcodec/x86/h264_chromamc.asm
+++ /dev/null
@@ -1,678 +0,0 @@
-;******************************************************************************
-;* MMX/SSSE3-optimized functions for H264 chroma MC
-;* Copyright (c) 2005 Zoltan Hidvegi <hzoli -a- hzoli -d- com>,
-;*               2005-2008 Loren Merritt
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-rnd_rv40_2d_tbl: times 4 dw  0
-                 times 4 dw 16
-                 times 4 dw 32
-                 times 4 dw 16
-                 times 4 dw 32
-                 times 4 dw 28
-                 times 4 dw 32
-                 times 4 dw 28
-                 times 4 dw  0
-                 times 4 dw 32
-                 times 4 dw 16
-                 times 4 dw 32
-                 times 4 dw 32
-                 times 4 dw 28
-                 times 4 dw 32
-                 times 4 dw 28
-rnd_rv40_1d_tbl: times 4 dw  0
-                 times 4 dw  2
-                 times 4 dw  4
-                 times 4 dw  2
-                 times 4 dw  4
-                 times 4 dw  3
-                 times 4 dw  4
-                 times 4 dw  3
-                 times 4 dw  0
-                 times 4 dw  4
-                 times 4 dw  2
-                 times 4 dw  4
-                 times 4 dw  4
-                 times 4 dw  3
-                 times 4 dw  4
-                 times 4 dw  3
-
-cextern pw_3
-cextern pw_4
-cextern pw_8
-pw_28: times 8 dw 28
-cextern pw_32
-cextern pw_64
-
-SECTION .text
-
-%macro mv0_pixels_mc8 0
-    lea           r4, [r2*2 ]
-.next4rows:
-    movq         mm0, [r1   ]
-    movq         mm1, [r1+r2]
-    add           r1, r4
-    CHROMAMC_AVG mm0, [r0   ]
-    CHROMAMC_AVG mm1, [r0+r2]
-    movq     [r0   ], mm0
-    movq     [r0+r2], mm1
-    add           r0, r4
-    movq         mm0, [r1   ]
-    movq         mm1, [r1+r2]
-    add           r1, r4
-    CHROMAMC_AVG mm0, [r0   ]
-    CHROMAMC_AVG mm1, [r0+r2]
-    movq     [r0   ], mm0
-    movq     [r0+r2], mm1
-    add           r0, r4
-    sub          r3d, 4
-    jne .next4rows
-%endmacro
-
-%macro chroma_mc8_mmx_func 2-3
-%ifidn %2, rv40
-%ifdef PIC
-%define rnd_1d_rv40 r8
-%define rnd_2d_rv40 r8
-%define extra_regs 2
-%else ; no-PIC
-%define rnd_1d_rv40 rnd_rv40_1d_tbl
-%define rnd_2d_rv40 rnd_rv40_2d_tbl
-%define extra_regs 1
-%endif ; PIC
-%else
-%define extra_regs 0
-%endif ; rv40
-; put/avg_h264_chroma_mc8_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/,
-;                           int stride, int h, int mx, int my)
-cglobal %1_%2_chroma_mc8%3, 6, 7 + extra_regs, 0
-%if ARCH_X86_64
-    movsxd        r2, r2d
-%endif
-    mov          r6d, r5d
-    or           r6d, r4d
-    jne .at_least_one_non_zero
-    ; mx == 0 AND my == 0 - no filter needed
-    mv0_pixels_mc8
-    REP_RET
-
-.at_least_one_non_zero:
-%ifidn %2, rv40
-%if ARCH_X86_64
-    mov           r7, r5
-    and           r7, 6         ; &~1 for mx/my=[0,7]
-    lea           r7, [r7*4+r4]
-    sar          r7d, 1
-%define rnd_bias r7
-%define dest_reg r0
-%else ; x86-32
-    mov           r0, r5
-    and           r0, 6         ; &~1 for mx/my=[0,7]
-    lea           r0, [r0*4+r4]
-    sar          r0d, 1
-%define rnd_bias r0
-%define dest_reg r5
-%endif
-%else ; vc1, h264
-%define rnd_bias  0
-%define dest_reg r0
-%endif
-
-    test         r5d, r5d
-    mov           r6, 1
-    je .my_is_zero
-    test         r4d, r4d
-    mov           r6, r2        ; dxy = x ? 1 : stride
-    jne .both_non_zero
-.my_is_zero:
-    ; mx == 0 XOR my == 0 - 1 dimensional filter only
-    or           r4d, r5d       ; x + y
-
-%ifidn %2, rv40
-%ifdef PIC
-    lea           r8, [rnd_rv40_1d_tbl]
-%endif
-%if ARCH_X86_64 == 0
-    mov           r5, r0m
-%endif
-%endif
-
-    movd          m5, r4d
-    movq          m4, [pw_8]
-    movq          m6, [rnd_1d_%2+rnd_bias*8] ; mm6 = rnd >> 3
-    punpcklwd     m5, m5
-    punpckldq     m5, m5        ; mm5 = B = x
-    pxor          m7, m7
-    psubw         m4, m5        ; mm4 = A = 8-x
-
-.next1drow:
-    movq          m0, [r1   ]   ; mm0 = src[0..7]
-    movq          m2, [r1+r6]   ; mm1 = src[1..8]
-
-    movq          m1, m0
-    movq          m3, m2
-    punpcklbw     m0, m7
-    punpckhbw     m1, m7
-    punpcklbw     m2, m7
-    punpckhbw     m3, m7
-    pmullw        m0, m4        ; [mm0,mm1] = A * src[0..7]
-    pmullw        m1, m4
-    pmullw        m2, m5        ; [mm2,mm3] = B * src[1..8]
-    pmullw        m3, m5
-
-    paddw         m0, m6
-    paddw         m1, m6
-    paddw         m0, m2
-    paddw         m1, m3
-    psrlw         m0, 3
-    psrlw         m1, 3
-    packuswb      m0, m1
-    CHROMAMC_AVG  m0, [dest_reg]
-    movq  [dest_reg], m0        ; dst[0..7] = (A * src[0..7] + B * src[1..8] + (rnd >> 3)) >> 3
-
-    add     dest_reg, r2
-    add           r1, r2
-    dec           r3d
-    jne .next1drow
-    REP_RET
-
-.both_non_zero: ; general case, bilinear
-    movd          m4, r4d         ; x
-    movd          m6, r5d         ; y
-%ifidn %2, rv40
-%ifdef PIC
-    lea           r8, [rnd_rv40_2d_tbl]
-%endif
-%if ARCH_X86_64 == 0
-    mov           r5, r0m
-%endif
-%endif
-    mov           r6, rsp         ; backup stack pointer
-    and          rsp, ~(mmsize-1) ; align stack
-    sub          rsp, 16          ; AA and DD
-
-    punpcklwd     m4, m4
-    punpcklwd     m6, m6
-    punpckldq     m4, m4          ; mm4 = x words
-    punpckldq     m6, m6          ; mm6 = y words
-    movq          m5, m4
-    pmullw        m4, m6          ; mm4 = x * y
-    psllw         m5, 3
-    psllw         m6, 3
-    movq          m7, m5
-    paddw         m7, m6
-    movq     [rsp+8], m4          ; DD = x * y
-    psubw         m5, m4          ; mm5 = B = 8x - xy
-    psubw         m6, m4          ; mm6 = C = 8y - xy
-    paddw         m4, [pw_64]
-    psubw         m4, m7          ; mm4 = A = xy - (8x+8y) + 64
-    pxor          m7, m7
-    movq     [rsp  ], m4
-
-    movq          m0, [r1  ]      ; mm0 = src[0..7]
-    movq          m1, [r1+1]      ; mm1 = src[1..8]
-.next2drow:
-    add           r1, r2
-
-    movq          m2, m0
-    movq          m3, m1
-    punpckhbw     m0, m7
-    punpcklbw     m1, m7
-    punpcklbw     m2, m7
-    punpckhbw     m3, m7
-    pmullw        m0, [rsp]
-    pmullw        m2, [rsp]
-    pmullw        m1, m5
-    pmullw        m3, m5
-    paddw         m2, m1          ; mm2 = A * src[0..3] + B * src[1..4]
-    paddw         m3, m0          ; mm3 = A * src[4..7] + B * src[5..8]
-
-    movq          m0, [r1]
-    movq          m1, m0
-    punpcklbw     m0, m7
-    punpckhbw     m1, m7
-    pmullw        m0, m6
-    pmullw        m1, m6
-    paddw         m2, m0
-    paddw         m3, m1          ; [mm2,mm3] += C * src[0..7]
-
-    movq          m1, [r1+1]
-    movq          m0, m1
-    movq          m4, m1
-    punpcklbw     m0, m7
-    punpckhbw     m4, m7
-    pmullw        m0, [rsp+8]
-    pmullw        m4, [rsp+8]
-    paddw         m2, m0
-    paddw         m3, m4          ; [mm2,mm3] += D * src[1..8]
-    movq          m0, [r1]
-
-    paddw         m2, [rnd_2d_%2+rnd_bias*8]
-    paddw         m3, [rnd_2d_%2+rnd_bias*8]
-    psrlw         m2, 6
-    psrlw         m3, 6
-    packuswb      m2, m3
-    CHROMAMC_AVG  m2, [dest_reg]
-    movq  [dest_reg], m2          ; dst[0..7] = ([mm2,mm3] + rnd) >> 6
-
-    add     dest_reg, r2
-    dec          r3d
-    jne .next2drow
-    mov          rsp, r6          ; restore stack pointer
-    RET
-%endmacro
-
-%macro chroma_mc4_mmx_func 2
-%define extra_regs 0
-%ifidn %2, rv40
-%ifdef PIC
-%define extra_regs 1
-%endif ; PIC
-%endif ; rv40
-cglobal %1_%2_chroma_mc4, 6, 6 + extra_regs, 0
-%if ARCH_X86_64
-    movsxd        r2, r2d
-%endif
-    pxor          m7, m7
-    movd          m2, r4d         ; x
-    movd          m3, r5d         ; y
-    movq          m4, [pw_8]
-    movq          m5, [pw_8]
-    punpcklwd     m2, m2
-    punpcklwd     m3, m3
-    punpcklwd     m2, m2
-    punpcklwd     m3, m3
-    psubw         m4, m2
-    psubw         m5, m3
-
-%ifidn %2, rv40
-%ifdef PIC
-   lea            r6, [rnd_rv40_2d_tbl]
-%define rnd_2d_rv40 r6
-%else
-%define rnd_2d_rv40 rnd_rv40_2d_tbl
-%endif
-    and           r5, 6         ; &~1 for mx/my=[0,7]
-    lea           r5, [r5*4+r4]
-    sar          r5d, 1
-%define rnd_bias r5
-%else ; vc1, h264
-%define rnd_bias 0
-%endif
-
-    movd          m0, [r1  ]
-    movd          m6, [r1+1]
-    add           r1, r2
-    punpcklbw     m0, m7
-    punpcklbw     m6, m7
-    pmullw        m0, m4
-    pmullw        m6, m2
-    paddw         m6, m0
-
-.next2rows:
-    movd          m0, [r1  ]
-    movd          m1, [r1+1]
-    add           r1, r2
-    punpcklbw     m0, m7
-    punpcklbw     m1, m7
-    pmullw        m0, m4
-    pmullw        m1, m2
-    paddw         m1, m0
-    movq          m0, m1
-
-    pmullw        m6, m5
-    pmullw        m1, m3
-    paddw         m6, [rnd_2d_%2+rnd_bias*8]
-    paddw         m1, m6
-    psrlw         m1, 6
-    packuswb      m1, m1
-    CHROMAMC_AVG4 m1, m6, [r0]
-    movd        [r0], m1
-    add           r0, r2
-
-    movd          m6, [r1  ]
-    movd          m1, [r1+1]
-    add           r1, r2
-    punpcklbw     m6, m7
-    punpcklbw     m1, m7
-    pmullw        m6, m4
-    pmullw        m1, m2
-    paddw         m1, m6
-    movq          m6, m1
-    pmullw        m0, m5
-    pmullw        m1, m3
-    paddw         m0, [rnd_2d_%2+rnd_bias*8]
-    paddw         m1, m0
-    psrlw         m1, 6
-    packuswb      m1, m1
-    CHROMAMC_AVG4 m1, m0, [r0]
-    movd        [r0], m1
-    add           r0, r2
-    sub          r3d, 2
-    jnz .next2rows
-    REP_RET
-%endmacro
-
-%macro chroma_mc2_mmx_func 2
-cglobal %1_%2_chroma_mc2, 6, 7, 0
-%if ARCH_X86_64
-    movsxd        r2, r2d
-%endif
-
-    mov          r6d, r4d
-    shl          r4d, 16
-    sub          r4d, r6d
-    add          r4d, 8
-    imul         r5d, r4d         ; x*y<<16 | y*(8-x)
-    shl          r4d, 3
-    sub          r4d, r5d         ; x*(8-y)<<16 | (8-x)*(8-y)
-
-    movd          m5, r4d
-    movd          m6, r5d
-    punpckldq     m5, m5          ; mm5 = {A,B,A,B}
-    punpckldq     m6, m6          ; mm6 = {C,D,C,D}
-    pxor          m7, m7
-    movd          m2, [r1]
-    punpcklbw     m2, m7
-    pshufw        m2, m2, 0x94    ; mm0 = src[0,1,1,2]
-
-.nextrow:
-    add           r1, r2
-    movq          m1, m2
-    pmaddwd       m1, m5          ; mm1 = A * src[0,1] + B * src[1,2]
-    movd          m0, [r1]
-    punpcklbw     m0, m7
-    pshufw        m0, m0, 0x94    ; mm0 = src[0,1,1,2]
-    movq          m2, m0
-    pmaddwd       m0, m6
-    paddw         m1, [rnd_2d_%2]
-    paddw         m1, m0          ; mm1 += C * src[0,1] + D * src[1,2]
-    psrlw         m1, 6
-    packssdw      m1, m7
-    packuswb      m1, m7
-    CHROMAMC_AVG4 m1, m3, [r0]
-    movd         r5d, m1
-    mov         [r0], r5w
-    add           r0, r2
-    sub          r3d, 1
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-%define rnd_1d_h264 pw_4
-%define rnd_2d_h264 pw_32
-%define rnd_1d_vc1  pw_3
-%define rnd_2d_vc1  pw_28
-
-%macro NOTHING 2-3
-%endmacro
-%macro DIRECT_AVG 2
-    PAVGB         %1, %2
-%endmacro
-%macro COPY_AVG 3
-    movd          %2, %3
-    PAVGB         %1, %2
-%endmacro
-
-INIT_MMX mmx
-%define CHROMAMC_AVG  NOTHING
-%define CHROMAMC_AVG4 NOTHING
-chroma_mc8_mmx_func put, h264, _rnd
-chroma_mc8_mmx_func put, vc1,  _nornd
-chroma_mc8_mmx_func put, rv40
-chroma_mc4_mmx_func put, h264
-chroma_mc4_mmx_func put, rv40
-
-INIT_MMX mmxext
-chroma_mc2_mmx_func put, h264
-
-%define CHROMAMC_AVG  DIRECT_AVG
-%define CHROMAMC_AVG4 COPY_AVG
-chroma_mc8_mmx_func avg, h264, _rnd
-chroma_mc8_mmx_func avg, vc1,  _nornd
-chroma_mc8_mmx_func avg, rv40
-chroma_mc4_mmx_func avg, h264
-chroma_mc4_mmx_func avg, rv40
-chroma_mc2_mmx_func avg, h264
-
-INIT_MMX 3dnow
-chroma_mc8_mmx_func avg, h264, _rnd
-chroma_mc8_mmx_func avg, vc1,  _nornd
-chroma_mc8_mmx_func avg, rv40
-chroma_mc4_mmx_func avg, h264
-chroma_mc4_mmx_func avg, rv40
-
-%macro chroma_mc8_ssse3_func 2-3
-cglobal %1_%2_chroma_mc8%3, 6, 7, 8
-%if ARCH_X86_64
-    movsxd        r2, r2d
-%endif
-    mov          r6d, r5d
-    or           r6d, r4d
-    jne .at_least_one_non_zero
-    ; mx == 0 AND my == 0 - no filter needed
-    mv0_pixels_mc8
-    REP_RET
-
-.at_least_one_non_zero:
-    test         r5d, r5d
-    je .my_is_zero
-    test         r4d, r4d
-    je .mx_is_zero
-
-    ; general case, bilinear
-    mov          r6d, r4d
-    shl          r4d, 8
-    sub           r4, r6
-    mov           r6, 8
-    add           r4, 8           ; x*288+8 = x<<8 | (8-x)
-    sub          r6d, r5d
-    imul          r6, r4          ; (8-y)*(x*255+8) = (8-y)*x<<8 | (8-y)*(8-x)
-    imul         r4d, r5d         ;    y *(x*255+8) =    y *x<<8 |    y *(8-x)
-
-    movd          m7, r6d
-    movd          m6, r4d
-    movdqa        m5, [rnd_2d_%2]
-    movq          m0, [r1  ]
-    movq          m1, [r1+1]
-    pshuflw       m7, m7, 0
-    pshuflw       m6, m6, 0
-    punpcklbw     m0, m1
-    movlhps       m7, m7
-    movlhps       m6, m6
-
-.next2rows:
-    movq          m1, [r1+r2*1   ]
-    movq          m2, [r1+r2*1+1]
-    movq          m3, [r1+r2*2  ]
-    movq          m4, [r1+r2*2+1]
-    lea           r1, [r1+r2*2]
-    punpcklbw     m1, m2
-    movdqa        m2, m1
-    punpcklbw     m3, m4
-    movdqa        m4, m3
-    pmaddubsw     m0, m7
-    pmaddubsw     m1, m6
-    pmaddubsw     m2, m7
-    pmaddubsw     m3, m6
-    paddw         m0, m5
-    paddw         m2, m5
-    paddw         m1, m0
-    paddw         m3, m2
-    psrlw         m1, 6
-    movdqa        m0, m4
-    psrlw         m3, 6
-%ifidn %1, avg
-    movq          m2, [r0   ]
-    movhps        m2, [r0+r2]
-%endif
-    packuswb      m1, m3
-    CHROMAMC_AVG  m1, m2
-    movq     [r0   ], m1
-    movhps   [r0+r2], m1
-    sub          r3d, 2
-    lea           r0, [r0+r2*2]
-    jg .next2rows
-    REP_RET
-
-.my_is_zero:
-    mov          r5d, r4d
-    shl          r4d, 8
-    add           r4, 8
-    sub           r4, r5          ; 255*x+8 = x<<8 | (8-x)
-    movd          m7, r4d
-    movdqa        m6, [rnd_1d_%2]
-    pshuflw       m7, m7, 0
-    movlhps       m7, m7
-
-.next2xrows:
-    movq          m0, [r1     ]
-    movq          m1, [r1   +1]
-    movq          m2, [r1+r2  ]
-    movq          m3, [r1+r2+1]
-    punpcklbw     m0, m1
-    punpcklbw     m2, m3
-    pmaddubsw     m0, m7
-    pmaddubsw     m2, m7
-%ifidn %1, avg
-    movq          m4, [r0   ]
-    movhps        m4, [r0+r2]
-%endif
-    paddw         m0, m6
-    paddw         m2, m6
-    psrlw         m0, 3
-    psrlw         m2, 3
-    packuswb      m0, m2
-    CHROMAMC_AVG  m0, m4
-    movq     [r0   ], m0
-    movhps   [r0+r2], m0
-    sub          r3d, 2
-    lea           r0, [r0+r2*2]
-    lea           r1, [r1+r2*2]
-    jg .next2xrows
-    REP_RET
-
-.mx_is_zero:
-    mov          r4d, r5d
-    shl          r5d, 8
-    add           r5, 8
-    sub           r5, r4          ; 255*y+8 = y<<8 | (8-y)
-    movd          m7, r5d
-    movdqa        m6, [rnd_1d_%2]
-    pshuflw       m7, m7, 0
-    movlhps       m7, m7
-
-.next2yrows:
-    movq          m0, [r1     ]
-    movq          m1, [r1+r2  ]
-    movdqa        m2, m1
-    movq          m3, [r1+r2*2]
-    lea           r1, [r1+r2*2]
-    punpcklbw     m0, m1
-    punpcklbw     m2, m3
-    pmaddubsw     m0, m7
-    pmaddubsw     m2, m7
-%ifidn %1, avg
-    movq          m4, [r0   ]
-    movhps        m4, [r0+r2]
-%endif
-    paddw         m0, m6
-    paddw         m2, m6
-    psrlw         m0, 3
-    psrlw         m2, 3
-    packuswb      m0, m2
-    CHROMAMC_AVG  m0, m4
-    movq     [r0   ], m0
-    movhps   [r0+r2], m0
-    sub          r3d, 2
-    lea           r0, [r0+r2*2]
-    jg .next2yrows
-    REP_RET
-%endmacro
-
-%macro chroma_mc4_ssse3_func 2
-cglobal %1_%2_chroma_mc4, 6, 7, 0
-%if ARCH_X86_64
-    movsxd        r2, r2d
-%endif
-    mov           r6, r4
-    shl          r4d, 8
-    sub          r4d, r6d
-    mov           r6, 8
-    add          r4d, 8           ; x*288+8
-    sub          r6d, r5d
-    imul         r6d, r4d         ; (8-y)*(x*255+8) = (8-y)*x<<8 | (8-y)*(8-x)
-    imul         r4d, r5d         ;    y *(x*255+8) =    y *x<<8 |    y *(8-x)
-
-    movd          m7, r6d
-    movd          m6, r4d
-    movq          m5, [pw_32]
-    movd          m0, [r1  ]
-    pshufw        m7, m7, 0
-    punpcklbw     m0, [r1+1]
-    pshufw        m6, m6, 0
-
-.next2rows:
-    movd          m1, [r1+r2*1  ]
-    movd          m3, [r1+r2*2  ]
-    punpcklbw     m1, [r1+r2*1+1]
-    punpcklbw     m3, [r1+r2*2+1]
-    lea           r1, [r1+r2*2]
-    movq          m2, m1
-    movq          m4, m3
-    pmaddubsw     m0, m7
-    pmaddubsw     m1, m6
-    pmaddubsw     m2, m7
-    pmaddubsw     m3, m6
-    paddw         m0, m5
-    paddw         m2, m5
-    paddw         m1, m0
-    paddw         m3, m2
-    psrlw         m1, 6
-    movq          m0, m4
-    psrlw         m3, 6
-    packuswb      m1, m1
-    packuswb      m3, m3
-    CHROMAMC_AVG  m1, [r0  ]
-    CHROMAMC_AVG  m3, [r0+r2]
-    movd     [r0   ], m1
-    movd     [r0+r2], m3
-    sub          r3d, 2
-    lea           r0, [r0+r2*2]
-    jg .next2rows
-    REP_RET
-%endmacro
-
-%define CHROMAMC_AVG NOTHING
-INIT_XMM ssse3
-chroma_mc8_ssse3_func put, h264, _rnd
-chroma_mc8_ssse3_func put, vc1,  _nornd
-INIT_MMX ssse3
-chroma_mc4_ssse3_func put, h264
-
-%define CHROMAMC_AVG DIRECT_AVG
-INIT_XMM ssse3
-chroma_mc8_ssse3_func avg, h264, _rnd
-chroma_mc8_ssse3_func avg, vc1,  _nornd
-INIT_MMX ssse3
-chroma_mc4_ssse3_func avg, h264
diff --git a/deps/libav/libavcodec/x86/h264_chromamc_10bit.asm b/deps/libav/libavcodec/x86/h264_chromamc_10bit.asm
deleted file mode 100644
index aec7678..0000000
--- a/deps/libav/libavcodec/x86/h264_chromamc_10bit.asm
+++ /dev/null
@@ -1,267 +0,0 @@
-;*****************************************************************************
-;* MMX/SSE2/AVX-optimized 10-bit H.264 chroma MC code
-;*****************************************************************************
-;* Copyright (C) 2005-2011 x264 project
-;*
-;* Authors: Daniel Kang <daniel.d.kang at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-cextern pw_4
-cextern pw_8
-cextern pw_32
-cextern pw_64
-
-SECTION .text
-
-
-%macro MV0_PIXELS_MC8 0
-    lea           r4, [r2*3   ]
-    lea           r5, [r2*4   ]
-.next4rows:
-    movu          m0, [r1     ]
-    movu          m1, [r1+r2  ]
-    CHROMAMC_AVG  m0, [r0     ]
-    CHROMAMC_AVG  m1, [r0+r2  ]
-    mova   [r0     ], m0
-    mova   [r0+r2  ], m1
-    movu          m0, [r1+r2*2]
-    movu          m1, [r1+r4  ]
-    CHROMAMC_AVG  m0, [r0+r2*2]
-    CHROMAMC_AVG  m1, [r0+r4  ]
-    mova   [r0+r2*2], m0
-    mova   [r0+r4  ], m1
-    add           r1, r5
-    add           r0, r5
-    sub          r3d, 4
-    jne .next4rows
-%endmacro
-
-;-----------------------------------------------------------------------------
-; void put/avg_h264_chroma_mc8(pixel *dst, pixel *src, int stride, int h, int mx, int my)
-;-----------------------------------------------------------------------------
-%macro CHROMA_MC8 1
-; put/avg_h264_chroma_mc8_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/,
-;                              int stride, int h, int mx, int my)
-cglobal %1_h264_chroma_mc8_10, 6,7,8
-    movsxdifnidn  r2, r2d
-    mov          r6d, r5d
-    or           r6d, r4d
-    jne .at_least_one_non_zero
-    ; mx == 0 AND my == 0 - no filter needed
-    MV0_PIXELS_MC8
-    REP_RET
-
-.at_least_one_non_zero:
-    mov          r6d, 2
-    test         r5d, r5d
-    je .x_interpolation
-    mov           r6, r2        ; dxy = x ? 1 : stride
-    test         r4d, r4d
-    jne .xy_interpolation
-.x_interpolation:
-    ; mx == 0 XOR my == 0 - 1 dimensional filter only
-    or           r4d, r5d       ; x + y
-    movd          m5, r4d
-    mova          m4, [pw_8]
-    mova          m6, [pw_4]    ; mm6 = rnd >> 3
-    SPLATW        m5, m5        ; mm5 = B = x
-    psubw         m4, m5        ; mm4 = A = 8-x
-
-.next1drow:
-    movu          m0, [r1   ]   ; mm0 = src[0..7]
-    movu          m2, [r1+r6]   ; mm2 = src[1..8]
-
-    pmullw        m0, m4        ; mm0 = A * src[0..7]
-    pmullw        m2, m5        ; mm2 = B * src[1..8]
-
-    paddw         m0, m6
-    paddw         m0, m2
-    psrlw         m0, 3
-    CHROMAMC_AVG  m0, [r0]
-    mova        [r0], m0        ; dst[0..7] = (A * src[0..7] + B * src[1..8] + (rnd >> 3)) >> 3
-
-    add           r0, r2
-    add           r1, r2
-    dec           r3d
-    jne .next1drow
-    REP_RET
-
-.xy_interpolation: ; general case, bilinear
-    movd          m4, r4m         ; x
-    movd          m6, r5m         ; y
-
-    SPLATW        m4, m4          ; mm4 = x words
-    SPLATW        m6, m6          ; mm6 = y words
-    psllw         m5, m4, 3       ; mm5 = 8x
-    pmullw        m4, m6          ; mm4 = x * y
-    psllw         m6, 3           ; mm6 = 8y
-    paddw         m1, m5, m6      ; mm7 = 8x+8y
-    mova          m7, m4          ; DD = x * y
-    psubw         m5, m4          ; mm5 = B = 8x - xy
-    psubw         m6, m4          ; mm6 = C = 8y - xy
-    paddw         m4, [pw_64]
-    psubw         m4, m1          ; mm4 = A = xy - (8x+8y) + 64
-
-    movu          m0, [r1  ]      ; mm0 = src[0..7]
-    movu          m1, [r1+2]      ; mm1 = src[1..8]
-.next2drow:
-    add           r1, r2
-
-    pmullw        m2, m0, m4
-    pmullw        m1, m5
-    paddw         m2, m1          ; mm2 = A * src[0..7] + B * src[1..8]
-
-    movu          m0, [r1]
-    movu          m1, [r1+2]
-    pmullw        m3, m0, m6
-    paddw         m2, m3          ; mm2 += C * src[0..7+strde]
-    pmullw        m3, m1, m7
-    paddw         m2, m3          ; mm2 += D * src[1..8+strde]
-
-    paddw         m2, [pw_32]
-    psrlw         m2, 6
-    CHROMAMC_AVG  m2, [r0]
-    mova        [r0], m2          ; dst[0..7] = (mm2 + 32) >> 6
-
-    add           r0, r2
-    dec          r3d
-    jne .next2drow
-    REP_RET
-%endmacro
-
-;-----------------------------------------------------------------------------
-; void put/avg_h264_chroma_mc4(pixel *dst, pixel *src, int stride, int h, int mx, int my)
-;-----------------------------------------------------------------------------
-;TODO: xmm mc4
-%macro MC4_OP 2
-    movq          %1, [r1  ]
-    movq          m1, [r1+2]
-    add           r1, r2
-    pmullw        %1, m4
-    pmullw        m1, m2
-    paddw         m1, %1
-    mova          %1, m1
-
-    pmullw        %2, m5
-    pmullw        m1, m3
-    paddw         %2, [pw_32]
-    paddw         m1, %2
-    psrlw         m1, 6
-    CHROMAMC_AVG  m1, %2, [r0]
-    movq        [r0], m1
-    add           r0, r2
-%endmacro
-
-%macro CHROMA_MC4 1
-cglobal %1_h264_chroma_mc4_10, 6,6,7
-    movsxdifnidn  r2, r2d
-    movd          m2, r4m         ; x
-    movd          m3, r5m         ; y
-    mova          m4, [pw_8]
-    mova          m5, m4
-    SPLATW        m2, m2
-    SPLATW        m3, m3
-    psubw         m4, m2
-    psubw         m5, m3
-
-    movq          m0, [r1  ]
-    movq          m6, [r1+2]
-    add           r1, r2
-    pmullw        m0, m4
-    pmullw        m6, m2
-    paddw         m6, m0
-
-.next2rows:
-    MC4_OP m0, m6
-    MC4_OP m6, m0
-    sub   r3d, 2
-    jnz .next2rows
-    REP_RET
-%endmacro
-
-;-----------------------------------------------------------------------------
-; void put/avg_h264_chroma_mc2(pixel *dst, pixel *src, int stride, int h, int mx, int my)
-;-----------------------------------------------------------------------------
-%macro CHROMA_MC2 1
-cglobal %1_h264_chroma_mc2_10, 6,7
-    movsxdifnidn  r2, r2d
-    mov          r6d, r4d
-    shl          r4d, 16
-    sub          r4d, r6d
-    add          r4d, 8
-    imul         r5d, r4d         ; x*y<<16 | y*(8-x)
-    shl          r4d, 3
-    sub          r4d, r5d         ; x*(8-y)<<16 | (8-x)*(8-y)
-
-    movd          m5, r4d
-    movd          m6, r5d
-    punpckldq     m5, m5          ; mm5 = {A,B,A,B}
-    punpckldq     m6, m6          ; mm6 = {C,D,C,D}
-    pxor          m7, m7
-    pshufw        m2, [r1], 0x94    ; mm0 = src[0,1,1,2]
-
-.nextrow:
-    add           r1, r2
-    movq          m1, m2
-    pmaddwd       m1, m5          ; mm1 = A * src[0,1] + B * src[1,2]
-    pshufw        m0, [r1], 0x94    ; mm0 = src[0,1,1,2]
-    movq          m2, m0
-    pmaddwd       m0, m6
-    paddw         m1, [pw_32]
-    paddw         m1, m0          ; mm1 += C * src[0,1] + D * src[1,2]
-    psrlw         m1, 6
-    packssdw      m1, m7
-    CHROMAMC_AVG  m1, m3, [r0]
-    movd        [r0], m1
-    add           r0, r2
-    dec          r3d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-%macro NOTHING 2-3
-%endmacro
-%macro AVG 2-3
-%if %0==3
-    movq          %2, %3
-%endif
-    pavgw         %1, %2
-%endmacro
-
-%define CHROMAMC_AVG  NOTHING
-INIT_XMM sse2
-CHROMA_MC8 put
-INIT_XMM avx
-CHROMA_MC8 put
-INIT_MMX mmxext
-CHROMA_MC4 put
-CHROMA_MC2 put
-
-%define CHROMAMC_AVG  AVG
-INIT_XMM sse2
-CHROMA_MC8 avg
-INIT_XMM avx
-CHROMA_MC8 avg
-INIT_MMX mmxext
-CHROMA_MC4 avg
-CHROMA_MC2 avg
diff --git a/deps/libav/libavcodec/x86/h264_deblock.asm b/deps/libav/libavcodec/x86/h264_deblock.asm
deleted file mode 100644
index 6e29ce7..0000000
--- a/deps/libav/libavcodec/x86/h264_deblock.asm
+++ /dev/null
@@ -1,1068 +0,0 @@
-;*****************************************************************************
-;* MMX/SSE2/AVX-optimized H.264 deblocking code
-;*****************************************************************************
-;* Copyright (C) 2005-2011 x264 project
-;*
-;* Authors: Loren Merritt <lorenm at u.washington.edu>
-;*          Jason Garrett-Glaser <darkshikari at gmail.com>
-;*          Oskar Arvidsson <oskar at irock.se>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-pb_A1: times 16 db 0xA1
-pb_3_1: times 4 db 3, 1
-
-SECTION .text
-
-cextern pb_0
-cextern pb_1
-cextern pb_3
-
-; expands to [base],...,[base+7*stride]
-%define PASS8ROWS(base, base3, stride, stride3) \
-    [base], [base+stride], [base+stride*2], [base3], \
-    [base3+stride], [base3+stride*2], [base3+stride3], [base3+stride*4]
-
-%define PASS8ROWS(base, base3, stride, stride3, offset) \
-    PASS8ROWS(base+offset, base3+offset, stride, stride3)
-
-; in: 8 rows of 4 bytes in %4..%11
-; out: 4 rows of 8 bytes in m0..m3
-%macro TRANSPOSE4x8_LOAD 11
-    movh       m0, %4
-    movh       m2, %5
-    movh       m1, %6
-    movh       m3, %7
-    punpckl%1  m0, m2
-    punpckl%1  m1, m3
-    mova       m2, m0
-    punpckl%2  m0, m1
-    punpckh%2  m2, m1
-
-    movh       m4, %8
-    movh       m6, %9
-    movh       m5, %10
-    movh       m7, %11
-    punpckl%1  m4, m6
-    punpckl%1  m5, m7
-    mova       m6, m4
-    punpckl%2  m4, m5
-    punpckh%2  m6, m5
-
-    punpckh%3  m1, m0, m4
-    punpckh%3  m3, m2, m6
-    punpckl%3  m0, m4
-    punpckl%3  m2, m6
-%endmacro
-
-; in: 4 rows of 8 bytes in m0..m3
-; out: 8 rows of 4 bytes in %1..%8
-%macro TRANSPOSE8x4B_STORE 8
-    punpckhdq  m4, m0, m0
-    punpckhdq  m5, m1, m1
-    punpckhdq  m6, m2, m2
-
-    punpcklbw  m0, m1
-    punpcklbw  m2, m3
-    punpcklwd  m1, m0, m2
-    punpckhwd  m0, m2
-    movh       %1, m1
-    punpckhdq  m1, m1
-    movh       %2, m1
-    movh       %3, m0
-    punpckhdq  m0, m0
-    movh       %4, m0
-
-    punpckhdq  m3, m3
-    punpcklbw  m4, m5
-    punpcklbw  m6, m3
-    punpcklwd  m5, m4, m6
-    punpckhwd  m4, m6
-    movh       %5, m5
-    punpckhdq  m5, m5
-    movh       %6, m5
-    movh       %7, m4
-    punpckhdq  m4, m4
-    movh       %8, m4
-%endmacro
-
-%macro TRANSPOSE4x8B_LOAD 8
-    TRANSPOSE4x8_LOAD bw, wd, dq, %1, %2, %3, %4, %5, %6, %7, %8
-%endmacro
-
-%macro SBUTTERFLY3 4
-    punpckh%1  %4, %2, %3
-    punpckl%1  %2, %3
-%endmacro
-
-; in: 8 rows of 8 (only the middle 6 pels are used) in %1..%8
-; out: 6 rows of 8 in [%9+0*16] .. [%9+5*16]
-%macro TRANSPOSE6x8_MEM 9
-    RESET_MM_PERMUTATION
-    movq  m0, %1
-    movq  m1, %2
-    movq  m2, %3
-    movq  m3, %4
-    movq  m4, %5
-    movq  m5, %6
-    movq  m6, %7
-    SBUTTERFLY bw, 0, 1, 7
-    SBUTTERFLY bw, 2, 3, 7
-    SBUTTERFLY bw, 4, 5, 7
-    movq  [%9+0x10], m3
-    SBUTTERFLY3 bw, m6, %8, m7
-    SBUTTERFLY wd, 0, 2, 3
-    SBUTTERFLY wd, 4, 6, 3
-    punpckhdq m0, m4
-    movq  [%9+0x00], m0
-    SBUTTERFLY3 wd, m1, [%9+0x10], m3
-    SBUTTERFLY wd, 5, 7, 0
-    SBUTTERFLY dq, 1, 5, 0
-    SBUTTERFLY dq, 2, 6, 0
-    punpckldq m3, m7
-    movq  [%9+0x10], m2
-    movq  [%9+0x20], m6
-    movq  [%9+0x30], m1
-    movq  [%9+0x40], m5
-    movq  [%9+0x50], m3
-    RESET_MM_PERMUTATION
-%endmacro
-
-; in: 8 rows of 8 in %1..%8
-; out: 8 rows of 8 in %9..%16
-%macro TRANSPOSE8x8_MEM 16
-    RESET_MM_PERMUTATION
-    movq  m0, %1
-    movq  m1, %2
-    movq  m2, %3
-    movq  m3, %4
-    movq  m4, %5
-    movq  m5, %6
-    movq  m6, %7
-    SBUTTERFLY bw, 0, 1, 7
-    SBUTTERFLY bw, 2, 3, 7
-    SBUTTERFLY bw, 4, 5, 7
-    SBUTTERFLY3 bw, m6, %8, m7
-    movq  %9,  m5
-    SBUTTERFLY wd, 0, 2, 5
-    SBUTTERFLY wd, 4, 6, 5
-    SBUTTERFLY wd, 1, 3, 5
-    movq  %11, m6
-    movq  m6,  %9
-    SBUTTERFLY wd, 6, 7, 5
-    SBUTTERFLY dq, 0, 4, 5
-    SBUTTERFLY dq, 1, 6, 5
-    movq  %9,  m0
-    movq  %10, m4
-    movq  %13, m1
-    movq  %14, m6
-    SBUTTERFLY3 dq, m2, %11, m0
-    SBUTTERFLY dq, 3, 7, 4
-    movq  %11, m2
-    movq  %12, m0
-    movq  %15, m3
-    movq  %16, m7
-    RESET_MM_PERMUTATION
-%endmacro
-
-; out: %4 = |%1-%2|>%3
-; clobbers: %5
-%macro DIFF_GT 5
-%if avx_enabled == 0
-    mova    %5, %2
-    mova    %4, %1
-    psubusb %5, %1
-    psubusb %4, %2
-%else
-    psubusb %5, %2, %1
-    psubusb %4, %1, %2
-%endif
-    por     %4, %5
-    psubusb %4, %3
-%endmacro
-
-; out: %4 = |%1-%2|>%3
-; clobbers: %5
-%macro DIFF_GT2 5
-%if ARCH_X86_64
-    psubusb %5, %2, %1
-    psubusb %4, %1, %2
-%else
-    mova    %5, %2
-    mova    %4, %1
-    psubusb %5, %1
-    psubusb %4, %2
-%endif
-    psubusb %5, %3
-    psubusb %4, %3
-    pcmpeqb %4, %5
-%endmacro
-
-; in: m0=p1 m1=p0 m2=q0 m3=q1 %1=alpha-1 %2=beta-1
-; out: m5=beta-1, m7=mask, %3=alpha-1
-; clobbers: m4,m6
-%macro LOAD_MASK 2-3
-    movd     m4, %1
-    movd     m5, %2
-    SPLATW   m4, m4
-    SPLATW   m5, m5
-    packuswb m4, m4  ; 16x alpha-1
-    packuswb m5, m5  ; 16x beta-1
-%if %0>2
-    mova     %3, m4
-%endif
-    DIFF_GT  m1, m2, m4, m7, m6 ; |p0-q0| > alpha-1
-    DIFF_GT  m0, m1, m5, m4, m6 ; |p1-p0| > beta-1
-    por      m7, m4
-    DIFF_GT  m3, m2, m5, m4, m6 ; |q1-q0| > beta-1
-    por      m7, m4
-    pxor     m6, m6
-    pcmpeqb  m7, m6
-%endmacro
-
-; in: m0=p1 m1=p0 m2=q0 m3=q1 m7=(tc&mask)
-; out: m1=p0' m2=q0'
-; clobbers: m0,3-6
-%macro DEBLOCK_P0_Q0 0
-    pcmpeqb m4, m4
-    pxor    m5, m1, m2   ; p0^q0
-    pxor    m3, m4
-    pand    m5, [pb_1]   ; (p0^q0)&1
-    pavgb   m3, m0       ; (p1 - q1 + 256)>>1
-    pxor    m4, m1
-    pavgb   m3, [pb_3]   ; (((p1 - q1 + 256)>>1)+4)>>1 = 64+2+(p1-q1)>>2
-    pavgb   m4, m2       ; (q0 - p0 + 256)>>1
-    pavgb   m3, m5
-    mova    m6, [pb_A1]
-    paddusb m3, m4       ; d+128+33
-    psubusb m6, m3
-    psubusb m3, [pb_A1]
-    pminub  m6, m7
-    pminub  m3, m7
-    psubusb m1, m6
-    psubusb m2, m3
-    paddusb m1, m3
-    paddusb m2, m6
-%endmacro
-
-; in: m1=p0 m2=q0
-;     %1=p1 %2=q2 %3=[q2] %4=[q1] %5=tc0 %6=tmp
-; out: [q1] = clip( (q2+((p0+q0+1)>>1))>>1, q1-tc0, q1+tc0 )
-; clobbers: q2, tmp, tc0
-%macro LUMA_Q1 6
-    pavgb   %6, m1, m2
-    pavgb   %2, %6       ; avg(p2,avg(p0,q0))
-    pxor    %6, %3
-    pand    %6, [pb_1]   ; (p2^avg(p0,q0))&1
-    psubusb %2, %6       ; (p2+((p0+q0+1)>>1))>>1
-    psubusb %6, %1, %5
-    paddusb %5, %1
-    pmaxub  %2, %6
-    pminub  %2, %5
-    mova    %4, %2
-%endmacro
-
-%if ARCH_X86_64
-;-----------------------------------------------------------------------------
-; void deblock_v_luma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
-;-----------------------------------------------------------------------------
-%macro DEBLOCK_LUMA 0
-cglobal deblock_v_luma_8, 5,5,10
-    movd    m8, [r4] ; tc0
-    lea     r4, [r1*3]
-    dec     r2d        ; alpha-1
-    neg     r4
-    dec     r3d        ; beta-1
-    add     r4, r0     ; pix-3*stride
-
-    mova    m0, [r4+r1]   ; p1
-    mova    m1, [r4+2*r1] ; p0
-    mova    m2, [r0]      ; q0
-    mova    m3, [r0+r1]   ; q1
-    LOAD_MASK r2d, r3d
-
-    punpcklbw m8, m8
-    punpcklbw m8, m8 ; tc = 4x tc0[3], 4x tc0[2], 4x tc0[1], 4x tc0[0]
-    pcmpeqb m9, m9
-    pcmpeqb m9, m8
-    pandn   m9, m7
-    pand    m8, m9
-
-    movdqa  m3, [r4] ; p2
-    DIFF_GT2 m1, m3, m5, m6, m7 ; |p2-p0| > beta-1
-    pand    m6, m9
-    psubb   m7, m8, m6
-    pand    m6, m8
-    LUMA_Q1 m0, m3, [r4], [r4+r1], m6, m4
-
-    movdqa  m4, [r0+2*r1] ; q2
-    DIFF_GT2 m2, m4, m5, m6, m3 ; |q2-q0| > beta-1
-    pand    m6, m9
-    pand    m8, m6
-    psubb   m7, m6
-    mova    m3, [r0+r1]
-    LUMA_Q1 m3, m4, [r0+2*r1], [r0+r1], m8, m6
-
-    DEBLOCK_P0_Q0
-    mova    [r4+2*r1], m1
-    mova    [r0], m2
-    RET
-
-;-----------------------------------------------------------------------------
-; void deblock_h_luma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
-;-----------------------------------------------------------------------------
-INIT_MMX cpuname
-cglobal deblock_h_luma_8, 5,9,0,0x60+16*WIN64
-    movsxd r7,  r1d
-    lea    r8,  [r7+r7*2]
-    lea    r6,  [r0-4]
-    lea    r5,  [r0-4+r8]
-%if WIN64
-    %define pix_tmp rsp+0x30 ; shadow space + r4
-%else
-    %define pix_tmp rsp
-%endif
-
-    ; transpose 6x16 -> tmp space
-    TRANSPOSE6x8_MEM  PASS8ROWS(r6, r5, r7, r8), pix_tmp
-    lea    r6, [r6+r7*8]
-    lea    r5, [r5+r7*8]
-    TRANSPOSE6x8_MEM  PASS8ROWS(r6, r5, r7, r8), pix_tmp+8
-
-    ; vertical filter
-    ; alpha, beta, tc0 are still in r2d, r3d, r4
-    ; don't backup r6, r5, r7, r8 because deblock_v_luma_sse2 doesn't use them
-    lea    r0, [pix_tmp+0x30]
-    mov    r1d, 0x10
-%if WIN64
-    mov    [rsp+0x20], r4
-%endif
-    call   deblock_v_luma_8
-
-    ; transpose 16x4 -> original space  (only the middle 4 rows were changed by the filter)
-    add    r6, 2
-    add    r5, 2
-    movq   m0, [pix_tmp+0x18]
-    movq   m1, [pix_tmp+0x28]
-    movq   m2, [pix_tmp+0x38]
-    movq   m3, [pix_tmp+0x48]
-    TRANSPOSE8x4B_STORE  PASS8ROWS(r6, r5, r7, r8)
-
-    shl    r7,  3
-    sub    r6,  r7
-    sub    r5,  r7
-    shr    r7,  3
-    movq   m0, [pix_tmp+0x10]
-    movq   m1, [pix_tmp+0x20]
-    movq   m2, [pix_tmp+0x30]
-    movq   m3, [pix_tmp+0x40]
-    TRANSPOSE8x4B_STORE  PASS8ROWS(r6, r5, r7, r8)
-
-    RET
-%endmacro
-
-INIT_XMM sse2
-DEBLOCK_LUMA
-INIT_XMM avx
-DEBLOCK_LUMA
-
-%else
-
-%macro DEBLOCK_LUMA 2
-;-----------------------------------------------------------------------------
-; void deblock_v8_luma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
-;-----------------------------------------------------------------------------
-cglobal deblock_%1_luma_8, 5,5,8,2*%2
-    lea     r4, [r1*3]
-    dec     r2     ; alpha-1
-    neg     r4
-    dec     r3     ; beta-1
-    add     r4, r0 ; pix-3*stride
-
-    mova    m0, [r4+r1]   ; p1
-    mova    m1, [r4+2*r1] ; p0
-    mova    m2, [r0]      ; q0
-    mova    m3, [r0+r1]   ; q1
-    LOAD_MASK r2, r3
-
-    mov     r3, r4mp
-    pcmpeqb m3, m3
-    movd    m4, [r3] ; tc0
-    punpcklbw m4, m4
-    punpcklbw m4, m4 ; tc = 4x tc0[3], 4x tc0[2], 4x tc0[1], 4x tc0[0]
-    mova   [esp+%2], m4 ; tc
-    pcmpgtb m4, m3
-    mova    m3, [r4] ; p2
-    pand    m4, m7
-    mova   [esp], m4 ; mask
-
-    DIFF_GT2 m1, m3, m5, m6, m7 ; |p2-p0| > beta-1
-    pand    m6, m4
-    pand    m4, [esp+%2] ; tc
-    psubb   m7, m4, m6
-    pand    m6, m4
-    LUMA_Q1 m0, m3, [r4], [r4+r1], m6, m4
-
-    mova    m4, [r0+2*r1] ; q2
-    DIFF_GT2 m2, m4, m5, m6, m3 ; |q2-q0| > beta-1
-    pand    m6, [esp] ; mask
-    mova    m5, [esp+%2] ; tc
-    psubb   m7, m6
-    pand    m5, m6
-    mova    m3, [r0+r1]
-    LUMA_Q1 m3, m4, [r0+2*r1], [r0+r1], m5, m6
-
-    DEBLOCK_P0_Q0
-    mova    [r4+2*r1], m1
-    mova    [r0], m2
-    RET
-
-;-----------------------------------------------------------------------------
-; void deblock_h_luma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
-;-----------------------------------------------------------------------------
-INIT_MMX cpuname
-cglobal deblock_h_luma_8, 0,5,8,0x60+HAVE_ALIGNED_STACK*12
-    mov    r0, r0mp
-    mov    r3, r1m
-    lea    r4, [r3*3]
-    sub    r0, 4
-    lea    r1, [r0+r4]
-%define pix_tmp esp+12*HAVE_ALIGNED_STACK
-
-    ; transpose 6x16 -> tmp space
-    TRANSPOSE6x8_MEM  PASS8ROWS(r0, r1, r3, r4), pix_tmp
-    lea    r0, [r0+r3*8]
-    lea    r1, [r1+r3*8]
-    TRANSPOSE6x8_MEM  PASS8ROWS(r0, r1, r3, r4), pix_tmp+8
-
-    ; vertical filter
-    lea    r0, [pix_tmp+0x30]
-    PUSH   dword r4m
-    PUSH   dword r3m
-    PUSH   dword r2m
-    PUSH   dword 16
-    PUSH   dword r0
-    call   deblock_%1_luma_8
-%ifidn %1, v8
-    add    dword [esp   ], 8 ; pix_tmp+0x38
-    add    dword [esp+16], 2 ; tc0+2
-    call   deblock_%1_luma_8
-%endif
-    ADD    esp, 20
-
-    ; transpose 16x4 -> original space  (only the middle 4 rows were changed by the filter)
-    mov    r0, r0mp
-    sub    r0, 2
-
-    movq   m0, [pix_tmp+0x10]
-    movq   m1, [pix_tmp+0x20]
-    lea    r1, [r0+r4]
-    movq   m2, [pix_tmp+0x30]
-    movq   m3, [pix_tmp+0x40]
-    TRANSPOSE8x4B_STORE  PASS8ROWS(r0, r1, r3, r4)
-
-    lea    r0, [r0+r3*8]
-    lea    r1, [r1+r3*8]
-    movq   m0, [pix_tmp+0x18]
-    movq   m1, [pix_tmp+0x28]
-    movq   m2, [pix_tmp+0x38]
-    movq   m3, [pix_tmp+0x48]
-    TRANSPOSE8x4B_STORE  PASS8ROWS(r0, r1, r3, r4)
-
-    RET
-%endmacro ; DEBLOCK_LUMA
-
-INIT_MMX mmxext
-DEBLOCK_LUMA v8, 8
-INIT_XMM sse2
-DEBLOCK_LUMA v, 16
-INIT_XMM avx
-DEBLOCK_LUMA v, 16
-
-%endif ; ARCH
-
-
-
-%macro LUMA_INTRA_P012 4 ; p0..p3 in memory
-%if ARCH_X86_64
-    pavgb t0, p2, p1
-    pavgb t1, p0, q0
-%else
-    mova  t0, p2
-    mova  t1, p0
-    pavgb t0, p1
-    pavgb t1, q0
-%endif
-    pavgb t0, t1 ; ((p2+p1+1)/2 + (p0+q0+1)/2 + 1)/2
-    mova  t5, t1
-%if ARCH_X86_64
-    paddb t2, p2, p1
-    paddb t3, p0, q0
-%else
-    mova  t2, p2
-    mova  t3, p0
-    paddb t2, p1
-    paddb t3, q0
-%endif
-    paddb t2, t3
-    mova  t3, t2
-    mova  t4, t2
-    psrlw t2, 1
-    pavgb t2, mpb_0
-    pxor  t2, t0
-    pand  t2, mpb_1
-    psubb t0, t2 ; p1' = (p2+p1+p0+q0+2)/4;
-
-%if ARCH_X86_64
-    pavgb t1, p2, q1
-    psubb t2, p2, q1
-%else
-    mova  t1, p2
-    mova  t2, p2
-    pavgb t1, q1
-    psubb t2, q1
-%endif
-    paddb t3, t3
-    psubb t3, t2 ; p2+2*p1+2*p0+2*q0+q1
-    pand  t2, mpb_1
-    psubb t1, t2
-    pavgb t1, p1
-    pavgb t1, t5 ; (((p2+q1)/2 + p1+1)/2 + (p0+q0+1)/2 + 1)/2
-    psrlw t3, 2
-    pavgb t3, mpb_0
-    pxor  t3, t1
-    pand  t3, mpb_1
-    psubb t1, t3 ; p0'a = (p2+2*p1+2*p0+2*q0+q1+4)/8
-
-    pxor  t3, p0, q1
-    pavgb t2, p0, q1
-    pand  t3, mpb_1
-    psubb t2, t3
-    pavgb t2, p1 ; p0'b = (2*p1+p0+q0+2)/4
-
-    pxor  t1, t2
-    pxor  t2, p0
-    pand  t1, mask1p
-    pand  t2, mask0
-    pxor  t1, t2
-    pxor  t1, p0
-    mova  %1, t1 ; store p0
-
-    mova  t1, %4 ; p3
-    paddb t2, t1, p2
-    pavgb t1, p2
-    pavgb t1, t0 ; (p3+p2+1)/2 + (p2+p1+p0+q0+2)/4
-    paddb t2, t2
-    paddb t2, t4 ; 2*p3+3*p2+p1+p0+q0
-    psrlw t2, 2
-    pavgb t2, mpb_0
-    pxor  t2, t1
-    pand  t2, mpb_1
-    psubb t1, t2 ; p2' = (2*p3+3*p2+p1+p0+q0+4)/8
-
-    pxor  t0, p1
-    pxor  t1, p2
-    pand  t0, mask1p
-    pand  t1, mask1p
-    pxor  t0, p1
-    pxor  t1, p2
-    mova  %2, t0 ; store p1
-    mova  %3, t1 ; store p2
-%endmacro
-
-%macro LUMA_INTRA_SWAP_PQ 0
-    %define q1 m0
-    %define q0 m1
-    %define p0 m2
-    %define p1 m3
-    %define p2 q2
-    %define mask1p mask1q
-%endmacro
-
-%macro DEBLOCK_LUMA_INTRA 1
-    %define p1 m0
-    %define p0 m1
-    %define q0 m2
-    %define q1 m3
-    %define t0 m4
-    %define t1 m5
-    %define t2 m6
-    %define t3 m7
-%if ARCH_X86_64
-    %define p2 m8
-    %define q2 m9
-    %define t4 m10
-    %define t5 m11
-    %define mask0 m12
-    %define mask1p m13
-%if WIN64
-    %define mask1q [rsp]
-%else
-    %define mask1q [rsp-24]
-%endif
-    %define mpb_0 m14
-    %define mpb_1 m15
-%else
-    %define spill(x) [esp+16*x]
-    %define p2 [r4+r1]
-    %define q2 [r0+2*r1]
-    %define t4 spill(0)
-    %define t5 spill(1)
-    %define mask0 spill(2)
-    %define mask1p spill(3)
-    %define mask1q spill(4)
-    %define mpb_0 [pb_0]
-    %define mpb_1 [pb_1]
-%endif
-
-;-----------------------------------------------------------------------------
-; void deblock_v_luma_intra( uint8_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
-%if WIN64
-cglobal deblock_%1_luma_intra_8, 4,6,16,0x10
-%else
-cglobal deblock_%1_luma_intra_8, 4,6,16,ARCH_X86_64*0x50-0x50
-%endif
-    lea     r4, [r1*4]
-    lea     r5, [r1*3] ; 3*stride
-    dec     r2d        ; alpha-1
-    jl .end
-    neg     r4
-    dec     r3d        ; beta-1
-    jl .end
-    add     r4, r0     ; pix-4*stride
-    mova    p1, [r4+2*r1]
-    mova    p0, [r4+r5]
-    mova    q0, [r0]
-    mova    q1, [r0+r1]
-%if ARCH_X86_64
-    pxor    mpb_0, mpb_0
-    mova    mpb_1, [pb_1]
-    LOAD_MASK r2d, r3d, t5 ; m5=beta-1, t5=alpha-1, m7=mask0
-    SWAP    7, 12 ; m12=mask0
-    pavgb   t5, mpb_0
-    pavgb   t5, mpb_1 ; alpha/4+1
-    movdqa  p2, [r4+r1]
-    movdqa  q2, [r0+2*r1]
-    DIFF_GT2 p0, q0, t5, t0, t3 ; t0 = |p0-q0| > alpha/4+1
-    DIFF_GT2 p0, p2, m5, t2, t5 ; mask1 = |p2-p0| > beta-1
-    DIFF_GT2 q0, q2, m5, t4, t5 ; t4 = |q2-q0| > beta-1
-    pand    t0, mask0
-    pand    t4, t0
-    pand    t2, t0
-    mova    mask1q, t4
-    mova    mask1p, t2
-%else
-    LOAD_MASK r2d, r3d, t5 ; m5=beta-1, t5=alpha-1, m7=mask0
-    mova    m4, t5
-    mova    mask0, m7
-    pavgb   m4, [pb_0]
-    pavgb   m4, [pb_1] ; alpha/4+1
-    DIFF_GT2 p0, q0, m4, m6, m7 ; m6 = |p0-q0| > alpha/4+1
-    pand    m6, mask0
-    DIFF_GT2 p0, p2, m5, m4, m7 ; m4 = |p2-p0| > beta-1
-    pand    m4, m6
-    mova    mask1p, m4
-    DIFF_GT2 q0, q2, m5, m4, m7 ; m4 = |q2-q0| > beta-1
-    pand    m4, m6
-    mova    mask1q, m4
-%endif
-    LUMA_INTRA_P012 [r4+r5], [r4+2*r1], [r4+r1], [r4]
-    LUMA_INTRA_SWAP_PQ
-    LUMA_INTRA_P012 [r0], [r0+r1], [r0+2*r1], [r0+r5]
-.end:
-    RET
-
-INIT_MMX cpuname
-%if ARCH_X86_64
-;-----------------------------------------------------------------------------
-; void deblock_h_luma_intra( uint8_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
-cglobal deblock_h_luma_intra_8, 4,9,0,0x80
-    movsxd r7,  r1d
-    lea    r8,  [r7*3]
-    lea    r6,  [r0-4]
-    lea    r5,  [r0-4+r8]
-%if WIN64
-    %define pix_tmp rsp+0x20 ; shadow space
-%else
-    %define pix_tmp rsp
-%endif
-
-    ; transpose 8x16 -> tmp space
-    TRANSPOSE8x8_MEM  PASS8ROWS(r6, r5, r7, r8), PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30)
-    lea    r6, [r6+r7*8]
-    lea    r5, [r5+r7*8]
-    TRANSPOSE8x8_MEM  PASS8ROWS(r6, r5, r7, r8), PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30)
-
-    lea    r0,  [pix_tmp+0x40]
-    mov    r1,  0x10
-    call   deblock_v_luma_intra_8
-
-    ; transpose 16x6 -> original space (but we can't write only 6 pixels, so really 16x8)
-    lea    r5, [r6+r8]
-    TRANSPOSE8x8_MEM  PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30), PASS8ROWS(r6, r5, r7, r8)
-    shl    r7,  3
-    sub    r6,  r7
-    sub    r5,  r7
-    shr    r7,  3
-    TRANSPOSE8x8_MEM  PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30), PASS8ROWS(r6, r5, r7, r8)
-    RET
-%else
-cglobal deblock_h_luma_intra_8, 2,4,8,0x80
-    lea    r3,  [r1*3]
-    sub    r0,  4
-    lea    r2,  [r0+r3]
-    %define pix_tmp rsp
-
-    ; transpose 8x16 -> tmp space
-    TRANSPOSE8x8_MEM  PASS8ROWS(r0, r2, r1, r3), PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30)
-    lea    r0,  [r0+r1*8]
-    lea    r2,  [r2+r1*8]
-    TRANSPOSE8x8_MEM  PASS8ROWS(r0, r2, r1, r3), PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30)
-
-    lea    r0,  [pix_tmp+0x40]
-    PUSH   dword r3m
-    PUSH   dword r2m
-    PUSH   dword 16
-    PUSH   r0
-    call   deblock_%1_luma_intra_8
-%ifidn %1, v8
-    add    dword [rsp], 8 ; pix_tmp+8
-    call   deblock_%1_luma_intra_8
-%endif
-    ADD    esp, 16
-
-    mov    r1,  r1m
-    mov    r0,  r0mp
-    lea    r3,  [r1*3]
-    sub    r0,  4
-    lea    r2,  [r0+r3]
-    ; transpose 16x6 -> original space (but we can't write only 6 pixels, so really 16x8)
-    TRANSPOSE8x8_MEM  PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30), PASS8ROWS(r0, r2, r1, r3)
-    lea    r0,  [r0+r1*8]
-    lea    r2,  [r2+r1*8]
-    TRANSPOSE8x8_MEM  PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30), PASS8ROWS(r0, r2, r1, r3)
-    RET
-%endif ; ARCH_X86_64
-%endmacro ; DEBLOCK_LUMA_INTRA
-
-INIT_XMM sse2
-DEBLOCK_LUMA_INTRA v
-INIT_XMM avx
-DEBLOCK_LUMA_INTRA v
-%if ARCH_X86_64 == 0
-INIT_MMX mmxext
-DEBLOCK_LUMA_INTRA v8
-%endif
-
-INIT_MMX mmxext
-
-%macro CHROMA_V_START 0
-    dec    r2d      ; alpha-1
-    dec    r3d      ; beta-1
-    mov    t5, r0
-    sub    t5, r1
-    sub    t5, r1
-%endmacro
-
-%macro CHROMA_H_START 0
-    dec    r2d
-    dec    r3d
-    sub    r0, 2
-    lea    t6, [r1*3]
-    mov    t5, r0
-    add    r0, t6
-%endmacro
-
-%define t5 r5
-%define t6 r6
-
-;-----------------------------------------------------------------------------
-; void ff_deblock_v_chroma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
-;-----------------------------------------------------------------------------
-cglobal deblock_v_chroma_8, 5,6
-    CHROMA_V_START
-    movq  m0, [t5]
-    movq  m1, [t5+r1]
-    movq  m2, [r0]
-    movq  m3, [r0+r1]
-    call ff_chroma_inter_body_mmxext
-    movq  [t5+r1], m1
-    movq  [r0], m2
-    RET
-
-;-----------------------------------------------------------------------------
-; void ff_deblock_h_chroma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
-;-----------------------------------------------------------------------------
-cglobal deblock_h_chroma_8, 5,7
-%if UNIX64
-    %define buf0 [rsp-24]
-    %define buf1 [rsp-16]
-%elif WIN64
-    sub   rsp, 16
-    %define buf0 [rsp]
-    %define buf1 [rsp+8]
-%else
-    %define buf0 r0m
-    %define buf1 r2m
-%endif
-    CHROMA_H_START
-    TRANSPOSE4x8_LOAD  bw, wd, dq, PASS8ROWS(t5, r0, r1, t6)
-    movq  buf0, m0
-    movq  buf1, m3
-    call ff_chroma_inter_body_mmxext
-    movq  m0, buf0
-    movq  m3, buf1
-    TRANSPOSE8x4B_STORE PASS8ROWS(t5, r0, r1, t6)
-%if WIN64
-    add   rsp, 16
-%endif
-    RET
-
-ALIGN 16
-ff_chroma_inter_body_mmxext:
-    LOAD_MASK  r2d, r3d
-    movd       m6, [r4] ; tc0
-    punpcklbw  m6, m6
-    pand       m7, m6
-    DEBLOCK_P0_Q0
-    ret
-
-
-
-; in: %1=p0 %2=p1 %3=q1
-; out: p0 = (p0 + q1 + 2*p1 + 2) >> 2
-%macro CHROMA_INTRA_P0 3
-    movq    m4, %1
-    pxor    m4, %3
-    pand    m4, [pb_1] ; m4 = (p0^q1)&1
-    pavgb   %1, %3
-    psubusb %1, m4
-    pavgb   %1, %2             ; dst = avg(p1, avg(p0,q1) - ((p0^q1)&1))
-%endmacro
-
-%define t5 r4
-%define t6 r5
-
-;-----------------------------------------------------------------------------
-; void ff_deblock_v_chroma_intra( uint8_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
-cglobal deblock_v_chroma_intra_8, 4,5
-    CHROMA_V_START
-    movq  m0, [t5]
-    movq  m1, [t5+r1]
-    movq  m2, [r0]
-    movq  m3, [r0+r1]
-    call ff_chroma_intra_body_mmxext
-    movq  [t5+r1], m1
-    movq  [r0], m2
-    RET
-
-;-----------------------------------------------------------------------------
-; void ff_deblock_h_chroma_intra( uint8_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
-cglobal deblock_h_chroma_intra_8, 4,6
-    CHROMA_H_START
-    TRANSPOSE4x8_LOAD  bw, wd, dq, PASS8ROWS(t5, r0, r1, t6)
-    call ff_chroma_intra_body_mmxext
-    TRANSPOSE8x4B_STORE PASS8ROWS(t5, r0, r1, t6)
-    RET
-
-ALIGN 16
-ff_chroma_intra_body_mmxext:
-    LOAD_MASK r2d, r3d
-    movq   m5, m1
-    movq   m6, m2
-    CHROMA_INTRA_P0  m1, m0, m3
-    CHROMA_INTRA_P0  m2, m3, m0
-    psubb  m1, m5
-    psubb  m2, m6
-    pand   m1, m7
-    pand   m2, m7
-    paddb  m1, m5
-    paddb  m2, m6
-    ret
-
-;-----------------------------------------------------------------------------
-; void h264_loop_filter_strength(int16_t bs[2][4][4], uint8_t nnz[40],
-;                                int8_t ref[2][40], int16_t mv[2][40][2],
-;                                int bidir,    int edges,    int step,
-;                                int mask_mv0, int mask_mv1, int field);
-;
-; bidir    is 0 or 1
-; edges    is 1 or 4
-; step     is 1 or 2
-; mask_mv0 is 0 or 3
-; mask_mv1 is 0 or 1
-; field    is 0 or 1
-;-----------------------------------------------------------------------------
-%macro loop_filter_strength_iteration 7 ; edges, step, mask_mv,
-                                        ; dir, d_idx, mask_dir, bidir
-%define edgesd    %1
-%define stepd     %2
-%define mask_mvd  %3
-%define dir       %4
-%define d_idx     %5
-%define mask_dir  %6
-%define bidir     %7
-    xor          b_idxd, b_idxd ; for (b_idx = 0; b_idx < edges; b_idx += step)
-%%.b_idx_loop:
-%if mask_dir == 0
-    pxor             m0, m0
-%endif
-    test         b_idxd, dword mask_mvd
-    jnz %%.skip_loop_iter                       ; if (!(b_idx & mask_mv))
-%if bidir == 1
-    movd             m2, [refq+b_idxq+d_idx+12] ; { ref0[bn] }
-    punpckldq        m2, [refq+b_idxq+d_idx+52] ; { ref0[bn], ref1[bn] }
-    pshufw           m0, [refq+b_idxq+12], 0x44 ; { ref0[b],  ref0[b]  }
-    pshufw           m1, [refq+b_idxq+52], 0x44 ; { ref1[b],  ref1[b]  }
-    pshufw           m3, m2, 0x4E               ; { ref1[bn], ref0[bn] }
-    psubb            m0, m2                     ; { ref0[b] != ref0[bn],
-                                                ;   ref0[b] != ref1[bn] }
-    psubb            m1, m3                     ; { ref1[b] != ref1[bn],
-                                                ;   ref1[b] != ref0[bn] }
-
-    por              m0, m1
-    mova             m1, [mvq+b_idxq*4+(d_idx+12)*4]
-    mova             m2, [mvq+b_idxq*4+(d_idx+12)*4+mmsize]
-    mova             m3, m1
-    mova             m4, m2
-    psubw            m1, [mvq+b_idxq*4+12*4]
-    psubw            m2, [mvq+b_idxq*4+12*4+mmsize]
-    psubw            m3, [mvq+b_idxq*4+52*4]
-    psubw            m4, [mvq+b_idxq*4+52*4+mmsize]
-    packsswb         m1, m2
-    packsswb         m3, m4
-    paddb            m1, m6
-    paddb            m3, m6
-    psubusb          m1, m5 ; abs(mv[b] - mv[bn]) >= limit
-    psubusb          m3, m5
-    packsswb         m1, m3
-
-    por              m0, m1
-    mova             m1, [mvq+b_idxq*4+(d_idx+52)*4]
-    mova             m2, [mvq+b_idxq*4+(d_idx+52)*4+mmsize]
-    mova             m3, m1
-    mova             m4, m2
-    psubw            m1, [mvq+b_idxq*4+12*4]
-    psubw            m2, [mvq+b_idxq*4+12*4+mmsize]
-    psubw            m3, [mvq+b_idxq*4+52*4]
-    psubw            m4, [mvq+b_idxq*4+52*4+mmsize]
-    packsswb         m1, m2
-    packsswb         m3, m4
-    paddb            m1, m6
-    paddb            m3, m6
-    psubusb          m1, m5 ; abs(mv[b] - mv[bn]) >= limit
-    psubusb          m3, m5
-    packsswb         m1, m3
-
-    pshufw           m1, m1, 0x4E
-    por              m0, m1
-    pshufw           m1, m0, 0x4E
-    pminub           m0, m1
-%else ; bidir == 0
-    movd             m0, [refq+b_idxq+12]
-    psubb            m0, [refq+b_idxq+d_idx+12] ; ref[b] != ref[bn]
-
-    mova             m1, [mvq+b_idxq*4+12*4]
-    mova             m2, [mvq+b_idxq*4+12*4+mmsize]
-    psubw            m1, [mvq+b_idxq*4+(d_idx+12)*4]
-    psubw            m2, [mvq+b_idxq*4+(d_idx+12)*4+mmsize]
-    packsswb         m1, m2
-    paddb            m1, m6
-    psubusb          m1, m5 ; abs(mv[b] - mv[bn]) >= limit
-    packsswb         m1, m1
-    por              m0, m1
-%endif ; bidir == 1/0
-
-%%.skip_loop_iter:
-    movd             m1, [nnzq+b_idxq+12]
-    por              m1, [nnzq+b_idxq+d_idx+12] ; nnz[b] || nnz[bn]
-
-    pminub           m1, m7
-    pminub           m0, m7
-    psllw            m1, 1
-    pxor             m2, m2
-    pmaxub           m1, m0
-    punpcklbw        m1, m2
-    movq [bsq+b_idxq+32*dir], m1
-
-    add          b_idxd, dword stepd
-    cmp          b_idxd, dword edgesd
-    jl %%.b_idx_loop
-%endmacro
-
-INIT_MMX mmxext
-cglobal h264_loop_filter_strength, 9, 9, 0, bs, nnz, ref, mv, bidir, edges, \
-                                            step, mask_mv0, mask_mv1, field
-%define b_idxq bidirq
-%define b_idxd bidird
-    cmp    dword fieldm, 0
-    mova             m7, [pb_1]
-    mova             m5, [pb_3]
-    je .nofield
-    mova             m5, [pb_3_1]
-.nofield:
-    mova             m6, m5
-    paddb            m5, m5
-
-    shl     dword stepd, 3
-    shl    dword edgesd, 3
-%if ARCH_X86_32
-%define mask_mv0d mask_mv0m
-%define mask_mv1d mask_mv1m
-%endif
-    shl dword mask_mv1d, 3
-    shl dword mask_mv0d, 3
-
-    cmp    dword bidird, 0
-    jne .bidir
-    loop_filter_strength_iteration edgesd, stepd, mask_mv1d, 1, -8,  0, 0
-    loop_filter_strength_iteration     32,     8, mask_mv0d, 0, -1, -1, 0
-
-    mova             m0, [bsq+mmsize*0]
-    mova             m1, [bsq+mmsize*1]
-    mova             m2, [bsq+mmsize*2]
-    mova             m3, [bsq+mmsize*3]
-    TRANSPOSE4x4W 0, 1, 2, 3, 4
-    mova  [bsq+mmsize*0], m0
-    mova  [bsq+mmsize*1], m1
-    mova  [bsq+mmsize*2], m2
-    mova  [bsq+mmsize*3], m3
-    RET
-
-.bidir:
-    loop_filter_strength_iteration edgesd, stepd, mask_mv1d, 1, -8,  0, 1
-    loop_filter_strength_iteration     32,     8, mask_mv0d, 0, -1, -1, 1
-
-    mova             m0, [bsq+mmsize*0]
-    mova             m1, [bsq+mmsize*1]
-    mova             m2, [bsq+mmsize*2]
-    mova             m3, [bsq+mmsize*3]
-    TRANSPOSE4x4W 0, 1, 2, 3, 4
-    mova  [bsq+mmsize*0], m0
-    mova  [bsq+mmsize*1], m1
-    mova  [bsq+mmsize*2], m2
-    mova  [bsq+mmsize*3], m3
-    RET
diff --git a/deps/libav/libavcodec/x86/h264_deblock_10bit.asm b/deps/libav/libavcodec/x86/h264_deblock_10bit.asm
deleted file mode 100644
index 3b81ef6..0000000
--- a/deps/libav/libavcodec/x86/h264_deblock_10bit.asm
+++ /dev/null
@@ -1,915 +0,0 @@
-;*****************************************************************************
-;* MMX/SSE2/AVX-optimized 10-bit H.264 deblocking code
-;*****************************************************************************
-;* Copyright (C) 2005-2011 x264 project
-;*
-;* Authors: Oskar Arvidsson <oskar at irock.se>
-;*          Loren Merritt <lorenm at u.washington.edu>
-;*          Jason Garrett-Glaser <darkshikari at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-pw_pixel_max: times 8 dw ((1 << 10)-1)
-
-SECTION .text
-
-cextern pw_2
-cextern pw_3
-cextern pw_4
-
-; out: %4 = |%1-%2|-%3
-; clobbers: %5
-%macro ABS_SUB 5
-    psubusw %5, %2, %1
-    psubusw %4, %1, %2
-    por     %4, %5
-    psubw   %4, %3
-%endmacro
-
-; out: %4 = |%1-%2|<%3
-%macro DIFF_LT   5
-    psubusw %4, %2, %1
-    psubusw %5, %1, %2
-    por     %5, %4 ; |%1-%2|
-    pxor    %4, %4
-    psubw   %5, %3 ; |%1-%2|-%3
-    pcmpgtw %4, %5 ; 0 > |%1-%2|-%3
-%endmacro
-
-%macro LOAD_AB 4
-    movd       %1, %3
-    movd       %2, %4
-    SPLATW     %1, %1
-    SPLATW     %2, %2
-%endmacro
-
-; in:  %2=tc reg
-; out: %1=splatted tc
-%macro LOAD_TC 2
-    movd        %1, [%2]
-    punpcklbw   %1, %1
-%if mmsize == 8
-    pshufw      %1, %1, 0
-%else
-    pshuflw     %1, %1, 01010000b
-    pshufd      %1, %1, 01010000b
-%endif
-    psraw       %1, 6
-%endmacro
-
-; in: %1=p1, %2=p0, %3=q0, %4=q1
-;     %5=alpha, %6=beta, %7-%9=tmp
-; out: %7=mask
-%macro LOAD_MASK 9
-    ABS_SUB     %2, %3, %5, %8, %7 ; |p0-q0| - alpha
-    ABS_SUB     %1, %2, %6, %9, %7 ; |p1-p0| - beta
-    pand        %8, %9
-    ABS_SUB     %3, %4, %6, %9, %7 ; |q1-q0| - beta
-    pxor        %7, %7
-    pand        %8, %9
-    pcmpgtw     %7, %8
-%endmacro
-
-; in: %1=p0, %2=q0, %3=p1, %4=q1, %5=mask, %6=tmp, %7=tmp
-; out: %1=p0', m2=q0'
-%macro DEBLOCK_P0_Q0 7
-    psubw   %3, %4
-    pxor    %7, %7
-    paddw   %3, [pw_4]
-    psubw   %7, %5
-    psubw   %6, %2, %1
-    psllw   %6, 2
-    paddw   %3, %6
-    psraw   %3, 3
-    mova    %6, [pw_pixel_max]
-    CLIPW   %3, %7, %5
-    pxor    %7, %7
-    paddw   %1, %3
-    psubw   %2, %3
-    CLIPW   %1, %7, %6
-    CLIPW   %2, %7, %6
-%endmacro
-
-; in: %1=x2, %2=x1, %3=p0, %4=q0 %5=mask&tc, %6=tmp
-%macro LUMA_Q1 6
-    pavgw       %6, %3, %4      ; (p0+q0+1)>>1
-    paddw       %1, %6
-    pxor        %6, %6
-    psraw       %1, 1
-    psubw       %6, %5
-    psubw       %1, %2
-    CLIPW       %1, %6, %5
-    paddw       %1, %2
-%endmacro
-
-%macro LUMA_DEBLOCK_ONE 3
-    DIFF_LT     m5, %1, bm, m4, m6
-    pxor        m6, m6
-    mova        %3, m4
-    pcmpgtw     m6, tcm
-    pand        m4, tcm
-    pandn       m6, m7
-    pand        m4, m6
-    LUMA_Q1 m5, %2, m1, m2, m4, m6
-%endmacro
-
-%macro LUMA_H_STORE 2
-%if mmsize == 8
-    movq        [r0-4], m0
-    movq        [r0+r1-4], m1
-    movq        [r0+r1*2-4], m2
-    movq        [r0+%2-4], m3
-%else
-    movq        [r0-4], m0
-    movhps      [r0+r1-4], m0
-    movq        [r0+r1*2-4], m1
-    movhps      [%1-4], m1
-    movq        [%1+r1-4], m2
-    movhps      [%1+r1*2-4], m2
-    movq        [%1+%2-4], m3
-    movhps      [%1+r1*4-4], m3
-%endif
-%endmacro
-
-%macro DEBLOCK_LUMA 0
-;-----------------------------------------------------------------------------
-; void deblock_v_luma( uint16_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
-;-----------------------------------------------------------------------------
-cglobal deblock_v_luma_10, 5,5,8*(mmsize/16)
-    %assign pad 5*mmsize+12-(stack_offset&15)
-    %define tcm [rsp]
-    %define ms1 [rsp+mmsize]
-    %define ms2 [rsp+mmsize*2]
-    %define am  [rsp+mmsize*3]
-    %define bm  [rsp+mmsize*4]
-    SUB        rsp, pad
-    shl        r2d, 2
-    shl        r3d, 2
-    LOAD_AB     m4, m5, r2d, r3d
-    mov         r3, 32/mmsize
-    mov         r2, r0
-    sub         r0, r1
-    mova        am, m4
-    sub         r0, r1
-    mova        bm, m5
-    sub         r0, r1
-.loop:
-    mova        m0, [r0+r1]
-    mova        m1, [r0+r1*2]
-    mova        m2, [r2]
-    mova        m3, [r2+r1]
-
-    LOAD_MASK   m0, m1, m2, m3, am, bm, m7, m4, m6
-    LOAD_TC     m6, r4
-    mova       tcm, m6
-
-    mova        m5, [r0]
-    LUMA_DEBLOCK_ONE m1, m0, ms1
-    mova   [r0+r1], m5
-
-    mova        m5, [r2+r1*2]
-    LUMA_DEBLOCK_ONE m2, m3, ms2
-    mova   [r2+r1], m5
-
-    pxor        m5, m5
-    mova        m6, tcm
-    pcmpgtw     m5, tcm
-    psubw       m6, ms1
-    pandn       m5, m7
-    psubw       m6, ms2
-    pand        m5, m6
-    DEBLOCK_P0_Q0 m1, m2, m0, m3, m5, m7, m6
-    mova [r0+r1*2], m1
-    mova      [r2], m2
-
-    add         r0, mmsize
-    add         r2, mmsize
-    add         r4, mmsize/8
-    dec         r3
-    jg .loop
-    ADD         rsp, pad
-    RET
-
-cglobal deblock_h_luma_10, 5,6,8*(mmsize/16)
-    %assign pad 7*mmsize+12-(stack_offset&15)
-    %define tcm [rsp]
-    %define ms1 [rsp+mmsize]
-    %define ms2 [rsp+mmsize*2]
-    %define p1m [rsp+mmsize*3]
-    %define p2m [rsp+mmsize*4]
-    %define am  [rsp+mmsize*5]
-    %define bm  [rsp+mmsize*6]
-    SUB        rsp, pad
-    shl        r2d, 2
-    shl        r3d, 2
-    LOAD_AB     m4, m5, r2d, r3d
-    mov         r3, r1
-    mova        am, m4
-    add         r3, r1
-    mov         r5, 32/mmsize
-    mova        bm, m5
-    add         r3, r1
-%if mmsize == 16
-    mov         r2, r0
-    add         r2, r3
-%endif
-.loop:
-%if mmsize == 8
-    movq        m2, [r0-8]     ; y q2 q1 q0
-    movq        m7, [r0+0]
-    movq        m5, [r0+r1-8]
-    movq        m3, [r0+r1+0]
-    movq        m0, [r0+r1*2-8]
-    movq        m6, [r0+r1*2+0]
-    movq        m1, [r0+r3-8]
-    TRANSPOSE4x4W 2, 5, 0, 1, 4
-    SWAP         2, 7
-    movq        m7, [r0+r3]
-    TRANSPOSE4x4W 2, 3, 6, 7, 4
-%else
-    movu        m5, [r0-8]     ; y q2 q1 q0 p0 p1 p2 x
-    movu        m0, [r0+r1-8]
-    movu        m2, [r0+r1*2-8]
-    movu        m3, [r2-8]
-    TRANSPOSE4x4W 5, 0, 2, 3, 6
-    mova       tcm, m3
-
-    movu        m4, [r2+r1-8]
-    movu        m1, [r2+r1*2-8]
-    movu        m3, [r2+r3-8]
-    movu        m7, [r2+r1*4-8]
-    TRANSPOSE4x4W 4, 1, 3, 7, 6
-
-    mova        m6, tcm
-    punpcklqdq  m6, m7
-    punpckhqdq  m5, m4
-    SBUTTERFLY qdq, 0, 1, 7
-    SBUTTERFLY qdq, 2, 3, 7
-%endif
-
-    mova       p2m, m6
-    LOAD_MASK   m0, m1, m2, m3, am, bm, m7, m4, m6
-    LOAD_TC     m6, r4
-    mova       tcm, m6
-
-    LUMA_DEBLOCK_ONE m1, m0, ms1
-    mova       p1m, m5
-
-    mova        m5, p2m
-    LUMA_DEBLOCK_ONE m2, m3, ms2
-    mova       p2m, m5
-
-    pxor        m5, m5
-    mova        m6, tcm
-    pcmpgtw     m5, tcm
-    psubw       m6, ms1
-    pandn       m5, m7
-    psubw       m6, ms2
-    pand        m5, m6
-    DEBLOCK_P0_Q0 m1, m2, m0, m3, m5, m7, m6
-    mova        m0, p1m
-    mova        m3, p2m
-    TRANSPOSE4x4W 0, 1, 2, 3, 4
-    LUMA_H_STORE r2, r3
-
-    add         r4, mmsize/8
-    lea         r0, [r0+r1*(mmsize/2)]
-    lea         r2, [r2+r1*(mmsize/2)]
-    dec         r5
-    jg .loop
-    ADD        rsp, pad
-    RET
-%endmacro
-
-%if ARCH_X86_64
-; in:  m0=p1, m1=p0, m2=q0, m3=q1, m8=p2, m9=q2
-;      m12=alpha, m13=beta
-; out: m0=p1', m3=q1', m1=p0', m2=q0'
-; clobbers: m4, m5, m6, m7, m10, m11, m14
-%macro DEBLOCK_LUMA_INTER_SSE2 0
-    LOAD_MASK   m0, m1, m2, m3, m12, m13, m7, m4, m6
-    LOAD_TC     m6, r4
-    DIFF_LT     m8, m1, m13, m10, m4
-    DIFF_LT     m9, m2, m13, m11, m4
-    pand        m6, m7
-
-    mova       m14, m6
-    pxor        m4, m4
-    pcmpgtw     m6, m4
-    pand        m6, m14
-
-    mova        m5, m10
-    pand        m5, m6
-    LUMA_Q1 m8, m0, m1, m2, m5, m4
-
-    mova        m5, m11
-    pand        m5, m6
-    LUMA_Q1 m9, m3, m1, m2, m5, m4
-
-    pxor        m4, m4
-    psubw       m6, m10
-    pcmpgtw     m4, m14
-    pandn       m4, m7
-    psubw       m6, m11
-    pand        m4, m6
-    DEBLOCK_P0_Q0 m1, m2, m0, m3, m4, m5, m6
-
-    SWAP         0, 8
-    SWAP         3, 9
-%endmacro
-
-%macro DEBLOCK_LUMA_64 0
-cglobal deblock_v_luma_10, 5,5,15
-    %define p2 m8
-    %define p1 m0
-    %define p0 m1
-    %define q0 m2
-    %define q1 m3
-    %define q2 m9
-    %define mask0 m7
-    %define mask1 m10
-    %define mask2 m11
-    shl        r2d, 2
-    shl        r3d, 2
-    LOAD_AB    m12, m13, r2d, r3d
-    mov         r2, r0
-    sub         r0, r1
-    sub         r0, r1
-    sub         r0, r1
-    mov         r3, 2
-.loop:
-    mova        p2, [r0]
-    mova        p1, [r0+r1]
-    mova        p0, [r0+r1*2]
-    mova        q0, [r2]
-    mova        q1, [r2+r1]
-    mova        q2, [r2+r1*2]
-    DEBLOCK_LUMA_INTER_SSE2
-    mova   [r0+r1], p1
-    mova [r0+r1*2], p0
-    mova      [r2], q0
-    mova   [r2+r1], q1
-    add         r0, mmsize
-    add         r2, mmsize
-    add         r4, 2
-    dec         r3
-    jg .loop
-    REP_RET
-
-cglobal deblock_h_luma_10, 5,7,15
-    shl        r2d, 2
-    shl        r3d, 2
-    LOAD_AB    m12, m13, r2d, r3d
-    mov         r2, r1
-    add         r2, r1
-    add         r2, r1
-    mov         r5, r0
-    add         r5, r2
-    mov         r6, 2
-.loop:
-    movu        m8, [r0-8]     ; y q2 q1 q0 p0 p1 p2 x
-    movu        m0, [r0+r1-8]
-    movu        m2, [r0+r1*2-8]
-    movu        m9, [r5-8]
-    movu        m5, [r5+r1-8]
-    movu        m1, [r5+r1*2-8]
-    movu        m3, [r5+r2-8]
-    movu        m7, [r5+r1*4-8]
-
-    TRANSPOSE4x4W 8, 0, 2, 9, 10
-    TRANSPOSE4x4W 5, 1, 3, 7, 10
-
-    punpckhqdq  m8, m5
-    SBUTTERFLY qdq, 0, 1, 10
-    SBUTTERFLY qdq, 2, 3, 10
-    punpcklqdq  m9, m7
-
-    DEBLOCK_LUMA_INTER_SSE2
-
-    TRANSPOSE4x4W 0, 1, 2, 3, 4
-    LUMA_H_STORE r5, r2
-    add         r4, 2
-    lea         r0, [r0+r1*8]
-    lea         r5, [r5+r1*8]
-    dec         r6
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-DEBLOCK_LUMA_64
-INIT_XMM avx
-DEBLOCK_LUMA_64
-%endif
-
-%macro SWAPMOVA 2
-%ifid %1
-    SWAP %1, %2
-%else
-    mova %1, %2
-%endif
-%endmacro
-
-; in: t0-t2: tmp registers
-;     %1=p0 %2=p1 %3=p2 %4=p3 %5=q0 %6=q1 %7=mask0
-;     %8=mask1p %9=2 %10=p0' %11=p1' %12=p2'
-%macro LUMA_INTRA_P012 12 ; p0..p3 in memory
-%if ARCH_X86_64
-    paddw     t0, %3, %2
-    mova      t2, %4
-    paddw     t2, %3
-%else
-    mova      t0, %3
-    mova      t2, %4
-    paddw     t0, %2
-    paddw     t2, %3
-%endif
-    paddw     t0, %1
-    paddw     t2, t2
-    paddw     t0, %5
-    paddw     t2, %9
-    paddw     t0, %9    ; (p2 + p1 + p0 + q0 + 2)
-    paddw     t2, t0    ; (2*p3 + 3*p2 + p1 + p0 + q0 + 4)
-
-    psrlw     t2, 3
-    psrlw     t1, t0, 2
-    psubw     t2, %3
-    psubw     t1, %2
-    pand      t2, %8
-    pand      t1, %8
-    paddw     t2, %3
-    paddw     t1, %2
-    SWAPMOVA %11, t1
-
-    psubw     t1, t0, %3
-    paddw     t0, t0
-    psubw     t1, %5
-    psubw     t0, %3
-    paddw     t1, %6
-    paddw     t1, %2
-    paddw     t0, %6
-    psrlw     t1, 2     ; (2*p1 + p0 + q1 + 2)/4
-    psrlw     t0, 3     ; (p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4)>>3
-
-    pxor      t0, t1
-    pxor      t1, %1
-    pand      t0, %8
-    pand      t1, %7
-    pxor      t0, t1
-    pxor      t0, %1
-    SWAPMOVA %10, t0
-    SWAPMOVA %12, t2
-%endmacro
-
-%macro LUMA_INTRA_INIT 1
-    %xdefine pad %1*mmsize+((gprsize*3) % mmsize)-(stack_offset&15)
-    %define t0 m4
-    %define t1 m5
-    %define t2 m6
-    %define t3 m7
-    %assign i 4
-%rep %1
-    CAT_XDEFINE t, i, [rsp+mmsize*(i-4)]
-    %assign i i+1
-%endrep
-    SUB    rsp, pad
-%endmacro
-
-; in: %1-%3=tmp, %4=p2, %5=q2
-%macro LUMA_INTRA_INTER 5
-    LOAD_AB t0, t1, r2d, r3d
-    mova    %1, t0
-    LOAD_MASK m0, m1, m2, m3, %1, t1, t0, t2, t3
-%if ARCH_X86_64
-    mova    %2, t0        ; mask0
-    psrlw   t3, %1, 2
-%else
-    mova    t3, %1
-    mova    %2, t0        ; mask0
-    psrlw   t3, 2
-%endif
-    paddw   t3, [pw_2]    ; alpha/4+2
-    DIFF_LT m1, m2, t3, t2, t0 ; t2 = |p0-q0| < alpha/4+2
-    pand    t2, %2
-    mova    t3, %5        ; q2
-    mova    %1, t2        ; mask1
-    DIFF_LT t3, m2, t1, t2, t0 ; t2 = |q2-q0| < beta
-    pand    t2, %1
-    mova    t3, %4        ; p2
-    mova    %3, t2        ; mask1q
-    DIFF_LT t3, m1, t1, t2, t0 ; t2 = |p2-p0| < beta
-    pand    t2, %1
-    mova    %1, t2        ; mask1p
-%endmacro
-
-%macro LUMA_H_INTRA_LOAD 0
-%if mmsize == 8
-    movu    t0, [r0-8]
-    movu    t1, [r0+r1-8]
-    movu    m0, [r0+r1*2-8]
-    movu    m1, [r0+r4-8]
-    TRANSPOSE4x4W 4, 5, 0, 1, 2
-    mova    t4, t0        ; p3
-    mova    t5, t1        ; p2
-
-    movu    m2, [r0]
-    movu    m3, [r0+r1]
-    movu    t0, [r0+r1*2]
-    movu    t1, [r0+r4]
-    TRANSPOSE4x4W 2, 3, 4, 5, 6
-    mova    t6, t0        ; q2
-    mova    t7, t1        ; q3
-%else
-    movu    t0, [r0-8]
-    movu    t1, [r0+r1-8]
-    movu    m0, [r0+r1*2-8]
-    movu    m1, [r0+r5-8]
-    movu    m2, [r4-8]
-    movu    m3, [r4+r1-8]
-    movu    t2, [r4+r1*2-8]
-    movu    t3, [r4+r5-8]
-    TRANSPOSE8x8W 4, 5, 0, 1, 2, 3, 6, 7, t4, t5
-    mova    t4, t0        ; p3
-    mova    t5, t1        ; p2
-    mova    t6, t2        ; q2
-    mova    t7, t3        ; q3
-%endif
-%endmacro
-
-; in: %1=q3 %2=q2' %3=q1' %4=q0' %5=p0' %6=p1' %7=p2' %8=p3 %9=tmp
-%macro LUMA_H_INTRA_STORE 9
-%if mmsize == 8
-    TRANSPOSE4x4W %1, %2, %3, %4, %9
-    movq       [r0-8], m%1
-    movq       [r0+r1-8], m%2
-    movq       [r0+r1*2-8], m%3
-    movq       [r0+r4-8], m%4
-    movq       m%1, %8
-    TRANSPOSE4x4W %5, %6, %7, %1, %9
-    movq       [r0], m%5
-    movq       [r0+r1], m%6
-    movq       [r0+r1*2], m%7
-    movq       [r0+r4], m%1
-%else
-    TRANSPOSE2x4x4W %1, %2, %3, %4, %9
-    movq       [r0-8], m%1
-    movq       [r0+r1-8], m%2
-    movq       [r0+r1*2-8], m%3
-    movq       [r0+r5-8], m%4
-    movhps     [r4-8], m%1
-    movhps     [r4+r1-8], m%2
-    movhps     [r4+r1*2-8], m%3
-    movhps     [r4+r5-8], m%4
-%ifnum %8
-    SWAP       %1, %8
-%else
-    mova       m%1, %8
-%endif
-    TRANSPOSE2x4x4W %5, %6, %7, %1, %9
-    movq       [r0], m%5
-    movq       [r0+r1], m%6
-    movq       [r0+r1*2], m%7
-    movq       [r0+r5], m%1
-    movhps     [r4], m%5
-    movhps     [r4+r1], m%6
-    movhps     [r4+r1*2], m%7
-    movhps     [r4+r5], m%1
-%endif
-%endmacro
-
-%if ARCH_X86_64
-;-----------------------------------------------------------------------------
-; void deblock_v_luma_intra( uint16_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
-%macro DEBLOCK_LUMA_INTRA_64 0
-cglobal deblock_v_luma_intra_10, 4,7,16
-    %define t0 m1
-    %define t1 m2
-    %define t2 m4
-    %define p2 m8
-    %define p1 m9
-    %define p0 m10
-    %define q0 m11
-    %define q1 m12
-    %define q2 m13
-    %define aa m5
-    %define bb m14
-    lea     r4, [r1*4]
-    lea     r5, [r1*3] ; 3*stride
-    neg     r4
-    add     r4, r0     ; pix-4*stride
-    mov     r6, 2
-    mova    m0, [pw_2]
-    shl    r2d, 2
-    shl    r3d, 2
-    LOAD_AB aa, bb, r2d, r3d
-.loop:
-    mova    p2, [r4+r1]
-    mova    p1, [r4+2*r1]
-    mova    p0, [r4+r5]
-    mova    q0, [r0]
-    mova    q1, [r0+r1]
-    mova    q2, [r0+2*r1]
-
-    LOAD_MASK p1, p0, q0, q1, aa, bb, m3, t0, t1
-    mova    t2, aa
-    psrlw   t2, 2
-    paddw   t2, m0 ; alpha/4+2
-    DIFF_LT p0, q0, t2, m6, t0 ; m6 = |p0-q0| < alpha/4+2
-    DIFF_LT p2, p0, bb, t1, t0 ; m7 = |p2-p0| < beta
-    DIFF_LT q2, q0, bb, m7, t0 ; t1 = |q2-q0| < beta
-    pand    m6, m3
-    pand    m7, m6
-    pand    m6, t1
-    LUMA_INTRA_P012 p0, p1, p2, [r4], q0, q1, m3, m6, m0, [r4+r5], [r4+2*r1], [r4+r1]
-    LUMA_INTRA_P012 q0, q1, q2, [r0+r5], p0, p1, m3, m7, m0, [r0], [r0+r1], [r0+2*r1]
-    add     r0, mmsize
-    add     r4, mmsize
-    dec     r6
-    jg .loop
-    REP_RET
-
-;-----------------------------------------------------------------------------
-; void deblock_h_luma_intra( uint16_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
-cglobal deblock_h_luma_intra_10, 4,7,16
-    %define t0 m15
-    %define t1 m14
-    %define t2 m2
-    %define q3 m5
-    %define q2 m8
-    %define q1 m9
-    %define q0 m10
-    %define p0 m11
-    %define p1 m12
-    %define p2 m13
-    %define p3 m4
-    %define spill [rsp]
-    %assign pad 24-(stack_offset&15)
-    SUB     rsp, pad
-    lea     r4, [r1*4]
-    lea     r5, [r1*3] ; 3*stride
-    add     r4, r0     ; pix+4*stride
-    mov     r6, 2
-    mova    m0, [pw_2]
-    shl    r2d, 2
-    shl    r3d, 2
-.loop:
-    movu    q3, [r0-8]
-    movu    q2, [r0+r1-8]
-    movu    q1, [r0+r1*2-8]
-    movu    q0, [r0+r5-8]
-    movu    p0, [r4-8]
-    movu    p1, [r4+r1-8]
-    movu    p2, [r4+r1*2-8]
-    movu    p3, [r4+r5-8]
-    TRANSPOSE8x8W 5, 8, 9, 10, 11, 12, 13, 4, 1
-
-    LOAD_AB m1, m2, r2d, r3d
-    LOAD_MASK q1, q0, p0, p1, m1, m2, m3, t0, t1
-    psrlw   m1, 2
-    paddw   m1, m0 ; alpha/4+2
-    DIFF_LT p0, q0, m1, m6, t0 ; m6 = |p0-q0| < alpha/4+2
-    DIFF_LT q2, q0, m2, t1, t0 ; t1 = |q2-q0| < beta
-    DIFF_LT p0, p2, m2, m7, t0 ; m7 = |p2-p0| < beta
-    pand    m6, m3
-    pand    m7, m6
-    pand    m6, t1
-
-    mova spill, q3
-    LUMA_INTRA_P012 q0, q1, q2, q3, p0, p1, m3, m6, m0, m5, m1, q2
-    LUMA_INTRA_P012 p0, p1, p2, p3, q0, q1, m3, m7, m0, p0, m6, p2
-    mova    m7, spill
-
-    LUMA_H_INTRA_STORE 7, 8, 1, 5, 11, 6, 13, 4, 14
-
-    lea     r0, [r0+r1*8]
-    lea     r4, [r4+r1*8]
-    dec     r6
-    jg .loop
-    ADD    rsp, pad
-    RET
-%endmacro
-
-INIT_XMM sse2
-DEBLOCK_LUMA_INTRA_64
-INIT_XMM avx
-DEBLOCK_LUMA_INTRA_64
-
-%endif
-
-%macro DEBLOCK_LUMA_INTRA 0
-;-----------------------------------------------------------------------------
-; void deblock_v_luma_intra( uint16_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
-cglobal deblock_v_luma_intra_10, 4,7,8*(mmsize/16)
-    LUMA_INTRA_INIT 3
-    lea     r4, [r1*4]
-    lea     r5, [r1*3]
-    neg     r4
-    add     r4, r0
-    mov     r6, 32/mmsize
-    shl    r2d, 2
-    shl    r3d, 2
-.loop:
-    mova    m0, [r4+r1*2] ; p1
-    mova    m1, [r4+r5]   ; p0
-    mova    m2, [r0]      ; q0
-    mova    m3, [r0+r1]   ; q1
-    LUMA_INTRA_INTER t4, t5, t6, [r4+r1], [r0+r1*2]
-    LUMA_INTRA_P012 m1, m0, t3, [r4], m2, m3, t5, t4, [pw_2], [r4+r5], [r4+2*r1], [r4+r1]
-    mova    t3, [r0+r1*2] ; q2
-    LUMA_INTRA_P012 m2, m3, t3, [r0+r5], m1, m0, t5, t6, [pw_2], [r0], [r0+r1], [r0+2*r1]
-    add     r0, mmsize
-    add     r4, mmsize
-    dec     r6
-    jg .loop
-    ADD    rsp, pad
-    RET
-
-;-----------------------------------------------------------------------------
-; void deblock_h_luma_intra( uint16_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
-cglobal deblock_h_luma_intra_10, 4,7,8*(mmsize/16)
-    LUMA_INTRA_INIT 8
-%if mmsize == 8
-    lea     r4, [r1*3]
-    mov     r5, 32/mmsize
-%else
-    lea     r4, [r1*4]
-    lea     r5, [r1*3] ; 3*stride
-    add     r4, r0     ; pix+4*stride
-    mov     r6, 32/mmsize
-%endif
-    shl    r2d, 2
-    shl    r3d, 2
-.loop:
-    LUMA_H_INTRA_LOAD
-    LUMA_INTRA_INTER t8, t9, t10, t5, t6
-
-    LUMA_INTRA_P012 m1, m0, t3, t4, m2, m3, t9, t8, [pw_2], t8, t5, t11
-    mova    t3, t6     ; q2
-    LUMA_INTRA_P012 m2, m3, t3, t7, m1, m0, t9, t10, [pw_2], m4, t6, m5
-
-    mova    m2, t4
-    mova    m0, t11
-    mova    m1, t5
-    mova    m3, t8
-    mova    m6, t6
-
-    LUMA_H_INTRA_STORE 2, 0, 1, 3, 4, 6, 5, t7, 7
-
-    lea     r0, [r0+r1*(mmsize/2)]
-%if mmsize == 8
-    dec     r5
-%else
-    lea     r4, [r4+r1*(mmsize/2)]
-    dec     r6
-%endif
-    jg .loop
-    ADD    rsp, pad
-    RET
-%endmacro
-
-%if ARCH_X86_64 == 0
-INIT_MMX mmxext
-DEBLOCK_LUMA
-DEBLOCK_LUMA_INTRA
-INIT_XMM sse2
-DEBLOCK_LUMA
-DEBLOCK_LUMA_INTRA
-INIT_XMM avx
-DEBLOCK_LUMA
-DEBLOCK_LUMA_INTRA
-%endif
-
-; in: %1=p0, %2=q0, %3=p1, %4=q1, %5=mask, %6=tmp, %7=tmp
-; out: %1=p0', %2=q0'
-%macro CHROMA_DEBLOCK_P0_Q0_INTRA 7
-    mova    %6, [pw_2]
-    paddw   %6, %3
-    paddw   %6, %4
-    paddw   %7, %6, %2
-    paddw   %6, %1
-    paddw   %6, %3
-    paddw   %7, %4
-    psraw   %6, 2
-    psraw   %7, 2
-    psubw   %6, %1
-    psubw   %7, %2
-    pand    %6, %5
-    pand    %7, %5
-    paddw   %1, %6
-    paddw   %2, %7
-%endmacro
-
-%macro CHROMA_V_LOAD 1
-    mova        m0, [r0]    ; p1
-    mova        m1, [r0+r1] ; p0
-    mova        m2, [%1]    ; q0
-    mova        m3, [%1+r1] ; q1
-%endmacro
-
-%macro CHROMA_V_STORE 0
-    mova [r0+1*r1], m1
-    mova [r0+2*r1], m2
-%endmacro
-
-%macro CHROMA_V_LOAD_TC 2
-    movd        %1, [%2]
-    punpcklbw   %1, %1
-    punpcklwd   %1, %1
-    psraw       %1, 6
-%endmacro
-
-%macro DEBLOCK_CHROMA 0
-;-----------------------------------------------------------------------------
-; void deblock_v_chroma( uint16_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
-;-----------------------------------------------------------------------------
-cglobal deblock_v_chroma_10, 5,7-(mmsize/16),8*(mmsize/16)
-    mov         r5, r0
-    sub         r0, r1
-    sub         r0, r1
-    shl        r2d, 2
-    shl        r3d, 2
-%if mmsize < 16
-    mov         r6, 16/mmsize
-.loop:
-%endif
-    CHROMA_V_LOAD r5
-    LOAD_AB     m4, m5, r2d, r3d
-    LOAD_MASK   m0, m1, m2, m3, m4, m5, m7, m6, m4
-    pxor        m4, m4
-    CHROMA_V_LOAD_TC m6, r4
-    psubw       m6, [pw_3]
-    pmaxsw      m6, m4
-    pand        m7, m6
-    DEBLOCK_P0_Q0 m1, m2, m0, m3, m7, m5, m6
-    CHROMA_V_STORE
-%if mmsize < 16
-    add         r0, mmsize
-    add         r5, mmsize
-    add         r4, mmsize/4
-    dec         r6
-    jg .loop
-    REP_RET
-%else
-    RET
-%endif
-
-;-----------------------------------------------------------------------------
-; void deblock_v_chroma_intra( uint16_t *pix, int stride, int alpha, int beta )
-;-----------------------------------------------------------------------------
-cglobal deblock_v_chroma_intra_10, 4,6-(mmsize/16),8*(mmsize/16)
-    mov         r4, r0
-    sub         r0, r1
-    sub         r0, r1
-    shl        r2d, 2
-    shl        r3d, 2
-%if mmsize < 16
-    mov         r5, 16/mmsize
-.loop:
-%endif
-    CHROMA_V_LOAD r4
-    LOAD_AB     m4, m5, r2d, r3d
-    LOAD_MASK   m0, m1, m2, m3, m4, m5, m7, m6, m4
-    CHROMA_DEBLOCK_P0_Q0_INTRA m1, m2, m0, m3, m7, m5, m6
-    CHROMA_V_STORE
-%if mmsize < 16
-    add         r0, mmsize
-    add         r4, mmsize
-    dec         r5
-    jg .loop
-    REP_RET
-%else
-    RET
-%endif
-%endmacro
-
-%if ARCH_X86_64 == 0
-INIT_MMX mmxext
-DEBLOCK_CHROMA
-%endif
-INIT_XMM sse2
-DEBLOCK_CHROMA
-INIT_XMM avx
-DEBLOCK_CHROMA
diff --git a/deps/libav/libavcodec/x86/h264_i386.h b/deps/libav/libavcodec/x86/h264_i386.h
deleted file mode 100644
index bb881c3..0000000
--- a/deps/libav/libavcodec/x86/h264_i386.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * H.264 / AVC / MPEG4 part10 codec.
- * non-MMX i386-specific optimizations for H.264
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVCODEC_X86_H264_I386_H
-#define AVCODEC_X86_H264_I386_H
-
-#include <stddef.h>
-
-#include "libavcodec/cabac.h"
-#include "cabac.h"
-
-#if HAVE_INLINE_ASM
-
-//FIXME use some macros to avoid duplicating get_cabac (cannot be done yet
-//as that would make optimization work hard)
-#if HAVE_7REGS
-#define decode_significance decode_significance_x86
-static int decode_significance_x86(CABACContext *c, int max_coeff,
-                                   uint8_t *significant_coeff_ctx_base,
-                                   int *index, x86_reg last_off){
-    void *end= significant_coeff_ctx_base + max_coeff - 1;
-    int minusstart= -(intptr_t)significant_coeff_ctx_base;
-    int minusindex= 4-(intptr_t)index;
-    int bit;
-    x86_reg coeff_count;
-
-#ifdef BROKEN_RELOCATIONS
-    void *tables;
-
-    __asm__ volatile(
-        "lea   "MANGLE(ff_h264_cabac_tables)", %0      \n\t"
-        : "=&r"(tables)
-    );
-#endif
-
-    __asm__ volatile(
-        "3:                                     \n\t"
-
-        BRANCHLESS_GET_CABAC("%4", "%q4", "(%1)", "%3", "%w3",
-                             "%5", "%q5", "%k0", "%b0",
-                             "%c11(%6)", "%c12(%6)",
-                             AV_STRINGIFY(H264_NORM_SHIFT_OFFSET),
-                             AV_STRINGIFY(H264_LPS_RANGE_OFFSET),
-                             AV_STRINGIFY(H264_MLPS_STATE_OFFSET),
-                             "%13")
-
-        "test $1, %4                            \n\t"
-        " jz 4f                                 \n\t"
-        "add  %10, %1                           \n\t"
-
-        BRANCHLESS_GET_CABAC("%4", "%q4", "(%1)", "%3", "%w3",
-                             "%5", "%q5", "%k0", "%b0",
-                             "%c11(%6)", "%c12(%6)",
-                             AV_STRINGIFY(H264_NORM_SHIFT_OFFSET),
-                             AV_STRINGIFY(H264_LPS_RANGE_OFFSET),
-                             AV_STRINGIFY(H264_MLPS_STATE_OFFSET),
-                             "%13")
-
-        "sub  %10, %1                           \n\t"
-        "mov  %2, %0                            \n\t"
-        "movl %7, %%ecx                         \n\t"
-        "add  %1, %%"REG_c"                     \n\t"
-        "movl %%ecx, (%0)                       \n\t"
-
-        "test $1, %4                            \n\t"
-        " jnz 5f                                \n\t"
-
-        "add"OPSIZE"  $4, %2                    \n\t"
-
-        "4:                                     \n\t"
-        "add  $1, %1                            \n\t"
-        "cmp  %8, %1                            \n\t"
-        " jb 3b                                 \n\t"
-        "mov  %2, %0                            \n\t"
-        "movl %7, %%ecx                         \n\t"
-        "add  %1, %%"REG_c"                     \n\t"
-        "movl %%ecx, (%0)                       \n\t"
-        "5:                                     \n\t"
-        "add  %9, %k0                           \n\t"
-        "shr $2, %k0                            \n\t"
-        : "=&q"(coeff_count), "+r"(significant_coeff_ctx_base), "+m"(index),
-          "+&r"(c->low), "=&r"(bit), "+&r"(c->range)
-        : "r"(c), "m"(minusstart), "m"(end), "m"(minusindex), "m"(last_off),
-          "i"(offsetof(CABACContext, bytestream)),
-          "i"(offsetof(CABACContext, bytestream_end))
-          TABLES_ARG
-        : "%"REG_c, "memory"
-    );
-    return coeff_count;
-}
-
-#define decode_significance_8x8 decode_significance_8x8_x86
-static int decode_significance_8x8_x86(CABACContext *c,
-                                       uint8_t *significant_coeff_ctx_base,
-                                       int *index, uint8_t *last_coeff_ctx_base, const uint8_t *sig_off){
-    int minusindex= 4-(intptr_t)index;
-    int bit;
-    x86_reg coeff_count;
-    x86_reg last=0;
-    x86_reg state;
-
-#ifdef BROKEN_RELOCATIONS
-    void *tables;
-
-    __asm__ volatile(
-        "lea    "MANGLE(ff_h264_cabac_tables)", %0      \n\t"
-        : "=&r"(tables)
-    );
-#endif
-
-    __asm__ volatile(
-        "mov %1, %6                             \n\t"
-        "3:                                     \n\t"
-
-        "mov %10, %0                            \n\t"
-        "movzbl (%0, %6), %k6                   \n\t"
-        "add %9, %6                             \n\t"
-
-        BRANCHLESS_GET_CABAC("%4", "%q4", "(%6)", "%3", "%w3",
-                             "%5", "%q5", "%k0", "%b0",
-                             "%c12(%7)", "%c13(%7)",
-                             AV_STRINGIFY(H264_NORM_SHIFT_OFFSET),
-                             AV_STRINGIFY(H264_LPS_RANGE_OFFSET),
-                             AV_STRINGIFY(H264_MLPS_STATE_OFFSET),
-                             "%15")
-
-        "mov %1, %k6                            \n\t"
-        "test $1, %4                            \n\t"
-        " jz 4f                                 \n\t"
-
-#ifdef BROKEN_RELOCATIONS
-        "movzbl %c14(%15, %q6), %k6\n\t"
-#else
-        "movzbl "MANGLE(ff_h264_cabac_tables)"+%c14(%k6), %k6\n\t"
-#endif
-        "add %11, %6                            \n\t"
-
-        BRANCHLESS_GET_CABAC("%4", "%q4", "(%6)", "%3", "%w3",
-                             "%5", "%q5", "%k0", "%b0",
-                             "%c12(%7)", "%c13(%7)",
-                             AV_STRINGIFY(H264_NORM_SHIFT_OFFSET),
-                             AV_STRINGIFY(H264_LPS_RANGE_OFFSET),
-                             AV_STRINGIFY(H264_MLPS_STATE_OFFSET),
-                             "%15")
-
-        "mov %2, %0                             \n\t"
-        "mov %1, %k6                            \n\t"
-        "movl %k6, (%0)                         \n\t"
-
-        "test $1, %4                            \n\t"
-        " jnz 5f                                \n\t"
-
-        "add"OPSIZE"  $4, %2                    \n\t"
-
-        "4:                                     \n\t"
-        "addl $1, %k6                           \n\t"
-        "mov %k6, %1                            \n\t"
-        "cmpl $63, %k6                          \n\t"
-        " jb 3b                                 \n\t"
-        "mov %2, %0                             \n\t"
-        "movl %k6, (%0)                         \n\t"
-        "5:                                     \n\t"
-        "addl %8, %k0                           \n\t"
-        "shr $2, %k0                            \n\t"
-        : "=&q"(coeff_count), "+m"(last), "+m"(index), "+&r"(c->low),
-          "=&r"(bit), "+&r"(c->range), "=&r"(state)
-        : "r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base),
-          "m"(sig_off), "m"(last_coeff_ctx_base),
-          "i"(offsetof(CABACContext, bytestream)),
-          "i"(offsetof(CABACContext, bytestream_end)),
-          "i"(H264_LAST_COEFF_FLAG_OFFSET_8x8_OFFSET) TABLES_ARG
-        : "%"REG_c, "memory"
-    );
-    return coeff_count;
-}
-#endif /* HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */
-
-#endif /* HAVE_INLINE_ASM */
-#endif /* AVCODEC_X86_H264_I386_H */
diff --git a/deps/libav/libavcodec/x86/h264_idct.asm b/deps/libav/libavcodec/x86/h264_idct.asm
deleted file mode 100644
index 2771291..0000000
--- a/deps/libav/libavcodec/x86/h264_idct.asm
+++ /dev/null
@@ -1,1082 +0,0 @@
-;*****************************************************************************
-;* MMX/SSE2-optimized H.264 iDCT
-;*****************************************************************************
-;* Copyright (C) 2004-2005 Michael Niedermayer, Loren Merritt
-;* Copyright (C) 2003-2008 x264 project
-;*
-;* Authors: Laurent Aimar <fenrir at via.ecp.fr>
-;*          Loren Merritt <lorenm at u.washington.edu>
-;*          Holger Lubitz <hal at duncan.ol.sub.de>
-;*          Min Chen <chenm001.163.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;*****************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-scan8_mem: db  4+ 1*8, 5+ 1*8, 4+ 2*8, 5+ 2*8
-           db  6+ 1*8, 7+ 1*8, 6+ 2*8, 7+ 2*8
-           db  4+ 3*8, 5+ 3*8, 4+ 4*8, 5+ 4*8
-           db  6+ 3*8, 7+ 3*8, 6+ 4*8, 7+ 4*8
-           db  4+ 6*8, 5+ 6*8, 4+ 7*8, 5+ 7*8
-           db  6+ 6*8, 7+ 6*8, 6+ 7*8, 7+ 7*8
-           db  4+ 8*8, 5+ 8*8, 4+ 9*8, 5+ 9*8
-           db  6+ 8*8, 7+ 8*8, 6+ 9*8, 7+ 9*8
-           db  4+11*8, 5+11*8, 4+12*8, 5+12*8
-           db  6+11*8, 7+11*8, 6+12*8, 7+12*8
-           db  4+13*8, 5+13*8, 4+14*8, 5+14*8
-           db  6+13*8, 7+13*8, 6+14*8, 7+14*8
-%ifdef PIC
-%define npicregs 1
-%define scan8 picregq
-%else
-%define npicregs 0
-%define scan8 scan8_mem
-%endif
-
-cextern pw_32
-cextern pw_1
-
-SECTION .text
-
-; %1=uint8_t *dst, %2=int16_t *block, %3=int stride
-%macro IDCT4_ADD 3
-    ; Load dct coeffs
-    movq         m0, [%2]
-    movq         m1, [%2+8]
-    movq         m2, [%2+16]
-    movq         m3, [%2+24]
-
-    IDCT4_1D      w, 0, 1, 2, 3, 4, 5
-    mova         m6, [pw_32]
-    TRANSPOSE4x4W 0, 1, 2, 3, 4
-    paddw        m0, m6
-    IDCT4_1D      w, 0, 1, 2, 3, 4, 5
-    pxor         m7, m7
-    movq    [%2+ 0], m7
-    movq    [%2+ 8], m7
-    movq    [%2+16], m7
-    movq    [%2+24], m7
-
-    STORE_DIFFx2 m0, m1, m4, m5, m7, 6, %1, %3
-    lea          %1, [%1+%3*2]
-    STORE_DIFFx2 m2, m3, m4, m5, m7, 6, %1, %3
-%endmacro
-
-INIT_MMX mmx
-; ff_h264_idct_add_8_mmx(uint8_t *dst, int16_t *block, int stride)
-cglobal h264_idct_add_8, 3, 3, 0
-    IDCT4_ADD    r0, r1, r2
-    RET
-
-%macro IDCT8_1D 2
-    mova         m0, m1
-    psraw        m1, 1
-    mova         m4, m5
-    psraw        m4, 1
-    paddw        m4, m5
-    paddw        m1, m0
-    paddw        m4, m7
-    paddw        m1, m5
-    psubw        m4, m0
-    paddw        m1, m3
-
-    psubw        m0, m3
-    psubw        m5, m3
-    psraw        m3, 1
-    paddw        m0, m7
-    psubw        m5, m7
-    psraw        m7, 1
-    psubw        m0, m3
-    psubw        m5, m7
-
-    mova         m7, m1
-    psraw        m1, 2
-    mova         m3, m4
-    psraw        m3, 2
-    paddw        m3, m0
-    psraw        m0, 2
-    paddw        m1, m5
-    psraw        m5, 2
-    psubw        m0, m4
-    psubw        m7, m5
-
-    mova         m5, m6
-    psraw        m6, 1
-    mova         m4, m2
-    psraw        m4, 1
-    paddw        m6, m2
-    psubw        m4, m5
-
-    mova         m2, %1
-    mova         m5, %2
-    SUMSUB_BA    w, 5, 2
-    SUMSUB_BA    w, 6, 5
-    SUMSUB_BA    w, 4, 2
-    SUMSUB_BA    w, 7, 6
-    SUMSUB_BA    w, 0, 4
-    SUMSUB_BA    w, 3, 2
-    SUMSUB_BA    w, 1, 5
-    SWAP         7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567
-%endmacro
-
-%macro IDCT8_1D_FULL 1
-    mova         m7, [%1+112]
-    mova         m6, [%1+ 96]
-    mova         m5, [%1+ 80]
-    mova         m3, [%1+ 48]
-    mova         m2, [%1+ 32]
-    mova         m1, [%1+ 16]
-    IDCT8_1D   [%1], [%1+ 64]
-%endmacro
-
-; %1=int16_t *block, %2=int16_t *dstblock
-%macro IDCT8_ADD_MMX_START 2
-    IDCT8_1D_FULL %1
-    mova       [%1], m7
-    TRANSPOSE4x4W 0, 1, 2, 3, 7
-    mova         m7, [%1]
-    mova    [%2   ], m0
-    mova    [%2+16], m1
-    mova    [%2+32], m2
-    mova    [%2+48], m3
-    TRANSPOSE4x4W 4, 5, 6, 7, 3
-    mova    [%2+ 8], m4
-    mova    [%2+24], m5
-    mova    [%2+40], m6
-    mova    [%2+56], m7
-%endmacro
-
-; %1=uint8_t *dst, %2=int16_t *block, %3=int stride
-%macro IDCT8_ADD_MMX_END 3-4
-    IDCT8_1D_FULL %2
-    mova    [%2   ], m5
-    mova    [%2+16], m6
-    mova    [%2+32], m7
-
-    pxor         m7, m7
-%if %0 == 4
-    movq   [%4+  0], m7
-    movq   [%4+  8], m7
-    movq   [%4+ 16], m7
-    movq   [%4+ 24], m7
-    movq   [%4+ 32], m7
-    movq   [%4+ 40], m7
-    movq   [%4+ 48], m7
-    movq   [%4+ 56], m7
-    movq   [%4+ 64], m7
-    movq   [%4+ 72], m7
-    movq   [%4+ 80], m7
-    movq   [%4+ 88], m7
-    movq   [%4+ 96], m7
-    movq   [%4+104], m7
-    movq   [%4+112], m7
-    movq   [%4+120], m7
-%endif
-    STORE_DIFFx2 m0, m1, m5, m6, m7, 6, %1, %3
-    lea          %1, [%1+%3*2]
-    STORE_DIFFx2 m2, m3, m5, m6, m7, 6, %1, %3
-    mova         m0, [%2   ]
-    mova         m1, [%2+16]
-    mova         m2, [%2+32]
-    lea          %1, [%1+%3*2]
-    STORE_DIFFx2 m4, m0, m5, m6, m7, 6, %1, %3
-    lea          %1, [%1+%3*2]
-    STORE_DIFFx2 m1, m2, m5, m6, m7, 6, %1, %3
-%endmacro
-
-INIT_MMX mmx
-; ff_h264_idct8_add_8_mmx(uint8_t *dst, int16_t *block, int stride)
-cglobal h264_idct8_add_8, 3, 4, 0
-    %assign pad 128+4-(stack_offset&7)
-    SUB         rsp, pad
-
-    add   word [r1], 32
-    IDCT8_ADD_MMX_START r1  , rsp
-    IDCT8_ADD_MMX_START r1+8, rsp+64
-    lea          r3, [r0+4]
-    IDCT8_ADD_MMX_END   r0  , rsp,   r2, r1
-    IDCT8_ADD_MMX_END   r3  , rsp+8, r2
-
-    ADD         rsp, pad
-    RET
-
-; %1=uint8_t *dst, %2=int16_t *block, %3=int stride
-%macro IDCT8_ADD_SSE 4
-    IDCT8_1D_FULL %2
-%if ARCH_X86_64
-    TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8
-%else
-    TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, [%2], [%2+16]
-%endif
-    paddw        m0, [pw_32]
-
-%if ARCH_X86_64 == 0
-    mova    [%2   ], m0
-    mova    [%2+16], m4
-    IDCT8_1D   [%2], [%2+ 16]
-    mova    [%2   ], m6
-    mova    [%2+16], m7
-%else
-    SWAP          0, 8
-    SWAP          4, 9
-    IDCT8_1D     m8, m9
-    SWAP          6, 8
-    SWAP          7, 9
-%endif
-
-    pxor         m7, m7
-    lea          %4, [%3*3]
-    STORE_DIFF   m0, m6, m7, [%1     ]
-    STORE_DIFF   m1, m6, m7, [%1+%3  ]
-    STORE_DIFF   m2, m6, m7, [%1+%3*2]
-    STORE_DIFF   m3, m6, m7, [%1+%4  ]
-%if ARCH_X86_64 == 0
-    mova         m0, [%2   ]
-    mova         m1, [%2+16]
-%else
-    SWAP          0, 8
-    SWAP          1, 9
-%endif
-    mova   [%2+  0], m7
-    mova   [%2+ 16], m7
-    mova   [%2+ 32], m7
-    mova   [%2+ 48], m7
-    mova   [%2+ 64], m7
-    mova   [%2+ 80], m7
-    mova   [%2+ 96], m7
-    mova   [%2+112], m7
-    lea          %1, [%1+%3*4]
-    STORE_DIFF   m4, m6, m7, [%1     ]
-    STORE_DIFF   m5, m6, m7, [%1+%3  ]
-    STORE_DIFF   m0, m6, m7, [%1+%3*2]
-    STORE_DIFF   m1, m6, m7, [%1+%4  ]
-%endmacro
-
-INIT_XMM sse2
-; ff_h264_idct8_add_8_sse2(uint8_t *dst, int16_t *block, int stride)
-cglobal h264_idct8_add_8, 3, 4, 10
-    IDCT8_ADD_SSE r0, r1, r2, r3
-    RET
-
-%macro DC_ADD_MMXEXT_INIT 2
-    add          %1, 32
-    sar          %1, 6
-    movd         m0, %1d
-    lea          %1, [%2*3]
-    pshufw       m0, m0, 0
-    pxor         m1, m1
-    psubw        m1, m0
-    packuswb     m0, m0
-    packuswb     m1, m1
-%endmacro
-
-%macro DC_ADD_MMXEXT_OP 4
-    %1           m2, [%2     ]
-    %1           m3, [%2+%3  ]
-    %1           m4, [%2+%3*2]
-    %1           m5, [%2+%4  ]
-    paddusb      m2, m0
-    paddusb      m3, m0
-    paddusb      m4, m0
-    paddusb      m5, m0
-    psubusb      m2, m1
-    psubusb      m3, m1
-    psubusb      m4, m1
-    psubusb      m5, m1
-    %1    [%2     ], m2
-    %1    [%2+%3  ], m3
-    %1    [%2+%3*2], m4
-    %1    [%2+%4  ], m5
-%endmacro
-
-INIT_MMX mmxext
-; ff_h264_idct_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
-%if ARCH_X86_64
-cglobal h264_idct_dc_add_8, 3, 4, 0
-    movsx        r3, word [r1]
-    mov  dword [r1], 0
-    DC_ADD_MMXEXT_INIT r3, r2
-    DC_ADD_MMXEXT_OP movh, r0, r2, r3
-    RET
-
-; ff_h264_idct8_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
-cglobal h264_idct8_dc_add_8, 3, 4, 0
-    movsx        r3, word [r1]
-    mov  dword [r1], 0
-    DC_ADD_MMXEXT_INIT r3, r2
-    DC_ADD_MMXEXT_OP mova, r0, r2, r3
-    lea          r0, [r0+r2*4]
-    DC_ADD_MMXEXT_OP mova, r0, r2, r3
-    RET
-%else
-; ff_h264_idct_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
-cglobal h264_idct_dc_add_8, 2, 3, 0
-    movsx        r2, word [r1]
-    mov  dword [r1], 0
-    mov          r1, r2m
-    DC_ADD_MMXEXT_INIT r2, r1
-    DC_ADD_MMXEXT_OP movh, r0, r1, r2
-    RET
-
-; ff_h264_idct8_dc_add_8_mmxext(uint8_t *dst, int16_t *block, int stride)
-cglobal h264_idct8_dc_add_8, 2, 3, 0
-    movsx        r2, word [r1]
-    mov  dword [r1], 0
-    mov          r1, r2m
-    DC_ADD_MMXEXT_INIT r2, r1
-    DC_ADD_MMXEXT_OP mova, r0, r1, r2
-    lea          r0, [r0+r1*4]
-    DC_ADD_MMXEXT_OP mova, r0, r1, r2
-    RET
-%endif
-
-INIT_MMX mmx
-; ff_h264_idct_add16_8_mmx(uint8_t *dst, const int *block_offset,
-;                          int16_t *block, int stride,
-;                          const uint8_t nnzc[6 * 8])
-cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg
-    xor          r5, r5
-%ifdef PIC
-    lea     picregq, [scan8_mem]
-%endif
-.nextblock:
-    movzx        r6, byte [scan8+r5]
-    movzx        r6, byte [r4+r6]
-    test         r6, r6
-    jz .skipblock
-    mov         r6d, dword [r1+r5*4]
-    lea          r6, [r0+r6]
-    IDCT4_ADD    r6, r2, r3
-.skipblock:
-    inc          r5
-    add          r2, 32
-    cmp          r5, 16
-    jl .nextblock
-    REP_RET
-
-; ff_h264_idct8_add4_8_mmx(uint8_t *dst, const int *block_offset,
-;                          int16_t *block, int stride,
-;                          const uint8_t nnzc[6 * 8])
-cglobal h264_idct8_add4_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg
-    %assign pad 128+4-(stack_offset&7)
-    SUB         rsp, pad
-
-    xor          r5, r5
-%ifdef PIC
-    lea     picregq, [scan8_mem]
-%endif
-.nextblock:
-    movzx        r6, byte [scan8+r5]
-    movzx        r6, byte [r4+r6]
-    test         r6, r6
-    jz .skipblock
-    mov         r6d, dword [r1+r5*4]
-    add          r6, r0
-    add   word [r2], 32
-    IDCT8_ADD_MMX_START r2  , rsp
-    IDCT8_ADD_MMX_START r2+8, rsp+64
-    IDCT8_ADD_MMX_END   r6  , rsp,   r3, r2
-    mov         r6d, dword [r1+r5*4]
-    lea          r6, [r0+r6+4]
-    IDCT8_ADD_MMX_END   r6  , rsp+8, r3
-.skipblock:
-    add          r5, 4
-    add          r2, 128
-    cmp          r5, 16
-    jl .nextblock
-    ADD         rsp, pad
-    RET
-
-INIT_MMX mmxext
-; ff_h264_idct_add16_8_mmxext(uint8_t *dst, const int *block_offset,
-;                             int16_t *block, int stride,
-;                             const uint8_t nnzc[6 * 8])
-cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
-    xor          r5, r5
-%ifdef PIC
-    lea     picregq, [scan8_mem]
-%endif
-.nextblock:
-    movzx        r6, byte [scan8+r5]
-    movzx        r6, byte [r4+r6]
-    test         r6, r6
-    jz .skipblock
-    cmp          r6, 1
-    jnz .no_dc
-    movsx        r6, word [r2]
-    test         r6, r6
-    jz .no_dc
-    mov   word [r2], 0
-    DC_ADD_MMXEXT_INIT r6, r3
-%if ARCH_X86_64 == 0
-%define dst2q r1
-%define dst2d r1d
-%endif
-    mov       dst2d, dword [r1+r5*4]
-    lea       dst2q, [r0+dst2q]
-    DC_ADD_MMXEXT_OP movh, dst2q, r3, r6
-%if ARCH_X86_64 == 0
-    mov          r1, r1m
-%endif
-    inc          r5
-    add          r2, 32
-    cmp          r5, 16
-    jl .nextblock
-    REP_RET
-.no_dc:
-    mov         r6d, dword [r1+r5*4]
-    add          r6, r0
-    IDCT4_ADD    r6, r2, r3
-.skipblock:
-    inc          r5
-    add          r2, 32
-    cmp          r5, 16
-    jl .nextblock
-    REP_RET
-
-INIT_MMX mmx
-; ff_h264_idct_add16intra_8_mmx(uint8_t *dst, const int *block_offset,
-;                               int16_t *block, int stride,
-;                               const uint8_t nnzc[6 * 8])
-cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg
-    xor          r5, r5
-%ifdef PIC
-    lea     picregq, [scan8_mem]
-%endif
-.nextblock:
-    movzx        r6, byte [scan8+r5]
-    movzx        r6, byte [r4+r6]
-    or          r6w, word [r2]
-    test         r6, r6
-    jz .skipblock
-    mov         r6d, dword [r1+r5*4]
-    add          r6, r0
-    IDCT4_ADD    r6, r2, r3
-.skipblock:
-    inc          r5
-    add          r2, 32
-    cmp          r5, 16
-    jl .nextblock
-    REP_RET
-
-INIT_MMX mmxext
-; ff_h264_idct_add16intra_8_mmxext(uint8_t *dst, const int *block_offset,
-;                                  int16_t *block, int stride,
-;                                  const uint8_t nnzc[6 * 8])
-cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
-    xor          r5, r5
-%ifdef PIC
-    lea     picregq, [scan8_mem]
-%endif
-.nextblock:
-    movzx        r6, byte [scan8+r5]
-    movzx        r6, byte [r4+r6]
-    test         r6, r6
-    jz .try_dc
-    mov         r6d, dword [r1+r5*4]
-    lea          r6, [r0+r6]
-    IDCT4_ADD    r6, r2, r3
-    inc          r5
-    add          r2, 32
-    cmp          r5, 16
-    jl .nextblock
-    REP_RET
-.try_dc:
-    movsx        r6, word [r2]
-    test         r6, r6
-    jz .skipblock
-    mov   word [r2], 0
-    DC_ADD_MMXEXT_INIT r6, r3
-%if ARCH_X86_64 == 0
-%define dst2q r1
-%define dst2d r1d
-%endif
-    mov       dst2d, dword [r1+r5*4]
-    add       dst2q, r0
-    DC_ADD_MMXEXT_OP movh, dst2q, r3, r6
-%if ARCH_X86_64 == 0
-    mov          r1, r1m
-%endif
-.skipblock:
-    inc          r5
-    add          r2, 32
-    cmp          r5, 16
-    jl .nextblock
-    REP_RET
-
-; ff_h264_idct8_add4_8_mmxext(uint8_t *dst, const int *block_offset,
-;                             int16_t *block, int stride,
-;                             const uint8_t nnzc[6 * 8])
-cglobal h264_idct8_add4_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
-    %assign pad 128+4-(stack_offset&7)
-    SUB         rsp, pad
-
-    xor          r5, r5
-%ifdef PIC
-    lea     picregq, [scan8_mem]
-%endif
-.nextblock:
-    movzx        r6, byte [scan8+r5]
-    movzx        r6, byte [r4+r6]
-    test         r6, r6
-    jz .skipblock
-    cmp          r6, 1
-    jnz .no_dc
-    movsx        r6, word [r2]
-    test         r6, r6
-    jz .no_dc
-    mov   word [r2], 0
-    DC_ADD_MMXEXT_INIT r6, r3
-%if ARCH_X86_64 == 0
-%define dst2q r1
-%define dst2d r1d
-%endif
-    mov       dst2d, dword [r1+r5*4]
-    lea       dst2q, [r0+dst2q]
-    DC_ADD_MMXEXT_OP mova, dst2q, r3, r6
-    lea       dst2q, [dst2q+r3*4]
-    DC_ADD_MMXEXT_OP mova, dst2q, r3, r6
-%if ARCH_X86_64 == 0
-    mov          r1, r1m
-%endif
-    add          r5, 4
-    add          r2, 128
-    cmp          r5, 16
-    jl .nextblock
-
-    ADD         rsp, pad
-    RET
-.no_dc:
-    mov         r6d, dword [r1+r5*4]
-    add          r6, r0
-    add   word [r2], 32
-    IDCT8_ADD_MMX_START r2  , rsp
-    IDCT8_ADD_MMX_START r2+8, rsp+64
-    IDCT8_ADD_MMX_END   r6  , rsp,   r3, r2
-    mov         r6d, dword [r1+r5*4]
-    lea          r6, [r0+r6+4]
-    IDCT8_ADD_MMX_END   r6  , rsp+8, r3
-.skipblock:
-    add          r5, 4
-    add          r2, 128
-    cmp          r5, 16
-    jl .nextblock
-
-    ADD         rsp, pad
-    RET
-
-INIT_XMM sse2
-; ff_h264_idct8_add4_8_sse2(uint8_t *dst, const int *block_offset,
-;                           int16_t *block, int stride,
-;                           const uint8_t nnzc[6 * 8])
-cglobal h264_idct8_add4_8, 5, 8 + npicregs, 10, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
-    xor          r5, r5
-%ifdef PIC
-    lea     picregq, [scan8_mem]
-%endif
-.nextblock:
-    movzx        r6, byte [scan8+r5]
-    movzx        r6, byte [r4+r6]
-    test         r6, r6
-    jz .skipblock
-    cmp          r6, 1
-    jnz .no_dc
-    movsx        r6, word [r2]
-    test         r6, r6
-    jz .no_dc
-INIT_MMX cpuname
-    mov   word [r2], 0
-    DC_ADD_MMXEXT_INIT r6, r3
-%if ARCH_X86_64 == 0
-%define dst2q r1
-%define dst2d r1d
-%endif
-    mov       dst2d, dword [r1+r5*4]
-    add       dst2q, r0
-    DC_ADD_MMXEXT_OP mova, dst2q, r3, r6
-    lea       dst2q, [dst2q+r3*4]
-    DC_ADD_MMXEXT_OP mova, dst2q, r3, r6
-%if ARCH_X86_64 == 0
-    mov          r1, r1m
-%endif
-    add          r5, 4
-    add          r2, 128
-    cmp          r5, 16
-    jl .nextblock
-    REP_RET
-.no_dc:
-INIT_XMM cpuname
-    mov       dst2d, dword [r1+r5*4]
-    add       dst2q, r0
-    IDCT8_ADD_SSE dst2q, r2, r3, r6
-%if ARCH_X86_64 == 0
-    mov          r1, r1m
-%endif
-.skipblock:
-    add          r5, 4
-    add          r2, 128
-    cmp          r5, 16
-    jl .nextblock
-    REP_RET
-
-INIT_MMX mmx
-h264_idct_add8_mmx_plane:
-.nextblock:
-    movzx        r6, byte [scan8+r5]
-    movzx        r6, byte [r4+r6]
-    or          r6w, word [r2]
-    test         r6, r6
-    jz .skipblock
-%if ARCH_X86_64
-    mov         r0d, dword [r1+r5*4]
-    add          r0, [dst2q]
-%else
-    mov          r0, r1m ; XXX r1m here is actually r0m of the calling func
-    mov          r0, [r0]
-    add          r0, dword [r1+r5*4]
-%endif
-    IDCT4_ADD    r0, r2, r3
-.skipblock:
-    inc          r5
-    add          r2, 32
-    test         r5, 3
-    jnz .nextblock
-    rep ret
-
-; ff_h264_idct_add8_8_mmx(uint8_t **dest, const int *block_offset,
-;                         int16_t *block, int stride, const uint8_t nnzc[6 * 8])
-cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
-    mov          r5, 16
-    add          r2, 512
-%ifdef PIC
-    lea     picregq, [scan8_mem]
-%endif
-%if ARCH_X86_64
-    mov       dst2q, r0
-%endif
-    call         h264_idct_add8_mmx_plane
-    mov          r5, 32
-    add          r2, 384
-%if ARCH_X86_64
-    add       dst2q, gprsize
-%else
-    add        r0mp, gprsize
-%endif
-    call         h264_idct_add8_mmx_plane
-    RET
-
-h264_idct_add8_mmxext_plane:
-.nextblock:
-    movzx        r6, byte [scan8+r5]
-    movzx        r6, byte [r4+r6]
-    test         r6, r6
-    jz .try_dc
-%if ARCH_X86_64
-    mov         r0d, dword [r1+r5*4]
-    add          r0, [dst2q]
-%else
-    mov          r0, r1m ; XXX r1m here is actually r0m of the calling func
-    mov          r0, [r0]
-    add          r0, dword [r1+r5*4]
-%endif
-    IDCT4_ADD    r0, r2, r3
-    inc          r5
-    add          r2, 32
-    test         r5, 3
-    jnz .nextblock
-    rep ret
-.try_dc:
-    movsx        r6, word [r2]
-    test         r6, r6
-    jz .skipblock
-    mov   word [r2], 0
-    DC_ADD_MMXEXT_INIT r6, r3
-%if ARCH_X86_64
-    mov         r0d, dword [r1+r5*4]
-    add          r0, [dst2q]
-%else
-    mov          r0, r1m ; XXX r1m here is actually r0m of the calling func
-    mov          r0, [r0]
-    add          r0, dword [r1+r5*4]
-%endif
-    DC_ADD_MMXEXT_OP movh, r0, r3, r6
-.skipblock:
-    inc          r5
-    add          r2, 32
-    test         r5, 3
-    jnz .nextblock
-    rep ret
-
-INIT_MMX mmxext
-; ff_h264_idct_add8_8_mmxext(uint8_t **dest, const int *block_offset,
-;                            int16_t *block, int stride,
-;                            const uint8_t nnzc[6 * 8])
-cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
-    mov          r5, 16
-    add          r2, 512
-%if ARCH_X86_64
-    mov       dst2q, r0
-%endif
-%ifdef PIC
-    lea     picregq, [scan8_mem]
-%endif
-    call h264_idct_add8_mmxext_plane
-    mov          r5, 32
-    add          r2, 384
-%if ARCH_X86_64
-    add       dst2q, gprsize
-%else
-    add        r0mp, gprsize
-%endif
-    call h264_idct_add8_mmxext_plane
-    RET
-
-; r0 = uint8_t *dst, r2 = int16_t *block, r3 = int stride, r6=clobbered
-h264_idct_dc_add8_mmxext:
-    movd         m0, [r2   ]          ;  0 0 X D
-    mov word [r2+ 0], 0
-    punpcklwd    m0, [r2+32]          ;  x X d D
-    mov word [r2+32], 0
-    paddsw       m0, [pw_32]
-    psraw        m0, 6
-    punpcklwd    m0, m0               ;  d d D D
-    pxor         m1, m1               ;  0 0 0 0
-    psubw        m1, m0               ; -d-d-D-D
-    packuswb     m0, m1               ; -d-d-D-D d d D D
-    pshufw       m1, m0, 0xFA         ; -d-d-d-d-D-D-D-D
-    punpcklwd    m0, m0               ;  d d d d D D D D
-    lea          r6, [r3*3]
-    DC_ADD_MMXEXT_OP movq, r0, r3, r6
-    ret
-
-ALIGN 16
-INIT_XMM sse2
-; r0 = uint8_t *dst (clobbered), r2 = int16_t *block, r3 = int stride
-h264_add8x4_idct_sse2:
-    movq   m0, [r2+ 0]
-    movq   m1, [r2+ 8]
-    movq   m2, [r2+16]
-    movq   m3, [r2+24]
-    movhps m0, [r2+32]
-    movhps m1, [r2+40]
-    movhps m2, [r2+48]
-    movhps m3, [r2+56]
-    IDCT4_1D w,0,1,2,3,4,5
-    TRANSPOSE2x4x4W 0,1,2,3,4
-    paddw m0, [pw_32]
-    IDCT4_1D w,0,1,2,3,4,5
-    pxor  m7, m7
-    mova [r2+ 0], m7
-    mova [r2+16], m7
-    mova [r2+32], m7
-    mova [r2+48], m7
-    STORE_DIFFx2 m0, m1, m4, m5, m7, 6, r0, r3
-    lea   r0, [r0+r3*2]
-    STORE_DIFFx2 m2, m3, m4, m5, m7, 6, r0, r3
-    ret
-
-%macro add16_sse2_cycle 2
-    movzx       r0, word [r4+%2]
-    test        r0, r0
-    jz .cycle%1end
-    mov        r0d, dword [r1+%1*8]
-%if ARCH_X86_64
-    add         r0, r5
-%else
-    add         r0, r0m
-%endif
-    call        h264_add8x4_idct_sse2
-.cycle%1end:
-%if %1 < 7
-    add         r2, 64
-%endif
-%endmacro
-
-; ff_h264_idct_add16_8_sse2(uint8_t *dst, const int *block_offset,
-;                           int16_t *block, int stride,
-;                           const uint8_t nnzc[6 * 8])
-cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8
-%if ARCH_X86_64
-    mov         r5, r0
-%endif
-    ; unrolling of the loop leads to an average performance gain of
-    ; 20-25%
-    add16_sse2_cycle 0, 0xc
-    add16_sse2_cycle 1, 0x14
-    add16_sse2_cycle 2, 0xe
-    add16_sse2_cycle 3, 0x16
-    add16_sse2_cycle 4, 0x1c
-    add16_sse2_cycle 5, 0x24
-    add16_sse2_cycle 6, 0x1e
-    add16_sse2_cycle 7, 0x26
-    RET
-
-%macro add16intra_sse2_cycle 2
-    movzx       r0, word [r4+%2]
-    test        r0, r0
-    jz .try%1dc
-    mov        r0d, dword [r1+%1*8]
-%if ARCH_X86_64
-    add         r0, r7
-%else
-    add         r0, r0m
-%endif
-    call        h264_add8x4_idct_sse2
-    jmp .cycle%1end
-.try%1dc:
-    movsx       r0, word [r2   ]
-    or         r0w, word [r2+32]
-    jz .cycle%1end
-    mov        r0d, dword [r1+%1*8]
-%if ARCH_X86_64
-    add         r0, r7
-%else
-    add         r0, r0m
-%endif
-    call        h264_idct_dc_add8_mmxext
-.cycle%1end:
-%if %1 < 7
-    add         r2, 64
-%endif
-%endmacro
-
-; ff_h264_idct_add16intra_8_sse2(uint8_t *dst, const int *block_offset,
-;                                int16_t *block, int stride,
-;                                const uint8_t nnzc[6 * 8])
-cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8
-%if ARCH_X86_64
-    mov         r7, r0
-%endif
-    add16intra_sse2_cycle 0, 0xc
-    add16intra_sse2_cycle 1, 0x14
-    add16intra_sse2_cycle 2, 0xe
-    add16intra_sse2_cycle 3, 0x16
-    add16intra_sse2_cycle 4, 0x1c
-    add16intra_sse2_cycle 5, 0x24
-    add16intra_sse2_cycle 6, 0x1e
-    add16intra_sse2_cycle 7, 0x26
-    RET
-
-%macro add8_sse2_cycle 2
-    movzx       r0, word [r4+%2]
-    test        r0, r0
-    jz .try%1dc
-%if ARCH_X86_64
-    mov        r0d, dword [r1+(%1&1)*8+64*(1+(%1>>1))]
-    add         r0, [r7]
-%else
-    mov         r0, r0m
-    mov         r0, [r0]
-    add         r0, dword [r1+(%1&1)*8+64*(1+(%1>>1))]
-%endif
-    call        h264_add8x4_idct_sse2
-    jmp .cycle%1end
-.try%1dc:
-    movsx       r0, word [r2   ]
-    or         r0w, word [r2+32]
-    jz .cycle%1end
-%if ARCH_X86_64
-    mov        r0d, dword [r1+(%1&1)*8+64*(1+(%1>>1))]
-    add         r0, [r7]
-%else
-    mov         r0, r0m
-    mov         r0, [r0]
-    add         r0, dword [r1+(%1&1)*8+64*(1+(%1>>1))]
-%endif
-    call        h264_idct_dc_add8_mmxext
-.cycle%1end:
-%if %1 == 1
-    add         r2, 384+64
-%elif %1 < 3
-    add         r2, 64
-%endif
-%endmacro
-
-; ff_h264_idct_add8_8_sse2(uint8_t **dest, const int *block_offset,
-;                          int16_t *block, int stride,
-;                          const uint8_t nnzc[6 * 8])
-cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8
-    add          r2, 512
-%if ARCH_X86_64
-    mov          r7, r0
-%endif
-    add8_sse2_cycle 0, 0x34
-    add8_sse2_cycle 1, 0x3c
-%if ARCH_X86_64
-    add          r7, gprsize
-%else
-    add        r0mp, gprsize
-%endif
-    add8_sse2_cycle 2, 0x5c
-    add8_sse2_cycle 3, 0x64
-    RET
-
-;void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul)
-
-%macro WALSH4_1D 5
-    SUMSUB_BADC w, %4, %3, %2, %1, %5
-    SUMSUB_BADC w, %4, %2, %3, %1, %5
-    SWAP %1, %4, %3
-%endmacro
-
-%macro DEQUANT_MMX 3
-    mova        m7, [pw_1]
-    mova        m4, %1
-    punpcklwd   %1, m7
-    punpckhwd   m4, m7
-    mova        m5, %2
-    punpcklwd   %2, m7
-    punpckhwd   m5, m7
-    movd        m7, t3d
-    punpckldq   m7, m7
-    pmaddwd     %1, m7
-    pmaddwd     %2, m7
-    pmaddwd     m4, m7
-    pmaddwd     m5, m7
-    psrad       %1, %3
-    psrad       %2, %3
-    psrad       m4, %3
-    psrad       m5, %3
-    packssdw    %1, m4
-    packssdw    %2, m5
-%endmacro
-
-%macro STORE_WORDS 5-9
-%if cpuflag(sse)
-    movd  t0d, %1
-    psrldq  %1, 4
-    movd  t1d, %1
-    psrldq  %1, 4
-    mov [t2+%2*32], t0w
-    mov [t2+%4*32], t1w
-    shr   t0d, 16
-    shr   t1d, 16
-    mov [t2+%3*32], t0w
-    mov [t2+%5*32], t1w
-    movd  t0d, %1
-    psrldq  %1, 4
-    movd  t1d, %1
-    mov [t2+%6*32], t0w
-    mov [t2+%8*32], t1w
-    shr   t0d, 16
-    shr   t1d, 16
-    mov [t2+%7*32], t0w
-    mov [t2+%9*32], t1w
-%else
-    movd  t0d, %1
-    psrlq  %1, 32
-    movd  t1d, %1
-    mov [t2+%2*32], t0w
-    mov [t2+%4*32], t1w
-    shr   t0d, 16
-    shr   t1d, 16
-    mov [t2+%3*32], t0w
-    mov [t2+%5*32], t1w
-%endif
-%endmacro
-
-%macro DEQUANT_STORE 1
-%if cpuflag(sse2)
-    movd      xmm4, t3d
-    movq      xmm5, [pw_1]
-    pshufd    xmm4, xmm4, 0
-    movq2dq   xmm0, m0
-    movq2dq   xmm1, m1
-    movq2dq   xmm2, m2
-    movq2dq   xmm3, m3
-    punpcklwd xmm0, xmm5
-    punpcklwd xmm1, xmm5
-    punpcklwd xmm2, xmm5
-    punpcklwd xmm3, xmm5
-    pmaddwd   xmm0, xmm4
-    pmaddwd   xmm1, xmm4
-    pmaddwd   xmm2, xmm4
-    pmaddwd   xmm3, xmm4
-    psrad     xmm0, %1
-    psrad     xmm1, %1
-    psrad     xmm2, %1
-    psrad     xmm3, %1
-    packssdw  xmm0, xmm1
-    packssdw  xmm2, xmm3
-    STORE_WORDS xmm0,  0,  1,  4,  5,  2,  3,  6,  7
-    STORE_WORDS xmm2,  8,  9, 12, 13, 10, 11, 14, 15
-%else
-    DEQUANT_MMX m0, m1, %1
-    STORE_WORDS m0,  0,  1,  4,  5
-    STORE_WORDS m1,  2,  3,  6,  7
-
-    DEQUANT_MMX m2, m3, %1
-    STORE_WORDS m2,  8,  9, 12, 13
-    STORE_WORDS m3, 10, 11, 14, 15
-%endif
-%endmacro
-
-%macro IDCT_DC_DEQUANT 1
-cglobal h264_luma_dc_dequant_idct, 3, 4, %1
-    ; manually spill XMM registers for Win64 because
-    ; the code here is initialized with INIT_MMX
-    WIN64_SPILL_XMM %1
-    movq        m3, [r1+24]
-    movq        m2, [r1+16]
-    movq        m1, [r1+ 8]
-    movq        m0, [r1+ 0]
-    WALSH4_1D    0,1,2,3,4
-    TRANSPOSE4x4W 0,1,2,3,4
-    WALSH4_1D    0,1,2,3,4
-
-; shift, tmp, output, qmul
-%if WIN64
-    DECLARE_REG_TMP 0,3,1,2
-    ; we can't avoid this, because r0 is the shift register (ecx) on win64
-    xchg        r0, t2
-%elif ARCH_X86_64
-    DECLARE_REG_TMP 3,1,0,2
-%else
-    DECLARE_REG_TMP 1,3,0,2
-%endif
-
-    cmp        t3d, 32767
-    jg .big_qmul
-    add        t3d, 128 << 16
-    DEQUANT_STORE 8
-    RET
-.big_qmul:
-    bsr        t0d, t3d
-    add        t3d, 128 << 16
-    mov        t1d, 7
-    cmp        t0d, t1d
-    cmovg      t0d, t1d
-    inc        t1d
-    shr        t3d, t0b
-    sub        t1d, t0d
-%if cpuflag(sse2)
-    movd      xmm6, t1d
-    DEQUANT_STORE xmm6
-%else
-    movd        m6, t1d
-    DEQUANT_STORE m6
-%endif
-    RET
-%endmacro
-
-INIT_MMX mmx
-IDCT_DC_DEQUANT 0
-INIT_MMX sse2
-IDCT_DC_DEQUANT 7
diff --git a/deps/libav/libavcodec/x86/h264_idct_10bit.asm b/deps/libav/libavcodec/x86/h264_idct_10bit.asm
deleted file mode 100644
index 4e51d2b..0000000
--- a/deps/libav/libavcodec/x86/h264_idct_10bit.asm
+++ /dev/null
@@ -1,573 +0,0 @@
-;*****************************************************************************
-;* MMX/SSE2/AVX-optimized 10-bit H.264 iDCT code
-;*****************************************************************************
-;* Copyright (C) 2005-2011 x264 project
-;*
-;* Authors: Daniel Kang <daniel.d.kang at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-pw_pixel_max: times 8 dw ((1 << 10)-1)
-pd_32:        times 4 dd 32
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; void h264_idct_add(pixel *dst, dctcoef *block, int stride)
-;-----------------------------------------------------------------------------
-%macro STORE_DIFFx2 6
-    psrad       %1, 6
-    psrad       %2, 6
-    packssdw    %1, %2
-    movq        %3, [%5]
-    movhps      %3, [%5+%6]
-    paddsw      %1, %3
-    CLIPW       %1, %4, [pw_pixel_max]
-    movq      [%5], %1
-    movhps [%5+%6], %1
-%endmacro
-
-%macro STORE_DIFF16 5
-    psrad       %1, 6
-    psrad       %2, 6
-    packssdw    %1, %2
-    paddsw      %1, [%5]
-    CLIPW       %1, %3, %4
-    mova      [%5], %1
-%endmacro
-
-;dst, in, stride
-%macro IDCT4_ADD_10 3
-    mova  m0, [%2+ 0]
-    mova  m1, [%2+16]
-    mova  m2, [%2+32]
-    mova  m3, [%2+48]
-    IDCT4_1D d,0,1,2,3,4,5
-    TRANSPOSE4x4D 0,1,2,3,4
-    paddd m0, [pd_32]
-    IDCT4_1D d,0,1,2,3,4,5
-    pxor  m5, m5
-    mova [%2+ 0], m5
-    mova [%2+16], m5
-    mova [%2+32], m5
-    mova [%2+48], m5
-    STORE_DIFFx2 m0, m1, m4, m5, %1, %3
-    lea   %1, [%1+%3*2]
-    STORE_DIFFx2 m2, m3, m4, m5, %1, %3
-%endmacro
-
-%macro IDCT_ADD_10 0
-cglobal h264_idct_add_10, 3,3
-    IDCT4_ADD_10 r0, r1, r2
-    RET
-%endmacro
-
-INIT_XMM sse2
-IDCT_ADD_10
-INIT_XMM avx
-IDCT_ADD_10
-
-;-----------------------------------------------------------------------------
-; h264_idct_add16(pixel *dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
-;-----------------------------------------------------------------------------
-;;;;;;; NO FATE SAMPLES TRIGGER THIS
-%macro ADD4x4IDCT 0
-add4x4_idct %+ SUFFIX:
-    add   r5, r0
-    mova  m0, [r2+ 0]
-    mova  m1, [r2+16]
-    mova  m2, [r2+32]
-    mova  m3, [r2+48]
-    IDCT4_1D d,0,1,2,3,4,5
-    TRANSPOSE4x4D 0,1,2,3,4
-    paddd m0, [pd_32]
-    IDCT4_1D d,0,1,2,3,4,5
-    pxor  m5, m5
-    mova  [r2+ 0], m5
-    mova  [r2+16], m5
-    mova  [r2+32], m5
-    mova  [r2+48], m5
-    STORE_DIFFx2 m0, m1, m4, m5, r5, r3
-    lea   r5, [r5+r3*2]
-    STORE_DIFFx2 m2, m3, m4, m5, r5, r3
-    ret
-%endmacro
-
-INIT_XMM sse2
-ALIGN 16
-ADD4x4IDCT
-INIT_XMM avx
-ALIGN 16
-ADD4x4IDCT
-
-%macro ADD16_OP 2
-    cmp          byte [r4+%2], 0
-    jz .skipblock%1
-    mov         r5d, [r1+%1*4]
-    call add4x4_idct %+ SUFFIX
-.skipblock%1:
-%if %1<15
-    add          r2, 64
-%endif
-%endmacro
-
-%macro IDCT_ADD16_10 0
-cglobal h264_idct_add16_10, 5,6
-    ADD16_OP 0, 4+1*8
-    ADD16_OP 1, 5+1*8
-    ADD16_OP 2, 4+2*8
-    ADD16_OP 3, 5+2*8
-    ADD16_OP 4, 6+1*8
-    ADD16_OP 5, 7+1*8
-    ADD16_OP 6, 6+2*8
-    ADD16_OP 7, 7+2*8
-    ADD16_OP 8, 4+3*8
-    ADD16_OP 9, 5+3*8
-    ADD16_OP 10, 4+4*8
-    ADD16_OP 11, 5+4*8
-    ADD16_OP 12, 6+3*8
-    ADD16_OP 13, 7+3*8
-    ADD16_OP 14, 6+4*8
-    ADD16_OP 15, 7+4*8
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-IDCT_ADD16_10
-INIT_XMM avx
-IDCT_ADD16_10
-
-;-----------------------------------------------------------------------------
-; void h264_idct_dc_add(pixel *dst, dctcoef *block, int stride)
-;-----------------------------------------------------------------------------
-%macro IDCT_DC_ADD_OP_10 3
-    pxor      m5, m5
-%if avx_enabled
-    paddw     m1, m0, [%1+0   ]
-    paddw     m2, m0, [%1+%2  ]
-    paddw     m3, m0, [%1+%2*2]
-    paddw     m4, m0, [%1+%3  ]
-%else
-    mova      m1, [%1+0   ]
-    mova      m2, [%1+%2  ]
-    mova      m3, [%1+%2*2]
-    mova      m4, [%1+%3  ]
-    paddw     m1, m0
-    paddw     m2, m0
-    paddw     m3, m0
-    paddw     m4, m0
-%endif
-    CLIPW     m1, m5, m6
-    CLIPW     m2, m5, m6
-    CLIPW     m3, m5, m6
-    CLIPW     m4, m5, m6
-    mova [%1+0   ], m1
-    mova [%1+%2  ], m2
-    mova [%1+%2*2], m3
-    mova [%1+%3  ], m4
-%endmacro
-
-INIT_MMX mmxext
-cglobal h264_idct_dc_add_10,3,3
-    movd      m0, [r1]
-    mov dword [r1], 0
-    paddd     m0, [pd_32]
-    psrad     m0, 6
-    lea       r1, [r2*3]
-    pshufw    m0, m0, 0
-    mova      m6, [pw_pixel_max]
-    IDCT_DC_ADD_OP_10 r0, r2, r1
-    RET
-
-;-----------------------------------------------------------------------------
-; void h264_idct8_dc_add(pixel *dst, dctcoef *block, int stride)
-;-----------------------------------------------------------------------------
-%macro IDCT8_DC_ADD 0
-cglobal h264_idct8_dc_add_10,3,4,7
-    movd      m0, [r1]
-    mov dword[r1], 0
-    paddd     m0, [pd_32]
-    psrad     m0, 6
-    lea       r1, [r2*3]
-    SPLATW    m0, m0, 0
-    mova      m6, [pw_pixel_max]
-    IDCT_DC_ADD_OP_10 r0, r2, r1
-    lea       r0, [r0+r2*4]
-    IDCT_DC_ADD_OP_10 r0, r2, r1
-    RET
-%endmacro
-
-INIT_XMM sse2
-IDCT8_DC_ADD
-INIT_XMM avx
-IDCT8_DC_ADD
-
-;-----------------------------------------------------------------------------
-; h264_idct_add16intra(pixel *dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
-;-----------------------------------------------------------------------------
-%macro AC 1
-.ac%1:
-    mov  r5d, [r1+(%1+0)*4]
-    call add4x4_idct %+ SUFFIX
-    mov  r5d, [r1+(%1+1)*4]
-    add  r2, 64
-    call add4x4_idct %+ SUFFIX
-    add  r2, 64
-    jmp .skipadd%1
-%endmacro
-
-%assign last_block 16
-%macro ADD16_OP_INTRA 2
-    cmp      word [r4+%2], 0
-    jnz .ac%1
-    mov      r5d, [r2+ 0]
-    or       r5d, [r2+64]
-    jz .skipblock%1
-    mov      r5d, [r1+(%1+0)*4]
-    call idct_dc_add %+ SUFFIX
-.skipblock%1:
-%if %1<last_block-2
-    add       r2, 128
-%endif
-.skipadd%1:
-%endmacro
-
-%macro IDCT_ADD16INTRA_10 0
-idct_dc_add %+ SUFFIX:
-    add       r5, r0
-    movq      m0, [r2+ 0]
-    movhps    m0, [r2+64]
-    mov dword [r2+ 0], 0
-    mov dword [r2+64], 0
-    paddd     m0, [pd_32]
-    psrad     m0, 6
-    pshufhw   m0, m0, 0
-    pshuflw   m0, m0, 0
-    lea       r6, [r3*3]
-    mova      m6, [pw_pixel_max]
-    IDCT_DC_ADD_OP_10 r5, r3, r6
-    ret
-
-cglobal h264_idct_add16intra_10,5,7,8
-    ADD16_OP_INTRA 0, 4+1*8
-    ADD16_OP_INTRA 2, 4+2*8
-    ADD16_OP_INTRA 4, 6+1*8
-    ADD16_OP_INTRA 6, 6+2*8
-    ADD16_OP_INTRA 8, 4+3*8
-    ADD16_OP_INTRA 10, 4+4*8
-    ADD16_OP_INTRA 12, 6+3*8
-    ADD16_OP_INTRA 14, 6+4*8
-    REP_RET
-    AC 8
-    AC 10
-    AC 12
-    AC 14
-    AC 0
-    AC 2
-    AC 4
-    AC 6
-%endmacro
-
-INIT_XMM sse2
-IDCT_ADD16INTRA_10
-INIT_XMM avx
-IDCT_ADD16INTRA_10
-
-%assign last_block 36
-;-----------------------------------------------------------------------------
-; h264_idct_add8(pixel **dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
-;-----------------------------------------------------------------------------
-%macro IDCT_ADD8 0
-cglobal h264_idct_add8_10,5,8,7
-%if ARCH_X86_64
-    mov      r7, r0
-%endif
-    add      r2, 1024
-    mov      r0, [r0]
-    ADD16_OP_INTRA 16, 4+ 6*8
-    ADD16_OP_INTRA 18, 4+ 7*8
-    add      r2, 1024-128*2
-%if ARCH_X86_64
-    mov      r0, [r7+gprsize]
-%else
-    mov      r0, r0m
-    mov      r0, [r0+gprsize]
-%endif
-    ADD16_OP_INTRA 32, 4+11*8
-    ADD16_OP_INTRA 34, 4+12*8
-    REP_RET
-    AC 16
-    AC 18
-    AC 32
-    AC 34
-
-%endmacro ; IDCT_ADD8
-
-INIT_XMM sse2
-IDCT_ADD8
-INIT_XMM avx
-IDCT_ADD8
-
-;-----------------------------------------------------------------------------
-; void h264_idct8_add(pixel *dst, dctcoef *block, int stride)
-;-----------------------------------------------------------------------------
-%macro IDCT8_1D 2
-    SWAP      0, 1
-    psrad     m4, m5, 1
-    psrad     m1, m0, 1
-    paddd     m4, m5
-    paddd     m1, m0
-    paddd     m4, m7
-    paddd     m1, m5
-    psubd     m4, m0
-    paddd     m1, m3
-
-    psubd     m0, m3
-    psubd     m5, m3
-    paddd     m0, m7
-    psubd     m5, m7
-    psrad     m3, 1
-    psrad     m7, 1
-    psubd     m0, m3
-    psubd     m5, m7
-
-    SWAP      1, 7
-    psrad     m1, m7, 2
-    psrad     m3, m4, 2
-    paddd     m3, m0
-    psrad     m0, 2
-    paddd     m1, m5
-    psrad     m5, 2
-    psubd     m0, m4
-    psubd     m7, m5
-
-    SWAP      5, 6
-    psrad     m4, m2, 1
-    psrad     m6, m5, 1
-    psubd     m4, m5
-    paddd     m6, m2
-
-    mova      m2, %1
-    mova      m5, %2
-    SUMSUB_BA d, 5, 2
-    SUMSUB_BA d, 6, 5
-    SUMSUB_BA d, 4, 2
-    SUMSUB_BA d, 7, 6
-    SUMSUB_BA d, 0, 4
-    SUMSUB_BA d, 3, 2
-    SUMSUB_BA d, 1, 5
-    SWAP      7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567
-%endmacro
-
-%macro IDCT8_1D_FULL 1
-    mova         m7, [%1+112*2]
-    mova         m6, [%1+ 96*2]
-    mova         m5, [%1+ 80*2]
-    mova         m3, [%1+ 48*2]
-    mova         m2, [%1+ 32*2]
-    mova         m1, [%1+ 16*2]
-    IDCT8_1D   [%1], [%1+ 64*2]
-%endmacro
-
-; %1=int16_t *block, %2=int16_t *dstblock
-%macro IDCT8_ADD_SSE_START 2
-    IDCT8_1D_FULL %1
-%if ARCH_X86_64
-    TRANSPOSE4x4D  0,1,2,3,8
-    mova    [%2    ], m0
-    TRANSPOSE4x4D  4,5,6,7,8
-    mova    [%2+8*2], m4
-%else
-    mova         [%1], m7
-    TRANSPOSE4x4D   0,1,2,3,7
-    mova           m7, [%1]
-    mova    [%2     ], m0
-    mova    [%2+16*2], m1
-    mova    [%2+32*2], m2
-    mova    [%2+48*2], m3
-    TRANSPOSE4x4D   4,5,6,7,3
-    mova    [%2+ 8*2], m4
-    mova    [%2+24*2], m5
-    mova    [%2+40*2], m6
-    mova    [%2+56*2], m7
-%endif
-%endmacro
-
-; %1=uint8_t *dst, %2=int16_t *block, %3=int stride
-%macro IDCT8_ADD_SSE_END 3
-    IDCT8_1D_FULL %2
-    mova  [%2     ], m6
-    mova  [%2+16*2], m7
-
-    pxor         m7, m7
-    STORE_DIFFx2 m0, m1, m6, m7, %1, %3
-    lea          %1, [%1+%3*2]
-    STORE_DIFFx2 m2, m3, m6, m7, %1, %3
-    mova         m0, [%2     ]
-    mova         m1, [%2+16*2]
-    lea          %1, [%1+%3*2]
-    STORE_DIFFx2 m4, m5, m6, m7, %1, %3
-    lea          %1, [%1+%3*2]
-    STORE_DIFFx2 m0, m1, m6, m7, %1, %3
-%endmacro
-
-%macro IDCT8_ADD 0
-cglobal h264_idct8_add_10, 3,4,16
-%if UNIX64 == 0
-    %assign pad 16-gprsize-(stack_offset&15)
-    sub  rsp, pad
-    call h264_idct8_add1_10 %+ SUFFIX
-    add  rsp, pad
-    RET
-%endif
-
-ALIGN 16
-; TODO: does not need to use stack
-h264_idct8_add1_10 %+ SUFFIX:
-%assign pad 256+16-gprsize
-    sub          rsp, pad
-    add   dword [r1], 32
-
-%if ARCH_X86_64
-    IDCT8_ADD_SSE_START r1, rsp
-    SWAP 1,  9
-    SWAP 2, 10
-    SWAP 3, 11
-    SWAP 5, 13
-    SWAP 6, 14
-    SWAP 7, 15
-    IDCT8_ADD_SSE_START r1+16, rsp+128
-    PERMUTE 1,9, 2,10, 3,11, 5,1, 6,2, 7,3, 9,13, 10,14, 11,15, 13,5, 14,6, 15,7
-    IDCT8_1D [rsp], [rsp+128]
-    SWAP 0,  8
-    SWAP 1,  9
-    SWAP 2, 10
-    SWAP 3, 11
-    SWAP 4, 12
-    SWAP 5, 13
-    SWAP 6, 14
-    SWAP 7, 15
-    IDCT8_1D [rsp+16], [rsp+144]
-    psrad         m8, 6
-    psrad         m0, 6
-    packssdw      m8, m0
-    paddsw        m8, [r0]
-    pxor          m0, m0
-    mova    [r1+  0], m0
-    mova    [r1+ 16], m0
-    mova    [r1+ 32], m0
-    mova    [r1+ 48], m0
-    mova    [r1+ 64], m0
-    mova    [r1+ 80], m0
-    mova    [r1+ 96], m0
-    mova    [r1+112], m0
-    mova    [r1+128], m0
-    mova    [r1+144], m0
-    mova    [r1+160], m0
-    mova    [r1+176], m0
-    mova    [r1+192], m0
-    mova    [r1+208], m0
-    mova    [r1+224], m0
-    mova    [r1+240], m0
-    CLIPW         m8, m0, [pw_pixel_max]
-    mova        [r0], m8
-    mova          m8, [pw_pixel_max]
-    STORE_DIFF16  m9, m1, m0, m8, r0+r2
-    lea           r0, [r0+r2*2]
-    STORE_DIFF16 m10, m2, m0, m8, r0
-    STORE_DIFF16 m11, m3, m0, m8, r0+r2
-    lea           r0, [r0+r2*2]
-    STORE_DIFF16 m12, m4, m0, m8, r0
-    STORE_DIFF16 m13, m5, m0, m8, r0+r2
-    lea           r0, [r0+r2*2]
-    STORE_DIFF16 m14, m6, m0, m8, r0
-    STORE_DIFF16 m15, m7, m0, m8, r0+r2
-%else
-    IDCT8_ADD_SSE_START r1,    rsp
-    IDCT8_ADD_SSE_START r1+16, rsp+128
-    lea           r3, [r0+8]
-    IDCT8_ADD_SSE_END r0, rsp,    r2
-    IDCT8_ADD_SSE_END r3, rsp+16, r2
-    mova    [r1+  0], m7
-    mova    [r1+ 16], m7
-    mova    [r1+ 32], m7
-    mova    [r1+ 48], m7
-    mova    [r1+ 64], m7
-    mova    [r1+ 80], m7
-    mova    [r1+ 96], m7
-    mova    [r1+112], m7
-    mova    [r1+128], m7
-    mova    [r1+144], m7
-    mova    [r1+160], m7
-    mova    [r1+176], m7
-    mova    [r1+192], m7
-    mova    [r1+208], m7
-    mova    [r1+224], m7
-    mova    [r1+240], m7
-%endif ; ARCH_X86_64
-
-    add          rsp, pad
-    ret
-%endmacro
-
-INIT_XMM sse2
-IDCT8_ADD
-INIT_XMM avx
-IDCT8_ADD
-
-;-----------------------------------------------------------------------------
-; h264_idct8_add4(pixel **dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
-;-----------------------------------------------------------------------------
-;;;;;;; NO FATE SAMPLES TRIGGER THIS
-%macro IDCT8_ADD4_OP 2
-    cmp       byte [r4+%2], 0
-    jz .skipblock%1
-    mov      r0d, [r6+%1*4]
-    add       r0, r5
-    call h264_idct8_add1_10 %+ SUFFIX
-.skipblock%1:
-%if %1<12
-    add       r1, 256
-%endif
-%endmacro
-
-%macro IDCT8_ADD4 0
-cglobal h264_idct8_add4_10, 0,7,16
-    %assign pad 16-gprsize-(stack_offset&15)
-    SUB      rsp, pad
-    mov       r5, r0mp
-    mov       r6, r1mp
-    mov       r1, r2mp
-    mov      r2d, r3m
-    movifnidn r4, r4mp
-    IDCT8_ADD4_OP  0, 4+1*8
-    IDCT8_ADD4_OP  4, 6+1*8
-    IDCT8_ADD4_OP  8, 4+3*8
-    IDCT8_ADD4_OP 12, 6+3*8
-    ADD       rsp, pad
-    RET
-%endmacro ; IDCT8_ADD4
-
-INIT_XMM sse2
-IDCT8_ADD4
-INIT_XMM avx
-IDCT8_ADD4
diff --git a/deps/libav/libavcodec/x86/h264_intrapred.asm b/deps/libav/libavcodec/x86/h264_intrapred.asm
deleted file mode 100644
index b9db3f4..0000000
--- a/deps/libav/libavcodec/x86/h264_intrapred.asm
+++ /dev/null
@@ -1,2702 +0,0 @@
-;******************************************************************************
-;* H.264 intra prediction asm optimizations
-;* Copyright (c) 2010 Jason Garrett-Glaser
-;* Copyright (c) 2010 Holger Lubitz
-;* Copyright (c) 2010 Loren Merritt
-;* Copyright (c) 2010 Ronald S. Bultje
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-tm_shuf: times 8 db 0x03, 0x80
-pw_ff00: times 8 dw 0xff00
-plane_shuf:  db -8, -7, -6, -5, -4, -3, -2, -1
-             db  1,  2,  3,  4,  5,  6,  7,  8
-plane8_shuf: db -4, -3, -2, -1,  0,  0,  0,  0
-             db  1,  2,  3,  4,  0,  0,  0,  0
-pw_0to7:     dw  0,  1,  2,  3,  4,  5,  6,  7
-pw_1to8:     dw  1,  2,  3,  4,  5,  6,  7,  8
-pw_m8tom1:   dw -8, -7, -6, -5, -4, -3, -2, -1
-pw_m4to4:    dw -4, -3, -2, -1,  1,  2,  3,  4
-
-SECTION .text
-
-cextern pb_1
-cextern pb_3
-cextern pw_4
-cextern pw_5
-cextern pw_8
-cextern pw_16
-cextern pw_17
-cextern pw_32
-
-;-----------------------------------------------------------------------------
-; void pred16x16_vertical_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmx
-cglobal pred16x16_vertical_8, 2,3
-    sub   r0, r1
-    mov   r2, 8
-    movq mm0, [r0+0]
-    movq mm1, [r0+8]
-.loop:
-    movq [r0+r1*1+0], mm0
-    movq [r0+r1*1+8], mm1
-    movq [r0+r1*2+0], mm0
-    movq [r0+r1*2+8], mm1
-    lea   r0, [r0+r1*2]
-    dec   r2
-    jg .loop
-    REP_RET
-
-INIT_XMM sse
-cglobal pred16x16_vertical_8, 2,3
-    sub   r0, r1
-    mov   r2, 4
-    movaps xmm0, [r0]
-.loop:
-    movaps [r0+r1*1], xmm0
-    movaps [r0+r1*2], xmm0
-    lea   r0, [r0+r1*2]
-    movaps [r0+r1*1], xmm0
-    movaps [r0+r1*2], xmm0
-    lea   r0, [r0+r1*2]
-    dec   r2
-    jg .loop
-    REP_RET
-
-;-----------------------------------------------------------------------------
-; void pred16x16_horizontal_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED16x16_H 0
-cglobal pred16x16_horizontal_8, 2,3
-    mov       r2, 8
-%if cpuflag(ssse3)
-    mova      m2, [pb_3]
-%endif
-.loop:
-    movd      m0, [r0+r1*0-4]
-    movd      m1, [r0+r1*1-4]
-
-%if cpuflag(ssse3)
-    pshufb    m0, m2
-    pshufb    m1, m2
-%else
-    punpcklbw m0, m0
-    punpcklbw m1, m1
-    SPLATW    m0, m0, 3
-    SPLATW    m1, m1, 3
-    mova [r0+r1*0+8], m0
-    mova [r0+r1*1+8], m1
-%endif
-
-    mova [r0+r1*0], m0
-    mova [r0+r1*1], m1
-    lea       r0, [r0+r1*2]
-    dec       r2
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-PRED16x16_H
-INIT_MMX mmxext
-PRED16x16_H
-INIT_XMM ssse3
-PRED16x16_H
-
-;-----------------------------------------------------------------------------
-; void pred16x16_dc_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED16x16_DC 0
-cglobal pred16x16_dc_8, 2,7
-    mov       r4, r0
-    sub       r0, r1
-    pxor      mm0, mm0
-    pxor      mm1, mm1
-    psadbw    mm0, [r0+0]
-    psadbw    mm1, [r0+8]
-    dec        r0
-    movzx     r5d, byte [r0+r1*1]
-    paddw     mm0, mm1
-    movd      r6d, mm0
-    lea        r0, [r0+r1*2]
-%rep 7
-    movzx     r2d, byte [r0+r1*0]
-    movzx     r3d, byte [r0+r1*1]
-    add       r5d, r2d
-    add       r6d, r3d
-    lea        r0, [r0+r1*2]
-%endrep
-    movzx     r2d, byte [r0+r1*0]
-    add       r5d, r6d
-    lea       r2d, [r2+r5+16]
-    shr       r2d, 5
-%if cpuflag(ssse3)
-    pxor       m1, m1
-%endif
-    SPLATB_REG m0, r2, m1
-
-%if mmsize==8
-    mov       r3d, 8
-.loop:
-    mova [r4+r1*0+0], m0
-    mova [r4+r1*0+8], m0
-    mova [r4+r1*1+0], m0
-    mova [r4+r1*1+8], m0
-%else
-    mov       r3d, 4
-.loop:
-    mova [r4+r1*0], m0
-    mova [r4+r1*1], m0
-    lea   r4, [r4+r1*2]
-    mova [r4+r1*0], m0
-    mova [r4+r1*1], m0
-%endif
-    lea   r4, [r4+r1*2]
-    dec   r3d
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PRED16x16_DC
-INIT_XMM sse2
-PRED16x16_DC
-INIT_XMM ssse3
-PRED16x16_DC
-
-;-----------------------------------------------------------------------------
-; void pred16x16_tm_vp8_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED16x16_TM 0
-cglobal pred16x16_tm_vp8_8, 2,5
-    sub        r0, r1
-    pxor      mm7, mm7
-    movq      mm0, [r0+0]
-    movq      mm2, [r0+8]
-    movq      mm1, mm0
-    movq      mm3, mm2
-    punpcklbw mm0, mm7
-    punpckhbw mm1, mm7
-    punpcklbw mm2, mm7
-    punpckhbw mm3, mm7
-    movzx     r3d, byte [r0-1]
-    mov       r4d, 16
-.loop:
-    movzx     r2d, byte [r0+r1-1]
-    sub       r2d, r3d
-    movd      mm4, r2d
-    SPLATW    mm4, mm4, 0
-    movq      mm5, mm4
-    movq      mm6, mm4
-    movq      mm7, mm4
-    paddw     mm4, mm0
-    paddw     mm5, mm1
-    paddw     mm6, mm2
-    paddw     mm7, mm3
-    packuswb  mm4, mm5
-    packuswb  mm6, mm7
-    movq [r0+r1+0], mm4
-    movq [r0+r1+8], mm6
-    add        r0, r1
-    dec       r4d
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-PRED16x16_TM
-INIT_MMX mmxext
-PRED16x16_TM
-
-INIT_XMM sse2
-cglobal pred16x16_tm_vp8_8, 2,6,6
-    sub          r0, r1
-    pxor       xmm2, xmm2
-    movdqa     xmm0, [r0]
-    movdqa     xmm1, xmm0
-    punpcklbw  xmm0, xmm2
-    punpckhbw  xmm1, xmm2
-    movzx       r4d, byte [r0-1]
-    mov         r5d, 8
-.loop:
-    movzx       r2d, byte [r0+r1*1-1]
-    movzx       r3d, byte [r0+r1*2-1]
-    sub         r2d, r4d
-    sub         r3d, r4d
-    movd       xmm2, r2d
-    movd       xmm4, r3d
-    pshuflw    xmm2, xmm2, 0
-    pshuflw    xmm4, xmm4, 0
-    punpcklqdq xmm2, xmm2
-    punpcklqdq xmm4, xmm4
-    movdqa     xmm3, xmm2
-    movdqa     xmm5, xmm4
-    paddw      xmm2, xmm0
-    paddw      xmm3, xmm1
-    paddw      xmm4, xmm0
-    paddw      xmm5, xmm1
-    packuswb   xmm2, xmm3
-    packuswb   xmm4, xmm5
-    movdqa [r0+r1*1], xmm2
-    movdqa [r0+r1*2], xmm4
-    lea          r0, [r0+r1*2]
-    dec         r5d
-    jg .loop
-    REP_RET
-
-;-----------------------------------------------------------------------------
-; void pred16x16_plane_*_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-%macro H264_PRED16x16_PLANE 1
-cglobal pred16x16_plane_%1_8, 2,9,7
-    mov          r2, r1           ; +stride
-    neg          r1               ; -stride
-
-    movh         m0, [r0+r1  -1]
-%if mmsize == 8
-    pxor         m4, m4
-    movh         m1, [r0+r1  +3 ]
-    movh         m2, [r0+r1  +8 ]
-    movh         m3, [r0+r1  +12]
-    punpcklbw    m0, m4
-    punpcklbw    m1, m4
-    punpcklbw    m2, m4
-    punpcklbw    m3, m4
-    pmullw       m0, [pw_m8tom1  ]
-    pmullw       m1, [pw_m8tom1+8]
-    pmullw       m2, [pw_1to8    ]
-    pmullw       m3, [pw_1to8  +8]
-    paddw        m0, m2
-    paddw        m1, m3
-%else ; mmsize == 16
-%if cpuflag(ssse3)
-    movhps       m0, [r0+r1  +8]
-    pmaddubsw    m0, [plane_shuf] ; H coefficients
-%else ; sse2
-    pxor         m2, m2
-    movh         m1, [r0+r1  +8]
-    punpcklbw    m0, m2
-    punpcklbw    m1, m2
-    pmullw       m0, [pw_m8tom1]
-    pmullw       m1, [pw_1to8]
-    paddw        m0, m1
-%endif
-    movhlps      m1, m0
-%endif
-    paddw        m0, m1
-%if cpuflag(mmxext)
-    PSHUFLW      m1, m0, 0xE
-%elif cpuflag(mmx)
-    mova         m1, m0
-    psrlq        m1, 32
-%endif
-    paddw        m0, m1
-%if cpuflag(mmxext)
-    PSHUFLW      m1, m0, 0x1
-%elif cpuflag(mmx)
-    mova         m1, m0
-    psrlq        m1, 16
-%endif
-    paddw        m0, m1           ; sum of H coefficients
-
-    lea          r4, [r0+r2*8-1]
-    lea          r3, [r0+r2*4-1]
-    add          r4, r2
-
-%if ARCH_X86_64
-%define e_reg r8
-%else
-%define e_reg r0
-%endif
-
-    movzx     e_reg, byte [r3+r2*2   ]
-    movzx        r5, byte [r4+r1     ]
-    sub          r5, e_reg
-
-    movzx     e_reg, byte [r3+r2     ]
-    movzx        r6, byte [r4        ]
-    sub          r6, e_reg
-    lea          r5, [r5+r6*2]
-
-    movzx     e_reg, byte [r3+r1     ]
-    movzx        r6, byte [r4+r2*2   ]
-    sub          r6, e_reg
-    lea          r5, [r5+r6*4]
-
-    movzx     e_reg, byte [r3        ]
-%if ARCH_X86_64
-    movzx        r7, byte [r4+r2     ]
-    sub          r7, e_reg
-%else
-    movzx        r6, byte [r4+r2     ]
-    sub          r6, e_reg
-    lea          r5, [r5+r6*4]
-    sub          r5, r6
-%endif
-
-    lea       e_reg, [r3+r1*4]
-    lea          r3, [r4+r2*4]
-
-    movzx        r4, byte [e_reg+r2  ]
-    movzx        r6, byte [r3        ]
-    sub          r6, r4
-%if ARCH_X86_64
-    lea          r6, [r7+r6*2]
-    lea          r5, [r5+r6*2]
-    add          r5, r6
-%else
-    lea          r5, [r5+r6*4]
-    lea          r5, [r5+r6*2]
-%endif
-
-    movzx        r4, byte [e_reg     ]
-%if ARCH_X86_64
-    movzx        r7, byte [r3   +r2  ]
-    sub          r7, r4
-    sub          r5, r7
-%else
-    movzx        r6, byte [r3   +r2  ]
-    sub          r6, r4
-    lea          r5, [r5+r6*8]
-    sub          r5, r6
-%endif
-
-    movzx        r4, byte [e_reg+r1  ]
-    movzx        r6, byte [r3   +r2*2]
-    sub          r6, r4
-%if ARCH_X86_64
-    add          r6, r7
-%endif
-    lea          r5, [r5+r6*8]
-
-    movzx        r4, byte [e_reg+r2*2]
-    movzx        r6, byte [r3   +r1  ]
-    sub          r6, r4
-    lea          r5, [r5+r6*4]
-    add          r5, r6           ; sum of V coefficients
-
-%if ARCH_X86_64 == 0
-    mov          r0, r0m
-%endif
-
-%ifidn %1, h264
-    lea          r5, [r5*5+32]
-    sar          r5, 6
-%elifidn %1, rv40
-    lea          r5, [r5*5]
-    sar          r5, 6
-%elifidn %1, svq3
-    test         r5, r5
-    lea          r6, [r5+3]
-    cmovs        r5, r6
-    sar          r5, 2            ; V/4
-    lea          r5, [r5*5]       ; 5*(V/4)
-    test         r5, r5
-    lea          r6, [r5+15]
-    cmovs        r5, r6
-    sar          r5, 4            ; (5*(V/4))/16
-%endif
-
-    movzx        r4, byte [r0+r1  +15]
-    movzx        r3, byte [r3+r2*2   ]
-    lea          r3, [r3+r4+1]
-    shl          r3, 4
-
-    movd        r1d, m0
-    movsx       r1d, r1w
-%ifnidn %1, svq3
-%ifidn %1, h264
-    lea         r1d, [r1d*5+32]
-%else ; rv40
-    lea         r1d, [r1d*5]
-%endif
-    sar         r1d, 6
-%else ; svq3
-    test        r1d, r1d
-    lea         r4d, [r1d+3]
-    cmovs       r1d, r4d
-    sar         r1d, 2           ; H/4
-    lea         r1d, [r1d*5]     ; 5*(H/4)
-    test        r1d, r1d
-    lea         r4d, [r1d+15]
-    cmovs       r1d, r4d
-    sar         r1d, 4           ; (5*(H/4))/16
-%endif
-    movd         m0, r1d
-
-    add         r1d, r5d
-    add         r3d, r1d
-    shl         r1d, 3
-    sub         r3d, r1d          ; a
-
-    movd         m1, r5d
-    movd         m3, r3d
-    SPLATW       m0, m0, 0        ; H
-    SPLATW       m1, m1, 0        ; V
-    SPLATW       m3, m3, 0        ; a
-%ifidn %1, svq3
-    SWAP          0, 1
-%endif
-    mova         m2, m0
-%if mmsize == 8
-    mova         m5, m0
-%endif
-    pmullw       m0, [pw_0to7]    ; 0*H, 1*H, ..., 7*H  (words)
-%if mmsize == 16
-    psllw        m2, 3
-%else
-    psllw        m5, 3
-    psllw        m2, 2
-    mova         m6, m5
-    paddw        m6, m2
-%endif
-    paddw        m0, m3           ; a + {0,1,2,3,4,5,6,7}*H
-    paddw        m2, m0           ; a + {8,9,10,11,12,13,14,15}*H
-%if mmsize == 8
-    paddw        m5, m0           ; a + {8,9,10,11}*H
-    paddw        m6, m0           ; a + {12,13,14,15}*H
-%endif
-
-    mov          r4, 8
-.loop:
-    mova         m3, m0           ; b[0..7]
-    mova         m4, m2           ; b[8..15]
-    psraw        m3, 5
-    psraw        m4, 5
-    packuswb     m3, m4
-    mova       [r0], m3
-%if mmsize == 8
-    mova         m3, m5           ; b[8..11]
-    mova         m4, m6           ; b[12..15]
-    psraw        m3, 5
-    psraw        m4, 5
-    packuswb     m3, m4
-    mova     [r0+8], m3
-%endif
-    paddw        m0, m1
-    paddw        m2, m1
-%if mmsize == 8
-    paddw        m5, m1
-    paddw        m6, m1
-%endif
-
-    mova         m3, m0           ; b[0..7]
-    mova         m4, m2           ; b[8..15]
-    psraw        m3, 5
-    psraw        m4, 5
-    packuswb     m3, m4
-    mova    [r0+r2], m3
-%if mmsize == 8
-    mova         m3, m5           ; b[8..11]
-    mova         m4, m6           ; b[12..15]
-    psraw        m3, 5
-    psraw        m4, 5
-    packuswb     m3, m4
-    mova  [r0+r2+8], m3
-%endif
-    paddw        m0, m1
-    paddw        m2, m1
-%if mmsize == 8
-    paddw        m5, m1
-    paddw        m6, m1
-%endif
-
-    lea          r0, [r0+r2*2]
-    dec          r4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-H264_PRED16x16_PLANE h264
-H264_PRED16x16_PLANE rv40
-H264_PRED16x16_PLANE svq3
-INIT_MMX mmxext
-H264_PRED16x16_PLANE h264
-H264_PRED16x16_PLANE rv40
-H264_PRED16x16_PLANE svq3
-INIT_XMM sse2
-H264_PRED16x16_PLANE h264
-H264_PRED16x16_PLANE rv40
-H264_PRED16x16_PLANE svq3
-INIT_XMM ssse3
-H264_PRED16x16_PLANE h264
-H264_PRED16x16_PLANE rv40
-H264_PRED16x16_PLANE svq3
-
-;-----------------------------------------------------------------------------
-; void pred8x8_plane_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-%macro H264_PRED8x8_PLANE 0
-cglobal pred8x8_plane_8, 2,9,7
-    mov          r2, r1           ; +stride
-    neg          r1               ; -stride
-
-    movd         m0, [r0+r1  -1]
-%if mmsize == 8
-    pxor         m2, m2
-    movh         m1, [r0+r1  +4 ]
-    punpcklbw    m0, m2
-    punpcklbw    m1, m2
-    pmullw       m0, [pw_m4to4]
-    pmullw       m1, [pw_m4to4+8]
-%else ; mmsize == 16
-%if cpuflag(ssse3)
-    movhps       m0, [r0+r1  +4]   ; this reads 4 bytes more than necessary
-    pmaddubsw    m0, [plane8_shuf] ; H coefficients
-%else ; sse2
-    pxor         m2, m2
-    movd         m1, [r0+r1  +4]
-    punpckldq    m0, m1
-    punpcklbw    m0, m2
-    pmullw       m0, [pw_m4to4]
-%endif
-    movhlps      m1, m0
-%endif
-    paddw        m0, m1
-
-%if notcpuflag(ssse3)
-%if cpuflag(mmxext)
-    PSHUFLW      m1, m0, 0xE
-%elif cpuflag(mmx)
-    mova         m1, m0
-    psrlq        m1, 32
-%endif
-    paddw        m0, m1
-%endif ; !ssse3
-
-%if cpuflag(mmxext)
-    PSHUFLW      m1, m0, 0x1
-%elif cpuflag(mmx)
-    mova         m1, m0
-    psrlq        m1, 16
-%endif
-    paddw        m0, m1           ; sum of H coefficients
-
-    lea          r4, [r0+r2*4-1]
-    lea          r3, [r0     -1]
-    add          r4, r2
-
-%if ARCH_X86_64
-%define e_reg r8
-%else
-%define e_reg r0
-%endif
-
-    movzx     e_reg, byte [r3+r2*2   ]
-    movzx        r5, byte [r4+r1     ]
-    sub          r5, e_reg
-
-    movzx     e_reg, byte [r3        ]
-%if ARCH_X86_64
-    movzx        r7, byte [r4+r2     ]
-    sub          r7, e_reg
-    sub          r5, r7
-%else
-    movzx        r6, byte [r4+r2     ]
-    sub          r6, e_reg
-    lea          r5, [r5+r6*4]
-    sub          r5, r6
-%endif
-
-    movzx     e_reg, byte [r3+r1     ]
-    movzx        r6, byte [r4+r2*2   ]
-    sub          r6, e_reg
-%if ARCH_X86_64
-    add          r6, r7
-%endif
-    lea          r5, [r5+r6*4]
-
-    movzx     e_reg, byte [r3+r2     ]
-    movzx        r6, byte [r4        ]
-    sub          r6, e_reg
-    lea          r6, [r5+r6*2]
-
-    lea          r5, [r6*9+16]
-    lea          r5, [r5+r6*8]
-    sar          r5, 5
-
-%if ARCH_X86_64 == 0
-    mov          r0, r0m
-%endif
-
-    movzx        r3, byte [r4+r2*2  ]
-    movzx        r4, byte [r0+r1  +7]
-    lea          r3, [r3+r4+1]
-    shl          r3, 4
-    movd        r1d, m0
-    movsx       r1d, r1w
-    imul        r1d, 17
-    add         r1d, 16
-    sar         r1d, 5
-    movd         m0, r1d
-    add         r1d, r5d
-    sub         r3d, r1d
-    add         r1d, r1d
-    sub         r3d, r1d          ; a
-
-    movd         m1, r5d
-    movd         m3, r3d
-    SPLATW       m0, m0, 0        ; H
-    SPLATW       m1, m1, 0        ; V
-    SPLATW       m3, m3, 0        ; a
-%if mmsize == 8
-    mova         m2, m0
-%endif
-    pmullw       m0, [pw_0to7]    ; 0*H, 1*H, ..., 7*H  (words)
-    paddw        m0, m3           ; a + {0,1,2,3,4,5,6,7}*H
-%if mmsize == 8
-    psllw        m2, 2
-    paddw        m2, m0           ; a + {4,5,6,7}*H
-%endif
-
-    mov          r4, 4
-ALIGN 16
-.loop:
-%if mmsize == 16
-    mova         m3, m0           ; b[0..7]
-    paddw        m0, m1
-    psraw        m3, 5
-    mova         m4, m0           ; V+b[0..7]
-    paddw        m0, m1
-    psraw        m4, 5
-    packuswb     m3, m4
-    movh       [r0], m3
-    movhps  [r0+r2], m3
-%else ; mmsize == 8
-    mova         m3, m0           ; b[0..3]
-    mova         m4, m2           ; b[4..7]
-    paddw        m0, m1
-    paddw        m2, m1
-    psraw        m3, 5
-    psraw        m4, 5
-    mova         m5, m0           ; V+b[0..3]
-    mova         m6, m2           ; V+b[4..7]
-    paddw        m0, m1
-    paddw        m2, m1
-    psraw        m5, 5
-    psraw        m6, 5
-    packuswb     m3, m4
-    packuswb     m5, m6
-    mova       [r0], m3
-    mova    [r0+r2], m5
-%endif
-
-    lea          r0, [r0+r2*2]
-    dec          r4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-H264_PRED8x8_PLANE
-INIT_MMX mmxext
-H264_PRED8x8_PLANE
-INIT_XMM sse2
-H264_PRED8x8_PLANE
-INIT_XMM ssse3
-H264_PRED8x8_PLANE
-
-;-----------------------------------------------------------------------------
-; void pred8x8_vertical_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmx
-cglobal pred8x8_vertical_8, 2,2
-    sub    r0, r1
-    movq  mm0, [r0]
-%rep 3
-    movq [r0+r1*1], mm0
-    movq [r0+r1*2], mm0
-    lea    r0, [r0+r1*2]
-%endrep
-    movq [r0+r1*1], mm0
-    movq [r0+r1*2], mm0
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred8x8_horizontal_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED8x8_H 0
-cglobal pred8x8_horizontal_8, 2,3
-    mov       r2, 4
-%if cpuflag(ssse3)
-    mova      m2, [pb_3]
-%endif
-.loop:
-    SPLATB_LOAD m0, r0+r1*0-1, m2
-    SPLATB_LOAD m1, r0+r1*1-1, m2
-    mova [r0+r1*0], m0
-    mova [r0+r1*1], m1
-    lea       r0, [r0+r1*2]
-    dec       r2
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-PRED8x8_H
-INIT_MMX mmxext
-PRED8x8_H
-INIT_MMX ssse3
-PRED8x8_H
-
-;-----------------------------------------------------------------------------
-; void pred8x8_top_dc_8_mmxext(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-INIT_MMX mmxext
-cglobal pred8x8_top_dc_8, 2,5
-    sub         r0, r1
-    movq       mm0, [r0]
-    pxor       mm1, mm1
-    pxor       mm2, mm2
-    lea         r2, [r0+r1*2]
-    punpckhbw  mm1, mm0
-    punpcklbw  mm0, mm2
-    psadbw     mm1, mm2        ; s1
-    lea         r3, [r2+r1*2]
-    psadbw     mm0, mm2        ; s0
-    psrlw      mm1, 1
-    psrlw      mm0, 1
-    pavgw      mm1, mm2
-    lea         r4, [r3+r1*2]
-    pavgw      mm0, mm2
-    pshufw     mm1, mm1, 0
-    pshufw     mm0, mm0, 0     ; dc0 (w)
-    packuswb   mm0, mm1        ; dc0,dc1 (b)
-    movq [r0+r1*1], mm0
-    movq [r0+r1*2], mm0
-    lea         r0, [r3+r1*2]
-    movq [r2+r1*1], mm0
-    movq [r2+r1*2], mm0
-    movq [r3+r1*1], mm0
-    movq [r3+r1*2], mm0
-    movq [r0+r1*1], mm0
-    movq [r0+r1*2], mm0
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred8x8_dc_8_mmxext(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred8x8_dc_8, 2,5
-    sub       r0, r1
-    pxor      m7, m7
-    movd      m0, [r0+0]
-    movd      m1, [r0+4]
-    psadbw    m0, m7            ; s0
-    mov       r4, r0
-    psadbw    m1, m7            ; s1
-
-    movzx    r2d, byte [r0+r1*1-1]
-    movzx    r3d, byte [r0+r1*2-1]
-    lea       r0, [r0+r1*2]
-    add      r2d, r3d
-    movzx    r3d, byte [r0+r1*1-1]
-    add      r2d, r3d
-    movzx    r3d, byte [r0+r1*2-1]
-    add      r2d, r3d
-    lea       r0, [r0+r1*2]
-    movd      m2, r2d            ; s2
-    movzx    r2d, byte [r0+r1*1-1]
-    movzx    r3d, byte [r0+r1*2-1]
-    lea       r0, [r0+r1*2]
-    add      r2d, r3d
-    movzx    r3d, byte [r0+r1*1-1]
-    add      r2d, r3d
-    movzx    r3d, byte [r0+r1*2-1]
-    add      r2d, r3d
-    movd      m3, r2d            ; s3
-
-    punpcklwd m0, m1
-    mov       r0, r4
-    punpcklwd m2, m3
-    punpckldq m0, m2            ; s0, s1, s2, s3
-    pshufw    m3, m0, 11110110b ; s2, s1, s3, s3
-    lea       r2, [r0+r1*2]
-    pshufw    m0, m0, 01110100b ; s0, s1, s3, s1
-    paddw     m0, m3
-    lea       r3, [r2+r1*2]
-    psrlw     m0, 2
-    pavgw     m0, m7            ; s0+s2, s1, s3, s1+s3
-    lea       r4, [r3+r1*2]
-    packuswb  m0, m0
-    punpcklbw m0, m0
-    movq      m1, m0
-    punpcklbw m0, m0
-    punpckhbw m1, m1
-    movq [r0+r1*1], m0
-    movq [r0+r1*2], m0
-    movq [r2+r1*1], m0
-    movq [r2+r1*2], m0
-    movq [r3+r1*1], m1
-    movq [r3+r1*2], m1
-    movq [r4+r1*1], m1
-    movq [r4+r1*2], m1
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred8x8_dc_rv40_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred8x8_dc_rv40_8, 2,7
-    mov       r4, r0
-    sub       r0, r1
-    pxor      mm0, mm0
-    psadbw    mm0, [r0]
-    dec        r0
-    movzx     r5d, byte [r0+r1*1]
-    movd      r6d, mm0
-    lea        r0, [r0+r1*2]
-%rep 3
-    movzx     r2d, byte [r0+r1*0]
-    movzx     r3d, byte [r0+r1*1]
-    add       r5d, r2d
-    add       r6d, r3d
-    lea        r0, [r0+r1*2]
-%endrep
-    movzx     r2d, byte [r0+r1*0]
-    add       r5d, r6d
-    lea       r2d, [r2+r5+8]
-    shr       r2d, 4
-    movd      mm0, r2d
-    punpcklbw mm0, mm0
-    pshufw    mm0, mm0, 0
-    mov       r3d, 4
-.loop:
-    movq [r4+r1*0], mm0
-    movq [r4+r1*1], mm0
-    lea   r4, [r4+r1*2]
-    dec   r3d
-    jg .loop
-    REP_RET
-
-;-----------------------------------------------------------------------------
-; void pred8x8_tm_vp8_8(uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED8x8_TM 0
-cglobal pred8x8_tm_vp8_8, 2,6
-    sub        r0, r1
-    pxor      mm7, mm7
-    movq      mm0, [r0]
-    movq      mm1, mm0
-    punpcklbw mm0, mm7
-    punpckhbw mm1, mm7
-    movzx     r4d, byte [r0-1]
-    mov       r5d, 4
-.loop:
-    movzx     r2d, byte [r0+r1*1-1]
-    movzx     r3d, byte [r0+r1*2-1]
-    sub       r2d, r4d
-    sub       r3d, r4d
-    movd      mm2, r2d
-    movd      mm4, r3d
-    SPLATW    mm2, mm2, 0
-    SPLATW    mm4, mm4, 0
-    movq      mm3, mm2
-    movq      mm5, mm4
-    paddw     mm2, mm0
-    paddw     mm3, mm1
-    paddw     mm4, mm0
-    paddw     mm5, mm1
-    packuswb  mm2, mm3
-    packuswb  mm4, mm5
-    movq [r0+r1*1], mm2
-    movq [r0+r1*2], mm4
-    lea        r0, [r0+r1*2]
-    dec       r5d
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-PRED8x8_TM
-INIT_MMX mmxext
-PRED8x8_TM
-
-INIT_XMM sse2
-cglobal pred8x8_tm_vp8_8, 2,6,4
-    sub          r0, r1
-    pxor       xmm1, xmm1
-    movq       xmm0, [r0]
-    punpcklbw  xmm0, xmm1
-    movzx       r4d, byte [r0-1]
-    mov         r5d, 4
-.loop:
-    movzx       r2d, byte [r0+r1*1-1]
-    movzx       r3d, byte [r0+r1*2-1]
-    sub         r2d, r4d
-    sub         r3d, r4d
-    movd       xmm2, r2d
-    movd       xmm3, r3d
-    pshuflw    xmm2, xmm2, 0
-    pshuflw    xmm3, xmm3, 0
-    punpcklqdq xmm2, xmm2
-    punpcklqdq xmm3, xmm3
-    paddw      xmm2, xmm0
-    paddw      xmm3, xmm0
-    packuswb   xmm2, xmm3
-    movq   [r0+r1*1], xmm2
-    movhps [r0+r1*2], xmm2
-    lea          r0, [r0+r1*2]
-    dec         r5d
-    jg .loop
-    REP_RET
-
-INIT_XMM ssse3
-cglobal pred8x8_tm_vp8_8, 2,3,6
-    sub          r0, r1
-    movdqa     xmm4, [tm_shuf]
-    pxor       xmm1, xmm1
-    movq       xmm0, [r0]
-    punpcklbw  xmm0, xmm1
-    movd       xmm5, [r0-4]
-    pshufb     xmm5, xmm4
-    mov         r2d, 4
-.loop:
-    movd       xmm2, [r0+r1*1-4]
-    movd       xmm3, [r0+r1*2-4]
-    pshufb     xmm2, xmm4
-    pshufb     xmm3, xmm4
-    psubw      xmm2, xmm5
-    psubw      xmm3, xmm5
-    paddw      xmm2, xmm0
-    paddw      xmm3, xmm0
-    packuswb   xmm2, xmm3
-    movq   [r0+r1*1], xmm2
-    movhps [r0+r1*2], xmm2
-    lea          r0, [r0+r1*2]
-    dec         r2d
-    jg .loop
-    REP_RET
-
-; dest, left, right, src, tmp
-; output: %1 = (t[n-1] + t[n]*2 + t[n+1] + 2) >> 2
-%macro PRED4x4_LOWPASS 5
-    mova    %5, %2
-    pavgb   %2, %3
-    pxor    %3, %5
-    mova    %1, %4
-    pand    %3, [pb_1]
-    psubusb %2, %3
-    pavgb   %1, %2
-%endmacro
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_top_dc_8(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED8x8L_TOP_DC 0
-cglobal pred8x8l_top_dc_8, 4,4
-    sub          r0, r3
-    pxor        mm7, mm7
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1 ; top_left
-    jz .fix_lt_2
-    test         r2, r2 ; top_right
-    jz .fix_tr_1
-    jmp .body
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2 ; top_right
-    jnz .body
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-.body:
-    PRED4x4_LOWPASS mm0, mm2, mm1, mm3, mm5
-    psadbw   mm7, mm0
-    paddw    mm7, [pw_4]
-    psrlw    mm7, 3
-    pshufw   mm7, mm7, 0
-    packuswb mm7, mm7
-%rep 3
-    movq [r0+r3*1], mm7
-    movq [r0+r3*2], mm7
-    lea    r0, [r0+r3*2]
-%endrep
-    movq [r0+r3*1], mm7
-    movq [r0+r3*2], mm7
-    RET
-%endmacro
-
-INIT_MMX mmxext
-PRED8x8L_TOP_DC
-INIT_MMX ssse3
-PRED8x8L_TOP_DC
-
-;-----------------------------------------------------------------------------
-;void pred8x8l_dc_8(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED8x8L_DC 0
-cglobal pred8x8l_dc_8, 4,5
-    sub          r0, r3
-    lea          r4, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    punpckhbw   mm0, [r0+r3*0-8]
-    movq        mm1, [r4+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
-    mov          r4, r0
-    punpckhwd   mm1, mm0
-    lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
-    lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
-    lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r4]
-    mov          r0, r4
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    test        r1, r1
-    jnz .do_left
-.fix_lt_1:
-    movq        mm5, mm3
-    pxor        mm5, mm4
-    psrlq       mm5, 56
-    psllq       mm5, 48
-    pxor        mm1, mm5
-    jmp .do_left
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2
-    jnz .body
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .body
-.do_left:
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq        mm4, mm0
-    movq        mm7, mm2
-    PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5
-    psllq       mm1, 56
-    PALIGNR     mm7, mm1, 7, mm3
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1
-    jz .fix_lt_2
-    test         r2, r2
-    jz .fix_tr_1
-.body:
-    lea          r1, [r0+r3*2]
-    PRED4x4_LOWPASS mm6, mm2, mm1, mm3, mm5
-    pxor        mm0, mm0
-    pxor        mm1, mm1
-    lea          r2, [r1+r3*2]
-    psadbw      mm0, mm7
-    psadbw      mm1, mm6
-    paddw       mm0, [pw_8]
-    paddw       mm0, mm1
-    lea          r4, [r2+r3*2]
-    psrlw       mm0, 4
-    pshufw      mm0, mm0, 0
-    packuswb    mm0, mm0
-    movq [r0+r3*1], mm0
-    movq [r0+r3*2], mm0
-    movq [r1+r3*1], mm0
-    movq [r1+r3*2], mm0
-    movq [r2+r3*1], mm0
-    movq [r2+r3*2], mm0
-    movq [r4+r3*1], mm0
-    movq [r4+r3*2], mm0
-    RET
-%endmacro
-
-INIT_MMX mmxext
-PRED8x8L_DC
-INIT_MMX ssse3
-PRED8x8L_DC
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_horizontal_8(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED8x8L_HORIZONTAL 0
-cglobal pred8x8l_horizontal_8, 4,4
-    sub          r0, r3
-    lea          r2, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    test         r1, r1
-    lea          r1, [r0+r3]
-    cmovnz       r1, r0
-    punpckhbw   mm0, [r1+r3*0-8]
-    movq        mm1, [r2+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
-    mov          r2, r0
-    punpckhwd   mm1, mm0
-    lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
-    lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
-    lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r1+r3*0-8]
-    mov          r0, r2
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq        mm4, mm0
-    movq        mm7, mm2
-    PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5
-    psllq       mm1, 56
-    PALIGNR     mm7, mm1, 7, mm3
-    movq        mm3, mm7
-    lea         r1, [r0+r3*2]
-    movq       mm7, mm3
-    punpckhbw  mm3, mm3
-    punpcklbw  mm7, mm7
-    pshufw     mm0, mm3, 0xff
-    pshufw     mm1, mm3, 0xaa
-    lea         r2, [r1+r3*2]
-    pshufw     mm2, mm3, 0x55
-    pshufw     mm3, mm3, 0x00
-    pshufw     mm4, mm7, 0xff
-    pshufw     mm5, mm7, 0xaa
-    pshufw     mm6, mm7, 0x55
-    pshufw     mm7, mm7, 0x00
-    movq [r0+r3*1], mm0
-    movq [r0+r3*2], mm1
-    movq [r1+r3*1], mm2
-    movq [r1+r3*2], mm3
-    movq [r2+r3*1], mm4
-    movq [r2+r3*2], mm5
-    lea         r0, [r2+r3*2]
-    movq [r0+r3*1], mm6
-    movq [r0+r3*2], mm7
-    RET
-%endmacro
-
-INIT_MMX mmxext
-PRED8x8L_HORIZONTAL
-INIT_MMX ssse3
-PRED8x8L_HORIZONTAL
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_vertical_8(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED8x8L_VERTICAL 0
-cglobal pred8x8l_vertical_8, 4,4
-    sub          r0, r3
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1 ; top_left
-    jz .fix_lt_2
-    test         r2, r2 ; top_right
-    jz .fix_tr_1
-    jmp .body
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2 ; top_right
-    jnz .body
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-.body:
-    PRED4x4_LOWPASS mm0, mm2, mm1, mm3, mm5
-%rep 3
-    movq [r0+r3*1], mm0
-    movq [r0+r3*2], mm0
-    lea    r0, [r0+r3*2]
-%endrep
-    movq [r0+r3*1], mm0
-    movq [r0+r3*2], mm0
-    RET
-%endmacro
-
-INIT_MMX mmxext
-PRED8x8L_VERTICAL
-INIT_MMX ssse3
-PRED8x8L_VERTICAL
-
-;-----------------------------------------------------------------------------
-;void pred8x8l_down_left_8(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred8x8l_down_left_8, 4,5
-    sub          r0, r3
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1
-    jz .fix_lt_2
-    test         r2, r2
-    jz .fix_tr_1
-    jmp .do_top
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.fix_tr_2:
-    punpckhbw   mm3, mm3
-    pshufw      mm1, mm3, 0xFF
-    jmp .do_topright
-.do_top:
-    PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
-    movq        mm7, mm4
-    test         r2, r2
-    jz .fix_tr_2
-    movq        mm0, [r0+8]
-    movq        mm5, mm0
-    movq        mm2, mm0
-    movq        mm4, mm0
-    psrlq       mm5, 56
-    PALIGNR     mm2, mm3, 7, mm3
-    PALIGNR     mm5, mm4, 1, mm4
-    PRED4x4_LOWPASS mm1, mm2, mm5, mm0, mm4
-.do_topright:
-    lea          r1, [r0+r3*2]
-    movq        mm6, mm1
-    psrlq       mm1, 56
-    movq        mm4, mm1
-    lea          r2, [r1+r3*2]
-    movq        mm2, mm6
-    PALIGNR     mm2, mm7, 1, mm0
-    movq        mm3, mm6
-    PALIGNR     mm3, mm7, 7, mm0
-    PALIGNR     mm4, mm6, 1, mm0
-    movq        mm5, mm7
-    movq        mm1, mm7
-    movq        mm7, mm6
-    lea          r4, [r2+r3*2]
-    psllq       mm1, 8
-    PRED4x4_LOWPASS mm0, mm1, mm2, mm5, mm6
-    PRED4x4_LOWPASS mm1, mm3, mm4, mm7, mm6
-    movq  [r4+r3*2], mm1
-    movq        mm2, mm0
-    psllq       mm1, 8
-    psrlq       mm2, 56
-    psllq       mm0, 8
-    por         mm1, mm2
-    movq  [r4+r3*1], mm1
-    movq        mm2, mm0
-    psllq       mm1, 8
-    psrlq       mm2, 56
-    psllq       mm0, 8
-    por         mm1, mm2
-    movq  [r2+r3*2], mm1
-    movq        mm2, mm0
-    psllq       mm1, 8
-    psrlq       mm2, 56
-    psllq       mm0, 8
-    por         mm1, mm2
-    movq  [r2+r3*1], mm1
-    movq        mm2, mm0
-    psllq       mm1, 8
-    psrlq       mm2, 56
-    psllq       mm0, 8
-    por         mm1, mm2
-    movq  [r1+r3*2], mm1
-    movq        mm2, mm0
-    psllq       mm1, 8
-    psrlq       mm2, 56
-    psllq       mm0, 8
-    por         mm1, mm2
-    movq  [r1+r3*1], mm1
-    movq        mm2, mm0
-    psllq       mm1, 8
-    psrlq       mm2, 56
-    psllq       mm0, 8
-    por         mm1, mm2
-    movq  [r0+r3*2], mm1
-    psllq       mm1, 8
-    psrlq       mm0, 56
-    por         mm1, mm0
-    movq  [r0+r3*1], mm1
-    RET
-
-%macro PRED8x8L_DOWN_LEFT 0
-cglobal pred8x8l_down_left_8, 4,4
-    sub          r0, r3
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1 ; top_left
-    jz .fix_lt_2
-    test         r2, r2 ; top_right
-    jz .fix_tr_1
-    jmp .do_top
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2 ; top_right
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.fix_tr_2:
-    punpckhbw   mm3, mm3
-    pshufw      mm1, mm3, 0xFF
-    jmp .do_topright
-.do_top:
-    PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
-    movq2dq    xmm3, mm4
-    test         r2, r2 ; top_right
-    jz .fix_tr_2
-    movq        mm0, [r0+8]
-    movq        mm5, mm0
-    movq        mm2, mm0
-    movq        mm4, mm0
-    psrlq       mm5, 56
-    PALIGNR     mm2, mm3, 7, mm3
-    PALIGNR     mm5, mm4, 1, mm4
-    PRED4x4_LOWPASS mm1, mm2, mm5, mm0, mm4
-.do_topright:
-    movq2dq    xmm4, mm1
-    psrlq       mm1, 56
-    movq2dq    xmm5, mm1
-    lea         r1, [r0+r3*2]
-    pslldq    xmm4, 8
-    por       xmm3, xmm4
-    movdqa    xmm2, xmm3
-    psrldq    xmm2, 1
-    pslldq    xmm5, 15
-    por       xmm2, xmm5
-    lea         r2, [r1+r3*2]
-    movdqa    xmm1, xmm3
-    pslldq    xmm1, 1
-INIT_XMM cpuname
-    PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm4
-    psrldq    xmm0, 1
-    movq [r0+r3*1], xmm0
-    psrldq    xmm0, 1
-    movq [r0+r3*2], xmm0
-    psrldq    xmm0, 1
-    lea         r0, [r2+r3*2]
-    movq [r1+r3*1], xmm0
-    psrldq    xmm0, 1
-    movq [r1+r3*2], xmm0
-    psrldq    xmm0, 1
-    movq [r2+r3*1], xmm0
-    psrldq    xmm0, 1
-    movq [r2+r3*2], xmm0
-    psrldq    xmm0, 1
-    movq [r0+r3*1], xmm0
-    psrldq    xmm0, 1
-    movq [r0+r3*2], xmm0
-    RET
-%endmacro
-
-INIT_MMX sse2
-PRED8x8L_DOWN_LEFT
-INIT_MMX ssse3
-PRED8x8L_DOWN_LEFT
-
-;-----------------------------------------------------------------------------
-;void pred8x8l_down_right_8_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred8x8l_down_right_8, 4,5
-    sub          r0, r3
-    lea          r4, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    punpckhbw   mm0, [r0+r3*0-8]
-    movq        mm1, [r4+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
-    mov          r4, r0
-    punpckhwd   mm1, mm0
-    lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
-    lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
-    lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r4]
-    mov          r0, r4
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    test        r1, r1 ; top_left
-    jz .fix_lt_1
-.do_left:
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq        mm4, mm0
-    movq        mm7, mm2
-    movq        mm6, mm2
-    PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5
-    psllq       mm1, 56
-    PALIGNR     mm7, mm1, 7, mm3
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1 ; top_left
-    jz .fix_lt_2
-    test         r2, r2 ; top_right
-    jz .fix_tr_1
-.do_top:
-    PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
-    movq        mm5, mm4
-    jmp .body
-.fix_lt_1:
-    movq        mm5, mm3
-    pxor        mm5, mm4
-    psrlq       mm5, 56
-    psllq       mm5, 48
-    pxor        mm1, mm5
-    jmp .do_left
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2 ; top_right
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.body:
-    lea         r1, [r0+r3*2]
-    movq       mm1, mm7
-    movq       mm7, mm5
-    movq       mm5, mm6
-    movq       mm2, mm7
-    lea         r2, [r1+r3*2]
-    PALIGNR    mm2, mm6, 1, mm0
-    movq       mm3, mm7
-    PALIGNR    mm3, mm6, 7, mm0
-    movq       mm4, mm7
-    lea         r4, [r2+r3*2]
-    psrlq      mm4, 8
-    PRED4x4_LOWPASS mm0, mm1, mm2, mm5, mm6
-    PRED4x4_LOWPASS mm1, mm3, mm4, mm7, mm6
-    movq [r4+r3*2], mm0
-    movq       mm2, mm1
-    psrlq      mm0, 8
-    psllq      mm2, 56
-    psrlq      mm1, 8
-    por        mm0, mm2
-    movq [r4+r3*1], mm0
-    movq       mm2, mm1
-    psrlq      mm0, 8
-    psllq      mm2, 56
-    psrlq      mm1, 8
-    por        mm0, mm2
-    movq [r2+r3*2], mm0
-    movq       mm2, mm1
-    psrlq      mm0, 8
-    psllq      mm2, 56
-    psrlq      mm1, 8
-    por        mm0, mm2
-    movq [r2+r3*1], mm0
-    movq       mm2, mm1
-    psrlq      mm0, 8
-    psllq      mm2, 56
-    psrlq      mm1, 8
-    por        mm0, mm2
-    movq [r1+r3*2], mm0
-    movq       mm2, mm1
-    psrlq      mm0, 8
-    psllq      mm2, 56
-    psrlq      mm1, 8
-    por        mm0, mm2
-    movq [r1+r3*1], mm0
-    movq       mm2, mm1
-    psrlq      mm0, 8
-    psllq      mm2, 56
-    psrlq      mm1, 8
-    por        mm0, mm2
-    movq [r0+r3*2], mm0
-    psrlq      mm0, 8
-    psllq      mm1, 56
-    por        mm0, mm1
-    movq [r0+r3*1], mm0
-    RET
-
-%macro PRED8x8L_DOWN_RIGHT 0
-cglobal pred8x8l_down_right_8, 4,5
-    sub          r0, r3
-    lea          r4, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    punpckhbw   mm0, [r0+r3*0-8]
-    movq        mm1, [r4+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
-    mov          r4, r0
-    punpckhwd   mm1, mm0
-    lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
-    lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
-    lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r4]
-    mov          r0, r4
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    test        r1, r1
-    jz .fix_lt_1
-    jmp .do_left
-.fix_lt_1:
-    movq        mm5, mm3
-    pxor        mm5, mm4
-    psrlq       mm5, 56
-    psllq       mm5, 48
-    pxor        mm1, mm5
-    jmp .do_left
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.do_left:
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq        mm4, mm0
-    movq        mm7, mm2
-    movq2dq    xmm3, mm2
-    PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5
-    psllq       mm1, 56
-    PALIGNR     mm7, mm1, 7, mm3
-    movq2dq    xmm1, mm7
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1
-    jz .fix_lt_2
-    test         r2, r2
-    jz .fix_tr_1
-.do_top:
-    PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
-    movq2dq   xmm4, mm4
-    lea         r1, [r0+r3*2]
-    movdqa    xmm0, xmm3
-    pslldq    xmm4, 8
-    por       xmm3, xmm4
-    lea         r2, [r1+r3*2]
-    pslldq    xmm4, 1
-    por       xmm1, xmm4
-    psrldq    xmm0, 7
-    pslldq    xmm0, 15
-    psrldq    xmm0, 7
-    por       xmm1, xmm0
-    lea         r0, [r2+r3*2]
-    movdqa    xmm2, xmm3
-    psrldq    xmm2, 1
-INIT_XMM cpuname
-    PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm4
-    movdqa    xmm1, xmm0
-    psrldq    xmm1, 1
-    movq [r0+r3*2], xmm0
-    movq [r0+r3*1], xmm1
-    psrldq    xmm0, 2
-    psrldq    xmm1, 2
-    movq [r2+r3*2], xmm0
-    movq [r2+r3*1], xmm1
-    psrldq    xmm0, 2
-    psrldq    xmm1, 2
-    movq [r1+r3*2], xmm0
-    movq [r1+r3*1], xmm1
-    psrldq    xmm0, 2
-    psrldq    xmm1, 2
-    movq [r4+r3*2], xmm0
-    movq [r4+r3*1], xmm1
-    RET
-%endmacro
-
-INIT_MMX sse2
-PRED8x8L_DOWN_RIGHT
-INIT_MMX ssse3
-PRED8x8L_DOWN_RIGHT
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_vertical_right_8(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred8x8l_vertical_right_8, 4,5
-    sub          r0, r3
-    lea          r4, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    punpckhbw   mm0, [r0+r3*0-8]
-    movq        mm1, [r4+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
-    mov          r4, r0
-    punpckhwd   mm1, mm0
-    lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
-    lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
-    lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r4]
-    mov          r0, r4
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    test        r1, r1
-    jz .fix_lt_1
-    jmp .do_left
-.fix_lt_1:
-    movq        mm5, mm3
-    pxor        mm5, mm4
-    psrlq       mm5, 56
-    psllq       mm5, 48
-    pxor        mm1, mm5
-    jmp .do_left
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.do_left:
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq        mm7, mm2
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1
-    jz .fix_lt_2
-    test         r2, r2
-    jz .fix_tr_1
-.do_top:
-    PRED4x4_LOWPASS mm6, mm2, mm1, mm3, mm5
-    lea         r1, [r0+r3*2]
-    movq       mm2, mm6
-    movq       mm3, mm6
-    PALIGNR    mm3, mm7, 7, mm0
-    PALIGNR    mm6, mm7, 6, mm1
-    movq       mm4, mm3
-    pavgb      mm3, mm2
-    lea         r2, [r1+r3*2]
-    PRED4x4_LOWPASS mm0, mm6, mm2, mm4, mm5
-    movq [r0+r3*1], mm3
-    movq [r0+r3*2], mm0
-    movq       mm5, mm0
-    movq       mm6, mm3
-    movq       mm1, mm7
-    movq       mm2, mm1
-    psllq      mm2, 8
-    movq       mm3, mm1
-    psllq      mm3, 16
-    lea         r4, [r2+r3*2]
-    PRED4x4_LOWPASS mm0, mm1, mm3, mm2, mm4
-    PALIGNR    mm6, mm0, 7, mm2
-    movq [r1+r3*1], mm6
-    psllq      mm0, 8
-    PALIGNR    mm5, mm0, 7, mm1
-    movq [r1+r3*2], mm5
-    psllq      mm0, 8
-    PALIGNR    mm6, mm0, 7, mm2
-    movq [r2+r3*1], mm6
-    psllq      mm0, 8
-    PALIGNR    mm5, mm0, 7, mm1
-    movq [r2+r3*2], mm5
-    psllq      mm0, 8
-    PALIGNR    mm6, mm0, 7, mm2
-    movq [r4+r3*1], mm6
-    psllq      mm0, 8
-    PALIGNR    mm5, mm0, 7, mm1
-    movq [r4+r3*2], mm5
-    RET
-
-%macro PRED8x8L_VERTICAL_RIGHT 0
-cglobal pred8x8l_vertical_right_8, 4,5,7
-    ; manually spill XMM registers for Win64 because
-    ; the code here is initialized with INIT_MMX
-    WIN64_SPILL_XMM 7
-    sub          r0, r3
-    lea          r4, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    punpckhbw   mm0, [r0+r3*0-8]
-    movq        mm1, [r4+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
-    mov          r4, r0
-    punpckhwd   mm1, mm0
-    lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
-    lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
-    lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r4]
-    mov          r0, r4
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    test        r1, r1
-    jnz .do_left
-.fix_lt_1:
-    movq        mm5, mm3
-    pxor        mm5, mm4
-    psrlq       mm5, 56
-    psllq       mm5, 48
-    pxor        mm1, mm5
-    jmp .do_left
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.do_left:
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq2dq    xmm0, mm2
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1
-    jz .fix_lt_2
-    test         r2, r2
-    jz .fix_tr_1
-.do_top:
-    PRED4x4_LOWPASS mm6, mm2, mm1, mm3, mm5
-    lea           r1, [r0+r3*2]
-    movq2dq     xmm4, mm6
-    pslldq      xmm4, 8
-    por         xmm0, xmm4
-    movdqa      xmm6, [pw_ff00]
-    movdqa      xmm1, xmm0
-    lea           r2, [r1+r3*2]
-    movdqa      xmm2, xmm0
-    movdqa      xmm3, xmm0
-    pslldq      xmm0, 1
-    pslldq      xmm1, 2
-    pavgb       xmm2, xmm0
-INIT_XMM cpuname
-    PRED4x4_LOWPASS xmm4, xmm3, xmm1, xmm0, xmm5
-    pandn       xmm6, xmm4
-    movdqa      xmm5, xmm4
-    psrlw       xmm4, 8
-    packuswb    xmm6, xmm4
-    movhlps     xmm4, xmm6
-    movhps [r0+r3*2], xmm5
-    movhps [r0+r3*1], xmm2
-    psrldq      xmm5, 4
-    movss       xmm5, xmm6
-    psrldq      xmm2, 4
-    movss       xmm2, xmm4
-    lea           r0, [r2+r3*2]
-    psrldq      xmm5, 1
-    psrldq      xmm2, 1
-    movq        [r0+r3*2], xmm5
-    movq        [r0+r3*1], xmm2
-    psrldq      xmm5, 1
-    psrldq      xmm2, 1
-    movq        [r2+r3*2], xmm5
-    movq        [r2+r3*1], xmm2
-    psrldq      xmm5, 1
-    psrldq      xmm2, 1
-    movq        [r1+r3*2], xmm5
-    movq        [r1+r3*1], xmm2
-    RET
-%endmacro
-
-INIT_MMX sse2
-PRED8x8L_VERTICAL_RIGHT
-INIT_MMX ssse3
-PRED8x8L_VERTICAL_RIGHT
-
-;-----------------------------------------------------------------------------
-;void pred8x8l_vertical_left_8(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED8x8L_VERTICAL_LEFT 0
-cglobal pred8x8l_vertical_left_8, 4,4
-    sub          r0, r3
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1
-    jz .fix_lt_2
-    test         r2, r2
-    jz .fix_tr_1
-    jmp .do_top
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.fix_tr_2:
-    punpckhbw   mm3, mm3
-    pshufw      mm1, mm3, 0xFF
-    jmp .do_topright
-.do_top:
-    PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
-    movq2dq    xmm4, mm4
-    test         r2, r2
-    jz .fix_tr_2
-    movq        mm0, [r0+8]
-    movq        mm5, mm0
-    movq        mm2, mm0
-    movq        mm4, mm0
-    psrlq       mm5, 56
-    PALIGNR     mm2, mm3, 7, mm3
-    PALIGNR     mm5, mm4, 1, mm4
-    PRED4x4_LOWPASS mm1, mm2, mm5, mm0, mm4
-.do_topright:
-    movq2dq   xmm3, mm1
-    lea         r1, [r0+r3*2]
-    pslldq    xmm3, 8
-    por       xmm4, xmm3
-    movdqa    xmm2, xmm4
-    movdqa    xmm1, xmm4
-    movdqa    xmm3, xmm4
-    psrldq    xmm2, 1
-    pslldq    xmm1, 1
-    pavgb     xmm3, xmm2
-    lea         r2, [r1+r3*2]
-INIT_XMM cpuname
-    PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm4, xmm5
-    psrldq    xmm0, 1
-    movq [r0+r3*1], xmm3
-    movq [r0+r3*2], xmm0
-    lea         r0, [r2+r3*2]
-    psrldq    xmm3, 1
-    psrldq    xmm0, 1
-    movq [r1+r3*1], xmm3
-    movq [r1+r3*2], xmm0
-    psrldq    xmm3, 1
-    psrldq    xmm0, 1
-    movq [r2+r3*1], xmm3
-    movq [r2+r3*2], xmm0
-    psrldq    xmm3, 1
-    psrldq    xmm0, 1
-    movq [r0+r3*1], xmm3
-    movq [r0+r3*2], xmm0
-    RET
-%endmacro
-
-INIT_MMX sse2
-PRED8x8L_VERTICAL_LEFT
-INIT_MMX ssse3
-PRED8x8L_VERTICAL_LEFT
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_horizontal_up_8(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED8x8L_HORIZONTAL_UP 0
-cglobal pred8x8l_horizontal_up_8, 4,4
-    sub          r0, r3
-    lea          r2, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    test         r1, r1
-    lea          r1, [r0+r3]
-    cmovnz       r1, r0
-    punpckhbw   mm0, [r1+r3*0-8]
-    movq        mm1, [r2+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
-    mov          r2, r0
-    punpckhwd   mm1, mm0
-    lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
-    lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
-    lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r1+r3*0-8]
-    mov          r0, r2
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    movq       mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq       mm4, mm0
-    movq       mm7, mm2
-    PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5
-    psllq      mm1, 56
-    PALIGNR    mm7, mm1, 7, mm3
-    lea         r1, [r0+r3*2]
-    pshufw     mm0, mm7, 00011011b ; l6 l7 l4 l5 l2 l3 l0 l1
-    psllq      mm7, 56             ; l7 .. .. .. .. .. .. ..
-    movq       mm2, mm0
-    psllw      mm0, 8
-    psrlw      mm2, 8
-    por        mm2, mm0            ; l7 l6 l5 l4 l3 l2 l1 l0
-    movq       mm3, mm2
-    movq       mm4, mm2
-    movq       mm5, mm2
-    psrlq      mm2, 8
-    psrlq      mm3, 16
-    lea         r2, [r1+r3*2]
-    por        mm2, mm7            ; l7 l7 l6 l5 l4 l3 l2 l1
-    punpckhbw  mm7, mm7
-    por        mm3, mm7            ; l7 l7 l7 l6 l5 l4 l3 l2
-    pavgb      mm4, mm2
-    PRED4x4_LOWPASS mm1, mm3, mm5, mm2, mm6
-    movq       mm5, mm4
-    punpcklbw  mm4, mm1            ; p4 p3 p2 p1
-    punpckhbw  mm5, mm1            ; p8 p7 p6 p5
-    movq       mm6, mm5
-    movq       mm7, mm5
-    movq       mm0, mm5
-    PALIGNR    mm5, mm4, 2, mm1
-    pshufw     mm1, mm6, 11111001b
-    PALIGNR    mm6, mm4, 4, mm2
-    pshufw     mm2, mm7, 11111110b
-    PALIGNR    mm7, mm4, 6, mm3
-    pshufw     mm3, mm0, 11111111b
-    movq [r0+r3*1], mm4
-    movq [r0+r3*2], mm5
-    lea         r0, [r2+r3*2]
-    movq [r1+r3*1], mm6
-    movq [r1+r3*2], mm7
-    movq [r2+r3*1], mm0
-    movq [r2+r3*2], mm1
-    movq [r0+r3*1], mm2
-    movq [r0+r3*2], mm3
-    RET
-%endmacro
-
-INIT_MMX mmxext
-PRED8x8L_HORIZONTAL_UP
-INIT_MMX ssse3
-PRED8x8L_HORIZONTAL_UP
-
-;-----------------------------------------------------------------------------
-;void pred8x8l_horizontal_down_8(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred8x8l_horizontal_down_8, 4,5
-    sub          r0, r3
-    lea          r4, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    punpckhbw   mm0, [r0+r3*0-8]
-    movq        mm1, [r4+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
-    mov          r4, r0
-    punpckhwd   mm1, mm0
-    lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
-    lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
-    lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r4]
-    mov          r0, r4
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    test        r1, r1
-    jnz .do_left
-.fix_lt_1:
-    movq        mm5, mm3
-    pxor        mm5, mm4
-    psrlq       mm5, 56
-    psllq       mm5, 48
-    pxor        mm1, mm5
-    jmp .do_left
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.do_left:
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq        mm4, mm0
-    movq        mm7, mm2
-    movq        mm6, mm2
-    PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5
-    psllq       mm1, 56
-    PALIGNR     mm7, mm1, 7, mm3
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1
-    jz .fix_lt_2
-    test         r2, r2
-    jz .fix_tr_1
-.do_top:
-    PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
-    movq       mm5, mm4
-    lea         r1, [r0+r3*2]
-    psllq      mm7, 56
-    movq       mm2, mm5
-    movq       mm3, mm6
-    movq       mm4, mm2
-    PALIGNR    mm2, mm6, 7, mm5
-    PALIGNR    mm6, mm7, 7, mm0
-    lea         r2, [r1+r3*2]
-    PALIGNR    mm4, mm3, 1, mm7
-    movq       mm5, mm3
-    pavgb      mm3, mm6
-    PRED4x4_LOWPASS mm0, mm4, mm6, mm5, mm7
-    movq       mm4, mm2
-    movq       mm1, mm2
-    lea         r4, [r2+r3*2]
-    psrlq      mm4, 16
-    psrlq      mm1, 8
-    PRED4x4_LOWPASS mm6, mm4, mm2, mm1, mm5
-    movq       mm7, mm3
-    punpcklbw  mm3, mm0
-    punpckhbw  mm7, mm0
-    movq       mm1, mm7
-    movq       mm0, mm7
-    movq       mm4, mm7
-    movq [r4+r3*2], mm3
-    PALIGNR    mm7, mm3, 2, mm5
-    movq [r4+r3*1], mm7
-    PALIGNR    mm1, mm3, 4, mm5
-    movq [r2+r3*2], mm1
-    PALIGNR    mm0, mm3, 6, mm3
-    movq [r2+r3*1], mm0
-    movq       mm2, mm6
-    movq       mm3, mm6
-    movq [r1+r3*2], mm4
-    PALIGNR    mm6, mm4, 2, mm5
-    movq [r1+r3*1], mm6
-    PALIGNR    mm2, mm4, 4, mm5
-    movq [r0+r3*2], mm2
-    PALIGNR    mm3, mm4, 6, mm4
-    movq [r0+r3*1], mm3
-    RET
-
-%macro PRED8x8L_HORIZONTAL_DOWN 0
-cglobal pred8x8l_horizontal_down_8, 4,5
-    sub          r0, r3
-    lea          r4, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    punpckhbw   mm0, [r0+r3*0-8]
-    movq        mm1, [r4+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
-    mov          r4, r0
-    punpckhwd   mm1, mm0
-    lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
-    lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
-    lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r4]
-    mov          r0, r4
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    test        r1, r1
-    jnz .do_left
-.fix_lt_1:
-    movq        mm5, mm3
-    pxor        mm5, mm4
-    psrlq       mm5, 56
-    psllq       mm5, 48
-    pxor        mm1, mm5
-    jmp .do_left
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test         r2, r2
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.fix_tr_2:
-    punpckhbw   mm3, mm3
-    pshufw      mm1, mm3, 0xFF
-    jmp .do_topright
-.do_left:
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq2dq    xmm0, mm2
-    pslldq     xmm0, 8
-    movq        mm4, mm0
-    PRED4x4_LOWPASS mm1, mm3, mm0, mm4, mm5
-    movq2dq    xmm2, mm1
-    pslldq     xmm2, 15
-    psrldq     xmm2, 8
-    por        xmm0, xmm2
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
-    test         r1, r1
-    jz .fix_lt_2
-    test         r2, r2
-    jz .fix_tr_1
-.do_top:
-    PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
-    movq2dq    xmm1, mm4
-    test         r2, r2
-    jz .fix_tr_2
-    movq        mm0, [r0+8]
-    movq        mm5, mm0
-    movq        mm2, mm0
-    movq        mm4, mm0
-    psrlq       mm5, 56
-    PALIGNR     mm2, mm3, 7, mm3
-    PALIGNR     mm5, mm4, 1, mm4
-    PRED4x4_LOWPASS mm1, mm2, mm5, mm0, mm4
-.do_topright:
-    movq2dq    xmm5, mm1
-    pslldq     xmm5, 8
-    por        xmm1, xmm5
-INIT_XMM cpuname
-    lea         r2, [r4+r3*2]
-    movdqa    xmm2, xmm1
-    movdqa    xmm3, xmm1
-    PALIGNR   xmm1, xmm0, 7, xmm4
-    PALIGNR   xmm2, xmm0, 9, xmm5
-    lea         r1, [r2+r3*2]
-    PALIGNR   xmm3, xmm0, 8, xmm0
-    movdqa    xmm4, xmm1
-    pavgb     xmm4, xmm3
-    lea         r0, [r1+r3*2]
-    PRED4x4_LOWPASS xmm0, xmm1, xmm2, xmm3, xmm5
-    punpcklbw xmm4, xmm0
-    movhlps   xmm0, xmm4
-    movq   [r0+r3*2], xmm4
-    movq   [r2+r3*2], xmm0
-    psrldq xmm4, 2
-    psrldq xmm0, 2
-    movq   [r0+r3*1], xmm4
-    movq   [r2+r3*1], xmm0
-    psrldq xmm4, 2
-    psrldq xmm0, 2
-    movq   [r1+r3*2], xmm4
-    movq   [r4+r3*2], xmm0
-    psrldq xmm4, 2
-    psrldq xmm0, 2
-    movq   [r1+r3*1], xmm4
-    movq   [r4+r3*1], xmm0
-    RET
-%endmacro
-
-INIT_MMX sse2
-PRED8x8L_HORIZONTAL_DOWN
-INIT_MMX ssse3
-PRED8x8L_HORIZONTAL_DOWN
-
-;-----------------------------------------------------------------------------
-; void pred4x4_dc_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred4x4_dc_8, 3,5
-    pxor   mm7, mm7
-    mov     r4, r0
-    sub     r0, r2
-    movd   mm0, [r0]
-    psadbw mm0, mm7
-    movzx  r1d, byte [r0+r2*1-1]
-    movd   r3d, mm0
-    add    r3d, r1d
-    movzx  r1d, byte [r0+r2*2-1]
-    lea     r0, [r0+r2*2]
-    add    r3d, r1d
-    movzx  r1d, byte [r0+r2*1-1]
-    add    r3d, r1d
-    movzx  r1d, byte [r0+r2*2-1]
-    add    r3d, r1d
-    add    r3d, 4
-    shr    r3d, 3
-    imul   r3d, 0x01010101
-    mov   [r4+r2*0], r3d
-    mov   [r0+r2*0], r3d
-    mov   [r0+r2*1], r3d
-    mov   [r0+r2*2], r3d
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred4x4_tm_vp8_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
-
-%macro PRED4x4_TM 0
-cglobal pred4x4_tm_vp8_8, 3,6
-    sub        r0, r2
-    pxor      mm7, mm7
-    movd      mm0, [r0]
-    punpcklbw mm0, mm7
-    movzx     r4d, byte [r0-1]
-    mov       r5d, 2
-.loop:
-    movzx     r1d, byte [r0+r2*1-1]
-    movzx     r3d, byte [r0+r2*2-1]
-    sub       r1d, r4d
-    sub       r3d, r4d
-    movd      mm2, r1d
-    movd      mm4, r3d
-%if cpuflag(mmxext)
-    pshufw    mm2, mm2, 0
-    pshufw    mm4, mm4, 0
-%else
-    punpcklwd mm2, mm2
-    punpcklwd mm4, mm4
-    punpckldq mm2, mm2
-    punpckldq mm4, mm4
-%endif
-    paddw     mm2, mm0
-    paddw     mm4, mm0
-    packuswb  mm2, mm2
-    packuswb  mm4, mm4
-    movd [r0+r2*1], mm2
-    movd [r0+r2*2], mm4
-    lea        r0, [r0+r2*2]
-    dec       r5d
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmx
-PRED4x4_TM
-INIT_MMX mmxext
-PRED4x4_TM
-
-INIT_XMM ssse3
-cglobal pred4x4_tm_vp8_8, 3,3
-    sub         r0, r2
-    movq       mm6, [tm_shuf]
-    pxor       mm1, mm1
-    movd       mm0, [r0]
-    punpcklbw  mm0, mm1
-    movd       mm7, [r0-4]
-    pshufb     mm7, mm6
-    lea         r1, [r0+r2*2]
-    movd       mm2, [r0+r2*1-4]
-    movd       mm3, [r0+r2*2-4]
-    movd       mm4, [r1+r2*1-4]
-    movd       mm5, [r1+r2*2-4]
-    pshufb     mm2, mm6
-    pshufb     mm3, mm6
-    pshufb     mm4, mm6
-    pshufb     mm5, mm6
-    psubw      mm2, mm7
-    psubw      mm3, mm7
-    psubw      mm4, mm7
-    psubw      mm5, mm7
-    paddw      mm2, mm0
-    paddw      mm3, mm0
-    paddw      mm4, mm0
-    paddw      mm5, mm0
-    packuswb   mm2, mm2
-    packuswb   mm3, mm3
-    packuswb   mm4, mm4
-    packuswb   mm5, mm5
-    movd [r0+r2*1], mm2
-    movd [r0+r2*2], mm3
-    movd [r1+r2*1], mm4
-    movd [r1+r2*2], mm5
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred4x4_vertical_vp8_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred4x4_vertical_vp8_8, 3,3
-    sub       r0, r2
-    movd      m1, [r0-1]
-    movd      m0, [r0]
-    mova      m2, m0   ;t0 t1 t2 t3
-    punpckldq m0, [r1] ;t0 t1 t2 t3 t4 t5 t6 t7
-    lea       r1, [r0+r2*2]
-    psrlq     m0, 8    ;t1 t2 t3 t4
-    PRED4x4_LOWPASS m3, m1, m0, m2, m4
-    movd [r0+r2*1], m3
-    movd [r0+r2*2], m3
-    movd [r1+r2*1], m3
-    movd [r1+r2*2], m3
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred4x4_down_left_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
-INIT_MMX mmxext
-cglobal pred4x4_down_left_8, 3,3
-    sub       r0, r2
-    movq      m1, [r0]
-    punpckldq m1, [r1]
-    movq      m2, m1
-    movq      m3, m1
-    psllq     m1, 8
-    pxor      m2, m1
-    psrlq     m2, 8
-    pxor      m2, m3
-    PRED4x4_LOWPASS m0, m1, m2, m3, m4
-    lea       r1, [r0+r2*2]
-    psrlq     m0, 8
-    movd      [r0+r2*1], m0
-    psrlq     m0, 8
-    movd      [r0+r2*2], m0
-    psrlq     m0, 8
-    movd      [r1+r2*1], m0
-    psrlq     m0, 8
-    movd      [r1+r2*2], m0
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred4x4_vertical_left_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred4x4_vertical_left_8, 3,3
-    sub       r0, r2
-    movq      m1, [r0]
-    punpckldq m1, [r1]
-    movq      m3, m1
-    movq      m2, m1
-    psrlq     m3, 8
-    psrlq     m2, 16
-    movq      m4, m3
-    pavgb     m4, m1
-    PRED4x4_LOWPASS m0, m1, m2, m3, m5
-    lea       r1, [r0+r2*2]
-    movh      [r0+r2*1], m4
-    movh      [r0+r2*2], m0
-    psrlq     m4, 8
-    psrlq     m0, 8
-    movh      [r1+r2*1], m4
-    movh      [r1+r2*2], m0
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred4x4_horizontal_up_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred4x4_horizontal_up_8, 3,3
-    sub       r0, r2
-    lea       r1, [r0+r2*2]
-    movd      m0, [r0+r2*1-4]
-    punpcklbw m0, [r0+r2*2-4]
-    movd      m1, [r1+r2*1-4]
-    punpcklbw m1, [r1+r2*2-4]
-    punpckhwd m0, m1
-    movq      m1, m0
-    punpckhbw m1, m1
-    pshufw    m1, m1, 0xFF
-    punpckhdq m0, m1
-    movq      m2, m0
-    movq      m3, m0
-    movq      m7, m0
-    psrlq     m2, 16
-    psrlq     m3, 8
-    pavgb     m7, m3
-    PRED4x4_LOWPASS m4, m0, m2, m3, m5
-    punpcklbw m7, m4
-    movd    [r0+r2*1], m7
-    psrlq    m7, 16
-    movd    [r0+r2*2], m7
-    psrlq    m7, 16
-    movd    [r1+r2*1], m7
-    movd    [r1+r2*2], m1
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred4x4_horizontal_down_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred4x4_horizontal_down_8, 3,3
-    sub       r0, r2
-    lea       r1, [r0+r2*2]
-    movh      m0, [r0-4]      ; lt ..
-    punpckldq m0, [r0]        ; t3 t2 t1 t0 lt .. .. ..
-    psllq     m0, 8           ; t2 t1 t0 lt .. .. .. ..
-    movd      m1, [r1+r2*2-4] ; l3
-    punpcklbw m1, [r1+r2*1-4] ; l2 l3
-    movd      m2, [r0+r2*2-4] ; l1
-    punpcklbw m2, [r0+r2*1-4] ; l0 l1
-    punpckhwd m1, m2          ; l0 l1 l2 l3
-    punpckhdq m1, m0          ; t2 t1 t0 lt l0 l1 l2 l3
-    movq      m0, m1
-    movq      m2, m1
-    movq      m5, m1
-    psrlq     m0, 16          ; .. .. t2 t1 t0 lt l0 l1
-    psrlq     m2, 8           ; .. t2 t1 t0 lt l0 l1 l2
-    pavgb     m5, m2
-    PRED4x4_LOWPASS m3, m1, m0, m2, m4
-    punpcklbw m5, m3
-    psrlq     m3, 32
-    PALIGNR   m3, m5, 6, m4
-    movh      [r1+r2*2], m5
-    psrlq     m5, 16
-    movh      [r1+r2*1], m5
-    psrlq     m5, 16
-    movh      [r0+r2*2], m5
-    movh      [r0+r2*1], m3
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred4x4_vertical_right_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred4x4_vertical_right_8, 3,3
-    sub     r0, r2
-    lea     r1, [r0+r2*2]
-    movh    m0, [r0]                    ; ........t3t2t1t0
-    movq    m5, m0
-    PALIGNR m0, [r0-8], 7, m1           ; ......t3t2t1t0lt
-    pavgb   m5, m0
-    PALIGNR m0, [r0+r2*1-8], 7, m1      ; ....t3t2t1t0ltl0
-    movq    m1, m0
-    PALIGNR m0, [r0+r2*2-8], 7, m2      ; ..t3t2t1t0ltl0l1
-    movq    m2, m0
-    PALIGNR m0, [r1+r2*1-8], 7, m3      ; t3t2t1t0ltl0l1l2
-    PRED4x4_LOWPASS m3, m1, m0, m2, m4
-    movq    m1, m3
-    psrlq   m3, 16
-    psllq   m1, 48
-    movh    [r0+r2*1], m5
-    movh    [r0+r2*2], m3
-    PALIGNR m5, m1, 7, m2
-    psllq   m1, 8
-    movh    [r1+r2*1], m5
-    PALIGNR m3, m1, 7, m1
-    movh    [r1+r2*2], m3
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred4x4_down_right_8_mmxext(uint8_t *src, const uint8_t *topright, int stride)
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmxext
-cglobal pred4x4_down_right_8, 3,3
-    sub       r0, r2
-    lea       r1, [r0+r2*2]
-    movq      m1, [r1-8]
-    movq      m2, [r0+r2*1-8]
-    punpckhbw m2, [r0-8]
-    movh      m3, [r0]
-    punpckhwd m1, m2
-    PALIGNR   m3, m1, 5, m1
-    movq      m1, m3
-    PALIGNR   m3, [r1+r2*1-8], 7, m4
-    movq      m2, m3
-    PALIGNR   m3, [r1+r2*2-8], 7, m4
-    PRED4x4_LOWPASS m0, m3, m1, m2, m4
-    movh      [r1+r2*2], m0
-    psrlq     m0, 8
-    movh      [r1+r2*1], m0
-    psrlq     m0, 8
-    movh      [r0+r2*2], m0
-    psrlq     m0, 8
-    movh      [r0+r2*1], m0
-    RET
diff --git a/deps/libav/libavcodec/x86/h264_intrapred_10bit.asm b/deps/libav/libavcodec/x86/h264_intrapred_10bit.asm
deleted file mode 100644
index 1b7974b..0000000
--- a/deps/libav/libavcodec/x86/h264_intrapred_10bit.asm
+++ /dev/null
@@ -1,1173 +0,0 @@
-;*****************************************************************************
-;* MMX/SSE2/AVX-optimized 10-bit H.264 intra prediction code
-;*****************************************************************************
-;* Copyright (C) 2005-2011 x264 project
-;*
-;* Authors: Daniel Kang <daniel.d.kang at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-cextern pw_16
-cextern pw_8
-cextern pw_4
-cextern pw_2
-cextern pw_1
-
-pw_m32101234: dw -3, -2, -1, 0, 1, 2, 3, 4
-pw_m3:        times 8 dw -3
-pw_pixel_max: times 8 dw ((1 << 10)-1)
-pw_512:       times 8 dw 512
-pd_17:        times 4 dd 17
-pd_16:        times 4 dd 16
-
-SECTION .text
-
-; dest, left, right, src
-; output: %1 = (t[n-1] + t[n]*2 + t[n+1] + 2) >> 2
-%macro PRED4x4_LOWPASS 4
-    paddw       %2, %3
-    psrlw       %2, 1
-    pavgw       %1, %4, %2
-%endmacro
-
-;-----------------------------------------------------------------------------
-; void pred4x4_down_right(pixel *src, const pixel *topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED4x4_DR 0
-cglobal pred4x4_down_right_10, 3, 3
-    sub       r0, r2
-    lea       r1, [r0+r2*2]
-    movhps    m1, [r1-8]
-    movhps    m2, [r0+r2*1-8]
-    movhps    m4, [r0-8]
-    punpckhwd m2, m4
-    movq      m3, [r0]
-    punpckhdq m1, m2
-    PALIGNR   m3, m1, 10, m1
-    movhps    m4, [r1+r2*1-8]
-    PALIGNR   m0, m3, m4, 14, m4
-    movhps    m4, [r1+r2*2-8]
-    PALIGNR   m2, m0, m4, 14, m4
-    PRED4x4_LOWPASS m0, m2, m3, m0
-    movq      [r1+r2*2], m0
-    psrldq    m0, 2
-    movq      [r1+r2*1], m0
-    psrldq    m0, 2
-    movq      [r0+r2*2], m0
-    psrldq    m0, 2
-    movq      [r0+r2*1], m0
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED4x4_DR
-INIT_XMM ssse3
-PRED4x4_DR
-INIT_XMM avx
-PRED4x4_DR
-
-;-----------------------------------------------------------------------------
-; void pred4x4_vertical_right(pixel *src, const pixel *topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED4x4_VR 0
-cglobal pred4x4_vertical_right_10, 3, 3, 6
-    sub     r0, r2
-    lea     r1, [r0+r2*2]
-    movq    m5, [r0]            ; ........t3t2t1t0
-    movhps  m1, [r0-8]
-    PALIGNR m0, m5, m1, 14, m1  ; ......t3t2t1t0lt
-    pavgw   m5, m0
-    movhps  m1, [r0+r2*1-8]
-    PALIGNR m0, m1, 14, m1      ; ....t3t2t1t0ltl0
-    movhps  m2, [r0+r2*2-8]
-    PALIGNR m1, m0, m2, 14, m2  ; ..t3t2t1t0ltl0l1
-    movhps  m3, [r1+r2*1-8]
-    PALIGNR m2, m1, m3, 14, m3  ; t3t2t1t0ltl0l1l2
-    PRED4x4_LOWPASS m1, m0, m2, m1
-    pslldq  m0, m1, 12
-    psrldq  m1, 4
-    movq    [r0+r2*1], m5
-    movq    [r0+r2*2], m1
-    PALIGNR m5, m0, 14, m2
-    pslldq  m0, 2
-    movq    [r1+r2*1], m5
-    PALIGNR m1, m0, 14, m0
-    movq    [r1+r2*2], m1
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED4x4_VR
-INIT_XMM ssse3
-PRED4x4_VR
-INIT_XMM avx
-PRED4x4_VR
-
-;-----------------------------------------------------------------------------
-; void pred4x4_horizontal_down(pixel *src, const pixel *topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED4x4_HD 0
-cglobal pred4x4_horizontal_down_10, 3, 3
-    sub        r0, r2
-    lea        r1, [r0+r2*2]
-    movq       m0, [r0-8]      ; lt ..
-    movhps     m0, [r0]
-    pslldq     m0, 2           ; t2 t1 t0 lt .. .. .. ..
-    movq       m1, [r1+r2*2-8] ; l3
-    movq       m3, [r1+r2*1-8]
-    punpcklwd  m1, m3          ; l2 l3
-    movq       m2, [r0+r2*2-8] ; l1
-    movq       m3, [r0+r2*1-8]
-    punpcklwd  m2, m3          ; l0 l1
-    punpckhdq  m1, m2          ; l0 l1 l2 l3
-    punpckhqdq m1, m0          ; t2 t1 t0 lt l0 l1 l2 l3
-    psrldq     m0, m1, 4       ; .. .. t2 t1 t0 lt l0 l1
-    psrldq     m3, m1, 2       ; .. t2 t1 t0 lt l0 l1 l2
-    pavgw      m5, m1, m3
-    PRED4x4_LOWPASS m3, m1, m0, m3
-    punpcklwd  m5, m3
-    psrldq     m3, 8
-    PALIGNR    m3, m5, 12, m4
-    movq       [r1+r2*2], m5
-    movhps     [r0+r2*2], m5
-    psrldq     m5, 4
-    movq       [r1+r2*1], m5
-    movq       [r0+r2*1], m3
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED4x4_HD
-INIT_XMM ssse3
-PRED4x4_HD
-INIT_XMM avx
-PRED4x4_HD
-
-;-----------------------------------------------------------------------------
-; void pred4x4_dc(pixel *src, const pixel *topright, int stride)
-;-----------------------------------------------------------------------------
-%macro HADDD 2 ; sum junk
-%if mmsize == 16
-    movhlps %2, %1
-    paddd   %1, %2
-    pshuflw %2, %1, 0xE
-    paddd   %1, %2
-%else
-    pshufw  %2, %1, 0xE
-    paddd   %1, %2
-%endif
-%endmacro
-
-%macro HADDW 2
-    pmaddwd %1, [pw_1]
-    HADDD   %1, %2
-%endmacro
-
-INIT_MMX mmxext
-cglobal pred4x4_dc_10, 3, 3
-    sub    r0, r2
-    lea    r1, [r0+r2*2]
-    movq   m2, [r0+r2*1-8]
-    paddw  m2, [r0+r2*2-8]
-    paddw  m2, [r1+r2*1-8]
-    paddw  m2, [r1+r2*2-8]
-    psrlq  m2, 48
-    movq   m0, [r0]
-    HADDW  m0, m1
-    paddw  m0, [pw_4]
-    paddw  m0, m2
-    psrlw  m0, 3
-    SPLATW m0, m0, 0
-    movq   [r0+r2*1], m0
-    movq   [r0+r2*2], m0
-    movq   [r1+r2*1], m0
-    movq   [r1+r2*2], m0
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred4x4_down_left(pixel *src, const pixel *topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED4x4_DL 0
-cglobal pred4x4_down_left_10, 3, 3
-    sub        r0, r2
-    movq       m0, [r0]
-    movhps     m0, [r1]
-    psrldq     m2, m0, 2
-    pslldq     m3, m0, 2
-    pshufhw    m2, m2, 10100100b
-    PRED4x4_LOWPASS m0, m3, m2, m0
-    lea        r1, [r0+r2*2]
-    movhps     [r1+r2*2], m0
-    psrldq     m0, 2
-    movq       [r0+r2*1], m0
-    psrldq     m0, 2
-    movq       [r0+r2*2], m0
-    psrldq     m0, 2
-    movq       [r1+r2*1], m0
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED4x4_DL
-INIT_XMM avx
-PRED4x4_DL
-
-;-----------------------------------------------------------------------------
-; void pred4x4_vertical_left(pixel *src, const pixel *topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED4x4_VL 0
-cglobal pred4x4_vertical_left_10, 3, 3
-    sub        r0, r2
-    movu       m1, [r0]
-    movhps     m1, [r1]
-    psrldq     m0, m1, 2
-    psrldq     m2, m1, 4
-    pavgw      m4, m0, m1
-    PRED4x4_LOWPASS m0, m1, m2, m0
-    lea        r1, [r0+r2*2]
-    movq       [r0+r2*1], m4
-    movq       [r0+r2*2], m0
-    psrldq     m4, 2
-    psrldq     m0, 2
-    movq       [r1+r2*1], m4
-    movq       [r1+r2*2], m0
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED4x4_VL
-INIT_XMM avx
-PRED4x4_VL
-
-;-----------------------------------------------------------------------------
-; void pred4x4_horizontal_up(pixel *src, const pixel *topright, int stride)
-;-----------------------------------------------------------------------------
-INIT_MMX mmxext
-cglobal pred4x4_horizontal_up_10, 3, 3
-    sub       r0, r2
-    lea       r1, [r0+r2*2]
-    movq      m0, [r0+r2*1-8]
-    punpckhwd m0, [r0+r2*2-8]
-    movq      m1, [r1+r2*1-8]
-    punpckhwd m1, [r1+r2*2-8]
-    punpckhdq m0, m1
-    pshufw    m1, m1, 0xFF
-    movq      [r1+r2*2], m1
-    movd      [r1+r2*1+4], m1
-    pshufw    m2, m0, 11111001b
-    movq      m1, m2
-    pavgw     m2, m0
-
-    pshufw    m5, m0, 11111110b
-    PRED4x4_LOWPASS m1, m0, m5, m1
-    movq      m6, m2
-    punpcklwd m6, m1
-    movq      [r0+r2*1], m6
-    psrlq     m2, 16
-    psrlq     m1, 16
-    punpcklwd m2, m1
-    movq      [r0+r2*2], m2
-    psrlq     m2, 32
-    movd      [r1+r2*1], m2
-    RET
-
-
-
-;-----------------------------------------------------------------------------
-; void pred8x8_vertical(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-INIT_XMM sse2
-cglobal pred8x8_vertical_10, 2, 2
-    sub  r0, r1
-    mova m0, [r0]
-%rep 3
-    mova [r0+r1*1], m0
-    mova [r0+r1*2], m0
-    lea  r0, [r0+r1*2]
-%endrep
-    mova [r0+r1*1], m0
-    mova [r0+r1*2], m0
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred8x8_horizontal(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-INIT_XMM sse2
-cglobal pred8x8_horizontal_10, 2, 3
-    mov         r2d, 4
-.loop:
-    movq         m0, [r0+r1*0-8]
-    movq         m1, [r0+r1*1-8]
-    pshuflw      m0, m0, 0xff
-    pshuflw      m1, m1, 0xff
-    punpcklqdq   m0, m0
-    punpcklqdq   m1, m1
-    mova  [r0+r1*0], m0
-    mova  [r0+r1*1], m1
-    lea          r0, [r0+r1*2]
-    dec          r2d
-    jg .loop
-    REP_RET
-
-;-----------------------------------------------------------------------------
-; void predict_8x8_dc(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MOV8 2-3
-; sort of a hack, but it works
-%if mmsize==8
-    movq    [%1+0], %2
-    movq    [%1+8], %3
-%else
-    movdqa    [%1], %2
-%endif
-%endmacro
-
-%macro PRED8x8_DC 1
-cglobal pred8x8_dc_10, 2, 6
-    sub         r0, r1
-    pxor        m4, m4
-    movq        m0, [r0+0]
-    movq        m1, [r0+8]
-%if mmsize==16
-    punpcklwd   m0, m1
-    movhlps     m1, m0
-    paddw       m0, m1
-%else
-    pshufw      m2, m0, 00001110b
-    pshufw      m3, m1, 00001110b
-    paddw       m0, m2
-    paddw       m1, m3
-    punpcklwd   m0, m1
-%endif
-    %1          m2, m0, 00001110b
-    paddw       m0, m2
-
-    lea         r5, [r1*3]
-    lea         r4, [r0+r1*4]
-    movzx      r2d, word [r0+r1*1-2]
-    movzx      r3d, word [r0+r1*2-2]
-    add        r2d, r3d
-    movzx      r3d, word [r0+r5*1-2]
-    add        r2d, r3d
-    movzx      r3d, word [r4-2]
-    add        r2d, r3d
-    movd        m2, r2d            ; s2
-
-    movzx      r2d, word [r4+r1*1-2]
-    movzx      r3d, word [r4+r1*2-2]
-    add        r2d, r3d
-    movzx      r3d, word [r4+r5*1-2]
-    add        r2d, r3d
-    movzx      r3d, word [r4+r1*4-2]
-    add        r2d, r3d
-    movd        m3, r2d            ; s3
-
-    punpcklwd   m2, m3
-    punpckldq   m0, m2            ; s0, s1, s2, s3
-    %1          m3, m0, 11110110b ; s2, s1, s3, s3
-    %1          m0, m0, 01110100b ; s0, s1, s3, s1
-    paddw       m0, m3
-    psrlw       m0, 2
-    pavgw       m0, m4            ; s0+s2, s1, s3, s1+s3
-%if mmsize==16
-    punpcklwd   m0, m0
-    pshufd      m3, m0, 11111010b
-    punpckldq   m0, m0
-    SWAP         0,1
-%else
-    pshufw      m1, m0, 0x00
-    pshufw      m2, m0, 0x55
-    pshufw      m3, m0, 0xaa
-    pshufw      m4, m0, 0xff
-%endif
-    MOV8   r0+r1*1, m1, m2
-    MOV8   r0+r1*2, m1, m2
-    MOV8   r0+r5*1, m1, m2
-    MOV8   r0+r1*4, m1, m2
-    MOV8   r4+r1*1, m3, m4
-    MOV8   r4+r1*2, m3, m4
-    MOV8   r4+r5*1, m3, m4
-    MOV8   r4+r1*4, m3, m4
-    RET
-%endmacro
-
-INIT_MMX mmxext
-PRED8x8_DC pshufw
-INIT_XMM sse2
-PRED8x8_DC pshuflw
-
-;-----------------------------------------------------------------------------
-; void pred8x8_top_dc(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-INIT_XMM sse2
-cglobal pred8x8_top_dc_10, 2, 4
-    sub         r0, r1
-    mova        m0, [r0]
-    pshuflw     m1, m0, 0x4e
-    pshufhw     m1, m1, 0x4e
-    paddw       m0, m1
-    pshuflw     m1, m0, 0xb1
-    pshufhw     m1, m1, 0xb1
-    paddw       m0, m1
-    lea         r2, [r1*3]
-    lea         r3, [r0+r1*4]
-    paddw       m0, [pw_2]
-    psrlw       m0, 2
-    mova [r0+r1*1], m0
-    mova [r0+r1*2], m0
-    mova [r0+r2*1], m0
-    mova [r0+r1*4], m0
-    mova [r3+r1*1], m0
-    mova [r3+r1*2], m0
-    mova [r3+r2*1], m0
-    mova [r3+r1*4], m0
-    RET
-
-;-----------------------------------------------------------------------------
-; void pred8x8_plane(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-INIT_XMM sse2
-cglobal pred8x8_plane_10, 2, 7, 7
-    sub       r0, r1
-    lea       r2, [r1*3]
-    lea       r3, [r0+r1*4]
-    mova      m2, [r0]
-    pmaddwd   m2, [pw_m32101234]
-    HADDD     m2, m1
-    movd      m0, [r0-4]
-    psrld     m0, 14
-    psubw     m2, m0               ; H
-    movd      m0, [r3+r1*4-4]
-    movd      m1, [r0+12]
-    paddw     m0, m1
-    psllw     m0, 4                ; 16*(src[7*stride-1] + src[-stride+7])
-    movzx    r4d, word [r3+r1*1-2] ; src[4*stride-1]
-    movzx    r5d, word [r0+r2*1-2] ; src[2*stride-1]
-    sub      r4d, r5d
-    movzx    r6d, word [r3+r1*2-2] ; src[5*stride-1]
-    movzx    r5d, word [r0+r1*2-2] ; src[1*stride-1]
-    sub      r6d, r5d
-    lea      r4d, [r4+r6*2]
-    movzx    r5d, word [r3+r2*1-2] ; src[6*stride-1]
-    movzx    r6d, word [r0+r1*1-2] ; src[0*stride-1]
-    sub      r5d, r6d
-    lea      r5d, [r5*3]
-    add      r4d, r5d
-    movzx    r6d, word [r3+r1*4-2] ; src[7*stride-1]
-    movzx    r5d, word [r0+r1*0-2] ; src[ -stride-1]
-    sub      r6d, r5d
-    lea      r4d, [r4+r6*4]
-    movd      m3, r4d              ; V
-    punpckldq m2, m3
-    pmaddwd   m2, [pd_17]
-    paddd     m2, [pd_16]
-    psrad     m2, 5                ; b, c
-
-    mova      m3, [pw_pixel_max]
-    pxor      m1, m1
-    SPLATW    m0, m0, 1
-    SPLATW    m4, m2, 2
-    SPLATW    m2, m2, 0
-    pmullw    m2, [pw_m32101234]   ; b
-    pmullw    m5, m4, [pw_m3]      ; c
-    paddw     m5, [pw_16]
-    mov      r2d, 8
-    add       r0, r1
-.loop:
-    paddsw    m6, m2, m5
-    paddsw    m6, m0
-    psraw     m6, 5
-    CLIPW     m6, m1, m3
-    mova    [r0], m6
-    paddw     m5, m4
-    add       r0, r1
-    dec r2d
-    jg .loop
-    REP_RET
-
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_128_dc(pixel *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED8x8L_128_DC 0
-cglobal pred8x8l_128_dc_10, 4, 4
-    mova      m0, [pw_512] ; (1<<(BIT_DEPTH-1))
-    lea       r1, [r3*3]
-    lea       r2, [r0+r3*4]
-    MOV8 r0+r3*0, m0, m0
-    MOV8 r0+r3*1, m0, m0
-    MOV8 r0+r3*2, m0, m0
-    MOV8 r0+r1*1, m0, m0
-    MOV8 r2+r3*0, m0, m0
-    MOV8 r2+r3*1, m0, m0
-    MOV8 r2+r3*2, m0, m0
-    MOV8 r2+r1*1, m0, m0
-    RET
-%endmacro
-
-INIT_MMX mmxext
-PRED8x8L_128_DC
-INIT_XMM sse2
-PRED8x8L_128_DC
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_top_dc(pixel *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED8x8L_TOP_DC 0
-cglobal pred8x8l_top_dc_10, 4, 4, 6
-    sub         r0, r3
-    mova        m0, [r0]
-    shr        r1d, 14
-    shr        r2d, 13
-    neg         r1
-    pslldq      m1, m0, 2
-    psrldq      m2, m0, 2
-    pinsrw      m1, [r0+r1], 0
-    pinsrw      m2, [r0+r2+14], 7
-    lea         r1, [r3*3]
-    lea         r2, [r0+r3*4]
-    PRED4x4_LOWPASS m0, m2, m1, m0
-    HADDW       m0, m1
-    paddw       m0, [pw_4]
-    psrlw       m0, 3
-    SPLATW      m0, m0, 0
-    mova [r0+r3*1], m0
-    mova [r0+r3*2], m0
-    mova [r0+r1*1], m0
-    mova [r0+r3*4], m0
-    mova [r2+r3*1], m0
-    mova [r2+r3*2], m0
-    mova [r2+r1*1], m0
-    mova [r2+r3*4], m0
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED8x8L_TOP_DC
-INIT_XMM avx
-PRED8x8L_TOP_DC
-
-;-----------------------------------------------------------------------------
-;void pred8x8l_dc(pixel *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-;TODO: see if scalar is faster
-%macro PRED8x8L_DC 0
-cglobal pred8x8l_dc_10, 4, 6, 6
-    sub         r0, r3
-    lea         r4, [r0+r3*4]
-    lea         r5, [r3*3]
-    mova        m0, [r0+r3*2-16]
-    punpckhwd   m0, [r0+r3*1-16]
-    mova        m1, [r4+r3*0-16]
-    punpckhwd   m1, [r0+r5*1-16]
-    punpckhdq   m1, m0
-    mova        m2, [r4+r3*2-16]
-    punpckhwd   m2, [r4+r3*1-16]
-    mova        m3, [r4+r3*4-16]
-    punpckhwd   m3, [r4+r5*1-16]
-    punpckhdq   m3, m2
-    punpckhqdq  m3, m1
-    mova        m0, [r0]
-    shr        r1d, 14
-    shr        r2d, 13
-    neg         r1
-    pslldq      m1, m0, 2
-    psrldq      m2, m0, 2
-    pinsrw      m1, [r0+r1], 0
-    pinsrw      m2, [r0+r2+14], 7
-    not         r1
-    and         r1, r3
-    pslldq      m4, m3, 2
-    psrldq      m5, m3, 2
-    pshuflw     m4, m4, 11100101b
-    pinsrw      m5, [r0+r1-2], 7
-    PRED4x4_LOWPASS m3, m4, m5, m3
-    PRED4x4_LOWPASS m0, m2, m1, m0
-    paddw       m0, m3
-    HADDW       m0, m1
-    paddw       m0, [pw_8]
-    psrlw       m0, 4
-    SPLATW      m0, m0
-    mova [r0+r3*1], m0
-    mova [r0+r3*2], m0
-    mova [r0+r5*1], m0
-    mova [r0+r3*4], m0
-    mova [r4+r3*1], m0
-    mova [r4+r3*2], m0
-    mova [r4+r5*1], m0
-    mova [r4+r3*4], m0
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED8x8L_DC
-INIT_XMM avx
-PRED8x8L_DC
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_vertical(pixel *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED8x8L_VERTICAL 0
-cglobal pred8x8l_vertical_10, 4, 4, 6
-    sub         r0, r3
-    mova        m0, [r0]
-    shr        r1d, 14
-    shr        r2d, 13
-    neg         r1
-    pslldq      m1, m0, 2
-    psrldq      m2, m0, 2
-    pinsrw      m1, [r0+r1], 0
-    pinsrw      m2, [r0+r2+14], 7
-    lea         r1, [r3*3]
-    lea         r2, [r0+r3*4]
-    PRED4x4_LOWPASS m0, m2, m1, m0
-    mova [r0+r3*1], m0
-    mova [r0+r3*2], m0
-    mova [r0+r1*1], m0
-    mova [r0+r3*4], m0
-    mova [r2+r3*1], m0
-    mova [r2+r3*2], m0
-    mova [r2+r1*1], m0
-    mova [r2+r3*4], m0
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED8x8L_VERTICAL
-INIT_XMM avx
-PRED8x8L_VERTICAL
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_horizontal(uint8_t *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED8x8L_HORIZONTAL 0
-cglobal pred8x8l_horizontal_10, 4, 4, 5
-    mova        m0, [r0-16]
-    shr        r1d, 14
-    dec         r1
-    and         r1, r3
-    sub         r1, r3
-    punpckhwd   m0, [r0+r1-16]
-    mova        m1, [r0+r3*2-16]
-    punpckhwd   m1, [r0+r3*1-16]
-    lea         r2, [r0+r3*4]
-    lea         r1, [r3*3]
-    punpckhdq   m1, m0
-    mova        m2, [r2+r3*0-16]
-    punpckhwd   m2, [r0+r1-16]
-    mova        m3, [r2+r3*2-16]
-    punpckhwd   m3, [r2+r3*1-16]
-    punpckhdq   m3, m2
-    punpckhqdq  m3, m1
-    PALIGNR     m4, m3, [r2+r1-16], 14, m0
-    pslldq      m0, m4, 2
-    pshuflw     m0, m0, 11100101b
-    PRED4x4_LOWPASS m4, m3, m0, m4
-    punpckhwd   m3, m4, m4
-    punpcklwd   m4, m4
-    pshufd      m0, m3, 0xff
-    pshufd      m1, m3, 0xaa
-    pshufd      m2, m3, 0x55
-    pshufd      m3, m3, 0x00
-    mova [r0+r3*0], m0
-    mova [r0+r3*1], m1
-    mova [r0+r3*2], m2
-    mova [r0+r1*1], m3
-    pshufd      m0, m4, 0xff
-    pshufd      m1, m4, 0xaa
-    pshufd      m2, m4, 0x55
-    pshufd      m3, m4, 0x00
-    mova [r2+r3*0], m0
-    mova [r2+r3*1], m1
-    mova [r2+r3*2], m2
-    mova [r2+r1*1], m3
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED8x8L_HORIZONTAL
-INIT_XMM ssse3
-PRED8x8L_HORIZONTAL
-INIT_XMM avx
-PRED8x8L_HORIZONTAL
-
-;-----------------------------------------------------------------------------
-;void pred8x8l_down_left(pixel *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED8x8L_DOWN_LEFT 0
-cglobal pred8x8l_down_left_10, 4, 4, 7
-    sub         r0, r3
-    mova        m3, [r0]
-    shr        r1d, 14
-    neg         r1
-    shr        r2d, 13
-    pslldq      m1, m3, 2
-    psrldq      m2, m3, 2
-    pinsrw      m1, [r0+r1], 0
-    pinsrw      m2, [r0+r2+14], 7
-    PRED4x4_LOWPASS m6, m2, m1, m3
-    jz .fix_tr ; flags from shr r2d
-    mova        m1, [r0+16]
-    psrldq      m5, m1, 2
-    PALIGNR     m2, m1, m3, 14, m3
-    pshufhw     m5, m5, 10100100b
-    PRED4x4_LOWPASS m1, m2, m5, m1
-.do_topright:
-    lea         r1, [r3*3]
-    psrldq      m5, m1, 14
-    lea         r2, [r0+r3*4]
-    PALIGNR     m2, m1, m6,  2, m0
-    PALIGNR     m3, m1, m6, 14, m0
-    PALIGNR     m5, m1,  2, m0
-    pslldq      m4, m6, 2
-    PRED4x4_LOWPASS m6, m4, m2, m6
-    PRED4x4_LOWPASS m1, m3, m5, m1
-    mova [r2+r3*4], m1
-    PALIGNR     m1, m6, 14, m2
-    pslldq      m6, 2
-    mova [r2+r1*1], m1
-    PALIGNR     m1, m6, 14, m2
-    pslldq      m6, 2
-    mova [r2+r3*2], m1
-    PALIGNR     m1, m6, 14, m2
-    pslldq      m6, 2
-    mova [r2+r3*1], m1
-    PALIGNR     m1, m6, 14, m2
-    pslldq      m6, 2
-    mova [r0+r3*4], m1
-    PALIGNR     m1, m6, 14, m2
-    pslldq      m6, 2
-    mova [r0+r1*1], m1
-    PALIGNR     m1, m6, 14, m2
-    pslldq      m6, 2
-    mova [r0+r3*2], m1
-    PALIGNR     m1, m6, 14, m6
-    mova [r0+r3*1], m1
-    RET
-.fix_tr:
-    punpckhwd   m3, m3
-    pshufd      m1, m3, 0xFF
-    jmp .do_topright
-%endmacro
-
-INIT_XMM sse2
-PRED8x8L_DOWN_LEFT
-INIT_XMM ssse3
-PRED8x8L_DOWN_LEFT
-INIT_XMM avx
-PRED8x8L_DOWN_LEFT
-
-;-----------------------------------------------------------------------------
-;void pred8x8l_down_right(pixel *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED8x8L_DOWN_RIGHT 0
-; standard forbids this when has_topleft is false
-; no need to check
-cglobal pred8x8l_down_right_10, 4, 5, 8
-    sub         r0, r3
-    lea         r4, [r0+r3*4]
-    lea         r1, [r3*3]
-    mova        m0, [r0+r3*1-16]
-    punpckhwd   m0, [r0+r3*0-16]
-    mova        m1, [r0+r1*1-16]
-    punpckhwd   m1, [r0+r3*2-16]
-    punpckhdq   m1, m0
-    mova        m2, [r4+r3*1-16]
-    punpckhwd   m2, [r4+r3*0-16]
-    mova        m3, [r4+r1*1-16]
-    punpckhwd   m3, [r4+r3*2-16]
-    punpckhdq   m3, m2
-    punpckhqdq  m3, m1
-    mova        m0, [r4+r3*4-16]
-    mova        m1, [r0]
-    PALIGNR     m4, m3, m0, 14, m0
-    PALIGNR     m1, m3,  2, m2
-    pslldq      m0, m4, 2
-    pshuflw     m0, m0, 11100101b
-    PRED4x4_LOWPASS m6, m1, m4, m3
-    PRED4x4_LOWPASS m4, m3, m0, m4
-    mova        m3, [r0]
-    shr        r2d, 13
-    pslldq      m1, m3, 2
-    psrldq      m2, m3, 2
-    pinsrw      m1, [r0-2], 0
-    pinsrw      m2, [r0+r2+14], 7
-    PRED4x4_LOWPASS m3, m2, m1, m3
-    PALIGNR     m2, m3, m6,  2, m0
-    PALIGNR     m5, m3, m6, 14, m0
-    psrldq      m7, m3, 2
-    PRED4x4_LOWPASS m6, m4, m2, m6
-    PRED4x4_LOWPASS m3, m5, m7, m3
-    mova [r4+r3*4], m6
-    PALIGNR     m3, m6, 14, m2
-    pslldq      m6, 2
-    mova [r0+r3*1], m3
-    PALIGNR     m3, m6, 14, m2
-    pslldq      m6, 2
-    mova [r0+r3*2], m3
-    PALIGNR     m3, m6, 14, m2
-    pslldq      m6, 2
-    mova [r0+r1*1], m3
-    PALIGNR     m3, m6, 14, m2
-    pslldq      m6, 2
-    mova [r0+r3*4], m3
-    PALIGNR     m3, m6, 14, m2
-    pslldq      m6, 2
-    mova [r4+r3*1], m3
-    PALIGNR     m3, m6, 14, m2
-    pslldq      m6, 2
-    mova [r4+r3*2], m3
-    PALIGNR     m3, m6, 14, m6
-    mova [r4+r1*1], m3
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED8x8L_DOWN_RIGHT
-INIT_XMM ssse3
-PRED8x8L_DOWN_RIGHT
-INIT_XMM avx
-PRED8x8L_DOWN_RIGHT
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_vertical_right(pixel *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED8x8L_VERTICAL_RIGHT 0
-; likewise with 8x8l_down_right
-cglobal pred8x8l_vertical_right_10, 4, 5, 7
-    sub         r0, r3
-    lea         r4, [r0+r3*4]
-    lea         r1, [r3*3]
-    mova        m0, [r0+r3*1-16]
-    punpckhwd   m0, [r0+r3*0-16]
-    mova        m1, [r0+r1*1-16]
-    punpckhwd   m1, [r0+r3*2-16]
-    punpckhdq   m1, m0
-    mova        m2, [r4+r3*1-16]
-    punpckhwd   m2, [r4+r3*0-16]
-    mova        m3, [r4+r1*1-16]
-    punpckhwd   m3, [r4+r3*2-16]
-    punpckhdq   m3, m2
-    punpckhqdq  m3, m1
-    mova        m0, [r4+r3*4-16]
-    mova        m1, [r0]
-    PALIGNR     m4, m3, m0, 14, m0
-    PALIGNR     m1, m3,  2, m2
-    PRED4x4_LOWPASS m3, m1, m4, m3
-    mova        m2, [r0]
-    shr        r2d, 13
-    pslldq      m1, m2, 2
-    psrldq      m5, m2, 2
-    pinsrw      m1, [r0-2], 0
-    pinsrw      m5, [r0+r2+14], 7
-    PRED4x4_LOWPASS m2, m5, m1, m2
-    PALIGNR     m6, m2, m3, 12, m1
-    PALIGNR     m5, m2, m3, 14, m0
-    PRED4x4_LOWPASS m0, m6, m2, m5
-    pavgw       m2, m5
-    mova [r0+r3*2], m0
-    mova [r0+r3*1], m2
-    pslldq      m6, m3, 4
-    pslldq      m1, m3, 2
-    PRED4x4_LOWPASS m1, m3, m6, m1
-    PALIGNR     m2, m1, 14, m4
-    mova [r0+r1*1], m2
-    pslldq      m1, 2
-    PALIGNR     m0, m1, 14, m3
-    mova [r0+r3*4], m0
-    pslldq      m1, 2
-    PALIGNR     m2, m1, 14, m4
-    mova [r4+r3*1], m2
-    pslldq      m1, 2
-    PALIGNR     m0, m1, 14, m3
-    mova [r4+r3*2], m0
-    pslldq      m1, 2
-    PALIGNR     m2, m1, 14, m4
-    mova [r4+r1*1], m2
-    pslldq      m1, 2
-    PALIGNR     m0, m1, 14, m1
-    mova [r4+r3*4], m0
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED8x8L_VERTICAL_RIGHT
-INIT_XMM ssse3
-PRED8x8L_VERTICAL_RIGHT
-INIT_XMM avx
-PRED8x8L_VERTICAL_RIGHT
-
-;-----------------------------------------------------------------------------
-; void pred8x8l_horizontal_up(pixel *src, int has_topleft, int has_topright, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED8x8L_HORIZONTAL_UP 0
-cglobal pred8x8l_horizontal_up_10, 4, 4, 6
-    mova        m0, [r0+r3*0-16]
-    punpckhwd   m0, [r0+r3*1-16]
-    shr        r1d, 14
-    dec         r1
-    and         r1, r3
-    sub         r1, r3
-    mova        m4, [r0+r1*1-16]
-    lea         r1, [r3*3]
-    lea         r2, [r0+r3*4]
-    mova        m1, [r0+r3*2-16]
-    punpckhwd   m1, [r0+r1*1-16]
-    punpckhdq   m0, m1
-    mova        m2, [r2+r3*0-16]
-    punpckhwd   m2, [r2+r3*1-16]
-    mova        m3, [r2+r3*2-16]
-    punpckhwd   m3, [r2+r1*1-16]
-    punpckhdq   m2, m3
-    punpckhqdq  m0, m2
-    PALIGNR     m1, m0, m4, 14, m4
-    psrldq      m2, m0, 2
-    pshufhw     m2, m2, 10100100b
-    PRED4x4_LOWPASS m0, m1, m2, m0
-    psrldq      m1, m0, 2
-    psrldq      m2, m0, 4
-    pshufhw     m1, m1, 10100100b
-    pshufhw     m2, m2, 01010100b
-    pavgw       m4, m0, m1
-    PRED4x4_LOWPASS m1, m2, m0, m1
-    punpckhwd   m5, m4, m1
-    punpcklwd   m4, m1
-    mova [r2+r3*0], m5
-    mova [r0+r3*0], m4
-    pshufd      m0, m5, 11111001b
-    pshufd      m1, m5, 11111110b
-    pshufd      m2, m5, 11111111b
-    mova [r2+r3*1], m0
-    mova [r2+r3*2], m1
-    mova [r2+r1*1], m2
-    PALIGNR     m2, m5, m4, 4, m0
-    PALIGNR     m3, m5, m4, 8, m1
-    PALIGNR     m5, m5, m4, 12, m4
-    mova [r0+r3*1], m2
-    mova [r0+r3*2], m3
-    mova [r0+r1*1], m5
-    RET
-%endmacro
-
-INIT_XMM sse2
-PRED8x8L_HORIZONTAL_UP
-INIT_XMM ssse3
-PRED8x8L_HORIZONTAL_UP
-INIT_XMM avx
-PRED8x8L_HORIZONTAL_UP
-
-
-;-----------------------------------------------------------------------------
-; void pred16x16_vertical(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MOV16 3-5
-    mova [%1+     0], %2
-    mova [%1+mmsize], %3
-%if mmsize==8
-    mova [%1+    16], %4
-    mova [%1+    24], %5
-%endif
-%endmacro
-
-%macro PRED16x16_VERTICAL 0
-cglobal pred16x16_vertical_10, 2, 3
-    sub   r0, r1
-    mov  r2d, 8
-    mova  m0, [r0+ 0]
-    mova  m1, [r0+mmsize]
-%if mmsize==8
-    mova  m2, [r0+16]
-    mova  m3, [r0+24]
-%endif
-.loop:
-    MOV16 r0+r1*1, m0, m1, m2, m3
-    MOV16 r0+r1*2, m0, m1, m2, m3
-    lea   r0, [r0+r1*2]
-    dec   r2d
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PRED16x16_VERTICAL
-INIT_XMM sse2
-PRED16x16_VERTICAL
-
-;-----------------------------------------------------------------------------
-; void pred16x16_horizontal(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED16x16_HORIZONTAL 0
-cglobal pred16x16_horizontal_10, 2, 3
-    mov   r2d, 8
-.vloop:
-    movd   m0, [r0+r1*0-4]
-    movd   m1, [r0+r1*1-4]
-    SPLATW m0, m0, 1
-    SPLATW m1, m1, 1
-    MOV16  r0+r1*0, m0, m0, m0, m0
-    MOV16  r0+r1*1, m1, m1, m1, m1
-    lea    r0, [r0+r1*2]
-    dec    r2d
-    jg .vloop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PRED16x16_HORIZONTAL
-INIT_XMM sse2
-PRED16x16_HORIZONTAL
-
-;-----------------------------------------------------------------------------
-; void pred16x16_dc(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED16x16_DC 0
-cglobal pred16x16_dc_10, 2, 6
-    mov        r5, r0
-    sub        r0, r1
-    mova       m0, [r0+0]
-    paddw      m0, [r0+mmsize]
-%if mmsize==8
-    paddw      m0, [r0+16]
-    paddw      m0, [r0+24]
-%endif
-    HADDW      m0, m2
-
-    lea        r0, [r0+r1-2]
-    movzx     r3d, word [r0]
-    movzx     r4d, word [r0+r1]
-%rep 7
-    lea        r0, [r0+r1*2]
-    movzx     r2d, word [r0]
-    add       r3d, r2d
-    movzx     r2d, word [r0+r1]
-    add       r4d, r2d
-%endrep
-    lea       r3d, [r3+r4+16]
-
-    movd       m1, r3d
-    paddw      m0, m1
-    psrlw      m0, 5
-    SPLATW     m0, m0
-    mov       r3d, 8
-.loop:
-    MOV16 r5+r1*0, m0, m0, m0, m0
-    MOV16 r5+r1*1, m0, m0, m0, m0
-    lea        r5, [r5+r1*2]
-    dec       r3d
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PRED16x16_DC
-INIT_XMM sse2
-PRED16x16_DC
-
-;-----------------------------------------------------------------------------
-; void pred16x16_top_dc(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED16x16_TOP_DC 0
-cglobal pred16x16_top_dc_10, 2, 3
-    sub        r0, r1
-    mova       m0, [r0+0]
-    paddw      m0, [r0+mmsize]
-%if mmsize==8
-    paddw      m0, [r0+16]
-    paddw      m0, [r0+24]
-%endif
-    HADDW      m0, m2
-
-    SPLATW     m0, m0
-    paddw      m0, [pw_8]
-    psrlw      m0, 4
-    mov       r2d, 8
-.loop:
-    MOV16 r0+r1*1, m0, m0, m0, m0
-    MOV16 r0+r1*2, m0, m0, m0, m0
-    lea        r0, [r0+r1*2]
-    dec       r2d
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PRED16x16_TOP_DC
-INIT_XMM sse2
-PRED16x16_TOP_DC
-
-;-----------------------------------------------------------------------------
-; void pred16x16_left_dc(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED16x16_LEFT_DC 0
-cglobal pred16x16_left_dc_10, 2, 6
-    mov        r5, r0
-
-    sub        r0, 2
-    movzx     r3d, word [r0]
-    movzx     r4d, word [r0+r1]
-%rep 7
-    lea        r0, [r0+r1*2]
-    movzx     r2d, word [r0]
-    add       r3d, r2d
-    movzx     r2d, word [r0+r1]
-    add       r4d, r2d
-%endrep
-    lea       r3d, [r3+r4+8]
-    shr       r3d, 4
-
-    movd       m0, r3d
-    SPLATW     m0, m0
-    mov       r3d, 8
-.loop:
-    MOV16 r5+r1*0, m0, m0, m0, m0
-    MOV16 r5+r1*1, m0, m0, m0, m0
-    lea        r5, [r5+r1*2]
-    dec       r3d
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PRED16x16_LEFT_DC
-INIT_XMM sse2
-PRED16x16_LEFT_DC
-
-;-----------------------------------------------------------------------------
-; void pred16x16_128_dc(pixel *src, int stride)
-;-----------------------------------------------------------------------------
-%macro PRED16x16_128_DC 0
-cglobal pred16x16_128_dc_10, 2,3
-    mova       m0, [pw_512]
-    mov       r2d, 8
-.loop:
-    MOV16 r0+r1*0, m0, m0, m0, m0
-    MOV16 r0+r1*1, m0, m0, m0, m0
-    lea        r0, [r0+r1*2]
-    dec       r2d
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PRED16x16_128_DC
-INIT_XMM sse2
-PRED16x16_128_DC
diff --git a/deps/libav/libavcodec/x86/h264_intrapred_init.c b/deps/libav/libavcodec/x86/h264_intrapred_init.c
deleted file mode 100644
index f934256..0000000
--- a/deps/libav/libavcodec/x86/h264_intrapred_init.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * Copyright (c) 2010 Jason Garrett-Glaser
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/h264pred.h"
-
-#define PRED4x4(TYPE, DEPTH, OPT) \
-void ff_pred4x4_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, \
-                                                    const uint8_t *topright, \
-                                                    ptrdiff_t stride);
-
-PRED4x4(dc, 10, mmxext)
-PRED4x4(down_left, 10, sse2)
-PRED4x4(down_left, 10, avx)
-PRED4x4(down_right, 10, sse2)
-PRED4x4(down_right, 10, ssse3)
-PRED4x4(down_right, 10, avx)
-PRED4x4(vertical_left, 10, sse2)
-PRED4x4(vertical_left, 10, avx)
-PRED4x4(vertical_right, 10, sse2)
-PRED4x4(vertical_right, 10, ssse3)
-PRED4x4(vertical_right, 10, avx)
-PRED4x4(horizontal_up, 10, mmxext)
-PRED4x4(horizontal_down, 10, sse2)
-PRED4x4(horizontal_down, 10, ssse3)
-PRED4x4(horizontal_down, 10, avx)
-
-#define PRED8x8(TYPE, DEPTH, OPT) \
-void ff_pred8x8_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, \
-                                                    ptrdiff_t stride);
-
-PRED8x8(dc, 10, mmxext)
-PRED8x8(dc, 10, sse2)
-PRED8x8(top_dc, 10, sse2)
-PRED8x8(plane, 10, sse2)
-PRED8x8(vertical, 10, sse2)
-PRED8x8(horizontal, 10, sse2)
-
-#define PRED8x8L(TYPE, DEPTH, OPT)\
-void ff_pred8x8l_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, \
-                                                     int has_topleft, \
-                                                     int has_topright, \
-                                                     ptrdiff_t stride);
-
-PRED8x8L(dc, 10, sse2)
-PRED8x8L(dc, 10, avx)
-PRED8x8L(128_dc, 10, mmxext)
-PRED8x8L(128_dc, 10, sse2)
-PRED8x8L(top_dc, 10, sse2)
-PRED8x8L(top_dc, 10, avx)
-PRED8x8L(vertical, 10, sse2)
-PRED8x8L(vertical, 10, avx)
-PRED8x8L(horizontal, 10, sse2)
-PRED8x8L(horizontal, 10, ssse3)
-PRED8x8L(horizontal, 10, avx)
-PRED8x8L(down_left, 10, sse2)
-PRED8x8L(down_left, 10, ssse3)
-PRED8x8L(down_left, 10, avx)
-PRED8x8L(down_right, 10, sse2)
-PRED8x8L(down_right, 10, ssse3)
-PRED8x8L(down_right, 10, avx)
-PRED8x8L(vertical_right, 10, sse2)
-PRED8x8L(vertical_right, 10, ssse3)
-PRED8x8L(vertical_right, 10, avx)
-PRED8x8L(horizontal_up, 10, sse2)
-PRED8x8L(horizontal_up, 10, ssse3)
-PRED8x8L(horizontal_up, 10, avx)
-
-#define PRED16x16(TYPE, DEPTH, OPT)\
-void ff_pred16x16_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, \
-                                                      ptrdiff_t stride);
-
-PRED16x16(dc, 10, mmxext)
-PRED16x16(dc, 10, sse2)
-PRED16x16(top_dc, 10, mmxext)
-PRED16x16(top_dc, 10, sse2)
-PRED16x16(128_dc, 10, mmxext)
-PRED16x16(128_dc, 10, sse2)
-PRED16x16(left_dc, 10, mmxext)
-PRED16x16(left_dc, 10, sse2)
-PRED16x16(vertical, 10, mmxext)
-PRED16x16(vertical, 10, sse2)
-PRED16x16(horizontal, 10, mmxext)
-PRED16x16(horizontal, 10, sse2)
-
-/* 8-bit versions */
-PRED16x16(vertical, 8, mmx)
-PRED16x16(vertical, 8, sse)
-PRED16x16(horizontal, 8, mmx)
-PRED16x16(horizontal, 8, mmxext)
-PRED16x16(horizontal, 8, ssse3)
-PRED16x16(dc, 8, mmxext)
-PRED16x16(dc, 8, sse2)
-PRED16x16(dc, 8, ssse3)
-PRED16x16(plane_h264, 8, mmx)
-PRED16x16(plane_h264, 8, mmxext)
-PRED16x16(plane_h264, 8, sse2)
-PRED16x16(plane_h264, 8, ssse3)
-PRED16x16(plane_rv40, 8, mmx)
-PRED16x16(plane_rv40, 8, mmxext)
-PRED16x16(plane_rv40, 8, sse2)
-PRED16x16(plane_rv40, 8, ssse3)
-PRED16x16(plane_svq3, 8, mmx)
-PRED16x16(plane_svq3, 8, mmxext)
-PRED16x16(plane_svq3, 8, sse2)
-PRED16x16(plane_svq3, 8, ssse3)
-PRED16x16(tm_vp8, 8, mmx)
-PRED16x16(tm_vp8, 8, mmxext)
-PRED16x16(tm_vp8, 8, sse2)
-
-PRED8x8(top_dc, 8, mmxext)
-PRED8x8(dc_rv40, 8, mmxext)
-PRED8x8(dc, 8, mmxext)
-PRED8x8(vertical, 8, mmx)
-PRED8x8(horizontal, 8, mmx)
-PRED8x8(horizontal, 8, mmxext)
-PRED8x8(horizontal, 8, ssse3)
-PRED8x8(plane, 8, mmx)
-PRED8x8(plane, 8, mmxext)
-PRED8x8(plane, 8, sse2)
-PRED8x8(plane, 8, ssse3)
-PRED8x8(tm_vp8, 8, mmx)
-PRED8x8(tm_vp8, 8, mmxext)
-PRED8x8(tm_vp8, 8, sse2)
-PRED8x8(tm_vp8, 8, ssse3)
-
-PRED8x8L(top_dc, 8, mmxext)
-PRED8x8L(top_dc, 8, ssse3)
-PRED8x8L(dc, 8, mmxext)
-PRED8x8L(dc, 8, ssse3)
-PRED8x8L(horizontal, 8, mmxext)
-PRED8x8L(horizontal, 8, ssse3)
-PRED8x8L(vertical, 8, mmxext)
-PRED8x8L(vertical, 8, ssse3)
-PRED8x8L(down_left, 8, mmxext)
-PRED8x8L(down_left, 8, sse2)
-PRED8x8L(down_left, 8, ssse3)
-PRED8x8L(down_right, 8, mmxext)
-PRED8x8L(down_right, 8, sse2)
-PRED8x8L(down_right, 8, ssse3)
-PRED8x8L(vertical_right, 8, mmxext)
-PRED8x8L(vertical_right, 8, sse2)
-PRED8x8L(vertical_right, 8, ssse3)
-PRED8x8L(vertical_left, 8, sse2)
-PRED8x8L(vertical_left, 8, ssse3)
-PRED8x8L(horizontal_up, 8, mmxext)
-PRED8x8L(horizontal_up, 8, ssse3)
-PRED8x8L(horizontal_down, 8, mmxext)
-PRED8x8L(horizontal_down, 8, sse2)
-PRED8x8L(horizontal_down, 8, ssse3)
-
-PRED4x4(dc, 8, mmxext)
-PRED4x4(down_left, 8, mmxext)
-PRED4x4(down_right, 8, mmxext)
-PRED4x4(vertical_left, 8, mmxext)
-PRED4x4(vertical_right, 8, mmxext)
-PRED4x4(horizontal_up, 8, mmxext)
-PRED4x4(horizontal_down, 8, mmxext)
-PRED4x4(tm_vp8, 8, mmx)
-PRED4x4(tm_vp8, 8, mmxext)
-PRED4x4(tm_vp8, 8, ssse3)
-PRED4x4(vertical_vp8, 8, mmxext)
-
-av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
-                                   const int bit_depth,
-                                   const int chroma_format_idc)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (bit_depth == 8) {
-        if (EXTERNAL_MMX(cpu_flags)) {
-            h->pred16x16[VERT_PRED8x8         ] = ff_pred16x16_vertical_8_mmx;
-            h->pred16x16[HOR_PRED8x8          ] = ff_pred16x16_horizontal_8_mmx;
-            if (chroma_format_idc <= 1) {
-                h->pred8x8  [VERT_PRED8x8     ] = ff_pred8x8_vertical_8_mmx;
-                h->pred8x8  [HOR_PRED8x8      ] = ff_pred8x8_horizontal_8_mmx;
-            }
-            if (codec_id == AV_CODEC_ID_VP8) {
-                h->pred16x16[PLANE_PRED8x8    ] = ff_pred16x16_tm_vp8_8_mmx;
-                h->pred8x8  [PLANE_PRED8x8    ] = ff_pred8x8_tm_vp8_8_mmx;
-                h->pred4x4  [TM_VP8_PRED      ] = ff_pred4x4_tm_vp8_8_mmx;
-            } else {
-                if (chroma_format_idc <= 1)
-                    h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_8_mmx;
-                if (codec_id == AV_CODEC_ID_SVQ3) {
-                    if (cpu_flags & AV_CPU_FLAG_CMOV)
-                        h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_8_mmx;
-                } else if (codec_id == AV_CODEC_ID_RV40) {
-                    h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_8_mmx;
-                } else {
-                    h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_8_mmx;
-                }
-            }
-        }
-
-        if (EXTERNAL_MMXEXT(cpu_flags)) {
-            h->pred16x16[HOR_PRED8x8            ] = ff_pred16x16_horizontal_8_mmxext;
-            h->pred16x16[DC_PRED8x8             ] = ff_pred16x16_dc_8_mmxext;
-            if (chroma_format_idc <= 1)
-                h->pred8x8[HOR_PRED8x8          ] = ff_pred8x8_horizontal_8_mmxext;
-            h->pred8x8l [TOP_DC_PRED            ] = ff_pred8x8l_top_dc_8_mmxext;
-            h->pred8x8l [DC_PRED                ] = ff_pred8x8l_dc_8_mmxext;
-            h->pred8x8l [HOR_PRED               ] = ff_pred8x8l_horizontal_8_mmxext;
-            h->pred8x8l [VERT_PRED              ] = ff_pred8x8l_vertical_8_mmxext;
-            h->pred8x8l [DIAG_DOWN_RIGHT_PRED   ] = ff_pred8x8l_down_right_8_mmxext;
-            h->pred8x8l [VERT_RIGHT_PRED        ] = ff_pred8x8l_vertical_right_8_mmxext;
-            h->pred8x8l [HOR_UP_PRED            ] = ff_pred8x8l_horizontal_up_8_mmxext;
-            h->pred8x8l [DIAG_DOWN_LEFT_PRED    ] = ff_pred8x8l_down_left_8_mmxext;
-            h->pred8x8l [HOR_DOWN_PRED          ] = ff_pred8x8l_horizontal_down_8_mmxext;
-            h->pred4x4  [DIAG_DOWN_RIGHT_PRED   ] = ff_pred4x4_down_right_8_mmxext;
-            h->pred4x4  [VERT_RIGHT_PRED        ] = ff_pred4x4_vertical_right_8_mmxext;
-            h->pred4x4  [HOR_DOWN_PRED          ] = ff_pred4x4_horizontal_down_8_mmxext;
-            h->pred4x4  [DC_PRED                ] = ff_pred4x4_dc_8_mmxext;
-            if (codec_id == AV_CODEC_ID_VP8 || codec_id == AV_CODEC_ID_H264) {
-                h->pred4x4  [DIAG_DOWN_LEFT_PRED] = ff_pred4x4_down_left_8_mmxext;
-            }
-            if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
-                h->pred4x4  [VERT_LEFT_PRED     ] = ff_pred4x4_vertical_left_8_mmxext;
-            }
-            if (codec_id != AV_CODEC_ID_RV40) {
-                h->pred4x4  [HOR_UP_PRED        ] = ff_pred4x4_horizontal_up_8_mmxext;
-            }
-            if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
-                if (chroma_format_idc <= 1) {
-                    h->pred8x8[TOP_DC_PRED8x8   ] = ff_pred8x8_top_dc_8_mmxext;
-                    h->pred8x8[DC_PRED8x8       ] = ff_pred8x8_dc_8_mmxext;
-                }
-            }
-            if (codec_id == AV_CODEC_ID_VP8) {
-                h->pred16x16[PLANE_PRED8x8      ] = ff_pred16x16_tm_vp8_8_mmxext;
-                h->pred8x8  [DC_PRED8x8         ] = ff_pred8x8_dc_rv40_8_mmxext;
-                h->pred8x8  [PLANE_PRED8x8      ] = ff_pred8x8_tm_vp8_8_mmxext;
-                h->pred4x4  [TM_VP8_PRED        ] = ff_pred4x4_tm_vp8_8_mmxext;
-                h->pred4x4  [VERT_PRED          ] = ff_pred4x4_vertical_vp8_8_mmxext;
-            } else {
-                if (chroma_format_idc <= 1)
-                    h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_8_mmxext;
-                if (codec_id == AV_CODEC_ID_SVQ3) {
-                    h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_svq3_8_mmxext;
-                } else if (codec_id == AV_CODEC_ID_RV40) {
-                    h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_rv40_8_mmxext;
-                } else {
-                    h->pred16x16[PLANE_PRED8x8  ] = ff_pred16x16_plane_h264_8_mmxext;
-                }
-            }
-        }
-
-        if (EXTERNAL_SSE(cpu_flags)) {
-            h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_8_sse;
-        }
-
-        if (EXTERNAL_SSE2(cpu_flags)) {
-            h->pred16x16[DC_PRED8x8           ] = ff_pred16x16_dc_8_sse2;
-            h->pred8x8l [DIAG_DOWN_LEFT_PRED  ] = ff_pred8x8l_down_left_8_sse2;
-            h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_8_sse2;
-            h->pred8x8l [VERT_RIGHT_PRED      ] = ff_pred8x8l_vertical_right_8_sse2;
-            h->pred8x8l [VERT_LEFT_PRED       ] = ff_pred8x8l_vertical_left_8_sse2;
-            h->pred8x8l [HOR_DOWN_PRED        ] = ff_pred8x8l_horizontal_down_8_sse2;
-            if (codec_id == AV_CODEC_ID_VP8) {
-                h->pred16x16[PLANE_PRED8x8    ] = ff_pred16x16_tm_vp8_8_sse2;
-                h->pred8x8  [PLANE_PRED8x8    ] = ff_pred8x8_tm_vp8_8_sse2;
-            } else {
-                if (chroma_format_idc <= 1)
-                    h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_8_sse2;
-                if (codec_id == AV_CODEC_ID_SVQ3) {
-                    h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_8_sse2;
-                } else if (codec_id == AV_CODEC_ID_RV40) {
-                    h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_8_sse2;
-                } else {
-                    h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_8_sse2;
-                }
-            }
-        }
-
-        if (EXTERNAL_SSSE3(cpu_flags)) {
-            h->pred16x16[HOR_PRED8x8          ] = ff_pred16x16_horizontal_8_ssse3;
-            h->pred16x16[DC_PRED8x8           ] = ff_pred16x16_dc_8_ssse3;
-            if (chroma_format_idc <= 1)
-                h->pred8x8  [HOR_PRED8x8      ] = ff_pred8x8_horizontal_8_ssse3;
-            h->pred8x8l [TOP_DC_PRED          ] = ff_pred8x8l_top_dc_8_ssse3;
-            h->pred8x8l [DC_PRED              ] = ff_pred8x8l_dc_8_ssse3;
-            h->pred8x8l [HOR_PRED             ] = ff_pred8x8l_horizontal_8_ssse3;
-            h->pred8x8l [VERT_PRED            ] = ff_pred8x8l_vertical_8_ssse3;
-            h->pred8x8l [DIAG_DOWN_LEFT_PRED  ] = ff_pred8x8l_down_left_8_ssse3;
-            h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_8_ssse3;
-            h->pred8x8l [VERT_RIGHT_PRED      ] = ff_pred8x8l_vertical_right_8_ssse3;
-            h->pred8x8l [VERT_LEFT_PRED       ] = ff_pred8x8l_vertical_left_8_ssse3;
-            h->pred8x8l [HOR_UP_PRED          ] = ff_pred8x8l_horizontal_up_8_ssse3;
-            h->pred8x8l [HOR_DOWN_PRED        ] = ff_pred8x8l_horizontal_down_8_ssse3;
-            if (codec_id == AV_CODEC_ID_VP8) {
-                h->pred8x8  [PLANE_PRED8x8    ] = ff_pred8x8_tm_vp8_8_ssse3;
-                h->pred4x4  [TM_VP8_PRED      ] = ff_pred4x4_tm_vp8_8_ssse3;
-            } else {
-                if (chroma_format_idc <= 1)
-                    h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_8_ssse3;
-                if (codec_id == AV_CODEC_ID_SVQ3) {
-                    h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_8_ssse3;
-                } else if (codec_id == AV_CODEC_ID_RV40) {
-                    h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_8_ssse3;
-                } else {
-                    h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_8_ssse3;
-                }
-            }
-        }
-    } else if (bit_depth == 10) {
-        if (EXTERNAL_MMXEXT(cpu_flags)) {
-            h->pred4x4[DC_PRED             ] = ff_pred4x4_dc_10_mmxext;
-            h->pred4x4[HOR_UP_PRED         ] = ff_pred4x4_horizontal_up_10_mmxext;
-
-            if (chroma_format_idc <= 1)
-                h->pred8x8[DC_PRED8x8      ] = ff_pred8x8_dc_10_mmxext;
-
-            h->pred8x8l[DC_128_PRED        ] = ff_pred8x8l_128_dc_10_mmxext;
-
-            h->pred16x16[DC_PRED8x8        ] = ff_pred16x16_dc_10_mmxext;
-            h->pred16x16[TOP_DC_PRED8x8    ] = ff_pred16x16_top_dc_10_mmxext;
-            h->pred16x16[DC_128_PRED8x8    ] = ff_pred16x16_128_dc_10_mmxext;
-            h->pred16x16[LEFT_DC_PRED8x8   ] = ff_pred16x16_left_dc_10_mmxext;
-            h->pred16x16[VERT_PRED8x8      ] = ff_pred16x16_vertical_10_mmxext;
-            h->pred16x16[HOR_PRED8x8       ] = ff_pred16x16_horizontal_10_mmxext;
-        }
-        if (EXTERNAL_SSE2(cpu_flags)) {
-            h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_sse2;
-            h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_sse2;
-            h->pred4x4[VERT_LEFT_PRED      ] = ff_pred4x4_vertical_left_10_sse2;
-            h->pred4x4[VERT_RIGHT_PRED     ] = ff_pred4x4_vertical_right_10_sse2;
-            h->pred4x4[HOR_DOWN_PRED       ] = ff_pred4x4_horizontal_down_10_sse2;
-
-            if (chroma_format_idc <= 1) {
-                h->pred8x8[DC_PRED8x8      ] = ff_pred8x8_dc_10_sse2;
-                h->pred8x8[TOP_DC_PRED8x8  ] = ff_pred8x8_top_dc_10_sse2;
-                h->pred8x8[PLANE_PRED8x8   ] = ff_pred8x8_plane_10_sse2;
-                h->pred8x8[VERT_PRED8x8    ] = ff_pred8x8_vertical_10_sse2;
-                h->pred8x8[HOR_PRED8x8     ] = ff_pred8x8_horizontal_10_sse2;
-            }
-
-            h->pred8x8l[VERT_PRED           ] = ff_pred8x8l_vertical_10_sse2;
-            h->pred8x8l[HOR_PRED            ] = ff_pred8x8l_horizontal_10_sse2;
-            h->pred8x8l[DC_PRED             ] = ff_pred8x8l_dc_10_sse2;
-            h->pred8x8l[DC_128_PRED         ] = ff_pred8x8l_128_dc_10_sse2;
-            h->pred8x8l[TOP_DC_PRED         ] = ff_pred8x8l_top_dc_10_sse2;
-            h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_sse2;
-            h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_sse2;
-            h->pred8x8l[VERT_RIGHT_PRED     ] = ff_pred8x8l_vertical_right_10_sse2;
-            h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_sse2;
-
-            h->pred16x16[DC_PRED8x8        ] = ff_pred16x16_dc_10_sse2;
-            h->pred16x16[TOP_DC_PRED8x8    ] = ff_pred16x16_top_dc_10_sse2;
-            h->pred16x16[DC_128_PRED8x8    ] = ff_pred16x16_128_dc_10_sse2;
-            h->pred16x16[LEFT_DC_PRED8x8   ] = ff_pred16x16_left_dc_10_sse2;
-            h->pred16x16[VERT_PRED8x8      ] = ff_pred16x16_vertical_10_sse2;
-            h->pred16x16[HOR_PRED8x8       ] = ff_pred16x16_horizontal_10_sse2;
-        }
-        if (EXTERNAL_SSSE3(cpu_flags)) {
-            h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_ssse3;
-            h->pred4x4[VERT_RIGHT_PRED     ] = ff_pred4x4_vertical_right_10_ssse3;
-            h->pred4x4[HOR_DOWN_PRED       ] = ff_pred4x4_horizontal_down_10_ssse3;
-
-            h->pred8x8l[HOR_PRED            ] = ff_pred8x8l_horizontal_10_ssse3;
-            h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_ssse3;
-            h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_ssse3;
-            h->pred8x8l[VERT_RIGHT_PRED     ] = ff_pred8x8l_vertical_right_10_ssse3;
-            h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_ssse3;
-        }
-        if (EXTERNAL_AVX(cpu_flags)) {
-            h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_avx;
-            h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_avx;
-            h->pred4x4[VERT_LEFT_PRED      ] = ff_pred4x4_vertical_left_10_avx;
-            h->pred4x4[VERT_RIGHT_PRED     ] = ff_pred4x4_vertical_right_10_avx;
-            h->pred4x4[HOR_DOWN_PRED       ] = ff_pred4x4_horizontal_down_10_avx;
-
-            h->pred8x8l[VERT_PRED           ] = ff_pred8x8l_vertical_10_avx;
-            h->pred8x8l[HOR_PRED            ] = ff_pred8x8l_horizontal_10_avx;
-            h->pred8x8l[DC_PRED             ] = ff_pred8x8l_dc_10_avx;
-            h->pred8x8l[TOP_DC_PRED         ] = ff_pred8x8l_top_dc_10_avx;
-            h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_avx;
-            h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_avx;
-            h->pred8x8l[VERT_RIGHT_PRED     ] = ff_pred8x8l_vertical_right_10_avx;
-            h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_avx;
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/x86/h264_qpel.c b/deps/libav/libavcodec/x86/h264_qpel.c
deleted file mode 100644
index 90857ce..0000000
--- a/deps/libav/libavcodec/x86/h264_qpel.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
- * Copyright (c) 2011 Daniel Kang
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/h264qpel.h"
-#include "libavcodec/mpegvideo.h"
-#include "dsputil_x86.h"
-
-#if HAVE_YASM
-void ff_put_pixels4_mmxext(uint8_t *block, const uint8_t *pixels,
-                           ptrdiff_t line_size, int h);
-void ff_avg_pixels4_mmxext(uint8_t *block, const uint8_t *pixels,
-                           ptrdiff_t line_size, int h);
-void ff_put_pixels4_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                              int dstStride, int src1Stride, int h);
-void ff_avg_pixels4_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                              int dstStride, int src1Stride, int h);
-void ff_put_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                              int dstStride, int src1Stride, int h);
-void ff_avg_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                              int dstStride, int src1Stride, int h);
-void ff_put_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                               int dstStride, int src1Stride, int h);
-void ff_avg_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
-                               int dstStride, int src1Stride, int h);
-#define ff_put_pixels8_l2_sse2  ff_put_pixels8_l2_mmxext
-#define ff_avg_pixels8_l2_sse2  ff_avg_pixels8_l2_mmxext
-#define ff_put_pixels16_l2_sse2 ff_put_pixels16_l2_mmxext
-#define ff_avg_pixels16_l2_sse2 ff_avg_pixels16_l2_mmxext
-
-PIXELS16(static, ff_avg, , , _mmxext)
-PIXELS16(static, ff_put, , , _mmxext)
-
-#define DEF_QPEL(OPNAME)\
-void ff_ ## OPNAME ## _h264_qpel4_h_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
-void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
-void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_ssse3(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
-void ff_ ## OPNAME ## _h264_qpel4_h_lowpass_l2_mmxext(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride);\
-void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_l2_mmxext(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride);\
-void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_l2_ssse3(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride);\
-void ff_ ## OPNAME ## _h264_qpel4_v_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
-void ff_ ## OPNAME ## _h264_qpel8or16_v_lowpass_op_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h);\
-void ff_ ## OPNAME ## _h264_qpel8or16_v_lowpass_sse2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h);\
-void ff_ ## OPNAME ## _h264_qpel4_hv_lowpass_v_mmxext(uint8_t *src, int16_t *tmp, int srcStride);\
-void ff_ ## OPNAME ## _h264_qpel4_hv_lowpass_h_mmxext(int16_t *tmp, uint8_t *dst, int dstStride);\
-void ff_ ## OPNAME ## _h264_qpel8or16_hv1_lowpass_op_mmxext(uint8_t *src, int16_t *tmp, int srcStride, int size);\
-void ff_ ## OPNAME ## _h264_qpel8or16_hv1_lowpass_op_sse2(uint8_t *src, int16_t *tmp, int srcStride, int size);\
-void ff_ ## OPNAME ## _h264_qpel8or16_hv2_lowpass_op_mmxext(uint8_t *dst, int16_t *tmp, int dstStride, int unused, int h);\
-void ff_ ## OPNAME ## _h264_qpel8or16_hv2_lowpass_ssse3(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size);\
-void ff_ ## OPNAME ## _pixels4_l2_shift5_mmxext(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h);\
-void ff_ ## OPNAME ## _pixels8_l2_shift5_mmxext(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h);
-
-DEF_QPEL(avg)
-DEF_QPEL(put)
-
-#define QPEL_H264(OPNAME, OP, MMX)\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel4_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
-    int w=3;\
-    src -= 2*srcStride+2;\
-    while(w--){\
-        ff_ ## OPNAME ## h264_qpel4_hv_lowpass_v_mmxext(src, tmp, srcStride);\
-        tmp += 4;\
-        src += 4;\
-    }\
-    tmp -= 3*4;\
-    ff_ ## OPNAME ## h264_qpel4_hv_lowpass_h_mmxext(tmp, dst, dstStride);\
-}\
-\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
-    src -= 2*srcStride;\
-    ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_op_mmxext(dst, src, dstStride, srcStride, h);\
-    src += 4;\
-    dst += 4;\
-    ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_op_mmxext(dst, src, dstStride, srcStride, h);\
-}\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv1_lowpass_ ## MMX(int16_t *tmp, uint8_t *src, int tmpStride, int srcStride, int size){\
-    int w = (size+8)>>2;\
-    src -= 2*srcStride+2;\
-    while(w--){\
-        ff_ ## OPNAME ## h264_qpel8or16_hv1_lowpass_op_mmxext(src, tmp, srcStride, size);\
-        tmp += 4;\
-        src += 4;\
-    }\
-}\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size){\
-    int w = size>>4;\
-    do{\
-    ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_op_mmxext(dst, tmp, dstStride, 0, size);\
-    tmp += 8;\
-    dst += 8;\
-    }while(w--);\
-}\
-\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst  , src  , dstStride, srcStride, 8);\
-}\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst  , src  , dstStride, srcStride, 16);\
-    ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
-}\
-\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst  , src  , dstStride, srcStride);\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst  , src  , dstStride, srcStride);\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst  , src  , src2  , dstStride, src2Stride);\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
-    src += 8*dstStride;\
-    dst += 8*dstStride;\
-    src2 += 8*src2Stride;\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst  , src  , src2  , dstStride, src2Stride);\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
-}\
-\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\
-    ff_put_h264_qpel8or16_hv1_lowpass_ ## MMX(tmp, src, tmpStride, srcStride, size);\
-    ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\
-}\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst  , tmp  , src  , dstStride, tmpStride, srcStride, 8);\
-}\
-\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst  , tmp  , src  , dstStride, tmpStride, srcStride, 16);\
-}\
-\
-static av_always_inline void ff_ ## OPNAME ## pixels16_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\
-{\
-    ff_ ## OPNAME ## pixels8_l2_shift5_ ## MMX(dst  , src16  , src8  , dstStride, src8Stride, h);\
-    ff_ ## OPNAME ## pixels8_l2_shift5_ ## MMX(dst+8, src16+8, src8+8, dstStride, src8Stride, h);\
-}\
-
-
-#if ARCH_X86_64
-#define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
-
-void ff_avg_h264_qpel16_h_lowpass_l2_ssse3(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride);
-void ff_put_h264_qpel16_h_lowpass_l2_ssse3(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride);
-
-#else // ARCH_X86_64
-#define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst  , src  , src2  , dstStride, src2Stride);\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
-    src += 8*dstStride;\
-    dst += 8*dstStride;\
-    src2 += 8*src2Stride;\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst  , src  , src2  , dstStride, src2Stride);\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
-}
-#endif // ARCH_X86_64
-
-#define QPEL_H264_H_XMM(OPNAME, OP, MMX)\
-QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst  , src  , dstStride, srcStride);\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
-    src += 8*srcStride;\
-    dst += 8*dstStride;\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst  , src  , dstStride, srcStride);\
-    ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
-}\
-
-#define QPEL_H264_V_XMM(OPNAME, OP, MMX)\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst  , src  , dstStride, srcStride, 8);\
-}\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst  , src  , dstStride, srcStride, 16);\
-    ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
-}
-
-static av_always_inline void put_h264_qpel8or16_hv1_lowpass_sse2(int16_t *tmp,
-                                                                 uint8_t *src,
-                                                                 int tmpStride,
-                                                                 int srcStride,
-                                                                 int size)
-{
-    int w = (size+8)>>3;
-    src -= 2*srcStride+2;
-    while(w--){
-        ff_put_h264_qpel8or16_hv1_lowpass_op_sse2(src, tmp, srcStride, size);
-        tmp += 8;
-        src += 8;
-    }
-}
-
-#define QPEL_H264_HV_XMM(OPNAME, OP, MMX)\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\
-    put_h264_qpel8or16_hv1_lowpass_sse2(tmp, src, tmpStride, srcStride, size);\
-    ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\
-}\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 8);\
-}\
-static av_always_inline void ff_ ## OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
-    ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 16);\
-}\
-
-#define ff_put_h264_qpel8_h_lowpass_l2_sse2  ff_put_h264_qpel8_h_lowpass_l2_mmxext
-#define ff_avg_h264_qpel8_h_lowpass_l2_sse2  ff_avg_h264_qpel8_h_lowpass_l2_mmxext
-#define ff_put_h264_qpel16_h_lowpass_l2_sse2 ff_put_h264_qpel16_h_lowpass_l2_mmxext
-#define ff_avg_h264_qpel16_h_lowpass_l2_sse2 ff_avg_h264_qpel16_h_lowpass_l2_mmxext
-
-#define ff_put_h264_qpel8_v_lowpass_ssse3  ff_put_h264_qpel8_v_lowpass_sse2
-#define ff_avg_h264_qpel8_v_lowpass_ssse3  ff_avg_h264_qpel8_v_lowpass_sse2
-#define ff_put_h264_qpel16_v_lowpass_ssse3 ff_put_h264_qpel16_v_lowpass_sse2
-#define ff_avg_h264_qpel16_v_lowpass_ssse3 ff_avg_h264_qpel16_v_lowpass_sse2
-
-#define ff_put_h264_qpel8or16_hv2_lowpass_sse2 ff_put_h264_qpel8or16_hv2_lowpass_mmxext
-#define ff_avg_h264_qpel8or16_hv2_lowpass_sse2 ff_avg_h264_qpel8or16_hv2_lowpass_mmxext
-
-#define H264_MC(OPNAME, SIZE, MMX, ALIGN) \
-H264_MC_C(OPNAME, SIZE, MMX, ALIGN)\
-H264_MC_V(OPNAME, SIZE, MMX, ALIGN)\
-H264_MC_H(OPNAME, SIZE, MMX, ALIGN)\
-H264_MC_HV(OPNAME, SIZE, MMX, ALIGN)\
-
-static void put_h264_qpel16_mc00_sse2 (uint8_t *dst, uint8_t *src,
-                                       ptrdiff_t stride)
-{
-    ff_put_pixels16_sse2(dst, src, stride, 16);
-}
-static void avg_h264_qpel16_mc00_sse2 (uint8_t *dst, uint8_t *src,
-                                       ptrdiff_t stride)
-{
-    ff_avg_pixels16_sse2(dst, src, stride, 16);
-}
-#define put_h264_qpel8_mc00_sse2 put_h264_qpel8_mc00_mmxext
-#define avg_h264_qpel8_mc00_sse2 avg_h264_qpel8_mc00_mmxext
-
-#define H264_MC_C(OPNAME, SIZE, MMX, ALIGN) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    ff_ ## OPNAME ## pixels ## SIZE ## _ ## MMX(dst, src, stride, SIZE);\
-}\
-
-#define H264_MC_H(OPNAME, SIZE, MMX, ALIGN) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src+1, stride, stride);\
-}\
-
-#define H264_MC_V(OPNAME, SIZE, MMX, ALIGN) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
-    ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
-    ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
-    ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
-    ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, stride, stride, SIZE);\
-}\
-
-#define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
-    ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
-    ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
-    ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
-    ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint16_t, temp)[SIZE*(SIZE<8?12:24)];\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, temp, src, stride, SIZE, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
-    uint8_t * const halfHV= temp;\
-    int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
-    assert(((int)temp & 7) == 0);\
-    ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfHV, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
-    uint8_t * const halfHV= temp;\
-    int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
-    assert(((int)temp & 7) == 0);\
-    ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
-    ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfHV, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
-    uint8_t * const halfHV= temp;\
-    int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
-    assert(((int)temp & 7) == 0);\
-    ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
-    ff_ ## OPNAME ## pixels ## SIZE ## _l2_shift5_mmxext(dst, halfV+2, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
-{\
-    DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
-    uint8_t * const halfHV= temp;\
-    int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
-    assert(((int)temp & 7) == 0);\
-    ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
-    ff_ ## OPNAME ## pixels ## SIZE ## _l2_shift5_mmxext(dst, halfV+3, halfHV, stride, SIZE, SIZE);\
-}\
-
-#define H264_MC_4816(MMX)\
-H264_MC(put_, 4, MMX, 8)\
-H264_MC(put_, 8, MMX, 8)\
-H264_MC(put_, 16,MMX, 8)\
-H264_MC(avg_, 4, MMX, 8)\
-H264_MC(avg_, 8, MMX, 8)\
-H264_MC(avg_, 16,MMX, 8)\
-
-#define H264_MC_816(QPEL, XMM)\
-QPEL(put_, 8, XMM, 16)\
-QPEL(put_, 16,XMM, 16)\
-QPEL(avg_, 8, XMM, 16)\
-QPEL(avg_, 16,XMM, 16)\
-
-QPEL_H264(put_,        PUT_OP, mmxext)
-QPEL_H264(avg_, AVG_MMXEXT_OP, mmxext)
-QPEL_H264_V_XMM(put_,       PUT_OP, sse2)
-QPEL_H264_V_XMM(avg_,AVG_MMXEXT_OP, sse2)
-QPEL_H264_HV_XMM(put_,       PUT_OP, sse2)
-QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, sse2)
-QPEL_H264_H_XMM(put_,       PUT_OP, ssse3)
-QPEL_H264_H_XMM(avg_,AVG_MMXEXT_OP, ssse3)
-QPEL_H264_HV_XMM(put_,       PUT_OP, ssse3)
-QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, ssse3)
-
-H264_MC_4816(mmxext)
-H264_MC_816(H264_MC_V, sse2)
-H264_MC_816(H264_MC_HV, sse2)
-H264_MC_816(H264_MC_H, ssse3)
-H264_MC_816(H264_MC_HV, ssse3)
-
-
-//10bit
-#define LUMA_MC_OP(OP, NUM, DEPTH, TYPE, OPT) \
-void ff_ ## OP ## _h264_qpel ## NUM ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT \
-    (uint8_t *dst, uint8_t *src, ptrdiff_t stride);
-
-#define LUMA_MC_ALL(DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(put,  4, DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(avg,  4, DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(put,  8, DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(avg,  8, DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(put, 16, DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(avg, 16, DEPTH, TYPE, OPT)
-
-#define LUMA_MC_816(DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(put,  8, DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(avg,  8, DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(put, 16, DEPTH, TYPE, OPT) \
-    LUMA_MC_OP(avg, 16, DEPTH, TYPE, OPT)
-
-LUMA_MC_ALL(10, mc00, mmxext)
-LUMA_MC_ALL(10, mc10, mmxext)
-LUMA_MC_ALL(10, mc20, mmxext)
-LUMA_MC_ALL(10, mc30, mmxext)
-LUMA_MC_ALL(10, mc01, mmxext)
-LUMA_MC_ALL(10, mc11, mmxext)
-LUMA_MC_ALL(10, mc21, mmxext)
-LUMA_MC_ALL(10, mc31, mmxext)
-LUMA_MC_ALL(10, mc02, mmxext)
-LUMA_MC_ALL(10, mc12, mmxext)
-LUMA_MC_ALL(10, mc22, mmxext)
-LUMA_MC_ALL(10, mc32, mmxext)
-LUMA_MC_ALL(10, mc03, mmxext)
-LUMA_MC_ALL(10, mc13, mmxext)
-LUMA_MC_ALL(10, mc23, mmxext)
-LUMA_MC_ALL(10, mc33, mmxext)
-
-LUMA_MC_816(10, mc00, sse2)
-LUMA_MC_816(10, mc10, sse2)
-LUMA_MC_816(10, mc10, sse2_cache64)
-LUMA_MC_816(10, mc10, ssse3_cache64)
-LUMA_MC_816(10, mc20, sse2)
-LUMA_MC_816(10, mc20, sse2_cache64)
-LUMA_MC_816(10, mc20, ssse3_cache64)
-LUMA_MC_816(10, mc30, sse2)
-LUMA_MC_816(10, mc30, sse2_cache64)
-LUMA_MC_816(10, mc30, ssse3_cache64)
-LUMA_MC_816(10, mc01, sse2)
-LUMA_MC_816(10, mc11, sse2)
-LUMA_MC_816(10, mc21, sse2)
-LUMA_MC_816(10, mc31, sse2)
-LUMA_MC_816(10, mc02, sse2)
-LUMA_MC_816(10, mc12, sse2)
-LUMA_MC_816(10, mc22, sse2)
-LUMA_MC_816(10, mc32, sse2)
-LUMA_MC_816(10, mc03, sse2)
-LUMA_MC_816(10, mc13, sse2)
-LUMA_MC_816(10, mc23, sse2)
-LUMA_MC_816(10, mc33, sse2)
-
-#define QPEL16_OPMC(OP, MC, MMX)\
-void ff_ ## OP ## _h264_qpel16_ ## MC ## _10_ ## MMX(uint8_t *dst, uint8_t *src, ptrdiff_t stride){\
-    ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst   , src   , stride);\
-    ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst+16, src+16, stride);\
-    src += 8*stride;\
-    dst += 8*stride;\
-    ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst   , src   , stride);\
-    ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst+16, src+16, stride);\
-}
-
-#define QPEL16_OP(MC, MMX)\
-QPEL16_OPMC(put, MC, MMX)\
-QPEL16_OPMC(avg, MC, MMX)
-
-#define QPEL16(MMX)\
-QPEL16_OP(mc00, MMX)\
-QPEL16_OP(mc01, MMX)\
-QPEL16_OP(mc02, MMX)\
-QPEL16_OP(mc03, MMX)\
-QPEL16_OP(mc10, MMX)\
-QPEL16_OP(mc11, MMX)\
-QPEL16_OP(mc12, MMX)\
-QPEL16_OP(mc13, MMX)\
-QPEL16_OP(mc20, MMX)\
-QPEL16_OP(mc21, MMX)\
-QPEL16_OP(mc22, MMX)\
-QPEL16_OP(mc23, MMX)\
-QPEL16_OP(mc30, MMX)\
-QPEL16_OP(mc31, MMX)\
-QPEL16_OP(mc32, MMX)\
-QPEL16_OP(mc33, MMX)
-
-#if ARCH_X86_32 && HAVE_YASM && CONFIG_H264QPEL // ARCH_X86_64 implies SSE2+
-QPEL16(mmxext)
-#endif
-
-#endif /* HAVE_YASM */
-
-#define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU, PREFIX)                          \
-    do {                                                                     \
-    c->PFX ## _pixels_tab[IDX][ 0] = PREFIX ## PFX ## SIZE ## _mc00_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 1] = PREFIX ## PFX ## SIZE ## _mc10_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 2] = PREFIX ## PFX ## SIZE ## _mc20_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 3] = PREFIX ## PFX ## SIZE ## _mc30_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 4] = PREFIX ## PFX ## SIZE ## _mc01_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 5] = PREFIX ## PFX ## SIZE ## _mc11_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 6] = PREFIX ## PFX ## SIZE ## _mc21_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 7] = PREFIX ## PFX ## SIZE ## _mc31_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 8] = PREFIX ## PFX ## SIZE ## _mc02_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][ 9] = PREFIX ## PFX ## SIZE ## _mc12_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][10] = PREFIX ## PFX ## SIZE ## _mc22_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][11] = PREFIX ## PFX ## SIZE ## _mc32_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][12] = PREFIX ## PFX ## SIZE ## _mc03_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][13] = PREFIX ## PFX ## SIZE ## _mc13_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][14] = PREFIX ## PFX ## SIZE ## _mc23_ ## CPU; \
-    c->PFX ## _pixels_tab[IDX][15] = PREFIX ## PFX ## SIZE ## _mc33_ ## CPU; \
-    } while (0)
-
-#define H264_QPEL_FUNCS(x, y, CPU)                                                            \
-    do {                                                                                      \
-        c->put_h264_qpel_pixels_tab[0][x + y * 4] = put_h264_qpel16_mc ## x ## y ## _ ## CPU; \
-        c->put_h264_qpel_pixels_tab[1][x + y * 4] = put_h264_qpel8_mc  ## x ## y ## _ ## CPU; \
-        c->avg_h264_qpel_pixels_tab[0][x + y * 4] = avg_h264_qpel16_mc ## x ## y ## _ ## CPU; \
-        c->avg_h264_qpel_pixels_tab[1][x + y * 4] = avg_h264_qpel8_mc  ## x ## y ## _ ## CPU; \
-    } while (0)
-
-#define H264_QPEL_FUNCS_10(x, y, CPU)                                                               \
-    do {                                                                                            \
-        c->put_h264_qpel_pixels_tab[0][x + y * 4] = ff_put_h264_qpel16_mc ## x ## y ## _10_ ## CPU; \
-        c->put_h264_qpel_pixels_tab[1][x + y * 4] = ff_put_h264_qpel8_mc  ## x ## y ## _10_ ## CPU; \
-        c->avg_h264_qpel_pixels_tab[0][x + y * 4] = ff_avg_h264_qpel16_mc ## x ## y ## _10_ ## CPU; \
-        c->avg_h264_qpel_pixels_tab[1][x + y * 4] = ff_avg_h264_qpel8_mc  ## x ## y ## _10_ ## CPU; \
-    } while (0)
-
-av_cold void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth)
-{
-#if HAVE_YASM
-    int high_bit_depth = bit_depth > 8;
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        if (!high_bit_depth) {
-            SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmxext, );
-            SET_QPEL_FUNCS(put_h264_qpel, 1,  8, mmxext, );
-            SET_QPEL_FUNCS(put_h264_qpel, 2,  4, mmxext, );
-            SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, mmxext, );
-            SET_QPEL_FUNCS(avg_h264_qpel, 1,  8, mmxext, );
-            SET_QPEL_FUNCS(avg_h264_qpel, 2,  4, mmxext, );
-        } else if (bit_depth == 10) {
-#if ARCH_X86_32
-            SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 10_mmxext, ff_);
-            SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 10_mmxext, ff_);
-            SET_QPEL_FUNCS(put_h264_qpel, 1,  8, 10_mmxext, ff_);
-            SET_QPEL_FUNCS(avg_h264_qpel, 1,  8, 10_mmxext, ff_);
-#endif
-            SET_QPEL_FUNCS(put_h264_qpel, 2, 4,  10_mmxext, ff_);
-            SET_QPEL_FUNCS(avg_h264_qpel, 2, 4,  10_mmxext, ff_);
-        }
-    }
-
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW) && !high_bit_depth) {
-            // these functions are slower than mmx on AMD, but faster on Intel
-            H264_QPEL_FUNCS(0, 0, sse2);
-        }
-
-        if (!high_bit_depth) {
-            H264_QPEL_FUNCS(0, 1, sse2);
-            H264_QPEL_FUNCS(0, 2, sse2);
-            H264_QPEL_FUNCS(0, 3, sse2);
-            H264_QPEL_FUNCS(1, 1, sse2);
-            H264_QPEL_FUNCS(1, 2, sse2);
-            H264_QPEL_FUNCS(1, 3, sse2);
-            H264_QPEL_FUNCS(2, 1, sse2);
-            H264_QPEL_FUNCS(2, 2, sse2);
-            H264_QPEL_FUNCS(2, 3, sse2);
-            H264_QPEL_FUNCS(3, 1, sse2);
-            H264_QPEL_FUNCS(3, 2, sse2);
-            H264_QPEL_FUNCS(3, 3, sse2);
-        }
-
-        if (bit_depth == 10) {
-            SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 10_sse2, ff_);
-            SET_QPEL_FUNCS(put_h264_qpel, 1,  8, 10_sse2, ff_);
-            SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 10_sse2, ff_);
-            SET_QPEL_FUNCS(avg_h264_qpel, 1,  8, 10_sse2, ff_);
-            H264_QPEL_FUNCS_10(1, 0, sse2_cache64);
-            H264_QPEL_FUNCS_10(2, 0, sse2_cache64);
-            H264_QPEL_FUNCS_10(3, 0, sse2_cache64);
-        }
-    }
-
-    if (EXTERNAL_SSSE3(cpu_flags)) {
-        if (!high_bit_depth) {
-            H264_QPEL_FUNCS(1, 0, ssse3);
-            H264_QPEL_FUNCS(1, 1, ssse3);
-            H264_QPEL_FUNCS(1, 2, ssse3);
-            H264_QPEL_FUNCS(1, 3, ssse3);
-            H264_QPEL_FUNCS(2, 0, ssse3);
-            H264_QPEL_FUNCS(2, 1, ssse3);
-            H264_QPEL_FUNCS(2, 2, ssse3);
-            H264_QPEL_FUNCS(2, 3, ssse3);
-            H264_QPEL_FUNCS(3, 0, ssse3);
-            H264_QPEL_FUNCS(3, 1, ssse3);
-            H264_QPEL_FUNCS(3, 2, ssse3);
-            H264_QPEL_FUNCS(3, 3, ssse3);
-        }
-
-        if (bit_depth == 10) {
-            H264_QPEL_FUNCS_10(1, 0, ssse3_cache64);
-            H264_QPEL_FUNCS_10(2, 0, ssse3_cache64);
-            H264_QPEL_FUNCS_10(3, 0, ssse3_cache64);
-        }
-    }
-
-    if (EXTERNAL_AVX(cpu_flags)) {
-        /* AVX implies 64 byte cache lines without the need to avoid unaligned
-         * memory accesses that cross the boundary between two cache lines.
-         * TODO: Port X264_CPU_CACHELINE_32/64 detection from x264 to avoid
-         * having to treat SSE2 functions with such properties as AVX. */
-        if (bit_depth == 10) {
-            H264_QPEL_FUNCS_10(1, 0, sse2);
-            H264_QPEL_FUNCS_10(2, 0, sse2);
-            H264_QPEL_FUNCS_10(3, 0, sse2);
-        }
-    }
-#endif
-}
diff --git a/deps/libav/libavcodec/x86/h264_qpel_10bit.asm b/deps/libav/libavcodec/x86/h264_qpel_10bit.asm
deleted file mode 100644
index e14df84..0000000
--- a/deps/libav/libavcodec/x86/h264_qpel_10bit.asm
+++ /dev/null
@@ -1,884 +0,0 @@
-;*****************************************************************************
-;* MMX/SSE2/AVX-optimized 10-bit H.264 qpel code
-;*****************************************************************************
-;* Copyright (C) 2011 x264 project
-;*
-;* Authors: Daniel Kang <daniel.d.kang at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA 32
-
-cextern pw_16
-cextern pw_1
-cextern pb_0
-
-pw_pixel_max: times 8 dw ((1 << 10)-1)
-
-pad10: times 8 dw 10*1023
-pad20: times 8 dw 20*1023
-pad30: times 8 dw 30*1023
-depad: times 4 dd 32*20*1023 + 512
-depad2: times 8 dw 20*1023 + 16*1022 + 16
-unpad: times 8 dw 16*1022/32 ; needs to be mod 16
-
-tap1: times 4 dw  1, -5
-tap2: times 4 dw 20, 20
-tap3: times 4 dw -5,  1
-pd_0f: times 4 dd 0xffff
-
-SECTION .text
-
-
-%macro AVG_MOV 2
-    pavgw %2, %1
-    mova  %1, %2
-%endmacro
-
-%macro ADDW 3
-%if mmsize == 8
-    paddw %1, %2
-%else
-    movu  %3, %2
-    paddw %1, %3
-%endif
-%endmacro
-
-%macro FILT_H 4
-    paddw  %1, %4
-    psubw  %1, %2  ; a-b
-    psraw  %1, 2   ; (a-b)/4
-    psubw  %1, %2  ; (a-b)/4-b
-    paddw  %1, %3  ; (a-b)/4-b+c
-    psraw  %1, 2   ; ((a-b)/4-b+c)/4
-    paddw  %1, %3  ; ((a-b)/4-b+c)/4+c = (a-5*b+20*c)/16
-%endmacro
-
-%macro PRELOAD_V 0
-    lea      r3, [r2*3]
-    sub      r1, r3
-    movu     m0, [r1+r2]
-    movu     m1, [r1+r2*2]
-    add      r1, r3
-    movu     m2, [r1]
-    movu     m3, [r1+r2]
-    movu     m4, [r1+r2*2]
-    add      r1, r3
-%endmacro
-
-%macro FILT_V 8
-    movu     %6, [r1]
-    paddw    %1, %6
-    mova     %7, %2
-    paddw    %7, %5
-    mova     %8, %3
-    paddw    %8, %4
-    FILT_H   %1, %7, %8, [pw_16]
-    psraw    %1, 1
-    CLIPW    %1, [pb_0], [pw_pixel_max]
-%endmacro
-
-%macro MC 1
-%define OP_MOV mova
-INIT_MMX mmxext
-%1 put, 4
-INIT_XMM sse2
-%1 put, 8
-
-%define OP_MOV AVG_MOV
-INIT_MMX mmxext
-%1 avg, 4
-INIT_XMM sse2
-%1 avg, 8
-%endmacro
-
-%macro MCAxA_OP 7
-%if ARCH_X86_32
-cglobal %1_h264_qpel%4_%2_10, %5,%6,%7
-    call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
-    mov  r0, r0m
-    mov  r1, r1m
-    add  r0, %3*2
-    add  r1, %3*2
-    call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
-    mov  r0, r0m
-    mov  r1, r1m
-    lea  r0, [r0+r2*%3]
-    lea  r1, [r1+r2*%3]
-    call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
-    mov  r0, r0m
-    mov  r1, r1m
-    lea  r0, [r0+r2*%3+%3*2]
-    lea  r1, [r1+r2*%3+%3*2]
-    call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
-    RET
-%else ; ARCH_X86_64
-cglobal %1_h264_qpel%4_%2_10, %5,%6 + 2,%7
-    mov r%6, r0
-%assign p1 %6+1
-    mov r %+ p1, r1
-    call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
-    lea  r0, [r%6+%3*2]
-    lea  r1, [r %+ p1+%3*2]
-    call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
-    lea  r0, [r%6+r2*%3]
-    lea  r1, [r %+ p1+r2*%3]
-    call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
-    lea  r0, [r%6+r2*%3+%3*2]
-    lea  r1, [r %+ p1+r2*%3+%3*2]
-%if UNIX64 == 0 ; fall through to function
-    call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
-    RET
-%endif
-%endif
-%endmacro
-
-;cpu, put/avg, mc, 4/8, ...
-%macro cglobal_mc 6
-%assign i %3*2
-%if ARCH_X86_32 || cpuflag(sse2)
-MCAxA_OP %1, %2, %3, i, %4,%5,%6
-%endif
-
-cglobal %1_h264_qpel%3_%2_10, %4,%5,%6
-%if UNIX64 == 0 ; no prologue or epilogue for UNIX64
-    call stub_%1_h264_qpel%3_%2_10 %+ SUFFIX
-    RET
-%endif
-
-stub_%1_h264_qpel%3_%2_10 %+ SUFFIX:
-%endmacro
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc00(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro COPY4 0
-    movu          m0, [r1     ]
-    OP_MOV [r0     ], m0
-    movu          m0, [r1+r2  ]
-    OP_MOV [r0+r2  ], m0
-    movu          m0, [r1+r2*2]
-    OP_MOV [r0+r2*2], m0
-    movu          m0, [r1+r3  ]
-    OP_MOV [r0+r3  ], m0
-%endmacro
-
-%macro MC00 1
-INIT_MMX mmxext
-cglobal_mc %1, mc00, 4, 3,4,0
-    lea           r3, [r2*3]
-    COPY4
-    ret
-
-INIT_XMM sse2
-cglobal %1_h264_qpel8_mc00_10, 3,4
-    lea  r3, [r2*3]
-    COPY4
-    lea  r0, [r0+r2*4]
-    lea  r1, [r1+r2*4]
-    COPY4
-    RET
-
-cglobal %1_h264_qpel16_mc00_10, 3,4
-    mov r3d, 8
-.loop:
-    movu           m0, [r1      ]
-    movu           m1, [r1   +16]
-    OP_MOV [r0      ], m0
-    OP_MOV [r0   +16], m1
-    movu           m0, [r1+r2   ]
-    movu           m1, [r1+r2+16]
-    OP_MOV [r0+r2   ], m0
-    OP_MOV [r0+r2+16], m1
-    lea            r0, [r0+r2*2]
-    lea            r1, [r1+r2*2]
-    dec r3d
-    jg .loop
-    REP_RET
-%endmacro
-
-%define OP_MOV mova
-MC00 put
-
-%define OP_MOV AVG_MOV
-MC00 avg
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc20(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC_CACHE 1
-%define OP_MOV mova
-INIT_MMX mmxext
-%1 put, 4
-INIT_XMM sse2, cache64
-%1 put, 8
-INIT_XMM ssse3, cache64
-%1 put, 8
-INIT_XMM sse2
-%1 put, 8
-
-%define OP_MOV AVG_MOV
-INIT_MMX mmxext
-%1 avg, 4
-INIT_XMM sse2, cache64
-%1 avg, 8
-INIT_XMM ssse3, cache64
-%1 avg, 8
-INIT_XMM sse2
-%1 avg, 8
-%endmacro
-
-%macro MC20 2
-cglobal_mc %1, mc20, %2, 3,4,9
-    mov     r3d, %2
-    mova     m1, [pw_pixel_max]
-%if num_mmregs > 8
-    mova     m8, [pw_16]
-    %define p16 m8
-%else
-    %define p16 [pw_16]
-%endif
-.nextrow:
-%if %0 == 4
-    movu     m2, [r1-4]
-    movu     m3, [r1-2]
-    movu     m4, [r1+0]
-    ADDW     m2, [r1+6], m5
-    ADDW     m3, [r1+4], m5
-    ADDW     m4, [r1+2], m5
-%else ; movu is slow on these processors
-%if mmsize==16
-    movu     m2, [r1-4]
-    movu     m0, [r1+6]
-    mova     m6, m0
-    psrldq   m0, 6
-
-    paddw    m6, m2
-    PALIGNR  m3, m0, m2, 2, m5
-    PALIGNR  m7, m0, m2, 8, m5
-    paddw    m3, m7
-    PALIGNR  m4, m0, m2, 4, m5
-    PALIGNR  m7, m0, m2, 6, m5
-    paddw    m4, m7
-    SWAP      2, 6
-%else
-    movu     m2, [r1-4]
-    movu     m6, [r1+4]
-    PALIGNR  m3, m6, m2, 2, m5
-    paddw    m3, m6
-    PALIGNR  m4, m6, m2, 4, m5
-    PALIGNR  m7, m6, m2, 6, m5
-    paddw    m4, m7
-    paddw    m2, [r1+6]
-%endif
-%endif
-
-    FILT_H   m2, m3, m4, p16
-    psraw    m2, 1
-    pxor     m0, m0
-    CLIPW    m2, m0, m1
-    OP_MOV [r0], m2
-    add      r0, r2
-    add      r1, r2
-    dec     r3d
-    jg .nextrow
-    rep ret
-%endmacro
-
-MC_CACHE MC20
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc30(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC30 2
-cglobal_mc %1, mc30, %2, 3,5,9
-    lea r4, [r1+2]
-    jmp stub_%1_h264_qpel%2_mc10_10 %+ SUFFIX %+ .body
-%endmacro
-
-MC_CACHE MC30
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc10(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC10 2
-cglobal_mc %1, mc10, %2, 3,5,9
-    mov      r4, r1
-.body:
-    mov     r3d, %2
-    mova     m1, [pw_pixel_max]
-%if num_mmregs > 8
-    mova     m8, [pw_16]
-    %define p16 m8
-%else
-    %define p16 [pw_16]
-%endif
-.nextrow:
-%if %0 == 4
-    movu     m2, [r1-4]
-    movu     m3, [r1-2]
-    movu     m4, [r1+0]
-    ADDW     m2, [r1+6], m5
-    ADDW     m3, [r1+4], m5
-    ADDW     m4, [r1+2], m5
-%else ; movu is slow on these processors
-%if mmsize==16
-    movu     m2, [r1-4]
-    movu     m0, [r1+6]
-    mova     m6, m0
-    psrldq   m0, 6
-
-    paddw    m6, m2
-    PALIGNR  m3, m0, m2, 2, m5
-    PALIGNR  m7, m0, m2, 8, m5
-    paddw    m3, m7
-    PALIGNR  m4, m0, m2, 4, m5
-    PALIGNR  m7, m0, m2, 6, m5
-    paddw    m4, m7
-    SWAP      2, 6
-%else
-    movu     m2, [r1-4]
-    movu     m6, [r1+4]
-    PALIGNR  m3, m6, m2, 2, m5
-    paddw    m3, m6
-    PALIGNR  m4, m6, m2, 4, m5
-    PALIGNR  m7, m6, m2, 6, m5
-    paddw    m4, m7
-    paddw    m2, [r1+6]
-%endif
-%endif
-
-    FILT_H   m2, m3, m4, p16
-    psraw    m2, 1
-    pxor     m0, m0
-    CLIPW    m2, m0, m1
-    movu     m3, [r4]
-    pavgw    m2, m3
-    OP_MOV [r0], m2
-    add      r0, r2
-    add      r1, r2
-    add      r4, r2
-    dec     r3d
-    jg .nextrow
-    rep ret
-%endmacro
-
-MC_CACHE MC10
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc02(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro V_FILT 10
-v_filt%9_%10_10
-    add    r4, r2
-.no_addr4:
-    FILT_V m0, m1, m2, m3, m4, m5, m6, m7
-    add    r1, r2
-    add    r0, r2
-    ret
-%endmacro
-
-INIT_MMX mmxext
-RESET_MM_PERMUTATION
-%assign i 0
-%rep 4
-V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 4, i
-SWAP 0,1,2,3,4,5
-%assign i i+1
-%endrep
-
-INIT_XMM sse2
-RESET_MM_PERMUTATION
-%assign i 0
-%rep 6
-V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 8, i
-SWAP 0,1,2,3,4,5
-%assign i i+1
-%endrep
-
-%macro MC02 2
-cglobal_mc %1, mc02, %2, 3,4,8
-    PRELOAD_V
-
-    sub      r0, r2
-%assign j 0
-%rep %2
-    %assign i (j % 6)
-    call v_filt%2_ %+ i %+ _10.no_addr4
-    OP_MOV [r0], m0
-    SWAP 0,1,2,3,4,5
-    %assign j j+1
-%endrep
-    ret
-%endmacro
-
-MC MC02
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc01(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC01 2
-cglobal_mc %1, mc01, %2, 3,5,8
-    mov      r4, r1
-.body:
-    PRELOAD_V
-
-    sub      r4, r2
-    sub      r0, r2
-%assign j 0
-%rep %2
-    %assign i (j % 6)
-    call v_filt%2_ %+ i %+ _10
-    movu     m7, [r4]
-    pavgw    m0, m7
-    OP_MOV [r0], m0
-    SWAP 0,1,2,3,4,5
-    %assign j j+1
-%endrep
-    ret
-%endmacro
-
-MC MC01
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc03(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC03 2
-cglobal_mc %1, mc03, %2, 3,5,8
-    lea r4, [r1+r2]
-    jmp stub_%1_h264_qpel%2_mc01_10 %+ SUFFIX %+ .body
-%endmacro
-
-MC MC03
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc11(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro H_FILT_AVG 2-3
-h_filt%1_%2_10:
-;FILT_H with fewer registers and averaged with the FILT_V result
-;m6,m7 are tmp registers, m0 is the FILT_V result, the rest are to be used next in the next iteration
-;unfortunately I need three registers, so m5 will have to be re-read from memory
-    movu     m5, [r4-4]
-    ADDW     m5, [r4+6], m7
-    movu     m6, [r4-2]
-    ADDW     m6, [r4+4], m7
-    paddw    m5, [pw_16]
-    psubw    m5, m6  ; a-b
-    psraw    m5, 2   ; (a-b)/4
-    psubw    m5, m6  ; (a-b)/4-b
-    movu     m6, [r4+0]
-    ADDW     m6, [r4+2], m7
-    paddw    m5, m6  ; (a-b)/4-b+c
-    psraw    m5, 2   ; ((a-b)/4-b+c)/4
-    paddw    m5, m6  ; ((a-b)/4-b+c)/4+c = (a-5*b+20*c)/16
-    psraw    m5, 1
-    CLIPW    m5, [pb_0], [pw_pixel_max]
-;avg FILT_V, FILT_H
-    pavgw    m0, m5
-%if %0!=4
-    movu     m5, [r1+r5]
-%endif
-    ret
-%endmacro
-
-INIT_MMX mmxext
-RESET_MM_PERMUTATION
-%assign i 0
-%rep 3
-H_FILT_AVG 4, i
-SWAP 0,1,2,3,4,5
-%assign i i+1
-%endrep
-H_FILT_AVG 4, i, 0
-
-INIT_XMM sse2
-RESET_MM_PERMUTATION
-%assign i 0
-%rep 6
-%if i==1
-H_FILT_AVG 8, i, 0
-%else
-H_FILT_AVG 8, i
-%endif
-SWAP 0,1,2,3,4,5
-%assign i i+1
-%endrep
-
-%macro MC11 2
-; this REALLY needs x86_64
-cglobal_mc %1, mc11, %2, 3,6,8
-    mov      r4, r1
-.body:
-    PRELOAD_V
-
-    sub      r0, r2
-    sub      r4, r2
-    mov      r5, r2
-    neg      r5
-%assign j 0
-%rep %2
-    %assign i (j % 6)
-    call v_filt%2_ %+ i %+ _10
-    call h_filt%2_ %+ i %+ _10
-%if %2==8 && i==1
-    movu     m5, [r1+r5]
-%endif
-    OP_MOV [r0], m0
-    SWAP 0,1,2,3,4,5
-    %assign j j+1
-%endrep
-    ret
-%endmacro
-
-MC MC11
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc31(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC31 2
-cglobal_mc %1, mc31, %2, 3,6,8
-    mov r4, r1
-    add r1, 2
-    jmp stub_%1_h264_qpel%2_mc11_10 %+ SUFFIX %+ .body
-%endmacro
-
-MC MC31
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc13(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC13 2
-cglobal_mc %1, mc13, %2, 3,7,12
-    lea r4, [r1+r2]
-    jmp stub_%1_h264_qpel%2_mc11_10 %+ SUFFIX %+ .body
-%endmacro
-
-MC MC13
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc33(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC33 2
-cglobal_mc %1, mc33, %2, 3,6,8
-    lea r4, [r1+r2]
-    add r1, 2
-    jmp stub_%1_h264_qpel%2_mc11_10 %+ SUFFIX %+ .body
-%endmacro
-
-MC MC33
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc22(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro FILT_H2 3
-    psubw  %1, %2  ; a-b
-    psubw  %2, %3  ; b-c
-    psllw  %2, 2
-    psubw  %1, %2  ; a-5*b+4*c
-    psllw  %3, 4
-    paddw  %1, %3  ; a-5*b+20*c
-%endmacro
-
-%macro FILT_VNRD 8
-    movu     %6, [r1]
-    paddw    %1, %6
-    mova     %7, %2
-    paddw    %7, %5
-    mova     %8, %3
-    paddw    %8, %4
-    FILT_H2  %1, %7, %8
-%endmacro
-
-%macro HV 1
-%if mmsize==16
-%define PAD 12
-%define COUNT 2
-%else
-%define PAD 4
-%define COUNT 3
-%endif
-put_hv%1_10:
-    neg      r2           ; This actually saves instructions
-    lea      r1, [r1+r2*2-mmsize+PAD]
-    lea      r4, [rsp+PAD+gprsize]
-    mov     r3d, COUNT
-.v_loop:
-    movu     m0, [r1]
-    sub      r1, r2
-    movu     m1, [r1]
-    sub      r1, r2
-    movu     m2, [r1]
-    sub      r1, r2
-    movu     m3, [r1]
-    sub      r1, r2
-    movu     m4, [r1]
-    sub      r1, r2
-%assign i 0
-%rep %1-1
-    FILT_VNRD m0, m1, m2, m3, m4, m5, m6, m7
-    psubw    m0, [pad20]
-    movu     [r4+i*mmsize*3], m0
-    sub      r1, r2
-    SWAP 0,1,2,3,4,5
-%assign i i+1
-%endrep
-    FILT_VNRD m0, m1, m2, m3, m4, m5, m6, m7
-    psubw    m0, [pad20]
-    movu     [r4+i*mmsize*3], m0
-    add      r4, mmsize
-    lea      r1, [r1+r2*8+mmsize]
-%if %1==8
-    lea      r1, [r1+r2*4]
-%endif
-    dec      r3d
-    jg .v_loop
-    neg      r2
-    ret
-%endmacro
-
-INIT_MMX mmxext
-HV 4
-INIT_XMM sse2
-HV 8
-
-%macro H_LOOP 1
-%if num_mmregs > 8
-    %define s1 m8
-    %define s2 m9
-    %define s3 m10
-    %define d1 m11
-%else
-    %define s1 [tap1]
-    %define s2 [tap2]
-    %define s3 [tap3]
-    %define d1 [depad]
-%endif
-h%1_loop_op:
-    movu       m1, [r1+mmsize-4]
-    movu       m2, [r1+mmsize-2]
-    mova       m3, [r1+mmsize+0]
-    movu       m4, [r1+mmsize+2]
-    movu       m5, [r1+mmsize+4]
-    movu       m6, [r1+mmsize+6]
-%if num_mmregs > 8
-    pmaddwd    m1, s1
-    pmaddwd    m2, s1
-    pmaddwd    m3, s2
-    pmaddwd    m4, s2
-    pmaddwd    m5, s3
-    pmaddwd    m6, s3
-    paddd      m1, d1
-    paddd      m2, d1
-%else
-    mova       m0, s1
-    pmaddwd    m1, m0
-    pmaddwd    m2, m0
-    mova       m0, s2
-    pmaddwd    m3, m0
-    pmaddwd    m4, m0
-    mova       m0, s3
-    pmaddwd    m5, m0
-    pmaddwd    m6, m0
-    mova       m0, d1
-    paddd      m1, m0
-    paddd      m2, m0
-%endif
-    paddd      m3, m5
-    paddd      m4, m6
-    paddd      m1, m3
-    paddd      m2, m4
-    psrad      m1, 10
-    psrad      m2, 10
-    pslld      m2, 16
-    pand       m1, [pd_0f]
-    por        m1, m2
-%if num_mmregs <= 8
-    pxor       m0, m0
-%endif
-    CLIPW      m1, m0, m7
-    add        r1, mmsize*3
-    ret
-%endmacro
-
-INIT_MMX mmxext
-H_LOOP 4
-INIT_XMM sse2
-H_LOOP 8
-
-%macro MC22 2
-cglobal_mc %1, mc22, %2, 3,7,12
-%define PAD mmsize*8*4*2      ; SIZE*16*4*sizeof(pixel)
-    mov      r6, rsp          ; backup stack pointer
-    and     rsp, ~(mmsize-1)  ; align stack
-    sub     rsp, PAD
-
-    call put_hv%2_10
-
-    mov       r3d, %2
-    mova       m7, [pw_pixel_max]
-%if num_mmregs > 8
-    pxor       m0, m0
-    mova       m8, [tap1]
-    mova       m9, [tap2]
-    mova      m10, [tap3]
-    mova      m11, [depad]
-%endif
-    mov        r1, rsp
-.h_loop:
-    call h%2_loop_op
-
-    OP_MOV   [r0], m1
-    add        r0, r2
-    dec       r3d
-    jg .h_loop
-
-    mov     rsp, r6          ; restore stack pointer
-    ret
-%endmacro
-
-MC MC22
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc12(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC12 2
-cglobal_mc %1, mc12, %2, 3,7,12
-%define PAD mmsize*8*4*2        ; SIZE*16*4*sizeof(pixel)
-    mov        r6, rsp          ; backup stack pointer
-    and       rsp, ~(mmsize-1)  ; align stack
-    sub       rsp, PAD
-
-    call put_hv%2_10
-
-    xor       r4d, r4d
-.body:
-    mov       r3d, %2
-    pxor       m0, m0
-    mova       m7, [pw_pixel_max]
-%if num_mmregs > 8
-    mova       m8, [tap1]
-    mova       m9, [tap2]
-    mova      m10, [tap3]
-    mova      m11, [depad]
-%endif
-    mov        r1, rsp
-.h_loop:
-    call h%2_loop_op
-
-    movu       m3, [r1+r4-2*mmsize] ; movu needed for mc32, etc
-    paddw      m3, [depad2]
-    psrlw      m3, 5
-    psubw      m3, [unpad]
-    CLIPW      m3, m0, m7
-    pavgw      m1, m3
-
-    OP_MOV   [r0], m1
-    add        r0, r2
-    dec       r3d
-    jg .h_loop
-
-    mov     rsp, r6          ; restore stack pointer
-    ret
-%endmacro
-
-MC MC12
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc32(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC32 2
-cglobal_mc %1, mc32, %2, 3,7,12
-%define PAD mmsize*8*3*2  ; SIZE*16*4*sizeof(pixel)
-    mov  r6, rsp          ; backup stack pointer
-    and rsp, ~(mmsize-1)  ; align stack
-    sub rsp, PAD
-
-    call put_hv%2_10
-
-    mov r4d, 2            ; sizeof(pixel)
-    jmp stub_%1_h264_qpel%2_mc12_10 %+ SUFFIX %+ .body
-%endmacro
-
-MC MC32
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc21(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro H_NRD 1
-put_h%1_10:
-    add       rsp, gprsize
-    mov       r3d, %1
-    xor       r4d, r4d
-    mova       m6, [pad20]
-.nextrow:
-    movu       m2, [r5-4]
-    movu       m3, [r5-2]
-    movu       m4, [r5+0]
-    ADDW       m2, [r5+6], m5
-    ADDW       m3, [r5+4], m5
-    ADDW       m4, [r5+2], m5
-
-    FILT_H2    m2, m3, m4
-    psubw      m2, m6
-    mova [rsp+r4], m2
-    add       r4d, mmsize*3
-    add        r5, r2
-    dec       r3d
-    jg .nextrow
-    sub       rsp, gprsize
-    ret
-%endmacro
-
-INIT_MMX mmxext
-H_NRD 4
-INIT_XMM sse2
-H_NRD 8
-
-%macro MC21 2
-cglobal_mc %1, mc21, %2, 3,7,12
-    mov   r5, r1
-.body:
-%define PAD mmsize*8*3*2   ; SIZE*16*4*sizeof(pixel)
-    mov   r6, rsp          ; backup stack pointer
-    and  rsp, ~(mmsize-1)  ; align stack
-
-    sub  rsp, PAD
-    call put_h%2_10
-
-    sub  rsp, PAD
-    call put_hv%2_10
-
-    mov r4d, PAD-mmsize    ; H buffer
-    jmp stub_%1_h264_qpel%2_mc12_10 %+ SUFFIX %+ .body
-%endmacro
-
-MC MC21
-
-;-----------------------------------------------------------------------------
-; void h264_qpel_mc23(uint8_t *dst, uint8_t *src, int stride)
-;-----------------------------------------------------------------------------
-%macro MC23 2
-cglobal_mc %1, mc23, %2, 3,7,12
-    lea   r5, [r1+r2]
-    jmp stub_%1_h264_qpel%2_mc21_10 %+ SUFFIX %+ .body
-%endmacro
-
-MC MC23
diff --git a/deps/libav/libavcodec/x86/h264_qpel_8bit.asm b/deps/libav/libavcodec/x86/h264_qpel_8bit.asm
deleted file mode 100644
index bc6c725..0000000
--- a/deps/libav/libavcodec/x86/h264_qpel_8bit.asm
+++ /dev/null
@@ -1,862 +0,0 @@
-;*****************************************************************************
-;* MMX/SSE2/SSSE3-optimized H.264 QPEL code
-;*****************************************************************************
-;* Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
-;* Copyright (C) 2012 Daniel Kang
-;*
-;* Authors: Daniel Kang <daniel.d.kang at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA 32
-
-cextern pw_16
-cextern pw_5
-cextern pb_0
-
-SECTION .text
-
-
-%macro op_avgh 3
-    movh   %3, %2
-    pavgb  %1, %3
-    movh   %2, %1
-%endmacro
-
-%macro op_avg 2-3
-    pavgb  %1, %2
-    mova   %2, %1
-%endmacro
-
-%macro op_puth 2-3
-    movh   %2, %1
-%endmacro
-
-%macro op_put 2-3
-    mova   %2, %1
-%endmacro
-
-%macro QPEL4_H_LOWPASS_OP 1
-cglobal %1_h264_qpel4_h_lowpass, 4,5 ; dst, src, dstStride, srcStride
-    movsxdifnidn  r2, r2d
-    movsxdifnidn  r3, r3d
-    pxor          m7, m7
-    mova          m4, [pw_5]
-    mova          m5, [pw_16]
-    mov          r4d, 4
-.loop:
-    movh          m1, [r1-1]
-    movh          m2, [r1+0]
-    movh          m3, [r1+1]
-    movh          m0, [r1+2]
-    punpcklbw     m1, m7
-    punpcklbw     m2, m7
-    punpcklbw     m3, m7
-    punpcklbw     m0, m7
-    paddw         m1, m0
-    paddw         m2, m3
-    movh          m0, [r1-2]
-    movh          m3, [r1+3]
-    punpcklbw     m0, m7
-    punpcklbw     m3, m7
-    paddw         m0, m3
-    psllw         m2, 2
-    psubw         m2, m1
-    pmullw        m2, m4
-    paddw         m0, m5
-    paddw         m0, m2
-    psraw         m0, 5
-    packuswb      m0, m0
-    op_%1h        m0, [r0], m6
-    add           r0, r2
-    add           r1, r3
-    dec          r4d
-    jg         .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-QPEL4_H_LOWPASS_OP put
-QPEL4_H_LOWPASS_OP avg
-
-%macro QPEL8_H_LOWPASS_OP 1
-cglobal %1_h264_qpel8_h_lowpass, 4,5 ; dst, src, dstStride, srcStride
-    movsxdifnidn  r2, r2d
-    movsxdifnidn  r3, r3d
-    mov          r4d, 8
-    pxor          m7, m7
-    mova          m6, [pw_5]
-.loop:
-    mova          m0, [r1]
-    mova          m2, [r1+1]
-    mova          m1, m0
-    mova          m3, m2
-    punpcklbw     m0, m7
-    punpckhbw     m1, m7
-    punpcklbw     m2, m7
-    punpckhbw     m3, m7
-    paddw         m0, m2
-    paddw         m1, m3
-    psllw         m0, 2
-    psllw         m1, 2
-    mova          m2, [r1-1]
-    mova          m4, [r1+2]
-    mova          m3, m2
-    mova          m5, m4
-    punpcklbw     m2, m7
-    punpckhbw     m3, m7
-    punpcklbw     m4, m7
-    punpckhbw     m5, m7
-    paddw         m2, m4
-    paddw         m5, m3
-    psubw         m0, m2
-    psubw         m1, m5
-    pmullw        m0, m6
-    pmullw        m1, m6
-    movd          m2, [r1-2]
-    movd          m5, [r1+7]
-    punpcklbw     m2, m7
-    punpcklbw     m5, m7
-    paddw         m2, m3
-    paddw         m4, m5
-    mova          m5, [pw_16]
-    paddw         m2, m5
-    paddw         m4, m5
-    paddw         m0, m2
-    paddw         m1, m4
-    psraw         m0, 5
-    psraw         m1, 5
-    packuswb      m0, m1
-    op_%1         m0, [r0], m4
-    add           r0, r2
-    add           r1, r3
-    dec          r4d
-    jg         .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-QPEL8_H_LOWPASS_OP put
-QPEL8_H_LOWPASS_OP avg
-
-%macro QPEL8_H_LOWPASS_OP_XMM 1
-cglobal %1_h264_qpel8_h_lowpass, 4,5,8 ; dst, src, dstStride, srcStride
-    movsxdifnidn  r2, r2d
-    movsxdifnidn  r3, r3d
-    mov          r4d, 8
-    pxor          m7, m7
-    mova          m6, [pw_5]
-.loop:
-    movu          m1, [r1-2]
-    mova          m0, m1
-    punpckhbw     m1, m7
-    punpcklbw     m0, m7
-    mova          m2, m1
-    mova          m3, m1
-    mova          m4, m1
-    mova          m5, m1
-    palignr       m4, m0, 2
-    palignr       m3, m0, 4
-    palignr       m2, m0, 6
-    palignr       m1, m0, 8
-    palignr       m5, m0, 10
-    paddw         m0, m5
-    paddw         m2, m3
-    paddw         m1, m4
-    psllw         m2, 2
-    psubw         m2, m1
-    paddw         m0, [pw_16]
-    pmullw        m2, m6
-    paddw         m2, m0
-    psraw         m2, 5
-    packuswb      m2, m2
-    op_%1h        m2, [r0], m4
-    add           r1, r3
-    add           r0, r2
-    dec          r4d
-    jne        .loop
-    REP_RET
-%endmacro
-
-INIT_XMM ssse3
-QPEL8_H_LOWPASS_OP_XMM put
-QPEL8_H_LOWPASS_OP_XMM avg
-
-
-%macro QPEL4_H_LOWPASS_L2_OP 1
-cglobal %1_h264_qpel4_h_lowpass_l2, 5,6 ; dst, src, src2, dstStride, srcStride
-    movsxdifnidn  r3, r3d
-    movsxdifnidn  r4, r4d
-    pxor          m7, m7
-    mova          m4, [pw_5]
-    mova          m5, [pw_16]
-    mov          r5d, 4
-.loop:
-    movh          m1, [r1-1]
-    movh          m2, [r1+0]
-    movh          m3, [r1+1]
-    movh          m0, [r1+2]
-    punpcklbw     m1, m7
-    punpcklbw     m2, m7
-    punpcklbw     m3, m7
-    punpcklbw     m0, m7
-    paddw         m1, m0
-    paddw         m2, m3
-    movh          m0, [r1-2]
-    movh          m3, [r1+3]
-    punpcklbw     m0, m7
-    punpcklbw     m3, m7
-    paddw         m0, m3
-    psllw         m2, 2
-    psubw         m2, m1
-    pmullw        m2, m4
-    paddw         m0, m5
-    paddw         m0, m2
-    movh          m3, [r2]
-    psraw         m0, 5
-    packuswb      m0, m0
-    pavgb         m0, m3
-    op_%1h        m0, [r0], m6
-    add           r0, r3
-    add           r1, r3
-    add           r2, r4
-    dec          r5d
-    jg         .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-QPEL4_H_LOWPASS_L2_OP put
-QPEL4_H_LOWPASS_L2_OP avg
-
-
-%macro QPEL8_H_LOWPASS_L2_OP 1
-cglobal %1_h264_qpel8_h_lowpass_l2, 5,6 ; dst, src, src2, dstStride, srcStride
-    movsxdifnidn  r3, r3d
-    movsxdifnidn  r4, r4d
-    mov          r5d, 8
-    pxor          m7, m7
-    mova          m6, [pw_5]
-.loop:
-    mova          m0, [r1]
-    mova          m2, [r1+1]
-    mova          m1, m0
-    mova          m3, m2
-    punpcklbw     m0, m7
-    punpckhbw     m1, m7
-    punpcklbw     m2, m7
-    punpckhbw     m3, m7
-    paddw         m0, m2
-    paddw         m1, m3
-    psllw         m0, 2
-    psllw         m1, 2
-    mova          m2, [r1-1]
-    mova          m4, [r1+2]
-    mova          m3, m2
-    mova          m5, m4
-    punpcklbw     m2, m7
-    punpckhbw     m3, m7
-    punpcklbw     m4, m7
-    punpckhbw     m5, m7
-    paddw         m2, m4
-    paddw         m5, m3
-    psubw         m0, m2
-    psubw         m1, m5
-    pmullw        m0, m6
-    pmullw        m1, m6
-    movd          m2, [r1-2]
-    movd          m5, [r1+7]
-    punpcklbw     m2, m7
-    punpcklbw     m5, m7
-    paddw         m2, m3
-    paddw         m4, m5
-    mova          m5, [pw_16]
-    paddw         m2, m5
-    paddw         m4, m5
-    paddw         m0, m2
-    paddw         m1, m4
-    psraw         m0, 5
-    psraw         m1, 5
-    mova          m4, [r2]
-    packuswb      m0, m1
-    pavgb         m0, m4
-    op_%1         m0, [r0], m4
-    add           r0, r3
-    add           r1, r3
-    add           r2, r4
-    dec          r5d
-    jg         .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-QPEL8_H_LOWPASS_L2_OP put
-QPEL8_H_LOWPASS_L2_OP avg
-
-
-%macro QPEL8_H_LOWPASS_L2_OP_XMM 1
-cglobal %1_h264_qpel8_h_lowpass_l2, 5,6,8 ; dst, src, src2, dstStride, src2Stride
-    movsxdifnidn  r3, r3d
-    movsxdifnidn  r4, r4d
-    mov          r5d, 8
-    pxor          m7, m7
-    mova          m6, [pw_5]
-.loop:
-    lddqu         m1, [r1-2]
-    mova          m0, m1
-    punpckhbw     m1, m7
-    punpcklbw     m0, m7
-    mova          m2, m1
-    mova          m3, m1
-    mova          m4, m1
-    mova          m5, m1
-    palignr       m4, m0, 2
-    palignr       m3, m0, 4
-    palignr       m2, m0, 6
-    palignr       m1, m0, 8
-    palignr       m5, m0, 10
-    paddw         m0, m5
-    paddw         m2, m3
-    paddw         m1, m4
-    psllw         m2, 2
-    movh          m3, [r2]
-    psubw         m2, m1
-    paddw         m0, [pw_16]
-    pmullw        m2, m6
-    paddw         m2, m0
-    psraw         m2, 5
-    packuswb      m2, m2
-    pavgb         m2, m3
-    op_%1h        m2, [r0], m4
-    add           r1, r3
-    add           r0, r3
-    add           r2, r4
-    dec          r5d
-    jg         .loop
-    REP_RET
-%endmacro
-
-INIT_XMM ssse3
-QPEL8_H_LOWPASS_L2_OP_XMM put
-QPEL8_H_LOWPASS_L2_OP_XMM avg
-
-
-; All functions that call this are required to have function arguments of
-; dst, src, dstStride, srcStride
-%macro FILT_V 1
-    mova      m6, m2
-    movh      m5, [r1]
-    paddw     m6, m3
-    psllw     m6, 2
-    psubw     m6, m1
-    psubw     m6, m4
-    punpcklbw m5, m7
-    pmullw    m6, [pw_5]
-    paddw     m0, [pw_16]
-    add       r1, r3
-    paddw     m0, m5
-    paddw     m6, m0
-    psraw     m6, 5
-    packuswb  m6, m6
-    op_%1h    m6, [r0], m0 ; 1
-    add       r0, r2
-    SWAP       0, 1, 2, 3, 4, 5
-%endmacro
-
-%macro QPEL4_V_LOWPASS_OP 1
-cglobal %1_h264_qpel4_v_lowpass, 4,4 ; dst, src, dstStride, srcStride
-    movsxdifnidn  r2, r2d
-    movsxdifnidn  r3, r3d
-    sub           r1, r3
-    sub           r1, r3
-    pxor          m7, m7
-    movh          m0, [r1]
-    movh          m1, [r1+r3]
-    lea           r1, [r1+2*r3]
-    movh          m2, [r1]
-    movh          m3, [r1+r3]
-    lea           r1, [r1+2*r3]
-    movh          m4, [r1]
-    add           r1, r3
-    punpcklbw     m0, m7
-    punpcklbw     m1, m7
-    punpcklbw     m2, m7
-    punpcklbw     m3, m7
-    punpcklbw     m4, m7
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    RET
-%endmacro
-
-INIT_MMX mmxext
-QPEL4_V_LOWPASS_OP put
-QPEL4_V_LOWPASS_OP avg
-
-
-
-%macro QPEL8OR16_V_LOWPASS_OP 1
-%if cpuflag(sse2)
-cglobal %1_h264_qpel8or16_v_lowpass, 5,5,8 ; dst, src, dstStride, srcStride, h
-    movsxdifnidn  r2, r2d
-    movsxdifnidn  r3, r3d
-    sub           r1, r3
-    sub           r1, r3
-%else
-cglobal %1_h264_qpel8or16_v_lowpass_op, 5,5,8 ; dst, src, dstStride, srcStride, h
-    movsxdifnidn  r2, r2d
-    movsxdifnidn  r3, r3d
-%endif
-    pxor          m7, m7
-    movh          m0, [r1]
-    movh          m1, [r1+r3]
-    lea           r1, [r1+2*r3]
-    movh          m2, [r1]
-    movh          m3, [r1+r3]
-    lea           r1, [r1+2*r3]
-    movh          m4, [r1]
-    add           r1, r3
-    punpcklbw     m0, m7
-    punpcklbw     m1, m7
-    punpcklbw     m2, m7
-    punpcklbw     m3, m7
-    punpcklbw     m4, m7
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    cmp          r4d, 16
-    jne         .end
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-    FILT_V        %1
-.end:
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-QPEL8OR16_V_LOWPASS_OP put
-QPEL8OR16_V_LOWPASS_OP avg
-
-INIT_XMM sse2
-QPEL8OR16_V_LOWPASS_OP put
-QPEL8OR16_V_LOWPASS_OP avg
-
-
-; All functions that use this are required to have args:
-; src, tmp, srcSize
-%macro FILT_HV 1 ; offset
-    mova           m6, m2
-    movh           m5, [r0]
-    paddw          m6, m3
-    psllw          m6, 2
-    paddw          m0, [pw_16]
-    psubw          m6, m1
-    psubw          m6, m4
-    punpcklbw      m5, m7
-    pmullw         m6, [pw_5]
-    paddw          m0, m5
-    add            r0, r2
-    paddw          m6, m0
-    mova      [r1+%1], m6
-    SWAP            0, 1, 2, 3, 4, 5
-%endmacro
-
-%macro QPEL4_HV1_LOWPASS_OP 1
-cglobal %1_h264_qpel4_hv_lowpass_v, 3,3 ; src, tmp, srcStride
-    movsxdifnidn  r2, r2d
-    pxor          m7, m7
-    movh          m0, [r0]
-    movh          m1, [r0+r2]
-    lea           r0, [r0+2*r2]
-    movh          m2, [r0]
-    movh          m3, [r0+r2]
-    lea           r0, [r0+2*r2]
-    movh          m4, [r0]
-    add           r0, r2
-    punpcklbw     m0, m7
-    punpcklbw     m1, m7
-    punpcklbw     m2, m7
-    punpcklbw     m3, m7
-    punpcklbw     m4, m7
-    FILT_HV       0*24
-    FILT_HV       1*24
-    FILT_HV       2*24
-    FILT_HV       3*24
-    RET
-
-cglobal %1_h264_qpel4_hv_lowpass_h, 3,4 ; tmp, dst, dstStride
-    movsxdifnidn  r2, r2d
-    mov          r3d, 4
-.loop:
-    mova          m0, [r0]
-    paddw         m0, [r0+10]
-    mova          m1, [r0+2]
-    paddw         m1, [r0+8]
-    mova          m2, [r0+4]
-    paddw         m2, [r0+6]
-    psubw         m0, m1
-    psraw         m0, 2
-    psubw         m0, m1
-    paddsw        m0, m2
-    psraw         m0, 2
-    paddw         m0, m2
-    psraw         m0, 6
-    packuswb      m0, m0
-    op_%1h        m0, [r1], m7
-    add           r0, 24
-    add           r1, r2
-    dec          r3d
-    jnz        .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-QPEL4_HV1_LOWPASS_OP put
-QPEL4_HV1_LOWPASS_OP avg
-
-%macro QPEL8OR16_HV1_LOWPASS_OP 1
-cglobal %1_h264_qpel8or16_hv1_lowpass_op, 4,4,8 ; src, tmp, srcStride, size
-    movsxdifnidn  r2, r2d
-    pxor          m7, m7
-    movh          m0, [r0]
-    movh          m1, [r0+r2]
-    lea           r0, [r0+2*r2]
-    movh          m2, [r0]
-    movh          m3, [r0+r2]
-    lea           r0, [r0+2*r2]
-    movh          m4, [r0]
-    add           r0, r2
-    punpcklbw     m0, m7
-    punpcklbw     m1, m7
-    punpcklbw     m2, m7
-    punpcklbw     m3, m7
-    punpcklbw     m4, m7
-    FILT_HV     0*48
-    FILT_HV     1*48
-    FILT_HV     2*48
-    FILT_HV     3*48
-    FILT_HV     4*48
-    FILT_HV     5*48
-    FILT_HV     6*48
-    FILT_HV     7*48
-    cmp          r3d, 16
-    jne         .end
-    FILT_HV     8*48
-    FILT_HV     9*48
-    FILT_HV    10*48
-    FILT_HV    11*48
-    FILT_HV    12*48
-    FILT_HV    13*48
-    FILT_HV    14*48
-    FILT_HV    15*48
-.end:
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-QPEL8OR16_HV1_LOWPASS_OP put
-QPEL8OR16_HV1_LOWPASS_OP avg
-
-INIT_XMM sse2
-QPEL8OR16_HV1_LOWPASS_OP put
-
-
-
-%macro QPEL8OR16_HV2_LOWPASS_OP 1
-; unused is to match ssse3 and mmxext args
-cglobal %1_h264_qpel8or16_hv2_lowpass_op, 5,5 ; dst, tmp, dstStride, unused, h
-    movsxdifnidn  r2, r2d
-.loop:
-    mova          m0, [r1]
-    mova          m3, [r1+8]
-    mova          m1, [r1+2]
-    mova          m4, [r1+10]
-    paddw         m0, m4
-    paddw         m1, m3
-    paddw         m3, [r1+18]
-    paddw         m4, [r1+16]
-    mova          m2, [r1+4]
-    mova          m5, [r1+12]
-    paddw         m2, [r1+6]
-    paddw         m5, [r1+14]
-    psubw         m0, m1
-    psubw         m3, m4
-    psraw         m0, 2
-    psraw         m3, 2
-    psubw         m0, m1
-    psubw         m3, m4
-    paddsw        m0, m2
-    paddsw        m3, m5
-    psraw         m0, 2
-    psraw         m3, 2
-    paddw         m0, m2
-    paddw         m3, m5
-    psraw         m0, 6
-    psraw         m3, 6
-    packuswb      m0, m3
-    op_%1         m0, [r0], m7
-    add           r1, 48
-    add           r0, r2
-    dec          r4d
-    jne        .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-QPEL8OR16_HV2_LOWPASS_OP put
-QPEL8OR16_HV2_LOWPASS_OP avg
-
-%macro QPEL8OR16_HV2_LOWPASS_OP_XMM 1
-cglobal %1_h264_qpel8or16_hv2_lowpass, 5,5,8 ; dst, tmp, dstStride, tmpStride, size
-    movsxdifnidn  r2, r2d
-    movsxdifnidn  r3, r3d
-    cmp          r4d, 16
-    je         .op16
-.loop8:
-    mova          m1, [r1+16]
-    mova          m0, [r1]
-    mova          m2, m1
-    mova          m3, m1
-    mova          m4, m1
-    mova          m5, m1
-    palignr       m5, m0, 10
-    palignr       m4, m0, 8
-    palignr       m3, m0, 6
-    palignr       m2, m0, 4
-    palignr       m1, m0, 2
-    paddw         m0, m5
-    paddw         m1, m4
-    paddw         m2, m3
-    psubw         m0, m1
-    psraw         m0, 2
-    psubw         m0, m1
-    paddw         m0, m2
-    psraw         m0, 2
-    paddw         m0, m2
-    psraw         m0, 6
-    packuswb      m0, m0
-    op_%1h        m0, [r0], m7
-    add           r1, 48
-    add           r0, r2
-    dec          r4d
-    jne       .loop8
-    jmp        .done
-.op16:
-    mova          m4, [r1+32]
-    mova          m5, [r1+16]
-    mova          m7, [r1]
-    mova          m3, m4
-    mova          m2, m4
-    mova          m1, m4
-    mova          m0, m4
-    palignr       m0, m5, 10
-    palignr       m1, m5, 8
-    palignr       m2, m5, 6
-    palignr       m3, m5, 4
-    palignr       m4, m5, 2
-    paddw         m0, m5
-    paddw         m1, m4
-    paddw         m2, m3
-    mova          m6, m5
-    mova          m4, m5
-    mova          m3, m5
-    palignr       m4, m7, 8
-    palignr       m6, m7, 2
-    palignr       m3, m7, 10
-    paddw         m4, m6
-    mova          m6, m5
-    palignr       m5, m7, 6
-    palignr       m6, m7, 4
-    paddw         m3, m7
-    paddw         m5, m6
-    psubw         m0, m1
-    psubw         m3, m4
-    psraw         m0, 2
-    psraw         m3, 2
-    psubw         m0, m1
-    psubw         m3, m4
-    paddw         m0, m2
-    paddw         m3, m5
-    psraw         m0, 2
-    psraw         m3, 2
-    paddw         m0, m2
-    paddw         m3, m5
-    psraw         m0, 6
-    psraw         m3, 6
-    packuswb      m3, m0
-    op_%1         m3, [r0], m7
-    add           r1, 48
-    add           r0, r2
-    dec          r4d
-    jne        .op16
-.done:
-    REP_RET
-%endmacro
-
-INIT_XMM ssse3
-QPEL8OR16_HV2_LOWPASS_OP_XMM put
-QPEL8OR16_HV2_LOWPASS_OP_XMM avg
-
-
-%macro PIXELS4_L2_SHIFT5 1
-cglobal %1_pixels4_l2_shift5,6,6 ; dst, src16, src8, dstStride, src8Stride, h
-    movsxdifnidn  r3, r3d
-    movsxdifnidn  r4, r4d
-    mova          m0, [r1]
-    mova          m1, [r1+24]
-    psraw         m0, 5
-    psraw         m1, 5
-    packuswb      m0, m0
-    packuswb      m1, m1
-    pavgb         m0, [r2]
-    pavgb         m1, [r2+r4]
-    op_%1h        m0, [r0], m4
-    op_%1h        m1, [r0+r3], m5
-    lea           r2, [r2+r4*2]
-    lea           r0, [r0+r3*2]
-    mova          m0, [r1+48]
-    mova          m1, [r1+72]
-    psraw         m0, 5
-    psraw         m1, 5
-    packuswb      m0, m0
-    packuswb      m1, m1
-    pavgb         m0, [r2]
-    pavgb         m1, [r2+r4]
-    op_%1h        m0, [r0], m4
-    op_%1h        m1, [r0+r3], m5
-    RET
-%endmacro
-
-INIT_MMX mmxext
-PIXELS4_L2_SHIFT5 put
-PIXELS4_L2_SHIFT5 avg
-
-
-%macro PIXELS8_L2_SHIFT5 1
-cglobal %1_pixels8_l2_shift5, 6, 6 ; dst, src16, src8, dstStride, src8Stride, h
-    movsxdifnidn  r3, r3d
-    movsxdifnidn  r4, r4d
-.loop:
-    mova          m0, [r1]
-    mova          m1, [r1+8]
-    mova          m2, [r1+48]
-    mova          m3, [r1+48+8]
-    psraw         m0, 5
-    psraw         m1, 5
-    psraw         m2, 5
-    psraw         m3, 5
-    packuswb      m0, m1
-    packuswb      m2, m3
-    pavgb         m0, [r2]
-    pavgb         m2, [r2+r4]
-    op_%1         m0, [r0], m4
-    op_%1         m2, [r0+r3], m5
-    lea           r2, [r2+2*r4]
-    add           r1, 48*2
-    lea           r0, [r0+2*r3]
-    sub          r5d, 2
-    jne        .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PIXELS8_L2_SHIFT5 put
-PIXELS8_L2_SHIFT5 avg
-
-
-%if ARCH_X86_64
-%macro QPEL16_H_LOWPASS_L2_OP 1
-cglobal %1_h264_qpel16_h_lowpass_l2, 5, 6, 16 ; dst, src, src2, dstStride, src2Stride
-    movsxdifnidn  r3, r3d
-    movsxdifnidn  r4, r4d
-    mov          r5d, 16
-    pxor         m15, m15
-    mova         m14, [pw_5]
-    mova         m13, [pw_16]
-.loop:
-    lddqu         m1, [r1+6]
-    lddqu         m7, [r1-2]
-    mova          m0, m1
-    punpckhbw     m1, m15
-    punpcklbw     m0, m15
-    punpcklbw     m7, m15
-    mova          m2, m1
-    mova          m6, m0
-    mova          m3, m1
-    mova          m8, m0
-    mova          m4, m1
-    mova          m9, m0
-    mova         m12, m0
-    mova         m11, m1
-    palignr      m11, m0, 10
-    palignr      m12, m7, 10
-    palignr       m4, m0, 2
-    palignr       m9, m7, 2
-    palignr       m3, m0, 4
-    palignr       m8, m7, 4
-    palignr       m2, m0, 6
-    palignr       m6, m7, 6
-    paddw        m11, m0
-    palignr       m1, m0, 8
-    palignr       m0, m7, 8
-    paddw         m7, m12
-    paddw         m2, m3
-    paddw         m6, m8
-    paddw         m1, m4
-    paddw         m0, m9
-    psllw         m2, 2
-    psllw         m6, 2
-    psubw         m2, m1
-    psubw         m6, m0
-    paddw        m11, m13
-    paddw         m7, m13
-    pmullw        m2, m14
-    pmullw        m6, m14
-    lddqu         m3, [r2]
-    paddw         m2, m11
-    paddw         m6, m7
-    psraw         m2, 5
-    psraw         m6, 5
-    packuswb      m6, m2
-    pavgb         m6, m3
-    op_%1         m6, [r0], m11
-    add           r1, r3
-    add           r0, r3
-    add           r2, r4
-    dec          r5d
-    jg         .loop
-    REP_RET
-%endmacro
-
-INIT_XMM ssse3
-QPEL16_H_LOWPASS_L2_OP put
-QPEL16_H_LOWPASS_L2_OP avg
-%endif
diff --git a/deps/libav/libavcodec/x86/h264_weight.asm b/deps/libav/libavcodec/x86/h264_weight.asm
deleted file mode 100644
index 646acdf..0000000
--- a/deps/libav/libavcodec/x86/h264_weight.asm
+++ /dev/null
@@ -1,310 +0,0 @@
-;*****************************************************************************
-;* SSE2-optimized weighted prediction code
-;*****************************************************************************
-;* Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
-;* Copyright (C) 2010 Eli Friedman <eli.friedman at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; biweight pred:
-;
-; void h264_biweight_16_sse2(uint8_t *dst, uint8_t *src, int stride,
-;                            int height, int log2_denom, int weightd,
-;                            int weights, int offset);
-; and
-; void h264_weight_16_sse2(uint8_t *dst, int stride, int height,
-;                          int log2_denom, int weight, int offset);
-;-----------------------------------------------------------------------------
-
-%macro WEIGHT_SETUP 0
-    add        r5, r5
-    inc        r5
-    movd       m3, r4d
-    movd       m5, r5d
-    movd       m6, r3d
-    pslld      m5, m6
-    psrld      m5, 1
-%if mmsize == 16
-    pshuflw    m3, m3, 0
-    pshuflw    m5, m5, 0
-    punpcklqdq m3, m3
-    punpcklqdq m5, m5
-%else
-    pshufw     m3, m3, 0
-    pshufw     m5, m5, 0
-%endif
-    pxor       m7, m7
-%endmacro
-
-%macro WEIGHT_OP 2
-    movh          m0, [r0+%1]
-    movh          m1, [r0+%2]
-    punpcklbw     m0, m7
-    punpcklbw     m1, m7
-    pmullw        m0, m3
-    pmullw        m1, m3
-    paddsw        m0, m5
-    paddsw        m1, m5
-    psraw         m0, m6
-    psraw         m1, m6
-    packuswb      m0, m1
-%endmacro
-
-INIT_MMX mmxext
-cglobal h264_weight_16, 6, 6, 0
-    WEIGHT_SETUP
-.nextrow:
-    WEIGHT_OP 0,  4
-    mova     [r0  ], m0
-    WEIGHT_OP 8, 12
-    mova     [r0+8], m0
-    add        r0, r1
-    dec        r2d
-    jnz .nextrow
-    REP_RET
-
-%macro WEIGHT_FUNC_MM 2
-cglobal h264_weight_%1, 6, 6, %2
-    WEIGHT_SETUP
-.nextrow:
-    WEIGHT_OP 0, mmsize/2
-    mova     [r0], m0
-    add        r0, r1
-    dec        r2d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-WEIGHT_FUNC_MM  8, 0
-INIT_XMM sse2
-WEIGHT_FUNC_MM 16, 8
-
-%macro WEIGHT_FUNC_HALF_MM 2
-cglobal h264_weight_%1, 6, 6, %2
-    WEIGHT_SETUP
-    sar       r2d, 1
-    lea        r3, [r1*2]
-.nextrow:
-    WEIGHT_OP 0, r1
-    movh     [r0], m0
-%if mmsize == 16
-    movhps   [r0+r1], m0
-%else
-    psrlq      m0, 32
-    movh     [r0+r1], m0
-%endif
-    add        r0, r3
-    dec        r2d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-WEIGHT_FUNC_HALF_MM 4, 0
-INIT_XMM sse2
-WEIGHT_FUNC_HALF_MM 8, 8
-
-%macro BIWEIGHT_SETUP 0
-%if ARCH_X86_64
-%define off_regd r7d
-%else
-%define off_regd r3d
-%endif
-    mov  off_regd, r7m
-    add  off_regd, 1
-    or   off_regd, 1
-    add        r4, 1
-%if cpuflag(ssse3)
-    movd       m4, r5d
-    movd       m0, r6d
-%else
-    movd       m3, r5d
-    movd       m4, r6d
-%endif
-    movd       m5, off_regd
-    movd       m6, r4d
-    pslld      m5, m6
-    psrld      m5, 1
-%if cpuflag(ssse3)
-    punpcklbw  m4, m0
-    pshuflw    m4, m4, 0
-    pshuflw    m5, m5, 0
-    punpcklqdq m4, m4
-    punpcklqdq m5, m5
-
-%else
-%if mmsize == 16
-    pshuflw    m3, m3, 0
-    pshuflw    m4, m4, 0
-    pshuflw    m5, m5, 0
-    punpcklqdq m3, m3
-    punpcklqdq m4, m4
-    punpcklqdq m5, m5
-%else
-    pshufw     m3, m3, 0
-    pshufw     m4, m4, 0
-    pshufw     m5, m5, 0
-%endif
-    pxor       m7, m7
-%endif
-%endmacro
-
-%macro BIWEIGHT_STEPA 3
-    movh       m%1, [r0+%3]
-    movh       m%2, [r1+%3]
-    punpcklbw  m%1, m7
-    punpcklbw  m%2, m7
-    pmullw     m%1, m3
-    pmullw     m%2, m4
-    paddsw     m%1, m%2
-%endmacro
-
-%macro BIWEIGHT_STEPB 0
-    paddsw     m0, m5
-    paddsw     m1, m5
-    psraw      m0, m6
-    psraw      m1, m6
-    packuswb   m0, m1
-%endmacro
-
-INIT_MMX mmxext
-cglobal h264_biweight_16, 7, 8, 0
-    BIWEIGHT_SETUP
-    movifnidn r3d, r3m
-.nextrow:
-    BIWEIGHT_STEPA 0, 1, 0
-    BIWEIGHT_STEPA 1, 2, 4
-    BIWEIGHT_STEPB
-    mova       [r0], m0
-    BIWEIGHT_STEPA 0, 1, 8
-    BIWEIGHT_STEPA 1, 2, 12
-    BIWEIGHT_STEPB
-    mova     [r0+8], m0
-    add        r0, r2
-    add        r1, r2
-    dec        r3d
-    jnz .nextrow
-    REP_RET
-
-%macro BIWEIGHT_FUNC_MM 2
-cglobal h264_biweight_%1, 7, 8, %2
-    BIWEIGHT_SETUP
-    movifnidn r3d, r3m
-.nextrow:
-    BIWEIGHT_STEPA 0, 1, 0
-    BIWEIGHT_STEPA 1, 2, mmsize/2
-    BIWEIGHT_STEPB
-    mova       [r0], m0
-    add        r0, r2
-    add        r1, r2
-    dec        r3d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-BIWEIGHT_FUNC_MM  8, 0
-INIT_XMM sse2
-BIWEIGHT_FUNC_MM 16, 8
-
-%macro BIWEIGHT_FUNC_HALF_MM 2
-cglobal h264_biweight_%1, 7, 8, %2
-    BIWEIGHT_SETUP
-    movifnidn r3d, r3m
-    sar        r3, 1
-    lea        r4, [r2*2]
-.nextrow:
-    BIWEIGHT_STEPA 0, 1, 0
-    BIWEIGHT_STEPA 1, 2, r2
-    BIWEIGHT_STEPB
-    movh       [r0], m0
-%if mmsize == 16
-    movhps     [r0+r2], m0
-%else
-    psrlq      m0, 32
-    movh       [r0+r2], m0
-%endif
-    add        r0, r4
-    add        r1, r4
-    dec        r3d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-BIWEIGHT_FUNC_HALF_MM 4, 0
-INIT_XMM sse2
-BIWEIGHT_FUNC_HALF_MM 8, 8
-
-%macro BIWEIGHT_SSSE3_OP 0
-    pmaddubsw  m0, m4
-    pmaddubsw  m2, m4
-    paddsw     m0, m5
-    paddsw     m2, m5
-    psraw      m0, m6
-    psraw      m2, m6
-    packuswb   m0, m2
-%endmacro
-
-INIT_XMM ssse3
-cglobal h264_biweight_16, 7, 8, 8
-    BIWEIGHT_SETUP
-    movifnidn r3d, r3m
-
-.nextrow:
-    movh       m0, [r0]
-    movh       m2, [r0+8]
-    movh       m3, [r1+8]
-    punpcklbw  m0, [r1]
-    punpcklbw  m2, m3
-    BIWEIGHT_SSSE3_OP
-    mova       [r0], m0
-    add        r0, r2
-    add        r1, r2
-    dec        r3d
-    jnz .nextrow
-    REP_RET
-
-INIT_XMM ssse3
-cglobal h264_biweight_8, 7, 8, 8
-    BIWEIGHT_SETUP
-    movifnidn r3d, r3m
-    sar        r3, 1
-    lea        r4, [r2*2]
-
-.nextrow:
-    movh       m0, [r0]
-    movh       m1, [r1]
-    movh       m2, [r0+r2]
-    movh       m3, [r1+r2]
-    punpcklbw  m0, m1
-    punpcklbw  m2, m3
-    BIWEIGHT_SSSE3_OP
-    movh       [r0], m0
-    movhps     [r0+r2], m0
-    add        r0, r4
-    add        r1, r4
-    dec        r3d
-    jnz .nextrow
-    REP_RET
diff --git a/deps/libav/libavcodec/x86/h264_weight_10bit.asm b/deps/libav/libavcodec/x86/h264_weight_10bit.asm
deleted file mode 100644
index 3b09e42..0000000
--- a/deps/libav/libavcodec/x86/h264_weight_10bit.asm
+++ /dev/null
@@ -1,282 +0,0 @@
-;*****************************************************************************
-;* MMX/SSE2/AVX-optimized 10-bit H.264 weighted prediction code
-;*****************************************************************************
-;* Copyright (C) 2005-2011 x264 project
-;*
-;* Authors: Daniel Kang <daniel.d.kang at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA 32
-
-pw_pixel_max: times 8 dw ((1 << 10)-1)
-sq_1: dq 1
-      dq 0
-
-cextern pw_1
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; void h264_weight(uint8_t *dst, int stride, int height, int log2_denom,
-;                  int weight, int offset);
-;-----------------------------------------------------------------------------
-%macro WEIGHT_PROLOGUE 0
-.prologue:
-    PROLOGUE 0,6,8
-    movifnidn  r0, r0mp
-    movifnidn r1d, r1m
-    movifnidn r2d, r2m
-    movifnidn r4d, r4m
-    movifnidn r5d, r5m
-%endmacro
-
-%macro WEIGHT_SETUP 0
-    mova       m0, [pw_1]
-    movd       m2, r3m
-    pslld      m0, m2       ; 1<<log2_denom
-    SPLATW     m0, m0
-    shl        r5, 19       ; *8, move to upper half of dword
-    lea        r5, [r5+r4*2+0x10000]
-    movd       m3, r5d      ; weight<<1 | 1+(offset<<(3))
-    pshufd     m3, m3, 0
-    mova       m4, [pw_pixel_max]
-    paddw      m2, [sq_1]   ; log2_denom+1
-%if notcpuflag(sse4)
-    pxor       m7, m7
-%endif
-%endmacro
-
-%macro WEIGHT_OP 1-2
-%if %0==1
-    mova        m5, [r0+%1]
-    punpckhwd   m6, m5, m0
-    punpcklwd   m5, m0
-%else
-    movq        m5, [r0+%1]
-    movq        m6, [r0+%2]
-    punpcklwd   m5, m0
-    punpcklwd   m6, m0
-%endif
-    pmaddwd     m5, m3
-    pmaddwd     m6, m3
-    psrad       m5, m2
-    psrad       m6, m2
-%if cpuflag(sse4)
-    packusdw    m5, m6
-    pminsw      m5, m4
-%else
-    packssdw    m5, m6
-    CLIPW       m5, m7, m4
-%endif
-%endmacro
-
-%macro WEIGHT_FUNC_DBL 0
-cglobal h264_weight_16_10
-    WEIGHT_PROLOGUE
-    WEIGHT_SETUP
-.nextrow:
-    WEIGHT_OP  0
-    mova [r0   ], m5
-    WEIGHT_OP 16
-    mova [r0+16], m5
-    add       r0, r1
-    dec       r2d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-WEIGHT_FUNC_DBL
-INIT_XMM sse4
-WEIGHT_FUNC_DBL
-
-
-%macro WEIGHT_FUNC_MM 0
-cglobal h264_weight_8_10
-    WEIGHT_PROLOGUE
-    WEIGHT_SETUP
-.nextrow:
-    WEIGHT_OP   0
-    mova     [r0], m5
-    add        r0, r1
-    dec        r2d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-WEIGHT_FUNC_MM
-INIT_XMM sse4
-WEIGHT_FUNC_MM
-
-
-%macro WEIGHT_FUNC_HALF_MM 0
-cglobal h264_weight_4_10
-    WEIGHT_PROLOGUE
-    sar         r2d, 1
-    WEIGHT_SETUP
-    lea         r3, [r1*2]
-.nextrow:
-    WEIGHT_OP    0, r1
-    movh      [r0], m5
-    movhps [r0+r1], m5
-    add         r0, r3
-    dec         r2d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-WEIGHT_FUNC_HALF_MM
-INIT_XMM sse4
-WEIGHT_FUNC_HALF_MM
-
-
-;-----------------------------------------------------------------------------
-; void h264_biweight(uint8_t *dst, uint8_t *src, int stride, int height,
-;                    int log2_denom, int weightd, int weights, int offset);
-;-----------------------------------------------------------------------------
-%if ARCH_X86_32
-DECLARE_REG_TMP 3
-%else
-DECLARE_REG_TMP 7
-%endif
-
-%macro BIWEIGHT_PROLOGUE 0
-.prologue:
-    PROLOGUE 0,8,8
-    movifnidn  r0, r0mp
-    movifnidn  r1, r1mp
-    movifnidn r2d, r2m
-    movifnidn r5d, r5m
-    movifnidn r6d, r6m
-    movifnidn t0d, r7m
-%endmacro
-
-%macro BIWEIGHT_SETUP 0
-    lea        t0, [t0*4+1] ; (offset<<2)+1
-    or         t0, 1
-    shl        r6, 16
-    or         r5, r6
-    movd       m4, r5d      ; weightd | weights
-    movd       m5, t0d      ; (offset+1)|1
-    movd       m6, r4m      ; log2_denom
-    pslld      m5, m6       ; (((offset<<2)+1)|1)<<log2_denom
-    paddd      m6, [sq_1]
-    pshufd     m4, m4, 0
-    pshufd     m5, m5, 0
-    mova       m3, [pw_pixel_max]
-    movifnidn r3d, r3m
-%if notcpuflag(sse4)
-    pxor       m7, m7
-%endif
-%endmacro
-
-%macro BIWEIGHT 1-2
-%if %0==1
-    mova       m0, [r0+%1]
-    mova       m1, [r1+%1]
-    punpckhwd  m2, m0, m1
-    punpcklwd  m0, m1
-%else
-    movq       m0, [r0+%1]
-    movq       m1, [r1+%1]
-    punpcklwd  m0, m1
-    movq       m2, [r0+%2]
-    movq       m1, [r1+%2]
-    punpcklwd  m2, m1
-%endif
-    pmaddwd    m0, m4
-    pmaddwd    m2, m4
-    paddd      m0, m5
-    paddd      m2, m5
-    psrad      m0, m6
-    psrad      m2, m6
-%if cpuflag(sse4)
-    packusdw   m0, m2
-    pminsw     m0, m3
-%else
-    packssdw   m0, m2
-    CLIPW      m0, m7, m3
-%endif
-%endmacro
-
-%macro BIWEIGHT_FUNC_DBL 0
-cglobal h264_biweight_16_10
-    BIWEIGHT_PROLOGUE
-    BIWEIGHT_SETUP
-.nextrow:
-    BIWEIGHT   0
-    mova [r0   ], m0
-    BIWEIGHT  16
-    mova [r0+16], m0
-    add       r0, r2
-    add       r1, r2
-    dec       r3d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-BIWEIGHT_FUNC_DBL
-INIT_XMM sse4
-BIWEIGHT_FUNC_DBL
-
-%macro BIWEIGHT_FUNC 0
-cglobal h264_biweight_8_10
-    BIWEIGHT_PROLOGUE
-    BIWEIGHT_SETUP
-.nextrow:
-    BIWEIGHT  0
-    mova   [r0], m0
-    add      r0, r2
-    add      r1, r2
-    dec      r3d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-BIWEIGHT_FUNC
-INIT_XMM sse4
-BIWEIGHT_FUNC
-
-%macro BIWEIGHT_FUNC_HALF 0
-cglobal h264_biweight_4_10
-    BIWEIGHT_PROLOGUE
-    BIWEIGHT_SETUP
-    sar        r3d, 1
-    lea        r4, [r2*2]
-.nextrow:
-    BIWEIGHT     0, r2
-    movh   [r0   ], m0
-    movhps [r0+r2], m0
-    add         r0, r4
-    add         r1, r4
-    dec         r3d
-    jnz .nextrow
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-BIWEIGHT_FUNC_HALF
-INIT_XMM sse4
-BIWEIGHT_FUNC_HALF
diff --git a/deps/libav/libavcodec/x86/h264chroma_init.c b/deps/libav/libavcodec/x86/h264chroma_init.c
deleted file mode 100644
index eec1653..0000000
--- a/deps/libav/libavcodec/x86/h264chroma_init.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/h264chroma.h"
-
-void ff_put_h264_chroma_mc8_rnd_mmx  (uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-void ff_avg_h264_chroma_mc8_rnd_mmxext(uint8_t *dst, uint8_t *src,
-                                       int stride, int h, int x, int y);
-void ff_avg_h264_chroma_mc8_rnd_3dnow(uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-
-void ff_put_h264_chroma_mc4_mmx      (uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-void ff_avg_h264_chroma_mc4_mmxext   (uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-void ff_avg_h264_chroma_mc4_3dnow    (uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-
-void ff_put_h264_chroma_mc2_mmxext   (uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-void ff_avg_h264_chroma_mc2_mmxext   (uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-
-void ff_put_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-void ff_put_h264_chroma_mc4_ssse3    (uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-
-void ff_avg_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-void ff_avg_h264_chroma_mc4_ssse3    (uint8_t *dst, uint8_t *src,
-                                      int stride, int h, int x, int y);
-
-#define CHROMA_MC(OP, NUM, DEPTH, OPT)                                  \
-void ff_ ## OP ## _h264_chroma_mc ## NUM ## _ ## DEPTH ## _ ## OPT      \
-                                      (uint8_t *dst, uint8_t *src,      \
-                                       int stride, int h, int x, int y);
-
-CHROMA_MC(put, 2, 10, mmxext)
-CHROMA_MC(avg, 2, 10, mmxext)
-CHROMA_MC(put, 4, 10, mmxext)
-CHROMA_MC(avg, 4, 10, mmxext)
-CHROMA_MC(put, 8, 10, sse2)
-CHROMA_MC(avg, 8, 10, sse2)
-CHROMA_MC(put, 8, 10, avx)
-CHROMA_MC(avg, 8, 10, avx)
-
-av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
-{
-#if HAVE_YASM
-    int high_bit_depth = bit_depth > 8;
-    int cpu_flags      = av_get_cpu_flags();
-
-    if (EXTERNAL_MMX(cpu_flags) && !high_bit_depth) {
-        c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_rnd_mmx;
-        c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_mmx;
-    }
-
-    if (EXTERNAL_AMD3DNOW(cpu_flags) && !high_bit_depth) {
-        c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_rnd_3dnow;
-        c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_3dnow;
-    }
-
-    if (EXTERNAL_MMXEXT(cpu_flags) && !high_bit_depth) {
-        c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_rnd_mmxext;
-        c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_mmxext;
-        c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_mmxext;
-        c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_mmxext;
-    }
-
-    if (EXTERNAL_MMXEXT(cpu_flags) && bit_depth > 8 && bit_depth <= 10) {
-        c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_10_mmxext;
-        c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_10_mmxext;
-        c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_10_mmxext;
-        c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_10_mmxext;
-    }
-
-    if (EXTERNAL_SSE2(cpu_flags) && bit_depth > 8 && bit_depth <= 10) {
-        c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_sse2;
-        c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_sse2;
-    }
-
-    if (EXTERNAL_SSSE3(cpu_flags) && !high_bit_depth) {
-        c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_rnd_ssse3;
-        c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_rnd_ssse3;
-        c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_ssse3;
-        c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_ssse3;
-    }
-
-    if (EXTERNAL_AVX(cpu_flags) && bit_depth > 8 && bit_depth <= 10) {
-        // AVX implies !cache64.
-        // TODO: Port cache(32|64) detection from x264.
-        c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx;
-        c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_avx;
-    }
-#endif
-}
diff --git a/deps/libav/libavcodec/x86/h264dsp_init.c b/deps/libav/libavcodec/x86/h264dsp_init.c
deleted file mode 100644
index e9d93e0..0000000
--- a/deps/libav/libavcodec/x86/h264dsp_init.c
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/h264dsp.h"
-#include "dsputil_x86.h"
-
-/***********************************/
-/* IDCT */
-#define IDCT_ADD_FUNC(NUM, DEPTH, OPT)                                  \
-void ff_h264_idct ## NUM ## _add_ ## DEPTH ## _ ## OPT(uint8_t *dst,    \
-                                                       int16_t *block,  \
-                                                       int stride);
-
-IDCT_ADD_FUNC(, 8, mmx)
-IDCT_ADD_FUNC(, 10, sse2)
-IDCT_ADD_FUNC(_dc, 8, mmxext)
-IDCT_ADD_FUNC(_dc, 10, mmxext)
-IDCT_ADD_FUNC(8_dc, 8, mmxext)
-IDCT_ADD_FUNC(8_dc, 10, sse2)
-IDCT_ADD_FUNC(8, 8, mmx)
-IDCT_ADD_FUNC(8, 8, sse2)
-IDCT_ADD_FUNC(8, 10, sse2)
-IDCT_ADD_FUNC(, 10, avx)
-IDCT_ADD_FUNC(8_dc, 10, avx)
-IDCT_ADD_FUNC(8, 10, avx)
-
-
-#define IDCT_ADD_REP_FUNC(NUM, REP, DEPTH, OPT)                         \
-void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT       \
-    (uint8_t *dst, const int *block_offset,                             \
-     int16_t *block, int stride, const uint8_t nnzc[6 * 8]);
-
-IDCT_ADD_REP_FUNC(8, 4, 8, mmx)
-IDCT_ADD_REP_FUNC(8, 4, 8, mmxext)
-IDCT_ADD_REP_FUNC(8, 4, 8, sse2)
-IDCT_ADD_REP_FUNC(8, 4, 10, sse2)
-IDCT_ADD_REP_FUNC(8, 4, 10, avx)
-IDCT_ADD_REP_FUNC(, 16, 8, mmx)
-IDCT_ADD_REP_FUNC(, 16, 8, mmxext)
-IDCT_ADD_REP_FUNC(, 16, 8, sse2)
-IDCT_ADD_REP_FUNC(, 16, 10, sse2)
-IDCT_ADD_REP_FUNC(, 16intra, 8, mmx)
-IDCT_ADD_REP_FUNC(, 16intra, 8, mmxext)
-IDCT_ADD_REP_FUNC(, 16intra, 8, sse2)
-IDCT_ADD_REP_FUNC(, 16intra, 10, sse2)
-IDCT_ADD_REP_FUNC(, 16, 10, avx)
-IDCT_ADD_REP_FUNC(, 16intra, 10, avx)
-
-
-#define IDCT_ADD_REP_FUNC2(NUM, REP, DEPTH, OPT)                      \
-void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT     \
-    (uint8_t **dst, const int *block_offset,                          \
-     int16_t *block, int stride, const uint8_t nnzc[6 * 8]);
-
-IDCT_ADD_REP_FUNC2(, 8, 8, mmx)
-IDCT_ADD_REP_FUNC2(, 8, 8, mmxext)
-IDCT_ADD_REP_FUNC2(, 8, 8, sse2)
-IDCT_ADD_REP_FUNC2(, 8, 10, sse2)
-IDCT_ADD_REP_FUNC2(, 8, 10, avx)
-
-void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul);
-void ff_h264_luma_dc_dequant_idct_sse2(int16_t *output, int16_t *input, int qmul);
-
-/***********************************/
-/* deblocking */
-
-void ff_h264_loop_filter_strength_mmxext(int16_t bS[2][4][4], uint8_t nnz[40],
-                                         int8_t ref[2][40],
-                                         int16_t mv[2][40][2],
-                                         int bidir, int edges, int step,
-                                         int mask_mv0, int mask_mv1, int field);
-
-#define LF_FUNC(DIR, TYPE, DEPTH, OPT)                                        \
-void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT(uint8_t *pix,  \
-                                                               int stride,    \
-                                                               int alpha,     \
-                                                               int beta,      \
-                                                               int8_t *tc0);
-#define LF_IFUNC(DIR, TYPE, DEPTH, OPT) \
-void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT(uint8_t *pix,  \
-                                                               int stride,    \
-                                                               int alpha,     \
-                                                               int beta);
-
-#define LF_FUNCS(type, depth)                   \
-LF_FUNC(h,  chroma,       depth, mmxext)        \
-LF_IFUNC(h, chroma_intra, depth, mmxext)        \
-LF_FUNC(v,  chroma,       depth, mmxext)        \
-LF_IFUNC(v, chroma_intra, depth, mmxext)        \
-LF_FUNC(h,  luma,         depth, mmxext)        \
-LF_IFUNC(h, luma_intra,   depth, mmxext)        \
-LF_FUNC(h,  luma,         depth, sse2)          \
-LF_IFUNC(h, luma_intra,   depth, sse2)          \
-LF_FUNC(v,  luma,         depth, sse2)          \
-LF_IFUNC(v, luma_intra,   depth, sse2)          \
-LF_FUNC(h,  chroma,       depth, sse2)          \
-LF_IFUNC(h, chroma_intra, depth, sse2)          \
-LF_FUNC(v,  chroma,       depth, sse2)          \
-LF_IFUNC(v, chroma_intra, depth, sse2)          \
-LF_FUNC(h,  luma,         depth, avx)           \
-LF_IFUNC(h, luma_intra,   depth, avx)           \
-LF_FUNC(v,  luma,         depth, avx)           \
-LF_IFUNC(v, luma_intra,   depth, avx)           \
-LF_FUNC(h,  chroma,       depth, avx)           \
-LF_IFUNC(h, chroma_intra, depth, avx)           \
-LF_FUNC(v,  chroma,       depth, avx)           \
-LF_IFUNC(v, chroma_intra, depth, avx)
-
-LF_FUNCS(uint8_t,   8)
-LF_FUNCS(uint16_t, 10)
-
-#if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL
-LF_FUNC(v8, luma, 8, mmxext)
-static void deblock_v_luma_8_mmxext(uint8_t *pix, int stride, int alpha,
-                                    int beta, int8_t *tc0)
-{
-    if ((tc0[0] & tc0[1]) >= 0)
-        ff_deblock_v8_luma_8_mmxext(pix + 0, stride, alpha, beta, tc0);
-    if ((tc0[2] & tc0[3]) >= 0)
-        ff_deblock_v8_luma_8_mmxext(pix + 8, stride, alpha, beta, tc0 + 2);
-}
-LF_IFUNC(v8, luma_intra, 8, mmxext)
-static void deblock_v_luma_intra_8_mmxext(uint8_t *pix, int stride,
-                                          int alpha, int beta)
-{
-    ff_deblock_v8_luma_intra_8_mmxext(pix + 0, stride, alpha, beta);
-    ff_deblock_v8_luma_intra_8_mmxext(pix + 8, stride, alpha, beta);
-}
-#endif /* ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL */
-
-LF_FUNC(v,  luma,       10, mmxext)
-LF_IFUNC(v, luma_intra, 10, mmxext)
-
-/***********************************/
-/* weighted prediction */
-
-#define H264_WEIGHT(W, OPT)                                             \
-void ff_h264_weight_ ## W ## _ ## OPT(uint8_t *dst, int stride,         \
-                                      int height, int log2_denom,       \
-                                      int weight, int offset);
-
-#define H264_BIWEIGHT(W, OPT)                                           \
-void ff_h264_biweight_ ## W ## _ ## OPT(uint8_t *dst, uint8_t *src,     \
-                                        int stride, int height,         \
-                                        int log2_denom, int weightd,    \
-                                        int weights, int offset);
-
-#define H264_BIWEIGHT_MMX(W)                    \
-    H264_WEIGHT(W, mmxext)                      \
-    H264_BIWEIGHT(W, mmxext)
-
-#define H264_BIWEIGHT_MMX_SSE(W)                \
-    H264_BIWEIGHT_MMX(W)                        \
-    H264_WEIGHT(W, sse2)                        \
-    H264_BIWEIGHT(W, sse2)                      \
-    H264_BIWEIGHT(W, ssse3)
-
-H264_BIWEIGHT_MMX_SSE(16)
-H264_BIWEIGHT_MMX_SSE(8)
-H264_BIWEIGHT_MMX(4)
-
-#define H264_WEIGHT_10(W, DEPTH, OPT)                                   \
-void ff_h264_weight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst,       \
-                                                    int stride,         \
-                                                    int height,         \
-                                                    int log2_denom,     \
-                                                    int weight,         \
-                                                    int offset);
-
-#define H264_BIWEIGHT_10(W, DEPTH, OPT)                                 \
-void ff_h264_biweight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst,     \
-                                                      uint8_t *src,     \
-                                                      int stride,       \
-                                                      int height,       \
-                                                      int log2_denom,   \
-                                                      int weightd,      \
-                                                      int weights,      \
-                                                      int offset);
-
-#define H264_BIWEIGHT_10_SSE(W, DEPTH)          \
-    H264_WEIGHT_10(W, DEPTH, sse2)              \
-    H264_WEIGHT_10(W, DEPTH, sse4)              \
-    H264_BIWEIGHT_10(W, DEPTH, sse2)            \
-    H264_BIWEIGHT_10(W, DEPTH, sse4)
-
-H264_BIWEIGHT_10_SSE(16, 10)
-H264_BIWEIGHT_10_SSE(8,  10)
-H264_BIWEIGHT_10_SSE(4,  10)
-
-av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
-                                 const int chroma_format_idc)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (chroma_format_idc <= 1 && EXTERNAL_MMXEXT(cpu_flags))
-        c->h264_loop_filter_strength = ff_h264_loop_filter_strength_mmxext;
-
-    if (bit_depth == 8) {
-        if (EXTERNAL_MMX(cpu_flags)) {
-            c->h264_idct_dc_add   =
-            c->h264_idct_add      = ff_h264_idct_add_8_mmx;
-            c->h264_idct8_dc_add  =
-            c->h264_idct8_add     = ff_h264_idct8_add_8_mmx;
-
-            c->h264_idct_add16 = ff_h264_idct_add16_8_mmx;
-            c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmx;
-            if (chroma_format_idc <= 1)
-                c->h264_idct_add8 = ff_h264_idct_add8_8_mmx;
-            c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmx;
-            if (cpu_flags & AV_CPU_FLAG_CMOV)
-                c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_mmx;
-        }
-        if (EXTERNAL_MMXEXT(cpu_flags)) {
-            c->h264_idct_dc_add  = ff_h264_idct_dc_add_8_mmxext;
-            c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmxext;
-            c->h264_idct_add16   = ff_h264_idct_add16_8_mmxext;
-            c->h264_idct8_add4   = ff_h264_idct8_add4_8_mmxext;
-            if (chroma_format_idc <= 1)
-                c->h264_idct_add8 = ff_h264_idct_add8_8_mmxext;
-            c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmxext;
-
-            c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_8_mmxext;
-            c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmxext;
-            if (chroma_format_idc <= 1) {
-                c->h264_h_loop_filter_chroma       = ff_deblock_h_chroma_8_mmxext;
-                c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_mmxext;
-            }
-#if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL
-            c->h264_v_loop_filter_luma       = deblock_v_luma_8_mmxext;
-            c->h264_h_loop_filter_luma       = ff_deblock_h_luma_8_mmxext;
-            c->h264_v_loop_filter_luma_intra = deblock_v_luma_intra_8_mmxext;
-            c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmxext;
-#endif /* ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL */
-            c->weight_h264_pixels_tab[0] = ff_h264_weight_16_mmxext;
-            c->weight_h264_pixels_tab[1] = ff_h264_weight_8_mmxext;
-            c->weight_h264_pixels_tab[2] = ff_h264_weight_4_mmxext;
-
-            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_mmxext;
-            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_mmxext;
-            c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_mmxext;
-        }
-        if (EXTERNAL_SSE2(cpu_flags)) {
-            c->h264_idct8_add  = ff_h264_idct8_add_8_sse2;
-
-            c->h264_idct_add16 = ff_h264_idct_add16_8_sse2;
-            c->h264_idct8_add4 = ff_h264_idct8_add4_8_sse2;
-            if (chroma_format_idc <= 1)
-                c->h264_idct_add8 = ff_h264_idct_add8_8_sse2;
-            c->h264_idct_add16intra      = ff_h264_idct_add16intra_8_sse2;
-            c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_sse2;
-
-            c->weight_h264_pixels_tab[0] = ff_h264_weight_16_sse2;
-            c->weight_h264_pixels_tab[1] = ff_h264_weight_8_sse2;
-
-            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_sse2;
-            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_sse2;
-
-            c->h264_v_loop_filter_luma       = ff_deblock_v_luma_8_sse2;
-            c->h264_h_loop_filter_luma       = ff_deblock_h_luma_8_sse2;
-            c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_sse2;
-            c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_sse2;
-        }
-        if (EXTERNAL_SSSE3(cpu_flags)) {
-            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_ssse3;
-            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_ssse3;
-        }
-        if (EXTERNAL_AVX(cpu_flags)) {
-            c->h264_v_loop_filter_luma       = ff_deblock_v_luma_8_avx;
-            c->h264_h_loop_filter_luma       = ff_deblock_h_luma_8_avx;
-            c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_avx;
-            c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_avx;
-        }
-    } else if (bit_depth == 10) {
-        if (EXTERNAL_MMXEXT(cpu_flags)) {
-#if ARCH_X86_32
-            c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_10_mmxext;
-            c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_mmxext;
-            c->h264_v_loop_filter_luma         = ff_deblock_v_luma_10_mmxext;
-            c->h264_h_loop_filter_luma         = ff_deblock_h_luma_10_mmxext;
-            c->h264_v_loop_filter_luma_intra   = ff_deblock_v_luma_intra_10_mmxext;
-            c->h264_h_loop_filter_luma_intra   = ff_deblock_h_luma_intra_10_mmxext;
-#endif /* ARCH_X86_32 */
-            c->h264_idct_dc_add = ff_h264_idct_dc_add_10_mmxext;
-        }
-        if (EXTERNAL_SSE2(cpu_flags)) {
-            c->h264_idct_add     = ff_h264_idct_add_10_sse2;
-            c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_sse2;
-
-            c->h264_idct_add16 = ff_h264_idct_add16_10_sse2;
-            if (chroma_format_idc <= 1)
-                c->h264_idct_add8 = ff_h264_idct_add8_10_sse2;
-            c->h264_idct_add16intra = ff_h264_idct_add16intra_10_sse2;
-#if HAVE_ALIGNED_STACK
-            c->h264_idct8_add  = ff_h264_idct8_add_10_sse2;
-            c->h264_idct8_add4 = ff_h264_idct8_add4_10_sse2;
-#endif /* HAVE_ALIGNED_STACK */
-
-            c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse2;
-            c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse2;
-            c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse2;
-
-            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse2;
-            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse2;
-            c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse2;
-
-            c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_10_sse2;
-            c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_sse2;
-#if HAVE_ALIGNED_STACK
-            c->h264_v_loop_filter_luma       = ff_deblock_v_luma_10_sse2;
-            c->h264_h_loop_filter_luma       = ff_deblock_h_luma_10_sse2;
-            c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_sse2;
-            c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_sse2;
-#endif /* HAVE_ALIGNED_STACK */
-        }
-        if (EXTERNAL_SSE4(cpu_flags)) {
-            c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse4;
-            c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse4;
-            c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse4;
-
-            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse4;
-            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse4;
-            c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse4;
-        }
-        if (EXTERNAL_AVX(cpu_flags)) {
-            c->h264_idct_dc_add  =
-            c->h264_idct_add     = ff_h264_idct_add_10_avx;
-            c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_avx;
-
-            c->h264_idct_add16 = ff_h264_idct_add16_10_avx;
-            if (chroma_format_idc <= 1)
-                c->h264_idct_add8 = ff_h264_idct_add8_10_avx;
-            c->h264_idct_add16intra = ff_h264_idct_add16intra_10_avx;
-#if HAVE_ALIGNED_STACK
-            c->h264_idct8_add  = ff_h264_idct8_add_10_avx;
-            c->h264_idct8_add4 = ff_h264_idct8_add4_10_avx;
-#endif /* HAVE_ALIGNED_STACK */
-
-            c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_10_avx;
-            c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_avx;
-#if HAVE_ALIGNED_STACK
-            c->h264_v_loop_filter_luma         = ff_deblock_v_luma_10_avx;
-            c->h264_h_loop_filter_luma         = ff_deblock_h_luma_10_avx;
-            c->h264_v_loop_filter_luma_intra   = ff_deblock_v_luma_intra_10_avx;
-            c->h264_h_loop_filter_luma_intra   = ff_deblock_h_luma_intra_10_avx;
-#endif /* HAVE_ALIGNED_STACK */
-        }
-    }
-}
diff --git a/deps/libav/libavcodec/x86/hpeldsp.asm b/deps/libav/libavcodec/x86/hpeldsp.asm
deleted file mode 100644
index ff6e57a..0000000
--- a/deps/libav/libavcodec/x86/hpeldsp.asm
+++ /dev/null
@@ -1,454 +0,0 @@
-;******************************************************************************
-;* MMX optimized hpel functions
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-cextern pb_1
-
-SECTION_TEXT
-
-; put_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro PUT_PIXELS8_X2 0
-cglobal put_pixels8_x2, 4,5
-    lea          r4, [r2*2]
-.loop:
-    mova         m0, [r1]
-    mova         m1, [r1+r2]
-    PAVGB        m0, [r1+1]
-    PAVGB        m1, [r1+r2+1]
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    add          r1, r4
-    add          r0, r4
-    mova         m0, [r1]
-    mova         m1, [r1+r2]
-    PAVGB        m0, [r1+1]
-    PAVGB        m1, [r1+r2+1]
-    add          r1, r4
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    add          r0, r4
-    sub         r3d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PUT_PIXELS8_X2
-INIT_MMX 3dnow
-PUT_PIXELS8_X2
-
-
-; put_pixels16_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro PUT_PIXELS_16 0
-cglobal put_pixels16_x2, 4,5
-    lea          r4, [r2*2]
-.loop:
-    mova         m0, [r1]
-    mova         m1, [r1+r2]
-    mova         m2, [r1+8]
-    mova         m3, [r1+r2+8]
-    PAVGB        m0, [r1+1]
-    PAVGB        m1, [r1+r2+1]
-    PAVGB        m2, [r1+9]
-    PAVGB        m3, [r1+r2+9]
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    mova     [r0+8], m2
-    mova  [r0+r2+8], m3
-    add          r1, r4
-    add          r0, r4
-    mova         m0, [r1]
-    mova         m1, [r1+r2]
-    mova         m2, [r1+8]
-    mova         m3, [r1+r2+8]
-    PAVGB        m0, [r1+1]
-    PAVGB        m1, [r1+r2+1]
-    PAVGB        m2, [r1+9]
-    PAVGB        m3, [r1+r2+9]
-    add          r1, r4
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    mova     [r0+8], m2
-    mova  [r0+r2+8], m3
-    add          r0, r4
-    sub         r3d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PUT_PIXELS_16
-INIT_MMX 3dnow
-PUT_PIXELS_16
-
-
-; put_no_rnd_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro PUT_NO_RND_PIXELS8_X2 0
-cglobal put_no_rnd_pixels8_x2, 4,5
-    mova         m6, [pb_1]
-    lea          r4, [r2*2]
-.loop:
-    mova         m0, [r1]
-    mova         m2, [r1+r2]
-    mova         m1, [r1+1]
-    mova         m3, [r1+r2+1]
-    add          r1, r4
-    psubusb      m0, m6
-    psubusb      m2, m6
-    PAVGB        m0, m1
-    PAVGB        m2, m3
-    mova       [r0], m0
-    mova    [r0+r2], m2
-    mova         m0, [r1]
-    mova         m1, [r1+1]
-    mova         m2, [r1+r2]
-    mova         m3, [r1+r2+1]
-    add          r0, r4
-    add          r1, r4
-    psubusb      m0, m6
-    psubusb      m2, m6
-    PAVGB        m0, m1
-    PAVGB        m2, m3
-    mova       [r0], m0
-    mova    [r0+r2], m2
-    add          r0, r4
-    sub         r3d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PUT_NO_RND_PIXELS8_X2
-INIT_MMX 3dnow
-PUT_NO_RND_PIXELS8_X2
-
-
-; put_no_rnd_pixels8_x2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro PUT_NO_RND_PIXELS8_X2_EXACT 0
-cglobal put_no_rnd_pixels8_x2_exact, 4,5
-    lea          r4, [r2*3]
-    pcmpeqb      m6, m6
-.loop:
-    mova         m0, [r1]
-    mova         m2, [r1+r2]
-    mova         m1, [r1+1]
-    mova         m3, [r1+r2+1]
-    pxor         m0, m6
-    pxor         m2, m6
-    pxor         m1, m6
-    pxor         m3, m6
-    PAVGB        m0, m1
-    PAVGB        m2, m3
-    pxor         m0, m6
-    pxor         m2, m6
-    mova       [r0], m0
-    mova    [r0+r2], m2
-    mova         m0, [r1+r2*2]
-    mova         m1, [r1+r2*2+1]
-    mova         m2, [r1+r4]
-    mova         m3, [r1+r4+1]
-    pxor         m0, m6
-    pxor         m1, m6
-    pxor         m2, m6
-    pxor         m3, m6
-    PAVGB        m0, m1
-    PAVGB        m2, m3
-    pxor         m0, m6
-    pxor         m2, m6
-    mova  [r0+r2*2], m0
-    mova    [r0+r4], m2
-    lea          r1, [r1+r2*4]
-    lea          r0, [r0+r2*4]
-    sub         r3d, 4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PUT_NO_RND_PIXELS8_X2_EXACT
-INIT_MMX 3dnow
-PUT_NO_RND_PIXELS8_X2_EXACT
-
-
-; put_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro PUT_PIXELS8_Y2 0
-cglobal put_pixels8_y2, 4,5
-    lea          r4, [r2*2]
-    mova         m0, [r1]
-    sub          r0, r2
-.loop:
-    mova         m1, [r1+r2]
-    mova         m2, [r1+r4]
-    add          r1, r4
-    PAVGB        m0, m1
-    PAVGB        m1, m2
-    mova    [r0+r2], m0
-    mova    [r0+r4], m1
-    mova         m1, [r1+r2]
-    mova         m0, [r1+r4]
-    add          r0, r4
-    add          r1, r4
-    PAVGB        m2, m1
-    PAVGB        m1, m0
-    mova    [r0+r2], m2
-    mova    [r0+r4], m1
-    add          r0, r4
-    sub         r3d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PUT_PIXELS8_Y2
-INIT_MMX 3dnow
-PUT_PIXELS8_Y2
-
-
-; put_no_rnd_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro PUT_NO_RND_PIXELS8_Y2 0
-cglobal put_no_rnd_pixels8_y2, 4,5
-    mova         m6, [pb_1]
-    lea          r4, [r2+r2]
-    mova         m0, [r1]
-    sub          r0, r2
-.loop:
-    mova         m1, [r1+r2]
-    mova         m2, [r1+r4]
-    add          r1, r4
-    psubusb      m1, m6
-    PAVGB        m0, m1
-    PAVGB        m1, m2
-    mova    [r0+r2], m0
-    mova    [r0+r4], m1
-    mova         m1, [r1+r2]
-    mova         m0, [r1+r4]
-    add          r0, r4
-    add          r1, r4
-    psubusb      m1, m6
-    PAVGB        m2, m1
-    PAVGB        m1, m0
-    mova    [r0+r2], m2
-    mova    [r0+r4], m1
-    add          r0, r4
-    sub         r3d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PUT_NO_RND_PIXELS8_Y2
-INIT_MMX 3dnow
-PUT_NO_RND_PIXELS8_Y2
-
-
-; put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro PUT_NO_RND_PIXELS8_Y2_EXACT 0
-cglobal put_no_rnd_pixels8_y2_exact, 4,5
-    lea          r4, [r2*3]
-    mova         m0, [r1]
-    pcmpeqb      m6, m6
-    add          r1, r2
-    pxor         m0, m6
-.loop:
-    mova         m1, [r1]
-    mova         m2, [r1+r2]
-    pxor         m1, m6
-    pxor         m2, m6
-    PAVGB        m0, m1
-    PAVGB        m1, m2
-    pxor         m0, m6
-    pxor         m1, m6
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    mova         m1, [r1+r2*2]
-    mova         m0, [r1+r4]
-    pxor         m1, m6
-    pxor         m0, m6
-    PAVGB        m2, m1
-    PAVGB        m1, m0
-    pxor         m2, m6
-    pxor         m1, m6
-    mova  [r0+r2*2], m2
-    mova    [r0+r4], m1
-    lea          r1, [r1+r2*4]
-    lea          r0, [r0+r2*4]
-    sub         r3d, 4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PUT_NO_RND_PIXELS8_Y2_EXACT
-INIT_MMX 3dnow
-PUT_NO_RND_PIXELS8_Y2_EXACT
-
-
-; avg_pixels8(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro AVG_PIXELS8 0
-cglobal avg_pixels8, 4,5
-    lea          r4, [r2*2]
-.loop:
-    mova         m0, [r0]
-    mova         m1, [r0+r2]
-    PAVGB        m0, [r1]
-    PAVGB        m1, [r1+r2]
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    add          r1, r4
-    add          r0, r4
-    mova         m0, [r0]
-    mova         m1, [r0+r2]
-    PAVGB        m0, [r1]
-    PAVGB        m1, [r1+r2]
-    add          r1, r4
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    add          r0, r4
-    sub         r3d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX 3dnow
-AVG_PIXELS8
-
-
-; avg_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro AVG_PIXELS8_X2 0
-cglobal avg_pixels8_x2, 4,5
-    lea          r4, [r2*2]
-.loop:
-    mova         m0, [r1]
-    mova         m2, [r1+r2]
-    PAVGB        m0, [r1+1]
-    PAVGB        m2, [r1+r2+1]
-    PAVGB        m0, [r0]
-    PAVGB        m2, [r0+r2]
-    add          r1, r4
-    mova       [r0], m0
-    mova    [r0+r2], m2
-    mova         m0, [r1]
-    mova         m2, [r1+r2]
-    PAVGB        m0, [r1+1]
-    PAVGB        m2, [r1+r2+1]
-    add          r0, r4
-    add          r1, r4
-    PAVGB        m0, [r0]
-    PAVGB        m2, [r0+r2]
-    mova       [r0], m0
-    mova    [r0+r2], m2
-    add          r0, r4
-    sub         r3d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-AVG_PIXELS8_X2
-INIT_MMX 3dnow
-AVG_PIXELS8_X2
-
-
-; avg_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro AVG_PIXELS8_Y2 0
-cglobal avg_pixels8_y2, 4,5
-    lea          r4, [r2*2]
-    mova         m0, [r1]
-    sub          r0, r2
-.loop:
-    mova         m1, [r1+r2]
-    mova         m2, [r1+r4]
-    add          r1, r4
-    PAVGB        m0, m1
-    PAVGB        m1, m2
-    mova         m3, [r0+r2]
-    mova         m4, [r0+r4]
-    PAVGB        m0, m3
-    PAVGB        m1, m4
-    mova    [r0+r2], m0
-    mova    [r0+r4], m1
-    mova         m1, [r1+r2]
-    mova         m0, [r1+r4]
-    PAVGB        m2, m1
-    PAVGB        m1, m0
-    add          r0, r4
-    add          r1, r4
-    mova         m3, [r0+r2]
-    mova         m4, [r0+r4]
-    PAVGB        m2, m3
-    PAVGB        m1, m4
-    mova    [r0+r2], m2
-    mova    [r0+r4], m1
-    add          r0, r4
-    sub         r3d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-AVG_PIXELS8_Y2
-INIT_MMX 3dnow
-AVG_PIXELS8_Y2
-
-
-; avg_pixels8_xy2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-%macro AVG_PIXELS8_XY2 0
-cglobal avg_pixels8_xy2, 4,5
-    mova         m6, [pb_1]
-    lea          r4, [r2*2]
-    mova         m0, [r1]
-    PAVGB        m0, [r1+1]
-.loop:
-    mova         m2, [r1+r4]
-    mova         m1, [r1+r2]
-    psubusb      m2, m6
-    PAVGB        m1, [r1+r2+1]
-    PAVGB        m2, [r1+r4+1]
-    add          r1, r4
-    PAVGB        m0, m1
-    PAVGB        m1, m2
-    PAVGB        m0, [r0]
-    PAVGB        m1, [r0+r2]
-    mova       [r0], m0
-    mova    [r0+r2], m1
-    mova         m1, [r1+r2]
-    mova         m0, [r1+r4]
-    PAVGB        m1, [r1+r2+1]
-    PAVGB        m0, [r1+r4+1]
-    add          r0, r4
-    add          r1, r4
-    PAVGB        m2, m1
-    PAVGB        m1, m0
-    PAVGB        m2, [r0]
-    PAVGB        m1, [r0+r2]
-    mova       [r0], m2
-    mova    [r0+r2], m1
-    add          r0, r4
-    sub         r3d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-AVG_PIXELS8_XY2
-INIT_MMX 3dnow
-AVG_PIXELS8_XY2
diff --git a/deps/libav/libavcodec/x86/hpeldsp_init.c b/deps/libav/libavcodec/x86/hpeldsp_init.c
deleted file mode 100644
index c4f555c..0000000
--- a/deps/libav/libavcodec/x86/hpeldsp_init.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * MMX optimized DSP utils
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * MMX optimization by Nick Kurshev <nickols_k at mail.ru>
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/hpeldsp.h"
-#include "dsputil_x86.h"
-
-void ff_put_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void ff_put_pixels8_x2_3dnow(uint8_t *block, const uint8_t *pixels,
-                             ptrdiff_t line_size, int h);
-void ff_put_pixels16_x2_mmxext(uint8_t *block, const uint8_t *pixels,
-                               ptrdiff_t line_size, int h);
-void ff_put_pixels16_x2_3dnow(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_x2_3dnow(uint8_t *block, const uint8_t *pixels,
-                                    ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_x2_exact_mmxext(uint8_t *block,
-                                           const uint8_t *pixels,
-                                           ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_x2_exact_3dnow(uint8_t *block,
-                                          const uint8_t *pixels,
-                                          ptrdiff_t line_size, int h);
-void ff_put_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void ff_put_pixels8_y2_3dnow(uint8_t *block, const uint8_t *pixels,
-                             ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels,
-                                     ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_y2_3dnow(uint8_t *block, const uint8_t *pixels,
-                                    ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block,
-                                           const uint8_t *pixels,
-                                           ptrdiff_t line_size, int h);
-void ff_put_no_rnd_pixels8_y2_exact_3dnow(uint8_t *block,
-                                          const uint8_t *pixels,
-                                          ptrdiff_t line_size, int h);
-void ff_avg_pixels8_3dnow(uint8_t *block, const uint8_t *pixels,
-                          ptrdiff_t line_size, int h);
-void ff_avg_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void ff_avg_pixels8_x2_3dnow(uint8_t *block, const uint8_t *pixels,
-                             ptrdiff_t line_size, int h);
-void ff_avg_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-void ff_avg_pixels8_y2_3dnow(uint8_t *block, const uint8_t *pixels,
-                             ptrdiff_t line_size, int h);
-void ff_avg_pixels8_xy2_mmxext(uint8_t *block, const uint8_t *pixels,
-                               ptrdiff_t line_size, int h);
-void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
-                              ptrdiff_t line_size, int h);
-
-#define avg_pixels8_mmx         ff_avg_pixels8_mmx
-#define avg_pixels8_x2_mmx      ff_avg_pixels8_x2_mmx
-#define avg_pixels16_mmx        ff_avg_pixels16_mmx
-#define avg_pixels8_xy2_mmx     ff_avg_pixels8_xy2_mmx
-#define avg_pixels16_xy2_mmx    ff_avg_pixels16_xy2_mmx
-#define put_pixels8_mmx         ff_put_pixels8_mmx
-#define put_pixels16_mmx        ff_put_pixels16_mmx
-#define put_pixels8_xy2_mmx     ff_put_pixels8_xy2_mmx
-#define put_pixels16_xy2_mmx    ff_put_pixels16_xy2_mmx
-#define avg_no_rnd_pixels16_mmx ff_avg_pixels16_mmx
-#define put_no_rnd_pixels8_mmx  ff_put_pixels8_mmx
-#define put_no_rnd_pixels16_mmx ff_put_pixels16_mmx
-
-#if HAVE_INLINE_ASM
-
-/***********************************/
-/* MMX no rounding */
-#define DEF(x, y) x ## _no_rnd_ ## y ## _mmx
-#define SET_RND  MOVQ_WONE
-#define PAVGBP(a, b, c, d, e, f)        PAVGBP_MMX_NO_RND(a, b, c, d, e, f)
-#define PAVGB(a, b, c, e)               PAVGB_MMX_NO_RND(a, b, c, e)
-#define STATIC static
-
-#include "rnd_template.c"
-#include "hpeldsp_rnd_template.c"
-
-#undef DEF
-#undef SET_RND
-#undef PAVGBP
-#undef PAVGB
-#undef STATIC
-
-PIXELS16(static, avg_no_rnd, , _y2, _mmx)
-PIXELS16(static, put_no_rnd, , _y2, _mmx)
-
-PIXELS16(static, avg_no_rnd, , _xy2, _mmx)
-PIXELS16(static, put_no_rnd, , _xy2, _mmx)
-
-/***********************************/
-/* MMX rounding */
-
-#define DEF(x, y) x ## _ ## y ## _mmx
-#define SET_RND  MOVQ_WTWO
-#define PAVGBP(a, b, c, d, e, f)        PAVGBP_MMX(a, b, c, d, e, f)
-#define PAVGB(a, b, c, e)               PAVGB_MMX(a, b, c, e)
-
-#include "hpeldsp_rnd_template.c"
-
-#undef DEF
-#undef SET_RND
-#undef PAVGBP
-#undef PAVGB
-
-PIXELS16(static, avg, , _y2, _mmx)
-PIXELS16(static, put, , _y2, _mmx)
-
-#endif /* HAVE_INLINE_ASM */
-
-
-#if HAVE_YASM
-
-#define HPELDSP_AVG_PIXELS16(CPUEXT)                \
-    PIXELS16(static, put_no_rnd, ff_,  _x2, CPUEXT) \
-    PIXELS16(static, put,        ff_,  _y2, CPUEXT) \
-    PIXELS16(static, put_no_rnd, ff_,  _y2, CPUEXT) \
-    PIXELS16(static, avg,        ff_,     , CPUEXT) \
-    PIXELS16(static, avg,        ff_,  _x2, CPUEXT) \
-    PIXELS16(static, avg,        ff_,  _y2, CPUEXT) \
-    PIXELS16(static, avg,        ff_, _xy2, CPUEXT)
-
-HPELDSP_AVG_PIXELS16(_3dnow)
-HPELDSP_AVG_PIXELS16(_mmxext)
-
-#endif /* HAVE_YASM */
-
-#define SET_HPEL_FUNCS(PFX, IDX, SIZE, CPU)                                     \
-    do {                                                                        \
-        c->PFX ## _pixels_tab IDX [0] = PFX ## _pixels ## SIZE ## _     ## CPU; \
-        c->PFX ## _pixels_tab IDX [1] = PFX ## _pixels ## SIZE ## _x2_  ## CPU; \
-        c->PFX ## _pixels_tab IDX [2] = PFX ## _pixels ## SIZE ## _y2_  ## CPU; \
-        c->PFX ## _pixels_tab IDX [3] = PFX ## _pixels ## SIZE ## _xy2_ ## CPU; \
-    } while (0)
-
-static void hpeldsp_init_mmx(HpelDSPContext *c, int flags, int cpu_flags)
-{
-#if HAVE_MMX_INLINE
-    SET_HPEL_FUNCS(put,        [0], 16, mmx);
-    SET_HPEL_FUNCS(put_no_rnd, [0], 16, mmx);
-    SET_HPEL_FUNCS(avg,        [0], 16, mmx);
-    SET_HPEL_FUNCS(avg_no_rnd,    , 16, mmx);
-    SET_HPEL_FUNCS(put,        [1],  8, mmx);
-    SET_HPEL_FUNCS(put_no_rnd, [1],  8, mmx);
-    SET_HPEL_FUNCS(avg,        [1],  8, mmx);
-#endif /* HAVE_MMX_INLINE */
-}
-
-static void hpeldsp_init_mmxext(HpelDSPContext *c, int flags, int cpu_flags)
-{
-#if HAVE_MMXEXT_EXTERNAL
-    c->put_pixels_tab[0][1] = ff_put_pixels16_x2_mmxext;
-    c->put_pixels_tab[0][2] = put_pixels16_y2_mmxext;
-
-    c->avg_pixels_tab[0][0] = avg_pixels16_mmxext;
-    c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmxext;
-    c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmxext;
-
-    c->put_pixels_tab[1][1] = ff_put_pixels8_x2_mmxext;
-    c->put_pixels_tab[1][2] = ff_put_pixels8_y2_mmxext;
-
-    c->avg_pixels_tab[1][0] = ff_avg_pixels8_mmxext;
-    c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_mmxext;
-    c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_mmxext;
-
-    if (!(flags & CODEC_FLAG_BITEXACT)) {
-        c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmxext;
-        c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmxext;
-        c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_mmxext;
-        c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_mmxext;
-
-        c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmxext;
-        c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_mmxext;
-    }
-
-    if (flags & CODEC_FLAG_BITEXACT && CONFIG_VP3_DECODER) {
-        c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_mmxext;
-        c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_mmxext;
-    }
-#endif /* HAVE_MMXEXT_EXTERNAL */
-}
-
-static void hpeldsp_init_3dnow(HpelDSPContext *c, int flags, int cpu_flags)
-{
-#if HAVE_AMD3DNOW_EXTERNAL
-    c->put_pixels_tab[0][1] = ff_put_pixels16_x2_3dnow;
-    c->put_pixels_tab[0][2] = put_pixels16_y2_3dnow;
-
-    c->avg_pixels_tab[0][0] = avg_pixels16_3dnow;
-    c->avg_pixels_tab[0][1] = avg_pixels16_x2_3dnow;
-    c->avg_pixels_tab[0][2] = avg_pixels16_y2_3dnow;
-
-    c->put_pixels_tab[1][1] = ff_put_pixels8_x2_3dnow;
-    c->put_pixels_tab[1][2] = ff_put_pixels8_y2_3dnow;
-
-    c->avg_pixels_tab[1][0] = ff_avg_pixels8_3dnow;
-    c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_3dnow;
-    c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_3dnow;
-
-    if (!(flags & CODEC_FLAG_BITEXACT)){
-        c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_3dnow;
-        c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_3dnow;
-        c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_3dnow;
-        c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_3dnow;
-
-        c->avg_pixels_tab[0][3] = avg_pixels16_xy2_3dnow;
-        c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_3dnow;
-    }
-
-    if (flags & CODEC_FLAG_BITEXACT && CONFIG_VP3_DECODER) {
-        c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_3dnow;
-        c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_3dnow;
-    }
-#endif /* HAVE_AMD3DNOW_EXTERNAL */
-}
-
-static void hpeldsp_init_sse2(HpelDSPContext *c, int flags, int cpu_flags)
-{
-#if HAVE_SSE2_EXTERNAL
-    if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
-        // these functions are slower than mmx on AMD, but faster on Intel
-        c->put_pixels_tab[0][0]        = ff_put_pixels16_sse2;
-        c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_sse2;
-        c->avg_pixels_tab[0][0]        = ff_avg_pixels16_sse2;
-    }
-#endif /* HAVE_SSE2_EXTERNAL */
-}
-
-av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (INLINE_MMX(cpu_flags))
-        hpeldsp_init_mmx(c, flags, cpu_flags);
-
-    if (EXTERNAL_AMD3DNOW(cpu_flags))
-        hpeldsp_init_3dnow(c, flags, cpu_flags);
-
-    if (EXTERNAL_MMXEXT(cpu_flags))
-        hpeldsp_init_mmxext(c, flags, cpu_flags);
-
-    if (EXTERNAL_SSE2(cpu_flags))
-        hpeldsp_init_sse2(c, flags, cpu_flags);
-}
diff --git a/deps/libav/libavcodec/x86/hpeldsp_mmx.c b/deps/libav/libavcodec/x86/hpeldsp_mmx.c
deleted file mode 100644
index fece265..0000000
--- a/deps/libav/libavcodec/x86/hpeldsp_mmx.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * MMX-optimized avg/put pixel routines
- *
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "config.h"
-#include "dsputil_x86.h"
-
-#if HAVE_MMX_INLINE
-
-void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels,
-                           ptrdiff_t line_size, int h)
-{
-    MOVQ_BFE(mm6);
-    JUMPALIGN();
-    do {
-        __asm__ volatile(
-            "movq  %1, %%mm0            \n\t"
-            "movq  1%1, %%mm1           \n\t"
-            "movq  %0, %%mm3            \n\t"
-            PAVGB_MMX(%%mm0, %%mm1, %%mm2, %%mm6)
-            PAVGB_MMX(%%mm3, %%mm2, %%mm0, %%mm6)
-            "movq  %%mm0, %0            \n\t"
-            :"+m"(*block)
-            :"m"(*pixels)
-            :"memory");
-        pixels += line_size;
-        block += line_size;
-    } while (--h);
-}
-
-#endif /* HAVE_MMX_INLINE */
diff --git a/deps/libav/libavcodec/x86/hpeldsp_rnd_template.c b/deps/libav/libavcodec/x86/hpeldsp_rnd_template.c
deleted file mode 100644
index 516a03a..0000000
--- a/deps/libav/libavcodec/x86/hpeldsp_rnd_template.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * DSP utils mmx functions are compiled twice for rnd/no_rnd
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * MMX optimization by Nick Kurshev <nickols_k at mail.ru>
- * mostly rewritten by Michael Niedermayer <michaelni at gmx.at>
- * and improved by Zdenek Kabelac <kabi at users.sf.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-// put_pixels
-static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    MOVQ_BFE(mm6);
-    __asm__ volatile(
-        "lea    (%3, %3), %%"REG_a"     \n\t"
-        ".p2align 3                     \n\t"
-        "1:                             \n\t"
-        "movq   (%1), %%mm0             \n\t"
-        "movq   1(%1), %%mm1            \n\t"
-        "movq   (%1, %3), %%mm2         \n\t"
-        "movq   1(%1, %3), %%mm3        \n\t"
-        PAVGBP(%%mm0, %%mm1, %%mm4,   %%mm2, %%mm3, %%mm5)
-        "movq   %%mm4, (%2)             \n\t"
-        "movq   %%mm5, (%2, %3)         \n\t"
-        "add    %%"REG_a", %1           \n\t"
-        "add    %%"REG_a", %2           \n\t"
-        "movq   (%1), %%mm0             \n\t"
-        "movq   1(%1), %%mm1            \n\t"
-        "movq   (%1, %3), %%mm2         \n\t"
-        "movq   1(%1, %3), %%mm3        \n\t"
-        PAVGBP(%%mm0, %%mm1, %%mm4,   %%mm2, %%mm3, %%mm5)
-        "movq   %%mm4, (%2)             \n\t"
-        "movq   %%mm5, (%2, %3)         \n\t"
-        "add    %%"REG_a", %1           \n\t"
-        "add    %%"REG_a", %2           \n\t"
-        "subl   $4, %0                  \n\t"
-        "jnz    1b                      \n\t"
-        :"+g"(h), "+S"(pixels), "+D"(block)
-        :"r"((x86_reg)line_size)
-        :REG_a, "memory");
-}
-
-static void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    MOVQ_BFE(mm6);
-    __asm__ volatile(
-        "lea        (%3, %3), %%"REG_a" \n\t"
-        ".p2align 3                     \n\t"
-        "1:                             \n\t"
-        "movq   (%1), %%mm0             \n\t"
-        "movq   1(%1), %%mm1            \n\t"
-        "movq   (%1, %3), %%mm2         \n\t"
-        "movq   1(%1, %3), %%mm3        \n\t"
-        PAVGBP(%%mm0, %%mm1, %%mm4,   %%mm2, %%mm3, %%mm5)
-        "movq   %%mm4, (%2)             \n\t"
-        "movq   %%mm5, (%2, %3)         \n\t"
-        "movq   8(%1), %%mm0            \n\t"
-        "movq   9(%1), %%mm1            \n\t"
-        "movq   8(%1, %3), %%mm2        \n\t"
-        "movq   9(%1, %3), %%mm3        \n\t"
-        PAVGBP(%%mm0, %%mm1, %%mm4,   %%mm2, %%mm3, %%mm5)
-        "movq   %%mm4, 8(%2)            \n\t"
-        "movq   %%mm5, 8(%2, %3)        \n\t"
-        "add    %%"REG_a", %1           \n\t"
-        "add    %%"REG_a", %2           \n\t"
-        "movq   (%1), %%mm0             \n\t"
-        "movq   1(%1), %%mm1            \n\t"
-        "movq   (%1, %3), %%mm2         \n\t"
-        "movq   1(%1, %3), %%mm3        \n\t"
-        PAVGBP(%%mm0, %%mm1, %%mm4,   %%mm2, %%mm3, %%mm5)
-        "movq   %%mm4, (%2)             \n\t"
-        "movq   %%mm5, (%2, %3)         \n\t"
-        "movq   8(%1), %%mm0            \n\t"
-        "movq   9(%1), %%mm1            \n\t"
-        "movq   8(%1, %3), %%mm2        \n\t"
-        "movq   9(%1, %3), %%mm3        \n\t"
-        PAVGBP(%%mm0, %%mm1, %%mm4,   %%mm2, %%mm3, %%mm5)
-        "movq   %%mm4, 8(%2)            \n\t"
-        "movq   %%mm5, 8(%2, %3)        \n\t"
-        "add    %%"REG_a", %1           \n\t"
-        "add    %%"REG_a", %2           \n\t"
-        "subl   $4, %0                  \n\t"
-        "jnz    1b                      \n\t"
-        :"+g"(h), "+S"(pixels), "+D"(block)
-        :"r"((x86_reg)line_size)
-        :REG_a, "memory");
-}
-
-static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    MOVQ_BFE(mm6);
-    __asm__ volatile(
-        "lea (%3, %3), %%"REG_a"        \n\t"
-        "movq (%1), %%mm0               \n\t"
-        ".p2align 3                     \n\t"
-        "1:                             \n\t"
-        "movq   (%1, %3), %%mm1         \n\t"
-        "movq   (%1, %%"REG_a"),%%mm2   \n\t"
-        PAVGBP(%%mm1, %%mm0, %%mm4,   %%mm2, %%mm1, %%mm5)
-        "movq   %%mm4, (%2)             \n\t"
-        "movq   %%mm5, (%2, %3)         \n\t"
-        "add    %%"REG_a", %1           \n\t"
-        "add    %%"REG_a", %2           \n\t"
-        "movq   (%1, %3), %%mm1         \n\t"
-        "movq   (%1, %%"REG_a"),%%mm0   \n\t"
-        PAVGBP(%%mm1, %%mm2, %%mm4,   %%mm0, %%mm1, %%mm5)
-        "movq   %%mm4, (%2)             \n\t"
-        "movq   %%mm5, (%2, %3)         \n\t"
-        "add    %%"REG_a", %1           \n\t"
-        "add    %%"REG_a", %2           \n\t"
-        "subl   $4, %0                  \n\t"
-        "jnz    1b                      \n\t"
-        :"+g"(h), "+S"(pixels), "+D"(block)
-        :"r"((x86_reg)line_size)
-        :REG_a, "memory");
-}
-
-static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    MOVQ_BFE(mm6);
-    JUMPALIGN();
-    do {
-        __asm__ volatile(
-            "movq  %1, %%mm0            \n\t"
-            "movq  1%1, %%mm1           \n\t"
-            "movq  %0, %%mm3            \n\t"
-            PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
-            PAVGB_MMX(%%mm3, %%mm2, %%mm0, %%mm6)
-            "movq  %%mm0, %0            \n\t"
-            "movq  8%1, %%mm0           \n\t"
-            "movq  9%1, %%mm1           \n\t"
-            "movq  8%0, %%mm3           \n\t"
-            PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
-            PAVGB_MMX(%%mm3, %%mm2, %%mm0, %%mm6)
-            "movq  %%mm0, 8%0           \n\t"
-            :"+m"(*block)
-            :"m"(*pixels)
-            :"memory");
-        pixels += line_size;
-        block += line_size;
-    } while (--h);
-}
-
-static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
-{
-    MOVQ_BFE(mm6);
-    __asm__ volatile(
-        "lea    (%3, %3), %%"REG_a"     \n\t"
-        "movq   (%1), %%mm0             \n\t"
-        ".p2align 3                     \n\t"
-        "1:                             \n\t"
-        "movq   (%1, %3), %%mm1         \n\t"
-        "movq   (%1, %%"REG_a"), %%mm2  \n\t"
-        PAVGBP(%%mm1, %%mm0, %%mm4,   %%mm2, %%mm1, %%mm5)
-        "movq   (%2), %%mm3             \n\t"
-        PAVGB_MMX(%%mm3, %%mm4, %%mm0, %%mm6)
-        "movq   (%2, %3), %%mm3         \n\t"
-        PAVGB_MMX(%%mm3, %%mm5, %%mm1, %%mm6)
-        "movq   %%mm0, (%2)             \n\t"
-        "movq   %%mm1, (%2, %3)         \n\t"
-        "add    %%"REG_a", %1           \n\t"
-        "add    %%"REG_a", %2           \n\t"
-
-        "movq   (%1, %3), %%mm1         \n\t"
-        "movq   (%1, %%"REG_a"), %%mm0  \n\t"
-        PAVGBP(%%mm1, %%mm2, %%mm4,   %%mm0, %%mm1, %%mm5)
-        "movq   (%2), %%mm3             \n\t"
-        PAVGB_MMX(%%mm3, %%mm4, %%mm2, %%mm6)
-        "movq   (%2, %3), %%mm3         \n\t"
-        PAVGB_MMX(%%mm3, %%mm5, %%mm1, %%mm6)
-        "movq   %%mm2, (%2)             \n\t"
-        "movq   %%mm1, (%2, %3)         \n\t"
-        "add    %%"REG_a", %1           \n\t"
-        "add    %%"REG_a", %2           \n\t"
-
-        "subl   $4, %0                  \n\t"
-        "jnz    1b                      \n\t"
-        :"+g"(h), "+S"(pixels), "+D"(block)
-        :"r"((x86_reg)line_size)
-        :REG_a, "memory");
-}
diff --git a/deps/libav/libavcodec/x86/idct_mmx_xvid.c b/deps/libav/libavcodec/x86/idct_mmx_xvid.c
deleted file mode 100644
index 2772339..0000000
--- a/deps/libav/libavcodec/x86/idct_mmx_xvid.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- * XVID MPEG-4 VIDEO CODEC
- * - MMX and XMM forward discrete cosine transform -
- *
- * Copyright(C) 2001 Peter Ross <pross at xvid.org>
- *
- * Originally provided by Intel at AP-922
- * http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
- * (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm)
- * but in a limited edition.
- * New macro implements a column part for precise iDCT
- * The routine precision now satisfies IEEE standard 1180-1990.
- *
- * Copyright(C) 2000-2001 Peter Gubanov <peter at elecard.net.ru>
- * Rounding trick Copyright(C) 2000 Michel Lespinasse <walken at zoy.org>
- *
- * http://www.elecard.com/peter/idct.html
- * http://www.linuxvideo.org/mpeg2dec/
- *
- * These examples contain code fragments for first stage iDCT 8x8
- * (for rows) and first stage DCT 8x8 (for columns)
- *
- * conversion to gcc syntax by Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-
-#include "config.h"
-#include "libavcodec/avcodec.h"
-#include "libavutil/mem.h"
-#include "dsputil_x86.h"
-#include "idct_xvid.h"
-
-#if HAVE_MMX_INLINE
-
-//=============================================================================
-// Macros and other preprocessor constants
-//=============================================================================
-
-#define BITS_INV_ACC    5                              // 4 or 5 for IEEE
-#define SHIFT_INV_ROW   (16 - BITS_INV_ACC) //11
-#define SHIFT_INV_COL   (1 + BITS_INV_ACC) //6
-#define RND_INV_ROW     (1024 * (6 - BITS_INV_ACC))
-#define RND_INV_COL     (16 * (BITS_INV_ACC - 3))
-#define RND_INV_CORR    (RND_INV_COL - 1)
-
-#define BITS_FRW_ACC    3                              // 2 or 3 for accuracy
-#define SHIFT_FRW_COL   BITS_FRW_ACC
-#define SHIFT_FRW_ROW   (BITS_FRW_ACC + 17)
-#define RND_FRW_ROW     (262144*(BITS_FRW_ACC - 1))
-
-
-//-----------------------------------------------------------------------------
-// Various memory constants (trigonometric values or rounding values)
-//-----------------------------------------------------------------------------
-
-
-DECLARE_ALIGNED(8, static const int16_t, tg_1_16)[4*4] = {
-  13036,13036,13036,13036,        // tg * (2<<16) + 0.5
-  27146,27146,27146,27146,        // tg * (2<<16) + 0.5
-  -21746,-21746,-21746,-21746,    // tg * (2<<16) + 0.5
-  23170,23170,23170,23170};       // cos * (2<<15) + 0.5
-
-DECLARE_ALIGNED(8, static const int32_t, rounder_0)[2*8] = {
-  65536,65536,
-  3597,3597,
-  2260,2260,
-  1203,1203,
-  0,0,
-  120,120,
-  512,512,
-  512,512};
-
-//-----------------------------------------------------------------------------
-//
-// The first stage iDCT 8x8 - inverse DCTs of rows
-//
-//-----------------------------------------------------------------------------
-// The 8-point inverse DCT direct algorithm
-//-----------------------------------------------------------------------------
-//
-// static const short w[32] = {
-//       FIX(cos_4_16),  FIX(cos_2_16),  FIX(cos_4_16),  FIX(cos_6_16),
-//       FIX(cos_4_16),  FIX(cos_6_16), -FIX(cos_4_16), -FIX(cos_2_16),
-//       FIX(cos_4_16), -FIX(cos_6_16), -FIX(cos_4_16),  FIX(cos_2_16),
-//       FIX(cos_4_16), -FIX(cos_2_16),  FIX(cos_4_16), -FIX(cos_6_16),
-//       FIX(cos_1_16),  FIX(cos_3_16),  FIX(cos_5_16),  FIX(cos_7_16),
-//       FIX(cos_3_16), -FIX(cos_7_16), -FIX(cos_1_16), -FIX(cos_5_16),
-//       FIX(cos_5_16), -FIX(cos_1_16),  FIX(cos_7_16),  FIX(cos_3_16),
-//       FIX(cos_7_16), -FIX(cos_5_16),  FIX(cos_3_16), -FIX(cos_1_16) };
-//
-// #define DCT_8_INV_ROW(x, y)
-// {
-//       int a0, a1, a2, a3, b0, b1, b2, b3;
-//
-//       a0 =x[0]*w[0]+x[2]*w[1]+x[4]*w[2]+x[6]*w[3];
-//       a1 =x[0]*w[4]+x[2]*w[5]+x[4]*w[6]+x[6]*w[7];
-//       a2 = x[0] * w[ 8] + x[2] * w[ 9] + x[4] * w[10] + x[6] * w[11];
-//       a3 = x[0] * w[12] + x[2] * w[13] + x[4] * w[14] + x[6] * w[15];
-//       b0 = x[1] * w[16] + x[3] * w[17] + x[5] * w[18] + x[7] * w[19];
-//       b1 = x[1] * w[20] + x[3] * w[21] + x[5] * w[22] + x[7] * w[23];
-//       b2 = x[1] * w[24] + x[3] * w[25] + x[5] * w[26] + x[7] * w[27];
-//       b3 = x[1] * w[28] + x[3] * w[29] + x[5] * w[30] + x[7] * w[31];
-//
-//       y[0] = SHIFT_ROUND ( a0 + b0 );
-//       y[1] = SHIFT_ROUND ( a1 + b1 );
-//       y[2] = SHIFT_ROUND ( a2 + b2 );
-//       y[3] = SHIFT_ROUND ( a3 + b3 );
-//       y[4] = SHIFT_ROUND ( a3 - b3 );
-//       y[5] = SHIFT_ROUND ( a2 - b2 );
-//       y[6] = SHIFT_ROUND ( a1 - b1 );
-//       y[7] = SHIFT_ROUND ( a0 - b0 );
-// }
-//
-//-----------------------------------------------------------------------------
-//
-// In this implementation the outputs of the iDCT-1D are multiplied
-//       for rows 0,4 - by cos_4_16,
-//       for rows 1,7 - by cos_1_16,
-//       for rows 2,6 - by cos_2_16,
-//       for rows 3,5 - by cos_3_16
-// and are shifted to the left for better accuracy
-//
-// For the constants used,
-//       FIX(float_const) = (short) (float_const * (1<<15) + 0.5)
-//
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Tables for mmx processors
-//-----------------------------------------------------------------------------
-
-// Table for rows 0,4 - constants are multiplied by cos_4_16
-DECLARE_ALIGNED(8, static const int16_t, tab_i_04_mmx)[32*4] = {
-  16384,16384,16384,-16384,       // movq-> w06 w04 w02 w00
-  21407,8867,8867,-21407,         // w07 w05 w03 w01
-  16384,-16384,16384,16384,       // w14 w12 w10 w08
-  -8867,21407,-21407,-8867,       // w15 w13 w11 w09
-  22725,12873,19266,-22725,       // w22 w20 w18 w16
-  19266,4520,-4520,-12873,        // w23 w21 w19 w17
-  12873,4520,4520,19266,          // w30 w28 w26 w24
-  -22725,19266,-12873,-22725,     // w31 w29 w27 w25
-// Table for rows 1,7 - constants are multiplied by cos_1_16
-  22725,22725,22725,-22725,       // movq-> w06 w04 w02 w00
-  29692,12299,12299,-29692,       // w07 w05 w03 w01
-  22725,-22725,22725,22725,       // w14 w12 w10 w08
-  -12299,29692,-29692,-12299,     // w15 w13 w11 w09
-  31521,17855,26722,-31521,       // w22 w20 w18 w16
-  26722,6270,-6270,-17855,        // w23 w21 w19 w17
-  17855,6270,6270,26722,          // w30 w28 w26 w24
-  -31521,26722,-17855,-31521,     // w31 w29 w27 w25
-// Table for rows 2,6 - constants are multiplied by cos_2_16
-  21407,21407,21407,-21407,       // movq-> w06 w04 w02 w00
-  27969,11585,11585,-27969,       // w07 w05 w03 w01
-  21407,-21407,21407,21407,       // w14 w12 w10 w08
-  -11585,27969,-27969,-11585,     // w15 w13 w11 w09
-  29692,16819,25172,-29692,       // w22 w20 w18 w16
-  25172,5906,-5906,-16819,        // w23 w21 w19 w17
-  16819,5906,5906,25172,          // w30 w28 w26 w24
-  -29692,25172,-16819,-29692,     // w31 w29 w27 w25
-// Table for rows 3,5 - constants are multiplied by cos_3_16
-  19266,19266,19266,-19266,       // movq-> w06 w04 w02 w00
-  25172,10426,10426,-25172,       // w07 w05 w03 w01
-  19266,-19266,19266,19266,       // w14 w12 w10 w08
-  -10426,25172,-25172,-10426,     // w15 w13 w11 w09
-  26722,15137,22654,-26722,       // w22 w20 w18 w16
-  22654,5315,-5315,-15137,        // w23 w21 w19 w17
-  15137,5315,5315,22654,          // w30 w28 w26 w24
-  -26722,22654,-15137,-26722,     // w31 w29 w27 w25
-};
-//-----------------------------------------------------------------------------
-// Tables for xmm processors
-//-----------------------------------------------------------------------------
-
-// %3 for rows 0,4 - constants are multiplied by cos_4_16
-DECLARE_ALIGNED(8, static const int16_t, tab_i_04_xmm)[32*4] = {
-  16384,21407,16384,8867,      // movq-> w05 w04 w01 w00
-  16384,8867,-16384,-21407,    // w07 w06 w03 w02
-  16384,-8867,16384,-21407,    // w13 w12 w09 w08
-  -16384,21407,16384,-8867,    // w15 w14 w11 w10
-  22725,19266,19266,-4520,     // w21 w20 w17 w16
-  12873,4520,-22725,-12873,    // w23 w22 w19 w18
-  12873,-22725,4520,-12873,    // w29 w28 w25 w24
-  4520,19266,19266,-22725,     // w31 w30 w27 w26
-// %3 for rows 1,7 - constants are multiplied by cos_1_16
-  22725,29692,22725,12299,     // movq-> w05 w04 w01 w00
-  22725,12299,-22725,-29692,   // w07 w06 w03 w02
-  22725,-12299,22725,-29692,   // w13 w12 w09 w08
-  -22725,29692,22725,-12299,   // w15 w14 w11 w10
-  31521,26722,26722,-6270,     // w21 w20 w17 w16
-  17855,6270,-31521,-17855,    // w23 w22 w19 w18
-  17855,-31521,6270,-17855,    // w29 w28 w25 w24
-  6270,26722,26722,-31521,     // w31 w30 w27 w26
-// %3 for rows 2,6 - constants are multiplied by cos_2_16
-  21407,27969,21407,11585,     // movq-> w05 w04 w01 w00
-  21407,11585,-21407,-27969,   // w07 w06 w03 w02
-  21407,-11585,21407,-27969,   // w13 w12 w09 w08
-  -21407,27969,21407,-11585,   // w15 w14 w11 w10
-  29692,25172,25172,-5906,     // w21 w20 w17 w16
-  16819,5906,-29692,-16819,    // w23 w22 w19 w18
-  16819,-29692,5906,-16819,    // w29 w28 w25 w24
-  5906,25172,25172,-29692,     // w31 w30 w27 w26
-// %3 for rows 3,5 - constants are multiplied by cos_3_16
-  19266,25172,19266,10426,     // movq-> w05 w04 w01 w00
-  19266,10426,-19266,-25172,   // w07 w06 w03 w02
-  19266,-10426,19266,-25172,   // w13 w12 w09 w08
-  -19266,25172,19266,-10426,   // w15 w14 w11 w10
-  26722,22654,22654,-5315,     // w21 w20 w17 w16
-  15137,5315,-26722,-15137,    // w23 w22 w19 w18
-  15137,-26722,5315,-15137,    // w29 w28 w25 w24
-  5315,22654,22654,-26722,     // w31 w30 w27 w26
-};
-//=============================================================================
-// Helper macros for the code
-//=============================================================================
-
-//-----------------------------------------------------------------------------
-// DCT_8_INV_ROW_MMX( INP, OUT, TABLE, ROUNDER
-//-----------------------------------------------------------------------------
-
-#define DCT_8_INV_ROW_MMX(A1,A2,A3,A4)\
-  "movq " #A1 ",%%mm0              \n\t"/* 0 ; x3 x2 x1 x0*/\
-  "movq 8+" #A1 ",%%mm1            \n\t"/* 1 ; x7 x6 x5 x4*/\
-  "movq %%mm0,%%mm2            \n\t"/* 2  ; x3 x2 x1 x0*/\
-  "movq " #A3 ",%%mm3              \n\t"/* 3 ; w06 w04 w02 w00*/\
-  "punpcklwd %%mm1,%%mm0       \n\t"/* x5 x1 x4 x0*/\
-  "movq %%mm0,%%mm5            \n\t"/* 5 ; x5 x1 x4 x0*/\
-  "punpckldq %%mm0,%%mm0       \n\t"/* x4 x0 x4 x0*/\
-  "movq 8+" #A3 ",%%mm4            \n\t"/* 4 ; w07 w05 w03 w01*/\
-  "punpckhwd %%mm1,%%mm2       \n\t"/* 1 ; x7 x3 x6 x2*/\
-  "pmaddwd %%mm0,%%mm3         \n\t"/* x4*w06+x0*w04 x4*w02+x0*w00*/\
-  "movq %%mm2,%%mm6            \n\t"/* 6 ; x7 x3 x6 x2*/\
-  "movq 32+" #A3 ",%%mm1           \n\t"/* 1 ; w22 w20 w18 w16*/\
-  "punpckldq %%mm2,%%mm2       \n\t"/* x6 x2 x6 x2*/\
-  "pmaddwd %%mm2,%%mm4         \n\t"/* x6*w07+x2*w05 x6*w03+x2*w01*/\
-  "punpckhdq %%mm5,%%mm5       \n\t"/* x5 x1 x5 x1*/\
-  "pmaddwd 16+" #A3 ",%%mm0        \n\t"/* x4*w14+x0*w12 x4*w10+x0*w08*/\
-  "punpckhdq %%mm6,%%mm6       \n\t"/* x7 x3 x7 x3*/\
-  "movq 40+" #A3 ",%%mm7           \n\t"/* 7 ; w23 w21 w19 w17*/\
-  "pmaddwd %%mm5,%%mm1         \n\t"/* x5*w22+x1*w20 x5*w18+x1*w16*/\
-  "paddd " #A4 ",%%mm3             \n\t"/* +%4*/\
-  "pmaddwd %%mm6,%%mm7         \n\t"/* x7*w23+x3*w21 x7*w19+x3*w17*/\
-  "pmaddwd 24+" #A3 ",%%mm2        \n\t"/* x6*w15+x2*w13 x6*w11+x2*w09*/\
-  "paddd %%mm4,%%mm3           \n\t"/* 4 ; a1=sum(even1) a0=sum(even0)*/\
-  "pmaddwd 48+" #A3 ",%%mm5        \n\t"/* x5*w30+x1*w28 x5*w26+x1*w24*/\
-  "movq %%mm3,%%mm4            \n\t"/* 4 ; a1 a0*/\
-  "pmaddwd 56+" #A3 ",%%mm6        \n\t"/* x7*w31+x3*w29 x7*w27+x3*w25*/\
-  "paddd %%mm7,%%mm1           \n\t"/* 7 ; b1=sum(odd1) b0=sum(odd0)*/\
-  "paddd " #A4 ",%%mm0             \n\t"/* +%4*/\
-  "psubd %%mm1,%%mm3           \n\t"/* a1-b1 a0-b0*/\
-  "psrad $11,%%mm3 \n\t"/* y6=a1-b1 y7=a0-b0*/\
-  "paddd %%mm4,%%mm1           \n\t"/* 4 ; a1+b1 a0+b0*/\
-  "paddd %%mm2,%%mm0           \n\t"/* 2 ; a3=sum(even3) a2=sum(even2)*/\
-  "psrad $11,%%mm1 \n\t"/* y1=a1+b1 y0=a0+b0*/\
-  "paddd %%mm6,%%mm5           \n\t"/* 6 ; b3=sum(odd3) b2=sum(odd2)*/\
-  "movq %%mm0,%%mm4            \n\t"/* 4 ; a3 a2*/\
-  "paddd %%mm5,%%mm0           \n\t"/* a3+b3 a2+b2*/\
-  "psubd %%mm5,%%mm4           \n\t"/* 5 ; a3-b3 a2-b2*/\
-  "psrad $11,%%mm0 \n\t"/* y3=a3+b3 y2=a2+b2*/\
-  "psrad $11,%%mm4 \n\t"/* y4=a3-b3 y5=a2-b2*/\
-  "packssdw %%mm0,%%mm1        \n\t"/* 0 ; y3 y2 y1 y0*/\
-  "packssdw %%mm3,%%mm4        \n\t"/* 3 ; y6 y7 y4 y5*/\
-  "movq %%mm4,%%mm7            \n\t"/* 7 ; y6 y7 y4 y5*/\
-  "psrld $16,%%mm4            \n\t"/* 0 y6 0 y4*/\
-  "pslld $16,%%mm7            \n\t"/* y7 0 y5 0*/\
-  "movq %%mm1," #A2 "              \n\t"/* 1 ; save y3 y2 y1 y0*/\
-  "por %%mm4,%%mm7             \n\t"/* 4 ; y7 y6 y5 y4*/\
-  "movq %%mm7,8            +" #A2 "\n\t"/* 7 ; save y7 y6 y5 y4*/\
-
-
-//-----------------------------------------------------------------------------
-// DCT_8_INV_ROW_XMM( INP, OUT, TABLE, ROUNDER
-//-----------------------------------------------------------------------------
-
-#define DCT_8_INV_ROW_XMM(A1,A2,A3,A4)\
-  "movq " #A1 ",%%mm0                  \n\t"/* 0     ; x3 x2 x1 x0*/\
-  "movq 8+" #A1 ",%%mm1                \n\t"/* 1     ; x7 x6 x5 x4*/\
-  "movq %%mm0,%%mm2                \n\t"/* 2     ; x3 x2 x1 x0*/\
-  "movq " #A3 ",%%mm3                  \n\t"/* 3     ; w05 w04 w01 w00*/\
-  "pshufw $0x88,%%mm0,%%mm0        \n\t"/* x2 x0 x2 x0*/\
-  "movq 8+" #A3 ",%%mm4                \n\t"/* 4     ; w07 w06 w03 w02*/\
-  "movq %%mm1,%%mm5                \n\t"/* 5     ; x7 x6 x5 x4*/\
-  "pmaddwd %%mm0,%%mm3             \n\t"/* x2*w05+x0*w04 x2*w01+x0*w00*/\
-  "movq 32+" #A3 ",%%mm6               \n\t"/* 6     ; w21 w20 w17 w16*/\
-  "pshufw $0x88,%%mm1,%%mm1        \n\t"/* x6 x4 x6 x4*/\
-  "pmaddwd %%mm1,%%mm4             \n\t"/* x6*w07+x4*w06 x6*w03+x4*w02*/\
-  "movq 40+" #A3 ",%%mm7               \n\t"/* 7    ; w23 w22 w19 w18*/\
-  "pshufw $0xdd,%%mm2,%%mm2        \n\t"/* x3 x1 x3 x1*/\
-  "pmaddwd %%mm2,%%mm6             \n\t"/* x3*w21+x1*w20 x3*w17+x1*w16*/\
-  "pshufw $0xdd,%%mm5,%%mm5        \n\t"/* x7 x5 x7 x5*/\
-  "pmaddwd %%mm5,%%mm7             \n\t"/* x7*w23+x5*w22 x7*w19+x5*w18*/\
-  "paddd " #A4 ",%%mm3                 \n\t"/* +%4*/\
-  "pmaddwd 16+" #A3 ",%%mm0            \n\t"/* x2*w13+x0*w12 x2*w09+x0*w08*/\
-  "paddd %%mm4,%%mm3               \n\t"/* 4     ; a1=sum(even1) a0=sum(even0)*/\
-  "pmaddwd 24+" #A3 ",%%mm1            \n\t"/* x6*w15+x4*w14 x6*w11+x4*w10*/\
-  "movq %%mm3,%%mm4                \n\t"/* 4     ; a1 a0*/\
-  "pmaddwd 48+" #A3 ",%%mm2            \n\t"/* x3*w29+x1*w28 x3*w25+x1*w24*/\
-  "paddd %%mm7,%%mm6               \n\t"/* 7     ; b1=sum(odd1) b0=sum(odd0)*/\
-  "pmaddwd 56+" #A3 ",%%mm5            \n\t"/* x7*w31+x5*w30 x7*w27+x5*w26*/\
-  "paddd %%mm6,%%mm3               \n\t"/* a1+b1 a0+b0*/\
-  "paddd " #A4 ",%%mm0                 \n\t"/* +%4*/\
-  "psrad $11,%%mm3     \n\t"/* y1=a1+b1 y0=a0+b0*/\
-  "paddd %%mm1,%%mm0               \n\t"/* 1     ; a3=sum(even3) a2=sum(even2)*/\
-  "psubd %%mm6,%%mm4               \n\t"/* 6     ; a1-b1 a0-b0*/\
-  "movq %%mm0,%%mm7                \n\t"/* 7     ; a3 a2*/\
-  "paddd %%mm5,%%mm2               \n\t"/* 5     ; b3=sum(odd3) b2=sum(odd2)*/\
-  "paddd %%mm2,%%mm0               \n\t"/* a3+b3 a2+b2*/\
-  "psrad $11,%%mm4     \n\t"/* y6=a1-b1 y7=a0-b0*/\
-  "psubd %%mm2,%%mm7               \n\t"/* 2     ; a3-b3 a2-b2*/\
-  "psrad $11,%%mm0     \n\t"/* y3=a3+b3 y2=a2+b2*/\
-  "psrad $11,%%mm7     \n\t"/* y4=a3-b3 y5=a2-b2*/\
-  "packssdw %%mm0,%%mm3            \n\t"/* 0     ; y3 y2 y1 y0*/\
-  "packssdw %%mm4,%%mm7            \n\t"/* 4     ; y6 y7 y4 y5*/\
-  "movq %%mm3, " #A2 "                  \n\t"/* 3     ; save y3 y2 y1 y0*/\
-  "pshufw $0xb1,%%mm7,%%mm7        \n\t"/* y7 y6 y5 y4*/\
-  "movq %%mm7,8                +" #A2 "\n\t"/* 7     ; save y7 y6 y5 y4*/\
-
-
-//-----------------------------------------------------------------------------
-//
-// The first stage DCT 8x8 - forward DCTs of columns
-//
-// The %2puts are multiplied
-// for rows 0,4 - on cos_4_16,
-// for rows 1,7 - on cos_1_16,
-// for rows 2,6 - on cos_2_16,
-// for rows 3,5 - on cos_3_16
-// and are shifted to the left for rise of accuracy
-//
-//-----------------------------------------------------------------------------
-//
-// The 8-point scaled forward DCT algorithm (26a8m)
-//
-//-----------------------------------------------------------------------------
-//
-// #define DCT_8_FRW_COL(x, y)
-//{
-// short t0, t1, t2, t3, t4, t5, t6, t7;
-// short tp03, tm03, tp12, tm12, tp65, tm65;
-// short tp465, tm465, tp765, tm765;
-//
-// t0 = LEFT_SHIFT ( x[0] + x[7] );
-// t1 = LEFT_SHIFT ( x[1] + x[6] );
-// t2 = LEFT_SHIFT ( x[2] + x[5] );
-// t3 = LEFT_SHIFT ( x[3] + x[4] );
-// t4 = LEFT_SHIFT ( x[3] - x[4] );
-// t5 = LEFT_SHIFT ( x[2] - x[5] );
-// t6 = LEFT_SHIFT ( x[1] - x[6] );
-// t7 = LEFT_SHIFT ( x[0] - x[7] );
-//
-// tp03 = t0 + t3;
-// tm03 = t0 - t3;
-// tp12 = t1 + t2;
-// tm12 = t1 - t2;
-//
-// y[0] = tp03 + tp12;
-// y[4] = tp03 - tp12;
-//
-// y[2] = tm03 + tm12 * tg_2_16;
-// y[6] = tm03 * tg_2_16 - tm12;
-//
-// tp65 =(t6 +t5 )*cos_4_16;
-// tm65 =(t6 -t5 )*cos_4_16;
-//
-// tp765 = t7 + tp65;
-// tm765 = t7 - tp65;
-// tp465 = t4 + tm65;
-// tm465 = t4 - tm65;
-//
-// y[1] = tp765 + tp465 * tg_1_16;
-// y[7] = tp765 * tg_1_16 - tp465;
-// y[5] = tm765 * tg_3_16 + tm465;
-// y[3] = tm765 - tm465 * tg_3_16;
-//}
-//
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// DCT_8_INV_COL_4  INP,OUT
-//-----------------------------------------------------------------------------
-
-#define DCT_8_INV_COL(A1,A2)\
-  "movq 2*8(%3),%%mm0\n\t"\
-  "movq 16*3+" #A1 ",%%mm3\n\t"\
-  "movq %%mm0,%%mm1            \n\t"/* tg_3_16*/\
-  "movq 16*5+" #A1 ",%%mm5\n\t"\
-  "pmulhw %%mm3,%%mm0          \n\t"/* x3*(tg_3_16-1)*/\
-  "movq (%3),%%mm4\n\t"\
-  "pmulhw %%mm5,%%mm1          \n\t"/* x5*(tg_3_16-1)*/\
-  "movq 16*7+" #A1 ",%%mm7\n\t"\
-  "movq %%mm4,%%mm2            \n\t"/* tg_1_16*/\
-  "movq 16*1+" #A1 ",%%mm6\n\t"\
-  "pmulhw %%mm7,%%mm4          \n\t"/* x7*tg_1_16*/\
-  "paddsw %%mm3,%%mm0          \n\t"/* x3*tg_3_16*/\
-  "pmulhw %%mm6,%%mm2          \n\t"/* x1*tg_1_16*/\
-  "paddsw %%mm3,%%mm1          \n\t"/* x3+x5*(tg_3_16-1)*/\
-  "psubsw %%mm5,%%mm0          \n\t"/* x3*tg_3_16-x5 = tm35*/\
-  "movq 3*8(%3),%%mm3\n\t"\
-  "paddsw %%mm5,%%mm1          \n\t"/* x3+x5*tg_3_16 = tp35*/\
-  "paddsw %%mm6,%%mm4          \n\t"/* x1+tg_1_16*x7 = tp17*/\
-  "psubsw %%mm7,%%mm2          \n\t"/* x1*tg_1_16-x7 = tm17*/\
-  "movq %%mm4,%%mm5            \n\t"/* tp17*/\
-  "movq %%mm2,%%mm6            \n\t"/* tm17*/\
-  "paddsw %%mm1,%%mm5          \n\t"/* tp17+tp35 = b0*/\
-  "psubsw %%mm0,%%mm6          \n\t"/* tm17-tm35 = b3*/\
-  "psubsw %%mm1,%%mm4          \n\t"/* tp17-tp35 = t1*/\
-  "paddsw %%mm0,%%mm2          \n\t"/* tm17+tm35 = t2*/\
-  "movq 1*8(%3),%%mm7\n\t"\
-  "movq %%mm4,%%mm1            \n\t"/* t1*/\
-  "movq %%mm5,3*16         +" #A2 "\n\t"/* save b0*/\
-  "paddsw %%mm2,%%mm1          \n\t"/* t1+t2*/\
-  "movq %%mm6,5*16         +" #A2 "\n\t"/* save b3*/\
-  "psubsw %%mm2,%%mm4          \n\t"/* t1-t2*/\
-  "movq 2*16+" #A1 ",%%mm5\n\t"\
-  "movq %%mm7,%%mm0            \n\t"/* tg_2_16*/\
-  "movq 6*16+" #A1 ",%%mm6\n\t"\
-  "pmulhw %%mm5,%%mm0          \n\t"/* x2*tg_2_16*/\
-  "pmulhw %%mm6,%%mm7          \n\t"/* x6*tg_2_16*/\
-  "pmulhw %%mm3,%%mm1          \n\t"/* ocos_4_16*(t1+t2) = b1/2*/\
-  "movq 0*16+" #A1 ",%%mm2\n\t"\
-  "pmulhw %%mm3,%%mm4          \n\t"/* ocos_4_16*(t1-t2) = b2/2*/\
-  "psubsw %%mm6,%%mm0          \n\t"/* t2*tg_2_16-x6 = tm26*/\
-  "movq %%mm2,%%mm3            \n\t"/* x0*/\
-  "movq 4*16+" #A1 ",%%mm6\n\t"\
-  "paddsw %%mm5,%%mm7          \n\t"/* x2+x6*tg_2_16 = tp26*/\
-  "paddsw %%mm6,%%mm2          \n\t"/* x0+x4 = tp04*/\
-  "psubsw %%mm6,%%mm3          \n\t"/* x0-x4 = tm04*/\
-  "movq %%mm2,%%mm5            \n\t"/* tp04*/\
-  "movq %%mm3,%%mm6            \n\t"/* tm04*/\
-  "psubsw %%mm7,%%mm2          \n\t"/* tp04-tp26 = a3*/\
-  "paddsw %%mm0,%%mm3          \n\t"/* tm04+tm26 = a1*/\
-  "paddsw %%mm1,%%mm1          \n\t"/* b1*/\
-  "paddsw %%mm4,%%mm4          \n\t"/* b2*/\
-  "paddsw %%mm7,%%mm5          \n\t"/* tp04+tp26 = a0*/\
-  "psubsw %%mm0,%%mm6          \n\t"/* tm04-tm26 = a2*/\
-  "movq %%mm3,%%mm7            \n\t"/* a1*/\
-  "movq %%mm6,%%mm0            \n\t"/* a2*/\
-  "paddsw %%mm1,%%mm3          \n\t"/* a1+b1*/\
-  "paddsw %%mm4,%%mm6          \n\t"/* a2+b2*/\
-  "psraw $6,%%mm3 \n\t"/* dst1*/\
-  "psubsw %%mm1,%%mm7          \n\t"/* a1-b1*/\
-  "psraw $6,%%mm6 \n\t"/* dst2*/\
-  "psubsw %%mm4,%%mm0          \n\t"/* a2-b2*/\
-  "movq 3*16+" #A2 ",%%mm1         \n\t"/* load b0*/\
-  "psraw $6,%%mm7 \n\t"/* dst6*/\
-  "movq %%mm5,%%mm4            \n\t"/* a0*/\
-  "psraw $6,%%mm0 \n\t"/* dst5*/\
-  "movq %%mm3,1*16+" #A2 "\n\t"\
-  "paddsw %%mm1,%%mm5          \n\t"/* a0+b0*/\
-  "movq %%mm6,2*16+" #A2 "\n\t"\
-  "psubsw %%mm1,%%mm4          \n\t"/* a0-b0*/\
-  "movq 5*16+" #A2 ",%%mm3         \n\t"/* load b3*/\
-  "psraw $6,%%mm5 \n\t"/* dst0*/\
-  "movq %%mm2,%%mm6            \n\t"/* a3*/\
-  "psraw $6,%%mm4 \n\t"/* dst7*/\
-  "movq %%mm0,5*16+" #A2 "\n\t"\
-  "paddsw %%mm3,%%mm2          \n\t"/* a3+b3*/\
-  "movq %%mm7,6*16+" #A2 "\n\t"\
-  "psubsw %%mm3,%%mm6          \n\t"/* a3-b3*/\
-  "movq %%mm5,0*16+" #A2 "\n\t"\
-  "psraw $6,%%mm2 \n\t"/* dst3*/\
-  "movq %%mm4,7*16+" #A2 "\n\t"\
-  "psraw $6,%%mm6 \n\t"/* dst4*/\
-  "movq %%mm2,3*16+" #A2 "\n\t"\
-  "movq %%mm6,4*16+" #A2 "\n\t"
-
-//=============================================================================
-// Code
-//=============================================================================
-
-//-----------------------------------------------------------------------------
-// void idct_mmx(uint16_t block[64]);
-//-----------------------------------------------------------------------------
-
-
-void ff_idct_xvid_mmx(short *block){
-__asm__ volatile(
-            //# Process each row
-    DCT_8_INV_ROW_MMX(0*16(%0), 0*16(%0), 64*0(%2), 8*0(%1))
-    DCT_8_INV_ROW_MMX(1*16(%0), 1*16(%0), 64*1(%2), 8*1(%1))
-    DCT_8_INV_ROW_MMX(2*16(%0), 2*16(%0), 64*2(%2), 8*2(%1))
-    DCT_8_INV_ROW_MMX(3*16(%0), 3*16(%0), 64*3(%2), 8*3(%1))
-    DCT_8_INV_ROW_MMX(4*16(%0), 4*16(%0), 64*0(%2), 8*4(%1))
-    DCT_8_INV_ROW_MMX(5*16(%0), 5*16(%0), 64*3(%2), 8*5(%1))
-    DCT_8_INV_ROW_MMX(6*16(%0), 6*16(%0), 64*2(%2), 8*6(%1))
-    DCT_8_INV_ROW_MMX(7*16(%0), 7*16(%0), 64*1(%2), 8*7(%1))
-
-            //# Process the columns (4 at a time)
-    DCT_8_INV_COL(0(%0), 0(%0))
-    DCT_8_INV_COL(8(%0), 8(%0))
-    :: "r"(block), "r"(rounder_0), "r"(tab_i_04_mmx), "r"(tg_1_16));
-}
-
-void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_idct_xvid_mmx(block);
-    ff_put_pixels_clamped_mmx(block, dest, line_size);
-}
-
-void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_idct_xvid_mmx(block);
-    ff_add_pixels_clamped_mmx(block, dest, line_size);
-}
-
-#endif /* HAVE_MMX_INLINE */
-
-#if HAVE_MMXEXT_INLINE
-
-//-----------------------------------------------------------------------------
-// void idct_xmm(uint16_t block[64]);
-//-----------------------------------------------------------------------------
-
-
-void ff_idct_xvid_mmxext(short *block)
-{
-__asm__ volatile(
-            //# Process each row
-    DCT_8_INV_ROW_XMM(0*16(%0), 0*16(%0), 64*0(%2), 8*0(%1))
-    DCT_8_INV_ROW_XMM(1*16(%0), 1*16(%0), 64*1(%2), 8*1(%1))
-    DCT_8_INV_ROW_XMM(2*16(%0), 2*16(%0), 64*2(%2), 8*2(%1))
-    DCT_8_INV_ROW_XMM(3*16(%0), 3*16(%0), 64*3(%2), 8*3(%1))
-    DCT_8_INV_ROW_XMM(4*16(%0), 4*16(%0), 64*0(%2), 8*4(%1))
-    DCT_8_INV_ROW_XMM(5*16(%0), 5*16(%0), 64*3(%2), 8*5(%1))
-    DCT_8_INV_ROW_XMM(6*16(%0), 6*16(%0), 64*2(%2), 8*6(%1))
-    DCT_8_INV_ROW_XMM(7*16(%0), 7*16(%0), 64*1(%2), 8*7(%1))
-
-            //# Process the columns (4 at a time)
-    DCT_8_INV_COL(0(%0), 0(%0))
-    DCT_8_INV_COL(8(%0), 8(%0))
-    :: "r"(block), "r"(rounder_0), "r"(tab_i_04_xmm), "r"(tg_1_16));
-}
-
-void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_idct_xvid_mmxext(block);
-    ff_put_pixels_clamped_mmx(block, dest, line_size);
-}
-
-void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_idct_xvid_mmxext(block);
-    ff_add_pixels_clamped_mmx(block, dest, line_size);
-}
-
-#endif /* HAVE_MMXEXT_INLINE */
diff --git a/deps/libav/libavcodec/x86/idct_sse2_xvid.c b/deps/libav/libavcodec/x86/idct_sse2_xvid.c
deleted file mode 100644
index 50655d6..0000000
--- a/deps/libav/libavcodec/x86/idct_sse2_xvid.c
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * XVID MPEG-4 VIDEO CODEC
- * - SSE2 inverse discrete cosine transform -
- *
- * Copyright(C) 2003 Pascal Massimino <skal at planet-d.net>
- *
- * Conversion to gcc syntax with modifications
- * by Alexander Strange <astrange at ithinksw.com>
- *
- * Originally from dct/x86_asm/fdct_sse2_skal.asm in Xvid.
- *
- * This file is part of Libav.
- *
- * Vertical pass is an implementation of the scheme:
- *  Loeffler C., Ligtenberg A., and Moschytz C.S.:
- *  Practical Fast 1D DCT Algorithm with Eleven Multiplications,
- *  Proc. ICASSP 1989, 988-991.
- *
- * Horizontal pass is a double 4x4 vector/matrix multiplication,
- * (see also Intel's Application Note 922:
- *  http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
- *  Copyright (C) 1999 Intel Corporation)
- *
- * More details at http://skal.planet-d.net/coding/dct.html
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "idct_xvid.h"
-#include "dsputil_x86.h"
-
-#if HAVE_SSE2_INLINE
-
-/**
- * @file
- * @brief SSE2 idct compatible with xvidmmx
- */
-
-#define X8(x)     x,x,x,x,x,x,x,x
-
-#define ROW_SHIFT 11
-#define COL_SHIFT 6
-
-DECLARE_ASM_CONST(16, int16_t, tan1)[] = {X8(13036)}; // tan( pi/16)
-DECLARE_ASM_CONST(16, int16_t, tan2)[] = {X8(27146)}; // tan(2pi/16) = sqrt(2)-1
-DECLARE_ASM_CONST(16, int16_t, tan3)[] = {X8(43790)}; // tan(3pi/16)-1
-DECLARE_ASM_CONST(16, int16_t, sqrt2)[]= {X8(23170)}; // 0.5/sqrt(2)
-DECLARE_ASM_CONST(8,  uint8_t, m127)[] = {X8(127)};
-
-DECLARE_ASM_CONST(16, int16_t, iTab1)[] = {
- 0x4000, 0x539f, 0xc000, 0xac61, 0x4000, 0xdd5d, 0x4000, 0xdd5d,
- 0x4000, 0x22a3, 0x4000, 0x22a3, 0xc000, 0x539f, 0x4000, 0xac61,
- 0x3249, 0x11a8, 0x4b42, 0xee58, 0x11a8, 0x4b42, 0x11a8, 0xcdb7,
- 0x58c5, 0x4b42, 0xa73b, 0xcdb7, 0x3249, 0xa73b, 0x4b42, 0xa73b
-};
-
-DECLARE_ASM_CONST(16, int16_t, iTab2)[] = {
- 0x58c5, 0x73fc, 0xa73b, 0x8c04, 0x58c5, 0xcff5, 0x58c5, 0xcff5,
- 0x58c5, 0x300b, 0x58c5, 0x300b, 0xa73b, 0x73fc, 0x58c5, 0x8c04,
- 0x45bf, 0x187e, 0x6862, 0xe782, 0x187e, 0x6862, 0x187e, 0xba41,
- 0x7b21, 0x6862, 0x84df, 0xba41, 0x45bf, 0x84df, 0x6862, 0x84df
-};
-
-DECLARE_ASM_CONST(16, int16_t, iTab3)[] = {
- 0x539f, 0x6d41, 0xac61, 0x92bf, 0x539f, 0xd2bf, 0x539f, 0xd2bf,
- 0x539f, 0x2d41, 0x539f, 0x2d41, 0xac61, 0x6d41, 0x539f, 0x92bf,
- 0x41b3, 0x1712, 0x6254, 0xe8ee, 0x1712, 0x6254, 0x1712, 0xbe4d,
- 0x73fc, 0x6254, 0x8c04, 0xbe4d, 0x41b3, 0x8c04, 0x6254, 0x8c04
-};
-
-DECLARE_ASM_CONST(16, int16_t, iTab4)[] = {
- 0x4b42, 0x6254, 0xb4be, 0x9dac, 0x4b42, 0xd746, 0x4b42, 0xd746,
- 0x4b42, 0x28ba, 0x4b42, 0x28ba, 0xb4be, 0x6254, 0x4b42, 0x9dac,
- 0x3b21, 0x14c3, 0x587e, 0xeb3d, 0x14c3, 0x587e, 0x14c3, 0xc4df,
- 0x6862, 0x587e, 0x979e, 0xc4df, 0x3b21, 0x979e, 0x587e, 0x979e
-};
-
-DECLARE_ASM_CONST(16, int32_t, walkenIdctRounders)[] = {
- 65536, 65536, 65536, 65536,
-  3597,  3597,  3597,  3597,
-  2260,  2260,  2260,  2260,
-  1203,  1203,  1203,  1203,
-   120,   120,   120,   120,
-   512,   512,   512,   512
-};
-
-// Temporary storage before the column pass
-#define ROW1 "%%xmm6"
-#define ROW3 "%%xmm4"
-#define ROW5 "%%xmm5"
-#define ROW7 "%%xmm7"
-
-#define CLEAR_ODD(r) "pxor  "r","r" \n\t"
-#define PUT_ODD(dst) "pshufhw  $0x1B, %%xmm2, "dst"   \n\t"
-
-#if ARCH_X86_64
-
-# define ROW0 "%%xmm8"
-# define REG0 ROW0
-# define ROW2 "%%xmm9"
-# define REG2 ROW2
-# define ROW4 "%%xmm10"
-# define REG4 ROW4
-# define ROW6 "%%xmm11"
-# define REG6 ROW6
-# define CLEAR_EVEN(r) CLEAR_ODD(r)
-# define PUT_EVEN(dst) PUT_ODD(dst)
-# define XMMS "%%xmm12"
-# define MOV_32_ONLY "#"
-# define SREG2 REG2
-# define TAN3 "%%xmm13"
-# define TAN1 "%%xmm14"
-
-#else
-
-# define ROW0 "(%0)"
-# define REG0 "%%xmm4"
-# define ROW2 "2*16(%0)"
-# define REG2 "%%xmm4"
-# define ROW4 "4*16(%0)"
-# define REG4 "%%xmm6"
-# define ROW6 "6*16(%0)"
-# define REG6 "%%xmm6"
-# define CLEAR_EVEN(r)
-# define PUT_EVEN(dst) \
-    "pshufhw  $0x1B, %%xmm2, %%xmm2   \n\t" \
-    "movdqa          %%xmm2, "dst"    \n\t"
-# define XMMS "%%xmm2"
-# define MOV_32_ONLY "movdqa "
-# define SREG2 "%%xmm7"
-# define TAN3 "%%xmm0"
-# define TAN1 "%%xmm2"
-
-#endif
-
-#define ROUND(x) "paddd   "MANGLE(x)
-
-#define JZ(reg, to)                         \
-    "testl     "reg","reg"            \n\t" \
-    "jz        "to"                   \n\t"
-
-#define JNZ(reg, to)                        \
-    "testl     "reg","reg"            \n\t" \
-    "jnz       "to"                   \n\t"
-
-#define TEST_ONE_ROW(src, reg, clear)       \
-    clear                                   \
-    "movq     "src", %%mm1            \n\t" \
-    "por    8+"src", %%mm1            \n\t" \
-    "paddusb  %%mm0, %%mm1            \n\t" \
-    "pmovmskb %%mm1, "reg"            \n\t"
-
-#define TEST_TWO_ROWS(row1, row2, reg1, reg2, clear1, clear2) \
-    clear1                                  \
-    clear2                                  \
-    "movq     "row1", %%mm1           \n\t" \
-    "por    8+"row1", %%mm1           \n\t" \
-    "movq     "row2", %%mm2           \n\t" \
-    "por    8+"row2", %%mm2           \n\t" \
-    "paddusb   %%mm0, %%mm1           \n\t" \
-    "paddusb   %%mm0, %%mm2           \n\t" \
-    "pmovmskb  %%mm1, "reg1"          \n\t" \
-    "pmovmskb  %%mm2, "reg2"          \n\t"
-
-///IDCT pass on rows.
-#define iMTX_MULT(src, table, rounder, put) \
-    "movdqa        "src", %%xmm3      \n\t" \
-    "movdqa       %%xmm3, %%xmm0      \n\t" \
-    "pshufd   $0x11, %%xmm3, %%xmm1   \n\t" /* 4602 */ \
-    "punpcklqdq   %%xmm0, %%xmm0      \n\t" /* 0246 */ \
-    "pmaddwd     "table", %%xmm0      \n\t" \
-    "pmaddwd  16+"table", %%xmm1      \n\t" \
-    "pshufd   $0xBB, %%xmm3, %%xmm2   \n\t" /* 5713 */ \
-    "punpckhqdq   %%xmm3, %%xmm3      \n\t" /* 1357 */ \
-    "pmaddwd  32+"table", %%xmm2      \n\t" \
-    "pmaddwd  48+"table", %%xmm3      \n\t" \
-    "paddd        %%xmm1, %%xmm0      \n\t" \
-    "paddd        %%xmm3, %%xmm2      \n\t" \
-    rounder",     %%xmm0              \n\t" \
-    "movdqa       %%xmm2, %%xmm3      \n\t" \
-    "paddd        %%xmm0, %%xmm2      \n\t" \
-    "psubd        %%xmm3, %%xmm0      \n\t" \
-    "psrad           $11, %%xmm2      \n\t" \
-    "psrad           $11, %%xmm0      \n\t" \
-    "packssdw     %%xmm0, %%xmm2      \n\t" \
-    put                                     \
-    "1:                               \n\t"
-
-#define iLLM_HEAD                           \
-    "movdqa   "MANGLE(tan3)", "TAN3"  \n\t" \
-    "movdqa   "MANGLE(tan1)", "TAN1"  \n\t" \
-
-///IDCT pass on columns.
-#define iLLM_PASS(dct)                      \
-    "movdqa   "TAN3", %%xmm1          \n\t" \
-    "movdqa   "TAN1", %%xmm3          \n\t" \
-    "pmulhw   %%xmm4, "TAN3"          \n\t" \
-    "pmulhw   %%xmm5, %%xmm1          \n\t" \
-    "paddsw   %%xmm4, "TAN3"          \n\t" \
-    "paddsw   %%xmm5, %%xmm1          \n\t" \
-    "psubsw   %%xmm5, "TAN3"          \n\t" \
-    "paddsw   %%xmm4, %%xmm1          \n\t" \
-    "pmulhw   %%xmm7, %%xmm3          \n\t" \
-    "pmulhw   %%xmm6, "TAN1"          \n\t" \
-    "paddsw   %%xmm6, %%xmm3          \n\t" \
-    "psubsw   %%xmm7, "TAN1"          \n\t" \
-    "movdqa   %%xmm3, %%xmm7          \n\t" \
-    "movdqa   "TAN1", %%xmm6          \n\t" \
-    "psubsw   %%xmm1, %%xmm3          \n\t" \
-    "psubsw   "TAN3", "TAN1"          \n\t" \
-    "paddsw   %%xmm7, %%xmm1          \n\t" \
-    "paddsw   %%xmm6, "TAN3"          \n\t" \
-    "movdqa   %%xmm3, %%xmm6          \n\t" \
-    "psubsw   "TAN3", %%xmm3          \n\t" \
-    "paddsw   %%xmm6, "TAN3"          \n\t" \
-    "movdqa   "MANGLE(sqrt2)", %%xmm4 \n\t" \
-    "pmulhw   %%xmm4, %%xmm3          \n\t" \
-    "pmulhw   %%xmm4, "TAN3"          \n\t" \
-    "paddsw   "TAN3", "TAN3"          \n\t" \
-    "paddsw   %%xmm3, %%xmm3          \n\t" \
-    "movdqa   "MANGLE(tan2)", %%xmm7  \n\t" \
-    MOV_32_ONLY ROW2", "REG2"         \n\t" \
-    MOV_32_ONLY ROW6", "REG6"         \n\t" \
-    "movdqa   %%xmm7, %%xmm5          \n\t" \
-    "pmulhw   "REG6", %%xmm7          \n\t" \
-    "pmulhw   "REG2", %%xmm5          \n\t" \
-    "paddsw   "REG2", %%xmm7          \n\t" \
-    "psubsw   "REG6", %%xmm5          \n\t" \
-    MOV_32_ONLY ROW0", "REG0"         \n\t" \
-    MOV_32_ONLY ROW4", "REG4"         \n\t" \
-    MOV_32_ONLY"  "TAN1", (%0)        \n\t" \
-    "movdqa   "REG0", "XMMS"          \n\t" \
-    "psubsw   "REG4", "REG0"          \n\t" \
-    "paddsw   "XMMS", "REG4"          \n\t" \
-    "movdqa   "REG4", "XMMS"          \n\t" \
-    "psubsw   %%xmm7, "REG4"          \n\t" \
-    "paddsw   "XMMS", %%xmm7          \n\t" \
-    "movdqa   "REG0", "XMMS"          \n\t" \
-    "psubsw   %%xmm5, "REG0"          \n\t" \
-    "paddsw   "XMMS", %%xmm5          \n\t" \
-    "movdqa   %%xmm5, "XMMS"          \n\t" \
-    "psubsw   "TAN3", %%xmm5          \n\t" \
-    "paddsw   "XMMS", "TAN3"          \n\t" \
-    "movdqa   "REG0", "XMMS"          \n\t" \
-    "psubsw   %%xmm3, "REG0"          \n\t" \
-    "paddsw   "XMMS", %%xmm3          \n\t" \
-    MOV_32_ONLY"  (%0), "TAN1"        \n\t" \
-    "psraw        $6, %%xmm5          \n\t" \
-    "psraw        $6, "REG0"          \n\t" \
-    "psraw        $6, "TAN3"          \n\t" \
-    "psraw        $6, %%xmm3          \n\t" \
-    "movdqa   "TAN3", 1*16("dct")     \n\t" \
-    "movdqa   %%xmm3, 2*16("dct")     \n\t" \
-    "movdqa   "REG0", 5*16("dct")     \n\t" \
-    "movdqa   %%xmm5, 6*16("dct")     \n\t" \
-    "movdqa   %%xmm7, %%xmm0          \n\t" \
-    "movdqa   "REG4", %%xmm4          \n\t" \
-    "psubsw   %%xmm1, %%xmm7          \n\t" \
-    "psubsw   "TAN1", "REG4"          \n\t" \
-    "paddsw   %%xmm0, %%xmm1          \n\t" \
-    "paddsw   %%xmm4, "TAN1"          \n\t" \
-    "psraw        $6, %%xmm1          \n\t" \
-    "psraw        $6, %%xmm7          \n\t" \
-    "psraw        $6, "TAN1"          \n\t" \
-    "psraw        $6, "REG4"          \n\t" \
-    "movdqa   %%xmm1, ("dct")         \n\t" \
-    "movdqa   "TAN1", 3*16("dct")     \n\t" \
-    "movdqa   "REG4", 4*16("dct")     \n\t" \
-    "movdqa   %%xmm7, 7*16("dct")     \n\t"
-
-///IDCT pass on columns, assuming rows 4-7 are zero.
-#define iLLM_PASS_SPARSE(dct)               \
-    "pmulhw   %%xmm4, "TAN3"          \n\t" \
-    "paddsw   %%xmm4, "TAN3"          \n\t" \
-    "movdqa   %%xmm6, %%xmm3          \n\t" \
-    "pmulhw   %%xmm6, "TAN1"          \n\t" \
-    "movdqa   %%xmm4, %%xmm1          \n\t" \
-    "psubsw   %%xmm1, %%xmm3          \n\t" \
-    "paddsw   %%xmm6, %%xmm1          \n\t" \
-    "movdqa   "TAN1", %%xmm6          \n\t" \
-    "psubsw   "TAN3", "TAN1"          \n\t" \
-    "paddsw   %%xmm6, "TAN3"          \n\t" \
-    "movdqa   %%xmm3, %%xmm6          \n\t" \
-    "psubsw   "TAN3", %%xmm3          \n\t" \
-    "paddsw   %%xmm6, "TAN3"          \n\t" \
-    "movdqa   "MANGLE(sqrt2)", %%xmm4 \n\t" \
-    "pmulhw   %%xmm4, %%xmm3          \n\t" \
-    "pmulhw   %%xmm4, "TAN3"          \n\t" \
-    "paddsw   "TAN3", "TAN3"          \n\t" \
-    "paddsw   %%xmm3, %%xmm3          \n\t" \
-    "movdqa   "MANGLE(tan2)", %%xmm5  \n\t" \
-    MOV_32_ONLY ROW2", "SREG2"        \n\t" \
-    "pmulhw   "SREG2", %%xmm5         \n\t" \
-    MOV_32_ONLY ROW0", "REG0"         \n\t" \
-    "movdqa   "REG0", %%xmm6          \n\t" \
-    "psubsw   "SREG2", %%xmm6         \n\t" \
-    "paddsw   "REG0", "SREG2"         \n\t" \
-    MOV_32_ONLY"  "TAN1", (%0)        \n\t" \
-    "movdqa   "REG0", "XMMS"          \n\t" \
-    "psubsw   %%xmm5, "REG0"          \n\t" \
-    "paddsw   "XMMS", %%xmm5          \n\t" \
-    "movdqa   %%xmm5, "XMMS"          \n\t" \
-    "psubsw   "TAN3", %%xmm5          \n\t" \
-    "paddsw   "XMMS", "TAN3"          \n\t" \
-    "movdqa   "REG0", "XMMS"          \n\t" \
-    "psubsw   %%xmm3, "REG0"          \n\t" \
-    "paddsw   "XMMS", %%xmm3          \n\t" \
-    MOV_32_ONLY"  (%0), "TAN1"        \n\t" \
-    "psraw        $6, %%xmm5          \n\t" \
-    "psraw        $6, "REG0"          \n\t" \
-    "psraw        $6, "TAN3"          \n\t" \
-    "psraw        $6, %%xmm3          \n\t" \
-    "movdqa   "TAN3", 1*16("dct")     \n\t" \
-    "movdqa   %%xmm3, 2*16("dct")     \n\t" \
-    "movdqa   "REG0", 5*16("dct")     \n\t" \
-    "movdqa   %%xmm5, 6*16("dct")     \n\t" \
-    "movdqa   "SREG2", %%xmm0         \n\t" \
-    "movdqa   %%xmm6, %%xmm4          \n\t" \
-    "psubsw   %%xmm1, "SREG2"         \n\t" \
-    "psubsw   "TAN1", %%xmm6          \n\t" \
-    "paddsw   %%xmm0, %%xmm1          \n\t" \
-    "paddsw   %%xmm4, "TAN1"          \n\t" \
-    "psraw        $6, %%xmm1          \n\t" \
-    "psraw        $6, "SREG2"         \n\t" \
-    "psraw        $6, "TAN1"          \n\t" \
-    "psraw        $6, %%xmm6          \n\t" \
-    "movdqa   %%xmm1, ("dct")         \n\t" \
-    "movdqa   "TAN1", 3*16("dct")     \n\t" \
-    "movdqa   %%xmm6, 4*16("dct")     \n\t" \
-    "movdqa   "SREG2", 7*16("dct")    \n\t"
-
-inline void ff_idct_xvid_sse2(short *block)
-{
-    __asm__ volatile(
-    "movq     "MANGLE(m127)", %%mm0                              \n\t"
-    iMTX_MULT("(%0)",     MANGLE(iTab1), ROUND(walkenIdctRounders),      PUT_EVEN(ROW0))
-    iMTX_MULT("1*16(%0)", MANGLE(iTab2), ROUND(walkenIdctRounders+1*16), PUT_ODD(ROW1))
-    iMTX_MULT("2*16(%0)", MANGLE(iTab3), ROUND(walkenIdctRounders+2*16), PUT_EVEN(ROW2))
-
-    TEST_TWO_ROWS("3*16(%0)", "4*16(%0)", "%%eax", "%%ecx", CLEAR_ODD(ROW3), CLEAR_EVEN(ROW4))
-    JZ("%%eax", "1f")
-    iMTX_MULT("3*16(%0)", MANGLE(iTab4), ROUND(walkenIdctRounders+3*16), PUT_ODD(ROW3))
-
-    TEST_TWO_ROWS("5*16(%0)", "6*16(%0)", "%%eax", "%%edx", CLEAR_ODD(ROW5), CLEAR_EVEN(ROW6))
-    TEST_ONE_ROW("7*16(%0)", "%%esi", CLEAR_ODD(ROW7))
-    iLLM_HEAD
-    ".p2align 4 \n\t"
-    JNZ("%%ecx", "2f")
-    JNZ("%%eax", "3f")
-    JNZ("%%edx", "4f")
-    JNZ("%%esi", "5f")
-    iLLM_PASS_SPARSE("%0")
-    "jmp 6f                                                      \n\t"
-    "2:                                                          \n\t"
-    iMTX_MULT("4*16(%0)", MANGLE(iTab1), "#", PUT_EVEN(ROW4))
-    "3:                                                          \n\t"
-    iMTX_MULT("5*16(%0)", MANGLE(iTab4), ROUND(walkenIdctRounders+4*16), PUT_ODD(ROW5))
-    JZ("%%edx", "1f")
-    "4:                                                          \n\t"
-    iMTX_MULT("6*16(%0)", MANGLE(iTab3), ROUND(walkenIdctRounders+5*16), PUT_EVEN(ROW6))
-    JZ("%%esi", "1f")
-    "5:                                                          \n\t"
-    iMTX_MULT("7*16(%0)", MANGLE(iTab2), ROUND(walkenIdctRounders+5*16), PUT_ODD(ROW7))
-#if ARCH_X86_32
-    iLLM_HEAD
-#endif
-    iLLM_PASS("%0")
-    "6:                                                          \n\t"
-    : "+r"(block)
-    :
-    : XMM_CLOBBERS("%xmm0" , "%xmm1" , "%xmm2" , "%xmm3" ,
-                   "%xmm4" , "%xmm5" , "%xmm6" , "%xmm7" ,)
-#if ARCH_X86_64
-      XMM_CLOBBERS("%xmm8" , "%xmm9" , "%xmm10", "%xmm11",
-                   "%xmm12", "%xmm13", "%xmm14",)
-#endif
-      "%eax", "%ecx", "%edx", "%esi", "memory"
-    );
-}
-
-void ff_idct_xvid_sse2_put(uint8_t *dest, int line_size, short *block)
-{
-    ff_idct_xvid_sse2(block);
-    ff_put_pixels_clamped_mmx(block, dest, line_size);
-}
-
-void ff_idct_xvid_sse2_add(uint8_t *dest, int line_size, short *block)
-{
-    ff_idct_xvid_sse2(block);
-    ff_add_pixels_clamped_mmx(block, dest, line_size);
-}
-
-#endif /* HAVE_SSE2_INLINE */
diff --git a/deps/libav/libavcodec/x86/idct_xvid.h b/deps/libav/libavcodec/x86/idct_xvid.h
deleted file mode 100644
index aea28ba..0000000
--- a/deps/libav/libavcodec/x86/idct_xvid.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * XVID MPEG-4 VIDEO CODEC
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * header for Xvid IDCT functions
- */
-
-#ifndef AVCODEC_X86_IDCT_XVID_H
-#define AVCODEC_X86_IDCT_XVID_H
-
-#include <stdint.h>
-
-void ff_idct_xvid_mmx(short *block);
-void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, int16_t *block);
-void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, int16_t *block);
-
-void ff_idct_xvid_mmxext(short *block);
-void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, int16_t *block);
-void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, int16_t *block);
-
-void ff_idct_xvid_sse2(short *block);
-void ff_idct_xvid_sse2_put(uint8_t *dest, int line_size, short *block);
-void ff_idct_xvid_sse2_add(uint8_t *dest, int line_size, short *block);
-
-#endif /* AVCODEC_X86_IDCT_XVID_H */
diff --git a/deps/libav/libavcodec/x86/imdct36.asm b/deps/libav/libavcodec/x86/imdct36.asm
deleted file mode 100644
index 633fcd9..0000000
--- a/deps/libav/libavcodec/x86/imdct36.asm
+++ /dev/null
@@ -1,720 +0,0 @@
-;******************************************************************************
-;* 36 point SSE-optimized IMDCT transform
-;* Copyright (c) 2011 Vitor Sessak
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-align 16
-ps_mask:  dd 0, ~0, ~0, ~0
-ps_mask2: dd 0, ~0,  0, ~0
-ps_mask3: dd 0,  0,  0, ~0
-ps_mask4: dd 0, ~0,  0,  0
-
-ps_val1:  dd          -0.5,          -0.5, -0.8660254038, -0.8660254038
-ps_val2:  dd           1.0,           1.0,  0.8660254038,  0.8660254038
-ps_val3:  dd  0.1736481777,  0.1736481777,  0.3420201433,  0.3420201433
-ps_val4:  dd -0.7660444431, -0.7660444431,  0.8660254038,  0.8660254038
-ps_val5:  dd -0.9396926208, -0.9396926208, -0.9848077530, -0.9848077530
-ps_val6:  dd           0.5,           0.5, -0.6427876097, -0.6427876097
-ps_val7:  dd           1.0,           1.0, -0.6427876097, -0.6427876097
-
-ps_p1p1m1m1: dd 0,          0, 0x80000000, 0x80000000
-ps_p1m1p1m1: dd 0, 0x80000000,          0, 0x80000000
-
-ps_cosh:       dd 1.0, 0.50190991877167369479,  1.0,  5.73685662283492756461
-               dd 1.0, 0.51763809020504152469,  1.0,  1.93185165257813657349
-               dd 1.0, 0.55168895948124587824, -1.0, -1.18310079157624925896
-               dd 1.0, 0.61038729438072803416, -1.0, -0.87172339781054900991
-               dd 1.0, 0.70710678118654752439,  0.0,  0.0
-
-ps_cosh_sse3:  dd 1.0, -0.50190991877167369479,  1.0, -5.73685662283492756461
-               dd 1.0, -0.51763809020504152469,  1.0, -1.93185165257813657349
-               dd 1.0, -0.55168895948124587824, -1.0,  1.18310079157624925896
-               dd 1.0, -0.61038729438072803416, -1.0,  0.87172339781054900991
-               dd 1.0,  0.70710678118654752439,  0.0,  0.0
-
-costabs:  times 4 dd  0.98480773
-          times 4 dd  0.93969262
-          times 4 dd  0.86602539
-          times 4 dd -0.76604444
-          times 4 dd -0.64278764
-          times 4 dd  0.50000000
-          times 4 dd -0.50000000
-          times 4 dd -0.34202015
-          times 4 dd -0.17364818
-          times 4 dd  0.50190992
-          times 4 dd  0.51763808
-          times 4 dd  0.55168896
-          times 4 dd  0.61038726
-          times 4 dd  0.70710677
-          times 4 dd  0.87172341
-          times 4 dd  1.18310082
-          times 4 dd  1.93185163
-          times 4 dd  5.73685646
-
-%define SBLIMIT 32
-SECTION_TEXT
-
-%macro PSHUFD 3
-%if cpuflag(sse2) && notcpuflag(avx)
-    pshufd %1, %2, %3
-%else
-    shufps %1, %2, %2, %3
-%endif
-%endmacro
-
-; input  %2={x1,x2,x3,x4}, %3={y1,y2,y3,y4}
-; output %1={x3,x4,y1,y2}
-%macro BUILDINVHIGHLOW 3
-%if cpuflag(avx)
-    shufps %1, %2, %3, 0x4e
-%else
-    movlhps %1, %3
-    movhlps %1, %2
-%endif
-%endmacro
-
-; input  %2={x1,x2,x3,x4}, %3={y1,y2,y3,y4}
-; output %1={x4,y1,y2,y3}
-%macro ROTLEFT 3
-%if cpuflag(ssse3)
-    palignr  %1, %3, %2, 12
-%else
-    BUILDINVHIGHLOW %1, %2, %3
-    shufps  %1, %1, %3, 0x99
-%endif
-%endmacro
-
-%macro INVERTHL 2
-%if cpuflag(sse2)
-    PSHUFD  %1, %2, 0x4e
-%else
-    movhlps %1, %2
-    movlhps %1, %2
-%endif
-%endmacro
-
-%macro BUTTERF 3
-    INVERTHL %2, %1
-    xorps    %1, [ps_p1p1m1m1]
-    addps    %1, %2
-%if cpuflag(sse3)
-    mulps    %1, %1, [ps_cosh_sse3 + %3]
-    PSHUFD   %2, %1, 0xb1
-    addsubps %1, %1, %2
-%else
-    mulps    %1, [ps_cosh + %3]
-    PSHUFD   %2, %1, 0xb1
-    xorps    %1, [ps_p1m1p1m1]
-    addps    %1, %2
-%endif
-%endmacro
-
-%macro STORE 4
-    movhlps %2, %1
-    movss   [%3       ], %1
-    movss   [%3 + 2*%4], %2
-    shufps  %1, %1, 0xb1
-    movss   [%3 +   %4], %1
-    movhlps %2, %1
-    movss   [%3 + 3*%4], %2
-%endmacro
-
-%macro LOAD 4
-    movlps  %1, [%3       ]
-    movhps  %1, [%3 +   %4]
-    movlps  %2, [%3 + 2*%4]
-    movhps  %2, [%3 + 3*%4]
-    shufps  %1, %2, 0x88
-%endmacro
-
-%macro LOADA64 2
-%if cpuflag(avx)
-   movu     %1, [%2]
-%else
-   movlps   %1, [%2]
-   movhps   %1, [%2 + 8]
-%endif
-%endmacro
-
-%macro DEFINE_IMDCT 0
-cglobal imdct36_float, 4,4,9, out, buf, in, win
-
-    ; for(i=17;i>=1;i--) in[i] += in[i-1];
-    LOADA64 m0, inq
-    LOADA64 m1, inq + 16
-
-    ROTLEFT m5, m0, m1
-
-    PSHUFD  m6, m0, 0x93
-    andps   m6, m6, [ps_mask]
-    addps   m0, m0, m6
-
-    LOADA64 m2, inq + 32
-
-    ROTLEFT m7, m1, m2
-
-    addps   m1, m1, m5
-    LOADA64 m3, inq + 48
-
-    ROTLEFT m5, m2, m3
-
-    xorps   m4, m4, m4
-    movlps  m4, [inq+64]
-    BUILDINVHIGHLOW m6, m3, m4
-    shufps  m6, m6, m4, 0xa9
-
-    addps   m4, m4, m6
-    addps   m2, m2, m7
-    addps   m3, m3, m5
-
-    ; for(i=17;i>=3;i-=2) in[i] += in[i-2];
-    movlhps m5, m5, m0
-    andps   m5, m5, [ps_mask3]
-
-    BUILDINVHIGHLOW m7, m0, m1
-    andps   m7, m7, [ps_mask2]
-
-    addps   m0, m0, m5
-
-    BUILDINVHIGHLOW m6, m1, m2
-    andps   m6, m6, [ps_mask2]
-
-    addps  m1, m1, m7
-
-    BUILDINVHIGHLOW m7, m2, m3
-    andps   m7, m7, [ps_mask2]
-
-    addps   m2, m2, m6
-
-    movhlps m6, m6, m3
-    andps   m6, m6, [ps_mask4]
-
-    addps  m3, m3, m7
-    addps  m4, m4, m6
-
-    ; Populate tmp[]
-    movlhps m6, m1, m5    ; zero out high values
-    subps   m6, m6, m4
-
-    subps  m5, m0, m3
-
-%if ARCH_X86_64
-    SWAP   m5, m8
-%endif
-
-    mulps  m7, m2, [ps_val1]
-
-%if ARCH_X86_64
-    mulps  m5, m8, [ps_val2]
-%else
-    mulps  m5, m5, [ps_val2]
-%endif
-    addps  m7, m7, m5
-
-    mulps  m5, m6, [ps_val1]
-    subps  m7, m7, m5
-
-%if ARCH_X86_64
-    SWAP   m5, m8
-%else
-    subps  m5, m0, m3
-%endif
-
-    subps  m5, m5, m6
-    addps  m5, m5, m2
-
-    shufps m6, m4, m3, 0xe4
-    subps  m6, m6, m2
-    mulps  m6, m6, [ps_val3]
-
-    addps  m4, m4, m1
-    mulps  m4, m4, [ps_val4]
-
-    shufps m1, m1, m0, 0xe4
-    addps  m1, m1, m2
-    mulps  m1, m1, [ps_val5]
-
-    mulps  m3, m3, [ps_val6]
-    mulps  m0, m0, [ps_val7]
-    addps  m0, m0, m3
-
-    xorps  m2, m1, [ps_p1p1m1m1]
-    subps  m2, m2, m4
-    addps  m2, m2, m0
-
-    addps  m3, m4, m0
-    subps  m3, m3, m6
-    xorps  m3, m3, [ps_p1p1m1m1]
-
-    shufps m0, m0, m4, 0xe4
-    subps  m0, m0, m1
-    addps  m0, m0, m6
-
-    BUILDINVHIGHLOW m4, m2, m3
-    shufps  m3, m3, m2, 0x4e
-
-    ; we have tmp = {SwAPLH(m0), SwAPLH(m7), m3, m4, m5}
-
-    BUTTERF  m0, m1, 0
-    BUTTERF  m7, m2, 16
-    BUTTERF  m3, m6, 32
-    BUTTERF  m4, m1, 48
-
-    mulps   m5, m5, [ps_cosh + 64]
-    PSHUFD  m1, m5, 0xe1
-    xorps   m5, m5, [ps_p1m1p1m1]
-    addps   m5, m5, m1
-
-    ; permutates:
-    ; m0    0  1  2  3     =>     2  6 10 14   m1
-    ; m7    4  5  6  7     =>     3  7 11 15   m2
-    ; m3    8  9 10 11     =>    17 13  9  5   m3
-    ; m4   12 13 14 15     =>    16 12  8  4   m5
-    ; m5   16 17 xx xx     =>     0  1 xx xx   m0
-
-    unpckhps m1, m0, m7
-    unpckhps m6, m3, m4
-    movhlps  m2, m6, m1
-    movlhps  m1, m1, m6
-
-    unpcklps m5, m5, m4
-    unpcklps m3, m3, m7
-    movhlps  m4, m3, m5
-    movlhps  m5, m5, m3
-    SWAP m4, m3
-    ; permutation done
-
-    PSHUFD  m6, m2, 0xb1
-    movss   m4, [bufq + 4*68]
-    movss   m7, [bufq + 4*64]
-    unpcklps  m7, m7, m4
-    mulps   m6, m6, [winq + 16*4]
-    addps   m6, m6, m7
-    movss   [outq + 64*SBLIMIT], m6
-    shufps  m6, m6, m6, 0xb1
-    movss   [outq + 68*SBLIMIT], m6
-
-    mulps   m6, m3, [winq + 4*4]
-    LOAD    m4, m7, bufq + 4*16, 16
-    addps   m6, m6, m4
-    STORE   m6, m7, outq + 16*SBLIMIT, 4*SBLIMIT
-
-    shufps  m4, m0, m3, 0xb5
-    mulps   m4, m4, [winq + 8*4]
-    LOAD    m7, m6, bufq + 4*32, 16
-    addps   m4, m4, m7
-    STORE   m4, m6, outq + 32*SBLIMIT, 4*SBLIMIT
-
-    shufps  m3, m3, m2, 0xb1
-    mulps   m3, m3, [winq + 12*4]
-    LOAD    m7, m6, bufq + 4*48, 16
-    addps   m3, m3, m7
-    STORE   m3, m7, outq + 48*SBLIMIT, 4*SBLIMIT
-
-    mulps   m2, m2, [winq]
-    LOAD    m6, m7, bufq, 16
-    addps   m2, m2, m6
-    STORE   m2, m7, outq, 4*SBLIMIT
-
-    mulps    m4, m1, [winq + 20*4]
-    STORE    m4, m7, bufq, 16
-
-    mulps    m3, m5, [winq + 24*4]
-    STORE    m3, m7, bufq + 4*16, 16
-
-    shufps   m0, m0, m5, 0xb0
-    mulps    m0, m0, [winq + 28*4]
-    STORE    m0, m7, bufq + 4*32, 16
-
-    shufps   m5, m5, m1, 0xb1
-    mulps    m5, m5, [winq + 32*4]
-    STORE    m5, m7, bufq + 4*48, 16
-
-    shufps   m1, m1, m1, 0xb1
-    mulps    m1, m1, [winq + 36*4]
-    movss    [bufq + 4*64], m1
-    shufps   m1, m1, 0xb1
-    movss    [bufq + 4*68], m1
-    RET
-%endmacro
-
-INIT_XMM sse
-DEFINE_IMDCT
-
-INIT_XMM sse2
-DEFINE_IMDCT
-
-INIT_XMM sse3
-DEFINE_IMDCT
-
-INIT_XMM ssse3
-DEFINE_IMDCT
-
-INIT_XMM avx
-DEFINE_IMDCT
-
-INIT_XMM sse
-
-%if ARCH_X86_64
-%define SPILL SWAP
-%define UNSPILL SWAP
-%define SPILLED(x) m %+ x
-%else
-%define SPILLED(x) [tmpq+(x-8)*16 + 32*4]
-%macro SPILL 2 ; xmm#, mempos
-    movaps SPILLED(%2), m%1
-%endmacro
-%macro UNSPILL 2
-    movaps m%1, SPILLED(%2)
-%endmacro
-%endif
-
-%macro DEFINE_FOUR_IMDCT 0
-cglobal four_imdct36_float, 5,5,16, out, buf, in, win, tmp
-    movlps  m0, [inq+64]
-    movhps  m0, [inq+64 +   72]
-    movlps  m3, [inq+64 + 2*72]
-    movhps  m3, [inq+64 + 3*72]
-
-    shufps  m5, m0, m3, 0xdd
-    shufps  m0, m0, m3, 0x88
-
-    mova     m1, [inq+48]
-    movu     m6, [inq+48 +   72]
-    mova     m7, [inq+48 + 2*72]
-    movu     m3, [inq+48 + 3*72]
-
-    TRANSPOSE4x4PS 1, 6, 7, 3, 4
-
-    addps   m4, m6, m7
-    mova    [tmpq+4*28], m4
-
-    addps    m7, m3
-    addps    m6, m1
-    addps    m3, m0
-    addps    m0, m5
-    addps    m0, m7
-    addps    m7, m6
-    mova    [tmpq+4*12], m7
-    SPILL   3, 12
-
-    mova     m4, [inq+32]
-    movu     m5, [inq+32 +   72]
-    mova     m2, [inq+32 + 2*72]
-    movu     m7, [inq+32 + 3*72]
-
-    TRANSPOSE4x4PS 4, 5, 2, 7, 3
-
-    addps   m1, m7
-    SPILL   1, 11
-
-    addps   m3, m5, m2
-    SPILL   3, 13
-
-    addps    m7, m2
-    addps    m5, m4
-    addps    m6, m7
-    mova    [tmpq], m6
-    addps   m7, m5
-    mova    [tmpq+4*16], m7
-
-    mova    m2, [inq+16]
-    movu    m7, [inq+16 +   72]
-    mova    m1, [inq+16 + 2*72]
-    movu    m6, [inq+16 + 3*72]
-
-    TRANSPOSE4x4PS 2, 7, 1, 6, 3
-
-    addps   m4, m6
-    addps   m6, m1
-    addps   m1, m7
-    addps   m7, m2
-    addps   m5, m6
-    SPILL   5, 15
-    addps   m6, m7
-    mulps   m6, [costabs + 16*2]
-    mova    [tmpq+4*8], m6
-    SPILL   1, 10
-    SPILL   0, 14
-
-    mova    m1, [inq]
-    movu    m6, [inq +   72]
-    mova    m3, [inq + 2*72]
-    movu    m5, [inq + 3*72]
-
-    TRANSPOSE4x4PS 1, 6, 3, 5, 0
-
-    addps    m2, m5
-    addps    m5, m3
-    addps    m7, m5
-    addps    m3, m6
-    addps    m6, m1
-    SPILL    7, 8
-    addps    m5, m6
-    SPILL    6, 9
-    addps    m6, m4, SPILLED(12)
-    subps    m6, m2
-    UNSPILL  7, 11
-    SPILL    5, 11
-    subps    m5, m1, m7
-    mulps    m7, [costabs + 16*5]
-    addps    m7, m1
-    mulps    m0, m6, [costabs + 16*6]
-    addps    m0, m5
-    mova     [tmpq+4*24], m0
-    addps    m6, m5
-    mova     [tmpq+4*4], m6
-    addps    m6, m4, m2
-    mulps    m6, [costabs + 16*1]
-    subps    m4, SPILLED(12)
-    mulps    m4, [costabs + 16*8]
-    addps    m2, SPILLED(12)
-    mulps    m2, [costabs + 16*3]
-    subps    m5, m7, m6
-    subps    m5, m2
-    addps    m6, m7
-    addps    m6, m4
-    addps    m7, m2
-    subps    m7, m4
-    mova     [tmpq+4*20], m7
-    mova     m2, [tmpq+4*28]
-    mova     [tmpq+4*28], m5
-    UNSPILL  7, 13
-    subps    m5, m7, m2
-    mulps    m5, [costabs + 16*7]
-    UNSPILL  1, 10
-    mulps    m1, [costabs + 16*2]
-    addps    m4, m3, m2
-    mulps    m4, [costabs + 16*4]
-    addps    m2, m7
-    addps    m7, m3
-    mulps    m7, [costabs]
-    subps    m3, m2
-    mulps    m3, [costabs + 16*2]
-    addps    m2, m7, m5
-    addps    m2, m1
-    SPILL    2, 10
-    addps    m7, m4
-    subps    m7, m1
-    SPILL    7, 12
-    subps    m5, m4
-    subps    m5, m1
-    UNSPILL  0, 14
-    SPILL    5, 13
-    addps    m1, m0, SPILLED(15)
-    subps    m1, SPILLED(8)
-    mova     m4, [costabs + 16*5]
-    mulps    m4, [tmpq]
-    UNSPILL  2, 9
-    addps    m4, m2
-    subps    m2, [tmpq]
-    mulps    m5, m1, [costabs + 16*6]
-    addps    m5, m2
-    SPILL    5, 9
-    addps    m2, m1
-    SPILL    2, 14
-    UNSPILL  5, 15
-    subps    m7, m5, m0
-    addps    m5, SPILLED(8)
-    mulps    m5, [costabs + 16*1]
-    mulps    m7, [costabs + 16*8]
-    addps    m0, SPILLED(8)
-    mulps    m0, [costabs + 16*3]
-    subps    m2, m4, m5
-    subps    m2, m0
-    SPILL    2, 15
-    addps    m5, m4
-    addps    m5, m7
-    addps    m4, m0
-    subps    m4, m7
-    SPILL    4, 8
-    mova     m7, [tmpq+4*16]
-    mova     m2, [tmpq+4*12]
-    addps    m0, m7, m2
-    subps    m0, SPILLED(11)
-    mulps    m0, [costabs + 16*2]
-    addps    m4, m7, SPILLED(11)
-    mulps    m4, [costabs]
-    subps    m7, m2
-    mulps    m7, [costabs + 16*7]
-    addps    m2, SPILLED(11)
-    mulps    m2, [costabs + 16*4]
-    addps    m1, m7, [tmpq+4*8]
-    addps    m1, m4
-    addps    m4, m2
-    subps    m4, [tmpq+4*8]
-    SPILL    4, 11
-    subps    m7, m2
-    subps    m7, [tmpq+4*8]
-    addps    m4, m6, SPILLED(10)
-    subps    m6, SPILLED(10)
-    addps    m2, m5, m1
-    mulps    m2, [costabs + 16*9]
-    subps    m5, m1
-    mulps    m5, [costabs + 16*17]
-    subps    m1, m4, m2
-    addps    m4, m2
-    mulps    m2, m1, [winq+4*36]
-    addps    m2, [bufq+4*36]
-    mova     [outq+1152], m2
-    mulps    m1, [winq+4*32]
-    addps    m1, [bufq+4*32]
-    mova     [outq+1024], m1
-    mulps    m1, m4, [winq+4*116]
-    mova     [bufq+4*36], m1
-    mulps    m4, [winq+4*112]
-    mova     [bufq+4*32], m4
-    addps    m2, m6, m5
-    subps    m6, m5
-    mulps    m1, m6, [winq+4*68]
-    addps    m1, [bufq+4*68]
-    mova     [outq+2176], m1
-    mulps    m6, [winq]
-    addps    m6, [bufq]
-    mova     [outq], m6
-    mulps    m1, m2, [winq+4*148]
-    mova     [bufq+4*68], m1
-    mulps    m2, [winq+4*80]
-    mova     [bufq], m2
-    addps    m5, m3, [tmpq+4*24]
-    mova     m2, [tmpq+4*24]
-    subps    m2, m3
-    mova     m1, SPILLED(9)
-    subps    m1, m0
-    mulps    m1, [costabs + 16*10]
-    addps    m0, SPILLED(9)
-    mulps    m0, [costabs + 16*16]
-    addps    m6, m5, m1
-    subps    m5, m1
-    mulps    m3, m5, [winq+4*40]
-    addps    m3, [bufq+4*40]
-    mova     [outq+1280], m3
-    mulps    m5, [winq+4*28]
-    addps    m5, [bufq+4*28]
-    mova     [outq+896], m5
-    mulps    m1, m6, [winq+4*120]
-    mova     [bufq+4*40], m1
-    mulps    m6, [winq+4*108]
-    mova     [bufq+4*28], m6
-    addps    m1, m2, m0
-    subps    m2, m0
-    mulps    m5, m2, [winq+4*64]
-    addps    m5, [bufq+4*64]
-    mova     [outq+2048], m5
-    mulps    m2, [winq+4*4]
-    addps    m2, [bufq+4*4]
-    mova     [outq+128], m2
-    mulps    m0, m1, [winq+4*144]
-    mova     [bufq+4*64], m0
-    mulps    m1, [winq+4*84]
-    mova     [bufq+4*4], m1
-    mova     m1, [tmpq+4*28]
-    mova     m5, m1
-    addps    m1, SPILLED(13)
-    subps    m5, SPILLED(13)
-    UNSPILL  3, 15
-    addps    m2, m7, m3
-    mulps    m2, [costabs + 16*11]
-    subps    m3, m7
-    mulps    m3, [costabs + 16*15]
-    addps    m0, m2, m1
-    subps    m1, m2
-    SWAP     m0, m2
-    mulps    m6, m1, [winq+4*44]
-    addps    m6, [bufq+4*44]
-    mova     [outq+1408], m6
-    mulps    m1, [winq+4*24]
-    addps    m1, [bufq+4*24]
-    mova     [outq+768], m1
-    mulps    m0, m2, [winq+4*124]
-    mova     [bufq+4*44], m0
-    mulps    m2, [winq+4*104]
-    mova     [bufq+4*24], m2
-    addps    m0, m5, m3
-    subps    m5, m3
-    mulps    m1, m5, [winq+4*60]
-    addps    m1, [bufq+4*60]
-    mova     [outq+1920], m1
-    mulps    m5, [winq+4*8]
-    addps    m5, [bufq+4*8]
-    mova     [outq+256], m5
-    mulps    m1, m0, [winq+4*140]
-    mova     [bufq+4*60], m1
-    mulps    m0, [winq+4*88]
-    mova     [bufq+4*8], m0
-    mova     m1, [tmpq+4*20]
-    addps    m1, SPILLED(12)
-    mova     m2, [tmpq+4*20]
-    subps    m2, SPILLED(12)
-    UNSPILL  7, 8
-    subps    m0, m7, SPILLED(11)
-    addps    m7, SPILLED(11)
-    mulps    m4, m7, [costabs + 16*12]
-    mulps    m0, [costabs + 16*14]
-    addps    m5, m1, m4
-    subps    m1, m4
-    mulps    m7, m1, [winq+4*48]
-    addps    m7, [bufq+4*48]
-    mova     [outq+1536], m7
-    mulps    m1, [winq+4*20]
-    addps    m1, [bufq+4*20]
-    mova     [outq+640], m1
-    mulps    m1, m5, [winq+4*128]
-    mova     [bufq+4*48], m1
-    mulps    m5, [winq+4*100]
-    mova     [bufq+4*20], m5
-    addps    m6, m2, m0
-    subps    m2, m0
-    mulps    m1, m2, [winq+4*56]
-    addps    m1, [bufq+4*56]
-    mova     [outq+1792], m1
-    mulps    m2, [winq+4*12]
-    addps    m2, [bufq+4*12]
-    mova     [outq+384], m2
-    mulps    m0, m6, [winq+4*136]
-    mova    [bufq+4*56], m0
-    mulps    m6, [winq+4*92]
-    mova     [bufq+4*12], m6
-    UNSPILL  0, 14
-    mulps    m0, [costabs + 16*13]
-    mova     m3, [tmpq+4*4]
-    addps    m2, m0, m3
-    subps    m3, m0
-    mulps    m0, m3, [winq+4*52]
-    addps    m0, [bufq+4*52]
-    mova     [outq+1664], m0
-    mulps    m3, [winq+4*16]
-    addps    m3, [bufq+4*16]
-    mova     [outq+512], m3
-    mulps    m0, m2, [winq+4*132]
-    mova     [bufq+4*52], m0
-    mulps    m2, [winq+4*96]
-    mova     [bufq+4*16], m2
-    RET
-%endmacro
-
-INIT_XMM sse
-DEFINE_FOUR_IMDCT
-
-INIT_XMM avx
-DEFINE_FOUR_IMDCT
diff --git a/deps/libav/libavcodec/x86/lpc.c b/deps/libav/libavcodec/x86/lpc.c
deleted file mode 100644
index 12245c4..0000000
--- a/deps/libav/libavcodec/x86/lpc.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * MMX optimized LPC DSP utils
- * Copyright (c) 2007 Loren Merritt
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/lpc.h"
-
-DECLARE_ASM_CONST(16, double, pd_1)[2] = { 1.0, 1.0 };
-DECLARE_ASM_CONST(16, double, pd_2)[2] = { 2.0, 2.0 };
-
-#if HAVE_SSE2_INLINE
-
-static void lpc_apply_welch_window_sse2(const int32_t *data, int len,
-                                        double *w_data)
-{
-    double c = 2.0 / (len-1.0);
-    int n2 = len>>1;
-    x86_reg i = -n2*sizeof(int32_t);
-    x86_reg j =  n2*sizeof(int32_t);
-    __asm__ volatile(
-        "movsd   %4,     %%xmm7                \n\t"
-        "movapd  "MANGLE(pd_1)", %%xmm6        \n\t"
-        "movapd  "MANGLE(pd_2)", %%xmm5        \n\t"
-        "movlhps %%xmm7, %%xmm7                \n\t"
-        "subpd   %%xmm5, %%xmm7                \n\t"
-        "addsd   %%xmm6, %%xmm7                \n\t"
-        "test    $1,     %5                    \n\t"
-        "jz      2f                            \n\t"
-#define WELCH(MOVPD, offset)\
-        "1:                                    \n\t"\
-        "movapd   %%xmm7,  %%xmm1              \n\t"\
-        "mulpd    %%xmm1,  %%xmm1              \n\t"\
-        "movapd   %%xmm6,  %%xmm0              \n\t"\
-        "subpd    %%xmm1,  %%xmm0              \n\t"\
-        "pshufd   $0x4e,   %%xmm0, %%xmm1      \n\t"\
-        "cvtpi2pd (%3,%0), %%xmm2              \n\t"\
-        "cvtpi2pd "#offset"*4(%3,%1), %%xmm3   \n\t"\
-        "mulpd    %%xmm0,  %%xmm2              \n\t"\
-        "mulpd    %%xmm1,  %%xmm3              \n\t"\
-        "movapd   %%xmm2, (%2,%0,2)            \n\t"\
-        MOVPD"    %%xmm3, "#offset"*8(%2,%1,2) \n\t"\
-        "subpd    %%xmm5,  %%xmm7              \n\t"\
-        "sub      $8,      %1                  \n\t"\
-        "add      $8,      %0                  \n\t"\
-        "jl 1b                                 \n\t"\
-
-        WELCH("movupd", -1)
-        "jmp 3f                                \n\t"
-        "2:                                    \n\t"
-        WELCH("movapd", -2)
-        "3:                                    \n\t"
-        :"+&r"(i), "+&r"(j)
-        :"r"(w_data+n2), "r"(data+n2), "m"(c), "r"(len)
-         XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
-                                    "%xmm5", "%xmm6", "%xmm7")
-    );
-#undef WELCH
-}
-
-static void lpc_compute_autocorr_sse2(const double *data, int len, int lag,
-                                      double *autoc)
-{
-    int j;
-
-    if((x86_reg)data & 15)
-        data++;
-
-    for(j=0; j<lag; j+=2){
-        x86_reg i = -len*sizeof(double);
-        if(j == lag-2) {
-            __asm__ volatile(
-                "movsd    "MANGLE(pd_1)", %%xmm0    \n\t"
-                "movsd    "MANGLE(pd_1)", %%xmm1    \n\t"
-                "movsd    "MANGLE(pd_1)", %%xmm2    \n\t"
-                "1:                                 \n\t"
-                "movapd   (%2,%0), %%xmm3           \n\t"
-                "movupd -8(%3,%0), %%xmm4           \n\t"
-                "movapd   (%3,%0), %%xmm5           \n\t"
-                "mulpd     %%xmm3, %%xmm4           \n\t"
-                "mulpd     %%xmm3, %%xmm5           \n\t"
-                "mulpd -16(%3,%0), %%xmm3           \n\t"
-                "addpd     %%xmm4, %%xmm1           \n\t"
-                "addpd     %%xmm5, %%xmm0           \n\t"
-                "addpd     %%xmm3, %%xmm2           \n\t"
-                "add       $16,    %0               \n\t"
-                "jl 1b                              \n\t"
-                "movhlps   %%xmm0, %%xmm3           \n\t"
-                "movhlps   %%xmm1, %%xmm4           \n\t"
-                "movhlps   %%xmm2, %%xmm5           \n\t"
-                "addsd     %%xmm3, %%xmm0           \n\t"
-                "addsd     %%xmm4, %%xmm1           \n\t"
-                "addsd     %%xmm5, %%xmm2           \n\t"
-                "movsd     %%xmm0,   (%1)           \n\t"
-                "movsd     %%xmm1,  8(%1)           \n\t"
-                "movsd     %%xmm2, 16(%1)           \n\t"
-                :"+&r"(i)
-                :"r"(autoc+j), "r"(data+len), "r"(data+len-j)
-                :"memory"
-            );
-        } else {
-            __asm__ volatile(
-                "movsd    "MANGLE(pd_1)", %%xmm0    \n\t"
-                "movsd    "MANGLE(pd_1)", %%xmm1    \n\t"
-                "1:                                 \n\t"
-                "movapd   (%3,%0), %%xmm3           \n\t"
-                "movupd -8(%4,%0), %%xmm4           \n\t"
-                "mulpd     %%xmm3, %%xmm4           \n\t"
-                "mulpd    (%4,%0), %%xmm3           \n\t"
-                "addpd     %%xmm4, %%xmm1           \n\t"
-                "addpd     %%xmm3, %%xmm0           \n\t"
-                "add       $16,    %0               \n\t"
-                "jl 1b                              \n\t"
-                "movhlps   %%xmm0, %%xmm3           \n\t"
-                "movhlps   %%xmm1, %%xmm4           \n\t"
-                "addsd     %%xmm3, %%xmm0           \n\t"
-                "addsd     %%xmm4, %%xmm1           \n\t"
-                "movsd     %%xmm0, %1               \n\t"
-                "movsd     %%xmm1, %2               \n\t"
-                :"+&r"(i), "=m"(autoc[j]), "=m"(autoc[j+1])
-                :"r"(data+len), "r"(data+len-j)
-            );
-        }
-    }
-}
-
-#endif /* HAVE_SSE2_INLINE */
-
-av_cold void ff_lpc_init_x86(LPCContext *c)
-{
-#if HAVE_SSE2_INLINE
-    int cpu_flags = av_get_cpu_flags();
-
-    if (INLINE_SSE2(cpu_flags) && (cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
-        c->lpc_apply_welch_window = lpc_apply_welch_window_sse2;
-        c->lpc_compute_autocorr   = lpc_compute_autocorr_sse2;
-    }
-#endif /* HAVE_SSE2_INLINE */
-}
diff --git a/deps/libav/libavcodec/x86/mathops.h b/deps/libav/libavcodec/x86/mathops.h
deleted file mode 100644
index a62094e..0000000
--- a/deps/libav/libavcodec/x86/mathops.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * simple math operations
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at> et al
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_X86_MATHOPS_H
-#define AVCODEC_X86_MATHOPS_H
-
-#include "config.h"
-#include "libavutil/common.h"
-
-#if HAVE_INLINE_ASM
-
-#if ARCH_X86_32
-
-#define MULL MULL
-static av_always_inline av_const int MULL(int a, int b, unsigned shift)
-{
-    int rt, dummy;
-    __asm__ (
-        "imull %3               \n\t"
-        "shrdl %4, %%edx, %%eax \n\t"
-        :"=a"(rt), "=d"(dummy)
-        :"a"(a), "rm"(b), "ci"((uint8_t)shift)
-    );
-    return rt;
-}
-
-#define MULH MULH
-static av_always_inline av_const int MULH(int a, int b)
-{
-    int rt, dummy;
-    __asm__ (
-        "imull %3"
-        :"=d"(rt), "=a"(dummy)
-        :"a"(a), "rm"(b)
-    );
-    return rt;
-}
-
-#define MUL64 MUL64
-static av_always_inline av_const int64_t MUL64(int a, int b)
-{
-    int64_t rt;
-    __asm__ (
-        "imull %2"
-        :"=A"(rt)
-        :"a"(a), "rm"(b)
-    );
-    return rt;
-}
-
-#endif /* ARCH_X86_32 */
-
-#if HAVE_I686
-/* median of 3 */
-#define mid_pred mid_pred
-static inline av_const int mid_pred(int a, int b, int c)
-{
-    int i=b;
-    __asm__ (
-        "cmp    %2, %1 \n\t"
-        "cmovg  %1, %0 \n\t"
-        "cmovg  %2, %1 \n\t"
-        "cmp    %3, %1 \n\t"
-        "cmovl  %3, %1 \n\t"
-        "cmp    %1, %0 \n\t"
-        "cmovg  %1, %0 \n\t"
-        :"+&r"(i), "+&r"(a)
-        :"r"(b), "r"(c)
-    );
-    return i;
-}
-
-#define COPY3_IF_LT(x, y, a, b, c, d)\
-__asm__ volatile(\
-    "cmpl  %0, %3       \n\t"\
-    "cmovl %3, %0       \n\t"\
-    "cmovl %4, %1       \n\t"\
-    "cmovl %5, %2       \n\t"\
-    : "+&r" (x), "+&r" (a), "+r" (c)\
-    : "r" (y), "r" (b), "r" (d)\
-);
-#endif /* HAVE_I686 */
-
-#define MASK_ABS(mask, level)                   \
-    __asm__ ("cltd                   \n\t"      \
-             "xorl %1, %0            \n\t"      \
-             "subl %1, %0            \n\t"      \
-             : "+a"(level), "=&d"(mask))
-
-// avoid +32 for shift optimization (gcc should do that ...)
-#define NEG_SSR32 NEG_SSR32
-static inline  int32_t NEG_SSR32( int32_t a, int8_t s){
-    __asm__ ("sarl %1, %0\n\t"
-         : "+r" (a)
-         : "ic" ((uint8_t)(-s))
-    );
-    return a;
-}
-
-#define NEG_USR32 NEG_USR32
-static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
-    __asm__ ("shrl %1, %0\n\t"
-         : "+r" (a)
-         : "ic" ((uint8_t)(-s))
-    );
-    return a;
-}
-
-#endif /* HAVE_INLINE_ASM */
-#endif /* AVCODEC_X86_MATHOPS_H */
diff --git a/deps/libav/libavcodec/x86/mlpdsp.c b/deps/libav/libavcodec/x86/mlpdsp.c
deleted file mode 100644
index 72fc637..0000000
--- a/deps/libav/libavcodec/x86/mlpdsp.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * MLP DSP functions x86-optimized
- * Copyright (c) 2009 Ramiro Polla
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/internal.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/mlpdsp.h"
-#include "libavcodec/mlp.h"
-
-#if HAVE_7REGS && HAVE_INLINE_ASM
-
-extern char ff_mlp_firorder_8;
-extern char ff_mlp_firorder_7;
-extern char ff_mlp_firorder_6;
-extern char ff_mlp_firorder_5;
-extern char ff_mlp_firorder_4;
-extern char ff_mlp_firorder_3;
-extern char ff_mlp_firorder_2;
-extern char ff_mlp_firorder_1;
-extern char ff_mlp_firorder_0;
-
-extern char ff_mlp_iirorder_4;
-extern char ff_mlp_iirorder_3;
-extern char ff_mlp_iirorder_2;
-extern char ff_mlp_iirorder_1;
-extern char ff_mlp_iirorder_0;
-
-static const void *firtable[9] = { &ff_mlp_firorder_0, &ff_mlp_firorder_1,
-                                   &ff_mlp_firorder_2, &ff_mlp_firorder_3,
-                                   &ff_mlp_firorder_4, &ff_mlp_firorder_5,
-                                   &ff_mlp_firorder_6, &ff_mlp_firorder_7,
-                                   &ff_mlp_firorder_8 };
-static const void *iirtable[5] = { &ff_mlp_iirorder_0, &ff_mlp_iirorder_1,
-                                   &ff_mlp_iirorder_2, &ff_mlp_iirorder_3,
-                                   &ff_mlp_iirorder_4 };
-
-#if ARCH_X86_64
-
-#define MLPMUL(label, offset, offs, offc)   \
-    LABEL_MANGLE(label)":             \n\t" \
-    "movslq "offset"+"offs"(%0), %%rax\n\t" \
-    "movslq "offset"+"offc"(%1), %%rdx\n\t" \
-    "imul                 %%rdx, %%rax\n\t" \
-    "add                  %%rax, %%rsi\n\t"
-
-#define FIRMULREG(label, offset, firc)\
-    LABEL_MANGLE(label)":       \n\t" \
-    "movslq "#offset"(%0), %%rax\n\t" \
-    "imul        %"#firc", %%rax\n\t" \
-    "add            %%rax, %%rsi\n\t"
-
-#define CLEAR_ACCUM                   \
-    "xor            %%rsi, %%rsi\n\t"
-
-#define SHIFT_ACCUM                   \
-    "shr     %%cl,         %%rsi\n\t"
-
-#define ACCUM    "%%rdx"
-#define RESULT   "%%rsi"
-#define RESULT32 "%%esi"
-
-#else /* if ARCH_X86_32 */
-
-#define MLPMUL(label, offset, offs, offc)  \
-    LABEL_MANGLE(label)":            \n\t" \
-    "mov   "offset"+"offs"(%0), %%eax\n\t" \
-    "imull "offset"+"offc"(%1)       \n\t" \
-    "add                %%eax , %%esi\n\t" \
-    "adc                %%edx , %%ecx\n\t"
-
-#define FIRMULREG(label, offset, firc)  \
-    MLPMUL(label, #offset, "0", "0")
-
-#define CLEAR_ACCUM                  \
-    "xor           %%esi, %%esi\n\t" \
-    "xor           %%ecx, %%ecx\n\t"
-
-#define SHIFT_ACCUM                  \
-    "mov           %%ecx, %%edx\n\t" \
-    "mov           %%esi, %%eax\n\t" \
-    "movzbl        %7   , %%ecx\n\t" \
-    "shrd    %%cl, %%edx, %%eax\n\t" \
-
-#define ACCUM    "%%edx"
-#define RESULT   "%%eax"
-#define RESULT32 "%%eax"
-
-#endif /* !ARCH_X86_64 */
-
-#define BINC  AV_STRINGIFY(4* MAX_CHANNELS)
-#define IOFFS AV_STRINGIFY(4*(MAX_FIR_ORDER + MAX_BLOCKSIZE))
-#define IOFFC AV_STRINGIFY(4* MAX_FIR_ORDER)
-
-#define FIRMUL(label, offset) MLPMUL(label, #offset,   "0",   "0")
-#define IIRMUL(label, offset) MLPMUL(label, #offset, IOFFS, IOFFC)
-
-static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff,
-                                   int firorder, int iirorder,
-                                   unsigned int filter_shift, int32_t mask,
-                                   int blocksize, int32_t *sample_buffer)
-{
-    const void *firjump = firtable[firorder];
-    const void *iirjump = iirtable[iirorder];
-
-    blocksize = -blocksize;
-
-    __asm__ volatile(
-        "1:                           \n\t"
-        CLEAR_ACCUM
-        "jmp  *%5                     \n\t"
-        FIRMUL   (ff_mlp_firorder_8, 0x1c   )
-        FIRMUL   (ff_mlp_firorder_7, 0x18   )
-        FIRMUL   (ff_mlp_firorder_6, 0x14   )
-        FIRMUL   (ff_mlp_firorder_5, 0x10   )
-        FIRMUL   (ff_mlp_firorder_4, 0x0c   )
-        FIRMULREG(ff_mlp_firorder_3, 0x08,10)
-        FIRMULREG(ff_mlp_firorder_2, 0x04, 9)
-        FIRMULREG(ff_mlp_firorder_1, 0x00, 8)
-        LABEL_MANGLE(ff_mlp_firorder_0)":\n\t"
-        "jmp  *%6                     \n\t"
-        IIRMUL   (ff_mlp_iirorder_4, 0x0c   )
-        IIRMUL   (ff_mlp_iirorder_3, 0x08   )
-        IIRMUL   (ff_mlp_iirorder_2, 0x04   )
-        IIRMUL   (ff_mlp_iirorder_1, 0x00   )
-        LABEL_MANGLE(ff_mlp_iirorder_0)":\n\t"
-        SHIFT_ACCUM
-        "mov  "RESULT"  ,"ACCUM"      \n\t"
-        "add  (%2)      ,"RESULT"     \n\t"
-        "and   %4       ,"RESULT"     \n\t"
-        "sub   $4       ,  %0         \n\t"
-        "mov  "RESULT32", (%0)        \n\t"
-        "mov  "RESULT32", (%2)        \n\t"
-        "add $"BINC"    ,  %2         \n\t"
-        "sub  "ACCUM"   ,"RESULT"     \n\t"
-        "mov  "RESULT32","IOFFS"(%0)  \n\t"
-        "incl              %3         \n\t"
-        "js 1b                        \n\t"
-        : /* 0*/"+r"(state),
-          /* 1*/"+r"(coeff),
-          /* 2*/"+r"(sample_buffer),
-#if ARCH_X86_64
-          /* 3*/"+r"(blocksize)
-        : /* 4*/"r"((x86_reg)mask), /* 5*/"r"(firjump),
-          /* 6*/"r"(iirjump)      , /* 7*/"c"(filter_shift)
-        , /* 8*/"r"((int64_t)coeff[0])
-        , /* 9*/"r"((int64_t)coeff[1])
-        , /*10*/"r"((int64_t)coeff[2])
-        : "rax", "rdx", "rsi"
-#else /* ARCH_X86_32 */
-          /* 3*/"+m"(blocksize)
-        : /* 4*/"m"(         mask), /* 5*/"m"(firjump),
-          /* 6*/"m"(iirjump)      , /* 7*/"m"(filter_shift)
-        : "eax", "edx", "esi", "ecx"
-#endif /* !ARCH_X86_64 */
-    );
-}
-
-#endif /* HAVE_7REGS && HAVE_INLINE_ASM */
-
-av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
-{
-#if HAVE_7REGS && HAVE_INLINE_ASM
-    int cpu_flags = av_get_cpu_flags();
-    if (INLINE_MMX(cpu_flags))
-        c->mlp_filter_channel = mlp_filter_channel_x86;
-#endif
-}
diff --git a/deps/libav/libavcodec/x86/motion_est.c b/deps/libav/libavcodec/x86/motion_est.c
deleted file mode 100644
index 41b9c5c..0000000
--- a/deps/libav/libavcodec/x86/motion_est.c
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
- * MMX optimized motion estimation
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * mostly by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "dsputil_x86.h"
-
-#if HAVE_INLINE_ASM
-
-DECLARE_ASM_CONST(8, uint64_t, round_tab)[3]={
-0x0000000000000000ULL,
-0x0001000100010001ULL,
-0x0002000200020002ULL,
-};
-
-DECLARE_ASM_CONST(8, uint64_t, bone)= 0x0101010101010101LL;
-
-static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
-{
-    x86_reg len= -(stride*h);
-    __asm__ volatile(
-        ".p2align 4                     \n\t"
-        "1:                             \n\t"
-        "movq (%1, %%"REG_a"), %%mm0    \n\t"
-        "movq (%2, %%"REG_a"), %%mm2    \n\t"
-        "movq (%2, %%"REG_a"), %%mm4    \n\t"
-        "add %3, %%"REG_a"              \n\t"
-        "psubusb %%mm0, %%mm2           \n\t"
-        "psubusb %%mm4, %%mm0           \n\t"
-        "movq (%1, %%"REG_a"), %%mm1    \n\t"
-        "movq (%2, %%"REG_a"), %%mm3    \n\t"
-        "movq (%2, %%"REG_a"), %%mm5    \n\t"
-        "psubusb %%mm1, %%mm3           \n\t"
-        "psubusb %%mm5, %%mm1           \n\t"
-        "por %%mm2, %%mm0               \n\t"
-        "por %%mm1, %%mm3               \n\t"
-        "movq %%mm0, %%mm1              \n\t"
-        "movq %%mm3, %%mm2              \n\t"
-        "punpcklbw %%mm7, %%mm0         \n\t"
-        "punpckhbw %%mm7, %%mm1         \n\t"
-        "punpcklbw %%mm7, %%mm3         \n\t"
-        "punpckhbw %%mm7, %%mm2         \n\t"
-        "paddw %%mm1, %%mm0             \n\t"
-        "paddw %%mm3, %%mm2             \n\t"
-        "paddw %%mm2, %%mm0             \n\t"
-        "paddw %%mm0, %%mm6             \n\t"
-        "add %3, %%"REG_a"              \n\t"
-        " js 1b                         \n\t"
-        : "+a" (len)
-        : "r" (blk1 - len), "r" (blk2 - len), "r" ((x86_reg)stride)
-    );
-}
-
-static inline void sad8_1_mmxext(uint8_t *blk1, uint8_t *blk2,
-                                 int stride, int h)
-{
-    __asm__ volatile(
-        ".p2align 4                     \n\t"
-        "1:                             \n\t"
-        "movq (%1), %%mm0               \n\t"
-        "movq (%1, %3), %%mm1           \n\t"
-        "psadbw (%2), %%mm0             \n\t"
-        "psadbw (%2, %3), %%mm1         \n\t"
-        "paddw %%mm0, %%mm6             \n\t"
-        "paddw %%mm1, %%mm6             \n\t"
-        "lea (%1,%3,2), %1              \n\t"
-        "lea (%2,%3,2), %2              \n\t"
-        "sub $2, %0                     \n\t"
-        " jg 1b                         \n\t"
-        : "+r" (h), "+r" (blk1), "+r" (blk2)
-        : "r" ((x86_reg)stride)
-    );
-}
-
-static int sad16_sse2(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)
-{
-    int ret;
-    __asm__ volatile(
-        "pxor %%xmm2, %%xmm2            \n\t"
-        ".p2align 4                     \n\t"
-        "1:                             \n\t"
-        "movdqu (%1), %%xmm0            \n\t"
-        "movdqu (%1, %4), %%xmm1        \n\t"
-        "psadbw (%2), %%xmm0            \n\t"
-        "psadbw (%2, %4), %%xmm1        \n\t"
-        "paddw %%xmm0, %%xmm2           \n\t"
-        "paddw %%xmm1, %%xmm2           \n\t"
-        "lea (%1,%4,2), %1              \n\t"
-        "lea (%2,%4,2), %2              \n\t"
-        "sub $2, %0                     \n\t"
-        " jg 1b                         \n\t"
-        "movhlps %%xmm2, %%xmm0         \n\t"
-        "paddw   %%xmm0, %%xmm2         \n\t"
-        "movd    %%xmm2, %3             \n\t"
-        : "+r" (h), "+r" (blk1), "+r" (blk2), "=r"(ret)
-        : "r" ((x86_reg)stride)
-    );
-    return ret;
-}
-
-static inline void sad8_x2a_mmxext(uint8_t *blk1, uint8_t *blk2,
-                                   int stride, int h)
-{
-    __asm__ volatile(
-        ".p2align 4                     \n\t"
-        "1:                             \n\t"
-        "movq (%1), %%mm0               \n\t"
-        "movq (%1, %3), %%mm1           \n\t"
-        "pavgb 1(%1), %%mm0             \n\t"
-        "pavgb 1(%1, %3), %%mm1         \n\t"
-        "psadbw (%2), %%mm0             \n\t"
-        "psadbw (%2, %3), %%mm1         \n\t"
-        "paddw %%mm0, %%mm6             \n\t"
-        "paddw %%mm1, %%mm6             \n\t"
-        "lea (%1,%3,2), %1              \n\t"
-        "lea (%2,%3,2), %2              \n\t"
-        "sub $2, %0                     \n\t"
-        " jg 1b                         \n\t"
-        : "+r" (h), "+r" (blk1), "+r" (blk2)
-        : "r" ((x86_reg)stride)
-    );
-}
-
-static inline void sad8_y2a_mmxext(uint8_t *blk1, uint8_t *blk2,
-                                   int stride, int h)
-{
-    __asm__ volatile(
-        "movq (%1), %%mm0               \n\t"
-        "add %3, %1                     \n\t"
-        ".p2align 4                     \n\t"
-        "1:                             \n\t"
-        "movq (%1), %%mm1               \n\t"
-        "movq (%1, %3), %%mm2           \n\t"
-        "pavgb %%mm1, %%mm0             \n\t"
-        "pavgb %%mm2, %%mm1             \n\t"
-        "psadbw (%2), %%mm0             \n\t"
-        "psadbw (%2, %3), %%mm1         \n\t"
-        "paddw %%mm0, %%mm6             \n\t"
-        "paddw %%mm1, %%mm6             \n\t"
-        "movq %%mm2, %%mm0              \n\t"
-        "lea (%1,%3,2), %1              \n\t"
-        "lea (%2,%3,2), %2              \n\t"
-        "sub $2, %0                     \n\t"
-        " jg 1b                         \n\t"
-        : "+r" (h), "+r" (blk1), "+r" (blk2)
-        : "r" ((x86_reg)stride)
-    );
-}
-
-static inline void sad8_4_mmxext(uint8_t *blk1, uint8_t *blk2,
-                                 int stride, int h)
-{
-    __asm__ volatile(
-        "movq "MANGLE(bone)", %%mm5     \n\t"
-        "movq (%1), %%mm0               \n\t"
-        "pavgb 1(%1), %%mm0             \n\t"
-        "add %3, %1                     \n\t"
-        ".p2align 4                     \n\t"
-        "1:                             \n\t"
-        "movq (%1), %%mm1               \n\t"
-        "movq (%1,%3), %%mm2            \n\t"
-        "pavgb 1(%1), %%mm1             \n\t"
-        "pavgb 1(%1,%3), %%mm2          \n\t"
-        "psubusb %%mm5, %%mm1           \n\t"
-        "pavgb %%mm1, %%mm0             \n\t"
-        "pavgb %%mm2, %%mm1             \n\t"
-        "psadbw (%2), %%mm0             \n\t"
-        "psadbw (%2,%3), %%mm1          \n\t"
-        "paddw %%mm0, %%mm6             \n\t"
-        "paddw %%mm1, %%mm6             \n\t"
-        "movq %%mm2, %%mm0              \n\t"
-        "lea (%1,%3,2), %1              \n\t"
-        "lea (%2,%3,2), %2              \n\t"
-        "sub $2, %0                     \n\t"
-        " jg 1b                         \n\t"
-        : "+r" (h), "+r" (blk1), "+r" (blk2)
-        : "r" ((x86_reg)stride)
-    );
-}
-
-static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
-{
-    x86_reg len= -(stride*h);
-    __asm__ volatile(
-        ".p2align 4                     \n\t"
-        "1:                             \n\t"
-        "movq (%1, %%"REG_a"), %%mm0    \n\t"
-        "movq (%2, %%"REG_a"), %%mm1    \n\t"
-        "movq (%1, %%"REG_a"), %%mm2    \n\t"
-        "movq (%2, %%"REG_a"), %%mm3    \n\t"
-        "punpcklbw %%mm7, %%mm0         \n\t"
-        "punpcklbw %%mm7, %%mm1         \n\t"
-        "punpckhbw %%mm7, %%mm2         \n\t"
-        "punpckhbw %%mm7, %%mm3         \n\t"
-        "paddw %%mm0, %%mm1             \n\t"
-        "paddw %%mm2, %%mm3             \n\t"
-        "movq (%3, %%"REG_a"), %%mm4    \n\t"
-        "movq (%3, %%"REG_a"), %%mm2    \n\t"
-        "paddw %%mm5, %%mm1             \n\t"
-        "paddw %%mm5, %%mm3             \n\t"
-        "psrlw $1, %%mm1                \n\t"
-        "psrlw $1, %%mm3                \n\t"
-        "packuswb %%mm3, %%mm1          \n\t"
-        "psubusb %%mm1, %%mm4           \n\t"
-        "psubusb %%mm2, %%mm1           \n\t"
-        "por %%mm4, %%mm1               \n\t"
-        "movq %%mm1, %%mm0              \n\t"
-        "punpcklbw %%mm7, %%mm0         \n\t"
-        "punpckhbw %%mm7, %%mm1         \n\t"
-        "paddw %%mm1, %%mm0             \n\t"
-        "paddw %%mm0, %%mm6             \n\t"
-        "add %4, %%"REG_a"              \n\t"
-        " js 1b                         \n\t"
-        : "+a" (len)
-        : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" ((x86_reg)stride)
-    );
-}
-
-static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
-{
-    x86_reg len= -(stride*h);
-    __asm__ volatile(
-        "movq (%1, %%"REG_a"), %%mm0    \n\t"
-        "movq 1(%1, %%"REG_a"), %%mm2   \n\t"
-        "movq %%mm0, %%mm1              \n\t"
-        "movq %%mm2, %%mm3              \n\t"
-        "punpcklbw %%mm7, %%mm0         \n\t"
-        "punpckhbw %%mm7, %%mm1         \n\t"
-        "punpcklbw %%mm7, %%mm2         \n\t"
-        "punpckhbw %%mm7, %%mm3         \n\t"
-        "paddw %%mm2, %%mm0             \n\t"
-        "paddw %%mm3, %%mm1             \n\t"
-        ".p2align 4                     \n\t"
-        "1:                             \n\t"
-        "movq (%2, %%"REG_a"), %%mm2    \n\t"
-        "movq 1(%2, %%"REG_a"), %%mm4   \n\t"
-        "movq %%mm2, %%mm3              \n\t"
-        "movq %%mm4, %%mm5              \n\t"
-        "punpcklbw %%mm7, %%mm2         \n\t"
-        "punpckhbw %%mm7, %%mm3         \n\t"
-        "punpcklbw %%mm7, %%mm4         \n\t"
-        "punpckhbw %%mm7, %%mm5         \n\t"
-        "paddw %%mm4, %%mm2             \n\t"
-        "paddw %%mm5, %%mm3             \n\t"
-        "movq 16+"MANGLE(round_tab)", %%mm5 \n\t"
-        "paddw %%mm2, %%mm0             \n\t"
-        "paddw %%mm3, %%mm1             \n\t"
-        "paddw %%mm5, %%mm0             \n\t"
-        "paddw %%mm5, %%mm1             \n\t"
-        "movq (%3, %%"REG_a"), %%mm4    \n\t"
-        "movq (%3, %%"REG_a"), %%mm5    \n\t"
-        "psrlw $2, %%mm0                \n\t"
-        "psrlw $2, %%mm1                \n\t"
-        "packuswb %%mm1, %%mm0          \n\t"
-        "psubusb %%mm0, %%mm4           \n\t"
-        "psubusb %%mm5, %%mm0           \n\t"
-        "por %%mm4, %%mm0               \n\t"
-        "movq %%mm0, %%mm4              \n\t"
-        "punpcklbw %%mm7, %%mm0         \n\t"
-        "punpckhbw %%mm7, %%mm4         \n\t"
-        "paddw %%mm0, %%mm6             \n\t"
-        "paddw %%mm4, %%mm6             \n\t"
-        "movq  %%mm2, %%mm0             \n\t"
-        "movq  %%mm3, %%mm1             \n\t"
-        "add %4, %%"REG_a"              \n\t"
-        " js 1b                         \n\t"
-        : "+a" (len)
-        : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" ((x86_reg)stride)
-    );
-}
-
-static inline int sum_mmx(void)
-{
-    int ret;
-    __asm__ volatile(
-        "movq %%mm6, %%mm0              \n\t"
-        "psrlq $32, %%mm6               \n\t"
-        "paddw %%mm0, %%mm6             \n\t"
-        "movq %%mm6, %%mm0              \n\t"
-        "psrlq $16, %%mm6               \n\t"
-        "paddw %%mm0, %%mm6             \n\t"
-        "movd %%mm6, %0                 \n\t"
-        : "=r" (ret)
-    );
-    return ret&0xFFFF;
-}
-
-static inline int sum_mmxext(void)
-{
-    int ret;
-    __asm__ volatile(
-        "movd %%mm6, %0                 \n\t"
-        : "=r" (ret)
-    );
-    return ret;
-}
-
-static inline void sad8_x2a_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
-{
-    sad8_2_mmx(blk1, blk1+1, blk2, stride, h);
-}
-static inline void sad8_y2a_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
-{
-    sad8_2_mmx(blk1, blk1+stride, blk2, stride, h);
-}
-
-
-#define PIX_SAD(suf)\
-static int sad8_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
-    assert(h==8);\
-    __asm__ volatile("pxor %%mm7, %%mm7     \n\t"\
-                 "pxor %%mm6, %%mm6     \n\t":);\
-\
-    sad8_1_ ## suf(blk1, blk2, stride, 8);\
-\
-    return sum_ ## suf();\
-}\
-static int sad8_x2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
-    assert(h==8);\
-    __asm__ volatile("pxor %%mm7, %%mm7     \n\t"\
-                 "pxor %%mm6, %%mm6     \n\t"\
-                 "movq %0, %%mm5        \n\t"\
-                 :: "m"(round_tab[1]) \
-                 );\
-\
-    sad8_x2a_ ## suf(blk1, blk2, stride, 8);\
-\
-    return sum_ ## suf();\
-}\
-\
-static int sad8_y2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
-    assert(h==8);\
-    __asm__ volatile("pxor %%mm7, %%mm7     \n\t"\
-                 "pxor %%mm6, %%mm6     \n\t"\
-                 "movq %0, %%mm5        \n\t"\
-                 :: "m"(round_tab[1]) \
-                 );\
-\
-    sad8_y2a_ ## suf(blk1, blk2, stride, 8);\
-\
-    return sum_ ## suf();\
-}\
-\
-static int sad8_xy2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
-    assert(h==8);\
-    __asm__ volatile("pxor %%mm7, %%mm7     \n\t"\
-                 "pxor %%mm6, %%mm6     \n\t"\
-                 ::);\
-\
-    sad8_4_ ## suf(blk1, blk2, stride, 8);\
-\
-    return sum_ ## suf();\
-}\
-\
-static int sad16_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
-    __asm__ volatile("pxor %%mm7, %%mm7     \n\t"\
-                 "pxor %%mm6, %%mm6     \n\t":);\
-\
-    sad8_1_ ## suf(blk1  , blk2  , stride, h);\
-    sad8_1_ ## suf(blk1+8, blk2+8, stride, h);\
-\
-    return sum_ ## suf();\
-}\
-static int sad16_x2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
-    __asm__ volatile("pxor %%mm7, %%mm7     \n\t"\
-                 "pxor %%mm6, %%mm6     \n\t"\
-                 "movq %0, %%mm5        \n\t"\
-                 :: "m"(round_tab[1]) \
-                 );\
-\
-    sad8_x2a_ ## suf(blk1  , blk2  , stride, h);\
-    sad8_x2a_ ## suf(blk1+8, blk2+8, stride, h);\
-\
-    return sum_ ## suf();\
-}\
-static int sad16_y2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
-    __asm__ volatile("pxor %%mm7, %%mm7     \n\t"\
-                 "pxor %%mm6, %%mm6     \n\t"\
-                 "movq %0, %%mm5        \n\t"\
-                 :: "m"(round_tab[1]) \
-                 );\
-\
-    sad8_y2a_ ## suf(blk1  , blk2  , stride, h);\
-    sad8_y2a_ ## suf(blk1+8, blk2+8, stride, h);\
-\
-    return sum_ ## suf();\
-}\
-static int sad16_xy2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
-    __asm__ volatile("pxor %%mm7, %%mm7     \n\t"\
-                 "pxor %%mm6, %%mm6     \n\t"\
-                 ::);\
-\
-    sad8_4_ ## suf(blk1  , blk2  , stride, h);\
-    sad8_4_ ## suf(blk1+8, blk2+8, stride, h);\
-\
-    return sum_ ## suf();\
-}\
-
-PIX_SAD(mmx)
-PIX_SAD(mmxext)
-
-#endif /* HAVE_INLINE_ASM */
-
-av_cold void ff_dsputil_init_pix_mmx(DSPContext *c, AVCodecContext *avctx)
-{
-#if HAVE_INLINE_ASM
-    int cpu_flags = av_get_cpu_flags();
-
-    if (INLINE_MMX(cpu_flags)) {
-        c->pix_abs[0][0] = sad16_mmx;
-        c->pix_abs[0][1] = sad16_x2_mmx;
-        c->pix_abs[0][2] = sad16_y2_mmx;
-        c->pix_abs[0][3] = sad16_xy2_mmx;
-        c->pix_abs[1][0] = sad8_mmx;
-        c->pix_abs[1][1] = sad8_x2_mmx;
-        c->pix_abs[1][2] = sad8_y2_mmx;
-        c->pix_abs[1][3] = sad8_xy2_mmx;
-
-        c->sad[0]= sad16_mmx;
-        c->sad[1]= sad8_mmx;
-    }
-    if (INLINE_MMXEXT(cpu_flags)) {
-        c->pix_abs[0][0] = sad16_mmxext;
-        c->pix_abs[1][0] = sad8_mmxext;
-
-        c->sad[0]        = sad16_mmxext;
-        c->sad[1]        = sad8_mmxext;
-
-        if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
-            c->pix_abs[0][1] = sad16_x2_mmxext;
-            c->pix_abs[0][2] = sad16_y2_mmxext;
-            c->pix_abs[0][3] = sad16_xy2_mmxext;
-            c->pix_abs[1][1] = sad8_x2_mmxext;
-            c->pix_abs[1][2] = sad8_y2_mmxext;
-            c->pix_abs[1][3] = sad8_xy2_mmxext;
-        }
-    }
-    if (INLINE_SSE2(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_3DNOW)) {
-        c->sad[0]= sad16_sse2;
-    }
-#endif /* HAVE_INLINE_ASM */
-}
diff --git a/deps/libav/libavcodec/x86/mpeg4qpel.asm b/deps/libav/libavcodec/x86/mpeg4qpel.asm
deleted file mode 100644
index df20ea9..0000000
--- a/deps/libav/libavcodec/x86/mpeg4qpel.asm
+++ /dev/null
@@ -1,558 +0,0 @@
-;******************************************************************************
-;* mpeg4 qpel
-;* Copyright (c) 2008 Loren Merritt
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-cextern pb_1
-cextern pw_3
-cextern pw_15
-cextern pw_16
-cextern pw_20
-
-
-SECTION_TEXT
-
-; put_no_rnd_pixels8_l2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-%macro PUT_NO_RND_PIXELS8_L2 0
-cglobal put_no_rnd_pixels8_l2, 6,6
-    movsxdifnidn r4, r4d
-    movsxdifnidn r3, r3d
-    pcmpeqb      m6, m6
-    test        r5d, 1
-    je .loop
-    mova         m0, [r1]
-    mova         m1, [r2]
-    add          r1, r4
-    add          r2, 8
-    pxor         m0, m6
-    pxor         m1, m6
-    PAVGB        m0, m1
-    pxor         m0, m6
-    mova       [r0], m0
-    add          r0, r3
-    dec r5d
-.loop:
-    mova         m0, [r1]
-    add          r1, r4
-    mova         m1, [r1]
-    add          r1, r4
-    mova         m2, [r2]
-    mova         m3, [r2+8]
-    pxor         m0, m6
-    pxor         m1, m6
-    pxor         m2, m6
-    pxor         m3, m6
-    PAVGB        m0, m2
-    PAVGB        m1, m3
-    pxor         m0, m6
-    pxor         m1, m6
-    mova       [r0], m0
-    add          r0, r3
-    mova       [r0], m1
-    add          r0, r3
-    mova         m0, [r1]
-    add          r1, r4
-    mova         m1, [r1]
-    add          r1, r4
-    mova         m2, [r2+16]
-    mova         m3, [r2+24]
-    pxor         m0, m6
-    pxor         m1, m6
-    pxor         m2, m6
-    pxor         m3, m6
-    PAVGB        m0, m2
-    PAVGB        m1, m3
-    pxor         m0, m6
-    pxor         m1, m6
-    mova       [r0], m0
-    add          r0, r3
-    mova       [r0], m1
-    add          r0, r3
-    add          r2, 32
-    sub         r5d, 4
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PUT_NO_RND_PIXELS8_L2
-
-
-; put_no_rnd_pixels16_l2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-%macro PUT_NO_RND_PIXELS16_l2 0
-cglobal put_no_rnd_pixels16_l2, 6,6
-    movsxdifnidn r3, r3d
-    movsxdifnidn r4, r4d
-    pcmpeqb      m6, m6
-    test        r5d, 1
-    je .loop
-    mova         m0, [r1]
-    mova         m1, [r1+8]
-    mova         m2, [r2]
-    mova         m3, [r2+8]
-    pxor         m0, m6
-    pxor         m1, m6
-    pxor         m2, m6
-    pxor         m3, m6
-    PAVGB        m0, m2
-    PAVGB        m1, m3
-    pxor         m0, m6
-    pxor         m1, m6
-    add          r1, r4
-    add          r2, 16
-    mova       [r0], m0
-    mova     [r0+8], m1
-    add          r0, r3
-    dec r5d
-.loop:
-    mova         m0, [r1]
-    mova         m1, [r1+8]
-    add          r1, r4
-    mova         m2, [r2]
-    mova         m3, [r2+8]
-    pxor         m0, m6
-    pxor         m1, m6
-    pxor         m2, m6
-    pxor         m3, m6
-    PAVGB        m0, m2
-    PAVGB        m1, m3
-    pxor         m0, m6
-    pxor         m1, m6
-    mova       [r0], m0
-    mova     [r0+8], m1
-    add          r0, r3
-    mova         m0, [r1]
-    mova         m1, [r1+8]
-    add          r1, r4
-    mova         m2, [r2+16]
-    mova         m3, [r2+24]
-    pxor         m0, m6
-    pxor         m1, m6
-    pxor         m2, m6
-    pxor         m3, m6
-    PAVGB        m0, m2
-    PAVGB        m1, m3
-    pxor         m0, m6
-    pxor         m1, m6
-    mova       [r0], m0
-    mova     [r0+8], m1
-    add          r0, r3
-    add          r2, 32
-    sub         r5d, 2
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PUT_NO_RND_PIXELS16_l2
-INIT_MMX 3dnow
-PUT_NO_RND_PIXELS16_l2
-
-%macro MPEG4_QPEL16_H_LOWPASS 1
-cglobal %1_mpeg4_qpel16_h_lowpass, 5, 5, 0, 16
-    movsxdifnidn r2, r2d
-    movsxdifnidn r3, r3d
-    pxor         m7, m7
-.loop:
-    mova         m0, [r1]
-    mova         m1, m0
-    mova         m2, m0
-    punpcklbw    m0, m7
-    punpckhbw    m1, m7
-    pshufw       m5, m0, 0x90
-    pshufw       m6, m0, 0x41
-    mova         m3, m2
-    mova         m4, m2
-    psllq        m2, 8
-    psllq        m3, 16
-    psllq        m4, 24
-    punpckhbw    m2, m7
-    punpckhbw    m3, m7
-    punpckhbw    m4, m7
-    paddw        m5, m3
-    paddw        m6, m2
-    paddw        m5, m5
-    psubw        m6, m5
-    pshufw       m5, m0, 6
-    pmullw       m6, [pw_3]
-    paddw        m0, m4
-    paddw        m5, m1
-    pmullw       m0, [pw_20]
-    psubw        m0, m5
-    paddw        m6, [PW_ROUND]
-    paddw        m0, m6
-    psraw        m0, 5
-    mova    [rsp+8], m0
-    mova         m0, [r1+5]
-    mova         m5, m0
-    mova         m6, m0
-    psrlq        m0, 8
-    psrlq        m5, 16
-    punpcklbw    m0, m7
-    punpcklbw    m5, m7
-    paddw        m2, m0
-    paddw        m3, m5
-    paddw        m2, m2
-    psubw        m3, m2
-    mova         m2, m6
-    psrlq        m6, 24
-    punpcklbw    m2, m7
-    punpcklbw    m6, m7
-    pmullw       m3, [pw_3]
-    paddw        m1, m2
-    paddw        m4, m6
-    pmullw       m1, [pw_20]
-    psubw        m3, m4
-    paddw        m1, [PW_ROUND]
-    paddw        m3, m1
-    psraw        m3, 5
-    mova         m1, [rsp+8]
-    packuswb     m1, m3
-    OP_MOV     [r0], m1, m4
-    mova         m1, [r1+9]
-    mova         m4, m1
-    mova         m3, m1
-    psrlq        m1, 8
-    psrlq        m4, 16
-    punpcklbw    m1, m7
-    punpcklbw    m4, m7
-    paddw        m5, m1
-    paddw        m0, m4
-    paddw        m5, m5
-    psubw        m0, m5
-    mova         m5, m3
-    psrlq        m3, 24
-    pmullw       m0, [pw_3]
-    punpcklbw    m3, m7
-    paddw        m2, m3
-    psubw        m0, m2
-    mova         m2, m5
-    punpcklbw    m2, m7
-    punpckhbw    m5, m7
-    paddw        m6, m2
-    pmullw       m6, [pw_20]
-    paddw        m0, [PW_ROUND]
-    paddw        m0, m6
-    psraw        m0, 5
-    paddw        m3, m5
-    pshufw       m6, m5, 0xf9
-    paddw        m6, m4
-    pshufw       m4, m5, 0xbe
-    pshufw       m5, m5, 0x6f
-    paddw        m4, m1
-    paddw        m5, m2
-    paddw        m6, m6
-    psubw        m4, m6
-    pmullw       m3, [pw_20]
-    pmullw       m4, [pw_3]
-    psubw        m3, m5
-    paddw        m4, [PW_ROUND]
-    paddw        m4, m3
-    psraw        m4, 5
-    packuswb     m0, m4
-    OP_MOV   [r0+8], m0, m4
-    add          r1, r3
-    add          r0, r2
-    dec r4d
-    jne .loop
-    REP_RET
-%endmacro
-
-%macro PUT_OP 2-3
-    mova %1, %2
-%endmacro
-
-%macro AVG_OP 2-3
-    mova  %3, %1
-    pavgb %2, %3
-    mova  %1, %2
-%endmacro
-
-INIT_MMX mmxext
-%define PW_ROUND pw_16
-%define OP_MOV PUT_OP
-MPEG4_QPEL16_H_LOWPASS put
-%define PW_ROUND pw_16
-%define OP_MOV AVG_OP
-MPEG4_QPEL16_H_LOWPASS avg
-%define PW_ROUND pw_15
-%define OP_MOV PUT_OP
-MPEG4_QPEL16_H_LOWPASS put_no_rnd
-
-
-
-%macro MPEG4_QPEL8_H_LOWPASS 1
-cglobal %1_mpeg4_qpel8_h_lowpass, 5, 5, 0, 8
-    movsxdifnidn r2, r2d
-    movsxdifnidn r3, r3d
-    pxor         m7, m7
-.loop:
-    mova         m0, [r1]
-    mova         m1, m0
-    mova         m2, m0
-    punpcklbw    m0, m7
-    punpckhbw    m1, m7
-    pshufw       m5, m0, 0x90
-    pshufw       m6, m0, 0x41
-    mova         m3, m2
-    mova         m4, m2
-    psllq        m2, 8
-    psllq        m3, 16
-    psllq        m4, 24
-    punpckhbw    m2, m7
-    punpckhbw    m3, m7
-    punpckhbw    m4, m7
-    paddw        m5, m3
-    paddw        m6, m2
-    paddw        m5, m5
-    psubw        m6, m5
-    pshufw       m5, m0, 0x6
-    pmullw       m6, [pw_3]
-    paddw        m0, m4
-    paddw        m5, m1
-    pmullw       m0, [pw_20]
-    psubw        m0, m5
-    paddw        m6, [PW_ROUND]
-    paddw        m0, m6
-    psraw        m0, 5
-    movh         m5, [r1+5]
-    punpcklbw    m5, m7
-    pshufw       m6, m5, 0xf9
-    paddw        m1, m5
-    paddw        m2, m6
-    pshufw       m6, m5, 0xbe
-    pshufw       m5, m5, 0x6f
-    paddw        m3, m6
-    paddw        m4, m5
-    paddw        m2, m2
-    psubw        m3, m2
-    pmullw       m1, [pw_20]
-    pmullw       m3, [pw_3]
-    psubw        m3, m4
-    paddw        m1, [PW_ROUND]
-    paddw        m3, m1
-    psraw        m3, 5
-    packuswb     m0, m3
-    OP_MOV     [r0], m0, m4
-    add          r1, r3
-    add          r0, r2
-    dec r4d
-    jne .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-%define PW_ROUND pw_16
-%define OP_MOV PUT_OP
-MPEG4_QPEL8_H_LOWPASS put
-%define PW_ROUND pw_16
-%define OP_MOV AVG_OP
-MPEG4_QPEL8_H_LOWPASS avg
-%define PW_ROUND pw_15
-%define OP_MOV PUT_OP
-MPEG4_QPEL8_H_LOWPASS put_no_rnd
-
-
-
-%macro QPEL_V_LOW 5
-    paddw      m0, m1
-    mova       m4, [pw_20]
-    pmullw     m4, m0
-    mova       m0, %4
-    mova       m5, %1
-    paddw      m5, m0
-    psubw      m4, m5
-    mova       m5, %2
-    mova       m6, %3
-    paddw      m5, m3
-    paddw      m6, m2
-    paddw      m6, m6
-    psubw      m5, m6
-    pmullw     m5, [pw_3]
-    paddw      m4, [PW_ROUND]
-    paddw      m5, m4
-    psraw      m5, 5
-    packuswb   m5, m5
-    OP_MOV     %5, m5, m7
-    SWAP 0,1,2,3
-%endmacro
-
-%macro MPEG4_QPEL16_V_LOWPASS 1
-cglobal %1_mpeg4_qpel16_v_lowpass, 4, 6, 0, 544
-    movsxdifnidn r2, r2d
-    movsxdifnidn r3, r3d
-
-    mov         r4d, 17
-    mov          r5, rsp
-    pxor         m7, m7
-.looph:
-    mova         m0, [r1]
-    mova         m1, [r1]
-    mova         m2, [r1+8]
-    mova         m3, [r1+8]
-    punpcklbw    m0, m7
-    punpckhbw    m1, m7
-    punpcklbw    m2, m7
-    punpckhbw    m3, m7
-    mova       [r5], m0
-    mova  [r5+0x88], m1
-    mova [r5+0x110], m2
-    mova [r5+0x198], m3
-    add          r5, 8
-    add          r1, r3
-    dec r4d
-    jne .looph
-
-
-    ; NOTE: r1 CHANGES VALUES: r1 -> 4 - 14*dstStride
-    mov         r4d, 4
-    mov          r1, 4
-    neg          r2
-    lea          r1, [r1+r2*8]
-    lea          r1, [r1+r2*4]
-    lea          r1, [r1+r2*2]
-    neg          r2
-    mov          r5, rsp
-.loopv:
-    pxor         m7, m7
-    mova         m0, [r5+ 0x0]
-    mova         m1, [r5+ 0x8]
-    mova         m2, [r5+0x10]
-    mova         m3, [r5+0x18]
-    QPEL_V_LOW [r5+0x10], [r5+ 0x8], [r5+ 0x0], [r5+0x20], [r0]
-    QPEL_V_LOW [r5+ 0x8], [r5+ 0x0], [r5+ 0x0], [r5+0x28], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+ 0x0], [r5+ 0x0], [r5+ 0x8], [r5+0x30], [r0]
-    QPEL_V_LOW [r5+ 0x0], [r5+ 0x8], [r5+0x10], [r5+0x38], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+ 0x8], [r5+0x10], [r5+0x18], [r5+0x40], [r0]
-    QPEL_V_LOW [r5+0x10], [r5+0x18], [r5+0x20], [r5+0x48], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+0x18], [r5+0x20], [r5+0x28], [r5+0x50], [r0]
-    QPEL_V_LOW [r5+0x20], [r5+0x28], [r5+0x30], [r5+0x58], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+0x28], [r5+0x30], [r5+0x38], [r5+0x60], [r0]
-    QPEL_V_LOW [r5+0x30], [r5+0x38], [r5+0x40], [r5+0x68], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+0x38], [r5+0x40], [r5+0x48], [r5+0x70], [r0]
-    QPEL_V_LOW [r5+0x40], [r5+0x48], [r5+0x50], [r5+0x78], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+0x48], [r5+0x50], [r5+0x58], [r5+0x80], [r0]
-    QPEL_V_LOW [r5+0x50], [r5+0x58], [r5+0x60], [r5+0x80], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+0x58], [r5+0x60], [r5+0x68], [r5+0x78], [r0]
-    QPEL_V_LOW [r5+0x60], [r5+0x68], [r5+0x70], [r5+0x70], [r0+r2]
-
-    add    r5, 0x88
-    add    r0, r1
-    dec r4d
-    jne .loopv
-    REP_RET
-%endmacro
-
-%macro PUT_OPH 2-3
-    movh %1, %2
-%endmacro
-
-%macro AVG_OPH 2-3
-    movh  %3, %1
-    pavgb %2, %3
-    movh  %1, %2
-%endmacro
-
-INIT_MMX mmxext
-%define PW_ROUND pw_16
-%define OP_MOV PUT_OPH
-MPEG4_QPEL16_V_LOWPASS put
-%define PW_ROUND pw_16
-%define OP_MOV AVG_OPH
-MPEG4_QPEL16_V_LOWPASS avg
-%define PW_ROUND pw_15
-%define OP_MOV PUT_OPH
-MPEG4_QPEL16_V_LOWPASS put_no_rnd
-
-
-
-%macro MPEG4_QPEL8_V_LOWPASS 1
-cglobal %1_mpeg4_qpel8_v_lowpass, 4, 6, 0, 288
-    movsxdifnidn r2, r2d
-    movsxdifnidn r3, r3d
-
-    mov         r4d, 9
-    mov          r5, rsp
-    pxor         m7, m7
-.looph:
-    mova         m0, [r1]
-    mova         m1, [r1]
-    punpcklbw    m0, m7
-    punpckhbw    m1, m7
-    mova       [r5], m0
-    mova  [r5+0x48], m1
-    add          r5, 8
-    add          r1, r3
-    dec r4d
-    jne .looph
-
-
-    ; NOTE: r1 CHANGES VALUES: r1 -> 4 - 6*dstStride
-    mov         r4d, 2
-    mov          r1, 4
-    neg          r2
-    lea          r1, [r1+r2*4]
-    lea          r1, [r1+r2*2]
-    neg          r2
-    mov          r5, rsp
-.loopv:
-    pxor         m7, m7
-    mova         m0, [r5+ 0x0]
-    mova         m1, [r5+ 0x8]
-    mova         m2, [r5+0x10]
-    mova         m3, [r5+0x18]
-    QPEL_V_LOW [r5+0x10], [r5+ 0x8], [r5+ 0x0], [r5+0x20], [r0]
-    QPEL_V_LOW [r5+ 0x8], [r5+ 0x0], [r5+ 0x0], [r5+0x28], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+ 0x0], [r5+ 0x0], [r5+ 0x8], [r5+0x30], [r0]
-    QPEL_V_LOW [r5+ 0x0], [r5+ 0x8], [r5+0x10], [r5+0x38], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+ 0x8], [r5+0x10], [r5+0x18], [r5+0x40], [r0]
-    QPEL_V_LOW [r5+0x10], [r5+0x18], [r5+0x20], [r5+0x40], [r0+r2]
-    lea    r0, [r0+r2*2]
-    QPEL_V_LOW [r5+0x18], [r5+0x20], [r5+0x28], [r5+0x38], [r0]
-    QPEL_V_LOW [r5+0x20], [r5+0x28], [r5+0x30], [r5+0x30], [r0+r2]
-
-    add    r5, 0x48
-    add    r0, r1
-    dec r4d
-    jne .loopv
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-%define PW_ROUND pw_16
-%define OP_MOV PUT_OPH
-MPEG4_QPEL8_V_LOWPASS put
-%define PW_ROUND pw_16
-%define OP_MOV AVG_OPH
-MPEG4_QPEL8_V_LOWPASS avg
-%define PW_ROUND pw_15
-%define OP_MOV PUT_OPH
-MPEG4_QPEL8_V_LOWPASS put_no_rnd
diff --git a/deps/libav/libavcodec/x86/mpegaudiodsp.c b/deps/libav/libavcodec/x86/mpegaudiodsp.c
deleted file mode 100644
index f45cb7e..0000000
--- a/deps/libav/libavcodec/x86/mpegaudiodsp.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * MMX optimized MP3 decoding functions
- * Copyright (c) 2010 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/internal.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/mpegaudiodsp.h"
-
-void ff_imdct36_float_sse(float *out, float *buf, float *in, float *win);
-void ff_imdct36_float_sse2(float *out, float *buf, float *in, float *win);
-void ff_imdct36_float_sse3(float *out, float *buf, float *in, float *win);
-void ff_imdct36_float_ssse3(float *out, float *buf, float *in, float *win);
-void ff_imdct36_float_avx(float *out, float *buf, float *in, float *win);
-void ff_four_imdct36_float_sse(float *out, float *buf, float *in, float *win,
-                               float *tmpbuf);
-void ff_four_imdct36_float_avx(float *out, float *buf, float *in, float *win,
-                               float *tmpbuf);
-
-DECLARE_ALIGNED(16, static float, mdct_win_sse)[2][4][4*40];
-
-#if HAVE_SSE2_INLINE
-
-#define MACS(rt, ra, rb) rt+=(ra)*(rb)
-#define MLSS(rt, ra, rb) rt-=(ra)*(rb)
-
-#define SUM8(op, sum, w, p)               \
-{                                         \
-    op(sum, (w)[0 * 64], (p)[0 * 64]);    \
-    op(sum, (w)[1 * 64], (p)[1 * 64]);    \
-    op(sum, (w)[2 * 64], (p)[2 * 64]);    \
-    op(sum, (w)[3 * 64], (p)[3 * 64]);    \
-    op(sum, (w)[4 * 64], (p)[4 * 64]);    \
-    op(sum, (w)[5 * 64], (p)[5 * 64]);    \
-    op(sum, (w)[6 * 64], (p)[6 * 64]);    \
-    op(sum, (w)[7 * 64], (p)[7 * 64]);    \
-}
-
-static void apply_window(const float *buf, const float *win1,
-                         const float *win2, float *sum1, float *sum2, int len)
-{
-    x86_reg count = - 4*len;
-    const float *win1a = win1+len;
-    const float *win2a = win2+len;
-    const float *bufa  = buf+len;
-    float *sum1a = sum1+len;
-    float *sum2a = sum2+len;
-
-
-#define MULT(a, b)                                 \
-    "movaps " #a "(%1,%0), %%xmm1           \n\t"  \
-    "movaps " #a "(%3,%0), %%xmm2           \n\t"  \
-    "mulps         %%xmm2, %%xmm1           \n\t"  \
-    "subps         %%xmm1, %%xmm0           \n\t"  \
-    "mulps  " #b "(%2,%0), %%xmm2           \n\t"  \
-    "subps         %%xmm2, %%xmm4           \n\t"  \
-
-    __asm__ volatile(
-            "1:                                   \n\t"
-            "xorps       %%xmm0, %%xmm0           \n\t"
-            "xorps       %%xmm4, %%xmm4           \n\t"
-
-            MULT(   0,   0)
-            MULT( 256,  64)
-            MULT( 512, 128)
-            MULT( 768, 192)
-            MULT(1024, 256)
-            MULT(1280, 320)
-            MULT(1536, 384)
-            MULT(1792, 448)
-
-            "movaps      %%xmm0, (%4,%0)          \n\t"
-            "movaps      %%xmm4, (%5,%0)          \n\t"
-            "add            $16,  %0              \n\t"
-            "jl              1b                   \n\t"
-            :"+&r"(count)
-            :"r"(win1a), "r"(win2a), "r"(bufa), "r"(sum1a), "r"(sum2a)
-            );
-
-#undef MULT
-}
-
-static void apply_window_mp3(float *in, float *win, int *unused, float *out,
-                             int incr)
-{
-    LOCAL_ALIGNED_16(float, suma, [17]);
-    LOCAL_ALIGNED_16(float, sumb, [17]);
-    LOCAL_ALIGNED_16(float, sumc, [17]);
-    LOCAL_ALIGNED_16(float, sumd, [17]);
-
-    float sum;
-
-    /* copy to avoid wrap */
-    __asm__ volatile(
-            "movaps    0(%0), %%xmm0   \n\t" \
-            "movaps   16(%0), %%xmm1   \n\t" \
-            "movaps   32(%0), %%xmm2   \n\t" \
-            "movaps   48(%0), %%xmm3   \n\t" \
-            "movaps   %%xmm0,   0(%1) \n\t" \
-            "movaps   %%xmm1,  16(%1) \n\t" \
-            "movaps   %%xmm2,  32(%1) \n\t" \
-            "movaps   %%xmm3,  48(%1) \n\t" \
-            "movaps   64(%0), %%xmm0   \n\t" \
-            "movaps   80(%0), %%xmm1   \n\t" \
-            "movaps   96(%0), %%xmm2   \n\t" \
-            "movaps  112(%0), %%xmm3   \n\t" \
-            "movaps   %%xmm0,  64(%1) \n\t" \
-            "movaps   %%xmm1,  80(%1) \n\t" \
-            "movaps   %%xmm2,  96(%1) \n\t" \
-            "movaps   %%xmm3, 112(%1) \n\t"
-            ::"r"(in), "r"(in+512)
-            :"memory"
-            );
-
-    apply_window(in + 16, win     , win + 512, suma, sumc, 16);
-    apply_window(in + 32, win + 48, win + 640, sumb, sumd, 16);
-
-    SUM8(MACS, suma[0], win + 32, in + 48);
-
-    sumc[ 0] = 0;
-    sumb[16] = 0;
-    sumd[16] = 0;
-
-#define SUMS(suma, sumb, sumc, sumd, out1, out2)               \
-            "movups " #sumd "(%4),       %%xmm0          \n\t" \
-            "shufps         $0x1b,       %%xmm0, %%xmm0  \n\t" \
-            "subps  " #suma "(%1),       %%xmm0          \n\t" \
-            "movaps        %%xmm0," #out1 "(%0)          \n\t" \
-\
-            "movups " #sumc "(%3),       %%xmm0          \n\t" \
-            "shufps         $0x1b,       %%xmm0, %%xmm0  \n\t" \
-            "addps  " #sumb "(%2),       %%xmm0          \n\t" \
-            "movaps        %%xmm0," #out2 "(%0)          \n\t"
-
-    if (incr == 1) {
-        __asm__ volatile(
-            SUMS( 0, 48,  4, 52,  0, 112)
-            SUMS(16, 32, 20, 36, 16,  96)
-            SUMS(32, 16, 36, 20, 32,  80)
-            SUMS(48,  0, 52,  4, 48,  64)
-
-            :"+&r"(out)
-            :"r"(&suma[0]), "r"(&sumb[0]), "r"(&sumc[0]), "r"(&sumd[0])
-            :"memory"
-            );
-        out += 16*incr;
-    } else {
-        int j;
-        float *out2 = out + 32 * incr;
-        out[0  ]  = -suma[   0];
-        out += incr;
-        out2 -= incr;
-        for(j=1;j<16;j++) {
-            *out  = -suma[   j] + sumd[16-j];
-            *out2 =  sumb[16-j] + sumc[   j];
-            out  += incr;
-            out2 -= incr;
-        }
-    }
-
-    sum = 0;
-    SUM8(MLSS, sum, win + 16 + 32, in + 32);
-    *out = sum;
-}
-
-#endif /* HAVE_SSE2_INLINE */
-
-#if HAVE_YASM
-#define DECL_IMDCT_BLOCKS(CPU1, CPU2)                                       \
-static void imdct36_blocks_ ## CPU1(float *out, float *buf, float *in,      \
-                               int count, int switch_point, int block_type) \
-{                                                                           \
-    int align_end = count - (count & 3);                                \
-    int j;                                                              \
-    for (j = 0; j < align_end; j+= 4) {                                 \
-        LOCAL_ALIGNED_16(float, tmpbuf, [1024]);                        \
-        float *win = mdct_win_sse[switch_point && j < 4][block_type];   \
-        /* apply window & overlap with previous buffer */               \
-                                                                        \
-        /* select window */                                             \
-        ff_four_imdct36_float_ ## CPU2(out, buf, in, win, tmpbuf);      \
-        in      += 4*18;                                                \
-        buf     += 4*18;                                                \
-        out     += 4;                                                   \
-    }                                                                   \
-    for (; j < count; j++) {                                            \
-        /* apply window & overlap with previous buffer */               \
-                                                                        \
-        /* select window */                                             \
-        int win_idx = (switch_point && j < 2) ? 0 : block_type;         \
-        float *win = ff_mdct_win_float[win_idx + (4 & -(j & 1))];       \
-                                                                        \
-        ff_imdct36_float_ ## CPU1(out, buf, in, win);                   \
-                                                                        \
-        in  += 18;                                                      \
-        buf++;                                                          \
-        out++;                                                          \
-    }                                                                   \
-}
-
-DECL_IMDCT_BLOCKS(sse,sse)
-DECL_IMDCT_BLOCKS(sse2,sse)
-DECL_IMDCT_BLOCKS(sse3,sse)
-DECL_IMDCT_BLOCKS(ssse3,sse)
-DECL_IMDCT_BLOCKS(avx,avx)
-#endif /* HAVE_YASM */
-
-av_cold void ff_mpadsp_init_x86(MPADSPContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    int i, j;
-    for (j = 0; j < 4; j++) {
-        for (i = 0; i < 40; i ++) {
-            mdct_win_sse[0][j][4*i    ] = ff_mdct_win_float[j    ][i];
-            mdct_win_sse[0][j][4*i + 1] = ff_mdct_win_float[j + 4][i];
-            mdct_win_sse[0][j][4*i + 2] = ff_mdct_win_float[j    ][i];
-            mdct_win_sse[0][j][4*i + 3] = ff_mdct_win_float[j + 4][i];
-            mdct_win_sse[1][j][4*i    ] = ff_mdct_win_float[0    ][i];
-            mdct_win_sse[1][j][4*i + 1] = ff_mdct_win_float[4    ][i];
-            mdct_win_sse[1][j][4*i + 2] = ff_mdct_win_float[j    ][i];
-            mdct_win_sse[1][j][4*i + 3] = ff_mdct_win_float[j + 4][i];
-        }
-    }
-
-#if HAVE_SSE2_INLINE
-    if (INLINE_SSE2(cpu_flags)) {
-        s->apply_window_float = apply_window_mp3;
-    }
-#endif /* HAVE_SSE2_INLINE */
-
-#if HAVE_YASM
-    if (EXTERNAL_SSE(cpu_flags)) {
-        s->imdct36_blocks_float = imdct36_blocks_sse;
-    }
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        s->imdct36_blocks_float = imdct36_blocks_sse2;
-    }
-    if (EXTERNAL_SSE3(cpu_flags)) {
-        s->imdct36_blocks_float = imdct36_blocks_sse3;
-    }
-    if (EXTERNAL_SSSE3(cpu_flags)) {
-        s->imdct36_blocks_float = imdct36_blocks_ssse3;
-    }
-    if (EXTERNAL_AVX(cpu_flags)) {
-        s->imdct36_blocks_float = imdct36_blocks_avx;
-    }
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavcodec/x86/mpegvideo.c b/deps/libav/libavcodec/x86/mpegvideo.c
deleted file mode 100644
index 25b44e6..0000000
--- a/deps/libav/libavcodec/x86/mpegvideo.c
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- * Optimized for ia32 CPUs by Nick Kurshev <nickols_k at mail.ru>
- * h263, mpeg1, mpeg2 dequantizer & draw_edges by Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/mpegvideo.h"
-#include "dsputil_x86.h"
-
-#if HAVE_INLINE_ASM
-
-static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,
-                                  int16_t *block, int n, int qscale)
-{
-    x86_reg level, qmul, qadd, nCoeffs;
-
-    qmul = qscale << 1;
-
-    assert(s->block_last_index[n]>=0 || s->h263_aic);
-
-    if (!s->h263_aic) {
-        if (n < 4)
-            level = block[0] * s->y_dc_scale;
-        else
-            level = block[0] * s->c_dc_scale;
-        qadd = (qscale - 1) | 1;
-    }else{
-        qadd = 0;
-        level= block[0];
-    }
-    if(s->ac_pred)
-        nCoeffs=63;
-    else
-        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
-__asm__ volatile(
-                "movd %1, %%mm6                 \n\t" //qmul
-                "packssdw %%mm6, %%mm6          \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "movd %2, %%mm5                 \n\t" //qadd
-                "pxor %%mm7, %%mm7              \n\t"
-                "packssdw %%mm5, %%mm5          \n\t"
-                "packssdw %%mm5, %%mm5          \n\t"
-                "psubw %%mm5, %%mm7             \n\t"
-                "pxor %%mm4, %%mm4              \n\t"
-                ".p2align 4                     \n\t"
-                "1:                             \n\t"
-                "movq (%0, %3), %%mm0           \n\t"
-                "movq 8(%0, %3), %%mm1          \n\t"
-
-                "pmullw %%mm6, %%mm0            \n\t"
-                "pmullw %%mm6, %%mm1            \n\t"
-
-                "movq (%0, %3), %%mm2           \n\t"
-                "movq 8(%0, %3), %%mm3          \n\t"
-
-                "pcmpgtw %%mm4, %%mm2           \n\t" // block[i] < 0 ? -1 : 0
-                "pcmpgtw %%mm4, %%mm3           \n\t" // block[i] < 0 ? -1 : 0
-
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-
-                "paddw %%mm7, %%mm0             \n\t"
-                "paddw %%mm7, %%mm1             \n\t"
-
-                "pxor %%mm0, %%mm2              \n\t"
-                "pxor %%mm1, %%mm3              \n\t"
-
-                "pcmpeqw %%mm7, %%mm0           \n\t" // block[i] == 0 ? -1 : 0
-                "pcmpeqw %%mm7, %%mm1           \n\t" // block[i] == 0 ? -1 : 0
-
-                "pandn %%mm2, %%mm0             \n\t"
-                "pandn %%mm3, %%mm1             \n\t"
-
-                "movq %%mm0, (%0, %3)           \n\t"
-                "movq %%mm1, 8(%0, %3)          \n\t"
-
-                "add $16, %3                    \n\t"
-                "jng 1b                         \n\t"
-                ::"r" (block+nCoeffs), "rm"(qmul), "rm" (qadd), "r" (2*(-nCoeffs))
-                : "memory"
-        );
-        block[0]= level;
-}
-
-
-static void dct_unquantize_h263_inter_mmx(MpegEncContext *s,
-                                  int16_t *block, int n, int qscale)
-{
-    x86_reg qmul, qadd, nCoeffs;
-
-    qmul = qscale << 1;
-    qadd = (qscale - 1) | 1;
-
-    assert(s->block_last_index[n]>=0 || s->h263_aic);
-
-    nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
-__asm__ volatile(
-                "movd %1, %%mm6                 \n\t" //qmul
-                "packssdw %%mm6, %%mm6          \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "movd %2, %%mm5                 \n\t" //qadd
-                "pxor %%mm7, %%mm7              \n\t"
-                "packssdw %%mm5, %%mm5          \n\t"
-                "packssdw %%mm5, %%mm5          \n\t"
-                "psubw %%mm5, %%mm7             \n\t"
-                "pxor %%mm4, %%mm4              \n\t"
-                ".p2align 4                     \n\t"
-                "1:                             \n\t"
-                "movq (%0, %3), %%mm0           \n\t"
-                "movq 8(%0, %3), %%mm1          \n\t"
-
-                "pmullw %%mm6, %%mm0            \n\t"
-                "pmullw %%mm6, %%mm1            \n\t"
-
-                "movq (%0, %3), %%mm2           \n\t"
-                "movq 8(%0, %3), %%mm3          \n\t"
-
-                "pcmpgtw %%mm4, %%mm2           \n\t" // block[i] < 0 ? -1 : 0
-                "pcmpgtw %%mm4, %%mm3           \n\t" // block[i] < 0 ? -1 : 0
-
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-
-                "paddw %%mm7, %%mm0             \n\t"
-                "paddw %%mm7, %%mm1             \n\t"
-
-                "pxor %%mm0, %%mm2              \n\t"
-                "pxor %%mm1, %%mm3              \n\t"
-
-                "pcmpeqw %%mm7, %%mm0           \n\t" // block[i] == 0 ? -1 : 0
-                "pcmpeqw %%mm7, %%mm1           \n\t" // block[i] == 0 ? -1 : 0
-
-                "pandn %%mm2, %%mm0             \n\t"
-                "pandn %%mm3, %%mm1             \n\t"
-
-                "movq %%mm0, (%0, %3)           \n\t"
-                "movq %%mm1, 8(%0, %3)          \n\t"
-
-                "add $16, %3                    \n\t"
-                "jng 1b                         \n\t"
-                ::"r" (block+nCoeffs), "rm"(qmul), "rm" (qadd), "r" (2*(-nCoeffs))
-                : "memory"
-        );
-}
-
-static void dct_unquantize_mpeg1_intra_mmx(MpegEncContext *s,
-                                     int16_t *block, int n, int qscale)
-{
-    x86_reg nCoeffs;
-    const uint16_t *quant_matrix;
-    int block0;
-
-    assert(s->block_last_index[n]>=0);
-
-    nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1;
-
-    if (n < 4)
-        block0 = block[0] * s->y_dc_scale;
-    else
-        block0 = block[0] * s->c_dc_scale;
-    /* XXX: only mpeg1 */
-    quant_matrix = s->intra_matrix;
-__asm__ volatile(
-                "pcmpeqw %%mm7, %%mm7           \n\t"
-                "psrlw $15, %%mm7               \n\t"
-                "movd %2, %%mm6                 \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "mov %3, %%"REG_a"              \n\t"
-                ".p2align 4                     \n\t"
-                "1:                             \n\t"
-                "movq (%0, %%"REG_a"), %%mm0    \n\t"
-                "movq 8(%0, %%"REG_a"), %%mm1   \n\t"
-                "movq (%1, %%"REG_a"), %%mm4    \n\t"
-                "movq 8(%1, %%"REG_a"), %%mm5   \n\t"
-                "pmullw %%mm6, %%mm4            \n\t" // q=qscale*quant_matrix[i]
-                "pmullw %%mm6, %%mm5            \n\t" // q=qscale*quant_matrix[i]
-                "pxor %%mm2, %%mm2              \n\t"
-                "pxor %%mm3, %%mm3              \n\t"
-                "pcmpgtw %%mm0, %%mm2           \n\t" // block[i] < 0 ? -1 : 0
-                "pcmpgtw %%mm1, %%mm3           \n\t" // block[i] < 0 ? -1 : 0
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-                "psubw %%mm2, %%mm0             \n\t" // abs(block[i])
-                "psubw %%mm3, %%mm1             \n\t" // abs(block[i])
-                "pmullw %%mm4, %%mm0            \n\t" // abs(block[i])*q
-                "pmullw %%mm5, %%mm1            \n\t" // abs(block[i])*q
-                "pxor %%mm4, %%mm4              \n\t"
-                "pxor %%mm5, %%mm5              \n\t" // FIXME slow
-                "pcmpeqw (%0, %%"REG_a"), %%mm4 \n\t" // block[i] == 0 ? -1 : 0
-                "pcmpeqw 8(%0, %%"REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
-                "psraw $3, %%mm0                \n\t"
-                "psraw $3, %%mm1                \n\t"
-                "psubw %%mm7, %%mm0             \n\t"
-                "psubw %%mm7, %%mm1             \n\t"
-                "por %%mm7, %%mm0               \n\t"
-                "por %%mm7, %%mm1               \n\t"
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-                "psubw %%mm2, %%mm0             \n\t"
-                "psubw %%mm3, %%mm1             \n\t"
-                "pandn %%mm0, %%mm4             \n\t"
-                "pandn %%mm1, %%mm5             \n\t"
-                "movq %%mm4, (%0, %%"REG_a")    \n\t"
-                "movq %%mm5, 8(%0, %%"REG_a")   \n\t"
-
-                "add $16, %%"REG_a"             \n\t"
-                "js 1b                          \n\t"
-                ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "rm" (qscale), "g" (-2*nCoeffs)
-                : "%"REG_a, "memory"
-        );
-    block[0]= block0;
-}
-
-static void dct_unquantize_mpeg1_inter_mmx(MpegEncContext *s,
-                                     int16_t *block, int n, int qscale)
-{
-    x86_reg nCoeffs;
-    const uint16_t *quant_matrix;
-
-    assert(s->block_last_index[n]>=0);
-
-    nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1;
-
-        quant_matrix = s->inter_matrix;
-__asm__ volatile(
-                "pcmpeqw %%mm7, %%mm7           \n\t"
-                "psrlw $15, %%mm7               \n\t"
-                "movd %2, %%mm6                 \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "mov %3, %%"REG_a"              \n\t"
-                ".p2align 4                     \n\t"
-                "1:                             \n\t"
-                "movq (%0, %%"REG_a"), %%mm0    \n\t"
-                "movq 8(%0, %%"REG_a"), %%mm1   \n\t"
-                "movq (%1, %%"REG_a"), %%mm4    \n\t"
-                "movq 8(%1, %%"REG_a"), %%mm5   \n\t"
-                "pmullw %%mm6, %%mm4            \n\t" // q=qscale*quant_matrix[i]
-                "pmullw %%mm6, %%mm5            \n\t" // q=qscale*quant_matrix[i]
-                "pxor %%mm2, %%mm2              \n\t"
-                "pxor %%mm3, %%mm3              \n\t"
-                "pcmpgtw %%mm0, %%mm2           \n\t" // block[i] < 0 ? -1 : 0
-                "pcmpgtw %%mm1, %%mm3           \n\t" // block[i] < 0 ? -1 : 0
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-                "psubw %%mm2, %%mm0             \n\t" // abs(block[i])
-                "psubw %%mm3, %%mm1             \n\t" // abs(block[i])
-                "paddw %%mm0, %%mm0             \n\t" // abs(block[i])*2
-                "paddw %%mm1, %%mm1             \n\t" // abs(block[i])*2
-                "paddw %%mm7, %%mm0             \n\t" // abs(block[i])*2 + 1
-                "paddw %%mm7, %%mm1             \n\t" // abs(block[i])*2 + 1
-                "pmullw %%mm4, %%mm0            \n\t" // (abs(block[i])*2 + 1)*q
-                "pmullw %%mm5, %%mm1            \n\t" // (abs(block[i])*2 + 1)*q
-                "pxor %%mm4, %%mm4              \n\t"
-                "pxor %%mm5, %%mm5              \n\t" // FIXME slow
-                "pcmpeqw (%0, %%"REG_a"), %%mm4 \n\t" // block[i] == 0 ? -1 : 0
-                "pcmpeqw 8(%0, %%"REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
-                "psraw $4, %%mm0                \n\t"
-                "psraw $4, %%mm1                \n\t"
-                "psubw %%mm7, %%mm0             \n\t"
-                "psubw %%mm7, %%mm1             \n\t"
-                "por %%mm7, %%mm0               \n\t"
-                "por %%mm7, %%mm1               \n\t"
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-                "psubw %%mm2, %%mm0             \n\t"
-                "psubw %%mm3, %%mm1             \n\t"
-                "pandn %%mm0, %%mm4             \n\t"
-                "pandn %%mm1, %%mm5             \n\t"
-                "movq %%mm4, (%0, %%"REG_a")    \n\t"
-                "movq %%mm5, 8(%0, %%"REG_a")   \n\t"
-
-                "add $16, %%"REG_a"             \n\t"
-                "js 1b                          \n\t"
-                ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "rm" (qscale), "g" (-2*nCoeffs)
-                : "%"REG_a, "memory"
-        );
-}
-
-static void dct_unquantize_mpeg2_intra_mmx(MpegEncContext *s,
-                                     int16_t *block, int n, int qscale)
-{
-    x86_reg nCoeffs;
-    const uint16_t *quant_matrix;
-    int block0;
-
-    assert(s->block_last_index[n]>=0);
-
-    if(s->alternate_scan) nCoeffs= 63; //FIXME
-    else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
-
-    if (n < 4)
-        block0 = block[0] * s->y_dc_scale;
-    else
-        block0 = block[0] * s->c_dc_scale;
-    quant_matrix = s->intra_matrix;
-__asm__ volatile(
-                "pcmpeqw %%mm7, %%mm7           \n\t"
-                "psrlw $15, %%mm7               \n\t"
-                "movd %2, %%mm6                 \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "mov %3, %%"REG_a"              \n\t"
-                ".p2align 4                     \n\t"
-                "1:                             \n\t"
-                "movq (%0, %%"REG_a"), %%mm0    \n\t"
-                "movq 8(%0, %%"REG_a"), %%mm1   \n\t"
-                "movq (%1, %%"REG_a"), %%mm4    \n\t"
-                "movq 8(%1, %%"REG_a"), %%mm5   \n\t"
-                "pmullw %%mm6, %%mm4            \n\t" // q=qscale*quant_matrix[i]
-                "pmullw %%mm6, %%mm5            \n\t" // q=qscale*quant_matrix[i]
-                "pxor %%mm2, %%mm2              \n\t"
-                "pxor %%mm3, %%mm3              \n\t"
-                "pcmpgtw %%mm0, %%mm2           \n\t" // block[i] < 0 ? -1 : 0
-                "pcmpgtw %%mm1, %%mm3           \n\t" // block[i] < 0 ? -1 : 0
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-                "psubw %%mm2, %%mm0             \n\t" // abs(block[i])
-                "psubw %%mm3, %%mm1             \n\t" // abs(block[i])
-                "pmullw %%mm4, %%mm0            \n\t" // abs(block[i])*q
-                "pmullw %%mm5, %%mm1            \n\t" // abs(block[i])*q
-                "pxor %%mm4, %%mm4              \n\t"
-                "pxor %%mm5, %%mm5              \n\t" // FIXME slow
-                "pcmpeqw (%0, %%"REG_a"), %%mm4 \n\t" // block[i] == 0 ? -1 : 0
-                "pcmpeqw 8(%0, %%"REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
-                "psraw $3, %%mm0                \n\t"
-                "psraw $3, %%mm1                \n\t"
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-                "psubw %%mm2, %%mm0             \n\t"
-                "psubw %%mm3, %%mm1             \n\t"
-                "pandn %%mm0, %%mm4             \n\t"
-                "pandn %%mm1, %%mm5             \n\t"
-                "movq %%mm4, (%0, %%"REG_a")    \n\t"
-                "movq %%mm5, 8(%0, %%"REG_a")   \n\t"
-
-                "add $16, %%"REG_a"             \n\t"
-                "jng 1b                         \n\t"
-                ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "rm" (qscale), "g" (-2*nCoeffs)
-                : "%"REG_a, "memory"
-        );
-    block[0]= block0;
-        //Note, we do not do mismatch control for intra as errors cannot accumulate
-}
-
-static void dct_unquantize_mpeg2_inter_mmx(MpegEncContext *s,
-                                     int16_t *block, int n, int qscale)
-{
-    x86_reg nCoeffs;
-    const uint16_t *quant_matrix;
-
-    assert(s->block_last_index[n]>=0);
-
-    if(s->alternate_scan) nCoeffs= 63; //FIXME
-    else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
-
-        quant_matrix = s->inter_matrix;
-__asm__ volatile(
-                "pcmpeqw %%mm7, %%mm7           \n\t"
-                "psrlq $48, %%mm7               \n\t"
-                "movd %2, %%mm6                 \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "packssdw %%mm6, %%mm6          \n\t"
-                "mov %3, %%"REG_a"              \n\t"
-                ".p2align 4                     \n\t"
-                "1:                             \n\t"
-                "movq (%0, %%"REG_a"), %%mm0    \n\t"
-                "movq 8(%0, %%"REG_a"), %%mm1   \n\t"
-                "movq (%1, %%"REG_a"), %%mm4    \n\t"
-                "movq 8(%1, %%"REG_a"), %%mm5   \n\t"
-                "pmullw %%mm6, %%mm4            \n\t" // q=qscale*quant_matrix[i]
-                "pmullw %%mm6, %%mm5            \n\t" // q=qscale*quant_matrix[i]
-                "pxor %%mm2, %%mm2              \n\t"
-                "pxor %%mm3, %%mm3              \n\t"
-                "pcmpgtw %%mm0, %%mm2           \n\t" // block[i] < 0 ? -1 : 0
-                "pcmpgtw %%mm1, %%mm3           \n\t" // block[i] < 0 ? -1 : 0
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-                "psubw %%mm2, %%mm0             \n\t" // abs(block[i])
-                "psubw %%mm3, %%mm1             \n\t" // abs(block[i])
-                "paddw %%mm0, %%mm0             \n\t" // abs(block[i])*2
-                "paddw %%mm1, %%mm1             \n\t" // abs(block[i])*2
-                "pmullw %%mm4, %%mm0            \n\t" // abs(block[i])*2*q
-                "pmullw %%mm5, %%mm1            \n\t" // abs(block[i])*2*q
-                "paddw %%mm4, %%mm0             \n\t" // (abs(block[i])*2 + 1)*q
-                "paddw %%mm5, %%mm1             \n\t" // (abs(block[i])*2 + 1)*q
-                "pxor %%mm4, %%mm4              \n\t"
-                "pxor %%mm5, %%mm5              \n\t" // FIXME slow
-                "pcmpeqw (%0, %%"REG_a"), %%mm4 \n\t" // block[i] == 0 ? -1 : 0
-                "pcmpeqw 8(%0, %%"REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
-                "psrlw $4, %%mm0                \n\t"
-                "psrlw $4, %%mm1                \n\t"
-                "pxor %%mm2, %%mm0              \n\t"
-                "pxor %%mm3, %%mm1              \n\t"
-                "psubw %%mm2, %%mm0             \n\t"
-                "psubw %%mm3, %%mm1             \n\t"
-                "pandn %%mm0, %%mm4             \n\t"
-                "pandn %%mm1, %%mm5             \n\t"
-                "pxor %%mm4, %%mm7              \n\t"
-                "pxor %%mm5, %%mm7              \n\t"
-                "movq %%mm4, (%0, %%"REG_a")    \n\t"
-                "movq %%mm5, 8(%0, %%"REG_a")   \n\t"
-
-                "add $16, %%"REG_a"             \n\t"
-                "jng 1b                         \n\t"
-                "movd 124(%0, %3), %%mm0        \n\t"
-                "movq %%mm7, %%mm6              \n\t"
-                "psrlq $32, %%mm7               \n\t"
-                "pxor %%mm6, %%mm7              \n\t"
-                "movq %%mm7, %%mm6              \n\t"
-                "psrlq $16, %%mm7               \n\t"
-                "pxor %%mm6, %%mm7              \n\t"
-                "pslld $31, %%mm7               \n\t"
-                "psrlq $15, %%mm7               \n\t"
-                "pxor %%mm7, %%mm0              \n\t"
-                "movd %%mm0, 124(%0, %3)        \n\t"
-
-                ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "rm" (qscale), "r" (-2*nCoeffs)
-                : "%"REG_a, "memory"
-        );
-}
-
-#endif /* HAVE_INLINE_ASM */
-
-av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
-{
-#if HAVE_INLINE_ASM
-    int cpu_flags = av_get_cpu_flags();
-
-    if (INLINE_MMX(cpu_flags)) {
-        s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_mmx;
-        s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_mmx;
-        s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_mmx;
-        s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_mmx;
-        if(!(s->flags & CODEC_FLAG_BITEXACT))
-            s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_mmx;
-        s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_mmx;
-    }
-#endif /* HAVE_INLINE_ASM */
-}
diff --git a/deps/libav/libavcodec/x86/mpegvideoenc.c b/deps/libav/libavcodec/x86/mpegvideoenc.c
deleted file mode 100644
index 19ab83a..0000000
--- a/deps/libav/libavcodec/x86/mpegvideoenc.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * The simplest mpeg encoder (well, it was the simplest!)
- * Copyright (c) 2000,2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dct.h"
-#include "libavcodec/mpegvideo.h"
-#include "dsputil_x86.h"
-
-/* not permutated inverse zigzag_direct + 1 for MMX quantizer */
-DECLARE_ALIGNED(16, static uint16_t, inv_zigzag_direct16)[64];
-
-#if HAVE_MMX_INLINE
-#define COMPILE_TEMPLATE_MMXEXT 0
-#define COMPILE_TEMPLATE_SSE2   0
-#define COMPILE_TEMPLATE_SSSE3  0
-#define RENAME(a) a ## _MMX
-#define RENAMEl(a) a ## _mmx
-#include "mpegvideoenc_template.c"
-#endif /* HAVE_MMX_INLINE */
-
-#if HAVE_MMXEXT_INLINE
-#undef COMPILE_TEMPLATE_SSSE3
-#undef COMPILE_TEMPLATE_SSE2
-#undef COMPILE_TEMPLATE_MMXEXT
-#define COMPILE_TEMPLATE_MMXEXT 1
-#define COMPILE_TEMPLATE_SSE2   0
-#define COMPILE_TEMPLATE_SSSE3  0
-#undef RENAME
-#undef RENAMEl
-#define RENAME(a) a ## _MMXEXT
-#define RENAMEl(a) a ## _mmxext
-#include "mpegvideoenc_template.c"
-#endif /* HAVE_MMXEXT_INLINE */
-
-#if HAVE_SSE2_INLINE
-#undef COMPILE_TEMPLATE_MMXEXT
-#undef COMPILE_TEMPLATE_SSE2
-#undef COMPILE_TEMPLATE_SSSE3
-#define COMPILE_TEMPLATE_MMXEXT 0
-#define COMPILE_TEMPLATE_SSE2   1
-#define COMPILE_TEMPLATE_SSSE3  0
-#undef RENAME
-#undef RENAMEl
-#define RENAME(a) a ## _SSE2
-#define RENAMEl(a) a ## _sse2
-#include "mpegvideoenc_template.c"
-#endif /* HAVE_SSE2_INLINE */
-
-#if HAVE_SSSE3_INLINE
-#undef COMPILE_TEMPLATE_MMXEXT
-#undef COMPILE_TEMPLATE_SSE2
-#undef COMPILE_TEMPLATE_SSSE3
-#define COMPILE_TEMPLATE_MMXEXT 0
-#define COMPILE_TEMPLATE_SSE2   1
-#define COMPILE_TEMPLATE_SSSE3  1
-#undef RENAME
-#undef RENAMEl
-#define RENAME(a) a ## _SSSE3
-#define RENAMEl(a) a ## _sse2
-#include "mpegvideoenc_template.c"
-#endif /* HAVE_SSSE3_INLINE */
-
-#if HAVE_INLINE_ASM
-static void  denoise_dct_mmx(MpegEncContext *s, int16_t *block){
-    const int intra= s->mb_intra;
-    int *sum= s->dct_error_sum[intra];
-    uint16_t *offset= s->dct_offset[intra];
-
-    s->dct_count[intra]++;
-
-    __asm__ volatile(
-        "pxor %%mm7, %%mm7                      \n\t"
-        "1:                                     \n\t"
-        "pxor %%mm0, %%mm0                      \n\t"
-        "pxor %%mm1, %%mm1                      \n\t"
-        "movq (%0), %%mm2                       \n\t"
-        "movq 8(%0), %%mm3                      \n\t"
-        "pcmpgtw %%mm2, %%mm0                   \n\t"
-        "pcmpgtw %%mm3, %%mm1                   \n\t"
-        "pxor %%mm0, %%mm2                      \n\t"
-        "pxor %%mm1, %%mm3                      \n\t"
-        "psubw %%mm0, %%mm2                     \n\t"
-        "psubw %%mm1, %%mm3                     \n\t"
-        "movq %%mm2, %%mm4                      \n\t"
-        "movq %%mm3, %%mm5                      \n\t"
-        "psubusw (%2), %%mm2                    \n\t"
-        "psubusw 8(%2), %%mm3                   \n\t"
-        "pxor %%mm0, %%mm2                      \n\t"
-        "pxor %%mm1, %%mm3                      \n\t"
-        "psubw %%mm0, %%mm2                     \n\t"
-        "psubw %%mm1, %%mm3                     \n\t"
-        "movq %%mm2, (%0)                       \n\t"
-        "movq %%mm3, 8(%0)                      \n\t"
-        "movq %%mm4, %%mm2                      \n\t"
-        "movq %%mm5, %%mm3                      \n\t"
-        "punpcklwd %%mm7, %%mm4                 \n\t"
-        "punpckhwd %%mm7, %%mm2                 \n\t"
-        "punpcklwd %%mm7, %%mm5                 \n\t"
-        "punpckhwd %%mm7, %%mm3                 \n\t"
-        "paddd (%1), %%mm4                      \n\t"
-        "paddd 8(%1), %%mm2                     \n\t"
-        "paddd 16(%1), %%mm5                    \n\t"
-        "paddd 24(%1), %%mm3                    \n\t"
-        "movq %%mm4, (%1)                       \n\t"
-        "movq %%mm2, 8(%1)                      \n\t"
-        "movq %%mm5, 16(%1)                     \n\t"
-        "movq %%mm3, 24(%1)                     \n\t"
-        "add $16, %0                            \n\t"
-        "add $32, %1                            \n\t"
-        "add $16, %2                            \n\t"
-        "cmp %3, %0                             \n\t"
-            " jb 1b                             \n\t"
-        : "+r" (block), "+r" (sum), "+r" (offset)
-        : "r"(block+64)
-    );
-}
-
-static void  denoise_dct_sse2(MpegEncContext *s, int16_t *block){
-    const int intra= s->mb_intra;
-    int *sum= s->dct_error_sum[intra];
-    uint16_t *offset= s->dct_offset[intra];
-
-    s->dct_count[intra]++;
-
-    __asm__ volatile(
-        "pxor %%xmm7, %%xmm7                    \n\t"
-        "1:                                     \n\t"
-        "pxor %%xmm0, %%xmm0                    \n\t"
-        "pxor %%xmm1, %%xmm1                    \n\t"
-        "movdqa (%0), %%xmm2                    \n\t"
-        "movdqa 16(%0), %%xmm3                  \n\t"
-        "pcmpgtw %%xmm2, %%xmm0                 \n\t"
-        "pcmpgtw %%xmm3, %%xmm1                 \n\t"
-        "pxor %%xmm0, %%xmm2                    \n\t"
-        "pxor %%xmm1, %%xmm3                    \n\t"
-        "psubw %%xmm0, %%xmm2                   \n\t"
-        "psubw %%xmm1, %%xmm3                   \n\t"
-        "movdqa %%xmm2, %%xmm4                  \n\t"
-        "movdqa %%xmm3, %%xmm5                  \n\t"
-        "psubusw (%2), %%xmm2                   \n\t"
-        "psubusw 16(%2), %%xmm3                 \n\t"
-        "pxor %%xmm0, %%xmm2                    \n\t"
-        "pxor %%xmm1, %%xmm3                    \n\t"
-        "psubw %%xmm0, %%xmm2                   \n\t"
-        "psubw %%xmm1, %%xmm3                   \n\t"
-        "movdqa %%xmm2, (%0)                    \n\t"
-        "movdqa %%xmm3, 16(%0)                  \n\t"
-        "movdqa %%xmm4, %%xmm6                  \n\t"
-        "movdqa %%xmm5, %%xmm0                  \n\t"
-        "punpcklwd %%xmm7, %%xmm4               \n\t"
-        "punpckhwd %%xmm7, %%xmm6               \n\t"
-        "punpcklwd %%xmm7, %%xmm5               \n\t"
-        "punpckhwd %%xmm7, %%xmm0               \n\t"
-        "paddd (%1), %%xmm4                     \n\t"
-        "paddd 16(%1), %%xmm6                   \n\t"
-        "paddd 32(%1), %%xmm5                   \n\t"
-        "paddd 48(%1), %%xmm0                   \n\t"
-        "movdqa %%xmm4, (%1)                    \n\t"
-        "movdqa %%xmm6, 16(%1)                  \n\t"
-        "movdqa %%xmm5, 32(%1)                  \n\t"
-        "movdqa %%xmm0, 48(%1)                  \n\t"
-        "add $32, %0                            \n\t"
-        "add $64, %1                            \n\t"
-        "add $32, %2                            \n\t"
-        "cmp %3, %0                             \n\t"
-            " jb 1b                             \n\t"
-        : "+r" (block), "+r" (sum), "+r" (offset)
-        : "r"(block+64)
-          XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
-                            "%xmm4", "%xmm5", "%xmm6", "%xmm7")
-    );
-}
-#endif /* HAVE_INLINE_ASM */
-
-av_cold void ff_MPV_encode_init_x86(MpegEncContext *s)
-{
-    const int dct_algo = s->avctx->dct_algo;
-    int i;
-
-    for (i = 0; i < 64; i++)
-        inv_zigzag_direct16[ff_zigzag_direct[i]] = i + 1;
-
-    if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
-#if HAVE_MMX_INLINE
-        int cpu_flags = av_get_cpu_flags();
-        if (INLINE_MMX(cpu_flags)) {
-            s->dct_quantize = dct_quantize_MMX;
-            s->denoise_dct  = denoise_dct_mmx;
-        }
-#endif
-#if HAVE_MMXEXT_INLINE
-        if (INLINE_MMXEXT(cpu_flags))
-            s->dct_quantize = dct_quantize_MMXEXT;
-#endif
-#if HAVE_SSE2_INLINE
-        if (INLINE_SSE2(cpu_flags)) {
-            s->dct_quantize = dct_quantize_SSE2;
-            s->denoise_dct  = denoise_dct_sse2;
-        }
-#endif
-#if HAVE_SSSE3_INLINE
-        if (INLINE_SSSE3(cpu_flags))
-            s->dct_quantize = dct_quantize_SSSE3;
-#endif
-    }
-}
diff --git a/deps/libav/libavcodec/x86/mpegvideoenc_template.c b/deps/libav/libavcodec/x86/mpegvideoenc_template.c
deleted file mode 100644
index a8d2a2c..0000000
--- a/deps/libav/libavcodec/x86/mpegvideoenc_template.c
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * MPEG video MMX templates
- *
- * Copyright (c) 2002 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#undef MMREG_WIDTH
-#undef MM
-#undef MOVQ
-#undef SPREADW
-#undef PMAXW
-#undef PMAX
-#undef SAVE_SIGN
-#undef RESTORE_SIGN
-
-#if COMPILE_TEMPLATE_SSE2
-#define MMREG_WIDTH "16"
-#define MM "%%xmm"
-#define MOVQ "movdqa"
-#define SPREADW(a) \
-            "pshuflw $0, "a", "a"       \n\t"\
-            "punpcklwd "a", "a"         \n\t"
-#define PMAXW(a,b) "pmaxsw "a", "b"     \n\t"
-#define PMAX(a,b) \
-            "movhlps "a", "b"           \n\t"\
-            PMAXW(b, a)\
-            "pshuflw $0x0E, "a", "b"    \n\t"\
-            PMAXW(b, a)\
-            "pshuflw $0x01, "a", "b"    \n\t"\
-            PMAXW(b, a)
-#else
-#define MMREG_WIDTH "8"
-#define MM "%%mm"
-#define MOVQ "movq"
-#if COMPILE_TEMPLATE_MMXEXT
-#define SPREADW(a) "pshufw $0, "a", "a" \n\t"
-#define PMAXW(a,b) "pmaxsw "a", "b"     \n\t"
-#define PMAX(a,b) \
-            "pshufw $0x0E, "a", "b"     \n\t"\
-            PMAXW(b, a)\
-            "pshufw $0x01, "a", "b"     \n\t"\
-            PMAXW(b, a)
-#else
-#define SPREADW(a) \
-            "punpcklwd "a", "a"         \n\t"\
-            "punpcklwd "a", "a"         \n\t"
-#define PMAXW(a,b) \
-            "psubusw "a", "b"           \n\t"\
-            "paddw "a", "b"             \n\t"
-#define PMAX(a,b)  \
-            "movq "a", "b"              \n\t"\
-            "psrlq $32, "a"             \n\t"\
-            PMAXW(b, a)\
-            "movq "a", "b"              \n\t"\
-            "psrlq $16, "a"             \n\t"\
-            PMAXW(b, a)
-
-#endif
-#endif
-
-#if COMPILE_TEMPLATE_SSSE3
-#define SAVE_SIGN(a,b) \
-            "movdqa "b", "a"            \n\t"\
-            "pabsw  "b", "b"            \n\t"
-#define RESTORE_SIGN(a,b) \
-            "psignw "a", "b"            \n\t"
-#else
-#define SAVE_SIGN(a,b) \
-            "pxor "a", "a"              \n\t"\
-            "pcmpgtw "b", "a"           \n\t" /* block[i] <= 0 ? 0xFF : 0x00 */\
-            "pxor "a", "b"              \n\t"\
-            "psubw "a", "b"             \n\t" /* ABS(block[i]) */
-#define RESTORE_SIGN(a,b) \
-            "pxor "a", "b"              \n\t"\
-            "psubw "a", "b"             \n\t" // out=((ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16)*sign(block[i])
-#endif
-
-static int RENAME(dct_quantize)(MpegEncContext *s,
-                            int16_t *block, int n,
-                            int qscale, int *overflow)
-{
-    x86_reg last_non_zero_p1;
-    int level=0, q; //=0 is because gcc says uninitialized ...
-    const uint16_t *qmat, *bias;
-    LOCAL_ALIGNED_16(int16_t, temp_block, [64]);
-
-    assert((7&(int)(&temp_block[0])) == 0); //did gcc align it correctly?
-
-    //s->fdct (block);
-    RENAMEl(ff_fdct) (block); //cannot be anything else ...
-
-    if(s->dct_error_sum)
-        s->denoise_dct(s, block);
-
-    if (s->mb_intra) {
-        int dummy;
-        if (n < 4)
-            q = s->y_dc_scale;
-        else
-            q = s->c_dc_scale;
-        /* note: block[0] is assumed to be positive */
-        if (!s->h263_aic) {
-        __asm__ volatile (
-                "mul %%ecx                \n\t"
-                : "=d" (level), "=a"(dummy)
-                : "a" ((block[0]>>2) + q), "c" (ff_inverse[q<<1])
-        );
-        } else
-            /* For AIC we skip quant/dequant of INTRADC */
-            level = (block[0] + 4)>>3;
-
-        block[0]=0; //avoid fake overflow
-//        temp_block[0] = (block[0] + (q >> 1)) / q;
-        last_non_zero_p1 = 1;
-        bias = s->q_intra_matrix16[qscale][1];
-        qmat = s->q_intra_matrix16[qscale][0];
-    } else {
-        last_non_zero_p1 = 0;
-        bias = s->q_inter_matrix16[qscale][1];
-        qmat = s->q_inter_matrix16[qscale][0];
-    }
-
-    if((s->out_format == FMT_H263 || s->out_format == FMT_H261) && s->mpeg_quant==0){
-
-        __asm__ volatile(
-            "movd %%"REG_a", "MM"3              \n\t" // last_non_zero_p1
-            SPREADW(MM"3")
-            "pxor "MM"7, "MM"7                  \n\t" // 0
-            "pxor "MM"4, "MM"4                  \n\t" // 0
-            MOVQ" (%2), "MM"5                   \n\t" // qmat[0]
-            "pxor "MM"6, "MM"6                  \n\t"
-            "psubw (%3), "MM"6                  \n\t" // -bias[0]
-            "mov $-128, %%"REG_a"               \n\t"
-            ".p2align 4                         \n\t"
-            "1:                                 \n\t"
-            MOVQ" (%1, %%"REG_a"), "MM"0        \n\t" // block[i]
-            SAVE_SIGN(MM"1", MM"0")                   // ABS(block[i])
-            "psubusw "MM"6, "MM"0               \n\t" // ABS(block[i]) + bias[0]
-            "pmulhw "MM"5, "MM"0                \n\t" // (ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16
-            "por "MM"0, "MM"4                   \n\t"
-            RESTORE_SIGN(MM"1", MM"0")                // out=((ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16)*sign(block[i])
-            MOVQ" "MM"0, (%5, %%"REG_a")        \n\t"
-            "pcmpeqw "MM"7, "MM"0               \n\t" // out==0 ? 0xFF : 0x00
-            MOVQ" (%4, %%"REG_a"), "MM"1        \n\t"
-            MOVQ" "MM"7, (%1, %%"REG_a")        \n\t" // 0
-            "pandn "MM"1, "MM"0                 \n\t"
-            PMAXW(MM"0", MM"3")
-            "add $"MMREG_WIDTH", %%"REG_a"      \n\t"
-            " js 1b                             \n\t"
-            PMAX(MM"3", MM"0")
-            "movd "MM"3, %%"REG_a"              \n\t"
-            "movzb %%al, %%"REG_a"              \n\t" // last_non_zero_p1
-            : "+a" (last_non_zero_p1)
-            : "r" (block+64), "r" (qmat), "r" (bias),
-              "r" (inv_zigzag_direct16 + 64), "r" (temp_block + 64)
-              XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
-                                "%xmm4", "%xmm5", "%xmm6", "%xmm7")
-        );
-    }else{ // FMT_H263
-        __asm__ volatile(
-            "movd %%"REG_a", "MM"3              \n\t" // last_non_zero_p1
-            SPREADW(MM"3")
-            "pxor "MM"7, "MM"7                  \n\t" // 0
-            "pxor "MM"4, "MM"4                  \n\t" // 0
-            "mov $-128, %%"REG_a"               \n\t"
-            ".p2align 4                         \n\t"
-            "1:                                 \n\t"
-            MOVQ" (%1, %%"REG_a"), "MM"0        \n\t" // block[i]
-            SAVE_SIGN(MM"1", MM"0")                   // ABS(block[i])
-            MOVQ" (%3, %%"REG_a"), "MM"6        \n\t" // bias[0]
-            "paddusw "MM"6, "MM"0               \n\t" // ABS(block[i]) + bias[0]
-            MOVQ" (%2, %%"REG_a"), "MM"5        \n\t" // qmat[i]
-            "pmulhw "MM"5, "MM"0                \n\t" // (ABS(block[i])*qmat[0] + bias[0]*qmat[0])>>16
-            "por "MM"0, "MM"4                   \n\t"
-            RESTORE_SIGN(MM"1", MM"0")                // out=((ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16)*sign(block[i])
-            MOVQ" "MM"0, (%5, %%"REG_a")        \n\t"
-            "pcmpeqw "MM"7, "MM"0               \n\t" // out==0 ? 0xFF : 0x00
-            MOVQ" (%4, %%"REG_a"), "MM"1        \n\t"
-            MOVQ" "MM"7, (%1, %%"REG_a")        \n\t" // 0
-            "pandn "MM"1, "MM"0                 \n\t"
-            PMAXW(MM"0", MM"3")
-            "add $"MMREG_WIDTH", %%"REG_a"      \n\t"
-            " js 1b                             \n\t"
-            PMAX(MM"3", MM"0")
-            "movd "MM"3, %%"REG_a"              \n\t"
-            "movzb %%al, %%"REG_a"              \n\t" // last_non_zero_p1
-            : "+a" (last_non_zero_p1)
-            : "r" (block+64), "r" (qmat+64), "r" (bias+64),
-              "r" (inv_zigzag_direct16 + 64), "r" (temp_block + 64)
-              XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
-                                "%xmm4", "%xmm5", "%xmm6", "%xmm7")
-        );
-    }
-    __asm__ volatile(
-        "movd %1, "MM"1                     \n\t" // max_qcoeff
-        SPREADW(MM"1")
-        "psubusw "MM"1, "MM"4               \n\t"
-        "packuswb "MM"4, "MM"4              \n\t"
-#if COMPILE_TEMPLATE_SSE2
-        "packuswb "MM"4, "MM"4              \n\t"
-#endif
-        "movd "MM"4, %0                     \n\t" // *overflow
-        : "=g" (*overflow)
-        : "g" (s->max_qcoeff)
-    );
-
-    if(s->mb_intra) block[0]= level;
-    else            block[0]= temp_block[0];
-
-    if(s->dsp.idct_permutation_type == FF_SIMPLE_IDCT_PERM){
-        if(last_non_zero_p1 <= 1) goto end;
-        block[0x08] = temp_block[0x01]; block[0x10] = temp_block[0x08];
-        block[0x20] = temp_block[0x10];
-        if(last_non_zero_p1 <= 4) goto end;
-        block[0x18] = temp_block[0x09]; block[0x04] = temp_block[0x02];
-        block[0x09] = temp_block[0x03];
-        if(last_non_zero_p1 <= 7) goto end;
-        block[0x14] = temp_block[0x0A]; block[0x28] = temp_block[0x11];
-        block[0x12] = temp_block[0x18]; block[0x02] = temp_block[0x20];
-        if(last_non_zero_p1 <= 11) goto end;
-        block[0x1A] = temp_block[0x19]; block[0x24] = temp_block[0x12];
-        block[0x19] = temp_block[0x0B]; block[0x01] = temp_block[0x04];
-        block[0x0C] = temp_block[0x05];
-        if(last_non_zero_p1 <= 16) goto end;
-        block[0x11] = temp_block[0x0C]; block[0x29] = temp_block[0x13];
-        block[0x16] = temp_block[0x1A]; block[0x0A] = temp_block[0x21];
-        block[0x30] = temp_block[0x28]; block[0x22] = temp_block[0x30];
-        block[0x38] = temp_block[0x29]; block[0x06] = temp_block[0x22];
-        if(last_non_zero_p1 <= 24) goto end;
-        block[0x1B] = temp_block[0x1B]; block[0x21] = temp_block[0x14];
-        block[0x1C] = temp_block[0x0D]; block[0x05] = temp_block[0x06];
-        block[0x0D] = temp_block[0x07]; block[0x15] = temp_block[0x0E];
-        block[0x2C] = temp_block[0x15]; block[0x13] = temp_block[0x1C];
-        if(last_non_zero_p1 <= 32) goto end;
-        block[0x0B] = temp_block[0x23]; block[0x34] = temp_block[0x2A];
-        block[0x2A] = temp_block[0x31]; block[0x32] = temp_block[0x38];
-        block[0x3A] = temp_block[0x39]; block[0x26] = temp_block[0x32];
-        block[0x39] = temp_block[0x2B]; block[0x03] = temp_block[0x24];
-        if(last_non_zero_p1 <= 40) goto end;
-        block[0x1E] = temp_block[0x1D]; block[0x25] = temp_block[0x16];
-        block[0x1D] = temp_block[0x0F]; block[0x2D] = temp_block[0x17];
-        block[0x17] = temp_block[0x1E]; block[0x0E] = temp_block[0x25];
-        block[0x31] = temp_block[0x2C]; block[0x2B] = temp_block[0x33];
-        if(last_non_zero_p1 <= 48) goto end;
-        block[0x36] = temp_block[0x3A]; block[0x3B] = temp_block[0x3B];
-        block[0x23] = temp_block[0x34]; block[0x3C] = temp_block[0x2D];
-        block[0x07] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
-        block[0x0F] = temp_block[0x27]; block[0x35] = temp_block[0x2E];
-        if(last_non_zero_p1 <= 56) goto end;
-        block[0x2E] = temp_block[0x35]; block[0x33] = temp_block[0x3C];
-        block[0x3E] = temp_block[0x3D]; block[0x27] = temp_block[0x36];
-        block[0x3D] = temp_block[0x2F]; block[0x2F] = temp_block[0x37];
-        block[0x37] = temp_block[0x3E]; block[0x3F] = temp_block[0x3F];
-    }else if(s->dsp.idct_permutation_type == FF_LIBMPEG2_IDCT_PERM){
-        if(last_non_zero_p1 <= 1) goto end;
-        block[0x04] = temp_block[0x01];
-        block[0x08] = temp_block[0x08]; block[0x10] = temp_block[0x10];
-        if(last_non_zero_p1 <= 4) goto end;
-        block[0x0C] = temp_block[0x09]; block[0x01] = temp_block[0x02];
-        block[0x05] = temp_block[0x03];
-        if(last_non_zero_p1 <= 7) goto end;
-        block[0x09] = temp_block[0x0A]; block[0x14] = temp_block[0x11];
-        block[0x18] = temp_block[0x18]; block[0x20] = temp_block[0x20];
-        if(last_non_zero_p1 <= 11) goto end;
-        block[0x1C] = temp_block[0x19];
-        block[0x11] = temp_block[0x12]; block[0x0D] = temp_block[0x0B];
-        block[0x02] = temp_block[0x04]; block[0x06] = temp_block[0x05];
-        if(last_non_zero_p1 <= 16) goto end;
-        block[0x0A] = temp_block[0x0C]; block[0x15] = temp_block[0x13];
-        block[0x19] = temp_block[0x1A]; block[0x24] = temp_block[0x21];
-        block[0x28] = temp_block[0x28]; block[0x30] = temp_block[0x30];
-        block[0x2C] = temp_block[0x29]; block[0x21] = temp_block[0x22];
-        if(last_non_zero_p1 <= 24) goto end;
-        block[0x1D] = temp_block[0x1B]; block[0x12] = temp_block[0x14];
-        block[0x0E] = temp_block[0x0D]; block[0x03] = temp_block[0x06];
-        block[0x07] = temp_block[0x07]; block[0x0B] = temp_block[0x0E];
-        block[0x16] = temp_block[0x15]; block[0x1A] = temp_block[0x1C];
-        if(last_non_zero_p1 <= 32) goto end;
-        block[0x25] = temp_block[0x23]; block[0x29] = temp_block[0x2A];
-        block[0x34] = temp_block[0x31]; block[0x38] = temp_block[0x38];
-        block[0x3C] = temp_block[0x39]; block[0x31] = temp_block[0x32];
-        block[0x2D] = temp_block[0x2B]; block[0x22] = temp_block[0x24];
-        if(last_non_zero_p1 <= 40) goto end;
-        block[0x1E] = temp_block[0x1D]; block[0x13] = temp_block[0x16];
-        block[0x0F] = temp_block[0x0F]; block[0x17] = temp_block[0x17];
-        block[0x1B] = temp_block[0x1E]; block[0x26] = temp_block[0x25];
-        block[0x2A] = temp_block[0x2C]; block[0x35] = temp_block[0x33];
-        if(last_non_zero_p1 <= 48) goto end;
-        block[0x39] = temp_block[0x3A]; block[0x3D] = temp_block[0x3B];
-        block[0x32] = temp_block[0x34]; block[0x2E] = temp_block[0x2D];
-            block[0x23] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
-        block[0x27] = temp_block[0x27]; block[0x2B] = temp_block[0x2E];
-        if(last_non_zero_p1 <= 56) goto end;
-        block[0x36] = temp_block[0x35]; block[0x3A] = temp_block[0x3C];
-        block[0x3E] = temp_block[0x3D]; block[0x33] = temp_block[0x36];
-        block[0x2F] = temp_block[0x2F]; block[0x37] = temp_block[0x37];
-        block[0x3B] = temp_block[0x3E]; block[0x3F] = temp_block[0x3F];
-    }else{
-        if(last_non_zero_p1 <= 1) goto end;
-        block[0x01] = temp_block[0x01];
-        block[0x08] = temp_block[0x08]; block[0x10] = temp_block[0x10];
-        if(last_non_zero_p1 <= 4) goto end;
-        block[0x09] = temp_block[0x09]; block[0x02] = temp_block[0x02];
-        block[0x03] = temp_block[0x03];
-        if(last_non_zero_p1 <= 7) goto end;
-        block[0x0A] = temp_block[0x0A]; block[0x11] = temp_block[0x11];
-        block[0x18] = temp_block[0x18]; block[0x20] = temp_block[0x20];
-        if(last_non_zero_p1 <= 11) goto end;
-        block[0x19] = temp_block[0x19];
-        block[0x12] = temp_block[0x12]; block[0x0B] = temp_block[0x0B];
-        block[0x04] = temp_block[0x04]; block[0x05] = temp_block[0x05];
-        if(last_non_zero_p1 <= 16) goto end;
-        block[0x0C] = temp_block[0x0C]; block[0x13] = temp_block[0x13];
-        block[0x1A] = temp_block[0x1A]; block[0x21] = temp_block[0x21];
-        block[0x28] = temp_block[0x28]; block[0x30] = temp_block[0x30];
-        block[0x29] = temp_block[0x29]; block[0x22] = temp_block[0x22];
-        if(last_non_zero_p1 <= 24) goto end;
-        block[0x1B] = temp_block[0x1B]; block[0x14] = temp_block[0x14];
-        block[0x0D] = temp_block[0x0D]; block[0x06] = temp_block[0x06];
-        block[0x07] = temp_block[0x07]; block[0x0E] = temp_block[0x0E];
-        block[0x15] = temp_block[0x15]; block[0x1C] = temp_block[0x1C];
-        if(last_non_zero_p1 <= 32) goto end;
-        block[0x23] = temp_block[0x23]; block[0x2A] = temp_block[0x2A];
-        block[0x31] = temp_block[0x31]; block[0x38] = temp_block[0x38];
-        block[0x39] = temp_block[0x39]; block[0x32] = temp_block[0x32];
-        block[0x2B] = temp_block[0x2B]; block[0x24] = temp_block[0x24];
-        if(last_non_zero_p1 <= 40) goto end;
-        block[0x1D] = temp_block[0x1D]; block[0x16] = temp_block[0x16];
-        block[0x0F] = temp_block[0x0F]; block[0x17] = temp_block[0x17];
-        block[0x1E] = temp_block[0x1E]; block[0x25] = temp_block[0x25];
-        block[0x2C] = temp_block[0x2C]; block[0x33] = temp_block[0x33];
-        if(last_non_zero_p1 <= 48) goto end;
-        block[0x3A] = temp_block[0x3A]; block[0x3B] = temp_block[0x3B];
-        block[0x34] = temp_block[0x34]; block[0x2D] = temp_block[0x2D];
-        block[0x26] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
-        block[0x27] = temp_block[0x27]; block[0x2E] = temp_block[0x2E];
-        if(last_non_zero_p1 <= 56) goto end;
-        block[0x35] = temp_block[0x35]; block[0x3C] = temp_block[0x3C];
-        block[0x3D] = temp_block[0x3D]; block[0x36] = temp_block[0x36];
-        block[0x2F] = temp_block[0x2F]; block[0x37] = temp_block[0x37];
-        block[0x3E] = temp_block[0x3E]; block[0x3F] = temp_block[0x3F];
-    }
-    end:
-    return last_non_zero_p1 - 1;
-}
diff --git a/deps/libav/libavcodec/x86/pngdsp.asm b/deps/libav/libavcodec/x86/pngdsp.asm
deleted file mode 100644
index c05f3da..0000000
--- a/deps/libav/libavcodec/x86/pngdsp.asm
+++ /dev/null
@@ -1,173 +0,0 @@
-;******************************************************************************
-;* x86 optimizations for PNG decoding
-;*
-;* Copyright (c) 2008 Loren Merritt <lorenm at u.washington.edu>
-;* Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-cextern pw_255
-
-SECTION_TEXT
-
-; %1 = nr. of xmm registers used
-%macro ADD_BYTES_FN 1
-cglobal add_bytes_l2, 4, 6, %1, dst, src1, src2, wa, w, i
-%if ARCH_X86_64
-    movsxd             waq, wad
-%endif
-    xor                 iq, iq
-
-    ; vector loop
-    mov                 wq, waq
-    and                waq, ~(mmsize*2-1)
-    jmp .end_v
-.loop_v:
-    mova                m0, [src1q+iq]
-    mova                m1, [src1q+iq+mmsize]
-    paddb               m0, [src2q+iq]
-    paddb               m1, [src2q+iq+mmsize]
-    mova  [dstq+iq       ], m0
-    mova  [dstq+iq+mmsize], m1
-    add                 iq, mmsize*2
-.end_v:
-    cmp                 iq, waq
-    jl .loop_v
-
-%if mmsize == 16
-    ; vector loop
-    mov                waq, wq
-    and                waq, ~7
-    jmp .end_l
-.loop_l:
-    movq               mm0, [src1q+iq]
-    paddb              mm0, [src2q+iq]
-    movq  [dstq+iq       ], mm0
-    add                 iq, 8
-.end_l:
-    cmp                 iq, waq
-    jl .loop_l
-%endif
-
-    ; scalar loop for leftover
-    jmp .end_s
-.loop_s:
-    mov                wab, [src1q+iq]
-    add                wab, [src2q+iq]
-    mov          [dstq+iq], wab
-    inc                 iq
-.end_s:
-    cmp                 iq, wq
-    jl .loop_s
-    REP_RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-ADD_BYTES_FN 0
-%endif
-
-INIT_XMM sse2
-ADD_BYTES_FN 2
-
-%macro ADD_PAETH_PRED_FN 1
-cglobal add_png_paeth_prediction, 5, 7, %1, dst, src, top, w, bpp, end, cntr
-%if ARCH_X86_64
-    movsxd            bppq, bppd
-    movsxd              wq, wd
-%endif
-    lea               endq, [dstq+wq-(mmsize/2-1)]
-    sub               topq, dstq
-    sub               srcq, dstq
-    sub               dstq, bppq
-    pxor                m7, m7
-
-    PUSH              dstq
-    lea              cntrq, [bppq-1]
-    shr              cntrq, 2 + mmsize/16
-.bpp_loop:
-    lea               dstq, [dstq+cntrq*(mmsize/2)]
-    movh                m0, [dstq]
-    movh                m1, [topq+dstq]
-    punpcklbw           m0, m7
-    punpcklbw           m1, m7
-    add               dstq, bppq
-.loop:
-    mova                m2, m1
-    movh                m1, [topq+dstq]
-    mova                m3, m2
-    punpcklbw           m1, m7
-    mova                m4, m2
-    psubw               m3, m1
-    psubw               m4, m0
-    mova                m5, m3
-    paddw               m5, m4
-%if cpuflag(ssse3)
-    pabsw               m3, m3
-    pabsw               m4, m4
-    pabsw               m5, m5
-%else ; !cpuflag(ssse3)
-    psubw               m7, m5
-    pmaxsw              m5, m7
-    pxor                m6, m6
-    pxor                m7, m7
-    psubw               m6, m3
-    psubw               m7, m4
-    pmaxsw              m3, m6
-    pmaxsw              m4, m7
-    pxor                m7, m7
-%endif ; cpuflag(ssse3)
-    mova                m6, m4
-    pminsw              m6, m5
-    pcmpgtw             m3, m6
-    pcmpgtw             m4, m5
-    mova                m6, m4
-    pand                m4, m3
-    pandn               m6, m3
-    pandn               m3, m0
-    movh                m0, [srcq+dstq]
-    pand                m6, m1
-    pand                m2, m4
-    punpcklbw           m0, m7
-    paddw               m0, m6
-    paddw               m3, m2
-    paddw               m0, m3
-    pand                m0, [pw_255]
-    mova                m3, m0
-    packuswb            m3, m3
-    movh            [dstq], m3
-    add               dstq, bppq
-    cmp               dstq, endq
-    jle .loop
-
-    mov               dstq, [rsp]
-    dec              cntrq
-    jge .bpp_loop
-    POP               dstq
-    RET
-%endmacro
-
-INIT_MMX mmxext
-ADD_PAETH_PRED_FN 0
-
-INIT_MMX ssse3
-ADD_PAETH_PRED_FN 0
diff --git a/deps/libav/libavcodec/x86/pngdsp_init.c b/deps/libav/libavcodec/x86/pngdsp_init.c
deleted file mode 100644
index 34a3da3..0000000
--- a/deps/libav/libavcodec/x86/pngdsp_init.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * x86 PNG optimizations.
- * Copyright (c) 2008 Loren Merrit <lorenm at u.washington.edu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/pngdsp.h"
-
-void ff_add_png_paeth_prediction_mmxext(uint8_t *dst, uint8_t *src,
-                                        uint8_t *top, int w, int bpp);
-void ff_add_png_paeth_prediction_ssse3(uint8_t *dst, uint8_t *src,
-                                       uint8_t *top, int w, int bpp);
-void ff_add_bytes_l2_mmx (uint8_t *dst, uint8_t *src1,
-                          uint8_t *src2, int w);
-void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1,
-                          uint8_t *src2, int w);
-
-av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-#if ARCH_X86_32
-    if (EXTERNAL_MMX(cpu_flags))
-        dsp->add_bytes_l2         = ff_add_bytes_l2_mmx;
-#endif
-    if (EXTERNAL_MMXEXT(cpu_flags))
-        dsp->add_paeth_prediction = ff_add_png_paeth_prediction_mmxext;
-    if (EXTERNAL_SSE2(cpu_flags))
-        dsp->add_bytes_l2         = ff_add_bytes_l2_sse2;
-    if (EXTERNAL_SSSE3(cpu_flags))
-        dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3;
-}
diff --git a/deps/libav/libavcodec/x86/proresdsp.asm b/deps/libav/libavcodec/x86/proresdsp.asm
deleted file mode 100644
index 855f209..0000000
--- a/deps/libav/libavcodec/x86/proresdsp.asm
+++ /dev/null
@@ -1,428 +0,0 @@
-;******************************************************************************
-;* x86-SIMD-optimized IDCT for prores
-;* this is identical to "simple" IDCT except for the clip range
-;*
-;* Copyright (c) 2011 Ronald S. Bultje <rsbultje at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-%define W1sh2 22725 ; W1 = 90901 = 22725<<2 + 1
-%define W2sh2 21407 ; W2 = 85627 = 21407<<2 - 1
-%define W3sh2 19265 ; W3 = 77062 = 19265<<2 + 2
-%define W4sh2 16384 ; W4 = 65535 = 16384<<2 - 1
-%define W5sh2 12873 ; W5 = 51491 = 12873<<2 - 1
-%define W6sh2  8867 ; W6 = 35468 =  8867<<2
-%define W7sh2  4520 ; W7 = 18081 =  4520<<2 + 1
-
-%if ARCH_X86_64
-
-SECTION_RODATA
-
-w4_plus_w2: times 4 dw W4sh2, +W2sh2
-w4_min_w2:  times 4 dw W4sh2, -W2sh2
-w4_plus_w6: times 4 dw W4sh2, +W6sh2
-w4_min_w6:  times 4 dw W4sh2, -W6sh2
-w1_plus_w3: times 4 dw W1sh2, +W3sh2
-w3_min_w1:  times 4 dw W3sh2, -W1sh2
-w7_plus_w3: times 4 dw W7sh2, +W3sh2
-w3_min_w7:  times 4 dw W3sh2, -W7sh2
-w1_plus_w5: times 4 dw W1sh2, +W5sh2
-w5_min_w1:  times 4 dw W5sh2, -W1sh2
-w5_plus_w7: times 4 dw W5sh2, +W7sh2
-w7_min_w5:  times 4 dw W7sh2, -W5sh2
-row_round:  times 8 dw (1<<14)
-
-cextern pw_4
-cextern pw_8
-cextern pw_512
-cextern pw_1019
-
-section .text align=16
-
-; interleave data while maintaining source
-; %1=type, %2=dstlo, %3=dsthi, %4=src, %5=interleave
-%macro SBUTTERFLY3 5
-    punpckl%1   m%2, m%4, m%5
-    punpckh%1   m%3, m%4, m%5
-%endmacro
-
-; %1/%2=src1/dst1, %3/%4=dst2, %5/%6=src2, %7=shift
-; action: %3/%4 = %1/%2 - %5/%6; %1/%2 += %5/%6
-;         %1/%2/%3/%4 >>= %7; dword -> word (in %1/%3)
-%macro SUMSUB_SHPK 7
-    psubd       %3,  %1,  %5       ; { a0 - b0 }[0-3]
-    psubd       %4,  %2,  %6       ; { a0 - b0 }[4-7]
-    paddd       %1,  %5            ; { a0 + b0 }[0-3]
-    paddd       %2,  %6            ; { a0 + b0 }[4-7]
-    psrad       %1,  %7
-    psrad       %2,  %7
-    psrad       %3,  %7
-    psrad       %4,  %7
-    packssdw    %1,  %2            ; row[0]
-    packssdw    %3,  %4            ; row[7]
-%endmacro
-
-; %1 = row or col (for rounding variable)
-; %2 = number of bits to shift at the end
-%macro IDCT_1D 2
-    ; a0 = (W4 * row[0]) + (1 << (15 - 1));
-    ; a1 = a0;
-    ; a2 = a0;
-    ; a3 = a0;
-    ; a0 += W2 * row[2];
-    ; a1 += W6 * row[2];
-    ; a2 -= W6 * row[2];
-    ; a3 -= W2 * row[2];
-%ifidn %1, col
-    paddw       m10,[pw_8]
-%endif
-    SBUTTERFLY3 wd,  0,  1, 10,  8 ; { row[0], row[2] }[0-3]/[4-7]
-%ifidn %1, row
-    psubw       m10,[row_round]
-%endif
-    SIGNEXTEND  m8,  m9,  m14      ; { row[2] }[0-3] / [4-7]
-    SIGNEXTEND  m10, m11, m14      ; { row[0] }[0-3] / [4-7]
-    pmaddwd     m2,  m0, [w4_plus_w6]
-    pmaddwd     m3,  m1, [w4_plus_w6]
-    pmaddwd     m4,  m0, [w4_min_w6]
-    pmaddwd     m5,  m1, [w4_min_w6]
-    pmaddwd     m6,  m0, [w4_min_w2]
-    pmaddwd     m7,  m1, [w4_min_w2]
-    pmaddwd     m0, [w4_plus_w2]
-    pmaddwd     m1, [w4_plus_w2]
-    pslld       m2,  2
-    pslld       m3,  2
-    pslld       m4,  2
-    pslld       m5,  2
-    pslld       m6,  2
-    pslld       m7,  2
-    pslld       m0,  2
-    pslld       m1,  2
-
-    ; a0: -1*row[0]-1*row[2]
-    ; a1: -1*row[0]
-    ; a2: -1*row[0]
-    ; a3: -1*row[0]+1*row[2]
-    psubd       m2,  m10           ; a1[0-3]
-    psubd       m3,  m11           ; a1[4-7]
-    psubd       m4,  m10           ; a2[0-3]
-    psubd       m5,  m11           ; a2[4-7]
-    psubd       m0,  m10
-    psubd       m1,  m11
-    psubd       m6,  m10
-    psubd       m7,  m11
-    psubd       m0,  m8            ; a0[0-3]
-    psubd       m1,  m9            ; a0[4-7]
-    paddd       m6,  m8            ; a3[0-3]
-    paddd       m7,  m9            ; a3[4-7]
-
-    ; a0 +=   W4*row[4] + W6*row[6]; i.e. -1*row[4]
-    ; a1 -=   W4*row[4] + W2*row[6]; i.e. -1*row[4]-1*row[6]
-    ; a2 -=   W4*row[4] - W2*row[6]; i.e. -1*row[4]+1*row[6]
-    ; a3 +=   W4*row[4] - W6*row[6]; i.e. -1*row[4]
-    SBUTTERFLY3 wd,  8,  9, 13, 12 ; { row[4], row[6] }[0-3]/[4-7]
-    SIGNEXTEND  m13, m14, m10      ; { row[4] }[0-3] / [4-7]
-    pmaddwd     m10, m8, [w4_plus_w6]
-    pmaddwd     m11, m9, [w4_plus_w6]
-    pslld       m10, 2
-    pslld       m11, 2
-    psubd       m10,  m13
-    psubd       m11,  m14
-    paddd       m0,  m10            ; a0[0-3]
-    paddd       m1,  m11            ; a0[4-7]
-    pmaddwd     m10, m8, [w4_min_w6]
-    pmaddwd     m11, m9, [w4_min_w6]
-    pslld       m10, 2
-    pslld       m11, 2
-    psubd       m10, m13
-    psubd       m11, m14
-    paddd       m6,  m10           ; a3[0-3]
-    paddd       m7,  m11           ; a3[4-7]
-    pmaddwd     m10, m8, [w4_min_w2]
-    pmaddwd     m11, m9, [w4_min_w2]
-    pmaddwd     m8, [w4_plus_w2]
-    pmaddwd     m9, [w4_plus_w2]
-    pslld       m10, 2
-    pslld       m11, 2
-    pslld       m8,  2
-    pslld       m9,  2
-    psubd       m10, m13
-    psubd       m11, m14
-    psubd       m8,  m13
-    psubd       m9,  m14
-    psubd       m4,  m10           ; a2[0-3] intermediate
-    psubd       m5,  m11           ; a2[4-7] intermediate
-    psubd       m2,  m8            ; a1[0-3] intermediate
-    psubd       m3,  m9            ; a1[4-7] intermediate
-    SIGNEXTEND  m12, m13, m10      ; { row[6] }[0-3] / [4-7]
-    psubd       m4,  m12           ; a2[0-3]
-    psubd       m5,  m13           ; a2[4-7]
-    paddd       m2,  m12           ; a1[0-3]
-    paddd       m3,  m13           ; a1[4-7]
-
-    ; load/store
-    mova   [r2+  0], m0
-    mova   [r2+ 32], m2
-    mova   [r2+ 64], m4
-    mova   [r2+ 96], m6
-    mova        m10,[r2+ 16]       ; { row[1] }[0-7]
-    mova        m8, [r2+ 48]       ; { row[3] }[0-7]
-    mova        m13,[r2+ 80]       ; { row[5] }[0-7]
-    mova        m14,[r2+112]       ; { row[7] }[0-7]
-    mova   [r2+ 16], m1
-    mova   [r2+ 48], m3
-    mova   [r2+ 80], m5
-    mova   [r2+112], m7
-%ifidn %1, row
-    pmullw      m10,[r3+ 16]
-    pmullw      m8, [r3+ 48]
-    pmullw      m13,[r3+ 80]
-    pmullw      m14,[r3+112]
-%endif
-
-    ; b0 = MUL(W1, row[1]);
-    ; MAC(b0, W3, row[3]);
-    ; b1 = MUL(W3, row[1]);
-    ; MAC(b1, -W7, row[3]);
-    ; b2 = MUL(W5, row[1]);
-    ; MAC(b2, -W1, row[3]);
-    ; b3 = MUL(W7, row[1]);
-    ; MAC(b3, -W5, row[3]);
-    SBUTTERFLY3 wd,  0,  1, 10, 8  ; { row[1], row[3] }[0-3]/[4-7]
-    SIGNEXTEND  m10, m11, m12      ; { row[1] }[0-3] / [4-7]
-    SIGNEXTEND  m8,  m9,  m12      ; { row[3] }[0-3] / [4-7]
-    pmaddwd     m2,  m0, [w3_min_w7]
-    pmaddwd     m3,  m1, [w3_min_w7]
-    pmaddwd     m4,  m0, [w5_min_w1]
-    pmaddwd     m5,  m1, [w5_min_w1]
-    pmaddwd     m6,  m0, [w7_min_w5]
-    pmaddwd     m7,  m1, [w7_min_w5]
-    pmaddwd     m0, [w1_plus_w3]
-    pmaddwd     m1, [w1_plus_w3]
-    pslld       m2,  2
-    pslld       m3,  2
-    pslld       m4,  2
-    pslld       m5,  2
-    pslld       m6,  2
-    pslld       m7,  2
-    pslld       m0,  2
-    pslld       m1,  2
-
-    ; b0: +1*row[1]+2*row[3]
-    ; b1: +2*row[1]-1*row[3]
-    ; b2: -1*row[1]-1*row[3]
-    ; b3: +1*row[1]+1*row[3]
-    psubd       m2,  m8
-    psubd       m3,  m9
-    paddd       m0,  m8
-    paddd       m1,  m9
-    paddd       m8,  m10           ; { row[1] + row[3] }[0-3]
-    paddd       m9,  m11           ; { row[1] + row[3] }[4-7]
-    paddd       m10, m10
-    paddd       m11, m11
-    paddd       m0,  m8            ; b0[0-3]
-    paddd       m1,  m9            ; b0[4-7]
-    paddd       m2,  m10           ; b1[0-3]
-    paddd       m3,  m11           ; b2[4-7]
-    psubd       m4,  m8            ; b2[0-3]
-    psubd       m5,  m9            ; b2[4-7]
-    paddd       m6,  m8            ; b3[0-3]
-    paddd       m7,  m9            ; b3[4-7]
-
-    ; MAC(b0,  W5, row[5]);
-    ; MAC(b0,  W7, row[7]);
-    ; MAC(b1, -W1, row[5]);
-    ; MAC(b1, -W5, row[7]);
-    ; MAC(b2,  W7, row[5]);
-    ; MAC(b2,  W3, row[7]);
-    ; MAC(b3,  W3, row[5]);
-    ; MAC(b3, -W1, row[7]);
-    SBUTTERFLY3 wd,  8,  9, 13, 14 ; { row[5], row[7] }[0-3]/[4-7]
-    SIGNEXTEND  m13, m12, m11      ; { row[5] }[0-3] / [4-7]
-    SIGNEXTEND  m14, m11, m10      ; { row[7] }[0-3] / [4-7]
-
-    ; b0: -1*row[5]+1*row[7]
-    ; b1: -1*row[5]+1*row[7]
-    ; b2: +1*row[5]+2*row[7]
-    ; b3: +2*row[5]-1*row[7]
-    paddd       m4,  m13
-    paddd       m5,  m12
-    paddd       m6,  m13
-    paddd       m7,  m12
-    psubd       m13, m14           ; { row[5] - row[7] }[0-3]
-    psubd       m12, m11           ; { row[5] - row[7] }[4-7]
-    paddd       m14, m14
-    paddd       m11, m11
-    psubd       m0,  m13
-    psubd       m1,  m12
-    psubd       m2,  m13
-    psubd       m3,  m12
-    paddd       m4,  m14
-    paddd       m5,  m11
-    paddd       m6,  m13
-    paddd       m7,  m12
-
-    pmaddwd     m10, m8, [w1_plus_w5]
-    pmaddwd     m11, m9, [w1_plus_w5]
-    pmaddwd     m12, m8, [w5_plus_w7]
-    pmaddwd     m13, m9, [w5_plus_w7]
-    pslld       m10, 2
-    pslld       m11, 2
-    pslld       m12,  2
-    pslld       m13,  2
-    psubd       m2,  m10           ; b1[0-3]
-    psubd       m3,  m11           ; b1[4-7]
-    paddd       m0,  m12            ; b0[0-3]
-    paddd       m1,  m13            ; b0[4-7]
-    pmaddwd     m12, m8, [w7_plus_w3]
-    pmaddwd     m13, m9, [w7_plus_w3]
-    pmaddwd     m8, [w3_min_w1]
-    pmaddwd     m9, [w3_min_w1]
-    pslld       m12, 2
-    pslld       m13, 2
-    pslld       m8,  2
-    pslld       m9,  2
-    paddd       m4,  m12           ; b2[0-3]
-    paddd       m5,  m13           ; b2[4-7]
-    paddd       m6,  m8            ; b3[0-3]
-    paddd       m7,  m9            ; b3[4-7]
-
-    ; row[0] = (a0 + b0) >> 15;
-    ; row[7] = (a0 - b0) >> 15;
-    ; row[1] = (a1 + b1) >> 15;
-    ; row[6] = (a1 - b1) >> 15;
-    ; row[2] = (a2 + b2) >> 15;
-    ; row[5] = (a2 - b2) >> 15;
-    ; row[3] = (a3 + b3) >> 15;
-    ; row[4] = (a3 - b3) >> 15;
-    mova        m8, [r2+ 0]        ; a0[0-3]
-    mova        m9, [r2+16]        ; a0[4-7]
-    SUMSUB_SHPK m8,  m9,  m10, m11, m0,  m1,  %2
-    mova        m0, [r2+32]        ; a1[0-3]
-    mova        m1, [r2+48]        ; a1[4-7]
-    SUMSUB_SHPK m0,  m1,  m9,  m11, m2,  m3,  %2
-    mova        m1, [r2+64]        ; a2[0-3]
-    mova        m2, [r2+80]        ; a2[4-7]
-    SUMSUB_SHPK m1,  m2,  m11, m3,  m4,  m5,  %2
-    mova        m2, [r2+96]        ; a3[0-3]
-    mova        m3, [r2+112]       ; a3[4-7]
-    SUMSUB_SHPK m2,  m3,  m4,  m5,  m6,  m7,  %2
-%endmacro
-
-; void prores_idct_put_10_<opt>(uint8_t *pixels, int stride,
-;                               int16_t *block, const int16_t *qmat);
-%macro idct_put_fn 1
-cglobal prores_idct_put_10, 4, 4, %1
-    movsxd      r1,  r1d
-    pxor        m15, m15           ; zero
-
-    ; for (i = 0; i < 8; i++)
-    ;     idctRowCondDC(block + i*8);
-    mova        m10,[r2+ 0]        ; { row[0] }[0-7]
-    mova        m8, [r2+32]        ; { row[2] }[0-7]
-    mova        m13,[r2+64]        ; { row[4] }[0-7]
-    mova        m12,[r2+96]        ; { row[6] }[0-7]
-
-    pmullw      m10,[r3+ 0]
-    pmullw      m8, [r3+32]
-    pmullw      m13,[r3+64]
-    pmullw      m12,[r3+96]
-
-    IDCT_1D     row, 17
-
-    ; transpose for second part of IDCT
-    TRANSPOSE8x8W 8, 0, 1, 2, 4, 11, 9, 10, 3
-    mova   [r2+ 16], m0
-    mova   [r2+ 48], m2
-    mova   [r2+ 80], m11
-    mova   [r2+112], m10
-    SWAP         8,  10
-    SWAP         1,   8
-    SWAP         4,  13
-    SWAP         9,  12
-
-    ; for (i = 0; i < 8; i++)
-    ;     idctSparseColAdd(dest + i, line_size, block + i);
-    IDCT_1D     col, 20
-
-    ; clip/store
-    mova        m6, [pw_512]
-    mova        m3, [pw_4]
-    mova        m5, [pw_1019]
-    paddw       m8,  m6
-    paddw       m0,  m6
-    paddw       m1,  m6
-    paddw       m2,  m6
-    paddw       m4,  m6
-    paddw       m11, m6
-    paddw       m9,  m6
-    paddw       m10, m6
-    pmaxsw      m8,  m3
-    pmaxsw      m0,  m3
-    pmaxsw      m1,  m3
-    pmaxsw      m2,  m3
-    pmaxsw      m4,  m3
-    pmaxsw      m11, m3
-    pmaxsw      m9,  m3
-    pmaxsw      m10, m3
-    pminsw      m8,  m5
-    pminsw      m0,  m5
-    pminsw      m1,  m5
-    pminsw      m2,  m5
-    pminsw      m4,  m5
-    pminsw      m11, m5
-    pminsw      m9,  m5
-    pminsw      m10, m5
-
-    lea         r2, [r1*3]
-    mova  [r0     ], m8
-    mova  [r0+r1  ], m0
-    mova  [r0+r1*2], m1
-    mova  [r0+r2  ], m2
-    lea         r0, [r0+r1*4]
-    mova  [r0     ], m4
-    mova  [r0+r1  ], m11
-    mova  [r0+r1*2], m9
-    mova  [r0+r2  ], m10
-    RET
-%endmacro
-
-%macro SIGNEXTEND 2-3
-%if cpuflag(sse4) ; dstlow, dsthigh
-    movhlps     %2,  %1
-    pmovsxwd    %1,  %1
-    pmovsxwd    %2,  %2
-%elif cpuflag(sse2) ; dstlow, dsthigh, tmp
-    pxor        %3,  %3
-    pcmpgtw     %3,  %1
-    mova        %2,  %1
-    punpcklwd   %1,  %3
-    punpckhwd   %2,  %3
-%endif
-%endmacro
-
-INIT_XMM sse2
-idct_put_fn 16
-INIT_XMM sse4
-idct_put_fn 16
-INIT_XMM avx
-idct_put_fn 16
-
-%endif
diff --git a/deps/libav/libavcodec/x86/proresdsp_init.c b/deps/libav/libavcodec/x86/proresdsp_init.c
deleted file mode 100644
index d63382c..0000000
--- a/deps/libav/libavcodec/x86/proresdsp_init.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Apple ProRes compatible decoder
- *
- * Copyright (c) 2010-2011 Maxim Poliakovski
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/dsputil.h"
-#include "libavcodec/proresdsp.h"
-
-void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
-                                int16_t *block, const int16_t *qmat);
-void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize,
-                                int16_t *block, const int16_t *qmat);
-void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize,
-                                int16_t *block, const int16_t *qmat);
-
-av_cold void ff_proresdsp_x86_init(ProresDSPContext *dsp)
-{
-#if ARCH_X86_64
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
-        dsp->idct_put = ff_prores_idct_put_10_sse2;
-    }
-
-    if (EXTERNAL_SSE4(cpu_flags)) {
-        dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
-        dsp->idct_put = ff_prores_idct_put_10_sse4;
-    }
-
-    if (EXTERNAL_AVX(cpu_flags)) {
-        dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
-        dsp->idct_put = ff_prores_idct_put_10_avx;
-    }
-#endif /* ARCH_X86_64 */
-}
diff --git a/deps/libav/libavcodec/x86/qpel.asm b/deps/libav/libavcodec/x86/qpel.asm
deleted file mode 100644
index c90b393..0000000
--- a/deps/libav/libavcodec/x86/qpel.asm
+++ /dev/null
@@ -1,176 +0,0 @@
-;******************************************************************************
-;* MMX optimized DSP utils
-;* Copyright (c) 2008 Loren Merritt
-;* Copyright (c) 2003-2013 Michael Niedermayer
-;* Copyright (c) 2013 Daniel Kang
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION .text
-
-%macro op_avgh 3
-    movh   %3, %2
-    pavgb  %1, %3
-    movh   %2, %1
-%endmacro
-
-%macro op_avg 2
-    pavgb  %1, %2
-    mova   %2, %1
-%endmacro
-
-%macro op_puth 2-3
-    movh   %2, %1
-%endmacro
-
-%macro op_put 2
-    mova   %2, %1
-%endmacro
-
-; void pixels4_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-%macro PIXELS4_L2 1
-%define OP op_%1h
-cglobal %1_pixels4_l2, 6,6
-    movsxdifnidn r3, r3d
-    movsxdifnidn r4, r4d
-    test        r5d, 1
-    je        .loop
-    movd         m0, [r1]
-    movd         m1, [r2]
-    add          r1, r4
-    add          r2, 4
-    pavgb        m0, m1
-    OP           m0, [r0], m3
-    add          r0, r3
-    dec         r5d
-.loop:
-    mova         m0, [r1]
-    mova         m1, [r1+r4]
-    lea          r1, [r1+2*r4]
-    pavgb        m0, [r2]
-    pavgb        m1, [r2+4]
-    OP           m0, [r0], m3
-    OP           m1, [r0+r3], m3
-    lea          r0, [r0+2*r3]
-    mova         m0, [r1]
-    mova         m1, [r1+r4]
-    lea          r1, [r1+2*r4]
-    pavgb        m0, [r2+8]
-    pavgb        m1, [r2+12]
-    OP           m0, [r0], m3
-    OP           m1, [r0+r3], m3
-    lea          r0, [r0+2*r3]
-    add          r2, 16
-    sub         r5d, 4
-    jne       .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PIXELS4_L2 put
-PIXELS4_L2 avg
-
-; void pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-%macro PIXELS8_L2 1
-%define OP op_%1
-cglobal %1_pixels8_l2, 6,6
-    movsxdifnidn r3, r3d
-    movsxdifnidn r4, r4d
-    test        r5d, 1
-    je        .loop
-    mova         m0, [r1]
-    mova         m1, [r2]
-    add          r1, r4
-    add          r2, 8
-    pavgb        m0, m1
-    OP           m0, [r0]
-    add          r0, r3
-    dec         r5d
-.loop:
-    mova         m0, [r1]
-    mova         m1, [r1+r4]
-    lea          r1, [r1+2*r4]
-    pavgb        m0, [r2]
-    pavgb        m1, [r2+8]
-    OP           m0, [r0]
-    OP           m1, [r0+r3]
-    lea          r0, [r0+2*r3]
-    mova         m0, [r1]
-    mova         m1, [r1+r4]
-    lea          r1, [r1+2*r4]
-    pavgb        m0, [r2+16]
-    pavgb        m1, [r2+24]
-    OP           m0, [r0]
-    OP           m1, [r0+r3]
-    lea          r0, [r0+2*r3]
-    add          r2, 32
-    sub         r5d, 4
-    jne       .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PIXELS8_L2 put
-PIXELS8_L2 avg
-
-; void pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-%macro PIXELS16_L2 1
-%define OP op_%1
-cglobal %1_pixels16_l2, 6,6
-    movsxdifnidn r3, r3d
-    movsxdifnidn r4, r4d
-    test        r5d, 1
-    je        .loop
-    mova         m0, [r1]
-    mova         m1, [r1+8]
-    pavgb        m0, [r2]
-    pavgb        m1, [r2+8]
-    add          r1, r4
-    add          r2, 16
-    OP           m0, [r0]
-    OP           m1, [r0+8]
-    add          r0, r3
-    dec         r5d
-.loop:
-    mova         m0, [r1]
-    mova         m1, [r1+8]
-    add          r1, r4
-    pavgb        m0, [r2]
-    pavgb        m1, [r2+8]
-    OP           m0, [r0]
-    OP           m1, [r0+8]
-    add          r0, r3
-    mova         m0, [r1]
-    mova         m1, [r1+8]
-    add          r1, r4
-    pavgb        m0, [r2+16]
-    pavgb        m1, [r2+24]
-    OP           m0, [r0]
-    OP           m1, [r0+8]
-    add          r0, r3
-    add          r2, 32
-    sub         r5d, 2
-    jne       .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PIXELS16_L2 put
-PIXELS16_L2 avg
diff --git a/deps/libav/libavcodec/x86/rnd_mmx.c b/deps/libav/libavcodec/x86/rnd_mmx.c
deleted file mode 100644
index db4515a..0000000
--- a/deps/libav/libavcodec/x86/rnd_mmx.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "dsputil_x86.h"
-
-#if HAVE_INLINE_ASM
-
-#define DEF(x, y) ff_ ## x ## _ ## y ## _mmx
-#define SET_RND  MOVQ_WTWO
-#define PAVGBP(a, b, c, d, e, f)        PAVGBP_MMX(a, b, c, d, e, f)
-#define PAVGB(a, b, c, e)               PAVGB_MMX(a, b, c, e)
-#define STATIC
-
-#include "rnd_template.c"
-
-PIXELS16(, ff_avg, , _xy2, _mmx)
-PIXELS16(, ff_put, , _xy2, _mmx)
-
-#endif /* HAVE_INLINE_ASM */
diff --git a/deps/libav/libavcodec/x86/rnd_template.c b/deps/libav/libavcodec/x86/rnd_template.c
deleted file mode 100644
index e9a5a45..0000000
--- a/deps/libav/libavcodec/x86/rnd_template.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * DSP utils mmx functions are compiled twice for rnd/no_rnd
- * Copyright (c) 2000, 2001 Fabrice Bellard
- * Copyright (c) 2003-2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * MMX optimization by Nick Kurshev <nickols_k at mail.ru>
- * mostly rewritten by Michael Niedermayer <michaelni at gmx.at>
- * and improved by Zdenek Kabelac <kabi at users.sf.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-// put_pixels
-STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
-                                  ptrdiff_t line_size, int h)
-{
-    MOVQ_ZERO(mm7);
-    SET_RND(mm6); // =2 for rnd  and  =1 for no_rnd version
-    __asm__ volatile(
-        "movq   (%1), %%mm0             \n\t"
-        "movq   1(%1), %%mm4            \n\t"
-        "movq   %%mm0, %%mm1            \n\t"
-        "movq   %%mm4, %%mm5            \n\t"
-        "punpcklbw %%mm7, %%mm0         \n\t"
-        "punpcklbw %%mm7, %%mm4         \n\t"
-        "punpckhbw %%mm7, %%mm1         \n\t"
-        "punpckhbw %%mm7, %%mm5         \n\t"
-        "paddusw %%mm0, %%mm4           \n\t"
-        "paddusw %%mm1, %%mm5           \n\t"
-        "xor    %%"REG_a", %%"REG_a"    \n\t"
-        "add    %3, %1                  \n\t"
-        ".p2align 3                     \n\t"
-        "1:                             \n\t"
-        "movq   (%1, %%"REG_a"), %%mm0  \n\t"
-        "movq   1(%1, %%"REG_a"), %%mm2 \n\t"
-        "movq   %%mm0, %%mm1            \n\t"
-        "movq   %%mm2, %%mm3            \n\t"
-        "punpcklbw %%mm7, %%mm0         \n\t"
-        "punpcklbw %%mm7, %%mm2         \n\t"
-        "punpckhbw %%mm7, %%mm1         \n\t"
-        "punpckhbw %%mm7, %%mm3         \n\t"
-        "paddusw %%mm2, %%mm0           \n\t"
-        "paddusw %%mm3, %%mm1           \n\t"
-        "paddusw %%mm6, %%mm4           \n\t"
-        "paddusw %%mm6, %%mm5           \n\t"
-        "paddusw %%mm0, %%mm4           \n\t"
-        "paddusw %%mm1, %%mm5           \n\t"
-        "psrlw  $2, %%mm4               \n\t"
-        "psrlw  $2, %%mm5               \n\t"
-        "packuswb  %%mm5, %%mm4         \n\t"
-        "movq   %%mm4, (%2, %%"REG_a")  \n\t"
-        "add    %3, %%"REG_a"           \n\t"
-
-        "movq   (%1, %%"REG_a"), %%mm2  \n\t" // 0 <-> 2   1 <-> 3
-        "movq   1(%1, %%"REG_a"), %%mm4 \n\t"
-        "movq   %%mm2, %%mm3            \n\t"
-        "movq   %%mm4, %%mm5            \n\t"
-        "punpcklbw %%mm7, %%mm2         \n\t"
-        "punpcklbw %%mm7, %%mm4         \n\t"
-        "punpckhbw %%mm7, %%mm3         \n\t"
-        "punpckhbw %%mm7, %%mm5         \n\t"
-        "paddusw %%mm2, %%mm4           \n\t"
-        "paddusw %%mm3, %%mm5           \n\t"
-        "paddusw %%mm6, %%mm0           \n\t"
-        "paddusw %%mm6, %%mm1           \n\t"
-        "paddusw %%mm4, %%mm0           \n\t"
-        "paddusw %%mm5, %%mm1           \n\t"
-        "psrlw  $2, %%mm0               \n\t"
-        "psrlw  $2, %%mm1               \n\t"
-        "packuswb  %%mm1, %%mm0         \n\t"
-        "movq   %%mm0, (%2, %%"REG_a")  \n\t"
-        "add    %3, %%"REG_a"           \n\t"
-
-        "subl   $2, %0                  \n\t"
-        "jnz    1b                      \n\t"
-        :"+g"(h), "+S"(pixels)
-        :"D"(block), "r"((x86_reg)line_size)
-        :REG_a, "memory");
-}
-
-// avg_pixels
-// this routine is 'slightly' suboptimal but mostly unused
-STATIC void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
-                                  ptrdiff_t line_size, int h)
-{
-    MOVQ_ZERO(mm7);
-    SET_RND(mm6); // =2 for rnd  and  =1 for no_rnd version
-    __asm__ volatile(
-        "movq   (%1), %%mm0             \n\t"
-        "movq   1(%1), %%mm4            \n\t"
-        "movq   %%mm0, %%mm1            \n\t"
-        "movq   %%mm4, %%mm5            \n\t"
-        "punpcklbw %%mm7, %%mm0         \n\t"
-        "punpcklbw %%mm7, %%mm4         \n\t"
-        "punpckhbw %%mm7, %%mm1         \n\t"
-        "punpckhbw %%mm7, %%mm5         \n\t"
-        "paddusw %%mm0, %%mm4           \n\t"
-        "paddusw %%mm1, %%mm5           \n\t"
-        "xor    %%"REG_a", %%"REG_a"    \n\t"
-        "add    %3, %1                  \n\t"
-        ".p2align 3                     \n\t"
-        "1:                             \n\t"
-        "movq   (%1, %%"REG_a"), %%mm0  \n\t"
-        "movq   1(%1, %%"REG_a"), %%mm2 \n\t"
-        "movq   %%mm0, %%mm1            \n\t"
-        "movq   %%mm2, %%mm3            \n\t"
-        "punpcklbw %%mm7, %%mm0         \n\t"
-        "punpcklbw %%mm7, %%mm2         \n\t"
-        "punpckhbw %%mm7, %%mm1         \n\t"
-        "punpckhbw %%mm7, %%mm3         \n\t"
-        "paddusw %%mm2, %%mm0           \n\t"
-        "paddusw %%mm3, %%mm1           \n\t"
-        "paddusw %%mm6, %%mm4           \n\t"
-        "paddusw %%mm6, %%mm5           \n\t"
-        "paddusw %%mm0, %%mm4           \n\t"
-        "paddusw %%mm1, %%mm5           \n\t"
-        "psrlw  $2, %%mm4               \n\t"
-        "psrlw  $2, %%mm5               \n\t"
-                "movq   (%2, %%"REG_a"), %%mm3  \n\t"
-        "packuswb  %%mm5, %%mm4         \n\t"
-                "pcmpeqd %%mm2, %%mm2   \n\t"
-                "paddb %%mm2, %%mm2     \n\t"
-                PAVGB_MMX(%%mm3, %%mm4, %%mm5, %%mm2)
-                "movq   %%mm5, (%2, %%"REG_a")  \n\t"
-        "add    %3, %%"REG_a"                \n\t"
-
-        "movq   (%1, %%"REG_a"), %%mm2  \n\t" // 0 <-> 2   1 <-> 3
-        "movq   1(%1, %%"REG_a"), %%mm4 \n\t"
-        "movq   %%mm2, %%mm3            \n\t"
-        "movq   %%mm4, %%mm5            \n\t"
-        "punpcklbw %%mm7, %%mm2         \n\t"
-        "punpcklbw %%mm7, %%mm4         \n\t"
-        "punpckhbw %%mm7, %%mm3         \n\t"
-        "punpckhbw %%mm7, %%mm5         \n\t"
-        "paddusw %%mm2, %%mm4           \n\t"
-        "paddusw %%mm3, %%mm5           \n\t"
-        "paddusw %%mm6, %%mm0           \n\t"
-        "paddusw %%mm6, %%mm1           \n\t"
-        "paddusw %%mm4, %%mm0           \n\t"
-        "paddusw %%mm5, %%mm1           \n\t"
-        "psrlw  $2, %%mm0               \n\t"
-        "psrlw  $2, %%mm1               \n\t"
-                "movq   (%2, %%"REG_a"), %%mm3  \n\t"
-        "packuswb  %%mm1, %%mm0         \n\t"
-                "pcmpeqd %%mm2, %%mm2   \n\t"
-                "paddb %%mm2, %%mm2     \n\t"
-                PAVGB_MMX(%%mm3, %%mm0, %%mm1, %%mm2)
-                "movq   %%mm1, (%2, %%"REG_a")  \n\t"
-        "add    %3, %%"REG_a"           \n\t"
-
-        "subl   $2, %0                  \n\t"
-        "jnz    1b                      \n\t"
-        :"+g"(h), "+S"(pixels)
-        :"D"(block), "r"((x86_reg)line_size)
-        :REG_a, "memory");
-}
diff --git a/deps/libav/libavcodec/x86/rv34dsp.asm b/deps/libav/libavcodec/x86/rv34dsp.asm
deleted file mode 100644
index 4d9c35b..0000000
--- a/deps/libav/libavcodec/x86/rv34dsp.asm
+++ /dev/null
@@ -1,196 +0,0 @@
-;******************************************************************************
-;* MMX/SSE2-optimized functions for the RV30 and RV40 decoders
-;* Copyright (C) 2012 Christophe Gisquet <christophe.gisquet at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-pw_row_coeffs:  times 4 dw 13
-                times 4 dw 17
-                times 4 dw  7
-pd_512: times 2 dd 0x200
-pw_col_coeffs:  dw 13,  13,  13, -13
-                dw 17,   7,   7, -17
-                dw 13, -13,  13,  13
-                dw -7,  17, -17,  -7
-
-SECTION .text
-
-%macro IDCT_DC_NOROUND 1
-    imul   %1, 13*13*3
-    sar    %1, 11
-%endmacro
-
-%macro IDCT_DC_ROUND 1
-    imul   %1, 13*13
-    add    %1, 0x200
-    sar    %1, 10
-%endmacro
-
-%macro rv34_idct 1
-cglobal rv34_idct_%1, 1, 2, 0
-    movsx   r1, word [r0]
-    IDCT_DC r1
-    movd    m0, r1d
-    pshufw  m0, m0, 0
-    movq    [r0+ 0], m0
-    movq    [r0+ 8], m0
-    movq    [r0+16], m0
-    movq    [r0+24], m0
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-%define IDCT_DC IDCT_DC_ROUND
-rv34_idct dc
-%define IDCT_DC IDCT_DC_NOROUND
-rv34_idct dc_noround
-
-; ff_rv34_idct_dc_add_mmx(uint8_t *dst, int stride, int dc);
-INIT_MMX mmx
-cglobal rv34_idct_dc_add, 3, 3
-    ; calculate DC
-    IDCT_DC_ROUND r2
-    pxor       m1, m1
-    movd       m0, r2d
-    psubw      m1, m0
-    packuswb   m0, m0
-    packuswb   m1, m1
-    punpcklbw  m0, m0
-    punpcklbw  m1, m1
-    punpcklwd  m0, m0
-    punpcklwd  m1, m1
-
-    ; add DC
-    lea        r2, [r0+r1*2]
-    movh       m2, [r0]
-    movh       m3, [r0+r1]
-    movh       m4, [r2]
-    movh       m5, [r2+r1]
-    paddusb    m2, m0
-    paddusb    m3, m0
-    paddusb    m4, m0
-    paddusb    m5, m0
-    psubusb    m2, m1
-    psubusb    m3, m1
-    psubusb    m4, m1
-    psubusb    m5, m1
-    movh       [r0], m2
-    movh       [r0+r1], m3
-    movh       [r2], m4
-    movh       [r2+r1], m5
-    RET
-
-; Load coeffs and perform row transform
-; Output: coeffs in mm[0467], rounder in mm5
-%macro ROW_TRANSFORM  1
-    pxor        mm7, mm7
-    mova        mm0, [%1+ 0*8]
-    mova        mm1, [%1+ 1*8]
-    mova        mm2, [%1+ 2*8]
-    mova        mm3, [%1+ 3*8]
-    mova  [%1+ 0*8], mm7
-    mova  [%1+ 1*8], mm7
-    mova  [%1+ 2*8], mm7
-    mova  [%1+ 3*8], mm7
-    mova        mm4, mm0
-    mova        mm6, [pw_row_coeffs+ 0]
-    paddsw      mm0, mm2                ; b0 + b2
-    psubsw      mm4, mm2                ; b0 - b2
-    pmullw      mm0, mm6                ; *13 = z0
-    pmullw      mm4, mm6                ; *13 = z1
-    mova        mm5, mm1
-    pmullw      mm1, [pw_row_coeffs+ 8] ; b1*17
-    pmullw      mm5, [pw_row_coeffs+16] ; b1* 7
-    mova        mm7, mm3
-    pmullw      mm3, [pw_row_coeffs+ 8] ; b3*17
-    pmullw      mm7, [pw_row_coeffs+16] ; b3* 7
-    paddsw      mm1, mm7                ; z3 = b1*17 + b3* 7
-    psubsw      mm5, mm3                ; z2 = b1* 7 - b3*17
-    mova        mm7, mm0
-    mova        mm6, mm4
-    paddsw      mm0, mm1                ; z0 + z3
-    psubsw      mm7, mm1                ; z0 - z3
-    paddsw      mm4, mm5                ; z1 + z2
-    psubsw      mm6, mm5                ; z1 - z2
-    mova        mm5, [pd_512]           ; 0x200
-%endmacro
-
-; ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block);
-%macro COL_TRANSFORM  4
-    pshufw      mm3, %2, 0xDD        ; col. 1,3,1,3
-    pshufw       %2, %2, 0x88        ; col. 0,2,0,2
-    pmaddwd      %2, %3              ; 13*c0+13*c2 | 13*c0-13*c2 = z0 | z1
-    pmaddwd     mm3, %4              ; 17*c1+ 7*c3 |  7*c1-17*c3 = z3 | z2
-    paddd        %2, mm5
-    pshufw      mm1,  %2, 01001110b  ;    z1 | z0
-    pshufw      mm2, mm3, 01001110b  ;    z2 | z3
-    paddd        %2, mm3             ; z0+z3 | z1+z2
-    psubd       mm1, mm2             ; z1-z2 | z0-z3
-    movd        mm3, %1
-    psrad        %2, 10
-    pxor        mm2, mm2
-    psrad       mm1, 10
-    punpcklbw   mm3, mm2
-    packssdw     %2, mm1
-    paddw        %2, mm3
-    packuswb     %2, %2
-    movd         %1, %2
-%endmacro
-INIT_MMX mmxext
-cglobal rv34_idct_add, 3,3,0, d, s, b
-    ROW_TRANSFORM       bq
-    COL_TRANSFORM     [dq], mm0, [pw_col_coeffs+ 0], [pw_col_coeffs+ 8]
-    mova               mm0, [pw_col_coeffs+ 0]
-    COL_TRANSFORM  [dq+sq], mm4, mm0, [pw_col_coeffs+ 8]
-    mova               mm4, [pw_col_coeffs+ 8]
-    lea                 dq, [dq + 2*sq]
-    COL_TRANSFORM     [dq], mm6, mm0, mm4
-    COL_TRANSFORM  [dq+sq], mm7, mm0, mm4
-    ret
-
-; ff_rv34_idct_dc_add_sse4(uint8_t *dst, int stride, int dc);
-INIT_XMM sse4
-cglobal rv34_idct_dc_add, 3, 3, 6
-    ; load data
-    IDCT_DC_ROUND r2
-    pxor       m1, m1
-
-    ; calculate DC
-    movd       m0, r2d
-    lea        r2, [r0+r1*2]
-    movd       m2, [r0]
-    movd       m3, [r0+r1]
-    pshuflw    m0, m0, 0
-    movd       m4, [r2]
-    movd       m5, [r2+r1]
-    punpcklqdq m0, m0
-    punpckldq  m2, m3
-    punpckldq  m4, m5
-    punpcklbw  m2, m1
-    punpcklbw  m4, m1
-    paddw      m2, m0
-    paddw      m4, m0
-    packuswb   m2, m4
-    movd      [r0], m2
-    pextrd [r0+r1], m2, 1
-    pextrd    [r2], m2, 2
-    pextrd [r2+r1], m2, 3
-    RET
diff --git a/deps/libav/libavcodec/x86/rv34dsp_init.c b/deps/libav/libavcodec/x86/rv34dsp_init.c
deleted file mode 100644
index 586e4e9..0000000
--- a/deps/libav/libavcodec/x86/rv34dsp_init.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * RV30/40 MMX/SSE2 optimizations
- * Copyright (C) 2012 Christophe Gisquet <christophe.gisquet at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/rv34dsp.h"
-
-void ff_rv34_idct_dc_mmxext(int16_t *block);
-void ff_rv34_idct_dc_noround_mmxext(int16_t *block);
-void ff_rv34_idct_dc_add_mmx(uint8_t *dst, ptrdiff_t stride, int dc);
-void ff_rv34_idct_dc_add_sse4(uint8_t *dst, ptrdiff_t stride, int dc);
-void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block);
-
-av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_MMX(cpu_flags))
-        c->rv34_idct_dc_add = ff_rv34_idct_dc_add_mmx;
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        c->rv34_inv_transform_dc = ff_rv34_idct_dc_noround_mmxext;
-        c->rv34_idct_add         = ff_rv34_idct_add_mmxext;
-    }
-    if (EXTERNAL_SSE4(cpu_flags))
-        c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;
-}
diff --git a/deps/libav/libavcodec/x86/rv40dsp.asm b/deps/libav/libavcodec/x86/rv40dsp.asm
deleted file mode 100644
index d12b079..0000000
--- a/deps/libav/libavcodec/x86/rv40dsp.asm
+++ /dev/null
@@ -1,501 +0,0 @@
-;******************************************************************************
-;* MMX/SSE2-optimized functions for the RV40 decoder
-;* Copyright (c) 2010 Ronald S. Bultje <rsbultje at gmail.com>
-;* Copyright (c) 2010 Jason Garrett-Glaser <darkshikari at gmail.com>
-;* Copyright (C) 2012 Christophe Gisquet <christophe.gisquet at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-align 16
-pw_1024:   times 8 dw 1 << (16 - 6) ; pw_1024
-
-sixtap_filter_hb_m:  times 8 db   1, -5
-                     times 8 db  52, 20
-                     ; multiplied by 2 to have the same shift
-                     times 8 db   2, -10
-                     times 8 db  40,  40
-                     ; back to normal
-                     times 8 db   1, -5
-                     times 8 db  20, 52
-
-sixtap_filter_v_m:   times 8 dw   1
-                     times 8 dw  -5
-                     times 8 dw  52
-                     times 8 dw  20
-                     ; multiplied by 2 to have the same shift
-                     times 8 dw   2
-                     times 8 dw -10
-                     times 8 dw  40
-                     times 8 dw  40
-                     ; back to normal
-                     times 8 dw   1
-                     times 8 dw  -5
-                     times 8 dw  20
-                     times 8 dw  52
-
-%ifdef PIC
-%define sixtap_filter_hw   picregq
-%define sixtap_filter_hb   picregq
-%define sixtap_filter_v    picregq
-%define npicregs 1
-%else
-%define sixtap_filter_hw   sixtap_filter_hw_m
-%define sixtap_filter_hb   sixtap_filter_hb_m
-%define sixtap_filter_v    sixtap_filter_v_m
-%define npicregs 0
-%endif
-
-filter_h6_shuf1: db 0, 1, 1, 2, 2, 3, 3, 4, 4, 5,  5, 6,  6,  7,  7,  8
-filter_h6_shuf2: db 2, 3, 3, 4, 4, 5, 5, 6, 6, 7,  7, 8,  8,  9,  9, 10
-filter_h6_shuf3: db 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11
-
-cextern  pw_32
-cextern  pw_16
-cextern  pw_512
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; subpel MC functions:
-;
-; void [put|rv40]_rv40_qpel_[h|v]_<opt>(uint8_t *dst, int deststride,
-;                                       uint8_t *src, int srcstride,
-;                                       int len, int m);
-;----------------------------------------------------------------------
-%macro LOAD  2
-%if WIN64
-   movsxd   %1q, %1d
-%endif
-%ifdef PIC
-   add      %1q, picregq
-%else
-   add      %1q, %2
-%endif
-%endmacro
-
-%macro STORE 3
-%ifidn %3, avg
-    movh      %2, [dstq]
-%endif
-    packuswb  %1, %1
-%ifidn %3, avg
-    PAVGB     %1, %2
-%endif
-    movh  [dstq], %1
-%endmacro
-
-%macro FILTER_V 1
-cglobal %1_rv40_qpel_v, 6,6+npicregs,12, dst, dststride, src, srcstride, height, my, picreg
-%ifdef PIC
-    lea  picregq, [sixtap_filter_v_m]
-%endif
-    pxor      m7, m7
-    LOAD      my, sixtap_filter_v
-
-    ; read 5 lines
-    sub     srcq, srcstrideq
-    sub     srcq, srcstrideq
-    movh      m0, [srcq]
-    movh      m1, [srcq+srcstrideq]
-    movh      m2, [srcq+srcstrideq*2]
-    lea     srcq, [srcq+srcstrideq*2]
-    add     srcq, srcstrideq
-    movh      m3, [srcq]
-    movh      m4, [srcq+srcstrideq]
-    punpcklbw m0, m7
-    punpcklbw m1, m7
-    punpcklbw m2, m7
-    punpcklbw m3, m7
-    punpcklbw m4, m7
-
-%ifdef m8
-    mova      m8, [myq+ 0]
-    mova      m9, [myq+16]
-    mova     m10, [myq+32]
-    mova     m11, [myq+48]
-%define COEFF05  m8
-%define COEFF14  m9
-%define COEFF2   m10
-%define COEFF3   m11
-%else
-%define COEFF05  [myq+ 0]
-%define COEFF14  [myq+16]
-%define COEFF2   [myq+32]
-%define COEFF3   [myq+48]
-%endif
-.nextrow:
-    mova      m6, m1
-    movh      m5, [srcq+2*srcstrideq]      ; read new row
-    paddw     m6, m4
-    punpcklbw m5, m7
-    pmullw    m6, COEFF14
-    paddw     m0, m5
-    pmullw    m0, COEFF05
-    paddw     m6, m0
-    mova      m0, m1
-    paddw     m6, [pw_32]
-    mova      m1, m2
-    pmullw    m2, COEFF2
-    paddw     m6, m2
-    mova      m2, m3
-    pmullw    m3, COEFF3
-    paddw     m6, m3
-
-    ; round/clip/store
-    mova      m3, m4
-    psraw     m6, 6
-    mova      m4, m5
-    STORE     m6, m5, %1
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec  heightd                           ; next row
-    jg .nextrow
-    REP_RET
-%endmacro
-
-%macro FILTER_H  1
-cglobal %1_rv40_qpel_h, 6, 6+npicregs, 12, dst, dststride, src, srcstride, height, mx, picreg
-%ifdef PIC
-    lea  picregq, [sixtap_filter_v_m]
-%endif
-    pxor      m7, m7
-    LOAD      mx, sixtap_filter_v
-    mova      m6, [pw_32]
-%ifdef m8
-    mova      m8, [mxq+ 0]
-    mova      m9, [mxq+16]
-    mova     m10, [mxq+32]
-    mova     m11, [mxq+48]
-%define COEFF05  m8
-%define COEFF14  m9
-%define COEFF2   m10
-%define COEFF3   m11
-%else
-%define COEFF05  [mxq+ 0]
-%define COEFF14  [mxq+16]
-%define COEFF2   [mxq+32]
-%define COEFF3   [mxq+48]
-%endif
-.nextrow:
-    movq      m0, [srcq-2]
-    movq      m5, [srcq+3]
-    movq      m1, [srcq-1]
-    movq      m4, [srcq+2]
-    punpcklbw m0, m7
-    punpcklbw m5, m7
-    punpcklbw m1, m7
-    punpcklbw m4, m7
-    movq      m2, [srcq-0]
-    movq      m3, [srcq+1]
-    paddw     m0, m5
-    paddw     m1, m4
-    punpcklbw m2, m7
-    punpcklbw m3, m7
-    pmullw    m0, COEFF05
-    pmullw    m1, COEFF14
-    pmullw    m2, COEFF2
-    pmullw    m3, COEFF3
-    paddw     m0, m6
-    paddw     m1, m2
-    paddw     m0, m3
-    paddw     m0, m1
-    psraw     m0, 6
-    STORE     m0, m1, %1
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec  heightd            ; next row
-    jg .nextrow
-    REP_RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX  mmx
-FILTER_V  put
-FILTER_H  put
-
-INIT_MMX  mmxext
-FILTER_V  avg
-FILTER_H  avg
-
-INIT_MMX  3dnow
-FILTER_V  avg
-FILTER_H  avg
-%endif
-
-INIT_XMM  sse2
-FILTER_H  put
-FILTER_H  avg
-FILTER_V  put
-FILTER_V  avg
-
-%macro FILTER_SSSE3 1
-cglobal %1_rv40_qpel_v, 6,6+npicregs,8, dst, dststride, src, srcstride, height, my, picreg
-%ifdef PIC
-    lea  picregq, [sixtap_filter_hb_m]
-%endif
-
-    ; read 5 lines
-    sub     srcq, srcstrideq
-    LOAD      my, sixtap_filter_hb
-    sub     srcq, srcstrideq
-    movh      m0, [srcq]
-    movh      m1, [srcq+srcstrideq]
-    movh      m2, [srcq+srcstrideq*2]
-    lea     srcq, [srcq+srcstrideq*2]
-    add     srcq, srcstrideq
-    mova      m5, [myq]
-    movh      m3, [srcq]
-    movh      m4, [srcq+srcstrideq]
-    lea     srcq, [srcq+2*srcstrideq]
-
-.nextrow:
-    mova      m6, m2
-    punpcklbw m0, m1
-    punpcklbw m6, m3
-    pmaddubsw m0, m5
-    pmaddubsw m6, [myq+16]
-    movh      m7, [srcq]      ; read new row
-    paddw     m6, m0
-    mova      m0, m1
-    mova      m1, m2
-    mova      m2, m3
-    mova      m3, m4
-    mova      m4, m7
-    punpcklbw m7, m3
-    pmaddubsw m7, m5
-    paddw     m6, m7
-    pmulhrsw  m6, [pw_512]
-    STORE     m6, m7, %1
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec       heightd                          ; next row
-    jg       .nextrow
-    REP_RET
-
-cglobal %1_rv40_qpel_h, 6,6+npicregs,8, dst, dststride, src, srcstride, height, mx, picreg
-%ifdef PIC
-    lea  picregq, [sixtap_filter_hb_m]
-%endif
-    mova      m3, [filter_h6_shuf2]
-    mova      m4, [filter_h6_shuf3]
-    LOAD      mx, sixtap_filter_hb
-    mova      m5, [mxq] ; set up 6tap filter in bytes
-    mova      m6, [mxq+16]
-    mova      m7, [filter_h6_shuf1]
-
-.nextrow:
-    movu      m0, [srcq-2]
-    mova      m1, m0
-    mova      m2, m0
-    pshufb    m0, m7
-    pshufb    m1, m3
-    pshufb    m2, m4
-    pmaddubsw m0, m5
-    pmaddubsw m1, m6
-    pmaddubsw m2, m5
-    paddw     m0, m1
-    paddw     m0, m2
-    pmulhrsw  m0, [pw_512]
-    STORE     m0, m1, %1
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec  heightd            ; next row
-    jg .nextrow
-    REP_RET
-%endmacro
-
-INIT_XMM ssse3
-FILTER_SSSE3  put
-FILTER_SSSE3  avg
-
-; %1=5bits weights?, %2=dst %3=src1 %4=src3 %5=stride if sse2
-%macro RV40_WCORE  4-5
-    movh       m4, [%3 + r6 + 0]
-    movh       m5, [%4 + r6 + 0]
-%if %0 == 4
-%define OFFSET r6 + mmsize / 2
-%else
-    ; 8x8 block and sse2, stride was provided
-%define OFFSET r6
-    add        r6, r5
-%endif
-    movh       m6, [%3 + OFFSET]
-    movh       m7, [%4 + OFFSET]
-
-%if %1 == 0
-    ; 14bits weights
-    punpcklbw  m4, m0
-    punpcklbw  m5, m0
-    punpcklbw  m6, m0
-    punpcklbw  m7, m0
-
-    psllw      m4, 7
-    psllw      m5, 7
-    psllw      m6, 7
-    psllw      m7, 7
-    pmulhw     m4, m3
-    pmulhw     m5, m2
-    pmulhw     m6, m3
-    pmulhw     m7, m2
-
-    paddw      m4, m5
-    paddw      m6, m7
-%else
-    ; 5bits weights
-%if cpuflag(ssse3)
-    punpcklbw  m4, m5
-    punpcklbw  m6, m7
-
-    pmaddubsw  m4, m3
-    pmaddubsw  m6, m3
-%else
-    punpcklbw  m4, m0
-    punpcklbw  m5, m0
-    punpcklbw  m6, m0
-    punpcklbw  m7, m0
-
-    pmullw     m4, m3
-    pmullw     m5, m2
-    pmullw     m6, m3
-    pmullw     m7, m2
-    paddw      m4, m5
-    paddw      m6, m7
-%endif
-
-%endif
-
-    ; bias and shift down
-%if cpuflag(ssse3)
-    pmulhrsw   m4, m1
-    pmulhrsw   m6, m1
-%else
-    paddw      m4, m1
-    paddw      m6, m1
-    psrlw      m4, 5
-    psrlw      m6, 5
-%endif
-
-    packuswb   m4, m6
-%if %0 == 5
-    ; Only called for 8x8 blocks and sse2
-    sub        r6, r5
-    movh       [%2 + r6], m4
-    add        r6, r5
-    movhps     [%2 + r6], m4
-%else
-    mova       [%2 + r6], m4
-%endif
-%endmacro
-
-
-%macro MAIN_LOOP   2
-%if mmsize == 8
-    RV40_WCORE %2, r0, r1, r2
-%if %1 == 16
-    RV40_WCORE %2, r0 + 8, r1 + 8, r2 + 8
-%endif
-
-    ; Prepare for next loop
-    add        r6, r5
-%else
-%ifidn %1, 8
-    RV40_WCORE %2, r0, r1, r2, r5
-    ; Prepare 2 next lines
-    add        r6, r5
-%else
-    RV40_WCORE %2, r0, r1, r2
-    ; Prepare single next line
-    add        r6, r5
-%endif
-%endif
-
-%endmacro
-
-; rv40_weight_func_%1(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, int stride)
-; %1=size  %2=num of xmm regs
-; The weights are FP0.14 notation of fractions depending on pts.
-; For timebases without rounding error (i.e. PAL), the fractions
-; can be simplified, and several operations can be avoided.
-; Therefore, we check here whether they are multiples of 2^9 for
-; those simplifications to occur.
-%macro RV40_WEIGHT  3
-cglobal rv40_weight_func_%1_%2, 6, 7, 8
-%if cpuflag(ssse3)
-    mova       m1, [pw_1024]
-%else
-    mova       m1, [pw_16]
-%endif
-    pxor       m0, m0
-    ; Set loop counter and increments
-    mov        r6, r5
-    shl        r6, %3
-    add        r0, r6
-    add        r1, r6
-    add        r2, r6
-    neg        r6
-
-    movd       m2, r3d
-    movd       m3, r4d
-%ifidn %1,rnd
-%define  RND   0
-    SPLATW     m2, m2
-%else
-%define  RND   1
-%if cpuflag(ssse3)
-    punpcklbw  m3, m2
-%else
-    SPLATW     m2, m2
-%endif
-%endif
-    SPLATW     m3, m3
-
-.loop:
-    MAIN_LOOP  %2, RND
-    jnz        .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-RV40_WEIGHT   rnd,    8, 3
-RV40_WEIGHT   rnd,   16, 4
-RV40_WEIGHT   nornd,  8, 3
-RV40_WEIGHT   nornd, 16, 4
-
-INIT_XMM sse2
-RV40_WEIGHT   rnd,    8, 3
-RV40_WEIGHT   rnd,   16, 4
-RV40_WEIGHT   nornd,  8, 3
-RV40_WEIGHT   nornd, 16, 4
-
-INIT_XMM ssse3
-RV40_WEIGHT   rnd,    8, 3
-RV40_WEIGHT   rnd,   16, 4
-RV40_WEIGHT   nornd,  8, 3
-RV40_WEIGHT   nornd, 16, 4
diff --git a/deps/libav/libavcodec/x86/rv40dsp_init.c b/deps/libav/libavcodec/x86/rv40dsp_init.c
deleted file mode 100644
index 781f467..0000000
--- a/deps/libav/libavcodec/x86/rv40dsp_init.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * RV40 decoder motion compensation functions x86-optimised
- * Copyright (c) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RV40 decoder motion compensation functions x86-optimised
- * 2,0 and 0,2 have h264 equivalents.
- * 3,3 is bugged in the rv40 format and maps to _xy2 version
- */
-
-#include "libavcodec/rv34dsp.h"
-#include "libavutil/attributes.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/cpu.h"
-#include "dsputil_x86.h"
-
-#if HAVE_YASM
-void ff_put_rv40_chroma_mc8_mmx  (uint8_t *dst, uint8_t *src,
-                                  int stride, int h, int x, int y);
-void ff_avg_rv40_chroma_mc8_mmxext(uint8_t *dst, uint8_t *src,
-                                   int stride, int h, int x, int y);
-void ff_avg_rv40_chroma_mc8_3dnow(uint8_t *dst, uint8_t *src,
-                                  int stride, int h, int x, int y);
-
-void ff_put_rv40_chroma_mc4_mmx  (uint8_t *dst, uint8_t *src,
-                                  int stride, int h, int x, int y);
-void ff_avg_rv40_chroma_mc4_mmxext(uint8_t *dst, uint8_t *src,
-                                   int stride, int h, int x, int y);
-void ff_avg_rv40_chroma_mc4_3dnow(uint8_t *dst, uint8_t *src,
-                                  int stride, int h, int x, int y);
-
-#define DECLARE_WEIGHT(opt) \
-void ff_rv40_weight_func_rnd_16_##opt(uint8_t *dst, uint8_t *src1, uint8_t *src2, \
-                                      int w1, int w2, ptrdiff_t stride); \
-void ff_rv40_weight_func_rnd_8_##opt (uint8_t *dst, uint8_t *src1, uint8_t *src2, \
-                                      int w1, int w2, ptrdiff_t stride); \
-void ff_rv40_weight_func_nornd_16_##opt(uint8_t *dst, uint8_t *src1, uint8_t *src2, \
-                                        int w1, int w2, ptrdiff_t stride); \
-void ff_rv40_weight_func_nornd_8_##opt (uint8_t *dst, uint8_t *src1, uint8_t *src2, \
-                                        int w1, int w2, ptrdiff_t stride);
-DECLARE_WEIGHT(mmxext)
-DECLARE_WEIGHT(sse2)
-DECLARE_WEIGHT(ssse3)
-
-/** @{ */
-/**
- * Define one qpel function.
- * LOOPSIZE must be already set to the number of pixels processed per
- * iteration in the inner loop of the called functions.
- * COFF(x) must be already defined so as to provide the offset into any
- * array of coeffs used by the called function for the qpel position x.
- */
-#define QPEL_FUNC_DECL(OP, SIZE, PH, PV, OPT)                           \
-static void OP ## rv40_qpel ##SIZE ##_mc ##PH ##PV ##OPT(uint8_t *dst,  \
-                                                         uint8_t *src,  \
-                                                         ptrdiff_t stride)  \
-{                                                                       \
-    int i;                                                              \
-    if (PH && PV) {                                                     \
-        DECLARE_ALIGNED(16, uint8_t, tmp)[SIZE * (SIZE + 5)];           \
-        uint8_t *tmpptr = tmp + SIZE * 2;                               \
-        src -= stride * 2;                                              \
-                                                                        \
-        for (i = 0; i < SIZE; i += LOOPSIZE)                            \
-            ff_put_rv40_qpel_h ##OPT(tmp + i, SIZE, src + i, stride,    \
-                                     SIZE + 5, HCOFF(PH));              \
-        for (i = 0; i < SIZE; i += LOOPSIZE)                            \
-            ff_ ##OP ##rv40_qpel_v ##OPT(dst + i, stride, tmpptr + i,   \
-                                         SIZE, SIZE, VCOFF(PV));        \
-    } else if (PV) {                                                    \
-        for (i = 0; i < SIZE; i += LOOPSIZE)                            \
-            ff_ ##OP ##rv40_qpel_v ## OPT(dst + i, stride, src + i,     \
-                                          stride, SIZE, VCOFF(PV));     \
-    } else {                                                            \
-        for (i = 0; i < SIZE; i += LOOPSIZE)                            \
-            ff_ ##OP ##rv40_qpel_h ## OPT(dst + i, stride, src + i,     \
-                                          stride, SIZE, HCOFF(PH));     \
-    }                                                                   \
-};
-
-/** Declare functions for sizes 8 and 16 and given operations
- *  and qpel position. */
-#define QPEL_FUNCS_DECL(OP, PH, PV, OPT) \
-    QPEL_FUNC_DECL(OP,  8, PH, PV, OPT)  \
-    QPEL_FUNC_DECL(OP, 16, PH, PV, OPT)
-
-/** Declare all functions for all sizes and qpel positions */
-#define QPEL_MC_DECL(OP, OPT)                                           \
-void ff_ ##OP ##rv40_qpel_h ##OPT(uint8_t *dst, ptrdiff_t dstStride,    \
-                                  const uint8_t *src,                   \
-                                  ptrdiff_t srcStride,                  \
-                                  int len, int m);                      \
-void ff_ ##OP ##rv40_qpel_v ##OPT(uint8_t *dst, ptrdiff_t dstStride,    \
-                                  const uint8_t *src,                   \
-                                  ptrdiff_t srcStride,                  \
-                                  int len, int m);                      \
-QPEL_FUNCS_DECL(OP, 0, 1, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 0, 3, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 1, 0, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 1, 1, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 1, 2, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 1, 3, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 2, 1, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 2, 2, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 2, 3, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 3, 0, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 3, 1, OPT)                                          \
-QPEL_FUNCS_DECL(OP, 3, 2, OPT)
-/** @} */
-
-#define LOOPSIZE  8
-#define HCOFF(x)  (32 * (x - 1))
-#define VCOFF(x)  (32 * (x - 1))
-QPEL_MC_DECL(put_, _ssse3)
-QPEL_MC_DECL(avg_, _ssse3)
-
-#undef LOOPSIZE
-#undef HCOFF
-#undef VCOFF
-#define LOOPSIZE  8
-#define HCOFF(x)  (64 * (x - 1))
-#define VCOFF(x)  (64 * (x - 1))
-QPEL_MC_DECL(put_, _sse2)
-QPEL_MC_DECL(avg_, _sse2)
-
-#if ARCH_X86_32
-#undef LOOPSIZE
-#undef HCOFF
-#undef VCOFF
-#define LOOPSIZE  4
-#define HCOFF(x)  (64 * (x - 1))
-#define VCOFF(x)  (64 * (x - 1))
-
-QPEL_MC_DECL(put_, _mmx)
-
-#define ff_put_rv40_qpel_h_mmxext  ff_put_rv40_qpel_h_mmx
-#define ff_put_rv40_qpel_v_mmxext  ff_put_rv40_qpel_v_mmx
-QPEL_MC_DECL(avg_, _mmxext)
-
-#define ff_put_rv40_qpel_h_3dnow  ff_put_rv40_qpel_h_mmx
-#define ff_put_rv40_qpel_v_3dnow  ff_put_rv40_qpel_v_mmx
-QPEL_MC_DECL(avg_, _3dnow)
-#endif
-
-/** @{ */
-/** Set one function */
-#define QPEL_FUNC_SET(OP, SIZE, PH, PV, OPT)                            \
-    c-> OP ## pixels_tab[2 - SIZE / 8][4 * PV + PH] = OP ## rv40_qpel ##SIZE ## _mc ##PH ##PV ##OPT;
-
-/** Set functions put and avg for sizes 8 and 16 and a given qpel position */
-#define QPEL_FUNCS_SET(OP, PH, PV, OPT)         \
-    QPEL_FUNC_SET(OP,  8, PH, PV, OPT)          \
-    QPEL_FUNC_SET(OP, 16, PH, PV, OPT)
-
-/** Set all functions for all sizes and qpel positions */
-#define QPEL_MC_SET(OP, OPT)   \
-QPEL_FUNCS_SET (OP, 0, 1, OPT) \
-QPEL_FUNCS_SET (OP, 0, 3, OPT) \
-QPEL_FUNCS_SET (OP, 1, 0, OPT) \
-QPEL_FUNCS_SET (OP, 1, 1, OPT) \
-QPEL_FUNCS_SET (OP, 1, 2, OPT) \
-QPEL_FUNCS_SET (OP, 1, 3, OPT) \
-QPEL_FUNCS_SET (OP, 2, 1, OPT) \
-QPEL_FUNCS_SET (OP, 2, 2, OPT) \
-QPEL_FUNCS_SET (OP, 2, 3, OPT) \
-QPEL_FUNCS_SET (OP, 3, 0, OPT) \
-QPEL_FUNCS_SET (OP, 3, 1, OPT) \
-QPEL_FUNCS_SET (OP, 3, 2, OPT)
-/** @} */
-
-#endif /* HAVE_YASM */
-
-#if HAVE_MMX_INLINE
-static void put_rv40_qpel8_mc33_mmx(uint8_t *dst, uint8_t *src,
-                                    ptrdiff_t stride)
-{
-    ff_put_pixels8_xy2_mmx(dst, src, stride, 8);
-}
-static void put_rv40_qpel16_mc33_mmx(uint8_t *dst, uint8_t *src,
-                                     ptrdiff_t stride)
-{
-    ff_put_pixels16_xy2_mmx(dst, src, stride, 16);
-}
-static void avg_rv40_qpel8_mc33_mmx(uint8_t *dst, uint8_t *src,
-                                    ptrdiff_t stride)
-{
-    ff_avg_pixels8_xy2_mmx(dst, src, stride, 8);
-}
-static void avg_rv40_qpel16_mc33_mmx(uint8_t *dst, uint8_t *src,
-                                     ptrdiff_t stride)
-{
-    ff_avg_pixels16_xy2_mmx(dst, src, stride, 16);
-}
-#endif /* HAVE_MMX_INLINE */
-
-av_cold void ff_rv40dsp_init_x86(RV34DSPContext *c)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-#if HAVE_MMX_INLINE
-    if (INLINE_MMX(cpu_flags)) {
-        c->put_pixels_tab[0][15] = put_rv40_qpel16_mc33_mmx;
-        c->put_pixels_tab[1][15] = put_rv40_qpel8_mc33_mmx;
-        c->avg_pixels_tab[0][15] = avg_rv40_qpel16_mc33_mmx;
-        c->avg_pixels_tab[1][15] = avg_rv40_qpel8_mc33_mmx;
-    }
-#endif /* HAVE_MMX_INLINE */
-
-#if HAVE_YASM
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->put_chroma_pixels_tab[0] = ff_put_rv40_chroma_mc8_mmx;
-        c->put_chroma_pixels_tab[1] = ff_put_rv40_chroma_mc4_mmx;
-#if ARCH_X86_32
-        QPEL_MC_SET(put_, _mmx)
-#endif
-    }
-    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-        c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_3dnow;
-        c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_3dnow;
-#if ARCH_X86_32
-        QPEL_MC_SET(avg_, _3dnow)
-#endif
-    }
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        c->avg_chroma_pixels_tab[0]     = ff_avg_rv40_chroma_mc8_mmxext;
-        c->avg_chroma_pixels_tab[1]     = ff_avg_rv40_chroma_mc4_mmxext;
-        c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_rnd_16_mmxext;
-        c->rv40_weight_pixels_tab[0][1] = ff_rv40_weight_func_rnd_8_mmxext;
-        c->rv40_weight_pixels_tab[1][0] = ff_rv40_weight_func_nornd_16_mmxext;
-        c->rv40_weight_pixels_tab[1][1] = ff_rv40_weight_func_nornd_8_mmxext;
-#if ARCH_X86_32
-        QPEL_MC_SET(avg_, _mmxext)
-#endif
-    }
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_rnd_16_sse2;
-        c->rv40_weight_pixels_tab[0][1] = ff_rv40_weight_func_rnd_8_sse2;
-        c->rv40_weight_pixels_tab[1][0] = ff_rv40_weight_func_nornd_16_sse2;
-        c->rv40_weight_pixels_tab[1][1] = ff_rv40_weight_func_nornd_8_sse2;
-        QPEL_MC_SET(put_, _sse2)
-        QPEL_MC_SET(avg_, _sse2)
-    }
-    if (EXTERNAL_SSSE3(cpu_flags)) {
-        c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_rnd_16_ssse3;
-        c->rv40_weight_pixels_tab[0][1] = ff_rv40_weight_func_rnd_8_ssse3;
-        c->rv40_weight_pixels_tab[1][0] = ff_rv40_weight_func_nornd_16_ssse3;
-        c->rv40_weight_pixels_tab[1][1] = ff_rv40_weight_func_nornd_8_ssse3;
-        QPEL_MC_SET(put_, _ssse3)
-        QPEL_MC_SET(avg_, _ssse3)
-    }
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavcodec/x86/sbrdsp.asm b/deps/libav/libavcodec/x86/sbrdsp.asm
deleted file mode 100644
index 36a0918..0000000
--- a/deps/libav/libavcodec/x86/sbrdsp.asm
+++ /dev/null
@@ -1,305 +0,0 @@
-;******************************************************************************
-;* AAC Spectral Band Replication decoding functions
-;* Copyright (C) 2012 Christophe Gisquet <christophe.gisquet at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-; mask equivalent for multiply by -1.0 1.0
-ps_mask         times 2 dd 1<<31, 0
-ps_mask2        times 2 dd 0, 1<<31
-ps_neg          times 4 dd 1<<31
-
-SECTION_TEXT
-
-INIT_XMM sse
-cglobal sbr_sum_square, 2, 3, 6
-    mov         r2, r1
-    xorps       m0, m0
-    xorps       m1, m1
-    sar         r2, 3
-    jz          .prepare
-.loop:
-    movu        m2, [r0 +  0]
-    movu        m3, [r0 + 16]
-    movu        m4, [r0 + 32]
-    movu        m5, [r0 + 48]
-    mulps       m2, m2
-    mulps       m3, m3
-    mulps       m4, m4
-    mulps       m5, m5
-    addps       m0, m2
-    addps       m1, m3
-    addps       m0, m4
-    addps       m1, m5
-    add         r0, 64
-    dec         r2
-    jnz         .loop
-.prepare:
-    and         r1, 7
-    sar         r1, 1
-    jz          .end
-; len is a multiple of 2, thus there are at least 4 elements to process
-.endloop:
-    movu        m2, [r0]
-    add         r0, 16
-    mulps       m2, m2
-    dec         r1
-    addps       m0, m2
-    jnz         .endloop
-.end:
-    addps       m0, m1
-    movhlps     m2, m0
-    addps       m0, m2
-    movss       m1, m0
-    shufps      m0, m0, 1
-    addss       m0, m1
-%if ARCH_X86_64 == 0
-    movss       r0m,  m0
-    fld         dword r0m
-%endif
-    RET
-
-%define STEP  40*4*2
-cglobal sbr_hf_g_filt, 5, 6, 5
-    lea         r1, [r1 + 8*r4] ; offset by ixh elements into X_high
-    mov         r5, r3
-    and         r3, 0xFC
-    lea         r2, [r2 + r3*4]
-    lea         r0, [r0 + r3*8]
-    neg         r3
-    jz          .loop1
-.loop4:
-    movlps      m0, [r2 + 4*r3 + 0]
-    movlps      m1, [r2 + 4*r3 + 8]
-    movlps      m2, [r1 + 0*STEP]
-    movlps      m3, [r1 + 2*STEP]
-    movhps      m2, [r1 + 1*STEP]
-    movhps      m3, [r1 + 3*STEP]
-    unpcklps    m0, m0
-    unpcklps    m1, m1
-    mulps       m0, m2
-    mulps       m1, m3
-    movu        [r0 + 8*r3 +  0], m0
-    movu        [r0 + 8*r3 + 16], m1
-    add         r1, 4*STEP
-    add         r3, 4
-    jnz         .loop4
-    and         r5, 3 ; number of single element loops
-    jz          .end
-.loop1: ; element 0 and 1 can be computed at the same time
-    movss       m0, [r2]
-    movlps      m2, [r1]
-    unpcklps    m0, m0
-    mulps       m2, m0
-    movlps    [r0], m2
-    add         r0, 8
-    add         r2, 4
-    add         r1, STEP
-    dec         r5
-    jnz         .loop1
-.end:
-    RET
-
-; static void sbr_hf_gen_c(float (*X_high)[2], const float (*X_low)[2],
-;                          const float alpha0[2], const float alpha1[2],
-;                          float bw, int start, int end)
-;
-cglobal sbr_hf_gen, 4,4,8, X_high, X_low, alpha0, alpha1, BW, S, E
-    ; load alpha factors
-%define bw m0
-%if ARCH_X86_64 == 0 || WIN64
-    movss      bw, BWm
-%endif
-    movlps     m2, [alpha1q]
-    movlps     m1, [alpha0q]
-    shufps     bw, bw, 0
-    mulps      m2, bw             ; (a1[0] a1[1])*bw
-    mulps      m1, bw             ; (a0[0] a0[1])*bw    = (a2 a3)
-    mulps      m2, bw             ; (a1[0] a1[1])*bw*bw = (a0 a1)
-    mova       m3, m1
-    mova       m4, m2
-    mova       m7, [ps_mask]
-
-    ; Set pointers
-%if ARCH_X86_64 == 0 || WIN64
-    ; start and end 6th and 7th args on stack
-    mov        r2d, Sm
-    mov        r3d, Em
-%define  start r2q
-%define  end   r3q
-%else
-; BW does not actually occupy a register, so shift by 1
-%define  start BWq
-%define  end   Sq
-%endif
-    sub      start, end          ; neg num of loops
-    lea    X_highq, [X_highq + end*2*4]
-    lea     X_lowq, [X_lowq  + end*2*4 - 2*2*4]
-    shl      start, 3            ; offset from num loops
-
-    mova        m0, [X_lowq + start]
-    movlhps     m1, m1           ; (a2 a3 a2 a3)
-    movlhps     m2, m2           ; (a0 a1 a0 a1)
-    shufps      m3, m3, q0101    ; (a3 a2 a3 a2)
-    shufps      m4, m4, q0101    ; (a1 a0 a1 a0)
-    xorps       m3, m7           ; (-a3 a2 -a3 a2)
-    xorps       m4, m7           ; (-a1 a0 -a1 a0)
-.loop2:
-    mova        m5, m0
-    mova        m6, m0
-    shufps      m0, m0, q2200    ; {Xl[-2][0],",Xl[-1][0],"}
-    shufps      m5, m5, q3311    ; {Xl[-2][1],",Xl[-1][1],"}
-    mulps       m0, m2
-    mulps       m5, m4
-    mova        m7, m6
-    addps       m5, m0
-    mova        m0, [X_lowq + start + 2*2*4]
-    shufps      m6, m0, q0022    ; {Xl[-1][0],",Xl[0][0],"}
-    shufps      m7, m0, q1133    ; {Xl[-1][1],",Xl[1][1],"}
-    mulps       m6, m1
-    mulps       m7, m3
-    addps       m5, m6
-    addps       m7, m0
-    addps       m5, m7
-    mova  [X_highq + start], m5
-    add     start, 16
-    jnz         .loop2
-    RET
-
-cglobal sbr_sum64x5, 1,2,4,z
-    lea    r1q, [zq+ 256]
-.loop:
-    mova    m0, [zq+   0]
-    mova    m2, [zq+  16]
-    mova    m1, [zq+ 256]
-    mova    m3, [zq+ 272]
-    addps   m0, [zq+ 512]
-    addps   m2, [zq+ 528]
-    addps   m1, [zq+ 768]
-    addps   m3, [zq+ 784]
-    addps   m0, [zq+1024]
-    addps   m2, [zq+1040]
-    addps   m0, m1
-    addps   m2, m3
-    mova  [zq], m0
-    mova  [zq+16], m2
-    add     zq, 32
-    cmp     zq, r1q
-    jne  .loop
-    REP_RET
-
-INIT_XMM sse
-cglobal sbr_qmf_post_shuffle, 2,3,4,W,z
-    lea              r2q, [zq + (64-4)*4]
-    mova              m3, [ps_neg]
-.loop:
-    mova              m1, [zq]
-    xorps             m0, m3, [r2q]
-    shufps            m0, m0, m0, q0123
-    unpcklps          m2, m0, m1
-    unpckhps          m0, m0, m1
-    mova       [Wq +  0], m2
-    mova       [Wq + 16], m0
-    add               Wq, 32
-    sub              r2q, 16
-    add               zq, 16
-    cmp               zq, r2q
-    jl             .loop
-    REP_RET
-
-INIT_XMM sse
-cglobal sbr_neg_odd_64, 1,2,4,z
-    lea        r1q, [zq+256]
-.loop:
-    mova        m0, [zq+ 0]
-    mova        m1, [zq+16]
-    mova        m2, [zq+32]
-    mova        m3, [zq+48]
-    xorps       m0, [ps_mask2]
-    xorps       m1, [ps_mask2]
-    xorps       m2, [ps_mask2]
-    xorps       m3, [ps_mask2]
-    mova   [zq+ 0], m0
-    mova   [zq+16], m1
-    mova   [zq+32], m2
-    mova   [zq+48], m3
-    add         zq, 64
-    cmp         zq, r1q
-    jne      .loop
-    REP_RET
-
-INIT_XMM sse2
-; sbr_qmf_deint_bfly(float *v, const float *src0, const float *src1)
-cglobal sbr_qmf_deint_bfly, 3,5,8, v,src0,src1,vrev,c
-    mov               cq, 64*4-2*mmsize
-    lea            vrevq, [vq + 64*4]
-.loop:
-    mova              m0, [src0q+cq]
-    mova              m1, [src1q]
-    mova              m2, [src0q+cq+mmsize]
-    mova              m3, [src1q+mmsize]
-    pshufd            m4, m0, q0123
-    pshufd            m5, m1, q0123
-    pshufd            m6, m2, q0123
-    pshufd            m7, m3, q0123
-    addps             m3, m4
-    subps             m0, m7
-    addps             m1, m6
-    subps             m2, m5
-    mova         [vrevq], m1
-    mova  [vrevq+mmsize], m3
-    mova         [vq+cq], m0
-    mova  [vq+cq+mmsize], m2
-    add            src1q, 2*mmsize
-    add            vrevq, 2*mmsize
-    sub               cq, 2*mmsize
-    jge            .loop
-    REP_RET
-
-INIT_XMM sse2
-cglobal sbr_qmf_pre_shuffle, 1,4,6,z
-%define OFFSET  (32*4-2*mmsize)
-    mov       r3q, OFFSET
-    lea       r1q, [zq + (32+1)*4]
-    lea       r2q, [zq + 64*4]
-    mova       m5, [ps_neg]
-.loop:
-    movu       m0, [r1q]
-    movu       m2, [r1q + mmsize]
-    movu       m1, [zq + r3q + 4 + mmsize]
-    movu       m3, [zq + r3q + 4]
-
-    pxor       m2, m5
-    pxor       m0, m5
-    pshufd     m2, m2, q0123
-    pshufd     m0, m0, q0123
-    SBUTTERFLY dq, 2, 3, 4
-    SBUTTERFLY dq, 0, 1, 4
-    mova  [r2q + 2*r3q + 0*mmsize], m2
-    mova  [r2q + 2*r3q + 1*mmsize], m3
-    mova  [r2q + 2*r3q + 2*mmsize], m0
-    mova  [r2q + 2*r3q + 3*mmsize], m1
-    add       r1q, 2*mmsize
-    sub       r3q, 2*mmsize
-    jge      .loop
-    movq       m2, [zq]
-    movq    [r2q], m2
-    REP_RET
diff --git a/deps/libav/libavcodec/x86/sbrdsp_init.c b/deps/libav/libavcodec/x86/sbrdsp_init.c
deleted file mode 100644
index 9600852..0000000
--- a/deps/libav/libavcodec/x86/sbrdsp_init.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * AAC Spectral Band Replication decoding functions
- * Copyright (c) 2012 Christophe Gisquet <christophe.gisquet at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/sbrdsp.h"
-
-float ff_sbr_sum_square_sse(float (*x)[2], int n);
-void ff_sbr_sum64x5_sse(float *z);
-void ff_sbr_hf_g_filt_sse(float (*Y)[2], const float (*X_high)[40][2],
-                          const float *g_filt, int m_max, intptr_t ixh);
-void ff_sbr_hf_gen_sse(float (*X_high)[2], const float (*X_low)[2],
-                       const float alpha0[2], const float alpha1[2],
-                       float bw, int start, int end);
-void ff_sbr_neg_odd_64_sse(float *z);
-void ff_sbr_qmf_post_shuffle_sse(float W[32][2], const float *z);
-void ff_sbr_qmf_deint_bfly_sse2(float *v, const float *src0, const float *src1);
-void ff_sbr_qmf_pre_shuffle_sse2(float *z);
-
-av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_SSE(cpu_flags)) {
-        s->neg_odd_64 = ff_sbr_neg_odd_64_sse;
-        s->sum_square = ff_sbr_sum_square_sse;
-        s->sum64x5    = ff_sbr_sum64x5_sse;
-        s->hf_g_filt  = ff_sbr_hf_g_filt_sse;
-        s->hf_gen     = ff_sbr_hf_gen_sse;
-        s->qmf_post_shuffle = ff_sbr_qmf_post_shuffle_sse;
-    }
-
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        s->qmf_deint_bfly   = ff_sbr_qmf_deint_bfly_sse2;
-        s->qmf_pre_shuffle  = ff_sbr_qmf_pre_shuffle_sse2;
-    }
-}
diff --git a/deps/libav/libavcodec/x86/simple_idct.c b/deps/libav/libavcodec/x86/simple_idct.c
deleted file mode 100644
index 36f0b47..0000000
--- a/deps/libav/libavcodec/x86/simple_idct.c
+++ /dev/null
@@ -1,1168 +0,0 @@
-/*
- * Simple IDCT MMX
- *
- * Copyright (c) 2001, 2002 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "libavcodec/simple_idct.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "dsputil_x86.h"
-
-#if HAVE_INLINE_ASM
-
-/*
-23170.475006
-22725.260826
-21406.727617
-19265.545870
-16384.000000
-12872.826198
-8866.956905
-4520.335430
-*/
-#define C0 23170 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C1 22725 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C2 21407 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C3 19266 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C4 16383 //cos(i*M_PI/16)*sqrt(2)*(1<<14) - 0.5
-#define C5 12873 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C6 8867  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C7 4520  //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-
-#define ROW_SHIFT 11
-#define COL_SHIFT 20 // 6
-
-DECLARE_ASM_CONST(8, uint64_t, wm1010)= 0xFFFF0000FFFF0000ULL;
-DECLARE_ASM_CONST(8, uint64_t, d40000)= 0x0000000000040000ULL;
-
-DECLARE_ALIGNED(8, static const int16_t, coeffs)[]= {
-        1<<(ROW_SHIFT-1), 0, 1<<(ROW_SHIFT-1), 0,
-//        1<<(COL_SHIFT-1), 0, 1<<(COL_SHIFT-1), 0,
-//        0, 1<<(COL_SHIFT-1-16), 0, 1<<(COL_SHIFT-1-16),
-        1<<(ROW_SHIFT-1), 1, 1<<(ROW_SHIFT-1), 0,
-        // the 1 = ((1<<(COL_SHIFT-1))/C4)<<ROW_SHIFT :)
-//        0, 0, 0, 0,
-//        0, 0, 0, 0,
-
- C4,  C4,  C4,  C4,
- C4, -C4,  C4, -C4,
-
- C2,  C6,  C2,  C6,
- C6, -C2,  C6, -C2,
-
- C1,  C3,  C1,  C3,
- C5,  C7,  C5,  C7,
-
- C3, -C7,  C3, -C7,
--C1, -C5, -C1, -C5,
-
- C5, -C1,  C5, -C1,
- C7,  C3,  C7,  C3,
-
- C7, -C5,  C7, -C5,
- C3, -C1,  C3, -C1
-};
-
-static inline void idct(int16_t *block)
-{
-        DECLARE_ALIGNED(8, int64_t, align_tmp)[16];
-        int16_t * const temp= (int16_t*)align_tmp;
-
-        __asm__ volatile(
-#if 0 //Alternative, simpler variant
-
-#define ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        #rounder ", %%mm4               \n\t"\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq 56(%2), %%mm5             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        #rounder ", %%mm0               \n\t"\
-        "paddd %%mm0, %%mm1             \n\t" /* A1             a1 */\
-        "paddd %%mm0, %%mm0             \n\t" \
-        "psubd %%mm1, %%mm0             \n\t" /* A2             a2 */\
-        "pmaddwd 64(%2), %%mm2          \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm5, %%mm7             \n\t" /* B0             b0 */\
-        "movq 72(%2), %%mm5             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "paddd %%mm2, %%mm5             \n\t" /* B1             b1 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm1, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm5, %%mm1             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm5, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm1, %%mm7          \n\t" /* A1+B1  a1+b1   A0+B0   a0+b0 */\
-        "packssdw %%mm4, %%mm2          \n\t" /* A0-B0  a0-b0   A1-B1   a1-b1 */\
-        "movq %%mm7, " #dst "           \n\t"\
-        "movq " #src1 ", %%mm1          \n\t" /* R3     R1      r3      r1 */\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "movq %%mm2, 24+" #dst "        \n\t"\
-        "pmaddwd %%mm1, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "movq 88(%2), %%mm7             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd 96(%2), %%mm1          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm0, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm7, %%mm4             \n\t" /* B2             b2 */\
-        "paddd %%mm4, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm0             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm1, %%mm3             \n\t" /* B3             b3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "packssdw %%mm6, %%mm2          \n\t" /* A3+B3  a3+b3   A2+B2   a2+b2 */\
-        "movq %%mm2, 8+" #dst "         \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm0, %%mm4          \n\t" /* A2-B2  a2-b2   A3-B3   a3-b3 */\
-        "movq %%mm4, 16+" #dst "        \n\t"\
-
-#define COL_IDCT(src0, src4, src1, src5, dst, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq %%mm0, %%mm5              \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "paddd %%mm1, %%mm0             \n\t" /* A1             a1 */\
-        "psubd %%mm1, %%mm5             \n\t" /* A2             a2 */\
-        "movq 56(%2), %%mm1             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        "pmaddwd 64(%2), %%mm2          \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm1, %%mm7             \n\t" /* B0             b0 */\
-        "movq 72(%2), %%mm1             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "paddd %%mm2, %%mm1             \n\t" /* B1             b1 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm0, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm1, %%mm0             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm1, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm7, %%mm7          \n\t" /* A0+B0  a0+b0 */\
-        "movd %%mm7, " #dst "           \n\t"\
-        "packssdw %%mm0, %%mm0          \n\t" /* A1+B1  a1+b1 */\
-        "movd %%mm0, 16+" #dst "        \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A1-B1  a1-b1 */\
-        "movd %%mm2, 96+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A0-B0  a0-b0 */\
-        "movd %%mm4, 112+" #dst "       \n\t"\
-        "movq " #src1 ", %%mm0          \n\t" /* R3     R1      r3      r1 */\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "movq 88(%2), %%mm7             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd 96(%2), %%mm0          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm5, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm7, %%mm4             \n\t" /* B2             b2 */\
-        "paddd %%mm4, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm5             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm5       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm0, %%mm3             \n\t" /* B3             b3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A2+B2  a2+b2 */\
-        "packssdw %%mm6, %%mm6          \n\t" /* A3+B3  a3+b3 */\
-        "movd %%mm2, 32+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A3-B3  a3-b3 */\
-        "packssdw %%mm5, %%mm5          \n\t" /* A2-B2  a2-b2 */\
-        "movd %%mm6, 48+" #dst "        \n\t"\
-        "movd %%mm4, 64+" #dst "        \n\t"\
-        "movd %%mm5, 80+" #dst "        \n\t"\
-
-
-#define DC_COND_ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq "MANGLE(wm1010)", %%mm4   \n\t"\
-        "pand %%mm0, %%mm4              \n\t"\
-        "por %%mm1, %%mm4               \n\t"\
-        "por %%mm2, %%mm4               \n\t"\
-        "por %%mm3, %%mm4               \n\t"\
-        "packssdw %%mm4,%%mm4           \n\t"\
-        "movd %%mm4, %%eax              \n\t"\
-        "orl %%eax, %%eax               \n\t"\
-        "jz 1f                          \n\t"\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        #rounder ", %%mm4               \n\t"\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq 56(%2), %%mm5             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        #rounder ", %%mm0               \n\t"\
-        "paddd %%mm0, %%mm1             \n\t" /* A1             a1 */\
-        "paddd %%mm0, %%mm0             \n\t" \
-        "psubd %%mm1, %%mm0             \n\t" /* A2             a2 */\
-        "pmaddwd 64(%2), %%mm2          \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm5, %%mm7             \n\t" /* B0             b0 */\
-        "movq 72(%2), %%mm5             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "paddd %%mm2, %%mm5             \n\t" /* B1             b1 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm1, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm5, %%mm1             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm5, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm1, %%mm7          \n\t" /* A1+B1  a1+b1   A0+B0   a0+b0 */\
-        "packssdw %%mm4, %%mm2          \n\t" /* A0-B0  a0-b0   A1-B1   a1-b1 */\
-        "movq %%mm7, " #dst "           \n\t"\
-        "movq " #src1 ", %%mm1          \n\t" /* R3     R1      r3      r1 */\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "movq %%mm2, 24+" #dst "        \n\t"\
-        "pmaddwd %%mm1, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "movq 88(%2), %%mm7             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd 96(%2), %%mm1          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm0, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm7, %%mm4             \n\t" /* B2             b2 */\
-        "paddd %%mm4, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm0             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm1, %%mm3             \n\t" /* B3             b3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "packssdw %%mm6, %%mm2          \n\t" /* A3+B3  a3+b3   A2+B2   a2+b2 */\
-        "movq %%mm2, 8+" #dst "         \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm0, %%mm4          \n\t" /* A2-B2  a2-b2   A3-B3   a3-b3 */\
-        "movq %%mm4, 16+" #dst "        \n\t"\
-        "jmp 2f                         \n\t"\
-        "1:                             \n\t"\
-        "pslld $16, %%mm0               \n\t"\
-        "#paddd "MANGLE(d40000)", %%mm0 \n\t"\
-        "psrad $13, %%mm0               \n\t"\
-        "packssdw %%mm0, %%mm0          \n\t"\
-        "movq %%mm0, " #dst "           \n\t"\
-        "movq %%mm0, 8+" #dst "         \n\t"\
-        "movq %%mm0, 16+" #dst "        \n\t"\
-        "movq %%mm0, 24+" #dst "        \n\t"\
-        "2:                             \n\t"
-
-
-//IDCT(      src0,   src4,   src1,   src5,    dst,    rounder, shift)
-ROW_IDCT(    (%0),  8(%0), 16(%0), 24(%0),  0(%1),paddd 8(%2), 11)
-/*ROW_IDCT(  32(%0), 40(%0), 48(%0), 56(%0), 32(%1), paddd (%2), 11)
-ROW_IDCT(  64(%0), 72(%0), 80(%0), 88(%0), 64(%1), paddd (%2), 11)
-ROW_IDCT(  96(%0),104(%0),112(%0),120(%0), 96(%1), paddd (%2), 11)*/
-
-DC_COND_ROW_IDCT(  32(%0), 40(%0), 48(%0), 56(%0), 32(%1),paddd (%2), 11)
-DC_COND_ROW_IDCT(  64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddd (%2), 11)
-DC_COND_ROW_IDCT(  96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11)
-
-
-//IDCT(      src0,   src4,   src1,    src5,    dst, shift)
-COL_IDCT(    (%1), 64(%1), 32(%1),  96(%1),  0(%0), 20)
-COL_IDCT(   8(%1), 72(%1), 40(%1), 104(%1),  4(%0), 20)
-COL_IDCT(  16(%1), 80(%1), 48(%1), 112(%1),  8(%0), 20)
-COL_IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-
-#else
-
-#define DC_COND_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq "MANGLE(wm1010)", %%mm4   \n\t"\
-        "pand %%mm0, %%mm4              \n\t"\
-        "por %%mm1, %%mm4               \n\t"\
-        "por %%mm2, %%mm4               \n\t"\
-        "por %%mm3, %%mm4               \n\t"\
-        "packssdw %%mm4,%%mm4           \n\t"\
-        "movd %%mm4, %%eax              \n\t"\
-        "orl %%eax, %%eax               \n\t"\
-        "jz 1f                          \n\t"\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        #rounder ", %%mm4               \n\t"\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq 56(%2), %%mm5             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        #rounder ", %%mm0               \n\t"\
-        "paddd %%mm0, %%mm1             \n\t" /* A1             a1 */\
-        "paddd %%mm0, %%mm0             \n\t" \
-        "psubd %%mm1, %%mm0             \n\t" /* A2             a2 */\
-        "pmaddwd 64(%2), %%mm2          \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm5, %%mm7             \n\t" /* B0             b0 */\
-        "movq 72(%2), %%mm5             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "paddd %%mm2, %%mm5             \n\t" /* B1             b1 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm1, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm5, %%mm1             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm5, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm1, %%mm7          \n\t" /* A1+B1  a1+b1   A0+B0   a0+b0 */\
-        "packssdw %%mm4, %%mm2          \n\t" /* A0-B0  a0-b0   A1-B1   a1-b1 */\
-        "movq %%mm7, " #dst "           \n\t"\
-        "movq " #src1 ", %%mm1          \n\t" /* R3     R1      r3      r1 */\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "movq %%mm2, 24+" #dst "        \n\t"\
-        "pmaddwd %%mm1, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "movq 88(%2), %%mm7             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd 96(%2), %%mm1          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm0, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm7, %%mm4             \n\t" /* B2             b2 */\
-        "paddd %%mm4, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm0             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm1, %%mm3             \n\t" /* B3             b3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "packssdw %%mm6, %%mm2          \n\t" /* A3+B3  a3+b3   A2+B2   a2+b2 */\
-        "movq %%mm2, 8+" #dst "         \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm0, %%mm4          \n\t" /* A2-B2  a2-b2   A3-B3   a3-b3 */\
-        "movq %%mm4, 16+" #dst "        \n\t"\
-        "jmp 2f                         \n\t"\
-        "1:                             \n\t"\
-        "pslld $16, %%mm0               \n\t"\
-        "paddd "MANGLE(d40000)", %%mm0  \n\t"\
-        "psrad $13, %%mm0               \n\t"\
-        "packssdw %%mm0, %%mm0          \n\t"\
-        "movq %%mm0, " #dst "           \n\t"\
-        "movq %%mm0, 8+" #dst "         \n\t"\
-        "movq %%mm0, 16+" #dst "        \n\t"\
-        "movq %%mm0, 24+" #dst "        \n\t"\
-        "2:                             \n\t"
-
-#define Z_COND_IDCT(src0, src4, src1, src5, dst, rounder, shift, bt) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq %%mm0, %%mm4              \n\t"\
-        "por %%mm1, %%mm4               \n\t"\
-        "por %%mm2, %%mm4               \n\t"\
-        "por %%mm3, %%mm4               \n\t"\
-        "packssdw %%mm4,%%mm4           \n\t"\
-        "movd %%mm4, %%eax              \n\t"\
-        "orl %%eax, %%eax               \n\t"\
-        "jz " #bt "                     \n\t"\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        #rounder ", %%mm4               \n\t"\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq 56(%2), %%mm5             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        #rounder ", %%mm0               \n\t"\
-        "paddd %%mm0, %%mm1             \n\t" /* A1             a1 */\
-        "paddd %%mm0, %%mm0             \n\t" \
-        "psubd %%mm1, %%mm0             \n\t" /* A2             a2 */\
-        "pmaddwd 64(%2), %%mm2          \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm5, %%mm7             \n\t" /* B0             b0 */\
-        "movq 72(%2), %%mm5             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "paddd %%mm2, %%mm5             \n\t" /* B1             b1 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm1, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm5, %%mm1             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm5, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm1, %%mm7          \n\t" /* A1+B1  a1+b1   A0+B0   a0+b0 */\
-        "packssdw %%mm4, %%mm2          \n\t" /* A0-B0  a0-b0   A1-B1   a1-b1 */\
-        "movq %%mm7, " #dst "           \n\t"\
-        "movq " #src1 ", %%mm1          \n\t" /* R3     R1      r3      r1 */\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "movq %%mm2, 24+" #dst "        \n\t"\
-        "pmaddwd %%mm1, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "movq 88(%2), %%mm7             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd 96(%2), %%mm1          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm0, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm7, %%mm4             \n\t" /* B2             b2 */\
-        "paddd %%mm4, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm0             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm1, %%mm3             \n\t" /* B3             b3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "packssdw %%mm6, %%mm2          \n\t" /* A3+B3  a3+b3   A2+B2   a2+b2 */\
-        "movq %%mm2, 8+" #dst "         \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm0, %%mm4          \n\t" /* A2-B2  a2-b2   A3-B3   a3-b3 */\
-        "movq %%mm4, 16+" #dst "        \n\t"\
-
-#define ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        #rounder ", %%mm4               \n\t"\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq 56(%2), %%mm5             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        #rounder ", %%mm0               \n\t"\
-        "paddd %%mm0, %%mm1             \n\t" /* A1             a1 */\
-        "paddd %%mm0, %%mm0             \n\t" \
-        "psubd %%mm1, %%mm0             \n\t" /* A2             a2 */\
-        "pmaddwd 64(%2), %%mm2          \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm5, %%mm7             \n\t" /* B0             b0 */\
-        "movq 72(%2), %%mm5             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm5           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "paddd %%mm2, %%mm5             \n\t" /* B1             b1 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm1, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm5, %%mm1             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm5, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm1, %%mm7          \n\t" /* A1+B1  a1+b1   A0+B0   a0+b0 */\
-        "packssdw %%mm4, %%mm2          \n\t" /* A0-B0  a0-b0   A1-B1   a1-b1 */\
-        "movq %%mm7, " #dst "           \n\t"\
-        "movq " #src1 ", %%mm1          \n\t" /* R3     R1      r3      r1 */\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "movq %%mm2, 24+" #dst "        \n\t"\
-        "pmaddwd %%mm1, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "movq 88(%2), %%mm7             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd 96(%2), %%mm1          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm0, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm7, %%mm4             \n\t" /* B2             b2 */\
-        "paddd %%mm4, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm0             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm1, %%mm3             \n\t" /* B3             b3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "packssdw %%mm6, %%mm2          \n\t" /* A3+B3  a3+b3   A2+B2   a2+b2 */\
-        "movq %%mm2, 8+" #dst "         \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm0, %%mm4          \n\t" /* A2-B2  a2-b2   A3-B3   a3-b3 */\
-        "movq %%mm4, 16+" #dst "        \n\t"\
-
-//IDCT(         src0,   src4,   src1,   src5,    dst,   rounder, shift)
-DC_COND_IDCT(  0(%0),  8(%0), 16(%0), 24(%0),  0(%1),paddd 8(%2), 11)
-Z_COND_IDCT(  32(%0), 40(%0), 48(%0), 56(%0), 32(%1),paddd (%2), 11, 4f)
-Z_COND_IDCT(  64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddd (%2), 11, 2f)
-Z_COND_IDCT(  96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 1f)
-
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq %%mm0, %%mm5              \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "paddd %%mm1, %%mm0             \n\t" /* A1             a1 */\
-        "psubd %%mm1, %%mm5             \n\t" /* A2             a2 */\
-        "movq 56(%2), %%mm1             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        "pmaddwd 64(%2), %%mm2          \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm1, %%mm7             \n\t" /* B0             b0 */\
-        "movq 72(%2), %%mm1             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "paddd %%mm2, %%mm1             \n\t" /* B1             b1 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm0, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm1, %%mm0             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm1, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm7, %%mm7          \n\t" /* A0+B0  a0+b0 */\
-        "movd %%mm7, " #dst "           \n\t"\
-        "packssdw %%mm0, %%mm0          \n\t" /* A1+B1  a1+b1 */\
-        "movd %%mm0, 16+" #dst "        \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A1-B1  a1-b1 */\
-        "movd %%mm2, 96+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A0-B0  a0-b0 */\
-        "movd %%mm4, 112+" #dst "       \n\t"\
-        "movq " #src1 ", %%mm0          \n\t" /* R3     R1      r3      r1 */\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "movq 88(%2), %%mm7             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd 96(%2), %%mm0          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm5, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm7, %%mm4             \n\t" /* B2             b2 */\
-        "paddd %%mm4, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm5             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm5       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm0, %%mm3             \n\t" /* B3             b3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A2+B2  a2+b2 */\
-        "packssdw %%mm6, %%mm6          \n\t" /* A3+B3  a3+b3 */\
-        "movd %%mm2, 32+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A3-B3  a3-b3 */\
-        "packssdw %%mm5, %%mm5          \n\t" /* A2-B2  a2-b2 */\
-        "movd %%mm6, 48+" #dst "        \n\t"\
-        "movd %%mm4, 64+" #dst "        \n\t"\
-        "movd %%mm5, 80+" #dst "        \n\t"
-
-
-//IDCT(  src0,   src4,   src1,    src5,    dst, shift)
-IDCT(    (%1), 64(%1), 32(%1),  96(%1),  0(%0), 20)
-IDCT(   8(%1), 72(%1), 40(%1), 104(%1),  4(%0), 20)
-IDCT(  16(%1), 80(%1), 48(%1), 112(%1),  8(%0), 20)
-IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-        "jmp 9f                         \n\t"
-
-        "# .p2align 4                   \n\t"\
-        "4:                             \n\t"
-Z_COND_IDCT(  64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddd (%2), 11, 6f)
-Z_COND_IDCT(  96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 5f)
-
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq %%mm0, %%mm5              \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "paddd %%mm1, %%mm0             \n\t" /* A1             a1 */\
-        "psubd %%mm1, %%mm5             \n\t" /* A2             a2 */\
-        "movq 56(%2), %%mm1             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        "movq 72(%2), %%mm7             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm1             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm1, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm0, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm7, %%mm0             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm7, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm1, %%mm1          \n\t" /* A0+B0  a0+b0 */\
-        "movd %%mm1, " #dst "           \n\t"\
-        "packssdw %%mm0, %%mm0          \n\t" /* A1+B1  a1+b1 */\
-        "movd %%mm0, 16+" #dst "        \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A1-B1  a1-b1 */\
-        "movd %%mm2, 96+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A0-B0  a0-b0 */\
-        "movd %%mm4, 112+" #dst "       \n\t"\
-        "movq 88(%2), %%mm1             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm5, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm1, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm1, %%mm5             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm5       \n\t"\
-        "movq %%mm6, %%mm1              \n\t" /* A3             a3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm1             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A2+B2  a2+b2 */\
-        "packssdw %%mm6, %%mm6          \n\t" /* A3+B3  a3+b3 */\
-        "movd %%mm2, 32+" #dst "        \n\t"\
-        "packssdw %%mm1, %%mm1          \n\t" /* A3-B3  a3-b3 */\
-        "packssdw %%mm5, %%mm5          \n\t" /* A2-B2  a2-b2 */\
-        "movd %%mm6, 48+" #dst "        \n\t"\
-        "movd %%mm1, 64+" #dst "        \n\t"\
-        "movd %%mm5, 80+" #dst "        \n\t"
-
-//IDCT(  src0,   src4,   src1,    src5,    dst, shift)
-IDCT(    (%1), 64(%1), 32(%1),  96(%1),  0(%0), 20)
-IDCT(   8(%1), 72(%1), 40(%1), 104(%1),  4(%0), 20)
-IDCT(  16(%1), 80(%1), 48(%1), 112(%1),  8(%0), 20)
-IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-        "jmp 9f                         \n\t"
-
-        "# .p2align 4                   \n\t"\
-        "6:                             \n\t"
-Z_COND_IDCT(  96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 7f)
-
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq %%mm0, %%mm5              \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 56(%2), %%mm1             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        "movq 72(%2), %%mm7             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm1             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm1, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm0, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm7, %%mm0             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm7, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm1, %%mm1          \n\t" /* A0+B0  a0+b0 */\
-        "movd %%mm1, " #dst "           \n\t"\
-        "packssdw %%mm0, %%mm0          \n\t" /* A1+B1  a1+b1 */\
-        "movd %%mm0, 16+" #dst "        \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A1-B1  a1-b1 */\
-        "movd %%mm2, 96+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A0-B0  a0-b0 */\
-        "movd %%mm4, 112+" #dst "       \n\t"\
-        "movq 88(%2), %%mm1             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm5, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm1, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm1, %%mm5             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm5       \n\t"\
-        "movq %%mm6, %%mm1              \n\t" /* A3             a3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm1             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A2+B2  a2+b2 */\
-        "packssdw %%mm6, %%mm6          \n\t" /* A3+B3  a3+b3 */\
-        "movd %%mm2, 32+" #dst "        \n\t"\
-        "packssdw %%mm1, %%mm1          \n\t" /* A3-B3  a3-b3 */\
-        "packssdw %%mm5, %%mm5          \n\t" /* A2-B2  a2-b2 */\
-        "movd %%mm6, 48+" #dst "        \n\t"\
-        "movd %%mm1, 64+" #dst "        \n\t"\
-        "movd %%mm5, 80+" #dst "        \n\t"
-
-
-//IDCT(  src0,   src4,   src1,    src5,    dst, shift)
-IDCT(    (%1), 64(%1), 32(%1),  96(%1),  0(%0), 20)
-IDCT(   8(%1), 72(%1), 40(%1), 104(%1),  4(%0), 20)
-IDCT(  16(%1), 80(%1), 48(%1), 112(%1),  8(%0), 20)
-IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-        "jmp 9f                         \n\t"
-
-        "# .p2align 4                   \n\t"\
-        "2:                             \n\t"
-Z_COND_IDCT(  96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 3f)
-
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq " #src5 ", %%mm3          \n\t" /* R7     R5      r7      r5 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        "movq %%mm0, %%mm5              \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 56(%2), %%mm1             \n\t" /* C7     C5      C7      C5 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* C7R7+C5R5      C7r7+C5r5 */\
-        "pmaddwd 64(%2), %%mm2          \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm1, %%mm7             \n\t" /* B0             b0 */\
-        "movq 72(%2), %%mm1             \n\t" /* -C5    -C1     -C5     -C1 */\
-        "pmaddwd %%mm3, %%mm1           \n\t" /* -C5R7-C1R5     -C5r7-C1r5 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "paddd %%mm2, %%mm1             \n\t" /* B1             b1 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm0, %%mm2              \n\t" /* A1             a1 */\
-        "paddd %%mm1, %%mm0             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm1, %%mm2             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm7, %%mm7          \n\t" /* A0+B0  a0+b0 */\
-        "movd %%mm7, " #dst "           \n\t"\
-        "packssdw %%mm0, %%mm0          \n\t" /* A1+B1  a1+b1 */\
-        "movd %%mm0, 16+" #dst "        \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A1-B1  a1-b1 */\
-        "movd %%mm2, 96+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A0-B0  a0-b0 */\
-        "movd %%mm4, 112+" #dst "       \n\t"\
-        "movq " #src1 ", %%mm0          \n\t" /* R3     R1      r3      r1 */\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "movq 88(%2), %%mm7             \n\t" /* C3     C7      C3      C7 */\
-        "pmaddwd 96(%2), %%mm0          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* C3R7+C7R5      C3r7+C7r5 */\
-        "movq %%mm5, %%mm2              \n\t" /* A2             a2 */\
-        "pmaddwd 104(%2), %%mm3         \n\t" /* -C1R7+C3R5     -C1r7+C3r5 */\
-        "paddd %%mm7, %%mm4             \n\t" /* B2             b2 */\
-        "paddd %%mm4, %%mm2             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm5             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "psrad $" #shift ", %%mm5       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm0, %%mm3             \n\t" /* B3             b3 */\
-        "paddd %%mm3, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm3, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm2, %%mm2          \n\t" /* A2+B2  a2+b2 */\
-        "packssdw %%mm6, %%mm6          \n\t" /* A3+B3  a3+b3 */\
-        "movd %%mm2, 32+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A3-B3  a3-b3 */\
-        "packssdw %%mm5, %%mm5          \n\t" /* A2-B2  a2-b2 */\
-        "movd %%mm6, 48+" #dst "        \n\t"\
-        "movd %%mm4, 64+" #dst "        \n\t"\
-        "movd %%mm5, 80+" #dst "        \n\t"
-
-//IDCT(  src0,   src4,   src1,    src5,    dst, shift)
-IDCT(    (%1), 64(%1), 32(%1),  96(%1),  0(%0), 20)
-IDCT(   8(%1), 72(%1), 40(%1), 104(%1),  4(%0), 20)
-IDCT(  16(%1), 80(%1), 48(%1), 112(%1),  8(%0), 20)
-IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-        "jmp 9f                         \n\t"
-
-        "# .p2align 4                   \n\t"\
-        "3:                             \n\t"
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        "movq %%mm0, %%mm5              \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 64(%2), %%mm3             \n\t"\
-        "pmaddwd %%mm2, %%mm3           \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm0, %%mm1              \n\t" /* A1             a1 */\
-        "paddd %%mm3, %%mm0             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm3, %%mm1             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "packssdw %%mm7, %%mm7          \n\t" /* A0+B0  a0+b0 */\
-        "movd %%mm7, " #dst "           \n\t"\
-        "packssdw %%mm0, %%mm0          \n\t" /* A1+B1  a1+b1 */\
-        "movd %%mm0, 16+" #dst "        \n\t"\
-        "packssdw %%mm1, %%mm1          \n\t" /* A1-B1  a1-b1 */\
-        "movd %%mm1, 96+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A0-B0  a0-b0 */\
-        "movd %%mm4, 112+" #dst "       \n\t"\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "pmaddwd %%mm2, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "pmaddwd 96(%2), %%mm2          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "movq %%mm5, %%mm1              \n\t" /* A2             a2 */\
-        "paddd %%mm4, %%mm1             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm5             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "psrad $" #shift ", %%mm5       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm2, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm2, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm1, %%mm1          \n\t" /* A2+B2  a2+b2 */\
-        "packssdw %%mm6, %%mm6          \n\t" /* A3+B3  a3+b3 */\
-        "movd %%mm1, 32+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A3-B3  a3-b3 */\
-        "packssdw %%mm5, %%mm5          \n\t" /* A2-B2  a2-b2 */\
-        "movd %%mm6, 48+" #dst "        \n\t"\
-        "movd %%mm4, 64+" #dst "        \n\t"\
-        "movd %%mm5, 80+" #dst "        \n\t"
-
-
-//IDCT(  src0,   src4,   src1,    src5,    dst, shift)
-IDCT(    (%1), 64(%1), 32(%1),  96(%1),  0(%0), 20)
-IDCT(   8(%1), 72(%1), 40(%1), 104(%1),  4(%0), 20)
-IDCT(  16(%1), 80(%1), 48(%1), 112(%1),  8(%0), 20)
-IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-        "jmp 9f                         \n\t"
-
-        "# .p2align 4                   \n\t"\
-        "5:                             \n\t"
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq %%mm0, %%mm5              \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "paddd %%mm1, %%mm0             \n\t" /* A1             a1 */\
-        "psubd %%mm1, %%mm5             \n\t" /* A2             a2 */\
-        "movq 8+" #src0 ", %%mm2        \n\t" /* R4     R0      r4      r0 */\
-        "movq 8+" #src4 ", %%mm3        \n\t" /* R6     R2      r6      r2 */\
-        "movq 16(%2), %%mm1             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm2, %%mm1           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm7             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm7, %%mm2           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm7             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm3, %%mm7           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "pmaddwd 40(%2), %%mm3          \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "paddd %%mm1, %%mm7             \n\t" /* A0             a0 */\
-        "paddd %%mm1, %%mm1             \n\t" /* 2C0            2c0 */\
-        "psubd %%mm7, %%mm1             \n\t" /* A3             a3 */\
-        "paddd %%mm2, %%mm3             \n\t" /* A1             a1 */\
-        "paddd %%mm2, %%mm2             \n\t" /* 2C1            2c1 */\
-        "psubd %%mm3, %%mm2             \n\t" /* A2             a2 */\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm3       \n\t"\
-        "packssdw %%mm7, %%mm4          \n\t" /* A0     a0 */\
-        "movq %%mm4, " #dst "           \n\t"\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "packssdw %%mm3, %%mm0          \n\t" /* A1     a1 */\
-        "movq %%mm0, 16+" #dst "        \n\t"\
-        "movq %%mm0, 96+" #dst "        \n\t"\
-        "movq %%mm4, 112+" #dst "       \n\t"\
-        "psrad $" #shift ", %%mm5       \n\t"\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm2, %%mm5          \n\t" /* A2-B2  a2-b2 */\
-        "movq %%mm5, 32+" #dst "        \n\t"\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "packssdw %%mm1, %%mm6          \n\t" /* A3+B3  a3+b3 */\
-        "movq %%mm6, 48+" #dst "        \n\t"\
-        "movq %%mm6, 64+" #dst "        \n\t"\
-        "movq %%mm5, 80+" #dst "        \n\t"
-
-
-//IDCT(  src0,   src4,   src1,    src5,    dst, shift)
-IDCT(    0(%1), 64(%1), 32(%1),  96(%1),  0(%0), 20)
-//IDCT(   8(%1), 72(%1), 40(%1), 104(%1),  4(%0), 20)
-IDCT(  16(%1), 80(%1), 48(%1), 112(%1),  8(%0), 20)
-//IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-        "jmp 9f                         \n\t"
-
-
-        "# .p2align 4                   \n\t"\
-        "1:                             \n\t"
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq " #src4 ", %%mm1          \n\t" /* R6     R2      r6      r2 */\
-        "movq " #src1 ", %%mm2          \n\t" /* R3     R1      r3      r1 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm5             \n\t" /* C6     C2      C6      C2 */\
-        "pmaddwd %%mm1, %%mm5           \n\t" /* C6R6+C2R2      C6r6+C2r2 */\
-        "movq 40(%2), %%mm6             \n\t" /* -C2    C6      -C2     C6 */\
-        "pmaddwd %%mm6, %%mm1           \n\t" /* -C2R6+C6R2     -C2r6+C6r2 */\
-        "movq %%mm4, %%mm6              \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 48(%2), %%mm7             \n\t" /* C3     C1      C3      C1 */\
-        "pmaddwd %%mm2, %%mm7           \n\t" /* C3R3+C1R1      C3r3+C1r1 */\
-        "paddd %%mm5, %%mm4             \n\t" /* A0             a0 */\
-        "psubd %%mm5, %%mm6             \n\t" /* A3             a3 */\
-        "movq %%mm0, %%mm5              \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "paddd %%mm1, %%mm0             \n\t" /* A1             a1 */\
-        "psubd %%mm1, %%mm5             \n\t" /* A2             a2 */\
-        "movq 64(%2), %%mm1             \n\t"\
-        "pmaddwd %%mm2, %%mm1           \n\t" /* -C7R3+C3R1     -C7r3+C3r1 */\
-        "paddd %%mm4, %%mm7             \n\t" /* A0+B0          a0+b0 */\
-        "paddd %%mm4, %%mm4             \n\t" /* 2A0            2a0 */\
-        "psubd %%mm7, %%mm4             \n\t" /* A0-B0          a0-b0 */\
-        "psrad $" #shift ", %%mm7       \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "movq %%mm0, %%mm3              \n\t" /* A1             a1 */\
-        "paddd %%mm1, %%mm0             \n\t" /* A1+B1          a1+b1 */\
-        "psubd %%mm1, %%mm3             \n\t" /* A1-B1          a1-b1 */\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "psrad $" #shift ", %%mm3       \n\t"\
-        "packssdw %%mm7, %%mm7          \n\t" /* A0+B0  a0+b0 */\
-        "movd %%mm7, " #dst "           \n\t"\
-        "packssdw %%mm0, %%mm0          \n\t" /* A1+B1  a1+b1 */\
-        "movd %%mm0, 16+" #dst "        \n\t"\
-        "packssdw %%mm3, %%mm3          \n\t" /* A1-B1  a1-b1 */\
-        "movd %%mm3, 96+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A0-B0  a0-b0 */\
-        "movd %%mm4, 112+" #dst "       \n\t"\
-        "movq 80(%2), %%mm4             \n\t" /* -C1    C5      -C1     C5 */\
-        "pmaddwd %%mm2, %%mm4           \n\t" /* -C1R3+C5R1     -C1r3+C5r1 */\
-        "pmaddwd 96(%2), %%mm2          \n\t" /* -C5R3+C7R1     -C5r3+C7r1 */\
-        "movq %%mm5, %%mm3              \n\t" /* A2             a2 */\
-        "paddd %%mm4, %%mm3             \n\t" /* A2+B2          a2+b2 */\
-        "psubd %%mm4, %%mm5             \n\t" /* a2-B2          a2-b2 */\
-        "psrad $" #shift ", %%mm3       \n\t"\
-        "psrad $" #shift ", %%mm5       \n\t"\
-        "movq %%mm6, %%mm4              \n\t" /* A3             a3 */\
-        "paddd %%mm2, %%mm6             \n\t" /* A3+B3          a3+b3 */\
-        "psubd %%mm2, %%mm4             \n\t" /* a3-B3          a3-b3 */\
-        "psrad $" #shift ", %%mm6       \n\t"\
-        "packssdw %%mm3, %%mm3          \n\t" /* A2+B2  a2+b2 */\
-        "movd %%mm3, 32+" #dst "        \n\t"\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "packssdw %%mm6, %%mm6          \n\t" /* A3+B3  a3+b3 */\
-        "movd %%mm6, 48+" #dst "        \n\t"\
-        "packssdw %%mm4, %%mm4          \n\t" /* A3-B3  a3-b3 */\
-        "packssdw %%mm5, %%mm5          \n\t" /* A2-B2  a2-b2 */\
-        "movd %%mm4, 64+" #dst "        \n\t"\
-        "movd %%mm5, 80+" #dst "        \n\t"
-
-
-//IDCT(  src0,   src4,   src1,    src5,    dst, shift)
-IDCT(    (%1), 64(%1), 32(%1),  96(%1),  0(%0), 20)
-IDCT(   8(%1), 72(%1), 40(%1), 104(%1),  4(%0), 20)
-IDCT(  16(%1), 80(%1), 48(%1), 112(%1),  8(%0), 20)
-IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-        "jmp 9f                         \n\t"
-
-
-        "# .p2align 4                   \n\t"
-        "7:                             \n\t"
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
-        "movq " #src0 ", %%mm0          \n\t" /* R4     R0      r4      r0 */\
-        "movq 16(%2), %%mm4             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm0, %%mm4           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm5             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm5, %%mm0           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "psrad $" #shift ", %%mm4       \n\t"\
-        "psrad $" #shift ", %%mm0       \n\t"\
-        "movq 8+" #src0 ", %%mm2        \n\t" /* R4     R0      r4      r0 */\
-        "movq 16(%2), %%mm1             \n\t" /* C4     C4      C4      C4 */\
-        "pmaddwd %%mm2, %%mm1           \n\t" /* C4R4+C4R0      C4r4+C4r0 */\
-        "movq 24(%2), %%mm7             \n\t" /* -C4    C4      -C4     C4 */\
-        "pmaddwd %%mm7, %%mm2           \n\t" /* -C4R4+C4R0     -C4r4+C4r0 */\
-        "movq 32(%2), %%mm7             \n\t" /* C6     C2      C6      C2 */\
-        "psrad $" #shift ", %%mm1       \n\t"\
-        "packssdw %%mm1, %%mm4          \n\t" /* A0     a0 */\
-        "movq %%mm4, " #dst "           \n\t"\
-        "psrad $" #shift ", %%mm2       \n\t"\
-        "packssdw %%mm2, %%mm0          \n\t" /* A1     a1 */\
-        "movq %%mm0, 16+" #dst "        \n\t"\
-        "movq %%mm0, 96+" #dst "        \n\t"\
-        "movq %%mm4, 112+" #dst "       \n\t"\
-        "movq %%mm0, 32+" #dst "        \n\t"\
-        "movq %%mm4, 48+" #dst "        \n\t"\
-        "movq %%mm4, 64+" #dst "        \n\t"\
-        "movq %%mm0, 80+" #dst "        \n\t"
-
-//IDCT(  src0,   src4,   src1,    src5,    dst, shift)
-IDCT(   0(%1), 64(%1), 32(%1),  96(%1),  0(%0), 20)
-//IDCT(   8(%1), 72(%1), 40(%1), 104(%1),  4(%0), 20)
-IDCT(  16(%1), 80(%1), 48(%1), 112(%1),  8(%0), 20)
-//IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-
-
-#endif
-
-/*
-Input
- 00 40 04 44 20 60 24 64
- 10 30 14 34 50 70 54 74
- 01 41 03 43 21 61 23 63
- 11 31 13 33 51 71 53 73
- 02 42 06 46 22 62 26 66
- 12 32 16 36 52 72 56 76
- 05 45 07 47 25 65 27 67
- 15 35 17 37 55 75 57 77
-
-Temp
- 00 04 10 14 20 24 30 34
- 40 44 50 54 60 64 70 74
- 01 03 11 13 21 23 31 33
- 41 43 51 53 61 63 71 73
- 02 06 12 16 22 26 32 36
- 42 46 52 56 62 66 72 76
- 05 07 15 17 25 27 35 37
- 45 47 55 57 65 67 75 77
-*/
-
-"9: \n\t"
-                :: "r" (block), "r" (temp), "r" (coeffs)
-                : "%eax"
-        );
-}
-
-void ff_simple_idct_mmx(int16_t *block)
-{
-    idct(block);
-}
-
-//FIXME merge add/put into the idct
-
-void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block)
-{
-    idct(block);
-    ff_put_pixels_clamped_mmx(block, dest, line_size);
-}
-void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block)
-{
-    idct(block);
-    ff_add_pixels_clamped_mmx(block, dest, line_size);
-}
-
-#endif /* HAVE_INLINE_ASM */
diff --git a/deps/libav/libavcodec/x86/vc1dsp.asm b/deps/libav/libavcodec/x86/vc1dsp.asm
deleted file mode 100644
index adf08d7..0000000
--- a/deps/libav/libavcodec/x86/vc1dsp.asm
+++ /dev/null
@@ -1,317 +0,0 @@
-;******************************************************************************
-;* VC1 deblocking optimizations
-;* Copyright (c) 2009 David Conrad
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-cextern pw_4
-cextern pw_5
-
-section .text
-
-; dst_low, dst_high (src), zero
-; zero-extends one vector from 8 to 16 bits
-%macro UNPACK_8TO16 4
-    mova      m%2, m%3
-    punpckh%1 m%3, m%4
-    punpckl%1 m%2, m%4
-%endmacro
-
-%macro STORE_4_WORDS 6
-%if cpuflag(sse4)
-    pextrw %1, %5, %6+0
-    pextrw %2, %5, %6+1
-    pextrw %3, %5, %6+2
-    pextrw %4, %5, %6+3
-%else
-    movd  %6d, %5
-%if mmsize==16
-    psrldq %5, 4
-%else
-    psrlq  %5, 32
-%endif
-    mov    %1, %6w
-    shr    %6, 16
-    mov    %2, %6w
-    movd  %6d, %5
-    mov    %3, %6w
-    shr    %6, 16
-    mov    %4, %6w
-%endif
-%endmacro
-
-; in:  p1 p0 q0 q1, clobbers p0
-; out: p1 = (2*(p1 - q1) - 5*(p0 - q0) + 4) >> 3
-%macro VC1_LOOP_FILTER_A0 4
-    psubw  %1, %4
-    psubw  %2, %3
-    paddw  %1, %1
-    pmullw %2, [pw_5]
-    psubw  %1, %2
-    paddw  %1, [pw_4]
-    psraw  %1, 3
-%endmacro
-
-; in: p0 q0 a0 a1 a2
-;     m0 m1 m7 m6 m5
-; %1: size
-; out: m0=p0' m1=q0'
-%macro VC1_FILTER 1
-    PABSW   m4, m7
-    PABSW   m3, m6
-    PABSW   m2, m5
-    mova    m6, m4
-    pminsw  m3, m2
-    pcmpgtw m6, m3  ; if (a2 < a0 || a1 < a0)
-    psubw   m3, m4
-    pmullw  m3, [pw_5]   ; 5*(a3 - a0)
-    PABSW   m2, m3
-    psraw   m2, 3   ; abs(d/8)
-    pxor    m7, m3  ; d_sign ^= a0_sign
-
-    pxor    m5, m5
-    movd    m3, r2d
-%if %1 > 4
-    punpcklbw m3, m3
-%endif
-    punpcklbw m3, m5
-    pcmpgtw m3, m4  ; if (a0 < pq)
-    pand    m6, m3
-
-    mova    m3, m0
-    psubw   m3, m1
-    PABSW   m4, m3
-    psraw   m4, 1
-    pxor    m3, m7  ; d_sign ^ clip_sign
-    psraw   m3, 15
-    pminsw  m2, m4  ; min(d, clip)
-    pcmpgtw m4, m5
-    pand    m6, m4  ; filt3 (C return value)
-
-; each set of 4 pixels is not filtered if the 3rd is not
-%if mmsize==16
-    pshuflw m4, m6, 0xaa
-%if %1 > 4
-    pshufhw m4, m4, 0xaa
-%endif
-%else
-    pshufw  m4, m6, 0xaa
-%endif
-    pandn   m3, m4
-    pand    m2, m6
-    pand    m3, m2  ; d final
-
-    psraw   m7, 15
-    pxor    m3, m7
-    psubw   m3, m7
-    psubw   m0, m3
-    paddw   m1, m3
-    packuswb m0, m0
-    packuswb m1, m1
-%endmacro
-
-; 1st param: size of filter
-; 2nd param: mov suffix equivalent to the filter size
-%macro VC1_V_LOOP_FILTER 2
-    pxor      m5, m5
-    mov%2     m6, [r4]
-    mov%2     m4, [r4+r1]
-    mov%2     m7, [r4+2*r1]
-    mov%2     m0, [r4+r3]
-    punpcklbw m6, m5
-    punpcklbw m4, m5
-    punpcklbw m7, m5
-    punpcklbw m0, m5
-
-    VC1_LOOP_FILTER_A0 m6, m4, m7, m0
-    mov%2     m1, [r0]
-    mov%2     m2, [r0+r1]
-    punpcklbw m1, m5
-    punpcklbw m2, m5
-    mova      m4, m0
-    VC1_LOOP_FILTER_A0 m7, m4, m1, m2
-    mov%2     m3, [r0+2*r1]
-    mov%2     m4, [r0+r3]
-    punpcklbw m3, m5
-    punpcklbw m4, m5
-    mova      m5, m1
-    VC1_LOOP_FILTER_A0 m5, m2, m3, m4
-
-    VC1_FILTER %1
-    mov%2 [r4+r3], m0
-    mov%2 [r0],    m1
-%endmacro
-
-; 1st param: size of filter
-;     NOTE: UNPACK_8TO16 this number of 8 bit numbers are in half a register
-; 2nd (optional) param: temp register to use for storing words
-%macro VC1_H_LOOP_FILTER 1-2
-%if %1 == 4
-    movq      m0, [r0     -4]
-    movq      m1, [r0+  r1-4]
-    movq      m2, [r0+2*r1-4]
-    movq      m3, [r0+  r3-4]
-    TRANSPOSE4x4B 0, 1, 2, 3, 4
-%else
-    movq      m0, [r0     -4]
-    movq      m4, [r0+  r1-4]
-    movq      m1, [r0+2*r1-4]
-    movq      m5, [r0+  r3-4]
-    movq      m2, [r4     -4]
-    movq      m6, [r4+  r1-4]
-    movq      m3, [r4+2*r1-4]
-    movq      m7, [r4+  r3-4]
-    punpcklbw m0, m4
-    punpcklbw m1, m5
-    punpcklbw m2, m6
-    punpcklbw m3, m7
-    TRANSPOSE4x4W 0, 1, 2, 3, 4
-%endif
-    pxor      m5, m5
-
-    UNPACK_8TO16 bw, 6, 0, 5
-    UNPACK_8TO16 bw, 7, 1, 5
-    VC1_LOOP_FILTER_A0 m6, m0, m7, m1
-    UNPACK_8TO16 bw, 4, 2, 5
-    mova    m0, m1                      ; m0 = p0
-    VC1_LOOP_FILTER_A0 m7, m1, m4, m2
-    UNPACK_8TO16 bw, 1, 3, 5
-    mova    m5, m4
-    VC1_LOOP_FILTER_A0 m5, m2, m1, m3
-    SWAP 1, 4                           ; m1 = q0
-
-    VC1_FILTER %1
-    punpcklbw m0, m1
-%if %0 > 1
-    STORE_4_WORDS [r0-1], [r0+r1-1], [r0+2*r1-1], [r0+r3-1], m0, %2
-%if %1 > 4
-    psrldq m0, 4
-    STORE_4_WORDS [r4-1], [r4+r1-1], [r4+2*r1-1], [r4+r3-1], m0, %2
-%endif
-%else
-    STORE_4_WORDS [r0-1], [r0+r1-1], [r0+2*r1-1], [r0+r3-1], m0, 0
-    STORE_4_WORDS [r4-1], [r4+r1-1], [r4+2*r1-1], [r4+r3-1], m0, 4
-%endif
-%endmacro
-
-
-%macro START_V_FILTER 0
-    mov  r4, r0
-    lea  r3, [4*r1]
-    sub  r4, r3
-    lea  r3, [r1+2*r1]
-    imul r2, 0x01010101
-%endmacro
-
-%macro START_H_FILTER 1
-    lea  r3, [r1+2*r1]
-%if %1 > 4
-    lea  r4, [r0+4*r1]
-%endif
-    imul r2, 0x01010101
-%endmacro
-
-%macro VC1_LF 0
-cglobal vc1_v_loop_filter_internal
-    VC1_V_LOOP_FILTER 4, d
-    ret
-
-cglobal vc1_h_loop_filter_internal
-    VC1_H_LOOP_FILTER 4, r4
-    ret
-
-; void ff_vc1_v_loop_filter4_mmxext(uint8_t *src, int stride, int pq)
-cglobal vc1_v_loop_filter4, 3,5,0
-    START_V_FILTER
-    call vc1_v_loop_filter_internal
-    RET
-
-; void ff_vc1_h_loop_filter4_mmxext(uint8_t *src, int stride, int pq)
-cglobal vc1_h_loop_filter4, 3,5,0
-    START_H_FILTER 4
-    call vc1_h_loop_filter_internal
-    RET
-
-; void ff_vc1_v_loop_filter8_mmxext(uint8_t *src, int stride, int pq)
-cglobal vc1_v_loop_filter8, 3,5,0
-    START_V_FILTER
-    call vc1_v_loop_filter_internal
-    add  r4, 4
-    add  r0, 4
-    call vc1_v_loop_filter_internal
-    RET
-
-; void ff_vc1_h_loop_filter8_mmxext(uint8_t *src, int stride, int pq)
-cglobal vc1_h_loop_filter8, 3,5,0
-    START_H_FILTER 4
-    call vc1_h_loop_filter_internal
-    lea  r0, [r0+4*r1]
-    call vc1_h_loop_filter_internal
-    RET
-%endmacro
-
-INIT_MMX mmxext
-VC1_LF
-
-INIT_XMM sse2
-; void ff_vc1_v_loop_filter8_sse2(uint8_t *src, int stride, int pq)
-cglobal vc1_v_loop_filter8, 3,5,8
-    START_V_FILTER
-    VC1_V_LOOP_FILTER 8, q
-    RET
-
-; void ff_vc1_h_loop_filter8_sse2(uint8_t *src, int stride, int pq)
-cglobal vc1_h_loop_filter8, 3,6,8
-    START_H_FILTER 8
-    VC1_H_LOOP_FILTER 8, r5
-    RET
-
-INIT_MMX ssse3
-; void ff_vc1_v_loop_filter4_ssse3(uint8_t *src, int stride, int pq)
-cglobal vc1_v_loop_filter4, 3,5,0
-    START_V_FILTER
-    VC1_V_LOOP_FILTER 4, d
-    RET
-
-; void ff_vc1_h_loop_filter4_ssse3(uint8_t *src, int stride, int pq)
-cglobal vc1_h_loop_filter4, 3,5,0
-    START_H_FILTER 4
-    VC1_H_LOOP_FILTER 4, r4
-    RET
-
-INIT_XMM ssse3
-; void ff_vc1_v_loop_filter8_ssse3(uint8_t *src, int stride, int pq)
-cglobal vc1_v_loop_filter8, 3,5,8
-    START_V_FILTER
-    VC1_V_LOOP_FILTER 8, q
-    RET
-
-; void ff_vc1_h_loop_filter8_ssse3(uint8_t *src, int stride, int pq)
-cglobal vc1_h_loop_filter8, 3,6,8
-    START_H_FILTER 8
-    VC1_H_LOOP_FILTER 8, r5
-    RET
-
-INIT_XMM sse4
-; void ff_vc1_h_loop_filter8_sse4(uint8_t *src, int stride, int pq)
-cglobal vc1_h_loop_filter8, 3,5,8
-    START_H_FILTER 8
-    VC1_H_LOOP_FILTER 8
-    RET
diff --git a/deps/libav/libavcodec/x86/vc1dsp.h b/deps/libav/libavcodec/x86/vc1dsp.h
deleted file mode 100644
index 9b6c8ad..0000000
--- a/deps/libav/libavcodec/x86/vc1dsp.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * VC-1 and WMV3 decoder - X86 DSP init functions
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_X86_VC1DSP_H
-#define AVCODEC_X86_VC1DSP_H
-
-#include "libavcodec/vc1dsp.h"
-
-void ff_vc1dsp_init_mmx(VC1DSPContext *dsp);
-void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp);
-
-#endif /* AVCODEC_X86_VC1DSP_H */
diff --git a/deps/libav/libavcodec/x86/vc1dsp_init.c b/deps/libav/libavcodec/x86/vc1dsp_init.c
deleted file mode 100644
index 9bd5ae3..0000000
--- a/deps/libav/libavcodec/x86/vc1dsp_init.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * VC-1 and WMV3 - DSP functions MMX-optimized
- * Copyright (c) 2007 Christophe GISQUET <christophe.gisquet at free.fr>
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following
- * conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/vc1dsp.h"
-#include "dsputil_x86.h"
-#include "vc1dsp.h"
-#include "config.h"
-
-#define LOOP_FILTER(EXT) \
-void ff_vc1_v_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \
-void ff_vc1_h_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \
-void ff_vc1_v_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \
-void ff_vc1_h_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \
-\
-static void vc1_v_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \
-{ \
-    ff_vc1_v_loop_filter8_ ## EXT(src,   stride, pq); \
-    ff_vc1_v_loop_filter8_ ## EXT(src+8, stride, pq); \
-} \
-\
-static void vc1_h_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \
-{ \
-    ff_vc1_h_loop_filter8_ ## EXT(src,          stride, pq); \
-    ff_vc1_h_loop_filter8_ ## EXT(src+8*stride, stride, pq); \
-}
-
-#if HAVE_YASM
-LOOP_FILTER(mmxext)
-LOOP_FILTER(sse2)
-LOOP_FILTER(ssse3)
-
-void ff_vc1_h_loop_filter8_sse4(uint8_t *src, int stride, int pq);
-
-static void vc1_h_loop_filter16_sse4(uint8_t *src, int stride, int pq)
-{
-    ff_vc1_h_loop_filter8_sse4(src,          stride, pq);
-    ff_vc1_h_loop_filter8_sse4(src+8*stride, stride, pq);
-}
-
-static void avg_vc1_mspel_mc00_mmxext(uint8_t *dst, const uint8_t *src,
-                                      ptrdiff_t stride, int rnd)
-{
-    ff_avg_pixels8_mmxext(dst, src, stride, 8);
-}
-#endif /* HAVE_YASM */
-
-void ff_put_vc1_chroma_mc8_nornd_mmx  (uint8_t *dst, uint8_t *src,
-                                       int stride, int h, int x, int y);
-void ff_avg_vc1_chroma_mc8_nornd_mmxext(uint8_t *dst, uint8_t *src,
-                                        int stride, int h, int x, int y);
-void ff_avg_vc1_chroma_mc8_nornd_3dnow(uint8_t *dst, uint8_t *src,
-                                       int stride, int h, int x, int y);
-void ff_put_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src,
-                                       int stride, int h, int x, int y);
-void ff_avg_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src,
-                                       int stride, int h, int x, int y);
-
-
-av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (INLINE_MMX(cpu_flags))
-        ff_vc1dsp_init_mmx(dsp);
-
-    if (INLINE_MMXEXT(cpu_flags))
-        ff_vc1dsp_init_mmxext(dsp);
-
-#define ASSIGN_LF(EXT) \
-        dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
-        dsp->vc1_h_loop_filter4  = ff_vc1_h_loop_filter4_ ## EXT; \
-        dsp->vc1_v_loop_filter8  = ff_vc1_v_loop_filter8_ ## EXT; \
-        dsp->vc1_h_loop_filter8  = ff_vc1_h_loop_filter8_ ## EXT; \
-        dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_ ## EXT; \
-        dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_ ## EXT
-
-#if HAVE_YASM
-    if (EXTERNAL_MMX(cpu_flags)) {
-        dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_nornd_mmx;
-    }
-    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-        dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_3dnow;
-    }
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        ASSIGN_LF(mmxext);
-        dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_mmxext;
-
-        dsp->avg_vc1_mspel_pixels_tab[0]         = avg_vc1_mspel_mc00_mmxext;
-    }
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        dsp->vc1_v_loop_filter8  = ff_vc1_v_loop_filter8_sse2;
-        dsp->vc1_h_loop_filter8  = ff_vc1_h_loop_filter8_sse2;
-        dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_sse2;
-        dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse2;
-    }
-    if (EXTERNAL_SSSE3(cpu_flags)) {
-        ASSIGN_LF(ssse3);
-        dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_nornd_ssse3;
-        dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_ssse3;
-    }
-    if (EXTERNAL_SSE4(cpu_flags)) {
-        dsp->vc1_h_loop_filter8  = ff_vc1_h_loop_filter8_sse4;
-        dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse4;
-    }
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavcodec/x86/vc1dsp_mmx.c b/deps/libav/libavcodec/x86/vc1dsp_mmx.c
deleted file mode 100644
index 15fd2c8..0000000
--- a/deps/libav/libavcodec/x86/vc1dsp_mmx.c
+++ /dev/null
@@ -1,758 +0,0 @@
-/*
- * VC-1 and WMV3 - DSP functions MMX-optimized
- * Copyright (c) 2007 Christophe GISQUET <christophe.gisquet at free.fr>
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following
- * conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "libavutil/cpu.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/vc1dsp.h"
-#include "constants.h"
-#include "dsputil_x86.h"
-#include "vc1dsp.h"
-
-#if HAVE_INLINE_ASM
-
-#define OP_PUT(S,D)
-#define OP_AVG(S,D) "pavgb " #S ", " #D " \n\t"
-
-/** Add rounder from mm7 to mm3 and pack result at destination */
-#define NORMALIZE_MMX(SHIFT)                                    \
-     "paddw     %%mm7, %%mm3           \n\t" /* +bias-r */      \
-     "paddw     %%mm7, %%mm4           \n\t" /* +bias-r */      \
-     "psraw     "SHIFT", %%mm3         \n\t"                    \
-     "psraw     "SHIFT", %%mm4         \n\t"
-
-#define TRANSFER_DO_PACK(OP)                    \
-     "packuswb  %%mm4, %%mm3           \n\t"    \
-     OP((%2), %%mm3)                            \
-     "movq      %%mm3, (%2)            \n\t"
-
-#define TRANSFER_DONT_PACK(OP)                  \
-     OP(0(%2), %%mm3)                           \
-     OP(8(%2), %%mm4)                           \
-     "movq      %%mm3, 0(%2)           \n\t"    \
-     "movq      %%mm4, 8(%2)           \n\t"
-
-/** @see MSPEL_FILTER13_CORE for use as UNPACK macro */
-#define DO_UNPACK(reg)  "punpcklbw %%mm0, " reg "\n\t"
-#define DONT_UNPACK(reg)
-
-/** Compute the rounder 32-r or 8-r and unpacks it to mm7 */
-#define LOAD_ROUNDER_MMX(ROUND)                 \
-     "movd      "ROUND", %%mm7         \n\t"    \
-     "punpcklwd %%mm7, %%mm7           \n\t"    \
-     "punpckldq %%mm7, %%mm7           \n\t"
-
-#define SHIFT2_LINE(OFF, R0,R1,R2,R3)           \
-    "paddw     %%mm"#R2", %%mm"#R1"    \n\t"    \
-    "movd      (%0,%3), %%mm"#R0"      \n\t"    \
-    "pmullw    %%mm6, %%mm"#R1"        \n\t"    \
-    "punpcklbw %%mm0, %%mm"#R0"        \n\t"    \
-    "movd      (%0,%2), %%mm"#R3"      \n\t"    \
-    "psubw     %%mm"#R0", %%mm"#R1"    \n\t"    \
-    "punpcklbw %%mm0, %%mm"#R3"        \n\t"    \
-    "paddw     %%mm7, %%mm"#R1"        \n\t"    \
-    "psubw     %%mm"#R3", %%mm"#R1"    \n\t"    \
-    "psraw     %4, %%mm"#R1"           \n\t"    \
-    "movq      %%mm"#R1", "#OFF"(%1)   \n\t"    \
-    "add       %2, %0                  \n\t"
-
-/** Sacrifying mm6 allows to pipeline loads from src */
-static void vc1_put_ver_16b_shift2_mmx(int16_t *dst,
-                                       const uint8_t *src, x86_reg stride,
-                                       int rnd, int64_t shift)
-{
-    __asm__ volatile(
-        "mov       $3, %%"REG_c"           \n\t"
-        LOAD_ROUNDER_MMX("%5")
-        "movq      "MANGLE(ff_pw_9)", %%mm6 \n\t"
-        "1:                                \n\t"
-        "movd      (%0), %%mm2             \n\t"
-        "add       %2, %0                  \n\t"
-        "movd      (%0), %%mm3             \n\t"
-        "punpcklbw %%mm0, %%mm2            \n\t"
-        "punpcklbw %%mm0, %%mm3            \n\t"
-        SHIFT2_LINE(  0, 1, 2, 3, 4)
-        SHIFT2_LINE( 24, 2, 3, 4, 1)
-        SHIFT2_LINE( 48, 3, 4, 1, 2)
-        SHIFT2_LINE( 72, 4, 1, 2, 3)
-        SHIFT2_LINE( 96, 1, 2, 3, 4)
-        SHIFT2_LINE(120, 2, 3, 4, 1)
-        SHIFT2_LINE(144, 3, 4, 1, 2)
-        SHIFT2_LINE(168, 4, 1, 2, 3)
-        "sub       %6, %0                  \n\t"
-        "add       $8, %1                  \n\t"
-        "dec       %%"REG_c"               \n\t"
-        "jnz 1b                            \n\t"
-        : "+r"(src), "+r"(dst)
-        : "r"(stride), "r"(-2*stride),
-          "m"(shift), "m"(rnd), "r"(9*stride-4)
-        : "%"REG_c, "memory"
-    );
-}
-
-/**
- * Data is already unpacked, so some operations can directly be made from
- * memory.
- */
-#define VC1_HOR_16b_SHIFT2(OP, OPNAME)\
-static void OPNAME ## vc1_hor_16b_shift2_mmx(uint8_t *dst, x86_reg stride,\
-                                             const int16_t *src, int rnd)\
-{\
-    int h = 8;\
-\
-    src -= 1;\
-    rnd -= (-1+9+9-1)*1024; /* Add -1024 bias */\
-    __asm__ volatile(\
-        LOAD_ROUNDER_MMX("%4")\
-        "movq      "MANGLE(ff_pw_128)", %%mm6\n\t"\
-        "movq      "MANGLE(ff_pw_9)", %%mm5 \n\t"\
-        "1:                                \n\t"\
-        "movq      2*0+0(%1), %%mm1        \n\t"\
-        "movq      2*0+8(%1), %%mm2        \n\t"\
-        "movq      2*1+0(%1), %%mm3        \n\t"\
-        "movq      2*1+8(%1), %%mm4        \n\t"\
-        "paddw     2*3+0(%1), %%mm1        \n\t"\
-        "paddw     2*3+8(%1), %%mm2        \n\t"\
-        "paddw     2*2+0(%1), %%mm3        \n\t"\
-        "paddw     2*2+8(%1), %%mm4        \n\t"\
-        "pmullw    %%mm5, %%mm3            \n\t"\
-        "pmullw    %%mm5, %%mm4            \n\t"\
-        "psubw     %%mm1, %%mm3            \n\t"\
-        "psubw     %%mm2, %%mm4            \n\t"\
-        NORMALIZE_MMX("$7")\
-        /* Remove bias */\
-        "paddw     %%mm6, %%mm3            \n\t"\
-        "paddw     %%mm6, %%mm4            \n\t"\
-        TRANSFER_DO_PACK(OP)\
-        "add       $24, %1                 \n\t"\
-        "add       %3, %2                  \n\t"\
-        "decl      %0                      \n\t"\
-        "jnz 1b                            \n\t"\
-        : "+r"(h), "+r" (src),  "+r" (dst)\
-        : "r"(stride), "m"(rnd)\
-        : "memory"\
-    );\
-}
-
-VC1_HOR_16b_SHIFT2(OP_PUT, put_)
-VC1_HOR_16b_SHIFT2(OP_AVG, avg_)
-
-
-/**
- * Purely vertical or horizontal 1/2 shift interpolation.
- * Sacrify mm6 for *9 factor.
- */
-#define VC1_SHIFT2(OP, OPNAME)\
-static void OPNAME ## vc1_shift2_mmx(uint8_t *dst, const uint8_t *src,\
-                                     x86_reg stride, int rnd, x86_reg offset)\
-{\
-    rnd = 8-rnd;\
-    __asm__ volatile(\
-        "mov       $8, %%"REG_c"           \n\t"\
-        LOAD_ROUNDER_MMX("%5")\
-        "movq      "MANGLE(ff_pw_9)", %%mm6\n\t"\
-        "1:                                \n\t"\
-        "movd      0(%0   ), %%mm3         \n\t"\
-        "movd      4(%0   ), %%mm4         \n\t"\
-        "movd      0(%0,%2), %%mm1         \n\t"\
-        "movd      4(%0,%2), %%mm2         \n\t"\
-        "add       %2, %0                  \n\t"\
-        "punpcklbw %%mm0, %%mm3            \n\t"\
-        "punpcklbw %%mm0, %%mm4            \n\t"\
-        "punpcklbw %%mm0, %%mm1            \n\t"\
-        "punpcklbw %%mm0, %%mm2            \n\t"\
-        "paddw     %%mm1, %%mm3            \n\t"\
-        "paddw     %%mm2, %%mm4            \n\t"\
-        "movd      0(%0,%3), %%mm1         \n\t"\
-        "movd      4(%0,%3), %%mm2         \n\t"\
-        "pmullw    %%mm6, %%mm3            \n\t" /* 0,9,9,0*/\
-        "pmullw    %%mm6, %%mm4            \n\t" /* 0,9,9,0*/\
-        "punpcklbw %%mm0, %%mm1            \n\t"\
-        "punpcklbw %%mm0, %%mm2            \n\t"\
-        "psubw     %%mm1, %%mm3            \n\t" /*-1,9,9,0*/\
-        "psubw     %%mm2, %%mm4            \n\t" /*-1,9,9,0*/\
-        "movd      0(%0,%2), %%mm1         \n\t"\
-        "movd      4(%0,%2), %%mm2         \n\t"\
-        "punpcklbw %%mm0, %%mm1            \n\t"\
-        "punpcklbw %%mm0, %%mm2            \n\t"\
-        "psubw     %%mm1, %%mm3            \n\t" /*-1,9,9,-1*/\
-        "psubw     %%mm2, %%mm4            \n\t" /*-1,9,9,-1*/\
-        NORMALIZE_MMX("$4")\
-        "packuswb  %%mm4, %%mm3            \n\t"\
-        OP((%1), %%mm3)\
-        "movq      %%mm3, (%1)             \n\t"\
-        "add       %6, %0                  \n\t"\
-        "add       %4, %1                  \n\t"\
-        "dec       %%"REG_c"               \n\t"\
-        "jnz 1b                            \n\t"\
-        : "+r"(src),  "+r"(dst)\
-        : "r"(offset), "r"(-2*offset), "g"(stride), "m"(rnd),\
-          "g"(stride-offset)\
-        : "%"REG_c, "memory"\
-    );\
-}
-
-VC1_SHIFT2(OP_PUT, put_)
-VC1_SHIFT2(OP_AVG, avg_)
-
-/**
- * Core of the 1/4 and 3/4 shift bicubic interpolation.
- *
- * @param UNPACK  Macro unpacking arguments from 8 to 16bits (can be empty).
- * @param MOVQ    "movd 1" or "movq 2", if data read is already unpacked.
- * @param A1      Address of 1st tap (beware of unpacked/packed).
- * @param A2      Address of 2nd tap
- * @param A3      Address of 3rd tap
- * @param A4      Address of 4th tap
- */
-#define MSPEL_FILTER13_CORE(UNPACK, MOVQ, A1, A2, A3, A4)       \
-     MOVQ "*0+"A1", %%mm1       \n\t"                           \
-     MOVQ "*4+"A1", %%mm2       \n\t"                           \
-     UNPACK("%%mm1")                                            \
-     UNPACK("%%mm2")                                            \
-     "pmullw    "MANGLE(ff_pw_3)", %%mm1\n\t"                   \
-     "pmullw    "MANGLE(ff_pw_3)", %%mm2\n\t"                   \
-     MOVQ "*0+"A2", %%mm3       \n\t"                           \
-     MOVQ "*4+"A2", %%mm4       \n\t"                           \
-     UNPACK("%%mm3")                                            \
-     UNPACK("%%mm4")                                            \
-     "pmullw    %%mm6, %%mm3    \n\t" /* *18 */                 \
-     "pmullw    %%mm6, %%mm4    \n\t" /* *18 */                 \
-     "psubw     %%mm1, %%mm3    \n\t" /* 18,-3 */               \
-     "psubw     %%mm2, %%mm4    \n\t" /* 18,-3 */               \
-     MOVQ "*0+"A4", %%mm1       \n\t"                           \
-     MOVQ "*4+"A4", %%mm2       \n\t"                           \
-     UNPACK("%%mm1")                                            \
-     UNPACK("%%mm2")                                            \
-     "psllw     $2, %%mm1       \n\t" /* 4* */                  \
-     "psllw     $2, %%mm2       \n\t" /* 4* */                  \
-     "psubw     %%mm1, %%mm3    \n\t" /* -4,18,-3 */            \
-     "psubw     %%mm2, %%mm4    \n\t" /* -4,18,-3 */            \
-     MOVQ "*0+"A3", %%mm1       \n\t"                           \
-     MOVQ "*4+"A3", %%mm2       \n\t"                           \
-     UNPACK("%%mm1")                                            \
-     UNPACK("%%mm2")                                            \
-     "pmullw    %%mm5, %%mm1    \n\t" /* *53 */                 \
-     "pmullw    %%mm5, %%mm2    \n\t" /* *53 */                 \
-     "paddw     %%mm1, %%mm3    \n\t" /* 4,53,18,-3 */          \
-     "paddw     %%mm2, %%mm4    \n\t" /* 4,53,18,-3 */
-
-/**
- * Macro to build the vertical 16bits version of vc1_put_shift[13].
- * Here, offset=src_stride. Parameters passed A1 to A4 must use
- * %3 (src_stride) and %4 (3*src_stride).
- *
- * @param  NAME   Either 1 or 3
- * @see MSPEL_FILTER13_CORE for information on A1->A4
- */
-#define MSPEL_FILTER13_VER_16B(NAME, A1, A2, A3, A4)                    \
-static void                                                             \
-vc1_put_ver_16b_ ## NAME ## _mmx(int16_t *dst, const uint8_t *src,      \
-                                 x86_reg src_stride,                   \
-                                 int rnd, int64_t shift)                \
-{                                                                       \
-    int h = 8;                                                          \
-    src -= src_stride;                                                  \
-    __asm__ volatile(                                                       \
-        LOAD_ROUNDER_MMX("%5")                                          \
-        "movq      "MANGLE(ff_pw_53)", %%mm5\n\t"                       \
-        "movq      "MANGLE(ff_pw_18)", %%mm6\n\t"                       \
-        ".p2align 3                \n\t"                                \
-        "1:                        \n\t"                                \
-        MSPEL_FILTER13_CORE(DO_UNPACK, "movd  1", A1, A2, A3, A4)       \
-        NORMALIZE_MMX("%6")                                             \
-        TRANSFER_DONT_PACK(OP_PUT)                                      \
-        /* Last 3 (in fact 4) bytes on the line */                      \
-        "movd      8+"A1", %%mm1   \n\t"                                \
-        DO_UNPACK("%%mm1")                                              \
-        "movq      %%mm1, %%mm3    \n\t"                                \
-        "paddw     %%mm1, %%mm1    \n\t"                                \
-        "paddw     %%mm3, %%mm1    \n\t" /* 3* */                       \
-        "movd      8+"A2", %%mm3   \n\t"                                \
-        DO_UNPACK("%%mm3")                                              \
-        "pmullw    %%mm6, %%mm3    \n\t" /* *18 */                      \
-        "psubw     %%mm1, %%mm3    \n\t" /*18,-3 */                     \
-        "movd      8+"A3", %%mm1   \n\t"                                \
-        DO_UNPACK("%%mm1")                                              \
-        "pmullw    %%mm5, %%mm1    \n\t" /* *53 */                      \
-        "paddw     %%mm1, %%mm3    \n\t" /*53,18,-3 */                  \
-        "movd      8+"A4", %%mm1   \n\t"                                \
-        DO_UNPACK("%%mm1")                                              \
-        "psllw     $2, %%mm1       \n\t" /* 4* */                       \
-        "psubw     %%mm1, %%mm3    \n\t"                                \
-        "paddw     %%mm7, %%mm3    \n\t"                                \
-        "psraw     %6, %%mm3       \n\t"                                \
-        "movq      %%mm3, 16(%2)   \n\t"                                \
-        "add       %3, %1          \n\t"                                \
-        "add       $24, %2         \n\t"                                \
-        "decl      %0              \n\t"                                \
-        "jnz 1b                    \n\t"                                \
-        : "+r"(h), "+r" (src),  "+r" (dst)                              \
-        : "r"(src_stride), "r"(3*src_stride),                           \
-          "m"(rnd), "m"(shift)                                          \
-        : "memory"                                                      \
-    );                                                                  \
-}
-
-/**
- * Macro to build the horizontal 16bits version of vc1_put_shift[13].
- * Here, offset=16bits, so parameters passed A1 to A4 should be simple.
- *
- * @param  NAME   Either 1 or 3
- * @see MSPEL_FILTER13_CORE for information on A1->A4
- */
-#define MSPEL_FILTER13_HOR_16B(NAME, A1, A2, A3, A4, OP, OPNAME)        \
-static void                                                             \
-OPNAME ## vc1_hor_16b_ ## NAME ## _mmx(uint8_t *dst, x86_reg stride,    \
-                                 const int16_t *src, int rnd)           \
-{                                                                       \
-    int h = 8;                                                          \
-    src -= 1;                                                           \
-    rnd -= (-4+58+13-3)*256; /* Add -256 bias */                        \
-    __asm__ volatile(                                                       \
-        LOAD_ROUNDER_MMX("%4")                                          \
-        "movq      "MANGLE(ff_pw_18)", %%mm6   \n\t"                    \
-        "movq      "MANGLE(ff_pw_53)", %%mm5   \n\t"                    \
-        ".p2align 3                \n\t"                                \
-        "1:                        \n\t"                                \
-        MSPEL_FILTER13_CORE(DONT_UNPACK, "movq 2", A1, A2, A3, A4)      \
-        NORMALIZE_MMX("$7")                                             \
-        /* Remove bias */                                               \
-        "paddw     "MANGLE(ff_pw_128)", %%mm3  \n\t"                    \
-        "paddw     "MANGLE(ff_pw_128)", %%mm4  \n\t"                    \
-        TRANSFER_DO_PACK(OP)                                            \
-        "add       $24, %1         \n\t"                                \
-        "add       %3, %2          \n\t"                                \
-        "decl      %0              \n\t"                                \
-        "jnz 1b                    \n\t"                                \
-        : "+r"(h), "+r" (src),  "+r" (dst)                              \
-        : "r"(stride), "m"(rnd)                                         \
-        : "memory"                                                      \
-    );                                                                  \
-}
-
-/**
- * Macro to build the 8bits, any direction, version of vc1_put_shift[13].
- * Here, offset=src_stride. Parameters passed A1 to A4 must use
- * %3 (offset) and %4 (3*offset).
- *
- * @param  NAME   Either 1 or 3
- * @see MSPEL_FILTER13_CORE for information on A1->A4
- */
-#define MSPEL_FILTER13_8B(NAME, A1, A2, A3, A4, OP, OPNAME)             \
-static void                                                             \
-OPNAME ## vc1_## NAME ## _mmx(uint8_t *dst, const uint8_t *src,         \
-                        x86_reg stride, int rnd, x86_reg offset)      \
-{                                                                       \
-    int h = 8;                                                          \
-    src -= offset;                                                      \
-    rnd = 32-rnd;                                                       \
-    __asm__ volatile (                                                      \
-        LOAD_ROUNDER_MMX("%6")                                          \
-        "movq      "MANGLE(ff_pw_53)", %%mm5       \n\t"                \
-        "movq      "MANGLE(ff_pw_18)", %%mm6       \n\t"                \
-        ".p2align 3                \n\t"                                \
-        "1:                        \n\t"                                \
-        MSPEL_FILTER13_CORE(DO_UNPACK, "movd   1", A1, A2, A3, A4)      \
-        NORMALIZE_MMX("$6")                                             \
-        TRANSFER_DO_PACK(OP)                                            \
-        "add       %5, %1          \n\t"                                \
-        "add       %5, %2          \n\t"                                \
-        "decl      %0              \n\t"                                \
-        "jnz 1b                    \n\t"                                \
-        : "+r"(h), "+r" (src),  "+r" (dst)                              \
-        : "r"(offset), "r"(3*offset), "g"(stride), "m"(rnd)             \
-        : "memory"                                                      \
-    );                                                                  \
-}
-
-/** 1/4 shift bicubic interpolation */
-MSPEL_FILTER13_8B     (shift1, "0(%1,%4  )", "0(%1,%3,2)", "0(%1,%3  )", "0(%1     )", OP_PUT, put_)
-MSPEL_FILTER13_8B     (shift1, "0(%1,%4  )", "0(%1,%3,2)", "0(%1,%3  )", "0(%1     )", OP_AVG, avg_)
-MSPEL_FILTER13_VER_16B(shift1, "0(%1,%4  )", "0(%1,%3,2)", "0(%1,%3  )", "0(%1     )")
-MSPEL_FILTER13_HOR_16B(shift1, "2*3(%1)", "2*2(%1)", "2*1(%1)", "2*0(%1)", OP_PUT, put_)
-MSPEL_FILTER13_HOR_16B(shift1, "2*3(%1)", "2*2(%1)", "2*1(%1)", "2*0(%1)", OP_AVG, avg_)
-
-/** 3/4 shift bicubic interpolation */
-MSPEL_FILTER13_8B     (shift3, "0(%1     )", "0(%1,%3  )", "0(%1,%3,2)", "0(%1,%4  )", OP_PUT, put_)
-MSPEL_FILTER13_8B     (shift3, "0(%1     )", "0(%1,%3  )", "0(%1,%3,2)", "0(%1,%4  )", OP_AVG, avg_)
-MSPEL_FILTER13_VER_16B(shift3, "0(%1     )", "0(%1,%3  )", "0(%1,%3,2)", "0(%1,%4  )")
-MSPEL_FILTER13_HOR_16B(shift3, "2*0(%1)", "2*1(%1)", "2*2(%1)", "2*3(%1)", OP_PUT, put_)
-MSPEL_FILTER13_HOR_16B(shift3, "2*0(%1)", "2*1(%1)", "2*2(%1)", "2*3(%1)", OP_AVG, avg_)
-
-typedef void (*vc1_mspel_mc_filter_ver_16bits)(int16_t *dst, const uint8_t *src, x86_reg src_stride, int rnd, int64_t shift);
-typedef void (*vc1_mspel_mc_filter_hor_16bits)(uint8_t *dst, x86_reg dst_stride, const int16_t *src, int rnd);
-typedef void (*vc1_mspel_mc_filter_8bits)(uint8_t *dst, const uint8_t *src, x86_reg stride, int rnd, x86_reg offset);
-
-/**
- * Interpolate fractional pel values by applying proper vertical then
- * horizontal filter.
- *
- * @param  dst     Destination buffer for interpolated pels.
- * @param  src     Source buffer.
- * @param  stride  Stride for both src and dst buffers.
- * @param  hmode   Horizontal filter (expressed in quarter pixels shift).
- * @param  hmode   Vertical filter.
- * @param  rnd     Rounding bias.
- */
-#define VC1_MSPEL_MC(OP)\
-static void OP ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride,\
-                               int hmode, int vmode, int rnd)\
-{\
-    static const vc1_mspel_mc_filter_ver_16bits vc1_put_shift_ver_16bits[] =\
-         { NULL, vc1_put_ver_16b_shift1_mmx, vc1_put_ver_16b_shift2_mmx, vc1_put_ver_16b_shift3_mmx };\
-    static const vc1_mspel_mc_filter_hor_16bits vc1_put_shift_hor_16bits[] =\
-         { NULL, OP ## vc1_hor_16b_shift1_mmx, OP ## vc1_hor_16b_shift2_mmx, OP ## vc1_hor_16b_shift3_mmx };\
-    static const vc1_mspel_mc_filter_8bits vc1_put_shift_8bits[] =\
-         { NULL, OP ## vc1_shift1_mmx, OP ## vc1_shift2_mmx, OP ## vc1_shift3_mmx };\
-\
-    __asm__ volatile(\
-        "pxor %%mm0, %%mm0         \n\t"\
-        ::: "memory"\
-    );\
-\
-    if (vmode) { /* Vertical filter to apply */\
-        if (hmode) { /* Horizontal filter to apply, output to tmp */\
-            static const int shift_value[] = { 0, 5, 1, 5 };\
-            int              shift = (shift_value[hmode]+shift_value[vmode])>>1;\
-            int              r;\
-            DECLARE_ALIGNED(16, int16_t, tmp)[12*8];\
-\
-            r = (1<<(shift-1)) + rnd-1;\
-            vc1_put_shift_ver_16bits[vmode](tmp, src-1, stride, r, shift);\
-\
-            vc1_put_shift_hor_16bits[hmode](dst, stride, tmp+1, 64-rnd);\
-            return;\
-        }\
-        else { /* No horizontal filter, output 8 lines to dst */\
-            vc1_put_shift_8bits[vmode](dst, src, stride, 1-rnd, stride);\
-            return;\
-        }\
-    }\
-\
-    /* Horizontal mode with no vertical mode */\
-    vc1_put_shift_8bits[hmode](dst, src, stride, rnd, 1);\
-}
-
-VC1_MSPEL_MC(put_)
-VC1_MSPEL_MC(avg_)
-
-/** Macro to ease bicubic filter interpolation functions declarations */
-#define DECLARE_FUNCTION(a, b)                                          \
-static void put_vc1_mspel_mc ## a ## b ## _mmx(uint8_t *dst,            \
-                                               const uint8_t *src,      \
-                                               ptrdiff_t stride,        \
-                                               int rnd)                 \
-{                                                                       \
-     put_vc1_mspel_mc(dst, src, stride, a, b, rnd);                     \
-}\
-static void avg_vc1_mspel_mc ## a ## b ## _mmxext(uint8_t *dst,         \
-                                                  const uint8_t *src,   \
-                                                  ptrdiff_t stride,     \
-                                                  int rnd)              \
-{                                                                       \
-     avg_vc1_mspel_mc(dst, src, stride, a, b, rnd);                     \
-}
-
-DECLARE_FUNCTION(0, 1)
-DECLARE_FUNCTION(0, 2)
-DECLARE_FUNCTION(0, 3)
-
-DECLARE_FUNCTION(1, 0)
-DECLARE_FUNCTION(1, 1)
-DECLARE_FUNCTION(1, 2)
-DECLARE_FUNCTION(1, 3)
-
-DECLARE_FUNCTION(2, 0)
-DECLARE_FUNCTION(2, 1)
-DECLARE_FUNCTION(2, 2)
-DECLARE_FUNCTION(2, 3)
-
-DECLARE_FUNCTION(3, 0)
-DECLARE_FUNCTION(3, 1)
-DECLARE_FUNCTION(3, 2)
-DECLARE_FUNCTION(3, 3)
-
-static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize,
-                                        int16_t *block)
-{
-    int dc = block[0];
-    dc = (17 * dc +  4) >> 3;
-    dc = (17 * dc + 64) >> 7;
-    __asm__ volatile(
-        "movd          %0, %%mm0 \n\t"
-        "pshufw $0, %%mm0, %%mm0 \n\t"
-        "pxor       %%mm1, %%mm1 \n\t"
-        "psubw      %%mm0, %%mm1 \n\t"
-        "packuswb   %%mm0, %%mm0 \n\t"
-        "packuswb   %%mm1, %%mm1 \n\t"
-        ::"r"(dc)
-    );
-    __asm__ volatile(
-        "movd          %0, %%mm2 \n\t"
-        "movd          %1, %%mm3 \n\t"
-        "movd          %2, %%mm4 \n\t"
-        "movd          %3, %%mm5 \n\t"
-        "paddusb    %%mm0, %%mm2 \n\t"
-        "paddusb    %%mm0, %%mm3 \n\t"
-        "paddusb    %%mm0, %%mm4 \n\t"
-        "paddusb    %%mm0, %%mm5 \n\t"
-        "psubusb    %%mm1, %%mm2 \n\t"
-        "psubusb    %%mm1, %%mm3 \n\t"
-        "psubusb    %%mm1, %%mm4 \n\t"
-        "psubusb    %%mm1, %%mm5 \n\t"
-        "movd       %%mm2, %0    \n\t"
-        "movd       %%mm3, %1    \n\t"
-        "movd       %%mm4, %2    \n\t"
-        "movd       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
-    );
-}
-
-static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize,
-                                        int16_t *block)
-{
-    int dc = block[0];
-    dc = (17 * dc +  4) >> 3;
-    dc = (12 * dc + 64) >> 7;
-    __asm__ volatile(
-        "movd          %0, %%mm0 \n\t"
-        "pshufw $0, %%mm0, %%mm0 \n\t"
-        "pxor       %%mm1, %%mm1 \n\t"
-        "psubw      %%mm0, %%mm1 \n\t"
-        "packuswb   %%mm0, %%mm0 \n\t"
-        "packuswb   %%mm1, %%mm1 \n\t"
-        ::"r"(dc)
-    );
-    __asm__ volatile(
-        "movd          %0, %%mm2 \n\t"
-        "movd          %1, %%mm3 \n\t"
-        "movd          %2, %%mm4 \n\t"
-        "movd          %3, %%mm5 \n\t"
-        "paddusb    %%mm0, %%mm2 \n\t"
-        "paddusb    %%mm0, %%mm3 \n\t"
-        "paddusb    %%mm0, %%mm4 \n\t"
-        "paddusb    %%mm0, %%mm5 \n\t"
-        "psubusb    %%mm1, %%mm2 \n\t"
-        "psubusb    %%mm1, %%mm3 \n\t"
-        "psubusb    %%mm1, %%mm4 \n\t"
-        "psubusb    %%mm1, %%mm5 \n\t"
-        "movd       %%mm2, %0    \n\t"
-        "movd       %%mm3, %1    \n\t"
-        "movd       %%mm4, %2    \n\t"
-        "movd       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
-    );
-    dest += 4*linesize;
-    __asm__ volatile(
-        "movd          %0, %%mm2 \n\t"
-        "movd          %1, %%mm3 \n\t"
-        "movd          %2, %%mm4 \n\t"
-        "movd          %3, %%mm5 \n\t"
-        "paddusb    %%mm0, %%mm2 \n\t"
-        "paddusb    %%mm0, %%mm3 \n\t"
-        "paddusb    %%mm0, %%mm4 \n\t"
-        "paddusb    %%mm0, %%mm5 \n\t"
-        "psubusb    %%mm1, %%mm2 \n\t"
-        "psubusb    %%mm1, %%mm3 \n\t"
-        "psubusb    %%mm1, %%mm4 \n\t"
-        "psubusb    %%mm1, %%mm5 \n\t"
-        "movd       %%mm2, %0    \n\t"
-        "movd       %%mm3, %1    \n\t"
-        "movd       %%mm4, %2    \n\t"
-        "movd       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
-    );
-}
-
-static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize,
-                                        int16_t *block)
-{
-    int dc = block[0];
-    dc = ( 3 * dc +  1) >> 1;
-    dc = (17 * dc + 64) >> 7;
-    __asm__ volatile(
-        "movd          %0, %%mm0 \n\t"
-        "pshufw $0, %%mm0, %%mm0 \n\t"
-        "pxor       %%mm1, %%mm1 \n\t"
-        "psubw      %%mm0, %%mm1 \n\t"
-        "packuswb   %%mm0, %%mm0 \n\t"
-        "packuswb   %%mm1, %%mm1 \n\t"
-        ::"r"(dc)
-    );
-    __asm__ volatile(
-        "movq          %0, %%mm2 \n\t"
-        "movq          %1, %%mm3 \n\t"
-        "movq          %2, %%mm4 \n\t"
-        "movq          %3, %%mm5 \n\t"
-        "paddusb    %%mm0, %%mm2 \n\t"
-        "paddusb    %%mm0, %%mm3 \n\t"
-        "paddusb    %%mm0, %%mm4 \n\t"
-        "paddusb    %%mm0, %%mm5 \n\t"
-        "psubusb    %%mm1, %%mm2 \n\t"
-        "psubusb    %%mm1, %%mm3 \n\t"
-        "psubusb    %%mm1, %%mm4 \n\t"
-        "psubusb    %%mm1, %%mm5 \n\t"
-        "movq       %%mm2, %0    \n\t"
-        "movq       %%mm3, %1    \n\t"
-        "movq       %%mm4, %2    \n\t"
-        "movq       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
-    );
-}
-
-static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize,
-                                        int16_t *block)
-{
-    int dc = block[0];
-    dc = (3 * dc +  1) >> 1;
-    dc = (3 * dc + 16) >> 5;
-    __asm__ volatile(
-        "movd          %0, %%mm0 \n\t"
-        "pshufw $0, %%mm0, %%mm0 \n\t"
-        "pxor       %%mm1, %%mm1 \n\t"
-        "psubw      %%mm0, %%mm1 \n\t"
-        "packuswb   %%mm0, %%mm0 \n\t"
-        "packuswb   %%mm1, %%mm1 \n\t"
-        ::"r"(dc)
-    );
-    __asm__ volatile(
-        "movq          %0, %%mm2 \n\t"
-        "movq          %1, %%mm3 \n\t"
-        "movq          %2, %%mm4 \n\t"
-        "movq          %3, %%mm5 \n\t"
-        "paddusb    %%mm0, %%mm2 \n\t"
-        "paddusb    %%mm0, %%mm3 \n\t"
-        "paddusb    %%mm0, %%mm4 \n\t"
-        "paddusb    %%mm0, %%mm5 \n\t"
-        "psubusb    %%mm1, %%mm2 \n\t"
-        "psubusb    %%mm1, %%mm3 \n\t"
-        "psubusb    %%mm1, %%mm4 \n\t"
-        "psubusb    %%mm1, %%mm5 \n\t"
-        "movq       %%mm2, %0    \n\t"
-        "movq       %%mm3, %1    \n\t"
-        "movq       %%mm4, %2    \n\t"
-        "movq       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
-    );
-    dest += 4*linesize;
-    __asm__ volatile(
-        "movq          %0, %%mm2 \n\t"
-        "movq          %1, %%mm3 \n\t"
-        "movq          %2, %%mm4 \n\t"
-        "movq          %3, %%mm5 \n\t"
-        "paddusb    %%mm0, %%mm2 \n\t"
-        "paddusb    %%mm0, %%mm3 \n\t"
-        "paddusb    %%mm0, %%mm4 \n\t"
-        "paddusb    %%mm0, %%mm5 \n\t"
-        "psubusb    %%mm1, %%mm2 \n\t"
-        "psubusb    %%mm1, %%mm3 \n\t"
-        "psubusb    %%mm1, %%mm4 \n\t"
-        "psubusb    %%mm1, %%mm5 \n\t"
-        "movq       %%mm2, %0    \n\t"
-        "movq       %%mm3, %1    \n\t"
-        "movq       %%mm4, %2    \n\t"
-        "movq       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
-    );
-}
-
-static void put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src,
-                                   ptrdiff_t stride, int rnd)
-{
-    ff_put_pixels8_mmx(dst, src, stride, 8);
-}
-
-av_cold void ff_vc1dsp_init_mmx(VC1DSPContext *dsp)
-{
-    dsp->put_vc1_mspel_pixels_tab[ 0] = put_vc1_mspel_mc00_mmx;
-    dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_mmx;
-    dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_mmx;
-    dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_mmx;
-
-    dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_mmx;
-    dsp->put_vc1_mspel_pixels_tab[ 5] = put_vc1_mspel_mc11_mmx;
-    dsp->put_vc1_mspel_pixels_tab[ 9] = put_vc1_mspel_mc12_mmx;
-    dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_mmx;
-
-    dsp->put_vc1_mspel_pixels_tab[ 2] = put_vc1_mspel_mc20_mmx;
-    dsp->put_vc1_mspel_pixels_tab[ 6] = put_vc1_mspel_mc21_mmx;
-    dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_mmx;
-    dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_mmx;
-
-    dsp->put_vc1_mspel_pixels_tab[ 3] = put_vc1_mspel_mc30_mmx;
-    dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_mmx;
-    dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_mmx;
-    dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_mmx;
-}
-
-av_cold void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp)
-{
-    dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_mmxext;
-
-    dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_mmxext;
-
-    dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_mmxext;
-
-    dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_mmxext;
-    dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_mmxext;
-
-    dsp->vc1_inv_trans_8x8_dc = vc1_inv_trans_8x8_dc_mmxext;
-    dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_mmxext;
-    dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_mmxext;
-    dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_mmxext;
-}
-#endif /* HAVE_INLINE_ASM */
diff --git a/deps/libav/libavcodec/x86/videodsp.asm b/deps/libav/libavcodec/x86/videodsp.asm
deleted file mode 100644
index 53b9e82..0000000
--- a/deps/libav/libavcodec/x86/videodsp.asm
+++ /dev/null
@@ -1,444 +0,0 @@
-;******************************************************************************
-;* Core video DSP functions
-;* Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION .text
-
-; slow vertical extension loop function. Works with variable-width, and
-; does per-line reading/writing of source data
-
-%macro V_COPY_ROW 2 ; type (top/body/bottom), h
-.%1_y_loop:                                     ; do {
-    mov              wq, r7mp                   ;   initialize w (r7mp = wmp)
-.%1_x_loop:                                     ;   do {
-    movu             m0, [srcq+wq]              ;     m0 = read($mmsize)
-    movu      [dstq+wq], m0                     ;     write(m0, $mmsize)
-    add              wq, mmsize                 ;     w -= $mmsize
-    cmp              wq, -mmsize                ;   } while (w > $mmsize);
-    jl .%1_x_loop
-    movu             m0, [srcq-mmsize]          ;     m0 = read($mmsize)
-    movu  [dstq-mmsize], m0                     ;     write(m0, $mmsize)
-%ifidn %1, body                                 ;   if ($type == body) {
-    add            srcq, src_strideq            ;     src += src_stride
-%endif                                          ;   }
-    add            dstq, dst_strideq            ;   dst += dst_stride
-    dec              %2                         ; } while (--$h);
-    jnz .%1_y_loop
-%endmacro
-
-%macro vvar_fn 0
-; .----. <- zero
-; |    |    <- top is copied from first line in body of source
-; |----| <- start_y
-; |    |    <- body is copied verbatim (line-by-line) from source
-; |----| <- end_y
-; |    |    <- bottom is copied from last line in body of source
-; '----' <- bh
-%if ARCH_X86_64
-cglobal emu_edge_vvar, 7, 8, 1, dst, src, dst_stride, src_stride, \
-                                start_y, end_y, bh, w
-%else ; x86-32
-cglobal emu_edge_vvar, 1, 6, 1, dst, src, start_y, end_y, bh, w
-%define src_strideq r3mp
-%define dst_strideq r2mp
-    mov            srcq, r1mp
-    mov        start_yq, r4mp
-    mov          end_yq, r5mp
-    mov             bhq, r6mp
-%endif
-    sub             bhq, end_yq                 ; bh    -= end_q
-    sub          end_yq, start_yq               ; end_q -= start_q
-    add            srcq, r7mp                   ; (r7mp = wmp)
-    add            dstq, r7mp                   ; (r7mp = wmp)
-    neg            r7mp                         ; (r7mp = wmp)
-    test       start_yq, start_yq               ; if (start_q) {
-    jz .body
-    V_COPY_ROW      top, start_yq               ;   v_copy_row(top, start_yq)
-.body:                                          ; }
-    V_COPY_ROW     body, end_yq                 ; v_copy_row(body, end_yq)
-    test            bhq, bhq                    ; if (bh) {
-    jz .end
-    sub            srcq, src_strideq            ;   src -= src_stride
-    V_COPY_ROW   bottom, bhq                    ;   v_copy_row(bottom, bh)
-.end:                                           ; }
-    RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-vvar_fn
-%endif
-
-INIT_XMM sse
-vvar_fn
-
-%macro hvar_fn 0
-cglobal emu_edge_hvar, 5, 6, 1, dst, dst_stride, start_x, n_words, h, w
-    lea            dstq, [dstq+n_wordsq*2]
-    neg        n_wordsq
-    lea        start_xq, [start_xq+n_wordsq*2]
-.y_loop:                                        ; do {
-    ; FIXME also write a ssse3 version using pshufb
-    movzx            wd, byte [dstq+start_xq]   ;   w = read(1)
-    imul             wd, 0x01010101             ;   w *= 0x01010101
-    movd             m0, wd
-    mov              wq, n_wordsq               ;   initialize w
-%if cpuflag(sse2)
-    pshufd           m0, m0, q0000              ;   splat
-%else ; mmx
-    punpckldq        m0, m0                     ;   splat
-%endif ; mmx/sse
-.x_loop:                                        ;   do {
-    movu    [dstq+wq*2], m0                     ;     write($reg, $mmsize)
-    add              wq, mmsize/2               ;     w -= $mmsize/2
-    cmp              wq, -mmsize/2              ;   } while (w > $mmsize/2)
-    jl .x_loop
-    movu  [dstq-mmsize], m0                     ;   write($reg, $mmsize)
-    add            dstq, dst_strideq            ;   dst += dst_stride
-    dec              hq                         ; } while (h--)
-    jnz .y_loop
-    RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-hvar_fn
-%endif
-
-INIT_XMM sse2
-hvar_fn
-
-; macro to read/write a horizontal number of pixels (%2) to/from registers
-; on sse, - fills xmm0-15 for consecutive sets of 16 pixels
-;         - if (%2 & 8)  fills 8 bytes into xmm$next
-;         - if (%2 & 4)  fills 4 bytes into xmm$next
-;         - if (%2 & 3)  fills 1, 2 or 4 bytes in eax
-; on mmx, - fills mm0-7 for consecutive sets of 8 pixels
-;         - if (%2 & 4)  fills 4 bytes into mm$next
-;         - if (%2 & 3)  fills 1, 2 or 4 bytes in eax
-; writing data out is in the same way
-%macro READ_NUM_BYTES 2
-%assign %%off 0     ; offset in source buffer
-%assign %%mmx_idx 0 ; mmx register index
-%assign %%xmm_idx 0 ; xmm register index
-
-%rep %2/mmsize
-%if mmsize == 16
-    movu   xmm %+ %%xmm_idx, [srcq+%%off]
-%assign %%xmm_idx %%xmm_idx+1
-%else ; mmx
-    movu    mm %+ %%mmx_idx, [srcq+%%off]
-%assign %%mmx_idx %%mmx_idx+1
-%endif
-%assign %%off %%off+mmsize
-%endrep ; %2/mmsize
-
-%if mmsize == 16
-%if (%2-%%off) >= 8
-%if %2 > 16 && (%2-%%off) > 8
-    movu   xmm %+ %%xmm_idx, [srcq+%2-16]
-%assign %%xmm_idx %%xmm_idx+1
-%assign %%off %2
-%else
-    movq    mm %+ %%mmx_idx, [srcq+%%off]
-%assign %%mmx_idx %%mmx_idx+1
-%assign %%off %%off+8
-%endif
-%endif ; (%2-%%off) >= 8
-%endif
-
-%if (%2-%%off) >= 4
-%if %2 > 8 && (%2-%%off) > 4
-    movq    mm %+ %%mmx_idx, [srcq+%2-8]
-%assign %%off %2
-%else
-    movd    mm %+ %%mmx_idx, [srcq+%%off]
-%assign %%off %%off+4
-%endif
-%assign %%mmx_idx %%mmx_idx+1
-%endif ; (%2-%%off) >= 4
-
-%if (%2-%%off) >= 1
-%if %2 >= 4
-    movd mm %+ %%mmx_idx, [srcq+%2-4]
-%elif (%2-%%off) == 1
-    mov            valb, [srcq+%2-1]
-%elif (%2-%%off) == 2
-    mov            valw, [srcq+%2-2]
-%elifidn %1, body
-    mov            vald, [srcq+%2-3]
-%else
-    movd mm %+ %%mmx_idx, [srcq+%2-3]
-%endif
-%endif ; (%2-%%off) >= 1
-%endmacro ; READ_NUM_BYTES
-
-%macro WRITE_NUM_BYTES 2
-%assign %%off 0     ; offset in destination buffer
-%assign %%mmx_idx 0 ; mmx register index
-%assign %%xmm_idx 0 ; xmm register index
-
-%rep %2/mmsize
-%if mmsize == 16
-    movu   [dstq+%%off], xmm %+ %%xmm_idx
-%assign %%xmm_idx %%xmm_idx+1
-%else ; mmx
-    movu   [dstq+%%off], mm %+ %%mmx_idx
-%assign %%mmx_idx %%mmx_idx+1
-%endif
-%assign %%off %%off+mmsize
-%endrep ; %2/mmsize
-
-%if mmsize == 16
-%if (%2-%%off) >= 8
-%if %2 > 16 && (%2-%%off) > 8
-    movu   [dstq+%2-16], xmm %+ %%xmm_idx
-%assign %%xmm_idx %%xmm_idx+1
-%assign %%off %2
-%else
-    movq   [dstq+%%off], mm %+ %%mmx_idx
-%assign %%mmx_idx %%mmx_idx+1
-%assign %%off %%off+8
-%endif
-%endif ; (%2-%%off) >= 8
-%endif
-
-%if (%2-%%off) >= 4
-%if %2 > 8 && (%2-%%off) > 4
-    movq    [dstq+%2-8], mm %+ %%mmx_idx
-%assign %%off %2
-%else
-    movd   [dstq+%%off], mm %+ %%mmx_idx
-%assign %%off %%off+4
-%endif
-%assign %%mmx_idx %%mmx_idx+1
-%endif ; (%2-%%off) >= 4
-
-%if (%2-%%off) >= 1
-%if %2 >= 4
-    movd    [dstq+%2-4], mm %+ %%mmx_idx
-%elif (%2-%%off) == 1
-    mov     [dstq+%2-1], valb
-%elif (%2-%%off) == 2
-    mov     [dstq+%2-2], valw
-%elifidn %1, body
-    mov     [dstq+%2-3], valw
-    shr            vald, 16
-    mov     [dstq+%2-1], valb
-%else
-    movd           vald, mm %+ %%mmx_idx
-    mov     [dstq+%2-3], valw
-    shr            vald, 16
-    mov     [dstq+%2-1], valb
-%endif
-%endif ; (%2-%%off) >= 1
-%endmacro ; WRITE_NUM_BYTES
-
-; vertical top/bottom extend and body copy fast loops
-; these are function pointers to set-width line copy functions, i.e.
-; they read a fixed number of pixels into set registers, and write
-; those out into the destination buffer
-%macro VERTICAL_EXTEND 2
-%assign %%n %1
-%rep 1+%2-%1
-%if %%n <= 3
-%if ARCH_X86_64
-cglobal emu_edge_vfix %+ %%n, 6, 8, 0, dst, src, dst_stride, src_stride, \
-                                       start_y, end_y, val, bh
-    mov             bhq, r6mp                   ; r6mp = bhmp
-%else ; x86-32
-cglobal emu_edge_vfix %+ %%n, 0, 6, 0, val, dst, src, start_y, end_y, bh
-    mov            dstq, r0mp
-    mov            srcq, r1mp
-    mov        start_yq, r4mp
-    mov          end_yq, r5mp
-    mov             bhq, r6mp
-%define dst_strideq r2mp
-%define src_strideq r3mp
-%endif ; x86-64/32
-%else
-%if ARCH_X86_64
-cglobal emu_edge_vfix %+ %%n, 7, 7, 1, dst, src, dst_stride, src_stride, \
-                                       start_y, end_y, bh
-%else ; x86-32
-cglobal emu_edge_vfix %+ %%n, 1, 5, 1, dst, src, start_y, end_y, bh
-    mov            srcq, r1mp
-    mov        start_yq, r4mp
-    mov          end_yq, r5mp
-    mov             bhq, r6mp
-%define dst_strideq r2mp
-%define src_strideq r3mp
-%endif ; x86-64/32
-%endif
-    ; FIXME move this to c wrapper?
-    sub             bhq, end_yq                 ; bh    -= end_y
-    sub          end_yq, start_yq               ; end_y -= start_y
-
-    ; extend pixels above body
-    test       start_yq, start_yq               ; if (start_y) {
-    jz .body_loop
-    READ_NUM_BYTES  top, %%n                    ;   $variable_regs = read($n)
-.top_loop:                                      ;   do {
-    WRITE_NUM_BYTES top, %%n                    ;     write($variable_regs, $n)
-    add            dstq, dst_strideq            ;     dst += linesize
-    dec        start_yq                         ;   } while (--start_y)
-    jnz .top_loop                               ; }
-
-    ; copy body pixels
-.body_loop:                                     ; do {
-    READ_NUM_BYTES  body, %%n                   ;   $variable_regs = read($n)
-    WRITE_NUM_BYTES body, %%n                   ;   write($variable_regs, $n)
-    add            dstq, dst_strideq            ;   dst += dst_stride
-    add            srcq, src_strideq            ;   src += src_stride
-    dec          end_yq                         ; } while (--end_y)
-    jnz .body_loop
-
-    ; copy bottom pixels
-    test            bhq, bhq                    ; if (block_h) {
-    jz .end
-    sub            srcq, src_strideq            ;   src -= linesize
-    READ_NUM_BYTES  bottom, %%n                 ;   $variable_regs = read($n)
-.bottom_loop:                                   ;   do {
-    WRITE_NUM_BYTES bottom, %%n                 ;     write($variable_regs, $n)
-    add            dstq, dst_strideq            ;     dst += linesize
-    dec             bhq                         ;   } while (--bh)
-    jnz .bottom_loop                            ; }
-
-.end:
-    RET
-%assign %%n %%n+1
-%endrep ; 1+%2-%1
-%endmacro ; VERTICAL_EXTEND
-
-INIT_MMX mmx
-VERTICAL_EXTEND 1, 15
-%if ARCH_X86_32
-VERTICAL_EXTEND 16, 22
-%endif
-
-INIT_XMM sse
-VERTICAL_EXTEND 16, 22
-
-; left/right (horizontal) fast extend functions
-; these are essentially identical to the vertical extend ones above,
-; just left/right separated because number of pixels to extend is
-; obviously not the same on both sides.
-
-%macro READ_V_PIXEL 2
-%if %1 == 2
-    movzx          valw, byte %2
-    imul           valw, 0x0101
-%else
-    movzx          vald, byte %2
-    imul           vald, 0x01010101
-%if %1 >= 8
-    movd             m0, vald
-%if mmsize == 16
-    pshufd           m0, m0, q0000
-%else
-    punpckldq        m0, m0
-%endif
-%endif ; %1 >= 8
-%endif
-%endmacro ; READ_V_PIXEL
-
-%macro WRITE_V_PIXEL 2
-%assign %%off 0
-%rep %1/mmsize
-    movu     [%2+%%off], m0
-%assign %%off %%off+mmsize
-%endrep ; %1/mmsize
-
-%if mmsize == 16
-%if %1-%%off >= 8
-%if %1 > 16 && %1-%%off > 8
-    movu     [%2+%1-16], m0
-%assign %%off %1
-%else
-    movq     [%2+%%off], m0
-%assign %%off %%off+8
-%endif
-%endif ; %1-%%off >= 8
-%endif
-
-%if %1-%%off >= 4
-%if %1 > 8 && %1-%%off > 4
-    movq      [%2+%1-8], m0
-%assign %%off %1
-%elif %1 >= 8 && %1-%%off >= 4
-    movd     [%2+%%off], m0
-%assign %%off %%off+4
-%else
-    mov      [%2+%%off], vald
-%assign %%off %%off+4
-%endif
-%endif ; %1-%%off >= 4
-
-%if %1-%%off >= 2
-%if %1 >= 8
-    movd      [%2+%1-4], m0
-%else
-    mov      [%2+%%off], valw
-%endif
-%endif ; (%1-%%off)/2
-%endmacro ; WRITE_V_PIXEL
-
-%macro H_EXTEND 2
-%assign %%n %1
-%rep 1+(%2-%1)/2
-cglobal emu_edge_hfix %+ %%n, 4, 5, 1, dst, dst_stride, start_x, bh, val
-.loop_y:                                        ; do {
-    READ_V_PIXEL    %%n, [dstq+start_xq]        ;   $variable_regs = read($n)
-    WRITE_V_PIXEL   %%n, dstq                   ;   write($variable_regs, $n)
-    add            dstq, dst_strideq            ;   dst += dst_stride
-    dec             bhq                         ; } while (--bh)
-    jnz .loop_y
-    RET
-%assign %%n %%n+2
-%endrep ; 1+(%2-%1)/2
-%endmacro ; H_EXTEND
-
-INIT_MMX mmx
-H_EXTEND 2, 14
-%if ARCH_X86_32
-H_EXTEND 16, 22
-%endif
-
-INIT_XMM sse2
-H_EXTEND 16, 22
-
-%macro PREFETCH_FN 1
-cglobal prefetch, 3, 3, 0, buf, stride, h
-.loop:
-    %1      [bufq]
-    add      bufq, strideq
-    dec        hd
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PREFETCH_FN prefetcht0
-%if ARCH_X86_32
-INIT_MMX 3dnow
-PREFETCH_FN prefetch
-%endif
diff --git a/deps/libav/libavcodec/x86/videodsp_init.c b/deps/libav/libavcodec/x86/videodsp_init.c
deleted file mode 100644
index 8ee8370..0000000
--- a/deps/libav/libavcodec/x86/videodsp_init.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright (C) 2012 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "libavutil/cpu.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/videodsp.h"
-
-#if HAVE_YASM
-typedef void emu_edge_vfix_func(uint8_t *dst, const uint8_t *src,
-                                x86_reg dst_stride, x86_reg src_stride,
-                                x86_reg start_y, x86_reg end_y, x86_reg bh);
-typedef void emu_edge_vvar_func(uint8_t *dst, const uint8_t *src,
-                                x86_reg dst_stride, x86_reg src_stride,
-                                x86_reg start_y, x86_reg end_y, x86_reg bh,
-                                x86_reg w);
-
-extern emu_edge_vfix_func ff_emu_edge_vfix1_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix2_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix3_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix4_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix5_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix6_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix7_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix8_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix9_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix10_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix11_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix12_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix13_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix14_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix15_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix16_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix17_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix18_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix19_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix20_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix21_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix22_mmx;
-#if ARCH_X86_32
-static emu_edge_vfix_func *vfixtbl_mmx[22] = {
-    &ff_emu_edge_vfix1_mmx,  &ff_emu_edge_vfix2_mmx,  &ff_emu_edge_vfix3_mmx,
-    &ff_emu_edge_vfix4_mmx,  &ff_emu_edge_vfix5_mmx,  &ff_emu_edge_vfix6_mmx,
-    &ff_emu_edge_vfix7_mmx,  &ff_emu_edge_vfix8_mmx,  &ff_emu_edge_vfix9_mmx,
-    &ff_emu_edge_vfix10_mmx, &ff_emu_edge_vfix11_mmx, &ff_emu_edge_vfix12_mmx,
-    &ff_emu_edge_vfix13_mmx, &ff_emu_edge_vfix14_mmx, &ff_emu_edge_vfix15_mmx,
-    &ff_emu_edge_vfix16_mmx, &ff_emu_edge_vfix17_mmx, &ff_emu_edge_vfix18_mmx,
-    &ff_emu_edge_vfix19_mmx, &ff_emu_edge_vfix20_mmx, &ff_emu_edge_vfix21_mmx,
-    &ff_emu_edge_vfix22_mmx
-};
-#endif
-extern emu_edge_vvar_func ff_emu_edge_vvar_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix16_sse;
-extern emu_edge_vfix_func ff_emu_edge_vfix17_sse;
-extern emu_edge_vfix_func ff_emu_edge_vfix18_sse;
-extern emu_edge_vfix_func ff_emu_edge_vfix19_sse;
-extern emu_edge_vfix_func ff_emu_edge_vfix20_sse;
-extern emu_edge_vfix_func ff_emu_edge_vfix21_sse;
-extern emu_edge_vfix_func ff_emu_edge_vfix22_sse;
-static emu_edge_vfix_func *vfixtbl_sse[22] = {
-    ff_emu_edge_vfix1_mmx,  ff_emu_edge_vfix2_mmx,  ff_emu_edge_vfix3_mmx,
-    ff_emu_edge_vfix4_mmx,  ff_emu_edge_vfix5_mmx,  ff_emu_edge_vfix6_mmx,
-    ff_emu_edge_vfix7_mmx,  ff_emu_edge_vfix8_mmx,  ff_emu_edge_vfix9_mmx,
-    ff_emu_edge_vfix10_mmx, ff_emu_edge_vfix11_mmx, ff_emu_edge_vfix12_mmx,
-    ff_emu_edge_vfix13_mmx, ff_emu_edge_vfix14_mmx, ff_emu_edge_vfix15_mmx,
-    ff_emu_edge_vfix16_sse, ff_emu_edge_vfix17_sse, ff_emu_edge_vfix18_sse,
-    ff_emu_edge_vfix19_sse, ff_emu_edge_vfix20_sse, ff_emu_edge_vfix21_sse,
-    ff_emu_edge_vfix22_sse
-};
-extern emu_edge_vvar_func ff_emu_edge_vvar_sse;
-
-typedef void emu_edge_hfix_func(uint8_t *dst, x86_reg dst_stride,
-                                x86_reg start_x, x86_reg bh);
-typedef void emu_edge_hvar_func(uint8_t *dst, x86_reg dst_stride,
-                                x86_reg start_x, x86_reg n_words, x86_reg bh);
-
-extern emu_edge_hfix_func ff_emu_edge_hfix2_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix4_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix6_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix8_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix10_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix12_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix14_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix16_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix18_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix20_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix22_mmx;
-#if ARCH_X86_32
-static emu_edge_hfix_func *hfixtbl_mmx[11] = {
-    ff_emu_edge_hfix2_mmx,  ff_emu_edge_hfix4_mmx,  ff_emu_edge_hfix6_mmx,
-    ff_emu_edge_hfix8_mmx,  ff_emu_edge_hfix10_mmx, ff_emu_edge_hfix12_mmx,
-    ff_emu_edge_hfix14_mmx, ff_emu_edge_hfix16_mmx, ff_emu_edge_hfix18_mmx,
-    ff_emu_edge_hfix20_mmx, ff_emu_edge_hfix22_mmx
-};
-#endif
-extern emu_edge_hvar_func ff_emu_edge_hvar_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix16_sse2;
-extern emu_edge_hfix_func ff_emu_edge_hfix18_sse2;
-extern emu_edge_hfix_func ff_emu_edge_hfix20_sse2;
-extern emu_edge_hfix_func ff_emu_edge_hfix22_sse2;
-static emu_edge_hfix_func *hfixtbl_sse2[11] = {
-    ff_emu_edge_hfix2_mmx,  ff_emu_edge_hfix4_mmx,  ff_emu_edge_hfix6_mmx,
-    ff_emu_edge_hfix8_mmx,  ff_emu_edge_hfix10_mmx, ff_emu_edge_hfix12_mmx,
-    ff_emu_edge_hfix14_mmx, ff_emu_edge_hfix16_sse2, ff_emu_edge_hfix18_sse2,
-    ff_emu_edge_hfix20_sse2, ff_emu_edge_hfix22_sse2
-};
-extern emu_edge_hvar_func ff_emu_edge_hvar_sse2;
-
-static av_always_inline void emulated_edge_mc(uint8_t *dst, const uint8_t *src,
-                                              ptrdiff_t dst_stride,
-                                              ptrdiff_t src_stride,
-                                              x86_reg block_w, x86_reg block_h,
-                                              x86_reg src_x, x86_reg src_y,
-                                              x86_reg w, x86_reg h,
-                                              emu_edge_vfix_func **vfix_tbl,
-                                              emu_edge_vvar_func *v_extend_var,
-                                              emu_edge_hfix_func **hfix_tbl,
-                                              emu_edge_hvar_func *h_extend_var)
-{
-    x86_reg start_y, start_x, end_y, end_x, src_y_add = 0, p;
-
-    if (!w || !h)
-         return;
-
-    if (src_y >= h) {
-        src  -= src_y * src_stride;
-        src_y = src_y_add = h - 1;
-    } else if (src_y <= -block_h) {
-        src  -= src_y*src_stride;
-        src_y = src_y_add = 1 - block_h;
-    }
-    if (src_x >= w) {
-        src   += w - 1 - src_x;
-        src_x  = w - 1;
-    } else if (src_x <= -block_w) {
-        src   += 1 - block_w - src_x;
-        src_x  = 1 - block_w;
-    }
-
-    start_y = FFMAX(0, -src_y);
-    start_x = FFMAX(0, -src_x);
-    end_y   = FFMIN(block_h, h-src_y);
-    end_x   = FFMIN(block_w, w-src_x);
-    assert(start_x < end_x && block_w > 0);
-    assert(start_y < end_y && block_h > 0);
-
-    // fill in the to-be-copied part plus all above/below
-    src += (src_y_add + start_y) * src_stride + start_x;
-    w = end_x - start_x;
-    if (w <= 22) {
-        vfix_tbl[w - 1](dst + start_x, src,
-                        dst_stride, src_stride,
-                        start_y, end_y, block_h);
-    } else {
-        v_extend_var(dst + start_x, src, dst_stride, src_stride,
-                     start_y, end_y, block_h, w);
-    }
-
-    // fill left
-    if (start_x) {
-        if (start_x <= 22) {
-            hfix_tbl[(start_x - 1) >> 1](dst, dst_stride, start_x, block_h);
-        } else {
-            h_extend_var(dst, dst_stride,
-                         start_x, (start_x + 1) >> 1, block_h);
-        }
-    }
-
-    // fill right
-    p = block_w - end_x;
-    if (p) {
-        if (p <= 22) {
-            hfix_tbl[(p - 1) >> 1](dst + end_x - (p & 1), dst_stride,
-                                   -!(p & 1), block_h);
-        } else {
-            h_extend_var(dst + end_x - (p & 1), dst_stride,
-                         -!(p & 1), (p + 1) >> 1, block_h);
-        }
-    }
-}
-
-#if ARCH_X86_32
-static av_noinline void emulated_edge_mc_mmx(uint8_t *buf, const uint8_t *src,
-                                             ptrdiff_t buf_stride,
-                                             ptrdiff_t src_stride,
-                                             int block_w, int block_h,
-                                             int src_x, int src_y, int w, int h)
-{
-    emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h,
-                     src_x, src_y, w, h, vfixtbl_mmx, &ff_emu_edge_vvar_mmx,
-                     hfixtbl_mmx, &ff_emu_edge_hvar_mmx);
-}
-
-static av_noinline void emulated_edge_mc_sse(uint8_t * buf,const uint8_t *src,
-                                             ptrdiff_t buf_stride,
-                                             ptrdiff_t src_stride,
-                                             int block_w, int block_h,
-                                             int src_x, int src_y, int w, int h)
-{
-    emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h,
-                     src_x, src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse,
-                     hfixtbl_mmx, &ff_emu_edge_hvar_mmx);
-}
-#endif
-
-static av_noinline void emulated_edge_mc_sse2(uint8_t *buf, const uint8_t *src,
-                                              ptrdiff_t buf_stride,
-                                              ptrdiff_t src_stride,
-                                              int block_w, int block_h,
-                                              int src_x, int src_y, int w,
-                                              int h)
-{
-    emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h, src_x,
-                     src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse,
-                     hfixtbl_sse2, &ff_emu_edge_hvar_sse2);
-}
-#endif /* HAVE_YASM */
-
-void ff_prefetch_mmxext(uint8_t *buf, ptrdiff_t stride, int h);
-void ff_prefetch_3dnow(uint8_t *buf, ptrdiff_t stride, int h);
-
-av_cold void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc)
-{
-#if HAVE_YASM
-    int cpu_flags = av_get_cpu_flags();
-
-#if ARCH_X86_32
-    if (EXTERNAL_MMX(cpu_flags) && bpc <= 8) {
-        ctx->emulated_edge_mc = emulated_edge_mc_mmx;
-    }
-    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-        ctx->prefetch = ff_prefetch_3dnow;
-    }
-#endif /* ARCH_X86_32 */
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        ctx->prefetch = ff_prefetch_mmxext;
-    }
-#if ARCH_X86_32
-    if (EXTERNAL_SSE(cpu_flags) && bpc <= 8) {
-        ctx->emulated_edge_mc = emulated_edge_mc_sse;
-    }
-#endif /* ARCH_X86_32 */
-    if (EXTERNAL_SSE2(cpu_flags) && bpc <= 8) {
-        ctx->emulated_edge_mc = emulated_edge_mc_sse2;
-    }
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavcodec/x86/vorbisdsp.asm b/deps/libav/libavcodec/x86/vorbisdsp.asm
deleted file mode 100644
index c54650e..0000000
--- a/deps/libav/libavcodec/x86/vorbisdsp.asm
+++ /dev/null
@@ -1,83 +0,0 @@
-;******************************************************************************
-;* Vorbis x86 optimizations
-;* Copyright (C) 2006 Loren Merritt <lorenm at u.washington.edu>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-pdw_80000000: times 4 dd 0x80000000
-
-SECTION .text
-
-%if ARCH_X86_32
-INIT_MMX 3dnow
-cglobal vorbis_inverse_coupling, 3, 3, 6, mag, ang, block_size
-    pxor                     m7, m7
-    lea                    magq, [magq+block_sizeq*4]
-    lea                    angq, [angq+block_sizeq*4]
-    neg             block_sizeq
-.loop:
-    mova                     m0, [magq+block_sizeq*4]
-    mova                     m1, [angq+block_sizeq*4]
-    mova                     m2, m0
-    mova                     m3, m1
-    pfcmpge                  m2, m7     ; m <= 0.0
-    pfcmpge                  m3, m7     ; a <= 0.0
-    pslld                    m2, 31     ; keep only the sign bit
-    pxor                     m1, m2
-    mova                     m4, m3
-    pand                     m3, m1
-    pandn                    m4, m1
-    pfadd                    m3, m0     ; a = m + ((a < 0) & (a ^ sign(m)))
-    pfsub                    m0, m4     ; m = m + ((a > 0) & (a ^ sign(m)))
-    mova   [angq+block_sizeq*4], m3
-    mova   [magq+block_sizeq*4], m0
-    add             block_sizeq, 2
-    jl .loop
-    femms
-    RET
-%endif
-
-INIT_XMM sse
-cglobal vorbis_inverse_coupling, 3, 4, 6, mag, ang, block_size, cntr
-    mova                     m5, [pdw_80000000]
-    xor                   cntrq, cntrq
-align 16
-.loop:
-    mova                     m0, [magq+cntrq*4]
-    mova                     m1, [angq+cntrq*4]
-    xorps                    m2, m2
-    xorps                    m3, m3
-    cmpleps                  m2, m0     ; m <= 0.0
-    cmpleps                  m3, m1     ; a <= 0.0
-    andps                    m2, m5     ; keep only the sign bit
-    xorps                    m1, m2
-    mova                     m4, m3
-    andps                    m3, m1
-    andnps                   m4, m1
-    addps                    m3, m0     ; a = m + ((a < 0) & (a ^ sign(m)))
-    subps                    m0, m4     ; m = m + ((a > 0) & (a ^ sign(m)))
-    mova         [angq+cntrq*4], m3
-    mova         [magq+cntrq*4], m0
-    add                   cntrq, 4
-    cmp                   cntrq, block_sizeq
-    jl .loop
-    RET
diff --git a/deps/libav/libavcodec/x86/vorbisdsp_init.c b/deps/libav/libavcodec/x86/vorbisdsp_init.c
deleted file mode 100644
index 2a978b6..0000000
--- a/deps/libav/libavcodec/x86/vorbisdsp_init.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2006 Loren Merritt <lorenm at u.washington.edu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/vorbisdsp.h"
-
-void ff_vorbis_inverse_coupling_3dnow(float *mag, float *ang,
-                                      intptr_t blocksize);
-void ff_vorbis_inverse_coupling_sse(float *mag, float *ang,
-                                    intptr_t blocksize);
-
-av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp)
-{
-#if HAVE_YASM
-    int cpu_flags = av_get_cpu_flags();
-
-#if ARCH_X86_32
-    if (EXTERNAL_AMD3DNOW(cpu_flags))
-        dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_3dnow;
-#endif /* ARCH_X86_32 */
-    if (EXTERNAL_SSE(cpu_flags))
-        dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse;
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavcodec/x86/vp3dsp.asm b/deps/libav/libavcodec/x86/vp3dsp.asm
deleted file mode 100644
index fc8a047..0000000
--- a/deps/libav/libavcodec/x86/vp3dsp.asm
+++ /dev/null
@@ -1,709 +0,0 @@
-;******************************************************************************
-;* MMX/SSE2-optimized functions for the VP3 decoder
-;* Copyright (c) 2007 Aurelien Jacobs <aurel at gnuage.org>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-; MMX-optimized functions cribbed from the original VP3 source code.
-
-SECTION_RODATA
-
-vp3_idct_data: times 8 dw 64277
-               times 8 dw 60547
-               times 8 dw 54491
-               times 8 dw 46341
-               times 8 dw 36410
-               times 8 dw 25080
-               times 8 dw 12785
-
-pb_7:  times 8 db 0x07
-pb_1F: times 8 db 0x1f
-pb_81: times 8 db 0x81
-
-cextern pb_1
-cextern pb_3
-cextern pb_80
-
-cextern pw_8
-
-SECTION .text
-
-; this is off by one or two for some cases when filter_limit is greater than 63
-; in:  p0 in mm6, p1 in mm4, p2 in mm2, p3 in mm1
-; out: p1 in mm4, p2 in mm3
-%macro VP3_LOOP_FILTER 0
-    movq          m7, m6
-    pand          m6, [pb_7]    ; p0&7
-    psrlw         m7, 3
-    pand          m7, [pb_1F]   ; p0>>3
-    movq          m3, m2        ; p2
-    pxor          m2, m4
-    pand          m2, [pb_1]    ; (p2^p1)&1
-    movq          m5, m2
-    paddb         m2, m2
-    paddb         m2, m5        ; 3*(p2^p1)&1
-    paddb         m2, m6        ; extra bits lost in shifts
-    pcmpeqb       m0, m0
-    pxor          m1, m0        ; 255 - p3
-    pavgb         m1, m2        ; (256 - p3 + extrabits) >> 1
-    pxor          m0, m4        ; 255 - p1
-    pavgb         m0, m3        ; (256 + p2-p1) >> 1
-    paddb         m1, [pb_3]
-    pavgb         m1, m0        ; 128+2+(   p2-p1  - p3) >> 2
-    pavgb         m1, m0        ; 128+1+(3*(p2-p1) - p3) >> 3
-    paddusb       m7, m1        ; d+128+1
-    movq          m6, [pb_81]
-    psubusb       m6, m7
-    psubusb       m7, [pb_81]
-
-    movq          m5, [r2+516]  ; flim
-    pminub        m6, m5
-    pminub        m7, m5
-    movq          m0, m6
-    movq          m1, m7
-    paddb         m6, m6
-    paddb         m7, m7
-    pminub        m6, m5
-    pminub        m7, m5
-    psubb         m6, m0
-    psubb         m7, m1
-    paddusb       m4, m7
-    psubusb       m4, m6
-    psubusb       m3, m7
-    paddusb       m3, m6
-%endmacro
-
-%macro STORE_4_WORDS 1
-    movd         r2d, %1
-    mov  [r0     -1], r2w
-    psrlq         %1, 32
-    shr           r2, 16
-    mov  [r0+r1  -1], r2w
-    movd         r2d, %1
-    mov  [r0+r1*2-1], r2w
-    shr           r2, 16
-    mov  [r0+r3  -1], r2w
-%endmacro
-
-INIT_MMX mmxext
-cglobal vp3_v_loop_filter, 3, 4
-%if ARCH_X86_64
-    movsxd        r1, r1d
-%endif
-    mov           r3, r1
-    neg           r1
-    movq          m6, [r0+r1*2]
-    movq          m4, [r0+r1  ]
-    movq          m2, [r0     ]
-    movq          m1, [r0+r3  ]
-
-    VP3_LOOP_FILTER
-
-    movq     [r0+r1], m4
-    movq     [r0   ], m3
-    RET
-
-cglobal vp3_h_loop_filter, 3, 4
-%if ARCH_X86_64
-    movsxd        r1, r1d
-%endif
-    lea           r3, [r1*3]
-
-    movd          m6, [r0     -2]
-    movd          m4, [r0+r1  -2]
-    movd          m2, [r0+r1*2-2]
-    movd          m1, [r0+r3  -2]
-    lea           r0, [r0+r1*4  ]
-    punpcklbw     m6, [r0     -2]
-    punpcklbw     m4, [r0+r1  -2]
-    punpcklbw     m2, [r0+r1*2-2]
-    punpcklbw     m1, [r0+r3  -2]
-    sub           r0, r3
-    sub           r0, r1
-
-    TRANSPOSE4x4B  6, 4, 2, 1, 0
-    VP3_LOOP_FILTER
-    SBUTTERFLY    bw, 4, 3, 5
-
-    STORE_4_WORDS m4
-    lea           r0, [r0+r1*4  ]
-    STORE_4_WORDS m3
-    RET
-
-; from original comments: The Macro does IDct on 4 1-D Dcts
-%macro BeginIDCT 0
-    movq          m2, I(3)
-    movq          m6, C(3)
-    movq          m4, m2
-    movq          m7, J(5)
-    pmulhw        m4, m6        ; r4 = c3*i3 - i3
-    movq          m1, C(5)
-    pmulhw        m6, m7        ; r6 = c3*i5 - i5
-    movq          m5, m1
-    pmulhw        m1, m2        ; r1 = c5*i3 - i3
-    movq          m3, I(1)
-    pmulhw        m5, m7        ; r5 = c5*i5 - i5
-    movq          m0, C(1)
-    paddw         m4, m2        ; r4 = c3*i3
-    paddw         m6, m7        ; r6 = c3*i5
-    paddw         m2, m1        ; r2 = c5*i3
-    movq          m1, J(7)
-    paddw         m7, m5        ; r7 = c5*i5
-    movq          m5, m0        ; r5 = c1
-    pmulhw        m0, m3        ; r0 = c1*i1 - i1
-    paddsw        m4, m7        ; r4 = C = c3*i3 + c5*i5
-    pmulhw        m5, m1        ; r5 = c1*i7 - i7
-    movq          m7, C(7)
-    psubsw        m6, m2        ; r6 = D = c3*i5 - c5*i3
-    paddw         m0, m3        ; r0 = c1*i1
-    pmulhw        m3, m7        ; r3 = c7*i1
-    movq          m2, I(2)
-    pmulhw        m7, m1        ; r7 = c7*i7
-    paddw         m5, m1        ; r5 = c1*i7
-    movq          m1, m2        ; r1 = i2
-    pmulhw        m2, C(2)      ; r2 = c2*i2 - i2
-    psubsw        m3, m5        ; r3 = B = c7*i1 - c1*i7
-    movq          m5, J(6)
-    paddsw        m0, m7        ; r0 = A = c1*i1 + c7*i7
-    movq          m7, m5        ; r7 = i6
-    psubsw        m0, m4        ; r0 = A - C
-    pmulhw        m5, C(2)      ; r5 = c2*i6 - i6
-    paddw         m2, m1        ; r2 = c2*i2
-    pmulhw        m1, C(6)      ; r1 = c6*i2
-    paddsw        m4, m4        ; r4 = C + C
-    paddsw        m4, m0        ; r4 = C. = A + C
-    psubsw        m3, m6        ; r3 = B - D
-    paddw         m5, m7        ; r5 = c2*i6
-    paddsw        m6, m6        ; r6 = D + D
-    pmulhw        m7, C(6)      ; r7 = c6*i6
-    paddsw        m6, m3        ; r6 = D. = B + D
-    movq        I(1), m4        ; save C. at I(1)
-    psubsw        m1, m5        ; r1 = H = c6*i2 - c2*i6
-    movq          m4, C(4)
-    movq          m5, m3        ; r5 = B - D
-    pmulhw        m3, m4        ; r3 = (c4 - 1) * (B - D)
-    paddsw        m7, m2        ; r3 = (c4 - 1) * (B - D)
-    movq        I(2), m6        ; save D. at I(2)
-    movq          m2, m0        ; r2 = A - C
-    movq          m6, I(0)
-    pmulhw        m0, m4        ; r0 = (c4 - 1) * (A - C)
-    paddw         m5, m3        ; r5 = B. = c4 * (B - D)
-    movq          m3, J(4)
-    psubsw        m5, m1        ; r5 = B.. = B. - H
-    paddw         m2, m0        ; r0 = A. = c4 * (A - C)
-    psubsw        m6, m3        ; r6 = i0 - i4
-    movq          m0, m6
-    pmulhw        m6, m4        ; r6 = (c4 - 1) * (i0 - i4)
-    paddsw        m3, m3        ; r3 = i4 + i4
-    paddsw        m1, m1        ; r1 = H + H
-    paddsw        m3, m0        ; r3 = i0 + i4
-    paddsw        m1, m5        ; r1 = H. = B + H
-    pmulhw        m4, m3        ; r4 = (c4 - 1) * (i0 + i4)
-    paddsw        m6, m0        ; r6 = F = c4 * (i0 - i4)
-    psubsw        m6, m2        ; r6 = F. = F - A.
-    paddsw        m2, m2        ; r2 = A. + A.
-    movq          m0, I(1)      ; r0 = C.
-    paddsw        m2, m6        ; r2 = A.. = F + A.
-    paddw         m4, m3        ; r4 = E = c4 * (i0 + i4)
-    psubsw        m2, m1        ; r2 = R2 = A.. - H.
-%endmacro
-
-; RowIDCT gets ready to transpose
-%macro RowIDCT 0
-    BeginIDCT
-    movq          m3, I(2)      ; r3 = D.
-    psubsw        m4, m7        ; r4 = E. = E - G
-    paddsw        m1, m1        ; r1 = H. + H.
-    paddsw        m7, m7        ; r7 = G + G
-    paddsw        m1, m2        ; r1 = R1 = A.. + H.
-    paddsw        m7, m4        ; r1 = R1 = A.. + H.
-    psubsw        m4, m3        ; r4 = R4 = E. - D.
-    paddsw        m3, m3
-    psubsw        m6, m5        ; r6 = R6 = F. - B..
-    paddsw        m5, m5
-    paddsw        m3, m4        ; r3 = R3 = E. + D.
-    paddsw        m5, m6        ; r5 = R5 = F. + B..
-    psubsw        m7, m0        ; r7 = R7 = G. - C.
-    paddsw        m0, m0
-    movq        I(1), m1        ; save R1
-    paddsw        m0, m7        ; r0 = R0 = G. + C.
-%endmacro
-
-; Column IDCT normalizes and stores final results
-%macro ColumnIDCT 0
-    BeginIDCT
-    paddsw        m2, OC_8      ; adjust R2 (and R1) for shift
-    paddsw        m1, m1        ; r1 = H. + H.
-    paddsw        m1, m2        ; r1 = R1 = A.. + H.
-    psraw         m2, 4         ; r2 = NR2
-    psubsw        m4, m7        ; r4 = E. = E - G
-    psraw         m1, 4         ; r1 = NR2
-    movq          m3, I(2)      ; r3 = D.
-    paddsw        m7, m7        ; r7 = G + G
-    movq        I(2), m2        ; store NR2 at I2
-    paddsw        m7, m4        ; r7 = G. = E + G
-    movq        I(1), m1        ; store NR1 at I1
-    psubsw        m4, m3        ; r4 = R4 = E. - D.
-    paddsw        m4, OC_8      ; adjust R4 (and R3) for shift
-    paddsw        m3, m3        ; r3 = D. + D.
-    paddsw        m3, m4        ; r3 = R3 = E. + D.
-    psraw         m4, 4         ; r4 = NR4
-    psubsw        m6, m5        ; r6 = R6 = F. - B..
-    psraw         m3, 4         ; r3 = NR3
-    paddsw        m6, OC_8      ; adjust R6 (and R5) for shift
-    paddsw        m5, m5        ; r5 = B.. + B..
-    paddsw        m5, m6        ; r5 = R5 = F. + B..
-    psraw         m6, 4         ; r6 = NR6
-    movq        J(4), m4        ; store NR4 at J4
-    psraw         m5, 4         ; r5 = NR5
-    movq        I(3), m3        ; store NR3 at I3
-    psubsw        m7, m0        ; r7 = R7 = G. - C.
-    paddsw        m7, OC_8      ; adjust R7 (and R0) for shift
-    paddsw        m0, m0        ; r0 = C. + C.
-    paddsw        m0, m7        ; r0 = R0 = G. + C.
-    psraw         m7, 4         ; r7 = NR7
-    movq        J(6), m6        ; store NR6 at J6
-    psraw         m0, 4         ; r0 = NR0
-    movq        J(5), m5        ; store NR5 at J5
-    movq        J(7), m7        ; store NR7 at J7
-    movq        I(0), m0        ; store NR0 at I0
-%endmacro
-
-; Following macro does two 4x4 transposes in place.
-;
-; At entry (we assume):
-;
-;   r0 = a3 a2 a1 a0
-;   I(1) = b3 b2 b1 b0
-;   r2 = c3 c2 c1 c0
-;   r3 = d3 d2 d1 d0
-;
-;   r4 = e3 e2 e1 e0
-;   r5 = f3 f2 f1 f0
-;   r6 = g3 g2 g1 g0
-;   r7 = h3 h2 h1 h0
-;
-; At exit, we have:
-;
-;   I(0) = d0 c0 b0 a0
-;   I(1) = d1 c1 b1 a1
-;   I(2) = d2 c2 b2 a2
-;   I(3) = d3 c3 b3 a3
-;
-;   J(4) = h0 g0 f0 e0
-;   J(5) = h1 g1 f1 e1
-;   J(6) = h2 g2 f2 e2
-;   J(7) = h3 g3 f3 e3
-;
-;  I(0) I(1) I(2) I(3)  is the transpose of r0 I(1) r2 r3.
-;  J(4) J(5) J(6) J(7)  is the transpose of r4 r5 r6 r7.
-;
-;  Since r1 is free at entry, we calculate the Js first.
-%macro Transpose 0
-    movq          m1, m4        ; r1 = e3 e2 e1 e0
-    punpcklwd     m4, m5        ; r4 = f1 e1 f0 e0
-    movq        I(0), m0        ; save a3 a2 a1 a0
-    punpckhwd     m1, m5        ; r1 = f3 e3 f2 e2
-    movq          m0, m6        ; r0 = g3 g2 g1 g0
-    punpcklwd     m6, m7        ; r6 = h1 g1 h0 g0
-    movq          m5, m4        ; r5 = f1 e1 f0 e0
-    punpckldq     m4, m6        ; r4 = h0 g0 f0 e0 = R4
-    punpckhdq     m5, m6        ; r5 = h1 g1 f1 e1 = R5
-    movq          m6, m1        ; r6 = f3 e3 f2 e2
-    movq        J(4), m4
-    punpckhwd     m0, m7        ; r0 = h3 g3 h2 g2
-    movq        J(5), m5
-    punpckhdq     m6, m0        ; r6 = h3 g3 f3 e3 = R7
-    movq          m4, I(0)      ; r4 = a3 a2 a1 a0
-    punpckldq     m1, m0        ; r1 = h2 g2 f2 e2 = R6
-    movq          m5, I(1)      ; r5 = b3 b2 b1 b0
-    movq          m0, m4        ; r0 = a3 a2 a1 a0
-    movq        J(7), m6
-    punpcklwd     m0, m5        ; r0 = b1 a1 b0 a0
-    movq        J(6), m1
-    punpckhwd     m4, m5        ; r4 = b3 a3 b2 a2
-    movq          m5, m2        ; r5 = c3 c2 c1 c0
-    punpcklwd     m2, m3        ; r2 = d1 c1 d0 c0
-    movq          m1, m0        ; r1 = b1 a1 b0 a0
-    punpckldq     m0, m2        ; r0 = d0 c0 b0 a0 = R0
-    punpckhdq     m1, m2        ; r1 = d1 c1 b1 a1 = R1
-    movq          m2, m4        ; r2 = b3 a3 b2 a2
-    movq        I(0), m0
-    punpckhwd     m5, m3        ; r5 = d3 c3 d2 c2
-    movq        I(1), m1
-    punpckhdq     m4, m5        ; r4 = d3 c3 b3 a3 = R3
-    punpckldq     m2, m5        ; r2 = d2 c2 b2 a2 = R2
-    movq        I(3), m4
-    movq        I(2), m2
-%endmacro
-
-%macro VP3_1D_IDCT_SSE2 0
-    movdqa        m2, I(3)      ; xmm2 = i3
-    movdqa        m6, C(3)      ; xmm6 = c3
-    movdqa        m4, m2        ; xmm4 = i3
-    movdqa        m7, I(5)      ; xmm7 = i5
-    pmulhw        m4, m6        ; xmm4 = c3 * i3 - i3
-    movdqa        m1, C(5)      ; xmm1 = c5
-    pmulhw        m6, m7        ; xmm6 = c3 * i5 - i5
-    movdqa        m5, m1        ; xmm5 = c5
-    pmulhw        m1, m2        ; xmm1 = c5 * i3 - i3
-    movdqa        m3, I(1)      ; xmm3 = i1
-    pmulhw        m5, m7        ; xmm5 = c5 * i5 - i5
-    movdqa        m0, C(1)      ; xmm0 = c1
-    paddw         m4, m2        ; xmm4 = c3 * i3
-    paddw         m6, m7        ; xmm6 = c3 * i5
-    paddw         m2, m1        ; xmm2 = c5 * i3
-    movdqa        m1, I(7)      ; xmm1 = i7
-    paddw         m7, m5        ; xmm7 = c5 * i5
-    movdqa        m5, m0        ; xmm5 = c1
-    pmulhw        m0, m3        ; xmm0 = c1 * i1 - i1
-    paddsw        m4, m7        ; xmm4 = c3 * i3 + c5 * i5 = C
-    pmulhw        m5, m1        ; xmm5 = c1 * i7 - i7
-    movdqa        m7, C(7)      ; xmm7 = c7
-    psubsw        m6, m2        ; xmm6 = c3 * i5 - c5 * i3 = D
-    paddw         m0, m3        ; xmm0 = c1 * i1
-    pmulhw        m3, m7        ; xmm3 = c7 * i1
-    movdqa        m2, I(2)      ; xmm2 = i2
-    pmulhw        m7, m1        ; xmm7 = c7 * i7
-    paddw         m5, m1        ; xmm5 = c1 * i7
-    movdqa        m1, m2        ; xmm1 = i2
-    pmulhw        m2, C(2)      ; xmm2 = i2 * c2 -i2
-    psubsw        m3, m5        ; xmm3 = c7 * i1 - c1 * i7 = B
-    movdqa        m5, I(6)      ; xmm5 = i6
-    paddsw        m0, m7        ; xmm0 = c1 * i1 + c7 * i7 = A
-    movdqa        m7, m5        ; xmm7 = i6
-    psubsw        m0, m4        ; xmm0 = A - C
-    pmulhw        m5, C(2)      ; xmm5 = c2 * i6 - i6
-    paddw         m2, m1        ; xmm2 = i2 * c2
-    pmulhw        m1, C(6)      ; xmm1 = c6 * i2
-    paddsw        m4, m4        ; xmm4 = C + C
-    paddsw        m4, m0        ; xmm4 = A + C = C.
-    psubsw        m3, m6        ; xmm3 = B - D
-    paddw         m5, m7        ; xmm5 = c2 * i6
-    paddsw        m6, m6        ; xmm6 = D + D
-    pmulhw        m7, C(6)      ; xmm7 = c6 * i6
-    paddsw        m6, m3        ; xmm6 = B + D = D.
-    movdqa      I(1), m4        ; Save C. at I(1)
-    psubsw        m1, m5        ; xmm1 = c6 * i2 - c2 * i6 = H
-    movdqa        m4, C(4)      ; xmm4 = C4
-    movdqa        m5, m3        ; xmm5 = B - D
-    pmulhw        m3, m4        ; xmm3 = ( c4 -1 ) * ( B - D )
-    paddsw        m7, m2        ; xmm7 = c2 * i2 + c6 * i6 = G
-    movdqa      I(2), m6        ; save D. at I(2)
-    movdqa        m2, m0        ; xmm2 = A - C
-    movdqa        m6, I(0)      ; xmm6 = i0
-    pmulhw        m0, m4        ; xmm0 = ( c4 - 1 ) * ( A - C ) = A.
-    paddw         m5, m3        ; xmm5 = c4 * ( B - D ) = B.
-    movdqa        m3, I(4)      ; xmm3 = i4
-    psubsw        m5, m1        ; xmm5 = B. - H = B..
-    paddw         m2, m0        ; xmm2 = c4 * ( A - C) = A.
-    psubsw        m6, m3        ; xmm6 = i0 - i4
-    movdqa        m0, m6        ; xmm0 = i0 - i4
-    pmulhw        m6, m4        ; xmm6 = (c4 - 1) * (i0 - i4) = F
-    paddsw        m3, m3        ; xmm3 = i4 + i4
-    paddsw        m1, m1        ; xmm1 = H + H
-    paddsw        m3, m0        ; xmm3 = i0 + i4
-    paddsw        m1, m5        ; xmm1 = B. + H = H.
-    pmulhw        m4, m3        ; xmm4 = ( c4 - 1 ) * ( i0 + i4 )
-    paddw         m6, m0        ; xmm6 = c4 * ( i0 - i4 )
-    psubsw        m6, m2        ; xmm6 = F - A. = F.
-    paddsw        m2, m2        ; xmm2 = A. + A.
-    movdqa        m0, I(1)      ; Load        C. from I(1)
-    paddsw        m2, m6        ; xmm2 = F + A. = A..
-    paddw         m4, m3        ; xmm4 = c4 * ( i0 + i4 ) = 3
-    psubsw        m2, m1        ; xmm2 = A.. - H. = R2
-    ADD(m2)                     ; Adjust R2 and R1 before shifting
-    paddsw        m1, m1        ; xmm1 = H. + H.
-    paddsw        m1, m2        ; xmm1 = A.. + H. = R1
-    SHIFT(m2)                   ; xmm2 = op2
-    psubsw        m4, m7        ; xmm4 = E - G = E.
-    SHIFT(m1)                   ; xmm1 = op1
-    movdqa        m3, I(2)      ; Load D. from I(2)
-    paddsw        m7, m7        ; xmm7 = G + G
-    paddsw        m7, m4        ; xmm7 = E + G = G.
-    psubsw        m4, m3        ; xmm4 = E. - D. = R4
-    ADD(m4)                     ; Adjust R4 and R3 before shifting
-    paddsw        m3, m3        ; xmm3 = D. + D.
-    paddsw        m3, m4        ; xmm3 = E. + D. = R3
-    SHIFT(m4)                   ; xmm4 = op4
-    psubsw        m6, m5        ; xmm6 = F. - B..= R6
-    SHIFT(m3)                   ; xmm3 = op3
-    ADD(m6)                     ; Adjust R6 and R5 before shifting
-    paddsw        m5, m5        ; xmm5 = B.. + B..
-    paddsw        m5, m6        ; xmm5 = F. + B.. = R5
-    SHIFT(m6)                   ; xmm6 = op6
-    SHIFT(m5)                   ; xmm5 = op5
-    psubsw        m7, m0        ; xmm7 = G. - C. = R7
-    ADD(m7)                     ; Adjust R7 and R0 before shifting
-    paddsw        m0, m0        ; xmm0 = C. + C.
-    paddsw        m0, m7        ; xmm0 = G. + C.
-    SHIFT(m7)                   ; xmm7 = op7
-    SHIFT(m0)                   ; xmm0 = op0
-%endmacro
-
-%macro PUT_BLOCK 8
-    movdqa      O(0), m%1
-    movdqa      O(1), m%2
-    movdqa      O(2), m%3
-    movdqa      O(3), m%4
-    movdqa      O(4), m%5
-    movdqa      O(5), m%6
-    movdqa      O(6), m%7
-    movdqa      O(7), m%8
-%endmacro
-
-%macro VP3_IDCT 1
-%if mmsize == 16
-%define I(x) [%1+16*x]
-%define O(x) [%1+16*x]
-%define C(x) [vp3_idct_data+16*(x-1)]
-%define SHIFT(x)
-%define ADD(x)
-        VP3_1D_IDCT_SSE2
-%if ARCH_X86_64
-        TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8
-%else
-        TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, [%1], [%1+16]
-%endif
-        PUT_BLOCK 0, 1, 2, 3, 4, 5, 6, 7
-
-%define SHIFT(x) psraw  x, 4
-%define ADD(x)   paddsw x, [pw_8]
-        VP3_1D_IDCT_SSE2
-        PUT_BLOCK 0, 1, 2, 3, 4, 5, 6, 7
-%else ; mmsize == 8
-    ; eax = quantized input
-    ; ebx = dequantizer matrix
-    ; ecx = IDCT constants
-    ;  M(I) = ecx + MaskOffset(0) + I * 8
-    ;  C(I) = ecx + CosineOffset(32) + (I-1) * 8
-    ; edx = output
-    ; r0..r7 = mm0..mm7
-%define OC_8 [pw_8]
-%define C(x) [vp3_idct_data+16*(x-1)]
-
-    ; at this point, function has completed dequantization + dezigzag +
-    ; partial transposition; now do the idct itself
-%define I(x) [%1+16*x]
-%define J(x) [%1+16*x]
-    RowIDCT
-    Transpose
-
-%define I(x) [%1+16*x+8]
-%define J(x) [%1+16*x+8]
-    RowIDCT
-    Transpose
-
-%define I(x) [%1+16* x]
-%define J(x) [%1+16*(x-4)+8]
-    ColumnIDCT
-
-%define I(x) [%1+16* x   +64]
-%define J(x) [%1+16*(x-4)+72]
-    ColumnIDCT
-%endif ; mmsize == 16/8
-%endmacro
-
-%macro vp3_idct_funcs 0
-cglobal vp3_idct_put, 3, 4, 9
-    VP3_IDCT      r2
-
-    movsxdifnidn  r1, r1d
-    mova          m4, [pb_80]
-    lea           r3, [r1*3]
-%assign %%i 0
-%rep 16/mmsize
-    mova          m0, [r2+mmsize*0+%%i]
-    mova          m1, [r2+mmsize*2+%%i]
-    mova          m2, [r2+mmsize*4+%%i]
-    mova          m3, [r2+mmsize*6+%%i]
-%if mmsize == 8
-    packsswb      m0, [r2+mmsize*8+%%i]
-    packsswb      m1, [r2+mmsize*10+%%i]
-    packsswb      m2, [r2+mmsize*12+%%i]
-    packsswb      m3, [r2+mmsize*14+%%i]
-%else
-    packsswb      m0, [r2+mmsize*1+%%i]
-    packsswb      m1, [r2+mmsize*3+%%i]
-    packsswb      m2, [r2+mmsize*5+%%i]
-    packsswb      m3, [r2+mmsize*7+%%i]
-%endif
-    paddb         m0, m4
-    paddb         m1, m4
-    paddb         m2, m4
-    paddb         m3, m4
-    movq   [r0     ], m0
-%if mmsize == 8
-    movq   [r0+r1  ], m1
-    movq   [r0+r1*2], m2
-    movq   [r0+r3  ], m3
-%else
-    movhps [r0+r1  ], m0
-    movq   [r0+r1*2], m1
-    movhps [r0+r3  ], m1
-%endif
-%if %%i == 0
-    lea           r0, [r0+r1*4]
-%endif
-%if mmsize == 16
-    movq   [r0     ], m2
-    movhps [r0+r1  ], m2
-    movq   [r0+r1*2], m3
-    movhps [r0+r3  ], m3
-%endif
-%assign %%i %%i+8
-%endrep
-
-    pxor          m0, m0
-%assign %%offset 0
-%rep 128/mmsize
-    mova [r2+%%offset], m0
-%assign %%offset %%offset+mmsize
-%endrep
-    RET
-
-cglobal vp3_idct_add, 3, 4, 9
-    VP3_IDCT      r2
-
-    movsxdifnidn  r1, r1d
-    lea           r3, [r1*3]
-    pxor          m4, m4
-%if mmsize == 16
-%assign %%i 0
-%rep 2
-    movq          m0, [r0]
-    movq          m1, [r0+r1]
-    movq          m2, [r0+r1*2]
-    movq          m3, [r0+r3]
-    punpcklbw     m0, m4
-    punpcklbw     m1, m4
-    punpcklbw     m2, m4
-    punpcklbw     m3, m4
-    paddsw        m0, [r2+ 0+%%i]
-    paddsw        m1, [r2+16+%%i]
-    paddsw        m2, [r2+32+%%i]
-    paddsw        m3, [r2+48+%%i]
-    packuswb      m0, m1
-    packuswb      m2, m3
-    movq   [r0     ], m0
-    movhps [r0+r1  ], m0
-    movq   [r0+r1*2], m2
-    movhps [r0+r3  ], m2
-%if %%i == 0
-    lea           r0, [r0+r1*4]
-%endif
-%assign %%i %%i+64
-%endrep
-%else
-%assign %%i 0
-%rep 2
-    movq          m0, [r0]
-    movq          m1, [r0+r1]
-    movq          m2, [r0+r1*2]
-    movq          m3, [r0+r3]
-    movq          m5, m0
-    movq          m6, m1
-    movq          m7, m2
-    punpcklbw     m0, m4
-    punpcklbw     m1, m4
-    punpcklbw     m2, m4
-    punpckhbw     m5, m4
-    punpckhbw     m6, m4
-    punpckhbw     m7, m4
-    paddsw        m0, [r2+ 0+%%i]
-    paddsw        m1, [r2+16+%%i]
-    paddsw        m2, [r2+32+%%i]
-    paddsw        m5, [r2+64+%%i]
-    paddsw        m6, [r2+80+%%i]
-    paddsw        m7, [r2+96+%%i]
-    packuswb      m0, m5
-    movq          m5, m3
-    punpcklbw     m3, m4
-    punpckhbw     m5, m4
-    packuswb      m1, m6
-    paddsw        m3, [r2+48+%%i]
-    paddsw        m5, [r2+112+%%i]
-    packuswb      m2, m7
-    packuswb      m3, m5
-    movq   [r0     ], m0
-    movq   [r0+r1  ], m1
-    movq   [r0+r1*2], m2
-    movq   [r0+r3  ], m3
-%if %%i == 0
-    lea           r0, [r0+r1*4]
-%endif
-%assign %%i %%i+8
-%endrep
-%endif
-%assign %%i 0
-%rep 128/mmsize
-    mova    [r2+%%i], m4
-%assign %%i %%i+mmsize
-%endrep
-    RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-vp3_idct_funcs
-%endif
-
-INIT_XMM sse2
-vp3_idct_funcs
-
-%macro DC_ADD 0
-    movq          m2, [r0     ]
-    movq          m3, [r0+r1  ]
-    paddusb       m2, m0
-    movq          m4, [r0+r1*2]
-    paddusb       m3, m0
-    movq          m5, [r0+r2  ]
-    paddusb       m4, m0
-    paddusb       m5, m0
-    psubusb       m2, m1
-    psubusb       m3, m1
-    movq   [r0     ], m2
-    psubusb       m4, m1
-    movq   [r0+r1  ], m3
-    psubusb       m5, m1
-    movq   [r0+r1*2], m4
-    movq   [r0+r2  ], m5
-%endmacro
-
-INIT_MMX mmxext
-cglobal vp3_idct_dc_add, 3, 4
-%if ARCH_X86_64
-    movsxd        r1, r1d
-%endif
-    movsx         r3, word [r2]
-    mov    word [r2], 0
-    lea           r2, [r1*3]
-    add           r3, 15
-    sar           r3, 5
-    movd          m0, r3d
-    pshufw        m0, m0, 0x0
-    pxor          m1, m1
-    psubw         m1, m0
-    packuswb      m0, m0
-    packuswb      m1, m1
-    DC_ADD
-    lea           r0, [r0+r1*4]
-    DC_ADD
-    RET
diff --git a/deps/libav/libavcodec/x86/vp3dsp_init.c b/deps/libav/libavcodec/x86/vp3dsp_init.c
deleted file mode 100644
index 9e38014..0000000
--- a/deps/libav/libavcodec/x86/vp3dsp_init.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/dsputil.h"
-#include "libavcodec/vp3dsp.h"
-#include "config.h"
-
-void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);
-void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);
-
-void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, int16_t *block);
-void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, int16_t *block);
-
-void ff_vp3_idct_dc_add_mmxext(uint8_t *dest, int line_size,
-                               int16_t *block);
-
-void ff_vp3_v_loop_filter_mmxext(uint8_t *src, int stride,
-                                 int *bounding_values);
-void ff_vp3_h_loop_filter_mmxext(uint8_t *src, int stride,
-                                 int *bounding_values);
-
-av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-#if ARCH_X86_32
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->idct_put  = ff_vp3_idct_put_mmx;
-        c->idct_add  = ff_vp3_idct_add_mmx;
-    }
-#endif
-
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        c->idct_dc_add = ff_vp3_idct_dc_add_mmxext;
-
-        if (!(flags & CODEC_FLAG_BITEXACT)) {
-            c->v_loop_filter = ff_vp3_v_loop_filter_mmxext;
-            c->h_loop_filter = ff_vp3_h_loop_filter_mmxext;
-        }
-    }
-
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        c->idct_put  = ff_vp3_idct_put_sse2;
-        c->idct_add  = ff_vp3_idct_add_sse2;
-    }
-}
diff --git a/deps/libav/libavcodec/x86/vp56_arith.h b/deps/libav/libavcodec/x86/vp56_arith.h
deleted file mode 100644
index 0a69368..0000000
--- a/deps/libav/libavcodec/x86/vp56_arith.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * VP5 and VP6 compatible video decoder (arith decoder)
- *
- * Copyright (C) 2006  Aurelien Jacobs <aurel at gnuage.org>
- * Copyright (C) 2010  Eli Friedman
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_X86_VP56_ARITH_H
-#define AVCODEC_X86_VP56_ARITH_H
-
-#if HAVE_INLINE_ASM && HAVE_FAST_CMOV
-#define vp56_rac_get_prob vp56_rac_get_prob
-static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
-{
-    unsigned int code_word = vp56_rac_renorm(c);
-    unsigned int high = c->high;
-    unsigned int low = 1 + (((high - 1) * prob) >> 8);
-    unsigned int low_shift = low << 16;
-    int bit = 0;
-
-    __asm__(
-        "subl  %4, %1      \n\t"
-        "subl  %3, %2      \n\t"
-        "leal (%2, %3), %3 \n\t"
-        "setae %b0         \n\t"
-        "cmovb %4, %1      \n\t"
-        "cmovb %3, %2      \n\t"
-        : "+q"(bit), "+r"(high), "+r"(code_word), "+r"(low_shift)
-        : "r"(low)
-    );
-
-    c->high      = high;
-    c->code_word = code_word;
-    return bit;
-}
-#endif
-
-#endif /* AVCODEC_X86_VP56_ARITH_H */
diff --git a/deps/libav/libavcodec/x86/vp6dsp.asm b/deps/libav/libavcodec/x86/vp6dsp.asm
deleted file mode 100644
index 80f8ca5..0000000
--- a/deps/libav/libavcodec/x86/vp6dsp.asm
+++ /dev/null
@@ -1,170 +0,0 @@
-;******************************************************************************
-;* MMX/SSE2-optimized functions for the VP6 decoder
-;* Copyright (C) 2009  Sebastien Lucas <sebastien.lucas at gmail.com>
-;* Copyright (C) 2009  Zuxy Meng <zuxy.meng at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-cextern pw_64
-
-SECTION .text
-
-%macro DIAG4 6
-%if mmsize == 8
-    movq          m0, [%1+%2]
-    movq          m1, [%1+%3]
-    movq          m3, m0
-    movq          m4, m1
-    punpcklbw     m0, m7
-    punpcklbw     m1, m7
-    punpckhbw     m3, m7
-    punpckhbw     m4, m7
-    pmullw        m0, [rsp+8*11] ; src[x-8 ] * biweight [0]
-    pmullw        m1, [rsp+8*12] ; src[x   ] * biweight [1]
-    pmullw        m3, [rsp+8*11] ; src[x-8 ] * biweight [0]
-    pmullw        m4, [rsp+8*12] ; src[x   ] * biweight [1]
-    paddw         m0, m1
-    paddw         m3, m4
-    movq          m1, [%1+%4]
-    movq          m2, [%1+%5]
-    movq          m4, m1
-    movq          m5, m2
-    punpcklbw     m1, m7
-    punpcklbw     m2, m7
-    punpckhbw     m4, m7
-    punpckhbw     m5, m7
-    pmullw        m1, [rsp+8*13] ; src[x+8 ] * biweight [2]
-    pmullw        m2, [rsp+8*14] ; src[x+16] * biweight [3]
-    pmullw        m4, [rsp+8*13] ; src[x+8 ] * biweight [2]
-    pmullw        m5, [rsp+8*14] ; src[x+16] * biweight [3]
-    paddw         m1, m2
-    paddw         m4, m5
-    paddsw        m0, m1
-    paddsw        m3, m4
-    paddsw        m0, m6         ; Add 64
-    paddsw        m3, m6         ; Add 64
-    psraw         m0, 7
-    psraw         m3, 7
-    packuswb      m0, m3
-    movq        [%6], m0
-%else ; mmsize == 16
-    movq          m0, [%1+%2]
-    movq          m1, [%1+%3]
-    punpcklbw     m0, m7
-    punpcklbw     m1, m7
-    pmullw        m0, m4         ; src[x-8 ] * biweight [0]
-    pmullw        m1, m5         ; src[x   ] * biweight [1]
-    paddw         m0, m1
-    movq          m1, [%1+%4]
-    movq          m2, [%1+%5]
-    punpcklbw     m1, m7
-    punpcklbw     m2, m7
-    pmullw        m1, m6         ; src[x+8 ] * biweight [2]
-    pmullw        m2, m3         ; src[x+16] * biweight [3]
-    paddw         m1, m2
-    paddsw        m0, m1
-    paddsw        m0, [pw_64]    ; Add 64
-    psraw         m0, 7
-    packuswb      m0, m0
-    movq        [%6], m0
-%endif ; mmsize == 8/16
-%endmacro
-
-%macro SPLAT4REGS 0
-%if mmsize == 8
-    movq         m5, m3
-    punpcklwd    m3, m3
-    movq         m4, m3
-    punpckldq    m3, m3
-    punpckhdq    m4, m4
-    punpckhwd    m5, m5
-    movq         m2, m5
-    punpckhdq    m2, m2
-    punpckldq    m5, m5
-    movq [rsp+8*11], m3
-    movq [rsp+8*12], m4
-    movq [rsp+8*13], m5
-    movq [rsp+8*14], m2
-%else ; mmsize == 16
-    pshuflw      m4, m3, 0x0
-    pshuflw      m5, m3, 0x55
-    pshuflw      m6, m3, 0xAA
-    pshuflw      m3, m3, 0xFF
-    punpcklqdq   m4, m4
-    punpcklqdq   m5, m5
-    punpcklqdq   m6, m6
-    punpcklqdq   m3, m3
-%endif ; mmsize == 8/16
-%endmacro
-
-%macro vp6_filter_diag4 0
-; void ff_vp6_filter_diag4_<opt>(uint8_t *dst, uint8_t *src, int stride,
-;                                const int16_t h_weight[4], const int16_t v_weights[4])
-cglobal vp6_filter_diag4, 5, 7, 8
-    mov          r5, rsp         ; backup stack pointer
-    and         rsp, ~(mmsize-1) ; align stack
-%if mmsize == 16
-    sub         rsp, 8*11
-%else
-    sub         rsp, 8*15
-    movq         m6, [pw_64]
-%endif
-%if ARCH_X86_64
-    movsxd       r2, r2d
-%endif
-
-    sub          r1, r2
-
-    pxor         m7, m7
-    movq         m3, [r3]
-    SPLAT4REGS
-
-    mov          r3, rsp
-    mov          r6, 11
-.nextrow:
-    DIAG4        r1, -1, 0, 1, 2, r3
-    add          r3, 8
-    add          r1, r2
-    dec          r6
-    jnz .nextrow
-
-    movq         m3, [r4]
-    SPLAT4REGS
-
-    lea          r3, [rsp+8]
-    mov          r6, 8
-.nextcol:
-    DIAG4        r3, -8, 0, 8, 16, r0
-    add          r3, 8
-    add          r0, r2
-    dec          r6
-    jnz .nextcol
-
-    mov         rsp, r5          ; restore stack pointer
-    RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-vp6_filter_diag4
-%endif
-
-INIT_XMM sse2
-vp6_filter_diag4
diff --git a/deps/libav/libavcodec/x86/vp6dsp_init.c b/deps/libav/libavcodec/x86/vp6dsp_init.c
deleted file mode 100644
index cd94f3e..0000000
--- a/deps/libav/libavcodec/x86/vp6dsp_init.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * VP6 MMX/SSE2 optimizations
- * Copyright (C) 2009  Sebastien Lucas <sebastien.lucas at gmail.com>
- * Copyright (C) 2009  Zuxy Meng <zuxy.meng at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/vp56dsp.h"
-
-void ff_vp6_filter_diag4_mmx(uint8_t *dst, uint8_t *src, int stride,
-                             const int16_t *h_weights,const int16_t *v_weights);
-void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, int stride,
-                              const int16_t *h_weights,const int16_t *v_weights);
-
-av_cold void ff_vp6dsp_init_x86(VP56DSPContext* c, enum AVCodecID codec)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-#if ARCH_X86_32
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->vp6_filter_diag4 = ff_vp6_filter_diag4_mmx;
-    }
-#endif
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2;
-    }
-}
diff --git a/deps/libav/libavcodec/x86/vp8dsp.asm b/deps/libav/libavcodec/x86/vp8dsp.asm
deleted file mode 100644
index d41b6b4..0000000
--- a/deps/libav/libavcodec/x86/vp8dsp.asm
+++ /dev/null
@@ -1,1225 +0,0 @@
-;******************************************************************************
-;* VP8 MMXEXT optimizations
-;* Copyright (c) 2010 Ronald S. Bultje <rsbultje at gmail.com>
-;* Copyright (c) 2010 Jason Garrett-Glaser <darkshikari at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-fourtap_filter_hw_m: times 4 dw  -6, 123
-                     times 4 dw  12,  -1
-                     times 4 dw  -9,  93
-                     times 4 dw  50,  -6
-                     times 4 dw  -6,  50
-                     times 4 dw  93,  -9
-                     times 4 dw  -1,  12
-                     times 4 dw 123,  -6
-
-sixtap_filter_hw_m:  times 4 dw   2, -11
-                     times 4 dw 108,  36
-                     times 4 dw  -8,   1
-                     times 4 dw   3, -16
-                     times 4 dw  77,  77
-                     times 4 dw -16,   3
-                     times 4 dw   1,  -8
-                     times 4 dw  36, 108
-                     times 4 dw -11,   2
-
-fourtap_filter_hb_m: times 8 db  -6, 123
-                     times 8 db  12,  -1
-                     times 8 db  -9,  93
-                     times 8 db  50,  -6
-                     times 8 db  -6,  50
-                     times 8 db  93,  -9
-                     times 8 db  -1,  12
-                     times 8 db 123,  -6
-
-sixtap_filter_hb_m:  times 8 db   2,   1
-                     times 8 db -11, 108
-                     times 8 db  36,  -8
-                     times 8 db   3,   3
-                     times 8 db -16,  77
-                     times 8 db  77, -16
-                     times 8 db   1,   2
-                     times 8 db  -8,  36
-                     times 8 db 108, -11
-
-fourtap_filter_v_m:  times 8 dw  -6
-                     times 8 dw 123
-                     times 8 dw  12
-                     times 8 dw  -1
-                     times 8 dw  -9
-                     times 8 dw  93
-                     times 8 dw  50
-                     times 8 dw  -6
-                     times 8 dw  -6
-                     times 8 dw  50
-                     times 8 dw  93
-                     times 8 dw  -9
-                     times 8 dw  -1
-                     times 8 dw  12
-                     times 8 dw 123
-                     times 8 dw  -6
-
-sixtap_filter_v_m:   times 8 dw   2
-                     times 8 dw -11
-                     times 8 dw 108
-                     times 8 dw  36
-                     times 8 dw  -8
-                     times 8 dw   1
-                     times 8 dw   3
-                     times 8 dw -16
-                     times 8 dw  77
-                     times 8 dw  77
-                     times 8 dw -16
-                     times 8 dw   3
-                     times 8 dw   1
-                     times 8 dw  -8
-                     times 8 dw  36
-                     times 8 dw 108
-                     times 8 dw -11
-                     times 8 dw   2
-
-bilinear_filter_vw_m: times 8 dw 1
-                      times 8 dw 2
-                      times 8 dw 3
-                      times 8 dw 4
-                      times 8 dw 5
-                      times 8 dw 6
-                      times 8 dw 7
-
-bilinear_filter_vb_m: times 8 db 7, 1
-                      times 8 db 6, 2
-                      times 8 db 5, 3
-                      times 8 db 4, 4
-                      times 8 db 3, 5
-                      times 8 db 2, 6
-                      times 8 db 1, 7
-
-%ifdef PIC
-%define fourtap_filter_hw  picregq
-%define sixtap_filter_hw   picregq
-%define fourtap_filter_hb  picregq
-%define sixtap_filter_hb   picregq
-%define fourtap_filter_v   picregq
-%define sixtap_filter_v    picregq
-%define bilinear_filter_vw picregq
-%define bilinear_filter_vb picregq
-%define npicregs 1
-%else
-%define fourtap_filter_hw  fourtap_filter_hw_m
-%define sixtap_filter_hw   sixtap_filter_hw_m
-%define fourtap_filter_hb  fourtap_filter_hb_m
-%define sixtap_filter_hb   sixtap_filter_hb_m
-%define fourtap_filter_v   fourtap_filter_v_m
-%define sixtap_filter_v    sixtap_filter_v_m
-%define bilinear_filter_vw bilinear_filter_vw_m
-%define bilinear_filter_vb bilinear_filter_vb_m
-%define npicregs 0
-%endif
-
-filter_h2_shuf:  db 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5,  6, 6,  7,  7,  8
-filter_h4_shuf:  db 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,  8, 8,  9,  9, 10
-
-filter_h6_shuf1: db 0, 5, 1, 6, 2, 7, 3, 8, 4, 9, 5, 10, 6, 11,  7, 12
-filter_h6_shuf2: db 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,  7, 7,  8,  8,  9
-filter_h6_shuf3: db 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8,  9, 9, 10, 10, 11
-
-pw_256:   times 8 dw 256
-pw_20091: times 4 dw 20091
-pw_17734: times 4 dw 17734
-
-cextern pw_3
-cextern pw_4
-cextern pw_64
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; subpel MC functions:
-;
-; void put_vp8_epel<size>_h<htap>v<vtap>_<opt>(uint8_t *dst, int deststride,
-;                                              uint8_t *src, int srcstride,
-;                                              int height,   int mx, int my);
-;-----------------------------------------------------------------------------
-
-%macro FILTER_SSSE3 1
-cglobal put_vp8_epel%1_h6, 6, 6 + npicregs, 8, dst, dststride, src, srcstride, height, mx, picreg
-    lea      mxd, [mxq*3]
-    mova      m3, [filter_h6_shuf2]
-    mova      m4, [filter_h6_shuf3]
-%ifdef PIC
-    lea  picregq, [sixtap_filter_hb_m]
-%endif
-    mova      m5, [sixtap_filter_hb+mxq*8-48] ; set up 6tap filter in bytes
-    mova      m6, [sixtap_filter_hb+mxq*8-32]
-    mova      m7, [sixtap_filter_hb+mxq*8-16]
-
-.nextrow:
-    movu      m0, [srcq-2]
-    mova      m1, m0
-    mova      m2, m0
-%if mmsize == 8
-; For epel4, we need 9 bytes, but only 8 get loaded; to compensate, do the
-; shuffle with a memory operand
-    punpcklbw m0, [srcq+3]
-%else
-    pshufb    m0, [filter_h6_shuf1]
-%endif
-    pshufb    m1, m3
-    pshufb    m2, m4
-    pmaddubsw m0, m5
-    pmaddubsw m1, m6
-    pmaddubsw m2, m7
-    paddsw    m0, m1
-    paddsw    m0, m2
-    pmulhrsw  m0, [pw_256]
-    packuswb  m0, m0
-    movh  [dstq], m0        ; store
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec  heightd            ; next row
-    jg .nextrow
-    REP_RET
-
-cglobal put_vp8_epel%1_h4, 6, 6 + npicregs, 7, dst, dststride, src, srcstride, height, mx, picreg
-    shl      mxd, 4
-    mova      m2, [pw_256]
-    mova      m3, [filter_h2_shuf]
-    mova      m4, [filter_h4_shuf]
-%ifdef PIC
-    lea  picregq, [fourtap_filter_hb_m]
-%endif
-    mova      m5, [fourtap_filter_hb+mxq-16] ; set up 4tap filter in bytes
-    mova      m6, [fourtap_filter_hb+mxq]
-
-.nextrow:
-    movu      m0, [srcq-1]
-    mova      m1, m0
-    pshufb    m0, m3
-    pshufb    m1, m4
-    pmaddubsw m0, m5
-    pmaddubsw m1, m6
-    paddsw    m0, m1
-    pmulhrsw  m0, m2
-    packuswb  m0, m0
-    movh  [dstq], m0        ; store
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec  heightd            ; next row
-    jg .nextrow
-    REP_RET
-
-cglobal put_vp8_epel%1_v4, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my
-    shl      myd, 4
-%ifdef PIC
-    lea  picregq, [fourtap_filter_hb_m]
-%endif
-    mova      m5, [fourtap_filter_hb+myq-16]
-    mova      m6, [fourtap_filter_hb+myq]
-    mova      m7, [pw_256]
-
-    ; read 3 lines
-    sub     srcq, srcstrideq
-    movh      m0, [srcq]
-    movh      m1, [srcq+  srcstrideq]
-    movh      m2, [srcq+2*srcstrideq]
-    add     srcq, srcstrideq
-
-.nextrow:
-    movh      m3, [srcq+2*srcstrideq]      ; read new row
-    mova      m4, m0
-    mova      m0, m1
-    punpcklbw m4, m1
-    mova      m1, m2
-    punpcklbw m2, m3
-    pmaddubsw m4, m5
-    pmaddubsw m2, m6
-    paddsw    m4, m2
-    mova      m2, m3
-    pmulhrsw  m4, m7
-    packuswb  m4, m4
-    movh  [dstq], m4
-
-    ; go to next line
-    add      dstq, dststrideq
-    add      srcq, srcstrideq
-    dec   heightd                          ; next row
-    jg .nextrow
-    REP_RET
-
-cglobal put_vp8_epel%1_v6, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my
-    lea      myd, [myq*3]
-%ifdef PIC
-    lea  picregq, [sixtap_filter_hb_m]
-%endif
-    lea      myq, [sixtap_filter_hb+myq*8]
-
-    ; read 5 lines
-    sub     srcq, srcstrideq
-    sub     srcq, srcstrideq
-    movh      m0, [srcq]
-    movh      m1, [srcq+srcstrideq]
-    movh      m2, [srcq+srcstrideq*2]
-    lea     srcq, [srcq+srcstrideq*2]
-    add     srcq, srcstrideq
-    movh      m3, [srcq]
-    movh      m4, [srcq+srcstrideq]
-
-.nextrow:
-    movh      m5, [srcq+2*srcstrideq]      ; read new row
-    mova      m6, m0
-    punpcklbw m6, m5
-    mova      m0, m1
-    punpcklbw m1, m2
-    mova      m7, m3
-    punpcklbw m7, m4
-    pmaddubsw m6, [myq-48]
-    pmaddubsw m1, [myq-32]
-    pmaddubsw m7, [myq-16]
-    paddsw    m6, m1
-    paddsw    m6, m7
-    mova      m1, m2
-    mova      m2, m3
-    pmulhrsw  m6, [pw_256]
-    mova      m3, m4
-    packuswb  m6, m6
-    mova      m4, m5
-    movh  [dstq], m6
-
-    ; go to next line
-    add      dstq, dststrideq
-    add      srcq, srcstrideq
-    dec   heightd                          ; next row
-    jg .nextrow
-    REP_RET
-%endmacro
-
-INIT_MMX ssse3
-FILTER_SSSE3 4
-INIT_XMM ssse3
-FILTER_SSSE3 8
-
-; 4x4 block, H-only 4-tap filter
-INIT_MMX mmxext
-cglobal put_vp8_epel4_h4, 6, 6 + npicregs, 0, dst, dststride, src, srcstride, height, mx, picreg
-    shl       mxd, 4
-%ifdef PIC
-    lea   picregq, [fourtap_filter_hw_m]
-%endif
-    movq      mm4, [fourtap_filter_hw+mxq-16] ; set up 4tap filter in words
-    movq      mm5, [fourtap_filter_hw+mxq]
-    movq      mm7, [pw_64]
-    pxor      mm6, mm6
-
-.nextrow:
-    movq      mm1, [srcq-1]                ; (ABCDEFGH) load 8 horizontal pixels
-
-    ; first set of 2 pixels
-    movq      mm2, mm1                     ; byte ABCD..
-    punpcklbw mm1, mm6                     ; byte->word ABCD
-    pshufw    mm0, mm2, 9                  ; byte CDEF..
-    punpcklbw mm0, mm6                     ; byte->word CDEF
-    pshufw    mm3, mm1, 0x94               ; word ABBC
-    pshufw    mm1, mm0, 0x94               ; word CDDE
-    pmaddwd   mm3, mm4                     ; multiply 2px with F0/F1
-    movq      mm0, mm1                     ; backup for second set of pixels
-    pmaddwd   mm1, mm5                     ; multiply 2px with F2/F3
-    paddd     mm3, mm1                     ; finish 1st 2px
-
-    ; second set of 2 pixels, use backup of above
-    punpckhbw mm2, mm6                     ; byte->word EFGH
-    pmaddwd   mm0, mm4                     ; multiply backed up 2px with F0/F1
-    pshufw    mm1, mm2, 0x94               ; word EFFG
-    pmaddwd   mm1, mm5                     ; multiply 2px with F2/F3
-    paddd     mm0, mm1                     ; finish 2nd 2px
-
-    ; merge two sets of 2 pixels into one set of 4, round/clip/store
-    packssdw  mm3, mm0                     ; merge dword->word (4px)
-    paddsw    mm3, mm7                     ; rounding
-    psraw     mm3, 7
-    packuswb  mm3, mm6                     ; clip and word->bytes
-    movd   [dstq], mm3                     ; store
-
-    ; go to next line
-    add      dstq, dststrideq
-    add      srcq, srcstrideq
-    dec   heightd                          ; next row
-    jg .nextrow
-    REP_RET
-
-; 4x4 block, H-only 6-tap filter
-INIT_MMX mmxext
-cglobal put_vp8_epel4_h6, 6, 6 + npicregs, 0, dst, dststride, src, srcstride, height, mx, picreg
-    lea       mxd, [mxq*3]
-%ifdef PIC
-    lea   picregq, [sixtap_filter_hw_m]
-%endif
-    movq      mm4, [sixtap_filter_hw+mxq*8-48] ; set up 4tap filter in words
-    movq      mm5, [sixtap_filter_hw+mxq*8-32]
-    movq      mm6, [sixtap_filter_hw+mxq*8-16]
-    movq      mm7, [pw_64]
-    pxor      mm3, mm3
-
-.nextrow:
-    movq      mm1, [srcq-2]                ; (ABCDEFGH) load 8 horizontal pixels
-
-    ; first set of 2 pixels
-    movq      mm2, mm1                     ; byte ABCD..
-    punpcklbw mm1, mm3                     ; byte->word ABCD
-    pshufw    mm0, mm2, 0x9                ; byte CDEF..
-    punpckhbw mm2, mm3                     ; byte->word EFGH
-    punpcklbw mm0, mm3                     ; byte->word CDEF
-    pshufw    mm1, mm1, 0x94               ; word ABBC
-    pshufw    mm2, mm2, 0x94               ; word EFFG
-    pmaddwd   mm1, mm4                     ; multiply 2px with F0/F1
-    pshufw    mm3, mm0, 0x94               ; word CDDE
-    movq      mm0, mm3                     ; backup for second set of pixels
-    pmaddwd   mm3, mm5                     ; multiply 2px with F2/F3
-    paddd     mm1, mm3                     ; add to 1st 2px cache
-    movq      mm3, mm2                     ; backup for second set of pixels
-    pmaddwd   mm2, mm6                     ; multiply 2px with F4/F5
-    paddd     mm1, mm2                     ; finish 1st 2px
-
-    ; second set of 2 pixels, use backup of above
-    movd      mm2, [srcq+3]                ; byte FGHI (prevent overreads)
-    pmaddwd   mm0, mm4                     ; multiply 1st backed up 2px with F0/F1
-    pmaddwd   mm3, mm5                     ; multiply 2nd backed up 2px with F2/F3
-    paddd     mm0, mm3                     ; add to 2nd 2px cache
-    pxor      mm3, mm3
-    punpcklbw mm2, mm3                     ; byte->word FGHI
-    pshufw    mm2, mm2, 0xE9               ; word GHHI
-    pmaddwd   mm2, mm6                     ; multiply 2px with F4/F5
-    paddd     mm0, mm2                     ; finish 2nd 2px
-
-    ; merge two sets of 2 pixels into one set of 4, round/clip/store
-    packssdw  mm1, mm0                     ; merge dword->word (4px)
-    paddsw    mm1, mm7                     ; rounding
-    psraw     mm1, 7
-    packuswb  mm1, mm3                     ; clip and word->bytes
-    movd   [dstq], mm1                     ; store
-
-    ; go to next line
-    add      dstq, dststrideq
-    add      srcq, srcstrideq
-    dec   heightd                          ; next row
-    jg .nextrow
-    REP_RET
-
-INIT_XMM sse2
-cglobal put_vp8_epel8_h4, 6, 6 + npicregs, 10, dst, dststride, src, srcstride, height, mx, picreg
-    shl      mxd, 5
-%ifdef PIC
-    lea  picregq, [fourtap_filter_v_m]
-%endif
-    lea      mxq, [fourtap_filter_v+mxq-32]
-    pxor      m7, m7
-    mova      m4, [pw_64]
-    mova      m5, [mxq+ 0]
-    mova      m6, [mxq+16]
-%ifdef m8
-    mova      m8, [mxq+32]
-    mova      m9, [mxq+48]
-%endif
-.nextrow:
-    movq      m0, [srcq-1]
-    movq      m1, [srcq-0]
-    movq      m2, [srcq+1]
-    movq      m3, [srcq+2]
-    punpcklbw m0, m7
-    punpcklbw m1, m7
-    punpcklbw m2, m7
-    punpcklbw m3, m7
-    pmullw    m0, m5
-    pmullw    m1, m6
-%ifdef m8
-    pmullw    m2, m8
-    pmullw    m3, m9
-%else
-    pmullw    m2, [mxq+32]
-    pmullw    m3, [mxq+48]
-%endif
-    paddsw    m0, m1
-    paddsw    m2, m3
-    paddsw    m0, m2
-    paddsw    m0, m4
-    psraw     m0, 7
-    packuswb  m0, m7
-    movh  [dstq], m0        ; store
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec  heightd            ; next row
-    jg .nextrow
-    REP_RET
-
-INIT_XMM sse2
-cglobal put_vp8_epel8_h6, 6, 6 + npicregs, 14, dst, dststride, src, srcstride, height, mx, picreg
-    lea      mxd, [mxq*3]
-    shl      mxd, 4
-%ifdef PIC
-    lea  picregq, [sixtap_filter_v_m]
-%endif
-    lea      mxq, [sixtap_filter_v+mxq-96]
-    pxor      m7, m7
-    mova      m6, [pw_64]
-%ifdef m8
-    mova      m8, [mxq+ 0]
-    mova      m9, [mxq+16]
-    mova     m10, [mxq+32]
-    mova     m11, [mxq+48]
-    mova     m12, [mxq+64]
-    mova     m13, [mxq+80]
-%endif
-.nextrow:
-    movq      m0, [srcq-2]
-    movq      m1, [srcq-1]
-    movq      m2, [srcq-0]
-    movq      m3, [srcq+1]
-    movq      m4, [srcq+2]
-    movq      m5, [srcq+3]
-    punpcklbw m0, m7
-    punpcklbw m1, m7
-    punpcklbw m2, m7
-    punpcklbw m3, m7
-    punpcklbw m4, m7
-    punpcklbw m5, m7
-%ifdef m8
-    pmullw    m0, m8
-    pmullw    m1, m9
-    pmullw    m2, m10
-    pmullw    m3, m11
-    pmullw    m4, m12
-    pmullw    m5, m13
-%else
-    pmullw    m0, [mxq+ 0]
-    pmullw    m1, [mxq+16]
-    pmullw    m2, [mxq+32]
-    pmullw    m3, [mxq+48]
-    pmullw    m4, [mxq+64]
-    pmullw    m5, [mxq+80]
-%endif
-    paddsw    m1, m4
-    paddsw    m0, m5
-    paddsw    m1, m2
-    paddsw    m0, m3
-    paddsw    m0, m1
-    paddsw    m0, m6
-    psraw     m0, 7
-    packuswb  m0, m7
-    movh  [dstq], m0        ; store
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec  heightd            ; next row
-    jg .nextrow
-    REP_RET
-
-%macro FILTER_V 1
-; 4x4 block, V-only 4-tap filter
-cglobal put_vp8_epel%1_v4, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my
-    shl      myd, 5
-%ifdef PIC
-    lea  picregq, [fourtap_filter_v_m]
-%endif
-    lea      myq, [fourtap_filter_v+myq-32]
-    mova      m6, [pw_64]
-    pxor      m7, m7
-    mova      m5, [myq+48]
-
-    ; read 3 lines
-    sub     srcq, srcstrideq
-    movh      m0, [srcq]
-    movh      m1, [srcq+  srcstrideq]
-    movh      m2, [srcq+2*srcstrideq]
-    add     srcq, srcstrideq
-    punpcklbw m0, m7
-    punpcklbw m1, m7
-    punpcklbw m2, m7
-
-.nextrow:
-    ; first calculate negative taps (to prevent losing positive overflows)
-    movh      m4, [srcq+2*srcstrideq]      ; read new row
-    punpcklbw m4, m7
-    mova      m3, m4
-    pmullw    m0, [myq+0]
-    pmullw    m4, m5
-    paddsw    m4, m0
-
-    ; then calculate positive taps
-    mova      m0, m1
-    pmullw    m1, [myq+16]
-    paddsw    m4, m1
-    mova      m1, m2
-    pmullw    m2, [myq+32]
-    paddsw    m4, m2
-    mova      m2, m3
-
-    ; round/clip/store
-    paddsw    m4, m6
-    psraw     m4, 7
-    packuswb  m4, m7
-    movh  [dstq], m4
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec  heightd                           ; next row
-    jg .nextrow
-    REP_RET
-
-
-; 4x4 block, V-only 6-tap filter
-cglobal put_vp8_epel%1_v6, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my
-    shl      myd, 4
-    lea      myq, [myq*3]
-%ifdef PIC
-    lea  picregq, [sixtap_filter_v_m]
-%endif
-    lea      myq, [sixtap_filter_v+myq-96]
-    pxor      m7, m7
-
-    ; read 5 lines
-    sub     srcq, srcstrideq
-    sub     srcq, srcstrideq
-    movh      m0, [srcq]
-    movh      m1, [srcq+srcstrideq]
-    movh      m2, [srcq+srcstrideq*2]
-    lea     srcq, [srcq+srcstrideq*2]
-    add     srcq, srcstrideq
-    movh      m3, [srcq]
-    movh      m4, [srcq+srcstrideq]
-    punpcklbw m0, m7
-    punpcklbw m1, m7
-    punpcklbw m2, m7
-    punpcklbw m3, m7
-    punpcklbw m4, m7
-
-.nextrow:
-    ; first calculate negative taps (to prevent losing positive overflows)
-    mova      m5, m1
-    pmullw    m5, [myq+16]
-    mova      m6, m4
-    pmullw    m6, [myq+64]
-    paddsw    m6, m5
-
-    ; then calculate positive taps
-    movh      m5, [srcq+2*srcstrideq]      ; read new row
-    punpcklbw m5, m7
-    pmullw    m0, [myq+0]
-    paddsw    m6, m0
-    mova      m0, m1
-    mova      m1, m2
-    pmullw    m2, [myq+32]
-    paddsw    m6, m2
-    mova      m2, m3
-    pmullw    m3, [myq+48]
-    paddsw    m6, m3
-    mova      m3, m4
-    mova      m4, m5
-    pmullw    m5, [myq+80]
-    paddsw    m6, m5
-
-    ; round/clip/store
-    paddsw    m6, [pw_64]
-    psraw     m6, 7
-    packuswb  m6, m7
-    movh  [dstq], m6
-
-    ; go to next line
-    add     dstq, dststrideq
-    add     srcq, srcstrideq
-    dec  heightd                           ; next row
-    jg .nextrow
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-FILTER_V 4
-INIT_XMM sse2
-FILTER_V 8
-
-%macro FILTER_BILINEAR 1
-cglobal put_vp8_bilinear%1_v, 7, 7, 7, dst, dststride, src, srcstride, height, picreg, my
-    shl      myd, 4
-%ifdef PIC
-    lea  picregq, [bilinear_filter_vw_m]
-%endif
-    pxor      m6, m6
-    mova      m5, [bilinear_filter_vw+myq-1*16]
-    neg      myq
-    mova      m4, [bilinear_filter_vw+myq+7*16]
-.nextrow:
-    movh      m0, [srcq+srcstrideq*0]
-    movh      m1, [srcq+srcstrideq*1]
-    movh      m3, [srcq+srcstrideq*2]
-    punpcklbw m0, m6
-    punpcklbw m1, m6
-    punpcklbw m3, m6
-    mova      m2, m1
-    pmullw    m0, m4
-    pmullw    m1, m5
-    pmullw    m2, m4
-    pmullw    m3, m5
-    paddsw    m0, m1
-    paddsw    m2, m3
-    psraw     m0, 2
-    psraw     m2, 2
-    pavgw     m0, m6
-    pavgw     m2, m6
-%if mmsize == 8
-    packuswb  m0, m0
-    packuswb  m2, m2
-    movh   [dstq+dststrideq*0], m0
-    movh   [dstq+dststrideq*1], m2
-%else
-    packuswb  m0, m2
-    movh   [dstq+dststrideq*0], m0
-    movhps [dstq+dststrideq*1], m0
-%endif
-
-    lea     dstq, [dstq+dststrideq*2]
-    lea     srcq, [srcq+srcstrideq*2]
-    sub  heightd, 2
-    jg .nextrow
-    REP_RET
-
-cglobal put_vp8_bilinear%1_h, 6, 6 + npicregs, 7, dst, dststride, src, srcstride, height, mx, picreg
-    shl      mxd, 4
-%ifdef PIC
-    lea  picregq, [bilinear_filter_vw_m]
-%endif
-    pxor      m6, m6
-    mova      m5, [bilinear_filter_vw+mxq-1*16]
-    neg      mxq
-    mova      m4, [bilinear_filter_vw+mxq+7*16]
-.nextrow:
-    movh      m0, [srcq+srcstrideq*0+0]
-    movh      m1, [srcq+srcstrideq*0+1]
-    movh      m2, [srcq+srcstrideq*1+0]
-    movh      m3, [srcq+srcstrideq*1+1]
-    punpcklbw m0, m6
-    punpcklbw m1, m6
-    punpcklbw m2, m6
-    punpcklbw m3, m6
-    pmullw    m0, m4
-    pmullw    m1, m5
-    pmullw    m2, m4
-    pmullw    m3, m5
-    paddsw    m0, m1
-    paddsw    m2, m3
-    psraw     m0, 2
-    psraw     m2, 2
-    pavgw     m0, m6
-    pavgw     m2, m6
-%if mmsize == 8
-    packuswb  m0, m0
-    packuswb  m2, m2
-    movh   [dstq+dststrideq*0], m0
-    movh   [dstq+dststrideq*1], m2
-%else
-    packuswb  m0, m2
-    movh   [dstq+dststrideq*0], m0
-    movhps [dstq+dststrideq*1], m0
-%endif
-
-    lea     dstq, [dstq+dststrideq*2]
-    lea     srcq, [srcq+srcstrideq*2]
-    sub  heightd, 2
-    jg .nextrow
-    REP_RET
-%endmacro
-
-INIT_MMX mmxext
-FILTER_BILINEAR 4
-INIT_XMM sse2
-FILTER_BILINEAR 8
-
-%macro FILTER_BILINEAR_SSSE3 1
-cglobal put_vp8_bilinear%1_v, 7, 7, 5, dst, dststride, src, srcstride, height, picreg, my
-    shl      myd, 4
-%ifdef PIC
-    lea  picregq, [bilinear_filter_vb_m]
-%endif
-    pxor      m4, m4
-    mova      m3, [bilinear_filter_vb+myq-16]
-.nextrow:
-    movh      m0, [srcq+srcstrideq*0]
-    movh      m1, [srcq+srcstrideq*1]
-    movh      m2, [srcq+srcstrideq*2]
-    punpcklbw m0, m1
-    punpcklbw m1, m2
-    pmaddubsw m0, m3
-    pmaddubsw m1, m3
-    psraw     m0, 2
-    psraw     m1, 2
-    pavgw     m0, m4
-    pavgw     m1, m4
-%if mmsize==8
-    packuswb  m0, m0
-    packuswb  m1, m1
-    movh   [dstq+dststrideq*0], m0
-    movh   [dstq+dststrideq*1], m1
-%else
-    packuswb  m0, m1
-    movh   [dstq+dststrideq*0], m0
-    movhps [dstq+dststrideq*1], m0
-%endif
-
-    lea     dstq, [dstq+dststrideq*2]
-    lea     srcq, [srcq+srcstrideq*2]
-    sub  heightd, 2
-    jg .nextrow
-    REP_RET
-
-cglobal put_vp8_bilinear%1_h, 6, 6 + npicregs, 5, dst, dststride, src, srcstride, height, mx, picreg
-    shl      mxd, 4
-%ifdef PIC
-    lea  picregq, [bilinear_filter_vb_m]
-%endif
-    pxor      m4, m4
-    mova      m2, [filter_h2_shuf]
-    mova      m3, [bilinear_filter_vb+mxq-16]
-.nextrow:
-    movu      m0, [srcq+srcstrideq*0]
-    movu      m1, [srcq+srcstrideq*1]
-    pshufb    m0, m2
-    pshufb    m1, m2
-    pmaddubsw m0, m3
-    pmaddubsw m1, m3
-    psraw     m0, 2
-    psraw     m1, 2
-    pavgw     m0, m4
-    pavgw     m1, m4
-%if mmsize==8
-    packuswb  m0, m0
-    packuswb  m1, m1
-    movh   [dstq+dststrideq*0], m0
-    movh   [dstq+dststrideq*1], m1
-%else
-    packuswb  m0, m1
-    movh   [dstq+dststrideq*0], m0
-    movhps [dstq+dststrideq*1], m0
-%endif
-
-    lea     dstq, [dstq+dststrideq*2]
-    lea     srcq, [srcq+srcstrideq*2]
-    sub  heightd, 2
-    jg .nextrow
-    REP_RET
-%endmacro
-
-INIT_MMX ssse3
-FILTER_BILINEAR_SSSE3 4
-INIT_XMM ssse3
-FILTER_BILINEAR_SSSE3 8
-
-INIT_MMX mmx
-cglobal put_vp8_pixels8, 5, 5, 0, dst, dststride, src, srcstride, height
-.nextrow:
-    movq    mm0, [srcq+srcstrideq*0]
-    movq    mm1, [srcq+srcstrideq*1]
-    lea    srcq, [srcq+srcstrideq*2]
-    movq [dstq+dststrideq*0], mm0
-    movq [dstq+dststrideq*1], mm1
-    lea    dstq, [dstq+dststrideq*2]
-    sub heightd, 2
-    jg .nextrow
-    REP_RET
-
-%if ARCH_X86_32
-INIT_MMX mmx
-cglobal put_vp8_pixels16, 5, 5, 0, dst, dststride, src, srcstride, height
-.nextrow:
-    movq    mm0, [srcq+srcstrideq*0+0]
-    movq    mm1, [srcq+srcstrideq*0+8]
-    movq    mm2, [srcq+srcstrideq*1+0]
-    movq    mm3, [srcq+srcstrideq*1+8]
-    lea    srcq, [srcq+srcstrideq*2]
-    movq [dstq+dststrideq*0+0], mm0
-    movq [dstq+dststrideq*0+8], mm1
-    movq [dstq+dststrideq*1+0], mm2
-    movq [dstq+dststrideq*1+8], mm3
-    lea    dstq, [dstq+dststrideq*2]
-    sub heightd, 2
-    jg .nextrow
-    REP_RET
-%endif
-
-INIT_XMM sse
-cglobal put_vp8_pixels16, 5, 5, 2, dst, dststride, src, srcstride, height
-.nextrow:
-    movups xmm0, [srcq+srcstrideq*0]
-    movups xmm1, [srcq+srcstrideq*1]
-    lea    srcq, [srcq+srcstrideq*2]
-    movaps [dstq+dststrideq*0], xmm0
-    movaps [dstq+dststrideq*1], xmm1
-    lea    dstq, [dstq+dststrideq*2]
-    sub heightd, 2
-    jg .nextrow
-    REP_RET
-
-;-----------------------------------------------------------------------------
-; void vp8_idct_dc_add_<opt>(uint8_t *dst, int16_t block[16], int stride);
-;-----------------------------------------------------------------------------
-
-%macro ADD_DC 4
-    %4        m2, [dst1q+%3]
-    %4        m3, [dst1q+strideq+%3]
-    %4        m4, [dst2q+%3]
-    %4        m5, [dst2q+strideq+%3]
-    paddusb   m2, %1
-    paddusb   m3, %1
-    paddusb   m4, %1
-    paddusb   m5, %1
-    psubusb   m2, %2
-    psubusb   m3, %2
-    psubusb   m4, %2
-    psubusb   m5, %2
-    %4 [dst1q+%3], m2
-    %4 [dst1q+strideq+%3], m3
-    %4 [dst2q+%3], m4
-    %4 [dst2q+strideq+%3], m5
-%endmacro
-
-INIT_MMX mmx
-cglobal vp8_idct_dc_add, 3, 3, 0, dst, block, stride
-    ; load data
-    movd       m0, [blockq]
-
-    ; calculate DC
-    paddw      m0, [pw_4]
-    pxor       m1, m1
-    psraw      m0, 3
-    movd [blockq], m1
-    psubw      m1, m0
-    packuswb   m0, m0
-    packuswb   m1, m1
-    punpcklbw  m0, m0
-    punpcklbw  m1, m1
-    punpcklwd  m0, m0
-    punpcklwd  m1, m1
-
-    ; add DC
-    DEFINE_ARGS dst1, dst2, stride
-    lea     dst2q, [dst1q+strideq*2]
-    ADD_DC     m0, m1, 0, movh
-    RET
-
-INIT_XMM sse4
-cglobal vp8_idct_dc_add, 3, 3, 6, dst, block, stride
-    ; load data
-    movd       m0, [blockq]
-    pxor       m1, m1
-
-    ; calculate DC
-    paddw      m0, [pw_4]
-    movd [blockq], m1
-    DEFINE_ARGS dst1, dst2, stride
-    lea     dst2q, [dst1q+strideq*2]
-    movd       m2, [dst1q]
-    movd       m3, [dst1q+strideq]
-    movd       m4, [dst2q]
-    movd       m5, [dst2q+strideq]
-    psraw      m0, 3
-    pshuflw    m0, m0, 0
-    punpcklqdq m0, m0
-    punpckldq  m2, m3
-    punpckldq  m4, m5
-    punpcklbw  m2, m1
-    punpcklbw  m4, m1
-    paddw      m2, m0
-    paddw      m4, m0
-    packuswb   m2, m4
-    movd   [dst1q], m2
-    pextrd [dst1q+strideq], m2, 1
-    pextrd [dst2q], m2, 2
-    pextrd [dst2q+strideq], m2, 3
-    RET
-
-;-----------------------------------------------------------------------------
-; void vp8_idct_dc_add4y_<opt>(uint8_t *dst, int16_t block[4][16], int stride);
-;-----------------------------------------------------------------------------
-
-%if ARCH_X86_32
-INIT_MMX mmx
-cglobal vp8_idct_dc_add4y, 3, 3, 0, dst, block, stride
-    ; load data
-    movd      m0, [blockq+32*0] ; A
-    movd      m1, [blockq+32*2] ; C
-    punpcklwd m0, [blockq+32*1] ; A B
-    punpcklwd m1, [blockq+32*3] ; C D
-    punpckldq m0, m1        ; A B C D
-    pxor      m6, m6
-
-    ; calculate DC
-    paddw     m0, [pw_4]
-    movd [blockq+32*0], m6
-    movd [blockq+32*1], m6
-    movd [blockq+32*2], m6
-    movd [blockq+32*3], m6
-    psraw     m0, 3
-    psubw     m6, m0
-    packuswb  m0, m0
-    packuswb  m6, m6
-    punpcklbw m0, m0 ; AABBCCDD
-    punpcklbw m6, m6 ; AABBCCDD
-    movq      m1, m0
-    movq      m7, m6
-    punpcklbw m0, m0 ; AAAABBBB
-    punpckhbw m1, m1 ; CCCCDDDD
-    punpcklbw m6, m6 ; AAAABBBB
-    punpckhbw m7, m7 ; CCCCDDDD
-
-    ; add DC
-    DEFINE_ARGS dst1, dst2, stride
-    lea    dst2q, [dst1q+strideq*2]
-    ADD_DC    m0, m6, 0, mova
-    ADD_DC    m1, m7, 8, mova
-    RET
-%endif
-
-INIT_XMM sse2
-cglobal vp8_idct_dc_add4y, 3, 3, 6, dst, block, stride
-    ; load data
-    movd      m0, [blockq+32*0] ; A
-    movd      m1, [blockq+32*2] ; C
-    punpcklwd m0, [blockq+32*1] ; A B
-    punpcklwd m1, [blockq+32*3] ; C D
-    punpckldq m0, m1        ; A B C D
-    pxor      m1, m1
-
-    ; calculate DC
-    paddw     m0, [pw_4]
-    movd [blockq+32*0], m1
-    movd [blockq+32*1], m1
-    movd [blockq+32*2], m1
-    movd [blockq+32*3], m1
-    psraw     m0, 3
-    psubw     m1, m0
-    packuswb  m0, m0
-    packuswb  m1, m1
-    punpcklbw m0, m0
-    punpcklbw m1, m1
-    punpcklbw m0, m0
-    punpcklbw m1, m1
-
-    ; add DC
-    DEFINE_ARGS dst1, dst2, stride
-    lea    dst2q, [dst1q+strideq*2]
-    ADD_DC    m0, m1, 0, mova
-    RET
-
-;-----------------------------------------------------------------------------
-; void vp8_idct_dc_add4uv_<opt>(uint8_t *dst, int16_t block[4][16], int stride);
-;-----------------------------------------------------------------------------
-
-INIT_MMX mmx
-cglobal vp8_idct_dc_add4uv, 3, 3, 0, dst, block, stride
-    ; load data
-    movd      m0, [blockq+32*0] ; A
-    movd      m1, [blockq+32*2] ; C
-    punpcklwd m0, [blockq+32*1] ; A B
-    punpcklwd m1, [blockq+32*3] ; C D
-    punpckldq m0, m1        ; A B C D
-    pxor      m6, m6
-
-    ; calculate DC
-    paddw     m0, [pw_4]
-    movd [blockq+32*0], m6
-    movd [blockq+32*1], m6
-    movd [blockq+32*2], m6
-    movd [blockq+32*3], m6
-    psraw     m0, 3
-    psubw     m6, m0
-    packuswb  m0, m0
-    packuswb  m6, m6
-    punpcklbw m0, m0 ; AABBCCDD
-    punpcklbw m6, m6 ; AABBCCDD
-    movq      m1, m0
-    movq      m7, m6
-    punpcklbw m0, m0 ; AAAABBBB
-    punpckhbw m1, m1 ; CCCCDDDD
-    punpcklbw m6, m6 ; AAAABBBB
-    punpckhbw m7, m7 ; CCCCDDDD
-
-    ; add DC
-    DEFINE_ARGS dst1, dst2, stride
-    lea    dst2q, [dst1q+strideq*2]
-    ADD_DC    m0, m6, 0, mova
-    lea    dst1q, [dst1q+strideq*4]
-    lea    dst2q, [dst2q+strideq*4]
-    ADD_DC    m1, m7, 0, mova
-    RET
-
-;-----------------------------------------------------------------------------
-; void vp8_idct_add_<opt>(uint8_t *dst, int16_t block[16], int stride);
-;-----------------------------------------------------------------------------
-
-; calculate %1=mul_35468(%1)-mul_20091(%2); %2=mul_20091(%1)+mul_35468(%2)
-;           this macro assumes that m6/m7 have words for 20091/17734 loaded
-%macro VP8_MULTIPLY_SUMSUB 4
-    mova      %3, %1
-    mova      %4, %2
-    pmulhw    %3, m6 ;20091(1)
-    pmulhw    %4, m6 ;20091(2)
-    paddw     %3, %1
-    paddw     %4, %2
-    paddw     %1, %1
-    paddw     %2, %2
-    pmulhw    %1, m7 ;35468(1)
-    pmulhw    %2, m7 ;35468(2)
-    psubw     %1, %4
-    paddw     %2, %3
-%endmacro
-
-; calculate x0=%1+%3; x1=%1-%3
-;           x2=mul_35468(%2)-mul_20091(%4); x3=mul_20091(%2)+mul_35468(%4)
-;           %1=x0+x3 (tmp0); %2=x1+x2 (tmp1); %3=x1-x2 (tmp2); %4=x0-x3 (tmp3)
-;           %5/%6 are temporary registers
-;           we assume m6/m7 have constant words 20091/17734 loaded in them
-%macro VP8_IDCT_TRANSFORM4x4_1D 6
-    SUMSUB_BA         w, %3,  %1,  %5     ;t0, t1
-    VP8_MULTIPLY_SUMSUB m%2, m%4, m%5,m%6 ;t2, t3
-    SUMSUB_BA         w, %4,  %3,  %5     ;tmp0, tmp3
-    SUMSUB_BA         w, %2,  %1,  %5     ;tmp1, tmp2
-    SWAP                 %4,  %1
-    SWAP                 %4,  %3
-%endmacro
-
-%macro VP8_IDCT_ADD 0
-cglobal vp8_idct_add, 3, 3, 0, dst, block, stride
-    ; load block data
-    movq         m0, [blockq+ 0]
-    movq         m1, [blockq+ 8]
-    movq         m2, [blockq+16]
-    movq         m3, [blockq+24]
-    movq         m6, [pw_20091]
-    movq         m7, [pw_17734]
-%if cpuflag(sse)
-    xorps      xmm0, xmm0
-    movaps [blockq+ 0], xmm0
-    movaps [blockq+16], xmm0
-%else
-    pxor         m4, m4
-    movq [blockq+ 0], m4
-    movq [blockq+ 8], m4
-    movq [blockq+16], m4
-    movq [blockq+24], m4
-%endif
-
-    ; actual IDCT
-    VP8_IDCT_TRANSFORM4x4_1D 0, 1, 2, 3, 4, 5
-    TRANSPOSE4x4W            0, 1, 2, 3, 4
-    paddw        m0, [pw_4]
-    VP8_IDCT_TRANSFORM4x4_1D 0, 1, 2, 3, 4, 5
-    TRANSPOSE4x4W            0, 1, 2, 3, 4
-
-    ; store
-    pxor         m4, m4
-    DEFINE_ARGS dst1, dst2, stride
-    lea       dst2q, [dst1q+2*strideq]
-    STORE_DIFFx2 m0, m1, m6, m7, m4, 3, dst1q, strideq
-    STORE_DIFFx2 m2, m3, m6, m7, m4, 3, dst2q, strideq
-
-    RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-VP8_IDCT_ADD
-%endif
-INIT_MMX sse
-VP8_IDCT_ADD
-
-;-----------------------------------------------------------------------------
-; void vp8_luma_dc_wht_mmxext(int16_t block[4][4][16], int16_t dc[16])
-;-----------------------------------------------------------------------------
-
-%macro SCATTER_WHT 3
-    movd dc1d, m%1
-    movd dc2d, m%2
-    mov [blockq+2*16*(0+%3)], dc1w
-    mov [blockq+2*16*(1+%3)], dc2w
-    shr  dc1d, 16
-    shr  dc2d, 16
-    psrlq m%1, 32
-    psrlq m%2, 32
-    mov [blockq+2*16*(4+%3)], dc1w
-    mov [blockq+2*16*(5+%3)], dc2w
-    movd dc1d, m%1
-    movd dc2d, m%2
-    mov [blockq+2*16*(8+%3)], dc1w
-    mov [blockq+2*16*(9+%3)], dc2w
-    shr  dc1d, 16
-    shr  dc2d, 16
-    mov [blockq+2*16*(12+%3)], dc1w
-    mov [blockq+2*16*(13+%3)], dc2w
-%endmacro
-
-%macro HADAMARD4_1D 4
-    SUMSUB_BADC w, %2, %1, %4, %3
-    SUMSUB_BADC w, %4, %2, %3, %1
-    SWAP %1, %4, %3
-%endmacro
-
-%macro VP8_DC_WHT 0
-cglobal vp8_luma_dc_wht, 2, 3, 0, block, dc1, dc2
-    movq          m0, [dc1q]
-    movq          m1, [dc1q+8]
-    movq          m2, [dc1q+16]
-    movq          m3, [dc1q+24]
-%if cpuflag(sse)
-    xorps      xmm0, xmm0
-    movaps [dc1q+ 0], xmm0
-    movaps [dc1q+16], xmm0
-%else
-    pxor         m4, m4
-    movq  [dc1q+ 0], m4
-    movq  [dc1q+ 8], m4
-    movq  [dc1q+16], m4
-    movq  [dc1q+24], m4
-%endif
-    HADAMARD4_1D  0, 1, 2, 3
-    TRANSPOSE4x4W 0, 1, 2, 3, 4
-    paddw         m0, [pw_3]
-    HADAMARD4_1D  0, 1, 2, 3
-    psraw         m0, 3
-    psraw         m1, 3
-    psraw         m2, 3
-    psraw         m3, 3
-    SCATTER_WHT   0, 1, 0
-    SCATTER_WHT   2, 3, 2
-    RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-VP8_DC_WHT
-%endif
-INIT_MMX sse
-VP8_DC_WHT
diff --git a/deps/libav/libavcodec/x86/vp8dsp_init.c b/deps/libav/libavcodec/x86/vp8dsp_init.c
deleted file mode 100644
index 69460aa..0000000
--- a/deps/libav/libavcodec/x86/vp8dsp_init.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * VP8 DSP functions x86-optimized
- * Copyright (c) 2010 Ronald S. Bultje <rsbultje at gmail.com>
- * Copyright (c) 2010 Jason Garrett-Glaser <darkshikari at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/vp8dsp.h"
-
-#if HAVE_YASM
-
-/*
- * MC functions
- */
-void ff_put_vp8_epel4_h4_mmxext(uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel4_h6_mmxext(uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel4_v4_mmxext(uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel4_v6_mmxext(uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-
-void ff_put_vp8_epel8_h4_sse2  (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel8_h6_sse2  (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel8_v4_sse2  (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel8_v6_sse2  (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-
-void ff_put_vp8_epel4_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel4_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel4_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel4_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel8_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel8_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel8_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-void ff_put_vp8_epel8_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                uint8_t *src, ptrdiff_t srcstride,
-                                int height, int mx, int my);
-
-void ff_put_vp8_bilinear4_h_mmxext(uint8_t *dst, ptrdiff_t dststride,
-                                   uint8_t *src, ptrdiff_t srcstride,
-                                   int height, int mx, int my);
-void ff_put_vp8_bilinear8_h_sse2  (uint8_t *dst, ptrdiff_t dststride,
-                                   uint8_t *src, ptrdiff_t srcstride,
-                                   int height, int mx, int my);
-void ff_put_vp8_bilinear4_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                   uint8_t *src, ptrdiff_t srcstride,
-                                   int height, int mx, int my);
-void ff_put_vp8_bilinear8_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                   uint8_t *src, ptrdiff_t srcstride,
-                                   int height, int mx, int my);
-
-void ff_put_vp8_bilinear4_v_mmxext(uint8_t *dst, ptrdiff_t dststride,
-                                   uint8_t *src, ptrdiff_t srcstride,
-                                   int height, int mx, int my);
-void ff_put_vp8_bilinear8_v_sse2  (uint8_t *dst, ptrdiff_t dststride,
-                                   uint8_t *src, ptrdiff_t srcstride,
-                                   int height, int mx, int my);
-void ff_put_vp8_bilinear4_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                   uint8_t *src, ptrdiff_t srcstride,
-                                   int height, int mx, int my);
-void ff_put_vp8_bilinear8_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
-                                   uint8_t *src, ptrdiff_t srcstride,
-                                   int height, int mx, int my);
-
-
-void ff_put_vp8_pixels8_mmx (uint8_t *dst, ptrdiff_t dststride,
-                             uint8_t *src, ptrdiff_t srcstride,
-                             int height, int mx, int my);
-void ff_put_vp8_pixels16_mmx(uint8_t *dst, ptrdiff_t dststride,
-                             uint8_t *src, ptrdiff_t srcstride,
-                             int height, int mx, int my);
-void ff_put_vp8_pixels16_sse(uint8_t *dst, ptrdiff_t dststride,
-                             uint8_t *src, ptrdiff_t srcstride,
-                             int height, int mx, int my);
-
-#define TAP_W16(OPT, FILTERTYPE, TAPTYPE) \
-static void ff_put_vp8_ ## FILTERTYPE ## 16_ ## TAPTYPE ## _ ## OPT( \
-    uint8_t *dst,  ptrdiff_t dststride, uint8_t *src, \
-    ptrdiff_t srcstride, int height, int mx, int my) \
-{ \
-    ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
-        dst,     dststride, src,     srcstride, height, mx, my); \
-    ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
-        dst + 8, dststride, src + 8, srcstride, height, mx, my); \
-}
-#define TAP_W8(OPT, FILTERTYPE, TAPTYPE) \
-static void ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
-    uint8_t *dst,  ptrdiff_t dststride, uint8_t *src, \
-    ptrdiff_t srcstride, int height, int mx, int my) \
-{ \
-    ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
-        dst,     dststride, src,     srcstride, height, mx, my); \
-    ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
-        dst + 4, dststride, src + 4, srcstride, height, mx, my); \
-}
-
-#if ARCH_X86_32
-TAP_W8 (mmxext, epel, h4)
-TAP_W8 (mmxext, epel, h6)
-TAP_W16(mmxext, epel, h6)
-TAP_W8 (mmxext, epel, v4)
-TAP_W8 (mmxext, epel, v6)
-TAP_W16(mmxext, epel, v6)
-TAP_W8 (mmxext, bilinear, h)
-TAP_W16(mmxext, bilinear, h)
-TAP_W8 (mmxext, bilinear, v)
-TAP_W16(mmxext, bilinear, v)
-#endif
-
-TAP_W16(sse2,  epel, h6)
-TAP_W16(sse2,  epel, v6)
-TAP_W16(sse2,  bilinear, h)
-TAP_W16(sse2,  bilinear, v)
-
-TAP_W16(ssse3, epel, h6)
-TAP_W16(ssse3, epel, v6)
-TAP_W16(ssse3, bilinear, h)
-TAP_W16(ssse3, bilinear, v)
-
-#define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \
-static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \
-    uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
-    ptrdiff_t srcstride, int height, int mx, int my) \
-{ \
-    DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + TAPNUMY - 1)]; \
-    uint8_t *tmpptr = tmp + SIZE * (TAPNUMY / 2 - 1); \
-    src -= srcstride * (TAPNUMY / 2 - 1); \
-    ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## _ ## OPT( \
-        tmp, SIZE,      src,    srcstride, height + TAPNUMY - 1, mx, my); \
-    ff_put_vp8_epel ## SIZE ## _v ## TAPNUMY ## _ ## OPT( \
-        dst, dststride, tmpptr, SIZE,      height,               mx, my); \
-}
-
-#if ARCH_X86_32
-#define HVTAPMMX(x, y) \
-HVTAP(mmxext, 8, x, y,  4,  8) \
-HVTAP(mmxext, 8, x, y,  8, 16)
-
-HVTAP(mmxext, 8, 6, 6, 16, 16)
-#else
-#define HVTAPMMX(x, y) \
-HVTAP(mmxext, 8, x, y,  4,  8)
-#endif
-
-HVTAPMMX(4, 4)
-HVTAPMMX(4, 6)
-HVTAPMMX(6, 4)
-HVTAPMMX(6, 6)
-
-#define HVTAPSSE2(x, y, w) \
-HVTAP(sse2,  16, x, y, w, 16) \
-HVTAP(ssse3, 16, x, y, w, 16)
-
-HVTAPSSE2(4, 4, 8)
-HVTAPSSE2(4, 6, 8)
-HVTAPSSE2(6, 4, 8)
-HVTAPSSE2(6, 6, 8)
-HVTAPSSE2(6, 6, 16)
-
-HVTAP(ssse3, 16, 4, 4, 4, 8)
-HVTAP(ssse3, 16, 4, 6, 4, 8)
-HVTAP(ssse3, 16, 6, 4, 4, 8)
-HVTAP(ssse3, 16, 6, 6, 4, 8)
-
-#define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \
-static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \
-    uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
-    ptrdiff_t srcstride, int height, int mx, int my) \
-{ \
-    DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + 2)]; \
-    ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT( \
-        tmp, SIZE,      src, srcstride, height + 1, mx, my); \
-    ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT( \
-        dst, dststride, tmp, SIZE,      height,     mx, my); \
-}
-
-HVBILIN(mmxext,  8,  4,  8)
-#if ARCH_X86_32
-HVBILIN(mmxext,  8,  8, 16)
-HVBILIN(mmxext,  8, 16, 16)
-#endif
-HVBILIN(sse2,  8,  8, 16)
-HVBILIN(sse2,  8, 16, 16)
-HVBILIN(ssse3, 8,  4,  8)
-HVBILIN(ssse3, 8,  8, 16)
-HVBILIN(ssse3, 8, 16, 16)
-
-void ff_vp8_idct_dc_add_mmx(uint8_t *dst, int16_t block[16],
-                            ptrdiff_t stride);
-void ff_vp8_idct_dc_add_sse4(uint8_t *dst, int16_t block[16],
-                             ptrdiff_t stride);
-void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, int16_t block[4][16],
-                               ptrdiff_t stride);
-void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, int16_t block[4][16],
-                               ptrdiff_t stride);
-void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, int16_t block[2][16],
-                               ptrdiff_t stride);
-void ff_vp8_luma_dc_wht_mmx(int16_t block[4][4][16], int16_t dc[16]);
-void ff_vp8_luma_dc_wht_sse(int16_t block[4][4][16], int16_t dc[16]);
-void ff_vp8_idct_add_mmx(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
-void ff_vp8_idct_add_sse(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
-
-#define DECLARE_LOOP_FILTER(NAME)                                       \
-void ff_vp8_v_loop_filter_simple_ ## NAME(uint8_t *dst,                 \
-                                          ptrdiff_t stride,             \
-                                          int flim);                    \
-void ff_vp8_h_loop_filter_simple_ ## NAME(uint8_t *dst,                 \
-                                          ptrdiff_t stride,             \
-                                          int flim);                    \
-void ff_vp8_v_loop_filter16y_inner_ ## NAME (uint8_t *dst,              \
-                                             ptrdiff_t stride,          \
-                                             int e, int i, int hvt);    \
-void ff_vp8_h_loop_filter16y_inner_ ## NAME (uint8_t *dst,              \
-                                             ptrdiff_t stride,          \
-                                             int e, int i, int hvt);    \
-void ff_vp8_v_loop_filter8uv_inner_ ## NAME (uint8_t *dstU,             \
-                                             uint8_t *dstV,             \
-                                             ptrdiff_t s,               \
-                                             int e, int i, int hvt);    \
-void ff_vp8_h_loop_filter8uv_inner_ ## NAME (uint8_t *dstU,             \
-                                             uint8_t *dstV,             \
-                                             ptrdiff_t s,               \
-                                             int e, int i, int hvt);    \
-void ff_vp8_v_loop_filter16y_mbedge_ ## NAME(uint8_t *dst,              \
-                                             ptrdiff_t stride,          \
-                                             int e, int i, int hvt);    \
-void ff_vp8_h_loop_filter16y_mbedge_ ## NAME(uint8_t *dst,              \
-                                             ptrdiff_t stride,          \
-                                             int e, int i, int hvt);    \
-void ff_vp8_v_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU,             \
-                                             uint8_t *dstV,             \
-                                             ptrdiff_t s,               \
-                                             int e, int i, int hvt);    \
-void ff_vp8_h_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU,             \
-                                             uint8_t *dstV,             \
-                                             ptrdiff_t s,               \
-                                             int e, int i, int hvt);
-
-DECLARE_LOOP_FILTER(mmx)
-DECLARE_LOOP_FILTER(mmxext)
-DECLARE_LOOP_FILTER(sse2)
-DECLARE_LOOP_FILTER(ssse3)
-DECLARE_LOOP_FILTER(sse4)
-
-#endif /* HAVE_YASM */
-
-#define VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) \
-    c->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel ## SIZE ## _h6_ ## OPT; \
-    c->put_vp8_epel_pixels_tab[IDX][2][0] = ff_put_vp8_epel ## SIZE ## _v6_ ## OPT; \
-    c->put_vp8_epel_pixels_tab[IDX][2][2] = ff_put_vp8_epel ## SIZE ## _h6v6_ ## OPT
-
-#define VP8_MC_FUNC(IDX, SIZE, OPT) \
-    c->put_vp8_epel_pixels_tab[IDX][0][1] = ff_put_vp8_epel ## SIZE ## _h4_ ## OPT; \
-    c->put_vp8_epel_pixels_tab[IDX][1][0] = ff_put_vp8_epel ## SIZE ## _v4_ ## OPT; \
-    c->put_vp8_epel_pixels_tab[IDX][1][1] = ff_put_vp8_epel ## SIZE ## _h4v4_ ## OPT; \
-    c->put_vp8_epel_pixels_tab[IDX][1][2] = ff_put_vp8_epel ## SIZE ## _h6v4_ ## OPT; \
-    c->put_vp8_epel_pixels_tab[IDX][2][1] = ff_put_vp8_epel ## SIZE ## _h4v6_ ## OPT; \
-    VP8_LUMA_MC_FUNC(IDX, SIZE, OPT)
-
-#define VP8_BILINEAR_MC_FUNC(IDX, SIZE, OPT) \
-    c->put_vp8_bilinear_pixels_tab[IDX][0][1] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
-    c->put_vp8_bilinear_pixels_tab[IDX][0][2] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
-    c->put_vp8_bilinear_pixels_tab[IDX][1][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
-    c->put_vp8_bilinear_pixels_tab[IDX][1][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
-    c->put_vp8_bilinear_pixels_tab[IDX][1][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
-    c->put_vp8_bilinear_pixels_tab[IDX][2][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
-    c->put_vp8_bilinear_pixels_tab[IDX][2][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
-    c->put_vp8_bilinear_pixels_tab[IDX][2][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT
-
-
-av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
-{
-#if HAVE_YASM
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->vp8_idct_dc_add    = ff_vp8_idct_dc_add_mmx;
-        c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx;
-#if ARCH_X86_32
-        c->vp8_idct_dc_add4y  = ff_vp8_idct_dc_add4y_mmx;
-        c->vp8_idct_add       = ff_vp8_idct_add_mmx;
-        c->vp8_luma_dc_wht    = ff_vp8_luma_dc_wht_mmx;
-        c->put_vp8_epel_pixels_tab[0][0][0]     =
-        c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmx;
-#endif
-        c->put_vp8_epel_pixels_tab[1][0][0]     =
-        c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmx;
-
-#if ARCH_X86_32
-        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx;
-        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx;
-
-        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx;
-        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx;
-        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx;
-        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx;
-
-        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_mmx;
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_mmx;
-        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_mmx;
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_mmx;
-#endif
-    }
-
-    /* note that 4-tap width=16 functions are missing because w=16
-     * is only used for luma, and luma is always a copy or sixtap. */
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        VP8_MC_FUNC(2, 4, mmxext);
-        VP8_BILINEAR_MC_FUNC(2, 4, mmxext);
-#if ARCH_X86_32
-        VP8_LUMA_MC_FUNC(0, 16, mmxext);
-        VP8_MC_FUNC(1, 8, mmxext);
-        VP8_BILINEAR_MC_FUNC(0, 16, mmxext);
-        VP8_BILINEAR_MC_FUNC(1,  8, mmxext);
-
-        c->vp8_v_loop_filter_simple   = ff_vp8_v_loop_filter_simple_mmxext;
-        c->vp8_h_loop_filter_simple   = ff_vp8_h_loop_filter_simple_mmxext;
-
-        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmxext;
-        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmxext;
-        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmxext;
-        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmxext;
-
-        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_mmxext;
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_mmxext;
-        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_mmxext;
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_mmxext;
-#endif
-    }
-
-    if (EXTERNAL_SSE(cpu_flags)) {
-        c->vp8_idct_add                         = ff_vp8_idct_add_sse;
-        c->vp8_luma_dc_wht                      = ff_vp8_luma_dc_wht_sse;
-        c->put_vp8_epel_pixels_tab[0][0][0]     =
-        c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
-    }
-
-    if (EXTERNAL_SSE2(cpu_flags) && (cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
-        VP8_LUMA_MC_FUNC(0, 16, sse2);
-        VP8_MC_FUNC(1, 8, sse2);
-        VP8_BILINEAR_MC_FUNC(0, 16, sse2);
-        VP8_BILINEAR_MC_FUNC(1, 8, sse2);
-
-        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2;
-
-        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;
-        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_sse2;
-
-        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_sse2;
-        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_sse2;
-    }
-
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        c->vp8_idct_dc_add4y          = ff_vp8_idct_dc_add4y_sse2;
-
-        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
-
-        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2;
-        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2;
-
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_sse2;
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_sse2;
-    }
-
-    if (EXTERNAL_SSSE3(cpu_flags)) {
-        VP8_LUMA_MC_FUNC(0, 16, ssse3);
-        VP8_MC_FUNC(1, 8, ssse3);
-        VP8_MC_FUNC(2, 4, ssse3);
-        VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
-        VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
-        VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
-
-        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3;
-        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3;
-
-        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_ssse3;
-        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_ssse3;
-        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_ssse3;
-        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_ssse3;
-
-        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_ssse3;
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_ssse3;
-        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_ssse3;
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_ssse3;
-    }
-
-    if (EXTERNAL_SSE4(cpu_flags)) {
-        c->vp8_idct_dc_add                  = ff_vp8_idct_dc_add_sse4;
-
-        c->vp8_h_loop_filter_simple   = ff_vp8_h_loop_filter_simple_sse4;
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_sse4;
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_sse4;
-    }
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavcodec/x86/vp8dsp_loopfilter.asm b/deps/libav/libavcodec/x86/vp8dsp_loopfilter.asm
deleted file mode 100644
index cbad085..0000000
--- a/deps/libav/libavcodec/x86/vp8dsp_loopfilter.asm
+++ /dev/null
@@ -1,1584 +0,0 @@
-;******************************************************************************
-;* VP8 MMXEXT optimizations
-;* Copyright (c) 2010 Ronald S. Bultje <rsbultje at gmail.com>
-;* Copyright (c) 2010 Jason Garrett-Glaser <darkshikari at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-pw_27:    times 8 dw 27
-pw_63:    times 8 dw 63
-
-pb_4:     times 16 db 4
-pb_F8:    times 16 db 0xF8
-pb_FE:    times 16 db 0xFE
-pb_27_63: times 8 db 27, 63
-pb_18_63: times 8 db 18, 63
-pb_9_63:  times 8 db  9, 63
-
-cextern pb_1
-cextern pb_3
-cextern pw_9
-cextern pw_18
-cextern pb_80
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; void vp8_h/v_loop_filter_simple_<opt>(uint8_t *dst, int stride, int flim);
-;-----------------------------------------------------------------------------
-
-; macro called with 7 mm register indexes as argument, and 4 regular registers
-;
-; first 4 mm registers will carry the transposed pixel data
-; the other three are scratchspace (one would be sufficient, but this allows
-; for more spreading/pipelining and thus faster execution on OOE CPUs)
-;
-; first two regular registers are buf+4*stride and buf+5*stride
-; third is -stride, fourth is +stride
-%macro READ_8x4_INTERLEAVED 11
-    ; interleave 8 (A-H) rows of 4 pixels each
-    movd          m%1, [%8+%10*4]   ; A0-3
-    movd          m%5, [%9+%10*4]   ; B0-3
-    movd          m%2, [%8+%10*2]   ; C0-3
-    movd          m%6, [%8+%10]     ; D0-3
-    movd          m%3, [%8]         ; E0-3
-    movd          m%7, [%9]         ; F0-3
-    movd          m%4, [%9+%11]     ; G0-3
-    punpcklbw     m%1, m%5          ; A/B interleaved
-    movd          m%5, [%9+%11*2]   ; H0-3
-    punpcklbw     m%2, m%6          ; C/D interleaved
-    punpcklbw     m%3, m%7          ; E/F interleaved
-    punpcklbw     m%4, m%5          ; G/H interleaved
-%endmacro
-
-; macro called with 7 mm register indexes as argument, and 5 regular registers
-; first 11 mean the same as READ_8x4_TRANSPOSED above
-; fifth regular register is scratchspace to reach the bottom 8 rows, it
-; will be set to second regular register + 8*stride at the end
-%macro READ_16x4_INTERLEAVED 12
-    ; transpose 16 (A-P) rows of 4 pixels each
-    lea           %12, [r0+8*r2]
-
-    ; read (and interleave) those addressable by %8 (=r0), A/C/D/E/I/K/L/M
-    movd          m%1, [%8+%10*4]   ; A0-3
-    movd          m%3, [%12+%10*4]  ; I0-3
-    movd          m%2, [%8+%10*2]   ; C0-3
-    movd          m%4, [%12+%10*2]  ; K0-3
-    movd          m%6, [%8+%10]     ; D0-3
-    movd          m%5, [%12+%10]    ; L0-3
-    movd          m%7, [%12]        ; M0-3
-    add           %12, %11
-    punpcklbw     m%1, m%3          ; A/I
-    movd          m%3, [%8]         ; E0-3
-    punpcklbw     m%2, m%4          ; C/K
-    punpcklbw     m%6, m%5          ; D/L
-    punpcklbw     m%3, m%7          ; E/M
-    punpcklbw     m%2, m%6          ; C/D/K/L interleaved
-
-    ; read (and interleave) those addressable by %9 (=r4), B/F/G/H/J/N/O/P
-    movd         m%5, [%9+%10*4]   ; B0-3
-    movd         m%4, [%12+%10*4]  ; J0-3
-    movd         m%7, [%9]         ; F0-3
-    movd         m%6, [%12]        ; N0-3
-    punpcklbw    m%5, m%4          ; B/J
-    punpcklbw    m%7, m%6          ; F/N
-    punpcklbw    m%1, m%5          ; A/B/I/J interleaved
-    punpcklbw    m%3, m%7          ; E/F/M/N interleaved
-    movd         m%4, [%9+%11]     ; G0-3
-    movd         m%6, [%12+%11]    ; O0-3
-    movd         m%5, [%9+%11*2]   ; H0-3
-    movd         m%7, [%12+%11*2]  ; P0-3
-    punpcklbw    m%4, m%6          ; G/O
-    punpcklbw    m%5, m%7          ; H/P
-    punpcklbw    m%4, m%5          ; G/H/O/P interleaved
-%endmacro
-
-; write 4 mm registers of 2 dwords each
-; first four arguments are mm register indexes containing source data
-; last four are registers containing buf+4*stride, buf+5*stride,
-; -stride and +stride
-%macro WRITE_4x2D 8
-    ; write out (2 dwords per register)
-    movd    [%5+%7*4], m%1
-    movd    [%5+%7*2], m%2
-    movd         [%5], m%3
-    movd      [%6+%8], m%4
-    punpckhdq     m%1, m%1
-    punpckhdq     m%2, m%2
-    punpckhdq     m%3, m%3
-    punpckhdq     m%4, m%4
-    movd    [%6+%7*4], m%1
-    movd      [%5+%7], m%2
-    movd         [%6], m%3
-    movd    [%6+%8*2], m%4
-%endmacro
-
-; write 4 xmm registers of 4 dwords each
-; arguments same as WRITE_2x4D, but with an extra register, so that the 5 regular
-; registers contain buf+4*stride, buf+5*stride, buf+12*stride, -stride and +stride
-; we add 1*stride to the third regular registry in the process
-; the 10th argument is 16 if it's a Y filter (i.e. all regular registers cover the
-; same memory region), or 8 if they cover two separate buffers (third one points to
-; a different memory region than the first two), allowing for more optimal code for
-; the 16-width case
-%macro WRITE_4x4D 10
-    ; write out (4 dwords per register), start with dwords zero
-    movd    [%5+%8*4], m%1
-    movd         [%5], m%2
-    movd    [%7+%8*4], m%3
-    movd         [%7], m%4
-
-    ; store dwords 1
-    psrldq        m%1, 4
-    psrldq        m%2, 4
-    psrldq        m%3, 4
-    psrldq        m%4, 4
-    movd    [%6+%8*4], m%1
-    movd         [%6], m%2
-%if %10 == 16
-    movd    [%6+%9*4], m%3
-%endif
-    movd      [%7+%9], m%4
-
-    ; write dwords 2
-    psrldq        m%1, 4
-    psrldq        m%2, 4
-%if %10 == 8
-    movd    [%5+%8*2], m%1
-    movd          %5d, m%3
-%endif
-    psrldq        m%3, 4
-    psrldq        m%4, 4
-%if %10 == 16
-    movd    [%5+%8*2], m%1
-%endif
-    movd      [%6+%9], m%2
-    movd    [%7+%8*2], m%3
-    movd    [%7+%9*2], m%4
-    add            %7, %9
-
-    ; store dwords 3
-    psrldq        m%1, 4
-    psrldq        m%2, 4
-    psrldq        m%3, 4
-    psrldq        m%4, 4
-%if %10 == 8
-    mov     [%7+%8*4], %5d
-    movd    [%6+%8*2], m%1
-%else
-    movd      [%5+%8], m%1
-%endif
-    movd    [%6+%9*2], m%2
-    movd    [%7+%8*2], m%3
-    movd    [%7+%9*2], m%4
-%endmacro
-
-; write 4 or 8 words in the mmx/xmm registers as 8 lines
-; 1 and 2 are the registers to write, this can be the same (for SSE2)
-; for pre-SSE4:
-; 3 is a general-purpose register that we will clobber
-; for SSE4:
-; 3 is a pointer to the destination's 5th line
-; 4 is a pointer to the destination's 4th line
-; 5/6 is -stride and +stride
-%macro WRITE_2x4W 6
-    movd            %3d, %1
-    punpckhdq        %1, %1
-    mov       [%4+%5*4], %3w
-    shr              %3, 16
-    add              %4, %6
-    mov       [%4+%5*4], %3w
-
-    movd            %3d, %1
-    add              %4, %5
-    mov       [%4+%5*2], %3w
-    shr              %3, 16
-    mov       [%4+%5  ], %3w
-
-    movd            %3d, %2
-    punpckhdq        %2, %2
-    mov       [%4     ], %3w
-    shr              %3, 16
-    mov       [%4+%6  ], %3w
-
-    movd            %3d, %2
-    add              %4, %6
-    mov       [%4+%6  ], %3w
-    shr              %3, 16
-    mov       [%4+%6*2], %3w
-    add              %4, %5
-%endmacro
-
-%macro WRITE_8W 5
-%if cpuflag(sse4)
-    pextrw    [%3+%4*4], %1, 0
-    pextrw    [%2+%4*4], %1, 1
-    pextrw    [%3+%4*2], %1, 2
-    pextrw    [%3+%4  ], %1, 3
-    pextrw    [%3     ], %1, 4
-    pextrw    [%2     ], %1, 5
-    pextrw    [%2+%5  ], %1, 6
-    pextrw    [%2+%5*2], %1, 7
-%else
-    movd            %2d, %1
-    psrldq           %1, 4
-    mov       [%3+%4*4], %2w
-    shr              %2, 16
-    add              %3, %5
-    mov       [%3+%4*4], %2w
-
-    movd            %2d, %1
-    psrldq           %1, 4
-    add              %3, %4
-    mov       [%3+%4*2], %2w
-    shr              %2, 16
-    mov       [%3+%4  ], %2w
-
-    movd            %2d, %1
-    psrldq           %1, 4
-    mov       [%3     ], %2w
-    shr              %2, 16
-    mov       [%3+%5  ], %2w
-
-    movd            %2d, %1
-    add              %3, %5
-    mov       [%3+%5  ], %2w
-    shr              %2, 16
-    mov       [%3+%5*2], %2w
-%endif
-%endmacro
-
-%macro SIMPLE_LOOPFILTER 2
-cglobal vp8_%1_loop_filter_simple, 3, %2, 8, dst, stride, flim, cntr
-%if mmsize == 8 ; mmx/mmxext
-    mov         cntrq, 2
-%endif
-%if cpuflag(ssse3)
-    pxor           m0, m0
-%endif
-    SPLATB_REG     m7, flim, m0     ; splat "flim" into register
-
-    ; set up indexes to address 4 rows
-%if mmsize == 8
-    DEFINE_ARGS dst1, mstride, stride, cntr, dst2
-%else
-    DEFINE_ARGS dst1, mstride, stride, dst3, dst2
-%endif
-    mov       strideq, mstrideq
-    neg      mstrideq
-%ifidn %1, h
-    lea         dst1q, [dst1q+4*strideq-2]
-%endif
-
-%if mmsize == 8 ; mmx / mmxext
-.next8px:
-%endif
-%ifidn %1, v
-    ; read 4 half/full rows of pixels
-    mova           m0, [dst1q+mstrideq*2]    ; p1
-    mova           m1, [dst1q+mstrideq]      ; p0
-    mova           m2, [dst1q]               ; q0
-    mova           m3, [dst1q+ strideq]      ; q1
-%else ; h
-    lea         dst2q, [dst1q+ strideq]
-
-%if mmsize == 8 ; mmx/mmxext
-    READ_8x4_INTERLEAVED  0, 1, 2, 3, 4, 5, 6, dst1q, dst2q, mstrideq, strideq
-%else ; sse2
-    READ_16x4_INTERLEAVED 0, 1, 2, 3, 4, 5, 6, dst1q, dst2q, mstrideq, strideq, dst3q
-%endif
-    TRANSPOSE4x4W         0, 1, 2, 3, 4
-%endif
-
-    ; simple_limit
-    mova           m5, m2           ; m5=backup of q0
-    mova           m6, m1           ; m6=backup of p0
-    psubusb        m1, m2           ; p0-q0
-    psubusb        m2, m6           ; q0-p0
-    por            m1, m2           ; FFABS(p0-q0)
-    paddusb        m1, m1           ; m1=FFABS(p0-q0)*2
-
-    mova           m4, m3
-    mova           m2, m0
-    psubusb        m3, m0           ; q1-p1
-    psubusb        m0, m4           ; p1-q1
-    por            m3, m0           ; FFABS(p1-q1)
-    mova           m0, [pb_80]
-    pxor           m2, m0
-    pxor           m4, m0
-    psubsb         m2, m4           ; m2=p1-q1 (signed) backup for below
-    pand           m3, [pb_FE]
-    psrlq          m3, 1            ; m3=FFABS(p1-q1)/2, this can be used signed
-    paddusb        m3, m1
-    psubusb        m3, m7
-    pxor           m1, m1
-    pcmpeqb        m3, m1           ; abs(p0-q0)*2+abs(p1-q1)/2<=flim mask(0xff/0x0)
-
-    ; filter_common (use m2/p1-q1, m4=q0, m6=p0, m5/q0-p0 and m3/mask)
-    mova           m4, m5
-    pxor           m5, m0
-    pxor           m0, m6
-    psubsb         m5, m0           ; q0-p0 (signed)
-    paddsb         m2, m5
-    paddsb         m2, m5
-    paddsb         m2, m5           ; a=(p1-q1) + 3*(q0-p0)
-    pand           m2, m3           ; apply filter mask (m3)
-
-    mova           m3, [pb_F8]
-    mova           m1, m2
-    paddsb         m2, [pb_4]       ; f1<<3=a+4
-    paddsb         m1, [pb_3]       ; f2<<3=a+3
-    pand           m2, m3
-    pand           m1, m3           ; cache f2<<3
-
-    pxor           m0, m0
-    pxor           m3, m3
-    pcmpgtb        m0, m2           ; which values are <0?
-    psubb          m3, m2           ; -f1<<3
-    psrlq          m2, 3            ; +f1
-    psrlq          m3, 3            ; -f1
-    pand           m3, m0
-    pandn          m0, m2
-    psubusb        m4, m0
-    paddusb        m4, m3           ; q0-f1
-
-    pxor           m0, m0
-    pxor           m3, m3
-    pcmpgtb        m0, m1           ; which values are <0?
-    psubb          m3, m1           ; -f2<<3
-    psrlq          m1, 3            ; +f2
-    psrlq          m3, 3            ; -f2
-    pand           m3, m0
-    pandn          m0, m1
-    paddusb        m6, m0
-    psubusb        m6, m3           ; p0+f2
-
-    ; store
-%ifidn %1, v
-    mova      [dst1q], m4
-    mova [dst1q+mstrideq], m6
-%else ; h
-    inc        dst1q
-    SBUTTERFLY    bw, 6, 4, 0
-
-%if mmsize == 16 ; sse2
-%if cpuflag(sse4)
-    inc         dst2q
-%endif
-    WRITE_8W       m6, dst2q, dst1q, mstrideq, strideq
-    lea         dst2q, [dst3q+mstrideq+1]
-%if cpuflag(sse4)
-    inc         dst3q
-%endif
-    WRITE_8W       m4, dst3q, dst2q, mstrideq, strideq
-%else ; mmx/mmxext
-    WRITE_2x4W     m6, m4, dst2q, dst1q, mstrideq, strideq
-%endif
-%endif
-
-%if mmsize == 8 ; mmx/mmxext
-    ; next 8 pixels
-%ifidn %1, v
-    add         dst1q, 8            ; advance 8 cols = pixels
-%else ; h
-    lea         dst1q, [dst1q+strideq*8-1]  ; advance 8 rows = lines
-%endif
-    dec         cntrq
-    jg .next8px
-    REP_RET
-%else ; sse2
-    RET
-%endif
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-SIMPLE_LOOPFILTER v, 4
-SIMPLE_LOOPFILTER h, 5
-INIT_MMX mmxext
-SIMPLE_LOOPFILTER v, 4
-SIMPLE_LOOPFILTER h, 5
-%endif
-
-INIT_XMM sse2
-SIMPLE_LOOPFILTER v, 3
-SIMPLE_LOOPFILTER h, 5
-INIT_XMM ssse3
-SIMPLE_LOOPFILTER v, 3
-SIMPLE_LOOPFILTER h, 5
-INIT_XMM sse4
-SIMPLE_LOOPFILTER h, 5
-
-;-----------------------------------------------------------------------------
-; void vp8_h/v_loop_filter<size>_inner_<opt>(uint8_t *dst, [uint8_t *v,] int stride,
-;                                            int flimE, int flimI, int hev_thr);
-;-----------------------------------------------------------------------------
-
-%macro INNER_LOOPFILTER 2
-%define stack_size 0
-%ifndef m8   ; stack layout: [0]=E, [1]=I, [2]=hev_thr
-%ifidn %1, v ;               [3]=hev() result
-%define stack_size mmsize * -4
-%else ; h    ; extra storage space for transposes
-%define stack_size mmsize * -5
-%endif
-%endif
-
-%if %2 == 8 ; chroma
-cglobal vp8_%1_loop_filter8uv_inner, 6, 6, 13, stack_size, dst, dst8, stride, flimE, flimI, hevthr
-%else ; luma
-cglobal vp8_%1_loop_filter16y_inner, 5, 5, 13, stack_size, dst, stride, flimE, flimI, hevthr
-%endif
-
-%if cpuflag(ssse3)
-    pxor             m7, m7
-%endif
-
-%ifndef m8
-    ; splat function arguments
-    SPLATB_REG       m0, flimEq, m7   ; E
-    SPLATB_REG       m1, flimIq, m7   ; I
-    SPLATB_REG       m2, hevthrq, m7  ; hev_thresh
-
-%define m_flimE    [rsp]
-%define m_flimI    [rsp+mmsize]
-%define m_hevthr   [rsp+mmsize*2]
-%define m_maskres  [rsp+mmsize*3]
-%define m_p0backup [rsp+mmsize*3]
-%define m_q0backup [rsp+mmsize*4]
-
-    mova        m_flimE, m0
-    mova        m_flimI, m1
-    mova       m_hevthr, m2
-%else
-%define m_flimE    m9
-%define m_flimI    m10
-%define m_hevthr   m11
-%define m_maskres  m12
-%define m_p0backup m12
-%define m_q0backup m8
-
-    ; splat function arguments
-    SPLATB_REG  m_flimE, flimEq, m7   ; E
-    SPLATB_REG  m_flimI, flimIq, m7   ; I
-    SPLATB_REG m_hevthr, hevthrq, m7  ; hev_thresh
-%endif
-
-%if %2 == 8 ; chroma
-    DEFINE_ARGS dst1, dst8, mstride, stride, dst2
-%elif mmsize == 8
-    DEFINE_ARGS dst1, mstride, stride, dst2, cntr
-    mov           cntrq, 2
-%else
-    DEFINE_ARGS dst1, mstride, stride, dst2, dst8
-%endif
-    mov         strideq, mstrideq
-    neg        mstrideq
-%ifidn %1, h
-    lea           dst1q, [dst1q+strideq*4-4]
-%if %2 == 8 ; chroma
-    lea           dst8q, [dst8q+strideq*4-4]
-%endif
-%endif
-
-%if mmsize == 8
-.next8px:
-%endif
-    ; read
-    lea           dst2q, [dst1q+strideq]
-%ifidn %1, v
-%if %2 == 8 && mmsize == 16
-%define movrow movh
-%else
-%define movrow mova
-%endif
-    movrow           m0, [dst1q+mstrideq*4] ; p3
-    movrow           m1, [dst2q+mstrideq*4] ; p2
-    movrow           m2, [dst1q+mstrideq*2] ; p1
-    movrow           m5, [dst2q]            ; q1
-    movrow           m6, [dst2q+ strideq*1] ; q2
-    movrow           m7, [dst2q+ strideq*2] ; q3
-%if mmsize == 16 && %2 == 8
-    movhps           m0, [dst8q+mstrideq*4]
-    movhps           m2, [dst8q+mstrideq*2]
-    add           dst8q, strideq
-    movhps           m1, [dst8q+mstrideq*4]
-    movhps           m5, [dst8q]
-    movhps           m6, [dst8q+ strideq  ]
-    movhps           m7, [dst8q+ strideq*2]
-    add           dst8q, mstrideq
-%endif
-%elif mmsize == 8 ; mmx/mmxext (h)
-    ; read 8 rows of 8px each
-    movu             m0, [dst1q+mstrideq*4]
-    movu             m1, [dst2q+mstrideq*4]
-    movu             m2, [dst1q+mstrideq*2]
-    movu             m3, [dst1q+mstrideq  ]
-    movu             m4, [dst1q]
-    movu             m5, [dst2q]
-    movu             m6, [dst2q+ strideq  ]
-
-    ; 8x8 transpose
-    TRANSPOSE4x4B     0, 1, 2, 3, 7
-    mova     m_q0backup, m1
-    movu             m7, [dst2q+ strideq*2]
-    TRANSPOSE4x4B     4, 5, 6, 7, 1
-    SBUTTERFLY       dq, 0, 4, 1     ; p3/p2
-    SBUTTERFLY       dq, 2, 6, 1     ; q0/q1
-    SBUTTERFLY       dq, 3, 7, 1     ; q2/q3
-    mova             m1, m_q0backup
-    mova     m_q0backup, m2          ; store q0
-    SBUTTERFLY       dq, 1, 5, 2     ; p1/p0
-    mova     m_p0backup, m5          ; store p0
-    SWAP              1, 4
-    SWAP              2, 4
-    SWAP              6, 3
-    SWAP              5, 3
-%else ; sse2 (h)
-%if %2 == 16
-    lea           dst8q, [dst1q+ strideq*8]
-%endif
-
-    ; read 16 rows of 8px each, interleave
-    movh             m0, [dst1q+mstrideq*4]
-    movh             m1, [dst8q+mstrideq*4]
-    movh             m2, [dst1q+mstrideq*2]
-    movh             m5, [dst8q+mstrideq*2]
-    movh             m3, [dst1q+mstrideq  ]
-    movh             m6, [dst8q+mstrideq  ]
-    movh             m4, [dst1q]
-    movh             m7, [dst8q]
-    punpcklbw        m0, m1          ; A/I
-    punpcklbw        m2, m5          ; C/K
-    punpcklbw        m3, m6          ; D/L
-    punpcklbw        m4, m7          ; E/M
-
-    add           dst8q, strideq
-    movh             m1, [dst2q+mstrideq*4]
-    movh             m6, [dst8q+mstrideq*4]
-    movh             m5, [dst2q]
-    movh             m7, [dst8q]
-    punpcklbw        m1, m6          ; B/J
-    punpcklbw        m5, m7          ; F/N
-    movh             m6, [dst2q+ strideq  ]
-    movh             m7, [dst8q+ strideq  ]
-    punpcklbw        m6, m7          ; G/O
-
-    ; 8x16 transpose
-    TRANSPOSE4x4B     0, 1, 2, 3, 7
-%ifdef m8
-    SWAP              1, 8
-%else
-    mova     m_q0backup, m1
-%endif
-    movh             m7, [dst2q+ strideq*2]
-    movh             m1, [dst8q+ strideq*2]
-    punpcklbw        m7, m1          ; H/P
-    TRANSPOSE4x4B     4, 5, 6, 7, 1
-    SBUTTERFLY       dq, 0, 4, 1     ; p3/p2
-    SBUTTERFLY       dq, 2, 6, 1     ; q0/q1
-    SBUTTERFLY       dq, 3, 7, 1     ; q2/q3
-%ifdef m8
-    SWAP              1, 8
-    SWAP              2, 8
-%else
-    mova             m1, m_q0backup
-    mova     m_q0backup, m2          ; store q0
-%endif
-    SBUTTERFLY       dq, 1, 5, 2     ; p1/p0
-%ifdef m12
-    SWAP              5, 12
-%else
-    mova     m_p0backup, m5          ; store p0
-%endif
-    SWAP              1, 4
-    SWAP              2, 4
-    SWAP              6, 3
-    SWAP              5, 3
-%endif
-
-    ; normal_limit for p3-p2, p2-p1, q3-q2 and q2-q1
-    mova             m4, m1
-    SWAP              4, 1
-    psubusb          m4, m0          ; p2-p3
-    psubusb          m0, m1          ; p3-p2
-    por              m0, m4          ; abs(p3-p2)
-
-    mova             m4, m2
-    SWAP              4, 2
-    psubusb          m4, m1          ; p1-p2
-    psubusb          m1, m2          ; p2-p1
-    por              m1, m4          ; abs(p2-p1)
-
-    mova             m4, m6
-    SWAP              4, 6
-    psubusb          m4, m7          ; q2-q3
-    psubusb          m7, m6          ; q3-q2
-    por              m7, m4          ; abs(q3-q2)
-
-    mova             m4, m5
-    SWAP              4, 5
-    psubusb          m4, m6          ; q1-q2
-    psubusb          m6, m5          ; q2-q1
-    por              m6, m4          ; abs(q2-q1)
-
-%if notcpuflag(mmxext)
-    mova             m4, m_flimI
-    pxor             m3, m3
-    psubusb          m0, m4
-    psubusb          m1, m4
-    psubusb          m7, m4
-    psubusb          m6, m4
-    pcmpeqb          m0, m3          ; abs(p3-p2) <= I
-    pcmpeqb          m1, m3          ; abs(p2-p1) <= I
-    pcmpeqb          m7, m3          ; abs(q3-q2) <= I
-    pcmpeqb          m6, m3          ; abs(q2-q1) <= I
-    pand             m0, m1
-    pand             m7, m6
-    pand             m0, m7
-%else ; mmxext/sse2
-    pmaxub           m0, m1
-    pmaxub           m6, m7
-    pmaxub           m0, m6
-%endif
-
-    ; normal_limit and high_edge_variance for p1-p0, q1-q0
-    SWAP              7, 3           ; now m7 is zero
-%ifidn %1, v
-    movrow           m3, [dst1q+mstrideq  ] ; p0
-%if mmsize == 16 && %2 == 8
-    movhps           m3, [dst8q+mstrideq  ]
-%endif
-%elifdef m12
-    SWAP              3, 12
-%else
-    mova             m3, m_p0backup
-%endif
-
-    mova             m1, m2
-    SWAP              1, 2
-    mova             m6, m3
-    SWAP              3, 6
-    psubusb          m1, m3          ; p1-p0
-    psubusb          m6, m2          ; p0-p1
-    por              m1, m6          ; abs(p1-p0)
-%if notcpuflag(mmxext)
-    mova             m6, m1
-    psubusb          m1, m4
-    psubusb          m6, m_hevthr
-    pcmpeqb          m1, m7          ; abs(p1-p0) <= I
-    pcmpeqb          m6, m7          ; abs(p1-p0) <= hev_thresh
-    pand             m0, m1
-    mova      m_maskres, m6
-%else ; mmxext/sse2
-    pmaxub           m0, m1          ; max_I
-    SWAP              1, 4           ; max_hev_thresh
-%endif
-
-    SWAP              6, 4           ; now m6 is I
-%ifidn %1, v
-    movrow           m4, [dst1q]     ; q0
-%if mmsize == 16 && %2 == 8
-    movhps           m4, [dst8q]
-%endif
-%elifdef m8
-    SWAP              4, 8
-%else
-    mova             m4, m_q0backup
-%endif
-    mova             m1, m4
-    SWAP              1, 4
-    mova             m7, m5
-    SWAP              7, 5
-    psubusb          m1, m5          ; q0-q1
-    psubusb          m7, m4          ; q1-q0
-    por              m1, m7          ; abs(q1-q0)
-%if notcpuflag(mmxext)
-    mova             m7, m1
-    psubusb          m1, m6
-    psubusb          m7, m_hevthr
-    pxor             m6, m6
-    pcmpeqb          m1, m6          ; abs(q1-q0) <= I
-    pcmpeqb          m7, m6          ; abs(q1-q0) <= hev_thresh
-    mova             m6, m_maskres
-    pand             m0, m1          ; abs([pq][321]-[pq][210]) <= I
-    pand             m6, m7
-%else ; mmxext/sse2
-    pxor             m7, m7
-    pmaxub           m0, m1
-    pmaxub           m6, m1
-    psubusb          m0, m_flimI
-    psubusb          m6, m_hevthr
-    pcmpeqb          m0, m7          ; max(abs(..)) <= I
-    pcmpeqb          m6, m7          ; !(max(abs..) > thresh)
-%endif
-%ifdef m12
-    SWAP              6, 12
-%else
-    mova      m_maskres, m6          ; !(abs(p1-p0) > hev_t || abs(q1-q0) > hev_t)
-%endif
-
-    ; simple_limit
-    mova             m1, m3
-    SWAP              1, 3
-    mova             m6, m4          ; keep copies of p0/q0 around for later use
-    SWAP              6, 4
-    psubusb          m1, m4          ; p0-q0
-    psubusb          m6, m3          ; q0-p0
-    por              m1, m6          ; abs(q0-p0)
-    paddusb          m1, m1          ; m1=2*abs(q0-p0)
-
-    mova             m7, m2
-    SWAP              7, 2
-    mova             m6, m5
-    SWAP              6, 5
-    psubusb          m7, m5          ; p1-q1
-    psubusb          m6, m2          ; q1-p1
-    por              m7, m6          ; abs(q1-p1)
-    pxor             m6, m6
-    pand             m7, [pb_FE]
-    psrlq            m7, 1           ; abs(q1-p1)/2
-    paddusb          m7, m1          ; abs(q0-p0)*2+abs(q1-p1)/2
-    psubusb          m7, m_flimE
-    pcmpeqb          m7, m6          ; abs(q0-p0)*2+abs(q1-p1)/2 <= E
-    pand             m0, m7          ; normal_limit result
-
-    ; filter_common; at this point, m2-m5=p1-q1 and m0 is filter_mask
-%ifdef m8 ; x86-64 && sse2
-    mova             m8, [pb_80]
-%define m_pb_80 m8
-%else ; x86-32 or mmx/mmxext
-%define m_pb_80 [pb_80]
-%endif
-    mova             m1, m4
-    mova             m7, m3
-    pxor             m1, m_pb_80
-    pxor             m7, m_pb_80
-    psubsb           m1, m7          ; (signed) q0-p0
-    mova             m6, m2
-    mova             m7, m5
-    pxor             m6, m_pb_80
-    pxor             m7, m_pb_80
-    psubsb           m6, m7          ; (signed) p1-q1
-    mova             m7, m_maskres
-    pandn            m7, m6
-    paddsb           m7, m1
-    paddsb           m7, m1
-    paddsb           m7, m1          ; 3*(q0-p0)+is4tap?(p1-q1)
-
-    pand             m7, m0
-    mova             m1, [pb_F8]
-    mova             m6, m7
-    paddsb           m7, [pb_3]
-    paddsb           m6, [pb_4]
-    pand             m7, m1
-    pand             m6, m1
-
-    pxor             m1, m1
-    pxor             m0, m0
-    pcmpgtb          m1, m7
-    psubb            m0, m7
-    psrlq            m7, 3           ; +f2
-    psrlq            m0, 3           ; -f2
-    pand             m0, m1
-    pandn            m1, m7
-    psubusb          m3, m0
-    paddusb          m3, m1          ; p0+f2
-
-    pxor             m1, m1
-    pxor             m0, m0
-    pcmpgtb          m0, m6
-    psubb            m1, m6
-    psrlq            m6, 3           ; +f1
-    psrlq            m1, 3           ; -f1
-    pand             m1, m0
-    pandn            m0, m6
-    psubusb          m4, m0
-    paddusb          m4, m1          ; q0-f1
-
-%ifdef m12
-    SWAP              6, 12
-%else
-    mova             m6, m_maskres
-%endif
-%if notcpuflag(mmxext)
-    mova             m7, [pb_1]
-%else ; mmxext/sse2
-    pxor             m7, m7
-%endif
-    pand             m0, m6
-    pand             m1, m6
-%if notcpuflag(mmxext)
-    paddusb          m0, m7
-    pand             m1, [pb_FE]
-    pandn            m7, m0
-    psrlq            m1, 1
-    psrlq            m7, 1
-    SWAP              0, 7
-%else ; mmxext/sse2
-    psubusb          m1, [pb_1]
-    pavgb            m0, m7          ; a
-    pavgb            m1, m7          ; -a
-%endif
-    psubusb          m5, m0
-    psubusb          m2, m1
-    paddusb          m5, m1          ; q1-a
-    paddusb          m2, m0          ; p1+a
-
-    ; store
-%ifidn %1, v
-    movrow [dst1q+mstrideq*2], m2
-    movrow [dst1q+mstrideq  ], m3
-    movrow      [dst1q], m4
-    movrow [dst1q+ strideq  ], m5
-%if mmsize == 16 && %2 == 8
-    movhps [dst8q+mstrideq*2], m2
-    movhps [dst8q+mstrideq  ], m3
-    movhps      [dst8q], m4
-    movhps [dst8q+ strideq  ], m5
-%endif
-%else ; h
-    add           dst1q, 2
-    add           dst2q, 2
-
-    ; 4x8/16 transpose
-    TRANSPOSE4x4B     2, 3, 4, 5, 6
-
-%if mmsize == 8 ; mmx/mmxext (h)
-    WRITE_4x2D        2, 3, 4, 5, dst1q, dst2q, mstrideq, strideq
-%else ; sse2 (h)
-    lea           dst8q, [dst8q+mstrideq  +2]
-    WRITE_4x4D        2, 3, 4, 5, dst1q, dst2q, dst8q, mstrideq, strideq, %2
-%endif
-%endif
-
-%if mmsize == 8
-%if %2 == 8 ; chroma
-%ifidn %1, h
-    sub           dst1q, 2
-%endif
-    cmp           dst1q, dst8q
-    mov           dst1q, dst8q
-    jnz .next8px
-%else
-%ifidn %1, h
-    lea           dst1q, [dst1q+ strideq*8-2]
-%else ; v
-    add           dst1q, 8
-%endif
-    dec           cntrq
-    jg .next8px
-%endif
-    REP_RET
-%else ; mmsize == 16
-    RET
-%endif
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-INNER_LOOPFILTER v, 16
-INNER_LOOPFILTER h, 16
-INNER_LOOPFILTER v,  8
-INNER_LOOPFILTER h,  8
-
-INIT_MMX mmxext
-INNER_LOOPFILTER v, 16
-INNER_LOOPFILTER h, 16
-INNER_LOOPFILTER v,  8
-INNER_LOOPFILTER h,  8
-%endif
-
-INIT_XMM sse2
-INNER_LOOPFILTER v, 16
-INNER_LOOPFILTER h, 16
-INNER_LOOPFILTER v,  8
-INNER_LOOPFILTER h,  8
-
-INIT_XMM ssse3
-INNER_LOOPFILTER v, 16
-INNER_LOOPFILTER h, 16
-INNER_LOOPFILTER v,  8
-INNER_LOOPFILTER h,  8
-
-;-----------------------------------------------------------------------------
-; void vp8_h/v_loop_filter<size>_mbedge_<opt>(uint8_t *dst, [uint8_t *v,] int stride,
-;                                            int flimE, int flimI, int hev_thr);
-;-----------------------------------------------------------------------------
-
-%macro MBEDGE_LOOPFILTER 2
-%define stack_size 0
-%ifndef m8       ; stack layout: [0]=E, [1]=I, [2]=hev_thr
-%if mmsize == 16 ;               [3]=hev() result
-                 ;               [4]=filter tmp result
-                 ;               [5]/[6] = p2/q2 backup
-                 ;               [7]=lim_res sign result
-%define stack_size mmsize * -7
-%else ; 8        ; extra storage space for transposes
-%define stack_size mmsize * -8
-%endif
-%endif
-
-%if %2 == 8 ; chroma
-cglobal vp8_%1_loop_filter8uv_mbedge, 6, 6, 15, stack_size, dst1, dst8, stride, flimE, flimI, hevthr
-%else ; luma
-cglobal vp8_%1_loop_filter16y_mbedge, 5, 5, 15, stack_size, dst1, stride, flimE, flimI, hevthr
-%endif
-
-%if cpuflag(ssse3)
-    pxor             m7, m7
-%endif
-
-%ifndef m8
-    ; splat function arguments
-    SPLATB_REG       m0, flimEq, m7   ; E
-    SPLATB_REG       m1, flimIq, m7   ; I
-    SPLATB_REG       m2, hevthrq, m7  ; hev_thresh
-
-%define m_flimE    [rsp]
-%define m_flimI    [rsp+mmsize]
-%define m_hevthr   [rsp+mmsize*2]
-%define m_maskres  [rsp+mmsize*3]
-%define m_limres   [rsp+mmsize*4]
-%define m_p0backup [rsp+mmsize*3]
-%define m_q0backup [rsp+mmsize*4]
-%define m_p2backup [rsp+mmsize*5]
-%define m_q2backup [rsp+mmsize*6]
-%if mmsize == 16
-%define m_limsign  [rsp]
-%else
-%define m_limsign  [rsp+mmsize*7]
-%endif
-
-    mova        m_flimE, m0
-    mova        m_flimI, m1
-    mova       m_hevthr, m2
-%else ; sse2 on x86-64
-%define m_flimE    m9
-%define m_flimI    m10
-%define m_hevthr   m11
-%define m_maskres  m12
-%define m_limres   m8
-%define m_p0backup m12
-%define m_q0backup m8
-%define m_p2backup m13
-%define m_q2backup m14
-%define m_limsign  m9
-
-    ; splat function arguments
-    SPLATB_REG  m_flimE, flimEq, m7   ; E
-    SPLATB_REG  m_flimI, flimIq, m7   ; I
-    SPLATB_REG m_hevthr, hevthrq, m7  ; hev_thresh
-%endif
-
-%if %2 == 8 ; chroma
-    DEFINE_ARGS dst1, dst8, mstride, stride, dst2
-%elif mmsize == 8
-    DEFINE_ARGS dst1, mstride, stride, dst2, cntr
-    mov           cntrq, 2
-%else
-    DEFINE_ARGS dst1, mstride, stride, dst2, dst8
-%endif
-    mov         strideq, mstrideq
-    neg        mstrideq
-%ifidn %1, h
-    lea           dst1q, [dst1q+strideq*4-4]
-%if %2 == 8 ; chroma
-    lea           dst8q, [dst8q+strideq*4-4]
-%endif
-%endif
-
-%if mmsize == 8
-.next8px:
-%endif
-    ; read
-    lea           dst2q, [dst1q+ strideq  ]
-%ifidn %1, v
-%if %2 == 8 && mmsize == 16
-%define movrow movh
-%else
-%define movrow mova
-%endif
-    movrow           m0, [dst1q+mstrideq*4] ; p3
-    movrow           m1, [dst2q+mstrideq*4] ; p2
-    movrow           m2, [dst1q+mstrideq*2] ; p1
-    movrow           m5, [dst2q]            ; q1
-    movrow           m6, [dst2q+ strideq  ] ; q2
-    movrow           m7, [dst2q+ strideq*2] ; q3
-%if mmsize == 16 && %2 == 8
-    movhps           m0, [dst8q+mstrideq*4]
-    movhps           m2, [dst8q+mstrideq*2]
-    add           dst8q, strideq
-    movhps           m1, [dst8q+mstrideq*4]
-    movhps           m5, [dst8q]
-    movhps           m6, [dst8q+ strideq  ]
-    movhps           m7, [dst8q+ strideq*2]
-    add           dst8q, mstrideq
-%endif
-%elif mmsize == 8 ; mmx/mmxext (h)
-    ; read 8 rows of 8px each
-    movu             m0, [dst1q+mstrideq*4]
-    movu             m1, [dst2q+mstrideq*4]
-    movu             m2, [dst1q+mstrideq*2]
-    movu             m3, [dst1q+mstrideq  ]
-    movu             m4, [dst1q]
-    movu             m5, [dst2q]
-    movu             m6, [dst2q+ strideq  ]
-
-    ; 8x8 transpose
-    TRANSPOSE4x4B     0, 1, 2, 3, 7
-    mova     m_q0backup, m1
-    movu             m7, [dst2q+ strideq*2]
-    TRANSPOSE4x4B     4, 5, 6, 7, 1
-    SBUTTERFLY       dq, 0, 4, 1     ; p3/p2
-    SBUTTERFLY       dq, 2, 6, 1     ; q0/q1
-    SBUTTERFLY       dq, 3, 7, 1     ; q2/q3
-    mova             m1, m_q0backup
-    mova     m_q0backup, m2          ; store q0
-    SBUTTERFLY       dq, 1, 5, 2     ; p1/p0
-    mova     m_p0backup, m5          ; store p0
-    SWAP              1, 4
-    SWAP              2, 4
-    SWAP              6, 3
-    SWAP              5, 3
-%else ; sse2 (h)
-%if %2 == 16
-    lea           dst8q, [dst1q+ strideq*8  ]
-%endif
-
-    ; read 16 rows of 8px each, interleave
-    movh             m0, [dst1q+mstrideq*4]
-    movh             m1, [dst8q+mstrideq*4]
-    movh             m2, [dst1q+mstrideq*2]
-    movh             m5, [dst8q+mstrideq*2]
-    movh             m3, [dst1q+mstrideq  ]
-    movh             m6, [dst8q+mstrideq  ]
-    movh             m4, [dst1q]
-    movh             m7, [dst8q]
-    punpcklbw        m0, m1          ; A/I
-    punpcklbw        m2, m5          ; C/K
-    punpcklbw        m3, m6          ; D/L
-    punpcklbw        m4, m7          ; E/M
-
-    add           dst8q, strideq
-    movh             m1, [dst2q+mstrideq*4]
-    movh             m6, [dst8q+mstrideq*4]
-    movh             m5, [dst2q]
-    movh             m7, [dst8q]
-    punpcklbw        m1, m6          ; B/J
-    punpcklbw        m5, m7          ; F/N
-    movh             m6, [dst2q+ strideq  ]
-    movh             m7, [dst8q+ strideq  ]
-    punpcklbw        m6, m7          ; G/O
-
-    ; 8x16 transpose
-    TRANSPOSE4x4B     0, 1, 2, 3, 7
-%ifdef m8
-    SWAP              1, 8
-%else
-    mova     m_q0backup, m1
-%endif
-    movh             m7, [dst2q+ strideq*2]
-    movh             m1, [dst8q+ strideq*2]
-    punpcklbw        m7, m1          ; H/P
-    TRANSPOSE4x4B     4, 5, 6, 7, 1
-    SBUTTERFLY       dq, 0, 4, 1     ; p3/p2
-    SBUTTERFLY       dq, 2, 6, 1     ; q0/q1
-    SBUTTERFLY       dq, 3, 7, 1     ; q2/q3
-%ifdef m8
-    SWAP              1, 8
-    SWAP              2, 8
-%else
-    mova             m1, m_q0backup
-    mova     m_q0backup, m2          ; store q0
-%endif
-    SBUTTERFLY       dq, 1, 5, 2     ; p1/p0
-%ifdef m12
-    SWAP              5, 12
-%else
-    mova     m_p0backup, m5          ; store p0
-%endif
-    SWAP              1, 4
-    SWAP              2, 4
-    SWAP              6, 3
-    SWAP              5, 3
-%endif
-
-    ; normal_limit for p3-p2, p2-p1, q3-q2 and q2-q1
-    mova             m4, m1
-    SWAP              4, 1
-    psubusb          m4, m0          ; p2-p3
-    psubusb          m0, m1          ; p3-p2
-    por              m0, m4          ; abs(p3-p2)
-
-    mova             m4, m2
-    SWAP              4, 2
-    psubusb          m4, m1          ; p1-p2
-    mova     m_p2backup, m1
-    psubusb          m1, m2          ; p2-p1
-    por              m1, m4          ; abs(p2-p1)
-
-    mova             m4, m6
-    SWAP              4, 6
-    psubusb          m4, m7          ; q2-q3
-    psubusb          m7, m6          ; q3-q2
-    por              m7, m4          ; abs(q3-q2)
-
-    mova             m4, m5
-    SWAP              4, 5
-    psubusb          m4, m6          ; q1-q2
-    mova     m_q2backup, m6
-    psubusb          m6, m5          ; q2-q1
-    por              m6, m4          ; abs(q2-q1)
-
-%if notcpuflag(mmxext)
-    mova             m4, m_flimI
-    pxor             m3, m3
-    psubusb          m0, m4
-    psubusb          m1, m4
-    psubusb          m7, m4
-    psubusb          m6, m4
-    pcmpeqb          m0, m3          ; abs(p3-p2) <= I
-    pcmpeqb          m1, m3          ; abs(p2-p1) <= I
-    pcmpeqb          m7, m3          ; abs(q3-q2) <= I
-    pcmpeqb          m6, m3          ; abs(q2-q1) <= I
-    pand             m0, m1
-    pand             m7, m6
-    pand             m0, m7
-%else ; mmxext/sse2
-    pmaxub           m0, m1
-    pmaxub           m6, m7
-    pmaxub           m0, m6
-%endif
-
-    ; normal_limit and high_edge_variance for p1-p0, q1-q0
-    SWAP              7, 3           ; now m7 is zero
-%ifidn %1, v
-    movrow           m3, [dst1q+mstrideq  ] ; p0
-%if mmsize == 16 && %2 == 8
-    movhps           m3, [dst8q+mstrideq  ]
-%endif
-%elifdef m12
-    SWAP              3, 12
-%else
-    mova             m3, m_p0backup
-%endif
-
-    mova             m1, m2
-    SWAP              1, 2
-    mova             m6, m3
-    SWAP              3, 6
-    psubusb          m1, m3          ; p1-p0
-    psubusb          m6, m2          ; p0-p1
-    por              m1, m6          ; abs(p1-p0)
-%if notcpuflag(mmxext)
-    mova             m6, m1
-    psubusb          m1, m4
-    psubusb          m6, m_hevthr
-    pcmpeqb          m1, m7          ; abs(p1-p0) <= I
-    pcmpeqb          m6, m7          ; abs(p1-p0) <= hev_thresh
-    pand             m0, m1
-    mova      m_maskres, m6
-%else ; mmxext/sse2
-    pmaxub           m0, m1          ; max_I
-    SWAP              1, 4           ; max_hev_thresh
-%endif
-
-    SWAP              6, 4           ; now m6 is I
-%ifidn %1, v
-    movrow           m4, [dst1q]     ; q0
-%if mmsize == 16 && %2 == 8
-    movhps           m4, [dst8q]
-%endif
-%elifdef m8
-    SWAP              4, 8
-%else
-    mova             m4, m_q0backup
-%endif
-    mova             m1, m4
-    SWAP              1, 4
-    mova             m7, m5
-    SWAP              7, 5
-    psubusb          m1, m5          ; q0-q1
-    psubusb          m7, m4          ; q1-q0
-    por              m1, m7          ; abs(q1-q0)
-%if notcpuflag(mmxext)
-    mova             m7, m1
-    psubusb          m1, m6
-    psubusb          m7, m_hevthr
-    pxor             m6, m6
-    pcmpeqb          m1, m6          ; abs(q1-q0) <= I
-    pcmpeqb          m7, m6          ; abs(q1-q0) <= hev_thresh
-    mova             m6, m_maskres
-    pand             m0, m1          ; abs([pq][321]-[pq][210]) <= I
-    pand             m6, m7
-%else ; mmxext/sse2
-    pxor             m7, m7
-    pmaxub           m0, m1
-    pmaxub           m6, m1
-    psubusb          m0, m_flimI
-    psubusb          m6, m_hevthr
-    pcmpeqb          m0, m7          ; max(abs(..)) <= I
-    pcmpeqb          m6, m7          ; !(max(abs..) > thresh)
-%endif
-%ifdef m12
-    SWAP              6, 12
-%else
-    mova      m_maskres, m6          ; !(abs(p1-p0) > hev_t || abs(q1-q0) > hev_t)
-%endif
-
-    ; simple_limit
-    mova             m1, m3
-    SWAP              1, 3
-    mova             m6, m4          ; keep copies of p0/q0 around for later use
-    SWAP              6, 4
-    psubusb          m1, m4          ; p0-q0
-    psubusb          m6, m3          ; q0-p0
-    por              m1, m6          ; abs(q0-p0)
-    paddusb          m1, m1          ; m1=2*abs(q0-p0)
-
-    mova             m7, m2
-    SWAP              7, 2
-    mova             m6, m5
-    SWAP              6, 5
-    psubusb          m7, m5          ; p1-q1
-    psubusb          m6, m2          ; q1-p1
-    por              m7, m6          ; abs(q1-p1)
-    pxor             m6, m6
-    pand             m7, [pb_FE]
-    psrlq            m7, 1           ; abs(q1-p1)/2
-    paddusb          m7, m1          ; abs(q0-p0)*2+abs(q1-p1)/2
-    psubusb          m7, m_flimE
-    pcmpeqb          m7, m6          ; abs(q0-p0)*2+abs(q1-p1)/2 <= E
-    pand             m0, m7          ; normal_limit result
-
-    ; filter_common; at this point, m2-m5=p1-q1 and m0 is filter_mask
-%ifdef m8 ; x86-64 && sse2
-    mova             m8, [pb_80]
-%define m_pb_80 m8
-%else ; x86-32 or mmx/mmxext
-%define m_pb_80 [pb_80]
-%endif
-    mova             m1, m4
-    mova             m7, m3
-    pxor             m1, m_pb_80
-    pxor             m7, m_pb_80
-    psubsb           m1, m7          ; (signed) q0-p0
-    mova             m6, m2
-    mova             m7, m5
-    pxor             m6, m_pb_80
-    pxor             m7, m_pb_80
-    psubsb           m6, m7          ; (signed) p1-q1
-    mova             m7, m_maskres
-    paddsb           m6, m1
-    paddsb           m6, m1
-    paddsb           m6, m1
-    pand             m6, m0
-%ifdef m8
-    mova       m_limres, m6          ; 3*(qp-p0)+(p1-q1) masked for filter_mbedge
-    pand       m_limres, m7
-%else
-    mova             m0, m6
-    pand             m0, m7
-    mova       m_limres, m0
-%endif
-    pandn            m7, m6          ; 3*(q0-p0)+(p1-q1) masked for filter_common
-
-    mova             m1, [pb_F8]
-    mova             m6, m7
-    paddsb           m7, [pb_3]
-    paddsb           m6, [pb_4]
-    pand             m7, m1
-    pand             m6, m1
-
-    pxor             m1, m1
-    pxor             m0, m0
-    pcmpgtb          m1, m7
-    psubb            m0, m7
-    psrlq            m7, 3           ; +f2
-    psrlq            m0, 3           ; -f2
-    pand             m0, m1
-    pandn            m1, m7
-    psubusb          m3, m0
-    paddusb          m3, m1          ; p0+f2
-
-    pxor             m1, m1
-    pxor             m0, m0
-    pcmpgtb          m0, m6
-    psubb            m1, m6
-    psrlq            m6, 3           ; +f1
-    psrlq            m1, 3           ; -f1
-    pand             m1, m0
-    pandn            m0, m6
-    psubusb          m4, m0
-    paddusb          m4, m1          ; q0-f1
-
-    ; filter_mbedge (m2-m5 = p1-q1; lim_res carries w)
-%if cpuflag(ssse3)
-    mova             m7, [pb_1]
-%else
-    mova             m7, [pw_63]
-%endif
-%ifdef m8
-    SWAP              1, 8
-%else
-    mova             m1, m_limres
-%endif
-    pxor             m0, m0
-    mova             m6, m1
-    pcmpgtb          m0, m1         ; which are negative
-%if cpuflag(ssse3)
-    punpcklbw        m6, m7         ; interleave with "1" for rounding
-    punpckhbw        m1, m7
-%else
-    punpcklbw        m6, m0         ; signed byte->word
-    punpckhbw        m1, m0
-%endif
-    mova      m_limsign, m0
-%if cpuflag(ssse3)
-    mova             m7, [pb_27_63]
-%ifndef m8
-    mova       m_limres, m1
-%endif
-%ifdef m10
-    SWAP              0, 10         ; don't lose lim_sign copy
-%endif
-    mova             m0, m7
-    pmaddubsw        m7, m6
-    SWAP              6, 7
-    pmaddubsw        m0, m1
-    SWAP              1, 0
-%ifdef m10
-    SWAP              0, 10
-%else
-    mova             m0, m_limsign
-%endif
-%else
-    mova      m_maskres, m6         ; backup for later in filter
-    mova       m_limres, m1
-    pmullw          m6, [pw_27]
-    pmullw          m1, [pw_27]
-    paddw           m6, m7
-    paddw           m1, m7
-%endif
-    psraw           m6, 7
-    psraw           m1, 7
-    packsswb        m6, m1          ; a0
-    pxor            m1, m1
-    psubb           m1, m6
-    pand            m1, m0          ; -a0
-    pandn           m0, m6          ; +a0
-%if cpuflag(ssse3)
-    mova            m6, [pb_18_63]  ; pipelining
-%endif
-    psubusb         m3, m1
-    paddusb         m4, m1
-    paddusb         m3, m0          ; p0+a0
-    psubusb         m4, m0          ; q0-a0
-
-%if cpuflag(ssse3)
-    SWAP             6, 7
-%ifdef m10
-    SWAP             1, 10
-%else
-    mova            m1, m_limres
-%endif
-    mova            m0, m7
-    pmaddubsw       m7, m6
-    SWAP             6, 7
-    pmaddubsw       m0, m1
-    SWAP             1, 0
-%ifdef m10
-    SWAP             0, 10
-%endif
-    mova            m0, m_limsign
-%else
-    mova            m6, m_maskres
-    mova            m1, m_limres
-    pmullw          m6, [pw_18]
-    pmullw          m1, [pw_18]
-    paddw           m6, m7
-    paddw           m1, m7
-%endif
-    mova            m0, m_limsign
-    psraw           m6, 7
-    psraw           m1, 7
-    packsswb        m6, m1          ; a1
-    pxor            m1, m1
-    psubb           m1, m6
-    pand            m1, m0          ; -a1
-    pandn           m0, m6          ; +a1
-%if cpuflag(ssse3)
-    mova            m6, [pb_9_63]
-%endif
-    psubusb         m2, m1
-    paddusb         m5, m1
-    paddusb         m2, m0          ; p1+a1
-    psubusb         m5, m0          ; q1-a1
-
-%if cpuflag(ssse3)
-    SWAP             6, 7
-%ifdef m10
-    SWAP             1, 10
-%else
-    mova            m1, m_limres
-%endif
-    mova            m0, m7
-    pmaddubsw       m7, m6
-    SWAP             6, 7
-    pmaddubsw       m0, m1
-    SWAP             1, 0
-%else
-%ifdef m8
-    SWAP             6, 12
-    SWAP             1, 8
-%else
-    mova            m6, m_maskres
-    mova            m1, m_limres
-%endif
-    pmullw          m6, [pw_9]
-    pmullw          m1, [pw_9]
-    paddw           m6, m7
-    paddw           m1, m7
-%endif
-%ifdef m9
-    SWAP             7, 9
-%else
-    mova            m7, m_limsign
-%endif
-    psraw           m6, 7
-    psraw           m1, 7
-    packsswb        m6, m1          ; a1
-    pxor            m0, m0
-    psubb           m0, m6
-    pand            m0, m7          ; -a1
-    pandn           m7, m6          ; +a1
-%ifdef m8
-    SWAP             1, 13
-    SWAP             6, 14
-%else
-    mova            m1, m_p2backup
-    mova            m6, m_q2backup
-%endif
-    psubusb         m1, m0
-    paddusb         m6, m0
-    paddusb         m1, m7          ; p1+a1
-    psubusb         m6, m7          ; q1-a1
-
-    ; store
-%ifidn %1, v
-    movrow [dst2q+mstrideq*4], m1
-    movrow [dst1q+mstrideq*2], m2
-    movrow [dst1q+mstrideq  ], m3
-    movrow     [dst1q], m4
-    movrow     [dst2q], m5
-    movrow [dst2q+ strideq  ], m6
-%if mmsize == 16 && %2 == 8
-    add           dst8q, mstrideq
-    movhps [dst8q+mstrideq*2], m1
-    movhps [dst8q+mstrideq  ], m2
-    movhps     [dst8q], m3
-    add          dst8q, strideq
-    movhps     [dst8q], m4
-    movhps [dst8q+ strideq  ], m5
-    movhps [dst8q+ strideq*2], m6
-%endif
-%else ; h
-    inc          dst1q
-    inc          dst2q
-
-    ; 4x8/16 transpose
-    TRANSPOSE4x4B    1, 2, 3, 4, 0
-    SBUTTERFLY      bw, 5, 6, 0
-
-%if mmsize == 8 ; mmx/mmxext (h)
-    WRITE_4x2D       1, 2, 3, 4, dst1q, dst2q, mstrideq, strideq
-    add          dst1q, 4
-    WRITE_2x4W      m5, m6, dst2q, dst1q, mstrideq, strideq
-%else ; sse2 (h)
-    lea          dst8q, [dst8q+mstrideq+1]
-    WRITE_4x4D       1, 2, 3, 4, dst1q, dst2q, dst8q, mstrideq, strideq, %2
-    lea          dst1q, [dst2q+mstrideq+4]
-    lea          dst8q, [dst8q+mstrideq+4]
-%if cpuflag(sse4)
-    add          dst2q, 4
-%endif
-    WRITE_8W        m5, dst2q, dst1q,  mstrideq, strideq
-%if cpuflag(sse4)
-    lea          dst2q, [dst8q+ strideq  ]
-%endif
-    WRITE_8W        m6, dst2q, dst8q, mstrideq, strideq
-%endif
-%endif
-
-%if mmsize == 8
-%if %2 == 8 ; chroma
-%ifidn %1, h
-    sub          dst1q, 5
-%endif
-    cmp          dst1q, dst8q
-    mov          dst1q, dst8q
-    jnz .next8px
-%else
-%ifidn %1, h
-    lea          dst1q, [dst1q+ strideq*8-5]
-%else ; v
-    add          dst1q, 8
-%endif
-    dec          cntrq
-    jg .next8px
-%endif
-    REP_RET
-%else ; mmsize == 16
-    RET
-%endif
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-MBEDGE_LOOPFILTER v, 16
-MBEDGE_LOOPFILTER h, 16
-MBEDGE_LOOPFILTER v,  8
-MBEDGE_LOOPFILTER h,  8
-
-INIT_MMX mmxext
-MBEDGE_LOOPFILTER v, 16
-MBEDGE_LOOPFILTER h, 16
-MBEDGE_LOOPFILTER v,  8
-MBEDGE_LOOPFILTER h,  8
-%endif
-
-INIT_XMM sse2
-MBEDGE_LOOPFILTER v, 16
-MBEDGE_LOOPFILTER h, 16
-MBEDGE_LOOPFILTER v,  8
-MBEDGE_LOOPFILTER h,  8
-
-INIT_XMM ssse3
-MBEDGE_LOOPFILTER v, 16
-MBEDGE_LOOPFILTER h, 16
-MBEDGE_LOOPFILTER v,  8
-MBEDGE_LOOPFILTER h,  8
-
-INIT_XMM sse4
-MBEDGE_LOOPFILTER h, 16
-MBEDGE_LOOPFILTER h,  8
diff --git a/deps/libav/libavcodec/x86/vp9dsp.asm b/deps/libav/libavcodec/x86/vp9dsp.asm
deleted file mode 100644
index 6488f30..0000000
--- a/deps/libav/libavcodec/x86/vp9dsp.asm
+++ /dev/null
@@ -1,277 +0,0 @@
-;******************************************************************************
-;* VP9 SIMD optimizations
-;*
-;* Copyright (c) 2013 Ronald S. Bultje <rsbultje gmail com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-; FIXME share with vp8dsp.asm
-pw_256:   times 8 dw 256
-
-%macro F8_TAPS 8
-times 8 db %1, %2
-times 8 db %3, %4
-times 8 db %5, %6
-times 8 db %7, %8
-%endmacro
-; int8_t ff_filters_ssse3[3][15][4][16]
-const filters_ssse3 ; smooth
-                    F8_TAPS -3, -1,  32,  64,  38,   1, -3,  0
-                    F8_TAPS -2, -2,  29,  63,  41,   2, -3,  0
-                    F8_TAPS -2, -2,  26,  63,  43,   4, -4,  0
-                    F8_TAPS -2, -3,  24,  62,  46,   5, -4,  0
-                    F8_TAPS -2, -3,  21,  60,  49,   7, -4,  0
-                    F8_TAPS -1, -4,  18,  59,  51,   9, -4,  0
-                    F8_TAPS -1, -4,  16,  57,  53,  12, -4, -1
-                    F8_TAPS -1, -4,  14,  55,  55,  14, -4, -1
-                    F8_TAPS -1, -4,  12,  53,  57,  16, -4, -1
-                    F8_TAPS  0, -4,   9,  51,  59,  18, -4, -1
-                    F8_TAPS  0, -4,   7,  49,  60,  21, -3, -2
-                    F8_TAPS  0, -4,   5,  46,  62,  24, -3, -2
-                    F8_TAPS  0, -4,   4,  43,  63,  26, -2, -2
-                    F8_TAPS  0, -3,   2,  41,  63,  29, -2, -2
-                    F8_TAPS  0, -3,   1,  38,  64,  32, -1, -3
-                    ; regular
-                    F8_TAPS  0,  1,  -5, 126,   8,  -3,  1,  0
-                    F8_TAPS -1,  3, -10, 122,  18,  -6,  2,  0
-                    F8_TAPS -1,  4, -13, 118,  27,  -9,  3, -1
-                    F8_TAPS -1,  4, -16, 112,  37, -11,  4, -1
-                    F8_TAPS -1,  5, -18, 105,  48, -14,  4, -1
-                    F8_TAPS -1,  5, -19,  97,  58, -16,  5, -1
-                    F8_TAPS -1,  6, -19,  88,  68, -18,  5, -1
-                    F8_TAPS -1,  6, -19,  78,  78, -19,  6, -1
-                    F8_TAPS -1,  5, -18,  68,  88, -19,  6, -1
-                    F8_TAPS -1,  5, -16,  58,  97, -19,  5, -1
-                    F8_TAPS -1,  4, -14,  48, 105, -18,  5, -1
-                    F8_TAPS -1,  4, -11,  37, 112, -16,  4, -1
-                    F8_TAPS -1,  3,  -9,  27, 118, -13,  4, -1
-                    F8_TAPS  0,  2,  -6,  18, 122, -10,  3, -1
-                    F8_TAPS  0,  1,  -3,   8, 126,  -5,  1,  0
-                    ; sharp
-                    F8_TAPS -1,  3,  -7, 127,   8,  -3,  1,  0
-                    F8_TAPS -2,  5, -13, 125,  17,  -6,  3, -1
-                    F8_TAPS -3,  7, -17, 121,  27, -10,  5, -2
-                    F8_TAPS -4,  9, -20, 115,  37, -13,  6, -2
-                    F8_TAPS -4, 10, -23, 108,  48, -16,  8, -3
-                    F8_TAPS -4, 10, -24, 100,  59, -19,  9, -3
-                    F8_TAPS -4, 11, -24,  90,  70, -21, 10, -4
-                    F8_TAPS -4, 11, -23,  80,  80, -23, 11, -4
-                    F8_TAPS -4, 10, -21,  70,  90, -24, 11, -4
-                    F8_TAPS -3,  9, -19,  59, 100, -24, 10, -4
-                    F8_TAPS -3,  8, -16,  48, 108, -23, 10, -4
-                    F8_TAPS -2,  6, -13,  37, 115, -20,  9, -4
-                    F8_TAPS -2,  5, -10,  27, 121, -17,  7, -3
-                    F8_TAPS -1,  3,  -6,  17, 125, -13,  5, -2
-                    F8_TAPS  0,  1,  -3,   8, 127,  -7,  3, -1
-
-SECTION .text
-
-%macro filter_h_fn 1
-%assign %%px mmsize/2
-cglobal %1_8tap_1d_h_ %+ %%px, 6, 6, 11, dst, src, dstride, sstride, h, filtery
-    mova        m6, [pw_256]
-    mova        m7, [filteryq+ 0]
-%if ARCH_X86_64 && mmsize > 8
-    mova        m8, [filteryq+16]
-    mova        m9, [filteryq+32]
-    mova       m10, [filteryq+48]
-%endif
-.loop:
-    movh        m0, [srcq-3]
-    movh        m1, [srcq-2]
-    movh        m2, [srcq-1]
-    movh        m3, [srcq+0]
-    movh        m4, [srcq+1]
-    movh        m5, [srcq+2]
-    punpcklbw   m0, m1
-    punpcklbw   m2, m3
-    movh        m1, [srcq+3]
-    movh        m3, [srcq+4]
-    add       srcq, sstrideq
-    punpcklbw   m4, m5
-    punpcklbw   m1, m3
-    pmaddubsw   m0, m7
-%if ARCH_X86_64 && mmsize > 8
-    pmaddubsw   m2, m8
-    pmaddubsw   m4, m9
-    pmaddubsw   m1, m10
-%else
-    pmaddubsw   m2, [filteryq+16]
-    pmaddubsw   m4, [filteryq+32]
-    pmaddubsw   m1, [filteryq+48]
-%endif
-    paddw       m0, m2
-    paddw       m4, m1
-    paddsw      m0, m4
-    pmulhrsw    m0, m6
-%ifidn %1, avg
-    movh        m1, [dstq]
-%endif
-    packuswb    m0, m0
-%ifidn %1, avg
-    pavgb       m0, m1
-%endif
-    movh    [dstq], m0
-    add       dstq, dstrideq
-    dec         hd
-    jg .loop
-    RET
-%endmacro
-
-INIT_MMX ssse3
-filter_h_fn put
-filter_h_fn avg
-
-INIT_XMM ssse3
-filter_h_fn put
-filter_h_fn avg
-
-%macro filter_v_fn 1
-%assign %%px mmsize/2
-%if ARCH_X86_64
-cglobal %1_8tap_1d_v_ %+ %%px, 6, 8, 11, dst, src, dstride, sstride, h, filtery, src4, sstride3
-%else
-cglobal %1_8tap_1d_v_ %+ %%px, 4, 7, 11, dst, src, dstride, sstride, filtery, src4, sstride3
-    mov   filteryq, r5mp
-%define hd r4mp
-%endif
-    sub       srcq, sstrideq
-    lea  sstride3q, [sstrideq*3]
-    sub       srcq, sstrideq
-    mova        m6, [pw_256]
-    sub       srcq, sstrideq
-    mova        m7, [filteryq+ 0]
-    lea      src4q, [srcq+sstrideq*4]
-%if ARCH_X86_64 && mmsize > 8
-    mova        m8, [filteryq+16]
-    mova        m9, [filteryq+32]
-    mova       m10, [filteryq+48]
-%endif
-.loop:
-    ; FIXME maybe reuse loads from previous rows, or just more generally
-    ; unroll this to prevent multiple loads of the same data?
-    movh        m0, [srcq]
-    movh        m1, [srcq+sstrideq]
-    movh        m2, [srcq+sstrideq*2]
-    movh        m3, [srcq+sstride3q]
-    movh        m4, [src4q]
-    movh        m5, [src4q+sstrideq]
-    punpcklbw   m0, m1
-    punpcklbw   m2, m3
-    movh        m1, [src4q+sstrideq*2]
-    movh        m3, [src4q+sstride3q]
-    add       srcq, sstrideq
-    add      src4q, sstrideq
-    punpcklbw   m4, m5
-    punpcklbw   m1, m3
-    pmaddubsw   m0, m7
-%if ARCH_X86_64 && mmsize > 8
-    pmaddubsw   m2, m8
-    pmaddubsw   m4, m9
-    pmaddubsw   m1, m10
-%else
-    pmaddubsw   m2, [filteryq+16]
-    pmaddubsw   m4, [filteryq+32]
-    pmaddubsw   m1, [filteryq+48]
-%endif
-    paddw       m0, m2
-    paddw       m4, m1
-    paddsw      m0, m4
-    pmulhrsw    m0, m6
-%ifidn %1, avg
-    movh        m1, [dstq]
-%endif
-    packuswb    m0, m0
-%ifidn %1, avg
-    pavgb       m0, m1
-%endif
-    movh    [dstq], m0
-    add       dstq, dstrideq
-    dec         hd
-    jg .loop
-    RET
-%endmacro
-
-INIT_MMX ssse3
-filter_v_fn put
-filter_v_fn avg
-
-INIT_XMM ssse3
-filter_v_fn put
-filter_v_fn avg
-
-%macro fpel_fn 6
-%if %2 == 4
-%define %%srcfn movh
-%define %%dstfn movh
-%else
-%define %%srcfn movu
-%define %%dstfn mova
-%endif
-
-%if %2 <= 16
-cglobal %1%2, 5, 7, 4, dst, src, dstride, sstride, h, dstride3, sstride3
-    lea  sstride3q, [sstrideq*3]
-    lea  dstride3q, [dstrideq*3]
-%else
-cglobal %1%2, 5, 5, 4, dst, src, dstride, sstride, h
-%endif
-.loop:
-    %%srcfn     m0, [srcq]
-    %%srcfn     m1, [srcq+s%3]
-    %%srcfn     m2, [srcq+s%4]
-    %%srcfn     m3, [srcq+s%5]
-    lea       srcq, [srcq+sstrideq*%6]
-%ifidn %1, avg
-    pavgb       m0, [dstq]
-    pavgb       m1, [dstq+d%3]
-    pavgb       m2, [dstq+d%4]
-    pavgb       m3, [dstq+d%5]
-%endif
-    %%dstfn [dstq], m0
-    %%dstfn [dstq+d%3], m1
-    %%dstfn [dstq+d%4], m2
-    %%dstfn [dstq+d%5], m3
-    lea       dstq, [dstq+dstrideq*%6]
-    sub         hd, %6
-    jnz .loop
-    RET
-%endmacro
-
-%define d16 16
-%define s16 16
-INIT_MMX mmx
-fpel_fn put, 4,  strideq, strideq*2, stride3q, 4
-fpel_fn put, 8,  strideq, strideq*2, stride3q, 4
-INIT_MMX sse
-fpel_fn avg, 4,  strideq, strideq*2, stride3q, 4
-fpel_fn avg, 8,  strideq, strideq*2, stride3q, 4
-INIT_XMM sse
-fpel_fn put, 16, strideq, strideq*2, stride3q, 4
-fpel_fn put, 32, mmsize,  strideq,   strideq+mmsize, 2
-fpel_fn put, 64, mmsize,  mmsize*2,  mmsize*3, 1
-INIT_XMM sse2
-fpel_fn avg, 16, strideq, strideq*2, stride3q, 4
-fpel_fn avg, 32, mmsize,  strideq,   strideq+mmsize, 2
-fpel_fn avg, 64, mmsize,  mmsize*2,  mmsize*3, 1
-%undef s16
-%undef d16
diff --git a/deps/libav/libavcodec/x86/vp9dsp_init.c b/deps/libav/libavcodec/x86/vp9dsp_init.c
deleted file mode 100644
index ce58c08..0000000
--- a/deps/libav/libavcodec/x86/vp9dsp_init.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * VP9 SIMD optimizations
- *
- * Copyright (c) 2013 Ronald S. Bultje <rsbultje at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavcodec/vp9.h"
-
-#if HAVE_YASM
-
-#define fpel_func(avg, sz, opt)                                         \
-void ff_ ## avg ## sz ## _ ## opt(uint8_t *dst, const uint8_t *src,     \
-                                  ptrdiff_t dst_stride,                 \
-                                  ptrdiff_t src_stride,                 \
-                                  int h, int mx, int my)
-
-fpel_func(put,  4, mmx);
-fpel_func(put,  8, mmx);
-fpel_func(put, 16, sse);
-fpel_func(put, 32, sse);
-fpel_func(put, 64, sse);
-fpel_func(avg,  4, sse);
-fpel_func(avg,  8, sse);
-fpel_func(avg, 16, sse2);
-fpel_func(avg, 32, sse2);
-fpel_func(avg, 64, sse2);
-#undef fpel_func
-
-#define mc_func(avg, sz, dir, opt)                                          \
-void                                                                        \
-ff_ ## avg ## _8tap_1d_ ## dir ## _ ## sz ## _ ## opt(uint8_t *dst,         \
-                                                      const uint8_t *src,   \
-                                                      ptrdiff_t dst_stride, \
-                                                      ptrdiff_t src_stride, \
-                                                      int h,                \
-                                                      const int8_t (*filter)[16])
-
-#define mc_funcs(sz)            \
-    mc_func(put, sz, h, ssse3); \
-    mc_func(avg, sz, h, ssse3); \
-    mc_func(put, sz, v, ssse3); \
-    mc_func(avg, sz, v, ssse3)
-
-mc_funcs(4);
-mc_funcs(8);
-
-#undef mc_funcs
-#undef mc_func
-
-#define mc_rep_func(avg, sz, hsz, dir, opt)                                 \
-static av_always_inline void                                                \
-ff_ ## avg ## _8tap_1d_ ## dir ## _ ## sz ## _ ## opt(uint8_t *dst,         \
-                                                      const uint8_t *src,   \
-                                                      ptrdiff_t dst_stride, \
-                                                      ptrdiff_t src_stride, \
-                                                      int h,                \
-                                                      const int8_t (*filter)[16]) \
-{                                                                           \
-    ff_ ## avg ## _8tap_1d_ ## dir ## _ ## hsz ## _ ## opt(dst, src,        \
-                                                           dst_stride,      \
-                                                           src_stride,      \
-                                                           h,               \
-                                                           filter);         \
-    ff_ ## avg ## _8tap_1d_ ## dir ## _ ## hsz ## _ ## opt(dst + hsz,       \
-                                                           src + hsz,       \
-                                                           dst_stride,      \
-                                                           src_stride,      \
-                                                           h, filter);      \
-}
-
-#define mc_rep_funcs(sz, hsz)            \
-    mc_rep_func(put, sz, hsz, h, ssse3); \
-    mc_rep_func(avg, sz, hsz, h, ssse3); \
-    mc_rep_func(put, sz, hsz, v, ssse3); \
-    mc_rep_func(avg, sz, hsz, v, ssse3)
-
-mc_rep_funcs(16, 8);
-mc_rep_funcs(32, 16);
-mc_rep_funcs(64, 32);
-
-#undef mc_rep_funcs
-#undef mc_rep_func
-
-extern const int8_t ff_filters_ssse3[3][15][4][16];
-
-#define filter_8tap_2d_fn(op, sz, f, fname)                             \
-static void                                                             \
-op ## _8tap_ ## fname ## _ ## sz ## hv_ssse3(uint8_t *dst,              \
-                                             const uint8_t *src,        \
-                                             ptrdiff_t dst_stride,      \
-                                             ptrdiff_t src_stride,      \
-                                             int h, int mx, int my)     \
-{                                                                       \
-    LOCAL_ALIGNED_16(uint8_t, temp, [71 * 64]);                         \
-    ff_put_8tap_1d_h_ ## sz ## _ssse3(temp, src - 3 * src_stride,       \
-                                      64, src_stride,                   \
-                                      h + 7,                            \
-                                      ff_filters_ssse3[f][mx - 1]);     \
-    ff_ ## op ## _8tap_1d_v_ ## sz ## _ssse3(dst, temp + 3 * 64,        \
-                                             dst_stride, 64,            \
-                                             h,                         \
-                                             ff_filters_ssse3[f][my - 1]); \
-}
-
-#define filters_8tap_2d_fn(op, sz)                          \
-    filter_8tap_2d_fn(op, sz, FILTER_8TAP_REGULAR, regular) \
-    filter_8tap_2d_fn(op, sz, FILTER_8TAP_SHARP, sharp)     \
-    filter_8tap_2d_fn(op, sz, FILTER_8TAP_SMOOTH, smooth)
-
-#define filters_8tap_2d_fn2(op) \
-    filters_8tap_2d_fn(op, 64)  \
-    filters_8tap_2d_fn(op, 32)  \
-    filters_8tap_2d_fn(op, 16)  \
-    filters_8tap_2d_fn(op, 8)   \
-    filters_8tap_2d_fn(op, 4)
-
-filters_8tap_2d_fn2(put)
-filters_8tap_2d_fn2(avg)
-
-#undef filters_8tap_2d_fn2
-#undef filters_8tap_2d_fn
-#undef filter_8tap_2d_fn
-
-#define filter_8tap_1d_fn(op, sz, f, fname, dir, dvar)                  \
-static void                                                             \
-op ## _8tap_ ## fname ## _ ## sz ## dir ## _ssse3(uint8_t *dst,         \
-                                                  const uint8_t *src,   \
-                                                  ptrdiff_t dst_stride, \
-                                                  ptrdiff_t src_stride, \
-                                                  int h, int mx,        \
-                                                  int my)               \
-{                                                                       \
-    ff_ ## op ## _8tap_1d_ ## dir ## _ ## sz ## _ssse3(dst, src,        \
-                                                       dst_stride,      \
-                                                       src_stride, h,   \
-                                                       ff_filters_ssse3[f][dvar - 1]); \
-}
-
-#define filters_8tap_1d_fn(op, sz, dir, dvar)                          \
-    filter_8tap_1d_fn(op, sz, FILTER_8TAP_REGULAR, regular, dir, dvar) \
-    filter_8tap_1d_fn(op, sz, FILTER_8TAP_SHARP, sharp, dir, dvar)     \
-    filter_8tap_1d_fn(op, sz, FILTER_8TAP_SMOOTH, smooth, dir, dvar)
-
-#define filters_8tap_1d_fn2(op, sz)             \
-    filters_8tap_1d_fn(op, sz, h, mx)           \
-    filters_8tap_1d_fn(op, sz, v, my)
-
-#define filters_8tap_1d_fn3(op) \
-    filters_8tap_1d_fn2(op, 64) \
-    filters_8tap_1d_fn2(op, 32) \
-    filters_8tap_1d_fn2(op, 16) \
-    filters_8tap_1d_fn2(op,  8) \
-    filters_8tap_1d_fn2(op,  4)
-
-filters_8tap_1d_fn3(put)
-filters_8tap_1d_fn3(avg)
-
-#undef filters_8tap_1d_fn
-#undef filters_8tap_1d_fn2
-#undef filters_8tap_1d_fn3
-#undef filter_8tap_1d_fn
-
-#endif /* HAVE_YASM */
-
-av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp)
-{
-#if HAVE_YASM
-    int cpu_flags = av_get_cpu_flags();
-
-#define init_fpel(idx1, idx2, sz, type, opt)                            \
-    dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][0][0] =                    \
-    dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][0][0] =                    \
-    dsp->mc[idx1][FILTER_8TAP_SHARP  ][idx2][0][0] =                    \
-    dsp->mc[idx1][FILTER_BILINEAR    ][idx2][0][0] = ff_ ## type ## sz ## _ ## opt
-
-
-#define init_subpel1(idx1, idx2, idxh, idxv, sz, dir, type, opt) \
-    dsp->mc[idx1][FILTER_8TAP_SMOOTH][idx2][idxh][idxv]  = type ## _8tap_smooth_  ## sz ## dir ## _ ## opt; \
-    dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][idxh][idxv] = type ## _8tap_regular_ ## sz ## dir ## _ ## opt; \
-    dsp->mc[idx1][FILTER_8TAP_SHARP][idx2][idxh][idxv]   = type ## _8tap_sharp_   ## sz ## dir ## _ ## opt
-
-#define init_subpel2(idx, idxh, idxv, dir, type, opt)     \
-    init_subpel1(0, idx, idxh, idxv, 64, dir, type, opt); \
-    init_subpel1(1, idx, idxh, idxv, 32, dir, type, opt); \
-    init_subpel1(2, idx, idxh, idxv, 16, dir, type, opt); \
-    init_subpel1(3, idx, idxh, idxv,  8, dir, type, opt); \
-    init_subpel1(4, idx, idxh, idxv,  4, dir, type, opt)
-
-#define init_subpel3(idx, type, opt)        \
-    init_subpel2(idx, 1, 1, hv, type, opt); \
-    init_subpel2(idx, 0, 1,  v, type, opt); \
-    init_subpel2(idx, 1, 0,  h, type, opt)
-
-    if (EXTERNAL_MMX(cpu_flags)) {
-        init_fpel(4, 0,  4, put, mmx);
-        init_fpel(3, 0,  8, put, mmx);
-    }
-
-    if (EXTERNAL_SSE(cpu_flags)) {
-        init_fpel(2, 0, 16, put, sse);
-        init_fpel(1, 0, 32, put, sse);
-        init_fpel(0, 0, 64, put, sse);
-        init_fpel(4, 1,  4, avg, sse);
-        init_fpel(3, 1,  8, avg, sse);
-    }
-
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        init_fpel(2, 1, 16, avg, sse2);
-        init_fpel(1, 1, 32, avg, sse2);
-        init_fpel(0, 1, 64, avg, sse2);
-    }
-
-    if (EXTERNAL_SSSE3(cpu_flags)) {
-        init_subpel3(0, put, ssse3);
-        init_subpel3(1, avg, ssse3);
-    }
-
-#undef init_fpel
-#undef init_subpel1
-#undef init_subpel2
-#undef init_subpel3
-
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavcodec/x86/w64xmmtest.c b/deps/libav/libavcodec/x86/w64xmmtest.c
deleted file mode 100644
index 2f064ca..0000000
--- a/deps/libav/libavcodec/x86/w64xmmtest.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * check XMM registers for clobbers on Win64
- * Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/avcodec.h"
-#include "libavutil/x86/w64xmmtest.h"
-
-wrap(avcodec_open2(AVCodecContext *avctx,
-                   AVCodec *codec,
-                   AVDictionary **options))
-{
-    testxmmclobbers(avcodec_open2, avctx, codec, options);
-}
-
-wrap(avcodec_decode_audio4(AVCodecContext *avctx,
-                           AVFrame *frame,
-                           int *got_frame_ptr,
-                           AVPacket *avpkt))
-{
-    testxmmclobbers(avcodec_decode_audio4, avctx, frame,
-                    got_frame_ptr, avpkt);
-}
-
-wrap(avcodec_decode_video2(AVCodecContext *avctx,
-                           AVFrame *picture,
-                           int *got_picture_ptr,
-                           AVPacket *avpkt))
-{
-    testxmmclobbers(avcodec_decode_video2, avctx, picture,
-                    got_picture_ptr, avpkt);
-}
-
-wrap(avcodec_decode_subtitle2(AVCodecContext *avctx,
-                              AVSubtitle *sub,
-                              int *got_sub_ptr,
-                              AVPacket *avpkt))
-{
-    testxmmclobbers(avcodec_decode_subtitle2, avctx, sub,
-                    got_sub_ptr, avpkt);
-}
-
-wrap(avcodec_encode_audio2(AVCodecContext *avctx,
-                           AVPacket *avpkt,
-                           const AVFrame *frame,
-                           int *got_packet_ptr))
-{
-    testxmmclobbers(avcodec_encode_audio2, avctx, avpkt, frame,
-                    got_packet_ptr);
-}
-
-wrap(avcodec_encode_subtitle(AVCodecContext *avctx,
-                             uint8_t *buf, int buf_size,
-                             const AVSubtitle *sub))
-{
-    testxmmclobbers(avcodec_encode_subtitle, avctx, buf, buf_size, sub);
-}
-
-wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
-                           const AVFrame *frame, int *got_packet_ptr))
-{
-    testxmmclobbers(avcodec_encode_video2, avctx, avpkt, frame, got_packet_ptr);
-}
diff --git a/deps/libav/libavcodec/xan.c b/deps/libav/libavcodec/xan.c
deleted file mode 100644
index 4bf1d87..0000000
--- a/deps/libav/libavcodec/xan.c
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
- * Wing Commander/Xan Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Xan video decoder for Wing Commander III computer game
- * by Mario Brito (mbrito at student.dei.uc.pt)
- * and Mike Melanson (melanson at pcisys.net)
- *
- * The xan_wc3 decoder outputs PAL8 data.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mem.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "internal.h"
-
-#define RUNTIME_GAMMA 0
-
-#define VGA__TAG MKTAG('V', 'G', 'A', ' ')
-#define PALT_TAG MKTAG('P', 'A', 'L', 'T')
-#define SHOT_TAG MKTAG('S', 'H', 'O', 'T')
-#define PALETTE_COUNT 256
-#define PALETTE_SIZE (PALETTE_COUNT * 3)
-#define PALETTES_MAX 256
-
-typedef struct XanContext {
-
-    AVCodecContext *avctx;
-    AVFrame *last_frame;
-
-    const unsigned char *buf;
-    int size;
-
-    /* scratch space */
-    unsigned char *buffer1;
-    int buffer1_size;
-    unsigned char *buffer2;
-    int buffer2_size;
-
-    unsigned *palettes;
-    int palettes_count;
-    int cur_palette;
-
-    int frame_size;
-
-} XanContext;
-
-static av_cold int xan_decode_end(AVCodecContext *avctx)
-{
-    XanContext *s = avctx->priv_data;
-
-    av_frame_free(&s->last_frame);
-
-    av_freep(&s->buffer1);
-    av_freep(&s->buffer2);
-    av_freep(&s->palettes);
-
-    return 0;
-}
-
-static av_cold int xan_decode_init(AVCodecContext *avctx)
-{
-    XanContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-    s->frame_size = 0;
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    s->buffer1_size = avctx->width * avctx->height;
-    s->buffer1 = av_malloc(s->buffer1_size);
-    if (!s->buffer1)
-        return AVERROR(ENOMEM);
-    s->buffer2_size = avctx->width * avctx->height;
-    s->buffer2 = av_malloc(s->buffer2_size + 130);
-    if (!s->buffer2) {
-        av_freep(&s->buffer1);
-        return AVERROR(ENOMEM);
-    }
-
-    s->last_frame = av_frame_alloc();
-    if (!s->last_frame) {
-        xan_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static int xan_huffman_decode(unsigned char *dest, int dest_len,
-                              const unsigned char *src, int src_len)
-{
-    unsigned char byte = *src++;
-    unsigned char ival = byte + 0x16;
-    const unsigned char * ptr = src + byte*2;
-    int ptr_len = src_len - 1 - byte*2;
-    unsigned char val = ival;
-    unsigned char *dest_end = dest + dest_len;
-    unsigned char *dest_start = dest;
-    GetBitContext gb;
-
-    if (ptr_len < 0)
-        return AVERROR_INVALIDDATA;
-
-    init_get_bits(&gb, ptr, ptr_len * 8);
-
-    while (val != 0x16) {
-        unsigned idx = val - 0x17 + get_bits1(&gb) * byte;
-        if (idx >= 2 * byte)
-            return AVERROR_INVALIDDATA;
-        val = src[idx];
-
-        if (val < 0x16) {
-            if (dest >= dest_end)
-                return dest_len;
-            *dest++ = val;
-            val = ival;
-        }
-    }
-
-    return dest - dest_start;
-}
-
-/**
- * unpack simple compression
- *
- * @param dest destination buffer of dest_len, must be padded with at least 130 bytes
- */
-static void xan_unpack(unsigned char *dest, int dest_len,
-                       const unsigned char *src, int src_len)
-{
-    unsigned char opcode;
-    int size;
-    unsigned char *dest_org = dest;
-    unsigned char *dest_end = dest + dest_len;
-    GetByteContext ctx;
-
-    bytestream2_init(&ctx, src, src_len);
-    while (dest < dest_end && bytestream2_get_bytes_left(&ctx)) {
-        opcode = bytestream2_get_byte(&ctx);
-
-        if (opcode < 0xe0) {
-            int size2, back;
-            if ((opcode & 0x80) == 0) {
-                size = opcode & 3;
-
-                back  = ((opcode & 0x60) << 3) + bytestream2_get_byte(&ctx) + 1;
-                size2 = ((opcode & 0x1c) >> 2) + 3;
-            } else if ((opcode & 0x40) == 0) {
-                size = bytestream2_peek_byte(&ctx) >> 6;
-
-                back  = (bytestream2_get_be16(&ctx) & 0x3fff) + 1;
-                size2 = (opcode & 0x3f) + 4;
-            } else {
-                size = opcode & 3;
-
-                back  = ((opcode & 0x10) << 12) + bytestream2_get_be16(&ctx) + 1;
-                size2 = ((opcode & 0x0c) <<  6) + bytestream2_get_byte(&ctx) + 5;
-            }
-
-            if (dest_end - dest < size + size2 ||
-                dest + size - dest_org < back ||
-                bytestream2_get_bytes_left(&ctx) < size)
-                return;
-            bytestream2_get_buffer(&ctx, dest, size);
-            dest += size;
-            av_memcpy_backptr(dest, back, size2);
-            dest += size2;
-        } else {
-            int finish = opcode >= 0xfc;
-            size = finish ? opcode & 3 : ((opcode & 0x1f) << 2) + 4;
-
-            if (dest_end - dest < size || bytestream2_get_bytes_left(&ctx) < size)
-                return;
-            bytestream2_get_buffer(&ctx, dest, size);
-            dest += size;
-            if (finish)
-                return;
-        }
-    }
-}
-
-static inline void xan_wc3_output_pixel_run(XanContext *s, AVFrame *frame,
-    const unsigned char *pixel_buffer, int x, int y, int pixel_count)
-{
-    int stride;
-    int line_inc;
-    int index;
-    int current_x;
-    int width = s->avctx->width;
-    unsigned char *palette_plane;
-
-    palette_plane = frame->data[0];
-    stride = frame->linesize[0];
-    line_inc = stride - width;
-    index = y * stride + x;
-    current_x = x;
-    while (pixel_count && index < s->frame_size) {
-        int count = FFMIN(pixel_count, width - current_x);
-        memcpy(palette_plane + index, pixel_buffer, count);
-        pixel_count  -= count;
-        index        += count;
-        pixel_buffer += count;
-        current_x    += count;
-
-        if (current_x >= width) {
-            index += line_inc;
-            current_x = 0;
-        }
-    }
-}
-
-static inline void xan_wc3_copy_pixel_run(XanContext *s, AVFrame *frame,
-                                          int x, int y,
-                                          int pixel_count, int motion_x,
-                                          int motion_y)
-{
-    int stride;
-    int line_inc;
-    int curframe_index, prevframe_index;
-    int curframe_x, prevframe_x;
-    int width = s->avctx->width;
-    unsigned char *palette_plane, *prev_palette_plane;
-
-    if (y + motion_y < 0 || y + motion_y >= s->avctx->height ||
-        x + motion_x < 0 || x + motion_x >= s->avctx->width)
-        return;
-
-    palette_plane = frame->data[0];
-    prev_palette_plane = s->last_frame->data[0];
-    if (!prev_palette_plane)
-        prev_palette_plane = palette_plane;
-    stride = frame->linesize[0];
-    line_inc = stride - width;
-    curframe_index = y * stride + x;
-    curframe_x = x;
-    prevframe_index = (y + motion_y) * stride + x + motion_x;
-    prevframe_x = x + motion_x;
-    while (pixel_count &&
-           curframe_index  < s->frame_size &&
-           prevframe_index < s->frame_size) {
-        int count = FFMIN3(pixel_count, width - curframe_x,
-                           width - prevframe_x);
-
-        memcpy(palette_plane + curframe_index,
-               prev_palette_plane + prevframe_index, count);
-        pixel_count     -= count;
-        curframe_index  += count;
-        prevframe_index += count;
-        curframe_x      += count;
-        prevframe_x     += count;
-
-        if (curframe_x >= width) {
-            curframe_index += line_inc;
-            curframe_x = 0;
-        }
-
-        if (prevframe_x >= width) {
-            prevframe_index += line_inc;
-            prevframe_x = 0;
-        }
-    }
-}
-
-static int xan_wc3_decode_frame(XanContext *s, AVFrame *frame)
-{
-
-    int width  = s->avctx->width;
-    int height = s->avctx->height;
-    int total_pixels = width * height;
-    unsigned char opcode;
-    unsigned char flag = 0;
-    int size = 0;
-    int motion_x, motion_y;
-    int x, y, ret;
-
-    unsigned char *opcode_buffer = s->buffer1;
-    unsigned char *opcode_buffer_end = s->buffer1 + s->buffer1_size;
-    int opcode_buffer_size = s->buffer1_size;
-    const unsigned char *imagedata_buffer = s->buffer2;
-
-    /* pointers to segments inside the compressed chunk */
-    const unsigned char *huffman_segment;
-    GetByteContext       size_segment;
-    GetByteContext       vector_segment;
-    const unsigned char *imagedata_segment;
-    int huffman_offset, size_offset, vector_offset, imagedata_offset,
-        imagedata_size;
-
-    if (s->size < 8)
-        return AVERROR_INVALIDDATA;
-
-    huffman_offset    = AV_RL16(&s->buf[0]);
-    size_offset       = AV_RL16(&s->buf[2]);
-    vector_offset     = AV_RL16(&s->buf[4]);
-    imagedata_offset  = AV_RL16(&s->buf[6]);
-
-    if (huffman_offset   >= s->size ||
-        size_offset      >= s->size ||
-        vector_offset    >= s->size ||
-        imagedata_offset >= s->size)
-        return AVERROR_INVALIDDATA;
-
-    huffman_segment   = s->buf + huffman_offset;
-    bytestream2_init(&size_segment,   s->buf + size_offset,   s->size - size_offset);
-    bytestream2_init(&vector_segment, s->buf + vector_offset, s->size - vector_offset);
-    imagedata_segment = s->buf + imagedata_offset;
-
-    if ((ret = xan_huffman_decode(opcode_buffer, opcode_buffer_size,
-                                  huffman_segment, s->size - huffman_offset)) < 0)
-        return AVERROR_INVALIDDATA;
-    opcode_buffer_end = opcode_buffer + ret;
-
-    if (imagedata_segment[0] == 2) {
-        xan_unpack(s->buffer2, s->buffer2_size,
-                   &imagedata_segment[1], s->size - imagedata_offset - 1);
-        imagedata_size = s->buffer2_size;
-    } else {
-        imagedata_size = s->size - imagedata_offset - 1;
-        imagedata_buffer = &imagedata_segment[1];
-    }
-
-    /* use the decoded data segments to build the frame */
-    x = y = 0;
-    while (total_pixels && opcode_buffer < opcode_buffer_end) {
-
-        opcode = *opcode_buffer++;
-        size = 0;
-
-        switch (opcode) {
-
-        case 0:
-            flag ^= 1;
-            continue;
-
-        case 1:
-        case 2:
-        case 3:
-        case 4:
-        case 5:
-        case 6:
-        case 7:
-        case 8:
-            size = opcode;
-            break;
-
-        case 12:
-        case 13:
-        case 14:
-        case 15:
-        case 16:
-        case 17:
-        case 18:
-            size += (opcode - 10);
-            break;
-
-        case 9:
-        case 19:
-            size = bytestream2_get_byte(&size_segment);
-            break;
-
-        case 10:
-        case 20:
-            size = bytestream2_get_be16(&size_segment);
-            break;
-
-        case 11:
-        case 21:
-            size = bytestream2_get_be24(&size_segment);
-            break;
-        }
-
-        if (size > total_pixels)
-            break;
-
-        if (opcode < 12) {
-            flag ^= 1;
-            if (flag) {
-                /* run of (size) pixels is unchanged from last frame */
-                xan_wc3_copy_pixel_run(s, frame, x, y, size, 0, 0);
-            } else {
-                /* output a run of pixels from imagedata_buffer */
-                if (imagedata_size < size)
-                    break;
-                xan_wc3_output_pixel_run(s, frame, imagedata_buffer, x, y, size);
-                imagedata_buffer += size;
-                imagedata_size -= size;
-            }
-        } else {
-            /* run-based motion compensation from last frame */
-            uint8_t vector = bytestream2_get_byte(&vector_segment);
-            motion_x = sign_extend(vector >> 4,  4);
-            motion_y = sign_extend(vector & 0xF, 4);
-
-            /* copy a run of pixels from the previous frame */
-            xan_wc3_copy_pixel_run(s, frame, x, y, size, motion_x, motion_y);
-
-            flag = 0;
-        }
-
-        /* coordinate accounting */
-        total_pixels -= size;
-        y += (x + size) / width;
-        x  = (x + size) % width;
-    }
-    return 0;
-}
-
-#if RUNTIME_GAMMA
-static inline unsigned mul(unsigned a, unsigned b)
-{
-    return (a * b) >> 16;
-}
-
-static inline unsigned pow4(unsigned a)
-{
-    unsigned square = mul(a, a);
-    return mul(square, square);
-}
-
-static inline unsigned pow5(unsigned a)
-{
-    return mul(pow4(a), a);
-}
-
-static uint8_t gamma_corr(uint8_t in) {
-    unsigned lo, hi = 0xff40, target;
-    int i = 15;
-    in = (in << 2) | (in >> 6);
-    /*  equivalent float code:
-    if (in >= 252)
-        return 253;
-    return round(pow(in / 256.0, 0.8) * 256);
-    */
-    lo = target = in << 8;
-    do {
-        unsigned mid = (lo + hi) >> 1;
-        unsigned pow = pow5(mid);
-        if (pow > target) hi = mid;
-        else lo = mid;
-    } while (--i);
-    return (pow4((lo + hi) >> 1) + 0x80) >> 8;
-}
-#else
-/**
- * This is a gamma correction that xan3 applies to all palette entries.
- *
- * There is a peculiarity, namely that the values are clamped to 253 -
- * it seems likely that this table was calculated by a buggy fixed-point
- * implementation, the one above under RUNTIME_GAMMA behaves like this for
- * example.
- * The exponent value of 0.8 can be explained by this as well, since 0.8 = 4/5
- * and thus pow(x, 0.8) is still easy to calculate.
- * Also, the input values are first rotated to the left by 2.
- */
-static const uint8_t gamma_lookup[256] = {
-    0x00, 0x09, 0x10, 0x16, 0x1C, 0x21, 0x27, 0x2C,
-    0x31, 0x35, 0x3A, 0x3F, 0x43, 0x48, 0x4C, 0x50,
-    0x54, 0x59, 0x5D, 0x61, 0x65, 0x69, 0x6D, 0x71,
-    0x75, 0x79, 0x7D, 0x80, 0x84, 0x88, 0x8C, 0x8F,
-    0x93, 0x97, 0x9A, 0x9E, 0xA2, 0xA5, 0xA9, 0xAC,
-    0xB0, 0xB3, 0xB7, 0xBA, 0xBE, 0xC1, 0xC5, 0xC8,
-    0xCB, 0xCF, 0xD2, 0xD5, 0xD9, 0xDC, 0xDF, 0xE3,
-    0xE6, 0xE9, 0xED, 0xF0, 0xF3, 0xF6, 0xFA, 0xFD,
-    0x03, 0x0B, 0x12, 0x18, 0x1D, 0x23, 0x28, 0x2D,
-    0x32, 0x36, 0x3B, 0x40, 0x44, 0x49, 0x4D, 0x51,
-    0x56, 0x5A, 0x5E, 0x62, 0x66, 0x6A, 0x6E, 0x72,
-    0x76, 0x7A, 0x7D, 0x81, 0x85, 0x89, 0x8D, 0x90,
-    0x94, 0x98, 0x9B, 0x9F, 0xA2, 0xA6, 0xAA, 0xAD,
-    0xB1, 0xB4, 0xB8, 0xBB, 0xBF, 0xC2, 0xC5, 0xC9,
-    0xCC, 0xD0, 0xD3, 0xD6, 0xDA, 0xDD, 0xE0, 0xE4,
-    0xE7, 0xEA, 0xED, 0xF1, 0xF4, 0xF7, 0xFA, 0xFD,
-    0x05, 0x0D, 0x13, 0x19, 0x1F, 0x24, 0x29, 0x2E,
-    0x33, 0x38, 0x3C, 0x41, 0x45, 0x4A, 0x4E, 0x52,
-    0x57, 0x5B, 0x5F, 0x63, 0x67, 0x6B, 0x6F, 0x73,
-    0x77, 0x7B, 0x7E, 0x82, 0x86, 0x8A, 0x8D, 0x91,
-    0x95, 0x99, 0x9C, 0xA0, 0xA3, 0xA7, 0xAA, 0xAE,
-    0xB2, 0xB5, 0xB9, 0xBC, 0xBF, 0xC3, 0xC6, 0xCA,
-    0xCD, 0xD0, 0xD4, 0xD7, 0xDA, 0xDE, 0xE1, 0xE4,
-    0xE8, 0xEB, 0xEE, 0xF1, 0xF5, 0xF8, 0xFB, 0xFD,
-    0x07, 0x0E, 0x15, 0x1A, 0x20, 0x25, 0x2A, 0x2F,
-    0x34, 0x39, 0x3D, 0x42, 0x46, 0x4B, 0x4F, 0x53,
-    0x58, 0x5C, 0x60, 0x64, 0x68, 0x6C, 0x70, 0x74,
-    0x78, 0x7C, 0x7F, 0x83, 0x87, 0x8B, 0x8E, 0x92,
-    0x96, 0x99, 0x9D, 0xA1, 0xA4, 0xA8, 0xAB, 0xAF,
-    0xB2, 0xB6, 0xB9, 0xBD, 0xC0, 0xC4, 0xC7, 0xCB,
-    0xCE, 0xD1, 0xD5, 0xD8, 0xDB, 0xDF, 0xE2, 0xE5,
-    0xE9, 0xEC, 0xEF, 0xF2, 0xF6, 0xF9, 0xFC, 0xFD
-};
-#endif
-
-static int xan_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    const uint8_t *buf = avpkt->data;
-    int ret, buf_size = avpkt->size;
-    XanContext *s = avctx->priv_data;
-    GetByteContext ctx;
-    int tag = 0;
-
-    bytestream2_init(&ctx, buf, buf_size);
-    while (bytestream2_get_bytes_left(&ctx) > 8 && tag != VGA__TAG) {
-        unsigned *tmpptr;
-        uint32_t new_pal;
-        int size;
-        int i;
-        tag  = bytestream2_get_le32(&ctx);
-        size = bytestream2_get_be32(&ctx);
-        size = FFMIN(size, bytestream2_get_bytes_left(&ctx));
-        switch (tag) {
-        case PALT_TAG:
-            if (size < PALETTE_SIZE)
-                return AVERROR_INVALIDDATA;
-            if (s->palettes_count >= PALETTES_MAX)
-                return AVERROR_INVALIDDATA;
-            tmpptr = av_realloc(s->palettes,
-                                (s->palettes_count + 1) * AVPALETTE_SIZE);
-            if (!tmpptr)
-                return AVERROR(ENOMEM);
-            s->palettes = tmpptr;
-            tmpptr += s->palettes_count * AVPALETTE_COUNT;
-            for (i = 0; i < PALETTE_COUNT; i++) {
-#if RUNTIME_GAMMA
-                int r = gamma_corr(bytestream2_get_byteu(&ctx));
-                int g = gamma_corr(bytestream2_get_byteu(&ctx));
-                int b = gamma_corr(bytestream2_get_byteu(&ctx));
-#else
-                int r = gamma_lookup[bytestream2_get_byteu(&ctx)];
-                int g = gamma_lookup[bytestream2_get_byteu(&ctx)];
-                int b = gamma_lookup[bytestream2_get_byteu(&ctx)];
-#endif
-                *tmpptr++ = (r << 16) | (g << 8) | b;
-            }
-            s->palettes_count++;
-            break;
-        case SHOT_TAG:
-            if (size < 4)
-                return AVERROR_INVALIDDATA;
-            new_pal = bytestream2_get_le32(&ctx);
-            if (new_pal < s->palettes_count) {
-                s->cur_palette = new_pal;
-            } else
-                av_log(avctx, AV_LOG_ERROR, "Invalid palette selected\n");
-            break;
-        case VGA__TAG:
-            break;
-        default:
-            bytestream2_skip(&ctx, size);
-            break;
-        }
-    }
-    buf_size = bytestream2_get_bytes_left(&ctx);
-
-    if (s->palettes_count <= 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "No palette found\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF))) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (!s->frame_size)
-        s->frame_size = frame->linesize[0] * s->avctx->height;
-
-    memcpy(frame->data[1],
-           s->palettes + s->cur_palette * AVPALETTE_COUNT, AVPALETTE_SIZE);
-
-    s->buf = ctx.buffer;
-    s->size = buf_size;
-
-    if (xan_wc3_decode_frame(s, frame) < 0)
-        return AVERROR_INVALIDDATA;
-
-    av_frame_unref(s->last_frame);
-    if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-AVCodec ff_xan_wc3_decoder = {
-    .name           = "xan_wc3",
-    .long_name      = NULL_IF_CONFIG_SMALL("Wing Commander III / Xan"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_XAN_WC3,
-    .priv_data_size = sizeof(XanContext),
-    .init           = xan_decode_init,
-    .close          = xan_decode_end,
-    .decode         = xan_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/xbmenc.c b/deps/libav/libavcodec/xbmenc.c
deleted file mode 100644
index d6657dc..0000000
--- a/deps/libav/libavcodec/xbmenc.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * XBM image format
- *
- * Copyright (c) 2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "internal.h"
-#include "mathops.h"
-
-static av_cold int xbm_encode_init(AVCodecContext *avctx)
-{
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
-    return 0;
-}
-
-static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                            const AVFrame *p, int *got_packet)
-{
-    int i, j, ret, size, linesize;
-    uint8_t *ptr, *buf;
-
-    linesize = (avctx->width + 7) / 8;
-    size     = avctx->height * (linesize * 7 + 2) + 110;
-    if ((ret = ff_alloc_packet(pkt, size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
-        return ret;
-    }
-
-    buf = pkt->data;
-    ptr = p->data[0];
-
-    buf += snprintf(buf, 32, "#define image_width %u\n", avctx->width);
-    buf += snprintf(buf, 33, "#define image_height %u\n", avctx->height);
-    buf += snprintf(buf, 40, "static unsigned char image_bits[] = {\n");
-    for (i = 0; i < avctx->height; i++) {
-        for (j = 0; j < linesize; j++)
-            buf += snprintf(buf, 7, " 0x%02X,", ff_reverse[*ptr++]);
-        ptr += p->linesize[0] - linesize;
-        buf += snprintf(buf, 2, "\n");
-    }
-    buf += snprintf(buf, 5, " };\n");
-
-    pkt->size   = buf - pkt->data;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-static av_cold int xbm_encode_close(AVCodecContext *avctx)
-{
-    av_freep(&avctx->coded_frame);
-
-    return 0;
-}
-
-AVCodec ff_xbm_encoder = {
-    .name         = "xbm",
-    .long_name    = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
-    .type         = AVMEDIA_TYPE_VIDEO,
-    .id           = AV_CODEC_ID_XBM,
-    .init         = xbm_encode_init,
-    .encode2      = xbm_encode_frame,
-    .close        = xbm_encode_close,
-    .pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE,
-                                                 AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/xiph.c b/deps/libav/libavcodec/xiph.c
deleted file mode 100644
index 7c3c710..0000000
--- a/deps/libav/libavcodec/xiph.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2007  Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "xiph.h"
-
-int avpriv_split_xiph_headers(uint8_t *extradata, int extradata_size,
-                          int first_header_size, uint8_t *header_start[3],
-                          int header_len[3])
-{
-    int i;
-
-    if (extradata_size >= 6 && AV_RB16(extradata) == first_header_size) {
-        int overall_len = 6;
-        for (i=0; i<3; i++) {
-            header_len[i] = AV_RB16(extradata);
-            extradata += 2;
-            header_start[i] = extradata;
-            extradata += header_len[i];
-            if (overall_len > extradata_size - header_len[i])
-                return -1;
-            overall_len += header_len[i];
-        }
-    } else if (extradata_size >= 3 && extradata_size < INT_MAX - 0x1ff && extradata[0] == 2) {
-        int overall_len = 3;
-        extradata++;
-        for (i=0; i<2; i++, extradata++) {
-            header_len[i] = 0;
-            for (; overall_len < extradata_size && *extradata==0xff; extradata++) {
-                header_len[i] += 0xff;
-                overall_len   += 0xff + 1;
-            }
-            header_len[i] += *extradata;
-            overall_len   += *extradata;
-            if (overall_len > extradata_size)
-                return -1;
-        }
-        header_len[2] = extradata_size - overall_len;
-        header_start[0] = extradata;
-        header_start[1] = header_start[0] + header_len[0];
-        header_start[2] = header_start[1] + header_len[1];
-    } else {
-        return -1;
-    }
-    return 0;
-}
diff --git a/deps/libav/libavcodec/xiph.h b/deps/libav/libavcodec/xiph.h
deleted file mode 100644
index afaece7..0000000
--- a/deps/libav/libavcodec/xiph.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2007  Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_XIPH_H
-#define AVCODEC_XIPH_H
-
-#include "libavutil/common.h"
-
-/**
- * Split a single extradata buffer into the three headers that most
- * Xiph codecs use. (e.g. Theora and Vorbis)
- * Works both with Matroska's packing and lavc's packing.
- *
- * @param[in] extradata The single chunk that combines all three headers
- * @param[in] extradata_size The size of the extradata buffer
- * @param[in] first_header_size The size of the first header, used to
- * differentiate between the Matroska packing and lavc packing.
- * @param[out] header_start Pointers to the start of the three separate headers.
- * @param[out] header_len The sizes of each of the three headers.
- * @return On error a negative value is returned, on success zero.
- */
-int avpriv_split_xiph_headers(uint8_t *extradata, int extradata_size,
-                              int first_header_size, uint8_t *header_start[3],
-                              int header_len[3]);
-
-#endif /* AVCODEC_XIPH_H */
diff --git a/deps/libav/libavcodec/xl.c b/deps/libav/libavcodec/xl.c
deleted file mode 100644
index 8e9bdc6..0000000
--- a/deps/libav/libavcodec/xl.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Miro VideoXL codec
- * Copyright (c) 2004 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Miro VideoXL codec.
- */
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-static const int xl_table[32] = {
-   0,   1,   2,   3,   4,   5,   6,   7,
-   8,   9,  12,  15,  20,  25,  34,  46,
-  64,  82,  94, 103, 108, 113, 116, 119,
- 120, 121, 122, 123, 124, 125, 126, 127
-};
-
-static int decode_frame(AVCodecContext *avctx,
-                        void *data, int *got_frame,
-                        AVPacket *avpkt)
-{
-    const uint8_t *buf = avpkt->data;
-    int buf_size       = avpkt->size;
-    AVFrame *const p   = data;
-    uint8_t *Y, *U, *V;
-    int i, j, ret;
-    int stride;
-    uint32_t val;
-    int y0, y1, y2, y3 = 0, c0 = 0, c1 = 0;
-
-    if (avctx->width % 4) {
-        av_log(avctx, AV_LOG_ERROR, "Width not a multiple of 4.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (buf_size < avctx->width * avctx->height) {
-        av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-    p->pict_type = AV_PICTURE_TYPE_I;
-    p->key_frame = 1;
-
-    Y = p->data[0];
-    U = p->data[1];
-    V = p->data[2];
-
-    stride = avctx->width - 4;
-
-    for (i = 0; i < avctx->height; i++) {
-        /* lines are stored in reversed order */
-        buf += stride;
-
-        for (j = 0; j < avctx->width; j += 4) {
-            /* value is stored in LE dword with word swapped */
-            val  = AV_RL32(buf);
-            buf -= 4;
-            val  = ((val >> 16) & 0xFFFF) | ((val & 0xFFFF) << 16);
-
-            if (!j)
-                y0 = (val & 0x1F) << 2;
-            else
-                y0 = y3 + xl_table[val & 0x1F];
-            val >>= 5;
-            y1    = y0 + xl_table[val & 0x1F];
-            val >>= 5;
-            y2    = y1 + xl_table[val & 0x1F];
-            val >>= 6; /* align to word */
-            y3    = y2 + xl_table[val & 0x1F];
-            val >>= 5;
-            if (!j)
-                c0 = (val & 0x1F) << 2;
-            else
-                c0 += xl_table[val & 0x1F];
-            val >>= 5;
-            if (!j)
-                c1 = (val & 0x1F) << 2;
-            else
-                c1 += xl_table[val & 0x1F];
-
-            Y[j + 0] = y0 << 1;
-            Y[j + 1] = y1 << 1;
-            Y[j + 2] = y2 << 1;
-            Y[j + 3] = y3 << 1;
-
-            U[j >> 2] = c0 << 1;
-            V[j >> 2] = c1 << 1;
-        }
-
-        buf += avctx->width + 4;
-        Y   += p->linesize[0];
-        U   += p->linesize[1];
-        V   += p->linesize[2];
-    }
-
-    *got_frame = 1;
-
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    avctx->pix_fmt = AV_PIX_FMT_YUV411P;
-
-    return 0;
-}
-
-AVCodec ff_xl_decoder = {
-    .name         = "xl",
-    .long_name    = NULL_IF_CONFIG_SMALL("Miro VideoXL"),
-    .type         = AVMEDIA_TYPE_VIDEO,
-    .id           = AV_CODEC_ID_VIXL,
-    .init         = decode_init,
-    .decode       = decode_frame,
-    .capabilities = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/xsubdec.c b/deps/libav/libavcodec/xsubdec.c
deleted file mode 100644
index 3d85973..0000000
--- a/deps/libav/libavcodec/xsubdec.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * XSUB subtitle decoder
- * Copyright (c) 2007 Reimar Döffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mathematics.h"
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "get_bits.h"
-#include "bytestream.h"
-
-static av_cold int decode_init(AVCodecContext *avctx) {
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-    return 0;
-}
-
-static const uint8_t tc_offsets[9] = { 0, 1, 3, 4, 6, 7, 9, 10, 11 };
-static const uint8_t tc_muls[9] = { 10, 6, 10, 6, 10, 10, 10, 10, 1 };
-
-static int64_t parse_timecode(const uint8_t *buf, int64_t packet_time) {
-    int i;
-    int64_t ms = 0;
-    if (buf[2] != ':' || buf[5] != ':' || buf[8] != '.')
-        return AV_NOPTS_VALUE;
-    for (i = 0; i < sizeof(tc_offsets); i++) {
-        uint8_t c = buf[tc_offsets[i]] - '0';
-        if (c > 9) return AV_NOPTS_VALUE;
-        ms = (ms + c) * tc_muls[i];
-    }
-    return ms - packet_time;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
-                        AVPacket *avpkt) {
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    AVSubtitle *sub = data;
-    const uint8_t *buf_end = buf + buf_size;
-    uint8_t *bitmap;
-    int w, h, x, y, i;
-    int64_t packet_time = 0;
-    GetBitContext gb;
-
-    memset(sub, 0, sizeof(*sub));
-
-    // check that at least header fits
-    if (buf_size < 27 + 7 * 2 + 4 * 3) {
-        av_log(avctx, AV_LOG_ERROR, "coded frame too small\n");
-        return -1;
-    }
-
-    // read start and end time
-    if (buf[0] != '[' || buf[13] != '-' || buf[26] != ']') {
-        av_log(avctx, AV_LOG_ERROR, "invalid time code\n");
-        return -1;
-    }
-    if (avpkt->pts != AV_NOPTS_VALUE)
-        packet_time = av_rescale_q(avpkt->pts, AV_TIME_BASE_Q, (AVRational){1, 1000});
-    sub->start_display_time = parse_timecode(buf +  1, packet_time);
-    sub->end_display_time   = parse_timecode(buf + 14, packet_time);
-    buf += 27;
-
-    // read header
-    w = bytestream_get_le16(&buf);
-    h = bytestream_get_le16(&buf);
-    if (av_image_check_size(w, h, 0, avctx) < 0)
-        return -1;
-    x = bytestream_get_le16(&buf);
-    y = bytestream_get_le16(&buf);
-    // skip bottom right position, it gives no new information
-    bytestream_get_le16(&buf);
-    bytestream_get_le16(&buf);
-    // The following value is supposed to indicate the start offset
-    // (relative to the palette) of the data for the second field,
-    // however there are files in which it has a bogus value and thus
-    // we just ignore it
-    bytestream_get_le16(&buf);
-
-    // allocate sub and set values
-    sub->rects =  av_mallocz(sizeof(*sub->rects));
-    sub->rects[0] = av_mallocz(sizeof(*sub->rects[0]));
-    sub->num_rects = 1;
-    sub->rects[0]->x = x; sub->rects[0]->y = y;
-    sub->rects[0]->w = w; sub->rects[0]->h = h;
-    sub->rects[0]->type = SUBTITLE_BITMAP;
-    sub->rects[0]->pict.linesize[0] = w;
-    sub->rects[0]->pict.data[0] = av_malloc(w * h);
-    sub->rects[0]->nb_colors = 4;
-    sub->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
-
-    // read palette
-    for (i = 0; i < sub->rects[0]->nb_colors; i++)
-        ((uint32_t*)sub->rects[0]->pict.data[1])[i] = bytestream_get_be24(&buf);
-    // make all except background (first entry) non-transparent
-    for (i = 1; i < sub->rects[0]->nb_colors; i++)
-        ((uint32_t*)sub->rects[0]->pict.data[1])[i] |= 0xff000000;
-
-    // process RLE-compressed data
-    init_get_bits(&gb, buf, (buf_end - buf) * 8);
-    bitmap = sub->rects[0]->pict.data[0];
-    for (y = 0; y < h; y++) {
-        // interlaced: do odd lines
-        if (y == (h + 1) / 2) bitmap = sub->rects[0]->pict.data[0] + w;
-        for (x = 0; x < w; ) {
-            int log2 = ff_log2_tab[show_bits(&gb, 8)];
-            int run = get_bits(&gb, 14 - 4 * (log2 >> 1));
-            int color = get_bits(&gb, 2);
-            run = FFMIN(run, w - x);
-            // run length 0 means till end of row
-            if (!run) run = w - x;
-            memset(bitmap, color, run);
-            bitmap += run;
-            x += run;
-        }
-        // interlaced, skip every second line
-        bitmap += w;
-        align_get_bits(&gb);
-    }
-    *data_size = 1;
-    return buf_size;
-}
-
-AVCodec ff_xsub_decoder = {
-    .name      = "xsub",
-    .long_name = NULL_IF_CONFIG_SMALL("XSUB"),
-    .type      = AVMEDIA_TYPE_SUBTITLE,
-    .id        = AV_CODEC_ID_XSUB,
-    .init      = decode_init,
-    .decode    = decode_frame,
-};
diff --git a/deps/libav/libavcodec/xsubenc.c b/deps/libav/libavcodec/xsubenc.c
deleted file mode 100644
index fc46fb8..0000000
--- a/deps/libav/libavcodec/xsubenc.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * DivX (XSUB) subtitle encoder
- * Copyright (c) 2005 DivX, Inc.
- * Copyright (c) 2009 Bjorn Axelsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bytestream.h"
-#include "put_bits.h"
-
-/**
- * Number of pixels to pad left and right.
- *
- * The official encoder pads the subtitles with two pixels on either side,
- * but until we find out why, we won't do it (we will pad to have width
- * divisible by 2 though).
- */
-#define PADDING 0
-#define PADDING_COLOR 0
-
-/**
- * Encode a single color run. At most 16 bits will be used.
- * @param len   length of the run, values > 255 mean "until end of line", may not be < 0.
- * @param color color to encode, only the lowest two bits are used and all others must be 0.
- */
-static void put_xsub_rle(PutBitContext *pb, int len, int color)
-{
-    if (len <= 255)
-        put_bits(pb, 2 + ((ff_log2_tab[len] >> 1) << 2), len);
-    else
-        put_bits(pb, 14, 0);
-    put_bits(pb, 2, color);
-}
-
-/**
- * Encode a 4-color bitmap with XSUB rle.
- *
- * The encoded bitmap may be wider than the source bitmap due to padding.
- */
-static int xsub_encode_rle(PutBitContext *pb, const uint8_t *bitmap,
-                           int linesize, int w, int h)
-{
-    int x0, x1, y, len, color = PADDING_COLOR;
-
-    for (y = 0; y < h; y++) {
-        x0 = 0;
-        while (x0 < w) {
-            // Make sure we have enough room for at least one run and padding
-            if (pb->size_in_bits - put_bits_count(pb) < 7*8)
-                return -1;
-
-            x1 = x0;
-            color = bitmap[x1++] & 3;
-            while (x1 < w && (bitmap[x1] & 3) == color)
-                x1++;
-            len = x1 - x0;
-            if (PADDING && x0 == 0) {
-                if (color == PADDING_COLOR) {
-                    len += PADDING;
-                    x0  -= PADDING;
-                } else
-                    put_xsub_rle(pb, PADDING, PADDING_COLOR);
-            }
-
-            // Run can't be longer than 255, unless it is the rest of a row
-            if (x1 == w && color == PADDING_COLOR) {
-                len += PADDING + (w&1);
-            } else
-                len = FFMIN(len, 255);
-            put_xsub_rle(pb, len, color);
-
-            x0 += len;
-        }
-        if (color != PADDING_COLOR && (PADDING + (w&1)))
-            put_xsub_rle(pb, PADDING + (w&1), PADDING_COLOR);
-
-        avpriv_align_put_bits(pb);
-
-        bitmap += linesize;
-    }
-
-    return 0;
-}
-
-static int make_tc(uint64_t ms, int *tc)
-{
-    static const int tc_divs[3] = { 1000, 60, 60 };
-    int i;
-    for (i=0; i<3; i++) {
-        tc[i] = ms % tc_divs[i];
-        ms /= tc_divs[i];
-    }
-    tc[3] = ms;
-    return ms > 99;
-}
-
-static int xsub_encode(AVCodecContext *avctx, unsigned char *buf,
-                       int bufsize, const AVSubtitle *h)
-{
-    uint64_t startTime = h->pts / 1000; // FIXME: need better solution...
-    uint64_t endTime = startTime + h->end_display_time - h->start_display_time;
-    int start_tc[4], end_tc[4];
-    uint8_t *hdr = buf + 27; // Point behind the timestamp
-    uint8_t *rlelenptr;
-    uint16_t width, height;
-    int i;
-    PutBitContext pb;
-
-    if (bufsize < 27 + 7*2 + 4*3) {
-        av_log(avctx, AV_LOG_ERROR, "Buffer too small for XSUB header.\n");
-        return -1;
-    }
-
-    // TODO: support multiple rects
-    if (h->num_rects > 1)
-        av_log(avctx, AV_LOG_WARNING, "Only single rects supported (%d in subtitle.)\n", h->num_rects);
-
-    // TODO: render text-based subtitles into bitmaps
-    if (!h->rects[0]->pict.data[0] || !h->rects[0]->pict.data[1]) {
-        av_log(avctx, AV_LOG_WARNING, "No subtitle bitmap available.\n");
-        return -1;
-    }
-
-    // TODO: color reduction, similar to dvdsub encoder
-    if (h->rects[0]->nb_colors > 4)
-        av_log(avctx, AV_LOG_WARNING, "No more than 4 subtitle colors supported (%d found.)\n", h->rects[0]->nb_colors);
-
-    // TODO: Palette swapping if color zero is not transparent
-    if (((uint32_t *)h->rects[0]->pict.data[1])[0] & 0xff)
-        av_log(avctx, AV_LOG_WARNING, "Color index 0 is not transparent. Transparency will be messed up.\n");
-
-    if (make_tc(startTime, start_tc) || make_tc(endTime, end_tc)) {
-        av_log(avctx, AV_LOG_WARNING, "Time code >= 100 hours.\n");
-        return -1;
-    }
-
-    snprintf(buf, 28,
-        "[%02d:%02d:%02d.%03d-%02d:%02d:%02d.%03d]",
-        start_tc[3], start_tc[2], start_tc[1], start_tc[0],
-        end_tc[3],   end_tc[2],   end_tc[1],   end_tc[0]);
-
-    // Width and height must probably be multiples of 2.
-    // 2 pixels required on either side of subtitle.
-    // Possibly due to limitations of hardware renderers.
-    // TODO: check if the bitmap is already padded
-    width  = FFALIGN(h->rects[0]->w, 2) + PADDING * 2;
-    height = FFALIGN(h->rects[0]->h, 2);
-
-    bytestream_put_le16(&hdr, width);
-    bytestream_put_le16(&hdr, height);
-    bytestream_put_le16(&hdr, h->rects[0]->x);
-    bytestream_put_le16(&hdr, h->rects[0]->y);
-    bytestream_put_le16(&hdr, h->rects[0]->x + width);
-    bytestream_put_le16(&hdr, h->rects[0]->y + height);
-
-    rlelenptr = hdr; // Will store length of first field here later.
-    hdr+=2;
-
-    // Palette
-    for (i=0; i<4; i++)
-        bytestream_put_be24(&hdr, ((uint32_t *)h->rects[0]->pict.data[1])[i]);
-
-    // Bitmap
-    // RLE buffer. Reserve 2 bytes for possible padding after the last row.
-    init_put_bits(&pb, hdr, bufsize - (hdr - buf) - 2);
-    if (xsub_encode_rle(&pb, h->rects[0]->pict.data[0],
-                        h->rects[0]->pict.linesize[0]*2,
-                        h->rects[0]->w, (h->rects[0]->h + 1) >> 1))
-        return -1;
-    bytestream_put_le16(&rlelenptr, put_bits_count(&pb) >> 3); // Length of first field
-
-    if (xsub_encode_rle(&pb, h->rects[0]->pict.data[0] + h->rects[0]->pict.linesize[0],
-                        h->rects[0]->pict.linesize[0]*2,
-                        h->rects[0]->w, h->rects[0]->h >> 1))
-        return -1;
-
-    // Enforce total height to be be multiple of 2
-    if (h->rects[0]->h & 1) {
-        put_xsub_rle(&pb, h->rects[0]->w, PADDING_COLOR);
-        avpriv_align_put_bits(&pb);
-    }
-
-    flush_put_bits(&pb);
-
-    return hdr - buf + put_bits_count(&pb)/8;
-}
-
-static av_cold int xsub_encoder_init(AVCodecContext *avctx)
-{
-    if (!avctx->codec_tag)
-        avctx->codec_tag = MKTAG('D','X','S','B');
-
-    return 0;
-}
-
-AVCodec ff_xsub_encoder = {
-    .name       = "xsub",
-    .long_name  = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"),
-    .type       = AVMEDIA_TYPE_SUBTITLE,
-    .id         = AV_CODEC_ID_XSUB,
-    .init       = xsub_encoder_init,
-    .encode_sub = xsub_encode,
-};
diff --git a/deps/libav/libavcodec/xvmc.h b/deps/libav/libavcodec/xvmc.h
deleted file mode 100644
index 950ed18..0000000
--- a/deps/libav/libavcodec/xvmc.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2003 Ivan Kalvachev
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_XVMC_H
-#define AVCODEC_XVMC_H
-
-/**
- * @file
- * @ingroup lavc_codec_hwaccel_xvmc
- * Public libavcodec XvMC header.
- */
-
-#include <X11/extensions/XvMC.h>
-
-#include "libavutil/attributes.h"
-#include "version.h"
-#include "avcodec.h"
-
-#if FF_API_XVMC
-
-/**
- * @defgroup lavc_codec_hwaccel_xvmc XvMC
- * @ingroup lavc_codec_hwaccel
- *
- * @{
- */
-
-#define AV_XVMC_ID                    0x1DC711C0  /**< special value to ensure that regular pixel routines haven't corrupted the struct
-                                                       the number is 1337 speak for the letters IDCT MCo (motion compensation) */
-
-attribute_deprecated struct xvmc_pix_fmt {
-    /** The field contains the special constant value AV_XVMC_ID.
-        It is used as a test that the application correctly uses the API,
-        and that there is no corruption caused by pixel routines.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             xvmc_id;
-
-    /** Pointer to the block array allocated by XvMCCreateBlocks().
-        The array has to be freed by XvMCDestroyBlocks().
-        Each group of 64 values represents one data block of differential
-        pixel information (in MoCo mode) or coefficients for IDCT.
-        - application - set the pointer during initialization
-        - libavcodec  - fills coefficients/pixel data into the array
-    */
-    short*          data_blocks;
-
-    /** Pointer to the macroblock description array allocated by
-        XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
-        - application - set the pointer during initialization
-        - libavcodec  - fills description data into the array
-    */
-    XvMCMacroBlock* mv_blocks;
-
-    /** Number of macroblock descriptions that can be stored in the mv_blocks
-        array.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             allocated_mv_blocks;
-
-    /** Number of blocks that can be stored at once in the data_blocks array.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             allocated_data_blocks;
-
-    /** Indicate that the hardware would interpret data_blocks as IDCT
-        coefficients and perform IDCT on them.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             idct;
-
-    /** In MoCo mode it indicates that intra macroblocks are assumed to be in
-        unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             unsigned_intra;
-
-    /** Pointer to the surface allocated by XvMCCreateSurface().
-        It has to be freed by XvMCDestroySurface() on application exit.
-        It identifies the frame and its state on the video hardware.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    XvMCSurface*    p_surface;
-
-/** Set by the decoder before calling ff_draw_horiz_band(),
-    needed by the XvMCRenderSurface function. */
-//@{
-    /** Pointer to the surface used as past reference
-        - application - unchanged
-        - libavcodec  - set
-    */
-    XvMCSurface*    p_past_surface;
-
-    /** Pointer to the surface used as future reference
-        - application - unchanged
-        - libavcodec  - set
-    */
-    XvMCSurface*    p_future_surface;
-
-    /** top/bottom field or frame
-        - application - unchanged
-        - libavcodec  - set
-    */
-    unsigned int    picture_structure;
-
-    /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
-        - application - unchanged
-        - libavcodec  - set
-    */
-    unsigned int    flags;
-//}@
-
-    /** Number of macroblock descriptions in the mv_blocks array
-        that have already been passed to the hardware.
-        - application - zeroes it on get_buffer().
-                        A successful ff_draw_horiz_band() may increment it
-                        with filled_mb_block_num or zero both.
-        - libavcodec  - unchanged
-    */
-    int             start_mv_blocks_num;
-
-    /** Number of new macroblock descriptions in the mv_blocks array (after
-        start_mv_blocks_num) that are filled by libavcodec and have to be
-        passed to the hardware.
-        - application - zeroes it on get_buffer() or after successful
-                        ff_draw_horiz_band().
-        - libavcodec  - increment with one of each stored MB
-    */
-    int             filled_mv_blocks_num;
-
-    /** Number of the next free data block; one data block consists of
-        64 short values in the data_blocks array.
-        All blocks before this one have already been claimed by placing their
-        position into the corresponding block description structure field,
-        that are part of the mv_blocks array.
-        - application - zeroes it on get_buffer().
-                        A successful ff_draw_horiz_band() may zero it together
-                        with start_mb_blocks_num.
-        - libavcodec  - each decoded macroblock increases it by the number
-                        of coded blocks it contains.
-    */
-    int             next_free_data_block_num;
-};
-
-/**
- * @}
- */
-
-#endif /* FF_API_XVMC */
-
-#endif /* AVCODEC_XVMC_H */
diff --git a/deps/libav/libavcodec/xvmc_internal.h b/deps/libav/libavcodec/xvmc_internal.h
deleted file mode 100644
index 9018e4a..0000000
--- a/deps/libav/libavcodec/xvmc_internal.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * XVideo Motion Compensation internal functions
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_XVMC_INTERNAL_H
-#define AVCODEC_XVMC_INTERNAL_H
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "version.h"
-
-#if FF_API_XVMC
-
-void ff_xvmc_init_block(MpegEncContext *s);
-void ff_xvmc_pack_pblocks(MpegEncContext *s, int cbp);
-int  ff_xvmc_field_start(MpegEncContext*s, AVCodecContext *avctx);
-void ff_xvmc_field_end(MpegEncContext *s);
-void ff_xvmc_decode_mb(MpegEncContext *s);
-
-#endif /* FF_API_XVMC */
-
-#endif /* AVCODEC_XVMC_INTERNAL_H */
diff --git a/deps/libav/libavcodec/xwd.h b/deps/libav/libavcodec/xwd.h
deleted file mode 100644
index f41e2cd..0000000
--- a/deps/libav/libavcodec/xwd.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * XWD image format
- *
- * Copyright (c) 2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_XWD_H
-#define AVCODEC_XWD_H
-
-#define XWD_VERSION         7
-#define XWD_HEADER_SIZE     100
-#define XWD_CMAP_SIZE       12
-
-#define XWD_XY_BITMAP       0
-#define XWD_XY_PIXMAP       1
-#define XWD_Z_PIXMAP        2
-
-#define XWD_STATIC_GRAY     0
-#define XWD_GRAY_SCALE      1
-#define XWD_STATIC_COLOR    2
-#define XWD_PSEUDO_COLOR    3
-#define XWD_TRUE_COLOR      4
-#define XWD_DIRECT_COLOR    5
-
-#endif /* AVCODEC_XWD_H */
diff --git a/deps/libav/libavcodec/xwddec.c b/deps/libav/libavcodec/xwddec.c
deleted file mode 100644
index 8963c96..0000000
--- a/deps/libav/libavcodec/xwddec.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * XWD image format
- *
- * Copyright (c) 2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/imgutils.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "xwd.h"
-
-static int xwd_decode_frame(AVCodecContext *avctx, void *data,
-                            int *got_frame, AVPacket *avpkt)
-{
-    AVFrame *p = data;
-    const uint8_t *buf = avpkt->data;
-    int i, ret, buf_size = avpkt->size;
-    uint32_t version, header_size, vclass, ncolors;
-    uint32_t xoffset, be, bpp, lsize, rsize;
-    uint32_t pixformat, pixdepth, bunit, bitorder, bpad;
-    uint32_t rgb[3];
-    uint8_t *ptr;
-    GetByteContext gb;
-
-    if (buf_size < XWD_HEADER_SIZE)
-        return AVERROR_INVALIDDATA;
-
-    bytestream2_init(&gb, buf, buf_size);
-    header_size = bytestream2_get_be32u(&gb);
-
-    version = bytestream2_get_be32u(&gb);
-    if (version != XWD_VERSION) {
-        av_log(avctx, AV_LOG_ERROR, "unsupported version\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (buf_size < header_size || header_size < XWD_HEADER_SIZE) {
-        av_log(avctx, AV_LOG_ERROR, "invalid header size\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    pixformat     = bytestream2_get_be32u(&gb);
-    pixdepth      = bytestream2_get_be32u(&gb);
-    avctx->width  = bytestream2_get_be32u(&gb);
-    avctx->height = bytestream2_get_be32u(&gb);
-    xoffset       = bytestream2_get_be32u(&gb);
-    be            = bytestream2_get_be32u(&gb);
-    bunit         = bytestream2_get_be32u(&gb);
-    bitorder      = bytestream2_get_be32u(&gb);
-    bpad          = bytestream2_get_be32u(&gb);
-    bpp           = bytestream2_get_be32u(&gb);
-    lsize         = bytestream2_get_be32u(&gb);
-    vclass        = bytestream2_get_be32u(&gb);
-    rgb[0]        = bytestream2_get_be32u(&gb);
-    rgb[1]        = bytestream2_get_be32u(&gb);
-    rgb[2]        = bytestream2_get_be32u(&gb);
-    bytestream2_skipu(&gb, 8);
-    ncolors       = bytestream2_get_be32u(&gb);
-    bytestream2_skipu(&gb, header_size - (XWD_HEADER_SIZE - 20));
-
-    av_log(avctx, AV_LOG_DEBUG, "pixformat %d, pixdepth %d, bunit %d, bitorder %d, bpad %d\n",
-           pixformat, pixdepth, bunit, bitorder, bpad);
-    av_log(avctx, AV_LOG_DEBUG, "vclass %d, ncolors %d, bpp %d, be %d, lsize %d, xoffset %d\n",
-           vclass, ncolors, bpp, be, lsize, xoffset);
-    av_log(avctx, AV_LOG_DEBUG, "red %0x, green %0x, blue %0x\n", rgb[0], rgb[1], rgb[2]);
-
-    if (pixformat > XWD_Z_PIXMAP) {
-        av_log(avctx, AV_LOG_ERROR, "invalid pixmap format\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (pixdepth == 0 || pixdepth > 32) {
-        av_log(avctx, AV_LOG_ERROR, "invalid pixmap depth\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (xoffset) {
-        avpriv_request_sample(avctx, "xoffset %d", xoffset);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (be > 1) {
-        av_log(avctx, AV_LOG_ERROR, "invalid byte order\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (bitorder > 1) {
-        av_log(avctx, AV_LOG_ERROR, "invalid bitmap bit order\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (bunit != 8 && bunit != 16 && bunit != 32) {
-        av_log(avctx, AV_LOG_ERROR, "invalid bitmap unit\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (bpad != 8 && bpad != 16 && bpad != 32) {
-        av_log(avctx, AV_LOG_ERROR, "invalid bitmap scan-line pad\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (bpp == 0 || bpp > 32) {
-        av_log(avctx, AV_LOG_ERROR, "invalid bits per pixel\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (ncolors > 256) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of entries in colormap\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = av_image_check_size(avctx->width, avctx->height, 0, NULL)) < 0)
-        return ret;
-
-    rsize = FFALIGN(avctx->width * bpp, bpad) / 8;
-    if (lsize < rsize) {
-        av_log(avctx, AV_LOG_ERROR, "invalid bytes per scan-line\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (bytestream2_get_bytes_left(&gb) < ncolors * XWD_CMAP_SIZE + avctx->height * lsize) {
-        av_log(avctx, AV_LOG_ERROR, "input buffer too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (pixformat != XWD_Z_PIXMAP) {
-        av_log(avctx, AV_LOG_ERROR, "pixmap format %d unsupported\n", pixformat);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_NONE;
-    switch (vclass) {
-    case XWD_STATIC_GRAY:
-    case XWD_GRAY_SCALE:
-        if (bpp != 1)
-            return AVERROR_INVALIDDATA;
-        if (pixdepth == 1)
-            avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
-        break;
-    case XWD_STATIC_COLOR:
-    case XWD_PSEUDO_COLOR:
-        if (bpp == 8)
-            avctx->pix_fmt = AV_PIX_FMT_PAL8;
-        break;
-    case XWD_TRUE_COLOR:
-    case XWD_DIRECT_COLOR:
-        if (bpp != 16 && bpp != 24 && bpp != 32)
-            return AVERROR_INVALIDDATA;
-        if (bpp == 16 && pixdepth == 15) {
-            if (rgb[0] == 0x7C00 && rgb[1] == 0x3E0 && rgb[2] == 0x1F)
-                avctx->pix_fmt = be ? AV_PIX_FMT_RGB555BE : AV_PIX_FMT_RGB555LE;
-            else if (rgb[0] == 0x1F && rgb[1] == 0x3E0 && rgb[2] == 0x7C00)
-                avctx->pix_fmt = be ? AV_PIX_FMT_BGR555BE : AV_PIX_FMT_BGR555LE;
-        } else if (bpp == 16 && pixdepth == 16) {
-            if (rgb[0] == 0xF800 && rgb[1] == 0x7E0 && rgb[2] == 0x1F)
-                avctx->pix_fmt = be ? AV_PIX_FMT_RGB565BE : AV_PIX_FMT_RGB565LE;
-            else if (rgb[0] == 0x1F && rgb[1] == 0x7E0 && rgb[2] == 0xF800)
-                avctx->pix_fmt = be ? AV_PIX_FMT_BGR565BE : AV_PIX_FMT_BGR565LE;
-        } else if (bpp == 24) {
-            if (rgb[0] == 0xFF0000 && rgb[1] == 0xFF00 && rgb[2] == 0xFF)
-                avctx->pix_fmt = be ? AV_PIX_FMT_RGB24 : AV_PIX_FMT_BGR24;
-            else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000)
-                avctx->pix_fmt = be ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_RGB24;
-        } else if (bpp == 32) {
-            if (rgb[0] == 0xFF0000 && rgb[1] == 0xFF00 && rgb[2] == 0xFF)
-                avctx->pix_fmt = be ? AV_PIX_FMT_ARGB : AV_PIX_FMT_BGRA;
-            else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000)
-                avctx->pix_fmt = be ? AV_PIX_FMT_ABGR : AV_PIX_FMT_RGBA;
-        }
-        bytestream2_skipu(&gb, ncolors * XWD_CMAP_SIZE);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "invalid visual class\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
-        avpriv_request_sample(avctx,
-                              "Unknown file: bpp %d, pixdepth %d, vclass %d",
-                              bpp, pixdepth, vclass);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    p->key_frame = 1;
-    p->pict_type = AV_PICTURE_TYPE_I;
-
-    if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
-        uint32_t *dst = (uint32_t *)p->data[1];
-        uint8_t red, green, blue;
-
-        for (i = 0; i < ncolors; i++) {
-
-            bytestream2_skipu(&gb, 4); // skip colormap entry number
-            red    = bytestream2_get_byteu(&gb);
-            bytestream2_skipu(&gb, 1);
-            green  = bytestream2_get_byteu(&gb);
-            bytestream2_skipu(&gb, 1);
-            blue   = bytestream2_get_byteu(&gb);
-            bytestream2_skipu(&gb, 3); // skip bitmask flag and padding
-
-            dst[i] = red << 16 | green << 8 | blue;
-        }
-    }
-
-    ptr = p->data[0];
-    for (i = 0; i < avctx->height; i++) {
-        bytestream2_get_bufferu(&gb, ptr, rsize);
-        bytestream2_skipu(&gb, lsize - rsize);
-        ptr += p->linesize[0];
-    }
-
-    *got_frame       = 1;
-
-    return buf_size;
-}
-
-AVCodec ff_xwd_decoder = {
-    .name           = "xwd",
-    .long_name      = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_XWD,
-    .decode         = xwd_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/xwdenc.c b/deps/libav/libavcodec/xwdenc.c
deleted file mode 100644
index 54599a0..0000000
--- a/deps/libav/libavcodec/xwdenc.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * XWD image format
- *
- * Copyright (c) 2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/pixdesc.h"
-#include "avcodec.h"
-#include "bytestream.h"
-#include "internal.h"
-#include "xwd.h"
-
-#define WINDOW_NAME         "lavcxwdenc"
-#define WINDOW_NAME_SIZE    11
-
-static av_cold int xwd_encode_init(AVCodecContext *avctx)
-{
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                            const AVFrame *p, int *got_packet)
-{
-    enum AVPixelFormat pix_fmt = avctx->pix_fmt;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;
-    uint32_t rgb[3] = { 0 }, bitorder = 0;
-    uint32_t header_size;
-    int i, out_size, ret;
-    uint8_t *ptr, *buf;
-
-    pixdepth = av_get_bits_per_pixel(desc);
-    if (desc->flags & AV_PIX_FMT_FLAG_BE)
-        be = 1;
-    switch (pix_fmt) {
-    case AV_PIX_FMT_ARGB:
-    case AV_PIX_FMT_BGRA:
-    case AV_PIX_FMT_RGBA:
-    case AV_PIX_FMT_ABGR:
-        if (pix_fmt == AV_PIX_FMT_ARGB ||
-            pix_fmt == AV_PIX_FMT_ABGR)
-            be = 1;
-        if (pix_fmt == AV_PIX_FMT_ABGR ||
-            pix_fmt == AV_PIX_FMT_RGBA) {
-            rgb[0] = 0xFF;
-            rgb[1] = 0xFF00;
-            rgb[2] = 0xFF0000;
-        } else {
-            rgb[0] = 0xFF0000;
-            rgb[1] = 0xFF00;
-            rgb[2] = 0xFF;
-        }
-        bpp      = 32;
-        pixdepth = 24;
-        vclass   = XWD_TRUE_COLOR;
-        bpad     = 32;
-        break;
-    case AV_PIX_FMT_BGR24:
-    case AV_PIX_FMT_RGB24:
-        if (pix_fmt == AV_PIX_FMT_RGB24)
-            be = 1;
-        bpp      = 24;
-        vclass   = XWD_TRUE_COLOR;
-        bpad     = 32;
-        rgb[0]   = 0xFF0000;
-        rgb[1]   = 0xFF00;
-        rgb[2]   = 0xFF;
-        break;
-    case AV_PIX_FMT_RGB565LE:
-    case AV_PIX_FMT_RGB565BE:
-    case AV_PIX_FMT_BGR565LE:
-    case AV_PIX_FMT_BGR565BE:
-        if (pix_fmt == AV_PIX_FMT_BGR565LE ||
-            pix_fmt == AV_PIX_FMT_BGR565BE) {
-            rgb[0] = 0x1F;
-            rgb[1] = 0x7E0;
-            rgb[2] = 0xF800;
-        } else {
-            rgb[0] = 0xF800;
-            rgb[1] = 0x7E0;
-            rgb[2] = 0x1F;
-        }
-        bpp      = 16;
-        vclass   = XWD_TRUE_COLOR;
-        bpad     = 16;
-        break;
-    case AV_PIX_FMT_RGB555LE:
-    case AV_PIX_FMT_RGB555BE:
-    case AV_PIX_FMT_BGR555LE:
-    case AV_PIX_FMT_BGR555BE:
-        if (pix_fmt == AV_PIX_FMT_BGR555LE ||
-            pix_fmt == AV_PIX_FMT_BGR555BE) {
-            rgb[0] = 0x1F;
-            rgb[1] = 0x3E0;
-            rgb[2] = 0x7C00;
-        } else {
-            rgb[0] = 0x7C00;
-            rgb[1] = 0x3E0;
-            rgb[2] = 0x1F;
-        }
-        bpp      = 16;
-        vclass   = XWD_TRUE_COLOR;
-        bpad     = 16;
-        break;
-    case AV_PIX_FMT_RGB8:
-    case AV_PIX_FMT_BGR8:
-    case AV_PIX_FMT_RGB4_BYTE:
-    case AV_PIX_FMT_BGR4_BYTE:
-    case AV_PIX_FMT_PAL8:
-        bpp      = 8;
-        vclass   = XWD_PSEUDO_COLOR;
-        bpad     = 8;
-        ncolors  = 256;
-        break;
-    case AV_PIX_FMT_MONOWHITE:
-        be       = 1;
-        bitorder = 1;
-        bpp      = 1;
-        bpad     = 8;
-        vclass   = XWD_STATIC_GRAY;
-        break;
-    default:
-        av_log(avctx, AV_LOG_INFO, "unsupported pixel format\n");
-        return AVERROR(EINVAL);
-    }
-
-    lsize       = FFALIGN(bpp * avctx->width, bpad) / 8;
-    header_size = XWD_HEADER_SIZE + WINDOW_NAME_SIZE;
-    out_size    = header_size + ncolors * XWD_CMAP_SIZE + avctx->height * lsize;
-
-    if ((ret = ff_alloc_packet(pkt, out_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "output buffer too small\n");
-        return ret;
-    }
-    buf = pkt->data;
-
-    avctx->coded_frame->key_frame = 1;
-    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-
-    bytestream_put_be32(&buf, header_size);
-    bytestream_put_be32(&buf, XWD_VERSION);   // file version
-    bytestream_put_be32(&buf, XWD_Z_PIXMAP);  // pixmap format
-    bytestream_put_be32(&buf, pixdepth);      // pixmap depth in pixels
-    bytestream_put_be32(&buf, avctx->width);  // pixmap width in pixels
-    bytestream_put_be32(&buf, avctx->height); // pixmap height in pixels
-    bytestream_put_be32(&buf, 0);             // bitmap x offset
-    bytestream_put_be32(&buf, be);            // byte order
-    bytestream_put_be32(&buf, 32);            // bitmap unit
-    bytestream_put_be32(&buf, bitorder);      // bit-order of image data
-    bytestream_put_be32(&buf, bpad);          // bitmap scan-line pad in bits
-    bytestream_put_be32(&buf, bpp);           // bits per pixel
-    bytestream_put_be32(&buf, lsize);         // bytes per scan-line
-    bytestream_put_be32(&buf, vclass);        // visual class
-    bytestream_put_be32(&buf, rgb[0]);        // red mask
-    bytestream_put_be32(&buf, rgb[1]);        // green mask
-    bytestream_put_be32(&buf, rgb[2]);        // blue mask
-    bytestream_put_be32(&buf, 8);             // size of each bitmask in bits
-    bytestream_put_be32(&buf, ncolors);       // number of colors
-    bytestream_put_be32(&buf, ncolors);       // number of entries in color map
-    bytestream_put_be32(&buf, avctx->width);  // window width
-    bytestream_put_be32(&buf, avctx->height); // window height
-    bytestream_put_be32(&buf, 0);             // window upper left X coordinate
-    bytestream_put_be32(&buf, 0);             // window upper left Y coordinate
-    bytestream_put_be32(&buf, 0);             // window border width
-    bytestream_put_buffer(&buf, WINDOW_NAME, WINDOW_NAME_SIZE);
-
-    for (i = 0; i < ncolors; i++) {
-        uint32_t val;
-        uint8_t red, green, blue;
-
-        val   = AV_RN32A(p->data[1] + i * 4);
-        red   = (val >> 16) & 0xFF;
-        green = (val >>  8) & 0xFF;
-        blue  =  val        & 0xFF;
-
-        bytestream_put_be32(&buf, i);         // colormap entry number
-        bytestream_put_be16(&buf, red   << 8);
-        bytestream_put_be16(&buf, green << 8);
-        bytestream_put_be16(&buf, blue  << 8);
-        bytestream_put_byte(&buf, 0x7);       // bitmask flag
-        bytestream_put_byte(&buf, 0);         // padding
-    }
-
-    ptr = p->data[0];
-    for (i = 0; i < avctx->height; i++) {
-        bytestream_put_buffer(&buf, ptr, lsize);
-        ptr += p->linesize[0];
-    }
-
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    *got_packet = 1;
-    return 0;
-}
-
-static av_cold int xwd_encode_close(AVCodecContext *avctx)
-{
-    av_freep(&avctx->coded_frame);
-
-    return 0;
-}
-
-AVCodec ff_xwd_encoder = {
-    .name         = "xwd",
-    .long_name    = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),
-    .type         = AVMEDIA_TYPE_VIDEO,
-    .id           = AV_CODEC_ID_XWD,
-    .init         = xwd_encode_init,
-    .encode2      = xwd_encode_frame,
-    .close        = xwd_encode_close,
-    .pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGRA,
-                                                 AV_PIX_FMT_RGBA,
-                                                 AV_PIX_FMT_ARGB,
-                                                 AV_PIX_FMT_ABGR,
-                                                 AV_PIX_FMT_RGB24,
-                                                 AV_PIX_FMT_BGR24,
-                                                 AV_PIX_FMT_RGB565BE,
-                                                 AV_PIX_FMT_RGB565LE,
-                                                 AV_PIX_FMT_BGR565BE,
-                                                 AV_PIX_FMT_BGR565LE,
-                                                 AV_PIX_FMT_RGB555BE,
-                                                 AV_PIX_FMT_RGB555LE,
-                                                 AV_PIX_FMT_BGR555BE,
-                                                 AV_PIX_FMT_BGR555LE,
-                                                 AV_PIX_FMT_RGB8,
-                                                 AV_PIX_FMT_BGR8,
-                                                 AV_PIX_FMT_RGB4_BYTE,
-                                                 AV_PIX_FMT_BGR4_BYTE,
-                                                 AV_PIX_FMT_PAL8,
-                                                 AV_PIX_FMT_MONOWHITE,
-                                                 AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavcodec/xxan.c b/deps/libav/libavcodec/xxan.c
deleted file mode 100644
index d77a50f..0000000
--- a/deps/libav/libavcodec/xxan.c
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * Wing Commander/Xan Video Decoder
- * Copyright (C) 2011 Konstantin Shishkov
- * based on work by Mike Melanson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mem.h"
-#include "bytestream.h"
-#define BITSTREAM_READER_LE
-#include "get_bits.h"
-#include "internal.h"
-
-typedef struct XanContext {
-    AVCodecContext *avctx;
-    AVFrame *pic;
-
-    uint8_t *y_buffer;
-    uint8_t *scratch_buffer;
-    int     buffer_size;
-    GetByteContext gb;
-} XanContext;
-
-static av_cold int xan_decode_end(AVCodecContext *avctx)
-{
-    XanContext *s = avctx->priv_data;
-
-    av_frame_free(&s->pic);
-
-    av_freep(&s->y_buffer);
-    av_freep(&s->scratch_buffer);
-
-    return 0;
-}
-
-static av_cold int xan_decode_init(AVCodecContext *avctx)
-{
-    XanContext *s = avctx->priv_data;
-
-    s->avctx = avctx;
-
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    if (avctx->height < 8) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame height: %d.\n", avctx->height);
-        return AVERROR(EINVAL);
-    }
-    if (avctx->width & 1) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid frame width: %d.\n", avctx->width);
-        return AVERROR(EINVAL);
-    }
-
-    s->buffer_size = avctx->width * avctx->height;
-    s->y_buffer = av_malloc(s->buffer_size);
-    if (!s->y_buffer)
-        return AVERROR(ENOMEM);
-    s->scratch_buffer = av_malloc(s->buffer_size + 130);
-    if (!s->scratch_buffer) {
-        av_freep(&s->y_buffer);
-        return AVERROR(ENOMEM);
-    }
-
-    s->pic = av_frame_alloc();
-    if (!s->pic) {
-        xan_decode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-static int xan_unpack_luma(XanContext *s,
-                           uint8_t *dst, const int dst_size)
-{
-    int tree_size, eof;
-    int bits, mask;
-    int tree_root, node;
-    const uint8_t *dst_end = dst + dst_size;
-    GetByteContext tree = s->gb;
-    int start_off = bytestream2_tell(&tree);
-
-    tree_size = bytestream2_get_byte(&s->gb);
-    eof       = bytestream2_get_byte(&s->gb);
-    tree_root = eof + tree_size;
-    bytestream2_skip(&s->gb, tree_size * 2);
-
-    node = tree_root;
-    bits = bytestream2_get_byte(&s->gb);
-    mask = 0x80;
-    for (;;) {
-        int bit = !!(bits & mask);
-        mask >>= 1;
-        bytestream2_seek(&tree, start_off + node*2 + bit - eof * 2, SEEK_SET);
-        node = bytestream2_get_byte(&tree);
-        if (node == eof)
-            break;
-        if (node < eof) {
-            *dst++ = node;
-            if (dst > dst_end)
-                break;
-            node = tree_root;
-        }
-        if (!mask) {
-            if (bytestream2_get_bytes_left(&s->gb) <= 0)
-                break;
-            bits = bytestream2_get_byteu(&s->gb);
-            mask = 0x80;
-        }
-    }
-    return dst != dst_end ? AVERROR_INVALIDDATA : 0;
-}
-
-/* almost the same as in xan_wc3 decoder */
-static int xan_unpack(XanContext *s,
-                      uint8_t *dest, const int dest_len)
-{
-    uint8_t opcode;
-    int size;
-    uint8_t *orig_dest = dest;
-    const uint8_t *dest_end = dest + dest_len;
-
-    while (dest < dest_end) {
-        if (bytestream2_get_bytes_left(&s->gb) <= 0)
-            return AVERROR_INVALIDDATA;
-
-        opcode = bytestream2_get_byteu(&s->gb);
-
-        if (opcode < 0xe0) {
-            int size2, back;
-            if ((opcode & 0x80) == 0) {
-                size  = opcode & 3;
-                back  = ((opcode & 0x60) << 3) + bytestream2_get_byte(&s->gb) + 1;
-                size2 = ((opcode & 0x1c) >> 2) + 3;
-            } else if ((opcode & 0x40) == 0) {
-                size  = bytestream2_peek_byte(&s->gb) >> 6;
-                back  = (bytestream2_get_be16(&s->gb) & 0x3fff) + 1;
-                size2 = (opcode & 0x3f) + 4;
-            } else {
-                size  = opcode & 3;
-                back  = ((opcode & 0x10) << 12) + bytestream2_get_be16(&s->gb) + 1;
-                size2 = ((opcode & 0x0c) <<  6) + bytestream2_get_byte(&s->gb) + 5;
-                if (size + size2 > dest_end - dest)
-                    break;
-            }
-            if (dest + size + size2 > dest_end ||
-                dest - orig_dest + size < back)
-                return AVERROR_INVALIDDATA;
-            bytestream2_get_buffer(&s->gb, dest, size);
-            dest += size;
-            av_memcpy_backptr(dest, back, size2);
-            dest += size2;
-        } else {
-            int finish = opcode >= 0xfc;
-
-            size = finish ? opcode & 3 : ((opcode & 0x1f) << 2) + 4;
-            if (dest_end - dest < size)
-                return AVERROR_INVALIDDATA;
-            bytestream2_get_buffer(&s->gb, dest, size);
-            dest += size;
-            if (finish)
-                break;
-        }
-    }
-    return dest - orig_dest;
-}
-
-static int xan_decode_chroma(AVCodecContext *avctx, unsigned chroma_off)
-{
-    XanContext *s = avctx->priv_data;
-    uint8_t *U, *V;
-    int val, uval, vval;
-    int i, j;
-    const uint8_t *src, *src_end;
-    const uint8_t *table;
-    int mode, offset, dec_size, table_size;
-
-    if (!chroma_off)
-        return 0;
-    if (chroma_off + 4 >= bytestream2_get_bytes_left(&s->gb)) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid chroma block position\n");
-        return AVERROR_INVALIDDATA;
-    }
-    bytestream2_seek(&s->gb, chroma_off + 4, SEEK_SET);
-    mode        = bytestream2_get_le16(&s->gb);
-    table       = s->gb.buffer;
-    table_size  = bytestream2_get_le16(&s->gb);
-    offset      = table_size * 2;
-    table_size += 1;
-
-    if (offset >= bytestream2_get_bytes_left(&s->gb)) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid chroma block offset\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    bytestream2_skip(&s->gb, offset);
-    memset(s->scratch_buffer, 0, s->buffer_size);
-    dec_size = xan_unpack(s, s->scratch_buffer, s->buffer_size);
-    if (dec_size < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Chroma unpacking failed\n");
-        return dec_size;
-    }
-
-    U = s->pic->data[1];
-    V = s->pic->data[2];
-    src     = s->scratch_buffer;
-    src_end = src + dec_size;
-    if (mode) {
-        for (j = 0; j < avctx->height >> 1; j++) {
-            for (i = 0; i < avctx->width >> 1; i++) {
-                val = *src++;
-                if (val && val < table_size) {
-                    val  = AV_RL16(table + (val << 1));
-                    uval = (val >> 3) & 0xF8;
-                    vval = (val >> 8) & 0xF8;
-                    U[i] = uval | (uval >> 5);
-                    V[i] = vval | (vval >> 5);
-                }
-                if (src == src_end)
-                    return 0;
-            }
-            U += s->pic->linesize[1];
-            V += s->pic->linesize[2];
-        }
-        if (avctx->height & 1) {
-            memcpy(U, U - s->pic->linesize[1], avctx->width >> 1);
-            memcpy(V, V - s->pic->linesize[2], avctx->width >> 1);
-        }
-    } else {
-        uint8_t *U2 = U + s->pic->linesize[1];
-        uint8_t *V2 = V + s->pic->linesize[2];
-
-        for (j = 0; j < avctx->height >> 2; j++) {
-            for (i = 0; i < avctx->width >> 1; i += 2) {
-                val = *src++;
-                if (val && val < table_size) {
-                    val  = AV_RL16(table + (val << 1));
-                    uval = (val >> 3) & 0xF8;
-                    vval = (val >> 8) & 0xF8;
-                    U[i] = U[i+1] = U2[i] = U2[i+1] = uval | (uval >> 5);
-                    V[i] = V[i+1] = V2[i] = V2[i+1] = vval | (vval >> 5);
-                }
-            }
-            U  += s->pic->linesize[1] * 2;
-            V  += s->pic->linesize[2] * 2;
-            U2 += s->pic->linesize[1] * 2;
-            V2 += s->pic->linesize[2] * 2;
-        }
-        if (avctx->height & 3) {
-            int lines = ((avctx->height + 1) >> 1) - (avctx->height >> 2) * 2;
-
-            memcpy(U, U - lines * s->pic->linesize[1], lines * s->pic->linesize[1]);
-            memcpy(V, V - lines * s->pic->linesize[2], lines * s->pic->linesize[2]);
-        }
-    }
-
-    return 0;
-}
-
-static int xan_decode_frame_type0(AVCodecContext *avctx)
-{
-    XanContext *s = avctx->priv_data;
-    uint8_t *ybuf, *prev_buf, *src = s->scratch_buffer;
-    unsigned  chroma_off, corr_off;
-    int cur, last;
-    int i, j;
-    int ret;
-
-    chroma_off = bytestream2_get_le32(&s->gb);
-    corr_off   = bytestream2_get_le32(&s->gb);
-
-    if ((ret = xan_decode_chroma(avctx, chroma_off)) != 0)
-        return ret;
-
-    if (corr_off >= (s->gb.buffer_end - s->gb.buffer_start)) {
-        av_log(avctx, AV_LOG_WARNING, "Ignoring invalid correction block position\n");
-        corr_off = 0;
-    }
-    bytestream2_seek(&s->gb, 12, SEEK_SET);
-    ret = xan_unpack_luma(s, src, s->buffer_size >> 1);
-    if (ret) {
-        av_log(avctx, AV_LOG_ERROR, "Luma decoding failed\n");
-        return ret;
-    }
-
-    ybuf = s->y_buffer;
-    last = *src++;
-    ybuf[0] = last << 1;
-    for (j = 1; j < avctx->width - 1; j += 2) {
-        cur = (last + *src++) & 0x1F;
-        ybuf[j]   = last + cur;
-        ybuf[j+1] = cur << 1;
-        last = cur;
-    }
-    ybuf[j]  = last << 1;
-    prev_buf = ybuf;
-    ybuf += avctx->width;
-
-    for (i = 1; i < avctx->height; i++) {
-        last = ((prev_buf[0] >> 1) + *src++) & 0x1F;
-        ybuf[0] = last << 1;
-        for (j = 1; j < avctx->width - 1; j += 2) {
-            cur = ((prev_buf[j + 1] >> 1) + *src++) & 0x1F;
-            ybuf[j]   = last + cur;
-            ybuf[j+1] = cur << 1;
-            last = cur;
-        }
-        ybuf[j] = last << 1;
-        prev_buf = ybuf;
-        ybuf += avctx->width;
-    }
-
-    if (corr_off) {
-        int dec_size;
-
-        bytestream2_seek(&s->gb, 8 + corr_off, SEEK_SET);
-        dec_size = xan_unpack(s, s->scratch_buffer, s->buffer_size / 2);
-        if (dec_size < 0)
-            dec_size = 0;
-        for (i = 0; i < dec_size; i++)
-            s->y_buffer[i*2+1] = (s->y_buffer[i*2+1] + (s->scratch_buffer[i] << 1)) & 0x3F;
-    }
-
-    src  = s->y_buffer;
-    ybuf = s->pic->data[0];
-    for (j = 0; j < avctx->height; j++) {
-        for (i = 0; i < avctx->width; i++)
-            ybuf[i] = (src[i] << 2) | (src[i] >> 3);
-        src  += avctx->width;
-        ybuf += s->pic->linesize[0];
-    }
-
-    return 0;
-}
-
-static int xan_decode_frame_type1(AVCodecContext *avctx)
-{
-    XanContext *s = avctx->priv_data;
-    uint8_t *ybuf, *src = s->scratch_buffer;
-    int cur, last;
-    int i, j;
-    int ret;
-
-    if ((ret = xan_decode_chroma(avctx, bytestream2_get_le32(&s->gb))) != 0)
-        return ret;
-
-    bytestream2_seek(&s->gb, 16, SEEK_SET);
-    ret = xan_unpack_luma(s, src,
-                          s->buffer_size >> 1);
-    if (ret) {
-        av_log(avctx, AV_LOG_ERROR, "Luma decoding failed\n");
-        return ret;
-    }
-
-    ybuf = s->y_buffer;
-    for (i = 0; i < avctx->height; i++) {
-        last = (ybuf[0] + (*src++ << 1)) & 0x3F;
-        ybuf[0] = last;
-        for (j = 1; j < avctx->width - 1; j += 2) {
-            cur = (ybuf[j + 1] + (*src++ << 1)) & 0x3F;
-            ybuf[j]   = (last + cur) >> 1;
-            ybuf[j+1] = cur;
-            last = cur;
-        }
-        ybuf[j] = last;
-        ybuf += avctx->width;
-    }
-
-    src = s->y_buffer;
-    ybuf = s->pic->data[0];
-    for (j = 0; j < avctx->height; j++) {
-        for (i = 0; i < avctx->width; i++)
-            ybuf[i] = (src[i] << 2) | (src[i] >> 3);
-        src  += avctx->width;
-        ybuf += s->pic->linesize[0];
-    }
-
-    return 0;
-}
-
-static int xan_decode_frame(AVCodecContext *avctx,
-                            void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    XanContext *s = avctx->priv_data;
-    int ftype;
-    int ret;
-
-    if ((ret = ff_reget_buffer(avctx, s->pic))) {
-        av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return ret;
-    }
-
-    bytestream2_init(&s->gb, avpkt->data, avpkt->size);
-    ftype = bytestream2_get_le32(&s->gb);
-    switch (ftype) {
-    case 0:
-        ret = xan_decode_frame_type0(avctx);
-        break;
-    case 1:
-        ret = xan_decode_frame_type1(avctx);
-        break;
-    default:
-        av_log(avctx, AV_LOG_ERROR, "Unknown frame type %d\n", ftype);
-        return AVERROR_INVALIDDATA;
-    }
-    if (ret)
-        return ret;
-
-    if ((ret = av_frame_ref(data, s->pic)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-AVCodec ff_xan_wc4_decoder = {
-    .name           = "xan_wc4",
-    .long_name      = NULL_IF_CONFIG_SMALL("Wing Commander IV / Xxan"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_XAN_WC4,
-    .priv_data_size = sizeof(XanContext),
-    .init           = xan_decode_init,
-    .close          = xan_decode_end,
-    .decode         = xan_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/yop.c b/deps/libav/libavcodec/yop.c
deleted file mode 100644
index 3434fd9..0000000
--- a/deps/libav/libavcodec/yop.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Psygnosis YOP decoder
- *
- * Copyright (C) 2010 Mohamed Naufal Basheer <naufal11 at gmail.com>
- * derived from the code by
- * Copyright (C) 2009 Thomas P. Higdon <thomas.p.higdon at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-
-#include "avcodec.h"
-#include "get_bits.h"
-#include "internal.h"
-
-typedef struct YopDecContext {
-    AVCodecContext *avctx;
-
-    int num_pal_colors;
-    int first_color[2];
-    int frame_data_length;
-
-    uint8_t *low_nibble;
-    uint8_t *srcptr;
-    uint8_t *src_end;
-    uint8_t *dstptr;
-    uint8_t *dstbuf;
-} YopDecContext;
-
-// These tables are taken directly from:
-// http://wiki.multimedia.cx/index.php?title=Psygnosis_YOP
-
-/**
- * Lookup table for painting macroblocks. Bytes 0-2 of each entry contain
- * the macroblock positions to be painted (taken as (0, B0, B1, B2)).
- * Byte 3 contains the number of bytes consumed on the input,
- * equal to max(bytes 0-2) + 1.
- */
-static const uint8_t paint_lut[15][4] =
-    {{1, 2, 3, 4}, {1, 2, 0, 3},
-     {1, 2, 1, 3}, {1, 2, 2, 3},
-     {1, 0, 2, 3}, {1, 0, 0, 2},
-     {1, 0, 1, 2}, {1, 1, 2, 3},
-     {0, 1, 2, 3}, {0, 1, 0, 2},
-     {1, 1, 0, 2}, {0, 1, 1, 2},
-     {0, 0, 1, 2}, {0, 0, 0, 1},
-     {1, 1, 1, 2},
-    };
-
-/**
- * Lookup table for copying macroblocks. Each entry contains the respective
- * x and y pixel offset for the copy source.
- */
-static const int8_t motion_vector[16][2] =
-    {{-4, -4}, {-2, -4},
-     { 0, -4}, { 2, -4},
-     {-4, -2}, {-4,  0},
-     {-3, -3}, {-1, -3},
-     { 1, -3}, { 3, -3},
-     {-3, -1}, {-2, -2},
-     { 0, -2}, { 2, -2},
-     { 4, -2}, {-2,  0},
-    };
-
-static av_cold int yop_decode_init(AVCodecContext *avctx)
-{
-    YopDecContext *s = avctx->priv_data;
-    s->avctx = avctx;
-
-    if (avctx->width & 1 || avctx->height & 1 ||
-        av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "YOP has invalid dimensions\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avctx->extradata_size < 3) {
-        av_log(avctx, AV_LOG_ERROR, "Missing or incomplete extradata.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
-    s->num_pal_colors = avctx->extradata[0];
-    s->first_color[0] = avctx->extradata[1];
-    s->first_color[1] = avctx->extradata[2];
-
-    if (s->num_pal_colors + s->first_color[0] > 256 ||
-        s->num_pal_colors + s->first_color[1] > 256) {
-        av_log(avctx, AV_LOG_ERROR,
-               "YOP: palette parameters invalid, header probably corrupt\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-/**
- * Paint a macroblock using the pattern in paint_lut.
- * @param s codec context
- * @param tag the tag that was in the nibble
- */
-static int yop_paint_block(YopDecContext *s, int linesize, int tag)
-{
-    if (s->src_end - s->srcptr < paint_lut[tag][3]) {
-        av_log(s->avctx, AV_LOG_ERROR, "Packet too small.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->dstptr[0]            = s->srcptr[0];
-    s->dstptr[1]            = s->srcptr[paint_lut[tag][0]];
-    s->dstptr[linesize]     = s->srcptr[paint_lut[tag][1]];
-    s->dstptr[linesize + 1] = s->srcptr[paint_lut[tag][2]];
-
-    // The number of src bytes consumed is in the last part of the lut entry.
-    s->srcptr += paint_lut[tag][3];
-    return 0;
-}
-
-/**
- * Copy a previously painted macroblock to the current_block.
- * @param copy_tag the tag that was in the nibble
- */
-static int yop_copy_previous_block(YopDecContext *s, int linesize, int copy_tag)
-{
-    uint8_t *bufptr;
-
-    // Calculate position for the copy source
-    bufptr = s->dstptr + motion_vector[copy_tag][0] +
-             linesize * motion_vector[copy_tag][1];
-    if (bufptr < s->dstbuf) {
-        av_log(s->avctx, AV_LOG_ERROR,
-               "YOP: cannot decode, file probably corrupt\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->dstptr[0]            = bufptr[0];
-    s->dstptr[1]            = bufptr[1];
-    s->dstptr[linesize]     = bufptr[linesize];
-    s->dstptr[linesize + 1] = bufptr[linesize + 1];
-
-    return 0;
-}
-
-/**
- * Return the next nibble in sequence, consuming a new byte on the input
- * only if necessary.
- */
-static uint8_t yop_get_next_nibble(YopDecContext *s)
-{
-    int ret;
-
-    if (s->low_nibble) {
-        ret           = *s->low_nibble & 0xf;
-        s->low_nibble = NULL;
-    }else {
-        s->low_nibble = s->srcptr++;
-        ret           = *s->low_nibble >> 4;
-    }
-    return ret;
-}
-
-static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-                            AVPacket *avpkt)
-{
-    YopDecContext *s = avctx->priv_data;
-    AVFrame *frame = data;
-    int tag, firstcolor, is_odd_frame;
-    int ret, i, x, y;
-    uint32_t *palette;
-
-    if (avpkt->size < 4 + 3 * s->num_pal_colors) {
-        av_log(avctx, AV_LOG_ERROR, "Packet too small.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ret = ff_get_buffer(avctx, frame, 0);
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    if (!avctx->frame_number)
-        memset(frame->data[1], 0, AVPALETTE_SIZE);
-
-    s->dstbuf     = frame->data[0];
-    s->dstptr     = frame->data[0];
-    s->srcptr     = avpkt->data + 4;
-    s->src_end    = avpkt->data + avpkt->size;
-    s->low_nibble = NULL;
-
-    is_odd_frame = avpkt->data[0];
-    firstcolor   = s->first_color[is_odd_frame];
-    palette      = (uint32_t *)frame->data[1];
-
-    for (i = 0; i < s->num_pal_colors; i++, s->srcptr += 3)
-        palette[i + firstcolor] = (s->srcptr[0] << 18) |
-                                  (s->srcptr[1] << 10) |
-                                  (s->srcptr[2] << 2);
-
-    frame->palette_has_changed = 1;
-
-    for (y = 0; y < avctx->height; y += 2) {
-        for (x = 0; x < avctx->width; x += 2) {
-            if (s->srcptr - avpkt->data >= avpkt->size) {
-                av_log(avctx, AV_LOG_ERROR, "Packet too small.\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            tag = yop_get_next_nibble(s);
-
-            if (tag != 0xf) {
-                ret = yop_paint_block(s, frame->linesize[0], tag);
-                if (ret < 0)
-                    return ret;
-            } else {
-                tag = yop_get_next_nibble(s);
-                ret = yop_copy_previous_block(s, frame->linesize[0], tag);
-                if (ret < 0)
-                    return ret;
-            }
-            s->dstptr += 2;
-        }
-        s->dstptr += 2*frame->linesize[0] - x;
-    }
-
-    *got_frame = 1;
-    return avpkt->size;
-}
-
-AVCodec ff_yop_decoder = {
-    .name           = "yop",
-    .long_name      = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_YOP,
-    .priv_data_size = sizeof(YopDecContext),
-    .init           = yop_decode_init,
-    .decode         = yop_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/zerocodec.c b/deps/libav/libavcodec/zerocodec.c
deleted file mode 100644
index eeba2de..0000000
--- a/deps/libav/libavcodec/zerocodec.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * ZeroCodec Decoder
- *
- * Copyright (c) 2012, Derek Buitenhuis
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <zlib.h>
-
-#include "avcodec.h"
-#include "internal.h"
-#include "libavutil/common.h"
-
-typedef struct {
-    AVFrame  *previous_frame;
-    z_stream zstream;
-} ZeroCodecContext;
-
-static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
-                                  int *got_frame, AVPacket *avpkt)
-{
-    ZeroCodecContext *zc = avctx->priv_data;
-    AVFrame *pic         = data;
-    AVFrame *prev_pic    = zc->previous_frame;
-    z_stream *zstream    = &zc->zstream;
-    uint8_t *prev        = prev_pic->data[0];
-    uint8_t *dst;
-    int i, j, zret, ret;
-
-    if (avpkt->flags & AV_PKT_FLAG_KEY) {
-        pic->key_frame = 1;
-        pic->pict_type = AV_PICTURE_TYPE_I;
-    } else {
-        if (!prev) {
-            av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        prev += (avctx->height - 1) * prev_pic->linesize[0];
-
-        pic->key_frame = 0;
-        pic->pict_type = AV_PICTURE_TYPE_P;
-    }
-
-    zret = inflateReset(zstream);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Could not reset inflate: %d.\n", zret);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (ff_get_buffer(avctx, pic, AV_GET_BUFFER_FLAG_REF) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    zstream->next_in  = avpkt->data;
-    zstream->avail_in = avpkt->size;
-
-    dst = pic->data[0] + (avctx->height - 1) * pic->linesize[0];
-
-    /**
-     * ZeroCodec has very simple interframe compression. If a value
-     * is the same as the previous frame, set it to 0.
-     */
-
-    for (i = 0; i < avctx->height; i++) {
-        zstream->next_out  = dst;
-        zstream->avail_out = avctx->width << 1;
-
-        zret = inflate(zstream, Z_SYNC_FLUSH);
-        if (zret != Z_OK && zret != Z_STREAM_END) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Inflate failed with return code: %d.\n", zret);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (!(avpkt->flags & AV_PKT_FLAG_KEY))
-            for (j = 0; j < avctx->width << 1; j++)
-                dst[j] += prev[j] & -!dst[j];
-
-        prev -= prev_pic->linesize[0];
-        dst  -= pic->linesize[0];
-    }
-
-    av_frame_unref(zc->previous_frame);
-    if ((ret = av_frame_ref(zc->previous_frame, pic)) < 0)
-        return ret;
-
-    *got_frame = 1;
-
-    return avpkt->size;
-}
-
-static av_cold int zerocodec_decode_close(AVCodecContext *avctx)
-{
-    ZeroCodecContext *zc = avctx->priv_data;
-
-    av_frame_free(&zc->previous_frame);
-
-    inflateEnd(&zc->zstream);
-
-    return 0;
-}
-
-static av_cold int zerocodec_decode_init(AVCodecContext *avctx)
-{
-    ZeroCodecContext *zc = avctx->priv_data;
-    z_stream *zstream    = &zc->zstream;
-    int zret;
-
-    avctx->pix_fmt             = AV_PIX_FMT_UYVY422;
-    avctx->bits_per_raw_sample = 8;
-
-    zstream->zalloc = Z_NULL;
-    zstream->zfree  = Z_NULL;
-    zstream->opaque = Z_NULL;
-
-    zret = inflateInit(zstream);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Could not initialize inflate: %d.\n", zret);
-        return AVERROR(ENOMEM);
-    }
-
-    zc->previous_frame = av_frame_alloc();
-    if (!zc->previous_frame) {
-        zerocodec_decode_close(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-AVCodec ff_zerocodec_decoder = {
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .name           = "zerocodec",
-    .long_name      = NULL_IF_CONFIG_SMALL("ZeroCodec Lossless Video"),
-    .id             = AV_CODEC_ID_ZEROCODEC,
-    .priv_data_size = sizeof(ZeroCodecContext),
-    .init           = zerocodec_decode_init,
-    .decode         = zerocodec_decode_frame,
-    .close          = zerocodec_decode_close,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/zmbv.c b/deps/libav/libavcodec/zmbv.c
deleted file mode 100644
index d17f37a..0000000
--- a/deps/libav/libavcodec/zmbv.c
+++ /dev/null
@@ -1,666 +0,0 @@
-/*
- * Zip Motion Blocks Video (ZMBV) decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Zip Motion Blocks Video decoder
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-#include <zlib.h>
-
-#define ZMBV_KEYFRAME 1
-#define ZMBV_DELTAPAL 2
-
-enum ZmbvFormat {
-    ZMBV_FMT_NONE  = 0,
-    ZMBV_FMT_1BPP  = 1,
-    ZMBV_FMT_2BPP  = 2,
-    ZMBV_FMT_4BPP  = 3,
-    ZMBV_FMT_8BPP  = 4,
-    ZMBV_FMT_15BPP = 5,
-    ZMBV_FMT_16BPP = 6,
-    ZMBV_FMT_24BPP = 7,
-    ZMBV_FMT_32BPP = 8
-};
-
-/*
- * Decoder context
- */
-typedef struct ZmbvContext {
-    AVCodecContext *avctx;
-
-    int bpp;
-    unsigned int decomp_size;
-    uint8_t* decomp_buf;
-    uint8_t pal[768];
-    uint8_t *prev, *cur;
-    int width, height;
-    int fmt;
-    int comp;
-    int flags;
-    int bw, bh, bx, by;
-    int decomp_len;
-    z_stream zstream;
-    int (*decode_intra)(struct ZmbvContext *c);
-    int (*decode_xor)(struct ZmbvContext *c);
-} ZmbvContext;
-
-/**
- * Decode XOR'ed frame - 8bpp version
- */
-
-static int zmbv_decode_xor_8(ZmbvContext *c)
-{
-    uint8_t *src = c->decomp_buf;
-    uint8_t *output, *prev;
-    int8_t *mvec;
-    int x, y;
-    int d, dx, dy, bw2, bh2;
-    int block;
-    int i, j;
-    int mx, my;
-
-    output = c->cur;
-    prev = c->prev;
-
-    if (c->flags & ZMBV_DELTAPAL) {
-        for (i = 0; i < 768; i++)
-            c->pal[i] ^= *src++;
-    }
-
-    mvec = (int8_t*)src;
-    src += ((c->bx * c->by * 2 + 3) & ~3);
-
-    block = 0;
-    for (y = 0; y < c->height; y += c->bh) {
-        bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
-        for (x = 0; x < c->width; x += c->bw) {
-            uint8_t *out, *tprev;
-
-            d = mvec[block] & 1;
-            dx = mvec[block] >> 1;
-            dy = mvec[block + 1] >> 1;
-            block += 2;
-
-            bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
-
-            /* copy block - motion vectors out of bounds are used to zero blocks */
-            out = output + x;
-            tprev = prev + x + dx + dy * c->width;
-            mx = x + dx;
-            my = y + dy;
-            for (j = 0; j < bh2; j++) {
-                if (my + j < 0 || my + j >= c->height) {
-                    memset(out, 0, bw2);
-                } else {
-                    for (i = 0; i < bw2; i++) {
-                        if (mx + i < 0 || mx + i >= c->width)
-                            out[i] = 0;
-                        else
-                            out[i] = tprev[i];
-                    }
-                }
-                out += c->width;
-                tprev += c->width;
-            }
-
-            if (d) { /* apply XOR'ed difference */
-                out = output + x;
-                for (j = 0; j < bh2; j++) {
-                    for (i = 0; i < bw2; i++)
-                        out[i] ^= *src++;
-                    out += c->width;
-                }
-            }
-        }
-        output += c->width * c->bh;
-        prev += c->width * c->bh;
-    }
-    if (src - c->decomp_buf != c->decomp_len)
-        av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
-               src-c->decomp_buf, c->decomp_len);
-    return 0;
-}
-
-/**
- * Decode XOR'ed frame - 15bpp and 16bpp version
- */
-
-static int zmbv_decode_xor_16(ZmbvContext *c)
-{
-    uint8_t *src = c->decomp_buf;
-    uint16_t *output, *prev;
-    int8_t *mvec;
-    int x, y;
-    int d, dx, dy, bw2, bh2;
-    int block;
-    int i, j;
-    int mx, my;
-
-    output = (uint16_t*)c->cur;
-    prev = (uint16_t*)c->prev;
-
-    mvec = (int8_t*)src;
-    src += ((c->bx * c->by * 2 + 3) & ~3);
-
-    block = 0;
-    for (y = 0; y < c->height; y += c->bh) {
-        bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
-        for (x = 0; x < c->width; x += c->bw) {
-            uint16_t *out, *tprev;
-
-            d = mvec[block] & 1;
-            dx = mvec[block] >> 1;
-            dy = mvec[block + 1] >> 1;
-            block += 2;
-
-            bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
-
-            /* copy block - motion vectors out of bounds are used to zero blocks */
-            out = output + x;
-            tprev = prev + x + dx + dy * c->width;
-            mx = x + dx;
-            my = y + dy;
-            for (j = 0; j < bh2; j++) {
-                if (my + j < 0 || my + j >= c->height) {
-                    memset(out, 0, bw2 * 2);
-                } else {
-                    for (i = 0; i < bw2; i++) {
-                        if (mx + i < 0 || mx + i >= c->width)
-                            out[i] = 0;
-                        else
-                            out[i] = tprev[i];
-                    }
-                }
-                out += c->width;
-                tprev += c->width;
-            }
-
-            if (d) { /* apply XOR'ed difference */
-                out = output + x;
-                for (j = 0; j < bh2; j++){
-                    for (i = 0; i < bw2; i++) {
-                        out[i] ^= *((uint16_t*)src);
-                        src += 2;
-                    }
-                    out += c->width;
-                }
-            }
-        }
-        output += c->width * c->bh;
-        prev += c->width * c->bh;
-    }
-    if (src - c->decomp_buf != c->decomp_len)
-        av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
-               src-c->decomp_buf, c->decomp_len);
-    return 0;
-}
-
-#ifdef ZMBV_ENABLE_24BPP
-/**
- * Decode XOR'ed frame - 24bpp version
- */
-
-static int zmbv_decode_xor_24(ZmbvContext *c)
-{
-    uint8_t *src = c->decomp_buf;
-    uint8_t *output, *prev;
-    int8_t *mvec;
-    int x, y;
-    int d, dx, dy, bw2, bh2;
-    int block;
-    int i, j;
-    int mx, my;
-    int stride;
-
-    output = c->cur;
-    prev = c->prev;
-
-    stride = c->width * 3;
-    mvec = (int8_t*)src;
-    src += ((c->bx * c->by * 2 + 3) & ~3);
-
-    block = 0;
-    for (y = 0; y < c->height; y += c->bh) {
-        bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
-        for (x = 0; x < c->width; x += c->bw) {
-            uint8_t *out, *tprev;
-
-            d = mvec[block] & 1;
-            dx = mvec[block] >> 1;
-            dy = mvec[block + 1] >> 1;
-            block += 2;
-
-            bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
-
-            /* copy block - motion vectors out of bounds are used to zero blocks */
-            out = output + x * 3;
-            tprev = prev + (x + dx) * 3 + dy * stride;
-            mx = x + dx;
-            my = y + dy;
-            for (j = 0; j < bh2; j++) {
-                if (my + j < 0 || my + j >= c->height) {
-                    memset(out, 0, bw2 * 3);
-                } else {
-                    for (i = 0; i < bw2; i++){
-                        if (mx + i < 0 || mx + i >= c->width) {
-                            out[i * 3 + 0] = 0;
-                            out[i * 3 + 1] = 0;
-                            out[i * 3 + 2] = 0;
-                        } else {
-                            out[i * 3 + 0] = tprev[i * 3 + 0];
-                            out[i * 3 + 1] = tprev[i * 3 + 1];
-                            out[i * 3 + 2] = tprev[i * 3 + 2];
-                        }
-                    }
-                }
-                out += stride;
-                tprev += stride;
-            }
-
-            if (d) { /* apply XOR'ed difference */
-                out = output + x * 3;
-                for (j = 0; j < bh2; j++) {
-                    for (i = 0; i < bw2; i++) {
-                        out[i * 3 + 0] ^= *src++;
-                        out[i * 3 + 1] ^= *src++;
-                        out[i * 3 + 2] ^= *src++;
-                    }
-                    out += stride;
-                }
-            }
-        }
-        output += stride * c->bh;
-        prev += stride * c->bh;
-    }
-    if (src - c->decomp_buf != c->decomp_len)
-        av_log(c->avctx, AV_LOG_ERROR, "Used %i of %i bytes\n",
-               src-c->decomp_buf, c->decomp_len);
-    return 0;
-}
-#endif //ZMBV_ENABLE_24BPP
-
-/**
- * Decode XOR'ed frame - 32bpp version
- */
-
-static int zmbv_decode_xor_32(ZmbvContext *c)
-{
-    uint8_t *src = c->decomp_buf;
-    uint32_t *output, *prev;
-    int8_t *mvec;
-    int x, y;
-    int d, dx, dy, bw2, bh2;
-    int block;
-    int i, j;
-    int mx, my;
-
-    output = (uint32_t*)c->cur;
-    prev = (uint32_t*)c->prev;
-
-    mvec = (int8_t*)src;
-    src += ((c->bx * c->by * 2 + 3) & ~3);
-
-    block = 0;
-    for (y = 0; y < c->height; y += c->bh) {
-        bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
-        for (x = 0; x < c->width; x += c->bw) {
-            uint32_t *out, *tprev;
-
-            d = mvec[block] & 1;
-            dx = mvec[block] >> 1;
-            dy = mvec[block + 1] >> 1;
-            block += 2;
-
-            bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
-
-            /* copy block - motion vectors out of bounds are used to zero blocks */
-            out = output + x;
-            tprev = prev + x + dx + dy * c->width;
-            mx = x + dx;
-            my = y + dy;
-            for (j = 0; j < bh2; j++) {
-                if (my + j < 0 || my + j >= c->height) {
-                    memset(out, 0, bw2 * 4);
-                } else {
-                    for (i = 0; i < bw2; i++){
-                        if (mx + i < 0 || mx + i >= c->width)
-                            out[i] = 0;
-                        else
-                            out[i] = tprev[i];
-                    }
-                }
-                out += c->width;
-                tprev += c->width;
-            }
-
-            if (d) { /* apply XOR'ed difference */
-                out = output + x;
-                for (j = 0; j < bh2; j++){
-                    for (i = 0; i < bw2; i++) {
-                        out[i] ^= *((uint32_t *) src);
-                        src += 4;
-                    }
-                    out += c->width;
-                }
-            }
-        }
-        output += c->width * c->bh;
-        prev   += c->width * c->bh;
-    }
-    if (src - c->decomp_buf != c->decomp_len)
-        av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
-               src-c->decomp_buf, c->decomp_len);
-    return 0;
-}
-
-/**
- * Decode intraframe
- */
-static int zmbv_decode_intra(ZmbvContext *c)
-{
-    uint8_t *src = c->decomp_buf;
-
-    /* make the palette available on the way out */
-    if (c->fmt == ZMBV_FMT_8BPP) {
-        memcpy(c->pal, src, 768);
-        src += 768;
-    }
-
-    memcpy(c->cur, src, c->width * c->height * (c->bpp / 8));
-    return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
-{
-    AVFrame *frame = data;
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
-    ZmbvContext * const c = avctx->priv_data;
-    int zret = Z_OK; // Zlib return code
-    int len = buf_size;
-    int hi_ver, lo_ver, ret;
-    uint8_t *tmp;
-
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
-
-    /* parse header */
-    c->flags = buf[0];
-    buf++; len--;
-    if (c->flags & ZMBV_KEYFRAME) {
-        hi_ver = buf[0];
-        lo_ver = buf[1];
-        c->comp = buf[2];
-        c->fmt = buf[3];
-        c->bw = buf[4];
-        c->bh = buf[5];
-        c->decode_intra = NULL;
-        c->decode_xor = NULL;
-
-        buf += 6;
-        len -= 6;
-        av_log(avctx, AV_LOG_DEBUG,
-               "Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n",
-               c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh);
-        if (hi_ver != 0 || lo_ver != 1) {
-            avpriv_request_sample(avctx, "Version %i.%i", hi_ver, lo_ver);
-            return AVERROR_PATCHWELCOME;
-        }
-        if (c->bw == 0 || c->bh == 0) {
-            avpriv_request_sample(avctx, "Block size %ix%i", c->bw, c->bh);
-            return AVERROR_PATCHWELCOME;
-        }
-        if (c->comp != 0 && c->comp != 1) {
-            avpriv_request_sample(avctx, "Compression type %i", c->comp);
-            return AVERROR_PATCHWELCOME;
-        }
-
-        switch (c->fmt) {
-        case ZMBV_FMT_8BPP:
-            c->bpp = 8;
-            c->decode_intra = zmbv_decode_intra;
-            c->decode_xor = zmbv_decode_xor_8;
-            break;
-        case ZMBV_FMT_15BPP:
-        case ZMBV_FMT_16BPP:
-            c->bpp = 16;
-            c->decode_intra = zmbv_decode_intra;
-            c->decode_xor = zmbv_decode_xor_16;
-            break;
-#ifdef ZMBV_ENABLE_24BPP
-        case ZMBV_FMT_24BPP:
-            c->bpp = 24;
-            c->decode_intra = zmbv_decode_intra;
-            c->decode_xor = zmbv_decode_xor_24;
-            break;
-#endif //ZMBV_ENABLE_24BPP
-        case ZMBV_FMT_32BPP:
-            c->bpp = 32;
-            c->decode_intra = zmbv_decode_intra;
-            c->decode_xor = zmbv_decode_xor_32;
-            break;
-        default:
-            c->decode_intra = NULL;
-            c->decode_xor = NULL;
-            avpriv_request_sample(avctx, "Format %i", c->fmt);
-            return AVERROR_PATCHWELCOME;
-        }
-
-        zret = inflateReset(&c->zstream);
-        if (zret != Z_OK) {
-            av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
-            return AVERROR_UNKNOWN;
-        }
-
-        tmp = av_realloc(c->cur,  avctx->width * avctx->height * (c->bpp / 8));
-        if (!tmp)
-            return AVERROR(ENOMEM);
-        c->cur = tmp;
-        tmp = av_realloc(c->prev, avctx->width * avctx->height * (c->bpp / 8));
-        if (!tmp)
-            return AVERROR(ENOMEM);
-        c->prev = tmp;
-        c->bx   = (c->width  + c->bw - 1) / c->bw;
-        c->by   = (c->height + c->bh - 1) / c->bh;
-    }
-
-    if (c->decode_intra == NULL) {
-        av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (c->comp == 0) { //Uncompressed data
-        if (c->decomp_size < len) {
-            av_log(avctx, AV_LOG_ERROR, "Buffer too small\n");
-            return AVERROR_INVALIDDATA;
-        }
-        memcpy(c->decomp_buf, buf, len);
-    } else { // ZLIB-compressed data
-        c->zstream.total_in = c->zstream.total_out = 0;
-        c->zstream.next_in = buf;
-        c->zstream.avail_in = len;
-        c->zstream.next_out = c->decomp_buf;
-        c->zstream.avail_out = c->decomp_size;
-        zret = inflate(&c->zstream, Z_SYNC_FLUSH);
-        if (zret != Z_OK && zret != Z_STREAM_END) {
-            av_log(avctx, AV_LOG_ERROR, "inflate error %d\n", zret);
-            return AVERROR_INVALIDDATA;
-        }
-        c->decomp_len = c->zstream.total_out;
-    }
-    if (c->flags & ZMBV_KEYFRAME) {
-        frame->key_frame = 1;
-        frame->pict_type = AV_PICTURE_TYPE_I;
-        c->decode_intra(c);
-    } else {
-        frame->key_frame = 0;
-        frame->pict_type = AV_PICTURE_TYPE_P;
-        if (c->decomp_len)
-            c->decode_xor(c);
-    }
-
-    /* update frames */
-    {
-        uint8_t *out, *src;
-        int i, j;
-
-        out = frame->data[0];
-        src = c->cur;
-        switch (c->fmt) {
-        case ZMBV_FMT_8BPP:
-            for (j = 0; j < c->height; j++) {
-                for (i = 0; i < c->width; i++) {
-                    out[i * 3 + 0] = c->pal[(*src) * 3 + 0];
-                    out[i * 3 + 1] = c->pal[(*src) * 3 + 1];
-                    out[i * 3 + 2] = c->pal[(*src) * 3 + 2];
-                    src++;
-                }
-                out += frame->linesize[0];
-            }
-            break;
-        case ZMBV_FMT_15BPP:
-            for (j = 0; j < c->height; j++) {
-                for (i = 0; i < c->width; i++) {
-                    uint16_t tmp = AV_RL16(src);
-                    src += 2;
-                    out[i * 3 + 0] = (tmp & 0x7C00) >> 7;
-                    out[i * 3 + 1] = (tmp & 0x03E0) >> 2;
-                    out[i * 3 + 2] = (tmp & 0x001F) << 3;
-                }
-                out += frame->linesize[0];
-            }
-            break;
-        case ZMBV_FMT_16BPP:
-            for (j = 0; j < c->height; j++) {
-                for (i = 0; i < c->width; i++) {
-                    uint16_t tmp = AV_RL16(src);
-                    src += 2;
-                    out[i * 3 + 0] = (tmp & 0xF800) >> 8;
-                    out[i * 3 + 1] = (tmp & 0x07E0) >> 3;
-                    out[i * 3 + 2] = (tmp & 0x001F) << 3;
-                }
-                out += frame->linesize[0];
-            }
-            break;
-#ifdef ZMBV_ENABLE_24BPP
-        case ZMBV_FMT_24BPP:
-            for (j = 0; j < c->height; j++) {
-                memcpy(out, src, c->width * 3);
-                src += c->width * 3;
-                out += frame->linesize[0];
-            }
-            break;
-#endif //ZMBV_ENABLE_24BPP
-        case ZMBV_FMT_32BPP:
-            for (j = 0; j < c->height; j++) {
-                for (i = 0; i < c->width; i++) {
-                    uint32_t tmp = AV_RL32(src);
-                    src += 4;
-                    AV_WB24(out+(i*3), tmp);
-                }
-                out += frame->linesize[0];
-            }
-            break;
-        default:
-            av_log(avctx, AV_LOG_ERROR, "Cannot handle format %i\n", c->fmt);
-        }
-        FFSWAP(uint8_t *, c->cur, c->prev);
-    }
-    *got_frame = 1;
-
-    /* always report that the buffer was completely consumed */
-    return buf_size;
-}
-
-static av_cold int decode_init(AVCodecContext *avctx)
-{
-    ZmbvContext * const c = avctx->priv_data;
-    int zret; // Zlib return code
-
-    c->avctx = avctx;
-
-    c->width = avctx->width;
-    c->height = avctx->height;
-
-    c->bpp = avctx->bits_per_coded_sample;
-
-    // Needed if zlib unused or init aborted before inflateInit
-    memset(&c->zstream, 0, sizeof(z_stream));
-
-    avctx->pix_fmt = AV_PIX_FMT_RGB24;
-    c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64);
-
-    /* Allocate decompression buffer */
-    if (c->decomp_size) {
-        if ((c->decomp_buf = av_malloc(c->decomp_size)) == NULL) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Can't allocate decompression buffer.\n");
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    c->zstream.zalloc = Z_NULL;
-    c->zstream.zfree = Z_NULL;
-    c->zstream.opaque = Z_NULL;
-    zret = inflateInit(&c->zstream);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
-        return AVERROR_UNKNOWN;
-    }
-
-    return 0;
-}
-
-static av_cold int decode_end(AVCodecContext *avctx)
-{
-    ZmbvContext * const c = avctx->priv_data;
-
-    av_freep(&c->decomp_buf);
-
-    inflateEnd(&c->zstream);
-    av_freep(&c->cur);
-    av_freep(&c->prev);
-
-    return 0;
-}
-
-AVCodec ff_zmbv_decoder = {
-    .name           = "zmbv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ZMBV,
-    .priv_data_size = sizeof(ZmbvContext),
-    .init           = decode_init,
-    .close          = decode_end,
-    .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-};
diff --git a/deps/libav/libavcodec/zmbvenc.c b/deps/libav/libavcodec/zmbvenc.c
deleted file mode 100644
index 785ee0a..0000000
--- a/deps/libav/libavcodec/zmbvenc.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Zip Motion Blocks Video (ZMBV) encoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Zip Motion Blocks Video encoder
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
-#include "internal.h"
-
-#include <zlib.h>
-
-#define ZMBV_KEYFRAME 1
-#define ZMBV_DELTAPAL 2
-
-#define ZMBV_BLOCK 16
-
-/**
- * Encoder context
- */
-typedef struct ZmbvEncContext {
-    AVCodecContext *avctx;
-
-    int range;
-    uint8_t *comp_buf, *work_buf;
-    uint8_t pal[768];
-    uint32_t pal2[256]; //for quick comparisons
-    uint8_t *prev;
-    int pstride;
-    int comp_size;
-    int keyint, curfrm;
-    z_stream zstream;
-} ZmbvEncContext;
-
-static int score_tab[256];
-
-/** Block comparing function
- * XXX should be optimized and moved to DSPContext
- * TODO handle out of edge ME
- */
-static inline int block_cmp(uint8_t *src, int stride, uint8_t *src2, int stride2,
-                            int bw, int bh, int *xored)
-{
-    int sum = 0;
-    int i, j;
-    uint8_t histogram[256] = {0};
-
-    *xored = 0;
-    for(j = 0; j < bh; j++){
-        for(i = 0; i < bw; i++){
-            int t = src[i] ^ src2[i];
-            histogram[t]++;
-            *xored |= t;
-        }
-        src += stride;
-        src2 += stride2;
-    }
-
-    for(i = 1; i < 256; i++)
-        sum += score_tab[histogram[i]];
-
-    return sum;
-}
-
-/** Motion estimation function
- * TODO make better ME decisions
- */
-static int zmbv_me(ZmbvEncContext *c, uint8_t *src, int sstride, uint8_t *prev,
-                   int pstride, int x, int y, int *mx, int *my, int *xored)
-{
-    int dx, dy, tx, ty, tv, bv, bw, bh;
-
-    *mx = *my = 0;
-    bw = FFMIN(ZMBV_BLOCK, c->avctx->width - x);
-    bh = FFMIN(ZMBV_BLOCK, c->avctx->height - y);
-    bv = block_cmp(src, sstride, prev, pstride, bw, bh, xored);
-    if(!bv) return 0;
-    for(ty = FFMAX(y - c->range, 0); ty < FFMIN(y + c->range, c->avctx->height - bh); ty++){
-        for(tx = FFMAX(x - c->range, 0); tx < FFMIN(x + c->range, c->avctx->width - bw); tx++){
-            if(tx == x && ty == y) continue; // we already tested this block
-            dx = tx - x;
-            dy = ty - y;
-            tv = block_cmp(src, sstride, prev + dx + dy*pstride, pstride, bw, bh, xored);
-            if(tv < bv){
-                 bv = tv;
-                 *mx = dx;
-                 *my = dy;
-                 if(!bv) return 0;
-             }
-         }
-    }
-    return bv;
-}
-
-static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        const AVFrame *pict, int *got_packet)
-{
-    ZmbvEncContext * const c = avctx->priv_data;
-    const AVFrame * const p = pict;
-    uint8_t *src, *prev, *buf;
-    uint32_t *palptr;
-    int keyframe, chpal;
-    int fl;
-    int work_size = 0, pkt_size;
-    int bw, bh;
-    int i, j, ret;
-
-    keyframe = !c->curfrm;
-    c->curfrm++;
-    if(c->curfrm == c->keyint)
-        c->curfrm = 0;
-    avctx->coded_frame->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
-    avctx->coded_frame->key_frame = keyframe;
-    chpal = !keyframe && memcmp(p->data[1], c->pal2, 1024);
-
-    palptr = (uint32_t*)p->data[1];
-    src = p->data[0];
-    prev = c->prev;
-    if(chpal){
-        uint8_t tpal[3];
-        for(i = 0; i < 256; i++){
-            AV_WB24(tpal, palptr[i]);
-            c->work_buf[work_size++] = tpal[0] ^ c->pal[i * 3 + 0];
-            c->work_buf[work_size++] = tpal[1] ^ c->pal[i * 3 + 1];
-            c->work_buf[work_size++] = tpal[2] ^ c->pal[i * 3 + 2];
-            c->pal[i * 3 + 0] = tpal[0];
-            c->pal[i * 3 + 1] = tpal[1];
-            c->pal[i * 3 + 2] = tpal[2];
-        }
-        memcpy(c->pal2, p->data[1], 1024);
-    }
-    if(keyframe){
-        for(i = 0; i < 256; i++){
-            AV_WB24(c->pal+(i*3), palptr[i]);
-        }
-        memcpy(c->work_buf, c->pal, 768);
-        memcpy(c->pal2, p->data[1], 1024);
-        work_size = 768;
-        for(i = 0; i < avctx->height; i++){
-            memcpy(c->work_buf + work_size, src, avctx->width);
-            src += p->linesize[0];
-            work_size += avctx->width;
-        }
-    }else{
-        int x, y, bh2, bw2, xored;
-        uint8_t *tsrc, *tprev;
-        uint8_t *mv;
-        int mx, my;
-
-        bw = (avctx->width + ZMBV_BLOCK - 1) / ZMBV_BLOCK;
-        bh = (avctx->height + ZMBV_BLOCK - 1) / ZMBV_BLOCK;
-        mv = c->work_buf + work_size;
-        memset(c->work_buf + work_size, 0, (bw * bh * 2 + 3) & ~3);
-        work_size += (bw * bh * 2 + 3) & ~3;
-        /* for now just XOR'ing */
-        for(y = 0; y < avctx->height; y += ZMBV_BLOCK) {
-            bh2 = FFMIN(avctx->height - y, ZMBV_BLOCK);
-            for(x = 0; x < avctx->width; x += ZMBV_BLOCK, mv += 2) {
-                bw2 = FFMIN(avctx->width - x, ZMBV_BLOCK);
-
-                tsrc = src + x;
-                tprev = prev + x;
-
-                zmbv_me(c, tsrc, p->linesize[0], tprev, c->pstride, x, y, &mx, &my, &xored);
-                mv[0] = (mx << 1) | !!xored;
-                mv[1] = my << 1;
-                tprev += mx + my * c->pstride;
-                if(xored){
-                    for(j = 0; j < bh2; j++){
-                        for(i = 0; i < bw2; i++)
-                            c->work_buf[work_size++] = tsrc[i] ^ tprev[i];
-                        tsrc += p->linesize[0];
-                        tprev += c->pstride;
-                    }
-                }
-            }
-            src += p->linesize[0] * ZMBV_BLOCK;
-            prev += c->pstride * ZMBV_BLOCK;
-        }
-    }
-    /* save the previous frame */
-    src = p->data[0];
-    prev = c->prev;
-    for(i = 0; i < avctx->height; i++){
-        memcpy(prev, src, avctx->width);
-        prev += c->pstride;
-        src += p->linesize[0];
-    }
-
-    if (keyframe)
-        deflateReset(&c->zstream);
-
-    c->zstream.next_in = c->work_buf;
-    c->zstream.avail_in = work_size;
-    c->zstream.total_in = 0;
-
-    c->zstream.next_out = c->comp_buf;
-    c->zstream.avail_out = c->comp_size;
-    c->zstream.total_out = 0;
-    if(deflate(&c->zstream, Z_SYNC_FLUSH) != Z_OK){
-        av_log(avctx, AV_LOG_ERROR, "Error compressing data\n");
-        return -1;
-    }
-
-    pkt_size = c->zstream.total_out + 1 + 6*keyframe;
-    if ((ret = ff_alloc_packet(pkt, pkt_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting packet of size %d.\n", pkt_size);
-        return ret;
-    }
-    buf = pkt->data;
-
-    fl = (keyframe ? ZMBV_KEYFRAME : 0) | (chpal ? ZMBV_DELTAPAL : 0);
-    *buf++ = fl;
-    if (keyframe) {
-        *buf++ = 0; // hi ver
-        *buf++ = 1; // lo ver
-        *buf++ = 1; // comp
-        *buf++ = 4; // format - 8bpp
-        *buf++ = ZMBV_BLOCK; // block width
-        *buf++ = ZMBV_BLOCK; // block height
-    }
-    memcpy(buf, c->comp_buf, c->zstream.total_out);
-
-    pkt->flags |= AV_PKT_FLAG_KEY*keyframe;
-    *got_packet = 1;
-
-    return 0;
-}
-
-static av_cold int encode_end(AVCodecContext *avctx)
-{
-    ZmbvEncContext * const c = avctx->priv_data;
-
-    av_freep(&c->comp_buf);
-    av_freep(&c->work_buf);
-
-    deflateEnd(&c->zstream);
-    av_freep(&c->prev);
-
-    av_frame_free(&avctx->coded_frame);
-
-    return 0;
-}
-
-/**
- * Init zmbv encoder
- */
-static av_cold int encode_init(AVCodecContext *avctx)
-{
-    ZmbvEncContext * const c = avctx->priv_data;
-    int zret; // Zlib return code
-    int i;
-    int lvl = 9;
-
-    for(i=1; i<256; i++)
-        score_tab[i]= -i * log(i/(double)(ZMBV_BLOCK*ZMBV_BLOCK)) * (256/M_LN2);
-
-    c->avctx = avctx;
-
-    c->curfrm = 0;
-    c->keyint = avctx->keyint_min;
-    c->range = 8;
-    if(avctx->me_range > 0)
-        c->range = FFMIN(avctx->me_range, 127);
-
-    if(avctx->compression_level >= 0)
-        lvl = avctx->compression_level;
-    if(lvl < 0 || lvl > 9){
-        av_log(avctx, AV_LOG_ERROR, "Compression level should be 0-9, not %i\n", lvl);
-        return AVERROR(EINVAL);
-    }
-
-    // Needed if zlib unused or init aborted before deflateInit
-    memset(&c->zstream, 0, sizeof(z_stream));
-    c->comp_size = avctx->width * avctx->height + 1024 +
-        ((avctx->width + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * ((avctx->height + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * 2 + 4;
-    if ((c->work_buf = av_malloc(c->comp_size)) == NULL) {
-        av_log(avctx, AV_LOG_ERROR, "Can't allocate work buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-    /* Conservative upper bound taken from zlib v1.2.1 source via lcl.c */
-    c->comp_size = c->comp_size + ((c->comp_size + 7) >> 3) +
-                           ((c->comp_size + 63) >> 6) + 11;
-
-    /* Allocate compression buffer */
-    if ((c->comp_buf = av_malloc(c->comp_size)) == NULL) {
-        av_log(avctx, AV_LOG_ERROR, "Can't allocate compression buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-    c->pstride = FFALIGN(avctx->width, 16);
-    if ((c->prev = av_malloc(c->pstride * avctx->height)) == NULL) {
-        av_log(avctx, AV_LOG_ERROR, "Can't allocate picture.\n");
-        return AVERROR(ENOMEM);
-    }
-
-    c->zstream.zalloc = Z_NULL;
-    c->zstream.zfree = Z_NULL;
-    c->zstream.opaque = Z_NULL;
-    zret = deflateInit(&c->zstream, lvl);
-    if (zret != Z_OK) {
-        av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
-        return -1;
-    }
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame) {
-        encode_end(avctx);
-        return AVERROR(ENOMEM);
-    }
-
-    return 0;
-}
-
-AVCodec ff_zmbv_encoder = {
-    .name           = "zmbv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_ZMBV,
-    .priv_data_size = sizeof(ZmbvEncContext),
-    .init           = encode_init,
-    .encode2        = encode_frame,
-    .close          = encode_end,
-    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE },
-};
diff --git a/deps/libav/libavdevice/Makefile b/deps/libav/libavdevice/Makefile
deleted file mode 100644
index 02de216..0000000
--- a/deps/libav/libavdevice/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-NAME    = avdevice
-FFLIBS  = avformat avcodec avutil
-
-HEADERS = avdevice.h                                                    \
-          version.h                                                     \
-
-OBJS    = alldevices.o                                                  \
-          avdevice.o                                                    \
-
-# input/output devices
-OBJS-$(CONFIG_ALSA_INDEV)                += alsa-audio-common.o \
-                                            alsa-audio-dec.o
-OBJS-$(CONFIG_ALSA_OUTDEV)               += alsa-audio-common.o \
-                                            alsa-audio-enc.o
-OBJS-$(CONFIG_BKTR_INDEV)                += bktr.o
-OBJS-$(CONFIG_DV1394_INDEV)              += dv1394.o
-OBJS-$(CONFIG_FBDEV_INDEV)               += fbdev.o
-OBJS-$(CONFIG_JACK_INDEV)                += jack_audio.o timefilter.o
-OBJS-$(CONFIG_OSS_INDEV)                 += oss_audio.o
-OBJS-$(CONFIG_OSS_OUTDEV)                += oss_audio.o
-OBJS-$(CONFIG_PULSE_INDEV)               += pulse.o
-OBJS-$(CONFIG_SNDIO_INDEV)               += sndio_common.o sndio_dec.o
-OBJS-$(CONFIG_SNDIO_OUTDEV)              += sndio_common.o sndio_enc.o
-OBJS-$(CONFIG_V4L2_INDEV)                += v4l2.o
-OBJS-$(CONFIG_VFWCAP_INDEV)              += vfwcap.o
-OBJS-$(CONFIG_X11GRAB_INDEV)             += x11grab.o
-
-# external libraries
-OBJS-$(CONFIG_LIBCDIO_INDEV)             += libcdio.o
-OBJS-$(CONFIG_LIBDC1394_INDEV)           += libdc1394.o
-
-OBJS-$(HAVE_LIBC_MSVCRT)                 += file_open.o
-
-SKIPHEADERS-$(HAVE_ALSA_ASOUNDLIB_H)     += alsa-audio.h
-SKIPHEADERS-$(HAVE_SNDIO_H)              += sndio_common.h
-
-TESTPROGS = timefilter
diff --git a/deps/libav/libavdevice/alldevices.c b/deps/libav/libavdevice/alldevices.c
deleted file mode 100644
index 155f7a8..0000000
--- a/deps/libav/libavdevice/alldevices.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Register all the grabbing devices.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; 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 "avdevice.h"
-
-#define REGISTER_OUTDEV(X, x)                                           \
-    {                                                                   \
-        extern AVOutputFormat ff_##x##_muxer;                           \
-        if (CONFIG_##X##_OUTDEV)                                        \
-            av_register_output_format(&ff_##x##_muxer);                 \
-    }
-
-#define REGISTER_INDEV(X, x)                                            \
-    {                                                                   \
-        extern AVInputFormat ff_##x##_demuxer;                          \
-        if (CONFIG_##X##_INDEV)                                         \
-            av_register_input_format(&ff_##x##_demuxer);                \
-    }
-
-#define REGISTER_INOUTDEV(X, x) REGISTER_OUTDEV(X, x); REGISTER_INDEV(X, x)
-
-void avdevice_register_all(void)
-{
-    static int initialized;
-
-    if (initialized)
-        return;
-    initialized = 1;
-
-    /* devices */
-    REGISTER_INOUTDEV(ALSA,             alsa);
-    REGISTER_INDEV   (BKTR,             bktr);
-    REGISTER_INDEV   (DV1394,           dv1394);
-    REGISTER_INDEV   (FBDEV,            fbdev);
-    REGISTER_INDEV   (JACK,             jack);
-    REGISTER_INOUTDEV(OSS,              oss);
-    REGISTER_INDEV   (PULSE,            pulse);
-    REGISTER_INOUTDEV(SNDIO,            sndio);
-    REGISTER_INDEV   (V4L2,             v4l2);
-    REGISTER_INDEV   (VFWCAP,           vfwcap);
-    REGISTER_INDEV   (X11GRAB,          x11grab);
-
-    /* external libraries */
-    REGISTER_INDEV   (LIBCDIO,          libcdio);
-    REGISTER_INDEV   (LIBDC1394,        libdc1394);
-}
diff --git a/deps/libav/libavdevice/alsa-audio-common.c b/deps/libav/libavdevice/alsa-audio-common.c
deleted file mode 100644
index 21f1594..0000000
--- a/deps/libav/libavdevice/alsa-audio-common.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * ALSA input and output
- * Copyright (c) 2007 Luca Abeni ( lucabe72 email it )
- * Copyright (c) 2007 Benoit Fouet ( benoit fouet free fr )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ALSA input and output: common code
- * @author Luca Abeni ( lucabe72 email it )
- * @author Benoit Fouet ( benoit fouet free fr )
- * @author Nicolas George ( nicolas george normalesup org )
- */
-
-#include <alsa/asoundlib.h>
-#include "libavformat/avformat.h"
-#include "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-
-#include "alsa-audio.h"
-
-static av_cold snd_pcm_format_t codec_id_to_pcm_format(int codec_id)
-{
-    switch(codec_id) {
-        case AV_CODEC_ID_PCM_F64LE: return SND_PCM_FORMAT_FLOAT64_LE;
-        case AV_CODEC_ID_PCM_F64BE: return SND_PCM_FORMAT_FLOAT64_BE;
-        case AV_CODEC_ID_PCM_F32LE: return SND_PCM_FORMAT_FLOAT_LE;
-        case AV_CODEC_ID_PCM_F32BE: return SND_PCM_FORMAT_FLOAT_BE;
-        case AV_CODEC_ID_PCM_S32LE: return SND_PCM_FORMAT_S32_LE;
-        case AV_CODEC_ID_PCM_S32BE: return SND_PCM_FORMAT_S32_BE;
-        case AV_CODEC_ID_PCM_U32LE: return SND_PCM_FORMAT_U32_LE;
-        case AV_CODEC_ID_PCM_U32BE: return SND_PCM_FORMAT_U32_BE;
-        case AV_CODEC_ID_PCM_S24LE: return SND_PCM_FORMAT_S24_3LE;
-        case AV_CODEC_ID_PCM_S24BE: return SND_PCM_FORMAT_S24_3BE;
-        case AV_CODEC_ID_PCM_U24LE: return SND_PCM_FORMAT_U24_3LE;
-        case AV_CODEC_ID_PCM_U24BE: return SND_PCM_FORMAT_U24_3BE;
-        case AV_CODEC_ID_PCM_S16LE: return SND_PCM_FORMAT_S16_LE;
-        case AV_CODEC_ID_PCM_S16BE: return SND_PCM_FORMAT_S16_BE;
-        case AV_CODEC_ID_PCM_U16LE: return SND_PCM_FORMAT_U16_LE;
-        case AV_CODEC_ID_PCM_U16BE: return SND_PCM_FORMAT_U16_BE;
-        case AV_CODEC_ID_PCM_S8:    return SND_PCM_FORMAT_S8;
-        case AV_CODEC_ID_PCM_U8:    return SND_PCM_FORMAT_U8;
-        case AV_CODEC_ID_PCM_MULAW: return SND_PCM_FORMAT_MU_LAW;
-        case AV_CODEC_ID_PCM_ALAW:  return SND_PCM_FORMAT_A_LAW;
-        default:                 return SND_PCM_FORMAT_UNKNOWN;
-    }
-}
-
-#define REORDER_OUT_50(NAME, TYPE) \
-static void alsa_reorder_ ## NAME ## _out_50(const void *in_v, void *out_v, int n) \
-{ \
-    const TYPE *in = in_v; \
-    TYPE      *out = out_v; \
-\
-    while (n-- > 0) { \
-        out[0] = in[0]; \
-        out[1] = in[1]; \
-        out[2] = in[3]; \
-        out[3] = in[4]; \
-        out[4] = in[2]; \
-        in  += 5; \
-        out += 5; \
-    } \
-}
-
-#define REORDER_OUT_51(NAME, TYPE) \
-static void alsa_reorder_ ## NAME ## _out_51(const void *in_v, void *out_v, int n) \
-{ \
-    const TYPE *in = in_v; \
-    TYPE      *out = out_v; \
-\
-    while (n-- > 0) { \
-        out[0] = in[0]; \
-        out[1] = in[1]; \
-        out[2] = in[4]; \
-        out[3] = in[5]; \
-        out[4] = in[2]; \
-        out[5] = in[3]; \
-        in  += 6; \
-        out += 6; \
-    } \
-}
-
-#define REORDER_OUT_71(NAME, TYPE) \
-static void alsa_reorder_ ## NAME ## _out_71(const void *in_v, void *out_v, int n) \
-{ \
-    const TYPE *in = in_v; \
-    TYPE      *out = out_v; \
-\
-    while (n-- > 0) { \
-        out[0] = in[0]; \
-        out[1] = in[1]; \
-        out[2] = in[4]; \
-        out[3] = in[5]; \
-        out[4] = in[2]; \
-        out[5] = in[3]; \
-        out[6] = in[6]; \
-        out[7] = in[7]; \
-        in  += 8; \
-        out += 8; \
-    } \
-}
-
-REORDER_OUT_50(int8, int8_t)
-REORDER_OUT_51(int8, int8_t)
-REORDER_OUT_71(int8, int8_t)
-REORDER_OUT_50(int16, int16_t)
-REORDER_OUT_51(int16, int16_t)
-REORDER_OUT_71(int16, int16_t)
-REORDER_OUT_50(int32, int32_t)
-REORDER_OUT_51(int32, int32_t)
-REORDER_OUT_71(int32, int32_t)
-REORDER_OUT_50(f32, float)
-REORDER_OUT_51(f32, float)
-REORDER_OUT_71(f32, float)
-
-#define FORMAT_I8  0
-#define FORMAT_I16 1
-#define FORMAT_I32 2
-#define FORMAT_F32 3
-
-#define PICK_REORDER(layout)\
-switch(format) {\
-    case FORMAT_I8:  s->reorder_func = alsa_reorder_int8_out_ ##layout;  break;\
-    case FORMAT_I16: s->reorder_func = alsa_reorder_int16_out_ ##layout; break;\
-    case FORMAT_I32: s->reorder_func = alsa_reorder_int32_out_ ##layout; break;\
-    case FORMAT_F32: s->reorder_func = alsa_reorder_f32_out_ ##layout;   break;\
-}
-
-static av_cold int find_reorder_func(AlsaData *s, int codec_id, uint64_t layout, int out)
-{
-    int format;
-
-    /* reordering input is not currently supported */
-    if (!out)
-        return AVERROR(ENOSYS);
-
-    /* reordering is not needed for QUAD or 2_2 layout */
-    if (layout == AV_CH_LAYOUT_QUAD || layout == AV_CH_LAYOUT_2_2)
-        return 0;
-
-    switch (codec_id) {
-    case AV_CODEC_ID_PCM_S8:
-    case AV_CODEC_ID_PCM_U8:
-    case AV_CODEC_ID_PCM_ALAW:
-    case AV_CODEC_ID_PCM_MULAW: format = FORMAT_I8;  break;
-    case AV_CODEC_ID_PCM_S16LE:
-    case AV_CODEC_ID_PCM_S16BE:
-    case AV_CODEC_ID_PCM_U16LE:
-    case AV_CODEC_ID_PCM_U16BE: format = FORMAT_I16; break;
-    case AV_CODEC_ID_PCM_S32LE:
-    case AV_CODEC_ID_PCM_S32BE:
-    case AV_CODEC_ID_PCM_U32LE:
-    case AV_CODEC_ID_PCM_U32BE: format = FORMAT_I32; break;
-    case AV_CODEC_ID_PCM_F32LE:
-    case AV_CODEC_ID_PCM_F32BE: format = FORMAT_F32; break;
-    default:                 return AVERROR(ENOSYS);
-    }
-
-    if      (layout == AV_CH_LAYOUT_5POINT0_BACK || layout == AV_CH_LAYOUT_5POINT0)
-        PICK_REORDER(50)
-    else if (layout == AV_CH_LAYOUT_5POINT1_BACK || layout == AV_CH_LAYOUT_5POINT1)
-        PICK_REORDER(51)
-    else if (layout == AV_CH_LAYOUT_7POINT1)
-        PICK_REORDER(71)
-
-    return s->reorder_func ? 0 : AVERROR(ENOSYS);
-}
-
-av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
-                         unsigned int *sample_rate,
-                         int channels, enum AVCodecID *codec_id)
-{
-    AlsaData *s = ctx->priv_data;
-    const char *audio_device;
-    int res, flags = 0;
-    snd_pcm_format_t format;
-    snd_pcm_t *h;
-    snd_pcm_hw_params_t *hw_params;
-    snd_pcm_uframes_t buffer_size, period_size;
-    uint64_t layout = ctx->streams[0]->codec->channel_layout;
-
-    if (ctx->filename[0] == 0) audio_device = "default";
-    else                       audio_device = ctx->filename;
-
-    if (*codec_id == AV_CODEC_ID_NONE)
-        *codec_id = DEFAULT_CODEC_ID;
-    format = codec_id_to_pcm_format(*codec_id);
-    if (format == SND_PCM_FORMAT_UNKNOWN) {
-        av_log(ctx, AV_LOG_ERROR, "sample format 0x%04x is not supported\n", *codec_id);
-        return AVERROR(ENOSYS);
-    }
-    s->frame_size = av_get_bits_per_sample(*codec_id) / 8 * channels;
-
-    if (ctx->flags & AVFMT_FLAG_NONBLOCK) {
-        flags = SND_PCM_NONBLOCK;
-    }
-    res = snd_pcm_open(&h, audio_device, mode, flags);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot open audio device %s (%s)\n",
-               audio_device, snd_strerror(res));
-        return AVERROR(EIO);
-    }
-
-    res = snd_pcm_hw_params_malloc(&hw_params);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot allocate hardware parameter structure (%s)\n",
-               snd_strerror(res));
-        goto fail1;
-    }
-
-    res = snd_pcm_hw_params_any(h, hw_params);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot initialize hardware parameter structure (%s)\n",
-               snd_strerror(res));
-        goto fail;
-    }
-
-    res = snd_pcm_hw_params_set_access(h, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot set access type (%s)\n",
-               snd_strerror(res));
-        goto fail;
-    }
-
-    res = snd_pcm_hw_params_set_format(h, hw_params, format);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot set sample format 0x%04x %d (%s)\n",
-               *codec_id, format, snd_strerror(res));
-        goto fail;
-    }
-
-    res = snd_pcm_hw_params_set_rate_near(h, hw_params, sample_rate, 0);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot set sample rate (%s)\n",
-               snd_strerror(res));
-        goto fail;
-    }
-
-    res = snd_pcm_hw_params_set_channels(h, hw_params, channels);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot set channel count to %d (%s)\n",
-               channels, snd_strerror(res));
-        goto fail;
-    }
-
-    snd_pcm_hw_params_get_buffer_size_max(hw_params, &buffer_size);
-    buffer_size = FFMIN(buffer_size, ALSA_BUFFER_SIZE_MAX);
-    /* TODO: maybe use ctx->max_picture_buffer somehow */
-    res = snd_pcm_hw_params_set_buffer_size_near(h, hw_params, &buffer_size);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot set ALSA buffer size (%s)\n",
-               snd_strerror(res));
-        goto fail;
-    }
-
-    snd_pcm_hw_params_get_period_size_min(hw_params, &period_size, NULL);
-    if (!period_size)
-        period_size = buffer_size / 4;
-    res = snd_pcm_hw_params_set_period_size_near(h, hw_params, &period_size, NULL);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot set ALSA period size (%s)\n",
-               snd_strerror(res));
-        goto fail;
-    }
-    s->period_size = period_size;
-
-    res = snd_pcm_hw_params(h, hw_params);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "cannot set parameters (%s)\n",
-               snd_strerror(res));
-        goto fail;
-    }
-
-    snd_pcm_hw_params_free(hw_params);
-
-    if (channels > 2 && layout) {
-        if (find_reorder_func(s, *codec_id, layout, mode == SND_PCM_STREAM_PLAYBACK) < 0) {
-            char name[128];
-            av_get_channel_layout_string(name, sizeof(name), channels, layout);
-            av_log(ctx, AV_LOG_WARNING, "ALSA channel layout unknown or unimplemented for %s %s.\n",
-                   name, mode == SND_PCM_STREAM_PLAYBACK ? "playback" : "capture");
-        }
-        if (s->reorder_func) {
-            s->reorder_buf_size = buffer_size;
-            s->reorder_buf = av_malloc(s->reorder_buf_size * s->frame_size);
-            if (!s->reorder_buf)
-                goto fail1;
-        }
-    }
-
-    s->h = h;
-    return 0;
-
-fail:
-    snd_pcm_hw_params_free(hw_params);
-fail1:
-    snd_pcm_close(h);
-    return AVERROR(EIO);
-}
-
-av_cold int ff_alsa_close(AVFormatContext *s1)
-{
-    AlsaData *s = s1->priv_data;
-
-    av_freep(&s->reorder_buf);
-    snd_pcm_close(s->h);
-    return 0;
-}
-
-int ff_alsa_xrun_recover(AVFormatContext *s1, int err)
-{
-    AlsaData *s = s1->priv_data;
-    snd_pcm_t *handle = s->h;
-
-    av_log(s1, AV_LOG_WARNING, "ALSA buffer xrun.\n");
-    if (err == -EPIPE) {
-        err = snd_pcm_prepare(handle);
-        if (err < 0) {
-            av_log(s1, AV_LOG_ERROR, "cannot recover from underrun (snd_pcm_prepare failed: %s)\n", snd_strerror(err));
-
-            return AVERROR(EIO);
-        }
-    } else if (err == -ESTRPIPE) {
-        av_log(s1, AV_LOG_ERROR, "-ESTRPIPE... Unsupported!\n");
-
-        return -1;
-    }
-    return err;
-}
-
-int ff_alsa_extend_reorder_buf(AlsaData *s, int min_size)
-{
-    int size = s->reorder_buf_size;
-    void *r;
-
-    av_assert0(size != 0);
-    while (size < min_size)
-        size *= 2;
-    r = av_realloc(s->reorder_buf, size * s->frame_size);
-    if (!r)
-        return AVERROR(ENOMEM);
-    s->reorder_buf = r;
-    s->reorder_buf_size = size;
-    return 0;
-}
diff --git a/deps/libav/libavdevice/alsa-audio-dec.c b/deps/libav/libavdevice/alsa-audio-dec.c
deleted file mode 100644
index 0687a4a..0000000
--- a/deps/libav/libavdevice/alsa-audio-dec.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * ALSA input and output
- * Copyright (c) 2007 Luca Abeni ( lucabe72 email it )
- * Copyright (c) 2007 Benoit Fouet ( benoit fouet free fr )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ALSA input and output: input
- * @author Luca Abeni ( lucabe72 email it )
- * @author Benoit Fouet ( benoit fouet free fr )
- * @author Nicolas George ( nicolas george normalesup org )
- *
- * This avdevice decoder allows to capture audio from an ALSA (Advanced
- * Linux Sound Architecture) device.
- *
- * The filename parameter is the name of an ALSA PCM device capable of
- * capture, for example "default" or "plughw:1"; see the ALSA documentation
- * for naming conventions. The empty string is equivalent to "default".
- *
- * The capture period is set to the lower value available for the device,
- * which gives a low latency suitable for real-time capture.
- *
- * The PTS are an Unix time in microsecond.
- *
- * Due to a bug in the ALSA library
- * (https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4308), this
- * decoder does not work with certain ALSA plugins, especially the dsnoop
- * plugin.
- */
-
-#include <alsa/asoundlib.h>
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-#include "libavutil/opt.h"
-
-#include "alsa-audio.h"
-
-static av_cold int audio_read_header(AVFormatContext *s1)
-{
-    AlsaData *s = s1->priv_data;
-    AVStream *st;
-    int ret;
-    enum AVCodecID codec_id;
-    snd_pcm_sw_params_t *sw_params;
-
-    st = avformat_new_stream(s1, NULL);
-    if (!st) {
-        av_log(s1, AV_LOG_ERROR, "Cannot add stream\n");
-
-        return AVERROR(ENOMEM);
-    }
-    codec_id    = s1->audio_codec_id;
-
-    ret = ff_alsa_open(s1, SND_PCM_STREAM_CAPTURE, &s->sample_rate, s->channels,
-        &codec_id);
-    if (ret < 0) {
-        return AVERROR(EIO);
-    }
-
-    if (snd_pcm_type(s->h) != SND_PCM_TYPE_HW)
-        av_log(s1, AV_LOG_WARNING,
-               "capture with some ALSA plugins, especially dsnoop, "
-               "may hang.\n");
-
-    ret = snd_pcm_sw_params_malloc(&sw_params);
-    if (ret < 0) {
-        av_log(s1, AV_LOG_ERROR, "cannot allocate software parameters structure (%s)\n",
-               snd_strerror(ret));
-        goto fail;
-    }
-
-    snd_pcm_sw_params_current(s->h, sw_params);
-    snd_pcm_sw_params_set_tstamp_mode(s->h, sw_params, SND_PCM_TSTAMP_ENABLE);
-
-    ret = snd_pcm_sw_params(s->h, sw_params);
-    snd_pcm_sw_params_free(sw_params);
-    if (ret < 0) {
-        av_log(s1, AV_LOG_ERROR, "cannot install ALSA software parameters (%s)\n",
-               snd_strerror(ret));
-        goto fail;
-    }
-
-    /* take real parameters */
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id    = codec_id;
-    st->codec->sample_rate = s->sample_rate;
-    st->codec->channels    = s->channels;
-    avpriv_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */
-
-    return 0;
-
-fail:
-    snd_pcm_close(s->h);
-    return AVERROR(EIO);
-}
-
-static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    AlsaData *s  = s1->priv_data;
-    AVStream *st = s1->streams[0];
-    int res;
-    snd_htimestamp_t timestamp;
-    snd_pcm_uframes_t ts_delay;
-
-    if (av_new_packet(pkt, s->period_size) < 0) {
-        return AVERROR(EIO);
-    }
-
-    while ((res = snd_pcm_readi(s->h, pkt->data, pkt->size / s->frame_size)) < 0) {
-        if (res == -EAGAIN) {
-            av_free_packet(pkt);
-
-            return AVERROR(EAGAIN);
-        }
-        if (ff_alsa_xrun_recover(s1, res) < 0) {
-            av_log(s1, AV_LOG_ERROR, "ALSA read error: %s\n",
-                   snd_strerror(res));
-            av_free_packet(pkt);
-
-            return AVERROR(EIO);
-        }
-    }
-
-    snd_pcm_htimestamp(s->h, &ts_delay, &timestamp);
-    ts_delay += res;
-    pkt->pts = timestamp.tv_sec * 1000000LL
-               + (timestamp.tv_nsec * st->codec->sample_rate
-                  - (int64_t)ts_delay * 1000000000LL + st->codec->sample_rate * 500LL)
-               / (st->codec->sample_rate * 1000LL);
-
-    pkt->size = res * s->frame_size;
-
-    return 0;
-}
-
-static const AVOption options[] = {
-    { "sample_rate", "", offsetof(AlsaData, sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { "channels",    "", offsetof(AlsaData, channels),    AV_OPT_TYPE_INT, {.i64 = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-static const AVClass alsa_demuxer_class = {
-    .class_name     = "ALSA demuxer",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_alsa_demuxer = {
-    .name           = "alsa",
-    .long_name      = NULL_IF_CONFIG_SMALL("ALSA audio input"),
-    .priv_data_size = sizeof(AlsaData),
-    .read_header    = audio_read_header,
-    .read_packet    = audio_read_packet,
-    .read_close     = ff_alsa_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &alsa_demuxer_class,
-};
diff --git a/deps/libav/libavdevice/alsa-audio-enc.c b/deps/libav/libavdevice/alsa-audio-enc.c
deleted file mode 100644
index bb4575f..0000000
--- a/deps/libav/libavdevice/alsa-audio-enc.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * ALSA input and output
- * Copyright (c) 2007 Luca Abeni ( lucabe72 email it )
- * Copyright (c) 2007 Benoit Fouet ( benoit fouet free fr )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ALSA input and output: output
- * @author Luca Abeni ( lucabe72 email it )
- * @author Benoit Fouet ( benoit fouet free fr )
- *
- * This avdevice encoder allows to play audio to an ALSA (Advanced Linux
- * Sound Architecture) device.
- *
- * The filename parameter is the name of an ALSA PCM device capable of
- * capture, for example "default" or "plughw:1"; see the ALSA documentation
- * for naming conventions. The empty string is equivalent to "default".
- *
- * The playback period is set to the lower value available for the device,
- * which gives a low latency suitable for real-time playback.
- */
-
-#include <alsa/asoundlib.h>
-#include "libavformat/avformat.h"
-
-#include "alsa-audio.h"
-
-static av_cold int audio_write_header(AVFormatContext *s1)
-{
-    AlsaData *s = s1->priv_data;
-    AVStream *st;
-    unsigned int sample_rate;
-    enum AVCodecID codec_id;
-    int res;
-
-    st = s1->streams[0];
-    sample_rate = st->codec->sample_rate;
-    codec_id    = st->codec->codec_id;
-    res = ff_alsa_open(s1, SND_PCM_STREAM_PLAYBACK, &sample_rate,
-        st->codec->channels, &codec_id);
-    if (sample_rate != st->codec->sample_rate) {
-        av_log(s1, AV_LOG_ERROR,
-               "sample rate %d not available, nearest is %d\n",
-               st->codec->sample_rate, sample_rate);
-        goto fail;
-    }
-
-    return res;
-
-fail:
-    snd_pcm_close(s->h);
-    return AVERROR(EIO);
-}
-
-static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    AlsaData *s = s1->priv_data;
-    int res;
-    int size     = pkt->size;
-    uint8_t *buf = pkt->data;
-
-    size /= s->frame_size;
-    if (s->reorder_func) {
-        if (size > s->reorder_buf_size)
-            if (ff_alsa_extend_reorder_buf(s, size))
-                return AVERROR(ENOMEM);
-        s->reorder_func(buf, s->reorder_buf, size);
-        buf = s->reorder_buf;
-    }
-    while ((res = snd_pcm_writei(s->h, buf, size)) < 0) {
-        if (res == -EAGAIN) {
-
-            return AVERROR(EAGAIN);
-        }
-
-        if (ff_alsa_xrun_recover(s1, res) < 0) {
-            av_log(s1, AV_LOG_ERROR, "ALSA write error: %s\n",
-                   snd_strerror(res));
-
-            return AVERROR(EIO);
-        }
-    }
-
-    return 0;
-}
-
-AVOutputFormat ff_alsa_muxer = {
-    .name           = "alsa",
-    .long_name      = NULL_IF_CONFIG_SMALL("ALSA audio output"),
-    .priv_data_size = sizeof(AlsaData),
-    .audio_codec    = DEFAULT_CODEC_ID,
-    .video_codec    = AV_CODEC_ID_NONE,
-    .write_header   = audio_write_header,
-    .write_packet   = audio_write_packet,
-    .write_trailer  = ff_alsa_close,
-    .flags          = AVFMT_NOFILE,
-};
diff --git a/deps/libav/libavdevice/alsa-audio.h b/deps/libav/libavdevice/alsa-audio.h
deleted file mode 100644
index 26eaee6..0000000
--- a/deps/libav/libavdevice/alsa-audio.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * ALSA input and output
- * Copyright (c) 2007 Luca Abeni ( lucabe72 email it )
- * Copyright (c) 2007 Benoit Fouet ( benoit fouet free fr )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * ALSA input and output: definitions and structures
- * @author Luca Abeni ( lucabe72 email it )
- * @author Benoit Fouet ( benoit fouet free fr )
- */
-
-#ifndef AVDEVICE_ALSA_AUDIO_H
-#define AVDEVICE_ALSA_AUDIO_H
-
-#include <alsa/asoundlib.h>
-#include "config.h"
-#include "libavformat/avformat.h"
-#include "libavutil/log.h"
-
-/* XXX: we make the assumption that the soundcard accepts this format */
-/* XXX: find better solution with "preinit" method, needed also in
-        other formats */
-#define DEFAULT_CODEC_ID AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE)
-
-#define ALSA_BUFFER_SIZE_MAX 32768
-
-typedef struct AlsaData {
-    AVClass *class;
-    snd_pcm_t *h;
-    int frame_size;  ///< preferred size for reads and writes
-    int period_size; ///< bytes per sample * channels
-    int sample_rate; ///< sample rate set by user
-    int channels;    ///< number of channels set by user
-    void (*reorder_func)(const void *, void *, int);
-    void *reorder_buf;
-    int reorder_buf_size; ///< in frames
-} AlsaData;
-
-/**
- * Open an ALSA PCM.
- *
- * @param s media file handle
- * @param mode either SND_PCM_STREAM_CAPTURE or SND_PCM_STREAM_PLAYBACK
- * @param sample_rate in: requested sample rate;
- *                    out: actually selected sample rate
- * @param channels number of channels
- * @param codec_id in: requested AVCodecID or AV_CODEC_ID_NONE;
- *                 out: actually selected AVCodecID, changed only if
- *                 AV_CODEC_ID_NONE was requested
- *
- * @return 0 if OK, AVERROR_xxx on error
- */
-int ff_alsa_open(AVFormatContext *s, snd_pcm_stream_t mode,
-                 unsigned int *sample_rate,
-                 int channels, enum AVCodecID *codec_id);
-
-/**
- * Close the ALSA PCM.
- *
- * @param s1 media file handle
- *
- * @return 0
- */
-int ff_alsa_close(AVFormatContext *s1);
-
-/**
- * Try to recover from ALSA buffer underrun.
- *
- * @param s1 media file handle
- * @param err error code reported by the previous ALSA call
- *
- * @return 0 if OK, AVERROR_xxx on error
- */
-int ff_alsa_xrun_recover(AVFormatContext *s1, int err);
-
-int ff_alsa_extend_reorder_buf(AlsaData *s, int size);
-
-#endif /* AVDEVICE_ALSA_AUDIO_H */
diff --git a/deps/libav/libavdevice/avdevice.c b/deps/libav/libavdevice/avdevice.c
deleted file mode 100644
index 5a5c762..0000000
--- a/deps/libav/libavdevice/avdevice.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avdevice.h"
-#include "config.h"
-
-unsigned avdevice_version(void)
-{
-    return LIBAVDEVICE_VERSION_INT;
-}
-
-const char * avdevice_configuration(void)
-{
-    return LIBAV_CONFIGURATION;
-}
-
-const char * avdevice_license(void)
-{
-#define LICENSE_PREFIX "libavdevice license: "
-    return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
-}
diff --git a/deps/libav/libavdevice/avdevice.h b/deps/libav/libavdevice/avdevice.h
deleted file mode 100644
index 39166a5..0000000
--- a/deps/libav/libavdevice/avdevice.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVDEVICE_AVDEVICE_H
-#define AVDEVICE_AVDEVICE_H
-
-#include "version.h"
-
-/**
- * @file
- * @ingroup lavd
- * Main libavdevice API header
- */
-
-/**
- * @defgroup lavd Special devices muxing/demuxing library
- * @{
- * Libavdevice is a complementary library to @ref libavf "libavformat". It
- * provides various "special" platform-specific muxers and demuxers, e.g. for
- * grabbing devices, audio capture and playback etc. As a consequence, the
- * (de)muxers in libavdevice are of the AVFMT_NOFILE type (they use their own
- * I/O functions). The filename passed to avformat_open_input() often does not
- * refer to an actually existing file, but has some special device-specific
- * meaning - e.g. for x11grab it is the display name.
- *
- * To use libavdevice, simply call avdevice_register_all() to register all
- * compiled muxers and demuxers. They all use standard libavformat API.
- * @}
- */
-
-/**
- * Return the LIBAVDEVICE_VERSION_INT constant.
- */
-unsigned avdevice_version(void);
-
-/**
- * Return the libavdevice build-time configuration.
- */
-const char *avdevice_configuration(void);
-
-/**
- * Return the libavdevice license.
- */
-const char *avdevice_license(void);
-
-/**
- * Initialize libavdevice and register all the input and output devices.
- * @warning This function is not thread safe.
- */
-void avdevice_register_all(void);
-
-#endif /* AVDEVICE_AVDEVICE_H */
diff --git a/deps/libav/libavdevice/bktr.c b/deps/libav/libavdevice/bktr.c
deleted file mode 100644
index 06f4d86..0000000
--- a/deps/libav/libavdevice/bktr.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * *BSD video grab interface
- * Copyright (c) 2002 Steve O'Hara-Smith
- * based on
- *           Linux video grab interface
- *           Copyright (c) 2000,2001 Gerard Lantau
- * and
- *           simple_grab.c Copyright (c) 1999 Roger Hardiman
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-#include "libavutil/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/time.h"
-#if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H
-# include <dev/bktr/ioctl_meteor.h>
-# include <dev/bktr/ioctl_bt848.h>
-#elif HAVE_MACHINE_IOCTL_METEOR_H && HAVE_MACHINE_IOCTL_BT848_H
-# include <machine/ioctl_meteor.h>
-# include <machine/ioctl_bt848.h>
-#elif HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H && HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H
-# include <dev/video/meteor/ioctl_meteor.h>
-# include <dev/video/bktr/ioctl_bt848.h>
-#elif HAVE_DEV_IC_BT8XX_H
-# include <dev/ic/bt8xx.h>
-#endif
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <stdint.h>
-
-typedef struct {
-    AVClass *class;
-    int video_fd;
-    int tuner_fd;
-    int width, height;
-    uint64_t per_frame;
-    int standard;
-    char *video_size; /**< String describing video size, set by a private option. */
-    char *framerate;  /**< Set by a private option. */
-} VideoData;
-
-
-#define PAL 1
-#define PALBDGHI 1
-#define NTSC 2
-#define NTSCM 2
-#define SECAM 3
-#define PALN 4
-#define PALM 5
-#define NTSCJ 6
-
-/* PAL is 768 x 576. NTSC is 640 x 480 */
-#define PAL_HEIGHT 576
-#define SECAM_HEIGHT 576
-#define NTSC_HEIGHT 480
-
-#ifndef VIDEO_FORMAT
-#define VIDEO_FORMAT NTSC
-#endif
-
-static int bktr_dev[] = { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2,
-    METEOR_DEV3, METEOR_DEV_SVIDEO };
-
-uint8_t *video_buf;
-size_t video_buf_size;
-uint64_t last_frame_time;
-volatile sig_atomic_t nsignals;
-
-
-static void catchsignal(int signal)
-{
-    nsignals++;
-    return;
-}
-
-static av_cold int bktr_init(const char *video_device, int width, int height,
-    int format, int *video_fd, int *tuner_fd, int idev, double frequency)
-{
-    struct meteor_geomet geo;
-    int h_max;
-    long ioctl_frequency;
-    char *arg;
-    int c;
-    struct sigaction act = { 0 }, old;
-
-    if (idev < 0 || idev > 4)
-    {
-        arg = getenv ("BKTR_DEV");
-        if (arg)
-            idev = atoi (arg);
-        if (idev < 0 || idev > 4)
-            idev = 1;
-    }
-
-    if (format < 1 || format > 6)
-    {
-        arg = getenv ("BKTR_FORMAT");
-        if (arg)
-            format = atoi (arg);
-        if (format < 1 || format > 6)
-            format = VIDEO_FORMAT;
-    }
-
-    if (frequency <= 0)
-    {
-        arg = getenv ("BKTR_FREQUENCY");
-        if (arg)
-            frequency = atof (arg);
-        if (frequency <= 0)
-            frequency = 0.0;
-    }
-
-    sigemptyset(&act.sa_mask);
-    act.sa_handler = catchsignal;
-    sigaction(SIGUSR1, &act, &old);
-
-    *tuner_fd = avpriv_open("/dev/tuner0", O_RDONLY);
-    if (*tuner_fd < 0)
-        av_log(NULL, AV_LOG_ERROR, "Warning. Tuner not opened, continuing: %s\n", strerror(errno));
-
-    *video_fd = avpriv_open(video_device, O_RDONLY);
-    if (*video_fd < 0) {
-        av_log(NULL, AV_LOG_ERROR, "%s: %s\n", video_device, strerror(errno));
-        return -1;
-    }
-
-    geo.rows = height;
-    geo.columns = width;
-    geo.frames = 1;
-    geo.oformat = METEOR_GEO_YUV_422 | METEOR_GEO_YUV_12;
-
-    switch (format) {
-    case PAL:   h_max = PAL_HEIGHT;   c = BT848_IFORM_F_PALBDGHI; break;
-    case PALN:  h_max = PAL_HEIGHT;   c = BT848_IFORM_F_PALN;     break;
-    case PALM:  h_max = PAL_HEIGHT;   c = BT848_IFORM_F_PALM;     break;
-    case SECAM: h_max = SECAM_HEIGHT; c = BT848_IFORM_F_SECAM;    break;
-    case NTSC:  h_max = NTSC_HEIGHT;  c = BT848_IFORM_F_NTSCM;    break;
-    case NTSCJ: h_max = NTSC_HEIGHT;  c = BT848_IFORM_F_NTSCJ;    break;
-    default:    h_max = PAL_HEIGHT;   c = BT848_IFORM_F_PALBDGHI; break;
-    }
-
-    if (height <= h_max / 2)
-        geo.oformat |= METEOR_GEO_EVEN_ONLY;
-
-    if (ioctl(*video_fd, METEORSETGEO, &geo) < 0) {
-        av_log(NULL, AV_LOG_ERROR, "METEORSETGEO: %s\n", strerror(errno));
-        return -1;
-    }
-
-    if (ioctl(*video_fd, BT848SFMT, &c) < 0) {
-        av_log(NULL, AV_LOG_ERROR, "BT848SFMT: %s\n", strerror(errno));
-        return -1;
-    }
-
-    c = bktr_dev[idev];
-    if (ioctl(*video_fd, METEORSINPUT, &c) < 0) {
-        av_log(NULL, AV_LOG_ERROR, "METEORSINPUT: %s\n", strerror(errno));
-        return -1;
-    }
-
-    video_buf_size = width * height * 12 / 8;
-
-    video_buf = (uint8_t *)mmap((caddr_t)0, video_buf_size,
-        PROT_READ, MAP_SHARED, *video_fd, (off_t)0);
-    if (video_buf == MAP_FAILED) {
-        av_log(NULL, AV_LOG_ERROR, "mmap: %s\n", strerror(errno));
-        return -1;
-    }
-
-    if (frequency != 0.0) {
-        ioctl_frequency  = (unsigned long)(frequency*16);
-        if (ioctl(*tuner_fd, TVTUNER_SETFREQ, &ioctl_frequency) < 0)
-            av_log(NULL, AV_LOG_ERROR, "TVTUNER_SETFREQ: %s\n", strerror(errno));
-    }
-
-    c = AUDIO_UNMUTE;
-    if (ioctl(*tuner_fd, BT848_SAUDIO, &c) < 0)
-        av_log(NULL, AV_LOG_ERROR, "TVTUNER_SAUDIO: %s\n", strerror(errno));
-
-    c = METEOR_CAP_CONTINOUS;
-    ioctl(*video_fd, METEORCAPTUR, &c);
-
-    c = SIGUSR1;
-    ioctl(*video_fd, METEORSSIGNAL, &c);
-
-    return 0;
-}
-
-static void bktr_getframe(uint64_t per_frame)
-{
-    uint64_t curtime;
-
-    curtime = av_gettime();
-    if (!last_frame_time
-        || ((last_frame_time + per_frame) > curtime)) {
-        if (!usleep(last_frame_time + per_frame + per_frame / 8 - curtime)) {
-            if (!nsignals)
-                av_log(NULL, AV_LOG_INFO,
-                       "SLEPT NO signals - %d microseconds late\n",
-                       (int)(av_gettime() - last_frame_time - per_frame));
-        }
-    }
-    nsignals = 0;
-    last_frame_time = curtime;
-}
-
-
-/* note: we support only one picture read at a time */
-static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    VideoData *s = s1->priv_data;
-
-    if (av_new_packet(pkt, video_buf_size) < 0)
-        return AVERROR(EIO);
-
-    bktr_getframe(s->per_frame);
-
-    pkt->pts = av_gettime();
-    memcpy(pkt->data, video_buf, video_buf_size);
-
-    return video_buf_size;
-}
-
-static int grab_read_header(AVFormatContext *s1)
-{
-    VideoData *s = s1->priv_data;
-    AVStream *st;
-    int width, height;
-    AVRational framerate;
-    int ret = 0;
-
-    if ((ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
-        av_log(s1, AV_LOG_ERROR, "Could not parse video size '%s'.\n", s->video_size);
-        goto out;
-    }
-
-    if (!s->framerate)
-        switch (s->standard) {
-        case PAL:   s->framerate = av_strdup("pal");  break;
-        case NTSC:  s->framerate = av_strdup("ntsc"); break;
-        case SECAM: s->framerate = av_strdup("25");   break;
-        default:
-            av_log(s1, AV_LOG_ERROR, "Unknown standard.\n");
-            ret = AVERROR(EINVAL);
-            goto out;
-        }
-    if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
-        av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate);
-        goto out;
-    }
-
-    st = avformat_new_stream(s1, NULL);
-    if (!st) {
-        ret = AVERROR(ENOMEM);
-        goto out;
-    }
-    avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in use */
-
-    s->width = width;
-    s->height = height;
-    s->per_frame = ((uint64_t)1000000 * framerate.den) / framerate.num;
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->pix_fmt = AV_PIX_FMT_YUV420P;
-    st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
-    st->codec->width = width;
-    st->codec->height = height;
-    st->codec->time_base.den = framerate.num;
-    st->codec->time_base.num = framerate.den;
-
-
-    if (bktr_init(s1->filename, width, height, s->standard,
-                  &s->video_fd, &s->tuner_fd, -1, 0.0) < 0) {
-        ret = AVERROR(EIO);
-        goto out;
-    }
-
-    nsignals = 0;
-    last_frame_time = 0;
-
-out:
-    return ret;
-}
-
-static int grab_read_close(AVFormatContext *s1)
-{
-    VideoData *s = s1->priv_data;
-    int c;
-
-    c = METEOR_CAP_STOP_CONT;
-    ioctl(s->video_fd, METEORCAPTUR, &c);
-    close(s->video_fd);
-
-    c = AUDIO_MUTE;
-    ioctl(s->tuner_fd, BT848_SAUDIO, &c);
-    close(s->tuner_fd);
-
-    munmap((caddr_t)video_buf, video_buf_size);
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(VideoData, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "standard", "", offsetof(VideoData, standard), AV_OPT_TYPE_INT, {.i64 = VIDEO_FORMAT}, PAL, NTSCJ, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "PAL",      "", 0, AV_OPT_TYPE_CONST, {.i64 = PAL},   0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "NTSC",     "", 0, AV_OPT_TYPE_CONST, {.i64 = NTSC},  0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "SECAM",    "", 0, AV_OPT_TYPE_CONST, {.i64 = SECAM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "PALN",     "", 0, AV_OPT_TYPE_CONST, {.i64 = PALN},  0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "PALM",     "", 0, AV_OPT_TYPE_CONST, {.i64 = PALM},  0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "NTSCJ",    "", 0, AV_OPT_TYPE_CONST, {.i64 = NTSCJ}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC },
-    { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
-    { NULL },
-};
-
-static const AVClass bktr_class = {
-    .class_name = "BKTR grab interface",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_bktr_demuxer = {
-    .name           = "bktr",
-    .long_name      = NULL_IF_CONFIG_SMALL("video grab"),
-    .priv_data_size = sizeof(VideoData),
-    .read_header    = grab_read_header,
-    .read_packet    = grab_read_packet,
-    .read_close     = grab_read_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &bktr_class,
-};
diff --git a/deps/libav/libavdevice/dv1394.c b/deps/libav/libavdevice/dv1394.c
deleted file mode 100644
index d259e1a..0000000
--- a/deps/libav/libavdevice/dv1394.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Linux DV1394 interface
- * Copyright (c) 2003 Max Krasnyansky <maxk at qualcomm.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <poll.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavformat/avformat.h"
-#include "libavformat/dv.h"
-#include "dv1394.h"
-
-struct dv1394_data {
-    AVClass *class;
-    int fd;
-    int channel;
-    int format;
-
-    uint8_t *ring; /* Ring buffer */
-    int index;  /* Current frame index */
-    int avail;  /* Number of frames available for reading */
-    int done;   /* Number of completed frames */
-
-    DVDemuxContext* dv_demux; /* Generic DV muxing/demuxing context */
-};
-
-/*
- * The trick here is to kludge around well known problem with kernel Ooopsing
- * when you try to capture PAL on a device node configure for NTSC. That's
- * why we have to configure the device node for PAL, and then read only NTSC
- * amount of data.
- */
-static int dv1394_reset(struct dv1394_data *dv)
-{
-    struct dv1394_init init;
-
-    init.channel     = dv->channel;
-    init.api_version = DV1394_API_VERSION;
-    init.n_frames    = DV1394_RING_FRAMES;
-    init.format      = DV1394_PAL;
-
-    if (ioctl(dv->fd, DV1394_INIT, &init) < 0)
-        return -1;
-
-    dv->avail  = dv->done = 0;
-    return 0;
-}
-
-static int dv1394_start(struct dv1394_data *dv)
-{
-    /* Tell DV1394 driver to enable receiver */
-    if (ioctl(dv->fd, DV1394_START_RECEIVE, 0) < 0) {
-        av_log(NULL, AV_LOG_ERROR, "Failed to start receiver: %s\n", strerror(errno));
-        return -1;
-    }
-    return 0;
-}
-
-static int dv1394_read_header(AVFormatContext * context)
-{
-    struct dv1394_data *dv = context->priv_data;
-
-    dv->dv_demux = avpriv_dv_init_demux(context);
-    if (!dv->dv_demux)
-        goto failed;
-
-    /* Open and initialize DV1394 device */
-    dv->fd = avpriv_open(context->filename, O_RDONLY);
-    if (dv->fd < 0) {
-        av_log(context, AV_LOG_ERROR, "Failed to open DV interface: %s\n", strerror(errno));
-        goto failed;
-    }
-
-    if (dv1394_reset(dv) < 0) {
-        av_log(context, AV_LOG_ERROR, "Failed to initialize DV interface: %s\n", strerror(errno));
-        goto failed;
-    }
-
-    dv->ring = mmap(NULL, DV1394_PAL_FRAME_SIZE * DV1394_RING_FRAMES,
-                    PROT_READ, MAP_PRIVATE, dv->fd, 0);
-    if (dv->ring == MAP_FAILED) {
-        av_log(context, AV_LOG_ERROR, "Failed to mmap DV ring buffer: %s\n", strerror(errno));
-        goto failed;
-    }
-
-    if (dv1394_start(dv) < 0)
-        goto failed;
-
-    return 0;
-
-failed:
-    close(dv->fd);
-    return AVERROR(EIO);
-}
-
-static int dv1394_read_packet(AVFormatContext *context, AVPacket *pkt)
-{
-    struct dv1394_data *dv = context->priv_data;
-    int size;
-
-    size = avpriv_dv_get_packet(dv->dv_demux, pkt);
-    if (size > 0)
-        return size;
-
-    if (!dv->avail) {
-        struct dv1394_status s;
-        struct pollfd p;
-
-        if (dv->done) {
-            /* Request more frames */
-            if (ioctl(dv->fd, DV1394_RECEIVE_FRAMES, dv->done) < 0) {
-                /* This usually means that ring buffer overflowed.
-                 * We have to reset :(.
-                 */
-
-                av_log(context, AV_LOG_ERROR, "DV1394: Ring buffer overflow. Reseting ..\n");
-
-                dv1394_reset(dv);
-                dv1394_start(dv);
-            }
-            dv->done = 0;
-        }
-
-        /* Wait until more frames are available */
-restart_poll:
-        p.fd = dv->fd;
-        p.events = POLLIN | POLLERR | POLLHUP;
-        if (poll(&p, 1, -1) < 0) {
-            if (errno == EAGAIN || errno == EINTR)
-                goto restart_poll;
-            av_log(context, AV_LOG_ERROR, "Poll failed: %s\n", strerror(errno));
-            return AVERROR(EIO);
-        }
-
-        if (ioctl(dv->fd, DV1394_GET_STATUS, &s) < 0) {
-            av_log(context, AV_LOG_ERROR, "Failed to get status: %s\n", strerror(errno));
-            return AVERROR(EIO);
-        }
-        av_dlog(context, "DV1394: status\n"
-                "\tactive_frame\t%d\n"
-                "\tfirst_clear_frame\t%d\n"
-                "\tn_clear_frames\t%d\n"
-                "\tdropped_frames\t%d\n",
-                s.active_frame, s.first_clear_frame,
-                s.n_clear_frames, s.dropped_frames);
-
-        dv->avail = s.n_clear_frames;
-        dv->index = s.first_clear_frame;
-        dv->done  = 0;
-
-        if (s.dropped_frames) {
-            av_log(context, AV_LOG_ERROR, "DV1394: Frame drop detected (%d). Reseting ..\n",
-                    s.dropped_frames);
-
-            dv1394_reset(dv);
-            dv1394_start(dv);
-        }
-    }
-
-    av_dlog(context, "index %d, avail %d, done %d\n", dv->index, dv->avail,
-            dv->done);
-
-    size = avpriv_dv_produce_packet(dv->dv_demux, pkt,
-                             dv->ring + (dv->index * DV1394_PAL_FRAME_SIZE),
-                             DV1394_PAL_FRAME_SIZE);
-    dv->index = (dv->index + 1) % DV1394_RING_FRAMES;
-    dv->done++; dv->avail--;
-
-    return size;
-}
-
-static int dv1394_close(AVFormatContext * context)
-{
-    struct dv1394_data *dv = context->priv_data;
-
-    /* Shutdown DV1394 receiver */
-    if (ioctl(dv->fd, DV1394_SHUTDOWN, 0) < 0)
-        av_log(context, AV_LOG_ERROR, "Failed to shutdown DV1394: %s\n", strerror(errno));
-
-    /* Unmap ring buffer */
-    if (munmap(dv->ring, DV1394_NTSC_FRAME_SIZE * DV1394_RING_FRAMES) < 0)
-        av_log(context, AV_LOG_ERROR, "Failed to munmap DV1394 ring buffer: %s\n", strerror(errno));
-
-    close(dv->fd);
-    av_free(dv->dv_demux);
-
-    return 0;
-}
-
-static const AVOption options[] = {
-    { "standard", "", offsetof(struct dv1394_data, format), AV_OPT_TYPE_INT, {.i64 = DV1394_NTSC}, DV1394_NTSC, DV1394_PAL, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "PAL",      "", 0, AV_OPT_TYPE_CONST, {.i64 = DV1394_PAL},   0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "NTSC",     "", 0, AV_OPT_TYPE_CONST, {.i64 = DV1394_NTSC},  0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
-    { "channel",  "", offsetof(struct dv1394_data, channel), AV_OPT_TYPE_INT, {.i64 = DV1394_DEFAULT_CHANNEL}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-static const AVClass dv1394_class = {
-    .class_name = "DV1394 indev",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_dv1394_demuxer = {
-    .name           = "dv1394",
-    .long_name      = NULL_IF_CONFIG_SMALL("DV1394 A/V grab"),
-    .priv_data_size = sizeof(struct dv1394_data),
-    .read_header    = dv1394_read_header,
-    .read_packet    = dv1394_read_packet,
-    .read_close     = dv1394_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &dv1394_class,
-};
diff --git a/deps/libav/libavdevice/dv1394.h b/deps/libav/libavdevice/dv1394.h
deleted file mode 100644
index 9710ff5..0000000
--- a/deps/libav/libavdevice/dv1394.h
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * DV input/output over IEEE 1394 on OHCI chips
- *   Copyright (C)2001 Daniel Maas <dmaas at dcine.com>
- *     receive, proc_fs by Dan Dennedy <dan at dennedy.org>
- *
- * based on:
- *   video1394.h - driver for OHCI 1394 boards
- *   Copyright (C)1999,2000 Sebastien Rougeaux <sebastien.rougeaux at anu.edu.au>
- *                          Peter Schlaile <udbz at rz.uni-karlsruhe.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVDEVICE_DV1394_H
-#define AVDEVICE_DV1394_H
-
-#define DV1394_DEFAULT_CHANNEL 63
-#define DV1394_DEFAULT_CARD    0
-#define DV1394_RING_FRAMES     20
-
-#define DV1394_WIDTH  720
-#define DV1394_NTSC_HEIGHT 480
-#define DV1394_PAL_HEIGHT 576
-
-/* This is the public user-space interface. Try not to break it. */
-
-#define DV1394_API_VERSION 0x20011127
-
-/* ********************
-   **                **
-   **   DV1394 API   **
-   **                **
-   ********************
-
-   There are two methods of operating the DV1394 DV output device.
-
-   1)
-
-   The simplest is an interface based on write(): simply write
-   full DV frames of data to the device, and they will be transmitted
-   as quickly as possible. The FD may be set for non-blocking I/O,
-   in which case you can use select() or poll() to wait for output
-   buffer space.
-
-   To set the DV output parameters (e.g. whether you want NTSC or PAL
-   video), use the DV1394_INIT ioctl, passing in the parameters you
-   want in a struct dv1394_init.
-
-   Example 1:
-         To play a raw .DV file:   cat foo.DV > /dev/dv1394
-         (cat will use write() internally)
-
-   Example 2:
-           static struct dv1394_init init = {
-              0x63,        (broadcast channel)
-              4,           (four-frame ringbuffer)
-              DV1394_NTSC, (send NTSC video)
-              0, 0         (default empty packet rate)
-           }
-
-           ioctl(fd, DV1394_INIT, &init);
-
-           while(1) {
-                  read( <a raw DV file>, buf, DV1394_NTSC_FRAME_SIZE );
-                  write( <the dv1394 FD>, buf, DV1394_NTSC_FRAME_SIZE );
-           }
-
-   2)
-
-   For more control over buffering, and to avoid unnecessary copies
-   of the DV data, you can use the more sophisticated the mmap() interface.
-   First, call the DV1394_INIT ioctl to specify your parameters,
-   including the number of frames in the ringbuffer. Then, calling mmap()
-   on the dv1394 device will give you direct access to the ringbuffer
-   from which the DV card reads your frame data.
-
-   The ringbuffer is simply one large, contiguous region of memory
-   containing two or more frames of packed DV data. Each frame of DV data
-   is 120000 bytes (NTSC) or 144000 bytes (PAL).
-
-   Fill one or more frames in the ringbuffer, then use the DV1394_SUBMIT_FRAMES
-   ioctl to begin I/O. You can use either the DV1394_WAIT_FRAMES ioctl
-   or select()/poll() to wait until the frames are transmitted. Next, you'll
-   need to call the DV1394_GET_STATUS ioctl to determine which ringbuffer
-   frames are clear (ready to be filled with new DV data). Finally, use
-   DV1394_SUBMIT_FRAMES again to send the new data to the DV output.
-
-
-   Example: here is what a four-frame ringbuffer might look like
-            during DV transmission:
-
-
-         frame 0   frame 1   frame 2   frame 3
-
-        *--------------------------------------*
-        | CLEAR   | DV data | DV data | CLEAR  |
-        *--------------------------------------*
-                   <ACTIVE>
-
-        transmission goes in this direction --->>>
-
-
-   The DV hardware is currently transmitting the data in frame 1.
-   Once frame 1 is finished, it will automatically transmit frame 2.
-   (if frame 2 finishes before frame 3 is submitted, the device
-   will continue to transmit frame 2, and will increase the dropped_frames
-   counter each time it repeats the transmission).
-
-
-   If you called DV1394_GET_STATUS at this instant, you would
-   receive the following values:
-
-                  n_frames          = 4
-                  active_frame      = 1
-                  first_clear_frame = 3
-                  n_clear_frames    = 2
-
-   At this point, you should write new DV data into frame 3 and optionally
-   frame 0. Then call DV1394_SUBMIT_FRAMES to inform the device that
-   it may transmit the new frames.
-
-   ERROR HANDLING
-
-   An error (buffer underflow/overflow or a break in the DV stream due
-   to a 1394 bus reset) can be detected by checking the dropped_frames
-   field of struct dv1394_status (obtained through the
-   DV1394_GET_STATUS ioctl).
-
-   The best way to recover from such an error is to re-initialize
-   dv1394, either by using the DV1394_INIT ioctl call, or closing the
-   file descriptor and opening it again. (note that you must unmap all
-   ringbuffer mappings when closing the file descriptor, or else
-   dv1394 will still be considered 'in use').
-
-   MAIN LOOP
-
-   For maximum efficiency and robustness against bus errors, you are
-   advised to model the main loop of your application after the
-   following pseudo-code example:
-
-   (checks of system call return values omitted for brevity; always
-   check return values in your code!)
-
-   while( frames left ) {
-
-    struct pollfd *pfd = ...;
-
-    pfd->fd = dv1394_fd;
-    pfd->revents = 0;
-    pfd->events = POLLOUT | POLLIN; (OUT for transmit, IN for receive)
-
-    (add other sources of I/O here)
-
-    poll(pfd, 1, -1); (or select(); add a timeout if you want)
-
-    if(pfd->revents) {
-         struct dv1394_status status;
-
-         ioctl(dv1394_fd, DV1394_GET_STATUS, &status);
-
-         if(status.dropped_frames > 0) {
-              reset_dv1394();
-         } else {
-              int i;
-              for (i = 0; i < status.n_clear_frames; i++) {
-                  copy_DV_frame();
-              }
-         }
-    }
-   }
-
-   where copy_DV_frame() reads or writes on the dv1394 file descriptor
-   (read/write mode) or copies data to/from the mmap ringbuffer and
-   then calls ioctl(DV1394_SUBMIT_FRAMES) to notify dv1394 that new
-   frames are available (mmap mode).
-
-   reset_dv1394() is called in the event of a buffer
-   underflow/overflow or a halt in the DV stream (e.g. due to a 1394
-   bus reset). To guarantee recovery from the error, this function
-   should close the dv1394 file descriptor (and munmap() all
-   ringbuffer mappings, if you are using them), then re-open the
-   dv1394 device (and re-map the ringbuffer).
-
-*/
-
-
-/* maximum number of frames in the ringbuffer */
-#define DV1394_MAX_FRAMES 32
-
-/* number of *full* isochronous packets per DV frame */
-#define DV1394_NTSC_PACKETS_PER_FRAME 250
-#define DV1394_PAL_PACKETS_PER_FRAME  300
-
-/* size of one frame's worth of DV data, in bytes */
-#define DV1394_NTSC_FRAME_SIZE (480 * DV1394_NTSC_PACKETS_PER_FRAME)
-#define DV1394_PAL_FRAME_SIZE  (480 * DV1394_PAL_PACKETS_PER_FRAME)
-
-
-/* ioctl() commands */
-
-enum {
-        /* I don't like using 0 as a valid ioctl() */
-        DV1394_INVALID = 0,
-
-
-        /* get the driver ready to transmit video.
-           pass a struct dv1394_init* as the parameter (see below),
-           or NULL to get default parameters */
-        DV1394_INIT,
-
-
-        /* stop transmitting video and free the ringbuffer */
-        DV1394_SHUTDOWN,
-
-
-        /* submit N new frames to be transmitted, where
-           the index of the first new frame is first_clear_buffer,
-           and the index of the last new frame is
-           (first_clear_buffer + N) % n_frames */
-        DV1394_SUBMIT_FRAMES,
-
-
-        /* block until N buffers are clear (pass N as the parameter)
-           Because we re-transmit the last frame on underrun, there
-           will at most be n_frames - 1 clear frames at any time */
-        DV1394_WAIT_FRAMES,
-
-        /* capture new frames that have been received, where
-           the index of the first new frame is first_clear_buffer,
-           and the index of the last new frame is
-           (first_clear_buffer + N) % n_frames */
-        DV1394_RECEIVE_FRAMES,
-
-
-        DV1394_START_RECEIVE,
-
-
-        /* pass a struct dv1394_status* as the parameter (see below) */
-        DV1394_GET_STATUS,
-};
-
-
-
-enum pal_or_ntsc {
-        DV1394_NTSC = 0,
-        DV1394_PAL
-};
-
-
-
-
-/* this is the argument to DV1394_INIT */
-struct dv1394_init {
-        /* DV1394_API_VERSION */
-        unsigned int api_version;
-
-        /* isochronous transmission channel to use */
-        unsigned int channel;
-
-        /* number of frames in the ringbuffer. Must be at least 2
-           and at most DV1394_MAX_FRAMES. */
-        unsigned int n_frames;
-
-        /* send/receive PAL or NTSC video format */
-        enum pal_or_ntsc format;
-
-        /* the following are used only for transmission */
-
-        /* set these to zero unless you want a
-           non-default empty packet rate (see below) */
-        unsigned long cip_n;
-        unsigned long cip_d;
-
-        /* set this to zero unless you want a
-           non-default SYT cycle offset (default = 3 cycles) */
-        unsigned int syt_offset;
-};
-
-/* NOTE: you may only allocate the DV frame ringbuffer once each time
-   you open the dv1394 device. DV1394_INIT will fail if you call it a
-   second time with different 'n_frames' or 'format' arguments (which
-   would imply a different size for the ringbuffer). If you need a
-   different buffer size, simply close and re-open the device, then
-   initialize it with your new settings. */
-
-/* Q: What are cip_n and cip_d? */
-
-/*
-  A: DV video streams do not utilize 100% of the potential bandwidth offered
-  by IEEE 1394 (FireWire). To achieve the correct rate of data transmission,
-  DV devices must periodically insert empty packets into the 1394 data stream.
-  Typically there is one empty packet per 14-16 data-carrying packets.
-
-  Some DV devices will accept a wide range of empty packet rates, while others
-  require a precise rate. If the dv1394 driver produces empty packets at
-  a rate that your device does not accept, you may see ugly patterns on the
-  DV output, or even no output at all.
-
-  The default empty packet insertion rate seems to work for many people; if
-  your DV output is stable, you can simply ignore this discussion. However,
-  we have exposed the empty packet rate as a parameter to support devices that
-  do not work with the default rate.
-
-  The decision to insert an empty packet is made with a numerator/denominator
-  algorithm. Empty packets are produced at an average rate of CIP_N / CIP_D.
-  You can alter the empty packet rate by passing non-zero values for cip_n
-  and cip_d to the INIT ioctl.
-
- */
-
-
-
-struct dv1394_status {
-        /* this embedded init struct returns the current dv1394
-           parameters in use */
-        struct dv1394_init init;
-
-        /* the ringbuffer frame that is currently being
-           displayed. (-1 if the device is not transmitting anything) */
-        int active_frame;
-
-        /* index of the first buffer (ahead of active_frame) that
-           is ready to be filled with data */
-        unsigned int first_clear_frame;
-
-        /* how many buffers, including first_clear_buffer, are
-           ready to be filled with data */
-        unsigned int n_clear_frames;
-
-        /* how many times the DV stream has underflowed, overflowed,
-           or otherwise encountered an error, since the previous call
-           to DV1394_GET_STATUS */
-        unsigned int dropped_frames;
-
-        /* N.B. The dropped_frames counter is only a lower bound on the actual
-           number of dropped frames, with the special case that if dropped_frames
-           is zero, then it is guaranteed that NO frames have been dropped
-           since the last call to DV1394_GET_STATUS.
-        */
-};
-
-
-#endif /* AVDEVICE_DV1394_H */
diff --git a/deps/libav/libavdevice/fbdev.c b/deps/libav/libavdevice/fbdev.c
deleted file mode 100644
index 22c53a3..0000000
--- a/deps/libav/libavdevice/fbdev.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright (c) 2011 Stefano Sabatini
- * Copyright (c) 2009 Giliard B. de Freitas <giliarde at gmail.com>
- * Copyright (C) 2002 Gunnar Monell <gmo at linux.nu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Linux framebuffer input device,
- * inspired by code from fbgrab.c by Gunnar Monell.
- * @see http://linux-fbdev.sourceforge.net/
- */
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <time.h>
-#include <linux/fb.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include "libavutil/time.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-
-struct rgb_pixfmt_map_entry {
-    int bits_per_pixel;
-    int red_offset, green_offset, blue_offset, alpha_offset;
-    enum AVPixelFormat pixfmt;
-};
-
-static struct rgb_pixfmt_map_entry rgb_pixfmt_map[] = {
-    // bpp, red_offset,  green_offset, blue_offset, alpha_offset, pixfmt
-    {  32,       0,           8,          16,           24,   AV_PIX_FMT_RGBA  },
-    {  32,      16,           8,           0,           24,   AV_PIX_FMT_BGRA  },
-    {  32,       8,          16,          24,            0,   AV_PIX_FMT_ARGB  },
-    {  32,       3,           2,           8,            0,   AV_PIX_FMT_ABGR  },
-    {  24,       0,           8,          16,            0,   AV_PIX_FMT_RGB24 },
-    {  24,      16,           8,           0,            0,   AV_PIX_FMT_BGR24 },
-};
-
-static enum AVPixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)
-{
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(rgb_pixfmt_map); i++) {
-        struct rgb_pixfmt_map_entry *entry = &rgb_pixfmt_map[i];
-        if (entry->bits_per_pixel == varinfo->bits_per_pixel &&
-            entry->red_offset     == varinfo->red.offset     &&
-            entry->green_offset   == varinfo->green.offset   &&
-            entry->blue_offset    == varinfo->blue.offset)
-            return entry->pixfmt;
-    }
-
-    return AV_PIX_FMT_NONE;
-}
-
-typedef struct {
-    AVClass *class;          ///< class for private options
-    int frame_size;          ///< size in bytes of a grabbed frame
-    AVRational framerate_q;  ///< framerate
-    char *framerate;         ///< framerate string set by a private option
-    int64_t time_frame;      ///< time for the next frame to output (in 1/1000000 units)
-
-    int fd;                  ///< framebuffer device file descriptor
-    int width, height;       ///< assumed frame resolution
-    int frame_linesize;      ///< linesize of the output frame, it is assumed to be constant
-    int bytes_per_pixel;
-
-    struct fb_var_screeninfo varinfo; ///< variable info;
-    struct fb_fix_screeninfo fixinfo; ///< fixed    info;
-
-    uint8_t *data;           ///< framebuffer data
-} FBDevContext;
-
-static av_cold int fbdev_read_header(AVFormatContext *avctx)
-{
-    FBDevContext *fbdev = avctx->priv_data;
-    AVStream *st = NULL;
-    enum AVPixelFormat pix_fmt;
-    int ret, flags = O_RDONLY;
-
-    ret = av_parse_video_rate(&fbdev->framerate_q, fbdev->framerate);
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", fbdev->framerate);
-        return ret;
-    }
-
-    if (!(st = avformat_new_stream(avctx, NULL)))
-        return AVERROR(ENOMEM);
-    avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */
-
-    /* NONBLOCK is ignored by the fbdev driver, only set for consistency */
-    if (avctx->flags & AVFMT_FLAG_NONBLOCK)
-        flags |= O_NONBLOCK;
-
-    if ((fbdev->fd = avpriv_open(avctx->filename, flags)) == -1) {
-        ret = AVERROR(errno);
-        av_log(avctx, AV_LOG_ERROR,
-               "Could not open framebuffer device '%s': %s\n",
-               avctx->filename, strerror(ret));
-        return ret;
-    }
-
-    if (ioctl(fbdev->fd, FBIOGET_VSCREENINFO, &fbdev->varinfo) < 0) {
-        ret = AVERROR(errno);
-        av_log(avctx, AV_LOG_ERROR,
-               "FBIOGET_VSCREENINFO: %s\n", strerror(errno));
-        goto fail;
-    }
-
-    if (ioctl(fbdev->fd, FBIOGET_FSCREENINFO, &fbdev->fixinfo) < 0) {
-        ret = AVERROR(errno);
-        av_log(avctx, AV_LOG_ERROR,
-               "FBIOGET_FSCREENINFO: %s\n", strerror(errno));
-        goto fail;
-    }
-
-    pix_fmt = get_pixfmt_from_fb_varinfo(&fbdev->varinfo);
-    if (pix_fmt == AV_PIX_FMT_NONE) {
-        ret = AVERROR(EINVAL);
-        av_log(avctx, AV_LOG_ERROR,
-               "Framebuffer pixel format not supported.\n");
-        goto fail;
-    }
-
-    fbdev->width           = fbdev->varinfo.xres;
-    fbdev->height          = fbdev->varinfo.yres;
-    fbdev->bytes_per_pixel = (fbdev->varinfo.bits_per_pixel + 7) >> 3;
-    fbdev->frame_linesize  = fbdev->width * fbdev->bytes_per_pixel;
-    fbdev->frame_size      = fbdev->frame_linesize * fbdev->height;
-    fbdev->time_frame      = AV_NOPTS_VALUE;
-    fbdev->data = mmap(NULL, fbdev->fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->fd, 0);
-    if (fbdev->data == MAP_FAILED) {
-        ret = AVERROR(errno);
-        av_log(avctx, AV_LOG_ERROR, "Error in mmap(): %s\n", strerror(errno));
-        goto fail;
-    }
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_RAWVIDEO;
-    st->codec->width      = fbdev->width;
-    st->codec->height     = fbdev->height;
-    st->codec->pix_fmt    = pix_fmt;
-    st->codec->time_base  = (AVRational){fbdev->framerate_q.den, fbdev->framerate_q.num};
-    st->codec->bit_rate   =
-        fbdev->width * fbdev->height * fbdev->bytes_per_pixel * av_q2d(fbdev->framerate_q) * 8;
-
-    av_log(avctx, AV_LOG_INFO,
-           "w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n",
-           fbdev->width, fbdev->height, fbdev->varinfo.bits_per_pixel,
-           av_get_pix_fmt_name(pix_fmt),
-           fbdev->framerate_q.num, fbdev->framerate_q.den,
-           st->codec->bit_rate);
-    return 0;
-
-fail:
-    close(fbdev->fd);
-    return ret;
-}
-
-static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
-{
-    FBDevContext *fbdev = avctx->priv_data;
-    int64_t curtime, delay;
-    struct timespec ts;
-    int i, ret;
-    uint8_t *pin, *pout;
-
-    if (fbdev->time_frame == AV_NOPTS_VALUE)
-        fbdev->time_frame = av_gettime();
-
-    /* wait based on the frame rate */
-    curtime = av_gettime();
-    delay = fbdev->time_frame - curtime;
-    av_dlog(avctx,
-            "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",
-            fbdev->time_frame, curtime, delay);
-    if (delay > 0) {
-        if (avctx->flags & AVFMT_FLAG_NONBLOCK)
-            return AVERROR(EAGAIN);
-        ts.tv_sec  =  delay / 1000000;
-        ts.tv_nsec = (delay % 1000000) * 1000;
-        while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
-    }
-    /* compute the time of the next frame */
-    fbdev->time_frame += INT64_C(1000000) / av_q2d(fbdev->framerate_q);
-
-    if ((ret = av_new_packet(pkt, fbdev->frame_size)) < 0)
-        return ret;
-
-    /* refresh fbdev->varinfo, visible data position may change at each call */
-    if (ioctl(fbdev->fd, FBIOGET_VSCREENINFO, &fbdev->varinfo) < 0)
-        av_log(avctx, AV_LOG_WARNING,
-               "Error refreshing variable info: %s\n", strerror(errno));
-
-    pkt->pts = curtime;
-
-    /* compute visible data offset */
-    pin = fbdev->data + fbdev->bytes_per_pixel * fbdev->varinfo.xoffset +
-                        fbdev->varinfo.yoffset * fbdev->fixinfo.line_length;
-    pout = pkt->data;
-
-    // TODO it'd be nice if the lines were aligned
-    for (i = 0; i < fbdev->height; i++) {
-        memcpy(pout, pin, fbdev->frame_linesize);
-        pin  += fbdev->fixinfo.line_length;
-        pout += fbdev->frame_linesize;
-    }
-
-    return fbdev->frame_size;
-}
-
-static av_cold int fbdev_read_close(AVFormatContext *avctx)
-{
-    FBDevContext *fbdev = avctx->priv_data;
-
-    munmap(fbdev->data, fbdev->frame_size);
-    close(fbdev->fd);
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(FBDevContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "framerate","", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
-    { NULL },
-};
-
-static const AVClass fbdev_class = {
-    .class_name = "fbdev indev",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_fbdev_demuxer = {
-    .name           = "fbdev",
-    .long_name      = NULL_IF_CONFIG_SMALL("Linux framebuffer"),
-    .priv_data_size = sizeof(FBDevContext),
-    .read_header    = fbdev_read_header,
-    .read_packet    = fbdev_read_packet,
-    .read_close     = fbdev_read_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &fbdev_class,
-};
diff --git a/deps/libav/libavdevice/file_open.c b/deps/libav/libavdevice/file_open.c
deleted file mode 100644
index 494a5d3..0000000
--- a/deps/libav/libavdevice/file_open.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "libavutil/file_open.c"
diff --git a/deps/libav/libavdevice/jack_audio.c b/deps/libav/libavdevice/jack_audio.c
deleted file mode 100644
index c261514..0000000
--- a/deps/libav/libavdevice/jack_audio.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * JACK Audio Connection Kit input device
- * Copyright (c) 2009 Samalyse
- * Author: Olivier Guilyardi <olivier samalyse com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <semaphore.h>
-#include <jack/jack.h>
-
-#include "libavutil/log.h"
-#include "libavutil/fifo.h"
-#include "libavutil/opt.h"
-#include "libavutil/time.h"
-#include "libavcodec/avcodec.h"
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-#include "timefilter.h"
-
-/**
- * Size of the internal FIFO buffers as a number of audio packets
- */
-#define FIFO_PACKETS_NUM 16
-
-typedef struct {
-    AVClass        *class;
-    jack_client_t * client;
-    int             activated;
-    sem_t           packet_count;
-    jack_nframes_t  sample_rate;
-    jack_nframes_t  buffer_size;
-    jack_port_t **  ports;
-    int             nports;
-    TimeFilter *    timefilter;
-    AVFifoBuffer *  new_pkts;
-    AVFifoBuffer *  filled_pkts;
-    int             pkt_xrun;
-    int             jack_xrun;
-} JackData;
-
-static int process_callback(jack_nframes_t nframes, void *arg)
-{
-    /* Warning: this function runs in realtime. One mustn't allocate memory here
-     * or do any other thing that could block. */
-
-    int i, j;
-    JackData *self = arg;
-    float * buffer;
-    jack_nframes_t latency, cycle_delay;
-    AVPacket pkt;
-    float *pkt_data;
-    double cycle_time;
-
-    if (!self->client)
-        return 0;
-
-    /* The approximate delay since the hardware interrupt as a number of frames */
-    cycle_delay = jack_frames_since_cycle_start(self->client);
-
-    /* Retrieve filtered cycle time */
-    cycle_time = ff_timefilter_update(self->timefilter,
-                                      av_gettime() / 1000000.0 - (double) cycle_delay / self->sample_rate,
-                                      self->buffer_size);
-
-    /* Check if an empty packet is available, and if there's enough space to send it back once filled */
-    if ((av_fifo_size(self->new_pkts) < sizeof(pkt)) || (av_fifo_space(self->filled_pkts) < sizeof(pkt))) {
-        self->pkt_xrun = 1;
-        return 0;
-    }
-
-    /* Retrieve empty (but allocated) packet */
-    av_fifo_generic_read(self->new_pkts, &pkt, sizeof(pkt), NULL);
-
-    pkt_data  = (float *) pkt.data;
-    latency   = 0;
-
-    /* Copy and interleave audio data from the JACK buffer into the packet */
-    for (i = 0; i < self->nports; i++) {
-    #if HAVE_JACK_PORT_GET_LATENCY_RANGE
-        jack_latency_range_t range;
-        jack_port_get_latency_range(self->ports[i], JackCaptureLatency, &range);
-        latency += range.max;
-    #else
-        latency += jack_port_get_total_latency(self->client, self->ports[i]);
-    #endif
-        buffer = jack_port_get_buffer(self->ports[i], self->buffer_size);
-        for (j = 0; j < self->buffer_size; j++)
-            pkt_data[j * self->nports + i] = buffer[j];
-    }
-
-    /* Timestamp the packet with the cycle start time minus the average latency */
-    pkt.pts = (cycle_time - (double) latency / (self->nports * self->sample_rate)) * 1000000.0;
-
-    /* Send the now filled packet back, and increase packet counter */
-    av_fifo_generic_write(self->filled_pkts, &pkt, sizeof(pkt), NULL);
-    sem_post(&self->packet_count);
-
-    return 0;
-}
-
-static void shutdown_callback(void *arg)
-{
-    JackData *self = arg;
-    self->client = NULL;
-}
-
-static int xrun_callback(void *arg)
-{
-    JackData *self = arg;
-    self->jack_xrun = 1;
-    ff_timefilter_reset(self->timefilter);
-    return 0;
-}
-
-static int supply_new_packets(JackData *self, AVFormatContext *context)
-{
-    AVPacket pkt;
-    int test, pkt_size = self->buffer_size * self->nports * sizeof(float);
-
-    /* Supply the process callback with new empty packets, by filling the new
-     * packets FIFO buffer with as many packets as possible. process_callback()
-     * can't do this by itself, because it can't allocate memory in realtime. */
-    while (av_fifo_space(self->new_pkts) >= sizeof(pkt)) {
-        if ((test = av_new_packet(&pkt, pkt_size)) < 0) {
-            av_log(context, AV_LOG_ERROR, "Could not create packet of size %d\n", pkt_size);
-            return test;
-        }
-        av_fifo_generic_write(self->new_pkts, &pkt, sizeof(pkt), NULL);
-    }
-    return 0;
-}
-
-static int start_jack(AVFormatContext *context)
-{
-    JackData *self = context->priv_data;
-    jack_status_t status;
-    int i, test;
-    double o, period;
-
-    /* Register as a JACK client, using the context filename as client name. */
-    self->client = jack_client_open(context->filename, JackNullOption, &status);
-    if (!self->client) {
-        av_log(context, AV_LOG_ERROR, "Unable to register as a JACK client\n");
-        return AVERROR(EIO);
-    }
-
-    sem_init(&self->packet_count, 0, 0);
-
-    self->sample_rate = jack_get_sample_rate(self->client);
-    self->ports       = av_malloc(self->nports * sizeof(*self->ports));
-    self->buffer_size = jack_get_buffer_size(self->client);
-
-    /* Register JACK ports */
-    for (i = 0; i < self->nports; i++) {
-        char str[16];
-        snprintf(str, sizeof(str), "input_%d", i + 1);
-        self->ports[i] = jack_port_register(self->client, str,
-                                            JACK_DEFAULT_AUDIO_TYPE,
-                                            JackPortIsInput, 0);
-        if (!self->ports[i]) {
-            av_log(context, AV_LOG_ERROR, "Unable to register port %s:%s\n",
-                   context->filename, str);
-            jack_client_close(self->client);
-            return AVERROR(EIO);
-        }
-    }
-
-    /* Register JACK callbacks */
-    jack_set_process_callback(self->client, process_callback, self);
-    jack_on_shutdown(self->client, shutdown_callback, self);
-    jack_set_xrun_callback(self->client, xrun_callback, self);
-
-    /* Create time filter */
-    period            = (double) self->buffer_size / self->sample_rate;
-    o                 = 2 * M_PI * 1.5 * period; /// bandwidth: 1.5Hz
-    self->timefilter  = ff_timefilter_new (1.0 / self->sample_rate, sqrt(2 * o), o * o);
-    if (!self->timefilter) {
-        jack_client_close(self->client);
-        return AVERROR(ENOMEM);
-    }
-
-    /* Create FIFO buffers */
-    self->filled_pkts = av_fifo_alloc(FIFO_PACKETS_NUM * sizeof(AVPacket));
-    /* New packets FIFO with one extra packet for safety against underruns */
-    self->new_pkts    = av_fifo_alloc((FIFO_PACKETS_NUM + 1) * sizeof(AVPacket));
-    if ((test = supply_new_packets(self, context))) {
-        jack_client_close(self->client);
-        return test;
-    }
-
-    return 0;
-
-}
-
-static void free_pkt_fifo(AVFifoBuffer *fifo)
-{
-    AVPacket pkt;
-    while (av_fifo_size(fifo)) {
-        av_fifo_generic_read(fifo, &pkt, sizeof(pkt), NULL);
-        av_free_packet(&pkt);
-    }
-    av_fifo_free(fifo);
-}
-
-static void stop_jack(JackData *self)
-{
-    if (self->client) {
-        if (self->activated)
-            jack_deactivate(self->client);
-        jack_client_close(self->client);
-    }
-    sem_destroy(&self->packet_count);
-    free_pkt_fifo(self->new_pkts);
-    free_pkt_fifo(self->filled_pkts);
-    av_freep(&self->ports);
-    ff_timefilter_destroy(self->timefilter);
-}
-
-static int audio_read_header(AVFormatContext *context)
-{
-    JackData *self = context->priv_data;
-    AVStream *stream;
-    int test;
-
-    if ((test = start_jack(context)))
-        return test;
-
-    stream = avformat_new_stream(context, NULL);
-    if (!stream) {
-        stop_jack(self);
-        return AVERROR(ENOMEM);
-    }
-
-    stream->codec->codec_type   = AVMEDIA_TYPE_AUDIO;
-#if HAVE_BIGENDIAN
-    stream->codec->codec_id     = AV_CODEC_ID_PCM_F32BE;
-#else
-    stream->codec->codec_id     = AV_CODEC_ID_PCM_F32LE;
-#endif
-    stream->codec->sample_rate  = self->sample_rate;
-    stream->codec->channels     = self->nports;
-
-    avpriv_set_pts_info(stream, 64, 1, 1000000);  /* 64 bits pts in us */
-    return 0;
-}
-
-static int audio_read_packet(AVFormatContext *context, AVPacket *pkt)
-{
-    JackData *self = context->priv_data;
-    struct timespec timeout = {0, 0};
-    int test;
-
-    /* Activate the JACK client on first packet read. Activating the JACK client
-     * means that process_callback() starts to get called at regular interval.
-     * If we activate it in audio_read_header(), we're actually reading audio data
-     * from the device before instructed to, and that may result in an overrun. */
-    if (!self->activated) {
-        if (!jack_activate(self->client)) {
-            self->activated = 1;
-            av_log(context, AV_LOG_INFO,
-                   "JACK client registered and activated (rate=%dHz, buffer_size=%d frames)\n",
-                   self->sample_rate, self->buffer_size);
-        } else {
-            av_log(context, AV_LOG_ERROR, "Unable to activate JACK client\n");
-            return AVERROR(EIO);
-        }
-    }
-
-    /* Wait for a packet coming back from process_callback(), if one isn't available yet */
-    timeout.tv_sec = av_gettime() / 1000000 + 2;
-    if (sem_timedwait(&self->packet_count, &timeout)) {
-        if (errno == ETIMEDOUT) {
-            av_log(context, AV_LOG_ERROR,
-                   "Input error: timed out when waiting for JACK process callback output\n");
-        } else {
-            av_log(context, AV_LOG_ERROR, "Error while waiting for audio packet: %s\n",
-                   strerror(errno));
-        }
-        if (!self->client)
-            av_log(context, AV_LOG_ERROR, "Input error: JACK server is gone\n");
-
-        return AVERROR(EIO);
-    }
-
-    if (self->pkt_xrun) {
-        av_log(context, AV_LOG_WARNING, "Audio packet xrun\n");
-        self->pkt_xrun = 0;
-    }
-
-    if (self->jack_xrun) {
-        av_log(context, AV_LOG_WARNING, "JACK xrun\n");
-        self->jack_xrun = 0;
-    }
-
-    /* Retrieve the packet filled with audio data by process_callback() */
-    av_fifo_generic_read(self->filled_pkts, pkt, sizeof(*pkt), NULL);
-
-    if ((test = supply_new_packets(self, context)))
-        return test;
-
-    return 0;
-}
-
-static int audio_read_close(AVFormatContext *context)
-{
-    JackData *self = context->priv_data;
-    stop_jack(self);
-    return 0;
-}
-
-#define OFFSET(x) offsetof(JackData, x)
-static const AVOption options[] = {
-    { "channels", "Number of audio channels.", OFFSET(nports), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-static const AVClass jack_indev_class = {
-    .class_name     = "JACK indev",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_jack_demuxer = {
-    .name           = "jack",
-    .long_name      = NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
-    .priv_data_size = sizeof(JackData),
-    .read_header    = audio_read_header,
-    .read_packet    = audio_read_packet,
-    .read_close     = audio_read_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &jack_indev_class,
-};
diff --git a/deps/libav/libavdevice/libavdevice.v b/deps/libav/libavdevice/libavdevice.v
deleted file mode 100644
index 663af85..0000000
--- a/deps/libav/libavdevice/libavdevice.v
+++ /dev/null
@@ -1,4 +0,0 @@
-LIBAVDEVICE_$MAJOR {
-        global: avdevice_*;
-        local: *;
-};
diff --git a/deps/libav/libavdevice/libcdio.c b/deps/libav/libavdevice/libcdio.c
deleted file mode 100644
index 06ddb4a..0000000
--- a/deps/libav/libavdevice/libcdio.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 2011 Anton Khirnov <anton at khirnov.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * libcdio CD grabbing
- */
-
-#include "config.h"
-
-#if HAVE_CDIO_PARANOIA_H
-#include <cdio/cdda.h>
-#include <cdio/paranoia.h>
-#elif HAVE_CDIO_PARANOIA_PARANOIA_H
-#include <cdio/paranoia/cdda.h>
-#include <cdio/paranoia/paranoia.h>
-#endif
-
-#include "libavutil/log.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-
-typedef struct CDIOContext {
-    AVClass             *class;
-    cdrom_drive_t       *drive;
-    cdrom_paranoia_t *paranoia;
-    int32_t last_sector;
-
-    /* private options */
-    int speed;
-    int paranoia_mode;
-} CDIOContext;
-
-static av_cold int read_header(AVFormatContext *ctx)
-{
-    CDIOContext *s = ctx->priv_data;
-    AVStream *st;
-    int ret, i;
-    char *err = NULL;
-
-    if (!(st = avformat_new_stream(ctx, NULL)))
-        return AVERROR(ENOMEM);
-    s->drive = cdio_cddap_identify(ctx->filename, CDDA_MESSAGE_LOGIT, &err);
-    if (!s->drive) {
-        av_log(ctx, AV_LOG_ERROR, "Could not open drive %s.\n", ctx->filename);
-        return AVERROR(EINVAL);
-    }
-    if (err) {
-        av_log(ctx, AV_LOG_VERBOSE, "%s\n", err);
-        free(err);
-    }
-    if ((ret = cdio_cddap_open(s->drive)) < 0 || !s->drive->opened) {
-        av_log(ctx, AV_LOG_ERROR, "Could not open disk in drive %s.\n", ctx->filename);
-        return AVERROR(EINVAL);
-    }
-
-    cdio_cddap_verbose_set(s->drive, CDDA_MESSAGE_LOGIT, CDDA_MESSAGE_LOGIT);
-    if (s->speed)
-        cdio_cddap_speed_set(s->drive, s->speed);
-
-    s->paranoia = cdio_paranoia_init(s->drive);
-    if (!s->paranoia) {
-        av_log(ctx, AV_LOG_ERROR, "Could not init paranoia.\n");
-        return AVERROR(EINVAL);
-    }
-    cdio_paranoia_modeset(s->paranoia, s->paranoia_mode);
-
-    st->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    if (s->drive->bigendianp)
-        st->codec->codec_id    = AV_CODEC_ID_PCM_S16BE;
-    else
-        st->codec->codec_id    = AV_CODEC_ID_PCM_S16LE;
-    st->codec->sample_rate     = 44100;
-    st->codec->channels        = 2;
-    if (s->drive->audio_last_sector != CDIO_INVALID_LSN &&
-        s->drive->audio_first_sector != CDIO_INVALID_LSN)
-        st->duration           = s->drive->audio_last_sector - s->drive->audio_first_sector;
-    else if (s->drive->tracks)
-        st->duration = s->drive->disc_toc[s->drive->tracks].dwStartSector;
-    avpriv_set_pts_info(st, 64, CDIO_CD_FRAMESIZE_RAW, 2*st->codec->channels*st->codec->sample_rate);
-
-    for (i = 0; i < s->drive->tracks; i++) {
-        char title[16];
-        snprintf(title, sizeof(title), "track %02d", s->drive->disc_toc[i].bTrack);
-        avpriv_new_chapter(ctx, i, st->time_base, s->drive->disc_toc[i].dwStartSector,
-                       s->drive->disc_toc[i+1].dwStartSector, title);
-    }
-
-    s->last_sector = cdio_cddap_disc_lastsector(s->drive);
-
-    return 0;
-}
-
-static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
-{
-    CDIOContext *s = ctx->priv_data;
-    int ret;
-    uint16_t *buf;
-    char *err = NULL;
-
-    if (ctx->streams[0]->cur_dts > s->last_sector)
-        return AVERROR_EOF;
-
-    buf = cdio_paranoia_read(s->paranoia, NULL);
-    if (!buf)
-        return AVERROR_EOF;
-
-    if (err = cdio_cddap_errors(s->drive)) {
-        av_log(ctx, AV_LOG_ERROR, "%s\n", err);
-        free(err);
-        err = NULL;
-    }
-    if (err = cdio_cddap_messages(s->drive)) {
-        av_log(ctx, AV_LOG_VERBOSE, "%s\n", err);
-        free(err);
-        err = NULL;
-    }
-
-    if ((ret = av_new_packet(pkt, CDIO_CD_FRAMESIZE_RAW)) < 0)
-        return ret;
-    memcpy(pkt->data, buf, CDIO_CD_FRAMESIZE_RAW);
-    return 0;
-}
-
-static av_cold int read_close(AVFormatContext *ctx)
-{
-    CDIOContext *s = ctx->priv_data;
-    cdio_paranoia_free(s->paranoia);
-    cdio_cddap_close(s->drive);
-    return 0;
-}
-
-static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp,
-                     int flags)
-{
-    CDIOContext *s = ctx->priv_data;
-    AVStream *st = ctx->streams[0];
-
-    cdio_paranoia_seek(s->paranoia, timestamp, SEEK_SET);
-    st->cur_dts = timestamp;
-    return 0;
-}
-
-#define OFFSET(x) offsetof(CDIOContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "speed",              "Drive reading speed.", OFFSET(speed),         AV_OPT_TYPE_INT,   { .i64 = 0 }, 0,       INT_MAX, DEC },
-    { "paranoia_mode",      "Error recovery mode.", OFFSET(paranoia_mode), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX, DEC, "paranoia_mode" },
-        { "verify",         "Verify data integrity in overlap area", 0,    AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_VERIFY },    0, 0, DEC, "paranoia_mode" },
-        { "overlap",        "Perform overlapped reads.",             0,    AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_OVERLAP },   0, 0, DEC, "paranoia_mode" },
-        { "neverskip",      "Do not skip failed reads.",             0,    AV_OPT_TYPE_CONST, { .i64 = PARANOIA_MODE_NEVERSKIP }, 0, 0, DEC, "paranoia_mode" },
-    { NULL },
-};
-
-static const AVClass libcdio_class = {
-    .class_name = "libcdio indev",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_libcdio_demuxer = {
-    .name           = "libcdio",
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .read_close     = read_close,
-    .read_seek      = read_seek,
-    .priv_data_size = sizeof(CDIOContext),
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &libcdio_class,
-};
diff --git a/deps/libav/libavdevice/libdc1394.c b/deps/libav/libavdevice/libdc1394.c
deleted file mode 100644
index f030e3e..0000000
--- a/deps/libav/libavdevice/libdc1394.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * IIDC1394 grab interface (uses libdc1394 and libraw1394)
- * Copyright (c) 2004 Roman Shaposhnik
- * Copyright (c) 2008 Alessandro Sappia
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; 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 "libavformat/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-
-#if HAVE_LIBDC1394_2
-#include <dc1394/dc1394.h>
-#elif HAVE_LIBDC1394_1
-#include <libraw1394/raw1394.h>
-#include <libdc1394/dc1394_control.h>
-
-#define DC1394_VIDEO_MODE_320x240_YUV422 MODE_320x240_YUV422
-#define DC1394_VIDEO_MODE_640x480_YUV411 MODE_640x480_YUV411
-#define DC1394_VIDEO_MODE_640x480_YUV422 MODE_640x480_YUV422
-#define DC1394_FRAMERATE_1_875 FRAMERATE_1_875
-#define DC1394_FRAMERATE_3_75  FRAMERATE_3_75
-#define DC1394_FRAMERATE_7_5   FRAMERATE_7_5
-#define DC1394_FRAMERATE_15    FRAMERATE_15
-#define DC1394_FRAMERATE_30    FRAMERATE_30
-#define DC1394_FRAMERATE_60    FRAMERATE_60
-#define DC1394_FRAMERATE_120   FRAMERATE_120
-#define DC1394_FRAMERATE_240   FRAMERATE_240
-#endif
-
-typedef struct dc1394_data {
-    AVClass *class;
-#if HAVE_LIBDC1394_1
-    raw1394handle_t handle;
-    dc1394_cameracapture camera;
-    int channel;
-#elif HAVE_LIBDC1394_2
-    dc1394_t *d;
-    dc1394camera_t *camera;
-    dc1394video_frame_t *frame;
-#endif
-    int current_frame;
-    int  frame_rate;        /**< frames per 1000 seconds (fps * 1000) */
-    char *video_size;       /**< String describing video size, set by a private option. */
-    char *pixel_format;     /**< Set by a private option. */
-    char *framerate;        /**< Set by a private option. */
-
-    AVPacket packet;
-} dc1394_data;
-
-struct dc1394_frame_format {
-    int width;
-    int height;
-    enum AVPixelFormat pix_fmt;
-    int frame_size_id;
-} dc1394_frame_formats[] = {
-    { 320, 240, AV_PIX_FMT_UYVY422,   DC1394_VIDEO_MODE_320x240_YUV422 },
-    { 640, 480, AV_PIX_FMT_UYYVYY411, DC1394_VIDEO_MODE_640x480_YUV411 },
-    { 640, 480, AV_PIX_FMT_UYVY422,   DC1394_VIDEO_MODE_640x480_YUV422 },
-    { 0, 0, 0, 0 } /* gotta be the last one */
-};
-
-struct dc1394_frame_rate {
-    int frame_rate;
-    int frame_rate_id;
-} dc1394_frame_rates[] = {
-    {  1875, DC1394_FRAMERATE_1_875 },
-    {  3750, DC1394_FRAMERATE_3_75  },
-    {  7500, DC1394_FRAMERATE_7_5   },
-    { 15000, DC1394_FRAMERATE_15    },
-    { 30000, DC1394_FRAMERATE_30    },
-    { 60000, DC1394_FRAMERATE_60    },
-    {120000, DC1394_FRAMERATE_120   },
-    {240000, DC1394_FRAMERATE_240    },
-    { 0, 0 } /* gotta be the last one */
-};
-
-#define OFFSET(x) offsetof(dc1394_data, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-#if HAVE_LIBDC1394_1
-    { "channel", "", offsetof(dc1394_data, channel), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-#endif
-    { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "qvga"}, 0, 0, DEC },
-    { "pixel_format", "", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = "uyvy422"}, 0, 0, DEC },
-    { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
-    { NULL },
-};
-
-static const AVClass libdc1394_class = {
-    .class_name = "libdc1394 indev",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-
-static inline int dc1394_read_common(AVFormatContext *c,
-                                     struct dc1394_frame_format **select_fmt, struct dc1394_frame_rate **select_fps)
-{
-    dc1394_data* dc1394 = c->priv_data;
-    AVStream* vst;
-    struct dc1394_frame_format *fmt;
-    struct dc1394_frame_rate *fps;
-    enum AVPixelFormat pix_fmt;
-    int width, height;
-    AVRational framerate;
-    int ret = 0;
-
-    if ((pix_fmt = av_get_pix_fmt(dc1394->pixel_format)) == AV_PIX_FMT_NONE) {
-        av_log(c, AV_LOG_ERROR, "No such pixel format: %s.\n", dc1394->pixel_format);
-        ret = AVERROR(EINVAL);
-        goto out;
-    }
-
-    if ((ret = av_parse_video_size(&width, &height, dc1394->video_size)) < 0) {
-        av_log(c, AV_LOG_ERROR, "Could not parse video size '%s'.\n", dc1394->video_size);
-        goto out;
-    }
-    if ((ret = av_parse_video_rate(&framerate, dc1394->framerate)) < 0) {
-        av_log(c, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", dc1394->framerate);
-        goto out;
-    }
-    dc1394->frame_rate = av_rescale(1000, framerate.num, framerate.den);
-
-    for (fmt = dc1394_frame_formats; fmt->width; fmt++)
-         if (fmt->pix_fmt == pix_fmt && fmt->width == width && fmt->height == height)
-             break;
-
-    for (fps = dc1394_frame_rates; fps->frame_rate; fps++)
-         if (fps->frame_rate == dc1394->frame_rate)
-             break;
-
-    if (!fps->frame_rate || !fmt->width) {
-        av_log(c, AV_LOG_ERROR, "Can't find matching camera format for %s, %dx%d@%d:1000fps\n", av_get_pix_fmt_name(pix_fmt),
-                                                                                                width, height, dc1394->frame_rate);
-        ret = AVERROR(EINVAL);
-        goto out;
-    }
-
-    /* create a video stream */
-    vst = avformat_new_stream(c, NULL);
-    if (!vst) {
-        ret = AVERROR(ENOMEM);
-        goto out;
-    }
-    avpriv_set_pts_info(vst, 64, 1, 1000);
-    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
-    vst->codec->time_base.den = framerate.num;
-    vst->codec->time_base.num = framerate.den;
-    vst->codec->width = fmt->width;
-    vst->codec->height = fmt->height;
-    vst->codec->pix_fmt = fmt->pix_fmt;
-
-    /* packet init */
-    av_init_packet(&dc1394->packet);
-    dc1394->packet.size = avpicture_get_size(fmt->pix_fmt, fmt->width, fmt->height);
-    dc1394->packet.stream_index = vst->index;
-    dc1394->packet.flags |= AV_PKT_FLAG_KEY;
-
-    dc1394->current_frame = 0;
-
-    vst->codec->bit_rate = av_rescale(dc1394->packet.size * 8, fps->frame_rate, 1000);
-    *select_fps = fps;
-    *select_fmt = fmt;
-out:
-    return ret;
-}
-
-#if HAVE_LIBDC1394_1
-static int dc1394_v1_read_header(AVFormatContext *c)
-{
-    dc1394_data* dc1394 = c->priv_data;
-    AVStream* vst;
-    nodeid_t* camera_nodes;
-    int res;
-    struct dc1394_frame_format *fmt = NULL;
-    struct dc1394_frame_rate *fps = NULL;
-
-    if (dc1394_read_common(c, &fmt, &fps) != 0)
-        return -1;
-
-    /* Now let us prep the hardware. */
-    dc1394->handle = dc1394_create_handle(0); /* FIXME: gotta have ap->port */
-    if (!dc1394->handle) {
-        av_log(c, AV_LOG_ERROR, "Can't acquire dc1394 handle on port %d\n", 0 /* ap->port */);
-        goto out;
-    }
-    camera_nodes = dc1394_get_camera_nodes(dc1394->handle, &res, 1);
-    if (!camera_nodes || camera_nodes[dc1394->channel] == DC1394_NO_CAMERA) {
-        av_log(c, AV_LOG_ERROR, "There's no IIDC camera on the channel %d\n", dc1394->channel);
-        goto out_handle;
-    }
-    res = dc1394_dma_setup_capture(dc1394->handle, camera_nodes[dc1394->channel],
-                                   0,
-                                   FORMAT_VGA_NONCOMPRESSED,
-                                   fmt->frame_size_id,
-                                   SPEED_400,
-                                   fps->frame_rate_id, 8, 1,
-                                   c->filename,
-                                   &dc1394->camera);
-    dc1394_free_camera_nodes(camera_nodes);
-    if (res != DC1394_SUCCESS) {
-        av_log(c, AV_LOG_ERROR, "Can't prepare camera for the DMA capture\n");
-        goto out_handle;
-    }
-
-    res = dc1394_start_iso_transmission(dc1394->handle, dc1394->camera.node);
-    if (res != DC1394_SUCCESS) {
-        av_log(c, AV_LOG_ERROR, "Can't start isochronous transmission\n");
-        goto out_handle_dma;
-    }
-
-    return 0;
-
-out_handle_dma:
-    dc1394_dma_unlisten(dc1394->handle, &dc1394->camera);
-    dc1394_dma_release_camera(dc1394->handle, &dc1394->camera);
-out_handle:
-    dc1394_destroy_handle(dc1394->handle);
-out:
-    return -1;
-}
-
-static int dc1394_v1_read_packet(AVFormatContext *c, AVPacket *pkt)
-{
-    struct dc1394_data *dc1394 = c->priv_data;
-    int res;
-
-    /* discard stale frame */
-    if (dc1394->current_frame++) {
-        if (dc1394_dma_done_with_buffer(&dc1394->camera) != DC1394_SUCCESS)
-            av_log(c, AV_LOG_ERROR, "failed to release %d frame\n", dc1394->current_frame);
-    }
-
-    res = dc1394_dma_single_capture(&dc1394->camera);
-
-    if (res == DC1394_SUCCESS) {
-        dc1394->packet.data = (uint8_t *)(dc1394->camera.capture_buffer);
-        dc1394->packet.pts = (dc1394->current_frame * 1000000) / dc1394->frame_rate;
-        res = dc1394->packet.size;
-    } else {
-        av_log(c, AV_LOG_ERROR, "DMA capture failed\n");
-        dc1394->packet.data = NULL;
-        res = -1;
-    }
-
-    *pkt = dc1394->packet;
-    return res;
-}
-
-static int dc1394_v1_close(AVFormatContext * context)
-{
-    struct dc1394_data *dc1394 = context->priv_data;
-
-    dc1394_stop_iso_transmission(dc1394->handle, dc1394->camera.node);
-    dc1394_dma_unlisten(dc1394->handle, &dc1394->camera);
-    dc1394_dma_release_camera(dc1394->handle, &dc1394->camera);
-    dc1394_destroy_handle(dc1394->handle);
-
-    return 0;
-}
-
-#elif HAVE_LIBDC1394_2
-static int dc1394_v2_read_header(AVFormatContext *c)
-{
-    dc1394_data* dc1394 = c->priv_data;
-    dc1394camera_list_t *list;
-    int res, i;
-    struct dc1394_frame_format *fmt = NULL;
-    struct dc1394_frame_rate *fps = NULL;
-
-    if (dc1394_read_common(c, &fmt, &fps) != 0)
-       return -1;
-
-    /* Now let us prep the hardware. */
-    dc1394->d = dc1394_new();
-    dc1394_camera_enumerate (dc1394->d, &list);
-    if ( !list || list->num == 0) {
-        av_log(c, AV_LOG_ERROR, "Unable to look for an IIDC camera\n\n");
-        goto out;
-    }
-
-    /* FIXME: To select a specific camera I need to search in list its guid */
-    dc1394->camera = dc1394_camera_new (dc1394->d, list->ids[0].guid);
-    if (list->num > 1) {
-        av_log(c, AV_LOG_INFO, "Working with the first camera found\n");
-    }
-
-    /* Freeing list of cameras */
-    dc1394_camera_free_list (list);
-
-    /* Select MAX Speed possible from the cam */
-    if (dc1394->camera->bmode_capable>0) {
-       dc1394_video_set_operation_mode(dc1394->camera, DC1394_OPERATION_MODE_1394B);
-       i = DC1394_ISO_SPEED_800;
-    } else {
-       i = DC1394_ISO_SPEED_400;
-    }
-
-    for (res = DC1394_FAILURE; i >= DC1394_ISO_SPEED_MIN && res != DC1394_SUCCESS; i--) {
-            res=dc1394_video_set_iso_speed(dc1394->camera, i);
-    }
-    if (res != DC1394_SUCCESS) {
-        av_log(c, AV_LOG_ERROR, "Couldn't set ISO Speed\n");
-        goto out_camera;
-    }
-
-    if (dc1394_video_set_mode(dc1394->camera, fmt->frame_size_id) != DC1394_SUCCESS) {
-        av_log(c, AV_LOG_ERROR, "Couldn't set video format\n");
-        goto out_camera;
-    }
-
-    if (dc1394_video_set_framerate(dc1394->camera,fps->frame_rate_id) != DC1394_SUCCESS) {
-        av_log(c, AV_LOG_ERROR, "Couldn't set framerate %d \n",fps->frame_rate);
-        goto out_camera;
-    }
-    if (dc1394_capture_setup(dc1394->camera, 10, DC1394_CAPTURE_FLAGS_DEFAULT)!=DC1394_SUCCESS) {
-        av_log(c, AV_LOG_ERROR, "Cannot setup camera \n");
-        goto out_camera;
-    }
-
-    if (dc1394_video_set_transmission(dc1394->camera, DC1394_ON) !=DC1394_SUCCESS) {
-        av_log(c, AV_LOG_ERROR, "Cannot start capture\n");
-        goto out_camera;
-    }
-    return 0;
-
-out_camera:
-    dc1394_capture_stop(dc1394->camera);
-    dc1394_video_set_transmission(dc1394->camera, DC1394_OFF);
-    dc1394_camera_free (dc1394->camera);
-out:
-    dc1394_free(dc1394->d);
-    return -1;
-}
-
-static int dc1394_v2_read_packet(AVFormatContext *c, AVPacket *pkt)
-{
-    struct dc1394_data *dc1394 = c->priv_data;
-    int res;
-
-    /* discard stale frame */
-    if (dc1394->current_frame++) {
-        if (dc1394_capture_enqueue(dc1394->camera, dc1394->frame) != DC1394_SUCCESS)
-            av_log(c, AV_LOG_ERROR, "failed to release %d frame\n", dc1394->current_frame);
-    }
-
-    res = dc1394_capture_dequeue(dc1394->camera, DC1394_CAPTURE_POLICY_WAIT, &dc1394->frame);
-    if (res == DC1394_SUCCESS) {
-        dc1394->packet.data = (uint8_t *) dc1394->frame->image;
-        dc1394->packet.pts  = dc1394->current_frame * 1000000 / dc1394->frame_rate;
-        res = dc1394->frame->image_bytes;
-    } else {
-        av_log(c, AV_LOG_ERROR, "DMA capture failed\n");
-        dc1394->packet.data = NULL;
-        res = -1;
-    }
-
-    *pkt = dc1394->packet;
-    return res;
-}
-
-static int dc1394_v2_close(AVFormatContext * context)
-{
-    struct dc1394_data *dc1394 = context->priv_data;
-
-    dc1394_video_set_transmission(dc1394->camera, DC1394_OFF);
-    dc1394_capture_stop(dc1394->camera);
-    dc1394_camera_free(dc1394->camera);
-    dc1394_free(dc1394->d);
-
-    return 0;
-}
-
-AVInputFormat ff_libdc1394_demuxer = {
-    .name           = "libdc1394",
-    .long_name      = NULL_IF_CONFIG_SMALL("dc1394 v.2 A/V grab"),
-    .priv_data_size = sizeof(struct dc1394_data),
-    .read_header    = dc1394_v2_read_header,
-    .read_packet    = dc1394_v2_read_packet,
-    .read_close     = dc1394_v2_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &libdc1394_class,
-};
-
-#endif
-#if HAVE_LIBDC1394_1
-AVInputFormat ff_libdc1394_demuxer = {
-    .name           = "libdc1394",
-    .long_name      = NULL_IF_CONFIG_SMALL("dc1394 v.1 A/V grab"),
-    .priv_data_size = sizeof(struct dc1394_data),
-    .read_header    = dc1394_v1_read_header,
-    .read_packet    = dc1394_v1_read_packet,
-    .read_close     = dc1394_v1_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &libdc1394_class,
-};
-#endif
diff --git a/deps/libav/libavdevice/oss_audio.c b/deps/libav/libavdevice/oss_audio.c
deleted file mode 100644
index f1cc91f..0000000
--- a/deps/libav/libavdevice/oss_audio.c
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Linux audio play and grab interface
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <string.h>
-#include <errno.h>
-#if HAVE_SOUNDCARD_H
-#include <soundcard.h>
-#else
-#include <sys/soundcard.h>
-#endif
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/time.h"
-#include "libavcodec/avcodec.h"
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-
-#define AUDIO_BLOCK_SIZE 4096
-
-typedef struct {
-    AVClass *class;
-    int fd;
-    int sample_rate;
-    int channels;
-    int frame_size; /* in bytes ! */
-    enum AVCodecID codec_id;
-    unsigned int flip_left : 1;
-    uint8_t buffer[AUDIO_BLOCK_SIZE];
-    int buffer_ptr;
-} AudioData;
-
-static int audio_open(AVFormatContext *s1, int is_output, const char *audio_device)
-{
-    AudioData *s = s1->priv_data;
-    int audio_fd;
-    int tmp, err;
-    char *flip = getenv("AUDIO_FLIP_LEFT");
-
-    if (is_output)
-        audio_fd = avpriv_open(audio_device, O_WRONLY);
-    else
-        audio_fd = avpriv_open(audio_device, O_RDONLY);
-    if (audio_fd < 0) {
-        av_log(s1, AV_LOG_ERROR, "%s: %s\n", audio_device, strerror(errno));
-        return AVERROR(EIO);
-    }
-
-    if (flip && *flip == '1') {
-        s->flip_left = 1;
-    }
-
-    /* non blocking mode */
-    if (!is_output)
-        fcntl(audio_fd, F_SETFL, O_NONBLOCK);
-
-    s->frame_size = AUDIO_BLOCK_SIZE;
-
-    /* select format : favour native format */
-    err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
-
-#if HAVE_BIGENDIAN
-    if (tmp & AFMT_S16_BE) {
-        tmp = AFMT_S16_BE;
-    } else if (tmp & AFMT_S16_LE) {
-        tmp = AFMT_S16_LE;
-    } else {
-        tmp = 0;
-    }
-#else
-    if (tmp & AFMT_S16_LE) {
-        tmp = AFMT_S16_LE;
-    } else if (tmp & AFMT_S16_BE) {
-        tmp = AFMT_S16_BE;
-    } else {
-        tmp = 0;
-    }
-#endif
-
-    switch(tmp) {
-    case AFMT_S16_LE:
-        s->codec_id = AV_CODEC_ID_PCM_S16LE;
-        break;
-    case AFMT_S16_BE:
-        s->codec_id = AV_CODEC_ID_PCM_S16BE;
-        break;
-    default:
-        av_log(s1, AV_LOG_ERROR, "Soundcard does not support 16 bit sample format\n");
-        close(audio_fd);
-        return AVERROR(EIO);
-    }
-    err=ioctl(audio_fd, SNDCTL_DSP_SETFMT, &tmp);
-    if (err < 0) {
-        av_log(s1, AV_LOG_ERROR, "SNDCTL_DSP_SETFMT: %s\n", strerror(errno));
-        goto fail;
-    }
-
-    tmp = (s->channels == 2);
-    err = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp);
-    if (err < 0) {
-        av_log(s1, AV_LOG_ERROR, "SNDCTL_DSP_STEREO: %s\n", strerror(errno));
-        goto fail;
-    }
-
-    tmp = s->sample_rate;
-    err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &tmp);
-    if (err < 0) {
-        av_log(s1, AV_LOG_ERROR, "SNDCTL_DSP_SPEED: %s\n", strerror(errno));
-        goto fail;
-    }
-    s->sample_rate = tmp; /* store real sample rate */
-    s->fd = audio_fd;
-
-    return 0;
- fail:
-    close(audio_fd);
-    return AVERROR(EIO);
-}
-
-static int audio_close(AudioData *s)
-{
-    close(s->fd);
-    return 0;
-}
-
-/* sound output support */
-static int audio_write_header(AVFormatContext *s1)
-{
-    AudioData *s = s1->priv_data;
-    AVStream *st;
-    int ret;
-
-    st = s1->streams[0];
-    s->sample_rate = st->codec->sample_rate;
-    s->channels = st->codec->channels;
-    ret = audio_open(s1, 1, s1->filename);
-    if (ret < 0) {
-        return AVERROR(EIO);
-    } else {
-        return 0;
-    }
-}
-
-static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    AudioData *s = s1->priv_data;
-    int len, ret;
-    int size= pkt->size;
-    uint8_t *buf= pkt->data;
-
-    while (size > 0) {
-        len = FFMIN(AUDIO_BLOCK_SIZE - s->buffer_ptr, size);
-        memcpy(s->buffer + s->buffer_ptr, buf, len);
-        s->buffer_ptr += len;
-        if (s->buffer_ptr >= AUDIO_BLOCK_SIZE) {
-            for(;;) {
-                ret = write(s->fd, s->buffer, AUDIO_BLOCK_SIZE);
-                if (ret > 0)
-                    break;
-                if (ret < 0 && (errno != EAGAIN && errno != EINTR))
-                    return AVERROR(EIO);
-            }
-            s->buffer_ptr = 0;
-        }
-        buf += len;
-        size -= len;
-    }
-    return 0;
-}
-
-static int audio_write_trailer(AVFormatContext *s1)
-{
-    AudioData *s = s1->priv_data;
-
-    audio_close(s);
-    return 0;
-}
-
-/* grab support */
-
-static int audio_read_header(AVFormatContext *s1)
-{
-    AudioData *s = s1->priv_data;
-    AVStream *st;
-    int ret;
-
-    st = avformat_new_stream(s1, NULL);
-    if (!st) {
-        return AVERROR(ENOMEM);
-    }
-
-    ret = audio_open(s1, 0, s1->filename);
-    if (ret < 0) {
-        return AVERROR(EIO);
-    }
-
-    /* take real parameters */
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = s->codec_id;
-    st->codec->sample_rate = s->sample_rate;
-    st->codec->channels = s->channels;
-
-    avpriv_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */
-    return 0;
-}
-
-static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    AudioData *s = s1->priv_data;
-    int ret, bdelay;
-    int64_t cur_time;
-    struct audio_buf_info abufi;
-
-    if ((ret=av_new_packet(pkt, s->frame_size)) < 0)
-        return ret;
-
-    ret = read(s->fd, pkt->data, pkt->size);
-    if (ret <= 0){
-        av_free_packet(pkt);
-        pkt->size = 0;
-        if (ret<0)  return AVERROR(errno);
-        else        return AVERROR_EOF;
-    }
-    pkt->size = ret;
-
-    /* compute pts of the start of the packet */
-    cur_time = av_gettime();
-    bdelay = ret;
-    if (ioctl(s->fd, SNDCTL_DSP_GETISPACE, &abufi) == 0) {
-        bdelay += abufi.bytes;
-    }
-    /* subtract time represented by the number of bytes in the audio fifo */
-    cur_time -= (bdelay * 1000000LL) / (s->sample_rate * s->channels);
-
-    /* convert to wanted units */
-    pkt->pts = cur_time;
-
-    if (s->flip_left && s->channels == 2) {
-        int i;
-        short *p = (short *) pkt->data;
-
-        for (i = 0; i < ret; i += 4) {
-            *p = ~*p;
-            p += 2;
-        }
-    }
-    return 0;
-}
-
-static int audio_read_close(AVFormatContext *s1)
-{
-    AudioData *s = s1->priv_data;
-
-    audio_close(s);
-    return 0;
-}
-
-#if CONFIG_OSS_INDEV
-static const AVOption options[] = {
-    { "sample_rate", "", offsetof(AudioData, sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { "channels",    "", offsetof(AudioData, channels),    AV_OPT_TYPE_INT, {.i64 = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-static const AVClass oss_demuxer_class = {
-    .class_name     = "OSS demuxer",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_oss_demuxer = {
-    .name           = "oss",
-    .long_name      = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) capture"),
-    .priv_data_size = sizeof(AudioData),
-    .read_header    = audio_read_header,
-    .read_packet    = audio_read_packet,
-    .read_close     = audio_read_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &oss_demuxer_class,
-};
-#endif
-
-#if CONFIG_OSS_OUTDEV
-AVOutputFormat ff_oss_muxer = {
-    .name           = "oss",
-    .long_name      = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) playback"),
-    .priv_data_size = sizeof(AudioData),
-    /* XXX: we make the assumption that the soundcard accepts this format */
-    /* XXX: find better solution with "preinit" method, needed also in
-       other formats */
-    .audio_codec    = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
-    .video_codec    = AV_CODEC_ID_NONE,
-    .write_header   = audio_write_header,
-    .write_packet   = audio_write_packet,
-    .write_trailer  = audio_write_trailer,
-    .flags          = AVFMT_NOFILE,
-};
-#endif
diff --git a/deps/libav/libavdevice/pulse.c b/deps/libav/libavdevice/pulse.c
deleted file mode 100644
index a8e710d..0000000
--- a/deps/libav/libavdevice/pulse.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Pulseaudio input
- * Copyright (c) 2011 Luca Barbato <lu_zero at gentoo.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * PulseAudio input using the simple API.
- * @author Luca Barbato <lu_zero at gentoo.org>
- */
-
-#include <pulse/simple.h>
-#include <pulse/rtclock.h>
-#include <pulse/error.h>
-
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-#include "libavutil/opt.h"
-
-#define DEFAULT_CODEC_ID AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE)
-
-typedef struct PulseData {
-    AVClass *class;
-    char *server;
-    char *name;
-    char *stream_name;
-    int  sample_rate;
-    int  channels;
-    int  frame_size;
-    int  fragment_size;
-    pa_simple *s;
-    int64_t pts;
-    int64_t frame_duration;
-} PulseData;
-
-static pa_sample_format_t codec_id_to_pulse_format(int codec_id) {
-    switch (codec_id) {
-    case AV_CODEC_ID_PCM_U8:    return PA_SAMPLE_U8;
-    case AV_CODEC_ID_PCM_ALAW:  return PA_SAMPLE_ALAW;
-    case AV_CODEC_ID_PCM_MULAW: return PA_SAMPLE_ULAW;
-    case AV_CODEC_ID_PCM_S16LE: return PA_SAMPLE_S16LE;
-    case AV_CODEC_ID_PCM_S16BE: return PA_SAMPLE_S16BE;
-    case AV_CODEC_ID_PCM_F32LE: return PA_SAMPLE_FLOAT32LE;
-    case AV_CODEC_ID_PCM_F32BE: return PA_SAMPLE_FLOAT32BE;
-    case AV_CODEC_ID_PCM_S32LE: return PA_SAMPLE_S32LE;
-    case AV_CODEC_ID_PCM_S32BE: return PA_SAMPLE_S32BE;
-    case AV_CODEC_ID_PCM_S24LE: return PA_SAMPLE_S24LE;
-    case AV_CODEC_ID_PCM_S24BE: return PA_SAMPLE_S24BE;
-    default:                 return PA_SAMPLE_INVALID;
-    }
-}
-
-static av_cold int pulse_read_header(AVFormatContext *s)
-{
-    PulseData *pd = s->priv_data;
-    AVStream *st;
-    char *device = NULL;
-    int ret;
-    enum AVCodecID codec_id =
-        s->audio_codec_id == AV_CODEC_ID_NONE ? DEFAULT_CODEC_ID : s->audio_codec_id;
-    const pa_sample_spec ss = { codec_id_to_pulse_format(codec_id),
-                                pd->sample_rate,
-                                pd->channels };
-
-    pa_buffer_attr attr = { -1 };
-
-    st = avformat_new_stream(s, NULL);
-
-    if (!st) {
-        av_log(s, AV_LOG_ERROR, "Cannot add stream\n");
-        return AVERROR(ENOMEM);
-    }
-
-    attr.fragsize = pd->fragment_size;
-
-    if (strcmp(s->filename, "default"))
-        device = s->filename;
-
-    pd->s = pa_simple_new(pd->server, pd->name,
-                          PA_STREAM_RECORD,
-                          device, pd->stream_name, &ss,
-                          NULL, &attr, &ret);
-
-    if (!pd->s) {
-        av_log(s, AV_LOG_ERROR, "pa_simple_new failed: %s\n",
-               pa_strerror(ret));
-        return AVERROR(EIO);
-    }
-    /* take real parameters */
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id    = codec_id;
-    st->codec->sample_rate = pd->sample_rate;
-    st->codec->channels    = pd->channels;
-    avpriv_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */
-
-    pd->pts = AV_NOPTS_VALUE;
-    pd->frame_duration = (pd->frame_size * 1000000LL * 8) /
-        (pd->sample_rate * pd->channels * av_get_bits_per_sample(codec_id));
-
-    return 0;
-}
-
-static int pulse_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    PulseData *pd  = s->priv_data;
-    int res;
-    pa_usec_t latency;
-
-    if (av_new_packet(pkt, pd->frame_size) < 0) {
-        return AVERROR(ENOMEM);
-    }
-
-    if ((pa_simple_read(pd->s, pkt->data, pkt->size, &res)) < 0) {
-        av_log(s, AV_LOG_ERROR, "pa_simple_read failed: %s\n",
-               pa_strerror(res));
-        av_free_packet(pkt);
-        return AVERROR(EIO);
-    }
-
-    if ((latency = pa_simple_get_latency(pd->s, &res)) == (pa_usec_t) -1) {
-        av_log(s, AV_LOG_ERROR, "pa_simple_get_latency() failed: %s\n",
-               pa_strerror(res));
-        return AVERROR(EIO);
-    }
-
-    if (pd->pts == AV_NOPTS_VALUE) {
-        pd->pts = -latency;
-    }
-
-    pkt->pts = pd->pts;
-
-    pd->pts += pd->frame_duration;
-
-    return 0;
-}
-
-static av_cold int pulse_close(AVFormatContext *s)
-{
-    PulseData *pd = s->priv_data;
-    pa_simple_free(pd->s);
-    return 0;
-}
-
-#define OFFSET(a) offsetof(PulseData, a)
-#define D AV_OPT_FLAG_DECODING_PARAM
-
-static const AVOption options[] = {
-    { "server",        "pulse server name",                              OFFSET(server),        AV_OPT_TYPE_STRING, {.str = NULL},     0, 0, D },
-    { "name",          "application name",                               OFFSET(name),          AV_OPT_TYPE_STRING, {.str = "libav"},  0, 0, D },
-    { "stream_name",   "stream description",                             OFFSET(stream_name),   AV_OPT_TYPE_STRING, {.str = "record"}, 0, 0, D },
-    { "sample_rate",   "sample rate in Hz",                              OFFSET(sample_rate),   AV_OPT_TYPE_INT,    {.i64 = 48000},    1, INT_MAX, D },
-    { "channels",      "number of audio channels",                       OFFSET(channels),      AV_OPT_TYPE_INT,    {.i64 = 2},        1, INT_MAX, D },
-    { "frame_size",    "number of bytes per frame",                      OFFSET(frame_size),    AV_OPT_TYPE_INT,    {.i64 = 1024},     1, INT_MAX, D },
-    { "fragment_size", "buffering size, affects latency and cpu usage",  OFFSET(fragment_size), AV_OPT_TYPE_INT,    {.i64 = -1},      -1, INT_MAX, D },
-    { NULL },
-};
-
-static const AVClass pulse_demuxer_class = {
-    .class_name     = "Pulse demuxer",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_pulse_demuxer = {
-    .name           = "pulse",
-    .long_name      = NULL_IF_CONFIG_SMALL("Pulse audio input"),
-    .priv_data_size = sizeof(PulseData),
-    .read_header    = pulse_read_header,
-    .read_packet    = pulse_read_packet,
-    .read_close     = pulse_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &pulse_demuxer_class,
-};
diff --git a/deps/libav/libavdevice/sndio_common.c b/deps/libav/libavdevice/sndio_common.c
deleted file mode 100644
index 1bea6c5..0000000
--- a/deps/libav/libavdevice/sndio_common.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * sndio play and grab interface
- * Copyright (c) 2010 Jacob Meuser
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <sndio.h>
-
-#include "libavformat/avformat.h"
-
-#include "sndio_common.h"
-
-static inline void movecb(void *addr, int delta)
-{
-    SndioData *s = addr;
-
-    s->hwpos += delta * s->channels * s->bps;
-}
-
-av_cold int ff_sndio_open(AVFormatContext *s1, int is_output,
-                          const char *audio_device)
-{
-    SndioData *s = s1->priv_data;
-    struct sio_hdl *hdl;
-    struct sio_par par;
-
-    hdl = sio_open(audio_device, is_output ? SIO_PLAY : SIO_REC, 0);
-    if (!hdl) {
-        av_log(s1, AV_LOG_ERROR, "Could not open sndio device\n");
-        return AVERROR(EIO);
-    }
-
-    sio_initpar(&par);
-
-    par.bits = 16;
-    par.sig  = 1;
-    par.le   = SIO_LE_NATIVE;
-
-    if (is_output)
-        par.pchan = s->channels;
-    else
-        par.rchan = s->channels;
-    par.rate = s->sample_rate;
-
-    if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) {
-        av_log(s1, AV_LOG_ERROR, "Impossible to set sndio parameters, "
-               "channels: %d sample rate: %d\n", s->channels, s->sample_rate);
-        goto fail;
-    }
-
-    if (par.bits != 16 || par.sig != 1 ||
-        (is_output  && (par.pchan != s->channels)) ||
-        (!is_output && (par.rchan != s->channels)) ||
-        (par.rate != s->sample_rate)) {
-        av_log(s1, AV_LOG_ERROR, "Could not set appropriate sndio parameters, "
-               "channels: %d sample rate: %d\n", s->channels, s->sample_rate);
-        goto fail;
-    }
-
-    s->buffer_size = par.round * par.bps *
-                     (is_output ? par.pchan : par.rchan);
-
-    if (is_output) {
-        s->buffer = av_malloc(s->buffer_size);
-        if (!s->buffer) {
-            av_log(s1, AV_LOG_ERROR, "Could not allocate buffer\n");
-            goto fail;
-        }
-    }
-
-    s->codec_id    = par.le ? AV_CODEC_ID_PCM_S16LE : AV_CODEC_ID_PCM_S16BE;
-    s->channels    = is_output ? par.pchan : par.rchan;
-    s->sample_rate = par.rate;
-    s->bps         = par.bps;
-
-    sio_onmove(hdl, movecb, s);
-
-    if (!sio_start(hdl)) {
-        av_log(s1, AV_LOG_ERROR, "Could not start sndio\n");
-        goto fail;
-    }
-
-    s->hdl = hdl;
-
-    return 0;
-
-fail:
-    av_freep(&s->buffer);
-
-    if (hdl)
-        sio_close(hdl);
-
-    return AVERROR(EIO);
-}
-
-int ff_sndio_close(SndioData *s)
-{
-    av_freep(&s->buffer);
-
-    if (s->hdl)
-        sio_close(s->hdl);
-
-    return 0;
-}
diff --git a/deps/libav/libavdevice/sndio_common.h b/deps/libav/libavdevice/sndio_common.h
deleted file mode 100644
index 2f70213..0000000
--- a/deps/libav/libavdevice/sndio_common.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * sndio play and grab interface
- * Copyright (c) 2010 Jacob Meuser
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVDEVICE_SNDIO_COMMON_H
-#define AVDEVICE_SNDIO_COMMON_H
-
-#include <stdint.h>
-#include <sndio.h>
-
-#include "libavformat/avformat.h"
-#include "libavutil/log.h"
-
-typedef struct SndioData {
-    AVClass *class;
-    struct sio_hdl *hdl;
-    enum AVCodecID codec_id;
-    int64_t hwpos;
-    int64_t softpos;
-    uint8_t *buffer;
-    int bps;
-    int buffer_size;
-    int buffer_offset;
-    int channels;
-    int sample_rate;
-} SndioData;
-
-int ff_sndio_open(AVFormatContext *s1, int is_output, const char *audio_device);
-int ff_sndio_close(SndioData *s);
-
-#endif /* AVDEVICE_SNDIO_COMMON_H */
diff --git a/deps/libav/libavdevice/sndio_dec.c b/deps/libav/libavdevice/sndio_dec.c
deleted file mode 100644
index 58caaa1..0000000
--- a/deps/libav/libavdevice/sndio_dec.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * sndio play and grab interface
- * Copyright (c) 2010 Jacob Meuser
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <sndio.h>
-
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-#include "libavutil/opt.h"
-#include "libavutil/time.h"
-
-#include "sndio_common.h"
-
-static av_cold int audio_read_header(AVFormatContext *s1)
-{
-    SndioData *s = s1->priv_data;
-    AVStream *st;
-    int ret;
-
-    st = avformat_new_stream(s1, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    ret = ff_sndio_open(s1, 0, s1->filename);
-    if (ret < 0)
-        return ret;
-
-    /* take real parameters */
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id    = s->codec_id;
-    st->codec->sample_rate = s->sample_rate;
-    st->codec->channels    = s->channels;
-
-    avpriv_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */
-
-    return 0;
-}
-
-static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    SndioData *s = s1->priv_data;
-    int64_t bdelay, cur_time;
-    int ret;
-
-    if ((ret = av_new_packet(pkt, s->buffer_size)) < 0)
-        return ret;
-
-    ret = sio_read(s->hdl, pkt->data, pkt->size);
-    if (ret == 0 || sio_eof(s->hdl)) {
-        av_free_packet(pkt);
-        return AVERROR_EOF;
-    }
-
-    pkt->size   = ret;
-    s->softpos += ret;
-
-    /* compute pts of the start of the packet */
-    cur_time = av_gettime();
-
-    bdelay = ret + s->hwpos - s->softpos;
-
-    /* convert to pts */
-    pkt->pts = cur_time - ((bdelay * 1000000) /
-        (s->bps * s->channels * s->sample_rate));
-
-    return 0;
-}
-
-static av_cold int audio_read_close(AVFormatContext *s1)
-{
-    SndioData *s = s1->priv_data;
-
-    ff_sndio_close(s);
-
-    return 0;
-}
-
-static const AVOption options[] = {
-    { "sample_rate", "", offsetof(SndioData, sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { "channels",    "", offsetof(SndioData, channels),    AV_OPT_TYPE_INT, {.i64 = 2},     1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-static const AVClass sndio_demuxer_class = {
-    .class_name     = "sndio indev",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_sndio_demuxer = {
-    .name           = "sndio",
-    .long_name      = NULL_IF_CONFIG_SMALL("sndio audio capture"),
-    .priv_data_size = sizeof(SndioData),
-    .read_header    = audio_read_header,
-    .read_packet    = audio_read_packet,
-    .read_close     = audio_read_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &sndio_demuxer_class,
-};
diff --git a/deps/libav/libavdevice/sndio_enc.c b/deps/libav/libavdevice/sndio_enc.c
deleted file mode 100644
index 6f69b9e..0000000
--- a/deps/libav/libavdevice/sndio_enc.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * sndio play and grab interface
- * Copyright (c) 2010 Jacob Meuser
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <sndio.h>
-
-#include "libavformat/avformat.h"
-
-#include "sndio_common.h"
-
-static av_cold int audio_write_header(AVFormatContext *s1)
-{
-    SndioData *s = s1->priv_data;
-    AVStream *st;
-    int ret;
-
-    st             = s1->streams[0];
-    s->sample_rate = st->codec->sample_rate;
-    s->channels    = st->codec->channels;
-
-    ret = ff_sndio_open(s1, 1, s1->filename);
-
-    return ret;
-}
-
-static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    SndioData *s = s1->priv_data;
-    uint8_t *buf= pkt->data;
-    int size = pkt->size;
-    int len, ret;
-
-    while (size > 0) {
-        len = FFMIN(s->buffer_size - s->buffer_offset, size);
-        memcpy(s->buffer + s->buffer_offset, buf, len);
-        buf  += len;
-        size -= len;
-        s->buffer_offset += len;
-        if (s->buffer_offset >= s->buffer_size) {
-            ret = sio_write(s->hdl, s->buffer, s->buffer_size);
-            if (ret == 0 || sio_eof(s->hdl))
-                return AVERROR(EIO);
-            s->softpos      += ret;
-            s->buffer_offset = 0;
-        }
-    }
-
-    return 0;
-}
-
-static int audio_write_trailer(AVFormatContext *s1)
-{
-    SndioData *s = s1->priv_data;
-
-    sio_write(s->hdl, s->buffer, s->buffer_offset);
-
-    ff_sndio_close(s);
-
-    return 0;
-}
-
-AVOutputFormat ff_sndio_muxer = {
-    .name           = "sndio",
-    .long_name      = NULL_IF_CONFIG_SMALL("sndio audio playback"),
-    .priv_data_size = sizeof(SndioData),
-    /* XXX: we make the assumption that the soundcard accepts this format */
-    /* XXX: find better solution with "preinit" method, needed also in
-       other formats */
-    .audio_codec    = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
-    .video_codec    = AV_CODEC_ID_NONE,
-    .write_header   = audio_write_header,
-    .write_packet   = audio_write_packet,
-    .write_trailer  = audio_write_trailer,
-    .flags          = AVFMT_NOFILE,
-};
diff --git a/deps/libav/libavdevice/timefilter.c b/deps/libav/libavdevice/timefilter.c
deleted file mode 100644
index a497351..0000000
--- a/deps/libav/libavdevice/timefilter.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Delay Locked Loop based time filter
- * Copyright (c) 2009 Samalyse
- * Copyright (c) 2009 Michael Niedermayer
- * Author: Olivier Guilyardi <olivier samalyse com>
- *         Michael Niedermayer <michaelni gmx at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/mem.h"
-#include "config.h"
-#include "timefilter.h"
-
-struct TimeFilter {
-    // Delay Locked Loop data. These variables refer to mathematical
-    // concepts described in: http://www.kokkinizita.net/papers/usingdll.pdf
-    double cycle_time;
-    double feedback2_factor;
-    double feedback3_factor;
-    double clock_period;
-    int count;
-};
-
-TimeFilter *ff_timefilter_new(double clock_period,
-                              double feedback2_factor,
-                              double feedback3_factor)
-{
-    TimeFilter *self = av_mallocz(sizeof(TimeFilter));
-
-    if (!self)
-        return NULL;
-
-    self->clock_period     = clock_period;
-    self->feedback2_factor = feedback2_factor;
-    self->feedback3_factor = feedback3_factor;
-    return self;
-}
-
-void ff_timefilter_destroy(TimeFilter *self)
-{
-    av_freep(&self);
-}
-
-void ff_timefilter_reset(TimeFilter *self)
-{
-    self->count = 0;
-}
-
-double ff_timefilter_update(TimeFilter *self, double system_time, double period)
-{
-    self->count++;
-    if (self->count == 1) {
-        self->cycle_time = system_time;
-    } else {
-        double loop_error;
-        self->cycle_time += self->clock_period * period;
-        loop_error = system_time - self->cycle_time;
-
-        self->cycle_time   += FFMAX(self->feedback2_factor, 1.0 / self->count) * loop_error;
-        self->clock_period += self->feedback3_factor * loop_error / period;
-    }
-    return self->cycle_time;
-}
-
-#ifdef TEST
-#include "libavutil/lfg.h"
-#define LFG_MAX ((1LL << 32) - 1)
-
-int main(void)
-{
-    AVLFG prng;
-    double n0, n1;
-#define SAMPLES 1000
-    double ideal[SAMPLES];
-    double samples[SAMPLES];
-    for (n0 = 0; n0 < 40; n0 = 2 * n0 + 1) {
-        for (n1 = 0; n1 < 10; n1 = 2 * n1 + 1) {
-            double best_error = 1000000000;
-            double bestpar0   = 1;
-            double bestpar1   = 0.001;
-            int better, i;
-
-            av_lfg_init(&prng, 123);
-            for (i = 0; i < SAMPLES; i++) {
-                ideal[i]   = 10 + i + n1 * i / (1000);
-                samples[i] = ideal[i] + n0 * (av_lfg_get(&prng) - LFG_MAX / 2) / (LFG_MAX * 10LL);
-            }
-
-            do {
-                double par0, par1;
-                better = 0;
-                for (par0 = bestpar0 * 0.8; par0 <= bestpar0 * 1.21; par0 += bestpar0 * 0.05) {
-                    for (par1 = bestpar1 * 0.8; par1 <= bestpar1 * 1.21; par1 += bestpar1 * 0.05) {
-                        double error   = 0;
-                        TimeFilter *tf = ff_timefilter_new(1, par0, par1);
-                        if (!tf) {
-                            printf("Could not allocate memory for timefilter.\n");
-                            exit(1);
-                        }
-                        for (i = 0; i < SAMPLES; i++) {
-                            double filtered;
-                            filtered = ff_timefilter_update(tf, samples[i], 1);
-                            error   += (filtered - ideal[i]) * (filtered - ideal[i]);
-                        }
-                        ff_timefilter_destroy(tf);
-                        if (error < best_error) {
-                            best_error = error;
-                            bestpar0   = par0;
-                            bestpar1   = par1;
-                            better     = 1;
-                        }
-                    }
-                }
-            } while (better);
-#if 0
-            double lastfil = 9;
-            TimeFilter *tf = ff_timefilter_new(1, bestpar0, bestpar1);
-            for (i = 0; i < SAMPLES; i++) {
-                double filtered;
-                filtered = ff_timefilter_update(tf, samples[i], 1);
-                printf("%f %f %f %f\n", i - samples[i] + 10, filtered - samples[i],
-                       samples[FFMAX(i, 1)] - samples[FFMAX(i - 1, 0)], filtered - lastfil);
-                lastfil = filtered;
-            }
-            ff_timefilter_destroy(tf);
-#else
-            printf(" [%f %f %9f]", bestpar0, bestpar1, best_error);
-#endif
-        }
-        printf("\n");
-    }
-    return 0;
-}
-#endif
diff --git a/deps/libav/libavdevice/timefilter.h b/deps/libav/libavdevice/timefilter.h
deleted file mode 100644
index 2235db6..0000000
--- a/deps/libav/libavdevice/timefilter.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Delay Locked Loop based time filter prototypes and declarations
- * Copyright (c) 2009 Samalyse
- * Copyright (c) 2009 Michael Niedermayer
- * Author: Olivier Guilyardi <olivier samalyse com>
- *         Michael Niedermayer <michaelni gmx at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVDEVICE_TIMEFILTER_H
-#define AVDEVICE_TIMEFILTER_H
-
-/**
- * Opaque type representing a time filter state
- *
- * The purpose of this filter is to provide a way to compute accurate time
- * stamps that can be compared to wall clock time, especially when dealing
- * with two clocks: the system clock and a hardware device clock, such as
- * a soundcard.
- */
-typedef struct TimeFilter TimeFilter;
-
-
-/**
- * Create a new Delay Locked Loop time filter
- *
- * feedback2_factor and feedback3_factor are the factors used for the
- * multiplications that are respectively performed in the second and third
- * feedback paths of the loop.
- *
- * Unless you know what you are doing, you should set these as follow:
- *
- * o = 2 * M_PI * bandwidth * period
- * feedback2_factor = sqrt(2 * o)
- * feedback3_factor = o * o
- *
- * Where bandwidth is up to you to choose. Smaller values will filter out more
- * of the jitter, but also take a longer time for the loop to settle. A good
- * starting point is something between 0.3 and 3 Hz.
- *
- * @param clock_period period of the hardware clock in seconds
- *        (for example 1.0/44100)
- *
- * @return a pointer to a TimeFilter struct, or NULL on error
- *
- * For more details about these parameters and background concepts please see:
- * http://www.kokkinizita.net/papers/usingdll.pdf
- */
-TimeFilter * ff_timefilter_new(double clock_period, double feedback2_factor, double feedback3_factor);
-
-/**
- * Update the filter
- *
- * This function must be called in real time, at each process cycle.
- *
- * @param period the device cycle duration in clock_periods. For example, at
- * 44.1kHz and a buffer size of 512 frames, period = 512 when clock_period
- * was 1.0/44100, or 512/44100 if clock_period was 1.
- *
- * system_time, in seconds, should be the value of the system clock time,
- * at (or as close as possible to) the moment the device hardware interrupt
- * occurred (or any other event the device clock raises at the beginning of a
- * cycle).
- *
- * @return the filtered time, in seconds
- */
-double ff_timefilter_update(TimeFilter *self, double system_time, double period);
-
-/**
- * Reset the filter
- *
- * This function should mainly be called in case of XRUN.
- *
- * Warning: after calling this, the filter is in an undetermined state until
- * the next call to ff_timefilter_update()
- */
-void ff_timefilter_reset(TimeFilter *);
-
-/**
- * Free all resources associated with the filter
- */
-void ff_timefilter_destroy(TimeFilter *);
-
-#endif /* AVDEVICE_TIMEFILTER_H */
diff --git a/deps/libav/libavdevice/v4l2.c b/deps/libav/libavdevice/v4l2.c
deleted file mode 100644
index adb289d..0000000
--- a/deps/libav/libavdevice/v4l2.c
+++ /dev/null
@@ -1,900 +0,0 @@
-/*
- * Video4Linux2 grab interface
- * Copyright (c) 2000,2001 Fabrice Bellard
- * Copyright (c) 2006 Luca Abeni
- *
- * Part of this file is based on the V4L2 video capture example
- * (http://v4l2spec.bytesex.org/v4l2spec/capture.c)
- *
- * Thanks to Michael Niedermayer for providing the mapping between
- * V4L2_PIX_FMT_* and AV_PIX_FMT_*
- *
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#undef __STRICT_ANSI__ //workaround due to broken kernel headers
-#include "config.h"
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/time.h>
-#include <poll.h>
-#if HAVE_SYS_VIDEOIO_H
-#include <sys/videoio.h>
-#else
-#include <linux/videodev2.h>
-#endif
-#include "libavutil/atomic.h"
-#include "libavutil/avassert.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/avstring.h"
-#include "libavutil/mathematics.h"
-
-static const int desired_video_buffers = 256;
-
-#define V4L_ALLFORMATS  3
-#define V4L_RAWFORMATS  1
-#define V4L_COMPFORMATS 2
-
-struct video_data {
-    AVClass *class;
-    int fd;
-    int frame_format; /* V4L2_PIX_FMT_* */
-    int width, height;
-    int frame_size;
-    int timeout;
-    int interlaced;
-    int top_field_first;
-
-    int buffers;
-    volatile int buffers_queued;
-    void **buf_start;
-    unsigned int *buf_len;
-    char *standard;
-    int channel;
-    char *video_size;   /**< String describing video size,
-                             set by a private option. */
-    char *pixel_format; /**< Set by a private option. */
-    int list_format;    /**< Set by a private option. */
-    char *framerate;    /**< Set by a private option. */
-};
-
-struct buff_data {
-    struct video_data *s;
-    int index;
-    int fd;
-};
-
-struct fmt_map {
-    enum AVPixelFormat ff_fmt;
-    enum AVCodecID codec_id;
-    uint32_t v4l2_fmt;
-};
-
-static struct fmt_map fmt_conversion_table[] = {
-    //ff_fmt           codec_id           v4l2_fmt
-    { AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420  },
-    { AV_PIX_FMT_YUV422P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P },
-    { AV_PIX_FMT_YUYV422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV    },
-    { AV_PIX_FMT_UYVY422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY    },
-    { AV_PIX_FMT_YUV411P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P },
-    { AV_PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410  },
-    { AV_PIX_FMT_RGB555,  AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555  },
-    { AV_PIX_FMT_RGB565,  AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565  },
-    { AV_PIX_FMT_BGR24,   AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24   },
-    { AV_PIX_FMT_RGB24,   AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24   },
-    { AV_PIX_FMT_BGRA,    AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32   },
-    { AV_PIX_FMT_GRAY8,   AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY    },
-    { AV_PIX_FMT_NV12,    AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12    },
-    { AV_PIX_FMT_NONE,    AV_CODEC_ID_MJPEG,    V4L2_PIX_FMT_MJPEG   },
-    { AV_PIX_FMT_NONE,    AV_CODEC_ID_MJPEG,    V4L2_PIX_FMT_JPEG    },
-};
-
-static int device_open(AVFormatContext *ctx)
-{
-    struct v4l2_capability cap;
-    int fd;
-    int res, err;
-    int flags = O_RDWR;
-
-    if (ctx->flags & AVFMT_FLAG_NONBLOCK) {
-        flags |= O_NONBLOCK;
-    }
-
-    fd = avpriv_open(ctx->filename, flags);
-    if (fd < 0) {
-        err = errno;
-
-        av_log(ctx, AV_LOG_ERROR, "Cannot open video device %s : %s\n",
-               ctx->filename, strerror(err));
-
-        return AVERROR(err);
-    }
-
-    res = ioctl(fd, VIDIOC_QUERYCAP, &cap);
-    if (res < 0) {
-        err = errno;
-        av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QUERYCAP): %s\n",
-               strerror(err));
-
-        goto fail;
-    }
-
-    av_log(ctx, AV_LOG_VERBOSE, "[%d]Capabilities: %x\n",
-           fd, cap.capabilities);
-
-    if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
-        av_log(ctx, AV_LOG_ERROR, "Not a video capture device.\n");
-        err = ENODEV;
-
-        goto fail;
-    }
-
-    if (!(cap.capabilities & V4L2_CAP_STREAMING)) {
-        av_log(ctx, AV_LOG_ERROR,
-               "The device does not support the streaming I/O method.\n");
-        err = ENOSYS;
-
-        goto fail;
-    }
-
-    return fd;
-
-fail:
-    close(fd);
-    return AVERROR(err);
-}
-
-static int device_init(AVFormatContext *ctx, int *width, int *height,
-                       uint32_t pix_fmt)
-{
-    struct video_data *s = ctx->priv_data;
-    int fd = s->fd;
-    struct v4l2_format fmt = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE };
-    struct v4l2_pix_format *pix = &fmt.fmt.pix;
-
-    int res;
-
-    pix->width = *width;
-    pix->height = *height;
-    pix->pixelformat = pix_fmt;
-    pix->field = V4L2_FIELD_ANY;
-
-    res = ioctl(fd, VIDIOC_S_FMT, &fmt);
-
-    if ((*width != fmt.fmt.pix.width) || (*height != fmt.fmt.pix.height)) {
-        av_log(ctx, AV_LOG_INFO,
-               "The V4L2 driver changed the video from %dx%d to %dx%d\n",
-               *width, *height, fmt.fmt.pix.width, fmt.fmt.pix.height);
-        *width = fmt.fmt.pix.width;
-        *height = fmt.fmt.pix.height;
-    }
-
-    if (pix_fmt != fmt.fmt.pix.pixelformat) {
-        av_log(ctx, AV_LOG_DEBUG,
-               "The V4L2 driver changed the pixel format "
-               "from 0x%08X to 0x%08X\n",
-               pix_fmt, fmt.fmt.pix.pixelformat);
-        res = -1;
-    }
-
-    if (fmt.fmt.pix.field == V4L2_FIELD_INTERLACED) {
-        av_log(ctx, AV_LOG_DEBUG, "The V4L2 driver using the interlaced mode");
-        s->interlaced = 1;
-    }
-
-    return res;
-}
-
-static int first_field(int fd)
-{
-    int res;
-    v4l2_std_id std;
-
-    res = ioctl(fd, VIDIOC_G_STD, &std);
-    if (res < 0) {
-        return 0;
-    }
-    if (std & V4L2_STD_NTSC) {
-        return 0;
-    }
-
-    return 1;
-}
-
-static uint32_t fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id)
-{
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
-        if ((codec_id == AV_CODEC_ID_NONE ||
-             fmt_conversion_table[i].codec_id == codec_id) &&
-            (pix_fmt == AV_PIX_FMT_NONE ||
-             fmt_conversion_table[i].ff_fmt == pix_fmt)) {
-            return fmt_conversion_table[i].v4l2_fmt;
-        }
-    }
-
-    return 0;
-}
-
-static enum AVPixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id)
-{
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
-        if (fmt_conversion_table[i].v4l2_fmt == v4l2_fmt &&
-            fmt_conversion_table[i].codec_id == codec_id) {
-            return fmt_conversion_table[i].ff_fmt;
-        }
-    }
-
-    return AV_PIX_FMT_NONE;
-}
-
-static enum AVCodecID fmt_v4l2codec(uint32_t v4l2_fmt)
-{
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
-        if (fmt_conversion_table[i].v4l2_fmt == v4l2_fmt) {
-            return fmt_conversion_table[i].codec_id;
-        }
-    }
-
-    return AV_CODEC_ID_NONE;
-}
-
-#if HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE
-static void list_framesizes(AVFormatContext *ctx, int fd, uint32_t pixelformat)
-{
-    struct v4l2_frmsizeenum vfse = { .pixel_format = pixelformat };
-
-    while(!ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &vfse)) {
-        switch (vfse.type) {
-        case V4L2_FRMSIZE_TYPE_DISCRETE:
-            av_log(ctx, AV_LOG_INFO, " %ux%u",
-                   vfse.discrete.width, vfse.discrete.height);
-        break;
-        case V4L2_FRMSIZE_TYPE_CONTINUOUS:
-        case V4L2_FRMSIZE_TYPE_STEPWISE:
-            av_log(ctx, AV_LOG_INFO, " {%u-%u, %u}x{%u-%u, %u}",
-                   vfse.stepwise.min_width,
-                   vfse.stepwise.max_width,
-                   vfse.stepwise.step_width,
-                   vfse.stepwise.min_height,
-                   vfse.stepwise.max_height,
-                   vfse.stepwise.step_height);
-        }
-        vfse.index++;
-    }
-}
-#endif
-
-static void list_formats(AVFormatContext *ctx, int fd, int type)
-{
-    struct v4l2_fmtdesc vfd = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE };
-
-    while(!ioctl(fd, VIDIOC_ENUM_FMT, &vfd)) {
-        enum AVCodecID codec_id = fmt_v4l2codec(vfd.pixelformat);
-        enum AVPixelFormat pix_fmt = fmt_v4l2ff(vfd.pixelformat, codec_id);
-
-        vfd.index++;
-
-        if (!(vfd.flags & V4L2_FMT_FLAG_COMPRESSED) &&
-            type & V4L_RAWFORMATS) {
-            const char *fmt_name = av_get_pix_fmt_name(pix_fmt);
-            av_log(ctx, AV_LOG_INFO, "R : %9s : %20s :",
-                   fmt_name ? fmt_name : "Unsupported",
-                   vfd.description);
-        } else if (vfd.flags & V4L2_FMT_FLAG_COMPRESSED &&
-                   type & V4L_COMPFORMATS) {
-            AVCodec *codec = avcodec_find_encoder(codec_id);
-            av_log(ctx, AV_LOG_INFO, "C : %9s : %20s :",
-                   codec ? codec->name : "Unsupported",
-                   vfd.description);
-        } else {
-            continue;
-        }
-
-#ifdef V4L2_FMT_FLAG_EMULATED
-        if (vfd.flags & V4L2_FMT_FLAG_EMULATED) {
-            av_log(ctx, AV_LOG_WARNING, "%s", "Emulated");
-            continue;
-        }
-#endif
-#if HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE
-        list_framesizes(ctx, fd, vfd.pixelformat);
-#endif
-        av_log(ctx, AV_LOG_INFO, "\n");
-    }
-}
-
-static int mmap_init(AVFormatContext *ctx)
-{
-    int i, res;
-    struct video_data *s = ctx->priv_data;
-    struct v4l2_requestbuffers req = {
-        .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
-        .count  = desired_video_buffers,
-        .memory = V4L2_MEMORY_MMAP
-    };
-
-    res = ioctl(s->fd, VIDIOC_REQBUFS, &req);
-    if (res < 0) {
-        if (errno == EINVAL) {
-            av_log(ctx, AV_LOG_ERROR, "Device does not support mmap\n");
-        } else {
-            av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_REQBUFS)\n");
-        }
-
-        return AVERROR(errno);
-    }
-
-    if (req.count < 2) {
-        av_log(ctx, AV_LOG_ERROR, "Insufficient buffer memory\n");
-
-        return AVERROR(ENOMEM);
-    }
-    s->buffers = req.count;
-    s->buf_start = av_malloc(sizeof(void *) * s->buffers);
-    if (s->buf_start == NULL) {
-        av_log(ctx, AV_LOG_ERROR, "Cannot allocate buffer pointers\n");
-
-        return AVERROR(ENOMEM);
-    }
-    s->buf_len = av_malloc(sizeof(unsigned int) * s->buffers);
-    if (s->buf_len == NULL) {
-        av_log(ctx, AV_LOG_ERROR, "Cannot allocate buffer sizes\n");
-        av_free(s->buf_start);
-
-        return AVERROR(ENOMEM);
-    }
-
-    for (i = 0; i < req.count; i++) {
-        struct v4l2_buffer buf = {
-            .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
-            .index  = i,
-            .memory = V4L2_MEMORY_MMAP
-        };
-
-        res = ioctl(s->fd, VIDIOC_QUERYBUF, &buf);
-        if (res < 0) {
-            av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QUERYBUF)\n");
-
-            return AVERROR(errno);
-        }
-
-        s->buf_len[i] = buf.length;
-        if (s->frame_size > 0 && s->buf_len[i] < s->frame_size) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Buffer len [%d] = %d != %d\n",
-                   i, s->buf_len[i], s->frame_size);
-
-            return -1;
-        }
-        s->buf_start[i] = mmap(NULL, buf.length,
-                               PROT_READ | PROT_WRITE, MAP_SHARED,
-                               s->fd, buf.m.offset);
-
-        if (s->buf_start[i] == MAP_FAILED) {
-            av_log(ctx, AV_LOG_ERROR, "mmap: %s\n", strerror(errno));
-
-            return AVERROR(errno);
-        }
-    }
-
-    return 0;
-}
-
-#if FF_API_DESTRUCT_PACKET
-static void dummy_release_buffer(AVPacket *pkt)
-{
-    av_assert0(0);
-}
-#endif
-
-static void mmap_release_buffer(void *opaque, uint8_t *data)
-{
-    struct v4l2_buffer buf = { 0 };
-    int res, fd;
-    struct buff_data *buf_descriptor = opaque;
-    struct video_data *s = buf_descriptor->s;
-
-    buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-    buf.memory = V4L2_MEMORY_MMAP;
-    buf.index = buf_descriptor->index;
-    fd = buf_descriptor->fd;
-    av_free(buf_descriptor);
-
-    res = ioctl(fd, VIDIOC_QBUF, &buf);
-    if (res < 0)
-        av_log(NULL, AV_LOG_ERROR, "ioctl(VIDIOC_QBUF): %s\n",
-               strerror(errno));
-    avpriv_atomic_int_add_and_fetch(&s->buffers_queued, 1);
-}
-
-static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
-{
-    struct video_data *s = ctx->priv_data;
-    struct v4l2_buffer buf = {
-        .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
-        .memory = V4L2_MEMORY_MMAP
-    };
-    struct pollfd p = { .fd = s->fd, .events = POLLIN };
-    int res;
-
-    res = poll(&p, 1, s->timeout);
-    if (res < 0)
-        return AVERROR(errno);
-
-    if (!(p.revents & (POLLIN | POLLERR | POLLHUP)))
-        return AVERROR(EAGAIN);
-
-    /* FIXME: Some special treatment might be needed in case of loss of signal... */
-    while ((res = ioctl(s->fd, VIDIOC_DQBUF, &buf)) < 0 && (errno == EINTR));
-    if (res < 0) {
-        if (errno == EAGAIN) {
-            pkt->size = 0;
-
-            return AVERROR(EAGAIN);
-        }
-        av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_DQBUF): %s\n",
-               strerror(errno));
-
-        return AVERROR(errno);
-    }
-
-    if (buf.index >= s->buffers) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid buffer index received.\n");
-        return AVERROR(EINVAL);
-    }
-    avpriv_atomic_int_add_and_fetch(&s->buffers_queued, -1);
-    // always keep at least one buffer queued
-    av_assert0(avpriv_atomic_int_get(&s->buffers_queued) >= 1);
-
-    if (s->frame_size > 0 && buf.bytesused != s->frame_size) {
-        av_log(ctx, AV_LOG_ERROR,
-               "The v4l2 frame is %d bytes, but %d bytes are expected\n",
-               buf.bytesused, s->frame_size);
-
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Image is at s->buff_start[buf.index] */
-    if (avpriv_atomic_int_get(&s->buffers_queued) == FFMAX(s->buffers / 8, 1)) {
-        /* when we start getting low on queued buffers, fall back on copying data */
-        res = av_new_packet(pkt, buf.bytesused);
-        if (res < 0) {
-            av_log(ctx, AV_LOG_ERROR, "Error allocating a packet.\n");
-            return res;
-        }
-        memcpy(pkt->data, s->buf_start[buf.index], buf.bytesused);
-
-        res = ioctl(s->fd, VIDIOC_QBUF, &buf);
-        if (res < 0) {
-            av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QBUF)\n");
-            av_free_packet(pkt);
-            return AVERROR(errno);
-        }
-        avpriv_atomic_int_add_and_fetch(&s->buffers_queued, 1);
-    } else {
-        struct buff_data *buf_descriptor;
-
-        pkt->data     = s->buf_start[buf.index];
-        pkt->size     = buf.bytesused;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-        pkt->destruct = dummy_release_buffer;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-        buf_descriptor = av_malloc(sizeof(struct buff_data));
-        if (buf_descriptor == NULL) {
-            /* Something went wrong... Since av_malloc() failed, we cannot even
-             * allocate a buffer for memcpying into it
-             */
-            av_log(ctx, AV_LOG_ERROR, "Failed to allocate a buffer descriptor\n");
-            res = ioctl(s->fd, VIDIOC_QBUF, &buf);
-
-            return AVERROR(ENOMEM);
-        }
-        buf_descriptor->fd    = s->fd;
-        buf_descriptor->index = buf.index;
-        buf_descriptor->s     = s;
-
-        pkt->buf = av_buffer_create(pkt->data, pkt->size, mmap_release_buffer,
-                                    buf_descriptor, 0);
-        if (!pkt->buf) {
-            av_freep(&buf_descriptor);
-            return AVERROR(ENOMEM);
-        }
-    }
-    pkt->pts = buf.timestamp.tv_sec * INT64_C(1000000) + buf.timestamp.tv_usec;
-
-    return s->buf_len[buf.index];
-}
-
-static int mmap_start(AVFormatContext *ctx)
-{
-    struct video_data *s = ctx->priv_data;
-    enum v4l2_buf_type type;
-    int i, res;
-
-    for (i = 0; i < s->buffers; i++) {
-        struct v4l2_buffer buf = {
-            .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
-            .index  = i,
-            .memory = V4L2_MEMORY_MMAP
-        };
-
-        res = ioctl(s->fd, VIDIOC_QBUF, &buf);
-        if (res < 0) {
-            av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QBUF): %s\n",
-                   strerror(errno));
-
-            return AVERROR(errno);
-        }
-    }
-    s->buffers_queued = s->buffers;
-
-    type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-    res = ioctl(s->fd, VIDIOC_STREAMON, &type);
-    if (res < 0) {
-        av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_STREAMON): %s\n",
-               strerror(errno));
-
-        return AVERROR(errno);
-    }
-
-    return 0;
-}
-
-static void mmap_close(struct video_data *s)
-{
-    enum v4l2_buf_type type;
-    int i;
-
-    type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-    /* We do not check for the result, because we could
-     * not do anything about it anyway...
-     */
-    ioctl(s->fd, VIDIOC_STREAMOFF, &type);
-    for (i = 0; i < s->buffers; i++) {
-        munmap(s->buf_start[i], s->buf_len[i]);
-    }
-    av_free(s->buf_start);
-    av_free(s->buf_len);
-}
-
-static int v4l2_set_parameters(AVFormatContext *s1)
-{
-    struct video_data *s = s1->priv_data;
-    struct v4l2_input input = { 0 };
-    struct v4l2_standard standard = { 0 };
-    struct v4l2_streamparm streamparm = { 0 };
-    struct v4l2_fract *tpf = &streamparm.parm.capture.timeperframe;
-    AVRational framerate_q = { 0 };
-    int i, ret;
-
-    streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-
-    if (s->framerate &&
-        (ret = av_parse_video_rate(&framerate_q, s->framerate)) < 0) {
-        av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n",
-               s->framerate);
-        return ret;
-    }
-
-    /* set tv video input */
-    input.index = s->channel;
-    if (ioctl(s->fd, VIDIOC_ENUMINPUT, &input) < 0) {
-        av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl enum input failed:\n");
-        return AVERROR(EIO);
-    }
-
-    av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set input_id: %d, input: %s\n",
-            s->channel, input.name);
-    if (ioctl(s->fd, VIDIOC_S_INPUT, &input.index) < 0) {
-        av_log(s1, AV_LOG_ERROR,
-               "The V4L2 driver ioctl set input(%d) failed\n",
-                s->channel);
-        return AVERROR(EIO);
-    }
-
-    if (s->standard) {
-        av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s\n",
-               s->standard);
-        /* set tv standard */
-        for(i=0;;i++) {
-            standard.index = i;
-            if (ioctl(s->fd, VIDIOC_ENUMSTD, &standard) < 0) {
-                av_log(s1, AV_LOG_ERROR,
-                       "The V4L2 driver ioctl set standard(%s) failed\n",
-                       s->standard);
-                return AVERROR(EIO);
-            }
-
-            if (!av_strcasecmp(standard.name, s->standard)) {
-                break;
-            }
-        }
-
-        av_log(s1, AV_LOG_DEBUG,
-               "The V4L2 driver set standard: %s, id: %"PRIu64"\n",
-               s->standard, (uint64_t)standard.id);
-        if (ioctl(s->fd, VIDIOC_S_STD, &standard.id) < 0) {
-            av_log(s1, AV_LOG_ERROR,
-                   "The V4L2 driver ioctl set standard(%s) failed\n",
-                   s->standard);
-            return AVERROR(EIO);
-        }
-    }
-
-    if (framerate_q.num && framerate_q.den) {
-        av_log(s1, AV_LOG_DEBUG, "Setting time per frame to %d/%d\n",
-               framerate_q.den, framerate_q.num);
-        tpf->numerator   = framerate_q.den;
-        tpf->denominator = framerate_q.num;
-
-        if (ioctl(s->fd, VIDIOC_S_PARM, &streamparm) != 0) {
-            av_log(s1, AV_LOG_ERROR,
-                   "ioctl set time per frame(%d/%d) failed\n",
-                   framerate_q.den, framerate_q.num);
-            return AVERROR(EIO);
-        }
-
-        if (framerate_q.num != tpf->denominator ||
-            framerate_q.den != tpf->numerator) {
-            av_log(s1, AV_LOG_INFO,
-                   "The driver changed the time per frame from "
-                   "%d/%d to %d/%d\n",
-                   framerate_q.den, framerate_q.num,
-                   tpf->numerator, tpf->denominator);
-        }
-    } else {
-        if (ioctl(s->fd, VIDIOC_G_PARM, &streamparm) != 0) {
-            av_log(s1, AV_LOG_ERROR, "ioctl(VIDIOC_G_PARM): %s\n",
-                   strerror(errno));
-            return AVERROR(errno);
-        }
-    }
-    s1->streams[0]->avg_frame_rate.num = tpf->denominator;
-    s1->streams[0]->avg_frame_rate.den = tpf->numerator;
-
-    s->timeout = 100 +
-        av_rescale_q(1, s1->streams[0]->avg_frame_rate,
-                        (AVRational){1, 1000});
-
-    return 0;
-}
-
-static uint32_t device_try_init(AVFormatContext *s1,
-                                enum AVPixelFormat pix_fmt,
-                                int *width,
-                                int *height,
-                                enum AVCodecID *codec_id)
-{
-    uint32_t desired_format = fmt_ff2v4l(pix_fmt, s1->video_codec_id);
-
-    if (desired_format == 0 ||
-        device_init(s1, width, height, desired_format) < 0) {
-        int i;
-
-        desired_format = 0;
-        for (i = 0; i<FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
-            if (s1->video_codec_id == AV_CODEC_ID_NONE ||
-                fmt_conversion_table[i].codec_id == s1->video_codec_id) {
-                desired_format = fmt_conversion_table[i].v4l2_fmt;
-                if (device_init(s1, width, height, desired_format) >= 0) {
-                    break;
-                }
-                desired_format = 0;
-            }
-        }
-    }
-
-    if (desired_format != 0) {
-        *codec_id = fmt_v4l2codec(desired_format);
-        assert(*codec_id != AV_CODEC_ID_NONE);
-    }
-
-    return desired_format;
-}
-
-static int v4l2_read_header(AVFormatContext *s1)
-{
-    struct video_data *s = s1->priv_data;
-    AVStream *st;
-    int res = 0;
-    uint32_t desired_format;
-    enum AVCodecID codec_id;
-    enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
-
-    st = avformat_new_stream(s1, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    s->fd = device_open(s1);
-    if (s->fd < 0)
-        return s->fd;
-
-    if (s->list_format) {
-        list_formats(s1, s->fd, s->list_format);
-        return AVERROR_EXIT;
-    }
-
-    avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
-
-    if (s->video_size &&
-        (res = av_parse_video_size(&s->width, &s->height, s->video_size)) < 0) {
-        av_log(s1, AV_LOG_ERROR, "Could not parse video size '%s'.\n",
-               s->video_size);
-        return res;
-    }
-
-    if (s->pixel_format) {
-        AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
-
-        if (codec)
-            s1->video_codec_id = codec->id;
-
-        pix_fmt = av_get_pix_fmt(s->pixel_format);
-
-        if (pix_fmt == AV_PIX_FMT_NONE && !codec) {
-            av_log(s1, AV_LOG_ERROR, "No such input format: %s.\n",
-                   s->pixel_format);
-
-            return AVERROR(EINVAL);
-        }
-    }
-
-    if (!s->width && !s->height) {
-        struct v4l2_format fmt;
-
-        av_log(s1, AV_LOG_VERBOSE,
-               "Querying the device for the current frame size\n");
-        fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-        if (ioctl(s->fd, VIDIOC_G_FMT, &fmt) < 0) {
-            av_log(s1, AV_LOG_ERROR, "ioctl(VIDIOC_G_FMT): %s\n",
-                   strerror(errno));
-            return AVERROR(errno);
-        }
-
-        s->width  = fmt.fmt.pix.width;
-        s->height = fmt.fmt.pix.height;
-        av_log(s1, AV_LOG_VERBOSE,
-               "Setting frame size to %dx%d\n", s->width, s->height);
-    }
-
-    desired_format = device_try_init(s1, pix_fmt, &s->width, &s->height,
-                                     &codec_id);
-    if (desired_format == 0) {
-        av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for "
-               "codec_id %d, pix_fmt %d.\n", s1->video_codec_id, pix_fmt);
-        close(s->fd);
-
-        return AVERROR(EIO);
-    }
-
-    if ((res = av_image_check_size(s->width, s->height, 0, s1) < 0))
-        return res;
-
-    s->frame_format = desired_format;
-
-    if ((res = v4l2_set_parameters(s1) < 0))
-        return res;
-
-    st->codec->pix_fmt = fmt_v4l2ff(desired_format, codec_id);
-    s->frame_size =
-        avpicture_get_size(st->codec->pix_fmt, s->width, s->height);
-
-    if ((res = mmap_init(s1)) ||
-        (res = mmap_start(s1)) < 0) {
-        close(s->fd);
-        return res;
-    }
-
-    s->top_field_first = first_field(s->fd);
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = codec_id;
-    if (codec_id == AV_CODEC_ID_RAWVIDEO)
-        st->codec->codec_tag =
-            avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
-    st->codec->width = s->width;
-    st->codec->height = s->height;
-    st->codec->bit_rate = s->frame_size * av_q2d(st->avg_frame_rate) * 8;
-
-    return 0;
-}
-
-static int v4l2_read_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    struct video_data *s = s1->priv_data;
-    AVFrame *frame = s1->streams[0]->codec->coded_frame;
-    int res;
-
-    av_init_packet(pkt);
-    if ((res = mmap_read_frame(s1, pkt)) < 0) {
-        return res;
-    }
-
-    if (frame && s->interlaced) {
-        frame->interlaced_frame = 1;
-        frame->top_field_first = s->top_field_first;
-    }
-
-    return pkt->size;
-}
-
-static int v4l2_read_close(AVFormatContext *s1)
-{
-    struct video_data *s = s1->priv_data;
-
-    if (avpriv_atomic_int_get(&s->buffers_queued) != s->buffers)
-        av_log(s1, AV_LOG_WARNING, "Some buffers are still owned by the caller on "
-               "close.\n");
-
-    mmap_close(s);
-
-    close(s->fd);
-    return 0;
-}
-
-#define OFFSET(x) offsetof(struct video_data, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "standard",     "TV standard, used only by analog frame grabber",            OFFSET(standard),     AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0,       DEC },
-    { "channel",      "TV channel, used only by frame grabber",                    OFFSET(channel),      AV_OPT_TYPE_INT,    {.i64 = 0 },    0, INT_MAX, DEC },
-    { "video_size",   "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size),   AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,       DEC },
-    { "pixel_format", "Preferred pixel format",                                    OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,       DEC },
-    { "input_format", "Preferred pixel format (for raw video) or codec name",      OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,       DEC },
-    { "framerate",    "",                                                          OFFSET(framerate),    AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,       DEC },
-    { "list_formats", "List available formats and exit",                           OFFSET(list_format),  AV_OPT_TYPE_INT,    {.i64 = 0 },  0, INT_MAX, DEC, "list_formats" },
-    { "all",          "Show all available formats",                                OFFSET(list_format),  AV_OPT_TYPE_CONST,  {.i64 = V4L_ALLFORMATS  },    0, INT_MAX, DEC, "list_formats" },
-    { "raw",          "Show only non-compressed formats",                          OFFSET(list_format),  AV_OPT_TYPE_CONST,  {.i64 = V4L_RAWFORMATS  },    0, INT_MAX, DEC, "list_formats" },
-    { "compressed",   "Show only compressed formats",                              OFFSET(list_format),  AV_OPT_TYPE_CONST,  {.i64 = V4L_COMPFORMATS },    0, INT_MAX, DEC, "list_formats" },
-    { NULL },
-};
-
-static const AVClass v4l2_class = {
-    .class_name = "V4L2 indev",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_v4l2_demuxer = {
-    .name           = "video4linux2",
-    .long_name      = NULL_IF_CONFIG_SMALL("Video4Linux2 device grab"),
-    .priv_data_size = sizeof(struct video_data),
-    .read_header    = v4l2_read_header,
-    .read_packet    = v4l2_read_packet,
-    .read_close     = v4l2_read_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &v4l2_class,
-};
diff --git a/deps/libav/libavdevice/version.h b/deps/libav/libavdevice/version.h
deleted file mode 100644
index 487b4c0..0000000
--- a/deps/libav/libavdevice/version.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVDEVICE_VERSION_H
-#define AVDEVICE_VERSION_H
-
-/**
- * @file
- * @ingroup lavd
- * Libavdevice version macros
- */
-
-#include "libavutil/version.h"
-
-#define LIBAVDEVICE_VERSION_MAJOR 54
-#define LIBAVDEVICE_VERSION_MINOR  0
-#define LIBAVDEVICE_VERSION_MICRO  0
-
-#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
-                                               LIBAVDEVICE_VERSION_MINOR, \
-                                               LIBAVDEVICE_VERSION_MICRO)
-#define LIBAVDEVICE_VERSION     AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
-                                           LIBAVDEVICE_VERSION_MINOR, \
-                                           LIBAVDEVICE_VERSION_MICRO)
-#define LIBAVDEVICE_BUILD       LIBAVDEVICE_VERSION_INT
-
-/**
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- */
-
-#endif /* AVDEVICE_VERSION_H */
diff --git a/deps/libav/libavdevice/vfwcap.c b/deps/libav/libavdevice/vfwcap.c
deleted file mode 100644
index fea85fc..0000000
--- a/deps/libav/libavdevice/vfwcap.c
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- * VFW capture interface
- * Copyright (c) 2006-2008 Ramiro Polla
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include <windows.h>
-#include <vfw.h>
-
-/* Defines for VFW missing from MinGW.
- * Remove this when MinGW incorporates them. */
-#define HWND_MESSAGE                ((HWND)-3)
-
-#define BI_RGB                      0
-
-/* End of missing MinGW defines */
-
-struct vfw_ctx {
-    const AVClass *class;
-    HWND hwnd;
-    HANDLE mutex;
-    HANDLE event;
-    AVPacketList *pktl;
-    unsigned int curbufsize;
-    unsigned int frame_num;
-    char *video_size;       /**< A string describing video size, set by a private option. */
-    char *framerate;        /**< Set by a private option. */
-};
-
-static enum AVPixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount)
-{
-    switch(biCompression) {
-    case MKTAG('U', 'Y', 'V', 'Y'):
-        return AV_PIX_FMT_UYVY422;
-    case MKTAG('Y', 'U', 'Y', '2'):
-        return AV_PIX_FMT_YUYV422;
-    case MKTAG('I', '4', '2', '0'):
-        return AV_PIX_FMT_YUV420P;
-    case BI_RGB:
-        switch(biBitCount) { /* 1-8 are untested */
-            case 1:
-                return AV_PIX_FMT_MONOWHITE;
-            case 4:
-                return AV_PIX_FMT_RGB4;
-            case 8:
-                return AV_PIX_FMT_RGB8;
-            case 16:
-                return AV_PIX_FMT_RGB555;
-            case 24:
-                return AV_PIX_FMT_BGR24;
-            case 32:
-                return AV_PIX_FMT_RGB32;
-        }
-    }
-    return AV_PIX_FMT_NONE;
-}
-
-static enum AVCodecID vfw_codecid(DWORD biCompression)
-{
-    switch(biCompression) {
-    case MKTAG('d', 'v', 's', 'd'):
-        return AV_CODEC_ID_DVVIDEO;
-    case MKTAG('M', 'J', 'P', 'G'):
-    case MKTAG('m', 'j', 'p', 'g'):
-        return AV_CODEC_ID_MJPEG;
-    }
-    return AV_CODEC_ID_NONE;
-}
-
-#define dstruct(pctx, sname, var, type) \
-    av_log(pctx, AV_LOG_DEBUG, #var":\t%"type"\n", sname->var)
-
-static void dump_captureparms(AVFormatContext *s, CAPTUREPARMS *cparms)
-{
-    av_log(s, AV_LOG_DEBUG, "CAPTUREPARMS\n");
-    dstruct(s, cparms, dwRequestMicroSecPerFrame, "lu");
-    dstruct(s, cparms, fMakeUserHitOKToCapture, "d");
-    dstruct(s, cparms, wPercentDropForError, "u");
-    dstruct(s, cparms, fYield, "d");
-    dstruct(s, cparms, dwIndexSize, "lu");
-    dstruct(s, cparms, wChunkGranularity, "u");
-    dstruct(s, cparms, fUsingDOSMemory, "d");
-    dstruct(s, cparms, wNumVideoRequested, "u");
-    dstruct(s, cparms, fCaptureAudio, "d");
-    dstruct(s, cparms, wNumAudioRequested, "u");
-    dstruct(s, cparms, vKeyAbort, "u");
-    dstruct(s, cparms, fAbortLeftMouse, "d");
-    dstruct(s, cparms, fAbortRightMouse, "d");
-    dstruct(s, cparms, fLimitEnabled, "d");
-    dstruct(s, cparms, wTimeLimit, "u");
-    dstruct(s, cparms, fMCIControl, "d");
-    dstruct(s, cparms, fStepMCIDevice, "d");
-    dstruct(s, cparms, dwMCIStartTime, "lu");
-    dstruct(s, cparms, dwMCIStopTime, "lu");
-    dstruct(s, cparms, fStepCaptureAt2x, "d");
-    dstruct(s, cparms, wStepCaptureAverageFrames, "u");
-    dstruct(s, cparms, dwAudioBufferSize, "lu");
-    dstruct(s, cparms, fDisableWriteCache, "d");
-    dstruct(s, cparms, AVStreamMaster, "u");
-}
-
-static void dump_videohdr(AVFormatContext *s, VIDEOHDR *vhdr)
-{
-#ifdef DEBUG
-    av_log(s, AV_LOG_DEBUG, "VIDEOHDR\n");
-    dstruct(s, vhdr, lpData, "p");
-    dstruct(s, vhdr, dwBufferLength, "lu");
-    dstruct(s, vhdr, dwBytesUsed, "lu");
-    dstruct(s, vhdr, dwTimeCaptured, "lu");
-    dstruct(s, vhdr, dwUser, "lu");
-    dstruct(s, vhdr, dwFlags, "lu");
-    dstruct(s, vhdr, dwReserved[0], "lu");
-    dstruct(s, vhdr, dwReserved[1], "lu");
-    dstruct(s, vhdr, dwReserved[2], "lu");
-    dstruct(s, vhdr, dwReserved[3], "lu");
-#endif
-}
-
-static void dump_bih(AVFormatContext *s, BITMAPINFOHEADER *bih)
-{
-    av_log(s, AV_LOG_DEBUG, "BITMAPINFOHEADER\n");
-    dstruct(s, bih, biSize, "lu");
-    dstruct(s, bih, biWidth, "ld");
-    dstruct(s, bih, biHeight, "ld");
-    dstruct(s, bih, biPlanes, "d");
-    dstruct(s, bih, biBitCount, "d");
-    dstruct(s, bih, biCompression, "lu");
-    av_log(s, AV_LOG_DEBUG, "    biCompression:\t\"%.4s\"\n",
-                   (char*) &bih->biCompression);
-    dstruct(s, bih, biSizeImage, "lu");
-    dstruct(s, bih, biXPelsPerMeter, "lu");
-    dstruct(s, bih, biYPelsPerMeter, "lu");
-    dstruct(s, bih, biClrUsed, "lu");
-    dstruct(s, bih, biClrImportant, "lu");
-}
-
-static int shall_we_drop(AVFormatContext *s)
-{
-    struct vfw_ctx *ctx = s->priv_data;
-    const uint8_t dropscore[] = {62, 75, 87, 100};
-    const int ndropscores = FF_ARRAY_ELEMS(dropscore);
-    unsigned int buffer_fullness = (ctx->curbufsize*100)/s->max_picture_buffer;
-
-    if(dropscore[++ctx->frame_num%ndropscores] <= buffer_fullness) {
-        av_log(s, AV_LOG_ERROR,
-              "real-time buffer %d%% full! frame dropped!\n", buffer_fullness);
-        return 1;
-    }
-
-    return 0;
-}
-
-static LRESULT CALLBACK videostream_cb(HWND hwnd, LPVIDEOHDR vdhdr)
-{
-    AVFormatContext *s;
-    struct vfw_ctx *ctx;
-    AVPacketList **ppktl, *pktl_next;
-
-    s = (AVFormatContext *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
-    ctx = s->priv_data;
-
-    dump_videohdr(s, vdhdr);
-
-    if(shall_we_drop(s))
-        return FALSE;
-
-    WaitForSingleObject(ctx->mutex, INFINITE);
-
-    pktl_next = av_mallocz(sizeof(AVPacketList));
-    if(!pktl_next)
-        goto fail;
-
-    if(av_new_packet(&pktl_next->pkt, vdhdr->dwBytesUsed) < 0) {
-        av_free(pktl_next);
-        goto fail;
-    }
-
-    pktl_next->pkt.pts = vdhdr->dwTimeCaptured;
-    memcpy(pktl_next->pkt.data, vdhdr->lpData, vdhdr->dwBytesUsed);
-
-    for(ppktl = &ctx->pktl ; *ppktl ; ppktl = &(*ppktl)->next);
-    *ppktl = pktl_next;
-
-    ctx->curbufsize += vdhdr->dwBytesUsed;
-
-    SetEvent(ctx->event);
-    ReleaseMutex(ctx->mutex);
-
-    return TRUE;
-fail:
-    ReleaseMutex(ctx->mutex);
-    return FALSE;
-}
-
-static int vfw_read_close(AVFormatContext *s)
-{
-    struct vfw_ctx *ctx = s->priv_data;
-    AVPacketList *pktl;
-
-    if(ctx->hwnd) {
-        SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
-        SendMessage(ctx->hwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0);
-        DestroyWindow(ctx->hwnd);
-    }
-    if(ctx->mutex)
-        CloseHandle(ctx->mutex);
-    if(ctx->event)
-        CloseHandle(ctx->event);
-
-    pktl = ctx->pktl;
-    while (pktl) {
-        AVPacketList *next = pktl->next;
-        av_destruct_packet(&pktl->pkt);
-        av_free(pktl);
-        pktl = next;
-    }
-
-    return 0;
-}
-
-static int vfw_read_header(AVFormatContext *s)
-{
-    struct vfw_ctx *ctx = s->priv_data;
-    AVCodecContext *codec;
-    AVStream *st;
-    int devnum;
-    int bisize;
-    BITMAPINFO *bi;
-    CAPTUREPARMS cparms;
-    DWORD biCompression;
-    WORD biBitCount;
-    int ret;
-    AVRational framerate_q;
-
-    if (!strcmp(s->filename, "list")) {
-        for (devnum = 0; devnum <= 9; devnum++) {
-            char driver_name[256];
-            char driver_ver[256];
-            ret = capGetDriverDescription(devnum,
-                                          driver_name, sizeof(driver_name),
-                                          driver_ver, sizeof(driver_ver));
-            if (ret) {
-                av_log(s, AV_LOG_INFO, "Driver %d\n", devnum);
-                av_log(s, AV_LOG_INFO, " %s\n", driver_name);
-                av_log(s, AV_LOG_INFO, " %s\n", driver_ver);
-            }
-        }
-        return AVERROR(EIO);
-    }
-
-    ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0);
-    if(!ctx->hwnd) {
-        av_log(s, AV_LOG_ERROR, "Could not create capture window.\n");
-        return AVERROR(EIO);
-    }
-
-    /* If atoi fails, devnum==0 and the default device is used */
-    devnum = atoi(s->filename);
-
-    ret = SendMessage(ctx->hwnd, WM_CAP_DRIVER_CONNECT, devnum, 0);
-    if(!ret) {
-        av_log(s, AV_LOG_ERROR, "Could not connect to device.\n");
-        DestroyWindow(ctx->hwnd);
-        return AVERROR(ENODEV);
-    }
-
-    SendMessage(ctx->hwnd, WM_CAP_SET_OVERLAY, 0, 0);
-    SendMessage(ctx->hwnd, WM_CAP_SET_PREVIEW, 0, 0);
-
-    ret = SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0,
-                      (LPARAM) videostream_cb);
-    if(!ret) {
-        av_log(s, AV_LOG_ERROR, "Could not set video stream callback.\n");
-        goto fail_io;
-    }
-
-    SetWindowLongPtr(ctx->hwnd, GWLP_USERDATA, (LONG_PTR) s);
-
-    st = avformat_new_stream(s, NULL);
-    if(!st) {
-        vfw_read_close(s);
-        return AVERROR(ENOMEM);
-    }
-
-    /* Set video format */
-    bisize = SendMessage(ctx->hwnd, WM_CAP_GET_VIDEOFORMAT, 0, 0);
-    if(!bisize)
-        goto fail_io;
-    bi = av_malloc(bisize);
-    if(!bi) {
-        vfw_read_close(s);
-        return AVERROR(ENOMEM);
-    }
-    ret = SendMessage(ctx->hwnd, WM_CAP_GET_VIDEOFORMAT, bisize, (LPARAM) bi);
-    if(!ret)
-        goto fail_bi;
-
-    dump_bih(s, &bi->bmiHeader);
-
-
-    if (ctx->video_size) {
-        ret = av_parse_video_size(&bi->bmiHeader.biWidth, &bi->bmiHeader.biHeight, ctx->video_size);
-        if (ret < 0) {
-            av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n");
-            goto fail_bi;
-        }
-    }
-
-    if (0) {
-        /* For testing yet unsupported compressions
-         * Copy these values from user-supplied verbose information */
-        bi->bmiHeader.biWidth       = 320;
-        bi->bmiHeader.biHeight      = 240;
-        bi->bmiHeader.biPlanes      = 1;
-        bi->bmiHeader.biBitCount    = 12;
-        bi->bmiHeader.biCompression = MKTAG('I','4','2','0');
-        bi->bmiHeader.biSizeImage   = 115200;
-        dump_bih(s, &bi->bmiHeader);
-    }
-
-    ret = SendMessage(ctx->hwnd, WM_CAP_SET_VIDEOFORMAT, bisize, (LPARAM) bi);
-    if(!ret) {
-        av_log(s, AV_LOG_ERROR, "Could not set Video Format.\n");
-        goto fail_bi;
-    }
-
-    biCompression = bi->bmiHeader.biCompression;
-    biBitCount = bi->bmiHeader.biBitCount;
-
-    av_free(bi);
-
-    /* Set sequence setup */
-    ret = SendMessage(ctx->hwnd, WM_CAP_GET_SEQUENCE_SETUP, sizeof(cparms),
-                      (LPARAM) &cparms);
-    if(!ret)
-        goto fail_io;
-
-    dump_captureparms(s, &cparms);
-
-    cparms.fYield = 1; // Spawn a background thread
-    cparms.dwRequestMicroSecPerFrame =
-                               (framerate_q.den*1000000) / framerate_q.num;
-    cparms.fAbortLeftMouse = 0;
-    cparms.fAbortRightMouse = 0;
-    cparms.fCaptureAudio = 0;
-    cparms.vKeyAbort = 0;
-
-    ret = SendMessage(ctx->hwnd, WM_CAP_SET_SEQUENCE_SETUP, sizeof(cparms),
-                      (LPARAM) &cparms);
-    if(!ret)
-        goto fail_io;
-
-    codec = st->codec;
-    codec->time_base = (AVRational){framerate_q.den, framerate_q.num};
-    codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    codec->width  = bi->bmiHeader.biWidth;
-    codec->height = bi->bmiHeader.biHeight;
-    codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount);
-    if(codec->pix_fmt == AV_PIX_FMT_NONE) {
-        codec->codec_id = vfw_codecid(biCompression);
-        if(codec->codec_id == AV_CODEC_ID_NONE) {
-            av_log(s, AV_LOG_ERROR, "Unknown compression type. "
-                             "Please report verbose (-v 9) debug information.\n");
-            vfw_read_close(s);
-            return AVERROR_PATCHWELCOME;
-        }
-        codec->bits_per_coded_sample = biBitCount;
-    } else {
-        codec->codec_id = AV_CODEC_ID_RAWVIDEO;
-        if(biCompression == BI_RGB) {
-            codec->bits_per_coded_sample = biBitCount;
-            codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (codec->extradata) {
-                codec->extradata_size = 9;
-                memcpy(codec->extradata, "BottomUp", 9);
-            }
-        }
-    }
-
-    avpriv_set_pts_info(st, 32, 1, 1000);
-
-    ctx->mutex = CreateMutex(NULL, 0, NULL);
-    if(!ctx->mutex) {
-        av_log(s, AV_LOG_ERROR, "Could not create Mutex.\n" );
-        goto fail_io;
-    }
-    ctx->event = CreateEvent(NULL, 1, 0, NULL);
-    if(!ctx->event) {
-        av_log(s, AV_LOG_ERROR, "Could not create Event.\n" );
-        goto fail_io;
-    }
-
-    ret = SendMessage(ctx->hwnd, WM_CAP_SEQUENCE_NOFILE, 0, 0);
-    if(!ret) {
-        av_log(s, AV_LOG_ERROR, "Could not start capture sequence.\n" );
-        goto fail_io;
-    }
-
-    return 0;
-
-fail_bi:
-    av_free(bi);
-
-fail_io:
-    vfw_read_close(s);
-    return AVERROR(EIO);
-}
-
-static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    struct vfw_ctx *ctx = s->priv_data;
-    AVPacketList *pktl = NULL;
-
-    while(!pktl) {
-        WaitForSingleObject(ctx->mutex, INFINITE);
-        pktl = ctx->pktl;
-        if(ctx->pktl) {
-            *pkt = ctx->pktl->pkt;
-            ctx->pktl = ctx->pktl->next;
-            av_free(pktl);
-        }
-        ResetEvent(ctx->event);
-        ReleaseMutex(ctx->mutex);
-        if(!pktl) {
-            if(s->flags & AVFMT_FLAG_NONBLOCK) {
-                return AVERROR(EAGAIN);
-            } else {
-                WaitForSingleObject(ctx->event, INFINITE);
-            }
-        }
-    }
-
-    ctx->curbufsize -= pkt->size;
-
-    return pkt->size;
-}
-
-#define OFFSET(x) offsetof(struct vfw_ctx, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
-    { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
-    { NULL },
-};
-
-static const AVClass vfw_class = {
-    .class_name = "VFW indev",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_vfwcap_demuxer = {
-    .name           = "vfwcap",
-    .long_name      = NULL_IF_CONFIG_SMALL("VfW video capture"),
-    .priv_data_size = sizeof(struct vfw_ctx),
-    .read_header    = vfw_read_header,
-    .read_packet    = vfw_read_packet,
-    .read_close     = vfw_read_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &vfw_class,
-};
diff --git a/deps/libav/libavdevice/x11grab.c b/deps/libav/libavdevice/x11grab.c
deleted file mode 100644
index 8edbf7b..0000000
--- a/deps/libav/libavdevice/x11grab.c
+++ /dev/null
@@ -1,615 +0,0 @@
-/*
- * X11 video grab interface
- *
- * This file is part of Libav.
- *
- * Libav integration:
- * Copyright (C) 2006 Clemens Fruhwirth <clemens at endorphin.org>
- *                    Edouard Gomez <ed.gomez at free.fr>
- *
- * This file contains code from grab.c:
- * Copyright (c) 2000-2001 Fabrice Bellard
- *
- * This file contains code from the xvidcap project:
- * Copyright (C) 1997-1998 Rasca, Berlin
- *               2003-2004 Karl H. Beckers, Frankfurt
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * X11 frame device demuxer
- * @author Clemens Fruhwirth <clemens at endorphin.org>
- * @author Edouard Gomez <ed.gomez at free.fr>
- */
-
-#include "config.h"
-#include "libavformat/avformat.h"
-#include "libavformat/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/time.h"
-#include <time.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xlibint.h>
-#include <X11/Xproto.h>
-#include <X11/Xutil.h>
-#include <sys/shm.h>
-#include <X11/extensions/shape.h>
-#include <X11/extensions/XShm.h>
-#include <X11/extensions/Xfixes.h>
-
-/**
- * X11 Device Demuxer context
- */
-struct x11grab {
-    const AVClass *class;    /**< Class for private options. */
-    int frame_size;          /**< Size in bytes of a grabbed frame */
-    AVRational time_base;    /**< Time base */
-    int64_t time_frame;      /**< Current time */
-
-    char *video_size;        /**< String describing video size, set by a private option. */
-    int height;              /**< Height of the grab frame */
-    int width;               /**< Width of the grab frame */
-    int x_off;               /**< Horizontal top-left corner coordinate */
-    int y_off;               /**< Vertical top-left corner coordinate */
-
-    Display *dpy;            /**< X11 display from which x11grab grabs frames */
-    XImage *image;           /**< X11 image holding the grab */
-    int use_shm;             /**< !0 when using XShm extension */
-    XShmSegmentInfo shminfo; /**< When using XShm, keeps track of XShm infos */
-    int  draw_mouse;         /**< Set by a private option. */
-    int  follow_mouse;       /**< Set by a private option. */
-    int  show_region;        /**< set by a private option. */
-    char *framerate;         /**< Set by a private option. */
-
-    Window region_win;       /**< This is used by show_region option. */
-};
-
-#define REGION_WIN_BORDER 3
-/**
- * Draw grabbing region window
- *
- * @param s x11grab context
- */
-static void
-x11grab_draw_region_win(struct x11grab *s)
-{
-    Display *dpy = s->dpy;
-    int screen;
-    Window win = s->region_win;
-    GC gc;
-
-    screen = DefaultScreen(dpy);
-    gc = XCreateGC(dpy, win, 0, 0);
-    XSetForeground(dpy, gc, WhitePixel(dpy, screen));
-    XSetBackground(dpy, gc, BlackPixel(dpy, screen));
-    XSetLineAttributes(dpy, gc, REGION_WIN_BORDER, LineDoubleDash, 0, 0);
-    XDrawRectangle(dpy, win, gc,
-                   1, 1,
-                   (s->width  + REGION_WIN_BORDER * 2) - 1 * 2 - 1,
-                   (s->height + REGION_WIN_BORDER * 2) - 1 * 2 - 1);
-    XFreeGC(dpy, gc);
-}
-
-/**
- * Initialize grabbing region window
- *
- * @param s x11grab context
- */
-static void
-x11grab_region_win_init(struct x11grab *s)
-{
-    Display *dpy = s->dpy;
-    int screen;
-    XSetWindowAttributes attribs;
-    XRectangle rect;
-
-    screen = DefaultScreen(dpy);
-    attribs.override_redirect = True;
-    s->region_win = XCreateWindow(dpy, RootWindow(dpy, screen),
-                                  s->x_off  - REGION_WIN_BORDER,
-                                  s->y_off  - REGION_WIN_BORDER,
-                                  s->width  + REGION_WIN_BORDER * 2,
-                                  s->height + REGION_WIN_BORDER * 2,
-                                  0, CopyFromParent,
-                                  InputOutput, CopyFromParent,
-                                  CWOverrideRedirect, &attribs);
-    rect.x = 0;
-    rect.y = 0;
-    rect.width  = s->width;
-    rect.height = s->height;
-    XShapeCombineRectangles(dpy, s->region_win,
-                            ShapeBounding, REGION_WIN_BORDER, REGION_WIN_BORDER,
-                            &rect, 1, ShapeSubtract, 0);
-    XMapWindow(dpy, s->region_win);
-    XSelectInput(dpy, s->region_win, ExposureMask | StructureNotifyMask);
-    x11grab_draw_region_win(s);
-}
-
-/**
- * Initialize the x11 grab device demuxer (public device demuxer API).
- *
- * @param s1 Context from avformat core
- * @return <ul>
- *          <li>AVERROR(ENOMEM) no memory left</li>
- *          <li>AVERROR(EIO) other failure case</li>
- *          <li>0 success</li>
- *         </ul>
- */
-static int
-x11grab_read_header(AVFormatContext *s1)
-{
-    struct x11grab *x11grab = s1->priv_data;
-    Display *dpy;
-    AVStream *st = NULL;
-    enum AVPixelFormat input_pixfmt;
-    XImage *image;
-    int x_off = 0;
-    int y_off = 0;
-    int screen;
-    int use_shm;
-    char *param, *offset;
-    int ret = 0;
-    AVRational framerate;
-
-    param = av_strdup(s1->filename);
-    if (!param)
-        goto out;
-
-    offset = strchr(param, '+');
-    if (offset) {
-        sscanf(offset, "%d,%d", &x_off, &y_off);
-        x11grab->draw_mouse = !strstr(offset, "nomouse");
-        *offset= 0;
-    }
-
-    if ((ret = av_parse_video_size(&x11grab->width, &x11grab->height, x11grab->video_size)) < 0) {
-        av_log(s1, AV_LOG_ERROR, "Couldn't parse video size.\n");
-        goto out;
-    }
-    if ((ret = av_parse_video_rate(&framerate, x11grab->framerate)) < 0) {
-        av_log(s1, AV_LOG_ERROR, "Could not parse framerate: %s.\n", x11grab->framerate);
-        goto out;
-    }
-    av_log(s1, AV_LOG_INFO, "device: %s -> display: %s x: %d y: %d width: %d height: %d\n",
-           s1->filename, param, x_off, y_off, x11grab->width, x11grab->height);
-
-    dpy = XOpenDisplay(param);
-    if(!dpy) {
-        av_log(s1, AV_LOG_ERROR, "Could not open X display.\n");
-        ret = AVERROR(EIO);
-        goto out;
-    }
-
-    st = avformat_new_stream(s1, NULL);
-    if (!st) {
-        ret = AVERROR(ENOMEM);
-        goto out;
-    }
-    avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
-
-    screen = DefaultScreen(dpy);
-
-    if (x11grab->follow_mouse) {
-        int screen_w, screen_h;
-        Window w;
-
-        screen_w = DisplayWidth(dpy, screen);
-        screen_h = DisplayHeight(dpy, screen);
-        XQueryPointer(dpy, RootWindow(dpy, screen), &w, &w, &x_off, &y_off, &ret, &ret, &ret);
-        x_off -= x11grab->width / 2;
-        y_off -= x11grab->height / 2;
-        x_off = FFMIN(FFMAX(x_off, 0), screen_w - x11grab->width);
-        y_off = FFMIN(FFMAX(y_off, 0), screen_h - x11grab->height);
-        av_log(s1, AV_LOG_INFO, "followmouse is enabled, resetting grabbing region to x: %d y: %d\n", x_off, y_off);
-    }
-
-    use_shm = XShmQueryExtension(dpy);
-    av_log(s1, AV_LOG_INFO, "shared memory extension %s found\n", use_shm ? "" : "not");
-
-    if(use_shm) {
-        int scr = XDefaultScreen(dpy);
-        image = XShmCreateImage(dpy,
-                                DefaultVisual(dpy, scr),
-                                DefaultDepth(dpy, scr),
-                                ZPixmap,
-                                NULL,
-                                &x11grab->shminfo,
-                                x11grab->width, x11grab->height);
-        x11grab->shminfo.shmid = shmget(IPC_PRIVATE,
-                                        image->bytes_per_line * image->height,
-                                        IPC_CREAT|0777);
-        if (x11grab->shminfo.shmid == -1) {
-            av_log(s1, AV_LOG_ERROR, "Fatal: Can't get shared memory!\n");
-            ret = AVERROR(ENOMEM);
-            goto out;
-        }
-        x11grab->shminfo.shmaddr = image->data = shmat(x11grab->shminfo.shmid, 0, 0);
-        x11grab->shminfo.readOnly = False;
-
-        if (!XShmAttach(dpy, &x11grab->shminfo)) {
-            av_log(s1, AV_LOG_ERROR, "Fatal: Failed to attach shared memory!\n");
-            /* needs some better error subroutine :) */
-            ret = AVERROR(EIO);
-            goto out;
-        }
-    } else {
-        image = XGetImage(dpy, RootWindow(dpy, screen),
-                          x_off,y_off,
-                          x11grab->width, x11grab->height,
-                          AllPlanes, ZPixmap);
-    }
-
-    switch (image->bits_per_pixel) {
-    case 8:
-        av_log (s1, AV_LOG_DEBUG, "8 bit palette\n");
-        input_pixfmt = AV_PIX_FMT_PAL8;
-        break;
-    case 16:
-        if (       image->red_mask   == 0xf800 &&
-                   image->green_mask == 0x07e0 &&
-                   image->blue_mask  == 0x001f ) {
-            av_log (s1, AV_LOG_DEBUG, "16 bit RGB565\n");
-            input_pixfmt = AV_PIX_FMT_RGB565;
-        } else if (image->red_mask   == 0x7c00 &&
-                   image->green_mask == 0x03e0 &&
-                   image->blue_mask  == 0x001f ) {
-            av_log(s1, AV_LOG_DEBUG, "16 bit RGB555\n");
-            input_pixfmt = AV_PIX_FMT_RGB555;
-        } else {
-            av_log(s1, AV_LOG_ERROR, "RGB ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel);
-            av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask);
-            ret = AVERROR(EIO);
-            goto out;
-        }
-        break;
-    case 24:
-        if (        image->red_mask   == 0xff0000 &&
-                    image->green_mask == 0x00ff00 &&
-                    image->blue_mask  == 0x0000ff ) {
-            input_pixfmt = AV_PIX_FMT_BGR24;
-        } else if ( image->red_mask   == 0x0000ff &&
-                    image->green_mask == 0x00ff00 &&
-                    image->blue_mask  == 0xff0000 ) {
-            input_pixfmt = AV_PIX_FMT_RGB24;
-        } else {
-            av_log(s1, AV_LOG_ERROR,"rgb ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel);
-            av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask);
-            ret = AVERROR(EIO);
-            goto out;
-        }
-        break;
-    case 32:
-        input_pixfmt = AV_PIX_FMT_RGB32;
-        break;
-    default:
-        av_log(s1, AV_LOG_ERROR, "image depth %i not supported ... aborting\n", image->bits_per_pixel);
-        ret = AVERROR(EINVAL);
-        goto out;
-    }
-
-    x11grab->frame_size = x11grab->width * x11grab->height * image->bits_per_pixel/8;
-    x11grab->dpy = dpy;
-    x11grab->time_base  = (AVRational){framerate.den, framerate.num};
-    x11grab->time_frame = av_gettime() / av_q2d(x11grab->time_base);
-    x11grab->x_off = x_off;
-    x11grab->y_off = y_off;
-    x11grab->image = image;
-    x11grab->use_shm = use_shm;
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
-    st->codec->width  = x11grab->width;
-    st->codec->height = x11grab->height;
-    st->codec->pix_fmt = input_pixfmt;
-    st->codec->time_base = x11grab->time_base;
-    st->codec->bit_rate = x11grab->frame_size * 1/av_q2d(x11grab->time_base) * 8;
-
-out:
-    av_free(param);
-    return ret;
-}
-
-/**
- * Paint a mouse pointer in an X11 image.
- *
- * @param image image to paint the mouse pointer to
- * @param s context used to retrieve original grabbing rectangle
- *          coordinates
- */
-static void
-paint_mouse_pointer(XImage *image, struct x11grab *s)
-{
-    int x_off = s->x_off;
-    int y_off = s->y_off;
-    int width = s->width;
-    int height = s->height;
-    Display *dpy = s->dpy;
-    XFixesCursorImage *xcim;
-    int x, y;
-    int line, column;
-    int to_line, to_column;
-    int pixstride = image->bits_per_pixel >> 3;
-    /* Warning: in its insanity, xlib provides unsigned image data through a
-     * char* pointer, so we have to make it uint8_t to make things not break.
-     * Anyone who performs further investigation of the xlib API likely risks
-     * permanent brain damage. */
-    uint8_t *pix = image->data;
-
-    /* Code doesn't currently support 16-bit or PAL8 */
-    if (image->bits_per_pixel != 24 && image->bits_per_pixel != 32)
-        return;
-
-    xcim = XFixesGetCursorImage(dpy);
-
-    x = xcim->x - xcim->xhot;
-    y = xcim->y - xcim->yhot;
-
-    to_line = FFMIN((y + xcim->height), (height + y_off));
-    to_column = FFMIN((x + xcim->width), (width + x_off));
-
-    for (line = FFMAX(y, y_off); line < to_line; line++) {
-        for (column = FFMAX(x, x_off); column < to_column; column++) {
-            int  xcim_addr = (line - y) * xcim->width + column - x;
-            int image_addr = ((line - y_off) * width + column - x_off) * pixstride;
-            int r = (uint8_t)(xcim->pixels[xcim_addr] >>  0);
-            int g = (uint8_t)(xcim->pixels[xcim_addr] >>  8);
-            int b = (uint8_t)(xcim->pixels[xcim_addr] >> 16);
-            int a = (uint8_t)(xcim->pixels[xcim_addr] >> 24);
-
-            if (a == 255) {
-                pix[image_addr+0] = r;
-                pix[image_addr+1] = g;
-                pix[image_addr+2] = b;
-            } else if (a) {
-                /* pixel values from XFixesGetCursorImage come premultiplied by alpha */
-                pix[image_addr+0] = r + (pix[image_addr+0]*(255-a) + 255/2) / 255;
-                pix[image_addr+1] = g + (pix[image_addr+1]*(255-a) + 255/2) / 255;
-                pix[image_addr+2] = b + (pix[image_addr+2]*(255-a) + 255/2) / 255;
-            }
-        }
-    }
-
-    XFree(xcim);
-    xcim = NULL;
-}
-
-
-/**
- * Read new data in the image structure.
- *
- * @param dpy X11 display to grab from
- * @param d
- * @param image Image where the grab will be put
- * @param x Top-Left grabbing rectangle horizontal coordinate
- * @param y Top-Left grabbing rectangle vertical coordinate
- * @return 0 if error, !0 if successful
- */
-static int
-xget_zpixmap(Display *dpy, Drawable d, XImage *image, int x, int y)
-{
-    xGetImageReply rep;
-    xGetImageReq *req;
-    long nbytes;
-
-    if (!image) {
-        return 0;
-    }
-
-    LockDisplay(dpy);
-    GetReq(GetImage, req);
-
-    /* First set up the standard stuff in the request */
-    req->drawable = d;
-    req->x = x;
-    req->y = y;
-    req->width = image->width;
-    req->height = image->height;
-    req->planeMask = (unsigned int)AllPlanes;
-    req->format = ZPixmap;
-
-    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse) || !rep.length) {
-        UnlockDisplay(dpy);
-        SyncHandle();
-        return 0;
-    }
-
-    nbytes = (long)rep.length << 2;
-    _XReadPad(dpy, image->data, nbytes);
-
-    UnlockDisplay(dpy);
-    SyncHandle();
-    return 1;
-}
-
-/**
- * Grab a frame from x11 (public device demuxer API).
- *
- * @param s1 Context from avformat core
- * @param pkt Packet holding the brabbed frame
- * @return frame size in bytes
- */
-static int
-x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    struct x11grab *s = s1->priv_data;
-    Display *dpy = s->dpy;
-    XImage *image = s->image;
-    int x_off = s->x_off;
-    int y_off = s->y_off;
-
-    int screen;
-    Window root;
-    int follow_mouse = s->follow_mouse;
-
-    int64_t curtime, delay;
-    struct timespec ts;
-
-    /* Calculate the time of the next frame */
-    s->time_frame += INT64_C(1000000);
-
-    /* wait based on the frame rate */
-    for(;;) {
-        curtime = av_gettime();
-        delay = s->time_frame * av_q2d(s->time_base) - curtime;
-        if (delay <= 0) {
-            if (delay < INT64_C(-1000000) * av_q2d(s->time_base)) {
-                s->time_frame += INT64_C(1000000);
-            }
-            break;
-        }
-        ts.tv_sec = delay / 1000000;
-        ts.tv_nsec = (delay % 1000000) * 1000;
-        nanosleep(&ts, NULL);
-    }
-
-    av_init_packet(pkt);
-    pkt->data = image->data;
-    pkt->size = s->frame_size;
-    pkt->pts = curtime;
-
-    screen = DefaultScreen(dpy);
-    root = RootWindow(dpy, screen);
-    if (follow_mouse) {
-        int screen_w, screen_h;
-        int pointer_x, pointer_y, _;
-        Window w;
-
-        screen_w = DisplayWidth(dpy, screen);
-        screen_h = DisplayHeight(dpy, screen);
-        XQueryPointer(dpy, root, &w, &w, &pointer_x, &pointer_y, &_, &_, &_);
-        if (follow_mouse == -1) {
-            // follow the mouse, put it at center of grabbing region
-            x_off += pointer_x - s->width  / 2 - x_off;
-            y_off += pointer_y - s->height / 2 - y_off;
-        } else {
-            // follow the mouse, but only move the grabbing region when mouse
-            // reaches within certain pixels to the edge.
-            if (pointer_x > x_off + s->width - follow_mouse) {
-                x_off += pointer_x - (x_off + s->width - follow_mouse);
-            } else if (pointer_x < x_off + follow_mouse)
-                x_off -= (x_off + follow_mouse) - pointer_x;
-            if (pointer_y > y_off + s->height - follow_mouse) {
-                y_off += pointer_y - (y_off + s->height - follow_mouse);
-            } else if (pointer_y < y_off + follow_mouse)
-                y_off -= (y_off + follow_mouse) - pointer_y;
-        }
-        // adjust grabbing region position if it goes out of screen.
-        s->x_off = x_off = FFMIN(FFMAX(x_off, 0), screen_w - s->width);
-        s->y_off = y_off = FFMIN(FFMAX(y_off, 0), screen_h - s->height);
-
-        if (s->show_region && s->region_win)
-            XMoveWindow(dpy, s->region_win,
-                        s->x_off - REGION_WIN_BORDER,
-                        s->y_off - REGION_WIN_BORDER);
-    }
-
-    if (s->show_region) {
-        if (s->region_win) {
-            XEvent evt;
-            // clean up the events, and do the initinal draw or redraw.
-            for (evt.type = NoEventMask; XCheckMaskEvent(dpy, ExposureMask | StructureNotifyMask, &evt); );
-            if (evt.type)
-                x11grab_draw_region_win(s);
-        } else {
-            x11grab_region_win_init(s);
-        }
-    }
-
-    if(s->use_shm) {
-        if (!XShmGetImage(dpy, root, image, x_off, y_off, AllPlanes)) {
-            av_log (s1, AV_LOG_INFO, "XShmGetImage() failed\n");
-        }
-    } else {
-        if (!xget_zpixmap(dpy, root, image, x_off, y_off)) {
-            av_log (s1, AV_LOG_INFO, "XGetZPixmap() failed\n");
-        }
-    }
-
-    if (s->draw_mouse) {
-        paint_mouse_pointer(image, s);
-    }
-
-    return s->frame_size;
-}
-
-/**
- * Close x11 frame grabber (public device demuxer API).
- *
- * @param s1 Context from avformat core
- * @return 0 success, !0 failure
- */
-static int
-x11grab_read_close(AVFormatContext *s1)
-{
-    struct x11grab *x11grab = s1->priv_data;
-
-    /* Detach cleanly from shared mem */
-    if (x11grab->use_shm) {
-        XShmDetach(x11grab->dpy, &x11grab->shminfo);
-        shmdt(x11grab->shminfo.shmaddr);
-        shmctl(x11grab->shminfo.shmid, IPC_RMID, NULL);
-    }
-
-    /* Destroy X11 image */
-    if (x11grab->image) {
-        XDestroyImage(x11grab->image);
-        x11grab->image = NULL;
-    }
-
-    if (x11grab->region_win) {
-        XDestroyWindow(x11grab->dpy, x11grab->region_win);
-    }
-
-    /* Free X11 display */
-    XCloseDisplay(x11grab->dpy);
-    return 0;
-}
-
-#define OFFSET(x) offsetof(struct x11grab, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC },
-    { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
-    { "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, DEC },
-    { "follow_mouse", "Move the grabbing region when the mouse pointer reaches within specified amount of pixels to the edge of region.",
-      OFFSET(follow_mouse), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT_MAX, DEC, "follow_mouse" },
-    { "centered", "Keep the mouse pointer at the center of grabbing region when following.", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, INT_MIN, INT_MAX, DEC, "follow_mouse" },
-    { "show_region", "Show the grabbing region.", OFFSET(show_region), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, DEC },
-    { NULL },
-};
-
-static const AVClass x11_class = {
-    .class_name = "X11grab indev",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-/** x11 grabber device demuxer declaration */
-AVInputFormat ff_x11grab_demuxer = {
-    .name           = "x11grab",
-    .long_name      = NULL_IF_CONFIG_SMALL("X11grab"),
-    .priv_data_size = sizeof(struct x11grab),
-    .read_header    = x11grab_read_header,
-    .read_packet    = x11grab_read_packet,
-    .read_close     = x11grab_read_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &x11_class,
-};
diff --git a/deps/libav/libavfilter/Makefile b/deps/libav/libavfilter/Makefile
deleted file mode 100644
index 23dbd1d..0000000
--- a/deps/libav/libavfilter/Makefile
+++ /dev/null
@@ -1,100 +0,0 @@
-NAME = avfilter
-FFLIBS = avutil
-FFLIBS-$(CONFIG_ASYNCTS_FILTER) += avresample
-FFLIBS-$(CONFIG_MOVIE_FILTER) += avformat avcodec
-FFLIBS-$(CONFIG_RESAMPLE_FILTER) += avresample
-FFLIBS-$(CONFIG_SCALE_FILTER)   += swscale
-
-HEADERS = avfilter.h                                                    \
-          avfiltergraph.h                                               \
-          buffersink.h                                                  \
-          buffersrc.h                                                   \
-          version.h                                                     \
-
-OBJS = allfilters.o                                                     \
-       audio.o                                                          \
-       avfilter.o                                                       \
-       avfiltergraph.o                                                  \
-       buffer.o                                                         \
-       buffersink.o                                                     \
-       buffersrc.o                                                      \
-       drawutils.o                                                      \
-       fifo.o                                                           \
-       formats.o                                                        \
-       graphparser.o                                                    \
-       video.o                                                          \
-
-OBJS-$(CONFIG_AFORMAT_FILTER)                += af_aformat.o
-OBJS-$(CONFIG_AMIX_FILTER)                   += af_amix.o
-OBJS-$(CONFIG_ANULL_FILTER)                  += af_anull.o
-OBJS-$(CONFIG_ASETPTS_FILTER)                += setpts.o
-OBJS-$(CONFIG_ASHOWINFO_FILTER)              += af_ashowinfo.o
-OBJS-$(CONFIG_ASPLIT_FILTER)                 += split.o
-OBJS-$(CONFIG_ASYNCTS_FILTER)                += af_asyncts.o
-OBJS-$(CONFIG_ATRIM_FILTER)                  += trim.o
-OBJS-$(CONFIG_CHANNELMAP_FILTER)             += af_channelmap.o
-OBJS-$(CONFIG_CHANNELSPLIT_FILTER)           += af_channelsplit.o
-OBJS-$(CONFIG_COMPAND_FILTER)                += af_compand.o
-OBJS-$(CONFIG_JOIN_FILTER)                   += af_join.o
-OBJS-$(CONFIG_RESAMPLE_FILTER)               += af_resample.o
-OBJS-$(CONFIG_VOLUME_FILTER)                 += af_volume.o
-
-OBJS-$(CONFIG_ANULLSRC_FILTER)               += asrc_anullsrc.o
-
-OBJS-$(CONFIG_ANULLSINK_FILTER)              += asink_anullsink.o
-
-OBJS-$(CONFIG_BLACKFRAME_FILTER)             += vf_blackframe.o
-OBJS-$(CONFIG_BOXBLUR_FILTER)                += vf_boxblur.o
-OBJS-$(CONFIG_COPY_FILTER)                   += vf_copy.o
-OBJS-$(CONFIG_CROP_FILTER)                   += vf_crop.o
-OBJS-$(CONFIG_CROPDETECT_FILTER)             += vf_cropdetect.o
-OBJS-$(CONFIG_DELOGO_FILTER)                 += vf_delogo.o
-OBJS-$(CONFIG_DRAWBOX_FILTER)                += vf_drawbox.o
-OBJS-$(CONFIG_DRAWTEXT_FILTER)               += vf_drawtext.o
-OBJS-$(CONFIG_FADE_FILTER)                   += vf_fade.o
-OBJS-$(CONFIG_FIELDORDER_FILTER)             += vf_fieldorder.o
-OBJS-$(CONFIG_FORMAT_FILTER)                 += vf_format.o
-OBJS-$(CONFIG_FPS_FILTER)                    += vf_fps.o
-OBJS-$(CONFIG_FRAMEPACK_FILTER)              += vf_framepack.o
-OBJS-$(CONFIG_FREI0R_FILTER)                 += vf_frei0r.o
-OBJS-$(CONFIG_GRADFUN_FILTER)                += vf_gradfun.o
-OBJS-$(CONFIG_HFLIP_FILTER)                  += vf_hflip.o
-OBJS-$(CONFIG_HQDN3D_FILTER)                 += vf_hqdn3d.o
-OBJS-$(CONFIG_INTERLACE_FILTER)              += vf_interlace.o
-OBJS-$(CONFIG_LUT_FILTER)                    += vf_lut.o
-OBJS-$(CONFIG_LUTRGB_FILTER)                 += vf_lut.o
-OBJS-$(CONFIG_LUTYUV_FILTER)                 += vf_lut.o
-OBJS-$(CONFIG_NEGATE_FILTER)                 += vf_lut.o
-OBJS-$(CONFIG_NOFORMAT_FILTER)               += vf_format.o
-OBJS-$(CONFIG_NULL_FILTER)                   += vf_null.o
-OBJS-$(CONFIG_OCV_FILTER)                    += vf_libopencv.o
-OBJS-$(CONFIG_OVERLAY_FILTER)                += vf_overlay.o
-OBJS-$(CONFIG_PAD_FILTER)                    += vf_pad.o
-OBJS-$(CONFIG_PIXDESCTEST_FILTER)            += vf_pixdesctest.o
-OBJS-$(CONFIG_SCALE_FILTER)                  += vf_scale.o
-OBJS-$(CONFIG_SELECT_FILTER)                 += vf_select.o
-OBJS-$(CONFIG_SETDAR_FILTER)                 += vf_aspect.o
-OBJS-$(CONFIG_SETPTS_FILTER)                 += setpts.o
-OBJS-$(CONFIG_SETSAR_FILTER)                 += vf_aspect.o
-OBJS-$(CONFIG_SETTB_FILTER)                  += vf_settb.o
-OBJS-$(CONFIG_SHOWINFO_FILTER)               += vf_showinfo.o
-OBJS-$(CONFIG_SPLIT_FILTER)                  += split.o
-OBJS-$(CONFIG_TRANSPOSE_FILTER)              += vf_transpose.o
-OBJS-$(CONFIG_TRIM_FILTER)                   += trim.o
-OBJS-$(CONFIG_UNSHARP_FILTER)                += vf_unsharp.o
-OBJS-$(CONFIG_VFLIP_FILTER)                  += vf_vflip.o
-OBJS-$(CONFIG_YADIF_FILTER)                  += vf_yadif.o
-
-OBJS-$(CONFIG_COLOR_FILTER)                  += vsrc_color.o
-OBJS-$(CONFIG_FREI0R_SRC_FILTER)             += vf_frei0r.o
-OBJS-$(CONFIG_MOVIE_FILTER)                  += vsrc_movie.o
-OBJS-$(CONFIG_NULLSRC_FILTER)                += vsrc_nullsrc.o
-OBJS-$(CONFIG_RGBTESTSRC_FILTER)             += vsrc_testsrc.o
-OBJS-$(CONFIG_TESTSRC_FILTER)                += vsrc_testsrc.o
-
-OBJS-$(CONFIG_NULLSINK_FILTER)               += vsink_nullsink.o
-
-OBJS-$(HAVE_THREADS)                         += pthread.o
-
-TOOLS     = graph2dot
-TESTPROGS = filtfmts
diff --git a/deps/libav/libavfilter/af_aformat.c b/deps/libav/libavfilter/af_aformat.c
deleted file mode 100644
index f074673..0000000
--- a/deps/libav/libavfilter/af_aformat.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2011 Mina Nagy Zaki
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * format audio filter
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-
-typedef struct AFormatContext {
-    const AVClass   *class;
-
-    AVFilterFormats *formats;
-    AVFilterFormats *sample_rates;
-    AVFilterChannelLayouts *channel_layouts;
-
-    char *formats_str;
-    char *sample_rates_str;
-    char *channel_layouts_str;
-} AFormatContext;
-
-#define OFFSET(x) offsetof(AFormatContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
-    { "sample_fmts",     "A comma-separated list of sample formats.",  OFFSET(formats_str),         AV_OPT_TYPE_STRING, .flags = A },
-    { "sample_rates",    "A comma-separated list of sample rates.",    OFFSET(sample_rates_str),    AV_OPT_TYPE_STRING, .flags = A },
-    { "channel_layouts", "A comma-separated list of channel layouts.", OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = A },
-    { NULL },
-};
-
-static const AVClass aformat_class = {
-    .class_name = "aformat filter",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-#define PARSE_FORMATS(str, type, list, add_to_list, get_fmt, none, desc)    \
-do {                                                                        \
-    char *next, *cur = str, sep;                                            \
-                                                                            \
-    if (str && strchr(str, ',')) {                                          \
-        av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' to "\
-               "separate %s.\n", desc);                                     \
-        sep = ',';                                                          \
-    } else                                                                  \
-        sep = '|';                                                          \
-                                                                            \
-    while (cur) {                                                           \
-        type fmt;                                                           \
-        next = strchr(cur, sep);                                            \
-        if (next)                                                           \
-            *next++ = 0;                                                    \
-                                                                            \
-        if ((fmt = get_fmt(cur)) == none) {                                 \
-            av_log(ctx, AV_LOG_ERROR, "Error parsing " desc ": %s.\n", cur);\
-            return AVERROR(EINVAL);                                         \
-        }                                                                   \
-        add_to_list(&list, fmt);                                            \
-                                                                            \
-        cur = next;                                                         \
-    }                                                                       \
-} while (0)
-
-static int get_sample_rate(const char *samplerate)
-{
-    int ret = strtol(samplerate, NULL, 0);
-    return FFMAX(ret, 0);
-}
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    AFormatContext *s = ctx->priv;
-
-    PARSE_FORMATS(s->formats_str, enum AVSampleFormat, s->formats,
-                  ff_add_format, av_get_sample_fmt, AV_SAMPLE_FMT_NONE, "sample format");
-    PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, ff_add_format,
-                  get_sample_rate, 0, "sample rate");
-    PARSE_FORMATS(s->channel_layouts_str, uint64_t, s->channel_layouts,
-                  ff_add_channel_layout, av_get_channel_layout, 0,
-                  "channel layout");
-
-    return 0;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    AFormatContext *s = ctx->priv;
-
-    ff_set_common_formats(ctx, s->formats ? s->formats :
-                                            ff_all_formats(AVMEDIA_TYPE_AUDIO));
-    ff_set_common_samplerates(ctx, s->sample_rates ? s->sample_rates :
-                                                     ff_all_samplerates());
-    ff_set_common_channel_layouts(ctx, s->channel_layouts ? s->channel_layouts :
-                                                            ff_all_channel_layouts());
-
-    return 0;
-}
-
-static const AVFilterPad avfilter_af_aformat_inputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_AUDIO,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_af_aformat_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_AUDIO
-    },
-    { NULL }
-};
-
-AVFilter ff_af_aformat = {
-    .name          = "aformat",
-    .description   = NULL_IF_CONFIG_SMALL("Convert the input audio to one of the specified formats."),
-    .init          = init,
-    .query_formats = query_formats,
-    .priv_size     = sizeof(AFormatContext),
-    .priv_class    = &aformat_class,
-
-    .inputs        = avfilter_af_aformat_inputs,
-    .outputs       = avfilter_af_aformat_outputs,
-};
diff --git a/deps/libav/libavfilter/af_amix.c b/deps/libav/libavfilter/af_amix.c
deleted file mode 100644
index bfba150..0000000
--- a/deps/libav/libavfilter/af_amix.c
+++ /dev/null
@@ -1,568 +0,0 @@
-/*
- * Audio Mix Filter
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Audio Mix Filter
- *
- * Mixes audio from multiple sources into a single output. The channel layout,
- * sample rate, and sample format will be the same for all inputs and the
- * output.
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/audio_fifo.h"
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-
-#define INPUT_OFF      0    /**< input has reached EOF */
-#define INPUT_ON       1    /**< input is active */
-#define INPUT_INACTIVE 2    /**< input is on, but is currently inactive */
-
-#define DURATION_LONGEST  0
-#define DURATION_SHORTEST 1
-#define DURATION_FIRST    2
-
-
-typedef struct FrameInfo {
-    int nb_samples;
-    int64_t pts;
-    struct FrameInfo *next;
-} FrameInfo;
-
-/**
- * Linked list used to store timestamps and frame sizes of all frames in the
- * FIFO for the first input.
- *
- * This is needed to keep timestamps synchronized for the case where multiple
- * input frames are pushed to the filter for processing before a frame is
- * requested by the output link.
- */
-typedef struct FrameList {
-    int nb_frames;
-    int nb_samples;
-    FrameInfo *list;
-    FrameInfo *end;
-} FrameList;
-
-static void frame_list_clear(FrameList *frame_list)
-{
-    if (frame_list) {
-        while (frame_list->list) {
-            FrameInfo *info = frame_list->list;
-            frame_list->list = info->next;
-            av_free(info);
-        }
-        frame_list->nb_frames  = 0;
-        frame_list->nb_samples = 0;
-        frame_list->end        = NULL;
-    }
-}
-
-static int frame_list_next_frame_size(FrameList *frame_list)
-{
-    if (!frame_list->list)
-        return 0;
-    return frame_list->list->nb_samples;
-}
-
-static int64_t frame_list_next_pts(FrameList *frame_list)
-{
-    if (!frame_list->list)
-        return AV_NOPTS_VALUE;
-    return frame_list->list->pts;
-}
-
-static void frame_list_remove_samples(FrameList *frame_list, int nb_samples)
-{
-    if (nb_samples >= frame_list->nb_samples) {
-        frame_list_clear(frame_list);
-    } else {
-        int samples = nb_samples;
-        while (samples > 0) {
-            FrameInfo *info = frame_list->list;
-            av_assert0(info != NULL);
-            if (info->nb_samples <= samples) {
-                samples -= info->nb_samples;
-                frame_list->list = info->next;
-                if (!frame_list->list)
-                    frame_list->end = NULL;
-                frame_list->nb_frames--;
-                frame_list->nb_samples -= info->nb_samples;
-                av_free(info);
-            } else {
-                info->nb_samples       -= samples;
-                info->pts              += samples;
-                frame_list->nb_samples -= samples;
-                samples = 0;
-            }
-        }
-    }
-}
-
-static int frame_list_add_frame(FrameList *frame_list, int nb_samples, int64_t pts)
-{
-    FrameInfo *info = av_malloc(sizeof(*info));
-    if (!info)
-        return AVERROR(ENOMEM);
-    info->nb_samples = nb_samples;
-    info->pts        = pts;
-    info->next       = NULL;
-
-    if (!frame_list->list) {
-        frame_list->list = info;
-        frame_list->end  = info;
-    } else {
-        av_assert0(frame_list->end != NULL);
-        frame_list->end->next = info;
-        frame_list->end       = info;
-    }
-    frame_list->nb_frames++;
-    frame_list->nb_samples += nb_samples;
-
-    return 0;
-}
-
-
-typedef struct MixContext {
-    const AVClass *class;       /**< class for AVOptions */
-    AVFloatDSPContext fdsp;
-
-    int nb_inputs;              /**< number of inputs */
-    int active_inputs;          /**< number of input currently active */
-    int duration_mode;          /**< mode for determining duration */
-    float dropout_transition;   /**< transition time when an input drops out */
-
-    int nb_channels;            /**< number of channels */
-    int sample_rate;            /**< sample rate */
-    int planar;
-    AVAudioFifo **fifos;        /**< audio fifo for each input */
-    uint8_t *input_state;       /**< current state of each input */
-    float *input_scale;         /**< mixing scale factor for each input */
-    float scale_norm;           /**< normalization factor for all inputs */
-    int64_t next_pts;           /**< calculated pts for next output frame */
-    FrameList *frame_list;      /**< list of frame info for the first input */
-} MixContext;
-
-#define OFFSET(x) offsetof(MixContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
-    { "inputs", "Number of inputs.",
-            OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, 32, A },
-    { "duration", "How to determine the end-of-stream.",
-            OFFSET(duration_mode), AV_OPT_TYPE_INT, { .i64 = DURATION_LONGEST }, 0,  2, A, "duration" },
-        { "longest",  "Duration of longest input.",  0, AV_OPT_TYPE_CONST, { .i64 = DURATION_LONGEST  }, INT_MIN, INT_MAX, A, "duration" },
-        { "shortest", "Duration of shortest input.", 0, AV_OPT_TYPE_CONST, { .i64 = DURATION_SHORTEST }, INT_MIN, INT_MAX, A, "duration" },
-        { "first",    "Duration of first input.",    0, AV_OPT_TYPE_CONST, { .i64 = DURATION_FIRST    }, INT_MIN, INT_MAX, A, "duration" },
-    { "dropout_transition", "Transition time, in seconds, for volume "
-                            "renormalization when an input stream ends.",
-            OFFSET(dropout_transition), AV_OPT_TYPE_FLOAT, { .dbl = 2.0 }, 0, INT_MAX, A },
-    { NULL },
-};
-
-static const AVClass amix_class = {
-    .class_name = "amix filter",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-
-/**
- * Update the scaling factors to apply to each input during mixing.
- *
- * This balances the full volume range between active inputs and handles
- * volume transitions when EOF is encountered on an input but mixing continues
- * with the remaining inputs.
- */
-static void calculate_scales(MixContext *s, int nb_samples)
-{
-    int i;
-
-    if (s->scale_norm > s->active_inputs) {
-        s->scale_norm -= nb_samples / (s->dropout_transition * s->sample_rate);
-        s->scale_norm = FFMAX(s->scale_norm, s->active_inputs);
-    }
-
-    for (i = 0; i < s->nb_inputs; i++) {
-        if (s->input_state[i] == INPUT_ON)
-            s->input_scale[i] = 1.0f / s->scale_norm;
-        else
-            s->input_scale[i] = 0.0f;
-    }
-}
-
-static int config_output(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    MixContext *s      = ctx->priv;
-    int i;
-    char buf[64];
-
-    s->planar          = av_sample_fmt_is_planar(outlink->format);
-    s->sample_rate     = outlink->sample_rate;
-    outlink->time_base = (AVRational){ 1, outlink->sample_rate };
-    s->next_pts        = AV_NOPTS_VALUE;
-
-    s->frame_list = av_mallocz(sizeof(*s->frame_list));
-    if (!s->frame_list)
-        return AVERROR(ENOMEM);
-
-    s->fifos = av_mallocz(s->nb_inputs * sizeof(*s->fifos));
-    if (!s->fifos)
-        return AVERROR(ENOMEM);
-
-    s->nb_channels = av_get_channel_layout_nb_channels(outlink->channel_layout);
-    for (i = 0; i < s->nb_inputs; i++) {
-        s->fifos[i] = av_audio_fifo_alloc(outlink->format, s->nb_channels, 1024);
-        if (!s->fifos[i])
-            return AVERROR(ENOMEM);
-    }
-
-    s->input_state = av_malloc(s->nb_inputs);
-    if (!s->input_state)
-        return AVERROR(ENOMEM);
-    memset(s->input_state, INPUT_ON, s->nb_inputs);
-    s->active_inputs = s->nb_inputs;
-
-    s->input_scale = av_mallocz(s->nb_inputs * sizeof(*s->input_scale));
-    if (!s->input_scale)
-        return AVERROR(ENOMEM);
-    s->scale_norm = s->active_inputs;
-    calculate_scales(s, 0);
-
-    av_get_channel_layout_string(buf, sizeof(buf), -1, outlink->channel_layout);
-
-    av_log(ctx, AV_LOG_VERBOSE,
-           "inputs:%d fmt:%s srate:%d cl:%s\n", s->nb_inputs,
-           av_get_sample_fmt_name(outlink->format), outlink->sample_rate, buf);
-
-    return 0;
-}
-
-/**
- * Read samples from the input FIFOs, mix, and write to the output link.
- */
-static int output_frame(AVFilterLink *outlink, int nb_samples)
-{
-    AVFilterContext *ctx = outlink->src;
-    MixContext      *s = ctx->priv;
-    AVFrame *out_buf, *in_buf;
-    int i;
-
-    calculate_scales(s, nb_samples);
-
-    out_buf = ff_get_audio_buffer(outlink, nb_samples);
-    if (!out_buf)
-        return AVERROR(ENOMEM);
-
-    in_buf = ff_get_audio_buffer(outlink, nb_samples);
-    if (!in_buf) {
-        av_frame_free(&out_buf);
-        return AVERROR(ENOMEM);
-    }
-
-    for (i = 0; i < s->nb_inputs; i++) {
-        if (s->input_state[i] == INPUT_ON) {
-            int planes, plane_size, p;
-
-            av_audio_fifo_read(s->fifos[i], (void **)in_buf->extended_data,
-                               nb_samples);
-
-            planes     = s->planar ? s->nb_channels : 1;
-            plane_size = nb_samples * (s->planar ? 1 : s->nb_channels);
-            plane_size = FFALIGN(plane_size, 16);
-
-            for (p = 0; p < planes; p++) {
-                s->fdsp.vector_fmac_scalar((float *)out_buf->extended_data[p],
-                                           (float *) in_buf->extended_data[p],
-                                           s->input_scale[i], plane_size);
-            }
-        }
-    }
-    av_frame_free(&in_buf);
-
-    out_buf->pts = s->next_pts;
-    if (s->next_pts != AV_NOPTS_VALUE)
-        s->next_pts += nb_samples;
-
-    return ff_filter_frame(outlink, out_buf);
-}
-
-/**
- * Returns the smallest number of samples available in the input FIFOs other
- * than that of the first input.
- */
-static int get_available_samples(MixContext *s)
-{
-    int i;
-    int available_samples = INT_MAX;
-
-    av_assert0(s->nb_inputs > 1);
-
-    for (i = 1; i < s->nb_inputs; i++) {
-        int nb_samples;
-        if (s->input_state[i] == INPUT_OFF)
-            continue;
-        nb_samples = av_audio_fifo_size(s->fifos[i]);
-        available_samples = FFMIN(available_samples, nb_samples);
-    }
-    if (available_samples == INT_MAX)
-        return 0;
-    return available_samples;
-}
-
-/**
- * Requests a frame, if needed, from each input link other than the first.
- */
-static int request_samples(AVFilterContext *ctx, int min_samples)
-{
-    MixContext *s = ctx->priv;
-    int i, ret;
-
-    av_assert0(s->nb_inputs > 1);
-
-    for (i = 1; i < s->nb_inputs; i++) {
-        ret = 0;
-        if (s->input_state[i] == INPUT_OFF)
-            continue;
-        while (!ret && av_audio_fifo_size(s->fifos[i]) < min_samples)
-            ret = ff_request_frame(ctx->inputs[i]);
-        if (ret == AVERROR_EOF) {
-            if (av_audio_fifo_size(s->fifos[i]) == 0) {
-                s->input_state[i] = INPUT_OFF;
-                continue;
-            }
-        } else if (ret < 0)
-            return ret;
-    }
-    return 0;
-}
-
-/**
- * Calculates the number of active inputs and determines EOF based on the
- * duration option.
- *
- * @return 0 if mixing should continue, or AVERROR_EOF if mixing should stop.
- */
-static int calc_active_inputs(MixContext *s)
-{
-    int i;
-    int active_inputs = 0;
-    for (i = 0; i < s->nb_inputs; i++)
-        active_inputs += !!(s->input_state[i] != INPUT_OFF);
-    s->active_inputs = active_inputs;
-
-    if (!active_inputs ||
-        (s->duration_mode == DURATION_FIRST && s->input_state[0] == INPUT_OFF) ||
-        (s->duration_mode == DURATION_SHORTEST && active_inputs != s->nb_inputs))
-        return AVERROR_EOF;
-    return 0;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    MixContext      *s = ctx->priv;
-    int ret;
-    int wanted_samples, available_samples;
-
-    ret = calc_active_inputs(s);
-    if (ret < 0)
-        return ret;
-
-    if (s->input_state[0] == INPUT_OFF) {
-        ret = request_samples(ctx, 1);
-        if (ret < 0)
-            return ret;
-
-        ret = calc_active_inputs(s);
-        if (ret < 0)
-            return ret;
-
-        available_samples = get_available_samples(s);
-        if (!available_samples)
-            return AVERROR(EAGAIN);
-
-        return output_frame(outlink, available_samples);
-    }
-
-    if (s->frame_list->nb_frames == 0) {
-        ret = ff_request_frame(ctx->inputs[0]);
-        if (ret == AVERROR_EOF) {
-            s->input_state[0] = INPUT_OFF;
-            if (s->nb_inputs == 1)
-                return AVERROR_EOF;
-            else
-                return AVERROR(EAGAIN);
-        } else if (ret < 0)
-            return ret;
-    }
-    av_assert0(s->frame_list->nb_frames > 0);
-
-    wanted_samples = frame_list_next_frame_size(s->frame_list);
-
-    if (s->active_inputs > 1) {
-        ret = request_samples(ctx, wanted_samples);
-        if (ret < 0)
-            return ret;
-
-        ret = calc_active_inputs(s);
-        if (ret < 0)
-            return ret;
-    }
-
-    if (s->active_inputs > 1) {
-        available_samples = get_available_samples(s);
-        if (!available_samples)
-            return AVERROR(EAGAIN);
-        available_samples = FFMIN(available_samples, wanted_samples);
-    } else {
-        available_samples = wanted_samples;
-    }
-
-    s->next_pts = frame_list_next_pts(s->frame_list);
-    frame_list_remove_samples(s->frame_list, available_samples);
-
-    return output_frame(outlink, available_samples);
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
-{
-    AVFilterContext  *ctx = inlink->dst;
-    MixContext       *s = ctx->priv;
-    AVFilterLink *outlink = ctx->outputs[0];
-    int i, ret = 0;
-
-    for (i = 0; i < ctx->nb_inputs; i++)
-        if (ctx->inputs[i] == inlink)
-            break;
-    if (i >= ctx->nb_inputs) {
-        av_log(ctx, AV_LOG_ERROR, "unknown input link\n");
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-
-    if (i == 0) {
-        int64_t pts = av_rescale_q(buf->pts, inlink->time_base,
-                                   outlink->time_base);
-        ret = frame_list_add_frame(s->frame_list, buf->nb_samples, pts);
-        if (ret < 0)
-            goto fail;
-    }
-
-    ret = av_audio_fifo_write(s->fifos[i], (void **)buf->extended_data,
-                              buf->nb_samples);
-
-fail:
-    av_frame_free(&buf);
-
-    return ret;
-}
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    MixContext *s = ctx->priv;
-    int i;
-
-    for (i = 0; i < s->nb_inputs; i++) {
-        char name[32];
-        AVFilterPad pad = { 0 };
-
-        snprintf(name, sizeof(name), "input%d", i);
-        pad.type           = AVMEDIA_TYPE_AUDIO;
-        pad.name           = av_strdup(name);
-        pad.filter_frame   = filter_frame;
-
-        ff_insert_inpad(ctx, i, &pad);
-    }
-
-    avpriv_float_dsp_init(&s->fdsp, 0);
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    int i;
-    MixContext *s = ctx->priv;
-
-    if (s->fifos) {
-        for (i = 0; i < s->nb_inputs; i++)
-            av_audio_fifo_free(s->fifos[i]);
-        av_freep(&s->fifos);
-    }
-    frame_list_clear(s->frame_list);
-    av_freep(&s->frame_list);
-    av_freep(&s->input_state);
-    av_freep(&s->input_scale);
-
-    for (i = 0; i < ctx->nb_inputs; i++)
-        av_freep(&ctx->input_pads[i].name);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    AVFilterFormats *formats = NULL;
-    ff_add_format(&formats, AV_SAMPLE_FMT_FLT);
-    ff_add_format(&formats, AV_SAMPLE_FMT_FLTP);
-    ff_set_common_formats(ctx, formats);
-    ff_set_common_channel_layouts(ctx, ff_all_channel_layouts());
-    ff_set_common_samplerates(ctx, ff_all_samplerates());
-    return 0;
-}
-
-static const AVFilterPad avfilter_af_amix_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_AUDIO,
-        .config_props  = config_output,
-        .request_frame = request_frame
-    },
-    { NULL }
-};
-
-AVFilter ff_af_amix = {
-    .name          = "amix",
-    .description   = NULL_IF_CONFIG_SMALL("Audio mixing."),
-    .priv_size     = sizeof(MixContext),
-    .priv_class    = &amix_class,
-
-    .init           = init,
-    .uninit         = uninit,
-    .query_formats  = query_formats,
-
-    .inputs    = NULL,
-    .outputs   = avfilter_af_amix_outputs,
-
-    .flags     = AVFILTER_FLAG_DYNAMIC_INPUTS,
-};
diff --git a/deps/libav/libavfilter/af_anull.c b/deps/libav/libavfilter/af_anull.c
deleted file mode 100644
index 6d7caf3..0000000
--- a/deps/libav/libavfilter/af_anull.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * null audio filter
- */
-
-#include "audio.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "libavutil/internal.h"
-
-static const AVFilterPad avfilter_af_anull_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_AUDIO,
-        .get_audio_buffer = ff_null_get_audio_buffer,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_af_anull_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_AUDIO,
-    },
-    { NULL }
-};
-
-AVFilter ff_af_anull = {
-    .name      = "anull",
-    .description = NULL_IF_CONFIG_SMALL("Pass the source unchanged to the output."),
-
-    .priv_size = 0,
-
-    .inputs    = avfilter_af_anull_inputs,
-
-    .outputs   = avfilter_af_anull_outputs,
-};
diff --git a/deps/libav/libavfilter/af_ashowinfo.c b/deps/libav/libavfilter/af_ashowinfo.c
deleted file mode 100644
index 2a2edcf..0000000
--- a/deps/libav/libavfilter/af_ashowinfo.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2011 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * filter for showing textual audio frame information
- */
-
-#include <inttypes.h>
-#include <stddef.h>
-
-#include "libavutil/adler32.h"
-#include "libavutil/attributes.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/mem.h"
-#include "libavutil/samplefmt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "internal.h"
-
-typedef struct AShowInfoContext {
-    /**
-     * Scratch space for individual plane checksums for planar audio
-     */
-    uint32_t *plane_checksums;
-
-    /**
-     * Frame counter
-     */
-    uint64_t frame;
-} AShowInfoContext;
-
-static int config_input(AVFilterLink *inlink)
-{
-    AShowInfoContext *s = inlink->dst->priv;
-    int channels = av_get_channel_layout_nb_channels(inlink->channel_layout);
-    s->plane_checksums = av_malloc(channels * sizeof(*s->plane_checksums));
-    if (!s->plane_checksums)
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    AShowInfoContext *s = ctx->priv;
-    av_freep(&s->plane_checksums);
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
-{
-    AVFilterContext *ctx = inlink->dst;
-    AShowInfoContext *s  = ctx->priv;
-    char chlayout_str[128];
-    uint32_t checksum = 0;
-    int channels    = av_get_channel_layout_nb_channels(buf->channel_layout);
-    int planar      = av_sample_fmt_is_planar(buf->format);
-    int block_align = av_get_bytes_per_sample(buf->format) * (planar ? 1 : channels);
-    int data_size   = buf->nb_samples * block_align;
-    int planes      = planar ? channels : 1;
-    int i;
-
-    for (i = 0; i < planes; i++) {
-        uint8_t *data = buf->extended_data[i];
-
-        s->plane_checksums[i] = av_adler32_update(0, data, data_size);
-        checksum = i ? av_adler32_update(checksum, data, data_size) :
-                       s->plane_checksums[0];
-    }
-
-    av_get_channel_layout_string(chlayout_str, sizeof(chlayout_str), -1,
-                                 buf->channel_layout);
-
-    av_log(ctx, AV_LOG_INFO,
-           "n:%"PRIu64" pts:%"PRId64" pts_time:%f "
-           "fmt:%s chlayout:%s rate:%d nb_samples:%d "
-           "checksum:%08X ",
-           s->frame, buf->pts, buf->pts * av_q2d(inlink->time_base),
-           av_get_sample_fmt_name(buf->format), chlayout_str,
-           buf->sample_rate, buf->nb_samples,
-           checksum);
-
-    av_log(ctx, AV_LOG_INFO, "plane_checksums: [ ");
-    for (i = 0; i < planes; i++)
-        av_log(ctx, AV_LOG_INFO, "%08X ", s->plane_checksums[i]);
-    av_log(ctx, AV_LOG_INFO, "]\n");
-
-    s->frame++;
-    return ff_filter_frame(inlink->dst->outputs[0], buf);
-}
-
-static const AVFilterPad inputs[] = {
-    {
-        .name       = "default",
-        .type             = AVMEDIA_TYPE_AUDIO,
-        .get_audio_buffer = ff_null_get_audio_buffer,
-        .config_props     = config_input,
-        .filter_frame     = filter_frame,
-    },
-    { NULL },
-};
-
-static const AVFilterPad outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_AUDIO,
-    },
-    { NULL },
-};
-
-AVFilter ff_af_ashowinfo = {
-    .name        = "ashowinfo",
-    .description = NULL_IF_CONFIG_SMALL("Show textual information for each audio frame."),
-    .priv_size   = sizeof(AShowInfoContext),
-    .uninit      = uninit,
-    .inputs      = inputs,
-    .outputs     = outputs,
-};
diff --git a/deps/libav/libavfilter/af_asyncts.c b/deps/libav/libavfilter/af_asyncts.c
deleted file mode 100644
index e662c84..0000000
--- a/deps/libav/libavfilter/af_asyncts.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavresample/avresample.h"
-#include "libavutil/attributes.h"
-#include "libavutil/audio_fifo.h"
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "internal.h"
-
-typedef struct ASyncContext {
-    const AVClass *class;
-
-    AVAudioResampleContext *avr;
-    int64_t pts;            ///< timestamp in samples of the first sample in fifo
-    int min_delta;          ///< pad/trim min threshold in samples
-    int first_frame;        ///< 1 until filter_frame() has processed at least 1 frame with a pts != AV_NOPTS_VALUE
-    int64_t first_pts;      ///< user-specified first expected pts, in samples
-    int comp;               ///< current resample compensation
-
-    /* options */
-    int resample;
-    float min_delta_sec;
-    int max_comp;
-
-    /* set by filter_frame() to signal an output frame to request_frame() */
-    int got_output;
-} ASyncContext;
-
-#define OFFSET(x) offsetof(ASyncContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
-    { "compensate", "Stretch/squeeze the data to make it match the timestamps", OFFSET(resample),      AV_OPT_TYPE_INT,   { .i64 = 0 },   0, 1,       A },
-    { "min_delta",  "Minimum difference between timestamps and audio data "
-                    "(in seconds) to trigger padding/trimmin the data.",        OFFSET(min_delta_sec), AV_OPT_TYPE_FLOAT, { .dbl = 0.1 }, 0, INT_MAX, A },
-    { "max_comp",   "Maximum compensation in samples per second.",              OFFSET(max_comp),      AV_OPT_TYPE_INT,   { .i64 = 500 }, 0, INT_MAX, A },
-    { "first_pts",  "Assume the first pts should be this value.",               OFFSET(first_pts),     AV_OPT_TYPE_INT64, { .i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, A },
-    { NULL },
-};
-
-static const AVClass async_class = {
-    .class_name = "asyncts filter",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    ASyncContext *s = ctx->priv;
-
-    s->pts         = AV_NOPTS_VALUE;
-    s->first_frame = 1;
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    ASyncContext *s = ctx->priv;
-
-    if (s->avr) {
-        avresample_close(s->avr);
-        avresample_free(&s->avr);
-    }
-}
-
-static int config_props(AVFilterLink *link)
-{
-    ASyncContext *s = link->src->priv;
-    int ret;
-
-    s->min_delta = s->min_delta_sec * link->sample_rate;
-    link->time_base = (AVRational){1, link->sample_rate};
-
-    s->avr = avresample_alloc_context();
-    if (!s->avr)
-        return AVERROR(ENOMEM);
-
-    av_opt_set_int(s->avr,  "in_channel_layout", link->channel_layout, 0);
-    av_opt_set_int(s->avr, "out_channel_layout", link->channel_layout, 0);
-    av_opt_set_int(s->avr,  "in_sample_fmt",     link->format,         0);
-    av_opt_set_int(s->avr, "out_sample_fmt",     link->format,         0);
-    av_opt_set_int(s->avr,  "in_sample_rate",    link->sample_rate,    0);
-    av_opt_set_int(s->avr, "out_sample_rate",    link->sample_rate,    0);
-
-    if (s->resample)
-        av_opt_set_int(s->avr, "force_resampling", 1, 0);
-
-    if ((ret = avresample_open(s->avr)) < 0)
-        return ret;
-
-    return 0;
-}
-
-/* get amount of data currently buffered, in samples */
-static int64_t get_delay(ASyncContext *s)
-{
-    return avresample_available(s->avr) + avresample_get_delay(s->avr);
-}
-
-static void handle_trimming(AVFilterContext *ctx)
-{
-    ASyncContext *s = ctx->priv;
-
-    if (s->pts < s->first_pts) {
-        int delta = FFMIN(s->first_pts - s->pts, avresample_available(s->avr));
-        av_log(ctx, AV_LOG_VERBOSE, "Trimming %d samples from start\n",
-               delta);
-        avresample_read(s->avr, NULL, delta);
-        s->pts += delta;
-    } else if (s->first_frame)
-        s->pts = s->first_pts;
-}
-
-static int request_frame(AVFilterLink *link)
-{
-    AVFilterContext *ctx = link->src;
-    ASyncContext      *s = ctx->priv;
-    int ret = 0;
-    int nb_samples;
-
-    s->got_output = 0;
-    while (ret >= 0 && !s->got_output)
-        ret = ff_request_frame(ctx->inputs[0]);
-
-    /* flush the fifo */
-    if (ret == AVERROR_EOF) {
-        if (s->first_pts != AV_NOPTS_VALUE)
-            handle_trimming(ctx);
-
-        if (nb_samples = get_delay(s)) {
-            AVFrame *buf = ff_get_audio_buffer(link, nb_samples);
-            if (!buf)
-                return AVERROR(ENOMEM);
-            ret = avresample_convert(s->avr, buf->extended_data,
-                                     buf->linesize[0], nb_samples, NULL, 0, 0);
-            if (ret <= 0) {
-                av_frame_free(&buf);
-                return (ret < 0) ? ret : AVERROR_EOF;
-            }
-
-            buf->pts = s->pts;
-            return ff_filter_frame(link, buf);
-        }
-    }
-
-    return ret;
-}
-
-static int write_to_fifo(ASyncContext *s, AVFrame *buf)
-{
-    int ret = avresample_convert(s->avr, NULL, 0, 0, buf->extended_data,
-                                 buf->linesize[0], buf->nb_samples);
-    av_frame_free(&buf);
-    return ret;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
-{
-    AVFilterContext  *ctx = inlink->dst;
-    ASyncContext       *s = ctx->priv;
-    AVFilterLink *outlink = ctx->outputs[0];
-    int nb_channels = av_get_channel_layout_nb_channels(buf->channel_layout);
-    int64_t pts = (buf->pts == AV_NOPTS_VALUE) ? buf->pts :
-                  av_rescale_q(buf->pts, inlink->time_base, outlink->time_base);
-    int out_size, ret;
-    int64_t delta;
-    int64_t new_pts;
-
-    /* buffer data until we get the next timestamp */
-    if (s->pts == AV_NOPTS_VALUE || pts == AV_NOPTS_VALUE) {
-        if (pts != AV_NOPTS_VALUE) {
-            s->pts = pts - get_delay(s);
-        }
-        return write_to_fifo(s, buf);
-    }
-
-    if (s->first_pts != AV_NOPTS_VALUE) {
-        handle_trimming(ctx);
-        if (!avresample_available(s->avr))
-            return write_to_fifo(s, buf);
-    }
-
-    /* when we have two timestamps, compute how many samples would we have
-     * to add/remove to get proper sync between data and timestamps */
-    delta    = pts - s->pts - get_delay(s);
-    out_size = avresample_available(s->avr);
-
-    if (labs(delta) > s->min_delta ||
-        (s->first_frame && delta && s->first_pts != AV_NOPTS_VALUE)) {
-        av_log(ctx, AV_LOG_VERBOSE, "Discontinuity - %"PRId64" samples.\n", delta);
-        out_size = av_clipl_int32((int64_t)out_size + delta);
-    } else {
-        if (s->resample) {
-            // adjust the compensation if delta is non-zero
-            int delay = get_delay(s);
-            int comp = s->comp + av_clip(delta * inlink->sample_rate / delay,
-                                         -s->max_comp, s->max_comp);
-            if (comp != s->comp) {
-                av_log(ctx, AV_LOG_VERBOSE, "Compensating %d samples per second.\n", comp);
-                if (avresample_set_compensation(s->avr, comp, inlink->sample_rate) == 0) {
-                    s->comp = comp;
-                }
-            }
-        }
-        // adjust PTS to avoid monotonicity errors with input PTS jitter
-        pts -= delta;
-        delta = 0;
-    }
-
-    if (out_size > 0) {
-        AVFrame *buf_out = ff_get_audio_buffer(outlink, out_size);
-        if (!buf_out) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        if (s->first_frame && delta > 0) {
-            int planar = av_sample_fmt_is_planar(buf_out->format);
-            int planes = planar ?  nb_channels : 1;
-            int block_size = av_get_bytes_per_sample(buf_out->format) *
-                             (planar ? 1 : nb_channels);
-
-            int ch;
-
-            av_samples_set_silence(buf_out->extended_data, 0, delta,
-                                   nb_channels, buf->format);
-
-            for (ch = 0; ch < planes; ch++)
-                buf_out->extended_data[ch] += delta * block_size;
-
-            avresample_read(s->avr, buf_out->extended_data, out_size);
-
-            for (ch = 0; ch < planes; ch++)
-                buf_out->extended_data[ch] -= delta * block_size;
-        } else {
-            avresample_read(s->avr, buf_out->extended_data, out_size);
-
-            if (delta > 0) {
-                av_samples_set_silence(buf_out->extended_data, out_size - delta,
-                                       delta, nb_channels, buf->format);
-            }
-        }
-        buf_out->pts = s->pts;
-        ret = ff_filter_frame(outlink, buf_out);
-        if (ret < 0)
-            goto fail;
-        s->got_output = 1;
-    } else if (avresample_available(s->avr)) {
-        av_log(ctx, AV_LOG_WARNING, "Non-monotonous timestamps, dropping "
-               "whole buffer.\n");
-    }
-
-    /* drain any remaining buffered data */
-    avresample_read(s->avr, NULL, avresample_available(s->avr));
-
-    new_pts = pts - avresample_get_delay(s->avr);
-    /* check for s->pts monotonicity */
-    if (new_pts > s->pts) {
-        s->pts = new_pts;
-        ret = avresample_convert(s->avr, NULL, 0, 0, buf->extended_data,
-                                 buf->linesize[0], buf->nb_samples);
-    } else {
-        av_log(ctx, AV_LOG_WARNING, "Non-monotonous timestamps, dropping "
-               "whole buffer.\n");
-        ret = 0;
-    }
-
-    s->first_frame = 0;
-fail:
-    av_frame_free(&buf);
-
-    return ret;
-}
-
-static const AVFilterPad avfilter_af_asyncts_inputs[] = {
-    {
-        .name           = "default",
-        .type           = AVMEDIA_TYPE_AUDIO,
-        .filter_frame   = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_af_asyncts_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_AUDIO,
-        .config_props  = config_props,
-        .request_frame = request_frame
-    },
-    { NULL }
-};
-
-AVFilter ff_af_asyncts = {
-    .name        = "asyncts",
-    .description = NULL_IF_CONFIG_SMALL("Sync audio data to timestamps"),
-
-    .init        = init,
-    .uninit      = uninit,
-
-    .priv_size   = sizeof(ASyncContext),
-    .priv_class  = &async_class,
-
-    .inputs      = avfilter_af_asyncts_inputs,
-    .outputs     = avfilter_af_asyncts_outputs,
-};
diff --git a/deps/libav/libavfilter/af_channelmap.c b/deps/libav/libavfilter/af_channelmap.c
deleted file mode 100644
index 3e5cc3d..0000000
--- a/deps/libav/libavfilter/af_channelmap.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Copyright (c) 2012 Google, Inc.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * audio channel mapping filter
- */
-
-#include <ctype.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-
-struct ChannelMap {
-    uint64_t in_channel;
-    uint64_t out_channel;
-    int in_channel_idx;
-    int out_channel_idx;
-};
-
-enum MappingMode {
-    MAP_NONE,
-    MAP_ONE_INT,
-    MAP_ONE_STR,
-    MAP_PAIR_INT_INT,
-    MAP_PAIR_INT_STR,
-    MAP_PAIR_STR_INT,
-    MAP_PAIR_STR_STR
-};
-
-#define MAX_CH 64
-typedef struct ChannelMapContext {
-    const AVClass *class;
-    AVFilterChannelLayouts *channel_layouts;
-    char *mapping_str;
-    char *channel_layout_str;
-    uint64_t output_layout;
-    struct ChannelMap map[MAX_CH];
-    int nch;
-    enum MappingMode mode;
-} ChannelMapContext;
-
-#define OFFSET(x) offsetof(ChannelMapContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
-    { "map", "A comma-separated list of input channel numbers in output order.",
-          OFFSET(mapping_str),        AV_OPT_TYPE_STRING, .flags = A },
-    { "channel_layout", "Output channel layout.",
-          OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = A },
-    { NULL },
-};
-
-static const AVClass channelmap_class = {
-    .class_name = "channel map filter",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static char* split(char *message, char delim) {
-    char *next = strchr(message, delim);
-    if (next)
-      *next++ = '\0';
-    return next;
-}
-
-static int get_channel_idx(char **map, int *ch, char delim, int max_ch)
-{
-    char *next = split(*map, delim);
-    int len;
-    int n = 0;
-    if (!next && delim == '-')
-        return AVERROR(EINVAL);
-    len = strlen(*map);
-    sscanf(*map, "%d%n", ch, &n);
-    if (n != len)
-        return AVERROR(EINVAL);
-    if (*ch < 0 || *ch > max_ch)
-        return AVERROR(EINVAL);
-    *map = next;
-    return 0;
-}
-
-static int get_channel(char **map, uint64_t *ch, char delim)
-{
-    char *next = split(*map, delim);
-    if (!next && delim == '-')
-        return AVERROR(EINVAL);
-    *ch = av_get_channel_layout(*map);
-    if (av_get_channel_layout_nb_channels(*ch) != 1)
-        return AVERROR(EINVAL);
-    *map = next;
-    return 0;
-}
-
-static av_cold int channelmap_init(AVFilterContext *ctx)
-{
-    ChannelMapContext *s = ctx->priv;
-    char *mapping, separator = '|';
-    int map_entries = 0;
-    char buf[256];
-    enum MappingMode mode;
-    uint64_t out_ch_mask = 0;
-    int i;
-
-    mapping = s->mapping_str;
-
-    if (!mapping) {
-        mode = MAP_NONE;
-    } else {
-        char *dash = strchr(mapping, '-');
-        if (!dash) {  // short mapping
-            if (av_isdigit(*mapping))
-                mode = MAP_ONE_INT;
-            else
-                mode = MAP_ONE_STR;
-        } else if (av_isdigit(*mapping)) {
-            if (av_isdigit(*(dash+1)))
-                mode = MAP_PAIR_INT_INT;
-            else
-                mode = MAP_PAIR_INT_STR;
-        } else {
-            if (av_isdigit(*(dash+1)))
-                mode = MAP_PAIR_STR_INT;
-            else
-                mode = MAP_PAIR_STR_STR;
-        }
-#if FF_API_OLD_FILTER_OPTS
-        if (strchr(mapping, ',')) {
-            av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use "
-                   "'|' to separate the mappings.\n");
-            separator = ',';
-        }
-#endif
-    }
-
-    if (mode != MAP_NONE) {
-        char *sep = mapping;
-        map_entries = 1;
-        while ((sep = strchr(sep, separator))) {
-            if (*++sep)  // Allow trailing comma
-                map_entries++;
-        }
-    }
-
-    if (map_entries > MAX_CH) {
-        av_log(ctx, AV_LOG_ERROR, "Too many channels mapped: '%d'.\n", map_entries);
-        return AVERROR(EINVAL);
-    }
-
-    for (i = 0; i < map_entries; i++) {
-        int in_ch_idx = -1, out_ch_idx = -1;
-        uint64_t in_ch = 0, out_ch = 0;
-        static const char err[] = "Failed to parse channel map\n";
-        switch (mode) {
-        case MAP_ONE_INT:
-            if (get_channel_idx(&mapping, &in_ch_idx, separator, MAX_CH) < 0) {
-                av_log(ctx, AV_LOG_ERROR, err);
-                return AVERROR(EINVAL);
-            }
-            s->map[i].in_channel_idx  = in_ch_idx;
-            s->map[i].out_channel_idx = i;
-            break;
-        case MAP_ONE_STR:
-            if (get_channel(&mapping, &in_ch, separator) < 0) {
-                av_log(ctx, AV_LOG_ERROR, err);
-                return AVERROR(EINVAL);
-            }
-            s->map[i].in_channel      = in_ch;
-            s->map[i].out_channel_idx = i;
-            break;
-        case MAP_PAIR_INT_INT:
-            if (get_channel_idx(&mapping, &in_ch_idx, '-', MAX_CH) < 0 ||
-                get_channel_idx(&mapping, &out_ch_idx, separator, MAX_CH) < 0) {
-                av_log(ctx, AV_LOG_ERROR, err);
-                return AVERROR(EINVAL);
-            }
-            s->map[i].in_channel_idx  = in_ch_idx;
-            s->map[i].out_channel_idx = out_ch_idx;
-            break;
-        case MAP_PAIR_INT_STR:
-            if (get_channel_idx(&mapping, &in_ch_idx, '-', MAX_CH) < 0 ||
-                get_channel(&mapping, &out_ch, separator) < 0 ||
-                out_ch & out_ch_mask) {
-                av_log(ctx, AV_LOG_ERROR, err);
-                return AVERROR(EINVAL);
-            }
-            s->map[i].in_channel_idx  = in_ch_idx;
-            s->map[i].out_channel     = out_ch;
-            out_ch_mask |= out_ch;
-            break;
-        case MAP_PAIR_STR_INT:
-            if (get_channel(&mapping, &in_ch, '-') < 0 ||
-                get_channel_idx(&mapping, &out_ch_idx, separator, MAX_CH) < 0) {
-                av_log(ctx, AV_LOG_ERROR, err);
-                return AVERROR(EINVAL);
-            }
-            s->map[i].in_channel      = in_ch;
-            s->map[i].out_channel_idx = out_ch_idx;
-            break;
-        case MAP_PAIR_STR_STR:
-            if (get_channel(&mapping, &in_ch, '-') < 0 ||
-                get_channel(&mapping, &out_ch, separator) < 0 ||
-                out_ch & out_ch_mask) {
-                av_log(ctx, AV_LOG_ERROR, err);
-                return AVERROR(EINVAL);
-            }
-            s->map[i].in_channel = in_ch;
-            s->map[i].out_channel = out_ch;
-            out_ch_mask |= out_ch;
-            break;
-        }
-    }
-    s->mode          = mode;
-    s->nch           = map_entries;
-    s->output_layout = out_ch_mask ? out_ch_mask :
-                       av_get_default_channel_layout(map_entries);
-
-    if (s->channel_layout_str) {
-        uint64_t fmt;
-        if ((fmt = av_get_channel_layout(s->channel_layout_str)) == 0) {
-            av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout: '%s'.\n",
-                   s->channel_layout_str);
-            return AVERROR(EINVAL);
-        }
-        if (mode == MAP_NONE) {
-            int i;
-            s->nch = av_get_channel_layout_nb_channels(fmt);
-            for (i = 0; i < s->nch; i++) {
-                s->map[i].in_channel_idx  = i;
-                s->map[i].out_channel_idx = i;
-            }
-        } else if (out_ch_mask && out_ch_mask != fmt) {
-            av_get_channel_layout_string(buf, sizeof(buf), 0, out_ch_mask);
-            av_log(ctx, AV_LOG_ERROR,
-                   "Output channel layout '%s' does not match the list of channel mapped: '%s'.\n",
-                   s->channel_layout_str, buf);
-            return AVERROR(EINVAL);
-        } else if (s->nch != av_get_channel_layout_nb_channels(fmt)) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Output channel layout %s does not match the number of channels mapped %d.\n",
-                   s->channel_layout_str, s->nch);
-            return AVERROR(EINVAL);
-        }
-        s->output_layout = fmt;
-    }
-    if (!s->output_layout) {
-        av_log(ctx, AV_LOG_ERROR, "Output channel layout is not set and "
-               "cannot be guessed from the maps.\n");
-        return AVERROR(EINVAL);
-    }
-
-    ff_add_channel_layout(&s->channel_layouts, s->output_layout);
-
-    if (mode == MAP_PAIR_INT_STR || mode == MAP_PAIR_STR_STR) {
-        for (i = 0; i < s->nch; i++) {
-            s->map[i].out_channel_idx = av_get_channel_layout_channel_index(
-                s->output_layout, s->map[i].out_channel);
-        }
-    }
-
-    return 0;
-}
-
-static int channelmap_query_formats(AVFilterContext *ctx)
-{
-    ChannelMapContext *s = ctx->priv;
-
-    ff_set_common_formats(ctx, ff_planar_sample_fmts());
-    ff_set_common_samplerates(ctx, ff_all_samplerates());
-    ff_channel_layouts_ref(ff_all_channel_layouts(), &ctx->inputs[0]->out_channel_layouts);
-    ff_channel_layouts_ref(s->channel_layouts,       &ctx->outputs[0]->in_channel_layouts);
-
-    return 0;
-}
-
-static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf)
-{
-    AVFilterContext  *ctx = inlink->dst;
-    AVFilterLink *outlink = ctx->outputs[0];
-    const ChannelMapContext *s = ctx->priv;
-    const int nch_in = av_get_channel_layout_nb_channels(inlink->channel_layout);
-    const int nch_out = s->nch;
-    int ch;
-    uint8_t *source_planes[MAX_CH];
-
-    memcpy(source_planes, buf->extended_data,
-           nch_in * sizeof(source_planes[0]));
-
-    if (nch_out > nch_in) {
-        if (nch_out > FF_ARRAY_ELEMS(buf->data)) {
-            uint8_t **new_extended_data =
-                av_mallocz(nch_out * sizeof(*buf->extended_data));
-            if (!new_extended_data) {
-                av_frame_free(&buf);
-                return AVERROR(ENOMEM);
-            }
-            if (buf->extended_data == buf->data) {
-                buf->extended_data = new_extended_data;
-            } else {
-                av_free(buf->extended_data);
-                buf->extended_data = new_extended_data;
-            }
-        } else if (buf->extended_data != buf->data) {
-            av_free(buf->extended_data);
-            buf->extended_data = buf->data;
-        }
-    }
-
-    for (ch = 0; ch < nch_out; ch++) {
-        buf->extended_data[s->map[ch].out_channel_idx] =
-            source_planes[s->map[ch].in_channel_idx];
-    }
-
-    if (buf->data != buf->extended_data)
-        memcpy(buf->data, buf->extended_data,
-           FFMIN(FF_ARRAY_ELEMS(buf->data), nch_out) * sizeof(buf->data[0]));
-
-    return ff_filter_frame(outlink, buf);
-}
-
-static int channelmap_config_input(AVFilterLink *inlink)
-{
-    AVFilterContext *ctx = inlink->dst;
-    ChannelMapContext *s = ctx->priv;
-    int nb_channels = av_get_channel_layout_nb_channels(inlink->channel_layout);
-    int i, err = 0;
-    const char *channel_name;
-    char layout_name[256];
-
-    for (i = 0; i < s->nch; i++) {
-        struct ChannelMap *m = &s->map[i];
-
-        if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {
-            m->in_channel_idx = av_get_channel_layout_channel_index(
-                inlink->channel_layout, m->in_channel);
-        }
-
-        if (m->in_channel_idx < 0 || m->in_channel_idx >= nb_channels) {
-            av_get_channel_layout_string(layout_name, sizeof(layout_name),
-                                         0, inlink->channel_layout);
-            if (m->in_channel) {
-                channel_name = av_get_channel_name(m->in_channel);
-                av_log(ctx, AV_LOG_ERROR,
-                       "input channel '%s' not available from input layout '%s'\n",
-                       channel_name, layout_name);
-            } else {
-                av_log(ctx, AV_LOG_ERROR,
-                       "input channel #%d not available from input layout '%s'\n",
-                       m->in_channel_idx, layout_name);
-            }
-            err = AVERROR(EINVAL);
-        }
-    }
-
-    return err;
-}
-
-static const AVFilterPad avfilter_af_channelmap_inputs[] = {
-    {
-        .name           = "default",
-        .type           = AVMEDIA_TYPE_AUDIO,
-        .filter_frame   = channelmap_filter_frame,
-        .config_props   = channelmap_config_input
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_af_channelmap_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_AUDIO
-    },
-    { NULL }
-};
-
-AVFilter ff_af_channelmap = {
-    .name          = "channelmap",
-    .description   = NULL_IF_CONFIG_SMALL("Remap audio channels."),
-    .init          = channelmap_init,
-    .query_formats = channelmap_query_formats,
-    .priv_size     = sizeof(ChannelMapContext),
-    .priv_class    = &channelmap_class,
-
-    .inputs        = avfilter_af_channelmap_inputs,
-    .outputs       = avfilter_af_channelmap_outputs,
-};
diff --git a/deps/libav/libavfilter/af_channelsplit.c b/deps/libav/libavfilter/af_channelsplit.c
deleted file mode 100644
index 5b410fd..0000000
--- a/deps/libav/libavfilter/af_channelsplit.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Channel split filter
- *
- * Split an audio stream into per-channel streams.
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-
-typedef struct ChannelSplitContext {
-    const AVClass *class;
-
-    uint64_t channel_layout;
-    char    *channel_layout_str;
-} ChannelSplitContext;
-
-#define OFFSET(x) offsetof(ChannelSplitContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
-    { "channel_layout", "Input channel layout.", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, { .str = "stereo" }, .flags = A },
-    { NULL },
-};
-
-static const AVClass channelsplit_class = {
-    .class_name = "channelsplit filter",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    ChannelSplitContext *s = ctx->priv;
-    int nb_channels;
-    int ret = 0, i;
-
-    if (!(s->channel_layout = av_get_channel_layout(s->channel_layout_str))) {
-        av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout '%s'.\n",
-               s->channel_layout_str);
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-
-    nb_channels = av_get_channel_layout_nb_channels(s->channel_layout);
-    for (i = 0; i < nb_channels; i++) {
-        uint64_t channel = av_channel_layout_extract_channel(s->channel_layout, i);
-        AVFilterPad pad  = { 0 };
-
-        pad.type = AVMEDIA_TYPE_AUDIO;
-        pad.name = av_get_channel_name(channel);
-
-        ff_insert_outpad(ctx, i, &pad);
-    }
-
-fail:
-    return ret;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    ChannelSplitContext *s = ctx->priv;
-    AVFilterChannelLayouts *in_layouts = NULL;
-    int i;
-
-    ff_set_common_formats    (ctx, ff_planar_sample_fmts());
-    ff_set_common_samplerates(ctx, ff_all_samplerates());
-
-    ff_add_channel_layout(&in_layouts, s->channel_layout);
-    ff_channel_layouts_ref(in_layouts, &ctx->inputs[0]->out_channel_layouts);
-
-    for (i = 0; i < ctx->nb_outputs; i++) {
-        AVFilterChannelLayouts *out_layouts = NULL;
-        uint64_t channel = av_channel_layout_extract_channel(s->channel_layout, i);
-
-        ff_add_channel_layout(&out_layouts, channel);
-        ff_channel_layouts_ref(out_layouts, &ctx->outputs[i]->in_channel_layouts);
-    }
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
-{
-    AVFilterContext *ctx = inlink->dst;
-    int i, ret = 0;
-
-    for (i = 0; i < ctx->nb_outputs; i++) {
-        AVFrame *buf_out = av_frame_clone(buf);
-
-        if (!buf_out) {
-            ret = AVERROR(ENOMEM);
-            break;
-        }
-
-        buf_out->data[0] = buf_out->extended_data[0] = buf_out->extended_data[i];
-        buf_out->channel_layout =
-            av_channel_layout_extract_channel(buf->channel_layout, i);
-
-        ret = ff_filter_frame(ctx->outputs[i], buf_out);
-        if (ret < 0)
-            break;
-    }
-    av_frame_free(&buf);
-    return ret;
-}
-
-static const AVFilterPad avfilter_af_channelsplit_inputs[] = {
-    {
-        .name           = "default",
-        .type           = AVMEDIA_TYPE_AUDIO,
-        .filter_frame   = filter_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_af_channelsplit = {
-    .name           = "channelsplit",
-    .description    = NULL_IF_CONFIG_SMALL("Split audio into per-channel streams"),
-    .priv_size      = sizeof(ChannelSplitContext),
-    .priv_class     = &channelsplit_class,
-
-    .init           = init,
-    .query_formats  = query_formats,
-
-    .inputs  = avfilter_af_channelsplit_inputs,
-    .outputs = NULL,
-
-    .flags   = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
-};
diff --git a/deps/libav/libavfilter/af_compand.c b/deps/libav/libavfilter/af_compand.c
deleted file mode 100644
index a6692bc..0000000
--- a/deps/libav/libavfilter/af_compand.c
+++ /dev/null
@@ -1,603 +0,0 @@
-/*
- * Copyright (c) 1999 Chris Bagwell
- * Copyright (c) 1999 Nick Bailey
- * Copyright (c) 2007 Rob Sykes <robs at users.sourceforge.net>
- * Copyright (c) 2013 Paul B Mahol
- * Copyright (c) 2014 Andrew Kelley
- *
- * This file is part of libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * audio compand filter
- */
-
-#include <string.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include "audio.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-
-typedef struct ChanParam {
-    float attack;
-    float decay;
-    float volume;
-} ChanParam;
-
-typedef struct CompandSegment {
-    float x, y;
-    float a, b;
-} CompandSegment;
-
-typedef struct CompandContext {
-    const AVClass *class;
-    int nb_channels;
-    int nb_segments;
-    char *attacks, *decays, *points;
-    CompandSegment *segments;
-    ChanParam *channels;
-    float in_min_lin;
-    float out_min_lin;
-    double curve_dB;
-    double gain_dB;
-    double initial_volume;
-    double delay;
-    AVFrame *delay_frame;
-    int delay_samples;
-    int delay_count;
-    int delay_index;
-    int64_t pts;
-
-    int (*compand)(AVFilterContext *ctx, AVFrame *frame);
-} CompandContext;
-
-#define OFFSET(x) offsetof(CompandContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM
-
-static const AVOption compand_options[] = {
-    { "attacks", "set time over which increase of volume is determined", OFFSET(attacks), AV_OPT_TYPE_STRING, { .str = "0.3" }, 0, 0, A },
-    { "decays", "set time over which decrease of volume is determined", OFFSET(decays), AV_OPT_TYPE_STRING, { .str = "0.8" }, 0, 0, A },
-    { "points", "set points of transfer function", OFFSET(points), AV_OPT_TYPE_STRING, { .str = "-70/-70|-60/-20" }, 0, 0, A },
-    { "soft-knee", "set soft-knee", OFFSET(curve_dB), AV_OPT_TYPE_DOUBLE, { .dbl = 0.01 }, 0.01, 900, A },
-    { "gain", "set output gain", OFFSET(gain_dB), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -900, 900, A },
-    { "volume", "set initial volume", OFFSET(initial_volume), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, -900, 0, A },
-    { "delay", "set delay for samples before sending them to volume adjuster", OFFSET(delay), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, 20, A },
-    { NULL }
-};
-
-static const AVClass compand_class = {
-    .class_name = "compand filter",
-    .item_name  = av_default_item_name,
-    .option     = compand_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    CompandContext *s = ctx->priv;
-    s->pts            = AV_NOPTS_VALUE;
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    CompandContext *s = ctx->priv;
-
-    av_freep(&s->channels);
-    av_freep(&s->segments);
-    av_frame_free(&s->delay_frame);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    AVFilterChannelLayouts *layouts;
-    AVFilterFormats *formats;
-    static const enum AVSampleFormat sample_fmts[] = {
-        AV_SAMPLE_FMT_FLTP,
-        AV_SAMPLE_FMT_NONE
-    };
-
-    layouts = ff_all_channel_layouts();
-    if (!layouts)
-        return AVERROR(ENOMEM);
-    ff_set_common_channel_layouts(ctx, layouts);
-
-    formats = ff_make_format_list(sample_fmts);
-    if (!formats)
-        return AVERROR(ENOMEM);
-    ff_set_common_formats(ctx, formats);
-
-    formats = ff_all_samplerates();
-    if (!formats)
-        return AVERROR(ENOMEM);
-    ff_set_common_samplerates(ctx, formats);
-
-    return 0;
-}
-
-static void count_items(char *item_str, int *nb_items)
-{
-    char *p;
-
-    *nb_items = 1;
-    for (p = item_str; *p; p++) {
-        if (*p == '|')
-            (*nb_items)++;
-    }
-}
-
-static void update_volume(ChanParam *cp, float in)
-{
-    float delta = in - cp->volume;
-
-    if (delta > 0.0)
-        cp->volume += delta * cp->attack;
-    else
-        cp->volume += delta * cp->decay;
-}
-
-static float get_volume(CompandContext *s, float in_lin)
-{
-    CompandSegment *cs;
-    float in_log, out_log;
-    int i;
-
-    if (in_lin < s->in_min_lin)
-        return s->out_min_lin;
-
-    in_log = logf(in_lin);
-
-    for (i = 1; i < s->nb_segments; i++)
-        if (in_log <= s->segments[i].x)
-            break;
-    cs = &s->segments[i - 1];
-    in_log -= cs->x;
-    out_log = cs->y + in_log * (cs->a * in_log + cs->b);
-
-    return expf(out_log);
-}
-
-static int compand_nodelay(AVFilterContext *ctx, AVFrame *frame)
-{
-    CompandContext *s    = ctx->priv;
-    AVFilterLink *inlink = ctx->inputs[0];
-    const int channels   = s->nb_channels;
-    const int nb_samples = frame->nb_samples;
-    AVFrame *out_frame;
-    int chan, i;
-    int err;
-
-    if (av_frame_is_writable(frame)) {
-        out_frame = frame;
-    } else {
-        out_frame = ff_get_audio_buffer(inlink, nb_samples);
-        if (!out_frame) {
-            av_frame_free(&frame);
-            return AVERROR(ENOMEM);
-        }
-        err = av_frame_copy_props(out_frame, frame);
-        if (err < 0) {
-            av_frame_free(&out_frame);
-            av_frame_free(&frame);
-            return err;
-        }
-    }
-
-    for (chan = 0; chan < channels; chan++) {
-        const float *src = (float *)frame->extended_data[chan];
-        float *dst = (float *)out_frame->extended_data[chan];
-        ChanParam *cp = &s->channels[chan];
-
-        for (i = 0; i < nb_samples; i++) {
-            update_volume(cp, fabs(src[i]));
-
-            dst[i] = av_clipf(src[i] * get_volume(s, cp->volume), -1.0f, 1.0f);
-        }
-    }
-
-    if (frame != out_frame)
-        av_frame_free(&frame);
-
-    return ff_filter_frame(ctx->outputs[0], out_frame);
-}
-
-#define MOD(a, b) (((a) >= (b)) ? (a) - (b) : (a))
-
-static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
-{
-    CompandContext *s    = ctx->priv;
-    AVFilterLink *inlink = ctx->inputs[0];
-    const int channels   = s->nb_channels;
-    const int nb_samples = frame->nb_samples;
-    int chan, i, dindex  = 0, oindex, count = 0;
-    AVFrame *out_frame   = NULL;
-    int err;
-
-    if (s->pts == AV_NOPTS_VALUE) {
-        s->pts = (frame->pts == AV_NOPTS_VALUE) ? 0 : frame->pts;
-    }
-
-    for (chan = 0; chan < channels; chan++) {
-        AVFrame *delay_frame = s->delay_frame;
-        const float *src     = (float *)frame->extended_data[chan];
-        float *dbuf          = (float *)delay_frame->extended_data[chan];
-        ChanParam *cp        = &s->channels[chan];
-        float *dst;
-
-        count  = s->delay_count;
-        dindex = s->delay_index;
-        for (i = 0, oindex = 0; i < nb_samples; i++) {
-            const float in = src[i];
-            update_volume(cp, fabs(in));
-
-            if (count >= s->delay_samples) {
-                if (!out_frame) {
-                    out_frame = ff_get_audio_buffer(inlink, nb_samples - i);
-                    if (!out_frame) {
-                        av_frame_free(&frame);
-                        return AVERROR(ENOMEM);
-                    }
-                    err = av_frame_copy_props(out_frame, frame);
-                    if (err < 0) {
-                        av_frame_free(&out_frame);
-                        av_frame_free(&frame);
-                        return err;
-                    }
-                    out_frame->pts = s->pts;
-                    s->pts += av_rescale_q(nb_samples - i,
-                        (AVRational){ 1, inlink->sample_rate },
-                        inlink->time_base);
-                }
-
-                dst = (float *)out_frame->extended_data[chan];
-                dst[oindex++] = av_clipf(dbuf[dindex] *
-                        get_volume(s, cp->volume), -1.0f, 1.0f);
-            } else {
-                count++;
-            }
-
-            dbuf[dindex] = in;
-            dindex = MOD(dindex + 1, s->delay_samples);
-        }
-    }
-
-    s->delay_count = count;
-    s->delay_index = dindex;
-
-    av_frame_free(&frame);
-    return out_frame ? ff_filter_frame(ctx->outputs[0], out_frame) : 0;
-}
-
-static int compand_drain(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    CompandContext *s    = ctx->priv;
-    const int channels   = s->nb_channels;
-    AVFrame *frame       = NULL;
-    int chan, i, dindex;
-
-    /* 2048 is to limit output frame size during drain */
-    frame = ff_get_audio_buffer(outlink, FFMIN(2048, s->delay_count));
-    if (!frame)
-        return AVERROR(ENOMEM);
-    frame->pts = s->pts;
-    s->pts += av_rescale_q(frame->nb_samples,
-            (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
-
-    for (chan = 0; chan < channels; chan++) {
-        AVFrame *delay_frame = s->delay_frame;
-        float *dbuf = (float *)delay_frame->extended_data[chan];
-        float *dst = (float *)frame->extended_data[chan];
-        ChanParam *cp = &s->channels[chan];
-
-        dindex = s->delay_index;
-        for (i = 0; i < frame->nb_samples; i++) {
-            dst[i] = av_clipf(dbuf[dindex] * get_volume(s, cp->volume),
-                    -1.0f, 1.0f);
-            dindex = MOD(dindex + 1, s->delay_samples);
-        }
-    }
-    s->delay_count -= frame->nb_samples;
-    s->delay_index = dindex;
-
-    return ff_filter_frame(outlink, frame);
-}
-
-static int config_output(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx  = outlink->src;
-    CompandContext *s     = ctx->priv;
-    const int sample_rate = outlink->sample_rate;
-    double radius         = s->curve_dB * M_LN10 / 20.0;
-    const char *p;
-    const int channels    =
-        av_get_channel_layout_nb_channels(outlink->channel_layout);
-    int nb_attacks, nb_decays, nb_points;
-    int new_nb_items, num;
-    int i;
-    int err;
-
-
-    count_items(s->attacks, &nb_attacks);
-    count_items(s->decays, &nb_decays);
-    count_items(s->points, &nb_points);
-
-    if (channels <= 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid number of channels: %d\n", channels);
-        return AVERROR(EINVAL);
-    }
-
-    if (nb_attacks > channels || nb_decays > channels) {
-        av_log(ctx, AV_LOG_ERROR,
-                "Number of attacks/decays bigger than number of channels.\n");
-        return AVERROR(EINVAL);
-    }
-
-    uninit(ctx);
-
-    s->nb_channels = channels;
-    s->channels = av_mallocz_array(channels, sizeof(*s->channels));
-    s->nb_segments = (nb_points + 4) * 2;
-    s->segments = av_mallocz_array(s->nb_segments, sizeof(*s->segments));
-
-    if (!s->channels || !s->segments) {
-        uninit(ctx);
-        return AVERROR(ENOMEM);
-    }
-
-    p = s->attacks;
-    for (i = 0, new_nb_items = 0; i < nb_attacks; i++) {
-        char *tstr = av_get_token(&p, "|");
-        if (!tstr)
-            return AVERROR(ENOMEM);
-
-        new_nb_items += sscanf(tstr, "%f", &s->channels[i].attack) == 1;
-        av_freep(&tstr);
-        if (s->channels[i].attack < 0) {
-            uninit(ctx);
-            return AVERROR(EINVAL);
-        }
-        if (*p)
-            p++;
-    }
-    nb_attacks = new_nb_items;
-
-    p = s->decays;
-    for (i = 0, new_nb_items = 0; i < nb_decays; i++) {
-        char *tstr = av_get_token(&p, "|");
-        if (!tstr)
-            return AVERROR(ENOMEM);
-        new_nb_items += sscanf(tstr, "%f", &s->channels[i].decay) == 1;
-        av_freep(&tstr);
-        if (s->channels[i].decay < 0) {
-            uninit(ctx);
-            return AVERROR(EINVAL);
-        }
-        if (*p)
-            p++;
-    }
-    nb_decays = new_nb_items;
-
-    if (nb_attacks != nb_decays) {
-        av_log(ctx, AV_LOG_ERROR,
-                "Number of attacks %d differs from number of decays %d.\n",
-                nb_attacks, nb_decays);
-        uninit(ctx);
-        return AVERROR(EINVAL);
-    }
-
-#define S(x) s->segments[2 * ((x) + 1)]
-    p = s->points;
-    for (i = 0, new_nb_items = 0; i < nb_points; i++) {
-        char *tstr = av_get_token(&p, "|");
-        if (!tstr)
-            return AVERROR(ENOMEM);
-
-        err = sscanf(tstr, "%f/%f", &S(i).x, &S(i).y);
-        av_freep(&tstr);
-        if (err != 2) {
-            av_log(ctx, AV_LOG_ERROR,
-                    "Invalid and/or missing input/output value.\n");
-            uninit(ctx);
-            return AVERROR(EINVAL);
-        }
-        if (i && S(i - 1).x > S(i).x) {
-            av_log(ctx, AV_LOG_ERROR,
-                    "Transfer function input values must be increasing.\n");
-            uninit(ctx);
-            return AVERROR(EINVAL);
-        }
-        S(i).y -= S(i).x;
-        av_log(ctx, AV_LOG_DEBUG, "%d: x=%f y=%f\n", i, S(i).x, S(i).y);
-        new_nb_items++;
-        if (*p)
-            p++;
-    }
-    num = new_nb_items;
-
-    /* Add 0,0 if necessary */
-    if (num == 0 || S(num - 1).x)
-        num++;
-
-#undef S
-#define S(x) s->segments[2 * (x)]
-    /* Add a tail off segment at the start */
-    S(0).x = S(1).x - 2 * s->curve_dB;
-    S(0).y = S(1).y;
-    num++;
-
-    /* Join adjacent colinear segments */
-    for (i = 2; i < num; i++) {
-        double g1 = (S(i - 1).y - S(i - 2).y) * (S(i - 0).x - S(i - 1).x);
-        double g2 = (S(i - 0).y - S(i - 1).y) * (S(i - 1).x - S(i - 2).x);
-        int j;
-
-        /* here we purposefully lose precision so that we can compare floats */
-        if (fabs(g1 - g2))
-            continue;
-        num--;
-        for (j = --i; j < num; j++)
-            S(j) = S(j + 1);
-    }
-
-    for (i = 0; !i || s->segments[i - 2].x; i += 2) {
-        s->segments[i].y += s->gain_dB;
-        s->segments[i].x *= M_LN10 / 20;
-        s->segments[i].y *= M_LN10 / 20;
-    }
-
-#define L(x) s->segments[i - (x)]
-    for (i = 4; s->segments[i - 2].x; i += 2) {
-        double x, y, cx, cy, in1, in2, out1, out2, theta, len, r;
-
-        L(4).a = 0;
-        L(4).b = (L(2).y - L(4).y) / (L(2).x - L(4).x);
-
-        L(2).a = 0;
-        L(2).b = (L(0).y - L(2).y) / (L(0).x - L(2).x);
-
-        theta = atan2(L(2).y - L(4).y, L(2).x - L(4).x);
-        len = sqrt(pow(L(2).x - L(4).x, 2.) + pow(L(2).y - L(4).y, 2.));
-        r = FFMIN(radius, len);
-        L(3).x = L(2).x - r * cos(theta);
-        L(3).y = L(2).y - r * sin(theta);
-
-        theta = atan2(L(0).y - L(2).y, L(0).x - L(2).x);
-        len = sqrt(pow(L(0).x - L(2).x, 2.) + pow(L(0).y - L(2).y, 2.));
-        r = FFMIN(radius, len / 2);
-        x = L(2).x + r * cos(theta);
-        y = L(2).y + r * sin(theta);
-
-        cx = (L(3).x + L(2).x + x) / 3;
-        cy = (L(3).y + L(2).y + y) / 3;
-
-        L(2).x = x;
-        L(2).y = y;
-
-        in1  = cx - L(3).x;
-        out1 = cy - L(3).y;
-        in2  = L(2).x - L(3).x;
-        out2 = L(2).y - L(3).y;
-        L(3).a = (out2 / in2 - out1 / in1) / (in2 - in1);
-        L(3).b = out1 / in1 - L(3).a * in1;
-    }
-    L(3).x = 0;
-    L(3).y = L(2).y;
-
-    s->in_min_lin  = exp(s->segments[1].x);
-    s->out_min_lin = exp(s->segments[1].y);
-
-    for (i = 0; i < channels; i++) {
-        ChanParam *cp = &s->channels[i];
-
-        if (cp->attack > 1.0 / sample_rate)
-            cp->attack = 1.0 - exp(-1.0 / (sample_rate * cp->attack));
-        else
-            cp->attack = 1.0;
-        if (cp->decay > 1.0 / sample_rate)
-            cp->decay = 1.0 - exp(-1.0 / (sample_rate * cp->decay));
-        else
-            cp->decay = 1.0;
-        cp->volume = pow(10.0, s->initial_volume / 20);
-    }
-
-    s->delay_samples = s->delay * sample_rate;
-    if (s->delay_samples <= 0) {
-        s->compand = compand_nodelay;
-        return 0;
-    }
-
-    s->delay_frame = av_frame_alloc();
-    if (!s->delay_frame) {
-        uninit(ctx);
-        return AVERROR(ENOMEM);
-    }
-
-    s->delay_frame->format         = outlink->format;
-    s->delay_frame->nb_samples     = s->delay_samples;
-    s->delay_frame->channel_layout = outlink->channel_layout;
-
-    err = av_frame_get_buffer(s->delay_frame, 32);
-    if (err)
-        return err;
-
-    s->compand = compand_delay;
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    CompandContext *s    = ctx->priv;
-
-    return s->compand(ctx, frame);
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    CompandContext *s    = ctx->priv;
-    int ret;
-
-    ret = ff_request_frame(ctx->inputs[0]);
-
-    if (ret == AVERROR_EOF && s->delay_count)
-        ret = compand_drain(outlink);
-
-    return ret;
-}
-
-static const AVFilterPad compand_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_AUDIO,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad compand_outputs[] = {
-    {
-        .name          = "default",
-        .request_frame = request_frame,
-        .config_props  = config_output,
-        .type          = AVMEDIA_TYPE_AUDIO,
-    },
-    { NULL }
-};
-
-
-AVFilter ff_af_compand = {
-    .name           = "compand",
-    .description    = NULL_IF_CONFIG_SMALL(
-            "Compress or expand audio dynamic range."),
-    .query_formats  = query_formats,
-    .priv_size      = sizeof(CompandContext),
-    .priv_class     = &compand_class,
-    .init           = init,
-    .uninit         = uninit,
-    .inputs         = compand_inputs,
-    .outputs        = compand_outputs,
-};
diff --git a/deps/libav/libavfilter/af_join.c b/deps/libav/libavfilter/af_join.c
deleted file mode 100644
index ee87340..0000000
--- a/deps/libav/libavfilter/af_join.c
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Audio join filter
- *
- * Join multiple audio inputs as different channels in
- * a single output
- */
-
-#include "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-
-typedef struct ChannelMap {
-    int input;                ///< input stream index
-    int       in_channel_idx; ///< index of in_channel in the input stream data
-    uint64_t  in_channel;     ///< layout describing the input channel
-    uint64_t out_channel;     ///< layout describing the output channel
-} ChannelMap;
-
-typedef struct JoinContext {
-    const AVClass *class;
-
-    int inputs;
-    char *map;
-    char    *channel_layout_str;
-    uint64_t channel_layout;
-
-    int      nb_channels;
-    ChannelMap *channels;
-
-    /**
-     * Temporary storage for input frames, until we get one on each input.
-     */
-    AVFrame **input_frames;
-
-    /**
-     *  Temporary storage for buffer references, for assembling the output frame.
-     */
-    AVBufferRef **buffers;
-} JoinContext;
-
-#define OFFSET(x) offsetof(JoinContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption join_options[] = {
-    { "inputs",         "Number of input streams.", OFFSET(inputs),             AV_OPT_TYPE_INT,    { .i64 = 2 }, 1, INT_MAX,       A },
-    { "channel_layout", "Channel layout of the "
-                        "output stream.",           OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0, A },
-    { "map",            "A comma-separated list of channels maps in the format "
-                        "'input_stream.input_channel-output_channel.",
-                                                    OFFSET(map),                AV_OPT_TYPE_STRING,                 .flags = A },
-    { NULL },
-};
-
-static const AVClass join_class = {
-    .class_name = "join filter",
-    .item_name  = av_default_item_name,
-    .option     = join_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static int filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    AVFilterContext *ctx = link->dst;
-    JoinContext       *s = ctx->priv;
-    int i;
-
-    for (i = 0; i < ctx->nb_inputs; i++)
-        if (link == ctx->inputs[i])
-            break;
-    av_assert0(i < ctx->nb_inputs);
-    av_assert0(!s->input_frames[i]);
-    s->input_frames[i] = frame;
-
-    return 0;
-}
-
-static int parse_maps(AVFilterContext *ctx)
-{
-    JoinContext *s = ctx->priv;
-    char separator = '|';
-    char *cur      = s->map;
-
-#if FF_API_OLD_FILTER_OPTS
-    if (cur && strchr(cur, ',')) {
-        av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' to "
-               "separate the mappings.\n");
-        separator = ',';
-    }
-#endif
-
-    while (cur && *cur) {
-        char *sep, *next, *p;
-        uint64_t in_channel = 0, out_channel = 0;
-        int input_idx, out_ch_idx, in_ch_idx;
-
-        next = strchr(cur, separator);
-        if (next)
-            *next++ = 0;
-
-        /* split the map into input and output parts */
-        if (!(sep = strchr(cur, '-'))) {
-            av_log(ctx, AV_LOG_ERROR, "Missing separator '-' in channel "
-                   "map '%s'\n", cur);
-            return AVERROR(EINVAL);
-        }
-        *sep++ = 0;
-
-#define PARSE_CHANNEL(str, var, inout)                                         \
-        if (!(var = av_get_channel_layout(str))) {                             \
-            av_log(ctx, AV_LOG_ERROR, "Invalid " inout " channel: %s.\n", str);\
-            return AVERROR(EINVAL);                                            \
-        }                                                                      \
-        if (av_get_channel_layout_nb_channels(var) != 1) {                     \
-            av_log(ctx, AV_LOG_ERROR, "Channel map describes more than one "   \
-                   inout " channel.\n");                                       \
-            return AVERROR(EINVAL);                                            \
-        }
-
-        /* parse output channel */
-        PARSE_CHANNEL(sep, out_channel, "output");
-        if (!(out_channel & s->channel_layout)) {
-            av_log(ctx, AV_LOG_ERROR, "Output channel '%s' is not present in "
-                   "requested channel layout.\n", sep);
-            return AVERROR(EINVAL);
-        }
-
-        out_ch_idx = av_get_channel_layout_channel_index(s->channel_layout,
-                                                         out_channel);
-        if (s->channels[out_ch_idx].input >= 0) {
-            av_log(ctx, AV_LOG_ERROR, "Multiple maps for output channel "
-                   "'%s'.\n", sep);
-            return AVERROR(EINVAL);
-        }
-
-        /* parse input channel */
-        input_idx = strtol(cur, &cur, 0);
-        if (input_idx < 0 || input_idx >= s->inputs) {
-            av_log(ctx, AV_LOG_ERROR, "Invalid input stream index: %d.\n",
-                   input_idx);
-            return AVERROR(EINVAL);
-        }
-
-        if (*cur)
-            cur++;
-
-        in_ch_idx = strtol(cur, &p, 0);
-        if (p == cur) {
-            /* channel specifier is not a number,
-             * try to parse as channel name */
-            PARSE_CHANNEL(cur, in_channel, "input");
-        }
-
-        s->channels[out_ch_idx].input      = input_idx;
-        if (in_channel)
-            s->channels[out_ch_idx].in_channel = in_channel;
-        else
-            s->channels[out_ch_idx].in_channel_idx = in_ch_idx;
-
-        cur = next;
-    }
-    return 0;
-}
-
-static av_cold int join_init(AVFilterContext *ctx)
-{
-    JoinContext *s = ctx->priv;
-    int ret, i;
-
-    if (!(s->channel_layout = av_get_channel_layout(s->channel_layout_str))) {
-        av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout '%s'.\n",
-               s->channel_layout_str);
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-
-    s->nb_channels  = av_get_channel_layout_nb_channels(s->channel_layout);
-    s->channels     = av_mallocz(sizeof(*s->channels) * s->nb_channels);
-    s->buffers      = av_mallocz(sizeof(*s->buffers)  * s->nb_channels);
-    s->input_frames = av_mallocz(sizeof(*s->input_frames) * s->inputs);
-    if (!s->channels || !s->buffers|| !s->input_frames) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    for (i = 0; i < s->nb_channels; i++) {
-        s->channels[i].out_channel = av_channel_layout_extract_channel(s->channel_layout, i);
-        s->channels[i].input       = -1;
-    }
-
-    if ((ret = parse_maps(ctx)) < 0)
-        goto fail;
-
-    for (i = 0; i < s->inputs; i++) {
-        char name[32];
-        AVFilterPad pad = { 0 };
-
-        snprintf(name, sizeof(name), "input%d", i);
-        pad.type           = AVMEDIA_TYPE_AUDIO;
-        pad.name           = av_strdup(name);
-        pad.filter_frame   = filter_frame;
-
-        pad.needs_fifo = 1;
-
-        ff_insert_inpad(ctx, i, &pad);
-    }
-
-fail:
-    av_opt_free(s);
-    return ret;
-}
-
-static av_cold void join_uninit(AVFilterContext *ctx)
-{
-    JoinContext *s = ctx->priv;
-    int i;
-
-    for (i = 0; i < ctx->nb_inputs; i++) {
-        av_freep(&ctx->input_pads[i].name);
-        av_frame_free(&s->input_frames[i]);
-    }
-
-    av_freep(&s->channels);
-    av_freep(&s->buffers);
-    av_freep(&s->input_frames);
-}
-
-static int join_query_formats(AVFilterContext *ctx)
-{
-    JoinContext *s = ctx->priv;
-    AVFilterChannelLayouts *layouts = NULL;
-    int i;
-
-    ff_add_channel_layout(&layouts, s->channel_layout);
-    ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts);
-
-    for (i = 0; i < ctx->nb_inputs; i++)
-        ff_channel_layouts_ref(ff_all_channel_layouts(),
-                               &ctx->inputs[i]->out_channel_layouts);
-
-    ff_set_common_formats    (ctx, ff_planar_sample_fmts());
-    ff_set_common_samplerates(ctx, ff_all_samplerates());
-
-    return 0;
-}
-
-static void guess_map_matching(AVFilterContext *ctx, ChannelMap *ch,
-                               uint64_t *inputs)
-{
-    int i;
-
-    for (i = 0; i < ctx->nb_inputs; i++) {
-        AVFilterLink *link = ctx->inputs[i];
-
-        if (ch->out_channel & link->channel_layout &&
-            !(ch->out_channel & inputs[i])) {
-            ch->input      = i;
-            ch->in_channel = ch->out_channel;
-            inputs[i]     |= ch->out_channel;
-            return;
-        }
-    }
-}
-
-static void guess_map_any(AVFilterContext *ctx, ChannelMap *ch,
-                          uint64_t *inputs)
-{
-    int i;
-
-    for (i = 0; i < ctx->nb_inputs; i++) {
-        AVFilterLink *link = ctx->inputs[i];
-
-        if ((inputs[i] & link->channel_layout) != link->channel_layout) {
-            uint64_t unused = link->channel_layout & ~inputs[i];
-
-            ch->input      = i;
-            ch->in_channel = av_channel_layout_extract_channel(unused, 0);
-            inputs[i]     |= ch->in_channel;
-            return;
-        }
-    }
-}
-
-static int join_config_output(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    JoinContext       *s = ctx->priv;
-    uint64_t *inputs;   // nth element tracks which channels are used from nth input
-    int i, ret = 0;
-
-    /* initialize inputs to user-specified mappings */
-    if (!(inputs = av_mallocz(sizeof(*inputs) * ctx->nb_inputs)))
-        return AVERROR(ENOMEM);
-    for (i = 0; i < s->nb_channels; i++) {
-        ChannelMap *ch = &s->channels[i];
-        AVFilterLink *inlink;
-
-        if (ch->input < 0)
-            continue;
-
-        inlink = ctx->inputs[ch->input];
-
-        if (!ch->in_channel)
-            ch->in_channel = av_channel_layout_extract_channel(inlink->channel_layout,
-                                                               ch->in_channel_idx);
-
-        if (!(ch->in_channel & inlink->channel_layout)) {
-            av_log(ctx, AV_LOG_ERROR, "Requested channel %s is not present in "
-                   "input stream #%d.\n", av_get_channel_name(ch->in_channel),
-                   ch->input);
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-
-        inputs[ch->input] |= ch->in_channel;
-    }
-
-    /* guess channel maps when not explicitly defined */
-    /* first try unused matching channels */
-    for (i = 0; i < s->nb_channels; i++) {
-        ChannelMap *ch = &s->channels[i];
-
-        if (ch->input < 0)
-            guess_map_matching(ctx, ch, inputs);
-    }
-
-    /* if the above failed, try to find _any_ unused input channel */
-    for (i = 0; i < s->nb_channels; i++) {
-        ChannelMap *ch = &s->channels[i];
-
-        if (ch->input < 0)
-            guess_map_any(ctx, ch, inputs);
-
-        if (ch->input < 0) {
-            av_log(ctx, AV_LOG_ERROR, "Could not find input channel for "
-                   "output channel '%s'.\n",
-                   av_get_channel_name(ch->out_channel));
-            goto fail;
-        }
-
-        ch->in_channel_idx = av_get_channel_layout_channel_index(ctx->inputs[ch->input]->channel_layout,
-                                                                 ch->in_channel);
-    }
-
-    /* print mappings */
-    av_log(ctx, AV_LOG_VERBOSE, "mappings: ");
-    for (i = 0; i < s->nb_channels; i++) {
-        ChannelMap *ch = &s->channels[i];
-        av_log(ctx, AV_LOG_VERBOSE, "%d.%s => %s ", ch->input,
-               av_get_channel_name(ch->in_channel),
-               av_get_channel_name(ch->out_channel));
-    }
-    av_log(ctx, AV_LOG_VERBOSE, "\n");
-
-    for (i = 0; i < ctx->nb_inputs; i++) {
-        if (!inputs[i])
-            av_log(ctx, AV_LOG_WARNING, "No channels are used from input "
-                   "stream %d.\n", i);
-    }
-
-fail:
-    av_freep(&inputs);
-    return ret;
-}
-
-static int join_request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    JoinContext *s       = ctx->priv;
-    AVFrame *frame;
-    int linesize   = INT_MAX;
-    int nb_samples = 0;
-    int nb_buffers = 0;
-    int i, j, ret;
-
-    /* get a frame on each input */
-    for (i = 0; i < ctx->nb_inputs; i++) {
-        AVFilterLink *inlink = ctx->inputs[i];
-
-        if (!s->input_frames[i] &&
-            (ret = ff_request_frame(inlink)) < 0)
-            return ret;
-
-        /* request the same number of samples on all inputs */
-        if (i == 0) {
-            nb_samples = s->input_frames[0]->nb_samples;
-
-            for (j = 1; !i && j < ctx->nb_inputs; j++)
-                ctx->inputs[j]->request_samples = nb_samples;
-        }
-    }
-
-    /* setup the output frame */
-    frame = av_frame_alloc();
-    if (!frame)
-        return AVERROR(ENOMEM);
-    if (s->nb_channels > FF_ARRAY_ELEMS(frame->data)) {
-        frame->extended_data = av_mallocz(s->nb_channels *
-                                          sizeof(*frame->extended_data));
-        if (!frame->extended_data) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-    }
-
-    /* copy the data pointers */
-    for (i = 0; i < s->nb_channels; i++) {
-        ChannelMap *ch = &s->channels[i];
-        AVFrame *cur   = s->input_frames[ch->input];
-        AVBufferRef *buf;
-
-        frame->extended_data[i] = cur->extended_data[ch->in_channel_idx];
-        linesize = FFMIN(linesize, cur->linesize[0]);
-
-        /* add the buffer where this plan is stored to the list if it's
-         * not already there */
-        buf = av_frame_get_plane_buffer(cur, ch->in_channel_idx);
-        if (!buf) {
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-        for (j = 0; j < nb_buffers; j++)
-            if (s->buffers[j]->buffer == buf->buffer)
-                break;
-        if (j == i)
-            s->buffers[nb_buffers++] = buf;
-    }
-
-    /* create references to the buffers we copied to output */
-    if (nb_buffers > FF_ARRAY_ELEMS(frame->buf)) {
-        frame->nb_extended_buf = nb_buffers - FF_ARRAY_ELEMS(frame->buf);
-        frame->extended_buf = av_mallocz(sizeof(*frame->extended_buf) *
-                                         frame->nb_extended_buf);
-        if (!frame->extended_buf) {
-            frame->nb_extended_buf = 0;
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-    }
-    for (i = 0; i < FFMIN(FF_ARRAY_ELEMS(frame->buf), nb_buffers); i++) {
-        frame->buf[i] = av_buffer_ref(s->buffers[i]);
-        if (!frame->buf[i]) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-    }
-    for (i = 0; i < frame->nb_extended_buf; i++) {
-        frame->extended_buf[i] = av_buffer_ref(s->buffers[i +
-                                               FF_ARRAY_ELEMS(frame->buf)]);
-        if (!frame->extended_buf[i]) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-    }
-
-    frame->nb_samples     = nb_samples;
-    frame->channel_layout = outlink->channel_layout;
-    frame->sample_rate    = outlink->sample_rate;
-    frame->pts            = s->input_frames[0]->pts;
-    frame->linesize[0]    = linesize;
-    if (frame->data != frame->extended_data) {
-        memcpy(frame->data, frame->extended_data, sizeof(*frame->data) *
-               FFMIN(FF_ARRAY_ELEMS(frame->data), s->nb_channels));
-    }
-
-    ret = ff_filter_frame(outlink, frame);
-
-    for (i = 0; i < ctx->nb_inputs; i++)
-        av_frame_free(&s->input_frames[i]);
-
-    return ret;
-
-fail:
-    av_frame_free(&frame);
-    return ret;
-}
-
-static const AVFilterPad avfilter_af_join_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_AUDIO,
-        .config_props  = join_config_output,
-        .request_frame = join_request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_af_join = {
-    .name           = "join",
-    .description    = NULL_IF_CONFIG_SMALL("Join multiple audio streams into "
-                                           "multi-channel output"),
-    .priv_size      = sizeof(JoinContext),
-    .priv_class     = &join_class,
-
-    .init           = join_init,
-    .uninit         = join_uninit,
-    .query_formats  = join_query_formats,
-
-    .inputs  = NULL,
-    .outputs = avfilter_af_join_outputs,
-
-    .flags   = AVFILTER_FLAG_DYNAMIC_INPUTS,
-};
diff --git a/deps/libav/libavfilter/af_resample.c b/deps/libav/libavfilter/af_resample.c
deleted file mode 100644
index a89ab35..0000000
--- a/deps/libav/libavfilter/af_resample.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * sample format and channel layout conversion audio filter
- */
-
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/common.h"
-#include "libavutil/dict.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-
-#include "libavresample/avresample.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-
-typedef struct ResampleContext {
-    const AVClass *class;
-    AVAudioResampleContext *avr;
-    AVDictionary *options;
-
-    int64_t next_pts;
-
-    /* set by filter_frame() to signal an output frame to request_frame() */
-    int got_output;
-} ResampleContext;
-
-static av_cold int init(AVFilterContext *ctx, AVDictionary **opts)
-{
-    ResampleContext *s = ctx->priv;
-    const AVClass *avr_class = avresample_get_class();
-    AVDictionaryEntry *e = NULL;
-
-    while ((e = av_dict_get(*opts, "", e, AV_DICT_IGNORE_SUFFIX))) {
-        if (av_opt_find(&avr_class, e->key, NULL, 0,
-                        AV_OPT_SEARCH_FAKE_OBJ | AV_OPT_SEARCH_CHILDREN))
-            av_dict_set(&s->options, e->key, e->value, 0);
-    }
-
-    e = NULL;
-    while ((e = av_dict_get(s->options, "", e, AV_DICT_IGNORE_SUFFIX)))
-        av_dict_set(opts, e->key, NULL, 0);
-
-    /* do not allow the user to override basic format options */
-    av_dict_set(&s->options,  "in_channel_layout", NULL, 0);
-    av_dict_set(&s->options, "out_channel_layout", NULL, 0);
-    av_dict_set(&s->options,  "in_sample_fmt",     NULL, 0);
-    av_dict_set(&s->options, "out_sample_fmt",     NULL, 0);
-    av_dict_set(&s->options,  "in_sample_rate",    NULL, 0);
-    av_dict_set(&s->options, "out_sample_rate",    NULL, 0);
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    ResampleContext *s = ctx->priv;
-
-    if (s->avr) {
-        avresample_close(s->avr);
-        avresample_free(&s->avr);
-    }
-    av_dict_free(&s->options);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    AVFilterLink *inlink  = ctx->inputs[0];
-    AVFilterLink *outlink = ctx->outputs[0];
-
-    AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);
-    AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);
-    AVFilterFormats        *in_samplerates  = ff_all_samplerates();
-    AVFilterFormats        *out_samplerates = ff_all_samplerates();
-    AVFilterChannelLayouts *in_layouts      = ff_all_channel_layouts();
-    AVFilterChannelLayouts *out_layouts     = ff_all_channel_layouts();
-
-    ff_formats_ref(in_formats,  &inlink->out_formats);
-    ff_formats_ref(out_formats, &outlink->in_formats);
-
-    ff_formats_ref(in_samplerates,  &inlink->out_samplerates);
-    ff_formats_ref(out_samplerates, &outlink->in_samplerates);
-
-    ff_channel_layouts_ref(in_layouts,  &inlink->out_channel_layouts);
-    ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts);
-
-    return 0;
-}
-
-static int config_output(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    AVFilterLink *inlink = ctx->inputs[0];
-    ResampleContext   *s = ctx->priv;
-    char buf1[64], buf2[64];
-    int ret;
-
-    if (s->avr) {
-        avresample_close(s->avr);
-        avresample_free(&s->avr);
-    }
-
-    if (inlink->channel_layout == outlink->channel_layout &&
-        inlink->sample_rate    == outlink->sample_rate    &&
-        (inlink->format        == outlink->format ||
-        (av_get_channel_layout_nb_channels(inlink->channel_layout)  == 1 &&
-         av_get_channel_layout_nb_channels(outlink->channel_layout) == 1 &&
-         av_get_planar_sample_fmt(inlink->format) ==
-         av_get_planar_sample_fmt(outlink->format))))
-        return 0;
-
-    if (!(s->avr = avresample_alloc_context()))
-        return AVERROR(ENOMEM);
-
-    if (s->options) {
-        AVDictionaryEntry *e = NULL;
-        while ((e = av_dict_get(s->options, "", e, AV_DICT_IGNORE_SUFFIX)))
-            av_log(ctx, AV_LOG_VERBOSE, "lavr option: %s=%s\n", e->key, e->value);
-
-        av_opt_set_dict(s->avr, &s->options);
-    }
-
-    av_opt_set_int(s->avr,  "in_channel_layout", inlink ->channel_layout, 0);
-    av_opt_set_int(s->avr, "out_channel_layout", outlink->channel_layout, 0);
-    av_opt_set_int(s->avr,  "in_sample_fmt",     inlink ->format,         0);
-    av_opt_set_int(s->avr, "out_sample_fmt",     outlink->format,         0);
-    av_opt_set_int(s->avr,  "in_sample_rate",    inlink ->sample_rate,    0);
-    av_opt_set_int(s->avr, "out_sample_rate",    outlink->sample_rate,    0);
-
-    if ((ret = avresample_open(s->avr)) < 0)
-        return ret;
-
-    outlink->time_base = (AVRational){ 1, outlink->sample_rate };
-    s->next_pts        = AV_NOPTS_VALUE;
-
-    av_get_channel_layout_string(buf1, sizeof(buf1),
-                                 -1, inlink ->channel_layout);
-    av_get_channel_layout_string(buf2, sizeof(buf2),
-                                 -1, outlink->channel_layout);
-    av_log(ctx, AV_LOG_VERBOSE,
-           "fmt:%s srate:%d cl:%s -> fmt:%s srate:%d cl:%s\n",
-           av_get_sample_fmt_name(inlink ->format), inlink ->sample_rate, buf1,
-           av_get_sample_fmt_name(outlink->format), outlink->sample_rate, buf2);
-
-    return 0;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    ResampleContext   *s = ctx->priv;
-    int ret = 0;
-
-    s->got_output = 0;
-    while (ret >= 0 && !s->got_output)
-        ret = ff_request_frame(ctx->inputs[0]);
-
-    /* flush the lavr delay buffer */
-    if (ret == AVERROR_EOF && s->avr) {
-        AVFrame *frame;
-        int nb_samples = av_rescale_rnd(avresample_get_delay(s->avr),
-                                        outlink->sample_rate,
-                                        ctx->inputs[0]->sample_rate,
-                                        AV_ROUND_UP);
-
-        if (!nb_samples)
-            return ret;
-
-        frame = ff_get_audio_buffer(outlink, nb_samples);
-        if (!frame)
-            return AVERROR(ENOMEM);
-
-        ret = avresample_convert(s->avr, frame->extended_data,
-                                 frame->linesize[0], nb_samples,
-                                 NULL, 0, 0);
-        if (ret <= 0) {
-            av_frame_free(&frame);
-            return (ret == 0) ? AVERROR_EOF : ret;
-        }
-
-        frame->pts = s->next_pts;
-        return ff_filter_frame(outlink, frame);
-    }
-    return ret;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    AVFilterContext  *ctx = inlink->dst;
-    ResampleContext    *s = ctx->priv;
-    AVFilterLink *outlink = ctx->outputs[0];
-    int ret;
-
-    if (s->avr) {
-        AVFrame *out;
-        int delay, nb_samples;
-
-        /* maximum possible samples lavr can output */
-        delay      = avresample_get_delay(s->avr);
-        nb_samples = av_rescale_rnd(in->nb_samples + delay,
-                                    outlink->sample_rate, inlink->sample_rate,
-                                    AV_ROUND_UP);
-
-        out = ff_get_audio_buffer(outlink, nb_samples);
-        if (!out) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        ret = avresample_convert(s->avr, out->extended_data, out->linesize[0],
-                                 nb_samples, in->extended_data, in->linesize[0],
-                                 in->nb_samples);
-        if (ret <= 0) {
-            av_frame_free(&out);
-            if (ret < 0)
-                goto fail;
-        }
-
-        av_assert0(!avresample_available(s->avr));
-
-        if (s->next_pts == AV_NOPTS_VALUE) {
-            if (in->pts == AV_NOPTS_VALUE) {
-                av_log(ctx, AV_LOG_WARNING, "First timestamp is missing, "
-                       "assuming 0.\n");
-                s->next_pts = 0;
-            } else
-                s->next_pts = av_rescale_q(in->pts, inlink->time_base,
-                                           outlink->time_base);
-        }
-
-        if (ret > 0) {
-            out->nb_samples = ret;
-
-            ret = av_frame_copy_props(out, in);
-            if (ret < 0) {
-                av_frame_free(&out);
-                goto fail;
-            }
-
-            out->sample_rate = outlink->sample_rate;
-            if (in->pts != AV_NOPTS_VALUE) {
-                out->pts = av_rescale_q(in->pts, inlink->time_base,
-                                            outlink->time_base) -
-                               av_rescale(delay, outlink->sample_rate,
-                                          inlink->sample_rate);
-            } else
-                out->pts = s->next_pts;
-
-            s->next_pts = out->pts + out->nb_samples;
-
-            ret = ff_filter_frame(outlink, out);
-            s->got_output = 1;
-        }
-
-fail:
-        av_frame_free(&in);
-    } else {
-        in->format = outlink->format;
-        ret = ff_filter_frame(outlink, in);
-        s->got_output = 1;
-    }
-
-    return ret;
-}
-
-static const AVClass *resample_child_class_next(const AVClass *prev)
-{
-    return prev ? NULL : avresample_get_class();
-}
-
-static void *resample_child_next(void *obj, void *prev)
-{
-    ResampleContext *s = obj;
-    return prev ? NULL : s->avr;
-}
-
-static const AVClass resample_class = {
-    .class_name       = "resample",
-    .item_name        = av_default_item_name,
-    .version          = LIBAVUTIL_VERSION_INT,
-    .child_class_next = resample_child_class_next,
-    .child_next       = resample_child_next,
-};
-
-static const AVFilterPad avfilter_af_resample_inputs[] = {
-    {
-        .name           = "default",
-        .type           = AVMEDIA_TYPE_AUDIO,
-        .filter_frame   = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_af_resample_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_AUDIO,
-        .config_props  = config_output,
-        .request_frame = request_frame
-    },
-    { NULL }
-};
-
-AVFilter ff_af_resample = {
-    .name          = "resample",
-    .description   = NULL_IF_CONFIG_SMALL("Audio resampling and conversion."),
-    .priv_size     = sizeof(ResampleContext),
-    .priv_class    = &resample_class,
-
-    .init_dict      = init,
-    .uninit         = uninit,
-    .query_formats  = query_formats,
-
-    .inputs    = avfilter_af_resample_inputs,
-    .outputs   = avfilter_af_resample_outputs,
-};
diff --git a/deps/libav/libavfilter/af_volume.c b/deps/libav/libavfilter/af_volume.c
deleted file mode 100644
index 59223e5..0000000
--- a/deps/libav/libavfilter/af_volume.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (c) 2011 Stefano Sabatini
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * audio volume filter
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/eval.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/opt.h"
-#include "audio.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "af_volume.h"
-
-static const char *precision_str[] = {
-    "fixed", "float", "double"
-};
-
-#define OFFSET(x) offsetof(VolumeContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM
-
-static const AVOption options[] = {
-    { "volume", "Volume adjustment.",
-            OFFSET(volume), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, 0, 0x7fffff, A },
-    { "precision", "Mathematical precision.",
-            OFFSET(precision), AV_OPT_TYPE_INT, { .i64 = PRECISION_FLOAT }, PRECISION_FIXED, PRECISION_DOUBLE, A, "precision" },
-        { "fixed",  "8-bit fixed-point.",     0, AV_OPT_TYPE_CONST, { .i64 = PRECISION_FIXED  }, INT_MIN, INT_MAX, A, "precision" },
-        { "float",  "32-bit floating-point.", 0, AV_OPT_TYPE_CONST, { .i64 = PRECISION_FLOAT  }, INT_MIN, INT_MAX, A, "precision" },
-        { "double", "64-bit floating-point.", 0, AV_OPT_TYPE_CONST, { .i64 = PRECISION_DOUBLE }, INT_MIN, INT_MAX, A, "precision" },
-    { NULL },
-};
-
-static const AVClass volume_class = {
-    .class_name = "volume filter",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    VolumeContext *vol = ctx->priv;
-
-    if (vol->precision == PRECISION_FIXED) {
-        vol->volume_i = (int)(vol->volume * 256 + 0.5);
-        vol->volume   = vol->volume_i / 256.0;
-        av_log(ctx, AV_LOG_VERBOSE, "volume:(%d/256)(%f)(%1.2fdB) precision:fixed\n",
-               vol->volume_i, vol->volume, 20.0*log(vol->volume)/M_LN10);
-    } else {
-        av_log(ctx, AV_LOG_VERBOSE, "volume:(%f)(%1.2fdB) precision:%s\n",
-               vol->volume, 20.0*log(vol->volume)/M_LN10,
-               precision_str[vol->precision]);
-    }
-
-    return 0;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    VolumeContext *vol = ctx->priv;
-    AVFilterFormats *formats = NULL;
-    AVFilterChannelLayouts *layouts;
-    static const enum AVSampleFormat sample_fmts[][7] = {
-        /* PRECISION_FIXED */
-        {
-            AV_SAMPLE_FMT_U8,
-            AV_SAMPLE_FMT_U8P,
-            AV_SAMPLE_FMT_S16,
-            AV_SAMPLE_FMT_S16P,
-            AV_SAMPLE_FMT_S32,
-            AV_SAMPLE_FMT_S32P,
-            AV_SAMPLE_FMT_NONE
-        },
-        /* PRECISION_FLOAT */
-        {
-            AV_SAMPLE_FMT_FLT,
-            AV_SAMPLE_FMT_FLTP,
-            AV_SAMPLE_FMT_NONE
-        },
-        /* PRECISION_DOUBLE */
-        {
-            AV_SAMPLE_FMT_DBL,
-            AV_SAMPLE_FMT_DBLP,
-            AV_SAMPLE_FMT_NONE
-        }
-    };
-
-    layouts = ff_all_channel_layouts();
-    if (!layouts)
-        return AVERROR(ENOMEM);
-    ff_set_common_channel_layouts(ctx, layouts);
-
-    formats = ff_make_format_list(sample_fmts[vol->precision]);
-    if (!formats)
-        return AVERROR(ENOMEM);
-    ff_set_common_formats(ctx, formats);
-
-    formats = ff_all_samplerates();
-    if (!formats)
-        return AVERROR(ENOMEM);
-    ff_set_common_samplerates(ctx, formats);
-
-    return 0;
-}
-
-static inline void scale_samples_u8(uint8_t *dst, const uint8_t *src,
-                                    int nb_samples, int volume)
-{
-    int i;
-    for (i = 0; i < nb_samples; i++)
-        dst[i] = av_clip_uint8(((((int64_t)src[i] - 128) * volume + 128) >> 8) + 128);
-}
-
-static inline void scale_samples_u8_small(uint8_t *dst, const uint8_t *src,
-                                          int nb_samples, int volume)
-{
-    int i;
-    for (i = 0; i < nb_samples; i++)
-        dst[i] = av_clip_uint8((((src[i] - 128) * volume + 128) >> 8) + 128);
-}
-
-static inline void scale_samples_s16(uint8_t *dst, const uint8_t *src,
-                                     int nb_samples, int volume)
-{
-    int i;
-    int16_t *smp_dst       = (int16_t *)dst;
-    const int16_t *smp_src = (const int16_t *)src;
-    for (i = 0; i < nb_samples; i++)
-        smp_dst[i] = av_clip_int16(((int64_t)smp_src[i] * volume + 128) >> 8);
-}
-
-static inline void scale_samples_s16_small(uint8_t *dst, const uint8_t *src,
-                                           int nb_samples, int volume)
-{
-    int i;
-    int16_t *smp_dst       = (int16_t *)dst;
-    const int16_t *smp_src = (const int16_t *)src;
-    for (i = 0; i < nb_samples; i++)
-        smp_dst[i] = av_clip_int16((smp_src[i] * volume + 128) >> 8);
-}
-
-static inline void scale_samples_s32(uint8_t *dst, const uint8_t *src,
-                                     int nb_samples, int volume)
-{
-    int i;
-    int32_t *smp_dst       = (int32_t *)dst;
-    const int32_t *smp_src = (const int32_t *)src;
-    for (i = 0; i < nb_samples; i++)
-        smp_dst[i] = av_clipl_int32((((int64_t)smp_src[i] * volume + 128) >> 8));
-}
-
-
-
-static av_cold void volume_init(VolumeContext *vol)
-{
-    vol->samples_align = 1;
-
-    switch (av_get_packed_sample_fmt(vol->sample_fmt)) {
-    case AV_SAMPLE_FMT_U8:
-        if (vol->volume_i < 0x1000000)
-            vol->scale_samples = scale_samples_u8_small;
-        else
-            vol->scale_samples = scale_samples_u8;
-        break;
-    case AV_SAMPLE_FMT_S16:
-        if (vol->volume_i < 0x10000)
-            vol->scale_samples = scale_samples_s16_small;
-        else
-            vol->scale_samples = scale_samples_s16;
-        break;
-    case AV_SAMPLE_FMT_S32:
-        vol->scale_samples = scale_samples_s32;
-        break;
-    case AV_SAMPLE_FMT_FLT:
-        avpriv_float_dsp_init(&vol->fdsp, 0);
-        vol->samples_align = 4;
-        break;
-    case AV_SAMPLE_FMT_DBL:
-        avpriv_float_dsp_init(&vol->fdsp, 0);
-        vol->samples_align = 8;
-        break;
-    }
-
-    if (ARCH_X86)
-        ff_volume_init_x86(vol);
-}
-
-static int config_output(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    VolumeContext *vol   = ctx->priv;
-    AVFilterLink *inlink = ctx->inputs[0];
-
-    vol->sample_fmt = inlink->format;
-    vol->channels   = av_get_channel_layout_nb_channels(inlink->channel_layout);
-    vol->planes     = av_sample_fmt_is_planar(inlink->format) ? vol->channels : 1;
-
-    volume_init(vol);
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
-{
-    VolumeContext *vol    = inlink->dst->priv;
-    AVFilterLink *outlink = inlink->dst->outputs[0];
-    int nb_samples        = buf->nb_samples;
-    AVFrame *out_buf;
-    int ret;
-
-    if (vol->volume == 1.0 || vol->volume_i == 256)
-        return ff_filter_frame(outlink, buf);
-
-    /* do volume scaling in-place if input buffer is writable */
-    if (av_frame_is_writable(buf)) {
-        out_buf = buf;
-    } else {
-        out_buf = ff_get_audio_buffer(inlink, nb_samples);
-        if (!out_buf)
-            return AVERROR(ENOMEM);
-        ret = av_frame_copy_props(out_buf, buf);
-        if (ret < 0) {
-            av_frame_free(&out_buf);
-            av_frame_free(&buf);
-            return ret;
-        }
-    }
-
-    if (vol->precision != PRECISION_FIXED || vol->volume_i > 0) {
-        int p, plane_samples;
-
-        if (av_sample_fmt_is_planar(buf->format))
-            plane_samples = FFALIGN(nb_samples, vol->samples_align);
-        else
-            plane_samples = FFALIGN(nb_samples * vol->channels, vol->samples_align);
-
-        if (vol->precision == PRECISION_FIXED) {
-            for (p = 0; p < vol->planes; p++) {
-                vol->scale_samples(out_buf->extended_data[p],
-                                   buf->extended_data[p], plane_samples,
-                                   vol->volume_i);
-            }
-        } else if (av_get_packed_sample_fmt(vol->sample_fmt) == AV_SAMPLE_FMT_FLT) {
-            for (p = 0; p < vol->planes; p++) {
-                vol->fdsp.vector_fmul_scalar((float *)out_buf->extended_data[p],
-                                             (const float *)buf->extended_data[p],
-                                             vol->volume, plane_samples);
-            }
-        } else {
-            for (p = 0; p < vol->planes; p++) {
-                vol->fdsp.vector_dmul_scalar((double *)out_buf->extended_data[p],
-                                             (const double *)buf->extended_data[p],
-                                             vol->volume, plane_samples);
-            }
-        }
-    }
-
-    emms_c();
-
-    if (buf != out_buf)
-        av_frame_free(&buf);
-
-    return ff_filter_frame(outlink, out_buf);
-}
-
-static const AVFilterPad avfilter_af_volume_inputs[] = {
-    {
-        .name           = "default",
-        .type           = AVMEDIA_TYPE_AUDIO,
-        .filter_frame   = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_af_volume_outputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_AUDIO,
-        .config_props = config_output,
-    },
-    { NULL }
-};
-
-AVFilter ff_af_volume = {
-    .name           = "volume",
-    .description    = NULL_IF_CONFIG_SMALL("Change input volume."),
-    .query_formats  = query_formats,
-    .priv_size      = sizeof(VolumeContext),
-    .priv_class     = &volume_class,
-    .init           = init,
-    .inputs         = avfilter_af_volume_inputs,
-    .outputs        = avfilter_af_volume_outputs,
-};
diff --git a/deps/libav/libavfilter/af_volume.h b/deps/libav/libavfilter/af_volume.h
deleted file mode 100644
index a1883ed..0000000
--- a/deps/libav/libavfilter/af_volume.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * audio volume filter
- */
-
-#ifndef AVFILTER_AF_VOLUME_H
-#define AVFILTER_AF_VOLUME_H
-
-#include "libavutil/common.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-
-enum PrecisionType {
-    PRECISION_FIXED = 0,
-    PRECISION_FLOAT,
-    PRECISION_DOUBLE,
-};
-
-typedef struct VolumeContext {
-    const AVClass *class;
-    AVFloatDSPContext fdsp;
-    enum PrecisionType precision;
-    double volume;
-    int    volume_i;
-    int    channels;
-    int    planes;
-    enum AVSampleFormat sample_fmt;
-
-    void (*scale_samples)(uint8_t *dst, const uint8_t *src, int nb_samples,
-                          int volume);
-    int samples_align;
-} VolumeContext;
-
-void ff_volume_init_x86(VolumeContext *vol);
-
-#endif /* AVFILTER_AF_VOLUME_H */
diff --git a/deps/libav/libavfilter/allfilters.c b/deps/libav/libavfilter/allfilters.c
deleted file mode 100644
index e47a22e..0000000
--- a/deps/libav/libavfilter/allfilters.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * filter registration
- * Copyright (c) 2008 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avfilter.h"
-#include "config.h"
-
-
-#define REGISTER_FILTER(X, x, y)                                        \
-    {                                                                   \
-        extern AVFilter ff_##y##_##x;                                   \
-        if (CONFIG_##X##_FILTER)                                        \
-            avfilter_register(&ff_##y##_##x);                           \
-    }
-
-#define REGISTER_FILTER_UNCONDITIONAL(x)                                \
-    {                                                                   \
-        extern AVFilter ff_##x;                                         \
-        avfilter_register(&ff_##x);                                     \
-    }
-
-void avfilter_register_all(void)
-{
-    static int initialized;
-
-    if (initialized)
-        return;
-    initialized = 1;
-
-    REGISTER_FILTER(AFORMAT,        aformat,        af);
-    REGISTER_FILTER(AMIX,           amix,           af);
-    REGISTER_FILTER(ANULL,          anull,          af);
-    REGISTER_FILTER(ASETPTS,        asetpts,        af);
-    REGISTER_FILTER(ASHOWINFO,      ashowinfo,      af);
-    REGISTER_FILTER(ASPLIT,         asplit,         af);
-    REGISTER_FILTER(ASYNCTS,        asyncts,        af);
-    REGISTER_FILTER(ATRIM,          atrim,          af);
-    REGISTER_FILTER(CHANNELMAP,     channelmap,     af);
-    REGISTER_FILTER(CHANNELSPLIT,   channelsplit,   af);
-    REGISTER_FILTER(COMPAND,        compand,        af);
-    REGISTER_FILTER(JOIN,           join,           af);
-    REGISTER_FILTER(RESAMPLE,       resample,       af);
-    REGISTER_FILTER(VOLUME,         volume,         af);
-
-    REGISTER_FILTER(ANULLSRC,       anullsrc,       asrc);
-
-    REGISTER_FILTER(ANULLSINK,      anullsink,      asink);
-
-    REGISTER_FILTER(BLACKFRAME,     blackframe,     vf);
-    REGISTER_FILTER(BOXBLUR,        boxblur,        vf);
-    REGISTER_FILTER(COPY,           copy,           vf);
-    REGISTER_FILTER(CROP,           crop,           vf);
-    REGISTER_FILTER(CROPDETECT,     cropdetect,     vf);
-    REGISTER_FILTER(DELOGO,         delogo,         vf);
-    REGISTER_FILTER(DRAWBOX,        drawbox,        vf);
-    REGISTER_FILTER(DRAWTEXT,       drawtext,       vf);
-    REGISTER_FILTER(FADE,           fade,           vf);
-    REGISTER_FILTER(FIELDORDER,     fieldorder,     vf);
-    REGISTER_FILTER(FORMAT,         format,         vf);
-    REGISTER_FILTER(FPS,            fps,            vf);
-    REGISTER_FILTER(FRAMEPACK,      framepack,      vf);
-    REGISTER_FILTER(FREI0R,         frei0r,         vf);
-    REGISTER_FILTER(GRADFUN,        gradfun,        vf);
-    REGISTER_FILTER(HFLIP,          hflip,          vf);
-    REGISTER_FILTER(HQDN3D,         hqdn3d,         vf);
-    REGISTER_FILTER(INTERLACE,      interlace,      vf);
-    REGISTER_FILTER(LUT,            lut,            vf);
-    REGISTER_FILTER(LUTRGB,         lutrgb,         vf);
-    REGISTER_FILTER(LUTYUV,         lutyuv,         vf);
-    REGISTER_FILTER(NEGATE,         negate,         vf);
-    REGISTER_FILTER(NOFORMAT,       noformat,       vf);
-    REGISTER_FILTER(NULL,           null,           vf);
-    REGISTER_FILTER(OCV,            ocv,            vf);
-    REGISTER_FILTER(OVERLAY,        overlay,        vf);
-    REGISTER_FILTER(PAD,            pad,            vf);
-    REGISTER_FILTER(PIXDESCTEST,    pixdesctest,    vf);
-    REGISTER_FILTER(SCALE,          scale,          vf);
-    REGISTER_FILTER(SELECT,         select,         vf);
-    REGISTER_FILTER(SETDAR,         setdar,         vf);
-    REGISTER_FILTER(SETPTS,         setpts,         vf);
-    REGISTER_FILTER(SETSAR,         setsar,         vf);
-    REGISTER_FILTER(SETTB,          settb,          vf);
-    REGISTER_FILTER(SHOWINFO,       showinfo,       vf);
-    REGISTER_FILTER(SPLIT,          split,          vf);
-    REGISTER_FILTER(TRANSPOSE,      transpose,      vf);
-    REGISTER_FILTER(TRIM,           trim,           vf);
-    REGISTER_FILTER(UNSHARP,        unsharp,        vf);
-    REGISTER_FILTER(VFLIP,          vflip,          vf);
-    REGISTER_FILTER(YADIF,          yadif,          vf);
-
-    REGISTER_FILTER(COLOR,          color,          vsrc);
-    REGISTER_FILTER(FREI0R,         frei0r_src,     vsrc);
-    REGISTER_FILTER(MOVIE,          movie,          vsrc);
-    REGISTER_FILTER(NULLSRC,        nullsrc,        vsrc);
-    REGISTER_FILTER(RGBTESTSRC,     rgbtestsrc,     vsrc);
-    REGISTER_FILTER(TESTSRC,        testsrc,        vsrc);
-
-    REGISTER_FILTER(NULLSINK,       nullsink,       vsink);
-
-    /* those filters are part of public or internal API => registered
-     * unconditionally */
-    REGISTER_FILTER_UNCONDITIONAL(asrc_abuffer);
-    REGISTER_FILTER_UNCONDITIONAL(vsrc_buffer);
-    REGISTER_FILTER_UNCONDITIONAL(asink_abuffer);
-    REGISTER_FILTER_UNCONDITIONAL(vsink_buffer);
-    REGISTER_FILTER_UNCONDITIONAL(af_afifo);
-    REGISTER_FILTER_UNCONDITIONAL(vf_fifo);
-}
diff --git a/deps/libav/libavfilter/asink_anullsink.c b/deps/libav/libavfilter/asink_anullsink.c
deleted file mode 100644
index 44f547d..0000000
--- a/deps/libav/libavfilter/asink_anullsink.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/internal.h"
-#include "avfilter.h"
-#include "internal.h"
-
-static int null_filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    av_frame_free(&frame);
-    return 0;
-}
-
-static const AVFilterPad avfilter_asink_anullsink_inputs[] = {
-    {
-        .name           = "default",
-        .type           = AVMEDIA_TYPE_AUDIO,
-        .filter_frame   = null_filter_frame,
-    },
-    { NULL },
-};
-
-AVFilter ff_asink_anullsink = {
-    .name        = "anullsink",
-    .description = NULL_IF_CONFIG_SMALL("Do absolutely nothing with the input audio."),
-
-    .priv_size = 0,
-
-    .inputs    = avfilter_asink_anullsink_inputs,
-    .outputs   = NULL,
-};
diff --git a/deps/libav/libavfilter/asrc_anullsrc.c b/deps/libav/libavfilter/asrc_anullsrc.c
deleted file mode 100644
index b1a449c..0000000
--- a/deps/libav/libavfilter/asrc_anullsrc.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * null audio source
- */
-
-#include <inttypes.h>
-#include <stdio.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/internal.h"
-#include "avfilter.h"
-#include "internal.h"
-
-static int request_frame(AVFilterLink *link)
-{
-    return AVERROR_EOF;
-}
-
-static const AVFilterPad avfilter_asrc_anullsrc_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_AUDIO,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_asrc_anullsrc = {
-    .name        = "anullsrc",
-    .description = NULL_IF_CONFIG_SMALL("Null audio source, never return audio frames."),
-
-    .inputs      = NULL,
-
-    .outputs     = avfilter_asrc_anullsrc_outputs,
-};
diff --git a/deps/libav/libavfilter/audio.c b/deps/libav/libavfilter/audio.c
deleted file mode 100644
index b332e9e..0000000
--- a/deps/libav/libavfilter/audio.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "internal.h"
-
-AVFrame *ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples)
-{
-    return ff_get_audio_buffer(link->dst->outputs[0], nb_samples);
-}
-
-AVFrame *ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples)
-{
-    AVFrame *frame = av_frame_alloc();
-    int channels = av_get_channel_layout_nb_channels(link->channel_layout);
-    int ret;
-
-    if (!frame)
-        return NULL;
-
-    frame->nb_samples     = nb_samples;
-    frame->format         = link->format;
-    frame->channel_layout = link->channel_layout;
-    frame->sample_rate    = link->sample_rate;
-    ret = av_frame_get_buffer(frame, 0);
-    if (ret < 0) {
-        av_frame_free(&frame);
-        return NULL;
-    }
-
-    av_samples_set_silence(frame->extended_data, 0, nb_samples, channels,
-                           link->format);
-
-
-    return frame;
-}
-
-AVFrame *ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
-{
-    AVFrame *ret = NULL;
-
-    if (link->dstpad->get_audio_buffer)
-        ret = link->dstpad->get_audio_buffer(link, nb_samples);
-
-    if (!ret)
-        ret = ff_default_get_audio_buffer(link, nb_samples);
-
-    return ret;
-}
-
-#if FF_API_AVFILTERBUFFER
-AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
-                                                             int linesize,int perms,
-                                                             int nb_samples,
-                                                             enum AVSampleFormat sample_fmt,
-                                                             uint64_t channel_layout)
-{
-    int planes;
-    AVFilterBuffer    *samples    = av_mallocz(sizeof(*samples));
-    AVFilterBufferRef *samplesref = av_mallocz(sizeof(*samplesref));
-
-    if (!samples || !samplesref)
-        goto fail;
-
-    samplesref->buf         = samples;
-    samplesref->buf->free   = ff_avfilter_default_free_buffer;
-    if (!(samplesref->audio = av_mallocz(sizeof(*samplesref->audio))))
-        goto fail;
-
-    samplesref->audio->nb_samples     = nb_samples;
-    samplesref->audio->channel_layout = channel_layout;
-    samplesref->audio->planar         = av_sample_fmt_is_planar(sample_fmt);
-
-    planes = samplesref->audio->planar ? av_get_channel_layout_nb_channels(channel_layout) : 1;
-
-    /* make sure the buffer gets read permission or it's useless for output */
-    samplesref->perms = perms | AV_PERM_READ;
-
-    samples->refcount  = 1;
-    samplesref->type   = AVMEDIA_TYPE_AUDIO;
-    samplesref->format = sample_fmt;
-
-    memcpy(samples->data, data,
-           FFMIN(FF_ARRAY_ELEMS(samples->data), planes)*sizeof(samples->data[0]));
-    memcpy(samplesref->data, samples->data, sizeof(samples->data));
-
-    samples->linesize[0] = samplesref->linesize[0] = linesize;
-
-    if (planes > FF_ARRAY_ELEMS(samples->data)) {
-        samples->   extended_data = av_mallocz(sizeof(*samples->extended_data) *
-                                               planes);
-        samplesref->extended_data = av_mallocz(sizeof(*samplesref->extended_data) *
-                                               planes);
-
-        if (!samples->extended_data || !samplesref->extended_data)
-            goto fail;
-
-        memcpy(samples->   extended_data, data, sizeof(*data)*planes);
-        memcpy(samplesref->extended_data, data, sizeof(*data)*planes);
-    } else {
-        samples->extended_data    = samples->data;
-        samplesref->extended_data = samplesref->data;
-    }
-
-    samplesref->pts = AV_NOPTS_VALUE;
-
-    return samplesref;
-
-fail:
-    if (samples && samples->extended_data != samples->data)
-        av_freep(&samples->extended_data);
-    if (samplesref) {
-        av_freep(&samplesref->audio);
-        if (samplesref->extended_data != samplesref->data)
-            av_freep(&samplesref->extended_data);
-    }
-    av_freep(&samplesref);
-    av_freep(&samples);
-    return NULL;
-}
-#endif
diff --git a/deps/libav/libavfilter/audio.h b/deps/libav/libavfilter/audio.h
deleted file mode 100644
index 4684b6c..0000000
--- a/deps/libav/libavfilter/audio.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_AUDIO_H
-#define AVFILTER_AUDIO_H
-
-#include "avfilter.h"
-
-/** default handler for get_audio_buffer() for audio inputs */
-AVFrame *ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples);
-
-/** get_audio_buffer() handler for filters which simply pass audio along */
-AVFrame *ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples);
-
-/**
- * Request an audio samples buffer with a specific set of permissions.
- *
- * @param link           the output link to the filter from which the buffer will
- *                       be requested
- * @param nb_samples     the number of samples per channel
- * @return               A reference to the samples. This must be unreferenced with
- *                       avfilter_unref_buffer when you are finished with it.
- */
-AVFrame *ff_get_audio_buffer(AVFilterLink *link, int nb_samples);
-
-#endif /* AVFILTER_AUDIO_H */
diff --git a/deps/libav/libavfilter/avfilter.c b/deps/libav/libavfilter/avfilter.c
deleted file mode 100644
index f02358f..0000000
--- a/deps/libav/libavfilter/avfilter.c
+++ /dev/null
@@ -1,796 +0,0 @@
-/*
- * filter layer
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/rational.h"
-#include "libavutil/samplefmt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-unsigned avfilter_version(void)
-{
-    return LIBAVFILTER_VERSION_INT;
-}
-
-const char *avfilter_configuration(void)
-{
-    return LIBAV_CONFIGURATION;
-}
-
-const char *avfilter_license(void)
-{
-#define LICENSE_PREFIX "libavfilter license: "
-    return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
-}
-
-void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
-                   AVFilterPad **pads, AVFilterLink ***links,
-                   AVFilterPad *newpad)
-{
-    unsigned i;
-
-    idx = FFMIN(idx, *count);
-
-    *pads  = av_realloc(*pads,  sizeof(AVFilterPad)   * (*count + 1));
-    *links = av_realloc(*links, sizeof(AVFilterLink*) * (*count + 1));
-    memmove(*pads  + idx + 1, *pads  + idx, sizeof(AVFilterPad)   * (*count - idx));
-    memmove(*links + idx + 1, *links + idx, sizeof(AVFilterLink*) * (*count - idx));
-    memcpy(*pads + idx, newpad, sizeof(AVFilterPad));
-    (*links)[idx] = NULL;
-
-    (*count)++;
-    for (i = idx + 1; i < *count; i++)
-        if (*links[i])
-            (*(unsigned *)((uint8_t *) *links[i] + padidx_off))++;
-}
-
-int avfilter_link(AVFilterContext *src, unsigned srcpad,
-                  AVFilterContext *dst, unsigned dstpad)
-{
-    AVFilterLink *link;
-
-    if (src->nb_outputs <= srcpad || dst->nb_inputs <= dstpad ||
-        src->outputs[srcpad]      || dst->inputs[dstpad])
-        return -1;
-
-    if (src->output_pads[srcpad].type != dst->input_pads[dstpad].type) {
-        av_log(src, AV_LOG_ERROR,
-               "Media type mismatch between the '%s' filter output pad %d and the '%s' filter input pad %d\n",
-               src->name, srcpad, dst->name, dstpad);
-        return AVERROR(EINVAL);
-    }
-
-    link = av_mallocz(sizeof(*link));
-    if (!link)
-        return AVERROR(ENOMEM);
-
-    src->outputs[srcpad] = dst->inputs[dstpad] = link;
-
-    link->src     = src;
-    link->dst     = dst;
-    link->srcpad  = &src->output_pads[srcpad];
-    link->dstpad  = &dst->input_pads[dstpad];
-    link->type    = src->output_pads[srcpad].type;
-    assert(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);
-    link->format  = -1;
-
-    return 0;
-}
-
-int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
-                           unsigned filt_srcpad_idx, unsigned filt_dstpad_idx)
-{
-    int ret;
-    unsigned dstpad_idx = link->dstpad - link->dst->input_pads;
-
-    av_log(link->dst, AV_LOG_VERBOSE, "auto-inserting filter '%s' "
-           "between the filter '%s' and the filter '%s'\n",
-           filt->name, link->src->name, link->dst->name);
-
-    link->dst->inputs[dstpad_idx] = NULL;
-    if ((ret = avfilter_link(filt, filt_dstpad_idx, link->dst, dstpad_idx)) < 0) {
-        /* failed to link output filter to new filter */
-        link->dst->inputs[dstpad_idx] = link;
-        return ret;
-    }
-
-    /* re-hookup the link to the new destination filter we inserted */
-    link->dst                     = filt;
-    link->dstpad                  = &filt->input_pads[filt_srcpad_idx];
-    filt->inputs[filt_srcpad_idx] = link;
-
-    /* if any information on supported media formats already exists on the
-     * link, we need to preserve that */
-    if (link->out_formats)
-        ff_formats_changeref(&link->out_formats,
-                             &filt->outputs[filt_dstpad_idx]->out_formats);
-    if (link->out_samplerates)
-        ff_formats_changeref(&link->out_samplerates,
-                             &filt->outputs[filt_dstpad_idx]->out_samplerates);
-    if (link->out_channel_layouts)
-        ff_channel_layouts_changeref(&link->out_channel_layouts,
-                                     &filt->outputs[filt_dstpad_idx]->out_channel_layouts);
-
-    return 0;
-}
-
-int avfilter_config_links(AVFilterContext *filter)
-{
-    int (*config_link)(AVFilterLink *);
-    unsigned i;
-    int ret;
-
-    for (i = 0; i < filter->nb_inputs; i ++) {
-        AVFilterLink *link = filter->inputs[i];
-
-        if (!link) continue;
-
-        switch (link->init_state) {
-        case AVLINK_INIT:
-            continue;
-        case AVLINK_STARTINIT:
-            av_log(filter, AV_LOG_INFO, "circular filter chain detected\n");
-            return 0;
-        case AVLINK_UNINIT:
-            link->init_state = AVLINK_STARTINIT;
-
-            if ((ret = avfilter_config_links(link->src)) < 0)
-                return ret;
-
-            if (!(config_link = link->srcpad->config_props)) {
-                if (link->src->nb_inputs != 1) {
-                    av_log(link->src, AV_LOG_ERROR, "Source filters and filters "
-                                                    "with more than one input "
-                                                    "must set config_props() "
-                                                    "callbacks on all outputs\n");
-                    return AVERROR(EINVAL);
-                }
-            } else if ((ret = config_link(link)) < 0) {
-                av_log(link->src, AV_LOG_ERROR,
-                       "Failed to configure output pad on %s\n",
-                       link->src->name);
-                return ret;
-            }
-
-            if (link->time_base.num == 0 && link->time_base.den == 0)
-                link->time_base = link->src && link->src->nb_inputs ?
-                    link->src->inputs[0]->time_base : AV_TIME_BASE_Q;
-
-            if (link->type == AVMEDIA_TYPE_VIDEO) {
-                if (!link->sample_aspect_ratio.num && !link->sample_aspect_ratio.den)
-                    link->sample_aspect_ratio = link->src->nb_inputs ?
-                        link->src->inputs[0]->sample_aspect_ratio : (AVRational){1,1};
-
-                if (link->src->nb_inputs) {
-                    if (!link->w)
-                        link->w = link->src->inputs[0]->w;
-                    if (!link->h)
-                        link->h = link->src->inputs[0]->h;
-                } else if (!link->w || !link->h) {
-                    av_log(link->src, AV_LOG_ERROR,
-                           "Video source filters must set their output link's "
-                           "width and height\n");
-                    return AVERROR(EINVAL);
-                }
-            }
-
-            if ((config_link = link->dstpad->config_props))
-                if ((ret = config_link(link)) < 0) {
-                    av_log(link->src, AV_LOG_ERROR,
-                           "Failed to configure input pad on %s\n",
-                           link->dst->name);
-                    return ret;
-                }
-
-            link->init_state = AVLINK_INIT;
-        }
-    }
-
-    return 0;
-}
-
-void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
-{
-    if (link->type == AVMEDIA_TYPE_VIDEO) {
-        av_dlog(ctx,
-                "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
-                link, link->w, link->h,
-                av_get_pix_fmt_name(link->format),
-                link->src ? link->src->filter->name : "",
-                link->dst ? link->dst->filter->name : "",
-                end ? "\n" : "");
-    } else {
-        char buf[128];
-        av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
-
-        av_dlog(ctx,
-                "link[%p r:%d cl:%s fmt:%-16s %-16s->%-16s]%s",
-                link, link->sample_rate, buf,
-                av_get_sample_fmt_name(link->format),
-                link->src ? link->src->filter->name : "",
-                link->dst ? link->dst->filter->name : "",
-                end ? "\n" : "");
-    }
-}
-
-int ff_request_frame(AVFilterLink *link)
-{
-    FF_DPRINTF_START(NULL, request_frame); ff_dlog_link(NULL, link, 1);
-
-    if (link->srcpad->request_frame)
-        return link->srcpad->request_frame(link);
-    else if (link->src->inputs[0])
-        return ff_request_frame(link->src->inputs[0]);
-    else return -1;
-}
-
-int ff_poll_frame(AVFilterLink *link)
-{
-    int i, min = INT_MAX;
-
-    if (link->srcpad->poll_frame)
-        return link->srcpad->poll_frame(link);
-
-    for (i = 0; i < link->src->nb_inputs; i++) {
-        int val;
-        if (!link->src->inputs[i])
-            return -1;
-        val = ff_poll_frame(link->src->inputs[i]);
-        min = FFMIN(min, val);
-    }
-
-    return min;
-}
-
-static AVFilter *first_filter;
-
-#if !FF_API_NOCONST_GET_NAME
-const
-#endif
-AVFilter *avfilter_get_by_name(const char *name)
-{
-    const AVFilter *f = NULL;
-
-    if (!name)
-        return NULL;
-
-    while ((f = avfilter_next(f)))
-        if (!strcmp(f->name, name))
-            return f;
-
-    return NULL;
-}
-
-int avfilter_register(AVFilter *filter)
-{
-    AVFilter **f = &first_filter;
-    while (*f)
-        f = &(*f)->next;
-    *f = filter;
-    filter->next = NULL;
-    return 0;
-}
-
-const AVFilter *avfilter_next(const AVFilter *prev)
-{
-    return prev ? prev->next : first_filter;
-}
-
-#if FF_API_OLD_FILTER_REGISTER
-AVFilter **av_filter_next(AVFilter **filter)
-{
-    return filter ? &(*filter)->next : &first_filter;
-}
-
-void avfilter_uninit(void)
-{
-}
-#endif
-
-int avfilter_pad_count(const AVFilterPad *pads)
-{
-    int count;
-
-    if (!pads)
-        return 0;
-
-    for (count = 0; pads->name; count++)
-        pads++;
-    return count;
-}
-
-static const char *filter_name(void *p)
-{
-    AVFilterContext *filter = p;
-    return filter->filter->name;
-}
-
-static void *filter_child_next(void *obj, void *prev)
-{
-    AVFilterContext *ctx = obj;
-    if (!prev && ctx->filter && ctx->filter->priv_class && ctx->priv)
-        return ctx->priv;
-    return NULL;
-}
-
-static const AVClass *filter_child_class_next(const AVClass *prev)
-{
-    const AVFilter *f = NULL;
-
-    while (prev && (f = avfilter_next(f)))
-        if (f->priv_class == prev)
-            break;
-
-    while ((f = avfilter_next(f)))
-        if (f->priv_class)
-            return f->priv_class;
-
-    return NULL;
-}
-
-#define OFFSET(x) offsetof(AVFilterContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption avfilter_options[] = {
-    { "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS,
-        { .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, FLAGS, "thread_type" },
-        { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .unit = "thread_type" },
-    { NULL },
-};
-
-static const AVClass avfilter_class = {
-    .class_name = "AVFilter",
-    .item_name  = filter_name,
-    .version    = LIBAVUTIL_VERSION_INT,
-    .child_next = filter_child_next,
-    .child_class_next = filter_child_class_next,
-    .option           = avfilter_options,
-};
-
-static int default_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg,
-                           int *ret, int nb_jobs)
-{
-    int i;
-
-    for (i = 0; i < nb_jobs; i++) {
-        int r = func(ctx, arg, i, nb_jobs);
-        if (ret)
-            ret[i] = r;
-    }
-    return 0;
-}
-
-AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name)
-{
-    AVFilterContext *ret;
-
-    if (!filter)
-        return NULL;
-
-    ret = av_mallocz(sizeof(AVFilterContext));
-    if (!ret)
-        return NULL;
-
-    ret->av_class = &avfilter_class;
-    ret->filter   = filter;
-    ret->name     = inst_name ? av_strdup(inst_name) : NULL;
-    if (filter->priv_size) {
-        ret->priv     = av_mallocz(filter->priv_size);
-        if (!ret->priv)
-            goto err;
-    }
-
-    av_opt_set_defaults(ret);
-    if (filter->priv_class) {
-        *(const AVClass**)ret->priv = filter->priv_class;
-        av_opt_set_defaults(ret->priv);
-    }
-
-    ret->internal = av_mallocz(sizeof(*ret->internal));
-    if (!ret->internal)
-        goto err;
-    ret->internal->execute = default_execute;
-
-    ret->nb_inputs = avfilter_pad_count(filter->inputs);
-    if (ret->nb_inputs ) {
-        ret->input_pads   = av_malloc(sizeof(AVFilterPad) * ret->nb_inputs);
-        if (!ret->input_pads)
-            goto err;
-        memcpy(ret->input_pads, filter->inputs, sizeof(AVFilterPad) * ret->nb_inputs);
-        ret->inputs       = av_mallocz(sizeof(AVFilterLink*) * ret->nb_inputs);
-        if (!ret->inputs)
-            goto err;
-    }
-
-    ret->nb_outputs = avfilter_pad_count(filter->outputs);
-    if (ret->nb_outputs) {
-        ret->output_pads  = av_malloc(sizeof(AVFilterPad) * ret->nb_outputs);
-        if (!ret->output_pads)
-            goto err;
-        memcpy(ret->output_pads, filter->outputs, sizeof(AVFilterPad) * ret->nb_outputs);
-        ret->outputs      = av_mallocz(sizeof(AVFilterLink*) * ret->nb_outputs);
-        if (!ret->outputs)
-            goto err;
-    }
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
-    ret->output_count = ret->nb_outputs;
-    ret->input_count  = ret->nb_inputs;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-    return ret;
-
-err:
-    av_freep(&ret->inputs);
-    av_freep(&ret->input_pads);
-    ret->nb_inputs = 0;
-    av_freep(&ret->outputs);
-    av_freep(&ret->output_pads);
-    ret->nb_outputs = 0;
-    av_freep(&ret->priv);
-    av_freep(&ret->internal);
-    av_free(ret);
-    return NULL;
-}
-
-#if FF_API_AVFILTER_OPEN
-int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name)
-{
-    *filter_ctx = ff_filter_alloc(filter, inst_name);
-    return *filter_ctx ? 0 : AVERROR(ENOMEM);
-}
-#endif
-
-static void free_link(AVFilterLink *link)
-{
-    if (!link)
-        return;
-
-    if (link->src)
-        link->src->outputs[link->srcpad - link->src->output_pads] = NULL;
-    if (link->dst)
-        link->dst->inputs[link->dstpad - link->dst->input_pads] = NULL;
-
-    ff_formats_unref(&link->in_formats);
-    ff_formats_unref(&link->out_formats);
-    ff_formats_unref(&link->in_samplerates);
-    ff_formats_unref(&link->out_samplerates);
-    ff_channel_layouts_unref(&link->in_channel_layouts);
-    ff_channel_layouts_unref(&link->out_channel_layouts);
-    av_freep(&link);
-}
-
-void avfilter_free(AVFilterContext *filter)
-{
-    int i;
-
-    if (filter->graph)
-        ff_filter_graph_remove_filter(filter->graph, filter);
-
-    if (filter->filter->uninit)
-        filter->filter->uninit(filter);
-
-    for (i = 0; i < filter->nb_inputs; i++) {
-        free_link(filter->inputs[i]);
-    }
-    for (i = 0; i < filter->nb_outputs; i++) {
-        free_link(filter->outputs[i]);
-    }
-
-    if (filter->filter->priv_class)
-        av_opt_free(filter->priv);
-
-    av_freep(&filter->name);
-    av_freep(&filter->input_pads);
-    av_freep(&filter->output_pads);
-    av_freep(&filter->inputs);
-    av_freep(&filter->outputs);
-    av_freep(&filter->priv);
-    av_freep(&filter->internal);
-    av_free(filter);
-}
-
-/* process a list of value1:value2:..., each value corresponding
- * to subsequent AVOption, in the order they are declared */
-static int process_unnamed_options(AVFilterContext *ctx, AVDictionary **options,
-                                   const char *args)
-{
-    const AVOption *o = NULL;
-    const char *p = args;
-    char *val;
-
-    while (*p) {
-        o = av_opt_next(ctx->priv, o);
-        if (!o) {
-            av_log(ctx, AV_LOG_ERROR, "More options provided than "
-                   "this filter supports.\n");
-            return AVERROR(EINVAL);
-        }
-        if (o->type == AV_OPT_TYPE_CONST)
-            continue;
-
-        val = av_get_token(&p, ":");
-        if (!val)
-            return AVERROR(ENOMEM);
-
-        av_dict_set(options, o->name, val, 0);
-
-        av_freep(&val);
-        if (*p)
-            p++;
-    }
-
-    return 0;
-}
-
-#if FF_API_AVFILTER_INIT_FILTER
-int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque)
-{
-    return avfilter_init_str(filter, args);
-}
-#endif
-
-int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
-{
-    int ret = 0;
-
-    ret = av_opt_set_dict(ctx, options);
-    if (ret < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Error applying generic filter options.\n");
-        return ret;
-    }
-
-    if (ctx->filter->flags & AVFILTER_FLAG_SLICE_THREADS &&
-        ctx->thread_type & ctx->graph->thread_type & AVFILTER_THREAD_SLICE &&
-        ctx->graph->internal->thread_execute) {
-        ctx->thread_type       = AVFILTER_THREAD_SLICE;
-        ctx->internal->execute = ctx->graph->internal->thread_execute;
-    } else {
-        ctx->thread_type = 0;
-    }
-
-    if (ctx->filter->priv_class) {
-        ret = av_opt_set_dict(ctx->priv, options);
-        if (ret < 0) {
-            av_log(ctx, AV_LOG_ERROR, "Error applying options to the filter.\n");
-            return ret;
-        }
-    }
-
-    if (ctx->filter->init)
-        ret = ctx->filter->init(ctx);
-    else if (ctx->filter->init_dict)
-        ret = ctx->filter->init_dict(ctx, options);
-
-    return ret;
-}
-
-int avfilter_init_str(AVFilterContext *filter, const char *args)
-{
-    AVDictionary *options = NULL;
-    AVDictionaryEntry *e;
-    int ret = 0;
-
-    if (args && *args) {
-        if (!filter->filter->priv_class) {
-            av_log(filter, AV_LOG_ERROR, "This filter does not take any "
-                   "options, but options were provided: %s.\n", args);
-            return AVERROR(EINVAL);
-        }
-
-#if FF_API_OLD_FILTER_OPTS
-        if (!strcmp(filter->filter->name, "scale") &&
-            strchr(args, ':') && strchr(args, ':') < strchr(args, '=')) {
-            /* old w:h:flags=<flags> syntax */
-            char *copy = av_strdup(args);
-            char *p;
-
-            av_log(filter, AV_LOG_WARNING, "The <w>:<h>:flags=<flags> option "
-                   "syntax is deprecated. Use either <w>:<h>:<flags> or "
-                   "w=<w>:h=<h>:flags=<flags>.\n");
-
-            if (!copy) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-
-            p = strrchr(copy, ':');
-            if (p) {
-                *p++ = 0;
-                ret = av_dict_parse_string(&options, p, "=", ":", 0);
-            }
-            if (ret >= 0)
-                ret = process_unnamed_options(filter, &options, copy);
-            av_freep(&copy);
-
-            if (ret < 0)
-                goto fail;
-        } else
-#endif
-
-        if (strchr(args, '=')) {
-            /* assume a list of key1=value1:key2=value2:... */
-            ret = av_dict_parse_string(&options, args, "=", ":", 0);
-            if (ret < 0)
-                goto fail;
-#if FF_API_OLD_FILTER_OPTS
-        } else if (!strcmp(filter->filter->name, "format")     ||
-                   !strcmp(filter->filter->name, "noformat")   ||
-                   !strcmp(filter->filter->name, "frei0r")     ||
-                   !strcmp(filter->filter->name, "frei0r_src") ||
-                   !strcmp(filter->filter->name, "ocv")) {
-            /* a hack for compatibility with the old syntax
-             * replace colons with |s */
-            char *copy = av_strdup(args);
-            char *p    = copy;
-            int nb_leading = 0; // number of leading colons to skip
-
-            if (!copy) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-
-            if (!strcmp(filter->filter->name, "frei0r") ||
-                !strcmp(filter->filter->name, "ocv"))
-                nb_leading = 1;
-            else if (!strcmp(filter->filter->name, "frei0r_src"))
-                nb_leading = 3;
-
-            while (nb_leading--) {
-                p = strchr(p, ':');
-                if (!p) {
-                    p = copy + strlen(copy);
-                    break;
-                }
-                p++;
-            }
-
-            if (strchr(p, ':')) {
-                av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
-                       "'|' to separate the list items.\n");
-            }
-
-            while ((p = strchr(p, ':')))
-                *p++ = '|';
-
-            ret = process_unnamed_options(filter, &options, copy);
-            av_freep(&copy);
-
-            if (ret < 0)
-                goto fail;
-#endif
-        } else {
-            ret = process_unnamed_options(filter, &options, args);
-            if (ret < 0)
-                goto fail;
-        }
-    }
-
-    ret = avfilter_init_dict(filter, &options);
-    if (ret < 0)
-        goto fail;
-
-    if ((e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
-        av_log(filter, AV_LOG_ERROR, "No such option: %s.\n", e->key);
-        ret = AVERROR_OPTION_NOT_FOUND;
-        goto fail;
-    }
-
-fail:
-    av_dict_free(&options);
-
-    return ret;
-}
-
-const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx)
-{
-    return pads[pad_idx].name;
-}
-
-enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx)
-{
-    return pads[pad_idx].type;
-}
-
-static int default_filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    return ff_filter_frame(link->dst->outputs[0], frame);
-}
-
-int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    int (*filter_frame)(AVFilterLink *, AVFrame *);
-    AVFilterPad *dst = link->dstpad;
-    AVFrame *out = NULL;
-    int ret;
-
-    FF_DPRINTF_START(NULL, filter_frame);
-    ff_dlog_link(NULL, link, 1);
-
-    if (!(filter_frame = dst->filter_frame))
-        filter_frame = default_filter_frame;
-
-    /* copy the frame if needed */
-    if (dst->needs_writable && !av_frame_is_writable(frame)) {
-        av_log(link->dst, AV_LOG_DEBUG, "Copying data in avfilter.\n");
-
-        switch (link->type) {
-        case AVMEDIA_TYPE_VIDEO:
-            out = ff_get_video_buffer(link, link->w, link->h);
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            out = ff_get_audio_buffer(link, frame->nb_samples);
-            break;
-        default:
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-        if (!out) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        ret = av_frame_copy_props(out, frame);
-        if (ret < 0)
-            goto fail;
-
-        switch (link->type) {
-        case AVMEDIA_TYPE_VIDEO:
-            av_image_copy(out->data, out->linesize, frame->data, frame->linesize,
-                          frame->format, frame->width, frame->height);
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            av_samples_copy(out->extended_data, frame->extended_data,
-                            0, 0, frame->nb_samples,
-                            av_get_channel_layout_nb_channels(frame->channel_layout),
-                            frame->format);
-            break;
-        default:
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-
-        av_frame_free(&frame);
-    } else
-        out = frame;
-
-    return filter_frame(link, out);
-
-fail:
-    av_frame_free(&out);
-    av_frame_free(&frame);
-    return ret;
-}
-
-const AVClass *avfilter_get_class(void)
-{
-    return &avfilter_class;
-}
diff --git a/deps/libav/libavfilter/avfilter.h b/deps/libav/libavfilter/avfilter.h
deleted file mode 100644
index 1b42086..0000000
--- a/deps/libav/libavfilter/avfilter.h
+++ /dev/null
@@ -1,1169 +0,0 @@
-/*
- * filter layer
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_AVFILTER_H
-#define AVFILTER_AVFILTER_H
-
-/**
- * @file
- * @ingroup lavfi
- * Main libavfilter public API header
- */
-
-/**
- * @defgroup lavfi Libavfilter - graph-based frame editing library
- * @{
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/avutil.h"
-#include "libavutil/frame.h"
-#include "libavutil/log.h"
-#include "libavutil/samplefmt.h"
-#include "libavutil/pixfmt.h"
-#include "libavutil/rational.h"
-#include "libavcodec/avcodec.h"
-
-#include <stddef.h>
-
-#include "libavfilter/version.h"
-
-/**
- * Return the LIBAVFILTER_VERSION_INT constant.
- */
-unsigned avfilter_version(void);
-
-/**
- * Return the libavfilter build-time configuration.
- */
-const char *avfilter_configuration(void);
-
-/**
- * Return the libavfilter license.
- */
-const char *avfilter_license(void);
-
-
-typedef struct AVFilterContext AVFilterContext;
-typedef struct AVFilterLink    AVFilterLink;
-typedef struct AVFilterPad     AVFilterPad;
-typedef struct AVFilterFormats AVFilterFormats;
-
-#if FF_API_AVFILTERBUFFER
-/**
- * A reference-counted buffer data type used by the filter system. Filters
- * should not store pointers to this structure directly, but instead use the
- * AVFilterBufferRef structure below.
- */
-typedef struct AVFilterBuffer {
-    uint8_t *data[8];           ///< buffer data for each plane/channel
-
-    /**
-     * pointers to the data planes/channels.
-     *
-     * For video, this should simply point to data[].
-     *
-     * For planar audio, each channel has a separate data pointer, and
-     * linesize[0] contains the size of each channel buffer.
-     * For packed audio, there is just one data pointer, and linesize[0]
-     * contains the total size of the buffer for all channels.
-     *
-     * Note: Both data and extended_data will always be set, but for planar
-     * audio with more channels that can fit in data, extended_data must be used
-     * in order to access all channels.
-     */
-    uint8_t **extended_data;
-    int linesize[8];            ///< number of bytes per line
-
-    /** private data to be used by a custom free function */
-    void *priv;
-    /**
-     * A pointer to the function to deallocate this buffer if the default
-     * function is not sufficient. This could, for example, add the memory
-     * back into a memory pool to be reused later without the overhead of
-     * reallocating it from scratch.
-     */
-    void (*free)(struct AVFilterBuffer *buf);
-
-    int format;                 ///< media format
-    int w, h;                   ///< width and height of the allocated buffer
-    unsigned refcount;          ///< number of references to this buffer
-} AVFilterBuffer;
-
-#define AV_PERM_READ     0x01   ///< can read from the buffer
-#define AV_PERM_WRITE    0x02   ///< can write to the buffer
-#define AV_PERM_PRESERVE 0x04   ///< nobody else can overwrite the buffer
-#define AV_PERM_REUSE    0x08   ///< can output the buffer multiple times, with the same contents each time
-#define AV_PERM_REUSE2   0x10   ///< can output the buffer multiple times, modified each time
-#define AV_PERM_NEG_LINESIZES 0x20  ///< the buffer requested can have negative linesizes
-
-/**
- * Audio specific properties in a reference to an AVFilterBuffer. Since
- * AVFilterBufferRef is common to different media formats, audio specific
- * per reference properties must be separated out.
- */
-typedef struct AVFilterBufferRefAudioProps {
-    uint64_t channel_layout;    ///< channel layout of audio buffer
-    int nb_samples;             ///< number of audio samples
-    int sample_rate;            ///< audio buffer sample rate
-    int planar;                 ///< audio buffer - planar or packed
-} AVFilterBufferRefAudioProps;
-
-/**
- * Video specific properties in a reference to an AVFilterBuffer. Since
- * AVFilterBufferRef is common to different media formats, video specific
- * per reference properties must be separated out.
- */
-typedef struct AVFilterBufferRefVideoProps {
-    int w;                      ///< image width
-    int h;                      ///< image height
-    AVRational pixel_aspect;    ///< pixel aspect ratio
-    int interlaced;             ///< is frame interlaced
-    int top_field_first;        ///< field order
-    enum AVPictureType pict_type; ///< picture type of the frame
-    int key_frame;              ///< 1 -> keyframe, 0-> not
-} AVFilterBufferRefVideoProps;
-
-/**
- * A reference to an AVFilterBuffer. Since filters can manipulate the origin of
- * a buffer to, for example, crop image without any memcpy, the buffer origin
- * and dimensions are per-reference properties. Linesize is also useful for
- * image flipping, frame to field filters, etc, and so is also per-reference.
- *
- * TODO: add anything necessary for frame reordering
- */
-typedef struct AVFilterBufferRef {
-    AVFilterBuffer *buf;        ///< the buffer that this is a reference to
-    uint8_t *data[8];           ///< picture/audio data for each plane
-    /**
-     * pointers to the data planes/channels.
-     *
-     * For video, this should simply point to data[].
-     *
-     * For planar audio, each channel has a separate data pointer, and
-     * linesize[0] contains the size of each channel buffer.
-     * For packed audio, there is just one data pointer, and linesize[0]
-     * contains the total size of the buffer for all channels.
-     *
-     * Note: Both data and extended_data will always be set, but for planar
-     * audio with more channels that can fit in data, extended_data must be used
-     * in order to access all channels.
-     */
-    uint8_t **extended_data;
-    int linesize[8];            ///< number of bytes per line
-
-    AVFilterBufferRefVideoProps *video; ///< video buffer specific properties
-    AVFilterBufferRefAudioProps *audio; ///< audio buffer specific properties
-
-    /**
-     * presentation timestamp. The time unit may change during
-     * filtering, as it is specified in the link and the filter code
-     * may need to rescale the PTS accordingly.
-     */
-    int64_t pts;
-    int64_t pos;                ///< byte position in stream, -1 if unknown
-
-    int format;                 ///< media format
-
-    int perms;                  ///< permissions, see the AV_PERM_* flags
-
-    enum AVMediaType type;      ///< media type of buffer data
-} AVFilterBufferRef;
-
-/**
- * Copy properties of src to dst, without copying the actual data
- */
-attribute_deprecated
-void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src);
-
-/**
- * Add a new reference to a buffer.
- *
- * @param ref   an existing reference to the buffer
- * @param pmask a bitmask containing the allowable permissions in the new
- *              reference
- * @return      a new reference to the buffer with the same properties as the
- *              old, excluding any permissions denied by pmask
- */
-attribute_deprecated
-AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask);
-
-/**
- * Remove a reference to a buffer. If this is the last reference to the
- * buffer, the buffer itself is also automatically freed.
- *
- * @param ref reference to the buffer, may be NULL
- *
- * @note it is recommended to use avfilter_unref_bufferp() instead of this
- * function
- */
-attribute_deprecated
-void avfilter_unref_buffer(AVFilterBufferRef *ref);
-
-/**
- * Remove a reference to a buffer and set the pointer to NULL.
- * If this is the last reference to the buffer, the buffer itself
- * is also automatically freed.
- *
- * @param ref pointer to the buffer reference
- */
-attribute_deprecated
-void avfilter_unref_bufferp(AVFilterBufferRef **ref);
-#endif
-
-#if FF_API_AVFILTERPAD_PUBLIC
-/**
- * A filter pad used for either input or output.
- *
- * @warning this struct will be removed from public API.
- * users should call avfilter_pad_get_name() and avfilter_pad_get_type()
- * to access the name and type fields; there should be no need to access
- * any other fields from outside of libavfilter.
- */
-struct AVFilterPad {
-    /**
-     * Pad name. The name is unique among inputs and among outputs, but an
-     * input may have the same name as an output. This may be NULL if this
-     * pad has no need to ever be referenced by name.
-     */
-    const char *name;
-
-    /**
-     * AVFilterPad type.
-     */
-    enum AVMediaType type;
-
-    /**
-     * Minimum required permissions on incoming buffers. Any buffer with
-     * insufficient permissions will be automatically copied by the filter
-     * system to a new buffer which provides the needed access permissions.
-     *
-     * Input pads only.
-     */
-    attribute_deprecated int min_perms;
-
-    /**
-     * Permissions which are not accepted on incoming buffers. Any buffer
-     * which has any of these permissions set will be automatically copied
-     * by the filter system to a new buffer which does not have those
-     * permissions. This can be used to easily disallow buffers with
-     * AV_PERM_REUSE.
-     *
-     * Input pads only.
-     */
-    attribute_deprecated int rej_perms;
-
-    /**
-     * @deprecated unused
-     */
-    int (*start_frame)(AVFilterLink *link, AVFilterBufferRef *picref);
-
-    /**
-     * Callback function to get a video buffer. If NULL, the filter system will
-     * use avfilter_default_get_video_buffer().
-     *
-     * Input video pads only.
-     */
-    AVFrame *(*get_video_buffer)(AVFilterLink *link, int w, int h);
-
-    /**
-     * Callback function to get an audio buffer. If NULL, the filter system will
-     * use avfilter_default_get_audio_buffer().
-     *
-     * Input audio pads only.
-     */
-    AVFrame *(*get_audio_buffer)(AVFilterLink *link, int nb_samples);
-
-    /**
-     * @deprecated unused
-     */
-    int (*end_frame)(AVFilterLink *link);
-
-    /**
-     * @deprecated unused
-     */
-    int (*draw_slice)(AVFilterLink *link, int y, int height, int slice_dir);
-
-    /**
-     * Filtering callback. This is where a filter receives a frame with
-     * audio/video data and should do its processing.
-     *
-     * Input pads only.
-     *
-     * @return >= 0 on success, a negative AVERROR on error. This function
-     * must ensure that samplesref is properly unreferenced on error if it
-     * hasn't been passed on to another filter.
-     */
-    int (*filter_frame)(AVFilterLink *link, AVFrame *frame);
-
-    /**
-     * Frame poll callback. This returns the number of immediately available
-     * samples. It should return a positive value if the next request_frame()
-     * is guaranteed to return one frame (with no delay).
-     *
-     * Defaults to just calling the source poll_frame() method.
-     *
-     * Output pads only.
-     */
-    int (*poll_frame)(AVFilterLink *link);
-
-    /**
-     * Frame request callback. A call to this should result in at least one
-     * frame being output over the given link. This should return zero on
-     * success, and another value on error.
-     *
-     * Output pads only.
-     */
-    int (*request_frame)(AVFilterLink *link);
-
-    /**
-     * Link configuration callback.
-     *
-     * For output pads, this should set the link properties such as
-     * width/height. This should NOT set the format property - that is
-     * negotiated between filters by the filter system using the
-     * query_formats() callback before this function is called.
-     *
-     * For input pads, this should check the properties of the link, and update
-     * the filter's internal state as necessary.
-     *
-     * For both input and output filters, this should return zero on success,
-     * and another value on error.
-     */
-    int (*config_props)(AVFilterLink *link);
-
-    /**
-     * The filter expects a fifo to be inserted on its input link,
-     * typically because it has a delay.
-     *
-     * input pads only.
-     */
-    int needs_fifo;
-
-    /**
-     * The filter expects writable frames from its input link,
-     * duplicating data buffers if needed.
-     *
-     * input pads only.
-     */
-    int needs_writable;
-};
-#endif
-
-/**
- * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g.
- * AVFilter.inputs/outputs).
- */
-int avfilter_pad_count(const AVFilterPad *pads);
-
-/**
- * Get the name of an AVFilterPad.
- *
- * @param pads an array of AVFilterPads
- * @param pad_idx index of the pad in the array it; is the caller's
- *                responsibility to ensure the index is valid
- *
- * @return name of the pad_idx'th pad in pads
- */
-const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx);
-
-/**
- * Get the type of an AVFilterPad.
- *
- * @param pads an array of AVFilterPads
- * @param pad_idx index of the pad in the array; it is the caller's
- *                responsibility to ensure the index is valid
- *
- * @return type of the pad_idx'th pad in pads
- */
-enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx);
-
-/**
- * The number of the filter inputs is not determined just by AVFilter.inputs.
- * The filter might add additional inputs during initialization depending on the
- * options supplied to it.
- */
-#define AVFILTER_FLAG_DYNAMIC_INPUTS        (1 << 0)
-/**
- * The number of the filter outputs is not determined just by AVFilter.outputs.
- * The filter might add additional outputs during initialization depending on
- * the options supplied to it.
- */
-#define AVFILTER_FLAG_DYNAMIC_OUTPUTS       (1 << 1)
-/**
- * The filter supports multithreading by splitting frames into multiple parts
- * and processing them concurrently.
- */
-#define AVFILTER_FLAG_SLICE_THREADS         (1 << 2)
-
-/**
- * Filter definition. This defines the pads a filter contains, and all the
- * callback functions used to interact with the filter.
- */
-typedef struct AVFilter {
-    /**
-     * Filter name. Must be non-NULL and unique among filters.
-     */
-    const char *name;
-
-    /**
-     * A description of the filter. May be NULL.
-     *
-     * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
-     */
-    const char *description;
-
-    /**
-     * List of inputs, terminated by a zeroed element.
-     *
-     * NULL if there are no (static) inputs. Instances of filters with
-     * AVFILTER_FLAG_DYNAMIC_INPUTS set may have more inputs than present in
-     * this list.
-     */
-    const AVFilterPad *inputs;
-    /**
-     * List of outputs, terminated by a zeroed element.
-     *
-     * NULL if there are no (static) outputs. Instances of filters with
-     * AVFILTER_FLAG_DYNAMIC_OUTPUTS set may have more outputs than present in
-     * this list.
-     */
-    const AVFilterPad *outputs;
-
-    /**
-     * A class for the private data, used to declare filter private AVOptions.
-     * This field is NULL for filters that do not declare any options.
-     *
-     * If this field is non-NULL, the first member of the filter private data
-     * must be a pointer to AVClass, which will be set by libavfilter generic
-     * code to this class.
-     */
-    const AVClass *priv_class;
-
-    /**
-     * A combination of AVFILTER_FLAG_*
-     */
-    int flags;
-
-    /*****************************************************************
-     * All fields below this line are not part of the public API. They
-     * may not be used outside of libavfilter and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-
-    /**
-     * Filter initialization function.
-     *
-     * This callback will be called only once during the filter lifetime, after
-     * all the options have been set, but before links between filters are
-     * established and format negotiation is done.
-     *
-     * Basic filter initialization should be done here. Filters with dynamic
-     * inputs and/or outputs should create those inputs/outputs here based on
-     * provided options. No more changes to this filter's inputs/outputs can be
-     * done after this callback.
-     *
-     * This callback must not assume that the filter links exist or frame
-     * parameters are known.
-     *
-     * @ref AVFilter.uninit "uninit" is guaranteed to be called even if
-     * initialization fails, so this callback does not have to clean up on
-     * failure.
-     *
-     * @return 0 on success, a negative AVERROR on failure
-     */
-    int (*init)(AVFilterContext *ctx);
-
-    /**
-     * Should be set instead of @ref AVFilter.init "init" by the filters that
-     * want to pass a dictionary of AVOptions to nested contexts that are
-     * allocated during init.
-     *
-     * On return, the options dict should be freed and replaced with one that
-     * contains all the options which could not be processed by this filter (or
-     * with NULL if all the options were processed).
-     *
-     * Otherwise the semantics is the same as for @ref AVFilter.init "init".
-     */
-    int (*init_dict)(AVFilterContext *ctx, AVDictionary **options);
-
-    /**
-     * Filter uninitialization function.
-     *
-     * Called only once right before the filter is freed. Should deallocate any
-     * memory held by the filter, release any buffer references, etc. It does
-     * not need to deallocate the AVFilterContext.priv memory itself.
-     *
-     * This callback may be called even if @ref AVFilter.init "init" was not
-     * called or failed, so it must be prepared to handle such a situation.
-     */
-    void (*uninit)(AVFilterContext *ctx);
-
-    /**
-     * Query formats supported by the filter on its inputs and outputs.
-     *
-     * This callback is called after the filter is initialized (so the inputs
-     * and outputs are fixed), shortly before the format negotiation. This
-     * callback may be called more than once.
-     *
-     * This callback must set AVFilterLink.out_formats on every input link and
-     * AVFilterLink.in_formats on every output link to a list of pixel/sample
-     * formats that the filter supports on that link. For audio links, this
-     * filter must also set @ref AVFilterLink.in_samplerates "in_samplerates" /
-     * @ref AVFilterLink.out_samplerates "out_samplerates" and
-     * @ref AVFilterLink.in_channel_layouts "in_channel_layouts" /
-     * @ref AVFilterLink.out_channel_layouts "out_channel_layouts" analogously.
-     *
-     * This callback may be NULL for filters with one input, in which case
-     * libavfilter assumes that it supports all input formats and preserves
-     * them on output.
-     *
-     * @return zero on success, a negative value corresponding to an
-     * AVERROR code otherwise
-     */
-    int (*query_formats)(AVFilterContext *);
-
-    int priv_size;      ///< size of private data to allocate for the filter
-
-    /**
-     * Used by the filter registration system. Must not be touched by any other
-     * code.
-     */
-    struct AVFilter *next;
-} AVFilter;
-
-/**
- * Process multiple parts of the frame concurrently.
- */
-#define AVFILTER_THREAD_SLICE (1 << 0)
-
-typedef struct AVFilterInternal AVFilterInternal;
-
-/** An instance of a filter */
-struct AVFilterContext {
-    const AVClass *av_class;              ///< needed for av_log()
-
-    const AVFilter *filter;         ///< the AVFilter of which this is an instance
-
-    char *name;                     ///< name of this filter instance
-
-    AVFilterPad   *input_pads;      ///< array of input pads
-    AVFilterLink **inputs;          ///< array of pointers to input links
-#if FF_API_FOO_COUNT
-    attribute_deprecated unsigned input_count; ///< @deprecated use nb_inputs
-#endif
-    unsigned    nb_inputs;          ///< number of input pads
-
-    AVFilterPad   *output_pads;     ///< array of output pads
-    AVFilterLink **outputs;         ///< array of pointers to output links
-#if FF_API_FOO_COUNT
-    attribute_deprecated unsigned output_count; ///< @deprecated use nb_outputs
-#endif
-    unsigned    nb_outputs;         ///< number of output pads
-
-    void *priv;                     ///< private data for use by the filter
-
-    struct AVFilterGraph *graph;    ///< filtergraph this filter belongs to
-
-    /**
-     * Type of multithreading being allowed/used. A combination of
-     * AVFILTER_THREAD_* flags.
-     *
-     * May be set by the caller before initializing the filter to forbid some
-     * or all kinds of multithreading for this filter. The default is allowing
-     * everything.
-     *
-     * When the filter is initialized, this field is combined using bit AND with
-     * AVFilterGraph.thread_type to get the final mask used for determining
-     * allowed threading types. I.e. a threading type needs to be set in both
-     * to be allowed.
-     *
-     * After the filter is initialzed, libavfilter sets this field to the
-     * threading type that is actually used (0 for no multithreading).
-     */
-    int thread_type;
-
-    /**
-     * An opaque struct for libavfilter internal use.
-     */
-    AVFilterInternal *internal;
-};
-
-/**
- * A link between two filters. This contains pointers to the source and
- * destination filters between which this link exists, and the indexes of
- * the pads involved. In addition, this link also contains the parameters
- * which have been negotiated and agreed upon between the filter, such as
- * image dimensions, format, etc.
- */
-struct AVFilterLink {
-    AVFilterContext *src;       ///< source filter
-    AVFilterPad *srcpad;        ///< output pad on the source filter
-
-    AVFilterContext *dst;       ///< dest filter
-    AVFilterPad *dstpad;        ///< input pad on the dest filter
-
-    enum AVMediaType type;      ///< filter media type
-
-    /* These parameters apply only to video */
-    int w;                      ///< agreed upon image width
-    int h;                      ///< agreed upon image height
-    AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio
-    /* These two parameters apply only to audio */
-    uint64_t channel_layout;    ///< channel layout of current buffer (see libavutil/channel_layout.h)
-    int sample_rate;            ///< samples per second
-
-    int format;                 ///< agreed upon media format
-
-    /**
-     * Define the time base used by the PTS of the frames/samples
-     * which will pass through this link.
-     * During the configuration stage, each filter is supposed to
-     * change only the output timebase, while the timebase of the
-     * input link is assumed to be an unchangeable property.
-     */
-    AVRational time_base;
-
-    /*****************************************************************
-     * All fields below this line are not part of the public API. They
-     * may not be used outside of libavfilter and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-    /**
-     * Lists of formats supported by the input and output filters respectively.
-     * These lists are used for negotiating the format to actually be used,
-     * which will be loaded into the format member, above, when chosen.
-     */
-    AVFilterFormats *in_formats;
-    AVFilterFormats *out_formats;
-
-    /**
-     * Lists of channel layouts and sample rates used for automatic
-     * negotiation.
-     */
-    AVFilterFormats  *in_samplerates;
-    AVFilterFormats *out_samplerates;
-    struct AVFilterChannelLayouts  *in_channel_layouts;
-    struct AVFilterChannelLayouts *out_channel_layouts;
-
-    /**
-     * Audio only, the destination filter sets this to a non-zero value to
-     * request that buffers with the given number of samples should be sent to
-     * it. AVFilterPad.needs_fifo must also be set on the corresponding input
-     * pad.
-     * Last buffer before EOF will be padded with silence.
-     */
-    int request_samples;
-
-    /** stage of the initialization of the link properties (dimensions, etc) */
-    enum {
-        AVLINK_UNINIT = 0,      ///< not started
-        AVLINK_STARTINIT,       ///< started, but incomplete
-        AVLINK_INIT             ///< complete
-    } init_state;
-};
-
-/**
- * Link two filters together.
- *
- * @param src    the source filter
- * @param srcpad index of the output pad on the source filter
- * @param dst    the destination filter
- * @param dstpad index of the input pad on the destination filter
- * @return       zero on success
- */
-int avfilter_link(AVFilterContext *src, unsigned srcpad,
-                  AVFilterContext *dst, unsigned dstpad);
-
-/**
- * Negotiate the media format, dimensions, etc of all inputs to a filter.
- *
- * @param filter the filter to negotiate the properties for its inputs
- * @return       zero on successful negotiation
- */
-int avfilter_config_links(AVFilterContext *filter);
-
-#if FF_API_AVFILTERBUFFER
-/**
- * Create a buffer reference wrapped around an already allocated image
- * buffer.
- *
- * @param data pointers to the planes of the image to reference
- * @param linesize linesizes for the planes of the image to reference
- * @param perms the required access permissions
- * @param w the width of the image specified by the data and linesize arrays
- * @param h the height of the image specified by the data and linesize arrays
- * @param format the pixel format of the image specified by the data and linesize arrays
- */
-attribute_deprecated
-AVFilterBufferRef *
-avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms,
-                                          int w, int h, enum AVPixelFormat format);
-
-/**
- * Create an audio buffer reference wrapped around an already
- * allocated samples buffer.
- *
- * @param data           pointers to the samples plane buffers
- * @param linesize       linesize for the samples plane buffers
- * @param perms          the required access permissions
- * @param nb_samples     number of samples per channel
- * @param sample_fmt     the format of each sample in the buffer to allocate
- * @param channel_layout the channel layout of the buffer
- */
-attribute_deprecated
-AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
-                                                             int linesize,
-                                                             int perms,
-                                                             int nb_samples,
-                                                             enum AVSampleFormat sample_fmt,
-                                                             uint64_t channel_layout);
-#endif
-
-/** Initialize the filter system. Register all builtin filters. */
-void avfilter_register_all(void);
-
-#if FF_API_OLD_FILTER_REGISTER
-/** Uninitialize the filter system. Unregister all filters. */
-attribute_deprecated
-void avfilter_uninit(void);
-#endif
-
-/**
- * Register a filter. This is only needed if you plan to use
- * avfilter_get_by_name later to lookup the AVFilter structure by name. A
- * filter can still by instantiated with avfilter_graph_alloc_filter even if it
- * is not registered.
- *
- * @param filter the filter to register
- * @return 0 if the registration was succesfull, a negative value
- * otherwise
- */
-int avfilter_register(AVFilter *filter);
-
-/**
- * Get a filter definition matching the given name.
- *
- * @param name the filter name to find
- * @return     the filter definition, if any matching one is registered.
- *             NULL if none found.
- */
-#if !FF_API_NOCONST_GET_NAME
-const
-#endif
-AVFilter *avfilter_get_by_name(const char *name);
-
-/**
- * Iterate over all registered filters.
- * @return If prev is non-NULL, next registered filter after prev or NULL if
- * prev is the last filter. If prev is NULL, return the first registered filter.
- */
-const AVFilter *avfilter_next(const AVFilter *prev);
-
-#if FF_API_OLD_FILTER_REGISTER
-/**
- * If filter is NULL, returns a pointer to the first registered filter pointer,
- * if filter is non-NULL, returns the next pointer after filter.
- * If the returned pointer points to NULL, the last registered filter
- * was already reached.
- * @deprecated use avfilter_next()
- */
-attribute_deprecated
-AVFilter **av_filter_next(AVFilter **filter);
-#endif
-
-#if FF_API_AVFILTER_OPEN
-/**
- * Create a filter instance.
- *
- * @param filter_ctx put here a pointer to the created filter context
- * on success, NULL on failure
- * @param filter    the filter to create an instance of
- * @param inst_name Name to give to the new instance. Can be NULL for none.
- * @return >= 0 in case of success, a negative error code otherwise
- * @deprecated use avfilter_graph_alloc_filter() instead
- */
-attribute_deprecated
-int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);
-#endif
-
-
-#if FF_API_AVFILTER_INIT_FILTER
-/**
- * Initialize a filter.
- *
- * @param filter the filter to initialize
- * @param args   A string of parameters to use when initializing the filter.
- *               The format and meaning of this string varies by filter.
- * @param opaque Any extra non-string data needed by the filter. The meaning
- *               of this parameter varies by filter.
- * @return       zero on success
- */
-attribute_deprecated
-int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque);
-#endif
-
-/**
- * Initialize a filter with the supplied parameters.
- *
- * @param ctx  uninitialized filter context to initialize
- * @param args Options to initialize the filter with. This must be a
- *             ':'-separated list of options in the 'key=value' form.
- *             May be NULL if the options have been set directly using the
- *             AVOptions API or there are no options that need to be set.
- * @return 0 on success, a negative AVERROR on failure
- */
-int avfilter_init_str(AVFilterContext *ctx, const char *args);
-
-/**
- * Initialize a filter with the supplied dictionary of options.
- *
- * @param ctx     uninitialized filter context to initialize
- * @param options An AVDictionary filled with options for this filter. On
- *                return this parameter will be destroyed and replaced with
- *                a dict containing options that were not found. This dictionary
- *                must be freed by the caller.
- *                May be NULL, then this function is equivalent to
- *                avfilter_init_str() with the second parameter set to NULL.
- * @return 0 on success, a negative AVERROR on failure
- *
- * @note This function and avfilter_init_str() do essentially the same thing,
- * the difference is in manner in which the options are passed. It is up to the
- * calling code to choose whichever is more preferable. The two functions also
- * behave differently when some of the provided options are not declared as
- * supported by the filter. In such a case, avfilter_init_str() will fail, but
- * this function will leave those extra options in the options AVDictionary and
- * continue as usual.
- */
-int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options);
-
-/**
- * Free a filter context. This will also remove the filter from its
- * filtergraph's list of filters.
- *
- * @param filter the filter to free
- */
-void avfilter_free(AVFilterContext *filter);
-
-/**
- * Insert a filter in the middle of an existing link.
- *
- * @param link the link into which the filter should be inserted
- * @param filt the filter to be inserted
- * @param filt_srcpad_idx the input pad on the filter to connect
- * @param filt_dstpad_idx the output pad on the filter to connect
- * @return     zero on success
- */
-int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
-                           unsigned filt_srcpad_idx, unsigned filt_dstpad_idx);
-
-#if FF_API_AVFILTERBUFFER
-/**
- * Copy the frame properties of src to dst, without copying the actual
- * image data.
- *
- * @return 0 on success, a negative number on error.
- */
-attribute_deprecated
-int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
-
-/**
- * Copy the frame properties and data pointers of src to dst, without copying
- * the actual data.
- *
- * @return 0 on success, a negative number on error.
- */
-attribute_deprecated
-int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src);
-#endif
-
-/**
- * @return AVClass for AVFilterContext.
- *
- * @see av_opt_find().
- */
-const AVClass *avfilter_get_class(void);
-
-typedef struct AVFilterGraphInternal AVFilterGraphInternal;
-
-/**
- * A function pointer passed to the @ref AVFilterGraph.execute callback to be
- * executed multiple times, possibly in parallel.
- *
- * @param ctx the filter context the job belongs to
- * @param arg an opaque parameter passed through from @ref
- *            AVFilterGraph.execute
- * @param jobnr the index of the job being executed
- * @param nb_jobs the total number of jobs
- *
- * @return 0 on success, a negative AVERROR on error
- */
-typedef int (avfilter_action_func)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
-
-/**
- * A function executing multiple jobs, possibly in parallel.
- *
- * @param ctx the filter context to which the jobs belong
- * @param func the function to be called multiple times
- * @param arg the argument to be passed to func
- * @param ret a nb_jobs-sized array to be filled with return values from each
- *            invocation of func
- * @param nb_jobs the number of jobs to execute
- *
- * @return 0 on success, a negative AVERROR on error
- */
-typedef int (avfilter_execute_func)(AVFilterContext *ctx, avfilter_action_func *func,
-                                    void *arg, int *ret, int nb_jobs);
-
-typedef struct AVFilterGraph {
-    const AVClass *av_class;
-#if FF_API_FOO_COUNT
-    attribute_deprecated
-    unsigned filter_count;
-#endif
-    AVFilterContext **filters;
-#if !FF_API_FOO_COUNT
-    unsigned nb_filters;
-#endif
-
-    char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters
-    char *resample_lavr_opts;   ///< libavresample options to use for the auto-inserted resample filters
-#if FF_API_FOO_COUNT
-    unsigned nb_filters;
-#endif
-
-    /**
-     * Type of multithreading allowed for filters in this graph. A combination
-     * of AVFILTER_THREAD_* flags.
-     *
-     * May be set by the caller at any point, the setting will apply to all
-     * filters initialized after that. The default is allowing everything.
-     *
-     * When a filter in this graph is initialized, this field is combined using
-     * bit AND with AVFilterContext.thread_type to get the final mask used for
-     * determining allowed threading types. I.e. a threading type needs to be
-     * set in both to be allowed.
-     */
-    int thread_type;
-
-    /**
-     * Maximum number of threads used by filters in this graph. May be set by
-     * the caller before adding any filters to the filtergraph. Zero (the
-     * default) means that the number of threads is determined automatically.
-     */
-    int nb_threads;
-
-    /**
-     * Opaque object for libavfilter internal use.
-     */
-    AVFilterGraphInternal *internal;
-
-    /**
-     * Opaque user data. May be set by the caller to an arbitrary value, e.g. to
-     * be used from callbacks like @ref AVFilterGraph.execute.
-     * Libavfilter will not touch this field in any way.
-     */
-    void *opaque;
-
-    /**
-     * This callback may be set by the caller immediately after allocating the
-     * graph and before adding any filters to it, to provide a custom
-     * multithreading implementation.
-     *
-     * If set, filters with slice threading capability will call this callback
-     * to execute multiple jobs in parallel.
-     *
-     * If this field is left unset, libavfilter will use its internal
-     * implementation, which may or may not be multithreaded depending on the
-     * platform and build options.
-     */
-    avfilter_execute_func *execute;
-} AVFilterGraph;
-
-/**
- * Allocate a filter graph.
- */
-AVFilterGraph *avfilter_graph_alloc(void);
-
-/**
- * Create a new filter instance in a filter graph.
- *
- * @param graph graph in which the new filter will be used
- * @param filter the filter to create an instance of
- * @param name Name to give to the new instance (will be copied to
- *             AVFilterContext.name). This may be used by the caller to identify
- *             different filters, libavfilter itself assigns no semantics to
- *             this parameter. May be NULL.
- *
- * @return the context of the newly created filter instance (note that it is
- *         also retrievable directly through AVFilterGraph.filters or with
- *         avfilter_graph_get_filter()) on success or NULL or failure.
- */
-AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
-                                             const AVFilter *filter,
-                                             const char *name);
-
-/**
- * Get a filter instance with name name from graph.
- *
- * @return the pointer to the found filter instance or NULL if it
- * cannot be found.
- */
-AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name);
-
-#if FF_API_AVFILTER_OPEN
-/**
- * Add an existing filter instance to a filter graph.
- *
- * @param graphctx  the filter graph
- * @param filter the filter to be added
- *
- * @deprecated use avfilter_graph_alloc_filter() to allocate a filter in a
- * filter graph
- */
-attribute_deprecated
-int avfilter_graph_add_filter(AVFilterGraph *graphctx, AVFilterContext *filter);
-#endif
-
-/**
- * Create and add a filter instance into an existing graph.
- * The filter instance is created from the filter filt and inited
- * with the parameters args and opaque.
- *
- * In case of success put in *filt_ctx the pointer to the created
- * filter instance, otherwise set *filt_ctx to NULL.
- *
- * @param name the instance name to give to the created filter instance
- * @param graph_ctx the filter graph
- * @return a negative AVERROR error code in case of failure, a non
- * negative value otherwise
- */
-int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt,
-                                 const char *name, const char *args, void *opaque,
-                                 AVFilterGraph *graph_ctx);
-
-/**
- * Check validity and configure all the links and formats in the graph.
- *
- * @param graphctx the filter graph
- * @param log_ctx context used for logging
- * @return 0 in case of success, a negative AVERROR code otherwise
- */
-int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx);
-
-/**
- * Free a graph, destroy its links, and set *graph to NULL.
- * If *graph is NULL, do nothing.
- */
-void avfilter_graph_free(AVFilterGraph **graph);
-
-/**
- * A linked-list of the inputs/outputs of the filter chain.
- *
- * This is mainly useful for avfilter_graph_parse() / avfilter_graph_parse2(),
- * where it is used to communicate open (unlinked) inputs and outputs from and
- * to the caller.
- * This struct specifies, per each not connected pad contained in the graph, the
- * filter context and the pad index required for establishing a link.
- */
-typedef struct AVFilterInOut {
-    /** unique name for this input/output in the list */
-    char *name;
-
-    /** filter context associated to this input/output */
-    AVFilterContext *filter_ctx;
-
-    /** index of the filt_ctx pad to use for linking */
-    int pad_idx;
-
-    /** next input/input in the list, NULL if this is the last */
-    struct AVFilterInOut *next;
-} AVFilterInOut;
-
-/**
- * Allocate a single AVFilterInOut entry.
- * Must be freed with avfilter_inout_free().
- * @return allocated AVFilterInOut on success, NULL on failure.
- */
-AVFilterInOut *avfilter_inout_alloc(void);
-
-/**
- * Free the supplied list of AVFilterInOut and set *inout to NULL.
- * If *inout is NULL, do nothing.
- */
-void avfilter_inout_free(AVFilterInOut **inout);
-
-/**
- * Add a graph described by a string to a graph.
- *
- * @param graph   the filter graph where to link the parsed graph context
- * @param filters string to be parsed
- * @param inputs  linked list to the inputs of the graph
- * @param outputs linked list to the outputs of the graph
- * @return zero on success, a negative AVERROR code on error
- */
-int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
-                         AVFilterInOut *inputs, AVFilterInOut *outputs,
-                         void *log_ctx);
-
-/**
- * Add a graph described by a string to a graph.
- *
- * @param[in]  graph   the filter graph where to link the parsed graph context
- * @param[in]  filters string to be parsed
- * @param[out] inputs  a linked list of all free (unlinked) inputs of the
- *                     parsed graph will be returned here. It is to be freed
- *                     by the caller using avfilter_inout_free().
- * @param[out] outputs a linked list of all free (unlinked) outputs of the
- *                     parsed graph will be returned here. It is to be freed by the
- *                     caller using avfilter_inout_free().
- * @return zero on success, a negative AVERROR code on error
- *
- * @note the difference between avfilter_graph_parse2() and
- * avfilter_graph_parse() is that in avfilter_graph_parse(), the caller provides
- * the lists of inputs and outputs, which therefore must be known before calling
- * the function. On the other hand, avfilter_graph_parse2() \em returns the
- * inputs and outputs that are left unlinked after parsing the graph and the
- * caller then deals with them. Another difference is that in
- * avfilter_graph_parse(), the inputs parameter describes inputs of the
- * <em>already existing</em> part of the graph; i.e. from the point of view of
- * the newly created part, they are outputs. Similarly the outputs parameter
- * describes outputs of the already existing filters, which are provided as
- * inputs to the parsed filters.
- * avfilter_graph_parse2() takes the opposite approach -- it makes no reference
- * whatsoever to already existing parts of the graph and the inputs parameter
- * will on return contain inputs of the newly parsed part of the graph.
- * Analogously the outputs parameter will contain outputs of the newly created
- * filters.
- */
-int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
-                          AVFilterInOut **inputs,
-                          AVFilterInOut **outputs);
-
-/**
- * @}
- */
-
-#endif /* AVFILTER_AVFILTER_H */
diff --git a/deps/libav/libavfilter/avfiltergraph.c b/deps/libav/libavfilter/avfiltergraph.c
deleted file mode 100644
index 0fc385c..0000000
--- a/deps/libav/libavfilter/avfiltergraph.c
+++ /dev/null
@@ -1,825 +0,0 @@
-/*
- * filter graphs
- * Copyright (c) 2008 Vitor Sessak
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include <string.h>
-
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "thread.h"
-
-#define OFFSET(x) offsetof(AVFilterGraph, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption filtergraph_options[] = {
-    { "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS,
-        { .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, FLAGS, "thread_type" },
-        { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .flags = FLAGS, .unit = "thread_type" },
-    { "threads",     "Maximum number of threads", OFFSET(nb_threads),
-        AV_OPT_TYPE_INT,   { .i64 = 0 }, 0, INT_MAX, FLAGS },
-    { NULL },
-};
-
-static const AVClass filtergraph_class = {
-    .class_name = "AVFilterGraph",
-    .item_name  = av_default_item_name,
-    .version    = LIBAVUTIL_VERSION_INT,
-    .option     = filtergraph_options,
-};
-
-#if !HAVE_THREADS
-void ff_graph_thread_free(AVFilterGraph *graph)
-{
-}
-
-int ff_graph_thread_init(AVFilterGraph *graph)
-{
-    graph->thread_type = 0;
-    graph->nb_threads  = 1;
-    return 0;
-}
-#endif
-
-AVFilterGraph *avfilter_graph_alloc(void)
-{
-    AVFilterGraph *ret = av_mallocz(sizeof(*ret));
-    if (!ret)
-        return NULL;
-
-    ret->internal = av_mallocz(sizeof(*ret->internal));
-    if (!ret->internal) {
-        av_freep(&ret);
-        return NULL;
-    }
-
-    ret->av_class = &filtergraph_class;
-    av_opt_set_defaults(ret);
-
-    return ret;
-}
-
-void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter)
-{
-    int i;
-    for (i = 0; i < graph->nb_filters; i++) {
-        if (graph->filters[i] == filter) {
-            FFSWAP(AVFilterContext*, graph->filters[i],
-                   graph->filters[graph->nb_filters - 1]);
-            graph->nb_filters--;
-            return;
-        }
-    }
-}
-
-void avfilter_graph_free(AVFilterGraph **graph)
-{
-    if (!*graph)
-        return;
-
-    while ((*graph)->nb_filters)
-        avfilter_free((*graph)->filters[0]);
-
-    ff_graph_thread_free(*graph);
-
-    av_freep(&(*graph)->scale_sws_opts);
-    av_freep(&(*graph)->resample_lavr_opts);
-    av_freep(&(*graph)->filters);
-    av_freep(&(*graph)->internal);
-    av_freep(graph);
-}
-
-#if FF_API_AVFILTER_OPEN
-int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
-{
-    AVFilterContext **filters = av_realloc(graph->filters,
-                                           sizeof(*filters) * (graph->nb_filters + 1));
-    if (!filters)
-        return AVERROR(ENOMEM);
-
-    graph->filters = filters;
-    graph->filters[graph->nb_filters++] = filter;
-
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
-    graph->filter_count = graph->nb_filters;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-    filter->graph = graph;
-
-    return 0;
-}
-#endif
-
-int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt,
-                                 const char *name, const char *args, void *opaque,
-                                 AVFilterGraph *graph_ctx)
-{
-    int ret;
-
-    *filt_ctx = avfilter_graph_alloc_filter(graph_ctx, filt, name);
-    if (!*filt_ctx)
-        return AVERROR(ENOMEM);
-
-    ret = avfilter_init_str(*filt_ctx, args);
-    if (ret < 0)
-        goto fail;
-
-    return 0;
-
-fail:
-    if (*filt_ctx)
-        avfilter_free(*filt_ctx);
-    *filt_ctx = NULL;
-    return ret;
-}
-
-AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
-                                             const AVFilter *filter,
-                                             const char *name)
-{
-    AVFilterContext **filters, *s;
-
-    if (graph->thread_type && !graph->internal->thread_execute) {
-        if (graph->execute) {
-            graph->internal->thread_execute = graph->execute;
-        } else {
-            int ret = ff_graph_thread_init(graph);
-            if (ret < 0) {
-                av_log(graph, AV_LOG_ERROR, "Error initializing threading.\n");
-                return NULL;
-            }
-        }
-    }
-
-    s = ff_filter_alloc(filter, name);
-    if (!s)
-        return NULL;
-
-    filters = av_realloc(graph->filters, sizeof(*filters) * (graph->nb_filters + 1));
-    if (!filters) {
-        avfilter_free(s);
-        return NULL;
-    }
-
-    graph->filters = filters;
-    graph->filters[graph->nb_filters++] = s;
-
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
-    graph->filter_count = graph->nb_filters;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-    s->graph = graph;
-
-    return s;
-}
-
-/**
- * Check for the validity of graph.
- *
- * A graph is considered valid if all its input and output pads are
- * connected.
- *
- * @return 0 in case of success, a negative value otherwise
- */
-static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)
-{
-    AVFilterContext *filt;
-    int i, j;
-
-    for (i = 0; i < graph->nb_filters; i++) {
-        filt = graph->filters[i];
-
-        for (j = 0; j < filt->nb_inputs; j++) {
-            if (!filt->inputs[j] || !filt->inputs[j]->src) {
-                av_log(log_ctx, AV_LOG_ERROR,
-                       "Input pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any source\n",
-                       filt->input_pads[j].name, filt->name, filt->filter->name);
-                return AVERROR(EINVAL);
-            }
-        }
-
-        for (j = 0; j < filt->nb_outputs; j++) {
-            if (!filt->outputs[j] || !filt->outputs[j]->dst) {
-                av_log(log_ctx, AV_LOG_ERROR,
-                       "Output pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any destination\n",
-                       filt->output_pads[j].name, filt->name, filt->filter->name);
-                return AVERROR(EINVAL);
-            }
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Configure all the links of graphctx.
- *
- * @return 0 in case of success, a negative value otherwise
- */
-static int graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
-{
-    AVFilterContext *filt;
-    int i, ret;
-
-    for (i = 0; i < graph->nb_filters; i++) {
-        filt = graph->filters[i];
-
-        if (!filt->nb_outputs) {
-            if ((ret = avfilter_config_links(filt)))
-                return ret;
-        }
-    }
-
-    return 0;
-}
-
-AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name)
-{
-    int i;
-
-    for (i = 0; i < graph->nb_filters; i++)
-        if (graph->filters[i]->name && !strcmp(name, graph->filters[i]->name))
-            return graph->filters[i];
-
-    return NULL;
-}
-
-static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
-{
-    int i, j, ret;
-    int scaler_count = 0, resampler_count = 0;
-
-    /* ask all the sub-filters for their supported media formats */
-    for (i = 0; i < graph->nb_filters; i++) {
-        if (graph->filters[i]->filter->query_formats)
-            graph->filters[i]->filter->query_formats(graph->filters[i]);
-        else
-            ff_default_query_formats(graph->filters[i]);
-    }
-
-    /* go through and merge as many format lists as possible */
-    for (i = 0; i < graph->nb_filters; i++) {
-        AVFilterContext *filter = graph->filters[i];
-
-        for (j = 0; j < filter->nb_inputs; j++) {
-            AVFilterLink *link = filter->inputs[j];
-            int convert_needed = 0;
-
-            if (!link)
-                continue;
-
-            if (link->in_formats != link->out_formats &&
-                !ff_merge_formats(link->in_formats,
-                                        link->out_formats))
-                convert_needed = 1;
-            if (link->type == AVMEDIA_TYPE_AUDIO) {
-                if (link->in_channel_layouts != link->out_channel_layouts &&
-                    !ff_merge_channel_layouts(link->in_channel_layouts,
-                                              link->out_channel_layouts))
-                    convert_needed = 1;
-                if (link->in_samplerates != link->out_samplerates &&
-                    !ff_merge_samplerates(link->in_samplerates,
-                                          link->out_samplerates))
-                    convert_needed = 1;
-            }
-
-            if (convert_needed) {
-                AVFilterContext *convert;
-                AVFilter *filter;
-                AVFilterLink *inlink, *outlink;
-                char scale_args[256];
-                char inst_name[30];
-
-                /* couldn't merge format lists. auto-insert conversion filter */
-                switch (link->type) {
-                case AVMEDIA_TYPE_VIDEO:
-                    if (!(filter = avfilter_get_by_name("scale"))) {
-                        av_log(log_ctx, AV_LOG_ERROR, "'scale' filter "
-                               "not present, cannot convert pixel formats.\n");
-                        return AVERROR(EINVAL);
-                    }
-
-                    snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d",
-                             scaler_count++);
-
-                    if ((ret = avfilter_graph_create_filter(&convert, filter,
-                                                            inst_name, graph->scale_sws_opts, NULL,
-                                                            graph)) < 0)
-                        return ret;
-                    break;
-                case AVMEDIA_TYPE_AUDIO:
-                    if (!(filter = avfilter_get_by_name("resample"))) {
-                        av_log(log_ctx, AV_LOG_ERROR, "'resample' filter "
-                               "not present, cannot convert audio formats.\n");
-                        return AVERROR(EINVAL);
-                    }
-
-                    snprintf(inst_name, sizeof(inst_name), "auto-inserted resampler %d",
-                             resampler_count++);
-                    scale_args[0] = '\0';
-                    if (graph->resample_lavr_opts)
-                        snprintf(scale_args, sizeof(scale_args), "%s",
-                                 graph->resample_lavr_opts);
-                    if ((ret = avfilter_graph_create_filter(&convert, filter,
-                                                            inst_name, scale_args,
-                                                            NULL, graph)) < 0)
-                        return ret;
-                    break;
-                default:
-                    return AVERROR(EINVAL);
-                }
-
-                if ((ret = avfilter_insert_filter(link, convert, 0, 0)) < 0)
-                    return ret;
-
-                convert->filter->query_formats(convert);
-                inlink  = convert->inputs[0];
-                outlink = convert->outputs[0];
-                if (!ff_merge_formats( inlink->in_formats,  inlink->out_formats) ||
-                    !ff_merge_formats(outlink->in_formats, outlink->out_formats))
-                    ret |= AVERROR(ENOSYS);
-                if (inlink->type == AVMEDIA_TYPE_AUDIO &&
-                    (!ff_merge_samplerates(inlink->in_samplerates,
-                                           inlink->out_samplerates) ||
-                     !ff_merge_channel_layouts(inlink->in_channel_layouts,
-                                               inlink->out_channel_layouts)))
-                    ret |= AVERROR(ENOSYS);
-                if (outlink->type == AVMEDIA_TYPE_AUDIO &&
-                    (!ff_merge_samplerates(outlink->in_samplerates,
-                                           outlink->out_samplerates) ||
-                     !ff_merge_channel_layouts(outlink->in_channel_layouts,
-                                               outlink->out_channel_layouts)))
-                    ret |= AVERROR(ENOSYS);
-
-                if (ret < 0) {
-                    av_log(log_ctx, AV_LOG_ERROR,
-                           "Impossible to convert between the formats supported by the filter "
-                           "'%s' and the filter '%s'\n", link->src->name, link->dst->name);
-                    return ret;
-                }
-            }
-        }
-    }
-
-    return 0;
-}
-
-static int pick_format(AVFilterLink *link)
-{
-    if (!link || !link->in_formats)
-        return 0;
-
-    link->in_formats->nb_formats = 1;
-    link->format = link->in_formats->formats[0];
-
-    if (link->type == AVMEDIA_TYPE_AUDIO) {
-        if (!link->in_samplerates->nb_formats) {
-            av_log(link->src, AV_LOG_ERROR, "Cannot select sample rate for"
-                   " the link between filters %s and %s.\n", link->src->name,
-                   link->dst->name);
-            return AVERROR(EINVAL);
-        }
-        link->in_samplerates->nb_formats = 1;
-        link->sample_rate = link->in_samplerates->formats[0];
-
-        if (!link->in_channel_layouts->nb_channel_layouts) {
-            av_log(link->src, AV_LOG_ERROR, "Cannot select channel layout for"
-                   "the link between filters %s and %s.\n", link->src->name,
-                   link->dst->name);
-            return AVERROR(EINVAL);
-        }
-        link->in_channel_layouts->nb_channel_layouts = 1;
-        link->channel_layout = link->in_channel_layouts->channel_layouts[0];
-    }
-
-    ff_formats_unref(&link->in_formats);
-    ff_formats_unref(&link->out_formats);
-    ff_formats_unref(&link->in_samplerates);
-    ff_formats_unref(&link->out_samplerates);
-    ff_channel_layouts_unref(&link->in_channel_layouts);
-    ff_channel_layouts_unref(&link->out_channel_layouts);
-
-    return 0;
-}
-
-#define REDUCE_FORMATS(fmt_type, list_type, list, var, nb, add_format) \
-do {                                                                   \
-    for (i = 0; i < filter->nb_inputs; i++) {                          \
-        AVFilterLink *link = filter->inputs[i];                        \
-        fmt_type fmt;                                                  \
-                                                                       \
-        if (!link->out_ ## list || link->out_ ## list->nb != 1)        \
-            continue;                                                  \
-        fmt = link->out_ ## list->var[0];                              \
-                                                                       \
-        for (j = 0; j < filter->nb_outputs; j++) {                     \
-            AVFilterLink *out_link = filter->outputs[j];               \
-            list_type *fmts;                                           \
-                                                                       \
-            if (link->type != out_link->type ||                        \
-                out_link->in_ ## list->nb == 1)                        \
-                continue;                                              \
-            fmts = out_link->in_ ## list;                              \
-                                                                       \
-            if (!out_link->in_ ## list->nb) {                          \
-                add_format(&out_link->in_ ##list, fmt);                \
-                break;                                                 \
-            }                                                          \
-                                                                       \
-            for (k = 0; k < out_link->in_ ## list->nb; k++)            \
-                if (fmts->var[k] == fmt) {                             \
-                    fmts->var[0]  = fmt;                               \
-                    fmts->nb = 1;                                      \
-                    ret = 1;                                           \
-                    break;                                             \
-                }                                                      \
-        }                                                              \
-    }                                                                  \
-} while (0)
-
-static int reduce_formats_on_filter(AVFilterContext *filter)
-{
-    int i, j, k, ret = 0;
-
-    REDUCE_FORMATS(int,      AVFilterFormats,        formats,         formats,
-                   nb_formats, ff_add_format);
-    REDUCE_FORMATS(int,      AVFilterFormats,        samplerates,     formats,
-                   nb_formats, ff_add_format);
-    REDUCE_FORMATS(uint64_t, AVFilterChannelLayouts, channel_layouts,
-                   channel_layouts, nb_channel_layouts, ff_add_channel_layout);
-
-    return ret;
-}
-
-static void reduce_formats(AVFilterGraph *graph)
-{
-    int i, reduced;
-
-    do {
-        reduced = 0;
-
-        for (i = 0; i < graph->nb_filters; i++)
-            reduced |= reduce_formats_on_filter(graph->filters[i]);
-    } while (reduced);
-}
-
-static void swap_samplerates_on_filter(AVFilterContext *filter)
-{
-    AVFilterLink *link = NULL;
-    int sample_rate;
-    int i, j;
-
-    for (i = 0; i < filter->nb_inputs; i++) {
-        link = filter->inputs[i];
-
-        if (link->type == AVMEDIA_TYPE_AUDIO &&
-            link->out_samplerates->nb_formats== 1)
-            break;
-    }
-    if (i == filter->nb_inputs)
-        return;
-
-    sample_rate = link->out_samplerates->formats[0];
-
-    for (i = 0; i < filter->nb_outputs; i++) {
-        AVFilterLink *outlink = filter->outputs[i];
-        int best_idx, best_diff = INT_MAX;
-
-        if (outlink->type != AVMEDIA_TYPE_AUDIO ||
-            outlink->in_samplerates->nb_formats < 2)
-            continue;
-
-        for (j = 0; j < outlink->in_samplerates->nb_formats; j++) {
-            int diff = abs(sample_rate - outlink->in_samplerates->formats[j]);
-
-            if (diff < best_diff) {
-                best_diff = diff;
-                best_idx  = j;
-            }
-        }
-        FFSWAP(int, outlink->in_samplerates->formats[0],
-               outlink->in_samplerates->formats[best_idx]);
-    }
-}
-
-static void swap_samplerates(AVFilterGraph *graph)
-{
-    int i;
-
-    for (i = 0; i < graph->nb_filters; i++)
-        swap_samplerates_on_filter(graph->filters[i]);
-}
-
-#define CH_CENTER_PAIR (AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER)
-#define CH_FRONT_PAIR  (AV_CH_FRONT_LEFT           | AV_CH_FRONT_RIGHT)
-#define CH_STEREO_PAIR (AV_CH_STEREO_LEFT          | AV_CH_STEREO_RIGHT)
-#define CH_WIDE_PAIR   (AV_CH_WIDE_LEFT            | AV_CH_WIDE_RIGHT)
-#define CH_SIDE_PAIR   (AV_CH_SIDE_LEFT            | AV_CH_SIDE_RIGHT)
-#define CH_DIRECT_PAIR (AV_CH_SURROUND_DIRECT_LEFT | AV_CH_SURROUND_DIRECT_RIGHT)
-#define CH_BACK_PAIR   (AV_CH_BACK_LEFT            | AV_CH_BACK_RIGHT)
-
-/* allowable substitutions for channel pairs when comparing layouts,
- * ordered by priority for both values */
-static const uint64_t ch_subst[][2] = {
-    { CH_FRONT_PAIR,      CH_CENTER_PAIR     },
-    { CH_FRONT_PAIR,      CH_WIDE_PAIR       },
-    { CH_FRONT_PAIR,      AV_CH_FRONT_CENTER },
-    { CH_CENTER_PAIR,     CH_FRONT_PAIR      },
-    { CH_CENTER_PAIR,     CH_WIDE_PAIR       },
-    { CH_CENTER_PAIR,     AV_CH_FRONT_CENTER },
-    { CH_WIDE_PAIR,       CH_FRONT_PAIR      },
-    { CH_WIDE_PAIR,       CH_CENTER_PAIR     },
-    { CH_WIDE_PAIR,       AV_CH_FRONT_CENTER },
-    { AV_CH_FRONT_CENTER, CH_FRONT_PAIR      },
-    { AV_CH_FRONT_CENTER, CH_CENTER_PAIR     },
-    { AV_CH_FRONT_CENTER, CH_WIDE_PAIR       },
-    { CH_SIDE_PAIR,       CH_DIRECT_PAIR     },
-    { CH_SIDE_PAIR,       CH_BACK_PAIR       },
-    { CH_SIDE_PAIR,       AV_CH_BACK_CENTER  },
-    { CH_BACK_PAIR,       CH_DIRECT_PAIR     },
-    { CH_BACK_PAIR,       CH_SIDE_PAIR       },
-    { CH_BACK_PAIR,       AV_CH_BACK_CENTER  },
-    { AV_CH_BACK_CENTER,  CH_BACK_PAIR       },
-    { AV_CH_BACK_CENTER,  CH_DIRECT_PAIR     },
-    { AV_CH_BACK_CENTER,  CH_SIDE_PAIR       },
-};
-
-static void swap_channel_layouts_on_filter(AVFilterContext *filter)
-{
-    AVFilterLink *link = NULL;
-    int i, j, k;
-
-    for (i = 0; i < filter->nb_inputs; i++) {
-        link = filter->inputs[i];
-
-        if (link->type == AVMEDIA_TYPE_AUDIO &&
-            link->out_channel_layouts->nb_channel_layouts == 1)
-            break;
-    }
-    if (i == filter->nb_inputs)
-        return;
-
-    for (i = 0; i < filter->nb_outputs; i++) {
-        AVFilterLink *outlink = filter->outputs[i];
-        int best_idx = -1, best_score = INT_MIN, best_count_diff = INT_MAX;
-
-        if (outlink->type != AVMEDIA_TYPE_AUDIO ||
-            outlink->in_channel_layouts->nb_channel_layouts < 2)
-            continue;
-
-        for (j = 0; j < outlink->in_channel_layouts->nb_channel_layouts; j++) {
-            uint64_t  in_chlayout = link->out_channel_layouts->channel_layouts[0];
-            uint64_t out_chlayout = outlink->in_channel_layouts->channel_layouts[j];
-            int  in_channels      = av_get_channel_layout_nb_channels(in_chlayout);
-            int out_channels      = av_get_channel_layout_nb_channels(out_chlayout);
-            int count_diff        = out_channels - in_channels;
-            int matched_channels, extra_channels;
-            int score = 0;
-
-            /* channel substitution */
-            for (k = 0; k < FF_ARRAY_ELEMS(ch_subst); k++) {
-                uint64_t cmp0 = ch_subst[k][0];
-                uint64_t cmp1 = ch_subst[k][1];
-                if (( in_chlayout & cmp0) && (!(out_chlayout & cmp0)) &&
-                    (out_chlayout & cmp1) && (!( in_chlayout & cmp1))) {
-                    in_chlayout  &= ~cmp0;
-                    out_chlayout &= ~cmp1;
-                    /* add score for channel match, minus a deduction for
-                       having to do the substitution */
-                    score += 10 * av_get_channel_layout_nb_channels(cmp1) - 2;
-                }
-            }
-
-            /* no penalty for LFE channel mismatch */
-            if ( (in_chlayout & AV_CH_LOW_FREQUENCY) &&
-                (out_chlayout & AV_CH_LOW_FREQUENCY))
-                score += 10;
-            in_chlayout  &= ~AV_CH_LOW_FREQUENCY;
-            out_chlayout &= ~AV_CH_LOW_FREQUENCY;
-
-            matched_channels = av_get_channel_layout_nb_channels(in_chlayout &
-                                                                 out_chlayout);
-            extra_channels   = av_get_channel_layout_nb_channels(out_chlayout &
-                                                                 (~in_chlayout));
-            score += 10 * matched_channels - 5 * extra_channels;
-
-            if (score > best_score ||
-                (count_diff < best_count_diff && score == best_score)) {
-                best_score = score;
-                best_idx   = j;
-                best_count_diff = count_diff;
-            }
-        }
-        av_assert0(best_idx >= 0);
-        FFSWAP(uint64_t, outlink->in_channel_layouts->channel_layouts[0],
-               outlink->in_channel_layouts->channel_layouts[best_idx]);
-    }
-
-}
-
-static void swap_channel_layouts(AVFilterGraph *graph)
-{
-    int i;
-
-    for (i = 0; i < graph->nb_filters; i++)
-        swap_channel_layouts_on_filter(graph->filters[i]);
-}
-
-static void swap_sample_fmts_on_filter(AVFilterContext *filter)
-{
-    AVFilterLink *link = NULL;
-    int format, bps;
-    int i, j;
-
-    for (i = 0; i < filter->nb_inputs; i++) {
-        link = filter->inputs[i];
-
-        if (link->type == AVMEDIA_TYPE_AUDIO &&
-            link->out_formats->nb_formats == 1)
-            break;
-    }
-    if (i == filter->nb_inputs)
-        return;
-
-    format = link->out_formats->formats[0];
-    bps    = av_get_bytes_per_sample(format);
-
-    for (i = 0; i < filter->nb_outputs; i++) {
-        AVFilterLink *outlink = filter->outputs[i];
-        int best_idx = -1, best_score = INT_MIN;
-
-        if (outlink->type != AVMEDIA_TYPE_AUDIO ||
-            outlink->in_formats->nb_formats < 2)
-            continue;
-
-        for (j = 0; j < outlink->in_formats->nb_formats; j++) {
-            int out_format = outlink->in_formats->formats[j];
-            int out_bps    = av_get_bytes_per_sample(out_format);
-            int score;
-
-            if (av_get_packed_sample_fmt(out_format) == format ||
-                av_get_planar_sample_fmt(out_format) == format) {
-                best_idx   = j;
-                break;
-            }
-
-            /* for s32 and float prefer double to prevent loss of information */
-            if (bps == 4 && out_bps == 8) {
-                best_idx = j;
-                break;
-            }
-
-            /* prefer closest higher or equal bps */
-            score = -abs(out_bps - bps);
-            if (out_bps >= bps)
-                score += INT_MAX/2;
-
-            if (score > best_score) {
-                best_score = score;
-                best_idx   = j;
-            }
-        }
-        av_assert0(best_idx >= 0);
-        FFSWAP(int, outlink->in_formats->formats[0],
-               outlink->in_formats->formats[best_idx]);
-    }
-}
-
-static void swap_sample_fmts(AVFilterGraph *graph)
-{
-    int i;
-
-    for (i = 0; i < graph->nb_filters; i++)
-        swap_sample_fmts_on_filter(graph->filters[i]);
-
-}
-
-static int pick_formats(AVFilterGraph *graph)
-{
-    int i, j, ret;
-
-    for (i = 0; i < graph->nb_filters; i++) {
-        AVFilterContext *filter = graph->filters[i];
-
-        for (j = 0; j < filter->nb_inputs; j++)
-            if ((ret = pick_format(filter->inputs[j])) < 0)
-                return ret;
-        for (j = 0; j < filter->nb_outputs; j++)
-            if ((ret = pick_format(filter->outputs[j])) < 0)
-                return ret;
-    }
-    return 0;
-}
-
-/**
- * Configure the formats of all the links in the graph.
- */
-static int graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)
-{
-    int ret;
-
-    /* find supported formats from sub-filters, and merge along links */
-    if ((ret = query_formats(graph, log_ctx)) < 0)
-        return ret;
-
-    /* Once everything is merged, it's possible that we'll still have
-     * multiple valid media format choices. We try to minimize the amount
-     * of format conversion inside filters */
-    reduce_formats(graph);
-
-    /* for audio filters, ensure the best format, sample rate and channel layout
-     * is selected */
-    swap_sample_fmts(graph);
-    swap_samplerates(graph);
-    swap_channel_layouts(graph);
-
-    if ((ret = pick_formats(graph)) < 0)
-        return ret;
-
-    return 0;
-}
-
-static int graph_insert_fifos(AVFilterGraph *graph, AVClass *log_ctx)
-{
-    AVFilterContext *f;
-    int i, j, ret;
-    int fifo_count = 0;
-
-    for (i = 0; i < graph->nb_filters; i++) {
-        f = graph->filters[i];
-
-        for (j = 0; j < f->nb_inputs; j++) {
-            AVFilterLink *link = f->inputs[j];
-            AVFilterContext *fifo_ctx;
-            AVFilter *fifo;
-            char name[32];
-
-            if (!link->dstpad->needs_fifo)
-                continue;
-
-            fifo = f->inputs[j]->type == AVMEDIA_TYPE_VIDEO ?
-                   avfilter_get_by_name("fifo") :
-                   avfilter_get_by_name("afifo");
-
-            snprintf(name, sizeof(name), "auto-inserted fifo %d", fifo_count++);
-
-            ret = avfilter_graph_create_filter(&fifo_ctx, fifo, name, NULL,
-                                               NULL, graph);
-            if (ret < 0)
-                return ret;
-
-            ret = avfilter_insert_filter(link, fifo_ctx, 0, 0);
-            if (ret < 0)
-                return ret;
-        }
-    }
-
-    return 0;
-}
-
-int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
-{
-    int ret;
-
-    if ((ret = graph_check_validity(graphctx, log_ctx)))
-        return ret;
-    if ((ret = graph_insert_fifos(graphctx, log_ctx)) < 0)
-        return ret;
-    if ((ret = graph_config_formats(graphctx, log_ctx)))
-        return ret;
-    if ((ret = graph_config_links(graphctx, log_ctx)))
-        return ret;
-
-    return 0;
-}
diff --git a/deps/libav/libavfilter/avfiltergraph.h b/deps/libav/libavfilter/avfiltergraph.h
deleted file mode 100644
index 47174ef..0000000
--- a/deps/libav/libavfilter/avfiltergraph.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Filter graphs
- * copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_AVFILTERGRAPH_H
-#define AVFILTER_AVFILTERGRAPH_H
-
-#include "avfilter.h"
-#include "libavutil/log.h"
-
-
-#endif /* AVFILTER_AVFILTERGRAPH_H */
diff --git a/deps/libav/libavfilter/buffer.c b/deps/libav/libavfilter/buffer.c
deleted file mode 100644
index fd0b18f..0000000
--- a/deps/libav/libavfilter/buffer.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-#include "libavcodec/avcodec.h"
-
-#include "avfilter.h"
-#include "internal.h"
-#include "version.h"
-
-#if FF_API_AVFILTERBUFFER
-/* TODO: buffer pool.  see comment for avfilter_default_get_video_buffer() */
-void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
-{
-    if (ptr->extended_data != ptr->data)
-        av_freep(&ptr->extended_data);
-    av_free(ptr->data[0]);
-    av_free(ptr);
-}
-
-AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
-{
-    AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
-    if (!ret)
-        return NULL;
-    *ret = *ref;
-    if (ref->type == AVMEDIA_TYPE_VIDEO) {
-        ret->video = av_malloc(sizeof(AVFilterBufferRefVideoProps));
-        if (!ret->video) {
-            av_free(ret);
-            return NULL;
-        }
-        *ret->video = *ref->video;
-        ret->extended_data = ret->data;
-    } else if (ref->type == AVMEDIA_TYPE_AUDIO) {
-        ret->audio = av_malloc(sizeof(AVFilterBufferRefAudioProps));
-        if (!ret->audio) {
-            av_free(ret);
-            return NULL;
-        }
-        *ret->audio = *ref->audio;
-
-        if (ref->extended_data != ref->data) {
-            int nb_channels = av_get_channel_layout_nb_channels(ref->audio->channel_layout);
-            if (!(ret->extended_data = av_malloc(sizeof(*ret->extended_data) *
-                                                 nb_channels))) {
-                av_freep(&ret->audio);
-                av_freep(&ret);
-                return NULL;
-            }
-            memcpy(ret->extended_data, ref->extended_data,
-                   sizeof(*ret->extended_data) * nb_channels);
-        } else
-            ret->extended_data = ret->data;
-    }
-    ret->perms &= pmask;
-    ret->buf->refcount ++;
-    return ret;
-}
-
-void avfilter_unref_buffer(AVFilterBufferRef *ref)
-{
-    if (!ref)
-        return;
-    if (!(--ref->buf->refcount))
-        ref->buf->free(ref->buf);
-    if (ref->extended_data != ref->data)
-        av_freep(&ref->extended_data);
-    av_free(ref->video);
-    av_free(ref->audio);
-    av_free(ref);
-}
-
-void avfilter_unref_bufferp(AVFilterBufferRef **ref)
-{
-FF_DISABLE_DEPRECATION_WARNINGS
-    avfilter_unref_buffer(*ref);
-FF_ENABLE_DEPRECATION_WARNINGS
-    *ref = NULL;
-}
-
-int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
-{
-    dst->pts    = src->pts;
-    dst->format = src->format;
-
-    switch (dst->type) {
-    case AVMEDIA_TYPE_VIDEO:
-        dst->video->w                   = src->width;
-        dst->video->h                   = src->height;
-        dst->video->pixel_aspect        = src->sample_aspect_ratio;
-        dst->video->interlaced          = src->interlaced_frame;
-        dst->video->top_field_first     = src->top_field_first;
-        dst->video->key_frame           = src->key_frame;
-        dst->video->pict_type           = src->pict_type;
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        dst->audio->sample_rate         = src->sample_rate;
-        dst->audio->channel_layout      = src->channel_layout;
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-
-    return 0;
-}
-
-int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
-{
-    int planes, nb_channels;
-
-    memcpy(dst->data, src->data, sizeof(dst->data));
-    memcpy(dst->linesize, src->linesize, sizeof(dst->linesize));
-
-    dst->pts     = src->pts;
-    dst->format  = src->format;
-
-    switch (src->type) {
-    case AVMEDIA_TYPE_VIDEO:
-        dst->width               = src->video->w;
-        dst->height              = src->video->h;
-        dst->sample_aspect_ratio = src->video->pixel_aspect;
-        dst->interlaced_frame    = src->video->interlaced;
-        dst->top_field_first     = src->video->top_field_first;
-        dst->key_frame           = src->video->key_frame;
-        dst->pict_type           = src->video->pict_type;
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        nb_channels = av_get_channel_layout_nb_channels(src->audio->channel_layout);
-        planes      = av_sample_fmt_is_planar(src->format) ? nb_channels : 1;
-
-        if (planes > FF_ARRAY_ELEMS(dst->data)) {
-            dst->extended_data = av_mallocz(planes * sizeof(*dst->extended_data));
-            if (!dst->extended_data)
-                return AVERROR(ENOMEM);
-            memcpy(dst->extended_data, src->extended_data,
-                   planes * sizeof(*dst->extended_data));
-        } else
-            dst->extended_data = dst->data;
-
-        dst->sample_rate         = src->audio->sample_rate;
-        dst->channel_layout      = src->audio->channel_layout;
-        dst->nb_samples          = src->audio->nb_samples;
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-
-    return 0;
-}
-
-void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
-{
-    // copy common properties
-    dst->pts             = src->pts;
-    dst->pos             = src->pos;
-
-    switch (src->type) {
-    case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break;
-    case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break;
-    default: break;
-    }
-}
-#endif /* FF_API_AVFILTERBUFFER */
diff --git a/deps/libav/libavfilter/buffersink.c b/deps/libav/libavfilter/buffersink.c
deleted file mode 100644
index 2a22948..0000000
--- a/deps/libav/libavfilter/buffersink.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (c) 2011 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * buffer sink
- */
-
-#include "libavutil/audio_fifo.h"
-#include "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "buffersink.h"
-#include "internal.h"
-
-typedef struct {
-    AVFrame *cur_frame;          ///< last frame delivered on the sink
-    AVAudioFifo *audio_fifo;     ///< FIFO for audio samples
-    int64_t next_pts;            ///< interpolating audio pts
-} BufferSinkContext;
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    BufferSinkContext *sink = ctx->priv;
-
-    if (sink->audio_fifo)
-        av_audio_fifo_free(sink->audio_fifo);
-}
-
-static int filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    BufferSinkContext *s = link->dst->priv;
-
-    av_assert0(!s->cur_frame);
-    s->cur_frame = frame;
-
-    return 0;
-}
-
-int attribute_align_arg av_buffersink_get_frame(AVFilterContext *ctx,
-                                                AVFrame *frame)
-{
-    BufferSinkContext *s    = ctx->priv;
-    AVFilterLink      *link = ctx->inputs[0];
-    int ret;
-
-    if ((ret = ff_request_frame(link)) < 0)
-        return ret;
-
-    if (!s->cur_frame)
-        return AVERROR(EINVAL);
-
-    av_frame_move_ref(frame, s->cur_frame);
-    av_frame_free(&s->cur_frame);
-
-    return 0;
-}
-
-static int read_from_fifo(AVFilterContext *ctx, AVFrame *frame,
-                          int nb_samples)
-{
-    BufferSinkContext *s = ctx->priv;
-    AVFilterLink   *link = ctx->inputs[0];
-    AVFrame *tmp;
-
-    if (!(tmp = ff_get_audio_buffer(link, nb_samples)))
-        return AVERROR(ENOMEM);
-    av_audio_fifo_read(s->audio_fifo, (void**)tmp->extended_data, nb_samples);
-
-    tmp->pts = s->next_pts;
-    s->next_pts += av_rescale_q(nb_samples, (AVRational){1, link->sample_rate},
-                                link->time_base);
-
-    av_frame_move_ref(frame, tmp);
-    av_frame_free(&tmp);
-
-    return 0;
-}
-
-int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx,
-                                                  AVFrame *frame, int nb_samples)
-{
-    BufferSinkContext *s = ctx->priv;
-    AVFilterLink   *link = ctx->inputs[0];
-    int ret = 0;
-
-    if (!s->audio_fifo) {
-        int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
-        if (!(s->audio_fifo = av_audio_fifo_alloc(link->format, nb_channels, nb_samples)))
-            return AVERROR(ENOMEM);
-    }
-
-    while (ret >= 0) {
-        if (av_audio_fifo_size(s->audio_fifo) >= nb_samples)
-            return read_from_fifo(ctx, frame, nb_samples);
-
-        ret = ff_request_frame(link);
-        if (ret == AVERROR_EOF && av_audio_fifo_size(s->audio_fifo))
-            return read_from_fifo(ctx, frame, av_audio_fifo_size(s->audio_fifo));
-        else if (ret < 0)
-            return ret;
-
-        if (s->cur_frame->pts != AV_NOPTS_VALUE) {
-            s->next_pts = s->cur_frame->pts -
-                          av_rescale_q(av_audio_fifo_size(s->audio_fifo),
-                                       (AVRational){ 1, link->sample_rate },
-                                       link->time_base);
-        }
-
-        ret = av_audio_fifo_write(s->audio_fifo, (void**)s->cur_frame->extended_data,
-                                  s->cur_frame->nb_samples);
-        av_frame_free(&s->cur_frame);
-    }
-
-    return ret;
-}
-
-#if FF_API_AVFILTERBUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-static void compat_free_buffer(AVFilterBuffer *buf)
-{
-    AVFrame *frame = buf->priv;
-    av_frame_free(&frame);
-    av_free(buf);
-}
-
-static int compat_read(AVFilterContext *ctx,
-                       AVFilterBufferRef **pbuf, int nb_samples)
-{
-    AVFilterBufferRef *buf;
-    AVFrame *frame;
-    int ret;
-
-    if (!pbuf)
-        return ff_poll_frame(ctx->inputs[0]);
-
-    frame = av_frame_alloc();
-    if (!frame)
-        return AVERROR(ENOMEM);
-
-    if (!nb_samples)
-        ret = av_buffersink_get_frame(ctx, frame);
-    else
-        ret = av_buffersink_get_samples(ctx, frame, nb_samples);
-
-    if (ret < 0)
-        goto fail;
-
-    if (ctx->inputs[0]->type == AVMEDIA_TYPE_VIDEO) {
-        buf = avfilter_get_video_buffer_ref_from_arrays(frame->data, frame->linesize,
-                                                        AV_PERM_READ,
-                                                        frame->width, frame->height,
-                                                        frame->format);
-    } else {
-        buf = avfilter_get_audio_buffer_ref_from_arrays(frame->extended_data,
-                                                        frame->linesize[0], AV_PERM_READ,
-                                                        frame->nb_samples,
-                                                        frame->format,
-                                                        frame->channel_layout);
-    }
-    if (!buf) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    avfilter_copy_frame_props(buf, frame);
-
-    buf->buf->priv = frame;
-    buf->buf->free = compat_free_buffer;
-
-    *pbuf = buf;
-
-    return 0;
-fail:
-    av_frame_free(&frame);
-    return ret;
-}
-
-int attribute_align_arg av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf)
-{
-    return compat_read(ctx, buf, 0);
-}
-
-int attribute_align_arg av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf,
-                                                   int nb_samples)
-{
-    return compat_read(ctx, buf, nb_samples);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-static const AVFilterPad avfilter_vsink_buffer_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-        .needs_fifo   = 1
-    },
-    { NULL }
-};
-
-AVFilter ff_vsink_buffer = {
-    .name        = "buffersink",
-    .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
-    .priv_size   = sizeof(BufferSinkContext),
-    .uninit      = uninit,
-
-    .inputs      = avfilter_vsink_buffer_inputs,
-    .outputs     = NULL,
-};
-
-static const AVFilterPad avfilter_asink_abuffer_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_AUDIO,
-        .filter_frame = filter_frame,
-        .needs_fifo   = 1
-    },
-    { NULL }
-};
-
-AVFilter ff_asink_abuffer = {
-    .name        = "abuffersink",
-    .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
-    .priv_size   = sizeof(BufferSinkContext),
-    .uninit      = uninit,
-
-    .inputs      = avfilter_asink_abuffer_inputs,
-    .outputs     = NULL,
-};
diff --git a/deps/libav/libavfilter/buffersink.h b/deps/libav/libavfilter/buffersink.h
deleted file mode 100644
index 83a8bd9..0000000
--- a/deps/libav/libavfilter/buffersink.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_BUFFERSINK_H
-#define AVFILTER_BUFFERSINK_H
-
-/**
- * @file
- * @ingroup lavfi_buffersink
- * memory buffer sink API
- */
-
-#include "avfilter.h"
-
-/**
- * @defgroup lavfi_buffersink Buffer sink API
- * @ingroup lavfi
- * @{
- */
-
-#if FF_API_AVFILTERBUFFER
-/**
- * Get a buffer with filtered data from sink and put it in buf.
- *
- * @param ctx pointer to a context of a buffersink or abuffersink AVFilter.
- * @param buf pointer to the buffer will be written here if buf is non-NULL. buf
- *            must be freed by the caller using avfilter_unref_buffer().
- *            Buf may also be NULL to query whether a buffer is ready to be
- *            output.
- *
- * @return >= 0 in case of success, a negative AVERROR code in case of
- *         failure.
- */
-attribute_deprecated
-int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf);
-
-/**
- * Same as av_buffersink_read, but with the ability to specify the number of
- * samples read. This function is less efficient than av_buffersink_read(),
- * because it copies the data around.
- *
- * @param ctx pointer to a context of the abuffersink AVFilter.
- * @param buf pointer to the buffer will be written here if buf is non-NULL. buf
- *            must be freed by the caller using avfilter_unref_buffer(). buf
- *            will contain exactly nb_samples audio samples, except at the end
- *            of stream, when it can contain less than nb_samples.
- *            Buf may also be NULL to query whether a buffer is ready to be
- *            output.
- *
- * @warning do not mix this function with av_buffersink_read(). Use only one or
- * the other with a single sink, not both.
- */
-attribute_deprecated
-int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf,
-                               int nb_samples);
-#endif
-
-/**
- * Get a frame with filtered data from sink and put it in frame.
- *
- * @param ctx pointer to a context of a buffersink or abuffersink AVFilter.
- * @param frame pointer to an allocated frame that will be filled with data.
- *              The data must be freed using av_frame_unref() / av_frame_free()
- *
- * @return
- *         - >= 0 if a frame was successfully returned.
- *         - AVERROR(EAGAIN) if no frames are available at this point; more
- *           input frames must be added to the filtergraph to get more output.
- *         - AVERROR_EOF if there will be no more output frames on this sink.
- *         - A different negative AVERROR code in other failure cases.
- */
-int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame);
-
-/**
- * Same as av_buffersink_get_frame(), but with the ability to specify the number
- * of samples read. This function is less efficient than
- * av_buffersink_get_frame(), because it copies the data around.
- *
- * @param ctx pointer to a context of the abuffersink AVFilter.
- * @param frame pointer to an allocated frame that will be filled with data.
- *              The data must be freed using av_frame_unref() / av_frame_free()
- *              frame will contain exactly nb_samples audio samples, except at
- *              the end of stream, when it can contain less than nb_samples.
- *
- * @return The return codes have the same meaning as for
- *         av_buffersink_get_samples().
- *
- * @warning do not mix this function with av_buffersink_get_frame(). Use only one or
- * the other with a single sink, not both.
- */
-int av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples);
-
-/**
- * @}
- */
-
-#endif /* AVFILTER_BUFFERSINK_H */
diff --git a/deps/libav/libavfilter/buffersrc.c b/deps/libav/libavfilter/buffersrc.c
deleted file mode 100644
index fd058d6..0000000
--- a/deps/libav/libavfilter/buffersrc.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/*
- * Copyright (c) 2008 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * memory buffer source filter
- */
-
-#include <float.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/fifo.h"
-#include "libavutil/frame.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-#include "audio.h"
-#include "avfilter.h"
-#include "buffersrc.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    const AVClass    *class;
-    AVFifoBuffer     *fifo;
-    AVRational        time_base;     ///< time_base to set in the output link
-
-    /* video only */
-    int               h, w;
-    enum AVPixelFormat  pix_fmt;
-    char               *pix_fmt_str;
-    AVRational        pixel_aspect;
-
-    /* audio only */
-    int sample_rate;
-    enum AVSampleFormat sample_fmt;
-    char               *sample_fmt_str;
-    uint64_t channel_layout;
-    char    *channel_layout_str;
-
-    int eof;
-} BufferSourceContext;
-
-#define CHECK_VIDEO_PARAM_CHANGE(s, c, width, height, format)\
-    if (c->w != width || c->h != height || c->pix_fmt != format) {\
-        av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
-        return AVERROR(EINVAL);\
-    }
-
-#define CHECK_AUDIO_PARAM_CHANGE(s, c, srate, ch_layout, format)\
-    if (c->sample_fmt != format || c->sample_rate != srate ||\
-        c->channel_layout != ch_layout) {\
-        av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
-        return AVERROR(EINVAL);\
-    }
-
-int attribute_align_arg av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame)
-{
-    AVFrame *copy;
-    int ret = 0;
-
-    if (!(copy = av_frame_alloc()))
-        return AVERROR(ENOMEM);
-    ret = av_frame_ref(copy, frame);
-    if (ret >= 0)
-        ret = av_buffersrc_add_frame(ctx, copy);
-
-    av_frame_free(&copy);
-    return ret;
-}
-
-int attribute_align_arg av_buffersrc_add_frame(AVFilterContext *ctx,
-                                               AVFrame *frame)
-{
-    BufferSourceContext *s = ctx->priv;
-    AVFrame *copy;
-    int refcounted, ret;
-
-    if (!frame) {
-        s->eof = 1;
-        return 0;
-    } else if (s->eof)
-        return AVERROR(EINVAL);
-
-    refcounted = !!frame->buf[0];
-
-    switch (ctx->outputs[0]->type) {
-    case AVMEDIA_TYPE_VIDEO:
-        CHECK_VIDEO_PARAM_CHANGE(ctx, s, frame->width, frame->height,
-                                 frame->format);
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        CHECK_AUDIO_PARAM_CHANGE(ctx, s, frame->sample_rate, frame->channel_layout,
-                                 frame->format);
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-
-    if (!av_fifo_space(s->fifo) &&
-        (ret = av_fifo_realloc2(s->fifo, av_fifo_size(s->fifo) +
-                                         sizeof(copy))) < 0)
-        return ret;
-
-    if (!(copy = av_frame_alloc()))
-        return AVERROR(ENOMEM);
-
-    if (refcounted) {
-        av_frame_move_ref(copy, frame);
-    } else {
-        ret = av_frame_ref(copy, frame);
-        if (ret < 0) {
-            av_frame_free(&copy);
-            return ret;
-        }
-    }
-
-    if ((ret = av_fifo_generic_write(s->fifo, &copy, sizeof(copy), NULL)) < 0) {
-        if (refcounted)
-            av_frame_move_ref(frame, copy);
-        av_frame_free(&copy);
-        return ret;
-    }
-
-    return 0;
-}
-
-#if FF_API_AVFILTERBUFFER
-FF_DISABLE_DEPRECATION_WARNINGS
-static void compat_free_buffer(void *opaque, uint8_t *data)
-{
-    AVFilterBufferRef *buf = opaque;
-    avfilter_unref_buffer(buf);
-}
-
-static void compat_unref_buffer(void *opaque, uint8_t *data)
-{
-    AVBufferRef *buf = opaque;
-    av_buffer_unref(&buf);
-}
-
-int av_buffersrc_buffer(AVFilterContext *ctx, AVFilterBufferRef *buf)
-{
-    BufferSourceContext *s = ctx->priv;
-    AVFrame *frame = NULL;
-    AVBufferRef *dummy_buf = NULL;
-    int ret = 0, planes, i;
-
-    if (!buf) {
-        s->eof = 1;
-        return 0;
-    } else if (s->eof)
-        return AVERROR(EINVAL);
-
-    frame = av_frame_alloc();
-    if (!frame)
-        return AVERROR(ENOMEM);
-
-    dummy_buf = av_buffer_create(NULL, 0, compat_free_buffer, buf, 0);
-    if (!dummy_buf) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    if ((ret = avfilter_copy_buf_props(frame, buf)) < 0)
-        goto fail;
-
-#define WRAP_PLANE(ref_out, data, data_size)                            \
-do {                                                                    \
-    AVBufferRef *dummy_ref = av_buffer_ref(dummy_buf);                  \
-    if (!dummy_ref) {                                                   \
-        ret = AVERROR(ENOMEM);                                          \
-        goto fail;                                                      \
-    }                                                                   \
-    ref_out = av_buffer_create(data, data_size, compat_unref_buffer,    \
-                               dummy_ref, 0);                           \
-    if (!ref_out) {                                                     \
-        av_frame_unref(frame);                                          \
-        ret = AVERROR(ENOMEM);                                          \
-        goto fail;                                                      \
-    }                                                                   \
-} while (0)
-
-    if (ctx->outputs[0]->type  == AVMEDIA_TYPE_VIDEO) {
-        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
-
-        planes = av_pix_fmt_count_planes(frame->format);
-        if (!desc || planes <= 0) {
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-
-        for (i = 0; i < planes; i++) {
-            int v_shift    = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
-            int plane_size = (frame->height >> v_shift) * frame->linesize[i];
-
-            WRAP_PLANE(frame->buf[i], frame->data[i], plane_size);
-        }
-    } else {
-        int planar = av_sample_fmt_is_planar(frame->format);
-        int channels = av_get_channel_layout_nb_channels(frame->channel_layout);
-
-        planes = planar ? channels : 1;
-
-        if (planes > FF_ARRAY_ELEMS(frame->buf)) {
-            frame->nb_extended_buf = planes - FF_ARRAY_ELEMS(frame->buf);
-            frame->extended_buf = av_mallocz(sizeof(*frame->extended_buf) *
-                                             frame->nb_extended_buf);
-            if (!frame->extended_buf) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-        }
-
-        for (i = 0; i < FFMIN(planes, FF_ARRAY_ELEMS(frame->buf)); i++)
-            WRAP_PLANE(frame->buf[i], frame->extended_data[i], frame->linesize[0]);
-
-        for (i = 0; i < planes - FF_ARRAY_ELEMS(frame->buf); i++)
-            WRAP_PLANE(frame->extended_buf[i],
-                       frame->extended_data[i + FF_ARRAY_ELEMS(frame->buf)],
-                       frame->linesize[0]);
-    }
-
-    ret = av_buffersrc_add_frame(ctx, frame);
-
-fail:
-    av_buffer_unref(&dummy_buf);
-    av_frame_free(&frame);
-
-    return ret;
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-static av_cold int init_video(AVFilterContext *ctx)
-{
-    BufferSourceContext *c = ctx->priv;
-
-    if (!c->pix_fmt_str || !c->w || !c->h || av_q2d(c->time_base) <= 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid parameters provided.\n");
-        return AVERROR(EINVAL);
-    }
-
-    if ((c->pix_fmt = av_get_pix_fmt(c->pix_fmt_str)) == AV_PIX_FMT_NONE) {
-        char *tail;
-        c->pix_fmt = strtol(c->pix_fmt_str, &tail, 10);
-        if (*tail || c->pix_fmt < 0 || c->pix_fmt >= AV_PIX_FMT_NB) {
-            av_log(ctx, AV_LOG_ERROR, "Invalid pixel format string '%s'\n", c->pix_fmt_str);
-            return AVERROR(EINVAL);
-        }
-    }
-
-    if (!(c->fifo = av_fifo_alloc(sizeof(AVFrame*))))
-        return AVERROR(ENOMEM);
-
-    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s\n", c->w, c->h, av_get_pix_fmt_name(c->pix_fmt));
-    return 0;
-}
-
-#define OFFSET(x) offsetof(BufferSourceContext, x)
-#define A AV_OPT_FLAG_AUDIO_PARAM
-#define V AV_OPT_FLAG_VIDEO_PARAM
-
-static const AVOption video_options[] = {
-    { "width",         NULL,                     OFFSET(w),                AV_OPT_TYPE_INT,      { .i64 = 0 }, 0, INT_MAX, V },
-    { "height",        NULL,                     OFFSET(h),                AV_OPT_TYPE_INT,      { .i64 = 0 }, 0, INT_MAX, V },
-    { "pix_fmt",       NULL,                     OFFSET(pix_fmt_str),      AV_OPT_TYPE_STRING,                    .flags = V },
-#if FF_API_OLD_FILTER_OPTS
-    /* those 4 are for compatibility with the old option passing system where each filter
-     * did its own parsing */
-    { "time_base_num", "deprecated, do not use", OFFSET(time_base.num),    AV_OPT_TYPE_INT,      { .i64 = 0 }, 0, INT_MAX, V },
-    { "time_base_den", "deprecated, do not use", OFFSET(time_base.den),    AV_OPT_TYPE_INT,      { .i64 = 0 }, 0, INT_MAX, V },
-    { "sar_num",       "deprecated, do not use", OFFSET(pixel_aspect.num), AV_OPT_TYPE_INT,      { .i64 = 0 }, 0, INT_MAX, V },
-    { "sar_den",       "deprecated, do not use", OFFSET(pixel_aspect.den), AV_OPT_TYPE_INT,      { .i64 = 0 }, 0, INT_MAX, V },
-#endif
-    { "sar",           "sample aspect ratio",    OFFSET(pixel_aspect),     AV_OPT_TYPE_RATIONAL, { .dbl = 1 }, 0, DBL_MAX, V },
-    { "time_base",     NULL,                     OFFSET(time_base),        AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
-    { NULL },
-};
-
-static const AVClass buffer_class = {
-    .class_name = "buffer source",
-    .item_name  = av_default_item_name,
-    .option     = video_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVOption audio_options[] = {
-    { "time_base",      NULL, OFFSET(time_base),           AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, INT_MAX, A },
-    { "sample_rate",    NULL, OFFSET(sample_rate),         AV_OPT_TYPE_INT,      { .i64 = 0 }, 0, INT_MAX, A },
-    { "sample_fmt",     NULL, OFFSET(sample_fmt_str),      AV_OPT_TYPE_STRING,             .flags = A },
-    { "channel_layout", NULL, OFFSET(channel_layout_str),  AV_OPT_TYPE_STRING,             .flags = A },
-    { NULL },
-};
-
-static const AVClass abuffer_class = {
-    .class_name = "abuffer source",
-    .item_name  = av_default_item_name,
-    .option     = audio_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static av_cold int init_audio(AVFilterContext *ctx)
-{
-    BufferSourceContext *s = ctx->priv;
-    int ret = 0;
-
-    s->sample_fmt = av_get_sample_fmt(s->sample_fmt_str);
-    if (s->sample_fmt == AV_SAMPLE_FMT_NONE) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid sample format %s.\n",
-               s->sample_fmt_str);
-        return AVERROR(EINVAL);
-    }
-
-    s->channel_layout = av_get_channel_layout(s->channel_layout_str);
-    if (!s->channel_layout) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s.\n",
-               s->channel_layout_str);
-        return AVERROR(EINVAL);
-    }
-
-    if (!(s->fifo = av_fifo_alloc(sizeof(AVFrame*))))
-        return AVERROR(ENOMEM);
-
-    if (!s->time_base.num)
-        s->time_base = (AVRational){1, s->sample_rate};
-
-    av_log(ctx, AV_LOG_VERBOSE, "tb:%d/%d samplefmt:%s samplerate: %d "
-           "ch layout:%s\n", s->time_base.num, s->time_base.den, s->sample_fmt_str,
-           s->sample_rate, s->channel_layout_str);
-
-    return ret;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    BufferSourceContext *s = ctx->priv;
-    while (s->fifo && av_fifo_size(s->fifo)) {
-        AVFrame *frame;
-        av_fifo_generic_read(s->fifo, &frame, sizeof(frame), NULL);
-        av_frame_free(&frame);
-    }
-    av_fifo_free(s->fifo);
-    s->fifo = NULL;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    BufferSourceContext *c = ctx->priv;
-    AVFilterChannelLayouts *channel_layouts = NULL;
-    AVFilterFormats *formats = NULL;
-    AVFilterFormats *samplerates = NULL;
-
-    switch (ctx->outputs[0]->type) {
-    case AVMEDIA_TYPE_VIDEO:
-        ff_add_format(&formats, c->pix_fmt);
-        ff_set_common_formats(ctx, formats);
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        ff_add_format(&formats,           c->sample_fmt);
-        ff_set_common_formats(ctx, formats);
-
-        ff_add_format(&samplerates,       c->sample_rate);
-        ff_set_common_samplerates(ctx, samplerates);
-
-        ff_add_channel_layout(&channel_layouts, c->channel_layout);
-        ff_set_common_channel_layouts(ctx, channel_layouts);
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-
-    return 0;
-}
-
-static int config_props(AVFilterLink *link)
-{
-    BufferSourceContext *c = link->src->priv;
-
-    switch (link->type) {
-    case AVMEDIA_TYPE_VIDEO:
-        link->w = c->w;
-        link->h = c->h;
-        link->sample_aspect_ratio = c->pixel_aspect;
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        link->channel_layout = c->channel_layout;
-        link->sample_rate    = c->sample_rate;
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-
-    link->time_base = c->time_base;
-    return 0;
-}
-
-static int request_frame(AVFilterLink *link)
-{
-    BufferSourceContext *c = link->src->priv;
-    AVFrame *frame;
-    int ret = 0;
-
-    if (!av_fifo_size(c->fifo)) {
-        if (c->eof)
-            return AVERROR_EOF;
-        return AVERROR(EAGAIN);
-    }
-    av_fifo_generic_read(c->fifo, &frame, sizeof(frame), NULL);
-
-    ff_filter_frame(link, frame);
-
-    return ret;
-}
-
-static int poll_frame(AVFilterLink *link)
-{
-    BufferSourceContext *c = link->src->priv;
-    int size = av_fifo_size(c->fifo);
-    if (!size && c->eof)
-        return AVERROR_EOF;
-    return size/sizeof(AVFrame*);
-}
-
-static const AVFilterPad avfilter_vsrc_buffer_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .request_frame = request_frame,
-        .poll_frame    = poll_frame,
-        .config_props  = config_props,
-    },
-    { NULL }
-};
-
-AVFilter ff_vsrc_buffer = {
-    .name      = "buffer",
-    .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them accessible to the filterchain."),
-    .priv_size = sizeof(BufferSourceContext),
-    .priv_class = &buffer_class,
-    .query_formats = query_formats,
-
-    .init      = init_video,
-    .uninit    = uninit,
-
-    .inputs    = NULL,
-    .outputs   = avfilter_vsrc_buffer_outputs,
-};
-
-static const AVFilterPad avfilter_asrc_abuffer_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_AUDIO,
-        .request_frame = request_frame,
-        .poll_frame    = poll_frame,
-        .config_props  = config_props,
-    },
-    { NULL }
-};
-
-AVFilter ff_asrc_abuffer = {
-    .name          = "abuffer",
-    .description   = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them accessible to the filterchain."),
-    .priv_size     = sizeof(BufferSourceContext),
-    .priv_class    = &abuffer_class,
-    .query_formats = query_formats,
-
-    .init      = init_audio,
-    .uninit    = uninit,
-
-    .inputs    = NULL,
-    .outputs   = avfilter_asrc_abuffer_outputs,
-};
diff --git a/deps/libav/libavfilter/buffersrc.h b/deps/libav/libavfilter/buffersrc.h
deleted file mode 100644
index 0ca4d96..0000000
--- a/deps/libav/libavfilter/buffersrc.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_BUFFERSRC_H
-#define AVFILTER_BUFFERSRC_H
-
-/**
- * @file
- * @ingroup lavfi_buffersrc
- * Memory buffer source API.
- */
-
-#include "avfilter.h"
-
-/**
- * @defgroup lavfi_buffersrc Buffer source API
- * @ingroup lavfi
- * @{
- */
-
-#if FF_API_AVFILTERBUFFER
-/**
- * Add a buffer to a filtergraph.
- *
- * @param ctx an instance of the buffersrc filter
- * @param buf buffer containing frame data to be passed down the filtergraph.
- * This function will take ownership of buf, the user must not free it.
- * A NULL buf signals EOF -- i.e. no more frames will be sent to this filter.
- *
- * @deprecated use av_buffersrc_write_frame() or av_buffersrc_add_frame()
- */
-attribute_deprecated
-int av_buffersrc_buffer(AVFilterContext *ctx, AVFilterBufferRef *buf);
-#endif
-
-/**
- * Add a frame to the buffer source.
- *
- * @param ctx   an instance of the buffersrc filter
- * @param frame frame to be added. If the frame is reference counted, this
- * function will make a new reference to it. Otherwise the frame data will be
- * copied.
- *
- * @return 0 on success, a negative AVERROR on error
- */
-int av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame);
-
-/**
- * Add a frame to the buffer source.
- *
- * @param ctx   an instance of the buffersrc filter
- * @param frame frame to be added. If the frame is reference counted, this
- * function will take ownership of the reference(s) and reset the frame.
- * Otherwise the frame data will be copied. If this function returns an error,
- * the input frame is not touched.
- *
- * @return 0 on success, a negative AVERROR on error.
- *
- * @note the difference between this function and av_buffersrc_write_frame() is
- * that av_buffersrc_write_frame() creates a new reference to the input frame,
- * while this function takes ownership of the reference passed to it.
- */
-int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame);
-
-/**
- * @}
- */
-
-#endif /* AVFILTER_BUFFERSRC_H */
diff --git a/deps/libav/libavfilter/drawutils.c b/deps/libav/libavfilter/drawutils.c
deleted file mode 100644
index e837760..0000000
--- a/deps/libav/libavfilter/drawutils.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/avutil.h"
-#include "libavutil/colorspace.h"
-#include "libavutil/mem.h"
-#include "libavutil/pixdesc.h"
-#include "drawutils.h"
-
-enum { RED = 0, GREEN, BLUE, ALPHA };
-
-int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4],
-                            enum AVPixelFormat pix_fmt, uint8_t rgba_color[4],
-                            int *is_packed_rgba, uint8_t rgba_map_ptr[4])
-{
-    uint8_t rgba_map[4] = {0};
-    int i;
-    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
-    int hsub = pix_desc->log2_chroma_w;
-
-    *is_packed_rgba = 1;
-    switch (pix_fmt) {
-    case AV_PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
-    case AV_PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
-    case AV_PIX_FMT_RGBA:
-    case AV_PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
-    case AV_PIX_FMT_BGRA:
-    case AV_PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
-    default:
-        *is_packed_rgba = 0;
-    }
-
-    if (*is_packed_rgba) {
-        pixel_step[0] = (av_get_bits_per_pixel(pix_desc))>>3;
-        for (i = 0; i < 4; i++)
-            dst_color[rgba_map[i]] = rgba_color[i];
-
-        line[0] = av_malloc(w * pixel_step[0]);
-        for (i = 0; i < w; i++)
-            memcpy(line[0] + i * pixel_step[0], dst_color, pixel_step[0]);
-        if (rgba_map_ptr)
-            memcpy(rgba_map_ptr, rgba_map, sizeof(rgba_map[0]) * 4);
-    } else {
-        int plane;
-
-        dst_color[0] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]);
-        dst_color[1] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
-        dst_color[2] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
-        dst_color[3] = rgba_color[3];
-
-        for (plane = 0; plane < 4; plane++) {
-            int line_size;
-            int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
-
-            pixel_step[plane] = 1;
-            line_size = (w >> hsub1) * pixel_step[plane];
-            line[plane] = av_malloc(line_size);
-            memset(line[plane], dst_color[plane], line_size);
-        }
-    }
-
-    return 0;
-}
-
-void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4],
-                       uint8_t *src[4], int pixelstep[4],
-                       int hsub, int vsub, int x, int y, int w, int h)
-{
-    int i, plane;
-    uint8_t *p;
-
-    for (plane = 0; plane < 4 && dst[plane]; plane++) {
-        int hsub1 = plane == 1 || plane == 2 ? hsub : 0;
-        int vsub1 = plane == 1 || plane == 2 ? vsub : 0;
-
-        p = dst[plane] + (y >> vsub1) * dst_linesize[plane];
-        for (i = 0; i < (h >> vsub1); i++) {
-            memcpy(p + (x >> hsub1) * pixelstep[plane],
-                   src[plane], (w >> hsub1) * pixelstep[plane]);
-            p += dst_linesize[plane];
-        }
-    }
-}
-
-void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4],
-                       uint8_t *src[4], int src_linesize[4], int pixelstep[4],
-                       int hsub, int vsub, int x, int y, int y2, int w, int h)
-{
-    int i, plane;
-    uint8_t *p;
-
-    for (plane = 0; plane < 4 && dst[plane]; plane++) {
-        int hsub1 = plane == 1 || plane == 2 ? hsub : 0;
-        int vsub1 = plane == 1 || plane == 2 ? vsub : 0;
-
-        p = dst[plane] + (y >> vsub1) * dst_linesize[plane];
-        for (i = 0; i < (h >> vsub1); i++) {
-            memcpy(p + (x >> hsub1) * pixelstep[plane],
-                   src[plane] + src_linesize[plane]*(i+(y2>>vsub1)), (w >> hsub1) * pixelstep[plane]);
-            p += dst_linesize[plane];
-        }
-    }
-}
diff --git a/deps/libav/libavfilter/drawutils.h b/deps/libav/libavfilter/drawutils.h
deleted file mode 100644
index 73f482e..0000000
--- a/deps/libav/libavfilter/drawutils.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_DRAWUTILS_H
-#define AVFILTER_DRAWUTILS_H
-
-/**
- * @file
- * misc drawing utilities
- */
-
-#include <stdint.h>
-#include "libavutil/pixfmt.h"
-
-int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w,
-                            uint8_t dst_color[4],
-                            enum AVPixelFormat pix_fmt, uint8_t rgba_color[4],
-                            int *is_packed_rgba, uint8_t rgba_map[4]);
-
-void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4],
-                       uint8_t *src[4], int pixelstep[4],
-                       int hsub, int vsub, int x, int y, int w, int h);
-
-void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4],
-                       uint8_t *src[4], int src_linesize[4], int pixelstep[4],
-                       int hsub, int vsub, int x, int y, int y2, int w, int h);
-
-#endif /* AVFILTER_DRAWUTILS_H */
diff --git a/deps/libav/libavfilter/fifo.c b/deps/libav/libavfilter/fifo.c
deleted file mode 100644
index 30e0b38..0000000
--- a/deps/libav/libavfilter/fifo.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FIFO buffering filter
- */
-
-#include "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/samplefmt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct Buf {
-    AVFrame *frame;
-    struct Buf        *next;
-} Buf;
-
-typedef struct {
-    Buf  root;
-    Buf *last;   ///< last buffered frame
-
-    /**
-     * When a specific number of output samples is requested, the partial
-     * buffer is stored here
-     */
-    AVFrame *out;
-    int allocated_samples;      ///< number of samples out was allocated for
-} FifoContext;
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    FifoContext *fifo = ctx->priv;
-    fifo->last = &fifo->root;
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    FifoContext *fifo = ctx->priv;
-    Buf *buf, *tmp;
-
-    for (buf = fifo->root.next; buf; buf = tmp) {
-        tmp = buf->next;
-        av_frame_free(&buf->frame);
-        av_free(buf);
-    }
-
-    av_frame_free(&fifo->out);
-}
-
-static int add_to_queue(AVFilterLink *inlink, AVFrame *frame)
-{
-    FifoContext *fifo = inlink->dst->priv;
-
-    fifo->last->next = av_mallocz(sizeof(Buf));
-    if (!fifo->last->next) {
-        av_frame_free(&frame);
-        return AVERROR(ENOMEM);
-    }
-
-    fifo->last = fifo->last->next;
-    fifo->last->frame = frame;
-
-    return 0;
-}
-
-static void queue_pop(FifoContext *s)
-{
-    Buf *tmp = s->root.next->next;
-    if (s->last == s->root.next)
-        s->last = &s->root;
-    av_freep(&s->root.next);
-    s->root.next = tmp;
-}
-
-/**
- * Move data pointers and pts offset samples forward.
- */
-static void buffer_offset(AVFilterLink *link, AVFrame *frame,
-                          int offset)
-{
-    int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
-    int planar = av_sample_fmt_is_planar(link->format);
-    int planes = planar ? nb_channels : 1;
-    int block_align = av_get_bytes_per_sample(link->format) * (planar ? 1 : nb_channels);
-    int i;
-
-    av_assert0(frame->nb_samples > offset);
-
-    for (i = 0; i < planes; i++)
-        frame->extended_data[i] += block_align * offset;
-    if (frame->data != frame->extended_data)
-        memcpy(frame->data, frame->extended_data,
-               FFMIN(planes, FF_ARRAY_ELEMS(frame->data)) * sizeof(*frame->data));
-    frame->linesize[0] -= block_align*offset;
-    frame->nb_samples -= offset;
-
-    if (frame->pts != AV_NOPTS_VALUE) {
-        frame->pts += av_rescale_q(offset, (AVRational){1, link->sample_rate},
-                                   link->time_base);
-    }
-}
-
-static int calc_ptr_alignment(AVFrame *frame)
-{
-    int planes = av_sample_fmt_is_planar(frame->format) ?
-                 av_get_channel_layout_nb_channels(frame->channel_layout) : 1;
-    int min_align = 128;
-    int p;
-
-    for (p = 0; p < planes; p++) {
-        int cur_align = 128;
-        while ((intptr_t)frame->extended_data[p] % cur_align)
-            cur_align >>= 1;
-        if (cur_align < min_align)
-            min_align = cur_align;
-    }
-    return min_align;
-}
-
-static int return_audio_frame(AVFilterContext *ctx)
-{
-    AVFilterLink *link = ctx->outputs[0];
-    FifoContext *s = ctx->priv;
-    AVFrame *head = s->root.next ? s->root.next->frame : NULL;
-    AVFrame *out;
-    int ret;
-
-    /* if head is NULL then we're flushing the remaining samples in out */
-    if (!head && !s->out)
-        return AVERROR_EOF;
-
-    if (!s->out &&
-        head->nb_samples >= link->request_samples &&
-        calc_ptr_alignment(head) >= 32) {
-        if (head->nb_samples == link->request_samples) {
-            out = head;
-            queue_pop(s);
-        } else {
-            out = av_frame_clone(head);
-            if (!out)
-                return AVERROR(ENOMEM);
-
-            out->nb_samples = link->request_samples;
-            buffer_offset(link, head, link->request_samples);
-        }
-    } else {
-        int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
-
-        if (!s->out) {
-            s->out = ff_get_audio_buffer(link, link->request_samples);
-            if (!s->out)
-                return AVERROR(ENOMEM);
-
-            s->out->nb_samples = 0;
-            s->out->pts                   = head->pts;
-            s->allocated_samples          = link->request_samples;
-        } else if (link->request_samples != s->allocated_samples) {
-            av_log(ctx, AV_LOG_ERROR, "request_samples changed before the "
-                   "buffer was returned.\n");
-            return AVERROR(EINVAL);
-        }
-
-        while (s->out->nb_samples < s->allocated_samples) {
-            int len;
-
-            if (!s->root.next) {
-                ret = ff_request_frame(ctx->inputs[0]);
-                if (ret == AVERROR_EOF) {
-                    av_samples_set_silence(s->out->extended_data,
-                                           s->out->nb_samples,
-                                           s->allocated_samples -
-                                           s->out->nb_samples,
-                                           nb_channels, link->format);
-                    s->out->nb_samples = s->allocated_samples;
-                    break;
-                } else if (ret < 0)
-                    return ret;
-            }
-            head = s->root.next->frame;
-
-            len = FFMIN(s->allocated_samples - s->out->nb_samples,
-                        head->nb_samples);
-
-            av_samples_copy(s->out->extended_data, head->extended_data,
-                            s->out->nb_samples, 0, len, nb_channels,
-                            link->format);
-            s->out->nb_samples += len;
-
-            if (len == head->nb_samples) {
-                av_frame_free(&head);
-                queue_pop(s);
-            } else {
-                buffer_offset(link, head, len);
-            }
-        }
-        out = s->out;
-        s->out = NULL;
-    }
-    return ff_filter_frame(link, out);
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    FifoContext *fifo = outlink->src->priv;
-    int ret = 0;
-
-    if (!fifo->root.next) {
-        if ((ret = ff_request_frame(outlink->src->inputs[0])) < 0) {
-            if (ret == AVERROR_EOF && outlink->request_samples)
-                return return_audio_frame(outlink->src);
-            return ret;
-        }
-    }
-
-    if (outlink->request_samples) {
-        return return_audio_frame(outlink->src);
-    } else {
-        ret = ff_filter_frame(outlink, fifo->root.next->frame);
-        queue_pop(fifo);
-    }
-
-    return ret;
-}
-
-static const AVFilterPad avfilter_vf_fifo_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = add_to_queue,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_fifo_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_fifo = {
-    .name      = "fifo",
-    .description = NULL_IF_CONFIG_SMALL("Buffer input images and send them when they are requested."),
-
-    .init      = init,
-    .uninit    = uninit,
-
-    .priv_size = sizeof(FifoContext),
-
-    .inputs    = avfilter_vf_fifo_inputs,
-    .outputs   = avfilter_vf_fifo_outputs,
-};
-
-static const AVFilterPad avfilter_af_afifo_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_AUDIO,
-        .get_audio_buffer = ff_null_get_audio_buffer,
-        .filter_frame     = add_to_queue,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_af_afifo_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_AUDIO,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_af_afifo = {
-    .name        = "afifo",
-    .description = NULL_IF_CONFIG_SMALL("Buffer input frames and send them when they are requested."),
-
-    .init      = init,
-    .uninit    = uninit,
-
-    .priv_size = sizeof(FifoContext),
-
-    .inputs    = avfilter_af_afifo_inputs,
-    .outputs   = avfilter_af_afifo_outputs,
-};
diff --git a/deps/libav/libavfilter/filtfmts.c b/deps/libav/libavfilter/filtfmts.c
deleted file mode 100644
index f68287a..0000000
--- a/deps/libav/libavfilter/filtfmts.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2009 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-
-#include "libavformat/avformat.h"
-#include "libavutil/pixdesc.h"
-#include "libavfilter/avfilter.h"
-#include "libavfilter/formats.h"
-
-int main(int argc, char **argv)
-{
-    AVFilter *filter;
-    AVFilterContext *filter_ctx;
-    AVFilterGraph *graph_ctx;
-    const char *filter_name;
-    const char *filter_args = NULL;
-    int i, j;
-
-    av_log_set_level(AV_LOG_DEBUG);
-
-    if (!argv[1]) {
-        fprintf(stderr, "Missing filter name as argument\n");
-        return 1;
-    }
-
-    filter_name = argv[1];
-    if (argv[2])
-        filter_args = argv[2];
-
-    /* allocate graph */
-    graph_ctx = avfilter_graph_alloc();
-    if (!graph_ctx)
-        return 1;
-
-    avfilter_register_all();
-
-    /* get a corresponding filter and open it */
-    if (!(filter = avfilter_get_by_name(filter_name))) {
-        fprintf(stderr, "Unrecognized filter with name '%s'\n", filter_name);
-        return 1;
-    }
-
-    /* open filter and add it to the graph */
-    if (!(filter_ctx = avfilter_graph_alloc_filter(graph_ctx, filter, filter_name))) {
-        fprintf(stderr, "Impossible to open filter with name '%s'\n",
-                filter_name);
-        return 1;
-    }
-    if (avfilter_init_str(filter_ctx, filter_args) < 0) {
-        fprintf(stderr, "Impossible to init filter '%s' with arguments '%s'\n",
-                filter_name, filter_args);
-        return 1;
-    }
-
-    /* create a link for each of the input pads */
-    for (i = 0; i < filter_ctx->nb_inputs; i++) {
-        AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
-        link->type = filter_ctx->filter->inputs[i].type;
-        filter_ctx->inputs[i] = link;
-    }
-    for (i = 0; i < filter_ctx->nb_outputs; i++) {
-        AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
-        link->type = filter_ctx->filter->outputs[i].type;
-        filter_ctx->outputs[i] = link;
-    }
-
-    if (filter->query_formats)
-        filter->query_formats(filter_ctx);
-    else
-        ff_default_query_formats(filter_ctx);
-
-    /* print the supported formats in input */
-    for (i = 0; i < filter_ctx->nb_inputs; i++) {
-        AVFilterFormats *fmts = filter_ctx->inputs[i]->out_formats;
-        for (j = 0; j < fmts->nb_formats; j++)
-            printf("INPUT[%d] %s: %s\n",
-                   i, filter_ctx->filter->inputs[i].name,
-                   av_get_pix_fmt_name(fmts->formats[j]));
-    }
-
-    /* print the supported formats in output */
-    for (i = 0; i < filter_ctx->nb_outputs; i++) {
-        AVFilterFormats *fmts = filter_ctx->outputs[i]->in_formats;
-        for (j = 0; j < fmts->nb_formats; j++)
-            printf("OUTPUT[%d] %s: %s\n",
-                   i, filter_ctx->filter->outputs[i].name,
-                   av_get_pix_fmt_name(fmts->formats[j]));
-    }
-
-    avfilter_free(filter_ctx);
-    avfilter_graph_free(&graph_ctx);
-    fflush(stdout);
-    return 0;
-}
diff --git a/deps/libav/libavfilter/formats.c b/deps/libav/libavfilter/formats.c
deleted file mode 100644
index 1441161..0000000
--- a/deps/libav/libavfilter/formats.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Filter layer - format negotiation
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "formats.h"
-
-/**
- * Add all refs from a to ret and destroy a.
- */
-#define MERGE_REF(ret, a, fmts, type, fail)                                \
-do {                                                                       \
-    type ***tmp;                                                           \
-    int i;                                                                 \
-                                                                           \
-    if (!(tmp = av_realloc(ret->refs,                                      \
-                           sizeof(*tmp) * (ret->refcount + a->refcount)))) \
-        goto fail;                                                         \
-    ret->refs = tmp;                                                       \
-                                                                           \
-    for (i = 0; i < a->refcount; i ++) {                                   \
-        ret->refs[ret->refcount] = a->refs[i];                             \
-        *ret->refs[ret->refcount++] = ret;                                 \
-    }                                                                      \
-                                                                           \
-    av_freep(&a->refs);                                                    \
-    av_freep(&a->fmts);                                                    \
-    av_freep(&a);                                                          \
-} while (0)
-
-/**
- * Add all formats common for a and b to ret, copy the refs and destroy
- * a and b.
- */
-#define MERGE_FORMATS(ret, a, b, fmts, nb, type, fail)                          \
-do {                                                                            \
-    int i, j, k = 0, count = FFMIN(a->nb, b->nb);                               \
-                                                                                \
-    if (!(ret = av_mallocz(sizeof(*ret))))                                      \
-        goto fail;                                                              \
-                                                                                \
-    if (count) {                                                                \
-        if (!(ret->fmts = av_malloc(sizeof(*ret->fmts) * count)))               \
-            goto fail;                                                          \
-        for (i = 0; i < a->nb; i++)                                             \
-            for (j = 0; j < b->nb; j++)                                         \
-                if (a->fmts[i] == b->fmts[j])                                   \
-                    ret->fmts[k++] = a->fmts[i];                                \
-                                                                                \
-        ret->nb = k;                                                            \
-    }                                                                           \
-    /* check that there was at least one common format */                       \
-    if (!ret->nb)                                                               \
-        goto fail;                                                              \
-                                                                                \
-    MERGE_REF(ret, a, fmts, type, fail);                                        \
-    MERGE_REF(ret, b, fmts, type, fail);                                        \
-} while (0)
-
-AVFilterFormats *ff_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
-{
-    AVFilterFormats *ret = NULL;
-
-    if (a == b)
-        return a;
-
-    MERGE_FORMATS(ret, a, b, formats, nb_formats, AVFilterFormats, fail);
-
-    return ret;
-fail:
-    if (ret) {
-        av_freep(&ret->refs);
-        av_freep(&ret->formats);
-    }
-    av_freep(&ret);
-    return NULL;
-}
-
-AVFilterFormats *ff_merge_samplerates(AVFilterFormats *a,
-                                      AVFilterFormats *b)
-{
-    AVFilterFormats *ret = NULL;
-
-    if (a == b) return a;
-
-    if (a->nb_formats && b->nb_formats) {
-        MERGE_FORMATS(ret, a, b, formats, nb_formats, AVFilterFormats, fail);
-    } else if (a->nb_formats) {
-        MERGE_REF(a, b, formats, AVFilterFormats, fail);
-        ret = a;
-    } else {
-        MERGE_REF(b, a, formats, AVFilterFormats, fail);
-        ret = b;
-    }
-
-    return ret;
-fail:
-    if (ret) {
-        av_freep(&ret->refs);
-        av_freep(&ret->formats);
-    }
-    av_freep(&ret);
-    return NULL;
-}
-
-AVFilterChannelLayouts *ff_merge_channel_layouts(AVFilterChannelLayouts *a,
-                                                 AVFilterChannelLayouts *b)
-{
-    AVFilterChannelLayouts *ret = NULL;
-
-    if (a == b) return a;
-
-    if (a->nb_channel_layouts && b->nb_channel_layouts) {
-        MERGE_FORMATS(ret, a, b, channel_layouts, nb_channel_layouts,
-                      AVFilterChannelLayouts, fail);
-    } else if (a->nb_channel_layouts) {
-        MERGE_REF(a, b, channel_layouts, AVFilterChannelLayouts, fail);
-        ret = a;
-    } else {
-        MERGE_REF(b, a, channel_layouts, AVFilterChannelLayouts, fail);
-        ret = b;
-    }
-
-    return ret;
-fail:
-    if (ret) {
-        av_freep(&ret->refs);
-        av_freep(&ret->channel_layouts);
-    }
-    av_freep(&ret);
-    return NULL;
-}
-
-int ff_fmt_is_in(int fmt, const int *fmts)
-{
-    const int *p;
-
-    for (p = fmts; *p != AV_PIX_FMT_NONE; p++) {
-        if (fmt == *p)
-            return 1;
-    }
-    return 0;
-}
-
-AVFilterFormats *ff_make_format_list(const int *fmts)
-{
-    AVFilterFormats *formats;
-    int count;
-
-    for (count = 0; fmts[count] != -1; count++)
-        ;
-
-    formats               = av_mallocz(sizeof(*formats));
-    if (count)
-        formats->formats  = av_malloc(sizeof(*formats->formats) * count);
-    formats->nb_formats = count;
-    memcpy(formats->formats, fmts, sizeof(*formats->formats) * count);
-
-    return formats;
-}
-
-#define ADD_FORMAT(f, fmt, type, list, nb)                  \
-do {                                                        \
-    type *fmts;                                             \
-                                                            \
-    if (!(*f) && !(*f = av_mallocz(sizeof(**f))))           \
-        return AVERROR(ENOMEM);                             \
-                                                            \
-    fmts = av_realloc((*f)->list,                           \
-                      sizeof(*(*f)->list) * ((*f)->nb + 1));\
-    if (!fmts)                                              \
-        return AVERROR(ENOMEM);                             \
-                                                            \
-    (*f)->list = fmts;                                      \
-    (*f)->list[(*f)->nb++] = fmt;                           \
-    return 0;                                               \
-} while (0)
-
-int ff_add_format(AVFilterFormats **avff, int fmt)
-{
-    ADD_FORMAT(avff, fmt, int, formats, nb_formats);
-}
-
-int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout)
-{
-    ADD_FORMAT(l, channel_layout, uint64_t, channel_layouts, nb_channel_layouts);
-}
-
-AVFilterFormats *ff_all_formats(enum AVMediaType type)
-{
-    AVFilterFormats *ret = NULL;
-    int fmt;
-    int num_formats = type == AVMEDIA_TYPE_VIDEO ? AV_PIX_FMT_NB    :
-                      type == AVMEDIA_TYPE_AUDIO ? AV_SAMPLE_FMT_NB : 0;
-
-    for (fmt = 0; fmt < num_formats; fmt++) {
-        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
-        if ((type != AVMEDIA_TYPE_VIDEO) ||
-            (type == AVMEDIA_TYPE_VIDEO && !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)))
-            ff_add_format(&ret, fmt);
-    }
-
-    return ret;
-}
-
-AVFilterFormats *ff_planar_sample_fmts(void)
-{
-    AVFilterFormats *ret = NULL;
-    int fmt;
-
-    for (fmt = 0; fmt < AV_SAMPLE_FMT_NB; fmt++)
-        if (av_sample_fmt_is_planar(fmt))
-            ff_add_format(&ret, fmt);
-
-    return ret;
-}
-
-AVFilterFormats *ff_all_samplerates(void)
-{
-    AVFilterFormats *ret = av_mallocz(sizeof(*ret));
-    return ret;
-}
-
-AVFilterChannelLayouts *ff_all_channel_layouts(void)
-{
-    AVFilterChannelLayouts *ret = av_mallocz(sizeof(*ret));
-    return ret;
-}
-
-#define FORMATS_REF(f, ref)                                          \
-do {                                                                 \
-    *ref = f;                                                        \
-    f->refs = av_realloc(f->refs, sizeof(*f->refs) * ++f->refcount); \
-    f->refs[f->refcount-1] = ref;                                    \
-} while (0)
-
-void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
-{
-    FORMATS_REF(f, ref);
-}
-
-void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
-{
-    FORMATS_REF(f, ref);
-}
-
-#define FIND_REF_INDEX(ref, idx)            \
-do {                                        \
-    int i;                                  \
-    for (i = 0; i < (*ref)->refcount; i ++) \
-        if((*ref)->refs[i] == ref) {        \
-            idx = i;                        \
-            break;                          \
-        }                                   \
-} while (0)
-
-#define FORMATS_UNREF(ref, list)                                   \
-do {                                                               \
-    int idx = -1;                                                  \
-                                                                   \
-    if (!*ref)                                                     \
-        return;                                                    \
-                                                                   \
-    FIND_REF_INDEX(ref, idx);                                      \
-                                                                   \
-    if (idx >= 0)                                                  \
-        memmove((*ref)->refs + idx, (*ref)->refs + idx + 1,        \
-            sizeof(*(*ref)->refs) * ((*ref)->refcount - idx - 1)); \
-                                                                   \
-    if(!--(*ref)->refcount) {                                      \
-        av_free((*ref)->list);                                     \
-        av_free((*ref)->refs);                                     \
-        av_free(*ref);                                             \
-    }                                                              \
-    *ref = NULL;                                                   \
-} while (0)
-
-void ff_formats_unref(AVFilterFormats **ref)
-{
-    FORMATS_UNREF(ref, formats);
-}
-
-void ff_channel_layouts_unref(AVFilterChannelLayouts **ref)
-{
-    FORMATS_UNREF(ref, channel_layouts);
-}
-
-#define FORMATS_CHANGEREF(oldref, newref)       \
-do {                                            \
-    int idx = -1;                               \
-                                                \
-    FIND_REF_INDEX(oldref, idx);                \
-                                                \
-    if (idx >= 0) {                             \
-        (*oldref)->refs[idx] = newref;          \
-        *newref = *oldref;                      \
-        *oldref = NULL;                         \
-    }                                           \
-} while (0)
-
-void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref,
-                                  AVFilterChannelLayouts **newref)
-{
-    FORMATS_CHANGEREF(oldref, newref);
-}
-
-void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref)
-{
-    FORMATS_CHANGEREF(oldref, newref);
-}
-
-#define SET_COMMON_FORMATS(ctx, fmts, in_fmts, out_fmts, ref, list) \
-{                                                                   \
-    int count = 0, i;                                               \
-                                                                    \
-    for (i = 0; i < ctx->nb_inputs; i++) {                          \
-        if (ctx->inputs[i]) {                                       \
-            ref(fmts, &ctx->inputs[i]->out_fmts);                   \
-            count++;                                                \
-        }                                                           \
-    }                                                               \
-    for (i = 0; i < ctx->nb_outputs; i++) {                         \
-        if (ctx->outputs[i]) {                                      \
-            ref(fmts, &ctx->outputs[i]->in_fmts);                   \
-            count++;                                                \
-        }                                                           \
-    }                                                               \
-                                                                    \
-    if (!count) {                                                   \
-        av_freep(&fmts->list);                                      \
-        av_freep(&fmts->refs);                                      \
-        av_freep(&fmts);                                            \
-    }                                                               \
-}
-
-void ff_set_common_channel_layouts(AVFilterContext *ctx,
-                                   AVFilterChannelLayouts *layouts)
-{
-    SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts,
-                       ff_channel_layouts_ref, channel_layouts);
-}
-
-void ff_set_common_samplerates(AVFilterContext *ctx,
-                               AVFilterFormats *samplerates)
-{
-    SET_COMMON_FORMATS(ctx, samplerates, in_samplerates, out_samplerates,
-                       ff_formats_ref, formats);
-}
-
-/**
- * A helper for query_formats() which sets all links to the same list of
- * formats. If there are no links hooked to this filter, the list of formats is
- * freed.
- */
-void ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
-{
-    SET_COMMON_FORMATS(ctx, formats, in_formats, out_formats,
-                       ff_formats_ref, formats);
-}
-
-int ff_default_query_formats(AVFilterContext *ctx)
-{
-    enum AVMediaType type = ctx->inputs  && ctx->inputs [0] ? ctx->inputs [0]->type :
-                            ctx->outputs && ctx->outputs[0] ? ctx->outputs[0]->type :
-                            AVMEDIA_TYPE_VIDEO;
-
-    ff_set_common_formats(ctx, ff_all_formats(type));
-    if (type == AVMEDIA_TYPE_AUDIO) {
-        ff_set_common_channel_layouts(ctx, ff_all_channel_layouts());
-        ff_set_common_samplerates(ctx, ff_all_samplerates());
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavfilter/formats.h b/deps/libav/libavfilter/formats.h
deleted file mode 100644
index 2e44792..0000000
--- a/deps/libav/libavfilter/formats.h
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_FORMATS_H
-#define AVFILTER_FORMATS_H
-
-#include "avfilter.h"
-
-/**
- * A list of supported formats for one end of a filter link. This is used
- * during the format negotiation process to try to pick the best format to
- * use to minimize the number of necessary conversions. Each filter gives a
- * list of the formats supported by each input and output pad. The list
- * given for each pad need not be distinct - they may be references to the
- * same list of formats, as is often the case when a filter supports multiple
- * formats, but will always output the same format as it is given in input.
- *
- * In this way, a list of possible input formats and a list of possible
- * output formats are associated with each link. When a set of formats is
- * negotiated over a link, the input and output lists are merged to form a
- * new list containing only the common elements of each list. In the case
- * that there were no common elements, a format conversion is necessary.
- * Otherwise, the lists are merged, and all other links which reference
- * either of the format lists involved in the merge are also affected.
- *
- * For example, consider the filter chain:
- * filter (a) --> (b) filter (b) --> (c) filter
- *
- * where the letters in parenthesis indicate a list of formats supported on
- * the input or output of the link. Suppose the lists are as follows:
- * (a) = {A, B}
- * (b) = {A, B, C}
- * (c) = {B, C}
- *
- * First, the first link's lists are merged, yielding:
- * filter (a) --> (a) filter (a) --> (c) filter
- *
- * Notice that format list (b) now refers to the same list as filter list (a).
- * Next, the lists for the second link are merged, yielding:
- * filter (a) --> (a) filter (a) --> (a) filter
- *
- * where (a) = {B}.
- *
- * Unfortunately, when the format lists at the two ends of a link are merged,
- * we must ensure that all links which reference either pre-merge format list
- * get updated as well. Therefore, we have the format list structure store a
- * pointer to each of the pointers to itself.
- */
-struct AVFilterFormats {
-    unsigned nb_formats;        ///< number of formats
-    int *formats;               ///< list of media formats
-
-    unsigned refcount;          ///< number of references to this list
-    struct AVFilterFormats ***refs; ///< references to this list
-};
-
-typedef struct AVFilterChannelLayouts {
-    uint64_t *channel_layouts;  ///< list of channel layouts
-    int    nb_channel_layouts;  ///< number of channel layouts
-
-    unsigned refcount;          ///< number of references to this list
-    struct AVFilterChannelLayouts ***refs; ///< references to this list
-} AVFilterChannelLayouts;
-
-/**
- * Return a channel layouts/samplerates list which contains the intersection of
- * the layouts/samplerates of a and b. Also, all the references of a, all the
- * references of b, and a and b themselves will be deallocated.
- *
- * If a and b do not share any common elements, neither is modified, and NULL
- * is returned.
- */
-AVFilterChannelLayouts *ff_merge_channel_layouts(AVFilterChannelLayouts *a,
-                                                 AVFilterChannelLayouts *b);
-AVFilterFormats *ff_merge_samplerates(AVFilterFormats *a,
-                                      AVFilterFormats *b);
-
-/**
- * Construct an empty AVFilterChannelLayouts/AVFilterFormats struct --
- * representing any channel layout/sample rate.
- */
-AVFilterChannelLayouts *ff_all_channel_layouts(void);
-AVFilterFormats *ff_all_samplerates(void);
-
-/**
- * A helper for query_formats() which sets all links to the same list of channel
- * layouts/sample rates. If there are no links hooked to this filter, the list
- * is freed.
- */
-void ff_set_common_channel_layouts(AVFilterContext *ctx,
-                                   AVFilterChannelLayouts *layouts);
-void ff_set_common_samplerates(AVFilterContext *ctx,
-                               AVFilterFormats *samplerates);
-
-/**
- * A helper for query_formats() which sets all links to the same list of
- * formats. If there are no links hooked to this filter, the list of formats is
- * freed.
- */
-void ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats);
-
-int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout);
-
-/**
- * Add *ref as a new reference to f.
- */
-void ff_channel_layouts_ref(AVFilterChannelLayouts *f,
-                            AVFilterChannelLayouts **ref);
-
-/**
- * Remove a reference to a channel layouts list.
- */
-void ff_channel_layouts_unref(AVFilterChannelLayouts **ref);
-
-void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref,
-                                  AVFilterChannelLayouts **newref);
-
-int ff_default_query_formats(AVFilterContext *ctx);
-
-
-/**
- * Create a list of supported formats. This is intended for use in
- * AVFilter->query_formats().
- *
- * @param fmts list of media formats, terminated by -1
- * @return the format list, with no existing references
- */
-AVFilterFormats *ff_make_format_list(const int *fmts);
-
-/**
- * Add fmt to the list of media formats contained in *avff.
- * If *avff is NULL the function allocates the filter formats struct
- * and puts its pointer in *avff.
- *
- * @return a non negative value in case of success, or a negative
- * value corresponding to an AVERROR code in case of error
- */
-int ff_add_format(AVFilterFormats **avff, int fmt);
-
-/**
- * Return a list of all formats supported by Libav for the given media type.
- */
-AVFilterFormats *ff_all_formats(enum AVMediaType type);
-
-/**
- * Construct a formats list containing all planar sample formats.
- */
-AVFilterFormats *ff_planar_sample_fmts(void);
-
-/**
- * Return a format list which contains the intersection of the formats of
- * a and b. Also, all the references of a, all the references of b, and
- * a and b themselves will be deallocated.
- *
- * If a and b do not share any common formats, neither is modified, and NULL
- * is returned.
- */
-AVFilterFormats *ff_merge_formats(AVFilterFormats *a, AVFilterFormats *b);
-
-/**
- * Add *ref as a new reference to formats.
- * That is the pointers will point like in the ascii art below:
- *   ________
- *  |formats |<--------.
- *  |  ____  |     ____|___________________
- *  | |refs| |    |  __|_
- *  | |* * | |    | |  | |  AVFilterLink
- *  | |* *--------->|*ref|
- *  | |____| |    | |____|
- *  |________|    |________________________
- */
-void ff_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref);
-
-/**
- * If *ref is non-NULL, remove *ref as a reference to the format list
- * it currently points to, deallocates that list if this was the last
- * reference, and sets *ref to NULL.
- *
- *         Before                                 After
- *   ________                               ________         NULL
- *  |formats |<--------.                   |formats |         ^
- *  |  ____  |     ____|________________   |  ____  |     ____|________________
- *  | |refs| |    |  __|_                  | |refs| |    |  __|_
- *  | |* * | |    | |  | |  AVFilterLink   | |* * | |    | |  | |  AVFilterLink
- *  | |* *--------->|*ref|                 | |*   | |    | |*ref|
- *  | |____| |    | |____|                 | |____| |    | |____|
- *  |________|    |_____________________   |________|    |_____________________
- */
-void ff_formats_unref(AVFilterFormats **ref);
-
-/**
- *
- *         Before                                 After
- *   ________                         ________
- *  |formats |<---------.            |formats |<---------.
- *  |  ____  |       ___|___         |  ____  |       ___|___
- *  | |refs| |      |   |   |        | |refs| |      |   |   |   NULL
- *  | |* *--------->|*oldref|        | |* *--------->|*newref|     ^
- *  | |* * | |      |_______|        | |* * | |      |_______|  ___|___
- *  | |____| |                       | |____| |                |   |   |
- *  |________|                       |________|                |*oldref|
- *                                                             |_______|
- */
-void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref);
-
-#endif /* AVFILTER_FORMATS_H */
diff --git a/deps/libav/libavfilter/gradfun.h b/deps/libav/libavfilter/gradfun.h
deleted file mode 100644
index f6f7311..0000000
--- a/deps/libav/libavfilter/gradfun.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2010 Nolan Lum <nol888 at gmail.com>
- * Copyright (c) 2009 Loren Merritt <lorenm at u.washington.edu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_GRADFUN_H
-#define AVFILTER_GRADFUN_H
-
-#include "avfilter.h"
-
-/// Holds instance-specific information for gradfun.
-typedef struct GradFunContext {
-    const AVClass *class;
-    float strength;
-    int thresh;    ///< threshold for gradient algorithm
-    int radius;    ///< blur radius
-    int chroma_w;  ///< width of the chroma planes
-    int chroma_h;  ///< weight of the chroma planes
-    int chroma_r;  ///< blur radius for the chroma planes
-    uint16_t *buf; ///< holds image data for blur algorithm passed into filter.
-    /// DSP functions.
-    void (*filter_line) (uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers);
-    void (*blur_line) (uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width);
-} GradFunContext;
-
-void ff_gradfun_init_x86(GradFunContext *gf);
-
-void ff_gradfun_filter_line_c(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers);
-void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width);
-
-#endif /* AVFILTER_GRADFUN_H */
diff --git a/deps/libav/libavfilter/graphparser.c b/deps/libav/libavfilter/graphparser.c
deleted file mode 100644
index e20dd62..0000000
--- a/deps/libav/libavfilter/graphparser.c
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
- * filter graph parser
- * Copyright (c) 2008 Vitor Sessak
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/mem.h"
-#include "avfilter.h"
-
-#define WHITESPACES " \n\t"
-
-/**
- * Link two filters together.
- *
- * @see avfilter_link()
- */
-static int link_filter(AVFilterContext *src, int srcpad,
-                       AVFilterContext *dst, int dstpad,
-                       void *log_ctx)
-{
-    int ret;
-    if ((ret = avfilter_link(src, srcpad, dst, dstpad))) {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "Cannot create the link %s:%d -> %s:%d\n",
-               src->filter->name, srcpad, dst->filter->name, dstpad);
-        return ret;
-    }
-
-    return 0;
-}
-
-/**
- * Parse the name of a link, which has the format "[linkname]".
- *
- * @return a pointer (that need to be freed after use) to the name
- * between parenthesis
- */
-static char *parse_link_name(const char **buf, void *log_ctx)
-{
-    const char *start = *buf;
-    char *name;
-    (*buf)++;
-
-    name = av_get_token(buf, "]");
-
-    if (!name[0]) {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "Bad (empty?) label found in the following: \"%s\".\n", start);
-        goto fail;
-    }
-
-    if (*(*buf)++ != ']') {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "Mismatched '[' found in the following: \"%s\".\n", start);
-    fail:
-        av_freep(&name);
-    }
-
-    return name;
-}
-
-/**
- * Create an instance of a filter, initialize and insert it in the
- * filtergraph in *ctx.
- *
- * @param filt_ctx put here a filter context in case of successful creation and configuration, NULL otherwise.
- * @param ctx the filtergraph context
- * @param index an index which is supposed to be unique for each filter instance added to the filtergraph
- * @param filt_name the name of the filter to create
- * @param args the arguments provided to the filter during its initialization
- * @param log_ctx the log context to use
- * @return 0 in case of success, a negative AVERROR code otherwise
- */
-static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index,
-                         const char *filt_name, const char *args, void *log_ctx)
-{
-    AVFilter *filt;
-    char inst_name[30];
-    char tmp_args[256];
-    int ret;
-
-    snprintf(inst_name, sizeof(inst_name), "Parsed filter %d %s", index, filt_name);
-
-    filt = avfilter_get_by_name(filt_name);
-
-    if (!filt) {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "No such filter: '%s'\n", filt_name);
-        return AVERROR(EINVAL);
-    }
-
-    *filt_ctx = avfilter_graph_alloc_filter(ctx, filt, inst_name);
-    if (!*filt_ctx) {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "Error creating filter '%s'\n", filt_name);
-        return AVERROR(ENOMEM);
-    }
-
-    if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") &&
-        ctx->scale_sws_opts) {
-        snprintf(tmp_args, sizeof(tmp_args), "%s:%s",
-                 args, ctx->scale_sws_opts);
-        args = tmp_args;
-    }
-
-    ret = avfilter_init_str(*filt_ctx, args);
-    if (ret < 0) {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "Error initializing filter '%s'", filt_name);
-        if (args)
-            av_log(log_ctx, AV_LOG_ERROR, " with args '%s'", args);
-        av_log(log_ctx, AV_LOG_ERROR, "\n");
-        avfilter_free(*filt_ctx);
-        return ret;
-    }
-
-    return 0;
-}
-
-/**
- * Parse a string of the form FILTER_NAME[=PARAMS], and create a
- * corresponding filter instance which is added to graph with
- * create_filter().
- *
- * @param filt_ctx Pointer that is set to the created and configured filter
- *                 context on success, set to NULL on failure.
- * @param filt_ctx put here a pointer to the created filter context on
- * success, NULL otherwise
- * @param buf pointer to the buffer to parse, *buf will be updated to
- * point to the char next after the parsed string
- * @param index an index which is assigned to the created filter
- * instance, and which is supposed to be unique for each filter
- * instance added to the filtergraph
- * @return 0 in case of success, a negative AVERROR code otherwise
- */
-static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGraph *graph,
-                        int index, void *log_ctx)
-{
-    char *opts = NULL;
-    char *name = av_get_token(buf, "=,;[\n");
-    int ret;
-
-    if (**buf == '=') {
-        (*buf)++;
-        opts = av_get_token(buf, "[],;\n");
-    }
-
-    ret = create_filter(filt_ctx, graph, index, name, opts, log_ctx);
-    av_free(name);
-    av_free(opts);
-    return ret;
-}
-
-AVFilterInOut *avfilter_inout_alloc(void)
-{
-    return av_mallocz(sizeof(AVFilterInOut));
-}
-
-void avfilter_inout_free(AVFilterInOut **inout)
-{
-    while (*inout) {
-        AVFilterInOut *next = (*inout)->next;
-        av_freep(&(*inout)->name);
-        av_freep(inout);
-        *inout = next;
-    }
-}
-
-static AVFilterInOut *extract_inout(const char *label, AVFilterInOut **links)
-{
-    AVFilterInOut *ret;
-
-    while (*links && (!(*links)->name || strcmp((*links)->name, label)))
-        links = &((*links)->next);
-
-    ret = *links;
-
-    if (ret) {
-        *links = ret->next;
-        ret->next = NULL;
-    }
-
-    return ret;
-}
-
-static void insert_inout(AVFilterInOut **inouts, AVFilterInOut *element)
-{
-    element->next = *inouts;
-    *inouts = element;
-}
-
-static void append_inout(AVFilterInOut **inouts, AVFilterInOut **element)
-{
-    while (*inouts && (*inouts)->next)
-        inouts = &((*inouts)->next);
-
-    if (!*inouts)
-        *inouts = *element;
-    else
-        (*inouts)->next = *element;
-    *element = NULL;
-}
-
-static int link_filter_inouts(AVFilterContext *filt_ctx,
-                              AVFilterInOut **curr_inputs,
-                              AVFilterInOut **open_inputs, void *log_ctx)
-{
-    int pad, ret;
-
-    for (pad = 0; pad < filt_ctx->nb_inputs; pad++) {
-        AVFilterInOut *p = *curr_inputs;
-
-        if (p) {
-            *curr_inputs = (*curr_inputs)->next;
-            p->next = NULL;
-        } else if (!(p = av_mallocz(sizeof(*p))))
-            return AVERROR(ENOMEM);
-
-        if (p->filter_ctx) {
-            ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, log_ctx);
-            av_free(p->name);
-            av_free(p);
-            if (ret < 0)
-                return ret;
-        } else {
-            p->filter_ctx = filt_ctx;
-            p->pad_idx = pad;
-            append_inout(open_inputs, &p);
-        }
-    }
-
-    if (*curr_inputs) {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "Too many inputs specified for the \"%s\" filter.\n",
-               filt_ctx->filter->name);
-        return AVERROR(EINVAL);
-    }
-
-    pad = filt_ctx->nb_outputs;
-    while (pad--) {
-        AVFilterInOut *currlinkn = av_mallocz(sizeof(AVFilterInOut));
-        if (!currlinkn)
-            return AVERROR(ENOMEM);
-        currlinkn->filter_ctx  = filt_ctx;
-        currlinkn->pad_idx = pad;
-        insert_inout(curr_inputs, currlinkn);
-    }
-
-    return 0;
-}
-
-static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs,
-                        AVFilterInOut **open_outputs, void *log_ctx)
-{
-    AVFilterInOut *parsed_inputs = NULL;
-    int pad = 0;
-
-    while (**buf == '[') {
-        char *name = parse_link_name(buf, log_ctx);
-        AVFilterInOut *match;
-
-        if (!name)
-            return AVERROR(EINVAL);
-
-        /* First check if the label is not in the open_outputs list */
-        match = extract_inout(name, open_outputs);
-
-        if (match) {
-            av_free(name);
-        } else {
-            /* Not in the list, so add it as an input */
-            if (!(match = av_mallocz(sizeof(AVFilterInOut)))) {
-                av_free(name);
-                return AVERROR(ENOMEM);
-            }
-            match->name    = name;
-            match->pad_idx = pad;
-        }
-
-        append_inout(&parsed_inputs, &match);
-
-        *buf += strspn(*buf, WHITESPACES);
-        pad++;
-    }
-
-    append_inout(&parsed_inputs, curr_inputs);
-    *curr_inputs = parsed_inputs;
-
-    return pad;
-}
-
-static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
-                         AVFilterInOut **open_inputs,
-                         AVFilterInOut **open_outputs, void *log_ctx)
-{
-    int ret, pad = 0;
-
-    while (**buf == '[') {
-        char *name = parse_link_name(buf, log_ctx);
-        AVFilterInOut *match;
-
-        AVFilterInOut *input = *curr_inputs;
-
-        if (!name)
-            return AVERROR(EINVAL);
-
-        if (!input) {
-            av_log(log_ctx, AV_LOG_ERROR,
-                   "No output pad can be associated to link label '%s'.\n", name);
-            av_free(name);
-            return AVERROR(EINVAL);
-        }
-        *curr_inputs = (*curr_inputs)->next;
-
-        /* First check if the label is not in the open_inputs list */
-        match = extract_inout(name, open_inputs);
-
-        if (match) {
-            if ((ret = link_filter(input->filter_ctx, input->pad_idx,
-                                   match->filter_ctx, match->pad_idx, log_ctx)) < 0) {
-                av_free(name);
-                return ret;
-            }
-            av_free(match->name);
-            av_free(name);
-            av_free(match);
-            av_free(input);
-        } else {
-            /* Not in the list, so add the first input as a open_output */
-            input->name = name;
-            insert_inout(open_outputs, input);
-        }
-        *buf += strspn(*buf, WHITESPACES);
-        pad++;
-    }
-
-    return pad;
-}
-
-static int parse_sws_flags(const char **buf, AVFilterGraph *graph)
-{
-    char *p = strchr(*buf, ';');
-
-    if (strncmp(*buf, "sws_flags=", 10))
-        return 0;
-
-    if (!p) {
-        av_log(graph, AV_LOG_ERROR, "sws_flags not terminated with ';'.\n");
-        return AVERROR(EINVAL);
-    }
-
-    *buf += 4;  // keep the 'flags=' part
-
-    av_freep(&graph->scale_sws_opts);
-    if (!(graph->scale_sws_opts = av_mallocz(p - *buf + 1)))
-        return AVERROR(ENOMEM);
-    av_strlcpy(graph->scale_sws_opts, *buf, p - *buf + 1);
-
-    *buf = p + 1;
-    return 0;
-}
-
-int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
-                          AVFilterInOut **inputs,
-                          AVFilterInOut **outputs)
-{
-    int index = 0, ret;
-    char chr = 0;
-
-    AVFilterInOut *curr_inputs = NULL, *open_inputs = NULL, *open_outputs = NULL;
-
-    filters += strspn(filters, WHITESPACES);
-
-    if ((ret = parse_sws_flags(&filters, graph)) < 0)
-        goto fail;
-
-    do {
-        AVFilterContext *filter;
-        filters += strspn(filters, WHITESPACES);
-
-        if ((ret = parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0)
-            goto fail;
-
-        if ((ret = parse_filter(&filter, &filters, graph, index, graph)) < 0)
-            goto fail;
-
-
-        if ((ret = link_filter_inouts(filter, &curr_inputs, &open_inputs, graph)) < 0)
-            goto fail;
-
-        if ((ret = parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,
-                                 graph)) < 0)
-            goto fail;
-
-        filters += strspn(filters, WHITESPACES);
-        chr = *filters++;
-
-        if (chr == ';' && curr_inputs)
-            append_inout(&open_outputs, &curr_inputs);
-        index++;
-    } while (chr == ',' || chr == ';');
-
-    if (chr) {
-        av_log(graph, AV_LOG_ERROR,
-               "Unable to parse graph description substring: \"%s\"\n",
-               filters - 1);
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-
-    append_inout(&open_outputs, &curr_inputs);
-
-    *inputs  = open_inputs;
-    *outputs = open_outputs;
-    return 0;
-
- fail:
-    while (graph->nb_filters)
-        avfilter_free(graph->filters[0]);
-    av_freep(&graph->filters);
-    avfilter_inout_free(&open_inputs);
-    avfilter_inout_free(&open_outputs);
-    avfilter_inout_free(&curr_inputs);
-
-    *inputs  = NULL;
-    *outputs = NULL;
-
-    return ret;
-}
-
-int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
-                         AVFilterInOut *open_inputs,
-                         AVFilterInOut *open_outputs, void *log_ctx)
-{
-    int ret;
-    AVFilterInOut *cur, *match, *inputs = NULL, *outputs = NULL;
-
-    if ((ret = avfilter_graph_parse2(graph, filters, &inputs, &outputs)) < 0)
-        goto fail;
-
-    /* First input can be omitted if it is "[in]" */
-    if (inputs && !inputs->name)
-        inputs->name = av_strdup("in");
-    for (cur = inputs; cur; cur = cur->next) {
-        if (!cur->name) {
-              av_log(log_ctx, AV_LOG_ERROR,
-                     "Not enough inputs specified for the \"%s\" filter.\n",
-                     cur->filter_ctx->filter->name);
-              ret = AVERROR(EINVAL);
-              goto fail;
-        }
-        if (!(match = extract_inout(cur->name, &open_outputs)))
-            continue;
-        ret = avfilter_link(match->filter_ctx, match->pad_idx,
-                            cur->filter_ctx,   cur->pad_idx);
-        avfilter_inout_free(&match);
-        if (ret < 0)
-            goto fail;
-    }
-
-    /* Last output can be omitted if it is "[out]" */
-    if (outputs && !outputs->name)
-        outputs->name = av_strdup("out");
-    for (cur = outputs; cur; cur = cur->next) {
-        if (!cur->name) {
-            av_log(log_ctx, AV_LOG_ERROR,
-                   "Invalid filterchain containing an unlabelled output pad: \"%s\"\n",
-                   filters);
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-        if (!(match = extract_inout(cur->name, &open_inputs)))
-            continue;
-        ret = avfilter_link(cur->filter_ctx,   cur->pad_idx,
-                            match->filter_ctx, match->pad_idx);
-        avfilter_inout_free(&match);
-        if (ret < 0)
-            goto fail;
-    }
-
- fail:
-    if (ret < 0) {
-        while (graph->nb_filters)
-            avfilter_free(graph->filters[0]);
-        av_freep(&graph->filters);
-    }
-    avfilter_inout_free(&inputs);
-    avfilter_inout_free(&outputs);
-    avfilter_inout_free(&open_inputs);
-    avfilter_inout_free(&open_outputs);
-    return ret;
-}
diff --git a/deps/libav/libavfilter/internal.h b/deps/libav/libavfilter/internal.h
deleted file mode 100644
index 6a752dc..0000000
--- a/deps/libav/libavfilter/internal.h
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_INTERNAL_H
-#define AVFILTER_INTERNAL_H
-
-/**
- * @file
- * internal API functions
- */
-
-#include "libavutil/internal.h"
-#include "avfilter.h"
-#include "thread.h"
-#include "version.h"
-
-#if !FF_API_AVFILTERPAD_PUBLIC
-/**
- * A filter pad used for either input or output.
- */
-struct AVFilterPad {
-    /**
-     * Pad name. The name is unique among inputs and among outputs, but an
-     * input may have the same name as an output. This may be NULL if this
-     * pad has no need to ever be referenced by name.
-     */
-    const char *name;
-
-    /**
-     * AVFilterPad type.
-     */
-    enum AVMediaType type;
-
-    /**
-     * Callback function to get a video buffer. If NULL, the filter system will
-     * use avfilter_default_get_video_buffer().
-     *
-     * Input video pads only.
-     */
-    AVFrame *(*get_video_buffer)(AVFilterLink *link, int w, int h);
-
-    /**
-     * Callback function to get an audio buffer. If NULL, the filter system will
-     * use avfilter_default_get_audio_buffer().
-     *
-     * Input audio pads only.
-     */
-    AVFrame *(*get_audio_buffer)(AVFilterLink *link, int nb_samples);
-
-    /**
-     * Filtering callback. This is where a filter receives a frame with
-     * audio/video data and should do its processing.
-     *
-     * Input pads only.
-     *
-     * @return >= 0 on success, a negative AVERROR on error. This function
-     * must ensure that samplesref is properly unreferenced on error if it
-     * hasn't been passed on to another filter.
-     */
-    int (*filter_frame)(AVFilterLink *link, AVFrame *frame);
-
-    /**
-     * Frame poll callback. This returns the number of immediately available
-     * samples. It should return a positive value if the next request_frame()
-     * is guaranteed to return one frame (with no delay).
-     *
-     * Defaults to just calling the source poll_frame() method.
-     *
-     * Output pads only.
-     */
-    int (*poll_frame)(AVFilterLink *link);
-
-    /**
-     * Frame request callback. A call to this should result in at least one
-     * frame being output over the given link. This should return zero on
-     * success, and another value on error.
-     *
-     * Output pads only.
-     */
-    int (*request_frame)(AVFilterLink *link);
-
-    /**
-     * Link configuration callback.
-     *
-     * For output pads, this should set the link properties such as
-     * width/height. This should NOT set the format property - that is
-     * negotiated between filters by the filter system using the
-     * query_formats() callback before this function is called.
-     *
-     * For input pads, this should check the properties of the link, and update
-     * the filter's internal state as necessary.
-     *
-     * For both input and output filters, this should return zero on success,
-     * and another value on error.
-     */
-    int (*config_props)(AVFilterLink *link);
-
-    /**
-     * The filter expects a fifo to be inserted on its input link,
-     * typically because it has a delay.
-     *
-     * input pads only.
-     */
-    int needs_fifo;
-
-    /**
-     * The filter expects writable frames from its input link,
-     * duplicating data buffers if needed.
-     *
-     * input pads only.
-     */
-    int needs_writable;
-};
-#endif
-
-struct AVFilterGraphInternal {
-    void *thread;
-    avfilter_execute_func *thread_execute;
-};
-
-struct AVFilterInternal {
-    avfilter_execute_func *execute;
-};
-
-#if FF_API_AVFILTERBUFFER
-/** default handler for freeing audio/video buffer when there are no references left */
-void ff_avfilter_default_free_buffer(AVFilterBuffer *buf);
-#endif
-
-/** Tell is a format is contained in the provided list terminated by -1. */
-int ff_fmt_is_in(int fmt, const int *fmts);
-
-#define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
-
-void ff_dlog_link(void *ctx, AVFilterLink *link, int end);
-
-/**
- * Insert a new pad.
- *
- * @param idx Insertion point. Pad is inserted at the end if this point
- *            is beyond the end of the list of pads.
- * @param count Pointer to the number of pads in the list
- * @param padidx_off Offset within an AVFilterLink structure to the element
- *                   to increment when inserting a new pad causes link
- *                   numbering to change
- * @param pads Pointer to the pointer to the beginning of the list of pads
- * @param links Pointer to the pointer to the beginning of the list of links
- * @param newpad The new pad to add. A copy is made when adding.
- */
-void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
-                   AVFilterPad **pads, AVFilterLink ***links,
-                   AVFilterPad *newpad);
-
-/** Insert a new input pad for the filter. */
-static inline void ff_insert_inpad(AVFilterContext *f, unsigned index,
-                                   AVFilterPad *p)
-{
-    ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
-                  &f->input_pads, &f->inputs, p);
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
-    f->input_count = f->nb_inputs;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-}
-
-/** Insert a new output pad for the filter. */
-static inline void ff_insert_outpad(AVFilterContext *f, unsigned index,
-                                    AVFilterPad *p)
-{
-    ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
-                  &f->output_pads, &f->outputs, p);
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
-    f->output_count = f->nb_outputs;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-}
-
-/**
- * Poll a frame from the filter chain.
- *
- * @param  link the input link
- * @return the number of immediately available frames, a negative
- * number in case of error
- */
-int ff_poll_frame(AVFilterLink *link);
-
-/**
- * Request an input frame from the filter at the other end of the link.
- *
- * @param link the input link
- * @return     zero on success
- */
-int ff_request_frame(AVFilterLink *link);
-
-/**
- * Send a frame of data to the next filter.
- *
- * @param link   the output link over which the data is being sent
- * @param frame a reference to the buffer of data being sent. The
- *              receiving filter will free this reference when it no longer
- *              needs it or pass it on to the next filter.
- *
- * @return >= 0 on success, a negative AVERROR on error. The receiving filter
- * is responsible for unreferencing frame in case of error.
- */
-int ff_filter_frame(AVFilterLink *link, AVFrame *frame);
-
-/**
- * Allocate a new filter context and return it.
- *
- * @param filter what filter to create an instance of
- * @param inst_name name to give to the new filter context
- *
- * @return newly created filter context or NULL on failure
- */
-AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name);
-
-/**
- * Remove a filter from a graph;
- */
-void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter);
-
-#endif /* AVFILTER_INTERNAL_H */
diff --git a/deps/libav/libavfilter/libavfilter.v b/deps/libav/libavfilter/libavfilter.v
deleted file mode 100644
index 83e8887..0000000
--- a/deps/libav/libavfilter/libavfilter.v
+++ /dev/null
@@ -1,4 +0,0 @@
-LIBAVFILTER_$MAJOR {
-        global: avfilter_*; av_*;
-        local: *;
-};
diff --git a/deps/libav/libavfilter/pthread.c b/deps/libav/libavfilter/pthread.c
deleted file mode 100644
index dd3b174..0000000
--- a/deps/libav/libavfilter/pthread.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Libavfilter multithreading support
- */
-
-#include "config.h"
-
-#include "libavutil/common.h"
-#include "libavutil/cpu.h"
-#include "libavutil/mem.h"
-
-#include "avfilter.h"
-#include "internal.h"
-#include "thread.h"
-
-#if HAVE_PTHREADS
-#include <pthread.h>
-#elif HAVE_W32THREADS
-#include "compat/w32pthreads.h"
-#endif
-
-typedef struct ThreadContext {
-    AVFilterGraph *graph;
-
-    int nb_threads;
-    pthread_t *workers;
-    avfilter_action_func *func;
-
-    /* per-execute perameters */
-    AVFilterContext *ctx;
-    void *arg;
-    int   *rets;
-    int nb_rets;
-    int nb_jobs;
-
-    pthread_cond_t last_job_cond;
-    pthread_cond_t current_job_cond;
-    pthread_mutex_t current_job_lock;
-    int current_job;
-    unsigned int current_execute;
-    int done;
-} ThreadContext;
-
-static void* attribute_align_arg worker(void *v)
-{
-    ThreadContext *c = v;
-    int our_job      = c->nb_jobs;
-    int nb_threads   = c->nb_threads;
-    unsigned int last_execute = 0;
-    int self_id;
-
-    pthread_mutex_lock(&c->current_job_lock);
-    self_id = c->current_job++;
-    for (;;) {
-        while (our_job >= c->nb_jobs) {
-            if (c->current_job == nb_threads + c->nb_jobs)
-                pthread_cond_signal(&c->last_job_cond);
-
-            while (last_execute == c->current_execute && !c->done)
-                pthread_cond_wait(&c->current_job_cond, &c->current_job_lock);
-            last_execute = c->current_execute;
-            our_job = self_id;
-
-            if (c->done) {
-                pthread_mutex_unlock(&c->current_job_lock);
-                return NULL;
-            }
-        }
-        pthread_mutex_unlock(&c->current_job_lock);
-
-        c->rets[our_job % c->nb_rets] = c->func(c->ctx, c->arg, our_job, c->nb_jobs);
-
-        pthread_mutex_lock(&c->current_job_lock);
-        our_job = c->current_job++;
-    }
-}
-
-static void slice_thread_uninit(ThreadContext *c)
-{
-    int i;
-
-    pthread_mutex_lock(&c->current_job_lock);
-    c->done = 1;
-    pthread_cond_broadcast(&c->current_job_cond);
-    pthread_mutex_unlock(&c->current_job_lock);
-
-    for (i = 0; i < c->nb_threads; i++)
-         pthread_join(c->workers[i], NULL);
-
-    pthread_mutex_destroy(&c->current_job_lock);
-    pthread_cond_destroy(&c->current_job_cond);
-    pthread_cond_destroy(&c->last_job_cond);
-    av_freep(&c->workers);
-}
-
-static void slice_thread_park_workers(ThreadContext *c)
-{
-    while (c->current_job != c->nb_threads + c->nb_jobs)
-        pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);
-    pthread_mutex_unlock(&c->current_job_lock);
-}
-
-static int thread_execute(AVFilterContext *ctx, avfilter_action_func *func,
-                          void *arg, int *ret, int nb_jobs)
-{
-    ThreadContext *c = ctx->graph->internal->thread;
-    int dummy_ret;
-
-    if (nb_jobs <= 0)
-        return 0;
-
-    pthread_mutex_lock(&c->current_job_lock);
-
-    c->current_job = c->nb_threads;
-    c->nb_jobs     = nb_jobs;
-    c->ctx         = ctx;
-    c->arg         = arg;
-    c->func        = func;
-    if (ret) {
-        c->rets    = ret;
-        c->nb_rets = nb_jobs;
-    } else {
-        c->rets    = &dummy_ret;
-        c->nb_rets = 1;
-    }
-    c->current_execute++;
-
-    pthread_cond_broadcast(&c->current_job_cond);
-
-    slice_thread_park_workers(c);
-
-    return 0;
-}
-
-static int thread_init_internal(ThreadContext *c, int nb_threads)
-{
-    int i, ret;
-
-    if (!nb_threads) {
-        int nb_cpus = av_cpu_count();
-        av_log(c->graph, AV_LOG_DEBUG, "Detected %d logical cores.\n", nb_cpus);
-        // use number of cores + 1 as thread count if there is more than one
-        if (nb_cpus > 1)
-            nb_threads = nb_cpus + 1;
-        else
-            nb_threads = 1;
-    }
-
-    if (nb_threads <= 1)
-        return 1;
-
-    c->nb_threads = nb_threads;
-    c->workers = av_mallocz(sizeof(*c->workers) * nb_threads);
-    if (!c->workers)
-        return AVERROR(ENOMEM);
-
-    c->current_job = 0;
-    c->nb_jobs     = 0;
-    c->done        = 0;
-
-    pthread_cond_init(&c->current_job_cond, NULL);
-    pthread_cond_init(&c->last_job_cond,    NULL);
-
-    pthread_mutex_init(&c->current_job_lock, NULL);
-    pthread_mutex_lock(&c->current_job_lock);
-    for (i = 0; i < nb_threads; i++) {
-        ret = pthread_create(&c->workers[i], NULL, worker, c);
-        if (ret) {
-           pthread_mutex_unlock(&c->current_job_lock);
-           c->nb_threads = i;
-           slice_thread_uninit(c);
-           return AVERROR(ret);
-        }
-    }
-
-    slice_thread_park_workers(c);
-
-    return c->nb_threads;
-}
-
-int ff_graph_thread_init(AVFilterGraph *graph)
-{
-    int ret;
-
-#if HAVE_W32THREADS
-    w32thread_init();
-#endif
-
-    if (graph->nb_threads == 1) {
-        graph->thread_type = 0;
-        return 0;
-    }
-
-    graph->internal->thread = av_mallocz(sizeof(ThreadContext));
-    if (!graph->internal->thread)
-        return AVERROR(ENOMEM);
-
-    ret = thread_init_internal(graph->internal->thread, graph->nb_threads);
-    if (ret <= 1) {
-        av_freep(&graph->internal->thread);
-        graph->thread_type = 0;
-        graph->nb_threads  = 1;
-        return (ret < 0) ? ret : 0;
-    }
-    graph->nb_threads = ret;
-
-    graph->internal->thread_execute = thread_execute;
-
-    return 0;
-}
-
-void ff_graph_thread_free(AVFilterGraph *graph)
-{
-    if (graph->internal->thread)
-        slice_thread_uninit(graph->internal->thread);
-    av_freep(&graph->internal->thread);
-}
diff --git a/deps/libav/libavfilter/setpts.c b/deps/libav/libavfilter/setpts.c
deleted file mode 100644
index be190c0..0000000
--- a/deps/libav/libavfilter/setpts.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Copyright (c) 2010 Stefano Sabatini
- * Copyright (c) 2008 Victor Paesa
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * video presentation timestamp (PTS) modification filter
- */
-
-#include "libavutil/eval.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/time.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-#include "config.h"
-
-static const char *const var_names[] = {
-    "E",           ///< Euler number
-    "INTERLACED",  ///< tell if the current frame is interlaced
-    "N",           ///< frame / sample number (starting at zero)
-    "PHI",         ///< golden ratio
-    "PI",          ///< greek pi
-    "PREV_INPTS",  ///< previous  input PTS
-    "PREV_OUTPTS", ///< previous output PTS
-    "PTS",         ///< original pts in the file of the frame
-    "STARTPTS",    ///< PTS at start of movie
-    "TB",          ///< timebase
-    "RTCTIME",     ///< wallclock (RTC) time in micro seconds
-    "RTCSTART",    ///< wallclock (RTC) time at the start of the movie in micro seconds
-    "S",           //   Number of samples in the current frame
-    "SR",          //   Audio sample rate
-    NULL
-};
-
-enum var_name {
-    VAR_E,
-    VAR_INTERLACED,
-    VAR_N,
-    VAR_PHI,
-    VAR_PI,
-    VAR_PREV_INPTS,
-    VAR_PREV_OUTPTS,
-    VAR_PTS,
-    VAR_STARTPTS,
-    VAR_TB,
-    VAR_RTCTIME,
-    VAR_RTCSTART,
-    VAR_S,
-    VAR_SR,
-    VAR_VARS_NB
-};
-
-typedef struct {
-    const AVClass *class;
-    char *expr_str;
-    AVExpr *expr;
-    double var_values[VAR_VARS_NB];
-} SetPTSContext;
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    SetPTSContext *setpts = ctx->priv;
-    int ret;
-
-    if ((ret = av_expr_parse(&setpts->expr, setpts->expr_str,
-                             var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Error while parsing expression '%s'\n", setpts->expr_str);
-        return ret;
-    }
-
-    setpts->var_values[VAR_E]           = M_E;
-    setpts->var_values[VAR_N]           = 0.0;
-    setpts->var_values[VAR_S]           = 0.0;
-    setpts->var_values[VAR_PHI]         = M_PHI;
-    setpts->var_values[VAR_PI]          = M_PI;
-    setpts->var_values[VAR_PREV_INPTS]  = NAN;
-    setpts->var_values[VAR_PREV_OUTPTS] = NAN;
-    setpts->var_values[VAR_STARTPTS]    = NAN;
-    return 0;
-}
-
-static int config_input(AVFilterLink *inlink)
-{
-    SetPTSContext *setpts = inlink->dst->priv;
-
-    setpts->var_values[VAR_TB] = av_q2d(inlink->time_base);
-    setpts->var_values[VAR_RTCSTART] = av_gettime();
-
-    if (inlink->type == AVMEDIA_TYPE_AUDIO) {
-        setpts->var_values[VAR_SR] = inlink->sample_rate;
-    }
-
-    av_log(inlink->src, AV_LOG_VERBOSE, "TB:%f\n", setpts->var_values[VAR_TB]);
-    return 0;
-}
-
-#define D2TS(d)  (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
-#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    SetPTSContext *setpts = inlink->dst->priv;
-    int64_t in_pts = frame->pts;
-    double d;
-
-    if (isnan(setpts->var_values[VAR_STARTPTS]))
-        setpts->var_values[VAR_STARTPTS] = TS2D(frame->pts);
-
-    setpts->var_values[VAR_PTS       ] = TS2D(frame->pts);
-    setpts->var_values[VAR_RTCTIME   ] = av_gettime();
-
-    if (inlink->type == AVMEDIA_TYPE_VIDEO) {
-        setpts->var_values[VAR_INTERLACED] = frame->interlaced_frame;
-    } else {
-        setpts->var_values[VAR_S] = frame->nb_samples;
-    }
-
-    d = av_expr_eval(setpts->expr, setpts->var_values, NULL);
-    frame->pts = D2TS(d);
-
-#ifdef DEBUG
-    av_log(inlink->dst, AV_LOG_DEBUG,
-           "n:%"PRId64" interlaced:%d pts:%"PRId64" t:%f -> pts:%"PRId64" t:%f\n",
-           (int64_t)setpts->var_values[VAR_N],
-           (int)setpts->var_values[VAR_INTERLACED],
-           in_pts, in_pts * av_q2d(inlink->time_base),
-           frame->pts, frame->pts * av_q2d(inlink->time_base));
-#endif
-
-
-    if (inlink->type == AVMEDIA_TYPE_VIDEO) {
-        setpts->var_values[VAR_N] += 1.0;
-    } else {
-        setpts->var_values[VAR_N] += frame->nb_samples;
-    }
-
-    setpts->var_values[VAR_PREV_INPTS ] = TS2D(in_pts);
-    setpts->var_values[VAR_PREV_OUTPTS] = TS2D(frame->pts);
-    return ff_filter_frame(inlink->dst->outputs[0], frame);
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    SetPTSContext *setpts = ctx->priv;
-    av_expr_free(setpts->expr);
-    setpts->expr = NULL;
-}
-
-#define OFFSET(x) offsetof(SetPTSContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
-    { "expr", "Expression determining the frame timestamp", OFFSET(expr_str), AV_OPT_TYPE_STRING, { .str = "PTS" }, .flags = FLAGS },
-    { NULL },
-};
-
-#if CONFIG_SETPTS_FILTER
-static const AVClass setpts_class = {
-    .class_name = "setpts",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_setpts_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .config_props     = config_input,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_setpts_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_setpts = {
-    .name      = "setpts",
-    .description = NULL_IF_CONFIG_SMALL("Set PTS for the output video frame."),
-    .init      = init,
-    .uninit    = uninit,
-
-    .priv_size = sizeof(SetPTSContext),
-    .priv_class = &setpts_class,
-
-    .inputs    = avfilter_vf_setpts_inputs,
-    .outputs   = avfilter_vf_setpts_outputs,
-};
-#endif
-
-#if CONFIG_ASETPTS_FILTER
-static const AVClass asetpts_class = {
-    .class_name = "asetpts",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad asetpts_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_AUDIO,
-        .get_audio_buffer = ff_null_get_audio_buffer,
-        .config_props     = config_input,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad asetpts_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_AUDIO,
-    },
-    { NULL }
-};
-
-AVFilter ff_af_asetpts = {
-    .name        = "asetpts",
-    .description = NULL_IF_CONFIG_SMALL("Set PTS for the output audio frame."),
-    .init        = init,
-    .uninit      = uninit,
-
-    .priv_size  = sizeof(SetPTSContext),
-    .priv_class = &asetpts_class,
-
-    .inputs    = asetpts_inputs,
-    .outputs   = asetpts_outputs,
-};
-#endif
diff --git a/deps/libav/libavfilter/split.c b/deps/libav/libavfilter/split.c
deleted file mode 100644
index 41395e7..0000000
--- a/deps/libav/libavfilter/split.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * audio and video splitter
- */
-
-#include <stdio.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-
-#include "avfilter.h"
-#include "audio.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct SplitContext {
-    const AVClass *class;
-    int nb_outputs;
-} SplitContext;
-
-static av_cold int split_init(AVFilterContext *ctx)
-{
-    SplitContext *s = ctx->priv;
-    int i;
-
-    for (i = 0; i < s->nb_outputs; i++) {
-        char name[32];
-        AVFilterPad pad = { 0 };
-
-        snprintf(name, sizeof(name), "output%d", i);
-        pad.type = ctx->filter->inputs[0].type;
-        pad.name = av_strdup(name);
-
-        ff_insert_outpad(ctx, i, &pad);
-    }
-
-    return 0;
-}
-
-static av_cold void split_uninit(AVFilterContext *ctx)
-{
-    int i;
-
-    for (i = 0; i < ctx->nb_outputs; i++)
-        av_freep(&ctx->output_pads[i].name);
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    int i, ret = 0;
-
-    for (i = 0; i < ctx->nb_outputs; i++) {
-        AVFrame *buf_out = av_frame_clone(frame);
-        if (!buf_out) {
-            ret = AVERROR(ENOMEM);
-            break;
-        }
-
-        ret = ff_filter_frame(ctx->outputs[i], buf_out);
-        if (ret < 0)
-            break;
-    }
-    av_frame_free(&frame);
-    return ret;
-}
-
-#define OFFSET(x) offsetof(SplitContext, x)
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "outputs", "Number of outputs", OFFSET(nb_outputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, FLAGS },
-    { NULL },
-};
-
-static const AVClass split_class = {
-    .class_name = "split",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVClass asplit_class = {
-    .class_name = "asplit",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_split_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_split = {
-    .name      = "split",
-    .description = NULL_IF_CONFIG_SMALL("Pass on the input to N video outputs."),
-
-    .priv_size  = sizeof(SplitContext),
-    .priv_class = &split_class,
-
-    .init   = split_init,
-    .uninit = split_uninit,
-
-    .inputs    = avfilter_vf_split_inputs,
-    .outputs   = NULL,
-
-    .flags     = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
-};
-
-static const AVFilterPad avfilter_af_asplit_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_AUDIO,
-        .get_audio_buffer = ff_null_get_audio_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_af_asplit = {
-    .name        = "asplit",
-    .description = NULL_IF_CONFIG_SMALL("Pass on the audio input to N audio outputs."),
-
-    .priv_size  = sizeof(SplitContext),
-    .priv_class = &asplit_class,
-
-    .init   = split_init,
-    .uninit = split_uninit,
-
-    .inputs  = avfilter_af_asplit_inputs,
-    .outputs = NULL,
-
-    .flags   = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
-};
diff --git a/deps/libav/libavfilter/thread.h b/deps/libav/libavfilter/thread.h
deleted file mode 100644
index 1cfea3e..0000000
--- a/deps/libav/libavfilter/thread.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_THREAD_H
-#define AVFILTER_THREAD_H
-
-#include "avfilter.h"
-
-int ff_graph_thread_init(AVFilterGraph *graph);
-
-void ff_graph_thread_free(AVFilterGraph *graph);
-
-#endif /* AVFILTER_THREAD_H */
diff --git a/deps/libav/libavfilter/trim.c b/deps/libav/libavfilter/trim.c
deleted file mode 100644
index 2b57540..0000000
--- a/deps/libav/libavfilter/trim.c
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <float.h>
-#include <math.h>
-#include <stdint.h>
-
-#include "config.h"
-
-#include "libavutil/avassert.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "libavutil/log.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-
-#include "audio.h"
-#include "avfilter.h"
-#include "internal.h"
-
-typedef struct TrimContext {
-    const AVClass *class;
-
-    /*
-     * AVOptions
-     */
-    double duration;
-    double start_time, end_time;
-    int64_t start_frame, end_frame;
-    /*
-     * in the link timebase for video,
-     * in 1/samplerate for audio
-     */
-    int64_t start_pts, end_pts;
-    int64_t start_sample, end_sample;
-
-    /*
-     * number of video frames that arrived on this filter so far
-     */
-    int64_t nb_frames;
-    /*
-     * number of audio samples that arrived on this filter so far
-     */
-    int64_t nb_samples;
-    /*
-     * timestamp of the first frame in the output, in the timebase units
-     */
-    int64_t first_pts;
-    /*
-     * duration in the timebase units
-     */
-    int64_t duration_tb;
-
-    int64_t next_pts;
-
-    int eof;
-    int got_output;
-} TrimContext;
-
-static int init(AVFilterContext *ctx)
-{
-    TrimContext *s = ctx->priv;
-
-    s->first_pts = AV_NOPTS_VALUE;
-
-    return 0;
-}
-
-static int config_input(AVFilterLink *inlink)
-{
-    AVFilterContext *ctx = inlink->dst;
-    TrimContext       *s = ctx->priv;
-    AVRational tb = (inlink->type == AVMEDIA_TYPE_VIDEO) ?
-                     inlink->time_base : (AVRational){ 1, inlink->sample_rate };
-
-    if (s->start_time != DBL_MAX) {
-        int64_t start_pts = lrintf(s->start_time / av_q2d(tb));
-        if (s->start_pts == AV_NOPTS_VALUE || start_pts < s->start_pts)
-            s->start_pts = start_pts;
-    }
-    if (s->end_time != DBL_MAX) {
-        int64_t end_pts = lrintf(s->end_time / av_q2d(tb));
-        if (s->end_pts == AV_NOPTS_VALUE || end_pts > s->end_pts)
-            s->end_pts = end_pts;
-    }
-    if (s->duration)
-        s->duration_tb = lrintf(s->duration / av_q2d(tb));
-
-    return 0;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    TrimContext       *s = ctx->priv;
-    int ret;
-
-    s->got_output = 0;
-    while (!s->got_output) {
-        if (s->eof)
-            return AVERROR_EOF;
-
-        ret = ff_request_frame(ctx->inputs[0]);
-        if (ret < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(TrimContext, x)
-#define COMMON_OPTS                                                                                                                                                         \
-    { "start",       "Timestamp in seconds of the first frame that "                                                                                                        \
-        "should be passed",                                              OFFSET(start_time),  AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX },       -DBL_MAX, DBL_MAX,     FLAGS }, \
-    { "end",         "Timestamp in seconds of the first frame that "                                                                                                        \
-        "should be dropped again",                                       OFFSET(end_time),    AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX },       -DBL_MAX, DBL_MAX,     FLAGS }, \
-    { "start_pts",   "Timestamp of the first frame that should be "                                                                                                         \
-       " passed",                                                        OFFSET(start_pts),   AV_OPT_TYPE_INT64,  { .i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, FLAGS }, \
-    { "end_pts",     "Timestamp of the first frame that should be "                                                                                                         \
-        "dropped again",                                                 OFFSET(end_pts),     AV_OPT_TYPE_INT64,  { .i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, FLAGS }, \
-    { "duration",    "Maximum duration of the output in seconds",        OFFSET(duration),    AV_OPT_TYPE_DOUBLE, { .dbl = 0 },                      0,   DBL_MAX, FLAGS },
-
-
-#if CONFIG_TRIM_FILTER
-static int trim_filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    TrimContext       *s = ctx->priv;
-    int drop;
-
-    /* drop everything if EOF has already been returned */
-    if (s->eof) {
-        av_frame_free(&frame);
-        return 0;
-    }
-
-    if (s->start_frame >= 0 || s->start_pts != AV_NOPTS_VALUE) {
-        drop = 1;
-        if (s->start_frame >= 0 && s->nb_frames >= s->start_frame)
-            drop = 0;
-        if (s->start_pts != AV_NOPTS_VALUE && frame->pts != AV_NOPTS_VALUE &&
-            frame->pts >= s->start_pts)
-            drop = 0;
-        if (drop)
-            goto drop;
-    }
-
-    if (s->first_pts == AV_NOPTS_VALUE && frame->pts != AV_NOPTS_VALUE)
-        s->first_pts = frame->pts;
-
-    if (s->end_frame != INT64_MAX || s->end_pts != AV_NOPTS_VALUE || s->duration_tb) {
-        drop = 1;
-
-        if (s->end_frame != INT64_MAX && s->nb_frames < s->end_frame)
-            drop = 0;
-        if (s->end_pts != AV_NOPTS_VALUE && frame->pts != AV_NOPTS_VALUE &&
-            frame->pts < s->end_pts)
-            drop = 0;
-        if (s->duration_tb && frame->pts != AV_NOPTS_VALUE &&
-            frame->pts - s->first_pts < s->duration_tb)
-            drop = 0;
-
-        if (drop) {
-            s->eof = 1;
-            goto drop;
-        }
-    }
-
-    s->nb_frames++;
-    s->got_output = 1;
-
-    return ff_filter_frame(ctx->outputs[0], frame);
-
-drop:
-    s->nb_frames++;
-    av_frame_free(&frame);
-    return 0;
-}
-
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption trim_options[] = {
-    COMMON_OPTS
-    { "start_frame", "Number of the first frame that should be passed "
-        "to the output",                                                 OFFSET(start_frame), AV_OPT_TYPE_INT64,  { .i64 = -1 },       -1, INT64_MAX, FLAGS },
-    { "end_frame",   "Number of the first frame that should be dropped "
-        "again",                                                         OFFSET(end_frame),   AV_OPT_TYPE_INT64,  { .i64 = INT64_MAX }, 0, INT64_MAX, FLAGS },
-    { NULL },
-};
-#undef FLAGS
-
-static const AVClass trim_class = {
-    .class_name = "trim",
-    .item_name  = av_default_item_name,
-    .option     = trim_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad trim_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = trim_filter_frame,
-        .config_props = config_input,
-    },
-    { NULL }
-};
-
-static const AVFilterPad trim_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_trim = {
-    .name        = "trim",
-    .description = NULL_IF_CONFIG_SMALL("Pick one continuous section from the input, drop the rest."),
-
-    .init        = init,
-
-    .priv_size   = sizeof(TrimContext),
-    .priv_class  = &trim_class,
-
-    .inputs      = trim_inputs,
-    .outputs     = trim_outputs,
-};
-#endif // CONFIG_TRIM_FILTER
-
-#if CONFIG_ATRIM_FILTER
-static int atrim_filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    TrimContext       *s = ctx->priv;
-    int64_t start_sample, end_sample = frame->nb_samples;
-    int64_t pts;
-    int drop;
-
-    /* drop everything if EOF has already been returned */
-    if (s->eof) {
-        av_frame_free(&frame);
-        return 0;
-    }
-
-    if (frame->pts != AV_NOPTS_VALUE)
-        pts = av_rescale_q(frame->pts, inlink->time_base,
-                           (AVRational){ 1, inlink->sample_rate });
-    else
-        pts = s->next_pts;
-    s->next_pts = pts + frame->nb_samples;
-
-    /* check if at least a part of the frame is after the start time */
-    if (s->start_sample < 0 && s->start_pts == AV_NOPTS_VALUE) {
-        start_sample = 0;
-    } else {
-        drop = 1;
-        start_sample = frame->nb_samples;
-
-        if (s->start_sample >= 0 &&
-            s->nb_samples + frame->nb_samples > s->start_sample) {
-            drop         = 0;
-            start_sample = FFMIN(start_sample, s->start_sample - s->nb_samples);
-        }
-
-        if (s->start_pts != AV_NOPTS_VALUE && pts != AV_NOPTS_VALUE &&
-            pts + frame->nb_samples > s->start_pts) {
-            drop = 0;
-            start_sample = FFMIN(start_sample, s->start_pts - pts);
-        }
-
-        if (drop)
-            goto drop;
-    }
-
-    if (s->first_pts == AV_NOPTS_VALUE)
-        s->first_pts = pts + start_sample;
-
-    /* check if at least a part of the frame is before the end time */
-    if (s->end_sample == INT64_MAX && s->end_pts == AV_NOPTS_VALUE && !s->duration_tb) {
-        end_sample = frame->nb_samples;
-    } else {
-        drop       = 1;
-        end_sample = 0;
-
-        if (s->end_sample != INT64_MAX &&
-            s->nb_samples < s->end_sample) {
-            drop       = 0;
-            end_sample = FFMAX(end_sample, s->end_sample - s->nb_samples);
-        }
-
-        if (s->end_pts != AV_NOPTS_VALUE && pts != AV_NOPTS_VALUE &&
-            pts < s->end_pts) {
-            drop       = 0;
-            end_sample = FFMAX(end_sample, s->end_pts - pts);
-        }
-
-        if (s->duration_tb && pts - s->first_pts < s->duration_tb) {
-            drop       = 0;
-            end_sample = FFMAX(end_sample, s->first_pts + s->duration_tb - pts);
-        }
-
-        if (drop) {
-            s->eof = 1;
-            goto drop;
-        }
-    }
-
-    s->nb_samples += frame->nb_samples;
-    start_sample   = FFMAX(0, start_sample);
-    end_sample     = FFMIN(frame->nb_samples, end_sample);
-    av_assert0(start_sample < end_sample);
-
-    if (start_sample) {
-        AVFrame *out = ff_get_audio_buffer(ctx->outputs[0], end_sample - start_sample);
-        if (!out) {
-            av_frame_free(&frame);
-            return AVERROR(ENOMEM);
-        }
-
-        av_frame_copy_props(out, frame);
-        av_samples_copy(out->extended_data, frame->extended_data, 0, start_sample,
-                        out->nb_samples, av_get_channel_layout_nb_channels(frame->channel_layout),
-                        frame->format);
-        if (out->pts != AV_NOPTS_VALUE)
-            out->pts += av_rescale_q(start_sample, (AVRational){ 1, out->sample_rate },
-                                     inlink->time_base);
-
-        av_frame_free(&frame);
-        frame = out;
-    } else
-        frame->nb_samples = end_sample;
-
-    s->got_output = 1;
-    return ff_filter_frame(ctx->outputs[0], frame);
-
-drop:
-    s->nb_samples += frame->nb_samples;
-    av_frame_free(&frame);
-    return 0;
-}
-
-#define FLAGS AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption atrim_options[] = {
-    COMMON_OPTS
-    { "start_sample", "Number of the first audio sample that should be "
-        "passed to the output",                                          OFFSET(start_sample), AV_OPT_TYPE_INT64,  { .i64 = -1 },       -1, INT64_MAX, FLAGS },
-    { "end_sample",   "Number of the first audio sample that should be "
-        "dropped again",                                                 OFFSET(end_sample),   AV_OPT_TYPE_INT64,  { .i64 = INT64_MAX }, 0, INT64_MAX, FLAGS },
-    { NULL },
-};
-#undef FLAGS
-
-static const AVClass atrim_class = {
-    .class_name = "atrim",
-    .item_name  = av_default_item_name,
-    .option     = atrim_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad atrim_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_AUDIO,
-        .filter_frame = atrim_filter_frame,
-        .config_props = config_input,
-    },
-    { NULL }
-};
-
-static const AVFilterPad atrim_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_AUDIO,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_af_atrim = {
-    .name        = "atrim",
-    .description = NULL_IF_CONFIG_SMALL("Pick one continuous section from the input, drop the rest."),
-
-    .init        = init,
-
-    .priv_size   = sizeof(TrimContext),
-    .priv_class  = &atrim_class,
-
-    .inputs      = atrim_inputs,
-    .outputs     = atrim_outputs,
-};
-#endif // CONFIG_ATRIM_FILTER
diff --git a/deps/libav/libavfilter/version.h b/deps/libav/libavfilter/version.h
deleted file mode 100644
index f09b501..0000000
--- a/deps/libav/libavfilter/version.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Version macros.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_VERSION_H
-#define AVFILTER_VERSION_H
-
-/**
- * @file
- * @ingroup lavfi
- * Libavfilter version macros
- */
-
-#include "libavutil/version.h"
-
-#define LIBAVFILTER_VERSION_MAJOR  4
-#define LIBAVFILTER_VERSION_MINOR  2
-#define LIBAVFILTER_VERSION_MICRO  0
-
-#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
-                                               LIBAVFILTER_VERSION_MINOR, \
-                                               LIBAVFILTER_VERSION_MICRO)
-#define LIBAVFILTER_VERSION     AV_VERSION(LIBAVFILTER_VERSION_MAJOR,   \
-                                           LIBAVFILTER_VERSION_MINOR,   \
-                                           LIBAVFILTER_VERSION_MICRO)
-#define LIBAVFILTER_BUILD       LIBAVFILTER_VERSION_INT
-
-/**
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- */
-
-#ifndef FF_API_AVFILTERPAD_PUBLIC
-#define FF_API_AVFILTERPAD_PUBLIC           (LIBAVFILTER_VERSION_MAJOR < 5)
-#endif
-#ifndef FF_API_FOO_COUNT
-#define FF_API_FOO_COUNT                    (LIBAVFILTER_VERSION_MAJOR < 5)
-#endif
-#ifndef FF_API_AVFILTERBUFFER
-#define FF_API_AVFILTERBUFFER               (LIBAVFILTER_VERSION_MAJOR < 5)
-#endif
-#ifndef FF_API_OLD_FILTER_OPTS
-#define FF_API_OLD_FILTER_OPTS              (LIBAVFILTER_VERSION_MAJOR < 5)
-#endif
-#ifndef FF_API_AVFILTER_OPEN
-#define FF_API_AVFILTER_OPEN                (LIBAVFILTER_VERSION_MAJOR < 5)
-#endif
-#ifndef FF_API_AVFILTER_INIT_FILTER
-#define FF_API_AVFILTER_INIT_FILTER         (LIBAVFILTER_VERSION_MAJOR < 5)
-#endif
-#ifndef FF_API_OLD_FILTER_REGISTER
-#define FF_API_OLD_FILTER_REGISTER          (LIBAVFILTER_VERSION_MAJOR < 5)
-#endif
-#ifndef FF_API_NOCONST_GET_NAME
-#define FF_API_NOCONST_GET_NAME             (LIBAVFILTER_VERSION_MAJOR < 5)
-#endif
-
-#endif /* AVFILTER_VERSION_H */
diff --git a/deps/libav/libavfilter/vf_aspect.c b/deps/libav/libavfilter/vf_aspect.c
deleted file mode 100644
index bb7f15e..0000000
--- a/deps/libav/libavfilter/vf_aspect.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (c) 2010 Bobby Bingham
-
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * aspect ratio modification video filters
- */
-
-#include <float.h>
-
-#include "libavutil/common.h"
-#include "libavutil/eval.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-static const char *const var_names[] = {
-    "PI",
-    "PHI",
-    "E",
-    "w",
-    "h",
-    "a", "dar",
-    "sar",
-    "hsub",
-    "vsub",
-    NULL
-};
-
-enum var_name {
-    VAR_PI,
-    VAR_PHI,
-    VAR_E,
-    VAR_W,
-    VAR_H,
-    VAR_A, VAR_DAR,
-    VAR_SAR,
-    VAR_HSUB,
-    VAR_VSUB,
-    VARS_NB
-};
-
-typedef struct {
-    const AVClass *class;
-    AVRational dar;
-    AVRational sar;
-#if FF_API_OLD_FILTER_OPTS
-    float aspect_num, aspect_den;
-#endif
-    char *ratio_expr;
-} AspectContext;
-
-#if FF_API_OLD_FILTER_OPTS
-static av_cold int init(AVFilterContext *ctx)
-{
-    AspectContext *s = ctx->priv;
-
-    if (s->aspect_num > 0 && s->aspect_den > 0) {
-        av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use "
-               "dar=<number> or dar=num/den.\n");
-        s->sar = s->dar = av_d2q(s->aspect_num / s->aspect_den, INT_MAX);
-    }
-
-    return 0;
-}
-#endif
-
-static int filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    AspectContext *s = link->dst->priv;
-
-    frame->sample_aspect_ratio = s->sar;
-    return ff_filter_frame(link->dst->outputs[0], frame);
-}
-
-#define OFFSET(x) offsetof(AspectContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-
-static int get_aspect_ratio(AVFilterLink *inlink, AVRational *aspect_ratio)
-{
-    AVFilterContext *ctx = inlink->dst;
-    AspectContext *s = inlink->dst->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    double var_values[VARS_NB], res;
-    int ret;
-
-    var_values[VAR_PI]    = M_PI;
-    var_values[VAR_PHI]   = M_PHI;
-    var_values[VAR_E]     = M_E;
-    var_values[VAR_W]     = inlink->w;
-    var_values[VAR_H]     = inlink->h;
-    var_values[VAR_A]     = (double) inlink->w / inlink->h;
-    var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
-        (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
-    var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];
-    var_values[VAR_HSUB]  = 1 << desc->log2_chroma_w;
-    var_values[VAR_VSUB]  = 1 << desc->log2_chroma_h;
-
-    /* evaluate new aspect ratio*/
-    if ((ret = av_expr_parse_and_eval(&res, s->ratio_expr,
-                                      var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Error when evaluating the expression '%s'\n", s->ratio_expr);
-        return ret;
-    }
-    *aspect_ratio = av_d2q(res, INT_MAX);
-    return 0;
-}
-
-#if CONFIG_SETDAR_FILTER
-/* for setdar filter, convert from frame aspect ratio to pixel aspect ratio */
-static int setdar_config_props(AVFilterLink *inlink)
-{
-    AspectContext *s = inlink->dst->priv;
-    AVRational dar;
-    int ret;
-
-#if FF_API_OLD_FILTER_OPTS
-    if (!(s->aspect_num > 0 && s->aspect_den > 0)) {
-#endif
-    if ((ret = get_aspect_ratio(inlink, &s->dar)))
-        return ret;
-#if FF_API_OLD_FILTER_OPTS
-    }
-#endif
-
-    if (s->dar.num && s->dar.den) {
-        av_reduce(&s->sar.num, &s->sar.den,
-                   s->dar.num * inlink->h,
-                   s->dar.den * inlink->w, 100);
-        inlink->sample_aspect_ratio = s->sar;
-        dar = s->dar;
-    } else {
-        inlink->sample_aspect_ratio = (AVRational){ 1, 1 };
-        dar = (AVRational){ inlink->w, inlink->h };
-    }
-
-    av_log(inlink->dst, AV_LOG_VERBOSE, "w:%d h:%d -> dar:%d/%d sar:%d/%d\n",
-           inlink->w, inlink->h, dar.num, dar.den,
-           inlink->sample_aspect_ratio.num, inlink->sample_aspect_ratio.den);
-
-    return 0;
-}
-
-static const AVOption setdar_options[] = {
-#if FF_API_OLD_FILTER_OPTS
-    { "dar_num", NULL, OFFSET(aspect_num), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, 0, FLT_MAX, FLAGS },
-    { "dar_den", NULL, OFFSET(aspect_den), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, 0, FLT_MAX, FLAGS },
-#endif
-    { "dar", "display aspect ratio", OFFSET(ratio_expr), AV_OPT_TYPE_STRING, { .str = "1" }, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass setdar_class = {
-    .class_name = "setdar",
-    .item_name  = av_default_item_name,
-    .option     = setdar_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_setdar_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = setdar_config_props,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_setdar_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_setdar = {
-    .name      = "setdar",
-    .description = NULL_IF_CONFIG_SMALL("Set the frame display aspect ratio."),
-
-#if FF_API_OLD_FILTER_OPTS
-    .init      = init,
-#endif
-
-    .priv_size = sizeof(AspectContext),
-    .priv_class = &setdar_class,
-
-    .inputs    = avfilter_vf_setdar_inputs,
-
-    .outputs   = avfilter_vf_setdar_outputs,
-};
-#endif /* CONFIG_SETDAR_FILTER */
-
-#if CONFIG_SETSAR_FILTER
-/* for setdar filter, convert from frame aspect ratio to pixel aspect ratio */
-static int setsar_config_props(AVFilterLink *inlink)
-{
-    AspectContext *s = inlink->dst->priv;
-    int ret;
-
-#if FF_API_OLD_FILTER_OPTS
-    if (!(s->aspect_num > 0 && s->aspect_den > 0)) {
-#endif
-    if ((ret = get_aspect_ratio(inlink, &s->sar)))
-        return ret;
-#if FF_API_OLD_FILTER_OPTS
-    }
-#endif
-
-    inlink->sample_aspect_ratio = s->sar;
-
-    return 0;
-}
-
-static const AVOption setsar_options[] = {
-#if FF_API_OLD_FILTER_OPTS
-    { "sar_num", NULL, OFFSET(aspect_num), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, 0, FLT_MAX, FLAGS },
-    { "sar_den", NULL, OFFSET(aspect_den), AV_OPT_TYPE_FLOAT, { .dbl = 0 }, 0, FLT_MAX, FLAGS },
-#endif
-    { "sar", "sample (pixel) aspect ratio", OFFSET(ratio_expr), AV_OPT_TYPE_STRING, { .str = "1" }, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass setsar_class = {
-    .class_name = "setsar",
-    .item_name  = av_default_item_name,
-    .option     = setsar_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_setsar_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = setsar_config_props,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_setsar_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_setsar = {
-    .name      = "setsar",
-    .description = NULL_IF_CONFIG_SMALL("Set the pixel sample aspect ratio."),
-
-#if FF_API_OLD_FILTER_OPTS
-    .init      = init,
-#endif
-
-    .priv_size = sizeof(AspectContext),
-    .priv_class = &setsar_class,
-
-    .inputs    = avfilter_vf_setsar_inputs,
-
-    .outputs   = avfilter_vf_setsar_outputs,
-};
-#endif /* CONFIG_SETSAR_FILTER */
diff --git a/deps/libav/libavfilter/vf_blackframe.c b/deps/libav/libavfilter/vf_blackframe.c
deleted file mode 100644
index 039f055..0000000
--- a/deps/libav/libavfilter/vf_blackframe.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2010 Stefano Sabatini
- * Copyright (c) 2006 Ivo van Poorten
- * Copyright (c) 2006 Julian Hall
- * Copyright (c) 2002-2003 Brian J. Murrell
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/**
- * @file
- * Search for black frames to detect scene transitions.
- * Ported from MPlayer libmpcodecs/vf_blackframe.c.
- */
-
-#include <stdio.h>
-#include <inttypes.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    const AVClass *class;
-    int bamount;          ///< black amount
-    int bthresh;          ///< black threshold
-    unsigned int frame;   ///< frame number
-    unsigned int nblack;  ///< number of black pixels counted so far
-} BlackFrameContext;
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NV12,
-        AV_PIX_FMT_NV21, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    BlackFrameContext *s = ctx->priv;
-    int x, i;
-    int pblack = 0;
-    uint8_t *p = frame->data[0];
-
-    for (i = 0; i < frame->height; i++) {
-        for (x = 0; x < inlink->w; x++)
-            s->nblack += p[x] < s->bthresh;
-        p += frame->linesize[0];
-    }
-
-    pblack = s->nblack * 100 / (inlink->w * inlink->h);
-    if (pblack >= s->bamount)
-        av_log(ctx, AV_LOG_INFO, "frame:%u pblack:%u pts:%"PRId64" t:%f\n",
-               s->frame, pblack, frame->pts,
-               frame->pts == AV_NOPTS_VALUE ? -1 : frame->pts * av_q2d(inlink->time_base));
-
-    s->frame++;
-    s->nblack = 0;
-    return ff_filter_frame(inlink->dst->outputs[0], frame);
-}
-
-#define OFFSET(x) offsetof(BlackFrameContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "amount", "Percentage of the pixels that have to be below the threshold "
-        "for the frame to be considered black.", OFFSET(bamount), AV_OPT_TYPE_INT, { .i64 = 98 }, 0, 100,     FLAGS },
-    { "threshold", "threshold below which a pixel value is considered black",
-                                                 OFFSET(bthresh), AV_OPT_TYPE_INT, { .i64 = 32 }, 0, INT_MAX, FLAGS },
-    { NULL },
-};
-
-static const AVClass blackframe_class = {
-    .class_name = "blackframe",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_blackframe_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_blackframe_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_blackframe = {
-    .name        = "blackframe",
-    .description = NULL_IF_CONFIG_SMALL("Detect frames that are (almost) black."),
-
-    .priv_size = sizeof(BlackFrameContext),
-    .priv_class = &blackframe_class,
-
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_blackframe_inputs,
-
-    .outputs   = avfilter_vf_blackframe_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_boxblur.c b/deps/libav/libavfilter/vf_boxblur.c
deleted file mode 100644
index 1f26549..0000000
--- a/deps/libav/libavfilter/vf_boxblur.c
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Copyright (c) 2002 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2011 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/**
- * @file
- * Apply a boxblur filter to the input video.
- * Ported from MPlayer libmpcodecs/vf_boxblur.c.
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/common.h"
-#include "libavutil/eval.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-static const char *const var_names[] = {
-    "w",
-    "h",
-    "cw",
-    "ch",
-    "hsub",
-    "vsub",
-    NULL
-};
-
-enum var_name {
-    VAR_W,
-    VAR_H,
-    VAR_CW,
-    VAR_CH,
-    VAR_HSUB,
-    VAR_VSUB,
-    VARS_NB
-};
-
-typedef struct {
-    int radius;
-    int power;
-} FilterParam;
-
-typedef struct {
-    const AVClass *class;
-    FilterParam luma_param;
-    FilterParam chroma_param;
-    FilterParam alpha_param;
-    char *luma_radius_expr;
-    char *chroma_radius_expr;
-    char *alpha_radius_expr;
-
-    int hsub, vsub;
-    int radius[4];
-    int power[4];
-    uint8_t *temp[2]; ///< temporary buffer used in blur_power()
-} BoxBlurContext;
-
-#define Y 0
-#define U 1
-#define V 2
-#define A 3
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    BoxBlurContext *s = ctx->priv;
-
-    if (!s->luma_radius_expr) {
-        av_log(ctx, AV_LOG_ERROR, "Luma radius expression is not set.\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (!s->chroma_radius_expr) {
-        s->chroma_radius_expr = av_strdup(s->luma_radius_expr);
-        if (!s->chroma_radius_expr)
-            return AVERROR(ENOMEM);
-        s->chroma_param.power = s->luma_param.power;
-    }
-    if (!s->alpha_radius_expr) {
-        s->alpha_radius_expr = av_strdup(s->luma_radius_expr);
-        if (!s->alpha_radius_expr)
-            return AVERROR(ENOMEM);
-        s->alpha_param.power = s->luma_param.power;
-    }
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    BoxBlurContext *s = ctx->priv;
-
-    av_freep(&s->temp[0]);
-    av_freep(&s->temp[1]);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV420P,
-        AV_PIX_FMT_YUV411P,  AV_PIX_FMT_YUV410P,  AV_PIX_FMT_YUVA420P,
-        AV_PIX_FMT_YUV440P,  AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
-        AV_PIX_FMT_YUVJ440P,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int config_input(AVFilterLink *inlink)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    AVFilterContext    *ctx = inlink->dst;
-    BoxBlurContext *s = ctx->priv;
-    int w = inlink->w, h = inlink->h;
-    int cw, ch;
-    double var_values[VARS_NB], res;
-    char *expr;
-    int ret;
-
-    av_freep(&s->temp[0]);
-    av_freep(&s->temp[1]);
-    if (!(s->temp[0] = av_malloc(FFMAX(w, h))))
-       return AVERROR(ENOMEM);
-    if (!(s->temp[1] = av_malloc(FFMAX(w, h)))) {
-        av_freep(&s->temp[0]);
-        return AVERROR(ENOMEM);
-    }
-
-    s->hsub = desc->log2_chroma_w;
-    s->vsub = desc->log2_chroma_h;
-
-    var_values[VAR_W]       = inlink->w;
-    var_values[VAR_H]       = inlink->h;
-    var_values[VAR_CW] = cw = w>>s->hsub;
-    var_values[VAR_CH] = ch = h>>s->vsub;
-    var_values[VAR_HSUB]    = 1<<s->hsub;
-    var_values[VAR_VSUB]    = 1<<s->vsub;
-
-#define EVAL_RADIUS_EXPR(comp)                                          \
-    expr = s->comp##_radius_expr;                                       \
-    ret = av_expr_parse_and_eval(&res, expr, var_names, var_values,     \
-                                 NULL, NULL, NULL, NULL, NULL, 0, ctx); \
-    s->comp##_param.radius = res;                                       \
-    if (ret < 0) {                                                      \
-        av_log(NULL, AV_LOG_ERROR,                                      \
-               "Error when evaluating " #comp " radius expression '%s'\n", expr); \
-        return ret;                                                     \
-    }
-    EVAL_RADIUS_EXPR(luma);
-    EVAL_RADIUS_EXPR(chroma);
-    EVAL_RADIUS_EXPR(alpha);
-
-    av_log(ctx, AV_LOG_DEBUG,
-           "luma_radius:%d luma_power:%d "
-           "chroma_radius:%d chroma_power:%d "
-           "alpha_radius:%d alpha_power:%d "
-           "w:%d chroma_w:%d h:%d chroma_h:%d\n",
-           s->luma_param  .radius, s->luma_param  .power,
-           s->chroma_param.radius, s->chroma_param.power,
-           s->alpha_param .radius, s->alpha_param .power,
-           w, cw, h, ch);
-
-#define CHECK_RADIUS_VAL(w_, h_, comp)                                  \
-    if (s->comp##_param.radius < 0 ||                                   \
-        2*s->comp##_param.radius > FFMIN(w_, h_)) {                     \
-        av_log(ctx, AV_LOG_ERROR,                                       \
-               "Invalid " #comp " radius value %d, must be >= 0 and <= %d\n", \
-               s->comp##_param.radius, FFMIN(w_, h_)/2);                \
-        return AVERROR(EINVAL);                                         \
-    }
-    CHECK_RADIUS_VAL(w,  h,  luma);
-    CHECK_RADIUS_VAL(cw, ch, chroma);
-    CHECK_RADIUS_VAL(w,  h,  alpha);
-
-    s->radius[Y] = s->luma_param.radius;
-    s->radius[U] = s->radius[V] = s->chroma_param.radius;
-    s->radius[A] = s->alpha_param.radius;
-
-    s->power[Y] = s->luma_param.power;
-    s->power[U] = s->power[V] = s->chroma_param.power;
-    s->power[A] = s->alpha_param.power;
-
-    return 0;
-}
-
-static inline void blur(uint8_t *dst, int dst_step, const uint8_t *src, int src_step,
-                        int len, int radius)
-{
-    /* Naive boxblur would sum source pixels from x-radius .. x+radius
-     * for destination pixel x. That would be O(radius*width).
-     * If you now look at what source pixels represent 2 consecutive
-     * output pixels, then you see they are almost identical and only
-     * differ by 2 pixels, like:
-     * src0       111111111
-     * dst0           1
-     * src1        111111111
-     * dst1            1
-     * src0-src1  1       -1
-     * so when you know one output pixel you can find the next by just adding
-     * and subtracting 1 input pixel.
-     * The following code adopts this faster variant.
-     */
-    const int length = radius*2 + 1;
-    const int inv = ((1<<16) + length/2)/length;
-    int x, sum = 0;
-
-    for (x = 0; x < radius; x++)
-        sum += src[x*src_step]<<1;
-    sum += src[radius*src_step];
-
-    for (x = 0; x <= radius; x++) {
-        sum += src[(radius+x)*src_step] - src[(radius-x)*src_step];
-        dst[x*dst_step] = (sum*inv + (1<<15))>>16;
-    }
-
-    for (; x < len-radius; x++) {
-        sum += src[(radius+x)*src_step] - src[(x-radius-1)*src_step];
-        dst[x*dst_step] = (sum*inv + (1<<15))>>16;
-    }
-
-    for (; x < len; x++) {
-        sum += src[(2*len-radius-x-1)*src_step] - src[(x-radius-1)*src_step];
-        dst[x*dst_step] = (sum*inv + (1<<15))>>16;
-    }
-}
-
-static inline void blur_power(uint8_t *dst, int dst_step, const uint8_t *src, int src_step,
-                              int len, int radius, int power, uint8_t *temp[2])
-{
-    uint8_t *a = temp[0], *b = temp[1];
-
-    if (radius && power) {
-        blur(a, 1, src, src_step, len, radius);
-        for (; power > 2; power--) {
-            uint8_t *c;
-            blur(b, 1, a, 1, len, radius);
-            c = a; a = b; b = c;
-        }
-        if (power > 1) {
-            blur(dst, dst_step, a, 1, len, radius);
-        } else {
-            int i;
-            for (i = 0; i < len; i++)
-                dst[i*dst_step] = a[i];
-        }
-    } else {
-        int i;
-        for (i = 0; i < len; i++)
-            dst[i*dst_step] = src[i*src_step];
-    }
-}
-
-static void hblur(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize,
-                  int w, int h, int radius, int power, uint8_t *temp[2])
-{
-    int y;
-
-    if (radius == 0 && dst == src)
-        return;
-
-    for (y = 0; y < h; y++)
-        blur_power(dst + y*dst_linesize, 1, src + y*src_linesize, 1,
-                   w, radius, power, temp);
-}
-
-static void vblur(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize,
-                  int w, int h, int radius, int power, uint8_t *temp[2])
-{
-    int x;
-
-    if (radius == 0 && dst == src)
-        return;
-
-    for (x = 0; x < w; x++)
-        blur_power(dst + x, dst_linesize, src + x, src_linesize,
-                   h, radius, power, temp);
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    AVFilterContext *ctx = inlink->dst;
-    BoxBlurContext *s = ctx->priv;
-    AVFilterLink *outlink = inlink->dst->outputs[0];
-    AVFrame *out;
-    int plane;
-    int cw = inlink->w >> s->hsub, ch = in->height >> s->vsub;
-    int w[4] = { inlink->w, cw, cw, inlink->w };
-    int h[4] = { in->height, ch, ch, in->height };
-
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-    av_frame_copy_props(out, in);
-
-    for (plane = 0; in->data[plane] && plane < 4; plane++)
-        hblur(out->data[plane], out->linesize[plane],
-              in ->data[plane], in ->linesize[plane],
-              w[plane], h[plane], s->radius[plane], s->power[plane],
-              s->temp);
-
-    for (plane = 0; in->data[plane] && plane < 4; plane++)
-        vblur(out->data[plane], out->linesize[plane],
-              out->data[plane], out->linesize[plane],
-              w[plane], h[plane], s->radius[plane], s->power[plane],
-              s->temp);
-
-    av_frame_free(&in);
-
-    return ff_filter_frame(outlink, out);
-}
-
-#define OFFSET(x) offsetof(BoxBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "luma_radius", "Radius of the luma blurring box",     OFFSET(luma_radius_expr),   AV_OPT_TYPE_STRING,               .flags = FLAGS },
-    { "luma_power",  "How many times should the boxblur be applied to luma",
-                                                            OFFSET(luma_param.power),   AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, FLAGS },
-    { "chroma_radius", "Radius of the chroma blurring box", OFFSET(chroma_radius_expr), AV_OPT_TYPE_STRING,               .flags = FLAGS },
-    { "chroma_power",  "How many times should the boxblur be applied to chroma",
-                                                            OFFSET(chroma_param.power), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, FLAGS },
-    { "alpha_radius", "Radius of the alpha blurring box",   OFFSET(alpha_radius_expr),  AV_OPT_TYPE_STRING,               .flags = FLAGS },
-    { "alpha_power",  "How many times should the boxblur be applied to alpha",
-                                                            OFFSET(alpha_param.power),  AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, FLAGS },
-    { NULL },
-};
-
-static const AVClass boxblur_class = {
-    .class_name = "boxblur",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_boxblur_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_input,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_boxblur_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_boxblur = {
-    .name          = "boxblur",
-    .description   = NULL_IF_CONFIG_SMALL("Blur the input."),
-    .priv_size     = sizeof(BoxBlurContext),
-    .priv_class    = &boxblur_class,
-    .init          = init,
-    .uninit        = uninit,
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_boxblur_inputs,
-    .outputs   = avfilter_vf_boxblur_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_copy.c b/deps/libav/libavfilter/vf_copy.c
deleted file mode 100644
index 55175a0..0000000
--- a/deps/libav/libavfilter/vf_copy.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * copy video filter
- */
-
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    AVFilterLink *outlink = inlink->dst->outputs[0];
-    AVFrame *out = ff_get_video_buffer(outlink, in->width, in->height);
-
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-    av_frame_copy_props(out, in);
-    av_image_copy(out->data, out->linesize, in->data, in->linesize,
-                  in->format, in->width, in->height);
-
-    av_frame_free(&in);
-    return ff_filter_frame(outlink, out);
-}
-
-static const AVFilterPad avfilter_vf_copy_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_copy_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_copy = {
-    .name      = "copy",
-    .description = NULL_IF_CONFIG_SMALL("Copy the input video unchanged to the output."),
-
-    .inputs    = avfilter_vf_copy_inputs,
-    .outputs   = avfilter_vf_copy_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_crop.c b/deps/libav/libavfilter/vf_crop.c
deleted file mode 100644
index 1aa8466..0000000
--- a/deps/libav/libavfilter/vf_crop.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * video crop filter
- */
-
-#include <stdio.h>
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "libavutil/eval.h"
-#include "libavutil/avstring.h"
-#include "libavutil/internal.h"
-#include "libavutil/libm.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-
-static const char *const var_names[] = {
-    "E",
-    "PHI",
-    "PI",
-    "in_w", "iw",   ///< width  of the input video
-    "in_h", "ih",   ///< height of the input video
-    "out_w", "ow",  ///< width  of the cropped video
-    "out_h", "oh",  ///< height of the cropped video
-    "x",
-    "y",
-    "n",            ///< number of frame
-    "pos",          ///< position in the file
-    "t",            ///< timestamp expressed in seconds
-    NULL
-};
-
-enum var_name {
-    VAR_E,
-    VAR_PHI,
-    VAR_PI,
-    VAR_IN_W,  VAR_IW,
-    VAR_IN_H,  VAR_IH,
-    VAR_OUT_W, VAR_OW,
-    VAR_OUT_H, VAR_OH,
-    VAR_X,
-    VAR_Y,
-    VAR_N,
-    VAR_T,
-    VAR_VARS_NB
-};
-
-typedef struct {
-    const AVClass *class;
-    int  x;             ///< x offset of the non-cropped area with respect to the input area
-    int  y;             ///< y offset of the non-cropped area with respect to the input area
-    int  w;             ///< width of the cropped area
-    int  h;             ///< height of the cropped area
-
-    int max_step[4];    ///< max pixel step for each plane, expressed as a number of bytes
-    int hsub, vsub;     ///< chroma subsampling
-    char *x_expr, *y_expr, *ow_expr, *oh_expr;
-    AVExpr *x_pexpr, *y_pexpr;  /* parsed expressions for x and y */
-    double var_values[VAR_VARS_NB];
-} CropContext;
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_RGB48BE,      AV_PIX_FMT_RGB48LE,
-        AV_PIX_FMT_BGR48BE,      AV_PIX_FMT_BGR48LE,
-        AV_PIX_FMT_ARGB,         AV_PIX_FMT_RGBA,
-        AV_PIX_FMT_ABGR,         AV_PIX_FMT_BGRA,
-        AV_PIX_FMT_RGB24,        AV_PIX_FMT_BGR24,
-        AV_PIX_FMT_RGB565BE,     AV_PIX_FMT_RGB565LE,
-        AV_PIX_FMT_RGB555BE,     AV_PIX_FMT_RGB555LE,
-        AV_PIX_FMT_BGR565BE,     AV_PIX_FMT_BGR565LE,
-        AV_PIX_FMT_BGR555BE,     AV_PIX_FMT_BGR555LE,
-        AV_PIX_FMT_GRAY16BE,     AV_PIX_FMT_GRAY16LE,
-        AV_PIX_FMT_YUV420P16LE,  AV_PIX_FMT_YUV420P16BE,
-        AV_PIX_FMT_YUV422P16LE,  AV_PIX_FMT_YUV422P16BE,
-        AV_PIX_FMT_YUV444P16LE,  AV_PIX_FMT_YUV444P16BE,
-        AV_PIX_FMT_YUV444P,      AV_PIX_FMT_YUV422P,
-        AV_PIX_FMT_YUV420P,      AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_YUV410P,      AV_PIX_FMT_YUV440P,
-        AV_PIX_FMT_YUVJ444P,     AV_PIX_FMT_YUVJ422P,
-        AV_PIX_FMT_YUVJ420P,     AV_PIX_FMT_YUVJ440P,
-        AV_PIX_FMT_YUVA420P,
-        AV_PIX_FMT_RGB8,         AV_PIX_FMT_BGR8,
-        AV_PIX_FMT_RGB4_BYTE,    AV_PIX_FMT_BGR4_BYTE,
-        AV_PIX_FMT_PAL8,         AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    CropContext *s = ctx->priv;
-
-    av_expr_free(s->x_pexpr);
-    s->x_pexpr = NULL;
-    av_expr_free(s->y_pexpr);
-    s->y_pexpr = NULL;
-}
-
-static inline int normalize_double(int *n, double d)
-{
-    int ret = 0;
-
-    if (isnan(d)) {
-        ret = AVERROR(EINVAL);
-    } else if (d > INT_MAX || d < INT_MIN) {
-        *n = d > INT_MAX ? INT_MAX : INT_MIN;
-        ret = AVERROR(EINVAL);
-    } else
-        *n = round(d);
-
-    return ret;
-}
-
-static int config_input(AVFilterLink *link)
-{
-    AVFilterContext *ctx = link->dst;
-    CropContext *s = ctx->priv;
-    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(link->format);
-    int ret;
-    const char *expr;
-    double res;
-
-    s->var_values[VAR_E]     = M_E;
-    s->var_values[VAR_PHI]   = M_PHI;
-    s->var_values[VAR_PI]    = M_PI;
-    s->var_values[VAR_IN_W]  = s->var_values[VAR_IW] = ctx->inputs[0]->w;
-    s->var_values[VAR_IN_H]  = s->var_values[VAR_IH] = ctx->inputs[0]->h;
-    s->var_values[VAR_X]     = NAN;
-    s->var_values[VAR_Y]     = NAN;
-    s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = NAN;
-    s->var_values[VAR_OUT_H] = s->var_values[VAR_OH] = NAN;
-    s->var_values[VAR_N]     = 0;
-    s->var_values[VAR_T]     = NAN;
-
-    av_image_fill_max_pixsteps(s->max_step, NULL, pix_desc);
-    s->hsub = pix_desc->log2_chroma_w;
-    s->vsub = pix_desc->log2_chroma_h;
-
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->ow_expr),
-                                      var_names, s->var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto fail_expr;
-    s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = res;
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->oh_expr),
-                                      var_names, s->var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto fail_expr;
-    s->var_values[VAR_OUT_H] = s->var_values[VAR_OH] = res;
-    /* evaluate again ow as it may depend on oh */
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->ow_expr),
-                                      var_names, s->var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto fail_expr;
-
-    s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = res;
-    if (normalize_double(&s->w, s->var_values[VAR_OUT_W]) < 0 ||
-        normalize_double(&s->h, s->var_values[VAR_OUT_H]) < 0) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Too big value or invalid expression for out_w/ow or out_h/oh. "
-               "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n",
-               s->ow_expr, s->oh_expr);
-        return AVERROR(EINVAL);
-    }
-    s->w &= ~((1 << s->hsub) - 1);
-    s->h &= ~((1 << s->vsub) - 1);
-
-    av_expr_free(s->x_pexpr);
-    av_expr_free(s->y_pexpr);
-    s->x_pexpr = s->y_pexpr = NULL;
-    if ((ret = av_expr_parse(&s->x_pexpr, s->x_expr, var_names,
-                             NULL, NULL, NULL, NULL, 0, ctx)) < 0 ||
-        (ret = av_expr_parse(&s->y_pexpr, s->y_expr, var_names,
-                             NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        return AVERROR(EINVAL);
-
-    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d -> w:%d h:%d\n",
-           link->w, link->h, s->w, s->h);
-
-    if (s->w <= 0 || s->h <= 0 ||
-        s->w > link->w || s->h > link->h) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid too big or non positive size for width '%d' or height '%d'\n",
-               s->w, s->h);
-        return AVERROR(EINVAL);
-    }
-
-    /* set default, required in the case the first computed value for x/y is NAN */
-    s->x = (link->w - s->w) / 2;
-    s->y = (link->h - s->h) / 2;
-    s->x &= ~((1 << s->hsub) - 1);
-    s->y &= ~((1 << s->vsub) - 1);
-    return 0;
-
-fail_expr:
-    av_log(NULL, AV_LOG_ERROR, "Error when evaluating the expression '%s'\n", expr);
-    return ret;
-}
-
-static int config_output(AVFilterLink *link)
-{
-    CropContext *s = link->src->priv;
-
-    link->w = s->w;
-    link->h = s->h;
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    AVFilterContext *ctx = link->dst;
-    CropContext *s = ctx->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
-    int i;
-
-    frame->width  = s->w;
-    frame->height = s->h;
-
-    s->var_values[VAR_T] = frame->pts == AV_NOPTS_VALUE ?
-        NAN : frame->pts * av_q2d(link->time_base);
-    s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);
-    s->var_values[VAR_Y] = av_expr_eval(s->y_pexpr, s->var_values, NULL);
-    s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);
-
-    normalize_double(&s->x, s->var_values[VAR_X]);
-    normalize_double(&s->y, s->var_values[VAR_Y]);
-
-    if (s->x < 0)
-        s->x = 0;
-    if (s->y < 0)
-        s->y = 0;
-    if ((unsigned)s->x + (unsigned)s->w > link->w)
-        s->x = link->w - s->w;
-    if ((unsigned)s->y + (unsigned)s->h > link->h)
-        s->y = link->h - s->h;
-    s->x &= ~((1 << s->hsub) - 1);
-    s->y &= ~((1 << s->vsub) - 1);
-
-    av_dlog(ctx, "n:%d t:%f x:%d y:%d x+w:%d y+h:%d\n",
-            (int)s->var_values[VAR_N], s->var_values[VAR_T], s->x,
-            s->y, s->x+s->w, s->y+s->h);
-
-    frame->data[0] += s->y * frame->linesize[0];
-    frame->data[0] += s->x * s->max_step[0];
-
-    if (!(desc->flags & AV_PIX_FMT_FLAG_PAL || desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)) {
-        for (i = 1; i < 3; i ++) {
-            if (frame->data[i]) {
-                frame->data[i] += (s->y >> s->vsub) * frame->linesize[i];
-                frame->data[i] += (s->x * s->max_step[i]) >> s->hsub;
-            }
-        }
-    }
-
-    /* alpha plane */
-    if (frame->data[3]) {
-        frame->data[3] += s->y * frame->linesize[3];
-        frame->data[3] += s->x * s->max_step[3];
-    }
-
-    s->var_values[VAR_N] += 1.0;
-
-    return ff_filter_frame(link->dst->outputs[0], frame);
-}
-
-#define OFFSET(x) offsetof(CropContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "out_w", "Output video width",  OFFSET(ow_expr), AV_OPT_TYPE_STRING, { .str = "iw" },                 .flags = FLAGS },
-    { "out_h", "Output video height", OFFSET(oh_expr), AV_OPT_TYPE_STRING, { .str = "ih" },                 .flags = FLAGS },
-    { "x",     "Horizontal position in the input video of the left edge of the cropped output video",
-                                      OFFSET(x_expr),  AV_OPT_TYPE_STRING, { .str = "(in_w - out_w) / 2" }, .flags = FLAGS },
-    { "y",     "Vertical position in the input video of the top edge of the cropped output video",
-                                      OFFSET(y_expr),  AV_OPT_TYPE_STRING, { .str = "(in_h - out_h) / 2" }, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass crop_class = {
-    .class_name = "crop",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_crop_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .filter_frame     = filter_frame,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .config_props     = config_input,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_crop_outputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_output,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_crop = {
-    .name      = "crop",
-    .description = NULL_IF_CONFIG_SMALL("Crop the input video to width:height:x:y."),
-
-    .priv_size = sizeof(CropContext),
-    .priv_class = &crop_class,
-
-    .query_formats = query_formats,
-    .uninit        = uninit,
-
-    .inputs    = avfilter_vf_crop_inputs,
-    .outputs   = avfilter_vf_crop_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_cropdetect.c b/deps/libav/libavfilter/vf_cropdetect.c
deleted file mode 100644
index ea9e47d..0000000
--- a/deps/libav/libavfilter/vf_cropdetect.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (c) 2002 A'rpi
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/**
- * @file
- * border detection filter
- * Ported from MPlayer libmpcodecs/vf_cropdetect.c.
- */
-
-#include <stdio.h>
-
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    const AVClass *class;
-    int x1, y1, x2, y2;
-    int limit;
-    int round;
-    int reset_count;
-    int frame_nb;
-    int max_pixsteps[4];
-} CropDetectContext;
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
-        AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
-        AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
-        AV_PIX_FMT_YUV411P, AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_NV12,    AV_PIX_FMT_NV21,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int checkline(void *ctx, const unsigned char *src, int stride, int len, int bpp)
-{
-    int total = 0;
-    int div = len;
-
-    switch (bpp) {
-    case 1:
-        while (--len >= 0) {
-            total += src[0];
-            src += stride;
-        }
-        break;
-    case 3:
-    case 4:
-        while (--len >= 0) {
-            total += src[0] + src[1] + src[2];
-            src += stride;
-        }
-        div *= 3;
-        break;
-    }
-    total /= div;
-
-    av_log(ctx, AV_LOG_DEBUG, "total:%d\n", total);
-    return total;
-}
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    CropDetectContext *s = ctx->priv;
-
-    s->frame_nb = -2;
-
-    av_log(ctx, AV_LOG_VERBOSE, "limit:%d round:%d reset_count:%d\n",
-           s->limit, s->round, s->reset_count);
-
-    return 0;
-}
-
-static int config_input(AVFilterLink *inlink)
-{
-    AVFilterContext *ctx = inlink->dst;
-    CropDetectContext *s = ctx->priv;
-
-    av_image_fill_max_pixsteps(s->max_pixsteps, NULL,
-                               av_pix_fmt_desc_get(inlink->format));
-
-    s->x1 = inlink->w - 1;
-    s->y1 = inlink->h - 1;
-    s->x2 = 0;
-    s->y2 = 0;
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    CropDetectContext *s = ctx->priv;
-    int bpp = s->max_pixsteps[0];
-    int w, h, x, y, shrink_by;
-
-    // ignore first 2 frames - they may be empty
-    if (++s->frame_nb > 0) {
-        // Reset the crop area every reset_count frames, if reset_count is > 0
-        if (s->reset_count > 0 && s->frame_nb > s->reset_count) {
-            s->x1 = frame->width  - 1;
-            s->y1 = frame->height - 1;
-            s->x2 = 0;
-            s->y2 = 0;
-            s->frame_nb = 1;
-        }
-
-        for (y = 0; y < s->y1; y++) {
-            if (checkline(ctx, frame->data[0] + frame->linesize[0] * y, bpp, frame->width, bpp) > s->limit) {
-                s->y1 = y;
-                break;
-            }
-        }
-
-        for (y = frame->height - 1; y > s->y2; y--) {
-            if (checkline(ctx, frame->data[0] + frame->linesize[0] * y, bpp, frame->width, bpp) > s->limit) {
-                s->y2 = y;
-                break;
-            }
-        }
-
-        for (y = 0; y < s->x1; y++) {
-            if (checkline(ctx, frame->data[0] + bpp*y, frame->linesize[0], frame->height, bpp) > s->limit) {
-                s->x1 = y;
-                break;
-            }
-        }
-
-        for (y = frame->width - 1; y > s->x2; y--) {
-            if (checkline(ctx, frame->data[0] + bpp*y, frame->linesize[0], frame->height, bpp) > s->limit) {
-                s->x2 = y;
-                break;
-            }
-        }
-
-        // round x and y (up), important for yuv colorspaces
-        // make sure they stay rounded!
-        x = (s->x1+1) & ~1;
-        y = (s->y1+1) & ~1;
-
-        w = s->x2 - x + 1;
-        h = s->y2 - y + 1;
-
-        // w and h must be divisible by 2 as well because of yuv
-        // colorspace problems.
-        if (s->round <= 1)
-            s->round = 16;
-        if (s->round % 2)
-            s->round *= 2;
-
-        shrink_by = w % s->round;
-        w -= shrink_by;
-        x += (shrink_by/2 + 1) & ~1;
-
-        shrink_by = h % s->round;
-        h -= shrink_by;
-        y += (shrink_by/2 + 1) & ~1;
-
-        av_log(ctx, AV_LOG_INFO,
-               "x1:%d x2:%d y1:%d y2:%d w:%d h:%d x:%d y:%d pts:%"PRId64" t:%f crop=%d:%d:%d:%d\n",
-               s->x1, s->x2, s->y1, s->y2, w, h, x, y, frame->pts,
-               frame->pts == AV_NOPTS_VALUE ? -1 : frame->pts * av_q2d(inlink->time_base),
-               w, h, x, y);
-    }
-
-    return ff_filter_frame(inlink->dst->outputs[0], frame);
-}
-
-#define OFFSET(x) offsetof(CropDetectContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "limit", "Threshold below which the pixel is considered black", OFFSET(limit),       AV_OPT_TYPE_INT, { .i64 = 24 }, 0, INT_MAX, FLAGS },
-    { "round", "Value by which the width/height should be divisible", OFFSET(round),       AV_OPT_TYPE_INT, { .i64 = 0  }, 0, INT_MAX, FLAGS },
-    { "reset", "Recalculate the crop area after this many frames",    OFFSET(reset_count), AV_OPT_TYPE_INT, { .i64 = 0 },  0, INT_MAX, FLAGS },
-    { NULL },
-};
-
-static const AVClass cropdetect_class = {
-    .class_name = "cropdetect",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_cropdetect_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = config_input,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_cropdetect_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_cropdetect = {
-    .name        = "cropdetect",
-    .description = NULL_IF_CONFIG_SMALL("Auto-detect crop size."),
-
-    .priv_size = sizeof(CropDetectContext),
-    .priv_class = &cropdetect_class,
-    .init      = init,
-
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_cropdetect_inputs,
-
-    .outputs   = avfilter_vf_cropdetect_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_delogo.c b/deps/libav/libavfilter/vf_delogo.c
deleted file mode 100644
index 4175e47..0000000
--- a/deps/libav/libavfilter/vf_delogo.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (c) 2002 Jindrich Makovicka <makovick at gmail.com>
- * Copyright (c) 2011 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/**
- * @file
- * A very simple tv station logo remover
- * Ported from MPlayer libmpcodecs/vf_delogo.c.
- */
-
-#include "libavutil/common.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-/**
- * Apply a simple delogo algorithm to the image in dst and put the
- * result in src.
- *
- * The algorithm is only applied to the region specified by the logo
- * parameters.
- *
- * @param w      width of the input image
- * @param h      height of the input image
- * @param logo_x x coordinate of the top left corner of the logo region
- * @param logo_y y coordinate of the top left corner of the logo region
- * @param logo_w width of the logo
- * @param logo_h height of the logo
- * @param band   the size of the band around the processed area
- * @param show   show a rectangle around the processed area, useful for
- *               parameters tweaking
- * @param direct if non-zero perform in-place processing
- */
-static void apply_delogo(uint8_t *dst, int dst_linesize,
-                         uint8_t *src, int src_linesize,
-                         int w, int h,
-                         int logo_x, int logo_y, int logo_w, int logo_h,
-                         int band, int show, int direct)
-{
-    int x, y;
-    int interp, dist;
-    uint8_t *xdst, *xsrc;
-
-    uint8_t *topleft, *botleft, *topright;
-    int xclipl, xclipr, yclipt, yclipb;
-    int logo_x1, logo_x2, logo_y1, logo_y2;
-
-    xclipl = FFMAX(-logo_x, 0);
-    xclipr = FFMAX(logo_x+logo_w-w, 0);
-    yclipt = FFMAX(-logo_y, 0);
-    yclipb = FFMAX(logo_y+logo_h-h, 0);
-
-    logo_x1 = logo_x + xclipl;
-    logo_x2 = logo_x + logo_w - xclipr;
-    logo_y1 = logo_y + yclipt;
-    logo_y2 = logo_y + logo_h - yclipb;
-
-    topleft  = src+logo_y1     * src_linesize+logo_x1;
-    topright = src+logo_y1     * src_linesize+logo_x2-1;
-    botleft  = src+(logo_y2-1) * src_linesize+logo_x1;
-
-    if (!direct)
-        av_image_copy_plane(dst, dst_linesize, src, src_linesize, w, h);
-
-    dst += (logo_y1 + 1) * dst_linesize;
-    src += (logo_y1 + 1) * src_linesize;
-
-    for (y = logo_y1+1; y < logo_y2-1; y++) {
-        for (x = logo_x1+1,
-             xdst = dst+logo_x1+1,
-             xsrc = src+logo_x1+1; x < logo_x2-1; x++, xdst++, xsrc++) {
-            interp = (topleft[src_linesize*(y-logo_y  -yclipt)]   +
-                      topleft[src_linesize*(y-logo_y-1-yclipt)]   +
-                      topleft[src_linesize*(y-logo_y+1-yclipt)])  * (logo_w-(x-logo_x))/logo_w
-                   + (topright[src_linesize*(y-logo_y-yclipt)]    +
-                      topright[src_linesize*(y-logo_y-1-yclipt)]  +
-                      topright[src_linesize*(y-logo_y+1-yclipt)]) * (x-logo_x)/logo_w
-                   + (topleft[x-logo_x-xclipl]                    +
-                      topleft[x-logo_x-1-xclipl]                  +
-                      topleft[x-logo_x+1-xclipl])                 * (logo_h-(y-logo_y))/logo_h
-                   + (botleft[x-logo_x-xclipl]                    +
-                      botleft[x-logo_x-1-xclipl]                  +
-                      botleft[x-logo_x+1-xclipl])                 * (y-logo_y)/logo_h;
-            interp /= 6;
-
-            if (y >= logo_y+band && y < logo_y+logo_h-band &&
-                x >= logo_x+band && x < logo_x+logo_w-band) {
-                *xdst = interp;
-            } else {
-                dist = 0;
-                if      (x < logo_x+band)
-                    dist = FFMAX(dist, logo_x-x+band);
-                else if (x >= logo_x+logo_w-band)
-                    dist = FFMAX(dist, x-(logo_x+logo_w-1-band));
-
-                if      (y < logo_y+band)
-                    dist = FFMAX(dist, logo_y-y+band);
-                else if (y >= logo_y+logo_h-band)
-                    dist = FFMAX(dist, y-(logo_y+logo_h-1-band));
-
-                *xdst = (*xsrc*dist + interp*(band-dist))/band;
-                if (show && (dist == band-1))
-                    *xdst = 0;
-            }
-        }
-
-        dst += dst_linesize;
-        src += src_linesize;
-    }
-}
-
-typedef struct {
-    const AVClass *class;
-    int x, y, w, h, band, show;
-}  DelogoContext;
-
-#define OFFSET(x) offsetof(DelogoContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-
-static const AVOption delogo_options[]= {
-    { "x",    "set logo x position",       OFFSET(x),    AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
-    { "y",    "set logo y position",       OFFSET(y),    AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
-    { "w",    "set logo width",            OFFSET(w),    AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
-    { "h",    "set logo height",           OFFSET(h),    AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
-    { "band", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, { .i64 =  4 }, -1, INT_MAX, FLAGS },
-    { "t",    "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, { .i64 =  4 }, -1, INT_MAX, FLAGS },
-    { "show", "show delogo area",          OFFSET(show), AV_OPT_TYPE_INT, { .i64 =  0 },  0, 1,       FLAGS },
-    { NULL },
-};
-
-static const char *delogo_get_name(void *ctx)
-{
-    return "delogo";
-}
-
-static const AVClass delogo_class = {
-    .class_name = "DelogoContext",
-    .item_name  = delogo_get_name,
-    .option     = delogo_options,
-};
-
-static int query_formats(AVFilterContext *ctx)
-{
-    enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV420P,
-        AV_PIX_FMT_YUV411P,  AV_PIX_FMT_YUV410P,  AV_PIX_FMT_YUV440P,
-        AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    DelogoContext *s = ctx->priv;
-
-#define CHECK_UNSET_OPT(opt)                                            \
-    if (s->opt == -1) {                                            \
-        av_log(s, AV_LOG_ERROR, "Option %s was not set.\n", #opt); \
-        return AVERROR(EINVAL);                                         \
-    }
-    CHECK_UNSET_OPT(x);
-    CHECK_UNSET_OPT(y);
-    CHECK_UNSET_OPT(w);
-    CHECK_UNSET_OPT(h);
-
-    if (s->show)
-        s->band = 4;
-
-    av_log(ctx, AV_LOG_DEBUG, "x:%d y:%d, w:%d h:%d band:%d show:%d\n",
-           s->x, s->y, s->w, s->h, s->band, s->show);
-
-    s->w += s->band*2;
-    s->h += s->band*2;
-    s->x -= s->band;
-    s->y -= s->band;
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    DelogoContext *s = inlink->dst->priv;
-    AVFilterLink *outlink = inlink->dst->outputs[0];
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    AVFrame *out;
-    int hsub0 = desc->log2_chroma_w;
-    int vsub0 = desc->log2_chroma_h;
-    int direct = 0;
-    int plane;
-
-    if (av_frame_is_writable(in)) {
-        direct = 1;
-        out = in;
-    } else {
-        out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-        if (!out) {
-            av_frame_free(&in);
-            return AVERROR(ENOMEM);
-        }
-
-        av_frame_copy_props(out, in);
-        out->width  = outlink->w;
-        out->height = outlink->h;
-    }
-
-    for (plane = 0; plane < 4 && in->data[plane]; plane++) {
-        int hsub = plane == 1 || plane == 2 ? hsub0 : 0;
-        int vsub = plane == 1 || plane == 2 ? vsub0 : 0;
-
-        apply_delogo(out->data[plane], out->linesize[plane],
-                     in ->data[plane], in ->linesize[plane],
-                     inlink->w>>hsub, inlink->h>>vsub,
-                     s->x>>hsub, s->y>>vsub,
-                     s->w>>hsub, s->h>>vsub,
-                     s->band>>FFMIN(hsub, vsub),
-                     s->show, direct);
-    }
-
-    if (!direct)
-        av_frame_free(&in);
-
-    return ff_filter_frame(outlink, out);
-}
-
-static const AVFilterPad avfilter_vf_delogo_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_delogo_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_delogo = {
-    .name          = "delogo",
-    .description   = NULL_IF_CONFIG_SMALL("Remove logo from input video."),
-    .priv_size     = sizeof(DelogoContext),
-    .priv_class    = &delogo_class,
-    .init          = init,
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_delogo_inputs,
-    .outputs   = avfilter_vf_delogo_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_drawbox.c b/deps/libav/libavfilter/vf_drawbox.c
deleted file mode 100644
index 2241974..0000000
--- a/deps/libav/libavfilter/vf_drawbox.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2008 Affine Systems, Inc (Michael Sullivan, Bobby Impollonia)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Box drawing filter. Also a nice template for a filter that needs to
- * write in the input frame.
- */
-
-#include "libavutil/colorspace.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/parseutils.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-enum { Y, U, V, A };
-
-typedef struct {
-    const AVClass *class;
-    int x, y, w_opt, h_opt, w, h;
-    char *color_str;
-    unsigned char yuv_color[4];
-    int vsub, hsub;   ///< chroma subsampling
-} DrawBoxContext;
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    DrawBoxContext *s = ctx->priv;
-    uint8_t rgba_color[4];
-
-    if (av_parse_color(rgba_color, s->color_str, -1, ctx) < 0)
-        return AVERROR(EINVAL);
-
-    s->yuv_color[Y] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]);
-    s->yuv_color[U] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
-    s->yuv_color[V] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0);
-    s->yuv_color[A] = rgba_color[3];
-
-    return 0;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV420P,
-        AV_PIX_FMT_YUV411P,  AV_PIX_FMT_YUV410P,
-        AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
-        AV_PIX_FMT_YUV440P,  AV_PIX_FMT_YUVJ440P,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int config_input(AVFilterLink *inlink)
-{
-    DrawBoxContext *s = inlink->dst->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-
-    s->hsub = desc->log2_chroma_w;
-    s->vsub = desc->log2_chroma_h;
-
-    s->w = (s->w_opt > 0) ? s->w_opt : inlink->w;
-    s->h = (s->h_opt > 0) ? s->h_opt : inlink->h;
-
-    av_log(inlink->dst, AV_LOG_VERBOSE, "x:%d y:%d w:%d h:%d color:0x%02X%02X%02X%02X\n",
-           s->w, s->y, s->w, s->h,
-           s->yuv_color[Y], s->yuv_color[U], s->yuv_color[V], s->yuv_color[A]);
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    DrawBoxContext *s = inlink->dst->priv;
-    int plane, x, y, xb = s->x, yb = s->y;
-    unsigned char *row[4];
-
-    for (y = FFMAX(yb, 0); y < frame->height && y < (yb + s->h); y++) {
-        row[0] = frame->data[0] + y * frame->linesize[0];
-
-        for (plane = 1; plane < 3; plane++)
-            row[plane] = frame->data[plane] +
-                 frame->linesize[plane] * (y >> s->vsub);
-
-        for (x = FFMAX(xb, 0); x < (xb + s->w) && x < frame->width; x++) {
-            double alpha = (double)s->yuv_color[A] / 255;
-
-            if ((y - yb < 3) || (yb + s->h - y < 4) ||
-                (x - xb < 3) || (xb + s->w - x < 4)) {
-                row[0][x                 ] = (1 - alpha) * row[0][x                 ] + alpha * s->yuv_color[Y];
-                row[1][x >> s->hsub] = (1 - alpha) * row[1][x >> s->hsub] + alpha * s->yuv_color[U];
-                row[2][x >> s->hsub] = (1 - alpha) * row[2][x >> s->hsub] + alpha * s->yuv_color[V];
-            }
-        }
-    }
-
-    return ff_filter_frame(inlink->dst->outputs[0], frame);
-}
-
-#define OFFSET(x) offsetof(DrawBoxContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "x",      "Horizontal position of the left box edge", OFFSET(x),         AV_OPT_TYPE_INT,    { .i64 = 0 }, INT_MIN, INT_MAX, FLAGS },
-    { "y",      "Vertical position of the top box edge",    OFFSET(y),         AV_OPT_TYPE_INT,    { .i64 = 0 }, INT_MIN, INT_MAX, FLAGS },
-    { "width",  "Width of the box",                         OFFSET(w_opt),     AV_OPT_TYPE_INT,    { .i64 = 0 }, 0,       INT_MAX, FLAGS },
-    { "height", "Height of the box",                        OFFSET(h_opt),     AV_OPT_TYPE_INT,    { .i64 = 0 }, 0,       INT_MAX, FLAGS },
-    { "color",  "Color of the box",                         OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" },    .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass drawbox_class = {
-    .class_name = "drawbox",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_drawbox_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = config_input,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-        .needs_writable   = 1,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_drawbox_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_drawbox = {
-    .name      = "drawbox",
-    .description = NULL_IF_CONFIG_SMALL("Draw a colored box on the input video."),
-    .priv_size = sizeof(DrawBoxContext),
-    .priv_class = &drawbox_class,
-    .init      = init,
-
-    .query_formats   = query_formats,
-    .inputs    = avfilter_vf_drawbox_inputs,
-    .outputs   = avfilter_vf_drawbox_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_drawtext.c b/deps/libav/libavfilter/vf_drawtext.c
deleted file mode 100644
index 314e0fc..0000000
--- a/deps/libav/libavfilter/vf_drawtext.c
+++ /dev/null
@@ -1,880 +0,0 @@
-/*
- * Copyright (c) 2011 Stefano Sabatini
- * Copyright (c) 2010 S.N. Hemanth Meenakshisundaram
- * Copyright (c) 2003 Gustavo Sverzut Barbieri <gsbarbieri at yahoo.com.br>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * drawtext filter, based on the original vhook/drawtext.c
- * filter by Gustavo Sverzut Barbieri
- */
-
-#include <sys/time.h>
-#include <time.h>
-
-#include "libavutil/colorspace.h"
-#include "libavutil/common.h"
-#include "libavutil/file.h"
-#include "libavutil/eval.h"
-#include "libavutil/opt.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/random_seed.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/tree.h"
-#include "libavutil/lfg.h"
-#include "avfilter.h"
-#include "drawutils.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_GLYPH_H
-
-static const char *const var_names[] = {
-    "E",
-    "PHI",
-    "PI",
-    "main_w",    "W", ///< width  of the main    video
-    "main_h",    "H", ///< height of the main    video
-    "text_w",    "w", ///< width  of the overlay text
-    "text_h",    "h", ///< height of the overlay text
-    "x",
-    "y",
-    "n",              ///< number of processed frames
-    "t",              ///< timestamp expressed in seconds
-    NULL
-};
-
-static const char *const fun2_names[] = {
-    "rand"
-};
-
-static double drand(void *opaque, double min, double max)
-{
-    return min + (max-min) / UINT_MAX * av_lfg_get(opaque);
-}
-
-typedef double (*eval_func2)(void *, double a, double b);
-
-static const eval_func2 fun2[] = {
-    drand,
-    NULL
-};
-
-enum var_name {
-    VAR_E,
-    VAR_PHI,
-    VAR_PI,
-    VAR_MAIN_W, VAR_MW,
-    VAR_MAIN_H, VAR_MH,
-    VAR_TEXT_W, VAR_TW,
-    VAR_TEXT_H, VAR_TH,
-    VAR_X,
-    VAR_Y,
-    VAR_N,
-    VAR_T,
-    VAR_VARS_NB
-};
-
-typedef struct {
-    const AVClass *class;
-    uint8_t *fontfile;              ///< font to be used
-    uint8_t *text;                  ///< text to be drawn
-    uint8_t *expanded_text;         ///< used to contain the strftime()-expanded text
-    size_t   expanded_text_size;    ///< size in bytes of the expanded_text buffer
-    int ft_load_flags;              ///< flags used for loading fonts, see FT_LOAD_*
-    FT_Vector *positions;           ///< positions for each element in the text
-    size_t nb_positions;            ///< number of elements of positions array
-    char *textfile;                 ///< file with text to be drawn
-    int x, y;                       ///< position to start drawing text
-    int w, h;                       ///< dimension of the text block
-    int shadowx, shadowy;
-    unsigned int fontsize;          ///< font size to use
-    char *fontcolor_string;         ///< font color as string
-    char *boxcolor_string;          ///< box color as string
-    char *shadowcolor_string;       ///< shadow color as string
-    uint8_t fontcolor[4];           ///< foreground color
-    uint8_t boxcolor[4];            ///< background color
-    uint8_t shadowcolor[4];         ///< shadow color
-    uint8_t fontcolor_rgba[4];      ///< foreground color in RGBA
-    uint8_t boxcolor_rgba[4];       ///< background color in RGBA
-    uint8_t shadowcolor_rgba[4];    ///< shadow color in RGBA
-
-    short int draw_box;             ///< draw box around text - true or false
-    int use_kerning;                ///< font kerning is used - true/false
-    int tabsize;                    ///< tab size
-    int fix_bounds;                 ///< do we let it go out of frame bounds - t/f
-
-    FT_Library library;             ///< freetype font library handle
-    FT_Face face;                   ///< freetype font face handle
-    struct AVTreeNode *glyphs;      ///< rendered glyphs, stored using the UTF-32 char code
-    int hsub, vsub;                 ///< chroma subsampling values
-    int is_packed_rgb;
-    int pixel_step[4];              ///< distance in bytes between the component of each pixel
-    uint8_t rgba_map[4];            ///< map RGBA offsets to the positions in the packed RGBA format
-    uint8_t *box_line[4];           ///< line used for filling the box background
-    char   *x_expr, *y_expr;
-    AVExpr *x_pexpr, *y_pexpr;      ///< parsed expressions for x and y
-    double var_values[VAR_VARS_NB];
-    char   *d_expr;
-    AVExpr *d_pexpr;
-    int draw;                       ///< set to zero to prevent drawing
-    AVLFG  prng;                    ///< random
-} DrawTextContext;
-
-#define OFFSET(x) offsetof(DrawTextContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-
-static const AVOption drawtext_options[]= {
-    { "fontfile",    NULL,                   OFFSET(fontfile),           AV_OPT_TYPE_STRING,                              .flags = FLAGS },
-    { "text",        NULL,                   OFFSET(text),               AV_OPT_TYPE_STRING,                              .flags = FLAGS },
-    { "textfile",    NULL,                   OFFSET(textfile),           AV_OPT_TYPE_STRING,                              .flags = FLAGS },
-    { "fontcolor",   NULL,                   OFFSET(fontcolor_string),   AV_OPT_TYPE_STRING, { .str = "black" },          .flags = FLAGS },
-    { "boxcolor",    NULL,                   OFFSET(boxcolor_string),    AV_OPT_TYPE_STRING, { .str = "white" },          .flags = FLAGS },
-    { "shadowcolor", NULL,                   OFFSET(shadowcolor_string), AV_OPT_TYPE_STRING, { .str = "black" },          .flags = FLAGS },
-    { "box",         NULL,                   OFFSET(draw_box),           AV_OPT_TYPE_INT,    { .i64 = 0       }, 0,       1,       FLAGS },
-    { "fontsize",    NULL,                   OFFSET(fontsize),           AV_OPT_TYPE_INT,    { .i64 = 16      }, 1,       72,      FLAGS },
-    { "x",           NULL,                   OFFSET(x_expr),             AV_OPT_TYPE_STRING, { .str = "0"     },          .flags = FLAGS },
-    { "y",           NULL,                   OFFSET(y_expr),             AV_OPT_TYPE_STRING, { .str = "0"     },          .flags = FLAGS },
-    { "shadowx",     NULL,                   OFFSET(shadowx),            AV_OPT_TYPE_INT,    { .i64 = 0       }, INT_MIN, INT_MAX, FLAGS },
-    { "shadowy",     NULL,                   OFFSET(shadowy),            AV_OPT_TYPE_INT,    { .i64 = 0       }, INT_MIN, INT_MAX, FLAGS },
-    { "tabsize",     NULL,                   OFFSET(tabsize),            AV_OPT_TYPE_INT,    { .i64 = 4       }, 0,       INT_MAX, FLAGS },
-    { "draw",        "if false do not draw", OFFSET(d_expr),             AV_OPT_TYPE_STRING, { .str = "1"     },          .flags = FLAGS },
-    { "fix_bounds",  "if true, check and fix text coords to avoid clipping",
-                                            OFFSET(fix_bounds),          AV_OPT_TYPE_INT,    { .i64 = 1       }, 0,       1,       FLAGS },
-
-    /* FT_LOAD_* flags */
-    { "ft_load_flags", "set font loading flags for libfreetype", OFFSET(ft_load_flags), AV_OPT_TYPE_FLAGS, { .i64 = FT_LOAD_DEFAULT | FT_LOAD_RENDER}, 0, INT_MAX, FLAGS, "ft_load_flags" },
-        { "default",                     NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_DEFAULT },                     .flags = FLAGS, .unit = "ft_load_flags" },
-        { "no_scale",                    NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_NO_SCALE },                    .flags = FLAGS, .unit = "ft_load_flags" },
-        { "no_hinting",                  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_NO_HINTING },                  .flags = FLAGS, .unit = "ft_load_flags" },
-        { "render",                      NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_RENDER },                      .flags = FLAGS, .unit = "ft_load_flags" },
-        { "no_bitmap",                   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_NO_BITMAP },                   .flags = FLAGS, .unit = "ft_load_flags" },
-        { "vertical_layout",             NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_VERTICAL_LAYOUT },             .flags = FLAGS, .unit = "ft_load_flags" },
-        { "force_autohint",              NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_FORCE_AUTOHINT },              .flags = FLAGS, .unit = "ft_load_flags" },
-        { "crop_bitmap",                 NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_CROP_BITMAP },                 .flags = FLAGS, .unit = "ft_load_flags" },
-        { "pedantic",                    NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_PEDANTIC },                    .flags = FLAGS, .unit = "ft_load_flags" },
-        { "ignore_global_advance_width", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH }, .flags = FLAGS, .unit = "ft_load_flags" },
-        { "no_recurse",                  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_NO_RECURSE },                  .flags = FLAGS, .unit = "ft_load_flags" },
-        { "ignore_transform",            NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_IGNORE_TRANSFORM },            .flags = FLAGS, .unit = "ft_load_flags" },
-        { "monochrome",                  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_MONOCHROME },                  .flags = FLAGS, .unit = "ft_load_flags" },
-        { "linear_design",               NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_LINEAR_DESIGN },               .flags = FLAGS, .unit = "ft_load_flags" },
-        { "no_autohint",                 NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FT_LOAD_NO_AUTOHINT },                 .flags = FLAGS, .unit = "ft_load_flags" },
-    { NULL},
-};
-
-static const char *drawtext_get_name(void *ctx)
-{
-    return "drawtext";
-}
-
-static const AVClass drawtext_class = {
-    "DrawTextContext",
-    drawtext_get_name,
-    drawtext_options
-};
-
-#undef __FTERRORS_H__
-#define FT_ERROR_START_LIST {
-#define FT_ERRORDEF(e, v, s) { (e), (s) },
-#define FT_ERROR_END_LIST { 0, NULL } };
-
-struct ft_error
-{
-    int err;
-    const char *err_msg;
-} static ft_errors[] =
-#include FT_ERRORS_H
-
-#define FT_ERRMSG(e) ft_errors[e].err_msg
-
-typedef struct {
-    FT_Glyph *glyph;
-    uint32_t code;
-    FT_Bitmap bitmap; ///< array holding bitmaps of font
-    FT_BBox bbox;
-    int advance;
-    int bitmap_left;
-    int bitmap_top;
-} Glyph;
-
-static int glyph_cmp(void *key, const void *b)
-{
-    const Glyph *a = key, *bb = b;
-    int64_t diff = (int64_t)a->code - (int64_t)bb->code;
-    return diff > 0 ? 1 : diff < 0 ? -1 : 0;
-}
-
-/**
- * Load glyphs corresponding to the UTF-32 codepoint code.
- */
-static int load_glyph(AVFilterContext *ctx, Glyph **glyph_ptr, uint32_t code)
-{
-    DrawTextContext *s = ctx->priv;
-    Glyph *glyph;
-    struct AVTreeNode *node = NULL;
-    int ret;
-
-    /* load glyph into s->face->glyph */
-    if (FT_Load_Char(s->face, code, s->ft_load_flags))
-        return AVERROR(EINVAL);
-
-    /* save glyph */
-    if (!(glyph = av_mallocz(sizeof(*glyph))) ||
-        !(glyph->glyph = av_mallocz(sizeof(*glyph->glyph)))) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-    glyph->code  = code;
-
-    if (FT_Get_Glyph(s->face->glyph, glyph->glyph)) {
-        ret = AVERROR(EINVAL);
-        goto error;
-    }
-
-    glyph->bitmap      = s->face->glyph->bitmap;
-    glyph->bitmap_left = s->face->glyph->bitmap_left;
-    glyph->bitmap_top  = s->face->glyph->bitmap_top;
-    glyph->advance     = s->face->glyph->advance.x >> 6;
-
-    /* measure text height to calculate text_height (or the maximum text height) */
-    FT_Glyph_Get_CBox(*glyph->glyph, ft_glyph_bbox_pixels, &glyph->bbox);
-
-    /* cache the newly created glyph */
-    if (!(node = av_tree_node_alloc())) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-    av_tree_insert(&s->glyphs, glyph, glyph_cmp, &node);
-
-    if (glyph_ptr)
-        *glyph_ptr = glyph;
-    return 0;
-
-error:
-    if (glyph)
-        av_freep(&glyph->glyph);
-    av_freep(&glyph);
-    av_freep(&node);
-    return ret;
-}
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    int err;
-    DrawTextContext *s = ctx->priv;
-    Glyph *glyph;
-
-    if (!s->fontfile) {
-        av_log(ctx, AV_LOG_ERROR, "No font filename provided\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (s->textfile) {
-        uint8_t *textbuf;
-        size_t textbuf_size;
-
-        if (s->text) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Both text and text file provided. Please provide only one\n");
-            return AVERROR(EINVAL);
-        }
-        if ((err = av_file_map(s->textfile, &textbuf, &textbuf_size, 0, ctx)) < 0) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "The text file '%s' could not be read or is empty\n",
-                   s->textfile);
-            return err;
-        }
-
-        if (!(s->text = av_malloc(textbuf_size+1)))
-            return AVERROR(ENOMEM);
-        memcpy(s->text, textbuf, textbuf_size);
-        s->text[textbuf_size] = 0;
-        av_file_unmap(textbuf, textbuf_size);
-    }
-
-    if (!s->text) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Either text or a valid file must be provided\n");
-        return AVERROR(EINVAL);
-    }
-
-    if ((err = av_parse_color(s->fontcolor_rgba, s->fontcolor_string, -1, ctx))) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid font color '%s'\n", s->fontcolor_string);
-        return err;
-    }
-
-    if ((err = av_parse_color(s->boxcolor_rgba, s->boxcolor_string, -1, ctx))) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid box color '%s'\n", s->boxcolor_string);
-        return err;
-    }
-
-    if ((err = av_parse_color(s->shadowcolor_rgba, s->shadowcolor_string, -1, ctx))) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid shadow color '%s'\n", s->shadowcolor_string);
-        return err;
-    }
-
-    if ((err = FT_Init_FreeType(&(s->library)))) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Could not load FreeType: %s\n", FT_ERRMSG(err));
-        return AVERROR(EINVAL);
-    }
-
-    /* load the face, and set up the encoding, which is by default UTF-8 */
-    if ((err = FT_New_Face(s->library, s->fontfile, 0, &s->face))) {
-        av_log(ctx, AV_LOG_ERROR, "Could not load fontface from file '%s': %s\n",
-               s->fontfile, FT_ERRMSG(err));
-        return AVERROR(EINVAL);
-    }
-    if ((err = FT_Set_Pixel_Sizes(s->face, 0, s->fontsize))) {
-        av_log(ctx, AV_LOG_ERROR, "Could not set font size to %d pixels: %s\n",
-               s->fontsize, FT_ERRMSG(err));
-        return AVERROR(EINVAL);
-    }
-
-    s->use_kerning = FT_HAS_KERNING(s->face);
-
-    /* load the fallback glyph with code 0 */
-    load_glyph(ctx, NULL, 0);
-
-    /* set the tabsize in pixels */
-    if ((err = load_glyph(ctx, &glyph, ' ') < 0)) {
-        av_log(ctx, AV_LOG_ERROR, "Could not set tabsize.\n");
-        return err;
-    }
-    s->tabsize *= glyph->advance;
-
-#if !HAVE_LOCALTIME_R
-    av_log(ctx, AV_LOG_WARNING, "strftime() expansion unavailable!\n");
-#endif
-
-    return 0;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_ARGB,    AV_PIX_FMT_RGBA,
-        AV_PIX_FMT_ABGR,    AV_PIX_FMT_BGRA,
-        AV_PIX_FMT_RGB24,   AV_PIX_FMT_BGR24,
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P,
-        AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int glyph_enu_free(void *opaque, void *elem)
-{
-    av_free(elem);
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    DrawTextContext *s = ctx->priv;
-    int i;
-
-    av_expr_free(s->x_pexpr);
-    av_expr_free(s->y_pexpr);
-    av_expr_free(s->d_pexpr);
-    s->x_pexpr = s->y_pexpr = s->d_pexpr = NULL;
-    av_freep(&s->expanded_text);
-    av_freep(&s->positions);
-    av_tree_enumerate(s->glyphs, NULL, NULL, glyph_enu_free);
-    av_tree_destroy(s->glyphs);
-    s->glyphs = 0;
-    FT_Done_Face(s->face);
-    FT_Done_FreeType(s->library);
-
-    for (i = 0; i < 4; i++) {
-        av_freep(&s->box_line[i]);
-        s->pixel_step[i] = 0;
-    }
-
-}
-
-static inline int is_newline(uint32_t c)
-{
-    return c == '\n' || c == '\r' || c == '\f' || c == '\v';
-}
-
-static int dtext_prepare_text(AVFilterContext *ctx)
-{
-    DrawTextContext *s = ctx->priv;
-    uint32_t code = 0, prev_code = 0;
-    int x = 0, y = 0, i = 0, ret;
-    int text_height, baseline;
-    char *text = s->text;
-    uint8_t *p;
-    int str_w = 0, len;
-    int y_min = 32000, y_max = -32000;
-    FT_Vector delta;
-    Glyph *glyph = NULL, *prev_glyph = NULL;
-    Glyph dummy = { 0 };
-    int width  = ctx->inputs[0]->w;
-    int height = ctx->inputs[0]->h;
-
-#if HAVE_LOCALTIME_R
-    time_t now = time(0);
-    struct tm ltime;
-    uint8_t *buf = s->expanded_text;
-    int buf_size = s->expanded_text_size;
-
-    if (!buf)
-        buf_size = 2*strlen(s->text)+1;
-
-    localtime_r(&now, &ltime);
-
-    while ((buf = av_realloc(buf, buf_size))) {
-        *buf = 1;
-        if (strftime(buf, buf_size, s->text, &ltime) != 0 || *buf == 0)
-            break;
-        buf_size *= 2;
-    }
-
-    if (!buf)
-        return AVERROR(ENOMEM);
-    text = s->expanded_text = buf;
-    s->expanded_text_size = buf_size;
-#endif
-
-    if ((len = strlen(text)) > s->nb_positions) {
-        FT_Vector *p = av_realloc(s->positions,
-                                  len * sizeof(*s->positions));
-        if (!p) {
-            av_freep(s->positions);
-            s->nb_positions = 0;
-            return AVERROR(ENOMEM);
-        } else {
-            s->positions = p;
-            s->nb_positions = len;
-        }
-    }
-
-    /* load and cache glyphs */
-    for (i = 0, p = text; *p; i++) {
-        GET_UTF8(code, *p++, continue;);
-
-        /* get glyph */
-        dummy.code = code;
-        glyph = av_tree_find(s->glyphs, &dummy, glyph_cmp, NULL);
-        if (!glyph) {
-            ret = load_glyph(ctx, &glyph, code);
-            if (ret)
-                return ret;
-        }
-
-        y_min = FFMIN(glyph->bbox.yMin, y_min);
-        y_max = FFMAX(glyph->bbox.yMax, y_max);
-    }
-    text_height = y_max - y_min;
-    baseline    = y_max;
-
-    /* compute and save position for each glyph */
-    glyph = NULL;
-    for (i = 0, p = text; *p; i++) {
-        GET_UTF8(code, *p++, continue;);
-
-        /* skip the \n in the sequence \r\n */
-        if (prev_code == '\r' && code == '\n')
-            continue;
-
-        prev_code = code;
-        if (is_newline(code)) {
-            str_w = FFMAX(str_w, x - s->x);
-            y += text_height;
-            x = 0;
-            continue;
-        }
-
-        /* get glyph */
-        prev_glyph = glyph;
-        dummy.code = code;
-        glyph = av_tree_find(s->glyphs, &dummy, glyph_cmp, NULL);
-
-        /* kerning */
-        if (s->use_kerning && prev_glyph && glyph->code) {
-            FT_Get_Kerning(s->face, prev_glyph->code, glyph->code,
-                           ft_kerning_default, &delta);
-            x += delta.x >> 6;
-        }
-
-        if (x + glyph->bbox.xMax >= width) {
-            str_w = FFMAX(str_w, x);
-            y += text_height;
-            x = 0;
-        }
-
-        /* save position */
-        s->positions[i].x = x + glyph->bitmap_left;
-        s->positions[i].y = y - glyph->bitmap_top + baseline;
-        if (code == '\t') x  = (x / s->tabsize + 1)*s->tabsize;
-        else              x += glyph->advance;
-    }
-
-    str_w = FFMIN(width - 1, FFMAX(str_w, x));
-    y     = FFMIN(y + text_height, height - 1);
-
-    s->w = str_w;
-    s->var_values[VAR_TEXT_W] = s->var_values[VAR_TW] = s->w;
-    s->h = y;
-    s->var_values[VAR_TEXT_H] = s->var_values[VAR_TH] = s->h;
-
-    return 0;
-}
-
-
-static int config_input(AVFilterLink *inlink)
-{
-    AVFilterContext *ctx  = inlink->dst;
-    DrawTextContext *s = ctx->priv;
-    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
-    int ret;
-
-    s->hsub = pix_desc->log2_chroma_w;
-    s->vsub = pix_desc->log2_chroma_h;
-
-    s->var_values[VAR_E  ] = M_E;
-    s->var_values[VAR_PHI] = M_PHI;
-    s->var_values[VAR_PI ] = M_PI;
-
-    s->var_values[VAR_MAIN_W] =
-        s->var_values[VAR_MW] = ctx->inputs[0]->w;
-    s->var_values[VAR_MAIN_H] =
-        s->var_values[VAR_MH] = ctx->inputs[0]->h;
-
-    s->var_values[VAR_X] = 0;
-    s->var_values[VAR_Y] = 0;
-    s->var_values[VAR_T] = NAN;
-
-    av_lfg_init(&s->prng, av_get_random_seed());
-
-    av_expr_free(s->x_pexpr);
-    av_expr_free(s->y_pexpr);
-    av_expr_free(s->d_pexpr);
-    s->x_pexpr = s->y_pexpr = s->d_pexpr = NULL;
-    if ((ret = av_expr_parse(&s->x_pexpr, s->x_expr, var_names,
-                             NULL, NULL, fun2_names, fun2, 0, ctx)) < 0 ||
-        (ret = av_expr_parse(&s->y_pexpr, s->y_expr, var_names,
-                             NULL, NULL, fun2_names, fun2, 0, ctx)) < 0 ||
-        (ret = av_expr_parse(&s->d_pexpr, s->d_expr, var_names,
-                             NULL, NULL, fun2_names, fun2, 0, ctx)) < 0)
-        return AVERROR(EINVAL);
-
-    if ((ret =
-         ff_fill_line_with_color(s->box_line, s->pixel_step,
-                                 inlink->w, s->boxcolor,
-                                 inlink->format, s->boxcolor_rgba,
-                                 &s->is_packed_rgb, s->rgba_map)) < 0)
-        return ret;
-
-    if (!s->is_packed_rgb) {
-        uint8_t *rgba = s->fontcolor_rgba;
-        s->fontcolor[0] = RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
-        s->fontcolor[1] = RGB_TO_U_CCIR(rgba[0], rgba[1], rgba[2], 0);
-        s->fontcolor[2] = RGB_TO_V_CCIR(rgba[0], rgba[1], rgba[2], 0);
-        s->fontcolor[3] = rgba[3];
-        rgba = s->shadowcolor_rgba;
-        s->shadowcolor[0] = RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
-        s->shadowcolor[1] = RGB_TO_U_CCIR(rgba[0], rgba[1], rgba[2], 0);
-        s->shadowcolor[2] = RGB_TO_V_CCIR(rgba[0], rgba[1], rgba[2], 0);
-        s->shadowcolor[3] = rgba[3];
-    }
-
-    s->draw = 1;
-
-    return dtext_prepare_text(ctx);
-}
-
-#define GET_BITMAP_VAL(r, c)                                            \
-    bitmap->pixel_mode == FT_PIXEL_MODE_MONO ?                          \
-        (bitmap->buffer[(r) * bitmap->pitch + ((c)>>3)] & (0x80 >> ((c)&7))) * 255 : \
-         bitmap->buffer[(r) * bitmap->pitch +  (c)]
-
-#define SET_PIXEL_YUV(frame, yuva_color, val, x, y, hsub, vsub) {           \
-    luma_pos    = ((x)          ) + ((y)          ) * frame->linesize[0]; \
-    alpha = yuva_color[3] * (val) * 129;                               \
-    frame->data[0][luma_pos]    = (alpha * yuva_color[0] + (255*255*129 - alpha) * frame->data[0][luma_pos]   ) >> 23; \
-    if (((x) & ((1<<(hsub)) - 1)) == 0 && ((y) & ((1<<(vsub)) - 1)) == 0) {\
-        chroma_pos1 = ((x) >> (hsub)) + ((y) >> (vsub)) * frame->linesize[1]; \
-        chroma_pos2 = ((x) >> (hsub)) + ((y) >> (vsub)) * frame->linesize[2]; \
-        frame->data[1][chroma_pos1] = (alpha * yuva_color[1] + (255*255*129 - alpha) * frame->data[1][chroma_pos1]) >> 23; \
-        frame->data[2][chroma_pos2] = (alpha * yuva_color[2] + (255*255*129 - alpha) * frame->data[2][chroma_pos2]) >> 23; \
-    }\
-}
-
-static inline int draw_glyph_yuv(AVFrame *frame, FT_Bitmap *bitmap, unsigned int x,
-                                 unsigned int y, unsigned int width, unsigned int height,
-                                 const uint8_t yuva_color[4], int hsub, int vsub)
-{
-    int r, c, alpha;
-    unsigned int luma_pos, chroma_pos1, chroma_pos2;
-    uint8_t src_val;
-
-    for (r = 0; r < bitmap->rows && r+y < height; r++) {
-        for (c = 0; c < bitmap->width && c+x < width; c++) {
-            /* get intensity value in the glyph bitmap (source) */
-            src_val = GET_BITMAP_VAL(r, c);
-            if (!src_val)
-                continue;
-
-            SET_PIXEL_YUV(frame, yuva_color, src_val, c+x, y+r, hsub, vsub);
-        }
-    }
-
-    return 0;
-}
-
-#define SET_PIXEL_RGB(frame, rgba_color, val, x, y, pixel_step, r_off, g_off, b_off, a_off) { \
-    p   = frame->data[0] + (x) * pixel_step + ((y) * frame->linesize[0]); \
-    alpha = rgba_color[3] * (val) * 129;                              \
-    *(p+r_off) = (alpha * rgba_color[0] + (255*255*129 - alpha) * *(p+r_off)) >> 23; \
-    *(p+g_off) = (alpha * rgba_color[1] + (255*255*129 - alpha) * *(p+g_off)) >> 23; \
-    *(p+b_off) = (alpha * rgba_color[2] + (255*255*129 - alpha) * *(p+b_off)) >> 23; \
-}
-
-static inline int draw_glyph_rgb(AVFrame *frame, FT_Bitmap *bitmap,
-                                 unsigned int x, unsigned int y,
-                                 unsigned int width, unsigned int height, int pixel_step,
-                                 const uint8_t rgba_color[4], const uint8_t rgba_map[4])
-{
-    int r, c, alpha;
-    uint8_t *p;
-    uint8_t src_val;
-
-    for (r = 0; r < bitmap->rows && r+y < height; r++) {
-        for (c = 0; c < bitmap->width && c+x < width; c++) {
-            /* get intensity value in the glyph bitmap (source) */
-            src_val = GET_BITMAP_VAL(r, c);
-            if (!src_val)
-                continue;
-
-            SET_PIXEL_RGB(frame, rgba_color, src_val, c+x, y+r, pixel_step,
-                          rgba_map[0], rgba_map[1], rgba_map[2], rgba_map[3]);
-        }
-    }
-
-    return 0;
-}
-
-static inline void drawbox(AVFrame *frame, unsigned int x, unsigned int y,
-                           unsigned int width, unsigned int height,
-                           uint8_t *line[4], int pixel_step[4], uint8_t color[4],
-                           int hsub, int vsub, int is_rgba_packed, uint8_t rgba_map[4])
-{
-    int i, j, alpha;
-
-    if (color[3] != 0xFF) {
-        if (is_rgba_packed) {
-            uint8_t *p;
-            for (j = 0; j < height; j++)
-                for (i = 0; i < width; i++)
-                    SET_PIXEL_RGB(frame, color, 255, i+x, y+j, pixel_step[0],
-                                  rgba_map[0], rgba_map[1], rgba_map[2], rgba_map[3]);
-        } else {
-            unsigned int luma_pos, chroma_pos1, chroma_pos2;
-            for (j = 0; j < height; j++)
-                for (i = 0; i < width; i++)
-                    SET_PIXEL_YUV(frame, color, 255, i+x, y+j, hsub, vsub);
-        }
-    } else {
-        ff_draw_rectangle(frame->data, frame->linesize,
-                          line, pixel_step, hsub, vsub,
-                          x, y, width, height);
-    }
-}
-
-static int draw_glyphs(DrawTextContext *s, AVFrame *frame,
-                       int width, int height, const uint8_t rgbcolor[4], const uint8_t yuvcolor[4], int x, int y)
-{
-    char *text = HAVE_LOCALTIME_R ? s->expanded_text : s->text;
-    uint32_t code = 0;
-    int i;
-    uint8_t *p;
-    Glyph *glyph = NULL;
-
-    for (i = 0, p = text; *p; i++) {
-        Glyph dummy = { 0 };
-        GET_UTF8(code, *p++, continue;);
-
-        /* skip new line chars, just go to new line */
-        if (code == '\n' || code == '\r' || code == '\t')
-            continue;
-
-        dummy.code = code;
-        glyph = av_tree_find(s->glyphs, &dummy, (void *)glyph_cmp, NULL);
-
-        if (glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO &&
-            glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)
-            return AVERROR(EINVAL);
-
-        if (s->is_packed_rgb) {
-            draw_glyph_rgb(frame, &glyph->bitmap,
-                           s->positions[i].x+x, s->positions[i].y+y, width, height,
-                           s->pixel_step[0], rgbcolor, s->rgba_map);
-        } else {
-            draw_glyph_yuv(frame, &glyph->bitmap,
-                           s->positions[i].x+x, s->positions[i].y+y, width, height,
-                           yuvcolor, s->hsub, s->vsub);
-        }
-    }
-
-    return 0;
-}
-
-static int draw_text(AVFilterContext *ctx, AVFrame *frame,
-                     int width, int height)
-{
-    DrawTextContext *s = ctx->priv;
-    int ret;
-
-    /* draw box */
-    if (s->draw_box)
-        drawbox(frame, s->x, s->y, s->w, s->h,
-                s->box_line, s->pixel_step, s->boxcolor,
-                s->hsub, s->vsub, s->is_packed_rgb,
-                s->rgba_map);
-
-    if (s->shadowx || s->shadowy) {
-        if ((ret = draw_glyphs(s, frame, width, height,
-                               s->shadowcolor_rgba,
-                               s->shadowcolor,
-                               s->x + s->shadowx,
-                               s->y + s->shadowy)) < 0)
-            return ret;
-    }
-
-    if ((ret = draw_glyphs(s, frame, width, height,
-                           s->fontcolor_rgba,
-                           s->fontcolor,
-                           s->x,
-                           s->y)) < 0)
-        return ret;
-
-    return 0;
-}
-
-static inline int normalize_double(int *n, double d)
-{
-    int ret = 0;
-
-    if (isnan(d)) {
-        ret = AVERROR(EINVAL);
-    } else if (d > INT_MAX || d < INT_MIN) {
-        *n = d > INT_MAX ? INT_MAX : INT_MIN;
-        ret = AVERROR(EINVAL);
-    } else
-        *n = round(d);
-
-    return ret;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    DrawTextContext *s = ctx->priv;
-    int ret = 0;
-
-    if ((ret = dtext_prepare_text(ctx)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Can't draw text\n");
-        av_frame_free(&frame);
-        return ret;
-    }
-
-    s->var_values[VAR_T] = frame->pts == AV_NOPTS_VALUE ?
-        NAN : frame->pts * av_q2d(inlink->time_base);
-    s->var_values[VAR_X] =
-        av_expr_eval(s->x_pexpr, s->var_values, &s->prng);
-    s->var_values[VAR_Y] =
-        av_expr_eval(s->y_pexpr, s->var_values, &s->prng);
-    s->var_values[VAR_X] =
-        av_expr_eval(s->x_pexpr, s->var_values, &s->prng);
-
-    s->draw = av_expr_eval(s->d_pexpr, s->var_values, &s->prng);
-
-    normalize_double(&s->x, s->var_values[VAR_X]);
-    normalize_double(&s->y, s->var_values[VAR_Y]);
-
-    if (s->fix_bounds) {
-        if (s->x < 0) s->x = 0;
-        if (s->y < 0) s->y = 0;
-        if ((unsigned)s->x + (unsigned)s->w > inlink->w)
-            s->x = inlink->w - s->w;
-        if ((unsigned)s->y + (unsigned)s->h > inlink->h)
-            s->y = inlink->h - s->h;
-    }
-
-    s->x &= ~((1 << s->hsub) - 1);
-    s->y &= ~((1 << s->vsub) - 1);
-
-    av_dlog(ctx, "n:%d t:%f x:%d y:%d x+w:%d y+h:%d\n",
-            (int)s->var_values[VAR_N], s->var_values[VAR_T],
-            s->x, s->y, s->x+s->w, s->y+s->h);
-
-    if (s->draw)
-        draw_text(inlink->dst, frame, frame->width, frame->height);
-
-    s->var_values[VAR_N] += 1.0;
-
-    return ff_filter_frame(inlink->dst->outputs[0], frame);
-}
-
-static const AVFilterPad avfilter_vf_drawtext_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-        .config_props     = config_input,
-        .needs_writable   = 1,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_drawtext_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_drawtext = {
-    .name          = "drawtext",
-    .description   = NULL_IF_CONFIG_SMALL("Draw text on top of video frames using libfreetype library."),
-    .priv_size     = sizeof(DrawTextContext),
-    .priv_class    = &drawtext_class,
-    .init          = init,
-    .uninit        = uninit,
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_drawtext_inputs,
-    .outputs   = avfilter_vf_drawtext_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_fade.c b/deps/libav/libavfilter/vf_fade.c
deleted file mode 100644
index b6bd775..0000000
--- a/deps/libav/libavfilter/vf_fade.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2010 Brandon Mintern
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * video fade filter
- * based heavily on vf_negate.c by Bobby Bingham
- */
-
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-#define FADE_IN  0
-#define FADE_OUT 1
-
-typedef struct {
-    const AVClass *class;
-    int type;
-    int factor, fade_per_frame;
-    int start_frame, nb_frames;
-    unsigned int frame_index, stop_frame;
-    int hsub, vsub, bpp;
-} FadeContext;
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    FadeContext *s = ctx->priv;
-
-    s->fade_per_frame = (1 << 16) / s->nb_frames;
-    if (s->type == FADE_IN) {
-        s->factor = 0;
-    } else if (s->type == FADE_OUT) {
-        s->fade_per_frame = -s->fade_per_frame;
-        s->factor = (1 << 16);
-    }
-    s->stop_frame = s->start_frame + s->nb_frames;
-
-    av_log(ctx, AV_LOG_VERBOSE,
-           "type:%s start_frame:%d nb_frames:%d\n",
-           s->type == FADE_IN ? "in" : "out", s->start_frame,
-           s->nb_frames);
-    return 0;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV420P,
-        AV_PIX_FMT_YUV411P,  AV_PIX_FMT_YUV410P,
-        AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
-        AV_PIX_FMT_YUV440P,  AV_PIX_FMT_YUVJ440P,
-        AV_PIX_FMT_RGB24,    AV_PIX_FMT_BGR24,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int config_props(AVFilterLink *inlink)
-{
-    FadeContext *s = inlink->dst->priv;
-    const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(inlink->format);
-
-    s->hsub = pixdesc->log2_chroma_w;
-    s->vsub = pixdesc->log2_chroma_h;
-
-    s->bpp = av_get_bits_per_pixel(pixdesc) >> 3;
-    return 0;
-}
-
-static int filter_slice_luma(AVFilterContext *ctx, void *arg, int jobnr,
-                             int nb_jobs)
-{
-    FadeContext *s = ctx->priv;
-    AVFrame *frame = arg;
-    int slice_h     = frame->height / nb_jobs;
-    int slice_start = jobnr * slice_h;
-    int slice_end   = (jobnr == nb_jobs - 1) ? frame->height : (jobnr + 1) * slice_h;
-    int i, j;
-
-    for (i = slice_start; i < slice_end; i++) {
-        uint8_t *p = frame->data[0] + i * frame->linesize[0];
-        for (j = 0; j < frame->width * s->bpp; j++) {
-            /* s->factor is using 16 lower-order bits for decimal
-             * places. 32768 = 1 << 15, it is an integer representation
-             * of 0.5 and is for rounding. */
-            *p = (*p * s->factor + 32768) >> 16;
-            p++;
-        }
-    }
-
-    return 0;
-}
-
-static int filter_slice_chroma(AVFilterContext *ctx, void *arg, int jobnr,
-                               int nb_jobs)
-{
-    FadeContext *s = ctx->priv;
-    AVFrame *frame = arg;
-    int slice_h     = FFALIGN(frame->height / nb_jobs, 1 << s->vsub);
-    int slice_start = jobnr * slice_h;
-    int slice_end   = (jobnr == nb_jobs - 1) ? frame->height : (jobnr + 1) * slice_h;
-    int i, j, plane;
-
-    for (plane = 1; plane < 3; plane++) {
-        for (i = slice_start; i < slice_end; i++) {
-            uint8_t *p = frame->data[plane] + (i >> s->vsub) * frame->linesize[plane];
-            for (j = 0; j < frame->width >> s->hsub; j++) {
-                /* 8421367 = ((128 << 1) + 1) << 15. It is an integer
-                 * representation of 128.5. The .5 is for rounding
-                 * purposes. */
-                *p = ((*p - 128) * s->factor + 8421367) >> 16;
-                p++;
-            }
-        }
-    }
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    FadeContext *s       = ctx->priv;
-
-    if (s->factor < UINT16_MAX) {
-        /* luma or rgb plane */
-        ctx->internal->execute(ctx, filter_slice_luma, frame, NULL,
-                               FFMIN(frame->height, ctx->graph->nb_threads));
-
-        if (frame->data[1] && frame->data[2]) {
-            /* chroma planes */
-            ctx->internal->execute(ctx, filter_slice_chroma, frame, NULL,
-                                   FFMIN(frame->height, ctx->graph->nb_threads));
-        }
-    }
-
-    if (s->frame_index >= s->start_frame &&
-        s->frame_index <= s->stop_frame)
-        s->factor += s->fade_per_frame;
-    s->factor = av_clip_uint16(s->factor);
-    s->frame_index++;
-
-    return ff_filter_frame(inlink->dst->outputs[0], frame);
-}
-
-#define OFFSET(x) offsetof(FadeContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "type", "'in' or 'out' for fade-in/fade-out", OFFSET(type), AV_OPT_TYPE_INT, { .i64 = FADE_IN }, FADE_IN, FADE_OUT, FLAGS, "type" },
-        { "in",  "fade-in",  0, AV_OPT_TYPE_CONST, { .i64 = FADE_IN },  .unit = "type" },
-        { "out", "fade-out", 0, AV_OPT_TYPE_CONST, { .i64 = FADE_OUT }, .unit = "type" },
-    { "start_frame", "Number of the first frame to which to apply the effect.",
-                                                    OFFSET(start_frame), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
-    { "nb_frames",   "Number of frames to which the effect should be applied.",
-                                                    OFFSET(nb_frames),   AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, FLAGS },
-    { NULL },
-};
-
-static const AVClass fade_class = {
-    .class_name = "fade",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_fade_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = config_props,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-        .needs_writable   = 1,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_fade_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_fade = {
-    .name          = "fade",
-    .description   = NULL_IF_CONFIG_SMALL("Fade in/out input video"),
-    .init          = init,
-    .priv_size     = sizeof(FadeContext),
-    .priv_class    = &fade_class,
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_fade_inputs,
-    .outputs   = avfilter_vf_fade_outputs,
-    .flags     = AVFILTER_FLAG_SLICE_THREADS,
-};
diff --git a/deps/libav/libavfilter/vf_fieldorder.c b/deps/libav/libavfilter/vf_fieldorder.c
deleted file mode 100644
index 5185cf4..0000000
--- a/deps/libav/libavfilter/vf_fieldorder.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 2011 Mark Himsley
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * video field order filter, heavily influenced by vf_pad.c
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    const AVClass *class;
-    int dst_tff;               ///< output bff/tff
-    int          line_size[4]; ///< bytes of pixel data per line for each plane
-} FieldOrderContext;
-
-static int query_formats(AVFilterContext *ctx)
-{
-    AVFilterFormats  *formats;
-    enum AVPixelFormat pix_fmt;
-    int              ret;
-
-    /** accept any input pixel format that is not hardware accelerated, not
-     *  a bitstream format, and does not have vertically sub-sampled chroma */
-    if (ctx->inputs[0]) {
-        formats = NULL;
-        for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) {
-            const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-            if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL ||
-                  desc->flags & AV_PIX_FMT_FLAG_BITSTREAM) &&
-                desc->nb_components && !desc->log2_chroma_h &&
-                (ret = ff_add_format(&formats, pix_fmt)) < 0) {
-                ff_formats_unref(&formats);
-                return ret;
-            }
-        }
-        ff_formats_ref(formats, &ctx->inputs[0]->out_formats);
-        ff_formats_ref(formats, &ctx->outputs[0]->in_formats);
-    }
-
-    return 0;
-}
-
-static int config_input(AVFilterLink *inlink)
-{
-    AVFilterContext   *ctx = inlink->dst;
-    FieldOrderContext *s   = ctx->priv;
-    int               plane;
-
-    /** full an array with the number of bytes that the video
-     *  data occupies per line for each plane of the input video */
-    for (plane = 0; plane < 4; plane++) {
-        s->line_size[plane] = av_image_get_linesize(inlink->format, inlink->w,
-                                                    plane);
-    }
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext   *ctx     = inlink->dst;
-    FieldOrderContext *s       = ctx->priv;
-    AVFilterLink      *outlink = ctx->outputs[0];
-    int h, plane, line_step, line_size, line;
-    uint8_t *data;
-
-    if (!frame->interlaced_frame ||
-        frame->top_field_first == s->dst_tff) {
-        av_log(ctx, AV_LOG_VERBOSE,
-               "Skipping %s.\n",
-               frame->interlaced_frame ?
-               "frame with same field order" : "progressive frame");
-        return ff_filter_frame(outlink, frame);
-    }
-
-    av_dlog(ctx,
-            "picture will move %s one line\n",
-            s->dst_tff ? "up" : "down");
-    h = frame->height;
-    for (plane = 0; plane < 4 && frame->data[plane]; plane++) {
-        line_step = frame->linesize[plane];
-        line_size = s->line_size[plane];
-        data = frame->data[plane];
-        if (s->dst_tff) {
-            /** Move every line up one line, working from
-             *  the top to the bottom of the frame.
-             *  The original top line is lost.
-             *  The new last line is created as a copy of the
-             *  penultimate line from that field. */
-            for (line = 0; line < h; line++) {
-                if (1 + line < frame->height) {
-                    memcpy(data, data + line_step, line_size);
-                } else {
-                    memcpy(data, data - line_step - line_step, line_size);
-                }
-                data += line_step;
-            }
-        } else {
-            /** Move every line down one line, working from
-             *  the bottom to the top of the frame.
-             *  The original bottom line is lost.
-             *  The new first line is created as a copy of the
-             *  second line from that field. */
-            data += (h - 1) * line_step;
-            for (line = h - 1; line >= 0 ; line--) {
-                if (line > 0) {
-                    memcpy(data, data - line_step, line_size);
-                } else {
-                    memcpy(data, data + line_step + line_step, line_size);
-                }
-                data -= line_step;
-            }
-        }
-    }
-    frame->top_field_first = s->dst_tff;
-
-    return ff_filter_frame(outlink, frame);
-}
-
-#define OFFSET(x) offsetof(FieldOrderContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "order", "output field order", OFFSET(dst_tff), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS, "order" },
-        { "bff", "bottom field first", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, .unit = "order" },
-        { "tff", "top field first",    0, AV_OPT_TYPE_CONST, { .i64 = 1 }, .unit = "order" },
-    { NULL },
-};
-
-static const AVClass fieldorder_class = {
-    .class_name = "fieldorder",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_fieldorder_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = config_input,
-        .filter_frame     = filter_frame,
-        .needs_writable   = 1,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_fieldorder_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_fieldorder = {
-    .name          = "fieldorder",
-    .description   = NULL_IF_CONFIG_SMALL("Set the field order."),
-    .priv_size     = sizeof(FieldOrderContext),
-    .priv_class    = &fieldorder_class,
-    .query_formats = query_formats,
-    .inputs        = avfilter_vf_fieldorder_inputs,
-    .outputs       = avfilter_vf_fieldorder_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_format.c b/deps/libav/libavfilter/vf_format.c
deleted file mode 100644
index 22628d7..0000000
--- a/deps/libav/libavfilter/vf_format.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * format and noformat video filters
- */
-
-#include <string.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/opt.h"
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    const AVClass *class;
-    char *pix_fmts;
-    /**
-     * List of flags telling if a given image format has been listed
-     * as argument to the filter.
-     */
-    int listed_pix_fmt_flags[AV_PIX_FMT_NB];
-} FormatContext;
-
-#define AV_PIX_FMT_NAME_MAXSIZE 32
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    FormatContext *s = ctx->priv;
-    const char *cur, *sep;
-    char             pix_fmt_name[AV_PIX_FMT_NAME_MAXSIZE];
-    int              pix_fmt_name_len;
-    enum AVPixelFormat pix_fmt;
-
-    /* parse the list of formats */
-    for (cur = s->pix_fmts; cur; cur = sep ? sep + 1 : NULL) {
-        if (!(sep = strchr(cur, '|')))
-            pix_fmt_name_len = strlen(cur);
-        else
-            pix_fmt_name_len = sep - cur;
-        if (pix_fmt_name_len >= AV_PIX_FMT_NAME_MAXSIZE) {
-            av_log(ctx, AV_LOG_ERROR, "Format name too long\n");
-            return -1;
-        }
-
-        memcpy(pix_fmt_name, cur, pix_fmt_name_len);
-        pix_fmt_name[pix_fmt_name_len] = 0;
-        pix_fmt = av_get_pix_fmt(pix_fmt_name);
-
-        if (pix_fmt == AV_PIX_FMT_NONE) {
-            av_log(ctx, AV_LOG_ERROR, "Unknown pixel format: %s\n", pix_fmt_name);
-            return -1;
-        }
-
-        s->listed_pix_fmt_flags[pix_fmt] = 1;
-    }
-
-    return 0;
-}
-
-static AVFilterFormats *make_format_list(FormatContext *s, int flag)
-{
-    AVFilterFormats *formats = NULL;
-    enum AVPixelFormat pix_fmt;
-
-    for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
-        if (s->listed_pix_fmt_flags[pix_fmt] == flag) {
-            int ret = ff_add_format(&formats, pix_fmt);
-            if (ret < 0) {
-                ff_formats_unref(&formats);
-                return NULL;
-            }
-        }
-
-    return formats;
-}
-
-#define OFFSET(x) offsetof(FormatContext, x)
-static const AVOption options[] = {
-    { "pix_fmts", "A '|'-separated list of pixel formats", OFFSET(pix_fmts), AV_OPT_TYPE_STRING, .flags = AV_OPT_FLAG_VIDEO_PARAM },
-    { NULL },
-};
-
-#if CONFIG_FORMAT_FILTER
-static int query_formats_format(AVFilterContext *ctx)
-{
-    ff_set_common_formats(ctx, make_format_list(ctx->priv, 1));
-    return 0;
-}
-
-static const AVClass format_class = {
-    .class_name = "format",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_format_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_format_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_format = {
-    .name      = "format",
-    .description = NULL_IF_CONFIG_SMALL("Convert the input video to one of the specified pixel formats."),
-
-    .init      = init,
-
-    .query_formats = query_formats_format,
-
-    .priv_size = sizeof(FormatContext),
-    .priv_class = &format_class,
-
-    .inputs    = avfilter_vf_format_inputs,
-    .outputs   = avfilter_vf_format_outputs,
-};
-#endif /* CONFIG_FORMAT_FILTER */
-
-#if CONFIG_NOFORMAT_FILTER
-static int query_formats_noformat(AVFilterContext *ctx)
-{
-    ff_set_common_formats(ctx, make_format_list(ctx->priv, 0));
-    return 0;
-}
-
-static const AVClass noformat_class = {
-    .class_name = "noformat",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_noformat_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_noformat_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_noformat = {
-    .name      = "noformat",
-    .description = NULL_IF_CONFIG_SMALL("Force libavfilter not to use any of the specified pixel formats for the input to the next filter."),
-
-    .init      = init,
-
-    .query_formats = query_formats_noformat,
-
-    .priv_size = sizeof(FormatContext),
-    .priv_class = &noformat_class,
-
-    .inputs    = avfilter_vf_noformat_inputs,
-    .outputs   = avfilter_vf_noformat_outputs,
-};
-#endif /* CONFIG_NOFORMAT_FILTER */
diff --git a/deps/libav/libavfilter/vf_fps.c b/deps/libav/libavfilter/vf_fps.c
deleted file mode 100644
index 5f62ffd..0000000
--- a/deps/libav/libavfilter/vf_fps.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * a filter enforcing given constant framerate
- */
-
-#include <float.h>
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "libavutil/fifo.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct FPSContext {
-    const AVClass *class;
-
-    AVFifoBuffer *fifo;     ///< store frames until we get two successive timestamps
-
-    /* timestamps in input timebase */
-    int64_t first_pts;      ///< pts of the first frame that arrived on this filter
-    int64_t pts;            ///< pts of the first frame currently in the fifo
-
-    double start_time;      ///< pts, in seconds, of the expected first frame
-
-    AVRational framerate;   ///< target framerate
-    char *fps;              ///< a string describing target framerate
-
-    /* statistics */
-    int frames_in;             ///< number of frames on input
-    int frames_out;            ///< number of frames on output
-    int dup;                   ///< number of frames duplicated
-    int drop;                  ///< number of framed dropped
-} FPSContext;
-
-#define OFFSET(x) offsetof(FPSContext, x)
-#define V AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "fps", "A string describing desired output framerate", OFFSET(fps), AV_OPT_TYPE_STRING, { .str = "25" }, .flags = V },
-    { "start_time", "Assume the first PTS should be this value.", OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, V },
-    { NULL },
-};
-
-static const AVClass class = {
-    .class_name = "FPS filter",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    FPSContext *s = ctx->priv;
-    int ret;
-
-    if ((ret = av_parse_video_rate(&s->framerate, s->fps)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Error parsing framerate %s.\n", s->fps);
-        return ret;
-    }
-
-    if (!(s->fifo = av_fifo_alloc(2*sizeof(AVFrame*))))
-        return AVERROR(ENOMEM);
-
-    s->pts          = AV_NOPTS_VALUE;
-    s->first_pts    = AV_NOPTS_VALUE;
-
-    av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", s->framerate.num, s->framerate.den);
-    return 0;
-}
-
-static void flush_fifo(AVFifoBuffer *fifo)
-{
-    while (av_fifo_size(fifo)) {
-        AVFrame *tmp;
-        av_fifo_generic_read(fifo, &tmp, sizeof(tmp), NULL);
-        av_frame_free(&tmp);
-    }
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    FPSContext *s = ctx->priv;
-    if (s->fifo) {
-        s->drop += av_fifo_size(s->fifo) / sizeof(AVFilterBufferRef*);
-        flush_fifo(s->fifo);
-        av_fifo_free(s->fifo);
-    }
-
-    av_log(ctx, AV_LOG_VERBOSE, "%d frames in, %d frames out; %d frames dropped, "
-           "%d frames duplicated.\n", s->frames_in, s->frames_out, s->drop, s->dup);
-}
-
-static int config_props(AVFilterLink* link)
-{
-    FPSContext   *s = link->src->priv;
-
-    link->time_base = (AVRational){ s->framerate.den, s->framerate.num };
-    link->w         = link->src->inputs[0]->w;
-    link->h         = link->src->inputs[0]->h;
-
-    return 0;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    FPSContext        *s = ctx->priv;
-    int frames_out = s->frames_out;
-    int ret = 0;
-
-    while (ret >= 0 && s->frames_out == frames_out)
-        ret = ff_request_frame(ctx->inputs[0]);
-
-    /* flush the fifo */
-    if (ret == AVERROR_EOF && av_fifo_size(s->fifo)) {
-        int i;
-        for (i = 0; av_fifo_size(s->fifo); i++) {
-            AVFrame *buf;
-
-            av_fifo_generic_read(s->fifo, &buf, sizeof(buf), NULL);
-            buf->pts = av_rescale_q(s->first_pts, ctx->inputs[0]->time_base,
-                                    outlink->time_base) + s->frames_out;
-
-            if ((ret = ff_filter_frame(outlink, buf)) < 0)
-                return ret;
-
-            s->frames_out++;
-        }
-        return 0;
-    }
-
-    return ret;
-}
-
-static int write_to_fifo(AVFifoBuffer *fifo, AVFrame *buf)
-{
-    int ret;
-
-    if (!av_fifo_space(fifo) &&
-        (ret = av_fifo_realloc2(fifo, 2*av_fifo_size(fifo)))) {
-        av_frame_free(&buf);
-        return ret;
-    }
-
-    av_fifo_generic_write(fifo, &buf, sizeof(buf), NULL);
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
-{
-    AVFilterContext    *ctx = inlink->dst;
-    FPSContext           *s = ctx->priv;
-    AVFilterLink   *outlink = ctx->outputs[0];
-    int64_t delta;
-    int i, ret;
-
-    s->frames_in++;
-    /* discard frames until we get the first timestamp */
-    if (s->pts == AV_NOPTS_VALUE) {
-        if (buf->pts != AV_NOPTS_VALUE) {
-            ret = write_to_fifo(s->fifo, buf);
-            if (ret < 0)
-                return ret;
-
-            if (s->start_time != DBL_MAX) {
-                double first_pts = s->start_time * AV_TIME_BASE;
-                first_pts = FFMIN(FFMAX(first_pts, INT64_MIN), INT64_MAX);
-                s->first_pts = s->pts = av_rescale_q(first_pts, AV_TIME_BASE_Q,
-                                                     inlink->time_base);
-                av_log(ctx, AV_LOG_VERBOSE, "Set first pts to (in:%"PRId64" out:%"PRId64")\n",
-                       s->first_pts, av_rescale_q(first_pts, AV_TIME_BASE_Q,
-                                                  outlink->time_base));
-            } else {
-                s->first_pts = s->pts = buf->pts;
-            }
-        } else {
-            av_log(ctx, AV_LOG_WARNING, "Discarding initial frame(s) with no "
-                   "timestamp.\n");
-            av_frame_free(&buf);
-            s->drop++;
-        }
-        return 0;
-    }
-
-    /* now wait for the next timestamp */
-    if (buf->pts == AV_NOPTS_VALUE) {
-        return write_to_fifo(s->fifo, buf);
-    }
-
-    /* number of output frames */
-    delta = av_rescale_q(buf->pts - s->pts, inlink->time_base,
-                         outlink->time_base);
-
-    if (delta < 1) {
-        /* drop the frame and everything buffered except the first */
-        AVFrame *tmp;
-        int drop = av_fifo_size(s->fifo)/sizeof(AVFrame*);
-
-        av_log(ctx, AV_LOG_DEBUG, "Dropping %d frame(s).\n", drop);
-        s->drop += drop;
-
-        av_fifo_generic_read(s->fifo, &tmp, sizeof(tmp), NULL);
-        flush_fifo(s->fifo);
-        ret = write_to_fifo(s->fifo, tmp);
-
-        av_frame_free(&buf);
-        return ret;
-    }
-
-    /* can output >= 1 frames */
-    for (i = 0; i < delta; i++) {
-        AVFrame *buf_out;
-        av_fifo_generic_read(s->fifo, &buf_out, sizeof(buf_out), NULL);
-
-        /* duplicate the frame if needed */
-        if (!av_fifo_size(s->fifo) && i < delta - 1) {
-            AVFrame *dup = av_frame_clone(buf_out);
-
-            av_log(ctx, AV_LOG_DEBUG, "Duplicating frame.\n");
-            if (dup)
-                ret = write_to_fifo(s->fifo, dup);
-            else
-                ret = AVERROR(ENOMEM);
-
-            if (ret < 0) {
-                av_frame_free(&buf_out);
-                av_frame_free(&buf);
-                return ret;
-            }
-
-            s->dup++;
-        }
-
-        buf_out->pts = av_rescale_q(s->first_pts, inlink->time_base,
-                                    outlink->time_base) + s->frames_out;
-
-        if ((ret = ff_filter_frame(outlink, buf_out)) < 0) {
-            av_frame_free(&buf);
-            return ret;
-        }
-
-        s->frames_out++;
-    }
-    flush_fifo(s->fifo);
-
-    ret = write_to_fifo(s->fifo, buf);
-    s->pts = s->first_pts + av_rescale_q(s->frames_out, outlink->time_base, inlink->time_base);
-
-    return ret;
-}
-
-static const AVFilterPad avfilter_vf_fps_inputs[] = {
-    {
-        .name        = "default",
-        .type        = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_fps_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .request_frame = request_frame,
-        .config_props  = config_props
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_fps = {
-    .name        = "fps",
-    .description = NULL_IF_CONFIG_SMALL("Force constant framerate"),
-
-    .init      = init,
-    .uninit    = uninit,
-
-    .priv_size = sizeof(FPSContext),
-    .priv_class = &class,
-
-    .inputs    = avfilter_vf_fps_inputs,
-    .outputs   = avfilter_vf_fps_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_framepack.c b/deps/libav/libavfilter/vf_framepack.c
deleted file mode 100644
index f5c761a..0000000
--- a/deps/libav/libavfilter/vf_framepack.c
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- * Copyright (c) 2013 Vittorio Giovara
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Generate a frame packed video, by combining two views in a single surface.
- */
-
-#include <string.h>
-
-#include "libavutil/imgutils.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/rational.h"
-#include "libavutil/stereo3d.h"
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-#define LEFT  0
-#define RIGHT 1
-
-typedef struct FramepackContext {
-    const AVClass *class;
-
-    const AVPixFmtDescriptor *pix_desc; ///< agreed pixel format
-
-    enum AVStereo3DType format;         ///< frame pack type output
-
-    AVFrame *input_views[2];            ///< input frames
-
-    int64_t double_pts;                 ///< new pts for frameseq mode
-} FramepackContext;
-
-static const enum AVPixelFormat formats_supported[] = {
-    AV_PIX_FMT_YUV420P,  AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV444P,
-    AV_PIX_FMT_YUV410P,  AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVJ420P,
-    AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
-    AV_PIX_FMT_NONE
-};
-
-static int query_formats(AVFilterContext *ctx)
-{
-    // this will ensure that formats are the same on all pads
-    ff_set_common_formats(ctx, ff_make_format_list(formats_supported));
-    return 0;
-}
-
-static av_cold void framepack_uninit(AVFilterContext *ctx)
-{
-    FramepackContext *s = ctx->priv;
-
-    // clean any leftover frame
-    av_frame_free(&s->input_views[LEFT]);
-    av_frame_free(&s->input_views[RIGHT]);
-}
-
-static int config_output(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    FramepackContext *s  = outlink->src->priv;
-
-    int width            = ctx->inputs[LEFT]->w;
-    int height           = ctx->inputs[LEFT]->h;
-    AVRational time_base = ctx->inputs[LEFT]->time_base;
-
-    // check size and fps match on the other input
-    if (width  != ctx->inputs[RIGHT]->w ||
-        height != ctx->inputs[RIGHT]->h) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Left and right sizes differ (%dx%d vs %dx%d).\n",
-               width, height,
-               ctx->inputs[RIGHT]->w, ctx->inputs[RIGHT]->h);
-        return AVERROR_INVALIDDATA;
-    } else if (av_cmp_q(time_base, ctx->inputs[RIGHT]->time_base) != 0) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Left and right framerates differ (%d/%d vs %d/%d).\n",
-               time_base.num, time_base.den,
-               ctx->inputs[RIGHT]->time_base.num,
-               ctx->inputs[RIGHT]->time_base.den);
-        return AVERROR_INVALIDDATA;
-    }
-
-    s->pix_desc = av_pix_fmt_desc_get(outlink->format);
-    if (!s->pix_desc)
-        return AVERROR_BUG;
-
-    // modify output properties as needed
-    switch (s->format) {
-    case AV_STEREO3D_FRAMESEQUENCE:
-        time_base.den *= 2;
-        s->double_pts = AV_NOPTS_VALUE;
-        break;
-    case AV_STEREO3D_COLUMNS:
-    case AV_STEREO3D_SIDEBYSIDE:
-        width *= 2;
-        break;
-    case AV_STEREO3D_LINES:
-    case AV_STEREO3D_TOPBOTTOM:
-        height *= 2;
-        break;
-    default:
-        av_log(ctx, AV_LOG_ERROR, "Unknown packing mode.");
-        return AVERROR_INVALIDDATA;
-    }
-
-    outlink->w         = width;
-    outlink->h         = height;
-    outlink->time_base = time_base;
-
-    return 0;
-}
-
-static void horizontal_frame_pack(FramepackContext *s,
-                                  AVFrame *dst,
-                                  int interleaved)
-{
-    int plane, i;
-    int length = dst->width / 2;
-    int lines  = dst->height;
-
-    for (plane = 0; plane < s->pix_desc->nb_components; plane++) {
-        const uint8_t *leftp  = s->input_views[LEFT]->data[plane];
-        const uint8_t *rightp = s->input_views[RIGHT]->data[plane];
-        uint8_t *dstp         = dst->data[plane];
-
-        if (plane == 1 || plane == 2) {
-            length = -(-(dst->width / 2) >> s->pix_desc->log2_chroma_w);
-            lines  = -(-(dst->height)    >> s->pix_desc->log2_chroma_h);
-        }
-
-        if (interleaved) {
-            for (i = 0; i < lines; i++) {
-                int j;
-                int k = 0;
-
-                for (j = 0; j < length; j++) {
-                    dstp[k++] = leftp[j];
-                    dstp[k++] = rightp[j];
-                }
-
-                dstp   += dst->linesize[plane];
-                leftp  += s->input_views[LEFT]->linesize[plane];
-                rightp += s->input_views[RIGHT]->linesize[plane];
-            }
-        } else {
-            av_image_copy_plane(dst->data[plane], dst->linesize[plane],
-                                leftp, s->input_views[LEFT]->linesize[plane],
-                                length, lines);
-            av_image_copy_plane(dst->data[plane] + length, dst->linesize[plane],
-                                rightp, s->input_views[RIGHT]->linesize[plane],
-                                length, lines);
-        }
-    }
-}
-
-static void vertical_frame_pack(FramepackContext *s,
-                                AVFrame *dst,
-                                int interleaved)
-{
-    int plane, offset;
-    int length = dst->width;
-    int lines  = dst->height / 2;
-
-    for (plane = 0; plane < s->pix_desc->nb_components; plane++) {
-        if (plane == 1 || plane == 2) {
-            length = -(-(dst->width)      >> s->pix_desc->log2_chroma_w);
-            lines  = -(-(dst->height / 2) >> s->pix_desc->log2_chroma_h);
-        }
-
-        offset = interleaved ? dst->linesize[plane] : dst->linesize[plane] * lines;
-
-        av_image_copy_plane(dst->data[plane],
-                            dst->linesize[plane] << interleaved,
-                            s->input_views[LEFT]->data[plane],
-                            s->input_views[LEFT]->linesize[plane],
-                            length, lines);
-        av_image_copy_plane(dst->data[plane] + offset,
-                            dst->linesize[plane] << interleaved,
-                            s->input_views[RIGHT]->data[plane],
-                            s->input_views[RIGHT]->linesize[plane],
-                            length, lines);
-    }
-}
-
-static av_always_inline void spatial_frame_pack(FramepackContext *s, AVFrame *dst)
-{
-    switch (s->format) {
-    case AV_STEREO3D_SIDEBYSIDE:
-        horizontal_frame_pack(s, dst, 0);
-        break;
-    case AV_STEREO3D_COLUMNS:
-        horizontal_frame_pack(s, dst, 1);
-        break;
-    case AV_STEREO3D_TOPBOTTOM:
-        vertical_frame_pack(s, dst, 0);
-        break;
-    case AV_STEREO3D_LINES:
-        vertical_frame_pack(s, dst, 1);
-        break;
-    }
-}
-
-static int filter_frame_left(AVFilterLink *inlink, AVFrame *frame)
-{
-    FramepackContext *s = inlink->dst->priv;
-    s->input_views[LEFT] = frame;
-    return 0;
-}
-
-static int filter_frame_right(AVFilterLink *inlink, AVFrame *frame)
-{
-    FramepackContext *s = inlink->dst->priv;
-    s->input_views[RIGHT] = frame;
-    return 0;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    FramepackContext *s = ctx->priv;
-    AVStereo3D *stereo;
-    int ret, i;
-
-    /* get a frame on the either input, stop as soon as a video ends */
-    for (i = 0; i < 2; i++) {
-        if (!s->input_views[i]) {
-            ret = ff_request_frame(ctx->inputs[i]);
-            if (ret < 0)
-                return ret;
-        }
-    }
-
-    if (s->format == AV_STEREO3D_FRAMESEQUENCE) {
-        if (s->double_pts == AV_NOPTS_VALUE)
-            s->double_pts = s->input_views[LEFT]->pts;
-
-        for (i = 0; i < 2; i++) {
-            // set correct timestamps
-            s->input_views[i]->pts = s->double_pts++;
-
-            // set stereo3d side data
-            stereo = av_stereo3d_create_side_data(s->input_views[i]);
-            if (!stereo)
-                return AVERROR(ENOMEM);
-            stereo->type = s->format;
-
-            // filter the frame and immediately relinquish its pointer
-            ret = ff_filter_frame(outlink, s->input_views[i]);
-            s->input_views[i] = NULL;
-            if (ret < 0)
-                return ret;
-        }
-        return ret;
-    } else {
-        AVFrame *dst = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-        if (!dst)
-            return AVERROR(ENOMEM);
-
-        spatial_frame_pack(s, dst);
-
-        // get any property from the original frame
-        ret = av_frame_copy_props(dst, s->input_views[LEFT]);
-        if (ret < 0) {
-            av_frame_free(&dst);
-            return ret;
-        }
-
-        for (i = 0; i < 2; i++)
-            av_frame_free(&s->input_views[i]);
-
-        // set stereo3d side data
-        stereo = av_stereo3d_create_side_data(dst);
-        if (!stereo) {
-            av_frame_free(&dst);
-            return AVERROR(ENOMEM);
-        }
-        stereo->type = s->format;
-
-        return ff_filter_frame(outlink, dst);
-    }
-}
-
-#define OFFSET(x) offsetof(FramepackContext, x)
-#define V AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "format", "Frame pack output format", OFFSET(format), AV_OPT_TYPE_INT,
-        { .i64 = AV_STEREO3D_SIDEBYSIDE }, 0, INT_MAX, .flags = V, .unit = "format" },
-    { "sbs", "Views are packed next to each other", 0, AV_OPT_TYPE_CONST,
-        { .i64 = AV_STEREO3D_SIDEBYSIDE }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
-    { "tab", "Views are packed on top of each other", 0, AV_OPT_TYPE_CONST,
-        { .i64 = AV_STEREO3D_TOPBOTTOM }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
-    { "frameseq", "Views are one after the other", 0, AV_OPT_TYPE_CONST,
-        { .i64 = AV_STEREO3D_FRAMESEQUENCE }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
-    { "lines", "Views are interleaved by lines", 0, AV_OPT_TYPE_CONST,
-        { .i64 = AV_STEREO3D_LINES }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
-    { "columns", "Views are interleaved by columns", 0, AV_OPT_TYPE_CONST,
-        { .i64 = AV_STEREO3D_COLUMNS }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
-    { NULL },
-};
-
-static const AVClass framepack_class = {
-    .class_name = "framepack",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad framepack_inputs[] = {
-    {
-        .name         = "left",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame_left,
-        .needs_fifo   = 1,
-    },
-    {
-        .name         = "right",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame_right,
-        .needs_fifo   = 1,
-    },
-    { NULL }
-};
-
-static const AVFilterPad framepack_outputs[] = {
-    {
-        .name          = "packed",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .config_props  = config_output,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_framepack = {
-    .name          = "framepack",
-    .description   = NULL_IF_CONFIG_SMALL("Generate a frame packed stereoscopic video."),
-    .priv_size     = sizeof(FramepackContext),
-    .priv_class    = &framepack_class,
-    .query_formats = query_formats,
-    .inputs        = framepack_inputs,
-    .outputs       = framepack_outputs,
-    .uninit        = framepack_uninit,
-};
diff --git a/deps/libav/libavfilter/vf_frei0r.c b/deps/libav/libavfilter/vf_frei0r.c
deleted file mode 100644
index 771443d..0000000
--- a/deps/libav/libavfilter/vf_frei0r.c
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * Copyright (c) 2010 Stefano Sabatini
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * frei0r wrapper
- */
-
-#include <dlfcn.h>
-#include <frei0r.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include "config.h"
-#include "libavutil/avstring.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-typedef f0r_instance_t (*f0r_construct_f)(unsigned int width, unsigned int height);
-typedef void (*f0r_destruct_f)(f0r_instance_t instance);
-typedef void (*f0r_deinit_f)(void);
-typedef int (*f0r_init_f)(void);
-typedef void (*f0r_get_plugin_info_f)(f0r_plugin_info_t *info);
-typedef void (*f0r_get_param_info_f)(f0r_param_info_t *info, int param_index);
-typedef void (*f0r_update_f)(f0r_instance_t instance, double time, const uint32_t *inframe, uint32_t *outframe);
-typedef void (*f0r_update2_f)(f0r_instance_t instance, double time, const uint32_t *inframe1, const uint32_t *inframe2, const uint32_t *inframe3, uint32_t *outframe);
-typedef void (*f0r_set_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index);
-typedef void (*f0r_get_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index);
-
-typedef struct Frei0rContext {
-    const AVClass *class;
-    f0r_update_f update;
-    void *dl_handle;            /* dynamic library handle   */
-    f0r_instance_t instance;
-    f0r_plugin_info_t plugin_info;
-
-    f0r_get_param_info_f  get_param_info;
-    f0r_get_param_value_f get_param_value;
-    f0r_set_param_value_f set_param_value;
-    f0r_construct_f       construct;
-    f0r_destruct_f        destruct;
-    f0r_deinit_f          deinit;
-
-    char *dl_name;
-    char *params;
-    char *size;
-    char *framerate;
-
-    /* only used by the source */
-    int w, h;
-    AVRational time_base;
-    uint64_t pts;
-} Frei0rContext;
-
-static void *load_sym(AVFilterContext *ctx, const char *sym_name)
-{
-    Frei0rContext *s = ctx->priv;
-    void *sym = dlsym(s->dl_handle, sym_name);
-    if (!sym)
-        av_log(ctx, AV_LOG_ERROR, "Could not find symbol '%s' in loaded module.\n", sym_name);
-    return sym;
-}
-
-static int set_param(AVFilterContext *ctx, f0r_param_info_t info, int index, char *param)
-{
-    Frei0rContext *s = ctx->priv;
-    union {
-        double d;
-        f0r_param_color_t col;
-        f0r_param_position_t pos;
-    } val;
-    char *tail;
-    uint8_t rgba[4];
-
-    switch (info.type) {
-    case F0R_PARAM_BOOL:
-        if      (!strcmp(param, "y")) val.d = 1.0;
-        else if (!strcmp(param, "n")) val.d = 0.0;
-        else goto fail;
-        break;
-
-    case F0R_PARAM_DOUBLE:
-        val.d = strtod(param, &tail);
-        if (*tail || val.d == HUGE_VAL)
-            goto fail;
-        break;
-
-    case F0R_PARAM_COLOR:
-        if (sscanf(param, "%f/%f/%f", &val.col.r, &val.col.g, &val.col.b) != 3) {
-            if (av_parse_color(rgba, param, -1, ctx) < 0)
-                goto fail;
-            val.col.r = rgba[0] / 255.0;
-            val.col.g = rgba[1] / 255.0;
-            val.col.b = rgba[2] / 255.0;
-        }
-        break;
-
-    case F0R_PARAM_POSITION:
-        if (sscanf(param, "%lf/%lf", &val.pos.x, &val.pos.y) != 2)
-            goto fail;
-        break;
-    }
-
-    s->set_param_value(s->instance, &val, index);
-    return 0;
-
-fail:
-    av_log(ctx, AV_LOG_ERROR, "Invalid value '%s' for parameter '%s'.\n",
-           param, info.name);
-    return AVERROR(EINVAL);
-}
-
-static int set_params(AVFilterContext *ctx, const char *params)
-{
-    Frei0rContext *s = ctx->priv;
-    int i;
-
-    for (i = 0; i < s->plugin_info.num_params; i++) {
-        f0r_param_info_t info;
-        char *param;
-        int ret;
-
-        s->get_param_info(&info, i);
-
-        if (*params) {
-            if (!(param = av_get_token(&params, "|")))
-                return AVERROR(ENOMEM);
-            params++;               /* skip ':' */
-            ret = set_param(ctx, info, i, param);
-            av_free(param);
-            if (ret < 0)
-                return ret;
-        }
-
-        av_log(ctx, AV_LOG_VERBOSE,
-               "idx:%d name:'%s' type:%s explanation:'%s' ",
-               i, info.name,
-               info.type == F0R_PARAM_BOOL     ? "bool"     :
-               info.type == F0R_PARAM_DOUBLE   ? "double"   :
-               info.type == F0R_PARAM_COLOR    ? "color"    :
-               info.type == F0R_PARAM_POSITION ? "position" :
-               info.type == F0R_PARAM_STRING   ? "string"   : "unknown",
-               info.explanation);
-
-#ifdef DEBUG
-        av_log(ctx, AV_LOG_DEBUG, "value:");
-        switch (info.type) {
-            void *v;
-            double d;
-            char s[128];
-            f0r_param_color_t col;
-            f0r_param_position_t pos;
-
-        case F0R_PARAM_BOOL:
-            v = &d;
-            s->get_param_value(s->instance, v, i);
-            av_log(ctx, AV_LOG_DEBUG, "%s", d >= 0.5 && d <= 1.0 ? "y" : "n");
-            break;
-        case F0R_PARAM_DOUBLE:
-            v = &d;
-            s->get_param_value(s->instance, v, i);
-            av_log(ctx, AV_LOG_DEBUG, "%f", d);
-            break;
-        case F0R_PARAM_COLOR:
-            v = &col;
-            s->get_param_value(s->instance, v, i);
-            av_log(ctx, AV_LOG_DEBUG, "%f/%f/%f", col.r, col.g, col.b);
-            break;
-        case F0R_PARAM_POSITION:
-            v = &pos;
-            s->get_param_value(s->instance, v, i);
-            av_log(ctx, AV_LOG_DEBUG, "%f/%f", pos.x, pos.y);
-            break;
-        default: /* F0R_PARAM_STRING */
-            v = s;
-            s->get_param_value(s->instance, v, i);
-            av_log(ctx, AV_LOG_DEBUG, "'%s'", s);
-            break;
-        }
-#endif
-        av_log(ctx, AV_LOG_VERBOSE, ".\n");
-    }
-
-    return 0;
-}
-
-static void *load_path(AVFilterContext *ctx, const char *prefix, const char *name)
-{
-    char path[1024];
-
-    snprintf(path, sizeof(path), "%s%s%s", prefix, name, SLIBSUF);
-    av_log(ctx, AV_LOG_DEBUG, "Looking for frei0r effect in '%s'.\n", path);
-    return dlopen(path, RTLD_NOW|RTLD_LOCAL);
-}
-
-static av_cold int frei0r_init(AVFilterContext *ctx,
-                               const char *dl_name, int type)
-{
-    Frei0rContext *s = ctx->priv;
-    f0r_init_f            f0r_init;
-    f0r_get_plugin_info_f f0r_get_plugin_info;
-    f0r_plugin_info_t *pi;
-    char *path;
-
-    if (!dl_name) {
-        av_log(ctx, AV_LOG_ERROR, "No filter name provided.\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* see: http://piksel.org/frei0r/1.2/spec/1.2/spec/group__pluglocations.html */
-    if (path = getenv("FREI0R_PATH")) {
-        while(*path) {
-            char *ptr = av_get_token((const char **)&path, ":");
-            if (!ptr)
-                return AVERROR(ENOMEM);
-            s->dl_handle = load_path(ctx, ptr, dl_name);
-            av_freep(&ptr);
-            if (s->dl_handle)
-                break;              /* found */
-            if (*path)
-                path++;             /* skip ':' */
-        }
-    }
-    if (!s->dl_handle && (path = getenv("HOME"))) {
-        char prefix[1024];
-        snprintf(prefix, sizeof(prefix), "%s/.frei0r-1/lib/", path);
-        s->dl_handle = load_path(ctx, prefix, dl_name);
-    }
-    if (!s->dl_handle)
-        s->dl_handle = load_path(ctx, "/usr/local/lib/frei0r-1/", dl_name);
-    if (!s->dl_handle)
-        s->dl_handle = load_path(ctx, "/usr/lib/frei0r-1/", dl_name);
-    if (!s->dl_handle) {
-        av_log(ctx, AV_LOG_ERROR, "Could not find module '%s'.\n", dl_name);
-        return AVERROR(EINVAL);
-    }
-
-    if (!(f0r_init                = load_sym(ctx, "f0r_init"           )) ||
-        !(f0r_get_plugin_info     = load_sym(ctx, "f0r_get_plugin_info")) ||
-        !(s->get_param_info  = load_sym(ctx, "f0r_get_param_info" )) ||
-        !(s->get_param_value = load_sym(ctx, "f0r_get_param_value")) ||
-        !(s->set_param_value = load_sym(ctx, "f0r_set_param_value")) ||
-        !(s->update          = load_sym(ctx, "f0r_update"         )) ||
-        !(s->construct       = load_sym(ctx, "f0r_construct"      )) ||
-        !(s->destruct        = load_sym(ctx, "f0r_destruct"       )) ||
-        !(s->deinit          = load_sym(ctx, "f0r_deinit"         )))
-        return AVERROR(EINVAL);
-
-    if (f0r_init() < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Could not init the frei0r module.\n");
-        return AVERROR(EINVAL);
-    }
-
-    f0r_get_plugin_info(&s->plugin_info);
-    pi = &s->plugin_info;
-    if (pi->plugin_type != type) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid type '%s' for this plugin\n",
-               pi->plugin_type == F0R_PLUGIN_TYPE_FILTER ? "filter" :
-               pi->plugin_type == F0R_PLUGIN_TYPE_SOURCE ? "source" :
-               pi->plugin_type == F0R_PLUGIN_TYPE_MIXER2 ? "mixer2" :
-               pi->plugin_type == F0R_PLUGIN_TYPE_MIXER3 ? "mixer3" : "unknown");
-        return AVERROR(EINVAL);
-    }
-
-    av_log(ctx, AV_LOG_VERBOSE,
-           "name:%s author:'%s' explanation:'%s' color_model:%s "
-           "frei0r_version:%d version:%d.%d num_params:%d\n",
-           pi->name, pi->author, pi->explanation,
-           pi->color_model == F0R_COLOR_MODEL_BGRA8888 ? "bgra8888" :
-           pi->color_model == F0R_COLOR_MODEL_RGBA8888 ? "rgba8888" :
-           pi->color_model == F0R_COLOR_MODEL_PACKED32 ? "packed32" : "unknown",
-           pi->frei0r_version, pi->major_version, pi->minor_version, pi->num_params);
-
-    return 0;
-}
-
-static av_cold int filter_init(AVFilterContext *ctx)
-{
-    Frei0rContext *s = ctx->priv;
-
-    return frei0r_init(ctx, s->dl_name, F0R_PLUGIN_TYPE_FILTER);
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    Frei0rContext *s = ctx->priv;
-
-    if (s->destruct && s->instance)
-        s->destruct(s->instance);
-    if (s->deinit)
-        s->deinit();
-    if (s->dl_handle)
-        dlclose(s->dl_handle);
-}
-
-static int config_input_props(AVFilterLink *inlink)
-{
-    AVFilterContext *ctx = inlink->dst;
-    Frei0rContext *s = ctx->priv;
-
-    if (s->destruct && s->instance)
-        s->destruct(s->instance);
-    if (!(s->instance = s->construct(inlink->w, inlink->h))) {
-        av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance.\n");
-        return AVERROR(EINVAL);
-    }
-
-    return set_params(ctx, s->params);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    Frei0rContext *s = ctx->priv;
-    AVFilterFormats *formats = NULL;
-
-    if        (s->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888) {
-        ff_add_format(&formats, AV_PIX_FMT_BGRA);
-    } else if (s->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888) {
-        ff_add_format(&formats, AV_PIX_FMT_RGBA);
-    } else {                                   /* F0R_COLOR_MODEL_PACKED32 */
-        static const enum AVPixelFormat pix_fmts[] = {
-            AV_PIX_FMT_BGRA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, AV_PIX_FMT_ARGB, AV_PIX_FMT_NONE
-        };
-        formats = ff_make_format_list(pix_fmts);
-    }
-
-    if (!formats)
-        return AVERROR(ENOMEM);
-
-    ff_set_common_formats(ctx, formats);
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    Frei0rContext *s = inlink->dst->priv;
-    AVFilterLink *outlink = inlink->dst->outputs[0];
-    AVFrame *out;
-
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-    av_frame_copy_props(out, in);
-
-    s->update(s->instance, in->pts * av_q2d(inlink->time_base) * 1000,
-                   (const uint32_t *)in->data[0],
-                   (uint32_t *)out->data[0]);
-
-    av_frame_free(&in);
-
-    return ff_filter_frame(outlink, out);
-}
-
-#define OFFSET(x) offsetof(Frei0rContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption filter_options[] = {
-    { "filter_name",   NULL, OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
-    { "filter_params", NULL, OFFSET(params),  AV_OPT_TYPE_STRING, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass filter_class = {
-    .class_name = "frei0r",
-    .item_name  = av_default_item_name,
-    .option     = filter_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_frei0r_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_input_props,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_frei0r_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_frei0r = {
-    .name      = "frei0r",
-    .description = NULL_IF_CONFIG_SMALL("Apply a frei0r effect."),
-
-    .query_formats = query_formats,
-    .init = filter_init,
-    .uninit = uninit,
-
-    .priv_size = sizeof(Frei0rContext),
-    .priv_class = &filter_class,
-
-    .inputs    = avfilter_vf_frei0r_inputs,
-
-    .outputs   = avfilter_vf_frei0r_outputs,
-};
-
-static av_cold int source_init(AVFilterContext *ctx)
-{
-    Frei0rContext *s = ctx->priv;
-    AVRational frame_rate_q;
-
-    if (av_parse_video_size(&s->w, &s->h, s->size) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid frame size: '%s'.\n", s->size);
-        return AVERROR(EINVAL);
-    }
-
-    if (av_parse_video_rate(&frame_rate_q, s->framerate) < 0 ||
-        frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'.\n", s->framerate);
-        return AVERROR(EINVAL);
-    }
-    s->time_base.num = frame_rate_q.den;
-    s->time_base.den = frame_rate_q.num;
-
-    return frei0r_init(ctx, s->dl_name, F0R_PLUGIN_TYPE_SOURCE);
-}
-
-static int source_config_props(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    Frei0rContext *s = ctx->priv;
-
-    if (av_image_check_size(s->w, s->h, 0, ctx) < 0)
-        return AVERROR(EINVAL);
-    outlink->w = s->w;
-    outlink->h = s->h;
-    outlink->time_base = s->time_base;
-
-    if (s->destruct && s->instance)
-        s->destruct(s->instance);
-    if (!(s->instance = s->construct(outlink->w, outlink->h))) {
-        av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance.\n");
-        return AVERROR(EINVAL);
-    }
-    if (!s->params) {
-        av_log(ctx, AV_LOG_ERROR, "frei0r filter parameters not set.\n");
-        return AVERROR(EINVAL);
-    }
-
-    return set_params(ctx, s->params);
-}
-
-static int source_request_frame(AVFilterLink *outlink)
-{
-    Frei0rContext *s = outlink->src->priv;
-    AVFrame *frame = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-
-    if (!frame)
-        return AVERROR(ENOMEM);
-
-    frame->sample_aspect_ratio = (AVRational) {1, 1};
-    frame->pts = s->pts++;
-
-    s->update(s->instance, av_rescale_q(frame->pts, s->time_base, (AVRational){1,1000}),
-                   NULL, (uint32_t *)frame->data[0]);
-
-    return ff_filter_frame(outlink, frame);
-}
-
-static const AVOption src_options[] = {
-    { "size",          "Dimensions of the generated video.", OFFSET(size),      AV_OPT_TYPE_STRING, { .str = "" },   .flags = FLAGS },
-    { "framerate",     NULL,                                 OFFSET(framerate), AV_OPT_TYPE_STRING, { .str = "25" }, .flags = FLAGS },
-    { "filter_name",   NULL,                                 OFFSET(dl_name),   AV_OPT_TYPE_STRING,                  .flags = FLAGS },
-    { "filter_params", NULL,                                 OFFSET(params),    AV_OPT_TYPE_STRING,                  .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass src_class = {
-    .class_name = "frei0r_src",
-    .item_name  = av_default_item_name,
-    .option     = src_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vsrc_frei0r_src_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .request_frame = source_request_frame,
-        .config_props  = source_config_props
-    },
-    { NULL }
-};
-
-AVFilter ff_vsrc_frei0r_src = {
-    .name        = "frei0r_src",
-    .description = NULL_IF_CONFIG_SMALL("Generate a frei0r source."),
-
-    .priv_size = sizeof(Frei0rContext),
-    .priv_class = &src_class,
-    .init      = source_init,
-    .uninit    = uninit,
-
-    .query_formats = query_formats,
-
-    .inputs    = NULL,
-
-    .outputs   = avfilter_vsrc_frei0r_src_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_gradfun.c b/deps/libav/libavfilter/vf_gradfun.c
deleted file mode 100644
index f7c4372..0000000
--- a/deps/libav/libavfilter/vf_gradfun.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Copyright (c) 2010 Nolan Lum <nol888 at gmail.com>
- * Copyright (c) 2009 Loren Merritt <lorenm at u.washington.edu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * gradfun debanding filter, ported from MPlayer
- * libmpcodecs/vf_gradfun.c
- *
- * Apply a boxblur debanding algorithm (based on the gradfun2db
- * AviSynth filter by prunedtree).
- * Foreach pixel, if it's within threshold of the blurred value, make it closer.
- * So now we have a smoothed and higher bitdepth version of all the shallow
- * gradients, while leaving detailed areas untouched.
- * Dither it back to 8bit.
- */
-
-#include "libavutil/imgutils.h"
-#include "libavutil/common.h"
-#include "libavutil/cpu.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "gradfun.h"
-#include "internal.h"
-#include "video.h"
-
-DECLARE_ALIGNED(16, static const uint16_t, dither)[8][8] = {
-    {0x00,0x60,0x18,0x78,0x06,0x66,0x1E,0x7E},
-    {0x40,0x20,0x58,0x38,0x46,0x26,0x5E,0x3E},
-    {0x10,0x70,0x08,0x68,0x16,0x76,0x0E,0x6E},
-    {0x50,0x30,0x48,0x28,0x56,0x36,0x4E,0x2E},
-    {0x04,0x64,0x1C,0x7C,0x02,0x62,0x1A,0x7A},
-    {0x44,0x24,0x5C,0x3C,0x42,0x22,0x5A,0x3A},
-    {0x14,0x74,0x0C,0x6C,0x12,0x72,0x0A,0x6A},
-    {0x54,0x34,0x4C,0x2C,0x52,0x32,0x4A,0x2A},
-};
-
-void ff_gradfun_filter_line_c(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers)
-{
-    int x;
-    for (x = 0; x < width; dc += x & 1, x++) {
-        int pix = src[x] << 7;
-        int delta = dc[0] - pix;
-        int m = abs(delta) * thresh >> 16;
-        m = FFMAX(0, 127 - m);
-        m = m * m * delta >> 14;
-        pix += m + dithers[x & 7];
-        dst[x] = av_clip_uint8(pix >> 7);
-    }
-}
-
-void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width)
-{
-    int x, v, old;
-    for (x = 0; x < width; x++) {
-        v = buf1[x] + src[2 * x] + src[2 * x + 1] + src[2 * x + src_linesize] + src[2 * x + 1 + src_linesize];
-        old = buf[x];
-        buf[x] = v;
-        dc[x] = v - old;
-    }
-}
-
-static void filter(GradFunContext *ctx, uint8_t *dst, uint8_t *src, int width, int height, int dst_linesize, int src_linesize, int r)
-{
-    int bstride = FFALIGN(width, 16) / 2;
-    int y;
-    uint32_t dc_factor = (1 << 21) / (r * r);
-    uint16_t *dc = ctx->buf + 16;
-    uint16_t *buf = ctx->buf + bstride + 32;
-    int thresh = ctx->thresh;
-
-    memset(dc, 0, (bstride + 16) * sizeof(*buf));
-    for (y = 0; y < r; y++)
-        ctx->blur_line(dc, buf + y * bstride, buf + (y - 1) * bstride, src + 2 * y * src_linesize, src_linesize, width / 2);
-    for (;;) {
-        if (y < height - r) {
-            int mod = ((y + r) / 2) % r;
-            uint16_t *buf0 = buf + mod * bstride;
-            uint16_t *buf1 = buf + (mod ? mod - 1 : r - 1) * bstride;
-            int x, v;
-            ctx->blur_line(dc, buf0, buf1, src + (y + r) * src_linesize, src_linesize, width / 2);
-            for (x = v = 0; x < r; x++)
-                v += dc[x];
-            for (; x < width / 2; x++) {
-                v += dc[x] - dc[x-r];
-                dc[x-r] = v * dc_factor >> 16;
-            }
-            for (; x < (width + r + 1) / 2; x++)
-                dc[x-r] = v * dc_factor >> 16;
-            for (x = -r / 2; x < 0; x++)
-                dc[x] = dc[0];
-        }
-        if (y == r) {
-            for (y = 0; y < r; y++)
-                ctx->filter_line(dst + y * dst_linesize, src + y * src_linesize, dc - r / 2, width, thresh, dither[y & 7]);
-        }
-        ctx->filter_line(dst + y * dst_linesize, src + y * src_linesize, dc - r / 2, width, thresh, dither[y & 7]);
-        if (++y >= height) break;
-        ctx->filter_line(dst + y * dst_linesize, src + y * src_linesize, dc - r / 2, width, thresh, dither[y & 7]);
-        if (++y >= height) break;
-    }
-    emms_c();
-}
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    GradFunContext *s = ctx->priv;
-
-    s->thresh  = (1 << 15) / s->strength;
-    s->radius &= ~1;
-
-    s->blur_line = ff_gradfun_blur_line_c;
-    s->filter_line = ff_gradfun_filter_line_c;
-
-    if (ARCH_X86)
-        ff_gradfun_init_x86(s);
-
-    av_log(ctx, AV_LOG_VERBOSE, "threshold:%.2f radius:%d\n", s->strength, s->radius);
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    GradFunContext *s = ctx->priv;
-    av_freep(&s->buf);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV410P,            AV_PIX_FMT_YUV420P,
-        AV_PIX_FMT_GRAY8,              AV_PIX_FMT_NV12,
-        AV_PIX_FMT_NV21,               AV_PIX_FMT_YUV444P,
-        AV_PIX_FMT_YUV422P,            AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-
-    return 0;
-}
-
-static int config_input(AVFilterLink *inlink)
-{
-    GradFunContext *s = inlink->dst->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    int hsub = desc->log2_chroma_w;
-    int vsub = desc->log2_chroma_h;
-
-    av_freep(&s->buf);
-    s->buf = av_mallocz((FFALIGN(inlink->w, 16) * (s->radius + 1) / 2 + 32) * sizeof(uint16_t));
-    if (!s->buf)
-        return AVERROR(ENOMEM);
-
-    s->chroma_w = -((-inlink->w) >> hsub);
-    s->chroma_h = -((-inlink->h) >> vsub);
-    s->chroma_r = av_clip(((((s->radius >> hsub) + (s->radius >> vsub)) / 2 ) + 1) & ~1, 4, 32);
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    GradFunContext *s = inlink->dst->priv;
-    AVFilterLink *outlink = inlink->dst->outputs[0];
-    AVFrame *out;
-    int p, direct;
-
-    if (av_frame_is_writable(in)) {
-        direct = 1;
-        out = in;
-    } else {
-        direct = 0;
-        out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-        if (!out) {
-            av_frame_free(&in);
-            return AVERROR(ENOMEM);
-        }
-
-        av_frame_copy_props(out, in);
-        out->width  = outlink->w;
-        out->height = outlink->h;
-    }
-
-    for (p = 0; p < 4 && in->data[p]; p++) {
-        int w = inlink->w;
-        int h = inlink->h;
-        int r = s->radius;
-        if (p) {
-            w = s->chroma_w;
-            h = s->chroma_h;
-            r = s->chroma_r;
-        }
-
-        if (FFMIN(w, h) > 2 * r)
-            filter(s, out->data[p], in->data[p], w, h, out->linesize[p], in->linesize[p], r);
-        else if (out->data[p] != in->data[p])
-            av_image_copy_plane(out->data[p], out->linesize[p], in->data[p], in->linesize[p], w, h);
-    }
-
-    if (!direct)
-        av_frame_free(&in);
-
-    return ff_filter_frame(outlink, out);
-}
-
-#define OFFSET(x) offsetof(GradFunContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "strength", "The maximum amount by which the filter will change any one pixel.", OFFSET(strength), AV_OPT_TYPE_FLOAT, { .dbl = 1.2 }, 0.51, 64, FLAGS },
-    { "radius",   "The neighborhood to fit the gradient to.",                          OFFSET(radius),   AV_OPT_TYPE_INT,   { .i64 = 16  }, 4,    32, FLAGS },
-    { NULL },
-};
-
-static const AVClass gradfun_class = {
-    .class_name = "gradfun",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_gradfun_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_input,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_gradfun_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_gradfun = {
-    .name          = "gradfun",
-    .description   = NULL_IF_CONFIG_SMALL("Debands video quickly using gradients."),
-    .priv_size     = sizeof(GradFunContext),
-    .priv_class    = &gradfun_class,
-    .init          = init,
-    .uninit        = uninit,
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_gradfun_inputs,
-    .outputs   = avfilter_vf_gradfun_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_hflip.c b/deps/libav/libavfilter/vf_hflip.c
deleted file mode 100644
index 6034b68..0000000
--- a/deps/libav/libavfilter/vf_hflip.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 2007 Benoit Fouet
- * Copyright (c) 2010 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * horizontal flip filter
- */
-
-#include <string.h>
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/imgutils.h"
-
-typedef struct {
-    int max_step[4];    ///< max pixel step for each plane, expressed as a number of bytes
-    int hsub, vsub;     ///< chroma subsampling
-} FlipContext;
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_RGB48BE,      AV_PIX_FMT_RGB48LE,
-        AV_PIX_FMT_BGR48BE,      AV_PIX_FMT_BGR48LE,
-        AV_PIX_FMT_ARGB,         AV_PIX_FMT_RGBA,
-        AV_PIX_FMT_ABGR,         AV_PIX_FMT_BGRA,
-        AV_PIX_FMT_RGB24,        AV_PIX_FMT_BGR24,
-        AV_PIX_FMT_RGB565BE,     AV_PIX_FMT_RGB565LE,
-        AV_PIX_FMT_RGB555BE,     AV_PIX_FMT_RGB555LE,
-        AV_PIX_FMT_BGR565BE,     AV_PIX_FMT_BGR565LE,
-        AV_PIX_FMT_BGR555BE,     AV_PIX_FMT_BGR555LE,
-        AV_PIX_FMT_GRAY16BE,     AV_PIX_FMT_GRAY16LE,
-        AV_PIX_FMT_YUV420P16LE,  AV_PIX_FMT_YUV420P16BE,
-        AV_PIX_FMT_YUV422P16LE,  AV_PIX_FMT_YUV422P16BE,
-        AV_PIX_FMT_YUV444P16LE,  AV_PIX_FMT_YUV444P16BE,
-        AV_PIX_FMT_YUV444P,      AV_PIX_FMT_YUV422P,
-        AV_PIX_FMT_YUV420P,      AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_YUV410P,      AV_PIX_FMT_YUV440P,
-        AV_PIX_FMT_YUVJ444P,     AV_PIX_FMT_YUVJ422P,
-        AV_PIX_FMT_YUVJ420P,     AV_PIX_FMT_YUVJ440P,
-        AV_PIX_FMT_YUVA420P,
-        AV_PIX_FMT_RGB8,         AV_PIX_FMT_BGR8,
-        AV_PIX_FMT_RGB4_BYTE,    AV_PIX_FMT_BGR4_BYTE,
-        AV_PIX_FMT_PAL8,         AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int config_props(AVFilterLink *inlink)
-{
-    FlipContext *s = inlink->dst->priv;
-    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
-
-    av_image_fill_max_pixsteps(s->max_step, NULL, pix_desc);
-    s->hsub = pix_desc->log2_chroma_w;
-    s->vsub = pix_desc->log2_chroma_h;
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    AVFilterContext *ctx  = inlink->dst;
-    FlipContext *s     = ctx->priv;
-    AVFilterLink *outlink = ctx->outputs[0];
-    AVFrame *out;
-    uint8_t *inrow, *outrow;
-    int i, j, plane, step, hsub, vsub;
-
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-    av_frame_copy_props(out, in);
-
-    for (plane = 0; plane < 4 && in->data[plane]; plane++) {
-        step = s->max_step[plane];
-        hsub = (plane == 1 || plane == 2) ? s->hsub : 0;
-        vsub = (plane == 1 || plane == 2) ? s->vsub : 0;
-
-        outrow = out->data[plane];
-        inrow  = in ->data[plane] + ((inlink->w >> hsub) - 1) * step;
-        for (i = 0; i < in->height >> vsub; i++) {
-            switch (step) {
-            case 1:
-                for (j = 0; j < (inlink->w >> hsub); j++)
-                    outrow[j] = inrow[-j];
-            break;
-
-            case 2:
-            {
-                uint16_t *outrow16 = (uint16_t *)outrow;
-                uint16_t * inrow16 = (uint16_t *) inrow;
-                for (j = 0; j < (inlink->w >> hsub); j++)
-                    outrow16[j] = inrow16[-j];
-            }
-            break;
-
-            case 3:
-            {
-                uint8_t *in  =  inrow;
-                uint8_t *out = outrow;
-                for (j = 0; j < (inlink->w >> hsub); j++, out += 3, in -= 3) {
-                    int32_t v = AV_RB24(in);
-                    AV_WB24(out, v);
-                }
-            }
-            break;
-
-            case 4:
-            {
-                uint32_t *outrow32 = (uint32_t *)outrow;
-                uint32_t * inrow32 = (uint32_t *) inrow;
-                for (j = 0; j < (inlink->w >> hsub); j++)
-                    outrow32[j] = inrow32[-j];
-            }
-            break;
-
-            default:
-                for (j = 0; j < (inlink->w >> hsub); j++)
-                    memcpy(outrow + j*step, inrow - j*step, step);
-            }
-
-            inrow  += in ->linesize[plane];
-            outrow += out->linesize[plane];
-        }
-    }
-
-    av_frame_free(&in);
-    return ff_filter_frame(outlink, out);
-}
-
-static const AVFilterPad avfilter_vf_hflip_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-        .config_props = config_props,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_hflip_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_hflip = {
-    .name      = "hflip",
-    .description = NULL_IF_CONFIG_SMALL("Horizontally flip the input video."),
-    .priv_size = sizeof(FlipContext),
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_hflip_inputs,
-    .outputs   = avfilter_vf_hflip_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_hqdn3d.c b/deps/libav/libavfilter/vf_hqdn3d.c
deleted file mode 100644
index be6b761..0000000
--- a/deps/libav/libavfilter/vf_hqdn3d.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * Copyright (c) 2003 Daniel Moreno <comac AT comac DOT darktech DOT org>
- * Copyright (c) 2010 Baptiste Coudurier
- * Copyright (c) 2012 Loren Merritt
- *
- * This file is part of Libav, ported from MPlayer.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/**
- * @file
- * high quality 3d video denoiser, ported from MPlayer
- * libmpcodecs/vf_hqdn3d.c.
- */
-
-#include <float.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/opt.h"
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "vf_hqdn3d.h"
-
-#define LUT_BITS (depth==16 ? 8 : 4)
-#define LOAD(x) (((depth == 8 ? src[x] : AV_RN16A(src + (x) * 2)) << (16 - depth))\
-                 + (((1 << (16 - depth)) - 1) >> 1))
-#define STORE(x,val) (depth == 8 ? dst[x] = (val) >> (16 - depth) : \
-                                   AV_WN16A(dst + (x) * 2, (val) >> (16 - depth)))
-
-av_always_inline
-static uint32_t lowpass(int prev, int cur, int16_t *coef, int depth)
-{
-    int d = (prev - cur) >> (8 - LUT_BITS);
-    return cur + coef[d];
-}
-
-av_always_inline
-static void denoise_temporal(uint8_t *src, uint8_t *dst,
-                             uint16_t *frame_ant,
-                             int w, int h, int sstride, int dstride,
-                             int16_t *temporal, int depth)
-{
-    long x, y;
-    uint32_t tmp;
-
-    temporal += 256 << LUT_BITS;
-
-    for (y = 0; y < h; y++) {
-        for (x = 0; x < w; x++) {
-            frame_ant[x] = tmp = lowpass(frame_ant[x], LOAD(x), temporal, depth);
-            STORE(x, tmp);
-        }
-        src += sstride;
-        dst += dstride;
-        frame_ant += w;
-    }
-}
-
-av_always_inline
-static void denoise_spatial(HQDN3DContext *s,
-                            uint8_t *src, uint8_t *dst,
-                            uint16_t *line_ant, uint16_t *frame_ant,
-                            int w, int h, int sstride, int dstride,
-                            int16_t *spatial, int16_t *temporal, int depth)
-{
-    long x, y;
-    uint32_t pixel_ant;
-    uint32_t tmp;
-
-    spatial  += 256 << LUT_BITS;
-    temporal += 256 << LUT_BITS;
-
-    /* First line has no top neighbor. Only left one for each tmp and
-     * last frame */
-    pixel_ant = LOAD(0);
-    for (x = 0; x < w; x++) {
-        line_ant[x] = tmp = pixel_ant = lowpass(pixel_ant, LOAD(x), spatial, depth);
-        frame_ant[x] = tmp = lowpass(frame_ant[x], tmp, temporal, depth);
-        STORE(x, tmp);
-    }
-
-    for (y = 1; y < h; y++) {
-        src += sstride;
-        dst += dstride;
-        frame_ant += w;
-        if (s->denoise_row[depth]) {
-            s->denoise_row[depth](src, dst, line_ant, frame_ant, w, spatial, temporal);
-            continue;
-        }
-        pixel_ant = LOAD(0);
-        for (x = 0; x < w-1; x++) {
-            line_ant[x] = tmp = lowpass(line_ant[x], pixel_ant, spatial, depth);
-            pixel_ant = lowpass(pixel_ant, LOAD(x+1), spatial, depth);
-            frame_ant[x] = tmp = lowpass(frame_ant[x], tmp, temporal, depth);
-            STORE(x, tmp);
-        }
-        line_ant[x] = tmp = lowpass(line_ant[x], pixel_ant, spatial, depth);
-        frame_ant[x] = tmp = lowpass(frame_ant[x], tmp, temporal, depth);
-        STORE(x, tmp);
-    }
-}
-
-av_always_inline
-static void denoise_depth(HQDN3DContext *s,
-                          uint8_t *src, uint8_t *dst,
-                          uint16_t *line_ant, uint16_t **frame_ant_ptr,
-                          int w, int h, int sstride, int dstride,
-                          int16_t *spatial, int16_t *temporal, int depth)
-{
-    // FIXME: For 16bit depth, frame_ant could be a pointer to the previous
-    // filtered frame rather than a separate buffer.
-    long x, y;
-    uint16_t *frame_ant = *frame_ant_ptr;
-    if (!frame_ant) {
-        uint8_t *frame_src = src;
-        *frame_ant_ptr = frame_ant = av_malloc(w*h*sizeof(uint16_t));
-        for (y = 0; y < h; y++, src += sstride, frame_ant += w)
-            for (x = 0; x < w; x++)
-                frame_ant[x] = LOAD(x);
-        src = frame_src;
-        frame_ant = *frame_ant_ptr;
-    }
-
-    if (spatial[0])
-        denoise_spatial(s, src, dst, line_ant, frame_ant,
-                        w, h, sstride, dstride, spatial, temporal, depth);
-    else
-        denoise_temporal(src, dst, frame_ant,
-                         w, h, sstride, dstride, temporal, depth);
-    emms_c();
-}
-
-#define denoise(...) \
-    switch (s->depth) {\
-        case  8: denoise_depth(__VA_ARGS__,  8); break;\
-        case  9: denoise_depth(__VA_ARGS__,  9); break;\
-        case 10: denoise_depth(__VA_ARGS__, 10); break;\
-        case 16: denoise_depth(__VA_ARGS__, 16); break;\
-    }
-
-static int16_t *precalc_coefs(double dist25, int depth)
-{
-    int i;
-    double gamma, simil, C;
-    int16_t *ct = av_malloc((512<<LUT_BITS)*sizeof(int16_t));
-    if (!ct)
-        return NULL;
-
-    gamma = log(0.25) / log(1.0 - FFMIN(dist25,252.0)/255.0 - 0.00001);
-
-    for (i = -255<<LUT_BITS; i <= 255<<LUT_BITS; i++) {
-        double f = ((i<<(9-LUT_BITS)) + (1<<(8-LUT_BITS)) - 1) / 512.0; // midpoint of the bin
-        simil = 1.0 - FFABS(f) / 255.0;
-        C = pow(simil, gamma) * 256.0 * f;
-        ct[(256<<LUT_BITS)+i] = lrint(C);
-    }
-
-    ct[0] = !!dist25;
-    return ct;
-}
-
-#define PARAM1_DEFAULT 4.0
-#define PARAM2_DEFAULT 3.0
-#define PARAM3_DEFAULT 6.0
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    HQDN3DContext *s = ctx->priv;
-
-    if (!s->strength[LUMA_SPATIAL])
-        s->strength[LUMA_SPATIAL] = PARAM1_DEFAULT;
-    if (!s->strength[CHROMA_SPATIAL])
-        s->strength[CHROMA_SPATIAL] = PARAM2_DEFAULT * s->strength[LUMA_SPATIAL] / PARAM1_DEFAULT;
-    if (!s->strength[LUMA_TMP])
-        s->strength[LUMA_TMP]   = PARAM3_DEFAULT * s->strength[LUMA_SPATIAL] / PARAM1_DEFAULT;
-    if (!s->strength[CHROMA_TMP])
-        s->strength[CHROMA_TMP] = s->strength[LUMA_TMP] * s->strength[CHROMA_SPATIAL] / s->strength[LUMA_SPATIAL];
-
-    av_log(ctx, AV_LOG_VERBOSE, "ls:%f cs:%f lt:%f ct:%f\n",
-           s->strength[LUMA_SPATIAL], s->strength[CHROMA_SPATIAL],
-           s->strength[LUMA_TMP], s->strength[CHROMA_TMP]);
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    HQDN3DContext *s = ctx->priv;
-
-    av_freep(&s->coefs[0]);
-    av_freep(&s->coefs[1]);
-    av_freep(&s->coefs[2]);
-    av_freep(&s->coefs[3]);
-    av_freep(&s->line);
-    av_freep(&s->frame_prev[0]);
-    av_freep(&s->frame_prev[1]);
-    av_freep(&s->frame_prev[2]);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV420P,
-        AV_PIX_FMT_YUV422P,
-        AV_PIX_FMT_YUV444P,
-        AV_PIX_FMT_YUV410P,
-        AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_YUV440P,
-        AV_PIX_FMT_YUVJ420P,
-        AV_PIX_FMT_YUVJ422P,
-        AV_PIX_FMT_YUVJ444P,
-        AV_PIX_FMT_YUVJ440P,
-        AV_NE( AV_PIX_FMT_YUV420P9BE, AV_PIX_FMT_YUV420P9LE ),
-        AV_NE( AV_PIX_FMT_YUV422P9BE, AV_PIX_FMT_YUV422P9LE ),
-        AV_NE( AV_PIX_FMT_YUV444P9BE, AV_PIX_FMT_YUV444P9LE ),
-        AV_NE( AV_PIX_FMT_YUV420P10BE, AV_PIX_FMT_YUV420P10LE ),
-        AV_NE( AV_PIX_FMT_YUV422P10BE, AV_PIX_FMT_YUV422P10LE ),
-        AV_NE( AV_PIX_FMT_YUV444P10BE, AV_PIX_FMT_YUV444P10LE ),
-        AV_NE( AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUV420P16LE ),
-        AV_NE( AV_PIX_FMT_YUV422P16BE, AV_PIX_FMT_YUV422P16LE ),
-        AV_NE( AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUV444P16LE ),
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-
-    return 0;
-}
-
-static int config_input(AVFilterLink *inlink)
-{
-    HQDN3DContext *s = inlink->dst->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    int i;
-
-    uninit(inlink->dst);
-
-    s->hsub  = desc->log2_chroma_w;
-    s->vsub  = desc->log2_chroma_h;
-    s->depth = desc->comp[0].depth_minus1+1;
-
-    s->line = av_malloc(inlink->w * sizeof(*s->line));
-    if (!s->line)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < 4; i++) {
-        s->coefs[i] = precalc_coefs(s->strength[i], s->depth);
-        if (!s->coefs[i])
-            return AVERROR(ENOMEM);
-    }
-
-    if (ARCH_X86)
-        ff_hqdn3d_init_x86(s);
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    HQDN3DContext *s = inlink->dst->priv;
-    AVFilterLink *outlink = inlink->dst->outputs[0];
-    AVFrame *out;
-    int direct, c;
-
-    if (av_frame_is_writable(in)) {
-        direct = 1;
-        out = in;
-    } else {
-        direct = 0;
-        out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-        if (!out) {
-            av_frame_free(&in);
-            return AVERROR(ENOMEM);
-        }
-
-        av_frame_copy_props(out, in);
-        out->width  = outlink->w;
-        out->height = outlink->h;
-    }
-
-    for (c = 0; c < 3; c++) {
-        denoise(s, in->data[c], out->data[c],
-                s->line, &s->frame_prev[c],
-                in->width  >> (!!c * s->hsub),
-                in->height >> (!!c * s->vsub),
-                in->linesize[c], out->linesize[c],
-                s->coefs[c?2:0], s->coefs[c?3:1]);
-    }
-
-    if (!direct)
-        av_frame_free(&in);
-
-    return ff_filter_frame(outlink, out);
-}
-
-#define OFFSET(x) offsetof(HQDN3DContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "luma_spatial",   "spatial luma strength",    OFFSET(strength[LUMA_SPATIAL]),   AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0, DBL_MAX, FLAGS },
-    { "chroma_spatial", "spatial chroma strength",  OFFSET(strength[CHROMA_SPATIAL]), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0, DBL_MAX, FLAGS },
-    { "luma_tmp",       "temporal luma strength",   OFFSET(strength[LUMA_TMP]),       AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0, DBL_MAX, FLAGS },
-    { "chroma_tmp",     "temporal chroma strength", OFFSET(strength[CHROMA_TMP]),     AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0, DBL_MAX, FLAGS },
-    { NULL },
-};
-
-static const AVClass hqdn3d_class = {
-    .class_name = "hqdn3d",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_hqdn3d_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_input,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_hqdn3d_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_hqdn3d = {
-    .name          = "hqdn3d",
-    .description   = NULL_IF_CONFIG_SMALL("Apply a High Quality 3D Denoiser."),
-
-    .priv_size     = sizeof(HQDN3DContext),
-    .priv_class    = &hqdn3d_class,
-    .init          = init,
-    .uninit        = uninit,
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_hqdn3d_inputs,
-
-    .outputs   = avfilter_vf_hqdn3d_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_hqdn3d.h b/deps/libav/libavfilter/vf_hqdn3d.h
deleted file mode 100644
index 5cdbb12..0000000
--- a/deps/libav/libavfilter/vf_hqdn3d.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef AVFILTER_VF_HQDN3D_H
-#define AVFILTER_VF_HQDN3D_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/opt.h"
-
-typedef struct {
-    const AVClass *class;
-    int16_t *coefs[4];
-    uint16_t *line;
-    uint16_t *frame_prev[3];
-    double strength[4];
-    int hsub, vsub;
-    int depth;
-    void (*denoise_row[17])(uint8_t *src, uint8_t *dst, uint16_t *line_ant, uint16_t *frame_ant, ptrdiff_t w, int16_t *spatial, int16_t *temporal);
-} HQDN3DContext;
-
-#define LUMA_SPATIAL   0
-#define LUMA_TMP       1
-#define CHROMA_SPATIAL 2
-#define CHROMA_TMP     3
-
-void ff_hqdn3d_init_x86(HQDN3DContext *hqdn3d);
-
-#endif /* AVFILTER_VF_HQDN3D_H */
diff --git a/deps/libav/libavfilter/vf_interlace.c b/deps/libav/libavfilter/vf_interlace.c
deleted file mode 100644
index a05ab03..0000000
--- a/deps/libav/libavfilter/vf_interlace.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/**
- * @file
- * progressive to interlaced content filter, inspired by heavy debugging of tinterlace filter
- */
-
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/avassert.h"
-
-#include "formats.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-enum ScanMode {
-    MODE_TFF = 0,
-    MODE_BFF = 1,
-};
-
-enum FieldType {
-    FIELD_UPPER = 0,
-    FIELD_LOWER = 1,
-};
-
-typedef struct {
-    const AVClass *class;
-    enum ScanMode scan;    // top or bottom field first scanning
-    int lowpass;           // enable or disable low pass filterning
-    AVFrame *cur, *next;   // the two frames from which the new one is obtained
-    int got_output;        // signal an output frame is reday to request_frame()
-} InterlaceContext;
-
-#define OFFSET(x) offsetof(InterlaceContext, x)
-#define V AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "scan", "scanning mode", OFFSET(scan),
-        AV_OPT_TYPE_INT,   {.i64 = MODE_TFF }, 0, 1, .flags = V, .unit = "scan" },
-    { "tff", "top field first", 0,
-        AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags = V, .unit = "scan" },
-    { "bff", "bottom field first", 0,
-        AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags = V, .unit = "scan" },
-    { "lowpass", "enable vertical low-pass filter", OFFSET(lowpass),
-        AV_OPT_TYPE_INT,   {.i64 = 1 },        0, 1, .flags = V },
-    { NULL }
-};
-
-static const AVClass class = {
-    .class_name = "interlace filter",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-
-static const enum AVPixelFormat formats_supported[] = {
-    AV_PIX_FMT_YUV420P,  AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV444P,
-    AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV410P,  AV_PIX_FMT_YUVA420P,
-    AV_PIX_FMT_GRAY8,    AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
-    AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
-};
-
-static int query_formats(AVFilterContext *ctx)
-{
-    ff_set_common_formats(ctx, ff_make_format_list(formats_supported));
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    InterlaceContext *s = ctx->priv;
-
-    av_frame_free(&s->cur);
-    av_frame_free(&s->next);
-
-    av_opt_free(s);
-}
-
-static int config_out_props(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    AVFilterLink *inlink = outlink->src->inputs[0];
-    InterlaceContext *s = ctx->priv;
-
-    if (inlink->h < 2) {
-        av_log(ctx, AV_LOG_ERROR, "input video height is too small\n");
-        return AVERROR_INVALIDDATA;
-    }
-    // same input size
-    outlink->w = inlink->w;
-    outlink->h = inlink->h;
-    outlink->time_base = inlink->time_base;
-    // half framerate
-    outlink->time_base.num *= 2;
-
-    av_log(ctx, AV_LOG_VERBOSE, "%s interlacing %s lowpass filter\n",
-           s->scan == MODE_TFF ? "tff" : "bff", (s->lowpass) ? "with" : "without");
-
-    return 0;
-}
-
-static void copy_picture_field(AVFrame *src_frame, AVFrame *dst_frame,
-                               AVFilterLink *inlink, enum FieldType field_type,
-                               int lowpass)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    int vsub = desc->log2_chroma_h;
-    int plane, i, j;
-
-    for (plane = 0; plane < desc->nb_components; plane++) {
-        int lines = (plane == 1 || plane == 2) ? -(-inlink->h) >> vsub : inlink->h;
-        int linesize = av_image_get_linesize(inlink->format, inlink->w, plane);
-        uint8_t *dstp = dst_frame->data[plane];
-        const uint8_t *srcp = src_frame->data[plane];
-
-        av_assert0(linesize >= 0);
-
-        lines = (lines + (field_type == FIELD_UPPER)) / 2;
-        if (field_type == FIELD_LOWER)
-            srcp += src_frame->linesize[plane];
-        if (field_type == FIELD_LOWER)
-            dstp += dst_frame->linesize[plane];
-        if (lowpass) {
-            int srcp_linesize = src_frame->linesize[plane] * 2;
-            int dstp_linesize = dst_frame->linesize[plane] * 2;
-            for (j = lines; j > 0; j--) {
-                const uint8_t *srcp_above = srcp - src_frame->linesize[plane];
-                const uint8_t *srcp_below = srcp + src_frame->linesize[plane];
-                if (j == lines)
-                    srcp_above = srcp; // there is no line above
-                if (j == 1)
-                    srcp_below = srcp; // there is no line below
-                for (i = 0; i < linesize; i++) {
-                    // this calculation is an integer representation of
-                    // '0.5 * current + 0.25 * above + 0.25 * below'
-                    // '1 +' is for rounding.
-                    dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i]) >> 2;
-                }
-                dstp += dstp_linesize;
-                srcp += srcp_linesize;
-            }
-        } else {
-            av_image_copy_plane(dstp, dst_frame->linesize[plane] * 2,
-                                srcp, src_frame->linesize[plane] * 2,
-                                linesize, lines);
-        }
-    }
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
-{
-    AVFilterContext *ctx = inlink->dst;
-    AVFilterLink *outlink = ctx->outputs[0];
-    InterlaceContext *s = ctx->priv;
-    AVFrame *out;
-    int tff, ret;
-
-    av_frame_free(&s->cur);
-    s->cur  = s->next;
-    s->next = buf;
-
-    /* we need at least two frames */
-    if (!s->cur || !s->next)
-        return 0;
-
-    if (s->cur->interlaced_frame) {
-        av_log(ctx, AV_LOG_WARNING,
-               "video is already interlaced, adjusting framerate only\n");
-        out = av_frame_clone(s->cur);
-        if (!out)
-            return AVERROR(ENOMEM);
-        out->pts /= 2;  // adjust pts to new framerate
-        ret = ff_filter_frame(outlink, out);
-        s->got_output = 1;
-        return ret;
-    }
-
-    tff = (s->scan == MODE_TFF);
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out)
-        return AVERROR(ENOMEM);
-
-    av_frame_copy_props(out, s->cur);
-    out->interlaced_frame = 1;
-    out->top_field_first  = tff;
-    out->pts             /= 2;  // adjust pts to new framerate
-
-    /* copy upper/lower field from cur */
-    copy_picture_field(s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER, s->lowpass);
-    av_frame_free(&s->cur);
-
-    /* copy lower/upper field from next */
-    copy_picture_field(s->next, out, inlink, tff ? FIELD_LOWER : FIELD_UPPER, s->lowpass);
-    av_frame_free(&s->next);
-
-    ret = ff_filter_frame(outlink, out);
-    s->got_output = 1;
-
-    return ret;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    InterlaceContext *s  = ctx->priv;
-    int ret = 0;
-
-    s->got_output = 0;
-    while (ret >= 0 && !s->got_output)
-        ret = ff_request_frame(ctx->inputs[0]);
-
-    return ret;
-}
-
-static const AVFilterPad inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .config_props  = config_out_props,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_interlace = {
-    .name          = "interlace",
-    .description   = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."),
-    .uninit        = uninit,
-
-    .priv_class    = &class,
-    .priv_size     = sizeof(InterlaceContext),
-    .query_formats = query_formats,
-
-    .inputs        = inputs,
-    .outputs       = outputs,
-};
-
diff --git a/deps/libav/libavfilter/vf_libopencv.c b/deps/libav/libavfilter/vf_libopencv.c
deleted file mode 100644
index fa913f7..0000000
--- a/deps/libav/libavfilter/vf_libopencv.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Copyright (c) 2010 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * libopencv wrapper functions
- */
-
-#include <opencv/cv.h>
-#include <opencv/cxcore.h>
-#include "libavutil/avstring.h"
-#include "libavutil/common.h"
-#include "libavutil/file.h"
-#include "libavutil/opt.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-static void fill_iplimage_from_frame(IplImage *img, const AVFrame *frame, enum AVPixelFormat pixfmt)
-{
-    IplImage *tmpimg;
-    int depth, channels_nb;
-
-    if      (pixfmt == AV_PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U;  channels_nb = 1; }
-    else if (pixfmt == AV_PIX_FMT_BGRA)  { depth = IPL_DEPTH_8U;  channels_nb = 4; }
-    else if (pixfmt == AV_PIX_FMT_BGR24) { depth = IPL_DEPTH_8U;  channels_nb = 3; }
-    else return;
-
-    tmpimg = cvCreateImageHeader((CvSize){frame->width, frame->height}, depth, channels_nb);
-    *img = *tmpimg;
-    img->imageData = img->imageDataOrigin = frame->data[0];
-    img->dataOrder = IPL_DATA_ORDER_PIXEL;
-    img->origin    = IPL_ORIGIN_TL;
-    img->widthStep = frame->linesize[0];
-}
-
-static void fill_frame_from_iplimage(AVFrame *frame, const IplImage *img, enum AVPixelFormat pixfmt)
-{
-    frame->linesize[0] = img->widthStep;
-    frame->data[0]     = img->imageData;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-typedef struct {
-    const AVClass *class;
-    char *name;
-    char *params;
-    int (*init)(AVFilterContext *ctx, const char *args);
-    void (*uninit)(AVFilterContext *ctx);
-    void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg);
-    void *priv;
-} OCVContext;
-
-typedef struct {
-    int type;
-    int    param1, param2;
-    double param3, param4;
-} SmoothContext;
-
-static av_cold int smooth_init(AVFilterContext *ctx, const char *args)
-{
-    OCVContext *s = ctx->priv;
-    SmoothContext *smooth = s->priv;
-    char type_str[128] = "gaussian";
-
-    smooth->param1 = 3;
-    smooth->param2 = 0;
-    smooth->param3 = 0.0;
-    smooth->param4 = 0.0;
-
-    if (args)
-        sscanf(args, "%127[^|]|%d|%d|%lf|%lf", type_str, &smooth->param1, &smooth->param2, &smooth->param3, &smooth->param4);
-
-    if      (!strcmp(type_str, "blur"         )) smooth->type = CV_BLUR;
-    else if (!strcmp(type_str, "blur_no_scale")) smooth->type = CV_BLUR_NO_SCALE;
-    else if (!strcmp(type_str, "median"       )) smooth->type = CV_MEDIAN;
-    else if (!strcmp(type_str, "gaussian"     )) smooth->type = CV_GAUSSIAN;
-    else if (!strcmp(type_str, "bilateral"    )) smooth->type = CV_BILATERAL;
-    else {
-        av_log(ctx, AV_LOG_ERROR, "Smoothing type '%s' unknown.\n", type_str);
-        return AVERROR(EINVAL);
-    }
-
-    if (smooth->param1 < 0 || !(smooth->param1%2)) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid value '%d' for param1, it has to be a positive odd number\n",
-               smooth->param1);
-        return AVERROR(EINVAL);
-    }
-    if ((smooth->type == CV_BLUR || smooth->type == CV_BLUR_NO_SCALE || smooth->type == CV_GAUSSIAN) &&
-        (smooth->param2 < 0 || (smooth->param2 && !(smooth->param2%2)))) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid value '%d' for param2, it has to be zero or a positive odd number\n",
-               smooth->param2);
-        return AVERROR(EINVAL);
-    }
-
-    av_log(ctx, AV_LOG_VERBOSE, "type:%s param1:%d param2:%d param3:%f param4:%f\n",
-           type_str, smooth->param1, smooth->param2, smooth->param3, smooth->param4);
-    return 0;
-}
-
-static void smooth_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
-{
-    OCVContext *s = ctx->priv;
-    SmoothContext *smooth = s->priv;
-    cvSmooth(inimg, outimg, smooth->type, smooth->param1, smooth->param2, smooth->param3, smooth->param4);
-}
-
-static int read_shape_from_file(int *cols, int *rows, int **values, const char *filename,
-                                void *log_ctx)
-{
-    uint8_t *buf, *p, *pend;
-    size_t size;
-    int ret, i, j, w;
-
-    if ((ret = av_file_map(filename, &buf, &size, 0, log_ctx)) < 0)
-        return ret;
-
-    /* prescan file to get the number of lines and the maximum width */
-    w = 0;
-    for (i = 0; i < size; i++) {
-        if (buf[i] == '\n') {
-            if (*rows == INT_MAX) {
-                av_log(log_ctx, AV_LOG_ERROR, "Overflow on the number of rows in the file\n");
-                return AVERROR_INVALIDDATA;
-            }
-            ++(*rows);
-            *cols = FFMAX(*cols, w);
-            w = 0;
-        } else if (w == INT_MAX) {
-            av_log(log_ctx, AV_LOG_ERROR, "Overflow on the number of columns in the file\n");
-            return AVERROR_INVALIDDATA;
-        }
-        w++;
-    }
-    if (*rows > (SIZE_MAX / sizeof(int) / *cols)) {
-        av_log(log_ctx, AV_LOG_ERROR, "File with size %dx%d is too big\n",
-               *rows, *cols);
-        return AVERROR_INVALIDDATA;
-    }
-    if (!(*values = av_mallocz(sizeof(int) * *rows * *cols)))
-        return AVERROR(ENOMEM);
-
-    /* fill *values */
-    p    = buf;
-    pend = buf + size-1;
-    for (i = 0; i < *rows; i++) {
-        for (j = 0;; j++) {
-            if (p > pend || *p == '\n') {
-                p++;
-                break;
-            } else
-                (*values)[*cols*i + j] = !!av_isgraph(*(p++));
-        }
-    }
-    av_file_unmap(buf, size);
-
-#ifdef DEBUG
-    {
-        char *line;
-        if (!(line = av_malloc(*cols + 1)))
-            return AVERROR(ENOMEM);
-        for (i = 0; i < *rows; i++) {
-            for (j = 0; j < *cols; j++)
-                line[j] = (*values)[i * *cols + j] ? '@' : ' ';
-            line[j] = 0;
-            av_log(log_ctx, AV_LOG_DEBUG, "%3d: %s\n", i, line);
-        }
-        av_free(line);
-    }
-#endif
-
-    return 0;
-}
-
-static int parse_iplconvkernel(IplConvKernel **kernel, char *buf, void *log_ctx)
-{
-    char shape_filename[128] = "", shape_str[32] = "rect";
-    int cols = 0, rows = 0, anchor_x = 0, anchor_y = 0, shape = CV_SHAPE_RECT;
-    int *values = NULL, ret;
-
-    sscanf(buf, "%dx%d+%dx%d/%32[^=]=%127s", &cols, &rows, &anchor_x, &anchor_y, shape_str, shape_filename);
-
-    if      (!strcmp(shape_str, "rect"   )) shape = CV_SHAPE_RECT;
-    else if (!strcmp(shape_str, "cross"  )) shape = CV_SHAPE_CROSS;
-    else if (!strcmp(shape_str, "ellipse")) shape = CV_SHAPE_ELLIPSE;
-    else if (!strcmp(shape_str, "custom" )) {
-        shape = CV_SHAPE_CUSTOM;
-        if ((ret = read_shape_from_file(&cols, &rows, &values, shape_filename, log_ctx)) < 0)
-            return ret;
-    } else {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "Shape unspecified or type '%s' unknown.\n", shape_str);
-        return AVERROR(EINVAL);
-    }
-
-    if (rows <= 0 || cols <= 0) {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "Invalid non-positive values for shape size %dx%d\n", cols, rows);
-        return AVERROR(EINVAL);
-    }
-
-    if (anchor_x < 0 || anchor_y < 0 || anchor_x >= cols || anchor_y >= rows) {
-        av_log(log_ctx, AV_LOG_ERROR,
-               "Shape anchor %dx%d is not inside the rectangle with size %dx%d.\n",
-               anchor_x, anchor_y, cols, rows);
-        return AVERROR(EINVAL);
-    }
-
-    *kernel = cvCreateStructuringElementEx(cols, rows, anchor_x, anchor_y, shape, values);
-    av_freep(&values);
-    if (!*kernel)
-        return AVERROR(ENOMEM);
-
-    av_log(log_ctx, AV_LOG_VERBOSE, "Structuring element: w:%d h:%d x:%d y:%d shape:%s\n",
-           rows, cols, anchor_x, anchor_y, shape_str);
-    return 0;
-}
-
-typedef struct {
-    int nb_iterations;
-    IplConvKernel *kernel;
-} DilateContext;
-
-static av_cold int dilate_init(AVFilterContext *ctx, const char *args)
-{
-    OCVContext *s = ctx->priv;
-    DilateContext *dilate = s->priv;
-    char default_kernel_str[] = "3x3+0x0/rect";
-    char *kernel_str;
-    const char *buf = args;
-    int ret;
-
-    dilate->nb_iterations = 1;
-
-    if (args)
-        kernel_str = av_get_token(&buf, "|");
-    if ((ret = parse_iplconvkernel(&dilate->kernel,
-                                   *kernel_str ? kernel_str : default_kernel_str,
-                                   ctx)) < 0)
-        return ret;
-    av_free(kernel_str);
-
-    sscanf(buf, "|%d", &dilate->nb_iterations);
-    av_log(ctx, AV_LOG_VERBOSE, "iterations_nb:%d\n", dilate->nb_iterations);
-    if (dilate->nb_iterations <= 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid non-positive value '%d' for nb_iterations\n",
-               dilate->nb_iterations);
-        return AVERROR(EINVAL);
-    }
-    return 0;
-}
-
-static av_cold void dilate_uninit(AVFilterContext *ctx)
-{
-    OCVContext *s = ctx->priv;
-    DilateContext *dilate = s->priv;
-
-    cvReleaseStructuringElement(&dilate->kernel);
-}
-
-static void dilate_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
-{
-    OCVContext *s = ctx->priv;
-    DilateContext *dilate = s->priv;
-    cvDilate(inimg, outimg, dilate->kernel, dilate->nb_iterations);
-}
-
-static void erode_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
-{
-    OCVContext *s = ctx->priv;
-    DilateContext *dilate = s->priv;
-    cvErode(inimg, outimg, dilate->kernel, dilate->nb_iterations);
-}
-
-typedef struct {
-    const char *name;
-    size_t priv_size;
-    int  (*init)(AVFilterContext *ctx, const char *args);
-    void (*uninit)(AVFilterContext *ctx);
-    void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg);
-} OCVFilterEntry;
-
-static OCVFilterEntry ocv_filter_entries[] = {
-    { "dilate", sizeof(DilateContext), dilate_init, dilate_uninit, dilate_end_frame_filter },
-    { "erode",  sizeof(DilateContext), dilate_init, dilate_uninit, erode_end_frame_filter  },
-    { "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter },
-};
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    OCVContext *s = ctx->priv;
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(ocv_filter_entries); i++) {
-        OCVFilterEntry *entry = &ocv_filter_entries[i];
-        if (!strcmp(s->name, entry->name)) {
-            s->init             = entry->init;
-            s->uninit           = entry->uninit;
-            s->end_frame_filter = entry->end_frame_filter;
-
-            if (!(s->priv = av_mallocz(entry->priv_size)))
-                return AVERROR(ENOMEM);
-            return s->init(ctx, s->params);
-        }
-    }
-
-    av_log(ctx, AV_LOG_ERROR, "No libopencv filter named '%s'\n", s->name);
-    return AVERROR(EINVAL);
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    OCVContext *s = ctx->priv;
-
-    if (s->uninit)
-        s->uninit(ctx);
-    av_free(s->priv);
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    AVFilterContext *ctx = inlink->dst;
-    OCVContext *s = ctx->priv;
-    AVFilterLink *outlink= inlink->dst->outputs[0];
-    AVFrame *out;
-    IplImage inimg, outimg;
-
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-    av_frame_copy_props(out, in);
-
-    fill_iplimage_from_frame(&inimg , in , inlink->format);
-    fill_iplimage_from_frame(&outimg, out, inlink->format);
-    s->end_frame_filter(ctx, &inimg, &outimg);
-    fill_frame_from_iplimage(out, &outimg, inlink->format);
-
-    av_frame_free(&in);
-
-    return ff_filter_frame(outlink, out);
-}
-
-#define OFFSET(x) offsetof(OCVContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "filter_name",   NULL, OFFSET(name),   AV_OPT_TYPE_STRING, .flags = FLAGS },
-    { "filter_params", NULL, OFFSET(params), AV_OPT_TYPE_STRING, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass ocv_class = {
-    .class_name = "ocv",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_ocv_inputs[] = {
-    {
-        .name       = "default",
-        .type       = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_ocv_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_ocv = {
-    .name        = "ocv",
-    .description = NULL_IF_CONFIG_SMALL("Apply transform using libopencv."),
-
-    .priv_size = sizeof(OCVContext),
-    .priv_class = &ocv_class,
-
-    .query_formats = query_formats,
-    .init = init,
-    .uninit = uninit,
-
-    .inputs    = avfilter_vf_ocv_inputs,
-
-    .outputs   = avfilter_vf_ocv_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_lut.c b/deps/libav/libavfilter/vf_lut.c
deleted file mode 100644
index c59dcd6..0000000
--- a/deps/libav/libavfilter/vf_lut.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Copyright (c) 2011 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Compute a look-up table for binding the input value to the output
- * value, and apply it to input video.
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "libavutil/eval.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-static const char *const var_names[] = {
-    "E",
-    "PHI",
-    "PI",
-    "w",        ///< width of the input video
-    "h",        ///< height of the input video
-    "val",      ///< input value for the pixel
-    "maxval",   ///< max value for the pixel
-    "minval",   ///< min value for the pixel
-    "negval",   ///< negated value
-    "clipval",
-    NULL
-};
-
-enum var_name {
-    VAR_E,
-    VAR_PHI,
-    VAR_PI,
-    VAR_W,
-    VAR_H,
-    VAR_VAL,
-    VAR_MAXVAL,
-    VAR_MINVAL,
-    VAR_NEGVAL,
-    VAR_CLIPVAL,
-    VAR_VARS_NB
-};
-
-typedef struct {
-    const AVClass *class;
-    uint8_t lut[4][256];  ///< lookup table for each component
-    char   *comp_expr_str[4];
-    AVExpr *comp_expr[4];
-    int hsub, vsub;
-    double var_values[VAR_VARS_NB];
-    int is_rgb, is_yuv;
-    int rgba_map[4];
-    int step;
-    int negate_alpha; /* only used by negate */
-} LutContext;
-
-#define Y 0
-#define U 1
-#define V 2
-#define R 0
-#define G 1
-#define B 2
-#define A 3
-
-#define OFFSET(x) offsetof(LutContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-
-static const AVOption lut_options[] = {
-    { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "c1", "set component #1 expression", OFFSET(comp_expr_str[1]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "c2", "set component #2 expression", OFFSET(comp_expr_str[2]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "c3", "set component #3 expression", OFFSET(comp_expr_str[3]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "y",  "set Y expression",            OFFSET(comp_expr_str[Y]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "u",  "set U expression",            OFFSET(comp_expr_str[U]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "v",  "set V expression",            OFFSET(comp_expr_str[V]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "r",  "set R expression",            OFFSET(comp_expr_str[R]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "g",  "set G expression",            OFFSET(comp_expr_str[G]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "b",  "set B expression",            OFFSET(comp_expr_str[B]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { "a",  "set A expression",            OFFSET(comp_expr_str[A]),  AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS },
-    { NULL },
-};
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    LutContext *s = ctx->priv;
-
-    s->var_values[VAR_PHI] = M_PHI;
-    s->var_values[VAR_PI]  = M_PI;
-    s->var_values[VAR_E ]  = M_E;
-
-    s->is_rgb = !strcmp(ctx->filter->name, "lutrgb");
-    s->is_yuv = !strcmp(ctx->filter->name, "lutyuv");
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    LutContext *s = ctx->priv;
-    int i;
-
-    for (i = 0; i < 4; i++) {
-        av_expr_free(s->comp_expr[i]);
-        s->comp_expr[i] = NULL;
-        av_freep(&s->comp_expr_str[i]);
-    }
-}
-
-#define YUV_FORMATS                                         \
-    AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV420P,    \
-    AV_PIX_FMT_YUV411P,  AV_PIX_FMT_YUV410P,  AV_PIX_FMT_YUV440P,    \
-    AV_PIX_FMT_YUVA420P,                                       \
-    AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,   \
-    AV_PIX_FMT_YUVJ440P
-
-#define RGB_FORMATS                             \
-    AV_PIX_FMT_ARGB,         AV_PIX_FMT_RGBA,         \
-    AV_PIX_FMT_ABGR,         AV_PIX_FMT_BGRA,         \
-    AV_PIX_FMT_RGB24,        AV_PIX_FMT_BGR24
-
-static const enum AVPixelFormat yuv_pix_fmts[] = { YUV_FORMATS, AV_PIX_FMT_NONE };
-static const enum AVPixelFormat rgb_pix_fmts[] = { RGB_FORMATS, AV_PIX_FMT_NONE };
-static const enum AVPixelFormat all_pix_fmts[] = { RGB_FORMATS, YUV_FORMATS, AV_PIX_FMT_NONE };
-
-static int query_formats(AVFilterContext *ctx)
-{
-    LutContext *s = ctx->priv;
-
-    const enum AVPixelFormat *pix_fmts = s->is_rgb ? rgb_pix_fmts :
-                                                     s->is_yuv ? yuv_pix_fmts :
-                                                                 all_pix_fmts;
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-/**
- * Clip value val in the minval - maxval range.
- */
-static double clip(void *opaque, double val)
-{
-    LutContext *s = opaque;
-    double minval = s->var_values[VAR_MINVAL];
-    double maxval = s->var_values[VAR_MAXVAL];
-
-    return av_clip(val, minval, maxval);
-}
-
-/**
- * Compute gamma correction for value val, assuming the minval-maxval
- * range, val is clipped to a value contained in the same interval.
- */
-static double compute_gammaval(void *opaque, double gamma)
-{
-    LutContext *s = opaque;
-    double val    = s->var_values[VAR_CLIPVAL];
-    double minval = s->var_values[VAR_MINVAL];
-    double maxval = s->var_values[VAR_MAXVAL];
-
-    return pow((val-minval)/(maxval-minval), gamma) * (maxval-minval)+minval;
-}
-
-static double (* const funcs1[])(void *, double) = {
-    clip,
-    compute_gammaval,
-    NULL
-};
-
-static const char * const funcs1_names[] = {
-    "clip",
-    "gammaval",
-    NULL
-};
-
-static int config_props(AVFilterLink *inlink)
-{
-    AVFilterContext *ctx = inlink->dst;
-    LutContext *s = ctx->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    int min[4], max[4];
-    int val, comp, ret;
-
-    s->hsub = desc->log2_chroma_w;
-    s->vsub = desc->log2_chroma_h;
-
-    s->var_values[VAR_W] = inlink->w;
-    s->var_values[VAR_H] = inlink->h;
-
-    switch (inlink->format) {
-    case AV_PIX_FMT_YUV410P:
-    case AV_PIX_FMT_YUV411P:
-    case AV_PIX_FMT_YUV420P:
-    case AV_PIX_FMT_YUV422P:
-    case AV_PIX_FMT_YUV440P:
-    case AV_PIX_FMT_YUV444P:
-    case AV_PIX_FMT_YUVA420P:
-        min[Y] = min[U] = min[V] = 16;
-        max[Y] = 235;
-        max[U] = max[V] = 240;
-        min[A] = 0; max[A] = 255;
-        break;
-    default:
-        min[0] = min[1] = min[2] = min[3] = 0;
-        max[0] = max[1] = max[2] = max[3] = 255;
-    }
-
-    s->is_yuv = s->is_rgb = 0;
-    if      (ff_fmt_is_in(inlink->format, yuv_pix_fmts)) s->is_yuv = 1;
-    else if (ff_fmt_is_in(inlink->format, rgb_pix_fmts)) s->is_rgb = 1;
-
-    if (s->is_rgb) {
-        switch (inlink->format) {
-        case AV_PIX_FMT_ARGB:  s->rgba_map[A] = 0; s->rgba_map[R] = 1; s->rgba_map[G] = 2; s->rgba_map[B] = 3; break;
-        case AV_PIX_FMT_ABGR:  s->rgba_map[A] = 0; s->rgba_map[B] = 1; s->rgba_map[G] = 2; s->rgba_map[R] = 3; break;
-        case AV_PIX_FMT_RGBA:
-        case AV_PIX_FMT_RGB24: s->rgba_map[R] = 0; s->rgba_map[G] = 1; s->rgba_map[B] = 2; s->rgba_map[A] = 3; break;
-        case AV_PIX_FMT_BGRA:
-        case AV_PIX_FMT_BGR24: s->rgba_map[B] = 0; s->rgba_map[G] = 1; s->rgba_map[R] = 2; s->rgba_map[A] = 3; break;
-        }
-        s->step = av_get_bits_per_pixel(desc) >> 3;
-    }
-
-    for (comp = 0; comp < desc->nb_components; comp++) {
-        double res;
-
-        /* create the parsed expression */
-        av_expr_free(s->comp_expr[comp]);
-        s->comp_expr[comp] = NULL;
-        ret = av_expr_parse(&s->comp_expr[comp], s->comp_expr_str[comp],
-                            var_names, funcs1_names, funcs1, NULL, NULL, 0, ctx);
-        if (ret < 0) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Error when parsing the expression '%s' for the component %d.\n",
-                   s->comp_expr_str[comp], comp);
-            return AVERROR(EINVAL);
-        }
-
-        /* compute the s */
-        s->var_values[VAR_MAXVAL] = max[comp];
-        s->var_values[VAR_MINVAL] = min[comp];
-
-        for (val = 0; val < 256; val++) {
-            s->var_values[VAR_VAL] = val;
-            s->var_values[VAR_CLIPVAL] = av_clip(val, min[comp], max[comp]);
-            s->var_values[VAR_NEGVAL] =
-                av_clip(min[comp] + max[comp] - s->var_values[VAR_VAL],
-                        min[comp], max[comp]);
-
-            res = av_expr_eval(s->comp_expr[comp], s->var_values, s);
-            if (isnan(res)) {
-                av_log(ctx, AV_LOG_ERROR,
-                       "Error when evaluating the expression '%s' for the value %d for the component #%d.\n",
-                       s->comp_expr_str[comp], val, comp);
-                return AVERROR(EINVAL);
-            }
-            s->lut[comp][val] = av_clip((int)res, min[comp], max[comp]);
-            av_log(ctx, AV_LOG_DEBUG, "val[%d][%d] = %d\n", comp, val, s->lut[comp][val]);
-        }
-    }
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    AVFilterContext *ctx = inlink->dst;
-    LutContext *s = ctx->priv;
-    AVFilterLink *outlink = ctx->outputs[0];
-    AVFrame *out;
-    uint8_t *inrow, *outrow, *inrow0, *outrow0;
-    int i, j, k, plane;
-
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-    av_frame_copy_props(out, in);
-
-    if (s->is_rgb) {
-        /* packed */
-        inrow0  = in ->data[0];
-        outrow0 = out->data[0];
-
-        for (i = 0; i < in->height; i ++) {
-            inrow  = inrow0;
-            outrow = outrow0;
-            for (j = 0; j < inlink->w; j++) {
-                for (k = 0; k < s->step; k++)
-                    outrow[k] = s->lut[s->rgba_map[k]][inrow[k]];
-                outrow += s->step;
-                inrow  += s->step;
-            }
-            inrow0  += in ->linesize[0];
-            outrow0 += out->linesize[0];
-        }
-    } else {
-        /* planar */
-        for (plane = 0; plane < 4 && in->data[plane]; plane++) {
-            int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
-            int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
-
-            inrow  = in ->data[plane];
-            outrow = out->data[plane];
-
-            for (i = 0; i < in->height >> vsub; i ++) {
-                for (j = 0; j < inlink->w>>hsub; j++)
-                    outrow[j] = s->lut[plane][inrow[j]];
-                inrow  += in ->linesize[plane];
-                outrow += out->linesize[plane];
-            }
-        }
-    }
-
-    av_frame_free(&in);
-    return ff_filter_frame(outlink, out);
-}
-
-static const AVFilterPad inputs[] = {
-    { .name            = "default",
-      .type            = AVMEDIA_TYPE_VIDEO,
-      .filter_frame    = filter_frame,
-      .config_props    = config_props,
-    },
-    { .name = NULL}
-};
-static const AVFilterPad outputs[] = {
-    { .name            = "default",
-      .type            = AVMEDIA_TYPE_VIDEO, },
-    { .name = NULL}
-};
-#define DEFINE_LUT_FILTER(name_, description_, init_, options)          \
-    static const AVClass name_ ## _class = {                            \
-        .class_name = #name_,                                           \
-        .item_name  = av_default_item_name,                             \
-        .option     = options,                                          \
-        .version    = LIBAVUTIL_VERSION_INT,                            \
-    };                                                                  \
-    AVFilter ff_vf_##name_ = {                                          \
-        .name          = #name_,                                        \
-        .description   = NULL_IF_CONFIG_SMALL(description_),            \
-        .priv_size     = sizeof(LutContext),                            \
-        .priv_class    = &name_ ## _class,                              \
-                                                                        \
-        .init          = init_,                                         \
-        .uninit        = uninit,                                        \
-        .query_formats = query_formats,                                 \
-                                                                        \
-        .inputs        = inputs,                                        \
-        .outputs       = outputs,                                       \
-    }
-
-#if CONFIG_LUT_FILTER
-DEFINE_LUT_FILTER(lut,    "Compute and apply a lookup table to the RGB/YUV input video.", init, lut_options);
-#endif
-#if CONFIG_LUTYUV_FILTER
-DEFINE_LUT_FILTER(lutyuv, "Compute and apply a lookup table to the YUV input video.",     init, lut_options);
-#endif
-#if CONFIG_LUTRGB_FILTER
-DEFINE_LUT_FILTER(lutrgb, "Compute and apply a lookup table to the RGB input video.",     init, lut_options);
-#endif
-
-#if CONFIG_NEGATE_FILTER
-
-static const AVOption negate_options[] = {
-    { "negate_alpha", NULL, OFFSET(negate_alpha), AV_OPT_TYPE_INT, { .i64 = 0 }, .flags = FLAGS },
-    { NULL },
-};
-
-static av_cold int negate_init(AVFilterContext *ctx)
-{
-    LutContext *s = ctx->priv;
-    int i;
-
-    av_log(ctx, AV_LOG_DEBUG, "negate_alpha:%d\n", s->negate_alpha);
-
-    for (i = 0; i < 4; i++) {
-        s->comp_expr_str[i] = av_strdup((i == 3 && s->negate_alpha) ?
-                                          "val" : "negval");
-        if (!s->comp_expr_str[i]) {
-            uninit(ctx);
-            return AVERROR(ENOMEM);
-        }
-    }
-
-    return init(ctx);
-}
-
-DEFINE_LUT_FILTER(negate, "Negate input video.", negate_init, negate_options);
-
-#endif
diff --git a/deps/libav/libavfilter/vf_null.c b/deps/libav/libavfilter/vf_null.c
deleted file mode 100644
index f872587..0000000
--- a/deps/libav/libavfilter/vf_null.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * null video filter
- */
-
-#include "libavutil/internal.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-static const AVFilterPad avfilter_vf_null_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_null_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_null = {
-    .name      = "null",
-    .description = NULL_IF_CONFIG_SMALL("Pass the source unchanged to the output."),
-
-    .priv_size = 0,
-
-    .inputs    = avfilter_vf_null_inputs,
-
-    .outputs   = avfilter_vf_null_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_overlay.c b/deps/libav/libavfilter/vf_overlay.c
deleted file mode 100644
index b3591eb..0000000
--- a/deps/libav/libavfilter/vf_overlay.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * Copyright (c) 2010 Stefano Sabatini
- * Copyright (c) 2010 Baptiste Coudurier
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * overlay one video on top of another
- */
-
-#include "avfilter.h"
-#include "formats.h"
-#include "libavutil/common.h"
-#include "libavutil/eval.h"
-#include "libavutil/avstring.h"
-#include "libavutil/avassert.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "internal.h"
-#include "video.h"
-
-static const char *const var_names[] = {
-    "E",
-    "PHI",
-    "PI",
-    "main_w",    "W", ///< width  of the main    video
-    "main_h",    "H", ///< height of the main    video
-    "overlay_w", "w", ///< width  of the overlay video
-    "overlay_h", "h", ///< height of the overlay video
-    NULL
-};
-
-enum var_name {
-    VAR_E,
-    VAR_PHI,
-    VAR_PI,
-    VAR_MAIN_W,    VAR_MW,
-    VAR_MAIN_H,    VAR_MH,
-    VAR_OVERLAY_W, VAR_OW,
-    VAR_OVERLAY_H, VAR_OH,
-    VAR_VARS_NB
-};
-
-enum EOFAction {
-    EOF_ACTION_REPEAT,
-    EOF_ACTION_ENDALL,
-    EOF_ACTION_PASS
-};
-
-static const char *eof_action_str[] = {
-    "repeat", "endall", "pass"
-};
-
-#define MAIN    0
-#define OVERLAY 1
-
-typedef struct {
-    const AVClass *class;
-    int x, y;                   ///< position of overlayed picture
-
-    int max_plane_step[4];      ///< steps per pixel for each plane
-    int hsub, vsub;             ///< chroma subsampling values
-
-    char *x_expr, *y_expr;
-
-    enum EOFAction eof_action;  ///< action to take on EOF from source
-
-    AVFrame *main;
-    AVFrame *over_prev, *over_next;
-} OverlayContext;
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    OverlayContext *s = ctx->priv;
-
-    av_frame_free(&s->main);
-    av_frame_free(&s->over_prev);
-    av_frame_free(&s->over_next);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    const enum AVPixelFormat inout_pix_fmts[] = { AV_PIX_FMT_YUV420P,  AV_PIX_FMT_NONE };
-    const enum AVPixelFormat blend_pix_fmts[] = { AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE };
-    AVFilterFormats *inout_formats = ff_make_format_list(inout_pix_fmts);
-    AVFilterFormats *blend_formats = ff_make_format_list(blend_pix_fmts);
-
-    ff_formats_ref(inout_formats, &ctx->inputs [MAIN   ]->out_formats);
-    ff_formats_ref(blend_formats, &ctx->inputs [OVERLAY]->out_formats);
-    ff_formats_ref(inout_formats, &ctx->outputs[MAIN   ]->in_formats );
-
-    return 0;
-}
-
-static int config_input_main(AVFilterLink *inlink)
-{
-    OverlayContext *s = inlink->dst->priv;
-    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
-
-    av_image_fill_max_pixsteps(s->max_plane_step, NULL, pix_desc);
-    s->hsub = pix_desc->log2_chroma_w;
-    s->vsub = pix_desc->log2_chroma_h;
-
-    return 0;
-}
-
-static int config_input_overlay(AVFilterLink *inlink)
-{
-    AVFilterContext *ctx  = inlink->dst;
-    OverlayContext  *s = inlink->dst->priv;
-    char *expr;
-    double var_values[VAR_VARS_NB], res;
-    int ret;
-
-    /* Finish the configuration by evaluating the expressions
-       now when both inputs are configured. */
-    var_values[VAR_E  ] = M_E;
-    var_values[VAR_PHI] = M_PHI;
-    var_values[VAR_PI ] = M_PI;
-
-    var_values[VAR_MAIN_W   ] = var_values[VAR_MW] = ctx->inputs[MAIN   ]->w;
-    var_values[VAR_MAIN_H   ] = var_values[VAR_MH] = ctx->inputs[MAIN   ]->h;
-    var_values[VAR_OVERLAY_W] = var_values[VAR_OW] = ctx->inputs[OVERLAY]->w;
-    var_values[VAR_OVERLAY_H] = var_values[VAR_OH] = ctx->inputs[OVERLAY]->h;
-
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->x_expr), var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto fail;
-    s->x = res;
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->y_expr), var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)))
-        goto fail;
-    s->y = res;
-    /* x may depend on y */
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->x_expr), var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto fail;
-    s->x = res;
-
-    av_log(ctx, AV_LOG_VERBOSE,
-           "main w:%d h:%d fmt:%s overlay x:%d y:%d w:%d h:%d fmt:%s eof_action:%s\n",
-           ctx->inputs[MAIN]->w, ctx->inputs[MAIN]->h,
-           av_get_pix_fmt_name(ctx->inputs[MAIN]->format),
-           s->x, s->y,
-           ctx->inputs[OVERLAY]->w, ctx->inputs[OVERLAY]->h,
-           av_get_pix_fmt_name(ctx->inputs[OVERLAY]->format),
-           eof_action_str[s->eof_action]);
-
-    if (s->x < 0 || s->y < 0 ||
-        s->x + var_values[VAR_OVERLAY_W] > var_values[VAR_MAIN_W] ||
-        s->y + var_values[VAR_OVERLAY_H] > var_values[VAR_MAIN_H]) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Overlay area (%d,%d)<->(%d,%d) not within the main area (0,0)<->(%d,%d) or zero-sized\n",
-               s->x, s->y,
-               (int)(s->x + var_values[VAR_OVERLAY_W]),
-               (int)(s->y + var_values[VAR_OVERLAY_H]),
-               (int)var_values[VAR_MAIN_W], (int)var_values[VAR_MAIN_H]);
-        return AVERROR(EINVAL);
-    }
-    return 0;
-
-fail:
-    av_log(NULL, AV_LOG_ERROR,
-           "Error when evaluating the expression '%s'\n", expr);
-    return ret;
-}
-
-static int config_output(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-
-    outlink->w = ctx->inputs[MAIN]->w;
-    outlink->h = ctx->inputs[MAIN]->h;
-    outlink->time_base = ctx->inputs[MAIN]->time_base;
-
-    return 0;
-}
-
-static void blend_frame(AVFilterContext *ctx,
-                        AVFrame *dst, AVFrame *src,
-                        int x, int y)
-{
-    OverlayContext *s = ctx->priv;
-    int i, j, k;
-    int width, height;
-    int overlay_end_y = y + src->height;
-    int end_y, start_y;
-
-    width = FFMIN(dst->width - x, src->width);
-    end_y = FFMIN(dst->height, overlay_end_y);
-    start_y = FFMAX(y, 0);
-    height = end_y - start_y;
-
-    if (dst->format == AV_PIX_FMT_BGR24 || dst->format == AV_PIX_FMT_RGB24) {
-        uint8_t *dp = dst->data[0] + x * 3 + start_y * dst->linesize[0];
-        uint8_t *sp = src->data[0];
-        int b = dst->format == AV_PIX_FMT_BGR24 ? 2 : 0;
-        int r = dst->format == AV_PIX_FMT_BGR24 ? 0 : 2;
-        if (y < 0)
-            sp += -y * src->linesize[0];
-        for (i = 0; i < height; i++) {
-            uint8_t *d = dp, *s = sp;
-            for (j = 0; j < width; j++) {
-                d[r] = (d[r] * (0xff - s[3]) + s[0] * s[3] + 128) >> 8;
-                d[1] = (d[1] * (0xff - s[3]) + s[1] * s[3] + 128) >> 8;
-                d[b] = (d[b] * (0xff - s[3]) + s[2] * s[3] + 128) >> 8;
-                d += 3;
-                s += 4;
-            }
-            dp += dst->linesize[0];
-            sp += src->linesize[0];
-        }
-    } else {
-        for (i = 0; i < 3; i++) {
-            int hsub = i ? s->hsub : 0;
-            int vsub = i ? s->vsub : 0;
-            uint8_t *dp = dst->data[i] + (x >> hsub) +
-                (start_y >> vsub) * dst->linesize[i];
-            uint8_t *sp = src->data[i];
-            uint8_t *ap = src->data[3];
-            int wp = FFALIGN(width, 1<<hsub) >> hsub;
-            int hp = FFALIGN(height, 1<<vsub) >> vsub;
-            if (y < 0) {
-                sp += ((-y) >> vsub) * src->linesize[i];
-                ap += -y * src->linesize[3];
-            }
-            for (j = 0; j < hp; j++) {
-                uint8_t *d = dp, *s = sp, *a = ap;
-                for (k = 0; k < wp; k++) {
-                    // average alpha for color components, improve quality
-                    int alpha_v, alpha_h, alpha;
-                    if (hsub && vsub && j+1 < hp && k+1 < wp) {
-                        alpha = (a[0] + a[src->linesize[3]] +
-                                 a[1] + a[src->linesize[3]+1]) >> 2;
-                    } else if (hsub || vsub) {
-                        alpha_h = hsub && k+1 < wp ?
-                            (a[0] + a[1]) >> 1 : a[0];
-                        alpha_v = vsub && j+1 < hp ?
-                            (a[0] + a[src->linesize[3]]) >> 1 : a[0];
-                        alpha = (alpha_v + alpha_h) >> 1;
-                    } else
-                        alpha = a[0];
-                    *d = (*d * (0xff - alpha) + *s++ * alpha + 128) >> 8;
-                    d++;
-                    a += 1 << hsub;
-                }
-                dp += dst->linesize[i];
-                sp += src->linesize[i];
-                ap += (1 << vsub) * src->linesize[3];
-            }
-        }
-    }
-}
-
-static int filter_frame_main(AVFilterLink *inlink, AVFrame *frame)
-{
-    OverlayContext *s = inlink->dst->priv;
-
-    av_assert0(!s->main);
-    s->main         = frame;
-
-    return 0;
-}
-
-static int filter_frame_overlay(AVFilterLink *inlink, AVFrame *frame)
-{
-    OverlayContext *s = inlink->dst->priv;
-
-    av_assert0(!s->over_next);
-    s->over_next    = frame;
-
-    return 0;
-}
-
-static int output_frame(AVFilterContext *ctx)
-{
-    OverlayContext *s = ctx->priv;
-    AVFilterLink *outlink = ctx->outputs[0];
-    int ret = ff_filter_frame(outlink, s->main);
-    s->main = NULL;
-
-    return ret;
-}
-
-static int handle_overlay_eof(AVFilterContext *ctx)
-{
-    OverlayContext *s = ctx->priv;
-    /* Repeat previous frame on secondary input */
-    if (s->over_prev && s->eof_action == EOF_ACTION_REPEAT)
-        blend_frame(ctx, s->main, s->over_prev, s->x, s->y);
-    /* End both streams */
-    else if (s->eof_action == EOF_ACTION_ENDALL)
-        return AVERROR_EOF;
-    return output_frame(ctx);
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    OverlayContext    *s = ctx->priv;
-    AVRational tb_main = ctx->inputs[MAIN]->time_base;
-    AVRational tb_over = ctx->inputs[OVERLAY]->time_base;
-    int ret = 0;
-
-    /* get a frame on the main input */
-    if (!s->main) {
-        ret = ff_request_frame(ctx->inputs[MAIN]);
-        if (ret < 0)
-            return ret;
-    }
-
-    /* get a new frame on the overlay input, on EOF check setting 'eof_action' */
-    if (!s->over_next) {
-        ret = ff_request_frame(ctx->inputs[OVERLAY]);
-        if (ret == AVERROR_EOF)
-           return handle_overlay_eof(ctx);
-        else if (ret < 0)
-            return ret;
-    }
-
-    while (s->main->pts != AV_NOPTS_VALUE &&
-           s->over_next->pts != AV_NOPTS_VALUE &&
-           av_compare_ts(s->over_next->pts, tb_over, s->main->pts, tb_main) < 0) {
-        av_frame_free(&s->over_prev);
-        FFSWAP(AVFrame*, s->over_prev, s->over_next);
-
-        ret = ff_request_frame(ctx->inputs[OVERLAY]);
-        if (ret == AVERROR_EOF)
-            return handle_overlay_eof(ctx);
-        else if (ret < 0)
-            return ret;
-    }
-
-    if (s->main->pts == AV_NOPTS_VALUE ||
-        s->over_next->pts == AV_NOPTS_VALUE ||
-        !av_compare_ts(s->over_next->pts, tb_over, s->main->pts, tb_main)) {
-        blend_frame(ctx, s->main, s->over_next, s->x, s->y);
-        av_frame_free(&s->over_prev);
-        FFSWAP(AVFrame*, s->over_prev, s->over_next);
-    } else if (s->over_prev) {
-        blend_frame(ctx, s->main, s->over_prev, s->x, s->y);
-    }
-
-    return output_frame(ctx);
-}
-
-#define OFFSET(x) offsetof(OverlayContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "x", "Horizontal position of the left edge of the overlaid video on the "
-        "main video.",          OFFSET(x_expr), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
-    { "y", "Vertical position of the top edge of the overlaid video on the "
-        "main video.",          OFFSET(y_expr), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
-    { "eof_action", "Action to take when encountering EOF from secondary input ",
-        OFFSET(eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
-        EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
-        { "repeat", "Repeat the previous frame.",   0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, "eof_action" },
-        { "endall", "End both streams.",            0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, "eof_action" },
-        { "pass",   "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS },   .flags = FLAGS, "eof_action" },
-    { NULL },
-};
-
-static const AVClass overlay_class = {
-    .class_name = "overlay",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_overlay_inputs[] = {
-    {
-        .name         = "main",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_input_main,
-        .filter_frame = filter_frame_main,
-        .needs_writable = 1,
-        .needs_fifo   = 1,
-    },
-    {
-        .name         = "overlay",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_input_overlay,
-        .filter_frame = filter_frame_overlay,
-        .needs_fifo   = 1,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_overlay_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .config_props  = config_output,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_overlay = {
-    .name      = "overlay",
-    .description = NULL_IF_CONFIG_SMALL("Overlay a video source on top of the input."),
-
-    .uninit    = uninit,
-
-    .priv_size = sizeof(OverlayContext),
-    .priv_class = &overlay_class,
-
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_overlay_inputs,
-    .outputs   = avfilter_vf_overlay_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_pad.c b/deps/libav/libavfilter/vf_pad.c
deleted file mode 100644
index 0609767..0000000
--- a/deps/libav/libavfilter/vf_pad.c
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- * Copyright (c) 2008 vmrsss
- * Copyright (c) 2009 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * video padding filter
- */
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "libavutil/avstring.h"
-#include "libavutil/common.h"
-#include "libavutil/eval.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/colorspace.h"
-#include "libavutil/avassert.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-
-#include "drawutils.h"
-
-static const char *const var_names[] = {
-    "PI",
-    "PHI",
-    "E",
-    "in_w",   "iw",
-    "in_h",   "ih",
-    "out_w",  "ow",
-    "out_h",  "oh",
-    "x",
-    "y",
-    "a",
-    "hsub",
-    "vsub",
-    NULL
-};
-
-enum var_name {
-    VAR_PI,
-    VAR_PHI,
-    VAR_E,
-    VAR_IN_W,   VAR_IW,
-    VAR_IN_H,   VAR_IH,
-    VAR_OUT_W,  VAR_OW,
-    VAR_OUT_H,  VAR_OH,
-    VAR_X,
-    VAR_Y,
-    VAR_A,
-    VAR_HSUB,
-    VAR_VSUB,
-    VARS_NB
-};
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_ARGB,         AV_PIX_FMT_RGBA,
-        AV_PIX_FMT_ABGR,         AV_PIX_FMT_BGRA,
-        AV_PIX_FMT_RGB24,        AV_PIX_FMT_BGR24,
-
-        AV_PIX_FMT_YUV444P,      AV_PIX_FMT_YUV422P,
-        AV_PIX_FMT_YUV420P,      AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_YUV410P,      AV_PIX_FMT_YUV440P,
-        AV_PIX_FMT_YUVJ444P,     AV_PIX_FMT_YUVJ422P,
-        AV_PIX_FMT_YUVJ420P,     AV_PIX_FMT_YUVJ440P,
-        AV_PIX_FMT_YUVA420P,
-
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-typedef struct {
-    const AVClass *class;
-    int w, h;               ///< output dimensions, a value of 0 will result in the input size
-    int x, y;               ///< offsets of the input area with respect to the padded area
-    int in_w, in_h;         ///< width and height for the padded input video, which has to be aligned to the chroma values in order to avoid chroma issues
-
-    char *w_expr;           ///< width  expression string
-    char *h_expr;           ///< height expression string
-    char *x_expr;           ///< width  expression string
-    char *y_expr;           ///< height expression string
-    char *color_str;
-
-    uint8_t color[4];       ///< color expressed either in YUVA or RGBA colorspace for the padding area
-    uint8_t *line[4];
-    int      line_step[4];
-    int hsub, vsub;         ///< chroma subsampling values
-} PadContext;
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    PadContext *s = ctx->priv;
-
-    if (av_parse_color(s->color, s->color_str, -1, ctx) < 0)
-        return AVERROR(EINVAL);
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    PadContext *s = ctx->priv;
-    int i;
-
-    for (i = 0; i < 4; i++) {
-        av_freep(&s->line[i]);
-        s->line_step[i] = 0;
-    }
-}
-
-static int config_input(AVFilterLink *inlink)
-{
-    AVFilterContext *ctx = inlink->dst;
-    PadContext *s = ctx->priv;
-    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
-    uint8_t rgba_color[4];
-    int ret, is_packed_rgba;
-    double var_values[VARS_NB], res;
-    char *expr;
-
-    s->hsub = pix_desc->log2_chroma_w;
-    s->vsub = pix_desc->log2_chroma_h;
-
-    var_values[VAR_PI]    = M_PI;
-    var_values[VAR_PHI]   = M_PHI;
-    var_values[VAR_E]     = M_E;
-    var_values[VAR_IN_W]  = var_values[VAR_IW] = inlink->w;
-    var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;
-    var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
-    var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
-    var_values[VAR_A]     = (double) inlink->w / inlink->h;
-    var_values[VAR_HSUB]  = 1<<s->hsub;
-    var_values[VAR_VSUB]  = 1<<s->vsub;
-
-    /* evaluate width and height */
-    av_expr_parse_and_eval(&res, (expr = s->w_expr),
-                           var_names, var_values,
-                           NULL, NULL, NULL, NULL, NULL, 0, ctx);
-    s->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->h_expr),
-                                      var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto eval_fail;
-    s->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
-    /* evaluate the width again, as it may depend on the evaluated output height */
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr),
-                                      var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto eval_fail;
-    s->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
-
-    /* evaluate x and y */
-    av_expr_parse_and_eval(&res, (expr = s->x_expr),
-                           var_names, var_values,
-                           NULL, NULL, NULL, NULL, NULL, 0, ctx);
-    s->x = var_values[VAR_X] = res;
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->y_expr),
-                                      var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto eval_fail;
-    s->y = var_values[VAR_Y] = res;
-    /* evaluate x again, as it may depend on the evaluated y value */
-    if ((ret = av_expr_parse_and_eval(&res, (expr = s->x_expr),
-                                      var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto eval_fail;
-    s->x = var_values[VAR_X] = res;
-
-    /* sanity check params */
-    if (s->w < 0 || s->h < 0 || s->x < 0 || s->y < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Negative values are not acceptable.\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (!s->w)
-        s->w = inlink->w;
-    if (!s->h)
-        s->h = inlink->h;
-
-    s->w &= ~((1 << s->hsub) - 1);
-    s->h &= ~((1 << s->vsub) - 1);
-    s->x &= ~((1 << s->hsub) - 1);
-    s->y &= ~((1 << s->vsub) - 1);
-
-    s->in_w = inlink->w & ~((1 << s->hsub) - 1);
-    s->in_h = inlink->h & ~((1 << s->vsub) - 1);
-
-    memcpy(rgba_color, s->color, sizeof(rgba_color));
-    ff_fill_line_with_color(s->line, s->line_step, s->w, s->color,
-                            inlink->format, rgba_color, &is_packed_rgba, NULL);
-
-    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d -> w:%d h:%d x:%d y:%d color:0x%02X%02X%02X%02X[%s]\n",
-           inlink->w, inlink->h, s->w, s->h, s->x, s->y,
-           s->color[0], s->color[1], s->color[2], s->color[3],
-           is_packed_rgba ? "rgba" : "yuva");
-
-    if (s->x <  0 || s->y <  0                      ||
-        s->w <= 0 || s->h <= 0                      ||
-        (unsigned)s->x + (unsigned)inlink->w > s->w ||
-        (unsigned)s->y + (unsigned)inlink->h > s->h) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Input area %d:%d:%d:%d not within the padded area 0:0:%d:%d or zero-sized\n",
-               s->x, s->y, s->x + inlink->w, s->y + inlink->h, s->w, s->h);
-        return AVERROR(EINVAL);
-    }
-
-    return 0;
-
-eval_fail:
-    av_log(NULL, AV_LOG_ERROR,
-           "Error when evaluating the expression '%s'\n", expr);
-    return ret;
-
-}
-
-static int config_output(AVFilterLink *outlink)
-{
-    PadContext *s = outlink->src->priv;
-
-    outlink->w = s->w;
-    outlink->h = s->h;
-    return 0;
-}
-
-static AVFrame *get_video_buffer(AVFilterLink *inlink, int w, int h)
-{
-    PadContext *s = inlink->dst->priv;
-
-    AVFrame *frame = ff_get_video_buffer(inlink->dst->outputs[0],
-                                         w + (s->w - s->in_w),
-                                         h + (s->h - s->in_h));
-    int plane;
-
-    if (!frame)
-        return NULL;
-
-    frame->width  = w;
-    frame->height = h;
-
-    for (plane = 0; plane < 4 && frame->data[plane]; plane++) {
-        int hsub = (plane == 1 || plane == 2) ? s->hsub : 0;
-        int vsub = (plane == 1 || plane == 2) ? s->vsub : 0;
-
-        frame->data[plane] += (s->x >> hsub) * s->line_step[plane] +
-            (s->y >> vsub) * frame->linesize[plane];
-    }
-
-    return frame;
-}
-
-/* check whether each plane in this buffer can be padded without copying */
-static int buffer_needs_copy(PadContext *s, AVFrame *frame, AVBufferRef *buf)
-{
-    int planes[4] = { -1, -1, -1, -1}, *p = planes;
-    int i, j;
-
-    /* get all planes in this buffer */
-    for (i = 0; i < FF_ARRAY_ELEMS(planes) && frame->data[i]; i++) {
-        if (av_frame_get_plane_buffer(frame, i) == buf)
-            *p++ = i;
-    }
-
-    /* for each plane in this buffer, check that it can be padded without
-     * going over buffer bounds or other planes */
-    for (i = 0; i < FF_ARRAY_ELEMS(planes) && planes[i] >= 0; i++) {
-        int hsub = (planes[i] == 1 || planes[i] == 2) ? s->hsub : 0;
-        int vsub = (planes[i] == 1 || planes[i] == 2) ? s->vsub : 0;
-
-        uint8_t *start = frame->data[planes[i]];
-        uint8_t *end   = start + (frame->height >> hsub) *
-                                 frame->linesize[planes[i]];
-
-        /* amount of free space needed before the start and after the end
-         * of the plane */
-        ptrdiff_t req_start = (s->x >> hsub) * s->line_step[planes[i]] +
-                              (s->y >> vsub) * frame->linesize[planes[i]];
-        ptrdiff_t req_end   = ((s->w - s->x - frame->width) >> hsub) *
-                              s->line_step[planes[i]] +
-                              (s->y >> vsub) * frame->linesize[planes[i]];
-
-        if (frame->linesize[planes[i]] < (s->w >> hsub) * s->line_step[planes[i]])
-            return 1;
-        if (start - buf->data < req_start ||
-            (buf->data + buf->size) - end < req_end)
-            return 1;
-
-#define SIGN(x) ((x) > 0 ? 1 : -1)
-        for (j = 0; j < FF_ARRAY_ELEMS(planes) && planes[j] >= 0; j++) {
-            int hsub1 = (planes[j] == 1 || planes[j] == 2) ? s->hsub : 0;
-            uint8_t *start1 = frame->data[planes[j]];
-            uint8_t *end1   = start1 + (frame->height >> hsub1) *
-                                       frame->linesize[planes[j]];
-            if (i == j)
-                continue;
-
-            if (SIGN(start - end1) != SIGN(start - end1 - req_start) ||
-                SIGN(end - start1) != SIGN(end - start1 + req_end))
-                return 1;
-        }
-    }
-
-    return 0;
-}
-
-static int frame_needs_copy(PadContext *s, AVFrame *frame)
-{
-    int i;
-
-    if (!av_frame_is_writable(frame))
-        return 1;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(frame->buf) && frame->buf[i]; i++)
-        if (buffer_needs_copy(s, frame, frame->buf[i]))
-            return 1;
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    PadContext *s = inlink->dst->priv;
-    AVFrame *out;
-    int needs_copy = frame_needs_copy(s, in);
-
-    if (needs_copy) {
-        av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n");
-        out = ff_get_video_buffer(inlink->dst->outputs[0],
-                                  FFMAX(inlink->w, s->w),
-                                  FFMAX(inlink->h, s->h));
-        if (!out) {
-            av_frame_free(&in);
-            return AVERROR(ENOMEM);
-        }
-
-        av_frame_copy_props(out, in);
-    } else {
-        int i;
-
-        out = in;
-        for (i = 0; i < FF_ARRAY_ELEMS(out->data) && out->data[i]; i++) {
-            int hsub = (i == 1 || i == 2) ? s->hsub : 0;
-            int vsub = (i == 1 || i == 2) ? s->vsub : 0;
-            out->data[i] -= (s->x >> hsub) * s->line_step[i] +
-                            (s->y >> vsub) * out->linesize[i];
-        }
-    }
-
-    /* top bar */
-    if (s->y) {
-        ff_draw_rectangle(out->data, out->linesize,
-                          s->line, s->line_step, s->hsub, s->vsub,
-                          0, 0, s->w, s->y);
-    }
-
-    /* bottom bar */
-    if (s->h > s->y + s->in_h) {
-        ff_draw_rectangle(out->data, out->linesize,
-                          s->line, s->line_step, s->hsub, s->vsub,
-                          0, s->y + s->in_h, s->w, s->h - s->y - s->in_h);
-    }
-
-    /* left border */
-    ff_draw_rectangle(out->data, out->linesize, s->line, s->line_step,
-                      s->hsub, s->vsub, 0, s->y, s->x, in->height);
-
-    if (needs_copy) {
-        ff_copy_rectangle(out->data, out->linesize, in->data, in->linesize,
-                          s->line_step, s->hsub, s->vsub,
-                          s->x, s->y, 0, in->width, in->height);
-    }
-
-    /* right border */
-    ff_draw_rectangle(out->data, out->linesize,
-                      s->line, s->line_step, s->hsub, s->vsub,
-                      s->x + s->in_w, s->y, s->w - s->x - s->in_w,
-                      in->height);
-
-    out->width  = s->w;
-    out->height = s->h;
-
-    if (in != out)
-        av_frame_free(&in);
-    return ff_filter_frame(inlink->dst->outputs[0], out);
-}
-
-#define OFFSET(x) offsetof(PadContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "width",  "Output video width",       OFFSET(w_expr),    AV_OPT_TYPE_STRING, { .str = "iw" },    .flags = FLAGS },
-    { "height", "Output video height",      OFFSET(h_expr),    AV_OPT_TYPE_STRING, { .str = "ih" },    .flags = FLAGS },
-    { "x",      "Horizontal position of the left edge of the input video in the "
-        "output video",                     OFFSET(x_expr),    AV_OPT_TYPE_STRING, { .str = "0"  },    .flags = FLAGS },
-    { "y",      "Vertical position of the top edge of the input video in the "
-        "output video",                     OFFSET(y_expr),    AV_OPT_TYPE_STRING, { .str = "0"  },    .flags = FLAGS },
-    { "color",  "Color of the padded area", OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass pad_class = {
-    .class_name = "pad",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_pad_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .config_props     = config_input,
-        .get_video_buffer = get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_pad_outputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_output,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_pad = {
-    .name          = "pad",
-    .description   = NULL_IF_CONFIG_SMALL("Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black)."),
-
-    .priv_size     = sizeof(PadContext),
-    .priv_class    = &pad_class,
-    .init          = init,
-    .uninit        = uninit,
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_pad_inputs,
-
-    .outputs   = avfilter_vf_pad_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_pixdesctest.c b/deps/libav/libavfilter/vf_pixdesctest.c
deleted file mode 100644
index 5c6b625..0000000
--- a/deps/libav/libavfilter/vf_pixdesctest.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2009 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * pixdesc test filter
- */
-
-#include "libavutil/common.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    const AVPixFmtDescriptor *pix_desc;
-    uint16_t *line;
-} PixdescTestContext;
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    PixdescTestContext *priv = ctx->priv;
-    av_freep(&priv->line);
-}
-
-static int config_props(AVFilterLink *inlink)
-{
-    PixdescTestContext *priv = inlink->dst->priv;
-
-    priv->pix_desc = av_pix_fmt_desc_get(inlink->format);
-
-    av_freep(&priv->line);
-    if (!(priv->line = av_malloc(sizeof(*priv->line) * inlink->w)))
-        return AVERROR(ENOMEM);
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    PixdescTestContext *priv = inlink->dst->priv;
-    AVFilterLink *outlink    = inlink->dst->outputs[0];
-    AVFrame *out;
-    int i, c, w = inlink->w, h = inlink->h;
-
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-
-    av_frame_copy_props(out, in);
-
-    for (i = 0; i < 4; i++) {
-        int h = outlink->h;
-        h = i == 1 || i == 2 ? h>>priv->pix_desc->log2_chroma_h : h;
-        if (out->data[i]) {
-            uint8_t *data = out->data[i] +
-                (out->linesize[i] > 0 ? 0 : out->linesize[i] * (h-1));
-            memset(data, 0, FFABS(out->linesize[i]) * h);
-        }
-    }
-
-    /* copy palette */
-    if (priv->pix_desc->flags & AV_PIX_FMT_FLAG_PAL ||
-        priv->pix_desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)
-        memcpy(out->data[1], in->data[1], 256*4);
-
-    for (c = 0; c < priv->pix_desc->nb_components; c++) {
-        int w1 = c == 1 || c == 2 ? w>>priv->pix_desc->log2_chroma_w : w;
-        int h1 = c == 1 || c == 2 ? h>>priv->pix_desc->log2_chroma_h : h;
-
-        for (i = 0; i < h1; i++) {
-            av_read_image_line(priv->line,
-                               in->data,
-                               in->linesize,
-                               priv->pix_desc,
-                               0, i, c, w1, 0);
-
-            av_write_image_line(priv->line,
-                                out->data,
-                                out->linesize,
-                                priv->pix_desc,
-                                0, i, c, w1);
-        }
-    }
-
-    av_frame_free(&in);
-    return ff_filter_frame(outlink, out);
-}
-
-static const AVFilterPad avfilter_vf_pixdesctest_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-        .config_props = config_props,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_pixdesctest_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_pixdesctest = {
-    .name        = "pixdesctest",
-    .description = NULL_IF_CONFIG_SMALL("Test pixel format definitions."),
-
-    .priv_size = sizeof(PixdescTestContext),
-    .uninit    = uninit,
-
-    .inputs    = avfilter_vf_pixdesctest_inputs,
-
-    .outputs   = avfilter_vf_pixdesctest_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_scale.c b/deps/libav/libavfilter/vf_scale.c
deleted file mode 100644
index c47c6f3..0000000
--- a/deps/libav/libavfilter/vf_scale.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * scale video filter
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "libavutil/avstring.h"
-#include "libavutil/eval.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libswscale/swscale.h"
-
-static const char *const var_names[] = {
-    "PI",
-    "PHI",
-    "E",
-    "in_w",   "iw",
-    "in_h",   "ih",
-    "out_w",  "ow",
-    "out_h",  "oh",
-    "a", "dar",
-    "sar",
-    "hsub",
-    "vsub",
-    NULL
-};
-
-enum var_name {
-    VAR_PI,
-    VAR_PHI,
-    VAR_E,
-    VAR_IN_W,   VAR_IW,
-    VAR_IN_H,   VAR_IH,
-    VAR_OUT_W,  VAR_OW,
-    VAR_OUT_H,  VAR_OH,
-    VAR_A, VAR_DAR,
-    VAR_SAR,
-    VAR_HSUB,
-    VAR_VSUB,
-    VARS_NB
-};
-
-typedef struct {
-    const AVClass *class;
-    struct SwsContext *sws;     ///< software scaler context
-
-    /**
-     * New dimensions. Special values are:
-     *   0 = original width/height
-     *  -1 = keep original aspect
-     */
-    int w, h;
-    unsigned int flags;         ///sws flags
-
-    int hsub, vsub;             ///< chroma subsampling
-    int slice_y;                ///< top of current output slice
-    int input_is_pal;           ///< set to 1 if the input format is paletted
-
-    char *w_expr;               ///< width  expression string
-    char *h_expr;               ///< height expression string
-    char *flags_str;
-} ScaleContext;
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    ScaleContext *scale = ctx->priv;
-
-    if (scale->flags_str) {
-        const AVClass *class = sws_get_class();
-        const AVOption    *o = av_opt_find(&class, "sws_flags", NULL, 0,
-                                           AV_OPT_SEARCH_FAKE_OBJ);
-        int ret = av_opt_eval_flags(&class, o, scale->flags_str, &scale->flags);
-
-        if (ret < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    ScaleContext *scale = ctx->priv;
-    sws_freeContext(scale->sws);
-    scale->sws = NULL;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    AVFilterFormats *formats;
-    enum AVPixelFormat pix_fmt;
-    int ret;
-
-    if (ctx->inputs[0]) {
-        formats = NULL;
-        for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
-            if ((sws_isSupportedInput(pix_fmt) ||
-                 sws_isSupportedEndiannessConversion(pix_fmt))
-                && (ret = ff_add_format(&formats, pix_fmt)) < 0) {
-                ff_formats_unref(&formats);
-                return ret;
-            }
-        ff_formats_ref(formats, &ctx->inputs[0]->out_formats);
-    }
-    if (ctx->outputs[0]) {
-        formats = NULL;
-        for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
-            if ((sws_isSupportedOutput(pix_fmt) ||
-                 sws_isSupportedEndiannessConversion(pix_fmt))
-                && (ret = ff_add_format(&formats, pix_fmt)) < 0) {
-                ff_formats_unref(&formats);
-                return ret;
-            }
-        ff_formats_ref(formats, &ctx->outputs[0]->in_formats);
-    }
-
-    return 0;
-}
-
-static int config_props(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    AVFilterLink *inlink = outlink->src->inputs[0];
-    ScaleContext *scale = ctx->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    int64_t w, h;
-    double var_values[VARS_NB], res;
-    char *expr;
-    int ret;
-
-    var_values[VAR_PI]    = M_PI;
-    var_values[VAR_PHI]   = M_PHI;
-    var_values[VAR_E]     = M_E;
-    var_values[VAR_IN_W]  = var_values[VAR_IW] = inlink->w;
-    var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;
-    var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
-    var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
-    var_values[VAR_A]     = (double) inlink->w / inlink->h;
-    var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
-        (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
-    var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];
-    var_values[VAR_HSUB]  = 1 << desc->log2_chroma_w;
-    var_values[VAR_VSUB]  = 1 << desc->log2_chroma_h;
-
-    /* evaluate width and height */
-    av_expr_parse_and_eval(&res, (expr = scale->w_expr),
-                           var_names, var_values,
-                           NULL, NULL, NULL, NULL, NULL, 0, ctx);
-    scale->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
-    if ((ret = av_expr_parse_and_eval(&res, (expr = scale->h_expr),
-                                      var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto fail;
-    scale->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
-    /* evaluate again the width, as it may depend on the output height */
-    if ((ret = av_expr_parse_and_eval(&res, (expr = scale->w_expr),
-                                      var_names, var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
-        goto fail;
-    scale->w = res;
-
-    w = scale->w;
-    h = scale->h;
-
-    /* sanity check params */
-    if (w <  -1 || h <  -1) {
-        av_log(ctx, AV_LOG_ERROR, "Size values less than -1 are not acceptable.\n");
-        return AVERROR(EINVAL);
-    }
-    if (w == -1 && h == -1)
-        scale->w = scale->h = 0;
-
-    if (!(w = scale->w))
-        w = inlink->w;
-    if (!(h = scale->h))
-        h = inlink->h;
-    if (w == -1)
-        w = av_rescale(h, inlink->w, inlink->h);
-    if (h == -1)
-        h = av_rescale(w, inlink->h, inlink->w);
-
-    if (w > INT_MAX || h > INT_MAX ||
-        (h * inlink->w) > INT_MAX  ||
-        (w * inlink->h) > INT_MAX)
-        av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too big.\n");
-
-    outlink->w = w;
-    outlink->h = h;
-
-    /* TODO: make algorithm configurable */
-    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d fmt:%s -> w:%d h:%d fmt:%s flags:0x%0x\n",
-           inlink ->w, inlink ->h, av_get_pix_fmt_name(inlink->format),
-           outlink->w, outlink->h, av_get_pix_fmt_name(outlink->format),
-           scale->flags);
-
-    scale->input_is_pal = desc->flags & AV_PIX_FMT_FLAG_PAL ||
-                          desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL;
-
-    if (scale->sws)
-        sws_freeContext(scale->sws);
-    if (inlink->w == outlink->w && inlink->h == outlink->h &&
-        inlink->format == outlink->format)
-        scale->sws = NULL;
-    else {
-        scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format,
-                                    outlink->w, outlink->h, outlink->format,
-                                    scale->flags, NULL, NULL, NULL);
-        if (!scale->sws)
-            return AVERROR(EINVAL);
-    }
-
-
-    if (inlink->sample_aspect_ratio.num)
-        outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h*inlink->w,
-                                                             outlink->w*inlink->h},
-                                                inlink->sample_aspect_ratio);
-    else
-        outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
-
-    return 0;
-
-fail:
-    av_log(NULL, AV_LOG_ERROR,
-           "Error when evaluating the expression '%s'\n", expr);
-    return ret;
-}
-
-static int filter_frame(AVFilterLink *link, AVFrame *in)
-{
-    ScaleContext *scale = link->dst->priv;
-    AVFilterLink *outlink = link->dst->outputs[0];
-    AVFrame *out;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
-
-    if (!scale->sws)
-        return ff_filter_frame(outlink, in);
-
-    scale->hsub = desc->log2_chroma_w;
-    scale->vsub = desc->log2_chroma_h;
-
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-
-    av_frame_copy_props(out, in);
-    out->width  = outlink->w;
-    out->height = outlink->h;
-
-    av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,
-              (int64_t)in->sample_aspect_ratio.num * outlink->h * link->w,
-              (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h,
-              INT_MAX);
-
-    sws_scale(scale->sws, in->data, in->linesize, 0, in->height,
-              out->data, out->linesize);
-
-    av_frame_free(&in);
-    return ff_filter_frame(outlink, out);
-}
-
-#define OFFSET(x) offsetof(ScaleContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "w",     "Output video width",          OFFSET(w_expr),    AV_OPT_TYPE_STRING, { .str = "iw" },       .flags = FLAGS },
-    { "h",     "Output video height",         OFFSET(h_expr),    AV_OPT_TYPE_STRING, { .str = "ih" },       .flags = FLAGS },
-    { "flags", "Flags to pass to libswscale", OFFSET(flags_str), AV_OPT_TYPE_STRING, { .str = "bilinear" }, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass scale_class = {
-    .class_name = "scale",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_scale_inputs[] = {
-    {
-        .name        = "default",
-        .type        = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_scale_outputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_props,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_scale = {
-    .name      = "scale",
-    .description = NULL_IF_CONFIG_SMALL("Scale the input video to width:height size and/or convert the image format."),
-
-    .init      = init,
-    .uninit    = uninit,
-
-    .query_formats = query_formats,
-
-    .priv_size = sizeof(ScaleContext),
-    .priv_class = &scale_class,
-
-    .inputs    = avfilter_vf_scale_inputs,
-    .outputs   = avfilter_vf_scale_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_select.c b/deps/libav/libavfilter/vf_select.c
deleted file mode 100644
index fc69c89..0000000
--- a/deps/libav/libavfilter/vf_select.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Copyright (c) 2011 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * filter for selecting which frame passes in the filterchain
- */
-
-#include "libavutil/eval.h"
-#include "libavutil/fifo.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-static const char *const var_names[] = {
-    "E",                 ///< Euler number
-    "PHI",               ///< golden ratio
-    "PI",                ///< greek pi
-
-    "TB",                ///< timebase
-
-    "pts",               ///< original pts in the file of the frame
-    "start_pts",         ///< first PTS in the stream, expressed in TB units
-    "prev_pts",          ///< previous frame PTS
-    "prev_selected_pts", ///< previous selected frame PTS
-
-    "t",                 ///< first PTS in seconds
-    "start_t",           ///< first PTS in the stream, expressed in seconds
-    "prev_t",            ///< previous frame time
-    "prev_selected_t",   ///< previously selected time
-
-    "pict_type",         ///< the type of picture in the movie
-    "I",
-    "P",
-    "B",
-    "S",
-    "SI",
-    "SP",
-    "BI",
-
-    "interlace_type",    ///< the frame interlace type
-    "PROGRESSIVE",
-    "TOPFIRST",
-    "BOTTOMFIRST",
-
-    "n",                 ///< frame number (starting from zero)
-    "selected_n",        ///< selected frame number (starting from zero)
-    "prev_selected_n",   ///< number of the last selected frame
-
-    "key",               ///< tell if the frame is a key frame
-    "pos",               ///< original position in the file of the frame
-
-    NULL
-};
-
-enum var_name {
-    VAR_E,
-    VAR_PHI,
-    VAR_PI,
-
-    VAR_TB,
-
-    VAR_PTS,
-    VAR_START_PTS,
-    VAR_PREV_PTS,
-    VAR_PREV_SELECTED_PTS,
-
-    VAR_T,
-    VAR_START_T,
-    VAR_PREV_T,
-    VAR_PREV_SELECTED_T,
-
-    VAR_PICT_TYPE,
-    VAR_PICT_TYPE_I,
-    VAR_PICT_TYPE_P,
-    VAR_PICT_TYPE_B,
-    VAR_PICT_TYPE_S,
-    VAR_PICT_TYPE_SI,
-    VAR_PICT_TYPE_SP,
-    VAR_PICT_TYPE_BI,
-
-    VAR_INTERLACE_TYPE,
-    VAR_INTERLACE_TYPE_P,
-    VAR_INTERLACE_TYPE_T,
-    VAR_INTERLACE_TYPE_B,
-
-    VAR_N,
-    VAR_SELECTED_N,
-    VAR_PREV_SELECTED_N,
-
-    VAR_KEY,
-
-    VAR_VARS_NB
-};
-
-#define FIFO_SIZE 8
-
-typedef struct {
-    const AVClass *class;
-    char *expr_str;
-    AVExpr *expr;
-    double var_values[VAR_VARS_NB];
-    double select;
-    int cache_frames;
-    AVFifoBuffer *pending_frames; ///< FIFO buffer of video frames
-} SelectContext;
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    SelectContext *select = ctx->priv;
-    int ret;
-
-    if ((ret = av_expr_parse(&select->expr, select->expr_str,
-                             var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Error while parsing expression '%s'\n",
-               select->expr_str);
-        return ret;
-    }
-
-    select->pending_frames = av_fifo_alloc(FIFO_SIZE*sizeof(AVFrame*));
-    if (!select->pending_frames) {
-        av_log(ctx, AV_LOG_ERROR, "Failed to allocate pending frames buffer.\n");
-        return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-#define INTERLACE_TYPE_P 0
-#define INTERLACE_TYPE_T 1
-#define INTERLACE_TYPE_B 2
-
-static int config_input(AVFilterLink *inlink)
-{
-    SelectContext *select = inlink->dst->priv;
-
-    select->var_values[VAR_E]   = M_E;
-    select->var_values[VAR_PHI] = M_PHI;
-    select->var_values[VAR_PI]  = M_PI;
-
-    select->var_values[VAR_N]          = 0.0;
-    select->var_values[VAR_SELECTED_N] = 0.0;
-
-    select->var_values[VAR_TB] = av_q2d(inlink->time_base);
-
-    select->var_values[VAR_PREV_PTS]          = NAN;
-    select->var_values[VAR_PREV_SELECTED_PTS] = NAN;
-    select->var_values[VAR_PREV_SELECTED_T]   = NAN;
-    select->var_values[VAR_START_PTS]         = NAN;
-    select->var_values[VAR_START_T]           = NAN;
-
-    select->var_values[VAR_PICT_TYPE_I]  = AV_PICTURE_TYPE_I;
-    select->var_values[VAR_PICT_TYPE_P]  = AV_PICTURE_TYPE_P;
-    select->var_values[VAR_PICT_TYPE_B]  = AV_PICTURE_TYPE_B;
-    select->var_values[VAR_PICT_TYPE_SI] = AV_PICTURE_TYPE_SI;
-    select->var_values[VAR_PICT_TYPE_SP] = AV_PICTURE_TYPE_SP;
-
-    select->var_values[VAR_INTERLACE_TYPE_P] = INTERLACE_TYPE_P;
-    select->var_values[VAR_INTERLACE_TYPE_T] = INTERLACE_TYPE_T;
-    select->var_values[VAR_INTERLACE_TYPE_B] = INTERLACE_TYPE_B;;
-
-    return 0;
-}
-
-#define D2TS(d)  (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
-#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
-
-static int select_frame(AVFilterContext *ctx, AVFrame *frame)
-{
-    SelectContext *select = ctx->priv;
-    AVFilterLink *inlink = ctx->inputs[0];
-    double res;
-
-    if (isnan(select->var_values[VAR_START_PTS]))
-        select->var_values[VAR_START_PTS] = TS2D(frame->pts);
-    if (isnan(select->var_values[VAR_START_T]))
-        select->var_values[VAR_START_T] = TS2D(frame->pts) * av_q2d(inlink->time_base);
-
-    select->var_values[VAR_PTS] = TS2D(frame->pts);
-    select->var_values[VAR_T  ] = TS2D(frame->pts) * av_q2d(inlink->time_base);
-    select->var_values[VAR_PREV_PTS] = TS2D(frame->pts);
-
-    select->var_values[VAR_INTERLACE_TYPE] =
-        !frame->interlaced_frame     ? INTERLACE_TYPE_P :
-        frame->top_field_first ? INTERLACE_TYPE_T : INTERLACE_TYPE_B;
-    select->var_values[VAR_PICT_TYPE] = frame->pict_type;
-
-    res = av_expr_eval(select->expr, select->var_values, NULL);
-    av_log(inlink->dst, AV_LOG_DEBUG,
-           "n:%d pts:%d t:%f interlace_type:%c key:%d pict_type:%c "
-           "-> select:%f\n",
-           (int)select->var_values[VAR_N],
-           (int)select->var_values[VAR_PTS],
-           select->var_values[VAR_T],
-           select->var_values[VAR_INTERLACE_TYPE] == INTERLACE_TYPE_P ? 'P' :
-           select->var_values[VAR_INTERLACE_TYPE] == INTERLACE_TYPE_T ? 'T' :
-           select->var_values[VAR_INTERLACE_TYPE] == INTERLACE_TYPE_B ? 'B' : '?',
-           (int)select->var_values[VAR_KEY],
-           av_get_picture_type_char(select->var_values[VAR_PICT_TYPE]),
-           res);
-
-    select->var_values[VAR_N] += 1.0;
-
-    if (res) {
-        select->var_values[VAR_PREV_SELECTED_N]   = select->var_values[VAR_N];
-        select->var_values[VAR_PREV_SELECTED_PTS] = select->var_values[VAR_PTS];
-        select->var_values[VAR_PREV_SELECTED_T]   = select->var_values[VAR_T];
-        select->var_values[VAR_SELECTED_N] += 1.0;
-    }
-    return res;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    SelectContext *select = inlink->dst->priv;
-
-    select->select = select_frame(inlink->dst, frame);
-    if (select->select) {
-        /* frame was requested through poll_frame */
-        if (select->cache_frames) {
-            if (!av_fifo_space(select->pending_frames)) {
-                av_log(inlink->dst, AV_LOG_ERROR,
-                       "Buffering limit reached, cannot cache more frames\n");
-                av_frame_free(&frame);
-            } else
-                av_fifo_generic_write(select->pending_frames, &frame,
-                                      sizeof(frame), NULL);
-            return 0;
-        }
-        return ff_filter_frame(inlink->dst->outputs[0], frame);
-    }
-
-    av_frame_free(&frame);
-    return 0;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    SelectContext *select = ctx->priv;
-    AVFilterLink *inlink = outlink->src->inputs[0];
-    select->select = 0;
-
-    if (av_fifo_size(select->pending_frames)) {
-        AVFrame *frame;
-
-        av_fifo_generic_read(select->pending_frames, &frame, sizeof(frame), NULL);
-        return ff_filter_frame(outlink, frame);
-    }
-
-    while (!select->select) {
-        int ret = ff_request_frame(inlink);
-        if (ret < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-static int poll_frame(AVFilterLink *outlink)
-{
-    SelectContext *select = outlink->src->priv;
-    AVFilterLink *inlink = outlink->src->inputs[0];
-    int count, ret;
-
-    if (!av_fifo_size(select->pending_frames)) {
-        if ((count = ff_poll_frame(inlink)) <= 0)
-            return count;
-        /* request frame from input, and apply select condition to it */
-        select->cache_frames = 1;
-        while (count-- && av_fifo_space(select->pending_frames)) {
-            ret = ff_request_frame(inlink);
-            if (ret < 0)
-                break;
-        }
-        select->cache_frames = 0;
-    }
-
-    return av_fifo_size(select->pending_frames)/sizeof(AVFrame*);
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    SelectContext *select = ctx->priv;
-    AVFrame *frame;
-
-    av_expr_free(select->expr);
-    select->expr = NULL;
-
-    while (select->pending_frames &&
-           av_fifo_generic_read(select->pending_frames, &frame, sizeof(frame), NULL) == sizeof(frame))
-        av_frame_free(&frame);
-    av_fifo_free(select->pending_frames);
-    select->pending_frames = NULL;
-}
-
-#define OFFSET(x) offsetof(SelectContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "expr", "An expression to use for selecting frames", OFFSET(expr_str), AV_OPT_TYPE_STRING, { .str = "1" }, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass select_class = {
-    .class_name = "select",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_select_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .config_props     = config_input,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_select_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .poll_frame    = poll_frame,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_select = {
-    .name      = "select",
-    .description = NULL_IF_CONFIG_SMALL("Select frames to pass in output."),
-    .init      = init,
-    .uninit    = uninit,
-
-    .priv_size = sizeof(SelectContext),
-    .priv_class = &select_class,
-
-    .inputs    = avfilter_vf_select_inputs,
-    .outputs   = avfilter_vf_select_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_settb.c b/deps/libav/libavfilter/vf_settb.c
deleted file mode 100644
index 87b60a7..0000000
--- a/deps/libav/libavfilter/vf_settb.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2010 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Set timebase for the output link.
- */
-
-#include <inttypes.h>
-#include <stdio.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/eval.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/rational.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-static const char *const var_names[] = {
-    "E",
-    "PHI",
-    "PI",
-    "AVTB",   /* default timebase 1/AV_TIME_BASE */
-    "intb",   /* input timebase */
-    NULL
-};
-
-enum var_name {
-    VAR_E,
-    VAR_PHI,
-    VAR_PI,
-    VAR_AVTB,
-    VAR_INTB,
-    VAR_VARS_NB
-};
-
-typedef struct {
-    const AVClass *class;
-    char *tb_expr;
-    double var_values[VAR_VARS_NB];
-} SetTBContext;
-
-static int config_output_props(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    SetTBContext *settb = ctx->priv;
-    AVFilterLink *inlink = ctx->inputs[0];
-    AVRational time_base;
-    int ret;
-    double res;
-
-    settb->var_values[VAR_E]    = M_E;
-    settb->var_values[VAR_PHI]  = M_PHI;
-    settb->var_values[VAR_PI]   = M_PI;
-    settb->var_values[VAR_AVTB] = av_q2d(AV_TIME_BASE_Q);
-    settb->var_values[VAR_INTB] = av_q2d(inlink->time_base);
-
-    outlink->w = inlink->w;
-    outlink->h = inlink->h;
-
-    if ((ret = av_expr_parse_and_eval(&res, settb->tb_expr, var_names, settb->var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, NULL)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid expression '%s' for timebase.\n", settb->tb_expr);
-        return ret;
-    }
-    time_base = av_d2q(res, INT_MAX);
-    if (time_base.num <= 0 || time_base.den <= 0) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid non-positive values for the timebase num:%d or den:%d.\n",
-               time_base.num, time_base.den);
-        return AVERROR(EINVAL);
-    }
-
-    outlink->time_base = time_base;
-    av_log(outlink->src, AV_LOG_VERBOSE, "tb:%d/%d -> tb:%d/%d\n",
-           inlink ->time_base.num, inlink ->time_base.den,
-           outlink->time_base.num, outlink->time_base.den);
-
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    AVFilterLink *outlink = ctx->outputs[0];
-
-    if (av_cmp_q(inlink->time_base, outlink->time_base)) {
-        int64_t orig_pts = frame->pts;
-        frame->pts = av_rescale_q(frame->pts, inlink->time_base, outlink->time_base);
-        av_log(ctx, AV_LOG_DEBUG, "tb:%d/%d pts:%"PRId64" -> tb:%d/%d pts:%"PRId64"\n",
-               inlink ->time_base.num, inlink ->time_base.den, orig_pts,
-               outlink->time_base.num, outlink->time_base.den, frame->pts);
-    }
-
-    return ff_filter_frame(outlink, frame);
-}
-
-#define OFFSET(x) offsetof(SetTBContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "expr", "Expression determining the output timebase", OFFSET(tb_expr), AV_OPT_TYPE_STRING, { .str = "intb" }, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass settb_class = {
-    .class_name = "settb",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_settb_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_settb_outputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .config_props = config_output_props,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_settb = {
-    .name      = "settb",
-    .description = NULL_IF_CONFIG_SMALL("Set timebase for the output link."),
-
-    .priv_size = sizeof(SetTBContext),
-    .priv_class = &settb_class,
-
-    .inputs    = avfilter_vf_settb_inputs,
-
-    .outputs   = avfilter_vf_settb_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_showinfo.c b/deps/libav/libavfilter/vf_showinfo.c
deleted file mode 100644
index e89ffe0..0000000
--- a/deps/libav/libavfilter/vf_showinfo.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2011 Stefano Sabatini
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * filter for showing textual video frame information
- */
-
-#include "libavutil/adler32.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    unsigned int frame;
-} ShowInfoContext;
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
-    AVFilterContext *ctx = inlink->dst;
-    ShowInfoContext *showinfo = ctx->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    uint32_t plane_checksum[4] = {0}, checksum = 0;
-    int i, plane, vsub = desc->log2_chroma_h;
-
-    for (plane = 0; frame->data[plane] && plane < 4; plane++) {
-        size_t linesize = av_image_get_linesize(frame->format, frame->width, plane);
-        uint8_t *data = frame->data[plane];
-        int h = plane == 1 || plane == 2 ? inlink->h >> vsub : inlink->h;
-
-        for (i = 0; i < h; i++) {
-            plane_checksum[plane] = av_adler32_update(plane_checksum[plane], data, linesize);
-            checksum = av_adler32_update(checksum, data, linesize);
-            data += frame->linesize[plane];
-        }
-    }
-
-    av_log(ctx, AV_LOG_INFO,
-           "n:%d pts:%"PRId64" pts_time:%f "
-           "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c "
-           "checksum:%u plane_checksum:[%u %u %u %u]\n",
-           showinfo->frame,
-           frame->pts, frame->pts * av_q2d(inlink->time_base),
-           desc->name,
-           frame->sample_aspect_ratio.num, frame->sample_aspect_ratio.den,
-           frame->width, frame->height,
-           !frame->interlaced_frame ? 'P' :         /* Progressive  */
-           frame->top_field_first   ? 'T' : 'B',    /* Top / Bottom */
-           frame->key_frame,
-           av_get_picture_type_char(frame->pict_type),
-           checksum, plane_checksum[0], plane_checksum[1], plane_checksum[2], plane_checksum[3]);
-
-    showinfo->frame++;
-    return ff_filter_frame(inlink->dst->outputs[0], frame);
-}
-
-static const AVFilterPad avfilter_vf_showinfo_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = ff_null_get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_showinfo_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_showinfo = {
-    .name        = "showinfo",
-    .description = NULL_IF_CONFIG_SMALL("Show textual information for each video frame."),
-
-    .priv_size = sizeof(ShowInfoContext),
-
-    .inputs    = avfilter_vf_showinfo_inputs,
-
-    .outputs   = avfilter_vf_showinfo_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_transpose.c b/deps/libav/libavfilter/vf_transpose.c
deleted file mode 100644
index 06a88c7..0000000
--- a/deps/libav/libavfilter/vf_transpose.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2010 Stefano Sabatini
- * Copyright (c) 2008 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * transposition filter
- * Based on MPlayer libmpcodecs/vf_rotate.c.
- */
-
-#include <stdio.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-enum TransposeDir {
-    TRANSPOSE_CCLOCK_FLIP,
-    TRANSPOSE_CLOCK,
-    TRANSPOSE_CCLOCK,
-    TRANSPOSE_CLOCK_FLIP,
-};
-
-typedef struct {
-    const AVClass *class;
-    int hsub, vsub;
-    int pixsteps[4];
-
-    enum TransposeDir dir;
-} TransContext;
-
-static int query_formats(AVFilterContext *ctx)
-{
-    enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_ARGB,         AV_PIX_FMT_RGBA,
-        AV_PIX_FMT_ABGR,         AV_PIX_FMT_BGRA,
-        AV_PIX_FMT_RGB24,        AV_PIX_FMT_BGR24,
-        AV_PIX_FMT_RGB565BE,     AV_PIX_FMT_RGB565LE,
-        AV_PIX_FMT_RGB555BE,     AV_PIX_FMT_RGB555LE,
-        AV_PIX_FMT_BGR565BE,     AV_PIX_FMT_BGR565LE,
-        AV_PIX_FMT_BGR555BE,     AV_PIX_FMT_BGR555LE,
-        AV_PIX_FMT_GRAY16BE,     AV_PIX_FMT_GRAY16LE,
-        AV_PIX_FMT_YUV420P16LE,  AV_PIX_FMT_YUV420P16BE,
-        AV_PIX_FMT_YUV422P16LE,  AV_PIX_FMT_YUV422P16BE,
-        AV_PIX_FMT_YUV444P16LE,  AV_PIX_FMT_YUV444P16BE,
-        AV_PIX_FMT_NV12,         AV_PIX_FMT_NV21,
-        AV_PIX_FMT_RGB8,         AV_PIX_FMT_BGR8,
-        AV_PIX_FMT_RGB4_BYTE,    AV_PIX_FMT_BGR4_BYTE,
-        AV_PIX_FMT_YUV444P,      AV_PIX_FMT_YUV422P,
-        AV_PIX_FMT_YUV420P,      AV_PIX_FMT_YUVJ420P,
-        AV_PIX_FMT_YUV411P,      AV_PIX_FMT_YUV410P,
-        AV_PIX_FMT_YUVJ444P,     AV_PIX_FMT_YUVJ422P,
-        AV_PIX_FMT_YUV440P,      AV_PIX_FMT_YUVJ440P,
-        AV_PIX_FMT_YUVA420P,     AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int config_props_output(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    TransContext *trans = ctx->priv;
-    AVFilterLink *inlink = ctx->inputs[0];
-    const AVPixFmtDescriptor *desc_out = av_pix_fmt_desc_get(outlink->format);
-    const AVPixFmtDescriptor *desc_in  = av_pix_fmt_desc_get(inlink->format);
-
-    trans->hsub = desc_in->log2_chroma_w;
-    trans->vsub = desc_in->log2_chroma_h;
-
-    av_image_fill_max_pixsteps(trans->pixsteps, NULL, desc_out);
-
-    outlink->w = inlink->h;
-    outlink->h = inlink->w;
-
-    if (inlink->sample_aspect_ratio.num){
-        outlink->sample_aspect_ratio = av_div_q((AVRational){1,1}, inlink->sample_aspect_ratio);
-    } else
-        outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
-
-    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d dir:%d -> w:%d h:%d rotation:%s vflip:%d\n",
-           inlink->w, inlink->h, trans->dir, outlink->w, outlink->h,
-           trans->dir == 1 || trans->dir == 3 ? "clockwise" : "counterclockwise",
-           trans->dir == 0 || trans->dir == 3);
-    return 0;
-}
-
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
-{
-    AVFilterLink *outlink = inlink->dst->outputs[0];
-    TransContext *trans = inlink->dst->priv;
-    AVFrame *out;
-    int plane;
-
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-
-    out->pts = in->pts;
-
-    if (in->sample_aspect_ratio.num == 0) {
-        out->sample_aspect_ratio = in->sample_aspect_ratio;
-    } else {
-        out->sample_aspect_ratio.num = in->sample_aspect_ratio.den;
-        out->sample_aspect_ratio.den = in->sample_aspect_ratio.num;
-    }
-
-    for (plane = 0; out->data[plane]; plane++) {
-        int hsub = plane == 1 || plane == 2 ? trans->hsub : 0;
-        int vsub = plane == 1 || plane == 2 ? trans->vsub : 0;
-        int pixstep = trans->pixsteps[plane];
-        int inh  = in->height  >> vsub;
-        int outw = out->width  >> hsub;
-        int outh = out->height >> vsub;
-        uint8_t *dst, *src;
-        int dstlinesize, srclinesize;
-        int x, y;
-
-        dst = out->data[plane];
-        dstlinesize = out->linesize[plane];
-        src = in->data[plane];
-        srclinesize = in->linesize[plane];
-
-        if (trans->dir&1) {
-            src +=  in->linesize[plane] * (inh-1);
-            srclinesize *= -1;
-        }
-
-        if (trans->dir&2) {
-            dst += out->linesize[plane] * (outh-1);
-            dstlinesize *= -1;
-        }
-
-        for (y = 0; y < outh; y++) {
-            switch (pixstep) {
-            case 1:
-                for (x = 0; x < outw; x++)
-                    dst[x] = src[x*srclinesize + y];
-                break;
-            case 2:
-                for (x = 0; x < outw; x++)
-                    *((uint16_t *)(dst + 2*x)) = *((uint16_t *)(src + x*srclinesize + y*2));
-                break;
-            case 3:
-                for (x = 0; x < outw; x++) {
-                    int32_t v = AV_RB24(src + x*srclinesize + y*3);
-                    AV_WB24(dst + 3*x, v);
-                }
-                break;
-            case 4:
-                for (x = 0; x < outw; x++)
-                    *((uint32_t *)(dst + 4*x)) = *((uint32_t *)(src + x*srclinesize + y*4));
-                break;
-            }
-            dst += dstlinesize;
-        }
-    }
-
-    av_frame_free(&in);
-    return ff_filter_frame(outlink, out);
-}
-
-#define OFFSET(x) offsetof(TransContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "dir", "Transpose direction", OFFSET(dir), AV_OPT_TYPE_INT, { .i64 = TRANSPOSE_CCLOCK_FLIP },
-        TRANSPOSE_CCLOCK_FLIP, TRANSPOSE_CLOCK_FLIP, FLAGS, "dir" },
-        { "cclock_flip", "counter-clockwise with vertical flip", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK_FLIP }, .unit = "dir" },
-        { "clock",       "clockwise",                            0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CLOCK       }, .unit = "dir" },
-        { "cclock",      "counter-clockwise",                    0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK      }, .unit = "dir" },
-        { "clock_flip",  "clockwise with vertical flip",         0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CLOCK_FLIP  }, .unit = "dir" },
-    { NULL },
-};
-
-static const AVClass transpose_class = {
-    .class_name = "transpose",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_transpose_inputs[] = {
-    {
-        .name        = "default",
-        .type        = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_transpose_outputs[] = {
-    {
-        .name         = "default",
-        .config_props = config_props_output,
-        .type         = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_transpose = {
-    .name      = "transpose",
-    .description = NULL_IF_CONFIG_SMALL("Transpose input video."),
-
-    .priv_size = sizeof(TransContext),
-    .priv_class = &transpose_class,
-
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_transpose_inputs,
-    .outputs   = avfilter_vf_transpose_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_unsharp.c b/deps/libav/libavfilter/vf_unsharp.c
deleted file mode 100644
index 842ec7e..0000000
--- a/deps/libav/libavfilter/vf_unsharp.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Original copyright (c) 2002 Remi Guyomarch <rguyom at pobox.com>
- * Port copyright (c) 2010 Daniel G. Taylor <dan at programmer-art.org>
- * Relicensed to the LGPL with permission from Remi Guyomarch.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * blur / sharpen filter, ported to Libav from MPlayer
- * libmpcodecs/unsharp.c.
- *
- * This code is based on:
- *
- * An Efficient algorithm for Gaussian blur using finite-state machines
- * Frederick M. Waltz and John W. V. Miller
- *
- * SPIE Conf. on Machine Vision Systems for Inspection and Metrology VII
- * Originally published Boston, Nov 98
- *
- * http://www.engin.umd.umich.edu/~jwvm/ece581/21_GBlur.pdf
- */
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "libavutil/common.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-
-#define MIN_SIZE 3
-#define MAX_SIZE 13
-
-/* right-shift and round-up */
-#define SHIFTUP(x,shift) (-((-(x))>>(shift)))
-
-typedef struct FilterParam {
-    int msize_x;                             ///< matrix width
-    int msize_y;                             ///< matrix height
-    int amount;                              ///< effect amount
-    int steps_x;                             ///< horizontal step count
-    int steps_y;                             ///< vertical step count
-    int scalebits;                           ///< bits to shift pixel
-    int32_t halfscale;                       ///< amount to add to pixel
-    uint32_t *sc[(MAX_SIZE * MAX_SIZE) - 1]; ///< finite state machine storage
-} FilterParam;
-
-typedef struct {
-    const AVClass *class;
-    int lmsize_x, lmsize_y, cmsize_x, cmsize_y;
-    float lamount, camount;
-    FilterParam luma;   ///< luma parameters (width, height, amount)
-    FilterParam chroma; ///< chroma parameters (width, height, amount)
-    int hsub, vsub;
-} UnsharpContext;
-
-static void apply_unsharp(      uint8_t *dst, int dst_stride,
-                          const uint8_t *src, int src_stride,
-                          int width, int height, FilterParam *fp)
-{
-    uint32_t **sc = fp->sc;
-    uint32_t sr[(MAX_SIZE * MAX_SIZE) - 1], tmp1, tmp2;
-
-    int32_t res;
-    int x, y, z;
-    const uint8_t *src2;
-
-    if (!fp->amount) {
-        if (dst_stride == src_stride)
-            memcpy(dst, src, src_stride * height);
-        else
-            for (y = 0; y < height; y++, dst += dst_stride, src += src_stride)
-                memcpy(dst, src, width);
-        return;
-    }
-
-    for (y = 0; y < 2 * fp->steps_y; y++)
-        memset(sc[y], 0, sizeof(sc[y][0]) * (width + 2 * fp->steps_x));
-
-    for (y = -fp->steps_y; y < height + fp->steps_y; y++) {
-        if (y < height)
-            src2 = src;
-
-        memset(sr, 0, sizeof(sr[0]) * (2 * fp->steps_x - 1));
-        for (x = -fp->steps_x; x < width + fp->steps_x; x++) {
-            tmp1 = x <= 0 ? src2[0] : x >= width ? src2[width-1] : src2[x];
-            for (z = 0; z < fp->steps_x * 2; z += 2) {
-                tmp2 = sr[z + 0] + tmp1; sr[z + 0] = tmp1;
-                tmp1 = sr[z + 1] + tmp2; sr[z + 1] = tmp2;
-            }
-            for (z = 0; z < fp->steps_y * 2; z += 2) {
-                tmp2 = sc[z + 0][x + fp->steps_x] + tmp1; sc[z + 0][x + fp->steps_x] = tmp1;
-                tmp1 = sc[z + 1][x + fp->steps_x] + tmp2; sc[z + 1][x + fp->steps_x] = tmp2;
-            }
-            if (x >= fp->steps_x && y >= fp->steps_y) {
-                const uint8_t *srx = src - fp->steps_y * src_stride + x - fp->steps_x;
-                uint8_t *dsx       = dst - fp->steps_y * dst_stride + x - fp->steps_x;
-
-                res = (int32_t)*srx + ((((int32_t) * srx - (int32_t)((tmp1 + fp->halfscale) >> fp->scalebits)) * fp->amount) >> 16);
-                *dsx = av_clip_uint8(res);
-            }
-        }
-        if (y >= 0) {
-            dst += dst_stride;
-            src += src_stride;
-        }
-    }
-}
-
-static void set_filter_param(FilterParam *fp, int msize_x, int msize_y, float amount)
-{
-    fp->msize_x = msize_x;
-    fp->msize_y = msize_y;
-    fp->amount = amount * 65536.0;
-
-    fp->steps_x = msize_x / 2;
-    fp->steps_y = msize_y / 2;
-    fp->scalebits = (fp->steps_x + fp->steps_y) * 2;
-    fp->halfscale = 1 << (fp->scalebits - 1);
-}
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    UnsharpContext *unsharp = ctx->priv;
-
-    set_filter_param(&unsharp->luma,   unsharp->lmsize_x, unsharp->lmsize_y, unsharp->lamount);
-    set_filter_param(&unsharp->chroma, unsharp->cmsize_x, unsharp->cmsize_y, unsharp->camount);
-
-    return 0;
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV420P,  AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV410P,
-        AV_PIX_FMT_YUV411P,  AV_PIX_FMT_YUV440P,  AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
-        AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-
-    return 0;
-}
-
-static void init_filter_param(AVFilterContext *ctx, FilterParam *fp, const char *effect_type, int width)
-{
-    int z;
-    const char *effect;
-
-    effect = fp->amount == 0 ? "none" : fp->amount < 0 ? "blur" : "sharpen";
-
-    av_log(ctx, AV_LOG_VERBOSE, "effect:%s type:%s msize_x:%d msize_y:%d amount:%0.2f\n",
-           effect, effect_type, fp->msize_x, fp->msize_y, fp->amount / 65535.0);
-
-    for (z = 0; z < 2 * fp->steps_y; z++)
-        fp->sc[z] = av_malloc(sizeof(*(fp->sc[z])) * (width + 2 * fp->steps_x));
-}
-
-static int config_props(AVFilterLink *link)
-{
-    UnsharpContext *unsharp = link->dst->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
-
-    unsharp->hsub = desc->log2_chroma_w;
-    unsharp->vsub = desc->log2_chroma_h;
-
-    init_filter_param(link->dst, &unsharp->luma,   "luma",   link->w);
-    init_filter_param(link->dst, &unsharp->chroma, "chroma", SHIFTUP(link->w, unsharp->hsub));
-
-    return 0;
-}
-
-static void free_filter_param(FilterParam *fp)
-{
-    int z;
-
-    for (z = 0; z < 2 * fp->steps_y; z++)
-        av_free(fp->sc[z]);
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    UnsharpContext *unsharp = ctx->priv;
-
-    free_filter_param(&unsharp->luma);
-    free_filter_param(&unsharp->chroma);
-}
-
-static int filter_frame(AVFilterLink *link, AVFrame *in)
-{
-    UnsharpContext *unsharp = link->dst->priv;
-    AVFilterLink *outlink   = link->dst->outputs[0];
-    AVFrame *out;
-    int cw = SHIFTUP(link->w, unsharp->hsub);
-    int ch = SHIFTUP(link->h, unsharp->vsub);
-
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out) {
-        av_frame_free(&in);
-        return AVERROR(ENOMEM);
-    }
-    av_frame_copy_props(out, in);
-
-    apply_unsharp(out->data[0], out->linesize[0], in->data[0], in->linesize[0], link->w, link->h, &unsharp->luma);
-    apply_unsharp(out->data[1], out->linesize[1], in->data[1], in->linesize[1], cw,      ch,      &unsharp->chroma);
-    apply_unsharp(out->data[2], out->linesize[2], in->data[2], in->linesize[2], cw,      ch,      &unsharp->chroma);
-
-    av_frame_free(&in);
-    return ff_filter_frame(outlink, out);
-}
-
-#define OFFSET(x) offsetof(UnsharpContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "luma_msize_x",   "luma matrix horizontal size",   OFFSET(lmsize_x), AV_OPT_TYPE_INT,   { .i64 = 5 }, MIN_SIZE, MAX_SIZE, FLAGS },
-    { "luma_msize_y",   "luma matrix vertical size",     OFFSET(lmsize_y), AV_OPT_TYPE_INT,   { .i64 = 5 }, MIN_SIZE, MAX_SIZE, FLAGS },
-    { "luma_amount",    "luma effect strength",          OFFSET(lamount),  AV_OPT_TYPE_FLOAT, { .dbl = 1 },       -2,        5, FLAGS },
-    { "chroma_msize_x", "chroma matrix horizontal size", OFFSET(cmsize_x), AV_OPT_TYPE_INT,   { .i64 = 5 }, MIN_SIZE, MAX_SIZE, FLAGS },
-    { "chroma_msize_y", "chroma matrix vertical size",   OFFSET(cmsize_y), AV_OPT_TYPE_INT,   { .i64 = 5 }, MIN_SIZE, MAX_SIZE, FLAGS },
-    { "chroma_amount",  "chroma effect strength",        OFFSET(camount),  AV_OPT_TYPE_FLOAT, { .dbl = 0 },       -2,        5, FLAGS },
-    { NULL },
-};
-
-static const AVClass unsharp_class = {
-    .class_name = "unsharp",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_unsharp_inputs[] = {
-    {
-        .name         = "default",
-        .type         = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-        .config_props = config_props,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_unsharp_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_unsharp = {
-    .name      = "unsharp",
-    .description = NULL_IF_CONFIG_SMALL("Sharpen or blur the input video."),
-
-    .priv_size = sizeof(UnsharpContext),
-    .priv_class = &unsharp_class,
-
-    .init = init,
-    .uninit = uninit,
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_unsharp_inputs,
-
-    .outputs   = avfilter_vf_unsharp_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_vflip.c b/deps/libav/libavfilter/vf_vflip.c
deleted file mode 100644
index ced946e..0000000
--- a/deps/libav/libavfilter/vf_vflip.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2007 Bobby Bingham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * video vertical flip filter
- */
-
-#include "libavutil/internal.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    int vsub;   ///< vertical chroma subsampling
-} FlipContext;
-
-static int config_input(AVFilterLink *link)
-{
-    FlipContext *flip = link->dst->priv;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
-
-    flip->vsub = desc->log2_chroma_h;
-
-    return 0;
-}
-
-static AVFrame *get_video_buffer(AVFilterLink *link, int w, int h)
-{
-    FlipContext *flip = link->dst->priv;
-    AVFrame *frame;
-    int i;
-
-    frame = ff_get_video_buffer(link->dst->outputs[0], w, h);
-    if (!frame)
-        return NULL;
-
-    for (i = 0; i < 4; i ++) {
-        int vsub = i == 1 || i == 2 ? flip->vsub : 0;
-
-        if (frame->data[i]) {
-            frame->data[i] += ((h >> vsub) - 1) * frame->linesize[i];
-            frame->linesize[i] = -frame->linesize[i];
-        }
-    }
-
-    return frame;
-}
-
-static int filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    FlipContext *flip = link->dst->priv;
-    int i;
-
-    for (i = 0; i < 4; i ++) {
-        int vsub = i == 1 || i == 2 ? flip->vsub : 0;
-
-        if (frame->data[i]) {
-            frame->data[i] += ((link->h >> vsub)-1) * frame->linesize[i];
-            frame->linesize[i] = -frame->linesize[i];
-        }
-    }
-
-    return ff_filter_frame(link->dst->outputs[0], frame);
-}
-static const AVFilterPad avfilter_vf_vflip_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = get_video_buffer,
-        .filter_frame     = filter_frame,
-        .config_props     = config_input,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_vflip_outputs[] = {
-    {
-        .name = "default",
-        .type = AVMEDIA_TYPE_VIDEO,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_vflip = {
-    .name      = "vflip",
-    .description = NULL_IF_CONFIG_SMALL("Flip the input video vertically."),
-
-    .priv_size = sizeof(FlipContext),
-
-    .inputs    = avfilter_vf_vflip_inputs,
-    .outputs   = avfilter_vf_vflip_outputs,
-};
diff --git a/deps/libav/libavfilter/vf_yadif.c b/deps/libav/libavfilter/vf_yadif.c
deleted file mode 100644
index 53c567c..0000000
--- a/deps/libav/libavfilter/vf_yadif.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * Copyright (C) 2006-2010 Michael Niedermayer <michaelni at gmx.at>
- *               2010      James Darnley <james.darnley at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/cpu.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "yadif.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-typedef struct ThreadData {
-    AVFrame *frame;
-    int plane;
-    int w, h;
-    int parity;
-    int tff;
-} ThreadData;
-
-#define CHECK(j)\
-    {   int score = FFABS(cur[mrefs - 1 + (j)] - cur[prefs - 1 - (j)])\
-                  + FFABS(cur[mrefs  +(j)] - cur[prefs  -(j)])\
-                  + FFABS(cur[mrefs + 1 + (j)] - cur[prefs + 1 - (j)]);\
-        if (score < spatial_score) {\
-            spatial_score= score;\
-            spatial_pred= (cur[mrefs  +(j)] + cur[prefs  -(j)])>>1;\
-
-/* The is_not_edge argument here controls when the code will enter a branch
- * which reads up to and including x-3 and x+3. */
-
-#define FILTER(start, end, is_not_edge) \
-    for (x = start;  x < end; x++) { \
-        int c = cur[mrefs]; \
-        int d = (prev2[0] + next2[0])>>1; \
-        int e = cur[prefs]; \
-        int temporal_diff0 = FFABS(prev2[0] - next2[0]); \
-        int temporal_diff1 =(FFABS(prev[mrefs] - c) + FFABS(prev[prefs] - e) )>>1; \
-        int temporal_diff2 =(FFABS(next[mrefs] - c) + FFABS(next[prefs] - e) )>>1; \
-        int diff = FFMAX3(temporal_diff0 >> 1, temporal_diff1, temporal_diff2); \
-        int spatial_pred = (c+e) >> 1; \
- \
-        if (is_not_edge) {\
-            int spatial_score = FFABS(cur[mrefs - 1] - cur[prefs - 1]) + FFABS(c-e) \
-                              + FFABS(cur[mrefs + 1] - cur[prefs + 1]) - 1; \
-            CHECK(-1) CHECK(-2) }} }} \
-            CHECK( 1) CHECK( 2) }} }} \
-        }\
- \
-        if (mode < 2) { \
-            int b = (prev2[2 * mrefs] + next2[2 * mrefs])>>1; \
-            int f = (prev2[2 * prefs] + next2[2 * prefs])>>1; \
-            int max = FFMAX3(d - e, d - c, FFMIN(b - c, f - e)); \
-            int min = FFMIN3(d - e, d - c, FFMAX(b - c, f - e)); \
- \
-            diff = FFMAX3(diff, min, -max); \
-        } \
- \
-        if (spatial_pred > d + diff) \
-           spatial_pred = d + diff; \
-        else if (spatial_pred < d - diff) \
-           spatial_pred = d - diff; \
- \
-        dst[0] = spatial_pred; \
- \
-        dst++; \
-        cur++; \
-        prev++; \
-        next++; \
-        prev2++; \
-        next2++; \
-    }
-
-static void filter_line_c(void *dst1,
-                          void *prev1, void *cur1, void *next1,
-                          int w, int prefs, int mrefs, int parity, int mode)
-{
-    uint8_t *dst  = dst1;
-    uint8_t *prev = prev1;
-    uint8_t *cur  = cur1;
-    uint8_t *next = next1;
-    int x;
-    uint8_t *prev2 = parity ? prev : cur ;
-    uint8_t *next2 = parity ? cur  : next;
-
-    /* The function is called with the pointers already pointing to data[3] and
-     * with 6 subtracted from the width.  This allows the FILTER macro to be
-     * called so that it processes all the pixels normally.  A constant value of
-     * true for is_not_edge lets the compiler ignore the if statement. */
-    FILTER(0, w, 1)
-}
-
-static void filter_edges(void *dst1, void *prev1, void *cur1, void *next1,
-                         int w, int prefs, int mrefs, int parity, int mode)
-{
-    uint8_t *dst  = dst1;
-    uint8_t *prev = prev1;
-    uint8_t *cur  = cur1;
-    uint8_t *next = next1;
-    int x;
-    uint8_t *prev2 = parity ? prev : cur ;
-    uint8_t *next2 = parity ? cur  : next;
-
-    /* Only edge pixels need to be processed here.  A constant value of false
-     * for is_not_edge should let the compiler ignore the whole branch. */
-    FILTER(0, 3, 0)
-
-    dst  = (uint8_t*)dst1  + w - 3;
-    prev = (uint8_t*)prev1 + w - 3;
-    cur  = (uint8_t*)cur1  + w - 3;
-    next = (uint8_t*)next1 + w - 3;
-    prev2 = (uint8_t*)(parity ? prev : cur);
-    next2 = (uint8_t*)(parity ? cur  : next);
-
-    FILTER(w - 3, w, 0)
-}
-
-
-static void filter_line_c_16bit(void *dst1,
-                                void *prev1, void *cur1, void *next1,
-                                int w, int prefs, int mrefs, int parity,
-                                int mode)
-{
-    uint16_t *dst  = dst1;
-    uint16_t *prev = prev1;
-    uint16_t *cur  = cur1;
-    uint16_t *next = next1;
-    int x;
-    uint16_t *prev2 = parity ? prev : cur ;
-    uint16_t *next2 = parity ? cur  : next;
-    mrefs /= 2;
-    prefs /= 2;
-
-    FILTER(0, w, 1)
-}
-
-static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1,
-                               int w, int prefs, int mrefs, int parity, int mode)
-{
-    uint16_t *dst  = dst1;
-    uint16_t *prev = prev1;
-    uint16_t *cur  = cur1;
-    uint16_t *next = next1;
-    int x;
-    uint16_t *prev2 = parity ? prev : cur ;
-    uint16_t *next2 = parity ? cur  : next;
-    mrefs /= 2;
-    prefs /= 2;
-
-    FILTER(0, 3, 0)
-
-    dst   = (uint16_t*)dst1  + w - 3;
-    prev  = (uint16_t*)prev1 + w - 3;
-    cur   = (uint16_t*)cur1  + w - 3;
-    next  = (uint16_t*)next1 + w - 3;
-    prev2 = (uint16_t*)(parity ? prev : cur);
-    next2 = (uint16_t*)(parity ? cur  : next);
-
-    FILTER(w - 3, w, 0)
-}
-
-static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
-{
-    YADIFContext *s = ctx->priv;
-    ThreadData *td  = arg;
-    int refs = s->cur->linesize[td->plane];
-    int df = (s->csp->comp[td->plane].depth_minus1 + 8) / 8;
-    int pix_3 = 3 * df;
-    int slice_h = td->h / nb_jobs;
-    int slice_start = jobnr * slice_h;
-    int slice_end   = (jobnr == nb_jobs - 1) ? td->h : (jobnr + 1) * slice_h;
-    int y;
-
-    /* filtering reads 3 pixels to the left/right; to avoid invalid reads,
-     * we need to call the c variant which avoids this for border pixels
-     */
-    for (y = slice_start; y < slice_end; y++) {
-        if ((y ^ td->parity) & 1) {
-            uint8_t *prev = &s->prev->data[td->plane][y * refs];
-            uint8_t *cur  = &s->cur ->data[td->plane][y * refs];
-            uint8_t *next = &s->next->data[td->plane][y * refs];
-            uint8_t *dst  = &td->frame->data[td->plane][y * td->frame->linesize[td->plane]];
-            int     mode  = y == 1 || y + 2 == td->h ? 2 : s->mode;
-            s->filter_line(dst + pix_3, prev + pix_3, cur + pix_3,
-                           next + pix_3, td->w - 6,
-                           y + 1 < td->h ? refs : -refs,
-                           y ? -refs : refs,
-                           td->parity ^ td->tff, mode);
-            s->filter_edges(dst, prev, cur, next, td->w,
-                            y + 1 < td->h ? refs : -refs,
-                            y ? -refs : refs,
-                            td->parity ^ td->tff, mode);
-        } else {
-            memcpy(&td->frame->data[td->plane][y * td->frame->linesize[td->plane]],
-                   &s->cur->data[td->plane][y * refs], td->w * df);
-        }
-    }
-    return 0;
-}
-
-static void filter(AVFilterContext *ctx, AVFrame *dstpic,
-                   int parity, int tff)
-{
-    YADIFContext *yadif = ctx->priv;
-    ThreadData td = { .frame = dstpic, .parity = parity, .tff = tff };
-    int i;
-
-    for (i = 0; i < yadif->csp->nb_components; i++) {
-        int w = dstpic->width;
-        int h = dstpic->height;
-
-        if (i == 1 || i == 2) {
-            w >>= yadif->csp->log2_chroma_w;
-            h >>= yadif->csp->log2_chroma_h;
-        }
-
-
-        td.w       = w;
-        td.h       = h;
-        td.plane   = i;
-
-        ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(h, ctx->graph->nb_threads));
-    }
-
-    emms_c();
-}
-
-static AVFrame *get_video_buffer(AVFilterLink *link, int w, int h)
-{
-    AVFrame *frame;
-    int width  = FFALIGN(w, 32);
-    int height = FFALIGN(h + 2, 32);
-    int i;
-
-    frame = ff_default_get_video_buffer(link, width, height);
-
-    frame->width  = w;
-    frame->height = h;
-
-    for (i = 0; i < 3; i++)
-        frame->data[i] += frame->linesize[i];
-
-    return frame;
-}
-
-static int return_frame(AVFilterContext *ctx, int is_second)
-{
-    YADIFContext *yadif = ctx->priv;
-    AVFilterLink *link  = ctx->outputs[0];
-    int tff, ret;
-
-    if (yadif->parity == -1) {
-        tff = yadif->cur->interlaced_frame ?
-              yadif->cur->top_field_first : 1;
-    } else {
-        tff = yadif->parity ^ 1;
-    }
-
-    if (is_second) {
-        yadif->out = ff_get_video_buffer(link, link->w, link->h);
-        if (!yadif->out)
-            return AVERROR(ENOMEM);
-
-        av_frame_copy_props(yadif->out, yadif->cur);
-        yadif->out->interlaced_frame = 0;
-    }
-
-    filter(ctx, yadif->out, tff ^ !is_second, tff);
-
-    if (is_second) {
-        int64_t cur_pts  = yadif->cur->pts;
-        int64_t next_pts = yadif->next->pts;
-
-        if (next_pts != AV_NOPTS_VALUE && cur_pts != AV_NOPTS_VALUE) {
-            yadif->out->pts = cur_pts + next_pts;
-        } else {
-            yadif->out->pts = AV_NOPTS_VALUE;
-        }
-    }
-    ret = ff_filter_frame(ctx->outputs[0], yadif->out);
-
-    yadif->frame_pending = (yadif->mode&1) && !is_second;
-    return ret;
-}
-
-static int filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    AVFilterContext *ctx = link->dst;
-    YADIFContext *yadif = ctx->priv;
-
-    if (yadif->frame_pending)
-        return_frame(ctx, 1);
-
-    if (yadif->prev)
-        av_frame_free(&yadif->prev);
-    yadif->prev = yadif->cur;
-    yadif->cur  = yadif->next;
-    yadif->next = frame;
-
-    if (!yadif->cur)
-        return 0;
-
-    if (yadif->auto_enable && !yadif->cur->interlaced_frame) {
-        yadif->out  = av_frame_clone(yadif->cur);
-        if (!yadif->out)
-            return AVERROR(ENOMEM);
-
-        av_frame_free(&yadif->prev);
-        if (yadif->out->pts != AV_NOPTS_VALUE)
-            yadif->out->pts *= 2;
-        return ff_filter_frame(ctx->outputs[0], yadif->out);
-    }
-
-    if (!yadif->prev &&
-        !(yadif->prev = av_frame_clone(yadif->cur)))
-        return AVERROR(ENOMEM);
-
-    yadif->out = ff_get_video_buffer(ctx->outputs[0], link->w, link->h);
-    if (!yadif->out)
-        return AVERROR(ENOMEM);
-
-    av_frame_copy_props(yadif->out, yadif->cur);
-    yadif->out->interlaced_frame = 0;
-
-    if (yadif->out->pts != AV_NOPTS_VALUE)
-        yadif->out->pts *= 2;
-
-    return return_frame(ctx, 0);
-}
-
-static int request_frame(AVFilterLink *link)
-{
-    AVFilterContext *ctx = link->src;
-    YADIFContext *yadif = ctx->priv;
-
-    if (yadif->frame_pending) {
-        return_frame(ctx, 1);
-        return 0;
-    }
-
-    do {
-        int ret;
-
-        if (yadif->eof)
-            return AVERROR_EOF;
-
-        ret  = ff_request_frame(link->src->inputs[0]);
-
-        if (ret == AVERROR_EOF && yadif->next) {
-            AVFrame *next = av_frame_clone(yadif->next);
-
-            if (!next)
-                return AVERROR(ENOMEM);
-
-            next->pts = yadif->next->pts * 2 - yadif->cur->pts;
-
-            filter_frame(link->src->inputs[0], next);
-            yadif->eof = 1;
-        } else if (ret < 0) {
-            return ret;
-        }
-    } while (!yadif->cur);
-
-    return 0;
-}
-
-static int poll_frame(AVFilterLink *link)
-{
-    YADIFContext *yadif = link->src->priv;
-    int ret, val;
-
-    if (yadif->frame_pending)
-        return 1;
-
-    val = ff_poll_frame(link->src->inputs[0]);
-    if (val <= 0)
-        return val;
-
-    //FIXME change API to not requre this red tape
-    if (val == 1 && !yadif->next) {
-        if ((ret = ff_request_frame(link->src->inputs[0])) < 0)
-            return ret;
-        val = ff_poll_frame(link->src->inputs[0]);
-        if (val <= 0)
-            return val;
-    }
-    assert(yadif->next || !val);
-
-    if (yadif->auto_enable && yadif->next && !yadif->next->interlaced_frame)
-        return val;
-
-    return val * ((yadif->mode&1)+1);
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    YADIFContext *yadif = ctx->priv;
-
-    if (yadif->prev) av_frame_free(&yadif->prev);
-    if (yadif->cur ) av_frame_free(&yadif->cur );
-    if (yadif->next) av_frame_free(&yadif->next);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_YUV420P,
-        AV_PIX_FMT_YUV422P,
-        AV_PIX_FMT_YUV444P,
-        AV_PIX_FMT_YUV410P,
-        AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_YUVJ420P,
-        AV_PIX_FMT_YUVJ422P,
-        AV_PIX_FMT_YUVJ444P,
-        AV_NE( AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE ),
-        AV_PIX_FMT_YUV440P,
-        AV_PIX_FMT_YUVJ440P,
-        AV_NE( AV_PIX_FMT_YUV420P10BE, AV_PIX_FMT_YUV420P10LE ),
-        AV_NE( AV_PIX_FMT_YUV422P10BE, AV_PIX_FMT_YUV422P10LE ),
-        AV_NE( AV_PIX_FMT_YUV444P10BE, AV_PIX_FMT_YUV444P10LE ),
-        AV_NE( AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUV420P16LE ),
-        AV_NE( AV_PIX_FMT_YUV422P16BE, AV_PIX_FMT_YUV422P16LE ),
-        AV_NE( AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUV444P16LE ),
-        AV_PIX_FMT_YUVA420P,
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-
-    return 0;
-}
-
-static int config_props(AVFilterLink *link)
-{
-    YADIFContext *s = link->src->priv;
-
-    link->time_base.num = link->src->inputs[0]->time_base.num;
-    link->time_base.den = link->src->inputs[0]->time_base.den * 2;
-    link->w             = link->src->inputs[0]->w;
-    link->h             = link->src->inputs[0]->h;
-
-    s->csp = av_pix_fmt_desc_get(link->format);
-    if (s->csp->comp[0].depth_minus1 / 8 == 1) {
-        s->filter_line  = filter_line_c_16bit;
-        s->filter_edges = filter_edges_16bit;
-    } else {
-        s->filter_line  = filter_line_c;
-        s->filter_edges = filter_edges;
-
-        if (ARCH_X86)
-            ff_yadif_init_x86(s);
-    }
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(YADIFContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "mode",   NULL, OFFSET(mode),        AV_OPT_TYPE_INT, { .i64 = 0  },  0, 3, FLAGS },
-    { "parity", NULL, OFFSET(parity),      AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, FLAGS, "parity" },
-        { "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, .unit = "parity" },
-        { "tff",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0  }, .unit = "parity" },
-        { "bff",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1  }, .unit = "parity" },
-    { "auto",   NULL, OFFSET(auto_enable), AV_OPT_TYPE_INT, { .i64 = 0  },  0, 1, FLAGS },
-    { NULL },
-};
-
-static const AVClass yadif_class = {
-    .class_name = "yadif",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vf_yadif_inputs[] = {
-    {
-        .name             = "default",
-        .type             = AVMEDIA_TYPE_VIDEO,
-        .get_video_buffer = get_video_buffer,
-        .filter_frame     = filter_frame,
-    },
-    { NULL }
-};
-
-static const AVFilterPad avfilter_vf_yadif_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .poll_frame    = poll_frame,
-        .request_frame = request_frame,
-        .config_props  = config_props,
-    },
-    { NULL }
-};
-
-AVFilter ff_vf_yadif = {
-    .name          = "yadif",
-    .description   = NULL_IF_CONFIG_SMALL("Deinterlace the input image"),
-
-    .priv_size     = sizeof(YADIFContext),
-    .priv_class    = &yadif_class,
-    .uninit        = uninit,
-    .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_yadif_inputs,
-
-    .outputs   = avfilter_vf_yadif_outputs,
-
-    .flags     = AVFILTER_FLAG_SLICE_THREADS,
-};
diff --git a/deps/libav/libavfilter/video.c b/deps/libav/libavfilter/video.c
deleted file mode 100644
index 23bf867..0000000
--- a/deps/libav/libavfilter/video.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#include "libavutil/buffer.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/mem.h"
-
-#include "avfilter.h"
-#include "internal.h"
-#include "video.h"
-
-AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
-{
-    return ff_get_video_buffer(link->dst->outputs[0], w, h);
-}
-
-/* TODO: set the buffer's priv member to a context structure for the whole
- * filter chain.  This will allow for a buffer pool instead of the constant
- * alloc & free cycle currently implemented. */
-AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
-{
-    AVFrame *frame = av_frame_alloc();
-    int ret;
-
-    if (!frame)
-        return NULL;
-
-    frame->width  = w;
-    frame->height = h;
-    frame->format = link->format;
-
-    ret = av_frame_get_buffer(frame, 32);
-    if (ret < 0)
-        av_frame_free(&frame);
-
-    return frame;
-}
-
-#if FF_API_AVFILTERBUFFER
-AVFilterBufferRef *
-avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms,
-                                          int w, int h, enum AVPixelFormat format)
-{
-    AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer));
-    AVFilterBufferRef *picref = av_mallocz(sizeof(AVFilterBufferRef));
-
-    if (!pic || !picref)
-        goto fail;
-
-    picref->buf = pic;
-    picref->buf->free = ff_avfilter_default_free_buffer;
-    if (!(picref->video = av_mallocz(sizeof(AVFilterBufferRefVideoProps))))
-        goto fail;
-
-    pic->w = picref->video->w = w;
-    pic->h = picref->video->h = h;
-
-    /* make sure the buffer gets read permission or it's useless for output */
-    picref->perms = perms | AV_PERM_READ;
-
-    pic->refcount = 1;
-    picref->type = AVMEDIA_TYPE_VIDEO;
-    pic->format = picref->format = format;
-
-    memcpy(pic->data,        data,          4*sizeof(data[0]));
-    memcpy(pic->linesize,    linesize,      4*sizeof(linesize[0]));
-    memcpy(picref->data,     pic->data,     sizeof(picref->data));
-    memcpy(picref->linesize, pic->linesize, sizeof(picref->linesize));
-
-    pic->   extended_data = pic->data;
-    picref->extended_data = picref->data;
-
-    picref->pts = AV_NOPTS_VALUE;
-
-    return picref;
-
-fail:
-    if (picref && picref->video)
-        av_free(picref->video);
-    av_free(picref);
-    av_free(pic);
-    return NULL;
-}
-#endif
-
-AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h)
-{
-    AVFrame *ret = NULL;
-
-    av_unused char buf[16];
-    FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);
-
-    if (link->dstpad->get_video_buffer)
-        ret = link->dstpad->get_video_buffer(link, w, h);
-
-    if (!ret)
-        ret = ff_default_get_video_buffer(link, w, h);
-
-    return ret;
-}
diff --git a/deps/libav/libavfilter/video.h b/deps/libav/libavfilter/video.h
deleted file mode 100644
index f7e8e34..0000000
--- a/deps/libav/libavfilter/video.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_VIDEO_H
-#define AVFILTER_VIDEO_H
-
-#include "avfilter.h"
-
-AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h);
-AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h);
-
-/**
- * Request a picture buffer with a specific set of permissions.
- *
- * @param link  the output link to the filter from which the buffer will
- *              be requested
- * @param w     the minimum width of the buffer to allocate
- * @param h     the minimum height of the buffer to allocate
- * @return      A reference to the buffer. This must be unreferenced with
- *              avfilter_unref_buffer when you are finished with it.
- */
-AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h);
-
-#endif /* AVFILTER_VIDEO_H */
diff --git a/deps/libav/libavfilter/vsink_nullsink.c b/deps/libav/libavfilter/vsink_nullsink.c
deleted file mode 100644
index 14b6b12..0000000
--- a/deps/libav/libavfilter/vsink_nullsink.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avfilter.h"
-#include "internal.h"
-#include "libavutil/internal.h"
-
-static int filter_frame(AVFilterLink *link, AVFrame *frame)
-{
-    av_frame_free(&frame);
-    return 0;
-}
-
-static const AVFilterPad avfilter_vsink_nullsink_inputs[] = {
-    {
-        .name        = "default",
-        .type        = AVMEDIA_TYPE_VIDEO,
-        .filter_frame = filter_frame,
-    },
-    { NULL },
-};
-
-AVFilter ff_vsink_nullsink = {
-    .name        = "nullsink",
-    .description = NULL_IF_CONFIG_SMALL("Do absolutely nothing with the input video."),
-
-    .priv_size = 0,
-
-    .inputs    = avfilter_vsink_nullsink_inputs,
-    .outputs   = NULL,
-};
diff --git a/deps/libav/libavfilter/vsrc_color.c b/deps/libav/libavfilter/vsrc_color.c
deleted file mode 100644
index d72d072..0000000
--- a/deps/libav/libavfilter/vsrc_color.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2010 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * color source
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/colorspace.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "drawutils.h"
-
-typedef struct {
-    const AVClass *class;
-    int w, h;
-    uint8_t color[4];
-    AVRational time_base;
-    uint8_t *line[4];
-    int      line_step[4];
-    int hsub, vsub;         ///< chroma subsampling values
-    uint64_t pts;
-    char *color_str;
-    char *size_str;
-    char *framerate_str;
-} ColorContext;
-
-static av_cold int color_init(AVFilterContext *ctx)
-{
-    ColorContext *color = ctx->priv;
-    AVRational frame_rate_q;
-    int ret;
-
-    if (av_parse_video_size(&color->w, &color->h, color->size_str) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid frame size: %s\n", color->size_str);
-        return AVERROR(EINVAL);
-    }
-
-    if (av_parse_video_rate(&frame_rate_q, color->framerate_str) < 0 ||
-        frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: %s\n", color->framerate_str);
-        return AVERROR(EINVAL);
-    }
-    color->time_base.num = frame_rate_q.den;
-    color->time_base.den = frame_rate_q.num;
-
-    if ((ret = av_parse_color(color->color, color->color_str, -1, ctx)) < 0)
-        return ret;
-
-    return 0;
-}
-
-static av_cold void color_uninit(AVFilterContext *ctx)
-{
-    ColorContext *color = ctx->priv;
-    int i;
-
-    for (i = 0; i < 4; i++) {
-        av_freep(&color->line[i]);
-        color->line_step[i] = 0;
-    }
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_ARGB,         AV_PIX_FMT_RGBA,
-        AV_PIX_FMT_ABGR,         AV_PIX_FMT_BGRA,
-        AV_PIX_FMT_RGB24,        AV_PIX_FMT_BGR24,
-
-        AV_PIX_FMT_YUV444P,      AV_PIX_FMT_YUV422P,
-        AV_PIX_FMT_YUV420P,      AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_YUV410P,      AV_PIX_FMT_YUV440P,
-        AV_PIX_FMT_YUVJ444P,     AV_PIX_FMT_YUVJ422P,
-        AV_PIX_FMT_YUVJ420P,     AV_PIX_FMT_YUVJ440P,
-        AV_PIX_FMT_YUVA420P,
-
-        AV_PIX_FMT_NONE
-    };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int color_config_props(AVFilterLink *inlink)
-{
-    AVFilterContext *ctx = inlink->src;
-    ColorContext *color = ctx->priv;
-    uint8_t rgba_color[4];
-    int is_packed_rgba;
-    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
-
-    color->hsub = pix_desc->log2_chroma_w;
-    color->vsub = pix_desc->log2_chroma_h;
-
-    color->w &= ~((1 << color->hsub) - 1);
-    color->h &= ~((1 << color->vsub) - 1);
-    if (av_image_check_size(color->w, color->h, 0, ctx) < 0)
-        return AVERROR(EINVAL);
-
-    memcpy(rgba_color, color->color, sizeof(rgba_color));
-    ff_fill_line_with_color(color->line, color->line_step, color->w, color->color,
-                            inlink->format, rgba_color, &is_packed_rgba, NULL);
-
-    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d r:%d/%d color:0x%02x%02x%02x%02x[%s]\n",
-           color->w, color->h, color->time_base.den, color->time_base.num,
-           color->color[0], color->color[1], color->color[2], color->color[3],
-           is_packed_rgba ? "rgba" : "yuva");
-    inlink->w = color->w;
-    inlink->h = color->h;
-    inlink->time_base = color->time_base;
-
-    return 0;
-}
-
-static int color_request_frame(AVFilterLink *link)
-{
-    ColorContext *color = link->src->priv;
-    AVFrame *frame = ff_get_video_buffer(link, color->w, color->h);
-
-    if (!frame)
-        return AVERROR(ENOMEM);
-
-    frame->sample_aspect_ratio = (AVRational) {1, 1};
-    frame->pts                 = color->pts++;
-
-    ff_draw_rectangle(frame->data, frame->linesize,
-                      color->line, color->line_step, color->hsub, color->vsub,
-                      0, 0, color->w, color->h);
-    return ff_filter_frame(link, frame);
-}
-
-#define OFFSET(x) offsetof(ColorContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "color",     "Output video color",                         OFFSET(color_str),     AV_OPT_TYPE_STRING, { .str = "black"   }, .flags = FLAGS },
-    { "size",      "Output video size (wxh or an abbreviation)", OFFSET(size_str),      AV_OPT_TYPE_STRING, { .str = "320x240" }, .flags = FLAGS },
-    { "framerate", "Output video framerate",                     OFFSET(framerate_str), AV_OPT_TYPE_STRING, { .str = "25"      }, .flags = FLAGS },
-    { NULL },
-};
-
-static const AVClass color_class = {
-    .class_name = "color",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vsrc_color_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .request_frame = color_request_frame,
-        .config_props  = color_config_props
-    },
-    { NULL }
-};
-
-AVFilter ff_vsrc_color = {
-    .name        = "color",
-    .description = NULL_IF_CONFIG_SMALL("Provide an uniformly colored input, syntax is: [color[:size[:rate]]]"),
-
-    .priv_class = &color_class,
-    .priv_size = sizeof(ColorContext),
-    .init      = color_init,
-    .uninit    = color_uninit,
-
-    .query_formats = query_formats,
-
-    .inputs    = NULL,
-
-    .outputs   = avfilter_vsrc_color_outputs,
-};
diff --git a/deps/libav/libavfilter/vsrc_movie.c b/deps/libav/libavfilter/vsrc_movie.c
deleted file mode 100644
index 502f360..0000000
--- a/deps/libav/libavfilter/vsrc_movie.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (c) 2010 Stefano Sabatini
- * Copyright (c) 2008 Victor Paesa
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * movie video source
- *
- * @todo use direct rendering (no allocation of a new frame)
- * @todo support a PTS correction mechanism
- * @todo support more than one output stream
- */
-
-#include <float.h>
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/avstring.h"
-#include "libavutil/opt.h"
-#include "libavutil/imgutils.h"
-#include "libavformat/avformat.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    const AVClass *class;
-    int64_t seek_point;   ///< seekpoint in microseconds
-    double seek_point_d;
-    char *format_name;
-    char *file_name;
-    int stream_index;
-
-    AVFormatContext *format_ctx;
-    AVCodecContext *codec_ctx;
-    int is_done;
-    AVFrame *frame;   ///< video frame to store the decoded images in
-
-    int w, h;
-} MovieContext;
-
-#define OFFSET(x) offsetof(MovieContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-
-static const AVOption movie_options[]= {
-    { "filename",     NULL,                      OFFSET(file_name),    AV_OPT_TYPE_STRING,                                    .flags = FLAGS },
-    { "format_name",  "set format name",         OFFSET(format_name),  AV_OPT_TYPE_STRING,                                    .flags = FLAGS },
-    { "f",            "set format name",         OFFSET(format_name),  AV_OPT_TYPE_STRING,                                    .flags = FLAGS },
-    { "stream_index", "set stream index",        OFFSET(stream_index), AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, INT_MAX,                 FLAGS  },
-    { "si",           "set stream index",        OFFSET(stream_index), AV_OPT_TYPE_INT,    { .i64 = -1 }, -1, INT_MAX,                 FLAGS  },
-    { "seek_point",   "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl =  0 },  0, (INT64_MAX-1) / 1000000, FLAGS },
-    { "sp",           "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl =  0 },  0, (INT64_MAX-1) / 1000000, FLAGS },
-    { NULL },
-};
-
-static const char *movie_get_name(void *ctx)
-{
-    return "movie";
-}
-
-static const AVClass movie_class = {
-    "MovieContext",
-    movie_get_name,
-    movie_options
-};
-
-static av_cold int movie_init(AVFilterContext *ctx)
-{
-    MovieContext *movie = ctx->priv;
-    AVInputFormat *iformat = NULL;
-    AVCodec *codec;
-    int ret;
-    int64_t timestamp;
-
-    av_register_all();
-
-    // Try to find the movie format (container)
-    iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
-
-    movie->format_ctx = NULL;
-    if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Failed to avformat_open_input '%s'\n", movie->file_name);
-        return ret;
-    }
-    if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)
-        av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
-
-    // if seeking requested, we execute it
-    if (movie->seek_point > 0) {
-        timestamp = movie->seek_point;
-        // add the stream start time, should it exist
-        if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
-            if (timestamp > INT64_MAX - movie->format_ctx->start_time) {
-                av_log(ctx, AV_LOG_ERROR,
-                       "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n",
-                       movie->file_name, movie->format_ctx->start_time, movie->seek_point);
-                return AVERROR(EINVAL);
-            }
-            timestamp += movie->format_ctx->start_time;
-        }
-        if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {
-            av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\n",
-                   movie->file_name, timestamp);
-            return ret;
-        }
-    }
-
-    /* select the video stream */
-    if ((ret = av_find_best_stream(movie->format_ctx, AVMEDIA_TYPE_VIDEO,
-                                   movie->stream_index, -1, NULL, 0)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "No video stream with index '%d' found\n",
-               movie->stream_index);
-        return ret;
-    }
-    movie->stream_index = ret;
-    movie->codec_ctx = movie->format_ctx->streams[movie->stream_index]->codec;
-
-    /*
-     * So now we've got a pointer to the so-called codec context for our video
-     * stream, but we still have to find the actual codec and open it.
-     */
-    codec = avcodec_find_decoder(movie->codec_ctx->codec_id);
-    if (!codec) {
-        av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\n");
-        return AVERROR(EINVAL);
-    }
-
-    movie->codec_ctx->refcounted_frames = 1;
-
-    if ((ret = avcodec_open2(movie->codec_ctx, codec, NULL)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n");
-        return ret;
-    }
-
-    movie->w = movie->codec_ctx->width;
-    movie->h = movie->codec_ctx->height;
-
-    av_log(ctx, AV_LOG_VERBOSE, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\n",
-           movie->seek_point, movie->format_name, movie->file_name,
-           movie->stream_index);
-
-    return 0;
-}
-
-static av_cold int init(AVFilterContext *ctx)
-{
-    MovieContext *movie = ctx->priv;
-
-    movie->seek_point = movie->seek_point_d * 1000000 + 0.5;
-
-    return movie_init(ctx);
-}
-
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    MovieContext *movie = ctx->priv;
-
-    if (movie->codec_ctx)
-        avcodec_close(movie->codec_ctx);
-    if (movie->format_ctx)
-        avformat_close_input(&movie->format_ctx);
-    av_frame_free(&movie->frame);
-}
-
-static int query_formats(AVFilterContext *ctx)
-{
-    MovieContext *movie = ctx->priv;
-    enum AVPixelFormat pix_fmts[] = { movie->codec_ctx->pix_fmt, AV_PIX_FMT_NONE };
-
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int config_output_props(AVFilterLink *outlink)
-{
-    MovieContext *movie = outlink->src->priv;
-
-    outlink->w = movie->w;
-    outlink->h = movie->h;
-    outlink->time_base = movie->format_ctx->streams[movie->stream_index]->time_base;
-
-    return 0;
-}
-
-static int movie_get_frame(AVFilterLink *outlink)
-{
-    MovieContext *movie = outlink->src->priv;
-    AVPacket pkt;
-    int ret, frame_decoded;
-    AVStream av_unused *st = movie->format_ctx->streams[movie->stream_index];
-
-    if (movie->is_done == 1)
-        return 0;
-
-    movie->frame = av_frame_alloc();
-    if (!movie->frame)
-        return AVERROR(ENOMEM);
-
-    while ((ret = av_read_frame(movie->format_ctx, &pkt)) >= 0) {
-        // Is this a packet from the video stream?
-        if (pkt.stream_index == movie->stream_index) {
-            avcodec_decode_video2(movie->codec_ctx, movie->frame, &frame_decoded, &pkt);
-
-            if (frame_decoded) {
-                if (movie->frame->pkt_pts != AV_NOPTS_VALUE)
-                    movie->frame->pts = movie->frame->pkt_pts;
-                av_dlog(outlink->src,
-                        "movie_get_frame(): file:'%s' pts:%"PRId64" time:%f aspect:%d/%d\n",
-                        movie->file_name, movie->frame->pts,
-                        (double)movie->frame->pts * av_q2d(st->time_base),
-                        movie->frame->sample_aspect_ratio.num,
-                        movie->frame->sample_aspect_ratio.den);
-                // We got it. Free the packet since we are returning
-                av_free_packet(&pkt);
-
-                return 0;
-            }
-        }
-        // Free the packet that was allocated by av_read_frame
-        av_free_packet(&pkt);
-    }
-
-    // On multi-frame source we should stop the mixing process when
-    // the movie source does not have more frames
-    if (ret == AVERROR_EOF)
-        movie->is_done = 1;
-    return ret;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    MovieContext *movie = outlink->src->priv;
-    int ret;
-
-    if (movie->is_done)
-        return AVERROR_EOF;
-    if ((ret = movie_get_frame(outlink)) < 0)
-        return ret;
-
-    ret = ff_filter_frame(outlink, movie->frame);
-    movie->frame = NULL;
-
-    return ret;
-}
-
-static const AVFilterPad avfilter_vsrc_movie_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .request_frame = request_frame,
-        .config_props  = config_output_props,
-    },
-    { NULL }
-};
-
-AVFilter ff_vsrc_movie = {
-    .name          = "movie",
-    .description   = NULL_IF_CONFIG_SMALL("Read from a movie source."),
-    .priv_size     = sizeof(MovieContext),
-    .priv_class    = &movie_class,
-    .init          = init,
-    .uninit        = uninit,
-    .query_formats = query_formats,
-
-    .inputs    = NULL,
-    .outputs   = avfilter_vsrc_movie_outputs,
-};
diff --git a/deps/libav/libavfilter/vsrc_nullsrc.c b/deps/libav/libavfilter/vsrc_nullsrc.c
deleted file mode 100644
index f7766fa..0000000
--- a/deps/libav/libavfilter/vsrc_nullsrc.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * null video source
- */
-
-#include <stdio.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/eval.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-
-static const char *const var_names[] = {
-    "E",
-    "PHI",
-    "PI",
-    "AVTB",   /* default timebase 1/AV_TIME_BASE */
-    NULL
-};
-
-enum var_name {
-    VAR_E,
-    VAR_PHI,
-    VAR_PI,
-    VAR_AVTB,
-    VAR_VARS_NB
-};
-
-typedef struct {
-    const AVClass *class;
-    int w, h;
-    char *tb_expr;
-    double var_values[VAR_VARS_NB];
-} NullContext;
-
-static int config_props(AVFilterLink *outlink)
-{
-    AVFilterContext *ctx = outlink->src;
-    NullContext *priv = ctx->priv;
-    AVRational tb;
-    int ret;
-    double res;
-
-    priv->var_values[VAR_E]    = M_E;
-    priv->var_values[VAR_PHI]  = M_PHI;
-    priv->var_values[VAR_PI]   = M_PI;
-    priv->var_values[VAR_AVTB] = av_q2d(AV_TIME_BASE_Q);
-
-    if ((ret = av_expr_parse_and_eval(&res, priv->tb_expr, var_names, priv->var_values,
-                                      NULL, NULL, NULL, NULL, NULL, 0, NULL)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid expression '%s' for timebase.\n", priv->tb_expr);
-        return ret;
-    }
-    tb = av_d2q(res, INT_MAX);
-    if (tb.num <= 0 || tb.den <= 0) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid non-positive value for the timebase %d/%d.\n",
-               tb.num, tb.den);
-        return AVERROR(EINVAL);
-    }
-
-    outlink->w = priv->w;
-    outlink->h = priv->h;
-    outlink->time_base = tb;
-
-    av_log(outlink->src, AV_LOG_VERBOSE, "w:%d h:%d tb:%d/%d\n", priv->w, priv->h,
-           tb.num, tb.den);
-
-    return 0;
-}
-
-static int request_frame(AVFilterLink *link)
-{
-    return -1;
-}
-
-#define OFFSET(x) offsetof(NullContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
-    { "width",    NULL, OFFSET(w),       AV_OPT_TYPE_INT,    { .i64 = 352    }, 1, INT_MAX, FLAGS },
-    { "height",   NULL, OFFSET(h),       AV_OPT_TYPE_INT,    { .i64 = 288    }, 1, INT_MAX, FLAGS },
-    { "timebase", NULL, OFFSET(tb_expr), AV_OPT_TYPE_STRING, { .str = "AVTB" }, 0, 0,      FLAGS },
-    { NULL },
-};
-
-static const AVClass nullsrc_class = {
-    .class_name = "nullsrc",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVFilterPad avfilter_vsrc_nullsrc_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .config_props  = config_props,
-        .request_frame = request_frame,
-    },
-    { NULL }
-};
-
-AVFilter ff_vsrc_nullsrc = {
-    .name        = "nullsrc",
-    .description = NULL_IF_CONFIG_SMALL("Null video source, never return images."),
-
-    .priv_size = sizeof(NullContext),
-    .priv_class = &nullsrc_class,
-
-    .inputs    = NULL,
-
-    .outputs   = avfilter_vsrc_nullsrc_outputs,
-};
diff --git a/deps/libav/libavfilter/vsrc_testsrc.c b/deps/libav/libavfilter/vsrc_testsrc.c
deleted file mode 100644
index 9e12852..0000000
--- a/deps/libav/libavfilter/vsrc_testsrc.c
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- * Copyright (c) 2007 Nicolas George <nicolas.george at normalesup.org>
- * Copyright (c) 2011 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Misc test sources.
- *
- * testsrc is based on the test pattern generator demuxer by Nicolas George:
- * http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2007-October/037845.html
- *
- * rgbtestsrc is ported from MPlayer libmpcodecs/vf_rgbtest.c by
- * Michael Niedermayer.
- */
-
-#include <float.h>
-
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/parseutils.h"
-#include "avfilter.h"
-#include "formats.h"
-#include "internal.h"
-#include "video.h"
-
-typedef struct {
-    const AVClass *class;
-    int h, w;
-    unsigned int nb_frame;
-    AVRational time_base;
-    int64_t pts, max_pts;
-    char *size;                 ///< video frame size
-    char *rate;                 ///< video frame rate
-    char *duration;             ///< total duration of the generated video
-    AVRational sar;             ///< sample aspect ratio
-
-    void (* fill_picture_fn)(AVFilterContext *ctx, AVFrame *frame);
-
-    /* only used by rgbtest */
-    int rgba_map[4];
-} TestSourceContext;
-
-#define OFFSET(x) offsetof(TestSourceContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
-
-static const AVOption testsrc_options[] = {
-    { "size",     "set video size",     OFFSET(size),     AV_OPT_TYPE_STRING, {.str = "320x240"},     .flags = FLAGS },
-    { "s",        "set video size",     OFFSET(size),     AV_OPT_TYPE_STRING, {.str = "320x240"},     .flags = FLAGS },
-    { "rate",     "set video rate",     OFFSET(rate),     AV_OPT_TYPE_STRING, {.str = "25"},          .flags = FLAGS },
-    { "r",        "set video rate",     OFFSET(rate),     AV_OPT_TYPE_STRING, {.str = "25"},          .flags = FLAGS },
-    { "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL},          .flags = FLAGS },
-    { "sar",      "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl = 1},  0, INT_MAX, FLAGS },
-    { NULL },
-};
-
-static av_cold int init_common(AVFilterContext *ctx)
-{
-    TestSourceContext *test = ctx->priv;
-    AVRational frame_rate_q;
-    int64_t duration = -1;
-    int ret = 0;
-
-    if ((ret = av_parse_video_size(&test->w, &test->h, test->size)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid frame size: '%s'\n", test->size);
-        return ret;
-    }
-
-    if ((ret = av_parse_video_rate(&frame_rate_q, test->rate)) < 0 ||
-        frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'\n", test->rate);
-        return ret;
-    }
-
-    if ((test->duration) && (ret = av_parse_time(&duration, test->duration, 1)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid duration: '%s'\n", test->duration);
-        return ret;
-    }
-
-    test->time_base.num = frame_rate_q.den;
-    test->time_base.den = frame_rate_q.num;
-    test->max_pts = duration >= 0 ?
-        av_rescale_q(duration, AV_TIME_BASE_Q, test->time_base) : -1;
-    test->nb_frame = 0;
-    test->pts = 0;
-
-    av_log(ctx, AV_LOG_DEBUG, "size:%dx%d rate:%d/%d duration:%f sar:%d/%d\n",
-           test->w, test->h, frame_rate_q.num, frame_rate_q.den,
-           duration < 0 ? -1 : test->max_pts * av_q2d(test->time_base),
-           test->sar.num, test->sar.den);
-    return 0;
-}
-
-static int config_props(AVFilterLink *outlink)
-{
-    TestSourceContext *test = outlink->src->priv;
-
-    outlink->w = test->w;
-    outlink->h = test->h;
-    outlink->sample_aspect_ratio = test->sar;
-    outlink->time_base = test->time_base;
-
-    return 0;
-}
-
-static int request_frame(AVFilterLink *outlink)
-{
-    TestSourceContext *test = outlink->src->priv;
-    AVFrame *frame;
-
-    if (test->max_pts >= 0 && test->pts > test->max_pts)
-        return AVERROR_EOF;
-    frame = ff_get_video_buffer(outlink, test->w, test->h);
-    if (!frame)
-        return AVERROR(ENOMEM);
-
-    frame->pts                 = test->pts++;
-    frame->key_frame           = 1;
-    frame->interlaced_frame    = 0;
-    frame->pict_type           = AV_PICTURE_TYPE_I;
-    frame->sample_aspect_ratio = test->sar;
-    test->nb_frame++;
-    test->fill_picture_fn(outlink->src, frame);
-
-    return ff_filter_frame(outlink, frame);
-}
-
-#if CONFIG_TESTSRC_FILTER
-
-static const char *testsrc_get_name(void *ctx)
-{
-    return "testsrc";
-}
-
-static const AVClass testsrc_class = {
-    .class_name = "TestSourceContext",
-    .item_name  = testsrc_get_name,
-    .option     = testsrc_options,
-};
-
-/**
- * Fill a rectangle with value val.
- *
- * @param val the RGB value to set
- * @param dst pointer to the destination buffer to fill
- * @param dst_linesize linesize of destination
- * @param segment_width width of the segment
- * @param x horizontal coordinate where to draw the rectangle in the destination buffer
- * @param y horizontal coordinate where to draw the rectangle in the destination buffer
- * @param w width  of the rectangle to draw, expressed as a number of segment_width units
- * @param h height of the rectangle to draw, expressed as a number of segment_width units
- */
-static void draw_rectangle(unsigned val, uint8_t *dst, int dst_linesize, unsigned segment_width,
-                           unsigned x, unsigned y, unsigned w, unsigned h)
-{
-    int i;
-    int step = 3;
-
-    dst += segment_width * (step * x + y * dst_linesize);
-    w *= segment_width * step;
-    h *= segment_width;
-    for (i = 0; i < h; i++) {
-        memset(dst, val, w);
-        dst += dst_linesize;
-    }
-}
-
-static void draw_digit(int digit, uint8_t *dst, unsigned dst_linesize,
-                       unsigned segment_width)
-{
-#define TOP_HBAR        1
-#define MID_HBAR        2
-#define BOT_HBAR        4
-#define LEFT_TOP_VBAR   8
-#define LEFT_BOT_VBAR  16
-#define RIGHT_TOP_VBAR 32
-#define RIGHT_BOT_VBAR 64
-    struct {
-        int x, y, w, h;
-    } segments[] = {
-        { 1,  0, 5, 1 }, /* TOP_HBAR */
-        { 1,  6, 5, 1 }, /* MID_HBAR */
-        { 1, 12, 5, 1 }, /* BOT_HBAR */
-        { 0,  1, 1, 5 }, /* LEFT_TOP_VBAR */
-        { 0,  7, 1, 5 }, /* LEFT_BOT_VBAR */
-        { 6,  1, 1, 5 }, /* RIGHT_TOP_VBAR */
-        { 6,  7, 1, 5 }  /* RIGHT_BOT_VBAR */
-    };
-    static const unsigned char masks[10] = {
-        /* 0 */ TOP_HBAR         |BOT_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
-        /* 1 */                                                        RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
-        /* 2 */ TOP_HBAR|MID_HBAR|BOT_HBAR|LEFT_BOT_VBAR                             |RIGHT_TOP_VBAR,
-        /* 3 */ TOP_HBAR|MID_HBAR|BOT_HBAR                            |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
-        /* 4 */          MID_HBAR         |LEFT_TOP_VBAR              |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
-        /* 5 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR                             |RIGHT_BOT_VBAR,
-        /* 6 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR               |RIGHT_BOT_VBAR,
-        /* 7 */ TOP_HBAR                                              |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
-        /* 8 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
-        /* 9 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR              |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
-    };
-    unsigned mask = masks[digit];
-    int i;
-
-    draw_rectangle(0, dst, dst_linesize, segment_width, 0, 0, 8, 13);
-    for (i = 0; i < FF_ARRAY_ELEMS(segments); i++)
-        if (mask & (1<<i))
-            draw_rectangle(255, dst, dst_linesize, segment_width,
-                           segments[i].x, segments[i].y, segments[i].w, segments[i].h);
-}
-
-#define GRADIENT_SIZE (6 * 256)
-
-static void test_fill_picture(AVFilterContext *ctx, AVFrame *frame)
-{
-    TestSourceContext *test = ctx->priv;
-    uint8_t *p, *p0;
-    int x, y;
-    int color, color_rest;
-    int icolor;
-    int radius;
-    int quad0, quad;
-    int dquad_x, dquad_y;
-    int grad, dgrad, rgrad, drgrad;
-    int seg_size;
-    int second;
-    int i;
-    uint8_t *data = frame->data[0];
-    int width  = frame->width;
-    int height = frame->height;
-
-    /* draw colored bars and circle */
-    radius = (width + height) / 4;
-    quad0 = width * width / 4 + height * height / 4 - radius * radius;
-    dquad_y = 1 - height;
-    p0 = data;
-    for (y = 0; y < height; y++) {
-        p = p0;
-        color = 0;
-        color_rest = 0;
-        quad = quad0;
-        dquad_x = 1 - width;
-        for (x = 0; x < width; x++) {
-            icolor = color;
-            if (quad < 0)
-                icolor ^= 7;
-            quad += dquad_x;
-            dquad_x += 2;
-            *(p++) = icolor & 1 ? 255 : 0;
-            *(p++) = icolor & 2 ? 255 : 0;
-            *(p++) = icolor & 4 ? 255 : 0;
-            color_rest += 8;
-            if (color_rest >= width) {
-                color_rest -= width;
-                color++;
-            }
-        }
-        quad0 += dquad_y;
-        dquad_y += 2;
-        p0 += frame->linesize[0];
-    }
-
-    /* draw sliding color line */
-    p = data + frame->linesize[0] * height * 3/4;
-    grad = (256 * test->nb_frame * test->time_base.num / test->time_base.den) %
-        GRADIENT_SIZE;
-    rgrad = 0;
-    dgrad = GRADIENT_SIZE / width;
-    drgrad = GRADIENT_SIZE % width;
-    for (x = 0; x < width; x++) {
-        *(p++) =
-            grad < 256 || grad >= 5 * 256 ? 255 :
-            grad >= 2 * 256 && grad < 4 * 256 ? 0 :
-            grad < 2 * 256 ? 2 * 256 - 1 - grad : grad - 4 * 256;
-        *(p++) =
-            grad >= 4 * 256 ? 0 :
-            grad >= 1 * 256 && grad < 3 * 256 ? 255 :
-            grad < 1 * 256 ? grad : 4 * 256 - 1 - grad;
-        *(p++) =
-            grad < 2 * 256 ? 0 :
-            grad >= 3 * 256 && grad < 5 * 256 ? 255 :
-            grad < 3 * 256 ? grad - 2 * 256 : 6 * 256 - 1 - grad;
-        grad += dgrad;
-        rgrad += drgrad;
-        if (rgrad >= GRADIENT_SIZE) {
-            grad++;
-            rgrad -= GRADIENT_SIZE;
-        }
-        if (grad >= GRADIENT_SIZE)
-            grad -= GRADIENT_SIZE;
-    }
-    for (y = height / 8; y > 0; y--) {
-        memcpy(p, p - frame->linesize[0], 3 * width);
-        p += frame->linesize[0];
-    }
-
-    /* draw digits */
-    seg_size = width / 80;
-    if (seg_size >= 1 && height >= 13 * seg_size) {
-        second = test->nb_frame * test->time_base.num / test->time_base.den;
-        x = width - (width - seg_size * 64) / 2;
-        y = (height - seg_size * 13) / 2;
-        p = data + (x*3 + y * frame->linesize[0]);
-        for (i = 0; i < 8; i++) {
-            p -= 3 * 8 * seg_size;
-            draw_digit(second % 10, p, frame->linesize[0], seg_size);
-            second /= 10;
-            if (second == 0)
-                break;
-        }
-    }
-}
-
-static av_cold int test_init(AVFilterContext *ctx)
-{
-    TestSourceContext *test = ctx->priv;
-
-    test->fill_picture_fn = test_fill_picture;
-    return init_common(ctx);
-}
-
-static int test_query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE
-    };
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static const AVFilterPad avfilter_vsrc_testsrc_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .request_frame = request_frame,
-        .config_props  = config_props,
-    },
-    { NULL }
-};
-
-AVFilter ff_vsrc_testsrc = {
-    .name          = "testsrc",
-    .description   = NULL_IF_CONFIG_SMALL("Generate test pattern."),
-    .priv_size     = sizeof(TestSourceContext),
-    .priv_class    = &testsrc_class,
-    .init          = test_init,
-
-    .query_formats = test_query_formats,
-
-    .inputs    = NULL,
-
-    .outputs   = avfilter_vsrc_testsrc_outputs,
-};
-
-#endif /* CONFIG_TESTSRC_FILTER */
-
-#if CONFIG_RGBTESTSRC_FILTER
-
-static const char *rgbtestsrc_get_name(void *ctx)
-{
-    return "rgbtestsrc";
-}
-
-static const AVClass rgbtestsrc_class = {
-    .class_name = "RGBTestSourceContext",
-    .item_name  = rgbtestsrc_get_name,
-    .option     = testsrc_options,
-};
-
-#define R 0
-#define G 1
-#define B 2
-#define A 3
-
-static void rgbtest_put_pixel(uint8_t *dst, int dst_linesize,
-                              int x, int y, int r, int g, int b, enum AVPixelFormat fmt,
-                              int rgba_map[4])
-{
-    int32_t v;
-    uint8_t *p;
-
-    switch (fmt) {
-    case AV_PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break;
-    case AV_PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break;
-    case AV_PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break;
-    case AV_PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break;
-    case AV_PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break;
-    case AV_PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break;
-    case AV_PIX_FMT_RGB24:
-    case AV_PIX_FMT_BGR24:
-        v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));
-        p = dst + 3*x + y*dst_linesize;
-        AV_WL24(p, v);
-        break;
-    case AV_PIX_FMT_RGBA:
-    case AV_PIX_FMT_BGRA:
-    case AV_PIX_FMT_ARGB:
-    case AV_PIX_FMT_ABGR:
-        v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));
-        p = dst + 4*x + y*dst_linesize;
-        AV_WL32(p, v);
-        break;
-    }
-}
-
-static void rgbtest_fill_picture(AVFilterContext *ctx, AVFrame *frame)
-{
-    TestSourceContext *test = ctx->priv;
-    int x, y, w = frame->width, h = frame->height;
-
-    for (y = 0; y < h; y++) {
-         for (x = 0; x < w; x++) {
-             int c = 256*x/w;
-             int r = 0, g = 0, b = 0;
-
-             if      (3*y < h  ) r = c;
-             else if (3*y < 2*h) g = c;
-             else                b = c;
-
-             rgbtest_put_pixel(frame->data[0], frame->linesize[0], x, y, r, g, b,
-                               ctx->outputs[0]->format, test->rgba_map);
-         }
-     }
-}
-
-static av_cold int rgbtest_init(AVFilterContext *ctx)
-{
-    TestSourceContext *test = ctx->priv;
-
-    test->fill_picture_fn = rgbtest_fill_picture;
-    return init_common(ctx);
-}
-
-static int rgbtest_query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_RGBA, AV_PIX_FMT_ARGB, AV_PIX_FMT_BGRA, AV_PIX_FMT_ABGR,
-        AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24,
-        AV_PIX_FMT_RGB444, AV_PIX_FMT_BGR444,
-        AV_PIX_FMT_RGB565, AV_PIX_FMT_BGR565,
-        AV_PIX_FMT_RGB555, AV_PIX_FMT_BGR555,
-        AV_PIX_FMT_NONE
-    };
-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-    return 0;
-}
-
-static int rgbtest_config_props(AVFilterLink *outlink)
-{
-    TestSourceContext *test = outlink->src->priv;
-
-    switch (outlink->format) {
-    case AV_PIX_FMT_ARGB:  test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break;
-    case AV_PIX_FMT_ABGR:  test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break;
-    case AV_PIX_FMT_RGBA:
-    case AV_PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break;
-    case AV_PIX_FMT_BGRA:
-    case AV_PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break;
-    }
-
-    return config_props(outlink);
-}
-
-static const AVFilterPad avfilter_vsrc_rgbtestsrc_outputs[] = {
-    {
-        .name          = "default",
-        .type          = AVMEDIA_TYPE_VIDEO,
-        .request_frame = request_frame,
-        .config_props  = rgbtest_config_props,
-    },
-    { NULL }
-};
-
-AVFilter ff_vsrc_rgbtestsrc = {
-    .name          = "rgbtestsrc",
-    .description   = NULL_IF_CONFIG_SMALL("Generate RGB test pattern."),
-    .priv_size     = sizeof(TestSourceContext),
-    .priv_class    = &rgbtestsrc_class,
-    .init          = rgbtest_init,
-
-    .query_formats = rgbtest_query_formats,
-
-    .inputs    = NULL,
-
-    .outputs   = avfilter_vsrc_rgbtestsrc_outputs,
-};
-
-#endif /* CONFIG_RGBTESTSRC_FILTER */
diff --git a/deps/libav/libavfilter/x86/Makefile b/deps/libav/libavfilter/x86/Makefile
deleted file mode 100644
index 16b1307..0000000
--- a/deps/libav/libavfilter/x86/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-OBJS-$(CONFIG_GRADFUN_FILTER)                += x86/vf_gradfun_init.o
-OBJS-$(CONFIG_HQDN3D_FILTER)                 += x86/vf_hqdn3d_init.o
-OBJS-$(CONFIG_VOLUME_FILTER)                 += x86/af_volume_init.o
-OBJS-$(CONFIG_YADIF_FILTER)                  += x86/vf_yadif_init.o
-
-YASM-OBJS-$(CONFIG_GRADFUN_FILTER)           += x86/vf_gradfun.o
-YASM-OBJS-$(CONFIG_HQDN3D_FILTER)            += x86/vf_hqdn3d.o
-YASM-OBJS-$(CONFIG_VOLUME_FILTER)            += x86/af_volume.o
-YASM-OBJS-$(CONFIG_YADIF_FILTER)             += x86/vf_yadif.o
diff --git a/deps/libav/libavfilter/x86/af_volume.asm b/deps/libav/libavfilter/x86/af_volume.asm
deleted file mode 100644
index 4e5ad22..0000000
--- a/deps/libav/libavfilter/x86/af_volume.asm
+++ /dev/null
@@ -1,138 +0,0 @@
-;*****************************************************************************
-;* x86-optimized functions for volume filter
-;* Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA 32
-
-pd_1_256:     times 4 dq 0x3F70000000000000
-pd_int32_max: times 4 dq 0x41DFFFFFFFC00000
-pw_1:         times 8 dw 1
-pw_128:       times 8 dw 128
-pq_128:       times 2 dq 128
-
-SECTION_TEXT
-
-;------------------------------------------------------------------------------
-; void ff_scale_samples_s16(uint8_t *dst, const uint8_t *src, int len,
-;                           int volume)
-;------------------------------------------------------------------------------
-
-INIT_XMM sse2
-cglobal scale_samples_s16, 4,4,4, dst, src, len, volume
-    movd        m0, volumem
-    pshuflw     m0, m0, 0
-    punpcklwd   m0, [pw_1]
-    mova        m1, [pw_128]
-    lea       lenq, [lend*2-mmsize]
-.loop:
-    ; dst[i] = av_clip_int16((src[i] * volume + 128) >> 8);
-    mova        m2, [srcq+lenq]
-    punpcklwd   m3, m2, m1
-    punpckhwd   m2, m1
-    pmaddwd     m3, m0
-    pmaddwd     m2, m0
-    psrad       m3, 8
-    psrad       m2, 8
-    packssdw    m3, m2
-    mova  [dstq+lenq], m3
-    sub       lenq, mmsize
-    jge .loop
-    REP_RET
-
-;------------------------------------------------------------------------------
-; void ff_scale_samples_s32(uint8_t *dst, const uint8_t *src, int len,
-;                           int volume)
-;------------------------------------------------------------------------------
-
-%macro SCALE_SAMPLES_S32 0
-cglobal scale_samples_s32, 4,4,4, dst, src, len, volume
-%if ARCH_X86_32 && cpuflag(avx)
-    vbroadcastss   xmm2, volumem
-%else
-    movd           xmm2, volumed
-    pshufd         xmm2, xmm2, 0
-%endif
-    CVTDQ2PD         m2, xmm2
-    mulpd            m2, m2, [pd_1_256]
-    mova             m3, [pd_int32_max]
-    lea            lenq, [lend*4-mmsize]
-.loop:
-    CVTDQ2PD         m0, [srcq+lenq         ]
-    CVTDQ2PD         m1, [srcq+lenq+mmsize/2]
-    mulpd            m0, m0, m2
-    mulpd            m1, m1, m2
-    minpd            m0, m0, m3
-    minpd            m1, m1, m3
-    cvtpd2dq       xmm0, m0
-    cvtpd2dq       xmm1, m1
-%if cpuflag(avx)
-    vmovdqa [dstq+lenq         ], xmm0
-    vmovdqa [dstq+lenq+mmsize/2], xmm1
-%else
-    movq    [dstq+lenq         ], xmm0
-    movq    [dstq+lenq+mmsize/2], xmm1
-%endif
-    sub            lenq, mmsize
-    jge .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-%define CVTDQ2PD cvtdq2pd
-SCALE_SAMPLES_S32
-%define CVTDQ2PD vcvtdq2pd
-INIT_YMM avx
-SCALE_SAMPLES_S32
-%undef CVTDQ2PD
-
-; NOTE: This is not bit-identical with the C version because it clips to
-;       [-INT_MAX, INT_MAX] instead of [INT_MIN, INT_MAX]
-
-INIT_XMM ssse3, atom
-cglobal scale_samples_s32, 4,4,8, dst, src, len, volume
-    movd        m4, volumem
-    pshufd      m4, m4, 0
-    mova        m5, [pq_128]
-    pxor        m6, m6
-    lea       lenq, [lend*4-mmsize]
-.loop:
-    ; src[i] = av_clipl_int32((src[i] * volume + 128) >> 8);
-    mova        m7, [srcq+lenq]
-    pabsd       m3, m7
-    pshufd      m0, m3, q0100
-    pshufd      m1, m3, q0302
-    pmuludq     m0, m4
-    pmuludq     m1, m4
-    paddq       m0, m5
-    paddq       m1, m5
-    psrlq       m0, 7
-    psrlq       m1, 7
-    shufps      m2, m0, m1, q3131
-    shufps      m0, m0, m1, q2020
-    pcmpgtd     m2, m6
-    por         m0, m2
-    psrld       m0, 1
-    psignd      m0, m7
-    mova  [dstq+lenq], m0
-    sub       lenq, mmsize
-    jge .loop
-    REP_RET
diff --git a/deps/libav/libavfilter/x86/af_volume_init.c b/deps/libav/libavfilter/x86/af_volume_init.c
deleted file mode 100644
index c59e0ed..0000000
--- a/deps/libav/libavfilter/x86/af_volume_init.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/samplefmt.h"
-#include "libavutil/x86/cpu.h"
-#include "libavfilter/af_volume.h"
-
-void ff_scale_samples_s16_sse2(uint8_t *dst, const uint8_t *src, int len,
-                               int volume);
-
-void ff_scale_samples_s32_sse2(uint8_t *dst, const uint8_t *src, int len,
-                               int volume);
-void ff_scale_samples_s32_ssse3_atom(uint8_t *dst, const uint8_t *src, int len,
-                                     int volume);
-void ff_scale_samples_s32_avx(uint8_t *dst, const uint8_t *src, int len,
-                              int volume);
-
-av_cold void ff_volume_init_x86(VolumeContext *vol)
-{
-    int cpu_flags = av_get_cpu_flags();
-    enum AVSampleFormat sample_fmt = av_get_packed_sample_fmt(vol->sample_fmt);
-
-    if (sample_fmt == AV_SAMPLE_FMT_S16) {
-        if (EXTERNAL_SSE2(cpu_flags) && vol->volume_i < 32768) {
-            vol->scale_samples = ff_scale_samples_s16_sse2;
-            vol->samples_align = 8;
-        }
-    } else if (sample_fmt == AV_SAMPLE_FMT_S32) {
-        if (EXTERNAL_SSE2(cpu_flags)) {
-            vol->scale_samples = ff_scale_samples_s32_sse2;
-            vol->samples_align = 4;
-        }
-        if (EXTERNAL_SSSE3(cpu_flags) && cpu_flags & AV_CPU_FLAG_ATOM) {
-            vol->scale_samples = ff_scale_samples_s32_ssse3_atom;
-            vol->samples_align = 4;
-        }
-        if (EXTERNAL_AVX(cpu_flags)) {
-            vol->scale_samples = ff_scale_samples_s32_avx;
-            vol->samples_align = 8;
-        }
-    }
-}
diff --git a/deps/libav/libavfilter/x86/vf_gradfun.asm b/deps/libav/libavfilter/x86/vf_gradfun.asm
deleted file mode 100644
index 00fcb16..0000000
--- a/deps/libav/libavfilter/x86/vf_gradfun.asm
+++ /dev/null
@@ -1,110 +0,0 @@
-;******************************************************************************
-;* x86-optimized functions for gradfun filter
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-pw_7f: times 8 dw 0x7F
-pw_ff: times 8 dw 0xFF
-
-SECTION .text
-
-%macro FILTER_LINE 1
-    movh       m0, [r2+r0]
-    movh       m1, [r3+r0]
-    punpcklbw  m0, m7
-    punpcklwd  m1, m1
-    psllw      m0, 7
-    psubw      m1, m0
-    PABSW      m2, m1
-    pmulhuw    m2, m5
-    psubw      m2, m6
-    pminsw     m2, m7
-    pmullw     m2, m2
-    psllw      m1, 2
-    paddw      m0, %1
-    pmulhw     m1, m2
-    paddw      m0, m1
-    psraw      m0, 7
-    packuswb   m0, m0
-    movh  [r1+r0], m0
-%endmacro
-
-INIT_MMX mmxext
-cglobal gradfun_filter_line, 6, 6
-    movh      m5, r4d
-    pxor      m7, m7
-    pshufw    m5, m5,0
-    mova      m6, [pw_7f]
-    mova      m3, [r5]
-    mova      m4, [r5+8]
-.loop:
-    FILTER_LINE m3
-    add       r0, 4
-    jge .end
-    FILTER_LINE m4
-    add       r0, 4
-    jl .loop
-.end:
-    REP_RET
-
-INIT_XMM ssse3
-cglobal gradfun_filter_line, 6, 6, 8
-    movd       m5, r4d
-    pxor       m7, m7
-    pshuflw    m5, m5, 0
-    mova       m6, [pw_7f]
-    punpcklqdq m5, m5
-    mova       m4, [r5]
-.loop:
-    FILTER_LINE m4
-    add        r0, 8
-    jl .loop
-    REP_RET
-
-%macro BLUR_LINE 1
-cglobal gradfun_blur_line_%1, 6, 6, 8
-    mova        m7, [pw_ff]
-.loop:
-    %1          m0, [r4+r0]
-    %1          m1, [r5+r0]
-    mova        m2, m0
-    mova        m3, m1
-    psrlw       m0, 8
-    psrlw       m1, 8
-    pand        m2, m7
-    pand        m3, m7
-    paddw       m0, m1
-    paddw       m2, m3
-    paddw       m0, m2
-    paddw       m0, [r2+r0]
-    mova        m1, [r1+r0]
-    mova   [r1+r0], m0
-    psubw       m0, m1
-    mova   [r3+r0], m0
-    add         r0, 16
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-BLUR_LINE movdqa
-BLUR_LINE movdqu
diff --git a/deps/libav/libavfilter/x86/vf_gradfun_init.c b/deps/libav/libavfilter/x86/vf_gradfun_init.c
deleted file mode 100644
index 3f23bf6..0000000
--- a/deps/libav/libavfilter/x86/vf_gradfun_init.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2009 Loren Merritt <lorenm at u.washington.edu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavfilter/gradfun.h"
-
-void ff_gradfun_filter_line_mmxext(intptr_t x, uint8_t *dst, uint8_t *src,
-                                   uint16_t *dc, int thresh,
-                                   const uint16_t *dithers);
-
-void ff_gradfun_filter_line_ssse3(intptr_t x, uint8_t *dst, uint8_t *src,
-                                  uint16_t *dc, int thresh,
-                                  const uint16_t *dithers);
-
-void ff_gradfun_blur_line_movdqa_sse2(intptr_t x, uint16_t *buf,
-                                      uint16_t *buf1, uint16_t *dc,
-                                      uint8_t *src1, uint8_t *src2);
-void ff_gradfun_blur_line_movdqu_sse2(intptr_t x, uint16_t *buf,
-                                      uint16_t *buf1, uint16_t *dc,
-                                      uint8_t *src1, uint8_t *src2);
-
-#if HAVE_YASM
-static void gradfun_filter_line(uint8_t *dst, uint8_t *src, uint16_t *dc,
-                                int width, int thresh, const uint16_t *dithers,
-                                int alignment)
-{
-    intptr_t x;
-    if (width & alignment) {
-        x = width & ~alignment;
-        ff_gradfun_filter_line_c(dst + x, src + x, dc + x / 2,
-                                 width - x, thresh, dithers);
-        width = x;
-    }
-    x = -width;
-    ff_gradfun_filter_line_mmxext(x, dst + width, src + width, dc + width / 2,
-                                  thresh, dithers);
-}
-
-static void gradfun_filter_line_mmxext(uint8_t *dst, uint8_t *src, uint16_t *dc,
-                                       int width, int thresh,
-                                       const uint16_t *dithers)
-{
-    gradfun_filter_line(dst, src, dc, width, thresh, dithers, 3);
-}
-
-static void gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc,
-                                      int width, int thresh,
-                                      const uint16_t *dithers)
-{
-    gradfun_filter_line(dst, src, dc, width, thresh, dithers, 7);
-}
-
-static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1,
-                                   uint8_t *src, int src_linesize, int width)
-{
-    intptr_t x = -2 * width;
-    if (((intptr_t) src | src_linesize) & 15)
-        ff_gradfun_blur_line_movdqu_sse2(x, buf + width, buf1 + width,
-                                         dc + width, src + width * 2,
-                                         src + width * 2 + src_linesize);
-    else
-        ff_gradfun_blur_line_movdqa_sse2(x, buf + width, buf1 + width,
-                                         dc + width, src + width * 2,
-                                         src + width * 2 + src_linesize);
-}
-#endif /* HAVE_YASM */
-
-av_cold void ff_gradfun_init_x86(GradFunContext *gf)
-{
-#if HAVE_YASM
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_MMXEXT(cpu_flags))
-        gf->filter_line = gradfun_filter_line_mmxext;
-    if (EXTERNAL_SSSE3(cpu_flags))
-        gf->filter_line = gradfun_filter_line_ssse3;
-
-    if (EXTERNAL_SSE2(cpu_flags))
-        gf->blur_line = gradfun_blur_line_sse2;
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavfilter/x86/vf_hqdn3d.asm b/deps/libav/libavfilter/x86/vf_hqdn3d.asm
deleted file mode 100644
index 02632a1..0000000
--- a/deps/libav/libavfilter/x86/vf_hqdn3d.asm
+++ /dev/null
@@ -1,106 +0,0 @@
-;******************************************************************************
-;* Copyright (c) 2012 Loren Merritt
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION .text
-
-%macro LOWPASS 3 ; prevsample, cursample, lut
-    sub    %1q, %2q
-%if lut_bits != 8
-    sar    %1q, 8-lut_bits
-%endif
-    movsx  %1d, word [%3q+%1q*2]
-    add    %1d, %2d
-%endmacro
-
-%macro LOAD 3 ; dstreg, x, bitdepth
-%if %3 == 8
-    movzx  %1, byte [srcq+%2]
-%else
-    movzx  %1, word [srcq+(%2)*2]
-%endif
-%if %3 != 16
-    shl    %1, 16-%3
-    add    %1, (1<<(15-%3))-1
-%endif
-%endmacro
-
-%macro HQDN3D_ROW 1 ; bitdepth
-%if ARCH_X86_64
-cglobal hqdn3d_row_%1_x86, 7,10,0, src, dst, lineant, frameant, width, spatial, temporal, pixelant, t0, t1
-%else
-cglobal hqdn3d_row_%1_x86, 7,7,0, src, dst, lineant, frameant, width, spatial, temporal
-%endif
-    %assign bytedepth (%1+7)>>3
-    %assign lut_bits 4+4*(%1/16)
-    dec    widthq
-    lea    srcq, [srcq+widthq*bytedepth]
-    lea    dstq, [dstq+widthq*bytedepth]
-    lea    frameantq, [frameantq+widthq*2]
-    lea    lineantq,  [lineantq+widthq*2]
-    neg    widthq
-    %define xq widthq
-%if ARCH_X86_32
-    mov    dstmp, dstq
-    mov    srcmp, srcq
-    mov    frameantmp, frameantq
-    mov    lineantmp,  lineantq
-    %define dstq r0
-    %define frameantq r0
-    %define lineantq  r0
-    %define pixelantq r1
-    %define pixelantd r1d
-    DECLARE_REG_TMP 2,3
-%endif
-    LOAD   pixelantd, xq, %1
-ALIGN 16
-.loop:
-    movifnidn srcq, srcmp
-    LOAD      t0d, xq+1, %1 ; skip on the last iteration to avoid overread
-.loop2:
-    movifnidn lineantq, lineantmp
-    movzx     t1d, word [lineantq+xq*2]
-    LOWPASS   t1, pixelant, spatial
-    mov       [lineantq+xq*2], t1w
-    LOWPASS   pixelant, t0, spatial
-    movifnidn frameantq, frameantmp
-    movzx     t0d, word [frameantq+xq*2]
-    LOWPASS   t0, t1, temporal
-    mov       [frameantq+xq*2], t0w
-    movifnidn dstq, dstmp
-%if %1 != 16
-    shr    t0d, 16-%1 ; could eliminate this by storing from t0h, but only with some contraints on register allocation
-%endif
-%if %1 == 8
-    mov    [dstq+xq], t0b
-%else
-    mov    [dstq+xq*2], t0w
-%endif
-    inc    xq
-    jl .loop
-    je .loop2
-    REP_RET
-%endmacro ; HQDN3D_ROW
-
-HQDN3D_ROW 8
-HQDN3D_ROW 9
-HQDN3D_ROW 10
-HQDN3D_ROW 16
diff --git a/deps/libav/libavfilter/x86/vf_hqdn3d_init.c b/deps/libav/libavfilter/x86/vf_hqdn3d_init.c
deleted file mode 100644
index 06f9e00..0000000
--- a/deps/libav/libavfilter/x86/vf_hqdn3d_init.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavfilter/vf_hqdn3d.h"
-#include "config.h"
-
-void ff_hqdn3d_row_8_x86(uint8_t *src, uint8_t *dst, uint16_t *line_ant,
-                         uint16_t *frame_ant, ptrdiff_t w, int16_t *spatial,
-                         int16_t *temporal);
-void ff_hqdn3d_row_9_x86(uint8_t *src, uint8_t *dst, uint16_t *line_ant,
-                         uint16_t *frame_ant, ptrdiff_t w, int16_t *spatial,
-                         int16_t *temporal);
-void ff_hqdn3d_row_10_x86(uint8_t *src, uint8_t *dst, uint16_t *line_ant,
-                          uint16_t *frame_ant, ptrdiff_t w, int16_t *spatial,
-                          int16_t *temporal);
-void ff_hqdn3d_row_16_x86(uint8_t *src, uint8_t *dst, uint16_t *line_ant,
-                          uint16_t *frame_ant, ptrdiff_t w, int16_t *spatial,
-                          int16_t *temporal);
-
-av_cold void ff_hqdn3d_init_x86(HQDN3DContext *hqdn3d)
-{
-#if HAVE_YASM
-    hqdn3d->denoise_row[8]  = ff_hqdn3d_row_8_x86;
-    hqdn3d->denoise_row[9]  = ff_hqdn3d_row_9_x86;
-    hqdn3d->denoise_row[10] = ff_hqdn3d_row_10_x86;
-    hqdn3d->denoise_row[16] = ff_hqdn3d_row_16_x86;
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavfilter/x86/vf_yadif.asm b/deps/libav/libavfilter/x86/vf_yadif.asm
deleted file mode 100644
index 3d8b2bc..0000000
--- a/deps/libav/libavfilter/x86/vf_yadif.asm
+++ /dev/null
@@ -1,254 +0,0 @@
-;*****************************************************************************
-;* x86-optimized functions for yadif filter
-;*
-;* Copyright (C) 2006 Michael Niedermayer <michaelni at gmx.at>
-;* Copyright (c) 2013 Daniel Kang <daniel.d.kang at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-pb_1: times 16 db 1
-pw_1: times  8 dw 1
-
-SECTION .text
-
-%macro CHECK 2
-    movu      m2, [curq+t1+%1]
-    movu      m3, [curq+t0+%2]
-    mova      m4, m2
-    mova      m5, m2
-    pxor      m4, m3
-    pavgb     m5, m3
-    pand      m4, [pb_1]
-    psubusb   m5, m4
-%if mmsize == 16
-    psrldq    m5, 1
-%else
-    psrlq     m5, 8
-%endif
-    punpcklbw m5, m7
-    mova      m4, m2
-    psubusb   m2, m3
-    psubusb   m3, m4
-    pmaxub    m2, m3
-    mova      m3, m2
-    mova      m4, m2
-%if mmsize == 16
-    psrldq    m3, 1
-    psrldq    m4, 2
-%else
-    psrlq     m3, 8
-    psrlq     m4, 16
-%endif
-    punpcklbw m2, m7
-    punpcklbw m3, m7
-    punpcklbw m4, m7
-    paddw     m2, m3
-    paddw     m2, m4
-%endmacro
-
-%macro CHECK1 0
-    mova    m3, m0
-    pcmpgtw m3, m2
-    pminsw  m0, m2
-    mova    m6, m3
-    pand    m5, m3
-    pandn   m3, m1
-    por     m3, m5
-    mova    m1, m3
-%endmacro
-
-%macro CHECK2 0
-    paddw   m6, [pw_1]
-    psllw   m6, 14
-    paddsw  m2, m6
-    mova    m3, m0
-    pcmpgtw m3, m2
-    pminsw  m0, m2
-    pand    m5, m3
-    pandn   m3, m1
-    por     m3, m5
-    mova    m1, m3
-%endmacro
-
-%macro LOAD 2
-    movh      m%1, %2
-    punpcklbw m%1, m7
-%endmacro
-
-%macro FILTER 3
-.loop%1:
-    pxor         m7, m7
-    LOAD          0, [curq+t1]
-    LOAD          1, [curq+t0]
-    LOAD          2, [%2]
-    LOAD          3, [%3]
-    mova         m4, m3
-    paddw        m3, m2
-    psraw        m3, 1
-    mova   [rsp+ 0], m0
-    mova   [rsp+16], m3
-    mova   [rsp+32], m1
-    psubw        m2, m4
-    ABS1         m2, m4
-    LOAD          3, [prevq+t1]
-    LOAD          4, [prevq+t0]
-    psubw        m3, m0
-    psubw        m4, m1
-    ABS1         m3, m5
-    ABS1         m4, m5
-    paddw        m3, m4
-    psrlw        m2, 1
-    psrlw        m3, 1
-    pmaxsw       m2, m3
-    LOAD          3, [nextq+t1]
-    LOAD          4, [nextq+t0]
-    psubw        m3, m0
-    psubw        m4, m1
-    ABS1         m3, m5
-    ABS1         m4, m5
-    paddw        m3, m4
-    psrlw        m3, 1
-    pmaxsw       m2, m3
-    mova   [rsp+48], m2
-
-    paddw        m1, m0
-    paddw        m0, m0
-    psubw        m0, m1
-    psrlw        m1, 1
-    ABS1         m0, m2
-
-    movu         m2, [curq+t1-1]
-    movu         m3, [curq+t0-1]
-    mova         m4, m2
-    psubusb      m2, m3
-    psubusb      m3, m4
-    pmaxub       m2, m3
-%if mmsize == 16
-    mova         m3, m2
-    psrldq       m3, 2
-%else
-    pshufw       m3, m2, q0021
-%endif
-    punpcklbw    m2, m7
-    punpcklbw    m3, m7
-    paddw        m0, m2
-    paddw        m0, m3
-    psubw        m0, [pw_1]
-
-    CHECK -2, 0
-    CHECK1
-    CHECK -3, 1
-    CHECK2
-    CHECK 0, -2
-    CHECK1
-    CHECK 1, -3
-    CHECK2
-
-    mova         m6, [rsp+48]
-    cmp   DWORD r8m, 2
-    jge .end%1
-    LOAD          2, [%2+t1*2]
-    LOAD          4, [%3+t1*2]
-    LOAD          3, [%2+t0*2]
-    LOAD          5, [%3+t0*2]
-    paddw        m2, m4
-    paddw        m3, m5
-    psrlw        m2, 1
-    psrlw        m3, 1
-    mova         m4, [rsp+ 0]
-    mova         m5, [rsp+16]
-    mova         m7, [rsp+32]
-    psubw        m2, m4
-    psubw        m3, m7
-    mova         m0, m5
-    psubw        m5, m4
-    psubw        m0, m7
-    mova         m4, m2
-    pminsw       m2, m3
-    pmaxsw       m3, m4
-    pmaxsw       m2, m5
-    pminsw       m3, m5
-    pmaxsw       m2, m0
-    pminsw       m3, m0
-    pxor         m4, m4
-    pmaxsw       m6, m3
-    psubw        m4, m2
-    pmaxsw       m6, m4
-
-.end%1:
-    mova         m2, [rsp+16]
-    mova         m3, m2
-    psubw        m2, m6
-    paddw        m3, m6
-    pmaxsw       m1, m2
-    pminsw       m1, m3
-    packuswb     m1, m1
-
-    movh     [dstq], m1
-    add        dstq, mmsize/2
-    add       prevq, mmsize/2
-    add        curq, mmsize/2
-    add       nextq, mmsize/2
-    sub   DWORD r4m, mmsize/2
-    jg .loop%1
-%endmacro
-
-%macro YADIF 0
-%if ARCH_X86_32
-cglobal yadif_filter_line, 4, 6, 8, 80, dst, prev, cur, next, w, prefs, \
-                                        mrefs, parity, mode
-%else
-cglobal yadif_filter_line, 4, 7, 8, 80, dst, prev, cur, next, w, prefs, \
-                                        mrefs, parity, mode
-%endif
-    cmp      DWORD wm, 0
-    jle .ret
-%if ARCH_X86_32
-    mov            r4, r5mp
-    mov            r5, r6mp
-    DECLARE_REG_TMP 4,5
-%else
-    movsxd         r5, DWORD r5m
-    movsxd         r6, DWORD r6m
-    DECLARE_REG_TMP 5,6
-%endif
-
-    cmp DWORD paritym, 0
-    je .parity0
-    FILTER 1, prevq, curq
-    jmp .ret
-
-.parity0:
-    FILTER 0, curq, nextq
-
-.ret:
-    RET
-%endmacro
-
-INIT_XMM ssse3
-YADIF
-INIT_XMM sse2
-YADIF
-%if ARCH_X86_32
-INIT_MMX mmxext
-YADIF
-%endif
diff --git a/deps/libav/libavfilter/x86/vf_yadif_init.c b/deps/libav/libavfilter/x86/vf_yadif_init.c
deleted file mode 100644
index 995bdab..0000000
--- a/deps/libav/libavfilter/x86/vf_yadif_init.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavfilter/yadif.h"
-
-void ff_yadif_filter_line_mmxext(void *dst, void *prev, void *cur,
-                                 void *next, int w, int prefs,
-                                 int mrefs, int parity, int mode);
-void ff_yadif_filter_line_sse2(void *dst, void *prev, void *cur,
-                               void *next, int w, int prefs,
-                               int mrefs, int parity, int mode);
-void ff_yadif_filter_line_ssse3(void *dst, void *prev, void *cur,
-                                void *next, int w, int prefs,
-                                int mrefs, int parity, int mode);
-
-av_cold void ff_yadif_init_x86(YADIFContext *yadif)
-{
-#if HAVE_YASM
-    int cpu_flags = av_get_cpu_flags();
-
-#if ARCH_X86_32
-    if (EXTERNAL_MMXEXT(cpu_flags))
-        yadif->filter_line = ff_yadif_filter_line_mmxext;
-#endif /* ARCH_X86_32 */
-    if (EXTERNAL_SSE2(cpu_flags))
-        yadif->filter_line = ff_yadif_filter_line_sse2;
-    if (EXTERNAL_SSSE3(cpu_flags))
-        yadif->filter_line = ff_yadif_filter_line_ssse3;
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavfilter/yadif.h b/deps/libav/libavfilter/yadif.h
deleted file mode 100644
index 75e35c4..0000000
--- a/deps/libav/libavfilter/yadif.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_YADIF_H
-#define AVFILTER_YADIF_H
-
-#include "libavutil/pixdesc.h"
-#include "avfilter.h"
-
-typedef struct YADIFContext {
-    const AVClass *class;
-    /**
-     * 0: send 1 frame for each frame
-     * 1: send 1 frame for each field
-     * 2: like 0 but skips spatial interlacing check
-     * 3: like 1 but skips spatial interlacing check
-     */
-    int mode;
-
-    /**
-     *  0: top field first
-     *  1: bottom field first
-     * -1: auto-detection
-     */
-    int parity;
-
-    int frame_pending;
-
-    /**
-     *  0: deinterlace all frames
-     *  1: only deinterlace frames marked as interlaced
-     */
-    int auto_enable;
-
-    AVFrame *cur;
-    AVFrame *next;
-    AVFrame *prev;
-    AVFrame *out;
-
-    /**
-     * Required alignment for filter_line
-     */
-    void (*filter_line)(void *dst,
-                        void *prev, void *cur, void *next,
-                        int w, int prefs, int mrefs, int parity, int mode);
-    void (*filter_edges)(void *dst, void *prev, void *cur, void *next,
-                         int w, int prefs, int mrefs, int parity, int mode);
-
-    const AVPixFmtDescriptor *csp;
-    int eof;
-} YADIFContext;
-
-void ff_yadif_init_x86(YADIFContext *yadif);
-
-#endif /* AVFILTER_YADIF_H */
diff --git a/deps/libav/libavformat/4xm.c b/deps/libav/libavformat/4xm.c
deleted file mode 100644
index 7a87c36..0000000
--- a/deps/libav/libavformat/4xm.c
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * 4X Technologies .4xm File Demuxer (no muxer)
- * Copyright (c) 2003  The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * 4X Technologies file demuxer
- * by Mike Melanson (melanson at pcisys.net)
- * for more information on the .4xm file format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define     RIFF_TAG MKTAG('R', 'I', 'F', 'F')
-#define  FOURXMV_TAG MKTAG('4', 'X', 'M', 'V')
-#define     LIST_TAG MKTAG('L', 'I', 'S', 'T')
-#define     HEAD_TAG MKTAG('H', 'E', 'A', 'D')
-#define     TRK__TAG MKTAG('T', 'R', 'K', '_')
-#define     MOVI_TAG MKTAG('M', 'O', 'V', 'I')
-#define     VTRK_TAG MKTAG('V', 'T', 'R', 'K')
-#define     STRK_TAG MKTAG('S', 'T', 'R', 'K')
-#define     std__TAG MKTAG('s', 't', 'd', '_')
-#define     name_TAG MKTAG('n', 'a', 'm', 'e')
-#define     vtrk_TAG MKTAG('v', 't', 'r', 'k')
-#define     strk_TAG MKTAG('s', 't', 'r', 'k')
-#define     ifrm_TAG MKTAG('i', 'f', 'r', 'm')
-#define     pfrm_TAG MKTAG('p', 'f', 'r', 'm')
-#define     cfrm_TAG MKTAG('c', 'f', 'r', 'm')
-#define     ifr2_TAG MKTAG('i', 'f', 'r', '2')
-#define     pfr2_TAG MKTAG('p', 'f', 'r', '2')
-#define     cfr2_TAG MKTAG('c', 'f', 'r', '2')
-#define     snd__TAG MKTAG('s', 'n', 'd', '_')
-
-#define vtrk_SIZE 0x44
-#define strk_SIZE 0x28
-
-#define GET_LIST_HEADER() \
-    fourcc_tag = avio_rl32(pb); \
-    size       = avio_rl32(pb); \
-    if (fourcc_tag != LIST_TAG) \
-        return AVERROR_INVALIDDATA; \
-    fourcc_tag = avio_rl32(pb);
-
-typedef struct AudioTrack {
-    int sample_rate;
-    int bits;
-    int channels;
-    int stream_index;
-    int adpcm;
-    int64_t audio_pts;
-} AudioTrack;
-
-typedef struct FourxmDemuxContext {
-    int video_stream_index;
-    int track_count;
-    AudioTrack *tracks;
-
-    int64_t video_pts;
-    float fps;
-} FourxmDemuxContext;
-
-static int fourxm_probe(AVProbeData *p)
-{
-    if ((AV_RL32(&p->buf[0]) != RIFF_TAG) ||
-        (AV_RL32(&p->buf[8]) != FOURXMV_TAG))
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int parse_vtrk(AVFormatContext *s,
-                      FourxmDemuxContext *fourxm, uint8_t *buf, int size,
-                      int left)
-{
-    AVStream *st;
-    /* check that there is enough data */
-    if (size != vtrk_SIZE || left < size + 8) {
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* allocate a new AVStream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    avpriv_set_pts_info(st, 60, 1, fourxm->fps);
-
-    fourxm->video_stream_index = st->index;
-
-    st->codec->codec_type     = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id       = AV_CODEC_ID_4XM;
-    st->codec->extradata_size = 4;
-    st->codec->extradata      = av_malloc(4);
-    AV_WL32(st->codec->extradata, AV_RL32(buf + 16));
-    st->codec->width  = AV_RL32(buf + 36);
-    st->codec->height = AV_RL32(buf + 40);
-
-    return 0;
-}
-
-
-static int parse_strk(AVFormatContext *s,
-                      FourxmDemuxContext *fourxm, uint8_t *buf, int size,
-                      int left)
-{
-    AVStream *st;
-    int track;
-    /* check that there is enough data */
-    if (size != strk_SIZE || left < size + 8)
-        return AVERROR_INVALIDDATA;
-
-    track = AV_RL32(buf + 8);
-    if (track < 0)
-        return AVERROR_INVALIDDATA;
-    if (track + 1 > fourxm->track_count) {
-        if (av_reallocp_array(&fourxm->tracks, track + 1, sizeof(AudioTrack)))
-            return AVERROR(ENOMEM);
-        memset(&fourxm->tracks[fourxm->track_count], 0,
-               sizeof(AudioTrack) * (track + 1 - fourxm->track_count));
-        fourxm->track_count = track + 1;
-    }
-    fourxm->tracks[track].adpcm       = AV_RL32(buf + 12);
-    fourxm->tracks[track].channels    = AV_RL32(buf + 36);
-    fourxm->tracks[track].sample_rate = AV_RL32(buf + 40);
-    fourxm->tracks[track].bits        = AV_RL32(buf + 44);
-    fourxm->tracks[track].audio_pts   = 0;
-
-    if (fourxm->tracks[track].channels    <= 0 ||
-        fourxm->tracks[track].sample_rate <= 0 ||
-        fourxm->tracks[track].bits        <= 0) {
-        av_log(s, AV_LOG_ERROR, "audio header invalid\n");
-        return AVERROR_INVALIDDATA;
-    }
-    /* allocate a new AVStream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->id = track;
-    avpriv_set_pts_info(st, 60, 1, fourxm->tracks[track].sample_rate);
-
-    fourxm->tracks[track].stream_index = st->index;
-
-    st->codec->codec_type            = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_tag             = 0;
-    st->codec->channels              = fourxm->tracks[track].channels;
-    st->codec->sample_rate           = fourxm->tracks[track].sample_rate;
-    st->codec->bits_per_coded_sample = fourxm->tracks[track].bits;
-    st->codec->bit_rate              = st->codec->channels *
-                                       st->codec->sample_rate *
-                                       st->codec->bits_per_coded_sample;
-    st->codec->block_align           = st->codec->channels *
-                                       st->codec->bits_per_coded_sample;
-
-    if (fourxm->tracks[track].adpcm){
-        st->codec->codec_id = AV_CODEC_ID_ADPCM_4XM;
-    } else if (st->codec->bits_per_coded_sample == 8) {
-        st->codec->codec_id = AV_CODEC_ID_PCM_U8;
-    } else
-        st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
-
-    return 0;
-}
-
-static int fourxm_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    unsigned int fourcc_tag;
-    unsigned int size;
-    int header_size;
-    FourxmDemuxContext *fourxm = s->priv_data;
-    unsigned char *header;
-    int i, ret;
-
-    fourxm->track_count = 0;
-    fourxm->tracks      = NULL;
-    fourxm->fps         = 1.0;
-
-    /* skip the first 3 32-bit numbers */
-    avio_skip(pb, 12);
-
-    /* check for LIST-HEAD */
-    GET_LIST_HEADER();
-    header_size = size - 4;
-    if (fourcc_tag != HEAD_TAG || header_size < 0)
-        return AVERROR_INVALIDDATA;
-
-    /* allocate space for the header and load the whole thing */
-    header = av_malloc(header_size);
-    if (!header)
-        return AVERROR(ENOMEM);
-    if (avio_read(pb, header, header_size) != header_size) {
-        av_free(header);
-        return AVERROR(EIO);
-    }
-
-    /* take the lazy approach and search for any and all vtrk and strk chunks */
-    for (i = 0; i < header_size - 8; i++) {
-        fourcc_tag = AV_RL32(&header[i]);
-        size       = AV_RL32(&header[i + 4]);
-
-        if (fourcc_tag == std__TAG) {
-            if (header_size - i < 16) {
-                ret = AVERROR_INVALIDDATA;
-                goto fail;
-            }
-            fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));
-        } else if (fourcc_tag == vtrk_TAG) {
-            if ((ret = parse_vtrk(s, fourxm, header + i, size,
-                                  header_size - i)) < 0)
-                goto fail;
-
-            i += 8 + size;
-        } else if (fourcc_tag == strk_TAG) {
-            if ((ret = parse_strk(s, fourxm, header + i, size,
-                                  header_size - i)) < 0)
-                goto fail;
-
-            i += 8 + size;
-        }
-    }
-
-    /* skip over the LIST-MOVI chunk (which is where the stream should be */
-    GET_LIST_HEADER();
-    if (fourcc_tag != MOVI_TAG) {
-        ret = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-
-    av_free(header);
-    /* initialize context members */
-    fourxm->video_pts = -1;  /* first frame will push to 0 */
-
-    return 0;
-fail:
-    av_freep(&fourxm->tracks);
-    av_free(header);
-    return ret;
-}
-
-static int fourxm_read_packet(AVFormatContext *s,
-                              AVPacket *pkt)
-{
-    FourxmDemuxContext *fourxm = s->priv_data;
-    AVIOContext *pb            = s->pb;
-    unsigned int fourcc_tag;
-    unsigned int size;
-    int ret = 0;
-    unsigned int track_number;
-    int packet_read = 0;
-    unsigned char header[8];
-    int audio_frame_count;
-
-    while (!packet_read) {
-        if ((ret = avio_read(s->pb, header, 8)) < 0)
-            return ret;
-        fourcc_tag = AV_RL32(&header[0]);
-        size       = AV_RL32(&header[4]);
-        if (pb->eof_reached)
-            return AVERROR(EIO);
-        switch (fourcc_tag) {
-        case LIST_TAG:
-            /* this is a good time to bump the video pts */
-            fourxm->video_pts++;
-
-            /* skip the LIST-* tag and move on to the next fourcc */
-            avio_rl32(pb);
-            break;
-
-        case ifrm_TAG:
-        case pfrm_TAG:
-        case cfrm_TAG:
-        case ifr2_TAG:
-        case pfr2_TAG:
-        case cfr2_TAG:
-            /* allocate 8 more bytes than 'size' to account for fourcc
-             * and size */
-            if (size + 8 < size || av_new_packet(pkt, size + 8))
-                return AVERROR(EIO);
-            pkt->stream_index = fourxm->video_stream_index;
-            pkt->pts          = fourxm->video_pts;
-            pkt->pos          = avio_tell(s->pb);
-            memcpy(pkt->data, header, 8);
-            ret = avio_read(s->pb, &pkt->data[8], size);
-
-            if (ret < 0) {
-                av_free_packet(pkt);
-            } else
-                packet_read = 1;
-            break;
-
-        case snd__TAG:
-            track_number = avio_rl32(pb);
-            avio_skip(pb, 4);
-            size -= 8;
-
-            if (track_number < fourxm->track_count &&
-                fourxm->tracks[track_number].channels > 0) {
-                ret = av_get_packet(s->pb, pkt, size);
-                if (ret < 0)
-                    return AVERROR(EIO);
-                pkt->stream_index =
-                    fourxm->tracks[track_number].stream_index;
-                pkt->pts    = fourxm->tracks[track_number].audio_pts;
-                packet_read = 1;
-
-                /* pts accounting */
-                audio_frame_count = size;
-                if (fourxm->tracks[track_number].adpcm)
-                    audio_frame_count -= 2 * (fourxm->tracks[track_number].channels);
-                audio_frame_count /= fourxm->tracks[track_number].channels;
-                if (fourxm->tracks[track_number].adpcm) {
-                    audio_frame_count *= 2;
-                } else
-                    audio_frame_count /=
-                        (fourxm->tracks[track_number].bits / 8);
-                fourxm->tracks[track_number].audio_pts += audio_frame_count;
-            } else {
-                avio_skip(pb, size);
-            }
-            break;
-
-        default:
-            avio_skip(pb, size);
-            break;
-        }
-    }
-    return ret;
-}
-
-static int fourxm_read_close(AVFormatContext *s)
-{
-    FourxmDemuxContext *fourxm = s->priv_data;
-
-    av_freep(&fourxm->tracks);
-
-    return 0;
-}
-
-AVInputFormat ff_fourxm_demuxer = {
-    .name           = "4xm",
-    .long_name      = NULL_IF_CONFIG_SMALL("4X Technologies"),
-    .priv_data_size = sizeof(FourxmDemuxContext),
-    .read_probe     = fourxm_probe,
-    .read_header    = fourxm_read_header,
-    .read_packet    = fourxm_read_packet,
-    .read_close     = fourxm_read_close,
-};
diff --git a/deps/libav/libavformat/Makefile b/deps/libav/libavformat/Makefile
deleted file mode 100644
index 5694314..0000000
--- a/deps/libav/libavformat/Makefile
+++ /dev/null
@@ -1,404 +0,0 @@
-NAME = avformat
-FFLIBS = avcodec avutil
-
-HEADERS = avformat.h                                                    \
-          avio.h                                                        \
-          version.h                                                     \
-
-OBJS = allformats.o         \
-       avio.o               \
-       aviobuf.o            \
-       cutils.o             \
-       format.o             \
-       id3v1.o              \
-       id3v2.o              \
-       log2_tab.o           \
-       metadata.o           \
-       mux.o                \
-       options.o            \
-       os_support.o         \
-       riff.o               \
-       sdp.o                \
-       seek.o               \
-       url.o                \
-       utils.o              \
-
-OBJS-$(CONFIG_NETWORK)                   += network.o
-OBJS-$(CONFIG_RIFFDEC)                   += riffdec.o
-OBJS-$(CONFIG_RIFFENC)                   += riffenc.o
-OBJS-$(CONFIG_RTPDEC)                    += rdt.o                       \
-                                            rtp.o                       \
-                                            rtpdec.o                    \
-                                            rtpdec_amr.o                \
-                                            rtpdec_asf.o                \
-                                            rtpdec_g726.o               \
-                                            rtpdec_h263.o               \
-                                            rtpdec_h263_rfc2190.o       \
-                                            rtpdec_h264.o               \
-                                            rtpdec_ilbc.o               \
-                                            rtpdec_jpeg.o               \
-                                            rtpdec_latm.o               \
-                                            rtpdec_mpeg12.o             \
-                                            rtpdec_mpeg4.o              \
-                                            rtpdec_mpegts.o             \
-                                            rtpdec_qcelp.o              \
-                                            rtpdec_qdm2.o               \
-                                            rtpdec_qt.o                 \
-                                            rtpdec_svq3.o               \
-                                            rtpdec_vp8.o                \
-                                            rtpdec_xiph.o               \
-                                            srtp.o
-OBJS-$(CONFIG_RTPENC_CHAIN)              += rtpenc_chain.o rtp.o
-
-# muxers/demuxers
-OBJS-$(CONFIG_A64_MUXER)                 += a64.o rawenc.o
-OBJS-$(CONFIG_AAC_DEMUXER)               += aacdec.o rawdec.o
-OBJS-$(CONFIG_AC3_DEMUXER)               += ac3dec.o rawdec.o
-OBJS-$(CONFIG_AC3_MUXER)                 += rawenc.o
-OBJS-$(CONFIG_ADX_DEMUXER)               += adxdec.o
-OBJS-$(CONFIG_ADX_MUXER)                 += rawenc.o
-OBJS-$(CONFIG_ADTS_MUXER)                += adtsenc.o
-OBJS-$(CONFIG_AEA_DEMUXER)               += aea.o pcm.o
-OBJS-$(CONFIG_AIFF_DEMUXER)              += aiffdec.o pcm.o
-OBJS-$(CONFIG_AIFF_MUXER)                += aiffenc.o
-OBJS-$(CONFIG_AMR_DEMUXER)               += amr.o
-OBJS-$(CONFIG_AMR_MUXER)                 += amr.o
-OBJS-$(CONFIG_ANM_DEMUXER)               += anm.o
-OBJS-$(CONFIG_APC_DEMUXER)               += apc.o
-OBJS-$(CONFIG_APE_DEMUXER)               += ape.o apetag.o img2.o
-OBJS-$(CONFIG_ASF_DEMUXER)               += asfdec.o asf.o asfcrypt.o \
-                                            avlanguage.o
-OBJS-$(CONFIG_ASF_MUXER)                 += asfenc.o asf.o
-OBJS-$(CONFIG_ASS_DEMUXER)               += assdec.o
-OBJS-$(CONFIG_ASS_MUXER)                 += assenc.o
-OBJS-$(CONFIG_AU_DEMUXER)                += au.o pcm.o
-OBJS-$(CONFIG_AU_MUXER)                  += au.o rawenc.o
-OBJS-$(CONFIG_AVI_DEMUXER)               += avidec.o
-OBJS-$(CONFIG_AVI_MUXER)                 += avienc.o
-OBJS-$(CONFIG_AVISYNTH)                  += avisynth.o
-OBJS-$(CONFIG_AVM2_MUXER)                += swfenc.o swf.o
-OBJS-$(CONFIG_AVS_DEMUXER)               += avs.o vocdec.o voc.o
-OBJS-$(CONFIG_BETHSOFTVID_DEMUXER)       += bethsoftvid.o
-OBJS-$(CONFIG_BFI_DEMUXER)               += bfi.o
-OBJS-$(CONFIG_BINK_DEMUXER)              += bink.o
-OBJS-$(CONFIG_BMV_DEMUXER)               += bmv.o
-OBJS-$(CONFIG_C93_DEMUXER)               += c93.o vocdec.o voc.o
-OBJS-$(CONFIG_CAF_DEMUXER)               += cafdec.o caf.o mov.o mov_chan.o \
-                                            isom.o
-OBJS-$(CONFIG_CAVSVIDEO_DEMUXER)         += cavsvideodec.o rawdec.o
-OBJS-$(CONFIG_CAVSVIDEO_MUXER)           += rawenc.o
-OBJS-$(CONFIG_CDG_DEMUXER)               += cdg.o
-OBJS-$(CONFIG_CDXL_DEMUXER)              += cdxl.o
-OBJS-$(CONFIG_CRC_MUXER)                 += crcenc.o
-OBJS-$(CONFIG_DAUD_DEMUXER)              += daud.o
-OBJS-$(CONFIG_DAUD_MUXER)                += daud.o
-OBJS-$(CONFIG_DFA_DEMUXER)               += dfa.o
-OBJS-$(CONFIG_DIRAC_DEMUXER)             += diracdec.o rawdec.o
-OBJS-$(CONFIG_DIRAC_MUXER)               += rawenc.o
-OBJS-$(CONFIG_DNXHD_DEMUXER)             += dnxhddec.o rawdec.o
-OBJS-$(CONFIG_DNXHD_MUXER)               += rawenc.o
-OBJS-$(CONFIG_DSICIN_DEMUXER)            += dsicin.o
-OBJS-$(CONFIG_DTS_DEMUXER)               += dtsdec.o rawdec.o
-OBJS-$(CONFIG_DTS_MUXER)                 += rawenc.o
-OBJS-$(CONFIG_DV_DEMUXER)                += dv.o
-OBJS-$(CONFIG_DV_MUXER)                  += dvenc.o
-OBJS-$(CONFIG_DXA_DEMUXER)               += dxa.o
-OBJS-$(CONFIG_EA_CDATA_DEMUXER)          += eacdata.o
-OBJS-$(CONFIG_EA_DEMUXER)                += electronicarts.o
-OBJS-$(CONFIG_EAC3_DEMUXER)              += ac3dec.o rawdec.o
-OBJS-$(CONFIG_EAC3_MUXER)                += rawenc.o
-OBJS-$(CONFIG_FFM_DEMUXER)               += ffmdec.o
-OBJS-$(CONFIG_FFM_MUXER)                 += ffmenc.o
-OBJS-$(CONFIG_FFMETADATA_DEMUXER)        += ffmetadec.o
-OBJS-$(CONFIG_FFMETADATA_MUXER)          += ffmetaenc.o
-OBJS-$(CONFIG_FILMSTRIP_DEMUXER)         += filmstripdec.o
-OBJS-$(CONFIG_FILMSTRIP_MUXER)           += filmstripenc.o
-OBJS-$(CONFIG_FLAC_DEMUXER)              += flacdec.o rawdec.o \
-                                            flac_picture.o   \
-                                            oggparsevorbis.o \
-                                            vorbiscomment.o
-OBJS-$(CONFIG_FLAC_MUXER)                += flacenc.o flacenc_header.o \
-                                            vorbiscomment.o
-OBJS-$(CONFIG_FLIC_DEMUXER)              += flic.o
-OBJS-$(CONFIG_FLV_DEMUXER)               += flvdec.o
-OBJS-$(CONFIG_FLV_MUXER)                 += flvenc.o avc.o
-OBJS-$(CONFIG_FOURXM_DEMUXER)            += 4xm.o
-OBJS-$(CONFIG_FRAMECRC_MUXER)            += framecrcenc.o framehash.o
-OBJS-$(CONFIG_FRAMEMD5_MUXER)            += md5enc.o framehash.o
-OBJS-$(CONFIG_GIF_MUXER)                 += gif.o
-OBJS-$(CONFIG_GSM_DEMUXER)               += gsmdec.o
-OBJS-$(CONFIG_GXF_DEMUXER)               += gxf.o
-OBJS-$(CONFIG_GXF_MUXER)                 += gxfenc.o audiointerleave.o
-OBJS-$(CONFIG_G722_DEMUXER)              += g722.o rawdec.o
-OBJS-$(CONFIG_G722_MUXER)                += rawenc.o
-OBJS-$(CONFIG_G723_1_DEMUXER)            += g723_1.o
-OBJS-$(CONFIG_H261_DEMUXER)              += h261dec.o rawdec.o
-OBJS-$(CONFIG_H261_MUXER)                += rawenc.o
-OBJS-$(CONFIG_H263_DEMUXER)              += h263dec.o rawdec.o
-OBJS-$(CONFIG_H263_MUXER)                += rawenc.o
-OBJS-$(CONFIG_H264_DEMUXER)              += h264dec.o rawdec.o
-OBJS-$(CONFIG_H264_MUXER)                += rawenc.o
-OBJS-$(CONFIG_HDS_MUXER)                 += hdsenc.o
-OBJS-$(CONFIG_HEVC_DEMUXER)              += hevcdec.o rawdec.o
-OBJS-$(CONFIG_HEVC_MUXER)                += rawenc.o
-OBJS-$(CONFIG_HLS_DEMUXER)               += hls.o
-OBJS-$(CONFIG_HLS_MUXER)                 += hlsenc.o
-OBJS-$(CONFIG_HNM_DEMUXER)               += hnm.o
-OBJS-$(CONFIG_IDCIN_DEMUXER)             += idcin.o
-OBJS-$(CONFIG_IFF_DEMUXER)               += iff.o
-OBJS-$(CONFIG_ILBC_DEMUXER)              += ilbc.o
-OBJS-$(CONFIG_ILBC_MUXER)                += ilbc.o
-OBJS-$(CONFIG_IMAGE2_DEMUXER)            += img2dec.o img2.o
-OBJS-$(CONFIG_IMAGE2_MUXER)              += img2enc.o img2.o
-OBJS-$(CONFIG_IMAGE2PIPE_DEMUXER)        += img2dec.o img2.o
-OBJS-$(CONFIG_IMAGE2PIPE_MUXER)          += img2enc.o img2.o
-OBJS-$(CONFIG_INGENIENT_DEMUXER)         += ingenientdec.o rawdec.o
-OBJS-$(CONFIG_IPMOVIE_DEMUXER)           += ipmovie.o
-OBJS-$(CONFIG_ISS_DEMUXER)               += iss.o
-OBJS-$(CONFIG_IV8_DEMUXER)               += iv8.o
-OBJS-$(CONFIG_IVF_DEMUXER)               += ivfdec.o
-OBJS-$(CONFIG_IVF_MUXER)                 += ivfenc.o
-OBJS-$(CONFIG_JV_DEMUXER)                += jvdec.o
-OBJS-$(CONFIG_LATM_DEMUXER)              += rawdec.o
-OBJS-$(CONFIG_LATM_MUXER)                += latmenc.o
-OBJS-$(CONFIG_LMLM4_DEMUXER)             += lmlm4.o
-OBJS-$(CONFIG_LXF_DEMUXER)               += lxfdec.o
-OBJS-$(CONFIG_M4V_DEMUXER)               += m4vdec.o rawdec.o
-OBJS-$(CONFIG_M4V_MUXER)                 += rawenc.o
-OBJS-$(CONFIG_MATROSKA_DEMUXER)          += matroskadec.o matroska.o  \
-                                            isom.o rmsipr.o
-OBJS-$(CONFIG_MATROSKA_MUXER)            += matroskaenc.o matroska.o \
-                                            isom.o avc.o hevc.o \
-                                            flacenc_header.o avlanguage.o wv.o
-OBJS-$(CONFIG_MD5_MUXER)                 += md5enc.o
-OBJS-$(CONFIG_MJPEG_DEMUXER)             += rawdec.o
-OBJS-$(CONFIG_MJPEG_MUXER)               += rawenc.o
-OBJS-$(CONFIG_MLP_DEMUXER)               += rawdec.o
-OBJS-$(CONFIG_MLP_MUXER)                 += rawenc.o
-OBJS-$(CONFIG_MM_DEMUXER)                += mm.o
-OBJS-$(CONFIG_MMF_DEMUXER)               += mmf.o pcm.o
-OBJS-$(CONFIG_MMF_MUXER)                 += mmf.o
-OBJS-$(CONFIG_MOV_DEMUXER)               += mov.o isom.o mov_chan.o
-OBJS-$(CONFIG_MOV_MUXER)                 += movenc.o isom.o avc.o hevc.o \
-                                            movenchint.o mov_chan.o
-OBJS-$(CONFIG_MP2_MUXER)                 += mp3enc.o rawenc.o id3v2enc.o
-OBJS-$(CONFIG_MP3_DEMUXER)               += mp3dec.o
-OBJS-$(CONFIG_MP3_MUXER)                 += mp3enc.o rawenc.o id3v2enc.o
-OBJS-$(CONFIG_MPC_DEMUXER)               += mpc.o apetag.o img2.o
-OBJS-$(CONFIG_MPC8_DEMUXER)              += mpc8.o apetag.o img2.o
-OBJS-$(CONFIG_MPEG1SYSTEM_MUXER)         += mpegenc.o
-OBJS-$(CONFIG_MPEG1VCD_MUXER)            += mpegenc.o
-OBJS-$(CONFIG_MPEG2DVD_MUXER)            += mpegenc.o
-OBJS-$(CONFIG_MPEG2VOB_MUXER)            += mpegenc.o
-OBJS-$(CONFIG_MPEG2SVCD_MUXER)           += mpegenc.o
-OBJS-$(CONFIG_MPEG1VIDEO_MUXER)          += rawenc.o
-OBJS-$(CONFIG_MPEG2VIDEO_MUXER)          += rawenc.o
-OBJS-$(CONFIG_MPEGPS_DEMUXER)            += mpeg.o
-OBJS-$(CONFIG_MPEGTS_DEMUXER)            += mpegts.o isom.o
-OBJS-$(CONFIG_MPEGTS_MUXER)              += mpegtsenc.o
-OBJS-$(CONFIG_MPEGVIDEO_DEMUXER)         += mpegvideodec.o rawdec.o
-OBJS-$(CONFIG_MPJPEG_MUXER)              += mpjpeg.o
-OBJS-$(CONFIG_MSNWC_TCP_DEMUXER)         += msnwc_tcp.o
-OBJS-$(CONFIG_MTV_DEMUXER)               += mtv.o
-OBJS-$(CONFIG_MVI_DEMUXER)               += mvi.o
-OBJS-$(CONFIG_MXF_DEMUXER)               += mxfdec.o mxf.o
-OBJS-$(CONFIG_MXF_MUXER)                 += mxfenc.o mxf.o audiointerleave.o
-OBJS-$(CONFIG_MXG_DEMUXER)               += mxg.o
-OBJS-$(CONFIG_NC_DEMUXER)                += ncdec.o
-OBJS-$(CONFIG_NSV_DEMUXER)               += nsvdec.o
-OBJS-$(CONFIG_NULL_MUXER)                += nullenc.o
-OBJS-$(CONFIG_NUT_DEMUXER)               += nutdec.o nut.o
-OBJS-$(CONFIG_NUT_MUXER)                 += nutenc.o nut.o
-OBJS-$(CONFIG_NUV_DEMUXER)               += nuv.o
-OBJS-$(CONFIG_OGG_DEMUXER)               += oggdec.o         \
-                                            oggparsecelt.o   \
-                                            oggparsedirac.o  \
-                                            oggparseflac.o   \
-                                            oggparseogm.o    \
-                                            oggparseopus.o   \
-                                            oggparseskeleton.o \
-                                            oggparsespeex.o  \
-                                            oggparsetheora.o \
-                                            oggparsevorbis.o \
-                                            vorbiscomment.o  \
-                                            flac_picture.o
-OBJS-$(CONFIG_OGG_MUXER)                 += oggenc.o \
-                                            vorbiscomment.o
-OBJS-$(CONFIG_OMA_DEMUXER)               += omadec.o pcm.o oma.o
-OBJS-$(CONFIG_OMA_MUXER)                 += omaenc.o rawenc.o oma.o id3v2enc.o
-OBJS-$(CONFIG_PCM_ALAW_DEMUXER)          += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_ALAW_MUXER)            += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_F32BE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_F32BE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_F32LE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_F32LE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_F64BE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_F64BE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_F64LE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_F64LE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_MULAW_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_MULAW_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S16BE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_S16BE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S16LE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_S16LE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S24BE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_S24BE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S24LE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_S24LE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S32BE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_S32BE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S32LE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_S32LE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_S8_DEMUXER)            += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_S8_MUXER)              += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U16BE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_U16BE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U16LE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_U16LE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U24BE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_U24BE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U24LE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_U24LE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U32BE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_U32BE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U32LE_DEMUXER)         += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_U32LE_MUXER)           += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PCM_U8_DEMUXER)            += pcmdec.o pcm.o
-OBJS-$(CONFIG_PCM_U8_MUXER)              += pcmenc.o rawenc.o
-OBJS-$(CONFIG_PMP_DEMUXER)               += pmpdec.o
-OBJS-$(CONFIG_PVA_DEMUXER)               += pva.o
-OBJS-$(CONFIG_QCP_DEMUXER)               += qcp.o
-OBJS-$(CONFIG_R3D_DEMUXER)               += r3d.o
-OBJS-$(CONFIG_RAWVIDEO_DEMUXER)          += rawvideodec.o
-OBJS-$(CONFIG_RAWVIDEO_MUXER)            += rawenc.o
-OBJS-$(CONFIG_RL2_DEMUXER)               += rl2.o
-OBJS-$(CONFIG_RM_DEMUXER)                += rmdec.o rm.o rmsipr.o
-OBJS-$(CONFIG_RM_MUXER)                  += rmenc.o rm.o
-OBJS-$(CONFIG_ROQ_DEMUXER)               += idroqdec.o
-OBJS-$(CONFIG_ROQ_MUXER)                 += idroqenc.o rawenc.o
-OBJS-$(CONFIG_RSO_DEMUXER)               += rsodec.o rso.o pcm.o
-OBJS-$(CONFIG_RSO_MUXER)                 += rsoenc.o rso.o
-OBJS-$(CONFIG_RPL_DEMUXER)               += rpl.o
-OBJS-$(CONFIG_RTP_MUXER)                 += rtp.o         \
-                                            rtpenc_aac.o     \
-                                            rtpenc_latm.o    \
-                                            rtpenc_amr.o     \
-                                            rtpenc_h263.o    \
-                                            rtpenc_h263_rfc2190.o \
-                                            rtpenc_jpeg.o \
-                                            rtpenc_mpv.o     \
-                                            rtpenc.o      \
-                                            rtpenc_h264.o \
-                                            rtpenc_vp8.o  \
-                                            rtpenc_xiph.o \
-                                            avc.o
-OBJS-$(CONFIG_RTSP_DEMUXER)              += rtsp.o rtspdec.o httpauth.o \
-                                            urldecode.o
-OBJS-$(CONFIG_RTSP_MUXER)                += rtsp.o rtspenc.o httpauth.o \
-                                            urldecode.o
-OBJS-$(CONFIG_SAP_DEMUXER)               += sapdec.o
-OBJS-$(CONFIG_SAP_MUXER)                 += sapenc.o
-OBJS-$(CONFIG_SDP_DEMUXER)               += rtsp.o
-OBJS-$(CONFIG_SEGAFILM_DEMUXER)          += segafilm.o
-OBJS-$(CONFIG_SEGMENT_MUXER)             += segment.o
-OBJS-$(CONFIG_SHORTEN_DEMUXER)           += rawdec.o
-OBJS-$(CONFIG_SIFF_DEMUXER)              += siff.o
-OBJS-$(CONFIG_SMACKER_DEMUXER)           += smacker.o
-OBJS-$(CONFIG_SMJPEG_DEMUXER)            += smjpegdec.o smjpeg.o
-OBJS-$(CONFIG_SMJPEG_MUXER)              += smjpegenc.o smjpeg.o
-OBJS-$(CONFIG_SMOOTHSTREAMING_MUXER)     += smoothstreamingenc.o isom.o
-OBJS-$(CONFIG_SOL_DEMUXER)               += sol.o pcm.o
-OBJS-$(CONFIG_SOX_DEMUXER)               += soxdec.o pcm.o
-OBJS-$(CONFIG_SOX_MUXER)                 += soxenc.o
-OBJS-$(CONFIG_SPDIF_DEMUXER)             += spdif.o spdifdec.o
-OBJS-$(CONFIG_SPDIF_MUXER)               += spdif.o spdifenc.o
-OBJS-$(CONFIG_SRT_DEMUXER)               += srtdec.o
-OBJS-$(CONFIG_SRT_MUXER)                 += rawenc.o
-OBJS-$(CONFIG_STR_DEMUXER)               += psxstr.o
-OBJS-$(CONFIG_SWF_DEMUXER)               += swfdec.o swf.o
-OBJS-$(CONFIG_SWF_MUXER)                 += swfenc.o swf.o
-OBJS-$(CONFIG_TAK_DEMUXER)               += takdec.o apetag.o img2.o rawdec.o
-OBJS-$(CONFIG_THP_DEMUXER)               += thp.o
-OBJS-$(CONFIG_TIERTEXSEQ_DEMUXER)        += tiertexseq.o
-OBJS-$(CONFIG_TMV_DEMUXER)               += tmv.o
-OBJS-$(CONFIG_TRUEHD_DEMUXER)            += rawdec.o
-OBJS-$(CONFIG_TRUEHD_MUXER)              += rawenc.o
-OBJS-$(CONFIG_TTA_DEMUXER)               += tta.o
-OBJS-$(CONFIG_TTY_DEMUXER)               += tty.o sauce.o
-OBJS-$(CONFIG_TXD_DEMUXER)               += txd.o
-OBJS-$(CONFIG_VC1_DEMUXER)               += rawdec.o
-OBJS-$(CONFIG_VC1T_DEMUXER)              += vc1test.o
-OBJS-$(CONFIG_VC1T_MUXER)                += vc1testenc.o
-OBJS-$(CONFIG_VMD_DEMUXER)               += sierravmd.o
-OBJS-$(CONFIG_VOC_DEMUXER)               += vocdec.o voc.o
-OBJS-$(CONFIG_VOC_MUXER)                 += vocenc.o voc.o
-OBJS-$(CONFIG_VQF_DEMUXER)               += vqf.o
-OBJS-$(CONFIG_W64_DEMUXER)               += wavdec.o pcm.o
-OBJS-$(CONFIG_WAV_DEMUXER)               += wavdec.o pcm.o
-OBJS-$(CONFIG_WAV_MUXER)                 += wavenc.o
-OBJS-$(CONFIG_WC3_DEMUXER)               += wc3movie.o
-OBJS-$(CONFIG_WEBM_MUXER)                += matroskaenc.o matroska.o \
-                                            isom.o avc.o \
-                                            flacenc_header.o avlanguage.o wv.o
-OBJS-$(CONFIG_WSAUD_DEMUXER)             += westwood_aud.o
-OBJS-$(CONFIG_WSVQA_DEMUXER)             += westwood_vqa.o
-OBJS-$(CONFIG_WTV_DEMUXER)               += wtv.o asfdec.o asf.o asfcrypt.o \
-                                            avlanguage.o mpegts.o isom.o
-OBJS-$(CONFIG_WV_DEMUXER)                += wvdec.o wv.o apetag.o img2.o
-OBJS-$(CONFIG_WV_MUXER)                  += wvenc.o wv.o apetag.o img2.o
-OBJS-$(CONFIG_XA_DEMUXER)                += xa.o
-OBJS-$(CONFIG_XMV_DEMUXER)               += xmv.o
-OBJS-$(CONFIG_XWMA_DEMUXER)              += xwma.o
-OBJS-$(CONFIG_YOP_DEMUXER)               += yop.o
-OBJS-$(CONFIG_YUV4MPEGPIPE_MUXER)        += yuv4mpeg.o
-OBJS-$(CONFIG_YUV4MPEGPIPE_DEMUXER)      += yuv4mpeg.o
-
-# external libraries
-OBJS-$(CONFIG_LIBRTMP)                   += librtmp.o
-
-# protocols I/O
-OBJS-$(CONFIG_APPLEHTTP_PROTOCOL)        += hlsproto.o
-OBJS-$(CONFIG_CONCAT_PROTOCOL)           += concat.o
-OBJS-$(CONFIG_CRYPTO_PROTOCOL)           += crypto.o
-OBJS-$(CONFIG_FFRTMPCRYPT_PROTOCOL)      += rtmpcrypt.o rtmpdh.o
-OBJS-$(CONFIG_FFRTMPHTTP_PROTOCOL)       += rtmphttp.o
-OBJS-$(CONFIG_FILE_PROTOCOL)             += file.o
-OBJS-$(CONFIG_GOPHER_PROTOCOL)           += gopher.o
-OBJS-$(CONFIG_HLS_PROTOCOL)              += hlsproto.o
-OBJS-$(CONFIG_HTTP_PROTOCOL)             += http.o httpauth.o urldecode.o
-OBJS-$(CONFIG_HTTPPROXY_PROTOCOL)        += http.o httpauth.o urldecode.o
-OBJS-$(CONFIG_HTTPS_PROTOCOL)            += http.o httpauth.o urldecode.o
-OBJS-$(CONFIG_MMSH_PROTOCOL)             += mmsh.o mms.o asf.o
-OBJS-$(CONFIG_MMST_PROTOCOL)             += mmst.o mms.o asf.o
-OBJS-$(CONFIG_MD5_PROTOCOL)              += md5proto.o
-OBJS-$(CONFIG_PIPE_PROTOCOL)             += file.o
-OBJS-$(CONFIG_RTMP_PROTOCOL)             += rtmpproto.o rtmppkt.o
-OBJS-$(CONFIG_RTMPE_PROTOCOL)            += rtmpproto.o rtmppkt.o
-OBJS-$(CONFIG_RTMPS_PROTOCOL)            += rtmpproto.o rtmppkt.o
-OBJS-$(CONFIG_RTMPT_PROTOCOL)            += rtmpproto.o rtmppkt.o
-OBJS-$(CONFIG_RTMPTE_PROTOCOL)           += rtmpproto.o rtmppkt.o
-OBJS-$(CONFIG_RTMPTS_PROTOCOL)           += rtmpproto.o rtmppkt.o
-OBJS-$(CONFIG_RTP_PROTOCOL)              += rtpproto.o
-OBJS-$(CONFIG_SCTP_PROTOCOL)             += sctp.o
-OBJS-$(CONFIG_SRTP_PROTOCOL)             += srtpproto.o srtp.o
-OBJS-$(CONFIG_TCP_PROTOCOL)              += tcp.o
-OBJS-$(CONFIG_TLS_PROTOCOL)              += tls.o
-OBJS-$(CONFIG_UDP_PROTOCOL)              += udp.o
-OBJS-$(CONFIG_UNIX_PROTOCOL)             += unix.o
-
-OBJS-$(HAVE_LIBC_MSVCRT)                 += file_open.o
-
-SKIPHEADERS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh.h
-SKIPHEADERS-$(CONFIG_NETWORK)            += network.h rtsp.h
-
-TESTPROGS = seek                                                        \
-            srtp                                                        \
-            url                                                         \
-
-TESTPROGS-$(CONFIG_NETWORK)              += noproxy
-
-TOOLS     = aviocat                                                     \
-            ismindex                                                    \
-            pktdumper                                                   \
-            probetest                                                   \
diff --git a/deps/libav/libavformat/a64.c b/deps/libav/libavformat/a64.c
deleted file mode 100644
index 15a0475..0000000
--- a/deps/libav/libavformat/a64.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * a64 muxer
- * Copyright (c) 2009 Tobias Bindhammer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/avcodec.h"
-#include "libavcodec/a64enc.h"
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "rawenc.h"
-
-static int a64_write_header(struct AVFormatContext *s)
-{
-    AVCodecContext *avctx = s->streams[0]->codec;
-    uint8_t header[5] = {
-        0x00, //load
-        0x40, //address
-        0x00, //mode
-        0x00, //charset_lifetime (multi only)
-        0x00  //fps in 50/fps;
-    };
-    switch (avctx->codec->id) {
-    case AV_CODEC_ID_A64_MULTI:
-        header[2] = 0x00;
-        header[3] = AV_RB32(avctx->extradata+0);
-        header[4] = 2;
-        break;
-    case AV_CODEC_ID_A64_MULTI5:
-        header[2] = 0x01;
-        header[3] = AV_RB32(avctx->extradata+0);
-        header[4] = 3;
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-    avio_write(s->pb, header, 2);
-    return 0;
-}
-
-AVOutputFormat ff_a64_muxer = {
-    .name           = "a64",
-    .long_name      = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"),
-    .extensions     = "a64, A64",
-    .video_codec    = AV_CODEC_ID_A64_MULTI,
-    .write_header   = a64_write_header,
-    .write_packet   = ff_raw_write_packet,
-};
diff --git a/deps/libav/libavformat/aacdec.c b/deps/libav/libavformat/aacdec.c
deleted file mode 100644
index 8d87ce6..0000000
--- a/deps/libav/libavformat/aacdec.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * raw ADTS AAC demuxer
- * Copyright (c) 2008 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2009 Robert Swain ( rob opendot cl )
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-#include "rawdec.h"
-#include "id3v1.h"
-
-
-static int adts_aac_probe(AVProbeData *p)
-{
-    int max_frames = 0, first_frames = 0;
-    int fsize, frames;
-    uint8_t *buf0 = p->buf;
-    uint8_t *buf2;
-    uint8_t *buf;
-    uint8_t *end = buf0 + p->buf_size - 7;
-
-    buf = buf0;
-
-    for(; buf < end; buf= buf2+1) {
-        buf2 = buf;
-
-        for(frames = 0; buf2 < end; frames++) {
-            uint32_t header = AV_RB16(buf2);
-            if((header&0xFFF6) != 0xFFF0)
-                break;
-            fsize = (AV_RB32(buf2 + 3) >> 13) & 0x1FFF;
-            if(fsize < 7)
-                break;
-            buf2 += fsize;
-        }
-        max_frames = FFMAX(max_frames, frames);
-        if(buf == buf0)
-            first_frames= frames;
-    }
-    if   (first_frames>=3) return AVPROBE_SCORE_EXTENSION + 1;
-    else if(max_frames>500)return AVPROBE_SCORE_EXTENSION;
-    else if(max_frames>=3) return AVPROBE_SCORE_EXTENSION / 2;
-    else if(max_frames>=1) return 1;
-    else                   return 0;
-}
-
-static int adts_aac_read_header(AVFormatContext *s)
-{
-    AVStream *st;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = s->iformat->raw_codec_id;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-
-    ff_id3v1_read(s);
-
-    //LCM of all possible ADTS sample rates
-    avpriv_set_pts_info(st, 64, 1, 28224000);
-
-    return 0;
-}
-
-AVInputFormat ff_aac_demuxer = {
-    .name           = "aac",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw ADTS AAC (Advanced Audio Coding)"),
-    .read_probe     = adts_aac_probe,
-    .read_header    = adts_aac_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "aac",
-    .raw_codec_id   = AV_CODEC_ID_AAC,
-};
diff --git a/deps/libav/libavformat/ac3dec.c b/deps/libav/libavformat/ac3dec.c
deleted file mode 100644
index 4ceffa5..0000000
--- a/deps/libav/libavformat/ac3dec.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * RAW AC-3 and E-AC-3 demuxer
- * Copyright (c) 2007 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/crc.h"
-#include "libavcodec/ac3_parser.h"
-#include "avformat.h"
-#include "rawdec.h"
-
-static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
-{
-    int max_frames, first_frames = 0, frames;
-    uint8_t *buf, *buf2, *end;
-    AC3HeaderInfo hdr;
-    GetBitContext gbc;
-    enum AVCodecID codec_id = AV_CODEC_ID_AC3;
-
-    max_frames = 0;
-    buf = p->buf;
-    end = buf + p->buf_size;
-
-    for(; buf < end; buf++) {
-        buf2 = buf;
-
-        for(frames = 0; buf2 < end; frames++) {
-            init_get_bits(&gbc, buf2, 54);
-            if(avpriv_ac3_parse_header(&gbc, &hdr) < 0)
-                break;
-            if(buf2 + hdr.frame_size > end ||
-               av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf2 + 2, hdr.frame_size - 2))
-                break;
-            if (hdr.bitstream_id > 10)
-                codec_id = AV_CODEC_ID_EAC3;
-            buf2 += hdr.frame_size;
-        }
-        max_frames = FFMAX(max_frames, frames);
-        if(buf == p->buf)
-            first_frames = frames;
-    }
-    if(codec_id != expected_codec_id) return 0;
-    // keep this in sync with mp3 probe, both need to avoid
-    // issues with MPEG-files!
-    if (first_frames >= 4) return AVPROBE_SCORE_EXTENSION + 1;
-
-    if (max_frames) {
-        int pes = 0, i;
-        unsigned int code = -1;
-
-#define VIDEO_ID 0x000001e0
-#define AUDIO_ID 0x000001c0
-        /* do a search for mpegps headers to be able to properly bias
-         * towards mpegps if we detect this stream as both. */
-        for (i = 0; i<p->buf_size; i++) {
-            code = (code << 8) + p->buf[i];
-            if ((code & 0xffffff00) == 0x100) {
-                if     ((code & 0x1f0) == VIDEO_ID) pes++;
-                else if((code & 0x1e0) == AUDIO_ID) pes++;
-            }
-        }
-
-        if (pes)
-            max_frames = (max_frames + pes - 1) / pes;
-    }
-    if      (max_frames >  500) return AVPROBE_SCORE_EXTENSION;
-    else if (max_frames >= 4)   return AVPROBE_SCORE_EXTENSION / 2;
-    else if (max_frames >= 1)   return 1;
-    else                        return 0;
-}
-
-#if CONFIG_AC3_DEMUXER
-static int ac3_probe(AVProbeData *p)
-{
-    return ac3_eac3_probe(p, AV_CODEC_ID_AC3);
-}
-
-AVInputFormat ff_ac3_demuxer = {
-    .name           = "ac3",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw AC-3"),
-    .read_probe     = ac3_probe,
-    .read_header    = ff_raw_audio_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .extensions = "ac3",
-    .raw_codec_id   = AV_CODEC_ID_AC3,
-};
-#endif
-
-#if CONFIG_EAC3_DEMUXER
-static int eac3_probe(AVProbeData *p)
-{
-    return ac3_eac3_probe(p, AV_CODEC_ID_EAC3);
-}
-
-AVInputFormat ff_eac3_demuxer = {
-    .name           = "eac3",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
-    .read_probe     = eac3_probe,
-    .read_header    = ff_raw_audio_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "eac3",
-    .raw_codec_id   = AV_CODEC_ID_EAC3,
-};
-#endif
diff --git a/deps/libav/libavformat/adtsenc.c b/deps/libav/libavformat/adtsenc.c
deleted file mode 100644
index e7c9ca6..0000000
--- a/deps/libav/libavformat/adtsenc.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * ADTS muxer.
- * Copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier at smartjog.com>
- *                    Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/get_bits.h"
-#include "libavcodec/put_bits.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/mpeg4audio.h"
-#include "avformat.h"
-
-#define ADTS_HEADER_SIZE 7
-
-typedef struct {
-    int write_adts;
-    int objecttype;
-    int sample_rate_index;
-    int channel_conf;
-    int pce_size;
-    uint8_t pce_data[MAX_PCE_SIZE];
-} ADTSContext;
-
-#define ADTS_MAX_FRAME_BYTES ((1 << 13) - 1)
-
-static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf, int size)
-{
-    GetBitContext gb;
-    PutBitContext pb;
-    MPEG4AudioConfig m4ac;
-    int off;
-
-    init_get_bits(&gb, buf, size * 8);
-    off = avpriv_mpeg4audio_get_config(&m4ac, buf, size * 8, 1);
-    if (off < 0)
-        return off;
-    skip_bits_long(&gb, off);
-    adts->objecttype        = m4ac.object_type - 1;
-    adts->sample_rate_index = m4ac.sampling_index;
-    adts->channel_conf      = m4ac.chan_config;
-
-    if (adts->objecttype > 3U) {
-        av_log(s, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", adts->objecttype+1);
-        return -1;
-    }
-    if (adts->sample_rate_index == 15) {
-        av_log(s, AV_LOG_ERROR, "Escape sample rate index illegal in ADTS\n");
-        return -1;
-    }
-    if (get_bits(&gb, 1)) {
-        av_log(s, AV_LOG_ERROR, "960/120 MDCT window is not allowed in ADTS\n");
-        return -1;
-    }
-    if (get_bits(&gb, 1)) {
-        av_log(s, AV_LOG_ERROR, "Scalable configurations are not allowed in ADTS\n");
-        return -1;
-    }
-    if (get_bits(&gb, 1)) {
-        av_log(s, AV_LOG_ERROR, "Extension flag is not allowed in ADTS\n");
-        return -1;
-    }
-    if (!adts->channel_conf) {
-        init_put_bits(&pb, adts->pce_data, MAX_PCE_SIZE);
-
-        put_bits(&pb, 3, 5); //ID_PCE
-        adts->pce_size = (avpriv_copy_pce_data(&pb, &gb) + 3) / 8;
-        flush_put_bits(&pb);
-    }
-
-    adts->write_adts = 1;
-
-    return 0;
-}
-
-static int adts_write_header(AVFormatContext *s)
-{
-    ADTSContext *adts = s->priv_data;
-    AVCodecContext *avc = s->streams[0]->codec;
-
-    if (avc->extradata_size > 0 &&
-            adts_decode_extradata(s, adts, avc->extradata, avc->extradata_size) < 0)
-        return -1;
-
-    return 0;
-}
-
-static int adts_write_frame_header(ADTSContext *ctx,
-                                   uint8_t *buf, int size, int pce_size)
-{
-    PutBitContext pb;
-
-    unsigned full_frame_size = (unsigned)ADTS_HEADER_SIZE + size + pce_size;
-    if (full_frame_size > ADTS_MAX_FRAME_BYTES) {
-        av_log(NULL, AV_LOG_ERROR, "ADTS frame size too large: %u (max %d)\n",
-               full_frame_size, ADTS_MAX_FRAME_BYTES);
-        return AVERROR_INVALIDDATA;
-    }
-
-    init_put_bits(&pb, buf, ADTS_HEADER_SIZE);
-
-    /* adts_fixed_header */
-    put_bits(&pb, 12, 0xfff);   /* syncword */
-    put_bits(&pb, 1, 0);        /* ID */
-    put_bits(&pb, 2, 0);        /* layer */
-    put_bits(&pb, 1, 1);        /* protection_absent */
-    put_bits(&pb, 2, ctx->objecttype); /* profile_objecttype */
-    put_bits(&pb, 4, ctx->sample_rate_index);
-    put_bits(&pb, 1, 0);        /* private_bit */
-    put_bits(&pb, 3, ctx->channel_conf); /* channel_configuration */
-    put_bits(&pb, 1, 0);        /* original_copy */
-    put_bits(&pb, 1, 0);        /* home */
-
-    /* adts_variable_header */
-    put_bits(&pb, 1, 0);        /* copyright_identification_bit */
-    put_bits(&pb, 1, 0);        /* copyright_identification_start */
-    put_bits(&pb, 13, full_frame_size); /* aac_frame_length */
-    put_bits(&pb, 11, 0x7ff);   /* adts_buffer_fullness */
-    put_bits(&pb, 2, 0);        /* number_of_raw_data_blocks_in_frame */
-
-    flush_put_bits(&pb);
-
-    return 0;
-}
-
-static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    ADTSContext *adts = s->priv_data;
-    AVIOContext *pb = s->pb;
-    uint8_t buf[ADTS_HEADER_SIZE];
-
-    if (!pkt->size)
-        return 0;
-    if (adts->write_adts) {
-        int err = adts_write_frame_header(adts, buf, pkt->size,
-                                             adts->pce_size);
-        if (err < 0)
-            return err;
-        avio_write(pb, buf, ADTS_HEADER_SIZE);
-        if (adts->pce_size) {
-            avio_write(pb, adts->pce_data, adts->pce_size);
-            adts->pce_size = 0;
-        }
-    }
-    avio_write(pb, pkt->data, pkt->size);
-
-    return 0;
-}
-
-AVOutputFormat ff_adts_muxer = {
-    .name              = "adts",
-    .long_name         = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"),
-    .mime_type         = "audio/aac",
-    .extensions        = "aac,adts",
-    .priv_data_size    = sizeof(ADTSContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = adts_write_header,
-    .write_packet      = adts_write_packet,
-};
diff --git a/deps/libav/libavformat/adxdec.c b/deps/libav/libavformat/adxdec.c
deleted file mode 100644
index 49e1930..0000000
--- a/deps/libav/libavformat/adxdec.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * CRI ADX demuxer
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/adx.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define BLOCK_SIZE    18
-#define BLOCK_SAMPLES 32
-
-typedef struct ADXDemuxerContext {
-    int header_size;
-} ADXDemuxerContext;
-
-static int adx_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    ADXDemuxerContext *c = s->priv_data;
-    AVCodecContext *avctx = s->streams[0]->codec;
-    int ret, size;
-
-    size = BLOCK_SIZE * avctx->channels;
-
-    pkt->pos = avio_tell(s->pb);
-    pkt->stream_index = 0;
-
-    ret = av_get_packet(s->pb, pkt, size);
-    if (ret != size) {
-        av_free_packet(pkt);
-        return ret < 0 ? ret : AVERROR(EIO);
-    }
-    if (AV_RB16(pkt->data) & 0x8000) {
-        av_free_packet(pkt);
-        return AVERROR_EOF;
-    }
-    pkt->size     = size;
-    pkt->duration = 1;
-    pkt->pts      = (pkt->pos - c->header_size) / size;
-
-    return 0;
-}
-
-static int adx_read_header(AVFormatContext *s)
-{
-    ADXDemuxerContext *c = s->priv_data;
-    AVCodecContext *avctx;
-    int ret;
-
-    AVStream *st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    avctx = s->streams[0]->codec;
-
-    if (avio_rb16(s->pb) != 0x8000)
-        return AVERROR_INVALIDDATA;
-    c->header_size = avio_rb16(s->pb) + 4;
-    avio_seek(s->pb, -4, SEEK_CUR);
-
-    avctx->extradata = av_mallocz(c->header_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!avctx->extradata)
-        return AVERROR(ENOMEM);
-    if (avio_read(s->pb, avctx->extradata, c->header_size) < c->header_size) {
-        av_freep(&avctx->extradata);
-        return AVERROR(EIO);
-    }
-    avctx->extradata_size = c->header_size;
-
-    ret = avpriv_adx_decode_header(avctx, avctx->extradata,
-                                   avctx->extradata_size, &c->header_size,
-                                   NULL);
-    if (ret)
-        return ret;
-
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id    = s->iformat->raw_codec_id;
-
-    avpriv_set_pts_info(st, 64, BLOCK_SAMPLES, avctx->sample_rate);
-
-    return 0;
-}
-
-AVInputFormat ff_adx_demuxer = {
-    .name           = "adx",
-    .long_name      = NULL_IF_CONFIG_SMALL("CRI ADX"),
-    .priv_data_size = sizeof(ADXDemuxerContext),
-    .read_header    = adx_read_header,
-    .read_packet    = adx_read_packet,
-    .extensions     = "adx",
-    .raw_codec_id   = AV_CODEC_ID_ADPCM_ADX,
-    .flags          = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/aea.c b/deps/libav/libavformat/aea.c
deleted file mode 100644
index 7675009..0000000
--- a/deps/libav/libavformat/aea.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * MD STUDIO audio demuxer
- *
- * Copyright (c) 2009 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "pcm.h"
-
-#define AT1_SU_SIZE     212
-
-static int aea_read_probe(AVProbeData *p)
-{
-    if (p->buf_size <= 2048+212)
-        return 0;
-
-    /* Magic is '00 08 00 00' in Little Endian*/
-    if (AV_RL32(p->buf)==0x800) {
-        int bsm_s, bsm_e, inb_s, inb_e, ch;
-        ch    = p->buf[264];
-        bsm_s = p->buf[2048];
-        inb_s = p->buf[2048+1];
-        inb_e = p->buf[2048+210];
-        bsm_e = p->buf[2048+211];
-
-        if (ch != 1 && ch != 2)
-            return 0;
-
-        /* Check so that the redundant bsm bytes and info bytes are valid
-         * the block size mode bytes have to be the same
-         * the info bytes have to be the same
-         */
-        if (bsm_s == bsm_e && inb_s == inb_e)
-            return AVPROBE_SCORE_MAX / 4 + 1;
-    }
-    return 0;
-}
-
-static int aea_read_header(AVFormatContext *s)
-{
-    AVStream *st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    /* Parse the amount of channels and skip to pos 2048(0x800) */
-    avio_skip(s->pb, 264);
-    st->codec->channels = avio_r8(s->pb);
-    avio_skip(s->pb, 1783);
-
-
-    st->codec->codec_type     = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id       = AV_CODEC_ID_ATRAC1;
-    st->codec->sample_rate    = 44100;
-    st->codec->bit_rate       = 292000;
-
-    if (st->codec->channels != 1 && st->codec->channels != 2) {
-        av_log(s,AV_LOG_ERROR,"Channels %d not supported!\n",st->codec->channels);
-        return -1;
-    }
-
-    st->codec->channel_layout = (st->codec->channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
-
-    st->codec->block_align = AT1_SU_SIZE * st->codec->channels;
-    return 0;
-}
-
-static int aea_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret = av_get_packet(s->pb, pkt, s->streams[0]->codec->block_align);
-
-    pkt->stream_index = 0;
-    if (ret <= 0)
-        return AVERROR(EIO);
-
-    return ret;
-}
-
-AVInputFormat ff_aea_demuxer = {
-    .name           = "aea",
-    .long_name      = NULL_IF_CONFIG_SMALL("MD STUDIO audio"),
-    .read_probe     = aea_read_probe,
-    .read_header    = aea_read_header,
-    .read_packet    = aea_read_packet,
-    .read_seek      = ff_pcm_read_seek,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "aea",
-};
diff --git a/deps/libav/libavformat/aiff.h b/deps/libav/libavformat/aiff.h
deleted file mode 100644
index f88f957..0000000
--- a/deps/libav/libavformat/aiff.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * AIFF/AIFF-C muxer/demuxer common header
- * Copyright (c) 2006  Patrick Guimond
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * common header for AIFF muxer and demuxer
- */
-
-#ifndef AVFORMAT_AIFF_H
-#define AVFORMAT_AIFF_H
-
-#include "avformat.h"
-#include "internal.h"
-
-static const AVCodecTag ff_codec_aiff_tags[] = {
-    { AV_CODEC_ID_PCM_S16BE,    MKTAG('N','O','N','E') },
-    { AV_CODEC_ID_PCM_S8,       MKTAG('N','O','N','E') },
-    { AV_CODEC_ID_PCM_S24BE,    MKTAG('N','O','N','E') },
-    { AV_CODEC_ID_PCM_S32BE,    MKTAG('N','O','N','E') },
-    { AV_CODEC_ID_PCM_F32BE,    MKTAG('f','l','3','2') },
-    { AV_CODEC_ID_PCM_F64BE,    MKTAG('f','l','6','4') },
-    { AV_CODEC_ID_PCM_ALAW,     MKTAG('a','l','a','w') },
-    { AV_CODEC_ID_PCM_MULAW,    MKTAG('u','l','a','w') },
-    { AV_CODEC_ID_MACE3,        MKTAG('M','A','C','3') },
-    { AV_CODEC_ID_MACE6,        MKTAG('M','A','C','6') },
-    { AV_CODEC_ID_GSM,          MKTAG('G','S','M',' ') },
-    { AV_CODEC_ID_ADPCM_G726,   MKTAG('G','7','2','6') },
-    { AV_CODEC_ID_PCM_S16BE,    MKTAG('t','w','o','s') },
-    { AV_CODEC_ID_PCM_S16LE,    MKTAG('s','o','w','t') },
-    { AV_CODEC_ID_ADPCM_IMA_QT, MKTAG('i','m','a','4') },
-    { AV_CODEC_ID_QDM2,         MKTAG('Q','D','M','2') },
-    { AV_CODEC_ID_QCELP,        MKTAG('Q','c','l','p') },
-    { AV_CODEC_ID_NONE,         0 },
-};
-
-#endif /* AVFORMAT_AIFF_H */
diff --git a/deps/libav/libavformat/aiffdec.c b/deps/libav/libavformat/aiffdec.c
deleted file mode 100644
index 6243bcb..0000000
--- a/deps/libav/libavformat/aiffdec.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * AIFF/AIFF-C demuxer
- * Copyright (c) 2006  Patrick Guimond
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mathematics.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "internal.h"
-#include "pcm.h"
-#include "aiff.h"
-
-#define AIFF                    0
-#define AIFF_C_VERSION1         0xA2805140
-
-typedef struct {
-    int64_t data_end;
-    int block_duration;
-} AIFFInputContext;
-
-static enum AVCodecID aiff_codec_get_id(int bps)
-{
-    if (bps <= 8)
-        return AV_CODEC_ID_PCM_S8;
-    if (bps <= 16)
-        return AV_CODEC_ID_PCM_S16BE;
-    if (bps <= 24)
-        return AV_CODEC_ID_PCM_S24BE;
-    if (bps <= 32)
-        return AV_CODEC_ID_PCM_S32BE;
-
-    /* bigger than 32 isn't allowed  */
-    return AV_CODEC_ID_NONE;
-}
-
-/* returns the size of the found tag */
-static int get_tag(AVIOContext *pb, uint32_t * tag)
-{
-    int size;
-
-    if (pb->eof_reached)
-        return AVERROR(EIO);
-
-    *tag = avio_rl32(pb);
-    size = avio_rb32(pb);
-
-    if (size < 0)
-        size = 0x7fffffff;
-
-    return size;
-}
-
-/* Metadata string read */
-static void get_meta(AVFormatContext *s, const char *key, int size)
-{
-    uint8_t *str = av_malloc(size+1);
-    int res;
-
-    if (!str) {
-        avio_skip(s->pb, size);
-        return;
-    }
-
-    res = avio_read(s->pb, str, size);
-    if (res < 0)
-        return;
-
-    str[res] = 0;
-    av_dict_set(&s->metadata, key, str, AV_DICT_DONT_STRDUP_VAL);
-}
-
-/* Returns the number of sound data frames or negative on error */
-static unsigned int get_aiff_header(AVFormatContext *s, int size,
-                                    unsigned version)
-{
-    AVIOContext *pb        = s->pb;
-    AVCodecContext *codec  = s->streams[0]->codec;
-    AIFFInputContext *aiff = s->priv_data;
-    int exp;
-    uint64_t val;
-    double sample_rate;
-    unsigned int num_frames;
-
-    if (size & 1)
-        size++;
-    codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    codec->channels = avio_rb16(pb);
-    num_frames = avio_rb32(pb);
-    codec->bits_per_coded_sample = avio_rb16(pb);
-
-    exp = avio_rb16(pb);
-    val = avio_rb64(pb);
-    sample_rate = ldexp(val, exp - 16383 - 63);
-    codec->sample_rate = sample_rate;
-    size -= 18;
-
-    /* get codec id for AIFF-C */
-    if (version == AIFF_C_VERSION1) {
-        codec->codec_tag = avio_rl32(pb);
-        codec->codec_id  = ff_codec_get_id(ff_codec_aiff_tags, codec->codec_tag);
-        size -= 4;
-    }
-
-    if (version != AIFF_C_VERSION1 || codec->codec_id == AV_CODEC_ID_PCM_S16BE) {
-        codec->codec_id = aiff_codec_get_id(codec->bits_per_coded_sample);
-        codec->bits_per_coded_sample = av_get_bits_per_sample(codec->codec_id);
-        aiff->block_duration = 1;
-    } else {
-        switch (codec->codec_id) {
-        case AV_CODEC_ID_PCM_F32BE:
-        case AV_CODEC_ID_PCM_F64BE:
-        case AV_CODEC_ID_PCM_S16LE:
-        case AV_CODEC_ID_PCM_ALAW:
-        case AV_CODEC_ID_PCM_MULAW:
-            aiff->block_duration = 1;
-            break;
-        case AV_CODEC_ID_ADPCM_IMA_QT:
-            codec->block_align = 34*codec->channels;
-            break;
-        case AV_CODEC_ID_MACE3:
-            codec->block_align = 2*codec->channels;
-            break;
-        case AV_CODEC_ID_MACE6:
-            codec->block_align = 1*codec->channels;
-            break;
-        case AV_CODEC_ID_GSM:
-            codec->block_align = 33;
-            break;
-        case AV_CODEC_ID_QCELP:
-            codec->block_align = 35;
-            break;
-        default:
-            break;
-        }
-        if (codec->block_align > 0)
-            aiff->block_duration = av_get_audio_frame_duration(codec,
-                                                               codec->block_align);
-    }
-
-    /* Block align needs to be computed in all cases, as the definition
-     * is specific to applications -> here we use the WAVE format definition */
-    if (!codec->block_align)
-        codec->block_align = (codec->bits_per_coded_sample * codec->channels) >> 3;
-
-    if (aiff->block_duration) {
-        codec->bit_rate = codec->sample_rate * (codec->block_align << 3) /
-                          aiff->block_duration;
-    }
-
-    /* Chunk is over */
-    if (size)
-        avio_skip(pb, size);
-
-    return num_frames;
-}
-
-static int aiff_probe(AVProbeData *p)
-{
-    /* check file header */
-    if (p->buf[0] == 'F' && p->buf[1] == 'O' &&
-        p->buf[2] == 'R' && p->buf[3] == 'M' &&
-        p->buf[8] == 'A' && p->buf[9] == 'I' &&
-        p->buf[10] == 'F' && (p->buf[11] == 'F' || p->buf[11] == 'C'))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-/* aiff input */
-static int aiff_read_header(AVFormatContext *s)
-{
-    int size, filesize;
-    int64_t offset = 0;
-    uint32_t tag;
-    unsigned version = AIFF_C_VERSION1;
-    AVIOContext *pb = s->pb;
-    AVStream * st;
-    AIFFInputContext *aiff = s->priv_data;
-
-    /* check FORM header */
-    filesize = get_tag(pb, &tag);
-    if (filesize < 0 || tag != MKTAG('F', 'O', 'R', 'M'))
-        return AVERROR_INVALIDDATA;
-
-    /* AIFF data type */
-    tag = avio_rl32(pb);
-    if (tag == MKTAG('A', 'I', 'F', 'F'))       /* Got an AIFF file */
-        version = AIFF;
-    else if (tag != MKTAG('A', 'I', 'F', 'C'))  /* An AIFF-C file then */
-        return AVERROR_INVALIDDATA;
-
-    filesize -= 4;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    while (filesize > 0) {
-        /* parse different chunks */
-        size = get_tag(pb, &tag);
-        if (size < 0)
-            return size;
-
-        filesize -= size + 8;
-
-        switch (tag) {
-        case MKTAG('C', 'O', 'M', 'M'):     /* Common chunk */
-            /* Then for the complete header info */
-            st->nb_frames = get_aiff_header(s, size, version);
-            if (st->nb_frames < 0)
-                return st->nb_frames;
-            if (offset > 0) // COMM is after SSND
-                goto got_sound;
-            break;
-        case MKTAG('F', 'V', 'E', 'R'):     /* Version chunk */
-            version = avio_rb32(pb);
-            break;
-        case MKTAG('N', 'A', 'M', 'E'):     /* Sample name chunk */
-            get_meta(s, "title"    , size);
-            break;
-        case MKTAG('A', 'U', 'T', 'H'):     /* Author chunk */
-            get_meta(s, "author"   , size);
-            break;
-        case MKTAG('(', 'c', ')', ' '):     /* Copyright chunk */
-            get_meta(s, "copyright", size);
-            break;
-        case MKTAG('A', 'N', 'N', 'O'):     /* Annotation chunk */
-            get_meta(s, "comment"  , size);
-            break;
-        case MKTAG('S', 'S', 'N', 'D'):     /* Sampled sound chunk */
-            aiff->data_end = avio_tell(pb) + size;
-            offset = avio_rb32(pb);      /* Offset of sound data */
-            avio_rb32(pb);               /* BlockSize... don't care */
-            offset += avio_tell(pb);    /* Compute absolute data offset */
-            if (st->codec->block_align)    /* Assume COMM already parsed */
-                goto got_sound;
-            if (!pb->seekable) {
-                av_log(s, AV_LOG_ERROR, "file is not seekable\n");
-                return -1;
-            }
-            avio_skip(pb, size - 8);
-            break;
-        case MKTAG('w', 'a', 'v', 'e'):
-            if ((uint64_t)size > (1<<30))
-                return -1;
-            st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!st->codec->extradata)
-                return AVERROR(ENOMEM);
-            st->codec->extradata_size = size;
-            avio_read(pb, st->codec->extradata, size);
-            break;
-        default: /* Jump */
-            if (size & 1)   /* Always even aligned */
-                size++;
-            avio_skip(pb, size);
-        }
-    }
-
-got_sound:
-    if (!st->codec->block_align) {
-        av_log(s, AV_LOG_ERROR, "could not find COMM tag or invalid block_align value\n");
-        return -1;
-    }
-
-    /* Now positioned, get the sound data start and end */
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    st->start_time = 0;
-    st->duration = st->nb_frames * aiff->block_duration;
-
-    /* Position the stream at the first block */
-    avio_seek(pb, offset, SEEK_SET);
-
-    return 0;
-}
-
-#define MAX_SIZE 4096
-
-static int aiff_read_packet(AVFormatContext *s,
-                            AVPacket *pkt)
-{
-    AVStream *st = s->streams[0];
-    AIFFInputContext *aiff = s->priv_data;
-    int64_t max_size;
-    int res, size;
-
-    /* calculate size of remaining data */
-    max_size = aiff->data_end - avio_tell(s->pb);
-    if (max_size <= 0)
-        return AVERROR_EOF;
-
-    /* Now for that packet */
-    if (st->codec->block_align >= 33) // GSM, QCLP, IMA4
-        size = st->codec->block_align;
-    else
-        size = (MAX_SIZE / st->codec->block_align) * st->codec->block_align;
-    size = FFMIN(max_size, size);
-    res = av_get_packet(s->pb, pkt, size);
-    if (res < 0)
-        return res;
-
-    /* Only one stream in an AIFF file */
-    pkt->stream_index = 0;
-    pkt->duration     = (res / st->codec->block_align) * aiff->block_duration;
-    return 0;
-}
-
-AVInputFormat ff_aiff_demuxer = {
-    .name           = "aiff",
-    .long_name      = NULL_IF_CONFIG_SMALL("Audio IFF"),
-    .priv_data_size = sizeof(AIFFInputContext),
-    .read_probe     = aiff_probe,
-    .read_header    = aiff_read_header,
-    .read_packet    = aiff_read_packet,
-    .read_seek      = ff_pcm_read_seek,
-    .codec_tag      = (const AVCodecTag* const []){ ff_codec_aiff_tags, 0 },
-};
diff --git a/deps/libav/libavformat/aiffenc.c b/deps/libav/libavformat/aiffenc.c
deleted file mode 100644
index d4bffb3..0000000
--- a/deps/libav/libavformat/aiffenc.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * AIFF/AIFF-C muxer
- * Copyright (c) 2006  Patrick Guimond
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/intfloat.h"
-#include "avformat.h"
-#include "internal.h"
-#include "aiff.h"
-#include "avio_internal.h"
-
-typedef struct {
-    int64_t form;
-    int64_t frames;
-    int64_t ssnd;
-} AIFFOutputContext;
-
-static int aiff_write_header(AVFormatContext *s)
-{
-    AIFFOutputContext *aiff = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVCodecContext *enc = s->streams[0]->codec;
-    uint64_t sample_rate;
-    int aifc = 0;
-
-    /* First verify if format is ok */
-    if (!enc->codec_tag)
-        return -1;
-    if (enc->codec_tag != MKTAG('N','O','N','E'))
-        aifc = 1;
-
-    /* FORM AIFF header */
-    ffio_wfourcc(pb, "FORM");
-    aiff->form = avio_tell(pb);
-    avio_wb32(pb, 0);                    /* file length */
-    ffio_wfourcc(pb, aifc ? "AIFC" : "AIFF");
-
-    if (aifc) { // compressed audio
-        enc->bits_per_coded_sample = 16;
-        if (!enc->block_align) {
-            av_log(s, AV_LOG_ERROR, "block align not set\n");
-            return -1;
-        }
-        /* Version chunk */
-        ffio_wfourcc(pb, "FVER");
-        avio_wb32(pb, 4);
-        avio_wb32(pb, 0xA2805140);
-    }
-
-    /* Common chunk */
-    ffio_wfourcc(pb, "COMM");
-    avio_wb32(pb, aifc ? 24 : 18); /* size */
-    avio_wb16(pb, enc->channels);  /* Number of channels */
-
-    aiff->frames = avio_tell(pb);
-    avio_wb32(pb, 0);              /* Number of frames */
-
-    if (!enc->bits_per_coded_sample)
-        enc->bits_per_coded_sample = av_get_bits_per_sample(enc->codec_id);
-    if (!enc->bits_per_coded_sample) {
-        av_log(s, AV_LOG_ERROR, "could not compute bits per sample\n");
-        return -1;
-    }
-    if (!enc->block_align)
-        enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3;
-
-    avio_wb16(pb, enc->bits_per_coded_sample); /* Sample size */
-
-    sample_rate = av_double2int(enc->sample_rate);
-    avio_wb16(pb, (sample_rate >> 52) + (16383 - 1023));
-    avio_wb64(pb, UINT64_C(1) << 63 | sample_rate << 11);
-
-    if (aifc) {
-        avio_wl32(pb, enc->codec_tag);
-        avio_wb16(pb, 0);
-    }
-
-    /* Sound data chunk */
-    ffio_wfourcc(pb, "SSND");
-    aiff->ssnd = avio_tell(pb);         /* Sound chunk size */
-    avio_wb32(pb, 0);                    /* Sound samples data size */
-    avio_wb32(pb, 0);                    /* Data offset */
-    avio_wb32(pb, 0);                    /* Block-size (block align) */
-
-    avpriv_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
-
-    /* Data is starting here */
-    avio_flush(pb);
-
-    return 0;
-}
-
-static int aiff_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    avio_write(pb, pkt->data, pkt->size);
-    return 0;
-}
-
-static int aiff_write_trailer(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AIFFOutputContext *aiff = s->priv_data;
-    AVCodecContext *enc = s->streams[0]->codec;
-
-    /* Chunks sizes must be even */
-    int64_t file_size, end_size;
-    end_size = file_size = avio_tell(pb);
-    if (file_size & 1) {
-        avio_w8(pb, 0);
-        end_size++;
-    }
-
-    if (s->pb->seekable) {
-        /* File length */
-        avio_seek(pb, aiff->form, SEEK_SET);
-        avio_wb32(pb, file_size - aiff->form - 4);
-
-        /* Number of sample frames */
-        avio_seek(pb, aiff->frames, SEEK_SET);
-        avio_wb32(pb, (file_size-aiff->ssnd-12)/enc->block_align);
-
-        /* Sound Data chunk size */
-        avio_seek(pb, aiff->ssnd, SEEK_SET);
-        avio_wb32(pb, file_size - aiff->ssnd - 4);
-
-        /* return to the end */
-        avio_seek(pb, end_size, SEEK_SET);
-
-        avio_flush(pb);
-    }
-
-    return 0;
-}
-
-AVOutputFormat ff_aiff_muxer = {
-    .name              = "aiff",
-    .long_name         = NULL_IF_CONFIG_SMALL("Audio IFF"),
-    .mime_type         = "audio/aiff",
-    .extensions        = "aif,aiff,afc,aifc",
-    .priv_data_size    = sizeof(AIFFOutputContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16BE,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = aiff_write_header,
-    .write_packet      = aiff_write_packet,
-    .write_trailer     = aiff_write_trailer,
-    .codec_tag         = (const AVCodecTag* const []){ ff_codec_aiff_tags, 0 },
-};
diff --git a/deps/libav/libavformat/allformats.c b/deps/libav/libavformat/allformats.c
deleted file mode 100644
index 52a121e..0000000
--- a/deps/libav/libavformat/allformats.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Register all the formats and protocols
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtp.h"
-#include "rdt.h"
-#include "url.h"
-#include "version.h"
-
-#define REGISTER_MUXER(X, x)                                            \
-    {                                                                   \
-        extern AVOutputFormat ff_##x##_muxer;                           \
-        if (CONFIG_##X##_MUXER)                                         \
-            av_register_output_format(&ff_##x##_muxer);                 \
-    }
-
-#define REGISTER_DEMUXER(X, x)                                          \
-    {                                                                   \
-        extern AVInputFormat ff_##x##_demuxer;                          \
-        if (CONFIG_##X##_DEMUXER)                                       \
-            av_register_input_format(&ff_##x##_demuxer);                \
-    }
-
-#define REGISTER_MUXDEMUX(X, x) REGISTER_MUXER(X, x); REGISTER_DEMUXER(X, x)
-
-#define REGISTER_PROTOCOL(X, x)                                         \
-    {                                                                   \
-        extern URLProtocol ff_##x##_protocol;                           \
-        if (CONFIG_##X##_PROTOCOL)                                      \
-            ffurl_register_protocol(&ff_##x##_protocol);                \
-    }
-
-void av_register_all(void)
-{
-    static int initialized;
-
-    if (initialized)
-        return;
-    initialized = 1;
-
-    avcodec_register_all();
-
-    /* (de)muxers */
-    REGISTER_MUXER   (A64,              a64);
-    REGISTER_DEMUXER (AAC,              aac);
-    REGISTER_MUXDEMUX(AC3,              ac3);
-    REGISTER_MUXER   (ADTS,             adts);
-    REGISTER_MUXDEMUX(ADX,              adx);
-    REGISTER_DEMUXER (AEA,              aea);
-    REGISTER_MUXDEMUX(AIFF,             aiff);
-    REGISTER_MUXDEMUX(AMR,              amr);
-    REGISTER_DEMUXER (ANM,              anm);
-    REGISTER_DEMUXER (APC,              apc);
-    REGISTER_DEMUXER (APE,              ape);
-    REGISTER_MUXDEMUX(ASF,              asf);
-    REGISTER_MUXDEMUX(ASS,              ass);
-    REGISTER_MUXER   (ASF_STREAM,       asf_stream);
-    REGISTER_MUXDEMUX(AU,               au);
-    REGISTER_MUXDEMUX(AVI,              avi);
-    REGISTER_DEMUXER (AVISYNTH,         avisynth);
-    REGISTER_MUXER   (AVM2,             avm2);
-    REGISTER_DEMUXER (AVS,              avs);
-    REGISTER_DEMUXER (BETHSOFTVID,      bethsoftvid);
-    REGISTER_DEMUXER (BFI,              bfi);
-    REGISTER_DEMUXER (BINK,             bink);
-    REGISTER_DEMUXER (BMV,              bmv);
-    REGISTER_DEMUXER (C93,              c93);
-    REGISTER_DEMUXER (CAF,              caf);
-    REGISTER_MUXDEMUX(CAVSVIDEO,        cavsvideo);
-    REGISTER_DEMUXER (CDG,              cdg);
-    REGISTER_DEMUXER (CDXL,             cdxl);
-    REGISTER_MUXER   (CRC,              crc);
-    REGISTER_MUXDEMUX(DAUD,             daud);
-    REGISTER_DEMUXER (DFA,              dfa);
-    REGISTER_MUXDEMUX(DIRAC,            dirac);
-    REGISTER_MUXDEMUX(DNXHD,            dnxhd);
-    REGISTER_DEMUXER (DSICIN,           dsicin);
-    REGISTER_MUXDEMUX(DTS,              dts);
-    REGISTER_MUXDEMUX(DV,               dv);
-    REGISTER_DEMUXER (DXA,              dxa);
-    REGISTER_DEMUXER (EA,               ea);
-    REGISTER_DEMUXER (EA_CDATA,         ea_cdata);
-    REGISTER_MUXDEMUX(EAC3,             eac3);
-    REGISTER_MUXER   (F4V,              f4v);
-    REGISTER_MUXDEMUX(FFM,              ffm);
-    REGISTER_MUXDEMUX(FFMETADATA,       ffmetadata);
-    REGISTER_MUXDEMUX(FILMSTRIP,        filmstrip);
-    REGISTER_MUXDEMUX(FLAC,             flac);
-    REGISTER_DEMUXER (FLIC,             flic);
-    REGISTER_MUXDEMUX(FLV,              flv);
-    REGISTER_DEMUXER (FOURXM,           fourxm);
-    REGISTER_MUXER   (FRAMECRC,         framecrc);
-    REGISTER_MUXER   (FRAMEMD5,         framemd5);
-    REGISTER_MUXDEMUX(G722,             g722);
-    REGISTER_DEMUXER (G723_1,           g723_1);
-    REGISTER_MUXER   (GIF,              gif);
-    REGISTER_DEMUXER (GSM,              gsm);
-    REGISTER_MUXDEMUX(GXF,              gxf);
-    REGISTER_MUXDEMUX(H261,             h261);
-    REGISTER_MUXDEMUX(H263,             h263);
-    REGISTER_MUXDEMUX(H264,             h264);
-    REGISTER_MUXER   (HDS,              hds);
-    REGISTER_MUXDEMUX(HEVC,             hevc);
-    REGISTER_MUXDEMUX(HLS,              hls);
-    REGISTER_DEMUXER (HNM,              hnm);
-    REGISTER_DEMUXER (IDCIN,            idcin);
-    REGISTER_DEMUXER (IFF,              iff);
-    REGISTER_MUXDEMUX(ILBC,             ilbc);
-    REGISTER_MUXDEMUX(IMAGE2,           image2);
-    REGISTER_MUXDEMUX(IMAGE2PIPE,       image2pipe);
-    REGISTER_DEMUXER (INGENIENT,        ingenient);
-    REGISTER_DEMUXER (IPMOVIE,          ipmovie);
-    REGISTER_MUXER   (IPOD,             ipod);
-    REGISTER_MUXER   (ISMV,             ismv);
-    REGISTER_DEMUXER (ISS,              iss);
-    REGISTER_DEMUXER (IV8,              iv8);
-    REGISTER_MUXDEMUX(IVF,              ivf);
-    REGISTER_DEMUXER (JV,               jv);
-    REGISTER_MUXDEMUX(LATM,             latm);
-    REGISTER_DEMUXER (LMLM4,            lmlm4);
-    REGISTER_DEMUXER (LXF,              lxf);
-    REGISTER_MUXDEMUX(M4V,              m4v);
-    REGISTER_MUXER   (MD5,              md5);
-    REGISTER_MUXDEMUX(MATROSKA,         matroska);
-    REGISTER_MUXER   (MATROSKA_AUDIO,   matroska_audio);
-    REGISTER_MUXDEMUX(MJPEG,            mjpeg);
-    REGISTER_MUXDEMUX(MLP,              mlp);
-    REGISTER_DEMUXER (MM,               mm);
-    REGISTER_MUXDEMUX(MMF,              mmf);
-    REGISTER_MUXDEMUX(MOV,              mov);
-    REGISTER_MUXER   (MP2,              mp2);
-    REGISTER_MUXDEMUX(MP3,              mp3);
-    REGISTER_MUXER   (MP4,              mp4);
-    REGISTER_DEMUXER (MPC,              mpc);
-    REGISTER_DEMUXER (MPC8,             mpc8);
-    REGISTER_MUXER   (MPEG1SYSTEM,      mpeg1system);
-    REGISTER_MUXER   (MPEG1VCD,         mpeg1vcd);
-    REGISTER_MUXER   (MPEG1VIDEO,       mpeg1video);
-    REGISTER_MUXER   (MPEG2DVD,         mpeg2dvd);
-    REGISTER_MUXER   (MPEG2SVCD,        mpeg2svcd);
-    REGISTER_MUXER   (MPEG2VIDEO,       mpeg2video);
-    REGISTER_MUXER   (MPEG2VOB,         mpeg2vob);
-    REGISTER_DEMUXER (MPEGPS,           mpegps);
-    REGISTER_MUXDEMUX(MPEGTS,           mpegts);
-    REGISTER_DEMUXER (MPEGTSRAW,        mpegtsraw);
-    REGISTER_DEMUXER (MPEGVIDEO,        mpegvideo);
-    REGISTER_MUXER   (MPJPEG,           mpjpeg);
-    REGISTER_DEMUXER (MSNWC_TCP,        msnwc_tcp);
-    REGISTER_DEMUXER (MTV,              mtv);
-    REGISTER_DEMUXER (MVI,              mvi);
-    REGISTER_MUXDEMUX(MXF,              mxf);
-    REGISTER_MUXER   (MXF_D10,          mxf_d10);
-    REGISTER_DEMUXER (MXG,              mxg);
-    REGISTER_DEMUXER (NC,               nc);
-    REGISTER_DEMUXER (NSV,              nsv);
-    REGISTER_MUXER   (NULL,             null);
-    REGISTER_MUXDEMUX(NUT,              nut);
-    REGISTER_DEMUXER (NUV,              nuv);
-    REGISTER_MUXDEMUX(OGG,              ogg);
-    REGISTER_MUXDEMUX(OMA,              oma);
-    REGISTER_MUXDEMUX(PCM_ALAW,         pcm_alaw);
-    REGISTER_MUXDEMUX(PCM_MULAW,        pcm_mulaw);
-    REGISTER_MUXDEMUX(PCM_F64BE,        pcm_f64be);
-    REGISTER_MUXDEMUX(PCM_F64LE,        pcm_f64le);
-    REGISTER_MUXDEMUX(PCM_F32BE,        pcm_f32be);
-    REGISTER_MUXDEMUX(PCM_F32LE,        pcm_f32le);
-    REGISTER_MUXDEMUX(PCM_S32BE,        pcm_s32be);
-    REGISTER_MUXDEMUX(PCM_S32LE,        pcm_s32le);
-    REGISTER_MUXDEMUX(PCM_S24BE,        pcm_s24be);
-    REGISTER_MUXDEMUX(PCM_S24LE,        pcm_s24le);
-    REGISTER_MUXDEMUX(PCM_S16BE,        pcm_s16be);
-    REGISTER_MUXDEMUX(PCM_S16LE,        pcm_s16le);
-    REGISTER_MUXDEMUX(PCM_S8,           pcm_s8);
-    REGISTER_MUXDEMUX(PCM_U32BE,        pcm_u32be);
-    REGISTER_MUXDEMUX(PCM_U32LE,        pcm_u32le);
-    REGISTER_MUXDEMUX(PCM_U24BE,        pcm_u24be);
-    REGISTER_MUXDEMUX(PCM_U24LE,        pcm_u24le);
-    REGISTER_MUXDEMUX(PCM_U16BE,        pcm_u16be);
-    REGISTER_MUXDEMUX(PCM_U16LE,        pcm_u16le);
-    REGISTER_MUXDEMUX(PCM_U8,           pcm_u8);
-    REGISTER_DEMUXER (PMP,              pmp);
-    REGISTER_MUXER   (PSP,              psp);
-    REGISTER_DEMUXER (PVA,              pva);
-    REGISTER_DEMUXER (QCP,              qcp);
-    REGISTER_DEMUXER (R3D,              r3d);
-    REGISTER_MUXDEMUX(RAWVIDEO,         rawvideo);
-    REGISTER_DEMUXER (RL2,              rl2);
-    REGISTER_MUXDEMUX(RM,               rm);
-    REGISTER_MUXDEMUX(ROQ,              roq);
-    REGISTER_DEMUXER (RPL,              rpl);
-    REGISTER_MUXDEMUX(RSO,              rso);
-    REGISTER_MUXDEMUX(RTP,              rtp);
-    REGISTER_MUXDEMUX(RTSP,             rtsp);
-    REGISTER_MUXDEMUX(SAP,              sap);
-    REGISTER_DEMUXER (SDP,              sdp);
-#if CONFIG_RTPDEC
-    ff_register_rtp_dynamic_payload_handlers();
-    ff_register_rdt_dynamic_payload_handlers();
-#endif
-    REGISTER_DEMUXER (SEGAFILM,         segafilm);
-    REGISTER_MUXER   (SEGMENT,          segment);
-    REGISTER_DEMUXER (SHORTEN,          shorten);
-    REGISTER_DEMUXER (SIFF,             siff);
-    REGISTER_DEMUXER (SMACKER,          smacker);
-    REGISTER_MUXDEMUX(SMJPEG,           smjpeg);
-    REGISTER_MUXER   (SMOOTHSTREAMING,  smoothstreaming);
-    REGISTER_DEMUXER (SOL,              sol);
-    REGISTER_MUXDEMUX(SOX,              sox);
-    REGISTER_MUXDEMUX(SPDIF,            spdif);
-    REGISTER_MUXDEMUX(SRT,              srt);
-    REGISTER_DEMUXER (STR,              str);
-    REGISTER_MUXDEMUX(SWF,              swf);
-    REGISTER_DEMUXER (TAK,              tak);
-    REGISTER_MUXER   (TG2,              tg2);
-    REGISTER_MUXER   (TGP,              tgp);
-    REGISTER_DEMUXER (THP,              thp);
-    REGISTER_DEMUXER (TIERTEXSEQ,       tiertexseq);
-    REGISTER_DEMUXER (TMV,              tmv);
-    REGISTER_MUXDEMUX(TRUEHD,           truehd);
-    REGISTER_DEMUXER (TTA,              tta);
-    REGISTER_DEMUXER (TXD,              txd);
-    REGISTER_DEMUXER (TTY,              tty);
-    REGISTER_DEMUXER (VC1,              vc1);
-    REGISTER_MUXDEMUX(VC1T,             vc1t);
-    REGISTER_DEMUXER (VMD,              vmd);
-    REGISTER_MUXDEMUX(VOC,              voc);
-    REGISTER_DEMUXER (VQF,              vqf);
-    REGISTER_DEMUXER (W64,              w64);
-    REGISTER_MUXDEMUX(WAV,              wav);
-    REGISTER_DEMUXER (WC3,              wc3);
-    REGISTER_MUXER   (WEBM,             webm);
-    REGISTER_DEMUXER (WSAUD,            wsaud);
-    REGISTER_DEMUXER (WSVQA,            wsvqa);
-    REGISTER_DEMUXER (WTV,              wtv);
-    REGISTER_MUXDEMUX(WV,               wv);
-    REGISTER_DEMUXER (XA,               xa);
-    REGISTER_DEMUXER (XMV,              xmv);
-    REGISTER_DEMUXER (XWMA,             xwma);
-    REGISTER_DEMUXER (YOP,              yop);
-    REGISTER_MUXDEMUX(YUV4MPEGPIPE,     yuv4mpegpipe);
-
-    /* protocols */
-    REGISTER_PROTOCOL(CONCAT,           concat);
-    REGISTER_PROTOCOL(CRYPTO,           crypto);
-    REGISTER_PROTOCOL(FFRTMPCRYPT,      ffrtmpcrypt);
-    REGISTER_PROTOCOL(FFRTMPHTTP,       ffrtmphttp);
-    REGISTER_PROTOCOL(FILE,             file);
-    REGISTER_PROTOCOL(GOPHER,           gopher);
-    REGISTER_PROTOCOL(HLS,              hls);
-    REGISTER_PROTOCOL(HTTP,             http);
-    REGISTER_PROTOCOL(HTTPPROXY,        httpproxy);
-    REGISTER_PROTOCOL(HTTPS,            https);
-    REGISTER_PROTOCOL(MMSH,             mmsh);
-    REGISTER_PROTOCOL(MMST,             mmst);
-    REGISTER_PROTOCOL(MD5,              md5);
-    REGISTER_PROTOCOL(PIPE,             pipe);
-    REGISTER_PROTOCOL(RTMP,             rtmp);
-    REGISTER_PROTOCOL(RTMPE,            rtmpe);
-    REGISTER_PROTOCOL(RTMPS,            rtmps);
-    REGISTER_PROTOCOL(RTMPT,            rtmpt);
-    REGISTER_PROTOCOL(RTMPTE,           rtmpte);
-    REGISTER_PROTOCOL(RTMPTS,           rtmpts);
-    REGISTER_PROTOCOL(RTP,              rtp);
-    REGISTER_PROTOCOL(SCTP,             sctp);
-    REGISTER_PROTOCOL(SRTP,             srtp);
-    REGISTER_PROTOCOL(TCP,              tcp);
-    REGISTER_PROTOCOL(TLS,              tls);
-    REGISTER_PROTOCOL(UDP,              udp);
-    REGISTER_PROTOCOL(UNIX,             unix);
-
-    /* external libraries */
-    REGISTER_PROTOCOL(LIBRTMP,          librtmp);
-    REGISTER_PROTOCOL(LIBRTMPE,         librtmpe);
-    REGISTER_PROTOCOL(LIBRTMPS,         librtmps);
-    REGISTER_PROTOCOL(LIBRTMPT,         librtmpt);
-    REGISTER_PROTOCOL(LIBRTMPTE,        librtmpte);
-}
diff --git a/deps/libav/libavformat/amr.c b/deps/libav/libavformat/amr.c
deleted file mode 100644
index 3b1a468..0000000
--- a/deps/libav/libavformat/amr.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * amr file format
- * Copyright (c) 2001 ffmpeg project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
-Write and read amr data according to RFC3267, http://www.ietf.org/rfc/rfc3267.txt?number=3267
-
-Only mono files are supported.
-
-*/
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-#include "internal.h"
-
-static const char AMR_header[]   = "#!AMR\n";
-static const char AMRWB_header[] = "#!AMR-WB\n";
-
-#if CONFIG_AMR_MUXER
-static int amr_write_header(AVFormatContext *s)
-{
-    AVIOContext    *pb  = s->pb;
-    AVCodecContext *enc = s->streams[0]->codec;
-
-    s->priv_data = NULL;
-
-    if (enc->codec_id == AV_CODEC_ID_AMR_NB) {
-        avio_write(pb, AMR_header,   sizeof(AMR_header)   - 1); /* magic number */
-    } else if (enc->codec_id == AV_CODEC_ID_AMR_WB) {
-        avio_write(pb, AMRWB_header, sizeof(AMRWB_header) - 1); /* magic number */
-    } else {
-        return -1;
-    }
-    avio_flush(pb);
-    return 0;
-}
-
-static int amr_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    avio_write(s->pb, pkt->data, pkt->size);
-    return 0;
-}
-#endif /* CONFIG_AMR_MUXER */
-
-static int amr_probe(AVProbeData *p)
-{
-    // Only check for "#!AMR" which could be amr-wb, amr-nb.
-    // This will also trigger multichannel files: "#!AMR_MC1.0\n" and
-    // "#!AMR-WB_MC1.0\n" (not supported)
-
-    if (!memcmp(p->buf, AMR_header, 5))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-/* amr input */
-static int amr_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    uint8_t header[9];
-
-    avio_read(pb, header, 6);
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    if (memcmp(header, AMR_header, 6)) {
-        avio_read(pb, header + 6, 3);
-        if (memcmp(header, AMRWB_header, 9)) {
-            return -1;
-        }
-
-        st->codec->codec_tag   = MKTAG('s', 'a', 'w', 'b');
-        st->codec->codec_id    = AV_CODEC_ID_AMR_WB;
-        st->codec->sample_rate = 16000;
-    } else {
-        st->codec->codec_tag   = MKTAG('s', 'a', 'm', 'r');
-        st->codec->codec_id    = AV_CODEC_ID_AMR_NB;
-        st->codec->sample_rate = 8000;
-    }
-    st->codec->channels   = 1;
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-
-    return 0;
-}
-
-static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVCodecContext *enc = s->streams[0]->codec;
-    int read, size = 0, toc, mode;
-    int64_t pos = avio_tell(s->pb);
-
-    if (s->pb->eof_reached) {
-        return AVERROR(EIO);
-    }
-
-    // FIXME this is wrong, this should rather be in a AVParset
-    toc  = avio_r8(s->pb);
-    mode = (toc >> 3) & 0x0F;
-
-    if (enc->codec_id == AV_CODEC_ID_AMR_NB) {
-        static const uint8_t packed_size[16] = {
-            12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0
-        };
-
-        size = packed_size[mode] + 1;
-    } else if (enc->codec_id == AV_CODEC_ID_AMR_WB) {
-        static const uint8_t packed_size[16] = {
-            18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1
-        };
-
-        size = packed_size[mode];
-    } else {
-        assert(0);
-    }
-
-    if (!size || av_new_packet(pkt, size))
-        return AVERROR(EIO);
-
-    /* Both AMR formats have 50 frames per second */
-    s->streams[0]->codec->bit_rate = size*8*50;
-
-    pkt->stream_index = 0;
-    pkt->pos          = pos;
-    pkt->data[0]      = toc;
-    pkt->duration     = enc->codec_id == AV_CODEC_ID_AMR_NB ? 160 : 320;
-    read              = avio_read(s->pb, pkt->data + 1, size - 1);
-
-    if (read != size - 1) {
-        av_free_packet(pkt);
-        return AVERROR(EIO);
-    }
-
-    return 0;
-}
-
-#if CONFIG_AMR_DEMUXER
-AVInputFormat ff_amr_demuxer = {
-    .name           = "amr",
-    .long_name      = NULL_IF_CONFIG_SMALL("3GPP AMR"),
-    .read_probe     = amr_probe,
-    .read_header    = amr_read_header,
-    .read_packet    = amr_read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-};
-#endif
-
-#if CONFIG_AMR_MUXER
-AVOutputFormat ff_amr_muxer = {
-    .name              = "amr",
-    .long_name         = NULL_IF_CONFIG_SMALL("3GPP AMR"),
-    .mime_type         = "audio/amr",
-    .extensions        = "amr",
-    .audio_codec       = AV_CODEC_ID_AMR_NB,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = amr_write_header,
-    .write_packet      = amr_write_packet,
-};
-#endif
diff --git a/deps/libav/libavformat/anm.c b/deps/libav/libavformat/anm.c
deleted file mode 100644
index f781492..0000000
--- a/deps/libav/libavformat/anm.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Deluxe Paint Animation demuxer
- * Copyright (c) 2009 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Deluxe Paint Animation demuxer
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct {
-    int base_record;
-    unsigned int nb_records;
-    int size;
-} Page;
-
-typedef struct {
-    unsigned int nb_pages;    /**< total pages in file */
-    unsigned int nb_records;  /**< total records in file */
-    int page_table_offset;
-#define MAX_PAGES  256        /**< Deluxe Paint hardcoded value */
-    Page pt[MAX_PAGES];       /**< page table */
-    int page;                 /**< current page (or AVERROR_xxx code) */
-    int record;               /**< current record (with in page) */
-} AnmDemuxContext;
-
-#define LPF_TAG  MKTAG('L','P','F',' ')
-#define ANIM_TAG MKTAG('A','N','I','M')
-
-static int probe(AVProbeData *p)
-{
-    /* verify tags and video dimensions */
-    if (AV_RL32(&p->buf[0])  == LPF_TAG &&
-        AV_RL32(&p->buf[16]) == ANIM_TAG &&
-        AV_RL16(&p->buf[20]) && AV_RL16(&p->buf[22]))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-/**
- * @return page containing the requested record or AVERROR_XXX
- */
-static int find_record(const AnmDemuxContext *anm, int record)
-{
-    int i;
-
-    if (record >= anm->nb_records)
-        return AVERROR_EOF;
-
-    for (i = 0; i < MAX_PAGES; i++) {
-        const Page *p = &anm->pt[i];
-        if (p->nb_records > 0 && record >= p->base_record && record < p->base_record + p->nb_records)
-            return i;
-    }
-
-    return AVERROR_INVALIDDATA;
-}
-
-static int read_header(AVFormatContext *s)
-{
-    AnmDemuxContext *anm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    int i, ret;
-
-    avio_skip(pb, 4); /* magic number */
-    if (avio_rl16(pb) != MAX_PAGES) {
-        avpriv_request_sample(s, "max_pages != " AV_STRINGIFY(MAX_PAGES));
-        return AVERROR_PATCHWELCOME;
-    }
-
-    anm->nb_pages   = avio_rl16(pb);
-    anm->nb_records = avio_rl32(pb);
-    avio_skip(pb, 2); /* max records per page */
-    anm->page_table_offset = avio_rl16(pb);
-    if (avio_rl32(pb) != ANIM_TAG)
-        return AVERROR_INVALIDDATA;
-
-    /* video stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_ANM;
-    st->codec->codec_tag  = 0; /* no fourcc */
-    st->codec->width      = avio_rl16(pb);
-    st->codec->height     = avio_rl16(pb);
-    if (avio_r8(pb) != 0)
-        goto invalid;
-    avio_skip(pb, 1); /* frame rate multiplier info */
-
-    /* ignore last delta record (used for looping) */
-    if (avio_r8(pb))  /* has_last_delta */
-        anm->nb_records = FFMAX(anm->nb_records - 1, 0);
-
-    avio_skip(pb, 1); /* last_delta_valid */
-
-    if (avio_r8(pb) != 0)
-        goto invalid;
-
-    if (avio_r8(pb) != 1)
-        goto invalid;
-
-    avio_skip(pb, 1); /* other recs per frame */
-
-    if (avio_r8(pb) != 1)
-        goto invalid;
-
-    avio_skip(pb, 32); /* record_types */
-    st->nb_frames = avio_rl32(pb);
-    avpriv_set_pts_info(st, 64, 1, avio_rl16(pb));
-    avio_skip(pb, 58);
-
-    /* color cycling and palette data */
-    st->codec->extradata_size = 16*8 + 4*256;
-    st->codec->extradata      = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata) {
-        return AVERROR(ENOMEM);
-    }
-    ret = avio_read(pb, st->codec->extradata, st->codec->extradata_size);
-    if (ret < 0)
-        return ret;
-
-    /* read page table */
-    ret = avio_seek(pb, anm->page_table_offset, SEEK_SET);
-    if (ret < 0)
-        return ret;
-
-    for (i = 0; i < MAX_PAGES; i++) {
-        Page *p = &anm->pt[i];
-        p->base_record = avio_rl16(pb);
-        p->nb_records  = avio_rl16(pb);
-        p->size        = avio_rl16(pb);
-    }
-
-    /* find page of first frame */
-    anm->page = find_record(anm, 0);
-    if (anm->page < 0) {
-        return anm->page;
-    }
-
-    anm->record = -1;
-    return 0;
-
-invalid:
-    avpriv_request_sample(s, "Invalid header element");
-    return AVERROR_PATCHWELCOME;
-}
-
-static int read_packet(AVFormatContext *s,
-                       AVPacket *pkt)
-{
-    AnmDemuxContext *anm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    Page *p;
-    int tmp, record_size;
-
-    if (s->pb->eof_reached)
-        return AVERROR(EIO);
-
-    if (anm->page < 0)
-        return anm->page;
-
-repeat:
-    p = &anm->pt[anm->page];
-
-    /* parse page header */
-    if (anm->record < 0) {
-        avio_seek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16), SEEK_SET);
-        avio_skip(pb, 8 + 2*p->nb_records);
-        anm->record = 0;
-    }
-
-    /* if we have fetched all records in this page, then find the
-       next page and repeat */
-    if (anm->record >= p->nb_records) {
-        anm->page = find_record(anm, p->base_record + p->nb_records);
-        if (anm->page < 0)
-            return anm->page;
-        anm->record = -1;
-        goto repeat;
-    }
-
-    /* fetch record size */
-    tmp = avio_tell(pb);
-    avio_seek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16) +
-              8 + anm->record * 2, SEEK_SET);
-    record_size = avio_rl16(pb);
-    avio_seek(pb, tmp, SEEK_SET);
-
-    /* fetch record */
-    pkt->size = av_get_packet(s->pb, pkt, record_size);
-    if (pkt->size < 0)
-        return pkt->size;
-    if (p->base_record + anm->record == 0)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-
-    anm->record++;
-    return 0;
-}
-
-AVInputFormat ff_anm_demuxer = {
-    .name           = "anm",
-    .long_name      = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
-    .priv_data_size = sizeof(AnmDemuxContext),
-    .read_probe     = probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-};
diff --git a/deps/libav/libavformat/apc.c b/deps/libav/libavformat/apc.c
deleted file mode 100644
index 0b6c583..0000000
--- a/deps/libav/libavformat/apc.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * CRYO APC audio format demuxer
- * Copyright (c) 2007 Anssi Hannula <anssi.hannula at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-
-static int apc_probe(AVProbeData *p)
-{
-    if (!strncmp(p->buf, "CRYO_APC", 8))
-        return AVPROBE_SCORE_MAX;
-
-    return 0;
-}
-
-static int apc_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-
-    avio_rl32(pb); /* CRYO */
-    avio_rl32(pb); /* _APC */
-    avio_rl32(pb); /* 1.20 */
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_APC;
-
-    avio_rl32(pb); /* number of samples */
-    st->codec->sample_rate = avio_rl32(pb);
-
-    st->codec->extradata_size = 2 * 4;
-    st->codec->extradata = av_malloc(st->codec->extradata_size +
-                                     FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata)
-        return AVERROR(ENOMEM);
-
-    /* initial predictor values for adpcm decoder */
-    avio_read(pb, st->codec->extradata, 2 * 4);
-
-    if (avio_rl32(pb)) {
-        st->codec->channels       = 2;
-        st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-    } else {
-        st->codec->channels       = 1;
-        st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    }
-
-    st->codec->bits_per_coded_sample = 4;
-    st->codec->bit_rate = st->codec->bits_per_coded_sample * st->codec->channels
-                          * st->codec->sample_rate;
-    st->codec->block_align = 1;
-
-    return 0;
-}
-
-#define MAX_READ_SIZE 4096
-
-static int apc_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    if (av_get_packet(s->pb, pkt, MAX_READ_SIZE) <= 0)
-        return AVERROR(EIO);
-    pkt->stream_index = 0;
-    return 0;
-}
-
-AVInputFormat ff_apc_demuxer = {
-    .name           = "apc",
-    .long_name      = NULL_IF_CONFIG_SMALL("CRYO APC"),
-    .read_probe     = apc_probe,
-    .read_header    = apc_read_header,
-    .read_packet    = apc_read_packet,
-};
diff --git a/deps/libav/libavformat/ape.c b/deps/libav/libavformat/ape.c
deleted file mode 100644
index d967a5d..0000000
--- a/deps/libav/libavformat/ape.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * Monkey's Audio APE demuxer
- * Copyright (c) 2007 Benjamin Zores <ben at geexbox.org>
- *  based upon libdemac from Dave Chapman.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-#include "apetag.h"
-
-/* The earliest and latest file formats supported by this library */
-#define APE_MIN_VERSION 3800
-#define APE_MAX_VERSION 3990
-
-#define MAC_FORMAT_FLAG_8_BIT                 1 // is 8-bit [OBSOLETE]
-#define MAC_FORMAT_FLAG_CRC                   2 // uses the new CRC32 error detection [OBSOLETE]
-#define MAC_FORMAT_FLAG_HAS_PEAK_LEVEL        4 // uint32 nPeakLevel after the header [OBSOLETE]
-#define MAC_FORMAT_FLAG_24_BIT                8 // is 24-bit [OBSOLETE]
-#define MAC_FORMAT_FLAG_HAS_SEEK_ELEMENTS    16 // has the number of seek elements after the peak level
-#define MAC_FORMAT_FLAG_CREATE_WAV_HEADER    32 // create the wave header on decompression (not stored)
-
-#define MAC_SUBFRAME_SIZE 4608
-
-#define APE_EXTRADATA_SIZE 6
-
-typedef struct {
-    int64_t pos;
-    int nblocks;
-    int size;
-    int skip;
-    int64_t pts;
-} APEFrame;
-
-typedef struct {
-    /* Derived fields */
-    uint32_t junklength;
-    uint32_t firstframe;
-    uint32_t totalsamples;
-    int currentframe;
-    APEFrame *frames;
-
-    /* Info from Descriptor Block */
-    char magic[4];
-    int16_t fileversion;
-    int16_t padding1;
-    uint32_t descriptorlength;
-    uint32_t headerlength;
-    uint32_t seektablelength;
-    uint32_t wavheaderlength;
-    uint32_t audiodatalength;
-    uint32_t audiodatalength_high;
-    uint32_t wavtaillength;
-    uint8_t md5[16];
-
-    /* Info from Header Block */
-    uint16_t compressiontype;
-    uint16_t formatflags;
-    uint32_t blocksperframe;
-    uint32_t finalframeblocks;
-    uint32_t totalframes;
-    uint16_t bps;
-    uint16_t channels;
-    uint32_t samplerate;
-
-    /* Seektable */
-    uint32_t *seektable;
-    uint8_t  *bittable;
-} APEContext;
-
-static int ape_probe(AVProbeData * p)
-{
-    if (p->buf[0] == 'M' && p->buf[1] == 'A' && p->buf[2] == 'C' && p->buf[3] == ' ')
-        return AVPROBE_SCORE_MAX;
-
-    return 0;
-}
-
-static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx)
-{
-#ifdef DEBUG
-    int i;
-
-    av_log(s, AV_LOG_DEBUG, "Descriptor Block:\n\n");
-    av_log(s, AV_LOG_DEBUG, "magic                = \"%c%c%c%c\"\n", ape_ctx->magic[0], ape_ctx->magic[1], ape_ctx->magic[2], ape_ctx->magic[3]);
-    av_log(s, AV_LOG_DEBUG, "fileversion          = %"PRId16"\n", ape_ctx->fileversion);
-    av_log(s, AV_LOG_DEBUG, "descriptorlength     = %"PRIu32"\n", ape_ctx->descriptorlength);
-    av_log(s, AV_LOG_DEBUG, "headerlength         = %"PRIu32"\n", ape_ctx->headerlength);
-    av_log(s, AV_LOG_DEBUG, "seektablelength      = %"PRIu32"\n", ape_ctx->seektablelength);
-    av_log(s, AV_LOG_DEBUG, "wavheaderlength      = %"PRIu32"\n", ape_ctx->wavheaderlength);
-    av_log(s, AV_LOG_DEBUG, "audiodatalength      = %"PRIu32"\n", ape_ctx->audiodatalength);
-    av_log(s, AV_LOG_DEBUG, "audiodatalength_high = %"PRIu32"\n", ape_ctx->audiodatalength_high);
-    av_log(s, AV_LOG_DEBUG, "wavtaillength        = %"PRIu32"\n", ape_ctx->wavtaillength);
-    av_log(s, AV_LOG_DEBUG, "md5                  = ");
-    for (i = 0; i < 16; i++)
-         av_log(s, AV_LOG_DEBUG, "%02x", ape_ctx->md5[i]);
-    av_log(s, AV_LOG_DEBUG, "\n");
-
-    av_log(s, AV_LOG_DEBUG, "\nHeader Block:\n\n");
-
-    av_log(s, AV_LOG_DEBUG, "compressiontype      = %"PRIu16"\n", ape_ctx->compressiontype);
-    av_log(s, AV_LOG_DEBUG, "formatflags          = %"PRIu16"\n", ape_ctx->formatflags);
-    av_log(s, AV_LOG_DEBUG, "blocksperframe       = %"PRIu32"\n", ape_ctx->blocksperframe);
-    av_log(s, AV_LOG_DEBUG, "finalframeblocks     = %"PRIu32"\n", ape_ctx->finalframeblocks);
-    av_log(s, AV_LOG_DEBUG, "totalframes          = %"PRIu32"\n", ape_ctx->totalframes);
-    av_log(s, AV_LOG_DEBUG, "bps                  = %"PRIu16"\n", ape_ctx->bps);
-    av_log(s, AV_LOG_DEBUG, "channels             = %"PRIu16"\n", ape_ctx->channels);
-    av_log(s, AV_LOG_DEBUG, "samplerate           = %"PRIu32"\n", ape_ctx->samplerate);
-
-    av_log(s, AV_LOG_DEBUG, "\nSeektable\n\n");
-    if ((ape_ctx->seektablelength / sizeof(uint32_t)) != ape_ctx->totalframes) {
-        av_log(s, AV_LOG_DEBUG, "No seektable\n");
-    } else {
-        for (i = 0; i < ape_ctx->seektablelength / sizeof(uint32_t); i++) {
-            if (i < ape_ctx->totalframes - 1) {
-                av_log(s, AV_LOG_DEBUG, "%8d   %"PRIu32" (%"PRIu32" bytes)",
-                       i, ape_ctx->seektable[i],
-                       ape_ctx->seektable[i + 1] - ape_ctx->seektable[i]);
-                if (ape_ctx->bittable)
-                    av_log(s, AV_LOG_DEBUG, " + %2d bits\n",
-                           ape_ctx->bittable[i]);
-                av_log(s, AV_LOG_DEBUG, "\n");
-            } else {
-                av_log(s, AV_LOG_DEBUG, "%8d   %"PRIu32"\n", i, ape_ctx->seektable[i]);
-            }
-        }
-    }
-
-    av_log(s, AV_LOG_DEBUG, "\nFrames\n\n");
-    for (i = 0; i < ape_ctx->totalframes; i++)
-        av_log(s, AV_LOG_DEBUG, "%8d   %8"PRId64" %8d (%d samples)\n", i,
-               ape_ctx->frames[i].pos, ape_ctx->frames[i].size,
-               ape_ctx->frames[i].nblocks);
-
-    av_log(s, AV_LOG_DEBUG, "\nCalculated information:\n\n");
-    av_log(s, AV_LOG_DEBUG, "junklength           = %"PRIu32"\n", ape_ctx->junklength);
-    av_log(s, AV_LOG_DEBUG, "firstframe           = %"PRIu32"\n", ape_ctx->firstframe);
-    av_log(s, AV_LOG_DEBUG, "totalsamples         = %"PRIu32"\n", ape_ctx->totalsamples);
-#endif
-}
-
-static int ape_read_header(AVFormatContext * s)
-{
-    AVIOContext *pb = s->pb;
-    APEContext *ape = s->priv_data;
-    AVStream *st;
-    uint32_t tag;
-    int i;
-    int total_blocks, final_size = 0;
-    int64_t pts, file_size;
-
-    /* Skip any leading junk such as id3v2 tags */
-    ape->junklength = avio_tell(pb);
-
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('M', 'A', 'C', ' '))
-        return -1;
-
-    ape->fileversion = avio_rl16(pb);
-
-    if (ape->fileversion < APE_MIN_VERSION || ape->fileversion > APE_MAX_VERSION) {
-        av_log(s, AV_LOG_ERROR, "Unsupported file version - %d.%02d\n",
-               ape->fileversion / 1000, (ape->fileversion % 1000) / 10);
-        return -1;
-    }
-
-    if (ape->fileversion >= 3980) {
-        ape->padding1             = avio_rl16(pb);
-        ape->descriptorlength     = avio_rl32(pb);
-        ape->headerlength         = avio_rl32(pb);
-        ape->seektablelength      = avio_rl32(pb);
-        ape->wavheaderlength      = avio_rl32(pb);
-        ape->audiodatalength      = avio_rl32(pb);
-        ape->audiodatalength_high = avio_rl32(pb);
-        ape->wavtaillength        = avio_rl32(pb);
-        avio_read(pb, ape->md5, 16);
-
-        /* Skip any unknown bytes at the end of the descriptor.
-           This is for future compatibility */
-        if (ape->descriptorlength > 52)
-            avio_skip(pb, ape->descriptorlength - 52);
-
-        /* Read header data */
-        ape->compressiontype      = avio_rl16(pb);
-        ape->formatflags          = avio_rl16(pb);
-        ape->blocksperframe       = avio_rl32(pb);
-        ape->finalframeblocks     = avio_rl32(pb);
-        ape->totalframes          = avio_rl32(pb);
-        ape->bps                  = avio_rl16(pb);
-        ape->channels             = avio_rl16(pb);
-        ape->samplerate           = avio_rl32(pb);
-    } else {
-        ape->descriptorlength = 0;
-        ape->headerlength = 32;
-
-        ape->compressiontype      = avio_rl16(pb);
-        ape->formatflags          = avio_rl16(pb);
-        ape->channels             = avio_rl16(pb);
-        ape->samplerate           = avio_rl32(pb);
-        ape->wavheaderlength      = avio_rl32(pb);
-        ape->wavtaillength        = avio_rl32(pb);
-        ape->totalframes          = avio_rl32(pb);
-        ape->finalframeblocks     = avio_rl32(pb);
-
-        if (ape->formatflags & MAC_FORMAT_FLAG_HAS_PEAK_LEVEL) {
-            avio_skip(pb, 4); /* Skip the peak level */
-            ape->headerlength += 4;
-        }
-
-        if (ape->formatflags & MAC_FORMAT_FLAG_HAS_SEEK_ELEMENTS) {
-            ape->seektablelength = avio_rl32(pb);
-            ape->headerlength += 4;
-            ape->seektablelength *= sizeof(int32_t);
-        } else
-            ape->seektablelength = ape->totalframes * sizeof(int32_t);
-
-        if (ape->formatflags & MAC_FORMAT_FLAG_8_BIT)
-            ape->bps = 8;
-        else if (ape->formatflags & MAC_FORMAT_FLAG_24_BIT)
-            ape->bps = 24;
-        else
-            ape->bps = 16;
-
-        if (ape->fileversion >= 3950)
-            ape->blocksperframe = 73728 * 4;
-        else if (ape->fileversion >= 3900 || (ape->fileversion >= 3800  && ape->compressiontype >= 4000))
-            ape->blocksperframe = 73728;
-        else
-            ape->blocksperframe = 9216;
-
-        /* Skip any stored wav header */
-        if (!(ape->formatflags & MAC_FORMAT_FLAG_CREATE_WAV_HEADER))
-            avio_skip(pb, ape->wavheaderlength);
-    }
-
-    if(!ape->totalframes){
-        av_log(s, AV_LOG_ERROR, "No frames in the file!\n");
-        return AVERROR(EINVAL);
-    }
-    if(ape->totalframes > UINT_MAX / sizeof(APEFrame)){
-        av_log(s, AV_LOG_ERROR, "Too many frames: %"PRIu32"\n",
-               ape->totalframes);
-        return -1;
-    }
-    if (ape->seektablelength / sizeof(*ape->seektable) < ape->totalframes) {
-        av_log(s, AV_LOG_ERROR,
-               "Number of seek entries is less than number of frames: %zu vs. %"PRIu32"\n",
-               ape->seektablelength / sizeof(*ape->seektable), ape->totalframes);
-        return AVERROR_INVALIDDATA;
-    }
-    ape->frames       = av_malloc(ape->totalframes * sizeof(APEFrame));
-    if(!ape->frames)
-        return AVERROR(ENOMEM);
-    ape->firstframe   = ape->junklength + ape->descriptorlength + ape->headerlength + ape->seektablelength + ape->wavheaderlength;
-    if (ape->fileversion < 3810)
-        ape->firstframe += ape->totalframes;
-    ape->currentframe = 0;
-
-
-    ape->totalsamples = ape->finalframeblocks;
-    if (ape->totalframes > 1)
-        ape->totalsamples += ape->blocksperframe * (ape->totalframes - 1);
-
-    if (ape->seektablelength > 0) {
-        ape->seektable = av_malloc(ape->seektablelength);
-        if (!ape->seektable)
-            return AVERROR(ENOMEM);
-        for (i = 0; i < ape->seektablelength / sizeof(uint32_t) && !pb->eof_reached; i++)
-            ape->seektable[i] = avio_rl32(pb);
-        if (ape->fileversion < 3810) {
-            ape->bittable = av_malloc(ape->totalframes);
-            if (!ape->bittable)
-                return AVERROR(ENOMEM);
-            for (i = 0; i < ape->totalframes && !pb->eof_reached; i++)
-                ape->bittable[i] = avio_r8(pb);
-        }
-    }
-
-    ape->frames[0].pos     = ape->firstframe;
-    ape->frames[0].nblocks = ape->blocksperframe;
-    ape->frames[0].skip    = 0;
-    for (i = 1; i < ape->totalframes; i++) {
-        ape->frames[i].pos      = ape->seektable[i] + ape->junklength;
-        ape->frames[i].nblocks  = ape->blocksperframe;
-        ape->frames[i - 1].size = ape->frames[i].pos - ape->frames[i - 1].pos;
-        ape->frames[i].skip     = (ape->frames[i].pos - ape->frames[0].pos) & 3;
-    }
-    ape->frames[ape->totalframes - 1].nblocks = ape->finalframeblocks;
-    /* calculate final packet size from total file size, if available */
-    file_size = avio_size(pb);
-    if (file_size > 0) {
-        final_size = file_size - ape->frames[ape->totalframes - 1].pos -
-                     ape->wavtaillength;
-        final_size -= final_size & 3;
-    }
-    if (file_size <= 0 || final_size <= 0)
-        final_size = ape->finalframeblocks * 8;
-    ape->frames[ape->totalframes - 1].size = final_size;
-
-    for (i = 0; i < ape->totalframes; i++) {
-        if(ape->frames[i].skip){
-            ape->frames[i].pos  -= ape->frames[i].skip;
-            ape->frames[i].size += ape->frames[i].skip;
-        }
-        ape->frames[i].size = (ape->frames[i].size + 3) & ~3;
-    }
-    if (ape->fileversion < 3810) {
-        for (i = 0; i < ape->totalframes; i++) {
-            if (i < ape->totalframes - 1 && ape->bittable[i + 1])
-                ape->frames[i].size += 4;
-            ape->frames[i].skip <<= 3;
-            ape->frames[i].skip  += ape->bittable[i];
-        }
-    }
-
-    ape_dumpinfo(s, ape);
-
-    av_log(s, AV_LOG_DEBUG, "Decoding file - v%d.%02d, compression level %"PRIu16"\n",
-           ape->fileversion / 1000, (ape->fileversion % 1000) / 10,
-           ape->compressiontype);
-
-    /* now we are ready: build format streams */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return -1;
-
-    total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks;
-
-    st->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id        = AV_CODEC_ID_APE;
-    st->codec->codec_tag       = MKTAG('A', 'P', 'E', ' ');
-    st->codec->channels        = ape->channels;
-    st->codec->sample_rate     = ape->samplerate;
-    st->codec->bits_per_coded_sample = ape->bps;
-
-    st->nb_frames = ape->totalframes;
-    st->start_time = 0;
-    st->duration  = total_blocks / MAC_SUBFRAME_SIZE;
-    avpriv_set_pts_info(st, 64, MAC_SUBFRAME_SIZE, ape->samplerate);
-
-    st->codec->extradata = av_malloc(APE_EXTRADATA_SIZE);
-    st->codec->extradata_size = APE_EXTRADATA_SIZE;
-    AV_WL16(st->codec->extradata + 0, ape->fileversion);
-    AV_WL16(st->codec->extradata + 2, ape->compressiontype);
-    AV_WL16(st->codec->extradata + 4, ape->formatflags);
-
-    pts = 0;
-    for (i = 0; i < ape->totalframes; i++) {
-        ape->frames[i].pts = pts;
-        av_add_index_entry(st, ape->frames[i].pos, ape->frames[i].pts, 0, 0, AVINDEX_KEYFRAME);
-        pts += ape->blocksperframe / MAC_SUBFRAME_SIZE;
-    }
-
-    /* try to read APE tags */
-    if (pb->seekable) {
-        ff_ape_parse_tag(s);
-        avio_seek(pb, 0, SEEK_SET);
-    }
-
-    return 0;
-}
-
-static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
-{
-    int ret;
-    int nblocks;
-    APEContext *ape = s->priv_data;
-    uint32_t extra_size = 8;
-
-    if (s->pb->eof_reached)
-        return AVERROR_EOF;
-    if (ape->currentframe >= ape->totalframes)
-        return AVERROR_EOF;
-
-    if (avio_seek(s->pb, ape->frames[ape->currentframe].pos, SEEK_SET) < 0)
-        return AVERROR(EIO);
-
-    /* Calculate how many blocks there are in this frame */
-    if (ape->currentframe == (ape->totalframes - 1))
-        nblocks = ape->finalframeblocks;
-    else
-        nblocks = ape->blocksperframe;
-
-    if (ape->frames[ape->currentframe].size <= 0 ||
-        ape->frames[ape->currentframe].size > INT_MAX - extra_size) {
-        av_log(s, AV_LOG_ERROR, "invalid packet size: %d\n",
-               ape->frames[ape->currentframe].size);
-        ape->currentframe++;
-        return AVERROR(EIO);
-    }
-
-    if (av_new_packet(pkt,  ape->frames[ape->currentframe].size + extra_size) < 0)
-        return AVERROR(ENOMEM);
-
-    AV_WL32(pkt->data    , nblocks);
-    AV_WL32(pkt->data + 4, ape->frames[ape->currentframe].skip);
-    ret = avio_read(s->pb, pkt->data + extra_size, ape->frames[ape->currentframe].size);
-
-    pkt->pts = ape->frames[ape->currentframe].pts;
-    pkt->stream_index = 0;
-
-    /* note: we need to modify the packet size here to handle the last
-       packet */
-    pkt->size = ret + extra_size;
-
-    ape->currentframe++;
-
-    return 0;
-}
-
-static int ape_read_close(AVFormatContext * s)
-{
-    APEContext *ape = s->priv_data;
-
-    av_freep(&ape->frames);
-    av_freep(&ape->seektable);
-    av_freep(&ape->bittable);
-    return 0;
-}
-
-static int ape_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
-{
-    AVStream *st = s->streams[stream_index];
-    APEContext *ape = s->priv_data;
-    int index = av_index_search_timestamp(st, timestamp, flags);
-
-    if (index < 0)
-        return -1;
-
-    if (avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET) < 0)
-        return -1;
-    ape->currentframe = index;
-    return 0;
-}
-
-AVInputFormat ff_ape_demuxer = {
-    .name           = "ape",
-    .long_name      = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
-    .priv_data_size = sizeof(APEContext),
-    .read_probe     = ape_probe,
-    .read_header    = ape_read_header,
-    .read_packet    = ape_read_packet,
-    .read_close     = ape_read_close,
-    .read_seek      = ape_read_seek,
-    .extensions     = "ape,apl,mac",
-};
diff --git a/deps/libav/libavformat/apetag.c b/deps/libav/libavformat/apetag.c
deleted file mode 100644
index d4be91c..0000000
--- a/deps/libav/libavformat/apetag.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * APE tag handling
- * Copyright (c) 2007 Benjamin Zores <ben at geexbox.org>
- *  based upon libdemac from Dave Chapman.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "apetag.h"
-#include "internal.h"
-
-#define APE_TAG_VERSION               2000
-#define APE_TAG_FOOTER_BYTES          32
-#define APE_TAG_FLAG_CONTAINS_HEADER  (1 << 31)
-#define APE_TAG_FLAG_CONTAINS_FOOTER  (1 << 30)
-#define APE_TAG_FLAG_IS_HEADER        (1 << 29)
-#define APE_TAG_FLAG_IS_BINARY        (1 << 1)
-
-static int ape_tag_read_field(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    uint8_t key[1024], *value;
-    uint32_t size, flags;
-    int i, c;
-
-    size = avio_rl32(pb);  /* field size */
-    flags = avio_rl32(pb); /* field flags */
-    for (i = 0; i < sizeof(key) - 1; i++) {
-        c = avio_r8(pb);
-        if (c < 0x20 || c > 0x7E)
-            break;
-        else
-            key[i] = c;
-    }
-    key[i] = 0;
-    if (c != 0) {
-        av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
-        return -1;
-    }
-    if (size >= UINT_MAX)
-        return -1;
-    if (flags & APE_TAG_FLAG_IS_BINARY) {
-        uint8_t filename[1024];
-        enum AVCodecID id;
-        AVStream *st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-
-        size -= avio_get_str(pb, size, filename, sizeof(filename));
-        if (size <= 0) {
-            av_log(s, AV_LOG_WARNING, "Skipping binary tag '%s'.\n", key);
-            return 0;
-        }
-
-        av_dict_set(&st->metadata, key, filename, 0);
-
-        if ((id = ff_guess_image2_codec(filename)) != AV_CODEC_ID_NONE) {
-            AVPacket pkt;
-            int ret;
-
-            ret = av_get_packet(s->pb, &pkt, size);
-            if (ret < 0) {
-                av_log(s, AV_LOG_ERROR, "Error reading cover art.\n");
-                return ret;
-            }
-
-            st->disposition      |= AV_DISPOSITION_ATTACHED_PIC;
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_id   = id;
-
-            st->attached_pic              = pkt;
-            st->attached_pic.stream_index = st->index;
-            st->attached_pic.flags       |= AV_PKT_FLAG_KEY;
-        } else {
-            st->codec->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!st->codec->extradata)
-                return AVERROR(ENOMEM);
-            if (avio_read(pb, st->codec->extradata, size) != size) {
-                av_freep(&st->codec->extradata);
-                return AVERROR(EIO);
-            }
-            st->codec->extradata_size = size;
-            st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
-        }
-    } else {
-        value = av_malloc(size+1);
-        if (!value)
-            return AVERROR(ENOMEM);
-        c = avio_read(pb, value, size);
-        if (c < 0) {
-            av_free(value);
-            return c;
-        }
-        value[c] = 0;
-        av_dict_set(&s->metadata, key, value, AV_DICT_DONT_STRDUP_VAL);
-    }
-    return 0;
-}
-
-int64_t ff_ape_parse_tag(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    int64_t file_size = avio_size(pb);
-    uint32_t val, fields, tag_bytes;
-    uint8_t buf[8];
-    int64_t tag_start;
-    int i;
-
-    if (file_size < APE_TAG_FOOTER_BYTES)
-        return 0;
-
-    avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET);
-
-    avio_read(pb, buf, 8);     /* APETAGEX */
-    if (strncmp(buf, "APETAGEX", 8)) {
-        return 0;
-    }
-
-    val = avio_rl32(pb);       /* APE tag version */
-    if (val > APE_TAG_VERSION) {
-        av_log(s, AV_LOG_ERROR, "Unsupported tag version. (>=%d)\n", APE_TAG_VERSION);
-        return 0;
-    }
-
-    tag_bytes = avio_rl32(pb); /* tag size */
-    if (tag_bytes - APE_TAG_FOOTER_BYTES > (1024 * 1024 * 16)) {
-        av_log(s, AV_LOG_ERROR, "Tag size is way too big\n");
-        return 0;
-    }
-
-    if (tag_bytes > file_size - APE_TAG_FOOTER_BYTES) {
-        av_log(s, AV_LOG_ERROR, "Invalid tag size %u.\n", tag_bytes);
-        return 0;
-    }
-    tag_start = file_size - tag_bytes - APE_TAG_FOOTER_BYTES;
-
-    fields = avio_rl32(pb);    /* number of fields */
-    if (fields > 65536) {
-        av_log(s, AV_LOG_ERROR, "Too many tag fields (%d)\n", fields);
-        return 0;
-    }
-
-    val = avio_rl32(pb);       /* flags */
-    if (val & APE_TAG_FLAG_IS_HEADER) {
-        av_log(s, AV_LOG_ERROR, "APE Tag is a header\n");
-        return 0;
-    }
-
-    avio_seek(pb, file_size - tag_bytes, SEEK_SET);
-
-    for (i=0; i<fields; i++)
-        if (ape_tag_read_field(s) < 0) break;
-
-    return tag_start;
-}
-
-int ff_ape_write_tag(AVFormatContext *s)
-{
-    AVDictionaryEntry *e = NULL;
-    int64_t start, end;
-    int size, count = 0;
-
-    if (!s->pb->seekable)
-        return 0;
-
-    start = avio_tell(s->pb);
-
-    // header
-    avio_write(s->pb, "APETAGEX", 8);   // id
-    avio_wl32 (s->pb, APE_TAG_VERSION); // version
-    avio_wl32(s->pb, 0);                // reserve space for size
-    avio_wl32(s->pb, 0);                // reserve space for tag count
-
-    // flags
-    avio_wl32(s->pb, APE_TAG_FLAG_CONTAINS_HEADER | APE_TAG_FLAG_CONTAINS_FOOTER |
-                     APE_TAG_FLAG_IS_HEADER);
-    ffio_fill(s->pb, 0, 8);             // reserved
-
-    while ((e = av_dict_get(s->metadata, "", e, AV_DICT_IGNORE_SUFFIX))) {
-        int val_len = strlen(e->value);
-
-        avio_wl32(s->pb, val_len);            // value length
-        avio_wl32(s->pb, 0);                  // item flags
-        avio_put_str(s->pb, e->key);          // key
-        avio_write(s->pb, e->value, val_len); // value
-        count++;
-    }
-
-    size = avio_tell(s->pb) - start;
-
-    // footer
-    avio_write(s->pb, "APETAGEX", 8);   // id
-    avio_wl32 (s->pb, APE_TAG_VERSION); // version
-    avio_wl32(s->pb, size);             // size
-    avio_wl32(s->pb, count);            // tag count
-
-    // flags
-    avio_wl32(s->pb, APE_TAG_FLAG_CONTAINS_HEADER | APE_TAG_FLAG_CONTAINS_FOOTER);
-    ffio_fill(s->pb, 0, 8);             // reserved
-
-    // update values in the header
-    end = avio_tell(s->pb);
-    avio_seek(s->pb, start + 12, SEEK_SET);
-    avio_wl32(s->pb, size);
-    avio_wl32(s->pb, count);
-    avio_seek(s->pb, end, SEEK_SET);
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/apetag.h b/deps/libav/libavformat/apetag.h
deleted file mode 100644
index 36e3211..0000000
--- a/deps/libav/libavformat/apetag.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * APE tag handling
- * Copyright (c) 2007 Benjamin Zores <ben at geexbox.org>
- *  based upon libdemac from Dave Chapman.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_APETAG_H
-#define AVFORMAT_APETAG_H
-
-#include "avformat.h"
-
-/**
- * Read and parse an APE tag
- *
- * @return offset of the tag start in the file
- */
-int64_t ff_ape_parse_tag(AVFormatContext *s);
-
-/**
- * Write an APE tag into a file.
- */
-int ff_ape_write_tag(AVFormatContext *s);
-
-#endif /* AVFORMAT_APETAG_H */
diff --git a/deps/libav/libavformat/asf.c b/deps/libav/libavformat/asf.c
deleted file mode 100644
index ec34b50..0000000
--- a/deps/libav/libavformat/asf.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "asf.h"
-
-const ff_asf_guid ff_asf_header = {
-    0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C
-};
-
-const ff_asf_guid ff_asf_file_header = {
-    0xA1, 0xDC, 0xAB, 0x8C, 0x47, 0xA9, 0xCF, 0x11, 0x8E, 0xE4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65
-};
-
-const ff_asf_guid ff_asf_stream_header = {
-    0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65
-};
-
-const ff_asf_guid ff_asf_ext_stream_header = {
-    0xCB, 0xA5, 0xE6, 0x14, 0x72, 0xC6, 0x32, 0x43, 0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A
-};
-
-const ff_asf_guid ff_asf_audio_stream = {
-    0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
-};
-
-const ff_asf_guid ff_asf_audio_conceal_none = {
-    // 0x40, 0xa4, 0xf1, 0x49, 0x4ece, 0x11d0, 0xa3, 0xac, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6
-    // New value lifted from avifile
-    0x00, 0x57, 0xfb, 0x20, 0x55, 0x5B, 0xCF, 0x11, 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b
-};
-
-const ff_asf_guid ff_asf_audio_conceal_spread = {
-    0x50, 0xCD, 0xC3, 0xBF, 0x8F, 0x61, 0xCF, 0x11, 0x8B, 0xB2, 0x00, 0xAA, 0x00, 0xB4, 0xE2, 0x20
-};
-
-const ff_asf_guid ff_asf_video_stream = {
-    0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
-};
-
-const ff_asf_guid ff_asf_jfif_media = {
-    0x00, 0xE1, 0x1B, 0xB6, 0x4E, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
-};
-
-const ff_asf_guid ff_asf_video_conceal_none = {
-    0x00, 0x57, 0xFB, 0x20, 0x55, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
-};
-
-const ff_asf_guid ff_asf_command_stream = {
-    0xC0, 0xCF, 0xDA, 0x59, 0xE6, 0x59, 0xD0, 0x11, 0xA3, 0xAC, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6
-};
-
-const ff_asf_guid ff_asf_comment_header = {
-    0x33, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
-};
-
-const ff_asf_guid ff_asf_codec_comment_header = {
-    0x40, 0x52, 0xD1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6
-};
-const ff_asf_guid ff_asf_codec_comment1_header = {
-    0x41, 0x52, 0xd1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xa3, 0xa4, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6
-};
-
-const ff_asf_guid ff_asf_data_header = {
-    0x36, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
-};
-
-const ff_asf_guid ff_asf_head1_guid = {
-    0xb5, 0x03, 0xbf, 0x5f, 0x2E, 0xA9, 0xCF, 0x11, 0x8e, 0xe3, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65
-};
-
-const ff_asf_guid ff_asf_head2_guid = {
-    0x11, 0xd2, 0xd3, 0xab, 0xBA, 0xA9, 0xCF, 0x11, 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65
-};
-
-const ff_asf_guid ff_asf_extended_content_header = {
-    0x40, 0xA4, 0xD0, 0xD2, 0x07, 0xE3, 0xD2, 0x11, 0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5E, 0xA8, 0x50
-};
-
-const ff_asf_guid ff_asf_simple_index_header = {
-    0x90, 0x08, 0x00, 0x33, 0xB1, 0xE5, 0xCF, 0x11, 0x89, 0xF4, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xCB
-};
-
-const ff_asf_guid ff_asf_ext_stream_embed_stream_header = {
-    0xe2, 0x65, 0xfb, 0x3a, 0xEF, 0x47, 0xF2, 0x40, 0xac, 0x2c, 0x70, 0xa9, 0x0d, 0x71, 0xd3, 0x43
-};
-
-const ff_asf_guid ff_asf_ext_stream_audio_stream = {
-    0x9d, 0x8c, 0x17, 0x31, 0xE1, 0x03, 0x28, 0x45, 0xb5, 0x82, 0x3d, 0xf9, 0xdb, 0x22, 0xf5, 0x03
-};
-
-const ff_asf_guid ff_asf_metadata_header = {
-    0xea, 0xcb, 0xf8, 0xc5, 0xaf, 0x5b, 0x77, 0x48, 0x84, 0x67, 0xaa, 0x8c, 0x44, 0xfa, 0x4c, 0xca
-};
-
-const ff_asf_guid ff_asf_metadata_library_header = {
-    0x94, 0x1c, 0x23, 0x44, 0x98, 0x94, 0xd1, 0x49, 0xa1, 0x41, 0x1d, 0x13, 0x4e, 0x45, 0x70, 0x54
-};
-
-const ff_asf_guid ff_asf_marker_header = {
-    0x01, 0xCD, 0x87, 0xF4, 0x51, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65
-};
-
-const ff_asf_guid ff_asf_reserved_4 = {
-        0x20, 0xdb, 0xfe, 0x4c, 0xf6, 0x75, 0xCF, 0x11, 0x9c, 0x0f, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb
-};
-
-/* I am not a number !!! This GUID is the one found on the PC used to
- * generate the stream */
-const ff_asf_guid ff_asf_my_guid = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-const ff_asf_guid ff_asf_language_guid = {
-    0xa9, 0x46, 0x43, 0x7c, 0xe0, 0xef, 0xfc, 0x4b, 0xb2, 0x29, 0x39, 0x3e, 0xde, 0x41, 0x5c, 0x85
-};
-
-const ff_asf_guid ff_asf_content_encryption = {
-    0xfb, 0xb3, 0x11, 0x22, 0x23, 0xbd, 0xd2, 0x11, 0xb4, 0xb7, 0x00, 0xa0, 0xc9, 0x55, 0xfc, 0x6e
-};
-
-const ff_asf_guid ff_asf_ext_content_encryption = {
-    0x14, 0xe6, 0x8a, 0x29, 0x22, 0x26, 0x17, 0x4c, 0xb9, 0x35, 0xda, 0xe0, 0x7e, 0xe9, 0x28, 0x9c
-};
-
-const ff_asf_guid ff_asf_digital_signature = {
-    0xfc, 0xb3, 0x11, 0x22, 0x23, 0xbd, 0xd2, 0x11, 0xb4, 0xb7, 0x00, 0xa0, 0xc9, 0x55, 0xfc, 0x6e
-};
-
-/* List of official tags at http://msdn.microsoft.com/en-us/library/dd743066(VS.85).aspx */
-const AVMetadataConv ff_asf_metadata_conv[] = {
-    { "WM/AlbumArtist",          "album_artist"     },
-    { "WM/AlbumTitle",           "album"            },
-    { "Author",                  "artist"           },
-    { "Description",             "comment"          },
-    { "WM/Composer",             "composer"         },
-    { "WM/EncodedBy",            "encoded_by"       },
-    { "WM/EncodingSettings",     "encoder"          },
-    { "WM/Genre",                "genre"            },
-    { "WM/Language",             "language"         },
-    { "WM/OriginalFilename",     "filename"         },
-    { "WM/PartOfSet",            "disc"             },
-    { "WM/Publisher",            "publisher"        },
-    { "WM/Tool",                 "encoder"          },
-    { "WM/TrackNumber",          "track"            },
-    { "WM/Track",                "track"            },
-    { "WM/MediaStationCallSign", "service_provider" },
-    { "WM/MediaStationName",     "service_name"     },
-//  { "Year"               , "date"        }, TODO: conversion year<->date
-    { 0 }
-};
diff --git a/deps/libav/libavformat/asf.h b/deps/libav/libavformat/asf.h
deleted file mode 100644
index 2f6722a..0000000
--- a/deps/libav/libavformat/asf.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_ASF_H
-#define AVFORMAT_ASF_H
-
-#include <stdint.h>
-#include "avformat.h"
-#include "metadata.h"
-#include "riff.h"
-
-#define PACKET_SIZE 3200
-
-typedef struct ASFStream {
-    int num;
-    unsigned char seq;
-    /* use for reading */
-    AVPacket pkt;
-    int frag_offset;
-    int timestamp;
-    int64_t duration;
-
-    int ds_span;                /* descrambling  */
-    int ds_packet_size;
-    int ds_chunk_size;
-
-    int64_t packet_pos;
-
-    uint16_t stream_language_index;
-
-    int      palette_changed;
-    uint32_t palette[256];
-} ASFStream;
-
-typedef struct ASFMainHeader {
-    ff_asf_guid guid;                  ///< generated by client computer
-    uint64_t file_size;         /**< in bytes
-                                 *   invalid if broadcasting */
-    uint64_t create_time;       /**< time of creation, in 100-nanosecond units since 1.1.1601
-                                 *   invalid if broadcasting */
-    uint64_t play_time;         /**< play time, in 100-nanosecond units
-                                 * invalid if broadcasting */
-    uint64_t send_time;         /**< time to send file, in 100-nanosecond units
-                                 *   invalid if broadcasting (could be ignored) */
-    uint32_t preroll;           /**< timestamp of the first packet, in milliseconds
-                                 *   if nonzero - subtract from time */
-    uint32_t ignore;            ///< preroll is 64bit - but let's just ignore it
-    uint32_t flags;             /**< 0x01 - broadcast
-                                 *   0x02 - seekable
-                                 *   rest is reserved should be 0 */
-    uint32_t min_pktsize;       /**< size of a data packet
-                                 *   invalid if broadcasting */
-    uint32_t max_pktsize;       /**< shall be the same as for min_pktsize
-                                 *   invalid if broadcasting */
-    uint32_t max_bitrate;       /**< bandwidth of stream in bps
-                                 *   should be the sum of bitrates of the
-                                 *   individual media streams */
-} ASFMainHeader;
-
-
-typedef struct ASFIndex {
-    uint32_t packet_number;
-    uint16_t packet_count;
-    uint64_t send_time;
-    uint64_t offset;
-} ASFIndex;
-
-extern const ff_asf_guid ff_asf_header;
-extern const ff_asf_guid ff_asf_file_header;
-extern const ff_asf_guid ff_asf_stream_header;
-extern const ff_asf_guid ff_asf_ext_stream_header;
-extern const ff_asf_guid ff_asf_audio_stream;
-extern const ff_asf_guid ff_asf_audio_conceal_none;
-extern const ff_asf_guid ff_asf_audio_conceal_spread;
-extern const ff_asf_guid ff_asf_video_stream;
-extern const ff_asf_guid ff_asf_jfif_media;
-extern const ff_asf_guid ff_asf_video_conceal_none;
-extern const ff_asf_guid ff_asf_command_stream;
-extern const ff_asf_guid ff_asf_comment_header;
-extern const ff_asf_guid ff_asf_codec_comment_header;
-extern const ff_asf_guid ff_asf_codec_comment1_header;
-extern const ff_asf_guid ff_asf_data_header;
-extern const ff_asf_guid ff_asf_head1_guid;
-extern const ff_asf_guid ff_asf_head2_guid;
-extern const ff_asf_guid ff_asf_extended_content_header;
-extern const ff_asf_guid ff_asf_simple_index_header;
-extern const ff_asf_guid ff_asf_ext_stream_embed_stream_header;
-extern const ff_asf_guid ff_asf_ext_stream_audio_stream;
-extern const ff_asf_guid ff_asf_metadata_header;
-extern const ff_asf_guid ff_asf_metadata_library_header;
-extern const ff_asf_guid ff_asf_marker_header;
-extern const ff_asf_guid ff_asf_reserved_4;
-extern const ff_asf_guid ff_asf_my_guid;
-extern const ff_asf_guid ff_asf_language_guid;
-extern const ff_asf_guid ff_asf_content_encryption;
-extern const ff_asf_guid ff_asf_ext_content_encryption;
-extern const ff_asf_guid ff_asf_digital_signature;
-
-extern const AVMetadataConv ff_asf_metadata_conv[];
-
-#define ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT 0x80 //1000 0000
-
-
-//   ASF data packet structure
-//   =========================
-//
-//
-//  -----------------------------------
-// | Error Correction Data             |  Optional
-//  -----------------------------------
-// | Payload Parsing Information (PPI) |
-//  -----------------------------------
-// | Payload Data                      |
-//  -----------------------------------
-// | Padding Data                      |
-//  -----------------------------------
-
-
-// PPI_FLAG - Payload parsing information flags
-#define ASF_PPI_FLAG_MULTIPLE_PAYLOADS_PRESENT 1
-
-#define ASF_PPI_FLAG_SEQUENCE_FIELD_IS_BYTE  0x02 //0000 0010
-#define ASF_PPI_FLAG_SEQUENCE_FIELD_IS_WORD  0x04 //0000 0100
-#define ASF_PPI_FLAG_SEQUENCE_FIELD_IS_DWORD 0x06 //0000 0110
-#define ASF_PPI_MASK_SEQUENCE_FIELD_SIZE     0x06 //0000 0110
-
-#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE  0x08 //0000 1000
-#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD  0x10 //0001 0000
-#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_DWORD 0x18 //0001 1000
-#define ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE     0x18 //0001 1000
-
-#define ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_BYTE  0x20 //0010 0000
-#define ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_WORD  0x40 //0100 0000
-#define ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_DWORD 0x60 //0110 0000
-#define ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE     0x60 //0110 0000
-
-// PL_FLAG - Payload flags
-#define ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE   0x01 //0000 0001
-#define ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_WORD   0x02 //0000 0010
-#define ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_DWORD  0x03 //0000 0011
-#define ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE      0x03 //0000 0011
-
-#define ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_BYTE  0x04 //0000 0100
-#define ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_WORD  0x08 //0000 1000
-#define ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD 0x0c //0000 1100
-#define ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE     0x0c //0000 1100
-
-#define ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE  0x10 //0001 0000
-#define ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_WORD  0x20 //0010 0000
-#define ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_DWORD 0x30 //0011 0000
-#define ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE     0x30 //0011 0000
-
-#define ASF_PL_FLAG_STREAM_NUMBER_LENGTH_FIELD_IS_BYTE  0x40 //0100 0000
-#define ASF_PL_MASK_STREAM_NUMBER_LENGTH_FIELD_SIZE     0xc0 //1100 0000
-
-#define ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_BYTE  0x40 //0100 0000
-#define ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD  0x80 //1000 0000
-#define ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE     0xc0 //1100 0000
-
-#define ASF_PL_FLAG_KEY_FRAME 0x80 //1000 0000
-
-extern AVInputFormat ff_asf_demuxer;
-
-#endif /* AVFORMAT_ASF_H */
diff --git a/deps/libav/libavformat/asfcrypt.c b/deps/libav/libavformat/asfcrypt.c
deleted file mode 100644
index c261475..0000000
--- a/deps/libav/libavformat/asfcrypt.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * ASF decryption
- * Copyright (c) 2007 Reimar Doeffinger
- * This is a rewrite of code contained in freeme/freeme2
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/bswap.h"
-#include "libavutil/common.h"
-#include "libavutil/des.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/rc4.h"
-#include "asfcrypt.h"
-
-/**
- * @brief find multiplicative inverse modulo 2 ^ 32
- * @param v number to invert, must be odd!
- * @return number so that result * v = 1 (mod 2^32)
- */
-static uint32_t inverse(uint32_t v)
-{
-    // v ^ 3 gives the inverse (mod 16), could also be implemented
-    // as table etc. (only lowest 4 bits matter!)
-    uint32_t inverse = v * v * v;
-    // uses a fixpoint-iteration that doubles the number
-    // of correct lowest bits each time
-    inverse *= 2 - v * inverse;
-    inverse *= 2 - v * inverse;
-    inverse *= 2 - v * inverse;
-    return inverse;
-}
-
-/**
- * @brief read keys from keybuf into keys
- * @param keybuf buffer containing the keys
- * @param keys output key array containing the keys for encryption in
- *             native endianness
- */
-static void multiswap_init(const uint8_t keybuf[48], uint32_t keys[12])
-{
-    int i;
-    for (i = 0; i < 12; i++)
-        keys[i] = AV_RL32(keybuf + (i << 2)) | 1;
-}
-
-/**
- * @brief invert the keys so that encryption become decryption keys and
- *        the other way round.
- * @param keys key array of ints to invert
- */
-static void multiswap_invert_keys(uint32_t keys[12])
-{
-    int i;
-    for (i = 0; i < 5; i++)
-        keys[i] = inverse(keys[i]);
-    for (i = 6; i < 11; i++)
-        keys[i] = inverse(keys[i]);
-}
-
-static uint32_t multiswap_step(const uint32_t keys[12], uint32_t v)
-{
-    int i;
-    v *= keys[0];
-    for (i = 1; i < 5; i++) {
-        v  = (v >> 16) | (v << 16);
-        v *= keys[i];
-    }
-    v += keys[5];
-    return v;
-}
-
-static uint32_t multiswap_inv_step(const uint32_t keys[12], uint32_t v)
-{
-    int i;
-    v -= keys[5];
-    for (i = 4; i > 0; i--) {
-        v *= keys[i];
-        v  = (v >> 16) | (v << 16);
-    }
-    v *= keys[0];
-    return v;
-}
-
-/**
- * @brief "MultiSwap" encryption
- * @param keys 32 bit numbers in machine endianness,
- *             0-4 and 6-10 must be inverted from decryption
- * @param key another key, this one must be the same for the decryption
- * @param data data to encrypt
- * @return encrypted data
- */
-static uint64_t multiswap_enc(const uint32_t keys[12],
-                              uint64_t key, uint64_t data)
-{
-    uint32_t a = data;
-    uint32_t b = data >> 32;
-    uint32_t c;
-    uint32_t tmp;
-    a  += key;
-    tmp = multiswap_step(keys, a);
-    b  += tmp;
-    c   = (key >> 32) + tmp;
-    tmp = multiswap_step(keys + 6, b);
-    c  += tmp;
-    return ((uint64_t)c << 32) | tmp;
-}
-
-/**
- * @brief "MultiSwap" decryption
- * @param keys 32 bit numbers in machine endianness,
- *             0-4 and 6-10 must be inverted from encryption
- * @param key another key, this one must be the same as for the encryption
- * @param data data to decrypt
- * @return decrypted data
- */
-static uint64_t multiswap_dec(const uint32_t keys[12],
-                              uint64_t key, uint64_t data)
-{
-    uint32_t a;
-    uint32_t b;
-    uint32_t c   = data >> 32;
-    uint32_t tmp = data;
-    c  -= tmp;
-    b   = multiswap_inv_step(keys + 6, tmp);
-    tmp = c - (key >> 32);
-    b  -= tmp;
-    a   = multiswap_inv_step(keys, tmp);
-    a  -= key;
-    return ((uint64_t)b << 32) | a;
-}
-
-void ff_asfcrypt_dec(const uint8_t key[20], uint8_t *data, int len)
-{
-    struct AVDES des;
-    struct AVRC4 rc4;
-    int num_qwords      = len >> 3;
-    uint8_t *qwords     = data;
-    uint64_t rc4buff[8] = { 0 };
-    uint64_t packetkey;
-    uint32_t ms_keys[12];
-    uint64_t ms_state;
-    int i;
-    if (len < 16) {
-        for (i = 0; i < len; i++)
-            data[i] ^= key[i];
-        return;
-    }
-
-    av_rc4_init(&rc4, key, 12 * 8, 1);
-    av_rc4_crypt(&rc4, (uint8_t *)rc4buff, NULL, sizeof(rc4buff), NULL, 1);
-    multiswap_init((uint8_t *)rc4buff, ms_keys);
-
-    packetkey  = AV_RN64(&qwords[num_qwords * 8 - 8]);
-    packetkey ^= rc4buff[7];
-    av_des_init(&des, key + 12, 64, 1);
-    av_des_crypt(&des, (uint8_t *)&packetkey, (uint8_t *)&packetkey, 1, NULL, 1);
-    packetkey ^= rc4buff[6];
-
-    av_rc4_init(&rc4, (uint8_t *)&packetkey, 64, 1);
-    av_rc4_crypt(&rc4, data, data, len, NULL, 1);
-
-    ms_state = 0;
-    for (i = 0; i < num_qwords - 1; i++, qwords += 8)
-        ms_state = multiswap_enc(ms_keys, ms_state, AV_RL64(qwords));
-    multiswap_invert_keys(ms_keys);
-    packetkey = (packetkey << 32) | (packetkey >> 32);
-    packetkey = av_le2ne64(packetkey);
-    packetkey = multiswap_dec(ms_keys, ms_state, packetkey);
-    AV_WL64(qwords, packetkey);
-}
diff --git a/deps/libav/libavformat/asfcrypt.h b/deps/libav/libavformat/asfcrypt.h
deleted file mode 100644
index 53388b4..0000000
--- a/deps/libav/libavformat/asfcrypt.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * ASF decryption
- * Copyright (c) 2007 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_ASFCRYPT_H
-#define AVFORMAT_ASFCRYPT_H
-
-#include <inttypes.h>
-
-void ff_asfcrypt_dec(const uint8_t key[20], uint8_t *data, int len);
-
-#endif /* AVFORMAT_ASFCRYPT_H */
diff --git a/deps/libav/libavformat/asfdec.c b/deps/libav/libavformat/asfdec.c
deleted file mode 100644
index 28a403a..0000000
--- a/deps/libav/libavformat/asfdec.c
+++ /dev/null
@@ -1,1520 +0,0 @@
-/*
- * ASF compatible demuxer
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/bswap.h"
-#include "libavutil/common.h"
-#include "libavutil/dict.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "avlanguage.h"
-#include "id3v2.h"
-#include "internal.h"
-#include "riff.h"
-#include "asf.h"
-#include "asfcrypt.h"
-
-typedef struct {
-    const AVClass *class;
-    int asfid2avid[128];                 ///< conversion table from asf ID 2 AVStream ID
-    ASFStream streams[128];              ///< it's max number and it's not that big
-    uint32_t stream_bitrates[128];       ///< max number of streams, bitrate for each (for streaming)
-    AVRational dar[128];
-    char stream_languages[128][6];       ///< max number of streams, language for each (RFC1766, e.g. en-US)
-    /* non streamed additonnal info */
-    /* packet filling */
-    int packet_size_left;
-    /* only for reading */
-    uint64_t data_offset;                ///< beginning of the first data packet
-    uint64_t data_object_offset;         ///< data object offset (excl. GUID & size)
-    uint64_t data_object_size;           ///< size of the data object
-    int index_read;
-
-    ASFMainHeader hdr;
-
-    int packet_flags;
-    int packet_property;
-    int packet_timestamp;
-    int packet_segsizetype;
-    int packet_segments;
-    int packet_seq;
-    int packet_replic_size;
-    int packet_key_frame;
-    int packet_padsize;
-    unsigned int packet_frag_offset;
-    unsigned int packet_frag_size;
-    int64_t packet_frag_timestamp;
-    int packet_multi_size;
-    int packet_obj_size;
-    int packet_time_delta;
-    int packet_time_start;
-    int64_t packet_pos;
-
-    int stream_index;
-
-    ASFStream *asf_st;                   ///< currently decoded stream
-
-    int no_resync_search;
-} ASFContext;
-
-static const AVOption options[] = {
-    { "no_resync_search", "Don't try to resynchronize by looking for a certain optional start code", offsetof(ASFContext, no_resync_search), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-static const AVClass asf_class = {
-    .class_name = "asf demuxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-#undef NDEBUG
-#include <assert.h>
-
-#define ASF_MAX_STREAMS 127
-#define FRAME_HEADER_SIZE 17
-// Fix Me! FRAME_HEADER_SIZE may be different.
-
-static const ff_asf_guid index_guid = {
-    0x90, 0x08, 0x00, 0x33, 0xb1, 0xe5, 0xcf, 0x11, 0x89, 0xf4, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb
-};
-
-#ifdef DEBUG
-static const ff_asf_guid stream_bitrate_guid = { /* (http://get.to/sdp) */
-    0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2
-};
-
-#define PRINT_IF_GUID(g, cmp) \
-    if (!ff_guidcmp(g, &cmp)) \
-        av_dlog(NULL, "(GUID: %s) ", # cmp)
-
-static void print_guid(ff_asf_guid *g)
-{
-    int i;
-    PRINT_IF_GUID(g, ff_asf_header);
-    else PRINT_IF_GUID(g, ff_asf_file_header);
-    else PRINT_IF_GUID(g, ff_asf_stream_header);
-    else PRINT_IF_GUID(g, ff_asf_audio_stream);
-    else PRINT_IF_GUID(g, ff_asf_audio_conceal_none);
-    else PRINT_IF_GUID(g, ff_asf_video_stream);
-    else PRINT_IF_GUID(g, ff_asf_video_conceal_none);
-    else PRINT_IF_GUID(g, ff_asf_command_stream);
-    else PRINT_IF_GUID(g, ff_asf_comment_header);
-    else PRINT_IF_GUID(g, ff_asf_codec_comment_header);
-    else PRINT_IF_GUID(g, ff_asf_codec_comment1_header);
-    else PRINT_IF_GUID(g, ff_asf_data_header);
-    else PRINT_IF_GUID(g, index_guid);
-    else PRINT_IF_GUID(g, ff_asf_head1_guid);
-    else PRINT_IF_GUID(g, ff_asf_head2_guid);
-    else PRINT_IF_GUID(g, ff_asf_my_guid);
-    else PRINT_IF_GUID(g, ff_asf_ext_stream_header);
-    else PRINT_IF_GUID(g, ff_asf_extended_content_header);
-    else PRINT_IF_GUID(g, ff_asf_ext_stream_embed_stream_header);
-    else PRINT_IF_GUID(g, ff_asf_ext_stream_audio_stream);
-    else PRINT_IF_GUID(g, ff_asf_metadata_header);
-    else PRINT_IF_GUID(g, ff_asf_metadata_library_header);
-    else PRINT_IF_GUID(g, ff_asf_marker_header);
-    else PRINT_IF_GUID(g, stream_bitrate_guid);
-    else PRINT_IF_GUID(g, ff_asf_language_guid);
-    else
-        av_dlog(NULL, "(GUID: unknown) ");
-    for (i = 0; i < 16; i++)
-        av_dlog(NULL, " 0x%02x,", (*g)[i]);
-    av_dlog(NULL, "}\n");
-}
-#undef PRINT_IF_GUID
-#else
-#define print_guid(g)
-#endif
-
-static int asf_probe(AVProbeData *pd)
-{
-    /* check file header */
-    if (!ff_guidcmp(pd->buf, &ff_asf_header))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-/* size of type 2 (BOOL) is 32bit for "Extended Content Description Object"
- * but 16 bit for "Metadata Object" and "Metadata Library Object" */
-static int get_value(AVIOContext *pb, int type, int type2_size)
-{
-    switch (type) {
-    case 2:
-        return (type2_size == 32) ? avio_rl32(pb) : avio_rl16(pb);
-    case 3:
-        return avio_rl32(pb);
-    case 4:
-        return avio_rl64(pb);
-    case 5:
-        return avio_rl16(pb);
-    default:
-        return INT_MIN;
-    }
-}
-
-/* MSDN claims that this should be "compatible with the ID3 frame, APIC",
- * but in reality this is only loosely similar */
-static int asf_read_picture(AVFormatContext *s, int len)
-{
-    AVPacket pkt          = { 0 };
-    const CodecMime *mime = ff_id3v2_mime_tags;
-    enum  AVCodecID id    = AV_CODEC_ID_NONE;
-    char mimetype[64];
-    uint8_t  *desc = NULL;
-    AVStream   *st = NULL;
-    int ret, type, picsize, desc_len;
-
-    /* type + picsize + mime + desc */
-    if (len < 1 + 4 + 2 + 2) {
-        av_log(s, AV_LOG_ERROR, "Invalid attached picture size: %d.\n", len);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* picture type */
-    type = avio_r8(s->pb);
-    len--;
-    if (type >= FF_ARRAY_ELEMS(ff_id3v2_picture_types) || type < 0) {
-        av_log(s, AV_LOG_WARNING, "Unknown attached picture type: %d.\n", type);
-        type = 0;
-    }
-
-    /* picture data size */
-    picsize = avio_rl32(s->pb);
-    len    -= 4;
-
-    /* picture MIME type */
-    len -= avio_get_str16le(s->pb, len, mimetype, sizeof(mimetype));
-    while (mime->id != AV_CODEC_ID_NONE) {
-        if (!strncmp(mime->str, mimetype, sizeof(mimetype))) {
-            id = mime->id;
-            break;
-        }
-        mime++;
-    }
-    if (id == AV_CODEC_ID_NONE) {
-        av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n",
-               mimetype);
-        return 0;
-    }
-
-    if (picsize >= len) {
-        av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d >= %d.\n",
-               picsize, len);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* picture description */
-    desc_len = (len - picsize) * 2 + 1;
-    desc     = av_malloc(desc_len);
-    if (!desc)
-        return AVERROR(ENOMEM);
-    len -= avio_get_str16le(s->pb, len - picsize, desc, desc_len);
-
-    ret = av_get_packet(s->pb, &pkt, picsize);
-    if (ret < 0)
-        goto fail;
-
-    st  = avformat_new_stream(s, NULL);
-    if (!st) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-    st->disposition              |= AV_DISPOSITION_ATTACHED_PIC;
-    st->codec->codec_type         = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id           = id;
-    st->attached_pic              = pkt;
-    st->attached_pic.stream_index = st->index;
-    st->attached_pic.flags       |= AV_PKT_FLAG_KEY;
-
-    if (*desc)
-        av_dict_set(&st->metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL);
-    else
-        av_freep(&desc);
-
-    av_dict_set(&st->metadata, "comment", ff_id3v2_picture_types[type], 0);
-
-    return 0;
-
-fail:
-    av_freep(&desc);
-    av_free_packet(&pkt);
-    return ret;
-}
-
-static void get_id3_tag(AVFormatContext *s, int len)
-{
-    ID3v2ExtraMeta *id3v2_extra_meta = NULL;
-
-    ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
-    if (id3v2_extra_meta)
-        ff_id3v2_parse_apic(s, &id3v2_extra_meta);
-    ff_id3v2_free_extra_meta(&id3v2_extra_meta);
-}
-
-static void get_tag(AVFormatContext *s, const char *key, int type, int len, int type2_size)
-{
-    char *value;
-    int64_t off = avio_tell(s->pb);
-
-    if ((unsigned)len >= (UINT_MAX - 1) / 2)
-        return;
-
-    value = av_malloc(2 * len + 1);
-    if (!value)
-        goto finish;
-
-    if (type == 0) {         // UTF16-LE
-        avio_get_str16le(s->pb, len, value, 2 * len + 1);
-    } else if (type == 1) {  // byte array
-        if (!strcmp(key, "WM/Picture")) { // handle cover art
-            asf_read_picture(s, len);
-        } else if (!strcmp(key, "ID3")) { // handle ID3 tag
-            get_id3_tag(s, len);
-        } else {
-            av_log(s, AV_LOG_VERBOSE, "Unsupported byte array in tag %s.\n", key);
-        }
-        goto finish;
-    } else if (type > 1 && type <= 5) {  // boolean or DWORD or QWORD or WORD
-        uint64_t num = get_value(s->pb, type, type2_size);
-        snprintf(value, len, "%"PRIu64, num);
-    } else if (type == 6) { // (don't) handle GUID
-        av_log(s, AV_LOG_DEBUG, "Unsupported GUID value in tag %s.\n", key);
-        goto finish;
-    } else {
-        av_log(s, AV_LOG_DEBUG,
-               "Unsupported value type %d in tag %s.\n", type, key);
-        goto finish;
-    }
-    if (*value)
-        av_dict_set(&s->metadata, key, value, 0);
-
-finish:
-    av_freep(&value);
-    avio_seek(s->pb, off + len, SEEK_SET);
-}
-
-static int asf_read_file_properties(AVFormatContext *s, int64_t size)
-{
-    ASFContext *asf = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    ff_get_guid(pb, &asf->hdr.guid);
-    asf->hdr.file_size   = avio_rl64(pb);
-    asf->hdr.create_time = avio_rl64(pb);
-    avio_rl64(pb);                               /* number of packets */
-    asf->hdr.play_time   = avio_rl64(pb);
-    asf->hdr.send_time   = avio_rl64(pb);
-    asf->hdr.preroll     = avio_rl32(pb);
-    asf->hdr.ignore      = avio_rl32(pb);
-    asf->hdr.flags       = avio_rl32(pb);
-    asf->hdr.min_pktsize = avio_rl32(pb);
-    asf->hdr.max_pktsize = avio_rl32(pb);
-    if (asf->hdr.min_pktsize >= (1U << 29))
-        return AVERROR_INVALIDDATA;
-    asf->hdr.max_bitrate = avio_rl32(pb);
-    s->packet_size       = asf->hdr.max_pktsize;
-
-    return 0;
-}
-
-static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
-{
-    ASFContext *asf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    ASFStream *asf_st;
-    ff_asf_guid g;
-    enum AVMediaType type;
-    int type_specific_size, sizeX;
-    unsigned int tag1;
-    int64_t pos1, pos2, start_time;
-    int test_for_ext_stream_audio, is_dvr_ms_audio = 0;
-
-    if (s->nb_streams == ASF_MAX_STREAMS) {
-        av_log(s, AV_LOG_ERROR, "too many streams\n");
-        return AVERROR(EINVAL);
-    }
-
-    pos1 = avio_tell(pb);
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    avpriv_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */
-    asf_st = av_mallocz(sizeof(ASFStream));
-    if (!asf_st)
-        return AVERROR(ENOMEM);
-    st->priv_data  = asf_st;
-    st->start_time = 0;
-    start_time     = asf->hdr.preroll;
-
-    asf_st->stream_language_index = 128; // invalid stream index means no language info
-
-    if (!(asf->hdr.flags & 0x01)) { // if we aren't streaming...
-        st->duration = asf->hdr.play_time /
-                       (10000000 / 1000) - start_time;
-    }
-    ff_get_guid(pb, &g);
-
-    test_for_ext_stream_audio = 0;
-    if (!ff_guidcmp(&g, &ff_asf_audio_stream)) {
-        type = AVMEDIA_TYPE_AUDIO;
-    } else if (!ff_guidcmp(&g, &ff_asf_video_stream)) {
-        type = AVMEDIA_TYPE_VIDEO;
-    } else if (!ff_guidcmp(&g, &ff_asf_jfif_media)) {
-        type                = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id = AV_CODEC_ID_MJPEG;
-    } else if (!ff_guidcmp(&g, &ff_asf_command_stream)) {
-        type = AVMEDIA_TYPE_DATA;
-    } else if (!ff_guidcmp(&g, &ff_asf_ext_stream_embed_stream_header)) {
-        test_for_ext_stream_audio = 1;
-        type                      = AVMEDIA_TYPE_UNKNOWN;
-    } else {
-        return -1;
-    }
-    ff_get_guid(pb, &g);
-    avio_skip(pb, 8); /* total_size */
-    type_specific_size = avio_rl32(pb);
-    avio_rl32(pb);
-    st->id = avio_rl16(pb) & 0x7f; /* stream id */
-    // mapping of asf ID to AV stream ID;
-    asf->asfid2avid[st->id] = s->nb_streams - 1;
-
-    avio_rl32(pb);
-
-    if (test_for_ext_stream_audio) {
-        ff_get_guid(pb, &g);
-        if (!ff_guidcmp(&g, &ff_asf_ext_stream_audio_stream)) {
-            type            = AVMEDIA_TYPE_AUDIO;
-            is_dvr_ms_audio = 1;
-            ff_get_guid(pb, &g);
-            avio_rl32(pb);
-            avio_rl32(pb);
-            avio_rl32(pb);
-            ff_get_guid(pb, &g);
-            avio_rl32(pb);
-        }
-    }
-
-    st->codec->codec_type = type;
-    if (type == AVMEDIA_TYPE_AUDIO) {
-        int ret = ff_get_wav_header(pb, st->codec, type_specific_size);
-        if (ret < 0)
-            return ret;
-        if (is_dvr_ms_audio) {
-            // codec_id and codec_tag are unreliable in dvr_ms
-            // files. Set them later by probing stream.
-            st->codec->codec_id  = AV_CODEC_ID_PROBE;
-            st->codec->codec_tag = 0;
-        }
-        if (st->codec->codec_id == AV_CODEC_ID_AAC)
-            st->need_parsing = AVSTREAM_PARSE_NONE;
-        else
-            st->need_parsing = AVSTREAM_PARSE_FULL;
-        /* We have to init the frame size at some point .... */
-        pos2 = avio_tell(pb);
-        if (size >= (pos2 + 8 - pos1 + 24)) {
-            asf_st->ds_span        = avio_r8(pb);
-            asf_st->ds_packet_size = avio_rl16(pb);
-            asf_st->ds_chunk_size  = avio_rl16(pb);
-            avio_rl16(pb);  // ds_data_size
-            avio_r8(pb);    // ds_silence_data
-        }
-        if (asf_st->ds_span > 1) {
-            if (!asf_st->ds_chunk_size                                ||
-                (asf_st->ds_packet_size / asf_st->ds_chunk_size <= 1) ||
-                asf_st->ds_packet_size % asf_st->ds_chunk_size)
-                asf_st->ds_span = 0;  // disable descrambling
-        }
-    } else if (type == AVMEDIA_TYPE_VIDEO &&
-               size - (avio_tell(pb) - pos1 + 24) >= 51) {
-        avio_rl32(pb);
-        avio_rl32(pb);
-        avio_r8(pb);
-        avio_rl16(pb);        /* size */
-        sizeX             = avio_rl32(pb); /* size */
-        st->codec->width  = avio_rl32(pb);
-        st->codec->height = avio_rl32(pb);
-        /* not available for asf */
-        avio_rl16(pb); /* panes */
-        st->codec->bits_per_coded_sample = avio_rl16(pb); /* depth */
-        tag1                             = avio_rl32(pb);
-        avio_skip(pb, 20);
-        if (sizeX > 40) {
-            st->codec->extradata_size = sizeX - 40;
-            st->codec->extradata      = av_mallocz(st->codec->extradata_size +
-                                                   FF_INPUT_BUFFER_PADDING_SIZE);
-            avio_read(pb, st->codec->extradata, st->codec->extradata_size);
-        }
-
-        /* Extract palette from extradata if bpp <= 8 */
-        /* This code assumes that extradata contains only palette */
-        /* This is true for all paletted codecs implemented in libavcodec */
-        if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
-#if HAVE_BIGENDIAN
-            int i;
-            for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE) / 4; i++)
-                asf_st->palette[i] = av_bswap32(((uint32_t *)st->codec->extradata)[i]);
-#else
-            memcpy(asf_st->palette, st->codec->extradata,
-                   FFMIN(st->codec->extradata_size, AVPALETTE_SIZE));
-#endif
-            asf_st->palette_changed = 1;
-        }
-
-        st->codec->codec_tag = tag1;
-        st->codec->codec_id  = ff_codec_get_id(ff_codec_bmp_tags, tag1);
-        if (tag1 == MKTAG('D', 'V', 'R', ' ')) {
-            st->need_parsing = AVSTREAM_PARSE_FULL;
-            /* issue658 contains wrong w/h and MS even puts a fake seq header
-             * with wrong w/h in extradata while a correct one is in the stream.
-             * maximum lameness */
-            st->codec->width      =
-                st->codec->height = 0;
-            av_freep(&st->codec->extradata);
-            st->codec->extradata_size = 0;
-        }
-        if (st->codec->codec_id == AV_CODEC_ID_H264)
-            st->need_parsing = AVSTREAM_PARSE_FULL_ONCE;
-    }
-    pos2 = avio_tell(pb);
-    avio_skip(pb, size - (pos2 - pos1 + 24));
-
-    return 0;
-}
-
-static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size)
-{
-    ASFContext *asf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    ff_asf_guid g;
-    int ext_len, payload_ext_ct, stream_ct, i;
-    uint32_t leak_rate, stream_num;
-    unsigned int stream_languageid_index;
-
-    avio_rl64(pb); // starttime
-    avio_rl64(pb); // endtime
-    leak_rate = avio_rl32(pb); // leak-datarate
-    avio_rl32(pb); // bucket-datasize
-    avio_rl32(pb); // init-bucket-fullness
-    avio_rl32(pb); // alt-leak-datarate
-    avio_rl32(pb); // alt-bucket-datasize
-    avio_rl32(pb); // alt-init-bucket-fullness
-    avio_rl32(pb); // max-object-size
-    avio_rl32(pb); // flags (reliable,seekable,no_cleanpoints?,resend-live-cleanpoints, rest of bits reserved)
-    stream_num = avio_rl16(pb); // stream-num
-
-    stream_languageid_index = avio_rl16(pb); // stream-language-id-index
-    if (stream_num < 128)
-        asf->streams[stream_num].stream_language_index = stream_languageid_index;
-
-    avio_rl64(pb); // avg frametime in 100ns units
-    stream_ct      = avio_rl16(pb); // stream-name-count
-    payload_ext_ct = avio_rl16(pb); // payload-extension-system-count
-
-    if (stream_num < 128)
-        asf->stream_bitrates[stream_num] = leak_rate;
-
-    for (i = 0; i < stream_ct; i++) {
-        avio_rl16(pb);
-        ext_len = avio_rl16(pb);
-        avio_skip(pb, ext_len);
-    }
-
-    for (i = 0; i < payload_ext_ct; i++) {
-        ff_get_guid(pb, &g);
-        avio_skip(pb, 2);
-        ext_len = avio_rl32(pb);
-        avio_skip(pb, ext_len);
-    }
-
-    return 0;
-}
-
-static int asf_read_content_desc(AVFormatContext *s, int64_t size)
-{
-    AVIOContext *pb = s->pb;
-    int len1, len2, len3, len4, len5;
-
-    len1 = avio_rl16(pb);
-    len2 = avio_rl16(pb);
-    len3 = avio_rl16(pb);
-    len4 = avio_rl16(pb);
-    len5 = avio_rl16(pb);
-    get_tag(s, "title", 0, len1, 32);
-    get_tag(s, "author", 0, len2, 32);
-    get_tag(s, "copyright", 0, len3, 32);
-    get_tag(s, "comment", 0, len4, 32);
-    avio_skip(pb, len5);
-
-    return 0;
-}
-
-static int asf_read_ext_content_desc(AVFormatContext *s, int64_t size)
-{
-    AVIOContext *pb = s->pb;
-    ASFContext *asf = s->priv_data;
-    int desc_count, i, ret;
-
-    desc_count = avio_rl16(pb);
-    for (i = 0; i < desc_count; i++) {
-        int name_len, value_type, value_len;
-        char name[1024];
-
-        name_len = avio_rl16(pb);
-        if (name_len % 2)   // must be even, broken lavf versions wrote len-1
-            name_len += 1;
-        if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
-            avio_skip(pb, name_len - ret);
-        value_type = avio_rl16(pb);
-        value_len  = avio_rl16(pb);
-        if (!value_type && value_len % 2)
-            value_len += 1;
-        /* My sample has that stream set to 0 maybe that mean the container.
-         * ASF stream count starts at 1. I am using 0 to the container value
-         * since it's unused. */
-        if (!strcmp(name, "AspectRatioX"))
-            asf->dar[0].num = get_value(s->pb, value_type, 32);
-        else if (!strcmp(name, "AspectRatioY"))
-            asf->dar[0].den = get_value(s->pb, value_type, 32);
-        else
-            get_tag(s, name, value_type, value_len, 32);
-    }
-
-    return 0;
-}
-
-static int asf_read_language_list(AVFormatContext *s, int64_t size)
-{
-    AVIOContext *pb = s->pb;
-    ASFContext *asf = s->priv_data;
-    int j, ret;
-    int stream_count = avio_rl16(pb);
-    for (j = 0; j < stream_count; j++) {
-        char lang[6];
-        unsigned int lang_len = avio_r8(pb);
-        if ((ret = avio_get_str16le(pb, lang_len, lang,
-                                    sizeof(lang))) < lang_len)
-            avio_skip(pb, lang_len - ret);
-        if (j < 128)
-            av_strlcpy(asf->stream_languages[j], lang,
-                       sizeof(*asf->stream_languages));
-    }
-
-    return 0;
-}
-
-static int asf_read_metadata(AVFormatContext *s, int64_t size)
-{
-    AVIOContext *pb = s->pb;
-    ASFContext *asf = s->priv_data;
-    int n, stream_num, name_len, value_len;
-    int ret, i;
-    n = avio_rl16(pb);
-
-    for (i = 0; i < n; i++) {
-        char name[1024];
-        int value_type;
-
-        avio_rl16(pb);  // lang_list_index
-        stream_num = avio_rl16(pb);
-        name_len   = avio_rl16(pb);
-        value_type = avio_rl16(pb); /* value_type */
-        value_len  = avio_rl32(pb);
-
-        if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
-            avio_skip(pb, name_len - ret);
-        av_dlog(s, "%d stream %d name_len %2d type %d len %4d <%s>\n",
-                i, stream_num, name_len, value_type, value_len, name);
-
-        if (!strcmp(name, "AspectRatioX")){
-            int aspect_x = get_value(s->pb, value_type, 16);
-            if(stream_num < 128)
-                asf->dar[stream_num].num = aspect_x;
-        } else if(!strcmp(name, "AspectRatioY")){
-            int aspect_y = get_value(s->pb, value_type, 16);
-            if(stream_num < 128)
-                asf->dar[stream_num].den = aspect_y;
-        } else {
-            get_tag(s, name, value_type, value_len, 16);
-        }
-    }
-
-    return 0;
-}
-
-static int asf_read_marker(AVFormatContext *s, int64_t size)
-{
-    AVIOContext *pb = s->pb;
-    ASFContext *asf = s->priv_data;
-    int i, count, name_len, ret;
-    char name[1024];
-
-    avio_rl64(pb);            // reserved 16 bytes
-    avio_rl64(pb);            // ...
-    count = avio_rl32(pb);    // markers count
-    avio_rl16(pb);            // reserved 2 bytes
-    name_len = avio_rl16(pb); // name length
-    for (i = 0; i < name_len; i++)
-        avio_r8(pb); // skip the name
-
-    for (i = 0; i < count; i++) {
-        int64_t pres_time;
-        int name_len;
-
-        avio_rl64(pb);             // offset, 8 bytes
-        pres_time = avio_rl64(pb); // presentation time
-        pres_time -= asf->hdr.preroll * 10000;
-        avio_rl16(pb);             // entry length
-        avio_rl32(pb);             // send time
-        avio_rl32(pb);             // flags
-        name_len = avio_rl32(pb);  // name length
-        if ((ret = avio_get_str16le(pb, name_len * 2, name,
-                                    sizeof(name))) < name_len)
-            avio_skip(pb, name_len - ret);
-        avpriv_new_chapter(s, i, (AVRational) { 1, 10000000 }, pres_time,
-                           AV_NOPTS_VALUE, name);
-    }
-
-    return 0;
-}
-
-static int asf_read_header(AVFormatContext *s)
-{
-    ASFContext *asf = s->priv_data;
-    ff_asf_guid g;
-    AVIOContext *pb = s->pb;
-    int i;
-    int64_t gsize;
-
-    ff_get_guid(pb, &g);
-    if (ff_guidcmp(&g, &ff_asf_header))
-        return -1;
-    avio_rl64(pb);
-    avio_rl32(pb);
-    avio_r8(pb);
-    avio_r8(pb);
-    memset(&asf->asfid2avid, -1, sizeof(asf->asfid2avid));
-    for (;;) {
-        uint64_t gpos = avio_tell(pb);
-        ff_get_guid(pb, &g);
-        gsize = avio_rl64(pb);
-        print_guid(&g);
-        if (!ff_guidcmp(&g, &ff_asf_data_header)) {
-            asf->data_object_offset = avio_tell(pb);
-            /* If not streaming, gsize is not unlimited (how?),
-             * and there is enough space in the file.. */
-            if (!(asf->hdr.flags & 0x01) && gsize >= 100)
-                asf->data_object_size = gsize - 24;
-            else
-                asf->data_object_size = (uint64_t)-1;
-            break;
-        }
-        if (gsize < 24)
-            return -1;
-        if (!ff_guidcmp(&g, &ff_asf_file_header)) {
-            int ret = asf_read_file_properties(s, gsize);
-            if (ret < 0)
-                return ret;
-        } else if (!ff_guidcmp(&g, &ff_asf_stream_header)) {
-            int ret = asf_read_stream_properties(s, gsize);
-            if (ret < 0)
-                return ret;
-        } else if (!ff_guidcmp(&g, &ff_asf_comment_header)) {
-            asf_read_content_desc(s, gsize);
-        } else if (!ff_guidcmp(&g, &ff_asf_language_guid)) {
-            asf_read_language_list(s, gsize);
-        } else if (!ff_guidcmp(&g, &ff_asf_extended_content_header)) {
-            asf_read_ext_content_desc(s, gsize);
-        } else if (!ff_guidcmp(&g, &ff_asf_metadata_header)) {
-            asf_read_metadata(s, gsize);
-        } else if (!ff_guidcmp(&g, &ff_asf_metadata_library_header)) {
-            asf_read_metadata(s, gsize);
-        } else if (!ff_guidcmp(&g, &ff_asf_ext_stream_header)) {
-            asf_read_ext_stream_properties(s, gsize);
-
-            // there could be a optional stream properties object to follow
-            // if so the next iteration will pick it up
-            continue;
-        } else if (!ff_guidcmp(&g, &ff_asf_head1_guid)) {
-            ff_get_guid(pb, &g);
-            avio_skip(pb, 6);
-            continue;
-        } else if (!ff_guidcmp(&g, &ff_asf_marker_header)) {
-            asf_read_marker(s, gsize);
-        } else if (pb->eof_reached) {
-            return -1;
-        } else {
-            if (!s->keylen) {
-                if (!ff_guidcmp(&g, &ff_asf_content_encryption)) {
-                    av_log(s, AV_LOG_WARNING,
-                           "DRM protected stream detected, decoding will likely fail!\n");
-                } else if (!ff_guidcmp(&g, &ff_asf_ext_content_encryption)) {
-                    av_log(s, AV_LOG_WARNING,
-                           "Ext DRM protected stream detected, decoding will likely fail!\n");
-                } else if (!ff_guidcmp(&g, &ff_asf_digital_signature)) {
-                    av_log(s, AV_LOG_WARNING,
-                           "Digital signature detected, decoding will likely fail!\n");
-                }
-            }
-        }
-        if (avio_tell(pb) != gpos + gsize)
-            av_log(s, AV_LOG_DEBUG,
-                   "gpos mismatch our pos=%"PRIu64", end=%"PRId64"\n",
-                   avio_tell(pb) - gpos, gsize);
-        avio_seek(pb, gpos + gsize, SEEK_SET);
-    }
-    ff_get_guid(pb, &g);
-    avio_rl64(pb);
-    avio_r8(pb);
-    avio_r8(pb);
-    if (pb->eof_reached)
-        return -1;
-    asf->data_offset      = avio_tell(pb);
-    asf->packet_size_left = 0;
-
-    for (i = 0; i < 128; i++) {
-        int stream_num = asf->asfid2avid[i];
-        if (stream_num >= 0) {
-            AVStream *st = s->streams[stream_num];
-            if (!st->codec->bit_rate)
-                st->codec->bit_rate = asf->stream_bitrates[i];
-            if (asf->dar[i].num > 0 && asf->dar[i].den > 0) {
-                av_reduce(&st->sample_aspect_ratio.num,
-                          &st->sample_aspect_ratio.den,
-                          asf->dar[i].num, asf->dar[i].den, INT_MAX);
-            } else if ((asf->dar[0].num > 0) && (asf->dar[0].den > 0) &&
-                       // Use ASF container value if the stream doesn't set AR.
-                       (st->codec->codec_type == AVMEDIA_TYPE_VIDEO))
-                av_reduce(&st->sample_aspect_ratio.num,
-                          &st->sample_aspect_ratio.den,
-                          asf->dar[0].num, asf->dar[0].den, INT_MAX);
-
-            av_dlog(s, "i=%d, st->codec->codec_type:%d, asf->dar %d:%d sar=%d:%d\n",
-                    i, st->codec->codec_type, asf->dar[i].num, asf->dar[i].den,
-                    st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
-
-            // copy and convert language codes to the frontend
-            if (asf->streams[i].stream_language_index < 128) {
-                const char *rfc1766 = asf->stream_languages[asf->streams[i].stream_language_index];
-                if (rfc1766 && strlen(rfc1766) > 1) {
-                    const char primary_tag[3] = { rfc1766[0], rfc1766[1], '\0' }; // ignore country code if any
-                    const char *iso6392       = av_convert_lang_to(primary_tag,
-                                                                   AV_LANG_ISO639_2_BIBL);
-                    if (iso6392)
-                        av_dict_set(&st->metadata, "language", iso6392, 0);
-                }
-            }
-        }
-    }
-
-    ff_metadata_conv(&s->metadata, NULL, ff_asf_metadata_conv);
-
-    return 0;
-}
-
-#define DO_2BITS(bits, var, defval)             \
-    switch (bits & 3) {                         \
-    case 3:                                     \
-        var = avio_rl32(pb);                    \
-        rsize += 4;                             \
-        break;                                  \
-    case 2:                                     \
-        var = avio_rl16(pb);                    \
-        rsize += 2;                             \
-        break;                                  \
-    case 1:                                     \
-        var = avio_r8(pb);                      \
-        rsize++;                                \
-        break;                                  \
-    default:                                    \
-        var = defval;                           \
-        break;                                  \
-    }
-
-/**
- * Load a single ASF packet into the demuxer.
- * @param s demux context
- * @param pb context to read data from
- * @return 0 on success, <0 on error
- */
-static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
-{
-    ASFContext *asf = s->priv_data;
-    uint32_t packet_length, padsize;
-    int rsize = 8;
-    int c, d, e, off;
-
-    // if we do not know packet size, allow skipping up to 32 kB
-    off = 32768;
-    if (asf->no_resync_search)
-        off = 3;
-    else if (s->packet_size > 0)
-        off = (avio_tell(pb) - s->data_offset) % s->packet_size + 3;
-
-    c = d = e = -1;
-    while (off-- > 0) {
-        c = d;
-        d = e;
-        e = avio_r8(pb);
-        if (c == 0x82 && !d && !e)
-            break;
-    }
-
-    if (c != 0x82) {
-        /* This code allows handling of -EAGAIN at packet boundaries (i.e.
-         * if the packet sync code above triggers -EAGAIN). This does not
-         * imply complete -EAGAIN handling support at random positions in
-         * the stream. */
-        if (pb->error == AVERROR(EAGAIN))
-            return AVERROR(EAGAIN);
-        if (!pb->eof_reached)
-            av_log(s, AV_LOG_ERROR,
-                   "ff asf bad header %x  at:%"PRId64"\n", c, avio_tell(pb));
-    }
-    if ((c & 0x8f) == 0x82) {
-        if (d || e) {
-            if (!pb->eof_reached)
-                av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
-            return -1;
-        }
-        c      = avio_r8(pb);
-        d      = avio_r8(pb);
-        rsize += 3;
-    } else if (!pb->eof_reached) {
-        avio_seek(pb, -1, SEEK_CUR); // FIXME
-    }
-
-    asf->packet_flags    = c;
-    asf->packet_property = d;
-
-    DO_2BITS(asf->packet_flags >> 5, packet_length, s->packet_size);
-    DO_2BITS(asf->packet_flags >> 1, padsize, 0); // sequence ignored
-    DO_2BITS(asf->packet_flags >> 3, padsize, 0); // padding length
-
-    // the following checks prevent overflows and infinite loops
-    if (!packet_length || packet_length >= (1U << 29)) {
-        av_log(s, AV_LOG_ERROR,
-               "invalid packet_length %d at:%"PRId64"\n",
-               packet_length, avio_tell(pb));
-        return -1;
-    }
-    if (padsize >= packet_length) {
-        av_log(s, AV_LOG_ERROR,
-               "invalid padsize %d at:%"PRId64"\n", padsize, avio_tell(pb));
-        return -1;
-    }
-
-    asf->packet_timestamp = avio_rl32(pb);
-    avio_rl16(pb); /* duration */
-    // rsize has at least 11 bytes which have to be present
-
-    if (asf->packet_flags & 0x01) {
-        asf->packet_segsizetype = avio_r8(pb);
-        rsize++;
-        asf->packet_segments = asf->packet_segsizetype & 0x3f;
-    } else {
-        asf->packet_segments    = 1;
-        asf->packet_segsizetype = 0x80;
-    }
-    if (rsize > packet_length - padsize) {
-        asf->packet_size_left = 0;
-        av_log(s, AV_LOG_ERROR,
-               "invalid packet header length %d for pktlen %d-%d at %"PRId64"\n",
-               rsize, packet_length, padsize, avio_tell(pb));
-        return -1;
-    }
-    asf->packet_size_left = packet_length - padsize - rsize;
-    if (packet_length < asf->hdr.min_pktsize)
-        padsize += asf->hdr.min_pktsize - packet_length;
-    asf->packet_padsize = padsize;
-    av_dlog(s, "packet: size=%d padsize=%d  left=%d\n",
-            s->packet_size, asf->packet_padsize, asf->packet_size_left);
-    return 0;
-}
-
-/**
- *
- * @return <0 if error
- */
-static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb)
-{
-    ASFContext *asf = s->priv_data;
-    int rsize       = 1;
-    int num         = avio_r8(pb);
-    int64_t ts0;
-
-    asf->packet_segments--;
-    asf->packet_key_frame = num >> 7;
-    asf->stream_index     = asf->asfid2avid[num & 0x7f];
-    // sequence should be ignored!
-    DO_2BITS(asf->packet_property >> 4, asf->packet_seq, 0);
-    DO_2BITS(asf->packet_property >> 2, asf->packet_frag_offset, 0);
-    DO_2BITS(asf->packet_property, asf->packet_replic_size, 0);
-    av_dlog(asf, "key:%d stream:%d seq:%d offset:%d replic_size:%d\n",
-            asf->packet_key_frame, asf->stream_index, asf->packet_seq,
-            asf->packet_frag_offset, asf->packet_replic_size);
-    if (asf->packet_replic_size >= 8) {
-        asf->packet_obj_size = avio_rl32(pb);
-        if (asf->packet_obj_size >= (1 << 24) || asf->packet_obj_size <= 0) {
-            av_log(s, AV_LOG_ERROR, "packet_obj_size invalid\n");
-            return -1;
-        }
-        asf->packet_frag_timestamp = avio_rl32(pb); // timestamp
-        if (asf->packet_replic_size >= 8 + 38 + 4) {
-            avio_skip(pb, 10);
-            ts0 = avio_rl64(pb);
-            avio_skip(pb, 8);
-            avio_skip(pb, 12);
-            avio_rl32(pb);
-            avio_skip(pb, asf->packet_replic_size - 8 - 38 - 4);
-            if (ts0 != -1)
-                asf->packet_frag_timestamp = ts0 / 10000;
-            else
-                asf->packet_frag_timestamp = AV_NOPTS_VALUE;
-        } else
-            avio_skip(pb, asf->packet_replic_size - 8);
-        rsize += asf->packet_replic_size; // FIXME - check validity
-    } else if (asf->packet_replic_size == 1) {
-        // multipacket - frag_offset is beginning timestamp
-        asf->packet_time_start     = asf->packet_frag_offset;
-        asf->packet_frag_offset    = 0;
-        asf->packet_frag_timestamp = asf->packet_timestamp;
-
-        asf->packet_time_delta = avio_r8(pb);
-        rsize++;
-    } else if (asf->packet_replic_size != 0) {
-        av_log(s, AV_LOG_ERROR, "unexpected packet_replic_size of %d\n",
-               asf->packet_replic_size);
-        return -1;
-    }
-    if (asf->packet_flags & 0x01) {
-        DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 0 is illegal
-        if (rsize > asf->packet_size_left) {
-            av_log(s, AV_LOG_ERROR, "packet_replic_size is invalid\n");
-            return -1;
-        } else if (asf->packet_frag_size > asf->packet_size_left - rsize) {
-            if (asf->packet_frag_size > asf->packet_size_left - rsize + asf->packet_padsize) {
-                av_log(s, AV_LOG_ERROR, "packet_frag_size is invalid (%d-%d)\n",
-                       asf->packet_size_left, rsize);
-                return -1;
-            } else {
-                int diff = asf->packet_frag_size - (asf->packet_size_left - rsize);
-                asf->packet_size_left += diff;
-                asf->packet_padsize   -= diff;
-            }
-        }
-    } else {
-        if (rsize > asf->packet_size_left) {
-            av_log(s, AV_LOG_ERROR, "packet_replic_size is invalid\n");
-            return -1;
-        }
-        asf->packet_frag_size = asf->packet_size_left - rsize;
-    }
-    if (asf->packet_replic_size == 1) {
-        asf->packet_multi_size = asf->packet_frag_size;
-        if (asf->packet_multi_size > asf->packet_size_left)
-            return -1;
-    }
-    asf->packet_size_left -= rsize;
-
-    return 0;
-}
-
-/**
- * Parse data from individual ASF packets (which were previously loaded
- * with asf_get_packet()).
- * @param s demux context
- * @param pb context to read data from
- * @param pkt pointer to store packet data into
- * @return 0 if data was stored in pkt, <0 on error or 1 if more ASF
- *          packets need to be loaded (through asf_get_packet())
- */
-static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
-{
-    ASFContext *asf   = s->priv_data;
-    ASFStream *asf_st = 0;
-    for (;;) {
-        int ret;
-
-        if (pb->eof_reached)
-            return AVERROR_EOF;
-
-        if (asf->packet_size_left < FRAME_HEADER_SIZE ||
-            asf->packet_segments < 1) {
-            int ret = asf->packet_size_left + asf->packet_padsize;
-
-            assert(ret >= 0);
-            /* fail safe */
-            avio_skip(pb, ret);
-
-            asf->packet_pos = avio_tell(pb);
-            if (asf->data_object_size != (uint64_t)-1 &&
-                (asf->packet_pos - asf->data_object_offset >= asf->data_object_size))
-                return AVERROR_EOF;  /* Do not exceed the size of the data object */
-            return 1;
-        }
-        if (asf->packet_time_start == 0) {
-            if (asf_read_frame_header(s, pb) < 0) {
-                asf->packet_segments = 0;
-                continue;
-            }
-            if (asf->stream_index < 0 ||
-                s->streams[asf->stream_index]->discard >= AVDISCARD_ALL ||
-                (!asf->packet_key_frame &&
-                 s->streams[asf->stream_index]->discard >= AVDISCARD_NONKEY)) {
-                asf->packet_time_start = 0;
-                /* unhandled packet (should not happen) */
-                avio_skip(pb, asf->packet_frag_size);
-                asf->packet_size_left -= asf->packet_frag_size;
-                if (asf->stream_index < 0)
-                    av_log(s, AV_LOG_ERROR, "ff asf skip %d (unknown stream)\n",
-                           asf->packet_frag_size);
-                continue;
-            }
-            asf->asf_st = s->streams[asf->stream_index]->priv_data;
-        }
-        asf_st = asf->asf_st;
-        av_assert0(asf_st);
-
-        if (!asf_st->frag_offset && asf->packet_frag_offset) {
-            av_dlog(s, "skipping asf data pkt with fragment offset for "
-                    "stream:%d, expected:%d but got %d from pkt)\n",
-                    asf->stream_index, asf_st->frag_offset,
-                    asf->packet_frag_offset);
-            avio_skip(pb, asf->packet_frag_size);
-            asf->packet_size_left -= asf->packet_frag_size;
-            continue;
-        }
-
-        if (asf->packet_replic_size == 1) {
-            // frag_offset is here used as the beginning timestamp
-            asf->packet_frag_timestamp = asf->packet_time_start;
-            asf->packet_time_start    += asf->packet_time_delta;
-            asf->packet_obj_size       = asf->packet_frag_size = avio_r8(pb);
-            asf->packet_size_left--;
-            asf->packet_multi_size--;
-            if (asf->packet_multi_size < asf->packet_obj_size) {
-                asf->packet_time_start = 0;
-                avio_skip(pb, asf->packet_multi_size);
-                asf->packet_size_left -= asf->packet_multi_size;
-                continue;
-            }
-            asf->packet_multi_size -= asf->packet_obj_size;
-        }
-        if (asf_st->frag_offset + asf->packet_frag_size <= asf_st->pkt.size &&
-            asf_st->frag_offset + asf->packet_frag_size > asf->packet_obj_size) {
-            av_log(s, AV_LOG_INFO, "ignoring invalid packet_obj_size (%d %d %d %d)\n",
-                   asf_st->frag_offset, asf->packet_frag_size,
-                   asf->packet_obj_size, asf_st->pkt.size);
-            asf->packet_obj_size = asf_st->pkt.size;
-        }
-
-        if (asf_st->pkt.size != asf->packet_obj_size ||
-            // FIXME is this condition sufficient?
-            asf_st->frag_offset + asf->packet_frag_size > asf_st->pkt.size) {
-            if (asf_st->pkt.data) {
-                av_log(s, AV_LOG_INFO,
-                       "freeing incomplete packet size %d, new %d\n",
-                       asf_st->pkt.size, asf->packet_obj_size);
-                asf_st->frag_offset = 0;
-                av_free_packet(&asf_st->pkt);
-            }
-            /* new packet */
-            av_new_packet(&asf_st->pkt, asf->packet_obj_size);
-            asf_st->seq              = asf->packet_seq;
-            asf_st->pkt.dts          = asf->packet_frag_timestamp - asf->hdr.preroll;
-            asf_st->pkt.stream_index = asf->stream_index;
-            asf_st->pkt.pos          = asf_st->packet_pos = asf->packet_pos;
-
-            if (asf_st->pkt.data && asf_st->palette_changed) {
-                uint8_t *pal;
-                pal = av_packet_new_side_data(&asf_st->pkt, AV_PKT_DATA_PALETTE,
-                                              AVPALETTE_SIZE);
-                if (!pal) {
-                    av_log(s, AV_LOG_ERROR, "Cannot append palette to packet\n");
-                } else {
-                    memcpy(pal, asf_st->palette, AVPALETTE_SIZE);
-                    asf_st->palette_changed = 0;
-                }
-            }
-            av_dlog(asf, "new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
-                    asf->stream_index, asf->packet_key_frame,
-                    asf_st->pkt.flags & AV_PKT_FLAG_KEY,
-                    s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO,
-                    asf->packet_obj_size);
-            if (s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-                asf->packet_key_frame = 1;
-            if (asf->packet_key_frame)
-                asf_st->pkt.flags |= AV_PKT_FLAG_KEY;
-        }
-
-        /* read data */
-        av_dlog(asf, "READ PACKET s:%d  os:%d  o:%d,%d  l:%d   DATA:%p\n",
-                s->packet_size, asf_st->pkt.size, asf->packet_frag_offset,
-                asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data);
-        asf->packet_size_left -= asf->packet_frag_size;
-        if (asf->packet_size_left < 0)
-            continue;
-
-        if (asf->packet_frag_offset >= asf_st->pkt.size ||
-            asf->packet_frag_size > asf_st->pkt.size - asf->packet_frag_offset) {
-            av_log(s, AV_LOG_ERROR,
-                   "packet fragment position invalid %u,%u not in %u\n",
-                   asf->packet_frag_offset, asf->packet_frag_size,
-                   asf_st->pkt.size);
-            continue;
-        }
-
-        ret = avio_read(pb, asf_st->pkt.data + asf->packet_frag_offset,
-                        asf->packet_frag_size);
-        if (ret != asf->packet_frag_size) {
-            if (ret < 0 || asf->packet_frag_offset + ret == 0)
-                return ret < 0 ? ret : AVERROR_EOF;
-
-            if (asf_st->ds_span > 1) {
-                // scrambling, we can either drop it completely or fill the remainder
-                // TODO: should we fill the whole packet instead of just the current
-                // fragment?
-                memset(asf_st->pkt.data + asf->packet_frag_offset + ret, 0,
-                       asf->packet_frag_size - ret);
-                ret = asf->packet_frag_size;
-            } else {
-                // no scrambling, so we can return partial packets
-                av_shrink_packet(&asf_st->pkt, asf->packet_frag_offset + ret);
-            }
-        }
-        if (s->key && s->keylen == 20)
-            ff_asfcrypt_dec(s->key, asf_st->pkt.data + asf->packet_frag_offset,
-                            ret);
-        asf_st->frag_offset += ret;
-        /* test if whole packet is read */
-        if (asf_st->frag_offset == asf_st->pkt.size) {
-            // workaround for macroshit radio DVR-MS files
-            if (s->streams[asf->stream_index]->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO &&
-                asf_st->pkt.size > 100) {
-                int i;
-                for (i = 0; i < asf_st->pkt.size && !asf_st->pkt.data[i]; i++)
-                    ;
-                if (i == asf_st->pkt.size) {
-                    av_log(s, AV_LOG_DEBUG, "discarding ms fart\n");
-                    asf_st->frag_offset = 0;
-                    av_free_packet(&asf_st->pkt);
-                    continue;
-                }
-            }
-
-            /* return packet */
-            if (asf_st->ds_span > 1) {
-                if (asf_st->pkt.size != asf_st->ds_packet_size * asf_st->ds_span) {
-                    av_log(s, AV_LOG_ERROR,
-                           "pkt.size != ds_packet_size * ds_span (%d %d %d)\n",
-                           asf_st->pkt.size, asf_st->ds_packet_size,
-                           asf_st->ds_span);
-                } else {
-                    /* packet descrambling */
-                    AVBufferRef *buf = av_buffer_alloc(asf_st->pkt.size +
-                                                       FF_INPUT_BUFFER_PADDING_SIZE);
-                    if (buf) {
-                        uint8_t *newdata = buf->data;
-                        int offset = 0;
-                        memset(newdata + asf_st->pkt.size, 0,
-                               FF_INPUT_BUFFER_PADDING_SIZE);
-                        while (offset < asf_st->pkt.size) {
-                            int off = offset / asf_st->ds_chunk_size;
-                            int row = off / asf_st->ds_span;
-                            int col = off % asf_st->ds_span;
-                            int idx = row + col * asf_st->ds_packet_size / asf_st->ds_chunk_size;
-                            assert(offset + asf_st->ds_chunk_size <= asf_st->pkt.size);
-                            assert(idx + 1 <= asf_st->pkt.size / asf_st->ds_chunk_size);
-                            memcpy(newdata + offset,
-                                   asf_st->pkt.data + idx * asf_st->ds_chunk_size,
-                                   asf_st->ds_chunk_size);
-                            offset += asf_st->ds_chunk_size;
-                        }
-                        av_buffer_unref(&asf_st->pkt.buf);
-                        asf_st->pkt.buf  = buf;
-                        asf_st->pkt.data = buf->data;
-                    }
-                }
-            }
-            asf_st->frag_offset         = 0;
-            *pkt                        = asf_st->pkt;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-            asf_st->pkt.destruct        = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-            asf_st->pkt.buf             = 0;
-            asf_st->pkt.size            = 0;
-            asf_st->pkt.data            = 0;
-            asf_st->pkt.side_data_elems = 0;
-            asf_st->pkt.side_data       = NULL;
-            break; // packet completed
-        }
-    }
-    return 0;
-}
-
-static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    ASFContext *asf = s->priv_data;
-
-    for (;;) {
-        int ret;
-
-        /* parse cached packets, if any */
-        if ((ret = asf_parse_packet(s, s->pb, pkt)) <= 0)
-            return ret;
-        if ((ret = asf_get_packet(s, s->pb)) < 0)
-            assert(asf->packet_size_left < FRAME_HEADER_SIZE ||
-                   asf->packet_segments < 1);
-        asf->packet_time_start = 0;
-    }
-}
-
-// Added to support seeking after packets have been read
-// If information is not reset, read_packet fails due to
-// leftover information from previous reads
-static void asf_reset_header(AVFormatContext *s)
-{
-    ASFContext *asf = s->priv_data;
-    ASFStream *asf_st;
-    int i;
-
-    asf->packet_size_left      = 0;
-    asf->packet_segments       = 0;
-    asf->packet_flags          = 0;
-    asf->packet_property       = 0;
-    asf->packet_timestamp      = 0;
-    asf->packet_segsizetype    = 0;
-    asf->packet_segments       = 0;
-    asf->packet_seq            = 0;
-    asf->packet_replic_size    = 0;
-    asf->packet_key_frame      = 0;
-    asf->packet_padsize        = 0;
-    asf->packet_frag_offset    = 0;
-    asf->packet_frag_size      = 0;
-    asf->packet_frag_timestamp = 0;
-    asf->packet_multi_size     = 0;
-    asf->packet_obj_size       = 0;
-    asf->packet_time_delta     = 0;
-    asf->packet_time_start     = 0;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        asf_st = s->streams[i]->priv_data;
-        if (!asf_st)
-            continue;
-        av_free_packet(&asf_st->pkt);
-        asf_st->frag_offset = 0;
-        asf_st->seq         = 0;
-    }
-    asf->asf_st = NULL;
-}
-
-static int asf_read_close(AVFormatContext *s)
-{
-    asf_reset_header(s);
-
-    return 0;
-}
-
-static int64_t asf_read_pts(AVFormatContext *s, int stream_index,
-                            int64_t *ppos, int64_t pos_limit)
-{
-    AVPacket pkt1, *pkt = &pkt1;
-    ASFStream *asf_st;
-    int64_t pts;
-    int64_t pos = *ppos;
-    int i;
-    int64_t start_pos[ASF_MAX_STREAMS];
-
-    for (i = 0; i < s->nb_streams; i++)
-        start_pos[i] = pos;
-
-    if (s->packet_size > 0)
-        pos = (pos + s->packet_size - 1 - s->data_offset) /
-              s->packet_size * s->packet_size +
-              s->data_offset;
-    *ppos = pos;
-    avio_seek(s->pb, pos, SEEK_SET);
-
-    asf_reset_header(s);
-    for (;;) {
-        if (asf_read_packet(s, pkt) < 0) {
-            av_log(s, AV_LOG_INFO, "asf_read_pts failed\n");
-            return AV_NOPTS_VALUE;
-        }
-
-        pts = pkt->dts;
-
-        av_free_packet(pkt);
-        if (pkt->flags & AV_PKT_FLAG_KEY) {
-            i = pkt->stream_index;
-
-            asf_st = s->streams[i]->priv_data;
-            av_assert0(asf_st);
-
-//            assert((asf_st->packet_pos - s->data_offset) % s->packet_size == 0);
-            pos = asf_st->packet_pos;
-
-            av_add_index_entry(s->streams[i], pos, pts, pkt->size,
-                               pos - start_pos[i] + 1, AVINDEX_KEYFRAME);
-            start_pos[i] = asf_st->packet_pos + 1;
-
-            if (pkt->stream_index == stream_index)
-                break;
-        }
-    }
-
-    *ppos = pos;
-    return pts;
-}
-
-static int asf_build_simple_index(AVFormatContext *s, int stream_index)
-{
-    ff_asf_guid g;
-    ASFContext *asf     = s->priv_data;
-    int64_t current_pos = avio_tell(s->pb);
-    int i, ret = 0;
-
-    avio_seek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET);
-    if ((ret = ff_get_guid(s->pb, &g)) < 0)
-        goto end;
-
-    /* the data object can be followed by other top-level objects,
-     * skip them until the simple index object is reached */
-    while (ff_guidcmp(&g, &index_guid)) {
-        int64_t gsize = avio_rl64(s->pb);
-        if (gsize < 24 || s->pb->eof_reached) {
-            goto end;
-        }
-        avio_skip(s->pb, gsize - 24);
-        if ((ret = ff_get_guid(s->pb, &g)) < 0)
-            goto end;
-    }
-
-    {
-        int64_t itime, last_pos = -1;
-        int pct, ict;
-        int64_t av_unused gsize = avio_rl64(s->pb);
-        if ((ret = ff_get_guid(s->pb, &g)) < 0)
-            goto end;
-        itime = avio_rl64(s->pb);
-        pct   = avio_rl32(s->pb);
-        ict   = avio_rl32(s->pb);
-        av_log(s, AV_LOG_DEBUG,
-               "itime:0x%"PRIx64", pct:%d, ict:%d\n", itime, pct, ict);
-
-        for (i = 0; i < ict; i++) {
-            int pktnum        = avio_rl32(s->pb);
-            int pktct         = avio_rl16(s->pb);
-            int64_t pos       = s->data_offset + s->packet_size * (int64_t)pktnum;
-            int64_t index_pts = FFMAX(av_rescale(itime, i, 10000) - asf->hdr.preroll, 0);
-
-            if (pos != last_pos) {
-                av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d  pts: %"PRId64"\n",
-                       pktnum, pktct, index_pts);
-                av_add_index_entry(s->streams[stream_index], pos, index_pts,
-                                   s->packet_size, 0, AVINDEX_KEYFRAME);
-                last_pos = pos;
-            }
-        }
-        asf->index_read = ict > 0;
-    }
-end:
-    if (s->pb->eof_reached)
-        ret = 0;
-    avio_seek(s->pb, current_pos, SEEK_SET);
-    return ret;
-}
-
-static int asf_read_seek(AVFormatContext *s, int stream_index,
-                         int64_t pts, int flags)
-{
-    ASFContext *asf = s->priv_data;
-    AVStream *st    = s->streams[stream_index];
-    int64_t pos;
-    int index, ret = 0;
-
-    if (s->packet_size <= 0)
-        return -1;
-
-    /* Try using the protocol's read_seek if available */
-    if (s->pb) {
-        int ret = avio_seek_time(s->pb, stream_index, pts, flags);
-        if (ret >= 0)
-            asf_reset_header(s);
-        if (ret != AVERROR(ENOSYS))
-            return ret;
-    }
-
-    /* explicitly handle the case of seeking to 0 */
-    if (!pts) {
-        asf_reset_header(s);
-        avio_seek(s->pb, s->data_offset, SEEK_SET);
-        return 0;
-    }
-
-    if (!asf->index_read)
-        ret = asf_build_simple_index(s, stream_index);
-
-    if (!ret && asf->index_read && st->index_entries) {
-        index = av_index_search_timestamp(st, pts, flags);
-        if (index >= 0) {
-            /* find the position */
-            pos = st->index_entries[index].pos;
-
-            /* do the seek */
-            av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos);
-            avio_seek(s->pb, pos, SEEK_SET);
-            asf_reset_header(s);
-            return 0;
-        }
-    }
-    /* no index or seeking by index failed */
-    if (ff_seek_frame_binary(s, stream_index, pts, flags) < 0)
-        return -1;
-    asf_reset_header(s);
-    return 0;
-}
-
-AVInputFormat ff_asf_demuxer = {
-    .name           = "asf",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
-    .priv_data_size = sizeof(ASFContext),
-    .read_probe     = asf_probe,
-    .read_header    = asf_read_header,
-    .read_packet    = asf_read_packet,
-    .read_close     = asf_read_close,
-    .read_seek      = asf_read_seek,
-    .read_timestamp = asf_read_pts,
-    .flags          = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH,
-    .priv_class     = &asf_class,
-};
diff --git a/deps/libav/libavformat/asfenc.c b/deps/libav/libavformat/asfenc.c
deleted file mode 100644
index e1a7189..0000000
--- a/deps/libav/libavformat/asfenc.c
+++ /dev/null
@@ -1,967 +0,0 @@
-/*
- * ASF muxer
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/dict.h"
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "riff.h"
-#include "asf.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-
-#define ASF_INDEXED_INTERVAL    10000000
-#define ASF_INDEX_BLOCK         600
-
-#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE 0x2
-#define ASF_PACKET_ERROR_CORRECTION_FLAGS          \
-    (ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT |    \
-     ASF_PACKET_ERROR_CORRECTION_DATA_SIZE)
-
-#if (ASF_PACKET_ERROR_CORRECTION_FLAGS != 0)
-#   define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 1
-#else
-#   define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 0
-#endif
-
-#define ASF_PPI_PROPERTY_FLAGS                                       \
-    (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE           |    \
-     ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD |    \
-     ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE       |    \
-     ASF_PL_FLAG_STREAM_NUMBER_LENGTH_FIELD_IS_BYTE)
-
-#define ASF_PPI_LENGTH_TYPE_FLAGS 0
-
-#define ASF_PAYLOAD_FLAGS ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD
-
-#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
-#   define ASF_PPI_SEQUENCE_FIELD_SIZE 1
-#endif
-#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
-#   define ASF_PPI_SEQUENCE_FIELD_SIZE 2
-#endif
-#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
-#   define ASF_PPI_SEQUENCE_FIELD_SIZE 4
-#endif
-#ifndef ASF_PPI_SEQUENCE_FIELD_SIZE
-#   define ASF_PPI_SEQUENCE_FIELD_SIZE 0
-#endif
-
-#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 1
-#endif
-#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 2
-#endif
-#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 4
-#endif
-#ifndef ASF_PPI_PACKET_LENGTH_FIELD_SIZE
-#   define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 0
-#endif
-
-#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 1
-#endif
-#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 2
-#endif
-#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
-#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 4
-#endif
-#ifndef ASF_PPI_PADDING_LENGTH_FIELD_SIZE
-#   define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 0
-#endif
-
-#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 1
-#endif
-#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 2
-#endif
-#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 4
-#endif
-#ifndef ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE
-#   define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 0
-#endif
-
-#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 1
-#endif
-#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 2
-#endif
-#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 4
-#endif
-#ifndef ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE
-#   define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 0
-#endif
-
-#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 1
-#endif
-#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 2
-#endif
-#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 4
-#endif
-#ifndef ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE
-#   define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 0
-#endif
-
-#if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_BYTE == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_LENGTH_FIELD_SIZE 1
-#endif
-#if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
-#   define ASF_PAYLOAD_LENGTH_FIELD_SIZE 2
-#endif
-#ifndef ASF_PAYLOAD_LENGTH_FIELD_SIZE
-#   define ASF_PAYLOAD_LENGTH_FIELD_SIZE 0
-#endif
-
-#define PACKET_HEADER_MIN_SIZE \
-    (ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE +       \
-     ASF_PACKET_ERROR_CORRECTION_DATA_SIZE +              \
-     1 +        /* Length Type Flags */                   \
-     1 +        /* Property Flags */                      \
-     ASF_PPI_PACKET_LENGTH_FIELD_SIZE +                   \
-     ASF_PPI_SEQUENCE_FIELD_SIZE +                        \
-     ASF_PPI_PADDING_LENGTH_FIELD_SIZE +                  \
-     4 +        /* Send Time Field */                     \
-     2)         /* Duration Field */
-
-// Replicated Data shall be at least 8 bytes long.
-#define ASF_PAYLOAD_REPLICATED_DATA_LENGTH 0x08
-
-#define PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD                \
-    (1 +     /* Stream Number */                          \
-     ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE +         \
-     ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE +    \
-     ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE +      \
-     ASF_PAYLOAD_REPLICATED_DATA_LENGTH)
-
-#define PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS             \
-    (1 +        /* Stream Number */                       \
-     ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE +         \
-     ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE +    \
-     ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE +      \
-     ASF_PAYLOAD_REPLICATED_DATA_LENGTH +                 \
-     ASF_PAYLOAD_LENGTH_FIELD_SIZE)
-
-#define SINGLE_PAYLOAD_DATA_LENGTH                        \
-    (PACKET_SIZE -                                        \
-     PACKET_HEADER_MIN_SIZE -                             \
-     PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD)
-
-#define MULTI_PAYLOAD_CONSTANT                            \
-    (PACKET_SIZE -                                        \
-     PACKET_HEADER_MIN_SIZE -                             \
-     1 -         /* Payload Flags */                      \
-     2 * PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS)
-
-#define DATA_HEADER_SIZE 50
-
-typedef struct {
-    uint32_t seqno;
-    int is_streamed;
-    ASFStream streams[128];              ///< it's max number and it's not that big
-    /* non streamed additonnal info */
-    uint64_t nb_packets;                 ///< how many packets are there in the file, invalid if broadcasting
-    int64_t duration;                    ///< in 100ns units
-    /* packet filling */
-    unsigned char multi_payloads_present;
-    int packet_size_left;
-    int packet_timestamp_start;
-    int packet_timestamp_end;
-    unsigned int packet_nb_payloads;
-    uint8_t packet_buf[PACKET_SIZE];
-    AVIOContext pb;
-    /* only for reading */
-    uint64_t data_offset;                ///< beginning of the first data packet
-
-    int64_t last_indexed_pts;
-    ASFIndex *index_ptr;
-    uint32_t nb_index_count;
-    uint32_t nb_index_memory_alloc;
-    uint16_t maximum_packet;
-} ASFContext;
-
-static const AVCodecTag codec_asf_bmp_tags[] = {
-    { AV_CODEC_ID_MPEG4,     MKTAG('M', 'P', '4', 'S') },
-    { AV_CODEC_ID_MPEG4,     MKTAG('M', '4', 'S', '2') },
-    { AV_CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', '4', '3') },
-    { AV_CODEC_ID_NONE,      0 },
-};
-
-#define PREROLL_TIME 3100
-
-static void put_guid(AVIOContext *s, const ff_asf_guid *g)
-{
-    assert(sizeof(*g) == 16);
-    avio_write(s, *g, sizeof(*g));
-}
-
-static void put_str16(AVIOContext *s, const char *tag)
-{
-    int len;
-    uint8_t *pb;
-    AVIOContext *dyn_buf;
-    if (avio_open_dyn_buf(&dyn_buf) < 0)
-        return;
-
-    avio_put_str16le(dyn_buf, tag);
-    len = avio_close_dyn_buf(dyn_buf, &pb);
-    avio_wl16(s, len);
-    avio_write(s, pb, len);
-    av_freep(&pb);
-}
-
-static int64_t put_header(AVIOContext *pb, const ff_asf_guid *g)
-{
-    int64_t pos;
-
-    pos = avio_tell(pb);
-    put_guid(pb, g);
-    avio_wl64(pb, 24);
-    return pos;
-}
-
-/* update header size */
-static void end_header(AVIOContext *pb, int64_t pos)
-{
-    int64_t pos1;
-
-    pos1 = avio_tell(pb);
-    avio_seek(pb, pos + 16, SEEK_SET);
-    avio_wl64(pb, pos1 - pos);
-    avio_seek(pb, pos1, SEEK_SET);
-}
-
-/* write an asf chunk (only used in streaming case) */
-static void put_chunk(AVFormatContext *s, int type,
-                      int payload_length, int flags)
-{
-    ASFContext *asf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int length;
-
-    length = payload_length + 8;
-    avio_wl16(pb, type);
-    avio_wl16(pb, length);      // size
-    avio_wl32(pb, asf->seqno);  // sequence number
-    avio_wl16(pb, flags);       // unknown bytes
-    avio_wl16(pb, length);      // size_confirm
-    asf->seqno++;
-}
-
-/* convert from unix to windows time */
-static int64_t unix_to_file_time(int ti)
-{
-    int64_t t;
-
-    t  = ti * INT64_C(10000000);
-    t += INT64_C(116444736000000000);
-    return t;
-}
-
-static int32_t get_send_time(ASFContext *asf, int64_t pres_time, uint64_t *offset)
-{
-    int i;
-    int32_t send_time = 0;
-    *offset = asf->data_offset + DATA_HEADER_SIZE;
-    for (i = 0; i < asf->nb_index_count; i++) {
-        if (pres_time <= asf->index_ptr[i].send_time)
-            break;
-        send_time = asf->index_ptr[i].send_time;
-        *offset   = asf->index_ptr[i].offset;
-    }
-
-    return send_time / 10000;
-}
-
-static int asf_write_markers(AVFormatContext *s)
-{
-    ASFContext *asf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int i;
-    AVRational scale = {1, 10000000};
-    int64_t hpos = put_header(pb, &ff_asf_marker_header);
-
-    put_guid(pb, &ff_asf_reserved_4);  // ASF spec mandates this reserved value
-    avio_wl32(pb, s->nb_chapters);     // markers count
-    avio_wl16(pb, 0);                  // ASF spec mandates 0 for this
-    avio_wl16(pb, 0);                  // name length 0, no name given
-
-    for (i = 0; i < s->nb_chapters; i++) {
-        AVChapter *c = s->chapters[i];
-        AVDictionaryEntry *t = av_dict_get(c->metadata, "title", NULL, 0);
-        int64_t pres_time = av_rescale_q(c->start, c->time_base, scale);
-        uint64_t offset;
-        int32_t send_time = get_send_time(asf, pres_time, &offset);
-        int len = 0;
-        uint8_t *buf;
-        AVIOContext *dyn_buf;
-        if (t) {
-            if (avio_open_dyn_buf(&dyn_buf) < 0)
-                return AVERROR(ENOMEM);
-            avio_put_str16le(dyn_buf, t->value);
-            len = avio_close_dyn_buf(dyn_buf, &buf);
-        }
-        avio_wl64(pb, offset);            // offset of the packet with send_time
-        avio_wl64(pb, pres_time + PREROLL_TIME * 10000); // presentation time
-        avio_wl16(pb, 12 + len);          // entry length
-        avio_wl32(pb, send_time);         // send time
-        avio_wl32(pb, 0);                 // flags, should be 0
-        avio_wl32(pb, len / 2);           // marker desc length in WCHARS!
-        if (t) {
-            avio_write(pb, buf, len);     // marker desc
-            av_freep(&buf);
-        }
-    }
-    end_header(pb, hpos);
-    return 0;
-}
-
-/* write the header (used two times if non streamed) */
-static int asf_write_header1(AVFormatContext *s, int64_t file_size,
-                             int64_t data_chunk_size)
-{
-    ASFContext *asf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVDictionaryEntry *tags[5];
-    int header_size, n, extra_size, extra_size2, wav_extra_size, file_time;
-    int has_title;
-    int metadata_count;
-    AVCodecContext *enc;
-    int64_t header_offset, cur_pos, hpos;
-    int bit_rate;
-    int64_t duration;
-
-    ff_metadata_conv(&s->metadata, ff_asf_metadata_conv, NULL);
-
-    tags[0] = av_dict_get(s->metadata, "title", NULL, 0);
-    tags[1] = av_dict_get(s->metadata, "author", NULL, 0);
-    tags[2] = av_dict_get(s->metadata, "copyright", NULL, 0);
-    tags[3] = av_dict_get(s->metadata, "comment", NULL, 0);
-    tags[4] = av_dict_get(s->metadata, "rating", NULL, 0);
-
-    duration       = asf->duration + PREROLL_TIME * 10000;
-    has_title      = tags[0] || tags[1] || tags[2] || tags[3] || tags[4];
-    metadata_count = av_dict_count(s->metadata);
-
-    bit_rate = 0;
-    for (n = 0; n < s->nb_streams; n++) {
-        enc = s->streams[n]->codec;
-
-        avpriv_set_pts_info(s->streams[n], 32, 1, 1000); /* 32 bit pts in ms */
-
-        bit_rate += enc->bit_rate;
-    }
-
-    if (asf->is_streamed) {
-        put_chunk(s, 0x4824, 0, 0xc00); /* start of stream (length will be patched later) */
-    }
-
-    put_guid(pb, &ff_asf_header);
-    avio_wl64(pb, -1); /* header length, will be patched after */
-    avio_wl32(pb, 3 + has_title + !!metadata_count + s->nb_streams); /* number of chunks in header */
-    avio_w8(pb, 1); /* ??? */
-    avio_w8(pb, 2); /* ??? */
-
-    /* file header */
-    header_offset = avio_tell(pb);
-    hpos          = put_header(pb, &ff_asf_file_header);
-    put_guid(pb, &ff_asf_my_guid);
-    avio_wl64(pb, file_size);
-    file_time = 0;
-    avio_wl64(pb, unix_to_file_time(file_time));
-    avio_wl64(pb, asf->nb_packets); /* number of packets */
-    avio_wl64(pb, duration); /* end time stamp (in 100ns units) */
-    avio_wl64(pb, asf->duration); /* duration (in 100ns units) */
-    avio_wl64(pb, PREROLL_TIME); /* start time stamp */
-    avio_wl32(pb, (asf->is_streamed || !pb->seekable) ? 3 : 2);  /* ??? */
-    avio_wl32(pb, s->packet_size); /* packet size */
-    avio_wl32(pb, s->packet_size); /* packet size */
-    avio_wl32(pb, bit_rate); /* Nominal data rate in bps */
-    end_header(pb, hpos);
-
-    /* unknown headers */
-    hpos = put_header(pb, &ff_asf_head1_guid);
-    put_guid(pb, &ff_asf_head2_guid);
-    avio_wl32(pb, 6);
-    avio_wl16(pb, 0);
-    end_header(pb, hpos);
-
-    /* title and other infos */
-    if (has_title) {
-        int len;
-        uint8_t *buf;
-        AVIOContext *dyn_buf;
-
-        if (avio_open_dyn_buf(&dyn_buf) < 0)
-            return AVERROR(ENOMEM);
-
-        hpos = put_header(pb, &ff_asf_comment_header);
-
-        for (n = 0; n < FF_ARRAY_ELEMS(tags); n++) {
-            len = tags[n] ? avio_put_str16le(dyn_buf, tags[n]->value) : 0;
-            avio_wl16(pb, len);
-        }
-        len = avio_close_dyn_buf(dyn_buf, &buf);
-        avio_write(pb, buf, len);
-        av_freep(&buf);
-        end_header(pb, hpos);
-    }
-    if (metadata_count) {
-        AVDictionaryEntry *tag = NULL;
-        hpos = put_header(pb, &ff_asf_extended_content_header);
-        avio_wl16(pb, metadata_count);
-        while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
-            put_str16(pb, tag->key);
-            avio_wl16(pb, 0);
-            put_str16(pb, tag->value);
-        }
-        end_header(pb, hpos);
-    }
-    /* chapters using ASF markers */
-    if (!asf->is_streamed && s->nb_chapters) {
-        int ret;
-        if (ret = asf_write_markers(s))
-            return ret;
-    }
-    /* stream headers */
-    for (n = 0; n < s->nb_streams; n++) {
-        int64_t es_pos;
-        //        ASFStream *stream = &asf->streams[n];
-
-        enc                 = s->streams[n]->codec;
-        asf->streams[n].num = n + 1;
-        asf->streams[n].seq = 0;
-
-        switch (enc->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            wav_extra_size = 0;
-            extra_size     = 18 + wav_extra_size;
-            extra_size2    = 8;
-            break;
-        default:
-        case AVMEDIA_TYPE_VIDEO:
-            wav_extra_size = enc->extradata_size;
-            extra_size     = 0x33 + wav_extra_size;
-            extra_size2    = 0;
-            break;
-        }
-
-        hpos = put_header(pb, &ff_asf_stream_header);
-        if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-            put_guid(pb, &ff_asf_audio_stream);
-            put_guid(pb, &ff_asf_audio_conceal_spread);
-        } else {
-            put_guid(pb, &ff_asf_video_stream);
-            put_guid(pb, &ff_asf_video_conceal_none);
-        }
-        avio_wl64(pb, 0); /* ??? */
-        es_pos = avio_tell(pb);
-        avio_wl32(pb, extra_size); /* wav header len */
-        avio_wl32(pb, extra_size2); /* additional data len */
-        avio_wl16(pb, n + 1); /* stream number */
-        avio_wl32(pb, 0); /* ??? */
-
-        if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-            /* WAVEFORMATEX header */
-            int wavsize = ff_put_wav_header(pb, enc);
-
-            if (wavsize < 0)
-                return -1;
-            if (wavsize != extra_size) {
-                cur_pos = avio_tell(pb);
-                avio_seek(pb, es_pos, SEEK_SET);
-                avio_wl32(pb, wavsize); /* wav header len */
-                avio_seek(pb, cur_pos, SEEK_SET);
-            }
-            /* ERROR Correction */
-            avio_w8(pb, 0x01);
-            if (enc->codec_id == AV_CODEC_ID_ADPCM_G726 || !enc->block_align) {
-                avio_wl16(pb, 0x0190);
-                avio_wl16(pb, 0x0190);
-            } else {
-                avio_wl16(pb, enc->block_align);
-                avio_wl16(pb, enc->block_align);
-            }
-            avio_wl16(pb, 0x01);
-            avio_w8(pb, 0x00);
-        } else {
-            avio_wl32(pb, enc->width);
-            avio_wl32(pb, enc->height);
-            avio_w8(pb, 2); /* ??? */
-            avio_wl16(pb, 40 + enc->extradata_size); /* size */
-
-            /* BITMAPINFOHEADER header */
-            ff_put_bmp_header(pb, enc, ff_codec_bmp_tags, 1);
-        }
-        end_header(pb, hpos);
-    }
-
-    /* media comments */
-
-    hpos = put_header(pb, &ff_asf_codec_comment_header);
-    put_guid(pb, &ff_asf_codec_comment1_header);
-    avio_wl32(pb, s->nb_streams);
-    for (n = 0; n < s->nb_streams; n++) {
-        AVCodec *p;
-        const char *desc;
-        int len;
-        uint8_t *buf;
-        AVIOContext *dyn_buf;
-
-        enc = s->streams[n]->codec;
-        p   = avcodec_find_encoder(enc->codec_id);
-
-        if (enc->codec_type == AVMEDIA_TYPE_AUDIO)
-            avio_wl16(pb, 2);
-        else if (enc->codec_type == AVMEDIA_TYPE_VIDEO)
-            avio_wl16(pb, 1);
-        else
-            avio_wl16(pb, -1);
-
-        if (enc->codec_id == AV_CODEC_ID_WMAV2)
-            desc = "Windows Media Audio V8";
-        else
-            desc = p ? p->name : enc->codec_name;
-
-        if (avio_open_dyn_buf(&dyn_buf) < 0)
-            return AVERROR(ENOMEM);
-
-        avio_put_str16le(dyn_buf, desc);
-        len = avio_close_dyn_buf(dyn_buf, &buf);
-        avio_wl16(pb, len / 2); // "number of characters" = length in bytes / 2
-
-        avio_write(pb, buf, len);
-        av_freep(&buf);
-
-        avio_wl16(pb, 0); /* no parameters */
-
-        /* id */
-        if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-            avio_wl16(pb, 2);
-            avio_wl16(pb, enc->codec_tag);
-        } else {
-            avio_wl16(pb, 4);
-            avio_wl32(pb, enc->codec_tag);
-        }
-        if (!enc->codec_tag)
-            return -1;
-    }
-    end_header(pb, hpos);
-
-    /* patch the header size fields */
-
-    cur_pos     = avio_tell(pb);
-    header_size = cur_pos - header_offset;
-    if (asf->is_streamed) {
-        header_size += 8 + 30 + DATA_HEADER_SIZE;
-
-        avio_seek(pb, header_offset - 10 - 30, SEEK_SET);
-        avio_wl16(pb, header_size);
-        avio_seek(pb, header_offset - 2 - 30, SEEK_SET);
-        avio_wl16(pb, header_size);
-
-        header_size -= 8 + 30 + DATA_HEADER_SIZE;
-    }
-    header_size += 24 + 6;
-    avio_seek(pb, header_offset - 14, SEEK_SET);
-    avio_wl64(pb, header_size);
-    avio_seek(pb, cur_pos, SEEK_SET);
-
-    /* movie chunk, followed by packets of packet_size */
-    asf->data_offset = cur_pos;
-    put_guid(pb, &ff_asf_data_header);
-    avio_wl64(pb, data_chunk_size);
-    put_guid(pb, &ff_asf_my_guid);
-    avio_wl64(pb, asf->nb_packets); /* nb packets */
-    avio_w8(pb, 1); /* ??? */
-    avio_w8(pb, 1); /* ??? */
-    return 0;
-}
-
-static int asf_write_header(AVFormatContext *s)
-{
-    ASFContext *asf = s->priv_data;
-
-    s->packet_size  = PACKET_SIZE;
-    asf->nb_packets = 0;
-
-    asf->last_indexed_pts      = 0;
-    asf->index_ptr             = av_malloc(sizeof(ASFIndex) * ASF_INDEX_BLOCK);
-    asf->nb_index_memory_alloc = ASF_INDEX_BLOCK;
-    asf->nb_index_count        = 0;
-    asf->maximum_packet        = 0;
-
-    /* the data-chunk-size has to be 50 (DATA_HEADER_SIZE), which is
-     * data_size - asf->data_offset at the moment this function is done.
-     * It is needed to use asf as a streamable format. */
-    if (asf_write_header1(s, 0, DATA_HEADER_SIZE) < 0) {
-        //av_free(asf);
-        return -1;
-    }
-
-    avio_flush(s->pb);
-
-    asf->packet_nb_payloads     = 0;
-    asf->packet_timestamp_start = -1;
-    asf->packet_timestamp_end   = -1;
-    ffio_init_context(&asf->pb, asf->packet_buf, s->packet_size, 1,
-                      NULL, NULL, NULL, NULL);
-
-    return 0;
-}
-
-static int asf_write_stream_header(AVFormatContext *s)
-{
-    ASFContext *asf = s->priv_data;
-
-    asf->is_streamed = 1;
-
-    return asf_write_header(s);
-}
-
-static int put_payload_parsing_info(AVFormatContext *s,
-                                    unsigned sendtime, unsigned duration,
-                                    int nb_payloads, int padsize)
-{
-    ASFContext *asf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ppi_size, i;
-    int64_t start = avio_tell(pb);
-
-    int iLengthTypeFlags = ASF_PPI_LENGTH_TYPE_FLAGS;
-
-    padsize -= PACKET_HEADER_MIN_SIZE;
-    if (asf->multi_payloads_present)
-        padsize--;
-    assert(padsize >= 0);
-
-    avio_w8(pb, ASF_PACKET_ERROR_CORRECTION_FLAGS);
-    for (i = 0; i < ASF_PACKET_ERROR_CORRECTION_DATA_SIZE; i++)
-        avio_w8(pb, 0x0);
-
-    if (asf->multi_payloads_present)
-        iLengthTypeFlags |= ASF_PPI_FLAG_MULTIPLE_PAYLOADS_PRESENT;
-
-    if (padsize > 0) {
-        if (padsize < 256)
-            iLengthTypeFlags |= ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE;
-        else
-            iLengthTypeFlags |= ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD;
-    }
-    avio_w8(pb, iLengthTypeFlags);
-
-    avio_w8(pb, ASF_PPI_PROPERTY_FLAGS);
-
-    if (iLengthTypeFlags & ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD)
-        avio_wl16(pb, padsize - 2);
-    if (iLengthTypeFlags & ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE)
-        avio_w8(pb, padsize - 1);
-
-    avio_wl32(pb, sendtime);
-    avio_wl16(pb, duration);
-    if (asf->multi_payloads_present)
-        avio_w8(pb, nb_payloads | ASF_PAYLOAD_FLAGS);
-
-    ppi_size = avio_tell(pb) - start;
-
-    return ppi_size;
-}
-
-static void flush_packet(AVFormatContext *s)
-{
-    ASFContext *asf = s->priv_data;
-    int packet_hdr_size, packet_filled_size;
-
-    assert(asf->packet_timestamp_end >= asf->packet_timestamp_start);
-
-    if (asf->is_streamed)
-        put_chunk(s, 0x4424, s->packet_size, 0);
-
-    packet_hdr_size = put_payload_parsing_info(s,
-                                               asf->packet_timestamp_start,
-                                               asf->packet_timestamp_end -
-                                               asf->packet_timestamp_start,
-                                               asf->packet_nb_payloads,
-                                               asf->packet_size_left);
-
-    packet_filled_size = PACKET_SIZE - asf->packet_size_left;
-    assert(packet_hdr_size <= asf->packet_size_left);
-    memset(asf->packet_buf + packet_filled_size, 0, asf->packet_size_left);
-
-    avio_write(s->pb, asf->packet_buf, s->packet_size - packet_hdr_size);
-
-    avio_flush(s->pb);
-    asf->nb_packets++;
-    asf->packet_nb_payloads     = 0;
-    asf->packet_timestamp_start = -1;
-    asf->packet_timestamp_end   = -1;
-    ffio_init_context(&asf->pb, asf->packet_buf, s->packet_size, 1,
-                      NULL, NULL, NULL, NULL);
-}
-
-static void put_payload_header(AVFormatContext *s, ASFStream *stream,
-                               int presentation_time, int m_obj_size,
-                               int m_obj_offset, int payload_len, int flags)
-{
-    ASFContext *asf = s->priv_data;
-    AVIOContext *pb = &asf->pb;
-    int val;
-
-    val = stream->num;
-    if (flags & AV_PKT_FLAG_KEY)
-        val |= ASF_PL_FLAG_KEY_FRAME;
-    avio_w8(pb, val);
-
-    avio_w8(pb, stream->seq);     // Media object number
-    avio_wl32(pb, m_obj_offset);  // Offset Into Media Object
-
-    // Replicated Data shall be at least 8 bytes long.
-    // The first 4 bytes of data shall contain the
-    // Size of the Media Object that the payload belongs to.
-    // The next 4 bytes of data shall contain the
-    // Presentation Time for the media object that the payload belongs to.
-    avio_w8(pb, ASF_PAYLOAD_REPLICATED_DATA_LENGTH);
-
-    avio_wl32(pb, m_obj_size);        // Replicated Data - Media Object Size
-    avio_wl32(pb, presentation_time); // Replicated Data - Presentation Time
-
-    if (asf->multi_payloads_present) {
-        avio_wl16(pb, payload_len);   // payload length
-    }
-}
-
-static void put_frame(AVFormatContext *s, ASFStream *stream, AVStream *avst,
-                      int timestamp, const uint8_t *buf,
-                      int m_obj_size, int flags)
-{
-    ASFContext *asf = s->priv_data;
-    int m_obj_offset, payload_len, frag_len1;
-
-    m_obj_offset = 0;
-    while (m_obj_offset < m_obj_size) {
-        payload_len = m_obj_size - m_obj_offset;
-        if (asf->packet_timestamp_start == -1) {
-            asf->multi_payloads_present = (payload_len < MULTI_PAYLOAD_CONSTANT);
-
-            asf->packet_size_left = PACKET_SIZE;
-            if (asf->multi_payloads_present) {
-                frag_len1 = MULTI_PAYLOAD_CONSTANT - 1;
-            } else {
-                frag_len1 = SINGLE_PAYLOAD_DATA_LENGTH;
-            }
-            asf->packet_timestamp_start = timestamp;
-        } else {
-            // multi payloads
-            frag_len1 = asf->packet_size_left -
-                        PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS -
-                        PACKET_HEADER_MIN_SIZE - 1;
-
-            if (frag_len1 < payload_len &&
-                avst->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-                flush_packet(s);
-                continue;
-            }
-        }
-        if (frag_len1 > 0) {
-            if (payload_len > frag_len1)
-                payload_len = frag_len1;
-            else if (payload_len == (frag_len1 - 1))
-                payload_len = frag_len1 - 2;  // additional byte need to put padding length
-
-            put_payload_header(s, stream, timestamp + PREROLL_TIME,
-                               m_obj_size, m_obj_offset, payload_len, flags);
-            avio_write(&asf->pb, buf, payload_len);
-
-            if (asf->multi_payloads_present)
-                asf->packet_size_left -= (payload_len + PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS);
-            else
-                asf->packet_size_left -= (payload_len + PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD);
-            asf->packet_timestamp_end = timestamp;
-
-            asf->packet_nb_payloads++;
-        } else {
-            payload_len = 0;
-        }
-        m_obj_offset += payload_len;
-        buf          += payload_len;
-
-        if (!asf->multi_payloads_present)
-            flush_packet(s);
-        else if (asf->packet_size_left <= (PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS + PACKET_HEADER_MIN_SIZE + 1))
-            flush_packet(s);
-    }
-    stream->seq++;
-}
-
-static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    ASFContext *asf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    ASFStream *stream;
-    int64_t duration;
-    AVCodecContext *codec;
-    int64_t packet_st, pts;
-    int start_sec, i;
-    int flags = pkt->flags;
-    uint64_t offset = avio_tell(pb);
-
-    codec  = s->streams[pkt->stream_index]->codec;
-    stream = &asf->streams[pkt->stream_index];
-
-    if (codec->codec_type == AVMEDIA_TYPE_AUDIO)
-        flags &= ~AV_PKT_FLAG_KEY;
-
-    pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts;
-    assert(pts != AV_NOPTS_VALUE);
-    duration      = pts * 10000;
-    asf->duration = FFMAX(asf->duration, duration + pkt->duration * 10000);
-
-    packet_st = asf->nb_packets;
-    put_frame(s, stream, s->streams[pkt->stream_index],
-              pkt->dts, pkt->data, pkt->size, flags);
-
-    /* check index */
-    if ((!asf->is_streamed) && (flags & AV_PKT_FLAG_KEY)) {
-        start_sec = (int)(duration / INT64_C(10000000));
-        if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) {
-            for (i = asf->nb_index_count; i < start_sec; i++) {
-                if (i >= asf->nb_index_memory_alloc) {
-                    int err;
-                    asf->nb_index_memory_alloc += ASF_INDEX_BLOCK;
-                    if ((err = av_reallocp_array(&asf->index_ptr,
-                                                asf->nb_index_memory_alloc,
-                                                sizeof(*asf->index_ptr))) < 0) {
-                       asf->nb_index_memory_alloc = 0;
-                       return err;
-                   }
-                }
-                // store
-                asf->index_ptr[i].packet_number = (uint32_t)packet_st;
-                asf->index_ptr[i].packet_count  = (uint16_t)(asf->nb_packets - packet_st);
-                asf->index_ptr[i].send_time     = start_sec * INT64_C(10000000);
-                asf->index_ptr[i].offset        = offset;
-                asf->maximum_packet             = FFMAX(asf->maximum_packet,
-                                                        (uint16_t)(asf->nb_packets - packet_st));
-            }
-            asf->nb_index_count   = start_sec;
-            asf->last_indexed_pts = duration;
-        }
-    }
-    return 0;
-}
-
-static int asf_write_index(AVFormatContext *s, ASFIndex *index,
-                           uint16_t max, uint32_t count)
-{
-    AVIOContext *pb = s->pb;
-    int i;
-
-    put_guid(pb, &ff_asf_simple_index_header);
-    avio_wl64(pb, 24 + 16 + 8 + 4 + 4 + (4 + 2) * count);
-    put_guid(pb, &ff_asf_my_guid);
-    avio_wl64(pb, ASF_INDEXED_INTERVAL);
-    avio_wl32(pb, max);
-    avio_wl32(pb, count);
-    for (i = 0; i < count; i++) {
-        avio_wl32(pb, index[i].packet_number);
-        avio_wl16(pb, index[i].packet_count);
-    }
-
-    return 0;
-}
-
-static int asf_write_trailer(AVFormatContext *s)
-{
-    ASFContext *asf = s->priv_data;
-    int64_t file_size, data_size;
-
-    /* flush the current packet */
-    if (asf->pb.buf_ptr > asf->pb.buffer)
-        flush_packet(s);
-
-    /* write index */
-    data_size = avio_tell(s->pb);
-    if ((!asf->is_streamed) && (asf->nb_index_count != 0))
-        asf_write_index(s, asf->index_ptr, asf->maximum_packet, asf->nb_index_count);
-    avio_flush(s->pb);
-
-    if (asf->is_streamed || !s->pb->seekable) {
-        put_chunk(s, 0x4524, 0, 0); /* end of stream */
-    } else {
-        /* rewrite an updated header */
-        file_size = avio_tell(s->pb);
-        avio_seek(s->pb, 0, SEEK_SET);
-        asf_write_header1(s, file_size, data_size - asf->data_offset);
-    }
-
-    av_free(asf->index_ptr);
-    return 0;
-}
-
-#if CONFIG_ASF_MUXER
-AVOutputFormat ff_asf_muxer = {
-    .name           = "asf",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
-    .mime_type      = "video/x-ms-asf",
-    .extensions     = "asf,wmv,wma",
-    .priv_data_size = sizeof(ASFContext),
-    .audio_codec    = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_MP2,
-    .video_codec    = AV_CODEC_ID_MSMPEG4V3,
-    .write_header   = asf_write_header,
-    .write_packet   = asf_write_packet,
-    .write_trailer  = asf_write_trailer,
-    .flags          = AVFMT_GLOBALHEADER,
-    .codec_tag      = (const AVCodecTag * const []) {
-        codec_asf_bmp_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0
-    },
-};
-#endif /* CONFIG_ASF_MUXER */
-
-#if CONFIG_ASF_STREAM_MUXER
-AVOutputFormat ff_asf_stream_muxer = {
-    .name           = "asf_stream",
-    .long_name      = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
-    .mime_type      = "video/x-ms-asf",
-    .extensions     = "asf,wmv,wma",
-    .priv_data_size = sizeof(ASFContext),
-    .audio_codec    = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_MP2,
-    .video_codec    = AV_CODEC_ID_MSMPEG4V3,
-    .write_header   = asf_write_stream_header,
-    .write_packet   = asf_write_packet,
-    .write_trailer  = asf_write_trailer,
-    .flags          = AVFMT_GLOBALHEADER,
-    .codec_tag      = (const AVCodecTag * const []) {
-        codec_asf_bmp_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0
-    },
-};
-#endif /* CONFIG_ASF_STREAM_MUXER */
diff --git a/deps/libav/libavformat/assdec.c b/deps/libav/libavformat/assdec.c
deleted file mode 100644
index b994cc1..0000000
--- a/deps/libav/libavformat/assdec.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * SSA/ASS demuxer
- * Copyright (c) 2008 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define MAX_LINESIZE 2000
-
-typedef struct ASSContext{
-    uint8_t *event_buffer;
-    uint8_t **event;
-    unsigned int event_count;
-    unsigned int event_index;
-}ASSContext;
-
-static int probe(AVProbeData *p)
-{
-    const char *header= "[Script Info]";
-
-    if(   !memcmp(p->buf  , header, strlen(header))
-       || !memcmp(p->buf+3, header, strlen(header)))
-        return AVPROBE_SCORE_MAX;
-
-    return 0;
-}
-
-static int read_close(AVFormatContext *s)
-{
-    ASSContext *ass = s->priv_data;
-
-    av_freep(&ass->event_buffer);
-    av_freep(&ass->event);
-
-    return 0;
-}
-
-static int64_t get_pts(const uint8_t *p)
-{
-    int hour, min, sec, hsec;
-
-    if(sscanf(p, "%*[^,],%d:%d:%d%*c%d", &hour, &min, &sec, &hsec) != 4)
-        return AV_NOPTS_VALUE;
-
-    av_dlog(NULL, "%d %d %d %d [%s]\n", hour, min, sec, hsec, p);
-
-    min+= 60*hour;
-    sec+= 60*min;
-
-    return sec*100+hsec;
-}
-
-static int event_cmp(const void *_a, const void *_b)
-{
-    const uint8_t *const *a = _a, *const *b = _b;
-    return get_pts(*a) - get_pts(*b);
-}
-
-static int read_header(AVFormatContext *s)
-{
-    int i, len, header_remaining;
-    ASSContext *ass = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    int allocated[2]={0};
-    uint8_t *p, **dst[2]={0};
-    int pos[2]={0};
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return -1;
-    avpriv_set_pts_info(st, 64, 1, 100);
-    st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-    st->codec->codec_id= AV_CODEC_ID_SSA;
-
-    header_remaining= INT_MAX;
-    dst[0] = &st->codec->extradata;
-    dst[1] = &ass->event_buffer;
-    while(!pb->eof_reached){
-        uint8_t line[MAX_LINESIZE];
-
-        len = ff_get_line(pb, line, sizeof(line));
-
-        if(!memcmp(line, "[Events]", 8))
-            header_remaining= 2;
-        else if(line[0]=='[')
-            header_remaining= INT_MAX;
-
-        i= header_remaining==0;
-
-        if(i && get_pts(line) == AV_NOPTS_VALUE)
-            continue;
-
-        p = av_fast_realloc(*(dst[i]), &allocated[i], pos[i]+MAX_LINESIZE);
-        if(!p)
-            goto fail;
-        *(dst[i])= p;
-        memcpy(p + pos[i], line, len+1);
-        pos[i] += len;
-        if(i) ass->event_count++;
-        else  header_remaining--;
-    }
-    st->codec->extradata_size= pos[0];
-
-    if(ass->event_count >= UINT_MAX / sizeof(*ass->event))
-        goto fail;
-
-    ass->event= av_malloc(ass->event_count * sizeof(*ass->event));
-    p= ass->event_buffer;
-    for(i=0; i<ass->event_count; i++){
-        ass->event[i]= p;
-        while(*p && *p != '\n')
-            p++;
-        p++;
-    }
-
-    qsort(ass->event, ass->event_count, sizeof(*ass->event), event_cmp);
-
-    return 0;
-
-fail:
-    read_close(s);
-
-    return -1;
-}
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    ASSContext *ass = s->priv_data;
-    uint8_t *p, *end;
-
-    if(ass->event_index >= ass->event_count)
-        return AVERROR(EIO);
-
-    p= ass->event[ ass->event_index ];
-
-    end= strchr(p, '\n');
-    av_new_packet(pkt, end ? end-p+1 : strlen(p));
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    pkt->pos= p - ass->event_buffer + s->streams[0]->codec->extradata_size;
-    pkt->pts= pkt->dts= get_pts(p);
-    memcpy(pkt->data, p, pkt->size);
-
-    ass->event_index++;
-
-    return 0;
-}
-
-static int read_seek2(AVFormatContext *s, int stream_index,
-                      int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
-{
-    ASSContext *ass = s->priv_data;
-
-    if (flags & AVSEEK_FLAG_BYTE) {
-        return AVERROR(ENOSYS);
-    } else if (flags & AVSEEK_FLAG_FRAME) {
-        if (ts < 0 || ts >= ass->event_count)
-            return AVERROR(ERANGE);
-        ass->event_index = ts;
-    } else {
-        int i, idx = -1;
-        int64_t min_ts_diff = INT64_MAX;
-        if (stream_index == -1) {
-            AVRational time_base = s->streams[0]->time_base;
-            ts = av_rescale_q(ts, AV_TIME_BASE_Q, time_base);
-            min_ts = av_rescale_rnd(min_ts, time_base.den,
-                                    time_base.num * (int64_t)AV_TIME_BASE,
-                                    AV_ROUND_UP);
-            max_ts = av_rescale_rnd(max_ts, time_base.den,
-                                    time_base.num * (int64_t)AV_TIME_BASE,
-                                    AV_ROUND_DOWN);
-        }
-        /* TODO: ass->event[] is sorted by pts so we could do a binary search */
-        for (i=0; i<ass->event_count; i++) {
-            int64_t pts = get_pts(ass->event[i]);
-            int64_t ts_diff = FFABS(pts - ts);
-            if (pts >= min_ts && pts <= max_ts && ts_diff < min_ts_diff) {
-                min_ts_diff = ts_diff;
-                idx = i;
-            }
-        }
-        if (idx < 0)
-            return AVERROR(ERANGE);
-        ass->event_index = idx;
-    }
-    return 0;
-}
-
-AVInputFormat ff_ass_demuxer = {
-    .name           = "ass",
-    .long_name      = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
-    .priv_data_size = sizeof(ASSContext),
-    .read_probe     = probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .read_close     = read_close,
-    .read_seek2     = read_seek2,
-};
diff --git a/deps/libav/libavformat/assenc.c b/deps/libav/libavformat/assenc.c
deleted file mode 100644
index 751485d..0000000
--- a/deps/libav/libavformat/assenc.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * SSA/ASS muxer
- * Copyright (c) 2008 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-
-typedef struct ASSContext{
-    unsigned int extra_index;
-}ASSContext;
-
-static int write_header(AVFormatContext *s)
-{
-    ASSContext *ass = s->priv_data;
-    AVCodecContext *avctx= s->streams[0]->codec;
-    uint8_t *last= NULL;
-
-    if(s->nb_streams != 1 || avctx->codec_id != AV_CODEC_ID_SSA){
-        av_log(s, AV_LOG_ERROR, "Exactly one ASS/SSA stream is needed.\n");
-        return -1;
-    }
-
-    while(ass->extra_index < avctx->extradata_size){
-        uint8_t *p  = avctx->extradata + ass->extra_index;
-        uint8_t *end= strchr(p, '\n');
-        if(!end) end= avctx->extradata + avctx->extradata_size;
-        else     end++;
-
-        avio_write(s->pb, p, end-p);
-        ass->extra_index += end-p;
-
-        if(last && !memcmp(last, "[Events]", 8))
-            break;
-        last=p;
-    }
-
-    avio_flush(s->pb);
-
-    return 0;
-}
-
-static int write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    avio_write(s->pb, pkt->data, pkt->size);
-    return 0;
-}
-
-static int write_trailer(AVFormatContext *s)
-{
-    ASSContext *ass = s->priv_data;
-    AVCodecContext *avctx= s->streams[0]->codec;
-
-    avio_write(s->pb, avctx->extradata      + ass->extra_index,
-                      avctx->extradata_size - ass->extra_index);
-
-    return 0;
-}
-
-AVOutputFormat ff_ass_muxer = {
-    .name           = "ass",
-    .long_name      = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
-    .mime_type      = "text/x-ssa",
-    .extensions     = "ass,ssa",
-    .priv_data_size = sizeof(ASSContext),
-    .subtitle_codec = AV_CODEC_ID_SSA,
-    .write_header   = write_header,
-    .write_packet   = write_packet,
-    .write_trailer  = write_trailer,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_NOTIMESTAMPS,
-};
diff --git a/deps/libav/libavformat/au.c b/deps/libav/libavformat/au.c
deleted file mode 100644
index 6b252b2..0000000
--- a/deps/libav/libavformat/au.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * AU muxer and demuxer
- * Copyright (c) 2001 Fabrice Bellard
- *
- * first version by Francois Revol <revol at free.fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Reference documents:
- * http://www.opengroup.org/public/pubs/external/auformat.html
- * http://www.goice.co.jp/member/mo/formats/au.html
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "pcm.h"
-
-static const AVCodecTag codec_au_tags[] = {
-    { AV_CODEC_ID_PCM_MULAW,  1 },
-    { AV_CODEC_ID_PCM_S8,     2 },
-    { AV_CODEC_ID_PCM_S16BE,  3 },
-    { AV_CODEC_ID_PCM_S24BE,  4 },
-    { AV_CODEC_ID_PCM_S32BE,  5 },
-    { AV_CODEC_ID_PCM_F32BE,  6 },
-    { AV_CODEC_ID_PCM_F64BE,  7 },
-    { AV_CODEC_ID_PCM_ALAW,  27 },
-    { AV_CODEC_ID_NONE,       0 },
-};
-
-#if CONFIG_AU_DEMUXER
-
-static int au_probe(AVProbeData *p)
-{
-    if (p->buf[0] == '.' && p->buf[1] == 's' &&
-        p->buf[2] == 'n' && p->buf[3] == 'd')
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-#define BLOCK_SIZE 1024
-
-static int au_read_header(AVFormatContext *s)
-{
-    int size;
-    unsigned int tag;
-    AVIOContext *pb = s->pb;
-    unsigned int id, channels, rate;
-    int bps;
-    enum AVCodecID codec;
-    AVStream *st;
-
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('.', 's', 'n', 'd'))
-        return AVERROR_INVALIDDATA;
-    size = avio_rb32(pb); /* header size */
-    avio_rb32(pb);        /* data size */
-
-    id       = avio_rb32(pb);
-    rate     = avio_rb32(pb);
-    channels = avio_rb32(pb);
-
-    if (size > 24) {
-        /* skip unused data */
-        avio_skip(pb, size - 24);
-    }
-
-    codec = ff_codec_get_id(codec_au_tags, id);
-
-    if (codec == AV_CODEC_ID_NONE) {
-        avpriv_request_sample(s, "unknown or unsupported codec tag: %u", id);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    bps = av_get_bits_per_sample(codec);
-    if (!bps) {
-        avpriv_request_sample(s, "Unknown bits per sample");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (channels == 0 || channels >= INT_MAX / (BLOCK_SIZE * bps >> 3)) {
-        av_log(s, AV_LOG_ERROR, "Invalid number of channels %u\n", channels);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (rate == 0 || rate > INT_MAX) {
-        av_log(s, AV_LOG_ERROR, "Invalid sample rate: %u\n", rate);
-        return AVERROR_INVALIDDATA;
-    }
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_tag   = id;
-    st->codec->codec_id    = codec;
-    st->codec->channels    = channels;
-    st->codec->sample_rate = rate;
-    st->codec->bit_rate    = channels * rate * bps;
-    st->codec->block_align = channels * bps >> 3;
-
-    st->start_time = 0;
-    avpriv_set_pts_info(st, 64, 1, rate);
-
-    return 0;
-}
-
-static int au_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret;
-
-    ret = av_get_packet(s->pb, pkt, BLOCK_SIZE *
-                        s->streams[0]->codec->block_align);
-    if (ret < 0)
-        return ret;
-
-    pkt->stream_index = 0;
-    pkt->duration     = ret / s->streams[0]->codec->block_align;
-
-    return 0;
-}
-
-AVInputFormat ff_au_demuxer = {
-    .name        = "au",
-    .long_name   = NULL_IF_CONFIG_SMALL("Sun AU"),
-    .read_probe  = au_probe,
-    .read_header = au_read_header,
-    .read_packet = au_read_packet,
-    .read_seek   = ff_pcm_read_seek,
-    .codec_tag   = (const AVCodecTag* const []) { codec_au_tags, 0 },
-};
-
-#endif /* CONFIG_AU_DEMUXER */
-
-#if CONFIG_AU_MUXER
-
-#include "rawenc.h"
-
-/* if we don't know the size in advance */
-#define AU_UNKNOWN_SIZE ((uint32_t)(~0))
-
-/* AUDIO_FILE header */
-static int put_au_header(AVIOContext *pb, AVCodecContext *enc)
-{
-    if (!enc->codec_tag)
-        return AVERROR(EINVAL);
-
-    ffio_wfourcc(pb, ".snd");                   /* magic number */
-    avio_wb32(pb, 24);                          /* header size */
-    avio_wb32(pb, AU_UNKNOWN_SIZE);             /* data size */
-    avio_wb32(pb, enc->codec_tag);              /* codec ID */
-    avio_wb32(pb, enc->sample_rate);
-    avio_wb32(pb, enc->channels);
-
-    return 0;
-}
-
-static int au_write_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    int ret;
-
-    s->priv_data = NULL;
-
-    if ((ret = put_au_header(pb, s->streams[0]->codec)) < 0)
-        return ret;
-
-    avio_flush(pb);
-
-    return 0;
-}
-
-static int au_write_trailer(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    int64_t file_size;
-
-    if (s->pb->seekable) {
-        /* update file size */
-        file_size = avio_tell(pb);
-        avio_seek(pb, 8, SEEK_SET);
-        avio_wb32(pb, (uint32_t)(file_size - 24));
-        avio_seek(pb, file_size, SEEK_SET);
-        avio_flush(pb);
-    }
-
-    return 0;
-}
-
-AVOutputFormat ff_au_muxer = {
-    .name          = "au",
-    .long_name     = NULL_IF_CONFIG_SMALL("Sun AU"),
-    .mime_type     = "audio/basic",
-    .extensions    = "au",
-    .audio_codec   = AV_CODEC_ID_PCM_S16BE,
-    .video_codec   = AV_CODEC_ID_NONE,
-    .write_header  = au_write_header,
-    .write_packet  = ff_raw_write_packet,
-    .write_trailer = au_write_trailer,
-    .codec_tag     = (const AVCodecTag* const []) { codec_au_tags, 0 },
-};
-
-#endif /* CONFIG_AU_MUXER */
diff --git a/deps/libav/libavformat/audiointerleave.c b/deps/libav/libavformat/audiointerleave.c
deleted file mode 100644
index e4cde9d..0000000
--- a/deps/libav/libavformat/audiointerleave.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Audio Interleaving functions
- *
- * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/fifo.h"
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "audiointerleave.h"
-#include "internal.h"
-
-void ff_audio_interleave_close(AVFormatContext *s)
-{
-    int i;
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        AudioInterleaveContext *aic = st->priv_data;
-
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-            av_fifo_free(aic->fifo);
-    }
-}
-
-int ff_audio_interleave_init(AVFormatContext *s,
-                             const int *samples_per_frame,
-                             AVRational time_base)
-{
-    int i;
-
-    if (!samples_per_frame)
-        return -1;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        AudioInterleaveContext *aic = st->priv_data;
-
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            aic->sample_size = (st->codec->channels *
-                                av_get_bits_per_sample(st->codec->codec_id)) / 8;
-            if (!aic->sample_size) {
-                av_log(s, AV_LOG_ERROR, "could not compute sample size\n");
-                return -1;
-            }
-            aic->samples_per_frame = samples_per_frame;
-            aic->samples = aic->samples_per_frame;
-            aic->time_base = time_base;
-
-            aic->fifo_size = 100* *aic->samples;
-            aic->fifo= av_fifo_alloc(100 * *aic->samples);
-        }
-    }
-
-    return 0;
-}
-
-static int interleave_new_audio_packet(AVFormatContext *s, AVPacket *pkt,
-                                       int stream_index, int flush)
-{
-    AVStream *st = s->streams[stream_index];
-    AudioInterleaveContext *aic = st->priv_data;
-
-    int size = FFMIN(av_fifo_size(aic->fifo), *aic->samples * aic->sample_size);
-    if (!size || (!flush && size == av_fifo_size(aic->fifo)))
-        return 0;
-
-    av_new_packet(pkt, size);
-    av_fifo_generic_read(aic->fifo, pkt->data, size, NULL);
-
-    pkt->dts = pkt->pts = aic->dts;
-    pkt->duration = av_rescale_q(*aic->samples, st->time_base, aic->time_base);
-    pkt->stream_index = stream_index;
-    aic->dts += pkt->duration;
-
-    aic->samples++;
-    if (!*aic->samples)
-        aic->samples = aic->samples_per_frame;
-
-    return size;
-}
-
-int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush,
-                        int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int),
-                        int (*compare_ts)(AVFormatContext *, AVPacket *, AVPacket *))
-{
-    int i;
-
-    if (pkt) {
-        AVStream *st = s->streams[pkt->stream_index];
-        AudioInterleaveContext *aic = st->priv_data;
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            unsigned new_size = av_fifo_size(aic->fifo) + pkt->size;
-            if (new_size > aic->fifo_size) {
-                if (av_fifo_realloc2(aic->fifo, new_size) < 0)
-                    return -1;
-                aic->fifo_size = new_size;
-            }
-            av_fifo_generic_write(aic->fifo, pkt->data, pkt->size, NULL);
-        } else {
-            // rewrite pts and dts to be decoded time line position
-            pkt->pts = pkt->dts = aic->dts;
-            aic->dts += pkt->duration;
-            ff_interleave_add_packet(s, pkt, compare_ts);
-        }
-        pkt = NULL;
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            AVPacket new_pkt;
-            while (interleave_new_audio_packet(s, &new_pkt, i, flush))
-                ff_interleave_add_packet(s, &new_pkt, compare_ts);
-        }
-    }
-
-    return get_packet(s, out, NULL, flush);
-}
diff --git a/deps/libav/libavformat/audiointerleave.h b/deps/libav/libavformat/audiointerleave.h
deleted file mode 100644
index 9c7b548..0000000
--- a/deps/libav/libavformat/audiointerleave.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * audio interleaving prototypes and declarations
- *
- * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_AUDIOINTERLEAVE_H
-#define AVFORMAT_AUDIOINTERLEAVE_H
-
-#include "libavutil/fifo.h"
-#include "avformat.h"
-
-typedef struct AudioInterleaveContext {
-    AVFifoBuffer *fifo;
-    unsigned fifo_size;           ///< size of currently allocated FIFO
-    uint64_t dts;                 ///< current dts
-    int sample_size;              ///< size of one sample all channels included
-    const int *samples_per_frame; ///< must be 0-terminated
-    const int *samples;           ///< current samples per frame, pointer to samples_per_frame
-    AVRational time_base;         ///< time base of output audio packets
-} AudioInterleaveContext;
-
-int ff_audio_interleave_init(AVFormatContext *s, const int *samples_per_frame, AVRational time_base);
-void ff_audio_interleave_close(AVFormatContext *s);
-
-/**
- * Rechunk audio PCM packets per AudioInterleaveContext->samples_per_frame
- * and interleave them correctly.
- * The first element of AVStream->priv_data must be AudioInterleaveContext
- * when using this function.
- *
- * @param get_packet function will output a packet when streams are correctly interleaved.
- * @param compare_ts function will compare AVPackets and decide interleaving order.
- */
-int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush,
-                        int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int),
-                        int (*compare_ts)(AVFormatContext *, AVPacket *, AVPacket *));
-
-#endif /* AVFORMAT_AUDIOINTERLEAVE_H */
diff --git a/deps/libav/libavformat/avc.c b/deps/libav/libavformat/avc.c
deleted file mode 100644
index 2fd5ac8..0000000
--- a/deps/libav/libavformat/avc.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * AVC helper functions for muxers
- * Copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier at smartjog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "avio.h"
-#include "avc.h"
-
-static const uint8_t *ff_avc_find_startcode_internal(const uint8_t *p, const uint8_t *end)
-{
-    const uint8_t *a = p + 4 - ((intptr_t)p & 3);
-
-    for (end -= 3; p < a && p < end; p++) {
-        if (p[0] == 0 && p[1] == 0 && p[2] == 1)
-            return p;
-    }
-
-    for (end -= 3; p < end; p += 4) {
-        uint32_t x = *(const uint32_t*)p;
-//      if ((x - 0x01000100) & (~x) & 0x80008000) // little endian
-//      if ((x - 0x00010001) & (~x) & 0x00800080) // big endian
-        if ((x - 0x01010101) & (~x) & 0x80808080) { // generic
-            if (p[1] == 0) {
-                if (p[0] == 0 && p[2] == 1)
-                    return p;
-                if (p[2] == 0 && p[3] == 1)
-                    return p+1;
-            }
-            if (p[3] == 0) {
-                if (p[2] == 0 && p[4] == 1)
-                    return p+2;
-                if (p[4] == 0 && p[5] == 1)
-                    return p+3;
-            }
-        }
-    }
-
-    for (end += 3; p < end; p++) {
-        if (p[0] == 0 && p[1] == 0 && p[2] == 1)
-            return p;
-    }
-
-    return end + 3;
-}
-
-const uint8_t *ff_avc_find_startcode(const uint8_t *p, const uint8_t *end){
-    const uint8_t *out= ff_avc_find_startcode_internal(p, end);
-    if(p<out && out<end && !out[-1]) out--;
-    return out;
-}
-
-int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)
-{
-    const uint8_t *p = buf_in;
-    const uint8_t *end = p + size;
-    const uint8_t *nal_start, *nal_end;
-
-    size = 0;
-    nal_start = ff_avc_find_startcode(p, end);
-    for (;;) {
-        while (nal_start < end && !*(nal_start++));
-        if (nal_start == end)
-            break;
-
-        nal_end = ff_avc_find_startcode(nal_start, end);
-        avio_wb32(pb, nal_end - nal_start);
-        avio_write(pb, nal_start, nal_end - nal_start);
-        size += 4 + nal_end - nal_start;
-        nal_start = nal_end;
-    }
-    return size;
-}
-
-int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
-{
-    AVIOContext *pb;
-    int ret = avio_open_dyn_buf(&pb);
-    if(ret < 0)
-        return ret;
-
-    ff_avc_parse_nal_units(pb, buf_in, *size);
-
-    av_freep(buf);
-    *size = avio_close_dyn_buf(pb, buf);
-    return 0;
-}
-
-int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len)
-{
-    if (len > 6) {
-        /* check for h264 start code */
-        if (AV_RB32(data) == 0x00000001 ||
-            AV_RB24(data) == 0x000001) {
-            uint8_t *buf=NULL, *end, *start;
-            uint32_t sps_size=0, pps_size=0;
-            uint8_t *sps=0, *pps=0;
-
-            int ret = ff_avc_parse_nal_units_buf(data, &buf, &len);
-            if (ret < 0)
-                return ret;
-            start = buf;
-            end = buf + len;
-
-            /* look for sps and pps */
-            while (end - buf > 4) {
-                uint32_t size;
-                uint8_t nal_type;
-                size = FFMIN(AV_RB32(buf), end - buf - 4);
-                buf += 4;
-                nal_type = buf[0] & 0x1f;
-
-                if (nal_type == 7) { /* SPS */
-                    sps = buf;
-                    sps_size = size;
-                } else if (nal_type == 8) { /* PPS */
-                    pps = buf;
-                    pps_size = size;
-                }
-
-                buf += size;
-            }
-
-            if (!sps || !pps || sps_size < 4 || sps_size > UINT16_MAX || pps_size > UINT16_MAX)
-                return AVERROR_INVALIDDATA;
-
-            avio_w8(pb, 1); /* version */
-            avio_w8(pb, sps[1]); /* profile */
-            avio_w8(pb, sps[2]); /* profile compat */
-            avio_w8(pb, sps[3]); /* level */
-            avio_w8(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal size length - 1 (11) */
-            avio_w8(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of sps (00001) */
-
-            avio_wb16(pb, sps_size);
-            avio_write(pb, sps, sps_size);
-            avio_w8(pb, 1); /* number of pps */
-            avio_wb16(pb, pps_size);
-            avio_write(pb, pps, pps_size);
-            av_free(start);
-        } else {
-            avio_write(pb, data, len);
-        }
-    }
-    return 0;
-}
-
-int ff_avc_write_annexb_extradata(const uint8_t *in, uint8_t **buf, int *size)
-{
-    uint16_t sps_size, pps_size;
-    uint8_t *out;
-    int out_size;
-
-    *buf = NULL;
-    if (*size >= 4 && (AV_RB32(in) == 0x00000001 || AV_RB24(in) == 0x000001))
-        return 0;
-    if (*size < 11 || in[0] != 1)
-        return AVERROR_INVALIDDATA;
-
-    sps_size = AV_RB16(&in[6]);
-    if (11 + sps_size > *size)
-        return AVERROR_INVALIDDATA;
-    pps_size = AV_RB16(&in[9 + sps_size]);
-    if (11 + sps_size + pps_size > *size)
-        return AVERROR_INVALIDDATA;
-    out_size = 8 + sps_size + pps_size;
-    out = av_mallocz(out_size);
-    if (!out)
-        return AVERROR(ENOMEM);
-    AV_WB32(&out[0], 0x00000001);
-    memcpy(out + 4, &in[8], sps_size);
-    AV_WB32(&out[4 + sps_size], 0x00000001);
-    memcpy(out + 8 + sps_size, &in[11 + sps_size], pps_size);
-    *buf = out;
-    *size = out_size;
-    return 0;
-}
diff --git a/deps/libav/libavformat/avc.h b/deps/libav/libavformat/avc.h
deleted file mode 100644
index 579756e..0000000
--- a/deps/libav/libavformat/avc.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * AVC helper functions for muxers
- * Copyright (c) 2008 Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_AVC_H
-#define AVFORMAT_AVC_H
-
-#include <stdint.h>
-#include "avio.h"
-
-int ff_avc_parse_nal_units(AVIOContext *s, const uint8_t *buf, int size);
-int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size);
-int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len);
-const uint8_t *ff_avc_find_startcode(const uint8_t *p, const uint8_t *end);
-int ff_avc_write_annexb_extradata(const uint8_t *in, uint8_t **buf, int *size);
-
-#endif /* AVFORMAT_AVC_H */
diff --git a/deps/libav/libavformat/avformat.h b/deps/libav/libavformat/avformat.h
deleted file mode 100644
index ec9c262..0000000
--- a/deps/libav/libavformat/avformat.h
+++ /dev/null
@@ -1,1869 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_AVFORMAT_H
-#define AVFORMAT_AVFORMAT_H
-
-/**
- * @file
- * @ingroup libavf
- * Main libavformat public API header
- */
-
-/**
- * @defgroup libavf I/O and Muxing/Demuxing Library
- * @{
- *
- * Libavformat (lavf) is a library for dealing with various media container
- * formats. Its main two purposes are demuxing - i.e. splitting a media file
- * into component streams, and the reverse process of muxing - writing supplied
- * data in a specified container format. It also has an @ref lavf_io
- * "I/O module" which supports a number of protocols for accessing the data (e.g.
- * file, tcp, http and others). Before using lavf, you need to call
- * av_register_all() to register all compiled muxers, demuxers and protocols.
- * Unless you are absolutely sure you won't use libavformat's network
- * capabilities, you should also call avformat_network_init().
- *
- * A supported input format is described by an AVInputFormat struct, conversely
- * an output format is described by AVOutputFormat. You can iterate over all
- * registered input/output formats using the av_iformat_next() /
- * av_oformat_next() functions. The protocols layer is not part of the public
- * API, so you can only get the names of supported protocols with the
- * avio_enum_protocols() function.
- *
- * Main lavf structure used for both muxing and demuxing is AVFormatContext,
- * which exports all information about the file being read or written. As with
- * most Libav structures, its size is not part of public ABI, so it cannot be
- * allocated on stack or directly with av_malloc(). To create an
- * AVFormatContext, use avformat_alloc_context() (some functions, like
- * avformat_open_input() might do that for you).
- *
- * Most importantly an AVFormatContext contains:
- * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat
- * "output" format. It is either autodetected or set by user for input;
- * always set by user for output.
- * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all
- * elementary streams stored in the file. AVStreams are typically referred to
- * using their index in this array.
- * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or
- * set by user for input, always set by user for output (unless you are dealing
- * with an AVFMT_NOFILE format).
- *
- * @section lavf_options Passing options to (de)muxers
- * Lavf allows to configure muxers and demuxers using the @ref avoptions
- * mechanism. Generic (format-independent) libavformat options are provided by
- * AVFormatContext, they can be examined from a user program by calling
- * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass
- * from avformat_get_class()). Private (format-specific) options are provided by
- * AVFormatContext.priv_data if and only if AVInputFormat.priv_class /
- * AVOutputFormat.priv_class of the corresponding format struct is non-NULL.
- * Further options may be provided by the @ref AVFormatContext.pb "I/O context",
- * if its AVClass is non-NULL, and the protocols layer. See the discussion on
- * nesting in @ref avoptions documentation to learn how to access those.
- *
- * @defgroup lavf_decoding Demuxing
- * @{
- * Demuxers read a media file and split it into chunks of data (@em packets). A
- * @ref AVPacket "packet" contains one or more encoded frames which belongs to a
- * single elementary stream. In the lavf API this process is represented by the
- * avformat_open_input() function for opening a file, av_read_frame() for
- * reading a single packet and finally avformat_close_input(), which does the
- * cleanup.
- *
- * @section lavf_decoding_open Opening a media file
- * The minimum information required to open a file is its URL or filename, which
- * is passed to avformat_open_input(), as in the following code:
- * @code
- * const char    *url = "in.mp3";
- * AVFormatContext *s = NULL;
- * int ret = avformat_open_input(&s, url, NULL, NULL);
- * if (ret < 0)
- *     abort();
- * @endcode
- * The above code attempts to allocate an AVFormatContext, open the
- * specified file (autodetecting the format) and read the header, exporting the
- * information stored there into s. Some formats do not have a header or do not
- * store enough information there, so it is recommended that you call the
- * avformat_find_stream_info() function which tries to read and decode a few
- * frames to find missing information.
- *
- * In some cases you might want to preallocate an AVFormatContext yourself with
- * avformat_alloc_context() and do some tweaking on it before passing it to
- * avformat_open_input(). One such case is when you want to use custom functions
- * for reading input data instead of lavf internal I/O layer.
- * To do that, create your own AVIOContext with avio_alloc_context(), passing
- * your reading callbacks to it. Then set the @em pb field of your
- * AVFormatContext to newly created AVIOContext.
- *
- * Since the format of the opened file is in general not known until after
- * avformat_open_input() has returned, it is not possible to set demuxer private
- * options on a preallocated context. Instead, the options should be passed to
- * avformat_open_input() wrapped in an AVDictionary:
- * @code
- * AVDictionary *options = NULL;
- * av_dict_set(&options, "video_size", "640x480", 0);
- * av_dict_set(&options, "pixel_format", "rgb24", 0);
- *
- * if (avformat_open_input(&s, url, NULL, &options) < 0)
- *     abort();
- * av_dict_free(&options);
- * @endcode
- * This code passes the private options 'video_size' and 'pixel_format' to the
- * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it
- * cannot know how to interpret raw video data otherwise. If the format turns
- * out to be something different than raw video, those options will not be
- * recognized by the demuxer and therefore will not be applied. Such unrecognized
- * options are then returned in the options dictionary (recognized options are
- * consumed). The calling program can handle such unrecognized options as it
- * wishes, e.g.
- * @code
- * AVDictionaryEntry *e;
- * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
- *     fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key);
- *     abort();
- * }
- * @endcode
- *
- * After you have finished reading the file, you must close it with
- * avformat_close_input(). It will free everything associated with the file.
- *
- * @section lavf_decoding_read Reading from an opened file
- * Reading data from an opened AVFormatContext is done by repeatedly calling
- * av_read_frame() on it. Each call, if successful, will return an AVPacket
- * containing encoded data for one AVStream, identified by
- * AVPacket.stream_index. This packet may be passed straight into the libavcodec
- * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or
- * avcodec_decode_subtitle2() if the caller wishes to decode the data.
- *
- * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be
- * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for
- * pts/dts, 0 for duration) if the stream does not provide them. The timing
- * information will be in AVStream.time_base units, i.e. it has to be
- * multiplied by the timebase to convert them to seconds.
- *
- * If AVPacket.buf is set on the returned packet, then the packet is
- * allocated dynamically and the user may keep it indefinitely.
- * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a
- * static storage somewhere inside the demuxer and the packet is only valid
- * until the next av_read_frame() call or closing the file. If the caller
- * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy
- * of it.
- * In both cases, the packet must be freed with av_free_packet() when it is no
- * longer needed.
- *
- * @section lavf_decoding_seek Seeking
- * @}
- *
- * @defgroup lavf_encoding Muxing
- * @{
- * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write
- * it into files or other output bytestreams in the specified container format.
- *
- * The main API functions for muxing are avformat_write_header() for writing the
- * file header, av_write_frame() / av_interleaved_write_frame() for writing the
- * packets and av_write_trailer() for finalizing the file.
- *
- * At the beginning of the muxing process, the caller must first call
- * avformat_alloc_context() to create a muxing context. The caller then sets up
- * the muxer by filling the various fields in this context:
- *
- * - The @ref AVFormatContext.oformat "oformat" field must be set to select the
- *   muxer that will be used.
- * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb
- *   "pb" field must be set to an opened IO context, either returned from
- *   avio_open2() or a custom one.
- * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must
- *   be created with the avformat_new_stream() function. The caller should fill
- *   the @ref AVStream.codec "stream codec context" information, such as the
- *   codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id
- *   "id" and other parameters (e.g. width / height, the pixel or sample format,
- *   etc.) as known. The @ref AVCodecContext.time_base "codec timebase" should
- *   be set to the timebase that the caller desires to use for this stream (note
- *   that the timebase actually used by the muxer can be different, as will be
- *   described later).
- * - The caller may fill in additional information, such as @ref
- *   AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream"
- *   metadata, @ref AVFormatContext.chapters "chapters", @ref
- *   AVFormatContext.programs "programs", etc. as described in the
- *   AVFormatContext documentation. Whether such information will actually be
- *   stored in the output depends on what the container format and the muxer
- *   support.
- *
- * When the muxing context is fully set up, the caller must call
- * avformat_write_header() to initialize the muxer internals and write the file
- * header. Whether anything actually is written to the IO context at this step
- * depends on the muxer, but this function must always be called. Any muxer
- * private options must be passed in the options parameter to this function.
- *
- * The data is then sent to the muxer by repeatedly calling av_write_frame() or
- * av_interleaved_write_frame() (consult those functions' documentation for
- * discussion on the difference between them; only one of them may be used with
- * a single muxing context, they should not be mixed). Do note that the timing
- * information on the packets sent to the muxer must be in the corresponding
- * AVStream's timebase. That timebase is set by the muxer (in the
- * avformat_write_header() step) and may be different from the timebase the
- * caller set on the codec context.
- *
- * Once all the data has been written, the caller must call av_write_trailer()
- * to flush any buffered packets and finalize the output file, then close the IO
- * context (if any) and finally free the muxing context with
- * avformat_free_context().
- * @}
- *
- * @defgroup lavf_io I/O Read/Write
- * @{
- * @}
- *
- * @defgroup lavf_codec Demuxers
- * @{
- * @defgroup lavf_codec_native Native Demuxers
- * @{
- * @}
- * @defgroup lavf_codec_wrappers External library wrappers
- * @{
- * @}
- * @}
- * @defgroup lavf_protos I/O Protocols
- * @{
- * @}
- * @defgroup lavf_internal Internal
- * @{
- * @}
- * @}
- *
- */
-
-#include <time.h>
-#include <stdio.h>  /* FILE */
-#include "libavcodec/avcodec.h"
-#include "libavutil/dict.h"
-#include "libavutil/log.h"
-
-#include "avio.h"
-#include "libavformat/version.h"
-
-struct AVFormatContext;
-
-
-/**
- * @defgroup metadata_api Public Metadata API
- * @{
- * @ingroup libavf
- * The metadata API allows libavformat to export metadata tags to a client
- * application when demuxing. Conversely it allows a client application to
- * set metadata when muxing.
- *
- * Metadata is exported or set as pairs of key/value strings in the 'metadata'
- * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs
- * using the @ref lavu_dict "AVDictionary" API. Like all strings in Libav,
- * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata
- * exported by demuxers isn't checked to be valid UTF-8 in most cases.
- *
- * Important concepts to keep in mind:
- * -  Keys are unique; there can never be 2 tags with the same key. This is
- *    also meant semantically, i.e., a demuxer should not knowingly produce
- *    several keys that are literally different but semantically identical.
- *    E.g., key=Author5, key=Author6. In this example, all authors must be
- *    placed in the same tag.
- * -  Metadata is flat, not hierarchical; there are no subtags. If you
- *    want to store, e.g., the email address of the child of producer Alice
- *    and actor Bob, that could have key=alice_and_bobs_childs_email_address.
- * -  Several modifiers can be applied to the tag name. This is done by
- *    appending a dash character ('-') and the modifier name in the order
- *    they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng.
- *    -  language -- a tag whose value is localized for a particular language
- *       is appended with the ISO 639-2/B 3-letter language code.
- *       For example: Author-ger=Michael, Author-eng=Mike
- *       The original/default language is in the unqualified "Author" tag.
- *       A demuxer should set a default if it sets any translated tag.
- *    -  sorting  -- a modified version of a tag that should be used for
- *       sorting will have '-sort' appended. E.g. artist="The Beatles",
- *       artist-sort="Beatles, The".
- *
- * -  Demuxers attempt to export metadata in a generic format, however tags
- *    with no generic equivalents are left as they are stored in the container.
- *    Follows a list of generic tag names:
- *
- @verbatim
- album        -- name of the set this work belongs to
- album_artist -- main creator of the set/album, if different from artist.
-                 e.g. "Various Artists" for compilation albums.
- artist       -- main creator of the work
- comment      -- any additional description of the file.
- composer     -- who composed the work, if different from artist.
- copyright    -- name of copyright holder.
- creation_time-- date when the file was created, preferably in ISO 8601.
- date         -- date when the work was created, preferably in ISO 8601.
- disc         -- number of a subset, e.g. disc in a multi-disc collection.
- encoder      -- name/settings of the software/hardware that produced the file.
- encoded_by   -- person/group who created the file.
- filename     -- original name of the file.
- genre        -- <self-evident>.
- language     -- main language in which the work is performed, preferably
-                 in ISO 639-2 format. Multiple languages can be specified by
-                 separating them with commas.
- performer    -- artist who performed the work, if different from artist.
-                 E.g for "Also sprach Zarathustra", artist would be "Richard
-                 Strauss" and performer "London Philharmonic Orchestra".
- publisher    -- name of the label/publisher.
- service_name     -- name of the service in broadcasting (channel name).
- service_provider -- name of the service provider in broadcasting.
- title        -- name of the work.
- track        -- number of this work in the set, can be in form current/total.
- variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
- @endverbatim
- *
- * Look in the examples section for an application example how to use the Metadata API.
- *
- * @}
- */
-
-/* packet functions */
-
-
-/**
- * Allocate and read the payload of a packet and initialize its
- * fields with default values.
- *
- * @param s    associated IO context
- * @param pkt packet
- * @param size desired payload size
- * @return >0 (read size) if OK, AVERROR_xxx otherwise
- */
-int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
-
-
-/**
- * Read data and append it to the current content of the AVPacket.
- * If pkt->size is 0 this is identical to av_get_packet.
- * Note that this uses av_grow_packet and thus involves a realloc
- * which is inefficient. Thus this function should only be used
- * when there is no reasonable way to know (an upper bound of)
- * the final size.
- *
- * @param s    associated IO context
- * @param pkt packet
- * @param size amount of data to read
- * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
- *         will not be lost even if an error occurs.
- */
-int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
-
-/*************************************************/
-/* fractional numbers for exact pts handling */
-
-/**
- * The exact value of the fractional number is: 'val + num / den'.
- * num is assumed to be 0 <= num < den.
- */
-typedef struct AVFrac {
-    int64_t val, num, den;
-} AVFrac;
-
-/*************************************************/
-/* input/output formats */
-
-struct AVCodecTag;
-
-/**
- * This structure contains the data a format has to probe a file.
- */
-typedef struct AVProbeData {
-    const char *filename;
-    unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */
-    int buf_size;       /**< Size of buf except extra allocated bytes */
-} AVProbeData;
-
-#define AVPROBE_SCORE_EXTENSION  50 ///< score for file extension
-#define AVPROBE_SCORE_MAX       100 ///< maximum score
-
-#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
-
-/// Demuxer will use avio_open, no opened file should be provided by the caller.
-#define AVFMT_NOFILE        0x0001
-#define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */
-#define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */
-#define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for
-                                      raw picture data. */
-#define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */
-#define AVFMT_NOTIMESTAMPS  0x0080 /**< Format does not need / have any timestamps. */
-#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
-#define AVFMT_TS_DISCONT    0x0200 /**< Format allows timestamp discontinuities. Note, muxers always require valid (monotone) timestamps */
-#define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
-#define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height */
-#define AVFMT_NOSTREAMS     0x1000 /**< Format does not require any streams */
-#define AVFMT_NOBINSEARCH   0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */
-#define AVFMT_NOGENSEARCH   0x4000 /**< Format does not allow to fall back on generic search */
-#define AVFMT_NO_BYTE_SEEK  0x8000 /**< Format does not allow seeking by bytes */
-#define AVFMT_ALLOW_FLUSH  0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */
-#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly
-                                        increasing timestamps, but they must
-                                        still be monotonic */
-#define AVFMT_TS_NEGATIVE  0x40000 /**< Format allows muxing negative
-                                        timestamps. If not set the timestamp
-                                        will be shifted in av_write_frame and
-                                        av_interleaved_write_frame so they
-                                        start from 0. */
-
-/**
- * @addtogroup lavf_encoding
- * @{
- */
-typedef struct AVOutputFormat {
-    const char *name;
-    /**
-     * Descriptive name for the format, meant to be more human-readable
-     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
-     * to define it.
-     */
-    const char *long_name;
-    const char *mime_type;
-    const char *extensions; /**< comma-separated filename extensions */
-    /* output support */
-    enum AVCodecID audio_codec;    /**< default audio codec */
-    enum AVCodecID video_codec;    /**< default video codec */
-    enum AVCodecID subtitle_codec; /**< default subtitle codec */
-    /**
-     * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
-     * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
-     * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH,
-     * AVFMT_TS_NONSTRICT
-     */
-    int flags;
-
-    /**
-     * List of supported codec_id-codec_tag pairs, ordered by "better
-     * choice first". The arrays are all terminated by AV_CODEC_ID_NONE.
-     */
-    const struct AVCodecTag * const *codec_tag;
-
-
-    const AVClass *priv_class; ///< AVClass for the private context
-
-    /*****************************************************************
-     * No fields below this line are part of the public API. They
-     * may not be used outside of libavformat and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-    struct AVOutputFormat *next;
-    /**
-     * size of private data so that it can be allocated in the wrapper
-     */
-    int priv_data_size;
-
-    int (*write_header)(struct AVFormatContext *);
-    /**
-     * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
-     * pkt can be NULL in order to flush data buffered in the muxer.
-     * When flushing, return 0 if there still is more data to flush,
-     * or 1 if everything was flushed and there is no more buffered
-     * data.
-     */
-    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
-    int (*write_trailer)(struct AVFormatContext *);
-    /**
-     * Currently only used to set pixel format if not YUV420P.
-     */
-    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
-                             AVPacket *in, int flush);
-    /**
-     * Test if the given codec can be stored in this container.
-     *
-     * @return 1 if the codec is supported, 0 if it is not.
-     *         A negative number if unknown.
-     */
-    int (*query_codec)(enum AVCodecID id, int std_compliance);
-} AVOutputFormat;
-/**
- * @}
- */
-
-/**
- * @addtogroup lavf_decoding
- * @{
- */
-typedef struct AVInputFormat {
-    /**
-     * A comma separated list of short names for the format. New names
-     * may be appended with a minor bump.
-     */
-    const char *name;
-
-    /**
-     * Descriptive name for the format, meant to be more human-readable
-     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
-     * to define it.
-     */
-    const char *long_name;
-
-    /**
-     * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
-     * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
-     * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
-     */
-    int flags;
-
-    /**
-     * If extensions are defined, then no probe is done. You should
-     * usually not use extension format guessing because it is not
-     * reliable enough
-     */
-    const char *extensions;
-
-    const struct AVCodecTag * const *codec_tag;
-
-    const AVClass *priv_class; ///< AVClass for the private context
-
-    /*****************************************************************
-     * No fields below this line are part of the public API. They
-     * may not be used outside of libavformat and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-    struct AVInputFormat *next;
-
-    /**
-     * Raw demuxers store their codec ID here.
-     */
-    int raw_codec_id;
-
-    /**
-     * Size of private data so that it can be allocated in the wrapper.
-     */
-    int priv_data_size;
-
-    /**
-     * Tell if a given file has a chance of being parsed as this format.
-     * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
-     * big so you do not have to check for that unless you need more.
-     */
-    int (*read_probe)(AVProbeData *);
-
-    /**
-     * Read the format header and initialize the AVFormatContext
-     * structure. Return 0 if OK. Only used in raw format right
-     * now. 'avformat_new_stream' should be called to create new streams.
-     */
-    int (*read_header)(struct AVFormatContext *);
-
-    /**
-     * Read one packet and put it in 'pkt'. pts and flags are also
-     * set. 'avformat_new_stream' can be called only if the flag
-     * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a
-     * background thread).
-     * @return 0 on success, < 0 on error.
-     *         When returning an error, pkt must not have been allocated
-     *         or must be freed before returning
-     */
-    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
-
-    /**
-     * Close the stream. The AVFormatContext and AVStreams are not
-     * freed by this function
-     */
-    int (*read_close)(struct AVFormatContext *);
-
-    /**
-     * Seek to a given timestamp relative to the frames in
-     * stream component stream_index.
-     * @param stream_index Must not be -1.
-     * @param flags Selects which direction should be preferred if no exact
-     *              match is available.
-     * @return >= 0 on success (but not necessarily the new offset)
-     */
-    int (*read_seek)(struct AVFormatContext *,
-                     int stream_index, int64_t timestamp, int flags);
-
-    /**
-     * Get the next timestamp in stream[stream_index].time_base units.
-     * @return the timestamp or AV_NOPTS_VALUE if an error occurred
-     */
-    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
-                              int64_t *pos, int64_t pos_limit);
-
-    /**
-     * Start/resume playing - only meaningful if using a network-based format
-     * (RTSP).
-     */
-    int (*read_play)(struct AVFormatContext *);
-
-    /**
-     * Pause playing - only meaningful if using a network-based format
-     * (RTSP).
-     */
-    int (*read_pause)(struct AVFormatContext *);
-
-    /**
-     * Seek to timestamp ts.
-     * Seeking will be done so that the point from which all active streams
-     * can be presented successfully will be closest to ts and within min/max_ts.
-     * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
-     */
-    int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
-} AVInputFormat;
-/**
- * @}
- */
-
-enum AVStreamParseType {
-    AVSTREAM_PARSE_NONE,
-    AVSTREAM_PARSE_FULL,       /**< full parsing and repack */
-    AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */
-    AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
-    AVSTREAM_PARSE_FULL_ONCE,  /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
-};
-
-typedef struct AVIndexEntry {
-    int64_t pos;
-    int64_t timestamp;
-#define AVINDEX_KEYFRAME 0x0001
-    int flags:2;
-    int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
-    int min_distance;         /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
-} AVIndexEntry;
-
-#define AV_DISPOSITION_DEFAULT   0x0001
-#define AV_DISPOSITION_DUB       0x0002
-#define AV_DISPOSITION_ORIGINAL  0x0004
-#define AV_DISPOSITION_COMMENT   0x0008
-#define AV_DISPOSITION_LYRICS    0x0010
-#define AV_DISPOSITION_KARAOKE   0x0020
-
-/**
- * Track should be used during playback by default.
- * Useful for subtitle track that should be displayed
- * even when user did not explicitly ask for subtitles.
- */
-#define AV_DISPOSITION_FORCED    0x0040
-#define AV_DISPOSITION_HEARING_IMPAIRED  0x0080  /**< stream for hearing impaired audiences */
-#define AV_DISPOSITION_VISUAL_IMPAIRED   0x0100  /**< stream for visual impaired audiences */
-#define AV_DISPOSITION_CLEAN_EFFECTS     0x0200  /**< stream without voice */
-/**
- * The stream is stored in the file as an attached picture/"cover art" (e.g.
- * APIC frame in ID3v2). The single packet associated with it will be returned
- * among the first few packets read from the file unless seeking takes place.
- * It can also be accessed at any time in AVStream.attached_pic.
- */
-#define AV_DISPOSITION_ATTACHED_PIC      0x0400
-
-/**
- * Stream structure.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVStream) must not be used outside libav*.
- */
-typedef struct AVStream {
-    int index;    /**< stream index in AVFormatContext */
-    /**
-     * Format-specific stream ID.
-     * decoding: set by libavformat
-     * encoding: set by the user, replaced by libavformat if left unset
-     */
-    int id;
-    /**
-     * Codec context associated with this stream. Allocated and freed by
-     * libavformat.
-     *
-     * - decoding: The demuxer exports codec information stored in the headers
-     *             here.
-     * - encoding: The user sets codec information, the muxer writes it to the
-     *             output. Mandatory fields as specified in AVCodecContext
-     *             documentation must be set even if this AVCodecContext is
-     *             not actually used for encoding.
-     */
-    AVCodecContext *codec;
-    void *priv_data;
-
-    /**
-     * encoding: pts generation when outputting stream
-     */
-    struct AVFrac pts;
-
-    /**
-     * This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented.
-     *
-     * decoding: set by libavformat
-     * encoding: set by libavformat in avformat_write_header. The muxer may use the
-     * user-provided value of @ref AVCodecContext.time_base "codec->time_base"
-     * as a hint.
-     */
-    AVRational time_base;
-
-    /**
-     * Decoding: pts of the first frame of the stream, in stream time base.
-     * Only set this if you are absolutely 100% sure that the value you set
-     * it to really is the pts of the first frame.
-     * This may be undefined (AV_NOPTS_VALUE).
-     */
-    int64_t start_time;
-
-    /**
-     * Decoding: duration of the stream, in stream time base.
-     * If a source file does not specify a duration, but does specify
-     * a bitrate, this value will be estimated from bitrate and file size.
-     */
-    int64_t duration;
-
-    int64_t nb_frames;                 ///< number of frames in this stream if known or 0
-
-    int disposition; /**< AV_DISPOSITION_* bit field */
-
-    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
-
-    /**
-     * sample aspect ratio (0 if unknown)
-     * - encoding: Set by user.
-     * - decoding: Set by libavformat.
-     */
-    AVRational sample_aspect_ratio;
-
-    AVDictionary *metadata;
-
-    /**
-     * Average framerate
-     */
-    AVRational avg_frame_rate;
-
-    /**
-     * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet
-     * will contain the attached picture.
-     *
-     * decoding: set by libavformat, must not be modified by the caller.
-     * encoding: unused
-     */
-    AVPacket attached_pic;
-
-    /*****************************************************************
-     * All fields below this line are not part of the public API. They
-     * may not be used outside of libavformat and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-
-    /**
-     * Stream information used internally by av_find_stream_info()
-     */
-#define MAX_STD_TIMEBASES (60*12+5)
-    struct {
-        int nb_decoded_frames;
-        int found_decoder;
-
-        /**
-         * Those are used for average framerate estimation.
-         */
-        int64_t fps_first_dts;
-        int     fps_first_dts_idx;
-        int64_t fps_last_dts;
-        int     fps_last_dts_idx;
-
-    } *info;
-
-    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
-
-#if FF_API_REFERENCE_DTS
-    /* a hack to keep ABI compatibility for avconv, which accesses parser even
-     * though it should not */
-    int64_t do_not_use;
-#endif
-    // Timestamp generation support:
-    int64_t first_dts;
-    int64_t cur_dts;
-    int64_t last_IP_pts;
-    int last_IP_duration;
-
-    /**
-     * Number of packets to buffer for codec probing
-     */
-#define MAX_PROBE_PACKETS 2500
-    int probe_packets;
-
-    /**
-     * Number of frames that have been demuxed during av_find_stream_info()
-     */
-    int codec_info_nb_frames;
-
-    /* av_read_frame() support */
-    enum AVStreamParseType need_parsing;
-    struct AVCodecParserContext *parser;
-
-    /**
-     * last packet in packet_buffer for this stream when muxing.
-     */
-    struct AVPacketList *last_in_packet_buffer;
-    AVProbeData probe_data;
-#define MAX_REORDER_DELAY 16
-    int64_t pts_buffer[MAX_REORDER_DELAY+1];
-
-    AVIndexEntry *index_entries; /**< Only used if the format does not
-                                    support seeking natively. */
-    int nb_index_entries;
-    unsigned int index_entries_allocated_size;
-} AVStream;
-
-#define AV_PROGRAM_RUNNING 1
-
-/**
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVProgram) must not be used outside libav*.
- */
-typedef struct AVProgram {
-    int            id;
-    int            flags;
-    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
-    unsigned int   *stream_index;
-    unsigned int   nb_stream_indexes;
-    AVDictionary *metadata;
-} AVProgram;
-
-#define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
-                                         (streams are added dynamically) */
-
-typedef struct AVChapter {
-    int id;                 ///< unique ID to identify the chapter
-    AVRational time_base;   ///< time base in which the start/end timestamps are specified
-    int64_t start, end;     ///< chapter start/end time in time_base units
-    AVDictionary *metadata;
-} AVChapter;
-
-typedef struct AVFormatInternal AVFormatInternal;
-
-/**
- * Format I/O context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVFormatContext) must not be used outside libav*, use
- * avformat_alloc_context() to create an AVFormatContext.
- */
-typedef struct AVFormatContext {
-    /**
-     * A class for logging and @ref avoptions. Set by avformat_alloc_context().
-     * Exports (de)muxer private options if they exist.
-     */
-    const AVClass *av_class;
-
-    /**
-     * The input container format.
-     *
-     * Demuxing only, set by avformat_open_input().
-     */
-    struct AVInputFormat *iformat;
-
-    /**
-     * The output container format.
-     *
-     * Muxing only, must be set by the caller before avformat_write_header().
-     */
-    struct AVOutputFormat *oformat;
-
-    /**
-     * Format private data. This is an AVOptions-enabled struct
-     * if and only if iformat/oformat.priv_class is not NULL.
-     *
-     * - muxing: set by avformat_write_header()
-     * - demuxing: set by avformat_open_input()
-     */
-    void *priv_data;
-
-    /**
-     * I/O context.
-     *
-     * - demuxing: either set by the user before avformat_open_input() (then
-     *             the user must close it manually) or set by avformat_open_input().
-     * - muxing: set by the user before avformat_write_header(). The caller must
-     *           take care of closing / freeing the IO context.
-     *
-     * Do NOT set this field if AVFMT_NOFILE flag is set in
-     * iformat/oformat.flags. In such a case, the (de)muxer will handle
-     * I/O in some other way and this field will be NULL.
-     */
-    AVIOContext *pb;
-
-    /* stream info */
-    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
-
-    /**
-     * Number of elements in AVFormatContext.streams.
-     *
-     * Set by avformat_new_stream(), must not be modified by any other code.
-     */
-    unsigned int nb_streams;
-    /**
-     * A list of all streams in the file. New streams are created with
-     * avformat_new_stream().
-     *
-     * - demuxing: streams are created by libavformat in avformat_open_input().
-     *             If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also
-     *             appear in av_read_frame().
-     * - muxing: streams are created by the user before avformat_write_header().
-     *
-     * Freed by libavformat in avformat_free_context().
-     */
-    AVStream **streams;
-
-    /**
-     * input or output filename
-     *
-     * - demuxing: set by avformat_open_input()
-     * - muxing: may be set by the caller before avformat_write_header()
-     */
-    char filename[1024];
-
-    /**
-     * Position of the first frame of the component, in
-     * AV_TIME_BASE fractional seconds. NEVER set this value directly:
-     * It is deduced from the AVStream values.
-     *
-     * Demuxing only, set by libavformat.
-     */
-    int64_t start_time;
-
-    /**
-     * Duration of the stream, in AV_TIME_BASE fractional
-     * seconds. Only set this value if you know none of the individual stream
-     * durations and also do not set any of them. This is deduced from the
-     * AVStream values if not set.
-     *
-     * Demuxing only, set by libavformat.
-     */
-    int64_t duration;
-
-    /**
-     * Total stream bitrate in bit/s, 0 if not
-     * available. Never set it directly if the file_size and the
-     * duration are known as Libav can compute it automatically.
-     */
-    int bit_rate;
-
-    unsigned int packet_size;
-    int max_delay;
-
-    int flags;
-#define AVFMT_FLAG_GENPTS       0x0001 ///< Generate missing pts even if it requires parsing future frames.
-#define AVFMT_FLAG_IGNIDX       0x0002 ///< Ignore index.
-#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input.
-#define AVFMT_FLAG_IGNDTS       0x0008 ///< Ignore DTS on frames that contain both DTS & PTS
-#define AVFMT_FLAG_NOFILLIN     0x0010 ///< Do not infer any values from other values, just return what is stored in the container
-#define AVFMT_FLAG_NOPARSE      0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled
-#define AVFMT_FLAG_NOBUFFER     0x0040 ///< Do not buffer frames when possible
-#define AVFMT_FLAG_CUSTOM_IO    0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
-#define AVFMT_FLAG_DISCARD_CORRUPT  0x0100 ///< Discard frames marked corrupted
-#define AVFMT_FLAG_FLUSH_PACKETS    0x0200 ///< Flush the AVIOContext every packet.
-
-    /**
-     * Maximum size of the data read from input for determining
-     * the input container format.
-     * Demuxing only, set by the caller before avformat_open_input().
-     */
-    unsigned int probesize;
-
-    /**
-     * Maximum duration (in AV_TIME_BASE units) of the data read
-     * from input in avformat_find_stream_info().
-     * Demuxing only, set by the caller before avformat_find_stream_info().
-     */
-    int max_analyze_duration;
-
-    const uint8_t *key;
-    int keylen;
-
-    unsigned int nb_programs;
-    AVProgram **programs;
-
-    /**
-     * Forced video codec_id.
-     * Demuxing: Set by user.
-     */
-    enum AVCodecID video_codec_id;
-
-    /**
-     * Forced audio codec_id.
-     * Demuxing: Set by user.
-     */
-    enum AVCodecID audio_codec_id;
-
-    /**
-     * Forced subtitle codec_id.
-     * Demuxing: Set by user.
-     */
-    enum AVCodecID subtitle_codec_id;
-
-    /**
-     * Maximum amount of memory in bytes to use for the index of each stream.
-     * If the index exceeds this size, entries will be discarded as
-     * needed to maintain a smaller size. This can lead to slower or less
-     * accurate seeking (depends on demuxer).
-     * Demuxers for which a full in-memory index is mandatory will ignore
-     * this.
-     * - muxing: unused
-     * - demuxing: set by user
-     */
-    unsigned int max_index_size;
-
-    /**
-     * Maximum amount of memory in bytes to use for buffering frames
-     * obtained from realtime capture devices.
-     */
-    unsigned int max_picture_buffer;
-
-    /**
-     * Number of chapters in AVChapter array.
-     * When muxing, chapters are normally written in the file header,
-     * so nb_chapters should normally be initialized before write_header
-     * is called. Some muxers (e.g. mov and mkv) can also write chapters
-     * in the trailer.  To write chapters in the trailer, nb_chapters
-     * must be zero when write_header is called and non-zero when
-     * write_trailer is called.
-     * - muxing: set by user
-     * - demuxing: set by libavformat
-     */
-    unsigned int nb_chapters;
-    AVChapter **chapters;
-
-    /**
-     * Metadata that applies to the whole file.
-     *
-     * - demuxing: set by libavformat in avformat_open_input()
-     * - muxing: may be set by the caller before avformat_write_header()
-     *
-     * Freed by libavformat in avformat_free_context().
-     */
-    AVDictionary *metadata;
-
-    /**
-     * Start time of the stream in real world time, in microseconds
-     * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the
-     * stream was captured at this real world time.
-     * Muxing only, set by the caller before avformat_write_header().
-     */
-    int64_t start_time_realtime;
-
-    /**
-     * The number of frames used for determining the framerate in
-     * avformat_find_stream_info().
-     * Demuxing only, set by the caller before avformat_find_stream_info().
-     */
-    int fps_probe_size;
-
-    /**
-     * Error recognition; higher values will detect more errors but may
-     * misdetect some more or less valid parts as errors.
-     * Demuxing only, set by the caller before avformat_open_input().
-     */
-    int error_recognition;
-
-    /**
-     * Custom interrupt callbacks for the I/O layer.
-     *
-     * demuxing: set by the user before avformat_open_input().
-     * muxing: set by the user before avformat_write_header()
-     * (mainly useful for AVFMT_NOFILE formats). The callback
-     * should also be passed to avio_open2() if it's used to
-     * open the file.
-     */
-    AVIOInterruptCB interrupt_callback;
-
-    /**
-     * Flags to enable debugging.
-     */
-    int debug;
-#define FF_FDEBUG_TS        0x0001
-
-    /**
-     * Maximum buffering duration for interleaving.
-     *
-     * To ensure all the streams are interleaved correctly,
-     * av_interleaved_write_frame() will wait until it has at least one packet
-     * for each stream before actually writing any packets to the output file.
-     * When some streams are "sparse" (i.e. there are large gaps between
-     * successive packets), this can result in excessive buffering.
-     *
-     * This field specifies the maximum difference between the timestamps of the
-     * first and the last packet in the muxing queue, above which libavformat
-     * will output a packet regardless of whether it has queued a packet for all
-     * the streams.
-     *
-     * Muxing only, set by the caller before avformat_write_header().
-     */
-    int64_t max_interleave_delta;
-
-    /*****************************************************************
-     * All fields below this line are not part of the public API. They
-     * may not be used outside of libavformat and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-
-    /**
-     * This buffer is only needed when packets were already buffered but
-     * not decoded, for example to get the codec parameters in MPEG
-     * streams.
-     */
-    struct AVPacketList *packet_buffer;
-    struct AVPacketList *packet_buffer_end;
-
-    /* av_seek_frame() support */
-    int64_t data_offset; /**< offset of the first packet */
-
-    /**
-     * Raw packets from the demuxer, prior to parsing and decoding.
-     * This buffer is used for buffering packets until the codec can
-     * be identified, as parsing cannot be done without knowing the
-     * codec.
-     */
-    struct AVPacketList *raw_packet_buffer;
-    struct AVPacketList *raw_packet_buffer_end;
-    /**
-     * Packets split by the parser get queued here.
-     */
-    struct AVPacketList *parse_queue;
-    struct AVPacketList *parse_queue_end;
-    /**
-     * Remaining size available for raw_packet_buffer, in bytes.
-     */
-#define RAW_PACKET_BUFFER_SIZE 2500000
-    int raw_packet_buffer_remaining_size;
-
-    /**
-     * Offset to remap timestamps to be non-negative.
-     * Expressed in timebase units.
-     */
-    int64_t offset;
-
-    /**
-     * Timebase for the timestamp offset.
-     */
-    AVRational offset_timebase;
-
-    /**
-     * An opaque field for libavformat internal usage.
-     * Must not be accessed in any way by callers.
-     */
-    AVFormatInternal *internal;
-} AVFormatContext;
-
-typedef struct AVPacketList {
-    AVPacket pkt;
-    struct AVPacketList *next;
-} AVPacketList;
-
-
-/**
- * @defgroup lavf_core Core functions
- * @ingroup libavf
- *
- * Functions for querying libavformat capabilities, allocating core structures,
- * etc.
- * @{
- */
-
-/**
- * Return the LIBAVFORMAT_VERSION_INT constant.
- */
-unsigned avformat_version(void);
-
-/**
- * Return the libavformat build-time configuration.
- */
-const char *avformat_configuration(void);
-
-/**
- * Return the libavformat license.
- */
-const char *avformat_license(void);
-
-/**
- * Initialize libavformat and register all the muxers, demuxers and
- * protocols. If you do not call this function, then you can select
- * exactly which formats you want to support.
- *
- * @see av_register_input_format()
- * @see av_register_output_format()
- * @see av_register_protocol()
- */
-void av_register_all(void);
-
-void av_register_input_format(AVInputFormat *format);
-void av_register_output_format(AVOutputFormat *format);
-
-/**
- * Do global initialization of network components. This is optional,
- * but recommended, since it avoids the overhead of implicitly
- * doing the setup for each session.
- *
- * Calling this function will become mandatory if using network
- * protocols at some major version bump.
- */
-int avformat_network_init(void);
-
-/**
- * Undo the initialization done by avformat_network_init.
- */
-int avformat_network_deinit(void);
-
-/**
- * If f is NULL, returns the first registered input format,
- * if f is non-NULL, returns the next registered input format after f
- * or NULL if f is the last one.
- */
-AVInputFormat  *av_iformat_next(AVInputFormat  *f);
-
-/**
- * If f is NULL, returns the first registered output format,
- * if f is non-NULL, returns the next registered output format after f
- * or NULL if f is the last one.
- */
-AVOutputFormat *av_oformat_next(AVOutputFormat *f);
-
-/**
- * Allocate an AVFormatContext.
- * avformat_free_context() can be used to free the context and everything
- * allocated by the framework within it.
- */
-AVFormatContext *avformat_alloc_context(void);
-
-/**
- * Free an AVFormatContext and all its streams.
- * @param s context to free
- */
-void avformat_free_context(AVFormatContext *s);
-
-/**
- * Get the AVClass for AVFormatContext. It can be used in combination with
- * AV_OPT_SEARCH_FAKE_OBJ for examining options.
- *
- * @see av_opt_find().
- */
-const AVClass *avformat_get_class(void);
-
-/**
- * Add a new stream to a media file.
- *
- * When demuxing, it is called by the demuxer in read_header(). If the
- * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
- * be called in read_packet().
- *
- * When muxing, should be called by the user before avformat_write_header().
- *
- * @param s media file handle
- * @param c If non-NULL, the AVCodecContext corresponding to the new stream
- * will be initialized to use this codec. This is needed for e.g. codec-specific
- * defaults to be set, so codec should be provided if it is known.
- *
- * @return newly created stream or NULL on error.
- */
-AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
-
-AVProgram *av_new_program(AVFormatContext *s, int id);
-
-/**
- * @}
- */
-
-
-/**
- * @addtogroup lavf_decoding
- * @{
- */
-
-/**
- * Find AVInputFormat based on the short name of the input format.
- */
-AVInputFormat *av_find_input_format(const char *short_name);
-
-/**
- * Guess the file format.
- *
- * @param pd        data to be probed
- * @param is_opened Whether the file is already opened; determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed.
- */
-AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
-
-/**
- * Guess the file format.
- *
- * @param pd        data to be probed
- * @param is_opened Whether the file is already opened; determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed.
- * @param score_max A probe score larger that this is required to accept a
- *                  detection, the variable is set to the actual detection
- *                  score afterwards.
- *                  If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
- *                  to retry with a larger probe buffer.
- */
-AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
-
-/**
- * Probe a bytestream to determine the input format. Each time a probe returns
- * with a score that is too low, the probe buffer size is increased and another
- * attempt is made. When the maximum probe size is reached, the input format
- * with the highest score is returned.
- *
- * @param pb the bytestream to probe
- * @param fmt the input format is put here
- * @param filename the filename of the stream
- * @param logctx the log context
- * @param offset the offset within the bytestream to probe from
- * @param max_probe_size the maximum probe buffer size (zero for default)
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code otherwise
- */
-int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
-                          const char *filename, void *logctx,
-                          unsigned int offset, unsigned int max_probe_size);
-
-/**
- * Open an input stream and read the header. The codecs are not opened.
- * The stream must be closed with avformat_close_input().
- *
- * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
- *           May be a pointer to NULL, in which case an AVFormatContext is allocated by this
- *           function and written into ps.
- *           Note that a user-supplied AVFormatContext will be freed on failure.
- * @param filename Name of the stream to open.
- * @param fmt If non-NULL, this parameter forces a specific input format.
- *            Otherwise the format is autodetected.
- * @param options  A dictionary filled with AVFormatContext and demuxer-private options.
- *                 On return this parameter will be destroyed and replaced with a dict containing
- *                 options that were not found. May be NULL.
- *
- * @return 0 on success, a negative AVERROR on failure.
- *
- * @note If you want to use custom IO, preallocate the format context and set its pb field.
- */
-int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);
-
-/**
- * Read packets of a media file to get stream information. This
- * is useful for file formats with no headers such as MPEG. This
- * function also computes the real framerate in case of MPEG-2 repeat
- * frame mode.
- * The logical file position is not changed by this function;
- * examined packets may be buffered for later processing.
- *
- * @param ic media file handle
- * @param options  If non-NULL, an ic.nb_streams long array of pointers to
- *                 dictionaries, where i-th member contains options for
- *                 codec corresponding to i-th stream.
- *                 On return each dictionary will be filled with options that were not found.
- * @return >=0 if OK, AVERROR_xxx on error
- *
- * @note this function isn't guaranteed to open all the codecs, so
- *       options being non-empty at return is a perfectly normal behavior.
- *
- * @todo Let the user decide somehow what information is needed so that
- *       we do not waste time getting stuff the user does not need.
- */
-int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options);
-
-/**
- * Find the "best" stream in the file.
- * The best stream is determined according to various heuristics as the most
- * likely to be what the user expects.
- * If the decoder parameter is non-NULL, av_find_best_stream will find the
- * default decoder for the stream's codec; streams for which no decoder can
- * be found are ignored.
- *
- * @param ic                media file handle
- * @param type              stream type: video, audio, subtitles, etc.
- * @param wanted_stream_nb  user-requested stream number,
- *                          or -1 for automatic selection
- * @param related_stream    try to find a stream related (eg. in the same
- *                          program) to this one, or -1 if none
- * @param decoder_ret       if non-NULL, returns the decoder for the
- *                          selected stream
- * @param flags             flags; none are currently defined
- * @return  the non-negative stream number in case of success,
- *          AVERROR_STREAM_NOT_FOUND if no stream with the requested type
- *          could be found,
- *          AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
- * @note  If av_find_best_stream returns successfully and decoder_ret is not
- *        NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
- */
-int av_find_best_stream(AVFormatContext *ic,
-                        enum AVMediaType type,
-                        int wanted_stream_nb,
-                        int related_stream,
-                        AVCodec **decoder_ret,
-                        int flags);
-
-/**
- * Return the next frame of a stream.
- * This function returns what is stored in the file, and does not validate
- * that what is there are valid frames for the decoder. It will split what is
- * stored in the file into frames and return one for each call. It will not
- * omit invalid data between valid frames so as to give the decoder the maximum
- * information possible for decoding.
- *
- * If pkt->buf is NULL, then the packet is valid until the next
- * av_read_frame() or until avformat_close_input(). Otherwise the packet
- * is valid indefinitely. In both cases the packet must be freed with
- * av_free_packet when it is no longer needed. For video, the packet contains
- * exactly one frame. For audio, it contains an integer number of frames if each
- * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames
- * have a variable size (e.g. MPEG audio), then it contains one frame.
- *
- * pkt->pts, pkt->dts and pkt->duration are always set to correct
- * values in AVStream.time_base units (and guessed if the format cannot
- * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format
- * has B-frames, so it is better to rely on pkt->dts if you do not
- * decompress the payload.
- *
- * @return 0 if OK, < 0 on error or end of file
- */
-int av_read_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Seek to the keyframe at timestamp.
- * 'timestamp' in 'stream_index'.
- *
- * @param s media file handle
- * @param stream_index If stream_index is (-1), a default
- * stream is selected, and timestamp is automatically converted
- * from AV_TIME_BASE units to the stream specific time_base.
- * @param timestamp Timestamp in AVStream.time_base units
- *        or, if no stream is specified, in AV_TIME_BASE units.
- * @param flags flags which select direction and seeking mode
- * @return >= 0 on success
- */
-int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
-                  int flags);
-
-/**
- * Seek to timestamp ts.
- * Seeking will be done so that the point from which all active streams
- * can be presented successfully will be closest to ts and within min/max_ts.
- * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
- *
- * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and
- * are the file position (this may not be supported by all demuxers).
- * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames
- * in the stream with stream_index (this may not be supported by all demuxers).
- * Otherwise all timestamps are in units of the stream selected by stream_index
- * or if stream_index is -1, in AV_TIME_BASE units.
- * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as
- * keyframes (this may not be supported by all demuxers).
- *
- * @param s media file handle
- * @param stream_index index of the stream which is used as time base reference
- * @param min_ts smallest acceptable timestamp
- * @param ts target timestamp
- * @param max_ts largest acceptable timestamp
- * @param flags flags
- * @return >=0 on success, error code otherwise
- *
- * @note This is part of the new seek API which is still under construction.
- *       Thus do not use this yet. It may change at any time, do not expect
- *       ABI compatibility yet!
- */
-int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
-
-/**
- * Start playing a network-based stream (e.g. RTSP stream) at the
- * current position.
- */
-int av_read_play(AVFormatContext *s);
-
-/**
- * Pause a network-based stream (e.g. RTSP stream).
- *
- * Use av_read_play() to resume it.
- */
-int av_read_pause(AVFormatContext *s);
-
-/**
- * Close an opened input AVFormatContext. Free it and all its contents
- * and set *s to NULL.
- */
-void avformat_close_input(AVFormatContext **s);
-/**
- * @}
- */
-
-#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
-#define AVSEEK_FLAG_BYTE     2 ///< seeking based on position in bytes
-#define AVSEEK_FLAG_ANY      4 ///< seek to any frame, even non-keyframes
-#define AVSEEK_FLAG_FRAME    8 ///< seeking based on frame number
-
-/**
- * @addtogroup lavf_encoding
- * @{
- */
-/**
- * Allocate the stream private data and write the stream header to
- * an output media file.
- *
- * @param s Media file handle, must be allocated with avformat_alloc_context().
- *          Its oformat field must be set to the desired output format;
- *          Its pb field must be set to an already opened AVIOContext.
- * @param options  An AVDictionary filled with AVFormatContext and muxer-private options.
- *                 On return this parameter will be destroyed and replaced with a dict containing
- *                 options that were not found. May be NULL.
- *
- * @return 0 on success, negative AVERROR on failure.
- *
- * @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
- */
-int avformat_write_header(AVFormatContext *s, AVDictionary **options);
-
-/**
- * Write a packet to an output media file.
- *
- * This function passes the packet directly to the muxer, without any buffering
- * or reordering. The caller is responsible for correctly interleaving the
- * packets if the format requires it. Callers that want libavformat to handle
- * the interleaving should call av_interleaved_write_frame() instead of this
- * function.
- *
- * @param s media file handle
- * @param pkt The packet containing the data to be written. Note that unlike
- *            av_interleaved_write_frame(), this function does not take
- *            ownership of the packet passed to it (though some muxers may make
- *            an internal reference to the input packet).
- *            <br>
- *            This parameter can be NULL (at any time, not just at the end), in
- *            order to immediately flush data buffered within the muxer, for
- *            muxers that buffer up data internally before writing it to the
- *            output.
- *            <br>
- *            Packet's @ref AVPacket.stream_index "stream_index" field must be
- *            set to the index of the corresponding stream in @ref
- *            AVFormatContext.streams "s->streams". It is very strongly
- *            recommended that timing information (@ref AVPacket.pts "pts", @ref
- *            AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to
- *            correct values.
- * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush
- *
- * @see av_interleaved_write_frame()
- */
-int av_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Write a packet to an output media file ensuring correct interleaving.
- *
- * This function will buffer the packets internally as needed to make sure the
- * packets in the output file are properly interleaved in the order of
- * increasing dts. Callers doing their own interleaving should call
- * av_write_frame() instead of this function.
- *
- * @param s media file handle
- * @param pkt The packet containing the data to be written.
- *            <br>
- *            If the packet is reference-counted, this function will take
- *            ownership of this reference and unreference it later when it sees
- *            fit.
- *            The caller must not access the data through this reference after
- *            this function returns. If the packet is not reference-counted,
- *            libavformat will make a copy.
- *            <br>
- *            This parameter can be NULL (at any time, not just at the end), to
- *            flush the interleaving queues.
- *            <br>
- *            Packet's @ref AVPacket.stream_index "stream_index" field must be
- *            set to the index of the corresponding stream in @ref
- *            AVFormatContext.streams "s->streams". It is very strongly
- *            recommended that timing information (@ref AVPacket.pts "pts", @ref
- *            AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to
- *            correct values.
- *
- * @return 0 on success, a negative AVERROR on error. Libavformat will always
- *         take care of freeing the packet, even if this function fails.
- *
- * @see av_write_frame(), AVFormatContext.max_interleave_delta
- */
-int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Write the stream trailer to an output media file and free the
- * file private data.
- *
- * May only be called after a successful call to avformat_write_header.
- *
- * @param s media file handle
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_write_trailer(AVFormatContext *s);
-
-/**
- * Return the output format in the list of registered output formats
- * which best matches the provided parameters, or return NULL if
- * there is no match.
- *
- * @param short_name if non-NULL checks if short_name matches with the
- * names of the registered formats
- * @param filename if non-NULL checks if filename terminates with the
- * extensions of the registered formats
- * @param mime_type if non-NULL checks if mime_type matches with the
- * MIME type of the registered formats
- */
-AVOutputFormat *av_guess_format(const char *short_name,
-                                const char *filename,
-                                const char *mime_type);
-
-/**
- * Guess the codec ID based upon muxer and filename.
- */
-enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
-                            const char *filename, const char *mime_type,
-                            enum AVMediaType type);
-
-/**
- * @}
- */
-
-
-/**
- * @defgroup lavf_misc Utility functions
- * @ingroup libavf
- * @{
- *
- * Miscellaneous utility functions related to both muxing and demuxing
- * (or neither).
- */
-
-/**
- * Send a nice hexadecimal dump of a buffer to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
- */
-void av_hex_dump(FILE *f, const uint8_t *buf, int size);
-
-/**
- * Send a nice hexadecimal dump of a buffer to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
- */
-void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size);
-
-/**
- * Send a nice dump of a packet to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param pkt packet to dump
- * @param dump_payload True if the payload must be displayed, too.
- * @param st AVStream that the packet belongs to
- */
-void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st);
-
-
-/**
- * Send a nice dump of a packet to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param pkt packet to dump
- * @param dump_payload True if the payload must be displayed, too.
- * @param st AVStream that the packet belongs to
- */
-void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
-                      AVStream *st);
-
-/**
- * Get the AVCodecID for the given codec tag tag.
- * If no codec id is found returns AV_CODEC_ID_NONE.
- *
- * @param tags list of supported codec_id-codec_tag pairs, as stored
- * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
- * @param tag  codec tag to match to a codec ID
- */
-enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
-
-/**
- * Get the codec tag for the given codec id id.
- * If no codec tag is found returns 0.
- *
- * @param tags list of supported codec_id-codec_tag pairs, as stored
- * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
- * @param id   codec ID to match to a codec tag
- */
-unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id);
-
-int av_find_default_stream_index(AVFormatContext *s);
-
-/**
- * Get the index for a specific timestamp.
- *
- * @param st        stream that the timestamp belongs to
- * @param timestamp timestamp to retrieve the index for
- * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond
- *                 to the timestamp which is <= the requested one, if backward
- *                 is 0, then it will be >=
- *              if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
- * @return < 0 if no such timestamp could be found
- */
-int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
-
-/**
- * Add an index entry into a sorted list. Update the entry if the list
- * already contains it.
- *
- * @param timestamp timestamp in the time base of the given stream
- */
-int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
-                       int size, int distance, int flags);
-
-
-/**
- * Split a URL string into components.
- *
- * The pointers to buffers for storing individual components may be null,
- * in order to ignore that component. Buffers for components not found are
- * set to empty strings. If the port is not found, it is set to a negative
- * value.
- *
- * @param proto the buffer for the protocol
- * @param proto_size the size of the proto buffer
- * @param authorization the buffer for the authorization
- * @param authorization_size the size of the authorization buffer
- * @param hostname the buffer for the host name
- * @param hostname_size the size of the hostname buffer
- * @param port_ptr a pointer to store the port number in
- * @param path the buffer for the path
- * @param path_size the size of the path buffer
- * @param url the URL to split
- */
-void av_url_split(char *proto,         int proto_size,
-                  char *authorization, int authorization_size,
-                  char *hostname,      int hostname_size,
-                  int *port_ptr,
-                  char *path,          int path_size,
-                  const char *url);
-
-
-void av_dump_format(AVFormatContext *ic,
-                    int index,
-                    const char *url,
-                    int is_output);
-
-/**
- * Return in 'buf' the path with '%d' replaced by a number.
- *
- * Also handles the '%0nd' format where 'n' is the total number
- * of digits and '%%'.
- *
- * @param buf destination buffer
- * @param buf_size destination buffer size
- * @param path numbered sequence string
- * @param number frame number
- * @return 0 if OK, -1 on format error
- */
-int av_get_frame_filename(char *buf, int buf_size,
-                          const char *path, int number);
-
-/**
- * Check whether filename actually is a numbered sequence generator.
- *
- * @param filename possible numbered sequence string
- * @return 1 if a valid numbered sequence string, 0 otherwise
- */
-int av_filename_number_test(const char *filename);
-
-/**
- * Generate an SDP for an RTP session.
- *
- * Note, this overwrites the id values of AVStreams in the muxer contexts
- * for getting unique dynamic payload types.
- *
- * @param ac array of AVFormatContexts describing the RTP streams. If the
- *           array is composed by only one context, such context can contain
- *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
- *           all the contexts in the array (an AVCodecContext per RTP stream)
- *           must contain only one AVStream.
- * @param n_files number of AVCodecContexts contained in ac
- * @param buf buffer where the SDP will be stored (must be allocated by
- *            the caller)
- * @param size the size of the buffer
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size);
-
-/**
- * Return a positive value if the given filename has one of the given
- * extensions, 0 otherwise.
- *
- * @param filename   file name to check against the given extensions
- * @param extensions a comma-separated list of filename extensions
- */
-int av_match_ext(const char *filename, const char *extensions);
-
-/**
- * Test if the given container can store a codec.
- *
- * @param ofmt           container to check for compatibility
- * @param codec_id       codec to potentially store in container
- * @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
- *
- * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
- *         A negative number if this information is not available.
- */
-int avformat_query_codec(AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance);
-
-/**
- * @defgroup riff_fourcc RIFF FourCCs
- * @{
- * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are
- * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the
- * following code:
- * @code
- * uint32_t tag = MKTAG('H', '2', '6', '4');
- * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 };
- * enum AVCodecID id = av_codec_get_id(table, tag);
- * @endcode
- */
-/**
- * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID.
- */
-const struct AVCodecTag *avformat_get_riff_video_tags(void);
-/**
- * @return the table mapping RIFF FourCCs for audio to AVCodecID.
- */
-const struct AVCodecTag *avformat_get_riff_audio_tags(void);
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-#endif /* AVFORMAT_AVFORMAT_H */
diff --git a/deps/libav/libavformat/avi.h b/deps/libav/libavformat/avi.h
deleted file mode 100644
index e05db9c..0000000
--- a/deps/libav/libavformat/avi.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_AVI_H
-#define AVFORMAT_AVI_H
-
-#define AVIF_HASINDEX           0x00000010        // Index at end of file?
-#define AVIF_MUSTUSEINDEX       0x00000020
-#define AVIF_ISINTERLEAVED      0x00000100
-#define AVIF_TRUSTCKTYPE        0x00000800        // Use CKType to find key frames?
-#define AVIF_WASCAPTUREFILE     0x00010000
-#define AVIF_COPYRIGHTED        0x00020000
-
-#define AVI_MAX_RIFF_SIZE       0x40000000LL
-#define AVI_MASTER_INDEX_SIZE   256
-#define AVI_MAX_STREAM_COUNT    100
-
-/* index flags */
-#define AVIIF_INDEX             0x10
-
-#endif /* AVFORMAT_AVI_H */
diff --git a/deps/libav/libavformat/avidec.c b/deps/libav/libavformat/avidec.c
deleted file mode 100644
index e851f0b..0000000
--- a/deps/libav/libavformat/avidec.c
+++ /dev/null
@@ -1,1599 +0,0 @@
-/*
- * AVI demuxer
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/bswap.h"
-#include "libavutil/dict.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "avi.h"
-#include "dv.h"
-#include "internal.h"
-#include "riff.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-typedef struct AVIStream {
-    int64_t frame_offset;   /* current frame (video) or byte (audio) counter
-                             * (used to compute the pts) */
-    int remaining;
-    int packet_size;
-
-    uint32_t scale;
-    uint32_t rate;
-    int sample_size;        /* size of one sample (or packet)
-                             * (in the rate/scale sense) in bytes */
-
-    int64_t cum_len;        /* temporary storage (used during seek) */
-    int prefix;             /* normally 'd'<<8 + 'c' or 'w'<<8 + 'b' */
-    int prefix_count;
-    uint32_t pal[256];
-    int has_pal;
-    int dshow_block_align;  /* block align variable used to emulate bugs in
-                             * the MS dshow demuxer */
-
-    AVFormatContext *sub_ctx;
-    AVPacket sub_pkt;
-    uint8_t *sub_buffer;
-} AVIStream;
-
-typedef struct {
-    int64_t riff_end;
-    int64_t movi_end;
-    int64_t fsize;
-    int64_t movi_list;
-    int64_t last_pkt_pos;
-    int index_loaded;
-    int is_odml;
-    int non_interleaved;
-    int stream_index;
-    DVDemuxContext *dv_demux;
-    int odml_depth;
-#define MAX_ODML_DEPTH 1000
-} AVIContext;
-
-static const char avi_headers[][8] = {
-    { 'R', 'I', 'F', 'F', 'A', 'V', 'I', ' '  },
-    { 'R', 'I', 'F', 'F', 'A', 'V', 'I', 'X'  },
-    { 'R', 'I', 'F', 'F', 'A', 'V', 'I', 0x19 },
-    { 'O', 'N', '2', ' ', 'O', 'N', '2', 'f'  },
-    { 'R', 'I', 'F', 'F', 'A', 'M', 'V', ' '  },
-    { 0 }
-};
-
-static const AVMetadataConv avi_metadata_conv[] = {
-    { "strn", "title" },
-    { 0 },
-};
-
-static int avi_load_index(AVFormatContext *s);
-static int guess_ni_flag(AVFormatContext *s);
-
-#define print_tag(str, tag, size)                        \
-    av_dlog(NULL, "%s: tag=%c%c%c%c size=0x%x\n",        \
-            str, tag & 0xff,                             \
-            (tag >> 8) & 0xff,                           \
-            (tag >> 16) & 0xff,                          \
-            (tag >> 24) & 0xff,                          \
-            size)
-
-static inline int get_duration(AVIStream *ast, int len)
-{
-    if (ast->sample_size)
-        return len;
-    else if (ast->dshow_block_align)
-        return (len + ast->dshow_block_align - 1) / ast->dshow_block_align;
-    else
-        return 1;
-}
-
-static int get_riff(AVFormatContext *s, AVIOContext *pb)
-{
-    AVIContext *avi = s->priv_data;
-    char header[8];
-    int i;
-
-    /* check RIFF header */
-    avio_read(pb, header, 4);
-    avi->riff_end  = avio_rl32(pb); /* RIFF chunk size */
-    avi->riff_end += avio_tell(pb); /* RIFF chunk end */
-    avio_read(pb, header + 4, 4);
-
-    for (i = 0; avi_headers[i][0]; i++)
-        if (!memcmp(header, avi_headers[i], 8))
-            break;
-    if (!avi_headers[i][0])
-        return AVERROR_INVALIDDATA;
-
-    if (header[7] == 0x19)
-        av_log(s, AV_LOG_INFO,
-               "This file has been generated by a totally broken muxer.\n");
-
-    return 0;
-}
-
-static int read_braindead_odml_indx(AVFormatContext *s, int frame_num)
-{
-    AVIContext *avi     = s->priv_data;
-    AVIOContext *pb     = s->pb;
-    int longs_pre_entry = avio_rl16(pb);
-    int index_sub_type  = avio_r8(pb);
-    int index_type      = avio_r8(pb);
-    int entries_in_use  = avio_rl32(pb);
-    int chunk_id        = avio_rl32(pb);
-    int64_t base        = avio_rl64(pb);
-    int stream_id       = ((chunk_id      & 0xFF) - '0') * 10 +
-                          ((chunk_id >> 8 & 0xFF) - '0');
-    AVStream *st;
-    AVIStream *ast;
-    int i;
-    int64_t last_pos = -1;
-    int64_t filesize = avio_size(s->pb);
-
-    av_dlog(s,
-            "longs_pre_entry:%d index_type:%d entries_in_use:%d "
-            "chunk_id:%X base:%16"PRIX64"\n",
-            longs_pre_entry,
-            index_type,
-            entries_in_use,
-            chunk_id,
-            base);
-
-    if (stream_id >= s->nb_streams || stream_id < 0)
-        return AVERROR_INVALIDDATA;
-    st  = s->streams[stream_id];
-    ast = st->priv_data;
-
-    if (index_sub_type)
-        return AVERROR_INVALIDDATA;
-
-    avio_rl32(pb);
-
-    if (index_type && longs_pre_entry != 2)
-        return AVERROR_INVALIDDATA;
-    if (index_type > 1)
-        return AVERROR_INVALIDDATA;
-
-    if (filesize > 0 && base >= filesize) {
-        av_log(s, AV_LOG_ERROR, "ODML index invalid\n");
-        if (base >> 32 == (base & 0xFFFFFFFF) &&
-            (base & 0xFFFFFFFF) < filesize    &&
-            filesize <= 0xFFFFFFFF)
-            base &= 0xFFFFFFFF;
-        else
-            return AVERROR_INVALIDDATA;
-    }
-
-    for (i = 0; i < entries_in_use; i++) {
-        if (index_type) {
-            int64_t pos = avio_rl32(pb) + base - 8;
-            int len     = avio_rl32(pb);
-            int key     = len >= 0;
-            len &= 0x7FFFFFFF;
-
-            av_dlog(s, "pos:%"PRId64", len:%X\n", pos, len);
-
-            if (pb->eof_reached)
-                return AVERROR_INVALIDDATA;
-
-            if (last_pos == pos || pos == base - 8)
-                avi->non_interleaved = 1;
-            if (last_pos != pos && (len || !ast->sample_size))
-                av_add_index_entry(st, pos, ast->cum_len, len, 0,
-                                   key ? AVINDEX_KEYFRAME : 0);
-
-            ast->cum_len += get_duration(ast, len);
-            last_pos      = pos;
-        } else {
-            int64_t offset, pos;
-            int duration;
-            offset = avio_rl64(pb);
-            avio_rl32(pb);       /* size */
-            duration = avio_rl32(pb);
-
-            if (pb->eof_reached)
-                return AVERROR_INVALIDDATA;
-
-            pos = avio_tell(pb);
-
-            if (avi->odml_depth > MAX_ODML_DEPTH) {
-                av_log(s, AV_LOG_ERROR, "Too deeply nested ODML indexes\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            avio_seek(pb, offset + 8, SEEK_SET);
-            avi->odml_depth++;
-            read_braindead_odml_indx(s, frame_num);
-            avi->odml_depth--;
-            frame_num += duration;
-
-            avio_seek(pb, pos, SEEK_SET);
-        }
-    }
-    avi->index_loaded = 1;
-    return 0;
-}
-
-static void clean_index(AVFormatContext *s)
-{
-    int i;
-    int64_t j;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st   = s->streams[i];
-        AVIStream *ast = st->priv_data;
-        int n          = st->nb_index_entries;
-        int max        = ast->sample_size;
-        int64_t pos, size, ts;
-
-        if (n != 1 || ast->sample_size == 0)
-            continue;
-
-        while (max < 1024)
-            max += max;
-
-        pos  = st->index_entries[0].pos;
-        size = st->index_entries[0].size;
-        ts   = st->index_entries[0].timestamp;
-
-        for (j = 0; j < size; j += max)
-            av_add_index_entry(st, pos + j, ts + j, FFMIN(max, size - j), 0,
-                               AVINDEX_KEYFRAME);
-    }
-}
-
-static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag,
-                        uint32_t size)
-{
-    AVIOContext *pb = s->pb;
-    char key[5]     = { 0 };
-    char *value;
-
-    size += (size & 1);
-
-    if (size == UINT_MAX)
-        return AVERROR(EINVAL);
-    value = av_malloc(size + 1);
-    if (!value)
-        return AVERROR(ENOMEM);
-    avio_read(pb, value, size);
-    value[size] = 0;
-
-    AV_WL32(key, tag);
-
-    return av_dict_set(st ? &st->metadata : &s->metadata, key, value,
-                       AV_DICT_DONT_STRDUP_VAL);
-}
-
-static const char months[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
-                                    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-
-static void avi_metadata_creation_time(AVDictionary **metadata, char *date)
-{
-    char month[4], time[9], buffer[64];
-    int i, day, year;
-    /* parse standard AVI date format (ie. "Mon Mar 10 15:04:43 2003") */
-    if (sscanf(date, "%*3s%*[ ]%3s%*[ ]%2d%*[ ]%8s%*[ ]%4d",
-               month, &day, time, &year) == 4) {
-        for (i = 0; i < 12; i++)
-            if (!av_strcasecmp(month, months[i])) {
-                snprintf(buffer, sizeof(buffer), "%.4d-%.2d-%.2d %s",
-                         year, i + 1, day, time);
-                av_dict_set(metadata, "creation_time", buffer, 0);
-            }
-    } else if (date[4] == '/' && date[7] == '/') {
-        date[4] = date[7] = '-';
-        av_dict_set(metadata, "creation_time", date, 0);
-    }
-}
-
-static void avi_read_nikon(AVFormatContext *s, uint64_t end)
-{
-    while (avio_tell(s->pb) < end) {
-        uint32_t tag  = avio_rl32(s->pb);
-        uint32_t size = avio_rl32(s->pb);
-        switch (tag) {
-        case MKTAG('n', 'c', 't', 'g'):  /* Nikon Tags */
-        {
-            uint64_t tag_end = avio_tell(s->pb) + size;
-            while (avio_tell(s->pb) < tag_end) {
-                uint16_t tag     = avio_rl16(s->pb);
-                uint16_t size    = avio_rl16(s->pb);
-                const char *name = NULL;
-                char buffer[64]  = { 0 };
-                size -= avio_read(s->pb, buffer,
-                                  FFMIN(size, sizeof(buffer) - 1));
-                switch (tag) {
-                case 0x03:
-                    name = "maker";
-                    break;
-                case 0x04:
-                    name = "model";
-                    break;
-                case 0x13:
-                    name = "creation_time";
-                    if (buffer[4] == ':' && buffer[7] == ':')
-                        buffer[4] = buffer[7] = '-';
-                    break;
-                }
-                if (name)
-                    av_dict_set(&s->metadata, name, buffer, 0);
-                avio_skip(s->pb, size);
-            }
-            break;
-        }
-        default:
-            avio_skip(s->pb, size);
-            break;
-        }
-    }
-}
-
-static int avi_read_header(AVFormatContext *s)
-{
-    AVIContext *avi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned int tag, tag1, handler;
-    int codec_type, stream_index, frame_period;
-    unsigned int size;
-    int i;
-    AVStream *st;
-    AVIStream *ast      = NULL;
-    int avih_width      = 0, avih_height = 0;
-    int amv_file_format = 0;
-    uint64_t list_end   = 0;
-    int ret;
-
-    avi->stream_index = -1;
-
-    ret = get_riff(s, pb);
-    if (ret < 0)
-        return ret;
-
-    avi->fsize = avio_size(pb);
-    if (avi->fsize <= 0)
-        avi->fsize = avi->riff_end == 8 ? INT64_MAX : avi->riff_end;
-
-    /* first list tag */
-    stream_index = -1;
-    codec_type   = -1;
-    frame_period = 0;
-    for (;;) {
-        if (pb->eof_reached)
-            goto fail;
-        tag  = avio_rl32(pb);
-        size = avio_rl32(pb);
-
-        print_tag("tag", tag, size);
-
-        switch (tag) {
-        case MKTAG('L', 'I', 'S', 'T'):
-            list_end = avio_tell(pb) + size;
-            /* Ignored, except at start of video packets. */
-            tag1 = avio_rl32(pb);
-
-            print_tag("list", tag1, 0);
-
-            if (tag1 == MKTAG('m', 'o', 'v', 'i')) {
-                avi->movi_list = avio_tell(pb) - 4;
-                if (size)
-                    avi->movi_end = avi->movi_list + size + (size & 1);
-                else
-                    avi->movi_end = avio_size(pb);
-                av_dlog(NULL, "movi end=%"PRIx64"\n", avi->movi_end);
-                goto end_of_header;
-            } else if (tag1 == MKTAG('I', 'N', 'F', 'O'))
-                ff_read_riff_info(s, size - 4);
-            else if (tag1 == MKTAG('n', 'c', 'd', 't'))
-                avi_read_nikon(s, list_end);
-
-            break;
-        case MKTAG('I', 'D', 'I', 'T'):
-        {
-            unsigned char date[64] = { 0 };
-            size += (size & 1);
-            size -= avio_read(pb, date, FFMIN(size, sizeof(date) - 1));
-            avio_skip(pb, size);
-            avi_metadata_creation_time(&s->metadata, date);
-            break;
-        }
-        case MKTAG('d', 'm', 'l', 'h'):
-            avi->is_odml = 1;
-            avio_skip(pb, size + (size & 1));
-            break;
-        case MKTAG('a', 'm', 'v', 'h'):
-            amv_file_format = 1;
-        case MKTAG('a', 'v', 'i', 'h'):
-            /* AVI header */
-            /* using frame_period is bad idea */
-            frame_period = avio_rl32(pb);
-            avio_skip(pb, 4);
-            avio_rl32(pb);
-            avi->non_interleaved |= avio_rl32(pb) & AVIF_MUSTUSEINDEX;
-
-            avio_skip(pb, 2 * 4);
-            avio_rl32(pb);
-            avio_rl32(pb);
-            avih_width  = avio_rl32(pb);
-            avih_height = avio_rl32(pb);
-
-            avio_skip(pb, size - 10 * 4);
-            break;
-        case MKTAG('s', 't', 'r', 'h'):
-            /* stream header */
-
-            tag1    = avio_rl32(pb);
-            handler = avio_rl32(pb); /* codec tag */
-
-            if (tag1 == MKTAG('p', 'a', 'd', 's')) {
-                avio_skip(pb, size - 8);
-                break;
-            } else {
-                stream_index++;
-                st = avformat_new_stream(s, NULL);
-                if (!st)
-                    goto fail;
-
-                st->id = stream_index;
-                ast    = av_mallocz(sizeof(AVIStream));
-                if (!ast)
-                    goto fail;
-                st->priv_data = ast;
-            }
-            if (amv_file_format)
-                tag1 = stream_index ? MKTAG('a', 'u', 'd', 's')
-                                    : MKTAG('v', 'i', 'd', 's');
-
-            print_tag("strh", tag1, -1);
-
-            if (tag1 == MKTAG('i', 'a', 'v', 's') ||
-                tag1 == MKTAG('i', 'v', 'a', 's')) {
-                int64_t dv_dur;
-
-                /* After some consideration -- I don't think we
-                 * have to support anything but DV in type1 AVIs. */
-                if (s->nb_streams != 1)
-                    goto fail;
-
-                if (handler != MKTAG('d', 'v', 's', 'd') &&
-                    handler != MKTAG('d', 'v', 'h', 'd') &&
-                    handler != MKTAG('d', 'v', 's', 'l'))
-                    goto fail;
-
-                ast = s->streams[0]->priv_data;
-                av_freep(&s->streams[0]->codec->extradata);
-                av_freep(&s->streams[0]->codec);
-                av_freep(&s->streams[0]->info);
-                av_freep(&s->streams[0]);
-                s->nb_streams = 0;
-                if (CONFIG_DV_DEMUXER) {
-                    avi->dv_demux = avpriv_dv_init_demux(s);
-                    if (!avi->dv_demux)
-                        goto fail;
-                } else
-                    goto fail;
-                s->streams[0]->priv_data = ast;
-                avio_skip(pb, 3 * 4);
-                ast->scale = avio_rl32(pb);
-                ast->rate  = avio_rl32(pb);
-                avio_skip(pb, 4);  /* start time */
-
-                dv_dur = avio_rl32(pb);
-                if (ast->scale > 0 && ast->rate > 0 && dv_dur > 0) {
-                    dv_dur     *= AV_TIME_BASE;
-                    s->duration = av_rescale(dv_dur, ast->scale, ast->rate);
-                }
-                /* else, leave duration alone; timing estimation in utils.c
-                 * will make a guess based on bitrate. */
-
-                stream_index = s->nb_streams - 1;
-                avio_skip(pb, size - 9 * 4);
-                break;
-            }
-
-            assert(stream_index < s->nb_streams);
-            st->codec->stream_codec_tag = handler;
-
-            avio_rl32(pb); /* flags */
-            avio_rl16(pb); /* priority */
-            avio_rl16(pb); /* language */
-            avio_rl32(pb); /* initial frame */
-            ast->scale = avio_rl32(pb);
-            ast->rate  = avio_rl32(pb);
-            if (!(ast->scale && ast->rate)) {
-                av_log(s, AV_LOG_WARNING,
-                       "scale/rate is %u/%u which is invalid. "
-                       "(This file has been generated by broken software.)\n",
-                       ast->scale,
-                       ast->rate);
-                if (frame_period) {
-                    ast->rate  = 1000000;
-                    ast->scale = frame_period;
-                } else {
-                    ast->rate  = 25;
-                    ast->scale = 1;
-                }
-            }
-            avpriv_set_pts_info(st, 64, ast->scale, ast->rate);
-
-            ast->cum_len  = avio_rl32(pb); /* start */
-            st->nb_frames = avio_rl32(pb);
-
-            st->start_time = 0;
-            avio_rl32(pb); /* buffer size */
-            avio_rl32(pb); /* quality */
-            ast->sample_size = avio_rl32(pb); /* sample ssize */
-            ast->cum_len    *= FFMAX(1, ast->sample_size);
-            av_dlog(s, "%"PRIu32" %"PRIu32" %d\n",
-                    ast->rate, ast->scale, ast->sample_size);
-
-            switch (tag1) {
-            case MKTAG('v', 'i', 'd', 's'):
-                codec_type = AVMEDIA_TYPE_VIDEO;
-
-                ast->sample_size = 0;
-                break;
-            case MKTAG('a', 'u', 'd', 's'):
-                codec_type = AVMEDIA_TYPE_AUDIO;
-                break;
-            case MKTAG('t', 'x', 't', 's'):
-                codec_type = AVMEDIA_TYPE_SUBTITLE;
-                break;
-            case MKTAG('d', 'a', 't', 's'):
-                codec_type = AVMEDIA_TYPE_DATA;
-                break;
-            default:
-                av_log(s, AV_LOG_ERROR, "unknown stream type %X\n", tag1);
-                goto fail;
-            }
-            if (ast->sample_size == 0)
-                st->duration = st->nb_frames;
-            ast->frame_offset = ast->cum_len;
-            avio_skip(pb, size - 12 * 4);
-            break;
-        case MKTAG('s', 't', 'r', 'f'):
-            /* stream header */
-            if (stream_index >= (unsigned)s->nb_streams || avi->dv_demux) {
-                avio_skip(pb, size);
-            } else {
-                uint64_t cur_pos = avio_tell(pb);
-                if (cur_pos < list_end)
-                    size = FFMIN(size, list_end - cur_pos);
-                st = s->streams[stream_index];
-                switch (codec_type) {
-                case AVMEDIA_TYPE_VIDEO:
-                    if (amv_file_format) {
-                        st->codec->width      = avih_width;
-                        st->codec->height     = avih_height;
-                        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-                        st->codec->codec_id   = AV_CODEC_ID_AMV;
-                        avio_skip(pb, size);
-                        break;
-                    }
-                    tag1 = ff_get_bmp_header(pb, st);
-
-                    if (tag1 == MKTAG('D', 'X', 'S', 'B') ||
-                        tag1 == MKTAG('D', 'X', 'S', 'A')) {
-                        st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-                        st->codec->codec_tag  = tag1;
-                        st->codec->codec_id   = AV_CODEC_ID_XSUB;
-                        break;
-                    }
-
-                    if (size > 10 * 4 && size < (1 << 30)) {
-                        st->codec->extradata_size = size - 10 * 4;
-                        st->codec->extradata      = av_malloc(st->codec->extradata_size +
-                                                              FF_INPUT_BUFFER_PADDING_SIZE);
-                        if (!st->codec->extradata) {
-                            st->codec->extradata_size = 0;
-                            return AVERROR(ENOMEM);
-                        }
-                        avio_read(pb,
-                                  st->codec->extradata,
-                                  st->codec->extradata_size);
-                    }
-
-                    // FIXME: check if the encoder really did this correctly
-                    if (st->codec->extradata_size & 1)
-                        avio_r8(pb);
-
-                    /* Extract palette from extradata if bpp <= 8.
-                     * This code assumes that extradata contains only palette.
-                     * This is true for all paletted codecs implemented in
-                     * Libav. */
-                    if (st->codec->extradata_size &&
-                        (st->codec->bits_per_coded_sample <= 8)) {
-                        int pal_size = (1 << st->codec->bits_per_coded_sample) << 2;
-                        const uint8_t *pal_src;
-
-                        pal_size = FFMIN(pal_size, st->codec->extradata_size);
-                        pal_src  = st->codec->extradata +
-                                   st->codec->extradata_size - pal_size;
-#if HAVE_BIGENDIAN
-                        for (i = 0; i < pal_size / 4; i++)
-                            ast->pal[i] = av_bswap32(((uint32_t *)pal_src)[i]);
-#else
-                        memcpy(ast->pal, pal_src, pal_size);
-#endif
-                        ast->has_pal = 1;
-                    }
-
-                    print_tag("video", tag1, 0);
-
-                    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-                    st->codec->codec_tag  = tag1;
-                    st->codec->codec_id   = ff_codec_get_id(ff_codec_bmp_tags,
-                                                            tag1);
-                    /* This is needed to get the pict type which is necessary
-                     * for generating correct pts. */
-                    st->need_parsing = AVSTREAM_PARSE_HEADERS;
-                    // Support "Resolution 1:1" for Avid AVI Codec
-                    if (tag1 == MKTAG('A', 'V', 'R', 'n') &&
-                        st->codec->extradata_size >= 31   &&
-                        !memcmp(&st->codec->extradata[28], "1:1", 3))
-                        st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
-
-                    if (st->codec->codec_tag == 0 && st->codec->height > 0 &&
-                        st->codec->extradata_size < 1U << 30) {
-                        st->codec->extradata_size += 9;
-                        if ((ret = av_reallocp(&st->codec->extradata,
-                                               st->codec->extradata_size +
-                                               FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
-                            st->codec->extradata_size = 0;
-                            return ret;
-                        } else
-                            memcpy(st->codec->extradata + st->codec->extradata_size - 9,
-                                   "BottomUp", 9);
-                    }
-                    st->codec->height = FFABS(st->codec->height);
-
-//                    avio_skip(pb, size - 5 * 4);
-                    break;
-                case AVMEDIA_TYPE_AUDIO:
-                    ret = ff_get_wav_header(pb, st->codec, size);
-                    if (ret < 0)
-                        return ret;
-                    ast->dshow_block_align = st->codec->block_align;
-                    if (ast->sample_size && st->codec->block_align &&
-                        ast->sample_size != st->codec->block_align) {
-                        av_log(s,
-                               AV_LOG_WARNING,
-                               "sample size (%d) != block align (%d)\n",
-                               ast->sample_size,
-                               st->codec->block_align);
-                        ast->sample_size = st->codec->block_align;
-                    }
-                    /* 2-aligned
-                     * (fix for Stargate SG-1 - 3x18 - Shades of Grey.avi) */
-                    if (size & 1)
-                        avio_skip(pb, 1);
-                    /* Force parsing as several audio frames can be in
-                     * one packet and timestamps refer to packet start. */
-                    st->need_parsing = AVSTREAM_PARSE_TIMESTAMPS;
-                    /* ADTS header is in extradata, AAC without header must be
-                     * stored as exact frames. Parser not needed and it will
-                     * fail. */
-                    if (st->codec->codec_id == AV_CODEC_ID_AAC &&
-                        st->codec->extradata_size)
-                        st->need_parsing = AVSTREAM_PARSE_NONE;
-                    /* AVI files with Xan DPCM audio (wrongly) declare PCM
-                     * audio in the header but have Axan as stream_code_tag. */
-                    if (st->codec->stream_codec_tag == AV_RL32("Axan")) {
-                        st->codec->codec_id  = AV_CODEC_ID_XAN_DPCM;
-                        st->codec->codec_tag = 0;
-                    }
-                    if (amv_file_format) {
-                        st->codec->codec_id    = AV_CODEC_ID_ADPCM_IMA_AMV;
-                        ast->dshow_block_align = 0;
-                    }
-                    break;
-                case AVMEDIA_TYPE_SUBTITLE:
-                    st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-                    st->codec->codec_id   = AV_CODEC_ID_PROBE;
-                    break;
-                default:
-                    st->codec->codec_type = AVMEDIA_TYPE_DATA;
-                    st->codec->codec_id   = AV_CODEC_ID_NONE;
-                    st->codec->codec_tag  = 0;
-                    avio_skip(pb, size);
-                    break;
-                }
-            }
-            break;
-        case MKTAG('i', 'n', 'd', 'x'):
-            i = avio_tell(pb);
-            if (pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) &&
-                read_braindead_odml_indx(s, 0) < 0 &&
-                (s->error_recognition & AV_EF_EXPLODE))
-                goto fail;
-            avio_seek(pb, i + size, SEEK_SET);
-            break;
-        case MKTAG('v', 'p', 'r', 'p'):
-            if (stream_index < (unsigned)s->nb_streams && size > 9 * 4) {
-                AVRational active, active_aspect;
-
-                st = s->streams[stream_index];
-                avio_rl32(pb);
-                avio_rl32(pb);
-                avio_rl32(pb);
-                avio_rl32(pb);
-                avio_rl32(pb);
-
-                active_aspect.den = avio_rl16(pb);
-                active_aspect.num = avio_rl16(pb);
-                active.num        = avio_rl32(pb);
-                active.den        = avio_rl32(pb);
-                avio_rl32(pb); // nbFieldsPerFrame
-
-                if (active_aspect.num && active_aspect.den &&
-                    active.num && active.den) {
-                    st->sample_aspect_ratio = av_div_q(active_aspect, active);
-                    av_dlog(s, "vprp %d/%d %d/%d\n",
-                            active_aspect.num, active_aspect.den,
-                            active.num, active.den);
-                }
-                size -= 9 * 4;
-            }
-            avio_skip(pb, size);
-            break;
-        case MKTAG('s', 't', 'r', 'n'):
-            if (s->nb_streams) {
-                ret = avi_read_tag(s, s->streams[s->nb_streams - 1], tag, size);
-                if (ret < 0)
-                    return ret;
-                break;
-            }
-        default:
-            if (size > 1000000) {
-                av_log(s, AV_LOG_ERROR,
-                       "Something went wrong during header parsing, "
-                       "I will ignore it and try to continue anyway.\n");
-                if (s->error_recognition & AV_EF_EXPLODE)
-                    goto fail;
-                avi->movi_list = avio_tell(pb) - 4;
-                avi->movi_end  = avio_size(pb);
-                goto end_of_header;
-            }
-            /* skip tag */
-            size += (size & 1);
-            avio_skip(pb, size);
-            break;
-        }
-    }
-
-end_of_header:
-    /* check stream number */
-    if (stream_index != s->nb_streams - 1) {
-
-fail:
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!avi->index_loaded && pb->seekable)
-        avi_load_index(s);
-    avi->index_loaded     = 1;
-
-    if ((ret = guess_ni_flag(s)) < 0)
-        return ret;
-
-    avi->non_interleaved |= ret;
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        if (st->nb_index_entries)
-            break;
-    }
-    if (i == s->nb_streams && avi->non_interleaved) {
-        av_log(s, AV_LOG_WARNING,
-               "Non-interleaved AVI without index, switching to interleaved\n");
-        avi->non_interleaved = 0;
-    }
-
-    if (avi->non_interleaved) {
-        av_log(s, AV_LOG_INFO, "non-interleaved AVI\n");
-        clean_index(s);
-    }
-
-    ff_metadata_conv_ctx(s, NULL, avi_metadata_conv);
-    ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv);
-
-    return 0;
-}
-
-static int read_gab2_sub(AVStream *st, AVPacket *pkt)
-{
-    if (pkt->size >= 7 &&
-        !strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data + 5) == 2) {
-        uint8_t desc[256];
-        int score      = AVPROBE_SCORE_EXTENSION, ret;
-        AVIStream *ast = st->priv_data;
-        AVInputFormat *sub_demuxer;
-        AVRational time_base;
-        AVIOContext *pb = avio_alloc_context(pkt->data + 7,
-                                             pkt->size - 7,
-                                             0, NULL, NULL, NULL, NULL);
-        AVProbeData pd;
-        unsigned int desc_len = avio_rl32(pb);
-
-        if (desc_len > pb->buf_end - pb->buf_ptr)
-            goto error;
-
-        ret = avio_get_str16le(pb, desc_len, desc, sizeof(desc));
-        avio_skip(pb, desc_len - ret);
-        if (*desc)
-            av_dict_set(&st->metadata, "title", desc, 0);
-
-        avio_rl16(pb);   /* flags? */
-        avio_rl32(pb);   /* data size */
-
-        pd = (AVProbeData) { .buf      = pb->buf_ptr,
-                             .buf_size = pb->buf_end - pb->buf_ptr };
-        if (!(sub_demuxer = av_probe_input_format2(&pd, 1, &score)))
-            goto error;
-
-        if (!(ast->sub_ctx = avformat_alloc_context()))
-            goto error;
-
-        ast->sub_ctx->pb = pb;
-        if (!avformat_open_input(&ast->sub_ctx, "", sub_demuxer, NULL)) {
-            ff_read_packet(ast->sub_ctx, &ast->sub_pkt);
-            *st->codec = *ast->sub_ctx->streams[0]->codec;
-            ast->sub_ctx->streams[0]->codec->extradata = NULL;
-            time_base = ast->sub_ctx->streams[0]->time_base;
-            avpriv_set_pts_info(st, 64, time_base.num, time_base.den);
-        }
-        ast->sub_buffer = pkt->data;
-        memset(pkt, 0, sizeof(*pkt));
-        return 1;
-
-error:
-        av_freep(&pb);
-    }
-    return 0;
-}
-
-static AVStream *get_subtitle_pkt(AVFormatContext *s, AVStream *next_st,
-                                  AVPacket *pkt)
-{
-    AVIStream *ast, *next_ast = next_st->priv_data;
-    int64_t ts, next_ts, ts_min = INT64_MAX;
-    AVStream *st, *sub_st = NULL;
-    int i;
-
-    next_ts = av_rescale_q(next_ast->frame_offset, next_st->time_base,
-                           AV_TIME_BASE_Q);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        st  = s->streams[i];
-        ast = st->priv_data;
-        if (st->discard < AVDISCARD_ALL && ast && ast->sub_pkt.data) {
-            ts = av_rescale_q(ast->sub_pkt.dts, st->time_base, AV_TIME_BASE_Q);
-            if (ts <= next_ts && ts < ts_min) {
-                ts_min = ts;
-                sub_st = st;
-            }
-        }
-    }
-
-    if (sub_st) {
-        ast               = sub_st->priv_data;
-        *pkt              = ast->sub_pkt;
-        pkt->stream_index = sub_st->index;
-
-        if (ff_read_packet(ast->sub_ctx, &ast->sub_pkt) < 0)
-            ast->sub_pkt.data = NULL;
-    }
-    return sub_st;
-}
-
-static int get_stream_idx(int *d)
-{
-    if (d[0] >= '0' && d[0] <= '9' &&
-        d[1] >= '0' && d[1] <= '9') {
-        return (d[0] - '0') * 10 + (d[1] - '0');
-    } else {
-        return 100; // invalid stream ID
-    }
-}
-
-static int avi_sync(AVFormatContext *s, int exit_early)
-{
-    AVIContext *avi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int n;
-    unsigned int d[8];
-    unsigned int size;
-    int64_t i, sync;
-
-start_sync:
-    memset(d, -1, sizeof(d));
-    for (i = sync = avio_tell(pb); !pb->eof_reached; i++) {
-        int j;
-
-        for (j = 0; j < 7; j++)
-            d[j] = d[j + 1];
-        d[7] = avio_r8(pb);
-
-        size = d[4] + (d[5] << 8) + (d[6] << 16) + (d[7] << 24);
-
-        n = get_stream_idx(d + 2);
-        av_dlog(s, "%X %X %X %X %X %X %X %X %"PRId64" %u %d\n",
-                d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n);
-        if (i + (uint64_t)size > avi->fsize || d[0] > 127)
-            continue;
-
-        // parse ix##
-        if ((d[0] == 'i' && d[1] == 'x' && n < s->nb_streams) ||
-            // parse JUNK
-            (d[0] == 'J' && d[1] == 'U' && d[2] == 'N' && d[3] == 'K') ||
-            (d[0] == 'i' && d[1] == 'd' && d[2] == 'x' && d[3] == '1')) {
-            avio_skip(pb, size);
-            goto start_sync;
-        }
-
-        // parse stray LIST
-        if (d[0] == 'L' && d[1] == 'I' && d[2] == 'S' && d[3] == 'T') {
-            avio_skip(pb, 4);
-            goto start_sync;
-        }
-
-        n = avi->dv_demux ? 0 : get_stream_idx(d);
-
-        if (!((i - avi->last_pkt_pos) & 1) &&
-            get_stream_idx(d + 1) < s->nb_streams)
-            continue;
-
-        // detect ##ix chunk and skip
-        if (d[2] == 'i' && d[3] == 'x' && n < s->nb_streams) {
-            avio_skip(pb, size);
-            goto start_sync;
-        }
-
-        // parse ##dc/##wb
-        if (n < s->nb_streams) {
-            AVStream *st;
-            AVIStream *ast;
-            st  = s->streams[n];
-            ast = st->priv_data;
-
-            if (s->nb_streams >= 2) {
-                AVStream *st1   = s->streams[1];
-                AVIStream *ast1 = st1->priv_data;
-                // workaround for broken small-file-bug402.avi
-                if (d[2] == 'w' && d[3] == 'b' && n == 0 &&
-                    st->codec->codec_type  == AVMEDIA_TYPE_VIDEO &&
-                    st1->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
-                    ast->prefix == 'd' * 256 + 'c' &&
-                    (d[2] * 256 + d[3] == ast1->prefix ||
-                     !ast1->prefix_count)) {
-                    n   = 1;
-                    st  = st1;
-                    ast = ast1;
-                    av_log(s, AV_LOG_WARNING,
-                           "Invalid stream + prefix combination, assuming audio.\n");
-                }
-            }
-
-            if (!avi->dv_demux &&
-                ((st->discard >= AVDISCARD_DEFAULT && size == 0) /* ||
-                 // FIXME: needs a little reordering
-                 (st->discard >= AVDISCARD_NONKEY &&
-                 !(pkt->flags & AV_PKT_FLAG_KEY)) */
-                || st->discard >= AVDISCARD_ALL)) {
-                if (!exit_early) {
-                    ast->frame_offset += get_duration(ast, size);
-                }
-                avio_skip(pb, size);
-                goto start_sync;
-            }
-
-            if (d[2] == 'p' && d[3] == 'c' && size <= 4 * 256 + 4) {
-                int k    = avio_r8(pb);
-                int last = (k + avio_r8(pb) - 1) & 0xFF;
-
-                avio_rl16(pb); // flags
-
-                // b + (g << 8) + (r << 16);
-                for (; k <= last; k++)
-                    ast->pal[k] = avio_rb32(pb) >> 8;
-
-                ast->has_pal = 1;
-                goto start_sync;
-            } else if (((ast->prefix_count < 5 || sync + 9 > i) &&
-                        d[2] < 128 && d[3] < 128) ||
-                       d[2] * 256 + d[3] == ast->prefix /* ||
-                       (d[2] == 'd' && d[3] == 'c') ||
-                       (d[2] == 'w' && d[3] == 'b') */) {
-                if (exit_early)
-                    return 0;
-                if (d[2] * 256 + d[3] == ast->prefix)
-                    ast->prefix_count++;
-                else {
-                    ast->prefix       = d[2] * 256 + d[3];
-                    ast->prefix_count = 0;
-                }
-
-                avi->stream_index = n;
-                ast->packet_size  = size + 8;
-                ast->remaining    = size;
-
-                if (size || !ast->sample_size) {
-                    uint64_t pos = avio_tell(pb) - 8;
-                    if (!st->index_entries || !st->nb_index_entries ||
-                        st->index_entries[st->nb_index_entries - 1].pos < pos) {
-                        av_add_index_entry(st, pos, ast->frame_offset, size,
-                                           0, AVINDEX_KEYFRAME);
-                    }
-                }
-                return 0;
-            }
-        }
-    }
-
-    return AVERROR_EOF;
-}
-
-static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIContext *avi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int err;
-#if FF_API_DESTRUCT_PACKET
-    void *dstr;
-#endif
-
-    if (CONFIG_DV_DEMUXER && avi->dv_demux) {
-        int size = avpriv_dv_get_packet(avi->dv_demux, pkt);
-        if (size >= 0)
-            return size;
-        else
-            goto resync;
-    }
-
-    if (avi->non_interleaved) {
-        int best_stream_index = 0;
-        AVStream *best_st     = NULL;
-        AVIStream *best_ast;
-        int64_t best_ts = INT64_MAX;
-        int i;
-
-        for (i = 0; i < s->nb_streams; i++) {
-            AVStream *st   = s->streams[i];
-            AVIStream *ast = st->priv_data;
-            int64_t ts     = ast->frame_offset;
-            int64_t last_ts;
-
-            if (!st->nb_index_entries)
-                continue;
-
-            last_ts = st->index_entries[st->nb_index_entries - 1].timestamp;
-            if (!ast->remaining && ts > last_ts)
-                continue;
-
-            ts = av_rescale_q(ts, st->time_base,
-                              (AVRational) { FFMAX(1, ast->sample_size),
-                                             AV_TIME_BASE });
-
-            av_dlog(s, "%"PRId64" %d/%d %"PRId64"\n", ts,
-                    st->time_base.num, st->time_base.den, ast->frame_offset);
-            if (ts < best_ts) {
-                best_ts           = ts;
-                best_st           = st;
-                best_stream_index = i;
-            }
-        }
-        if (!best_st)
-            return AVERROR_EOF;
-
-        best_ast = best_st->priv_data;
-        best_ts  = av_rescale_q(best_ts,
-                                (AVRational) { FFMAX(1, best_ast->sample_size),
-                                               AV_TIME_BASE },
-                                best_st->time_base);
-        if (best_ast->remaining) {
-            i = av_index_search_timestamp(best_st,
-                                          best_ts,
-                                          AVSEEK_FLAG_ANY |
-                                          AVSEEK_FLAG_BACKWARD);
-        } else {
-            i = av_index_search_timestamp(best_st, best_ts, AVSEEK_FLAG_ANY);
-            if (i >= 0)
-                best_ast->frame_offset = best_st->index_entries[i].timestamp;
-        }
-
-        if (i >= 0) {
-            int64_t pos = best_st->index_entries[i].pos;
-            pos += best_ast->packet_size - best_ast->remaining;
-            avio_seek(s->pb, pos + 8, SEEK_SET);
-
-            assert(best_ast->remaining <= best_ast->packet_size);
-
-            avi->stream_index = best_stream_index;
-            if (!best_ast->remaining)
-                best_ast->packet_size =
-                best_ast->remaining   = best_st->index_entries[i].size;
-        }
-    }
-
-resync:
-    if (avi->stream_index >= 0) {
-        AVStream *st   = s->streams[avi->stream_index];
-        AVIStream *ast = st->priv_data;
-        int size, err;
-
-        if (get_subtitle_pkt(s, st, pkt))
-            return 0;
-
-        // minorityreport.AVI block_align=1024 sample_size=1 IMA-ADPCM
-        if (ast->sample_size <= 1)
-            size = INT_MAX;
-        else if (ast->sample_size < 32)
-            // arbitrary multiplier to avoid tiny packets for raw PCM data
-            size = 1024 * ast->sample_size;
-        else
-            size = ast->sample_size;
-
-        if (size > ast->remaining)
-            size = ast->remaining;
-        avi->last_pkt_pos = avio_tell(pb);
-        err               = av_get_packet(pb, pkt, size);
-        if (err < 0)
-            return err;
-
-        if (ast->has_pal && pkt->data && pkt->size < (unsigned)INT_MAX / 2) {
-            uint8_t *pal;
-            pal = av_packet_new_side_data(pkt,
-                                          AV_PKT_DATA_PALETTE,
-                                          AVPALETTE_SIZE);
-            if (!pal) {
-                av_log(s, AV_LOG_ERROR,
-                       "Failed to allocate data for palette\n");
-            } else {
-                memcpy(pal, ast->pal, AVPALETTE_SIZE);
-                ast->has_pal = 0;
-            }
-        }
-
-        if (CONFIG_DV_DEMUXER && avi->dv_demux) {
-            AVBufferRef *avbuf = pkt->buf;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-            dstr = pkt->destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-            size = avpriv_dv_produce_packet(avi->dv_demux, pkt,
-                                            pkt->data, pkt->size);
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-            pkt->destruct = dstr;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-            pkt->buf    = avbuf;
-            pkt->flags |= AV_PKT_FLAG_KEY;
-            if (size < 0)
-                av_free_packet(pkt);
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE &&
-                   !st->codec->codec_tag && read_gab2_sub(st, pkt)) {
-            ast->frame_offset++;
-            avi->stream_index = -1;
-            ast->remaining    = 0;
-            goto resync;
-        } else {
-            /* XXX: How to handle B-frames in AVI? */
-            pkt->dts = ast->frame_offset;
-//                pkt->dts += ast->start;
-            if (ast->sample_size)
-                pkt->dts /= ast->sample_size;
-            av_dlog(s,
-                    "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d "
-                    "base:%d st:%d size:%d\n",
-                    pkt->dts,
-                    ast->frame_offset,
-                    ast->scale,
-                    ast->rate,
-                    ast->sample_size,
-                    AV_TIME_BASE,
-                    avi->stream_index,
-                    size);
-            pkt->stream_index = avi->stream_index;
-
-            if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-                AVIndexEntry *e;
-                int index;
-                assert(st->index_entries);
-
-                index = av_index_search_timestamp(st, ast->frame_offset, 0);
-                e     = &st->index_entries[index];
-
-                if (index >= 0 && e->timestamp == ast->frame_offset)
-                    if (e->flags & AVINDEX_KEYFRAME)
-                        pkt->flags |= AV_PKT_FLAG_KEY;
-            } else {
-                pkt->flags |= AV_PKT_FLAG_KEY;
-            }
-            ast->frame_offset += get_duration(ast, pkt->size);
-        }
-        ast->remaining -= err;
-        if (!ast->remaining) {
-            avi->stream_index = -1;
-            ast->packet_size  = 0;
-        }
-
-        return 0;
-    }
-
-    if ((err = avi_sync(s, 0)) < 0)
-        return err;
-    goto resync;
-}
-
-/* XXX: We make the implicit supposition that the positions are sorted
- * for each stream. */
-static int avi_read_idx1(AVFormatContext *s, int size)
-{
-    AVIContext *avi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int nb_index_entries, i;
-    AVStream *st;
-    AVIStream *ast;
-    unsigned int index, tag, flags, pos, len, first_packet = 1;
-    unsigned last_pos = -1;
-    int64_t idx1_pos, first_packet_pos = 0, data_offset = 0;
-
-    nb_index_entries = size / 16;
-    if (nb_index_entries <= 0)
-        return AVERROR_INVALIDDATA;
-
-    idx1_pos = avio_tell(pb);
-    avio_seek(pb, avi->movi_list + 4, SEEK_SET);
-    if (avi_sync(s, 1) == 0)
-        first_packet_pos = avio_tell(pb) - 8;
-    avi->stream_index = -1;
-    avio_seek(pb, idx1_pos, SEEK_SET);
-
-    /* Read the entries and sort them in each stream component. */
-    for (i = 0; i < nb_index_entries; i++) {
-        tag   = avio_rl32(pb);
-        flags = avio_rl32(pb);
-        pos   = avio_rl32(pb);
-        len   = avio_rl32(pb);
-        av_dlog(s, "%d: tag=0x%x flags=0x%x pos=0x%x len=%d/",
-                i, tag, flags, pos, len);
-
-        index  = ((tag      & 0xff) - '0') * 10;
-        index +=  (tag >> 8 & 0xff) - '0';
-        if (index >= s->nb_streams)
-            continue;
-        st  = s->streams[index];
-        ast = st->priv_data;
-
-        if (first_packet && first_packet_pos && len) {
-            data_offset  = first_packet_pos - pos;
-            first_packet = 0;
-        }
-        pos += data_offset;
-
-        av_dlog(s, "%d cum_len=%"PRId64"\n", len, ast->cum_len);
-
-        if (pb->eof_reached)
-            return AVERROR_INVALIDDATA;
-
-        if (last_pos == pos)
-            avi->non_interleaved = 1;
-        else if (len || !ast->sample_size)
-            av_add_index_entry(st, pos, ast->cum_len, len, 0,
-                               (flags & AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0);
-        ast->cum_len += get_duration(ast, len);
-        last_pos      = pos;
-    }
-    return 0;
-}
-
-/* Scan the index and consider any file with streams more than
- * 2 seconds or 64MB apart non-interleaved. */
-static int check_stream_max_drift(AVFormatContext *s)
-{
-    int64_t min_pos, pos;
-    int i;
-    int *idx = av_mallocz_array(s->nb_streams, sizeof(*idx));
-    if (!idx)
-        return AVERROR(ENOMEM);
-
-    for (min_pos = pos = 0; min_pos != INT64_MAX; pos = min_pos + 1LU) {
-        int64_t max_dts = INT64_MIN / 2;
-        int64_t min_dts = INT64_MAX / 2;
-        int64_t max_buffer = 0;
-
-        min_pos = INT64_MAX;
-
-        for (i = 0; i < s->nb_streams; i++) {
-            AVStream *st = s->streams[i];
-            AVIStream *ast = st->priv_data;
-            int n = st->nb_index_entries;
-            while (idx[i] < n && st->index_entries[idx[i]].pos < pos)
-                idx[i]++;
-            if (idx[i] < n) {
-                int64_t dts;
-                dts = av_rescale_q(st->index_entries[idx[i]].timestamp /
-                                   FFMAX(ast->sample_size, 1),
-                                   st->time_base, AV_TIME_BASE_Q);
-                min_dts = FFMIN(min_dts, dts);
-                min_pos = FFMIN(min_pos, st->index_entries[idx[i]].pos);
-            }
-        }
-        for (i = 0; i < s->nb_streams; i++) {
-            AVStream *st = s->streams[i];
-            AVIStream *ast = st->priv_data;
-
-            if (idx[i] && min_dts != INT64_MAX / 2) {
-                int64_t dts;
-                dts = av_rescale_q(st->index_entries[idx[i] - 1].timestamp /
-                                   FFMAX(ast->sample_size, 1),
-                                   st->time_base, AV_TIME_BASE_Q);
-                max_dts = FFMAX(max_dts, dts);
-                max_buffer = FFMAX(max_buffer,
-                                   av_rescale(dts - min_dts,
-                                              st->codec->bit_rate,
-                                              AV_TIME_BASE));
-            }
-        }
-        if (max_dts - min_dts > 2 * AV_TIME_BASE ||
-            max_buffer > 1024 * 1024 * 8 * 8) {
-            av_free(idx);
-            return 1;
-        }
-    }
-    av_free(idx);
-    return 0;
-}
-
-static int guess_ni_flag(AVFormatContext *s)
-{
-    int i;
-    int64_t last_start = 0;
-    int64_t first_end  = INT64_MAX;
-    int64_t oldpos     = avio_tell(s->pb);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        int n        = st->nb_index_entries;
-        unsigned int size;
-
-        if (n <= 0)
-            continue;
-
-        if (n >= 2) {
-            int64_t pos = st->index_entries[0].pos;
-            avio_seek(s->pb, pos + 4, SEEK_SET);
-            size = avio_rl32(s->pb);
-            if (pos + size > st->index_entries[1].pos)
-                last_start = INT64_MAX;
-        }
-
-        if (st->index_entries[0].pos > last_start)
-            last_start = st->index_entries[0].pos;
-        if (st->index_entries[n - 1].pos < first_end)
-            first_end = st->index_entries[n - 1].pos;
-    }
-    avio_seek(s->pb, oldpos, SEEK_SET);
-
-    if (last_start > first_end)
-        return 1;
-
-    return check_stream_max_drift(s);
-}
-
-static int avi_load_index(AVFormatContext *s)
-{
-    AVIContext *avi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    uint32_t tag, size;
-    int64_t pos = avio_tell(pb);
-    int ret     = -1;
-
-    if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0)
-        goto the_end; // maybe truncated file
-    av_dlog(s, "movi_end=0x%"PRIx64"\n", avi->movi_end);
-    for (;;) {
-        if (pb->eof_reached)
-            break;
-        tag  = avio_rl32(pb);
-        size = avio_rl32(pb);
-        av_dlog(s, "tag=%c%c%c%c size=0x%x\n",
-                 tag        & 0xff,
-                (tag >>  8) & 0xff,
-                (tag >> 16) & 0xff,
-                (tag >> 24) & 0xff,
-                size);
-
-        if (tag == MKTAG('i', 'd', 'x', '1') &&
-            avi_read_idx1(s, size) >= 0) {
-            ret = 0;
-            break;
-        }
-
-        size += (size & 1);
-        if (avio_skip(pb, size) < 0)
-            break; // something is wrong here
-    }
-
-the_end:
-    avio_seek(pb, pos, SEEK_SET);
-    return ret;
-}
-
-static void seek_subtitle(AVStream *st, AVStream *st2, int64_t timestamp)
-{
-    AVIStream *ast2 = st2->priv_data;
-    int64_t ts2     = av_rescale_q(timestamp, st->time_base, st2->time_base);
-    av_free_packet(&ast2->sub_pkt);
-    if (avformat_seek_file(ast2->sub_ctx, 0, INT64_MIN, ts2, ts2, 0) >= 0 ||
-        avformat_seek_file(ast2->sub_ctx, 0, ts2, ts2, INT64_MAX, 0) >= 0)
-        ff_read_packet(ast2->sub_ctx, &ast2->sub_pkt);
-}
-
-static int avi_read_seek(AVFormatContext *s, int stream_index,
-                         int64_t timestamp, int flags)
-{
-    AVIContext *avi = s->priv_data;
-    AVStream *st;
-    int i, index;
-    int64_t pos;
-    AVIStream *ast;
-
-    /* Does not matter which stream is requested dv in avi has the
-     * stream information in the first video stream.
-     */
-    if (avi->dv_demux)
-        stream_index = 0;
-
-    if (!avi->index_loaded) {
-        /* we only load the index on demand */
-        avi_load_index(s);
-        avi->index_loaded = 1;
-    }
-
-    st    = s->streams[stream_index];
-    ast   = st->priv_data;
-    index = av_index_search_timestamp(st,
-                                      timestamp * FFMAX(ast->sample_size, 1),
-                                      flags);
-    if (index < 0)
-        return AVERROR_INVALIDDATA;
-
-    /* find the position */
-    pos       = st->index_entries[index].pos;
-    timestamp = st->index_entries[index].timestamp / FFMAX(ast->sample_size, 1);
-
-    av_dlog(s, "XX %"PRId64" %d %"PRId64"\n",
-            timestamp, index, st->index_entries[index].timestamp);
-
-    if (CONFIG_DV_DEMUXER && avi->dv_demux) {
-        /* One and only one real stream for DV in AVI, and it has video  */
-        /* offsets. Calling with other stream indexes should have failed */
-        /* the av_index_search_timestamp call above.                     */
-
-        /* Feed the DV video stream version of the timestamp to the */
-        /* DV demux so it can synthesize correct timestamps.        */
-        ff_dv_offset_reset(avi->dv_demux, timestamp);
-
-        avio_seek(s->pb, pos, SEEK_SET);
-        avi->stream_index = -1;
-        return 0;
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st2   = s->streams[i];
-        AVIStream *ast2 = st2->priv_data;
-
-        ast2->packet_size =
-        ast2->remaining   = 0;
-
-        if (ast2->sub_ctx) {
-            seek_subtitle(st, st2, timestamp);
-            continue;
-        }
-
-        if (st2->nb_index_entries <= 0)
-            continue;
-
-//        assert(st2->codec->block_align);
-        assert((int64_t)st2->time_base.num * ast2->rate ==
-               (int64_t)st2->time_base.den * ast2->scale);
-        index = av_index_search_timestamp(st2,
-                                          av_rescale_q(timestamp,
-                                                       st->time_base,
-                                                       st2->time_base) *
-                                          FFMAX(ast2->sample_size, 1),
-                                          flags | AVSEEK_FLAG_BACKWARD);
-        if (index < 0)
-            index = 0;
-
-        if (!avi->non_interleaved) {
-            while (index > 0 && st2->index_entries[index].pos > pos)
-                index--;
-            while (index + 1 < st2->nb_index_entries &&
-                   st2->index_entries[index].pos < pos)
-                index++;
-        }
-
-        av_dlog(s, "%"PRId64" %d %"PRId64"\n",
-                timestamp, index, st2->index_entries[index].timestamp);
-        /* extract the current frame number */
-        ast2->frame_offset = st2->index_entries[index].timestamp;
-    }
-
-    /* do the seek */
-    avio_seek(s->pb, pos, SEEK_SET);
-    avi->stream_index = -1;
-    return 0;
-}
-
-static int avi_read_close(AVFormatContext *s)
-{
-    int i;
-    AVIContext *avi = s->priv_data;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st   = s->streams[i];
-        AVIStream *ast = st->priv_data;
-        if (ast) {
-            if (ast->sub_ctx) {
-                av_freep(&ast->sub_ctx->pb);
-                avformat_close_input(&ast->sub_ctx);
-            }
-            av_free(ast->sub_buffer);
-            av_free_packet(&ast->sub_pkt);
-        }
-    }
-
-    av_free(avi->dv_demux);
-
-    return 0;
-}
-
-static int avi_probe(AVProbeData *p)
-{
-    int i;
-
-    /* check file header */
-    for (i = 0; avi_headers[i][0]; i++)
-        if (!memcmp(p->buf,     avi_headers[i],     4) &&
-            !memcmp(p->buf + 8, avi_headers[i] + 4, 4))
-            return AVPROBE_SCORE_MAX;
-
-    return 0;
-}
-
-AVInputFormat ff_avi_demuxer = {
-    .name           = "avi",
-    .long_name      = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
-    .priv_data_size = sizeof(AVIContext),
-    .read_probe     = avi_probe,
-    .read_header    = avi_read_header,
-    .read_packet    = avi_read_packet,
-    .read_close     = avi_read_close,
-    .read_seek      = avi_read_seek,
-};
diff --git a/deps/libav/libavformat/avienc.c b/deps/libav/libavformat/avienc.c
deleted file mode 100644
index 0b1d578..0000000
--- a/deps/libav/libavformat/avienc.c
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
- * AVI muxer
- * Copyright (c) 2000 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avformat.h"
-#include "internal.h"
-#include "avi.h"
-#include "avio_internal.h"
-#include "riff.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-
-/*
- * TODO:
- *  - fill all fields if non streamed (nb_frames for example)
- */
-
-typedef struct AVIIentry {
-    unsigned int flags, pos, len;
-} AVIIentry;
-
-#define AVI_INDEX_CLUSTER_SIZE 16384
-
-typedef struct AVIIndex {
-    int64_t     indx_start;
-    int         entry;
-    int         ents_allocated;
-    AVIIentry** cluster;
-} AVIIndex;
-
-typedef struct {
-    int64_t riff_start, movi_list, odml_list;
-    int64_t frames_hdr_all;
-    int riff_id;
-} AVIContext;
-
-typedef struct  {
-    int64_t frames_hdr_strm;
-    int audio_strm_length;
-    int packet_count;
-    int entry;
-
-    AVIIndex indexes;
-} AVIStream ;
-
-static inline AVIIentry* avi_get_ientry(AVIIndex* idx, int ent_id)
-{
-    int cl = ent_id / AVI_INDEX_CLUSTER_SIZE;
-    int id = ent_id % AVI_INDEX_CLUSTER_SIZE;
-    return &idx->cluster[cl][id];
-}
-
-static int64_t avi_start_new_riff(AVFormatContext *s, AVIOContext *pb,
-                                  const char* riff_tag, const char* list_tag)
-{
-    AVIContext *avi= s->priv_data;
-    int64_t loff;
-    int i;
-
-    avi->riff_id++;
-    for (i=0; i<s->nb_streams; i++){
-        AVIStream *avist= s->streams[i]->priv_data;
-        avist->indexes.entry = 0;
-    }
-
-    avi->riff_start = ff_start_tag(pb, "RIFF");
-    ffio_wfourcc(pb, riff_tag);
-    loff = ff_start_tag(pb, "LIST");
-    ffio_wfourcc(pb, list_tag);
-    return loff;
-}
-
-static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type)
-{
-    tag[0] = '0' + index/10;
-    tag[1] = '0' + index%10;
-    if (type == AVMEDIA_TYPE_VIDEO) {
-        tag[2] = 'd';
-        tag[3] = 'c';
-    } else if (type == AVMEDIA_TYPE_SUBTITLE) {
-        // note: this is not an official code
-        tag[2] = 's';
-        tag[3] = 'b';
-    } else {
-        tag[2] = 'w';
-        tag[3] = 'b';
-    }
-    tag[4] = '\0';
-    return tag;
-}
-
-static int avi_write_counters(AVFormatContext* s, int riff_id)
-{
-    AVIOContext *pb = s->pb;
-    AVIContext *avi = s->priv_data;
-    int n, au_byterate, au_ssize, au_scale, nb_frames = 0;
-    int64_t file_size;
-    AVCodecContext* stream;
-
-    file_size = avio_tell(pb);
-    for(n = 0; n < s->nb_streams; n++) {
-        AVIStream *avist= s->streams[n]->priv_data;
-
-        assert(avist->frames_hdr_strm);
-        stream = s->streams[n]->codec;
-        avio_seek(pb, avist->frames_hdr_strm, SEEK_SET);
-        ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
-        if(au_ssize == 0) {
-            avio_wl32(pb, avist->packet_count);
-        } else {
-            avio_wl32(pb, avist->audio_strm_length / au_ssize);
-        }
-        if(stream->codec_type == AVMEDIA_TYPE_VIDEO)
-            nb_frames = FFMAX(nb_frames, avist->packet_count);
-    }
-    if(riff_id == 1) {
-        assert(avi->frames_hdr_all);
-        avio_seek(pb, avi->frames_hdr_all, SEEK_SET);
-        avio_wl32(pb, nb_frames);
-    }
-    avio_seek(pb, file_size, SEEK_SET);
-
-    return 0;
-}
-
-static int avi_write_header(AVFormatContext *s)
-{
-    AVIContext *avi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int bitrate, n, i, nb_frames, au_byterate, au_ssize, au_scale;
-    AVCodecContext *stream, *video_enc;
-    int64_t list1, list2, strh, strf;
-    AVDictionaryEntry *t = NULL;
-
-    if (s->nb_streams > AVI_MAX_STREAM_COUNT) {
-        av_log(s, AV_LOG_ERROR, "AVI does not support >%d streams\n",
-               AVI_MAX_STREAM_COUNT);
-        return -1;
-    }
-
-    for(n=0;n<s->nb_streams;n++) {
-        s->streams[n]->priv_data= av_mallocz(sizeof(AVIStream));
-        if(!s->streams[n]->priv_data)
-            return AVERROR(ENOMEM);
-    }
-
-    /* header list */
-    avi->riff_id = 0;
-    list1 = avi_start_new_riff(s, pb, "AVI ", "hdrl");
-
-    /* avi header */
-    ffio_wfourcc(pb, "avih");
-    avio_wl32(pb, 14 * 4);
-    bitrate = 0;
-
-    video_enc = NULL;
-    for(n=0;n<s->nb_streams;n++) {
-        stream = s->streams[n]->codec;
-        bitrate += stream->bit_rate;
-        if (stream->codec_type == AVMEDIA_TYPE_VIDEO)
-            video_enc = stream;
-    }
-
-    nb_frames = 0;
-
-    if(video_enc){
-        avio_wl32(pb, (uint32_t)(INT64_C(1000000) * video_enc->time_base.num / video_enc->time_base.den));
-    } else {
-        avio_wl32(pb, 0);
-    }
-    avio_wl32(pb, bitrate / 8); /* XXX: not quite exact */
-    avio_wl32(pb, 0); /* padding */
-    if (!pb->seekable)
-        avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_ISINTERLEAVED); /* flags */
-    else
-        avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_HASINDEX | AVIF_ISINTERLEAVED); /* flags */
-    avi->frames_hdr_all = avio_tell(pb); /* remember this offset to fill later */
-    avio_wl32(pb, nb_frames); /* nb frames, filled later */
-    avio_wl32(pb, 0); /* initial frame */
-    avio_wl32(pb, s->nb_streams); /* nb streams */
-    avio_wl32(pb, 1024 * 1024); /* suggested buffer size */
-    if(video_enc){
-        avio_wl32(pb, video_enc->width);
-        avio_wl32(pb, video_enc->height);
-    } else {
-        avio_wl32(pb, 0);
-        avio_wl32(pb, 0);
-    }
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-
-    /* stream list */
-    for(i=0;i<n;i++) {
-        AVIStream *avist= s->streams[i]->priv_data;
-        list2 = ff_start_tag(pb, "LIST");
-        ffio_wfourcc(pb, "strl");
-
-        stream = s->streams[i]->codec;
-
-        /* stream generic header */
-        strh = ff_start_tag(pb, "strh");
-        switch(stream->codec_type) {
-        case AVMEDIA_TYPE_SUBTITLE:
-            // XSUB subtitles behave like video tracks, other subtitles
-            // are not (yet) supported.
-            if (stream->codec_id != AV_CODEC_ID_XSUB) {
-                av_log(s, AV_LOG_ERROR, "Subtitle streams other than DivX XSUB are not supported by the AVI muxer.\n");
-                return AVERROR_PATCHWELCOME;
-            }
-        case AVMEDIA_TYPE_VIDEO: ffio_wfourcc(pb, "vids"); break;
-        case AVMEDIA_TYPE_AUDIO: ffio_wfourcc(pb, "auds"); break;
-//      case AVMEDIA_TYPE_TEXT : ffio_wfourcc(pb, "txts"); break;
-        case AVMEDIA_TYPE_DATA : ffio_wfourcc(pb, "dats"); break;
-        }
-        if(stream->codec_type == AVMEDIA_TYPE_VIDEO ||
-           stream->codec_id == AV_CODEC_ID_XSUB)
-            avio_wl32(pb, stream->codec_tag);
-        else
-            avio_wl32(pb, 1);
-        avio_wl32(pb, 0); /* flags */
-        avio_wl16(pb, 0); /* priority */
-        avio_wl16(pb, 0); /* language */
-        avio_wl32(pb, 0); /* initial frame */
-
-        ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
-
-        avio_wl32(pb, au_scale); /* scale */
-        avio_wl32(pb, au_byterate); /* rate */
-        avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
-
-        avio_wl32(pb, 0); /* start */
-        avist->frames_hdr_strm = avio_tell(pb); /* remember this offset to fill later */
-        if (!pb->seekable)
-            avio_wl32(pb, AVI_MAX_RIFF_SIZE); /* FIXME: this may be broken, but who cares */
-        else
-            avio_wl32(pb, 0); /* length, XXX: filled later */
-
-        /* suggested buffer size */ //FIXME set at the end to largest chunk
-        if(stream->codec_type == AVMEDIA_TYPE_VIDEO)
-            avio_wl32(pb, 1024 * 1024);
-        else if(stream->codec_type == AVMEDIA_TYPE_AUDIO)
-            avio_wl32(pb, 12 * 1024);
-        else
-            avio_wl32(pb, 0);
-        avio_wl32(pb, -1); /* quality */
-        avio_wl32(pb, au_ssize); /* sample size */
-        avio_wl32(pb, 0);
-        avio_wl16(pb, stream->width);
-        avio_wl16(pb, stream->height);
-        ff_end_tag(pb, strh);
-
-      if(stream->codec_type != AVMEDIA_TYPE_DATA){
-        strf = ff_start_tag(pb, "strf");
-        switch(stream->codec_type) {
-        case AVMEDIA_TYPE_SUBTITLE:
-            // XSUB subtitles behave like video tracks, other subtitles
-            // are not (yet) supported.
-            if (stream->codec_id != AV_CODEC_ID_XSUB) break;
-        case AVMEDIA_TYPE_VIDEO:
-            ff_put_bmp_header(pb, stream, ff_codec_bmp_tags, 0);
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            if (ff_put_wav_header(pb, stream) < 0) {
-                return -1;
-            }
-            break;
-        default:
-            return -1;
-        }
-        ff_end_tag(pb, strf);
-        if ((t = av_dict_get(s->streams[i]->metadata, "title", NULL, 0))) {
-            ff_riff_write_info_tag(s->pb, "strn", t->value);
-            t = NULL;
-        }
-      }
-
-        if (pb->seekable) {
-            unsigned char tag[5];
-            int j;
-
-            /* Starting to lay out AVI OpenDML master index.
-             * We want to make it JUNK entry for now, since we'd
-             * like to get away without making AVI an OpenDML one
-             * for compatibility reasons.
-             */
-            avist->indexes.entry = avist->indexes.ents_allocated = 0;
-            avist->indexes.indx_start = ff_start_tag(pb, "JUNK");
-            avio_wl16(pb, 4);        /* wLongsPerEntry */
-            avio_w8(pb, 0);          /* bIndexSubType (0 == frame index) */
-            avio_w8(pb, 0);          /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
-            avio_wl32(pb, 0);        /* nEntriesInUse (will fill out later on) */
-            ffio_wfourcc(pb, avi_stream2fourcc(tag, i, stream->codec_type));
-                                    /* dwChunkId */
-            avio_wl64(pb, 0);        /* dwReserved[3]
-            avio_wl32(pb, 0);           Must be 0.    */
-            for (j=0; j < AVI_MASTER_INDEX_SIZE * 2; j++)
-                 avio_wl64(pb, 0);
-            ff_end_tag(pb, avist->indexes.indx_start);
-        }
-
-        if(   stream->codec_type == AVMEDIA_TYPE_VIDEO
-           && s->streams[i]->sample_aspect_ratio.num>0
-           && s->streams[i]->sample_aspect_ratio.den>0){
-            int vprp= ff_start_tag(pb, "vprp");
-            AVRational dar = av_mul_q(s->streams[i]->sample_aspect_ratio,
-                                      (AVRational){stream->width, stream->height});
-            int num, den;
-            av_reduce(&num, &den, dar.num, dar.den, 0xFFFF);
-
-            avio_wl32(pb, 0); //video format  = unknown
-            avio_wl32(pb, 0); //video standard= unknown
-            avio_wl32(pb, lrintf(1.0/av_q2d(stream->time_base)));
-            avio_wl32(pb, stream->width );
-            avio_wl32(pb, stream->height);
-            avio_wl16(pb, den);
-            avio_wl16(pb, num);
-            avio_wl32(pb, stream->width );
-            avio_wl32(pb, stream->height);
-            avio_wl32(pb, 1); //progressive FIXME
-
-            avio_wl32(pb, stream->height);
-            avio_wl32(pb, stream->width );
-            avio_wl32(pb, stream->height);
-            avio_wl32(pb, stream->width );
-            avio_wl32(pb, 0);
-            avio_wl32(pb, 0);
-
-            avio_wl32(pb, 0);
-            avio_wl32(pb, 0);
-            ff_end_tag(pb, vprp);
-        }
-
-        ff_end_tag(pb, list2);
-    }
-
-    if (pb->seekable) {
-        /* AVI could become an OpenDML one, if it grows beyond 2Gb range */
-        avi->odml_list = ff_start_tag(pb, "JUNK");
-        ffio_wfourcc(pb, "odml");
-        ffio_wfourcc(pb, "dmlh");
-        avio_wl32(pb, 248);
-        for (i = 0; i < 248; i+= 4)
-             avio_wl32(pb, 0);
-        ff_end_tag(pb, avi->odml_list);
-    }
-
-    ff_end_tag(pb, list1);
-
-    ff_riff_write_info(s);
-
-    /* some padding for easier tag editing */
-    list2 = ff_start_tag(pb, "JUNK");
-    for (i = 0; i < 1016; i += 4)
-        avio_wl32(pb, 0);
-    ff_end_tag(pb, list2);
-
-    avi->movi_list = ff_start_tag(pb, "LIST");
-    ffio_wfourcc(pb, "movi");
-
-    avio_flush(pb);
-
-    return 0;
-}
-
-static int avi_write_ix(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVIContext *avi = s->priv_data;
-    char tag[5];
-    char ix_tag[] = "ix00";
-    int i, j;
-
-    assert(pb->seekable);
-
-    if (avi->riff_id > AVI_MASTER_INDEX_SIZE)
-        return -1;
-
-    for (i=0;i<s->nb_streams;i++) {
-        AVIStream *avist= s->streams[i]->priv_data;
-         int64_t ix, pos;
-
-         avi_stream2fourcc(tag, i, s->streams[i]->codec->codec_type);
-         ix_tag[3] = '0' + i;
-
-         /* Writing AVI OpenDML leaf index chunk */
-         ix = avio_tell(pb);
-         ffio_wfourcc(pb, ix_tag);     /* ix?? */
-         avio_wl32(pb, avist->indexes.entry * 8 + 24);
-                                      /* chunk size */
-         avio_wl16(pb, 2);             /* wLongsPerEntry */
-         avio_w8(pb, 0);             /* bIndexSubType (0 == frame index) */
-         avio_w8(pb, 1);             /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
-         avio_wl32(pb, avist->indexes.entry);
-                                      /* nEntriesInUse */
-         ffio_wfourcc(pb, tag);        /* dwChunkId */
-         avio_wl64(pb, avi->movi_list);/* qwBaseOffset */
-         avio_wl32(pb, 0);             /* dwReserved_3 (must be 0) */
-
-         for (j=0; j<avist->indexes.entry; j++) {
-             AVIIentry* ie = avi_get_ientry(&avist->indexes, j);
-             avio_wl32(pb, ie->pos + 8);
-             avio_wl32(pb, ((uint32_t)ie->len & ~0x80000000) |
-                          (ie->flags & 0x10 ? 0 : 0x80000000));
-         }
-         avio_flush(pb);
-         pos = avio_tell(pb);
-
-         /* Updating one entry in the AVI OpenDML master index */
-         avio_seek(pb, avist->indexes.indx_start - 8, SEEK_SET);
-         ffio_wfourcc(pb, "indx");            /* enabling this entry */
-         avio_skip(pb, 8);
-         avio_wl32(pb, avi->riff_id);         /* nEntriesInUse */
-         avio_skip(pb, 16*avi->riff_id);
-         avio_wl64(pb, ix);                   /* qwOffset */
-         avio_wl32(pb, pos - ix);             /* dwSize */
-         avio_wl32(pb, avist->indexes.entry); /* dwDuration */
-
-         avio_seek(pb, pos, SEEK_SET);
-    }
-    return 0;
-}
-
-static int avi_write_idx1(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVIContext *avi = s->priv_data;
-    int64_t idx_chunk;
-    int i;
-    char tag[5];
-
-    if (pb->seekable) {
-        AVIStream *avist;
-        AVIIentry* ie = 0, *tie;
-        int empty, stream_id = -1;
-
-        idx_chunk = ff_start_tag(pb, "idx1");
-        for(i=0; i<s->nb_streams; i++){
-            avist= s->streams[i]->priv_data;
-            avist->entry=0;
-        }
-
-        do {
-            empty = 1;
-            for (i=0; i<s->nb_streams; i++) {
-                avist= s->streams[i]->priv_data;
-                 if (avist->indexes.entry <= avist->entry)
-                     continue;
-
-                 tie = avi_get_ientry(&avist->indexes, avist->entry);
-                 if (empty || tie->pos < ie->pos) {
-                     ie = tie;
-                     stream_id = i;
-                 }
-                 empty = 0;
-            }
-            if (!empty) {
-                avist= s->streams[stream_id]->priv_data;
-                avi_stream2fourcc(tag, stream_id,
-                                  s->streams[stream_id]->codec->codec_type);
-                ffio_wfourcc(pb, tag);
-                avio_wl32(pb, ie->flags);
-                avio_wl32(pb, ie->pos);
-                avio_wl32(pb, ie->len);
-                avist->entry++;
-            }
-        } while (!empty);
-        ff_end_tag(pb, idx_chunk);
-
-        avi_write_counters(s, avi->riff_id);
-    }
-    return 0;
-}
-
-static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIContext *avi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned char tag[5];
-    unsigned int flags=0;
-    const int stream_index= pkt->stream_index;
-    AVIStream *avist= s->streams[stream_index]->priv_data;
-    AVCodecContext *enc= s->streams[stream_index]->codec;
-    int size= pkt->size;
-
-    while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count){
-        AVPacket empty_packet;
-
-        av_init_packet(&empty_packet);
-        empty_packet.size= 0;
-        empty_packet.data= NULL;
-        empty_packet.stream_index= stream_index;
-        avi_write_packet(s, &empty_packet);
-    }
-    avist->packet_count++;
-
-    // Make sure to put an OpenDML chunk when the file size exceeds the limits
-    if (pb->seekable &&
-        (avio_tell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE)) {
-
-        avi_write_ix(s);
-        ff_end_tag(pb, avi->movi_list);
-
-        if (avi->riff_id == 1)
-            avi_write_idx1(s);
-
-        ff_end_tag(pb, avi->riff_start);
-        avi->movi_list = avi_start_new_riff(s, pb, "AVIX", "movi");
-    }
-
-    avi_stream2fourcc(tag, stream_index, enc->codec_type);
-    if(pkt->flags&AV_PKT_FLAG_KEY)
-        flags = 0x10;
-    if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-       avist->audio_strm_length += size;
-    }
-
-    if (s->pb->seekable) {
-        int err;
-        AVIIndex* idx = &avist->indexes;
-        int cl = idx->entry / AVI_INDEX_CLUSTER_SIZE;
-        int id = idx->entry % AVI_INDEX_CLUSTER_SIZE;
-        if (idx->ents_allocated <= idx->entry) {
-            if ((err = av_reallocp(&idx->cluster, (cl + 1) * sizeof(*idx->cluster))) < 0) {
-                idx->ents_allocated = 0;
-                idx->entry = 0;
-                return err;
-            }
-            idx->cluster[cl] = av_malloc(AVI_INDEX_CLUSTER_SIZE*sizeof(AVIIentry));
-            if (!idx->cluster[cl])
-                return -1;
-            idx->ents_allocated += AVI_INDEX_CLUSTER_SIZE;
-        }
-
-        idx->cluster[cl][id].flags = flags;
-        idx->cluster[cl][id].pos = avio_tell(pb) - avi->movi_list;
-        idx->cluster[cl][id].len = size;
-        idx->entry++;
-    }
-
-    avio_write(pb, tag, 4);
-    avio_wl32(pb, size);
-    avio_write(pb, pkt->data, size);
-    if (size & 1)
-        avio_w8(pb, 0);
-
-    return 0;
-}
-
-static int avi_write_trailer(AVFormatContext *s)
-{
-    AVIContext *avi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int res = 0;
-    int i, j, n, nb_frames;
-    int64_t file_size;
-
-    if (pb->seekable){
-        if (avi->riff_id == 1) {
-            ff_end_tag(pb, avi->movi_list);
-            res = avi_write_idx1(s);
-            ff_end_tag(pb, avi->riff_start);
-        } else {
-            avi_write_ix(s);
-            ff_end_tag(pb, avi->movi_list);
-            ff_end_tag(pb, avi->riff_start);
-
-            file_size = avio_tell(pb);
-            avio_seek(pb, avi->odml_list - 8, SEEK_SET);
-            ffio_wfourcc(pb, "LIST"); /* Making this AVI OpenDML one */
-            avio_skip(pb, 16);
-
-            for (n=nb_frames=0;n<s->nb_streams;n++) {
-                AVCodecContext *stream = s->streams[n]->codec;
-                AVIStream *avist= s->streams[n]->priv_data;
-
-                if (stream->codec_type == AVMEDIA_TYPE_VIDEO) {
-                    if (nb_frames < avist->packet_count)
-                        nb_frames = avist->packet_count;
-                } else {
-                    if (stream->codec_id == AV_CODEC_ID_MP2 || stream->codec_id == AV_CODEC_ID_MP3) {
-                        nb_frames += avist->packet_count;
-                    }
-                }
-            }
-            avio_wl32(pb, nb_frames);
-            avio_seek(pb, file_size, SEEK_SET);
-
-            avi_write_counters(s, avi->riff_id);
-        }
-    }
-
-    for (i=0; i<s->nb_streams; i++) {
-         AVIStream *avist= s->streams[i]->priv_data;
-         for (j=0; j<avist->indexes.ents_allocated/AVI_INDEX_CLUSTER_SIZE; j++)
-              av_free(avist->indexes.cluster[j]);
-         av_freep(&avist->indexes.cluster);
-         avist->indexes.ents_allocated = avist->indexes.entry = 0;
-    }
-
-    return res;
-}
-
-AVOutputFormat ff_avi_muxer = {
-    .name              = "avi",
-    .long_name         = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
-    .mime_type         = "video/x-msvideo",
-    .extensions        = "avi",
-    .priv_data_size    = sizeof(AVIContext),
-    .audio_codec       = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_AC3,
-    .video_codec       = AV_CODEC_ID_MPEG4,
-    .write_header      = avi_write_header,
-    .write_packet      = avi_write_packet,
-    .write_trailer     = avi_write_trailer,
-    .codec_tag         = (const AVCodecTag* const []){
-        ff_codec_bmp_tags, ff_codec_wav_tags, 0
-    },
-};
diff --git a/deps/libav/libavformat/avio.c b/deps/libav/libavformat/avio.c
deleted file mode 100644
index fe42974..0000000
--- a/deps/libav/libavformat/avio.c
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * unbuffered I/O
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/dict.h"
-#include "libavutil/opt.h"
-#include "libavutil/time.h"
-#include "os_support.h"
-#include "avformat.h"
-#if CONFIG_NETWORK
-#include "network.h"
-#endif
-#include "url.h"
-
-static URLProtocol *first_protocol = NULL;
-
-URLProtocol *ffurl_protocol_next(URLProtocol *prev)
-{
-    return prev ? prev->next : first_protocol;
-}
-
-/** @name Logging context. */
-/*@{*/
-static const char *urlcontext_to_name(void *ptr)
-{
-    URLContext *h = (URLContext *)ptr;
-    if (h->prot)
-        return h->prot->name;
-    else
-        return "NULL";
-}
-
-static void *urlcontext_child_next(void *obj, void *prev)
-{
-    URLContext *h = obj;
-    if (!prev && h->priv_data && h->prot->priv_data_class)
-        return h->priv_data;
-    return NULL;
-}
-
-static const AVClass *urlcontext_child_class_next(const AVClass *prev)
-{
-    URLProtocol *p = NULL;
-
-    /* find the protocol that corresponds to prev */
-    while (prev && (p = ffurl_protocol_next(p)))
-        if (p->priv_data_class == prev)
-            break;
-
-    /* find next protocol with priv options */
-    while (p = ffurl_protocol_next(p))
-        if (p->priv_data_class)
-            return p->priv_data_class;
-    return NULL;
-}
-
-static const AVOption options[] = { { NULL } };
-const AVClass ffurl_context_class = {
-    .class_name       = "URLContext",
-    .item_name        = urlcontext_to_name,
-    .option           = options,
-    .version          = LIBAVUTIL_VERSION_INT,
-    .child_next       = urlcontext_child_next,
-    .child_class_next = urlcontext_child_class_next,
-};
-/*@}*/
-
-const char *avio_enum_protocols(void **opaque, int output)
-{
-    URLProtocol *p;
-    *opaque = ffurl_protocol_next(*opaque);
-    if (!(p = *opaque))
-        return NULL;
-    if ((output && p->url_write) || (!output && p->url_read))
-        return p->name;
-    return avio_enum_protocols(opaque, output);
-}
-
-int ffurl_register_protocol(URLProtocol *protocol)
-{
-    URLProtocol **p;
-    p = &first_protocol;
-    while (*p != NULL)
-        p = &(*p)->next;
-    *p             = protocol;
-    protocol->next = NULL;
-    return 0;
-}
-
-static int url_alloc_for_protocol(URLContext **puc, struct URLProtocol *up,
-                                  const char *filename, int flags,
-                                  const AVIOInterruptCB *int_cb)
-{
-    URLContext *uc;
-    int err;
-
-#if CONFIG_NETWORK
-    if (up->flags & URL_PROTOCOL_FLAG_NETWORK && !ff_network_init())
-        return AVERROR(EIO);
-#endif
-    uc = av_mallocz(sizeof(URLContext) + strlen(filename) + 1);
-    if (!uc) {
-        err = AVERROR(ENOMEM);
-        goto fail;
-    }
-    uc->av_class = &ffurl_context_class;
-    uc->filename = (char *)&uc[1];
-    strcpy(uc->filename, filename);
-    uc->prot            = up;
-    uc->flags           = flags;
-    uc->is_streamed     = 0; /* default = not streamed */
-    uc->max_packet_size = 0; /* default: stream file */
-    if (up->priv_data_size) {
-        uc->priv_data = av_mallocz(up->priv_data_size);
-        if (!uc->priv_data) {
-            err = AVERROR(ENOMEM);
-            goto fail;
-        }
-        if (up->priv_data_class) {
-            *(const AVClass **)uc->priv_data = up->priv_data_class;
-            av_opt_set_defaults(uc->priv_data);
-        }
-    }
-    if (int_cb)
-        uc->interrupt_callback = *int_cb;
-
-    *puc = uc;
-    return 0;
-fail:
-    *puc = NULL;
-    if (uc)
-        av_freep(&uc->priv_data);
-    av_freep(&uc);
-#if CONFIG_NETWORK
-    if (up->flags & URL_PROTOCOL_FLAG_NETWORK)
-        ff_network_close();
-#endif
-    return err;
-}
-
-int ffurl_connect(URLContext *uc, AVDictionary **options)
-{
-    int err =
-        uc->prot->url_open2 ? uc->prot->url_open2(uc,
-                                                  uc->filename,
-                                                  uc->flags,
-                                                  options) :
-        uc->prot->url_open(uc, uc->filename, uc->flags);
-    if (err)
-        return err;
-    uc->is_connected = 1;
-    /* We must be careful here as ffurl_seek() could be slow,
-     * for example for http */
-    if ((uc->flags & AVIO_FLAG_WRITE) || !strcmp(uc->prot->name, "file"))
-        if (!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0)
-            uc->is_streamed = 1;
-    return 0;
-}
-
-#define URL_SCHEME_CHARS                        \
-    "abcdefghijklmnopqrstuvwxyz"                \
-    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"                \
-    "0123456789+-."
-
-int ffurl_alloc(URLContext **puc, const char *filename, int flags,
-                const AVIOInterruptCB *int_cb)
-{
-    URLProtocol *up = NULL;
-    char proto_str[128], proto_nested[128], *ptr;
-    size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
-
-    if (filename[proto_len] != ':' || is_dos_path(filename))
-        strcpy(proto_str, "file");
-    else
-        av_strlcpy(proto_str, filename,
-                   FFMIN(proto_len + 1, sizeof(proto_str)));
-
-    av_strlcpy(proto_nested, proto_str, sizeof(proto_nested));
-    if ((ptr = strchr(proto_nested, '+')))
-        *ptr = '\0';
-
-    while (up = ffurl_protocol_next(up)) {
-        if (!strcmp(proto_str, up->name))
-            return url_alloc_for_protocol(puc, up, filename, flags, int_cb);
-        if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&
-            !strcmp(proto_nested, up->name))
-            return url_alloc_for_protocol(puc, up, filename, flags, int_cb);
-    }
-    *puc = NULL;
-    return AVERROR_PROTOCOL_NOT_FOUND;
-}
-
-int ffurl_open(URLContext **puc, const char *filename, int flags,
-               const AVIOInterruptCB *int_cb, AVDictionary **options)
-{
-    int ret = ffurl_alloc(puc, filename, flags, int_cb);
-    if (ret)
-        return ret;
-    if (options && (*puc)->prot->priv_data_class &&
-        (ret = av_opt_set_dict((*puc)->priv_data, options)) < 0)
-        goto fail;
-    ret = ffurl_connect(*puc, options);
-    if (!ret)
-        return 0;
-fail:
-    ffurl_close(*puc);
-    *puc = NULL;
-    return ret;
-}
-
-static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf,
-                                         int size, int size_min,
-                                         int (*transfer_func)(URLContext *h,
-                                                              uint8_t *buf,
-                                                              int size))
-{
-    int ret, len;
-    int fast_retries = 5;
-
-    len = 0;
-    while (len < size_min) {
-        ret = transfer_func(h, buf + len, size - len);
-        if (ret == AVERROR(EINTR))
-            continue;
-        if (h->flags & AVIO_FLAG_NONBLOCK)
-            return ret;
-        if (ret == AVERROR(EAGAIN)) {
-            ret = 0;
-            if (fast_retries)
-                fast_retries--;
-            else
-                av_usleep(1000);
-        } else if (ret < 1)
-            return (ret < 0 && ret != AVERROR_EOF) ? ret : len;
-        if (ret)
-            fast_retries = FFMAX(fast_retries, 2);
-        len += ret;
-        if (ff_check_interrupt(&h->interrupt_callback))
-            return AVERROR_EXIT;
-    }
-    return len;
-}
-
-int ffurl_read(URLContext *h, unsigned char *buf, int size)
-{
-    if (!(h->flags & AVIO_FLAG_READ))
-        return AVERROR(EIO);
-    return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read);
-}
-
-int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
-{
-    if (!(h->flags & AVIO_FLAG_READ))
-        return AVERROR(EIO);
-    return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read);
-}
-
-int ffurl_write(URLContext *h, const unsigned char *buf, int size)
-{
-    if (!(h->flags & AVIO_FLAG_WRITE))
-        return AVERROR(EIO);
-    /* avoid sending too big packets */
-    if (h->max_packet_size && size > h->max_packet_size)
-        return AVERROR(EIO);
-
-    return retry_transfer_wrapper(h, buf, size, size, h->prot->url_write);
-}
-
-int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
-{
-    int64_t ret;
-
-    if (!h->prot->url_seek)
-        return AVERROR(ENOSYS);
-    ret = h->prot->url_seek(h, pos, whence & ~AVSEEK_FORCE);
-    return ret;
-}
-
-int ffurl_close(URLContext *h)
-{
-    int ret = 0;
-    if (!h)
-        return 0;     /* can happen when ffurl_open fails */
-
-    if (h->is_connected && h->prot->url_close)
-        ret = h->prot->url_close(h);
-#if CONFIG_NETWORK
-    if (h->prot->flags & URL_PROTOCOL_FLAG_NETWORK)
-        ff_network_close();
-#endif
-    if (h->prot->priv_data_size) {
-        if (h->prot->priv_data_class)
-            av_opt_free(h->priv_data);
-        av_free(h->priv_data);
-    }
-    av_free(h);
-    return ret;
-}
-
-int avio_check(const char *url, int flags)
-{
-    URLContext *h;
-    int ret = ffurl_alloc(&h, url, flags, NULL);
-    if (ret)
-        return ret;
-
-    if (h->prot->url_check) {
-        ret = h->prot->url_check(h, flags);
-    } else {
-        ret = ffurl_connect(h, NULL);
-        if (ret >= 0)
-            ret = flags;
-    }
-
-    ffurl_close(h);
-    return ret;
-}
-
-int64_t ffurl_size(URLContext *h)
-{
-    int64_t pos, size;
-
-    size = ffurl_seek(h, 0, AVSEEK_SIZE);
-    if (size < 0) {
-        pos = ffurl_seek(h, 0, SEEK_CUR);
-        if ((size = ffurl_seek(h, -1, SEEK_END)) < 0)
-            return size;
-        size++;
-        ffurl_seek(h, pos, SEEK_SET);
-    }
-    return size;
-}
-
-int ffurl_get_file_handle(URLContext *h)
-{
-    if (!h->prot->url_get_file_handle)
-        return -1;
-    return h->prot->url_get_file_handle(h);
-}
-
-int ffurl_get_multi_file_handle(URLContext *h, int **handles, int *numhandles)
-{
-    if (!h->prot->url_get_multi_file_handle) {
-        if (!h->prot->url_get_file_handle)
-            return AVERROR(ENOSYS);
-        *handles = av_malloc(sizeof(*handles));
-        if (!*handles)
-            return AVERROR(ENOMEM);
-        *numhandles = 1;
-        *handles[0] = h->prot->url_get_file_handle(h);
-        return 0;
-    }
-    return h->prot->url_get_multi_file_handle(h, handles, numhandles);
-}
-
-int ffurl_shutdown(URLContext *h, int flags)
-{
-    if (!h->prot->url_shutdown)
-        return AVERROR(EINVAL);
-    return h->prot->url_shutdown(h, flags);
-}
-
-int ff_check_interrupt(AVIOInterruptCB *cb)
-{
-    int ret;
-    if (cb && cb->callback && (ret = cb->callback(cb->opaque)))
-        return ret;
-    return 0;
-}
diff --git a/deps/libav/libavformat/avio.h b/deps/libav/libavformat/avio.h
deleted file mode 100644
index 3360e82..0000000
--- a/deps/libav/libavformat/avio.h
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVFORMAT_AVIO_H
-#define AVFORMAT_AVIO_H
-
-/**
- * @file
- * @ingroup lavf_io
- * Buffered I/O operations
- */
-
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "libavutil/dict.h"
-#include "libavutil/log.h"
-
-#include "libavformat/version.h"
-
-
-#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
-
-/**
- * Callback for checking whether to abort blocking functions.
- * AVERROR_EXIT is returned in this case by the interrupted
- * function. During blocking operations, callback is called with
- * opaque as parameter. If the callback returns 1, the
- * blocking operation will be aborted.
- *
- * No members can be added to this struct without a major bump, if
- * new elements have been added after this struct in AVFormatContext
- * or AVIOContext.
- */
-typedef struct AVIOInterruptCB {
-    int (*callback)(void*);
-    void *opaque;
-} AVIOInterruptCB;
-
-/**
- * Bytestream IO Context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVIOContext) must not be used outside libav*.
- *
- * @note None of the function pointers in AVIOContext should be called
- *       directly, they should only be set by the client application
- *       when implementing custom I/O. Normally these are set to the
- *       function pointers specified in avio_alloc_context()
- */
-typedef struct AVIOContext {
-    /**
-     * A class for private options.
-     *
-     * If this AVIOContext is created by avio_open2(), av_class is set and
-     * passes the options down to protocols.
-     *
-     * If this AVIOContext is manually allocated, then av_class may be set by
-     * the caller.
-     *
-     * warning -- this field can be NULL, be sure to not pass this AVIOContext
-     * to any av_opt_* functions in that case.
-     */
-    const AVClass *av_class;
-    unsigned char *buffer;  /**< Start of the buffer. */
-    int buffer_size;        /**< Maximum buffer size */
-    unsigned char *buf_ptr; /**< Current position in the buffer */
-    unsigned char *buf_end; /**< End of the data, may be less than
-                                 buffer+buffer_size if the read function returned
-                                 less data than requested, e.g. for streams where
-                                 no more data has been received yet. */
-    void *opaque;           /**< A private pointer, passed to the read/write/seek/...
-                                 functions. */
-    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int64_t (*seek)(void *opaque, int64_t offset, int whence);
-    int64_t pos;            /**< position in the file of the current buffer */
-    int must_flush;         /**< true if the next seek should flush */
-    int eof_reached;        /**< true if eof reached */
-    int write_flag;         /**< true if open for writing */
-    int max_packet_size;
-    unsigned long checksum;
-    unsigned char *checksum_ptr;
-    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
-    int error;              /**< contains the error code or 0 if no error happened */
-    /**
-     * Pause or resume playback for network streaming protocols - e.g. MMS.
-     */
-    int (*read_pause)(void *opaque, int pause);
-    /**
-     * Seek to a given timestamp in stream with the specified stream_index.
-     * Needed for some network streaming protocols which don't support seeking
-     * to byte position.
-     */
-    int64_t (*read_seek)(void *opaque, int stream_index,
-                         int64_t timestamp, int flags);
-    /**
-     * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
-     */
-    int seekable;
-} AVIOContext;
-
-/* unbuffered I/O */
-
-/**
- * Return AVIO_FLAG_* access flags corresponding to the access permissions
- * of the resource in url, or a negative value corresponding to an
- * AVERROR code in case of failure. The returned access flags are
- * masked by the value in flags.
- *
- * @note This function is intrinsically unsafe, in the sense that the
- * checked resource may change its existence or permission status from
- * one call to another. Thus you should not trust the returned value,
- * unless you are sure that no other processes are accessing the
- * checked resource.
- */
-int avio_check(const char *url, int flags);
-
-/**
- * Allocate and initialize an AVIOContext for buffered I/O. It must be later
- * freed with av_free().
- *
- * @param buffer Memory block for input/output operations via AVIOContext.
- *        The buffer must be allocated with av_malloc() and friends.
- * @param buffer_size The buffer size is very important for performance.
- *        For protocols with fixed blocksize it should be set to this blocksize.
- *        For others a typical size is a cache page, e.g. 4kb.
- * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
- * @param opaque An opaque pointer to user-specific data.
- * @param read_packet  A function for refilling the buffer, may be NULL.
- * @param write_packet A function for writing the buffer contents, may be NULL.
- * @param seek A function for seeking to specified byte position, may be NULL.
- *
- * @return Allocated AVIOContext or NULL on failure.
- */
-AVIOContext *avio_alloc_context(
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
-
-void avio_w8(AVIOContext *s, int b);
-void avio_write(AVIOContext *s, const unsigned char *buf, int size);
-void avio_wl64(AVIOContext *s, uint64_t val);
-void avio_wb64(AVIOContext *s, uint64_t val);
-void avio_wl32(AVIOContext *s, unsigned int val);
-void avio_wb32(AVIOContext *s, unsigned int val);
-void avio_wl24(AVIOContext *s, unsigned int val);
-void avio_wb24(AVIOContext *s, unsigned int val);
-void avio_wl16(AVIOContext *s, unsigned int val);
-void avio_wb16(AVIOContext *s, unsigned int val);
-
-/**
- * Write a NULL-terminated string.
- * @return number of bytes written.
- */
-int avio_put_str(AVIOContext *s, const char *str);
-
-/**
- * Convert an UTF-8 string to UTF-16LE and write it.
- * @return number of bytes written.
- */
-int avio_put_str16le(AVIOContext *s, const char *str);
-
-/**
- * Passing this as the "whence" parameter to a seek function causes it to
- * return the filesize without seeking anywhere. Supporting this is optional.
- * If it is not supported then the seek function will return <0.
- */
-#define AVSEEK_SIZE 0x10000
-
-/**
- * Oring this flag as into the "whence" parameter to a seek function causes it to
- * seek by any means (like reopening and linear reading) or other normally unreasonble
- * means that can be extreemly slow.
- * This may be ignored by the seek code.
- */
-#define AVSEEK_FORCE 0x20000
-
-/**
- * fseek() equivalent for AVIOContext.
- * @return new position or AVERROR.
- */
-int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
-
-/**
- * Skip given number of bytes forward
- * @return new position or AVERROR.
- */
-static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
-{
-    return avio_seek(s, offset, SEEK_CUR);
-}
-
-/**
- * ftell() equivalent for AVIOContext.
- * @return position or AVERROR.
- */
-static av_always_inline int64_t avio_tell(AVIOContext *s)
-{
-    return avio_seek(s, 0, SEEK_CUR);
-}
-
-/**
- * Get the filesize.
- * @return filesize or AVERROR
- */
-int64_t avio_size(AVIOContext *s);
-
-/** @warning currently size is limited */
-int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
-
-void avio_flush(AVIOContext *s);
-
-
-/**
- * Read size bytes from AVIOContext into buf.
- * @return number of bytes read or AVERROR
- */
-int avio_read(AVIOContext *s, unsigned char *buf, int size);
-
-/**
- * @name Functions for reading from AVIOContext
- * @{
- *
- * @note return 0 if EOF, so you cannot use it if EOF handling is
- *       necessary
- */
-int          avio_r8  (AVIOContext *s);
-unsigned int avio_rl16(AVIOContext *s);
-unsigned int avio_rl24(AVIOContext *s);
-unsigned int avio_rl32(AVIOContext *s);
-uint64_t     avio_rl64(AVIOContext *s);
-unsigned int avio_rb16(AVIOContext *s);
-unsigned int avio_rb24(AVIOContext *s);
-unsigned int avio_rb32(AVIOContext *s);
-uint64_t     avio_rb64(AVIOContext *s);
-/**
- * @}
- */
-
-/**
- * Read a string from pb into buf. The reading will terminate when either
- * a NULL character was encountered, maxlen bytes have been read, or nothing
- * more can be read from pb. The result is guaranteed to be NULL-terminated, it
- * will be truncated if buf is too small.
- * Note that the string is not interpreted or validated in any way, it
- * might get truncated in the middle of a sequence for multi-byte encodings.
- *
- * @return number of bytes read (is always <= maxlen).
- * If reading ends on EOF or error, the return value will be one more than
- * bytes actually read.
- */
-int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
-
-/**
- * Read a UTF-16 string from pb and convert it to UTF-8.
- * The reading will terminate when either a null or invalid character was
- * encountered or maxlen bytes have been read.
- * @return number of bytes read (is always <= maxlen)
- */
-int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
-int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
-
-
-/**
- * @name URL open modes
- * The flags argument to avio_open must be one of the following
- * constants, optionally ORed with other flags.
- * @{
- */
-#define AVIO_FLAG_READ  1                                      /**< read-only */
-#define AVIO_FLAG_WRITE 2                                      /**< write-only */
-#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE)  /**< read-write pseudo flag */
-/**
- * @}
- */
-
-/**
- * Use non-blocking mode.
- * If this flag is set, operations on the context will return
- * AVERROR(EAGAIN) if they can not be performed immediately.
- * If this flag is not set, operations on the context will never return
- * AVERROR(EAGAIN).
- * Note that this flag does not affect the opening/connecting of the
- * context. Connecting a protocol will always block if necessary (e.g. on
- * network protocols) but never hang (e.g. on busy devices).
- * Warning: non-blocking protocols is work-in-progress; this flag may be
- * silently ignored.
- */
-#define AVIO_FLAG_NONBLOCK 8
-
-/**
- * Create and initialize a AVIOContext for accessing the
- * resource indicated by url.
- * @note When the resource indicated by url has been opened in
- * read+write mode, the AVIOContext can be used only for writing.
- *
- * @param s Used to return the pointer to the created AVIOContext.
- * In case of failure the pointed to value is set to NULL.
- * @param url resource to access
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int avio_open(AVIOContext **s, const char *url, int flags);
-
-/**
- * Create and initialize a AVIOContext for accessing the
- * resource indicated by url.
- * @note When the resource indicated by url has been opened in
- * read+write mode, the AVIOContext can be used only for writing.
- *
- * @param s Used to return the pointer to the created AVIOContext.
- * In case of failure the pointed to value is set to NULL.
- * @param url resource to access
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @param int_cb an interrupt callback to be used at the protocols level
- * @param options  A dictionary filled with protocol-private options. On return
- * this parameter will be destroyed and replaced with a dict containing options
- * that were not found. May be NULL.
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int avio_open2(AVIOContext **s, const char *url, int flags,
-               const AVIOInterruptCB *int_cb, AVDictionary **options);
-
-/**
- * Close the resource accessed by the AVIOContext s and free it.
- * This function can only be used if s was opened by avio_open().
- *
- * The internal buffer is automatically flushed before closing the
- * resource.
- *
- * @return 0 on success, an AVERROR < 0 on error.
- * @see avio_closep
- */
-int avio_close(AVIOContext *s);
-
-/**
- * Close the resource accessed by the AVIOContext *s, free it
- * and set the pointer pointing to it to NULL.
- * This function can only be used if s was opened by avio_open().
- *
- * The internal buffer is automatically flushed before closing the
- * resource.
- *
- * @return 0 on success, an AVERROR < 0 on error.
- * @see avio_close
- */
-int avio_closep(AVIOContext **s);
-
-
-/**
- * Open a write only memory stream.
- *
- * @param s new IO context
- * @return zero if no error.
- */
-int avio_open_dyn_buf(AVIOContext **s);
-
-/**
- * Return the written size and a pointer to the buffer. The buffer
- * must be freed with av_free().
- * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
- *
- * @param s IO context
- * @param pbuffer pointer to a byte buffer
- * @return the length of the byte buffer
- */
-int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
-
-/**
- * Iterate through names of available protocols.
- *
- * @param opaque A private pointer representing current protocol.
- *        It must be a pointer to NULL on first iteration and will
- *        be updated by successive calls to avio_enum_protocols.
- * @param output If set to 1, iterate over output protocols,
- *               otherwise over input protocols.
- *
- * @return A static string containing the name of current protocol or NULL
- */
-const char *avio_enum_protocols(void **opaque, int output);
-
-/**
- * Pause and resume playing - only meaningful if using a network streaming
- * protocol (e.g. MMS).
- *
- * @param h     IO context from which to call the read_pause function pointer
- * @param pause 1 for pause, 0 for resume
- */
-int     avio_pause(AVIOContext *h, int pause);
-
-/**
- * Seek to a given timestamp relative to some component stream.
- * Only meaningful if using a network streaming protocol (e.g. MMS.).
- *
- * @param h IO context from which to call the seek function pointers
- * @param stream_index The stream index that the timestamp is relative to.
- *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
- *        units from the beginning of the presentation.
- *        If a stream_index >= 0 is used and the protocol does not support
- *        seeking based on component streams, the call will fail with ENOTSUP.
- * @param timestamp timestamp in AVStream.time_base units
- *        or if there is no stream specified then in AV_TIME_BASE units.
- * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
- *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
- *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
- *        fail with ENOTSUP if used and not supported.
- * @return >= 0 on success
- * @see AVInputFormat::read_seek
- */
-int64_t avio_seek_time(AVIOContext *h, int stream_index,
-                       int64_t timestamp, int flags);
-
-#endif /* AVFORMAT_AVIO_H */
diff --git a/deps/libav/libavformat/avio_internal.h b/deps/libav/libavformat/avio_internal.h
deleted file mode 100644
index fdc98ec..0000000
--- a/deps/libav/libavformat/avio_internal.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_AVIO_INTERNAL_H
-#define AVFORMAT_AVIO_INTERNAL_H
-
-#include "avio.h"
-#include "url.h"
-
-#include "libavutil/log.h"
-
-extern const AVClass ffio_url_class;
-
-int ffio_init_context(AVIOContext *s,
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
-
-
-/**
- * Read size bytes from AVIOContext, returning a pointer.
- * Note that the data pointed at by the returned pointer is only
- * valid until the next call that references the same IO context.
- * @param s IO context
- * @param buf pointer to buffer into which to assemble the requested
- *    data if it is not available in contiguous addresses in the
- *    underlying buffer
- * @param size number of bytes requested
- * @param data address at which to store pointer: this will be a
- *    a direct pointer into the underlying buffer if the requested
- *    number of bytes are available at contiguous addresses, otherwise
- *    will be a copy of buf
- * @return number of bytes read or AVERROR
- */
-int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data);
-
-/**
- * Read size bytes from AVIOContext into buf.
- * This reads at most 1 packet. If that is not enough fewer bytes will be
- * returned.
- * @return number of bytes read or AVERROR
- */
-int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size);
-
-void ffio_fill(AVIOContext *s, int b, int count);
-
-static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
-{
-    avio_wl32(pb, MKTAG(s[0], s[1], s[2], s[3]));
-}
-
-/**
- * Rewind the AVIOContext using the specified buffer containing the first buf_size bytes of the file.
- * Used after probing to avoid seeking.
- * Joins buf and s->buffer, taking any overlap into consideration.
- * @note s->buffer must overlap with buf or they can't be joined and the function fails
- *
- * @param s The read-only AVIOContext to rewind
- * @param buf The probe buffer containing the first buf_size bytes of the file
- * @param buf_size The size of buf
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size);
-
-uint64_t ffio_read_varlen(AVIOContext *bc);
-
-/** @warning must be called before any I/O */
-int ffio_set_buf_size(AVIOContext *s, int buf_size);
-
-void ffio_init_checksum(AVIOContext *s,
-                        unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
-                        unsigned long checksum);
-unsigned long ffio_get_checksum(AVIOContext *s);
-unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
-                                    unsigned int len);
-
-/**
- * Open a write only packetized memory stream with a maximum packet
- * size of 'max_packet_size'.  The stream is stored in a memory buffer
- * with a big-endian 4 byte header giving the packet size in bytes.
- *
- * @param s new IO context
- * @param max_packet_size maximum packet size (must be > 0)
- * @return zero if no error.
- */
-int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
-
-/**
- * Create and initialize a AVIOContext for accessing the
- * resource referenced by the URLContext h.
- * @note When the URLContext h has been opened in read+write mode, the
- * AVIOContext can be used only for writing.
- *
- * @param s Used to return the pointer to the created AVIOContext.
- * In case of failure the pointed to value is set to NULL.
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int ffio_fdopen(AVIOContext **s, URLContext *h);
-
-/**
- * Open a write-only fake memory stream. The written data is not stored
- * anywhere - this is only used for measuring the amount of data
- * written.
- *
- * @param s new IO context
- * @return zero if no error.
- */
-int ffio_open_null_buf(AVIOContext **s);
-
-/**
- * Close a null buffer.
- *
- * @param s an IO context opened by ffio_open_null_buf
- * @return the number of bytes written to the null buffer
- */
-int ffio_close_null_buf(AVIOContext *s);
-
-#endif /* AVFORMAT_AVIO_INTERNAL_H */
diff --git a/deps/libav/libavformat/aviobuf.c b/deps/libav/libavformat/aviobuf.c
deleted file mode 100644
index 0024f9e..0000000
--- a/deps/libav/libavformat/aviobuf.c
+++ /dev/null
@@ -1,1018 +0,0 @@
-/*
- * buffered I/O
- * Copyright (c) 2000,2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/crc.h"
-#include "libavutil/dict.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "avformat.h"
-#include "avio.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "url.h"
-#include <stdarg.h>
-
-#define IO_BUFFER_SIZE 32768
-
-/**
- * Do seeks within this distance ahead of the current buffer by skipping
- * data instead of calling the protocol seek function, for seekable
- * protocols.
- */
-#define SHORT_SEEK_THRESHOLD 4096
-
-static void *ffio_url_child_next(void *obj, void *prev)
-{
-    AVIOContext *s = obj;
-    return prev ? NULL : s->opaque;
-}
-
-static const AVClass *ffio_url_child_class_next(const AVClass *prev)
-{
-    return prev ? NULL : &ffurl_context_class;
-}
-
-static const AVOption ffio_url_options[] = {
-    { NULL },
-};
-
-const AVClass ffio_url_class = {
-    .class_name = "AVIOContext",
-    .item_name  = av_default_item_name,
-    .version    = LIBAVUTIL_VERSION_INT,
-    .option     = ffio_url_options,
-    .child_next = ffio_url_child_next,
-    .child_class_next = ffio_url_child_class_next,
-};
-
-static void fill_buffer(AVIOContext *s);
-static int url_resetbuf(AVIOContext *s, int flags);
-
-int ffio_init_context(AVIOContext *s,
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence))
-{
-    s->buffer      = buffer;
-    s->buffer_size = buffer_size;
-    s->buf_ptr     = buffer;
-    s->opaque      = opaque;
-
-    url_resetbuf(s, write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ);
-
-    s->write_packet    = write_packet;
-    s->read_packet     = read_packet;
-    s->seek            = seek;
-    s->pos             = 0;
-    s->must_flush      = 0;
-    s->eof_reached     = 0;
-    s->error           = 0;
-    s->seekable        = seek ? AVIO_SEEKABLE_NORMAL : 0;
-    s->max_packet_size = 0;
-    s->update_checksum = NULL;
-
-    if (!read_packet && !write_flag) {
-        s->pos     = buffer_size;
-        s->buf_end = s->buffer + buffer_size;
-    }
-    s->read_pause = NULL;
-    s->read_seek  = NULL;
-
-    return 0;
-}
-
-AVIOContext *avio_alloc_context(
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence))
-{
-    AVIOContext *s = av_mallocz(sizeof(AVIOContext));
-    if (!s)
-        return NULL;
-    ffio_init_context(s, buffer, buffer_size, write_flag, opaque,
-                  read_packet, write_packet, seek);
-    return s;
-}
-
-static void flush_buffer(AVIOContext *s)
-{
-    if (s->buf_ptr > s->buffer) {
-        if (s->write_packet && !s->error) {
-            int ret = s->write_packet(s->opaque, s->buffer,
-                                      s->buf_ptr - s->buffer);
-            if (ret < 0) {
-                s->error = ret;
-            }
-        }
-        if (s->update_checksum) {
-            s->checksum     = s->update_checksum(s->checksum, s->checksum_ptr,
-                                                 s->buf_ptr - s->checksum_ptr);
-            s->checksum_ptr = s->buffer;
-        }
-        s->pos += s->buf_ptr - s->buffer;
-    }
-    s->buf_ptr = s->buffer;
-}
-
-void avio_w8(AVIOContext *s, int b)
-{
-    *s->buf_ptr++ = b;
-    if (s->buf_ptr >= s->buf_end)
-        flush_buffer(s);
-}
-
-void ffio_fill(AVIOContext *s, int b, int count)
-{
-    while (count > 0) {
-        int len = FFMIN(s->buf_end - s->buf_ptr, count);
-        memset(s->buf_ptr, b, len);
-        s->buf_ptr += len;
-
-        if (s->buf_ptr >= s->buf_end)
-            flush_buffer(s);
-
-        count -= len;
-    }
-}
-
-void avio_write(AVIOContext *s, const unsigned char *buf, int size)
-{
-    while (size > 0) {
-        int len = FFMIN(s->buf_end - s->buf_ptr, size);
-        memcpy(s->buf_ptr, buf, len);
-        s->buf_ptr += len;
-
-        if (s->buf_ptr >= s->buf_end)
-            flush_buffer(s);
-
-        buf += len;
-        size -= len;
-    }
-}
-
-void avio_flush(AVIOContext *s)
-{
-    flush_buffer(s);
-    s->must_flush = 0;
-}
-
-int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
-{
-    int64_t offset1;
-    int64_t pos;
-    int force = whence & AVSEEK_FORCE;
-    whence &= ~AVSEEK_FORCE;
-
-    if(!s)
-        return AVERROR(EINVAL);
-
-    pos = s->pos - (s->write_flag ? 0 : (s->buf_end - s->buffer));
-
-    if (whence != SEEK_CUR && whence != SEEK_SET)
-        return AVERROR(EINVAL);
-
-    if (whence == SEEK_CUR) {
-        offset1 = pos + (s->buf_ptr - s->buffer);
-        if (offset == 0)
-            return offset1;
-        offset += offset1;
-    }
-    offset1 = offset - pos;
-    if (!s->must_flush &&
-        offset1 >= 0 && offset1 <= (s->buf_end - s->buffer)) {
-        /* can do the seek inside the buffer */
-        s->buf_ptr = s->buffer + offset1;
-    } else if ((!s->seekable ||
-               offset1 <= s->buf_end + SHORT_SEEK_THRESHOLD - s->buffer) &&
-               !s->write_flag && offset1 >= 0 &&
-              (whence != SEEK_END || force)) {
-        while(s->pos < offset && !s->eof_reached)
-            fill_buffer(s);
-        if (s->eof_reached)
-            return AVERROR_EOF;
-        s->buf_ptr = s->buf_end + offset - s->pos;
-    } else {
-        int64_t res;
-
-        if (s->write_flag) {
-            flush_buffer(s);
-            s->must_flush = 1;
-        }
-        if (!s->seek)
-            return AVERROR(EPIPE);
-        if ((res = s->seek(s->opaque, offset, SEEK_SET)) < 0)
-            return res;
-        if (!s->write_flag)
-            s->buf_end = s->buffer;
-        s->buf_ptr = s->buffer;
-        s->pos = offset;
-    }
-    s->eof_reached = 0;
-    return offset;
-}
-
-int64_t avio_size(AVIOContext *s)
-{
-    int64_t size;
-
-    if (!s)
-        return AVERROR(EINVAL);
-
-    if (!s->seek)
-        return AVERROR(ENOSYS);
-    size = s->seek(s->opaque, 0, AVSEEK_SIZE);
-    if (size < 0) {
-        if ((size = s->seek(s->opaque, -1, SEEK_END)) < 0)
-            return size;
-        size++;
-        s->seek(s->opaque, s->pos, SEEK_SET);
-    }
-    return size;
-}
-
-void avio_wl32(AVIOContext *s, unsigned int val)
-{
-    avio_w8(s, val);
-    avio_w8(s, val >> 8);
-    avio_w8(s, val >> 16);
-    avio_w8(s, val >> 24);
-}
-
-void avio_wb32(AVIOContext *s, unsigned int val)
-{
-    avio_w8(s, val >> 24);
-    avio_w8(s, val >> 16);
-    avio_w8(s, val >> 8);
-    avio_w8(s, val);
-}
-
-int avio_put_str(AVIOContext *s, const char *str)
-{
-    int len = 1;
-    if (str) {
-        len += strlen(str);
-        avio_write(s, (const unsigned char *) str, len);
-    } else
-        avio_w8(s, 0);
-    return len;
-}
-
-int avio_put_str16le(AVIOContext *s, const char *str)
-{
-    const uint8_t *q = str;
-    int ret = 0;
-
-    while (*q) {
-        uint32_t ch;
-        uint16_t tmp;
-
-        GET_UTF8(ch, *q++, break;)
-        PUT_UTF16(ch, tmp, avio_wl16(s, tmp); ret += 2;)
-    }
-    avio_wl16(s, 0);
-    ret += 2;
-    return ret;
-}
-
-int ff_get_v_length(uint64_t val)
-{
-    int i = 1;
-
-    while (val >>= 7)
-        i++;
-
-    return i;
-}
-
-void ff_put_v(AVIOContext *bc, uint64_t val)
-{
-    int i = ff_get_v_length(val);
-
-    while (--i > 0)
-        avio_w8(bc, 128 | (val >> (7 * i)));
-
-    avio_w8(bc, val & 127);
-}
-
-void avio_wl64(AVIOContext *s, uint64_t val)
-{
-    avio_wl32(s, (uint32_t)(val & 0xffffffff));
-    avio_wl32(s, (uint32_t)(val >> 32));
-}
-
-void avio_wb64(AVIOContext *s, uint64_t val)
-{
-    avio_wb32(s, (uint32_t)(val >> 32));
-    avio_wb32(s, (uint32_t)(val & 0xffffffff));
-}
-
-void avio_wl16(AVIOContext *s, unsigned int val)
-{
-    avio_w8(s, val);
-    avio_w8(s, val >> 8);
-}
-
-void avio_wb16(AVIOContext *s, unsigned int val)
-{
-    avio_w8(s, val >> 8);
-    avio_w8(s, val);
-}
-
-void avio_wl24(AVIOContext *s, unsigned int val)
-{
-    avio_wl16(s, val & 0xffff);
-    avio_w8(s, val >> 16);
-}
-
-void avio_wb24(AVIOContext *s, unsigned int val)
-{
-    avio_wb16(s, val >> 8);
-    avio_w8(s, val);
-}
-
-/* Input stream */
-
-static void fill_buffer(AVIOContext *s)
-{
-    uint8_t *dst        = !s->max_packet_size &&
-                          s->buf_end - s->buffer < s->buffer_size ?
-                          s->buf_end : s->buffer;
-    int len             = s->buffer_size - (dst - s->buffer);
-    int max_buffer_size = s->max_packet_size ?
-                          s->max_packet_size : IO_BUFFER_SIZE;
-
-    /* can't fill the buffer without read_packet, just set EOF if appropriate */
-    if (!s->read_packet && s->buf_ptr >= s->buf_end)
-        s->eof_reached = 1;
-
-    /* no need to do anything if EOF already reached */
-    if (s->eof_reached)
-        return;
-
-    if (s->update_checksum && dst == s->buffer) {
-        if (s->buf_end > s->checksum_ptr)
-            s->checksum = s->update_checksum(s->checksum, s->checksum_ptr,
-                                             s->buf_end - s->checksum_ptr);
-        s->checksum_ptr = s->buffer;
-    }
-
-    /* make buffer smaller in case it ended up large after probing */
-    if (s->buffer_size > max_buffer_size) {
-        ffio_set_buf_size(s, max_buffer_size);
-
-        s->checksum_ptr = dst = s->buffer;
-        len = s->buffer_size;
-    }
-
-    if (s->read_packet)
-        len = s->read_packet(s->opaque, dst, len);
-    else
-        len = 0;
-    if (len <= 0) {
-        /* do not modify buffer if EOF reached so that a seek back can
-           be done without rereading data */
-        s->eof_reached = 1;
-        if (len < 0)
-            s->error = len;
-    } else {
-        s->pos += len;
-        s->buf_ptr = dst;
-        s->buf_end = dst + len;
-    }
-}
-
-unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
-                                    unsigned int len)
-{
-    return av_crc(av_crc_get_table(AV_CRC_32_IEEE), checksum, buf, len);
-}
-
-unsigned long ffio_get_checksum(AVIOContext *s)
-{
-    s->checksum = s->update_checksum(s->checksum, s->checksum_ptr,
-                                     s->buf_ptr - s->checksum_ptr);
-    s->update_checksum = NULL;
-    return s->checksum;
-}
-
-void ffio_init_checksum(AVIOContext *s,
-                   unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
-                   unsigned long checksum)
-{
-    s->update_checksum = update_checksum;
-    if (s->update_checksum) {
-        s->checksum     = checksum;
-        s->checksum_ptr = s->buf_ptr;
-    }
-}
-
-/* XXX: put an inline version */
-int avio_r8(AVIOContext *s)
-{
-    if (s->buf_ptr >= s->buf_end)
-        fill_buffer(s);
-    if (s->buf_ptr < s->buf_end)
-        return *s->buf_ptr++;
-    return 0;
-}
-
-int avio_read(AVIOContext *s, unsigned char *buf, int size)
-{
-    int len, size1;
-
-    size1 = size;
-    while (size > 0) {
-        len = s->buf_end - s->buf_ptr;
-        if (len > size)
-            len = size;
-        if (len == 0 || s->write_flag) {
-            if(size > s->buffer_size && !s->update_checksum){
-                if(s->read_packet)
-                    len = s->read_packet(s->opaque, buf, size);
-                if (len <= 0) {
-                    /* do not modify buffer if EOF reached so that a seek back can
-                    be done without rereading data */
-                    s->eof_reached = 1;
-                    if(len<0)
-                        s->error= len;
-                    break;
-                } else {
-                    s->pos += len;
-                    size -= len;
-                    buf += len;
-                    s->buf_ptr = s->buffer;
-                    s->buf_end = s->buffer/* + len*/;
-                }
-            } else {
-                fill_buffer(s);
-                len = s->buf_end - s->buf_ptr;
-                if (len == 0)
-                    break;
-            }
-        } else {
-            memcpy(buf, s->buf_ptr, len);
-            buf += len;
-            s->buf_ptr += len;
-            size -= len;
-        }
-    }
-    if (size1 == size) {
-        if (s->error)         return s->error;
-        if (s->eof_reached)   return AVERROR_EOF;
-    }
-    return size1 - size;
-}
-
-int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data)
-{
-    if (s->buf_end - s->buf_ptr >= size && !s->write_flag) {
-        *data = s->buf_ptr;
-        s->buf_ptr += size;
-        return size;
-    } else {
-        *data = buf;
-        return avio_read(s, buf, size);
-    }
-}
-
-int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size)
-{
-    int len;
-
-    if (size < 0)
-        return -1;
-
-    if (s->read_packet && s->write_flag) {
-        len = s->read_packet(s->opaque, buf, size);
-        if (len > 0)
-            s->pos += len;
-        return len;
-    }
-
-    len = s->buf_end - s->buf_ptr;
-    if (len == 0) {
-        /* Reset the buf_end pointer to the start of the buffer, to make sure
-         * the fill_buffer call tries to read as much data as fits into the
-         * full buffer, instead of just what space is left after buf_end.
-         * This avoids returning partial packets at the end of the buffer,
-         * for packet based inputs.
-         */
-        s->buf_end = s->buf_ptr = s->buffer;
-        fill_buffer(s);
-        len = s->buf_end - s->buf_ptr;
-    }
-    if (len > size)
-        len = size;
-    memcpy(buf, s->buf_ptr, len);
-    s->buf_ptr += len;
-    if (!len) {
-        if (s->error)         return s->error;
-        if (s->eof_reached)   return AVERROR_EOF;
-    }
-    return len;
-}
-
-unsigned int avio_rl16(AVIOContext *s)
-{
-    unsigned int val;
-    val = avio_r8(s);
-    val |= avio_r8(s) << 8;
-    return val;
-}
-
-unsigned int avio_rl24(AVIOContext *s)
-{
-    unsigned int val;
-    val = avio_rl16(s);
-    val |= avio_r8(s) << 16;
-    return val;
-}
-
-unsigned int avio_rl32(AVIOContext *s)
-{
-    unsigned int val;
-    val = avio_rl16(s);
-    val |= avio_rl16(s) << 16;
-    return val;
-}
-
-uint64_t avio_rl64(AVIOContext *s)
-{
-    uint64_t val;
-    val = (uint64_t)avio_rl32(s);
-    val |= (uint64_t)avio_rl32(s) << 32;
-    return val;
-}
-
-unsigned int avio_rb16(AVIOContext *s)
-{
-    unsigned int val;
-    val = avio_r8(s) << 8;
-    val |= avio_r8(s);
-    return val;
-}
-
-unsigned int avio_rb24(AVIOContext *s)
-{
-    unsigned int val;
-    val = avio_rb16(s) << 8;
-    val |= avio_r8(s);
-    return val;
-}
-unsigned int avio_rb32(AVIOContext *s)
-{
-    unsigned int val;
-    val = avio_rb16(s) << 16;
-    val |= avio_rb16(s);
-    return val;
-}
-
-int ff_get_line(AVIOContext *s, char *buf, int maxlen)
-{
-    int i = 0;
-    char c;
-
-    do {
-        c = avio_r8(s);
-        if (c && i < maxlen-1)
-            buf[i++] = c;
-    } while (c != '\n' && c);
-
-    buf[i] = 0;
-    return i;
-}
-
-int avio_get_str(AVIOContext *s, int maxlen, char *buf, int buflen)
-{
-    int i;
-
-    if (buflen <= 0)
-        return AVERROR(EINVAL);
-    // reserve 1 byte for terminating 0
-    buflen = FFMIN(buflen - 1, maxlen);
-    for (i = 0; i < buflen; i++)
-        if (!(buf[i] = avio_r8(s)))
-            return i + 1;
-    buf[i] = 0;
-    for (; i < maxlen; i++)
-        if (!avio_r8(s))
-            return i + 1;
-    return maxlen;
-}
-
-#define GET_STR16(type, read) \
-    int avio_get_str16 ##type(AVIOContext *pb, int maxlen, char *buf, int buflen)\
-{\
-    char* q = buf;\
-    int ret = 0;\
-    if (buflen <= 0) \
-        return AVERROR(EINVAL); \
-    while (ret + 1 < maxlen) {\
-        uint8_t tmp;\
-        uint32_t ch;\
-        GET_UTF16(ch, (ret += 2) <= maxlen ? read(pb) : 0, break;)\
-        if (!ch)\
-            break;\
-        PUT_UTF8(ch, tmp, if (q - buf < buflen - 1) *q++ = tmp;)\
-    }\
-    *q = 0;\
-    return ret;\
-}\
-
-GET_STR16(le, avio_rl16)
-GET_STR16(be, avio_rb16)
-
-#undef GET_STR16
-
-uint64_t avio_rb64(AVIOContext *s)
-{
-    uint64_t val;
-    val = (uint64_t)avio_rb32(s) << 32;
-    val |= (uint64_t)avio_rb32(s);
-    return val;
-}
-
-uint64_t ffio_read_varlen(AVIOContext *bc){
-    uint64_t val = 0;
-    int tmp;
-
-    do{
-        tmp = avio_r8(bc);
-        val= (val<<7) + (tmp&127);
-    }while(tmp&128);
-    return val;
-}
-
-int ffio_fdopen(AVIOContext **s, URLContext *h)
-{
-    uint8_t *buffer;
-    int buffer_size, max_packet_size;
-
-    max_packet_size = h->max_packet_size;
-    if (max_packet_size) {
-        buffer_size = max_packet_size; /* no need to bufferize more than one packet */
-    } else {
-        buffer_size = IO_BUFFER_SIZE;
-    }
-    buffer = av_malloc(buffer_size);
-    if (!buffer)
-        return AVERROR(ENOMEM);
-
-    *s = avio_alloc_context(buffer, buffer_size, h->flags & AVIO_FLAG_WRITE, h,
-                            ffurl_read, ffurl_write, ffurl_seek);
-    if (!*s) {
-        av_free(buffer);
-        return AVERROR(ENOMEM);
-    }
-    (*s)->seekable = h->is_streamed ? 0 : AVIO_SEEKABLE_NORMAL;
-    (*s)->max_packet_size = max_packet_size;
-    if(h->prot) {
-        (*s)->read_pause = (int (*)(void *, int))h->prot->url_read_pause;
-        (*s)->read_seek  = (int64_t (*)(void *, int, int64_t, int))h->prot->url_read_seek;
-    }
-    (*s)->av_class = &ffio_url_class;
-    return 0;
-}
-
-int ffio_set_buf_size(AVIOContext *s, int buf_size)
-{
-    uint8_t *buffer;
-    buffer = av_malloc(buf_size);
-    if (!buffer)
-        return AVERROR(ENOMEM);
-
-    av_free(s->buffer);
-    s->buffer = buffer;
-    s->buffer_size = buf_size;
-    s->buf_ptr = buffer;
-    url_resetbuf(s, s->write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ);
-    return 0;
-}
-
-static int url_resetbuf(AVIOContext *s, int flags)
-{
-    assert(flags == AVIO_FLAG_WRITE || flags == AVIO_FLAG_READ);
-
-    if (flags & AVIO_FLAG_WRITE) {
-        s->buf_end = s->buffer + s->buffer_size;
-        s->write_flag = 1;
-    } else {
-        s->buf_end = s->buffer;
-        s->write_flag = 0;
-    }
-    return 0;
-}
-
-int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size)
-{
-    int64_t buffer_start;
-    int buffer_size;
-    int overlap, new_size, alloc_size;
-
-    if (s->write_flag)
-        return AVERROR(EINVAL);
-
-    buffer_size = s->buf_end - s->buffer;
-
-    /* the buffers must touch or overlap */
-    if ((buffer_start = s->pos - buffer_size) > buf_size)
-        return AVERROR(EINVAL);
-
-    overlap = buf_size - buffer_start;
-    new_size = buf_size + buffer_size - overlap;
-
-    alloc_size = FFMAX(s->buffer_size, new_size);
-    if (alloc_size > buf_size)
-        if (!(buf = av_realloc(buf, alloc_size)))
-            return AVERROR(ENOMEM);
-
-    if (new_size > buf_size) {
-        memcpy(buf + buf_size, s->buffer + overlap, buffer_size - overlap);
-        buf_size = new_size;
-    }
-
-    av_free(s->buffer);
-    s->buf_ptr = s->buffer = buf;
-    s->buffer_size = alloc_size;
-    s->pos = buf_size;
-    s->buf_end = s->buf_ptr + buf_size;
-    s->eof_reached = 0;
-    s->must_flush = 0;
-
-    return 0;
-}
-
-int avio_open(AVIOContext **s, const char *filename, int flags)
-{
-    return avio_open2(s, filename, flags, NULL, NULL);
-}
-
-int avio_open2(AVIOContext **s, const char *filename, int flags,
-               const AVIOInterruptCB *int_cb, AVDictionary **options)
-{
-    URLContext *h;
-    int err;
-
-    err = ffurl_open(&h, filename, flags, int_cb, options);
-    if (err < 0)
-        return err;
-    err = ffio_fdopen(s, h);
-    if (err < 0) {
-        ffurl_close(h);
-        return err;
-    }
-    return 0;
-}
-
-int avio_close(AVIOContext *s)
-{
-    URLContext *h;
-
-    if (!s)
-        return 0;
-
-    avio_flush(s);
-    h = s->opaque;
-    av_freep(&s->buffer);
-    av_free(s);
-    return ffurl_close(h);
-}
-
-int avio_closep(AVIOContext **s)
-{
-    int ret = avio_close(*s);
-    *s = NULL;
-    return ret;
-}
-
-int avio_printf(AVIOContext *s, const char *fmt, ...)
-{
-    va_list ap;
-    char buf[4096];
-    int ret;
-
-    va_start(ap, fmt);
-    ret = vsnprintf(buf, sizeof(buf), fmt, ap);
-    va_end(ap);
-    avio_write(s, buf, strlen(buf));
-    return ret;
-}
-
-int avio_pause(AVIOContext *s, int pause)
-{
-    if (!s->read_pause)
-        return AVERROR(ENOSYS);
-    return s->read_pause(s->opaque, pause);
-}
-
-int64_t avio_seek_time(AVIOContext *s, int stream_index,
-                       int64_t timestamp, int flags)
-{
-    URLContext *h = s->opaque;
-    int64_t ret;
-    if (!s->read_seek)
-        return AVERROR(ENOSYS);
-    ret = s->read_seek(h, stream_index, timestamp, flags);
-    if (ret >= 0) {
-        int64_t pos;
-        s->buf_ptr = s->buf_end; // Flush buffer
-        pos = s->seek(h, 0, SEEK_CUR);
-        if (pos >= 0)
-            s->pos = pos;
-        else if (pos != AVERROR(ENOSYS))
-            ret = pos;
-    }
-    return ret;
-}
-
-/* output in a dynamic buffer */
-
-typedef struct DynBuffer {
-    int pos, size, allocated_size;
-    uint8_t *buffer;
-    int io_buffer_size;
-    uint8_t io_buffer[1];
-} DynBuffer;
-
-static int dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
-{
-    DynBuffer *d = opaque;
-    unsigned new_size, new_allocated_size;
-
-    /* reallocate buffer if needed */
-    new_size = d->pos + buf_size;
-    new_allocated_size = d->allocated_size;
-    if (new_size < d->pos || new_size > INT_MAX/2)
-        return -1;
-    while (new_size > new_allocated_size) {
-        if (!new_allocated_size)
-            new_allocated_size = new_size;
-        else
-            new_allocated_size += new_allocated_size / 2 + 1;
-    }
-
-    if (new_allocated_size > d->allocated_size) {
-        int err;
-        if ((err = av_reallocp(&d->buffer, new_allocated_size)) < 0) {
-            d->allocated_size = 0;
-            d->size = 0;
-            return err;
-        }
-        d->allocated_size = new_allocated_size;
-    }
-    memcpy(d->buffer + d->pos, buf, buf_size);
-    d->pos = new_size;
-    if (d->pos > d->size)
-        d->size = d->pos;
-    return buf_size;
-}
-
-static int dyn_packet_buf_write(void *opaque, uint8_t *buf, int buf_size)
-{
-    unsigned char buf1[4];
-    int ret;
-
-    /* packetized write: output the header */
-    AV_WB32(buf1, buf_size);
-    ret = dyn_buf_write(opaque, buf1, 4);
-    if (ret < 0)
-        return ret;
-
-    /* then the data */
-    return dyn_buf_write(opaque, buf, buf_size);
-}
-
-static int64_t dyn_buf_seek(void *opaque, int64_t offset, int whence)
-{
-    DynBuffer *d = opaque;
-
-    if (whence == SEEK_CUR)
-        offset += d->pos;
-    else if (whence == SEEK_END)
-        offset += d->size;
-    if (offset < 0 || offset > 0x7fffffffLL)
-        return -1;
-    d->pos = offset;
-    return 0;
-}
-
-static int url_open_dyn_buf_internal(AVIOContext **s, int max_packet_size)
-{
-    DynBuffer *d;
-    unsigned io_buffer_size = max_packet_size ? max_packet_size : 1024;
-
-    if (sizeof(DynBuffer) + io_buffer_size < io_buffer_size)
-        return -1;
-    d = av_mallocz(sizeof(DynBuffer) + io_buffer_size);
-    if (!d)
-        return AVERROR(ENOMEM);
-    d->io_buffer_size = io_buffer_size;
-    *s = avio_alloc_context(d->io_buffer, d->io_buffer_size, 1, d, NULL,
-                            max_packet_size ? dyn_packet_buf_write : dyn_buf_write,
-                            max_packet_size ? NULL : dyn_buf_seek);
-    if(!*s) {
-        av_free(d);
-        return AVERROR(ENOMEM);
-    }
-    (*s)->max_packet_size = max_packet_size;
-    return 0;
-}
-
-int avio_open_dyn_buf(AVIOContext **s)
-{
-    return url_open_dyn_buf_internal(s, 0);
-}
-
-int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
-{
-    if (max_packet_size <= 0)
-        return -1;
-    return url_open_dyn_buf_internal(s, max_packet_size);
-}
-
-int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
-{
-    DynBuffer *d = s->opaque;
-    int size;
-    static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0};
-    int padding = 0;
-
-    if (!s) {
-        *pbuffer = NULL;
-        return 0;
-    }
-
-    /* don't attempt to pad fixed-size packet buffers */
-    if (!s->max_packet_size) {
-        avio_write(s, padbuf, sizeof(padbuf));
-        padding = FF_INPUT_BUFFER_PADDING_SIZE;
-    }
-
-    avio_flush(s);
-
-    *pbuffer = d->buffer;
-    size = d->size;
-    av_free(d);
-    av_free(s);
-    return size - padding;
-}
-
-static int null_buf_write(void *opaque, uint8_t *buf, int buf_size)
-{
-    DynBuffer *d = opaque;
-
-    d->pos += buf_size;
-    if (d->pos > d->size)
-        d->size = d->pos;
-    return buf_size;
-}
-
-int ffio_open_null_buf(AVIOContext **s)
-{
-    int ret = url_open_dyn_buf_internal(s, 0);
-    if (ret >= 0) {
-        AVIOContext *pb = *s;
-        pb->write_packet = null_buf_write;
-    }
-    return ret;
-}
-
-int ffio_close_null_buf(AVIOContext *s)
-{
-    DynBuffer *d = s->opaque;
-    int size;
-
-    avio_flush(s);
-
-    size = d->size;
-    av_free(d);
-    av_free(s);
-    return size;
-}
diff --git a/deps/libav/libavformat/avisynth.c b/deps/libav/libavformat/avisynth.c
deleted file mode 100644
index a8d46a2..0000000
--- a/deps/libav/libavformat/avisynth.c
+++ /dev/null
@@ -1,694 +0,0 @@
-/*
- * AviSynth/AvxSynth support
- * Copyright (c) 2012 AvxSynth Team.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/internal.h"
-#include "libavcodec/internal.h"
-#include "avformat.h"
-#include "internal.h"
-
-/* Enable function pointer definitions for runtime loading. */
-#define AVSC_NO_DECLSPEC
-
-/* Platform-specific directives for AviSynth vs AvxSynth.
- *
- * avisynth_c.h needs to be the one provided with x264, as
- * the one in AviSynth's CVS hasn't been updated to support
- * 2.6's extra colorspaces. A temporary source of that header,
- * installable from a GNU-style Makefile is available from
- * github.com/qyot27/avisynth_headers -- AvxSynth doesn't
- * require this kind of special treatment because like any
- * standard *nix application, it installs its headers
- * alongside its libs. */
-#ifdef _WIN32
-  #include <windows.h>
-  #undef EXTERN_C
-  #include <avisynth/avisynth_c.h>
-  #define AVISYNTH_LIB "avisynth"
-  #define USING_AVISYNTH
-#else
-  #include <dlfcn.h>
-  #include <avxsynth/avxsynth_c.h>
-    #if defined (__APPLE__)
-      #define AVISYNTH_LIB "libavxsynth.dylib"
-    #else
-      #define AVISYNTH_LIB "libavxsynth.so"
-    #endif
-
-  #define LoadLibrary(x) dlopen(x, RTLD_NOW | RTLD_GLOBAL)
-  #define GetProcAddress dlsym
-  #define FreeLibrary dlclose
-#endif
-
-typedef struct AviSynthLibrary {
-    void *library;
-#define AVSC_DECLARE_FUNC(name) name ## _func name
-    AVSC_DECLARE_FUNC(avs_bit_blt);
-    AVSC_DECLARE_FUNC(avs_clip_get_error);
-    AVSC_DECLARE_FUNC(avs_create_script_environment);
-    AVSC_DECLARE_FUNC(avs_delete_script_environment);
-    AVSC_DECLARE_FUNC(avs_get_audio);
-    AVSC_DECLARE_FUNC(avs_get_error);
-    AVSC_DECLARE_FUNC(avs_get_frame);
-    AVSC_DECLARE_FUNC(avs_get_version);
-    AVSC_DECLARE_FUNC(avs_get_video_info);
-    AVSC_DECLARE_FUNC(avs_invoke);
-    AVSC_DECLARE_FUNC(avs_release_clip);
-    AVSC_DECLARE_FUNC(avs_release_value);
-    AVSC_DECLARE_FUNC(avs_release_video_frame);
-    AVSC_DECLARE_FUNC(avs_take_clip);
-#undef AVSC_DECLARE_FUNC
-} AviSynthLibrary;
-
-typedef struct AviSynthContext {
-    AVS_ScriptEnvironment *env;
-    AVS_Clip *clip;
-    const AVS_VideoInfo *vi;
-
-    /* avisynth_read_packet_video() iterates over this. */
-    int n_planes;
-    const int *planes;
-
-    int curr_stream;
-    int curr_frame;
-    int64_t curr_sample;
-
-    int error;
-
-    /* Linked list pointers. */
-    struct AviSynthContext *next;
-} AviSynthContext;
-
-static const int avs_planes_packed[1] = { 0 };
-static const int avs_planes_grey[1]   = { AVS_PLANAR_Y };
-static const int avs_planes_yuv[3]    = { AVS_PLANAR_Y, AVS_PLANAR_U,
-                                          AVS_PLANAR_V };
-
-/* A conflict between C++ global objects, atexit, and dynamic loading requires
- * us to register our own atexit handler to prevent double freeing. */
-static AviSynthLibrary avs_library;
-static int avs_atexit_called        = 0;
-
-/* Linked list of AviSynthContexts. An atexit handler destroys this list. */
-static AviSynthContext *avs_ctx_list = NULL;
-
-static av_cold void avisynth_atexit_handler(void);
-
-static av_cold int avisynth_load_library(void)
-{
-    avs_library.library = LoadLibrary(AVISYNTH_LIB);
-    if (!avs_library.library)
-        return AVERROR_UNKNOWN;
-
-#define LOAD_AVS_FUNC(name, continue_on_fail)                          \
-        avs_library.name =                                             \
-            (void *)GetProcAddress(avs_library.library, #name);        \
-        if (!continue_on_fail && !avs_library.name)                    \
-            goto fail;
-
-    LOAD_AVS_FUNC(avs_bit_blt, 0);
-    LOAD_AVS_FUNC(avs_clip_get_error, 0);
-    LOAD_AVS_FUNC(avs_create_script_environment, 0);
-    LOAD_AVS_FUNC(avs_delete_script_environment, 0);
-    LOAD_AVS_FUNC(avs_get_audio, 0);
-    LOAD_AVS_FUNC(avs_get_error, 1); // New to AviSynth 2.6
-    LOAD_AVS_FUNC(avs_get_frame, 0);
-    LOAD_AVS_FUNC(avs_get_version, 0);
-    LOAD_AVS_FUNC(avs_get_video_info, 0);
-    LOAD_AVS_FUNC(avs_invoke, 0);
-    LOAD_AVS_FUNC(avs_release_clip, 0);
-    LOAD_AVS_FUNC(avs_release_value, 0);
-    LOAD_AVS_FUNC(avs_release_video_frame, 0);
-    LOAD_AVS_FUNC(avs_take_clip, 0);
-#undef LOAD_AVS_FUNC
-
-    atexit(avisynth_atexit_handler);
-    return 0;
-
-fail:
-    FreeLibrary(avs_library.library);
-    return AVERROR_UNKNOWN;
-}
-
-/* Note that avisynth_context_create and avisynth_context_destroy
- * do not allocate or free the actual context! That is taken care of
- * by libavformat. */
-static av_cold int avisynth_context_create(AVFormatContext *s)
-{
-    AviSynthContext *avs = s->priv_data;
-    int ret;
-
-    if (!avs_library.library)
-        if (ret = avisynth_load_library())
-            return ret;
-
-    avs->env = avs_library.avs_create_script_environment(3);
-    if (avs_library.avs_get_error) {
-        const char *error = avs_library.avs_get_error(avs->env);
-        if (error) {
-            av_log(s, AV_LOG_ERROR, "%s\n", error);
-            return AVERROR_UNKNOWN;
-        }
-    }
-
-    if (!avs_ctx_list) {
-        avs_ctx_list = avs;
-    } else {
-        avs->next    = avs_ctx_list;
-        avs_ctx_list = avs;
-    }
-
-    return 0;
-}
-
-static av_cold void avisynth_context_destroy(AviSynthContext *avs)
-{
-    if (avs_atexit_called)
-        return;
-
-    if (avs == avs_ctx_list) {
-        avs_ctx_list = avs->next;
-    } else {
-        AviSynthContext *prev = avs_ctx_list;
-        while (prev->next != avs)
-            prev = prev->next;
-        prev->next = avs->next;
-    }
-
-    if (avs->clip) {
-        avs_library.avs_release_clip(avs->clip);
-        avs->clip = NULL;
-    }
-    if (avs->env) {
-        avs_library.avs_delete_script_environment(avs->env);
-        avs->env = NULL;
-    }
-}
-
-static av_cold void avisynth_atexit_handler(void)
-{
-    AviSynthContext *avs = avs_ctx_list;
-
-    while (avs) {
-        AviSynthContext *next = avs->next;
-        avisynth_context_destroy(avs);
-        avs = next;
-    }
-    FreeLibrary(avs_library.library);
-
-    avs_atexit_called = 1;
-}
-
-/* Create AVStream from audio and video data. */
-static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
-{
-    AviSynthContext *avs = s->priv_data;
-    int planar = 0; // 0: packed, 1: YUV, 2: Y8
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_RAWVIDEO;
-    st->codec->width      = avs->vi->width;
-    st->codec->height     = avs->vi->height;
-
-    st->time_base         = (AVRational) { avs->vi->fps_denominator,
-                                           avs->vi->fps_numerator };
-    st->avg_frame_rate    = (AVRational) { avs->vi->fps_numerator,
-                                           avs->vi->fps_denominator };
-    st->start_time        = 0;
-    st->duration          = avs->vi->num_frames;
-    st->nb_frames         = avs->vi->num_frames;
-
-    switch (avs->vi->pixel_type) {
-#ifdef USING_AVISYNTH
-    case AVS_CS_YV24:
-        st->codec->pix_fmt = AV_PIX_FMT_YUV444P;
-        planar             = 1;
-        break;
-    case AVS_CS_YV16:
-        st->codec->pix_fmt = AV_PIX_FMT_YUV422P;
-        planar             = 1;
-        break;
-    case AVS_CS_YV411:
-        st->codec->pix_fmt = AV_PIX_FMT_YUV411P;
-        planar             = 1;
-        break;
-    case AVS_CS_Y8:
-        st->codec->pix_fmt = AV_PIX_FMT_GRAY8;
-        planar             = 2;
-        break;
-#endif
-    case AVS_CS_BGR24:
-        st->codec->pix_fmt = AV_PIX_FMT_BGR24;
-        break;
-    case AVS_CS_BGR32:
-        st->codec->pix_fmt = AV_PIX_FMT_RGB32;
-        break;
-    case AVS_CS_YUY2:
-        st->codec->pix_fmt = AV_PIX_FMT_YUYV422;
-        break;
-    case AVS_CS_YV12:
-        st->codec->pix_fmt = AV_PIX_FMT_YUV420P;
-        planar             = 1;
-        break;
-    case AVS_CS_I420: // Is this even used anywhere?
-        st->codec->pix_fmt = AV_PIX_FMT_YUV420P;
-        planar             = 1;
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR,
-               "unknown AviSynth colorspace %d\n", avs->vi->pixel_type);
-        avs->error = 1;
-        return AVERROR_UNKNOWN;
-    }
-
-    switch (planar) {
-    case 2: // Y8
-        avs->n_planes = 1;
-        avs->planes   = avs_planes_grey;
-        break;
-    case 1: // YUV
-        avs->n_planes = 3;
-        avs->planes   = avs_planes_yuv;
-        break;
-    default:
-        avs->n_planes = 1;
-        avs->planes   = avs_planes_packed;
-    }
-    return 0;
-}
-
-static int avisynth_create_stream_audio(AVFormatContext *s, AVStream *st)
-{
-    AviSynthContext *avs = s->priv_data;
-
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->sample_rate = avs->vi->audio_samples_per_second;
-    st->codec->channels    = avs->vi->nchannels;
-    st->time_base          = (AVRational) { 1,
-                                            avs->vi->audio_samples_per_second };
-
-    switch (avs->vi->sample_type) {
-    case AVS_SAMPLE_INT8:
-        st->codec->codec_id = AV_CODEC_ID_PCM_U8;
-        break;
-    case AVS_SAMPLE_INT16:
-        st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
-        break;
-    case AVS_SAMPLE_INT24:
-        st->codec->codec_id = AV_CODEC_ID_PCM_S24LE;
-        break;
-    case AVS_SAMPLE_INT32:
-        st->codec->codec_id = AV_CODEC_ID_PCM_S32LE;
-        break;
-    case AVS_SAMPLE_FLOAT:
-        st->codec->codec_id = AV_CODEC_ID_PCM_F32LE;
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR,
-               "unknown AviSynth sample type %d\n", avs->vi->sample_type);
-        avs->error = 1;
-        return AVERROR_UNKNOWN;
-    }
-    return 0;
-}
-
-static int avisynth_create_stream(AVFormatContext *s)
-{
-    AviSynthContext *avs = s->priv_data;
-    AVStream *st;
-    int ret;
-    int id = 0;
-
-    if (avs_has_video(avs->vi)) {
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR_UNKNOWN;
-        st->id = id++;
-        if (ret = avisynth_create_stream_video(s, st))
-            return ret;
-    }
-    if (avs_has_audio(avs->vi)) {
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR_UNKNOWN;
-        st->id = id++;
-        if (ret = avisynth_create_stream_audio(s, st))
-            return ret;
-    }
-    return 0;
-}
-
-static int avisynth_open_file(AVFormatContext *s)
-{
-    AviSynthContext *avs = s->priv_data;
-    AVS_Value arg, val;
-    int ret;
-#ifdef USING_AVISYNTH
-    char filename_ansi[MAX_PATH * 4];
-    wchar_t filename_wc[MAX_PATH * 4];
-#endif
-
-    if (ret = avisynth_context_create(s))
-        return ret;
-
-#ifdef USING_AVISYNTH
-    /* Convert UTF-8 to ANSI code page */
-    MultiByteToWideChar(CP_UTF8, 0, s->filename, -1, filename_wc, MAX_PATH * 4);
-    WideCharToMultiByte(CP_THREAD_ACP, 0, filename_wc, -1, filename_ansi,
-                        MAX_PATH * 4, NULL, NULL);
-    arg = avs_new_value_string(filename_ansi);
-#else
-    arg = avs_new_value_string(s->filename);
-#endif
-    val = avs_library.avs_invoke(avs->env, "Import", arg, 0);
-    if (avs_is_error(val)) {
-        av_log(s, AV_LOG_ERROR, "%s\n", avs_as_error(val));
-        ret = AVERROR_UNKNOWN;
-        goto fail;
-    }
-    if (!avs_is_clip(val)) {
-        av_log(s, AV_LOG_ERROR, "AviSynth script did not return a clip\n");
-        ret = AVERROR_UNKNOWN;
-        goto fail;
-    }
-
-    avs->clip = avs_library.avs_take_clip(val, avs->env);
-    avs->vi   = avs_library.avs_get_video_info(avs->clip);
-
-#ifdef USING_AVISYNTH
-    /* libav only supports AviSynth 2.6 on Windows. Since AvxSynth
-     * identifies itself as interface version 3 like 2.5.8, this
-     * needs to be special-cased. */
-
-    if (avs_library.avs_get_version(avs->clip) == 3) {
-        av_log(s, AV_LOG_ERROR,
-               "AviSynth 2.5.8 not supported. Please upgrade to 2.6.\n");
-        ret = AVERROR_UNKNOWN;
-        goto fail;
-    }
-#endif
-
-    /* Release the AVS_Value as it will go out of scope. */
-    avs_library.avs_release_value(val);
-
-    if (ret = avisynth_create_stream(s))
-        goto fail;
-
-    return 0;
-
-fail:
-    avisynth_context_destroy(avs);
-    return ret;
-}
-
-static void avisynth_next_stream(AVFormatContext *s, AVStream **st,
-                                 AVPacket *pkt, int *discard)
-{
-    AviSynthContext *avs = s->priv_data;
-
-    avs->curr_stream++;
-    avs->curr_stream %= s->nb_streams;
-
-    *st = s->streams[avs->curr_stream];
-    if ((*st)->discard == AVDISCARD_ALL)
-        *discard = 1;
-    else
-        *discard = 0;
-
-    return;
-}
-
-/* Copy AviSynth clip data into an AVPacket. */
-static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt,
-                                      int discard)
-{
-    AviSynthContext *avs = s->priv_data;
-    AVS_VideoFrame *frame;
-    unsigned char *dst_p;
-    const unsigned char *src_p;
-    int n, i, plane, rowsize, planeheight, pitch, bits;
-    const char *error;
-
-    if (avs->curr_frame >= avs->vi->num_frames)
-        return AVERROR_EOF;
-
-    /* This must happen even if the stream is discarded to prevent desync. */
-    n = avs->curr_frame++;
-    if (discard)
-        return 0;
-
-#ifdef USING_AVISYNTH
-    /* Define the bpp values for the new AviSynth 2.6 colorspaces.
-     * Since AvxSynth doesn't have these functions, special-case
-     * it in order to avoid implicit declaration errors. */
-
-    if (avs_is_yv24(avs->vi))
-        bits = 24;
-    else if (avs_is_yv16(avs->vi))
-        bits = 16;
-    else if (avs_is_yv411(avs->vi))
-        bits = 12;
-    else if (avs_is_y8(avs->vi))
-        bits = 8;
-    else
-#endif
-        bits = avs_bits_per_pixel(avs->vi);
-
-    /* Without the cast to int64_t, calculation overflows at about 9k x 9k
-     * resolution. */
-    pkt->size = (((int64_t)avs->vi->width *
-                  (int64_t)avs->vi->height) * bits) / 8;
-    if (!pkt->size)
-        return AVERROR_UNKNOWN;
-
-    if (av_new_packet(pkt, pkt->size) < 0)
-        return AVERROR(ENOMEM);
-
-    pkt->pts      = n;
-    pkt->dts      = n;
-    pkt->duration = 1;
-    pkt->stream_index = avs->curr_stream;
-
-    frame = avs_library.avs_get_frame(avs->clip, n);
-    error = avs_library.avs_clip_get_error(avs->clip);
-    if (error) {
-        av_log(s, AV_LOG_ERROR, "%s\n", error);
-        avs->error = 1;
-        av_packet_unref(pkt);
-        return AVERROR_UNKNOWN;
-    }
-
-    dst_p = pkt->data;
-    for (i = 0; i < avs->n_planes; i++) {
-        plane = avs->planes[i];
-        src_p = avs_get_read_ptr_p(frame, plane);
-        pitch = avs_get_pitch_p(frame, plane);
-
-        rowsize     = avs_get_row_size_p(frame, plane);
-        planeheight = avs_get_height_p(frame, plane);
-
-        /* Flip RGB video. */
-        if (avs_is_rgb24(avs->vi) || avs_is_rgb(avs->vi)) {
-            src_p = src_p + (planeheight - 1) * pitch;
-            pitch = -pitch;
-        }
-
-        avs_library.avs_bit_blt(avs->env, dst_p, rowsize, src_p, pitch,
-                                 rowsize, planeheight);
-        dst_p += rowsize * planeheight;
-    }
-
-    avs_library.avs_release_video_frame(frame);
-    return 0;
-}
-
-static int avisynth_read_packet_audio(AVFormatContext *s, AVPacket *pkt,
-                                      int discard)
-{
-    AviSynthContext *avs = s->priv_data;
-    AVRational fps, samplerate;
-    int samples;
-    int64_t n;
-    const char *error;
-
-    if (avs->curr_sample >= avs->vi->num_audio_samples)
-        return AVERROR_EOF;
-
-    fps.num        = avs->vi->fps_numerator;
-    fps.den        = avs->vi->fps_denominator;
-    samplerate.num = avs->vi->audio_samples_per_second;
-    samplerate.den = 1;
-
-    if (avs_has_video(avs->vi)) {
-        if (avs->curr_frame < avs->vi->num_frames)
-            samples = av_rescale_q(avs->curr_frame, samplerate, fps) -
-                      avs->curr_sample;
-        else
-            samples = av_rescale_q(1, samplerate, fps);
-    } else {
-        samples = 1000;
-    }
-
-    /* After seeking, audio may catch up with video. */
-    if (samples <= 0) {
-        pkt->size = 0;
-        pkt->data = NULL;
-        return 0;
-    }
-
-    if (avs->curr_sample + samples > avs->vi->num_audio_samples)
-        samples = avs->vi->num_audio_samples - avs->curr_sample;
-
-    /* This must happen even if the stream is discarded to prevent desync. */
-    n                 = avs->curr_sample;
-    avs->curr_sample += samples;
-    if (discard)
-        return 0;
-
-    pkt->size = avs_bytes_per_channel_sample(avs->vi) *
-                samples * avs->vi->nchannels;
-    if (!pkt->size)
-        return AVERROR_UNKNOWN;
-
-    if (av_new_packet(pkt, pkt->size) < 0)
-        return AVERROR(ENOMEM);
-
-    pkt->pts      = n;
-    pkt->dts      = n;
-    pkt->duration = samples;
-    pkt->stream_index = avs->curr_stream;
-
-    avs_library.avs_get_audio(avs->clip, pkt->data, n, samples);
-    error = avs_library.avs_clip_get_error(avs->clip);
-    if (error) {
-        av_log(s, AV_LOG_ERROR, "%s\n", error);
-        avs->error = 1;
-        av_packet_unref(pkt);
-        return AVERROR_UNKNOWN;
-    }
-    return 0;
-}
-
-static av_cold int avisynth_read_header(AVFormatContext *s)
-{
-    int ret;
-
-    // Calling library must implement a lock for thread-safe opens.
-    if (ret = avpriv_lock_avformat())
-        return ret;
-
-    if (ret = avisynth_open_file(s)) {
-        avpriv_unlock_avformat();
-        return ret;
-    }
-
-    avpriv_unlock_avformat();
-    return 0;
-}
-
-static int avisynth_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AviSynthContext *avs = s->priv_data;
-    AVStream *st;
-    int discard = 0;
-    int ret;
-
-    if (avs->error)
-        return AVERROR_UNKNOWN;
-
-    /* If either stream reaches EOF, try to read the other one before
-     * giving up. */
-    avisynth_next_stream(s, &st, pkt, &discard);
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        ret = avisynth_read_packet_video(s, pkt, discard);
-        if (ret == AVERROR_EOF && avs_has_audio(avs->vi)) {
-            avisynth_next_stream(s, &st, pkt, &discard);
-            return avisynth_read_packet_audio(s, pkt, discard);
-        }
-    } else {
-        ret = avisynth_read_packet_audio(s, pkt, discard);
-        if (ret == AVERROR_EOF && avs_has_video(avs->vi)) {
-            avisynth_next_stream(s, &st, pkt, &discard);
-            return avisynth_read_packet_video(s, pkt, discard);
-        }
-    }
-
-    return ret;
-}
-
-static av_cold int avisynth_read_close(AVFormatContext *s)
-{
-    if (avpriv_lock_avformat())
-        return AVERROR_UNKNOWN;
-
-    avisynth_context_destroy(s->priv_data);
-    avpriv_unlock_avformat();
-    return 0;
-}
-
-static int avisynth_read_seek(AVFormatContext *s, int stream_index,
-                              int64_t timestamp, int flags)
-{
-    AviSynthContext *avs = s->priv_data;
-    AVStream *st;
-    AVRational fps, samplerate;
-
-    if (avs->error)
-        return AVERROR_UNKNOWN;
-
-    fps        = (AVRational) { avs->vi->fps_numerator,
-                                avs->vi->fps_denominator };
-    samplerate = (AVRational) { avs->vi->audio_samples_per_second, 1 };
-
-    st = s->streams[stream_index];
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        /* AviSynth frame counts are signed int. */
-        if ((timestamp >= avs->vi->num_frames) ||
-            (timestamp > INT_MAX)              ||
-            (timestamp < 0))
-            return AVERROR_EOF;
-        avs->curr_frame = timestamp;
-        if (avs_has_audio(avs->vi))
-            avs->curr_sample = av_rescale_q(timestamp, samplerate, fps);
-    } else {
-        if ((timestamp >= avs->vi->num_audio_samples) || (timestamp < 0))
-            return AVERROR_EOF;
-        /* Force frame granularity for seeking. */
-        if (avs_has_video(avs->vi)) {
-            avs->curr_frame  = av_rescale_q(timestamp, fps, samplerate);
-            avs->curr_sample = av_rescale_q(avs->curr_frame, samplerate, fps);
-        } else {
-            avs->curr_sample = timestamp;
-        }
-    }
-
-    return 0;
-}
-
-AVInputFormat ff_avisynth_demuxer = {
-    .name           = "avisynth",
-    .long_name      = NULL_IF_CONFIG_SMALL("AviSynth script"),
-    .priv_data_size = sizeof(AviSynthContext),
-    .read_header    = avisynth_read_header,
-    .read_packet    = avisynth_read_packet,
-    .read_close     = avisynth_read_close,
-    .read_seek      = avisynth_read_seek,
-    .extensions     = "avs",
-};
diff --git a/deps/libav/libavformat/avlanguage.c b/deps/libav/libavformat/avlanguage.c
deleted file mode 100644
index e606ef2..0000000
--- a/deps/libav/libavformat/avlanguage.c
+++ /dev/null
@@ -1,765 +0,0 @@
-/*
- * Cyril Comparon, Larbi Joubala, Resonate-MP4 2009
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avlanguage.h"
-#include "libavutil/avstring.h"
-#include "libavutil/common.h"
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-
-typedef struct LangEntry {
-    const char str[4];
-    uint16_t next_equivalent;
-} LangEntry;
-
-static const uint16_t lang_table_counts[] = { 484, 20, 184 };
-static const uint16_t lang_table_offsets[] = { 0, 484, 504 };
-
-static const LangEntry lang_table[] = {
-    /*----- AV_LANG_ISO639_2_BIBL entries (484) -----*/
-    /*0000*/ { "aar",  504 },
-    /*0001*/ { "abk",  505 },
-    /*0002*/ { "ace",    2 },
-    /*0003*/ { "ach",    3 },
-    /*0004*/ { "ada",    4 },
-    /*0005*/ { "ady",    5 },
-    /*0006*/ { "afa",    6 },
-    /*0007*/ { "afh",    7 },
-    /*0008*/ { "afr",  507 },
-    /*0009*/ { "ain",    9 },
-    /*0010*/ { "aka",  508 },
-    /*0011*/ { "akk",   11 },
-    /*0012*/ { "alb",  502 },
-    /*0013*/ { "ale",   13 },
-    /*0014*/ { "alg",   14 },
-    /*0015*/ { "alt",   15 },
-    /*0016*/ { "amh",  509 },
-    /*0017*/ { "ang",   17 },
-    /*0018*/ { "anp",   18 },
-    /*0019*/ { "apa",   19 },
-    /*0020*/ { "ara",  511 },
-    /*0021*/ { "arc",   21 },
-    /*0022*/ { "arg",  510 },
-    /*0023*/ { "arm",  492 },
-    /*0024*/ { "arn",   24 },
-    /*0025*/ { "arp",   25 },
-    /*0026*/ { "art",   26 },
-    /*0027*/ { "arw",   27 },
-    /*0028*/ { "asm",  512 },
-    /*0029*/ { "ast",   29 },
-    /*0030*/ { "ath",   30 },
-    /*0031*/ { "aus",   31 },
-    /*0032*/ { "ava",  513 },
-    /*0033*/ { "ave",  506 },
-    /*0034*/ { "awa",   34 },
-    /*0035*/ { "aym",  514 },
-    /*0036*/ { "aze",  515 },
-    /*0037*/ { "bad",   37 },
-    /*0038*/ { "bai",   38 },
-    /*0039*/ { "bak",  516 },
-    /*0040*/ { "bal",   40 },
-    /*0041*/ { "bam",  521 },
-    /*0042*/ { "ban",   42 },
-    /*0043*/ { "baq",  489 },
-    /*0044*/ { "bas",   44 },
-    /*0045*/ { "bat",   45 },
-    /*0046*/ { "bej",   46 },
-    /*0047*/ { "bel",  517 },
-    /*0048*/ { "bem",   48 },
-    /*0049*/ { "ben",  522 },
-    /*0050*/ { "ber",   50 },
-    /*0051*/ { "bho",   51 },
-    /*0052*/ { "bih",  519 },
-    /*0053*/ { "bik",   53 },
-    /*0054*/ { "bin",   54 },
-    /*0055*/ { "bis",  520 },
-    /*0056*/ { "bla",   56 },
-    /*0057*/ { "bnt",   57 },
-    /*0058*/ { "bos",  525 },
-    /*0059*/ { "bra",   59 },
-    /*0060*/ { "bre",  524 },
-    /*0061*/ { "btk",   61 },
-    /*0062*/ { "bua",   62 },
-    /*0063*/ { "bug",   63 },
-    /*0064*/ { "bul",  518 },
-    /*0065*/ { "bur",  498 },
-    /*0066*/ { "byn",   66 },
-    /*0067*/ { "cad",   67 },
-    /*0068*/ { "cai",   68 },
-    /*0069*/ { "car",   69 },
-    /*0070*/ { "cat",  526 },
-    /*0071*/ { "cau",   71 },
-    /*0072*/ { "ceb",   72 },
-    /*0073*/ { "cel",   73 },
-    /*0074*/ { "cha",  528 },
-    /*0075*/ { "chb",   75 },
-    /*0076*/ { "che",  527 },
-    /*0077*/ { "chg",   77 },
-    /*0078*/ { "chi",  503 },
-    /*0079*/ { "chk",   79 },
-    /*0080*/ { "chm",   80 },
-    /*0081*/ { "chn",   81 },
-    /*0082*/ { "cho",   82 },
-    /*0083*/ { "chp",   83 },
-    /*0084*/ { "chr",   84 },
-    /*0085*/ { "chu",  532 },
-    /*0086*/ { "chv",  533 },
-    /*0087*/ { "chy",   87 },
-    /*0088*/ { "cmc",   88 },
-    /*0089*/ { "cop",   89 },
-    /*0090*/ { "cor",  593 },
-    /*0091*/ { "cos",  529 },
-    /*0092*/ { "cpe",   92 },
-    /*0093*/ { "cpf",   93 },
-    /*0094*/ { "cpp",   94 },
-    /*0095*/ { "cre",  530 },
-    /*0096*/ { "crh",   96 },
-    /*0097*/ { "crp",   97 },
-    /*0098*/ { "csb",   98 },
-    /*0099*/ { "cus",   99 },
-    /*0100*/ { "cze",  485 },
-    /*0101*/ { "dak",  101 },
-    /*0102*/ { "dan",  535 },
-    /*0103*/ { "dar",  103 },
-    /*0104*/ { "day",  104 },
-    /*0105*/ { "del",  105 },
-    /*0106*/ { "den",  106 },
-    /*0107*/ { "dgr",  107 },
-    /*0108*/ { "din",  108 },
-    /*0109*/ { "div",  537 },
-    /*0110*/ { "doi",  110 },
-    /*0111*/ { "dra",  111 },
-    /*0112*/ { "dsb",  112 },
-    /*0113*/ { "dua",  113 },
-    /*0114*/ { "dum",  114 },
-    /*0115*/ { "dut",  499 },
-    /*0116*/ { "dyu",  116 },
-    /*0117*/ { "dzo",  538 },
-    /*0118*/ { "efi",  118 },
-    /*0119*/ { "egy",  119 },
-    /*0120*/ { "eka",  120 },
-    /*0121*/ { "elx",  121 },
-    /*0122*/ { "eng",  541 },
-    /*0123*/ { "enm",  123 },
-    /*0124*/ { "epo",  542 },
-    /*0125*/ { "est",  544 },
-    /*0126*/ { "ewe",  539 },
-    /*0127*/ { "ewo",  127 },
-    /*0128*/ { "fan",  128 },
-    /*0129*/ { "fao",  550 },
-    /*0130*/ { "fat",  130 },
-    /*0131*/ { "fij",  549 },
-    /*0132*/ { "fil",  132 },
-    /*0133*/ { "fin",  548 },
-    /*0134*/ { "fiu",  134 },
-    /*0135*/ { "fon",  135 },
-    /*0136*/ { "fre",  491 },
-    /*0137*/ { "frm",  137 },
-    /*0138*/ { "fro",  138 },
-    /*0139*/ { "frr",  139 },
-    /*0140*/ { "frs",  140 },
-    /*0141*/ { "fry",  552 },
-    /*0142*/ { "ful",  547 },
-    /*0143*/ { "fur",  143 },
-    /*0144*/ { "gaa",  144 },
-    /*0145*/ { "gay",  145 },
-    /*0146*/ { "gba",  146 },
-    /*0147*/ { "gem",  147 },
-    /*0148*/ { "geo",  494 },
-    /*0149*/ { "ger",  487 },
-    /*0150*/ { "gez",  150 },
-    /*0151*/ { "gil",  151 },
-    /*0152*/ { "gla",  554 },
-    /*0153*/ { "gle",  553 },
-    /*0154*/ { "glg",  555 },
-    /*0155*/ { "glv",  558 },
-    /*0156*/ { "gmh",  156 },
-    /*0157*/ { "goh",  157 },
-    /*0158*/ { "gon",  158 },
-    /*0159*/ { "gor",  159 },
-    /*0160*/ { "got",  160 },
-    /*0161*/ { "grb",  161 },
-    /*0162*/ { "grc",  162 },
-    /*0163*/ { "gre",  488 },
-    /*0164*/ { "grn",  556 },
-    /*0165*/ { "gsw",  165 },
-    /*0166*/ { "guj",  557 },
-    /*0167*/ { "gwi",  167 },
-    /*0168*/ { "hai",  168 },
-    /*0169*/ { "hat",  564 },
-    /*0170*/ { "hau",  559 },
-    /*0171*/ { "haw",  171 },
-    /*0172*/ { "heb",  560 },
-    /*0173*/ { "her",  567 },
-    /*0174*/ { "hil",  174 },
-    /*0175*/ { "him",  175 },
-    /*0176*/ { "hin",  561 },
-    /*0177*/ { "hit",  177 },
-    /*0178*/ { "hmn",  178 },
-    /*0179*/ { "hmo",  562 },
-    /*0180*/ { "hrv",  563 },
-    /*0181*/ { "hsb",  181 },
-    /*0182*/ { "hun",  565 },
-    /*0183*/ { "hup",  183 },
-    /*0184*/ { "iba",  184 },
-    /*0185*/ { "ibo",  571 },
-    /*0186*/ { "ice",  493 },
-    /*0187*/ { "ido",  574 },
-    /*0188*/ { "iii",  572 },
-    /*0189*/ { "ijo",  189 },
-    /*0190*/ { "iku",  577 },
-    /*0191*/ { "ile",  570 },
-    /*0192*/ { "ilo",  192 },
-    /*0193*/ { "ina",  568 },
-    /*0194*/ { "inc",  194 },
-    /*0195*/ { "ind",  569 },
-    /*0196*/ { "ine",  196 },
-    /*0197*/ { "inh",  197 },
-    /*0198*/ { "ipk",  573 },
-    /*0199*/ { "ira",  199 },
-    /*0200*/ { "iro",  200 },
-    /*0201*/ { "ita",  576 },
-    /*0202*/ { "jav",  579 },
-    /*0203*/ { "jbo",  203 },
-    /*0204*/ { "jpn",  578 },
-    /*0205*/ { "jpr",  205 },
-    /*0206*/ { "jrb",  206 },
-    /*0207*/ { "kaa",  207 },
-    /*0208*/ { "kab",  208 },
-    /*0209*/ { "kac",  209 },
-    /*0210*/ { "kal",  585 },
-    /*0211*/ { "kam",  211 },
-    /*0212*/ { "kan",  587 },
-    /*0213*/ { "kar",  213 },
-    /*0214*/ { "kas",  590 },
-    /*0215*/ { "kau",  589 },
-    /*0216*/ { "kaw",  216 },
-    /*0217*/ { "kaz",  584 },
-    /*0218*/ { "kbd",  218 },
-    /*0219*/ { "kha",  219 },
-    /*0220*/ { "khi",  220 },
-    /*0221*/ { "khm",  586 },
-    /*0222*/ { "kho",  222 },
-    /*0223*/ { "kik",  582 },
-    /*0224*/ { "kin",  640 },
-    /*0225*/ { "kir",  594 },
-    /*0226*/ { "kmb",  226 },
-    /*0227*/ { "kok",  227 },
-    /*0228*/ { "kom",  592 },
-    /*0229*/ { "kon",  581 },
-    /*0230*/ { "kor",  588 },
-    /*0231*/ { "kos",  231 },
-    /*0232*/ { "kpe",  232 },
-    /*0233*/ { "krc",  233 },
-    /*0234*/ { "krl",  234 },
-    /*0235*/ { "kro",  235 },
-    /*0236*/ { "kru",  236 },
-    /*0237*/ { "kua",  583 },
-    /*0238*/ { "kum",  238 },
-    /*0239*/ { "kur",  591 },
-    /*0240*/ { "kut",  240 },
-    /*0241*/ { "lad",  241 },
-    /*0242*/ { "lah",  242 },
-    /*0243*/ { "lam",  243 },
-    /*0244*/ { "lao",  600 },
-    /*0245*/ { "lat",  595 },
-    /*0246*/ { "lav",  603 },
-    /*0247*/ { "lez",  247 },
-    /*0248*/ { "lim",  598 },
-    /*0249*/ { "lin",  599 },
-    /*0250*/ { "lit",  601 },
-    /*0251*/ { "lol",  251 },
-    /*0252*/ { "loz",  252 },
-    /*0253*/ { "ltz",  596 },
-    /*0254*/ { "lua",  254 },
-    /*0255*/ { "lub",  602 },
-    /*0256*/ { "lug",  597 },
-    /*0257*/ { "lui",  257 },
-    /*0258*/ { "lun",  258 },
-    /*0259*/ { "luo",  259 },
-    /*0260*/ { "lus",  260 },
-    /*0261*/ { "mac",  495 },
-    /*0262*/ { "mad",  262 },
-    /*0263*/ { "mag",  263 },
-    /*0264*/ { "mah",  605 },
-    /*0265*/ { "mai",  265 },
-    /*0266*/ { "mak",  266 },
-    /*0267*/ { "mal",  608 },
-    /*0268*/ { "man",  268 },
-    /*0269*/ { "mao",  496 },
-    /*0270*/ { "map",  270 },
-    /*0271*/ { "mar",  610 },
-    /*0272*/ { "mas",  272 },
-    /*0273*/ { "may",  497 },
-    /*0274*/ { "mdf",  274 },
-    /*0275*/ { "mdr",  275 },
-    /*0276*/ { "men",  276 },
-    /*0277*/ { "mga",  277 },
-    /*0278*/ { "mic",  278 },
-    /*0279*/ { "min",  279 },
-    /*0280*/ { "mis",  280 },
-    /*0281*/ { "mkh",  281 },
-    /*0282*/ { "mlg",  604 },
-    /*0283*/ { "mlt",  612 },
-    /*0284*/ { "mnc",  284 },
-    /*0285*/ { "mni",  285 },
-    /*0286*/ { "mno",  286 },
-    /*0287*/ { "moh",  287 },
-    /*0288*/ { "mon",  609 },
-    /*0289*/ { "mos",  289 },
-    /*0290*/ { "mul",  290 },
-    /*0291*/ { "mun",  291 },
-    /*0292*/ { "mus",  292 },
-    /*0293*/ { "mwl",  293 },
-    /*0294*/ { "mwr",  294 },
-    /*0295*/ { "myn",  295 },
-    /*0296*/ { "myv",  296 },
-    /*0297*/ { "nah",  297 },
-    /*0298*/ { "nai",  298 },
-    /*0299*/ { "nap",  299 },
-    /*0300*/ { "nau",  614 },
-    /*0301*/ { "nav",  623 },
-    /*0302*/ { "nbl",  622 },
-    /*0303*/ { "nde",  616 },
-    /*0304*/ { "ndo",  618 },
-    /*0305*/ { "nds",  305 },
-    /*0306*/ { "nep",  617 },
-    /*0307*/ { "new",  307 },
-    /*0308*/ { "nia",  308 },
-    /*0309*/ { "nic",  309 },
-    /*0310*/ { "niu",  310 },
-    /*0311*/ { "nno",  620 },
-    /*0312*/ { "nob",  615 },
-    /*0313*/ { "nog",  313 },
-    /*0314*/ { "non",  314 },
-    /*0315*/ { "nor",  621 },
-    /*0316*/ { "nqo",  316 },
-    /*0317*/ { "nso",  317 },
-    /*0318*/ { "nub",  318 },
-    /*0319*/ { "nwc",  319 },
-    /*0320*/ { "nya",  624 },
-    /*0321*/ { "nym",  321 },
-    /*0322*/ { "nyn",  322 },
-    /*0323*/ { "nyo",  323 },
-    /*0324*/ { "nzi",  324 },
-    /*0325*/ { "oci",  625 },
-    /*0326*/ { "oji",  626 },
-    /*0327*/ { "ori",  628 },
-    /*0328*/ { "orm",  627 },
-    /*0329*/ { "osa",  329 },
-    /*0330*/ { "oss",  629 },
-    /*0331*/ { "ota",  331 },
-    /*0332*/ { "oto",  332 },
-    /*0333*/ { "paa",  333 },
-    /*0334*/ { "pag",  334 },
-    /*0335*/ { "pal",  335 },
-    /*0336*/ { "pam",  336 },
-    /*0337*/ { "pan",  630 },
-    /*0338*/ { "pap",  338 },
-    /*0339*/ { "pau",  339 },
-    /*0340*/ { "peo",  340 },
-    /*0341*/ { "per",  490 },
-    /*0342*/ { "phi",  342 },
-    /*0343*/ { "phn",  343 },
-    /*0344*/ { "pli",  631 },
-    /*0345*/ { "pol",  632 },
-    /*0346*/ { "pon",  346 },
-    /*0347*/ { "por",  634 },
-    /*0348*/ { "pra",  348 },
-    /*0349*/ { "pro",  349 },
-    /*0350*/ { "pus",  633 },
-    /*0351*/ { "que",  635 },
-    /*0352*/ { "raj",  352 },
-    /*0353*/ { "rap",  353 },
-    /*0354*/ { "rar",  354 },
-    /*0355*/ { "roa",  355 },
-    /*0356*/ { "roh",  636 },
-    /*0357*/ { "rom",  357 },
-    /*0358*/ { "rum",  500 },
-    /*0359*/ { "run",  637 },
-    /*0360*/ { "rup",  360 },
-    /*0361*/ { "rus",  639 },
-    /*0362*/ { "sad",  362 },
-    /*0363*/ { "sag",  645 },
-    /*0364*/ { "sah",  364 },
-    /*0365*/ { "sai",  365 },
-    /*0366*/ { "sal",  366 },
-    /*0367*/ { "sam",  367 },
-    /*0368*/ { "san",  641 },
-    /*0369*/ { "sas",  369 },
-    /*0370*/ { "sat",  370 },
-    /*0371*/ { "scn",  371 },
-    /*0372*/ { "sco",  372 },
-    /*0373*/ { "sel",  373 },
-    /*0374*/ { "sem",  374 },
-    /*0375*/ { "sga",  375 },
-    /*0376*/ { "sgn",  376 },
-    /*0377*/ { "shn",  377 },
-    /*0378*/ { "sid",  378 },
-    /*0379*/ { "sin",  646 },
-    /*0380*/ { "sio",  380 },
-    /*0381*/ { "sit",  381 },
-    /*0382*/ { "sla",  382 },
-    /*0383*/ { "slo",  501 },
-    /*0384*/ { "slv",  648 },
-    /*0385*/ { "sma",  385 },
-    /*0386*/ { "sme",  644 },
-    /*0387*/ { "smi",  387 },
-    /*0388*/ { "smj",  388 },
-    /*0389*/ { "smn",  389 },
-    /*0390*/ { "smo",  649 },
-    /*0391*/ { "sms",  391 },
-    /*0392*/ { "sna",  650 },
-    /*0393*/ { "snd",  643 },
-    /*0394*/ { "snk",  394 },
-    /*0395*/ { "sog",  395 },
-    /*0396*/ { "som",  651 },
-    /*0397*/ { "son",  397 },
-    /*0398*/ { "sot",  655 },
-    /*0399*/ { "spa",  543 },
-    /*0400*/ { "srd",  642 },
-    /*0401*/ { "srn",  401 },
-    /*0402*/ { "srp",  653 },
-    /*0403*/ { "srr",  403 },
-    /*0404*/ { "ssa",  404 },
-    /*0405*/ { "ssw",  654 },
-    /*0406*/ { "suk",  406 },
-    /*0407*/ { "sun",  656 },
-    /*0408*/ { "sus",  408 },
-    /*0409*/ { "sux",  409 },
-    /*0410*/ { "swa",  658 },
-    /*0411*/ { "swe",  657 },
-    /*0412*/ { "syc",  412 },
-    /*0413*/ { "syr",  413 },
-    /*0414*/ { "tah",  672 },
-    /*0415*/ { "tai",  415 },
-    /*0416*/ { "tam",  659 },
-    /*0417*/ { "tat",  670 },
-    /*0418*/ { "tel",  660 },
-    /*0419*/ { "tem",  419 },
-    /*0420*/ { "ter",  420 },
-    /*0421*/ { "tet",  421 },
-    /*0422*/ { "tgk",  661 },
-    /*0423*/ { "tgl",  665 },
-    /*0424*/ { "tha",  662 },
-    /*0425*/ { "tib",  484 },
-    /*0426*/ { "tig",  426 },
-    /*0427*/ { "tir",  663 },
-    /*0428*/ { "tiv",  428 },
-    /*0429*/ { "tkl",  429 },
-    /*0430*/ { "tlh",  430 },
-    /*0431*/ { "tli",  431 },
-    /*0432*/ { "tmh",  432 },
-    /*0433*/ { "tog",  433 },
-    /*0434*/ { "ton",  667 },
-    /*0435*/ { "tpi",  435 },
-    /*0436*/ { "tsi",  436 },
-    /*0437*/ { "tsn",  666 },
-    /*0438*/ { "tso",  669 },
-    /*0439*/ { "tuk",  664 },
-    /*0440*/ { "tum",  440 },
-    /*0441*/ { "tup",  441 },
-    /*0442*/ { "tur",  668 },
-    /*0443*/ { "tut",  443 },
-    /*0444*/ { "tvl",  444 },
-    /*0445*/ { "twi",  671 },
-    /*0446*/ { "tyv",  446 },
-    /*0447*/ { "udm",  447 },
-    /*0448*/ { "uga",  448 },
-    /*0449*/ { "uig",  673 },
-    /*0450*/ { "ukr",  674 },
-    /*0451*/ { "umb",  451 },
-    /*0452*/ { "und",  452 },
-    /*0453*/ { "urd",  675 },
-    /*0454*/ { "uzb",  676 },
-    /*0455*/ { "vai",  455 },
-    /*0456*/ { "ven",  677 },
-    /*0457*/ { "vie",  678 },
-    /*0458*/ { "vol",  679 },
-    /*0459*/ { "vot",  459 },
-    /*0460*/ { "wak",  460 },
-    /*0461*/ { "wal",  461 },
-    /*0462*/ { "war",  462 },
-    /*0463*/ { "was",  463 },
-    /*0464*/ { "wel",  486 },
-    /*0465*/ { "wen",  465 },
-    /*0466*/ { "wln",  680 },
-    /*0467*/ { "wol",  681 },
-    /*0468*/ { "xal",  468 },
-    /*0469*/ { "xho",  682 },
-    /*0470*/ { "yao",  470 },
-    /*0471*/ { "yap",  471 },
-    /*0472*/ { "yid",  683 },
-    /*0473*/ { "yor",  684 },
-    /*0474*/ { "ypk",  474 },
-    /*0475*/ { "zap",  475 },
-    /*0476*/ { "zbl",  476 },
-    /*0477*/ { "zen",  477 },
-    /*0478*/ { "zha",  685 },
-    /*0479*/ { "znd",  479 },
-    /*0480*/ { "zul",  687 },
-    /*0481*/ { "zun",  481 },
-    /*0482*/ { "zxx",  482 },
-    /*0483*/ { "zza",  483 },
-    /*----- AV_LANG_ISO639_2_TERM entries (20) -----*/
-    /*0484*/ { "bod",  523 },
-    /*0485*/ { "ces",  531 },
-    /*0486*/ { "cym",  534 },
-    /*0487*/ { "deu",  536 },
-    /*0488*/ { "ell",  540 },
-    /*0489*/ { "eus",  545 },
-    /*0490*/ { "fas",  546 },
-    /*0491*/ { "fra",  551 },
-    /*0492*/ { "hye",  566 },
-    /*0493*/ { "isl",  575 },
-    /*0494*/ { "kat",  580 },
-    /*0495*/ { "mkd",  607 },
-    /*0496*/ { "mri",  606 },
-    /*0497*/ { "msa",  611 },
-    /*0498*/ { "mya",  613 },
-    /*0499*/ { "nld",  619 },
-    /*0500*/ { "ron",  638 },
-    /*0501*/ { "slk",  647 },
-    /*0502*/ { "sqi",  652 },
-    /*0503*/ { "zho",  686 },
-    /*----- AV_LANG_ISO639_1 entries (184) -----*/
-    /*0504*/ { "aa" ,    0 },
-    /*0505*/ { "ab" ,    1 },
-    /*0506*/ { "ae" ,   33 },
-    /*0507*/ { "af" ,    8 },
-    /*0508*/ { "ak" ,   10 },
-    /*0509*/ { "am" ,   16 },
-    /*0510*/ { "an" ,   22 },
-    /*0511*/ { "ar" ,   20 },
-    /*0512*/ { "as" ,   28 },
-    /*0513*/ { "av" ,   32 },
-    /*0514*/ { "ay" ,   35 },
-    /*0515*/ { "az" ,   36 },
-    /*0516*/ { "ba" ,   39 },
-    /*0517*/ { "be" ,   47 },
-    /*0518*/ { "bg" ,   64 },
-    /*0519*/ { "bh" ,   52 },
-    /*0520*/ { "bi" ,   55 },
-    /*0521*/ { "bm" ,   41 },
-    /*0522*/ { "bn" ,   49 },
-    /*0523*/ { "bo" ,  425 },
-    /*0524*/ { "br" ,   60 },
-    /*0525*/ { "bs" ,   58 },
-    /*0526*/ { "ca" ,   70 },
-    /*0527*/ { "ce" ,   76 },
-    /*0528*/ { "ch" ,   74 },
-    /*0529*/ { "co" ,   91 },
-    /*0530*/ { "cr" ,   95 },
-    /*0531*/ { "cs" ,  100 },
-    /*0532*/ { "cu" ,   85 },
-    /*0533*/ { "cv" ,   86 },
-    /*0534*/ { "cy" ,  464 },
-    /*0535*/ { "da" ,  102 },
-    /*0536*/ { "de" ,  149 },
-    /*0537*/ { "dv" ,  109 },
-    /*0538*/ { "dz" ,  117 },
-    /*0539*/ { "ee" ,  126 },
-    /*0540*/ { "el" ,  163 },
-    /*0541*/ { "en" ,  122 },
-    /*0542*/ { "eo" ,  124 },
-    /*0543*/ { "es" ,  399 },
-    /*0544*/ { "et" ,  125 },
-    /*0545*/ { "eu" ,   43 },
-    /*0546*/ { "fa" ,  341 },
-    /*0547*/ { "ff" ,  142 },
-    /*0548*/ { "fi" ,  133 },
-    /*0549*/ { "fj" ,  131 },
-    /*0550*/ { "fo" ,  129 },
-    /*0551*/ { "fr" ,  136 },
-    /*0552*/ { "fy" ,  141 },
-    /*0553*/ { "ga" ,  153 },
-    /*0554*/ { "gd" ,  152 },
-    /*0555*/ { "gl" ,  154 },
-    /*0556*/ { "gn" ,  164 },
-    /*0557*/ { "gu" ,  166 },
-    /*0558*/ { "gv" ,  155 },
-    /*0559*/ { "ha" ,  170 },
-    /*0560*/ { "he" ,  172 },
-    /*0561*/ { "hi" ,  176 },
-    /*0562*/ { "ho" ,  179 },
-    /*0563*/ { "hr" ,  180 },
-    /*0564*/ { "ht" ,  169 },
-    /*0565*/ { "hu" ,  182 },
-    /*0566*/ { "hy" ,   23 },
-    /*0567*/ { "hz" ,  173 },
-    /*0568*/ { "ia" ,  193 },
-    /*0569*/ { "id" ,  195 },
-    /*0570*/ { "ie" ,  191 },
-    /*0571*/ { "ig" ,  185 },
-    /*0572*/ { "ii" ,  188 },
-    /*0573*/ { "ik" ,  198 },
-    /*0574*/ { "io" ,  187 },
-    /*0575*/ { "is" ,  186 },
-    /*0576*/ { "it" ,  201 },
-    /*0577*/ { "iu" ,  190 },
-    /*0578*/ { "ja" ,  204 },
-    /*0579*/ { "jv" ,  202 },
-    /*0580*/ { "ka" ,  148 },
-    /*0581*/ { "kg" ,  229 },
-    /*0582*/ { "ki" ,  223 },
-    /*0583*/ { "kj" ,  237 },
-    /*0584*/ { "kk" ,  217 },
-    /*0585*/ { "kl" ,  210 },
-    /*0586*/ { "km" ,  221 },
-    /*0587*/ { "kn" ,  212 },
-    /*0588*/ { "ko" ,  230 },
-    /*0589*/ { "kr" ,  215 },
-    /*0590*/ { "ks" ,  214 },
-    /*0591*/ { "ku" ,  239 },
-    /*0592*/ { "kv" ,  228 },
-    /*0593*/ { "kw" ,   90 },
-    /*0594*/ { "ky" ,  225 },
-    /*0595*/ { "la" ,  245 },
-    /*0596*/ { "lb" ,  253 },
-    /*0597*/ { "lg" ,  256 },
-    /*0598*/ { "li" ,  248 },
-    /*0599*/ { "ln" ,  249 },
-    /*0600*/ { "lo" ,  244 },
-    /*0601*/ { "lt" ,  250 },
-    /*0602*/ { "lu" ,  255 },
-    /*0603*/ { "lv" ,  246 },
-    /*0604*/ { "mg" ,  282 },
-    /*0605*/ { "mh" ,  264 },
-    /*0606*/ { "mi" ,  269 },
-    /*0607*/ { "mk" ,  261 },
-    /*0608*/ { "ml" ,  267 },
-    /*0609*/ { "mn" ,  288 },
-    /*0610*/ { "mr" ,  271 },
-    /*0611*/ { "ms" ,  273 },
-    /*0612*/ { "mt" ,  283 },
-    /*0613*/ { "my" ,   65 },
-    /*0614*/ { "na" ,  300 },
-    /*0615*/ { "nb" ,  312 },
-    /*0616*/ { "nd" ,  303 },
-    /*0617*/ { "ne" ,  306 },
-    /*0618*/ { "ng" ,  304 },
-    /*0619*/ { "nl" ,  115 },
-    /*0620*/ { "nn" ,  311 },
-    /*0621*/ { "no" ,  315 },
-    /*0622*/ { "nr" ,  302 },
-    /*0623*/ { "nv" ,  301 },
-    /*0624*/ { "ny" ,  320 },
-    /*0625*/ { "oc" ,  325 },
-    /*0626*/ { "oj" ,  326 },
-    /*0627*/ { "om" ,  328 },
-    /*0628*/ { "or" ,  327 },
-    /*0629*/ { "os" ,  330 },
-    /*0630*/ { "pa" ,  337 },
-    /*0631*/ { "pi" ,  344 },
-    /*0632*/ { "pl" ,  345 },
-    /*0633*/ { "ps" ,  350 },
-    /*0634*/ { "pt" ,  347 },
-    /*0635*/ { "qu" ,  351 },
-    /*0636*/ { "rm" ,  356 },
-    /*0637*/ { "rn" ,  359 },
-    /*0638*/ { "ro" ,  358 },
-    /*0639*/ { "ru" ,  361 },
-    /*0640*/ { "rw" ,  224 },
-    /*0641*/ { "sa" ,  368 },
-    /*0642*/ { "sc" ,  400 },
-    /*0643*/ { "sd" ,  393 },
-    /*0644*/ { "se" ,  386 },
-    /*0645*/ { "sg" ,  363 },
-    /*0646*/ { "si" ,  379 },
-    /*0647*/ { "sk" ,  383 },
-    /*0648*/ { "sl" ,  384 },
-    /*0649*/ { "sm" ,  390 },
-    /*0650*/ { "sn" ,  392 },
-    /*0651*/ { "so" ,  396 },
-    /*0652*/ { "sq" ,   12 },
-    /*0653*/ { "sr" ,  402 },
-    /*0654*/ { "ss" ,  405 },
-    /*0655*/ { "st" ,  398 },
-    /*0656*/ { "su" ,  407 },
-    /*0657*/ { "sv" ,  411 },
-    /*0658*/ { "sw" ,  410 },
-    /*0659*/ { "ta" ,  416 },
-    /*0660*/ { "te" ,  418 },
-    /*0661*/ { "tg" ,  422 },
-    /*0662*/ { "th" ,  424 },
-    /*0663*/ { "ti" ,  427 },
-    /*0664*/ { "tk" ,  439 },
-    /*0665*/ { "tl" ,  423 },
-    /*0666*/ { "tn" ,  437 },
-    /*0667*/ { "to" ,  434 },
-    /*0668*/ { "tr" ,  442 },
-    /*0669*/ { "ts" ,  438 },
-    /*0670*/ { "tt" ,  417 },
-    /*0671*/ { "tw" ,  445 },
-    /*0672*/ { "ty" ,  414 },
-    /*0673*/ { "ug" ,  449 },
-    /*0674*/ { "uk" ,  450 },
-    /*0675*/ { "ur" ,  453 },
-    /*0676*/ { "uz" ,  454 },
-    /*0677*/ { "ve" ,  456 },
-    /*0678*/ { "vi" ,  457 },
-    /*0679*/ { "vo" ,  458 },
-    /*0680*/ { "wa" ,  466 },
-    /*0681*/ { "wo" ,  467 },
-    /*0682*/ { "xh" ,  469 },
-    /*0683*/ { "yi" ,  472 },
-    /*0684*/ { "yo" ,  473 },
-    /*0685*/ { "za" ,  478 },
-    /*0686*/ { "zh" ,   78 },
-    /*0687*/ { "zu" ,  480 },
-    { "", 0 }
-};
-
-static int lang_table_compare(const void *lhs, const void *rhs)
-{
-    return strcmp(lhs, ((const LangEntry *)rhs)->str);
-}
-
-const char *av_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace)
-{
-    int i;
-    const LangEntry *entry = NULL;
-    const int NB_CODESPACES = FF_ARRAY_ELEMS(lang_table_counts);
-
-    if (target_codespace >= NB_CODESPACES)
-        return NULL;
-
-    for (i=0; !entry && i<NB_CODESPACES; i++)
-        entry = bsearch(lang,
-                        lang_table + lang_table_offsets[i],
-                        lang_table_counts[i],
-                        sizeof(LangEntry),
-                        lang_table_compare);
-    if (!entry)
-        return NULL;
-
-    for (i=0; i<NB_CODESPACES; i++)
-        if (entry >= lang_table + lang_table_offsets[target_codespace] &&
-            entry < lang_table + lang_table_offsets[target_codespace] + lang_table_counts[target_codespace])
-            return entry->str;
-        else
-            entry = lang_table + entry->next_equivalent;
-
-    if (target_codespace == AV_LANG_ISO639_2_TERM)
-        return av_convert_lang_to(lang, AV_LANG_ISO639_2_BIBL);
-
-    return NULL;
-}
diff --git a/deps/libav/libavformat/avlanguage.h b/deps/libav/libavformat/avlanguage.h
deleted file mode 100644
index 2ec3e2d..0000000
--- a/deps/libav/libavformat/avlanguage.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Cyril Comparon, Larbi Joubala, Resonate-MP4 2009
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_AVLANGUAGE_H
-#define AVFORMAT_AVLANGUAGE_H
-
-/**
- * Known language codespaces
- */
-enum AVLangCodespace {
-    AV_LANG_ISO639_2_BIBL, /** 3-char bibliographic language codes as per ISO-IEC 639-2 */
-    AV_LANG_ISO639_2_TERM, /** 3-char terminologic language codes as per ISO-IEC 639-2 */
-    AV_LANG_ISO639_1       /** 2-char code of language as per ISO/IEC 639-1 */
-};
-
-/**
- * Convert a language code to a target codespace. The source codespace is guessed.
- * @return NULL if the provided lang is null or invalid.
- */
-const char *av_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace);
-
-#endif /* AVFORMAT_AVLANGUAGE_H */
diff --git a/deps/libav/libavformat/avs.c b/deps/libav/libavformat/avs.c
deleted file mode 100644
index 3e95a36..0000000
--- a/deps/libav/libavformat/avs.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * AVS demuxer.
- * Copyright (c) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "voc.h"
-
-
-typedef struct avs_format {
-    VocDecContext voc;
-    AVStream *st_video;
-    AVStream *st_audio;
-    int width;
-    int height;
-    int bits_per_sample;
-    int fps;
-    int nb_frames;
-    int remaining_frame_size;
-    int remaining_audio_size;
-} AvsFormat;
-
-typedef enum avs_block_type {
-    AVS_NONE      = 0x00,
-    AVS_VIDEO     = 0x01,
-    AVS_AUDIO     = 0x02,
-    AVS_PALETTE   = 0x03,
-    AVS_GAME_DATA = 0x04,
-} AvsBlockType;
-
-static int avs_probe(AVProbeData * p)
-{
-    const uint8_t *d;
-
-    d = p->buf;
-    if (d[0] == 'w' && d[1] == 'W' && d[2] == 0x10 && d[3] == 0)
-        /* Ensure the buffer probe scores higher than the extension probe.
-         * This avoids problems with misdetection as AviSynth scripts. */
-        return AVPROBE_SCORE_EXTENSION + 1;
-
-    return 0;
-}
-
-static int avs_read_header(AVFormatContext * s)
-{
-    AvsFormat *avs = s->priv_data;
-
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    avio_skip(s->pb, 4);
-    avs->width = avio_rl16(s->pb);
-    avs->height = avio_rl16(s->pb);
-    avs->bits_per_sample = avio_rl16(s->pb);
-    avs->fps = avio_rl16(s->pb);
-    avs->nb_frames = avio_rl32(s->pb);
-    avs->remaining_frame_size = 0;
-    avs->remaining_audio_size = 0;
-
-    avs->st_video = avs->st_audio = NULL;
-
-    if (avs->width != 318 || avs->height != 198)
-        av_log(s, AV_LOG_ERROR, "This avs pretend to be %dx%d "
-               "when the avs format is supposed to be 318x198 only.\n",
-               avs->width, avs->height);
-
-    return 0;
-}
-
-static int
-avs_read_video_packet(AVFormatContext * s, AVPacket * pkt,
-                      AvsBlockType type, int sub_type, int size,
-                      uint8_t * palette, int palette_size)
-{
-    AvsFormat *avs = s->priv_data;
-    int ret;
-
-    ret = av_new_packet(pkt, size + palette_size);
-    if (ret < 0)
-        return ret;
-
-    if (palette_size) {
-        pkt->data[0] = 0x00;
-        pkt->data[1] = 0x03;
-        pkt->data[2] = palette_size & 0xFF;
-        pkt->data[3] = (palette_size >> 8) & 0xFF;
-        memcpy(pkt->data + 4, palette, palette_size - 4);
-    }
-
-    pkt->data[palette_size + 0] = sub_type;
-    pkt->data[palette_size + 1] = type;
-    pkt->data[palette_size + 2] = size & 0xFF;
-    pkt->data[palette_size + 3] = (size >> 8) & 0xFF;
-    ret = avio_read(s->pb, pkt->data + palette_size + 4, size - 4) + 4;
-    if (ret < size) {
-        av_free_packet(pkt);
-        return AVERROR(EIO);
-    }
-
-    pkt->size = ret + palette_size;
-    pkt->stream_index = avs->st_video->index;
-    if (sub_type == 0)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-
-    return 0;
-}
-
-static int avs_read_audio_packet(AVFormatContext * s, AVPacket * pkt)
-{
-    AvsFormat *avs = s->priv_data;
-    int ret, size;
-
-    size = avio_tell(s->pb);
-    ret = ff_voc_get_packet(s, pkt, avs->st_audio, avs->remaining_audio_size);
-    size = avio_tell(s->pb) - size;
-    avs->remaining_audio_size -= size;
-
-    if (ret == AVERROR(EIO))
-        return 0;    /* this indicate EOS */
-    if (ret < 0)
-        return ret;
-
-    pkt->stream_index = avs->st_audio->index;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-
-    return size;
-}
-
-static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
-{
-    AvsFormat *avs = s->priv_data;
-    int sub_type = 0, size = 0;
-    AvsBlockType type = AVS_NONE;
-    int palette_size = 0;
-    uint8_t palette[4 + 3 * 256];
-    int ret;
-
-    if (avs->remaining_audio_size > 0)
-        if (avs_read_audio_packet(s, pkt) > 0)
-            return 0;
-
-    while (1) {
-        if (avs->remaining_frame_size <= 0) {
-            if (!avio_rl16(s->pb))    /* found EOF */
-                return AVERROR(EIO);
-            avs->remaining_frame_size = avio_rl16(s->pb) - 4;
-        }
-
-        while (avs->remaining_frame_size > 0) {
-            sub_type = avio_r8(s->pb);
-            type = avio_r8(s->pb);
-            size = avio_rl16(s->pb);
-            if (size < 4)
-                return AVERROR_INVALIDDATA;
-            avs->remaining_frame_size -= size;
-
-            switch (type) {
-            case AVS_PALETTE:
-                if (size - 4 > sizeof(palette))
-                    return AVERROR_INVALIDDATA;
-                ret = avio_read(s->pb, palette, size - 4);
-                if (ret < size - 4)
-                    return AVERROR(EIO);
-                palette_size = size;
-                break;
-
-            case AVS_VIDEO:
-                if (!avs->st_video) {
-                    avs->st_video = avformat_new_stream(s, NULL);
-                    if (avs->st_video == NULL)
-                        return AVERROR(ENOMEM);
-                    avs->st_video->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-                    avs->st_video->codec->codec_id = AV_CODEC_ID_AVS;
-                    avs->st_video->codec->width = avs->width;
-                    avs->st_video->codec->height = avs->height;
-                    avs->st_video->codec->bits_per_coded_sample=avs->bits_per_sample;
-                    avs->st_video->nb_frames = avs->nb_frames;
-                    avs->st_video->avg_frame_rate = (AVRational){avs->fps, 1};
-                }
-                return avs_read_video_packet(s, pkt, type, sub_type, size,
-                                             palette, palette_size);
-
-            case AVS_AUDIO:
-                if (!avs->st_audio) {
-                    avs->st_audio = avformat_new_stream(s, NULL);
-                    if (avs->st_audio == NULL)
-                        return AVERROR(ENOMEM);
-                    avs->st_audio->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-                }
-                avs->remaining_audio_size = size - 4;
-                size = avs_read_audio_packet(s, pkt);
-                if (size != 0)
-                    return size;
-                break;
-
-            default:
-                avio_skip(s->pb, size - 4);
-            }
-        }
-    }
-}
-
-static int avs_read_close(AVFormatContext * s)
-{
-    return 0;
-}
-
-AVInputFormat ff_avs_demuxer = {
-    .name           = "avs",
-    .long_name      = NULL_IF_CONFIG_SMALL("AVS"),
-    .priv_data_size = sizeof(AvsFormat),
-    .read_probe     = avs_probe,
-    .read_header    = avs_read_header,
-    .read_packet    = avs_read_packet,
-    .read_close     = avs_read_close,
-};
diff --git a/deps/libav/libavformat/bethsoftvid.c b/deps/libav/libavformat/bethsoftvid.c
deleted file mode 100644
index 120e145..0000000
--- a/deps/libav/libavformat/bethsoftvid.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Bethsoft VID format Demuxer
- * Copyright (c) 2007 Nicholas Tung
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Bethesda Softworks VID (.vid) file demuxer
- * @author Nicholas Tung [ntung (at. ntung com] (2007-03)
- * @see http://wiki.multimedia.cx/index.php?title=Bethsoft_VID
- * @see http://www.svatopluk.com/andux/docs/dfvid.html
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-#include "libavcodec/bethsoftvideo.h"
-
-#define BVID_PALETTE_SIZE 3 * 256
-
-#define DEFAULT_SAMPLE_RATE 11111
-
-typedef struct BVID_DemuxContext
-{
-    int nframes;
-    int sample_rate;        /**< audio sample rate */
-    int width;              /**< video width       */
-    int height;             /**< video height      */
-    /** delay value between frames, added to individual frame delay.
-     * custom units, which will be added to other custom units (~=16ms according
-     * to free, unofficial documentation) */
-    int bethsoft_global_delay;
-    int video_index;        /**< video stream index */
-    int audio_index;        /**< audio stream index */
-    uint8_t *palette;
-
-    int is_finished;
-
-} BVID_DemuxContext;
-
-static int vid_probe(AVProbeData *p)
-{
-    // little-endian VID tag, file starts with "VID\0"
-    if (AV_RL32(p->buf) != MKTAG('V', 'I', 'D', 0))
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int vid_read_header(AVFormatContext *s)
-{
-    BVID_DemuxContext *vid = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    /* load main header. Contents:
-    *    bytes: 'V' 'I' 'D'
-    *    int16s: always_512, nframes, width, height, delay, always_14
-    */
-    avio_skip(pb, 5);
-    vid->nframes = avio_rl16(pb);
-    vid->width   = avio_rl16(pb);
-    vid->height  = avio_rl16(pb);
-    vid->bethsoft_global_delay = avio_rl16(pb);
-    avio_rl16(pb);
-
-    // wait until the first packet to create each stream
-    vid->video_index = -1;
-    vid->audio_index = -1;
-    vid->sample_rate = DEFAULT_SAMPLE_RATE;
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    return 0;
-}
-
-#define BUFFER_PADDING_SIZE 1000
-static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt,
-                      uint8_t block_type, AVFormatContext *s)
-{
-    uint8_t * vidbuf_start = NULL;
-    int vidbuf_nbytes = 0;
-    int code;
-    int bytes_copied = 0;
-    int position, duration, npixels;
-    unsigned int vidbuf_capacity;
-    int ret = 0;
-    AVStream *st;
-
-    if (vid->video_index < 0) {
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        vid->video_index = st->index;
-        if (vid->audio_index < 0) {
-            avpriv_request_sample(s, "Using default video time base since "
-                                  "having no audio packet before the first "
-                                  "video packet");
-        }
-        avpriv_set_pts_info(st, 64, 185, vid->sample_rate);
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id   = AV_CODEC_ID_BETHSOFTVID;
-        st->codec->width      = vid->width;
-        st->codec->height     = vid->height;
-    }
-    st      = s->streams[vid->video_index];
-    npixels = st->codec->width * st->codec->height;
-
-    vidbuf_start = av_malloc(vidbuf_capacity = BUFFER_PADDING_SIZE);
-    if(!vidbuf_start)
-        return AVERROR(ENOMEM);
-
-    // save the file position for the packet, include block type
-    position = avio_tell(pb) - 1;
-
-    vidbuf_start[vidbuf_nbytes++] = block_type;
-
-    // get the current packet duration
-    duration = vid->bethsoft_global_delay + avio_rl16(pb);
-
-    // set the y offset if it exists (decoder header data should be in data section)
-    if(block_type == VIDEO_YOFF_P_FRAME){
-        if (avio_read(pb, &vidbuf_start[vidbuf_nbytes], 2) != 2) {
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        vidbuf_nbytes += 2;
-    }
-
-    do{
-        vidbuf_start = av_fast_realloc(vidbuf_start, &vidbuf_capacity, vidbuf_nbytes + BUFFER_PADDING_SIZE);
-        if(!vidbuf_start)
-            return AVERROR(ENOMEM);
-
-        code = avio_r8(pb);
-        vidbuf_start[vidbuf_nbytes++] = code;
-
-        if(code >= 0x80){ // rle sequence
-            if(block_type == VIDEO_I_FRAME)
-                vidbuf_start[vidbuf_nbytes++] = avio_r8(pb);
-        } else if(code){ // plain sequence
-            if (avio_read(pb, &vidbuf_start[vidbuf_nbytes], code) != code) {
-                ret = AVERROR(EIO);
-                goto fail;
-            }
-            vidbuf_nbytes += code;
-        }
-        bytes_copied += code & 0x7F;
-        if(bytes_copied == npixels){ // sometimes no stop character is given, need to keep track of bytes copied
-            // may contain a 0 byte even if read all pixels
-            if(avio_r8(pb))
-                avio_seek(pb, -1, SEEK_CUR);
-            break;
-        }
-        if (bytes_copied > npixels) {
-            ret = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-    } while(code);
-
-    // copy data into packet
-    if ((ret = av_new_packet(pkt, vidbuf_nbytes)) < 0)
-        goto fail;
-    memcpy(pkt->data, vidbuf_start, vidbuf_nbytes);
-    av_free(vidbuf_start);
-
-    pkt->pos = position;
-    pkt->stream_index = vid->video_index;
-    pkt->duration = duration;
-    if (block_type == VIDEO_I_FRAME)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-
-    /* if there is a new palette available, add it to packet side data */
-    if (vid->palette) {
-        uint8_t *pdata = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
-                                                 BVID_PALETTE_SIZE);
-        memcpy(pdata, vid->palette, BVID_PALETTE_SIZE);
-        av_freep(&vid->palette);
-    }
-
-    vid->nframes--;  // used to check if all the frames were read
-    return 0;
-fail:
-    av_free(vidbuf_start);
-    return ret;
-}
-
-static int vid_read_packet(AVFormatContext *s,
-                           AVPacket *pkt)
-{
-    BVID_DemuxContext *vid = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned char block_type;
-    int audio_length;
-    int ret_value;
-
-    if(vid->is_finished || pb->eof_reached)
-        return AVERROR(EIO);
-
-    block_type = avio_r8(pb);
-    switch(block_type){
-        case PALETTE_BLOCK:
-            if (vid->palette) {
-                av_log(s, AV_LOG_WARNING, "discarding unused palette\n");
-                av_freep(&vid->palette);
-            }
-            vid->palette = av_malloc(BVID_PALETTE_SIZE);
-            if (!vid->palette)
-                return AVERROR(ENOMEM);
-            if (avio_read(pb, vid->palette, BVID_PALETTE_SIZE) != BVID_PALETTE_SIZE) {
-                av_freep(&vid->palette);
-                return AVERROR(EIO);
-            }
-            return vid_read_packet(s, pkt);
-
-        case FIRST_AUDIO_BLOCK:
-            avio_rl16(pb);
-            // soundblaster DAC used for sample rate, as on specification page (link above)
-            vid->sample_rate = 1000000 / (256 - avio_r8(pb));
-        case AUDIO_BLOCK:
-            if (vid->audio_index < 0) {
-                AVStream *st = avformat_new_stream(s, NULL);
-                if (!st)
-                    return AVERROR(ENOMEM);
-                vid->audio_index                 = st->index;
-                st->codec->codec_type            = AVMEDIA_TYPE_AUDIO;
-                st->codec->codec_id              = AV_CODEC_ID_PCM_U8;
-                st->codec->channels              = 1;
-                st->codec->channel_layout        = AV_CH_LAYOUT_MONO;
-                st->codec->bits_per_coded_sample = 8;
-                st->codec->sample_rate           = vid->sample_rate;
-                st->codec->bit_rate              = 8 * st->codec->sample_rate;
-                st->start_time                   = 0;
-                avpriv_set_pts_info(st, 64, 1, vid->sample_rate);
-            }
-            audio_length = avio_rl16(pb);
-            if ((ret_value = av_get_packet(pb, pkt, audio_length)) != audio_length) {
-                if (ret_value < 0)
-                    return ret_value;
-                av_log(s, AV_LOG_ERROR, "incomplete audio block\n");
-                return AVERROR(EIO);
-            }
-            pkt->stream_index = vid->audio_index;
-            pkt->duration     = audio_length;
-            pkt->flags |= AV_PKT_FLAG_KEY;
-            return 0;
-
-        case VIDEO_P_FRAME:
-        case VIDEO_YOFF_P_FRAME:
-        case VIDEO_I_FRAME:
-            return read_frame(vid, pb, pkt, block_type, s);
-
-        case EOF_BLOCK:
-            if(vid->nframes != 0)
-                av_log(s, AV_LOG_VERBOSE, "reached terminating character but not all frames read.\n");
-            vid->is_finished = 1;
-            return AVERROR(EIO);
-        default:
-            av_log(s, AV_LOG_ERROR, "unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
-                   block_type, block_type, block_type);
-            return AVERROR_INVALIDDATA;
-    }
-}
-
-static int vid_read_close(AVFormatContext *s)
-{
-    BVID_DemuxContext *vid = s->priv_data;
-    av_freep(&vid->palette);
-    return 0;
-}
-
-AVInputFormat ff_bethsoftvid_demuxer = {
-    .name           = "bethsoftvid",
-    .long_name      = NULL_IF_CONFIG_SMALL("Bethesda Softworks VID"),
-    .priv_data_size = sizeof(BVID_DemuxContext),
-    .read_probe     = vid_probe,
-    .read_header    = vid_read_header,
-    .read_packet    = vid_read_packet,
-    .read_close     = vid_read_close,
-};
diff --git a/deps/libav/libavformat/bfi.c b/deps/libav/libavformat/bfi.c
deleted file mode 100644
index 19060e7..0000000
--- a/deps/libav/libavformat/bfi.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Brute Force & Ignorance (BFI) demuxer
- * Copyright (c) 2008 Sisir Koppaka
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Brute Force & Ignorance (.bfi) file demuxer
- * @author Sisir Koppaka ( sisir.koppaka at gmail dot com )
- * @see http://wiki.multimedia.cx/index.php?title=BFI
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct BFIContext {
-    int nframes;
-    int audio_frame;
-    int video_frame;
-    int video_size;
-    int avflag;
-} BFIContext;
-
-static int bfi_probe(AVProbeData * p)
-{
-    /* Check file header */
-    if (AV_RL32(p->buf) == MKTAG('B', 'F', '&', 'I'))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int bfi_read_header(AVFormatContext * s)
-{
-    BFIContext *bfi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *vstream;
-    AVStream *astream;
-    int fps, chunk_header;
-
-    /* Initialize the video codec... */
-    vstream = avformat_new_stream(s, NULL);
-    if (!vstream)
-        return AVERROR(ENOMEM);
-
-    /* Initialize the audio codec... */
-    astream = avformat_new_stream(s, NULL);
-    if (!astream)
-        return AVERROR(ENOMEM);
-
-    /* Set the total number of frames. */
-    avio_skip(pb, 8);
-    chunk_header           = avio_rl32(pb);
-    bfi->nframes           = avio_rl32(pb);
-    avio_rl32(pb);
-    avio_rl32(pb);
-    avio_rl32(pb);
-    fps                    = avio_rl32(pb);
-    avio_skip(pb, 12);
-    vstream->codec->width  = avio_rl32(pb);
-    vstream->codec->height = avio_rl32(pb);
-
-    /*Load the palette to extradata */
-    avio_skip(pb, 8);
-    vstream->codec->extradata      = av_malloc(768);
-    vstream->codec->extradata_size = 768;
-    avio_read(pb, vstream->codec->extradata,
-               vstream->codec->extradata_size);
-
-    astream->codec->sample_rate = avio_rl32(pb);
-
-    /* Set up the video codec... */
-    avpriv_set_pts_info(vstream, 32, 1, fps);
-    vstream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    vstream->codec->codec_id   = AV_CODEC_ID_BFI;
-    vstream->codec->pix_fmt    = AV_PIX_FMT_PAL8;
-
-    /* Set up the audio codec now... */
-    astream->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    astream->codec->codec_id        = AV_CODEC_ID_PCM_U8;
-    astream->codec->channels        = 1;
-    astream->codec->channel_layout  = AV_CH_LAYOUT_MONO;
-    astream->codec->bits_per_coded_sample = 8;
-    astream->codec->bit_rate        =
-        astream->codec->sample_rate * astream->codec->bits_per_coded_sample;
-    avio_seek(pb, chunk_header - 3, SEEK_SET);
-    avpriv_set_pts_info(astream, 64, 1, astream->codec->sample_rate);
-    return 0;
-}
-
-
-static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
-{
-    BFIContext *bfi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret, audio_offset, video_offset, chunk_size, audio_size = 0;
-    if (bfi->nframes == 0 || pb->eof_reached) {
-        return AVERROR(EIO);
-    }
-
-    /* If all previous chunks were completely read, then find a new one... */
-    if (!bfi->avflag) {
-        uint32_t state = 0;
-        while(state != MKTAG('S','A','V','I')){
-            if (pb->eof_reached)
-                return AVERROR(EIO);
-            state = 256*state + avio_r8(pb);
-        }
-        /* Now that the chunk's location is confirmed, we proceed... */
-        chunk_size      = avio_rl32(pb);
-        avio_rl32(pb);
-        audio_offset    = avio_rl32(pb);
-        avio_rl32(pb);
-        video_offset    = avio_rl32(pb);
-        audio_size      = video_offset - audio_offset;
-        bfi->video_size = chunk_size - video_offset;
-        if (audio_size < 0 || bfi->video_size < 0) {
-            av_log(s, AV_LOG_ERROR, "Invalid audio/video offsets or chunk size\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        //Tossing an audio packet at the audio decoder.
-        ret = av_get_packet(pb, pkt, audio_size);
-        if (ret < 0)
-            return ret;
-
-        pkt->pts          = bfi->audio_frame;
-        bfi->audio_frame += ret;
-    } else if (bfi->video_size > 0) {
-
-        //Tossing a video packet at the video decoder.
-        ret = av_get_packet(pb, pkt, bfi->video_size);
-        if (ret < 0)
-            return ret;
-
-        pkt->pts          = bfi->video_frame;
-        bfi->video_frame += ret / bfi->video_size;
-
-        /* One less frame to read. A cursory decrement. */
-        bfi->nframes--;
-    } else {
-        /* Empty video packet */
-        ret = AVERROR(EAGAIN);
-    }
-
-    bfi->avflag       = !bfi->avflag;
-    pkt->stream_index = bfi->avflag;
-    return ret;
-}
-
-AVInputFormat ff_bfi_demuxer = {
-    .name           = "bfi",
-    .long_name      = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"),
-    .priv_data_size = sizeof(BFIContext),
-    .read_probe     = bfi_probe,
-    .read_header    = bfi_read_header,
-    .read_packet    = bfi_read_packet,
-};
diff --git a/deps/libav/libavformat/bink.c b/deps/libav/libavformat/bink.c
deleted file mode 100644
index f093e7c..0000000
--- a/deps/libav/libavformat/bink.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Bink demuxer
- * Copyright (c) 2008-2010 Peter Ross (pross at xvid.org)
- * Copyright (c) 2009 Daniel Verkamp (daniel at drv.nu)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Bink demuxer
- *
- * Technical details here:
- *  http://wiki.multimedia.cx/index.php?title=Bink_Container
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-enum BinkAudFlags {
-    BINK_AUD_16BITS = 0x4000, ///< prefer 16-bit output
-    BINK_AUD_STEREO = 0x2000,
-    BINK_AUD_USEDCT = 0x1000,
-};
-
-#define BINK_EXTRADATA_SIZE     1
-#define BINK_MAX_AUDIO_TRACKS   256
-#define BINK_MAX_WIDTH          7680
-#define BINK_MAX_HEIGHT         4800
-
-typedef struct {
-    uint32_t file_size;
-
-    uint32_t num_audio_tracks;
-    int current_track;      ///< audio track to return in next packet
-    int64_t video_pts;
-    int64_t audio_pts[BINK_MAX_AUDIO_TRACKS];
-
-    uint32_t remain_packet_size;
-} BinkDemuxContext;
-
-static int probe(AVProbeData *p)
-{
-    const uint8_t *b = p->buf;
-
-    if ( b[0] == 'B' && b[1] == 'I' && b[2] == 'K' &&
-        (b[3] == 'b' || b[3] == 'f' || b[3] == 'g' || b[3] == 'h' || b[3] == 'i') &&
-        AV_RL32(b+8) > 0 &&  // num_frames
-        AV_RL32(b+20) > 0 && AV_RL32(b+20) <= BINK_MAX_WIDTH &&
-        AV_RL32(b+24) > 0 && AV_RL32(b+24) <= BINK_MAX_HEIGHT &&
-        AV_RL32(b+28) > 0 && AV_RL32(b+32) > 0)  // fps num,den
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int read_header(AVFormatContext *s)
-{
-    BinkDemuxContext *bink = s->priv_data;
-    AVIOContext *pb = s->pb;
-    uint32_t fps_num, fps_den;
-    AVStream *vst, *ast;
-    unsigned int i;
-    uint32_t pos, next_pos;
-    uint16_t flags;
-    int keyframe;
-
-    vst = avformat_new_stream(s, NULL);
-    if (!vst)
-        return AVERROR(ENOMEM);
-
-    vst->codec->codec_tag = avio_rl32(pb);
-
-    bink->file_size = avio_rl32(pb) + 8;
-    vst->duration   = avio_rl32(pb);
-
-    if (vst->duration > 1000000) {
-        av_log(s, AV_LOG_ERROR, "invalid header: more than 1000000 frames\n");
-        return AVERROR(EIO);
-    }
-
-    if (avio_rl32(pb) > bink->file_size) {
-        av_log(s, AV_LOG_ERROR,
-               "invalid header: largest frame size greater than file size\n");
-        return AVERROR(EIO);
-    }
-
-    avio_skip(pb, 4);
-
-    vst->codec->width  = avio_rl32(pb);
-    vst->codec->height = avio_rl32(pb);
-
-    fps_num = avio_rl32(pb);
-    fps_den = avio_rl32(pb);
-    if (fps_num == 0 || fps_den == 0) {
-        av_log(s, AV_LOG_ERROR, "invalid header: invalid fps (%d/%d)\n", fps_num, fps_den);
-        return AVERROR(EIO);
-    }
-    avpriv_set_pts_info(vst, 64, fps_den, fps_num);
-    vst->avg_frame_rate = av_inv_q(vst->time_base);
-
-    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_id   = AV_CODEC_ID_BINKVIDEO;
-    vst->codec->extradata  = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!vst->codec->extradata)
-        return AVERROR(ENOMEM);
-    vst->codec->extradata_size = 4;
-    avio_read(pb, vst->codec->extradata, 4);
-
-    bink->num_audio_tracks = avio_rl32(pb);
-
-    if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) {
-        av_log(s, AV_LOG_ERROR,
-               "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%d)\n",
-               bink->num_audio_tracks);
-        return AVERROR(EIO);
-    }
-
-    if (bink->num_audio_tracks) {
-        avio_skip(pb, 4 * bink->num_audio_tracks);
-
-        for (i = 0; i < bink->num_audio_tracks; i++) {
-            ast = avformat_new_stream(s, NULL);
-            if (!ast)
-                return AVERROR(ENOMEM);
-            ast->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-            ast->codec->codec_tag   = 0;
-            ast->codec->sample_rate = avio_rl16(pb);
-            avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
-            flags = avio_rl16(pb);
-            ast->codec->codec_id = flags & BINK_AUD_USEDCT ?
-                                   AV_CODEC_ID_BINKAUDIO_DCT : AV_CODEC_ID_BINKAUDIO_RDFT;
-            if (flags & BINK_AUD_STEREO) {
-                ast->codec->channels       = 2;
-                ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-            } else {
-                ast->codec->channels       = 1;
-                ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
-            }
-            ast->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!ast->codec->extradata)
-                return AVERROR(ENOMEM);
-            ast->codec->extradata_size = 4;
-            AV_WL32(ast->codec->extradata, vst->codec->codec_tag);
-        }
-
-        for (i = 0; i < bink->num_audio_tracks; i++)
-            s->streams[i + 1]->id = avio_rl32(pb);
-    }
-
-    /* frame index table */
-    next_pos = avio_rl32(pb);
-    for (i = 0; i < vst->duration; i++) {
-        pos = next_pos;
-        if (i == vst->duration - 1) {
-            next_pos = bink->file_size;
-            keyframe = 0;
-        } else {
-            next_pos = avio_rl32(pb);
-            keyframe = pos & 1;
-        }
-        pos &= ~1;
-        next_pos &= ~1;
-
-        if (next_pos <= pos) {
-            av_log(s, AV_LOG_ERROR, "invalid frame index table\n");
-            return AVERROR(EIO);
-        }
-        av_add_index_entry(vst, pos, i, next_pos - pos, 0,
-                           keyframe ? AVINDEX_KEYFRAME : 0);
-    }
-
-    avio_skip(pb, 4);
-
-    bink->current_track = -1;
-    return 0;
-}
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    BinkDemuxContext *bink = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret;
-
-    if (bink->current_track < 0) {
-        int index_entry;
-        AVStream *st = s->streams[0]; // stream 0 is video stream with index
-
-        if (bink->video_pts >= st->duration)
-            return AVERROR(EIO);
-
-        index_entry = av_index_search_timestamp(st, bink->video_pts,
-                                                AVSEEK_FLAG_ANY);
-        if (index_entry < 0) {
-            av_log(s, AV_LOG_ERROR,
-                   "could not find index entry for frame %"PRId64"\n",
-                   bink->video_pts);
-            return AVERROR(EIO);
-        }
-
-        bink->remain_packet_size = st->index_entries[index_entry].size;
-        bink->current_track = 0;
-    }
-
-    while (bink->current_track < bink->num_audio_tracks) {
-        uint32_t audio_size = avio_rl32(pb);
-        if (audio_size > bink->remain_packet_size - 4) {
-            av_log(s, AV_LOG_ERROR,
-                   "frame %"PRId64": audio size in header (%u) > size of packet left (%u)\n",
-                   bink->video_pts, audio_size, bink->remain_packet_size);
-            return AVERROR(EIO);
-        }
-        bink->remain_packet_size -= 4 + audio_size;
-        bink->current_track++;
-        if (audio_size >= 4) {
-            /* get one audio packet per track */
-            if ((ret = av_get_packet(pb, pkt, audio_size)) < 0)
-                return ret;
-            pkt->stream_index = bink->current_track;
-            pkt->pts = bink->audio_pts[bink->current_track - 1];
-
-            /* Each audio packet reports the number of decompressed samples
-               (in bytes). We use this value to calcuate the audio PTS */
-            if (pkt->size >= 4)
-                bink->audio_pts[bink->current_track -1] +=
-                    AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codec->channels);
-            return 0;
-        } else {
-            avio_skip(pb, audio_size);
-        }
-    }
-
-    /* get video packet */
-    if ((ret = av_get_packet(pb, pkt, bink->remain_packet_size)) < 0)
-        return ret;
-    pkt->stream_index = 0;
-    pkt->pts = bink->video_pts++;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-
-    /* -1 instructs the next call to read_packet() to read the next frame */
-    bink->current_track = -1;
-
-    return 0;
-}
-
-static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
-{
-    BinkDemuxContext *bink = s->priv_data;
-    AVStream *vst = s->streams[0];
-
-    if (!s->pb->seekable)
-        return -1;
-
-    /* seek to the first frame */
-    if (avio_seek(s->pb, vst->index_entries[0].pos, SEEK_SET) < 0)
-        return -1;
-
-    bink->video_pts = 0;
-    memset(bink->audio_pts, 0, sizeof(bink->audio_pts));
-    bink->current_track = -1;
-    return 0;
-}
-
-AVInputFormat ff_bink_demuxer = {
-    .name           = "bink",
-    .long_name      = NULL_IF_CONFIG_SMALL("Bink"),
-    .priv_data_size = sizeof(BinkDemuxContext),
-    .read_probe     = probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .read_seek      = read_seek,
-};
diff --git a/deps/libav/libavformat/bmv.c b/deps/libav/libavformat/bmv.c
deleted file mode 100644
index b5572af..0000000
--- a/deps/libav/libavformat/bmv.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Discworld II BMV demuxer
- * Copyright (c) 2011 Konstantin Shishkov.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-#include "internal.h"
-
-enum BMVFlags {
-    BMV_NOP = 0,
-    BMV_END,
-    BMV_DELTA,
-    BMV_INTRA,
-
-    BMV_AUDIO   = 0x20,
-};
-
-typedef struct BMVContext {
-    uint8_t *packet;
-    int      size;
-    int      get_next;
-    int64_t  audio_pos;
-} BMVContext;
-
-static int bmv_read_header(AVFormatContext *s)
-{
-    AVStream *st, *ast;
-    BMVContext *c = s->priv_data;
-
-    st = avformat_new_stream(s, 0);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_BMV_VIDEO;
-    st->codec->width      = 640;
-    st->codec->height     = 429;
-    st->codec->pix_fmt    = AV_PIX_FMT_PAL8;
-    avpriv_set_pts_info(st, 16, 1, 12);
-    ast = avformat_new_stream(s, 0);
-    if (!ast)
-        return AVERROR(ENOMEM);
-    ast->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    ast->codec->codec_id        = AV_CODEC_ID_BMV_AUDIO;
-    ast->codec->channels        = 2;
-    ast->codec->channel_layout  = AV_CH_LAYOUT_STEREO;
-    ast->codec->sample_rate     = 22050;
-    avpriv_set_pts_info(ast, 16, 1, 22050);
-
-    c->get_next  = 1;
-    c->audio_pos = 0;
-    return 0;
-}
-
-static int bmv_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    BMVContext *c = s->priv_data;
-    int type, err;
-
-    while (c->get_next) {
-        if (s->pb->eof_reached)
-            return AVERROR_EOF;
-        type = avio_r8(s->pb);
-        if (type == BMV_NOP)
-            continue;
-        if (type == BMV_END)
-            return AVERROR_EOF;
-        c->size = avio_rl24(s->pb);
-        if (!c->size)
-            return AVERROR_INVALIDDATA;
-        if ((err = av_reallocp(&c->packet, c->size + 1)) < 0)
-            return err;
-        c->packet[0] = type;
-        if (avio_read(s->pb, c->packet + 1, c->size) != c->size)
-            return AVERROR(EIO);
-        if (type & BMV_AUDIO) {
-            int audio_size = c->packet[1] * 65 + 1;
-            if (audio_size >= c->size) {
-                av_log(s, AV_LOG_ERROR, "Reported audio size %d is bigger than packet size (%d)\n",
-                       audio_size, c->size);
-                return AVERROR_INVALIDDATA;
-            }
-            if (av_new_packet(pkt, audio_size) < 0)
-                return AVERROR(ENOMEM);
-            memcpy(pkt->data, c->packet + 1, pkt->size);
-            pkt->stream_index = 1;
-            pkt->pts          = c->audio_pos;
-            pkt->duration     = c->packet[1] * 32;
-            c->audio_pos += pkt->duration;
-            c->get_next   = 0;
-            return pkt->size;
-        } else
-            break;
-    }
-    if (av_new_packet(pkt, c->size + 1) < 0)
-        return AVERROR(ENOMEM);
-    pkt->stream_index = 0;
-    c->get_next = 1;
-    memcpy(pkt->data, c->packet, pkt->size);
-    return pkt->size;
-}
-
-static int bmv_read_close(AVFormatContext *s)
-{
-    BMVContext *c = s->priv_data;
-
-    av_freep(&c->packet);
-
-    return 0;
-}
-
-AVInputFormat ff_bmv_demuxer = {
-    .name           = "bmv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Discworld II BMV"),
-    .priv_data_size = sizeof(BMVContext),
-    .read_header    = bmv_read_header,
-    .read_packet    = bmv_read_packet,
-    .read_close     = bmv_read_close,
-    .extensions     = "bmv",
-};
diff --git a/deps/libav/libavformat/c93.c b/deps/libav/libavformat/c93.c
deleted file mode 100644
index 3f2a98f..0000000
--- a/deps/libav/libavformat/c93.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Interplay C93 demuxer
- * Copyright (c) 2007 Anssi Hannula <anssi.hannula at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "voc.h"
-#include "libavutil/intreadwrite.h"
-
-typedef struct {
-    uint16_t index;
-    uint8_t length;
-    uint8_t frames;
-} C93BlockRecord;
-
-typedef struct {
-    VocDecContext voc;
-
-    C93BlockRecord block_records[512];
-    int current_block;
-
-    uint32_t frame_offsets[32];
-    int current_frame;
-    int next_pkt_is_audio;
-
-    AVStream *audio;
-} C93DemuxContext;
-
-static int probe(AVProbeData *p)
-{
-    int i;
-    int index = 1;
-    if (p->buf_size < 16)
-        return 0;
-    for (i = 0; i < 16; i += 4) {
-        if (AV_RL16(p->buf + i) != index || !p->buf[i + 2] || !p->buf[i + 3])
-            return 0;
-        index += p->buf[i + 2];
-    }
-    return AVPROBE_SCORE_MAX;
-}
-
-static int read_header(AVFormatContext *s)
-{
-    AVStream *video;
-    AVIOContext *pb = s->pb;
-    C93DemuxContext *c93 = s->priv_data;
-    int i;
-    int framecount = 0;
-
-    for (i = 0; i < 512; i++) {
-        c93->block_records[i].index = avio_rl16(pb);
-        c93->block_records[i].length = avio_r8(pb);
-        c93->block_records[i].frames = avio_r8(pb);
-        if (c93->block_records[i].frames > 32) {
-            av_log(s, AV_LOG_ERROR, "too many frames in block\n");
-            return AVERROR_INVALIDDATA;
-        }
-        framecount += c93->block_records[i].frames;
-    }
-
-    /* Audio streams are added if audio packets are found */
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    video = avformat_new_stream(s, NULL);
-    if (!video)
-        return AVERROR(ENOMEM);
-
-    video->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    video->codec->codec_id = AV_CODEC_ID_C93;
-    video->codec->width = 320;
-    video->codec->height = 192;
-    /* 4:3 320x200 with 8 empty lines */
-    video->sample_aspect_ratio = (AVRational) { 5, 6 };
-    avpriv_set_pts_info(video, 64, 2, 25);
-    video->nb_frames = framecount;
-    video->duration = framecount;
-    video->start_time = 0;
-
-    c93->current_block = 0;
-    c93->current_frame = 0;
-    c93->next_pkt_is_audio = 0;
-    return 0;
-}
-
-#define C93_HAS_PALETTE 0x01
-#define C93_FIRST_FRAME 0x02
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    C93DemuxContext *c93 = s->priv_data;
-    C93BlockRecord *br = &c93->block_records[c93->current_block];
-    int datasize;
-    int ret, i;
-
-    if (c93->next_pkt_is_audio) {
-        c93->current_frame++;
-        c93->next_pkt_is_audio = 0;
-        datasize = avio_rl16(pb);
-        if (datasize > 42) {
-            if (!c93->audio) {
-                c93->audio = avformat_new_stream(s, NULL);
-                if (!c93->audio)
-                    return AVERROR(ENOMEM);
-                c93->audio->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            }
-            avio_skip(pb, 26); /* VOC header */
-            ret = ff_voc_get_packet(s, pkt, c93->audio, datasize - 26);
-            if (ret > 0) {
-                pkt->stream_index = 1;
-                pkt->flags |= AV_PKT_FLAG_KEY;
-                return ret;
-            }
-        }
-    }
-    if (c93->current_frame >= br->frames) {
-        if (c93->current_block >= 511 || !br[1].length)
-            return AVERROR(EIO);
-        br++;
-        c93->current_block++;
-        c93->current_frame = 0;
-    }
-
-    if (c93->current_frame == 0) {
-        avio_seek(pb, br->index * 2048, SEEK_SET);
-        for (i = 0; i < 32; i++) {
-            c93->frame_offsets[i] = avio_rl32(pb);
-        }
-    }
-
-    avio_seek(pb,br->index * 2048 +
-            c93->frame_offsets[c93->current_frame], SEEK_SET);
-    datasize = avio_rl16(pb); /* video frame size */
-
-    ret = av_new_packet(pkt, datasize + 768 + 1);
-    if (ret < 0)
-        return ret;
-    pkt->data[0] = 0;
-    pkt->size = datasize + 1;
-
-    ret = avio_read(pb, pkt->data + 1, datasize);
-    if (ret < datasize) {
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-
-    datasize = avio_rl16(pb); /* palette size */
-    if (datasize) {
-        if (datasize != 768) {
-            av_log(s, AV_LOG_ERROR, "invalid palette size %u\n", datasize);
-            ret = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-        pkt->data[0] |= C93_HAS_PALETTE;
-        ret = avio_read(pb, pkt->data + pkt->size, datasize);
-        if (ret < datasize) {
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        pkt->size += 768;
-    }
-    pkt->stream_index = 0;
-    c93->next_pkt_is_audio = 1;
-
-    /* only the first frame is guaranteed to not reference previous frames */
-    if (c93->current_block == 0 && c93->current_frame == 0) {
-        pkt->flags |= AV_PKT_FLAG_KEY;
-        pkt->data[0] |= C93_FIRST_FRAME;
-    }
-    return 0;
-
-    fail:
-    av_free_packet(pkt);
-    return ret;
-}
-
-AVInputFormat ff_c93_demuxer = {
-    .name           = "c93",
-    .long_name      = NULL_IF_CONFIG_SMALL("Interplay C93"),
-    .priv_data_size = sizeof(C93DemuxContext),
-    .read_probe     = probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-};
diff --git a/deps/libav/libavformat/caf.c b/deps/libav/libavformat/caf.c
deleted file mode 100644
index cf128d5..0000000
--- a/deps/libav/libavformat/caf.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * CAF common code
- * Copyright (c) 2007  Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * CAF common code
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "caf.h"
-
-/**
- * Known codec tags for CAF
- */
-const AVCodecTag ff_codec_caf_tags[] = {
-    { AV_CODEC_ID_AAC,             MKBETAG('a','a','c',' ') },
-    { AV_CODEC_ID_AC3,             MKBETAG('a','c','-','3') },
-    { AV_CODEC_ID_ALAC,            MKBETAG('a','l','a','c') },
-  /* FIXME: use DV demuxer, as done in MOV */
-  /*{ AV_CODEC_ID_DVAUDIO,         MKBETAG('v','d','v','a') },*/
-  /*{ AV_CODEC_ID_DVAUDIO,         MKBETAG('d','v','c','a') },*/
-    { AV_CODEC_ID_ADPCM_IMA_QT,    MKBETAG('i','m','a','4') },
-    { AV_CODEC_ID_MACE3,           MKBETAG('M','A','C','3') },
-    { AV_CODEC_ID_MACE6,           MKBETAG('M','A','C','6') },
-    { AV_CODEC_ID_MP3,             MKBETAG('.','m','p','3') },
-    { AV_CODEC_ID_MP2,             MKBETAG('.','m','p','2') },
-    { AV_CODEC_ID_MP1,             MKBETAG('.','m','p','1') },
-    { AV_CODEC_ID_PCM_ALAW,        MKBETAG('a','l','a','w') },
-    { AV_CODEC_ID_PCM_MULAW,       MKBETAG('u','l','a','w') },
-    { AV_CODEC_ID_QCELP,           MKBETAG('Q','c','l','p') },
-    { AV_CODEC_ID_QDM2,            MKBETAG('Q','D','M','2') },
-    { AV_CODEC_ID_QDM2,            MKBETAG('Q','D','M','C') },
-  /* currently unsupported codecs */
-  /*{ AC-3 over S/PDIF          MKBETAG('c','a','c','3') },*/
-  /*{ MPEG4CELP                 MKBETAG('c','e','l','p') },*/
-  /*{ MPEG4HVXC                 MKBETAG('h','v','x','c') },*/
-  /*{ MPEG4TwinVQ               MKBETAG('t','w','v','q') },*/
-    { AV_CODEC_ID_NONE,            0 },
-};
diff --git a/deps/libav/libavformat/caf.h b/deps/libav/libavformat/caf.h
deleted file mode 100644
index 7ca4dc5..0000000
--- a/deps/libav/libavformat/caf.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * CAF common code
- * Copyright (c) 2007  Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * CAF common code
- */
-
-#ifndef AVFORMAT_CAF_H
-#define AVFORMAT_CAF_H
-
-#include "internal.h"
-
-extern const AVCodecTag ff_codec_caf_tags[];
-
-#endif /* AVFORMAT_CAF_H */
diff --git a/deps/libav/libavformat/cafdec.c b/deps/libav/libavformat/cafdec.c
deleted file mode 100644
index 6950eb2..0000000
--- a/deps/libav/libavformat/cafdec.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * Core Audio Format demuxer
- * Copyright (c) 2007 Justin Ruggles
- * Copyright (c) 2009 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Core Audio Format demuxer
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "isom.h"
-#include "mov_chan.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/dict.h"
-#include "caf.h"
-
-typedef struct {
-    int bytes_per_packet;           ///< bytes in a packet, or 0 if variable
-    int frames_per_packet;          ///< frames in a packet, or 0 if variable
-    int64_t num_bytes;              ///< total number of bytes in stream
-
-    int64_t packet_cnt;             ///< packet counter
-    int64_t frame_cnt;              ///< frame counter
-
-    int64_t data_start;             ///< data start position, in bytes
-    int64_t data_size;              ///< raw data size, in bytes
-} CaffContext;
-
-static int probe(AVProbeData *p)
-{
-    if (AV_RB32(p->buf) == MKBETAG('c','a','f','f') && AV_RB16(&p->buf[4]) == 1)
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-/** Read audio description chunk */
-static int read_desc_chunk(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    CaffContext *caf  = s->priv_data;
-    AVStream *st;
-    int flags;
-
-    /* new audio stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    /* parse format description */
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->sample_rate = av_int2double(avio_rb64(pb));
-    st->codec->codec_tag   = avio_rb32(pb);
-    flags = avio_rb32(pb);
-    caf->bytes_per_packet  = avio_rb32(pb);
-    st->codec->block_align = caf->bytes_per_packet;
-    caf->frames_per_packet = avio_rb32(pb);
-    st->codec->channels    = avio_rb32(pb);
-    st->codec->bits_per_coded_sample = avio_rb32(pb);
-
-    /* calculate bit rate for constant size packets */
-    if (caf->frames_per_packet > 0 && caf->bytes_per_packet > 0) {
-        st->codec->bit_rate = (uint64_t)st->codec->sample_rate * (uint64_t)caf->bytes_per_packet * 8
-                              / (uint64_t)caf->frames_per_packet;
-    } else {
-        st->codec->bit_rate = 0;
-    }
-
-    /* determine codec */
-    if (st->codec->codec_tag == MKBETAG('l','p','c','m'))
-        st->codec->codec_id = ff_mov_get_lpcm_codec_id(st->codec->bits_per_coded_sample, (flags ^ 0x2) | 0x4);
-    else
-        st->codec->codec_id = ff_codec_get_id(ff_codec_caf_tags, st->codec->codec_tag);
-    return 0;
-}
-
-/** Read magic cookie chunk */
-static int read_kuki_chunk(AVFormatContext *s, int64_t size)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st      = s->streams[0];
-
-    if (size < 0 || size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
-        return -1;
-
-    if (st->codec->codec_id == AV_CODEC_ID_AAC) {
-        /* The magic cookie format for AAC is an mp4 esds atom.
-           The lavc AAC decoder requires the data from the codec specific
-           description as extradata input. */
-        int strt, skip;
-        MOVAtom atom;
-
-        strt = avio_tell(pb);
-        ff_mov_read_esds(s, pb, atom);
-        skip = size - (avio_tell(pb) - strt);
-        if (skip < 0 || !st->codec->extradata ||
-            st->codec->codec_id != AV_CODEC_ID_AAC) {
-            av_log(s, AV_LOG_ERROR, "invalid AAC magic cookie\n");
-            return AVERROR_INVALIDDATA;
-        }
-        avio_skip(pb, skip);
-    } else if (st->codec->codec_id == AV_CODEC_ID_ALAC) {
-#define ALAC_PREAMBLE 12
-#define ALAC_HEADER   36
-#define ALAC_NEW_KUKI 24
-        uint8_t preamble[12];
-        if (size < ALAC_NEW_KUKI) {
-            av_log(s, AV_LOG_ERROR, "invalid ALAC magic cookie\n");
-            avio_skip(pb, size);
-            return AVERROR_INVALIDDATA;
-        }
-        avio_read(pb, preamble, ALAC_PREAMBLE);
-
-        st->codec->extradata = av_mallocz(ALAC_HEADER + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!st->codec->extradata)
-            return AVERROR(ENOMEM);
-
-        /* For the old style cookie, we skip 12 bytes, then read 36 bytes.
-         * The new style cookie only contains the last 24 bytes of what was
-         * 36 bytes in the old style cookie, so we fabricate the first 12 bytes
-         * in that case to maintain compatibility. */
-        if (!memcmp(&preamble[4], "frmaalac", 8)) {
-            if (size < ALAC_PREAMBLE + ALAC_HEADER) {
-                av_log(s, AV_LOG_ERROR, "invalid ALAC magic cookie\n");
-                av_freep(&st->codec->extradata);
-                return AVERROR_INVALIDDATA;
-            }
-            avio_read(pb, st->codec->extradata, ALAC_HEADER);
-            avio_skip(pb, size - ALAC_PREAMBLE - ALAC_HEADER);
-        } else {
-            AV_WB32(st->codec->extradata, 36);
-            memcpy(&st->codec->extradata[4], "alac", 4);
-            AV_WB32(&st->codec->extradata[8], 0);
-            memcpy(&st->codec->extradata[12], preamble, 12);
-            avio_read(pb, &st->codec->extradata[24], ALAC_NEW_KUKI - 12);
-            avio_skip(pb, size - ALAC_NEW_KUKI);
-        }
-        st->codec->extradata_size = ALAC_HEADER;
-    } else {
-        st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!st->codec->extradata)
-            return AVERROR(ENOMEM);
-        avio_read(pb, st->codec->extradata, size);
-        st->codec->extradata_size = size;
-    }
-
-    return 0;
-}
-
-/** Read packet table chunk */
-static int read_pakt_chunk(AVFormatContext *s, int64_t size)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st      = s->streams[0];
-    CaffContext *caf  = s->priv_data;
-    int64_t pos = 0, ccount, num_packets;
-    int i;
-
-    ccount = avio_tell(pb);
-
-    num_packets = avio_rb64(pb);
-    if (num_packets < 0 || INT32_MAX / sizeof(AVIndexEntry) < num_packets)
-        return AVERROR_INVALIDDATA;
-
-    st->nb_frames  = avio_rb64(pb); /* valid frames */
-    st->nb_frames += avio_rb32(pb); /* priming frames */
-    st->nb_frames += avio_rb32(pb); /* remainder frames */
-
-    st->duration = 0;
-    for (i = 0; i < num_packets; i++) {
-        av_add_index_entry(s->streams[0], pos, st->duration, 0, 0, AVINDEX_KEYFRAME);
-        pos += caf->bytes_per_packet ? caf->bytes_per_packet : ff_mp4_read_descr_len(pb);
-        st->duration += caf->frames_per_packet ? caf->frames_per_packet : ff_mp4_read_descr_len(pb);
-    }
-
-    if (avio_tell(pb) - ccount > size) {
-        av_log(s, AV_LOG_ERROR, "error reading packet table\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avio_skip(pb, ccount + size - avio_tell(pb));
-
-    caf->num_bytes = pos;
-    return 0;
-}
-
-/** Read information chunk */
-static void read_info_chunk(AVFormatContext *s, int64_t size)
-{
-    AVIOContext *pb = s->pb;
-    unsigned int i;
-    unsigned int nb_entries = avio_rb32(pb);
-    for (i = 0; i < nb_entries; i++) {
-        char key[32];
-        char value[1024];
-        avio_get_str(pb, INT_MAX, key,   sizeof(key));
-        avio_get_str(pb, INT_MAX, value, sizeof(value));
-        av_dict_set(&s->metadata, key, value, 0);
-    }
-}
-
-static int read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    CaffContext *caf  = s->priv_data;
-    AVStream *st;
-    uint32_t tag = 0;
-    int found_data, ret;
-    int64_t size;
-
-    avio_skip(pb, 8); /* magic, version, file flags */
-
-    /* audio description chunk */
-    if (avio_rb32(pb) != MKBETAG('d','e','s','c')) {
-        av_log(s, AV_LOG_ERROR, "desc chunk not present\n");
-        return AVERROR_INVALIDDATA;
-    }
-    size = avio_rb64(pb);
-    if (size != 32)
-        return AVERROR_INVALIDDATA;
-
-    ret = read_desc_chunk(s);
-    if (ret)
-        return ret;
-    st = s->streams[0];
-
-    /* parse each chunk */
-    found_data = 0;
-    while (!pb->eof_reached) {
-
-        /* stop at data chunk if seeking is not supported or
-           data chunk size is unknown */
-        if (found_data && (caf->data_size < 0 || !pb->seekable))
-            break;
-
-        tag  = avio_rb32(pb);
-        size = avio_rb64(pb);
-        if (pb->eof_reached)
-            break;
-
-        switch (tag) {
-        case MKBETAG('d','a','t','a'):
-            avio_skip(pb, 4); /* edit count */
-            caf->data_start = avio_tell(pb);
-            caf->data_size  = size < 0 ? -1 : size - 4;
-            if (caf->data_size > 0 && pb->seekable)
-                avio_skip(pb, caf->data_size);
-            found_data = 1;
-            break;
-
-        case MKBETAG('c','h','a','n'):
-            if ((ret = ff_mov_read_chan(s, s->pb, st, size)) < 0)
-                return ret;
-            break;
-
-        /* magic cookie chunk */
-        case MKBETAG('k','u','k','i'):
-            if (read_kuki_chunk(s, size))
-                return AVERROR_INVALIDDATA;
-            break;
-
-        /* packet table chunk */
-        case MKBETAG('p','a','k','t'):
-            if (read_pakt_chunk(s, size))
-                return AVERROR_INVALIDDATA;
-            break;
-
-        case MKBETAG('i','n','f','o'):
-            read_info_chunk(s, size);
-            break;
-
-        default:
-#define _(x) ((x) >= ' ' ? (x) : ' ')
-            av_log(s, AV_LOG_WARNING, "skipping CAF chunk: %08X (%c%c%c%c)\n",
-                tag, _(tag>>24), _((tag>>16)&0xFF), _((tag>>8)&0xFF), _(tag&0xFF));
-#undef _
-        case MKBETAG('f','r','e','e'):
-            if (size < 0)
-                return AVERROR_INVALIDDATA;
-            avio_skip(pb, size);
-            break;
-        }
-    }
-
-    if (!found_data)
-        return AVERROR_INVALIDDATA;
-
-    if (caf->bytes_per_packet > 0 && caf->frames_per_packet > 0) {
-        if (caf->data_size > 0)
-            st->nb_frames = (caf->data_size / caf->bytes_per_packet) * caf->frames_per_packet;
-    } else if (st->nb_index_entries) {
-        st->codec->bit_rate = st->codec->sample_rate * caf->data_size * 8 /
-                              st->duration;
-    } else {
-        av_log(s, AV_LOG_ERROR, "Missing packet table. It is required when "
-                                "block size or frame size are variable.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    st->start_time = 0;
-
-    /* position the stream at the start of data */
-    if (caf->data_size >= 0)
-        avio_seek(pb, caf->data_start, SEEK_SET);
-
-    return 0;
-}
-
-#define CAF_MAX_PKT_SIZE 4096
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st      = s->streams[0];
-    CaffContext *caf  = s->priv_data;
-    int res, pkt_size = 0, pkt_frames = 0;
-    int64_t left      = CAF_MAX_PKT_SIZE;
-
-    if (pb->eof_reached)
-        return AVERROR(EIO);
-
-    /* don't read past end of data chunk */
-    if (caf->data_size > 0) {
-        left = (caf->data_start + caf->data_size) - avio_tell(pb);
-        if (left <= 0)
-            return AVERROR(EIO);
-    }
-
-    pkt_frames = caf->frames_per_packet;
-    pkt_size   = caf->bytes_per_packet;
-
-    if (pkt_size > 0 && pkt_frames == 1) {
-        pkt_size   = (CAF_MAX_PKT_SIZE / pkt_size) * pkt_size;
-        pkt_size   = FFMIN(pkt_size, left);
-        pkt_frames = pkt_size / caf->bytes_per_packet;
-    } else if (st->nb_index_entries) {
-        if (caf->packet_cnt < st->nb_index_entries - 1) {
-            pkt_size   = st->index_entries[caf->packet_cnt + 1].pos       - st->index_entries[caf->packet_cnt].pos;
-            pkt_frames = st->index_entries[caf->packet_cnt + 1].timestamp - st->index_entries[caf->packet_cnt].timestamp;
-        } else if (caf->packet_cnt == st->nb_index_entries - 1) {
-            pkt_size   = caf->num_bytes - st->index_entries[caf->packet_cnt].pos;
-            pkt_frames = st->duration   - st->index_entries[caf->packet_cnt].timestamp;
-        } else {
-            return AVERROR(EIO);
-        }
-    }
-
-    if (pkt_size == 0 || pkt_frames == 0 || pkt_size > left)
-        return AVERROR(EIO);
-
-    res = av_get_packet(pb, pkt, pkt_size);
-    if (res < 0)
-        return res;
-
-    pkt->size           = res;
-    pkt->stream_index   = 0;
-    pkt->dts = pkt->pts = caf->frame_cnt;
-
-    caf->packet_cnt++;
-    caf->frame_cnt += pkt_frames;
-
-    return 0;
-}
-
-static int read_seek(AVFormatContext *s, int stream_index,
-                     int64_t timestamp, int flags)
-{
-    AVStream *st = s->streams[0];
-    CaffContext *caf = s->priv_data;
-    int64_t pos, packet_cnt, frame_cnt;
-
-    timestamp = FFMAX(timestamp, 0);
-
-    if (caf->frames_per_packet > 0 && caf->bytes_per_packet > 0) {
-        /* calculate new byte position based on target frame position */
-        pos = caf->bytes_per_packet * timestamp / caf->frames_per_packet;
-        if (caf->data_size > 0)
-            pos = FFMIN(pos, caf->data_size);
-        packet_cnt = pos / caf->bytes_per_packet;
-        frame_cnt  = caf->frames_per_packet * packet_cnt;
-    } else if (st->nb_index_entries) {
-        packet_cnt = av_index_search_timestamp(st, timestamp, flags);
-        frame_cnt  = st->index_entries[packet_cnt].timestamp;
-        pos        = st->index_entries[packet_cnt].pos;
-    } else {
-        return -1;
-    }
-
-    if (avio_seek(s->pb, pos + caf->data_start, SEEK_SET) < 0)
-        return -1;
-
-    caf->packet_cnt = packet_cnt;
-    caf->frame_cnt  = frame_cnt;
-
-    return 0;
-}
-
-AVInputFormat ff_caf_demuxer = {
-    .name           = "caf",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple CAF (Core Audio Format)"),
-    .priv_data_size = sizeof(CaffContext),
-    .read_probe     = probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .read_seek      = read_seek,
-    .codec_tag      = (const AVCodecTag* const []){ ff_codec_caf_tags, 0 },
-};
diff --git a/deps/libav/libavformat/cavsvideodec.c b/deps/libav/libavformat/cavsvideodec.c
deleted file mode 100644
index fcca9e1..0000000
--- a/deps/libav/libavformat/cavsvideodec.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * RAW Chinese AVS video demuxer
- * Copyright (c) 2009  Stefan Gehrer <stefan.gehrer at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawdec.h"
-
-#define CAVS_SEQ_START_CODE       0x000001b0
-#define CAVS_PIC_I_START_CODE     0x000001b3
-#define CAVS_UNDEF_START_CODE     0x000001b4
-#define CAVS_PIC_PB_START_CODE    0x000001b6
-#define CAVS_VIDEO_EDIT_CODE      0x000001b7
-#define CAVS_PROFILE_JIZHUN       0x20
-
-static int cavsvideo_probe(AVProbeData *p)
-{
-    uint32_t code= -1;
-    int pic=0, seq=0, slice_pos = 0;
-    int i;
-
-    for(i=0; i<p->buf_size; i++){
-        code = (code<<8) + p->buf[i];
-        if ((code & 0xffffff00) == 0x100) {
-            if(code < CAVS_SEQ_START_CODE) {
-                /* slices have to be consecutive */
-                if(code < slice_pos)
-                    return 0;
-                slice_pos = code;
-            } else {
-                slice_pos = 0;
-            }
-            if (code == CAVS_SEQ_START_CODE) {
-                seq++;
-                /* check for the only currently supported profile */
-                if(p->buf[i+1] != CAVS_PROFILE_JIZHUN)
-                    return 0;
-            } else if ((code == CAVS_PIC_I_START_CODE) ||
-                       (code == CAVS_PIC_PB_START_CODE)) {
-                pic++;
-            } else if ((code == CAVS_UNDEF_START_CODE) ||
-                       (code >  CAVS_VIDEO_EDIT_CODE)) {
-                return 0;
-            }
-        }
-    }
-    if(seq && seq*9<=pic*10)
-        return AVPROBE_SCORE_EXTENSION;
-    return 0;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(cavsvideo, "raw Chinese AVS (Audio Video Standard)", cavsvideo_probe, NULL, AV_CODEC_ID_CAVS)
diff --git a/deps/libav/libavformat/cdg.c b/deps/libav/libavformat/cdg.c
deleted file mode 100644
index 974880a..0000000
--- a/deps/libav/libavformat/cdg.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * CD Graphics Demuxer
- * Copyright (c) 2009 Michael Tison
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-
-#define CDG_PACKET_SIZE    24
-#define CDG_COMMAND        0x09
-#define CDG_MASK           0x3F
-
-static int read_header(AVFormatContext *s)
-{
-    AVStream *vst;
-    int ret;
-
-    vst = avformat_new_stream(s, NULL);
-    if (!vst)
-        return AVERROR(ENOMEM);
-
-    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_id   = AV_CODEC_ID_CDGRAPHICS;
-
-    /// 75 sectors/sec * 4 packets/sector = 300 packets/sec
-    avpriv_set_pts_info(vst, 32, 1, 300);
-
-    ret = avio_size(s->pb);
-    if (ret > 0)
-        vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300);
-
-    return 0;
-}
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret;
-
-    while (1) {
-        ret = av_get_packet(s->pb, pkt, CDG_PACKET_SIZE);
-        if (ret < 1 || (pkt->data[0] & CDG_MASK) == CDG_COMMAND)
-            break;
-        av_free_packet(pkt);
-    }
-
-    pkt->stream_index = 0;
-    return ret;
-}
-
-AVInputFormat ff_cdg_demuxer = {
-    .name           = "cdg",
-    .long_name      = NULL_IF_CONFIG_SMALL("CD Graphics"),
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .extensions     = "cdg",
-};
diff --git a/deps/libav/libavformat/cdxl.c b/deps/libav/libavformat/cdxl.c
deleted file mode 100644
index a2cba52..0000000
--- a/deps/libav/libavformat/cdxl.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * CDXL demuxer
- * Copyright (c) 2011-2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/opt.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define CDXL_HEADER_SIZE 32
-
-typedef struct CDXLDemuxContext {
-    AVClass     *class;
-    int         sample_rate;
-    char        *framerate;
-    AVRational  fps;
-    int         read_chunk;
-    uint8_t     header[CDXL_HEADER_SIZE];
-    int         video_stream_index;
-    int         audio_stream_index;
-} CDXLDemuxContext;
-
-static int cdxl_read_header(AVFormatContext *s)
-{
-    CDXLDemuxContext *cdxl = s->priv_data;
-    int ret;
-
-    if (cdxl->framerate && (ret = av_parse_video_rate(&cdxl->fps, cdxl->framerate)) < 0) {
-        av_log(s, AV_LOG_ERROR,
-               "Could not parse framerate: %s.\n", cdxl->framerate);
-        return ret;
-    }
-
-    cdxl->read_chunk         =  0;
-    cdxl->video_stream_index = -1;
-    cdxl->audio_stream_index = -1;
-
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    return 0;
-}
-
-static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    CDXLDemuxContext *cdxl = s->priv_data;
-    AVIOContext *pb = s->pb;
-    uint32_t current_size, video_size, image_size;
-    uint16_t audio_size, palette_size, width, height;
-    int64_t  pos;
-    int      ret;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    pos = avio_tell(pb);
-    if (!cdxl->read_chunk &&
-        avio_read(pb, cdxl->header, CDXL_HEADER_SIZE) != CDXL_HEADER_SIZE)
-        return AVERROR_EOF;
-    if (cdxl->header[0] != 1) {
-        av_log(s, AV_LOG_ERROR, "non-standard cdxl file\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    current_size = AV_RB32(&cdxl->header[2]);
-    width        = AV_RB16(&cdxl->header[14]);
-    height       = AV_RB16(&cdxl->header[16]);
-    palette_size = AV_RB16(&cdxl->header[20]);
-    audio_size   = AV_RB16(&cdxl->header[22]);
-    image_size   = FFALIGN(width, 16) * height * cdxl->header[19] / 8;
-    video_size   = palette_size + image_size;
-
-    if (palette_size > 512)
-        return AVERROR_INVALIDDATA;
-    if (current_size < (uint64_t)audio_size + video_size + CDXL_HEADER_SIZE)
-        return AVERROR_INVALIDDATA;
-
-    if (cdxl->read_chunk && audio_size) {
-        if (cdxl->audio_stream_index == -1) {
-            AVStream *st = avformat_new_stream(s, NULL);
-            if (!st)
-                return AVERROR(ENOMEM);
-
-            st->codec->codec_type    = AVMEDIA_TYPE_AUDIO;
-            st->codec->codec_tag     = 0;
-            st->codec->codec_id      = AV_CODEC_ID_PCM_S8;
-            if (cdxl->header[1] & 0x10) {
-                st->codec->channels       = 2;
-                st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-            } else {
-                st->codec->channels       = 1;
-                st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-            }
-            st->codec->sample_rate   = cdxl->sample_rate;
-            st->start_time           = 0;
-            cdxl->audio_stream_index = st->index;
-            avpriv_set_pts_info(st, 64, 1, cdxl->sample_rate);
-        }
-
-        ret = av_get_packet(pb, pkt, audio_size);
-        if (ret < 0)
-            return ret;
-        pkt->stream_index = cdxl->audio_stream_index;
-        pkt->pos          = pos;
-        pkt->duration     = audio_size;
-        cdxl->read_chunk  = 0;
-    } else {
-        if (cdxl->video_stream_index == -1) {
-            AVStream *st = avformat_new_stream(s, NULL);
-            if (!st)
-                return AVERROR(ENOMEM);
-
-            st->codec->codec_type    = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_tag     = 0;
-            st->codec->codec_id      = AV_CODEC_ID_CDXL;
-            st->codec->width         = width;
-            st->codec->height        = height;
-            st->start_time           = 0;
-            cdxl->video_stream_index = st->index;
-            if (cdxl->framerate)
-                avpriv_set_pts_info(st, 64, cdxl->fps.den, cdxl->fps.num);
-            else
-                avpriv_set_pts_info(st, 64, 1, cdxl->sample_rate);
-        }
-
-        if (av_new_packet(pkt, video_size + CDXL_HEADER_SIZE) < 0)
-            return AVERROR(ENOMEM);
-        memcpy(pkt->data, cdxl->header, CDXL_HEADER_SIZE);
-        ret = avio_read(pb, pkt->data + CDXL_HEADER_SIZE, video_size);
-        if (ret < 0) {
-            av_free_packet(pkt);
-            return ret;
-        }
-        av_shrink_packet(pkt, CDXL_HEADER_SIZE + ret);
-        pkt->stream_index  = cdxl->video_stream_index;
-        pkt->flags        |= AV_PKT_FLAG_KEY;
-        pkt->pos           = pos;
-        pkt->duration      = cdxl->framerate ? 1 : audio_size ? audio_size : 220;
-        cdxl->read_chunk   = audio_size;
-    }
-
-    if (!cdxl->read_chunk)
-        avio_skip(pb, current_size - audio_size - video_size - CDXL_HEADER_SIZE);
-    return ret;
-}
-
-#define OFFSET(x) offsetof(CDXLDemuxContext, x)
-static const AVOption cdxl_options[] = {
-    { "sample_rate", "", OFFSET(sample_rate), AV_OPT_TYPE_INT,    { .i64 = 11025 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { "framerate",   "", OFFSET(framerate),   AV_OPT_TYPE_STRING, { .str = NULL },  0, 0,       AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-static const AVClass cdxl_demuxer_class = {
-    .class_name = "CDXL demuxer",
-    .item_name  = av_default_item_name,
-    .option     = cdxl_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_cdxl_demuxer = {
-    .name           = "cdxl",
-    .long_name      = NULL_IF_CONFIG_SMALL("Commodore CDXL video"),
-    .priv_data_size = sizeof(CDXLDemuxContext),
-    .read_header    = cdxl_read_header,
-    .read_packet    = cdxl_read_packet,
-    .extensions     = "cdxl,xl",
-    .flags          = AVFMT_GENERIC_INDEX,
-    .priv_class     = &cdxl_demuxer_class,
-};
diff --git a/deps/libav/libavformat/concat.c b/deps/libav/libavformat/concat.c
deleted file mode 100644
index 416bbf5..0000000
--- a/deps/libav/libavformat/concat.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Concat URL protocol
- * Copyright (c) 2006 Steve Lhomme
- * Copyright (c) 2007 Wolfram Gloger
- * Copyright (c) 2010 Michele Orrù
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "libavutil/avstring.h"
-#include "libavutil/mem.h"
-#include "url.h"
-
-#define AV_CAT_SEPARATOR "|"
-
-struct concat_nodes {
-    URLContext *uc;                ///< node's URLContext
-    int64_t     size;              ///< url filesize
-};
-
-struct concat_data {
-    struct concat_nodes *nodes;    ///< list of nodes to concat
-    size_t               length;   ///< number of cat'ed nodes
-    size_t               current;  ///< index of currently read node
-};
-
-static av_cold int concat_close(URLContext *h)
-{
-    int err = 0;
-    size_t i;
-    struct concat_data  *data  = h->priv_data;
-    struct concat_nodes *nodes = data->nodes;
-
-    for (i = 0; i != data->length; i++)
-        err |= ffurl_close(nodes[i].uc);
-
-    av_freep(&data->nodes);
-
-    return err < 0 ? -1 : 0;
-}
-
-static av_cold int concat_open(URLContext *h, const char *uri, int flags)
-{
-    char *node_uri = NULL;
-    int err = 0;
-    int64_t size;
-    size_t  len, i;
-    URLContext *uc;
-    struct concat_data  *data = h->priv_data;
-    struct concat_nodes *nodes;
-
-    av_strstart(uri, "concat:", &uri);
-
-    for (i = 0, len = 1; uri[i]; i++)
-        if (uri[i] == *AV_CAT_SEPARATOR)
-            /* integer overflow */
-            if (++len == UINT_MAX / sizeof(*nodes)) {
-                av_freep(&h->priv_data);
-                return AVERROR(ENAMETOOLONG);
-            }
-
-    if (!(nodes = av_realloc(NULL, sizeof(*nodes) * len))) {
-        return AVERROR(ENOMEM);
-    } else
-        data->nodes = nodes;
-
-    /* handle input */
-    if (!*uri)
-        err = AVERROR(ENOENT);
-    for (i = 0; *uri; i++) {
-        /* parsing uri */
-        len = strcspn(uri, AV_CAT_SEPARATOR);
-        if ((err = av_reallocp(&node_uri, len + 1)) < 0)
-            break;
-        av_strlcpy(node_uri, uri, len+1);
-        uri += len + strspn(uri+len, AV_CAT_SEPARATOR);
-
-        /* creating URLContext */
-        if ((err = ffurl_open(&uc, node_uri, flags,
-                              &h->interrupt_callback, NULL)) < 0)
-            break;
-
-        /* creating size */
-        if ((size = ffurl_size(uc)) < 0) {
-            ffurl_close(uc);
-            err = AVERROR(ENOSYS);
-            break;
-        }
-
-        /* assembling */
-        nodes[i].uc   = uc;
-        nodes[i].size = size;
-    }
-    av_free(node_uri);
-    data->length = i;
-
-    if (err < 0)
-        concat_close(h);
-    else if ((err = av_reallocp(&nodes, data->length * sizeof(*nodes))) < 0)
-        concat_close(h);
-    else
-        data->nodes = nodes;
-    return err;
-}
-
-static int concat_read(URLContext *h, unsigned char *buf, int size)
-{
-    int result, total = 0;
-    struct concat_data  *data  = h->priv_data;
-    struct concat_nodes *nodes = data->nodes;
-    size_t i = data->current;
-
-    while (size > 0) {
-        result = ffurl_read(nodes[i].uc, buf, size);
-        if (result < 0)
-            return total ? total : result;
-        if (!result)
-            if (i + 1 == data->length ||
-                ffurl_seek(nodes[++i].uc, 0, SEEK_SET) < 0)
-                break;
-        total += result;
-        buf   += result;
-        size  -= result;
-    }
-    data->current = i;
-    return total;
-}
-
-static int64_t concat_seek(URLContext *h, int64_t pos, int whence)
-{
-    int64_t result;
-    struct concat_data  *data  = h->priv_data;
-    struct concat_nodes *nodes = data->nodes;
-    size_t i;
-
-    switch (whence) {
-    case SEEK_END:
-        for (i = data->length - 1;
-             i && pos < -nodes[i].size;
-             i--)
-            pos += nodes[i].size;
-        break;
-    case SEEK_CUR:
-        /* get the absolute position */
-        for (i = 0; i != data->current; i++)
-            pos += nodes[i].size;
-        pos += ffurl_seek(nodes[i].uc, 0, SEEK_CUR);
-        whence = SEEK_SET;
-        /* fall through with the absolute position */
-    case SEEK_SET:
-        for (i = 0; i != data->length - 1 && pos >= nodes[i].size; i++)
-            pos -= nodes[i].size;
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-
-    result = ffurl_seek(nodes[i].uc, pos, whence);
-    if (result >= 0) {
-        data->current = i;
-        while (i)
-            result += nodes[--i].size;
-    }
-    return result;
-}
-
-URLProtocol ff_concat_protocol = {
-    .name           = "concat",
-    .url_open       = concat_open,
-    .url_read       = concat_read,
-    .url_seek       = concat_seek,
-    .url_close      = concat_close,
-    .priv_data_size = sizeof(struct concat_data),
-};
diff --git a/deps/libav/libavformat/crcenc.c b/deps/libav/libavformat/crcenc.c
deleted file mode 100644
index 3b30cc9..0000000
--- a/deps/libav/libavformat/crcenc.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * CRC encoder (for codec/format testing)
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/adler32.h"
-#include "avformat.h"
-
-typedef struct CRCState {
-    uint32_t crcval;
-} CRCState;
-
-static int crc_write_header(struct AVFormatContext *s)
-{
-    CRCState *crc = s->priv_data;
-
-    /* init CRC */
-    crc->crcval = 1;
-
-    return 0;
-}
-
-static int crc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    CRCState *crc = s->priv_data;
-    crc->crcval = av_adler32_update(crc->crcval, pkt->data, pkt->size);
-    return 0;
-}
-
-static int crc_write_trailer(struct AVFormatContext *s)
-{
-    CRCState *crc = s->priv_data;
-    char buf[64];
-
-    snprintf(buf, sizeof(buf), "CRC=0x%08x\n", crc->crcval);
-    avio_write(s->pb, buf, strlen(buf));
-
-    return 0;
-}
-
-AVOutputFormat ff_crc_muxer = {
-    .name              = "crc",
-    .long_name         = NULL_IF_CONFIG_SMALL("CRC testing"),
-    .extensions        = "",
-    .priv_data_size    = sizeof(CRCState),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
-    .write_header      = crc_write_header,
-    .write_packet      = crc_write_packet,
-    .write_trailer     = crc_write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
diff --git a/deps/libav/libavformat/crypto.c b/deps/libav/libavformat/crypto.c
deleted file mode 100644
index 3bc33f2..0000000
--- a/deps/libav/libavformat/crypto.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Decryption protocol handler
- * Copyright (c) 2011 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "libavutil/aes.h"
-#include "libavutil/avstring.h"
-#include "libavutil/opt.h"
-#include "internal.h"
-#include "url.h"
-
-#define MAX_BUFFER_BLOCKS 150
-#define BLOCKSIZE 16
-
-typedef struct {
-    const AVClass *class;
-    URLContext *hd;
-    uint8_t inbuffer [BLOCKSIZE*MAX_BUFFER_BLOCKS],
-            outbuffer[BLOCKSIZE*MAX_BUFFER_BLOCKS];
-    uint8_t *outptr;
-    int indata, indata_used, outdata;
-    int eof;
-    uint8_t *key;
-    int keylen;
-    uint8_t *iv;
-    int ivlen;
-    struct AVAES *aes;
-} CryptoContext;
-
-#define OFFSET(x) offsetof(CryptoContext, x)
-#define D AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    {"key", "AES decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, .flags = D },
-    {"iv",  "AES decryption initialization vector", OFFSET(iv), AV_OPT_TYPE_BINARY, .flags = D },
-    { NULL }
-};
-
-static const AVClass crypto_class = {
-    .class_name     = "crypto",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-static int crypto_open(URLContext *h, const char *uri, int flags)
-{
-    const char *nested_url;
-    int ret = 0;
-    CryptoContext *c = h->priv_data;
-
-    if (!av_strstart(uri, "crypto+", &nested_url) &&
-        !av_strstart(uri, "crypto:", &nested_url)) {
-        av_log(h, AV_LOG_ERROR, "Unsupported url %s\n", uri);
-        ret = AVERROR(EINVAL);
-        goto err;
-    }
-
-    if (c->keylen < BLOCKSIZE || c->ivlen < BLOCKSIZE) {
-        av_log(h, AV_LOG_ERROR, "Key or IV not set\n");
-        ret = AVERROR(EINVAL);
-        goto err;
-    }
-    if (flags & AVIO_FLAG_WRITE) {
-        av_log(h, AV_LOG_ERROR, "Only decryption is supported currently\n");
-        ret = AVERROR(ENOSYS);
-        goto err;
-    }
-    if ((ret = ffurl_open(&c->hd, nested_url, AVIO_FLAG_READ,
-                          &h->interrupt_callback, NULL)) < 0) {
-        av_log(h, AV_LOG_ERROR, "Unable to open input\n");
-        goto err;
-    }
-    c->aes = av_aes_alloc();
-    if (!c->aes) {
-        ret = AVERROR(ENOMEM);
-        goto err;
-    }
-
-    av_aes_init(c->aes, c->key, 128, 1);
-
-    h->is_streamed = 1;
-
-err:
-    return ret;
-}
-
-static int crypto_read(URLContext *h, uint8_t *buf, int size)
-{
-    CryptoContext *c = h->priv_data;
-    int blocks;
-retry:
-    if (c->outdata > 0) {
-        size = FFMIN(size, c->outdata);
-        memcpy(buf, c->outptr, size);
-        c->outptr  += size;
-        c->outdata -= size;
-        return size;
-    }
-    // We avoid using the last block until we've found EOF,
-    // since we'll remove PKCS7 padding at the end. So make
-    // sure we've got at least 2 blocks, so we can decrypt
-    // at least one.
-    while (c->indata - c->indata_used < 2*BLOCKSIZE) {
-        int n = ffurl_read(c->hd, c->inbuffer + c->indata,
-                           sizeof(c->inbuffer) - c->indata);
-        if (n <= 0) {
-            c->eof = 1;
-            break;
-        }
-        c->indata += n;
-    }
-    blocks = (c->indata - c->indata_used) / BLOCKSIZE;
-    if (!blocks)
-        return AVERROR_EOF;
-    if (!c->eof)
-        blocks--;
-    av_aes_crypt(c->aes, c->outbuffer, c->inbuffer + c->indata_used, blocks,
-                 c->iv, 1);
-    c->outdata      = BLOCKSIZE * blocks;
-    c->outptr       = c->outbuffer;
-    c->indata_used += BLOCKSIZE * blocks;
-    if (c->indata_used >= sizeof(c->inbuffer)/2) {
-        memmove(c->inbuffer, c->inbuffer + c->indata_used,
-                c->indata - c->indata_used);
-        c->indata     -= c->indata_used;
-        c->indata_used = 0;
-    }
-    if (c->eof) {
-        // Remove PKCS7 padding at the end
-        int padding = c->outbuffer[c->outdata - 1];
-        c->outdata -= padding;
-    }
-    goto retry;
-}
-
-static int crypto_close(URLContext *h)
-{
-    CryptoContext *c = h->priv_data;
-    if (c->hd)
-        ffurl_close(c->hd);
-    av_freep(&c->aes);
-    return 0;
-}
-
-URLProtocol ff_crypto_protocol = {
-    .name            = "crypto",
-    .url_open        = crypto_open,
-    .url_read        = crypto_read,
-    .url_close       = crypto_close,
-    .priv_data_size  = sizeof(CryptoContext),
-    .priv_data_class = &crypto_class,
-    .flags           = URL_PROTOCOL_FLAG_NESTED_SCHEME,
-};
diff --git a/deps/libav/libavformat/cutils.c b/deps/libav/libavformat/cutils.c
deleted file mode 100644
index f58e152..0000000
--- a/deps/libav/libavformat/cutils.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * various simple utilities for libavformat
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avformat.h"
-#include "internal.h"
-
-/* add one element to a dynamic array */
-void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem)
-{
-    /* see similar avconv.c:grow_array() */
-    int nb, nb_alloc;
-    intptr_t *tab;
-
-    nb = *nb_ptr;
-    tab = *tab_ptr;
-    if ((nb & (nb - 1)) == 0) {
-        if (nb == 0)
-            nb_alloc = 1;
-        else
-            nb_alloc = nb * 2;
-        tab = av_realloc(tab, nb_alloc * sizeof(intptr_t));
-        *tab_ptr = tab;
-    }
-    tab[nb++] = elem;
-    *nb_ptr = nb;
-}
-
-#define ISLEAP(y) (((y) % 4 == 0) && (((y) % 100) != 0 || ((y) % 400) == 0))
-#define LEAPS_COUNT(y) ((y)/4 - (y)/100 + (y)/400)
-
-/* This is our own gmtime_r. It differs from its POSIX counterpart in a
-   couple of places, though. */
-struct tm *ff_brktimegm(time_t secs, struct tm *tm)
-{
-    int days, y, ny, m;
-    int md[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-
-    days = secs / 86400;
-    secs %= 86400;
-    tm->tm_hour = secs / 3600;
-    tm->tm_min = (secs % 3600) / 60;
-    tm->tm_sec =  secs % 60;
-
-    /* oh well, may be someone some day will invent a formula for this stuff */
-    y = 1970; /* start "guessing" */
-    while (days > 365) {
-        ny = (y + days/366);
-        days -= (ny - y) * 365 + LEAPS_COUNT(ny - 1) - LEAPS_COUNT(y - 1);
-        y = ny;
-    }
-    if (days==365 && !ISLEAP(y)) { days=0; y++; }
-    md[1] = ISLEAP(y)?29:28;
-    for (m=0; days >= md[m]; m++)
-         days -= md[m];
-
-    tm->tm_year = y;  /* unlike gmtime_r we store complete year here */
-    tm->tm_mon = m+1; /* unlike gmtime_r tm_mon is from 1 to 12 */
-    tm->tm_mday = days+1;
-
-    return tm;
-}
diff --git a/deps/libav/libavformat/daud.c b/deps/libav/libavformat/daud.c
deleted file mode 100644
index bb7ab7f..0000000
--- a/deps/libav/libavformat/daud.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * D-Cinema audio demuxer
- * Copyright (c) 2005 Reimar Döffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-
-static int daud_header(AVFormatContext *s) {
-    AVStream *st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_PCM_S24DAUD;
-    st->codec->codec_tag = MKTAG('d', 'a', 'u', 'd');
-    st->codec->channels = 6;
-    st->codec->channel_layout = AV_CH_LAYOUT_5POINT1;
-    st->codec->sample_rate = 96000;
-    st->codec->bit_rate = 3 * 6 * 96000 * 8;
-    st->codec->block_align = 3 * 6;
-    st->codec->bits_per_coded_sample = 24;
-    return 0;
-}
-
-static int daud_packet(AVFormatContext *s, AVPacket *pkt) {
-    AVIOContext *pb = s->pb;
-    int ret, size;
-    if (pb->eof_reached)
-        return AVERROR(EIO);
-    size = avio_rb16(pb);
-    avio_rb16(pb); // unknown
-    ret = av_get_packet(pb, pkt, size);
-    pkt->stream_index = 0;
-    return ret;
-}
-
-static int daud_write_header(struct AVFormatContext *s)
-{
-    AVCodecContext *codec = s->streams[0]->codec;
-    if (codec->channels!=6 || codec->sample_rate!=96000)
-        return -1;
-    return 0;
-}
-
-static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    if (pkt->size > 65535) {
-        av_log(s, AV_LOG_ERROR,
-               "Packet size too large for s302m. (%d > 65535)\n", pkt->size);
-        return -1;
-    }
-    avio_wb16(s->pb, pkt->size);
-    avio_wb16(s->pb, 0x8010); // unknown
-    avio_write(s->pb, pkt->data, pkt->size);
-    return 0;
-}
-
-#if CONFIG_DAUD_DEMUXER
-AVInputFormat ff_daud_demuxer = {
-    .name           = "daud",
-    .long_name      = NULL_IF_CONFIG_SMALL("D-Cinema audio"),
-    .read_header    = daud_header,
-    .read_packet    = daud_packet,
-    .extensions     = "302",
-};
-#endif
-
-#if CONFIG_DAUD_MUXER
-AVOutputFormat ff_daud_muxer = {
-    .name         = "daud",
-    .long_name    = NULL_IF_CONFIG_SMALL("D-Cinema audio"),
-    .extensions   = "302",
-    .audio_codec  = AV_CODEC_ID_PCM_S24DAUD,
-    .video_codec  = AV_CODEC_ID_NONE,
-    .write_header = daud_write_header,
-    .write_packet = daud_write_packet,
-    .flags        = AVFMT_NOTIMESTAMPS,
-};
-#endif
diff --git a/deps/libav/libavformat/dfa.c b/deps/libav/libavformat/dfa.c
deleted file mode 100644
index fa32d1f..0000000
--- a/deps/libav/libavformat/dfa.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Chronomaster DFA Format Demuxer
- * Copyright (c) 2011 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-static int dfa_probe(AVProbeData *p)
-{
-    if (p->buf_size < 4 || AV_RL32(p->buf) != MKTAG('D', 'F', 'I', 'A'))
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int dfa_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    int frames;
-    uint32_t mspf;
-
-    if (avio_rl32(pb) != MKTAG('D', 'F', 'I', 'A')) {
-        av_log(s, AV_LOG_ERROR, "Invalid magic for DFA\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avio_skip(pb, 2); // unused
-    frames = avio_rl16(pb);
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_DFA;
-    st->codec->width      = avio_rl16(pb);
-    st->codec->height     = avio_rl16(pb);
-    mspf = avio_rl32(pb);
-    if (!mspf) {
-        av_log(s, AV_LOG_WARNING, "Zero FPS reported, defaulting to 10\n");
-        mspf = 100;
-    }
-    avpriv_set_pts_info(st, 24, mspf, 1000);
-    avio_skip(pb, 128 - 16); // padding
-    st->duration = frames;
-
-    return 0;
-}
-
-static int dfa_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    uint32_t frame_size;
-    int ret, first = 1;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    if (av_get_packet(pb, pkt, 12) != 12)
-        return AVERROR(EIO);
-    while (!pb->eof_reached) {
-        if (!first) {
-            ret = av_append_packet(pb, pkt, 12);
-            if (ret < 0) {
-                av_free_packet(pkt);
-                return ret;
-            }
-        } else
-            first = 0;
-        frame_size = AV_RL32(pkt->data + pkt->size - 8);
-        if (frame_size > INT_MAX - 4) {
-            av_log(s, AV_LOG_ERROR, "Too large chunk size: %d\n", frame_size);
-            return AVERROR(EIO);
-        }
-        if (AV_RL32(pkt->data + pkt->size - 12) == MKTAG('E', 'O', 'F', 'R')) {
-            if (frame_size) {
-                av_log(s, AV_LOG_WARNING, "skipping %d bytes of end-of-frame marker chunk\n",
-                       frame_size);
-                avio_skip(pb, frame_size);
-            }
-            return 0;
-        }
-        ret = av_append_packet(pb, pkt, frame_size);
-        if (ret < 0) {
-            av_free_packet(pkt);
-            return ret;
-        }
-    }
-
-    return 0;
-}
-
-AVInputFormat ff_dfa_demuxer = {
-    .name           = "dfa",
-    .long_name      = NULL_IF_CONFIG_SMALL("Chronomaster DFA"),
-    .read_probe     = dfa_probe,
-    .read_header    = dfa_read_header,
-    .read_packet    = dfa_read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/diracdec.c b/deps/libav/libavformat/diracdec.c
deleted file mode 100644
index f275212..0000000
--- a/deps/libav/libavformat/diracdec.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * RAW Dirac demuxer
- * Copyright (c) 2007 Marco Gerards <marco at gnu.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "rawdec.h"
-
-static int dirac_probe(AVProbeData *p)
-{
-    if (AV_RL32(p->buf) == MKTAG('B', 'B', 'C', 'D'))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(dirac, "raw Dirac", dirac_probe, NULL, AV_CODEC_ID_DIRAC)
diff --git a/deps/libav/libavformat/dnxhddec.c b/deps/libav/libavformat/dnxhddec.c
deleted file mode 100644
index 8bb6814..0000000
--- a/deps/libav/libavformat/dnxhddec.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * RAW DNxHD (SMPTE VC-3) demuxer
- * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier at gmail.com>
- * Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger at gmx.de>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "rawdec.h"
-
-static int dnxhd_probe(AVProbeData *p)
-{
-    static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
-    int w, h, compression_id;
-    if (p->buf_size < 0x2c)
-        return 0;
-    if (memcmp(p->buf, header, 5))
-        return 0;
-    h = AV_RB16(p->buf + 0x18);
-    w = AV_RB16(p->buf + 0x1a);
-    if (!w || !h)
-        return 0;
-    compression_id = AV_RB32(p->buf + 0x28);
-    if (compression_id < 1237 || compression_id > 1253)
-        return 0;
-    return AVPROBE_SCORE_MAX;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(dnxhd, "raw DNxHD (SMPTE VC-3)", dnxhd_probe, NULL, AV_CODEC_ID_DNXHD)
diff --git a/deps/libav/libavformat/dsicin.c b/deps/libav/libavformat/dsicin.c
deleted file mode 100644
index 6a7c8b9..0000000
--- a/deps/libav/libavformat/dsicin.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Delphine Software International CIN File Demuxer
- * Copyright (c) 2006 Gregory Montoir (cyx at users.sourceforge.net)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Delphine Software International CIN file demuxer
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-
-typedef struct CinFileHeader {
-    int video_frame_size;
-    int video_frame_width;
-    int video_frame_height;
-    int audio_frequency;
-    int audio_bits;
-    int audio_stereo;
-    int audio_frame_size;
-} CinFileHeader;
-
-typedef struct CinFrameHeader {
-    int audio_frame_type;
-    int video_frame_type;
-    int pal_colors_count;
-    int audio_frame_size;
-    int video_frame_size;
-} CinFrameHeader;
-
-typedef struct CinDemuxContext {
-    int audio_stream_index;
-    int video_stream_index;
-    CinFileHeader file_header;
-    int64_t audio_stream_pts;
-    int64_t video_stream_pts;
-    CinFrameHeader frame_header;
-    int audio_buffer_size;
-} CinDemuxContext;
-
-
-static int cin_probe(AVProbeData *p)
-{
-    /* header starts with this special marker */
-    if (AV_RL32(&p->buf[0]) != 0x55AA0000)
-        return 0;
-
-    /* for accuracy, check some header field values */
-    if (AV_RL32(&p->buf[12]) != 22050 || p->buf[16] != 16 || p->buf[17] != 0)
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int cin_read_file_header(CinDemuxContext *cin, AVIOContext *pb) {
-    CinFileHeader *hdr = &cin->file_header;
-
-    if (avio_rl32(pb) != 0x55AA0000)
-        return AVERROR_INVALIDDATA;
-
-    hdr->video_frame_size   = avio_rl32(pb);
-    hdr->video_frame_width  = avio_rl16(pb);
-    hdr->video_frame_height = avio_rl16(pb);
-    hdr->audio_frequency    = avio_rl32(pb);
-    hdr->audio_bits         = avio_r8(pb);
-    hdr->audio_stereo       = avio_r8(pb);
-    hdr->audio_frame_size   = avio_rl16(pb);
-
-    if (hdr->audio_frequency != 22050 || hdr->audio_bits != 16 || hdr->audio_stereo != 0)
-        return AVERROR_INVALIDDATA;
-
-    return 0;
-}
-
-static int cin_read_header(AVFormatContext *s)
-{
-    int rc;
-    CinDemuxContext *cin = s->priv_data;
-    CinFileHeader *hdr = &cin->file_header;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-
-    rc = cin_read_file_header(cin, pb);
-    if (rc)
-        return rc;
-
-    cin->video_stream_pts = 0;
-    cin->audio_stream_pts = 0;
-    cin->audio_buffer_size = 0;
-
-    /* initialize the video decoder stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    avpriv_set_pts_info(st, 32, 1, 12);
-    cin->video_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_DSICINVIDEO;
-    st->codec->codec_tag = 0;  /* no fourcc */
-    st->codec->width = hdr->video_frame_width;
-    st->codec->height = hdr->video_frame_height;
-
-    /* initialize the audio decoder stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    avpriv_set_pts_info(st, 32, 1, 22050);
-    cin->audio_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_DSICINAUDIO;
-    st->codec->codec_tag = 0;  /* no tag */
-    st->codec->channels = 1;
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    st->codec->sample_rate = 22050;
-    st->codec->bits_per_coded_sample = 8;
-    st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels;
-
-    return 0;
-}
-
-static int cin_read_frame_header(CinDemuxContext *cin, AVIOContext *pb) {
-    CinFrameHeader *hdr = &cin->frame_header;
-
-    hdr->video_frame_type = avio_r8(pb);
-    hdr->audio_frame_type = avio_r8(pb);
-    hdr->pal_colors_count = avio_rl16(pb);
-    hdr->video_frame_size = avio_rl32(pb);
-    hdr->audio_frame_size = avio_rl32(pb);
-
-    if (pb->eof_reached || pb->error)
-        return AVERROR(EIO);
-
-    if (avio_rl32(pb) != 0xAA55AA55)
-        return AVERROR_INVALIDDATA;
-    if (hdr->video_frame_size < 0 || hdr->audio_frame_size < 0)
-        return AVERROR_INVALIDDATA;
-
-    return 0;
-}
-
-static int cin_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    CinDemuxContext *cin = s->priv_data;
-    AVIOContext *pb = s->pb;
-    CinFrameHeader *hdr = &cin->frame_header;
-    int rc, palette_type, pkt_size;
-    int ret;
-
-    if (cin->audio_buffer_size == 0) {
-        rc = cin_read_frame_header(cin, pb);
-        if (rc)
-            return rc;
-
-        if ((int16_t)hdr->pal_colors_count < 0) {
-            hdr->pal_colors_count = -(int16_t)hdr->pal_colors_count;
-            palette_type = 1;
-        } else {
-            palette_type = 0;
-        }
-
-        /* palette and video packet */
-        pkt_size = (palette_type + 3) * hdr->pal_colors_count + hdr->video_frame_size;
-
-        ret = av_new_packet(pkt, 4 + pkt_size);
-        if (ret < 0)
-            return ret;
-
-        pkt->stream_index = cin->video_stream_index;
-        pkt->pts = cin->video_stream_pts++;
-
-        pkt->data[0] = palette_type;
-        pkt->data[1] = hdr->pal_colors_count & 0xFF;
-        pkt->data[2] = hdr->pal_colors_count >> 8;
-        pkt->data[3] = hdr->video_frame_type;
-
-        ret = avio_read(pb, &pkt->data[4], pkt_size);
-        if (ret < 0) {
-            av_free_packet(pkt);
-            return ret;
-        }
-        if (ret < pkt_size)
-            av_shrink_packet(pkt, 4 + ret);
-
-        /* sound buffer will be processed on next read_packet() call */
-        cin->audio_buffer_size = hdr->audio_frame_size;
-        return 0;
-    }
-
-    /* audio packet */
-    ret = av_get_packet(pb, pkt, cin->audio_buffer_size);
-    if (ret < 0)
-        return ret;
-
-    pkt->stream_index = cin->audio_stream_index;
-    pkt->pts = cin->audio_stream_pts;
-    pkt->duration = cin->audio_buffer_size - (pkt->pts == 0);
-    cin->audio_stream_pts += pkt->duration;
-    cin->audio_buffer_size = 0;
-    return 0;
-}
-
-AVInputFormat ff_dsicin_demuxer = {
-    .name           = "dsicin",
-    .long_name      = NULL_IF_CONFIG_SMALL("Delphine Software International CIN"),
-    .priv_data_size = sizeof(CinDemuxContext),
-    .read_probe     = cin_probe,
-    .read_header    = cin_read_header,
-    .read_packet    = cin_read_packet,
-};
diff --git a/deps/libav/libavformat/dtsdec.c b/deps/libav/libavformat/dtsdec.c
deleted file mode 100644
index 9010711..0000000
--- a/deps/libav/libavformat/dtsdec.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * RAW DTS demuxer
- * Copyright (c) 2008 Benjamin Larsson
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "rawdec.h"
-
-#define DCA_MARKER_14B_BE 0x1FFFE800
-#define DCA_MARKER_14B_LE 0xFF1F00E8
-#define DCA_MARKER_RAW_BE 0x7FFE8001
-#define DCA_MARKER_RAW_LE 0xFE7F0180
-
-static int dts_probe(AVProbeData *p)
-{
-    const uint8_t *buf, *bufp;
-    uint32_t state = -1;
-    int markers[3] = {0};
-    int sum, max;
-
-    buf = p->buf;
-
-    for(; buf < (p->buf+p->buf_size)-2; buf+=2) {
-        bufp = buf;
-        state = (state << 16) | bytestream_get_be16(&bufp);
-
-        /* regular bitstream */
-        if (state == DCA_MARKER_RAW_BE || state == DCA_MARKER_RAW_LE)
-            markers[0]++;
-
-        /* 14 bits big-endian bitstream */
-        if (state == DCA_MARKER_14B_BE)
-            if ((bytestream_get_be16(&bufp) & 0xFFF0) == 0x07F0)
-                markers[1]++;
-
-        /* 14 bits little-endian bitstream */
-        if (state == DCA_MARKER_14B_LE)
-            if ((bytestream_get_be16(&bufp) & 0xF0FF) == 0xF007)
-                markers[2]++;
-    }
-    sum = markers[0] + markers[1] + markers[2];
-    max = markers[1] > markers[0];
-    max = markers[2] > markers[max] ? 2 : max;
-    if (markers[max] > 3 && p->buf_size / markers[max] < 32*1024 &&
-        markers[max] * 4 > sum * 3)
-        return AVPROBE_SCORE_EXTENSION + 1;
-
-    return 0;
-}
-
-AVInputFormat ff_dts_demuxer = {
-    .name           = "dts",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw DTS"),
-    .read_probe     = dts_probe,
-    .read_header    = ff_raw_audio_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "dts",
-    .raw_codec_id   = AV_CODEC_ID_DTS,
-};
diff --git a/deps/libav/libavformat/dv.c b/deps/libav/libavformat/dv.c
deleted file mode 100644
index 5a1261a..0000000
--- a/deps/libav/libavformat/dv.c
+++ /dev/null
@@ -1,568 +0,0 @@
-/*
- * General DV muxer/demuxer
- * Copyright (c) 2003 Roman Shaposhnik
- *
- * Many thanks to Dan Dennedy <dan at dennedy.org> for providing wealth
- * of DV technical info.
- *
- * Raw DV format
- * Copyright (c) 2002 Fabrice Bellard
- *
- * 50 Mbps (DVCPRO50) and 100 Mbps (DVCPRO HD) support
- * Copyright (c) 2006 Daniel Maas <dmaas at maasdigital.com>
- * Funded by BBC Research & Development
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <time.h>
-#include "avformat.h"
-#include "internal.h"
-#include "libavcodec/dv_profile.h"
-#include "libavcodec/dv.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "dv.h"
-
-struct DVDemuxContext {
-    const DVprofile*  sys;    /* Current DV profile. E.g.: 525/60, 625/50 */
-    AVFormatContext*  fctx;
-    AVStream*         vst;
-    AVStream*         ast[4];
-    AVPacket          audio_pkt[4];
-    uint8_t           audio_buf[4][8192];
-    int               ach;
-    int               frames;
-    uint64_t          abytes;
-};
-
-static inline uint16_t dv_audio_12to16(uint16_t sample)
-{
-    uint16_t shift, result;
-
-    sample = (sample < 0x800) ? sample : sample | 0xf000;
-    shift  = (sample & 0xf00) >> 8;
-
-    if (shift < 0x2 || shift > 0xd) {
-        result = sample;
-    } else if (shift < 0x8) {
-        shift--;
-        result = (sample - (256 * shift)) << shift;
-    } else {
-        shift  = 0xe - shift;
-        result = ((sample + ((256 * shift) + 1)) << shift) - 1;
-    }
-
-    return result;
-}
-
-/*
- * This is the dumbest implementation of all -- it simply looks at
- * a fixed offset and if pack isn't there -- fails. We might want
- * to have a fallback mechanism for complete search of missing packs.
- */
-static const uint8_t *dv_extract_pack(uint8_t *frame, enum dv_pack_type t)
-{
-    int offs;
-
-    switch (t) {
-    case dv_audio_source:
-        offs = (80 * 6 + 80 * 16 * 3 + 3);
-        break;
-    case dv_audio_control:
-        offs = (80 * 6 + 80 * 16 * 4 + 3);
-        break;
-    case dv_video_control:
-        offs = (80 * 5 + 48 + 5);
-        break;
-    default:
-        return NULL;
-    }
-
-    return frame[offs] == t ? &frame[offs] : NULL;
-}
-
-static const int dv_audio_frequency[3] = {
-    48000, 44100, 32000,
-};
-
-/*
- * There's a couple of assumptions being made here:
- * 1. By default we silence erroneous (0x8000/16bit 0x800/12bit) audio samples.
- *    We can pass them upwards when libavcodec will be ready to deal with them.
- * 2. We don't do software emphasis.
- * 3. Audio is always returned as 16bit linear samples: 12bit nonlinear samples
- *    are converted into 16bit linear ones.
- */
-static int dv_extract_audio(uint8_t *frame, uint8_t **ppcm,
-                            const DVprofile *sys)
-{
-    int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
-    uint16_t lc, rc;
-    const uint8_t *as_pack;
-    uint8_t *pcm, ipcm;
-
-    as_pack = dv_extract_pack(frame, dv_audio_source);
-    if (!as_pack)    /* No audio ? */
-        return 0;
-
-    smpls = as_pack[1]      & 0x3f; /* samples in this frame - min. samples */
-    freq  = as_pack[4] >> 3 & 0x07; /* 0 - 48kHz, 1 - 44,1kHz, 2 - 32kHz */
-    quant = as_pack[4]      & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
-
-    if (quant > 1)
-        return -1;  /* unsupported quantization */
-
-    if (freq >= FF_ARRAY_ELEMS(dv_audio_frequency))
-        return AVERROR_INVALIDDATA;
-
-    size    = (sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */
-    half_ch = sys->difseg_size / 2;
-
-    /* We work with 720p frames split in half, thus even frames have
-     * channels 0,1 and odd 2,3. */
-    ipcm = (sys->height == 720 && !(frame[1] & 0x0C)) ? 2 : 0;
-
-    /* for each DIF channel */
-    for (chan = 0; chan < sys->n_difchan; chan++) {
-        /* next stereo channel (50Mbps and 100Mbps only) */
-        pcm = ppcm[ipcm++];
-        if (!pcm)
-            break;
-
-        /* for each DIF segment */
-        for (i = 0; i < sys->difseg_size; i++) {
-            frame += 6 * 80; /* skip DIF segment header */
-            if (quant == 1 && i == half_ch) {
-                /* next stereo channel (12bit mode only) */
-                pcm = ppcm[ipcm++];
-                if (!pcm)
-                    break;
-            }
-
-            /* for each AV sequence */
-            for (j = 0; j < 9; j++) {
-                for (d = 8; d < 80; d += 2) {
-                    if (quant == 0) {  /* 16bit quantization */
-                        of = sys->audio_shuffle[i][j] +
-                             (d - 8) / 2 * sys->audio_stride;
-                        if (of * 2 >= size)
-                            continue;
-
-                        /* FIXME: maybe we have to admit that DV is a
-                         * big-endian PCM */
-                        pcm[of * 2]     = frame[d + 1];
-                        pcm[of * 2 + 1] = frame[d];
-
-                        if (pcm[of * 2 + 1] == 0x80 && pcm[of * 2] == 0x00)
-                            pcm[of * 2 + 1] = 0;
-                    } else {           /* 12bit quantization */
-                        lc = ((uint16_t)frame[d]     << 4) |
-                             ((uint16_t)frame[d + 2] >> 4);
-                        rc = ((uint16_t)frame[d + 1] << 4) |
-                             ((uint16_t)frame[d + 2] & 0x0f);
-                        lc = (lc == 0x800 ? 0 : dv_audio_12to16(lc));
-                        rc = (rc == 0x800 ? 0 : dv_audio_12to16(rc));
-
-                        of = sys->audio_shuffle[i % half_ch][j] +
-                             (d - 8) / 3 * sys->audio_stride;
-                        if (of * 2 >= size)
-                            continue;
-
-                        /* FIXME: maybe we have to admit that DV is a
-                         * big-endian PCM */
-                        pcm[of * 2]     = lc & 0xff;
-                        pcm[of * 2 + 1] = lc >> 8;
-                        of = sys->audio_shuffle[i % half_ch + half_ch][j] +
-                             (d - 8) / 3 * sys->audio_stride;
-                        /* FIXME: maybe we have to admit that DV is a
-                         * big-endian PCM */
-                        pcm[of * 2]     = rc & 0xff;
-                        pcm[of * 2 + 1] = rc >> 8;
-                        ++d;
-                    }
-                }
-
-                frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
-            }
-        }
-    }
-
-    return size;
-}
-
-static int dv_extract_audio_info(DVDemuxContext *c, uint8_t *frame)
-{
-    const uint8_t *as_pack;
-    int freq, stype, smpls, quant, i, ach;
-
-    as_pack = dv_extract_pack(frame, dv_audio_source);
-    if (!as_pack || !c->sys) {    /* No audio ? */
-        c->ach = 0;
-        return 0;
-    }
-
-    smpls = as_pack[1]      & 0x3f; /* samples in this frame - min. samples */
-    freq  = as_pack[4] >> 3 & 0x07; /* 0 - 48kHz, 1 - 44,1kHz, 2 - 32kHz */
-    stype = as_pack[3]      & 0x1f; /* 0 - 2CH, 2 - 4CH, 3 - 8CH */
-    quant = as_pack[4]      & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
-
-    if (freq >= FF_ARRAY_ELEMS(dv_audio_frequency)) {
-        av_log(c->fctx, AV_LOG_ERROR,
-               "Unrecognized audio sample rate index (%d)\n", freq);
-        return 0;
-    }
-
-    if (stype > 3) {
-        av_log(c->fctx, AV_LOG_ERROR, "stype %d is invalid\n", stype);
-        c->ach = 0;
-        return 0;
-    }
-
-    /* note: ach counts PAIRS of channels (i.e. stereo channels) */
-    ach = ((int[4]) { 1, 0, 2, 4 })[stype];
-    if (ach == 1 && quant && freq == 2)
-        ach = 2;
-
-    /* Dynamic handling of the audio streams in DV */
-    for (i = 0; i < ach; i++) {
-        if (!c->ast[i]) {
-            c->ast[i] = avformat_new_stream(c->fctx, NULL);
-            if (!c->ast[i])
-                break;
-            avpriv_set_pts_info(c->ast[i], 64, 1, 30000);
-            c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            c->ast[i]->codec->codec_id   = AV_CODEC_ID_PCM_S16LE;
-
-            av_init_packet(&c->audio_pkt[i]);
-            c->audio_pkt[i].size         = 0;
-            c->audio_pkt[i].data         = c->audio_buf[i];
-            c->audio_pkt[i].stream_index = c->ast[i]->index;
-            c->audio_pkt[i].flags       |= AV_PKT_FLAG_KEY;
-        }
-        c->ast[i]->codec->sample_rate    = dv_audio_frequency[freq];
-        c->ast[i]->codec->channels       = 2;
-        c->ast[i]->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-        c->ast[i]->codec->bit_rate       = 2 * dv_audio_frequency[freq] * 16;
-        c->ast[i]->start_time            = 0;
-    }
-    c->ach = i;
-
-    return (c->sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */
-}
-
-static int dv_extract_video_info(DVDemuxContext *c, uint8_t *frame)
-{
-    const uint8_t *vsc_pack;
-    AVCodecContext *avctx;
-    int apt, is16_9;
-    int size = 0;
-
-    if (c->sys) {
-        avctx = c->vst->codec;
-
-        avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
-                            c->sys->time_base.den);
-        avctx->time_base = c->sys->time_base;
-        if (!avctx->width) {
-            avctx->width  = c->sys->width;
-            avctx->height = c->sys->height;
-        }
-        avctx->pix_fmt = c->sys->pix_fmt;
-
-        /* finding out SAR is a little bit messy */
-        vsc_pack = dv_extract_pack(frame, dv_video_control);
-        apt      = frame[4] & 0x07;
-        is16_9   = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
-                                 (!apt && (vsc_pack[2] & 0x07) == 0x07)));
-        c->vst->sample_aspect_ratio = c->sys->sar[is16_9];
-        avctx->bit_rate = av_rescale_q(c->sys->frame_size,
-                                       (AVRational) { 8, 1 },
-                                       c->sys->time_base);
-        size = c->sys->frame_size;
-    }
-    return size;
-}
-
-/* The following 3 functions constitute our interface to the world */
-
-DVDemuxContext *avpriv_dv_init_demux(AVFormatContext *s)
-{
-    DVDemuxContext *c;
-
-    c = av_mallocz(sizeof(DVDemuxContext));
-    if (!c)
-        return NULL;
-
-    c->vst = avformat_new_stream(s, NULL);
-    if (!c->vst) {
-        av_free(c);
-        return NULL;
-    }
-
-    c->fctx                   = s;
-    c->vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    c->vst->codec->codec_id   = AV_CODEC_ID_DVVIDEO;
-    c->vst->codec->bit_rate   = 25000000;
-    c->vst->start_time        = 0;
-
-    return c;
-}
-
-int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
-{
-    int size = -1;
-    int i;
-
-    for (i = 0; i < c->ach; i++) {
-        if (c->ast[i] && c->audio_pkt[i].size) {
-            *pkt                 = c->audio_pkt[i];
-            c->audio_pkt[i].size = 0;
-            size                 = pkt->size;
-            break;
-        }
-    }
-
-    return size;
-}
-
-int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
-                             uint8_t *buf, int buf_size)
-{
-    int size, i;
-    uint8_t *ppcm[5] = { 0 };
-
-    if (buf_size < DV_PROFILE_BYTES ||
-        !(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
-        buf_size < c->sys->frame_size) {
-        return -1;   /* Broken frame, or not enough data */
-    }
-
-    /* Queueing audio packet */
-    /* FIXME: in case of no audio/bad audio we have to do something */
-    size = dv_extract_audio_info(c, buf);
-    for (i = 0; i < c->ach; i++) {
-        c->audio_pkt[i].size = size;
-        c->audio_pkt[i].pts  = c->abytes * 30000 * 8 /
-                               c->ast[i]->codec->bit_rate;
-        ppcm[i] = c->audio_buf[i];
-    }
-    if (c->ach)
-        dv_extract_audio(buf, ppcm, c->sys);
-
-    /* We work with 720p frames split in half, thus even frames have
-     * channels 0,1 and odd 2,3. */
-    if (c->sys->height == 720) {
-        if (buf[1] & 0x0C) {
-            c->audio_pkt[2].size = c->audio_pkt[3].size = 0;
-        } else {
-            c->audio_pkt[0].size = c->audio_pkt[1].size = 0;
-            c->abytes           += size;
-        }
-    } else {
-        c->abytes += size;
-    }
-
-    /* Now it's time to return video packet */
-    size = dv_extract_video_info(c, buf);
-    av_init_packet(pkt);
-    pkt->data         = buf;
-    pkt->size         = size;
-    pkt->flags       |= AV_PKT_FLAG_KEY;
-    pkt->stream_index = c->vst->index;
-    pkt->pts          = c->frames;
-
-    c->frames++;
-
-    return size;
-}
-
-static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
-                               int64_t timestamp, int flags)
-{
-    // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
-    const DVprofile *sys = avpriv_dv_codec_profile(c->vst->codec);
-    int64_t offset;
-    int64_t size       = avio_size(s->pb) - s->data_offset;
-    int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
-
-    offset = sys->frame_size * timestamp;
-
-    if (size >= 0 && offset > max_offset)
-        offset = max_offset;
-    else if (offset < 0)
-        offset = 0;
-
-    return offset + s->data_offset;
-}
-
-void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset)
-{
-    c->frames = frame_offset;
-    if (c->ach)
-        c->abytes = av_rescale_q(c->frames, c->sys->time_base,
-                                 (AVRational) { 8, c->ast[0]->codec->bit_rate });
-
-    c->audio_pkt[0].size = c->audio_pkt[1].size = 0;
-    c->audio_pkt[2].size = c->audio_pkt[3].size = 0;
-}
-
-/************************************************************
- * Implementation of the easiest DV storage of all -- raw DV.
- ************************************************************/
-
-typedef struct RawDVContext {
-    DVDemuxContext *dv_demux;
-    uint8_t         buf[DV_MAX_FRAME_SIZE];
-} RawDVContext;
-
-static int dv_read_header(AVFormatContext *s)
-{
-    unsigned state, marker_pos = 0;
-    RawDVContext *c = s->priv_data;
-
-    c->dv_demux = avpriv_dv_init_demux(s);
-    if (!c->dv_demux)
-        return -1;
-
-    state = avio_rb32(s->pb);
-    while ((state & 0xffffff7f) != 0x1f07003f) {
-        if (s->pb->eof_reached) {
-            av_log(s, AV_LOG_ERROR, "Cannot find DV header.\n");
-            return -1;
-        }
-        if (state == 0x003f0700 || state == 0xff3f0700)
-            marker_pos = avio_tell(s->pb);
-        if (state == 0xff3f0701 && avio_tell(s->pb) - marker_pos == 80) {
-            avio_seek(s->pb, -163, SEEK_CUR);
-            state = avio_rb32(s->pb);
-            break;
-        }
-        state = (state << 8) | avio_r8(s->pb);
-    }
-    AV_WB32(c->buf, state);
-
-    if (avio_read(s->pb, c->buf + 4, DV_PROFILE_BYTES - 4) <= 0 ||
-        avio_seek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
-        return AVERROR(EIO);
-
-    c->dv_demux->sys = avpriv_dv_frame_profile(c->dv_demux->sys,
-                                               c->buf,
-                                               DV_PROFILE_BYTES);
-    if (!c->dv_demux->sys) {
-        av_log(s, AV_LOG_ERROR,
-               "Can't determine profile of DV input stream.\n");
-        return -1;
-    }
-
-    s->bit_rate = av_rescale_q(c->dv_demux->sys->frame_size,
-                               (AVRational) { 8, 1 },
-                               c->dv_demux->sys->time_base);
-
-    return 0;
-}
-
-static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int size;
-    RawDVContext *c = s->priv_data;
-
-    size = avpriv_dv_get_packet(c->dv_demux, pkt);
-
-    if (size < 0) {
-        if (!c->dv_demux->sys)
-            return AVERROR(EIO);
-        size = c->dv_demux->sys->frame_size;
-        if (avio_read(s->pb, c->buf, size) <= 0)
-            return AVERROR(EIO);
-
-        size = avpriv_dv_produce_packet(c->dv_demux, pkt, c->buf, size);
-    }
-
-    return size;
-}
-
-static int dv_read_seek(AVFormatContext *s, int stream_index,
-                        int64_t timestamp, int flags)
-{
-    RawDVContext *r   = s->priv_data;
-    DVDemuxContext *c = r->dv_demux;
-    int64_t offset    = dv_frame_offset(s, c, timestamp, flags);
-
-    if (avio_seek(s->pb, offset, SEEK_SET) < 0)
-        return -1;
-
-    ff_dv_offset_reset(c, offset / c->sys->frame_size);
-    return 0;
-}
-
-static int dv_read_close(AVFormatContext *s)
-{
-    RawDVContext *c = s->priv_data;
-    av_free(c->dv_demux);
-    return 0;
-}
-
-static int dv_probe(AVProbeData *p)
-{
-    unsigned state, marker_pos = 0;
-    int i;
-    int matches           = 0;
-    int secondary_matches = 0;
-
-    if (p->buf_size < 5)
-        return 0;
-
-    state = AV_RB32(p->buf);
-    for (i = 4; i < p->buf_size; i++) {
-        if ((state & 0xffffff7f) == 0x1f07003f)
-            matches++;
-        // any section header, also with seq/chan num != 0,
-        // should appear around every 12000 bytes, at least 10 per frame
-        if ((state & 0xff07ff7f) == 0x1f07003f)
-            secondary_matches++;
-        if (state == 0x003f0700 || state == 0xff3f0700)
-            marker_pos = i;
-        if (state == 0xff3f0701 && i - marker_pos == 80)
-            matches++;
-        state = (state << 8) | p->buf[i];
-    }
-
-    if (matches && p->buf_size / matches < 1024 * 1024) {
-        if (matches > 4 ||
-            (secondary_matches >= 10 &&
-             p->buf_size / secondary_matches < 24000))
-            // not max to avoid dv in mov to match
-            return AVPROBE_SCORE_MAX * 3 / 4;
-        return AVPROBE_SCORE_MAX / 4;
-    }
-    return 0;
-}
-
-#if CONFIG_DV_DEMUXER
-AVInputFormat ff_dv_demuxer = {
-    .name           = "dv",
-    .long_name      = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
-    .priv_data_size = sizeof(RawDVContext),
-    .read_probe     = dv_probe,
-    .read_header    = dv_read_header,
-    .read_packet    = dv_read_packet,
-    .read_close     = dv_read_close,
-    .read_seek      = dv_read_seek,
-    .extensions     = "dv,dif",
-};
-#endif
diff --git a/deps/libav/libavformat/dv.h b/deps/libav/libavformat/dv.h
deleted file mode 100644
index e8b2d37..0000000
--- a/deps/libav/libavformat/dv.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * General DV muxer/demuxer
- * Copyright (c) 2003 Roman Shaposhnik
- *
- * Many thanks to Dan Dennedy <dan at dennedy.org> for providing wealth
- * of DV technical info.
- *
- * Raw DV format
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_DV_H
-#define AVFORMAT_DV_H
-
-#include "avformat.h"
-
-typedef struct DVDemuxContext DVDemuxContext;
-DVDemuxContext* avpriv_dv_init_demux(AVFormatContext* s);
-int avpriv_dv_get_packet(DVDemuxContext*, AVPacket *);
-int avpriv_dv_produce_packet(DVDemuxContext*, AVPacket*, uint8_t*, int);
-void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset);
-
-typedef struct DVMuxContext DVMuxContext;
-
-#endif /* AVFORMAT_DV_H */
diff --git a/deps/libav/libavformat/dvenc.c b/deps/libav/libavformat/dvenc.c
deleted file mode 100644
index 66d848c..0000000
--- a/deps/libav/libavformat/dvenc.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * General DV muxer/demuxer
- * Copyright (c) 2003 Roman Shaposhnik
- *
- * Many thanks to Dan Dennedy <dan at dennedy.org> for providing wealth
- * of DV technical info.
- *
- * Raw DV format
- * Copyright (c) 2002 Fabrice Bellard
- *
- * 50 Mbps (DVCPRO50) support
- * Copyright (c) 2006 Daniel Maas <dmaas at maasdigital.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <time.h>
-#include <stdarg.h>
-
-#include "avformat.h"
-#include "internal.h"
-#include "libavcodec/dv_profile.h"
-#include "libavcodec/dv.h"
-#include "dv.h"
-#include "libavutil/fifo.h"
-#include "libavutil/mathematics.h"
-
-#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
-
-struct DVMuxContext {
-    const DVprofile*  sys;           /* current DV profile, e.g.: 525/60, 625/50 */
-    int               n_ast;         /* number of stereo audio streams (up to 2) */
-    AVStream         *ast[2];        /* stereo audio streams */
-    AVFifoBuffer     *audio_data[2]; /* FIFO for storing excessive amounts of PCM */
-    int               frames;        /* current frame number */
-    int64_t           start_time;    /* recording start time */
-    int               has_audio;     /* frame under construction has audio */
-    int               has_video;     /* frame under construction has video */
-    uint8_t           frame_buf[DV_MAX_FRAME_SIZE]; /* frame under construction */
-};
-
-static const int dv_aaux_packs_dist[12][9] = {
-    { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
-    { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
-    { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
-    { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
-    { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
-    { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
-    { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
-    { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
-    { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
-    { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
-    { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
-    { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
-};
-
-static int dv_audio_frame_size(const DVprofile* sys, int frame)
-{
-    return sys->audio_samples_dist[frame % (sizeof(sys->audio_samples_dist) /
-                                            sizeof(sys->audio_samples_dist[0]))];
-}
-
-static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* buf, ...)
-{
-    struct tm tc;
-    time_t ct;
-    int ltc_frame;
-    va_list ap;
-
-    buf[0] = (uint8_t)pack_id;
-    switch (pack_id) {
-    case dv_timecode:
-        ct = (time_t)av_rescale_rnd(c->frames, c->sys->time_base.num,
-                                    c->sys->time_base.den, AV_ROUND_DOWN);
-        ff_brktimegm(ct, &tc);
-        /*
-         * LTC drop-frame frame counter drops two frames (0 and 1) every
-         * minute, unless it is exactly divisible by 10
-         */
-        ltc_frame = (c->frames + 2 * ct / 60 - 2 * ct / 600) % c->sys->ltc_divisor;
-        buf[1] = (0                 << 7) | /* color frame: 0 - unsync; 1 - sync mode */
-                 (1                 << 6) | /* drop frame timecode: 0 - nondrop; 1 - drop */
-                 ((ltc_frame / 10)  << 4) | /* tens of frames */
-                 (ltc_frame % 10);          /* units of frames */
-        buf[2] = (1                 << 7) | /* biphase mark polarity correction: 0 - even; 1 - odd */
-                 ((tc.tm_sec / 10)  << 4) | /* tens of seconds */
-                 (tc.tm_sec % 10);          /* units of seconds */
-        buf[3] = (1                 << 7) | /* binary group flag BGF0 */
-                 ((tc.tm_min / 10)  << 4) | /* tens of minutes */
-                 (tc.tm_min % 10);          /* units of minutes */
-        buf[4] = (1                 << 7) | /* binary group flag BGF2 */
-                 (1                 << 6) | /* binary group flag BGF1 */
-                 ((tc.tm_hour / 10) << 4) | /* tens of hours */
-                 (tc.tm_hour % 10);         /* units of hours */
-        break;
-    case dv_audio_source:  /* AAUX source pack */
-        va_start(ap, buf);
-        buf[1] = (1 << 7) | /* locked mode -- SMPTE only supports locked mode */
-                 (1 << 6) | /* reserved -- always 1 */
-                 (dv_audio_frame_size(c->sys, c->frames) -
-                  c->sys->audio_min_samples[0]);
-                            /* # of samples      */
-        buf[2] = (0 << 7) | /* multi-stereo      */
-                 (0 << 5) | /* #of audio channels per block: 0 -- 1 channel */
-                 (0 << 4) | /* pair bit: 0 -- one pair of channels */
-                 !!va_arg(ap, int); /* audio mode        */
-        buf[3] = (1 << 7) | /* res               */
-                 (1 << 6) | /* multi-language flag */
-                 (c->sys->dsf << 5) | /*  system: 60fields/50fields */
-                 (c->sys->n_difchan & 2); /* definition: 0 -- 25Mbps, 2 -- 50Mbps */
-        buf[4] = (1 << 7) | /* emphasis: 1 -- off */
-                 (0 << 6) | /* emphasis time constant: 0 -- reserved */
-                 (0 << 3) | /* frequency: 0 -- 48kHz, 1 -- 44,1kHz, 2 -- 32kHz */
-                  0;        /* quantization: 0 -- 16bit linear, 1 -- 12bit nonlinear */
-        va_end(ap);
-        break;
-    case dv_audio_control:
-        buf[1] = (0 << 6) | /* copy protection: 0 -- unrestricted */
-                 (1 << 4) | /* input source: 1 -- digital input */
-                 (3 << 2) | /* compression: 3 -- no information */
-                  0;        /* misc. info/SMPTE emphasis off */
-        buf[2] = (1 << 7) | /* recording start point: 1 -- no */
-                 (1 << 6) | /* recording end point: 1 -- no */
-                 (1 << 3) | /* recording mode: 1 -- original */
-                  7;
-        buf[3] = (1 << 7) | /* direction: 1 -- forward */
-                 (c->sys->pix_fmt == AV_PIX_FMT_YUV420P ? 0x20 : /* speed */
-                                                       c->sys->ltc_divisor * 4);
-        buf[4] = (1 << 7) | /* reserved -- always 1 */
-                  0x7f;     /* genre category */
-        break;
-    case dv_audio_recdate:
-    case dv_video_recdate:  /* VAUX recording date */
-        ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
-                                            c->sys->time_base.den, AV_ROUND_DOWN);
-        ff_brktimegm(ct, &tc);
-        buf[1] = 0xff; /* ds, tm, tens of time zone, units of time zone */
-                       /* 0xff is very likely to be "unknown" */
-        buf[2] = (3 << 6) | /* reserved -- always 1 */
-                 ((tc.tm_mday / 10) << 4) | /* Tens of day */
-                 (tc.tm_mday % 10);         /* Units of day */
-        buf[3] = /* we set high 4 bits to 0, shouldn't we set them to week? */
-                 ((tc.tm_mon / 10) << 4) |    /* Tens of month */
-                 (tc.tm_mon  % 10);           /* Units of month */
-        buf[4] = (((tc.tm_year % 100) / 10) << 4) | /* Tens of year */
-                 (tc.tm_year % 10);                 /* Units of year */
-        break;
-    case dv_audio_rectime:  /* AAUX recording time */
-    case dv_video_rectime:  /* VAUX recording time */
-        ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
-                                                       c->sys->time_base.den, AV_ROUND_DOWN);
-        ff_brktimegm(ct, &tc);
-        buf[1] = (3 << 6) | /* reserved -- always 1 */
-                 0x3f; /* tens of frame, units of frame: 0x3f - "unknown" ? */
-        buf[2] = (1 << 7) | /* reserved -- always 1 */
-                 ((tc.tm_sec / 10) << 4) | /* Tens of seconds */
-                 (tc.tm_sec % 10);         /* Units of seconds */
-        buf[3] = (1 << 7) | /* reserved -- always 1 */
-                 ((tc.tm_min / 10) << 4) | /* Tens of minutes */
-                 (tc.tm_min % 10);         /* Units of minutes */
-        buf[4] = (3 << 6) | /* reserved -- always 1 */
-                 ((tc.tm_hour / 10) << 4) | /* Tens of hours */
-                 (tc.tm_hour % 10);         /* Units of hours */
-        break;
-    default:
-        buf[1] = buf[2] = buf[3] = buf[4] = 0xff;
-    }
-    return 5;
-}
-
-static void dv_inject_audio(DVMuxContext *c, int channel, uint8_t* frame_ptr)
-{
-    int i, j, d, of, size;
-    size = 4 * dv_audio_frame_size(c->sys, c->frames);
-    frame_ptr += channel * c->sys->difseg_size * 150 * 80;
-    for (i = 0; i < c->sys->difseg_size; i++) {
-        frame_ptr += 6 * 80; /* skip DIF segment header */
-        for (j = 0; j < 9; j++) {
-            dv_write_pack(dv_aaux_packs_dist[i][j], c, &frame_ptr[3], i >= c->sys->difseg_size/2);
-            for (d = 8; d < 80; d+=2) {
-                of = c->sys->audio_shuffle[i][j] + (d - 8)/2 * c->sys->audio_stride;
-                if (of*2 >= size)
-                    continue;
-
-                frame_ptr[d]   = *av_fifo_peek2(c->audio_data[channel], of*2+1); // FIXME: maybe we have to admit
-                frame_ptr[d+1] = *av_fifo_peek2(c->audio_data[channel], of*2);   //        that DV is a big-endian PCM
-            }
-            frame_ptr += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
-        }
-    }
-}
-
-static void dv_inject_metadata(DVMuxContext *c, uint8_t* frame)
-{
-    int j, k;
-    uint8_t* buf;
-
-    for (buf = frame; buf < frame + c->sys->frame_size; buf += 150 * 80) {
-        /* DV subcode: 2nd and 3d DIFs */
-        for (j = 80; j < 80 * 3; j += 80) {
-            for (k = 6; k < 6 * 8; k += 8)
-                dv_write_pack(dv_timecode, c, &buf[j+k]);
-
-            if (((long)(buf-frame)/(c->sys->frame_size/(c->sys->difseg_size*c->sys->n_difchan))%c->sys->difseg_size) > 5) { /* FIXME: is this really needed ? */
-                dv_write_pack(dv_video_recdate, c, &buf[j+14]);
-                dv_write_pack(dv_video_rectime, c, &buf[j+22]);
-                dv_write_pack(dv_video_recdate, c, &buf[j+38]);
-                dv_write_pack(dv_video_rectime, c, &buf[j+46]);
-            }
-        }
-
-        /* DV VAUX: 4th, 5th and 6th 3DIFs */
-        for (j = 80*3 + 3; j < 80*6; j += 80) {
-            dv_write_pack(dv_video_recdate, c, &buf[j+5*2]);
-            dv_write_pack(dv_video_rectime, c, &buf[j+5*3]);
-            dv_write_pack(dv_video_recdate, c, &buf[j+5*11]);
-            dv_write_pack(dv_video_rectime, c, &buf[j+5*12]);
-        }
-    }
-}
-
-/*
- * The following 3 functions constitute our interface to the world
- */
-
-static int dv_assemble_frame(DVMuxContext *c, AVStream* st,
-                             uint8_t* data, int data_size, uint8_t** frame)
-{
-    int i, reqasize;
-
-    *frame = &c->frame_buf[0];
-    reqasize = 4 * dv_audio_frame_size(c->sys, c->frames);
-
-    switch (st->codec->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-        /* FIXME: we have to have more sensible approach than this one */
-        if (c->has_video)
-            av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->frames);
-
-        memcpy(*frame, data, c->sys->frame_size);
-        c->has_video = 1;
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        for (i = 0; i < c->n_ast && st != c->ast[i]; i++);
-
-          /* FIXME: we have to have more sensible approach than this one */
-        if (av_fifo_size(c->audio_data[i]) + data_size >= 100*MAX_AUDIO_FRAME_SIZE)
-            av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->frames);
-        av_fifo_generic_write(c->audio_data[i], data, data_size, NULL);
-
-        /* Let us see if we've got enough audio for one DV frame. */
-        c->has_audio |= ((reqasize <= av_fifo_size(c->audio_data[i])) << i);
-
-        break;
-    default:
-        break;
-    }
-
-    /* Let us see if we have enough data to construct one DV frame. */
-    if (c->has_video == 1 && c->has_audio + 1 == 1 << c->n_ast) {
-        dv_inject_metadata(c, *frame);
-        c->has_audio = 0;
-        for (i=0; i < c->n_ast; i++) {
-            dv_inject_audio(c, i, *frame);
-            av_fifo_drain(c->audio_data[i], reqasize);
-            c->has_audio |= ((reqasize <= av_fifo_size(c->audio_data[i])) << i);
-        }
-
-        c->has_video = 0;
-
-        c->frames++;
-
-        return c->sys->frame_size;
-    }
-
-    return 0;
-}
-
-static DVMuxContext* dv_init_mux(AVFormatContext* s)
-{
-    DVMuxContext *c = s->priv_data;
-    AVStream *vst = NULL;
-    AVDictionaryEntry *t;
-    int i;
-
-    /* we support at most 1 video and 2 audio streams */
-    if (s->nb_streams > 3)
-        return NULL;
-
-    c->n_ast  = 0;
-    c->ast[0] = c->ast[1] = NULL;
-
-    /* We have to sort out where audio and where video stream is */
-    for (i=0; i<s->nb_streams; i++) {
-        switch (s->streams[i]->codec->codec_type) {
-        case AVMEDIA_TYPE_VIDEO:
-            if (vst) return NULL;
-            vst = s->streams[i];
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            if (c->n_ast > 1) return NULL;
-            c->ast[c->n_ast++] = s->streams[i];
-            break;
-        default:
-            goto bail_out;
-        }
-    }
-
-    /* Some checks -- DV format is very picky about its incoming streams */
-    if (!vst || vst->codec->codec_id != AV_CODEC_ID_DVVIDEO)
-        goto bail_out;
-    for (i=0; i<c->n_ast; i++) {
-        if (c->ast[i] && (c->ast[i]->codec->codec_id    != AV_CODEC_ID_PCM_S16LE ||
-                          c->ast[i]->codec->sample_rate != 48000 ||
-                          c->ast[i]->codec->channels    != 2))
-            goto bail_out;
-    }
-    c->sys = avpriv_dv_codec_profile(vst->codec);
-    if (!c->sys)
-        goto bail_out;
-
-    if ((c->n_ast > 1) && (c->sys->n_difchan < 2)) {
-        /* only 1 stereo pair is allowed in 25Mbps mode */
-        goto bail_out;
-    }
-
-    /* Ok, everything seems to be in working order */
-    c->frames     = 0;
-    c->has_audio  = 0;
-    c->has_video  = 0;
-    if (t = av_dict_get(s->metadata, "creation_time", NULL, 0))
-        c->start_time = ff_iso8601_to_unix_time(t->value);
-
-    for (i=0; i < c->n_ast; i++) {
-        if (c->ast[i] && !(c->audio_data[i]=av_fifo_alloc(100*MAX_AUDIO_FRAME_SIZE))) {
-            while (i > 0) {
-                i--;
-                av_fifo_free(c->audio_data[i]);
-            }
-            goto bail_out;
-        }
-    }
-
-    return c;
-
-bail_out:
-    return NULL;
-}
-
-static void dv_delete_mux(DVMuxContext *c)
-{
-    int i;
-    for (i=0; i < c->n_ast; i++)
-        av_fifo_free(c->audio_data[i]);
-}
-
-static int dv_write_header(AVFormatContext *s)
-{
-    if (!dv_init_mux(s)) {
-        av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n"
-                    "Make sure that you supply exactly two streams:\n"
-                    "     video: 25fps or 29.97fps, audio: 2ch/48kHz/PCM\n"
-                    "     (50Mbps allows an optional second audio stream)\n");
-        return -1;
-    }
-    return 0;
-}
-
-static int dv_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    uint8_t* frame;
-    int fsize;
-
-    fsize = dv_assemble_frame(s->priv_data, s->streams[pkt->stream_index],
-                              pkt->data, pkt->size, &frame);
-    if (fsize > 0) {
-        avio_write(s->pb, frame, fsize);
-    }
-    return 0;
-}
-
-/*
- * We might end up with some extra A/V data without matching counterpart.
- * E.g. video data without enough audio to write the complete frame.
- * Currently we simply drop the last frame. I don't know whether this
- * is the best strategy of all
- */
-static int dv_write_trailer(struct AVFormatContext *s)
-{
-    dv_delete_mux(s->priv_data);
-    return 0;
-}
-
-AVOutputFormat ff_dv_muxer = {
-    .name              = "dv",
-    .long_name         = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
-    .extensions        = "dv",
-    .priv_data_size    = sizeof(DVMuxContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_DVVIDEO,
-    .write_header      = dv_write_header,
-    .write_packet      = dv_write_packet,
-    .write_trailer     = dv_write_trailer,
-};
diff --git a/deps/libav/libavformat/dxa.c b/deps/libav/libavformat/dxa.c
deleted file mode 100644
index a1b85fe..0000000
--- a/deps/libav/libavformat/dxa.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * DXA demuxer
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-#include "riff.h"
-
-#define DXA_EXTRA_SIZE  9
-
-typedef struct{
-    int frames;
-    int has_sound;
-    int bpc;
-    uint32_t bytes_left;
-    int64_t wavpos, vidpos;
-    int readvid;
-}DXAContext;
-
-static int dxa_probe(AVProbeData *p)
-{
-    int w, h;
-    if (p->buf_size < 15)
-        return 0;
-    w = AV_RB16(p->buf + 11);
-    h = AV_RB16(p->buf + 13);
-    /* check file header */
-    if (p->buf[0] == 'D' && p->buf[1] == 'E' &&
-        p->buf[2] == 'X' && p->buf[3] == 'A' &&
-        w && w <= 2048 && h && h <= 2048)
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int dxa_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    DXAContext *c = s->priv_data;
-    AVStream *st, *ast;
-    uint32_t tag;
-    int32_t fps;
-    int w, h;
-    int num, den;
-    int flags;
-    int ret;
-
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('D', 'E', 'X', 'A'))
-        return -1;
-    flags = avio_r8(pb);
-    c->frames = avio_rb16(pb);
-    if(!c->frames){
-        av_log(s, AV_LOG_ERROR, "File contains no frames ???\n");
-        return -1;
-    }
-
-    fps = avio_rb32(pb);
-    if(fps > 0){
-        den = 1000;
-        num = fps;
-    }else if (fps < 0){
-        den = 100000;
-        num = -fps;
-    }else{
-        den = 10;
-        num = 1;
-    }
-    w = avio_rb16(pb);
-    h = avio_rb16(pb);
-    c->has_sound = 0;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return -1;
-
-    // Parse WAV data header
-    if(avio_rl32(pb) == MKTAG('W', 'A', 'V', 'E')){
-        uint32_t size, fsize;
-        c->has_sound = 1;
-        size = avio_rb32(pb);
-        c->vidpos = avio_tell(pb) + size;
-        avio_skip(pb, 16);
-        fsize = avio_rl32(pb);
-
-        ast = avformat_new_stream(s, NULL);
-        if (!ast)
-            return -1;
-        ret = ff_get_wav_header(pb, ast->codec, fsize);
-        if (ret < 0)
-            return ret;
-        if (ast->codec->sample_rate > 0)
-            avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
-        // find 'data' chunk
-        while(avio_tell(pb) < c->vidpos && !pb->eof_reached){
-            tag = avio_rl32(pb);
-            fsize = avio_rl32(pb);
-            if(tag == MKTAG('d', 'a', 't', 'a')) break;
-            avio_skip(pb, fsize);
-        }
-        c->bpc = (fsize + c->frames - 1) / c->frames;
-        if(ast->codec->block_align)
-            c->bpc = ((c->bpc + ast->codec->block_align - 1) / ast->codec->block_align) * ast->codec->block_align;
-        c->bytes_left = fsize;
-        c->wavpos = avio_tell(pb);
-        avio_seek(pb, c->vidpos, SEEK_SET);
-    }
-
-    /* now we are ready: build format streams */
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_DXA;
-    st->codec->width      = w;
-    st->codec->height     = h;
-    av_reduce(&den, &num, den, num, (1UL<<31)-1);
-    avpriv_set_pts_info(st, 33, num, den);
-    /* flags & 0x80 means that image is interlaced,
-     * flags & 0x40 means that image has double height
-     * either way set true height
-     */
-    if(flags & 0xC0){
-        st->codec->height >>= 1;
-    }
-    c->readvid = !c->has_sound;
-    c->vidpos  = avio_tell(pb);
-    s->start_time = 0;
-    s->duration = (int64_t)c->frames * AV_TIME_BASE * num / den;
-    av_log(s, AV_LOG_DEBUG, "%d frame(s)\n",c->frames);
-
-    return 0;
-}
-
-static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    DXAContext *c = s->priv_data;
-    int ret;
-    uint32_t size;
-    uint8_t buf[DXA_EXTRA_SIZE], pal[768+4];
-    int pal_size = 0;
-
-    if(!c->readvid && c->has_sound && c->bytes_left){
-        c->readvid = 1;
-        avio_seek(s->pb, c->wavpos, SEEK_SET);
-        size = FFMIN(c->bytes_left, c->bpc);
-        ret = av_get_packet(s->pb, pkt, size);
-        pkt->stream_index = 1;
-        if(ret != size)
-            return AVERROR(EIO);
-        c->bytes_left -= size;
-        c->wavpos = avio_tell(s->pb);
-        return 0;
-    }
-    avio_seek(s->pb, c->vidpos, SEEK_SET);
-    while(!s->pb->eof_reached && c->frames){
-        avio_read(s->pb, buf, 4);
-        switch(AV_RL32(buf)){
-        case MKTAG('N', 'U', 'L', 'L'):
-            if(av_new_packet(pkt, 4 + pal_size) < 0)
-                return AVERROR(ENOMEM);
-            pkt->stream_index = 0;
-            if(pal_size) memcpy(pkt->data, pal, pal_size);
-            memcpy(pkt->data + pal_size, buf, 4);
-            c->frames--;
-            c->vidpos = avio_tell(s->pb);
-            c->readvid = 0;
-            return 0;
-        case MKTAG('C', 'M', 'A', 'P'):
-            pal_size = 768+4;
-            memcpy(pal, buf, 4);
-            avio_read(s->pb, pal + 4, 768);
-            break;
-        case MKTAG('F', 'R', 'A', 'M'):
-            avio_read(s->pb, buf + 4, DXA_EXTRA_SIZE - 4);
-            size = AV_RB32(buf + 5);
-            if(size > 0xFFFFFF){
-                av_log(s, AV_LOG_ERROR, "Frame size is too big: %d\n", size);
-                return -1;
-            }
-            if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0)
-                return AVERROR(ENOMEM);
-            memcpy(pkt->data + pal_size, buf, DXA_EXTRA_SIZE);
-            ret = avio_read(s->pb, pkt->data + DXA_EXTRA_SIZE + pal_size, size);
-            if(ret != size){
-                av_free_packet(pkt);
-                return AVERROR(EIO);
-            }
-            if(pal_size) memcpy(pkt->data, pal, pal_size);
-            pkt->stream_index = 0;
-            c->frames--;
-            c->vidpos = avio_tell(s->pb);
-            c->readvid = 0;
-            return 0;
-        default:
-            av_log(s, AV_LOG_ERROR, "Unknown tag %c%c%c%c\n", buf[0], buf[1], buf[2], buf[3]);
-            return -1;
-        }
-    }
-    return AVERROR(EIO);
-}
-
-AVInputFormat ff_dxa_demuxer = {
-    .name           = "dxa",
-    .long_name      = NULL_IF_CONFIG_SMALL("DXA"),
-    .priv_data_size = sizeof(DXAContext),
-    .read_probe     = dxa_probe,
-    .read_header    = dxa_read_header,
-    .read_packet    = dxa_read_packet,
-};
diff --git a/deps/libav/libavformat/eacdata.c b/deps/libav/libavformat/eacdata.c
deleted file mode 100644
index b56ba1c..0000000
--- a/deps/libav/libavformat/eacdata.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Electronic Arts .cdata file Demuxer
- * Copyright (c) 2007 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Electronic Arts cdata Format Demuxer
- * by Peter Ross (pross at xvid.org)
- *
- * Technical details here:
- *  http://wiki.multimedia.cx/index.php?title=EA_Command_And_Conquer_3_Audio_Codec
- */
-
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct {
-  unsigned int channels;
-  unsigned int audio_pts;
-} CdataDemuxContext;
-
-static int cdata_probe(AVProbeData *p)
-{
-    const uint8_t *b = p->buf;
-
-    if (b[0] == 0x04 && (b[1] == 0x00 || b[1] == 0x04 || b[1] == 0x0C))
-        return AVPROBE_SCORE_MAX/8;
-    return 0;
-}
-
-static int cdata_read_header(AVFormatContext *s)
-{
-    CdataDemuxContext *cdata = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned int sample_rate, header;
-    AVStream *st;
-
-    header = avio_rb16(pb);
-    switch (header) {
-        case 0x0400: cdata->channels = 1; break;
-        case 0x0404: cdata->channels = 2; break;
-        case 0x040C: cdata->channels = 4; break;
-        default:
-            av_log(s, AV_LOG_INFO, "unknown header 0x%04x\n", header);
-            return -1;
-    };
-
-    sample_rate = avio_rb16(pb);
-    avio_skip(pb, 12);
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_tag = 0; /* no fourcc */
-    st->codec->codec_id = AV_CODEC_ID_ADPCM_EA_XAS;
-    st->codec->channels = cdata->channels;
-    st->codec->sample_rate = sample_rate;
-    avpriv_set_pts_info(st, 64, 1, sample_rate);
-
-    cdata->audio_pts = 0;
-    return 0;
-}
-
-static int cdata_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    CdataDemuxContext *cdata = s->priv_data;
-    int packet_size = 76*cdata->channels;
-
-    int ret = av_get_packet(s->pb, pkt, packet_size);
-    if (ret < 0)
-        return ret;
-    pkt->pts = cdata->audio_pts++;
-    return 0;
-}
-
-AVInputFormat ff_ea_cdata_demuxer = {
-    .name           = "ea_cdata",
-    .long_name      = NULL_IF_CONFIG_SMALL("Electronic Arts cdata"),
-    .priv_data_size = sizeof(CdataDemuxContext),
-    .read_probe     = cdata_probe,
-    .read_header    = cdata_read_header,
-    .read_packet    = cdata_read_packet,
-    .extensions = "cdata",
-};
diff --git a/deps/libav/libavformat/electronicarts.c b/deps/libav/libavformat/electronicarts.c
deleted file mode 100644
index 9d00c2d..0000000
--- a/deps/libav/libavformat/electronicarts.c
+++ /dev/null
@@ -1,642 +0,0 @@
-/* Electronic Arts Multimedia File Demuxer
- * Copyright (c) 2004  The ffmpeg Project
- * Copyright (c) 2006-2008 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Electronic Arts Multimedia file demuxer (WVE/UV2/etc.)
- * by Robin Kay (komadori at gekkou.co.uk)
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define SCHl_TAG MKTAG('S', 'C', 'H', 'l')
-#define SEAD_TAG MKTAG('S', 'E', 'A', 'D')  /* Sxxx header */
-#define SNDC_TAG MKTAG('S', 'N', 'D', 'C')  /* Sxxx data */
-#define SEND_TAG MKTAG('S', 'E', 'N', 'D')  /* Sxxx end */
-#define SHEN_TAG MKTAG('S', 'H', 'E', 'N')  /* SxEN header */
-#define SDEN_TAG MKTAG('S', 'D', 'E', 'N')  /* SxEN data */
-#define SEEN_TAG MKTAG('S', 'E', 'E', 'N')  /* SxEN end */
-#define ISNh_TAG MKTAG('1', 'S', 'N', 'h')  /* 1SNx header */
-#define EACS_TAG MKTAG('E', 'A', 'C', 'S')
-#define ISNd_TAG MKTAG('1', 'S', 'N', 'd')  /* 1SNx data */
-#define ISNe_TAG MKTAG('1', 'S', 'N', 'e')  /* 1SNx end */
-#define PT00_TAG MKTAG('P', 'T', 0x0, 0x0)
-#define GSTR_TAG MKTAG('G', 'S', 'T', 'R')
-#define SCDl_TAG MKTAG('S', 'C', 'D', 'l')
-#define SCEl_TAG MKTAG('S', 'C', 'E', 'l')
-#define kVGT_TAG MKTAG('k', 'V', 'G', 'T')  /* TGV I-frame */
-#define fVGT_TAG MKTAG('f', 'V', 'G', 'T')  /* TGV P-frame */
-#define mTCD_TAG MKTAG('m', 'T', 'C', 'D')  /* MDEC */
-#define MADk_TAG MKTAG('M', 'A', 'D', 'k')  /* MAD I-frame */
-#define MADm_TAG MKTAG('M', 'A', 'D', 'm')  /* MAD P-frame */
-#define MADe_TAG MKTAG('M', 'A', 'D', 'e')  /* MAD lqp-frame */
-#define MPCh_TAG MKTAG('M', 'P', 'C', 'h')  /* MPEG-2 */
-#define TGQs_TAG MKTAG('T', 'G', 'Q', 's')  /* TGQ I-frame (appears in .TGQ files) */
-#define pQGT_TAG MKTAG('p', 'Q', 'G', 'T')  /* TGQ I-frame (appears in .UV files) */
-#define pIQT_TAG MKTAG('p', 'I', 'Q', 'T')  /* TQI/UV2 I-frame (.UV2/.WVE) */
-#define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
-#define MV0K_TAG MKTAG('M', 'V', '0', 'K')
-#define MV0F_TAG MKTAG('M', 'V', '0', 'F')
-#define MVIh_TAG MKTAG('M', 'V', 'I', 'h')  /* CMV header */
-#define MVIf_TAG MKTAG('M', 'V', 'I', 'f')  /* CMV I-frame */
-
-typedef struct EaDemuxContext {
-    int big_endian;
-
-    enum AVCodecID video_codec;
-    AVRational time_base;
-    int width, height;
-    int video_stream_index;
-
-    enum AVCodecID audio_codec;
-    int audio_stream_index;
-
-    int bytes;
-    int sample_rate;
-    int num_channels;
-    int num_samples;
-} EaDemuxContext;
-
-static uint32_t read_arbitrary(AVIOContext *pb)
-{
-    uint8_t size, byte;
-    int i;
-    uint32_t word;
-
-    size = avio_r8(pb);
-
-    word = 0;
-    for (i = 0; i < size; i++) {
-        byte   = avio_r8(pb);
-        word <<= 8;
-        word  |= byte;
-    }
-
-    return word;
-}
-
-static int process_audio_header_elements(AVFormatContext *s)
-{
-    EaDemuxContext *ea = s->priv_data;
-    AVIOContext    *pb = s->pb;
-    int in_header = 1;
-    int compression_type = -1, revision = -1, revision2 = -1;
-
-    ea->bytes        = 2;
-    ea->sample_rate  = -1;
-    ea->num_channels = 1;
-
-    while (!pb->eof_reached && in_header) {
-        int in_subheader;
-        uint8_t byte;
-        byte = avio_r8(pb);
-
-        switch (byte) {
-        case 0xFD:
-            av_log(s, AV_LOG_DEBUG, "entered audio subheader\n");
-            in_subheader = 1;
-            while (!pb->eof_reached && in_subheader) {
-                uint8_t subbyte;
-                subbyte = avio_r8(pb);
-
-                switch (subbyte) {
-                case 0x80:
-                    revision = read_arbitrary(pb);
-                    av_log(s, AV_LOG_DEBUG,
-                           "revision (element 0x80) set to 0x%08x\n", revision);
-                    break;
-                case 0x82:
-                    ea->num_channels = read_arbitrary(pb);
-                    av_log(s, AV_LOG_DEBUG,
-                           "num_channels (element 0x82) set to 0x%08x\n",
-                           ea->num_channels);
-                    break;
-                case 0x83:
-                    compression_type = read_arbitrary(pb);
-                    av_log(s, AV_LOG_DEBUG,
-                           "compression_type (element 0x83) set to 0x%08x\n",
-                           compression_type);
-                    break;
-                case 0x84:
-                    ea->sample_rate = read_arbitrary(pb);
-                    av_log(s, AV_LOG_DEBUG,
-                           "sample_rate (element 0x84) set to %i\n",
-                           ea->sample_rate);
-                    break;
-                case 0x85:
-                    ea->num_samples = read_arbitrary(pb);
-                    av_log(s, AV_LOG_DEBUG,
-                           "num_samples (element 0x85) set to 0x%08x\n",
-                           ea->num_samples);
-                    break;
-                case 0x8A:
-                    av_log(s, AV_LOG_DEBUG,
-                           "element 0x%02x set to 0x%08x\n",
-                           subbyte, read_arbitrary(pb));
-                    av_log(s, AV_LOG_DEBUG, "exited audio subheader\n");
-                    in_subheader = 0;
-                    break;
-                case 0xA0:
-                    revision2 = read_arbitrary(pb);
-                    av_log(s, AV_LOG_DEBUG,
-                           "revision2 (element 0xA0) set to 0x%08x\n",
-                           revision2);
-                    break;
-                case 0xFF:
-                    av_log(s, AV_LOG_DEBUG,
-                           "end of header block reached (within audio subheader)\n");
-                    in_subheader = 0;
-                    in_header    = 0;
-                    break;
-                default:
-                    av_log(s, AV_LOG_DEBUG,
-                           "element 0x%02x set to 0x%08x\n",
-                           subbyte, read_arbitrary(pb));
-                    break;
-                }
-            }
-            break;
-        case 0xFF:
-            av_log(s, AV_LOG_DEBUG, "end of header block reached\n");
-            in_header = 0;
-            break;
-        default:
-            av_log(s, AV_LOG_DEBUG,
-                   "header element 0x%02x set to 0x%08x\n",
-                   byte, read_arbitrary(pb));
-            break;
-        }
-    }
-
-    switch (compression_type) {
-    case  0:
-        ea->audio_codec = AV_CODEC_ID_PCM_S16LE;
-        break;
-    case  7:
-        ea->audio_codec = AV_CODEC_ID_ADPCM_EA;
-        break;
-    case -1:
-        switch (revision) {
-        case  1:
-            ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R1;
-            break;
-        case  2:
-            ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R2;
-            break;
-        case  3:
-            ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R3;
-            break;
-        case -1:
-            break;
-        default:
-            av_log(s, AV_LOG_ERROR,
-                   "unsupported stream type; revision=%i\n", revision);
-            return 0;
-        }
-        switch (revision2) {
-        case  8:
-            ea->audio_codec = AV_CODEC_ID_PCM_S16LE_PLANAR;
-            break;
-        case 10:
-            ea->audio_codec = AV_CODEC_ID_ADPCM_EA_R2;
-            break;
-        case 16:
-            ea->audio_codec = AV_CODEC_ID_MP3;
-            break;
-        case -1:
-            break;
-        default:
-            ea->audio_codec = AV_CODEC_ID_NONE;
-            av_log(s, AV_LOG_ERROR,
-                   "unsupported stream type; revision2=%i\n", revision2);
-            return 0;
-        }
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR,
-               "unsupported stream type; compression_type=%i\n",
-               compression_type);
-        return 0;
-    }
-
-    if (ea->sample_rate == -1)
-        ea->sample_rate = revision == 3 ? 48000 : 22050;
-
-    return 1;
-}
-
-static void process_audio_header_eacs(AVFormatContext *s)
-{
-    EaDemuxContext *ea = s->priv_data;
-    AVIOContext *pb    = s->pb;
-    int compression_type;
-
-    ea->sample_rate  = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);
-    ea->bytes        = avio_r8(pb);   /* 1=8-bit, 2=16-bit */
-    ea->num_channels = avio_r8(pb);
-    compression_type = avio_r8(pb);
-    avio_skip(pb, 13);
-
-    switch (compression_type) {
-    case 0:
-        switch (ea->bytes) {
-        case 1:
-            ea->audio_codec = AV_CODEC_ID_PCM_S8;
-            break;
-        case 2:
-            ea->audio_codec = AV_CODEC_ID_PCM_S16LE;
-            break;
-        }
-        break;
-    case 1:
-        ea->audio_codec = AV_CODEC_ID_PCM_MULAW;
-        ea->bytes       = 1;
-        break;
-    case 2:
-        ea->audio_codec = AV_CODEC_ID_ADPCM_IMA_EA_EACS;
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR,
-               "unsupported stream type; audio compression_type=%i\n",
-               compression_type);
-    }
-}
-
-static void process_audio_header_sead(AVFormatContext *s)
-{
-    EaDemuxContext *ea = s->priv_data;
-    AVIOContext *pb    = s->pb;
-
-    ea->sample_rate  = avio_rl32(pb);
-    ea->bytes        = avio_rl32(pb);  /* 1=8-bit, 2=16-bit */
-    ea->num_channels = avio_rl32(pb);
-    ea->audio_codec  = AV_CODEC_ID_ADPCM_IMA_EA_SEAD;
-}
-
-static void process_video_header_mdec(AVFormatContext *s)
-{
-    EaDemuxContext *ea = s->priv_data;
-    AVIOContext *pb    = s->pb;
-    avio_skip(pb, 4);
-    ea->width       = avio_rl16(pb);
-    ea->height      = avio_rl16(pb);
-    ea->time_base   = (AVRational) { 1, 15 };
-    ea->video_codec = AV_CODEC_ID_MDEC;
-}
-
-static void process_video_header_vp6(AVFormatContext *s)
-{
-    EaDemuxContext *ea = s->priv_data;
-    AVIOContext *pb    = s->pb;
-
-    avio_skip(pb, 16);
-    ea->time_base.den = avio_rl32(pb);
-    ea->time_base.num = avio_rl32(pb);
-    ea->video_codec   = AV_CODEC_ID_VP6;
-}
-
-static void process_video_header_cmv(AVFormatContext *s)
-{
-    EaDemuxContext *ea = s->priv_data;
-    int fps;
-
-    avio_skip(s->pb, 10);
-    fps = avio_rl16(s->pb);
-    if (fps)
-        ea->time_base = (AVRational) { 1, fps };
-    ea->video_codec = AV_CODEC_ID_CMV;
-}
-
-/* Process EA file header.
- * Return 1 if the EA file is valid and successfully opened, 0 otherwise. */
-static int process_ea_header(AVFormatContext *s)
-{
-    uint32_t blockid, size = 0;
-    EaDemuxContext *ea = s->priv_data;
-    AVIOContext *pb    = s->pb;
-    int i;
-
-    for (i = 0; i < 5 && (!ea->audio_codec || !ea->video_codec); i++) {
-        unsigned int startpos = avio_tell(pb);
-        int err               = 0;
-
-        blockid = avio_rl32(pb);
-        size    = avio_rl32(pb);
-        if (i == 0)
-            ea->big_endian = size > 0x000FFFFF;
-        if (ea->big_endian)
-            size = av_bswap32(size);
-
-        switch (blockid) {
-        case ISNh_TAG:
-            if (avio_rl32(pb) != EACS_TAG) {
-                av_log(s, AV_LOG_ERROR, "unknown 1SNh headerid\n");
-                return 0;
-            }
-            process_audio_header_eacs(s);
-            break;
-
-        case SCHl_TAG:
-        case SHEN_TAG:
-            blockid = avio_rl32(pb);
-            if (blockid == GSTR_TAG) {
-                avio_skip(pb, 4);
-            } else if ((blockid & 0xFFFF) != PT00_TAG) {
-                av_log(s, AV_LOG_ERROR, "unknown SCHl headerid\n");
-                return 0;
-            }
-            err = process_audio_header_elements(s);
-            break;
-
-        case SEAD_TAG:
-            process_audio_header_sead(s);
-            break;
-
-        case MVIh_TAG:
-            process_video_header_cmv(s);
-            break;
-
-        case kVGT_TAG:
-            ea->video_codec = AV_CODEC_ID_TGV;
-            ea->time_base   = (AVRational) { 1, 15 };
-            break;
-
-        case mTCD_TAG:
-            process_video_header_mdec(s);
-            break;
-
-        case MPCh_TAG:
-            ea->video_codec = AV_CODEC_ID_MPEG2VIDEO;
-            break;
-
-        case pQGT_TAG:
-        case TGQs_TAG:
-            ea->video_codec = AV_CODEC_ID_TGQ;
-            break;
-
-        case pIQT_TAG:
-            ea->video_codec = AV_CODEC_ID_TQI;
-            break;
-
-        case MADk_TAG:
-            ea->video_codec = AV_CODEC_ID_MAD;
-            break;
-
-        case MVhd_TAG:
-            process_video_header_vp6(s);
-            break;
-        }
-
-        if (err < 0) {
-            av_log(s, AV_LOG_ERROR, "error parsing header: %i\n", err);
-            return err;
-        }
-
-        avio_seek(pb, startpos + size, SEEK_SET);
-    }
-
-    avio_seek(pb, 0, SEEK_SET);
-
-    return 1;
-}
-
-static int ea_probe(AVProbeData *p)
-{
-    switch (AV_RL32(&p->buf[0])) {
-    case ISNh_TAG:
-    case SCHl_TAG:
-    case SEAD_TAG:
-    case SHEN_TAG:
-    case kVGT_TAG:
-    case MADk_TAG:
-    case MPCh_TAG:
-    case MVhd_TAG:
-    case MVIh_TAG:
-        break;
-    default:
-        return 0;
-    }
-    if (AV_RL32(&p->buf[4]) > 0xfffff && AV_RB32(&p->buf[4]) > 0xfffff)
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int ea_read_header(AVFormatContext *s)
-{
-    EaDemuxContext *ea = s->priv_data;
-    AVStream *st;
-
-    if (!process_ea_header(s))
-        return AVERROR(EIO);
-
-    if (ea->video_codec) {
-        /* initialize the video decoder stream */
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        ea->video_stream_index = st->index;
-        st->codec->codec_type  = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id    = ea->video_codec;
-        st->codec->codec_tag   = 0; /* no fourcc */
-        st->codec->width       = ea->width;
-        st->codec->height      = ea->height;
-        avpriv_set_pts_info(st, 33, ea->time_base.num, ea->time_base.den);
-        st->avg_frame_rate     = (AVRational) { ea->time_base.den,
-                                                ea->time_base.num };
-    }
-
-    if (ea->audio_codec) {
-        if (ea->num_channels <= 0 || ea->num_channels > 2) {
-            av_log(s, AV_LOG_WARNING,
-                   "Unsupported number of channels: %d\n", ea->num_channels);
-            ea->audio_codec = 0;
-            return 1;
-        }
-        if (ea->sample_rate <= 0) {
-            av_log(s, AV_LOG_ERROR,
-                   "Unsupported sample rate: %d\n", ea->sample_rate);
-            ea->audio_codec = 0;
-            return 1;
-        }
-        if (ea->bytes <= 0) {
-            av_log(s, AV_LOG_ERROR,
-                   "Invalid number of bytes per sample: %d\n", ea->bytes);
-            ea->audio_codec = AV_CODEC_ID_NONE;
-            return 1;
-        }
-
-        /* initialize the audio decoder stream */
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        avpriv_set_pts_info(st, 33, 1, ea->sample_rate);
-        st->codec->codec_type            = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id              = ea->audio_codec;
-        st->codec->codec_tag             = 0;   /* no tag */
-        st->codec->channels              = ea->num_channels;
-        st->codec->sample_rate           = ea->sample_rate;
-        st->codec->bits_per_coded_sample = ea->bytes * 8;
-        st->codec->bit_rate              = st->codec->channels *
-                                           st->codec->sample_rate *
-                                           st->codec->bits_per_coded_sample / 4;
-        st->codec->block_align           = st->codec->channels *
-                                           st->codec->bits_per_coded_sample;
-        ea->audio_stream_index           = st->index;
-        st->start_time                   = 0;
-    }
-
-    return 1;
-}
-
-static int ea_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    EaDemuxContext *ea = s->priv_data;
-    AVIOContext *pb    = s->pb;
-    unsigned int chunk_type, chunk_size;
-    int ret = 0, packet_read = 0, key = 0;
-    int av_uninit(num_samples);
-
-    while (!packet_read) {
-        chunk_type = avio_rl32(pb);
-        chunk_size = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);
-        if (chunk_size <= 8)
-            return AVERROR_INVALIDDATA;
-        chunk_size -= 8;
-
-        switch (chunk_type) {
-        /* audio data */
-        case ISNh_TAG:
-            /* header chunk also contains data; skip over the header portion */
-            if (chunk_size < 32)
-                return AVERROR_INVALIDDATA;
-            avio_skip(pb, 32);
-            chunk_size -= 32;
-        case ISNd_TAG:
-        case SCDl_TAG:
-        case SNDC_TAG:
-        case SDEN_TAG:
-            if (!ea->audio_codec) {
-                avio_skip(pb, chunk_size);
-                break;
-            } else if (ea->audio_codec == AV_CODEC_ID_PCM_S16LE_PLANAR ||
-                       ea->audio_codec == AV_CODEC_ID_MP3) {
-                num_samples = avio_rl32(pb);
-                avio_skip(pb, 8);
-                chunk_size -= 12;
-            }
-            ret = av_get_packet(pb, pkt, chunk_size);
-            if (ret < 0)
-                return ret;
-            pkt->stream_index = ea->audio_stream_index;
-
-            switch (ea->audio_codec) {
-            case AV_CODEC_ID_ADPCM_EA:
-            case AV_CODEC_ID_ADPCM_EA_R1:
-            case AV_CODEC_ID_ADPCM_EA_R2:
-            case AV_CODEC_ID_ADPCM_IMA_EA_EACS:
-            case AV_CODEC_ID_ADPCM_EA_R3:
-                if (pkt->size < 4) {
-                    av_log(s, AV_LOG_ERROR, "Packet is too short\n");
-                    av_free_packet(pkt);
-                    return AVERROR_INVALIDDATA;
-                }
-                if (ea->audio_codec == AV_CODEC_ID_ADPCM_EA_R3)
-                    pkt->duration = AV_RB32(pkt->data);
-                else
-                    pkt->duration = AV_RL32(pkt->data);
-                break;
-            case AV_CODEC_ID_ADPCM_IMA_EA_SEAD:
-                pkt->duration = ret * 2 / ea->num_channels;
-                break;
-            case AV_CODEC_ID_PCM_S16LE_PLANAR:
-            case AV_CODEC_ID_MP3:
-                pkt->duration = num_samples;
-                break;
-            default:
-                pkt->duration = chunk_size / (ea->bytes * ea->num_channels);
-            }
-
-            packet_read = 1;
-            break;
-
-        /* ending tag */
-        case 0:
-        case ISNe_TAG:
-        case SCEl_TAG:
-        case SEND_TAG:
-        case SEEN_TAG:
-            ret         = AVERROR(EIO);
-            packet_read = 1;
-            break;
-
-        case MVIh_TAG:
-        case kVGT_TAG:
-        case pQGT_TAG:
-        case TGQs_TAG:
-        case MADk_TAG:
-            key = AV_PKT_FLAG_KEY;
-        case MVIf_TAG:
-        case fVGT_TAG:
-        case MADm_TAG:
-        case MADe_TAG:
-            avio_seek(pb, -8, SEEK_CUR);    // include chunk preamble
-            chunk_size += 8;
-            goto get_video_packet;
-
-        case mTCD_TAG:
-            avio_skip(pb, 8);               // skip ea DCT header
-            chunk_size -= 8;
-            goto get_video_packet;
-
-        case MV0K_TAG:
-        case MPCh_TAG:
-        case pIQT_TAG:
-            key = AV_PKT_FLAG_KEY;
-        case MV0F_TAG:
-get_video_packet:
-            ret = av_get_packet(pb, pkt, chunk_size);
-            if (ret < 0)
-                return ret;
-            pkt->stream_index = ea->video_stream_index;
-            pkt->flags       |= key;
-            packet_read       = 1;
-            break;
-
-        default:
-            avio_skip(pb, chunk_size);
-            break;
-        }
-    }
-
-    return ret;
-}
-
-AVInputFormat ff_ea_demuxer = {
-    .name           = "ea",
-    .long_name      = NULL_IF_CONFIG_SMALL("Electronic Arts Multimedia"),
-    .priv_data_size = sizeof(EaDemuxContext),
-    .read_probe     = ea_probe,
-    .read_header    = ea_read_header,
-    .read_packet    = ea_read_packet,
-};
diff --git a/deps/libav/libavformat/ffm.h b/deps/libav/libavformat/ffm.h
deleted file mode 100644
index 70c3e88..0000000
--- a/deps/libav/libavformat/ffm.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * FFM (avserver live feed) common header
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_FFM_H
-#define AVFORMAT_FFM_H
-
-#include <stdint.h>
-#include "avformat.h"
-#include "avio.h"
-
-/* The FFM file is made of blocks of fixed size */
-#define FFM_HEADER_SIZE 14
-#define FFM_PACKET_SIZE 4096
-#define PACKET_ID       0x666d
-
-/* each packet contains frames (which can span several packets */
-#define FRAME_HEADER_SIZE    16
-#define FLAG_KEY_FRAME       0x01
-#define FLAG_DTS             0x02
-
-enum {
-    READ_HEADER,
-    READ_DATA,
-};
-
-typedef struct FFMContext {
-    /* only reading mode */
-    int64_t write_index, file_size;
-    int read_state;
-    uint8_t header[FRAME_HEADER_SIZE+4];
-
-    /* read and write */
-    int first_packet; /* true if first packet, needed to set the discontinuity tag */
-    int packet_size;
-    int frame_offset;
-    int64_t dts;
-    uint8_t *packet_ptr, *packet_end;
-    uint8_t packet[FFM_PACKET_SIZE];
-} FFMContext;
-
-#endif /* AVFORMAT_FFM_H */
diff --git a/deps/libav/libavformat/ffmdec.c b/deps/libav/libavformat/ffmdec.c
deleted file mode 100644
index acc1dc4..0000000
--- a/deps/libav/libavformat/ffmdec.c
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- * FFM (avserver live feed) demuxer
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "avformat.h"
-#include "internal.h"
-#include "ffm.h"
-
-static int ffm_is_avail_data(AVFormatContext *s, int size)
-{
-    FFMContext *ffm = s->priv_data;
-    int64_t pos, avail_size;
-    int len;
-
-    len = ffm->packet_end - ffm->packet_ptr;
-    if (size <= len)
-        return 1;
-    pos = avio_tell(s->pb);
-    if (!ffm->write_index) {
-        if (pos == ffm->file_size)
-            return AVERROR_EOF;
-        avail_size = ffm->file_size - pos;
-    } else {
-    if (pos == ffm->write_index) {
-        /* exactly at the end of stream */
-        return AVERROR(EAGAIN);
-    } else if (pos < ffm->write_index) {
-        avail_size = ffm->write_index - pos;
-    } else {
-        avail_size = (ffm->file_size - pos) + (ffm->write_index - FFM_PACKET_SIZE);
-    }
-    }
-    avail_size = (avail_size / ffm->packet_size) * (ffm->packet_size - FFM_HEADER_SIZE) + len;
-    if (size <= avail_size)
-        return 1;
-    else
-        return AVERROR(EAGAIN);
-}
-
-static int ffm_resync(AVFormatContext *s, int state)
-{
-    av_log(s, AV_LOG_ERROR, "resyncing\n");
-    while (state != PACKET_ID) {
-        if (s->pb->eof_reached) {
-            av_log(s, AV_LOG_ERROR, "cannot find FFM syncword\n");
-            return -1;
-        }
-        state = (state << 8) | avio_r8(s->pb);
-    }
-    return 0;
-}
-
-/* first is true if we read the frame header */
-static int ffm_read_data(AVFormatContext *s,
-                         uint8_t *buf, int size, int header)
-{
-    FFMContext *ffm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int len, fill_size, size1, frame_offset, id;
-
-    size1 = size;
-    while (size > 0) {
-    redo:
-        len = ffm->packet_end - ffm->packet_ptr;
-        if (len < 0)
-            return -1;
-        if (len > size)
-            len = size;
-        if (len == 0) {
-            if (avio_tell(pb) == ffm->file_size)
-                avio_seek(pb, ffm->packet_size, SEEK_SET);
-    retry_read:
-            id = avio_rb16(pb); /* PACKET_ID */
-            if (id != PACKET_ID)
-                if (ffm_resync(s, id) < 0)
-                    return -1;
-            fill_size = avio_rb16(pb);
-            ffm->dts = avio_rb64(pb);
-            frame_offset = avio_rb16(pb);
-            avio_read(pb, ffm->packet, ffm->packet_size - FFM_HEADER_SIZE);
-            ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size);
-            if (ffm->packet_end < ffm->packet || frame_offset < 0)
-                return -1;
-            /* if first packet or resynchronization packet, we must
-               handle it specifically */
-            if (ffm->first_packet || (frame_offset & 0x8000)) {
-                if (!frame_offset) {
-                    /* This packet has no frame headers in it */
-                    if (avio_tell(pb) >= ffm->packet_size * 3) {
-                        avio_seek(pb, -ffm->packet_size * 2, SEEK_CUR);
-                        goto retry_read;
-                    }
-                    /* This is bad, we cannot find a valid frame header */
-                    return 0;
-                }
-                ffm->first_packet = 0;
-                if ((frame_offset & 0x7fff) < FFM_HEADER_SIZE)
-                    return -1;
-                ffm->packet_ptr = ffm->packet + (frame_offset & 0x7fff) - FFM_HEADER_SIZE;
-                if (!header)
-                    break;
-            } else {
-                ffm->packet_ptr = ffm->packet;
-            }
-            goto redo;
-        }
-        memcpy(buf, ffm->packet_ptr, len);
-        buf += len;
-        ffm->packet_ptr += len;
-        size -= len;
-        header = 0;
-    }
-    return size1 - size;
-}
-
-/* ensure that acutal seeking happens between FFM_PACKET_SIZE
-   and file_size - FFM_PACKET_SIZE */
-static int64_t ffm_seek1(AVFormatContext *s, int64_t pos1)
-{
-    FFMContext *ffm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pos;
-
-    pos = FFMIN(pos1, ffm->file_size - FFM_PACKET_SIZE);
-    pos = FFMAX(pos, FFM_PACKET_SIZE);
-    av_dlog(s, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
-    return avio_seek(pb, pos, SEEK_SET);
-}
-
-static int64_t get_dts(AVFormatContext *s, int64_t pos)
-{
-    AVIOContext *pb = s->pb;
-    int64_t dts;
-
-    ffm_seek1(s, pos);
-    avio_skip(pb, 4);
-    dts = avio_rb64(pb);
-    av_dlog(s, "dts=%0.6f\n", dts / 1000000.0);
-    return dts;
-}
-
-static void adjust_write_index(AVFormatContext *s)
-{
-    FFMContext *ffm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pts;
-    //int64_t orig_write_index = ffm->write_index;
-    int64_t pos_min, pos_max;
-    int64_t pts_start;
-    int64_t ptr = avio_tell(pb);
-
-
-    pos_min = 0;
-    pos_max = ffm->file_size - 2 * FFM_PACKET_SIZE;
-
-    pts_start = get_dts(s, pos_min);
-
-    pts = get_dts(s, pos_max);
-
-    if (pts - 100000 > pts_start)
-        goto end;
-
-    ffm->write_index = FFM_PACKET_SIZE;
-
-    pts_start = get_dts(s, pos_min);
-
-    pts = get_dts(s, pos_max);
-
-    if (pts - 100000 <= pts_start) {
-        while (1) {
-            int64_t newpos;
-            int64_t newpts;
-
-            newpos = ((pos_max + pos_min) / (2 * FFM_PACKET_SIZE)) * FFM_PACKET_SIZE;
-
-            if (newpos == pos_min)
-                break;
-
-            newpts = get_dts(s, newpos);
-
-            if (newpts - 100000 <= pts) {
-                pos_max = newpos;
-                pts = newpts;
-            } else {
-                pos_min = newpos;
-            }
-        }
-        ffm->write_index += pos_max;
-    }
-
- end:
-    avio_seek(pb, ptr, SEEK_SET);
-}
-
-
-static int ffm_close(AVFormatContext *s)
-{
-    int i;
-
-    for (i = 0; i < s->nb_streams; i++)
-        av_freep(&s->streams[i]->codec->rc_eq);
-
-    return 0;
-}
-
-
-static int ffm_read_header(AVFormatContext *s)
-{
-    FFMContext *ffm = s->priv_data;
-    AVStream *st;
-    AVIOContext *pb = s->pb;
-    AVCodecContext *codec;
-    int i, nb_streams;
-    uint32_t tag;
-
-    /* header */
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('F', 'F', 'M', '1'))
-        goto fail;
-    ffm->packet_size = avio_rb32(pb);
-    if (ffm->packet_size != FFM_PACKET_SIZE)
-        goto fail;
-    ffm->write_index = avio_rb64(pb);
-    /* get also filesize */
-    if (pb->seekable) {
-        ffm->file_size = avio_size(pb);
-        if (ffm->write_index)
-            adjust_write_index(s);
-    } else {
-        ffm->file_size = (UINT64_C(1) << 63) - 1;
-    }
-
-    nb_streams = avio_rb32(pb);
-    avio_rb32(pb); /* total bitrate */
-    /* read each stream */
-    for(i=0;i<nb_streams;i++) {
-        char rc_eq_buf[128];
-
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            goto fail;
-
-        avpriv_set_pts_info(st, 64, 1, 1000000);
-
-        codec = st->codec;
-        /* generic info */
-        codec->codec_id = avio_rb32(pb);
-        codec->codec_type = avio_r8(pb); /* codec_type */
-        codec->bit_rate = avio_rb32(pb);
-        codec->flags = avio_rb32(pb);
-        codec->flags2 = avio_rb32(pb);
-        codec->debug = avio_rb32(pb);
-        /* specific info */
-        switch(codec->codec_type) {
-        case AVMEDIA_TYPE_VIDEO:
-            codec->time_base.num = avio_rb32(pb);
-            codec->time_base.den = avio_rb32(pb);
-            codec->width = avio_rb16(pb);
-            codec->height = avio_rb16(pb);
-            codec->gop_size = avio_rb16(pb);
-            codec->pix_fmt = avio_rb32(pb);
-            codec->qmin = avio_r8(pb);
-            codec->qmax = avio_r8(pb);
-            codec->max_qdiff = avio_r8(pb);
-            codec->qcompress = avio_rb16(pb) / 10000.0;
-            codec->qblur = avio_rb16(pb) / 10000.0;
-            codec->bit_rate_tolerance = avio_rb32(pb);
-            avio_get_str(pb, INT_MAX, rc_eq_buf, sizeof(rc_eq_buf));
-            codec->rc_eq = av_strdup(rc_eq_buf);
-            codec->rc_max_rate = avio_rb32(pb);
-            codec->rc_min_rate = avio_rb32(pb);
-            codec->rc_buffer_size = avio_rb32(pb);
-            codec->i_quant_factor = av_int2double(avio_rb64(pb));
-            codec->b_quant_factor = av_int2double(avio_rb64(pb));
-            codec->i_quant_offset = av_int2double(avio_rb64(pb));
-            codec->b_quant_offset = av_int2double(avio_rb64(pb));
-            codec->dct_algo = avio_rb32(pb);
-            codec->strict_std_compliance = avio_rb32(pb);
-            codec->max_b_frames = avio_rb32(pb);
-            codec->mpeg_quant = avio_rb32(pb);
-            codec->intra_dc_precision = avio_rb32(pb);
-            codec->me_method = avio_rb32(pb);
-            codec->mb_decision = avio_rb32(pb);
-            codec->nsse_weight = avio_rb32(pb);
-            codec->frame_skip_cmp = avio_rb32(pb);
-            codec->rc_buffer_aggressivity = av_int2double(avio_rb64(pb));
-            codec->codec_tag = avio_rb32(pb);
-            codec->thread_count = avio_r8(pb);
-            codec->coder_type = avio_rb32(pb);
-            codec->me_cmp = avio_rb32(pb);
-            codec->me_subpel_quality = avio_rb32(pb);
-            codec->me_range = avio_rb32(pb);
-            codec->keyint_min = avio_rb32(pb);
-            codec->scenechange_threshold = avio_rb32(pb);
-            codec->b_frame_strategy = avio_rb32(pb);
-            codec->qcompress = av_int2double(avio_rb64(pb));
-            codec->qblur = av_int2double(avio_rb64(pb));
-            codec->max_qdiff = avio_rb32(pb);
-            codec->refs = avio_rb32(pb);
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            codec->sample_rate = avio_rb32(pb);
-            codec->channels = avio_rl16(pb);
-            codec->frame_size = avio_rl16(pb);
-            break;
-        default:
-            goto fail;
-        }
-        if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
-            codec->extradata_size = avio_rb32(pb);
-            codec->extradata = av_malloc(codec->extradata_size);
-            if (!codec->extradata)
-                return AVERROR(ENOMEM);
-            avio_read(pb, codec->extradata, codec->extradata_size);
-        }
-    }
-
-    /* get until end of block reached */
-    while ((avio_tell(pb) % ffm->packet_size) != 0)
-        avio_r8(pb);
-
-    /* init packet demux */
-    ffm->packet_ptr = ffm->packet;
-    ffm->packet_end = ffm->packet;
-    ffm->frame_offset = 0;
-    ffm->dts = 0;
-    ffm->read_state = READ_HEADER;
-    ffm->first_packet = 1;
-    return 0;
- fail:
-    ffm_close(s);
-    return -1;
-}
-
-/* return < 0 if eof */
-static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int size;
-    FFMContext *ffm = s->priv_data;
-    int duration, ret;
-
-    switch(ffm->read_state) {
-    case READ_HEADER:
-        if ((ret = ffm_is_avail_data(s, FRAME_HEADER_SIZE+4)) < 0)
-            return ret;
-
-        av_dlog(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
-               avio_tell(s->pb), s->pb->pos, ffm->write_index, ffm->file_size);
-        if (ffm_read_data(s, ffm->header, FRAME_HEADER_SIZE, 1) !=
-            FRAME_HEADER_SIZE)
-            return -1;
-        if (ffm->header[1] & FLAG_DTS)
-            if (ffm_read_data(s, ffm->header+16, 4, 1) != 4)
-                return -1;
-        ffm->read_state = READ_DATA;
-        /* fall thru */
-    case READ_DATA:
-        size = AV_RB24(ffm->header + 2);
-        if ((ret = ffm_is_avail_data(s, size)) < 0)
-            return ret;
-
-        duration = AV_RB24(ffm->header + 5);
-
-        av_new_packet(pkt, size);
-        pkt->stream_index = ffm->header[0];
-        if ((unsigned)pkt->stream_index >= s->nb_streams) {
-            av_log(s, AV_LOG_ERROR, "invalid stream index %d\n", pkt->stream_index);
-            av_free_packet(pkt);
-            ffm->read_state = READ_HEADER;
-            return -1;
-        }
-        pkt->pos = avio_tell(s->pb);
-        if (ffm->header[1] & FLAG_KEY_FRAME)
-            pkt->flags |= AV_PKT_FLAG_KEY;
-
-        ffm->read_state = READ_HEADER;
-        if (ffm_read_data(s, pkt->data, size, 0) != size) {
-            /* bad case: desynchronized packet. we cancel all the packet loading */
-            av_free_packet(pkt);
-            return -1;
-        }
-        pkt->pts = AV_RB64(ffm->header+8);
-        if (ffm->header[1] & FLAG_DTS)
-            pkt->dts = pkt->pts - AV_RB32(ffm->header+16);
-        else
-            pkt->dts = pkt->pts;
-        pkt->duration = duration;
-        break;
-    }
-    return 0;
-}
-
-/* seek to a given time in the file. The file read pointer is
-   positioned at or before pts. XXX: the following code is quite
-   approximative */
-static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, int flags)
-{
-    FFMContext *ffm = s->priv_data;
-    int64_t pos_min, pos_max, pos;
-    int64_t pts_min, pts_max, pts;
-    double pos1;
-
-    av_dlog(s, "wanted_pts=%0.6f\n", wanted_pts / 1000000.0);
-    /* find the position using linear interpolation (better than
-       dichotomy in typical cases) */
-    pos_min = FFM_PACKET_SIZE;
-    pos_max = ffm->file_size - FFM_PACKET_SIZE;
-    while (pos_min <= pos_max) {
-        pts_min = get_dts(s, pos_min);
-        pts_max = get_dts(s, pos_max);
-        /* linear interpolation */
-        pos1 = (double)(pos_max - pos_min) * (double)(wanted_pts - pts_min) /
-            (double)(pts_max - pts_min);
-        pos = (((int64_t)pos1) / FFM_PACKET_SIZE) * FFM_PACKET_SIZE;
-        if (pos <= pos_min)
-            pos = pos_min;
-        else if (pos >= pos_max)
-            pos = pos_max;
-        pts = get_dts(s, pos);
-        /* check if we are lucky */
-        if (pts == wanted_pts) {
-            goto found;
-        } else if (pts > wanted_pts) {
-            pos_max = pos - FFM_PACKET_SIZE;
-        } else {
-            pos_min = pos + FFM_PACKET_SIZE;
-        }
-    }
-    pos = (flags & AVSEEK_FLAG_BACKWARD) ? pos_min : pos_max;
-
- found:
-    if (ffm_seek1(s, pos) < 0)
-        return -1;
-
-    /* reset read state */
-    ffm->read_state = READ_HEADER;
-    ffm->packet_ptr = ffm->packet;
-    ffm->packet_end = ffm->packet;
-    ffm->first_packet = 1;
-
-    return 0;
-}
-
-static int ffm_probe(AVProbeData *p)
-{
-    if (
-        p->buf[0] == 'F' && p->buf[1] == 'F' && p->buf[2] == 'M' &&
-        p->buf[3] == '1')
-        return AVPROBE_SCORE_MAX + 1;
-    return 0;
-}
-
-AVInputFormat ff_ffm_demuxer = {
-    .name           = "ffm",
-    .long_name      = NULL_IF_CONFIG_SMALL("FFM (AVserver live feed)"),
-    .priv_data_size = sizeof(FFMContext),
-    .read_probe     = ffm_probe,
-    .read_header    = ffm_read_header,
-    .read_packet    = ffm_read_packet,
-    .read_close     = ffm_close,
-    .read_seek      = ffm_seek,
-};
diff --git a/deps/libav/libavformat/ffmenc.c b/deps/libav/libavformat/ffmenc.c
deleted file mode 100644
index 91658e1..0000000
--- a/deps/libav/libavformat/ffmenc.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * FFM (avserver live feed) muxer
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <assert.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "avformat.h"
-#include "internal.h"
-#include "ffm.h"
-
-static void flush_packet(AVFormatContext *s)
-{
-    FFMContext *ffm = s->priv_data;
-    int fill_size, h;
-    AVIOContext *pb = s->pb;
-
-    fill_size = ffm->packet_end - ffm->packet_ptr;
-    memset(ffm->packet_ptr, 0, fill_size);
-
-    assert(avio_tell(pb) % ffm->packet_size == 0);
-
-    /* put header */
-    avio_wb16(pb, PACKET_ID);
-    avio_wb16(pb, fill_size);
-    avio_wb64(pb, ffm->dts);
-    h = ffm->frame_offset;
-    if (ffm->first_packet)
-        h |= 0x8000;
-    avio_wb16(pb, h);
-    avio_write(pb, ffm->packet, ffm->packet_end - ffm->packet);
-    avio_flush(pb);
-
-    /* prepare next packet */
-    ffm->frame_offset = 0; /* no key frame */
-    ffm->packet_ptr = ffm->packet;
-    ffm->first_packet = 0;
-}
-
-/* 'first' is true if first data of a frame */
-static void ffm_write_data(AVFormatContext *s,
-                           const uint8_t *buf, int size,
-                           int64_t dts, int header)
-{
-    FFMContext *ffm = s->priv_data;
-    int len;
-
-    if (header && ffm->frame_offset == 0) {
-        ffm->frame_offset = ffm->packet_ptr - ffm->packet + FFM_HEADER_SIZE;
-        ffm->dts = dts;
-    }
-
-    /* write as many packets as needed */
-    while (size > 0) {
-        len = ffm->packet_end - ffm->packet_ptr;
-        if (len > size)
-            len = size;
-        memcpy(ffm->packet_ptr, buf, len);
-
-        ffm->packet_ptr += len;
-        buf += len;
-        size -= len;
-        if (ffm->packet_ptr >= ffm->packet_end)
-            flush_packet(s);
-    }
-}
-
-static int ffm_write_header(AVFormatContext *s)
-{
-    FFMContext *ffm = s->priv_data;
-    AVStream *st;
-    AVIOContext *pb = s->pb;
-    AVCodecContext *codec;
-    int bit_rate, i;
-
-    ffm->packet_size = FFM_PACKET_SIZE;
-
-    /* header */
-    avio_wl32(pb, MKTAG('F', 'F', 'M', '1'));
-    avio_wb32(pb, ffm->packet_size);
-    avio_wb64(pb, 0); /* current write position */
-
-    avio_wb32(pb, s->nb_streams);
-    bit_rate = 0;
-    for(i=0;i<s->nb_streams;i++) {
-        st = s->streams[i];
-        bit_rate += st->codec->bit_rate;
-    }
-    avio_wb32(pb, bit_rate);
-
-    /* list of streams */
-    for(i=0;i<s->nb_streams;i++) {
-        st = s->streams[i];
-        avpriv_set_pts_info(st, 64, 1, 1000000);
-
-        codec = st->codec;
-        /* generic info */
-        avio_wb32(pb, codec->codec_id);
-        avio_w8(pb, codec->codec_type);
-        avio_wb32(pb, codec->bit_rate);
-        avio_wb32(pb, codec->flags);
-        avio_wb32(pb, codec->flags2);
-        avio_wb32(pb, codec->debug);
-        /* specific info */
-        switch(codec->codec_type) {
-        case AVMEDIA_TYPE_VIDEO:
-            avio_wb32(pb, codec->time_base.num);
-            avio_wb32(pb, codec->time_base.den);
-            avio_wb16(pb, codec->width);
-            avio_wb16(pb, codec->height);
-            avio_wb16(pb, codec->gop_size);
-            avio_wb32(pb, codec->pix_fmt);
-            avio_w8(pb, codec->qmin);
-            avio_w8(pb, codec->qmax);
-            avio_w8(pb, codec->max_qdiff);
-            avio_wb16(pb, (int) (codec->qcompress * 10000.0));
-            avio_wb16(pb, (int) (codec->qblur * 10000.0));
-            avio_wb32(pb, codec->bit_rate_tolerance);
-            avio_put_str(pb, codec->rc_eq ? codec->rc_eq : "tex^qComp");
-            avio_wb32(pb, codec->rc_max_rate);
-            avio_wb32(pb, codec->rc_min_rate);
-            avio_wb32(pb, codec->rc_buffer_size);
-            avio_wb64(pb, av_double2int(codec->i_quant_factor));
-            avio_wb64(pb, av_double2int(codec->b_quant_factor));
-            avio_wb64(pb, av_double2int(codec->i_quant_offset));
-            avio_wb64(pb, av_double2int(codec->b_quant_offset));
-            avio_wb32(pb, codec->dct_algo);
-            avio_wb32(pb, codec->strict_std_compliance);
-            avio_wb32(pb, codec->max_b_frames);
-            avio_wb32(pb, codec->mpeg_quant);
-            avio_wb32(pb, codec->intra_dc_precision);
-            avio_wb32(pb, codec->me_method);
-            avio_wb32(pb, codec->mb_decision);
-            avio_wb32(pb, codec->nsse_weight);
-            avio_wb32(pb, codec->frame_skip_cmp);
-            avio_wb64(pb, av_double2int(codec->rc_buffer_aggressivity));
-            avio_wb32(pb, codec->codec_tag);
-            avio_w8(pb, codec->thread_count);
-            avio_wb32(pb, codec->coder_type);
-            avio_wb32(pb, codec->me_cmp);
-            avio_wb32(pb, codec->me_subpel_quality);
-            avio_wb32(pb, codec->me_range);
-            avio_wb32(pb, codec->keyint_min);
-            avio_wb32(pb, codec->scenechange_threshold);
-            avio_wb32(pb, codec->b_frame_strategy);
-            avio_wb64(pb, av_double2int(codec->qcompress));
-            avio_wb64(pb, av_double2int(codec->qblur));
-            avio_wb32(pb, codec->max_qdiff);
-            avio_wb32(pb, codec->refs);
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            avio_wb32(pb, codec->sample_rate);
-            avio_wl16(pb, codec->channels);
-            avio_wl16(pb, codec->frame_size);
-            break;
-        default:
-            return -1;
-        }
-        if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
-            avio_wb32(pb, codec->extradata_size);
-            avio_write(pb, codec->extradata, codec->extradata_size);
-        }
-    }
-
-    /* flush until end of block reached */
-    while ((avio_tell(pb) % ffm->packet_size) != 0)
-        avio_w8(pb, 0);
-
-    avio_flush(pb);
-
-    /* init packet mux */
-    ffm->packet_ptr = ffm->packet;
-    ffm->packet_end = ffm->packet + ffm->packet_size - FFM_HEADER_SIZE;
-    assert(ffm->packet_end >= ffm->packet);
-    ffm->frame_offset = 0;
-    ffm->dts = 0;
-    ffm->first_packet = 1;
-
-    return 0;
-}
-
-static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int64_t dts;
-    uint8_t header[FRAME_HEADER_SIZE+4];
-    int header_size = FRAME_HEADER_SIZE;
-
-    dts = pkt->dts;
-    /* packet size & key_frame */
-    header[0] = pkt->stream_index;
-    header[1] = 0;
-    if (pkt->flags & AV_PKT_FLAG_KEY)
-        header[1] |= FLAG_KEY_FRAME;
-    AV_WB24(header+2, pkt->size);
-    AV_WB24(header+5, pkt->duration);
-    AV_WB64(header+8, pkt->pts);
-    if (pkt->pts != pkt->dts) {
-        header[1] |= FLAG_DTS;
-        AV_WB32(header+16, pkt->pts - pkt->dts);
-        header_size += 4;
-    }
-    ffm_write_data(s, header, header_size, dts, 1);
-    ffm_write_data(s, pkt->data, pkt->size, dts, 0);
-
-    return 0;
-}
-
-static int ffm_write_trailer(AVFormatContext *s)
-{
-    FFMContext *ffm = s->priv_data;
-
-    /* flush packets */
-    if (ffm->packet_ptr > ffm->packet)
-        flush_packet(s);
-
-    return 0;
-}
-
-AVOutputFormat ff_ffm_muxer = {
-    .name              = "ffm",
-    .long_name         = NULL_IF_CONFIG_SMALL("FFM (AVserver live feed)"),
-    .mime_type         = "",
-    .extensions        = "ffm",
-    .priv_data_size    = sizeof(FFMContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
-    .write_header      = ffm_write_header,
-    .write_packet      = ffm_write_packet,
-    .write_trailer     = ffm_write_trailer,
-    .flags             = AVFMT_TS_NEGATIVE,
-};
diff --git a/deps/libav/libavformat/ffmeta.h b/deps/libav/libavformat/ffmeta.h
deleted file mode 100644
index a5380ca..0000000
--- a/deps/libav/libavformat/ffmeta.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Common data for metadata muxer/demuxer
- * Copyright (c) 2010 Anton Khirnov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_FFMETA_H
-#define AVFORMAT_FFMETA_H
-
-#define ID_STRING  ";FFMETADATA"
-#define ID_CHAPTER "[CHAPTER]"
-#define ID_STREAM  "[STREAM]"
-
-#endif /* AVFORMAT_FFMETA_H */
diff --git a/deps/libav/libavformat/ffmetadec.c b/deps/libav/libavformat/ffmetadec.c
deleted file mode 100644
index 7dbf7ed..0000000
--- a/deps/libav/libavformat/ffmetadec.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Metadata demuxer
- * Copyright (c) 2010 Anton Khirnov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "ffmeta.h"
-#include "internal.h"
-#include "libavutil/dict.h"
-
-static int probe(AVProbeData *p)
-{
-    if(!memcmp(p->buf, ID_STRING, strlen(ID_STRING)))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static void get_line(AVIOContext *s, uint8_t *buf, int size)
-{
-    do {
-        uint8_t c;
-        int i = 0;
-
-        while ((c = avio_r8(s))) {
-            if (c == '\\') {
-                if (i < size - 1)
-                    buf[i++] = c;
-                c = avio_r8(s);
-            } else if (c == '\n')
-                break;
-
-            if (i < size - 1)
-                buf[i++] = c;
-        }
-        buf[i] = 0;
-    } while (!s->eof_reached && (buf[0] == ';' || buf[0] == '#' || buf[0] == 0));
-}
-
-static AVChapter *read_chapter(AVFormatContext *s)
-{
-    uint8_t line[256];
-    int64_t start, end;
-    AVRational tb = {1, 1e9};
-
-    get_line(s->pb, line, sizeof(line));
-
-    if (sscanf(line, "TIMEBASE=%d/%d", &tb.num, &tb.den))
-        get_line(s->pb, line, sizeof(line));
-    if (!sscanf(line, "START=%"SCNd64, &start)) {
-        av_log(s, AV_LOG_ERROR, "Expected chapter start timestamp, found %s.\n", line);
-        start = (s->nb_chapters && s->chapters[s->nb_chapters - 1]->end != AV_NOPTS_VALUE) ?
-                 s->chapters[s->nb_chapters - 1]->end : 0;
-    } else
-        get_line(s->pb, line, sizeof(line));
-
-    if (!sscanf(line, "END=%"SCNd64, &end)) {
-        av_log(s, AV_LOG_ERROR, "Expected chapter end timestamp, found %s.\n", line);
-        end = AV_NOPTS_VALUE;
-    }
-
-    return avpriv_new_chapter(s, s->nb_chapters, tb, start, end, NULL);
-}
-
-static uint8_t *unescape(uint8_t *buf, int size)
-{
-    uint8_t *ret = av_malloc(size + 1);
-    uint8_t *p1  = ret, *p2 = buf;
-
-    if (!ret)
-        return NULL;
-
-    while (p2 < buf + size) {
-        if (*p2 == '\\')
-            p2++;
-        *p1++ = *p2++;
-    }
-    *p1 = 0;
-    return ret;
-}
-
-static int read_tag(uint8_t *line, AVDictionary **m)
-{
-    uint8_t *key, *value, *p = line;
-
-    /* find first not escaped '=' */
-    while (1) {
-        if (*p == '=')
-            break;
-        else if (*p == '\\')
-            p++;
-
-        if (*p++)
-            continue;
-
-        return 0;
-    }
-
-    if (!(key = unescape(line, p - line)))
-        return AVERROR(ENOMEM);
-    if (!(value = unescape(p + 1, strlen(p + 1)))) {
-        av_free(key);
-        return AVERROR(ENOMEM);
-    }
-
-    av_dict_set(m, key, value, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
-    return 0;
-}
-
-static int read_header(AVFormatContext *s)
-{
-    AVDictionary **m = &s->metadata;
-    uint8_t line[1024];
-
-    while(!s->pb->eof_reached) {
-        get_line(s->pb, line, sizeof(line));
-
-        if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) {
-            AVStream *st = avformat_new_stream(s, NULL);
-
-            if (!st)
-                return -1;
-
-            st->codec->codec_type = AVMEDIA_TYPE_DATA;
-            st->codec->codec_id   = AV_CODEC_ID_FFMETADATA;
-
-            m = &st->metadata;
-        } else if (!memcmp(line, ID_CHAPTER, strlen(ID_CHAPTER))) {
-            AVChapter *ch = read_chapter(s);
-
-            if (!ch)
-                return -1;
-
-            m = &ch->metadata;
-        } else
-            read_tag(line, m);
-    }
-
-    s->start_time = 0;
-    if (s->nb_chapters)
-        s->duration = av_rescale_q(s->chapters[s->nb_chapters - 1]->end,
-                                   s->chapters[s->nb_chapters - 1]->time_base,
-                                   AV_TIME_BASE_Q);
-
-    return 0;
-}
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    return AVERROR_EOF;
-}
-
-AVInputFormat ff_ffmetadata_demuxer = {
-    .name        = "ffmetadata",
-    .long_name   = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text"),
-    .read_probe  = probe,
-    .read_header = read_header,
-    .read_packet = read_packet,
-};
diff --git a/deps/libav/libavformat/ffmetaenc.c b/deps/libav/libavformat/ffmetaenc.c
deleted file mode 100644
index 19fe6c9..0000000
--- a/deps/libav/libavformat/ffmetaenc.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Metadata muxer
- * Copyright (c) 2010 Anton Khirnov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-
-#include "avformat.h"
-#include "ffmeta.h"
-#include "libavutil/dict.h"
-
-
-static void write_escape_str(AVIOContext *s, const uint8_t *str)
-{
-    const uint8_t *p = str;
-
-    while (*p) {
-        if (*p == '#' || *p == ';' || *p == '=' || *p == '\\' || *p == '\n')
-            avio_w8(s, '\\');
-        avio_w8(s, *p);
-        p++;
-    }
-}
-
-static void write_tags(AVIOContext *s, AVDictionary *m)
-{
-    AVDictionaryEntry *t = NULL;
-    while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) {
-        write_escape_str(s, t->key);
-        avio_w8(s, '=');
-        write_escape_str(s, t->value);
-        avio_w8(s, '\n');
-    }
-}
-
-static int write_header(AVFormatContext *s)
-{
-    avio_write(s->pb, ID_STRING, sizeof(ID_STRING) - 1);
-    avio_w8(s->pb, '1');          // version
-    avio_w8(s->pb, '\n');
-    avio_flush(s->pb);
-    return 0;
-}
-
-static int write_trailer(AVFormatContext *s)
-{
-    int i;
-
-    write_tags(s->pb, s->metadata);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        avio_write(s->pb, ID_STREAM, sizeof(ID_STREAM) - 1);
-        avio_w8(s->pb, '\n');
-        write_tags(s->pb, s->streams[i]->metadata);
-    }
-
-    for (i = 0; i < s->nb_chapters; i++) {
-        AVChapter *ch = s->chapters[i];
-        avio_write(s->pb, ID_CHAPTER, sizeof(ID_CHAPTER) - 1);
-        avio_w8(s->pb, '\n');
-        avio_printf(s->pb, "TIMEBASE=%d/%d\n", ch->time_base.num, ch->time_base.den);
-        avio_printf(s->pb, "START=%"PRId64"\n", ch->start);
-        avio_printf(s->pb, "END=%"PRId64"\n",   ch->end);
-        write_tags(s->pb, ch->metadata);
-    }
-
-    return 0;
-}
-
-static int write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    return 0;
-}
-
-AVOutputFormat ff_ffmetadata_muxer = {
-    .name          = "ffmetadata",
-    .long_name     = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text"),
-    .extensions    = "ffmeta",
-    .write_header  = write_header,
-    .write_packet  = write_packet,
-    .write_trailer = write_trailer,
-    .flags         = AVFMT_NOTIMESTAMPS | AVFMT_NOSTREAMS,
-};
diff --git a/deps/libav/libavformat/file.c b/deps/libav/libavformat/file.c
deleted file mode 100644
index 2837e9f..0000000
--- a/deps/libav/libavformat/file.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * buffered file I/O
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/internal.h"
-#include "libavutil/opt.h"
-#include "avformat.h"
-#include <fcntl.h>
-#if HAVE_IO_H
-#include <io.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
-#include <stdlib.h>
-#include "os_support.h"
-#include "url.h"
-
-
-/* standard file protocol */
-
-typedef struct FileContext {
-    const AVClass *class;
-    int fd;
-    int trunc;
-} FileContext;
-
-static const AVOption file_options[] = {
-    { "truncate", "Truncate existing files on write", offsetof(FileContext, trunc), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
-    { NULL }
-};
-
-static const AVClass file_class = {
-    .class_name = "file",
-    .item_name  = av_default_item_name,
-    .option     = file_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static int file_read(URLContext *h, unsigned char *buf, int size)
-{
-    FileContext *c = h->priv_data;
-    return read(c->fd, buf, size);
-}
-
-static int file_write(URLContext *h, const unsigned char *buf, int size)
-{
-    FileContext *c = h->priv_data;
-    return write(c->fd, buf, size);
-}
-
-static int file_get_handle(URLContext *h)
-{
-    FileContext *c = h->priv_data;
-    return c->fd;
-}
-
-static int file_check(URLContext *h, int mask)
-{
-    struct stat st;
-    int ret = stat(h->filename, &st);
-    if (ret < 0)
-        return AVERROR(errno);
-
-    ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ  : 0;
-    ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0;
-
-    return ret;
-}
-
-#if CONFIG_FILE_PROTOCOL
-
-static int file_open(URLContext *h, const char *filename, int flags)
-{
-    FileContext *c = h->priv_data;
-    int access;
-    int fd;
-
-    av_strstart(filename, "file:", &filename);
-
-    if (flags & AVIO_FLAG_WRITE && flags & AVIO_FLAG_READ) {
-        access = O_CREAT | O_RDWR;
-        if (c->trunc)
-            access |= O_TRUNC;
-    } else if (flags & AVIO_FLAG_WRITE) {
-        access = O_CREAT | O_WRONLY;
-        if (c->trunc)
-            access |= O_TRUNC;
-    } else {
-        access = O_RDONLY;
-    }
-#ifdef O_BINARY
-    access |= O_BINARY;
-#endif
-    fd = avpriv_open(filename, access, 0666);
-    if (fd == -1)
-        return AVERROR(errno);
-    c->fd = fd;
-    return 0;
-}
-
-/* XXX: use llseek */
-static int64_t file_seek(URLContext *h, int64_t pos, int whence)
-{
-    FileContext *c = h->priv_data;
-    int64_t ret;
-
-    if (whence == AVSEEK_SIZE) {
-        struct stat st;
-
-        ret = fstat(c->fd, &st);
-        return ret < 0 ? AVERROR(errno) : st.st_size;
-    }
-
-    ret = lseek(c->fd, pos, whence);
-
-    return ret < 0 ? AVERROR(errno) : ret;
-}
-
-static int file_close(URLContext *h)
-{
-    FileContext *c = h->priv_data;
-    return close(c->fd);
-}
-
-URLProtocol ff_file_protocol = {
-    .name                = "file",
-    .url_open            = file_open,
-    .url_read            = file_read,
-    .url_write           = file_write,
-    .url_seek            = file_seek,
-    .url_close           = file_close,
-    .url_get_file_handle = file_get_handle,
-    .url_check           = file_check,
-    .priv_data_size      = sizeof(FileContext),
-    .priv_data_class     = &file_class,
-};
-
-#endif /* CONFIG_FILE_PROTOCOL */
-
-#if CONFIG_PIPE_PROTOCOL
-
-static int pipe_open(URLContext *h, const char *filename, int flags)
-{
-    FileContext *c = h->priv_data;
-    int fd;
-    char *final;
-    av_strstart(filename, "pipe:", &filename);
-
-    fd = strtol(filename, &final, 10);
-    if((filename == final) || *final ) {/* No digits found, or something like 10ab */
-        if (flags & AVIO_FLAG_WRITE) {
-            fd = 1;
-        } else {
-            fd = 0;
-        }
-    }
-#if HAVE_SETMODE
-    setmode(fd, O_BINARY);
-#endif
-    c->fd = fd;
-    h->is_streamed = 1;
-    return 0;
-}
-
-URLProtocol ff_pipe_protocol = {
-    .name                = "pipe",
-    .url_open            = pipe_open,
-    .url_read            = file_read,
-    .url_write           = file_write,
-    .url_get_file_handle = file_get_handle,
-    .url_check           = file_check,
-    .priv_data_size      = sizeof(FileContext),
-};
-
-#endif /* CONFIG_PIPE_PROTOCOL */
diff --git a/deps/libav/libavformat/file_open.c b/deps/libav/libavformat/file_open.c
deleted file mode 100644
index 494a5d3..0000000
--- a/deps/libav/libavformat/file_open.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "libavutil/file_open.c"
diff --git a/deps/libav/libavformat/filmstripdec.c b/deps/libav/libavformat/filmstripdec.c
deleted file mode 100644
index 3fa6842..0000000
--- a/deps/libav/libavformat/filmstripdec.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Adobe Filmstrip demuxer
- * Copyright (c) 2010 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Adobe Filmstrip demuxer
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define RAND_TAG MKBETAG('R','a','n','d')
-
-typedef struct {
-    int leading;
-} FilmstripDemuxContext;
-
-static int read_header(AVFormatContext *s)
-{
-    FilmstripDemuxContext *film = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-
-    if (!s->pb->seekable)
-        return AVERROR(EIO);
-
-    avio_seek(pb, avio_size(pb) - 36, SEEK_SET);
-    if (avio_rb32(pb) != RAND_TAG) {
-        av_log(s, AV_LOG_ERROR, "magic number not found");
-        return AVERROR_INVALIDDATA;
-    }
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->nb_frames = avio_rb32(pb);
-    if (avio_rb16(pb) != 0) {
-        avpriv_request_sample(s, "Unsupported packing method");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    avio_skip(pb, 2);
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_RAWVIDEO;
-    st->codec->pix_fmt    = AV_PIX_FMT_RGBA;
-    st->codec->codec_tag  = 0; /* no fourcc */
-    st->codec->width      = avio_rb16(pb);
-    st->codec->height     = avio_rb16(pb);
-    film->leading         = avio_rb16(pb);
-    avpriv_set_pts_info(st, 64, 1, avio_rb16(pb));
-
-    avio_seek(pb, 0, SEEK_SET);
-
-    return 0;
-}
-
-static int read_packet(AVFormatContext *s,
-                       AVPacket *pkt)
-{
-    FilmstripDemuxContext *film = s->priv_data;
-    AVStream *st = s->streams[0];
-
-    if (s->pb->eof_reached)
-        return AVERROR(EIO);
-    pkt->dts = avio_tell(s->pb) / (st->codec->width * (st->codec->height + film->leading) * 4);
-    pkt->size = av_get_packet(s->pb, pkt, st->codec->width * st->codec->height * 4);
-    avio_skip(s->pb, st->codec->width * film->leading * 4);
-    if (pkt->size < 0)
-        return pkt->size;
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    return 0;
-}
-
-static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
-{
-    AVStream *st = s->streams[stream_index];
-    if (avio_seek(s->pb, FFMAX(timestamp, 0) * st->codec->width * st->codec->height * 4, SEEK_SET) < 0)
-        return -1;
-    return 0;
-}
-
-AVInputFormat ff_filmstrip_demuxer = {
-    .name           = "filmstrip",
-    .long_name      = NULL_IF_CONFIG_SMALL("Adobe Filmstrip"),
-    .priv_data_size = sizeof(FilmstripDemuxContext),
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .read_seek      = read_seek,
-    .extensions     = "flm",
-};
diff --git a/deps/libav/libavformat/filmstripenc.c b/deps/libav/libavformat/filmstripenc.c
deleted file mode 100644
index 90d9a76..0000000
--- a/deps/libav/libavformat/filmstripenc.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Adobe Filmstrip muxer
- * Copyright (c) 2010 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Adobe Filmstrip muxer
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-
-#define RAND_TAG MKBETAG('R','a','n','d')
-
-typedef struct {
-    int nb_frames;
-} FilmstripMuxContext;
-
-static int write_header(AVFormatContext *s)
-{
-    if (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_RGBA) {
-        av_log(s, AV_LOG_ERROR, "only AV_PIX_FMT_RGBA is supported\n");
-        return AVERROR_INVALIDDATA;
-    }
-    return 0;
-}
-
-static int write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    FilmstripMuxContext *film = s->priv_data;
-    avio_write(s->pb, pkt->data, pkt->size);
-    film->nb_frames++;
-    return 0;
-}
-
-static int write_trailer(AVFormatContext *s)
-{
-    FilmstripMuxContext *film = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st = s->streams[0];
-    int i;
-
-    avio_wb32(pb, RAND_TAG);
-    avio_wb32(pb, film->nb_frames);
-    avio_wb16(pb, 0);  // packing method
-    avio_wb16(pb, 0);  // reserved
-    avio_wb16(pb, st->codec->width);
-    avio_wb16(pb, st->codec->height);
-    avio_wb16(pb, 0);  // leading
-    avio_wb16(pb, 1/av_q2d(st->codec->time_base));
-    for (i = 0; i < 16; i++)
-        avio_w8(pb, 0x00);  // reserved
-
-    return 0;
-}
-
-AVOutputFormat ff_filmstrip_muxer = {
-    .name              = "filmstrip",
-    .long_name         = NULL_IF_CONFIG_SMALL("Adobe Filmstrip"),
-    .extensions        = "flm",
-    .priv_data_size    = sizeof(FilmstripMuxContext),
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
-    .write_header      = write_header,
-    .write_packet      = write_packet,
-    .write_trailer     = write_trailer,
-};
diff --git a/deps/libav/libavformat/flac_picture.c b/deps/libav/libavformat/flac_picture.c
deleted file mode 100644
index 69d2724..0000000
--- a/deps/libav/libavformat/flac_picture.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Raw FLAC picture parser
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "flac_picture.h"
-#include "id3v2.h"
-#include "internal.h"
-
-int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
-{
-    const CodecMime *mime = ff_id3v2_mime_tags;
-    enum AVCodecID id = AV_CODEC_ID_NONE;
-    AVBufferRef *data = NULL;
-    uint8_t mimetype[64], *desc = NULL;
-    AVIOContext *pb = NULL;
-    AVStream *st;
-    int type, width, height;
-    int len, ret = 0;
-
-    pb = avio_alloc_context(buf, buf_size, 0, NULL, NULL, NULL, NULL);
-    if (!pb)
-        return AVERROR(ENOMEM);
-
-    /* read the picture type */
-    type = avio_rb32(pb);
-    if (type >= FF_ARRAY_ELEMS(ff_id3v2_picture_types) || type < 0) {
-        av_log(s, AV_LOG_ERROR, "Invalid picture type: %d.\n", type);
-        if (s->error_recognition & AV_EF_EXPLODE) {
-            ret = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-        type = 0;
-    }
-
-    /* picture mimetype */
-    len = avio_rb32(pb);
-    if (len <= 0 ||
-        avio_read(pb, mimetype, FFMIN(len, sizeof(mimetype) - 1)) != len) {
-        av_log(s, AV_LOG_ERROR, "Could not read mimetype from an attached "
-               "picture.\n");
-        if (s->error_recognition & AV_EF_EXPLODE)
-            ret = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-    mimetype[len] = 0;
-
-    while (mime->id != AV_CODEC_ID_NONE) {
-        if (!strncmp(mime->str, mimetype, sizeof(mimetype))) {
-            id = mime->id;
-            break;
-        }
-        mime++;
-    }
-    if (id == AV_CODEC_ID_NONE) {
-        av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n",
-               mimetype);
-        if (s->error_recognition & AV_EF_EXPLODE)
-            ret = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-
-    /* picture description */
-    len = avio_rb32(pb);
-    if (len > 0) {
-        if (!(desc = av_malloc(len + 1))) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        if (avio_read(pb, desc, len) != len) {
-            av_log(s, AV_LOG_ERROR, "Error reading attached picture description.\n");
-            if (s->error_recognition & AV_EF_EXPLODE)
-                ret = AVERROR(EIO);
-            goto fail;
-        }
-        desc[len] = 0;
-    }
-
-    /* picture metadata */
-    width  = avio_rb32(pb);
-    height = avio_rb32(pb);
-    avio_skip(pb, 8);
-
-    /* picture data */
-    len = avio_rb32(pb);
-    if (len <= 0) {
-        av_log(s, AV_LOG_ERROR, "Invalid attached picture size: %d.\n", len);
-        if (s->error_recognition & AV_EF_EXPLODE)
-            ret = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-    if (!(data = av_buffer_alloc(len))) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-    if (avio_read(pb, data->data, len) != len) {
-        av_log(s, AV_LOG_ERROR, "Error reading attached picture data.\n");
-        if (s->error_recognition & AV_EF_EXPLODE)
-            ret = AVERROR(EIO);
-        goto fail;
-    }
-
-    st = avformat_new_stream(s, NULL);
-    if (!st) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    av_init_packet(&st->attached_pic);
-    st->attached_pic.buf          = data;
-    st->attached_pic.data         = data->data;
-    st->attached_pic.size         = len;
-    st->attached_pic.stream_index = st->index;
-    st->attached_pic.flags       |= AV_PKT_FLAG_KEY;
-
-    st->disposition      |= AV_DISPOSITION_ATTACHED_PIC;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = id;
-    st->codec->width      = width;
-    st->codec->height     = height;
-    av_dict_set(&st->metadata, "comment", ff_id3v2_picture_types[type], 0);
-    if (desc)
-        av_dict_set(&st->metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL);
-
-    av_freep(&pb);
-
-    return 0;
-
-fail:
-    av_buffer_unref(&data);
-    av_freep(&desc);
-    av_freep(&pb);
-
-    return ret;
-}
diff --git a/deps/libav/libavformat/flac_picture.h b/deps/libav/libavformat/flac_picture.h
deleted file mode 100644
index c700582..0000000
--- a/deps/libav/libavformat/flac_picture.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Raw FLAC picture parser
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_FLAC_PICTURE_H
-#define AVFORMAT_FLAC_PICTURE_H
-
-#include "avformat.h"
-
-int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size);
-
-#endif /* AVFORMAT_FLAC_PICTURE_H */
diff --git a/deps/libav/libavformat/flacdec.c b/deps/libav/libavformat/flacdec.c
deleted file mode 100644
index ecbb7ec..0000000
--- a/deps/libav/libavformat/flacdec.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Raw FLAC demuxer
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/flac.h"
-#include "avformat.h"
-#include "flac_picture.h"
-#include "internal.h"
-#include "rawdec.h"
-#include "oggdec.h"
-#include "vorbiscomment.h"
-#include "libavcodec/bytestream.h"
-
-static int flac_read_header(AVFormatContext *s)
-{
-    int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0;
-    uint8_t header[4];
-    uint8_t *buffer=NULL;
-    AVStream *st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_FLAC;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-    /* the parameters will be extracted from the compressed bitstream */
-
-    /* if fLaC marker is not found, assume there is no header */
-    if (avio_rl32(s->pb) != MKTAG('f','L','a','C')) {
-        avio_seek(s->pb, -4, SEEK_CUR);
-        return 0;
-    }
-
-    /* process metadata blocks */
-    while (!s->pb->eof_reached && !metadata_last) {
-        avio_read(s->pb, header, 4);
-        avpriv_flac_parse_block_header(header, &metadata_last, &metadata_type,
-                                   &metadata_size);
-        switch (metadata_type) {
-        /* allocate and read metadata block for supported types */
-        case FLAC_METADATA_TYPE_STREAMINFO:
-        case FLAC_METADATA_TYPE_CUESHEET:
-        case FLAC_METADATA_TYPE_PICTURE:
-        case FLAC_METADATA_TYPE_VORBIS_COMMENT:
-            buffer = av_mallocz(metadata_size + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!buffer) {
-                return AVERROR(ENOMEM);
-            }
-            if (avio_read(s->pb, buffer, metadata_size) != metadata_size) {
-                av_freep(&buffer);
-                return AVERROR(EIO);
-            }
-            break;
-        /* skip metadata block for unsupported types */
-        default:
-            ret = avio_skip(s->pb, metadata_size);
-            if (ret < 0)
-                return ret;
-        }
-
-        if (metadata_type == FLAC_METADATA_TYPE_STREAMINFO) {
-            FLACStreaminfo si;
-            /* STREAMINFO can only occur once */
-            if (found_streaminfo) {
-                av_freep(&buffer);
-                return AVERROR_INVALIDDATA;
-            }
-            if (metadata_size != FLAC_STREAMINFO_SIZE) {
-                av_freep(&buffer);
-                return AVERROR_INVALIDDATA;
-            }
-            found_streaminfo = 1;
-            st->codec->extradata      = buffer;
-            st->codec->extradata_size = metadata_size;
-            buffer = NULL;
-
-            /* get codec params from STREAMINFO header */
-            avpriv_flac_parse_streaminfo(st->codec, &si, st->codec->extradata);
-
-            /* set time base and duration */
-            if (si.samplerate > 0) {
-                avpriv_set_pts_info(st, 64, 1, si.samplerate);
-                if (si.samples > 0)
-                    st->duration = si.samples;
-            }
-        } else if (metadata_type == FLAC_METADATA_TYPE_CUESHEET) {
-            uint8_t isrc[13];
-            uint64_t start;
-            const uint8_t *offset;
-            int i, chapters, track, ti;
-            if (metadata_size < 431)
-                return AVERROR_INVALIDDATA;
-            offset = buffer + 395;
-            chapters = bytestream_get_byte(&offset) - 1;
-            if (chapters <= 0)
-                return AVERROR_INVALIDDATA;
-            for (i = 0; i < chapters; i++) {
-                if (offset + 36 - buffer > metadata_size)
-                    return AVERROR_INVALIDDATA;
-                start = bytestream_get_be64(&offset);
-                track = bytestream_get_byte(&offset);
-                bytestream_get_buffer(&offset, isrc, 12);
-                isrc[12] = 0;
-                offset += 14;
-                ti = bytestream_get_byte(&offset);
-                if (ti <= 0) return AVERROR_INVALIDDATA;
-                offset += ti * 12;
-                avpriv_new_chapter(s, track, st->time_base, start, AV_NOPTS_VALUE, isrc);
-            }
-        } else if (metadata_type == FLAC_METADATA_TYPE_PICTURE) {
-            ret = ff_flac_parse_picture(s, buffer, metadata_size);
-            av_freep(&buffer);
-            if (ret < 0) {
-                av_log(s, AV_LOG_ERROR, "Error parsing attached picture.\n");
-                return ret;
-            }
-        } else {
-            /* STREAMINFO must be the first block */
-            if (!found_streaminfo) {
-                av_freep(&buffer);
-                return AVERROR_INVALIDDATA;
-            }
-            /* process supported blocks other than STREAMINFO */
-            if (metadata_type == FLAC_METADATA_TYPE_VORBIS_COMMENT) {
-                if (ff_vorbis_comment(s, &s->metadata, buffer, metadata_size)) {
-                    av_log(s, AV_LOG_WARNING, "error parsing VorbisComment metadata\n");
-                }
-            }
-            av_freep(&buffer);
-        }
-    }
-
-    return 0;
-}
-
-static int flac_probe(AVProbeData *p)
-{
-    if (p->buf_size < 4 || memcmp(p->buf, "fLaC", 4))
-        return 0;
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-AVInputFormat ff_flac_demuxer = {
-    .name           = "flac",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw FLAC"),
-    .read_probe     = flac_probe,
-    .read_header    = flac_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "flac",
-    .raw_codec_id   = AV_CODEC_ID_FLAC,
-};
diff --git a/deps/libav/libavformat/flacenc.c b/deps/libav/libavformat/flacenc.c
deleted file mode 100644
index 83ddf44..0000000
--- a/deps/libav/libavformat/flacenc.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * raw FLAC muxer
- * Copyright (c) 2006-2009 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/opt.h"
-#include "libavcodec/flac.h"
-#include "avformat.h"
-#include "flacenc.h"
-#include "vorbiscomment.h"
-#include "libavcodec/bytestream.h"
-
-
-typedef struct FlacMuxerContext {
-    const AVClass *class;
-    int write_header;
-} FlacMuxerContext;
-
-static int flac_write_block_padding(AVIOContext *pb, unsigned int n_padding_bytes,
-                                    int last_block)
-{
-    avio_w8(pb, last_block ? 0x81 : 0x01);
-    avio_wb24(pb, n_padding_bytes);
-    while (n_padding_bytes > 0) {
-        avio_w8(pb, 0);
-        n_padding_bytes--;
-    }
-    return 0;
-}
-
-static int flac_write_block_comment(AVIOContext *pb, AVDictionary **m,
-                                    int last_block, int bitexact)
-{
-    const char *vendor = bitexact ? "Libav" : LIBAVFORMAT_IDENT;
-    unsigned int len, count;
-    uint8_t *p, *p0;
-
-    ff_metadata_conv(m, ff_vorbiscomment_metadata_conv, NULL);
-
-    len = ff_vorbiscomment_length(*m, vendor, &count);
-    p0 = av_malloc(len+4);
-    if (!p0)
-        return AVERROR(ENOMEM);
-    p = p0;
-
-    bytestream_put_byte(&p, last_block ? 0x84 : 0x04);
-    bytestream_put_be24(&p, len);
-    ff_vorbiscomment_write(&p, m, vendor, count);
-
-    avio_write(pb, p0, len+4);
-    av_freep(&p0);
-    p = NULL;
-
-    return 0;
-}
-
-static int flac_write_header(struct AVFormatContext *s)
-{
-    int ret;
-    AVCodecContext *codec = s->streams[0]->codec;
-    FlacMuxerContext *c   = s->priv_data;
-
-    if (!c->write_header)
-        return 0;
-
-    ret = ff_flac_write_header(s->pb, codec, 0);
-    if (ret)
-        return ret;
-
-    ret = flac_write_block_comment(s->pb, &s->metadata, 0,
-                                   codec->flags & CODEC_FLAG_BITEXACT);
-    if (ret)
-        return ret;
-
-    /* The command line flac encoder defaults to placing a seekpoint
-     * every 10s.  So one might add padding to allow that later
-     * but there seems to be no simple way to get the duration here.
-     * So let's try the flac default of 8192 bytes */
-    flac_write_block_padding(s->pb, 8192, 1);
-
-    return ret;
-}
-
-static int flac_write_trailer(struct AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    uint8_t *streaminfo;
-    enum FLACExtradataFormat format;
-    int64_t file_size;
-    FlacMuxerContext *c = s->priv_data;
-
-    if (!c->write_header)
-        return 0;
-
-    if (!avpriv_flac_is_extradata_valid(s->streams[0]->codec, &format, &streaminfo))
-        return -1;
-
-    if (pb->seekable) {
-        /* rewrite the STREAMINFO header block data */
-        file_size = avio_tell(pb);
-        avio_seek(pb, 8, SEEK_SET);
-        avio_write(pb, streaminfo, FLAC_STREAMINFO_SIZE);
-        avio_seek(pb, file_size, SEEK_SET);
-        avio_flush(pb);
-    } else {
-        av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n");
-    }
-    return 0;
-}
-
-static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    avio_write(s->pb, pkt->data, pkt->size);
-    return 0;
-}
-
-static const AVOption flacenc_options[] = {
-    { "write_header", "Write the file header", offsetof(FlacMuxerContext, write_header), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
-    { NULL },
-};
-
-static const AVClass flac_muxer_class = {
-    .class_name = "flac muxer",
-    .item_name  = av_default_item_name,
-    .option     = flacenc_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVOutputFormat ff_flac_muxer = {
-    .name              = "flac",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw FLAC"),
-    .priv_data_size    = sizeof(FlacMuxerContext),
-    .mime_type         = "audio/x-flac",
-    .extensions        = "flac",
-    .audio_codec       = AV_CODEC_ID_FLAC,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = flac_write_header,
-    .write_packet      = flac_write_packet,
-    .write_trailer     = flac_write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .priv_class        = &flac_muxer_class,
-};
diff --git a/deps/libav/libavformat/flacenc.h b/deps/libav/libavformat/flacenc.h
deleted file mode 100644
index 2edda67..0000000
--- a/deps/libav/libavformat/flacenc.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * raw FLAC muxer
- * Copyright (C) 2009 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_FLACENC_H
-#define AVFORMAT_FLACENC_H
-
-#include "libavcodec/flac.h"
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-
-int ff_flac_write_header(AVIOContext *pb, AVCodecContext *codec,
-                         int last_block);
-
-#endif /* AVFORMAT_FLACENC_H */
diff --git a/deps/libav/libavformat/flacenc_header.c b/deps/libav/libavformat/flacenc_header.c
deleted file mode 100644
index c1f7c86..0000000
--- a/deps/libav/libavformat/flacenc_header.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * raw FLAC muxer
- * Copyright (C) 2009 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/flac.h"
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "flacenc.h"
-
-int ff_flac_write_header(AVIOContext *pb, AVCodecContext *codec,
-                         int last_block)
-{
-    uint8_t header[8] = {
-        0x66, 0x4C, 0x61, 0x43, 0x00, 0x00, 0x00, 0x22
-    };
-    uint8_t *streaminfo;
-    enum FLACExtradataFormat format;
-
-    header[4] = last_block ? 0x80 : 0x00;
-    if (!avpriv_flac_is_extradata_valid(codec, &format, &streaminfo))
-        return -1;
-
-    /* write "fLaC" stream marker and first metadata block header */
-    avio_write(pb, header, 8);
-
-    /* write STREAMINFO */
-    avio_write(pb, streaminfo, FLAC_STREAMINFO_SIZE);
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/flic.c b/deps/libav/libavformat/flic.c
deleted file mode 100644
index 2eb6f05..0000000
--- a/deps/libav/libavformat/flic.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * FLI/FLC Animation File Demuxer
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FLI/FLC file demuxer
- * by Mike Melanson (melanson at pcisys.net)
- * for more information on the .fli/.flc file format and all of its many
- * variations, visit:
- *   http://www.compuphase.com/flic.htm
- *
- * This demuxer handles standard 0xAF11- and 0xAF12-type FLIs. It also handles
- * special FLIs from the PC games "Magic Carpet" and "X-COM: Terror from the Deep".
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define FLIC_FILE_MAGIC_1 0xAF11
-#define FLIC_FILE_MAGIC_2 0xAF12
-#define FLIC_FILE_MAGIC_3 0xAF44  /* Flic Type for Extended FLX Format which
-                                     originated in Dave's Targa Animator (DTA) */
-#define FLIC_CHUNK_MAGIC_1 0xF1FA
-#define FLIC_CHUNK_MAGIC_2 0xF5FA
-#define FLIC_MC_SPEED 5  /* speed for Magic Carpet game FLIs */
-#define FLIC_DEFAULT_SPEED 5  /* for FLIs that have 0 speed */
-#define FLIC_TFTD_CHUNK_AUDIO 0xAAAA /* Audio chunk. Used in Terror from the Deep.
-                                        Has 10 B extra header not accounted for in the chunk header */
-#define FLIC_TFTD_SAMPLE_RATE 22050
-
-#define FLIC_HEADER_SIZE 128
-#define FLIC_PREAMBLE_SIZE 6
-
-typedef struct FlicDemuxContext {
-    int video_stream_index;
-    int audio_stream_index;
-    int frame_number;
-} FlicDemuxContext;
-
-static int flic_probe(AVProbeData *p)
-{
-    int magic_number;
-
-    if(p->buf_size < FLIC_HEADER_SIZE)
-        return 0;
-
-    magic_number = AV_RL16(&p->buf[4]);
-    if ((magic_number != FLIC_FILE_MAGIC_1) &&
-        (magic_number != FLIC_FILE_MAGIC_2) &&
-        (magic_number != FLIC_FILE_MAGIC_3))
-        return 0;
-
-    if(AV_RL16(&p->buf[0x10]) != FLIC_CHUNK_MAGIC_1){
-        if(AV_RL32(&p->buf[0x10]) > 2000)
-            return 0;
-    }
-
-    if(   AV_RL16(&p->buf[0x08]) > 4096
-       || AV_RL16(&p->buf[0x0A]) > 4096)
-        return 0;
-
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int flic_read_header(AVFormatContext *s)
-{
-    FlicDemuxContext *flic = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned char header[FLIC_HEADER_SIZE];
-    AVStream *st, *ast;
-    int speed;
-    int magic_number;
-    unsigned char preamble[FLIC_PREAMBLE_SIZE];
-
-    flic->frame_number = 0;
-
-    /* load the whole header and pull out the width and height */
-    if (avio_read(pb, header, FLIC_HEADER_SIZE) != FLIC_HEADER_SIZE)
-        return AVERROR(EIO);
-
-    magic_number = AV_RL16(&header[4]);
-    speed = AV_RL32(&header[0x10]);
-    if (speed == 0)
-        speed = FLIC_DEFAULT_SPEED;
-
-    /* initialize the decoder streams */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    flic->video_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_FLIC;
-    st->codec->codec_tag = 0;  /* no fourcc */
-    st->codec->width = AV_RL16(&header[0x08]);
-    st->codec->height = AV_RL16(&header[0x0A]);
-
-    if (!st->codec->width || !st->codec->height) {
-        /* Ugly hack needed for the following sample: */
-        /* http://samples.libav.org/fli-flc/fli-bugs/specular.flc */
-        av_log(s, AV_LOG_WARNING,
-               "File with no specified width/height. Trying 640x480.\n");
-        st->codec->width  = 640;
-        st->codec->height = 480;
-    }
-
-    /* send over the whole 128-byte FLIC header */
-    st->codec->extradata_size = FLIC_HEADER_SIZE;
-    st->codec->extradata = av_malloc(FLIC_HEADER_SIZE);
-    memcpy(st->codec->extradata, header, FLIC_HEADER_SIZE);
-
-    /* peek at the preamble to detect TFTD videos - they seem to always start with an audio chunk */
-    if (avio_read(pb, preamble, FLIC_PREAMBLE_SIZE) != FLIC_PREAMBLE_SIZE) {
-        av_log(s, AV_LOG_ERROR, "Failed to peek at preamble\n");
-        return AVERROR(EIO);
-    }
-
-    avio_seek(pb, -FLIC_PREAMBLE_SIZE, SEEK_CUR);
-
-    /* Time to figure out the framerate:
-     * If the first preamble's magic number is 0xAAAA then this file is from
-     * X-COM: Terror from the Deep. If on the other hand there is a FLIC chunk
-     * magic number at offset 0x10 assume this file is from Magic Carpet instead.
-     * If neither of the above is true then this is a normal FLIC file.
-     */
-    if (AV_RL16(&preamble[4]) == FLIC_TFTD_CHUNK_AUDIO) {
-        /* TFTD videos have an extra 22050 Hz 8-bit mono audio stream */
-        ast = avformat_new_stream(s, NULL);
-        if (!ast)
-            return AVERROR(ENOMEM);
-
-        flic->audio_stream_index = ast->index;
-
-        /* all audio frames are the same size, so use the size of the first chunk for block_align */
-        ast->codec->block_align = AV_RL32(&preamble[0]);
-        ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        ast->codec->codec_id = AV_CODEC_ID_PCM_U8;
-        ast->codec->codec_tag = 0;
-        ast->codec->sample_rate = FLIC_TFTD_SAMPLE_RATE;
-        ast->codec->channels = 1;
-        ast->codec->sample_fmt = AV_SAMPLE_FMT_U8;
-        ast->codec->bit_rate = st->codec->sample_rate * 8;
-        ast->codec->bits_per_coded_sample = 8;
-        ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
-        ast->codec->extradata_size = 0;
-
-        /* Since the header information is incorrect we have to figure out the
-         * framerate using block_align and the fact that the audio is 22050 Hz.
-         * We usually have two cases: 2205 -> 10 fps and 1470 -> 15 fps */
-        avpriv_set_pts_info(st, 64, ast->codec->block_align, FLIC_TFTD_SAMPLE_RATE);
-        avpriv_set_pts_info(ast, 64, 1, FLIC_TFTD_SAMPLE_RATE);
-    } else if (AV_RL16(&header[0x10]) == FLIC_CHUNK_MAGIC_1) {
-        avpriv_set_pts_info(st, 64, FLIC_MC_SPEED, 70);
-
-        /* rewind the stream since the first chunk is at offset 12 */
-        avio_seek(pb, 12, SEEK_SET);
-
-        /* send over abbreviated FLIC header chunk */
-        av_free(st->codec->extradata);
-        st->codec->extradata_size = 12;
-        st->codec->extradata = av_malloc(12);
-        memcpy(st->codec->extradata, header, 12);
-
-    } else if (magic_number == FLIC_FILE_MAGIC_1) {
-        avpriv_set_pts_info(st, 64, speed, 70);
-    } else if ((magic_number == FLIC_FILE_MAGIC_2) ||
-               (magic_number == FLIC_FILE_MAGIC_3)) {
-        avpriv_set_pts_info(st, 64, speed, 1000);
-    } else {
-        av_log(s, AV_LOG_INFO, "Invalid or unsupported magic chunk in file\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-static int flic_read_packet(AVFormatContext *s,
-                            AVPacket *pkt)
-{
-    FlicDemuxContext *flic = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int packet_read = 0;
-    unsigned int size;
-    int magic;
-    int ret = 0;
-    unsigned char preamble[FLIC_PREAMBLE_SIZE];
-
-    while (!packet_read) {
-
-        if ((ret = avio_read(pb, preamble, FLIC_PREAMBLE_SIZE)) !=
-            FLIC_PREAMBLE_SIZE) {
-            ret = AVERROR(EIO);
-            break;
-        }
-
-        size = AV_RL32(&preamble[0]);
-        magic = AV_RL16(&preamble[4]);
-
-        if (((magic == FLIC_CHUNK_MAGIC_1) || (magic == FLIC_CHUNK_MAGIC_2)) && size > FLIC_PREAMBLE_SIZE) {
-            if (av_new_packet(pkt, size)) {
-                ret = AVERROR(EIO);
-                break;
-            }
-            pkt->stream_index = flic->video_stream_index;
-            pkt->pts = flic->frame_number++;
-            pkt->pos = avio_tell(pb);
-            memcpy(pkt->data, preamble, FLIC_PREAMBLE_SIZE);
-            ret = avio_read(pb, pkt->data + FLIC_PREAMBLE_SIZE,
-                size - FLIC_PREAMBLE_SIZE);
-            if (ret != size - FLIC_PREAMBLE_SIZE) {
-                av_free_packet(pkt);
-                ret = AVERROR(EIO);
-            }
-            packet_read = 1;
-        } else if (magic == FLIC_TFTD_CHUNK_AUDIO) {
-            if (av_new_packet(pkt, size)) {
-                ret = AVERROR(EIO);
-                break;
-            }
-
-            /* skip useless 10B sub-header (yes, it's not accounted for in the chunk header) */
-            avio_skip(pb, 10);
-
-            pkt->stream_index = flic->audio_stream_index;
-            pkt->pos = avio_tell(pb);
-            ret = avio_read(pb, pkt->data, size);
-
-            if (ret != size) {
-                av_free_packet(pkt);
-                ret = AVERROR(EIO);
-            }
-
-            packet_read = 1;
-        } else {
-            /* not interested in this chunk */
-            avio_skip(pb, size - 6);
-        }
-    }
-
-    return ret;
-}
-
-AVInputFormat ff_flic_demuxer = {
-    .name           = "flic",
-    .long_name      = NULL_IF_CONFIG_SMALL("FLI/FLC/FLX animation"),
-    .priv_data_size = sizeof(FlicDemuxContext),
-    .read_probe     = flic_probe,
-    .read_header    = flic_read_header,
-    .read_packet    = flic_read_packet,
-};
diff --git a/deps/libav/libavformat/flv.h b/deps/libav/libavformat/flv.h
deleted file mode 100644
index fe0fc90..0000000
--- a/deps/libav/libavformat/flv.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * FLV common header
- *
- * Copyright (c) 2006 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * FLV common header
- */
-
-#ifndef AVFORMAT_FLV_H
-#define AVFORMAT_FLV_H
-
-/* offsets for packed values */
-#define FLV_AUDIO_SAMPLESSIZE_OFFSET 1
-#define FLV_AUDIO_SAMPLERATE_OFFSET  2
-#define FLV_AUDIO_CODECID_OFFSET     4
-
-#define FLV_VIDEO_FRAMETYPE_OFFSET   4
-
-/* bitmasks to isolate specific values */
-#define FLV_AUDIO_CHANNEL_MASK    0x01
-#define FLV_AUDIO_SAMPLESIZE_MASK 0x02
-#define FLV_AUDIO_SAMPLERATE_MASK 0x0c
-#define FLV_AUDIO_CODECID_MASK    0xf0
-
-#define FLV_VIDEO_CODECID_MASK    0x0f
-#define FLV_VIDEO_FRAMETYPE_MASK  0xf0
-
-#define AMF_END_OF_OBJECT         0x09
-
-enum {
-    FLV_HEADER_FLAG_HASVIDEO = 1,
-    FLV_HEADER_FLAG_HASAUDIO = 4,
-};
-
-enum {
-    FLV_TAG_TYPE_AUDIO = 0x08,
-    FLV_TAG_TYPE_VIDEO = 0x09,
-    FLV_TAG_TYPE_META  = 0x12,
-};
-
-enum {
-    FLV_MONO   = 0,
-    FLV_STEREO = 1,
-};
-
-enum {
-    FLV_SAMPLESSIZE_8BIT  = 0,
-    FLV_SAMPLESSIZE_16BIT = 1 << FLV_AUDIO_SAMPLESSIZE_OFFSET,
-};
-
-enum {
-    FLV_SAMPLERATE_SPECIAL = 0, /**< signifies 5512Hz and 8000Hz in the case of NELLYMOSER */
-    FLV_SAMPLERATE_11025HZ = 1 << FLV_AUDIO_SAMPLERATE_OFFSET,
-    FLV_SAMPLERATE_22050HZ = 2 << FLV_AUDIO_SAMPLERATE_OFFSET,
-    FLV_SAMPLERATE_44100HZ = 3 << FLV_AUDIO_SAMPLERATE_OFFSET,
-};
-
-enum {
-    FLV_CODECID_PCM                  = 0,
-    FLV_CODECID_ADPCM                = 1 << FLV_AUDIO_CODECID_OFFSET,
-    FLV_CODECID_MP3                  = 2 << FLV_AUDIO_CODECID_OFFSET,
-    FLV_CODECID_PCM_LE               = 3 << FLV_AUDIO_CODECID_OFFSET,
-    FLV_CODECID_NELLYMOSER_16KHZ_MONO = 4 << FLV_AUDIO_CODECID_OFFSET,
-    FLV_CODECID_NELLYMOSER_8KHZ_MONO = 5 << FLV_AUDIO_CODECID_OFFSET,
-    FLV_CODECID_NELLYMOSER           = 6 << FLV_AUDIO_CODECID_OFFSET,
-    FLV_CODECID_PCM_ALAW             = 7 << FLV_AUDIO_CODECID_OFFSET,
-    FLV_CODECID_PCM_MULAW            = 8 << FLV_AUDIO_CODECID_OFFSET,
-    FLV_CODECID_AAC                  = 10<< FLV_AUDIO_CODECID_OFFSET,
-    FLV_CODECID_SPEEX                = 11<< FLV_AUDIO_CODECID_OFFSET,
-};
-
-enum {
-    FLV_CODECID_H263    = 2,
-    FLV_CODECID_SCREEN  = 3,
-    FLV_CODECID_VP6     = 4,
-    FLV_CODECID_VP6A    = 5,
-    FLV_CODECID_SCREEN2 = 6,
-    FLV_CODECID_H264    = 7,
-};
-
-enum {
-    FLV_FRAME_KEY        = 1 << FLV_VIDEO_FRAMETYPE_OFFSET,
-    FLV_FRAME_INTER      = 2 << FLV_VIDEO_FRAMETYPE_OFFSET,
-    FLV_FRAME_DISP_INTER = 3 << FLV_VIDEO_FRAMETYPE_OFFSET,
-};
-
-typedef enum {
-    AMF_DATA_TYPE_NUMBER      = 0x00,
-    AMF_DATA_TYPE_BOOL        = 0x01,
-    AMF_DATA_TYPE_STRING      = 0x02,
-    AMF_DATA_TYPE_OBJECT      = 0x03,
-    AMF_DATA_TYPE_NULL        = 0x05,
-    AMF_DATA_TYPE_UNDEFINED   = 0x06,
-    AMF_DATA_TYPE_REFERENCE   = 0x07,
-    AMF_DATA_TYPE_MIXEDARRAY  = 0x08,
-    AMF_DATA_TYPE_OBJECT_END  = 0x09,
-    AMF_DATA_TYPE_ARRAY       = 0x0a,
-    AMF_DATA_TYPE_DATE        = 0x0b,
-    AMF_DATA_TYPE_LONG_STRING = 0x0c,
-    AMF_DATA_TYPE_UNSUPPORTED = 0x0d,
-} AMFDataType;
-
-#endif /* AVFORMAT_FLV_H */
diff --git a/deps/libav/libavformat/flvdec.c b/deps/libav/libavformat/flvdec.c
deleted file mode 100644
index a3630f8..0000000
--- a/deps/libav/libavformat/flvdec.c
+++ /dev/null
@@ -1,1014 +0,0 @@
-/*
- * FLV demuxer
- * Copyright (c) 2003 The Libav Project
- *
- * This demuxer will generate a 1 byte extradata for VP6F content.
- * It is composed of:
- *  - upper 4bits: difference between encoded width and visible width
- *  - lower 4bits: difference between encoded height and visible height
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/dict.h"
-#include "libavutil/opt.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/mathematics.h"
-#include "libavcodec/bytestream.h"
-#include "libavcodec/mpeg4audio.h"
-#include "avformat.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "flv.h"
-
-#define KEYFRAMES_TAG            "keyframes"
-#define KEYFRAMES_TIMESTAMP_TAG  "times"
-#define KEYFRAMES_BYTEOFFSET_TAG "filepositions"
-
-#define VALIDATE_INDEX_TS_THRESH 2500
-
-typedef struct {
-    const AVClass *class; ///< Class for private options.
-    int trust_metadata;   ///< configure streams according onMetaData
-    int wrong_dts;        ///< wrong dts due to negative cts
-    uint8_t *new_extradata[2];
-    int new_extradata_size[2];
-    int last_sample_rate;
-    int last_channels;
-    struct {
-        int64_t dts;
-        int64_t pos;
-    } validate_index[2];
-    int validate_next;
-    int validate_count;
-} FLVContext;
-
-static int flv_probe(AVProbeData *p)
-{
-    const uint8_t *d;
-
-    d = p->buf;
-    if (d[0] == 'F' &&
-        d[1] == 'L' &&
-        d[2] == 'V' &&
-        d[3] < 5 && d[5] == 0 &&
-        AV_RB32(d + 5) > 8) {
-        return AVPROBE_SCORE_MAX;
-    }
-    return 0;
-}
-
-static AVStream *create_stream(AVFormatContext *s, int codec_type)
-{
-    AVStream *st = avformat_new_stream(s, NULL);
-    if (!st)
-        return NULL;
-    st->codec->codec_type = codec_type;
-    avpriv_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */
-    return st;
-}
-
-static int flv_same_audio_codec(AVCodecContext *acodec, int flags)
-{
-    int bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8;
-    int flv_codecid           = flags & FLV_AUDIO_CODECID_MASK;
-    int codec_id;
-
-    if (!acodec->codec_id && !acodec->codec_tag)
-        return 1;
-
-    if (acodec->bits_per_coded_sample != bits_per_coded_sample)
-        return 0;
-
-    switch (flv_codecid) {
-    // no distinction between S16 and S8 PCM codec flags
-    case FLV_CODECID_PCM:
-        codec_id = bits_per_coded_sample == 8
-                   ? AV_CODEC_ID_PCM_U8
-#if HAVE_BIGENDIAN
-                   : AV_CODEC_ID_PCM_S16BE;
-#else
-                   : AV_CODEC_ID_PCM_S16LE;
-#endif
-        return codec_id == acodec->codec_id;
-    case FLV_CODECID_PCM_LE:
-        codec_id = bits_per_coded_sample == 8
-                   ? AV_CODEC_ID_PCM_U8
-                   : AV_CODEC_ID_PCM_S16LE;
-        return codec_id == acodec->codec_id;
-    case FLV_CODECID_AAC:
-        return acodec->codec_id == AV_CODEC_ID_AAC;
-    case FLV_CODECID_ADPCM:
-        return acodec->codec_id == AV_CODEC_ID_ADPCM_SWF;
-    case FLV_CODECID_SPEEX:
-        return acodec->codec_id == AV_CODEC_ID_SPEEX;
-    case FLV_CODECID_MP3:
-        return acodec->codec_id == AV_CODEC_ID_MP3;
-    case FLV_CODECID_NELLYMOSER_8KHZ_MONO:
-    case FLV_CODECID_NELLYMOSER_16KHZ_MONO:
-    case FLV_CODECID_NELLYMOSER:
-        return acodec->codec_id == AV_CODEC_ID_NELLYMOSER;
-    case FLV_CODECID_PCM_MULAW:
-        return acodec->sample_rate == 8000 &&
-               acodec->codec_id    == AV_CODEC_ID_PCM_MULAW;
-    case FLV_CODECID_PCM_ALAW:
-        return acodec->sample_rate == 8000 &&
-               acodec->codec_id    == AV_CODEC_ID_PCM_ALAW;
-    default:
-        return acodec->codec_tag == (flv_codecid >> FLV_AUDIO_CODECID_OFFSET);
-    }
-}
-
-static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream,
-                                AVCodecContext *acodec, int flv_codecid)
-{
-    switch (flv_codecid) {
-    // no distinction between S16 and S8 PCM codec flags
-    case FLV_CODECID_PCM:
-        acodec->codec_id = acodec->bits_per_coded_sample == 8
-                           ? AV_CODEC_ID_PCM_U8
-#if HAVE_BIGENDIAN
-                           : AV_CODEC_ID_PCM_S16BE;
-#else
-                           : AV_CODEC_ID_PCM_S16LE;
-#endif
-        break;
-    case FLV_CODECID_PCM_LE:
-        acodec->codec_id = acodec->bits_per_coded_sample == 8
-                           ? AV_CODEC_ID_PCM_U8
-                           : AV_CODEC_ID_PCM_S16LE;
-        break;
-    case FLV_CODECID_AAC:
-        acodec->codec_id = AV_CODEC_ID_AAC;
-        break;
-    case FLV_CODECID_ADPCM:
-        acodec->codec_id = AV_CODEC_ID_ADPCM_SWF;
-        break;
-    case FLV_CODECID_SPEEX:
-        acodec->codec_id    = AV_CODEC_ID_SPEEX;
-        acodec->sample_rate = 16000;
-        break;
-    case FLV_CODECID_MP3:
-        acodec->codec_id      = AV_CODEC_ID_MP3;
-        astream->need_parsing = AVSTREAM_PARSE_FULL;
-        break;
-    case FLV_CODECID_NELLYMOSER_8KHZ_MONO:
-        // in case metadata does not otherwise declare samplerate
-        acodec->sample_rate = 8000;
-        acodec->codec_id    = AV_CODEC_ID_NELLYMOSER;
-        break;
-    case FLV_CODECID_NELLYMOSER_16KHZ_MONO:
-        acodec->sample_rate = 16000;
-        acodec->codec_id    = AV_CODEC_ID_NELLYMOSER;
-        break;
-    case FLV_CODECID_NELLYMOSER:
-        acodec->codec_id = AV_CODEC_ID_NELLYMOSER;
-        break;
-    case FLV_CODECID_PCM_MULAW:
-        acodec->sample_rate = 8000;
-        acodec->codec_id    = AV_CODEC_ID_PCM_MULAW;
-        break;
-    case FLV_CODECID_PCM_ALAW:
-        acodec->sample_rate = 8000;
-        acodec->codec_id    = AV_CODEC_ID_PCM_ALAW;
-        break;
-    default:
-        av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n",
-               flv_codecid >> FLV_AUDIO_CODECID_OFFSET);
-        acodec->codec_tag = flv_codecid >> FLV_AUDIO_CODECID_OFFSET;
-    }
-}
-
-static int flv_same_video_codec(AVCodecContext *vcodec, int flags)
-{
-    int flv_codecid = flags & FLV_VIDEO_CODECID_MASK;
-
-    if (!vcodec->codec_id && !vcodec->codec_tag)
-        return 1;
-
-    switch (flv_codecid) {
-    case FLV_CODECID_H263:
-        return vcodec->codec_id == AV_CODEC_ID_FLV1;
-    case FLV_CODECID_SCREEN:
-        return vcodec->codec_id == AV_CODEC_ID_FLASHSV;
-    case FLV_CODECID_SCREEN2:
-        return vcodec->codec_id == AV_CODEC_ID_FLASHSV2;
-    case FLV_CODECID_VP6:
-        return vcodec->codec_id == AV_CODEC_ID_VP6F;
-    case FLV_CODECID_VP6A:
-        return vcodec->codec_id == AV_CODEC_ID_VP6A;
-    case FLV_CODECID_H264:
-        return vcodec->codec_id == AV_CODEC_ID_H264;
-    default:
-        return vcodec->codec_tag == flv_codecid;
-    }
-}
-
-static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
-                               int flv_codecid, int read)
-{
-    AVCodecContext *vcodec = vstream->codec;
-    switch (flv_codecid) {
-    case FLV_CODECID_H263:
-        vcodec->codec_id = AV_CODEC_ID_FLV1;
-        break;
-    case FLV_CODECID_SCREEN:
-        vcodec->codec_id = AV_CODEC_ID_FLASHSV;
-        break;
-    case FLV_CODECID_SCREEN2:
-        vcodec->codec_id = AV_CODEC_ID_FLASHSV2;
-        break;
-    case FLV_CODECID_VP6:
-        vcodec->codec_id = AV_CODEC_ID_VP6F;
-    case FLV_CODECID_VP6A:
-        if (flv_codecid == FLV_CODECID_VP6A)
-            vcodec->codec_id = AV_CODEC_ID_VP6A;
-        if (read) {
-            if (vcodec->extradata_size != 1) {
-                vcodec->extradata = av_malloc(1);
-                if (vcodec->extradata)
-                    vcodec->extradata_size = 1;
-            }
-            if (vcodec->extradata)
-                vcodec->extradata[0] = avio_r8(s->pb);
-            else
-                avio_skip(s->pb, 1);
-        }
-        return 1;     // 1 byte body size adjustment for flv_read_packet()
-    case FLV_CODECID_H264:
-        vcodec->codec_id = AV_CODEC_ID_H264;
-        return 3;     // not 4, reading packet type will consume one byte
-    default:
-        av_log(s, AV_LOG_INFO, "Unsupported video codec (%x)\n", flv_codecid);
-        vcodec->codec_tag = flv_codecid;
-    }
-
-    return 0;
-}
-
-static int amf_get_string(AVIOContext *ioc, char *buffer, int buffsize)
-{
-    int length = avio_rb16(ioc);
-    if (length >= buffsize) {
-        avio_skip(ioc, length);
-        return -1;
-    }
-
-    avio_read(ioc, buffer, length);
-
-    buffer[length] = '\0';
-
-    return length;
-}
-
-static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc,
-                                 AVStream *vstream, int64_t max_pos)
-{
-    FLVContext *flv       = s->priv_data;
-    unsigned int arraylen = 0, timeslen = 0, fileposlen = 0, i;
-    double num_val;
-    char str_val[256];
-    int64_t *times         = NULL;
-    int64_t *filepositions = NULL;
-    int ret                = AVERROR(ENOSYS);
-    int64_t initial_pos    = avio_tell(ioc);
-
-    if (s->flags & AVFMT_FLAG_IGNIDX)
-        return 0;
-
-    while (avio_tell(ioc) < max_pos - 2 &&
-           amf_get_string(ioc, str_val, sizeof(str_val)) > 0) {
-        int64_t *current_array;
-
-        // Expect array object in context
-        if (avio_r8(ioc) != AMF_DATA_TYPE_ARRAY)
-            break;
-
-        arraylen = avio_rb32(ioc);
-        if (arraylen >> 28)
-            break;
-
-        /* Expect only 'times' or 'filepositions' sub-arrays in other
-         * case refuse to use such metadata for indexing. */
-        if (!strcmp(KEYFRAMES_TIMESTAMP_TAG, str_val) && !times) {
-            if (!(times = av_mallocz(sizeof(*times) * arraylen))) {
-                ret = AVERROR(ENOMEM);
-                goto finish;
-            }
-            timeslen      = arraylen;
-            current_array = times;
-        } else if (!strcmp(KEYFRAMES_BYTEOFFSET_TAG, str_val) &&
-                   !filepositions) {
-            if (!(filepositions = av_mallocz(sizeof(*filepositions) * arraylen))) {
-                ret = AVERROR(ENOMEM);
-                goto finish;
-            }
-            fileposlen    = arraylen;
-            current_array = filepositions;
-        } else
-            // unexpected metatag inside keyframes, will not use such
-            // metadata for indexing
-            break;
-
-        for (i = 0; i < arraylen && avio_tell(ioc) < max_pos - 1; i++) {
-            if (avio_r8(ioc) != AMF_DATA_TYPE_NUMBER)
-                goto finish;
-            num_val          = av_int2double(avio_rb64(ioc));
-            current_array[i] = num_val;
-        }
-        if (times && filepositions) {
-            // All done, exiting at a position allowing amf_parse_object
-            // to finish parsing the object
-            ret = 0;
-            break;
-        }
-    }
-
-    if (!ret && timeslen == fileposlen) {
-        for (i = 0; i < fileposlen; i++) {
-            av_add_index_entry(vstream, filepositions[i], times[i] * 1000,
-                               0, 0, AVINDEX_KEYFRAME);
-            if (i < 2) {
-                flv->validate_index[i].pos = filepositions[i];
-                flv->validate_index[i].dts = times[i] * 1000;
-                flv->validate_count        = i + 1;
-            }
-        }
-    } else
-        av_log(s, AV_LOG_WARNING, "Invalid keyframes object, skipping.\n");
-
-finish:
-    av_freep(&times);
-    av_freep(&filepositions);
-    // If we got unexpected data, but successfully reset back to
-    // the start pos, the caller can continue parsing
-    if (ret < 0 && avio_seek(ioc, initial_pos, SEEK_SET) > 0)
-        return 0;
-    return ret;
-}
-
-static int amf_parse_object(AVFormatContext *s, AVStream *astream,
-                            AVStream *vstream, const char *key,
-                            int64_t max_pos, int depth)
-{
-    AVCodecContext *acodec, *vcodec;
-    FLVContext *flv = s->priv_data;
-    AVIOContext *ioc;
-    AMFDataType amf_type;
-    char str_val[256];
-    double num_val;
-
-    num_val  = 0;
-    ioc      = s->pb;
-    amf_type = avio_r8(ioc);
-
-    switch (amf_type) {
-    case AMF_DATA_TYPE_NUMBER:
-        num_val = av_int2double(avio_rb64(ioc));
-        break;
-    case AMF_DATA_TYPE_BOOL:
-        num_val = avio_r8(ioc);
-        break;
-    case AMF_DATA_TYPE_STRING:
-        if (amf_get_string(ioc, str_val, sizeof(str_val)) < 0)
-            return -1;
-        break;
-    case AMF_DATA_TYPE_OBJECT:
-        if ((vstream || astream) && key &&
-            !strcmp(KEYFRAMES_TAG, key) && depth == 1)
-            if (parse_keyframes_index(s, ioc, vstream ? vstream : astream,
-                                      max_pos) < 0)
-                return -1;
-
-        while (avio_tell(ioc) < max_pos - 2 &&
-               amf_get_string(ioc, str_val, sizeof(str_val)) > 0)
-            if (amf_parse_object(s, astream, vstream, str_val, max_pos,
-                                 depth + 1) < 0)
-                return -1;     // if we couldn't skip, bomb out.
-        if (avio_r8(ioc) != AMF_END_OF_OBJECT)
-            return -1;
-        break;
-    case AMF_DATA_TYPE_NULL:
-    case AMF_DATA_TYPE_UNDEFINED:
-    case AMF_DATA_TYPE_UNSUPPORTED:
-        break;     // these take up no additional space
-    case AMF_DATA_TYPE_MIXEDARRAY:
-        avio_skip(ioc, 4);     // skip 32-bit max array index
-        while (avio_tell(ioc) < max_pos - 2 &&
-               amf_get_string(ioc, str_val, sizeof(str_val)) > 0)
-            // this is the only case in which we would want a nested
-            // parse to not skip over the object
-            if (amf_parse_object(s, astream, vstream, str_val, max_pos,
-                                 depth + 1) < 0)
-                return -1;
-        if (avio_r8(ioc) != AMF_END_OF_OBJECT)
-            return -1;
-        break;
-    case AMF_DATA_TYPE_ARRAY:
-    {
-        unsigned int arraylen, i;
-
-        arraylen = avio_rb32(ioc);
-        for (i = 0; i < arraylen && avio_tell(ioc) < max_pos - 1; i++)
-            if (amf_parse_object(s, NULL, NULL, NULL, max_pos,
-                                 depth + 1) < 0)
-                return -1;      // if we couldn't skip, bomb out.
-    }
-    break;
-    case AMF_DATA_TYPE_DATE:
-        avio_skip(ioc, 8 + 2);  // timestamp (double) and UTC offset (int16)
-        break;
-    default:                    // unsupported type, we couldn't skip
-        return -1;
-    }
-
-    // only look for metadata values when we are not nested and key != NULL
-    if (depth == 1 && key) {
-        acodec = astream ? astream->codec : NULL;
-        vcodec = vstream ? vstream->codec : NULL;
-
-        if (amf_type == AMF_DATA_TYPE_NUMBER ||
-            amf_type == AMF_DATA_TYPE_BOOL) {
-            if (!strcmp(key, "duration"))
-                s->duration = num_val * AV_TIME_BASE;
-            else if (!strcmp(key, "videodatarate") && vcodec &&
-                     0 <= (int)(num_val * 1024.0))
-                vcodec->bit_rate = num_val * 1024.0;
-            else if (!strcmp(key, "audiodatarate") && acodec &&
-                     0 <= (int)(num_val * 1024.0))
-                acodec->bit_rate = num_val * 1024.0;
-            else if (!strcmp(key, "datastream")) {
-                AVStream *st = create_stream(s, AVMEDIA_TYPE_DATA);
-                if (!st)
-                    return AVERROR(ENOMEM);
-                st->codec->codec_id = AV_CODEC_ID_TEXT;
-            } else if (flv->trust_metadata) {
-                if (!strcmp(key, "videocodecid") && vcodec) {
-                    flv_set_video_codec(s, vstream, num_val, 0);
-                } else if (!strcmp(key, "audiocodecid") && acodec) {
-                    int id = ((int)num_val) << FLV_AUDIO_CODECID_OFFSET;
-                    flv_set_audio_codec(s, astream, acodec, id);
-                } else if (!strcmp(key, "audiosamplerate") && acodec) {
-                    acodec->sample_rate = num_val;
-                } else if (!strcmp(key, "audiosamplesize") && acodec) {
-                    acodec->bits_per_coded_sample = num_val;
-                } else if (!strcmp(key, "stereo") && acodec) {
-                    acodec->channels       = num_val + 1;
-                    acodec->channel_layout = acodec->channels == 2 ?
-                                             AV_CH_LAYOUT_STEREO :
-                                             AV_CH_LAYOUT_MONO;
-                } else if (!strcmp(key, "width") && vcodec) {
-                    vcodec->width = num_val;
-                } else if (!strcmp(key, "height") && vcodec) {
-                    vcodec->height = num_val;
-                }
-            }
-        }
-
-        if (!strcmp(key, "duration")        ||
-            !strcmp(key, "filesize")        ||
-            !strcmp(key, "width")           ||
-            !strcmp(key, "height")          ||
-            !strcmp(key, "videodatarate")   ||
-            !strcmp(key, "framerate")       ||
-            !strcmp(key, "videocodecid")    ||
-            !strcmp(key, "audiodatarate")   ||
-            !strcmp(key, "audiosamplerate") ||
-            !strcmp(key, "audiosamplesize") ||
-            !strcmp(key, "stereo")          ||
-            !strcmp(key, "audiocodecid")    ||
-            !strcmp(key, "datastream"))
-            return 0;
-
-        if (amf_type == AMF_DATA_TYPE_BOOL) {
-            av_strlcpy(str_val, num_val > 0 ? "true" : "false",
-                       sizeof(str_val));
-            av_dict_set(&s->metadata, key, str_val, 0);
-        } else if (amf_type == AMF_DATA_TYPE_NUMBER) {
-            snprintf(str_val, sizeof(str_val), "%.f", num_val);
-            av_dict_set(&s->metadata, key, str_val, 0);
-        } else if (amf_type == AMF_DATA_TYPE_STRING)
-            av_dict_set(&s->metadata, key, str_val, 0);
-    }
-
-    return 0;
-}
-
-static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
-{
-    AMFDataType type;
-    AVStream *stream, *astream, *vstream;
-    AVIOContext *ioc;
-    int i;
-    // only needs to hold the string "onMetaData".
-    // Anything longer is something we don't want.
-    char buffer[11];
-
-    astream = NULL;
-    vstream = NULL;
-    ioc     = s->pb;
-
-    // first object needs to be "onMetaData" string
-    type = avio_r8(ioc);
-    if (type != AMF_DATA_TYPE_STRING ||
-        amf_get_string(ioc, buffer, sizeof(buffer)) < 0)
-        return -1;
-
-    if (!strcmp(buffer, "onTextData"))
-        return 1;
-
-    if (strcmp(buffer, "onMetaData"))
-        return -1;
-
-    // find the streams now so that amf_parse_object doesn't need to do
-    // the lookup every time it is called.
-    for (i = 0; i < s->nb_streams; i++) {
-        stream = s->streams[i];
-        if (stream->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-            astream = stream;
-        else if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-            vstream = stream;
-    }
-
-    // parse the second object (we want a mixed array)
-    if (amf_parse_object(s, astream, vstream, buffer, next_pos, 0) < 0)
-        return -1;
-
-    return 0;
-}
-
-static int flv_read_header(AVFormatContext *s)
-{
-    int offset, flags;
-
-    avio_skip(s->pb, 4);
-    flags = avio_r8(s->pb);
-    /* old flvtool cleared this field */
-    /* FIXME: better fix needed */
-    if (!flags) {
-        flags = FLV_HEADER_FLAG_HASVIDEO | FLV_HEADER_FLAG_HASAUDIO;
-        av_log(s, AV_LOG_WARNING,
-               "Broken FLV file, which says no streams present, "
-               "this might fail\n");
-    }
-
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    if (flags & FLV_HEADER_FLAG_HASVIDEO)
-        if (!create_stream(s, AVMEDIA_TYPE_VIDEO))
-            return AVERROR(ENOMEM);
-    if (flags & FLV_HEADER_FLAG_HASAUDIO)
-        if (!create_stream(s, AVMEDIA_TYPE_AUDIO))
-            return AVERROR(ENOMEM);
-
-    offset = avio_rb32(s->pb);
-    avio_seek(s->pb, offset, SEEK_SET);
-    avio_skip(s->pb, 4);
-
-    s->start_time = 0;
-
-    return 0;
-}
-
-static int flv_read_close(AVFormatContext *s)
-{
-    FLVContext *flv = s->priv_data;
-    av_freep(&flv->new_extradata[0]);
-    av_freep(&flv->new_extradata[1]);
-    return 0;
-}
-
-static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
-{
-    av_free(st->codec->extradata);
-    st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata)
-        return AVERROR(ENOMEM);
-    st->codec->extradata_size = size;
-    avio_read(s->pb, st->codec->extradata, st->codec->extradata_size);
-    return 0;
-}
-
-static int flv_queue_extradata(FLVContext *flv, AVIOContext *pb, int stream,
-                               int size)
-{
-    av_free(flv->new_extradata[stream]);
-    flv->new_extradata[stream] = av_mallocz(size +
-                                            FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!flv->new_extradata[stream])
-        return AVERROR(ENOMEM);
-    flv->new_extradata_size[stream] = size;
-    avio_read(pb, flv->new_extradata[stream], size);
-    return 0;
-}
-
-static void clear_index_entries(AVFormatContext *s, int64_t pos)
-{
-    int i, j, out;
-    av_log(s, AV_LOG_WARNING,
-           "Found invalid index entries, clearing the index.\n");
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        /* Remove all index entries that point to >= pos */
-        out = 0;
-        for (j = 0; j < st->nb_index_entries; j++)
-            if (st->index_entries[j].pos < pos)
-                st->index_entries[out++] = st->index_entries[j];
-        st->nb_index_entries = out;
-    }
-}
-
-static int amf_skip_tag(AVIOContext *pb, AMFDataType type)
-{
-    int nb = -1, ret, parse_name = 1;
-
-    switch (type) {
-    case AMF_DATA_TYPE_NUMBER:
-        avio_skip(pb, 8);
-        break;
-    case AMF_DATA_TYPE_BOOL:
-        avio_skip(pb, 1);
-        break;
-    case AMF_DATA_TYPE_STRING:
-        avio_skip(pb, avio_rb16(pb));
-        break;
-    case AMF_DATA_TYPE_ARRAY:
-        parse_name = 0;
-    case AMF_DATA_TYPE_MIXEDARRAY:
-        nb = avio_rb32(pb);
-    case AMF_DATA_TYPE_OBJECT:
-        while(!pb->eof_reached && (nb-- > 0 || type != AMF_DATA_TYPE_ARRAY)) {
-            if (parse_name) {
-                int size = avio_rb16(pb);
-                if (!size) {
-                    avio_skip(pb, 1);
-                    break;
-                }
-                avio_skip(pb, size);
-            }
-            if ((ret = amf_skip_tag(pb, avio_r8(pb))) < 0)
-                return ret;
-        }
-        break;
-    case AMF_DATA_TYPE_NULL:
-    case AMF_DATA_TYPE_OBJECT_END:
-        break;
-    default:
-        return AVERROR_INVALIDDATA;
-    }
-    return 0;
-}
-
-static int flv_data_packet(AVFormatContext *s, AVPacket *pkt,
-                           int64_t dts, int64_t next)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st    = NULL;
-    char buf[20];
-    int ret = AVERROR_INVALIDDATA;
-    int i, length = -1;
-
-    switch (avio_r8(pb)) {
-    case AMF_DATA_TYPE_MIXEDARRAY:
-        avio_seek(pb, 4, SEEK_CUR);
-    case AMF_DATA_TYPE_OBJECT:
-        break;
-    default:
-        goto skip;
-    }
-
-    while ((ret = amf_get_string(pb, buf, sizeof(buf))) > 0) {
-        AMFDataType type = avio_r8(pb);
-        if (type == AMF_DATA_TYPE_STRING && !strcmp(buf, "text")) {
-            length = avio_rb16(pb);
-            ret    = av_get_packet(pb, pkt, length);
-            if (ret < 0)
-                goto skip;
-            else
-                break;
-        } else {
-            if ((ret = amf_skip_tag(pb, type)) < 0)
-                goto skip;
-        }
-    }
-
-    if (length < 0) {
-        ret = AVERROR_INVALIDDATA;
-        goto skip;
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        st = s->streams[i];
-        if (st->codec->codec_type == AVMEDIA_TYPE_DATA)
-            break;
-    }
-
-    if (i == s->nb_streams) {
-        st = create_stream(s, AVMEDIA_TYPE_DATA);
-        if (!st)
-            return AVERROR_INVALIDDATA;
-        st->codec->codec_id = AV_CODEC_ID_TEXT;
-    }
-
-    pkt->dts  = dts;
-    pkt->pts  = dts;
-    pkt->size = ret;
-
-    pkt->stream_index = st->index;
-    pkt->flags       |= AV_PKT_FLAG_KEY;
-
-skip:
-    avio_seek(s->pb, next + 4, SEEK_SET);
-
-    return ret;
-}
-
-static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    FLVContext *flv = s->priv_data;
-    int ret, i, type, size, flags, is_audio;
-    int64_t next, pos;
-    int64_t dts, pts = AV_NOPTS_VALUE;
-    int sample_rate = 0, channels = 0;
-    AVStream *st    = NULL;
-
-    /* pkt size is repeated at end. skip it */
-    for (;; avio_skip(s->pb, 4)) {
-        pos  = avio_tell(s->pb);
-        type = avio_r8(s->pb);
-        size = avio_rb24(s->pb);
-        dts  = avio_rb24(s->pb);
-        dts |= avio_r8(s->pb) << 24;
-        av_dlog(s, "type:%d, size:%d, dts:%"PRId64"\n", type, size, dts);
-        if (s->pb->eof_reached)
-            return AVERROR_EOF;
-        avio_skip(s->pb, 3); /* stream id, always 0 */
-        flags = 0;
-
-        if (flv->validate_next < flv->validate_count) {
-            int64_t validate_pos = flv->validate_index[flv->validate_next].pos;
-            if (pos == validate_pos) {
-                if (FFABS(dts - flv->validate_index[flv->validate_next].dts) <=
-                    VALIDATE_INDEX_TS_THRESH) {
-                    flv->validate_next++;
-                } else {
-                    clear_index_entries(s, validate_pos);
-                    flv->validate_count = 0;
-                }
-            } else if (pos > validate_pos) {
-                clear_index_entries(s, validate_pos);
-                flv->validate_count = 0;
-            }
-        }
-
-        if (size == 0)
-            continue;
-
-        next = size + avio_tell(s->pb);
-
-        if (type == FLV_TAG_TYPE_AUDIO) {
-            is_audio = 1;
-            flags    = avio_r8(s->pb);
-            size--;
-        } else if (type == FLV_TAG_TYPE_VIDEO) {
-            is_audio = 0;
-            flags    = avio_r8(s->pb);
-            size--;
-            if ((flags & 0xf0) == 0x50) /* video info / command frame */
-                goto skip;
-        } else {
-            if (type == FLV_TAG_TYPE_META && size > 13 + 1 + 4)
-                if (flv_read_metabody(s, next) > 0) {
-                    return flv_data_packet(s, pkt, dts, next);
-                } else /* skip packet */
-                    av_log(s, AV_LOG_DEBUG,
-                           "skipping flv packet: type %d, size %d, flags %d\n",
-                           type, size, flags);
-
-skip:
-            avio_seek(s->pb, next, SEEK_SET);
-            continue;
-        }
-
-        /* skip empty data packets */
-        if (!size)
-            continue;
-
-        /* now find stream */
-        for (i = 0; i < s->nb_streams; i++) {
-            st = s->streams[i];
-            if (is_audio && st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-                if (flv_same_audio_codec(st->codec, flags))
-                    break;
-            } else if (!is_audio &&
-                       st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-                if (flv_same_video_codec(st->codec, flags))
-                    break;
-            }
-        }
-        if (i == s->nb_streams)
-            st = create_stream(s, is_audio ? AVMEDIA_TYPE_AUDIO
-                                           : AVMEDIA_TYPE_VIDEO);
-        av_dlog(s, "%d %X %d \n", is_audio, flags, st->discard);
-        if ((st->discard >= AVDISCARD_NONKEY &&
-             !((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY || is_audio)) ||
-            (st->discard >= AVDISCARD_BIDIR &&
-             ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_DISP_INTER && !is_audio)) ||
-            st->discard >= AVDISCARD_ALL) {
-            avio_seek(s->pb, next, SEEK_SET);
-            continue;
-        }
-        if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)
-            av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME);
-        break;
-    }
-
-    // if not streamed and no duration from metadata then seek to end to find
-    // the duration from the timestamps
-    if (s->pb->seekable && (!s->duration || s->duration == AV_NOPTS_VALUE)) {
-        int size;
-        const int64_t pos   = avio_tell(s->pb);
-        const int64_t fsize = avio_size(s->pb);
-        avio_seek(s->pb, fsize - 4, SEEK_SET);
-        size = avio_rb32(s->pb);
-        avio_seek(s->pb, fsize - 3 - size, SEEK_SET);
-        if (size == avio_rb24(s->pb) + 11) {
-            uint32_t ts = avio_rb24(s->pb);
-            ts         |= avio_r8(s->pb) << 24;
-            s->duration = ts * (int64_t)AV_TIME_BASE / 1000;
-        }
-        avio_seek(s->pb, pos, SEEK_SET);
-    }
-
-    if (is_audio) {
-        int bits_per_coded_sample;
-        channels = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1;
-        sample_rate = 44100 << ((flags & FLV_AUDIO_SAMPLERATE_MASK) >>
-                                FLV_AUDIO_SAMPLERATE_OFFSET) >> 3;
-        bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8;
-        if (!st->codec->channels || !st->codec->sample_rate ||
-            !st->codec->bits_per_coded_sample) {
-            st->codec->channels              = channels;
-            st->codec->channel_layout        = channels == 1
-                                               ? AV_CH_LAYOUT_MONO
-                                               : AV_CH_LAYOUT_STEREO;
-            st->codec->sample_rate           = sample_rate;
-            st->codec->bits_per_coded_sample = bits_per_coded_sample;
-        }
-        if (!st->codec->codec_id) {
-            flv_set_audio_codec(s, st, st->codec,
-                                flags & FLV_AUDIO_CODECID_MASK);
-            flv->last_sample_rate =
-            sample_rate           = st->codec->sample_rate;
-            flv->last_channels    =
-            channels              = st->codec->channels;
-        } else {
-            AVCodecContext ctx;
-            ctx.sample_rate = sample_rate;
-            flv_set_audio_codec(s, st, &ctx, flags & FLV_AUDIO_CODECID_MASK);
-            sample_rate = ctx.sample_rate;
-        }
-    } else {
-        size -= flv_set_video_codec(s, st, flags & FLV_VIDEO_CODECID_MASK, 1);
-    }
-
-    if (st->codec->codec_id == AV_CODEC_ID_AAC ||
-        st->codec->codec_id == AV_CODEC_ID_H264) {
-        int type = avio_r8(s->pb);
-        size--;
-        if (st->codec->codec_id == AV_CODEC_ID_H264) {
-            // sign extension
-            int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000;
-            pts = dts + cts;
-            if (cts < 0) { // dts are wrong
-                flv->wrong_dts = 1;
-                av_log(s, AV_LOG_WARNING,
-                       "negative cts, previous timestamps might be wrong\n");
-            }
-            if (flv->wrong_dts)
-                dts = AV_NOPTS_VALUE;
-        }
-        if (type == 0) {
-            if (st->codec->extradata) {
-                if ((ret = flv_queue_extradata(flv, s->pb, is_audio, size)) < 0)
-                    return ret;
-                ret = AVERROR(EAGAIN);
-                goto leave;
-            }
-            if ((ret = flv_get_extradata(s, st, size)) < 0)
-                return ret;
-            if (st->codec->codec_id == AV_CODEC_ID_AAC) {
-                MPEG4AudioConfig cfg;
-
-                /* Workaround for buggy Omnia A/XE encoder */
-                AVDictionaryEntry *t = av_dict_get(s->metadata, "Encoder", NULL, 0);
-                if (t && !strcmp(t->value, "Omnia A/XE"))
-                    st->codec->extradata_size = 2;
-
-                avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
-                                             st->codec->extradata_size * 8, 1);
-                st->codec->channels       = cfg.channels;
-                st->codec->channel_layout = 0;
-                if (cfg.ext_sample_rate)
-                    st->codec->sample_rate = cfg.ext_sample_rate;
-                else
-                    st->codec->sample_rate = cfg.sample_rate;
-                av_dlog(s, "mp4a config channels %d sample rate %d\n",
-                        st->codec->channels, st->codec->sample_rate);
-            }
-
-            ret = AVERROR(EAGAIN);
-            goto leave;
-        }
-    }
-
-    /* skip empty data packets */
-    if (!size) {
-        ret = AVERROR(EAGAIN);
-        goto leave;
-    }
-
-    ret = av_get_packet(s->pb, pkt, size);
-    if (ret < 0)
-        return AVERROR(EIO);
-    /* note: we need to modify the packet size here to handle the last
-     * packet */
-    pkt->size         = ret;
-    pkt->dts          = dts;
-    pkt->pts          = pts == AV_NOPTS_VALUE ? dts : pts;
-    pkt->stream_index = st->index;
-    if (flv->new_extradata[is_audio]) {
-        uint8_t *side = av_packet_new_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
-                                                flv->new_extradata_size[is_audio]);
-        if (side) {
-            memcpy(side, flv->new_extradata[is_audio],
-                   flv->new_extradata_size[is_audio]);
-            av_freep(&flv->new_extradata[is_audio]);
-            flv->new_extradata_size[is_audio] = 0;
-        }
-    }
-    if (is_audio && (sample_rate != flv->last_sample_rate ||
-                     channels    != flv->last_channels)) {
-        flv->last_sample_rate = sample_rate;
-        flv->last_channels    = channels;
-        ff_add_param_change(pkt, channels, 0, sample_rate, 0, 0);
-    }
-
-    if (is_audio || ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY))
-        pkt->flags |= AV_PKT_FLAG_KEY;
-
-leave:
-    avio_skip(s->pb, 4);
-    return ret;
-}
-
-static int flv_read_seek(AVFormatContext *s, int stream_index,
-                         int64_t ts, int flags)
-{
-    FLVContext *flv = s->priv_data;
-    flv->validate_count = 0;
-    return avio_seek_time(s->pb, stream_index, ts, flags);
-}
-
-#define OFFSET(x) offsetof(FLVContext, x)
-#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "flv_metadata", "Allocate streams according to the onMetaData array", OFFSET(trust_metadata), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VD },
-    { NULL }
-};
-
-static const AVClass class = {
-    .class_name = "flvdec",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_flv_demuxer = {
-    .name           = "flv",
-    .long_name      = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
-    .priv_data_size = sizeof(FLVContext),
-    .read_probe     = flv_probe,
-    .read_header    = flv_read_header,
-    .read_packet    = flv_read_packet,
-    .read_seek      = flv_read_seek,
-    .read_close     = flv_read_close,
-    .extensions     = "flv",
-    .priv_class     = &class,
-};
diff --git a/deps/libav/libavformat/flvenc.c b/deps/libav/libavformat/flvenc.c
deleted file mode 100644
index 3364f2c..0000000
--- a/deps/libav/libavformat/flvenc.c
+++ /dev/null
@@ -1,571 +0,0 @@
-/*
- * FLV muxer
- * Copyright (c) 2003 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/dict.h"
-#include "libavutil/intfloat.h"
-#include "avc.h"
-#include "avformat.h"
-#include "flv.h"
-#include "internal.h"
-#include "metadata.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-static const AVCodecTag flv_video_codec_ids[] = {
-    { AV_CODEC_ID_FLV1,     FLV_CODECID_H263 },
-    { AV_CODEC_ID_FLASHSV,  FLV_CODECID_SCREEN },
-    { AV_CODEC_ID_FLASHSV2, FLV_CODECID_SCREEN2 },
-    { AV_CODEC_ID_VP6F,     FLV_CODECID_VP6 },
-    { AV_CODEC_ID_VP6A,     FLV_CODECID_VP6A },
-    { AV_CODEC_ID_H264,     FLV_CODECID_H264 },
-    { AV_CODEC_ID_NONE,     0 }
-};
-
-static const AVCodecTag flv_audio_codec_ids[] = {
-    { AV_CODEC_ID_MP3,        FLV_CODECID_MP3        >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_PCM_U8,     FLV_CODECID_PCM        >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_PCM_S16BE,  FLV_CODECID_PCM        >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_PCM_S16LE,  FLV_CODECID_PCM_LE     >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_ADPCM_SWF,  FLV_CODECID_ADPCM      >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_AAC,        FLV_CODECID_AAC        >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_NELLYMOSER, FLV_CODECID_NELLYMOSER >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_PCM_MULAW,  FLV_CODECID_PCM_MULAW  >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_PCM_ALAW,   FLV_CODECID_PCM_ALAW   >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_SPEEX,      FLV_CODECID_SPEEX      >> FLV_AUDIO_CODECID_OFFSET },
-    { AV_CODEC_ID_NONE,       0 }
-};
-
-typedef struct FLVContext {
-    int     reserved;
-    int64_t duration_offset;
-    int64_t filesize_offset;
-    int64_t duration;
-    int64_t delay;      ///< first dts delay (needed for AVC & Speex)
-} FLVContext;
-
-typedef struct FLVStreamContext {
-    int64_t last_ts;    ///< last timestamp for each stream
-} FLVStreamContext;
-
-static int get_audio_flags(AVFormatContext *s, AVCodecContext *enc)
-{
-    int flags = (enc->bits_per_coded_sample == 16) ? FLV_SAMPLESSIZE_16BIT
-                                                   : FLV_SAMPLESSIZE_8BIT;
-
-    if (enc->codec_id == AV_CODEC_ID_AAC) // specs force these parameters
-        return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ |
-               FLV_SAMPLESSIZE_16BIT | FLV_STEREO;
-    else if (enc->codec_id == AV_CODEC_ID_SPEEX) {
-        if (enc->sample_rate != 16000) {
-            av_log(s, AV_LOG_ERROR,
-                   "flv only supports wideband (16kHz) Speex audio\n");
-            return -1;
-        }
-        if (enc->channels != 1) {
-            av_log(s, AV_LOG_ERROR, "flv only supports mono Speex audio\n");
-            return -1;
-        }
-        return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ | FLV_SAMPLESSIZE_16BIT;
-    } else {
-        switch (enc->sample_rate) {
-        case 44100:
-            flags |= FLV_SAMPLERATE_44100HZ;
-            break;
-        case 22050:
-            flags |= FLV_SAMPLERATE_22050HZ;
-            break;
-        case 11025:
-            flags |= FLV_SAMPLERATE_11025HZ;
-            break;
-        case 16000: // nellymoser only
-        case  8000: // nellymoser only
-        case  5512: // not MP3
-            if (enc->codec_id != AV_CODEC_ID_MP3) {
-                flags |= FLV_SAMPLERATE_SPECIAL;
-                break;
-            }
-        default:
-            av_log(s, AV_LOG_ERROR,
-                   "flv does not support that sample rate, "
-                   "choose from (44100, 22050, 11025).\n");
-            return -1;
-        }
-    }
-
-    if (enc->channels > 1)
-        flags |= FLV_STEREO;
-
-    switch (enc->codec_id) {
-    case AV_CODEC_ID_MP3:
-        flags |= FLV_CODECID_MP3    | FLV_SAMPLESSIZE_16BIT;
-        break;
-    case AV_CODEC_ID_PCM_U8:
-        flags |= FLV_CODECID_PCM    | FLV_SAMPLESSIZE_8BIT;
-        break;
-    case AV_CODEC_ID_PCM_S16BE:
-        flags |= FLV_CODECID_PCM    | FLV_SAMPLESSIZE_16BIT;
-        break;
-    case AV_CODEC_ID_PCM_S16LE:
-        flags |= FLV_CODECID_PCM_LE | FLV_SAMPLESSIZE_16BIT;
-        break;
-    case AV_CODEC_ID_ADPCM_SWF:
-        flags |= FLV_CODECID_ADPCM  | FLV_SAMPLESSIZE_16BIT;
-        break;
-    case AV_CODEC_ID_NELLYMOSER:
-        if (enc->sample_rate == 8000)
-            flags |= FLV_CODECID_NELLYMOSER_8KHZ_MONO  | FLV_SAMPLESSIZE_16BIT;
-        else if (enc->sample_rate == 16000)
-            flags |= FLV_CODECID_NELLYMOSER_16KHZ_MONO | FLV_SAMPLESSIZE_16BIT;
-        else
-            flags |= FLV_CODECID_NELLYMOSER            | FLV_SAMPLESSIZE_16BIT;
-        break;
-    case AV_CODEC_ID_PCM_MULAW:
-        flags = FLV_CODECID_PCM_MULAW | FLV_SAMPLERATE_SPECIAL | FLV_SAMPLESSIZE_16BIT;
-        break;
-    case AV_CODEC_ID_PCM_ALAW:
-        flags = FLV_CODECID_PCM_ALAW  | FLV_SAMPLERATE_SPECIAL | FLV_SAMPLESSIZE_16BIT;
-        break;
-    case 0:
-        flags |= enc->codec_tag << 4;
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "codec not compatible with flv\n");
-        return -1;
-    }
-
-    return flags;
-}
-
-static void put_amf_string(AVIOContext *pb, const char *str)
-{
-    size_t len = strlen(str);
-    avio_wb16(pb, len);
-    avio_write(pb, str, len);
-}
-
-static void put_avc_eos_tag(AVIOContext *pb, unsigned ts)
-{
-    avio_w8(pb, FLV_TAG_TYPE_VIDEO);
-    avio_wb24(pb, 5);               /* Tag Data Size */
-    avio_wb24(pb, ts);              /* lower 24 bits of timestamp in ms */
-    avio_w8(pb, (ts >> 24) & 0x7F); /* MSB of ts in ms */
-    avio_wb24(pb, 0);               /* StreamId = 0 */
-    avio_w8(pb, 23);                /* ub[4] FrameType = 1, ub[4] CodecId = 7 */
-    avio_w8(pb, 2);                 /* AVC end of sequence */
-    avio_wb24(pb, 0);               /* Always 0 for AVC EOS. */
-    avio_wb32(pb, 16);              /* Size of FLV tag */
-}
-
-static void put_amf_double(AVIOContext *pb, double d)
-{
-    avio_w8(pb, AMF_DATA_TYPE_NUMBER);
-    avio_wb64(pb, av_double2int(d));
-}
-
-static void put_amf_bool(AVIOContext *pb, int b)
-{
-    avio_w8(pb, AMF_DATA_TYPE_BOOL);
-    avio_w8(pb, !!b);
-}
-
-static int flv_write_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    FLVContext *flv = s->priv_data;
-    AVCodecContext *audio_enc = NULL, *video_enc = NULL, *data_enc = NULL;
-    int i, metadata_count = 0;
-    double framerate = 0.0;
-    int64_t metadata_size_pos, data_size, metadata_count_pos;
-    AVDictionaryEntry *tag = NULL;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVCodecContext *enc = s->streams[i]->codec;
-        FLVStreamContext *sc;
-        switch (enc->codec_type) {
-        case AVMEDIA_TYPE_VIDEO:
-            if (s->streams[i]->avg_frame_rate.den &&
-                s->streams[i]->avg_frame_rate.num) {
-                framerate = av_q2d(s->streams[i]->avg_frame_rate);
-            } else {
-                framerate = 1 / av_q2d(s->streams[i]->codec->time_base);
-            }
-            if (video_enc) {
-                av_log(s, AV_LOG_ERROR,
-                       "at most one video stream is supported in flv\n");
-                return AVERROR(EINVAL);
-            }
-            video_enc = enc;
-            if (enc->codec_tag == 0) {
-                av_log(s, AV_LOG_ERROR, "video codec not compatible with flv\n");
-                return -1;
-            }
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            if (audio_enc) {
-                av_log(s, AV_LOG_ERROR,
-                       "at most one audio stream is supported in flv\n");
-                return AVERROR(EINVAL);
-            }
-            audio_enc = enc;
-            if (get_audio_flags(s, enc) < 0)
-                return AVERROR_INVALIDDATA;
-            break;
-        case AVMEDIA_TYPE_DATA:
-            if (enc->codec_id != AV_CODEC_ID_TEXT) {
-                av_log(s, AV_LOG_ERROR, "codec not compatible with flv\n");
-                return AVERROR_INVALIDDATA;
-            }
-            data_enc = enc;
-            break;
-        default:
-            av_log(s, AV_LOG_ERROR, "codec not compatible with flv\n");
-            return -1;
-        }
-        avpriv_set_pts_info(s->streams[i], 32, 1, 1000); /* 32 bit pts in ms */
-
-        sc = av_mallocz(sizeof(FLVStreamContext));
-        if (!sc)
-            return AVERROR(ENOMEM);
-        s->streams[i]->priv_data = sc;
-        sc->last_ts = -1;
-    }
-
-    flv->delay = AV_NOPTS_VALUE;
-
-    avio_write(pb, "FLV", 3);
-    avio_w8(pb, 1);
-    avio_w8(pb, FLV_HEADER_FLAG_HASAUDIO * !!audio_enc +
-                FLV_HEADER_FLAG_HASVIDEO * !!video_enc);
-    avio_wb32(pb, 9);
-    avio_wb32(pb, 0);
-
-    for (i = 0; i < s->nb_streams; i++)
-        if (s->streams[i]->codec->codec_tag == 5) {
-            avio_w8(pb, 8);     // message type
-            avio_wb24(pb, 0);   // include flags
-            avio_wb24(pb, 0);   // time stamp
-            avio_wb32(pb, 0);   // reserved
-            avio_wb32(pb, 11);  // size
-            flv->reserved = 5;
-        }
-
-    /* write meta_tag */
-    avio_w8(pb, 18);            // tag type META
-    metadata_size_pos = avio_tell(pb);
-    avio_wb24(pb, 0);           // size of data part (sum of all parts below)
-    avio_wb24(pb, 0);           // timestamp
-    avio_wb32(pb, 0);           // reserved
-
-    /* now data of data_size size */
-
-    /* first event name as a string */
-    avio_w8(pb, AMF_DATA_TYPE_STRING);
-    put_amf_string(pb, "onMetaData"); // 12 bytes
-
-    /* mixed array (hash) with size and string/type/data tuples */
-    avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY);
-    metadata_count_pos = avio_tell(pb);
-    metadata_count = 5 * !!video_enc +
-                     5 * !!audio_enc +
-                     1 * !!data_enc  +
-                     2; // +2 for duration and file size
-
-    avio_wb32(pb, metadata_count);
-
-    put_amf_string(pb, "duration");
-    flv->duration_offset= avio_tell(pb);
-
-    // fill in the guessed duration, it'll be corrected later if incorrect
-    put_amf_double(pb, s->duration / AV_TIME_BASE);
-
-    if (video_enc) {
-        put_amf_string(pb, "width");
-        put_amf_double(pb, video_enc->width);
-
-        put_amf_string(pb, "height");
-        put_amf_double(pb, video_enc->height);
-
-        put_amf_string(pb, "videodatarate");
-        put_amf_double(pb, video_enc->bit_rate / 1024.0);
-
-        put_amf_string(pb, "framerate");
-        put_amf_double(pb, framerate);
-
-        put_amf_string(pb, "videocodecid");
-        put_amf_double(pb, video_enc->codec_tag);
-    }
-
-    if (audio_enc) {
-        put_amf_string(pb, "audiodatarate");
-        put_amf_double(pb, audio_enc->bit_rate / 1024.0);
-
-        put_amf_string(pb, "audiosamplerate");
-        put_amf_double(pb, audio_enc->sample_rate);
-
-        put_amf_string(pb, "audiosamplesize");
-        put_amf_double(pb, audio_enc->codec_id == AV_CODEC_ID_PCM_U8 ? 8 : 16);
-
-        put_amf_string(pb, "stereo");
-        put_amf_bool(pb, audio_enc->channels == 2);
-
-        put_amf_string(pb, "audiocodecid");
-        put_amf_double(pb, audio_enc->codec_tag);
-    }
-
-    if (data_enc) {
-        put_amf_string(pb, "datastream");
-        put_amf_double(pb, 0.0);
-    }
-
-    while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
-        put_amf_string(pb, tag->key);
-        avio_w8(pb, AMF_DATA_TYPE_STRING);
-        put_amf_string(pb, tag->value);
-        metadata_count++;
-    }
-
-    put_amf_string(pb, "filesize");
-    flv->filesize_offset = avio_tell(pb);
-    put_amf_double(pb, 0); // delayed write
-
-    put_amf_string(pb, "");
-    avio_w8(pb, AMF_END_OF_OBJECT);
-
-    /* write total size of tag */
-    data_size = avio_tell(pb) - metadata_size_pos - 10;
-
-    avio_seek(pb, metadata_count_pos, SEEK_SET);
-    avio_wb32(pb, metadata_count);
-
-    avio_seek(pb, metadata_size_pos, SEEK_SET);
-    avio_wb24(pb, data_size);
-    avio_skip(pb, data_size + 10 - 3);
-    avio_wb32(pb, data_size + 11);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVCodecContext *enc = s->streams[i]->codec;
-        if (enc->codec_id == AV_CODEC_ID_AAC || enc->codec_id == AV_CODEC_ID_H264) {
-            int64_t pos;
-            avio_w8(pb, enc->codec_type == AVMEDIA_TYPE_VIDEO ?
-                    FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO);
-            avio_wb24(pb, 0); // size patched later
-            avio_wb24(pb, 0); // ts
-            avio_w8(pb, 0);   // ts ext
-            avio_wb24(pb, 0); // streamid
-            pos = avio_tell(pb);
-            if (enc->codec_id == AV_CODEC_ID_AAC) {
-                avio_w8(pb, get_audio_flags(s, enc));
-                avio_w8(pb, 0); // AAC sequence header
-                avio_write(pb, enc->extradata, enc->extradata_size);
-            } else {
-                avio_w8(pb, enc->codec_tag | FLV_FRAME_KEY); // flags
-                avio_w8(pb, 0); // AVC sequence header
-                avio_wb24(pb, 0); // composition time
-                ff_isom_write_avcc(pb, enc->extradata, enc->extradata_size);
-            }
-            data_size = avio_tell(pb) - pos;
-            avio_seek(pb, -data_size - 10, SEEK_CUR);
-            avio_wb24(pb, data_size);
-            avio_skip(pb, data_size + 10 - 3);
-            avio_wb32(pb, data_size + 11); // previous tag size
-        }
-    }
-
-    return 0;
-}
-
-static int flv_write_trailer(AVFormatContext *s)
-{
-    int64_t file_size;
-
-    AVIOContext *pb = s->pb;
-    FLVContext *flv = s->priv_data;
-    int i;
-
-    /* Add EOS tag */
-    for (i = 0; i < s->nb_streams; i++) {
-        AVCodecContext *enc = s->streams[i]->codec;
-        FLVStreamContext *sc = s->streams[i]->priv_data;
-        if (enc->codec_type == AVMEDIA_TYPE_VIDEO &&
-            enc->codec_id == AV_CODEC_ID_H264)
-            put_avc_eos_tag(pb, sc->last_ts);
-    }
-
-    file_size = avio_tell(pb);
-
-    /* update information */
-    if (avio_seek(pb, flv->duration_offset, SEEK_SET) < 0)
-        av_log(s, AV_LOG_WARNING, "Failed to update header with correct duration.\n");
-    else
-        put_amf_double(pb, flv->duration / (double)1000);
-    if (avio_seek(pb, flv->filesize_offset, SEEK_SET) < 0)
-        av_log(s, AV_LOG_WARNING, "Failed to update header with correct filesize.\n");
-    else
-        put_amf_double(pb, file_size);
-
-    avio_seek(pb, file_size, SEEK_SET);
-    return 0;
-}
-
-static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb      = s->pb;
-    AVCodecContext *enc  = s->streams[pkt->stream_index]->codec;
-    FLVContext *flv      = s->priv_data;
-    FLVStreamContext *sc = s->streams[pkt->stream_index]->priv_data;
-    unsigned ts;
-    int size = pkt->size;
-    uint8_t *data = NULL;
-    int flags = 0, flags_size;
-
-    if (enc->codec_id == AV_CODEC_ID_VP6F || enc->codec_id == AV_CODEC_ID_VP6A ||
-        enc->codec_id == AV_CODEC_ID_AAC)
-        flags_size = 2;
-    else if (enc->codec_id == AV_CODEC_ID_H264)
-        flags_size = 5;
-    else
-        flags_size = 1;
-
-    switch (enc->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-        avio_w8(pb, FLV_TAG_TYPE_VIDEO);
-
-        flags = enc->codec_tag;
-        if (flags == 0) {
-            av_log(s, AV_LOG_ERROR,
-                   "video codec %X not compatible with flv\n",
-                   enc->codec_id);
-            return -1;
-        }
-
-        flags |= pkt->flags & AV_PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER;
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        flags = get_audio_flags(s, enc);
-
-        assert(size);
-
-        avio_w8(pb, FLV_TAG_TYPE_AUDIO);
-        break;
-    case AVMEDIA_TYPE_DATA:
-        avio_w8(pb, FLV_TAG_TYPE_META);
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-
-    if (enc->codec_id == AV_CODEC_ID_H264)
-        /* check if extradata looks like MP4 */
-        if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1)
-            if (ff_avc_parse_nal_units_buf(pkt->data, &data, &size) < 0)
-                return -1;
-
-    if (flv->delay == AV_NOPTS_VALUE)
-        flv->delay = -pkt->dts;
-
-    if (pkt->dts < -flv->delay) {
-        av_log(s, AV_LOG_WARNING,
-               "Packets are not in the proper order with respect to DTS\n");
-        return AVERROR(EINVAL);
-    }
-
-    ts = pkt->dts + flv->delay; // add delay to force positive dts
-
-    /* check Speex packet duration */
-    if (enc->codec_id == AV_CODEC_ID_SPEEX && ts - sc->last_ts > 160)
-        av_log(s, AV_LOG_WARNING, "Warning: Speex stream has more than "
-                                  "8 frames per packet. Adobe Flash "
-                                  "Player cannot handle this!\n");
-
-    if (sc->last_ts < ts)
-        sc->last_ts = ts;
-
-    avio_wb24(pb, size + flags_size);
-    avio_wb24(pb, ts);
-    avio_w8(pb, (ts >> 24) & 0x7F); // timestamps are 32 bits _signed_
-    avio_wb24(pb, flv->reserved);
-
-    if (enc->codec_type == AVMEDIA_TYPE_DATA) {
-        int data_size;
-        int64_t metadata_size_pos = avio_tell(pb);
-        avio_w8(pb, AMF_DATA_TYPE_STRING);
-        put_amf_string(pb, "onTextData");
-        avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY);
-        avio_wb32(pb, 2);
-        put_amf_string(pb, "type");
-        avio_w8(pb, AMF_DATA_TYPE_STRING);
-        put_amf_string(pb, "Text");
-        put_amf_string(pb, "text");
-        avio_w8(pb, AMF_DATA_TYPE_STRING);
-        put_amf_string(pb, pkt->data);
-        put_amf_string(pb, "");
-        avio_w8(pb, AMF_END_OF_OBJECT);
-        /* write total size of tag */
-        data_size = avio_tell(pb) - metadata_size_pos;
-        avio_seek(pb, metadata_size_pos - 10, SEEK_SET);
-        avio_wb24(pb, data_size);
-        avio_seek(pb, data_size + 10 - 3, SEEK_CUR);
-        avio_wb32(pb, data_size + 11);
-    } else {
-        avio_w8(pb,flags);
-        if (enc->codec_id == AV_CODEC_ID_VP6F || enc->codec_id == AV_CODEC_ID_VP6A) {
-            if (enc->extradata_size)
-                avio_w8(pb, enc->extradata[0]);
-            else
-                avio_w8(pb, ((FFALIGN(enc->width,  16) - enc->width) << 4) |
-                             (FFALIGN(enc->height, 16) - enc->height));
-        } else if (enc->codec_id == AV_CODEC_ID_AAC)
-            avio_w8(pb, 1); // AAC raw
-        else if (enc->codec_id == AV_CODEC_ID_H264) {
-            avio_w8(pb, 1); // AVC NALU
-            avio_wb24(pb, pkt->pts - pkt->dts);
-        }
-
-        avio_write(pb, data ? data : pkt->data, size);
-
-        avio_wb32(pb, size + flags_size + 11); // previous tag size
-        flv->duration = FFMAX(flv->duration,
-                              pkt->pts + flv->delay + pkt->duration);
-    }
-
-    av_free(data);
-
-    return pb->error;
-}
-
-AVOutputFormat ff_flv_muxer = {
-    .name           = "flv",
-    .long_name      = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
-    .mime_type      = "video/x-flv",
-    .extensions     = "flv",
-    .priv_data_size = sizeof(FLVContext),
-    .audio_codec    = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_ADPCM_SWF,
-    .video_codec    = AV_CODEC_ID_FLV1,
-    .write_header   = flv_write_header,
-    .write_packet   = flv_write_packet,
-    .write_trailer  = flv_write_trailer,
-    .codec_tag      = (const AVCodecTag* const []) {
-                          flv_video_codec_ids, flv_audio_codec_ids, 0
-                      },
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
-                      AVFMT_TS_NONSTRICT,
-};
diff --git a/deps/libav/libavformat/format.c b/deps/libav/libavformat/format.c
deleted file mode 100644
index 3a510cd..0000000
--- a/deps/libav/libavformat/format.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Format register and lookup
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "libavutil/avstring.h"
-
-/**
- * @file
- * Format register and lookup
- */
-/** head of registered input format linked list */
-static AVInputFormat *first_iformat = NULL;
-/** head of registered output format linked list */
-static AVOutputFormat *first_oformat = NULL;
-
-AVInputFormat *av_iformat_next(AVInputFormat *f)
-{
-    if (f)
-        return f->next;
-    else
-        return first_iformat;
-}
-
-AVOutputFormat *av_oformat_next(AVOutputFormat *f)
-{
-    if (f)
-        return f->next;
-    else
-        return first_oformat;
-}
-
-void av_register_input_format(AVInputFormat *format)
-{
-    AVInputFormat **p = &first_iformat;
-
-    while (*p != NULL)
-        p = &(*p)->next;
-
-    *p = format;
-    format->next = NULL;
-}
-
-void av_register_output_format(AVOutputFormat *format)
-{
-    AVOutputFormat **p = &first_oformat;
-
-    while (*p != NULL)
-        p = &(*p)->next;
-
-    *p = format;
-    format->next = NULL;
-}
-
-int av_match_ext(const char *filename, const char *extensions)
-{
-    const char *ext, *p;
-    char ext1[32], *q;
-
-    if (!filename)
-        return 0;
-
-    ext = strrchr(filename, '.');
-    if (ext) {
-        ext++;
-        p = extensions;
-        for (;;) {
-            q = ext1;
-            while (*p != '\0' && *p != ','  && q - ext1 < sizeof(ext1) - 1)
-                *q++ = *p++;
-            *q = '\0';
-            if (!av_strcasecmp(ext1, ext))
-                return 1;
-            if (*p == '\0')
-                break;
-            p++;
-        }
-    }
-    return 0;
-}
-
-static int match_format(const char *name, const char *names)
-{
-    const char *p;
-    int len, namelen;
-
-    if (!name || !names)
-        return 0;
-
-    namelen = strlen(name);
-    while ((p = strchr(names, ','))) {
-        len = FFMAX(p - names, namelen);
-        if (!av_strncasecmp(name, names, len))
-            return 1;
-        names = p + 1;
-    }
-    return !av_strcasecmp(name, names);
-}
-
-AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
-                                const char *mime_type)
-{
-    AVOutputFormat *fmt = NULL, *fmt_found;
-    int score_max, score;
-
-    /* specific test for image sequences */
-#if CONFIG_IMAGE2_MUXER
-    if (!short_name && filename &&
-        av_filename_number_test(filename) &&
-        ff_guess_image2_codec(filename) != AV_CODEC_ID_NONE) {
-        return av_guess_format("image2", NULL, NULL);
-    }
-#endif
-    /* Find the proper file type. */
-    fmt_found = NULL;
-    score_max = 0;
-    while ((fmt = av_oformat_next(fmt))) {
-        score = 0;
-        if (fmt->name && short_name && !av_strcasecmp(fmt->name, short_name))
-            score += 100;
-        if (fmt->mime_type && mime_type && !strcmp(fmt->mime_type, mime_type))
-            score += 10;
-        if (filename && fmt->extensions &&
-            av_match_ext(filename, fmt->extensions)) {
-            score += 5;
-        }
-        if (score > score_max) {
-            score_max = score;
-            fmt_found = fmt;
-        }
-    }
-    return fmt_found;
-}
-
-enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
-                              const char *filename, const char *mime_type,
-                              enum AVMediaType type)
-{
-    if (type == AVMEDIA_TYPE_VIDEO) {
-        enum AVCodecID codec_id = AV_CODEC_ID_NONE;
-
-#if CONFIG_IMAGE2_MUXER
-        if (!strcmp(fmt->name, "image2") || !strcmp(fmt->name, "image2pipe")) {
-            codec_id = ff_guess_image2_codec(filename);
-        }
-#endif
-        if (codec_id == AV_CODEC_ID_NONE)
-            codec_id = fmt->video_codec;
-        return codec_id;
-    } else if (type == AVMEDIA_TYPE_AUDIO)
-        return fmt->audio_codec;
-    else if (type == AVMEDIA_TYPE_SUBTITLE)
-        return fmt->subtitle_codec;
-    else
-        return AV_CODEC_ID_NONE;
-}
-
-AVInputFormat *av_find_input_format(const char *short_name)
-{
-    AVInputFormat *fmt = NULL;
-    while ((fmt = av_iformat_next(fmt)))
-        if (match_format(short_name, fmt->name))
-            return fmt;
-    return NULL;
-}
diff --git a/deps/libav/libavformat/framecrcenc.c b/deps/libav/libavformat/framecrcenc.c
deleted file mode 100644
index dd55c12..0000000
--- a/deps/libav/libavformat/framecrcenc.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * frame CRC encoder (for codec/format testing)
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/adler32.h"
-#include "avformat.h"
-#include "internal.h"
-
-static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    uint32_t crc = av_adler32_update(0, pkt->data, pkt->size);
-    char buf[256];
-
-    snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x\n",
-             pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc);
-    avio_write(s->pb, buf, strlen(buf));
-    return 0;
-}
-
-AVOutputFormat ff_framecrc_muxer = {
-    .name              = "framecrc",
-    .long_name         = NULL_IF_CONFIG_SMALL("framecrc testing"),
-    .extensions        = "",
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
-    .write_header      = ff_framehash_write_header,
-    .write_packet      = framecrc_write_packet,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
-                         AVFMT_TS_NEGATIVE,
-};
diff --git a/deps/libav/libavformat/framehash.c b/deps/libav/libavformat/framehash.c
deleted file mode 100644
index 28e9e84..0000000
--- a/deps/libav/libavformat/framehash.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Common functions for the frame{crc,md5} muxers
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "internal.h"
-
-int ff_framehash_write_header(AVFormatContext *s)
-{
-    int i;
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        avpriv_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
-        avio_printf(s->pb, "#tb %d: %d/%d\n", i, st->time_base.num, st->time_base.den);
-        avio_flush(s->pb);
-    }
-    return 0;
-}
diff --git a/deps/libav/libavformat/g722.c b/deps/libav/libavformat/g722.c
deleted file mode 100644
index 8052939..0000000
--- a/deps/libav/libavformat/g722.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * g722 raw demuxer
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "rawdec.h"
-
-static int g722_read_header(AVFormatContext *s)
-{
-    AVStream *st;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id    = AV_CODEC_ID_ADPCM_G722;
-    st->codec->sample_rate = 16000;
-    st->codec->channels    = 1;
-
-    st->codec->bits_per_coded_sample =
-        av_get_bits_per_sample(st->codec->codec_id);
-
-    assert(st->codec->bits_per_coded_sample > 0);
-
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    return 0;
-}
-
-AVInputFormat ff_g722_demuxer = {
-    .name           = "g722",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw G.722"),
-    .read_header    = g722_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "g722,722",
-    .raw_codec_id   = AV_CODEC_ID_ADPCM_G722,
-};
diff --git a/deps/libav/libavformat/g723_1.c b/deps/libav/libavformat/g723_1.c
deleted file mode 100644
index b67c07c..0000000
--- a/deps/libav/libavformat/g723_1.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * G.723.1 demuxer
- * Copyright (c) 2010 Mohamed Naufal Basheer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * G.723.1 demuxer
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-#include "internal.h"
-
-static const uint8_t frame_size[4] = { 24, 20, 4, 1 };
-
-static av_cold int g723_1_init(AVFormatContext *s)
-{
-    AVStream *st;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type     = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id       = AV_CODEC_ID_G723_1;
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    st->codec->channels       = 1;
-    st->codec->sample_rate    = 8000;
-
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    st->start_time = 0;
-
-    return 0;
-}
-
-static int g723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int size, byte, ret;
-
-    pkt->pos = avio_tell(s->pb);
-    byte     = avio_r8(s->pb);
-    size     = frame_size[byte & 3];
-
-    ret = av_new_packet(pkt, size);
-    if (ret < 0)
-        return ret;
-
-    pkt->data[0]      = byte;
-    pkt->duration     = 240;
-    pkt->stream_index = 0;
-
-    ret = avio_read(s->pb, pkt->data + 1, size - 1);
-    if (ret < size - 1) {
-        av_free_packet(pkt);
-        return ret < 0 ? ret : AVERROR_EOF;
-    }
-
-    return pkt->size;
-}
-
-AVInputFormat ff_g723_1_demuxer = {
-    .name        = "g723_1",
-    .long_name   = NULL_IF_CONFIG_SMALL("G.723.1"),
-    .read_header = g723_1_init,
-    .read_packet = g723_1_read_packet,
-    .extensions  = "tco",
-    .flags       = AVFMT_GENERIC_INDEX
-};
diff --git a/deps/libav/libavformat/gif.c b/deps/libav/libavformat/gif.c
deleted file mode 100644
index 085c2e0..0000000
--- a/deps/libav/libavformat/gif.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Animated GIF muxer
- * Copyright (c) 2000 Fabrice Bellard
- *
- * first version by Francois Revol <revol at free.fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Features and limitations:
- * - currently no compression is performed,
- *   in fact the size of the data is 9/8 the size of the image in 8bpp
- * - uses only a global standard palette
- * - tested with IE 5.0, Opera for BeOS, NetPositive (BeOS), and Mozilla (BeOS).
- *
- * Reference documents:
- * http://www.goice.co.jp/member/mo/formats/gif.html
- * http://astronomy.swin.edu.au/pbourke/dataformats/gif/
- * http://www.dcs.ed.ac.uk/home/mxr/gfx/2d/GIF89a.txt
- *
- * this url claims to have an LZW algorithm not covered by Unisys patent:
- * http://www.msg.net/utility/whirlgif/gifencod.html
- * could help reduce the size of the files _a lot_...
- * some sites mentions an RLE type compression also.
- */
-
-#include "avformat.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-
-/* The GIF format uses reversed order for bitstreams... */
-/* at least they don't use PDP_ENDIAN :) */
-#define BITSTREAM_WRITER_LE
-
-#include "libavcodec/put_bits.h"
-
-/* bitstream minipacket size */
-#define GIF_CHUNKS 100
-
-/* slows down the decoding (and some browsers don't like it) */
-/* update on the 'some browsers don't like it issue from above:
- * this was probably due to missing 'Data Sub-block Terminator'
- * (byte 19) in the app_header */
-#define GIF_ADD_APP_HEADER // required to enable looping of animated gif
-
-typedef struct {
-    unsigned char r;
-    unsigned char g;
-    unsigned char b;
-} rgb_triplet;
-
-/* we use the standard 216 color palette */
-
-/* this script was used to create the palette:
- * for r in 00 33 66 99 cc ff; do
- *     for g in 00 33 66 99 cc ff; do
- *         echo -n "    "
- *         for b in 00 33 66 99 cc ff; do
- *             echo -n "{ 0x$r, 0x$g, 0x$b }, "
- *         done
- *         echo ""
- *     done
- * done
- */
-
-static const rgb_triplet gif_clut[216] = {
-    { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x33 }, { 0x00, 0x00, 0x66 }, { 0x00, 0x00, 0x99 }, { 0x00, 0x00, 0xcc }, { 0x00, 0x00, 0xff },
-    { 0x00, 0x33, 0x00 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x33, 0x66 }, { 0x00, 0x33, 0x99 }, { 0x00, 0x33, 0xcc }, { 0x00, 0x33, 0xff },
-    { 0x00, 0x66, 0x00 }, { 0x00, 0x66, 0x33 }, { 0x00, 0x66, 0x66 }, { 0x00, 0x66, 0x99 }, { 0x00, 0x66, 0xcc }, { 0x00, 0x66, 0xff },
-    { 0x00, 0x99, 0x00 }, { 0x00, 0x99, 0x33 }, { 0x00, 0x99, 0x66 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x99, 0xcc }, { 0x00, 0x99, 0xff },
-    { 0x00, 0xcc, 0x00 }, { 0x00, 0xcc, 0x33 }, { 0x00, 0xcc, 0x66 }, { 0x00, 0xcc, 0x99 }, { 0x00, 0xcc, 0xcc }, { 0x00, 0xcc, 0xff },
-    { 0x00, 0xff, 0x00 }, { 0x00, 0xff, 0x33 }, { 0x00, 0xff, 0x66 }, { 0x00, 0xff, 0x99 }, { 0x00, 0xff, 0xcc }, { 0x00, 0xff, 0xff },
-    { 0x33, 0x00, 0x00 }, { 0x33, 0x00, 0x33 }, { 0x33, 0x00, 0x66 }, { 0x33, 0x00, 0x99 }, { 0x33, 0x00, 0xcc }, { 0x33, 0x00, 0xff },
-    { 0x33, 0x33, 0x00 }, { 0x33, 0x33, 0x33 }, { 0x33, 0x33, 0x66 }, { 0x33, 0x33, 0x99 }, { 0x33, 0x33, 0xcc }, { 0x33, 0x33, 0xff },
-    { 0x33, 0x66, 0x00 }, { 0x33, 0x66, 0x33 }, { 0x33, 0x66, 0x66 }, { 0x33, 0x66, 0x99 }, { 0x33, 0x66, 0xcc }, { 0x33, 0x66, 0xff },
-    { 0x33, 0x99, 0x00 }, { 0x33, 0x99, 0x33 }, { 0x33, 0x99, 0x66 }, { 0x33, 0x99, 0x99 }, { 0x33, 0x99, 0xcc }, { 0x33, 0x99, 0xff },
-    { 0x33, 0xcc, 0x00 }, { 0x33, 0xcc, 0x33 }, { 0x33, 0xcc, 0x66 }, { 0x33, 0xcc, 0x99 }, { 0x33, 0xcc, 0xcc }, { 0x33, 0xcc, 0xff },
-    { 0x33, 0xff, 0x00 }, { 0x33, 0xff, 0x33 }, { 0x33, 0xff, 0x66 }, { 0x33, 0xff, 0x99 }, { 0x33, 0xff, 0xcc }, { 0x33, 0xff, 0xff },
-    { 0x66, 0x00, 0x00 }, { 0x66, 0x00, 0x33 }, { 0x66, 0x00, 0x66 }, { 0x66, 0x00, 0x99 }, { 0x66, 0x00, 0xcc }, { 0x66, 0x00, 0xff },
-    { 0x66, 0x33, 0x00 }, { 0x66, 0x33, 0x33 }, { 0x66, 0x33, 0x66 }, { 0x66, 0x33, 0x99 }, { 0x66, 0x33, 0xcc }, { 0x66, 0x33, 0xff },
-    { 0x66, 0x66, 0x00 }, { 0x66, 0x66, 0x33 }, { 0x66, 0x66, 0x66 }, { 0x66, 0x66, 0x99 }, { 0x66, 0x66, 0xcc }, { 0x66, 0x66, 0xff },
-    { 0x66, 0x99, 0x00 }, { 0x66, 0x99, 0x33 }, { 0x66, 0x99, 0x66 }, { 0x66, 0x99, 0x99 }, { 0x66, 0x99, 0xcc }, { 0x66, 0x99, 0xff },
-    { 0x66, 0xcc, 0x00 }, { 0x66, 0xcc, 0x33 }, { 0x66, 0xcc, 0x66 }, { 0x66, 0xcc, 0x99 }, { 0x66, 0xcc, 0xcc }, { 0x66, 0xcc, 0xff },
-    { 0x66, 0xff, 0x00 }, { 0x66, 0xff, 0x33 }, { 0x66, 0xff, 0x66 }, { 0x66, 0xff, 0x99 }, { 0x66, 0xff, 0xcc }, { 0x66, 0xff, 0xff },
-    { 0x99, 0x00, 0x00 }, { 0x99, 0x00, 0x33 }, { 0x99, 0x00, 0x66 }, { 0x99, 0x00, 0x99 }, { 0x99, 0x00, 0xcc }, { 0x99, 0x00, 0xff },
-    { 0x99, 0x33, 0x00 }, { 0x99, 0x33, 0x33 }, { 0x99, 0x33, 0x66 }, { 0x99, 0x33, 0x99 }, { 0x99, 0x33, 0xcc }, { 0x99, 0x33, 0xff },
-    { 0x99, 0x66, 0x00 }, { 0x99, 0x66, 0x33 }, { 0x99, 0x66, 0x66 }, { 0x99, 0x66, 0x99 }, { 0x99, 0x66, 0xcc }, { 0x99, 0x66, 0xff },
-    { 0x99, 0x99, 0x00 }, { 0x99, 0x99, 0x33 }, { 0x99, 0x99, 0x66 }, { 0x99, 0x99, 0x99 }, { 0x99, 0x99, 0xcc }, { 0x99, 0x99, 0xff },
-    { 0x99, 0xcc, 0x00 }, { 0x99, 0xcc, 0x33 }, { 0x99, 0xcc, 0x66 }, { 0x99, 0xcc, 0x99 }, { 0x99, 0xcc, 0xcc }, { 0x99, 0xcc, 0xff },
-    { 0x99, 0xff, 0x00 }, { 0x99, 0xff, 0x33 }, { 0x99, 0xff, 0x66 }, { 0x99, 0xff, 0x99 }, { 0x99, 0xff, 0xcc }, { 0x99, 0xff, 0xff },
-    { 0xcc, 0x00, 0x00 }, { 0xcc, 0x00, 0x33 }, { 0xcc, 0x00, 0x66 }, { 0xcc, 0x00, 0x99 }, { 0xcc, 0x00, 0xcc }, { 0xcc, 0x00, 0xff },
-    { 0xcc, 0x33, 0x00 }, { 0xcc, 0x33, 0x33 }, { 0xcc, 0x33, 0x66 }, { 0xcc, 0x33, 0x99 }, { 0xcc, 0x33, 0xcc }, { 0xcc, 0x33, 0xff },
-    { 0xcc, 0x66, 0x00 }, { 0xcc, 0x66, 0x33 }, { 0xcc, 0x66, 0x66 }, { 0xcc, 0x66, 0x99 }, { 0xcc, 0x66, 0xcc }, { 0xcc, 0x66, 0xff },
-    { 0xcc, 0x99, 0x00 }, { 0xcc, 0x99, 0x33 }, { 0xcc, 0x99, 0x66 }, { 0xcc, 0x99, 0x99 }, { 0xcc, 0x99, 0xcc }, { 0xcc, 0x99, 0xff },
-    { 0xcc, 0xcc, 0x00 }, { 0xcc, 0xcc, 0x33 }, { 0xcc, 0xcc, 0x66 }, { 0xcc, 0xcc, 0x99 }, { 0xcc, 0xcc, 0xcc }, { 0xcc, 0xcc, 0xff },
-    { 0xcc, 0xff, 0x00 }, { 0xcc, 0xff, 0x33 }, { 0xcc, 0xff, 0x66 }, { 0xcc, 0xff, 0x99 }, { 0xcc, 0xff, 0xcc }, { 0xcc, 0xff, 0xff },
-    { 0xff, 0x00, 0x00 }, { 0xff, 0x00, 0x33 }, { 0xff, 0x00, 0x66 }, { 0xff, 0x00, 0x99 }, { 0xff, 0x00, 0xcc }, { 0xff, 0x00, 0xff },
-    { 0xff, 0x33, 0x00 }, { 0xff, 0x33, 0x33 }, { 0xff, 0x33, 0x66 }, { 0xff, 0x33, 0x99 }, { 0xff, 0x33, 0xcc }, { 0xff, 0x33, 0xff },
-    { 0xff, 0x66, 0x00 }, { 0xff, 0x66, 0x33 }, { 0xff, 0x66, 0x66 }, { 0xff, 0x66, 0x99 }, { 0xff, 0x66, 0xcc }, { 0xff, 0x66, 0xff },
-    { 0xff, 0x99, 0x00 }, { 0xff, 0x99, 0x33 }, { 0xff, 0x99, 0x66 }, { 0xff, 0x99, 0x99 }, { 0xff, 0x99, 0xcc }, { 0xff, 0x99, 0xff },
-    { 0xff, 0xcc, 0x00 }, { 0xff, 0xcc, 0x33 }, { 0xff, 0xcc, 0x66 }, { 0xff, 0xcc, 0x99 }, { 0xff, 0xcc, 0xcc }, { 0xff, 0xcc, 0xff },
-    { 0xff, 0xff, 0x00 }, { 0xff, 0xff, 0x33 }, { 0xff, 0xff, 0x66 }, { 0xff, 0xff, 0x99 }, { 0xff, 0xff, 0xcc }, { 0xff, 0xff, 0xff },
-};
-
-/* GIF header */
-static int gif_image_write_header(AVIOContext *pb, int width, int height,
-                                  int loop_count, uint32_t *palette)
-{
-    int i;
-    unsigned int v;
-
-    avio_write(pb, "GIF", 3);
-    avio_write(pb, "89a", 3);
-    avio_wl16(pb, width);
-    avio_wl16(pb, height);
-
-    avio_w8(pb, 0xf7); /* flags: global clut, 256 entries */
-    avio_w8(pb, 0x1f); /* background color index */
-    avio_w8(pb, 0);    /* aspect ratio */
-
-    /* the global palette */
-    if (!palette) {
-        avio_write(pb, (const unsigned char *)gif_clut, 216 * 3);
-        for (i = 0; i < ((256 - 216) * 3); i++)
-            avio_w8(pb, 0);
-    } else {
-        for (i = 0; i < 256; i++) {
-            v = palette[i];
-            avio_w8(pb, (v >> 16) & 0xff);
-            avio_w8(pb, (v >>  8) & 0xff);
-            avio_w8(pb, (v)       & 0xff);
-        }
-    }
-
-    /* update: this is the 'NETSCAPE EXTENSION' that allows for looped animated
-     * GIF, see http://members.aol.com/royalef/gifabout.htm#net-extension
-     *
-     * byte   1       : 33 (hex 0x21) GIF Extension code
-     * byte   2       : 255 (hex 0xFF) Application Extension Label
-     * byte   3       : 11 (hex (0x0B) Length of Application Block
-     *                          (eleven bytes of data to follow)
-     * bytes  4 to 11 : "NETSCAPE"
-     * bytes 12 to 14 : "2.0"
-     * byte  15       : 3 (hex 0x03) Length of Data Sub-Block
-     *                          (three bytes of data to follow)
-     * byte  16       : 1 (hex 0x01)
-     * bytes 17 to 18 : 0 to 65535, an unsigned integer in
-     *                          lo-hi byte format. This indicate the
-     *                          number of iterations the loop should
-     *                          be executed.
-     * bytes 19       : 0 (hex 0x00) a Data Sub-block Terminator
-     */
-
-    /* application extension header */
-#ifdef GIF_ADD_APP_HEADER
-    if (loop_count >= 0 && loop_count <= 65535) {
-        avio_w8(pb, 0x21);
-        avio_w8(pb, 0xff);
-        avio_w8(pb, 0x0b);
-        // bytes 4 to 14
-        avio_write(pb, "NETSCAPE2.0", sizeof("NETSCAPE2.0") - 1);
-        avio_w8(pb, 0x03); // byte 15
-        avio_w8(pb, 0x01); // byte 16
-        avio_wl16(pb, (uint16_t)loop_count);
-        avio_w8(pb, 0x00); // byte 19
-    }
-#endif
-    return 0;
-}
-
-/* this is maybe slow, but allows for extensions */
-static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)
-{
-    return (((r) / 47) % 6) * 6 * 6 + (((g) / 47) % 6) * 6 + (((b) / 47) % 6);
-}
-
-static int gif_image_write_image(AVIOContext *pb,
-                                 int x1, int y1, int width, int height,
-                                 const uint8_t *buf, int linesize, int pix_fmt)
-{
-    PutBitContext p;
-    uint8_t buffer[200]; /* 100 * 9 / 8 = 113 */
-    int i, left, w, v;
-    const uint8_t *ptr;
-    /* image block */
-
-    avio_w8(pb, 0x2c);
-    avio_wl16(pb, x1);
-    avio_wl16(pb, y1);
-    avio_wl16(pb, width);
-    avio_wl16(pb, height);
-    avio_w8(pb, 0x00); /* flags */
-    /* no local clut */
-
-    avio_w8(pb, 0x08);
-
-    left = width * height;
-
-    init_put_bits(&p, buffer, 130);
-
-/*
- * the thing here is the bitstream is written as little packets, with a size
- * byte before but it's still the same bitstream between packets (no flush !)
- */
-    ptr = buf;
-    w   = width;
-    while (left > 0) {
-        put_bits(&p, 9, 0x0100); /* clear code */
-
-        for (i = (left < GIF_CHUNKS) ? left : GIF_CHUNKS; i; i--) {
-            if (pix_fmt == AV_PIX_FMT_RGB24) {
-                v    = gif_clut_index(ptr[0], ptr[1], ptr[2]);
-                ptr += 3;
-            } else {
-                v = *ptr++;
-            }
-            put_bits(&p, 9, v);
-            if (--w == 0) {
-                w    = width;
-                buf += linesize;
-                ptr  = buf;
-            }
-        }
-
-        if (left <= GIF_CHUNKS) {
-            put_bits(&p, 9, 0x101); /* end of stream */
-            flush_put_bits(&p);
-        }
-        if (put_bits_ptr(&p) - p.buf > 0) {
-            avio_w8(pb, put_bits_ptr(&p) - p.buf); /* byte count of the packet */
-            avio_write(pb, p.buf, put_bits_ptr(&p) - p.buf); /* the actual buffer */
-            p.buf_ptr = p.buf; /* dequeue the bytes off the bitstream */
-        }
-        left -= GIF_CHUNKS;
-    }
-    avio_w8(pb, 0x00); /* end of image block */
-
-    return 0;
-}
-
-typedef struct {
-    AVClass *class;         /** Class for private options. */
-    int64_t time, file_time;
-    uint8_t buffer[100]; /* data chunks */
-    int loop;
-} GIFContext;
-
-static int gif_write_header(AVFormatContext *s)
-{
-    GIFContext *gif = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVCodecContext *enc, *video_enc;
-    int i, width, height /*, rate*/;
-
-/* XXX: do we reject audio streams or just ignore them ?
- *  if (s->nb_streams > 1)
- *      return -1;
- */
-    gif->time      = 0;
-    gif->file_time = 0;
-
-    video_enc = NULL;
-    for (i = 0; i < s->nb_streams; i++) {
-        enc = s->streams[i]->codec;
-        if (enc->codec_type != AVMEDIA_TYPE_AUDIO)
-            video_enc = enc;
-    }
-
-    if (!video_enc) {
-        av_free(gif);
-        return -1;
-    } else {
-        width  = video_enc->width;
-        height = video_enc->height;
-//        rate = video_enc->time_base.den;
-    }
-
-    if (video_enc->pix_fmt != AV_PIX_FMT_RGB24) {
-        av_log(s, AV_LOG_ERROR,
-               "ERROR: gif only handles the rgb24 pixel format. Use -pix_fmt rgb24.\n");
-        return AVERROR(EIO);
-    }
-
-    gif_image_write_header(pb, width, height, gif->loop, NULL);
-
-    avio_flush(s->pb);
-    return 0;
-}
-
-static int gif_write_video(AVFormatContext *s, AVCodecContext *enc,
-                           const uint8_t *buf, int size)
-{
-    AVIOContext *pb = s->pb;
-    int jiffies;
-
-    /* graphic control extension block */
-    avio_w8(pb, 0x21);
-    avio_w8(pb, 0xf9);
-    avio_w8(pb, 0x04); /* block size */
-    avio_w8(pb, 0x04); /* flags */
-
-    /* 1 jiffy is 1/70 s */
-    /* the delay_time field indicates the number of jiffies - 1 */
-    /* XXX: should use delay, in order to be more accurate */
-    /* instead of using the same rounded value each time */
-    /* XXX: don't even remember if I really use it for now */
-    jiffies = (70 * enc->time_base.num / enc->time_base.den) - 1;
-
-    avio_wl16(pb, jiffies);
-
-    avio_w8(pb, 0x1f); /* transparent color index */
-    avio_w8(pb, 0x00);
-
-    gif_image_write_image(pb, 0, 0, enc->width, enc->height,
-                          buf, enc->width * 3, AV_PIX_FMT_RGB24);
-
-    return 0;
-}
-
-static int gif_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
-    if (codec->codec_type == AVMEDIA_TYPE_AUDIO)
-        return 0; /* just ignore audio */
-    else
-        return gif_write_video(s, codec, pkt->data, pkt->size);
-}
-
-static int gif_write_trailer(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-
-    avio_w8(pb, 0x3b);
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(GIFContext, x)
-#define ENC AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "loop", "Number of times to loop the output.", OFFSET(loop),
-      AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 65535, ENC },
-    { NULL },
-};
-
-static const AVClass gif_muxer_class = {
-    .class_name = "GIF muxer",
-    .item_name  = av_default_item_name,
-    .version    = LIBAVUTIL_VERSION_INT,
-    .option     = options,
-};
-
-AVOutputFormat ff_gif_muxer = {
-    .name           = "gif",
-    .long_name      = NULL_IF_CONFIG_SMALL("GIF Animation"),
-    .mime_type      = "image/gif",
-    .extensions     = "gif",
-    .priv_data_size = sizeof(GIFContext),
-    .audio_codec    = AV_CODEC_ID_NONE,
-    .video_codec    = AV_CODEC_ID_RAWVIDEO,
-    .write_header   = gif_write_header,
-    .write_packet   = gif_write_packet,
-    .write_trailer  = gif_write_trailer,
-    .priv_class     = &gif_muxer_class,
-};
diff --git a/deps/libav/libavformat/gopher.c b/deps/libav/libavformat/gopher.c
deleted file mode 100644
index a149f7f..0000000
--- a/deps/libav/libavformat/gopher.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Gopher protocol
- *
- * Copyright (c) 2009 Toshimitsu Kimura
- *
- * based on libavformat/http.c, Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "avformat.h"
-#include "internal.h"
-#include "network.h"
-#include "url.h"
-
-typedef struct {
-    URLContext *hd;
-} GopherContext;
-
-static int gopher_write(URLContext *h, const uint8_t *buf, int size)
-{
-    GopherContext *s = h->priv_data;
-    return ffurl_write(s->hd, buf, size);
-}
-
-static int gopher_connect(URLContext *h, const char *path)
-{
-    char buffer[1024];
-
-    if (!*path) return AVERROR(EINVAL);
-    switch (*++path) {
-        case '5':
-        case '9':
-            path = strchr(path, '/');
-            if (!path) return AVERROR(EINVAL);
-            break;
-        default:
-            av_log(h, AV_LOG_WARNING,
-                   "Gopher protocol type '%c' not supported yet!\n",
-                   *path);
-            return AVERROR(EINVAL);
-    }
-
-    /* send gopher sector */
-    snprintf(buffer, sizeof(buffer), "%s\r\n", path);
-
-    if (gopher_write(h, buffer, strlen(buffer)) < 0)
-        return AVERROR(EIO);
-
-    return 0;
-}
-
-static int gopher_close(URLContext *h)
-{
-    GopherContext *s = h->priv_data;
-    if (s->hd) {
-        ffurl_close(s->hd);
-        s->hd = NULL;
-    }
-    return 0;
-}
-
-static int gopher_open(URLContext *h, const char *uri, int flags)
-{
-    GopherContext *s = h->priv_data;
-    char hostname[1024], auth[1024], path[1024], buf[1024];
-    int port, err;
-
-    h->is_streamed = 1;
-
-    /* needed in any case to build the host string */
-    av_url_split(NULL, 0, auth, sizeof(auth), hostname, sizeof(hostname), &port,
-                 path, sizeof(path), uri);
-
-    if (port < 0)
-        port = 70;
-
-    ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
-
-    s->hd = NULL;
-    err = ffurl_open(&s->hd, buf, AVIO_FLAG_READ_WRITE,
-                     &h->interrupt_callback, NULL);
-    if (err < 0)
-        goto fail;
-
-    if ((err = gopher_connect(h, path)) < 0)
-        goto fail;
-    return 0;
- fail:
-    gopher_close(h);
-    return err;
-}
-
-static int gopher_read(URLContext *h, uint8_t *buf, int size)
-{
-    GopherContext *s = h->priv_data;
-    int len = ffurl_read(s->hd, buf, size);
-    return len;
-}
-
-
-URLProtocol ff_gopher_protocol = {
-    .name           = "gopher",
-    .url_open       = gopher_open,
-    .url_read       = gopher_read,
-    .url_write      = gopher_write,
-    .url_close      = gopher_close,
-    .priv_data_size = sizeof(GopherContext),
-    .flags          = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/gsmdec.c b/deps/libav/libavformat/gsmdec.c
deleted file mode 100644
index f9ecbaf..0000000
--- a/deps/libav/libavformat/gsmdec.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * RAW GSM demuxer
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define GSM_BLOCK_SIZE    33
-#define GSM_BLOCK_SAMPLES 160
-#define GSM_SAMPLE_RATE   8000
-
-typedef struct {
-    AVClass *class;
-    int sample_rate;
-} GSMDemuxerContext;
-
-static int gsm_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, size;
-
-    size = GSM_BLOCK_SIZE;
-
-    pkt->pos = avio_tell(s->pb);
-    pkt->stream_index = 0;
-
-    ret = av_get_packet(s->pb, pkt, size);
-    if (ret < GSM_BLOCK_SIZE) {
-        av_free_packet(pkt);
-        return ret < 0 ? ret : AVERROR(EIO);
-    }
-    pkt->size     = ret;
-    pkt->duration = 1;
-    pkt->pts      = pkt->pos / GSM_BLOCK_SIZE;
-
-    return 0;
-}
-
-static int gsm_read_header(AVFormatContext *s)
-{
-    GSMDemuxerContext *c = s->priv_data;
-    AVStream *st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id    = s->iformat->raw_codec_id;
-    st->codec->channels    = 1;
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    st->codec->sample_rate = c->sample_rate;
-    st->codec->bit_rate    = GSM_BLOCK_SIZE * 8 * c->sample_rate / GSM_BLOCK_SAMPLES;
-
-    avpriv_set_pts_info(st, 64, GSM_BLOCK_SAMPLES, GSM_SAMPLE_RATE);
-
-    return 0;
-}
-
-static const AVOption options[] = {
-    { "sample_rate", "", offsetof(GSMDemuxerContext, sample_rate),
-       AV_OPT_TYPE_INT, {.i64 = GSM_SAMPLE_RATE}, 1, INT_MAX / GSM_BLOCK_SIZE,
-       AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-static const AVClass class = {
-    .class_name = "gsm demuxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_gsm_demuxer = {
-    .name           = "gsm",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw GSM"),
-    .priv_data_size = sizeof(GSMDemuxerContext),
-    .read_header    = gsm_read_header,
-    .read_packet    = gsm_read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "gsm",
-    .raw_codec_id   = AV_CODEC_ID_GSM,
-    .priv_class     = &class,
-};
diff --git a/deps/libav/libavformat/gxf.c b/deps/libav/libavformat/gxf.c
deleted file mode 100644
index 6feb3c3..0000000
--- a/deps/libav/libavformat/gxf.c
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * GXF demuxer.
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/common.h"
-#include "avformat.h"
-#include "internal.h"
-#include "gxf.h"
-#include "libavcodec/mpeg12data.h"
-
-struct gxf_stream_info {
-    int64_t first_field;
-    int64_t last_field;
-    AVRational frames_per_second;
-    int32_t fields_per_frame;
-};
-
-/**
- * @brief parses a packet header, extracting type and length
- * @param pb AVIOContext to read header from
- * @param type detected packet type is stored here
- * @param length detected packet length, excluding header is stored here
- * @return 0 if header not found or contains invalid data, 1 otherwise
- */
-static int parse_packet_header(AVIOContext *pb, GXFPktType *type, int *length) {
-    if (avio_rb32(pb))
-        return 0;
-    if (avio_r8(pb) != 1)
-        return 0;
-    *type = avio_r8(pb);
-    *length = avio_rb32(pb);
-    if ((*length >> 24) || *length < 16)
-        return 0;
-    *length -= 16;
-    if (avio_rb32(pb))
-        return 0;
-    if (avio_r8(pb) != 0xe1)
-        return 0;
-    if (avio_r8(pb) != 0xe2)
-        return 0;
-    return 1;
-}
-
-/**
- * @brief check if file starts with a PKT_MAP header
- */
-static int gxf_probe(AVProbeData *p) {
-    static const uint8_t startcode[] = {0, 0, 0, 0, 1, 0xbc}; // start with map packet
-    static const uint8_t endcode[] = {0, 0, 0, 0, 0xe1, 0xe2};
-    if (!memcmp(p->buf, startcode, sizeof(startcode)) &&
-        !memcmp(&p->buf[16 - sizeof(endcode)], endcode, sizeof(endcode)))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-/**
- * @brief gets the stream index for the track with the specified id, creates new
- *        stream if not found
- * @param id     id of stream to find / add
- * @param format stream format identifier
- */
-static int get_sindex(AVFormatContext *s, int id, int format) {
-    int i;
-    AVStream *st = NULL;
-    i = ff_find_stream_index(s, id);
-    if (i >= 0)
-        return i;
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->id = id;
-    switch (format) {
-        case 3:
-        case 4:
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_id = AV_CODEC_ID_MJPEG;
-            break;
-        case 13:
-        case 15:
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_id = AV_CODEC_ID_DVVIDEO;
-            break;
-        case 14:
-        case 16:
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_id = AV_CODEC_ID_DVVIDEO;
-            break;
-        case 11:
-        case 12:
-        case 20:
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_id = AV_CODEC_ID_MPEG2VIDEO;
-            st->need_parsing = AVSTREAM_PARSE_HEADERS; //get keyframe flag etc.
-            break;
-        case 22:
-        case 23:
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_id = AV_CODEC_ID_MPEG1VIDEO;
-            st->need_parsing = AVSTREAM_PARSE_HEADERS; //get keyframe flag etc.
-            break;
-        case 9:
-            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            st->codec->codec_id = AV_CODEC_ID_PCM_S24LE;
-            st->codec->channels = 1;
-            st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-            st->codec->sample_rate = 48000;
-            st->codec->bit_rate = 3 * 1 * 48000 * 8;
-            st->codec->block_align = 3 * 1;
-            st->codec->bits_per_coded_sample = 24;
-            break;
-        case 10:
-            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
-            st->codec->channels = 1;
-            st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-            st->codec->sample_rate = 48000;
-            st->codec->bit_rate = 2 * 1 * 48000 * 8;
-            st->codec->block_align = 2 * 1;
-            st->codec->bits_per_coded_sample = 16;
-            break;
-        case 17:
-            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            st->codec->codec_id = AV_CODEC_ID_AC3;
-            st->codec->channels = 2;
-            st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-            st->codec->sample_rate = 48000;
-            break;
-        // timecode tracks:
-        case 7:
-        case 8:
-        case 24:
-            st->codec->codec_type = AVMEDIA_TYPE_DATA;
-            st->codec->codec_id = AV_CODEC_ID_NONE;
-            break;
-        default:
-            st->codec->codec_type = AVMEDIA_TYPE_UNKNOWN;
-            st->codec->codec_id = AV_CODEC_ID_NONE;
-            break;
-    }
-    return s->nb_streams - 1;
-}
-
-/**
- * @brief filters out interesting tags from material information.
- * @param len length of tag section, will be adjusted to contain remaining bytes
- * @param si struct to store collected information into
- */
-static void gxf_material_tags(AVIOContext *pb, int *len, struct gxf_stream_info *si) {
-    si->first_field = AV_NOPTS_VALUE;
-    si->last_field = AV_NOPTS_VALUE;
-    while (*len >= 2) {
-        GXFMatTag tag = avio_r8(pb);
-        int tlen = avio_r8(pb);
-        *len -= 2;
-        if (tlen > *len)
-            return;
-        *len -= tlen;
-        if (tlen == 4) {
-            uint32_t value = avio_rb32(pb);
-            if (tag == MAT_FIRST_FIELD)
-                si->first_field = value;
-            else if (tag == MAT_LAST_FIELD)
-                si->last_field = value;
-        } else
-            avio_skip(pb, tlen);
-    }
-}
-
-static const AVRational frame_rate_tab[] = {
-    {   60,    1},
-    {60000, 1001},
-    {   50,    1},
-    {   30,    1},
-    {30000, 1001},
-    {   25,    1},
-    {   24,    1},
-    {24000, 1001},
-    {    0,    0},
-};
-
-/**
- * @brief convert fps tag value to AVRational fps
- * @param fps fps value from tag
- * @return fps as AVRational, or 0 / 0 if unknown
- */
-static AVRational fps_tag2avr(int32_t fps) {
-    if (fps < 1 || fps > 9) fps = 9;
-    return frame_rate_tab[fps - 1];
-}
-
-/**
- * @brief convert UMF attributes flags to AVRational fps
- * @param flags UMF flags to convert
- * @return fps as AVRational, or 0 / 0 if unknown
- */
-static AVRational fps_umf2avr(uint32_t flags) {
-    static const AVRational map[] = {{50, 1}, {60000, 1001}, {24, 1},
-        {25, 1}, {30000, 1001}};
-    int idx =  av_log2((flags & 0x7c0) >> 6);
-    return map[idx];
-}
-
-/**
- * @brief filters out interesting tags from track information.
- * @param len length of tag section, will be adjusted to contain remaining bytes
- * @param si struct to store collected information into
- */
-static void gxf_track_tags(AVIOContext *pb, int *len, struct gxf_stream_info *si) {
-    si->frames_per_second = (AVRational){0, 0};
-    si->fields_per_frame = 0;
-    while (*len >= 2) {
-        GXFTrackTag tag = avio_r8(pb);
-        int tlen = avio_r8(pb);
-        *len -= 2;
-        if (tlen > *len)
-            return;
-        *len -= tlen;
-        if (tlen == 4) {
-            uint32_t value = avio_rb32(pb);
-            if (tag == TRACK_FPS)
-                si->frames_per_second = fps_tag2avr(value);
-            else if (tag == TRACK_FPF && (value == 1 || value == 2))
-                si->fields_per_frame = value;
-        } else
-            avio_skip(pb, tlen);
-    }
-}
-
-/**
- * @brief read index from FLT packet into stream 0 av_index
- */
-static void gxf_read_index(AVFormatContext *s, int pkt_len) {
-    AVIOContext *pb = s->pb;
-    AVStream *st = s->streams[0];
-    uint32_t fields_per_map = avio_rl32(pb);
-    uint32_t map_cnt = avio_rl32(pb);
-    int i;
-    pkt_len -= 8;
-    if (s->flags & AVFMT_FLAG_IGNIDX) {
-        avio_skip(pb, pkt_len);
-        return;
-    }
-    if (map_cnt > 1000) {
-        av_log(s, AV_LOG_ERROR, "too many index entries %u (%x)\n", map_cnt, map_cnt);
-        map_cnt = 1000;
-    }
-    if (pkt_len < 4 * map_cnt) {
-        av_log(s, AV_LOG_ERROR, "invalid index length\n");
-        avio_skip(pb, pkt_len);
-        return;
-    }
-    pkt_len -= 4 * map_cnt;
-    av_add_index_entry(st, 0, 0, 0, 0, 0);
-    for (i = 0; i < map_cnt; i++)
-        av_add_index_entry(st, (uint64_t)avio_rl32(pb) * 1024,
-                           i * (uint64_t)fields_per_map + 1, 0, 0, 0);
-    avio_skip(pb, pkt_len);
-}
-
-static int gxf_header(AVFormatContext *s) {
-    AVIOContext *pb = s->pb;
-    GXFPktType pkt_type;
-    int map_len;
-    int len;
-    AVRational main_timebase = {0, 0};
-    struct gxf_stream_info *si = s->priv_data;
-    int i;
-    if (!parse_packet_header(pb, &pkt_type, &map_len) || pkt_type != PKT_MAP) {
-        av_log(s, AV_LOG_ERROR, "map packet not found\n");
-        return 0;
-    }
-    map_len -= 2;
-    if (avio_r8(pb) != 0x0e0 || avio_r8(pb) != 0xff) {
-        av_log(s, AV_LOG_ERROR, "unknown version or invalid map preamble\n");
-        return 0;
-    }
-    map_len -= 2;
-    len = avio_rb16(pb); // length of material data section
-    if (len > map_len) {
-        av_log(s, AV_LOG_ERROR, "material data longer than map data\n");
-        return 0;
-    }
-    map_len -= len;
-    gxf_material_tags(pb, &len, si);
-    avio_skip(pb, len);
-    map_len -= 2;
-    len = avio_rb16(pb); // length of track description
-    if (len > map_len) {
-        av_log(s, AV_LOG_ERROR, "track description longer than map data\n");
-        return 0;
-    }
-    map_len -= len;
-    while (len > 0) {
-        int track_type, track_id, track_len;
-        AVStream *st;
-        int idx;
-        len -= 4;
-        track_type = avio_r8(pb);
-        track_id = avio_r8(pb);
-        track_len = avio_rb16(pb);
-        len -= track_len;
-        gxf_track_tags(pb, &track_len, si);
-        avio_skip(pb, track_len);
-        if (!(track_type & 0x80)) {
-           av_log(s, AV_LOG_ERROR, "invalid track type %x\n", track_type);
-           continue;
-        }
-        track_type &= 0x7f;
-        if ((track_id & 0xc0) != 0xc0) {
-           av_log(s, AV_LOG_ERROR, "invalid track id %x\n", track_id);
-           continue;
-        }
-        track_id &= 0x3f;
-        idx = get_sindex(s, track_id, track_type);
-        if (idx < 0) continue;
-        st = s->streams[idx];
-        if (!main_timebase.num || !main_timebase.den) {
-            main_timebase.num = si->frames_per_second.den;
-            main_timebase.den = si->frames_per_second.num * 2;
-        }
-        st->start_time = si->first_field;
-        if (si->first_field != AV_NOPTS_VALUE && si->last_field != AV_NOPTS_VALUE)
-            st->duration = si->last_field - si->first_field;
-    }
-    if (len < 0)
-        av_log(s, AV_LOG_ERROR, "invalid track description length specified\n");
-    if (map_len)
-        avio_skip(pb, map_len);
-    if (!parse_packet_header(pb, &pkt_type, &len)) {
-        av_log(s, AV_LOG_ERROR, "sync lost in header\n");
-        return -1;
-    }
-    if (pkt_type == PKT_FLT) {
-        gxf_read_index(s, len);
-        if (!parse_packet_header(pb, &pkt_type, &len)) {
-            av_log(s, AV_LOG_ERROR, "sync lost in header\n");
-            return -1;
-        }
-    }
-    if (pkt_type == PKT_UMF) {
-        if (len >= 0x39) {
-            AVRational fps;
-            len -= 0x39;
-            avio_skip(pb, 5); // preamble
-            avio_skip(pb, 0x30); // payload description
-            fps = fps_umf2avr(avio_rl32(pb));
-            if (!main_timebase.num || !main_timebase.den) {
-                // this may not always be correct, but simply the best we can get
-                main_timebase.num = fps.den;
-                main_timebase.den = fps.num * 2;
-            }
-        } else
-            av_log(s, AV_LOG_INFO, "UMF packet too short\n");
-    } else
-        av_log(s, AV_LOG_INFO, "UMF packet missing\n");
-    avio_skip(pb, len);
-    // set a fallback value, 60000/1001 is specified for audio-only files
-    // so use that regardless of why we do not know the video frame rate.
-    if (!main_timebase.num || !main_timebase.den)
-        main_timebase = (AVRational){1001, 60000};
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        avpriv_set_pts_info(st, 32, main_timebase.num, main_timebase.den);
-    }
-    return 0;
-}
-
-#define READ_ONE() \
-    { \
-        if (!max_interval-- || pb->eof_reached) \
-            goto out; \
-        tmp = tmp << 8 | avio_r8(pb); \
-    }
-
-/**
- * @brief resync the stream on the next media packet with specified properties
- * @param max_interval how many bytes to search for matching packet at most
- * @param track track id the media packet must belong to, -1 for any
- * @param timestamp minimum timestamp (== field number) the packet must have, -1 for any
- * @return timestamp of packet found
- */
-static int64_t gxf_resync_media(AVFormatContext *s, uint64_t max_interval, int track, int timestamp) {
-    uint32_t tmp;
-    uint64_t last_pos;
-    uint64_t last_found_pos = 0;
-    int cur_track;
-    int64_t cur_timestamp = AV_NOPTS_VALUE;
-    int len;
-    AVIOContext *pb = s->pb;
-    GXFPktType type;
-    tmp = avio_rb32(pb);
-start:
-    while (tmp)
-        READ_ONE();
-    READ_ONE();
-    if (tmp != 1)
-        goto start;
-    last_pos = avio_tell(pb);
-    if (avio_seek(pb, -5, SEEK_CUR) < 0)
-        goto out;
-    if (!parse_packet_header(pb, &type, &len) || type != PKT_MEDIA) {
-        if (avio_seek(pb, last_pos, SEEK_SET) < 0)
-            goto out;
-        goto start;
-    }
-    avio_r8(pb);
-    cur_track = avio_r8(pb);
-    cur_timestamp = avio_rb32(pb);
-    last_found_pos = avio_tell(pb) - 16 - 6;
-    if ((track >= 0 && track != cur_track) || (timestamp >= 0 && timestamp > cur_timestamp)) {
-        if (avio_seek(pb, last_pos, SEEK_SET) >= 0)
-            goto start;
-    }
-out:
-    if (last_found_pos)
-        avio_seek(pb, last_found_pos, SEEK_SET);
-    return cur_timestamp;
-}
-
-static int gxf_packet(AVFormatContext *s, AVPacket *pkt) {
-    AVIOContext *pb = s->pb;
-    GXFPktType pkt_type;
-    int pkt_len;
-    struct gxf_stream_info *si = s->priv_data;
-
-    while (!pb->eof_reached) {
-        AVStream *st;
-        int track_type, track_id, ret;
-        int field_nr, field_info, skip = 0;
-        int stream_index;
-        if (!parse_packet_header(pb, &pkt_type, &pkt_len)) {
-            if (!pb->eof_reached)
-                av_log(s, AV_LOG_ERROR, "sync lost\n");
-            return -1;
-        }
-        if (pkt_type == PKT_FLT) {
-            gxf_read_index(s, pkt_len);
-            continue;
-        }
-        if (pkt_type != PKT_MEDIA) {
-            avio_skip(pb, pkt_len);
-            continue;
-        }
-        if (pkt_len < 16) {
-            av_log(s, AV_LOG_ERROR, "invalid media packet length\n");
-            continue;
-        }
-        pkt_len -= 16;
-        track_type = avio_r8(pb);
-        track_id = avio_r8(pb);
-        stream_index = get_sindex(s, track_id, track_type);
-        if (stream_index < 0)
-            return stream_index;
-        st = s->streams[stream_index];
-        field_nr = avio_rb32(pb);
-        field_info = avio_rb32(pb);
-        avio_rb32(pb); // "timeline" field number
-        avio_r8(pb); // flags
-        avio_r8(pb); // reserved
-        if (st->codec->codec_id == AV_CODEC_ID_PCM_S24LE ||
-            st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
-            int first = field_info >> 16;
-            int last  = field_info & 0xffff; // last is exclusive
-            int bps = av_get_bits_per_sample(st->codec->codec_id)>>3;
-            if (first <= last && last*bps <= pkt_len) {
-                avio_skip(pb, first*bps);
-                skip = pkt_len - last*bps;
-                pkt_len = (last-first)*bps;
-            } else
-                av_log(s, AV_LOG_ERROR, "invalid first and last sample values\n");
-        }
-        ret = av_get_packet(pb, pkt, pkt_len);
-        if (skip)
-            avio_skip(pb, skip);
-        pkt->stream_index = stream_index;
-        pkt->dts = field_nr;
-
-        //set duration manually for DV or else lavf misdetects the frame rate
-        if (st->codec->codec_id == AV_CODEC_ID_DVVIDEO)
-            pkt->duration = si->fields_per_frame;
-
-        return ret;
-    }
-    return AVERROR(EIO);
-}
-
-static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) {
-    int res = 0;
-    uint64_t pos;
-    uint64_t maxlen = 100 * 1024 * 1024;
-    AVStream *st = s->streams[0];
-    int64_t start_time = s->streams[stream_index]->start_time;
-    int64_t found;
-    int idx;
-    if (timestamp < start_time) timestamp = start_time;
-    idx = av_index_search_timestamp(st, timestamp - start_time,
-                                    AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWARD);
-    if (idx < 0)
-        return -1;
-    pos = st->index_entries[idx].pos;
-    if (idx < st->nb_index_entries - 2)
-        maxlen = st->index_entries[idx + 2].pos - pos;
-    maxlen = FFMAX(maxlen, 200 * 1024);
-    res = avio_seek(s->pb, pos, SEEK_SET);
-    if (res < 0)
-        return res;
-    found = gxf_resync_media(s, maxlen, -1, timestamp);
-    if (FFABS(found - timestamp) > 4)
-        return -1;
-    return 0;
-}
-
-static int64_t gxf_read_timestamp(AVFormatContext *s, int stream_index,
-                                  int64_t *pos, int64_t pos_limit) {
-    AVIOContext *pb = s->pb;
-    int64_t res;
-    if (avio_seek(pb, *pos, SEEK_SET) < 0)
-        return AV_NOPTS_VALUE;
-    res = gxf_resync_media(s, pos_limit - *pos, -1, -1);
-    *pos = avio_tell(pb);
-    return res;
-}
-
-AVInputFormat ff_gxf_demuxer = {
-    .name           = "gxf",
-    .long_name      = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
-    .priv_data_size = sizeof(struct gxf_stream_info),
-    .read_probe     = gxf_probe,
-    .read_header    = gxf_header,
-    .read_packet    = gxf_packet,
-    .read_seek      = gxf_seek,
-    .read_timestamp = gxf_read_timestamp,
-};
diff --git a/deps/libav/libavformat/gxf.h b/deps/libav/libavformat/gxf.h
deleted file mode 100644
index c1ac399..0000000
--- a/deps/libav/libavformat/gxf.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * GXF demuxer
- * copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_GXF_H
-#define AVFORMAT_GXF_H
-
-typedef enum {
-    PKT_MAP         = 0xbc,
-    PKT_MEDIA       = 0xbf,
-    PKT_EOS         = 0xfb,
-    PKT_FLT         = 0xfc,
-    PKT_UMF         = 0xfd,
-} GXFPktType;
-
-typedef enum {
-    MAT_NAME        = 0x40,
-    MAT_FIRST_FIELD = 0x41,
-    MAT_LAST_FIELD  = 0x42,
-    MAT_MARK_IN     = 0x43,
-    MAT_MARK_OUT    = 0x44,
-    MAT_SIZE        = 0x45,
-} GXFMatTag;
-
-typedef enum {
-    TRACK_NAME      = 0x4c,
-    TRACK_AUX       = 0x4d,
-    TRACK_VER       = 0x4e,
-    TRACK_MPG_AUX   = 0x4f,
-    TRACK_FPS       = 0x50,
-    TRACK_LINES     = 0x51,
-    TRACK_FPF       = 0x52,
-} GXFTrackTag;
-
-#endif /* AVFORMAT_GXF_H */
diff --git a/deps/libav/libavformat/gxfenc.c b/deps/libav/libavformat/gxfenc.c
deleted file mode 100644
index fea1d5d..0000000
--- a/deps/libav/libavformat/gxfenc.c
+++ /dev/null
@@ -1,943 +0,0 @@
-/*
- * GXF muxer.
- * Copyright (c) 2006 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intfloat.h"
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "internal.h"
-#include "gxf.h"
-#include "audiointerleave.h"
-
-#define GXF_AUDIO_PACKET_SIZE 65536
-
-typedef struct GXFStreamContext {
-    AudioInterleaveContext aic;
-    uint32_t track_type;
-    uint32_t sample_size;
-    uint32_t sample_rate;
-    uint16_t media_type;
-    uint16_t media_info;
-    int frame_rate_index;
-    int lines_index;
-    int fields;
-    int iframes;
-    int pframes;
-    int bframes;
-    int p_per_gop;
-    int b_per_i_or_p; ///< number of B frames per I frame or P frame
-    int first_gop_closed;
-    unsigned order;   ///< interleaving order
-} GXFStreamContext;
-
-typedef struct GXFContext {
-    uint32_t nb_fields;
-    uint16_t audio_tracks;
-    uint16_t mpeg_tracks;
-    int64_t creation_time;
-    uint32_t umf_start_offset;
-    uint32_t umf_track_offset;
-    uint32_t umf_media_offset;
-    uint32_t umf_length;
-    uint16_t umf_track_size;
-    uint16_t umf_media_size;
-    AVRational time_base;
-    int flags;
-    GXFStreamContext timecode_track;
-    unsigned *flt_entries;    ///< offsets of packets /1024, starts after 2nd video field
-    unsigned flt_entries_nb;
-    uint64_t *map_offsets;    ///< offset of map packets
-    unsigned map_offsets_nb;
-    unsigned packet_count;
-} GXFContext;
-
-static const struct {
-    int height, index;
-} gxf_lines_tab[] = {
-    { 480,  1 }, /* NTSC */
-    { 512,  1 }, /* NTSC + VBI */
-    { 576,  2 }, /* PAL */
-    { 608,  2 }, /* PAL + VBI */
-    { 1080, 4 },
-    { 720,  6 },
-};
-
-static const AVCodecTag gxf_media_types[] = {
-    { AV_CODEC_ID_MJPEG     ,   3 }, /* NTSC */
-    { AV_CODEC_ID_MJPEG     ,   4 }, /* PAL */
-    { AV_CODEC_ID_PCM_S24LE ,   9 },
-    { AV_CODEC_ID_PCM_S16LE ,  10 },
-    { AV_CODEC_ID_MPEG2VIDEO,  11 }, /* NTSC */
-    { AV_CODEC_ID_MPEG2VIDEO,  12 }, /* PAL */
-    { AV_CODEC_ID_DVVIDEO   ,  13 }, /* NTSC */
-    { AV_CODEC_ID_DVVIDEO   ,  14 }, /* PAL */
-    { AV_CODEC_ID_DVVIDEO   ,  15 }, /* 50M NTSC */
-    { AV_CODEC_ID_DVVIDEO   ,  16 }, /* 50M PAL */
-    { AV_CODEC_ID_AC3       ,  17 },
-    //{ AV_CODEC_ID_NONE,  ,   18 }, /* Non compressed 24 bit audio */
-    { AV_CODEC_ID_MPEG2VIDEO,  20 }, /* MPEG HD */
-    { AV_CODEC_ID_MPEG1VIDEO,  22 }, /* NTSC */
-    { AV_CODEC_ID_MPEG1VIDEO,  23 }, /* PAL */
-    { AV_CODEC_ID_NONE,         0 },
-};
-
-#define SERVER_PATH "EXT:/PDR/default/"
-#define ES_NAME_PATTERN "EXT:/PDR/default/ES."
-
-static int gxf_find_lines_index(AVStream *st)
-{
-    GXFStreamContext *sc = st->priv_data;
-    int i;
-
-    for (i = 0; i < 6; ++i) {
-        if (st->codec->height == gxf_lines_tab[i].height) {
-            sc->lines_index = gxf_lines_tab[i].index;
-            return 0;
-        }
-    }
-    return -1;
-}
-
-static void gxf_write_padding(AVIOContext *pb, int64_t to_pad)
-{
-    for (; to_pad > 0; to_pad--) {
-        avio_w8(pb, 0);
-    }
-}
-
-static int64_t updatePacketSize(AVIOContext *pb, int64_t pos)
-{
-    int64_t curpos;
-    int size;
-
-    size = avio_tell(pb) - pos;
-    if (size % 4) {
-        gxf_write_padding(pb, 4 - size % 4);
-        size = avio_tell(pb) - pos;
-    }
-    curpos = avio_tell(pb);
-    avio_seek(pb, pos + 6, SEEK_SET);
-    avio_wb32(pb, size);
-    avio_seek(pb, curpos, SEEK_SET);
-    return curpos - pos;
-}
-
-static int64_t updateSize(AVIOContext *pb, int64_t pos)
-{
-    int64_t curpos;
-
-    curpos = avio_tell(pb);
-    avio_seek(pb, pos, SEEK_SET);
-    avio_wb16(pb, curpos - pos - 2);
-    avio_seek(pb, curpos, SEEK_SET);
-    return curpos - pos;
-}
-
-static void gxf_write_packet_header(AVIOContext *pb, GXFPktType type)
-{
-    avio_wb32(pb, 0);  /* packet leader for synchro */
-    avio_w8(pb, 1);
-    avio_w8(pb, type); /* map packet */
-    avio_wb32(pb, 0);  /* size */
-    avio_wb32(pb, 0);  /* reserved */
-    avio_w8(pb, 0xE1); /* trailer 1 */
-    avio_w8(pb, 0xE2); /* trailer 2 */
-}
-
-static int gxf_write_mpeg_auxiliary(AVIOContext *pb, AVStream *st)
-{
-    GXFStreamContext *sc = st->priv_data;
-    char buffer[1024];
-    int size, starting_line;
-
-    if (sc->iframes) {
-        sc->p_per_gop = sc->pframes / sc->iframes;
-        if (sc->pframes % sc->iframes)
-            sc->p_per_gop++;
-        if (sc->pframes) {
-            sc->b_per_i_or_p = sc->bframes / sc->pframes;
-            if (sc->bframes % sc->pframes)
-                sc->b_per_i_or_p++;
-        }
-        if (sc->p_per_gop > 9)
-            sc->p_per_gop = 9; /* ensure value won't take more than one char */
-        if (sc->b_per_i_or_p > 9)
-            sc->b_per_i_or_p = 9; /* ensure value won't take more than one char */
-    }
-    if (st->codec->height == 512 || st->codec->height == 608)
-        starting_line = 7; // VBI
-    else if (st->codec->height == 480)
-        starting_line = 20;
-    else
-        starting_line = 23; // default PAL
-
-    size = snprintf(buffer, 1024, "Ver 1\nBr %.6f\nIpg 1\nPpi %d\nBpiop %d\n"
-                    "Pix 0\nCf %d\nCg %d\nSl %d\nnl16 %d\nVi 1\nf1 1\n",
-                    (float)st->codec->bit_rate, sc->p_per_gop, sc->b_per_i_or_p,
-                    st->codec->pix_fmt == AV_PIX_FMT_YUV422P ? 2 : 1, sc->first_gop_closed == 1,
-                    starting_line, (st->codec->height + 15) / 16);
-    avio_w8(pb, TRACK_MPG_AUX);
-    avio_w8(pb, size + 1);
-    avio_write(pb, (uint8_t *)buffer, size + 1);
-    return size + 3;
-}
-
-static int gxf_write_timecode_auxiliary(AVIOContext *pb, GXFStreamContext *sc)
-{
-    avio_w8(pb, 0); /* fields */
-    avio_w8(pb, 0); /* seconds */
-    avio_w8(pb, 0); /* minutes */
-    avio_w8(pb, 0); /* flags + hours */
-    /* reserved */
-    avio_wb32(pb, 0);
-    return 8;
-}
-
-static int gxf_write_track_description(AVFormatContext *s, GXFStreamContext *sc, int index)
-{
-    AVIOContext *pb = s->pb;
-    int64_t pos;
-    int mpeg = sc->track_type == 4 || sc->track_type == 9;
-
-    /* track description section */
-    avio_w8(pb, sc->media_type + 0x80);
-    avio_w8(pb, index + 0xC0);
-
-    pos = avio_tell(pb);
-    avio_wb16(pb, 0); /* size */
-
-    /* media file name */
-    avio_w8(pb, TRACK_NAME);
-    avio_w8(pb, strlen(ES_NAME_PATTERN) + 3);
-    avio_write(pb, ES_NAME_PATTERN, sizeof(ES_NAME_PATTERN) - 1);
-    avio_wb16(pb, sc->media_info);
-    avio_w8(pb, 0);
-
-    if (!mpeg) {
-        /* auxiliary information */
-        avio_w8(pb, TRACK_AUX);
-        avio_w8(pb, 8);
-        if (sc->track_type == 3)
-            gxf_write_timecode_auxiliary(pb, sc);
-        else
-            avio_wl64(pb, 0);
-    }
-
-    /* file system version */
-    avio_w8(pb, TRACK_VER);
-    avio_w8(pb, 4);
-    avio_wb32(pb, 0);
-
-    if (mpeg)
-        gxf_write_mpeg_auxiliary(pb, s->streams[index]);
-
-    /* frame rate */
-    avio_w8(pb, TRACK_FPS);
-    avio_w8(pb, 4);
-    avio_wb32(pb, sc->frame_rate_index);
-
-    /* lines per frame */
-    avio_w8(pb, TRACK_LINES);
-    avio_w8(pb, 4);
-    avio_wb32(pb, sc->lines_index);
-
-    /* fields per frame */
-    avio_w8(pb, TRACK_FPF);
-    avio_w8(pb, 4);
-    avio_wb32(pb, sc->fields);
-
-    return updateSize(pb, pos);
-}
-
-static int gxf_write_material_data_section(AVFormatContext *s)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pos;
-    int len;
-    const char *filename = strrchr(s->filename, '/');
-
-    pos = avio_tell(pb);
-    avio_wb16(pb, 0); /* size */
-
-    /* name */
-    if (filename)
-        filename++;
-    else
-        filename = s->filename;
-    len = strlen(filename);
-
-    avio_w8(pb, MAT_NAME);
-    avio_w8(pb, strlen(SERVER_PATH) + len + 1);
-    avio_write(pb, SERVER_PATH, sizeof(SERVER_PATH) - 1);
-    avio_write(pb, filename, len);
-    avio_w8(pb, 0);
-
-    /* first field */
-    avio_w8(pb, MAT_FIRST_FIELD);
-    avio_w8(pb, 4);
-    avio_wb32(pb, 0);
-
-    /* last field */
-    avio_w8(pb, MAT_LAST_FIELD);
-    avio_w8(pb, 4);
-    avio_wb32(pb, gxf->nb_fields);
-
-    /* reserved */
-    avio_w8(pb, MAT_MARK_IN);
-    avio_w8(pb, 4);
-    avio_wb32(pb, 0);
-
-    avio_w8(pb, MAT_MARK_OUT);
-    avio_w8(pb, 4);
-    avio_wb32(pb, gxf->nb_fields);
-
-    /* estimated size */
-    avio_w8(pb, MAT_SIZE);
-    avio_w8(pb, 4);
-    avio_wb32(pb, avio_size(pb) / 1024);
-
-    return updateSize(pb, pos);
-}
-
-static int gxf_write_track_description_section(AVFormatContext *s)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pos;
-    int i;
-
-    pos = avio_tell(pb);
-    avio_wb16(pb, 0); /* size */
-    for (i = 0; i < s->nb_streams; ++i)
-        gxf_write_track_description(s, s->streams[i]->priv_data, i);
-
-    gxf_write_track_description(s, &gxf->timecode_track, s->nb_streams);
-
-    return updateSize(pb, pos);
-}
-
-static int gxf_write_map_packet(AVFormatContext *s, int rewrite)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pos = avio_tell(pb);
-
-    if (!rewrite) {
-        if (!(gxf->map_offsets_nb % 30)) {
-            int err;
-            if ((err = av_reallocp_array(&gxf->map_offsets,
-                                         gxf->map_offsets_nb + 30,
-                                         sizeof(*gxf->map_offsets))) < 0) {
-                gxf->map_offsets_nb = 0;
-                av_log(s, AV_LOG_ERROR, "could not realloc map offsets\n");
-                return err;
-            }
-        }
-        gxf->map_offsets[gxf->map_offsets_nb++] = pos; // do not increment here
-    }
-
-    gxf_write_packet_header(pb, PKT_MAP);
-
-    /* preamble */
-    avio_w8(pb, 0xE0); /* version */
-    avio_w8(pb, 0xFF); /* reserved */
-
-    gxf_write_material_data_section(s);
-    gxf_write_track_description_section(s);
-
-    return updatePacketSize(pb, pos);
-}
-
-static int gxf_write_flt_packet(AVFormatContext *s)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pos = avio_tell(pb);
-    int fields_per_flt = (gxf->nb_fields+1) / 1000 + 1;
-    int flt_entries = gxf->nb_fields / fields_per_flt;
-    int i = 0;
-
-    gxf_write_packet_header(pb, PKT_FLT);
-
-    avio_wl32(pb, fields_per_flt); /* number of fields */
-    avio_wl32(pb, flt_entries); /* number of active flt entries */
-
-    if (gxf->flt_entries) {
-        for (i = 0; i < flt_entries; i++)
-            avio_wl32(pb, gxf->flt_entries[(i*fields_per_flt)>>1]);
-    }
-
-    for (; i < 1000; i++)
-        avio_wl32(pb, 0);
-
-    return updatePacketSize(pb, pos);
-}
-
-static int gxf_write_umf_material_description(AVFormatContext *s)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int timecode_base = gxf->time_base.den == 60000 ? 60 : 50;
-    int64_t timestamp = 0;
-    AVDictionaryEntry *t;
-    uint32_t timecode;
-
-    if (t = av_dict_get(s->metadata, "creation_time", NULL, 0))
-        timestamp = ff_iso8601_to_unix_time(t->value);
-
-    // XXX drop frame
-    timecode =
-        gxf->nb_fields / (timecode_base * 3600) % 24 << 24 | // hours
-        gxf->nb_fields / (timecode_base * 60) % 60   << 16 | // minutes
-        gxf->nb_fields /  timecode_base % 60         <<  8 | // seconds
-        gxf->nb_fields %  timecode_base;                     // fields
-
-    avio_wl32(pb, gxf->flags);
-    avio_wl32(pb, gxf->nb_fields); /* length of the longest track */
-    avio_wl32(pb, gxf->nb_fields); /* length of the shortest track */
-    avio_wl32(pb, 0); /* mark in */
-    avio_wl32(pb, gxf->nb_fields); /* mark out */
-    avio_wl32(pb, 0); /* timecode mark in */
-    avio_wl32(pb, timecode); /* timecode mark out */
-    avio_wl64(pb, timestamp); /* modification time */
-    avio_wl64(pb, timestamp); /* creation time */
-    avio_wl16(pb, 0); /* reserved */
-    avio_wl16(pb, 0); /* reserved */
-    avio_wl16(pb, gxf->audio_tracks);
-    avio_wl16(pb, 1); /* timecode track count */
-    avio_wl16(pb, 0); /* reserved */
-    avio_wl16(pb, gxf->mpeg_tracks);
-    return 48;
-}
-
-static int gxf_write_umf_payload(AVFormatContext *s)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    avio_wl32(pb, gxf->umf_length); /* total length of the umf data */
-    avio_wl32(pb, 3); /* version */
-    avio_wl32(pb, s->nb_streams+1);
-    avio_wl32(pb, gxf->umf_track_offset); /* umf track section offset */
-    avio_wl32(pb, gxf->umf_track_size);
-    avio_wl32(pb, s->nb_streams+1);
-    avio_wl32(pb, gxf->umf_media_offset);
-    avio_wl32(pb, gxf->umf_media_size);
-    avio_wl32(pb, gxf->umf_length); /* user data offset */
-    avio_wl32(pb, 0); /* user data size */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    return 48;
-}
-
-static int gxf_write_umf_track_description(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    GXFContext *gxf = s->priv_data;
-    int64_t pos = avio_tell(pb);
-    int i;
-
-    gxf->umf_track_offset = pos - gxf->umf_start_offset;
-    for (i = 0; i < s->nb_streams; ++i) {
-        GXFStreamContext *sc = s->streams[i]->priv_data;
-        avio_wl16(pb, sc->media_info);
-        avio_wl16(pb, 1);
-    }
-
-    avio_wl16(pb, gxf->timecode_track.media_info);
-    avio_wl16(pb, 1);
-
-    return avio_tell(pb) - pos;
-}
-
-static int gxf_write_umf_media_mpeg(AVIOContext *pb, AVStream *st)
-{
-    GXFStreamContext *sc = st->priv_data;
-
-    if (st->codec->pix_fmt == AV_PIX_FMT_YUV422P)
-        avio_wl32(pb, 2);
-    else
-        avio_wl32(pb, 1); /* default to 420 */
-    avio_wl32(pb, sc->first_gop_closed == 1); /* closed = 1, open = 0, unknown = 255 */
-    avio_wl32(pb, 3); /* top = 1, bottom = 2, frame = 3, unknown = 0 */
-    avio_wl32(pb, 1); /* I picture per GOP */
-    avio_wl32(pb, sc->p_per_gop);
-    avio_wl32(pb, sc->b_per_i_or_p);
-    if (st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO)
-        avio_wl32(pb, 2);
-    else if (st->codec->codec_id == AV_CODEC_ID_MPEG1VIDEO)
-        avio_wl32(pb, 1);
-    else
-        avio_wl32(pb, 0);
-    avio_wl32(pb, 0); /* reserved */
-    return 32;
-}
-
-static int gxf_write_umf_media_timecode(AVIOContext *pb, GXFStreamContext *sc)
-{
-    avio_wl32(pb, 1); /* non drop frame */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    return 32;
-}
-
-static int gxf_write_umf_media_dv(AVIOContext *pb, GXFStreamContext *sc)
-{
-    int i;
-
-    for (i = 0; i < 8; i++) {
-        avio_wb32(pb, 0);
-    }
-    return 32;
-}
-
-static int gxf_write_umf_media_audio(AVIOContext *pb, GXFStreamContext *sc)
-{
-    avio_wl64(pb, av_double2int(1)); /* sound level to begin to */
-    avio_wl64(pb, av_double2int(1)); /* sound level to begin to */
-    avio_wl32(pb, 0); /* number of fields over which to ramp up sound level */
-    avio_wl32(pb, 0); /* number of fields over which to ramp down sound level */
-    avio_wl32(pb, 0); /* reserved */
-    avio_wl32(pb, 0); /* reserved */
-    return 32;
-}
-
-static int gxf_write_umf_media_description(AVFormatContext *s)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pos;
-    int i, j;
-
-    pos = avio_tell(pb);
-    gxf->umf_media_offset = pos - gxf->umf_start_offset;
-    for (i = 0; i <= s->nb_streams; ++i) {
-        GXFStreamContext *sc;
-        int64_t startpos, curpos;
-
-        if (i == s->nb_streams)
-            sc = &gxf->timecode_track;
-        else
-            sc = s->streams[i]->priv_data;
-
-        startpos = avio_tell(pb);
-        avio_wl16(pb, 0); /* length */
-        avio_wl16(pb, sc->media_info);
-        avio_wl16(pb, 0); /* reserved */
-        avio_wl16(pb, 0); /* reserved */
-        avio_wl32(pb, gxf->nb_fields);
-        avio_wl32(pb, 0); /* attributes rw, ro */
-        avio_wl32(pb, 0); /* mark in */
-        avio_wl32(pb, gxf->nb_fields); /* mark out */
-        avio_write(pb, ES_NAME_PATTERN, strlen(ES_NAME_PATTERN));
-        avio_wb16(pb, sc->media_info);
-        for (j = strlen(ES_NAME_PATTERN)+2; j < 88; j++)
-            avio_w8(pb, 0);
-        avio_wl32(pb, sc->track_type);
-        avio_wl32(pb, sc->sample_rate);
-        avio_wl32(pb, sc->sample_size);
-        avio_wl32(pb, 0); /* reserved */
-
-        if (sc == &gxf->timecode_track)
-            gxf_write_umf_media_timecode(pb, sc); /* 8 0bytes */
-        else {
-            AVStream *st = s->streams[i];
-            switch (st->codec->codec_id) {
-            case AV_CODEC_ID_MPEG1VIDEO:
-            case AV_CODEC_ID_MPEG2VIDEO:
-                gxf_write_umf_media_mpeg(pb, st);
-                break;
-            case AV_CODEC_ID_PCM_S16LE:
-                gxf_write_umf_media_audio(pb, sc);
-                break;
-            case AV_CODEC_ID_DVVIDEO:
-                gxf_write_umf_media_dv(pb, sc);
-                break;
-            }
-        }
-
-        curpos = avio_tell(pb);
-        avio_seek(pb, startpos, SEEK_SET);
-        avio_wl16(pb, curpos - startpos);
-        avio_seek(pb, curpos, SEEK_SET);
-    }
-    return avio_tell(pb) - pos;
-}
-
-static int gxf_write_umf_packet(AVFormatContext *s)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pos = avio_tell(pb);
-
-    gxf_write_packet_header(pb, PKT_UMF);
-
-    /* preamble */
-    avio_w8(pb, 3); /* first and last (only) packet */
-    avio_wb32(pb, gxf->umf_length); /* data length */
-
-    gxf->umf_start_offset = avio_tell(pb);
-    gxf_write_umf_payload(s);
-    gxf_write_umf_material_description(s);
-    gxf->umf_track_size = gxf_write_umf_track_description(s);
-    gxf->umf_media_size = gxf_write_umf_media_description(s);
-    gxf->umf_length = avio_tell(pb) - gxf->umf_start_offset;
-    return updatePacketSize(pb, pos);
-}
-
-static const int GXF_samples_per_frame[] = { 32768, 0 };
-
-static void gxf_init_timecode_track(GXFStreamContext *sc, GXFStreamContext *vsc)
-{
-    if (!vsc)
-        return;
-
-    sc->media_type = vsc->sample_rate == 60 ? 7 : 8;
-    sc->sample_rate = vsc->sample_rate;
-    sc->media_info = ('T'<<8) | '0';
-    sc->track_type = 3;
-    sc->frame_rate_index = vsc->frame_rate_index;
-    sc->lines_index = vsc->lines_index;
-    sc->sample_size = 16;
-    sc->fields = vsc->fields;
-}
-
-static int gxf_write_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    GXFContext *gxf = s->priv_data;
-    GXFStreamContext *vsc = NULL;
-    uint8_t tracks[255] = {0};
-    int i, media_info = 0;
-
-    if (!pb->seekable) {
-        av_log(s, AV_LOG_ERROR, "gxf muxer does not support streamed output, patch welcome");
-        return -1;
-    }
-
-    gxf->flags |= 0x00080000; /* material is simple clip */
-    for (i = 0; i < s->nb_streams; ++i) {
-        AVStream *st = s->streams[i];
-        GXFStreamContext *sc = av_mallocz(sizeof(*sc));
-        if (!sc)
-            return AVERROR(ENOMEM);
-        st->priv_data = sc;
-
-        sc->media_type = ff_codec_get_tag(gxf_media_types, st->codec->codec_id);
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (st->codec->codec_id != AV_CODEC_ID_PCM_S16LE) {
-                av_log(s, AV_LOG_ERROR, "only 16 BIT PCM LE allowed for now\n");
-                return -1;
-            }
-            if (st->codec->sample_rate != 48000) {
-                av_log(s, AV_LOG_ERROR, "only 48000hz sampling rate is allowed\n");
-                return -1;
-            }
-            if (st->codec->channels != 1) {
-                av_log(s, AV_LOG_ERROR, "only mono tracks are allowed\n");
-                return -1;
-            }
-            sc->track_type = 2;
-            sc->sample_rate = st->codec->sample_rate;
-            avpriv_set_pts_info(st, 64, 1, sc->sample_rate);
-            sc->sample_size = 16;
-            sc->frame_rate_index = -2;
-            sc->lines_index = -2;
-            sc->fields = -2;
-            gxf->audio_tracks++;
-            gxf->flags |= 0x04000000; /* audio is 16 bit pcm */
-            media_info = 'A';
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            if (i != 0) {
-                av_log(s, AV_LOG_ERROR, "video stream must be the first track\n");
-                return -1;
-            }
-            /* FIXME check from time_base ? */
-            if (st->codec->height == 480 || st->codec->height == 512) { /* NTSC or NTSC+VBI */
-                sc->frame_rate_index = 5;
-                sc->sample_rate = 60;
-                gxf->flags |= 0x00000080;
-                gxf->time_base = (AVRational){ 1001, 60000 };
-            } else if (st->codec->height == 576 || st->codec->height == 608) { /* PAL or PAL+VBI */
-                sc->frame_rate_index = 6;
-                sc->media_type++;
-                sc->sample_rate = 50;
-                gxf->flags |= 0x00000040;
-                gxf->time_base = (AVRational){ 1, 50 };
-            } else {
-                av_log(s, AV_LOG_ERROR, "unsupported video resolution, "
-                       "gxf muxer only accepts PAL or NTSC resolutions currently\n");
-                return -1;
-            }
-            avpriv_set_pts_info(st, 64, gxf->time_base.num, gxf->time_base.den);
-            if (gxf_find_lines_index(st) < 0)
-                sc->lines_index = -1;
-            sc->sample_size = st->codec->bit_rate;
-            sc->fields = 2; /* interlaced */
-
-            vsc = sc;
-
-            switch (st->codec->codec_id) {
-            case AV_CODEC_ID_MJPEG:
-                sc->track_type = 1;
-                gxf->flags |= 0x00004000;
-                media_info = 'J';
-                break;
-            case AV_CODEC_ID_MPEG1VIDEO:
-                sc->track_type = 9;
-                gxf->mpeg_tracks++;
-                media_info = 'L';
-                break;
-            case AV_CODEC_ID_MPEG2VIDEO:
-                sc->first_gop_closed = -1;
-                sc->track_type = 4;
-                gxf->mpeg_tracks++;
-                gxf->flags |= 0x00008000;
-                media_info = 'M';
-                break;
-            case AV_CODEC_ID_DVVIDEO:
-                if (st->codec->pix_fmt == AV_PIX_FMT_YUV422P) {
-                    sc->media_type += 2;
-                    sc->track_type = 6;
-                    gxf->flags |= 0x00002000;
-                    media_info = 'E';
-                } else {
-                    sc->track_type = 5;
-                    gxf->flags |= 0x00001000;
-                    media_info = 'D';
-                }
-                break;
-            default:
-                av_log(s, AV_LOG_ERROR, "video codec not supported\n");
-                return -1;
-            }
-        }
-        /* FIXME first 10 audio tracks are 0 to 9 next 22 are A to V */
-        sc->media_info = media_info<<8 | ('0'+tracks[media_info]++);
-        sc->order = s->nb_streams - st->index;
-    }
-
-    if (ff_audio_interleave_init(s, GXF_samples_per_frame, (AVRational){ 1, 48000 }) < 0)
-        return -1;
-
-    gxf_init_timecode_track(&gxf->timecode_track, vsc);
-    gxf->flags |= 0x200000; // time code track is non-drop frame
-
-    gxf_write_map_packet(s, 0);
-    gxf_write_flt_packet(s);
-    gxf_write_umf_packet(s);
-
-    gxf->packet_count = 3;
-
-    avio_flush(pb);
-    return 0;
-}
-
-static int gxf_write_eos_packet(AVIOContext *pb)
-{
-    int64_t pos = avio_tell(pb);
-
-    gxf_write_packet_header(pb, PKT_EOS);
-    return updatePacketSize(pb, pos);
-}
-
-static int gxf_write_trailer(AVFormatContext *s)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t end;
-    int i;
-
-    ff_audio_interleave_close(s);
-
-    gxf_write_eos_packet(pb);
-    end = avio_tell(pb);
-    avio_seek(pb, 0, SEEK_SET);
-    /* overwrite map, flt and umf packets with new values */
-    gxf_write_map_packet(s, 1);
-    gxf_write_flt_packet(s);
-    gxf_write_umf_packet(s);
-    avio_flush(pb);
-    /* update duration in all map packets */
-    for (i = 1; i < gxf->map_offsets_nb; i++) {
-        avio_seek(pb, gxf->map_offsets[i], SEEK_SET);
-        gxf_write_map_packet(s, 1);
-        avio_flush(pb);
-    }
-
-    avio_seek(pb, end, SEEK_SET);
-
-    av_freep(&gxf->flt_entries);
-    av_freep(&gxf->map_offsets);
-
-    return 0;
-}
-
-static int gxf_parse_mpeg_frame(GXFStreamContext *sc, const uint8_t *buf, int size)
-{
-    uint32_t c=-1;
-    int i;
-    for(i=0; i<size-4 && c!=0x100; i++){
-        c = (c<<8) + buf[i];
-        if(c == 0x1B8 && sc->first_gop_closed == -1) /* GOP start code */
-            sc->first_gop_closed= (buf[i+4]>>6)&1;
-    }
-    return (buf[i+1]>>3)&7;
-}
-
-static int gxf_write_media_preamble(AVFormatContext *s, AVPacket *pkt, int size)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st = s->streams[pkt->stream_index];
-    GXFStreamContext *sc = st->priv_data;
-    unsigned field_nb;
-    /* If the video is frame-encoded, the frame numbers shall be represented by
-     * even field numbers.
-     * see SMPTE360M-2004  6.4.2.1.3 Media field number */
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        field_nb = gxf->nb_fields;
-    } else {
-        field_nb = av_rescale_rnd(pkt->dts, gxf->time_base.den,
-                                  (int64_t)48000*gxf->time_base.num, AV_ROUND_UP);
-    }
-
-    avio_w8(pb, sc->media_type);
-    avio_w8(pb, st->index);
-    avio_wb32(pb, field_nb);
-    if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-        avio_wb16(pb, 0);
-        avio_wb16(pb, size / 2);
-    } else if (st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-        int frame_type = gxf_parse_mpeg_frame(sc, pkt->data, pkt->size);
-        if (frame_type == AV_PICTURE_TYPE_I) {
-            avio_w8(pb, 0x0d);
-            sc->iframes++;
-        } else if (frame_type == AV_PICTURE_TYPE_B) {
-            avio_w8(pb, 0x0f);
-            sc->bframes++;
-        } else {
-            avio_w8(pb, 0x0e);
-            sc->pframes++;
-        }
-        avio_wb24(pb, size);
-    } else if (st->codec->codec_id == AV_CODEC_ID_DVVIDEO) {
-        avio_w8(pb, size / 4096);
-        avio_wb24(pb, 0);
-    } else
-        avio_wb32(pb, size);
-    avio_wb32(pb, field_nb);
-    avio_w8(pb, 1); /* flags */
-    avio_w8(pb, 0); /* reserved */
-    return 16;
-}
-
-static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    GXFContext *gxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st = s->streams[pkt->stream_index];
-    int64_t pos = avio_tell(pb);
-    int padding = 0;
-    int packet_start_offset = avio_tell(pb) / 1024;
-
-    gxf_write_packet_header(pb, PKT_MEDIA);
-    if (st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO && pkt->size % 4) /* MPEG-2 frames must be padded */
-        padding = 4 - pkt->size % 4;
-    else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-        padding = GXF_AUDIO_PACKET_SIZE - pkt->size;
-    gxf_write_media_preamble(s, pkt, pkt->size + padding);
-    avio_write(pb, pkt->data, pkt->size);
-    gxf_write_padding(pb, padding);
-
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        if (!(gxf->flt_entries_nb % 500)) {
-            int err;
-            if ((err = av_reallocp_array(&gxf->flt_entries,
-                                         gxf->flt_entries_nb + 500,
-                                         sizeof(*gxf->flt_entries))) < 0) {
-                gxf->flt_entries_nb = 0;
-                av_log(s, AV_LOG_ERROR, "could not reallocate flt entries\n");
-                return err;
-            }
-        }
-        gxf->flt_entries[gxf->flt_entries_nb++] = packet_start_offset;
-        gxf->nb_fields += 2; // count fields
-    }
-
-    updatePacketSize(pb, pos);
-
-    gxf->packet_count++;
-    if (gxf->packet_count == 100) {
-        gxf_write_map_packet(s, 0);
-        gxf->packet_count = 0;
-    }
-
-    return 0;
-}
-
-static int gxf_compare_field_nb(AVFormatContext *s, AVPacket *next, AVPacket *cur)
-{
-    GXFContext *gxf = s->priv_data;
-    AVPacket *pkt[2] = { cur, next };
-    int i, field_nb[2];
-    GXFStreamContext *sc[2];
-
-    for (i = 0; i < 2; i++) {
-        AVStream *st = s->streams[pkt[i]->stream_index];
-        sc[i] = st->priv_data;
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            field_nb[i] = av_rescale_rnd(pkt[i]->dts, gxf->time_base.den,
-                                         (int64_t)48000*gxf->time_base.num, AV_ROUND_UP);
-            field_nb[i] &= ~1; // compare against even field number because audio must be before video
-        } else
-            field_nb[i] = pkt[i]->dts; // dts are field based
-    }
-
-    return field_nb[1] > field_nb[0] ||
-        (field_nb[1] == field_nb[0] && sc[1]->order > sc[0]->order);
-}
-
-static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)
-{
-    if (pkt && s->streams[pkt->stream_index]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-        pkt->duration = 2; // enforce 2 fields
-    return ff_audio_rechunk_interleave(s, out, pkt, flush,
-                               ff_interleave_packet_per_dts, gxf_compare_field_nb);
-}
-
-AVOutputFormat ff_gxf_muxer = {
-    .name              = "gxf",
-    .long_name         = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
-    .extensions        = "gxf",
-    .priv_data_size    = sizeof(GXFContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_header      = gxf_write_header,
-    .write_packet      = gxf_write_packet,
-    .write_trailer     = gxf_write_trailer,
-    .interleave_packet = gxf_interleave_packet,
-};
diff --git a/deps/libav/libavformat/h261dec.c b/deps/libav/libavformat/h261dec.c
deleted file mode 100644
index 4a58050..0000000
--- a/deps/libav/libavformat/h261dec.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * RAW H.261 video demuxer
- * Copyright (c) 2009 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/get_bits.h"
-#include "avformat.h"
-#include "rawdec.h"
-
-static int h261_probe(AVProbeData *p)
-{
-    uint32_t code= -1;
-    int i;
-    int valid_psc=0;
-    int invalid_psc=0;
-    int next_gn=0;
-    int src_fmt=0;
-    GetBitContext gb;
-
-    init_get_bits(&gb, p->buf, p->buf_size*8);
-
-    for(i=0; i<p->buf_size*8; i++){
-        if ((code & 0x01ff0000) || !(code & 0xff00)) {
-            code = (code<<8) + get_bits(&gb, 8);
-            i += 7;
-        } else
-            code = (code<<1) + get_bits1(&gb);
-        if ((code & 0xffff0000) == 0x10000) {
-            int gn= (code>>12)&0xf;
-            if(!gn)
-                src_fmt= code&8;
-            if(gn != next_gn) invalid_psc++;
-            else              valid_psc++;
-
-            if(src_fmt){ // CIF
-                next_gn= (gn+1     )%13;
-            }else{       //QCIF
-                next_gn= (gn+1+!!gn)% 7;
-            }
-        }
-    }
-    if(valid_psc > 2*invalid_psc + 6){
-        return AVPROBE_SCORE_EXTENSION;
-    }else if(valid_psc > 2*invalid_psc + 2)
-        return AVPROBE_SCORE_EXTENSION / 2;
-    return 0;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(h261, "raw H.261", h261_probe, "h261", AV_CODEC_ID_H261)
diff --git a/deps/libav/libavformat/h263dec.c b/deps/libav/libavformat/h263dec.c
deleted file mode 100644
index 4d826d8..0000000
--- a/deps/libav/libavformat/h263dec.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * RAW H.263 video demuxer
- * Copyright (c) 2009 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawdec.h"
-
-static int h263_probe(AVProbeData *p)
-{
-    uint64_t code= -1;
-    int i;
-    int valid_psc=0;
-    int invalid_psc=0;
-    int res_change=0;
-    int src_fmt, last_src_fmt=-1;
-    int last_gn=0;
-
-    for(i=0; i<p->buf_size; i++){
-        code = (code<<8) + p->buf[i];
-        if ((code & 0xfffffc0000) == 0x800000) {
-            src_fmt= (code>>2)&3;
-            if(   src_fmt != last_src_fmt
-               && last_src_fmt>0 && last_src_fmt<6
-               && src_fmt<6)
-                res_change++;
-
-            if((code&0x300)==0x200 && src_fmt){
-                valid_psc++;
-                last_gn=0;
-            }else
-                invalid_psc++;
-            last_src_fmt= src_fmt;
-        } else if((code & 0xffff800000) == 0x800000) {
-            int gn= (code>>(23-5)) & 0x1F;
-            if(gn<last_gn){
-                invalid_psc++;
-            }else
-                last_gn= gn;
-        }
-    }
-    if(valid_psc > 2*invalid_psc + 2*res_change + 3){
-        return AVPROBE_SCORE_EXTENSION;
-    }else if(valid_psc > 2*invalid_psc)
-        return AVPROBE_SCORE_EXTENSION / 2;
-    return 0;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(h263, "raw H.263", h263_probe, NULL, AV_CODEC_ID_H263)
diff --git a/deps/libav/libavformat/h264dec.c b/deps/libav/libavformat/h264dec.c
deleted file mode 100644
index 6fd45c1..0000000
--- a/deps/libav/libavformat/h264dec.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * RAW H.264 video demuxer
- * Copyright (c) 2008 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawdec.h"
-
-static int h264_probe(AVProbeData *p)
-{
-    uint32_t code = -1;
-    int sps = 0, pps = 0, idr = 0, res = 0, sli = 0;
-    int i;
-
-    for (i = 0; i < p->buf_size; i++) {
-        code = (code << 8) + p->buf[i];
-        if ((code & 0xffffff00) == 0x100) {
-            int ref_idc = (code >> 5) & 3;
-            int type    = code & 0x1F;
-            static const int8_t ref_zero[] = {
-                 2,  0,  0,  0,  0, -1,  1, -1,
-                -1,  1,  1,  1,  1, -1,  2,  2,
-                 2,  2,  2,  0,  2,  2,  2,  2,
-                 2,  2,  2,  2,  2,  2,  2,  2
-            };
-
-            if (code & 0x80) // forbidden_bit
-                return 0;
-
-            if (ref_zero[type] == 1 && ref_idc)
-                return 0;
-            if (ref_zero[type] == -1 && !ref_idc)
-                return 0;
-            if (ref_zero[type] == 2)
-                res++;
-
-            switch (type) {
-            case 1:
-                sli++;
-                break;
-            case 5:
-                idr++;
-                break;
-            case 7:
-                if (p->buf[i + 2] & 0x03)
-                    return 0;
-                sps++;
-                break;
-            case 8:
-                pps++;
-                break;
-            }
-        }
-    }
-
-    if (sps && pps && (idr || sli > 3) && res < (sps + pps + idr))
-        return AVPROBE_SCORE_EXTENSION + 1;  // 1 more than .mpg
-
-    return 0;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(h264, "raw H.264 video", h264_probe, "h26l,h264,264,avc", AV_CODEC_ID_H264)
diff --git a/deps/libav/libavformat/hdsenc.c b/deps/libav/libavformat/hdsenc.c
deleted file mode 100644
index 6217c1f..0000000
--- a/deps/libav/libavformat/hdsenc.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * Live HDS fragmenter
- * Copyright (c) 2013 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <float.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "avformat.h"
-#include "internal.h"
-#include "os_support.h"
-
-#include "libavutil/avstring.h"
-#include "libavutil/base64.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-
-typedef struct Fragment {
-    char file[1024];
-    int64_t start_time, duration;
-    int n;
-} Fragment;
-
-typedef struct OutputStream {
-    int bitrate;
-    int first_stream;
-    AVFormatContext *ctx;
-    int ctx_inited;
-    uint8_t iobuf[32768];
-    char temp_filename[1024];
-    int64_t frag_start_ts, last_ts;
-    AVIOContext *out;
-    int packets_written;
-    int nb_fragments, fragments_size, fragment_index;
-    Fragment **fragments;
-
-    int has_audio, has_video;
-
-    uint8_t *metadata;
-    int metadata_size;
-
-    uint8_t *extra_packets[2];
-    int extra_packet_sizes[2];
-    int nb_extra_packets;
-} OutputStream;
-
-typedef struct HDSContext {
-    const AVClass *class;  /* Class for private options. */
-    int window_size;
-    int extra_window_size;
-    int min_frag_duration;
-    int remove_at_exit;
-
-    OutputStream *streams;
-    int nb_streams;
-} HDSContext;
-
-static int parse_header(OutputStream *os, const uint8_t *buf, int buf_size)
-{
-    if (buf_size < 13)
-        return AVERROR_INVALIDDATA;
-    if (memcmp(buf, "FLV", 3))
-        return AVERROR_INVALIDDATA;
-    buf      += 13;
-    buf_size -= 13;
-    while (buf_size >= 11 + 4) {
-        int type = buf[0];
-        int size = AV_RB24(&buf[1]) + 11 + 4;
-        if (size > buf_size)
-            return AVERROR_INVALIDDATA;
-        if (type == 8 || type == 9) {
-            if (os->nb_extra_packets >= FF_ARRAY_ELEMS(os->extra_packets))
-                return AVERROR_INVALIDDATA;
-            os->extra_packet_sizes[os->nb_extra_packets] = size;
-            os->extra_packets[os->nb_extra_packets] = av_malloc(size);
-            if (!os->extra_packets[os->nb_extra_packets])
-                return AVERROR(ENOMEM);
-            memcpy(os->extra_packets[os->nb_extra_packets], buf, size);
-            os->nb_extra_packets++;
-        } else if (type == 0x12) {
-            if (os->metadata)
-                return AVERROR_INVALIDDATA;
-            os->metadata_size = size - 11 - 4;
-            os->metadata      = av_malloc(os->metadata_size);
-            if (!os->metadata)
-                return AVERROR(ENOMEM);
-            memcpy(os->metadata, buf + 11, os->metadata_size);
-        }
-        buf      += size;
-        buf_size -= size;
-    }
-    if (!os->metadata)
-        return AVERROR_INVALIDDATA;
-    return 0;
-}
-
-static int hds_write(void *opaque, uint8_t *buf, int buf_size)
-{
-    OutputStream *os = opaque;
-    if (os->out) {
-        avio_write(os->out, buf, buf_size);
-    } else {
-        if (!os->metadata_size) {
-            int ret;
-            // Assuming the IO buffer is large enough to fit the
-            // FLV header and all metadata and extradata packets
-            if ((ret = parse_header(os, buf, buf_size)) < 0)
-                return ret;
-        }
-    }
-    return buf_size;
-}
-
-static void hds_free(AVFormatContext *s)
-{
-    HDSContext *c = s->priv_data;
-    int i, j;
-    if (!c->streams)
-        return;
-    for (i = 0; i < s->nb_streams; i++) {
-        OutputStream *os = &c->streams[i];
-        if (os->out)
-            avio_close(os->out);
-        os->out = NULL;
-        if (os->ctx && os->ctx_inited)
-            av_write_trailer(os->ctx);
-        if (os->ctx && os->ctx->pb)
-            av_free(os->ctx->pb);
-        if (os->ctx)
-            avformat_free_context(os->ctx);
-        av_free(os->metadata);
-        for (j = 0; j < os->nb_extra_packets; j++)
-            av_free(os->extra_packets[j]);
-        for (j = 0; j < os->nb_fragments; j++)
-            av_free(os->fragments[j]);
-        av_free(os->fragments);
-    }
-    av_freep(&c->streams);
-}
-
-static int write_manifest(AVFormatContext *s, int final)
-{
-    HDSContext *c = s->priv_data;
-    AVIOContext *out;
-    char filename[1024], temp_filename[1024];
-    int ret, i;
-    float duration = 0;
-
-    if (c->nb_streams > 0)
-        duration = c->streams[0].last_ts * av_q2d(s->streams[0]->time_base);
-
-    snprintf(filename, sizeof(filename), "%s/index.f4m", s->filename);
-    snprintf(temp_filename, sizeof(temp_filename), "%s/index.f4m.tmp", s->filename);
-    ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE,
-                     &s->interrupt_callback, NULL);
-    if (ret < 0) {
-        av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", filename);
-        return ret;
-    }
-    avio_printf(out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
-    avio_printf(out, "<manifest xmlns=\"http://ns.adobe.com/f4m/1.0\">\n");
-    avio_printf(out, "\t<id>%s</id>\n", av_basename(s->filename));
-    avio_printf(out, "\t<streamType>%s</streamType>\n",
-                     final ? "recorded" : "live");
-    avio_printf(out, "\t<deliveryType>streaming</deliveryType>\n");
-    if (final)
-        avio_printf(out, "\t<duration>%f</duration>\n", duration);
-    for (i = 0; i < c->nb_streams; i++) {
-        OutputStream *os = &c->streams[i];
-        int b64_size = AV_BASE64_SIZE(os->metadata_size);
-        char *base64 = av_malloc(b64_size);
-        if (!base64) {
-            avio_close(out);
-            return AVERROR(ENOMEM);
-        }
-        av_base64_encode(base64, b64_size, os->metadata, os->metadata_size);
-
-        avio_printf(out, "\t<bootstrapInfo profile=\"named\" url=\"stream%d.abst\" id=\"bootstrap%d\" />\n", i, i);
-        avio_printf(out, "\t<media bitrate=\"%d\" url=\"stream%d\" bootstrapInfoId=\"bootstrap%d\">\n", os->bitrate/1000, i, i);
-        avio_printf(out, "\t\t<metadata>%s</metadata>\n", base64);
-        avio_printf(out, "\t</media>\n");
-        av_free(base64);
-    }
-    avio_printf(out, "</manifest>\n");
-    avio_flush(out);
-    avio_close(out);
-    rename(temp_filename, filename);
-    return 0;
-}
-
-static void update_size(AVIOContext *out, int64_t pos)
-{
-    int64_t end = avio_tell(out);
-    avio_seek(out, pos, SEEK_SET);
-    avio_wb32(out, end - pos);
-    avio_seek(out, end, SEEK_SET);
-}
-
-/* Note, the .abst files need to be served with the "binary/octet"
- * mime type, otherwise at least the OSMF player can easily fail
- * with "stream not found" when polling for the next fragment. */
-static int write_abst(AVFormatContext *s, OutputStream *os, int final)
-{
-    HDSContext *c = s->priv_data;
-    AVIOContext *out;
-    char filename[1024], temp_filename[1024];
-    int i, ret;
-    int64_t asrt_pos, afrt_pos;
-    int start = 0, fragments;
-    int index = s->streams[os->first_stream]->id;
-    int64_t cur_media_time = 0;
-    if (c->window_size)
-        start = FFMAX(os->nb_fragments - c->window_size, 0);
-    fragments = os->nb_fragments - start;
-    if (final)
-        cur_media_time = os->last_ts;
-    else if (os->nb_fragments)
-        cur_media_time = os->fragments[os->nb_fragments - 1]->start_time;
-
-    snprintf(filename, sizeof(filename),
-             "%s/stream%d.abst", s->filename, index);
-    snprintf(temp_filename, sizeof(temp_filename),
-             "%s/stream%d.abst.tmp", s->filename, index);
-    ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE,
-                     &s->interrupt_callback, NULL);
-    if (ret < 0) {
-        av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename);
-        return ret;
-    }
-    avio_wb32(out, 0); // abst size
-    avio_wl32(out, MKTAG('a','b','s','t'));
-    avio_wb32(out, 0); // version + flags
-    avio_wb32(out, os->fragment_index - 1); // BootstrapinfoVersion
-    avio_w8(out, final ? 0 : 0x20); // profile, live, update
-    avio_wb32(out, 1000); // timescale
-    avio_wb64(out, cur_media_time);
-    avio_wb64(out, 0); // SmpteTimeCodeOffset
-    avio_w8(out, 0); // MovieIdentifer (null string)
-    avio_w8(out, 0); // ServerEntryCount
-    avio_w8(out, 0); // QualityEntryCount
-    avio_w8(out, 0); // DrmData (null string)
-    avio_w8(out, 0); // MetaData (null string)
-    avio_w8(out, 1); // SegmentRunTableCount
-    asrt_pos = avio_tell(out);
-    avio_wb32(out, 0); // asrt size
-    avio_wl32(out, MKTAG('a','s','r','t'));
-    avio_wb32(out, 0); // version + flags
-    avio_w8(out, 0); // QualityEntryCount
-    avio_wb32(out, 1); // SegmentRunEntryCount
-    avio_wb32(out, 1); // FirstSegment
-    avio_wb32(out, final ? (os->fragment_index - 1) : 0xffffffff); // FragmentsPerSegment
-    update_size(out, asrt_pos);
-    avio_w8(out, 1); // FragmentRunTableCount
-    afrt_pos = avio_tell(out);
-    avio_wb32(out, 0); // afrt size
-    avio_wl32(out, MKTAG('a','f','r','t'));
-    avio_wb32(out, 0); // version + flags
-    avio_wb32(out, 1000); // timescale
-    avio_w8(out, 0); // QualityEntryCount
-    avio_wb32(out, fragments); // FragmentRunEntryCount
-    for (i = start; i < os->nb_fragments; i++) {
-        avio_wb32(out, os->fragments[i]->n);
-        avio_wb64(out, os->fragments[i]->start_time);
-        avio_wb32(out, os->fragments[i]->duration);
-    }
-    update_size(out, afrt_pos);
-    update_size(out, 0);
-    avio_close(out);
-    rename(temp_filename, filename);
-    return 0;
-}
-
-static int init_file(AVFormatContext *s, OutputStream *os, int64_t start_ts)
-{
-    int ret, i;
-    ret = avio_open2(&os->out, os->temp_filename, AVIO_FLAG_WRITE,
-                     &s->interrupt_callback, NULL);
-    if (ret < 0)
-        return ret;
-    avio_wb32(os->out, 0);
-    avio_wl32(os->out, MKTAG('m','d','a','t'));
-    for (i = 0; i < os->nb_extra_packets; i++) {
-        AV_WB24(os->extra_packets[i] + 4, start_ts);
-        os->extra_packets[i][7] = (start_ts >> 24) & 0x7f;
-        avio_write(os->out, os->extra_packets[i], os->extra_packet_sizes[i]);
-    }
-    return 0;
-}
-
-static void close_file(OutputStream *os)
-{
-    int64_t pos = avio_tell(os->out);
-    avio_seek(os->out, 0, SEEK_SET);
-    avio_wb32(os->out, pos);
-    avio_flush(os->out);
-    avio_close(os->out);
-    os->out = NULL;
-}
-
-static int hds_write_header(AVFormatContext *s)
-{
-    HDSContext *c = s->priv_data;
-    int ret = 0, i;
-    AVOutputFormat *oformat;
-
-    mkdir(s->filename, 0777);
-
-    oformat = av_guess_format("flv", NULL, NULL);
-    if (!oformat) {
-        ret = AVERROR_MUXER_NOT_FOUND;
-        goto fail;
-    }
-
-    c->streams = av_mallocz(sizeof(*c->streams) * s->nb_streams);
-    if (!c->streams) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        OutputStream *os = &c->streams[c->nb_streams];
-        AVFormatContext *ctx;
-        AVStream *st = s->streams[i];
-
-        if (!st->codec->bit_rate) {
-            av_log(s, AV_LOG_ERROR, "No bit rate set for stream %d\n", i);
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            if (os->has_video) {
-                c->nb_streams++;
-                os++;
-            }
-            os->has_video = 1;
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (os->has_audio) {
-                c->nb_streams++;
-                os++;
-            }
-            os->has_audio = 1;
-        } else {
-            av_log(s, AV_LOG_ERROR, "Unsupported stream type in stream %d\n", i);
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-        os->bitrate += s->streams[i]->codec->bit_rate;
-
-        if (!os->ctx) {
-            os->first_stream = i;
-            ctx = avformat_alloc_context();
-            if (!ctx) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-            os->ctx = ctx;
-            ctx->oformat = oformat;
-            ctx->interrupt_callback = s->interrupt_callback;
-
-            ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf),
-                                         AVIO_FLAG_WRITE, os,
-                                         NULL, hds_write, NULL);
-            if (!ctx->pb) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-        } else {
-            ctx = os->ctx;
-        }
-        s->streams[i]->id = c->nb_streams;
-
-        if (!(st = avformat_new_stream(ctx, NULL))) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        avcodec_copy_context(st->codec, s->streams[i]->codec);
-        st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
-    }
-    if (c->streams[c->nb_streams].ctx)
-        c->nb_streams++;
-
-    for (i = 0; i < c->nb_streams; i++) {
-        OutputStream *os = &c->streams[i];
-        int j;
-        if ((ret = avformat_write_header(os->ctx, NULL)) < 0) {
-             goto fail;
-        }
-        os->ctx_inited = 1;
-        avio_flush(os->ctx->pb);
-        for (j = 0; j < os->ctx->nb_streams; j++)
-            s->streams[os->first_stream + j]->time_base = os->ctx->streams[j]->time_base;
-
-        snprintf(os->temp_filename, sizeof(os->temp_filename),
-                 "%s/stream%d_temp", s->filename, i);
-        ret = init_file(s, os, 0);
-        if (ret < 0)
-            goto fail;
-
-        if (!os->has_video && c->min_frag_duration <= 0) {
-            av_log(s, AV_LOG_WARNING,
-                   "No video stream in output stream %d and no min frag duration set\n", i);
-            ret = AVERROR(EINVAL);
-        }
-        os->fragment_index = 1;
-        write_abst(s, os, 0);
-    }
-    ret = write_manifest(s, 0);
-
-fail:
-    if (ret)
-        hds_free(s);
-    return ret;
-}
-
-static int add_fragment(OutputStream *os, const char *file,
-                        int64_t start_time, int64_t duration)
-{
-    Fragment *frag;
-    if (duration == 0)
-        duration = 1;
-    if (os->nb_fragments >= os->fragments_size) {
-        int ret;
-        os->fragments_size = (os->fragments_size + 1) * 2;
-        if ((ret = av_reallocp_array(&os->fragments, os->fragments_size,
-                                     sizeof(*os->fragments))) < 0) {
-            os->fragments_size = 0;
-            os->nb_fragments   = 0;
-            return ret;
-        }
-    }
-    frag = av_mallocz(sizeof(*frag));
-    if (!frag)
-        return AVERROR(ENOMEM);
-    av_strlcpy(frag->file, file, sizeof(frag->file));
-    frag->start_time = start_time;
-    frag->duration   = duration;
-    frag->n          = os->fragment_index;
-    os->fragments[os->nb_fragments++] = frag;
-    os->fragment_index++;
-    return 0;
-}
-
-static int hds_flush(AVFormatContext *s, OutputStream *os, int final,
-                     int64_t end_ts)
-{
-    HDSContext *c = s->priv_data;
-    int i, ret = 0;
-    char target_filename[1024];
-    int index = s->streams[os->first_stream]->id;
-
-    if (!os->packets_written)
-        return 0;
-
-    avio_flush(os->ctx->pb);
-    os->packets_written = 0;
-    close_file(os);
-
-    snprintf(target_filename, sizeof(target_filename),
-             "%s/stream%dSeg1-Frag%d", s->filename, index, os->fragment_index);
-    rename(os->temp_filename, target_filename);
-    add_fragment(os, target_filename, os->frag_start_ts, end_ts - os->frag_start_ts);
-
-    if (!final) {
-        ret = init_file(s, os, end_ts);
-        if (ret < 0)
-            return ret;
-    }
-
-    if (c->window_size || (final && c->remove_at_exit)) {
-        int remove = os->nb_fragments - c->window_size - c->extra_window_size;
-        if (final && c->remove_at_exit)
-            remove = os->nb_fragments;
-        if (remove > 0) {
-            for (i = 0; i < remove; i++) {
-                unlink(os->fragments[i]->file);
-                av_free(os->fragments[i]);
-            }
-            os->nb_fragments -= remove;
-            memmove(os->fragments, os->fragments + remove,
-                    os->nb_fragments * sizeof(*os->fragments));
-        }
-    }
-
-    if (ret >= 0)
-        ret = write_abst(s, os, final);
-    return ret;
-}
-
-static int hds_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    HDSContext *c = s->priv_data;
-    AVStream *st = s->streams[pkt->stream_index];
-    OutputStream *os = &c->streams[s->streams[pkt->stream_index]->id];
-    int64_t end_dts = os->fragment_index * (int64_t) c->min_frag_duration;
-    int ret;
-
-    if (st->first_dts == AV_NOPTS_VALUE)
-        st->first_dts = pkt->dts;
-
-    if ((!os->has_video || st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
-        av_compare_ts(pkt->dts - st->first_dts, st->time_base,
-                      end_dts, AV_TIME_BASE_Q) >= 0 &&
-        pkt->flags & AV_PKT_FLAG_KEY && os->packets_written) {
-
-        if ((ret = hds_flush(s, os, 0, pkt->dts)) < 0)
-            return ret;
-    }
-
-    // Note, these fragment start timestamps, that represent a whole
-    // OutputStream, assume all streams in it have the same time base.
-    if (!os->packets_written)
-        os->frag_start_ts = pkt->dts;
-    os->last_ts = pkt->dts;
-
-    os->packets_written++;
-    return ff_write_chained(os->ctx, pkt->stream_index - os->first_stream, pkt, s);
-}
-
-static int hds_write_trailer(AVFormatContext *s)
-{
-    HDSContext *c = s->priv_data;
-    int i;
-
-    for (i = 0; i < c->nb_streams; i++)
-        hds_flush(s, &c->streams[i], 1, c->streams[i].last_ts);
-    write_manifest(s, 1);
-
-    if (c->remove_at_exit) {
-        char filename[1024];
-        snprintf(filename, sizeof(filename), "%s/index.f4m", s->filename);
-        unlink(filename);
-        for (i = 0; i < c->nb_streams; i++) {
-            snprintf(filename, sizeof(filename), "%s/stream%d.abst", s->filename, i);
-            unlink(filename);
-        }
-        rmdir(s->filename);
-    }
-
-    hds_free(s);
-    return 0;
-}
-
-#define OFFSET(x) offsetof(HDSContext, x)
-#define E AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "window_size", "number of fragments kept in the manifest", OFFSET(window_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, E },
-    { "extra_window_size", "number of fragments kept outside of the manifest before removing from disk", OFFSET(extra_window_size), AV_OPT_TYPE_INT, { .i64 = 5 }, 0, INT_MAX, E },
-    { "min_frag_duration", "minimum fragment duration (in microseconds)", OFFSET(min_frag_duration), AV_OPT_TYPE_INT64, { .i64 = 10000000 }, 0, INT_MAX, E },
-    { "remove_at_exit", "remove all fragments when finished", OFFSET(remove_at_exit), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E },
-    { NULL },
-};
-
-static const AVClass hds_class = {
-    .class_name = "HDS muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVOutputFormat ff_hds_muxer = {
-    .name           = "hds",
-    .long_name      = NULL_IF_CONFIG_SMALL("HDS Muxer"),
-    .priv_data_size = sizeof(HDSContext),
-    .audio_codec    = AV_CODEC_ID_AAC,
-    .video_codec    = AV_CODEC_ID_H264,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
-    .write_header   = hds_write_header,
-    .write_packet   = hds_write_packet,
-    .write_trailer  = hds_write_trailer,
-    .priv_class     = &hds_class,
-};
diff --git a/deps/libav/libavformat/hevc.c b/deps/libav/libavformat/hevc.c
deleted file mode 100644
index 37b35b4..0000000
--- a/deps/libav/libavformat/hevc.c
+++ /dev/null
@@ -1,1140 +0,0 @@
-/*
- * Copyright (c) 2014 Tim Walker <tdskywalker at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/get_bits.h"
-#include "libavcodec/golomb.h"
-#include "libavcodec/hevc.h"
-#include "libavutil/intreadwrite.h"
-#include "avc.h"
-#include "avio.h"
-#include "hevc.h"
-
-#define MAX_SPATIAL_SEGMENTATION 4096 // max. value of u(12) field
-
-typedef struct HVCCNALUnitArray {
-    uint8_t  array_completeness;
-    uint8_t  NAL_unit_type;
-    uint16_t numNalus;
-    uint16_t *nalUnitLength;
-    uint8_t  **nalUnit;
-} HVCCNALUnitArray;
-
-typedef struct HEVCDecoderConfigurationRecord {
-    uint8_t  configurationVersion;
-    uint8_t  general_profile_space;
-    uint8_t  general_tier_flag;
-    uint8_t  general_profile_idc;
-    uint32_t general_profile_compatibility_flags;
-    uint64_t general_constraint_indicator_flags;
-    uint8_t  general_level_idc;
-    uint16_t min_spatial_segmentation_idc;
-    uint8_t  parallelismType;
-    uint8_t  chromaFormat;
-    uint8_t  bitDepthLumaMinus8;
-    uint8_t  bitDepthChromaMinus8;
-    uint16_t avgFrameRate;
-    uint8_t  constantFrameRate;
-    uint8_t  numTemporalLayers;
-    uint8_t  temporalIdNested;
-    uint8_t  lengthSizeMinusOne;
-    uint8_t  numOfArrays;
-    HVCCNALUnitArray *array;
-} HEVCDecoderConfigurationRecord;
-
-typedef struct HVCCProfileTierLevel {
-    uint8_t  profile_space;
-    uint8_t  tier_flag;
-    uint8_t  profile_idc;
-    uint32_t profile_compatibility_flags;
-    uint64_t constraint_indicator_flags;
-    uint8_t  level_idc;
-} HVCCProfileTierLevel;
-
-static void hvcc_update_ptl(HEVCDecoderConfigurationRecord *hvcc,
-                            HVCCProfileTierLevel *ptl)
-{
-    /*
-     * The value of general_profile_space in all the parameter sets must be
-     * identical.
-     */
-    hvcc->general_profile_space = ptl->profile_space;
-
-    /*
-     * The level indication general_level_idc must indicate a level of
-     * capability equal to or greater than the highest level indicated for the
-     * highest tier in all the parameter sets.
-     */
-    if (hvcc->general_tier_flag < ptl->tier_flag)
-        hvcc->general_level_idc = ptl->level_idc;
-    else
-        hvcc->general_level_idc = FFMAX(hvcc->general_level_idc, ptl->level_idc);
-
-    /*
-     * The tier indication general_tier_flag must indicate a tier equal to or
-     * greater than the highest tier indicated in all the parameter sets.
-     */
-    hvcc->general_tier_flag = FFMAX(hvcc->general_tier_flag, ptl->tier_flag);
-
-    /*
-     * The profile indication general_profile_idc must indicate a profile to
-     * which the stream associated with this configuration record conforms.
-     *
-     * If the sequence parameter sets are marked with different profiles, then
-     * the stream may need examination to determine which profile, if any, the
-     * entire stream conforms to. If the entire stream is not examined, or the
-     * examination reveals that there is no profile to which the entire stream
-     * conforms, then the entire stream must be split into two or more
-     * sub-streams with separate configuration records in which these rules can
-     * be met.
-     *
-     * Note: set the profile to the highest value for the sake of simplicity.
-     */
-    hvcc->general_profile_idc = FFMAX(hvcc->general_profile_idc, ptl->profile_idc);
-
-    /*
-     * Each bit in general_profile_compatibility_flags may only be set if all
-     * the parameter sets set that bit.
-     */
-    hvcc->general_profile_compatibility_flags &= ptl->profile_compatibility_flags;
-
-    /*
-     * Each bit in general_constraint_indicator_flags may only be set if all
-     * the parameter sets set that bit.
-     */
-    hvcc->general_constraint_indicator_flags &= ptl->constraint_indicator_flags;
-}
-
-static void hvcc_parse_ptl(GetBitContext *gb,
-                           HEVCDecoderConfigurationRecord *hvcc,
-                           unsigned int max_sub_layers_minus1)
-{
-    unsigned int i;
-    HVCCProfileTierLevel general_ptl;
-    uint8_t sub_layer_profile_present_flag[MAX_SUB_LAYERS];
-    uint8_t sub_layer_level_present_flag[MAX_SUB_LAYERS];
-
-    general_ptl.profile_space               = get_bits(gb, 2);
-    general_ptl.tier_flag                   = get_bits1(gb);
-    general_ptl.profile_idc                 = get_bits(gb, 5);
-    general_ptl.profile_compatibility_flags = get_bits_long(gb, 32);
-    general_ptl.constraint_indicator_flags  = get_bits64(gb, 48);
-    general_ptl.level_idc                   = get_bits(gb, 8);
-    hvcc_update_ptl(hvcc, &general_ptl);
-
-    for (i = 0; i < max_sub_layers_minus1; i++) {
-        sub_layer_profile_present_flag[i] = get_bits1(gb);
-        sub_layer_level_present_flag[i]   = get_bits1(gb);
-    }
-
-    if (max_sub_layers_minus1 > 0)
-        for (i = max_sub_layers_minus1; i < 8; i++)
-            skip_bits(gb, 2); // reserved_zero_2bits[i]
-
-    for (i = 0; i < max_sub_layers_minus1; i++) {
-        if (sub_layer_profile_present_flag[i]) {
-            /*
-             * sub_layer_profile_space[i]                     u(2)
-             * sub_layer_tier_flag[i]                         u(1)
-             * sub_layer_profile_idc[i]                       u(5)
-             * sub_layer_profile_compatibility_flag[i][0..31] u(32)
-             * sub_layer_progressive_source_flag[i]           u(1)
-             * sub_layer_interlaced_source_flag[i]            u(1)
-             * sub_layer_non_packed_constraint_flag[i]        u(1)
-             * sub_layer_frame_only_constraint_flag[i]        u(1)
-             * sub_layer_reserved_zero_44bits[i]              u(44)
-             */
-            skip_bits_long(gb, 32);
-            skip_bits_long(gb, 32);
-            skip_bits     (gb, 24);
-        }
-
-        if (sub_layer_level_present_flag[i])
-            skip_bits(gb, 8);
-    }
-}
-
-static void skip_sub_layer_hrd_parameters(GetBitContext *gb,
-                                          unsigned int cpb_cnt_minus1,
-                                          uint8_t sub_pic_hrd_params_present_flag)
-{
-    unsigned int i;
-
-    for (i = 0; i <= cpb_cnt_minus1; i++) {
-        get_ue_golomb_long(gb); // bit_rate_value_minus1
-        get_ue_golomb_long(gb); // cpb_size_value_minus1
-
-        if (sub_pic_hrd_params_present_flag) {
-            get_ue_golomb_long(gb); // cpb_size_du_value_minus1
-            get_ue_golomb_long(gb); // bit_rate_du_value_minus1
-        }
-
-        skip_bits1(gb); // cbr_flag
-    }
-}
-
-static void skip_hrd_parameters(GetBitContext *gb, uint8_t cprms_present_flag,
-                                unsigned int max_sub_layers_minus1)
-{
-    unsigned int i;
-    uint8_t sub_pic_hrd_params_present_flag = 0;
-    uint8_t nal_hrd_parameters_present_flag = 0;
-    uint8_t vcl_hrd_parameters_present_flag = 0;
-
-    if (cprms_present_flag) {
-        nal_hrd_parameters_present_flag = get_bits1(gb);
-        vcl_hrd_parameters_present_flag = get_bits1(gb);
-
-        if (nal_hrd_parameters_present_flag ||
-            vcl_hrd_parameters_present_flag) {
-            sub_pic_hrd_params_present_flag = get_bits1(gb);
-
-            if (sub_pic_hrd_params_present_flag)
-                /*
-                 * tick_divisor_minus2                          u(8)
-                 * du_cpb_removal_delay_increment_length_minus1 u(5)
-                 * sub_pic_cpb_params_in_pic_timing_sei_flag    u(1)
-                 * dpb_output_delay_du_length_minus1            u(5)
-                 */
-                skip_bits(gb, 19);
-
-            /*
-             * bit_rate_scale u(4)
-             * cpb_size_scale u(4)
-             */
-            skip_bits(gb, 8);
-
-            if (sub_pic_hrd_params_present_flag)
-                skip_bits(gb, 4); // cpb_size_du_scale
-
-            /*
-             * initial_cpb_removal_delay_length_minus1 u(5)
-             * au_cpb_removal_delay_length_minus1      u(5)
-             * dpb_output_delay_length_minus1          u(5)
-             */
-            skip_bits(gb, 15);
-        }
-    }
-
-    for (i = 0; i <= max_sub_layers_minus1; i++) {
-        unsigned int cpb_cnt_minus1            = 0;
-        uint8_t low_delay_hrd_flag             = 0;
-        uint8_t fixed_pic_rate_within_cvs_flag = 0;
-        uint8_t fixed_pic_rate_general_flag    = get_bits1(gb);
-
-        if (!fixed_pic_rate_general_flag)
-            fixed_pic_rate_within_cvs_flag = get_bits1(gb);
-
-        if (fixed_pic_rate_within_cvs_flag)
-            get_ue_golomb_long(gb); // elemental_duration_in_tc_minus1
-        else
-            low_delay_hrd_flag = get_bits1(gb);
-
-        if (!low_delay_hrd_flag)
-            cpb_cnt_minus1 = get_ue_golomb_long(gb);
-
-        if (nal_hrd_parameters_present_flag)
-            skip_sub_layer_hrd_parameters(gb, cpb_cnt_minus1,
-                                          sub_pic_hrd_params_present_flag);
-
-        if (vcl_hrd_parameters_present_flag)
-            skip_sub_layer_hrd_parameters(gb, cpb_cnt_minus1,
-                                          sub_pic_hrd_params_present_flag);
-    }
-}
-
-static void skip_timing_info(GetBitContext *gb)
-{
-    skip_bits_long(gb, 32); // num_units_in_tick
-    skip_bits_long(gb, 32); // time_scale
-
-    if (get_bits1(gb))          // poc_proportional_to_timing_flag
-        get_ue_golomb_long(gb); // num_ticks_poc_diff_one_minus1
-}
-
-static void hvcc_parse_vui(GetBitContext *gb,
-                           HEVCDecoderConfigurationRecord *hvcc,
-                           unsigned int max_sub_layers_minus1)
-{
-    unsigned int min_spatial_segmentation_idc;
-
-    if (get_bits1(gb))              // aspect_ratio_info_present_flag
-        if (get_bits(gb, 8) == 255) // aspect_ratio_idc
-            skip_bits_long(gb, 32); // sar_width u(16), sar_height u(16)
-
-    if (get_bits1(gb))  // overscan_info_present_flag
-        skip_bits1(gb); // overscan_appropriate_flag
-
-    if (get_bits1(gb)) {  // video_signal_type_present_flag
-        skip_bits(gb, 4); // video_format u(3), video_full_range_flag u(1)
-
-        if (get_bits1(gb)) // colour_description_present_flag
-            /*
-             * colour_primaries         u(8)
-             * transfer_characteristics u(8)
-             * matrix_coeffs            u(8)
-             */
-            skip_bits(gb, 24);
-    }
-
-    if (get_bits1(gb)) {        // chroma_loc_info_present_flag
-        get_ue_golomb_long(gb); // chroma_sample_loc_type_top_field
-        get_ue_golomb_long(gb); // chroma_sample_loc_type_bottom_field
-    }
-
-    /*
-     * neutral_chroma_indication_flag u(1)
-     * field_seq_flag                 u(1)
-     * frame_field_info_present_flag  u(1)
-     */
-    skip_bits(gb, 3);
-
-    if (get_bits1(gb)) {        // default_display_window_flag
-        get_ue_golomb_long(gb); // def_disp_win_left_offset
-        get_ue_golomb_long(gb); // def_disp_win_right_offset
-        get_ue_golomb_long(gb); // def_disp_win_top_offset
-        get_ue_golomb_long(gb); // def_disp_win_bottom_offset
-    }
-
-    if (get_bits1(gb)) { // vui_timing_info_present_flag
-        skip_timing_info(gb);
-
-        if (get_bits1(gb)) // vui_hrd_parameters_present_flag
-            skip_hrd_parameters(gb, 1, max_sub_layers_minus1);
-    }
-
-    if (get_bits1(gb)) { // bitstream_restriction_flag
-        /*
-         * tiles_fixed_structure_flag              u(1)
-         * motion_vectors_over_pic_boundaries_flag u(1)
-         * restricted_ref_pic_lists_flag           u(1)
-         */
-        skip_bits(gb, 3);
-
-        min_spatial_segmentation_idc = get_ue_golomb_long(gb);
-
-        /*
-         * unsigned int(12) min_spatial_segmentation_idc;
-         *
-         * The min_spatial_segmentation_idc indication must indicate a level of
-         * spatial segmentation equal to or less than the lowest level of
-         * spatial segmentation indicated in all the parameter sets.
-         */
-        hvcc->min_spatial_segmentation_idc = FFMIN(hvcc->min_spatial_segmentation_idc,
-                                                   min_spatial_segmentation_idc);
-
-        get_ue_golomb_long(gb); // max_bytes_per_pic_denom
-        get_ue_golomb_long(gb); // max_bits_per_min_cu_denom
-        get_ue_golomb_long(gb); // log2_max_mv_length_horizontal
-        get_ue_golomb_long(gb); // log2_max_mv_length_vertical
-    }
-}
-
-static void skip_sub_layer_ordering_info(GetBitContext *gb)
-{
-    get_ue_golomb_long(gb); // max_dec_pic_buffering_minus1
-    get_ue_golomb_long(gb); // max_num_reorder_pics
-    get_ue_golomb_long(gb); // max_latency_increase_plus1
-}
-
-static int hvcc_parse_vps(GetBitContext *gb,
-                          HEVCDecoderConfigurationRecord *hvcc)
-{
-    unsigned int vps_max_sub_layers_minus1;
-
-    /*
-     * vps_video_parameter_set_id u(4)
-     * vps_reserved_three_2bits   u(2)
-     * vps_max_layers_minus1      u(6)
-     */
-    skip_bits(gb, 12);
-
-    vps_max_sub_layers_minus1 = get_bits(gb, 3);
-
-    /*
-     * numTemporalLayers greater than 1 indicates that the stream to which this
-     * configuration record applies is temporally scalable and the contained
-     * number of temporal layers (also referred to as temporal sub-layer or
-     * sub-layer in ISO/IEC 23008-2) is equal to numTemporalLayers. Value 1
-     * indicates that the stream is not temporally scalable. Value 0 indicates
-     * that it is unknown whether the stream is temporally scalable.
-     */
-    hvcc->numTemporalLayers = FFMAX(hvcc->numTemporalLayers,
-                                    vps_max_sub_layers_minus1 + 1);
-
-    /*
-     * vps_temporal_id_nesting_flag u(1)
-     * vps_reserved_0xffff_16bits   u(16)
-     */
-    skip_bits(gb, 17);
-
-    hvcc_parse_ptl(gb, hvcc, vps_max_sub_layers_minus1);
-
-    /* nothing useful for hvcC past this point */
-    return 0;
-}
-
-static void skip_scaling_list_data(GetBitContext *gb)
-{
-    int i, j, k, num_coeffs;
-
-    for (i = 0; i < 4; i++)
-        for (j = 0; j < (i == 3 ? 2 : 6); j++)
-            if (!get_bits1(gb))         // scaling_list_pred_mode_flag[i][j]
-                get_ue_golomb_long(gb); // scaling_list_pred_matrix_id_delta[i][j]
-            else {
-                num_coeffs = FFMIN(64, 1 << (4 + (i << 1)));
-
-                if (i > 1)
-                    get_se_golomb_long(gb); // scaling_list_dc_coef_minus8[i-2][j]
-
-                for (k = 0; k < num_coeffs; k++)
-                    get_se_golomb_long(gb); // scaling_list_delta_coef
-            }
-}
-
-static int parse_rps(GetBitContext *gb, unsigned int rps_idx,
-                     unsigned int num_rps,
-                     unsigned int num_delta_pocs[MAX_SHORT_TERM_RPS_COUNT])
-{
-    unsigned int i;
-
-    if (rps_idx && get_bits1(gb)) { // inter_ref_pic_set_prediction_flag
-        /* this should only happen for slice headers, and this isn't one */
-        if (rps_idx >= num_rps)
-            return AVERROR_INVALIDDATA;
-
-        skip_bits1        (gb); // delta_rps_sign
-        get_ue_golomb_long(gb); // abs_delta_rps_minus1
-
-        num_delta_pocs[rps_idx] = 0;
-
-        /*
-         * From libavcodec/hevc_ps.c:
-         *
-         * if (is_slice_header) {
-         *    //foo
-         * } else
-         *     rps_ridx = &sps->st_rps[rps - sps->st_rps - 1];
-         *
-         * where:
-         * rps:             &sps->st_rps[rps_idx]
-         * sps->st_rps:     &sps->st_rps[0]
-         * is_slice_header: rps_idx == num_rps
-         *
-         * thus:
-         * if (num_rps != rps_idx)
-         *     rps_ridx = &sps->st_rps[rps_idx - 1];
-         *
-         * NumDeltaPocs[RefRpsIdx]: num_delta_pocs[rps_idx - 1]
-         */
-        for (i = 0; i < num_delta_pocs[rps_idx - 1]; i++) {
-            uint8_t use_delta_flag = 0;
-            uint8_t used_by_curr_pic_flag = get_bits1(gb);
-            if (!used_by_curr_pic_flag)
-                use_delta_flag = get_bits1(gb);
-
-            if (used_by_curr_pic_flag || use_delta_flag)
-                num_delta_pocs[rps_idx]++;
-        }
-    } else {
-        unsigned int num_negative_pics = get_ue_golomb_long(gb);
-        unsigned int num_positive_pics = get_ue_golomb_long(gb);
-
-        num_delta_pocs[rps_idx] = num_negative_pics + num_positive_pics;
-
-        for (i = 0; i < num_negative_pics; i++) {
-            get_ue_golomb_long(gb); // delta_poc_s0_minus1[rps_idx]
-            skip_bits1        (gb); // used_by_curr_pic_s0_flag[rps_idx]
-        }
-
-        for (i = 0; i < num_positive_pics; i++) {
-            get_ue_golomb_long(gb); // delta_poc_s1_minus1[rps_idx]
-            skip_bits1        (gb); // used_by_curr_pic_s1_flag[rps_idx]
-        }
-    }
-
-    return 0;
-}
-
-static int hvcc_parse_sps(GetBitContext *gb,
-                          HEVCDecoderConfigurationRecord *hvcc)
-{
-    unsigned int i, sps_max_sub_layers_minus1, log2_max_pic_order_cnt_lsb_minus4;
-    unsigned int num_short_term_ref_pic_sets, num_delta_pocs[MAX_SHORT_TERM_RPS_COUNT];
-
-    skip_bits(gb, 4); // sps_video_parameter_set_id
-
-    sps_max_sub_layers_minus1 = get_bits (gb, 3);
-
-    /*
-     * numTemporalLayers greater than 1 indicates that the stream to which this
-     * configuration record applies is temporally scalable and the contained
-     * number of temporal layers (also referred to as temporal sub-layer or
-     * sub-layer in ISO/IEC 23008-2) is equal to numTemporalLayers. Value 1
-     * indicates that the stream is not temporally scalable. Value 0 indicates
-     * that it is unknown whether the stream is temporally scalable.
-     */
-    hvcc->numTemporalLayers = FFMAX(hvcc->numTemporalLayers,
-                                    sps_max_sub_layers_minus1 + 1);
-
-    hvcc->temporalIdNested = get_bits1(gb);
-
-    hvcc_parse_ptl(gb, hvcc, sps_max_sub_layers_minus1);
-
-    get_ue_golomb_long(gb); // sps_seq_parameter_set_id
-
-    hvcc->chromaFormat = get_ue_golomb_long(gb);
-
-    if (hvcc->chromaFormat == 3)
-        skip_bits1(gb); // separate_colour_plane_flag
-
-    get_ue_golomb_long(gb); // pic_width_in_luma_samples
-    get_ue_golomb_long(gb); // pic_height_in_luma_samples
-
-    if (get_bits1(gb)) {        // conformance_window_flag
-        get_ue_golomb_long(gb); // conf_win_left_offset
-        get_ue_golomb_long(gb); // conf_win_right_offset
-        get_ue_golomb_long(gb); // conf_win_top_offset
-        get_ue_golomb_long(gb); // conf_win_bottom_offset
-    }
-
-    hvcc->bitDepthLumaMinus8          = get_ue_golomb_long(gb);
-    hvcc->bitDepthChromaMinus8        = get_ue_golomb_long(gb);
-    log2_max_pic_order_cnt_lsb_minus4 = get_ue_golomb_long(gb);
-
-    /* sps_sub_layer_ordering_info_present_flag */
-    i = get_bits1(gb) ? 0 : sps_max_sub_layers_minus1;
-    for (; i <= sps_max_sub_layers_minus1; i++)
-        skip_sub_layer_ordering_info(gb);
-
-    get_ue_golomb_long(gb); // log2_min_luma_coding_block_size_minus3
-    get_ue_golomb_long(gb); // log2_diff_max_min_luma_coding_block_size
-    get_ue_golomb_long(gb); // log2_min_transform_block_size_minus2
-    get_ue_golomb_long(gb); // log2_diff_max_min_transform_block_size
-    get_ue_golomb_long(gb); // max_transform_hierarchy_depth_inter
-    get_ue_golomb_long(gb); // max_transform_hierarchy_depth_intra
-
-    if (get_bits1(gb) && // scaling_list_enabled_flag
-        get_bits1(gb))   // sps_scaling_list_data_present_flag
-        skip_scaling_list_data(gb);
-
-    skip_bits1(gb); // amp_enabled_flag
-    skip_bits1(gb); // sample_adaptive_offset_enabled_flag
-
-    if (get_bits1(gb)) {           // pcm_enabled_flag
-        skip_bits         (gb, 4); // pcm_sample_bit_depth_luma_minus1
-        skip_bits         (gb, 4); // pcm_sample_bit_depth_chroma_minus1
-        get_ue_golomb_long(gb);    // log2_min_pcm_luma_coding_block_size_minus3
-        get_ue_golomb_long(gb);    // log2_diff_max_min_pcm_luma_coding_block_size
-        skip_bits1        (gb);    // pcm_loop_filter_disabled_flag
-    }
-
-    num_short_term_ref_pic_sets = get_ue_golomb_long(gb);
-    if (num_short_term_ref_pic_sets > MAX_SHORT_TERM_RPS_COUNT)
-        return AVERROR_INVALIDDATA;
-
-    for (i = 0; i < num_short_term_ref_pic_sets; i++) {
-        int ret = parse_rps(gb, i, num_short_term_ref_pic_sets, num_delta_pocs);
-        if (ret < 0)
-            return ret;
-    }
-
-    if (get_bits1(gb)) {                               // long_term_ref_pics_present_flag
-        for (i = 0; i < get_ue_golomb_long(gb); i++) { // num_long_term_ref_pics_sps
-            int len = FFMIN(log2_max_pic_order_cnt_lsb_minus4 + 4, 16);
-            skip_bits (gb, len); // lt_ref_pic_poc_lsb_sps[i]
-            skip_bits1(gb);      // used_by_curr_pic_lt_sps_flag[i]
-        }
-    }
-
-    skip_bits1(gb); // sps_temporal_mvp_enabled_flag
-    skip_bits1(gb); // strong_intra_smoothing_enabled_flag
-
-    if (get_bits1(gb)) // vui_parameters_present_flag
-        hvcc_parse_vui(gb, hvcc, sps_max_sub_layers_minus1);
-
-    /* nothing useful for hvcC past this point */
-    return 0;
-}
-
-static int hvcc_parse_pps(GetBitContext *gb,
-                          HEVCDecoderConfigurationRecord *hvcc)
-{
-    uint8_t tiles_enabled_flag, entropy_coding_sync_enabled_flag;
-
-    get_ue_golomb_long(gb); // pps_pic_parameter_set_id
-    get_ue_golomb_long(gb); // pps_seq_parameter_set_id
-
-    /*
-     * dependent_slice_segments_enabled_flag u(1)
-     * output_flag_present_flag              u(1)
-     * num_extra_slice_header_bits           u(3)
-     * sign_data_hiding_enabled_flag         u(1)
-     * cabac_init_present_flag               u(1)
-     */
-    skip_bits(gb, 7);
-
-    get_ue_golomb_long(gb); // num_ref_idx_l0_default_active_minus1
-    get_ue_golomb_long(gb); // num_ref_idx_l1_default_active_minus1
-    get_se_golomb_long(gb); // init_qp_minus26
-
-    /*
-     * constrained_intra_pred_flag u(1)
-     * transform_skip_enabled_flag u(1)
-     */
-    skip_bits(gb, 2);
-
-    if (get_bits1(gb))          // cu_qp_delta_enabled_flag
-        get_ue_golomb_long(gb); // diff_cu_qp_delta_depth
-
-    get_se_golomb_long(gb); // pps_cb_qp_offset
-    get_se_golomb_long(gb); // pps_cr_qp_offset
-
-    /*
-     * weighted_pred_flag               u(1)
-     * weighted_bipred_flag             u(1)
-     * transquant_bypass_enabled_flag   u(1)
-     */
-    skip_bits(gb, 3);
-
-    tiles_enabled_flag               = get_bits1(gb);
-    entropy_coding_sync_enabled_flag = get_bits1(gb);
-
-    if (entropy_coding_sync_enabled_flag && tiles_enabled_flag)
-        hvcc->parallelismType = 0; // mixed-type parallel decoding
-    else if (entropy_coding_sync_enabled_flag)
-        hvcc->parallelismType = 3; // wavefront-based parallel decoding
-    else if (tiles_enabled_flag)
-        hvcc->parallelismType = 2; // tile-based parallel decoding
-    else
-        hvcc->parallelismType = 1; // slice-based parallel decoding
-
-    /* nothing useful for hvcC past this point */
-    return 0;
-}
-
-static uint8_t *nal_unit_extract_rbsp(const uint8_t *src, uint32_t src_len,
-                                      uint32_t *dst_len)
-{
-    uint8_t *dst;
-    uint32_t i, len;
-
-    dst = av_malloc(src_len);
-    if (!dst)
-        return NULL;
-
-    /* NAL unit header (2 bytes) */
-    i = len = 0;
-    while (i < 2 && i < src_len)
-        dst[len++] = src[i++];
-
-    while (i + 2 < src_len)
-        if (!src[i] && !src[i + 1] && src[i + 2] == 3) {
-            dst[len++] = src[i++];
-            dst[len++] = src[i++];
-            i++; // remove emulation_prevention_three_byte
-        } else
-            dst[len++] = src[i++];
-
-    while (i < src_len)
-        dst[len++] = src[i++];
-
-    *dst_len = len;
-    return dst;
-}
-
-
-
-static void nal_unit_parse_header(GetBitContext *gb, uint8_t *nal_type)
-{
-    skip_bits1(gb); // forbidden_zero_bit
-
-    *nal_type = get_bits(gb, 6);
-
-    /*
-     * nuh_layer_id          u(6)
-     * nuh_temporal_id_plus1 u(3)
-     */
-    skip_bits(gb, 9);
-}
-
-static int hvcc_array_add_nal_unit(uint8_t *nal_buf, uint32_t nal_size,
-                                   uint8_t nal_type, int ps_array_completeness,
-                                   HEVCDecoderConfigurationRecord *hvcc)
-{
-    int ret;
-    uint8_t index;
-    uint16_t numNalus;
-    HVCCNALUnitArray *array;
-
-    for (index = 0; index < hvcc->numOfArrays; index++)
-        if (hvcc->array[index].NAL_unit_type == nal_type)
-            break;
-
-    if (index >= hvcc->numOfArrays) {
-        uint8_t i;
-
-        ret = av_reallocp_array(&hvcc->array, index + 1, sizeof(HVCCNALUnitArray));
-        if (ret < 0)
-            return ret;
-
-        for (i = hvcc->numOfArrays; i <= index; i++)
-            memset(&hvcc->array[i], 0, sizeof(HVCCNALUnitArray));
-        hvcc->numOfArrays = index + 1;
-    }
-
-    array    = &hvcc->array[index];
-    numNalus = array->numNalus;
-
-    ret = av_reallocp_array(&array->nalUnit, numNalus + 1, sizeof(uint8_t*));
-    if (ret < 0)
-        return ret;
-
-    ret = av_reallocp_array(&array->nalUnitLength, numNalus + 1, sizeof(uint16_t));
-    if (ret < 0)
-        return ret;
-
-    array->nalUnit      [numNalus] = nal_buf;
-    array->nalUnitLength[numNalus] = nal_size;
-    array->NAL_unit_type           = nal_type;
-    array->numNalus++;
-
-    /*
-     * When the sample entry name is ‘hvc1’, the default and mandatory value of
-     * array_completeness is 1 for arrays of all types of parameter sets, and 0
-     * for all other arrays. When the sample entry name is ‘hev1’, the default
-     * value of array_completeness is 0 for all arrays.
-     */
-    if (nal_type == NAL_VPS || nal_type == NAL_SPS || nal_type == NAL_PPS)
-        array->array_completeness = ps_array_completeness;
-
-    return 0;
-}
-
-static int hvcc_add_nal_unit(uint8_t *nal_buf, uint32_t nal_size,
-                             int ps_array_completeness,
-                             HEVCDecoderConfigurationRecord *hvcc)
-{
-    int ret = 0;
-    GetBitContext gbc;
-    uint8_t nal_type;
-    uint8_t *rbsp_buf;
-    uint32_t rbsp_size;
-
-    rbsp_buf = nal_unit_extract_rbsp(nal_buf, nal_size, &rbsp_size);
-    if (!rbsp_buf) {
-        ret = AVERROR(ENOMEM);
-        goto end;
-    }
-
-    ret = init_get_bits8(&gbc, rbsp_buf, rbsp_size);
-    if (ret < 0)
-        goto end;
-
-    nal_unit_parse_header(&gbc, &nal_type);
-
-    /*
-     * Note: only 'declarative' SEI messages are allowed in
-     * hvcC. Perhaps the SEI playload type should be checked
-     * and non-declarative SEI messages discarded?
-     */
-    switch (nal_type) {
-    case NAL_VPS:
-    case NAL_SPS:
-    case NAL_PPS:
-    case NAL_SEI_PREFIX:
-    case NAL_SEI_SUFFIX:
-        ret = hvcc_array_add_nal_unit(nal_buf, nal_size, nal_type,
-                                      ps_array_completeness, hvcc);
-        if (ret < 0)
-            goto end;
-        else if (nal_type == NAL_VPS)
-            ret = hvcc_parse_vps(&gbc, hvcc);
-        else if (nal_type == NAL_SPS)
-            ret = hvcc_parse_sps(&gbc, hvcc);
-        else if (nal_type == NAL_PPS)
-            ret = hvcc_parse_pps(&gbc, hvcc);
-        if (ret < 0)
-            goto end;
-        break;
-    default:
-        ret = AVERROR_INVALIDDATA;
-        goto end;
-    }
-
-end:
-    av_free(rbsp_buf);
-    return ret;
-}
-
-static void hvcc_init(HEVCDecoderConfigurationRecord *hvcc)
-{
-    memset(hvcc, 0, sizeof(HEVCDecoderConfigurationRecord));
-    hvcc->configurationVersion = 1;
-    hvcc->lengthSizeMinusOne   = 3; // 4 bytes
-
-    /*
-     * The following fields have all their valid bits set by default,
-     * the ProfileTierLevel parsing code will unset them when needed.
-     */
-    hvcc->general_profile_compatibility_flags = 0xffffffff;
-    hvcc->general_constraint_indicator_flags  = 0xffffffffffff;
-
-    /*
-     * Initialize this field with an invalid value which can be used to detect
-     * whether we didn't see any VUI (in wich case it should be reset to zero).
-     */
-    hvcc->min_spatial_segmentation_idc = MAX_SPATIAL_SEGMENTATION + 1;
-}
-
-static void hvcc_close(HEVCDecoderConfigurationRecord *hvcc)
-{
-    uint8_t i;
-
-    for (i = 0; i < hvcc->numOfArrays; i++) {
-        hvcc->array[i].numNalus = 0;
-        av_freep(&hvcc->array[i].nalUnit);
-        av_freep(&hvcc->array[i].nalUnitLength);
-    }
-
-    hvcc->numOfArrays = 0;
-    av_freep(&hvcc->array);
-}
-
-static int hvcc_write(AVIOContext *pb, HEVCDecoderConfigurationRecord *hvcc)
-{
-    uint8_t i;
-    uint16_t j, vps_count = 0, sps_count = 0, pps_count = 0;
-
-    /*
-     * We only support writing HEVCDecoderConfigurationRecord version 1.
-     */
-    hvcc->configurationVersion = 1;
-
-    /*
-     * If min_spatial_segmentation_idc is invalid, reset to 0 (unspecified).
-     */
-    if (hvcc->min_spatial_segmentation_idc > MAX_SPATIAL_SEGMENTATION)
-        hvcc->min_spatial_segmentation_idc = 0;
-
-    /*
-     * parallelismType indicates the type of parallelism that is used to meet
-     * the restrictions imposed by min_spatial_segmentation_idc when the value
-     * of min_spatial_segmentation_idc is greater than 0.
-     */
-    if (!hvcc->min_spatial_segmentation_idc)
-        hvcc->parallelismType = 0;
-
-    /*
-     * It's unclear how to properly compute these fields, so
-     * let's always set them to values meaning 'unspecified'.
-     */
-    hvcc->avgFrameRate      = 0;
-    hvcc->constantFrameRate = 0;
-
-    av_dlog(NULL,  "configurationVersion:                %"PRIu8"\n",
-            hvcc->configurationVersion);
-    av_dlog(NULL,  "general_profile_space:               %"PRIu8"\n",
-            hvcc->general_profile_space);
-    av_dlog(NULL,  "general_tier_flag:                   %"PRIu8"\n",
-            hvcc->general_tier_flag);
-    av_dlog(NULL,  "general_profile_idc:                 %"PRIu8"\n",
-            hvcc->general_profile_idc);
-    av_dlog(NULL, "general_profile_compatibility_flags: 0x%08"PRIx32"\n",
-            hvcc->general_profile_compatibility_flags);
-    av_dlog(NULL, "general_constraint_indicator_flags:  0x%012"PRIx64"\n",
-            hvcc->general_constraint_indicator_flags);
-    av_dlog(NULL,  "general_level_idc:                   %"PRIu8"\n",
-            hvcc->general_level_idc);
-    av_dlog(NULL,  "min_spatial_segmentation_idc:        %"PRIu16"\n",
-            hvcc->min_spatial_segmentation_idc);
-    av_dlog(NULL,  "parallelismType:                     %"PRIu8"\n",
-            hvcc->parallelismType);
-    av_dlog(NULL,  "chromaFormat:                        %"PRIu8"\n",
-            hvcc->chromaFormat);
-    av_dlog(NULL,  "bitDepthLumaMinus8:                  %"PRIu8"\n",
-            hvcc->bitDepthLumaMinus8);
-    av_dlog(NULL,  "bitDepthChromaMinus8:                %"PRIu8"\n",
-            hvcc->bitDepthChromaMinus8);
-    av_dlog(NULL,  "avgFrameRate:                        %"PRIu16"\n",
-            hvcc->avgFrameRate);
-    av_dlog(NULL,  "constantFrameRate:                   %"PRIu8"\n",
-            hvcc->constantFrameRate);
-    av_dlog(NULL,  "numTemporalLayers:                   %"PRIu8"\n",
-            hvcc->numTemporalLayers);
-    av_dlog(NULL,  "temporalIdNested:                    %"PRIu8"\n",
-            hvcc->temporalIdNested);
-    av_dlog(NULL,  "lengthSizeMinusOne:                  %"PRIu8"\n",
-            hvcc->lengthSizeMinusOne);
-    av_dlog(NULL,  "numOfArrays:                         %"PRIu8"\n",
-            hvcc->numOfArrays);
-    for (i = 0; i < hvcc->numOfArrays; i++) {
-        av_dlog(NULL, "array_completeness[%"PRIu8"]:               %"PRIu8"\n",
-                i, hvcc->array[i].array_completeness);
-        av_dlog(NULL, "NAL_unit_type[%"PRIu8"]:                    %"PRIu8"\n",
-                i, hvcc->array[i].NAL_unit_type);
-        av_dlog(NULL, "numNalus[%"PRIu8"]:                         %"PRIu16"\n",
-                i, hvcc->array[i].numNalus);
-        for (j = 0; j < hvcc->array[i].numNalus; j++)
-            av_dlog(NULL,
-                    "nalUnitLength[%"PRIu8"][%"PRIu16"]:                 %"PRIu16"\n",
-                    i, j, hvcc->array[i].nalUnitLength[j]);
-    }
-
-    /*
-     * We need at least one of each: VPS, SPS and PPS.
-     */
-    for (i = 0; i < hvcc->numOfArrays; i++)
-        switch (hvcc->array[i].NAL_unit_type) {
-        case NAL_VPS:
-            vps_count += hvcc->array[i].numNalus;
-            break;
-        case NAL_SPS:
-            sps_count += hvcc->array[i].numNalus;
-            break;
-        case NAL_PPS:
-            pps_count += hvcc->array[i].numNalus;
-            break;
-        default:
-            break;
-        }
-    if (!vps_count || vps_count > MAX_VPS_COUNT ||
-        !sps_count || sps_count > MAX_SPS_COUNT ||
-        !pps_count || pps_count > MAX_PPS_COUNT)
-        return AVERROR_INVALIDDATA;
-
-    /* unsigned int(8) configurationVersion = 1; */
-    avio_w8(pb, hvcc->configurationVersion);
-
-    /*
-     * unsigned int(2) general_profile_space;
-     * unsigned int(1) general_tier_flag;
-     * unsigned int(5) general_profile_idc;
-     */
-    avio_w8(pb, hvcc->general_profile_space << 6 |
-                hvcc->general_tier_flag     << 5 |
-                hvcc->general_profile_idc);
-
-    /* unsigned int(32) general_profile_compatibility_flags; */
-    avio_wb32(pb, hvcc->general_profile_compatibility_flags);
-
-    /* unsigned int(48) general_constraint_indicator_flags; */
-    avio_wb32(pb, hvcc->general_constraint_indicator_flags >> 16);
-    avio_wb16(pb, hvcc->general_constraint_indicator_flags);
-
-    /* unsigned int(8) general_level_idc; */
-    avio_w8(pb, hvcc->general_level_idc);
-
-    /*
-     * bit(4) reserved = ‘1111’b;
-     * unsigned int(12) min_spatial_segmentation_idc;
-     */
-    avio_wb16(pb, hvcc->min_spatial_segmentation_idc | 0xf000);
-
-    /*
-     * bit(6) reserved = ‘111111’b;
-     * unsigned int(2) parallelismType;
-     */
-    avio_w8(pb, hvcc->parallelismType | 0xfc);
-
-    /*
-     * bit(6) reserved = ‘111111’b;
-     * unsigned int(2) chromaFormat;
-     */
-    avio_w8(pb, hvcc->chromaFormat | 0xfc);
-
-    /*
-     * bit(5) reserved = ‘11111’b;
-     * unsigned int(3) bitDepthLumaMinus8;
-     */
-    avio_w8(pb, hvcc->bitDepthLumaMinus8 | 0xf8);
-
-    /*
-     * bit(5) reserved = ‘11111’b;
-     * unsigned int(3) bitDepthChromaMinus8;
-     */
-    avio_w8(pb, hvcc->bitDepthChromaMinus8 | 0xf8);
-
-    /* bit(16) avgFrameRate; */
-    avio_wb16(pb, hvcc->avgFrameRate);
-
-    /*
-     * bit(2) constantFrameRate;
-     * bit(3) numTemporalLayers;
-     * bit(1) temporalIdNested;
-     * unsigned int(2) lengthSizeMinusOne;
-     */
-    avio_w8(pb, hvcc->constantFrameRate << 6 |
-                hvcc->numTemporalLayers << 3 |
-                hvcc->temporalIdNested  << 2 |
-                hvcc->lengthSizeMinusOne);
-
-    /* unsigned int(8) numOfArrays; */
-    avio_w8(pb, hvcc->numOfArrays);
-
-    for (i = 0; i < hvcc->numOfArrays; i++) {
-        /*
-         * bit(1) array_completeness;
-         * unsigned int(1) reserved = 0;
-         * unsigned int(6) NAL_unit_type;
-         */
-        avio_w8(pb, hvcc->array[i].array_completeness << 7 |
-                    hvcc->array[i].NAL_unit_type & 0x3f);
-
-        /* unsigned int(16) numNalus; */
-        avio_wb16(pb, hvcc->array[i].numNalus);
-
-        for (j = 0; j < hvcc->array[i].numNalus; j++) {
-            /* unsigned int(16) nalUnitLength; */
-            avio_wb16(pb, hvcc->array[i].nalUnitLength[j]);
-
-            /* bit(8*nalUnitLength) nalUnit; */
-            avio_write(pb, hvcc->array[i].nalUnit[j],
-                       hvcc->array[i].nalUnitLength[j]);
-        }
-    }
-
-    return 0;
-}
-
-int ff_hevc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in,
-                       int size, int filter_ps, int *ps_count)
-{
-    int num_ps = 0, ret = 0;
-    uint8_t *buf, *end, *start = NULL;
-
-    if (!filter_ps) {
-        ret = ff_avc_parse_nal_units(pb, buf_in, size);
-        goto end;
-    }
-
-    ret = ff_avc_parse_nal_units_buf(buf_in, &start, &size);
-    if (ret < 0)
-        goto end;
-
-    ret = 0;
-    buf = start;
-    end = start + size;
-
-    while (end - buf > 4) {
-        uint32_t len = FFMIN(AV_RB32(buf), end - buf - 4);
-        uint8_t type = (buf[4] >> 1) & 0x3f;
-
-        buf += 4;
-
-        switch (type) {
-        case NAL_VPS:
-        case NAL_SPS:
-        case NAL_PPS:
-            num_ps++;
-            break;
-        default:
-            ret += 4 + len;
-            avio_wb32(pb, len);
-            avio_write(pb, buf, len);
-            break;
-        }
-
-        buf += len;
-    }
-
-end:
-    av_free(start);
-    if (ps_count)
-        *ps_count = num_ps;
-    return ret;
-}
-
-int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out,
-                           int *size, int filter_ps, int *ps_count)
-{
-    AVIOContext *pb;
-    int ret;
-
-    ret = avio_open_dyn_buf(&pb);
-    if (ret < 0)
-        return ret;
-
-    ret   = ff_hevc_annexb2mp4(pb, buf_in, *size, filter_ps, ps_count);
-    *size = avio_close_dyn_buf(pb, buf_out);
-
-    return ret;
-}
-
-int ff_isom_write_hvcc(AVIOContext *pb, const uint8_t *data,
-                       int size, int ps_array_completeness)
-{
-    int ret = 0;
-    uint8_t *buf, *end, *start = NULL;
-    HEVCDecoderConfigurationRecord hvcc;
-
-    hvcc_init(&hvcc);
-
-    if (size < 6) {
-        /* We can't write a valid hvcC from the provided data */
-        ret = AVERROR_INVALIDDATA;
-        goto end;
-    } else if (*data == 1) {
-        /* Data is already hvcC-formatted */
-        avio_write(pb, data, size);
-        goto end;
-    } else if (!(AV_RB24(data) == 1 || AV_RB32(data) == 1)) {
-        /* Not a valid Annex B start code prefix */
-        ret = AVERROR_INVALIDDATA;
-        goto end;
-    }
-
-    ret = ff_avc_parse_nal_units_buf(data, &start, &size);
-    if (ret < 0)
-        goto end;
-
-    buf = start;
-    end = start + size;
-
-    while (end - buf > 4) {
-        uint32_t len = FFMIN(AV_RB32(buf), end - buf - 4);
-        uint8_t type = (buf[4] >> 1) & 0x3f;
-
-        buf += 4;
-
-        switch (type) {
-        case NAL_VPS:
-        case NAL_SPS:
-        case NAL_PPS:
-        case NAL_SEI_PREFIX:
-        case NAL_SEI_SUFFIX:
-            ret = hvcc_add_nal_unit(buf, len, ps_array_completeness, &hvcc);
-            if (ret < 0)
-                goto end;
-            break;
-        default:
-            break;
-        }
-
-        buf += len;
-    }
-
-    ret = hvcc_write(pb, &hvcc);
-
-end:
-    hvcc_close(&hvcc);
-    av_free(start);
-    return ret;
-}
diff --git a/deps/libav/libavformat/hevc.h b/deps/libav/libavformat/hevc.h
deleted file mode 100644
index 03c43bd..0000000
--- a/deps/libav/libavformat/hevc.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2014 Tim Walker <tdskywalker at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * internal header for HEVC (de)muxer utilities
- */
-
-#ifndef AVFORMAT_HEVC_H
-#define AVFORMAT_HEVC_H
-
-#include <stdint.h>
-#include "avio.h"
-
-/**
- * Writes Annex B formatted HEVC NAL units to the provided AVIOContext.
- *
- * The NAL units are converted to an MP4-compatible format (start code prefixes
- * are replaced by 4-byte size fields, as per ISO/IEC 14496-15).
- *
- * If filter_ps is non-zero, any HEVC parameter sets found in the input will be
- * discarded, and *ps_count will be set to the number of discarded PS NAL units.
- *
- * @param pb address of the AVIOContext where the data shall be written
- * @param buf_in address of the buffer holding the input data
- * @param size size (in bytes) of the input buffer
- * @param filter_ps whether to write parameter set NAL units to the output (0)
- *        or to discard them (non-zero)
- * @param ps_count address of the variable where the number of discarded
- *        parameter set NAL units shall be written, may be NULL
- * @return the amount (in bytes) of data written in case of success, a negative
- *         value corresponding to an AVERROR code in case of failure
- */
-int ff_hevc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in,
-                       int size, int filter_ps, int *ps_count);
-
-/**
- * Writes Annex B formatted HEVC NAL units to a data buffer.
- *
- * The NAL units are converted to an MP4-compatible format (start code prefixes
- * are replaced by 4-byte size fields, as per ISO/IEC 14496-15).
- *
- * If filter_ps is non-zero, any HEVC parameter sets found in the input will be
- * discarded, and *ps_count will be set to the number of discarded PS NAL units.
- *
- * On output, *size holds the size (in bytes) of the output data buffer.
- *
- * @param buf_in address of the buffer holding the input data
- * @param size address of the variable holding the size (in bytes) of the input
- *        buffer (on input) and of the output buffer (on output)
- * @param buf_out address of the variable holding the address of the output
- *        buffer
- * @param filter_ps whether to write parameter set NAL units to the output (0)
- *        or to discard them (non-zero)
- * @param ps_count address of the variable where the number of discarded
- *        parameter set NAL units shall be written, may be NULL
- * @return the amount (in bytes) of data written in case of success, a negative
- *         value corresponding to an AVERROR code in case of failure
- */
-int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out,
-                           int *size, int filter_ps, int *ps_count);
-
-/**
- * Writes HEVC extradata (parameter sets, declarative SEI NAL units) to the
- * provided AVIOContext.
- *
- * If the extradata is Annex B format, it gets converted to hvcC format before
- * writing.
- *
- * @param pb address of the AVIOContext where the hvcC shall be written
- * @param data address of the buffer holding the data needed to write the hvcC
- * @param size size (in bytes) of the data buffer
- * @param ps_array_completeness whether all parameter sets are in the hvcC (1)
- *        or there may be additional parameter sets in the bitstream (0)
- * @return 0 in case of success, a negative value corresponding to an AVERROR
- *         code in case of failure
- */
-int ff_isom_write_hvcc(AVIOContext *pb, const uint8_t *data,
-                       int size, int ps_array_completeness);
-
-#endif /* AVFORMAT_HEVC_H */
diff --git a/deps/libav/libavformat/hevcdec.c b/deps/libav/libavformat/hevcdec.c
deleted file mode 100644
index 65a3cdf..0000000
--- a/deps/libav/libavformat/hevcdec.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * RAW HEVC video demuxer
- * Copyright (c) 2013 Dirk Farin <dirk.farin at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/hevc.h"
-
-#include "avformat.h"
-#include "rawdec.h"
-
-static int hevc_probe(AVProbeData *p)
-{
-    uint32_t code = -1;
-    int vps = 0, sps = 0, pps = 0, irap = 0;
-    int i;
-
-    for (i = 0; i < p->buf_size - 1; i++) {
-        code = (code << 8) + p->buf[i];
-        if ((code & 0xffffff00) == 0x100) {
-            uint8_t nal2 = p->buf[i + 1];
-            int type = (code & 0x7E) >> 1;
-
-            if (code & 0x81) // forbidden and reserved zero bits
-                return 0;
-
-            if (nal2 & 0xf8) // reserved zero
-                return 0;
-
-            switch (type) {
-            case NAL_VPS:        vps++;  break;
-            case NAL_SPS:        sps++;  break;
-            case NAL_PPS:        pps++;  break;
-            case NAL_BLA_N_LP:
-            case NAL_BLA_W_LP:
-            case NAL_BLA_W_RADL:
-            case NAL_CRA_NUT:
-            case NAL_IDR_N_LP:
-            case NAL_IDR_W_RADL: irap++; break;
-            }
-        }
-    }
-
-    if (vps && sps && pps && irap)
-        return AVPROBE_SCORE_EXTENSION + 1; // 1 more than .mpg
-    return 0;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(hevc, "raw HEVC video", hevc_probe, "hevc,h265,265", AV_CODEC_ID_HEVC)
diff --git a/deps/libav/libavformat/hls.c b/deps/libav/libavformat/hls.c
deleted file mode 100644
index 290f12e..0000000
--- a/deps/libav/libavformat/hls.c
+++ /dev/null
@@ -1,798 +0,0 @@
-/*
- * Apple HTTP Live Streaming demuxer
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Apple HTTP Live Streaming demuxer
- * http://tools.ietf.org/html/draft-pantos-http-live-streaming
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/dict.h"
-#include "libavutil/time.h"
-#include "avformat.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "url.h"
-
-#define INITIAL_BUFFER_SIZE 32768
-
-/*
- * An apple http stream consists of a playlist with media segment files,
- * played sequentially. There may be several playlists with the same
- * video content, in different bandwidth variants, that are played in
- * parallel (preferably only one bandwidth variant at a time). In this case,
- * the user supplied the url to a main playlist that only lists the variant
- * playlists.
- *
- * If the main playlist doesn't point at any variants, we still create
- * one anonymous toplevel variant for this, to maintain the structure.
- */
-
-enum KeyType {
-    KEY_NONE,
-    KEY_AES_128,
-};
-
-struct segment {
-    int64_t duration;
-    char url[MAX_URL_SIZE];
-    char key[MAX_URL_SIZE];
-    enum KeyType key_type;
-    uint8_t iv[16];
-};
-
-/*
- * Each variant has its own demuxer. If it currently is active,
- * it has an open AVIOContext too, and potentially an AVPacket
- * containing the next packet from this stream.
- */
-struct variant {
-    int bandwidth;
-    char url[MAX_URL_SIZE];
-    AVIOContext pb;
-    uint8_t* read_buffer;
-    URLContext *input;
-    AVFormatContext *parent;
-    int index;
-    AVFormatContext *ctx;
-    AVPacket pkt;
-    int stream_offset;
-
-    int finished;
-    int64_t target_duration;
-    int start_seq_no;
-    int n_segments;
-    struct segment **segments;
-    int needed, cur_needed;
-    int cur_seq_no;
-    int64_t last_load_time;
-
-    char key_url[MAX_URL_SIZE];
-    uint8_t key[16];
-};
-
-typedef struct HLSContext {
-    int n_variants;
-    struct variant **variants;
-    int cur_seq_no;
-    int end_of_segment;
-    int first_packet;
-    int64_t first_timestamp;
-    int64_t seek_timestamp;
-    int seek_flags;
-    AVIOInterruptCB *interrupt_callback;
-} HLSContext;
-
-static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
-{
-    int len = ff_get_line(s, buf, maxlen);
-    while (len > 0 && av_isspace(buf[len - 1]))
-        buf[--len] = '\0';
-    return len;
-}
-
-static void free_segment_list(struct variant *var)
-{
-    int i;
-    for (i = 0; i < var->n_segments; i++)
-        av_free(var->segments[i]);
-    av_freep(&var->segments);
-    var->n_segments = 0;
-}
-
-static void free_variant_list(HLSContext *c)
-{
-    int i;
-    for (i = 0; i < c->n_variants; i++) {
-        struct variant *var = c->variants[i];
-        free_segment_list(var);
-        av_free_packet(&var->pkt);
-        av_free(var->pb.buffer);
-        if (var->input)
-            ffurl_close(var->input);
-        if (var->ctx) {
-            var->ctx->pb = NULL;
-            avformat_close_input(&var->ctx);
-        }
-        av_free(var);
-    }
-    av_freep(&c->variants);
-    c->n_variants = 0;
-}
-
-/*
- * Used to reset a statically allocated AVPacket to a clean slate,
- * containing no data.
- */
-static void reset_packet(AVPacket *pkt)
-{
-    av_init_packet(pkt);
-    pkt->data = NULL;
-}
-
-static struct variant *new_variant(HLSContext *c, int bandwidth,
-                                   const char *url, const char *base)
-{
-    struct variant *var = av_mallocz(sizeof(struct variant));
-    if (!var)
-        return NULL;
-    reset_packet(&var->pkt);
-    var->bandwidth = bandwidth;
-    ff_make_absolute_url(var->url, sizeof(var->url), base, url);
-    dynarray_add(&c->variants, &c->n_variants, var);
-    return var;
-}
-
-struct variant_info {
-    char bandwidth[20];
-};
-
-static void handle_variant_args(struct variant_info *info, const char *key,
-                                int key_len, char **dest, int *dest_len)
-{
-    if (!strncmp(key, "BANDWIDTH=", key_len)) {
-        *dest     =        info->bandwidth;
-        *dest_len = sizeof(info->bandwidth);
-    }
-}
-
-struct key_info {
-     char uri[MAX_URL_SIZE];
-     char method[10];
-     char iv[35];
-};
-
-static void handle_key_args(struct key_info *info, const char *key,
-                            int key_len, char **dest, int *dest_len)
-{
-    if (!strncmp(key, "METHOD=", key_len)) {
-        *dest     =        info->method;
-        *dest_len = sizeof(info->method);
-    } else if (!strncmp(key, "URI=", key_len)) {
-        *dest     =        info->uri;
-        *dest_len = sizeof(info->uri);
-    } else if (!strncmp(key, "IV=", key_len)) {
-        *dest     =        info->iv;
-        *dest_len = sizeof(info->iv);
-    }
-}
-
-static int parse_playlist(HLSContext *c, const char *url,
-                          struct variant *var, AVIOContext *in)
-{
-    int ret = 0, is_segment = 0, is_variant = 0, bandwidth = 0;
-    int64_t duration = 0;
-    enum KeyType key_type = KEY_NONE;
-    uint8_t iv[16] = "";
-    int has_iv = 0;
-    char key[MAX_URL_SIZE] = "";
-    char line[1024];
-    const char *ptr;
-    int close_in = 0;
-    uint8_t *new_url = NULL;
-
-    if (!in) {
-        close_in = 1;
-        if ((ret = avio_open2(&in, url, AVIO_FLAG_READ,
-                              c->interrupt_callback, NULL)) < 0)
-            return ret;
-    }
-
-    if (av_opt_get(in, "location", AV_OPT_SEARCH_CHILDREN, &new_url) >= 0)
-        url = new_url;
-
-    read_chomp_line(in, line, sizeof(line));
-    if (strcmp(line, "#EXTM3U")) {
-        ret = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-
-    if (var) {
-        free_segment_list(var);
-        var->finished = 0;
-    }
-    while (!in->eof_reached) {
-        read_chomp_line(in, line, sizeof(line));
-        if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
-            struct variant_info info = {{0}};
-            is_variant = 1;
-            ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_variant_args,
-                               &info);
-            bandwidth = atoi(info.bandwidth);
-        } else if (av_strstart(line, "#EXT-X-KEY:", &ptr)) {
-            struct key_info info = {{0}};
-            ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_key_args,
-                               &info);
-            key_type = KEY_NONE;
-            has_iv = 0;
-            if (!strcmp(info.method, "AES-128"))
-                key_type = KEY_AES_128;
-            if (!strncmp(info.iv, "0x", 2) || !strncmp(info.iv, "0X", 2)) {
-                ff_hex_to_data(iv, info.iv + 2);
-                has_iv = 1;
-            }
-            av_strlcpy(key, info.uri, sizeof(key));
-        } else if (av_strstart(line, "#EXT-X-TARGETDURATION:", &ptr)) {
-            if (!var) {
-                var = new_variant(c, 0, url, NULL);
-                if (!var) {
-                    ret = AVERROR(ENOMEM);
-                    goto fail;
-                }
-            }
-            var->target_duration = atoi(ptr) * AV_TIME_BASE;
-        } else if (av_strstart(line, "#EXT-X-MEDIA-SEQUENCE:", &ptr)) {
-            if (!var) {
-                var = new_variant(c, 0, url, NULL);
-                if (!var) {
-                    ret = AVERROR(ENOMEM);
-                    goto fail;
-                }
-            }
-            var->start_seq_no = atoi(ptr);
-        } else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
-            if (var)
-                var->finished = 1;
-        } else if (av_strstart(line, "#EXTINF:", &ptr)) {
-            is_segment = 1;
-            duration   = atof(ptr) * AV_TIME_BASE;
-        } else if (av_strstart(line, "#", NULL)) {
-            continue;
-        } else if (line[0]) {
-            if (is_variant) {
-                if (!new_variant(c, bandwidth, line, url)) {
-                    ret = AVERROR(ENOMEM);
-                    goto fail;
-                }
-                is_variant = 0;
-                bandwidth  = 0;
-            }
-            if (is_segment) {
-                struct segment *seg;
-                if (!var) {
-                    var = new_variant(c, 0, url, NULL);
-                    if (!var) {
-                        ret = AVERROR(ENOMEM);
-                        goto fail;
-                    }
-                }
-                seg = av_malloc(sizeof(struct segment));
-                if (!seg) {
-                    ret = AVERROR(ENOMEM);
-                    goto fail;
-                }
-                seg->duration = duration;
-                seg->key_type = key_type;
-                if (has_iv) {
-                    memcpy(seg->iv, iv, sizeof(iv));
-                } else {
-                    int seq = var->start_seq_no + var->n_segments;
-                    memset(seg->iv, 0, sizeof(seg->iv));
-                    AV_WB32(seg->iv + 12, seq);
-                }
-                ff_make_absolute_url(seg->key, sizeof(seg->key), url, key);
-                ff_make_absolute_url(seg->url, sizeof(seg->url), url, line);
-                dynarray_add(&var->segments, &var->n_segments, seg);
-                is_segment = 0;
-            }
-        }
-    }
-    if (var)
-        var->last_load_time = av_gettime();
-
-fail:
-    av_free(new_url);
-    if (close_in)
-        avio_close(in);
-    return ret;
-}
-
-static int open_input(struct variant *var)
-{
-    struct segment *seg = var->segments[var->cur_seq_no - var->start_seq_no];
-    if (seg->key_type == KEY_NONE) {
-        return ffurl_open(&var->input, seg->url, AVIO_FLAG_READ,
-                          &var->parent->interrupt_callback, NULL);
-    } else if (seg->key_type == KEY_AES_128) {
-        char iv[33], key[33], url[MAX_URL_SIZE];
-        int ret;
-        if (strcmp(seg->key, var->key_url)) {
-            URLContext *uc;
-            if (ffurl_open(&uc, seg->key, AVIO_FLAG_READ,
-                           &var->parent->interrupt_callback, NULL) == 0) {
-                if (ffurl_read_complete(uc, var->key, sizeof(var->key))
-                    != sizeof(var->key)) {
-                    av_log(NULL, AV_LOG_ERROR, "Unable to read key file %s\n",
-                           seg->key);
-                }
-                ffurl_close(uc);
-            } else {
-                av_log(NULL, AV_LOG_ERROR, "Unable to open key file %s\n",
-                       seg->key);
-            }
-            av_strlcpy(var->key_url, seg->key, sizeof(var->key_url));
-        }
-        ff_data_to_hex(iv, seg->iv, sizeof(seg->iv), 0);
-        ff_data_to_hex(key, var->key, sizeof(var->key), 0);
-        iv[32] = key[32] = '\0';
-        if (strstr(seg->url, "://"))
-            snprintf(url, sizeof(url), "crypto+%s", seg->url);
-        else
-            snprintf(url, sizeof(url), "crypto:%s", seg->url);
-        if ((ret = ffurl_alloc(&var->input, url, AVIO_FLAG_READ,
-                               &var->parent->interrupt_callback)) < 0)
-            return ret;
-        av_opt_set(var->input->priv_data, "key", key, 0);
-        av_opt_set(var->input->priv_data, "iv", iv, 0);
-        if ((ret = ffurl_connect(var->input, NULL)) < 0) {
-            ffurl_close(var->input);
-            var->input = NULL;
-            return ret;
-        }
-        return 0;
-    }
-    return AVERROR(ENOSYS);
-}
-
-static int read_data(void *opaque, uint8_t *buf, int buf_size)
-{
-    struct variant *v = opaque;
-    HLSContext *c = v->parent->priv_data;
-    int ret, i;
-
-restart:
-    if (!v->input) {
-        /* If this is a live stream and the reload interval has elapsed since
-         * the last playlist reload, reload the variant playlists now. */
-        int64_t reload_interval = v->n_segments > 0 ?
-                                  v->segments[v->n_segments - 1]->duration :
-                                  v->target_duration;
-
-reload:
-        if (!v->finished &&
-            av_gettime() - v->last_load_time >= reload_interval) {
-            if ((ret = parse_playlist(c, v->url, v, NULL)) < 0)
-                return ret;
-            /* If we need to reload the playlist again below (if
-             * there's still no more segments), switch to a reload
-             * interval of half the target duration. */
-            reload_interval = v->target_duration / 2;
-        }
-        if (v->cur_seq_no < v->start_seq_no) {
-            av_log(NULL, AV_LOG_WARNING,
-                   "skipping %d segments ahead, expired from playlists\n",
-                   v->start_seq_no - v->cur_seq_no);
-            v->cur_seq_no = v->start_seq_no;
-        }
-        if (v->cur_seq_no >= v->start_seq_no + v->n_segments) {
-            if (v->finished)
-                return AVERROR_EOF;
-            while (av_gettime() - v->last_load_time < reload_interval) {
-                if (ff_check_interrupt(c->interrupt_callback))
-                    return AVERROR_EXIT;
-                av_usleep(100*1000);
-            }
-            /* Enough time has elapsed since the last reload */
-            goto reload;
-        }
-
-        ret = open_input(v);
-        if (ret < 0)
-            return ret;
-    }
-    ret = ffurl_read(v->input, buf, buf_size);
-    if (ret > 0)
-        return ret;
-    ffurl_close(v->input);
-    v->input = NULL;
-    v->cur_seq_no++;
-
-    c->end_of_segment = 1;
-    c->cur_seq_no = v->cur_seq_no;
-
-    if (v->ctx && v->ctx->nb_streams &&
-        v->parent->nb_streams >= v->stream_offset + v->ctx->nb_streams) {
-        v->needed = 0;
-        for (i = v->stream_offset; i < v->stream_offset + v->ctx->nb_streams;
-             i++) {
-            if (v->parent->streams[i]->discard < AVDISCARD_ALL)
-                v->needed = 1;
-        }
-    }
-    if (!v->needed) {
-        av_log(v->parent, AV_LOG_INFO, "No longer receiving variant %d\n",
-               v->index);
-        return AVERROR_EOF;
-    }
-    goto restart;
-}
-
-static int hls_read_header(AVFormatContext *s)
-{
-    HLSContext *c = s->priv_data;
-    int ret = 0, i, j, stream_offset = 0;
-
-    c->interrupt_callback = &s->interrupt_callback;
-
-    if ((ret = parse_playlist(c, s->filename, NULL, s->pb)) < 0)
-        goto fail;
-
-    if (c->n_variants == 0) {
-        av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
-        ret = AVERROR_EOF;
-        goto fail;
-    }
-    /* If the playlist only contained variants, parse each individual
-     * variant playlist. */
-    if (c->n_variants > 1 || c->variants[0]->n_segments == 0) {
-        for (i = 0; i < c->n_variants; i++) {
-            struct variant *v = c->variants[i];
-            if ((ret = parse_playlist(c, v->url, v, NULL)) < 0)
-                goto fail;
-        }
-    }
-
-    if (c->variants[0]->n_segments == 0) {
-        av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
-        ret = AVERROR_EOF;
-        goto fail;
-    }
-
-    /* If this isn't a live stream, calculate the total duration of the
-     * stream. */
-    if (c->variants[0]->finished) {
-        int64_t duration = 0;
-        for (i = 0; i < c->variants[0]->n_segments; i++)
-            duration += c->variants[0]->segments[i]->duration;
-        s->duration = duration;
-    }
-
-    /* Open the demuxer for each variant */
-    for (i = 0; i < c->n_variants; i++) {
-        struct variant *v = c->variants[i];
-        AVInputFormat *in_fmt = NULL;
-        char bitrate_str[20];
-        AVProgram *program;
-
-        if (v->n_segments == 0)
-            continue;
-
-        if (!(v->ctx = avformat_alloc_context())) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        v->index  = i;
-        v->needed = 1;
-        v->parent = s;
-
-        /* If this is a live stream with more than 3 segments, start at the
-         * third last segment. */
-        v->cur_seq_no = v->start_seq_no;
-        if (!v->finished && v->n_segments > 3)
-            v->cur_seq_no = v->start_seq_no + v->n_segments - 3;
-
-        v->read_buffer = av_malloc(INITIAL_BUFFER_SIZE);
-        ffio_init_context(&v->pb, v->read_buffer, INITIAL_BUFFER_SIZE, 0, v,
-                          read_data, NULL, NULL);
-        v->pb.seekable = 0;
-        ret = av_probe_input_buffer(&v->pb, &in_fmt, v->segments[0]->url,
-                                    NULL, 0, 0);
-        if (ret < 0) {
-            /* Free the ctx - it isn't initialized properly at this point,
-             * so avformat_close_input shouldn't be called. If
-             * avformat_open_input fails below, it frees and zeros the
-             * context, so it doesn't need any special treatment like this. */
-            avformat_free_context(v->ctx);
-            v->ctx = NULL;
-            goto fail;
-        }
-        v->ctx->pb       = &v->pb;
-        v->stream_offset = stream_offset;
-        ret = avformat_open_input(&v->ctx, v->segments[0]->url, in_fmt, NULL);
-        if (ret < 0)
-            goto fail;
-
-        v->ctx->ctx_flags &= ~AVFMTCTX_NOHEADER;
-        ret = avformat_find_stream_info(v->ctx, NULL);
-        if (ret < 0)
-            goto fail;
-        snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth);
-
-        program = av_new_program(s, i);
-        if (!program)
-            goto fail;
-        av_dict_set(&program->metadata, "variant_bitrate", bitrate_str, 0);
-
-        /* Create new AVStreams for each stream in this variant */
-        for (j = 0; j < v->ctx->nb_streams; j++) {
-            AVStream *st = avformat_new_stream(s, NULL);
-            AVStream *ist = v->ctx->streams[j];
-            if (!st) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-            ff_program_add_stream_index(s, i, stream_offset + j);
-            st->id = i;
-            avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den);
-            avcodec_copy_context(st->codec, v->ctx->streams[j]->codec);
-            if (v->bandwidth)
-                av_dict_set(&st->metadata, "variant_bitrate", bitrate_str,
-                                 0);
-        }
-        stream_offset += v->ctx->nb_streams;
-    }
-
-    c->first_packet = 1;
-    c->first_timestamp = AV_NOPTS_VALUE;
-    c->seek_timestamp  = AV_NOPTS_VALUE;
-
-    return 0;
-fail:
-    free_variant_list(c);
-    return ret;
-}
-
-static int recheck_discard_flags(AVFormatContext *s, int first)
-{
-    HLSContext *c = s->priv_data;
-    int i, changed = 0;
-
-    /* Check if any new streams are needed */
-    for (i = 0; i < c->n_variants; i++)
-        c->variants[i]->cur_needed = 0;;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        struct variant *var = c->variants[s->streams[i]->id];
-        if (st->discard < AVDISCARD_ALL)
-            var->cur_needed = 1;
-    }
-    for (i = 0; i < c->n_variants; i++) {
-        struct variant *v = c->variants[i];
-        if (v->cur_needed && !v->needed) {
-            v->needed = 1;
-            changed = 1;
-            v->cur_seq_no = c->cur_seq_no;
-            v->pb.eof_reached = 0;
-            av_log(s, AV_LOG_INFO, "Now receiving variant %d\n", i);
-        } else if (first && !v->cur_needed && v->needed) {
-            if (v->input)
-                ffurl_close(v->input);
-            v->input = NULL;
-            v->needed = 0;
-            changed = 1;
-            av_log(s, AV_LOG_INFO, "No longer receiving variant %d\n", i);
-        }
-    }
-    return changed;
-}
-
-static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    HLSContext *c = s->priv_data;
-    int ret, i, minvariant = -1;
-
-    if (c->first_packet) {
-        recheck_discard_flags(s, 1);
-        c->first_packet = 0;
-    }
-
-start:
-    c->end_of_segment = 0;
-    for (i = 0; i < c->n_variants; i++) {
-        struct variant *var = c->variants[i];
-        /* Make sure we've got one buffered packet from each open variant
-         * stream */
-        if (var->needed && !var->pkt.data) {
-            while (1) {
-                int64_t ts_diff;
-                AVStream *st;
-                ret = av_read_frame(var->ctx, &var->pkt);
-                if (ret < 0) {
-                    if (!var->pb.eof_reached)
-                        return ret;
-                    reset_packet(&var->pkt);
-                    break;
-                } else {
-                    if (c->first_timestamp == AV_NOPTS_VALUE &&
-                        var->pkt.dts       != AV_NOPTS_VALUE)
-                        c->first_timestamp = av_rescale_q(var->pkt.dts,
-                            var->ctx->streams[var->pkt.stream_index]->time_base,
-                            AV_TIME_BASE_Q);
-                }
-
-                if (c->seek_timestamp == AV_NOPTS_VALUE)
-                    break;
-
-                if (var->pkt.dts == AV_NOPTS_VALUE) {
-                    c->seek_timestamp = AV_NOPTS_VALUE;
-                    break;
-                }
-
-                st = var->ctx->streams[var->pkt.stream_index];
-                ts_diff = av_rescale_rnd(var->pkt.dts, AV_TIME_BASE,
-                                         st->time_base.den, AV_ROUND_DOWN) -
-                          c->seek_timestamp;
-                if (ts_diff >= 0 && (c->seek_flags  & AVSEEK_FLAG_ANY ||
-                                     var->pkt.flags & AV_PKT_FLAG_KEY)) {
-                    c->seek_timestamp = AV_NOPTS_VALUE;
-                    break;
-                }
-                av_free_packet(&var->pkt);
-                reset_packet(&var->pkt);
-            }
-        }
-        /* Check if this stream still is on an earlier segment number, or
-         * has the packet with the lowest dts */
-        if (var->pkt.data) {
-            struct variant *minvar = minvariant < 0 ?
-                                     NULL : c->variants[minvariant];
-            if (minvariant < 0 || var->cur_seq_no < minvar->cur_seq_no) {
-                minvariant = i;
-            } else if (var->cur_seq_no == minvar->cur_seq_no) {
-                int64_t dts     =    var->pkt.dts;
-                int64_t mindts  = minvar->pkt.dts;
-                AVStream *st    =    var->ctx->streams[var->pkt.stream_index];
-                AVStream *minst = minvar->ctx->streams[minvar->pkt.stream_index];
-
-                if (dts == AV_NOPTS_VALUE) {
-                    minvariant = i;
-                } else if (mindts != AV_NOPTS_VALUE) {
-                    if (st->start_time    != AV_NOPTS_VALUE)
-                        dts    -= st->start_time;
-                    if (minst->start_time != AV_NOPTS_VALUE)
-                        mindts -= minst->start_time;
-
-                    if (av_compare_ts(dts, st->time_base,
-                                      mindts, minst->time_base) < 0)
-                        minvariant = i;
-                }
-            }
-        }
-    }
-    if (c->end_of_segment) {
-        if (recheck_discard_flags(s, 0))
-            goto start;
-    }
-    /* If we got a packet, return it */
-    if (minvariant >= 0) {
-        *pkt = c->variants[minvariant]->pkt;
-        pkt->stream_index += c->variants[minvariant]->stream_offset;
-        reset_packet(&c->variants[minvariant]->pkt);
-        return 0;
-    }
-    return AVERROR_EOF;
-}
-
-static int hls_close(AVFormatContext *s)
-{
-    HLSContext *c = s->priv_data;
-
-    free_variant_list(c);
-    return 0;
-}
-
-static int hls_read_seek(AVFormatContext *s, int stream_index,
-                               int64_t timestamp, int flags)
-{
-    HLSContext *c = s->priv_data;
-    int i, j, ret;
-
-    if ((flags & AVSEEK_FLAG_BYTE) || !c->variants[0]->finished)
-        return AVERROR(ENOSYS);
-
-    c->seek_flags     = flags;
-    c->seek_timestamp = stream_index < 0 ? timestamp :
-                        av_rescale_rnd(timestamp, AV_TIME_BASE,
-                                       s->streams[stream_index]->time_base.den,
-                                       flags & AVSEEK_FLAG_BACKWARD ?
-                                       AV_ROUND_DOWN : AV_ROUND_UP);
-    timestamp = av_rescale_rnd(timestamp, AV_TIME_BASE, stream_index >= 0 ?
-                               s->streams[stream_index]->time_base.den :
-                               AV_TIME_BASE, flags & AVSEEK_FLAG_BACKWARD ?
-                               AV_ROUND_DOWN : AV_ROUND_UP);
-    if (s->duration < c->seek_timestamp) {
-        c->seek_timestamp = AV_NOPTS_VALUE;
-        return AVERROR(EIO);
-    }
-
-    ret = AVERROR(EIO);
-    for (i = 0; i < c->n_variants; i++) {
-        /* Reset reading */
-        struct variant *var = c->variants[i];
-        int64_t pos = c->first_timestamp == AV_NOPTS_VALUE ?
-                      0 : c->first_timestamp;
-        if (var->input) {
-            ffurl_close(var->input);
-            var->input = NULL;
-        }
-        av_free_packet(&var->pkt);
-        reset_packet(&var->pkt);
-        var->pb.eof_reached = 0;
-        /* Clear any buffered data */
-        var->pb.buf_end = var->pb.buf_ptr = var->pb.buffer;
-        /* Reset the pos, to let the mpegts demuxer know we've seeked. */
-        var->pb.pos = 0;
-
-        /* Locate the segment that contains the target timestamp */
-        for (j = 0; j < var->n_segments; j++) {
-            if (timestamp >= pos &&
-                timestamp < pos + var->segments[j]->duration) {
-                var->cur_seq_no = var->start_seq_no + j;
-                ret = 0;
-                break;
-            }
-            pos += var->segments[j]->duration;
-        }
-        if (ret)
-            c->seek_timestamp = AV_NOPTS_VALUE;
-    }
-    return ret;
-}
-
-static int hls_probe(AVProbeData *p)
-{
-    /* Require #EXTM3U at the start, and either one of the ones below
-     * somewhere for a proper match. */
-    if (strncmp(p->buf, "#EXTM3U", 7))
-        return 0;
-    if (strstr(p->buf, "#EXT-X-STREAM-INF:")     ||
-        strstr(p->buf, "#EXT-X-TARGETDURATION:") ||
-        strstr(p->buf, "#EXT-X-MEDIA-SEQUENCE:"))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-AVInputFormat ff_hls_demuxer = {
-    .name           = "hls,applehttp",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
-    .priv_data_size = sizeof(HLSContext),
-    .read_probe     = hls_probe,
-    .read_header    = hls_read_header,
-    .read_packet    = hls_read_packet,
-    .read_close     = hls_close,
-    .read_seek      = hls_read_seek,
-};
diff --git a/deps/libav/libavformat/hlsenc.c b/deps/libav/libavformat/hlsenc.c
deleted file mode 100644
index f9e9678..0000000
--- a/deps/libav/libavformat/hlsenc.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Apple HTTP Live Streaming segmenter
- * Copyright (c) 2012, Luca Barbato
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <float.h>
-#include <stdint.h>
-
-#include "libavutil/mathematics.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/avstring.h"
-#include "libavutil/opt.h"
-#include "libavutil/log.h"
-
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct ListEntry {
-    char  name[1024];
-    int   duration;
-    struct ListEntry *next;
-} ListEntry;
-
-typedef struct HLSContext {
-    const AVClass *class;  // Class for private options.
-    unsigned number;
-    int64_t sequence;
-    AVOutputFormat *oformat;
-    AVFormatContext *avf;
-    float time;            // Set by a private option.
-    int  size;             // Set by a private option.
-    int  wrap;             // Set by a private option.
-    int64_t recording_time;
-    int has_video;
-    int64_t start_pts;
-    int64_t end_pts;
-    int64_t duration;      // last segment duration computed so far, in seconds
-    int nb_entries;
-    ListEntry *list;
-    ListEntry *end_list;
-    char *basename;
-    AVIOContext *pb;
-} HLSContext;
-
-static int hls_mux_init(AVFormatContext *s)
-{
-    HLSContext *hls = s->priv_data;
-    AVFormatContext *oc;
-    int i;
-
-    hls->avf = oc = avformat_alloc_context();
-    if (!oc)
-        return AVERROR(ENOMEM);
-
-    oc->oformat            = hls->oformat;
-    oc->interrupt_callback = s->interrupt_callback;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st;
-        if (!(st = avformat_new_stream(oc, NULL)))
-            return AVERROR(ENOMEM);
-        avcodec_copy_context(st->codec, s->streams[i]->codec);
-        st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
-    }
-
-    return 0;
-}
-
-static int append_entry(HLSContext *hls, uint64_t duration)
-{
-    ListEntry *en = av_malloc(sizeof(*en));
-
-    if (!en)
-        return AVERROR(ENOMEM);
-
-    av_strlcpy(en->name, av_basename(hls->avf->filename), sizeof(en->name));
-
-    en->duration = duration;
-    en->next     = NULL;
-
-    if (!hls->list)
-        hls->list = en;
-    else
-        hls->end_list->next = en;
-
-    hls->end_list = en;
-
-    if (hls->nb_entries >= hls->size) {
-        en = hls->list;
-        hls->list = en->next;
-        av_free(en);
-    } else
-        hls->nb_entries++;
-
-    hls->sequence++;
-
-    return 0;
-}
-
-static void free_entries(HLSContext *hls)
-{
-    ListEntry *p = hls->list, *en;
-
-    while(p) {
-        en = p;
-        p = p->next;
-        av_free(en);
-    }
-}
-
-static int hls_window(AVFormatContext *s, int last)
-{
-    HLSContext *hls = s->priv_data;
-    ListEntry *en;
-    int target_duration = 0;
-    int ret = 0;
-
-    if ((ret = avio_open2(&hls->pb, s->filename, AVIO_FLAG_WRITE,
-                          &s->interrupt_callback, NULL)) < 0)
-        goto fail;
-
-    for (en = hls->list; en; en = en->next) {
-        if (target_duration < en->duration)
-            target_duration = en->duration;
-    }
-
-    avio_printf(hls->pb, "#EXTM3U\n");
-    avio_printf(hls->pb, "#EXT-X-VERSION:3\n");
-    avio_printf(hls->pb, "#EXT-X-TARGETDURATION:%d\n", target_duration);
-    avio_printf(hls->pb, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"\n",
-                FFMAX(0, hls->sequence - hls->size));
-
-    for (en = hls->list; en; en = en->next) {
-        avio_printf(hls->pb, "#EXTINF:%d,\n", en->duration);
-        avio_printf(hls->pb, "%s\n", en->name);
-    }
-
-    if (last)
-        avio_printf(hls->pb, "#EXT-X-ENDLIST\n");
-
-fail:
-    avio_closep(&hls->pb);
-    return ret;
-}
-
-static int hls_start(AVFormatContext *s)
-{
-    HLSContext *c = s->priv_data;
-    AVFormatContext *oc = c->avf;
-    int err = 0;
-
-    if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
-                              c->basename, c->wrap ? c->number % c->wrap : c->number) < 0)
-        return AVERROR(EINVAL);
-    c->number++;
-
-    if ((err = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
-                          &s->interrupt_callback, NULL)) < 0)
-        return err;
-
-    if (oc->oformat->priv_class && oc->priv_data)
-        av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
-
-    return 0;
-}
-
-static int hls_write_header(AVFormatContext *s)
-{
-    HLSContext *hls = s->priv_data;
-    int ret, i;
-    char *p;
-    const char *pattern = "%d.ts";
-    int basename_size = strlen(s->filename) + strlen(pattern) + 1;
-
-    hls->number      = 0;
-
-    hls->recording_time = hls->time * AV_TIME_BASE;
-    hls->start_pts      = AV_NOPTS_VALUE;
-
-    for (i = 0; i < s->nb_streams; i++)
-        hls->has_video +=
-            s->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO;
-
-    if (hls->has_video > 1)
-        av_log(s, AV_LOG_WARNING,
-               "More than a single video stream present, "
-               "expect issues decoding it.\n");
-
-    hls->oformat = av_guess_format("mpegts", NULL, NULL);
-
-    if (!hls->oformat) {
-        ret = AVERROR_MUXER_NOT_FOUND;
-        goto fail;
-    }
-
-    hls->basename = av_malloc(basename_size);
-
-    if (!hls->basename) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    strcpy(hls->basename, s->filename);
-
-    p = strrchr(hls->basename, '.');
-
-    if (p)
-        *p = '\0';
-
-    av_strlcat(hls->basename, pattern, basename_size);
-
-    if ((ret = hls_mux_init(s)) < 0)
-        goto fail;
-
-    if ((ret = hls_start(s)) < 0)
-        goto fail;
-
-    if ((ret = avformat_write_header(hls->avf, NULL)) < 0)
-        return ret;
-
-
-fail:
-    if (ret) {
-        av_free(hls->basename);
-        if (hls->avf)
-            avformat_free_context(hls->avf);
-    }
-    return ret;
-}
-
-static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    HLSContext *hls = s->priv_data;
-    AVFormatContext *oc = hls->avf;
-    AVStream *st = s->streams[pkt->stream_index];
-    int64_t end_pts = hls->recording_time * hls->number;
-    int ret, can_split = 1;
-
-    if (hls->start_pts == AV_NOPTS_VALUE) {
-        hls->start_pts = pkt->pts;
-        hls->end_pts   = pkt->pts;
-    }
-
-    if (hls->has_video) {
-        can_split = st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-                    pkt->flags & AV_PKT_FLAG_KEY;
-    }
-    if (pkt->pts == AV_NOPTS_VALUE)
-        can_split = 0;
-    else
-        hls->duration = av_rescale(pkt->pts - hls->end_pts,
-                                   st->time_base.num, st->time_base.den);
-
-    if (can_split && av_compare_ts(pkt->pts - hls->start_pts, st->time_base,
-                                   end_pts, AV_TIME_BASE_Q) >= 0) {
-        ret = append_entry(hls, hls->duration);
-        if (ret)
-            return ret;
-
-        hls->end_pts = pkt->pts;
-        hls->duration = 0;
-
-        av_write_frame(oc, NULL); /* Flush any buffered data */
-        avio_close(oc->pb);
-
-        ret = hls_start(s);
-
-        if (ret)
-            return ret;
-
-        oc = hls->avf;
-
-        if ((ret = hls_window(s, 0)) < 0)
-            return ret;
-    }
-
-    ret = ff_write_chained(oc, pkt->stream_index, pkt, s);
-
-    return ret;
-}
-
-static int hls_write_trailer(struct AVFormatContext *s)
-{
-    HLSContext *hls = s->priv_data;
-    AVFormatContext *oc = hls->avf;
-
-    av_write_trailer(oc);
-    avio_closep(&oc->pb);
-    avformat_free_context(oc);
-    av_free(hls->basename);
-    append_entry(hls, hls->duration);
-    hls_window(s, 1);
-
-    free_entries(hls);
-    avio_close(hls->pb);
-    return 0;
-}
-
-#define OFFSET(x) offsetof(HLSContext, x)
-#define E AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    {"start_number",  "first number in the sequence",            OFFSET(sequence),AV_OPT_TYPE_INT64,  {.i64 = 0},     0, INT64_MAX, E},
-    {"hls_time",      "segment length in seconds",               OFFSET(time),    AV_OPT_TYPE_FLOAT,  {.dbl = 2},     0, FLT_MAX, E},
-    {"hls_list_size", "maximum number of playlist entries",      OFFSET(size),    AV_OPT_TYPE_INT,    {.i64 = 5},     0, INT_MAX, E},
-    {"hls_wrap",      "number after which the index wraps",      OFFSET(wrap),    AV_OPT_TYPE_INT,    {.i64 = 0},     0, INT_MAX, E},
-    { NULL },
-};
-
-static const AVClass hls_class = {
-    .class_name = "hls muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-
-AVOutputFormat ff_hls_muxer = {
-    .name           = "hls",
-    .long_name      = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
-    .extensions     = "m3u8",
-    .priv_data_size = sizeof(HLSContext),
-    .audio_codec    = AV_CODEC_ID_MP2,
-    .video_codec    = AV_CODEC_ID_MPEG2VIDEO,
-    .flags          = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
-    .write_header   = hls_write_header,
-    .write_packet   = hls_write_packet,
-    .write_trailer  = hls_write_trailer,
-    .priv_class     = &hls_class,
-};
diff --git a/deps/libav/libavformat/hlsproto.c b/deps/libav/libavformat/hlsproto.c
deleted file mode 100644
index ec357de..0000000
--- a/deps/libav/libavformat/hlsproto.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Apple HTTP Live Streaming Protocol Handler
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Apple HTTP Live Streaming Protocol Handler
- * http://tools.ietf.org/html/draft-pantos-http-live-streaming
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/time.h"
-#include "avformat.h"
-#include "internal.h"
-#include "url.h"
-#include "version.h"
-
-/*
- * An apple http stream consists of a playlist with media segment files,
- * played sequentially. There may be several playlists with the same
- * video content, in different bandwidth variants, that are played in
- * parallel (preferably only one bandwidth variant at a time). In this case,
- * the user supplied the url to a main playlist that only lists the variant
- * playlists.
- *
- * If the main playlist doesn't point at any variants, we still create
- * one anonymous toplevel variant for this, to maintain the structure.
- */
-
-struct segment {
-    int64_t duration;
-    char url[MAX_URL_SIZE];
-};
-
-struct variant {
-    int bandwidth;
-    char url[MAX_URL_SIZE];
-};
-
-typedef struct HLSContext {
-    char playlisturl[MAX_URL_SIZE];
-    int64_t target_duration;
-    int start_seq_no;
-    int finished;
-    int n_segments;
-    struct segment **segments;
-    int n_variants;
-    struct variant **variants;
-    int cur_seq_no;
-    URLContext *seg_hd;
-    int64_t last_load_time;
-} HLSContext;
-
-static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
-{
-    int len = ff_get_line(s, buf, maxlen);
-    while (len > 0 && av_isspace(buf[len - 1]))
-        buf[--len] = '\0';
-    return len;
-}
-
-static void free_segment_list(HLSContext *s)
-{
-    int i;
-    for (i = 0; i < s->n_segments; i++)
-        av_free(s->segments[i]);
-    av_freep(&s->segments);
-    s->n_segments = 0;
-}
-
-static void free_variant_list(HLSContext *s)
-{
-    int i;
-    for (i = 0; i < s->n_variants; i++)
-        av_free(s->variants[i]);
-    av_freep(&s->variants);
-    s->n_variants = 0;
-}
-
-struct variant_info {
-    char bandwidth[20];
-};
-
-static void handle_variant_args(struct variant_info *info, const char *key,
-                                int key_len, char **dest, int *dest_len)
-{
-    if (!strncmp(key, "BANDWIDTH=", key_len)) {
-        *dest     =        info->bandwidth;
-        *dest_len = sizeof(info->bandwidth);
-    }
-}
-
-static int parse_playlist(URLContext *h, const char *url)
-{
-    HLSContext *s = h->priv_data;
-    AVIOContext *in;
-    int ret = 0, is_segment = 0, is_variant = 0, bandwidth = 0;
-    int64_t duration = 0;
-    char line[1024];
-    const char *ptr;
-
-    if ((ret = avio_open2(&in, url, AVIO_FLAG_READ,
-                          &h->interrupt_callback, NULL)) < 0)
-        return ret;
-
-    read_chomp_line(in, line, sizeof(line));
-    if (strcmp(line, "#EXTM3U"))
-        return AVERROR_INVALIDDATA;
-
-    free_segment_list(s);
-    s->finished = 0;
-    while (!in->eof_reached) {
-        read_chomp_line(in, line, sizeof(line));
-        if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
-            struct variant_info info = {{0}};
-            is_variant = 1;
-            ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_variant_args,
-                               &info);
-            bandwidth = atoi(info.bandwidth);
-        } else if (av_strstart(line, "#EXT-X-TARGETDURATION:", &ptr)) {
-            s->target_duration = atoi(ptr) * AV_TIME_BASE;
-        } else if (av_strstart(line, "#EXT-X-MEDIA-SEQUENCE:", &ptr)) {
-            s->start_seq_no = atoi(ptr);
-        } else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
-            s->finished = 1;
-        } else if (av_strstart(line, "#EXTINF:", &ptr)) {
-            is_segment = 1;
-            duration = atof(ptr) * AV_TIME_BASE;
-        } else if (av_strstart(line, "#", NULL)) {
-            continue;
-        } else if (line[0]) {
-            if (is_segment) {
-                struct segment *seg = av_malloc(sizeof(struct segment));
-                if (!seg) {
-                    ret = AVERROR(ENOMEM);
-                    goto fail;
-                }
-                seg->duration = duration;
-                ff_make_absolute_url(seg->url, sizeof(seg->url), url, line);
-                dynarray_add(&s->segments, &s->n_segments, seg);
-                is_segment = 0;
-            } else if (is_variant) {
-                struct variant *var = av_malloc(sizeof(struct variant));
-                if (!var) {
-                    ret = AVERROR(ENOMEM);
-                    goto fail;
-                }
-                var->bandwidth = bandwidth;
-                ff_make_absolute_url(var->url, sizeof(var->url), url, line);
-                dynarray_add(&s->variants, &s->n_variants, var);
-                is_variant = 0;
-            }
-        }
-    }
-    s->last_load_time = av_gettime();
-
-fail:
-    avio_close(in);
-    return ret;
-}
-
-static int hls_close(URLContext *h)
-{
-    HLSContext *s = h->priv_data;
-
-    free_segment_list(s);
-    free_variant_list(s);
-    ffurl_close(s->seg_hd);
-    return 0;
-}
-
-static int hls_open(URLContext *h, const char *uri, int flags)
-{
-    HLSContext *s = h->priv_data;
-    int ret, i;
-    const char *nested_url;
-
-    if (flags & AVIO_FLAG_WRITE)
-        return AVERROR(ENOSYS);
-
-    h->is_streamed = 1;
-
-    if (av_strstart(uri, "hls+", &nested_url)) {
-        av_strlcpy(s->playlisturl, nested_url, sizeof(s->playlisturl));
-    } else if (av_strstart(uri, "hls://", &nested_url)) {
-        av_log(h, AV_LOG_ERROR,
-               "No nested protocol specified. Specify e.g. hls+http://%s\n",
-               nested_url);
-        ret = AVERROR(EINVAL);
-        goto fail;
-    } else {
-        av_log(h, AV_LOG_ERROR, "Unsupported url %s\n", uri);
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-    av_log(h, AV_LOG_WARNING,
-           "Using the hls protocol is discouraged, please try using the "
-           "hls demuxer instead. The hls demuxer should be more complete "
-           "and work as well as the protocol implementation. (If not, "
-           "please report it.) To use the demuxer, simply use %s as url.\n",
-           s->playlisturl);
-
-    if ((ret = parse_playlist(h, s->playlisturl)) < 0)
-        goto fail;
-
-    if (s->n_segments == 0 && s->n_variants > 0) {
-        int max_bandwidth = 0, maxvar = -1;
-        for (i = 0; i < s->n_variants; i++) {
-            if (s->variants[i]->bandwidth > max_bandwidth || i == 0) {
-                max_bandwidth = s->variants[i]->bandwidth;
-                maxvar = i;
-            }
-        }
-        av_strlcpy(s->playlisturl, s->variants[maxvar]->url,
-                   sizeof(s->playlisturl));
-        if ((ret = parse_playlist(h, s->playlisturl)) < 0)
-            goto fail;
-    }
-
-    if (s->n_segments == 0) {
-        av_log(h, AV_LOG_WARNING, "Empty playlist\n");
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-    s->cur_seq_no = s->start_seq_no;
-    if (!s->finished && s->n_segments >= 3)
-        s->cur_seq_no = s->start_seq_no + s->n_segments - 3;
-
-    return 0;
-
-fail:
-    hls_close(h);
-    return ret;
-}
-
-static int hls_read(URLContext *h, uint8_t *buf, int size)
-{
-    HLSContext *s = h->priv_data;
-    const char *url;
-    int ret;
-    int64_t reload_interval;
-
-start:
-    if (s->seg_hd) {
-        ret = ffurl_read(s->seg_hd, buf, size);
-        if (ret > 0)
-            return ret;
-    }
-    if (s->seg_hd) {
-        ffurl_close(s->seg_hd);
-        s->seg_hd = NULL;
-        s->cur_seq_no++;
-    }
-    reload_interval = s->n_segments > 0 ?
-                      s->segments[s->n_segments - 1]->duration :
-                      s->target_duration;
-retry:
-    if (!s->finished) {
-        int64_t now = av_gettime();
-        if (now - s->last_load_time >= reload_interval) {
-            if ((ret = parse_playlist(h, s->playlisturl)) < 0)
-                return ret;
-            /* If we need to reload the playlist again below (if
-             * there's still no more segments), switch to a reload
-             * interval of half the target duration. */
-            reload_interval = s->target_duration / 2;
-        }
-    }
-    if (s->cur_seq_no < s->start_seq_no) {
-        av_log(h, AV_LOG_WARNING,
-               "skipping %d segments ahead, expired from playlist\n",
-               s->start_seq_no - s->cur_seq_no);
-        s->cur_seq_no = s->start_seq_no;
-    }
-    if (s->cur_seq_no - s->start_seq_no >= s->n_segments) {
-        if (s->finished)
-            return AVERROR_EOF;
-        while (av_gettime() - s->last_load_time < reload_interval) {
-            if (ff_check_interrupt(&h->interrupt_callback))
-                return AVERROR_EXIT;
-            av_usleep(100*1000);
-        }
-        goto retry;
-    }
-    url = s->segments[s->cur_seq_no - s->start_seq_no]->url,
-    av_log(h, AV_LOG_DEBUG, "opening %s\n", url);
-    ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ,
-                     &h->interrupt_callback, NULL);
-    if (ret < 0) {
-        if (ff_check_interrupt(&h->interrupt_callback))
-            return AVERROR_EXIT;
-        av_log(h, AV_LOG_WARNING, "Unable to open %s\n", url);
-        s->cur_seq_no++;
-        goto retry;
-    }
-    goto start;
-}
-
-URLProtocol ff_hls_protocol = {
-    .name           = "hls",
-    .url_open       = hls_open,
-    .url_read       = hls_read,
-    .url_close      = hls_close,
-    .flags          = URL_PROTOCOL_FLAG_NESTED_SCHEME,
-    .priv_data_size = sizeof(HLSContext),
-};
diff --git a/deps/libav/libavformat/hnm.c b/deps/libav/libavformat/hnm.c
deleted file mode 100644
index ee34a14..0000000
--- a/deps/libav/libavformat/hnm.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Cryo Interactive Entertainment HNM4 demuxer
- *
- * Copyright (c) 2012 David Kment
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define HNM4_TAG MKTAG('H', 'N', 'M', '4')
-
-#define HNM4_SAMPLE_RATE 22050
-#define HNM4_FRAME_FPS 24
-
-#define HNM4_CHUNK_ID_PL 19536
-#define HNM4_CHUNK_ID_IZ 23113
-#define HNM4_CHUNK_ID_IU 21833
-#define HNM4_CHUNK_ID_SD 17491
-
-typedef struct Hnm4DemuxContext {
-    uint8_t version;
-    uint16_t width;
-    uint16_t height;
-    uint32_t filesize;
-    uint32_t frames;
-    uint32_t taboffset;
-    uint16_t bits;
-    uint16_t channels;
-    uint32_t framesize;
-    uint32_t currentframe;
-    int64_t pts;
-    uint32_t superchunk_remaining;
-    AVPacket vpkt;
-} Hnm4DemuxContext;
-
-static int hnm_probe(AVProbeData *p)
-{
-    if (p->buf_size < 4)
-        return 0;
-
-    // check for HNM4 header.
-    // currently only HNM v4/v4A is supported
-    if (AV_RL32(&p->buf[0]) == HNM4_TAG)
-        return AVPROBE_SCORE_MAX;
-
-    return 0;
-}
-
-static int hnm_read_header(AVFormatContext *s)
-{
-    Hnm4DemuxContext *hnm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *vst;
-
-    /* default context members */
-    hnm->pts = 0;
-    av_init_packet(&hnm->vpkt);
-    hnm->vpkt.data = NULL;
-    hnm->vpkt.size = 0;
-
-    hnm->superchunk_remaining = 0;
-
-    avio_skip(pb, 8);
-    hnm->width     = avio_rl16(pb);
-    hnm->height    = avio_rl16(pb);
-    hnm->filesize  = avio_rl32(pb);
-    hnm->frames    = avio_rl32(pb);
-    hnm->taboffset = avio_rl32(pb);
-    hnm->bits      = avio_rl16(pb);
-    hnm->channels  = avio_rl16(pb);
-    hnm->framesize = avio_rl32(pb);
-    avio_skip(pb, 32);
-
-    hnm->currentframe = 0;
-
-    if (hnm->width  < 320 || hnm->width  > 640 ||
-        hnm->height < 150 || hnm->height > 480) {
-        av_log(s, AV_LOG_ERROR,
-               "invalid resolution: %ux%u\n", hnm->width, hnm->height);
-        return AVERROR_INVALIDDATA;
-    }
-
-    // TODO: find a better way to detect HNM4A
-    if (hnm->width == 640)
-        hnm->version = 0x4a;
-    else
-        hnm->version = 0x40;
-
-    if (!(vst = avformat_new_stream(s, NULL)))
-        return AVERROR(ENOMEM);
-
-    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_id   = AV_CODEC_ID_HNM4_VIDEO;
-    vst->codec->codec_tag  = 0;
-    vst->codec->width      = hnm->width;
-    vst->codec->height     = hnm->height;
-    vst->codec->extradata  = av_mallocz(1);
-
-    vst->codec->extradata_size = 1;
-    memcpy(vst->codec->extradata, &hnm->version, 1);
-
-    vst->start_time = 0;
-
-    avpriv_set_pts_info(vst, 33, 1, HNM4_FRAME_FPS);
-
-    return 0;
-}
-
-static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    Hnm4DemuxContext *hnm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret = 0;
-
-    uint32_t superchunk_size, chunk_size;
-    uint16_t chunk_id;
-
-    if (hnm->currentframe == hnm->frames || pb->eof_reached)
-        return AVERROR_EOF;
-
-    if (hnm->superchunk_remaining == 0) {
-        /* parse next superchunk */
-        superchunk_size = avio_rl24(pb);
-        avio_skip(pb, 1);
-
-        hnm->superchunk_remaining = superchunk_size - 4;
-    }
-
-    chunk_size = avio_rl24(pb);
-    avio_skip(pb, 1);
-    chunk_id = avio_rl16(pb);
-    avio_skip(pb, 2);
-
-    if (chunk_size > hnm->superchunk_remaining) {
-        av_log(s, AV_LOG_ERROR, "invalid chunk size: %u, offset: %u\n",
-               chunk_size, (int) avio_tell(pb));
-        avio_skip(pb, hnm->superchunk_remaining - 8);
-        hnm->superchunk_remaining = 0;
-    }
-
-    switch (chunk_id) {
-    case HNM4_CHUNK_ID_PL:
-    case HNM4_CHUNK_ID_IZ:
-    case HNM4_CHUNK_ID_IU:
-        avio_seek(pb, -8, SEEK_CUR);
-        ret += av_get_packet(pb, pkt, chunk_size);
-        hnm->superchunk_remaining -= chunk_size;
-        if (chunk_id == HNM4_CHUNK_ID_IZ || chunk_id == HNM4_CHUNK_ID_IU)
-            hnm->currentframe++;
-        break;
-
-    case HNM4_CHUNK_ID_SD:
-        avio_skip(pb, chunk_size - 8);
-        hnm->superchunk_remaining -= chunk_size;
-        break;
-
-    default:
-        av_log(s, AV_LOG_WARNING, "unknown chunk found: %d, offset: %d\n",
-               chunk_id, (int) avio_tell(pb));
-        avio_skip(pb, chunk_size - 8);
-        hnm->superchunk_remaining -= chunk_size;
-        break;
-    }
-
-    return ret;
-}
-
-static int hnm_read_close(AVFormatContext *s)
-{
-    Hnm4DemuxContext *hnm = s->priv_data;
-
-    if (hnm->vpkt.size > 0)
-        av_free_packet(&hnm->vpkt);
-
-    return 0;
-}
-
-AVInputFormat ff_hnm_demuxer = {
-    .name           = "hnm",
-    .long_name      = NULL_IF_CONFIG_SMALL("Cryo HNM v4"),
-    .priv_data_size = sizeof(Hnm4DemuxContext),
-    .read_probe     = hnm_probe,
-    .read_header    = hnm_read_header,
-    .read_packet    = hnm_read_packet,
-    .read_close     = hnm_read_close,
-    .flags          = AVFMT_NO_BYTE_SEEK | AVFMT_NOGENSEARCH | AVFMT_NOBINSEARCH
-};
diff --git a/deps/libav/libavformat/http.c b/deps/libav/libavformat/http.c
deleted file mode 100644
index 0169f5f..0000000
--- a/deps/libav/libavformat/http.c
+++ /dev/null
@@ -1,1090 +0,0 @@
-/*
- * HTTP protocol for avconv client
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "avformat.h"
-#include "internal.h"
-#include "network.h"
-#include "http.h"
-#include "os_support.h"
-#include "httpauth.h"
-#include "url.h"
-#include "libavutil/opt.h"
-
-#if CONFIG_ZLIB
-#include <zlib.h>
-#endif
-
-/* XXX: POST protocol is not completely implemented because avconv uses
-   only a subset of it. */
-
-/* The IO buffer size is unrelated to the max URL size in itself, but needs
- * to be large enough to fit the full request headers (including long
- * path names).
- */
-#define BUFFER_SIZE MAX_URL_SIZE
-#define MAX_REDIRECTS 8
-
-typedef struct {
-    const AVClass *class;
-    URLContext *hd;
-    unsigned char buffer[BUFFER_SIZE], *buf_ptr, *buf_end;
-    int line_count;
-    int http_code;
-    /* Used if "Transfer-Encoding: chunked" otherwise -1. */
-    int64_t chunksize;
-    int64_t off, end_off, filesize;
-    char *location;
-    HTTPAuthState auth_state;
-    HTTPAuthState proxy_auth_state;
-    char *headers;
-    char *mime_type;
-    char *user_agent;
-    char *content_type;
-    /* Set if the server correctly handles Connection: close and will close
-     * the connection after feeding us the content. */
-    int willclose;
-    int chunked_post;
-    /* A flag which indicates if the end of chunked encoding has been sent. */
-    int end_chunked_post;
-    /* A flag which indicates we have finished to read POST reply. */
-    int end_header;
-    /* A flag which indicates if we use persistent connections. */
-    int multiple_requests;
-    uint8_t *post_data;
-    int post_datalen;
-    int icy;
-    /* how much data was read since the last ICY metadata packet */
-    int icy_data_read;
-    /* after how many bytes of read data a new metadata packet will be found */
-    int icy_metaint;
-    char *icy_metadata_headers;
-    char *icy_metadata_packet;
-#if CONFIG_ZLIB
-    int compressed;
-    z_stream inflate_stream;
-    uint8_t *inflate_buffer;
-#endif
-    AVDictionary *chained_options;
-    int send_expect_100;
-} HTTPContext;
-
-#define OFFSET(x) offsetof(HTTPContext, x)
-#define D AV_OPT_FLAG_DECODING_PARAM
-#define E AV_OPT_FLAG_ENCODING_PARAM
-#define DEFAULT_USER_AGENT "Lavf/" AV_STRINGIFY(LIBAVFORMAT_VERSION)
-static const AVOption options[] = {
-{"chunked_post", "use chunked transfer-encoding for posts", OFFSET(chunked_post), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E },
-{"headers", "set custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
-{"content_type", "set a specific content type for the POST messages", OFFSET(content_type), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
-{"user_agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = DEFAULT_USER_AGENT}, 0, 0, D },
-{"user-agent", "override User-Agent header, for compatibility with ffmpeg", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = DEFAULT_USER_AGENT}, 0, 0, D },
-{"multiple_requests", "use persistent connections", OFFSET(multiple_requests), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
-{"post_data", "set custom HTTP post data", OFFSET(post_data), AV_OPT_TYPE_BINARY, .flags = D|E },
-{"mime_type", "export the MIME type", OFFSET(mime_type), AV_OPT_TYPE_STRING, {0}, 0, 0, 0  },
-{"icy", "request ICY metadata", OFFSET(icy), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D },
-{"icy_metadata_headers", "return ICY metadata headers", OFFSET(icy_metadata_headers), AV_OPT_TYPE_STRING, {0}, 0, 0, 0 },
-{"icy_metadata_packet", "return current ICY metadata packet", OFFSET(icy_metadata_packet), AV_OPT_TYPE_STRING, {0}, 0, 0, 0 },
-{"auth_type", "HTTP authentication type", OFFSET(auth_state.auth_type), AV_OPT_TYPE_INT, {.i64 = HTTP_AUTH_NONE}, HTTP_AUTH_NONE, HTTP_AUTH_BASIC, D|E, "auth_type" },
-{"none", "No auth method set, autodetect", 0, AV_OPT_TYPE_CONST, {.i64 = HTTP_AUTH_NONE}, 0, 0, D|E, "auth_type" },
-{"basic", "HTTP basic authentication", 0, AV_OPT_TYPE_CONST, {.i64 = HTTP_AUTH_BASIC}, 0, 0, D|E, "auth_type" },
-{"send_expect_100", "Force sending an Expect: 100-continue header for POST", OFFSET(send_expect_100), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, E },
-{"location", "The actual location of the data received", OFFSET(location), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
-{"offset", "initial byte offset", OFFSET(off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D },
-{"end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D },
-{NULL}
-};
-#define HTTP_CLASS(flavor)\
-static const AVClass flavor ## _context_class = {\
-    .class_name     = #flavor,\
-    .item_name      = av_default_item_name,\
-    .option         = options,\
-    .version        = LIBAVUTIL_VERSION_INT,\
-}
-
-HTTP_CLASS(http);
-HTTP_CLASS(https);
-
-static int http_connect(URLContext *h, const char *path, const char *local_path,
-                        const char *hoststr, const char *auth,
-                        const char *proxyauth, int *new_location);
-
-void ff_http_init_auth_state(URLContext *dest, const URLContext *src)
-{
-    memcpy(&((HTTPContext*)dest->priv_data)->auth_state,
-           &((HTTPContext*)src->priv_data)->auth_state, sizeof(HTTPAuthState));
-    memcpy(&((HTTPContext*)dest->priv_data)->proxy_auth_state,
-           &((HTTPContext*)src->priv_data)->proxy_auth_state,
-           sizeof(HTTPAuthState));
-}
-
-/* return non zero if error */
-static int http_open_cnx(URLContext *h, AVDictionary **options)
-{
-    const char *path, *proxy_path, *lower_proto = "tcp", *local_path;
-    char hostname[1024], hoststr[1024], proto[10];
-    char auth[1024], proxyauth[1024] = "";
-    char path1[MAX_URL_SIZE];
-    char buf[1024], urlbuf[MAX_URL_SIZE];
-    int port, use_proxy, err, location_changed = 0, redirects = 0, attempts = 0;
-    HTTPAuthType cur_auth_type, cur_proxy_auth_type;
-    HTTPContext *s = h->priv_data;
-
-    /* fill the dest addr */
- redo:
-    /* needed in any case to build the host string */
-    av_url_split(proto, sizeof(proto), auth, sizeof(auth),
-                 hostname, sizeof(hostname), &port,
-                 path1, sizeof(path1), s->location);
-    ff_url_join(hoststr, sizeof(hoststr), NULL, NULL, hostname, port, NULL);
-
-    proxy_path = getenv("http_proxy");
-    use_proxy = !ff_http_match_no_proxy(getenv("no_proxy"), hostname) &&
-                proxy_path != NULL && av_strstart(proxy_path, "http://", NULL);
-
-    if (!strcmp(proto, "https")) {
-        lower_proto = "tls";
-        use_proxy = 0;
-        if (port < 0)
-            port = 443;
-    }
-    if (port < 0)
-        port = 80;
-
-    if (path1[0] == '\0')
-        path = "/";
-    else
-        path = path1;
-    local_path = path;
-    if (use_proxy) {
-        /* Reassemble the request URL without auth string - we don't
-         * want to leak the auth to the proxy. */
-        ff_url_join(urlbuf, sizeof(urlbuf), proto, NULL, hostname, port, "%s",
-                    path1);
-        path = urlbuf;
-        av_url_split(NULL, 0, proxyauth, sizeof(proxyauth),
-                     hostname, sizeof(hostname), &port, NULL, 0, proxy_path);
-    }
-
-    ff_url_join(buf, sizeof(buf), lower_proto, NULL, hostname, port, NULL);
-
-    if (!s->hd) {
-        err = ffurl_open(&s->hd, buf, AVIO_FLAG_READ_WRITE,
-                         &h->interrupt_callback, options);
-        if (err < 0)
-            goto fail;
-    }
-
-    cur_auth_type = s->auth_state.auth_type;
-    cur_proxy_auth_type = s->auth_state.auth_type;
-    if (http_connect(h, path, local_path, hoststr, auth, proxyauth, &location_changed) < 0)
-        goto fail;
-    attempts++;
-    if (s->http_code == 401) {
-        if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
-            s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
-            ffurl_close(s->hd);
-            s->hd = NULL;
-            goto redo;
-        } else
-            goto fail;
-    }
-    if (s->http_code == 407) {
-        if ((cur_proxy_auth_type == HTTP_AUTH_NONE || s->proxy_auth_state.stale) &&
-            s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
-            ffurl_close(s->hd);
-            s->hd = NULL;
-            goto redo;
-        } else
-            goto fail;
-    }
-    if ((s->http_code == 301 || s->http_code == 302 || s->http_code == 303 || s->http_code == 307)
-        && location_changed == 1) {
-        /* url moved, get next */
-        ffurl_close(s->hd);
-        s->hd = NULL;
-        if (redirects++ >= MAX_REDIRECTS)
-            return AVERROR(EIO);
-        /* Restart the authentication process with the new target, which
-         * might use a different auth mechanism. */
-        memset(&s->auth_state, 0, sizeof(s->auth_state));
-        attempts = 0;
-        location_changed = 0;
-        goto redo;
-    }
-    return 0;
- fail:
-    if (s->hd)
-        ffurl_close(s->hd);
-    s->hd = NULL;
-    return AVERROR(EIO);
-}
-
-int ff_http_do_new_request(URLContext *h, const char *uri)
-{
-    HTTPContext *s = h->priv_data;
-    AVDictionary *options = NULL;
-    int ret;
-
-    s->off = 0;
-    s->icy_data_read = 0;
-    av_free(s->location);
-    s->location = av_strdup(uri);
-    if (!s->location)
-        return AVERROR(ENOMEM);
-
-    av_dict_copy(&options, s->chained_options, 0);
-    ret = http_open_cnx(h, &options);
-    av_dict_free(&options);
-    return ret;
-}
-
-static int http_open(URLContext *h, const char *uri, int flags,
-                     AVDictionary **options)
-{
-    HTTPContext *s = h->priv_data;
-    int ret;
-
-    h->is_streamed = 1;
-
-    s->filesize = -1;
-    s->location = av_strdup(uri);
-    if (!s->location)
-        return AVERROR(ENOMEM);
-    if (options)
-        av_dict_copy(&s->chained_options, *options, 0);
-
-    if (s->headers) {
-        int len = strlen(s->headers);
-        if (len < 2 || strcmp("\r\n", s->headers + len - 2))
-            av_log(h, AV_LOG_WARNING, "No trailing CRLF found in HTTP header.\n");
-    }
-
-    ret = http_open_cnx(h, options);
-    if (ret < 0)
-        av_dict_free(&s->chained_options);
-    return ret;
-}
-static int http_getc(HTTPContext *s)
-{
-    int len;
-    if (s->buf_ptr >= s->buf_end) {
-        len = ffurl_read(s->hd, s->buffer, BUFFER_SIZE);
-        if (len < 0) {
-            return len;
-        } else if (len == 0) {
-            return AVERROR_EOF;
-        } else {
-            s->buf_ptr = s->buffer;
-            s->buf_end = s->buffer + len;
-        }
-    }
-    return *s->buf_ptr++;
-}
-
-static int http_get_line(HTTPContext *s, char *line, int line_size)
-{
-    int ch;
-    char *q;
-
-    q = line;
-    for(;;) {
-        ch = http_getc(s);
-        if (ch < 0)
-            return ch;
-        if (ch == '\n') {
-            /* process line */
-            if (q > line && q[-1] == '\r')
-                q--;
-            *q = '\0';
-
-            return 0;
-        } else {
-            if ((q - line) < line_size - 1)
-                *q++ = ch;
-        }
-    }
-}
-
-static int check_http_code(URLContext *h, int http_code, const char *end)
-{
-    HTTPContext *s = h->priv_data;
-    /* error codes are 4xx and 5xx, but regard 401 as a success, so we
-     * don't abort until all headers have been parsed. */
-    if (http_code >= 400 && http_code < 600 &&
-        (http_code != 401 || s->auth_state.auth_type != HTTP_AUTH_NONE) &&
-        (http_code != 407 || s->proxy_auth_state.auth_type != HTTP_AUTH_NONE)) {
-        end += strspn(end, SPACE_CHARS);
-        av_log(h, AV_LOG_WARNING, "HTTP error %d %s\n", http_code, end);
-        return AVERROR(EIO);
-    }
-    return 0;
-}
-
-static int parse_location(HTTPContext *s, const char *p)
-{
-    char redirected_location[MAX_URL_SIZE], *new_loc;
-    ff_make_absolute_url(redirected_location, sizeof(redirected_location),
-                         s->location, p);
-    new_loc = av_strdup(redirected_location);
-    if (!new_loc)
-        return AVERROR(ENOMEM);
-    av_free(s->location);
-    s->location = new_loc;
-    return 0;
-}
-
-/* "bytes $from-$to/$document_size" */
-static void parse_content_range(URLContext *h, const char *p)
-{
-    HTTPContext *s = h->priv_data;
-    const char *slash;
-
-    if (!strncmp(p, "bytes ", 6)) {
-        p += 6;
-        s->off = strtoll(p, NULL, 10);
-        if ((slash = strchr(p, '/')) && strlen(slash) > 0)
-            s->filesize = strtoll(slash+1, NULL, 10);
-    }
-    h->is_streamed = 0; /* we _can_ in fact seek */
-}
-
-static int parse_content_encoding(URLContext *h, const char *p)
-{
-    HTTPContext *s = h->priv_data;
-
-    if (!av_strncasecmp(p, "gzip", 4) ||
-        !av_strncasecmp(p, "deflate", 7)) {
-#if CONFIG_ZLIB
-        s->compressed = 1;
-        inflateEnd(&s->inflate_stream);
-        if (inflateInit2(&s->inflate_stream, 32 + 15) != Z_OK) {
-            av_log(h, AV_LOG_WARNING, "Error during zlib initialisation: %s\n",
-                   s->inflate_stream.msg);
-            return AVERROR(ENOSYS);
-        }
-        if (zlibCompileFlags() & (1 << 17)) {
-            av_log(h, AV_LOG_WARNING,
-                   "Your zlib was compiled without gzip support.\n");
-            return AVERROR(ENOSYS);
-        }
-#else
-        av_log(h, AV_LOG_WARNING,
-               "Compressed (%s) content, need zlib with gzip support\n", p);
-        return AVERROR(ENOSYS);
-#endif
-    } else if (!av_strncasecmp(p, "identity", 8)) {
-        // The normal, no-encoding case (although servers shouldn't include
-        // the header at all if this is the case).
-    } else {
-        av_log(h, AV_LOG_WARNING, "Unknown content coding: %s\n", p);
-        return AVERROR(ENOSYS);
-    }
-    return 0;
-}
-
-// Concat all Icy- header lines
-static int parse_icy(HTTPContext *s, const char *tag, const char *p)
-{
-    int len = 4 + strlen(p) + strlen(tag);
-    int is_first = !s->icy_metadata_headers;
-    int ret;
-
-    if (s->icy_metadata_headers)
-        len += strlen(s->icy_metadata_headers);
-
-    if ((ret = av_reallocp(&s->icy_metadata_headers, len)) < 0)
-        return ret;
-
-    if (is_first)
-        *s->icy_metadata_headers = '\0';
-
-    av_strlcatf(s->icy_metadata_headers, len, "%s: %s\n", tag, p);
-
-    return 0;
-}
-
-static int process_line(URLContext *h, char *line, int line_count,
-                        int *new_location)
-{
-    HTTPContext *s = h->priv_data;
-    char *tag, *p, *end;
-    int ret;
-
-    /* end of header */
-    if (line[0] == '\0') {
-        s->end_header = 1;
-        return 0;
-    }
-
-    p = line;
-    if (line_count == 0) {
-        while (!av_isspace(*p) && *p != '\0')
-            p++;
-        while (av_isspace(*p))
-            p++;
-        s->http_code = strtol(p, &end, 10);
-
-        av_dlog(NULL, "http_code=%d\n", s->http_code);
-
-        if ((ret = check_http_code(h, s->http_code, end)) < 0)
-            return ret;
-    } else {
-        while (*p != '\0' && *p != ':')
-            p++;
-        if (*p != ':')
-            return 1;
-
-        *p = '\0';
-        tag = line;
-        p++;
-        while (av_isspace(*p))
-            p++;
-        if (!av_strcasecmp(tag, "Location")) {
-            if ((ret = parse_location(s, p)) < 0)
-                return ret;
-            *new_location = 1;
-        } else if (!av_strcasecmp(tag, "Content-Length") && s->filesize == -1) {
-            s->filesize = strtoll(p, NULL, 10);
-        } else if (!av_strcasecmp(tag, "Content-Range")) {
-            parse_content_range(h, p);
-        } else if (!av_strcasecmp(tag, "Accept-Ranges") &&
-                   !strncmp(p, "bytes", 5)) {
-            h->is_streamed = 0;
-        } else if (!av_strcasecmp(tag, "Transfer-Encoding") &&
-                   !av_strncasecmp(p, "chunked", 7)) {
-            s->filesize = -1;
-            s->chunksize = 0;
-        } else if (!av_strcasecmp(tag, "WWW-Authenticate")) {
-            ff_http_auth_handle_header(&s->auth_state, tag, p);
-        } else if (!av_strcasecmp(tag, "Authentication-Info")) {
-            ff_http_auth_handle_header(&s->auth_state, tag, p);
-        } else if (!av_strcasecmp(tag, "Proxy-Authenticate")) {
-            ff_http_auth_handle_header(&s->proxy_auth_state, tag, p);
-        } else if (!av_strcasecmp(tag, "Connection")) {
-            if (!strcmp(p, "close"))
-                s->willclose = 1;
-        } else if (!av_strcasecmp (tag, "Content-Type")) {
-            av_free(s->mime_type);
-            s->mime_type = av_strdup(p);
-        } else if (!av_strcasecmp (tag, "Icy-MetaInt")) {
-            s->icy_metaint = strtoll(p, NULL, 10);
-        } else if (!av_strncasecmp(tag, "Icy-", 4)) {
-            if ((ret = parse_icy(s, tag, p)) < 0)
-                return ret;
-        } else if (!av_strcasecmp(tag, "Content-Encoding")) {
-            if ((ret = parse_content_encoding(h, p)) < 0)
-                return ret;
-        }
-    }
-    return 1;
-}
-
-static inline int has_header(const char *str, const char *header)
-{
-    /* header + 2 to skip over CRLF prefix. (make sure you have one!) */
-    if (!str)
-        return 0;
-    return av_stristart(str, header + 2, NULL) || av_stristr(str, header);
-}
-
-static int http_read_header(URLContext *h, int *new_location)
-{
-    HTTPContext *s = h->priv_data;
-    char line[MAX_URL_SIZE];
-    int err = 0;
-
-    s->chunksize = -1;
-
-    for (;;) {
-        if ((err = http_get_line(s, line, sizeof(line))) < 0)
-            return err;
-
-        av_dlog(NULL, "header='%s'\n", line);
-
-        err = process_line(h, line, s->line_count, new_location);
-        if (err < 0)
-            return err;
-        if (err == 0)
-            break;
-        s->line_count++;
-    }
-
-    return err;
-}
-
-static int http_connect(URLContext *h, const char *path, const char *local_path,
-                        const char *hoststr, const char *auth,
-                        const char *proxyauth, int *new_location)
-{
-    HTTPContext *s = h->priv_data;
-    int post, err;
-    char headers[1024] = "";
-    char *authstr = NULL, *proxyauthstr = NULL;
-    int64_t off = s->off;
-    int len = 0;
-    const char *method;
-    int send_expect_100 = 0;
-
-
-    /* send http header */
-    post = h->flags & AVIO_FLAG_WRITE;
-
-    if (s->post_data) {
-        /* force POST method and disable chunked encoding when
-         * custom HTTP post data is set */
-        post = 1;
-        s->chunked_post = 0;
-    }
-
-    method = post ? "POST" : "GET";
-    authstr = ff_http_auth_create_response(&s->auth_state, auth, local_path,
-                                           method);
-    proxyauthstr = ff_http_auth_create_response(&s->proxy_auth_state, proxyauth,
-                                                local_path, method);
-    if (post && !s->post_data) {
-        send_expect_100 = s->send_expect_100;
-        /* The user has supplied authentication but we don't know the auth type,
-         * send Expect: 100-continue to get the 401 response including the
-         * WWW-Authenticate header, or an 100 continue if no auth actually
-         * is needed. */
-        if (auth && *auth &&
-            s->auth_state.auth_type == HTTP_AUTH_NONE &&
-            s->http_code != 401)
-            send_expect_100 = 1;
-    }
-
-    /* set default headers if needed */
-    if (!has_header(s->headers, "\r\nUser-Agent: "))
-        len += av_strlcatf(headers + len, sizeof(headers) - len,
-                           "User-Agent: %s\r\n", s->user_agent);
-    if (!has_header(s->headers, "\r\nAccept: "))
-        len += av_strlcpy(headers + len, "Accept: */*\r\n",
-                          sizeof(headers) - len);
-    // Note: we send this on purpose even when s->off is 0 when we're probing,
-    // since it allows us to detect more reliably if a (non-conforming)
-    // server supports seeking by analysing the reply headers.
-    if (!has_header(s->headers, "\r\nRange: ") && !post) {
-        len += av_strlcatf(headers + len, sizeof(headers) - len,
-                           "Range: bytes=%"PRId64"-", s->off);
-        if (s->end_off)
-            len += av_strlcatf(headers + len, sizeof(headers) - len,
-                               "%"PRId64, s->end_off - 1);
-        len += av_strlcpy(headers + len, "\r\n",
-                          sizeof(headers) - len);
-    }
-    if (send_expect_100 && !has_header(s->headers, "\r\nExpect: "))
-        len += av_strlcatf(headers + len, sizeof(headers) - len,
-                           "Expect: 100-continue\r\n");
-
-    if (!has_header(s->headers, "\r\nConnection: ")) {
-        if (s->multiple_requests) {
-            len += av_strlcpy(headers + len, "Connection: keep-alive\r\n",
-                              sizeof(headers) - len);
-        } else {
-            len += av_strlcpy(headers + len, "Connection: close\r\n",
-                              sizeof(headers) - len);
-        }
-    }
-
-    if (!has_header(s->headers, "\r\nHost: "))
-        len += av_strlcatf(headers + len, sizeof(headers) - len,
-                           "Host: %s\r\n", hoststr);
-    if (!has_header(s->headers, "\r\nContent-Length: ") && s->post_data)
-        len += av_strlcatf(headers + len, sizeof(headers) - len,
-                           "Content-Length: %d\r\n", s->post_datalen);
-
-    if (!has_header(s->headers, "\r\nContent-Type: ") && s->content_type)
-        len += av_strlcatf(headers + len, sizeof(headers) - len,
-                           "Content-Type: %s\r\n", s->content_type);
-    if (!has_header(s->headers, "\r\nIcy-MetaData: ") && s->icy) {
-        len += av_strlcatf(headers + len, sizeof(headers) - len,
-                           "Icy-MetaData: %d\r\n", 1);
-    }
-
-    /* now add in custom headers */
-    if (s->headers)
-        av_strlcpy(headers + len, s->headers, sizeof(headers) - len);
-
-    snprintf(s->buffer, sizeof(s->buffer),
-             "%s %s HTTP/1.1\r\n"
-             "%s"
-             "%s"
-             "%s"
-             "%s%s"
-             "\r\n",
-             method,
-             path,
-             post && s->chunked_post ? "Transfer-Encoding: chunked\r\n" : "",
-             headers,
-             authstr ? authstr : "",
-             proxyauthstr ? "Proxy-" : "", proxyauthstr ? proxyauthstr : "");
-
-    av_freep(&authstr);
-    av_freep(&proxyauthstr);
-    if ((err = ffurl_write(s->hd, s->buffer, strlen(s->buffer))) < 0)
-        return err;
-
-    if (s->post_data)
-        if ((err = ffurl_write(s->hd, s->post_data, s->post_datalen)) < 0)
-            return err;
-
-    /* init input buffer */
-    s->buf_ptr = s->buffer;
-    s->buf_end = s->buffer;
-    s->line_count = 0;
-    s->off = 0;
-    s->icy_data_read = 0;
-    s->filesize = -1;
-    s->willclose = 0;
-    s->end_chunked_post = 0;
-    s->end_header = 0;
-    if (post && !s->post_data && !send_expect_100) {
-        /* Pretend that it did work. We didn't read any header yet, since
-         * we've still to send the POST data, but the code calling this
-         * function will check http_code after we return. */
-        s->http_code = 200;
-        return 0;
-    }
-
-    /* wait for header */
-    err = http_read_header(h, new_location);
-    if (err < 0)
-        return err;
-
-    return (off == s->off) ? 0 : -1;
-}
-
-
-static int http_buf_read(URLContext *h, uint8_t *buf, int size)
-{
-    HTTPContext *s = h->priv_data;
-    int len;
-    /* read bytes from input buffer first */
-    len = s->buf_end - s->buf_ptr;
-    if (len > 0) {
-        if (len > size)
-            len = size;
-        memcpy(buf, s->buf_ptr, len);
-        s->buf_ptr += len;
-    } else {
-        if (!s->willclose && s->filesize >= 0 && s->off >= s->filesize)
-            return AVERROR_EOF;
-        len = ffurl_read(s->hd, buf, size);
-    }
-    if (len > 0) {
-        s->off += len;
-        if (s->chunksize > 0)
-            s->chunksize -= len;
-    }
-    return len;
-}
-
-#if CONFIG_ZLIB
-#define DECOMPRESS_BUF_SIZE (256 * 1024)
-static int http_buf_read_compressed(URLContext *h, uint8_t *buf, int size)
-{
-    HTTPContext *s = h->priv_data;
-    int ret;
-
-    if (!s->inflate_buffer) {
-        s->inflate_buffer = av_malloc(DECOMPRESS_BUF_SIZE);
-        if (!s->inflate_buffer)
-            return AVERROR(ENOMEM);
-    }
-
-    if (s->inflate_stream.avail_in == 0) {
-        int read = http_buf_read(h, s->inflate_buffer, DECOMPRESS_BUF_SIZE);
-        if (read <= 0)
-            return read;
-        s->inflate_stream.next_in  = s->inflate_buffer;
-        s->inflate_stream.avail_in = read;
-    }
-
-    s->inflate_stream.avail_out = size;
-    s->inflate_stream.next_out  = buf;
-
-    ret = inflate(&s->inflate_stream, Z_SYNC_FLUSH);
-    if (ret != Z_OK && ret != Z_STREAM_END)
-        av_log(h, AV_LOG_WARNING, "inflate return value: %d, %s\n", ret, s->inflate_stream.msg);
-
-    return size - s->inflate_stream.avail_out;
-}
-#endif
-
-static int http_read_stream(URLContext *h, uint8_t *buf, int size)
-{
-    HTTPContext *s = h->priv_data;
-    int err, new_location;
-
-    if (!s->hd)
-        return AVERROR_EOF;
-
-    if (s->end_chunked_post && !s->end_header) {
-        err = http_read_header(h, &new_location);
-        if (err < 0)
-            return err;
-    }
-
-    if (s->chunksize >= 0) {
-        if (!s->chunksize) {
-            char line[32];
-
-            for(;;) {
-                do {
-                    if ((err = http_get_line(s, line, sizeof(line))) < 0)
-                        return err;
-                } while (!*line);    /* skip CR LF from last chunk */
-
-                s->chunksize = strtoll(line, NULL, 16);
-
-                av_dlog(NULL, "Chunked encoding data size: %"PRId64"'\n", s->chunksize);
-
-                if (!s->chunksize)
-                    return 0;
-                break;
-            }
-        }
-        size = FFMIN(size, s->chunksize);
-    }
-#if CONFIG_ZLIB
-    if (s->compressed)
-        return http_buf_read_compressed(h, buf, size);
-#endif
-    return http_buf_read(h, buf, size);
-}
-
-static int http_read_stream_all(URLContext *h, uint8_t *buf, int size)
-{
-    int pos = 0;
-    while (pos < size) {
-        int len = http_read_stream(h, buf + pos, size - pos);
-        if (len < 0)
-            return len;
-        pos += len;
-    }
-    return pos;
-}
-
-static int store_icy(URLContext *h, int size)
-{
-    HTTPContext *s = h->priv_data;
-    /* until next metadata packet */
-    int remaining = s->icy_metaint - s->icy_data_read;
-
-    if (remaining < 0)
-        return AVERROR_INVALIDDATA;
-
-    if (!remaining) {
-        // The metadata packet is variable sized. It has a 1 byte header
-        // which sets the length of the packet (divided by 16). If it's 0,
-        // the metadata doesn't change. After the packet, icy_metaint bytes
-        // of normal data follow.
-        uint8_t ch;
-        int len = http_read_stream_all(h, &ch, 1);
-        if (len < 0)
-            return len;
-        if (ch > 0) {
-            char data[255 * 16 + 1];
-            int ret;
-            len = ch * 16;
-            ret = http_read_stream_all(h, data, len);
-            if (ret < 0)
-                return ret;
-            data[len + 1] = 0;
-            if ((ret = av_opt_set(s, "icy_metadata_packet", data, 0)) < 0)
-                return ret;
-        }
-        s->icy_data_read = 0;
-        remaining = s->icy_metaint;
-    }
-
-    return FFMIN(size, remaining);
-}
-
-static int http_read(URLContext *h, uint8_t *buf, int size)
-{
-    HTTPContext *s = h->priv_data;
-
-    if (s->icy_metaint > 0) {
-        size = store_icy(h, size);
-        if (size < 0)
-            return size;
-    }
-
-    size = http_read_stream(h, buf, size);
-    if (size > 0)
-        s->icy_data_read += size;
-    return size;
-}
-
-/* used only when posting data */
-static int http_write(URLContext *h, const uint8_t *buf, int size)
-{
-    char temp[11] = "";  /* 32-bit hex + CRLF + nul */
-    int ret;
-    char crlf[] = "\r\n";
-    HTTPContext *s = h->priv_data;
-
-    if (!s->chunked_post) {
-        /* non-chunked data is sent without any special encoding */
-        return ffurl_write(s->hd, buf, size);
-    }
-
-    /* silently ignore zero-size data since chunk encoding that would
-     * signal EOF */
-    if (size > 0) {
-        /* upload data using chunked encoding */
-        snprintf(temp, sizeof(temp), "%x\r\n", size);
-
-        if ((ret = ffurl_write(s->hd, temp, strlen(temp))) < 0 ||
-            (ret = ffurl_write(s->hd, buf, size)) < 0 ||
-            (ret = ffurl_write(s->hd, crlf, sizeof(crlf) - 1)) < 0)
-            return ret;
-    }
-    return size;
-}
-
-static int http_shutdown(URLContext *h, int flags)
-{
-    int ret = 0;
-    char footer[] = "0\r\n\r\n";
-    HTTPContext *s = h->priv_data;
-
-    /* signal end of chunked encoding if used */
-    if ((flags & AVIO_FLAG_WRITE) && s->chunked_post) {
-        ret = ffurl_write(s->hd, footer, sizeof(footer) - 1);
-        ret = ret > 0 ? 0 : ret;
-        s->end_chunked_post = 1;
-    }
-
-    return ret;
-}
-
-static int http_close(URLContext *h)
-{
-    int ret = 0;
-    HTTPContext *s = h->priv_data;
-
-#if CONFIG_ZLIB
-    inflateEnd(&s->inflate_stream);
-    av_freep(&s->inflate_buffer);
-#endif
-
-    if (!s->end_chunked_post) {
-        /* Close the write direction by sending the end of chunked encoding. */
-        ret = http_shutdown(h, h->flags);
-    }
-
-    if (s->hd)
-        ffurl_close(s->hd);
-    av_dict_free(&s->chained_options);
-    return ret;
-}
-
-static int64_t http_seek(URLContext *h, int64_t off, int whence)
-{
-    HTTPContext *s = h->priv_data;
-    URLContext *old_hd = s->hd;
-    int64_t old_off = s->off;
-    uint8_t old_buf[BUFFER_SIZE];
-    int old_buf_size, ret;
-    AVDictionary *options = NULL;
-
-    if (whence == AVSEEK_SIZE)
-        return s->filesize;
-    else if ((whence == SEEK_CUR && off == 0) ||
-             (whence == SEEK_SET && off == s->off))
-        return s->off;
-    else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed)
-        return AVERROR(ENOSYS);
-
-    /* we save the old context in case the seek fails */
-    old_buf_size = s->buf_end - s->buf_ptr;
-    memcpy(old_buf, s->buf_ptr, old_buf_size);
-    s->hd = NULL;
-    if (whence == SEEK_CUR)
-        off += s->off;
-    else if (whence == SEEK_END)
-        off += s->filesize;
-    s->off = off;
-
-    /* if it fails, continue on old connection */
-    av_dict_copy(&options, s->chained_options, 0);
-    if ((ret = http_open_cnx(h, &options)) < 0) {
-        av_dict_free(&options);
-        memcpy(s->buffer, old_buf, old_buf_size);
-        s->buf_ptr = s->buffer;
-        s->buf_end = s->buffer + old_buf_size;
-        s->hd = old_hd;
-        s->off = old_off;
-        return ret;
-    }
-    av_dict_free(&options);
-    ffurl_close(old_hd);
-    return off;
-}
-
-static int
-http_get_file_handle(URLContext *h)
-{
-    HTTPContext *s = h->priv_data;
-    return ffurl_get_file_handle(s->hd);
-}
-
-#if CONFIG_HTTP_PROTOCOL
-URLProtocol ff_http_protocol = {
-    .name                = "http",
-    .url_open2           = http_open,
-    .url_read            = http_read,
-    .url_write           = http_write,
-    .url_seek            = http_seek,
-    .url_close           = http_close,
-    .url_get_file_handle = http_get_file_handle,
-    .url_shutdown        = http_shutdown,
-    .priv_data_size      = sizeof(HTTPContext),
-    .priv_data_class     = &http_context_class,
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
-#endif
-#if CONFIG_HTTPS_PROTOCOL
-URLProtocol ff_https_protocol = {
-    .name                = "https",
-    .url_open2           = http_open,
-    .url_read            = http_read,
-    .url_write           = http_write,
-    .url_seek            = http_seek,
-    .url_close           = http_close,
-    .url_get_file_handle = http_get_file_handle,
-    .url_shutdown        = http_shutdown,
-    .priv_data_size      = sizeof(HTTPContext),
-    .priv_data_class     = &https_context_class,
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
-#endif
-
-#if CONFIG_HTTPPROXY_PROTOCOL
-static int http_proxy_close(URLContext *h)
-{
-    HTTPContext *s = h->priv_data;
-    if (s->hd)
-        ffurl_close(s->hd);
-    return 0;
-}
-
-static int http_proxy_open(URLContext *h, const char *uri, int flags)
-{
-    HTTPContext *s = h->priv_data;
-    char hostname[1024], hoststr[1024];
-    char auth[1024], pathbuf[1024], *path;
-    char lower_url[100];
-    int port, ret = 0, attempts = 0;
-    HTTPAuthType cur_auth_type;
-    char *authstr;
-    int new_loc;
-
-    h->is_streamed = 1;
-
-    av_url_split(NULL, 0, auth, sizeof(auth), hostname, sizeof(hostname), &port,
-                 pathbuf, sizeof(pathbuf), uri);
-    ff_url_join(hoststr, sizeof(hoststr), NULL, NULL, hostname, port, NULL);
-    path = pathbuf;
-    if (*path == '/')
-        path++;
-
-    ff_url_join(lower_url, sizeof(lower_url), "tcp", NULL, hostname, port,
-                NULL);
-redo:
-    ret = ffurl_open(&s->hd, lower_url, AVIO_FLAG_READ_WRITE,
-                     &h->interrupt_callback, NULL);
-    if (ret < 0)
-        return ret;
-
-    authstr = ff_http_auth_create_response(&s->proxy_auth_state, auth,
-                                           path, "CONNECT");
-    snprintf(s->buffer, sizeof(s->buffer),
-             "CONNECT %s HTTP/1.1\r\n"
-             "Host: %s\r\n"
-             "Connection: close\r\n"
-             "%s%s"
-             "\r\n",
-             path,
-             hoststr,
-             authstr ? "Proxy-" : "", authstr ? authstr : "");
-    av_freep(&authstr);
-
-    if ((ret = ffurl_write(s->hd, s->buffer, strlen(s->buffer))) < 0)
-        goto fail;
-
-    s->buf_ptr = s->buffer;
-    s->buf_end = s->buffer;
-    s->line_count = 0;
-    s->filesize = -1;
-    cur_auth_type = s->proxy_auth_state.auth_type;
-
-    /* Note: This uses buffering, potentially reading more than the
-     * HTTP header. If tunneling a protocol where the server starts
-     * the conversation, we might buffer part of that here, too.
-     * Reading that requires using the proper ffurl_read() function
-     * on this URLContext, not using the fd directly (as the tls
-     * protocol does). This shouldn't be an issue for tls though,
-     * since the client starts the conversation there, so there
-     * is no extra data that we might buffer up here.
-     */
-    ret = http_read_header(h, &new_loc);
-    if (ret < 0)
-        goto fail;
-
-    attempts++;
-    if (s->http_code == 407 &&
-        (cur_auth_type == HTTP_AUTH_NONE || s->proxy_auth_state.stale) &&
-        s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && attempts < 2) {
-        ffurl_close(s->hd);
-        s->hd = NULL;
-        goto redo;
-    }
-
-    if (s->http_code < 400)
-        return 0;
-    ret = AVERROR(EIO);
-
-fail:
-    http_proxy_close(h);
-    return ret;
-}
-
-static int http_proxy_write(URLContext *h, const uint8_t *buf, int size)
-{
-    HTTPContext *s = h->priv_data;
-    return ffurl_write(s->hd, buf, size);
-}
-
-URLProtocol ff_httpproxy_protocol = {
-    .name                = "httpproxy",
-    .url_open            = http_proxy_open,
-    .url_read            = http_buf_read,
-    .url_write           = http_proxy_write,
-    .url_close           = http_proxy_close,
-    .url_get_file_handle = http_get_file_handle,
-    .priv_data_size      = sizeof(HTTPContext),
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
-#endif
diff --git a/deps/libav/libavformat/http.h b/deps/libav/libavformat/http.h
deleted file mode 100644
index f0d9d4a..0000000
--- a/deps/libav/libavformat/http.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * HTTP definitions
- * Copyright (c) 2010 Josh Allmann
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_HTTP_H
-#define AVFORMAT_HTTP_H
-
-#include "url.h"
-
-/**
- * Initialize the authentication state based on another HTTP URLContext.
- * This can be used to pre-initialize the authentication parameters if
- * they are known beforehand, to avoid having to do an initial failing
- * request just to get the parameters.
- *
- * @param dest URL context whose authentication state gets updated
- * @param src URL context whose authentication state gets copied
- */
-void ff_http_init_auth_state(URLContext *dest, const URLContext *src);
-
-/**
- * Send a new HTTP request, reusing the old connection.
- *
- * @param h pointer to the ressource
- * @param uri uri used to perform the request
- * @return a negative value if an error condition occurred, 0
- * otherwise
- */
-int ff_http_do_new_request(URLContext *h, const char *uri);
-
-#endif /* AVFORMAT_HTTP_H */
diff --git a/deps/libav/libavformat/httpauth.c b/deps/libav/libavformat/httpauth.c
deleted file mode 100644
index b96da3e..0000000
--- a/deps/libav/libavformat/httpauth.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * HTTP authentication
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "httpauth.h"
-#include "libavutil/base64.h"
-#include "libavutil/avstring.h"
-#include "internal.h"
-#include "libavutil/random_seed.h"
-#include "libavutil/md5.h"
-#include "urldecode.h"
-#include "avformat.h"
-
-static void handle_basic_params(HTTPAuthState *state, const char *key,
-                                int key_len, char **dest, int *dest_len)
-{
-    if (!strncmp(key, "realm=", key_len)) {
-        *dest     =        state->realm;
-        *dest_len = sizeof(state->realm);
-    }
-}
-
-static void handle_digest_params(HTTPAuthState *state, const char *key,
-                                 int key_len, char **dest, int *dest_len)
-{
-    DigestParams *digest = &state->digest_params;
-
-    if (!strncmp(key, "realm=", key_len)) {
-        *dest     =        state->realm;
-        *dest_len = sizeof(state->realm);
-    } else if (!strncmp(key, "nonce=", key_len)) {
-        *dest     =        digest->nonce;
-        *dest_len = sizeof(digest->nonce);
-    } else if (!strncmp(key, "opaque=", key_len)) {
-        *dest     =        digest->opaque;
-        *dest_len = sizeof(digest->opaque);
-    } else if (!strncmp(key, "algorithm=", key_len)) {
-        *dest     =        digest->algorithm;
-        *dest_len = sizeof(digest->algorithm);
-    } else if (!strncmp(key, "qop=", key_len)) {
-        *dest     =        digest->qop;
-        *dest_len = sizeof(digest->qop);
-    } else if (!strncmp(key, "stale=", key_len)) {
-        *dest     =        digest->stale;
-        *dest_len = sizeof(digest->stale);
-    }
-}
-
-static void handle_digest_update(HTTPAuthState *state, const char *key,
-                                 int key_len, char **dest, int *dest_len)
-{
-    DigestParams *digest = &state->digest_params;
-
-    if (!strncmp(key, "nextnonce=", key_len)) {
-        *dest     =        digest->nonce;
-        *dest_len = sizeof(digest->nonce);
-    }
-}
-
-static void choose_qop(char *qop, int size)
-{
-    char *ptr = strstr(qop, "auth");
-    char *end = ptr + strlen("auth");
-
-    if (ptr && (!*end || av_isspace(*end) || *end == ',') &&
-        (ptr == qop || av_isspace(ptr[-1]) || ptr[-1] == ',')) {
-        av_strlcpy(qop, "auth", size);
-    } else {
-        qop[0] = 0;
-    }
-}
-
-void ff_http_auth_handle_header(HTTPAuthState *state, const char *key,
-                                const char *value)
-{
-    if (!strcmp(key, "WWW-Authenticate") || !strcmp(key, "Proxy-Authenticate")) {
-        const char *p;
-        if (av_stristart(value, "Basic ", &p) &&
-            state->auth_type <= HTTP_AUTH_BASIC) {
-            state->auth_type = HTTP_AUTH_BASIC;
-            state->realm[0] = 0;
-            state->stale = 0;
-            ff_parse_key_value(p, (ff_parse_key_val_cb) handle_basic_params,
-                               state);
-        } else if (av_stristart(value, "Digest ", &p) &&
-                   state->auth_type <= HTTP_AUTH_DIGEST) {
-            state->auth_type = HTTP_AUTH_DIGEST;
-            memset(&state->digest_params, 0, sizeof(DigestParams));
-            state->realm[0] = 0;
-            state->stale = 0;
-            ff_parse_key_value(p, (ff_parse_key_val_cb) handle_digest_params,
-                               state);
-            choose_qop(state->digest_params.qop,
-                       sizeof(state->digest_params.qop));
-            if (!av_strcasecmp(state->digest_params.stale, "true"))
-                state->stale = 1;
-        }
-    } else if (!strcmp(key, "Authentication-Info")) {
-        ff_parse_key_value(value, (ff_parse_key_val_cb) handle_digest_update,
-                           state);
-    }
-}
-
-
-static void update_md5_strings(struct AVMD5 *md5ctx, ...)
-{
-    va_list vl;
-
-    va_start(vl, md5ctx);
-    while (1) {
-        const char* str = va_arg(vl, const char*);
-        if (!str)
-            break;
-        av_md5_update(md5ctx, str, strlen(str));
-    }
-    va_end(vl);
-}
-
-/* Generate a digest reply, according to RFC 2617. */
-static char *make_digest_auth(HTTPAuthState *state, const char *username,
-                              const char *password, const char *uri,
-                              const char *method)
-{
-    DigestParams *digest = &state->digest_params;
-    int len;
-    uint32_t cnonce_buf[2];
-    char cnonce[17];
-    char nc[9];
-    int i;
-    char A1hash[33], A2hash[33], response[33];
-    struct AVMD5 *md5ctx;
-    uint8_t hash[16];
-    char *authstr;
-
-    digest->nc++;
-    snprintf(nc, sizeof(nc), "%08x", digest->nc);
-
-    /* Generate a client nonce. */
-    for (i = 0; i < 2; i++)
-        cnonce_buf[i] = av_get_random_seed();
-    ff_data_to_hex(cnonce, (const uint8_t*) cnonce_buf, sizeof(cnonce_buf), 1);
-    cnonce[2*sizeof(cnonce_buf)] = 0;
-
-    md5ctx = av_md5_alloc();
-    if (!md5ctx)
-        return NULL;
-
-    av_md5_init(md5ctx);
-    update_md5_strings(md5ctx, username, ":", state->realm, ":", password, NULL);
-    av_md5_final(md5ctx, hash);
-    ff_data_to_hex(A1hash, hash, 16, 1);
-    A1hash[32] = 0;
-
-    if (!strcmp(digest->algorithm, "") || !strcmp(digest->algorithm, "MD5")) {
-    } else if (!strcmp(digest->algorithm, "MD5-sess")) {
-        av_md5_init(md5ctx);
-        update_md5_strings(md5ctx, A1hash, ":", digest->nonce, ":", cnonce, NULL);
-        av_md5_final(md5ctx, hash);
-        ff_data_to_hex(A1hash, hash, 16, 1);
-        A1hash[32] = 0;
-    } else {
-        /* Unsupported algorithm */
-        av_free(md5ctx);
-        return NULL;
-    }
-
-    av_md5_init(md5ctx);
-    update_md5_strings(md5ctx, method, ":", uri, NULL);
-    av_md5_final(md5ctx, hash);
-    ff_data_to_hex(A2hash, hash, 16, 1);
-    A2hash[32] = 0;
-
-    av_md5_init(md5ctx);
-    update_md5_strings(md5ctx, A1hash, ":", digest->nonce, NULL);
-    if (!strcmp(digest->qop, "auth") || !strcmp(digest->qop, "auth-int")) {
-        update_md5_strings(md5ctx, ":", nc, ":", cnonce, ":", digest->qop, NULL);
-    }
-    update_md5_strings(md5ctx, ":", A2hash, NULL);
-    av_md5_final(md5ctx, hash);
-    ff_data_to_hex(response, hash, 16, 1);
-    response[32] = 0;
-
-    av_free(md5ctx);
-
-    if (!strcmp(digest->qop, "") || !strcmp(digest->qop, "auth")) {
-    } else if (!strcmp(digest->qop, "auth-int")) {
-        /* qop=auth-int not supported */
-        return NULL;
-    } else {
-        /* Unsupported qop value. */
-        return NULL;
-    }
-
-    len = strlen(username) + strlen(state->realm) + strlen(digest->nonce) +
-              strlen(uri) + strlen(response) + strlen(digest->algorithm) +
-              strlen(digest->opaque) + strlen(digest->qop) + strlen(cnonce) +
-              strlen(nc) + 150;
-
-    authstr = av_malloc(len);
-    if (!authstr)
-        return NULL;
-    snprintf(authstr, len, "Authorization: Digest ");
-
-    /* TODO: Escape the quoted strings properly. */
-    av_strlcatf(authstr, len, "username=\"%s\"",   username);
-    av_strlcatf(authstr, len, ",realm=\"%s\"",     state->realm);
-    av_strlcatf(authstr, len, ",nonce=\"%s\"",     digest->nonce);
-    av_strlcatf(authstr, len, ",uri=\"%s\"",       uri);
-    av_strlcatf(authstr, len, ",response=\"%s\"",  response);
-    if (digest->algorithm[0])
-        av_strlcatf(authstr, len, ",algorithm=%s",  digest->algorithm);
-    if (digest->opaque[0])
-        av_strlcatf(authstr, len, ",opaque=\"%s\"", digest->opaque);
-    if (digest->qop[0]) {
-        av_strlcatf(authstr, len, ",qop=\"%s\"",    digest->qop);
-        av_strlcatf(authstr, len, ",cnonce=\"%s\"", cnonce);
-        av_strlcatf(authstr, len, ",nc=%s",         nc);
-    }
-
-    av_strlcatf(authstr, len, "\r\n");
-
-    return authstr;
-}
-
-char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth,
-                                   const char *path, const char *method)
-{
-    char *authstr = NULL;
-
-    /* Clear the stale flag, we assume the auth is ok now. It is reset
-     * by the server headers if there's a new issue. */
-    state->stale = 0;
-    if (!auth || !strchr(auth, ':'))
-        return NULL;
-
-    if (state->auth_type == HTTP_AUTH_BASIC) {
-        int auth_b64_len, len;
-        char *ptr, *decoded_auth = ff_urldecode(auth);
-
-        if (!decoded_auth)
-            return NULL;
-
-        auth_b64_len = AV_BASE64_SIZE(strlen(decoded_auth));
-        len = auth_b64_len + 30;
-
-        authstr = av_malloc(len);
-        if (!authstr) {
-            av_free(decoded_auth);
-            return NULL;
-        }
-
-        snprintf(authstr, len, "Authorization: Basic ");
-        ptr = authstr + strlen(authstr);
-        av_base64_encode(ptr, auth_b64_len, decoded_auth, strlen(decoded_auth));
-        av_strlcat(ptr, "\r\n", len - (ptr - authstr));
-        av_free(decoded_auth);
-    } else if (state->auth_type == HTTP_AUTH_DIGEST) {
-        char *username = ff_urldecode(auth), *password;
-
-        if (!username)
-            return NULL;
-
-        if ((password = strchr(username, ':'))) {
-            *password++ = 0;
-            authstr = make_digest_auth(state, username, password, path, method);
-        }
-        av_free(username);
-    }
-    return authstr;
-}
diff --git a/deps/libav/libavformat/httpauth.h b/deps/libav/libavformat/httpauth.h
deleted file mode 100644
index 99bf43f..0000000
--- a/deps/libav/libavformat/httpauth.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * HTTP authentication
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_HTTPAUTH_H
-#define AVFORMAT_HTTPAUTH_H
-
-/**
- * Authentication types, ordered from weakest to strongest.
- */
-typedef enum HTTPAuthType {
-    HTTP_AUTH_NONE = 0,    /**< No authentication specified */
-    HTTP_AUTH_BASIC,       /**< HTTP 1.0 Basic auth from RFC 1945
-                             *  (also in RFC 2617) */
-    HTTP_AUTH_DIGEST,      /**< HTTP 1.1 Digest auth from RFC 2617 */
-} HTTPAuthType;
-
-typedef struct DigestParams {
-    char nonce[300];       /**< Server specified nonce */
-    char algorithm[10];    /**< Server specified digest algorithm */
-    char qop[30];          /**< Quality of protection, containing the one
-                             *  that we've chosen to use, from the
-                             *  alternatives that the server offered. */
-    char opaque[300];      /**< A server-specified string that should be
-                             *  included in authentication responses, not
-                             *  included in the actual digest calculation. */
-    char stale[10];        /**< The server indicated that the auth was ok,
-                             * but needs to be redone with a new, non-stale
-                             * nonce. */
-    int nc;                /**< Nonce count, the number of earlier replies
-                             *  where this particular nonce has been used. */
-} DigestParams;
-
-/**
- * HTTP Authentication state structure. Must be zero-initialized
- * before used with the functions below.
- */
-typedef struct HTTPAuthState {
-    /**
-     * The currently chosen auth type.
-     */
-    HTTPAuthType auth_type;
-    /**
-     * Authentication realm
-     */
-    char realm[200];
-    /**
-     * The parameters specifiec to digest authentication.
-     */
-    DigestParams digest_params;
-    /**
-     * Auth ok, but needs to be resent with a new nonce.
-     */
-    int stale;
-} HTTPAuthState;
-
-void ff_http_auth_handle_header(HTTPAuthState *state, const char *key,
-                                const char *value);
-char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth,
-                                   const char *path, const char *method);
-
-#endif /* AVFORMAT_HTTPAUTH_H */
diff --git a/deps/libav/libavformat/id3v1.c b/deps/libav/libavformat/id3v1.c
deleted file mode 100644
index 87930ff..0000000
--- a/deps/libav/libavformat/id3v1.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * ID3v1 header parser
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "id3v1.h"
-#include "libavcodec/avcodec.h"
-#include "libavutil/dict.h"
-
-const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1] = {
-      [0] = "Blues",
-      [1] = "Classic Rock",
-      [2] = "Country",
-      [3] = "Dance",
-      [4] = "Disco",
-      [5] = "Funk",
-      [6] = "Grunge",
-      [7] = "Hip-Hop",
-      [8] = "Jazz",
-      [9] = "Metal",
-     [10] = "New Age",
-     [11] = "Oldies",
-     [12] = "Other",
-     [13] = "Pop",
-     [14] = "R&B",
-     [15] = "Rap",
-     [16] = "Reggae",
-     [17] = "Rock",
-     [18] = "Techno",
-     [19] = "Industrial",
-     [20] = "Alternative",
-     [21] = "Ska",
-     [22] = "Death Metal",
-     [23] = "Pranks",
-     [24] = "Soundtrack",
-     [25] = "Euro-Techno",
-     [26] = "Ambient",
-     [27] = "Trip-Hop",
-     [28] = "Vocal",
-     [29] = "Jazz+Funk",
-     [30] = "Fusion",
-     [31] = "Trance",
-     [32] = "Classical",
-     [33] = "Instrumental",
-     [34] = "Acid",
-     [35] = "House",
-     [36] = "Game",
-     [37] = "Sound Clip",
-     [38] = "Gospel",
-     [39] = "Noise",
-     [40] = "AlternRock",
-     [41] = "Bass",
-     [42] = "Soul",
-     [43] = "Punk",
-     [44] = "Space",
-     [45] = "Meditative",
-     [46] = "Instrumental Pop",
-     [47] = "Instrumental Rock",
-     [48] = "Ethnic",
-     [49] = "Gothic",
-     [50] = "Darkwave",
-     [51] = "Techno-Industrial",
-     [52] = "Electronic",
-     [53] = "Pop-Folk",
-     [54] = "Eurodance",
-     [55] = "Dream",
-     [56] = "Southern Rock",
-     [57] = "Comedy",
-     [58] = "Cult",
-     [59] = "Gangsta",
-     [60] = "Top 40",
-     [61] = "Christian Rap",
-     [62] = "Pop/Funk",
-     [63] = "Jungle",
-     [64] = "Native American",
-     [65] = "Cabaret",
-     [66] = "New Wave",
-     [67] = "Psychadelic",
-     [68] = "Rave",
-     [69] = "Showtunes",
-     [70] = "Trailer",
-     [71] = "Lo-Fi",
-     [72] = "Tribal",
-     [73] = "Acid Punk",
-     [74] = "Acid Jazz",
-     [75] = "Polka",
-     [76] = "Retro",
-     [77] = "Musical",
-     [78] = "Rock & Roll",
-     [79] = "Hard Rock",
-     [80] = "Folk",
-     [81] = "Folk-Rock",
-     [82] = "National Folk",
-     [83] = "Swing",
-     [84] = "Fast Fusion",
-     [85] = "Bebob",
-     [86] = "Latin",
-     [87] = "Revival",
-     [88] = "Celtic",
-     [89] = "Bluegrass",
-     [90] = "Avantgarde",
-     [91] = "Gothic Rock",
-     [92] = "Progressive Rock",
-     [93] = "Psychedelic Rock",
-     [94] = "Symphonic Rock",
-     [95] = "Slow Rock",
-     [96] = "Big Band",
-     [97] = "Chorus",
-     [98] = "Easy Listening",
-     [99] = "Acoustic",
-    [100] = "Humour",
-    [101] = "Speech",
-    [102] = "Chanson",
-    [103] = "Opera",
-    [104] = "Chamber Music",
-    [105] = "Sonata",
-    [106] = "Symphony",
-    [107] = "Booty Bass",
-    [108] = "Primus",
-    [109] = "Porn Groove",
-    [110] = "Satire",
-    [111] = "Slow Jam",
-    [112] = "Club",
-    [113] = "Tango",
-    [114] = "Samba",
-    [115] = "Folklore",
-    [116] = "Ballad",
-    [117] = "Power Ballad",
-    [118] = "Rhythmic Soul",
-    [119] = "Freestyle",
-    [120] = "Duet",
-    [121] = "Punk Rock",
-    [122] = "Drum Solo",
-    [123] = "A capella",
-    [124] = "Euro-House",
-    [125] = "Dance Hall",
-    [126] = "Goa",
-    [127] = "Drum & Bass",
-    [128] = "Club-House",
-    [129] = "Hardcore",
-    [130] = "Terror",
-    [131] = "Indie",
-    [132] = "BritPop",
-    [133] = "Negerpunk",
-    [134] = "Polsk Punk",
-    [135] = "Beat",
-    [136] = "Christian Gangsta",
-    [137] = "Heavy Metal",
-    [138] = "Black Metal",
-    [139] = "Crossover",
-    [140] = "Contemporary Christian",
-    [141] = "Christian Rock",
-    [142] = "Merengue",
-    [143] = "Salsa",
-    [144] = "Thrash Metal",
-    [145] = "Anime",
-    [146] = "JPop",
-    [147] = "SynthPop",
-};
-
-static void get_string(AVFormatContext *s, const char *key,
-                       const uint8_t *buf, int buf_size)
-{
-    int i, c;
-    char *q, str[512];
-
-    q = str;
-    for(i = 0; i < buf_size; i++) {
-        c = buf[i];
-        if (c == '\0')
-            break;
-        if ((q - str) >= sizeof(str) - 1)
-            break;
-        *q++ = c;
-    }
-    *q = '\0';
-
-    if (*str)
-        av_dict_set(&s->metadata, key, str, 0);
-}
-
-/**
- * Parse an ID3v1 tag
- *
- * @param buf ID3v1_TAG_SIZE long buffer containing the tag
- */
-static int parse_tag(AVFormatContext *s, const uint8_t *buf)
-{
-    char str[5];
-    int genre;
-
-    if (!(buf[0] == 'T' &&
-          buf[1] == 'A' &&
-          buf[2] == 'G'))
-        return -1;
-    get_string(s, "title",   buf +  3, 30);
-    get_string(s, "artist",  buf + 33, 30);
-    get_string(s, "album",   buf + 63, 30);
-    get_string(s, "date",    buf + 93,  4);
-    get_string(s, "comment", buf + 97, 30);
-    if (buf[125] == 0 && buf[126] != 0) {
-        snprintf(str, sizeof(str), "%d", buf[126]);
-        av_dict_set(&s->metadata, "track", str, 0);
-    }
-    genre = buf[127];
-    if (genre <= ID3v1_GENRE_MAX)
-        av_dict_set(&s->metadata, "genre", ff_id3v1_genre_str[genre], 0);
-    return 0;
-}
-
-void ff_id3v1_read(AVFormatContext *s)
-{
-    int ret;
-    uint8_t buf[ID3v1_TAG_SIZE];
-    int64_t filesize, position = avio_tell(s->pb);
-
-    if (s->pb->seekable) {
-        /* XXX: change that */
-        filesize = avio_size(s->pb);
-        if (filesize > 128) {
-            avio_seek(s->pb, filesize - 128, SEEK_SET);
-            ret = avio_read(s->pb, buf, ID3v1_TAG_SIZE);
-            if (ret == ID3v1_TAG_SIZE) {
-                parse_tag(s, buf);
-            }
-            avio_seek(s->pb, position, SEEK_SET);
-        }
-    }
-}
diff --git a/deps/libav/libavformat/id3v1.h b/deps/libav/libavformat/id3v1.h
deleted file mode 100644
index 7107073..0000000
--- a/deps/libav/libavformat/id3v1.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * ID3v1 header parser
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_ID3V1_H
-#define AVFORMAT_ID3V1_H
-
-#include "avformat.h"
-
-#define ID3v1_TAG_SIZE 128
-
-#define ID3v1_GENRE_MAX 147
-
-/**
- * ID3v1 genres
- */
-extern const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1];
-
-/**
- * Read an ID3v1 tag
- */
-void ff_id3v1_read(AVFormatContext *s);
-
-#endif /* AVFORMAT_ID3V1_H */
diff --git a/deps/libav/libavformat/id3v2.c b/deps/libav/libavformat/id3v2.c
deleted file mode 100644
index e5f7486..0000000
--- a/deps/libav/libavformat/id3v2.c
+++ /dev/null
@@ -1,770 +0,0 @@
-/*
- * ID3v2 header parser
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/dict.h"
-#include "libavutil/intreadwrite.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "id3v1.h"
-#include "id3v2.h"
-
-const AVMetadataConv ff_id3v2_34_metadata_conv[] = {
-    { "TALB", "album"        },
-    { "TCOM", "composer"     },
-    { "TCON", "genre"        },
-    { "TCOP", "copyright"    },
-    { "TENC", "encoded_by"   },
-    { "TIT2", "title"        },
-    { "TLAN", "language"     },
-    { "TPE1", "artist"       },
-    { "TPE2", "album_artist" },
-    { "TPE3", "performer"    },
-    { "TPOS", "disc"         },
-    { "TPUB", "publisher"    },
-    { "TRCK", "track"        },
-    { "TSSE", "encoder"      },
-    { 0 }
-};
-
-const AVMetadataConv ff_id3v2_4_metadata_conv[] = {
-    { "TDRL", "date"          },
-    { "TDRC", "date"          },
-    { "TDEN", "creation_time" },
-    { "TSOA", "album-sort"    },
-    { "TSOP", "artist-sort"   },
-    { "TSOT", "title-sort"    },
-    { 0 }
-};
-
-static const AVMetadataConv id3v2_2_metadata_conv[] = {
-    { "TAL", "album"        },
-    { "TCO", "genre"        },
-    { "TT2", "title"        },
-    { "TEN", "encoded_by"   },
-    { "TP1", "artist"       },
-    { "TP2", "album_artist" },
-    { "TP3", "performer"    },
-    { "TRK", "track"        },
-    { 0 }
-};
-
-const char ff_id3v2_tags[][4] = {
-    "TALB", "TBPM", "TCOM", "TCON", "TCOP", "TDLY", "TENC", "TEXT",
-    "TFLT", "TIT1", "TIT2", "TIT3", "TKEY", "TLAN", "TLEN", "TMED",
-    "TOAL", "TOFN", "TOLY", "TOPE", "TOWN", "TPE1", "TPE2", "TPE3",
-    "TPE4", "TPOS", "TPUB", "TRCK", "TRSN", "TRSO", "TSRC", "TSSE",
-    { 0 },
-};
-
-const char ff_id3v2_4_tags[][4] = {
-    "TDEN", "TDOR", "TDRC", "TDRL", "TDTG", "TIPL", "TMCL", "TMOO",
-    "TPRO", "TSOA", "TSOP", "TSOT", "TSST",
-    { 0 },
-};
-
-const char ff_id3v2_3_tags[][4] = {
-    "TDAT", "TIME", "TORY", "TRDA", "TSIZ", "TYER",
-    { 0 },
-};
-
-const char *ff_id3v2_picture_types[21] = {
-    "Other",
-    "32x32 pixels 'file icon'",
-    "Other file icon",
-    "Cover (front)",
-    "Cover (back)",
-    "Leaflet page",
-    "Media (e.g. label side of CD)",
-    "Lead artist/lead performer/soloist",
-    "Artist/performer",
-    "Conductor",
-    "Band/Orchestra",
-    "Composer",
-    "Lyricist/text writer",
-    "Recording Location",
-    "During recording",
-    "During performance",
-    "Movie/video screen capture",
-    "A bright coloured fish",
-    "Illustration",
-    "Band/artist logotype",
-    "Publisher/Studio logotype",
-};
-
-const CodecMime ff_id3v2_mime_tags[] = {
-    { "image/gif",  AV_CODEC_ID_GIF   },
-    { "image/jpeg", AV_CODEC_ID_MJPEG },
-    { "image/jpg",  AV_CODEC_ID_MJPEG },
-    { "image/png",  AV_CODEC_ID_PNG   },
-    { "image/tiff", AV_CODEC_ID_TIFF  },
-    { "image/bmp",  AV_CODEC_ID_BMP   },
-    { "JPG",        AV_CODEC_ID_MJPEG }, /* ID3v2.2  */
-    { "PNG",        AV_CODEC_ID_PNG   }, /* ID3v2.2  */
-    { "",           AV_CODEC_ID_NONE  },
-};
-
-int ff_id3v2_match(const uint8_t *buf, const char *magic)
-{
-    return  buf[0]         == magic[0] &&
-            buf[1]         == magic[1] &&
-            buf[2]         == magic[2] &&
-            buf[3]         != 0xff     &&
-            buf[4]         != 0xff     &&
-           (buf[6] & 0x80) == 0        &&
-           (buf[7] & 0x80) == 0        &&
-           (buf[8] & 0x80) == 0        &&
-           (buf[9] & 0x80) == 0;
-}
-
-int ff_id3v2_tag_len(const uint8_t *buf)
-{
-    int len = ((buf[6] & 0x7f) << 21) +
-              ((buf[7] & 0x7f) << 14) +
-              ((buf[8] & 0x7f) << 7) +
-              (buf[9] & 0x7f) +
-              ID3v2_HEADER_SIZE;
-    if (buf[5] & 0x10)
-        len += ID3v2_HEADER_SIZE;
-    return len;
-}
-
-static unsigned int get_size(AVIOContext *s, int len)
-{
-    int v = 0;
-    while (len--)
-        v = (v << 7) + (avio_r8(s) & 0x7F);
-    return v;
-}
-
-/**
- * Free GEOB type extra metadata.
- */
-static void free_geobtag(void *obj)
-{
-    ID3v2ExtraMetaGEOB *geob = obj;
-    av_free(geob->mime_type);
-    av_free(geob->file_name);
-    av_free(geob->description);
-    av_free(geob->data);
-    av_free(geob);
-}
-
-/**
- * Decode characters to UTF-8 according to encoding type. The decoded buffer is
- * always null terminated. Stop reading when either *maxread bytes are read from
- * pb or U+0000 character is found.
- *
- * @param dst Pointer where the address of the buffer with the decoded bytes is
- * stored. Buffer must be freed by caller.
- * @param maxread Pointer to maximum number of characters to read from the
- * AVIOContext. After execution the value is decremented by the number of bytes
- * actually read.
- * @returns 0 if no error occurred, dst is uninitialized on error
- */
-static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
-                      uint8_t **dst, int *maxread)
-{
-    int ret;
-    uint8_t tmp;
-    uint32_t ch = 1;
-    int left = *maxread;
-    unsigned int (*get)(AVIOContext*) = avio_rb16;
-    AVIOContext *dynbuf;
-
-    if ((ret = avio_open_dyn_buf(&dynbuf)) < 0) {
-        av_log(s, AV_LOG_ERROR, "Error opening memory stream\n");
-        return ret;
-    }
-
-    switch (encoding) {
-    case ID3v2_ENCODING_ISO8859:
-        while (left && ch) {
-            ch = avio_r8(pb);
-            PUT_UTF8(ch, tmp, avio_w8(dynbuf, tmp);)
-            left--;
-        }
-        break;
-
-    case ID3v2_ENCODING_UTF16BOM:
-        if ((left -= 2) < 0) {
-            av_log(s, AV_LOG_ERROR, "Cannot read BOM value, input too short\n");
-            avio_close_dyn_buf(dynbuf, dst);
-            av_freep(dst);
-            return AVERROR_INVALIDDATA;
-        }
-        switch (avio_rb16(pb)) {
-        case 0xfffe:
-            get = avio_rl16;
-        case 0xfeff:
-            break;
-        default:
-            av_log(s, AV_LOG_ERROR, "Incorrect BOM value\n");
-            avio_close_dyn_buf(dynbuf, dst);
-            av_freep(dst);
-            *maxread = left;
-            return AVERROR_INVALIDDATA;
-        }
-        // fall-through
-
-    case ID3v2_ENCODING_UTF16BE:
-        while ((left > 1) && ch) {
-            GET_UTF16(ch, ((left -= 2) >= 0 ? get(pb) : 0), break;)
-            PUT_UTF8(ch, tmp, avio_w8(dynbuf, tmp);)
-        }
-        if (left < 0)
-            left += 2;  /* did not read last char from pb */
-        break;
-
-    case ID3v2_ENCODING_UTF8:
-        while (left && ch) {
-            ch = avio_r8(pb);
-            avio_w8(dynbuf, ch);
-            left--;
-        }
-        break;
-    default:
-        av_log(s, AV_LOG_WARNING, "Unknown encoding\n");
-    }
-
-    if (ch)
-        avio_w8(dynbuf, 0);
-
-    avio_close_dyn_buf(dynbuf, dst);
-    *maxread = left;
-
-    return 0;
-}
-
-/**
- * Parse a text tag.
- */
-static void read_ttag(AVFormatContext *s, AVIOContext *pb, int taglen,
-                      const char *key)
-{
-    uint8_t *dst;
-    int encoding, dict_flags = AV_DICT_DONT_OVERWRITE | AV_DICT_DONT_STRDUP_VAL;
-    unsigned genre;
-
-    if (taglen < 1)
-        return;
-
-    encoding = avio_r8(pb);
-    taglen--; /* account for encoding type byte */
-
-    if (decode_str(s, pb, encoding, &dst, &taglen) < 0) {
-        av_log(s, AV_LOG_ERROR, "Error reading frame %s, skipped\n", key);
-        return;
-    }
-
-    if (!(strcmp(key, "TCON") && strcmp(key, "TCO"))                         &&
-        (sscanf(dst, "(%d)", &genre) == 1 || sscanf(dst, "%d", &genre) == 1) &&
-        genre <= ID3v1_GENRE_MAX) {
-        av_freep(&dst);
-        dst = av_strdup(ff_id3v1_genre_str[genre]);
-    } else if (!(strcmp(key, "TXXX") && strcmp(key, "TXX"))) {
-        /* dst now contains the key, need to get value */
-        key = dst;
-        if (decode_str(s, pb, encoding, &dst, &taglen) < 0) {
-            av_log(s, AV_LOG_ERROR, "Error reading frame %s, skipped\n", key);
-            av_freep(&key);
-            return;
-        }
-        dict_flags |= AV_DICT_DONT_STRDUP_KEY;
-    } else if (!*dst)
-        av_freep(&dst);
-
-    if (dst)
-        av_dict_set(&s->metadata, key, dst, dict_flags);
-}
-
-/**
- * Parse GEOB tag into a ID3v2ExtraMetaGEOB struct.
- */
-static void read_geobtag(AVFormatContext *s, AVIOContext *pb, int taglen,
-                         char *tag, ID3v2ExtraMeta **extra_meta)
-{
-    ID3v2ExtraMetaGEOB *geob_data = NULL;
-    ID3v2ExtraMeta *new_extra     = NULL;
-    char encoding;
-    unsigned int len;
-
-    if (taglen < 1)
-        return;
-
-    geob_data = av_mallocz(sizeof(ID3v2ExtraMetaGEOB));
-    if (!geob_data) {
-        av_log(s, AV_LOG_ERROR, "Failed to alloc %zu bytes\n",
-               sizeof(ID3v2ExtraMetaGEOB));
-        return;
-    }
-
-    new_extra = av_mallocz(sizeof(ID3v2ExtraMeta));
-    if (!new_extra) {
-        av_log(s, AV_LOG_ERROR, "Failed to alloc %zu bytes\n",
-               sizeof(ID3v2ExtraMeta));
-        goto fail;
-    }
-
-    /* read encoding type byte */
-    encoding = avio_r8(pb);
-    taglen--;
-
-    /* read MIME type (always ISO-8859) */
-    if (decode_str(s, pb, ID3v2_ENCODING_ISO8859, &geob_data->mime_type,
-                   &taglen) < 0 ||
-        taglen <= 0)
-        goto fail;
-
-    /* read file name */
-    if (decode_str(s, pb, encoding, &geob_data->file_name, &taglen) < 0 ||
-        taglen <= 0)
-        goto fail;
-
-    /* read content description */
-    if (decode_str(s, pb, encoding, &geob_data->description, &taglen) < 0 ||
-        taglen < 0)
-        goto fail;
-
-    if (taglen) {
-        /* save encapsulated binary data */
-        geob_data->data = av_malloc(taglen);
-        if (!geob_data->data) {
-            av_log(s, AV_LOG_ERROR, "Failed to alloc %d bytes\n", taglen);
-            goto fail;
-        }
-        if ((len = avio_read(pb, geob_data->data, taglen)) < taglen)
-            av_log(s, AV_LOG_WARNING,
-                   "Error reading GEOB frame, data truncated.\n");
-        geob_data->datasize = len;
-    } else {
-        geob_data->data     = NULL;
-        geob_data->datasize = 0;
-    }
-
-    /* add data to the list */
-    new_extra->tag  = "GEOB";
-    new_extra->data = geob_data;
-    new_extra->next = *extra_meta;
-    *extra_meta     = new_extra;
-
-    return;
-
-fail:
-    av_log(s, AV_LOG_ERROR, "Error reading frame %s, skipped\n", tag);
-    free_geobtag(geob_data);
-    av_free(new_extra);
-    return;
-}
-
-static int is_number(const char *str)
-{
-    while (*str >= '0' && *str <= '9')
-        str++;
-    return !*str;
-}
-
-static AVDictionaryEntry *get_date_tag(AVDictionary *m, const char *tag)
-{
-    AVDictionaryEntry *t;
-    if ((t = av_dict_get(m, tag, NULL, AV_DICT_MATCH_CASE)) &&
-        strlen(t->value) == 4 && is_number(t->value))
-        return t;
-    return NULL;
-}
-
-static void merge_date(AVDictionary **m)
-{
-    AVDictionaryEntry *t;
-    char date[17] = { 0 };      // YYYY-MM-DD hh:mm
-
-    if (!(t = get_date_tag(*m, "TYER")) &&
-        !(t = get_date_tag(*m, "TYE")))
-        return;
-    av_strlcpy(date, t->value, 5);
-    av_dict_set(m, "TYER", NULL, 0);
-    av_dict_set(m, "TYE", NULL, 0);
-
-    if (!(t = get_date_tag(*m, "TDAT")) &&
-        !(t = get_date_tag(*m, "TDA")))
-        goto finish;
-    snprintf(date + 4, sizeof(date) - 4, "-%.2s-%.2s", t->value + 2, t->value);
-    av_dict_set(m, "TDAT", NULL, 0);
-    av_dict_set(m, "TDA", NULL, 0);
-
-    if (!(t = get_date_tag(*m, "TIME")) &&
-        !(t = get_date_tag(*m, "TIM")))
-        goto finish;
-    snprintf(date + 10, sizeof(date) - 10,
-             " %.2s:%.2s", t->value, t->value + 2);
-    av_dict_set(m, "TIME", NULL, 0);
-    av_dict_set(m, "TIM", NULL, 0);
-
-finish:
-    if (date[0])
-        av_dict_set(m, "date", date, 0);
-}
-
-static void free_apic(void *obj)
-{
-    ID3v2ExtraMetaAPIC *apic = obj;
-    av_buffer_unref(&apic->buf);
-    av_freep(&apic->description);
-    av_freep(&apic);
-}
-
-static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
-                      char *tag, ID3v2ExtraMeta **extra_meta)
-{
-    int enc, pic_type;
-    char mimetype[64];
-    const CodecMime *mime     = ff_id3v2_mime_tags;
-    enum AVCodecID id         = AV_CODEC_ID_NONE;
-    ID3v2ExtraMetaAPIC *apic  = NULL;
-    ID3v2ExtraMeta *new_extra = NULL;
-    int64_t end               = avio_tell(pb) + taglen;
-
-    if (taglen <= 4)
-        goto fail;
-
-    new_extra = av_mallocz(sizeof(*new_extra));
-    apic      = av_mallocz(sizeof(*apic));
-    if (!new_extra || !apic)
-        goto fail;
-
-    enc = avio_r8(pb);
-    taglen--;
-
-    /* mimetype */
-    taglen -= avio_get_str(pb, taglen, mimetype, sizeof(mimetype));
-    while (mime->id != AV_CODEC_ID_NONE) {
-        if (!av_strncasecmp(mime->str, mimetype, sizeof(mimetype))) {
-            id = mime->id;
-            break;
-        }
-        mime++;
-    }
-    if (id == AV_CODEC_ID_NONE) {
-        av_log(s, AV_LOG_WARNING,
-               "Unknown attached picture mimetype: %s, skipping.\n", mimetype);
-        goto fail;
-    }
-    apic->id = id;
-
-    /* picture type */
-    pic_type = avio_r8(pb);
-    taglen--;
-    if (pic_type < 0 || pic_type >= FF_ARRAY_ELEMS(ff_id3v2_picture_types)) {
-        av_log(s, AV_LOG_WARNING, "Unknown attached picture type %d.\n",
-               pic_type);
-        pic_type = 0;
-    }
-    apic->type = ff_id3v2_picture_types[pic_type];
-
-    /* description and picture data */
-    if (decode_str(s, pb, enc, &apic->description, &taglen) < 0) {
-        av_log(s, AV_LOG_ERROR,
-               "Error decoding attached picture description.\n");
-        goto fail;
-    }
-
-    apic->buf = av_buffer_alloc(taglen + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!apic->buf || avio_read(pb, apic->buf->data, taglen) != taglen)
-        goto fail;
-    memset(apic->buf->data + taglen, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-    new_extra->tag  = "APIC";
-    new_extra->data = apic;
-    new_extra->next = *extra_meta;
-    *extra_meta     = new_extra;
-
-    return;
-
-fail:
-    if (apic)
-        free_apic(apic);
-    av_freep(&new_extra);
-    avio_seek(pb, end, SEEK_SET);
-}
-
-typedef struct ID3v2EMFunc {
-    const char *tag3;
-    const char *tag4;
-    void (*read)(AVFormatContext *, AVIOContext *, int, char *,
-                 ID3v2ExtraMeta **);
-    void (*free)(void *obj);
-} ID3v2EMFunc;
-
-static const ID3v2EMFunc id3v2_extra_meta_funcs[] = {
-    { "GEO", "GEOB", read_geobtag, free_geobtag },
-    { "PIC", "APIC", read_apic,    free_apic    },
-    { NULL }
-};
-
-/**
- * Get the corresponding ID3v2EMFunc struct for a tag.
- * @param isv34 Determines if v2.2 or v2.3/4 strings are used
- * @return A pointer to the ID3v2EMFunc struct if found, NULL otherwise.
- */
-static const ID3v2EMFunc *get_extra_meta_func(const char *tag, int isv34)
-{
-    int i = 0;
-    while (id3v2_extra_meta_funcs[i].tag3) {
-        if (!memcmp(tag,
-                    (isv34 ? id3v2_extra_meta_funcs[i].tag4 :
-                             id3v2_extra_meta_funcs[i].tag3),
-                    (isv34 ? 4 : 3)))
-            return &id3v2_extra_meta_funcs[i];
-        i++;
-    }
-    return NULL;
-}
-
-static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
-                        uint8_t flags, ID3v2ExtraMeta **extra_meta)
-{
-    int isv34, tlen, unsync;
-    char tag[5];
-    int64_t next, end = avio_tell(s->pb) + len;
-    int taghdrlen;
-    const char *reason = NULL;
-    AVIOContext pb;
-    AVIOContext *pbx;
-    unsigned char *buffer = NULL;
-    int buffer_size       = 0;
-    const ID3v2EMFunc *extra_func;
-
-    switch (version) {
-    case 2:
-        if (flags & 0x40) {
-            reason = "compression";
-            goto error;
-        }
-        isv34     = 0;
-        taghdrlen = 6;
-        break;
-
-    case 3:
-    case 4:
-        isv34     = 1;
-        taghdrlen = 10;
-        break;
-
-    default:
-        reason = "version";
-        goto error;
-    }
-
-    unsync = flags & 0x80;
-
-    if (isv34 && flags & 0x40) { /* Extended header present, just skip over it */
-        int extlen = get_size(s->pb, 4);
-        if (version == 4)
-            /* In v2.4 the length includes the length field we just read. */
-            extlen -= 4;
-
-        if (extlen < 0) {
-            reason = "invalid extended header length";
-            goto error;
-        }
-        avio_skip(s->pb, extlen);
-    }
-
-    while (len >= taghdrlen) {
-        unsigned int tflags = 0;
-        int tunsync         = 0;
-
-        if (isv34) {
-            avio_read(s->pb, tag, 4);
-            tag[4] = 0;
-            if (version == 3) {
-                tlen = avio_rb32(s->pb);
-            } else
-                tlen = get_size(s->pb, 4);
-            tflags  = avio_rb16(s->pb);
-            tunsync = tflags & ID3v2_FLAG_UNSYNCH;
-        } else {
-            avio_read(s->pb, tag, 3);
-            tag[3] = 0;
-            tlen   = avio_rb24(s->pb);
-        }
-        if (tlen < 0 || tlen > len - taghdrlen) {
-            av_log(s, AV_LOG_WARNING,
-                   "Invalid size in frame %s, skipping the rest of tag.\n",
-                   tag);
-            break;
-        }
-        len -= taghdrlen + tlen;
-        next = avio_tell(s->pb) + tlen;
-
-        if (!tlen) {
-            if (tag[0])
-                av_log(s, AV_LOG_DEBUG, "Invalid empty frame %s, skipping.\n",
-                       tag);
-            continue;
-        }
-
-        if (tflags & ID3v2_FLAG_DATALEN) {
-            avio_rb32(s->pb);
-            tlen -= 4;
-        }
-
-        if (tflags & (ID3v2_FLAG_ENCRYPTION | ID3v2_FLAG_COMPRESSION)) {
-            av_log(s, AV_LOG_WARNING,
-                   "Skipping encrypted/compressed ID3v2 frame %s.\n", tag);
-            avio_skip(s->pb, tlen);
-        /* check for text tag or supported special meta tag */
-        } else if (tag[0] == 'T' ||
-                   (extra_meta &&
-                    (extra_func = get_extra_meta_func(tag, isv34)))) {
-            if (unsync || tunsync) {
-                int64_t end = avio_tell(s->pb) + tlen;
-                uint8_t *b;
-                av_fast_malloc(&buffer, &buffer_size, tlen);
-                if (!buffer) {
-                    av_log(s, AV_LOG_ERROR, "Failed to alloc %d bytes\n", tlen);
-                    goto seek;
-                }
-                b = buffer;
-                while (avio_tell(s->pb) < end && !s->pb->eof_reached) {
-                    *b++ = avio_r8(s->pb);
-                    if (*(b - 1) == 0xff && avio_tell(s->pb) < end - 1 &&
-                        !s->pb->eof_reached ) {
-                        uint8_t val = avio_r8(s->pb);
-                        *b++ = val ? val : avio_r8(s->pb);
-                    }
-                }
-                ffio_init_context(&pb, buffer, b - buffer, 0, NULL, NULL, NULL,
-                                  NULL);
-                tlen = b - buffer;
-                pbx  = &pb; // read from sync buffer
-            } else {
-                pbx = s->pb; // read straight from input
-            }
-            if (tag[0] == 'T')
-                /* parse text tag */
-                read_ttag(s, pbx, tlen, tag);
-            else
-                /* parse special meta tag */
-                extra_func->read(s, pbx, tlen, tag, extra_meta);
-        } else if (!tag[0]) {
-            if (tag[1])
-                av_log(s, AV_LOG_WARNING, "invalid frame id, assuming padding");
-            avio_skip(s->pb, tlen);
-            break;
-        }
-        /* Skip to end of tag */
-seek:
-        avio_seek(s->pb, next, SEEK_SET);
-    }
-
-    /* Footer preset, always 10 bytes, skip over it */
-    if (version == 4 && flags & 0x10)
-        end += 10;
-
-error:
-    if (reason)
-        av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n",
-               version, reason);
-    avio_seek(s->pb, end, SEEK_SET);
-    av_free(buffer);
-    return;
-}
-
-void ff_id3v2_read(AVFormatContext *s, const char *magic,
-                   ID3v2ExtraMeta **extra_meta)
-{
-    int len, ret;
-    uint8_t buf[ID3v2_HEADER_SIZE];
-    int found_header;
-    int64_t off;
-
-    do {
-        /* save the current offset in case there's nothing to read/skip */
-        off = avio_tell(s->pb);
-        ret = avio_read(s->pb, buf, ID3v2_HEADER_SIZE);
-        if (ret != ID3v2_HEADER_SIZE)
-            break;
-        found_header = ff_id3v2_match(buf, magic);
-        if (found_header) {
-            /* parse ID3v2 header */
-            len = ((buf[6] & 0x7f) << 21) |
-                  ((buf[7] & 0x7f) << 14) |
-                  ((buf[8] & 0x7f) << 7) |
-                   (buf[9] & 0x7f);
-            id3v2_parse(s, len, buf[3], buf[5], extra_meta);
-        } else {
-            avio_seek(s->pb, off, SEEK_SET);
-        }
-    } while (found_header);
-    ff_metadata_conv(&s->metadata, NULL, ff_id3v2_34_metadata_conv);
-    ff_metadata_conv(&s->metadata, NULL, id3v2_2_metadata_conv);
-    ff_metadata_conv(&s->metadata, NULL, ff_id3v2_4_metadata_conv);
-    merge_date(&s->metadata);
-}
-
-void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
-{
-    ID3v2ExtraMeta *current = *extra_meta, *next;
-    const ID3v2EMFunc *extra_func;
-
-    while (current) {
-        if ((extra_func = get_extra_meta_func(current->tag, 1)))
-            extra_func->free(current->data);
-        next = current->next;
-        av_freep(&current);
-        current = next;
-    }
-}
-
-int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
-{
-    ID3v2ExtraMeta *cur;
-
-    for (cur = *extra_meta; cur; cur = cur->next) {
-        ID3v2ExtraMetaAPIC *apic;
-        AVStream *st;
-
-        if (strcmp(cur->tag, "APIC"))
-            continue;
-        apic = cur->data;
-
-        if (!(st = avformat_new_stream(s, NULL)))
-            return AVERROR(ENOMEM);
-
-        st->disposition      |= AV_DISPOSITION_ATTACHED_PIC;
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id   = apic->id;
-        av_dict_set(&st->metadata, "title",   apic->description, 0);
-        av_dict_set(&st->metadata, "comment", apic->type, 0);
-
-        av_init_packet(&st->attached_pic);
-        st->attached_pic.buf          = apic->buf;
-        st->attached_pic.data         = apic->buf->data;
-        st->attached_pic.size         = apic->buf->size - FF_INPUT_BUFFER_PADDING_SIZE;
-        st->attached_pic.stream_index = st->index;
-        st->attached_pic.flags       |= AV_PKT_FLAG_KEY;
-
-        apic->buf = NULL;
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/id3v2.h b/deps/libav/libavformat/id3v2.h
deleted file mode 100644
index 7cb4296..0000000
--- a/deps/libav/libavformat/id3v2.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * ID3v2 header parser
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_ID3V2_H
-#define AVFORMAT_ID3V2_H
-
-#include <stdint.h>
-#include "avformat.h"
-#include "internal.h"
-#include "metadata.h"
-
-#define ID3v2_HEADER_SIZE 10
-
-/**
- * Default magic bytes for ID3v2 header: "ID3"
- */
-#define ID3v2_DEFAULT_MAGIC "ID3"
-
-#define ID3v2_FLAG_DATALEN     0x0001
-#define ID3v2_FLAG_UNSYNCH     0x0002
-#define ID3v2_FLAG_ENCRYPTION  0x0004
-#define ID3v2_FLAG_COMPRESSION 0x0008
-
-enum ID3v2Encoding {
-    ID3v2_ENCODING_ISO8859  = 0,
-    ID3v2_ENCODING_UTF16BOM = 1,
-    ID3v2_ENCODING_UTF16BE  = 2,
-    ID3v2_ENCODING_UTF8     = 3,
-};
-
-typedef struct ID3v2EncContext {
-    int      version;       ///< ID3v2 minor version, either 3 or 4
-    int64_t size_pos;       ///< offset of the tag total size
-    int          len;       ///< size of the tag written so far
-} ID3v2EncContext;
-
-typedef struct ID3v2ExtraMeta {
-    const char *tag;
-    void *data;
-    struct ID3v2ExtraMeta *next;
-} ID3v2ExtraMeta;
-
-typedef struct ID3v2ExtraMetaGEOB {
-    uint32_t datasize;
-    uint8_t *mime_type;
-    uint8_t *file_name;
-    uint8_t *description;
-    uint8_t *data;
-} ID3v2ExtraMetaGEOB;
-
-typedef struct ID3v2ExtraMetaAPIC {
-    AVBufferRef *buf;
-    const char  *type;
-    uint8_t     *description;
-    enum AVCodecID id;
-} ID3v2ExtraMetaAPIC;
-
-/**
- * Detect ID3v2 Header.
- * @param buf   must be ID3v2_HEADER_SIZE byte long
- * @param magic magic bytes to identify the header.
- * If in doubt, use ID3v2_DEFAULT_MAGIC.
- */
-int ff_id3v2_match(const uint8_t *buf, const char *magic);
-
-/**
- * Get the length of an ID3v2 tag.
- * @param buf must be ID3v2_HEADER_SIZE bytes long and point to the start of an
- * already detected ID3v2 tag
- */
-int ff_id3v2_tag_len(const uint8_t *buf);
-
-/**
- * Read an ID3v2 tag, including supported extra metadata
- * @param extra_meta If not NULL, extra metadata is parsed into a list of
- * ID3v2ExtraMeta structs and *extra_meta points to the head of the list
- */
-void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta);
-
-/**
- * Initialize an ID3v2 tag.
- */
-void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version,
-                    const char *magic);
-
-/**
- * Convert and write all global metadata from s into an ID3v2 tag.
- */
-int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3);
-
-/**
- * Write an attached picture from pkt into an ID3v2 tag.
- */
-int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt);
-
-/**
- * Finalize an opened ID3v2 tag.
- */
-void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb);
-
-/**
- * Write an ID3v2 tag containing all global metadata from s.
- * @param id3v2_version Subversion of ID3v2; supported values are 3 and 4
- * @param magic magic bytes to identify the header
- * If in doubt, use ID3v2_DEFAULT_MAGIC.
- */
-int ff_id3v2_write_simple(struct AVFormatContext *s, int id3v2_version, const char *magic);
-
-/**
- * Free memory allocated parsing special (non-text) metadata.
- * @param extra_meta Pointer to a pointer to the head of a ID3v2ExtraMeta list, *extra_meta is set to NULL.
- */
-void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta);
-
-/**
- * Create a stream for each APIC (attached picture) extracted from the
- * ID3v2 header.
- */
-int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta);
-
-extern const AVMetadataConv ff_id3v2_34_metadata_conv[];
-extern const AVMetadataConv ff_id3v2_4_metadata_conv[];
-
-/**
- * A list of text information frames allowed in both ID3 v2.3 and v2.4
- * http://www.id3.org/id3v2.4.0-frames
- * http://www.id3.org/id3v2.4.0-changes
- */
-extern const char ff_id3v2_tags[][4];
-
-/**
- * ID3v2.4-only text information frames.
- */
-extern const char ff_id3v2_4_tags[][4];
-
-/**
- * ID3v2.3-only text information frames.
- */
-extern const char ff_id3v2_3_tags[][4];
-
-extern const CodecMime ff_id3v2_mime_tags[];
-
-extern const char *ff_id3v2_picture_types[21];
-
-#endif /* AVFORMAT_ID3V2_H */
diff --git a/deps/libav/libavformat/id3v2enc.c b/deps/libav/libavformat/id3v2enc.c
deleted file mode 100644
index df00f05..0000000
--- a/deps/libav/libavformat/id3v2enc.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * ID3v2 header writer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include "libavutil/dict.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "avio.h"
-#include "id3v2.h"
-
-static void id3v2_put_size(AVIOContext *pb, int size)
-{
-    avio_w8(pb, size >> 21 & 0x7f);
-    avio_w8(pb, size >> 14 & 0x7f);
-    avio_w8(pb, size >> 7  & 0x7f);
-    avio_w8(pb, size       & 0x7f);
-}
-
-static int string_is_ascii(const uint8_t *str)
-{
-    while (*str && *str < 128) str++;
-    return !*str;
-}
-
-static void id3v2_encode_string(AVIOContext *pb, const uint8_t *str,
-                               enum ID3v2Encoding enc)
-{
-    int (*put)(AVIOContext*, const char*);
-
-    if (enc == ID3v2_ENCODING_UTF16BOM) {
-        avio_wl16(pb, 0xFEFF);      /* BOM */
-        put = avio_put_str16le;
-    } else
-        put = avio_put_str;
-
-    put(pb, str);
-}
-
-/**
- * Write a text frame with one (normal frames) or two (TXXX frames) strings
- * according to encoding (only UTF-8 or UTF-16+BOM supported).
- * @return number of bytes written or a negative error code.
- */
-static int id3v2_put_ttag(ID3v2EncContext *id3, AVIOContext *avioc, const char *str1, const char *str2,
-                          uint32_t tag, enum ID3v2Encoding enc)
-{
-    int len;
-    uint8_t *pb;
-    AVIOContext *dyn_buf;
-    if (avio_open_dyn_buf(&dyn_buf) < 0)
-        return AVERROR(ENOMEM);
-
-    /* check if the strings are ASCII-only and use UTF16 only if
-     * they're not */
-    if (enc == ID3v2_ENCODING_UTF16BOM && string_is_ascii(str1) &&
-        (!str2 || string_is_ascii(str2)))
-        enc = ID3v2_ENCODING_ISO8859;
-
-    avio_w8(dyn_buf, enc);
-    id3v2_encode_string(dyn_buf, str1, enc);
-    if (str2)
-        id3v2_encode_string(dyn_buf, str2, enc);
-    len = avio_close_dyn_buf(dyn_buf, &pb);
-
-    avio_wb32(avioc, tag);
-    /* ID3v2.3 frame size is not synchsafe */
-    if (id3->version == 3)
-        avio_wb32(avioc, len);
-    else
-        id3v2_put_size(avioc, len);
-    avio_wb16(avioc, 0);
-    avio_write(avioc, pb, len);
-
-    av_freep(&pb);
-    return len + ID3v2_HEADER_SIZE;
-}
-
-static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, AVDictionaryEntry *t,
-                                 const char table[][4], enum ID3v2Encoding enc)
-{
-    uint32_t tag;
-    int i;
-
-    if (t->key[0] != 'T' || strlen(t->key) != 4)
-        return -1;
-    tag = AV_RB32(t->key);
-    for (i = 0; *table[i]; i++)
-        if (tag == AV_RB32(table[i]))
-            return id3v2_put_ttag(id3, pb, t->value, NULL, tag, enc);
-    return -1;
-}
-
-void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version,
-                    const char *magic)
-{
-    id3->version = id3v2_version;
-
-    avio_wb32(pb, MKBETAG(magic[0], magic[1], magic[2], id3v2_version));
-    avio_w8(pb, 0);
-    avio_w8(pb, 0); /* flags */
-
-    /* reserve space for size */
-    id3->size_pos = avio_tell(pb);
-    avio_wb32(pb, 0);
-}
-
-int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3)
-{
-    AVDictionaryEntry *t = NULL;
-    int enc = id3->version == 3 ? ID3v2_ENCODING_UTF16BOM :
-                                  ID3v2_ENCODING_UTF8;
-
-    ff_metadata_conv(&s->metadata, ff_id3v2_34_metadata_conv, NULL);
-    if (id3->version == 4)
-        ff_metadata_conv(&s->metadata, ff_id3v2_4_metadata_conv, NULL);
-
-    while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) {
-        int ret;
-
-        if ((ret = id3v2_check_write_tag(id3, s->pb, t, ff_id3v2_tags, enc)) > 0) {
-            id3->len += ret;
-            continue;
-        }
-        if ((ret = id3v2_check_write_tag(id3, s->pb, t, id3->version == 3 ?
-                                               ff_id3v2_3_tags : ff_id3v2_4_tags, enc)) > 0) {
-            id3->len += ret;
-            continue;
-        }
-
-        /* unknown tag, write as TXXX frame */
-        if ((ret = id3v2_put_ttag(id3, s->pb, t->key, t->value, MKBETAG('T', 'X', 'X', 'X'), enc)) < 0)
-            return ret;
-        id3->len += ret;
-    }
-
-    return 0;
-}
-
-int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt)
-{
-    AVStream *st = s->streams[pkt->stream_index];
-    AVDictionaryEntry *e;
-
-    AVIOContext *dyn_buf;
-    uint8_t     *buf;
-    const CodecMime *mime = ff_id3v2_mime_tags;
-    const char  *mimetype = NULL, *desc = "";
-    int enc = id3->version == 3 ? ID3v2_ENCODING_UTF16BOM :
-                                  ID3v2_ENCODING_UTF8;
-    int i, len, type = 0;
-
-    /* get the mimetype*/
-    while (mime->id != AV_CODEC_ID_NONE) {
-        if (mime->id == st->codec->codec_id) {
-            mimetype = mime->str;
-            break;
-        }
-        mime++;
-    }
-    if (!mimetype) {
-        av_log(s, AV_LOG_ERROR, "No mimetype is known for stream %d, cannot "
-               "write an attached picture.\n", st->index);
-        return AVERROR(EINVAL);
-    }
-
-    /* get the picture type */
-    e = av_dict_get(st->metadata, "comment", NULL, 0);
-    for (i = 0; e && i < FF_ARRAY_ELEMS(ff_id3v2_picture_types); i++) {
-        if (strstr(ff_id3v2_picture_types[i], e->value) == ff_id3v2_picture_types[i]) {
-            type = i;
-            break;
-        }
-    }
-
-    /* get the description */
-    if ((e = av_dict_get(st->metadata, "title", NULL, 0)))
-        desc = e->value;
-
-    /* start writing */
-    if (avio_open_dyn_buf(&dyn_buf) < 0)
-        return AVERROR(ENOMEM);
-
-    avio_w8(dyn_buf, enc);
-    avio_put_str(dyn_buf, mimetype);
-    avio_w8(dyn_buf, type);
-    id3v2_encode_string(dyn_buf, desc, enc);
-    avio_write(dyn_buf, pkt->data, pkt->size);
-    len = avio_close_dyn_buf(dyn_buf, &buf);
-
-    avio_wb32(s->pb, MKBETAG('A', 'P', 'I', 'C'));
-    if (id3->version == 3)
-        avio_wb32(s->pb, len);
-    else
-        id3v2_put_size(s->pb, len);
-    avio_wb16(s->pb, 0);
-    avio_write(s->pb, buf, len);
-    av_freep(&buf);
-
-    id3->len += len + ID3v2_HEADER_SIZE;
-
-    return 0;
-}
-
-void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb)
-{
-    int64_t cur_pos = avio_tell(pb);
-    avio_seek(pb, id3->size_pos, SEEK_SET);
-    id3v2_put_size(pb, id3->len);
-    avio_seek(pb, cur_pos, SEEK_SET);
-}
-
-int ff_id3v2_write_simple(struct AVFormatContext *s, int id3v2_version,
-                          const char *magic)
-{
-    ID3v2EncContext id3 = { 0 };
-    int ret;
-
-    ff_id3v2_start(&id3, s->pb, id3v2_version, magic);
-    if ((ret = ff_id3v2_write_metadata(s, &id3)) < 0)
-        return ret;
-    ff_id3v2_finish(&id3, s->pb);
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/idcin.c b/deps/libav/libavformat/idcin.c
deleted file mode 100644
index 2536e8b..0000000
--- a/deps/libav/libavformat/idcin.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * id Quake II CIN File Demuxer
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * id Quake II CIN file demuxer by Mike Melanson (melanson at pcisys.net)
- * For more information about the id CIN format, visit:
- *   http://www.csse.monash.edu.au/~timf/
- *
- * CIN is a somewhat quirky and ill-defined format. Here are some notes
- * for anyone trying to understand the technical details of this format:
- *
- * The format has no definite file signature. This is problematic for a
- * general-purpose media player that wants to automatically detect file
- * types. However, a CIN file does start with 5 32-bit numbers that
- * specify audio and video parameters. This demuxer gets around the lack
- * of file signature by performing sanity checks on those parameters.
- * Probabalistically, this is a reasonable solution since the number of
- * valid combinations of the 5 parameters is a very small subset of the
- * total 160-bit number space.
- *
- * Refer to the function idcin_probe() for the precise A/V parameters
- * that this demuxer allows.
- *
- * Next, each audio and video frame has a duration of 1/14 sec. If the
- * audio sample rate is a multiple of the common frequency 22050 Hz it will
- * divide evenly by 14. However, if the sample rate is 11025 Hz:
- *   11025 (samples/sec) / 14 (frames/sec) = 787.5 (samples/frame)
- * The way the CIN stores audio in this case is by storing 787 sample
- * frames in the first audio frame and 788 sample frames in the second
- * audio frame. Therefore, the total number of bytes in an audio frame
- * is given as:
- *   audio frame #0: 787 * (bytes/sample) * (# channels) bytes in frame
- *   audio frame #1: 788 * (bytes/sample) * (# channels) bytes in frame
- *   audio frame #2: 787 * (bytes/sample) * (# channels) bytes in frame
- *   audio frame #3: 788 * (bytes/sample) * (# channels) bytes in frame
- *
- * Finally, not all id CIN creation tools agree on the resolution of the
- * color palette, apparently. Some creation tools specify red, green, and
- * blue palette components in terms of 6-bit VGA color DAC values which
- * range from 0..63. Other tools specify the RGB components as full 8-bit
- * values that range from 0..255. Since there are no markers in the file to
- * differentiate between the two variants, this demuxer uses the following
- * heuristic:
- *   - load the 768 palette bytes from disk
- *   - assume that they will need to be shifted left by 2 bits to
- *     transform them from 6-bit values to 8-bit values
- *   - scan through all 768 palette bytes
- *     - if any bytes exceed 63, do not shift the bytes at all before
- *       transmitting them to the video decoder
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/imgutils.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define HUFFMAN_TABLE_SIZE (64 * 1024)
-#define IDCIN_FPS 14
-
-typedef struct IdcinDemuxContext {
-    int video_stream_index;
-    int audio_stream_index;
-    int audio_chunk_size1;
-    int audio_chunk_size2;
-    int block_align;
-
-    /* demux state variables */
-    int current_audio_chunk;
-    int next_chunk_is_video;
-    int audio_present;
-    int64_t first_pkt_pos;
-} IdcinDemuxContext;
-
-static int idcin_probe(AVProbeData *p)
-{
-    unsigned int number;
-
-    /*
-     * This is what you could call a "probabilistic" file check: id CIN
-     * files don't have a definite file signature. In lieu of such a marker,
-     * perform sanity checks on the 5 32-bit header fields:
-     *  width, height: greater than 0, less than or equal to 1024
-     * audio sample rate: greater than or equal to 8000, less than or
-     *  equal to 48000, or 0 for no audio
-     * audio sample width (bytes/sample): 0 for no audio, or 1 or 2
-     * audio channels: 0 for no audio, or 1 or 2
-     */
-
-    /* check we have enough data to do all checks, otherwise the
-       0-padding may cause a wrong recognition */
-    if (p->buf_size < 20)
-        return 0;
-
-    /* check the video width */
-    number = AV_RL32(&p->buf[0]);
-    if ((number == 0) || (number > 1024))
-       return 0;
-
-    /* check the video height */
-    number = AV_RL32(&p->buf[4]);
-    if ((number == 0) || (number > 1024))
-       return 0;
-
-    /* check the audio sample rate */
-    number = AV_RL32(&p->buf[8]);
-    if ((number != 0) && ((number < 8000) | (number > 48000)))
-        return 0;
-
-    /* check the audio bytes/sample */
-    number = AV_RL32(&p->buf[12]);
-    if (number > 2)
-        return 0;
-
-    /* check the audio channels */
-    number = AV_RL32(&p->buf[16]);
-    if (number > 2)
-        return 0;
-
-    /* return half certainty since this check is a bit sketchy */
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-static int idcin_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    IdcinDemuxContext *idcin = s->priv_data;
-    AVStream *st;
-    unsigned int width, height;
-    unsigned int sample_rate, bytes_per_sample, channels;
-    int ret;
-
-    /* get the 5 header parameters */
-    width = avio_rl32(pb);
-    height = avio_rl32(pb);
-    sample_rate = avio_rl32(pb);
-    bytes_per_sample = avio_rl32(pb);
-    channels = avio_rl32(pb);
-
-    if (s->pb->eof_reached) {
-        av_log(s, AV_LOG_ERROR, "incomplete header\n");
-        return s->pb->error ? s->pb->error : AVERROR_EOF;
-    }
-
-    if (av_image_check_size(width, height, 0, s) < 0)
-        return AVERROR_INVALIDDATA;
-    if (sample_rate > 0) {
-        if (sample_rate < 14 || sample_rate > INT_MAX) {
-            av_log(s, AV_LOG_ERROR, "invalid sample rate: %u\n", sample_rate);
-            return AVERROR_INVALIDDATA;
-        }
-        if (bytes_per_sample < 1 || bytes_per_sample > 2) {
-            av_log(s, AV_LOG_ERROR, "invalid bytes per sample: %u\n",
-                   bytes_per_sample);
-            return AVERROR_INVALIDDATA;
-        }
-        if (channels < 1 || channels > 2) {
-            av_log(s, AV_LOG_ERROR, "invalid channels: %u\n", channels);
-            return AVERROR_INVALIDDATA;
-        }
-        idcin->audio_present = 1;
-    } else {
-        /* if sample rate is 0, assume no audio */
-        idcin->audio_present = 0;
-    }
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    avpriv_set_pts_info(st, 33, 1, IDCIN_FPS);
-    st->start_time = 0;
-    idcin->video_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_IDCIN;
-    st->codec->codec_tag = 0;  /* no fourcc */
-    st->codec->width = width;
-    st->codec->height = height;
-
-    /* load up the Huffman tables into extradata */
-    st->codec->extradata_size = HUFFMAN_TABLE_SIZE;
-    st->codec->extradata = av_malloc(HUFFMAN_TABLE_SIZE);
-    ret = avio_read(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE);
-    if (ret < 0) {
-        return ret;
-    } else if (ret != HUFFMAN_TABLE_SIZE) {
-        av_log(s, AV_LOG_ERROR, "incomplete header\n");
-        return AVERROR(EIO);
-    }
-
-    if (idcin->audio_present) {
-        idcin->audio_present = 1;
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        avpriv_set_pts_info(st, 63, 1, sample_rate);
-        st->start_time = 0;
-        idcin->audio_stream_index = st->index;
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_tag = 1;
-        st->codec->channels = channels;
-        st->codec->channel_layout = channels > 1 ? AV_CH_LAYOUT_STEREO :
-                                                   AV_CH_LAYOUT_MONO;
-        st->codec->sample_rate = sample_rate;
-        st->codec->bits_per_coded_sample = bytes_per_sample * 8;
-        st->codec->bit_rate = sample_rate * bytes_per_sample * 8 * channels;
-        st->codec->block_align = idcin->block_align = bytes_per_sample * channels;
-        if (bytes_per_sample == 1)
-            st->codec->codec_id = AV_CODEC_ID_PCM_U8;
-        else
-            st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
-
-        if (sample_rate % 14 != 0) {
-            idcin->audio_chunk_size1 = (sample_rate / 14) *
-            bytes_per_sample * channels;
-            idcin->audio_chunk_size2 = (sample_rate / 14 + 1) *
-                bytes_per_sample * channels;
-        } else {
-            idcin->audio_chunk_size1 = idcin->audio_chunk_size2 =
-                (sample_rate / 14) * bytes_per_sample * channels;
-        }
-        idcin->current_audio_chunk = 0;
-    }
-
-    idcin->next_chunk_is_video = 1;
-    idcin->first_pkt_pos = avio_tell(s->pb);
-
-    return 0;
-}
-
-static int idcin_read_packet(AVFormatContext *s,
-                             AVPacket *pkt)
-{
-    int ret;
-    unsigned int command;
-    unsigned int chunk_size;
-    IdcinDemuxContext *idcin = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int i;
-    int palette_scale;
-    unsigned char r, g, b;
-    unsigned char palette_buffer[768];
-    uint32_t palette[256];
-
-    if (s->pb->eof_reached)
-        return s->pb->error ? s->pb->error : AVERROR_EOF;
-
-    if (idcin->next_chunk_is_video) {
-        command = avio_rl32(pb);
-        if (command == 2) {
-            return AVERROR(EIO);
-        } else if (command == 1) {
-            /* trigger a palette change */
-            ret = avio_read(pb, palette_buffer, 768);
-            if (ret < 0) {
-                return ret;
-            } else if (ret != 768) {
-                av_log(s, AV_LOG_ERROR, "incomplete packet\n");
-                return AVERROR(EIO);
-            }
-            /* scale the palette as necessary */
-            palette_scale = 2;
-            for (i = 0; i < 768; i++)
-                if (palette_buffer[i] > 63) {
-                    palette_scale = 0;
-                    break;
-                }
-
-            for (i = 0; i < 256; i++) {
-                r = palette_buffer[i * 3    ] << palette_scale;
-                g = palette_buffer[i * 3 + 1] << palette_scale;
-                b = palette_buffer[i * 3 + 2] << palette_scale;
-                palette[i] = (r << 16) | (g << 8) | (b);
-            }
-        }
-
-        if (s->pb->eof_reached) {
-            av_log(s, AV_LOG_ERROR, "incomplete packet\n");
-            return s->pb->error ? s->pb->error : AVERROR_EOF;
-        }
-        chunk_size = avio_rl32(pb);
-        if (chunk_size < 4 || chunk_size > INT_MAX - 4) {
-            av_log(s, AV_LOG_ERROR, "invalid chunk size: %u\n", chunk_size);
-            return AVERROR_INVALIDDATA;
-        }
-        /* skip the number of decoded bytes (always equal to width * height) */
-        avio_skip(pb, 4);
-        chunk_size -= 4;
-        ret= av_get_packet(pb, pkt, chunk_size);
-        if (ret < 0)
-            return ret;
-        else if (ret != chunk_size) {
-            av_log(s, AV_LOG_ERROR, "incomplete packet\n");
-            av_free_packet(pkt);
-            return AVERROR(EIO);
-        }
-        if (command == 1) {
-            uint8_t *pal;
-
-            pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
-                                          AVPALETTE_SIZE);
-            if (ret < 0) {
-                av_free_packet(pkt);
-                return ret;
-            }
-            memcpy(pal, palette, AVPALETTE_SIZE);
-            pkt->flags |= AV_PKT_FLAG_KEY;
-        }
-        pkt->stream_index = idcin->video_stream_index;
-        pkt->duration     = 1;
-    } else {
-        /* send out the audio chunk */
-        if (idcin->current_audio_chunk)
-            chunk_size = idcin->audio_chunk_size2;
-        else
-            chunk_size = idcin->audio_chunk_size1;
-        ret= av_get_packet(pb, pkt, chunk_size);
-        if (ret < 0)
-            return ret;
-        pkt->stream_index = idcin->audio_stream_index;
-        pkt->duration     = chunk_size / idcin->block_align;
-
-        idcin->current_audio_chunk ^= 1;
-    }
-
-    if (idcin->audio_present)
-        idcin->next_chunk_is_video ^= 1;
-
-    return 0;
-}
-
-static int idcin_read_seek(AVFormatContext *s, int stream_index,
-                           int64_t timestamp, int flags)
-{
-    IdcinDemuxContext *idcin = s->priv_data;
-
-    if (idcin->first_pkt_pos > 0) {
-        int ret = avio_seek(s->pb, idcin->first_pkt_pos, SEEK_SET);
-        if (ret < 0)
-            return ret;
-        ff_update_cur_dts(s, s->streams[idcin->video_stream_index], 0);
-        idcin->next_chunk_is_video = 1;
-        idcin->current_audio_chunk = 0;
-        return 0;
-    }
-    return -1;
-}
-
-AVInputFormat ff_idcin_demuxer = {
-    .name           = "idcin",
-    .long_name      = NULL_IF_CONFIG_SMALL("id Cinematic"),
-    .priv_data_size = sizeof(IdcinDemuxContext),
-    .read_probe     = idcin_probe,
-    .read_header    = idcin_read_header,
-    .read_packet    = idcin_read_packet,
-    .read_seek      = idcin_read_seek,
-    .flags          = AVFMT_NO_BYTE_SEEK,
-};
diff --git a/deps/libav/libavformat/idroqdec.c b/deps/libav/libavformat/idroqdec.c
deleted file mode 100644
index 82eff24..0000000
--- a/deps/libav/libavformat/idroqdec.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * id RoQ (.roq) File Demuxer
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * id RoQ format file demuxer
- * by Mike Melanson (melanson at pcisys.net)
- * for more information on the .roq file format, visit:
- *   http://www.csse.monash.edu.au/~timf/
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define RoQ_MAGIC_NUMBER 0x1084
-#define RoQ_CHUNK_PREAMBLE_SIZE 8
-#define RoQ_AUDIO_SAMPLE_RATE 22050
-#define RoQ_CHUNKS_TO_SCAN 30
-
-#define RoQ_INFO           0x1001
-#define RoQ_QUAD_CODEBOOK  0x1002
-#define RoQ_QUAD_VQ        0x1011
-#define RoQ_SOUND_MONO     0x1020
-#define RoQ_SOUND_STEREO   0x1021
-
-typedef struct RoqDemuxContext {
-
-    int frame_rate;
-    int width;
-    int height;
-    int audio_channels;
-
-    int video_stream_index;
-    int audio_stream_index;
-
-    int64_t video_pts;
-    unsigned int audio_frame_count;
-
-} RoqDemuxContext;
-
-static int roq_probe(AVProbeData *p)
-{
-    if ((AV_RL16(&p->buf[0]) != RoQ_MAGIC_NUMBER) ||
-        (AV_RL32(&p->buf[2]) != 0xFFFFFFFF))
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int roq_read_header(AVFormatContext *s)
-{
-    RoqDemuxContext *roq = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned char preamble[RoQ_CHUNK_PREAMBLE_SIZE];
-
-    /* get the main header */
-    if (avio_read(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
-        RoQ_CHUNK_PREAMBLE_SIZE)
-        return AVERROR(EIO);
-    roq->frame_rate = AV_RL16(&preamble[6]);
-
-    /* init private context parameters */
-    roq->width = roq->height = roq->audio_channels = roq->video_pts =
-    roq->audio_frame_count = 0;
-    roq->audio_stream_index = -1;
-    roq->video_stream_index = -1;
-
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    return 0;
-}
-
-static int roq_read_packet(AVFormatContext *s,
-                           AVPacket *pkt)
-{
-    RoqDemuxContext *roq = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret = 0;
-    unsigned int chunk_size;
-    unsigned int chunk_type;
-    unsigned int codebook_size;
-    unsigned char preamble[RoQ_CHUNK_PREAMBLE_SIZE];
-    int packet_read = 0;
-    int64_t codebook_offset;
-
-    while (!packet_read) {
-
-        if (s->pb->eof_reached)
-            return AVERROR(EIO);
-
-        /* get the next chunk preamble */
-        if ((ret = avio_read(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE)) !=
-            RoQ_CHUNK_PREAMBLE_SIZE)
-            return AVERROR(EIO);
-
-        chunk_type = AV_RL16(&preamble[0]);
-        chunk_size = AV_RL32(&preamble[2]);
-        if(chunk_size > INT_MAX)
-            return AVERROR_INVALIDDATA;
-
-        switch (chunk_type) {
-
-        case RoQ_INFO:
-            if (roq->video_stream_index == -1) {
-                AVStream *st = avformat_new_stream(s, NULL);
-                if (!st)
-                    return AVERROR(ENOMEM);
-                avpriv_set_pts_info(st, 63, 1, roq->frame_rate);
-                roq->video_stream_index = st->index;
-                st->codec->codec_type   = AVMEDIA_TYPE_VIDEO;
-                st->codec->codec_id     = AV_CODEC_ID_ROQ;
-                st->codec->codec_tag    = 0;  /* no fourcc */
-
-                if (avio_read(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != RoQ_CHUNK_PREAMBLE_SIZE)
-                    return AVERROR(EIO);
-                st->codec->width  = roq->width  = AV_RL16(preamble);
-                st->codec->height = roq->height = AV_RL16(preamble + 2);
-                break;
-            }
-            /* don't care about this chunk anymore */
-            avio_skip(pb, RoQ_CHUNK_PREAMBLE_SIZE);
-            break;
-
-        case RoQ_QUAD_CODEBOOK:
-            if (roq->video_stream_index < 0)
-                return AVERROR_INVALIDDATA;
-            /* packet needs to contain both this codebook and next VQ chunk */
-            codebook_offset = avio_tell(pb) - RoQ_CHUNK_PREAMBLE_SIZE;
-            codebook_size = chunk_size;
-            avio_skip(pb, codebook_size);
-            if (avio_read(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
-                RoQ_CHUNK_PREAMBLE_SIZE)
-                return AVERROR(EIO);
-            chunk_size = AV_RL32(&preamble[2]) + RoQ_CHUNK_PREAMBLE_SIZE * 2 +
-                codebook_size;
-
-            /* rewind */
-            avio_seek(pb, codebook_offset, SEEK_SET);
-
-            /* load up the packet */
-            ret= av_get_packet(pb, pkt, chunk_size);
-            if (ret != chunk_size)
-                return AVERROR(EIO);
-            pkt->stream_index = roq->video_stream_index;
-            pkt->pts = roq->video_pts++;
-
-            packet_read = 1;
-            break;
-
-        case RoQ_SOUND_MONO:
-        case RoQ_SOUND_STEREO:
-            if (roq->audio_stream_index == -1) {
-                AVStream *st = avformat_new_stream(s, NULL);
-                if (!st)
-                    return AVERROR(ENOMEM);
-                avpriv_set_pts_info(st, 32, 1, RoQ_AUDIO_SAMPLE_RATE);
-                roq->audio_stream_index = st->index;
-                st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-                st->codec->codec_id = AV_CODEC_ID_ROQ_DPCM;
-                st->codec->codec_tag = 0;  /* no tag */
-                if (chunk_type == RoQ_SOUND_STEREO) {
-                    st->codec->channels       = 2;
-                    st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-                } else {
-                    st->codec->channels       = 1;
-                    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-                }
-                roq->audio_channels    = st->codec->channels;
-                st->codec->sample_rate = RoQ_AUDIO_SAMPLE_RATE;
-                st->codec->bits_per_coded_sample = 16;
-                st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
-                    st->codec->bits_per_coded_sample;
-                st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;
-            }
-        case RoQ_QUAD_VQ:
-            if (chunk_type == RoQ_QUAD_VQ) {
-                if (roq->video_stream_index < 0)
-                    return AVERROR_INVALIDDATA;
-            }
-
-            /* load up the packet */
-            if (av_new_packet(pkt, chunk_size + RoQ_CHUNK_PREAMBLE_SIZE))
-                return AVERROR(EIO);
-            /* copy over preamble */
-            memcpy(pkt->data, preamble, RoQ_CHUNK_PREAMBLE_SIZE);
-
-            if (chunk_type == RoQ_QUAD_VQ) {
-                pkt->stream_index = roq->video_stream_index;
-                pkt->pts = roq->video_pts++;
-            } else {
-                pkt->stream_index = roq->audio_stream_index;
-                pkt->pts = roq->audio_frame_count;
-                roq->audio_frame_count += (chunk_size / roq->audio_channels);
-            }
-
-            pkt->pos= avio_tell(pb);
-            ret = avio_read(pb, pkt->data + RoQ_CHUNK_PREAMBLE_SIZE,
-                chunk_size);
-            if (ret != chunk_size)
-                ret = AVERROR(EIO);
-
-            packet_read = 1;
-            break;
-
-        default:
-            av_log(s, AV_LOG_ERROR, "  unknown RoQ chunk (%04X)\n", chunk_type);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    return ret;
-}
-
-AVInputFormat ff_roq_demuxer = {
-    .name           = "roq",
-    .long_name      = NULL_IF_CONFIG_SMALL("id RoQ"),
-    .priv_data_size = sizeof(RoqDemuxContext),
-    .read_probe     = roq_probe,
-    .read_header    = roq_read_header,
-    .read_packet    = roq_read_packet,
-};
diff --git a/deps/libav/libavformat/idroqenc.c b/deps/libav/libavformat/idroqenc.c
deleted file mode 100644
index 2ce4d7d..0000000
--- a/deps/libav/libavformat/idroqenc.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * id RoQ (.roq) File muxer
- * Copyright (c) 2007 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawenc.h"
-
-
-static int roq_write_header(struct AVFormatContext *s)
-{
-    static const uint8_t header[] = {
-        0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00
-    };
-
-    avio_write(s->pb, header, 8);
-    avio_flush(s->pb);
-
-    return 0;
-}
-
-AVOutputFormat ff_roq_muxer = {
-    .name         = "roq",
-    .long_name    = NULL_IF_CONFIG_SMALL("raw id RoQ"),
-    .extensions   = "roq",
-    .audio_codec  = AV_CODEC_ID_ROQ_DPCM,
-    .video_codec  = AV_CODEC_ID_ROQ,
-    .write_header = roq_write_header,
-    .write_packet = ff_raw_write_packet,
-};
diff --git a/deps/libav/libavformat/iff.c b/deps/libav/libavformat/iff.c
deleted file mode 100644
index 79f5f16..0000000
--- a/deps/libav/libavformat/iff.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * IFF (.iff) file demuxer
- * Copyright (c) 2008 Jaikrishnan Menon <realityman at gmx.net>
- * Copyright (c) 2010 Peter Ross <pross at xvid.org>
- * Copyright (c) 2010 Sebastian Vater <cdgs.basty at googlemail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * IFF file demuxer
- * by Jaikrishnan Menon
- * for more information on the .iff file format, visit:
- * http://wiki.multimedia.cx/index.php?title=IFF
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define ID_8SVX       MKTAG('8','S','V','X')
-#define ID_VHDR       MKTAG('V','H','D','R')
-#define ID_ATAK       MKTAG('A','T','A','K')
-#define ID_RLSE       MKTAG('R','L','S','E')
-#define ID_CHAN       MKTAG('C','H','A','N')
-#define ID_PBM        MKTAG('P','B','M',' ')
-#define ID_ILBM       MKTAG('I','L','B','M')
-#define ID_BMHD       MKTAG('B','M','H','D')
-#define ID_CMAP       MKTAG('C','M','A','P')
-
-#define ID_FORM       MKTAG('F','O','R','M')
-#define ID_ANNO       MKTAG('A','N','N','O')
-#define ID_AUTH       MKTAG('A','U','T','H')
-#define ID_CHRS       MKTAG('C','H','R','S')
-#define ID_COPYRIGHT  MKTAG('(','c',')',' ')
-#define ID_CSET       MKTAG('C','S','E','T')
-#define ID_FVER       MKTAG('F','V','E','R')
-#define ID_NAME       MKTAG('N','A','M','E')
-#define ID_TEXT       MKTAG('T','E','X','T')
-#define ID_BODY       MKTAG('B','O','D','Y')
-#define ID_ANNO       MKTAG('A','N','N','O')
-
-#define LEFT    2
-#define RIGHT   4
-#define STEREO  6
-
-typedef enum {
-    COMP_NONE,
-    COMP_FIB,
-    COMP_EXP
-} svx8_compression_type;
-
-typedef enum {
-    BITMAP_RAW,
-    BITMAP_BYTERUN1
-} bitmap_compression_type;
-
-typedef struct {
-    uint64_t  body_pos;
-    uint32_t  body_size;
-    uint32_t  sent_bytes;
-} IffDemuxContext;
-
-
-/* Metadata string read */
-static int get_metadata(AVFormatContext *s,
-                        const char *const tag,
-                        const unsigned data_size)
-{
-    uint8_t *buf = ((data_size + 1) == 0) ? NULL : av_malloc(data_size + 1);
-
-    if (!buf)
-        return AVERROR(ENOMEM);
-
-    if (avio_read(s->pb, buf, data_size) < 0) {
-        av_free(buf);
-        return AVERROR(EIO);
-    }
-    buf[data_size] = 0;
-    av_dict_set(&s->metadata, tag, buf, AV_DICT_DONT_STRDUP_VAL);
-    return 0;
-}
-
-static int iff_probe(AVProbeData *p)
-{
-    const uint8_t *d = p->buf;
-
-    if ( AV_RL32(d)   == ID_FORM &&
-         (AV_RL32(d+8) == ID_8SVX || AV_RL32(d+8) == ID_PBM || AV_RL32(d+8) == ID_ILBM) )
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int iff_read_header(AVFormatContext *s)
-{
-    IffDemuxContext *iff = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    uint32_t chunk_id, data_size;
-    int compression = -1;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->channels = 1;
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    avio_skip(pb, 8);
-    // codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and interlaced (ILBM) content
-    st->codec->codec_tag = avio_rl32(pb);
-
-    while(!pb->eof_reached) {
-        uint64_t orig_pos;
-        int res;
-        const char *metadata_tag = NULL;
-        chunk_id = avio_rl32(pb);
-        data_size = avio_rb32(pb);
-        orig_pos = avio_tell(pb);
-
-        switch(chunk_id) {
-        case ID_VHDR:
-            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-
-            if (data_size < 14)
-                return AVERROR_INVALIDDATA;
-            avio_skip(pb, 12);
-            st->codec->sample_rate = avio_rb16(pb);
-            if (data_size >= 16) {
-                avio_skip(pb, 1);
-                compression        = avio_r8(pb);
-            }
-            break;
-
-        case ID_BODY:
-            iff->body_pos = avio_tell(pb);
-            iff->body_size = data_size;
-            break;
-
-        case ID_CHAN:
-            if (data_size < 4)
-                return AVERROR_INVALIDDATA;
-            if (avio_rb32(pb) < 6) {
-                st->codec->channels       = 1;
-                st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-            } else {
-                st->codec->channels       = 2;
-                st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-            }
-            break;
-
-        case ID_CMAP:
-            if (data_size < 3 || data_size > 768 || data_size % 3) {
-                 av_log(s, AV_LOG_ERROR, "Invalid CMAP chunk size %d\n",
-                        data_size);
-                 return AVERROR_INVALIDDATA;
-            }
-            st->codec->extradata_size = data_size;
-            st->codec->extradata      = av_malloc(data_size);
-            if (!st->codec->extradata)
-                return AVERROR(ENOMEM);
-            if (avio_read(pb, st->codec->extradata, data_size) < 0)
-                return AVERROR(EIO);
-            break;
-
-        case ID_BMHD:
-            st->codec->codec_type            = AVMEDIA_TYPE_VIDEO;
-            if (data_size <= 8)
-                return AVERROR_INVALIDDATA;
-            st->codec->width                 = avio_rb16(pb);
-            st->codec->height                = avio_rb16(pb);
-            avio_skip(pb, 4); // x, y offset
-            st->codec->bits_per_coded_sample = avio_r8(pb);
-            if (data_size >= 11) {
-                avio_skip(pb, 1); // masking
-                compression                  = avio_r8(pb);
-            }
-            if (data_size >= 16) {
-                avio_skip(pb, 3); // paddding, transparent
-                st->sample_aspect_ratio.num  = avio_r8(pb);
-                st->sample_aspect_ratio.den  = avio_r8(pb);
-            }
-            break;
-
-        case ID_ANNO:
-        case ID_TEXT:
-            metadata_tag = "comment";
-            break;
-
-        case ID_AUTH:
-            metadata_tag = "artist";
-            break;
-
-        case ID_COPYRIGHT:
-            metadata_tag = "copyright";
-            break;
-
-        case ID_NAME:
-            metadata_tag = "title";
-            break;
-        }
-
-        if (metadata_tag) {
-            if ((res = get_metadata(s, metadata_tag, data_size)) < 0) {
-                av_log(s, AV_LOG_ERROR, "cannot allocate metadata tag %s!", metadata_tag);
-                return res;
-            }
-        }
-        avio_skip(pb, data_size - (avio_tell(pb) - orig_pos) + (data_size & 1));
-    }
-
-    avio_seek(pb, iff->body_pos, SEEK_SET);
-
-    switch(st->codec->codec_type) {
-    case AVMEDIA_TYPE_AUDIO:
-        avpriv_set_pts_info(st, 32, 1, st->codec->sample_rate);
-
-        switch(compression) {
-        case COMP_NONE:
-            st->codec->codec_id = AV_CODEC_ID_PCM_S8_PLANAR;
-            break;
-        case COMP_FIB:
-            st->codec->codec_id = AV_CODEC_ID_8SVX_FIB;
-            break;
-        case COMP_EXP:
-            st->codec->codec_id = AV_CODEC_ID_8SVX_EXP;
-            break;
-        default:
-            av_log(s, AV_LOG_ERROR, "unknown compression method\n");
-            return -1;
-        }
-
-        st->codec->bits_per_coded_sample = 8;
-        st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bits_per_coded_sample;
-        st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;
-        break;
-
-    case AVMEDIA_TYPE_VIDEO:
-        switch (compression) {
-        case BITMAP_RAW:
-            st->codec->codec_id = AV_CODEC_ID_IFF_ILBM;
-            break;
-        case BITMAP_BYTERUN1:
-            st->codec->codec_id = AV_CODEC_ID_IFF_BYTERUN1;
-            break;
-        default:
-            av_log(s, AV_LOG_ERROR, "unknown compression method\n");
-            return AVERROR_INVALIDDATA;
-        }
-        break;
-    default:
-        return -1;
-    }
-
-    return 0;
-}
-
-static int iff_read_packet(AVFormatContext *s,
-                           AVPacket *pkt)
-{
-    IffDemuxContext *iff = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret;
-
-    if(iff->sent_bytes >= iff->body_size)
-        return AVERROR_EOF;
-
-    ret = av_get_packet(pb, pkt, iff->body_size);
-    if (ret < 0)
-        return ret;
-
-    if(iff->sent_bytes == 0)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    iff->sent_bytes = iff->body_size;
-
-    pkt->stream_index = 0;
-    return ret;
-}
-
-AVInputFormat ff_iff_demuxer = {
-    .name           = "iff",
-    .long_name      = NULL_IF_CONFIG_SMALL("IFF (Interchange File Format)"),
-    .priv_data_size = sizeof(IffDemuxContext),
-    .read_probe     = iff_probe,
-    .read_header    = iff_read_header,
-    .read_packet    = iff_read_packet,
-};
diff --git a/deps/libav/libavformat/ilbc.c b/deps/libav/libavformat/ilbc.c
deleted file mode 100644
index e44af48..0000000
--- a/deps/libav/libavformat/ilbc.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * iLBC storage file format
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-
-static const char mode20_header[] = "#!iLBC20\n";
-static const char mode30_header[] = "#!iLBC30\n";
-
-static int ilbc_write_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVCodecContext *enc;
-
-    if (s->nb_streams != 1) {
-        av_log(s, AV_LOG_ERROR, "Unsupported number of streams\n");
-        return AVERROR(EINVAL);
-    }
-    enc = s->streams[0]->codec;
-
-    if (enc->codec_id != AV_CODEC_ID_ILBC) {
-        av_log(s, AV_LOG_ERROR, "Unsupported codec\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (enc->block_align == 50) {
-        avio_write(pb, mode30_header, sizeof(mode30_header) - 1);
-    } else if (enc->block_align == 38) {
-        avio_write(pb, mode20_header, sizeof(mode20_header) - 1);
-    } else {
-        av_log(s, AV_LOG_ERROR, "Unsupported mode\n");
-        return AVERROR(EINVAL);
-    }
-    avio_flush(pb);
-    return 0;
-}
-
-static int ilbc_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    avio_write(s->pb, pkt->data, pkt->size);
-    return 0;
-}
-
-static int ilbc_probe(AVProbeData *p)
-{
-    // Only check for "#!iLBC" which matches both formats
-    if (!memcmp(p->buf, mode20_header, 6))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int ilbc_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    uint8_t header[9];
-
-    avio_read(pb, header, 9);
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_id = AV_CODEC_ID_ILBC;
-    st->codec->sample_rate = 8000;
-    st->codec->channels = 1;
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->start_time = 0;
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    if (!memcmp(header, mode20_header, sizeof(mode20_header) - 1)) {
-        st->codec->block_align = 38;
-        st->codec->bit_rate = 15200;
-    } else if (!memcmp(header, mode30_header, sizeof(mode30_header) - 1)) {
-        st->codec->block_align = 50;
-        st->codec->bit_rate = 13333;
-    } else {
-        av_log(s, AV_LOG_ERROR, "Unrecognized iLBC file header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    return 0;
-}
-
-static int ilbc_read_packet(AVFormatContext *s,
-                          AVPacket *pkt)
-{
-    AVCodecContext *enc = s->streams[0]->codec;
-    int ret;
-
-    if ((ret = av_new_packet(pkt, enc->block_align)) < 0)
-        return ret;
-
-    pkt->stream_index = 0;
-    pkt->pos = avio_tell(s->pb);
-    pkt->duration = enc->block_align == 38 ? 160 : 240;
-    if ((ret = avio_read(s->pb, pkt->data, enc->block_align)) != enc->block_align) {
-        av_free_packet(pkt);
-        return ret < 0 ? ret : AVERROR(EIO);
-    }
-
-    return 0;
-}
-
-AVInputFormat ff_ilbc_demuxer = {
-    .name         = "ilbc",
-    .long_name    = NULL_IF_CONFIG_SMALL("iLBC storage"),
-    .read_probe   = ilbc_probe,
-    .read_header  = ilbc_read_header,
-    .read_packet  = ilbc_read_packet,
-    .flags        = AVFMT_GENERIC_INDEX,
-};
-
-AVOutputFormat ff_ilbc_muxer = {
-    .name         = "ilbc",
-    .long_name    = NULL_IF_CONFIG_SMALL("iLBC storage"),
-    .mime_type    = "audio/iLBC",
-    .extensions   = "lbc",
-    .audio_codec  = AV_CODEC_ID_ILBC,
-    .write_header = ilbc_write_header,
-    .write_packet = ilbc_write_packet,
-    .flags        = AVFMT_NOTIMESTAMPS,
-};
diff --git a/deps/libav/libavformat/img2.c b/deps/libav/libavformat/img2.c
deleted file mode 100644
index 493df6d..0000000
--- a/deps/libav/libavformat/img2.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Image format
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "internal.h"
-
-typedef struct {
-    enum AVCodecID id;
-    const char *str;
-} IdStrMap;
-
-static const IdStrMap img_tags[] = {
-    { AV_CODEC_ID_MJPEG,      "jpeg"     },
-    { AV_CODEC_ID_MJPEG,      "jpg"      },
-    { AV_CODEC_ID_MJPEG,      "jps"      },
-    { AV_CODEC_ID_MJPEG,      "mpo"      },
-    { AV_CODEC_ID_LJPEG,      "ljpg"     },
-    { AV_CODEC_ID_PNG,        "png"      },
-    { AV_CODEC_ID_PNG,        "pns"      },
-    { AV_CODEC_ID_PNG,        "mng"      },
-    { AV_CODEC_ID_PPM,        "ppm"      },
-    { AV_CODEC_ID_PPM,        "pnm"      },
-    { AV_CODEC_ID_PGM,        "pgm"      },
-    { AV_CODEC_ID_PGMYUV,     "pgmyuv"   },
-    { AV_CODEC_ID_PBM,        "pbm"      },
-    { AV_CODEC_ID_PAM,        "pam"      },
-    { AV_CODEC_ID_MPEG1VIDEO, "mpg1-img" },
-    { AV_CODEC_ID_MPEG2VIDEO, "mpg2-img" },
-    { AV_CODEC_ID_MPEG4,      "mpg4-img" },
-    { AV_CODEC_ID_FFV1,       "ffv1-img" },
-    { AV_CODEC_ID_RAWVIDEO,   "y"        },
-    { AV_CODEC_ID_BMP,        "bmp"      },
-    { AV_CODEC_ID_GIF,        "gif"      },
-    { AV_CODEC_ID_TARGA,      "tga"      },
-    { AV_CODEC_ID_TIFF,       "tiff"     },
-    { AV_CODEC_ID_TIFF,       "tif"      },
-    { AV_CODEC_ID_SGI,        "sgi"      },
-    { AV_CODEC_ID_PTX,        "ptx"      },
-    { AV_CODEC_ID_PCX,        "pcx"      },
-    { AV_CODEC_ID_SUNRAST,    "sun"      },
-    { AV_CODEC_ID_SUNRAST,    "ras"      },
-    { AV_CODEC_ID_SUNRAST,    "rs"       },
-    { AV_CODEC_ID_SUNRAST,    "im1"      },
-    { AV_CODEC_ID_SUNRAST,    "im8"      },
-    { AV_CODEC_ID_SUNRAST,    "im24"     },
-    { AV_CODEC_ID_SUNRAST,    "sunras"   },
-    { AV_CODEC_ID_JPEG2000,   "jp2"      },
-    { AV_CODEC_ID_JPEG2000,   "jpc"      },
-    { AV_CODEC_ID_JPEG2000,   "j2k"      },
-    { AV_CODEC_ID_DPX,        "dpx"      },
-    { AV_CODEC_ID_PICTOR,     "pic"      },
-    { AV_CODEC_ID_WEBP,       "webp"     },
-    { AV_CODEC_ID_XBM,        "xbm"      },
-    { AV_CODEC_ID_XWD,        "xwd"      },
-    { AV_CODEC_ID_NONE,       NULL       }
-};
-
-static enum AVCodecID av_str2id(const IdStrMap *tags, const char *str)
-{
-    str = strrchr(str, '.');
-    if (!str)
-        return AV_CODEC_ID_NONE;
-    str++;
-
-    while (tags->id) {
-        if (!av_strcasecmp(str, tags->str))
-            return tags->id;
-
-        tags++;
-    }
-    return AV_CODEC_ID_NONE;
-}
-
-enum AVCodecID ff_guess_image2_codec(const char *filename)
-{
-    return av_str2id(img_tags, filename);
-}
diff --git a/deps/libav/libavformat/img2dec.c b/deps/libav/libavformat/img2dec.c
deleted file mode 100644
index 9acb6f6..0000000
--- a/deps/libav/libavformat/img2dec.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Image format
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/parseutils.h"
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct {
-    const AVClass *class;  /**< Class for private options. */
-    int img_first;
-    int img_last;
-    int img_number;
-    int img_count;
-    int is_pipe;
-    char path[1024];
-    char *pixel_format;     /**< Set by a private option. */
-    char *video_size;       /**< Set by a private option. */
-    char *framerate;        /**< Set by a private option. */
-    int loop;
-    int start_number;
-} VideoDemuxData;
-
-static const int sizes[][2] = {
-    { 640, 480 },
-    { 720, 480 },
-    { 720, 576 },
-    { 352, 288 },
-    { 352, 240 },
-    { 160, 128 },
-    { 512, 384 },
-    { 640, 352 },
-    { 640, 240 },
-};
-
-static int infer_size(int *width_ptr, int *height_ptr, int size)
-{
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(sizes); i++) {
-        if ((sizes[i][0] * sizes[i][1]) == size) {
-            *width_ptr  = sizes[i][0];
-            *height_ptr = sizes[i][1];
-            return 0;
-        }
-    }
-
-    return -1;
-}
-
-/* return -1 if no image found */
-static int find_image_range(int *pfirst_index, int *plast_index,
-                            const char *path, int max_start)
-{
-    char buf[1024];
-    int range, last_index, range1, first_index;
-
-    /* find the first image */
-    for (first_index = 0; first_index < max_start; first_index++) {
-        if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0) {
-            *pfirst_index =
-            *plast_index  = 1;
-            if (avio_check(buf, AVIO_FLAG_READ) > 0)
-                return 0;
-            return -1;
-        }
-        if (avio_check(buf, AVIO_FLAG_READ) > 0)
-            break;
-    }
-    if (first_index == 5)
-        goto fail;
-
-    /* find the last image */
-    last_index = first_index;
-    for (;;) {
-        range = 0;
-        for (;;) {
-            if (!range)
-                range1 = 1;
-            else
-                range1 = 2 * range;
-            if (av_get_frame_filename(buf, sizeof(buf), path,
-                                      last_index + range1) < 0)
-                goto fail;
-            if (avio_check(buf, AVIO_FLAG_READ) <= 0)
-                break;
-            range = range1;
-            /* just in case... */
-            if (range >= (1 << 30))
-                goto fail;
-        }
-        /* we are sure than image last_index + range exists */
-        if (!range)
-            break;
-        last_index += range;
-    }
-    *pfirst_index = first_index;
-    *plast_index  = last_index;
-    return 0;
-
-fail:
-    return -1;
-}
-
-static int img_read_probe(AVProbeData *p)
-{
-    if (p->filename && ff_guess_image2_codec(p->filename)) {
-        if (av_filename_number_test(p->filename))
-            return AVPROBE_SCORE_MAX;
-        else
-            return AVPROBE_SCORE_EXTENSION;
-    }
-    return 0;
-}
-
-static int img_read_header(AVFormatContext *s1)
-{
-    VideoDemuxData *s = s1->priv_data;
-    int first_index, last_index, ret = 0;
-    int width = 0, height = 0;
-    AVStream *st;
-    enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
-    AVRational framerate;
-
-    s1->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    st = avformat_new_stream(s1, NULL);
-    if (!st) {
-        return AVERROR(ENOMEM);
-    }
-
-    if (s->pixel_format &&
-        (pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
-        av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n",
-               s->pixel_format);
-        return AVERROR(EINVAL);
-    }
-    if (s->video_size &&
-        (ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
-        av_log(s, AV_LOG_ERROR,
-               "Could not parse video size: %s.\n", s->video_size);
-        return ret;
-    }
-    if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
-        av_log(s, AV_LOG_ERROR,
-               "Could not parse framerate: %s.\n", s->framerate);
-        return ret;
-    }
-
-    av_strlcpy(s->path, s1->filename, sizeof(s->path));
-    s->img_number = 0;
-    s->img_count  = 0;
-
-    /* find format */
-    if (s1->iformat->flags & AVFMT_NOFILE)
-        s->is_pipe = 0;
-    else {
-        s->is_pipe       = 1;
-        st->need_parsing = AVSTREAM_PARSE_FULL;
-    }
-
-    avpriv_set_pts_info(st, 60, framerate.den, framerate.num);
-
-    if (width && height) {
-        st->codec->width  = width;
-        st->codec->height = height;
-    }
-
-    if (!s->is_pipe) {
-        if (find_image_range(&first_index, &last_index, s->path,
-                             FFMAX(s->start_number, 5)) < 0)
-            return AVERROR(ENOENT);
-        s->img_first  = first_index;
-        s->img_last   = last_index;
-        s->img_number = first_index;
-        /* compute duration */
-        st->start_time = 0;
-        st->duration   = last_index - first_index + 1;
-    }
-
-    if (s1->video_codec_id) {
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id   = s1->video_codec_id;
-    } else if (s1->audio_codec_id) {
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id   = s1->audio_codec_id;
-    } else {
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id   = ff_guess_image2_codec(s->path);
-    }
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-        pix_fmt != AV_PIX_FMT_NONE)
-        st->codec->pix_fmt = pix_fmt;
-
-    return 0;
-}
-
-static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    VideoDemuxData *s = s1->priv_data;
-    char filename[1024];
-    int i;
-    int size[3]           = { 0 }, ret[3] = { 0 };
-    AVIOContext *f[3]     = { NULL };
-    AVCodecContext *codec = s1->streams[0]->codec;
-
-    if (!s->is_pipe) {
-        /* loop over input */
-        if (s->loop && s->img_number > s->img_last) {
-            s->img_number = s->img_first;
-        }
-        if (s->img_number > s->img_last)
-            return AVERROR_EOF;
-        if (av_get_frame_filename(filename, sizeof(filename),
-                                  s->path,
-                                  s->img_number) < 0 && s->img_number > 1)
-            return AVERROR(EIO);
-        for (i = 0; i < 3; i++) {
-            if (avio_open2(&f[i], filename, AVIO_FLAG_READ,
-                           &s1->interrupt_callback, NULL) < 0) {
-                if (i >= 1)
-                    break;
-                av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",
-                       filename);
-                return AVERROR(EIO);
-            }
-            size[i] = avio_size(f[i]);
-
-            if (codec->codec_id != AV_CODEC_ID_RAWVIDEO)
-                break;
-            filename[strlen(filename) - 1] = 'U' + i;
-        }
-
-        if (codec->codec_id == AV_CODEC_ID_RAWVIDEO && !codec->width)
-            infer_size(&codec->width, &codec->height, size[0]);
-    } else {
-        f[0] = s1->pb;
-        if (f[0]->eof_reached)
-            return AVERROR(EIO);
-        size[0] = 4096;
-    }
-
-    av_new_packet(pkt, size[0] + size[1] + size[2]);
-    pkt->stream_index = 0;
-    pkt->flags       |= AV_PKT_FLAG_KEY;
-
-    pkt->size = 0;
-    for (i = 0; i < 3; i++) {
-        if (f[i]) {
-            ret[i] = avio_read(f[i], pkt->data + pkt->size, size[i]);
-            if (!s->is_pipe)
-                avio_close(f[i]);
-            if (ret[i] > 0)
-                pkt->size += ret[i];
-        }
-    }
-
-    if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) {
-        av_free_packet(pkt);
-        return AVERROR(EIO); /* signal EOF */
-    } else {
-        s->img_count++;
-        s->img_number++;
-        return 0;
-    }
-}
-
-#define OFFSET(x) offsetof(VideoDemuxData, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "pixel_format", "",                             OFFSET(pixel_format), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0,       DEC },
-    { "video_size",   "",                             OFFSET(video_size),   AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0,       DEC },
-    { "framerate",    "",                             OFFSET(framerate),    AV_OPT_TYPE_STRING, { .str = "25" }, 0, 0,       DEC },
-    { "loop",         "",                             OFFSET(loop),         AV_OPT_TYPE_INT,    { .i64 = 0    }, 0, 1,       DEC },
-    { "start_number", "first number in the sequence", OFFSET(start_number), AV_OPT_TYPE_INT,    { .i64 = 1    }, 1, INT_MAX, DEC },
-    { NULL },
-};
-
-#if CONFIG_IMAGE2_DEMUXER
-static const AVClass img2_class = {
-    .class_name = "image2 demuxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-AVInputFormat ff_image2_demuxer = {
-    .name           = "image2",
-    .long_name      = NULL_IF_CONFIG_SMALL("image2 sequence"),
-    .priv_data_size = sizeof(VideoDemuxData),
-    .read_probe     = img_read_probe,
-    .read_header    = img_read_header,
-    .read_packet    = img_read_packet,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &img2_class,
-};
-#endif
-#if CONFIG_IMAGE2PIPE_DEMUXER
-static const AVClass img2pipe_class = {
-    .class_name = "image2pipe demuxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-AVInputFormat ff_image2pipe_demuxer = {
-    .name           = "image2pipe",
-    .long_name      = NULL_IF_CONFIG_SMALL("piped image2 sequence"),
-    .priv_data_size = sizeof(VideoDemuxData),
-    .read_header    = img_read_header,
-    .read_packet    = img_read_packet,
-    .priv_class     = &img2pipe_class,
-};
-#endif
diff --git a/deps/libav/libavformat/img2enc.c b/deps/libav/libavformat/img2enc.c
deleted file mode 100644
index 4cc5c3f..0000000
--- a/deps/libav/libavformat/img2enc.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Image format
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2004 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/avstring.h"
-#include "libavutil/log.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "libavutil/opt.h"
-
-typedef struct {
-    const AVClass *class;  /**< Class for private options. */
-    int img_number;
-    int is_pipe;
-    char path[1024];
-    int update;
-} VideoMuxData;
-
-static int write_header(AVFormatContext *s)
-{
-    VideoMuxData *img = s->priv_data;
-
-    av_strlcpy(img->path, s->filename, sizeof(img->path));
-
-    /* find format */
-    if (s->oformat->flags & AVFMT_NOFILE)
-        img->is_pipe = 0;
-    else
-        img->is_pipe = 1;
-
-    return 0;
-}
-
-static int write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    VideoMuxData *img = s->priv_data;
-    AVIOContext *pb[3];
-    char filename[1024];
-    AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
-    int i;
-
-    if (!img->is_pipe) {
-        if (img->update) {
-            av_strlcpy(filename, img->path, sizeof(filename));
-        } else if (av_get_frame_filename(filename, sizeof(filename), img->path, img->img_number) < 0 &&
-                   img->img_number > 1) {
-            av_log(s, AV_LOG_ERROR,
-                   "Could not get frame filename number %d from pattern '%s'\n",
-                   img->img_number, img->path);
-            return AVERROR(EIO);
-        }
-        for (i = 0; i < 3; i++) {
-            if (avio_open2(&pb[i], filename, AVIO_FLAG_WRITE,
-                           &s->interrupt_callback, NULL) < 0) {
-                av_log(s, AV_LOG_ERROR, "Could not open file : %s\n", filename);
-                return AVERROR(EIO);
-            }
-
-            if (codec->codec_id != AV_CODEC_ID_RAWVIDEO)
-                break;
-            filename[strlen(filename) - 1] = 'U' + i;
-        }
-    } else {
-        pb[0] = s->pb;
-    }
-
-    if (codec->codec_id == AV_CODEC_ID_RAWVIDEO) {
-        int ysize = codec->width * codec->height;
-        avio_write(pb[0], pkt->data, ysize);
-        avio_write(pb[1], pkt->data + ysize,                           (pkt->size - ysize) / 2);
-        avio_write(pb[2], pkt->data + ysize + (pkt->size - ysize) / 2, (pkt->size - ysize) / 2);
-        avio_close(pb[1]);
-        avio_close(pb[2]);
-    } else {
-        if (ff_guess_image2_codec(s->filename) == AV_CODEC_ID_JPEG2000) {
-            AVStream *st = s->streams[0];
-            if (st->codec->extradata_size > 8 &&
-                AV_RL32(st->codec->extradata + 4) == MKTAG('j', 'p', '2', 'h')) {
-                if (pkt->size < 8 ||
-                    AV_RL32(pkt->data + 4) != MKTAG('j', 'p', '2', 'c'))
-                    goto error;
-                avio_wb32(pb[0], 12);
-                ffio_wfourcc(pb[0], "jP  ");
-                avio_wb32(pb[0], 0x0D0A870A); // signature
-                avio_wb32(pb[0], 20);
-                ffio_wfourcc(pb[0], "ftyp");
-                ffio_wfourcc(pb[0], "jp2 ");
-                avio_wb32(pb[0], 0);
-                ffio_wfourcc(pb[0], "jp2 ");
-                avio_write(pb[0], st->codec->extradata, st->codec->extradata_size);
-            } else if (pkt->size < 8 ||
-                       (!st->codec->extradata_size &&
-                        AV_RL32(pkt->data + 4) != MKTAG('j', 'P', ' ', ' '))) { // signature
-error:
-                av_log(s, AV_LOG_ERROR, "malformed JPEG 2000 codestream\n");
-                return -1;
-            }
-        }
-        avio_write(pb[0], pkt->data, pkt->size);
-    }
-    avio_flush(pb[0]);
-    if (!img->is_pipe) {
-        avio_close(pb[0]);
-    }
-
-    img->img_number++;
-    return 0;
-}
-
-#define OFFSET(x) offsetof(VideoMuxData, x)
-#define ENC AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption muxoptions[] = {
-    { "start_number", "first number in the sequence", OFFSET(img_number), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, ENC },
-    { "update",       "continuously overwrite one file", OFFSET(update),  AV_OPT_TYPE_INT, { .i64 = 0 }, 0,       1, ENC },
-    { NULL },
-};
-
-#if CONFIG_IMAGE2_MUXER
-static const AVClass img2mux_class = {
-    .class_name = "image2 muxer",
-    .item_name  = av_default_item_name,
-    .option     = muxoptions,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVOutputFormat ff_image2_muxer = {
-    .name           = "image2",
-    .long_name      = NULL_IF_CONFIG_SMALL("image2 sequence"),
-    .extensions     = "bmp,dpx,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,"
-                      "ppm,sgi,tga,tif,tiff,jp2,xwd,sun,ras,rs,im1,im8,im24,"
-                      "sunras,webp,xbm",
-    .priv_data_size = sizeof(VideoMuxData),
-    .video_codec    = AV_CODEC_ID_MJPEG,
-    .write_header   = write_header,
-    .write_packet   = write_packet,
-    .flags          = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE,
-    .priv_class     = &img2mux_class,
-};
-#endif
-#if CONFIG_IMAGE2PIPE_MUXER
-AVOutputFormat ff_image2pipe_muxer = {
-    .name           = "image2pipe",
-    .long_name      = NULL_IF_CONFIG_SMALL("piped image2 sequence"),
-    .priv_data_size = sizeof(VideoMuxData),
-    .video_codec    = AV_CODEC_ID_MJPEG,
-    .write_header   = write_header,
-    .write_packet   = write_packet,
-    .flags          = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS
-};
-#endif
diff --git a/deps/libav/libavformat/ingenientdec.c b/deps/libav/libavformat/ingenientdec.c
deleted file mode 100644
index 42b29ef..0000000
--- a/deps/libav/libavformat/ingenientdec.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * RAW Ingenient MJPEG demuxer
- * Copyright (c) 2005 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawdec.h"
-
-// http://www.artificis.hu/files/texts/ingenient.txt
-static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, size, w, h, unk1, unk2;
-
-    if (avio_rl32(s->pb) != MKTAG('M', 'J', 'P', 'G'))
-        return AVERROR(EIO); // FIXME
-
-    size = avio_rl32(s->pb);
-
-    w = avio_rl16(s->pb);
-    h = avio_rl16(s->pb);
-
-    avio_skip(s->pb, 8); // zero + size (padded?)
-    avio_skip(s->pb, 2);
-    unk1 = avio_rl16(s->pb);
-    unk2 = avio_rl16(s->pb);
-    avio_skip(s->pb, 22); // ASCII timestamp
-
-    av_log(s, AV_LOG_DEBUG, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n",
-        size, w, h, unk1, unk2);
-
-    if (av_new_packet(pkt, size) < 0)
-        return AVERROR(ENOMEM);
-
-    pkt->pos = avio_tell(s->pb);
-    pkt->stream_index = 0;
-    ret = avio_read(s->pb, pkt->data, size);
-    if (ret < 0) {
-        av_free_packet(pkt);
-        return ret;
-    }
-    pkt->size = ret;
-    return ret;
-}
-
-FF_RAWVIDEO_DEMUXER_CLASS(ingenient)
-
-AVInputFormat ff_ingenient_demuxer = {
-    .name           = "ingenient",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw Ingenient MJPEG"),
-    .priv_data_size = sizeof(FFRawVideoDemuxerContext),
-    .read_header    = ff_raw_video_read_header,
-    .read_packet    = ingenient_read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "cgi", // FIXME
-    .raw_codec_id   = AV_CODEC_ID_MJPEG,
-    .priv_class     = &ingenient_demuxer_class,
-};
diff --git a/deps/libav/libavformat/internal.h b/deps/libav/libavformat/internal.h
deleted file mode 100644
index 0e7eb36..0000000
--- a/deps/libav/libavformat/internal.h
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_INTERNAL_H
-#define AVFORMAT_INTERNAL_H
-
-#include <stdint.h>
-#include "avformat.h"
-
-#define MAX_URL_SIZE 4096
-
-#ifdef DEBUG
-#    define hex_dump_debug(class, buf, size) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size)
-#else
-#    define hex_dump_debug(class, buf, size)
-#endif
-
-typedef struct AVCodecTag {
-    enum AVCodecID id;
-    unsigned int tag;
-} AVCodecTag;
-
-typedef struct CodecMime{
-    char str[32];
-    enum AVCodecID id;
-} CodecMime;
-
-struct AVFormatInternal {
-    /**
-     * Number of streams relevant for interleaving.
-     * Muxing only.
-     */
-    int nb_interleaved_streams;
-};
-
-void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem);
-
-#ifdef __GNUC__
-#define dynarray_add(tab, nb_ptr, elem)\
-do {\
-    __typeof__(tab) _tab = (tab);\
-    __typeof__(elem) _elem = (elem);\
-    (void)sizeof(**_tab == _elem); /* check that types are compatible */\
-    ff_dynarray_add((intptr_t **)_tab, nb_ptr, (intptr_t)_elem);\
-} while(0)
-#else
-#define dynarray_add(tab, nb_ptr, elem)\
-do {\
-    ff_dynarray_add((intptr_t **)(tab), nb_ptr, (intptr_t)(elem));\
-} while(0)
-#endif
-
-struct tm *ff_brktimegm(time_t secs, struct tm *tm);
-
-char *ff_data_to_hex(char *buf, const uint8_t *src, int size, int lowercase);
-
-/**
- * Parse a string of hexadecimal strings. Any space between the hexadecimal
- * digits is ignored.
- *
- * @param data if non-null, the parsed data is written to this pointer
- * @param p the string to parse
- * @return the number of bytes written (or to be written, if data is null)
- */
-int ff_hex_to_data(uint8_t *data, const char *p);
-
-void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int idx);
-
-/**
- * Add packet to AVFormatContext->packet_buffer list, determining its
- * interleaved position using compare() function argument.
- */
-void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
-                              int (*compare)(AVFormatContext *, AVPacket *, AVPacket *));
-
-void ff_read_frame_flush(AVFormatContext *s);
-
-#define NTP_OFFSET 2208988800ULL
-#define NTP_OFFSET_US (NTP_OFFSET * 1000000ULL)
-
-/** Get the current time since NTP epoch in microseconds. */
-uint64_t ff_ntp_time(void);
-
-/**
- * Append the media-specific SDP fragment for the media stream c
- * to the buffer buff.
- *
- * Note, the buffer needs to be initialized, since it is appended to
- * existing content.
- *
- * @param buff the buffer to append the SDP fragment to
- * @param size the size of the buff buffer
- * @param st the AVStream of the media to describe
- * @param idx the global stream index
- * @param dest_addr the destination address of the media stream, may be NULL
- * @param dest_type the destination address type, may be NULL
- * @param port the destination port of the media stream, 0 if unknown
- * @param ttl the time to live of the stream, 0 if not multicast
- * @param fmt the AVFormatContext, which might contain options modifying
- *            the generated SDP
- */
-void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,
-                        const char *dest_addr, const char *dest_type,
-                        int port, int ttl, AVFormatContext *fmt);
-
-/**
- * Write a packet to another muxer than the one the user originally
- * intended. Useful when chaining muxers, where one muxer internally
- * writes a received packet to another muxer.
- *
- * @param dst the muxer to write the packet to
- * @param dst_stream the stream index within dst to write the packet to
- * @param pkt the packet to be written
- * @param src the muxer the packet originally was intended for
- * @return the value av_write_frame returned
- */
-int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
-                     AVFormatContext *src);
-
-/**
- * Get the length in bytes which is needed to store val as v.
- */
-int ff_get_v_length(uint64_t val);
-
-/**
- * Put val using a variable number of bytes.
- */
-void ff_put_v(AVIOContext *bc, uint64_t val);
-
-/**
- * Read a whole line of text from AVIOContext. Stop reading after reaching
- * either a \\n, a \\0 or EOF. The returned string is always \\0-terminated,
- * and may be truncated if the buffer is too small.
- *
- * @param s the read-only AVIOContext
- * @param buf buffer to store the read line
- * @param maxlen size of the buffer
- * @return the length of the string written in the buffer, not including the
- *         final \\0
- */
-int ff_get_line(AVIOContext *s, char *buf, int maxlen);
-
-#define SPACE_CHARS " \t\r\n"
-
-/**
- * Callback function type for ff_parse_key_value.
- *
- * @param key a pointer to the key
- * @param key_len the number of bytes that belong to the key, including the '='
- *                char
- * @param dest return the destination pointer for the value in *dest, may
- *             be null to ignore the value
- * @param dest_len the length of the *dest buffer
- */
-typedef void (*ff_parse_key_val_cb)(void *context, const char *key,
-                                    int key_len, char **dest, int *dest_len);
-/**
- * Parse a string with comma-separated key=value pairs. The value strings
- * may be quoted and may contain escaped characters within quoted strings.
- *
- * @param str the string to parse
- * @param callback_get_buf function that returns where to store the
- *                         unescaped value string.
- * @param context the opaque context pointer to pass to callback_get_buf
- */
-void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
-                        void *context);
-
-/**
- * Find stream index based on format-specific stream ID
- * @return stream index, or < 0 on error
- */
-int ff_find_stream_index(AVFormatContext *s, int id);
-
-/**
- * Internal version of av_index_search_timestamp
- */
-int ff_index_search_timestamp(const AVIndexEntry *entries, int nb_entries,
-                              int64_t wanted_timestamp, int flags);
-
-/**
- * Internal version of av_add_index_entry
- */
-int ff_add_index_entry(AVIndexEntry **index_entries,
-                       int *nb_index_entries,
-                       unsigned int *index_entries_allocated_size,
-                       int64_t pos, int64_t timestamp, int size, int distance, int flags);
-
-/**
- * Add a new chapter.
- *
- * @param s media file handle
- * @param id unique ID for this chapter
- * @param start chapter start time in time_base units
- * @param end chapter end time in time_base units
- * @param title chapter title
- *
- * @return AVChapter or NULL on error
- */
-AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base,
-                              int64_t start, int64_t end, const char *title);
-
-/**
- * Ensure the index uses less memory than the maximum specified in
- * AVFormatContext.max_index_size by discarding entries if it grows
- * too large.
- */
-void ff_reduce_index(AVFormatContext *s, int stream_index);
-
-enum AVCodecID ff_guess_image2_codec(const char *filename);
-
-/**
- * Convert a date string in ISO8601 format to Unix timestamp.
- */
-int64_t ff_iso8601_to_unix_time(const char *datestr);
-
-/**
- * Perform a binary search using av_index_search_timestamp() and
- * AVInputFormat.read_timestamp().
- *
- * @param target_ts target timestamp in the time base of the given stream
- * @param stream_index stream number
- */
-int ff_seek_frame_binary(AVFormatContext *s, int stream_index,
-                         int64_t target_ts, int flags);
-
-/**
- * Update cur_dts of all streams based on the given timestamp and AVStream.
- *
- * Stream ref_st unchanged, others set cur_dts in their native time base.
- * Only needed for timestamp wrapping or if (dts not set and pts!=dts).
- * @param timestamp new dts expressed in time_base of param ref_st
- * @param ref_st reference stream giving time_base of param timestamp
- */
-void ff_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
-
-/**
- * Perform a binary search using read_timestamp().
- *
- * @param target_ts target timestamp in the time base of the given stream
- * @param stream_index stream number
- */
-int64_t ff_gen_search(AVFormatContext *s, int stream_index,
-                      int64_t target_ts, int64_t pos_min,
-                      int64_t pos_max, int64_t pos_limit,
-                      int64_t ts_min, int64_t ts_max,
-                      int flags, int64_t *ts_ret,
-                      int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));
-
-/**
- * Set the time base and wrapping info for a given stream. This will be used
- * to interpret the stream's timestamps. If the new time base is invalid
- * (numerator or denominator are non-positive), it leaves the stream
- * unchanged.
- *
- * @param s stream
- * @param pts_wrap_bits number of bits effectively used by the pts
- *        (used for wrap control)
- * @param pts_num time base numerator
- * @param pts_den time base denominator
- */
-void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits,
-                         unsigned int pts_num, unsigned int pts_den);
-
-/**
- * Add side data to a packet for changing parameters to the given values.
- * Parameters set to 0 aren't included in the change.
- */
-int ff_add_param_change(AVPacket *pkt, int32_t channels,
-                        uint64_t channel_layout, int32_t sample_rate,
-                        int32_t width, int32_t height);
-
-/**
- * Set the timebase for each stream from the corresponding codec timebase and
- * print it.
- */
-int ff_framehash_write_header(AVFormatContext *s);
-
-/**
- * Read a transport packet from a media file.
- *
- * @param s media file handle
- * @param pkt is filled
- * @return 0 if OK, AVERROR_xxx on error
- */
-int ff_read_packet(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Interleave a packet per dts in an output media file.
- *
- * Packets with pkt->destruct == av_destruct_packet will be freed inside this
- * function, so they cannot be used after it. Note that calling av_free_packet()
- * on them is still safe.
- *
- * @param s media file handle
- * @param out the interleaved packet will be output here
- * @param pkt the input packet
- * @param flush 1 if no further packets are available as input and all
- *              remaining packets should be output
- * @return 1 if a packet was output, 0 if no packet could be output,
- *         < 0 if an error occurred
- */
-int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
-                                 AVPacket *pkt, int flush);
-
-/**
- * Return the frame duration in seconds. Return 0 if not available.
- */
-void ff_compute_frame_duration(int *pnum, int *pden, AVStream *st,
-                               AVCodecParserContext *pc, AVPacket *pkt);
-
-int ff_get_audio_frame_size(AVCodecContext *enc, int size, int mux);
-
-unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum AVCodecID id);
-
-enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag);
-
-/**
- * Select a PCM codec based on the given parameters.
- *
- * @param bps     bits-per-sample
- * @param flt     floating-point
- * @param be      big-endian
- * @param sflags  signed flags. each bit corresponds to one byte of bit depth.
- *                e.g. the 1st bit indicates if 8-bit should be signed or
- *                unsigned, the 2nd bit indicates if 16-bit should be signed or
- *                unsigned, etc... This is useful for formats such as WAVE where
- *                only 8-bit is unsigned and all other bit depths are signed.
- * @return        a PCM codec id or AV_CODEC_ID_NONE
- */
-enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags);
-
-/**
- * Generate standard extradata for AVC-Intra based on width/height and field
- * order.
- */
-int ff_generate_avci_extradata(AVStream *st);
-
-#endif /* AVFORMAT_INTERNAL_H */
diff --git a/deps/libav/libavformat/ipmovie.c b/deps/libav/libavformat/ipmovie.c
deleted file mode 100644
index 60ae939..0000000
--- a/deps/libav/libavformat/ipmovie.c
+++ /dev/null
@@ -1,647 +0,0 @@
-/*
- * Interplay MVE File Demuxer
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Interplay MVE file demuxer
- * by Mike Melanson (melanson at pcisys.net)
- * For more information regarding the Interplay MVE file format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- * The aforementioned site also contains a command line utility for parsing
- * IP MVE files so that you can get a good idea of the typical structure of
- * such files. This demuxer is not the best example to use if you are trying
- * to write your own as it uses a rather roundabout approach for splitting
- * up and sending out the chunks.
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define CHUNK_PREAMBLE_SIZE 4
-#define OPCODE_PREAMBLE_SIZE 4
-
-#define CHUNK_INIT_AUDIO   0x0000
-#define CHUNK_AUDIO_ONLY   0x0001
-#define CHUNK_INIT_VIDEO   0x0002
-#define CHUNK_VIDEO        0x0003
-#define CHUNK_SHUTDOWN     0x0004
-#define CHUNK_END          0x0005
-/* these last types are used internally */
-#define CHUNK_DONE         0xFFFC
-#define CHUNK_NOMEM        0xFFFD
-#define CHUNK_EOF          0xFFFE
-#define CHUNK_BAD          0xFFFF
-
-#define OPCODE_END_OF_STREAM           0x00
-#define OPCODE_END_OF_CHUNK            0x01
-#define OPCODE_CREATE_TIMER            0x02
-#define OPCODE_INIT_AUDIO_BUFFERS      0x03
-#define OPCODE_START_STOP_AUDIO        0x04
-#define OPCODE_INIT_VIDEO_BUFFERS      0x05
-#define OPCODE_UNKNOWN_06              0x06
-#define OPCODE_SEND_BUFFER             0x07
-#define OPCODE_AUDIO_FRAME             0x08
-#define OPCODE_SILENCE_FRAME           0x09
-#define OPCODE_INIT_VIDEO_MODE         0x0A
-#define OPCODE_CREATE_GRADIENT         0x0B
-#define OPCODE_SET_PALETTE             0x0C
-#define OPCODE_SET_PALETTE_COMPRESSED  0x0D
-#define OPCODE_UNKNOWN_0E              0x0E
-#define OPCODE_SET_DECODING_MAP        0x0F
-#define OPCODE_UNKNOWN_10              0x10
-#define OPCODE_VIDEO_DATA              0x11
-#define OPCODE_UNKNOWN_12              0x12
-#define OPCODE_UNKNOWN_13              0x13
-#define OPCODE_UNKNOWN_14              0x14
-#define OPCODE_UNKNOWN_15              0x15
-
-#define PALETTE_COUNT 256
-
-typedef struct IPMVEContext {
-
-    unsigned char *buf;
-    int buf_size;
-
-    uint64_t frame_pts_inc;
-
-    unsigned int video_bpp;
-    unsigned int video_width;
-    unsigned int video_height;
-    int64_t video_pts;
-    uint32_t     palette[256];
-    int          has_palette;
-    int          changed;
-
-    unsigned int audio_bits;
-    unsigned int audio_channels;
-    unsigned int audio_sample_rate;
-    enum AVCodecID audio_type;
-    unsigned int audio_frame_count;
-
-    int video_stream_index;
-    int audio_stream_index;
-
-    int64_t audio_chunk_offset;
-    int audio_chunk_size;
-    int64_t video_chunk_offset;
-    int video_chunk_size;
-    int64_t decode_map_chunk_offset;
-    int decode_map_chunk_size;
-
-    int64_t next_chunk_offset;
-
-} IPMVEContext;
-
-static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
-    AVPacket *pkt) {
-
-    int chunk_type;
-
-    if (s->audio_chunk_offset) {
-        if (s->audio_type == AV_CODEC_ID_NONE) {
-            av_log(NULL, AV_LOG_ERROR, "Can not read audio packet before"
-                   "audio codec is known\n");
-                return CHUNK_BAD;
-        }
-
-        /* adjust for PCM audio by skipping chunk header */
-        if (s->audio_type != AV_CODEC_ID_INTERPLAY_DPCM) {
-            s->audio_chunk_offset += 6;
-            s->audio_chunk_size -= 6;
-        }
-
-        avio_seek(pb, s->audio_chunk_offset, SEEK_SET);
-        s->audio_chunk_offset = 0;
-
-        if (s->audio_chunk_size != av_get_packet(pb, pkt, s->audio_chunk_size))
-            return CHUNK_EOF;
-
-        pkt->stream_index = s->audio_stream_index;
-        pkt->pts = s->audio_frame_count;
-
-        /* audio frame maintenance */
-        if (s->audio_type != AV_CODEC_ID_INTERPLAY_DPCM)
-            s->audio_frame_count +=
-            (s->audio_chunk_size / s->audio_channels / (s->audio_bits / 8));
-        else
-            s->audio_frame_count +=
-                (s->audio_chunk_size - 6 - s->audio_channels) / s->audio_channels;
-
-        av_dlog(NULL, "sending audio frame with pts %"PRId64" (%d audio frames)\n",
-                pkt->pts, s->audio_frame_count);
-
-        chunk_type = CHUNK_VIDEO;
-
-    } else if (s->decode_map_chunk_offset) {
-
-        /* send both the decode map and the video data together */
-
-        if (av_new_packet(pkt, s->decode_map_chunk_size + s->video_chunk_size))
-            return CHUNK_NOMEM;
-
-        if (s->has_palette) {
-            uint8_t *pal;
-
-            pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
-                                          AVPALETTE_SIZE);
-            if (pal) {
-                memcpy(pal, s->palette, AVPALETTE_SIZE);
-                s->has_palette = 0;
-            }
-        }
-
-        if (s->changed) {
-            ff_add_param_change(pkt, 0, 0, 0, s->video_width, s->video_height);
-            s->changed = 0;
-        }
-        pkt->pos= s->decode_map_chunk_offset;
-        avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
-        s->decode_map_chunk_offset = 0;
-
-        if (avio_read(pb, pkt->data, s->decode_map_chunk_size) !=
-            s->decode_map_chunk_size) {
-            av_free_packet(pkt);
-            return CHUNK_EOF;
-        }
-
-        avio_seek(pb, s->video_chunk_offset, SEEK_SET);
-        s->video_chunk_offset = 0;
-
-        if (avio_read(pb, pkt->data + s->decode_map_chunk_size,
-            s->video_chunk_size) != s->video_chunk_size) {
-            av_free_packet(pkt);
-            return CHUNK_EOF;
-        }
-
-        pkt->stream_index = s->video_stream_index;
-        pkt->pts = s->video_pts;
-
-        av_dlog(NULL, "sending video frame with pts %"PRId64"\n", pkt->pts);
-
-        s->video_pts += s->frame_pts_inc;
-
-        chunk_type = CHUNK_VIDEO;
-
-    } else {
-
-        avio_seek(pb, s->next_chunk_offset, SEEK_SET);
-        chunk_type = CHUNK_DONE;
-
-    }
-
-    return chunk_type;
-}
-
-/* This function loads and processes a single chunk in an IP movie file.
- * It returns the type of chunk that was processed. */
-static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
-    AVPacket *pkt)
-{
-    unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
-    int chunk_type;
-    int chunk_size;
-    unsigned char opcode_preamble[OPCODE_PREAMBLE_SIZE];
-    unsigned char opcode_type;
-    unsigned char opcode_version;
-    int opcode_size;
-    unsigned char scratch[1024];
-    int i, j;
-    int first_color, last_color;
-    int audio_flags;
-    unsigned char r, g, b;
-    unsigned int width, height;
-
-    /* see if there are any pending packets */
-    chunk_type = load_ipmovie_packet(s, pb, pkt);
-    if (chunk_type != CHUNK_DONE)
-        return chunk_type;
-
-    /* read the next chunk, wherever the file happens to be pointing */
-    if (pb->eof_reached)
-        return CHUNK_EOF;
-    if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
-        CHUNK_PREAMBLE_SIZE)
-        return CHUNK_BAD;
-    chunk_size = AV_RL16(&chunk_preamble[0]);
-    chunk_type = AV_RL16(&chunk_preamble[2]);
-
-    av_dlog(NULL, "chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
-
-    switch (chunk_type) {
-
-    case CHUNK_INIT_AUDIO:
-        av_dlog(NULL, "initialize audio\n");
-        break;
-
-    case CHUNK_AUDIO_ONLY:
-        av_dlog(NULL, "audio only\n");
-        break;
-
-    case CHUNK_INIT_VIDEO:
-        av_dlog(NULL, "initialize video\n");
-        break;
-
-    case CHUNK_VIDEO:
-        av_dlog(NULL, "video (and audio)\n");
-        break;
-
-    case CHUNK_SHUTDOWN:
-        av_dlog(NULL, "shutdown\n");
-        break;
-
-    case CHUNK_END:
-        av_dlog(NULL, "end\n");
-        break;
-
-    default:
-        av_dlog(NULL, "invalid chunk\n");
-        chunk_type = CHUNK_BAD;
-        break;
-
-    }
-
-    while ((chunk_size > 0) && (chunk_type != CHUNK_BAD)) {
-
-        /* read the next chunk, wherever the file happens to be pointing */
-        if (pb->eof_reached) {
-            chunk_type = CHUNK_EOF;
-            break;
-        }
-        if (avio_read(pb, opcode_preamble, CHUNK_PREAMBLE_SIZE) !=
-            CHUNK_PREAMBLE_SIZE) {
-            chunk_type = CHUNK_BAD;
-            break;
-        }
-
-        opcode_size = AV_RL16(&opcode_preamble[0]);
-        opcode_type = opcode_preamble[2];
-        opcode_version = opcode_preamble[3];
-
-        chunk_size -= OPCODE_PREAMBLE_SIZE;
-        chunk_size -= opcode_size;
-        if (chunk_size < 0) {
-            av_dlog(NULL, "chunk_size countdown just went negative\n");
-            chunk_type = CHUNK_BAD;
-            break;
-        }
-
-        av_dlog(NULL, "  opcode type %02X, version %d, 0x%04X bytes: ",
-                opcode_type, opcode_version, opcode_size);
-        switch (opcode_type) {
-
-        case OPCODE_END_OF_STREAM:
-            av_dlog(NULL, "end of stream\n");
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_END_OF_CHUNK:
-            av_dlog(NULL, "end of chunk\n");
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_CREATE_TIMER:
-            av_dlog(NULL, "create timer\n");
-            if ((opcode_version > 0) || (opcode_size > 6)) {
-                av_dlog(NULL, "bad create_timer opcode\n");
-                chunk_type = CHUNK_BAD;
-                break;
-            }
-            if (avio_read(pb, scratch, opcode_size) !=
-                opcode_size) {
-                chunk_type = CHUNK_BAD;
-                break;
-            }
-            s->frame_pts_inc = ((uint64_t)AV_RL32(&scratch[0])) * AV_RL16(&scratch[4]);
-            av_dlog(NULL, "  %.2f frames/second (timer div = %d, subdiv = %d)\n",
-                    1000000.0 / s->frame_pts_inc, AV_RL32(&scratch[0]),
-                    AV_RL16(&scratch[4]));
-            break;
-
-        case OPCODE_INIT_AUDIO_BUFFERS:
-            av_dlog(NULL, "initialize audio buffers\n");
-            if ((opcode_version > 1) || (opcode_size > 10)) {
-                av_dlog(NULL, "bad init_audio_buffers opcode\n");
-                chunk_type = CHUNK_BAD;
-                break;
-            }
-            if (avio_read(pb, scratch, opcode_size) !=
-                opcode_size) {
-                chunk_type = CHUNK_BAD;
-                break;
-            }
-            s->audio_sample_rate = AV_RL16(&scratch[4]);
-            audio_flags = AV_RL16(&scratch[2]);
-            /* bit 0 of the flags: 0 = mono, 1 = stereo */
-            s->audio_channels = (audio_flags & 1) + 1;
-            /* bit 1 of the flags: 0 = 8 bit, 1 = 16 bit */
-            s->audio_bits = (((audio_flags >> 1) & 1) + 1) * 8;
-            /* bit 2 indicates compressed audio in version 1 opcode */
-            if ((opcode_version == 1) && (audio_flags & 0x4))
-                s->audio_type = AV_CODEC_ID_INTERPLAY_DPCM;
-            else if (s->audio_bits == 16)
-                s->audio_type = AV_CODEC_ID_PCM_S16LE;
-            else
-                s->audio_type = AV_CODEC_ID_PCM_U8;
-            av_dlog(NULL, "audio: %d bits, %d Hz, %s, %s format\n",
-                    s->audio_bits, s->audio_sample_rate,
-                    (s->audio_channels == 2) ? "stereo" : "mono",
-                    (s->audio_type == AV_CODEC_ID_INTERPLAY_DPCM) ?
-                    "Interplay audio" : "PCM");
-            break;
-
-        case OPCODE_START_STOP_AUDIO:
-            av_dlog(NULL, "start/stop audio\n");
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_INIT_VIDEO_BUFFERS:
-            av_dlog(NULL, "initialize video buffers\n");
-            if ((opcode_version > 2) || (opcode_size > 8)) {
-                av_dlog(NULL, "bad init_video_buffers opcode\n");
-                chunk_type = CHUNK_BAD;
-                break;
-            }
-            if (avio_read(pb, scratch, opcode_size) !=
-                opcode_size) {
-                chunk_type = CHUNK_BAD;
-                break;
-            }
-            width  = AV_RL16(&scratch[0]) * 8;
-            height = AV_RL16(&scratch[2]) * 8;
-            if (width != s->video_width) {
-                s->video_width = width;
-                s->changed++;
-            }
-            if (height != s->video_height) {
-                s->video_height = height;
-                s->changed++;
-            }
-            if (opcode_version < 2 || !AV_RL16(&scratch[6])) {
-                s->video_bpp = 8;
-            } else {
-                s->video_bpp = 16;
-            }
-            av_dlog(NULL, "video resolution: %d x %d\n",
-                    s->video_width, s->video_height);
-            break;
-
-        case OPCODE_UNKNOWN_06:
-        case OPCODE_UNKNOWN_0E:
-        case OPCODE_UNKNOWN_10:
-        case OPCODE_UNKNOWN_12:
-        case OPCODE_UNKNOWN_13:
-        case OPCODE_UNKNOWN_14:
-        case OPCODE_UNKNOWN_15:
-            av_dlog(NULL, "unknown (but documented) opcode %02X\n", opcode_type);
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_SEND_BUFFER:
-            av_dlog(NULL, "send buffer\n");
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_AUDIO_FRAME:
-            av_dlog(NULL, "audio frame\n");
-
-            /* log position and move on for now */
-            s->audio_chunk_offset = avio_tell(pb);
-            s->audio_chunk_size = opcode_size;
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_SILENCE_FRAME:
-            av_dlog(NULL, "silence frame\n");
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_INIT_VIDEO_MODE:
-            av_dlog(NULL, "initialize video mode\n");
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_CREATE_GRADIENT:
-            av_dlog(NULL, "create gradient\n");
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_SET_PALETTE:
-            av_dlog(NULL, "set palette\n");
-            /* check for the logical maximum palette size
-             * (3 * 256 + 4 bytes) */
-            if (opcode_size > 0x304) {
-                av_dlog(NULL, "demux_ipmovie: set_palette opcode too large\n");
-                chunk_type = CHUNK_BAD;
-                break;
-            }
-            if (avio_read(pb, scratch, opcode_size) != opcode_size) {
-                chunk_type = CHUNK_BAD;
-                break;
-            }
-
-            /* load the palette into internal data structure */
-            first_color = AV_RL16(&scratch[0]);
-            last_color = first_color + AV_RL16(&scratch[2]) - 1;
-            /* sanity check (since they are 16 bit values) */
-            if ((first_color > 0xFF) || (last_color > 0xFF)) {
-                av_dlog(NULL, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
-                    first_color, last_color);
-                chunk_type = CHUNK_BAD;
-                break;
-            }
-            j = 4;  /* offset of first palette data */
-            for (i = first_color; i <= last_color; i++) {
-                /* the palette is stored as a 6-bit VGA palette, thus each
-                 * component is shifted up to a 8-bit range */
-                r = scratch[j++] * 4;
-                g = scratch[j++] * 4;
-                b = scratch[j++] * 4;
-                s->palette[i] = (r << 16) | (g << 8) | (b);
-            }
-            s->has_palette = 1;
-            break;
-
-        case OPCODE_SET_PALETTE_COMPRESSED:
-            av_dlog(NULL, "set palette compressed\n");
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_SET_DECODING_MAP:
-            av_dlog(NULL, "set decoding map\n");
-
-            /* log position and move on for now */
-            s->decode_map_chunk_offset = avio_tell(pb);
-            s->decode_map_chunk_size = opcode_size;
-            avio_skip(pb, opcode_size);
-            break;
-
-        case OPCODE_VIDEO_DATA:
-            av_dlog(NULL, "set video data\n");
-
-            /* log position and move on for now */
-            s->video_chunk_offset = avio_tell(pb);
-            s->video_chunk_size = opcode_size;
-            avio_skip(pb, opcode_size);
-            break;
-
-        default:
-            av_dlog(NULL, "*** unknown opcode type\n");
-            chunk_type = CHUNK_BAD;
-            break;
-
-        }
-    }
-
-    /* make a note of where the stream is sitting */
-    s->next_chunk_offset = avio_tell(pb);
-
-    /* dispatch the first of any pending packets */
-    if ((chunk_type == CHUNK_VIDEO) || (chunk_type == CHUNK_AUDIO_ONLY))
-        chunk_type = load_ipmovie_packet(s, pb, pkt);
-
-    return chunk_type;
-}
-
-static const char signature[] = "Interplay MVE File\x1A\0\x1A";
-
-static int ipmovie_probe(AVProbeData *p)
-{
-    uint8_t *b = p->buf;
-    uint8_t *b_end = p->buf + p->buf_size - sizeof(signature);
-    do {
-        if (memcmp(b++, signature, sizeof(signature)) == 0)
-            return AVPROBE_SCORE_MAX;
-    } while (b < b_end);
-
-    return 0;
-}
-
-static int ipmovie_read_header(AVFormatContext *s)
-{
-    IPMVEContext *ipmovie = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVPacket pkt;
-    AVStream *st;
-    unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
-    int chunk_type;
-    uint8_t signature_buffer[sizeof(signature)];
-
-    avio_read(pb, signature_buffer, sizeof(signature_buffer));
-    while (memcmp(signature_buffer, signature, sizeof(signature))) {
-        memmove(signature_buffer, signature_buffer + 1, sizeof(signature_buffer) - 1);
-        signature_buffer[sizeof(signature_buffer) - 1] = avio_r8(pb);
-        if (pb->eof_reached)
-            return AVERROR_EOF;
-    }
-    /* initialize private context members */
-    ipmovie->video_pts = ipmovie->audio_frame_count = 0;
-    ipmovie->audio_chunk_offset = ipmovie->video_chunk_offset =
-    ipmovie->decode_map_chunk_offset = 0;
-
-    /* on the first read, this will position the stream at the first chunk */
-    ipmovie->next_chunk_offset = avio_tell(pb) + 4;
-
-    /* process the first chunk which should be CHUNK_INIT_VIDEO */
-    if (process_ipmovie_chunk(ipmovie, pb, &pkt) != CHUNK_INIT_VIDEO)
-        return AVERROR_INVALIDDATA;
-
-    /* peek ahead to the next chunk-- if it is an init audio chunk, process
-     * it; if it is the first video chunk, this is a silent file */
-    if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
-        CHUNK_PREAMBLE_SIZE)
-        return AVERROR(EIO);
-    chunk_type = AV_RL16(&chunk_preamble[2]);
-    avio_seek(pb, -CHUNK_PREAMBLE_SIZE, SEEK_CUR);
-
-    if (chunk_type == CHUNK_VIDEO)
-        ipmovie->audio_type = AV_CODEC_ID_NONE;  /* no audio */
-    else if (process_ipmovie_chunk(ipmovie, pb, &pkt) != CHUNK_INIT_AUDIO)
-        return AVERROR_INVALIDDATA;
-
-    /* initialize the stream decoders */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    avpriv_set_pts_info(st, 63, 1, 1000000);
-    ipmovie->video_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_INTERPLAY_VIDEO;
-    st->codec->codec_tag = 0;  /* no fourcc */
-    st->codec->width = ipmovie->video_width;
-    st->codec->height = ipmovie->video_height;
-    st->codec->bits_per_coded_sample = ipmovie->video_bpp;
-
-    if (ipmovie->audio_type) {
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        avpriv_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);
-        ipmovie->audio_stream_index = st->index;
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id = ipmovie->audio_type;
-        st->codec->codec_tag = 0;  /* no tag */
-        st->codec->channels = ipmovie->audio_channels;
-        st->codec->channel_layout = st->codec->channels == 1 ? AV_CH_LAYOUT_MONO :
-                                                               AV_CH_LAYOUT_STEREO;
-        st->codec->sample_rate = ipmovie->audio_sample_rate;
-        st->codec->bits_per_coded_sample = ipmovie->audio_bits;
-        st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
-            st->codec->bits_per_coded_sample;
-        if (st->codec->codec_id == AV_CODEC_ID_INTERPLAY_DPCM)
-            st->codec->bit_rate /= 2;
-        st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;
-    }
-
-    return 0;
-}
-
-static int ipmovie_read_packet(AVFormatContext *s,
-                               AVPacket *pkt)
-{
-    IPMVEContext *ipmovie = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret;
-
-    ret = process_ipmovie_chunk(ipmovie, pb, pkt);
-    if (ret == CHUNK_BAD)
-        ret = AVERROR_INVALIDDATA;
-    else if (ret == CHUNK_EOF)
-        ret = AVERROR(EIO);
-    else if (ret == CHUNK_NOMEM)
-        ret = AVERROR(ENOMEM);
-    else if (ret == CHUNK_VIDEO)
-        ret = 0;
-    else
-        ret = -1;
-
-    return ret;
-}
-
-AVInputFormat ff_ipmovie_demuxer = {
-    .name           = "ipmovie",
-    .long_name      = NULL_IF_CONFIG_SMALL("Interplay MVE"),
-    .priv_data_size = sizeof(IPMVEContext),
-    .read_probe     = ipmovie_probe,
-    .read_header    = ipmovie_read_header,
-    .read_packet    = ipmovie_read_packet,
-};
diff --git a/deps/libav/libavformat/isom.c b/deps/libav/libavformat/isom.c
deleted file mode 100644
index 7861290..0000000
--- a/deps/libav/libavformat/isom.c
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * ISO Media common code
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2002 Francois Revol <revol at free.fr>
- * Copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier at free.fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "isom.h"
-#include "libavcodec/mpeg4audio.h"
-#include "libavcodec/mpegaudiodata.h"
-
-/* http://www.mp4ra.org */
-/* ordered by muxing preference */
-const AVCodecTag ff_mp4_obj_type[] = {
-    { AV_CODEC_ID_MOV_TEXT    , 0x08 },
-    { AV_CODEC_ID_MPEG4       , 0x20 },
-    { AV_CODEC_ID_H264        , 0x21 },
-    { AV_CODEC_ID_HEVC        , 0x23 },
-    { AV_CODEC_ID_AAC         , 0x40 },
-    { AV_CODEC_ID_MP4ALS      , 0x40 }, /* 14496-3 ALS */
-    { AV_CODEC_ID_MPEG2VIDEO  , 0x61 }, /* MPEG2 Main */
-    { AV_CODEC_ID_MPEG2VIDEO  , 0x60 }, /* MPEG2 Simple */
-    { AV_CODEC_ID_MPEG2VIDEO  , 0x62 }, /* MPEG2 SNR */
-    { AV_CODEC_ID_MPEG2VIDEO  , 0x63 }, /* MPEG2 Spatial */
-    { AV_CODEC_ID_MPEG2VIDEO  , 0x64 }, /* MPEG2 High */
-    { AV_CODEC_ID_MPEG2VIDEO  , 0x65 }, /* MPEG2 422 */
-    { AV_CODEC_ID_AAC         , 0x66 }, /* MPEG2 AAC Main */
-    { AV_CODEC_ID_AAC         , 0x67 }, /* MPEG2 AAC Low */
-    { AV_CODEC_ID_AAC         , 0x68 }, /* MPEG2 AAC SSR */
-    { AV_CODEC_ID_MP3         , 0x69 }, /* 13818-3 */
-    { AV_CODEC_ID_MP2         , 0x69 }, /* 11172-3 */
-    { AV_CODEC_ID_MPEG1VIDEO  , 0x6A }, /* 11172-2 */
-    { AV_CODEC_ID_MP3         , 0x6B }, /* 11172-3 */
-    { AV_CODEC_ID_MJPEG       , 0x6C }, /* 10918-1 */
-    { AV_CODEC_ID_PNG         , 0x6D },
-    { AV_CODEC_ID_JPEG2000    , 0x6E }, /* 15444-1 */
-    { AV_CODEC_ID_VC1         , 0xA3 },
-    { AV_CODEC_ID_DIRAC       , 0xA4 },
-    { AV_CODEC_ID_AC3         , 0xA5 },
-    { AV_CODEC_ID_DTS         , 0xA9 }, /* mp4ra.org */
-    { AV_CODEC_ID_VORBIS      , 0xDD }, /* non standard, gpac uses it */
-    { AV_CODEC_ID_DVD_SUBTITLE, 0xE0 }, /* non standard, see unsupported-embedded-subs-2.mp4 */
-    { AV_CODEC_ID_QCELP       , 0xE1 },
-    { AV_CODEC_ID_MPEG4SYSTEMS, 0x01 },
-    { AV_CODEC_ID_MPEG4SYSTEMS, 0x02 },
-    { AV_CODEC_ID_NONE        ,    0 },
-};
-
-const AVCodecTag ff_codec_movvideo_tags[] = {
-/*  { AV_CODEC_ID_, MKTAG('I', 'V', '5', '0') }, *//* Indeo 5.0 */
-
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('r', 'a', 'w', ' ') }, /* Uncompressed RGB */
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('y', 'u', 'v', '2') }, /* Uncompressed YUV422 */
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'V', 'U', 'I') }, /* YUV with alpha-channel (AVID Uncompressed) */
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('2', 'v', 'u', 'y') }, /* UNCOMPRESSED 8BIT 4:2:2 */
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('y', 'u', 'v', 's') }, /* same as 2vuy but byte swapped */
-
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('L', '5', '5', '5') },
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('L', '5', '6', '5') },
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('B', '5', '6', '5') },
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('2', '4', 'B', 'G') },
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 'A') },
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 'A') },
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'B', 'G', 'R') },
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('b', '1', '6', 'g') },
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('b', '4', '8', 'r') },
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('D', 'V', 'O', 'O') }, /* Digital Voodoo SD 8 Bit */
-
-    { AV_CODEC_ID_R10K,   MKTAG('R', '1', '0', 'k') }, /* UNCOMPRESSED 10BIT RGB */
-    { AV_CODEC_ID_R10K,   MKTAG('R', '1', '0', 'g') }, /* UNCOMPRESSED 10BIT RGB */
-    { AV_CODEC_ID_R210,   MKTAG('r', '2', '1', '0') }, /* UNCOMPRESSED 10BIT RGB */
-    { AV_CODEC_ID_V210,   MKTAG('v', '2', '1', '0') }, /* UNCOMPRESSED 10BIT 4:2:2 */
-    { AV_CODEC_ID_V410,   MKTAG('v', '4', '1', '0') }, /* UNCOMPRESSED 10BIT 4:4:4 */
-
-    { AV_CODEC_ID_MJPEG,  MKTAG('j', 'p', 'e', 'g') }, /* PhotoJPEG */
-    { AV_CODEC_ID_MJPEG,  MKTAG('m', 'j', 'p', 'a') }, /* Motion-JPEG (format A) */
-    { AV_CODEC_ID_MJPEG,  MKTAG('A', 'V', 'D', 'J') }, /* MJPEG with alpha-channel (AVID JFIF meridien compressed) */
-/*  { AV_CODEC_ID_MJPEG,  MKTAG('A', 'V', 'R', 'n') }, *//* MJPEG with alpha-channel (AVID ABVB/Truevision NuVista) */
-    { AV_CODEC_ID_MJPEG,  MKTAG('d', 'm', 'b', '1') }, /* Motion JPEG OpenDML */
-    { AV_CODEC_ID_MJPEGB, MKTAG('m', 'j', 'p', 'b') }, /* Motion-JPEG (format B) */
-
-    { AV_CODEC_ID_SVQ1, MKTAG('S', 'V', 'Q', '1') }, /* Sorenson Video v1 */
-    { AV_CODEC_ID_SVQ1, MKTAG('s', 'v', 'q', '1') }, /* Sorenson Video v1 */
-    { AV_CODEC_ID_SVQ1, MKTAG('s', 'v', 'q', 'i') }, /* Sorenson Video v1 (from QT specs)*/
-    { AV_CODEC_ID_SVQ3, MKTAG('S', 'V', 'Q', '3') }, /* Sorenson Video v3 */
-
-    { AV_CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 'v') },
-    { AV_CODEC_ID_MPEG4, MKTAG('D', 'I', 'V', 'X') }, /* OpenDiVX *//* sample files at http://heroinewarrior.com/xmovie.php3 use this tag */
-    { AV_CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D') },
-    { AV_CODEC_ID_MPEG4, MKTAG('3', 'I', 'V', '2') }, /* experimental: 3IVX files before ivx D4 4.5.1 */
-
-    { AV_CODEC_ID_H263, MKTAG('h', '2', '6', '3') }, /* H263 */
-    { AV_CODEC_ID_H263, MKTAG('s', '2', '6', '3') }, /* H263 ?? works */
-
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'c', 'p') }, /* DV PAL */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'c', ' ') }, /* DV NTSC */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'p', 'p') }, /* DVCPRO PAL produced by FCP */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', '5', 'p') }, /* DVCPRO50 PAL produced by FCP */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', '5', 'n') }, /* DVCPRO50 NTSC produced by FCP */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('A', 'V', 'd', 'v') }, /* AVID DV */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('A', 'V', 'd', '1') }, /* AVID DV100 */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', 'q') }, /* DVCPRO HD 720p50 */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', 'p') }, /* DVCPRO HD 720p60 */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', '1') },
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', '2') },
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', '4') },
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', '5') }, /* DVCPRO HD 50i produced by FCP */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', '6') }, /* DVCPRO HD 60i produced by FCP */
-    { AV_CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', '3') }, /* DVCPRO HD 30p produced by FCP */
-
-    { AV_CODEC_ID_VP3,     MKTAG('V', 'P', '3', '1') }, /* On2 VP3 */
-    { AV_CODEC_ID_RPZA,    MKTAG('r', 'p', 'z', 'a') }, /* Apple Video (RPZA) */
-    { AV_CODEC_ID_CINEPAK, MKTAG('c', 'v', 'i', 'd') }, /* Cinepak */
-    { AV_CODEC_ID_8BPS,    MKTAG('8', 'B', 'P', 'S') }, /* Planar RGB (8BPS) */
-    { AV_CODEC_ID_SMC,     MKTAG('s', 'm', 'c', ' ') }, /* Apple Graphics (SMC) */
-    { AV_CODEC_ID_QTRLE,   MKTAG('r', 'l', 'e', ' ') }, /* Apple Animation (RLE) */
-    { AV_CODEC_ID_MSRLE,   MKTAG('W', 'R', 'L', 'E') },
-    { AV_CODEC_ID_QDRAW,   MKTAG('q', 'd', 'r', 'w') }, /* QuickDraw */
-
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('W', 'R', 'A', 'W') },
-
-    { AV_CODEC_ID_HEVC, MKTAG('h', 'e', 'v', '1') }, /* HEVC/H.265 which indicates parameter sets may be in ES */
-    { AV_CODEC_ID_HEVC, MKTAG('h', 'v', 'c', '1') }, /* HEVC/H.265 which indicates parameter sets shall not be in ES */
-
-    { AV_CODEC_ID_H264, MKTAG('a', 'v', 'c', '1') }, /* AVC-1/H.264 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '5', 'p') }, /* AVC-Intra  50M 720p24/30/60 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '5', 'q') }, /* AVC-Intra  50M 720p25/50 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '5', '2') }, /* AVC-Intra  50M 1080p25/50 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '5', '3') }, /* AVC-Intra  50M 1080p24/30/60 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '5', '5') }, /* AVC-Intra  50M 1080i50 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '5', '6') }, /* AVC-Intra  50M 1080i60 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '1', 'p') }, /* AVC-Intra 100M 720p24/30/60 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '1', 'q') }, /* AVC-Intra 100M 720p25/50 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '1', '2') }, /* AVC-Intra 100M 1080p25/50 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '1', '3') }, /* AVC-Intra 100M 1080p24/30/60 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '1', '5') }, /* AVC-Intra 100M 1080i50 */
-    { AV_CODEC_ID_H264, MKTAG('a', 'i', '1', '6') }, /* AVC-Intra 100M 1080i60 */
-    { AV_CODEC_ID_H264, MKTAG('A', 'V', 'i', 'n') }, /* AVC-Intra with implicit SPS/PPS */
-
-    { AV_CODEC_ID_MPEG1VIDEO, MKTAG('m', '1', 'v', '1') }, /* Apple MPEG-1 Camcorder */
-    { AV_CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'e', 'g') }, /* MPEG */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', '2', 'v', '1') }, /* Apple MPEG-2 Camcorder */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '1') }, /* MPEG2 HDV 720p30 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '2') }, /* MPEG2 HDV 1080i60 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '3') }, /* MPEG2 HDV 1080i50 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '4') }, /* MPEG2 HDV 720p24 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '5') }, /* MPEG2 HDV 720p25 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '6') }, /* MPEG2 HDV 1080p24 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '7') }, /* MPEG2 HDV 1080p25 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '8') }, /* MPEG2 HDV 1080p30 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', '9') }, /* MPEG2 HDV 720p60 JVC */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('h', 'd', 'v', 'a') }, /* MPEG2 HDV 720p50 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'x', '5', 'n') }, /* MPEG2 IMX NTSC 525/60 50mb/s produced by FCP */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'x', '5', 'p') }, /* MPEG2 IMX PAL 625/50 50mb/s produced by FCP */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'x', '4', 'n') }, /* MPEG2 IMX NTSC 525/60 40mb/s produced by FCP */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'x', '4', 'p') }, /* MPEG2 IMX PAL 625/50 40mb/s produced by FCP */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'x', '3', 'n') }, /* MPEG2 IMX NTSC 525/60 30mb/s produced by FCP */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'x', '3', 'p') }, /* MPEG2 IMX PAL 625/50 30mb/s produced by FCP */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', '5', '4') }, /* XDCAM HD422 720p24 CBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', '5', '5') }, /* XDCAM HD422 720p25 CBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', '5', '9') }, /* XDCAM HD422 720p60 CBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', '5', 'a') }, /* XDCAM HD422 720p50 CBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', '5', 'b') }, /* XDCAM HD422 1080i60 CBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', '5', 'c') }, /* XDCAM HD422 1080i50 CBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', '5', 'd') }, /* XDCAM HD422 1080p24 CBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', '5', 'e') }, /* XDCAM HD422 1080p25 CBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', '5', 'f') }, /* XDCAM HD422 1080p30 CBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', '1') }, /* XDCAM EX 720p30 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', '2') }, /* XDCAM HD 1080i60 */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', '3') }, /* XDCAM HD 1080i50 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', '4') }, /* XDCAM EX 720p24 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', '5') }, /* XDCAM EX 720p25 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', '6') }, /* XDCAM HD 1080p24 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', '7') }, /* XDCAM HD 1080p25 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', '8') }, /* XDCAM HD 1080p30 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', '9') }, /* XDCAM EX 720p60 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', 'a') }, /* XDCAM EX 720p50 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', 'b') }, /* XDCAM EX 1080i60 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', 'c') }, /* XDCAM EX 1080i50 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', 'd') }, /* XDCAM EX 1080p24 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', 'e') }, /* XDCAM EX 1080p25 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'v', 'f') }, /* XDCAM EX 1080p30 VBR */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'h', 'd') }, /* XDCAM HD 540p */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('x', 'd', 'h', '2') }, /* XDCAM HD422 540p */
-    { AV_CODEC_ID_MPEG2VIDEO, MKTAG('A', 'V', 'm', 'p') }, /* AVID IMX PAL */
-
-    { AV_CODEC_ID_JPEG2000, MKTAG('m', 'j', 'p', '2') }, /* JPEG 2000 produced by FCP */
-
-    { AV_CODEC_ID_TARGA, MKTAG('t', 'g', 'a', ' ') }, /* Truevision Targa */
-    { AV_CODEC_ID_TIFF,  MKTAG('t', 'i', 'f', 'f') }, /* TIFF embedded in MOV */
-    { AV_CODEC_ID_GIF,   MKTAG('g', 'i', 'f', ' ') }, /* embedded gif files as frames (usually one "click to play movie" frame) */
-    { AV_CODEC_ID_PNG,   MKTAG('p', 'n', 'g', ' ') },
-
-    { AV_CODEC_ID_VC1, MKTAG('v', 'c', '-', '1') }, /* SMPTE RP 2025 */
-    { AV_CODEC_ID_CAVS, MKTAG('a', 'v', 's', '2') },
-
-    { AV_CODEC_ID_DIRAC,     MKTAG('d', 'r', 'a', 'c') },
-    { AV_CODEC_ID_DNXHD,     MKTAG('A', 'V', 'd', 'n') }, /* AVID DNxHD */
-    { AV_CODEC_ID_H263,      MKTAG('H', '2', '6', '3') },
-    { AV_CODEC_ID_MSMPEG4V3, MKTAG('3', 'I', 'V', 'D') }, /* 3ivx DivX Doctor */
-    { AV_CODEC_ID_RAWVIDEO,  MKTAG('A', 'V', '1', 'x') }, /* AVID 1:1x */
-    { AV_CODEC_ID_RAWVIDEO,  MKTAG('A', 'V', 'u', 'p') },
-    { AV_CODEC_ID_SGI,       MKTAG('s', 'g', 'i', ' ') }, /* SGI  */
-    { AV_CODEC_ID_DPX,       MKTAG('d', 'p', 'x', ' ') }, /* DPX */
-
-    { AV_CODEC_ID_PRORES, MKTAG('a', 'p', 'c', 'h') }, /* Apple ProRes 422 High Quality */
-    { AV_CODEC_ID_PRORES, MKTAG('a', 'p', 'c', 'n') }, /* Apple ProRes 422 Standard Definition */
-    { AV_CODEC_ID_PRORES, MKTAG('a', 'p', 'c', 's') }, /* Apple ProRes 422 LT */
-    { AV_CODEC_ID_PRORES, MKTAG('a', 'p', 'c', 'o') }, /* Apple ProRes 422 Proxy */
-    { AV_CODEC_ID_PRORES, MKTAG('a', 'p', '4', 'h') }, /* Apple ProRes 4444 */
-
-    { AV_CODEC_ID_AIC, MKTAG('i', 'c', 'o', 'd') },
-
-    { AV_CODEC_ID_NONE, 0 },
-};
-
-const AVCodecTag ff_codec_movaudio_tags[] = {
-    { AV_CODEC_ID_AAC,             MKTAG('m', 'p', '4', 'a') },
-    { AV_CODEC_ID_AC3,             MKTAG('a', 'c', '-', '3') }, /* ETSI TS 102 366 Annex F */
-    { AV_CODEC_ID_AC3,             MKTAG('s', 'a', 'c', '3') }, /* Nero Recode */
-    { AV_CODEC_ID_ADPCM_IMA_QT,    MKTAG('i', 'm', 'a', '4') },
-    { AV_CODEC_ID_ALAC,            MKTAG('a', 'l', 'a', 'c') },
-    { AV_CODEC_ID_AMR_NB,          MKTAG('s', 'a', 'm', 'r') }, /* AMR-NB 3gp */
-    { AV_CODEC_ID_AMR_WB,          MKTAG('s', 'a', 'w', 'b') }, /* AMR-WB 3gp */
-    { AV_CODEC_ID_DTS,             MKTAG('d', 't', 's', 'c') }, /* DTS formats prior to DTS-HD */
-    { AV_CODEC_ID_DTS,             MKTAG('d', 't', 's', 'h') }, /* DTS-HD audio formats */
-    { AV_CODEC_ID_DTS,             MKTAG('d', 't', 's', 'l') }, /* DTS-HD Lossless formats */
-    { AV_CODEC_ID_DTS,             MKTAG('D', 'T', 'S', ' ') }, /* non-standard */
-    { AV_CODEC_ID_EAC3,            MKTAG('e', 'c', '-', '3') }, /* ETSI TS 102 366 Annex F (only valid in ISOBMFF) */
-    { AV_CODEC_ID_DVAUDIO,         MKTAG('v', 'd', 'v', 'a') },
-    { AV_CODEC_ID_DVAUDIO,         MKTAG('d', 'v', 'c', 'a') },
-    { AV_CODEC_ID_GSM,             MKTAG('a', 'g', 's', 'm') },
-    { AV_CODEC_ID_ILBC,            MKTAG('i', 'l', 'b', 'c') },
-    { AV_CODEC_ID_MACE3,           MKTAG('M', 'A', 'C', '3') },
-    { AV_CODEC_ID_MACE6,           MKTAG('M', 'A', 'C', '6') },
-    { AV_CODEC_ID_MP1,             MKTAG('.', 'm', 'p', '1') },
-    { AV_CODEC_ID_MP2,             MKTAG('.', 'm', 'p', '2') },
-    { AV_CODEC_ID_MP3,             MKTAG('.', 'm', 'p', '3') },
-    { AV_CODEC_ID_MP3,             0x6D730055                },
-    { AV_CODEC_ID_NELLYMOSER,      MKTAG('n', 'm', 'o', 's') }, /* Flash Media Server */
-    { AV_CODEC_ID_PCM_ALAW,        MKTAG('a', 'l', 'a', 'w') },
-    { AV_CODEC_ID_PCM_F32BE,       MKTAG('f', 'l', '3', '2') },
-    { AV_CODEC_ID_PCM_F32LE,       MKTAG('f', 'l', '3', '2') },
-    { AV_CODEC_ID_PCM_F64BE,       MKTAG('f', 'l', '6', '4') },
-    { AV_CODEC_ID_PCM_F64LE,       MKTAG('f', 'l', '6', '4') },
-    { AV_CODEC_ID_PCM_MULAW,       MKTAG('u', 'l', 'a', 'w') },
-    { AV_CODEC_ID_PCM_S16BE,       MKTAG('t', 'w', 'o', 's') },
-    { AV_CODEC_ID_PCM_S16LE,       MKTAG('s', 'o', 'w', 't') },
-    { AV_CODEC_ID_PCM_S16BE,       MKTAG('l', 'p', 'c', 'm') },
-    { AV_CODEC_ID_PCM_S16LE,       MKTAG('l', 'p', 'c', 'm') },
-    { AV_CODEC_ID_PCM_S24BE,       MKTAG('i', 'n', '2', '4') },
-    { AV_CODEC_ID_PCM_S24LE,       MKTAG('i', 'n', '2', '4') },
-    { AV_CODEC_ID_PCM_S32BE,       MKTAG('i', 'n', '3', '2') },
-    { AV_CODEC_ID_PCM_S32LE,       MKTAG('i', 'n', '3', '2') },
-    { AV_CODEC_ID_PCM_S8,          MKTAG('s', 'o', 'w', 't') },
-    { AV_CODEC_ID_PCM_U8,          MKTAG('r', 'a', 'w', ' ') },
-    { AV_CODEC_ID_PCM_U8,          MKTAG('N', 'O', 'N', 'E') },
-    { AV_CODEC_ID_QCELP,           MKTAG('Q', 'c', 'l', 'p') },
-    { AV_CODEC_ID_QCELP,           MKTAG('Q', 'c', 'l', 'q') },
-    { AV_CODEC_ID_QCELP,           MKTAG('s', 'q', 'c', 'p') }, /* ISO Media fourcc */
-    { AV_CODEC_ID_QDM2,            MKTAG('Q', 'D', 'M', '2') },
-    { AV_CODEC_ID_QDMC,            MKTAG('Q', 'D', 'M', 'C') },
-    { AV_CODEC_ID_SPEEX,           MKTAG('s', 'p', 'e', 'x') }, /* Flash Media Server */
-    { AV_CODEC_ID_WMAV2,           MKTAG('W', 'M', 'A', '2') },
-    { AV_CODEC_ID_NONE, 0 },
-};
-
-const AVCodecTag ff_codec_movsubtitle_tags[] = {
-    { AV_CODEC_ID_MOV_TEXT, MKTAG('t', 'e', 'x', 't') },
-    { AV_CODEC_ID_MOV_TEXT, MKTAG('t', 'x', '3', 'g') },
-    { AV_CODEC_ID_NONE, 0 },
-};
-
-/* map numeric codes from mdhd atom to ISO 639 */
-/* cf. QTFileFormat.pdf p253, qtff.pdf p205 */
-/* http://developer.apple.com/documentation/mac/Text/Text-368.html */
-/* deprecated by putting the code as 3*5bit ascii */
-static const char mov_mdhd_language_map[][4] = {
-    /* 0-9 */
-    "eng", "fra", "ger", "ita", "dut", "sve", "spa", "dan", "por", "nor",
-    "heb", "jpn", "ara", "fin", "gre", "ice", "mlt", "tur", "hr "/*scr*/, "chi"/*ace?*/,
-    "urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav",    "",
-    "fo ",    "", "rus", "chi",    "", "iri", "alb", "ron", "ces", "slk",
-    "slv", "yid", "sr ", "mac", "bul", "ukr", "bel", "uzb", "kaz", "aze",
-    /*?*/
-    "aze", "arm", "geo", "mol", "kir", "tgk", "tuk", "mon",    "", "pus",
-    "kur", "kas", "snd", "tib", "nep", "san", "mar", "ben", "asm", "guj",
-    "pa ", "ori", "mal", "kan", "tam", "tel",    "", "bur", "khm", "lao",
-    /*                   roman? arabic? */
-    "vie", "ind", "tgl", "may", "may", "amh", "tir", "orm", "som", "swa",
-    /*==rundi?*/
-       "", "run",    "", "mlg", "epo",    "",    "",    "",    "",    "",
-    /* 100 */
-       "",    "",    "",    "",    "",    "",    "",    "",    "",    "",
-       "",    "",    "",    "",    "",    "",    "",    "",    "",    "",
-       "",    "",    "",    "",    "",    "",    "",    "", "wel", "baq",
-    "cat", "lat", "que", "grn", "aym", "tat", "uig", "dzo", "jav"
-};
-
-int ff_mov_iso639_to_lang(const char lang[4], int mp4)
-{
-    int i, code = 0;
-
-    /* old way, only for QT? */
-    for (i = 0; lang[0] && !mp4 && i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
-        if (!strcmp(lang, mov_mdhd_language_map[i]))
-            return i;
-    }
-    /* XXX:can we do that in mov too? */
-    if (!mp4)
-        return -1;
-    /* handle undefined as such */
-    if (lang[0] == '\0')
-        lang = "und";
-    /* 5bit ascii */
-    for (i = 0; i < 3; i++) {
-        uint8_t c = lang[i];
-        c -= 0x60;
-        if (c > 0x1f)
-            return -1;
-        code <<= 5;
-        code |= c;
-    }
-    return code;
-}
-
-int ff_mov_lang_to_iso639(unsigned code, char to[4])
-{
-    int i;
-    memset(to, 0, 4);
-    /* is it the mangled iso code? */
-    /* see http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt */
-    if (code >= 0x400 && code != 0x7fff) {
-        for (i = 2; i >= 0; i--) {
-            to[i] = 0x60 + (code & 0x1f);
-            code >>= 5;
-        }
-        return 1;
-    }
-    /* old fashion apple lang code */
-    if (code >= FF_ARRAY_ELEMS(mov_mdhd_language_map))
-        return 0;
-    if (!mov_mdhd_language_map[code][0])
-        return 0;
-    memcpy(to, mov_mdhd_language_map[code], 4);
-    return 1;
-}
-
-int ff_mp4_read_descr_len(AVIOContext *pb)
-{
-    int len = 0;
-    int count = 4;
-    while (count--) {
-        int c = avio_r8(pb);
-        len = (len << 7) | (c & 0x7f);
-        if (!(c & 0x80))
-            break;
-    }
-    return len;
-}
-
-int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag)
-{
-    int len;
-    *tag = avio_r8(pb);
-    len = ff_mp4_read_descr_len(pb);
-    av_dlog(fc, "MPEG4 description: tag=0x%02x len=%d\n", *tag, len);
-    return len;
-}
-
-void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id)
-{
-     int flags;
-     if (es_id) *es_id = avio_rb16(pb);
-     else                avio_rb16(pb);
-     flags = avio_r8(pb);
-     if (flags & 0x80) //streamDependenceFlag
-         avio_rb16(pb);
-     if (flags & 0x40) { //URL_Flag
-         int len = avio_r8(pb);
-         avio_skip(pb, len);
-     }
-     if (flags & 0x20) //OCRstreamFlag
-         avio_rb16(pb);
-}
-
-static const AVCodecTag mp4_audio_types[] = {
-    { AV_CODEC_ID_MP3ON4, AOT_PS   }, /* old mp3on4 draft */
-    { AV_CODEC_ID_MP3ON4, AOT_L1   }, /* layer 1 */
-    { AV_CODEC_ID_MP3ON4, AOT_L2   }, /* layer 2 */
-    { AV_CODEC_ID_MP3ON4, AOT_L3   }, /* layer 3 */
-    { AV_CODEC_ID_MP4ALS, AOT_ALS  }, /* MPEG-4 ALS */
-    { AV_CODEC_ID_NONE,   AOT_NULL },
-};
-
-int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb)
-{
-    int len, tag;
-    int object_type_id = avio_r8(pb);
-    avio_r8(pb); /* stream type */
-    avio_rb24(pb); /* buffer size db */
-    avio_rb32(pb); /* max bitrate */
-    avio_rb32(pb); /* avg bitrate */
-
-    st->codec->codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
-    av_dlog(fc, "esds object type id 0x%02x\n", object_type_id);
-    len = ff_mp4_read_descr(fc, pb, &tag);
-    if (tag == MP4DecSpecificDescrTag) {
-        av_dlog(fc, "Specific MPEG4 header len=%d\n", len);
-        if (!len || (uint64_t)len > (1<<30))
-            return -1;
-        av_free(st->codec->extradata);
-        st->codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!st->codec->extradata)
-            return AVERROR(ENOMEM);
-        avio_read(pb, st->codec->extradata, len);
-        st->codec->extradata_size = len;
-        if (st->codec->codec_id == AV_CODEC_ID_AAC) {
-            MPEG4AudioConfig cfg;
-            avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
-                                         st->codec->extradata_size * 8, 1);
-            st->codec->channels = cfg.channels;
-            if (cfg.object_type == 29 && cfg.sampling_index < 3) // old mp3on4
-                st->codec->sample_rate = avpriv_mpa_freq_tab[cfg.sampling_index];
-            else if (cfg.ext_sample_rate)
-                st->codec->sample_rate = cfg.ext_sample_rate;
-            else
-                st->codec->sample_rate = cfg.sample_rate;
-            av_dlog(fc, "mp4a config channels %d obj %d ext obj %d "
-                    "sample rate %d ext sample rate %d\n", st->codec->channels,
-                    cfg.object_type, cfg.ext_object_type,
-                    cfg.sample_rate, cfg.ext_sample_rate);
-            if (!(st->codec->codec_id = ff_codec_get_id(mp4_audio_types,
-                                                        cfg.object_type)))
-                st->codec->codec_id = AV_CODEC_ID_AAC;
-        }
-    }
-    return 0;
-}
diff --git a/deps/libav/libavformat/isom.h b/deps/libav/libavformat/isom.h
deleted file mode 100644
index bf0792c..0000000
--- a/deps/libav/libavformat/isom.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * ISO Media common code
- * copyright (c) 2001 Fabrice Bellard
- * copyright (c) 2002 Francois Revol <revol at free.fr>
- * copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier at free.fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_ISOM_H
-#define AVFORMAT_ISOM_H
-
-#include "avio.h"
-#include "internal.h"
-#include "dv.h"
-
-/* isom.c */
-extern const AVCodecTag ff_mp4_obj_type[];
-extern const AVCodecTag ff_codec_movvideo_tags[];
-extern const AVCodecTag ff_codec_movaudio_tags[];
-extern const AVCodecTag ff_codec_movsubtitle_tags[];
-
-int ff_mov_iso639_to_lang(const char lang[4], int mp4);
-int ff_mov_lang_to_iso639(unsigned code, char to[4]);
-
-/* the QuickTime file format is quite convoluted...
- * it has lots of index tables, each indexing something in another one...
- * Here we just use what is needed to read the chunks
- */
-
-typedef struct MOVStts {
-    int count;
-    int duration;
-} MOVStts;
-
-typedef struct MOVStsc {
-    int first;
-    int count;
-    int id;
-} MOVStsc;
-
-typedef struct MOVDref {
-    uint32_t type;
-    char *path;
-    char *dir;
-    char volume[28];
-    char filename[64];
-    int16_t nlvl_to, nlvl_from;
-} MOVDref;
-
-typedef struct MOVAtom {
-    uint32_t type;
-    int64_t size; /* total size (excluding the size and type fields) */
-} MOVAtom;
-
-struct MOVParseTableEntry;
-
-typedef struct MOVFragment {
-    unsigned track_id;
-    uint64_t base_data_offset;
-    uint64_t moof_offset;
-    unsigned stsd_id;
-    unsigned duration;
-    unsigned size;
-    unsigned flags;
-} MOVFragment;
-
-typedef struct MOVTrackExt {
-    unsigned track_id;
-    unsigned stsd_id;
-    unsigned duration;
-    unsigned size;
-    unsigned flags;
-} MOVTrackExt;
-
-typedef struct MOVSbgp {
-    unsigned int count;
-    unsigned int index;
-} MOVSbgp;
-
-typedef struct MOVStreamContext {
-    AVIOContext *pb;
-    int ffindex;          ///< AVStream index
-    int next_chunk;
-    unsigned int chunk_count;
-    int64_t *chunk_offsets;
-    unsigned int stts_count;
-    MOVStts *stts_data;
-    unsigned int ctts_count;
-    MOVStts *ctts_data;
-    unsigned int stsc_count;
-    MOVStsc *stsc_data;
-    unsigned int stps_count;
-    unsigned *stps_data;  ///< partial sync sample for mpeg-2 open gop
-    int ctts_index;
-    int ctts_sample;
-    unsigned int sample_size;
-    unsigned int sample_count;
-    int *sample_sizes;
-    int keyframe_absent;
-    unsigned int keyframe_count;
-    int *keyframes;
-    int time_scale;
-    int64_t time_offset;  ///< time offset of the first edit list entry
-    int current_sample;
-    unsigned int bytes_per_frame;
-    unsigned int samples_per_frame;
-    int dv_audio_container;
-    int pseudo_stream_id; ///< -1 means demux all ids
-    int16_t audio_cid;    ///< stsd audio compression id
-    unsigned drefs_count;
-    MOVDref *drefs;
-    int dref_id;
-    int wrong_dts;        ///< dts are wrong due to huge ctts offset (iMovie files)
-    int width;            ///< tkhd width
-    int height;           ///< tkhd height
-    int dts_shift;        ///< dts shift when ctts is negative
-    uint32_t palette[256];
-    int has_palette;
-    int64_t data_size;
-    int64_t track_end;    ///< used for dts generation in fragmented movie files
-    unsigned int rap_group_count;
-    MOVSbgp *rap_group;
-} MOVStreamContext;
-
-typedef struct MOVContext {
-    AVFormatContext *fc;
-    int time_scale;
-    int64_t duration;     ///< duration of the longest track
-    int found_moov;       ///< 'moov' atom has been found
-    int found_mdat;       ///< 'mdat' atom has been found
-    DVDemuxContext *dv_demux;
-    AVFormatContext *dv_fctx;
-    int isom;             ///< 1 if file is ISO Media (mp4/3gp)
-    MOVFragment fragment; ///< current fragment in moof atom
-    MOVTrackExt *trex_data;
-    unsigned trex_count;
-    int itunes_metadata;  ///< metadata are itunes style
-    int chapter_track;
-    int64_t next_root_atom; ///< offset of the next root atom
-} MOVContext;
-
-int ff_mp4_read_descr_len(AVIOContext *pb);
-int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag);
-int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb);
-void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id);
-
-#define MP4ODescrTag                    0x01
-#define MP4IODescrTag                   0x02
-#define MP4ESDescrTag                   0x03
-#define MP4DecConfigDescrTag            0x04
-#define MP4DecSpecificDescrTag          0x05
-#define MP4SLDescrTag                   0x06
-
-#define MOV_TFHD_BASE_DATA_OFFSET       0x01
-#define MOV_TFHD_STSD_ID                0x02
-#define MOV_TFHD_DEFAULT_DURATION       0x08
-#define MOV_TFHD_DEFAULT_SIZE           0x10
-#define MOV_TFHD_DEFAULT_FLAGS          0x20
-#define MOV_TFHD_DURATION_IS_EMPTY  0x010000
-
-#define MOV_TRUN_DATA_OFFSET            0x01
-#define MOV_TRUN_FIRST_SAMPLE_FLAGS     0x04
-#define MOV_TRUN_SAMPLE_DURATION       0x100
-#define MOV_TRUN_SAMPLE_SIZE           0x200
-#define MOV_TRUN_SAMPLE_FLAGS          0x400
-#define MOV_TRUN_SAMPLE_CTS            0x800
-
-#define MOV_FRAG_SAMPLE_FLAG_DEGRADATION_PRIORITY_MASK 0x0000ffff
-#define MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC               0x00010000
-#define MOV_FRAG_SAMPLE_FLAG_PADDING_MASK              0x000e0000
-#define MOV_FRAG_SAMPLE_FLAG_REDUNDANCY_MASK           0x00300000
-#define MOV_FRAG_SAMPLE_FLAG_DEPENDED_MASK             0x00c00000
-#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_MASK              0x03000000
-
-#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO                0x02000000
-#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES               0x01000000
-
-#define MOV_TKHD_FLAG_ENABLED       0x0001
-#define MOV_TKHD_FLAG_IN_MOVIE      0x0002
-#define MOV_TKHD_FLAG_IN_PREVIEW    0x0004
-#define MOV_TKHD_FLAG_IN_POSTER     0x0008
-
-#define TAG_IS_AVCI(tag)                    \
-    ((tag) == MKTAG('a', 'i', '5', 'p') ||  \
-     (tag) == MKTAG('a', 'i', '5', 'q') ||  \
-     (tag) == MKTAG('a', 'i', '5', '2') ||  \
-     (tag) == MKTAG('a', 'i', '5', '3') ||  \
-     (tag) == MKTAG('a', 'i', '5', '5') ||  \
-     (tag) == MKTAG('a', 'i', '5', '6') ||  \
-     (tag) == MKTAG('a', 'i', '1', 'p') ||  \
-     (tag) == MKTAG('a', 'i', '1', 'q') ||  \
-     (tag) == MKTAG('a', 'i', '1', '2') ||  \
-     (tag) == MKTAG('a', 'i', '1', '3') ||  \
-     (tag) == MKTAG('a', 'i', '1', '5') ||  \
-     (tag) == MKTAG('a', 'i', '1', '6') ||  \
-     (tag) == MKTAG('A', 'V', 'i', 'n'))
-
-
-int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom);
-enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags);
-
-int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries);
-
-#endif /* AVFORMAT_ISOM_H */
diff --git a/deps/libav/libavformat/iss.c b/deps/libav/libavformat/iss.c
deleted file mode 100644
index 3f7f4fe..0000000
--- a/deps/libav/libavformat/iss.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * ISS (.iss) file demuxer
- * Copyright (c) 2008 Jaikrishnan Menon <realityman at gmx.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Funcom ISS file demuxer
- * @author Jaikrishnan Menon
- * @see http://wiki.multimedia.cx/index.php?title=FunCom_ISS
- */
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-#include "internal.h"
-#include "libavutil/avstring.h"
-
-#define ISS_SIG "IMA_ADPCM_Sound"
-#define ISS_SIG_LEN 15
-#define MAX_TOKEN_SIZE 20
-
-typedef struct {
-    int packet_size;
-    int sample_start_pos;
-} IssDemuxContext;
-
-static void get_token(AVIOContext *s, char *buf, int maxlen)
-{
-    int i = 0;
-    char c;
-
-    while ((c = avio_r8(s))) {
-        if(c == ' ')
-            break;
-        if (i < maxlen-1)
-            buf[i++] = c;
-    }
-
-    if(!c)
-        avio_r8(s);
-
-    buf[i] = 0; /* Ensure null terminated, but may be truncated */
-}
-
-static int iss_probe(AVProbeData *p)
-{
-    if (strncmp(p->buf, ISS_SIG, ISS_SIG_LEN))
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static av_cold int iss_read_header(AVFormatContext *s)
-{
-    IssDemuxContext *iss = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    char token[MAX_TOKEN_SIZE];
-    int stereo, rate_divisor;
-
-    get_token(pb, token, sizeof(token)); //"IMA_ADPCM_Sound"
-    get_token(pb, token, sizeof(token)); //packet size
-    sscanf(token, "%d", &iss->packet_size);
-    get_token(pb, token, sizeof(token)); //File ID
-    get_token(pb, token, sizeof(token)); //out size
-    get_token(pb, token, sizeof(token)); //stereo
-    sscanf(token, "%d", &stereo);
-    get_token(pb, token, sizeof(token)); //Unknown1
-    get_token(pb, token, sizeof(token)); //RateDivisor
-    sscanf(token, "%d", &rate_divisor);
-    get_token(pb, token, sizeof(token)); //Unknown2
-    get_token(pb, token, sizeof(token)); //Version ID
-    get_token(pb, token, sizeof(token)); //Size
-
-    iss->sample_start_pos = avio_tell(pb);
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_ISS;
-    if (stereo) {
-        st->codec->channels       = 2;
-        st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-    } else {
-        st->codec->channels       = 1;
-        st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    }
-    st->codec->sample_rate = 44100;
-    if(rate_divisor > 0)
-         st->codec->sample_rate /= rate_divisor;
-    st->codec->bits_per_coded_sample = 4;
-    st->codec->bit_rate = st->codec->channels * st->codec->sample_rate
-                                      * st->codec->bits_per_coded_sample;
-    st->codec->block_align = iss->packet_size;
-    avpriv_set_pts_info(st, 32, 1, st->codec->sample_rate);
-
-    return 0;
-}
-
-static int iss_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    IssDemuxContext *iss = s->priv_data;
-    int ret = av_get_packet(s->pb, pkt, iss->packet_size);
-
-    if(ret != iss->packet_size)
-        return AVERROR(EIO);
-
-    pkt->stream_index = 0;
-    pkt->pts = avio_tell(s->pb) - iss->sample_start_pos;
-    if(s->streams[0]->codec->channels > 0)
-        pkt->pts /= s->streams[0]->codec->channels*2;
-    return 0;
-}
-
-AVInputFormat ff_iss_demuxer = {
-    .name           = "iss",
-    .long_name      = NULL_IF_CONFIG_SMALL("Funcom ISS"),
-    .priv_data_size = sizeof(IssDemuxContext),
-    .read_probe     = iss_probe,
-    .read_header    = iss_read_header,
-    .read_packet    = iss_read_packet,
-};
diff --git a/deps/libav/libavformat/iv8.c b/deps/libav/libavformat/iv8.c
deleted file mode 100644
index 56909e3..0000000
--- a/deps/libav/libavformat/iv8.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2009 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-
-
-static int probe(AVProbeData *p)
-{
-    // the single file I have starts with that, I do not know if others do, too
-    if(   p->buf[0] == 1
-       && p->buf[1] == 1
-       && p->buf[2] == 3
-       && p->buf[3] == 0xB8
-       && p->buf[4] == 0x80
-       && p->buf[5] == 0x60
-      )
-        return AVPROBE_SCORE_MAX-2;
-
-    return 0;
-}
-
-static int read_header(AVFormatContext *s)
-{
-    AVStream *st;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_MPEG4;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-    avpriv_set_pts_info(st, 64, 1, 90000);
-
-    return 0;
-
-}
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, size, pts, type, flags;
-    int first_pkt      = 0;
-    int frame_complete = 0;
-
-    while (!frame_complete) {
-
-        type  = avio_rb16(s->pb); // 257 or 258
-        size  = avio_rb16(s->pb);
-        flags = avio_rb16(s->pb); //some flags, 0x80 indicates end of frame
-                avio_rb16(s->pb); //packet number
-        pts   = avio_rb32(s->pb);
-                avio_rb32(s->pb); //6A 13 E3 88
-
-        frame_complete = flags & 0x80;
-
-        size -= 12;
-        if (size < 1)
-            return -1;
-
-        if (type == 258) {
-            avio_skip(s->pb, size);
-            frame_complete = 0;
-            continue;
-        }
-
-        if (!first_pkt) {
-            ret = av_get_packet(s->pb, pkt, size);
-            if (ret < 0)
-                return ret;
-            first_pkt = 1;
-            pkt->pts  = pts;
-            pkt->pos -= 16;
-        } else {
-            ret = av_append_packet(s->pb, pkt, size);
-            if (ret < 0) {
-                av_log(s, AV_LOG_ERROR, "failed to grow packet\n");
-                av_free_packet(pkt);
-                return ret;
-            }
-        }
-        if (ret < size) {
-            av_log(s, AV_LOG_ERROR, "Truncated packet! Read %d of %d bytes\n",
-                   ret, size);
-            pkt->flags |= AV_PKT_FLAG_CORRUPT;
-            break;
-        }
-    }
-    pkt->stream_index = 0;
-
-    return 0;
-}
-
-AVInputFormat ff_iv8_demuxer = {
-    .name           = "iv8",
-    .long_name      = NULL_IF_CONFIG_SMALL("IndigoVision 8000 video"),
-    .read_probe     = probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/ivfdec.c b/deps/libav/libavformat/ivfdec.c
deleted file mode 100644
index b3555f4..0000000
--- a/deps/libav/libavformat/ivfdec.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2010 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "riff.h"
-#include "libavutil/intreadwrite.h"
-
-static int probe(AVProbeData *p)
-{
-    if (AV_RL32(p->buf) == MKTAG('D','K','I','F')
-        && !AV_RL16(p->buf+4) && AV_RL16(p->buf+6) == 32)
-        return AVPROBE_SCORE_MAX-2;
-
-    return 0;
-}
-
-static int read_header(AVFormatContext *s)
-{
-    AVStream *st;
-    AVRational time_base;
-
-    avio_rl32(s->pb); // DKIF
-    avio_rl16(s->pb); // version
-    avio_rl16(s->pb); // header size
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_tag  = avio_rl32(s->pb);
-    st->codec->codec_id   = ff_codec_get_id(ff_codec_bmp_tags, st->codec->codec_tag);
-    st->codec->width      = avio_rl16(s->pb);
-    st->codec->height     = avio_rl16(s->pb);
-    time_base.den         = avio_rl32(s->pb);
-    time_base.num         = avio_rl32(s->pb);
-    st->duration          = avio_rl64(s->pb);
-
-    st->need_parsing      = AVSTREAM_PARSE_HEADERS;
-
-    if (!time_base.den || !time_base.num) {
-        av_log(s, AV_LOG_ERROR, "Invalid frame rate\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avpriv_set_pts_info(st, 64, time_base.num, time_base.den);
-
-    return 0;
-}
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, size = avio_rl32(s->pb);
-    int64_t   pts = avio_rl64(s->pb);
-
-    ret = av_get_packet(s->pb, pkt, size);
-    pkt->stream_index = 0;
-    pkt->pts          = pts;
-    pkt->pos         -= 12;
-
-    return ret;
-}
-
-AVInputFormat ff_ivf_demuxer = {
-    .name           = "ivf",
-    .long_name      = NULL_IF_CONFIG_SMALL("On2 IVF"),
-    .read_probe     = probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .codec_tag      = (const AVCodecTag* const []){ ff_codec_bmp_tags, 0 },
-};
diff --git a/deps/libav/libavformat/ivfenc.c b/deps/libav/libavformat/ivfenc.c
deleted file mode 100644
index 3cd1616..0000000
--- a/deps/libav/libavformat/ivfenc.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2010 Reimar Döffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avformat.h"
-#include "libavutil/intreadwrite.h"
-
-static int ivf_write_header(AVFormatContext *s)
-{
-    AVCodecContext *ctx;
-    AVIOContext *pb = s->pb;
-
-    if (s->nb_streams != 1) {
-        av_log(s, AV_LOG_ERROR, "Format supports only exactly one video stream\n");
-        return AVERROR(EINVAL);
-    }
-    ctx = s->streams[0]->codec;
-    if (ctx->codec_type != AVMEDIA_TYPE_VIDEO || ctx->codec_id != AV_CODEC_ID_VP8) {
-        av_log(s, AV_LOG_ERROR, "Currently only VP8 is supported!\n");
-        return AVERROR(EINVAL);
-    }
-    avio_write(pb, "DKIF", 4);
-    avio_wl16(pb, 0); // version
-    avio_wl16(pb, 32); // header length
-    avio_wl32(pb, ctx->codec_tag ? ctx->codec_tag : AV_RL32("VP80"));
-    avio_wl16(pb, ctx->width);
-    avio_wl16(pb, ctx->height);
-    avio_wl32(pb, s->streams[0]->time_base.den);
-    avio_wl32(pb, s->streams[0]->time_base.num);
-    avio_wl64(pb, s->streams[0]->duration); // TODO: duration or number of frames?!?
-
-    return 0;
-}
-
-static int ivf_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    avio_wl32(pb, pkt->size);
-    avio_wl64(pb, pkt->pts);
-    avio_write(pb, pkt->data, pkt->size);
-
-    return 0;
-}
-
-AVOutputFormat ff_ivf_muxer = {
-    .name         = "ivf",
-    .long_name    = NULL_IF_CONFIG_SMALL("On2 IVF"),
-    .extensions   = "ivf",
-    .audio_codec  = AV_CODEC_ID_NONE,
-    .video_codec  = AV_CODEC_ID_VP8,
-    .write_header = ivf_write_header,
-    .write_packet = ivf_write_packet,
-};
diff --git a/deps/libav/libavformat/jvdec.c b/deps/libav/libavformat/jvdec.c
deleted file mode 100644
index 84d55da..0000000
--- a/deps/libav/libavformat/jvdec.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Bitmap Brothers JV demuxer
- * Copyright (c) 2005, 2011 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Bitmap Brothers JV demuxer
- * @author Peter Ross <pross at xvid.org>
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-
-#include "avformat.h"
-#include "internal.h"
-
-#define JV_PREAMBLE_SIZE 5
-
-typedef struct {
-    int audio_size;    /** audio packet size (bytes) */
-    int video_size;    /** video packet size (bytes) */
-    int palette_size;  /** palette size (bytes) */
-    int video_type;    /** per-frame video compression type */
-} JVFrame;
-
-typedef struct {
-    JVFrame *frames;
-    enum {
-        JV_AUDIO = 0,
-        JV_VIDEO,
-        JV_PADDING
-    } state;
-    int64_t pts;
-} JVDemuxContext;
-
-#define MAGIC " Compression by John M Phillips Copyright (C) 1995 The Bitmap Brothers Ltd."
-
-static int read_probe(AVProbeData *pd)
-{
-    if (pd->buf[0] == 'J' && pd->buf[1] == 'V' &&
-        !memcmp(pd->buf + 4, MAGIC, FFMIN(strlen(MAGIC), pd->buf_size - 4)))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int read_close(AVFormatContext *s)
-{
-    JVDemuxContext *jv = s->priv_data;
-
-    av_freep(&jv->frames);
-
-    return 0;
-}
-
-static int read_header(AVFormatContext *s)
-{
-    JVDemuxContext *jv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *vst, *ast;
-    int64_t audio_pts = 0;
-    int64_t offset;
-    int i;
-
-    avio_skip(pb, 80);
-
-    ast = avformat_new_stream(s, NULL);
-    vst = avformat_new_stream(s, NULL);
-    if (!ast || !vst)
-        return AVERROR(ENOMEM);
-
-    vst->codec->codec_type  = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_id    = AV_CODEC_ID_JV;
-    vst->codec->codec_tag   = 0; /* no fourcc */
-    vst->codec->width       = avio_rl16(pb);
-    vst->codec->height      = avio_rl16(pb);
-    vst->duration           =
-    vst->nb_frames          =
-    ast->nb_index_entries   = avio_rl16(pb);
-    avpriv_set_pts_info(vst, 64, avio_rl16(pb), 1000);
-
-    avio_skip(pb, 4);
-
-    ast->codec->codec_type     = AVMEDIA_TYPE_AUDIO;
-    ast->codec->codec_id       = AV_CODEC_ID_PCM_U8;
-    ast->codec->codec_tag      = 0; /* no fourcc */
-    ast->codec->sample_rate    = avio_rl16(pb);
-    ast->codec->channels       = 1;
-    ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
-
-    avio_skip(pb, 10);
-
-    ast->index_entries = av_malloc(ast->nb_index_entries *
-                                   sizeof(*ast->index_entries));
-    if (!ast->index_entries)
-        return AVERROR(ENOMEM);
-
-    jv->frames = av_malloc(ast->nb_index_entries * sizeof(JVFrame));
-    if (!jv->frames)
-        return AVERROR(ENOMEM);
-
-    offset = 0x68 + ast->nb_index_entries * 16;
-    for (i = 0; i < ast->nb_index_entries; i++) {
-        AVIndexEntry *e   = ast->index_entries + i;
-        JVFrame      *jvf = jv->frames + i;
-
-        /* total frame size including audio, video, palette data and padding */
-        e->size      = avio_rl32(pb);
-        e->timestamp = i;
-        e->pos       = offset;
-        offset      += e->size;
-
-        jvf->audio_size   = avio_rl32(pb);
-        jvf->video_size   = avio_rl32(pb);
-        jvf->palette_size = avio_r8(pb) ? 768 : 0;
-
-        if ((jvf->video_size | jvf->audio_size) & ~0xFFFFFF ||
-            e->size - jvf->audio_size
-                    - jvf->video_size
-                    - jvf->palette_size < 0) {
-            if (s->error_recognition & AV_EF_EXPLODE) {
-                read_close(s);
-                return AVERROR_INVALIDDATA;
-            }
-            jvf->audio_size   =
-            jvf->video_size   =
-            jvf->palette_size = 0;
-        }
-
-        if (avio_r8(pb))
-            av_log(s, AV_LOG_WARNING, "unsupported audio codec\n");
-
-        jvf->video_type = avio_r8(pb);
-        avio_skip(pb, 1);
-
-        e->timestamp = jvf->audio_size ? audio_pts : AV_NOPTS_VALUE;
-        audio_pts   += jvf->audio_size;
-
-        e->flags = jvf->video_type != 1 ? AVINDEX_KEYFRAME : 0;
-    }
-
-    jv->state = JV_AUDIO;
-    return 0;
-}
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    JVDemuxContext *jv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *ast = s->streams[0];
-
-    while (!s->pb->eof_reached && jv->pts < ast->nb_index_entries) {
-        const AVIndexEntry *e   = ast->index_entries + jv->pts;
-        const JVFrame      *jvf = jv->frames + jv->pts;
-
-        switch (jv->state) {
-        case JV_AUDIO:
-            jv->state++;
-            if (jvf->audio_size) {
-                if (av_get_packet(s->pb, pkt, jvf->audio_size) < 0)
-                    return AVERROR(ENOMEM);
-                pkt->stream_index = 0;
-                pkt->pts          = e->timestamp;
-                pkt->flags       |= AV_PKT_FLAG_KEY;
-                return 0;
-            }
-        case JV_VIDEO:
-            jv->state++;
-            if (jvf->video_size || jvf->palette_size) {
-                int ret;
-                int size = jvf->video_size + jvf->palette_size;
-                if (av_new_packet(pkt, size + JV_PREAMBLE_SIZE))
-                    return AVERROR(ENOMEM);
-
-                AV_WL32(pkt->data, jvf->video_size);
-                pkt->data[4] = jvf->video_type;
-                ret = avio_read(pb, pkt->data + JV_PREAMBLE_SIZE, size);
-                if (ret < 0)
-                    return ret;
-                if (ret < size) {
-                    memset(pkt->data + JV_PREAMBLE_SIZE + ret, 0,
-                           FF_INPUT_BUFFER_PADDING_SIZE);
-                    pkt->flags |= AV_PKT_FLAG_CORRUPT;
-                }
-                pkt->size         = ret + JV_PREAMBLE_SIZE;
-                pkt->stream_index = 1;
-                pkt->pts          = jv->pts;
-                if (jvf->video_type != 1)
-                    pkt->flags |= AV_PKT_FLAG_KEY;
-                return 0;
-            }
-        case JV_PADDING:
-            avio_skip(pb, FFMAX(e->size - jvf->audio_size - jvf->video_size
-                                        - jvf->palette_size, 0));
-            jv->state = JV_AUDIO;
-            jv->pts++;
-        }
-    }
-
-    if (s->pb->eof_reached)
-        return AVERROR_EOF;
-
-    return AVERROR(EIO);
-}
-
-static int read_seek(AVFormatContext *s, int stream_index,
-                     int64_t ts, int flags)
-{
-    JVDemuxContext *jv = s->priv_data;
-    AVStream *ast = s->streams[0];
-    int i;
-
-    if (flags & (AVSEEK_FLAG_BYTE | AVSEEK_FLAG_FRAME))
-        return AVERROR(ENOSYS);
-
-    switch (stream_index) {
-    case 0:
-        i = av_index_search_timestamp(ast, ts, flags);
-        break;
-    case 1:
-        i = ts;
-        break;
-    default:
-        return 0;
-    }
-
-    if (i < 0 || i >= ast->nb_index_entries)
-        return 0;
-    if (avio_seek(s->pb, ast->index_entries[i].pos, SEEK_SET) < 0)
-        return -1;
-
-    jv->state = JV_AUDIO;
-    jv->pts   = i;
-    return 0;
-}
-
-AVInputFormat ff_jv_demuxer = {
-    .name           = "jv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Bitmap Brothers JV"),
-    .priv_data_size = sizeof(JVDemuxContext),
-    .read_probe     = read_probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .read_seek      = read_seek,
-    .read_close     = read_close,
-};
diff --git a/deps/libav/libavformat/latmenc.c b/deps/libav/libavformat/latmenc.c
deleted file mode 100644
index 7270292..0000000
--- a/deps/libav/libavformat/latmenc.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * LATM/LOAS muxer
- * Copyright (c) 2011 Kieran Kunhya <kieran at kunhya.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/get_bits.h"
-#include "libavcodec/put_bits.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/mpeg4audio.h"
-#include "libavutil/opt.h"
-#include "avformat.h"
-
-typedef struct {
-    AVClass *av_class;
-    int off;
-    int channel_conf;
-    int object_type;
-    int counter;
-    int mod;
-} LATMContext;
-
-static const AVOption options[] = {
-    {"smc-interval", "StreamMuxConfig interval.",
-     offsetof(LATMContext, mod), AV_OPT_TYPE_INT, {.i64 = 0x0014}, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
-    {NULL},
-};
-
-static const AVClass latm_muxer_class = {
-    .class_name = "LATM/LOAS muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static int latm_decode_extradata(LATMContext *ctx, uint8_t *buf, int size)
-{
-    GetBitContext gb;
-    MPEG4AudioConfig m4ac;
-
-    init_get_bits(&gb, buf, size * 8);
-    ctx->off = avpriv_mpeg4audio_get_config(&m4ac, buf, size * 8, 1);
-    if (ctx->off < 0)
-        return ctx->off;
-    skip_bits_long(&gb, ctx->off);
-
-    /* FIXME: are any formats not allowed in LATM? */
-
-    if (m4ac.object_type > AOT_SBR && m4ac.object_type != AOT_ALS) {
-        av_log(ctx, AV_LOG_ERROR, "Muxing MPEG-4 AOT %d in LATM is not supported\n", m4ac.object_type);
-        return AVERROR_INVALIDDATA;
-    }
-    ctx->channel_conf = m4ac.chan_config;
-    ctx->object_type  = m4ac.object_type;
-
-    return 0;
-}
-
-static int latm_write_header(AVFormatContext *s)
-{
-    LATMContext *ctx = s->priv_data;
-    AVCodecContext *avctx = s->streams[0]->codec;
-
-    if (avctx->extradata_size > 0 &&
-        latm_decode_extradata(ctx, avctx->extradata, avctx->extradata_size) < 0)
-        return AVERROR_INVALIDDATA;
-
-    return 0;
-}
-
-static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
-{
-    LATMContext *ctx = s->priv_data;
-    AVCodecContext *avctx = s->streams[0]->codec;
-    GetBitContext gb;
-    int header_size;
-
-    /* AudioMuxElement */
-    put_bits(bs, 1, !!ctx->counter);
-
-    if (!ctx->counter) {
-        init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8);
-
-        /* StreamMuxConfig */
-        put_bits(bs, 1, 0); /* audioMuxVersion */
-        put_bits(bs, 1, 1); /* allStreamsSameTimeFraming */
-        put_bits(bs, 6, 0); /* numSubFrames */
-        put_bits(bs, 4, 0); /* numProgram */
-        put_bits(bs, 3, 0); /* numLayer */
-
-        /* AudioSpecificConfig */
-        if (ctx->object_type == AOT_ALS) {
-            header_size = avctx->extradata_size-(ctx->off + 7) >> 3;
-            avpriv_copy_bits(bs, &avctx->extradata[ctx->off], header_size);
-        } else {
-            avpriv_copy_bits(bs, avctx->extradata, ctx->off + 3);
-
-            if (!ctx->channel_conf) {
-                avpriv_copy_pce_data(bs, &gb);
-            }
-        }
-
-        put_bits(bs, 3, 0); /* frameLengthType */
-        put_bits(bs, 8, 0xff); /* latmBufferFullness */
-
-        put_bits(bs, 1, 0); /* otherDataPresent */
-        put_bits(bs, 1, 0); /* crcCheckPresent */
-    }
-
-    ctx->counter++;
-    ctx->counter %= ctx->mod;
-
-    return 0;
-}
-
-static int latm_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    PutBitContext bs;
-    int i, len;
-    uint8_t loas_header[] = "\x56\xe0\x00";
-    uint8_t *buf;
-
-    if (pkt->size > 2 && pkt->data[0] == 0xff && (pkt->data[1] >> 4) == 0xf) {
-        av_log(s, AV_LOG_ERROR, "ADTS header detected - ADTS will not be incorrectly muxed into LATM\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    buf = av_malloc(pkt->size+1024);
-    if (!buf)
-        return AVERROR(ENOMEM);
-
-    init_put_bits(&bs, buf, pkt->size+1024);
-
-    latm_write_frame_header(s, &bs);
-
-    /* PayloadLengthInfo() */
-    for (i = 0; i <= pkt->size-255; i+=255)
-        put_bits(&bs, 8, 255);
-
-    put_bits(&bs, 8, pkt->size-i);
-
-    /* The LATM payload is written unaligned */
-
-    /* PayloadMux() */
-    for (i = 0; i < pkt->size; i++)
-        put_bits(&bs, 8, pkt->data[i]);
-
-    avpriv_align_put_bits(&bs);
-    flush_put_bits(&bs);
-
-    len = put_bits_count(&bs) >> 3;
-
-    loas_header[1] |= (len >> 8) & 0x1f;
-    loas_header[2] |= len & 0xff;
-
-    avio_write(pb, loas_header, 3);
-    avio_write(pb, buf, len);
-
-    av_free(buf);
-
-    return 0;
-}
-
-AVOutputFormat ff_latm_muxer = {
-    .name           = "latm",
-    .long_name      = NULL_IF_CONFIG_SMALL("LOAS/LATM"),
-    .mime_type      = "audio/MP4A-LATM",
-    .extensions     = "latm",
-    .priv_data_size = sizeof(LATMContext),
-    .audio_codec    = AV_CODEC_ID_AAC,
-    .video_codec    = AV_CODEC_ID_NONE,
-    .write_header   = latm_write_header,
-    .write_packet   = latm_write_packet,
-    .priv_class     = &latm_muxer_class,
-};
diff --git a/deps/libav/libavformat/libavformat.v b/deps/libav/libavformat/libavformat.v
deleted file mode 100644
index 6f11d60..0000000
--- a/deps/libav/libavformat/libavformat.v
+++ /dev/null
@@ -1,4 +0,0 @@
-LIBAVFORMAT_$MAJOR {
-        global: av*;
-        local: *;
-};
diff --git a/deps/libav/libavformat/librtmp.c b/deps/libav/libavformat/librtmp.c
deleted file mode 100644
index 7133bd6..0000000
--- a/deps/libav/libavformat/librtmp.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * RTMP network protocol
- * Copyright (c) 2010 Howard Chu
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RTMP protocol based on http://rtmpdump.mplayerhq.hu/ librtmp
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "avformat.h"
-#include "url.h"
-
-#include <librtmp/rtmp.h>
-#include <librtmp/log.h>
-
-typedef struct LibRTMPContext {
-    const AVClass *class;
-    RTMP rtmp;
-    char *app;
-    char *playpath;
-} LibRTMPContext;
-
-static void rtmp_log(int level, const char *fmt, va_list args)
-{
-    switch (level) {
-    default:
-    case RTMP_LOGCRIT:    level = AV_LOG_FATAL;   break;
-    case RTMP_LOGERROR:   level = AV_LOG_ERROR;   break;
-    case RTMP_LOGWARNING: level = AV_LOG_WARNING; break;
-    case RTMP_LOGINFO:    level = AV_LOG_INFO;    break;
-    case RTMP_LOGDEBUG:   level = AV_LOG_VERBOSE; break;
-    case RTMP_LOGDEBUG2:  level = AV_LOG_DEBUG;   break;
-    }
-
-    av_vlog(NULL, level, fmt, args);
-    av_log(NULL, level, "\n");
-}
-
-static int rtmp_close(URLContext *s)
-{
-    LibRTMPContext *ctx = s->priv_data;
-    RTMP *r = &ctx->rtmp;
-
-    RTMP_Close(r);
-    return 0;
-}
-
-/**
- * Open RTMP connection and verify that the stream can be played.
- *
- * URL syntax: rtmp://server[:port][/app][/playpath][ keyword=value]...
- *             where 'app' is first one or two directories in the path
- *             (e.g. /ondemand/, /flash/live/, etc.)
- *             and 'playpath' is a file name (the rest of the path,
- *             may be prefixed with "mp4:")
- *
- *             Additional RTMP library options may be appended as
- *             space-separated key-value pairs.
- */
-static int rtmp_open(URLContext *s, const char *uri, int flags)
-{
-    LibRTMPContext *ctx = s->priv_data;
-    RTMP *r = &ctx->rtmp;
-    int rc = 0, level;
-    char *filename = s->filename;
-
-    switch (av_log_get_level()) {
-    default:
-    case AV_LOG_FATAL:   level = RTMP_LOGCRIT;    break;
-    case AV_LOG_ERROR:   level = RTMP_LOGERROR;   break;
-    case AV_LOG_WARNING: level = RTMP_LOGWARNING; break;
-    case AV_LOG_INFO:    level = RTMP_LOGINFO;    break;
-    case AV_LOG_VERBOSE: level = RTMP_LOGDEBUG;   break;
-    case AV_LOG_DEBUG:   level = RTMP_LOGDEBUG2;  break;
-    }
-    RTMP_LogSetLevel(level);
-    RTMP_LogSetCallback(rtmp_log);
-
-    if (ctx->app || ctx->playpath) {
-        int len = strlen(s->filename) + 1;
-        if (ctx->app)      len += strlen(ctx->app)      + sizeof(" app=");
-        if (ctx->playpath) len += strlen(ctx->playpath) + sizeof(" playpath=");
-
-        if (!(filename = av_malloc(len)))
-            return AVERROR(ENOMEM);
-
-        av_strlcpy(filename, s->filename, len);
-        if (ctx->app) {
-            av_strlcat(filename, " app=", len);
-            av_strlcat(filename, ctx->app, len);
-        }
-        if (ctx->playpath) {
-            av_strlcat(filename, " playpath=", len);
-            av_strlcat(filename, ctx->playpath, len);
-        }
-    }
-
-    RTMP_Init(r);
-    if (!RTMP_SetupURL(r, filename)) {
-        rc = AVERROR_UNKNOWN;
-        goto fail;
-    }
-
-    if (flags & AVIO_FLAG_WRITE)
-        RTMP_EnableWrite(r);
-
-    if (!RTMP_Connect(r, NULL) || !RTMP_ConnectStream(r, 0)) {
-        rc = AVERROR_UNKNOWN;
-        goto fail;
-    }
-
-    s->is_streamed = 1;
-    rc = 0;
-fail:
-    if (filename != s->filename)
-        av_freep(&filename);
-    return rc;
-}
-
-static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
-{
-    LibRTMPContext *ctx = s->priv_data;
-    RTMP *r = &ctx->rtmp;
-
-    return RTMP_Write(r, buf, size);
-}
-
-static int rtmp_read(URLContext *s, uint8_t *buf, int size)
-{
-    LibRTMPContext *ctx = s->priv_data;
-    RTMP *r = &ctx->rtmp;
-
-    return RTMP_Read(r, buf, size);
-}
-
-static int rtmp_read_pause(URLContext *s, int pause)
-{
-    LibRTMPContext *ctx = s->priv_data;
-    RTMP *r = &ctx->rtmp;
-
-    if (!RTMP_Pause(r, pause))
-        return AVERROR_UNKNOWN;
-    return 0;
-}
-
-static int64_t rtmp_read_seek(URLContext *s, int stream_index,
-                              int64_t timestamp, int flags)
-{
-    LibRTMPContext *ctx = s->priv_data;
-    RTMP *r = &ctx->rtmp;
-
-    if (flags & AVSEEK_FLAG_BYTE)
-        return AVERROR(ENOSYS);
-
-    /* seeks are in milliseconds */
-    if (stream_index < 0)
-        timestamp = av_rescale_rnd(timestamp, 1000, AV_TIME_BASE,
-            flags & AVSEEK_FLAG_BACKWARD ? AV_ROUND_DOWN : AV_ROUND_UP);
-
-    if (!RTMP_SendSeek(r, timestamp))
-        return AVERROR_UNKNOWN;
-    return timestamp;
-}
-
-static int rtmp_get_file_handle(URLContext *s)
-{
-    LibRTMPContext *ctx = s->priv_data;
-    RTMP *r = &ctx->rtmp;
-
-    return RTMP_Socket(r);
-}
-
-#define OFFSET(x) offsetof(LibRTMPContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-#define ENC AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    {"rtmp_app",      "Name of application to connect to on the RTMP server", OFFSET(app),      AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
-    {"rtmp_playpath", "Stream identifier to play or to publish",              OFFSET(playpath), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
-    { NULL },
-};
-
-#define RTMP_CLASS(flavor)\
-static const AVClass lib ## flavor ## _class = {\
-    .class_name = "lib" #flavor " protocol",\
-    .item_name  = av_default_item_name,\
-    .option     = options,\
-    .version    = LIBAVUTIL_VERSION_INT,\
-};
-
-RTMP_CLASS(rtmp)
-URLProtocol ff_librtmp_protocol = {
-    .name                = "rtmp",
-    .url_open            = rtmp_open,
-    .url_read            = rtmp_read,
-    .url_write           = rtmp_write,
-    .url_close           = rtmp_close,
-    .url_read_pause      = rtmp_read_pause,
-    .url_read_seek       = rtmp_read_seek,
-    .url_get_file_handle = rtmp_get_file_handle,
-    .priv_data_size      = sizeof(LibRTMPContext),
-    .priv_data_class     = &librtmp_class,
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
-
-RTMP_CLASS(rtmpt)
-URLProtocol ff_librtmpt_protocol = {
-    .name                = "rtmpt",
-    .url_open            = rtmp_open,
-    .url_read            = rtmp_read,
-    .url_write           = rtmp_write,
-    .url_close           = rtmp_close,
-    .url_read_pause      = rtmp_read_pause,
-    .url_read_seek       = rtmp_read_seek,
-    .url_get_file_handle = rtmp_get_file_handle,
-    .priv_data_size      = sizeof(LibRTMPContext),
-    .priv_data_class     = &librtmpt_class,
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
-
-RTMP_CLASS(rtmpe)
-URLProtocol ff_librtmpe_protocol = {
-    .name                = "rtmpe",
-    .url_open            = rtmp_open,
-    .url_read            = rtmp_read,
-    .url_write           = rtmp_write,
-    .url_close           = rtmp_close,
-    .url_read_pause      = rtmp_read_pause,
-    .url_read_seek       = rtmp_read_seek,
-    .url_get_file_handle = rtmp_get_file_handle,
-    .priv_data_size      = sizeof(LibRTMPContext),
-    .priv_data_class     = &librtmpe_class,
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
-
-RTMP_CLASS(rtmpte)
-URLProtocol ff_librtmpte_protocol = {
-    .name                = "rtmpte",
-    .url_open            = rtmp_open,
-    .url_read            = rtmp_read,
-    .url_write           = rtmp_write,
-    .url_close           = rtmp_close,
-    .url_read_pause      = rtmp_read_pause,
-    .url_read_seek       = rtmp_read_seek,
-    .url_get_file_handle = rtmp_get_file_handle,
-    .priv_data_size      = sizeof(LibRTMPContext),
-    .priv_data_class     = &librtmpte_class,
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
-
-RTMP_CLASS(rtmps)
-URLProtocol ff_librtmps_protocol = {
-    .name                = "rtmps",
-    .url_open            = rtmp_open,
-    .url_read            = rtmp_read,
-    .url_write           = rtmp_write,
-    .url_close           = rtmp_close,
-    .url_read_pause      = rtmp_read_pause,
-    .url_read_seek       = rtmp_read_seek,
-    .url_get_file_handle = rtmp_get_file_handle,
-    .priv_data_size      = sizeof(LibRTMPContext),
-    .priv_data_class     = &librtmps_class,
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/lmlm4.c b/deps/libav/libavformat/lmlm4.c
deleted file mode 100644
index b67b68e..0000000
--- a/deps/libav/libavformat/lmlm4.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Linux Media Labs MPEG-4 demuxer
- * Copyright (c) 2008 Ivo van Poorten
- *
- * Due to a lack of sample files, only files with one channel are supported.
- * u-law and ADPCM audio are unsupported for the same reason.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define LMLM4_I_FRAME   0x00
-#define LMLM4_P_FRAME   0x01
-#define LMLM4_B_FRAME   0x02
-#define LMLM4_INVALID   0x03
-#define LMLM4_MPEG1L2   0x04
-
-#define LMLM4_MAX_PACKET_SIZE   1024 * 1024
-
-static int lmlm4_probe(AVProbeData * pd) {
-    unsigned char *buf = pd->buf;
-    unsigned int frame_type, packet_size;
-
-    frame_type  = AV_RB16(buf+2);
-    packet_size = AV_RB32(buf+4);
-
-    if (!AV_RB16(buf) && frame_type <= LMLM4_MPEG1L2 && packet_size &&
-        frame_type != LMLM4_INVALID && packet_size <= LMLM4_MAX_PACKET_SIZE) {
-
-        if (frame_type == LMLM4_MPEG1L2) {
-            if ((AV_RB16(buf+8) & 0xfffe) != 0xfffc)
-                return 0;
-            /* I could calculate the audio framesize and compare with
-             * packet_size-8, but that seems overkill */
-            return AVPROBE_SCORE_MAX / 3;
-        } else if (AV_RB24(buf+8) == 0x000001) {    /* PES Signal */
-            return AVPROBE_SCORE_MAX / 5;
-        }
-    }
-
-    return 0;
-}
-
-static int lmlm4_read_header(AVFormatContext *s) {
-    AVStream *st;
-
-    if (!(st = avformat_new_stream(s, NULL)))
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_MPEG4;
-    st->need_parsing      = AVSTREAM_PARSE_HEADERS;
-    avpriv_set_pts_info(st, 64, 1001, 30000);
-
-    if (!(st = avformat_new_stream(s, NULL)))
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id   = AV_CODEC_ID_MP2;
-    st->need_parsing      = AVSTREAM_PARSE_HEADERS;
-
-    /* the parameters will be extracted from the compressed bitstream */
-    return 0;
-}
-
-static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) {
-    AVIOContext *pb = s->pb;
-    int ret;
-    unsigned int frame_type, packet_size, padding, frame_size;
-
-    avio_rb16(pb);                       /* channel number */
-    frame_type  = avio_rb16(pb);
-    packet_size = avio_rb32(pb);
-    padding     = -packet_size & 511;
-    frame_size  = packet_size - 8;
-
-    if (frame_type > LMLM4_MPEG1L2 || frame_type == LMLM4_INVALID) {
-        av_log(s, AV_LOG_ERROR, "invalid or unsupported frame_type\n");
-        return AVERROR(EIO);
-    }
-    if (packet_size > LMLM4_MAX_PACKET_SIZE) {
-        av_log(s, AV_LOG_ERROR, "packet size exceeds maximum\n");
-        return AVERROR(EIO);
-    }
-
-    if ((ret = av_get_packet(pb, pkt, frame_size)) <= 0)
-        return AVERROR(EIO);
-
-    avio_skip(pb, padding);
-
-    switch (frame_type) {
-        case LMLM4_I_FRAME:
-            pkt->flags = AV_PKT_FLAG_KEY;
-        case LMLM4_P_FRAME:
-        case LMLM4_B_FRAME:
-            pkt->stream_index = 0;
-            break;
-        case LMLM4_MPEG1L2:
-            pkt->stream_index = 1;
-            break;
-    }
-
-    return ret;
-}
-
-AVInputFormat ff_lmlm4_demuxer = {
-    .name           = "lmlm4",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw lmlm4"),
-    .read_probe     = lmlm4_probe,
-    .read_header    = lmlm4_read_header,
-    .read_packet    = lmlm4_read_packet,
-};
diff --git a/deps/libav/libavformat/log2_tab.c b/deps/libav/libavformat/log2_tab.c
deleted file mode 100644
index 47a1df0..0000000
--- a/deps/libav/libavformat/log2_tab.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "libavutil/log2_tab.c"
diff --git a/deps/libav/libavformat/lxfdec.c b/deps/libav/libavformat/lxfdec.c
deleted file mode 100644
index 859fc71..0000000
--- a/deps/libav/libavformat/lxfdec.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * LXF demuxer
- * Copyright (c) 2010 Tomas Härdin
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define LXF_MAX_PACKET_HEADER_SIZE 256
-#define LXF_HEADER_DATA_SIZE    120
-#define LXF_IDENT               "LEITCH\0"
-#define LXF_IDENT_LENGTH        8
-#define LXF_SAMPLERATE          48000
-
-static const AVCodecTag lxf_tags[] = {
-    { AV_CODEC_ID_MJPEG,       0 },
-    { AV_CODEC_ID_MPEG1VIDEO,  1 },
-    { AV_CODEC_ID_MPEG2VIDEO,  2 },    //MpMl, 4:2:0
-    { AV_CODEC_ID_MPEG2VIDEO,  3 },    //MpPl, 4:2:2
-    { AV_CODEC_ID_DVVIDEO,     4 },    //DV25
-    { AV_CODEC_ID_DVVIDEO,     5 },    //DVCPRO
-    { AV_CODEC_ID_DVVIDEO,     6 },    //DVCPRO50
-    { AV_CODEC_ID_RAWVIDEO,    7 },    //AV_PIX_FMT_ARGB, where alpha is used for chroma keying
-    { AV_CODEC_ID_RAWVIDEO,    8 },    //16-bit chroma key
-    { AV_CODEC_ID_MPEG2VIDEO,  9 },    //4:2:2 CBP ("Constrained Bytes per Gop")
-    { AV_CODEC_ID_NONE,        0 },
-};
-
-typedef struct {
-    int channels;                       ///< number of audio channels. zero means no audio
-    int frame_number;                   ///< current video frame
-    uint32_t video_format, packet_type, extended_size;
-} LXFDemuxContext;
-
-static int lxf_probe(AVProbeData *p)
-{
-    if (!memcmp(p->buf, LXF_IDENT, LXF_IDENT_LENGTH))
-        return AVPROBE_SCORE_MAX;
-
-    return 0;
-}
-
-/**
- * Verify the checksum of an LXF packet header
- *
- * @param[in] header the packet header to check
- * @return zero if the checksum is OK, non-zero otherwise
- */
-static int check_checksum(const uint8_t *header, int size)
-{
-    int x;
-    uint32_t sum = 0;
-
-    for (x = 0; x < size; x += 4)
-        sum += AV_RL32(&header[x]);
-
-    return sum;
-}
-
-/**
- * Read input until we find the next ident. If found, copy it to the header buffer
- *
- * @param[out] header where to copy the ident to
- * @return 0 if an ident was found, < 0 on I/O error
- */
-static int sync(AVFormatContext *s, uint8_t *header)
-{
-    uint8_t buf[LXF_IDENT_LENGTH];
-    int ret;
-
-    if ((ret = avio_read(s->pb, buf, LXF_IDENT_LENGTH)) != LXF_IDENT_LENGTH)
-        return ret < 0 ? ret : AVERROR_EOF;
-
-    while (memcmp(buf, LXF_IDENT, LXF_IDENT_LENGTH)) {
-        if (s->pb->eof_reached)
-            return AVERROR_EOF;
-
-        memmove(buf, &buf[1], LXF_IDENT_LENGTH-1);
-        buf[LXF_IDENT_LENGTH-1] = avio_r8(s->pb);
-    }
-
-    memcpy(header, LXF_IDENT, LXF_IDENT_LENGTH);
-
-    return 0;
-}
-
-/**
- * Read and checksum the next packet header
- *
- * @return the size of the payload following the header or < 0 on failure
- */
-static int get_packet_header(AVFormatContext *s)
-{
-    LXFDemuxContext *lxf = s->priv_data;
-    AVIOContext   *pb  = s->pb;
-    int track_size, samples, ret;
-    uint32_t version, audio_format, header_size, channels, tmp;
-    AVStream *st;
-    uint8_t header[LXF_MAX_PACKET_HEADER_SIZE];
-    const uint8_t *p = header + LXF_IDENT_LENGTH;
-
-    //find and read the ident
-    if ((ret = sync(s, header)) < 0)
-        return ret;
-
-    ret = avio_read(pb, header + LXF_IDENT_LENGTH, 8);
-    if (ret != 8)
-        return ret < 0 ? ret : AVERROR_EOF;
-
-    version     = bytestream_get_le32(&p);
-    header_size = bytestream_get_le32(&p);
-    if (version > 1)
-        avpriv_request_sample(s, "Unknown format version %i\n", version);
-
-    if (header_size < (version ? 72 : 60) ||
-        header_size > LXF_MAX_PACKET_HEADER_SIZE ||
-        (header_size & 3)) {
-        av_log(s, AV_LOG_ERROR, "Invalid header size 0x%x\n", header_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    //read the rest of the packet header
-    ret = avio_read(pb, header + (p - header), header_size - (p - header));
-    if (ret != header_size - (p - header))
-        return ret < 0 ? ret : AVERROR_EOF;
-
-    if (check_checksum(header, header_size))
-        av_log(s, AV_LOG_ERROR, "checksum error\n");
-
-    lxf->packet_type = bytestream_get_le32(&p);
-    p += version ? 20 : 12;
-
-    lxf->extended_size = 0;
-    switch (lxf->packet_type) {
-    case 0:
-        //video
-        lxf->video_format = bytestream_get_le32(&p);
-        ret               = bytestream_get_le32(&p);
-        //skip VBI data and metadata
-        avio_skip(pb, (int64_t)(uint32_t)AV_RL32(p + 4) +
-                      (int64_t)(uint32_t)AV_RL32(p + 12));
-        break;
-    case 1:
-        //audio
-        if (s->nb_streams < 2) {
-            av_log(s, AV_LOG_INFO, "got audio packet, but no audio stream present\n");
-            break;
-        }
-
-        if (version == 0)
-            p += 8;
-        audio_format = bytestream_get_le32(&p);
-        channels     = bytestream_get_le32(&p);
-        track_size   = bytestream_get_le32(&p);
-
-        st = s->streams[1];
-
-        //set codec based on specified audio bitdepth
-        //we only support tightly packed 16-, 20-, 24- and 32-bit PCM at the moment
-        st->codec->bits_per_coded_sample = (audio_format >> 6) & 0x3F;
-
-        if (st->codec->bits_per_coded_sample != (audio_format & 0x3F)) {
-            av_log(s, AV_LOG_WARNING, "only tightly packed PCM currently supported\n");
-            return AVERROR_PATCHWELCOME;
-        }
-
-        switch (st->codec->bits_per_coded_sample) {
-        case 16: st->codec->codec_id = AV_CODEC_ID_PCM_S16LE_PLANAR; break;
-        case 20: st->codec->codec_id = AV_CODEC_ID_PCM_LXF;   break;
-        case 24: st->codec->codec_id = AV_CODEC_ID_PCM_S24LE_PLANAR; break;
-        case 32: st->codec->codec_id = AV_CODEC_ID_PCM_S32LE_PLANAR; break;
-        default:
-            av_log(s, AV_LOG_WARNING,
-                   "only 16-, 20-, 24- and 32-bit PCM currently supported\n");
-            return AVERROR_PATCHWELCOME;
-        }
-
-        samples = track_size * 8 / st->codec->bits_per_coded_sample;
-
-        //use audio packet size to determine video standard
-        //for NTSC we have one 8008-sample audio frame per five video frames
-        if (samples == LXF_SAMPLERATE * 5005 / 30000) {
-            avpriv_set_pts_info(s->streams[0], 64, 1001, 30000);
-        } else {
-            //assume PAL, but warn if we don't have 1920 samples
-            if (samples != LXF_SAMPLERATE / 25)
-                av_log(s, AV_LOG_WARNING,
-                       "video doesn't seem to be PAL or NTSC. guessing PAL\n");
-
-            avpriv_set_pts_info(s->streams[0], 64, 1, 25);
-        }
-
-        //TODO: warning if track mask != (1 << channels) - 1?
-        ret = av_popcount(channels) * track_size;
-
-        break;
-    default:
-        tmp = bytestream_get_le32(&p);
-        ret = bytestream_get_le32(&p);
-        if (tmp == 1)
-            lxf->extended_size = bytestream_get_le32(&p);
-        break;
-    }
-
-    return ret;
-}
-
-static int lxf_read_header(AVFormatContext *s)
-{
-    LXFDemuxContext *lxf = s->priv_data;
-    AVIOContext   *pb  = s->pb;
-    uint8_t header_data[LXF_HEADER_DATA_SIZE];
-    int ret;
-    AVStream *st;
-    uint32_t video_params, disk_params;
-    uint16_t record_date, expiration_date;
-
-    if ((ret = get_packet_header(s)) < 0)
-        return ret;
-
-    if (ret != LXF_HEADER_DATA_SIZE) {
-        av_log(s, AV_LOG_ERROR, "expected %d B size header, got %d\n",
-               LXF_HEADER_DATA_SIZE, ret);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = avio_read(pb, header_data, LXF_HEADER_DATA_SIZE)) != LXF_HEADER_DATA_SIZE)
-        return ret < 0 ? ret : AVERROR_EOF;
-
-    if (!(st = avformat_new_stream(s, NULL)))
-        return AVERROR(ENOMEM);
-
-    st->duration          = AV_RL32(&header_data[32]);
-    video_params          = AV_RL32(&header_data[40]);
-    record_date           = AV_RL16(&header_data[56]);
-    expiration_date       = AV_RL16(&header_data[58]);
-    disk_params           = AV_RL32(&header_data[116]);
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->bit_rate   = 1000000 * ((video_params >> 14) & 0xFF);
-    st->codec->codec_tag  = video_params & 0xF;
-    st->codec->codec_id   = ff_codec_get_id(lxf_tags, st->codec->codec_tag);
-
-    av_log(s, AV_LOG_DEBUG, "record: %x = %i-%02i-%02i\n",
-           record_date, 1900 + (record_date & 0x7F), (record_date >> 7) & 0xF,
-           (record_date >> 11) & 0x1F);
-
-    av_log(s, AV_LOG_DEBUG, "expire: %x = %i-%02i-%02i\n",
-           expiration_date, 1900 + (expiration_date & 0x7F), (expiration_date >> 7) & 0xF,
-           (expiration_date >> 11) & 0x1F);
-
-    if ((video_params >> 22) & 1)
-        av_log(s, AV_LOG_WARNING, "VBI data not yet supported\n");
-
-    if ((lxf->channels = 1 << (disk_params >> 4 & 3) + 1)) {
-        if (!(st = avformat_new_stream(s, NULL)))
-            return AVERROR(ENOMEM);
-
-        st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-        st->codec->sample_rate = LXF_SAMPLERATE;
-        st->codec->channels    = lxf->channels;
-
-        avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    }
-
-    avio_skip(s->pb, lxf->extended_size);
-
-    return 0;
-}
-
-static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    LXFDemuxContext *lxf = s->priv_data;
-    AVIOContext   *pb  = s->pb;
-    uint32_t stream;
-    int ret, ret2;
-
-    if ((ret = get_packet_header(s)) < 0)
-        return ret;
-
-    stream = lxf->packet_type;
-
-    if (stream > 1) {
-        av_log(s, AV_LOG_WARNING, "got packet with illegal stream index %u\n", stream);
-        return AVERROR(EAGAIN);
-    }
-
-    if (stream == 1 && s->nb_streams < 2) {
-        av_log(s, AV_LOG_ERROR, "got audio packet without having an audio stream\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret2 = av_new_packet(pkt, ret)) < 0)
-        return ret2;
-
-    if ((ret2 = avio_read(pb, pkt->data, ret)) != ret) {
-        av_free_packet(pkt);
-        return ret2 < 0 ? ret2 : AVERROR_EOF;
-    }
-
-    pkt->stream_index = stream;
-
-    if (!stream) {
-        //picture type (0 = closed I, 1 = open I, 2 = P, 3 = B)
-        if (((lxf->video_format >> 22) & 0x3) < 2)
-            pkt->flags |= AV_PKT_FLAG_KEY;
-
-        pkt->dts = lxf->frame_number++;
-    }
-
-    return ret;
-}
-
-AVInputFormat ff_lxf_demuxer = {
-    .name           = "lxf",
-    .long_name      = NULL_IF_CONFIG_SMALL("VR native stream (LXF)"),
-    .priv_data_size = sizeof(LXFDemuxContext),
-    .read_probe     = lxf_probe,
-    .read_header    = lxf_read_header,
-    .read_packet    = lxf_read_packet,
-    .codec_tag      = (const AVCodecTag* const []){lxf_tags, 0},
-};
diff --git a/deps/libav/libavformat/m4vdec.c b/deps/libav/libavformat/m4vdec.c
deleted file mode 100644
index 04bd062..0000000
--- a/deps/libav/libavformat/m4vdec.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * RAW MPEG-4 video demuxer
- * Copyright (c) 2006  Thijs Vermeir <thijs.vermeir at barco.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawdec.h"
-
-#define VISUAL_OBJECT_START_CODE       0x000001b5
-#define VOP_START_CODE                 0x000001b6
-
-static int mpeg4video_probe(AVProbeData *probe_packet)
-{
-    uint32_t temp_buffer= -1;
-    int VO=0, VOL=0, VOP = 0, VISO = 0, res=0;
-    int i;
-
-    for(i=0; i<probe_packet->buf_size; i++){
-        temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
-        if ((temp_buffer & 0xffffff00) != 0x100)
-            continue;
-
-        if (temp_buffer == VOP_START_CODE)                         VOP++;
-        else if (temp_buffer == VISUAL_OBJECT_START_CODE)          VISO++;
-        else if (temp_buffer < 0x120)                              VO++;
-        else if (temp_buffer < 0x130)                              VOL++;
-        else if (   !(0x1AF < temp_buffer && temp_buffer < 0x1B7)
-                 && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++;
-    }
-
-    if (VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res==0)
-        return AVPROBE_SCORE_EXTENSION;
-    return 0;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(m4v, "raw MPEG-4 video", mpeg4video_probe, "m4v", AV_CODEC_ID_MPEG4)
diff --git a/deps/libav/libavformat/matroska.c b/deps/libav/libavformat/matroska.c
deleted file mode 100644
index 9628abc..0000000
--- a/deps/libav/libavformat/matroska.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Matroska common data
- * Copyright (c) 2003-2004 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "matroska.h"
-
-const CodecTags ff_mkv_codec_tags[]={
-    {"A_AAC"            , AV_CODEC_ID_AAC},
-    {"A_AC3"            , AV_CODEC_ID_AC3},
-    {"A_ALAC"           , AV_CODEC_ID_ALAC},
-    {"A_DTS"            , AV_CODEC_ID_DTS},
-    {"A_EAC3"           , AV_CODEC_ID_EAC3},
-    {"A_FLAC"           , AV_CODEC_ID_FLAC},
-    {"A_MLP"            , AV_CODEC_ID_MLP},
-    {"A_MPEG/L2"        , AV_CODEC_ID_MP2},
-    {"A_MPEG/L1"        , AV_CODEC_ID_MP2},
-    {"A_MPEG/L3"        , AV_CODEC_ID_MP3},
-    {"A_OPUS"           , AV_CODEC_ID_OPUS},
-    {"A_PCM/FLOAT/IEEE" , AV_CODEC_ID_PCM_F32LE},
-    {"A_PCM/FLOAT/IEEE" , AV_CODEC_ID_PCM_F64LE},
-    {"A_PCM/INT/BIG"    , AV_CODEC_ID_PCM_S16BE},
-    {"A_PCM/INT/BIG"    , AV_CODEC_ID_PCM_S24BE},
-    {"A_PCM/INT/BIG"    , AV_CODEC_ID_PCM_S32BE},
-    {"A_PCM/INT/LIT"    , AV_CODEC_ID_PCM_S16LE},
-    {"A_PCM/INT/LIT"    , AV_CODEC_ID_PCM_S24LE},
-    {"A_PCM/INT/LIT"    , AV_CODEC_ID_PCM_S32LE},
-    {"A_PCM/INT/LIT"    , AV_CODEC_ID_PCM_U8},
-    {"A_QUICKTIME/QDM2" , AV_CODEC_ID_QDM2},
-    {"A_REAL/14_4"      , AV_CODEC_ID_RA_144},
-    {"A_REAL/28_8"      , AV_CODEC_ID_RA_288},
-    {"A_REAL/ATRC"      , AV_CODEC_ID_ATRAC3},
-    {"A_REAL/COOK"      , AV_CODEC_ID_COOK},
-    {"A_REAL/SIPR"      , AV_CODEC_ID_SIPR},
-    {"A_TRUEHD"         , AV_CODEC_ID_TRUEHD},
-    {"A_TTA1"           , AV_CODEC_ID_TTA},
-    {"A_VORBIS"         , AV_CODEC_ID_VORBIS},
-    {"A_WAVPACK4"       , AV_CODEC_ID_WAVPACK},
-
-    {"S_TEXT/UTF8"      , AV_CODEC_ID_TEXT},
-    {"S_TEXT/UTF8"      , AV_CODEC_ID_SRT},
-    {"S_TEXT/ASCII"     , AV_CODEC_ID_TEXT},
-    {"S_TEXT/ASS"       , AV_CODEC_ID_SSA},
-    {"S_TEXT/SSA"       , AV_CODEC_ID_SSA},
-    {"S_ASS"            , AV_CODEC_ID_SSA},
-    {"S_SSA"            , AV_CODEC_ID_SSA},
-    {"S_VOBSUB"         , AV_CODEC_ID_DVD_SUBTITLE},
-    {"S_HDMV/PGS"       , AV_CODEC_ID_HDMV_PGS_SUBTITLE},
-
-    {"V_DIRAC"          , AV_CODEC_ID_DIRAC},
-    {"V_MJPEG"          , AV_CODEC_ID_MJPEG},
-    {"V_MPEG1"          , AV_CODEC_ID_MPEG1VIDEO},
-    {"V_MPEG2"          , AV_CODEC_ID_MPEG2VIDEO},
-    {"V_MPEG4/ISO/ASP"  , AV_CODEC_ID_MPEG4},
-    {"V_MPEG4/ISO/AP"   , AV_CODEC_ID_MPEG4},
-    {"V_MPEG4/ISO/SP"   , AV_CODEC_ID_MPEG4},
-    {"V_MPEG4/ISO/AVC"  , AV_CODEC_ID_H264},
-    {"V_MPEGH/ISO/HEVC" , AV_CODEC_ID_HEVC},
-    {"V_MPEG4/MS/V3"    , AV_CODEC_ID_MSMPEG4V3},
-    {"V_PRORES"         , AV_CODEC_ID_PRORES},
-    {"V_REAL/RV10"      , AV_CODEC_ID_RV10},
-    {"V_REAL/RV20"      , AV_CODEC_ID_RV20},
-    {"V_REAL/RV30"      , AV_CODEC_ID_RV30},
-    {"V_REAL/RV40"      , AV_CODEC_ID_RV40},
-    {"V_THEORA"         , AV_CODEC_ID_THEORA},
-    {"V_UNCOMPRESSED"   , AV_CODEC_ID_RAWVIDEO},
-    {"V_VP8"            , AV_CODEC_ID_VP8},
-    {"V_VP9"            , AV_CODEC_ID_VP9},
-
-    {""                 , AV_CODEC_ID_NONE}
-};
-
-const CodecMime ff_mkv_mime_tags[] = {
-    {"text/plain"                 , AV_CODEC_ID_TEXT},
-    {"image/gif"                  , AV_CODEC_ID_GIF},
-    {"image/jpeg"                 , AV_CODEC_ID_MJPEG},
-    {"image/png"                  , AV_CODEC_ID_PNG},
-    {"image/tiff"                 , AV_CODEC_ID_TIFF},
-    {"application/x-truetype-font", AV_CODEC_ID_TTF},
-    {"application/x-font"         , AV_CODEC_ID_TTF},
-
-    {""                           , AV_CODEC_ID_NONE}
-};
-
-const AVMetadataConv ff_mkv_metadata_conv[] = {
-    { "LEAD_PERFORMER", "performer" },
-    { "PART_NUMBER"   , "track"  },
-    { 0 }
-};
diff --git a/deps/libav/libavformat/matroska.h b/deps/libav/libavformat/matroska.h
deleted file mode 100644
index 667f92a..0000000
--- a/deps/libav/libavformat/matroska.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Matroska constants
- * Copyright (c) 2003-2004 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_MATROSKA_H
-#define AVFORMAT_MATROSKA_H
-
-#include "libavcodec/avcodec.h"
-#include "metadata.h"
-#include "internal.h"
-
-/* EBML version supported */
-#define EBML_VERSION 1
-
-/* top-level master-IDs */
-#define EBML_ID_HEADER             0x1A45DFA3
-
-/* IDs in the HEADER master */
-#define EBML_ID_EBMLVERSION        0x4286
-#define EBML_ID_EBMLREADVERSION    0x42F7
-#define EBML_ID_EBMLMAXIDLENGTH    0x42F2
-#define EBML_ID_EBMLMAXSIZELENGTH  0x42F3
-#define EBML_ID_DOCTYPE            0x4282
-#define EBML_ID_DOCTYPEVERSION     0x4287
-#define EBML_ID_DOCTYPEREADVERSION 0x4285
-
-/* general EBML types */
-#define EBML_ID_VOID               0xEC
-#define EBML_ID_CRC32              0xBF
-
-/*
- * Matroska element IDs, max. 32 bits
- */
-
-/* toplevel segment */
-#define MATROSKA_ID_SEGMENT    0x18538067
-
-/* Matroska top-level master IDs */
-#define MATROSKA_ID_INFO       0x1549A966
-#define MATROSKA_ID_TRACKS     0x1654AE6B
-#define MATROSKA_ID_CUES       0x1C53BB6B
-#define MATROSKA_ID_TAGS       0x1254C367
-#define MATROSKA_ID_SEEKHEAD   0x114D9B74
-#define MATROSKA_ID_ATTACHMENTS 0x1941A469
-#define MATROSKA_ID_CLUSTER    0x1F43B675
-#define MATROSKA_ID_CHAPTERS   0x1043A770
-
-/* IDs in the info master */
-#define MATROSKA_ID_TIMECODESCALE 0x2AD7B1
-#define MATROSKA_ID_DURATION   0x4489
-#define MATROSKA_ID_TITLE      0x7BA9
-#define MATROSKA_ID_WRITINGAPP 0x5741
-#define MATROSKA_ID_MUXINGAPP  0x4D80
-#define MATROSKA_ID_DATEUTC    0x4461
-#define MATROSKA_ID_SEGMENTUID 0x73A4
-
-/* ID in the tracks master */
-#define MATROSKA_ID_TRACKENTRY 0xAE
-
-/* IDs in the trackentry master */
-#define MATROSKA_ID_TRACKNUMBER 0xD7
-#define MATROSKA_ID_TRACKUID   0x73C5
-#define MATROSKA_ID_TRACKTYPE  0x83
-#define MATROSKA_ID_TRACKAUDIO 0xE1
-#define MATROSKA_ID_TRACKVIDEO 0xE0
-#define MATROSKA_ID_CODECID    0x86
-#define MATROSKA_ID_CODECPRIVATE 0x63A2
-#define MATROSKA_ID_CODECNAME  0x258688
-#define MATROSKA_ID_CODECINFOURL 0x3B4040
-#define MATROSKA_ID_CODECDOWNLOADURL 0x26B240
-#define MATROSKA_ID_CODECDECODEALL 0xAA
-#define MATROSKA_ID_CODECDELAY 0x56AA
-#define MATROSKA_ID_TRACKNAME  0x536E
-#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C
-#define MATROSKA_ID_TRACKFLAGENABLED 0xB9
-#define MATROSKA_ID_TRACKFLAGDEFAULT 0x88
-#define MATROSKA_ID_TRACKFLAGFORCED 0x55AA
-#define MATROSKA_ID_TRACKFLAGLACING 0x9C
-#define MATROSKA_ID_TRACKMINCACHE 0x6DE7
-#define MATROSKA_ID_TRACKMAXCACHE 0x6DF8
-#define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383
-#define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80
-#define MATROSKA_ID_TRACKCONTENTENCODING 0x6240
-#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F
-#define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE
-
-/* IDs in the trackvideo master */
-#define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3
-#define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0
-#define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA
-#define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0
-#define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA
-#define MATROSKA_ID_VIDEOPIXELCROPB 0x54AA
-#define MATROSKA_ID_VIDEOPIXELCROPT 0x54BB
-#define MATROSKA_ID_VIDEOPIXELCROPL 0x54CC
-#define MATROSKA_ID_VIDEOPIXELCROPR 0x54DD
-#define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2
-#define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A
-#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B8
-#define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3
-#define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524
-
-/* IDs in the trackaudio master */
-#define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5
-#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5
-
-#define MATROSKA_ID_AUDIOBITDEPTH 0x6264
-#define MATROSKA_ID_AUDIOCHANNELS 0x9F
-
-/* IDs in the content encoding master */
-#define MATROSKA_ID_ENCODINGORDER 0x5031
-#define MATROSKA_ID_ENCODINGSCOPE 0x5032
-#define MATROSKA_ID_ENCODINGTYPE 0x5033
-#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034
-#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254
-#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255
-
-/* ID in the cues master */
-#define MATROSKA_ID_POINTENTRY 0xBB
-
-/* IDs in the pointentry master */
-#define MATROSKA_ID_CUETIME    0xB3
-#define MATROSKA_ID_CUETRACKPOSITION 0xB7
-
-/* IDs in the cuetrackposition master */
-#define MATROSKA_ID_CUETRACK   0xF7
-#define MATROSKA_ID_CUECLUSTERPOSITION 0xF1
-#define MATROSKA_ID_CUEBLOCKNUMBER 0x5378
-
-/* IDs in the tags master */
-#define MATROSKA_ID_TAG                 0x7373
-#define MATROSKA_ID_SIMPLETAG           0x67C8
-#define MATROSKA_ID_TAGNAME             0x45A3
-#define MATROSKA_ID_TAGSTRING           0x4487
-#define MATROSKA_ID_TAGLANG             0x447A
-#define MATROSKA_ID_TAGDEFAULT          0x4484
-#define MATROSKA_ID_TAGDEFAULT_BUG      0x44B4
-#define MATROSKA_ID_TAGTARGETS          0x63C0
-#define MATROSKA_ID_TAGTARGETS_TYPE       0x63CA
-#define MATROSKA_ID_TAGTARGETS_TYPEVALUE  0x68CA
-#define MATROSKA_ID_TAGTARGETS_TRACKUID   0x63C5
-#define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4
-#define MATROSKA_ID_TAGTARGETS_ATTACHUID  0x63C6
-
-/* IDs in the seekhead master */
-#define MATROSKA_ID_SEEKENTRY  0x4DBB
-
-/* IDs in the seekpoint master */
-#define MATROSKA_ID_SEEKID     0x53AB
-#define MATROSKA_ID_SEEKPOSITION 0x53AC
-
-/* IDs in the cluster master */
-#define MATROSKA_ID_CLUSTERTIMECODE 0xE7
-#define MATROSKA_ID_CLUSTERPOSITION 0xA7
-#define MATROSKA_ID_CLUSTERPREVSIZE 0xAB
-#define MATROSKA_ID_BLOCKGROUP 0xA0
-#define MATROSKA_ID_SIMPLEBLOCK 0xA3
-
-/* IDs in the blockgroup master */
-#define MATROSKA_ID_BLOCK      0xA1
-#define MATROSKA_ID_BLOCKDURATION 0x9B
-#define MATROSKA_ID_BLOCKREFERENCE 0xFB
-#define MATROSKA_ID_CODECSTATE 0xA4
-
-/* IDs in the attachments master */
-#define MATROSKA_ID_ATTACHEDFILE        0x61A7
-#define MATROSKA_ID_FILEDESC            0x467E
-#define MATROSKA_ID_FILENAME            0x466E
-#define MATROSKA_ID_FILEMIMETYPE        0x4660
-#define MATROSKA_ID_FILEDATA            0x465C
-#define MATROSKA_ID_FILEUID             0x46AE
-
-/* IDs in the chapters master */
-#define MATROSKA_ID_EDITIONENTRY        0x45B9
-#define MATROSKA_ID_CHAPTERATOM         0xB6
-#define MATROSKA_ID_CHAPTERTIMESTART    0x91
-#define MATROSKA_ID_CHAPTERTIMEEND      0x92
-#define MATROSKA_ID_CHAPTERDISPLAY      0x80
-#define MATROSKA_ID_CHAPSTRING          0x85
-#define MATROSKA_ID_CHAPLANG            0x437C
-#define MATROSKA_ID_EDITIONUID          0x45BC
-#define MATROSKA_ID_EDITIONFLAGHIDDEN   0x45BD
-#define MATROSKA_ID_EDITIONFLAGDEFAULT  0x45DB
-#define MATROSKA_ID_EDITIONFLAGORDERED  0x45DD
-#define MATROSKA_ID_CHAPTERUID          0x73C4
-#define MATROSKA_ID_CHAPTERFLAGHIDDEN   0x98
-#define MATROSKA_ID_CHAPTERFLAGENABLED  0x4598
-#define MATROSKA_ID_CHAPTERPHYSEQUIV    0x63C3
-
-typedef enum {
-  MATROSKA_TRACK_TYPE_NONE     = 0x0,
-  MATROSKA_TRACK_TYPE_VIDEO    = 0x1,
-  MATROSKA_TRACK_TYPE_AUDIO    = 0x2,
-  MATROSKA_TRACK_TYPE_COMPLEX  = 0x3,
-  MATROSKA_TRACK_TYPE_LOGO     = 0x10,
-  MATROSKA_TRACK_TYPE_SUBTITLE = 0x11,
-  MATROSKA_TRACK_TYPE_CONTROL  = 0x20,
-} MatroskaTrackType;
-
-typedef enum {
-  MATROSKA_TRACK_ENCODING_COMP_ZLIB        = 0,
-  MATROSKA_TRACK_ENCODING_COMP_BZLIB       = 1,
-  MATROSKA_TRACK_ENCODING_COMP_LZO         = 2,
-  MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP = 3,
-} MatroskaTrackEncodingCompAlgo;
-
-typedef enum {
-  MATROSKA_VIDEO_STEREOMODE_TYPE_MONO               = 0,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT         = 1,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP         = 2,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM         = 3,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL    = 4,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR    = 5,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL = 6,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR = 7,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL = 8,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR = 9,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED  = 10,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT         = 11,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG = 12,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR = 13,
-  MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL = 14,
-} MatroskaVideoStereoModeType;
-
-/*
- * Matroska Codec IDs, strings
- */
-
-typedef struct CodecTags{
-    char str[20];
-    enum AVCodecID id;
-}CodecTags;
-
-/* max. depth in the EBML tree structure */
-#define EBML_MAX_DEPTH 16
-
-extern const CodecTags ff_mkv_codec_tags[];
-extern const CodecMime ff_mkv_mime_tags[];
-extern const AVMetadataConv ff_mkv_metadata_conv[];
-
-#endif /* AVFORMAT_MATROSKA_H */
diff --git a/deps/libav/libavformat/matroskadec.c b/deps/libav/libavformat/matroskadec.c
deleted file mode 100644
index 8aae26c..0000000
--- a/deps/libav/libavformat/matroskadec.c
+++ /dev/null
@@ -1,2457 +0,0 @@
-/*
- * Matroska file demuxer
- * Copyright (c) 2003-2008 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Matroska file demuxer
- * @author Ronald Bultje <rbultje at ronald.bitfreak.net>
- * @author with a little help from Moritz Bunkus <moritz at bunkus.org>
- * @author totally reworked by Aurelien Jacobs <aurel at gnuage.org>
- * @see specs available on the Matroska project page: http://www.matroska.org/
- */
-
-#include <stdio.h>
-#include "avformat.h"
-#include "internal.h"
-#include "avio_internal.h"
-/* For ff_codec_get_id(). */
-#include "riff.h"
-#include "isom.h"
-#include "rmsipr.h"
-#include "matroska.h"
-#include "libavcodec/bytestream.h"
-#include "libavcodec/mpeg4audio.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/avstring.h"
-#include "libavutil/lzo.h"
-#include "libavutil/dict.h"
-#include "libavutil/mathematics.h"
-#if CONFIG_ZLIB
-#include <zlib.h>
-#endif
-#if CONFIG_BZLIB
-#include <bzlib.h>
-#endif
-
-typedef enum {
-    EBML_NONE,
-    EBML_UINT,
-    EBML_FLOAT,
-    EBML_STR,
-    EBML_UTF8,
-    EBML_BIN,
-    EBML_NEST,
-    EBML_PASS,
-    EBML_STOP,
-    EBML_TYPE_COUNT
-} EbmlType;
-
-typedef const struct EbmlSyntax {
-    uint32_t id;
-    EbmlType type;
-    int list_elem_size;
-    int data_offset;
-    union {
-        uint64_t    u;
-        double      f;
-        const char *s;
-        const struct EbmlSyntax *n;
-    } def;
-} EbmlSyntax;
-
-typedef struct {
-    int nb_elem;
-    void *elem;
-} EbmlList;
-
-typedef struct {
-    int      size;
-    uint8_t *data;
-    int64_t  pos;
-} EbmlBin;
-
-typedef struct {
-    uint64_t version;
-    uint64_t max_size;
-    uint64_t id_length;
-    char    *doctype;
-    uint64_t doctype_version;
-} Ebml;
-
-typedef struct {
-    uint64_t algo;
-    EbmlBin  settings;
-} MatroskaTrackCompression;
-
-typedef struct {
-    uint64_t scope;
-    uint64_t type;
-    MatroskaTrackCompression compression;
-} MatroskaTrackEncoding;
-
-typedef struct {
-    double   frame_rate;
-    uint64_t display_width;
-    uint64_t display_height;
-    uint64_t pixel_width;
-    uint64_t pixel_height;
-    uint64_t fourcc;
-} MatroskaTrackVideo;
-
-typedef struct {
-    double   samplerate;
-    double   out_samplerate;
-    uint64_t bitdepth;
-    uint64_t channels;
-
-    /* real audio header (extracted from extradata) */
-    int      coded_framesize;
-    int      sub_packet_h;
-    int      frame_size;
-    int      sub_packet_size;
-    int      sub_packet_cnt;
-    int      pkt_cnt;
-    uint64_t buf_timecode;
-    uint8_t *buf;
-} MatroskaTrackAudio;
-
-typedef struct {
-    uint64_t num;
-    uint64_t uid;
-    uint64_t type;
-    char    *name;
-    char    *codec_id;
-    EbmlBin  codec_priv;
-    char    *language;
-    double time_scale;
-    uint64_t default_duration;
-    uint64_t flag_default;
-    uint64_t flag_forced;
-    MatroskaTrackVideo video;
-    MatroskaTrackAudio audio;
-    EbmlList encodings;
-    uint64_t codec_delay;
-
-    AVStream *stream;
-    int64_t end_timecode;
-    int ms_compat;
-} MatroskaTrack;
-
-typedef struct {
-    uint64_t uid;
-    char *filename;
-    char *mime;
-    EbmlBin bin;
-
-    AVStream *stream;
-} MatroskaAttachement;
-
-typedef struct {
-    uint64_t start;
-    uint64_t end;
-    uint64_t uid;
-    char    *title;
-
-    AVChapter *chapter;
-} MatroskaChapter;
-
-typedef struct {
-    uint64_t track;
-    uint64_t pos;
-} MatroskaIndexPos;
-
-typedef struct {
-    uint64_t time;
-    EbmlList pos;
-} MatroskaIndex;
-
-typedef struct {
-    char *name;
-    char *string;
-    char *lang;
-    uint64_t def;
-    EbmlList sub;
-} MatroskaTag;
-
-typedef struct {
-    char    *type;
-    uint64_t typevalue;
-    uint64_t trackuid;
-    uint64_t chapteruid;
-    uint64_t attachuid;
-} MatroskaTagTarget;
-
-typedef struct {
-    MatroskaTagTarget target;
-    EbmlList tag;
-} MatroskaTags;
-
-typedef struct {
-    uint64_t id;
-    uint64_t pos;
-} MatroskaSeekhead;
-
-typedef struct {
-    uint64_t start;
-    uint64_t length;
-} MatroskaLevel;
-
-typedef struct {
-    uint64_t timecode;
-    EbmlList blocks;
-} MatroskaCluster;
-
-typedef struct {
-    AVFormatContext *ctx;
-
-    /* EBML stuff */
-    int num_levels;
-    MatroskaLevel levels[EBML_MAX_DEPTH];
-    int level_up;
-    uint32_t current_id;
-
-    uint64_t time_scale;
-    double   duration;
-    char    *title;
-    EbmlList tracks;
-    EbmlList attachments;
-    EbmlList chapters;
-    EbmlList index;
-    EbmlList tags;
-    EbmlList seekhead;
-
-    /* byte position of the segment inside the stream */
-    int64_t segment_start;
-
-    /* the packet queue */
-    AVPacket **packets;
-    int num_packets;
-    AVPacket *prev_pkt;
-
-    int done;
-
-    /* What to skip before effectively reading a packet. */
-    int skip_to_keyframe;
-    uint64_t skip_to_timecode;
-
-    /* File has a CUES element, but we defer parsing until it is needed. */
-    int cues_parsing_deferred;
-
-    int current_cluster_num_blocks;
-    int64_t current_cluster_pos;
-    MatroskaCluster current_cluster;
-
-    /* File has SSA subtitles which prevent incremental cluster parsing. */
-    int contains_ssa;
-} MatroskaDemuxContext;
-
-typedef struct {
-    uint64_t duration;
-    int64_t  reference;
-    uint64_t non_simple;
-    EbmlBin  bin;
-} MatroskaBlock;
-
-static EbmlSyntax ebml_header[] = {
-    { EBML_ID_EBMLREADVERSION,        EBML_UINT, 0, offsetof(Ebml,version), {.u=EBML_VERSION} },
-    { EBML_ID_EBMLMAXSIZELENGTH,      EBML_UINT, 0, offsetof(Ebml,max_size), {.u=8} },
-    { EBML_ID_EBMLMAXIDLENGTH,        EBML_UINT, 0, offsetof(Ebml,id_length), {.u=4} },
-    { EBML_ID_DOCTYPE,                EBML_STR,  0, offsetof(Ebml,doctype), {.s="(none)"} },
-    { EBML_ID_DOCTYPEREADVERSION,     EBML_UINT, 0, offsetof(Ebml,doctype_version), {.u=1} },
-    { EBML_ID_EBMLVERSION,            EBML_NONE },
-    { EBML_ID_DOCTYPEVERSION,         EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax ebml_syntax[] = {
-    { EBML_ID_HEADER,                 EBML_NEST, 0, 0, {.n=ebml_header} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_info[] = {
-    { MATROSKA_ID_TIMECODESCALE,      EBML_UINT,  0, offsetof(MatroskaDemuxContext,time_scale), {.u=1000000} },
-    { MATROSKA_ID_DURATION,           EBML_FLOAT, 0, offsetof(MatroskaDemuxContext,duration) },
-    { MATROSKA_ID_TITLE,              EBML_UTF8,  0, offsetof(MatroskaDemuxContext,title) },
-    { MATROSKA_ID_WRITINGAPP,         EBML_NONE },
-    { MATROSKA_ID_MUXINGAPP,          EBML_NONE },
-    { MATROSKA_ID_DATEUTC,            EBML_NONE },
-    { MATROSKA_ID_SEGMENTUID,         EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_track_video[] = {
-    { MATROSKA_ID_VIDEOFRAMERATE,     EBML_FLOAT,0, offsetof(MatroskaTrackVideo,frame_rate) },
-    { MATROSKA_ID_VIDEODISPLAYWIDTH,  EBML_UINT, 0, offsetof(MatroskaTrackVideo,display_width) },
-    { MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo,display_height) },
-    { MATROSKA_ID_VIDEOPIXELWIDTH,    EBML_UINT, 0, offsetof(MatroskaTrackVideo,pixel_width) },
-    { MATROSKA_ID_VIDEOPIXELHEIGHT,   EBML_UINT, 0, offsetof(MatroskaTrackVideo,pixel_height) },
-    { MATROSKA_ID_VIDEOCOLORSPACE,    EBML_UINT, 0, offsetof(MatroskaTrackVideo,fourcc) },
-    { MATROSKA_ID_VIDEOPIXELCROPB,    EBML_NONE },
-    { MATROSKA_ID_VIDEOPIXELCROPT,    EBML_NONE },
-    { MATROSKA_ID_VIDEOPIXELCROPL,    EBML_NONE },
-    { MATROSKA_ID_VIDEOPIXELCROPR,    EBML_NONE },
-    { MATROSKA_ID_VIDEODISPLAYUNIT,   EBML_NONE },
-    { MATROSKA_ID_VIDEOFLAGINTERLACED,EBML_NONE },
-    { MATROSKA_ID_VIDEOSTEREOMODE,    EBML_NONE },
-    { MATROSKA_ID_VIDEOASPECTRATIO,   EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_track_audio[] = {
-    { MATROSKA_ID_AUDIOSAMPLINGFREQ,  EBML_FLOAT,0, offsetof(MatroskaTrackAudio,samplerate), {.f=8000.0} },
-    { MATROSKA_ID_AUDIOOUTSAMPLINGFREQ,EBML_FLOAT,0,offsetof(MatroskaTrackAudio,out_samplerate) },
-    { MATROSKA_ID_AUDIOBITDEPTH,      EBML_UINT, 0, offsetof(MatroskaTrackAudio,bitdepth) },
-    { MATROSKA_ID_AUDIOCHANNELS,      EBML_UINT, 0, offsetof(MatroskaTrackAudio,channels), {.u=1} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_track_encoding_compression[] = {
-    { MATROSKA_ID_ENCODINGCOMPALGO,   EBML_UINT, 0, offsetof(MatroskaTrackCompression,algo), {.u=0} },
-    { MATROSKA_ID_ENCODINGCOMPSETTINGS,EBML_BIN, 0, offsetof(MatroskaTrackCompression,settings) },
-    { 0 }
-};
-
-static EbmlSyntax matroska_track_encoding[] = {
-    { MATROSKA_ID_ENCODINGSCOPE,      EBML_UINT, 0, offsetof(MatroskaTrackEncoding,scope), {.u=1} },
-    { MATROSKA_ID_ENCODINGTYPE,       EBML_UINT, 0, offsetof(MatroskaTrackEncoding,type), {.u=0} },
-    { MATROSKA_ID_ENCODINGCOMPRESSION,EBML_NEST, 0, offsetof(MatroskaTrackEncoding,compression), {.n=matroska_track_encoding_compression} },
-    { MATROSKA_ID_ENCODINGORDER,      EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_track_encodings[] = {
-    { MATROSKA_ID_TRACKCONTENTENCODING, EBML_NEST, sizeof(MatroskaTrackEncoding), offsetof(MatroskaTrack,encodings), {.n=matroska_track_encoding} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_track[] = {
-    { MATROSKA_ID_TRACKNUMBER,          EBML_UINT, 0, offsetof(MatroskaTrack,num) },
-    { MATROSKA_ID_TRACKNAME,            EBML_UTF8, 0, offsetof(MatroskaTrack,name) },
-    { MATROSKA_ID_TRACKUID,             EBML_UINT, 0, offsetof(MatroskaTrack,uid) },
-    { MATROSKA_ID_TRACKTYPE,            EBML_UINT, 0, offsetof(MatroskaTrack,type) },
-    { MATROSKA_ID_CODECID,              EBML_STR,  0, offsetof(MatroskaTrack,codec_id) },
-    { MATROSKA_ID_CODECPRIVATE,         EBML_BIN,  0, offsetof(MatroskaTrack,codec_priv) },
-    { MATROSKA_ID_CODECDELAY,           EBML_UINT, 0, offsetof(MatroskaTrack, codec_delay) },
-    { MATROSKA_ID_TRACKLANGUAGE,        EBML_UTF8, 0, offsetof(MatroskaTrack,language), {.s="eng"} },
-    { MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack,default_duration) },
-    { MATROSKA_ID_TRACKTIMECODESCALE,   EBML_FLOAT,0, offsetof(MatroskaTrack,time_scale), {.f=1.0} },
-    { MATROSKA_ID_TRACKFLAGDEFAULT,     EBML_UINT, 0, offsetof(MatroskaTrack,flag_default), {.u=1} },
-    { MATROSKA_ID_TRACKFLAGFORCED,      EBML_UINT, 0, offsetof(MatroskaTrack,flag_forced), {.u=0} },
-    { MATROSKA_ID_TRACKVIDEO,           EBML_NEST, 0, offsetof(MatroskaTrack,video), {.n=matroska_track_video} },
-    { MATROSKA_ID_TRACKAUDIO,           EBML_NEST, 0, offsetof(MatroskaTrack,audio), {.n=matroska_track_audio} },
-    { MATROSKA_ID_TRACKCONTENTENCODINGS,EBML_NEST, 0, 0, {.n=matroska_track_encodings} },
-    { MATROSKA_ID_TRACKFLAGENABLED,     EBML_NONE },
-    { MATROSKA_ID_TRACKFLAGLACING,      EBML_NONE },
-    { MATROSKA_ID_CODECNAME,            EBML_NONE },
-    { MATROSKA_ID_CODECDECODEALL,       EBML_NONE },
-    { MATROSKA_ID_CODECINFOURL,         EBML_NONE },
-    { MATROSKA_ID_CODECDOWNLOADURL,     EBML_NONE },
-    { MATROSKA_ID_TRACKMINCACHE,        EBML_NONE },
-    { MATROSKA_ID_TRACKMAXCACHE,        EBML_NONE },
-    { MATROSKA_ID_TRACKMAXBLKADDID,     EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_tracks[] = {
-    { MATROSKA_ID_TRACKENTRY,         EBML_NEST, sizeof(MatroskaTrack), offsetof(MatroskaDemuxContext,tracks), {.n=matroska_track} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_attachment[] = {
-    { MATROSKA_ID_FILEUID,            EBML_UINT, 0, offsetof(MatroskaAttachement,uid) },
-    { MATROSKA_ID_FILENAME,           EBML_UTF8, 0, offsetof(MatroskaAttachement,filename) },
-    { MATROSKA_ID_FILEMIMETYPE,       EBML_STR,  0, offsetof(MatroskaAttachement,mime) },
-    { MATROSKA_ID_FILEDATA,           EBML_BIN,  0, offsetof(MatroskaAttachement,bin) },
-    { MATROSKA_ID_FILEDESC,           EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_attachments[] = {
-    { MATROSKA_ID_ATTACHEDFILE,       EBML_NEST, sizeof(MatroskaAttachement), offsetof(MatroskaDemuxContext,attachments), {.n=matroska_attachment} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_chapter_display[] = {
-    { MATROSKA_ID_CHAPSTRING,         EBML_UTF8, 0, offsetof(MatroskaChapter,title) },
-    { MATROSKA_ID_CHAPLANG,           EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_chapter_entry[] = {
-    { MATROSKA_ID_CHAPTERTIMESTART,   EBML_UINT, 0, offsetof(MatroskaChapter,start), {.u=AV_NOPTS_VALUE} },
-    { MATROSKA_ID_CHAPTERTIMEEND,     EBML_UINT, 0, offsetof(MatroskaChapter,end), {.u=AV_NOPTS_VALUE} },
-    { MATROSKA_ID_CHAPTERUID,         EBML_UINT, 0, offsetof(MatroskaChapter,uid) },
-    { MATROSKA_ID_CHAPTERDISPLAY,     EBML_NEST, 0, 0, {.n=matroska_chapter_display} },
-    { MATROSKA_ID_CHAPTERFLAGHIDDEN,  EBML_NONE },
-    { MATROSKA_ID_CHAPTERFLAGENABLED, EBML_NONE },
-    { MATROSKA_ID_CHAPTERPHYSEQUIV,   EBML_NONE },
-    { MATROSKA_ID_CHAPTERATOM,        EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_chapter[] = {
-    { MATROSKA_ID_CHAPTERATOM,        EBML_NEST, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext,chapters), {.n=matroska_chapter_entry} },
-    { MATROSKA_ID_EDITIONUID,         EBML_NONE },
-    { MATROSKA_ID_EDITIONFLAGHIDDEN,  EBML_NONE },
-    { MATROSKA_ID_EDITIONFLAGDEFAULT, EBML_NONE },
-    { MATROSKA_ID_EDITIONFLAGORDERED, EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_chapters[] = {
-    { MATROSKA_ID_EDITIONENTRY,       EBML_NEST, 0, 0, {.n=matroska_chapter} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_index_pos[] = {
-    { MATROSKA_ID_CUETRACK,           EBML_UINT, 0, offsetof(MatroskaIndexPos,track) },
-    { MATROSKA_ID_CUECLUSTERPOSITION, EBML_UINT, 0, offsetof(MatroskaIndexPos,pos)   },
-    { MATROSKA_ID_CUEBLOCKNUMBER,     EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_index_entry[] = {
-    { MATROSKA_ID_CUETIME,            EBML_UINT, 0, offsetof(MatroskaIndex,time) },
-    { MATROSKA_ID_CUETRACKPOSITION,   EBML_NEST, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex,pos), {.n=matroska_index_pos} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_index[] = {
-    { MATROSKA_ID_POINTENTRY,         EBML_NEST, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext,index), {.n=matroska_index_entry} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_simpletag[] = {
-    { MATROSKA_ID_TAGNAME,            EBML_UTF8, 0, offsetof(MatroskaTag,name) },
-    { MATROSKA_ID_TAGSTRING,          EBML_UTF8, 0, offsetof(MatroskaTag,string) },
-    { MATROSKA_ID_TAGLANG,            EBML_STR,  0, offsetof(MatroskaTag,lang), {.s="und"} },
-    { MATROSKA_ID_TAGDEFAULT,         EBML_UINT, 0, offsetof(MatroskaTag,def) },
-    { MATROSKA_ID_TAGDEFAULT_BUG,     EBML_UINT, 0, offsetof(MatroskaTag,def) },
-    { MATROSKA_ID_SIMPLETAG,          EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTag,sub), {.n=matroska_simpletag} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_tagtargets[] = {
-    { MATROSKA_ID_TAGTARGETS_TYPE,      EBML_STR,  0, offsetof(MatroskaTagTarget,type) },
-    { MATROSKA_ID_TAGTARGETS_TYPEVALUE, EBML_UINT, 0, offsetof(MatroskaTagTarget,typevalue), {.u=50} },
-    { MATROSKA_ID_TAGTARGETS_TRACKUID,  EBML_UINT, 0, offsetof(MatroskaTagTarget,trackuid) },
-    { MATROSKA_ID_TAGTARGETS_CHAPTERUID,EBML_UINT, 0, offsetof(MatroskaTagTarget,chapteruid) },
-    { MATROSKA_ID_TAGTARGETS_ATTACHUID, EBML_UINT, 0, offsetof(MatroskaTagTarget,attachuid) },
-    { 0 }
-};
-
-static EbmlSyntax matroska_tag[] = {
-    { MATROSKA_ID_SIMPLETAG,          EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTags,tag), {.n=matroska_simpletag} },
-    { MATROSKA_ID_TAGTARGETS,         EBML_NEST, 0, offsetof(MatroskaTags,target), {.n=matroska_tagtargets} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_tags[] = {
-    { MATROSKA_ID_TAG,                EBML_NEST, sizeof(MatroskaTags), offsetof(MatroskaDemuxContext,tags), {.n=matroska_tag} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_seekhead_entry[] = {
-    { MATROSKA_ID_SEEKID,             EBML_UINT, 0, offsetof(MatroskaSeekhead,id) },
-    { MATROSKA_ID_SEEKPOSITION,       EBML_UINT, 0, offsetof(MatroskaSeekhead,pos), {.u=-1} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_seekhead[] = {
-    { MATROSKA_ID_SEEKENTRY,          EBML_NEST, sizeof(MatroskaSeekhead), offsetof(MatroskaDemuxContext,seekhead), {.n=matroska_seekhead_entry} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_segment[] = {
-    { MATROSKA_ID_INFO,           EBML_NEST, 0, 0, {.n=matroska_info       } },
-    { MATROSKA_ID_TRACKS,         EBML_NEST, 0, 0, {.n=matroska_tracks     } },
-    { MATROSKA_ID_ATTACHMENTS,    EBML_NEST, 0, 0, {.n=matroska_attachments} },
-    { MATROSKA_ID_CHAPTERS,       EBML_NEST, 0, 0, {.n=matroska_chapters   } },
-    { MATROSKA_ID_CUES,           EBML_NEST, 0, 0, {.n=matroska_index      } },
-    { MATROSKA_ID_TAGS,           EBML_NEST, 0, 0, {.n=matroska_tags       } },
-    { MATROSKA_ID_SEEKHEAD,       EBML_NEST, 0, 0, {.n=matroska_seekhead   } },
-    { MATROSKA_ID_CLUSTER,        EBML_STOP },
-    { 0 }
-};
-
-static EbmlSyntax matroska_segments[] = {
-    { MATROSKA_ID_SEGMENT,        EBML_NEST, 0, 0, {.n=matroska_segment    } },
-    { 0 }
-};
-
-static EbmlSyntax matroska_blockgroup[] = {
-    { MATROSKA_ID_BLOCK,          EBML_BIN,  0, offsetof(MatroskaBlock,bin) },
-    { MATROSKA_ID_SIMPLEBLOCK,    EBML_BIN,  0, offsetof(MatroskaBlock,bin) },
-    { MATROSKA_ID_BLOCKDURATION,  EBML_UINT, 0, offsetof(MatroskaBlock,duration), {.u=AV_NOPTS_VALUE} },
-    { MATROSKA_ID_BLOCKREFERENCE, EBML_UINT, 0, offsetof(MatroskaBlock,reference) },
-    { MATROSKA_ID_CODECSTATE,     EBML_NONE },
-    { 1,                          EBML_UINT, 0, offsetof(MatroskaBlock,non_simple), {.u=1} },
-    { 0 }
-};
-
-static EbmlSyntax matroska_cluster[] = {
-    { MATROSKA_ID_CLUSTERTIMECODE,EBML_UINT,0, offsetof(MatroskaCluster,timecode) },
-    { MATROSKA_ID_BLOCKGROUP,     EBML_NEST, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
-    { MATROSKA_ID_SIMPLEBLOCK,    EBML_PASS, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
-    { MATROSKA_ID_CLUSTERPOSITION,EBML_NONE },
-    { MATROSKA_ID_CLUSTERPREVSIZE,EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_clusters[] = {
-    { MATROSKA_ID_CLUSTER,        EBML_NEST, 0, 0, {.n=matroska_cluster} },
-    { MATROSKA_ID_INFO,           EBML_NONE },
-    { MATROSKA_ID_CUES,           EBML_NONE },
-    { MATROSKA_ID_TAGS,           EBML_NONE },
-    { MATROSKA_ID_SEEKHEAD,       EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_cluster_incremental_parsing[] = {
-    { MATROSKA_ID_CLUSTERTIMECODE,EBML_UINT,0, offsetof(MatroskaCluster,timecode) },
-    { MATROSKA_ID_BLOCKGROUP,     EBML_NEST, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
-    { MATROSKA_ID_SIMPLEBLOCK,    EBML_PASS, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
-    { MATROSKA_ID_CLUSTERPOSITION,EBML_NONE },
-    { MATROSKA_ID_CLUSTERPREVSIZE,EBML_NONE },
-    { MATROSKA_ID_INFO,           EBML_NONE },
-    { MATROSKA_ID_CUES,           EBML_NONE },
-    { MATROSKA_ID_TAGS,           EBML_NONE },
-    { MATROSKA_ID_SEEKHEAD,       EBML_NONE },
-    { MATROSKA_ID_CLUSTER,        EBML_STOP },
-    { 0 }
-};
-
-static EbmlSyntax matroska_cluster_incremental[] = {
-    { MATROSKA_ID_CLUSTERTIMECODE,EBML_UINT,0, offsetof(MatroskaCluster,timecode) },
-    { MATROSKA_ID_BLOCKGROUP,     EBML_STOP },
-    { MATROSKA_ID_SIMPLEBLOCK,    EBML_STOP },
-    { MATROSKA_ID_CLUSTERPOSITION,EBML_NONE },
-    { MATROSKA_ID_CLUSTERPREVSIZE,EBML_NONE },
-    { 0 }
-};
-
-static EbmlSyntax matroska_clusters_incremental[] = {
-    { MATROSKA_ID_CLUSTER,        EBML_NEST, 0, 0, {.n=matroska_cluster_incremental} },
-    { MATROSKA_ID_INFO,           EBML_NONE },
-    { MATROSKA_ID_CUES,           EBML_NONE },
-    { MATROSKA_ID_TAGS,           EBML_NONE },
-    { MATROSKA_ID_SEEKHEAD,       EBML_NONE },
-    { 0 }
-};
-
-static const char *const matroska_doctypes[] = { "matroska", "webm" };
-
-static int matroska_resync(MatroskaDemuxContext *matroska, int64_t last_pos)
-{
-    AVIOContext *pb = matroska->ctx->pb;
-    uint32_t id;
-    matroska->current_id = 0;
-    matroska->num_levels = 0;
-
-    /* seek to next position to resync from */
-    if (avio_seek(pb, last_pos + 1, SEEK_SET) < 0)
-        goto eof;
-
-    id = avio_rb32(pb);
-
-    // try to find a toplevel element
-    while (!pb->eof_reached) {
-        if (id == MATROSKA_ID_INFO     || id == MATROSKA_ID_TRACKS      ||
-            id == MATROSKA_ID_CUES     || id == MATROSKA_ID_TAGS        ||
-            id == MATROSKA_ID_SEEKHEAD || id == MATROSKA_ID_ATTACHMENTS ||
-            id == MATROSKA_ID_CLUSTER  || id == MATROSKA_ID_CHAPTERS) {
-                matroska->current_id = id;
-                return 0;
-        }
-        id = (id << 8) | avio_r8(pb);
-    }
-eof:
-    matroska->done = 1;
-    return AVERROR_EOF;
-}
-
-/*
- * Return: Whether we reached the end of a level in the hierarchy or not.
- */
-static int ebml_level_end(MatroskaDemuxContext *matroska)
-{
-    AVIOContext *pb = matroska->ctx->pb;
-    int64_t pos = avio_tell(pb);
-
-    if (matroska->num_levels > 0) {
-        MatroskaLevel *level = &matroska->levels[matroska->num_levels - 1];
-        if (pos - level->start >= level->length || matroska->current_id) {
-            matroska->num_levels--;
-            return 1;
-        }
-    }
-    return 0;
-}
-
-/*
- * Read: an "EBML number", which is defined as a variable-length
- * array of bytes. The first byte indicates the length by giving a
- * number of 0-bits followed by a one. The position of the first
- * "one" bit inside the first byte indicates the length of this
- * number.
- * Returns: number of bytes read, < 0 on error
- */
-static int ebml_read_num(MatroskaDemuxContext *matroska, AVIOContext *pb,
-                         int max_size, uint64_t *number)
-{
-    int read = 1, n = 1;
-    uint64_t total = 0;
-
-    /* The first byte tells us the length in bytes - avio_r8() can normally
-     * return 0, but since that's not a valid first ebmlID byte, we can
-     * use it safely here to catch EOS. */
-    if (!(total = avio_r8(pb))) {
-        /* we might encounter EOS here */
-        if (!pb->eof_reached) {
-            int64_t pos = avio_tell(pb);
-            av_log(matroska->ctx, AV_LOG_ERROR,
-                   "Read error at pos. %"PRIu64" (0x%"PRIx64")\n",
-                   pos, pos);
-            return pb->error ? pb->error : AVERROR(EIO);
-        }
-        return AVERROR_EOF;
-    }
-
-    /* get the length of the EBML number */
-    read = 8 - ff_log2_tab[total];
-    if (read > max_size) {
-        int64_t pos = avio_tell(pb) - 1;
-        av_log(matroska->ctx, AV_LOG_ERROR,
-               "Invalid EBML number size tag 0x%02x at pos %"PRIu64" (0x%"PRIx64")\n",
-               (uint8_t) total, pos, pos);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* read out length */
-    total ^= 1 << ff_log2_tab[total];
-    while (n++ < read)
-        total = (total << 8) | avio_r8(pb);
-
-    *number = total;
-
-    return read;
-}
-
-/**
- * Read a EBML length value.
- * This needs special handling for the "unknown length" case which has multiple
- * encodings.
- */
-static int ebml_read_length(MatroskaDemuxContext *matroska, AVIOContext *pb,
-                            uint64_t *number)
-{
-    int res = ebml_read_num(matroska, pb, 8, number);
-    if (res > 0 && *number + 1 == 1ULL << (7 * res))
-        *number = 0xffffffffffffffULL;
-    return res;
-}
-
-/*
- * Read the next element as an unsigned int.
- * 0 is success, < 0 is failure.
- */
-static int ebml_read_uint(AVIOContext *pb, int size, uint64_t *num)
-{
-    int n = 0;
-
-    if (size > 8)
-        return AVERROR_INVALIDDATA;
-
-    /* big-endian ordering; build up number */
-    *num = 0;
-    while (n++ < size)
-        *num = (*num << 8) | avio_r8(pb);
-
-    return 0;
-}
-
-/*
- * Read the next element as a float.
- * 0 is success, < 0 is failure.
- */
-static int ebml_read_float(AVIOContext *pb, int size, double *num)
-{
-    if (size == 0) {
-        *num = 0;
-    } else if (size == 4) {
-        *num = av_int2float(avio_rb32(pb));
-    } else if (size == 8){
-        *num = av_int2double(avio_rb64(pb));
-    } else
-        return AVERROR_INVALIDDATA;
-
-    return 0;
-}
-
-/*
- * Read the next element as an ASCII string.
- * 0 is success, < 0 is failure.
- */
-static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
-{
-    char *res;
-
-    /* EBML strings are usually not 0-terminated, so we allocate one
-     * byte more, read the string and NULL-terminate it ourselves. */
-    if (!(res = av_malloc(size + 1)))
-        return AVERROR(ENOMEM);
-    if (avio_read(pb, (uint8_t *) res, size) != size) {
-        av_free(res);
-        return AVERROR(EIO);
-    }
-    (res)[size] = '\0';
-    av_free(*str);
-    *str = res;
-
-    return 0;
-}
-
-/*
- * Read the next element as binary data.
- * 0 is success, < 0 is failure.
- */
-static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)
-{
-    av_free(bin->data);
-    if (!(bin->data = av_malloc(length + FF_INPUT_BUFFER_PADDING_SIZE)))
-        return AVERROR(ENOMEM);
-
-    memset(bin->data + length, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-    bin->size = length;
-    bin->pos  = avio_tell(pb);
-    if (avio_read(pb, bin->data, length) != length) {
-        av_freep(&bin->data);
-        return AVERROR(EIO);
-    }
-
-    return 0;
-}
-
-/*
- * Read the next element, but only the header. The contents
- * are supposed to be sub-elements which can be read separately.
- * 0 is success, < 0 is failure.
- */
-static int ebml_read_master(MatroskaDemuxContext *matroska, uint64_t length)
-{
-    AVIOContext *pb = matroska->ctx->pb;
-    MatroskaLevel *level;
-
-    if (matroska->num_levels >= EBML_MAX_DEPTH) {
-        av_log(matroska->ctx, AV_LOG_ERROR,
-               "File moves beyond max. allowed depth (%d)\n", EBML_MAX_DEPTH);
-        return AVERROR(ENOSYS);
-    }
-
-    level = &matroska->levels[matroska->num_levels++];
-    level->start = avio_tell(pb);
-    level->length = length;
-
-    return 0;
-}
-
-/*
- * Read signed/unsigned "EBML" numbers.
- * Return: number of bytes processed, < 0 on error
- */
-static int matroska_ebmlnum_uint(MatroskaDemuxContext *matroska,
-                                 uint8_t *data, uint32_t size, uint64_t *num)
-{
-    AVIOContext pb;
-    ffio_init_context(&pb, data, size, 0, NULL, NULL, NULL, NULL);
-    return ebml_read_num(matroska, &pb, FFMIN(size, 8), num);
-}
-
-/*
- * Same as above, but signed.
- */
-static int matroska_ebmlnum_sint(MatroskaDemuxContext *matroska,
-                                 uint8_t *data, uint32_t size, int64_t *num)
-{
-    uint64_t unum;
-    int res;
-
-    /* read as unsigned number first */
-    if ((res = matroska_ebmlnum_uint(matroska, data, size, &unum)) < 0)
-        return res;
-
-    /* make signed (weird way) */
-    *num = unum - ((1LL << (7*res - 1)) - 1);
-
-    return res;
-}
-
-static int ebml_parse_elem(MatroskaDemuxContext *matroska,
-                           EbmlSyntax *syntax, void *data);
-
-static int ebml_parse_id(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
-                         uint32_t id, void *data)
-{
-    int i;
-    for (i=0; syntax[i].id; i++)
-        if (id == syntax[i].id)
-            break;
-    if (!syntax[i].id && id == MATROSKA_ID_CLUSTER &&
-        matroska->num_levels > 0 &&
-        matroska->levels[matroska->num_levels-1].length == 0xffffffffffffff)
-        return 0;  // we reached the end of an unknown size cluster
-    if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) {
-        av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%X\n", id);
-        if (matroska->ctx->error_recognition & AV_EF_EXPLODE)
-            return AVERROR_INVALIDDATA;
-    }
-    return ebml_parse_elem(matroska, &syntax[i], data);
-}
-
-static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
-                      void *data)
-{
-    if (!matroska->current_id) {
-        uint64_t id;
-        int res = ebml_read_num(matroska, matroska->ctx->pb, 4, &id);
-        if (res < 0)
-            return res;
-        matroska->current_id = id | 1 << 7*res;
-    }
-    return ebml_parse_id(matroska, syntax, matroska->current_id, data);
-}
-
-static int ebml_parse_nest(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
-                           void *data)
-{
-    int i, res = 0;
-
-    for (i=0; syntax[i].id; i++)
-        switch (syntax[i].type) {
-        case EBML_UINT:
-            *(uint64_t *)((char *)data+syntax[i].data_offset) = syntax[i].def.u;
-            break;
-        case EBML_FLOAT:
-            *(double   *)((char *)data+syntax[i].data_offset) = syntax[i].def.f;
-            break;
-        case EBML_STR:
-        case EBML_UTF8:
-            // the default may be NULL
-            if (syntax[i].def.s) {
-                uint8_t **dst = (uint8_t**)((uint8_t*)data + syntax[i].data_offset);
-                *dst = av_strdup(syntax[i].def.s);
-                if (!*dst)
-                    return AVERROR(ENOMEM);
-            }
-            break;
-        }
-
-    while (!res && !ebml_level_end(matroska))
-        res = ebml_parse(matroska, syntax, data);
-
-    return res;
-}
-
-static int ebml_parse_elem(MatroskaDemuxContext *matroska,
-                           EbmlSyntax *syntax, void *data)
-{
-    static const uint64_t max_lengths[EBML_TYPE_COUNT] = {
-        [EBML_UINT]  = 8,
-        [EBML_FLOAT] = 8,
-        // max. 16 MB for strings
-        [EBML_STR]   = 0x1000000,
-        [EBML_UTF8]  = 0x1000000,
-        // max. 256 MB for binary data
-        [EBML_BIN]   = 0x10000000,
-        // no limits for anything else
-    };
-    AVIOContext *pb = matroska->ctx->pb;
-    uint32_t id = syntax->id;
-    uint64_t length;
-    int res;
-
-    data = (char *)data + syntax->data_offset;
-    if (syntax->list_elem_size) {
-        EbmlList *list = data;
-        if ((res = av_reallocp_array(&list->elem,
-                                     list->nb_elem + 1,
-                                     syntax->list_elem_size)) < 0) {
-            list->nb_elem = 0;
-            return res;
-        }
-        data = (char*)list->elem + list->nb_elem*syntax->list_elem_size;
-        memset(data, 0, syntax->list_elem_size);
-        list->nb_elem++;
-    }
-
-    if (syntax->type != EBML_PASS && syntax->type != EBML_STOP) {
-        matroska->current_id = 0;
-        if ((res = ebml_read_length(matroska, pb, &length)) < 0)
-            return res;
-        if (max_lengths[syntax->type] && length > max_lengths[syntax->type]) {
-            av_log(matroska->ctx, AV_LOG_ERROR,
-                   "Invalid length 0x%"PRIx64" > 0x%"PRIx64" for syntax element %i\n",
-                   length, max_lengths[syntax->type], syntax->type);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    switch (syntax->type) {
-    case EBML_UINT:  res = ebml_read_uint  (pb, length, data);  break;
-    case EBML_FLOAT: res = ebml_read_float (pb, length, data);  break;
-    case EBML_STR:
-    case EBML_UTF8:  res = ebml_read_ascii (pb, length, data);  break;
-    case EBML_BIN:   res = ebml_read_binary(pb, length, data);  break;
-    case EBML_NEST:  if ((res=ebml_read_master(matroska, length)) < 0)
-                         return res;
-                     if (id == MATROSKA_ID_SEGMENT)
-                         matroska->segment_start = avio_tell(matroska->ctx->pb);
-                     return ebml_parse_nest(matroska, syntax->def.n, data);
-    case EBML_PASS:  return ebml_parse_id(matroska, syntax->def.n, id, data);
-    case EBML_STOP:  return 1;
-    default:         return avio_skip(pb,length)<0 ? AVERROR(EIO) : 0;
-    }
-    if (res == AVERROR_INVALIDDATA)
-        av_log(matroska->ctx, AV_LOG_ERROR, "Invalid element\n");
-    else if (res == AVERROR(EIO))
-        av_log(matroska->ctx, AV_LOG_ERROR, "Read error\n");
-    return res;
-}
-
-static void ebml_free(EbmlSyntax *syntax, void *data)
-{
-    int i, j;
-    for (i=0; syntax[i].id; i++) {
-        void *data_off = (char *)data + syntax[i].data_offset;
-        switch (syntax[i].type) {
-        case EBML_STR:
-        case EBML_UTF8:  av_freep(data_off);                      break;
-        case EBML_BIN:   av_freep(&((EbmlBin *)data_off)->data);  break;
-        case EBML_NEST:
-            if (syntax[i].list_elem_size) {
-                EbmlList *list = data_off;
-                char *ptr = list->elem;
-                for (j=0; j<list->nb_elem; j++, ptr+=syntax[i].list_elem_size)
-                    ebml_free(syntax[i].def.n, ptr);
-                av_free(list->elem);
-            } else
-                ebml_free(syntax[i].def.n, data_off);
-        default:  break;
-        }
-    }
-}
-
-
-/*
- * Autodetecting...
- */
-static int matroska_probe(AVProbeData *p)
-{
-    uint64_t total = 0;
-    int len_mask = 0x80, size = 1, n = 1, i;
-
-    /* EBML header? */
-    if (AV_RB32(p->buf) != EBML_ID_HEADER)
-        return 0;
-
-    /* length of header */
-    total = p->buf[4];
-    while (size <= 8 && !(total & len_mask)) {
-        size++;
-        len_mask >>= 1;
-    }
-    if (size > 8)
-      return 0;
-    total &= (len_mask - 1);
-    while (n < size)
-        total = (total << 8) | p->buf[4 + n++];
-
-    /* Does the probe data contain the whole header? */
-    if (p->buf_size < 4 + size + total)
-      return 0;
-
-    /* The header should contain a known document type. For now,
-     * we don't parse the whole header but simply check for the
-     * availability of that array of characters inside the header.
-     * Not fully fool-proof, but good enough. */
-    for (i = 0; i < FF_ARRAY_ELEMS(matroska_doctypes); i++) {
-        int probelen = strlen(matroska_doctypes[i]);
-        if (total < probelen)
-            continue;
-        for (n = 4+size; n <= 4+size+total-probelen; n++)
-            if (!memcmp(p->buf+n, matroska_doctypes[i], probelen))
-                return AVPROBE_SCORE_MAX;
-    }
-
-    // probably valid EBML header but no recognized doctype
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-static MatroskaTrack *matroska_find_track_by_num(MatroskaDemuxContext *matroska,
-                                                 int num)
-{
-    MatroskaTrack *tracks = matroska->tracks.elem;
-    int i;
-
-    for (i=0; i < matroska->tracks.nb_elem; i++)
-        if (tracks[i].num == num)
-            return &tracks[i];
-
-    av_log(matroska->ctx, AV_LOG_ERROR, "Invalid track number %d\n", num);
-    return NULL;
-}
-
-static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
-                                  MatroskaTrack *track)
-{
-    MatroskaTrackEncoding *encodings = track->encodings.elem;
-    uint8_t* data = *buf;
-    int isize = *buf_size;
-    uint8_t* pkt_data = NULL;
-    uint8_t av_unused *newpktdata;
-    int pkt_size = isize;
-    int result = 0;
-    int olen;
-
-    if (pkt_size >= 10000000)
-        return AVERROR_INVALIDDATA;
-
-    switch (encodings[0].compression.algo) {
-    case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP: {
-        int header_size = encodings[0].compression.settings.size;
-        uint8_t *header = encodings[0].compression.settings.data;
-
-        if (!header_size)
-            return 0;
-
-        pkt_size = isize + header_size;
-        pkt_data = av_malloc(pkt_size);
-        if (!pkt_data)
-            return AVERROR(ENOMEM);
-
-        memcpy(pkt_data, header, header_size);
-        memcpy(pkt_data + header_size, data, isize);
-        break;
-    }
-#if CONFIG_LZO
-    case MATROSKA_TRACK_ENCODING_COMP_LZO:
-        do {
-            olen = pkt_size *= 3;
-            newpktdata = av_realloc(pkt_data, pkt_size + AV_LZO_OUTPUT_PADDING);
-            if (!newpktdata) {
-                result = AVERROR(ENOMEM);
-                goto failed;
-            }
-            pkt_data = newpktdata;
-            result = av_lzo1x_decode(pkt_data, &olen, data, &isize);
-        } while (result==AV_LZO_OUTPUT_FULL && pkt_size<10000000);
-        if (result) {
-            result = AVERROR_INVALIDDATA;
-            goto failed;
-        }
-        pkt_size -= olen;
-        break;
-#endif
-#if CONFIG_ZLIB
-    case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {
-        z_stream zstream = {0};
-        if (inflateInit(&zstream) != Z_OK)
-            return -1;
-        zstream.next_in = data;
-        zstream.avail_in = isize;
-        do {
-            pkt_size *= 3;
-            newpktdata = av_realloc(pkt_data, pkt_size);
-            if (!newpktdata) {
-                inflateEnd(&zstream);
-                goto failed;
-            }
-            pkt_data = newpktdata;
-            zstream.avail_out = pkt_size - zstream.total_out;
-            zstream.next_out = pkt_data + zstream.total_out;
-            result = inflate(&zstream, Z_NO_FLUSH);
-        } while (result==Z_OK && pkt_size<10000000);
-        pkt_size = zstream.total_out;
-        inflateEnd(&zstream);
-        if (result != Z_STREAM_END) {
-            if (result == Z_MEM_ERROR)
-                result = AVERROR(ENOMEM);
-            else
-                result = AVERROR_INVALIDDATA;
-            goto failed;
-        }
-        break;
-    }
-#endif
-#if CONFIG_BZLIB
-    case MATROSKA_TRACK_ENCODING_COMP_BZLIB: {
-        bz_stream bzstream = {0};
-        if (BZ2_bzDecompressInit(&bzstream, 0, 0) != BZ_OK)
-            return -1;
-        bzstream.next_in = data;
-        bzstream.avail_in = isize;
-        do {
-            pkt_size *= 3;
-            newpktdata = av_realloc(pkt_data, pkt_size);
-            if (!newpktdata) {
-                BZ2_bzDecompressEnd(&bzstream);
-                goto failed;
-            }
-            pkt_data = newpktdata;
-            bzstream.avail_out = pkt_size - bzstream.total_out_lo32;
-            bzstream.next_out = pkt_data + bzstream.total_out_lo32;
-            result = BZ2_bzDecompress(&bzstream);
-        } while (result==BZ_OK && pkt_size<10000000);
-        pkt_size = bzstream.total_out_lo32;
-        BZ2_bzDecompressEnd(&bzstream);
-        if (result != BZ_STREAM_END) {
-            if (result == BZ_MEM_ERROR)
-                result = AVERROR(ENOMEM);
-            else
-                result = AVERROR_INVALIDDATA;
-            goto failed;
-        }
-        break;
-    }
-#endif
-    default:
-        return AVERROR_INVALIDDATA;
-    }
-
-    *buf = pkt_data;
-    *buf_size = pkt_size;
-    return 0;
- failed:
-    av_free(pkt_data);
-    return result;
-}
-
-static void matroska_fix_ass_packet(MatroskaDemuxContext *matroska,
-                                    AVPacket *pkt, uint64_t display_duration)
-{
-    AVBufferRef *line;
-    char *layer, *ptr = pkt->data, *end = ptr+pkt->size;
-    for (; *ptr!=',' && ptr<end-1; ptr++);
-    if (*ptr == ',')
-        layer = ++ptr;
-    for (; *ptr!=',' && ptr<end-1; ptr++);
-    if (*ptr == ',') {
-        int64_t end_pts = pkt->pts + display_duration;
-        int sc = matroska->time_scale * pkt->pts / 10000000;
-        int ec = matroska->time_scale * end_pts  / 10000000;
-        int sh, sm, ss, eh, em, es, len;
-        sh = sc/360000;  sc -= 360000*sh;
-        sm = sc/  6000;  sc -=   6000*sm;
-        ss = sc/   100;  sc -=    100*ss;
-        eh = ec/360000;  ec -= 360000*eh;
-        em = ec/  6000;  ec -=   6000*em;
-        es = ec/   100;  ec -=    100*es;
-        *ptr++ = '\0';
-        len = 50 + end-ptr + FF_INPUT_BUFFER_PADDING_SIZE;
-        if (!(line = av_buffer_alloc(len)))
-            return;
-        snprintf(line->data, len,"Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s\r\n",
-                 layer, sh, sm, ss, sc, eh, em, es, ec, ptr);
-        av_buffer_unref(&pkt->buf);
-        pkt->buf  = line;
-        pkt->data = line->data;
-        pkt->size = strlen(line->data);
-    }
-}
-
-static int matroska_merge_packets(AVPacket *out, AVPacket *in)
-{
-    int old_size = out->size;
-    int ret = av_grow_packet(out, in->size);
-    if (ret < 0)
-        return ret;
-
-    memcpy(out->data + old_size, in->data, in->size);
-
-    av_free_packet(in);
-    av_free(in);
-    return 0;
-}
-
-static void matroska_convert_tag(AVFormatContext *s, EbmlList *list,
-                                 AVDictionary **metadata, char *prefix)
-{
-    MatroskaTag *tags = list->elem;
-    char key[1024];
-    int i;
-
-    for (i=0; i < list->nb_elem; i++) {
-        const char *lang = tags[i].lang && strcmp(tags[i].lang, "und") ?
-                           tags[i].lang : NULL;
-
-        if (!tags[i].name) {
-            av_log(s, AV_LOG_WARNING, "Skipping invalid tag with no TagName.\n");
-            continue;
-        }
-        if (prefix)  snprintf(key, sizeof(key), "%s/%s", prefix, tags[i].name);
-        else         av_strlcpy(key, tags[i].name, sizeof(key));
-        if (tags[i].def || !lang) {
-        av_dict_set(metadata, key, tags[i].string, 0);
-        if (tags[i].sub.nb_elem)
-            matroska_convert_tag(s, &tags[i].sub, metadata, key);
-        }
-        if (lang) {
-            av_strlcat(key, "-", sizeof(key));
-            av_strlcat(key, lang, sizeof(key));
-            av_dict_set(metadata, key, tags[i].string, 0);
-            if (tags[i].sub.nb_elem)
-                matroska_convert_tag(s, &tags[i].sub, metadata, key);
-        }
-    }
-    ff_metadata_conv(metadata, NULL, ff_mkv_metadata_conv);
-}
-
-static void matroska_convert_tags(AVFormatContext *s)
-{
-    MatroskaDemuxContext *matroska = s->priv_data;
-    MatroskaTags *tags = matroska->tags.elem;
-    int i, j;
-
-    for (i=0; i < matroska->tags.nb_elem; i++) {
-        if (tags[i].target.attachuid) {
-            MatroskaAttachement *attachment = matroska->attachments.elem;
-            for (j=0; j<matroska->attachments.nb_elem; j++)
-                if (attachment[j].uid == tags[i].target.attachuid
-                    && attachment[j].stream)
-                    matroska_convert_tag(s, &tags[i].tag,
-                                         &attachment[j].stream->metadata, NULL);
-        } else if (tags[i].target.chapteruid) {
-            MatroskaChapter *chapter = matroska->chapters.elem;
-            for (j=0; j<matroska->chapters.nb_elem; j++)
-                if (chapter[j].uid == tags[i].target.chapteruid
-                    && chapter[j].chapter)
-                    matroska_convert_tag(s, &tags[i].tag,
-                                         &chapter[j].chapter->metadata, NULL);
-        } else if (tags[i].target.trackuid) {
-            MatroskaTrack *track = matroska->tracks.elem;
-            for (j=0; j<matroska->tracks.nb_elem; j++)
-                if (track[j].uid == tags[i].target.trackuid && track[j].stream)
-                    matroska_convert_tag(s, &tags[i].tag,
-                                         &track[j].stream->metadata, NULL);
-        } else {
-            matroska_convert_tag(s, &tags[i].tag, &s->metadata,
-                                 tags[i].target.type);
-        }
-    }
-}
-
-static int matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska, int idx)
-{
-    EbmlList *seekhead_list = &matroska->seekhead;
-    MatroskaSeekhead *seekhead = seekhead_list->elem;
-    uint32_t level_up = matroska->level_up;
-    int64_t before_pos = avio_tell(matroska->ctx->pb);
-    uint32_t saved_id = matroska->current_id;
-    MatroskaLevel level;
-    int64_t offset;
-    int ret = 0;
-
-    if (idx >= seekhead_list->nb_elem
-            || seekhead[idx].id == MATROSKA_ID_SEEKHEAD
-            || seekhead[idx].id == MATROSKA_ID_CLUSTER)
-        return 0;
-
-    /* seek */
-    offset = seekhead[idx].pos + matroska->segment_start;
-    if (avio_seek(matroska->ctx->pb, offset, SEEK_SET) == offset) {
-        /* We don't want to lose our seekhead level, so we add
-         * a dummy. This is a crude hack. */
-        if (matroska->num_levels == EBML_MAX_DEPTH) {
-            av_log(matroska->ctx, AV_LOG_INFO,
-                   "Max EBML element depth (%d) reached, "
-                   "cannot parse further.\n", EBML_MAX_DEPTH);
-            ret = AVERROR_INVALIDDATA;
-        } else {
-            level.start = 0;
-            level.length = (uint64_t)-1;
-            matroska->levels[matroska->num_levels] = level;
-            matroska->num_levels++;
-            matroska->current_id = 0;
-
-            ret = ebml_parse(matroska, matroska_segment, matroska);
-
-            /* remove dummy level */
-            while (matroska->num_levels) {
-                uint64_t length = matroska->levels[--matroska->num_levels].length;
-                if (length == (uint64_t)-1)
-                    break;
-            }
-        }
-    }
-    /* seek back */
-    avio_seek(matroska->ctx->pb, before_pos, SEEK_SET);
-    matroska->level_up = level_up;
-    matroska->current_id = saved_id;
-
-    return ret;
-}
-
-static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
-{
-    EbmlList *seekhead_list = &matroska->seekhead;
-    int64_t before_pos = avio_tell(matroska->ctx->pb);
-    int i;
-
-    // we should not do any seeking in the streaming case
-    if (!matroska->ctx->pb->seekable ||
-        (matroska->ctx->flags & AVFMT_FLAG_IGNIDX))
-        return;
-
-    for (i = 0; i < seekhead_list->nb_elem; i++) {
-        MatroskaSeekhead *seekhead = seekhead_list->elem;
-        if (seekhead[i].pos <= before_pos)
-            continue;
-
-        // defer cues parsing until we actually need cue data.
-        if (seekhead[i].id == MATROSKA_ID_CUES) {
-            matroska->cues_parsing_deferred = 1;
-            continue;
-        }
-
-        if (matroska_parse_seekhead_entry(matroska, i) < 0)
-            break;
-    }
-}
-
-static void matroska_parse_cues(MatroskaDemuxContext *matroska) {
-    EbmlList *seekhead_list = &matroska->seekhead;
-    MatroskaSeekhead *seekhead = seekhead_list->elem;
-    EbmlList *index_list;
-    MatroskaIndex *index;
-    int index_scale = 1;
-    int i, j;
-
-    for (i = 0; i < seekhead_list->nb_elem; i++)
-        if (seekhead[i].id == MATROSKA_ID_CUES)
-            break;
-    assert(i <= seekhead_list->nb_elem);
-
-    matroska_parse_seekhead_entry(matroska, i);
-
-    index_list = &matroska->index;
-    index = index_list->elem;
-    if (index_list->nb_elem
-        && index[0].time > 1E14/matroska->time_scale) {
-        av_log(matroska->ctx, AV_LOG_WARNING, "Working around broken index.\n");
-        index_scale = matroska->time_scale;
-    }
-    for (i = 0; i < index_list->nb_elem; i++) {
-        EbmlList *pos_list = &index[i].pos;
-        MatroskaIndexPos *pos = pos_list->elem;
-        for (j = 0; j < pos_list->nb_elem; j++) {
-            MatroskaTrack *track = matroska_find_track_by_num(matroska, pos[j].track);
-            if (track && track->stream)
-                av_add_index_entry(track->stream,
-                                   pos[j].pos + matroska->segment_start,
-                                   index[i].time/index_scale, 0, 0,
-                                   AVINDEX_KEYFRAME);
-        }
-    }
-}
-
-static int matroska_aac_profile(char *codec_id)
-{
-    static const char * const aac_profiles[] = { "MAIN", "LC", "SSR" };
-    int profile;
-
-    for (profile=0; profile<FF_ARRAY_ELEMS(aac_profiles); profile++)
-        if (strstr(codec_id, aac_profiles[profile]))
-            break;
-    return profile + 1;
-}
-
-static int matroska_aac_sri(int samplerate)
-{
-    int sri;
-
-    for (sri=0; sri<FF_ARRAY_ELEMS(avpriv_mpeg4audio_sample_rates); sri++)
-        if (avpriv_mpeg4audio_sample_rates[sri] == samplerate)
-            break;
-    return sri;
-}
-
-static int matroska_read_header(AVFormatContext *s)
-{
-    MatroskaDemuxContext *matroska = s->priv_data;
-    EbmlList *attachements_list = &matroska->attachments;
-    MatroskaAttachement *attachements;
-    EbmlList *chapters_list = &matroska->chapters;
-    MatroskaChapter *chapters;
-    MatroskaTrack *tracks;
-    uint64_t max_start = 0;
-    int64_t pos;
-    Ebml ebml = { 0 };
-    AVStream *st;
-    int i, j, res;
-
-    matroska->ctx = s;
-
-    /* First read the EBML header. */
-    if (ebml_parse(matroska, ebml_syntax, &ebml)
-        || ebml.version > EBML_VERSION       || ebml.max_size > sizeof(uint64_t)
-        || ebml.id_length > sizeof(uint32_t) || ebml.doctype_version > 2) {
-        av_log(matroska->ctx, AV_LOG_ERROR,
-               "EBML header using unsupported features\n"
-               "(EBML version %"PRIu64", doctype %s, doc version %"PRIu64")\n",
-               ebml.version, ebml.doctype, ebml.doctype_version);
-        ebml_free(ebml_syntax, &ebml);
-        return AVERROR_PATCHWELCOME;
-    }
-    for (i = 0; i < FF_ARRAY_ELEMS(matroska_doctypes); i++)
-        if (!strcmp(ebml.doctype, matroska_doctypes[i]))
-            break;
-    if (i >= FF_ARRAY_ELEMS(matroska_doctypes)) {
-        av_log(s, AV_LOG_WARNING, "Unknown EBML doctype '%s'\n", ebml.doctype);
-        if (matroska->ctx->error_recognition & AV_EF_EXPLODE) {
-            ebml_free(ebml_syntax, &ebml);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    ebml_free(ebml_syntax, &ebml);
-
-    /* The next thing is a segment. */
-    pos = avio_tell(matroska->ctx->pb);
-    res = ebml_parse(matroska, matroska_segments, matroska);
-    // try resyncing until we find a EBML_STOP type element.
-    while (res != 1) {
-        res = matroska_resync(matroska, pos);
-        if (res < 0)
-            return res;
-        pos = avio_tell(matroska->ctx->pb);
-        res = ebml_parse(matroska, matroska_segment, matroska);
-    }
-    matroska_execute_seekhead(matroska);
-
-    if (!matroska->time_scale)
-        matroska->time_scale = 1000000;
-    if (matroska->duration)
-        matroska->ctx->duration = matroska->duration * matroska->time_scale
-                                  * 1000 / AV_TIME_BASE;
-    av_dict_set(&s->metadata, "title", matroska->title, 0);
-
-    tracks = matroska->tracks.elem;
-    for (i=0; i < matroska->tracks.nb_elem; i++) {
-        MatroskaTrack *track = &tracks[i];
-        enum AVCodecID codec_id = AV_CODEC_ID_NONE;
-        EbmlList *encodings_list = &track->encodings;
-        MatroskaTrackEncoding *encodings = encodings_list->elem;
-        uint8_t *extradata = NULL;
-        int extradata_size = 0;
-        int extradata_offset = 0;
-        AVIOContext b;
-
-        /* Apply some sanity checks. */
-        if (track->type != MATROSKA_TRACK_TYPE_VIDEO &&
-            track->type != MATROSKA_TRACK_TYPE_AUDIO &&
-            track->type != MATROSKA_TRACK_TYPE_SUBTITLE) {
-            av_log(matroska->ctx, AV_LOG_INFO,
-                   "Unknown or unsupported track type %"PRIu64"\n",
-                   track->type);
-            continue;
-        }
-        if (track->codec_id == NULL)
-            continue;
-
-        if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
-            if (!track->default_duration && track->video.frame_rate > 0)
-                track->default_duration = 1000000000/track->video.frame_rate;
-            if (!track->video.display_width)
-                track->video.display_width = track->video.pixel_width;
-            if (!track->video.display_height)
-                track->video.display_height = track->video.pixel_height;
-        } else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) {
-            if (!track->audio.out_samplerate)
-                track->audio.out_samplerate = track->audio.samplerate;
-        }
-        if (encodings_list->nb_elem > 1) {
-            av_log(matroska->ctx, AV_LOG_ERROR,
-                   "Multiple combined encodings not supported");
-        } else if (encodings_list->nb_elem == 1) {
-            if (encodings[0].type ||
-                (
-#if CONFIG_ZLIB
-                 encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_ZLIB &&
-#endif
-#if CONFIG_BZLIB
-                 encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_BZLIB &&
-#endif
-#if CONFIG_LZO
-                 encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_LZO &&
-#endif
-                 encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP)) {
-                encodings[0].scope = 0;
-                av_log(matroska->ctx, AV_LOG_ERROR,
-                       "Unsupported encoding type");
-            } else if (track->codec_priv.size && encodings[0].scope&2) {
-                uint8_t *codec_priv = track->codec_priv.data;
-                int ret = matroska_decode_buffer(&track->codec_priv.data,
-                                                 &track->codec_priv.size,
-                                                 track);
-                if (ret < 0) {
-                    track->codec_priv.data = NULL;
-                    track->codec_priv.size = 0;
-                    av_log(matroska->ctx, AV_LOG_ERROR,
-                           "Failed to decode codec private data\n");
-                }
-
-                if (codec_priv != track->codec_priv.data)
-                    av_free(codec_priv);
-            }
-        }
-
-        for(j=0; ff_mkv_codec_tags[j].id != AV_CODEC_ID_NONE; j++){
-            if(!strncmp(ff_mkv_codec_tags[j].str, track->codec_id,
-                        strlen(ff_mkv_codec_tags[j].str))){
-                codec_id= ff_mkv_codec_tags[j].id;
-                break;
-            }
-        }
-
-        st = track->stream = avformat_new_stream(s, NULL);
-        if (st == NULL)
-            return AVERROR(ENOMEM);
-
-        if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC")
-            && track->codec_priv.size >= 40
-            && track->codec_priv.data != NULL) {
-            track->ms_compat = 1;
-            track->video.fourcc = AV_RL32(track->codec_priv.data + 16);
-            codec_id = ff_codec_get_id(ff_codec_bmp_tags, track->video.fourcc);
-            extradata_offset = 40;
-        } else if (!strcmp(track->codec_id, "A_MS/ACM")
-                   && track->codec_priv.size >= 14
-                   && track->codec_priv.data != NULL) {
-            int ret;
-            ffio_init_context(&b, track->codec_priv.data, track->codec_priv.size,
-                              0, NULL, NULL, NULL, NULL);
-            ret = ff_get_wav_header(&b, st->codec, track->codec_priv.size);
-            if (ret < 0)
-                return ret;
-            codec_id = st->codec->codec_id;
-            extradata_offset = FFMIN(track->codec_priv.size, 18);
-        } else if (!strcmp(track->codec_id, "V_QUICKTIME")
-                   && (track->codec_priv.size >= 86)
-                   && (track->codec_priv.data != NULL)) {
-            track->video.fourcc = AV_RL32(track->codec_priv.data);
-            codec_id=ff_codec_get_id(ff_codec_movvideo_tags, track->video.fourcc);
-        } else if (codec_id == AV_CODEC_ID_PCM_S16BE) {
-            switch (track->audio.bitdepth) {
-            case  8:  codec_id = AV_CODEC_ID_PCM_U8;     break;
-            case 24:  codec_id = AV_CODEC_ID_PCM_S24BE;  break;
-            case 32:  codec_id = AV_CODEC_ID_PCM_S32BE;  break;
-            }
-        } else if (codec_id == AV_CODEC_ID_PCM_S16LE) {
-            switch (track->audio.bitdepth) {
-            case  8:  codec_id = AV_CODEC_ID_PCM_U8;     break;
-            case 24:  codec_id = AV_CODEC_ID_PCM_S24LE;  break;
-            case 32:  codec_id = AV_CODEC_ID_PCM_S32LE;  break;
-            }
-        } else if (codec_id==AV_CODEC_ID_PCM_F32LE && track->audio.bitdepth==64) {
-            codec_id = AV_CODEC_ID_PCM_F64LE;
-        } else if (codec_id == AV_CODEC_ID_AAC && !track->codec_priv.size) {
-            int profile = matroska_aac_profile(track->codec_id);
-            int sri = matroska_aac_sri(track->audio.samplerate);
-            extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (extradata == NULL)
-                return AVERROR(ENOMEM);
-            extradata[0] = (profile << 3) | ((sri&0x0E) >> 1);
-            extradata[1] = ((sri&0x01) << 7) | (track->audio.channels<<3);
-            if (strstr(track->codec_id, "SBR")) {
-                sri = matroska_aac_sri(track->audio.out_samplerate);
-                extradata[2] = 0x56;
-                extradata[3] = 0xE5;
-                extradata[4] = 0x80 | (sri<<3);
-                extradata_size = 5;
-            } else
-                extradata_size = 2;
-        } else if (codec_id == AV_CODEC_ID_ALAC && track->codec_priv.size) {
-            /* Only ALAC's magic cookie is stored in Matroska's track headers.
-               Create the "atom size", "tag", and "tag version" fields the
-               decoder expects manually. */
-            extradata_size = 12 + track->codec_priv.size;
-            extradata = av_mallocz(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (extradata == NULL)
-                return AVERROR(ENOMEM);
-            AV_WB32(extradata, extradata_size);
-            memcpy(&extradata[4], "alac", 4);
-            AV_WB32(&extradata[8], 0);
-            memcpy(&extradata[12], track->codec_priv.data,
-                                   track->codec_priv.size);
-        } else if (codec_id == AV_CODEC_ID_TTA) {
-            extradata_size = 30;
-            extradata = av_mallocz(extradata_size);
-            if (extradata == NULL)
-                return AVERROR(ENOMEM);
-            ffio_init_context(&b, extradata, extradata_size, 1,
-                          NULL, NULL, NULL, NULL);
-            avio_write(&b, "TTA1", 4);
-            avio_wl16(&b, 1);
-            avio_wl16(&b, track->audio.channels);
-            avio_wl16(&b, track->audio.bitdepth);
-            avio_wl32(&b, track->audio.out_samplerate);
-            avio_wl32(&b, matroska->ctx->duration * track->audio.out_samplerate);
-        } else if (codec_id == AV_CODEC_ID_RV10 || codec_id == AV_CODEC_ID_RV20 ||
-                   codec_id == AV_CODEC_ID_RV30 || codec_id == AV_CODEC_ID_RV40) {
-            extradata_offset = 26;
-        } else if (codec_id == AV_CODEC_ID_RA_144) {
-            track->audio.out_samplerate = 8000;
-            track->audio.channels = 1;
-        } else if (codec_id == AV_CODEC_ID_RA_288 || codec_id == AV_CODEC_ID_COOK ||
-                   codec_id == AV_CODEC_ID_ATRAC3 || codec_id == AV_CODEC_ID_SIPR) {
-            int flavor;
-            ffio_init_context(&b, track->codec_priv.data,track->codec_priv.size,
-                          0, NULL, NULL, NULL, NULL);
-            avio_skip(&b, 22);
-            flavor                       = avio_rb16(&b);
-            track->audio.coded_framesize = avio_rb32(&b);
-            avio_skip(&b, 12);
-            track->audio.sub_packet_h    = avio_rb16(&b);
-            track->audio.frame_size      = avio_rb16(&b);
-            track->audio.sub_packet_size = avio_rb16(&b);
-            if (flavor <= 0 || track->audio.coded_framesize <= 0 ||
-                track->audio.sub_packet_h <= 0 || track->audio.frame_size <= 0 ||
-                track->audio.sub_packet_size <= 0)
-                return AVERROR_INVALIDDATA;
-            track->audio.buf = av_malloc(track->audio.frame_size * track->audio.sub_packet_h);
-            if (codec_id == AV_CODEC_ID_RA_288) {
-                st->codec->block_align = track->audio.coded_framesize;
-                track->codec_priv.size = 0;
-            } else {
-                if (codec_id == AV_CODEC_ID_SIPR && flavor < 4) {
-                    const int sipr_bit_rate[4] = { 6504, 8496, 5000, 16000 };
-                    track->audio.sub_packet_size = ff_sipr_subpk_size[flavor];
-                    st->codec->bit_rate = sipr_bit_rate[flavor];
-                }
-                st->codec->block_align = track->audio.sub_packet_size;
-                extradata_offset = 78;
-            }
-        }
-        track->codec_priv.size -= extradata_offset;
-
-        if (codec_id == AV_CODEC_ID_NONE)
-            av_log(matroska->ctx, AV_LOG_INFO,
-                   "Unknown/unsupported AVCodecID %s.\n", track->codec_id);
-
-        if (track->time_scale < 0.01)
-            track->time_scale = 1.0;
-        avpriv_set_pts_info(st, 64, matroska->time_scale*track->time_scale, 1000*1000*1000); /* 64 bit pts in ns */
-
-        /* convert the delay from ns to the track timebase */
-        track->codec_delay = av_rescale_q(track->codec_delay,
-                                          (AVRational){ 1, 1000000000 },
-                                          st->time_base);
-
-        st->codec->codec_id = codec_id;
-        st->start_time = 0;
-        if (strcmp(track->language, "und"))
-            av_dict_set(&st->metadata, "language", track->language, 0);
-        av_dict_set(&st->metadata, "title", track->name, 0);
-
-        if (track->flag_default)
-            st->disposition |= AV_DISPOSITION_DEFAULT;
-        if (track->flag_forced)
-            st->disposition |= AV_DISPOSITION_FORCED;
-
-        if (!st->codec->extradata) {
-            if(extradata){
-                st->codec->extradata = extradata;
-                st->codec->extradata_size = extradata_size;
-            } else if(track->codec_priv.data && track->codec_priv.size > 0){
-                st->codec->extradata = av_mallocz(track->codec_priv.size +
-                                                  FF_INPUT_BUFFER_PADDING_SIZE);
-                if(st->codec->extradata == NULL)
-                    return AVERROR(ENOMEM);
-                st->codec->extradata_size = track->codec_priv.size;
-                memcpy(st->codec->extradata,
-                       track->codec_priv.data + extradata_offset,
-                       track->codec_priv.size);
-            }
-        }
-
-        if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_tag  = track->video.fourcc;
-            st->codec->width  = track->video.pixel_width;
-            st->codec->height = track->video.pixel_height;
-            av_reduce(&st->sample_aspect_ratio.num,
-                      &st->sample_aspect_ratio.den,
-                      st->codec->height * track->video.display_width,
-                      st->codec-> width * track->video.display_height,
-                      255);
-            if (st->codec->codec_id != AV_CODEC_ID_H264 &&
-                st->codec->codec_id != AV_CODEC_ID_HEVC)
-                st->need_parsing = AVSTREAM_PARSE_HEADERS;
-            if (track->default_duration) {
-                av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
-                          1000000000, track->default_duration, 30000);
-            }
-        } else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) {
-            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            st->codec->sample_rate = track->audio.out_samplerate;
-            st->codec->channels = track->audio.channels;
-            if (st->codec->codec_id != AV_CODEC_ID_AAC)
-            st->need_parsing = AVSTREAM_PARSE_HEADERS;
-        } else if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE) {
-            st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-            if (st->codec->codec_id == AV_CODEC_ID_SSA)
-                matroska->contains_ssa = 1;
-        }
-    }
-
-    attachements = attachements_list->elem;
-    for (j=0; j<attachements_list->nb_elem; j++) {
-        if (!(attachements[j].filename && attachements[j].mime &&
-              attachements[j].bin.data && attachements[j].bin.size > 0)) {
-            av_log(matroska->ctx, AV_LOG_ERROR, "incomplete attachment\n");
-        } else {
-            AVStream *st = avformat_new_stream(s, NULL);
-            if (st == NULL)
-                break;
-            av_dict_set(&st->metadata, "filename",attachements[j].filename, 0);
-            av_dict_set(&st->metadata, "mimetype", attachements[j].mime, 0);
-            st->codec->codec_id = AV_CODEC_ID_NONE;
-            st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
-            st->codec->extradata  = av_malloc(attachements[j].bin.size);
-            if(st->codec->extradata == NULL)
-                break;
-            st->codec->extradata_size = attachements[j].bin.size;
-            memcpy(st->codec->extradata, attachements[j].bin.data, attachements[j].bin.size);
-
-            for (i=0; ff_mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++) {
-                if (!strncmp(ff_mkv_mime_tags[i].str, attachements[j].mime,
-                             strlen(ff_mkv_mime_tags[i].str))) {
-                    st->codec->codec_id = ff_mkv_mime_tags[i].id;
-                    break;
-                }
-            }
-            attachements[j].stream = st;
-        }
-    }
-
-    chapters = chapters_list->elem;
-    for (i=0; i<chapters_list->nb_elem; i++)
-        if (chapters[i].start != AV_NOPTS_VALUE && chapters[i].uid
-            && (max_start==0 || chapters[i].start > max_start)) {
-            chapters[i].chapter =
-            avpriv_new_chapter(s, chapters[i].uid, (AVRational){1, 1000000000},
-                           chapters[i].start, chapters[i].end,
-                           chapters[i].title);
-            av_dict_set(&chapters[i].chapter->metadata,
-                             "title", chapters[i].title, 0);
-            max_start = chapters[i].start;
-        }
-
-    matroska_convert_tags(s);
-
-    return 0;
-}
-
-/*
- * Put one packet in an application-supplied AVPacket struct.
- * Returns 0 on success or -1 on failure.
- */
-static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
-                                   AVPacket *pkt)
-{
-    if (matroska->num_packets > 0) {
-        memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
-        av_free(matroska->packets[0]);
-        if (matroska->num_packets > 1) {
-            void *newpackets;
-            memmove(&matroska->packets[0], &matroska->packets[1],
-                    (matroska->num_packets - 1) * sizeof(AVPacket *));
-            newpackets = av_realloc(matroska->packets,
-                            (matroska->num_packets - 1) * sizeof(AVPacket *));
-            if (newpackets)
-                matroska->packets = newpackets;
-        } else {
-            av_freep(&matroska->packets);
-            matroska->prev_pkt = NULL;
-        }
-        matroska->num_packets--;
-        return 0;
-    }
-
-    return -1;
-}
-
-/*
- * Free all packets in our internal queue.
- */
-static void matroska_clear_queue(MatroskaDemuxContext *matroska)
-{
-    matroska->prev_pkt = NULL;
-    if (matroska->packets) {
-        int n;
-        for (n = 0; n < matroska->num_packets; n++) {
-            av_free_packet(matroska->packets[n]);
-            av_free(matroska->packets[n]);
-        }
-        av_freep(&matroska->packets);
-        matroska->num_packets = 0;
-    }
-}
-
-static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
-                                int* buf_size, int type,
-                                uint32_t **lace_buf, int *laces)
-{
-    int res = 0, n, size = *buf_size;
-    uint8_t *data = *buf;
-    uint32_t *lace_size;
-
-    if (!type) {
-        *laces = 1;
-        *lace_buf = av_mallocz(sizeof(int));
-        if (!*lace_buf)
-            return AVERROR(ENOMEM);
-
-        *lace_buf[0] = size;
-        return 0;
-    }
-
-    assert(size > 0);
-    *laces = *data + 1;
-    data += 1;
-    size -= 1;
-    lace_size = av_mallocz(*laces * sizeof(int));
-    if (!lace_size)
-        return AVERROR(ENOMEM);
-
-    switch (type) {
-    case 0x1: /* Xiph lacing */ {
-        uint8_t temp;
-        uint32_t total = 0;
-        for (n = 0; res == 0 && n < *laces - 1; n++) {
-            while (1) {
-                if (size == 0) {
-                    res = AVERROR_EOF;
-                    break;
-                }
-                temp = *data;
-                lace_size[n] += temp;
-                data += 1;
-                size -= 1;
-                if (temp != 0xff)
-                    break;
-            }
-            total += lace_size[n];
-        }
-        if (size <= total) {
-            res = AVERROR_INVALIDDATA;
-            break;
-        }
-
-        lace_size[n] = size - total;
-        break;
-    }
-
-    case 0x2: /* fixed-size lacing */
-        if (size % (*laces)) {
-            res = AVERROR_INVALIDDATA;
-            break;
-        }
-        for (n = 0; n < *laces; n++)
-            lace_size[n] = size / *laces;
-        break;
-
-    case 0x3: /* EBML lacing */ {
-        uint64_t num;
-        uint64_t total;
-        n = matroska_ebmlnum_uint(matroska, data, size, &num);
-        if (n < 0) {
-            av_log(matroska->ctx, AV_LOG_INFO,
-                   "EBML block data error\n");
-            res = n;
-            break;
-        }
-        data += n;
-        size -= n;
-        total = lace_size[0] = num;
-        for (n = 1; res == 0 && n < *laces - 1; n++) {
-            int64_t snum;
-            int r;
-            r = matroska_ebmlnum_sint(matroska, data, size, &snum);
-            if (r < 0) {
-                av_log(matroska->ctx, AV_LOG_INFO,
-                       "EBML block data error\n");
-                res = r;
-                break;
-            }
-            data += r;
-            size -= r;
-            lace_size[n] = lace_size[n - 1] + snum;
-            total += lace_size[n];
-        }
-        if (size <= total) {
-            res = AVERROR_INVALIDDATA;
-            break;
-        }
-        lace_size[*laces - 1] = size - total;
-        break;
-    }
-    }
-
-    *buf      = data;
-    *lace_buf = lace_size;
-    *buf_size = size;
-
-    return res;
-}
-
-static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
-                                   MatroskaTrack *track,
-                                   AVStream *st,
-                                   uint8_t *data, int size,
-                                   uint64_t timecode, uint64_t duration,
-                                   int64_t pos)
-{
-    int a = st->codec->block_align;
-    int sps = track->audio.sub_packet_size;
-    int cfs = track->audio.coded_framesize;
-    int h = track->audio.sub_packet_h;
-    int y = track->audio.sub_packet_cnt;
-    int w = track->audio.frame_size;
-    int x;
-
-    if (!track->audio.pkt_cnt) {
-        if (track->audio.sub_packet_cnt == 0)
-            track->audio.buf_timecode = timecode;
-        if (st->codec->codec_id == AV_CODEC_ID_RA_288) {
-            if (size < cfs * h / 2) {
-                av_log(matroska->ctx, AV_LOG_ERROR,
-                       "Corrupt int4 RM-style audio packet size\n");
-                return AVERROR_INVALIDDATA;
-            }
-            for (x=0; x<h/2; x++)
-                memcpy(track->audio.buf+x*2*w+y*cfs,
-                       data+x*cfs, cfs);
-        } else if (st->codec->codec_id == AV_CODEC_ID_SIPR) {
-            if (size < w) {
-                av_log(matroska->ctx, AV_LOG_ERROR,
-                       "Corrupt sipr RM-style audio packet size\n");
-                return AVERROR_INVALIDDATA;
-            }
-            memcpy(track->audio.buf + y*w, data, w);
-        } else {
-            if (size < sps * w / sps) {
-                av_log(matroska->ctx, AV_LOG_ERROR,
-                       "Corrupt generic RM-style audio packet size\n");
-                return AVERROR_INVALIDDATA;
-            }
-            for (x=0; x<w/sps; x++)
-                memcpy(track->audio.buf+sps*(h*x+((h+1)/2)*(y&1)+(y>>1)), data+x*sps, sps);
-        }
-
-        if (++track->audio.sub_packet_cnt >= h) {
-            if (st->codec->codec_id == AV_CODEC_ID_SIPR)
-                ff_rm_reorder_sipr_data(track->audio.buf, h, w);
-            track->audio.sub_packet_cnt = 0;
-            track->audio.pkt_cnt = h*w / a;
-        }
-    }
-
-    while (track->audio.pkt_cnt) {
-        AVPacket *pkt = av_mallocz(sizeof(AVPacket));
-        av_new_packet(pkt, a);
-        memcpy(pkt->data, track->audio.buf
-               + a * (h*w / a - track->audio.pkt_cnt--), a);
-        pkt->pts = track->audio.buf_timecode;
-        track->audio.buf_timecode = AV_NOPTS_VALUE;
-        pkt->pos = pos;
-        pkt->stream_index = st->index;
-        dynarray_add(&matroska->packets,&matroska->num_packets,pkt);
-    }
-
-    return 0;
-}
-
-/* reconstruct full wavpack blocks from mangled matroska ones */
-static int matroska_parse_wavpack(MatroskaTrack *track, uint8_t *src,
-                                  uint8_t **pdst, int *size)
-{
-    uint8_t *dst = NULL;
-    int dstlen   = 0;
-    int srclen   = *size;
-    uint32_t samples;
-    uint16_t ver;
-    int ret, offset = 0;
-
-    if (srclen < 12 || track->stream->codec->extradata_size < 2)
-        return AVERROR_INVALIDDATA;
-
-    ver = AV_RL16(track->stream->codec->extradata);
-
-    samples = AV_RL32(src);
-    src    += 4;
-    srclen -= 4;
-
-    while (srclen >= 8) {
-        int multiblock;
-        uint32_t blocksize;
-        uint8_t *tmp;
-
-        uint32_t flags = AV_RL32(src);
-        uint32_t crc   = AV_RL32(src + 4);
-        src    += 8;
-        srclen -= 8;
-
-        multiblock = (flags & 0x1800) != 0x1800;
-        if (multiblock) {
-            if (srclen < 4) {
-                ret = AVERROR_INVALIDDATA;
-                goto fail;
-            }
-            blocksize = AV_RL32(src);
-            src    += 4;
-            srclen -= 4;
-        } else
-            blocksize = srclen;
-
-        if (blocksize > srclen) {
-            ret = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-
-        tmp = av_realloc(dst, dstlen + blocksize + 32);
-        if (!tmp) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        dst     = tmp;
-        dstlen += blocksize + 32;
-
-        AV_WL32(dst + offset,      MKTAG('w', 'v', 'p', 'k')); // tag
-        AV_WL32(dst + offset + 4,  blocksize + 24);            // blocksize - 8
-        AV_WL16(dst + offset + 8,  ver);                       // version
-        AV_WL16(dst + offset + 10, 0);                         // track/index_no
-        AV_WL32(dst + offset + 12, 0);                         // total samples
-        AV_WL32(dst + offset + 16, 0);                         // block index
-        AV_WL32(dst + offset + 20, samples);                   // number of samples
-        AV_WL32(dst + offset + 24, flags);                     // flags
-        AV_WL32(dst + offset + 28, crc);                       // crc
-        memcpy (dst + offset + 32, src, blocksize);            // block data
-
-        src    += blocksize;
-        srclen -= blocksize;
-        offset += blocksize + 32;
-    }
-
-    *pdst = dst;
-    *size = dstlen;
-
-    return 0;
-
-fail:
-    av_freep(&dst);
-    return ret;
-}
-
-static int matroska_parse_frame(MatroskaDemuxContext *matroska,
-                                MatroskaTrack *track,
-                                AVStream *st,
-                                uint8_t *data, int pkt_size,
-                                uint64_t timecode, uint64_t duration,
-                                int64_t pos, int is_keyframe)
-{
-    MatroskaTrackEncoding *encodings = track->encodings.elem;
-    uint8_t *pkt_data = data;
-    int offset = 0, res;
-    AVPacket *pkt;
-
-    if (encodings && encodings->scope & 1) {
-        res = matroska_decode_buffer(&pkt_data, &pkt_size, track);
-        if (res < 0)
-            return res;
-    }
-
-    if (st->codec->codec_id == AV_CODEC_ID_WAVPACK) {
-        uint8_t *wv_data;
-        res = matroska_parse_wavpack(track, pkt_data, &wv_data, &pkt_size);
-        if (res < 0) {
-            av_log(matroska->ctx, AV_LOG_ERROR, "Error parsing a wavpack block.\n");
-            goto fail;
-        }
-        if (pkt_data != data)
-            av_freep(&pkt_data);
-        pkt_data = wv_data;
-    }
-
-    if (st->codec->codec_id == AV_CODEC_ID_PRORES)
-        offset = 8;
-
-    pkt = av_mallocz(sizeof(AVPacket));
-    /* XXX: prevent data copy... */
-    if (av_new_packet(pkt, pkt_size + offset) < 0) {
-        av_free(pkt);
-        return AVERROR(ENOMEM);
-    }
-
-    if (st->codec->codec_id == AV_CODEC_ID_PRORES) {
-        uint8_t *buf = pkt->data;
-        bytestream_put_be32(&buf, pkt_size);
-        bytestream_put_be32(&buf, MKBETAG('i', 'c', 'p', 'f'));
-    }
-
-    memcpy(pkt->data + offset, pkt_data, pkt_size);
-
-    if (pkt_data != data)
-        av_free(pkt_data);
-
-    pkt->flags = is_keyframe;
-    pkt->stream_index = st->index;
-
-    if (track->ms_compat)
-        pkt->dts = timecode;
-    else
-        pkt->pts = timecode;
-    pkt->pos = pos;
-    if (st->codec->codec_id == AV_CODEC_ID_TEXT)
-        pkt->convergence_duration = duration;
-    else if (track->type != MATROSKA_TRACK_TYPE_SUBTITLE)
-        pkt->duration = duration;
-
-    if (st->codec->codec_id == AV_CODEC_ID_SSA)
-        matroska_fix_ass_packet(matroska, pkt, duration);
-
-    if (matroska->prev_pkt &&
-        timecode != AV_NOPTS_VALUE &&
-        matroska->prev_pkt->pts == timecode &&
-        matroska->prev_pkt->stream_index == st->index &&
-        st->codec->codec_id == AV_CODEC_ID_SSA)
-        matroska_merge_packets(matroska->prev_pkt, pkt);
-    else {
-        dynarray_add(&matroska->packets,&matroska->num_packets,pkt);
-        matroska->prev_pkt = pkt;
-    }
-
-    return 0;
-fail:
-    if (pkt_data != data)
-        av_freep(&pkt_data);
-    return res;
-}
-
-static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
-                                int size, int64_t pos, uint64_t cluster_time,
-                                uint64_t block_duration, int is_keyframe,
-                                int64_t cluster_pos)
-{
-    uint64_t timecode = AV_NOPTS_VALUE;
-    MatroskaTrack *track;
-    int res = 0;
-    AVStream *st;
-    int16_t block_time;
-    uint32_t *lace_size = NULL;
-    int n, flags, laces = 0;
-    uint64_t num, duration;
-
-    if ((n = matroska_ebmlnum_uint(matroska, data, size, &num)) < 0) {
-        av_log(matroska->ctx, AV_LOG_ERROR, "EBML block data error\n");
-        return n;
-    }
-    data += n;
-    size -= n;
-
-    track = matroska_find_track_by_num(matroska, num);
-    if (!track || !track->stream) {
-        av_log(matroska->ctx, AV_LOG_INFO,
-               "Invalid stream %"PRIu64" or size %u\n", num, size);
-        return AVERROR_INVALIDDATA;
-    } else if (size <= 3)
-        return 0;
-    st = track->stream;
-    if (st->discard >= AVDISCARD_ALL)
-        return res;
-
-    block_time = AV_RB16(data);
-    data += 2;
-    flags = *data++;
-    size -= 3;
-    if (is_keyframe == -1)
-        is_keyframe = flags & 0x80 ? AV_PKT_FLAG_KEY : 0;
-
-    if (cluster_time != (uint64_t)-1
-        && (block_time >= 0 || cluster_time >= -block_time)) {
-        timecode = cluster_time + block_time - track->codec_delay;
-        if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE
-            && timecode < track->end_timecode)
-            is_keyframe = 0;  /* overlapping subtitles are not key frame */
-        if (is_keyframe)
-            av_add_index_entry(st, cluster_pos, timecode, 0,0,AVINDEX_KEYFRAME);
-    }
-
-    if (matroska->skip_to_keyframe && track->type != MATROSKA_TRACK_TYPE_SUBTITLE) {
-        if (!is_keyframe || timecode < matroska->skip_to_timecode)
-            return res;
-        matroska->skip_to_keyframe = 0;
-    }
-
-    res = matroska_parse_laces(matroska, &data, &size, (flags & 0x06) >> 1,
-                               &lace_size, &laces);
-
-    if (res)
-        goto end;
-
-    if (block_duration != AV_NOPTS_VALUE) {
-        duration = block_duration / laces;
-        if (block_duration != duration * laces) {
-            av_log(matroska->ctx, AV_LOG_WARNING,
-                   "Incorrect block_duration, possibly corrupted container");
-        }
-    } else {
-        duration = track->default_duration / matroska->time_scale;
-        block_duration = duration * laces;
-    }
-
-    if (timecode != AV_NOPTS_VALUE)
-        track->end_timecode =
-            FFMAX(track->end_timecode, timecode + block_duration);
-
-    for (n = 0; n < laces; n++) {
-        if ((st->codec->codec_id == AV_CODEC_ID_RA_288 ||
-             st->codec->codec_id == AV_CODEC_ID_COOK ||
-             st->codec->codec_id == AV_CODEC_ID_SIPR ||
-             st->codec->codec_id == AV_CODEC_ID_ATRAC3) &&
-             st->codec->block_align && track->audio.sub_packet_size) {
-
-            res = matroska_parse_rm_audio(matroska, track, st, data,
-                                          lace_size[n],
-                                          timecode, duration, pos);
-            if (res)
-                goto end;
-
-        } else {
-            res = matroska_parse_frame(matroska, track, st, data, lace_size[n],
-                                      timecode, duration,
-                                      pos, !n? is_keyframe : 0);
-            if (res)
-                goto end;
-        }
-
-        if (timecode != AV_NOPTS_VALUE)
-            timecode = duration ? timecode + duration : AV_NOPTS_VALUE;
-        data += lace_size[n];
-    }
-
-end:
-    av_free(lace_size);
-    return res;
-}
-
-static int matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
-{
-    EbmlList *blocks_list;
-    MatroskaBlock *blocks;
-    int i, res;
-    res = ebml_parse(matroska,
-                     matroska_cluster_incremental_parsing,
-                     &matroska->current_cluster);
-    if (res == 1) {
-        /* New Cluster */
-        if (matroska->current_cluster_pos)
-            ebml_level_end(matroska);
-        ebml_free(matroska_cluster, &matroska->current_cluster);
-        memset(&matroska->current_cluster, 0, sizeof(MatroskaCluster));
-        matroska->current_cluster_num_blocks = 0;
-        matroska->current_cluster_pos = avio_tell(matroska->ctx->pb);
-        matroska->prev_pkt = NULL;
-        /* sizeof the ID which was already read */
-        if (matroska->current_id)
-            matroska->current_cluster_pos -= 4;
-        res = ebml_parse(matroska,
-                         matroska_clusters_incremental,
-                         &matroska->current_cluster);
-        /* Try parsing the block again. */
-        if (res == 1)
-            res = ebml_parse(matroska,
-                             matroska_cluster_incremental_parsing,
-                             &matroska->current_cluster);
-    }
-
-    if (!res &&
-        matroska->current_cluster_num_blocks <
-            matroska->current_cluster.blocks.nb_elem) {
-        blocks_list = &matroska->current_cluster.blocks;
-        blocks = blocks_list->elem;
-
-        matroska->current_cluster_num_blocks = blocks_list->nb_elem;
-        i = blocks_list->nb_elem - 1;
-        if (blocks[i].bin.size > 0 && blocks[i].bin.data) {
-            int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
-            if (!blocks[i].non_simple)
-                blocks[i].duration = AV_NOPTS_VALUE;
-            res = matroska_parse_block(matroska,
-                                       blocks[i].bin.data, blocks[i].bin.size,
-                                       blocks[i].bin.pos,
-                                       matroska->current_cluster.timecode,
-                                       blocks[i].duration, is_keyframe,
-                                       matroska->current_cluster_pos);
-        }
-    }
-
-    if (res < 0)  matroska->done = 1;
-    return res;
-}
-
-static int matroska_parse_cluster(MatroskaDemuxContext *matroska)
-{
-    MatroskaCluster cluster = { 0 };
-    EbmlList *blocks_list;
-    MatroskaBlock *blocks;
-    int i, res;
-    int64_t pos;
-    if (!matroska->contains_ssa)
-        return matroska_parse_cluster_incremental(matroska);
-    pos = avio_tell(matroska->ctx->pb);
-    matroska->prev_pkt = NULL;
-    if (matroska->current_id)
-        pos -= 4;  /* sizeof the ID which was already read */
-    res = ebml_parse(matroska, matroska_clusters, &cluster);
-    blocks_list = &cluster.blocks;
-    blocks = blocks_list->elem;
-    for (i=0; i<blocks_list->nb_elem && !res; i++)
-        if (blocks[i].bin.size > 0 && blocks[i].bin.data) {
-            int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
-            if (!blocks[i].non_simple)
-                blocks[i].duration = AV_NOPTS_VALUE;
-            res=matroska_parse_block(matroska,
-                                     blocks[i].bin.data, blocks[i].bin.size,
-                                     blocks[i].bin.pos,  cluster.timecode,
-                                     blocks[i].duration, is_keyframe,
-                                     pos);
-        }
-    ebml_free(matroska_cluster, &cluster);
-    return res;
-}
-
-static int matroska_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MatroskaDemuxContext *matroska = s->priv_data;
-    int ret = 0;
-
-    while (!ret && matroska_deliver_packet(matroska, pkt)) {
-        int64_t pos = avio_tell(matroska->ctx->pb);
-        if (matroska->done)
-            return AVERROR_EOF;
-        if (matroska_parse_cluster(matroska) < 0)
-            ret = matroska_resync(matroska, pos);
-    }
-
-    if (ret == AVERROR_INVALIDDATA && pkt->data) {
-        pkt->flags |= AV_PKT_FLAG_CORRUPT;
-        return 0;
-    }
-
-    return ret;
-}
-
-static int matroska_read_seek(AVFormatContext *s, int stream_index,
-                              int64_t timestamp, int flags)
-{
-    MatroskaDemuxContext *matroska = s->priv_data;
-    MatroskaTrack *tracks = matroska->tracks.elem;
-    AVStream *st = s->streams[stream_index];
-    int i, index, index_sub, index_min;
-
-    /* Parse the CUES now since we need the index data to seek. */
-    if (matroska->cues_parsing_deferred) {
-        matroska_parse_cues(matroska);
-        matroska->cues_parsing_deferred = 0;
-    }
-
-    if (!st->nb_index_entries)
-        return 0;
-    timestamp = FFMAX(timestamp, st->index_entries[0].timestamp);
-
-    if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
-        avio_seek(s->pb, st->index_entries[st->nb_index_entries-1].pos, SEEK_SET);
-        matroska->current_id = 0;
-        while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
-            matroska_clear_queue(matroska);
-            if (matroska_parse_cluster(matroska) < 0)
-                break;
-        }
-    }
-
-    matroska_clear_queue(matroska);
-    if (index < 0)
-        return 0;
-
-    index_min = index;
-    for (i=0; i < matroska->tracks.nb_elem; i++) {
-        tracks[i].audio.pkt_cnt = 0;
-        tracks[i].audio.sub_packet_cnt = 0;
-        tracks[i].audio.buf_timecode = AV_NOPTS_VALUE;
-        tracks[i].end_timecode = 0;
-        if (tracks[i].type == MATROSKA_TRACK_TYPE_SUBTITLE
-            && !tracks[i].stream->discard != AVDISCARD_ALL) {
-            index_sub = av_index_search_timestamp(tracks[i].stream, st->index_entries[index].timestamp, AVSEEK_FLAG_BACKWARD);
-            if (index_sub >= 0
-                && st->index_entries[index_sub].pos < st->index_entries[index_min].pos
-                && st->index_entries[index].timestamp - st->index_entries[index_sub].timestamp < 30000000000/matroska->time_scale)
-                index_min = index_sub;
-        }
-    }
-
-    avio_seek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
-    matroska->current_id = 0;
-    matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY);
-    matroska->skip_to_timecode = st->index_entries[index].timestamp;
-    matroska->done = 0;
-    ff_update_cur_dts(s, st, st->index_entries[index].timestamp);
-    return 0;
-}
-
-static int matroska_read_close(AVFormatContext *s)
-{
-    MatroskaDemuxContext *matroska = s->priv_data;
-    MatroskaTrack *tracks = matroska->tracks.elem;
-    int n;
-
-    matroska_clear_queue(matroska);
-
-    for (n=0; n < matroska->tracks.nb_elem; n++)
-        if (tracks[n].type == MATROSKA_TRACK_TYPE_AUDIO)
-            av_free(tracks[n].audio.buf);
-    ebml_free(matroska_cluster, &matroska->current_cluster);
-    ebml_free(matroska_segment, matroska);
-
-    return 0;
-}
-
-AVInputFormat ff_matroska_demuxer = {
-    .name           = "matroska,webm",
-    .long_name      = NULL_IF_CONFIG_SMALL("Matroska / WebM"),
-    .priv_data_size = sizeof(MatroskaDemuxContext),
-    .read_probe     = matroska_probe,
-    .read_header    = matroska_read_header,
-    .read_packet    = matroska_read_packet,
-    .read_close     = matroska_read_close,
-    .read_seek      = matroska_read_seek,
-};
diff --git a/deps/libav/libavformat/matroskaenc.c b/deps/libav/libavformat/matroskaenc.c
deleted file mode 100644
index fad1ec4..0000000
--- a/deps/libav/libavformat/matroskaenc.c
+++ /dev/null
@@ -1,1571 +0,0 @@
-/*
- * Matroska muxer
- * Copyright (c) 2007 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "avc.h"
-#include "hevc.h"
-#include "avformat.h"
-#include "avlanguage.h"
-#include "flacenc.h"
-#include "internal.h"
-#include "isom.h"
-#include "matroska.h"
-#include "riff.h"
-#include "wv.h"
-
-#include "libavutil/avstring.h"
-#include "libavutil/dict.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/lfg.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/random_seed.h"
-#include "libavutil/samplefmt.h"
-
-#include "libavcodec/xiph.h"
-#include "libavcodec/mpeg4audio.h"
-
-typedef struct ebml_master {
-    int64_t         pos;                ///< absolute offset in the file where the master's elements start
-    int             sizebytes;          ///< how many bytes were reserved for the size
-} ebml_master;
-
-typedef struct mkv_seekhead_entry {
-    unsigned int    elementid;
-    uint64_t        segmentpos;
-} mkv_seekhead_entry;
-
-typedef struct mkv_seekhead {
-    int64_t                 filepos;
-    int64_t                 segment_offset;     ///< the file offset to the beginning of the segment
-    int                     reserved_size;      ///< -1 if appending to file
-    int                     max_entries;
-    mkv_seekhead_entry      *entries;
-    int                     num_entries;
-} mkv_seekhead;
-
-typedef struct {
-    uint64_t        pts;
-    int             tracknum;
-    int64_t         cluster_pos;        ///< file offset of the cluster containing the block
-} mkv_cuepoint;
-
-typedef struct {
-    int64_t         segment_offset;
-    mkv_cuepoint    *entries;
-    int             num_entries;
-} mkv_cues;
-
-typedef struct {
-    int             write_dts;
-} mkv_track;
-
-#define MODE_MATROSKAv2 0x01
-#define MODE_WEBM       0x02
-
-typedef struct MatroskaMuxContext {
-    const AVClass  *class;
-    int             mode;
-    AVIOContext   *dyn_bc;
-    ebml_master     segment;
-    int64_t         segment_offset;
-    ebml_master     cluster;
-    int64_t         cluster_pos;        ///< file offset of the current cluster
-    int64_t         cluster_pts;
-    int64_t         duration_offset;
-    int64_t         duration;
-    mkv_seekhead    *main_seekhead;
-    mkv_cues        *cues;
-    mkv_track       *tracks;
-
-    AVPacket        cur_audio_pkt;
-
-    int have_attachments;
-
-    int reserve_cues_space;
-    int cluster_size_limit;
-    int64_t cues_pos;
-    int64_t cluster_time_limit;
-    int wrote_chapters;
-} MatroskaMuxContext;
-
-
-/** 2 bytes * 3 for EBML IDs, 3 1-byte EBML lengths, 8 bytes for 64 bit
- * offset, 4 bytes for target EBML ID */
-#define MAX_SEEKENTRY_SIZE 21
-
-/** per-cuepoint-track - 3 1-byte EBML IDs, 3 1-byte EBML sizes, 2
- * 8-byte uint max */
-#define MAX_CUETRACKPOS_SIZE 22
-
-/** per-cuepoint - 2 1-byte EBML IDs, 2 1-byte EBML sizes, 8-byte uint max */
-#define MAX_CUEPOINT_SIZE(num_tracks) 12 + MAX_CUETRACKPOS_SIZE*num_tracks
-
-
-static int ebml_id_size(unsigned int id)
-{
-    return (av_log2(id+1)-1)/7+1;
-}
-
-static void put_ebml_id(AVIOContext *pb, unsigned int id)
-{
-    int i = ebml_id_size(id);
-    while (i--)
-        avio_w8(pb, id >> (i*8));
-}
-
-/**
- * Write an EBML size meaning "unknown size".
- *
- * @param bytes The number of bytes the size should occupy (maximum: 8).
- */
-static void put_ebml_size_unknown(AVIOContext *pb, int bytes)
-{
-    assert(bytes <= 8);
-    avio_w8(pb, 0x1ff >> bytes);
-    while (--bytes)
-        avio_w8(pb, 0xff);
-}
-
-/**
- * Calculate how many bytes are needed to represent a given number in EBML.
- */
-static int ebml_num_size(uint64_t num)
-{
-    int bytes = 1;
-    while ((num+1) >> bytes*7) bytes++;
-    return bytes;
-}
-
-/**
- * Write a number in EBML variable length format.
- *
- * @param bytes The number of bytes that need to be used to write the number.
- *              If zero, any number of bytes can be used.
- */
-static void put_ebml_num(AVIOContext *pb, uint64_t num, int bytes)
-{
-    int i, needed_bytes = ebml_num_size(num);
-
-    // sizes larger than this are currently undefined in EBML
-    assert(num < (1ULL<<56)-1);
-
-    if (bytes == 0)
-        // don't care how many bytes are used, so use the min
-        bytes = needed_bytes;
-    // the bytes needed to write the given size would exceed the bytes
-    // that we need to use, so write unknown size. This shouldn't happen.
-    assert(bytes >= needed_bytes);
-
-    num |= 1ULL << bytes*7;
-    for (i = bytes - 1; i >= 0; i--)
-        avio_w8(pb, num >> i*8);
-}
-
-static void put_ebml_uint(AVIOContext *pb, unsigned int elementid, uint64_t val)
-{
-    int i, bytes = 1;
-    uint64_t tmp = val;
-    while (tmp>>=8) bytes++;
-
-    put_ebml_id(pb, elementid);
-    put_ebml_num(pb, bytes, 0);
-    for (i = bytes - 1; i >= 0; i--)
-        avio_w8(pb, val >> i*8);
-}
-
-static void put_ebml_float(AVIOContext *pb, unsigned int elementid, double val)
-{
-    put_ebml_id(pb, elementid);
-    put_ebml_num(pb, 8, 0);
-    avio_wb64(pb, av_double2int(val));
-}
-
-static void put_ebml_binary(AVIOContext *pb, unsigned int elementid,
-                            const void *buf, int size)
-{
-    put_ebml_id(pb, elementid);
-    put_ebml_num(pb, size, 0);
-    avio_write(pb, buf, size);
-}
-
-static void put_ebml_string(AVIOContext *pb, unsigned int elementid, const char *str)
-{
-    put_ebml_binary(pb, elementid, str, strlen(str));
-}
-
-/**
- * Write a void element of a given size. Useful for reserving space in
- * the file to be written to later.
- *
- * @param size The number of bytes to reserve, which must be at least 2.
- */
-static void put_ebml_void(AVIOContext *pb, uint64_t size)
-{
-    int64_t currentpos = avio_tell(pb);
-
-    assert(size >= 2);
-
-    put_ebml_id(pb, EBML_ID_VOID);
-    // we need to subtract the length needed to store the size from the
-    // size we need to reserve so 2 cases, we use 8 bytes to store the
-    // size if possible, 1 byte otherwise
-    if (size < 10)
-        put_ebml_num(pb, size-1, 0);
-    else
-        put_ebml_num(pb, size-9, 8);
-    while(avio_tell(pb) < currentpos + size)
-        avio_w8(pb, 0);
-}
-
-static ebml_master start_ebml_master(AVIOContext *pb, unsigned int elementid, uint64_t expectedsize)
-{
-    int bytes = expectedsize ? ebml_num_size(expectedsize) : 8;
-    put_ebml_id(pb, elementid);
-    put_ebml_size_unknown(pb, bytes);
-    return (ebml_master){ avio_tell(pb), bytes };
-}
-
-static void end_ebml_master(AVIOContext *pb, ebml_master master)
-{
-    int64_t pos = avio_tell(pb);
-
-    if (avio_seek(pb, master.pos - master.sizebytes, SEEK_SET) < 0)
-        return;
-    put_ebml_num(pb, pos - master.pos, master.sizebytes);
-    avio_seek(pb, pos, SEEK_SET);
-}
-
-static void put_xiph_size(AVIOContext *pb, int size)
-{
-    int i;
-    for (i = 0; i < size / 255; i++)
-        avio_w8(pb, 255);
-    avio_w8(pb, size % 255);
-}
-
-/**
- * Initialize a mkv_seekhead element to be ready to index level 1 Matroska
- * elements. If a maximum number of elements is specified, enough space
- * will be reserved at the current file location to write a seek head of
- * that size.
- *
- * @param segment_offset The absolute offset to the position in the file
- *                       where the segment begins.
- * @param numelements The maximum number of elements that will be indexed
- *                    by this seek head, 0 if unlimited.
- */
-static mkv_seekhead * mkv_start_seekhead(AVIOContext *pb, int64_t segment_offset, int numelements)
-{
-    mkv_seekhead *new_seekhead = av_mallocz(sizeof(mkv_seekhead));
-    if (new_seekhead == NULL)
-        return NULL;
-
-    new_seekhead->segment_offset = segment_offset;
-
-    if (numelements > 0) {
-        new_seekhead->filepos = avio_tell(pb);
-        // 21 bytes max for a seek entry, 10 bytes max for the SeekHead ID
-        // and size, and 3 bytes to guarantee that an EBML void element
-        // will fit afterwards
-        new_seekhead->reserved_size = numelements * MAX_SEEKENTRY_SIZE + 13;
-        new_seekhead->max_entries = numelements;
-        put_ebml_void(pb, new_seekhead->reserved_size);
-    }
-    return new_seekhead;
-}
-
-static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos)
-{
-    int err;
-
-    // don't store more elements than we reserved space for
-    if (seekhead->max_entries > 0 && seekhead->max_entries <= seekhead->num_entries)
-        return -1;
-
-    if ((err = av_reallocp_array(&seekhead->entries, seekhead->num_entries + 1,
-                                 sizeof(*seekhead->entries))) < 0) {
-        seekhead->num_entries = 0;
-        return err;
-    }
-
-    seekhead->entries[seekhead->num_entries].elementid    = elementid;
-    seekhead->entries[seekhead->num_entries++].segmentpos = filepos - seekhead->segment_offset;
-
-    return 0;
-}
-
-/**
- * Write the seek head to the file and free it. If a maximum number of
- * elements was specified to mkv_start_seekhead(), the seek head will
- * be written at the location reserved for it. Otherwise, it is written
- * at the current location in the file.
- *
- * @return The file offset where the seekhead was written,
- * -1 if an error occurred.
- */
-static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead)
-{
-    ebml_master metaseek, seekentry;
-    int64_t currentpos;
-    int i;
-
-    currentpos = avio_tell(pb);
-
-    if (seekhead->reserved_size > 0) {
-        if (avio_seek(pb, seekhead->filepos, SEEK_SET) < 0) {
-            currentpos = -1;
-            goto fail;
-        }
-    }
-
-    metaseek = start_ebml_master(pb, MATROSKA_ID_SEEKHEAD, seekhead->reserved_size);
-    for (i = 0; i < seekhead->num_entries; i++) {
-        mkv_seekhead_entry *entry = &seekhead->entries[i];
-
-        seekentry = start_ebml_master(pb, MATROSKA_ID_SEEKENTRY, MAX_SEEKENTRY_SIZE);
-
-        put_ebml_id(pb, MATROSKA_ID_SEEKID);
-        put_ebml_num(pb, ebml_id_size(entry->elementid), 0);
-        put_ebml_id(pb, entry->elementid);
-
-        put_ebml_uint(pb, MATROSKA_ID_SEEKPOSITION, entry->segmentpos);
-        end_ebml_master(pb, seekentry);
-    }
-    end_ebml_master(pb, metaseek);
-
-    if (seekhead->reserved_size > 0) {
-        uint64_t remaining = seekhead->filepos + seekhead->reserved_size - avio_tell(pb);
-        put_ebml_void(pb, remaining);
-        avio_seek(pb, currentpos, SEEK_SET);
-
-        currentpos = seekhead->filepos;
-    }
-fail:
-    av_free(seekhead->entries);
-    av_free(seekhead);
-
-    return currentpos;
-}
-
-static mkv_cues * mkv_start_cues(int64_t segment_offset)
-{
-    mkv_cues *cues = av_mallocz(sizeof(mkv_cues));
-    if (cues == NULL)
-        return NULL;
-
-    cues->segment_offset = segment_offset;
-    return cues;
-}
-
-static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos)
-{
-    int err;
-
-    if (ts < 0)
-        return 0;
-
-    if ((err = av_reallocp_array(&cues->entries, cues->num_entries + 1,
-                                 sizeof(*cues->entries))) < 0) {
-        cues->num_entries = 0;
-        return err;
-    }
-
-    cues->entries[cues->num_entries].pts           = ts;
-    cues->entries[cues->num_entries].tracknum      = stream + 1;
-    cues->entries[cues->num_entries++].cluster_pos = cluster_pos - cues->segment_offset;
-
-    return 0;
-}
-
-static int64_t mkv_write_cues(AVIOContext *pb, mkv_cues *cues, int num_tracks)
-{
-    ebml_master cues_element;
-    int64_t currentpos;
-    int i, j;
-
-    currentpos = avio_tell(pb);
-    cues_element = start_ebml_master(pb, MATROSKA_ID_CUES, 0);
-
-    for (i = 0; i < cues->num_entries; i++) {
-        ebml_master cuepoint, track_positions;
-        mkv_cuepoint *entry = &cues->entries[i];
-        uint64_t pts = entry->pts;
-
-        cuepoint = start_ebml_master(pb, MATROSKA_ID_POINTENTRY, MAX_CUEPOINT_SIZE(num_tracks));
-        put_ebml_uint(pb, MATROSKA_ID_CUETIME, pts);
-
-        // put all the entries from different tracks that have the exact same
-        // timestamp into the same CuePoint
-        for (j = 0; j < cues->num_entries - i && entry[j].pts == pts; j++) {
-            track_positions = start_ebml_master(pb, MATROSKA_ID_CUETRACKPOSITION, MAX_CUETRACKPOS_SIZE);
-            put_ebml_uint(pb, MATROSKA_ID_CUETRACK          , entry[j].tracknum   );
-            put_ebml_uint(pb, MATROSKA_ID_CUECLUSTERPOSITION, entry[j].cluster_pos);
-            end_ebml_master(pb, track_positions);
-        }
-        i += j - 1;
-        end_ebml_master(pb, cuepoint);
-    }
-    end_ebml_master(pb, cues_element);
-
-    return currentpos;
-}
-
-static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec)
-{
-    uint8_t *header_start[3];
-    int header_len[3];
-    int first_header_size;
-    int j;
-
-    if (codec->codec_id == AV_CODEC_ID_VORBIS)
-        first_header_size = 30;
-    else
-        first_header_size = 42;
-
-    if (avpriv_split_xiph_headers(codec->extradata, codec->extradata_size,
-                              first_header_size, header_start, header_len) < 0) {
-        av_log(s, AV_LOG_ERROR, "Extradata corrupt.\n");
-        return -1;
-    }
-
-    avio_w8(pb, 2);                    // number packets - 1
-    for (j = 0; j < 2; j++) {
-        put_xiph_size(pb, header_len[j]);
-    }
-    for (j = 0; j < 3; j++)
-        avio_write(pb, header_start[j], header_len[j]);
-
-    return 0;
-}
-
-static int put_wv_codecpriv(AVIOContext *pb, AVCodecContext *codec)
-{
-    if (codec->extradata && codec->extradata_size == 2)
-        avio_write(pb, codec->extradata, 2);
-    else
-        avio_wl16(pb, 0x403); // fallback to the version mentioned in matroska specs
-    return 0;
-}
-
-static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int *sample_rate, int *output_sample_rate)
-{
-    MPEG4AudioConfig mp4ac;
-
-    if (avpriv_mpeg4audio_get_config(&mp4ac, codec->extradata,
-                                     codec->extradata_size * 8, 1) < 0) {
-        av_log(s, AV_LOG_WARNING, "Error parsing AAC extradata, unable to determine samplerate.\n");
-        return;
-    }
-
-    *sample_rate        = mp4ac.sample_rate;
-    *output_sample_rate = mp4ac.ext_sample_rate;
-}
-
-static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec, int native_id, int qt_id)
-{
-    AVIOContext *dyn_cp;
-    uint8_t *codecpriv;
-    int ret, codecpriv_size;
-
-    ret = avio_open_dyn_buf(&dyn_cp);
-    if(ret < 0)
-        return ret;
-
-    if (native_id) {
-        if (codec->codec_id == AV_CODEC_ID_VORBIS || codec->codec_id == AV_CODEC_ID_THEORA)
-            ret = put_xiph_codecpriv(s, dyn_cp, codec);
-        else if (codec->codec_id == AV_CODEC_ID_FLAC)
-            ret = ff_flac_write_header(dyn_cp, codec, 1);
-        else if (codec->codec_id == AV_CODEC_ID_WAVPACK)
-            ret = put_wv_codecpriv(dyn_cp, codec);
-        else if (codec->codec_id == AV_CODEC_ID_H264)
-            ret = ff_isom_write_avcc(dyn_cp, codec->extradata, codec->extradata_size);
-        else if (codec->codec_id == AV_CODEC_ID_HEVC)
-            ret = ff_isom_write_hvcc(dyn_cp, codec->extradata, codec->extradata_size, 0);
-        else if (codec->codec_id == AV_CODEC_ID_ALAC) {
-            if (codec->extradata_size < 36) {
-                av_log(s, AV_LOG_ERROR,
-                       "Invalid extradata found, ALAC expects a 36-byte "
-                       "QuickTime atom.");
-                ret = AVERROR_INVALIDDATA;
-            } else
-                avio_write(dyn_cp, codec->extradata + 12,
-                                   codec->extradata_size - 12);
-        }
-        else if (codec->extradata_size)
-            avio_write(dyn_cp, codec->extradata, codec->extradata_size);
-    } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        if (qt_id) {
-            if (!codec->codec_tag)
-                codec->codec_tag = ff_codec_get_tag(ff_codec_movvideo_tags, codec->codec_id);
-            if (codec->extradata_size)
-                avio_write(dyn_cp, codec->extradata, codec->extradata_size);
-        } else {
-            if (!codec->codec_tag)
-                codec->codec_tag = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id);
-            if (!codec->codec_tag) {
-                av_log(s, AV_LOG_ERROR, "No bmp codec ID found.\n");
-                ret = -1;
-            }
-
-            ff_put_bmp_header(dyn_cp, codec, ff_codec_bmp_tags, 0);
-        }
-
-    } else if (codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-        unsigned int tag;
-        tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id);
-        if (!tag) {
-            av_log(s, AV_LOG_ERROR, "No wav codec ID found.\n");
-            ret = -1;
-        }
-        if (!codec->codec_tag)
-            codec->codec_tag = tag;
-
-        ff_put_wav_header(dyn_cp, codec);
-    }
-
-    codecpriv_size = avio_close_dyn_buf(dyn_cp, &codecpriv);
-    if (codecpriv_size)
-        put_ebml_binary(pb, MATROSKA_ID_CODECPRIVATE, codecpriv, codecpriv_size);
-    av_free(codecpriv);
-    return ret;
-}
-
-static int mkv_write_tracks(AVFormatContext *s)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    ebml_master tracks;
-    int i, j, ret;
-
-    ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_TRACKS, avio_tell(pb));
-    if (ret < 0) return ret;
-
-    tracks = start_ebml_master(pb, MATROSKA_ID_TRACKS, 0);
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        AVCodecContext *codec = st->codec;
-        ebml_master subinfo, track;
-        int native_id = 0;
-        int qt_id = 0;
-        int bit_depth = av_get_bits_per_sample(codec->codec_id);
-        int sample_rate = codec->sample_rate;
-        int output_sample_rate = 0;
-        AVDictionaryEntry *tag;
-
-        if (codec->codec_type == AVMEDIA_TYPE_ATTACHMENT) {
-            mkv->have_attachments = 1;
-            continue;
-        }
-
-        if (!bit_depth)
-            bit_depth = av_get_bytes_per_sample(codec->sample_fmt) << 3;
-
-        if (codec->codec_id == AV_CODEC_ID_AAC)
-            get_aac_sample_rates(s, codec, &sample_rate, &output_sample_rate);
-
-        track = start_ebml_master(pb, MATROSKA_ID_TRACKENTRY, 0);
-        put_ebml_uint (pb, MATROSKA_ID_TRACKNUMBER     , i + 1);
-        put_ebml_uint (pb, MATROSKA_ID_TRACKUID        , i + 1);
-        put_ebml_uint (pb, MATROSKA_ID_TRACKFLAGLACING , 0);    // no lacing (yet)
-
-        if ((tag = av_dict_get(st->metadata, "title", NULL, 0)))
-            put_ebml_string(pb, MATROSKA_ID_TRACKNAME, tag->value);
-        tag = av_dict_get(st->metadata, "language", NULL, 0);
-        put_ebml_string(pb, MATROSKA_ID_TRACKLANGUAGE, tag ? tag->value:"und");
-
-        // The default value for TRACKFLAGDEFAULT is 1, so add element
-        // if we need to clear it.
-        if (!(st->disposition & AV_DISPOSITION_DEFAULT))
-            put_ebml_uint(pb, MATROSKA_ID_TRACKFLAGDEFAULT, !!(st->disposition & AV_DISPOSITION_DEFAULT));
-
-        // look for a codec ID string specific to mkv to use,
-        // if none are found, use AVI codes
-        for (j = 0; ff_mkv_codec_tags[j].id != AV_CODEC_ID_NONE; j++) {
-            if (ff_mkv_codec_tags[j].id == codec->codec_id) {
-                put_ebml_string(pb, MATROSKA_ID_CODECID, ff_mkv_codec_tags[j].str);
-                native_id = 1;
-                break;
-            }
-        }
-
-        if (mkv->mode == MODE_WEBM && !(codec->codec_id == AV_CODEC_ID_VP8 ||
-                                        codec->codec_id == AV_CODEC_ID_VORBIS)) {
-            av_log(s, AV_LOG_ERROR,
-                   "Only VP8 video and Vorbis audio are supported for WebM.\n");
-            return AVERROR(EINVAL);
-        }
-
-        switch (codec->codec_type) {
-            case AVMEDIA_TYPE_VIDEO:
-                put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_VIDEO);
-                put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, av_q2d(codec->time_base)*1E9);
-
-                if (!native_id &&
-                      ff_codec_get_tag(ff_codec_movvideo_tags, codec->codec_id) &&
-                    (!ff_codec_get_tag(ff_codec_bmp_tags,   codec->codec_id)
-                     || codec->codec_id == AV_CODEC_ID_SVQ1
-                     || codec->codec_id == AV_CODEC_ID_SVQ3
-                     || codec->codec_id == AV_CODEC_ID_CINEPAK))
-                    qt_id = 1;
-
-                if (qt_id)
-                    put_ebml_string(pb, MATROSKA_ID_CODECID, "V_QUICKTIME");
-                else if (!native_id) {
-                    // if there is no mkv-specific codec ID, use VFW mode
-                    put_ebml_string(pb, MATROSKA_ID_CODECID, "V_MS/VFW/FOURCC");
-                    mkv->tracks[i].write_dts = 1;
-                }
-
-                subinfo = start_ebml_master(pb, MATROSKA_ID_TRACKVIDEO, 0);
-                // XXX: interlace flag?
-                put_ebml_uint (pb, MATROSKA_ID_VIDEOPIXELWIDTH , codec->width);
-                put_ebml_uint (pb, MATROSKA_ID_VIDEOPIXELHEIGHT, codec->height);
-                if ((tag = av_dict_get(s->metadata, "stereo_mode", NULL, 0))) {
-                    uint8_t stereo_fmt = atoi(tag->value);
-                    int valid_fmt = 0;
-
-                    switch (mkv->mode) {
-                    case MODE_WEBM:
-                        if (stereo_fmt <= MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM
-                            || stereo_fmt == MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT)
-                            valid_fmt = 1;
-                        break;
-                    case MODE_MATROSKAv2:
-                        if (stereo_fmt <= MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL)
-                            valid_fmt = 1;
-                        break;
-                    }
-
-                    if (valid_fmt)
-                        put_ebml_uint (pb, MATROSKA_ID_VIDEOSTEREOMODE, stereo_fmt);
-                }
-                if (st->sample_aspect_ratio.num) {
-                    int d_width = codec->width*av_q2d(st->sample_aspect_ratio);
-                    put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , d_width);
-                    put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, codec->height);
-                    put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYUNIT, 3);
-                }
-                end_ebml_master(pb, subinfo);
-                break;
-
-            case AVMEDIA_TYPE_AUDIO:
-                put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_AUDIO);
-
-                if (!native_id)
-                    // no mkv-specific ID, use ACM mode
-                    put_ebml_string(pb, MATROSKA_ID_CODECID, "A_MS/ACM");
-
-                subinfo = start_ebml_master(pb, MATROSKA_ID_TRACKAUDIO, 0);
-                put_ebml_uint  (pb, MATROSKA_ID_AUDIOCHANNELS    , codec->channels);
-                put_ebml_float (pb, MATROSKA_ID_AUDIOSAMPLINGFREQ, sample_rate);
-                if (output_sample_rate)
-                    put_ebml_float(pb, MATROSKA_ID_AUDIOOUTSAMPLINGFREQ, output_sample_rate);
-                if (bit_depth)
-                    put_ebml_uint(pb, MATROSKA_ID_AUDIOBITDEPTH, bit_depth);
-                end_ebml_master(pb, subinfo);
-                break;
-
-            case AVMEDIA_TYPE_SUBTITLE:
-                put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_SUBTITLE);
-                if (!native_id) {
-                    av_log(s, AV_LOG_ERROR, "Subtitle codec %d is not supported.\n", codec->codec_id);
-                    return AVERROR(ENOSYS);
-                }
-                break;
-            default:
-                av_log(s, AV_LOG_ERROR, "Only audio, video, and subtitles are supported for Matroska.\n");
-                break;
-        }
-        ret = mkv_write_codecprivate(s, pb, codec, native_id, qt_id);
-        if (ret < 0) return ret;
-
-        end_ebml_master(pb, track);
-
-        // ms precision is the de-facto standard timescale for mkv files
-        avpriv_set_pts_info(st, 64, 1, 1000);
-    }
-    end_ebml_master(pb, tracks);
-    return 0;
-}
-
-static int mkv_write_chapters(AVFormatContext *s)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    ebml_master chapters, editionentry;
-    AVRational scale = {1, 1E9};
-    int i, ret;
-
-    if (!s->nb_chapters || mkv->wrote_chapters)
-        return 0;
-
-    ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CHAPTERS, avio_tell(pb));
-    if (ret < 0) return ret;
-
-    chapters     = start_ebml_master(pb, MATROSKA_ID_CHAPTERS    , 0);
-    editionentry = start_ebml_master(pb, MATROSKA_ID_EDITIONENTRY, 0);
-    put_ebml_uint(pb, MATROSKA_ID_EDITIONFLAGDEFAULT, 1);
-    put_ebml_uint(pb, MATROSKA_ID_EDITIONFLAGHIDDEN , 0);
-    for (i = 0; i < s->nb_chapters; i++) {
-        ebml_master chapteratom, chapterdisplay;
-        AVChapter *c     = s->chapters[i];
-        AVDictionaryEntry *t = NULL;
-
-        chapteratom = start_ebml_master(pb, MATROSKA_ID_CHAPTERATOM, 0);
-        put_ebml_uint(pb, MATROSKA_ID_CHAPTERUID, c->id);
-        put_ebml_uint(pb, MATROSKA_ID_CHAPTERTIMESTART,
-                      av_rescale_q(c->start, c->time_base, scale));
-        put_ebml_uint(pb, MATROSKA_ID_CHAPTERTIMEEND,
-                      av_rescale_q(c->end,   c->time_base, scale));
-        put_ebml_uint(pb, MATROSKA_ID_CHAPTERFLAGHIDDEN , 0);
-        put_ebml_uint(pb, MATROSKA_ID_CHAPTERFLAGENABLED, 1);
-        if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
-            chapterdisplay = start_ebml_master(pb, MATROSKA_ID_CHAPTERDISPLAY, 0);
-            put_ebml_string(pb, MATROSKA_ID_CHAPSTRING, t->value);
-            put_ebml_string(pb, MATROSKA_ID_CHAPLANG  , "und");
-            end_ebml_master(pb, chapterdisplay);
-        }
-        end_ebml_master(pb, chapteratom);
-    }
-    end_ebml_master(pb, editionentry);
-    end_ebml_master(pb, chapters);
-
-    mkv->wrote_chapters = 1;
-    return 0;
-}
-
-static void mkv_write_simpletag(AVIOContext *pb, AVDictionaryEntry *t)
-{
-    uint8_t *key = av_strdup(t->key);
-    uint8_t *p   = key;
-    const uint8_t *lang = NULL;
-    ebml_master tag;
-
-    if ((p = strrchr(p, '-')) &&
-        (lang = av_convert_lang_to(p + 1, AV_LANG_ISO639_2_BIBL)))
-        *p = 0;
-
-    p = key;
-    while (*p) {
-        if (*p == ' ')
-            *p = '_';
-        else if (*p >= 'a' && *p <= 'z')
-            *p -= 'a' - 'A';
-        p++;
-    }
-
-    tag = start_ebml_master(pb, MATROSKA_ID_SIMPLETAG, 0);
-    put_ebml_string(pb, MATROSKA_ID_TAGNAME, key);
-    if (lang)
-        put_ebml_string(pb, MATROSKA_ID_TAGLANG, lang);
-    put_ebml_string(pb, MATROSKA_ID_TAGSTRING, t->value);
-    end_ebml_master(pb, tag);
-
-    av_freep(&key);
-}
-
-static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int elementid,
-                         unsigned int uid, ebml_master *tags)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    ebml_master tag, targets;
-    AVDictionaryEntry *t = NULL;
-    int ret;
-
-    if (!tags->pos) {
-        ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_TAGS, avio_tell(s->pb));
-        if (ret < 0) return ret;
-
-        *tags = start_ebml_master(s->pb, MATROSKA_ID_TAGS, 0);
-    }
-
-    tag     = start_ebml_master(s->pb, MATROSKA_ID_TAG,        0);
-    targets = start_ebml_master(s->pb, MATROSKA_ID_TAGTARGETS, 0);
-    if (elementid)
-        put_ebml_uint(s->pb, elementid, uid);
-    end_ebml_master(s->pb, targets);
-
-    while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX)))
-        if (av_strcasecmp(t->key, "title") &&
-            av_strcasecmp(t->key, "encoding_tool"))
-            mkv_write_simpletag(s->pb, t);
-
-    end_ebml_master(s->pb, tag);
-    return 0;
-}
-
-static int mkv_write_tags(AVFormatContext *s)
-{
-    ebml_master tags = {0};
-    int i, ret;
-
-    ff_metadata_conv_ctx(s, ff_mkv_metadata_conv, NULL);
-
-    if (av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
-        ret = mkv_write_tag(s, s->metadata, 0, 0, &tags);
-        if (ret < 0) return ret;
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-
-        if (!av_dict_get(st->metadata, "", 0, AV_DICT_IGNORE_SUFFIX))
-            continue;
-
-        ret = mkv_write_tag(s, st->metadata, MATROSKA_ID_TAGTARGETS_TRACKUID, i + 1, &tags);
-        if (ret < 0) return ret;
-    }
-
-    for (i = 0; i < s->nb_chapters; i++) {
-        AVChapter *ch = s->chapters[i];
-
-        if (!av_dict_get(ch->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
-            continue;
-
-        ret = mkv_write_tag(s, ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID, ch->id, &tags);
-        if (ret < 0) return ret;
-    }
-
-    if (tags.pos)
-        end_ebml_master(s->pb, tags);
-    return 0;
-}
-
-static int mkv_write_attachments(AVFormatContext *s)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    ebml_master attachments;
-    AVLFG c;
-    int i, ret;
-
-    if (!mkv->have_attachments)
-        return 0;
-
-    av_lfg_init(&c, av_get_random_seed());
-
-    ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_ATTACHMENTS, avio_tell(pb));
-    if (ret < 0) return ret;
-
-    attachments = start_ebml_master(pb, MATROSKA_ID_ATTACHMENTS, 0);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        ebml_master attached_file;
-        AVDictionaryEntry *t;
-        const char *mimetype = NULL;
-
-        if (st->codec->codec_type != AVMEDIA_TYPE_ATTACHMENT)
-            continue;
-
-        attached_file = start_ebml_master(pb, MATROSKA_ID_ATTACHEDFILE, 0);
-
-        if (t = av_dict_get(st->metadata, "title", NULL, 0))
-            put_ebml_string(pb, MATROSKA_ID_FILEDESC, t->value);
-        if (!(t = av_dict_get(st->metadata, "filename", NULL, 0))) {
-            av_log(s, AV_LOG_ERROR, "Attachment stream %d has no filename tag.\n", i);
-            return AVERROR(EINVAL);
-        }
-        put_ebml_string(pb, MATROSKA_ID_FILENAME, t->value);
-        if (t = av_dict_get(st->metadata, "mimetype", NULL, 0))
-            mimetype = t->value;
-        else if (st->codec->codec_id != AV_CODEC_ID_NONE ) {
-            int i;
-            for (i = 0; ff_mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++)
-                if (ff_mkv_mime_tags[i].id == st->codec->codec_id) {
-                    mimetype = ff_mkv_mime_tags[i].str;
-                    break;
-                }
-        }
-        if (!mimetype) {
-            av_log(s, AV_LOG_ERROR, "Attachment stream %d has no mimetype tag and "
-                                    "it cannot be deduced from the codec id.\n", i);
-            return AVERROR(EINVAL);
-        }
-
-        put_ebml_string(pb, MATROSKA_ID_FILEMIMETYPE, mimetype);
-        put_ebml_binary(pb, MATROSKA_ID_FILEDATA, st->codec->extradata, st->codec->extradata_size);
-        put_ebml_uint(pb, MATROSKA_ID_FILEUID, av_lfg_get(&c));
-        end_ebml_master(pb, attached_file);
-    }
-    end_ebml_master(pb, attachments);
-
-    return 0;
-}
-
-static int mkv_write_header(AVFormatContext *s)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    ebml_master ebml_header, segment_info;
-    AVDictionaryEntry *tag;
-    int ret, i;
-
-    if (!strcmp(s->oformat->name, "webm")) mkv->mode = MODE_WEBM;
-    else                                   mkv->mode = MODE_MATROSKAv2;
-
-    mkv->tracks = av_mallocz(s->nb_streams * sizeof(*mkv->tracks));
-    if (!mkv->tracks)
-        return AVERROR(ENOMEM);
-
-    ebml_header = start_ebml_master(pb, EBML_ID_HEADER, 0);
-    put_ebml_uint   (pb, EBML_ID_EBMLVERSION        ,           1);
-    put_ebml_uint   (pb, EBML_ID_EBMLREADVERSION    ,           1);
-    put_ebml_uint   (pb, EBML_ID_EBMLMAXIDLENGTH    ,           4);
-    put_ebml_uint   (pb, EBML_ID_EBMLMAXSIZELENGTH  ,           8);
-    put_ebml_string (pb, EBML_ID_DOCTYPE            , s->oformat->name);
-    put_ebml_uint   (pb, EBML_ID_DOCTYPEVERSION     ,           2);
-    put_ebml_uint   (pb, EBML_ID_DOCTYPEREADVERSION ,           2);
-    end_ebml_master(pb, ebml_header);
-
-    mkv->segment = start_ebml_master(pb, MATROSKA_ID_SEGMENT, 0);
-    mkv->segment_offset = avio_tell(pb);
-
-    // we write 2 seek heads - one at the end of the file to point to each
-    // cluster, and one at the beginning to point to all other level one
-    // elements (including the seek head at the end of the file), which
-    // isn't more than 10 elements if we only write one of each other
-    // currently defined level 1 element
-    mkv->main_seekhead    = mkv_start_seekhead(pb, mkv->segment_offset, 10);
-    if (!mkv->main_seekhead)
-        return AVERROR(ENOMEM);
-
-    ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_INFO, avio_tell(pb));
-    if (ret < 0) return ret;
-
-    segment_info = start_ebml_master(pb, MATROSKA_ID_INFO, 0);
-    put_ebml_uint(pb, MATROSKA_ID_TIMECODESCALE, 1000000);
-    if ((tag = av_dict_get(s->metadata, "title", NULL, 0)))
-        put_ebml_string(pb, MATROSKA_ID_TITLE, tag->value);
-    if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
-        uint32_t segment_uid[4];
-        AVLFG lfg;
-
-        av_lfg_init(&lfg, av_get_random_seed());
-
-        for (i = 0; i < 4; i++)
-            segment_uid[i] = av_lfg_get(&lfg);
-
-        put_ebml_string(pb, MATROSKA_ID_MUXINGAPP , LIBAVFORMAT_IDENT);
-        if ((tag = av_dict_get(s->metadata, "encoding_tool", NULL, 0)))
-            put_ebml_string(pb, MATROSKA_ID_WRITINGAPP, tag->value);
-        else
-            put_ebml_string(pb, MATROSKA_ID_WRITINGAPP, LIBAVFORMAT_IDENT);
-        put_ebml_binary(pb, MATROSKA_ID_SEGMENTUID, segment_uid, 16);
-    }
-
-    // reserve space for the duration
-    mkv->duration = 0;
-    mkv->duration_offset = avio_tell(pb);
-    put_ebml_void(pb, 11);                  // assumes double-precision float to be written
-    end_ebml_master(pb, segment_info);
-
-    ret = mkv_write_tracks(s);
-    if (ret < 0) return ret;
-
-    if (mkv->mode != MODE_WEBM) {
-        ret = mkv_write_chapters(s);
-        if (ret < 0) return ret;
-
-        ret = mkv_write_tags(s);
-        if (ret < 0) return ret;
-
-        ret = mkv_write_attachments(s);
-        if (ret < 0) return ret;
-    }
-
-    if (!s->pb->seekable)
-        mkv_write_seekhead(pb, mkv->main_seekhead);
-
-    mkv->cues = mkv_start_cues(mkv->segment_offset);
-    if (mkv->cues == NULL)
-        return AVERROR(ENOMEM);
-
-    if (pb->seekable && mkv->reserve_cues_space) {
-        mkv->cues_pos = avio_tell(pb);
-        put_ebml_void(pb, mkv->reserve_cues_space);
-    }
-
-    av_init_packet(&mkv->cur_audio_pkt);
-    mkv->cur_audio_pkt.size = 0;
-
-    avio_flush(pb);
-
-    // start a new cluster every 5 MB or 5 sec, or 32k / 1 sec for streaming or
-    // after 4k and on a keyframe
-    if (pb->seekable) {
-        if (mkv->cluster_time_limit < 0)
-            mkv->cluster_time_limit = 5000;
-        if (mkv->cluster_size_limit < 0)
-            mkv->cluster_size_limit = 5 * 1024 * 1024;
-    } else {
-        if (mkv->cluster_time_limit < 0)
-            mkv->cluster_time_limit = 1000;
-        if (mkv->cluster_size_limit < 0)
-            mkv->cluster_size_limit = 32 * 1024;
-    }
-
-    return 0;
-}
-
-static int mkv_blockgroup_size(int pkt_size)
-{
-    int size = pkt_size + 4;
-    size += ebml_num_size(size);
-    size += 2;              // EBML ID for block and block duration
-    size += 8;              // max size of block duration
-    size += ebml_num_size(size);
-    size += 1;              // blockgroup EBML ID
-    return size;
-}
-
-static int ass_get_duration(const uint8_t *p)
-{
-    int sh, sm, ss, sc, eh, em, es, ec;
-    uint64_t start, end;
-
-    if (sscanf(p, "%*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d",
-               &sh, &sm, &ss, &sc, &eh, &em, &es, &ec) != 8)
-        return 0;
-    start = 3600000*sh + 60000*sm + 1000*ss + 10*sc;
-    end   = 3600000*eh + 60000*em + 1000*es + 10*ec;
-    return end - start;
-}
-
-static int mkv_write_ass_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    int i, layer = 0, max_duration = 0, size, line_size, data_size = pkt->size;
-    uint8_t *start, *end, *data = pkt->data;
-    ebml_master blockgroup;
-    char buffer[2048];
-
-    while (data_size) {
-        int duration = ass_get_duration(data);
-        max_duration = FFMAX(duration, max_duration);
-        end = memchr(data, '\n', data_size);
-        size = line_size = end ? end-data+1 : data_size;
-        size -= end ? (end[-1]=='\r')+1 : 0;
-        start = data;
-        for (i=0; i<3; i++, start++)
-            if (!(start = memchr(start, ',', size-(start-data))))
-                return max_duration;
-        size -= start - data;
-        sscanf(data, "Dialogue: %d,", &layer);
-        i = snprintf(buffer, sizeof(buffer), "%"PRId64",%d,",
-                     s->streams[pkt->stream_index]->nb_frames, layer);
-        size = FFMIN(i+size, sizeof(buffer));
-        memcpy(buffer+i, start, size-i);
-
-        av_log(s, AV_LOG_DEBUG, "Writing block at offset %" PRIu64 ", size %d, "
-               "pts %" PRId64 ", duration %d\n",
-               avio_tell(pb), size, pkt->pts, duration);
-        blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, mkv_blockgroup_size(size));
-        put_ebml_id(pb, MATROSKA_ID_BLOCK);
-        put_ebml_num(pb, size+4, 0);
-        avio_w8(pb, 0x80 | (pkt->stream_index + 1));     // this assumes stream_index is less than 126
-        avio_wb16(pb, pkt->pts - mkv->cluster_pts);
-        avio_w8(pb, 0);
-        avio_write(pb, buffer, size);
-        put_ebml_uint(pb, MATROSKA_ID_BLOCKDURATION, duration);
-        end_ebml_master(pb, blockgroup);
-
-        data += line_size;
-        data_size -= line_size;
-    }
-
-    return max_duration;
-}
-
-static int mkv_strip_wavpack(const uint8_t *src, uint8_t **pdst, int *size)
-{
-    uint8_t *dst;
-    int srclen = *size;
-    int offset = 0;
-    int ret;
-
-    dst = av_malloc(srclen);
-    if (!dst)
-        return AVERROR(ENOMEM);
-
-    while (srclen >= WV_HEADER_SIZE) {
-        WvHeader header;
-
-        ret = ff_wv_parse_header(&header, src);
-        if (ret < 0)
-            goto fail;
-        src    += WV_HEADER_SIZE;
-        srclen -= WV_HEADER_SIZE;
-
-        if (srclen < header.blocksize) {
-            ret = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-
-        if (header.initial) {
-            AV_WL32(dst + offset, header.samples);
-            offset += 4;
-        }
-        AV_WL32(dst + offset,     header.flags);
-        AV_WL32(dst + offset + 4, header.crc);
-        offset += 8;
-
-        if (!(header.initial && header.final)) {
-            AV_WL32(dst + offset, header.blocksize);
-            offset += 4;
-        }
-
-        memcpy(dst + offset, src, header.blocksize);
-        src    += header.blocksize;
-        srclen -= header.blocksize;
-        offset += header.blocksize;
-    }
-
-    *pdst = dst;
-    *size = offset;
-
-    return 0;
-fail:
-    av_freep(&dst);
-    return ret;
-}
-
-static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
-                            unsigned int blockid, AVPacket *pkt, int flags)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
-    uint8_t *data = NULL;
-    int offset = 0, size = pkt->size;
-    int64_t ts = mkv->tracks[pkt->stream_index].write_dts ? pkt->dts : pkt->pts;
-
-    av_log(s, AV_LOG_DEBUG, "Writing block at offset %" PRIu64 ", size %d, "
-           "pts %" PRId64 ", dts %" PRId64 ", duration %d, flags %d\n",
-           avio_tell(pb), pkt->size, pkt->pts, pkt->dts, pkt->duration, flags);
-    if (codec->codec_id == AV_CODEC_ID_H264 && codec->extradata_size > 0 &&
-        (AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1))
-        ff_avc_parse_nal_units_buf(pkt->data, &data, &size);
-    else if (codec->codec_id == AV_CODEC_ID_HEVC && codec->extradata_size > 6 &&
-             (AV_RB24(codec->extradata) == 1 || AV_RB32(codec->extradata) == 1))
-        /* extradata is Annex B, assume the bitstream is too and convert it */
-        ff_hevc_annexb2mp4_buf(pkt->data, &data, &size, 0, NULL);
-    else if (codec->codec_id == AV_CODEC_ID_WAVPACK) {
-        int ret = mkv_strip_wavpack(pkt->data, &data, &size);
-        if (ret < 0) {
-            av_log(s, AV_LOG_ERROR, "Error stripping a WavPack packet.\n");
-            return;
-        }
-    } else
-        data = pkt->data;
-
-    if (codec->codec_id == AV_CODEC_ID_PRORES) {
-        /* Matroska specification requires to remove the first QuickTime atom
-         */
-        size -= 8;
-        offset = 8;
-    }
-
-    put_ebml_id(pb, blockid);
-    put_ebml_num(pb, size+4, 0);
-    avio_w8(pb, 0x80 | (pkt->stream_index + 1));     // this assumes stream_index is less than 126
-    avio_wb16(pb, ts - mkv->cluster_pts);
-    avio_w8(pb, flags);
-    avio_write(pb, data + offset, size);
-    if (data != pkt->data)
-        av_free(data);
-}
-
-static int srt_get_duration(uint8_t **buf)
-{
-    int i, duration = 0;
-
-    for (i=0; i<2 && !duration; i++) {
-        int s_hour, s_min, s_sec, s_hsec, e_hour, e_min, e_sec, e_hsec;
-        if (sscanf(*buf, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d",
-                   &s_hour, &s_min, &s_sec, &s_hsec,
-                   &e_hour, &e_min, &e_sec, &e_hsec) == 8) {
-            s_min  +=   60*s_hour;      e_min  +=   60*e_hour;
-            s_sec  +=   60*s_min;       e_sec  +=   60*e_min;
-            s_hsec += 1000*s_sec;       e_hsec += 1000*e_sec;
-            duration = e_hsec - s_hsec;
-        }
-        *buf += strcspn(*buf, "\n") + 1;
-    }
-    return duration;
-}
-
-static int mkv_write_srt_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
-{
-    ebml_master blockgroup;
-    AVPacket pkt2 = *pkt;
-    int64_t duration = srt_get_duration(&pkt2.data);
-    pkt2.size -= pkt2.data - pkt->data;
-
-    blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP,
-                                   mkv_blockgroup_size(pkt2.size));
-    mkv_write_block(s, pb, MATROSKA_ID_BLOCK, &pkt2, 0);
-    put_ebml_uint(pb, MATROSKA_ID_BLOCKDURATION, duration);
-    end_ebml_master(pb, blockgroup);
-
-    return duration;
-}
-
-static void mkv_flush_dynbuf(AVFormatContext *s)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    int bufsize;
-    uint8_t *dyn_buf;
-
-    if (!mkv->dyn_bc)
-        return;
-
-    bufsize = avio_close_dyn_buf(mkv->dyn_bc, &dyn_buf);
-    avio_write(s->pb, dyn_buf, bufsize);
-    av_free(dyn_buf);
-    mkv->dyn_bc = NULL;
-}
-
-static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
-    int keyframe = !!(pkt->flags & AV_PKT_FLAG_KEY);
-    int duration = pkt->duration;
-    int ret;
-    int64_t ts = mkv->tracks[pkt->stream_index].write_dts ? pkt->dts : pkt->pts;
-
-    if (ts == AV_NOPTS_VALUE) {
-        av_log(s, AV_LOG_ERROR, "Can't write packet with unknown timestamp\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (!s->pb->seekable) {
-        if (!mkv->dyn_bc)
-            avio_open_dyn_buf(&mkv->dyn_bc);
-        pb = mkv->dyn_bc;
-    }
-
-    if (!mkv->cluster_pos) {
-        mkv->cluster_pos = avio_tell(s->pb);
-        mkv->cluster = start_ebml_master(pb, MATROSKA_ID_CLUSTER, 0);
-        put_ebml_uint(pb, MATROSKA_ID_CLUSTERTIMECODE, FFMAX(0, ts));
-        mkv->cluster_pts = FFMAX(0, ts);
-    }
-
-    if (codec->codec_type != AVMEDIA_TYPE_SUBTITLE) {
-        mkv_write_block(s, pb, MATROSKA_ID_SIMPLEBLOCK, pkt, keyframe << 7);
-    } else if (codec->codec_id == AV_CODEC_ID_SSA) {
-        duration = mkv_write_ass_blocks(s, pb, pkt);
-    } else if (codec->codec_id == AV_CODEC_ID_SRT) {
-        duration = mkv_write_srt_blocks(s, pb, pkt);
-    } else {
-        ebml_master blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, mkv_blockgroup_size(pkt->size));
-        duration = pkt->convergence_duration;
-        mkv_write_block(s, pb, MATROSKA_ID_BLOCK, pkt, 0);
-        put_ebml_uint(pb, MATROSKA_ID_BLOCKDURATION, duration);
-        end_ebml_master(pb, blockgroup);
-    }
-
-    if (codec->codec_type == AVMEDIA_TYPE_VIDEO && keyframe) {
-        ret = mkv_add_cuepoint(mkv->cues, pkt->stream_index, ts, mkv->cluster_pos);
-        if (ret < 0) return ret;
-    }
-
-    mkv->duration = FFMAX(mkv->duration, ts + duration);
-    return 0;
-}
-
-static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    int codec_type          = s->streams[pkt->stream_index]->codec->codec_type;
-    int keyframe            = !!(pkt->flags & AV_PKT_FLAG_KEY);
-    int cluster_size;
-    int64_t cluster_time;
-    AVIOContext *pb;
-    int ret;
-
-    if (mkv->tracks[pkt->stream_index].write_dts)
-        cluster_time = pkt->dts - mkv->cluster_pts;
-    else
-        cluster_time = pkt->pts - mkv->cluster_pts;
-
-    // start a new cluster every 5 MB or 5 sec, or 32k / 1 sec for streaming or
-    // after 4k and on a keyframe
-    if (s->pb->seekable) {
-        pb = s->pb;
-        cluster_size = avio_tell(pb) - mkv->cluster_pos;
-    } else {
-        pb = mkv->dyn_bc;
-        cluster_size = avio_tell(pb);
-    }
-
-    if (mkv->cluster_pos &&
-        (cluster_size > mkv->cluster_size_limit ||
-         cluster_time > mkv->cluster_time_limit ||
-         (codec_type == AVMEDIA_TYPE_VIDEO && keyframe &&
-          cluster_size > 4 * 1024))) {
-        av_log(s, AV_LOG_DEBUG, "Starting new cluster at offset %" PRIu64
-               " bytes, pts %" PRIu64 "dts %" PRIu64 "\n",
-               avio_tell(pb), pkt->pts, pkt->dts);
-        end_ebml_master(pb, mkv->cluster);
-        mkv->cluster_pos = 0;
-        if (mkv->dyn_bc)
-            mkv_flush_dynbuf(s);
-        avio_flush(s->pb);
-    }
-
-    // check if we have an audio packet cached
-    if (mkv->cur_audio_pkt.size > 0) {
-        ret = mkv_write_packet_internal(s, &mkv->cur_audio_pkt);
-        av_free_packet(&mkv->cur_audio_pkt);
-        if (ret < 0) {
-            av_log(s, AV_LOG_ERROR, "Could not write cached audio packet ret:%d\n", ret);
-            return ret;
-        }
-    }
-
-    // buffer an audio packet to ensure the packet containing the video
-    // keyframe's timecode is contained in the same cluster for WebM
-    if (codec_type == AVMEDIA_TYPE_AUDIO) {
-        mkv->cur_audio_pkt = *pkt;
-        if (pkt->buf) {
-            mkv->cur_audio_pkt.buf = av_buffer_ref(pkt->buf);
-            ret = mkv->cur_audio_pkt.buf ? 0 : AVERROR(ENOMEM);
-        } else
-            ret = av_dup_packet(&mkv->cur_audio_pkt);
-    } else
-        ret = mkv_write_packet_internal(s, pkt);
-    return ret;
-}
-
-static int mkv_write_flush_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    AVIOContext *pb;
-    if (s->pb->seekable)
-        pb = s->pb;
-    else
-        pb = mkv->dyn_bc;
-    if (!pkt) {
-        if (mkv->cluster_pos) {
-            av_log(s, AV_LOG_DEBUG, "Flushing cluster at offset %" PRIu64
-                   " bytes\n", avio_tell(pb));
-            end_ebml_master(pb, mkv->cluster);
-            mkv->cluster_pos = 0;
-            if (mkv->dyn_bc)
-                mkv_flush_dynbuf(s);
-            avio_flush(s->pb);
-        }
-        return 0;
-    }
-    return mkv_write_packet(s, pkt);
-}
-
-static int mkv_write_trailer(AVFormatContext *s)
-{
-    MatroskaMuxContext *mkv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t currentpos, cuespos;
-    int ret;
-
-    // check if we have an audio packet cached
-    if (mkv->cur_audio_pkt.size > 0) {
-        ret = mkv_write_packet_internal(s, &mkv->cur_audio_pkt);
-        av_free_packet(&mkv->cur_audio_pkt);
-        if (ret < 0) {
-            av_log(s, AV_LOG_ERROR, "Could not write cached audio packet ret:%d\n", ret);
-            return ret;
-        }
-    }
-
-    if (mkv->dyn_bc) {
-        end_ebml_master(mkv->dyn_bc, mkv->cluster);
-        mkv_flush_dynbuf(s);
-    } else if (mkv->cluster_pos) {
-        end_ebml_master(pb, mkv->cluster);
-    }
-
-    if (mkv->mode != MODE_WEBM) {
-        ret = mkv_write_chapters(s);
-        if (ret < 0) return ret;
-    }
-
-    if (pb->seekable) {
-        if (mkv->cues->num_entries) {
-            if (mkv->reserve_cues_space) {
-                int64_t cues_end;
-
-                currentpos = avio_tell(pb);
-                avio_seek(pb, mkv->cues_pos, SEEK_SET);
-
-                cuespos = mkv_write_cues(pb, mkv->cues, s->nb_streams);
-                cues_end = avio_tell(pb);
-                if (cues_end > cuespos + mkv->reserve_cues_space) {
-                    av_log(s, AV_LOG_ERROR, "Insufficient space reserved for cues: %d "
-                           "(needed: %"PRId64").\n", mkv->reserve_cues_space,
-                           cues_end - cuespos);
-                    return AVERROR(EINVAL);
-                }
-
-                if (cues_end < cuespos + mkv->reserve_cues_space)
-                    put_ebml_void(pb, mkv->reserve_cues_space - (cues_end - cuespos));
-
-                avio_seek(pb, currentpos, SEEK_SET);
-            } else {
-                cuespos = mkv_write_cues(pb, mkv->cues, s->nb_streams);
-            }
-
-            ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES, cuespos);
-            if (ret < 0) return ret;
-        }
-
-        mkv_write_seekhead(pb, mkv->main_seekhead);
-
-        // update the duration
-        av_log(s, AV_LOG_DEBUG, "end duration = %" PRIu64 "\n", mkv->duration);
-        currentpos = avio_tell(pb);
-        avio_seek(pb, mkv->duration_offset, SEEK_SET);
-        put_ebml_float(pb, MATROSKA_ID_DURATION, mkv->duration);
-
-        avio_seek(pb, currentpos, SEEK_SET);
-    }
-
-    end_ebml_master(pb, mkv->segment);
-    av_free(mkv->tracks);
-    av_freep(&mkv->cues->entries);
-    av_freep(&mkv->cues);
-
-    return 0;
-}
-
-static int mkv_query_codec(enum AVCodecID codec_id, int std_compliance)
-{
-    int i;
-    for (i = 0; ff_mkv_codec_tags[i].id != AV_CODEC_ID_NONE; i++)
-        if (ff_mkv_codec_tags[i].id == codec_id)
-            return 1;
-
-    if (std_compliance < FF_COMPLIANCE_NORMAL) {                // mkv theoretically supports any
-        enum AVMediaType type = avcodec_get_type(codec_id);     // video/audio through VFW/ACM
-        if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)
-            return 1;
-    }
-
-    return 0;
-}
-
-#define OFFSET(x) offsetof(MatroskaMuxContext, x)
-#define FLAGS AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "reserve_index_space", "Reserve a given amount of space (in bytes) at the beginning of the file for the index (cues).", OFFSET(reserve_cues_space), AV_OPT_TYPE_INT,   { .i64 = 0 },   0, INT_MAX,   FLAGS },
-    { "cluster_size_limit",  "Store at most the provided amount of bytes in a cluster. ",                                     OFFSET(cluster_size_limit), AV_OPT_TYPE_INT  , { .i64 = -1 }, -1, INT_MAX,   FLAGS },
-    { "cluster_time_limit",  "Store at most the provided number of milliseconds in a cluster.",                               OFFSET(cluster_time_limit), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, FLAGS },
-    { NULL },
-};
-
-#if CONFIG_MATROSKA_MUXER
-static const AVClass matroska_class = {
-    .class_name = "matroska muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVOutputFormat ff_matroska_muxer = {
-    .name              = "matroska",
-    .long_name         = NULL_IF_CONFIG_SMALL("Matroska"),
-    .mime_type         = "video/x-matroska",
-    .extensions        = "mkv",
-    .priv_data_size    = sizeof(MatroskaMuxContext),
-    .audio_codec       = CONFIG_LIBVORBIS_ENCODER ?
-                         AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3,
-    .video_codec       = CONFIG_LIBX264_ENCODER ?
-                         AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
-    .write_header      = mkv_write_header,
-    .write_packet      = mkv_write_flush_packet,
-    .write_trailer     = mkv_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
-                         AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
-    .codec_tag         = (const AVCodecTag* const []){
-         ff_codec_bmp_tags, ff_codec_wav_tags, 0
-    },
-    .subtitle_codec    = AV_CODEC_ID_SSA,
-    .query_codec       = mkv_query_codec,
-    .priv_class        = &matroska_class,
-};
-#endif
-
-#if CONFIG_WEBM_MUXER
-static const AVClass webm_class = {
-    .class_name = "webm muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVOutputFormat ff_webm_muxer = {
-    .name              = "webm",
-    .long_name         = NULL_IF_CONFIG_SMALL("WebM"),
-    .mime_type         = "video/webm",
-    .extensions        = "webm",
-    .priv_data_size    = sizeof(MatroskaMuxContext),
-    .audio_codec       = AV_CODEC_ID_VORBIS,
-    .video_codec       = AV_CODEC_ID_VP8,
-    .write_header      = mkv_write_header,
-    .write_packet      = mkv_write_flush_packet,
-    .write_trailer     = mkv_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
-                         AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
-    .priv_class        = &webm_class,
-};
-#endif
-
-#if CONFIG_MATROSKA_AUDIO_MUXER
-static const AVClass mka_class = {
-    .class_name = "matroska audio muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-AVOutputFormat ff_matroska_audio_muxer = {
-    .name              = "matroska",
-    .long_name         = NULL_IF_CONFIG_SMALL("Matroska"),
-    .mime_type         = "audio/x-matroska",
-    .extensions        = "mka",
-    .priv_data_size    = sizeof(MatroskaMuxContext),
-    .audio_codec       = CONFIG_LIBVORBIS_ENCODER ?
-                         AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = mkv_write_header,
-    .write_packet      = mkv_write_flush_packet,
-    .write_trailer     = mkv_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT |
-                         AVFMT_ALLOW_FLUSH,
-    .codec_tag         = (const AVCodecTag* const []){ ff_codec_wav_tags, 0 },
-    .priv_class        = &mka_class,
-};
-#endif
diff --git a/deps/libav/libavformat/md5enc.c b/deps/libav/libavformat/md5enc.c
deleted file mode 100644
index 9249704..0000000
--- a/deps/libav/libavformat/md5enc.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * MD5 encoder (for codec/format testing)
- * Copyright (c) 2009 Reimar Döffinger, based on crcenc (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/md5.h"
-#include "avformat.h"
-#include "internal.h"
-
-struct MD5Context {
-    struct AVMD5 *md5;
-};
-
-static void md5_finish(struct AVFormatContext *s, char *buf)
-{
-    struct MD5Context *c = s->priv_data;
-    uint8_t md5[16];
-    int i, offset = strlen(buf);
-    av_md5_final(c->md5, md5);
-    for (i = 0; i < sizeof(md5); i++) {
-        snprintf(buf + offset, 3, "%02"PRIx8, md5[i]);
-        offset += 2;
-    }
-    buf[offset] = '\n';
-    buf[offset+1] = 0;
-
-    avio_write(s->pb, buf, strlen(buf));
-    avio_flush(s->pb);
-}
-
-#if CONFIG_MD5_MUXER
-static int write_header(struct AVFormatContext *s)
-{
-    struct MD5Context *c = s->priv_data;
-    c->md5 = av_md5_alloc();
-    if (!c->md5)
-        return AVERROR(ENOMEM);
-    av_md5_init(c->md5);
-    return 0;
-}
-
-static int write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    struct MD5Context *c = s->priv_data;
-    av_md5_update(c->md5, pkt->data, pkt->size);
-    return 0;
-}
-
-static int write_trailer(struct AVFormatContext *s)
-{
-    struct MD5Context *c = s->priv_data;
-    char buf[64] = "MD5=";
-
-    md5_finish(s, buf);
-
-    av_freep(&c->md5);
-    return 0;
-}
-
-AVOutputFormat ff_md5_muxer = {
-    .name              = "md5",
-    .long_name         = NULL_IF_CONFIG_SMALL("MD5 testing"),
-    .extensions        = "",
-    .priv_data_size    = sizeof(struct MD5Context),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
-    .write_header      = write_header,
-    .write_packet      = write_packet,
-    .write_trailer     = write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_FRAMEMD5_MUXER
-static int framemd5_write_header(struct AVFormatContext *s)
-{
-    struct MD5Context *c = s->priv_data;
-    c->md5 = av_md5_alloc();
-    if (!c->md5)
-        return AVERROR(ENOMEM);
-    return ff_framehash_write_header(s);
-}
-
-static int framemd5_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    struct MD5Context *c = s->priv_data;
-    char buf[256];
-    av_md5_init(c->md5);
-    av_md5_update(c->md5, pkt->data, pkt->size);
-
-    snprintf(buf, sizeof(buf) - 64, "%d, %10"PRId64", %10"PRId64", %8d, %8d, ",
-             pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size);
-    md5_finish(s, buf);
-    return 0;
-}
-
-static int framemd5_write_trailer(struct AVFormatContext *s)
-{
-    struct MD5Context *c = s->priv_data;
-    av_freep(&c->md5);
-    return 0;
-}
-
-AVOutputFormat ff_framemd5_muxer = {
-    .name              = "framemd5",
-    .long_name         = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing"),
-    .extensions        = "",
-    .priv_data_size    = sizeof(struct MD5Context),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
-    .write_header      = framemd5_write_header,
-    .write_packet      = framemd5_write_packet,
-    .write_trailer     = framemd5_write_trailer,
-    .flags             = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
-                         AVFMT_TS_NEGATIVE,
-};
-#endif
diff --git a/deps/libav/libavformat/md5proto.c b/deps/libav/libavformat/md5proto.c
deleted file mode 100644
index 12ddde3..0000000
--- a/deps/libav/libavformat/md5proto.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include "libavutil/avstring.h"
-#include "libavutil/md5.h"
-#include "libavutil/mem.h"
-#include "libavutil/error.h"
-#include "avformat.h"
-#include "avio.h"
-#include "url.h"
-
-struct MD5Context {
-    struct AVMD5 *md5;
-};
-
-static int md5_open(URLContext *h, const char *filename, int flags)
-{
-    struct MD5Context *c = h->priv_data;
-
-    if (!(flags & AVIO_FLAG_WRITE))
-        return AVERROR(EINVAL);
-
-    c->md5 = av_md5_alloc();
-    if (!c->md5)
-        return AVERROR(ENOMEM);
-    av_md5_init(c->md5);
-
-    return 0;
-}
-
-static int md5_write(URLContext *h, const unsigned char *buf, int size)
-{
-    struct MD5Context *c = h->priv_data;
-    av_md5_update(c->md5, buf, size);
-    return size;
-}
-
-static int md5_close(URLContext *h)
-{
-    struct MD5Context *c = h->priv_data;
-    const char *filename = h->filename;
-    uint8_t md5[16], buf[64];
-    URLContext *out;
-    int i, err = 0;
-
-    av_md5_final(c->md5, md5);
-    for (i = 0; i < sizeof(md5); i++)
-        snprintf(buf + i*2, 3, "%02x", md5[i]);
-    buf[i*2] = '\n';
-
-    av_strstart(filename, "md5:", &filename);
-
-    if (*filename) {
-        err = ffurl_open(&out, filename, AVIO_FLAG_WRITE,
-                         &h->interrupt_callback, NULL);
-        if (err)
-            return err;
-        err = ffurl_write(out, buf, i*2+1);
-        ffurl_close(out);
-    } else {
-        if (fwrite(buf, 1, i*2+1, stdout) < i*2+1)
-            err = AVERROR(errno);
-    }
-
-    av_freep(&c->md5);
-
-    return err;
-}
-
-
-URLProtocol ff_md5_protocol = {
-    .name                = "md5",
-    .url_open            = md5_open,
-    .url_write           = md5_write,
-    .url_close           = md5_close,
-    .priv_data_size      = sizeof(struct MD5Context),
-};
diff --git a/deps/libav/libavformat/metadata.c b/deps/libav/libavformat/metadata.c
deleted file mode 100644
index 77fb298..0000000
--- a/deps/libav/libavformat/metadata.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * copyright (c) 2009 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "metadata.h"
-#include "libavutil/dict.h"
-#include "libavutil/avstring.h"
-
-void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv,
-                                       const AVMetadataConv *s_conv)
-{
-    /* TODO: use binary search to look up the two conversion tables
-       if the tables are getting big enough that it would matter speed wise */
-    const AVMetadataConv *sc, *dc;
-    AVDictionaryEntry *mtag = NULL;
-    AVDictionary *dst = NULL;
-    const char *key;
-
-    if (d_conv == s_conv)
-        return;
-
-    while ((mtag = av_dict_get(*pm, "", mtag, AV_DICT_IGNORE_SUFFIX))) {
-        key = mtag->key;
-        if (s_conv)
-            for (sc=s_conv; sc->native; sc++)
-                if (!av_strcasecmp(key, sc->native)) {
-                    key = sc->generic;
-                    break;
-                }
-        if (d_conv)
-            for (dc=d_conv; dc->native; dc++)
-                if (!av_strcasecmp(key, dc->generic)) {
-                    key = dc->native;
-                    break;
-                }
-        av_dict_set(&dst, key, mtag->value, 0);
-    }
-    av_dict_free(pm);
-    *pm = dst;
-}
-
-void ff_metadata_conv_ctx(AVFormatContext *ctx, const AVMetadataConv *d_conv,
-                                                const AVMetadataConv *s_conv)
-{
-    int i;
-    ff_metadata_conv(&ctx->metadata, d_conv, s_conv);
-    for (i=0; i<ctx->nb_streams ; i++)
-        ff_metadata_conv(&ctx->streams [i]->metadata, d_conv, s_conv);
-    for (i=0; i<ctx->nb_chapters; i++)
-        ff_metadata_conv(&ctx->chapters[i]->metadata, d_conv, s_conv);
-    for (i=0; i<ctx->nb_programs; i++)
-        ff_metadata_conv(&ctx->programs[i]->metadata, d_conv, s_conv);
-}
diff --git a/deps/libav/libavformat/metadata.h b/deps/libav/libavformat/metadata.h
deleted file mode 100644
index eee3ee4..0000000
--- a/deps/libav/libavformat/metadata.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * copyright (c) 2009 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_METADATA_H
-#define AVFORMAT_METADATA_H
-
-/**
- * @file
- * internal metadata API header
- * see avformat.h or the public API!
- */
-
-
-#include "avformat.h"
-#include "libavutil/dict.h"
-
-typedef struct AVMetadataConv {
-    const char *native;
-    const char *generic;
-} AVMetadataConv;
-
-void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv,
-                                       const AVMetadataConv *s_conv);
-void ff_metadata_conv_ctx(AVFormatContext *ctx, const AVMetadataConv *d_conv,
-                                                const AVMetadataConv *s_conv);
-
-#endif /* AVFORMAT_METADATA_H */
diff --git a/deps/libav/libavformat/mm.c b/deps/libav/libavformat/mm.c
deleted file mode 100644
index 8c9cbd7..0000000
--- a/deps/libav/libavformat/mm.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * American Laser Games MM Format Demuxer
- * Copyright (c) 2006 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * American Laser Games MM Format Demuxer
- * by Peter Ross (pross at xvid.org)
- *
- * The MM format was used by IBM-PC ports of ALG's "arcade shooter" games,
- * including Mad Dog McCree and Crime Patrol.
- *
- * Technical details here:
- *  http://wiki.multimedia.cx/index.php?title=American_Laser_Games_MM
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define MM_PREAMBLE_SIZE    6
-
-#define MM_TYPE_HEADER      0x0
-#define MM_TYPE_INTER       0x5
-#define MM_TYPE_INTRA       0x8
-#define MM_TYPE_INTRA_HH    0xc
-#define MM_TYPE_INTER_HH    0xd
-#define MM_TYPE_INTRA_HHV   0xe
-#define MM_TYPE_INTER_HHV   0xf
-#define MM_TYPE_AUDIO       0x15
-#define MM_TYPE_PALETTE     0x31
-
-#define MM_HEADER_LEN_V     0x16    /* video only */
-#define MM_HEADER_LEN_AV    0x18    /* video + audio */
-
-#define MM_PALETTE_COUNT    128
-#define MM_PALETTE_SIZE     (MM_PALETTE_COUNT*3)
-
-typedef struct {
-  unsigned int audio_pts, video_pts;
-} MmDemuxContext;
-
-static int probe(AVProbeData *p)
-{
-    int len, type, fps, w, h;
-    if (p->buf_size < MM_HEADER_LEN_AV + MM_PREAMBLE_SIZE)
-        return 0;
-    /* the first chunk is always the header */
-    if (AV_RL16(&p->buf[0]) != MM_TYPE_HEADER)
-        return 0;
-    len = AV_RL32(&p->buf[2]);
-    if (len != MM_HEADER_LEN_V && len != MM_HEADER_LEN_AV)
-        return 0;
-    fps = AV_RL16(&p->buf[8]);
-    w = AV_RL16(&p->buf[12]);
-    h = AV_RL16(&p->buf[14]);
-    if (!fps || fps > 60 || !w || w > 2048 || !h || h > 2048)
-        return 0;
-    type = AV_RL16(&p->buf[len]);
-    if (!type || type > 0x31)
-        return 0;
-
-    /* only return half certainty since this check is a bit sketchy */
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-static int read_header(AVFormatContext *s)
-{
-    MmDemuxContext *mm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-
-    unsigned int type, length;
-    unsigned int frame_rate, width, height;
-
-    type = avio_rl16(pb);
-    length = avio_rl32(pb);
-
-    if (type != MM_TYPE_HEADER)
-        return AVERROR_INVALIDDATA;
-
-    /* read header */
-    avio_rl16(pb);   /* total number of chunks */
-    frame_rate = avio_rl16(pb);
-    avio_rl16(pb);   /* ibm-pc video bios mode */
-    width = avio_rl16(pb);
-    height = avio_rl16(pb);
-    avio_skip(pb, length - 10);  /* unknown data */
-
-    /* video stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_MMVIDEO;
-    st->codec->codec_tag = 0;  /* no fourcc */
-    st->codec->width = width;
-    st->codec->height = height;
-    avpriv_set_pts_info(st, 64, 1, frame_rate);
-
-    /* audio stream */
-    if (length == MM_HEADER_LEN_AV) {
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_tag = 0; /* no fourcc */
-        st->codec->codec_id = AV_CODEC_ID_PCM_U8;
-        st->codec->channels = 1;
-        st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-        st->codec->sample_rate = 8000;
-        avpriv_set_pts_info(st, 64, 1, 8000); /* 8000 hz */
-    }
-
-    mm->audio_pts = 0;
-    mm->video_pts = 0;
-    return 0;
-}
-
-static int read_packet(AVFormatContext *s,
-                           AVPacket *pkt)
-{
-    MmDemuxContext *mm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned char preamble[MM_PREAMBLE_SIZE];
-    unsigned int type, length;
-
-    while(1) {
-
-        if (avio_read(pb, preamble, MM_PREAMBLE_SIZE) != MM_PREAMBLE_SIZE) {
-            return AVERROR(EIO);
-        }
-
-        type = AV_RL16(&preamble[0]);
-        length = AV_RL16(&preamble[2]);
-
-        switch(type) {
-        case MM_TYPE_PALETTE :
-        case MM_TYPE_INTER :
-        case MM_TYPE_INTRA :
-        case MM_TYPE_INTRA_HH :
-        case MM_TYPE_INTER_HH :
-        case MM_TYPE_INTRA_HHV :
-        case MM_TYPE_INTER_HHV :
-            /* output preamble + data */
-            if (av_new_packet(pkt, length + MM_PREAMBLE_SIZE))
-                return AVERROR(ENOMEM);
-            memcpy(pkt->data, preamble, MM_PREAMBLE_SIZE);
-            if (avio_read(pb, pkt->data + MM_PREAMBLE_SIZE, length) != length)
-                return AVERROR(EIO);
-            pkt->size = length + MM_PREAMBLE_SIZE;
-            pkt->stream_index = 0;
-            pkt->pts = mm->video_pts;
-            if (type!=MM_TYPE_PALETTE)
-                mm->video_pts++;
-            return 0;
-
-        case MM_TYPE_AUDIO :
-            if (av_get_packet(s->pb, pkt, length)<0)
-                return AVERROR(ENOMEM);
-            pkt->size = length;
-            pkt->stream_index = 1;
-            pkt->pts = mm->audio_pts++;
-            return 0;
-
-        default :
-            av_log(s, AV_LOG_INFO, "unknown chunk type 0x%x\n", type);
-            avio_skip(pb, length);
-        }
-    }
-}
-
-AVInputFormat ff_mm_demuxer = {
-    .name           = "mm",
-    .long_name      = NULL_IF_CONFIG_SMALL("American Laser Games MM"),
-    .priv_data_size = sizeof(MmDemuxContext),
-    .read_probe     = probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-};
diff --git a/deps/libav/libavformat/mmf.c b/deps/libav/libavformat/mmf.c
deleted file mode 100644
index 61f1d7a..0000000
--- a/deps/libav/libavformat/mmf.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Yamaha SMAF format
- * Copyright (c) 2005 Vidar Madsen
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "pcm.h"
-#include "riff.h"
-
-typedef struct {
-    int64_t atrpos, atsqpos, awapos;
-    int64_t data_size;
-} MMFContext;
-
-static const int mmf_rates[] = { 4000, 8000, 11025, 22050, 44100 };
-
-static int mmf_rate(int code)
-{
-    if ((code < 0) || (code > 4))
-        return -1;
-    return mmf_rates[code];
-}
-
-#if CONFIG_MMF_MUXER
-static int mmf_rate_code(int rate)
-{
-    int i;
-    for (i = 0; i < 5; i++)
-        if (mmf_rates[i] == rate)
-            return i;
-    return -1;
-}
-
-/* Copy of end_tag() from avienc.c, but for big-endian chunk size */
-static void end_tag_be(AVIOContext *pb, int64_t start)
-{
-    int64_t pos;
-
-    pos = avio_tell(pb);
-    avio_seek(pb, start - 4, SEEK_SET);
-    avio_wb32(pb, (uint32_t)(pos - start));
-    avio_seek(pb, pos, SEEK_SET);
-}
-
-static int mmf_write_header(AVFormatContext *s)
-{
-    MMFContext *mmf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pos;
-    int rate;
-
-    rate = mmf_rate_code(s->streams[0]->codec->sample_rate);
-    if (rate < 0) {
-        av_log(s, AV_LOG_ERROR, "Unsupported sample rate %d\n",
-               s->streams[0]->codec->sample_rate);
-        return -1;
-    }
-
-    ffio_wfourcc(pb, "MMMD");
-    avio_wb32(pb, 0);
-    pos = ff_start_tag(pb, "CNTI");
-    avio_w8(pb, 0); /* class */
-    avio_w8(pb, 0); /* type */
-    avio_w8(pb, 0); /* code type */
-    avio_w8(pb, 0); /* status */
-    avio_w8(pb, 0); /* counts */
-    end_tag_be(pb, pos);
-
-    pos = ff_start_tag(pb, "OPDA");
-    avio_write(pb, "VN:libavcodec,", sizeof("VN:libavcodec,") -1); /* metadata ("ST:songtitle,VN:version,...") */
-    end_tag_be(pb, pos);
-
-    avio_write(pb, "ATR\x00", 4);
-    avio_wb32(pb, 0);
-    mmf->atrpos = avio_tell(pb);
-    avio_w8(pb, 0); /* format type */
-    avio_w8(pb, 0); /* sequence type */
-    avio_w8(pb, (0 << 7) | (1 << 4) | rate); /* (channel << 7) | (format << 4) | rate */
-    avio_w8(pb, 0); /* wave base bit */
-    avio_w8(pb, 2); /* time base d */
-    avio_w8(pb, 2); /* time base g */
-
-    ffio_wfourcc(pb, "Atsq");
-    avio_wb32(pb, 16);
-    mmf->atsqpos = avio_tell(pb);
-    /* Will be filled on close */
-    avio_write(pb, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16);
-
-    mmf->awapos = ff_start_tag(pb, "Awa\x01");
-
-    avpriv_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
-
-    avio_flush(pb);
-
-    return 0;
-}
-
-static int mmf_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    avio_write(pb, pkt->data, pkt->size);
-    return 0;
-}
-
-/* Write a variable-length symbol */
-static void put_varlength(AVIOContext *pb, int val)
-{
-    if (val < 128)
-        avio_w8(pb, val);
-    else {
-        val -= 128;
-        avio_w8(pb, 0x80 | val >> 7);
-        avio_w8(pb, 0x7f & val);
-    }
-}
-
-static int mmf_write_trailer(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    MMFContext *mmf = s->priv_data;
-    int64_t pos, size;
-    int gatetime;
-
-    if (s->pb->seekable) {
-        /* Fill in length fields */
-        end_tag_be(pb, mmf->awapos);
-        end_tag_be(pb, mmf->atrpos);
-        end_tag_be(pb, 8);
-
-        pos  = avio_tell(pb);
-        size = pos - mmf->awapos;
-
-        /* Fill Atsq chunk */
-        avio_seek(pb, mmf->atsqpos, SEEK_SET);
-
-        /* "play wav" */
-        avio_w8(pb, 0); /* start time */
-        avio_w8(pb, 1); /* (channel << 6) | wavenum */
-        gatetime = size * 500 / s->streams[0]->codec->sample_rate;
-        put_varlength(pb, gatetime); /* duration */
-
-        /* "nop" */
-        put_varlength(pb, gatetime); /* start time */
-        avio_write(pb, "\xff\x00", 2); /* nop */
-
-        /* "end of sequence" */
-        avio_write(pb, "\x00\x00\x00\x00", 4);
-
-        avio_seek(pb, pos, SEEK_SET);
-
-        avio_flush(pb);
-    }
-    return 0;
-}
-#endif /* CONFIG_MMF_MUXER */
-
-static int mmf_probe(AVProbeData *p)
-{
-    /* check file header */
-    if (p->buf[0] == 'M' && p->buf[1] == 'M' &&
-        p->buf[2] == 'M' && p->buf[3] == 'D' &&
-        p->buf[8] == 'C' && p->buf[9] == 'N' &&
-        p->buf[10] == 'T' && p->buf[11] == 'I')
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-/* mmf input */
-static int mmf_read_header(AVFormatContext *s)
-{
-    MMFContext *mmf = s->priv_data;
-    unsigned int tag;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    int64_t size;
-    int rate, params;
-
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('M', 'M', 'M', 'D'))
-        return -1;
-    avio_skip(pb, 4); /* file_size */
-
-    /* Skip some unused chunks that may or may not be present */
-    for (;; avio_skip(pb, size)) {
-        tag  = avio_rl32(pb);
-        size = avio_rb32(pb);
-        if (tag == MKTAG('C', 'N', 'T', 'I'))
-            continue;
-        if (tag == MKTAG('O', 'P', 'D', 'A'))
-            continue;
-        break;
-    }
-
-    /* Tag = "ATRx", where "x" = track number */
-    if ((tag & 0xffffff) == MKTAG('M', 'T', 'R', 0)) {
-        av_log(s, AV_LOG_ERROR, "MIDI like format found, unsupported\n");
-        return -1;
-    }
-    if ((tag & 0xffffff) != MKTAG('A', 'T', 'R', 0)) {
-        av_log(s, AV_LOG_ERROR, "Unsupported SMAF chunk %08x\n", tag);
-        return -1;
-    }
-
-    avio_r8(pb); /* format type */
-    avio_r8(pb); /* sequence type */
-    params = avio_r8(pb); /* (channel << 7) | (format << 4) | rate */
-    rate   = mmf_rate(params & 0x0f);
-    if (rate < 0) {
-        av_log(s, AV_LOG_ERROR, "Invalid sample rate\n");
-        return -1;
-    }
-    avio_r8(pb); /* wave base bit */
-    avio_r8(pb); /* time base d */
-    avio_r8(pb); /* time base g */
-
-    /* Skip some unused chunks that may or may not be present */
-    for (;; avio_skip(pb, size)) {
-        tag  = avio_rl32(pb);
-        size = avio_rb32(pb);
-        if (tag == MKTAG('A', 't', 's', 'q'))
-            continue;
-        if (tag == MKTAG('A', 's', 'p', 'I'))
-            continue;
-        break;
-    }
-
-    /* Make sure it's followed by an Awa chunk, aka wave data */
-    if ((tag & 0xffffff) != MKTAG('A', 'w', 'a', 0)) {
-        av_log(s, AV_LOG_ERROR, "Unexpected SMAF chunk %08x\n", tag);
-        return -1;
-    }
-    mmf->data_size = size;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type            = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id              = AV_CODEC_ID_ADPCM_YAMAHA;
-    st->codec->sample_rate           = rate;
-    st->codec->channels              = 1;
-    st->codec->channel_layout        = AV_CH_LAYOUT_MONO;
-    st->codec->bits_per_coded_sample = 4;
-    st->codec->bit_rate              = st->codec->sample_rate *
-                                       st->codec->bits_per_coded_sample;
-
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-
-    return 0;
-}
-
-#define MAX_SIZE 4096
-
-static int mmf_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MMFContext *mmf = s->priv_data;
-    int ret, size;
-
-    if (s->pb->eof_reached)
-        return AVERROR(EIO);
-
-    size = MAX_SIZE;
-    if (size > mmf->data_size)
-        size = mmf->data_size;
-
-    if (!size)
-        return AVERROR(EIO);
-
-    if (av_new_packet(pkt, size))
-        return AVERROR(EIO);
-    pkt->stream_index = 0;
-
-    ret = avio_read(s->pb, pkt->data, pkt->size);
-    if (ret < 0)
-        av_free_packet(pkt);
-
-    mmf->data_size -= ret;
-
-    pkt->size = ret;
-    return ret;
-}
-
-#if CONFIG_MMF_DEMUXER
-AVInputFormat ff_mmf_demuxer = {
-    .name           = "mmf",
-    .long_name      = NULL_IF_CONFIG_SMALL("Yamaha SMAF"),
-    .priv_data_size = sizeof(MMFContext),
-    .read_probe     = mmf_probe,
-    .read_header    = mmf_read_header,
-    .read_packet    = mmf_read_packet,
-    .read_seek      = ff_pcm_read_seek,
-};
-#endif
-
-#if CONFIG_MMF_MUXER
-AVOutputFormat ff_mmf_muxer = {
-    .name           = "mmf",
-    .long_name      = NULL_IF_CONFIG_SMALL("Yamaha SMAF"),
-    .mime_type      = "application/vnd.smaf",
-    .extensions     = "mmf",
-    .priv_data_size = sizeof(MMFContext),
-    .audio_codec    = AV_CODEC_ID_ADPCM_YAMAHA,
-    .video_codec    = AV_CODEC_ID_NONE,
-    .write_header   = mmf_write_header,
-    .write_packet   = mmf_write_packet,
-    .write_trailer  = mmf_write_trailer,
-};
-#endif
diff --git a/deps/libav/libavformat/mms.c b/deps/libav/libavformat/mms.c
deleted file mode 100644
index fb16a3c..0000000
--- a/deps/libav/libavformat/mms.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * MMS protocol common definitions.
- * Copyright (c) 2006,2007 Ryan Martell
- * Copyright (c) 2007 Björn Axelsson
- * Copyright (c) 2010 Zhentan Feng <spyfeng at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "mms.h"
-#include "asf.h"
-#include "libavutil/intreadwrite.h"
-
-#define MMS_MAX_STREAMS 256    /**< arbitrary sanity check value */
-
-int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size)
-{
-    char *pos;
-    int size_to_copy;
-    int remaining_size = mms->asf_header_size - mms->asf_header_read_size;
-    size_to_copy = FFMIN(size, remaining_size);
-    pos = mms->asf_header + mms->asf_header_read_size;
-    memcpy(buf, pos, size_to_copy);
-    if (mms->asf_header_read_size == mms->asf_header_size) {
-        av_freep(&mms->asf_header); // which contains asf header
-    }
-    mms->asf_header_read_size += size_to_copy;
-    return size_to_copy;
-}
-
-int ff_mms_read_data(MMSContext *mms, uint8_t *buf, const int size)
-{
-    int read_size;
-    read_size = FFMIN(size, mms->remaining_in_len);
-    memcpy(buf, mms->read_in_ptr, read_size);
-    mms->remaining_in_len -= read_size;
-    mms->read_in_ptr      += read_size;
-    return read_size;
-}
-
-int ff_mms_asf_header_parser(MMSContext *mms)
-{
-    uint8_t *p = mms->asf_header;
-    uint8_t *end;
-    int flags, stream_id;
-    mms->stream_num = 0;
-
-    if (mms->asf_header_size < sizeof(ff_asf_guid) * 2 + 22 ||
-        memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Corrupt stream (invalid ASF header, size=%d)\n",
-               mms->asf_header_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    end = mms->asf_header + mms->asf_header_size;
-
-    p += sizeof(ff_asf_guid) + 14;
-    while(end - p >= sizeof(ff_asf_guid) + 8) {
-        uint64_t chunksize;
-        if (!memcmp(p, ff_asf_data_header, sizeof(ff_asf_guid))) {
-            chunksize = 50; // see Reference [2] section 5.1
-        } else {
-            chunksize = AV_RL64(p + sizeof(ff_asf_guid));
-        }
-        if (!chunksize || chunksize > end - p) {
-            av_log(NULL, AV_LOG_ERROR,
-                   "Corrupt stream (header chunksize %"PRId64" is invalid)\n",
-                   chunksize);
-            return AVERROR_INVALIDDATA;
-        }
-        if (!memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) {
-            /* read packet size */
-            if (end - p > sizeof(ff_asf_guid) * 2 + 68) {
-                mms->asf_packet_len = AV_RL32(p + sizeof(ff_asf_guid) * 2 + 64);
-                if (mms->asf_packet_len <= 0 || mms->asf_packet_len > sizeof(mms->in_buffer)) {
-                    av_log(NULL, AV_LOG_ERROR,
-                           "Corrupt stream (too large pkt_len %d)\n",
-                           mms->asf_packet_len);
-                    return AVERROR_INVALIDDATA;
-                }
-            }
-        } else if (!memcmp(p, ff_asf_stream_header, sizeof(ff_asf_guid))) {
-            flags     = AV_RL16(p + sizeof(ff_asf_guid)*3 + 24);
-            stream_id = flags & 0x7F;
-            //The second condition is for checking CS_PKT_STREAM_ID_REQUEST packet size,
-            //we can calcuate the packet size by stream_num.
-            //Please see function send_stream_selection_request().
-            if (mms->stream_num < MMS_MAX_STREAMS &&
-                    46 + mms->stream_num * 6 < sizeof(mms->out_buffer)) {
-                mms->streams = av_fast_realloc(mms->streams,
-                                   &mms->nb_streams_allocated,
-                                   (mms->stream_num + 1) * sizeof(MMSStream));
-                mms->streams[mms->stream_num].id = stream_id;
-                mms->stream_num++;
-            } else {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Corrupt stream (too many A/V streams)\n");
-                return AVERROR_INVALIDDATA;
-            }
-        } else if (!memcmp(p, ff_asf_ext_stream_header, sizeof(ff_asf_guid))) {
-            if (end - p >= 88) {
-                int stream_count = AV_RL16(p + 84), ext_len_count = AV_RL16(p + 86);
-                uint64_t skip_bytes = 88;
-                while (stream_count--) {
-                    if (end - p < skip_bytes + 4) {
-                        av_log(NULL, AV_LOG_ERROR,
-                               "Corrupt stream (next stream name length is not in the buffer)\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    skip_bytes += 4 + AV_RL16(p + skip_bytes + 2);
-                }
-                while (ext_len_count--) {
-                    if (end - p < skip_bytes + 22) {
-                        av_log(NULL, AV_LOG_ERROR,
-                               "Corrupt stream (next extension system info length is not in the buffer)\n");
-                        return AVERROR_INVALIDDATA;
-                    }
-                    skip_bytes += 22 + AV_RL32(p + skip_bytes + 18);
-                }
-                if (end - p < skip_bytes) {
-                    av_log(NULL, AV_LOG_ERROR,
-                           "Corrupt stream (the last extension system info length is invalid)\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                if (chunksize - skip_bytes > 24)
-                    chunksize = skip_bytes;
-            }
-        } else if (!memcmp(p, ff_asf_head1_guid, sizeof(ff_asf_guid))) {
-            chunksize = 46; // see references [2] section 3.4. This should be set 46.
-        }
-        p += chunksize;
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/mms.h b/deps/libav/libavformat/mms.h
deleted file mode 100644
index e89da41..0000000
--- a/deps/libav/libavformat/mms.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * MMS protocol common definitions.
- * Copyright (c) 2010 Zhentan Feng <spyfeng at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVFORMAT_MMS_H
-#define AVFORMAT_MMS_H
-
-#include "url.h"
-
-typedef struct MMSStream {
-    int id;
-}MMSStream;
-
-typedef struct MMSContext {
-    URLContext *mms_hd;                  ///< TCP connection handle
-    MMSStream *streams;
-
-    /** Buffer for outgoing packets. */
-    /*@{*/
-    uint8_t *write_out_ptr;              ///< Pointer for writing the buffer.
-    uint8_t out_buffer[512];            ///< Buffer for outgoing packet.
-    /*@}*/
-
-    /** Buffer for incoming packets. */
-    /*@{*/
-    uint8_t in_buffer[65536];            ///< Buffer for incoming packets.
-    uint8_t *read_in_ptr;                ///< Pointer for reading from incoming buffer.
-    int remaining_in_len;                ///< Reading length from incoming buffer.
-    /*@}*/
-
-    /** Internal handling of the ASF header */
-    /*@{*/
-    uint8_t *asf_header;                 ///< Stored ASF header.
-    int asf_header_size;                 ///< Size of stored ASF header.
-    int header_parsed;                   ///< The header has been received and parsed.
-    int asf_packet_len;
-    int asf_header_read_size;
-    /*@}*/
-
-    int stream_num;                      ///< stream numbers.
-    unsigned int nb_streams_allocated;   ///< allocated size of streams
-} MMSContext;
-
-int ff_mms_asf_header_parser(MMSContext * mms);
-int ff_mms_read_data(MMSContext *mms, uint8_t *buf, const int size);
-int ff_mms_read_header(MMSContext * mms, uint8_t * buf, const int size);
-
-#endif /* AVFORMAT_MMS_H */
diff --git a/deps/libav/libavformat/mmsh.c b/deps/libav/libavformat/mmsh.c
deleted file mode 100644
index 5e9d0bc..0000000
--- a/deps/libav/libavformat/mmsh.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * MMS protocol over HTTP
- * Copyright (c) 2010 Zhentan Feng <spyfeng at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Reference
- * Windows Media HTTP Streaming Protocol.
- * http://msdn.microsoft.com/en-us/library/cc251059(PROT.10).aspx
- */
-
-#include <string.h>
-#include "libavutil/intreadwrite.h"
-#include "libavutil/avstring.h"
-#include "libavutil/opt.h"
-#include "internal.h"
-#include "mms.h"
-#include "asf.h"
-#include "http.h"
-#include "url.h"
-
-#define CHUNK_HEADER_LENGTH 4   // 2bytes chunk type and 2bytes chunk length.
-#define EXT_HEADER_LENGTH   8   // 4bytes sequence, 2bytes useless and 2bytes chunk length.
-
-// see Ref 2.2.1.8
-#define USERAGENT  "User-Agent: NSPlayer/4.1.0.3856\r\n"
-// see Ref 2.2.1.4.33
-// the guid value can be changed to any valid value.
-#define CLIENTGUID "Pragma: xClientGUID={c77e7400-738a-11d2-9add-0020af0a3278}\r\n"
-
-// see Ref 2.2.3 for packet type define:
-// chunk type contains 2 fields: Frame and PacketID.
-// Frame is 0x24 or 0xA4(rarely), different PacketID indicates different packet type.
-typedef enum {
-    CHUNK_TYPE_DATA          = 0x4424,
-    CHUNK_TYPE_ASF_HEADER    = 0x4824,
-    CHUNK_TYPE_END           = 0x4524,
-    CHUNK_TYPE_STREAM_CHANGE = 0x4324,
-} ChunkType;
-
-typedef struct {
-    MMSContext mms;
-    int request_seq;  ///< request packet sequence
-    int chunk_seq;    ///< data packet sequence
-} MMSHContext;
-
-static int mmsh_close(URLContext *h)
-{
-    MMSHContext *mmsh = (MMSHContext *)h->priv_data;
-    MMSContext *mms   = &mmsh->mms;
-    if (mms->mms_hd)
-        ffurl_close(mms->mms_hd);
-    av_free(mms->streams);
-    av_free(mms->asf_header);
-    return 0;
-}
-
-static ChunkType get_chunk_header(MMSHContext *mmsh, int *len)
-{
-    MMSContext *mms = &mmsh->mms;
-    uint8_t chunk_header[CHUNK_HEADER_LENGTH];
-    uint8_t ext_header[EXT_HEADER_LENGTH];
-    ChunkType chunk_type;
-    int chunk_len, res, ext_header_len;
-
-    res = ffurl_read_complete(mms->mms_hd, chunk_header, CHUNK_HEADER_LENGTH);
-    if (res != CHUNK_HEADER_LENGTH) {
-        av_log(NULL, AV_LOG_ERROR, "Read data packet header failed!\n");
-        return AVERROR(EIO);
-    }
-    chunk_type = AV_RL16(chunk_header);
-    chunk_len  = AV_RL16(chunk_header + 2);
-
-    switch (chunk_type) {
-    case CHUNK_TYPE_END:
-    case CHUNK_TYPE_STREAM_CHANGE:
-        ext_header_len = 4;
-        break;
-    case CHUNK_TYPE_ASF_HEADER:
-    case CHUNK_TYPE_DATA:
-        ext_header_len = 8;
-        break;
-    default:
-        av_log(NULL, AV_LOG_ERROR, "Strange chunk type %d\n", chunk_type);
-        return AVERROR_INVALIDDATA;
-    }
-
-    res = ffurl_read_complete(mms->mms_hd, ext_header, ext_header_len);
-    if (res != ext_header_len) {
-        av_log(NULL, AV_LOG_ERROR, "Read ext header failed!\n");
-        return AVERROR(EIO);
-    }
-    *len = chunk_len - ext_header_len;
-    if (chunk_type == CHUNK_TYPE_END || chunk_type == CHUNK_TYPE_DATA)
-        mmsh->chunk_seq = AV_RL32(ext_header);
-    return chunk_type;
-}
-
-static int read_data_packet(MMSHContext *mmsh, const int len)
-{
-    MMSContext *mms   = &mmsh->mms;
-    int res;
-    if (len > sizeof(mms->in_buffer)) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Data packet length %d exceeds the in_buffer size %zu\n",
-               len, sizeof(mms->in_buffer));
-        return AVERROR(EIO);
-    }
-    res = ffurl_read_complete(mms->mms_hd, mms->in_buffer, len);
-    av_dlog(NULL, "Data packet len = %d\n", len);
-    if (res != len) {
-        av_log(NULL, AV_LOG_ERROR, "Read data packet failed!\n");
-        return AVERROR(EIO);
-    }
-    if (len > mms->asf_packet_len) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Chunk length %d exceed packet length %d\n",len, mms->asf_packet_len);
-        return AVERROR_INVALIDDATA;
-    } else {
-        memset(mms->in_buffer + len, 0, mms->asf_packet_len - len); // padding
-    }
-    mms->read_in_ptr      = mms->in_buffer;
-    mms->remaining_in_len = mms->asf_packet_len;
-    return 0;
-}
-
-static int get_http_header_data(MMSHContext *mmsh)
-{
-    MMSContext *mms = &mmsh->mms;
-    int res, len;
-    ChunkType chunk_type;
-
-    for (;;) {
-        len = 0;
-        res = chunk_type = get_chunk_header(mmsh, &len);
-        if (res < 0) {
-            return res;
-        } else if (chunk_type == CHUNK_TYPE_ASF_HEADER){
-            // get asf header and stored it
-            if (!mms->header_parsed) {
-                if (mms->asf_header) {
-                    if (len != mms->asf_header_size) {
-                        mms->asf_header_size = len;
-                        av_dlog(NULL, "Header len changed from %d to %d\n",
-                                mms->asf_header_size, len);
-                        av_freep(&mms->asf_header);
-                    }
-                }
-                mms->asf_header = av_mallocz(len);
-                if (!mms->asf_header) {
-                    return AVERROR(ENOMEM);
-                }
-                mms->asf_header_size = len;
-            }
-            if (len > mms->asf_header_size) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Asf header packet len = %d exceed the asf header buf size %d\n",
-                       len, mms->asf_header_size);
-                return AVERROR(EIO);
-            }
-            res = ffurl_read_complete(mms->mms_hd, mms->asf_header, len);
-            if (res != len) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Recv asf header data len %d != expected len %d\n", res, len);
-                return AVERROR(EIO);
-            }
-            mms->asf_header_size = len;
-            if (!mms->header_parsed) {
-                res = ff_mms_asf_header_parser(mms);
-                mms->header_parsed = 1;
-                return res;
-            }
-        } else if (chunk_type == CHUNK_TYPE_DATA) {
-            // read data packet and do padding
-            return read_data_packet(mmsh, len);
-        } else {
-            if (len) {
-                if (len > sizeof(mms->in_buffer)) {
-                    av_log(NULL, AV_LOG_ERROR,
-                           "Other packet len = %d exceed the in_buffer size %zu\n",
-                           len, sizeof(mms->in_buffer));
-                    return AVERROR(EIO);
-                }
-                res = ffurl_read_complete(mms->mms_hd, mms->in_buffer, len);
-                if (res != len) {
-                    av_log(NULL, AV_LOG_ERROR, "Read other chunk type data failed!\n");
-                    return AVERROR(EIO);
-                } else {
-                    av_dlog(NULL, "Skip chunk type %d \n", chunk_type);
-                    continue;
-                }
-            }
-        }
-    }
-}
-
-static int mmsh_open(URLContext *h, const char *uri, int flags)
-{
-    int i, port, err;
-    char httpname[256], path[256], host[128], location[1024];
-    char *stream_selection = NULL;
-    char headers[1024];
-    MMSHContext *mmsh = h->priv_data;
-    MMSContext *mms;
-
-    mmsh->request_seq = h->is_streamed = 1;
-    mms = &mmsh->mms;
-    av_strlcpy(location, uri, sizeof(location));
-
-    av_url_split(NULL, 0, NULL, 0,
-        host, sizeof(host), &port, path, sizeof(path), location);
-    if (port<0)
-        port = 80; // default mmsh protocol port
-    ff_url_join(httpname, sizeof(httpname), "http", NULL, host, port, "%s", path);
-
-    if (ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ,
-                    &h->interrupt_callback) < 0) {
-        return AVERROR(EIO);
-    }
-
-    snprintf(headers, sizeof(headers),
-             "Accept: */*\r\n"
-             USERAGENT
-             "Host: %s:%d\r\n"
-             "Pragma: no-cache,rate=1.000000,stream-time=0,"
-             "stream-offset=0:0,request-context=%u,max-duration=0\r\n"
-             CLIENTGUID
-             "Connection: Close\r\n\r\n",
-             host, port, mmsh->request_seq++);
-    av_opt_set(mms->mms_hd->priv_data, "headers", headers, 0);
-
-    err = ffurl_connect(mms->mms_hd, NULL);
-    if (err) {
-        goto fail;
-    }
-    err = get_http_header_data(mmsh);
-    if (err) {
-        av_log(NULL, AV_LOG_ERROR, "Get http header data failed!\n");
-        goto fail;
-    }
-
-    // close the socket and then reopen it for sending the second play request.
-    ffurl_close(mms->mms_hd);
-    memset(headers, 0, sizeof(headers));
-    if ((err = ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ,
-                           &h->interrupt_callback)) < 0) {
-        goto fail;
-    }
-    stream_selection = av_mallocz(mms->stream_num * 19 + 1);
-    if (!stream_selection)
-        return AVERROR(ENOMEM);
-    for (i = 0; i < mms->stream_num; i++) {
-        char tmp[20];
-        err = snprintf(tmp, sizeof(tmp), "ffff:%d:0 ", mms->streams[i].id);
-        if (err < 0)
-            goto fail;
-        av_strlcat(stream_selection, tmp, mms->stream_num * 19 + 1);
-    }
-    // send play request
-    err = snprintf(headers, sizeof(headers),
-                   "Accept: */*\r\n"
-                   USERAGENT
-                   "Host: %s:%d\r\n"
-                   "Pragma: no-cache,rate=1.000000,request-context=%u\r\n"
-                   "Pragma: xPlayStrm=1\r\n"
-                   CLIENTGUID
-                   "Pragma: stream-switch-count=%d\r\n"
-                   "Pragma: stream-switch-entry=%s\r\n"
-                   "Connection: Close\r\n\r\n",
-                   host, port, mmsh->request_seq++, mms->stream_num, stream_selection);
-    av_freep(&stream_selection);
-    if (err < 0) {
-        av_log(NULL, AV_LOG_ERROR, "Build play request failed!\n");
-        goto fail;
-    }
-    av_dlog(NULL, "out_buffer is %s", headers);
-    av_opt_set(mms->mms_hd->priv_data, "headers", headers, 0);
-
-    err = ffurl_connect(mms->mms_hd, NULL);
-    if (err) {
-          goto fail;
-    }
-
-    err = get_http_header_data(mmsh);
-    if (err) {
-        av_log(NULL, AV_LOG_ERROR, "Get http header data failed!\n");
-        goto fail;
-    }
-
-    av_dlog(NULL, "Connection successfully open\n");
-    return 0;
-fail:
-    av_freep(&stream_selection);
-    mmsh_close(h);
-    av_dlog(NULL, "Connection failed with error %d\n", err);
-    return err;
-}
-
-static int handle_chunk_type(MMSHContext *mmsh)
-{
-    MMSContext *mms = &mmsh->mms;
-    int res, len = 0;
-    ChunkType chunk_type;
-    chunk_type = get_chunk_header(mmsh, &len);
-
-    switch (chunk_type) {
-    case CHUNK_TYPE_END:
-        mmsh->chunk_seq = 0;
-        av_log(NULL, AV_LOG_ERROR, "Stream ended!\n");
-        return AVERROR(EIO);
-    case CHUNK_TYPE_STREAM_CHANGE:
-        mms->header_parsed = 0;
-        if (res = get_http_header_data(mmsh)) {
-            av_log(NULL, AV_LOG_ERROR,"Stream changed! Failed to get new header!\n");
-            return res;
-        }
-        break;
-    case CHUNK_TYPE_DATA:
-        return read_data_packet(mmsh, len);
-    default:
-        av_log(NULL, AV_LOG_ERROR, "Recv other type packet %d\n", chunk_type);
-        return AVERROR_INVALIDDATA;
-    }
-    return 0;
-}
-
-static int mmsh_read(URLContext *h, uint8_t *buf, int size)
-{
-    int res = 0;
-    MMSHContext *mmsh = h->priv_data;
-    MMSContext *mms   = &mmsh->mms;
-    do {
-        if (mms->asf_header_read_size < mms->asf_header_size) {
-            // copy asf header into buffer
-            res = ff_mms_read_header(mms, buf, size);
-        } else {
-            if (!mms->remaining_in_len && (res = handle_chunk_type(mmsh)))
-                return res;
-            res = ff_mms_read_data(mms, buf, size);
-        }
-    } while (!res);
-    return res;
-}
-
-URLProtocol ff_mmsh_protocol = {
-    .name           = "mmsh",
-    .url_open       = mmsh_open,
-    .url_read       = mmsh_read,
-    .url_close      = mmsh_close,
-    .priv_data_size = sizeof(MMSHContext),
-    .flags          = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/mmst.c b/deps/libav/libavformat/mmst.c
deleted file mode 100644
index 4f896e0..0000000
--- a/deps/libav/libavformat/mmst.c
+++ /dev/null
@@ -1,629 +0,0 @@
-/*
- * MMS protocol over TCP
- * Copyright (c) 2006,2007 Ryan Martell
- * Copyright (c) 2007 Björn Axelsson
- * Copyright (c) 2010 Zhentan Feng <spyfeng at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* References
- * MMS protocol specification:
- *  [1]http://msdn.microsoft.com/en-us/library/cc234711(PROT.10).aspx
- * ASF specification. Revision 01.20.03.
- *  [2]http://msdn.microsoft.com/en-us/library/bb643323.aspx
- */
-
-#include "avformat.h"
-#include "mms.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/bytestream.h"
-#include "network.h"
-#include "url.h"
-
-#define LOCAL_ADDRESS 0xc0a80081    // FIXME get and use correct local ip address.
-#define LOCAL_PORT    1037          // as above.
-/** Client to server packet types. */
-typedef enum {
-    CS_PKT_INITIAL                  = 0x01,
-    CS_PKT_PROTOCOL_SELECT          = 0x02,
-    CS_PKT_MEDIA_FILE_REQUEST       = 0x05,
-    CS_PKT_START_FROM_PKT_ID        = 0x07,
-    CS_PKT_STREAM_PAUSE             = 0x09,
-    CS_PKT_STREAM_CLOSE             = 0x0d,
-    CS_PKT_MEDIA_HEADER_REQUEST     = 0x15,
-    CS_PKT_TIMING_DATA_REQUEST      = 0x18,
-    CS_PKT_USER_PASSWORD            = 0x1a,
-    CS_PKT_KEEPALIVE                = 0x1b,
-    CS_PKT_STREAM_ID_REQUEST        = 0x33,
-} MMSCSPacketType;
-
-/** Server to client packet types. */
-typedef enum {
-    /** Control packets. */
-    /*@{*/
-    SC_PKT_CLIENT_ACCEPTED          = 0x01,
-    SC_PKT_PROTOCOL_ACCEPTED        = 0x02,
-    SC_PKT_PROTOCOL_FAILED          = 0x03,
-    SC_PKT_MEDIA_PKT_FOLLOWS        = 0x05,
-    SC_PKT_MEDIA_FILE_DETAILS       = 0x06,
-    SC_PKT_HEADER_REQUEST_ACCEPTED  = 0x11,
-    SC_PKT_TIMING_TEST_REPLY        = 0x15,
-    SC_PKT_PASSWORD_REQUIRED        = 0x1a,
-    SC_PKT_KEEPALIVE                = 0x1b,
-    SC_PKT_STREAM_STOPPED           = 0x1e,
-    SC_PKT_STREAM_CHANGING          = 0x20,
-    SC_PKT_STREAM_ID_ACCEPTED       = 0x21,
-    /*@}*/
-
-    /** Pseudo packets. */
-    /*@{*/
-    SC_PKT_CANCEL                   = -1,
-    SC_PKT_NO_DATA                  = -2,
-    /*@}*/
-
-    /** Data packets. */
-    /*@{*/
-    SC_PKT_ASF_HEADER               = 0x010000,// make it bigger than 0xFF in case of
-    SC_PKT_ASF_MEDIA                = 0x010001,// receiving false data packets.
-    /*@}*/
-} MMSSCPacketType;
-
-typedef struct {
-    MMSContext  mms;
-    int outgoing_packet_seq;             ///< Outgoing packet sequence number.
-    char path[256];                      ///< Path of the resource being asked for.
-    char host[128];                      ///< Host of the resources.
-    int incoming_packet_seq;             ///< Incoming packet sequence number.
-    int incoming_flags;                  ///< Incoming packet flags.
-    int packet_id;                       ///< Identifier for packets in the current stream.
-    unsigned int header_packet_id;       ///< default is 2.
-} MMSTContext;
-
-/** Create MMST command packet header */
-static void start_command_packet(MMSTContext *mmst, MMSCSPacketType packet_type)
-{
-    MMSContext *mms    = &mmst->mms;
-    mms->write_out_ptr = mms->out_buffer;
-
-    bytestream_put_le32(&mms->write_out_ptr, 1); // start sequence
-    bytestream_put_le32(&mms->write_out_ptr, 0xb00bface);
-    bytestream_put_le32(&mms->write_out_ptr, 0); // Length starts from after the protocol type bytes
-    bytestream_put_le32(&mms->write_out_ptr, MKTAG('M','M','S',' '));
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-    bytestream_put_le32(&mms->write_out_ptr, mmst->outgoing_packet_seq++);
-    bytestream_put_le64(&mms->write_out_ptr, 0); // timestamp
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-    bytestream_put_le16(&mms->write_out_ptr, packet_type);
-    bytestream_put_le16(&mms->write_out_ptr, 3); // direction to server
-}
-
-/** Add prefixes to MMST command packet. */
-static void insert_command_prefixes(MMSContext *mms,
-        uint32_t prefix1, uint32_t prefix2)
-{
-    bytestream_put_le32(&mms->write_out_ptr, prefix1); // first prefix
-    bytestream_put_le32(&mms->write_out_ptr, prefix2); // second prefix
-}
-
-/** Send a prepared MMST command packet. */
-static int send_command_packet(MMSTContext *mmst)
-{
-    MMSContext *mms  = &mmst->mms;
-    int len= mms->write_out_ptr - mms->out_buffer;
-    int exact_length = FFALIGN(len, 8);
-    int first_length= exact_length - 16;
-    int len8= first_length/8;
-    int write_result;
-
-    // update packet length fields.
-    AV_WL32(mms->out_buffer + 8, first_length);
-    AV_WL32(mms->out_buffer + 16, len8);
-    AV_WL32(mms->out_buffer + 32, len8-2);
-    memset(mms->write_out_ptr, 0, exact_length - len);
-
-    // write it out.
-    write_result= ffurl_write(mms->mms_hd, mms->out_buffer, exact_length);
-    if(write_result != exact_length) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Failed to write data of length %d: %d (%s)\n",
-               exact_length, write_result,
-               write_result < 0 ? strerror(AVUNERROR(write_result)) :
-                   "The server closed the connection");
-        return AVERROR(EIO);
-    }
-
-    return 0;
-}
-
-static void mms_put_utf16(MMSContext *mms, uint8_t *src)
-{
-    AVIOContext bic;
-    int size = mms->write_out_ptr - mms->out_buffer;
-    int len;
-    ffio_init_context(&bic, mms->write_out_ptr,
-            sizeof(mms->out_buffer) - size, 1, NULL, NULL, NULL, NULL);
-
-    len = avio_put_str16le(&bic, src);
-    mms->write_out_ptr += len;
-}
-
-static int send_time_test_data(MMSTContext *mmst)
-{
-    start_command_packet(mmst, CS_PKT_TIMING_DATA_REQUEST);
-    insert_command_prefixes(&mmst->mms, 0x00f0f0f0, 0x0004000b);
-    return send_command_packet(mmst);
-}
-
-static int send_protocol_select(MMSTContext *mmst)
-{
-    char data_string[256];
-    MMSContext *mms = &mmst->mms;
-
-    start_command_packet(mmst, CS_PKT_PROTOCOL_SELECT);
-    insert_command_prefixes(mms, 0, 0xffffffff);
-    bytestream_put_le32(&mms->write_out_ptr, 0);          // maxFunnelBytes
-    bytestream_put_le32(&mms->write_out_ptr, 0x00989680); // maxbitRate
-    bytestream_put_le32(&mms->write_out_ptr, 2);          // funnelMode
-    snprintf(data_string, sizeof(data_string), "\\\\%d.%d.%d.%d\\%s\\%d",
-            (LOCAL_ADDRESS>>24)&0xff,
-            (LOCAL_ADDRESS>>16)&0xff,
-            (LOCAL_ADDRESS>>8)&0xff,
-            LOCAL_ADDRESS&0xff,
-            "TCP",                                        // or UDP
-            LOCAL_PORT);
-
-    mms_put_utf16(mms, data_string);
-    return send_command_packet(mmst);
-}
-
-static int send_media_file_request(MMSTContext *mmst)
-{
-    MMSContext *mms = &mmst->mms;
-    start_command_packet(mmst, CS_PKT_MEDIA_FILE_REQUEST);
-    insert_command_prefixes(mms, 1, 0xffffffff);
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-    mms_put_utf16(mms, mmst->path + 1); // +1 for skip "/"
-
-    return send_command_packet(mmst);
-}
-
-static void handle_packet_stream_changing_type(MMSTContext *mmst)
-{
-    MMSContext *mms = &mmst->mms;
-    av_dlog(NULL, "Stream changing!\n");
-
-    // 40 is the packet header size, 7 is the prefix size.
-    mmst->header_packet_id= AV_RL32(mms->in_buffer + 40 + 7);
-    av_dlog(NULL, "Changed header prefix to 0x%x", mmst->header_packet_id);
-}
-
-static int send_keepalive_packet(MMSTContext *mmst)
-{
-    // respond to a keepalive with a keepalive...
-    start_command_packet(mmst, CS_PKT_KEEPALIVE);
-    insert_command_prefixes(&mmst->mms, 1, 0x100FFFF);
-    return send_command_packet(mmst);
-}
-
-/** Pad media packets smaller than max_packet_size and/or adjust read position
-  * after a seek. */
-static void pad_media_packet(MMSContext *mms)
-{
-    if(mms->remaining_in_len<mms->asf_packet_len) {
-        int padding_size = mms->asf_packet_len - mms->remaining_in_len;
-        memset(mms->in_buffer + mms->remaining_in_len, 0, padding_size);
-        mms->remaining_in_len += padding_size;
-    }
-}
-
-/** Read incoming MMST media, header or command packet. */
-static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
-{
-    int read_result;
-    MMSSCPacketType packet_type= -1;
-    MMSContext *mms = &mmst->mms;
-    for(;;) {
-        read_result = ffurl_read_complete(mms->mms_hd, mms->in_buffer, 8);
-        if (read_result != 8) {
-            if(read_result < 0) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Error reading packet header: %d (%s)\n",
-                       read_result, strerror(AVUNERROR(read_result)));
-                packet_type = SC_PKT_CANCEL;
-            } else {
-                av_log(NULL, AV_LOG_ERROR,
-                       "The server closed the connection\n");
-                packet_type = SC_PKT_NO_DATA;
-            }
-            return packet_type;
-        }
-
-        // handle command packet.
-        if(AV_RL32(mms->in_buffer + 4)==0xb00bface) {
-            int length_remaining, hr;
-
-            mmst->incoming_flags= mms->in_buffer[3];
-            read_result= ffurl_read_complete(mms->mms_hd, mms->in_buffer+8, 4);
-            if(read_result != 4) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Reading command packet length failed: %d (%s)\n",
-                       read_result,
-                       read_result < 0 ? strerror(AVUNERROR(read_result)) :
-                           "The server closed the connection");
-                return read_result < 0 ? read_result : AVERROR(EIO);
-            }
-
-            length_remaining= AV_RL32(mms->in_buffer+8) + 4;
-            av_dlog(NULL, "Length remaining is %d\n", length_remaining);
-            // read the rest of the packet.
-            if (length_remaining < 0
-                || length_remaining > sizeof(mms->in_buffer) - 12) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Incoming packet length %d exceeds bufsize %zu\n",
-                       length_remaining, sizeof(mms->in_buffer) - 12);
-                return AVERROR_INVALIDDATA;
-            }
-            read_result = ffurl_read_complete(mms->mms_hd, mms->in_buffer + 12,
-                                            length_remaining) ;
-            if (read_result != length_remaining) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Reading pkt data (length=%d) failed: %d (%s)\n",
-                       length_remaining, read_result,
-                       read_result < 0 ? strerror(AVUNERROR(read_result)) :
-                           "The server closed the connection");
-                return read_result < 0 ? read_result : AVERROR(EIO);
-            }
-            packet_type= AV_RL16(mms->in_buffer+36);
-            if (read_result >= 44 && (hr = AV_RL32(mms->in_buffer + 40))) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Server sent a message with packet type 0x%x and error status code 0x%08x\n", packet_type, hr);
-                return AVERROR(EINVAL);
-            }
-        } else {
-            int length_remaining;
-            int packet_id_type;
-            int tmp;
-
-            // note we cache the first 8 bytes,
-            // then fill up the buffer with the others
-            tmp                       = AV_RL16(mms->in_buffer + 6);
-            length_remaining          = (tmp - 8) & 0xffff;
-            mmst->incoming_packet_seq = AV_RL32(mms->in_buffer);
-            packet_id_type            = mms->in_buffer[4];
-            mmst->incoming_flags      = mms->in_buffer[5];
-
-            if (length_remaining < 0
-                || length_remaining > sizeof(mms->in_buffer) - 8) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Data length %d is invalid or too large (max=%zu)\n",
-                       length_remaining, sizeof(mms->in_buffer));
-                return AVERROR_INVALIDDATA;
-            }
-            mms->remaining_in_len    = length_remaining;
-            mms->read_in_ptr         = mms->in_buffer;
-            read_result= ffurl_read_complete(mms->mms_hd, mms->in_buffer, length_remaining);
-            if(read_result != length_remaining) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Failed to read packet data of size %d: %d (%s)\n",
-                       length_remaining, read_result,
-                       read_result < 0 ? strerror(AVUNERROR(read_result)) :
-                           "The server closed the connection");
-                return read_result < 0 ? read_result : AVERROR(EIO);
-            }
-
-            // if we successfully read everything.
-            if(packet_id_type == mmst->header_packet_id) {
-                int err;
-                packet_type = SC_PKT_ASF_HEADER;
-                // Store the asf header
-                if(!mms->header_parsed) {
-                    if ((err = av_reallocp(&mms->asf_header,
-                                           mms->asf_header_size +
-                                           mms->remaining_in_len)) < 0) {
-                        mms->asf_header_size = 0;
-                        return err;
-                    }
-                    memcpy(mms->asf_header + mms->asf_header_size,
-                           mms->read_in_ptr, mms->remaining_in_len);
-                    mms->asf_header_size += mms->remaining_in_len;
-                }
-                // 0x04 means asf header is sent in multiple packets.
-                if (mmst->incoming_flags == 0x04)
-                    continue;
-            } else if(packet_id_type == mmst->packet_id) {
-                packet_type = SC_PKT_ASF_MEDIA;
-            } else {
-                av_dlog(NULL, "packet id type %d is old.", packet_id_type);
-                continue;
-            }
-        }
-
-        // preprocess some packet type
-        if(packet_type == SC_PKT_KEEPALIVE) {
-            send_keepalive_packet(mmst);
-            continue;
-        } else if(packet_type == SC_PKT_STREAM_CHANGING) {
-            handle_packet_stream_changing_type(mmst);
-        } else if(packet_type == SC_PKT_ASF_MEDIA) {
-            pad_media_packet(mms);
-        }
-        return packet_type;
-    }
-}
-
-static int mms_safe_send_recv(MMSTContext *mmst,
-                              int (*send_fun)(MMSTContext *mmst),
-                              const MMSSCPacketType expect_type)
-{
-    MMSSCPacketType type;
-    if(send_fun) {
-        int ret = send_fun(mmst);
-        if (ret < 0) {
-            av_dlog(NULL, "Send Packet error before expecting recv packet %d\n", expect_type);
-            return ret;
-        }
-    }
-
-    if ((type = get_tcp_server_response(mmst)) != expect_type) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Corrupt stream (unexpected packet type 0x%x, expected 0x%x)\n",
-               type, expect_type);
-        return AVERROR_INVALIDDATA;
-    } else {
-        return 0;
-    }
-}
-
-static int send_media_header_request(MMSTContext *mmst)
-{
-    MMSContext *mms = &mmst->mms;
-    start_command_packet(mmst, CS_PKT_MEDIA_HEADER_REQUEST);
-    insert_command_prefixes(mms, 1, 0);
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-    bytestream_put_le32(&mms->write_out_ptr, 0x00800000);
-    bytestream_put_le32(&mms->write_out_ptr, 0xffffffff);
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-
-    // the media preroll value in milliseconds?
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-    bytestream_put_le32(&mms->write_out_ptr, 0x40AC2000);
-    bytestream_put_le32(&mms->write_out_ptr, 2);
-    bytestream_put_le32(&mms->write_out_ptr, 0);
-
-    return send_command_packet(mmst);
-}
-
-/** Send the initial handshake. */
-static int send_startup_packet(MMSTContext *mmst)
-{
-    char data_string[256];
-    MMSContext *mms = &mmst->mms;
-    // SubscriberName is defined in MS specification linked below.
-    // The guid value can be any valid value.
-    // http://download.microsoft.com/
-    // download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-WMSP%5D.pdf
-    snprintf(data_string, sizeof(data_string),
-            "NSPlayer/7.0.0.1956; {%s}; Host: %s",
-            "7E667F5D-A661-495E-A512-F55686DDA178", mmst->host);
-
-    start_command_packet(mmst, CS_PKT_INITIAL);
-    insert_command_prefixes(mms, 0, 0x0004000b);
-    bytestream_put_le32(&mms->write_out_ptr, 0x0003001c);
-    mms_put_utf16(mms, data_string);
-    return send_command_packet(mmst);
-}
-
-/** Send MMST stream selection command based on the AVStream->discard values. */
-static int send_stream_selection_request(MMSTContext *mmst)
-{
-    int i;
-    MMSContext *mms = &mmst->mms;
-    //  send the streams we want back...
-    start_command_packet(mmst, CS_PKT_STREAM_ID_REQUEST);
-    bytestream_put_le32(&mms->write_out_ptr, mms->stream_num);         // stream nums
-    for(i= 0; i<mms->stream_num; i++) {
-        bytestream_put_le16(&mms->write_out_ptr, 0xffff);              // flags
-        bytestream_put_le16(&mms->write_out_ptr, mms->streams[i].id);  // stream id
-        bytestream_put_le16(&mms->write_out_ptr, 0);                   // selection
-    }
-    return send_command_packet(mmst);
-}
-
-static int send_close_packet(MMSTContext *mmst)
-{
-    start_command_packet(mmst, CS_PKT_STREAM_CLOSE);
-    insert_command_prefixes(&mmst->mms, 1, 1);
-
-    return send_command_packet(mmst);
-}
-
-/** Close the MMSH/MMST connection */
-static int mms_close(URLContext *h)
-{
-    MMSTContext *mmst = (MMSTContext *)h->priv_data;
-    MMSContext *mms   = &mmst->mms;
-    if(mms->mms_hd) {
-        send_close_packet(mmst);
-        ffurl_close(mms->mms_hd);
-    }
-
-    /* free all separately allocated pointers in mms */
-    av_free(mms->streams);
-    av_free(mms->asf_header);
-
-    return 0;
-}
-
-static int send_media_packet_request(MMSTContext *mmst)
-{
-    MMSContext *mms = &mmst->mms;
-    start_command_packet(mmst, CS_PKT_START_FROM_PKT_ID);
-    insert_command_prefixes(mms, 1, 0x0001FFFF);
-    bytestream_put_le64(&mms->write_out_ptr, 0);          // seek timestamp
-    bytestream_put_le32(&mms->write_out_ptr, 0xffffffff); // unknown
-    bytestream_put_le32(&mms->write_out_ptr, 0xffffffff); // packet offset
-    bytestream_put_byte(&mms->write_out_ptr, 0xff);       // max stream time limit
-    bytestream_put_byte(&mms->write_out_ptr, 0xff);       // max stream time limit
-    bytestream_put_byte(&mms->write_out_ptr, 0xff);       // max stream time limit
-    bytestream_put_byte(&mms->write_out_ptr, 0x00);       // stream time limit flag
-
-    mmst->packet_id++;                                     // new packet_id
-    bytestream_put_le32(&mms->write_out_ptr, mmst->packet_id);
-    return send_command_packet(mmst);
-}
-
-
-static void clear_stream_buffers(MMSContext *mms)
-{
-    mms->remaining_in_len = 0;
-    mms->read_in_ptr      = mms->in_buffer;
-}
-
-static int mms_open(URLContext *h, const char *uri, int flags)
-{
-    MMSTContext *mmst = h->priv_data;
-    MMSContext *mms;
-    int port, err;
-    char tcpname[256];
-
-    h->is_streamed = 1;
-    mms = &mmst->mms;
-
-    // only for MMS over TCP, so set proto = NULL
-    av_url_split(NULL, 0, NULL, 0,
-            mmst->host, sizeof(mmst->host), &port, mmst->path,
-            sizeof(mmst->path), uri);
-
-    if(port<0)
-        port = 1755; // defaut mms protocol port
-
-    // establish tcp connection.
-    ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, mmst->host, port, NULL);
-    err = ffurl_open(&mms->mms_hd, tcpname, AVIO_FLAG_READ_WRITE,
-                     &h->interrupt_callback, NULL);
-    if (err)
-        goto fail;
-
-    mmst->packet_id        = 3;          // default, initial value.
-    mmst->header_packet_id = 2;          // default, initial value.
-    err = mms_safe_send_recv(mmst, send_startup_packet, SC_PKT_CLIENT_ACCEPTED);
-    if (err)
-        goto fail;
-    err = mms_safe_send_recv(mmst, send_time_test_data, SC_PKT_TIMING_TEST_REPLY);
-    if (err)
-        goto fail;
-    err = mms_safe_send_recv(mmst, send_protocol_select, SC_PKT_PROTOCOL_ACCEPTED);
-    if (err)
-        goto fail;
-    err = mms_safe_send_recv(mmst, send_media_file_request, SC_PKT_MEDIA_FILE_DETAILS);
-    if (err)
-        goto fail;
-    err = mms_safe_send_recv(mmst, send_media_header_request, SC_PKT_HEADER_REQUEST_ACCEPTED);
-    if (err)
-        goto fail;
-    err = mms_safe_send_recv(mmst, NULL, SC_PKT_ASF_HEADER);
-    if (err)
-        goto fail;
-    if((mmst->incoming_flags != 0X08) && (mmst->incoming_flags != 0X0C)) {
-        av_log(NULL, AV_LOG_ERROR,
-               "The server does not support MMST (try MMSH or RTSP)\n");
-        err = AVERROR(EINVAL);
-        goto fail;
-    }
-    err = ff_mms_asf_header_parser(mms);
-    if (err) {
-        av_dlog(NULL, "asf header parsed failed!\n");
-        goto fail;
-    }
-    mms->header_parsed = 1;
-
-    if (!mms->asf_packet_len || !mms->stream_num)
-        goto fail;
-
-    clear_stream_buffers(mms);
-    err = mms_safe_send_recv(mmst, send_stream_selection_request, SC_PKT_STREAM_ID_ACCEPTED);
-    if (err)
-        goto fail;
-    // send media packet request
-    err = mms_safe_send_recv(mmst, send_media_packet_request, SC_PKT_MEDIA_PKT_FOLLOWS);
-    if (err) {
-        goto fail;
-    }
-    av_dlog(NULL, "Leaving open (success)\n");
-    return 0;
-fail:
-    mms_close(h);
-    av_dlog(NULL, "Leaving open (failure: %d)\n", err);
-    return err;
-}
-
-/** Read ASF data through the protocol. */
-static int mms_read(URLContext *h, uint8_t *buf, int size)
-{
-    /* TODO: see tcp.c:tcp_read() about a possible timeout scheme */
-    MMSTContext *mmst = h->priv_data;
-    MMSContext *mms   = &mmst->mms;
-    int result = 0;
-
-    do {
-        if(mms->asf_header_read_size < mms->asf_header_size) {
-            /* Read from ASF header buffer */
-            result = ff_mms_read_header(mms, buf, size);
-        } else if(mms->remaining_in_len) {
-            /* Read remaining packet data to buffer.
-             * the result can not be zero because remaining_in_len is positive.*/
-            result = ff_mms_read_data(mms, buf, size);
-        } else {
-            /* Read from network */
-            int err = mms_safe_send_recv(mmst, NULL, SC_PKT_ASF_MEDIA);
-            if (err == 0) {
-                if(mms->remaining_in_len>mms->asf_packet_len) {
-                    av_log(NULL, AV_LOG_ERROR,
-                           "Incoming pktlen %d is larger than ASF pktsize %d\n",
-                           mms->remaining_in_len, mms->asf_packet_len);
-                    result= AVERROR(EIO);
-                } else {
-                    // copy the data to the packet buffer.
-                    result = ff_mms_read_data(mms, buf, size);
-                    if (result == 0) {
-                        av_dlog(NULL, "Read ASF media packet size is zero!\n");
-                        break;
-                    }
-                }
-            } else {
-                av_dlog(NULL, "read packet error!\n");
-                break;
-            }
-        }
-    } while(!result); // only return one packet.
-    return result;
-}
-
-URLProtocol ff_mmst_protocol = {
-    .name           = "mmst",
-    .url_open       = mms_open,
-    .url_read       = mms_read,
-    .url_close      = mms_close,
-    .priv_data_size = sizeof(MMSTContext),
-    .flags          = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/mov.c b/deps/libav/libavformat/mov.c
deleted file mode 100644
index 6f72ce8..0000000
--- a/deps/libav/libavformat/mov.c
+++ /dev/null
@@ -1,3077 +0,0 @@
-/*
- * MOV demuxer
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
- *
- * first version by Francois Revol <revol at free.fr>
- * seek function by Gael Chardon <gael.dev at 4now.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <limits.h>
-#include <stdint.h>
-
-//#define MOV_EXPORT_ALL_METADATA
-
-#include "libavutil/attributes.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/avstring.h"
-#include "libavutil/dict.h"
-#include "libavcodec/ac3tab.h"
-#include "avformat.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "riff.h"
-#include "isom.h"
-#include "libavcodec/get_bits.h"
-#include "id3v1.h"
-#include "mov_chan.h"
-
-#if CONFIG_ZLIB
-#include <zlib.h>
-#endif
-
-#include "qtpalette.h"
-
-
-#undef NDEBUG
-#include <assert.h>
-
-/* those functions parse an atom */
-/* links atom IDs to parse functions */
-typedef struct MOVParseTableEntry {
-    uint32_t type;
-    int (*parse)(MOVContext *ctx, AVIOContext *pb, MOVAtom atom);
-} MOVParseTableEntry;
-
-static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom);
-
-static int mov_metadata_track_or_disc_number(MOVContext *c, AVIOContext *pb,
-                                             unsigned len, const char *key)
-{
-    char buf[16];
-
-    short current, total = 0;
-    avio_rb16(pb); // unknown
-    current = avio_rb16(pb);
-    if (len >= 6)
-        total = avio_rb16(pb);
-    if (!total)
-        snprintf(buf, sizeof(buf), "%d", current);
-    else
-        snprintf(buf, sizeof(buf), "%d/%d", current, total);
-    av_dict_set(&c->fc->metadata, key, buf, 0);
-
-    return 0;
-}
-
-static int mov_metadata_int8_bypass_padding(MOVContext *c, AVIOContext *pb,
-                                            unsigned len, const char *key)
-{
-    char buf[16];
-
-    /* bypass padding bytes */
-    avio_r8(pb);
-    avio_r8(pb);
-    avio_r8(pb);
-
-    snprintf(buf, sizeof(buf), "%d", avio_r8(pb));
-    av_dict_set(&c->fc->metadata, key, buf, 0);
-
-    return 0;
-}
-
-static int mov_metadata_int8_no_padding(MOVContext *c, AVIOContext *pb,
-                                        unsigned len, const char *key)
-{
-    char buf[16];
-
-    snprintf(buf, sizeof(buf), "%d", avio_r8(pb));
-    av_dict_set(&c->fc->metadata, key, buf, 0);
-
-    return 0;
-}
-
-static int mov_metadata_gnre(MOVContext *c, AVIOContext *pb,
-                             unsigned len, const char *key)
-{
-    short genre;
-    char buf[20];
-
-    avio_r8(pb); // unknown
-
-    genre = avio_r8(pb);
-    if (genre < 1 || genre > ID3v1_GENRE_MAX)
-        return 0;
-    snprintf(buf, sizeof(buf), "%s", ff_id3v1_genre_str[genre-1]);
-    av_dict_set(&c->fc->metadata, key, buf, 0);
-
-    return 0;
-}
-
-static const uint32_t mac_to_unicode[128] = {
-    0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
-    0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
-    0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3,
-    0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC,
-    0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF,
-    0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8,
-    0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211,
-    0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8,
-    0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB,
-    0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153,
-    0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA,
-    0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02,
-    0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1,
-    0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4,
-    0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC,
-    0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7,
-};
-
-static int mov_read_mac_string(MOVContext *c, AVIOContext *pb, int len,
-                               char *dst, int dstlen)
-{
-    char *p = dst;
-    char *end = dst+dstlen-1;
-    int i;
-
-    for (i = 0; i < len; i++) {
-        uint8_t t, c = avio_r8(pb);
-        if (c < 0x80 && p < end)
-            *p++ = c;
-        else
-            PUT_UTF8(mac_to_unicode[c-0x80], t, if (p < end) *p++ = t;);
-    }
-    *p = 0;
-    return p - dst;
-}
-
-static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
-{
-    AVPacket pkt;
-    AVStream *st;
-    MOVStreamContext *sc;
-    enum AVCodecID id;
-    int ret;
-
-    switch (type) {
-    case 0xd:  id = AV_CODEC_ID_MJPEG; break;
-    case 0xe:  id = AV_CODEC_ID_PNG;   break;
-    case 0x1b: id = AV_CODEC_ID_BMP;   break;
-    default:
-        av_log(c->fc, AV_LOG_WARNING, "Unknown cover type: 0x%x.\n", type);
-        avio_skip(pb, len);
-        return 0;
-    }
-
-    st = avformat_new_stream(c->fc, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    sc = av_mallocz(sizeof(*sc));
-    if (!sc)
-        return AVERROR(ENOMEM);
-    st->priv_data = sc;
-
-    ret = av_get_packet(pb, &pkt, len);
-    if (ret < 0)
-        return ret;
-
-    st->disposition              |= AV_DISPOSITION_ATTACHED_PIC;
-
-    st->attached_pic              = pkt;
-    st->attached_pic.stream_index = st->index;
-    st->attached_pic.flags       |= AV_PKT_FLAG_KEY;
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = id;
-
-    return 0;
-}
-
-static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-#ifdef MOV_EXPORT_ALL_METADATA
-    char tmp_key[5];
-#endif
-    char str[1024], key2[16], language[4] = {0};
-    const char *key = NULL;
-    uint16_t langcode = 0;
-    uint32_t data_type = 0, str_size;
-    int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL;
-
-    switch (atom.type) {
-    case MKTAG(0xa9,'n','a','m'): key = "title";     break;
-    case MKTAG(0xa9,'a','u','t'):
-    case MKTAG(0xa9,'A','R','T'): key = "artist";    break;
-    case MKTAG( 'a','A','R','T'): key = "album_artist";    break;
-    case MKTAG(0xa9,'w','r','t'): key = "composer";  break;
-    case MKTAG( 'c','p','r','t'):
-    case MKTAG(0xa9,'c','p','y'): key = "copyright"; break;
-    case MKTAG(0xa9,'c','m','t'):
-    case MKTAG(0xa9,'i','n','f'): key = "comment";   break;
-    case MKTAG(0xa9,'a','l','b'): key = "album";     break;
-    case MKTAG(0xa9,'d','a','y'): key = "date";      break;
-    case MKTAG(0xa9,'g','e','n'): key = "genre";     break;
-    case MKTAG( 'g','n','r','e'): key = "genre";
-        parse = mov_metadata_gnre; break;
-    case MKTAG(0xa9,'t','o','o'):
-    case MKTAG(0xa9,'s','w','r'): key = "encoder";   break;
-    case MKTAG(0xa9,'e','n','c'): key = "encoder";   break;
-    case MKTAG( 'd','e','s','c'): key = "description";break;
-    case MKTAG( 'l','d','e','s'): key = "synopsis";  break;
-    case MKTAG( 't','v','s','h'): key = "show";      break;
-    case MKTAG( 't','v','e','n'): key = "episode_id";break;
-    case MKTAG( 't','v','n','n'): key = "network";   break;
-    case MKTAG( 't','r','k','n'): key = "track";
-        parse = mov_metadata_track_or_disc_number; break;
-    case MKTAG( 'd','i','s','k'): key = "disc";
-        parse = mov_metadata_track_or_disc_number; break;
-    case MKTAG( 't','v','e','s'): key = "episode_sort";
-        parse = mov_metadata_int8_bypass_padding; break;
-    case MKTAG( 't','v','s','n'): key = "season_number";
-        parse = mov_metadata_int8_bypass_padding; break;
-    case MKTAG( 's','t','i','k'): key = "media_type";
-        parse = mov_metadata_int8_no_padding; break;
-    case MKTAG( 'h','d','v','d'): key = "hd_video";
-        parse = mov_metadata_int8_no_padding; break;
-    case MKTAG( 'p','g','a','p'): key = "gapless_playback";
-        parse = mov_metadata_int8_no_padding; break;
-    }
-
-    if (c->itunes_metadata && atom.size > 8) {
-        int data_size = avio_rb32(pb);
-        int tag = avio_rl32(pb);
-        if (tag == MKTAG('d','a','t','a')) {
-            data_type = avio_rb32(pb); // type
-            avio_rb32(pb); // unknown
-            str_size = data_size - 16;
-            atom.size -= 16;
-
-            if (atom.type == MKTAG('c', 'o', 'v', 'r')) {
-                int ret = mov_read_covr(c, pb, data_type, str_size);
-                if (ret < 0) {
-                    av_log(c->fc, AV_LOG_ERROR, "Error parsing cover art.\n");
-                    return ret;
-                }
-            }
-        } else return 0;
-    } else if (atom.size > 4 && key && !c->itunes_metadata) {
-        str_size = avio_rb16(pb); // string length
-        langcode = avio_rb16(pb);
-        ff_mov_lang_to_iso639(langcode, language);
-        atom.size -= 4;
-    } else
-        str_size = atom.size;
-
-#ifdef MOV_EXPORT_ALL_METADATA
-    if (!key) {
-        snprintf(tmp_key, 5, "%.4s", (char*)&atom.type);
-        key = tmp_key;
-    }
-#endif
-
-    if (!key)
-        return 0;
-    if (atom.size < 0)
-        return AVERROR_INVALIDDATA;
-
-    str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);
-
-    if (parse)
-        parse(c, pb, str_size, key);
-    else {
-        if (data_type == 3 || (data_type == 0 && (langcode < 0x400 || langcode == 0x7fff))) { // MAC Encoded
-            mov_read_mac_string(c, pb, str_size, str, sizeof(str));
-        } else {
-            avio_read(pb, str, str_size);
-            str[str_size] = 0;
-        }
-        av_dict_set(&c->fc->metadata, key, str, 0);
-        if (*language && strcmp(language, "und")) {
-            snprintf(key2, sizeof(key2), "%s-%s", key, language);
-            av_dict_set(&c->fc->metadata, key2, str, 0);
-        }
-    }
-    av_dlog(c->fc, "lang \"%3s\" ", language);
-    av_dlog(c->fc, "tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64"\n",
-            key, str, (char*)&atom.type, str_size, atom.size);
-
-    return 0;
-}
-
-static int mov_read_chpl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    int64_t start;
-    int i, nb_chapters, str_len, version;
-    char str[256+1];
-
-    if ((atom.size -= 5) < 0)
-        return 0;
-
-    version = avio_r8(pb);
-    avio_rb24(pb);
-    if (version)
-        avio_rb32(pb); // ???
-    nb_chapters = avio_r8(pb);
-
-    for (i = 0; i < nb_chapters; i++) {
-        if (atom.size < 9)
-            return 0;
-
-        start = avio_rb64(pb);
-        str_len = avio_r8(pb);
-
-        if ((atom.size -= 9+str_len) < 0)
-            return 0;
-
-        avio_read(pb, str, str_len);
-        str[str_len] = 0;
-        avpriv_new_chapter(c->fc, i, (AVRational){1,10000000}, start, AV_NOPTS_VALUE, str);
-    }
-    return 0;
-}
-
-#define MIN_DATA_ENTRY_BOX_SIZE 12
-static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    int entries, i, j;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    avio_rb32(pb); // version + flags
-    entries = avio_rb32(pb);
-    if (entries >  (atom.size - 1) / MIN_DATA_ENTRY_BOX_SIZE + 1 ||
-        entries >= UINT_MAX / sizeof(*sc->drefs))
-        return AVERROR_INVALIDDATA;
-    av_free(sc->drefs);
-    sc->drefs = av_mallocz(entries * sizeof(*sc->drefs));
-    if (!sc->drefs)
-        return AVERROR(ENOMEM);
-    sc->drefs_count = entries;
-
-    for (i = 0; i < sc->drefs_count; i++) {
-        MOVDref *dref = &sc->drefs[i];
-        uint32_t size = avio_rb32(pb);
-        int64_t next = avio_tell(pb) + size - 4;
-
-        if (size < 12)
-            return AVERROR_INVALIDDATA;
-
-        dref->type = avio_rl32(pb);
-        avio_rb32(pb); // version + flags
-        av_dlog(c->fc, "type %.4s size %d\n", (char*)&dref->type, size);
-
-        if (dref->type == MKTAG('a','l','i','s') && size > 150) {
-            /* macintosh alias record */
-            uint16_t volume_len, len;
-            int16_t type;
-
-            avio_skip(pb, 10);
-
-            volume_len = avio_r8(pb);
-            volume_len = FFMIN(volume_len, 27);
-            avio_read(pb, dref->volume, 27);
-            dref->volume[volume_len] = 0;
-            av_log(c->fc, AV_LOG_DEBUG, "volume %s, len %d\n", dref->volume, volume_len);
-
-            avio_skip(pb, 12);
-
-            len = avio_r8(pb);
-            len = FFMIN(len, 63);
-            avio_read(pb, dref->filename, 63);
-            dref->filename[len] = 0;
-            av_log(c->fc, AV_LOG_DEBUG, "filename %s, len %d\n", dref->filename, len);
-
-            avio_skip(pb, 16);
-
-            /* read next level up_from_alias/down_to_target */
-            dref->nlvl_from = avio_rb16(pb);
-            dref->nlvl_to   = avio_rb16(pb);
-            av_log(c->fc, AV_LOG_DEBUG, "nlvl from %d, nlvl to %d\n",
-                   dref->nlvl_from, dref->nlvl_to);
-
-            avio_skip(pb, 16);
-
-            for (type = 0; type != -1 && avio_tell(pb) < next; ) {
-                if (pb->eof_reached)
-                    return AVERROR_EOF;
-                type = avio_rb16(pb);
-                len = avio_rb16(pb);
-                av_log(c->fc, AV_LOG_DEBUG, "type %d, len %d\n", type, len);
-                if (len&1)
-                    len += 1;
-                if (type == 2) { // absolute path
-                    av_free(dref->path);
-                    dref->path = av_mallocz(len+1);
-                    if (!dref->path)
-                        return AVERROR(ENOMEM);
-                    avio_read(pb, dref->path, len);
-                    if (len > volume_len && !strncmp(dref->path, dref->volume, volume_len)) {
-                        len -= volume_len;
-                        memmove(dref->path, dref->path+volume_len, len);
-                        dref->path[len] = 0;
-                    }
-                    for (j = 0; j < len; j++)
-                        if (dref->path[j] == ':')
-                            dref->path[j] = '/';
-                    av_log(c->fc, AV_LOG_DEBUG, "path %s\n", dref->path);
-                } else if (type == 0) { // directory name
-                    av_free(dref->dir);
-                    dref->dir = av_malloc(len+1);
-                    if (!dref->dir)
-                        return AVERROR(ENOMEM);
-                    avio_read(pb, dref->dir, len);
-                    dref->dir[len] = 0;
-                    for (j = 0; j < len; j++)
-                        if (dref->dir[j] == ':')
-                            dref->dir[j] = '/';
-                    av_log(c->fc, AV_LOG_DEBUG, "dir %s\n", dref->dir);
-                } else
-                    avio_skip(pb, len);
-            }
-        }
-        avio_seek(pb, next, SEEK_SET);
-    }
-    return 0;
-}
-
-static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    uint32_t type;
-    uint32_t av_unused ctype;
-
-    if (c->fc->nb_streams < 1) // meta before first trak
-        return 0;
-
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-
-    /* component type */
-    ctype = avio_rl32(pb);
-    type = avio_rl32(pb); /* component subtype */
-
-    av_dlog(c->fc, "ctype= %.4s (0x%08x)\n", (char*)&ctype, ctype);
-    av_dlog(c->fc, "stype= %.4s\n", (char*)&type);
-
-    if     (type == MKTAG('v','i','d','e'))
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    else if (type == MKTAG('s','o','u','n'))
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    else if (type == MKTAG('m','1','a',' '))
-        st->codec->codec_id = AV_CODEC_ID_MP2;
-    else if ((type == MKTAG('s','u','b','p')) || (type == MKTAG('c','l','c','p')))
-        st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-
-    avio_rb32(pb); /* component  manufacture */
-    avio_rb32(pb); /* component flags */
-    avio_rb32(pb); /* component flags mask */
-
-    return 0;
-}
-
-int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    int tag;
-
-    if (fc->nb_streams < 1)
-        return 0;
-    st = fc->streams[fc->nb_streams-1];
-
-    avio_rb32(pb); /* version + flags */
-    ff_mp4_read_descr(fc, pb, &tag);
-    if (tag == MP4ESDescrTag) {
-        ff_mp4_parse_es_descr(pb, NULL);
-    } else
-        avio_rb16(pb); /* ID */
-
-    ff_mp4_read_descr(fc, pb, &tag);
-    if (tag == MP4DecConfigDescrTag)
-        ff_mp4_read_dec_config_descr(fc, st, pb);
-    return 0;
-}
-
-static int mov_read_esds(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    return ff_mov_read_esds(c->fc, pb, atom);
-}
-
-static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    int ac3info, acmod, lfeon, bsmod;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    ac3info = avio_rb24(pb);
-    bsmod = (ac3info >> 14) & 0x7;
-    acmod = (ac3info >> 11) & 0x7;
-    lfeon = (ac3info >> 10) & 0x1;
-    st->codec->channels = ((int[]){2,1,2,3,3,4,4,5})[acmod] + lfeon;
-    st->codec->channel_layout = avpriv_ac3_channel_layout_tab[acmod];
-    if (lfeon)
-        st->codec->channel_layout |= AV_CH_LOW_FREQUENCY;
-    st->codec->audio_service_type = bsmod;
-    if (st->codec->channels > 1 && bsmod == 0x7)
-        st->codec->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
-
-    return 0;
-}
-
-static int mov_read_dec3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    int eac3info, acmod, lfeon, bsmod;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    /* No need to parse fields for additional independent substreams and its
-     * associated dependent substreams since libavcodec's E-AC-3 decoder
-     * does not support them yet. */
-    avio_rb16(pb); /* data_rate and num_ind_sub */
-    eac3info = avio_rb24(pb);
-    bsmod = (eac3info >> 12) & 0x1f;
-    acmod = (eac3info >>  9) & 0x7;
-    lfeon = (eac3info >>  8) & 0x1;
-    st->codec->channel_layout = avpriv_ac3_channel_layout_tab[acmod];
-    if (lfeon)
-        st->codec->channel_layout |= AV_CH_LOW_FREQUENCY;
-    st->codec->channels = av_get_channel_layout_nb_channels(st->codec->channel_layout);
-    st->codec->audio_service_type = bsmod;
-    if (st->codec->channels > 1 && bsmod == 0x7)
-        st->codec->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
-
-    return 0;
-}
-
-static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    if (atom.size < 16)
-        return 0;
-
-    ff_mov_read_chan(c->fc, pb, st, atom.size - 4);
-
-    return 0;
-}
-
-static int mov_read_wfex(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    ff_get_wav_header(pb, st->codec, atom.size);
-
-    return 0;
-}
-
-static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    const int num = avio_rb32(pb);
-    const int den = avio_rb32(pb);
-    AVStream *st;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    if ((st->sample_aspect_ratio.den != 1 || st->sample_aspect_ratio.num) && // default
-        (den != st->sample_aspect_ratio.den || num != st->sample_aspect_ratio.num)) {
-        av_log(c->fc, AV_LOG_WARNING,
-               "sample aspect ratio already set to %d:%d, ignoring 'pasp' atom (%d:%d)\n",
-               st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
-               num, den);
-    } else if (den != 0) {
-        st->sample_aspect_ratio.num = num;
-        st->sample_aspect_ratio.den = den;
-    }
-    return 0;
-}
-
-/* this atom contains actual media data */
-static int mov_read_mdat(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    if (atom.size == 0) /* wrong one (MP4) */
-        return 0;
-    c->found_mdat=1;
-    return 0; /* now go for moov */
-}
-
-/* read major brand, minor version and compatible brands and store them as metadata */
-static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    uint32_t minor_ver;
-    int comp_brand_size;
-    char minor_ver_str[11]; /* 32 bit integer -> 10 digits + null */
-    char* comp_brands_str;
-    uint8_t type[5] = {0};
-
-    avio_read(pb, type, 4);
-    if (strcmp(type, "qt  "))
-        c->isom = 1;
-    av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type);
-    av_dict_set(&c->fc->metadata, "major_brand", type, 0);
-    minor_ver = avio_rb32(pb); /* minor version */
-    snprintf(minor_ver_str, sizeof(minor_ver_str), "%d", minor_ver);
-    av_dict_set(&c->fc->metadata, "minor_version", minor_ver_str, 0);
-
-    comp_brand_size = atom.size - 8;
-    if (comp_brand_size < 0)
-        return AVERROR_INVALIDDATA;
-    comp_brands_str = av_malloc(comp_brand_size + 1); /* Add null terminator */
-    if (!comp_brands_str)
-        return AVERROR(ENOMEM);
-    avio_read(pb, comp_brands_str, comp_brand_size);
-    comp_brands_str[comp_brand_size] = 0;
-    av_dict_set(&c->fc->metadata, "compatible_brands", comp_brands_str, 0);
-    av_freep(&comp_brands_str);
-
-    return 0;
-}
-
-/* this atom should contain all header atoms */
-static int mov_read_moov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    int ret;
-
-    if ((ret = mov_read_default(c, pb, atom)) < 0)
-        return ret;
-    /* we parsed the 'moov' atom, we can terminate the parsing as soon as we find the 'mdat' */
-    /* so we don't parse the whole file if over a network */
-    c->found_moov=1;
-    return 0; /* now go for mdat */
-}
-
-static int mov_read_moof(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    c->fragment.moof_offset = avio_tell(pb) - 8;
-    av_dlog(c->fc, "moof offset %"PRIx64"\n", c->fragment.moof_offset);
-    return mov_read_default(c, pb, atom);
-}
-
-static void mov_metadata_creation_time(AVDictionary **metadata, time_t time)
-{
-    char buffer[32];
-    if (time) {
-        struct tm *ptm;
-        time -= 2082844800;  /* seconds between 1904-01-01 and Epoch */
-        ptm = gmtime(&time);
-        if (!ptm) return;
-        strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm);
-        av_dict_set(metadata, "creation_time", buffer, 0);
-    }
-}
-
-static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    int version;
-    char language[4] = {0};
-    unsigned lang;
-    time_t creation_time;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    if (sc->time_scale) {
-        av_log(c->fc, AV_LOG_ERROR, "Multiple mdhd?\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    version = avio_r8(pb);
-    if (version > 1) {
-        avpriv_request_sample(c->fc, "Version %d", version);
-        return AVERROR_PATCHWELCOME;
-    }
-    avio_rb24(pb); /* flags */
-    if (version == 1) {
-        creation_time = avio_rb64(pb);
-        avio_rb64(pb);
-    } else {
-        creation_time = avio_rb32(pb);
-        avio_rb32(pb); /* modification time */
-    }
-    mov_metadata_creation_time(&st->metadata, creation_time);
-
-    sc->time_scale = avio_rb32(pb);
-    st->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */
-
-    lang = avio_rb16(pb); /* language */
-    if (ff_mov_lang_to_iso639(lang, language))
-        av_dict_set(&st->metadata, "language", language, 0);
-    avio_rb16(pb); /* quality */
-
-    return 0;
-}
-
-static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    time_t creation_time;
-    int version = avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-
-    if (version == 1) {
-        creation_time = avio_rb64(pb);
-        avio_rb64(pb);
-    } else {
-        creation_time = avio_rb32(pb);
-        avio_rb32(pb); /* modification time */
-    }
-    mov_metadata_creation_time(&c->fc->metadata, creation_time);
-    c->time_scale = avio_rb32(pb); /* time scale */
-
-    av_dlog(c->fc, "time scale = %i\n", c->time_scale);
-
-    c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */
-    avio_rb32(pb); /* preferred scale */
-
-    avio_rb16(pb); /* preferred volume */
-
-    avio_skip(pb, 10); /* reserved */
-
-    avio_skip(pb, 36); /* display matrix */
-
-    avio_rb32(pb); /* preview time */
-    avio_rb32(pb); /* preview duration */
-    avio_rb32(pb); /* poster time */
-    avio_rb32(pb); /* selection time */
-    avio_rb32(pb); /* selection duration */
-    avio_rb32(pb); /* current time */
-    avio_rb32(pb); /* next track ID */
-
-    return 0;
-}
-
-static int mov_read_smi(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    if ((uint64_t)atom.size > (1<<30))
-        return AVERROR_INVALIDDATA;
-
-    // currently SVQ3 decoder expect full STSD header - so let's fake it
-    // this should be fixed and just SMI header should be passed
-    av_free(st->codec->extradata);
-    st->codec->extradata = av_mallocz(atom.size + 0x5a + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata)
-        return AVERROR(ENOMEM);
-    st->codec->extradata_size = 0x5a + atom.size;
-    memcpy(st->codec->extradata, "SVQ3", 4); // fake
-    avio_read(pb, st->codec->extradata + 0x5a, atom.size);
-    av_dlog(c->fc, "Reading SMI %"PRId64"  %s\n", atom.size, st->codec->extradata + 0x5a);
-    return 0;
-}
-
-static int mov_read_enda(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    int little_endian;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    little_endian = avio_rb16(pb);
-    av_dlog(c->fc, "enda %d\n", little_endian);
-    if (little_endian == 1) {
-        switch (st->codec->codec_id) {
-        case AV_CODEC_ID_PCM_S24BE:
-            st->codec->codec_id = AV_CODEC_ID_PCM_S24LE;
-            break;
-        case AV_CODEC_ID_PCM_S32BE:
-            st->codec->codec_id = AV_CODEC_ID_PCM_S32LE;
-            break;
-        case AV_CODEC_ID_PCM_F32BE:
-            st->codec->codec_id = AV_CODEC_ID_PCM_F32LE;
-            break;
-        case AV_CODEC_ID_PCM_F64BE:
-            st->codec->codec_id = AV_CODEC_ID_PCM_F64LE;
-            break;
-        default:
-            break;
-        }
-    }
-    return 0;
-}
-
-static int mov_read_fiel(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    unsigned mov_field_order;
-    enum AVFieldOrder decoded_field_order = AV_FIELD_UNKNOWN;
-
-    if (c->fc->nb_streams < 1) // will happen with jp2 files
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    if (atom.size < 2)
-        return AVERROR_INVALIDDATA;
-    mov_field_order = avio_rb16(pb);
-    if ((mov_field_order & 0xFF00) == 0x0100)
-        decoded_field_order = AV_FIELD_PROGRESSIVE;
-    else if ((mov_field_order & 0xFF00) == 0x0200) {
-        switch (mov_field_order & 0xFF) {
-        case 0x01: decoded_field_order = AV_FIELD_TT;
-                   break;
-        case 0x06: decoded_field_order = AV_FIELD_BB;
-                   break;
-        case 0x09: decoded_field_order = AV_FIELD_TB;
-                   break;
-        case 0x0E: decoded_field_order = AV_FIELD_BT;
-                   break;
-        }
-    }
-    if (decoded_field_order == AV_FIELD_UNKNOWN && mov_field_order) {
-        av_log(NULL, AV_LOG_ERROR, "Unknown MOV field order 0x%04x\n", mov_field_order);
-    }
-    st->codec->field_order = decoded_field_order;
-
-    return 0;
-}
-
-/* FIXME modify qdm2/svq3/h264 decoders to take full atom as extradata */
-static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    uint64_t size;
-    uint8_t *buf;
-    int err;
-
-    if (c->fc->nb_streams < 1) // will happen with jp2 files
-        return 0;
-    st= c->fc->streams[c->fc->nb_streams-1];
-    size= (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE;
-    if (size > INT_MAX || (uint64_t)atom.size > INT_MAX)
-        return AVERROR_INVALIDDATA;
-    if ((err = av_reallocp(&st->codec->extradata, size)) < 0) {
-        st->codec->extradata_size = 0;
-        return err;
-    }
-    buf = st->codec->extradata + st->codec->extradata_size;
-    st->codec->extradata_size= size - FF_INPUT_BUFFER_PADDING_SIZE;
-    AV_WB32(       buf    , atom.size + 8);
-    AV_WL32(       buf + 4, atom.type);
-    avio_read(pb, buf + 8, atom.size);
-    return 0;
-}
-
-static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    if ((uint64_t)atom.size > (1<<30))
-        return AVERROR_INVALIDDATA;
-
-    if (st->codec->codec_id == AV_CODEC_ID_QDM2 || st->codec->codec_id == AV_CODEC_ID_QDMC) {
-        // pass all frma atom to codec, needed at least for QDMC and QDM2
-        av_free(st->codec->extradata);
-        st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!st->codec->extradata)
-            return AVERROR(ENOMEM);
-        st->codec->extradata_size = atom.size;
-        avio_read(pb, st->codec->extradata, atom.size);
-    } else if (atom.size > 8) { /* to read frma, esds atoms */
-        int ret;
-        if ((ret = mov_read_default(c, pb, atom)) < 0)
-            return ret;
-    } else
-        avio_skip(pb, atom.size);
-    return 0;
-}
-
-/**
- * This function reads atom content and puts data in extradata without tag
- * nor size unlike mov_read_extradata.
- */
-static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    if ((uint64_t)atom.size > (1<<30))
-        return AVERROR_INVALIDDATA;
-
-    if (atom.size >= 10) {
-        // Broken files created by legacy versions of libavformat will
-        // wrap a whole fiel atom inside of a glbl atom.
-        unsigned size = avio_rb32(pb);
-        unsigned type = avio_rl32(pb);
-        avio_seek(pb, -8, SEEK_CUR);
-        if (type == MKTAG('f','i','e','l') && size == atom.size)
-            return mov_read_default(c, pb, atom);
-    }
-    av_free(st->codec->extradata);
-    st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata)
-        return AVERROR(ENOMEM);
-    st->codec->extradata_size = atom.size;
-    avio_read(pb, st->codec->extradata, atom.size);
-    return 0;
-}
-
-static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    uint8_t profile_level;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    if (atom.size >= (1<<28) || atom.size < 7)
-        return AVERROR_INVALIDDATA;
-
-    profile_level = avio_r8(pb);
-    if ((profile_level & 0xf0) != 0xc0)
-        return 0;
-
-    av_free(st->codec->extradata);
-    st->codec->extradata = av_mallocz(atom.size - 7 + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata)
-        return AVERROR(ENOMEM);
-    st->codec->extradata_size = atom.size - 7;
-    avio_seek(pb, 6, SEEK_CUR);
-    avio_read(pb, st->codec->extradata, st->codec->extradata_size);
-    return 0;
-}
-
-/**
- * An strf atom is a BITMAPINFOHEADER struct. This struct is 40 bytes itself,
- * but can have extradata appended at the end after the 40 bytes belonging
- * to the struct.
- */
-static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    if (atom.size <= 40)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-
-    if ((uint64_t)atom.size > (1<<30))
-        return AVERROR_INVALIDDATA;
-
-    av_free(st->codec->extradata);
-    st->codec->extradata = av_mallocz(atom.size - 40 + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata)
-        return AVERROR(ENOMEM);
-    st->codec->extradata_size = atom.size - 40;
-    avio_skip(pb, 40);
-    avio_read(pb, st->codec->extradata, atom.size - 40);
-    return 0;
-}
-
-static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    unsigned int i, entries;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-
-    entries = avio_rb32(pb);
-
-    if (!entries)
-        return 0;
-    if (entries >= UINT_MAX/sizeof(int64_t))
-        return AVERROR_INVALIDDATA;
-
-    sc->chunk_offsets = av_malloc(entries * sizeof(int64_t));
-    if (!sc->chunk_offsets)
-        return AVERROR(ENOMEM);
-    sc->chunk_count = entries;
-
-    if      (atom.type == MKTAG('s','t','c','o'))
-        for (i = 0; i < entries && !pb->eof_reached; i++)
-            sc->chunk_offsets[i] = avio_rb32(pb);
-    else if (atom.type == MKTAG('c','o','6','4'))
-        for (i = 0; i < entries && !pb->eof_reached; i++)
-            sc->chunk_offsets[i] = avio_rb64(pb);
-    else
-        return AVERROR_INVALIDDATA;
-
-    sc->chunk_count = i;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    return 0;
-}
-
-/**
- * Compute codec id for 'lpcm' tag.
- * See CoreAudioTypes and AudioStreamBasicDescription at Apple.
- */
-enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
-{
-    /* lpcm flags:
-     * 0x1 = float
-     * 0x2 = big-endian
-     * 0x4 = signed
-     */
-    return ff_get_pcm_codec_id(bps, flags & 1, flags & 2, flags & 4 ? -1 : 0);
-}
-
-static int mov_codec_id(AVStream *st, uint32_t format)
-{
-    int id = ff_codec_get_id(ff_codec_movaudio_tags, format);
-
-    if (id <= 0 &&
-        ((format & 0xFFFF) == 'm' + ('s' << 8) ||
-         (format & 0xFFFF) == 'T' + ('S' << 8)))
-        id = ff_codec_get_id(ff_codec_wav_tags, av_bswap32(format) & 0xFFFF);
-
-    if (st->codec->codec_type != AVMEDIA_TYPE_VIDEO && id > 0) {
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    } else if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO &&
-               /* skip old asf mpeg4 tag */
-               format && format != MKTAG('m','p','4','s')) {
-        id = ff_codec_get_id(ff_codec_movvideo_tags, format);
-        if (id <= 0)
-            id = ff_codec_get_id(ff_codec_bmp_tags, format);
-        if (id > 0)
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        else if (st->codec->codec_type == AVMEDIA_TYPE_DATA) {
-            id = ff_codec_get_id(ff_codec_movsubtitle_tags, format);
-            if (id > 0)
-                st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-        }
-    }
-
-    st->codec->codec_tag = format;
-
-    return id;
-}
-
-static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
-                                 AVStream *st, MOVStreamContext *sc)
-{
-    unsigned int color_depth, len, j;
-    int color_greyscale;
-    int color_table_id;
-
-    avio_rb16(pb); /* version */
-    avio_rb16(pb); /* revision level */
-    avio_rb32(pb); /* vendor */
-    avio_rb32(pb); /* temporal quality */
-    avio_rb32(pb); /* spatial quality */
-
-    st->codec->width  = avio_rb16(pb); /* width */
-    st->codec->height = avio_rb16(pb); /* height */
-
-    avio_rb32(pb); /* horiz resolution */
-    avio_rb32(pb); /* vert resolution */
-    avio_rb32(pb); /* data size, always 0 */
-    avio_rb16(pb); /* frames per samples */
-
-    len = avio_r8(pb); /* codec name, pascal string */
-    if (len > 31)
-        len = 31;
-    mov_read_mac_string(c, pb, len, st->codec->codec_name, 32);
-    if (len < 31)
-        avio_skip(pb, 31 - len);
-    /* codec_tag YV12 triggers an UV swap in rawdec.c */
-    if (!memcmp(st->codec->codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25))
-        st->codec->codec_tag = MKTAG('I', '4', '2', '0');
-    /* Flash Media Server uses tag H263 with Sorenson Spark */
-    if (st->codec->codec_tag == MKTAG('H','2','6','3') &&
-        !memcmp(st->codec->codec_name, "Sorenson H263", 13))
-        st->codec->codec_id = AV_CODEC_ID_FLV1;
-
-    st->codec->bits_per_coded_sample = avio_rb16(pb); /* depth */
-    color_table_id = avio_rb16(pb); /* colortable id */
-    av_dlog(c->fc, "depth %d, ctab id %d\n",
-            st->codec->bits_per_coded_sample, color_table_id);
-    /* figure out the palette situation */
-    color_depth     = st->codec->bits_per_coded_sample & 0x1F;
-    color_greyscale = st->codec->bits_per_coded_sample & 0x20;
-
-    /* if the depth is 2, 4, or 8 bpp, file is palettized */
-    if ((color_depth == 2) || (color_depth == 4) || (color_depth == 8)) {
-        /* for palette traversal */
-        unsigned int color_start, color_count, color_end;
-        unsigned char r, g, b;
-
-        if (color_greyscale) {
-            int color_index, color_dec;
-            /* compute the greyscale palette */
-            st->codec->bits_per_coded_sample = color_depth;
-            color_count = 1 << color_depth;
-            color_index = 255;
-            color_dec   = 256 / (color_count - 1);
-            for (j = 0; j < color_count; j++) {
-                r = g = b = color_index;
-                sc->palette[j] = (r << 16) | (g << 8) | (b);
-                color_index -= color_dec;
-                if (color_index < 0)
-                    color_index = 0;
-            }
-        } else if (color_table_id) {
-            const uint8_t *color_table;
-            /* if flag bit 3 is set, use the default palette */
-            color_count = 1 << color_depth;
-            if (color_depth == 2)
-                color_table = ff_qt_default_palette_4;
-            else if (color_depth == 4)
-                color_table = ff_qt_default_palette_16;
-            else
-                color_table = ff_qt_default_palette_256;
-
-            for (j = 0; j < color_count; j++) {
-                r = color_table[j * 3 + 0];
-                g = color_table[j * 3 + 1];
-                b = color_table[j * 3 + 2];
-                sc->palette[j] = (r << 16) | (g << 8) | (b);
-            }
-        } else {
-            /* load the palette from the file */
-            color_start = avio_rb32(pb);
-            color_count = avio_rb16(pb);
-            color_end   = avio_rb16(pb);
-            if ((color_start <= 255) && (color_end <= 255)) {
-                for (j = color_start; j <= color_end; j++) {
-                    /* each R, G, or B component is 16 bits;
-                     * only use the top 8 bits; skip alpha bytes
-                     * up front */
-                    avio_r8(pb);
-                    avio_r8(pb);
-                    r = avio_r8(pb);
-                    avio_r8(pb);
-                    g = avio_r8(pb);
-                    avio_r8(pb);
-                    b = avio_r8(pb);
-                    avio_r8(pb);
-                    sc->palette[j] = (r << 16) | (g << 8) | (b);
-                }
-            }
-        }
-        sc->has_palette = 1;
-    }
-}
-
-static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
-                                 AVStream *st, MOVStreamContext *sc)
-{
-    int bits_per_sample, flags;
-    uint16_t version = avio_rb16(pb);
-
-    avio_rb16(pb); /* revision level */
-    avio_rb32(pb); /* vendor */
-
-    st->codec->channels              = avio_rb16(pb); /* channel count */
-    st->codec->bits_per_coded_sample = avio_rb16(pb); /* sample size */
-    av_dlog(c->fc, "audio channels %d\n", st->codec->channels);
-
-    sc->audio_cid = avio_rb16(pb);
-    avio_rb16(pb); /* packet size = 0 */
-
-    st->codec->sample_rate = ((avio_rb32(pb) >> 16));
-
-    // Read QT version 1 fields. In version 0 these do not exist.
-    av_dlog(c->fc, "version =%d, isom =%d\n", version, c->isom);
-    if (!c->isom) {
-        if (version == 1) {
-            sc->samples_per_frame = avio_rb32(pb);
-            avio_rb32(pb); /* bytes per packet */
-            sc->bytes_per_frame = avio_rb32(pb);
-            avio_rb32(pb); /* bytes per sample */
-        } else if (version == 2) {
-            avio_rb32(pb); /* sizeof struct only */
-            st->codec->sample_rate = av_int2double(avio_rb64(pb));
-            st->codec->channels    = avio_rb32(pb);
-            avio_rb32(pb); /* always 0x7F000000 */
-            st->codec->bits_per_coded_sample = avio_rb32(pb);
-
-            flags = avio_rb32(pb); /* lpcm format specific flag */
-            sc->bytes_per_frame   = avio_rb32(pb);
-            sc->samples_per_frame = avio_rb32(pb);
-            if (st->codec->codec_tag == MKTAG('l','p','c','m'))
-                st->codec->codec_id =
-                    ff_mov_get_lpcm_codec_id(st->codec->bits_per_coded_sample,
-                                             flags);
-        }
-    }
-
-    switch (st->codec->codec_id) {
-    case AV_CODEC_ID_PCM_S8:
-    case AV_CODEC_ID_PCM_U8:
-        if (st->codec->bits_per_coded_sample == 16)
-            st->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
-        break;
-    case AV_CODEC_ID_PCM_S16LE:
-    case AV_CODEC_ID_PCM_S16BE:
-        if (st->codec->bits_per_coded_sample == 8)
-            st->codec->codec_id = AV_CODEC_ID_PCM_S8;
-        else if (st->codec->bits_per_coded_sample == 24)
-            st->codec->codec_id =
-                st->codec->codec_id == AV_CODEC_ID_PCM_S16BE ?
-                AV_CODEC_ID_PCM_S24BE : AV_CODEC_ID_PCM_S24LE;
-        break;
-    /* set values for old format before stsd version 1 appeared */
-    case AV_CODEC_ID_MACE3:
-        sc->samples_per_frame = 6;
-        sc->bytes_per_frame   = 2 * st->codec->channels;
-        break;
-    case AV_CODEC_ID_MACE6:
-        sc->samples_per_frame = 6;
-        sc->bytes_per_frame   = 1 * st->codec->channels;
-        break;
-    case AV_CODEC_ID_ADPCM_IMA_QT:
-        sc->samples_per_frame = 64;
-        sc->bytes_per_frame   = 34 * st->codec->channels;
-        break;
-    case AV_CODEC_ID_GSM:
-        sc->samples_per_frame = 160;
-        sc->bytes_per_frame   = 33;
-        break;
-    default:
-        break;
-    }
-
-    bits_per_sample = av_get_bits_per_sample(st->codec->codec_id);
-    if (bits_per_sample) {
-        st->codec->bits_per_coded_sample = bits_per_sample;
-        sc->sample_size = (bits_per_sample >> 3) * st->codec->channels;
-    }
-}
-
-static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb,
-                                    AVStream *st, MOVStreamContext *sc,
-                                    int size)
-{
-    // ttxt stsd contains display flags, justification, background
-    // color, fonts, and default styles, so fake an atom to read it
-    MOVAtom fake_atom = { .size = size };
-    // mp4s contains a regular esds atom
-    if (st->codec->codec_tag != AV_RL32("mp4s"))
-        mov_read_glbl(c, pb, fake_atom);
-    st->codec->width  = sc->width;
-    st->codec->height = sc->height;
-}
-
-static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
-                                AVStream *st, MOVStreamContext *sc,
-                                int size)
-{
-    if (st->codec->codec_tag == MKTAG('t','m','c','d')) {
-        st->codec->extradata_size = size;
-        st->codec->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!st->codec->extradata)
-            return AVERROR(ENOMEM);
-        avio_read(pb, st->codec->extradata, size);
-    } else {
-        /* other codec type, just skip (rtp, mp4s ...) */
-        avio_skip(pb, size);
-    }
-    return 0;
-}
-
-static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb,
-                                   AVStream *st, MOVStreamContext *sc)
-{
-    if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
-        !st->codec->sample_rate && sc->time_scale > 1)
-        st->codec->sample_rate = sc->time_scale;
-
-    /* special codec parameters handling */
-    switch (st->codec->codec_id) {
-#if CONFIG_DV_DEMUXER
-    case AV_CODEC_ID_DVAUDIO:
-        c->dv_fctx  = avformat_alloc_context();
-        c->dv_demux = avpriv_dv_init_demux(c->dv_fctx);
-        if (!c->dv_demux) {
-            av_log(c->fc, AV_LOG_ERROR, "dv demux context init error\n");
-            return AVERROR(ENOMEM);
-        }
-        sc->dv_audio_container = 1;
-        st->codec->codec_id    = AV_CODEC_ID_PCM_S16LE;
-        break;
-#endif
-    /* no ifdef since parameters are always those */
-    case AV_CODEC_ID_QCELP:
-        st->codec->channels = 1;
-        // force sample rate for qcelp when not stored in mov
-        if (st->codec->codec_tag != MKTAG('Q','c','l','p'))
-            st->codec->sample_rate = 8000;
-        break;
-    case AV_CODEC_ID_AMR_NB:
-        st->codec->channels    = 1;
-        /* force sample rate for amr, stsd in 3gp does not store sample rate */
-        st->codec->sample_rate = 8000;
-        break;
-    case AV_CODEC_ID_AMR_WB:
-        st->codec->channels    = 1;
-        st->codec->sample_rate = 16000;
-        break;
-    case AV_CODEC_ID_MP2:
-    case AV_CODEC_ID_MP3:
-        /* force type after stsd for m1a hdlr */
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->need_parsing      = AVSTREAM_PARSE_FULL;
-        break;
-    case AV_CODEC_ID_GSM:
-    case AV_CODEC_ID_ADPCM_MS:
-    case AV_CODEC_ID_ADPCM_IMA_WAV:
-    case AV_CODEC_ID_ILBC:
-        st->codec->block_align = sc->bytes_per_frame;
-        break;
-    case AV_CODEC_ID_ALAC:
-        if (st->codec->extradata_size == 36) {
-            st->codec->channels    = AV_RB8 (st->codec->extradata + 21);
-            st->codec->sample_rate = AV_RB32(st->codec->extradata + 32);
-        }
-        break;
-    case AV_CODEC_ID_VC1:
-        st->need_parsing = AVSTREAM_PARSE_FULL;
-        break;
-    default:
-        break;
-    }
-    return 0;
-}
-
-static int mov_skip_multiple_stsd(MOVContext *c, AVIOContext *pb,
-                                  int codec_tag, int format,
-                                  int size)
-{
-    int video_codec_id = ff_codec_get_id(ff_codec_movvideo_tags, format);
-
-    if (codec_tag &&
-        (codec_tag == AV_RL32("avc1") ||
-         codec_tag == AV_RL32("hvc1") ||
-         codec_tag == AV_RL32("hev1") ||
-         (codec_tag != format &&
-          (c->fc->video_codec_id ? video_codec_id != c->fc->video_codec_id
-                                 : codec_tag != MKTAG('j','p','e','g'))))) {
-        /* Multiple fourcc, we skip JPEG. This is not correct, we should
-         * export it as a separate AVStream but this needs a few changes
-         * in the MOV demuxer, patch welcome. */
-
-        av_log(c->fc, AV_LOG_WARNING, "multiple fourcc not supported\n");
-        avio_skip(pb, size);
-        return 1;
-    }
-
-    return 0;
-}
-
-int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    int pseudo_stream_id;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    for (pseudo_stream_id = 0;
-         pseudo_stream_id < entries && !pb->eof_reached;
-         pseudo_stream_id++) {
-        //Parsing Sample description table
-        enum AVCodecID id;
-        int ret, dref_id = 1;
-        MOVAtom a = { AV_RL32("stsd") };
-        int64_t start_pos = avio_tell(pb);
-        uint32_t size = avio_rb32(pb); /* size */
-        uint32_t format = avio_rl32(pb); /* data format */
-
-        if (size >= 16) {
-            avio_rb32(pb); /* reserved */
-            avio_rb16(pb); /* reserved */
-            dref_id = avio_rb16(pb);
-        } else {
-            av_log(c->fc, AV_LOG_ERROR, "invalid size %d in stsd\n", size);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (mov_skip_multiple_stsd(c, pb, st->codec->codec_tag, format,
-                                   size - (avio_tell(pb) - start_pos)))
-            continue;
-
-        sc->pseudo_stream_id = st->codec->codec_tag ? -1 : pseudo_stream_id;
-        sc->dref_id= dref_id;
-
-        id = mov_codec_id(st, format);
-
-        av_dlog(c->fc, "size=%d 4CC= %c%c%c%c codec_type=%d\n", size,
-                (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
-                (format >> 24) & 0xff, st->codec->codec_type);
-
-        if (st->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
-            st->codec->codec_id = id;
-            mov_parse_stsd_video(c, pb, st, sc);
-        } else if (st->codec->codec_type==AVMEDIA_TYPE_AUDIO) {
-            st->codec->codec_id = id;
-            mov_parse_stsd_audio(c, pb, st, sc);
-        } else if (st->codec->codec_type==AVMEDIA_TYPE_SUBTITLE){
-            st->codec->codec_id = id;
-            mov_parse_stsd_subtitle(c, pb, st, sc,
-                                    size - (avio_tell(pb) - start_pos));
-        } else {
-            ret = mov_parse_stsd_data(c, pb, st, sc,
-                                      size - (avio_tell(pb) - start_pos));
-            if (ret < 0)
-                return ret;
-        }
-        /* this will read extra atoms at the end (wave, alac, damr, avcC, hvcC, SMI ...) */
-        a.size = size - (avio_tell(pb) - start_pos);
-        if (a.size > 8) {
-            if ((ret = mov_read_default(c, pb, a)) < 0)
-                return ret;
-        } else if (a.size > 0)
-            avio_skip(pb, a.size);
-    }
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    return mov_finalize_stsd_codec(c, pb, st, sc);
-}
-
-static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    int entries;
-
-    avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-    entries = avio_rb32(pb);
-
-    return ff_mov_read_stsd_entries(c, pb, entries);
-}
-
-static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    unsigned int i, entries;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-
-    entries = avio_rb32(pb);
-
-    av_dlog(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
-
-    if (!entries)
-        return 0;
-    if (entries >= UINT_MAX / sizeof(*sc->stsc_data))
-        return AVERROR_INVALIDDATA;
-    sc->stsc_data = av_malloc(entries * sizeof(*sc->stsc_data));
-    if (!sc->stsc_data)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < entries && !pb->eof_reached; i++) {
-        sc->stsc_data[i].first = avio_rb32(pb);
-        sc->stsc_data[i].count = avio_rb32(pb);
-        sc->stsc_data[i].id = avio_rb32(pb);
-    }
-
-    sc->stsc_count = i;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    return 0;
-}
-
-static int mov_read_stps(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    unsigned i, entries;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    avio_rb32(pb); // version + flags
-
-    entries = avio_rb32(pb);
-    if (entries >= UINT_MAX / sizeof(*sc->stps_data))
-        return AVERROR_INVALIDDATA;
-    sc->stps_data = av_malloc(entries * sizeof(*sc->stps_data));
-    if (!sc->stps_data)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < entries && !pb->eof_reached; i++) {
-        sc->stps_data[i] = avio_rb32(pb);
-        //av_dlog(c->fc, "stps %d\n", sc->stps_data[i]);
-    }
-
-    sc->stps_count = i;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    return 0;
-}
-
-static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    unsigned int i, entries;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-
-    entries = avio_rb32(pb);
-
-    av_dlog(c->fc, "keyframe_count = %d\n", entries);
-
-    if (!entries)
-    {
-        sc->keyframe_absent = 1;
-        return 0;
-    }
-    if (entries >= UINT_MAX / sizeof(int))
-        return AVERROR_INVALIDDATA;
-    sc->keyframes = av_malloc(entries * sizeof(int));
-    if (!sc->keyframes)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < entries && !pb->eof_reached; i++) {
-        sc->keyframes[i] = avio_rb32(pb);
-        //av_dlog(c->fc, "keyframes[]=%d\n", sc->keyframes[i]);
-    }
-
-    sc->keyframe_count = i;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    return 0;
-}
-
-static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    unsigned int i, entries, sample_size, field_size, num_bytes;
-    GetBitContext gb;
-    unsigned char* buf;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-
-    if (atom.type == MKTAG('s','t','s','z')) {
-        sample_size = avio_rb32(pb);
-        if (!sc->sample_size) /* do not overwrite value computed in stsd */
-            sc->sample_size = sample_size;
-        field_size = 32;
-    } else {
-        sample_size = 0;
-        avio_rb24(pb); /* reserved */
-        field_size = avio_r8(pb);
-    }
-    entries = avio_rb32(pb);
-
-    av_dlog(c->fc, "sample_size = %d sample_count = %d\n", sc->sample_size, entries);
-
-    sc->sample_count = entries;
-    if (sample_size)
-        return 0;
-
-    if (field_size != 4 && field_size != 8 && field_size != 16 && field_size != 32) {
-        av_log(c->fc, AV_LOG_ERROR, "Invalid sample field size %d\n", field_size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!entries)
-        return 0;
-    if (entries >= UINT_MAX / sizeof(int) || entries >= (UINT_MAX - 4) / field_size)
-        return AVERROR_INVALIDDATA;
-    sc->sample_sizes = av_malloc(entries * sizeof(int));
-    if (!sc->sample_sizes)
-        return AVERROR(ENOMEM);
-
-    num_bytes = (entries*field_size+4)>>3;
-
-    buf = av_malloc(num_bytes+FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!buf) {
-        av_freep(&sc->sample_sizes);
-        return AVERROR(ENOMEM);
-    }
-
-    if (avio_read(pb, buf, num_bytes) < num_bytes) {
-        av_freep(&sc->sample_sizes);
-        av_free(buf);
-        return AVERROR_INVALIDDATA;
-    }
-
-    init_get_bits(&gb, buf, 8*num_bytes);
-
-    for (i = 0; i < entries && !pb->eof_reached; i++) {
-        sc->sample_sizes[i] = get_bits_long(&gb, field_size);
-        sc->data_size += sc->sample_sizes[i];
-    }
-
-    sc->sample_count = i;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    av_free(buf);
-    return 0;
-}
-
-static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    unsigned int i, entries;
-    int64_t duration=0;
-    int64_t total_sample_count=0;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-    entries = avio_rb32(pb);
-
-    av_dlog(c->fc, "track[%i].stts.entries = %i\n",
-            c->fc->nb_streams-1, entries);
-
-    if (!entries)
-        return 0;
-    if (entries >= UINT_MAX / sizeof(*sc->stts_data))
-        return AVERROR(EINVAL);
-
-    av_free(sc->stts_data);
-    sc->stts_data = av_malloc(entries * sizeof(*sc->stts_data));
-    if (!sc->stts_data)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < entries && !pb->eof_reached; i++) {
-        int sample_duration;
-        int sample_count;
-
-        sample_count=avio_rb32(pb);
-        sample_duration = avio_rb32(pb);
-        if (sample_count < 0) {
-            av_log(c->fc, AV_LOG_ERROR, "Invalid sample_count=%d\n", sample_count);
-            return AVERROR_INVALIDDATA;
-        }
-        sc->stts_data[i].count= sample_count;
-        sc->stts_data[i].duration= sample_duration;
-
-        av_dlog(c->fc, "sample_count=%d, sample_duration=%d\n",
-                sample_count, sample_duration);
-
-        duration+=(int64_t)sample_duration*sample_count;
-        total_sample_count+=sample_count;
-    }
-
-    sc->stts_count = i;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    st->nb_frames= total_sample_count;
-    if (duration)
-        st->duration= duration;
-    sc->track_end = duration;
-    return 0;
-}
-
-static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    unsigned int i, entries;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-    entries = avio_rb32(pb);
-
-    av_dlog(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
-
-    if (!entries)
-        return 0;
-    if (entries >= UINT_MAX / sizeof(*sc->ctts_data))
-        return AVERROR_INVALIDDATA;
-    sc->ctts_data = av_malloc(entries * sizeof(*sc->ctts_data));
-    if (!sc->ctts_data)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < entries && !pb->eof_reached; i++) {
-        int count    =avio_rb32(pb);
-        int duration =avio_rb32(pb);
-
-        sc->ctts_data[i].count   = count;
-        sc->ctts_data[i].duration= duration;
-        if (duration < 0)
-            sc->dts_shift = FFMAX(sc->dts_shift, -duration);
-    }
-
-    sc->ctts_count = i;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    av_dlog(c->fc, "dts shift %d\n", sc->dts_shift);
-
-    return 0;
-}
-
-static int mov_read_sbgp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    unsigned int i, entries;
-    uint8_t version;
-    uint32_t grouping_type;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    version = avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-    grouping_type = avio_rl32(pb);
-    if (grouping_type != MKTAG( 'r','a','p',' '))
-        return 0; /* only support 'rap ' grouping */
-    if (version == 1)
-        avio_rb32(pb); /* grouping_type_parameter */
-
-    entries = avio_rb32(pb);
-    if (!entries)
-        return 0;
-    if (entries >= UINT_MAX / sizeof(*sc->rap_group))
-        return AVERROR_INVALIDDATA;
-    sc->rap_group = av_malloc(entries * sizeof(*sc->rap_group));
-    if (!sc->rap_group)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < entries && !pb->eof_reached; i++) {
-        sc->rap_group[i].count = avio_rb32(pb); /* sample_count */
-        sc->rap_group[i].index = avio_rb32(pb); /* group_description_index */
-    }
-
-    sc->rap_group_count = i;
-
-    return pb->eof_reached ? AVERROR_EOF : 0;
-}
-
-static void mov_build_index(MOVContext *mov, AVStream *st)
-{
-    MOVStreamContext *sc = st->priv_data;
-    int64_t current_offset;
-    int64_t current_dts = 0;
-    unsigned int stts_index = 0;
-    unsigned int stsc_index = 0;
-    unsigned int stss_index = 0;
-    unsigned int stps_index = 0;
-    unsigned int i, j;
-    uint64_t stream_size = 0;
-
-    /* adjust first dts according to edit list */
-    if (sc->time_offset && mov->time_scale > 0) {
-        if (sc->time_offset < 0)
-            sc->time_offset = av_rescale(sc->time_offset, sc->time_scale, mov->time_scale);
-        current_dts = -sc->time_offset;
-        if (sc->ctts_data && sc->stts_data && sc->stts_data[0].duration &&
-            sc->ctts_data[0].duration / sc->stts_data[0].duration > 16) {
-            /* more than 16 frames delay, dts are likely wrong
-               this happens with files created by iMovie */
-            sc->wrong_dts = 1;
-            st->codec->has_b_frames = 1;
-        }
-    }
-
-    /* only use old uncompressed audio chunk demuxing when stts specifies it */
-    if (!(st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
-          sc->stts_count == 1 && sc->stts_data[0].duration == 1)) {
-        unsigned int current_sample = 0;
-        unsigned int stts_sample = 0;
-        unsigned int sample_size;
-        unsigned int distance = 0;
-        unsigned int rap_group_index = 0;
-        unsigned int rap_group_sample = 0;
-        int rap_group_present = sc->rap_group_count && sc->rap_group;
-        int key_off = (sc->keyframes && sc->keyframes[0] > 0) || (sc->stps_data && sc->stps_data[0] > 0);
-
-        current_dts -= sc->dts_shift;
-
-        if (!sc->sample_count)
-            return;
-        if (sc->sample_count >= UINT_MAX / sizeof(*st->index_entries) - st->nb_index_entries)
-            return;
-        if (av_reallocp_array(&st->index_entries,
-                              st->nb_index_entries + sc->sample_count,
-                              sizeof(*st->index_entries)) < 0) {
-            st->nb_index_entries = 0;
-            return;
-        }
-        st->index_entries_allocated_size = (st->nb_index_entries + sc->sample_count) * sizeof(*st->index_entries);
-
-        for (i = 0; i < sc->chunk_count; i++) {
-            current_offset = sc->chunk_offsets[i];
-            while (stsc_index + 1 < sc->stsc_count &&
-                i + 1 == sc->stsc_data[stsc_index + 1].first)
-                stsc_index++;
-            for (j = 0; j < sc->stsc_data[stsc_index].count; j++) {
-                int keyframe = 0;
-                if (current_sample >= sc->sample_count) {
-                    av_log(mov->fc, AV_LOG_ERROR, "wrong sample count\n");
-                    return;
-                }
-
-                if (!sc->keyframe_absent && (!sc->keyframe_count || current_sample+key_off == sc->keyframes[stss_index])) {
-                    keyframe = 1;
-                    if (stss_index + 1 < sc->keyframe_count)
-                        stss_index++;
-                } else if (sc->stps_count && current_sample+key_off == sc->stps_data[stps_index]) {
-                    keyframe = 1;
-                    if (stps_index + 1 < sc->stps_count)
-                        stps_index++;
-                }
-                if (rap_group_present && rap_group_index < sc->rap_group_count) {
-                    if (sc->rap_group[rap_group_index].index > 0)
-                        keyframe = 1;
-                    if (++rap_group_sample == sc->rap_group[rap_group_index].count) {
-                        rap_group_sample = 0;
-                        rap_group_index++;
-                    }
-                }
-                if (keyframe)
-                    distance = 0;
-                sample_size = sc->sample_size > 0 ? sc->sample_size : sc->sample_sizes[current_sample];
-                if (sc->pseudo_stream_id == -1 ||
-                   sc->stsc_data[stsc_index].id - 1 == sc->pseudo_stream_id) {
-                    AVIndexEntry *e = &st->index_entries[st->nb_index_entries++];
-                    e->pos = current_offset;
-                    e->timestamp = current_dts;
-                    e->size = sample_size;
-                    e->min_distance = distance;
-                    e->flags = keyframe ? AVINDEX_KEYFRAME : 0;
-                    av_dlog(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
-                            "size %d, distance %d, keyframe %d\n", st->index, current_sample,
-                            current_offset, current_dts, sample_size, distance, keyframe);
-                }
-
-                current_offset += sample_size;
-                stream_size += sample_size;
-                current_dts += sc->stts_data[stts_index].duration;
-                distance++;
-                stts_sample++;
-                current_sample++;
-                if (stts_index + 1 < sc->stts_count && stts_sample == sc->stts_data[stts_index].count) {
-                    stts_sample = 0;
-                    stts_index++;
-                }
-            }
-        }
-        if (st->duration > 0)
-            st->codec->bit_rate = stream_size*8*sc->time_scale/st->duration;
-    } else {
-        unsigned chunk_samples, total = 0;
-
-        // compute total chunk count
-        for (i = 0; i < sc->stsc_count; i++) {
-            unsigned count, chunk_count;
-
-            chunk_samples = sc->stsc_data[i].count;
-            if (i != sc->stsc_count - 1 &&
-                sc->samples_per_frame && chunk_samples % sc->samples_per_frame) {
-                av_log(mov->fc, AV_LOG_ERROR, "error unaligned chunk\n");
-                return;
-            }
-
-            if (sc->samples_per_frame >= 160) { // gsm
-                count = chunk_samples / sc->samples_per_frame;
-            } else if (sc->samples_per_frame > 1) {
-                unsigned samples = (1024/sc->samples_per_frame)*sc->samples_per_frame;
-                count = (chunk_samples+samples-1) / samples;
-            } else {
-                count = (chunk_samples+1023) / 1024;
-            }
-
-            if (i < sc->stsc_count - 1)
-                chunk_count = sc->stsc_data[i+1].first - sc->stsc_data[i].first;
-            else
-                chunk_count = sc->chunk_count - (sc->stsc_data[i].first - 1);
-            total += chunk_count * count;
-        }
-
-        av_dlog(mov->fc, "chunk count %d\n", total);
-        if (total >= UINT_MAX / sizeof(*st->index_entries) - st->nb_index_entries)
-            return;
-        if (av_reallocp_array(&st->index_entries,
-                              st->nb_index_entries + total,
-                              sizeof(*st->index_entries)) < 0) {
-            st->nb_index_entries = 0;
-            return;
-        }
-        st->index_entries_allocated_size = (st->nb_index_entries + total) * sizeof(*st->index_entries);
-
-        // populate index
-        for (i = 0; i < sc->chunk_count; i++) {
-            current_offset = sc->chunk_offsets[i];
-            if (stsc_index + 1 < sc->stsc_count &&
-                i + 1 == sc->stsc_data[stsc_index + 1].first)
-                stsc_index++;
-            chunk_samples = sc->stsc_data[stsc_index].count;
-
-            while (chunk_samples > 0) {
-                AVIndexEntry *e;
-                unsigned size, samples;
-
-                if (sc->samples_per_frame >= 160) { // gsm
-                    samples = sc->samples_per_frame;
-                    size = sc->bytes_per_frame;
-                } else {
-                    if (sc->samples_per_frame > 1) {
-                        samples = FFMIN((1024 / sc->samples_per_frame)*
-                                        sc->samples_per_frame, chunk_samples);
-                        size = (samples / sc->samples_per_frame) * sc->bytes_per_frame;
-                    } else {
-                        samples = FFMIN(1024, chunk_samples);
-                        size = samples * sc->sample_size;
-                    }
-                }
-
-                if (st->nb_index_entries >= total) {
-                    av_log(mov->fc, AV_LOG_ERROR, "wrong chunk count %d\n", total);
-                    return;
-                }
-                e = &st->index_entries[st->nb_index_entries++];
-                e->pos = current_offset;
-                e->timestamp = current_dts;
-                e->size = size;
-                e->min_distance = 0;
-                e->flags = AVINDEX_KEYFRAME;
-                av_dlog(mov->fc, "AVIndex stream %d, chunk %d, offset %"PRIx64", dts %"PRId64", "
-                        "size %d, duration %d\n", st->index, i, current_offset, current_dts,
-                        size, samples);
-
-                current_offset += size;
-                current_dts += samples;
-                chunk_samples -= samples;
-            }
-        }
-    }
-}
-
-static int mov_open_dref(AVIOContext **pb, char *src, MOVDref *ref,
-                         AVIOInterruptCB *int_cb)
-{
-    /* try relative path, we do not try the absolute because it can leak information about our
-       system to an attacker */
-    if (ref->nlvl_to > 0 && ref->nlvl_from > 0) {
-        char filename[1024];
-        char *src_path;
-        int i, l;
-
-        /* find a source dir */
-        src_path = strrchr(src, '/');
-        if (src_path)
-            src_path++;
-        else
-            src_path = src;
-
-        /* find a next level down to target */
-        for (i = 0, l = strlen(ref->path) - 1; l >= 0; l--)
-            if (ref->path[l] == '/') {
-                if (i == ref->nlvl_to - 1)
-                    break;
-                else
-                    i++;
-            }
-
-        /* compose filename if next level down to target was found */
-        if (i == ref->nlvl_to - 1 && src_path - src  < sizeof(filename)) {
-            memcpy(filename, src, src_path - src);
-            filename[src_path - src] = 0;
-
-            for (i = 1; i < ref->nlvl_from; i++)
-                av_strlcat(filename, "../", 1024);
-
-            av_strlcat(filename, ref->path + l + 1, 1024);
-
-            if (!avio_open2(pb, filename, AVIO_FLAG_READ, int_cb, NULL))
-                return 0;
-        }
-    }
-
-    return AVERROR(ENOENT);
-}
-
-static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-    int ret;
-
-    st = avformat_new_stream(c->fc, NULL);
-    if (!st) return AVERROR(ENOMEM);
-    st->id = c->fc->nb_streams;
-    sc = av_mallocz(sizeof(MOVStreamContext));
-    if (!sc) return AVERROR(ENOMEM);
-
-    st->priv_data = sc;
-    st->codec->codec_type = AVMEDIA_TYPE_DATA;
-    sc->ffindex = st->index;
-
-    if ((ret = mov_read_default(c, pb, atom)) < 0)
-        return ret;
-
-    /* sanity checks */
-    if (sc->chunk_count && (!sc->stts_count || !sc->stsc_count ||
-                            (!sc->sample_size && !sc->sample_count))) {
-        av_log(c->fc, AV_LOG_ERROR, "stream %d, missing mandatory atoms, broken header\n",
-               st->index);
-        return 0;
-    }
-
-    if (sc->time_scale <= 0) {
-        av_log(c->fc, AV_LOG_WARNING, "stream %d, timescale not set\n", st->index);
-        sc->time_scale = c->time_scale;
-        if (sc->time_scale <= 0)
-            sc->time_scale = 1;
-    }
-
-    avpriv_set_pts_info(st, 64, 1, sc->time_scale);
-
-    mov_build_index(c, st);
-
-    if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) {
-        MOVDref *dref = &sc->drefs[sc->dref_id - 1];
-        if (mov_open_dref(&sc->pb, c->fc->filename, dref, &c->fc->interrupt_callback) < 0)
-            av_log(c->fc, AV_LOG_ERROR,
-                   "stream %d, error opening alias: path='%s', dir='%s', "
-                   "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
-                   st->index, dref->path, dref->dir, dref->filename,
-                   dref->volume, dref->nlvl_from, dref->nlvl_to);
-    } else
-        sc->pb = c->fc->pb;
-
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        if (!st->sample_aspect_ratio.num &&
-            (st->codec->width != sc->width || st->codec->height != sc->height)) {
-            st->sample_aspect_ratio = av_d2q(((double)st->codec->height * sc->width) /
-                                             ((double)st->codec->width * sc->height), INT_MAX);
-        }
-    }
-
-    // done for ai5q, ai52, ai55, ai1q, ai12 and ai15.
-    if (!st->codec->extradata_size && st->codec->codec_id == AV_CODEC_ID_H264 &&
-        TAG_IS_AVCI(st->codec->codec_tag)) {
-        ret = ff_generate_avci_extradata(st);
-        if (ret < 0)
-            return ret;
-    }
-
-    switch (st->codec->codec_id) {
-#if CONFIG_H261_DECODER
-    case AV_CODEC_ID_H261:
-#endif
-#if CONFIG_H263_DECODER
-    case AV_CODEC_ID_H263:
-#endif
-#if CONFIG_MPEG4_DECODER
-    case AV_CODEC_ID_MPEG4:
-#endif
-        st->codec->width = 0; /* let decoder init width/height */
-        st->codec->height= 0;
-        break;
-    }
-
-    /* Do not need those anymore. */
-    av_freep(&sc->chunk_offsets);
-    av_freep(&sc->stsc_data);
-    av_freep(&sc->sample_sizes);
-    av_freep(&sc->keyframes);
-    av_freep(&sc->stts_data);
-    av_freep(&sc->stps_data);
-    av_freep(&sc->rap_group);
-
-    return 0;
-}
-
-static int mov_read_ilst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    int ret;
-    c->itunes_metadata = 1;
-    ret = mov_read_default(c, pb, atom);
-    c->itunes_metadata = 0;
-    return ret;
-}
-
-static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    while (atom.size > 8) {
-        uint32_t tag = avio_rl32(pb);
-        atom.size -= 4;
-        if (tag == MKTAG('h','d','l','r')) {
-            avio_seek(pb, -8, SEEK_CUR);
-            atom.size += 8;
-            return mov_read_default(c, pb, atom);
-        }
-    }
-    return 0;
-}
-
-static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    int i;
-    int width;
-    int height;
-    int64_t disp_transform[2];
-    int display_matrix[3][2];
-    AVStream *st;
-    MOVStreamContext *sc;
-    int version;
-    int flags;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    version = avio_r8(pb);
-    flags = avio_rb24(pb);
-    st->disposition |= (flags & MOV_TKHD_FLAG_ENABLED) ? AV_DISPOSITION_DEFAULT : 0;
-
-    if (version == 1) {
-        avio_rb64(pb);
-        avio_rb64(pb);
-    } else {
-        avio_rb32(pb); /* creation time */
-        avio_rb32(pb); /* modification time */
-    }
-    st->id = (int)avio_rb32(pb); /* track id (NOT 0 !)*/
-    avio_rb32(pb); /* reserved */
-
-    /* highlevel (considering edits) duration in movie timebase */
-    (version == 1) ? avio_rb64(pb) : avio_rb32(pb);
-    avio_rb32(pb); /* reserved */
-    avio_rb32(pb); /* reserved */
-
-    avio_rb16(pb); /* layer */
-    avio_rb16(pb); /* alternate group */
-    avio_rb16(pb); /* volume */
-    avio_rb16(pb); /* reserved */
-
-    //read in the display matrix (outlined in ISO 14496-12, Section 6.2.2)
-    // they're kept in fixed point format through all calculations
-    // ignore u,v,z b/c we don't need the scale factor to calc aspect ratio
-    for (i = 0; i < 3; i++) {
-        display_matrix[i][0] = avio_rb32(pb);   // 16.16 fixed point
-        display_matrix[i][1] = avio_rb32(pb);   // 16.16 fixed point
-        avio_rb32(pb);           // 2.30 fixed point (not used)
-    }
-
-    width = avio_rb32(pb);       // 16.16 fixed point track width
-    height = avio_rb32(pb);      // 16.16 fixed point track height
-    sc->width = width >> 16;
-    sc->height = height >> 16;
-
-    // transform the display width/height according to the matrix
-    // skip this if the display matrix is the default identity matrix
-    // or if it is rotating the picture, ex iPhone 3GS
-    // to keep the same scale, use [width height 1<<16]
-    if (width && height &&
-        ((display_matrix[0][0] != 65536  ||
-          display_matrix[1][1] != 65536) &&
-         !display_matrix[0][1] &&
-         !display_matrix[1][0] &&
-         !display_matrix[2][0] && !display_matrix[2][1])) {
-        for (i = 0; i < 2; i++)
-            disp_transform[i] =
-                (int64_t)  width  * display_matrix[0][i] +
-                (int64_t)  height * display_matrix[1][i] +
-                ((int64_t) display_matrix[2][i] << 16);
-
-        //sample aspect ratio is new width/height divided by old width/height
-        st->sample_aspect_ratio = av_d2q(
-            ((double) disp_transform[0] * height) /
-            ((double) disp_transform[1] * width), INT_MAX);
-    }
-    return 0;
-}
-
-static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    MOVFragment *frag = &c->fragment;
-    MOVTrackExt *trex = NULL;
-    int flags, track_id, i;
-
-    avio_r8(pb); /* version */
-    flags = avio_rb24(pb);
-
-    track_id = avio_rb32(pb);
-    if (!track_id)
-        return AVERROR_INVALIDDATA;
-    frag->track_id = track_id;
-    for (i = 0; i < c->trex_count; i++)
-        if (c->trex_data[i].track_id == frag->track_id) {
-            trex = &c->trex_data[i];
-            break;
-        }
-    if (!trex) {
-        av_log(c->fc, AV_LOG_ERROR, "could not find corresponding trex\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    frag->base_data_offset = flags & MOV_TFHD_BASE_DATA_OFFSET ?
-                             avio_rb64(pb) : frag->moof_offset;
-    frag->stsd_id  = flags & MOV_TFHD_STSD_ID ? avio_rb32(pb) : trex->stsd_id;
-
-    frag->duration = flags & MOV_TFHD_DEFAULT_DURATION ?
-                     avio_rb32(pb) : trex->duration;
-    frag->size     = flags & MOV_TFHD_DEFAULT_SIZE ?
-                     avio_rb32(pb) : trex->size;
-    frag->flags    = flags & MOV_TFHD_DEFAULT_FLAGS ?
-                     avio_rb32(pb) : trex->flags;
-    av_dlog(c->fc, "frag flags 0x%x\n", frag->flags);
-    return 0;
-}
-
-static int mov_read_chap(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    c->chapter_track = avio_rb32(pb);
-    return 0;
-}
-
-static int mov_read_trex(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    MOVTrackExt *trex;
-    int err;
-
-    if ((uint64_t)c->trex_count+1 >= UINT_MAX / sizeof(*c->trex_data))
-        return AVERROR_INVALIDDATA;
-    if ((err = av_reallocp_array(&c->trex_data, c->trex_count + 1,
-                                 sizeof(*c->trex_data))) < 0) {
-        c->trex_count = 0;
-        return err;
-    }
-    trex = &c->trex_data[c->trex_count++];
-    avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-    trex->track_id = avio_rb32(pb);
-    trex->stsd_id  = avio_rb32(pb);
-    trex->duration = avio_rb32(pb);
-    trex->size     = avio_rb32(pb);
-    trex->flags    = avio_rb32(pb);
-    return 0;
-}
-
-static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    MOVFragment *frag = &c->fragment;
-    AVStream *st = NULL;
-    MOVStreamContext *sc;
-    MOVStts *ctts_data;
-    uint64_t offset;
-    int64_t dts;
-    int data_offset = 0;
-    unsigned entries, first_sample_flags = frag->flags;
-    int flags, distance, i, found_keyframe = 0, err;
-
-    for (i = 0; i < c->fc->nb_streams; i++) {
-        if (c->fc->streams[i]->id == frag->track_id) {
-            st = c->fc->streams[i];
-            break;
-        }
-    }
-    if (!st) {
-        av_log(c->fc, AV_LOG_ERROR, "could not find corresponding track id %d\n", frag->track_id);
-        return AVERROR_INVALIDDATA;
-    }
-    sc = st->priv_data;
-    if (sc->pseudo_stream_id+1 != frag->stsd_id)
-        return 0;
-    avio_r8(pb); /* version */
-    flags = avio_rb24(pb);
-    entries = avio_rb32(pb);
-    av_dlog(c->fc, "flags 0x%x entries %d\n", flags, entries);
-
-    /* Always assume the presence of composition time offsets.
-     * Without this assumption, for instance, we cannot deal with a track in fragmented movies that meet the following.
-     *  1) in the initial movie, there are no samples.
-     *  2) in the first movie fragment, there is only one sample without composition time offset.
-     *  3) in the subsequent movie fragments, there are samples with composition time offset. */
-    if (!sc->ctts_count && sc->sample_count)
-    {
-        /* Complement ctts table if moov atom doesn't have ctts atom. */
-        ctts_data = av_realloc(NULL, sizeof(*sc->ctts_data));
-        if (!ctts_data)
-            return AVERROR(ENOMEM);
-        sc->ctts_data = ctts_data;
-        sc->ctts_data[sc->ctts_count].count = sc->sample_count;
-        sc->ctts_data[sc->ctts_count].duration = 0;
-        sc->ctts_count++;
-    }
-    if ((uint64_t)entries+sc->ctts_count >= UINT_MAX/sizeof(*sc->ctts_data))
-        return AVERROR_INVALIDDATA;
-    if ((err = av_reallocp_array(&sc->ctts_data, entries + sc->ctts_count,
-                                 sizeof(*sc->ctts_data))) < 0) {
-        sc->ctts_count = 0;
-        return err;
-    }
-    if (flags & MOV_TRUN_DATA_OFFSET)        data_offset        = avio_rb32(pb);
-    if (flags & MOV_TRUN_FIRST_SAMPLE_FLAGS) first_sample_flags = avio_rb32(pb);
-    dts    = sc->track_end - sc->time_offset;
-    offset = frag->base_data_offset + data_offset;
-    distance = 0;
-    av_dlog(c->fc, "first sample flags 0x%x\n", first_sample_flags);
-    for (i = 0; i < entries && !pb->eof_reached; i++) {
-        unsigned sample_size = frag->size;
-        int sample_flags = i ? frag->flags : first_sample_flags;
-        unsigned sample_duration = frag->duration;
-        int keyframe = 0;
-
-        if (flags & MOV_TRUN_SAMPLE_DURATION) sample_duration = avio_rb32(pb);
-        if (flags & MOV_TRUN_SAMPLE_SIZE)     sample_size     = avio_rb32(pb);
-        if (flags & MOV_TRUN_SAMPLE_FLAGS)    sample_flags    = avio_rb32(pb);
-        sc->ctts_data[sc->ctts_count].count = 1;
-        sc->ctts_data[sc->ctts_count].duration = (flags & MOV_TRUN_SAMPLE_CTS) ?
-                                                  avio_rb32(pb) : 0;
-        sc->ctts_count++;
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-            keyframe = 1;
-        else if (!found_keyframe)
-            keyframe = found_keyframe =
-                !(sample_flags & (MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC |
-                                  MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES));
-        if (keyframe)
-            distance = 0;
-        av_add_index_entry(st, offset, dts, sample_size, distance,
-                           keyframe ? AVINDEX_KEYFRAME : 0);
-        av_dlog(c->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
-                "size %d, distance %d, keyframe %d\n", st->index, sc->sample_count+i,
-                offset, dts, sample_size, distance, keyframe);
-        distance++;
-        dts += sample_duration;
-        offset += sample_size;
-        sc->data_size += sample_size;
-    }
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    frag->moof_offset = offset;
-    st->duration = sc->track_end = dts + sc->time_offset;
-    return 0;
-}
-
-/* this atom should be null (from specs), but some buggy files put the 'moov' atom inside it... */
-/* like the files created with Adobe Premiere 5.0, for samples see */
-/* http://graphics.tudelft.nl/~wouter/publications/soundtests/ */
-static int mov_read_wide(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    int err;
-
-    if (atom.size < 8)
-        return 0; /* continue */
-    if (avio_rb32(pb) != 0) { /* 0 sized mdat atom... use the 'wide' atom size */
-        avio_skip(pb, atom.size - 4);
-        return 0;
-    }
-    atom.type = avio_rl32(pb);
-    atom.size -= 8;
-    if (atom.type != MKTAG('m','d','a','t')) {
-        avio_skip(pb, atom.size);
-        return 0;
-    }
-    err = mov_read_mdat(c, pb, atom);
-    return err;
-}
-
-static int mov_read_cmov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-#if CONFIG_ZLIB
-    AVIOContext ctx;
-    uint8_t *cmov_data;
-    uint8_t *moov_data; /* uncompressed data */
-    long cmov_len, moov_len;
-    int ret = -1;
-
-    avio_rb32(pb); /* dcom atom */
-    if (avio_rl32(pb) != MKTAG('d','c','o','m'))
-        return AVERROR_INVALIDDATA;
-    if (avio_rl32(pb) != MKTAG('z','l','i','b')) {
-        av_log(c->fc, AV_LOG_ERROR, "unknown compression for cmov atom !");
-        return AVERROR_INVALIDDATA;
-    }
-    avio_rb32(pb); /* cmvd atom */
-    if (avio_rl32(pb) != MKTAG('c','m','v','d'))
-        return AVERROR_INVALIDDATA;
-    moov_len = avio_rb32(pb); /* uncompressed size */
-    cmov_len = atom.size - 6 * 4;
-
-    cmov_data = av_malloc(cmov_len);
-    if (!cmov_data)
-        return AVERROR(ENOMEM);
-    moov_data = av_malloc(moov_len);
-    if (!moov_data) {
-        av_free(cmov_data);
-        return AVERROR(ENOMEM);
-    }
-    avio_read(pb, cmov_data, cmov_len);
-    if (uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK)
-        goto free_and_return;
-    if (ffio_init_context(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0)
-        goto free_and_return;
-    atom.type = MKTAG('m','o','o','v');
-    atom.size = moov_len;
-    ret = mov_read_default(c, &ctx, atom);
-free_and_return:
-    av_free(moov_data);
-    av_free(cmov_data);
-    return ret;
-#else
-    av_log(c->fc, AV_LOG_ERROR, "this file requires zlib support compiled in\n");
-    return AVERROR(ENOSYS);
-#endif
-}
-
-/* edit list atom */
-static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    MOVStreamContext *sc;
-    int i, edit_count, version;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    sc = c->fc->streams[c->fc->nb_streams-1]->priv_data;
-
-    version = avio_r8(pb); /* version */
-    avio_rb24(pb); /* flags */
-    edit_count = avio_rb32(pb); /* entries */
-
-    if ((uint64_t)edit_count*12+8 > atom.size)
-        return AVERROR_INVALIDDATA;
-
-    for (i=0; i<edit_count; i++){
-        int64_t time;
-        int64_t duration;
-        if (version == 1) {
-            duration = avio_rb64(pb);
-            time     = avio_rb64(pb);
-        } else {
-            duration = avio_rb32(pb); /* segment duration */
-            time     = (int32_t)avio_rb32(pb); /* media time */
-        }
-        avio_rb32(pb); /* Media rate */
-        if (i == 0 && time >= -1) {
-            sc->time_offset = time != -1 ? time : -duration;
-        }
-    }
-
-    if (edit_count > 1)
-        av_log(c->fc, AV_LOG_WARNING, "multiple edit list entries, "
-               "a/v desync might occur, patch welcome\n");
-
-    av_dlog(c->fc, "track[%i].edit_count = %i\n", c->fc->nb_streams-1, edit_count);
-    return 0;
-}
-
-static const MOVParseTableEntry mov_default_parse_table[] = {
-{ MKTAG('a','v','s','s'), mov_read_extradata },
-{ MKTAG('c','h','p','l'), mov_read_chpl },
-{ MKTAG('c','o','6','4'), mov_read_stco },
-{ MKTAG('c','t','t','s'), mov_read_ctts }, /* composition time to sample */
-{ MKTAG('d','i','n','f'), mov_read_default },
-{ MKTAG('d','r','e','f'), mov_read_dref },
-{ MKTAG('e','d','t','s'), mov_read_default },
-{ MKTAG('e','l','s','t'), mov_read_elst },
-{ MKTAG('e','n','d','a'), mov_read_enda },
-{ MKTAG('f','i','e','l'), mov_read_fiel },
-{ MKTAG('f','t','y','p'), mov_read_ftyp },
-{ MKTAG('g','l','b','l'), mov_read_glbl },
-{ MKTAG('h','d','l','r'), mov_read_hdlr },
-{ MKTAG('i','l','s','t'), mov_read_ilst },
-{ MKTAG('j','p','2','h'), mov_read_extradata },
-{ MKTAG('m','d','a','t'), mov_read_mdat },
-{ MKTAG('m','d','h','d'), mov_read_mdhd },
-{ MKTAG('m','d','i','a'), mov_read_default },
-{ MKTAG('m','e','t','a'), mov_read_meta },
-{ MKTAG('m','i','n','f'), mov_read_default },
-{ MKTAG('m','o','o','f'), mov_read_moof },
-{ MKTAG('m','o','o','v'), mov_read_moov },
-{ MKTAG('m','v','e','x'), mov_read_default },
-{ MKTAG('m','v','h','d'), mov_read_mvhd },
-{ MKTAG('S','M','I',' '), mov_read_smi }, /* Sorenson extension ??? */
-{ MKTAG('a','l','a','c'), mov_read_extradata }, /* alac specific atom */
-{ MKTAG('a','v','c','C'), mov_read_glbl },
-{ MKTAG('p','a','s','p'), mov_read_pasp },
-{ MKTAG('s','t','b','l'), mov_read_default },
-{ MKTAG('s','t','c','o'), mov_read_stco },
-{ MKTAG('s','t','p','s'), mov_read_stps },
-{ MKTAG('s','t','r','f'), mov_read_strf },
-{ MKTAG('s','t','s','c'), mov_read_stsc },
-{ MKTAG('s','t','s','d'), mov_read_stsd }, /* sample description */
-{ MKTAG('s','t','s','s'), mov_read_stss }, /* sync sample */
-{ MKTAG('s','t','s','z'), mov_read_stsz }, /* sample size */
-{ MKTAG('s','t','t','s'), mov_read_stts },
-{ MKTAG('s','t','z','2'), mov_read_stsz }, /* compact sample size */
-{ MKTAG('t','k','h','d'), mov_read_tkhd }, /* track header */
-{ MKTAG('t','f','h','d'), mov_read_tfhd }, /* track fragment header */
-{ MKTAG('t','r','a','k'), mov_read_trak },
-{ MKTAG('t','r','a','f'), mov_read_default },
-{ MKTAG('t','r','e','f'), mov_read_default },
-{ MKTAG('c','h','a','p'), mov_read_chap },
-{ MKTAG('t','r','e','x'), mov_read_trex },
-{ MKTAG('t','r','u','n'), mov_read_trun },
-{ MKTAG('u','d','t','a'), mov_read_default },
-{ MKTAG('w','a','v','e'), mov_read_wave },
-{ MKTAG('e','s','d','s'), mov_read_esds },
-{ MKTAG('d','a','c','3'), mov_read_dac3 }, /* AC-3 info */
-{ MKTAG('d','e','c','3'), mov_read_dec3 }, /* EAC-3 info */
-{ MKTAG('w','i','d','e'), mov_read_wide }, /* place holder */
-{ MKTAG('w','f','e','x'), mov_read_wfex },
-{ MKTAG('c','m','o','v'), mov_read_cmov },
-{ MKTAG('c','h','a','n'), mov_read_chan }, /* channel layout */
-{ MKTAG('d','v','c','1'), mov_read_dvc1 },
-{ MKTAG('s','b','g','p'), mov_read_sbgp },
-{ MKTAG('h','v','c','C'), mov_read_glbl },
-{ 0, NULL }
-};
-
-static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-{
-    int64_t total_size = 0;
-    MOVAtom a;
-    int i;
-
-    if (atom.size < 0)
-        atom.size = INT64_MAX;
-    while (total_size + 8 < atom.size && !pb->eof_reached) {
-        int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
-        a.size = atom.size;
-        a.type=0;
-        if (atom.size >= 8) {
-            a.size = avio_rb32(pb);
-            a.type = avio_rl32(pb);
-        }
-        av_dlog(c->fc, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
-                a.type, (char*)&a.type, (char*)&atom.type, a.size, total_size, atom.size);
-        total_size += 8;
-        if (a.size == 1) { /* 64 bit extended size */
-            a.size = avio_rb64(pb) - 8;
-            total_size += 8;
-        }
-        if (a.size == 0) {
-            a.size = atom.size - total_size;
-            if (a.size <= 8)
-                break;
-        }
-        a.size -= 8;
-        if (a.size < 0)
-            break;
-        a.size = FFMIN(a.size, atom.size - total_size);
-
-        for (i = 0; mov_default_parse_table[i].type; i++)
-            if (mov_default_parse_table[i].type == a.type) {
-                parse = mov_default_parse_table[i].parse;
-                break;
-            }
-
-        // container is user data
-        if (!parse && (atom.type == MKTAG('u','d','t','a') ||
-                       atom.type == MKTAG('i','l','s','t')))
-            parse = mov_read_udta_string;
-
-        if (!parse) { /* skip leaf atoms data */
-            avio_skip(pb, a.size);
-        } else {
-            int64_t start_pos = avio_tell(pb);
-            int64_t left;
-            int err = parse(c, pb, a);
-            if (err < 0)
-                return err;
-            if (c->found_moov && c->found_mdat &&
-                ((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) ||
-                 start_pos + a.size == avio_size(pb))) {
-                if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX)
-                    c->next_root_atom = start_pos + a.size;
-                return 0;
-            }
-            left = a.size - avio_tell(pb) + start_pos;
-            if (left > 0) /* skip garbage at atom end */
-                avio_skip(pb, left);
-            else if (left < 0) {
-                av_log(c->fc, AV_LOG_WARNING,
-                       "overread end of atom '%.4s' by %"PRId64" bytes\n",
-                       (char*)&a.type, -left);
-                avio_seek(pb, left, SEEK_CUR);
-            }
-        }
-
-        total_size += a.size;
-    }
-
-    if (total_size < atom.size && atom.size < 0x7ffff)
-        avio_skip(pb, atom.size - total_size);
-
-    return 0;
-}
-
-static int mov_probe(AVProbeData *p)
-{
-    unsigned int offset;
-    uint32_t tag;
-    int score = 0;
-
-    /* check file header */
-    offset = 0;
-    for (;;) {
-        /* ignore invalid offset */
-        if ((offset + 8) > (unsigned int)p->buf_size)
-            return score;
-        tag = AV_RL32(p->buf + offset + 4);
-        switch(tag) {
-        /* check for obvious tags */
-        case MKTAG('j','P',' ',' '): /* jpeg 2000 signature */
-        case MKTAG('m','o','o','v'):
-        case MKTAG('m','d','a','t'):
-        case MKTAG('p','n','o','t'): /* detect movs with preview pics like ew.mov and april.mov */
-        case MKTAG('u','d','t','a'): /* Packet Video PVAuthor adds this and a lot of more junk */
-        case MKTAG('f','t','y','p'):
-            return AVPROBE_SCORE_MAX;
-        /* those are more common words, so rate then a bit less */
-        case MKTAG('e','d','i','w'): /* xdcam files have reverted first tags */
-        case MKTAG('w','i','d','e'):
-        case MKTAG('f','r','e','e'):
-        case MKTAG('j','u','n','k'):
-        case MKTAG('p','i','c','t'):
-            return AVPROBE_SCORE_MAX - 5;
-        case MKTAG(0x82,0x82,0x7f,0x7d):
-        case MKTAG('s','k','i','p'):
-        case MKTAG('u','u','i','d'):
-        case MKTAG('p','r','f','l'):
-            offset = AV_RB32(p->buf+offset) + offset;
-            /* if we only find those cause probedata is too small at least rate them */
-            score = AVPROBE_SCORE_EXTENSION;
-            break;
-        default:
-            /* unrecognized tag */
-            return score;
-        }
-    }
-}
-
-// must be done after parsing all trak because there's no order requirement
-static void mov_read_chapters(AVFormatContext *s)
-{
-    MOVContext *mov = s->priv_data;
-    AVStream *st = NULL;
-    MOVStreamContext *sc;
-    int64_t cur_pos;
-    int i;
-
-    for (i = 0; i < s->nb_streams; i++)
-        if (s->streams[i]->id == mov->chapter_track) {
-            st = s->streams[i];
-            break;
-        }
-    if (!st) {
-        av_log(s, AV_LOG_ERROR, "Referenced QT chapter track not found\n");
-        return;
-    }
-
-    st->discard = AVDISCARD_ALL;
-    sc = st->priv_data;
-    cur_pos = avio_tell(sc->pb);
-
-    for (i = 0; i < st->nb_index_entries; i++) {
-        AVIndexEntry *sample = &st->index_entries[i];
-        int64_t end = i+1 < st->nb_index_entries ? st->index_entries[i+1].timestamp : st->duration;
-        uint8_t *title;
-        uint16_t ch;
-        int len, title_len;
-
-        if (avio_seek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {
-            av_log(s, AV_LOG_ERROR, "Chapter %d not found in file\n", i);
-            goto finish;
-        }
-
-        // the first two bytes are the length of the title
-        len = avio_rb16(sc->pb);
-        if (len > sample->size-2)
-            continue;
-        title_len = 2*len + 1;
-        if (!(title = av_mallocz(title_len)))
-            goto finish;
-
-        // The samples could theoretically be in any encoding if there's an encd
-        // atom following, but in practice are only utf-8 or utf-16, distinguished
-        // instead by the presence of a BOM
-        if (!len) {
-            title[0] = 0;
-        } else {
-            ch = avio_rb16(sc->pb);
-            if (ch == 0xfeff)
-                avio_get_str16be(sc->pb, len, title, title_len);
-            else if (ch == 0xfffe)
-                avio_get_str16le(sc->pb, len, title, title_len);
-            else {
-                AV_WB16(title, ch);
-                if (len == 1 || len == 2)
-                    title[len] = 0;
-                else
-                    avio_get_str(sc->pb, len - 2, title + 2, title_len - 2);
-            }
-        }
-
-        avpriv_new_chapter(s, i, st->time_base, sample->timestamp, end, title);
-        av_freep(&title);
-    }
-finish:
-    avio_seek(sc->pb, cur_pos, SEEK_SET);
-}
-
-static int mov_read_close(AVFormatContext *s)
-{
-    MOVContext *mov = s->priv_data;
-    int i, j;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        MOVStreamContext *sc = st->priv_data;
-
-        av_freep(&sc->ctts_data);
-        for (j = 0; j < sc->drefs_count; j++) {
-            av_freep(&sc->drefs[j].path);
-            av_freep(&sc->drefs[j].dir);
-        }
-        av_freep(&sc->drefs);
-        if (sc->pb && sc->pb != s->pb)
-            avio_close(sc->pb);
-
-        av_freep(&sc->chunk_offsets);
-        av_freep(&sc->stsc_data);
-        av_freep(&sc->sample_sizes);
-        av_freep(&sc->keyframes);
-        av_freep(&sc->stts_data);
-        av_freep(&sc->stps_data);
-        av_freep(&sc->rap_group);
-    }
-
-    if (mov->dv_demux) {
-        for (i = 0; i < mov->dv_fctx->nb_streams; i++) {
-            av_freep(&mov->dv_fctx->streams[i]->codec);
-            av_freep(&mov->dv_fctx->streams[i]);
-        }
-        av_freep(&mov->dv_fctx);
-        av_freep(&mov->dv_demux);
-    }
-
-    av_freep(&mov->trex_data);
-
-    return 0;
-}
-
-static int mov_read_header(AVFormatContext *s)
-{
-    MOVContext *mov = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int err;
-    MOVAtom atom = { AV_RL32("root") };
-
-    mov->fc = s;
-    /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */
-    if (pb->seekable)
-        atom.size = avio_size(pb);
-    else
-        atom.size = INT64_MAX;
-
-    /* check MOV header */
-    if ((err = mov_read_default(mov, pb, atom)) < 0) {
-        av_log(s, AV_LOG_ERROR, "error reading header: %d\n", err);
-        mov_read_close(s);
-        return err;
-    }
-    if (!mov->found_moov) {
-        av_log(s, AV_LOG_ERROR, "moov atom not found\n");
-        mov_read_close(s);
-        return AVERROR_INVALIDDATA;
-    }
-    av_dlog(mov->fc, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb));
-
-    if (pb->seekable && mov->chapter_track > 0)
-        mov_read_chapters(s);
-
-    if (mov->trex_data) {
-        int i;
-        for (i = 0; i < s->nb_streams; i++) {
-            AVStream *st = s->streams[i];
-            MOVStreamContext *sc = st->priv_data;
-            if (st->duration > 0)
-                st->codec->bit_rate = sc->data_size * 8 * sc->time_scale / st->duration;
-        }
-    }
-
-    return 0;
-}
-
-static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
-{
-    AVIndexEntry *sample = NULL;
-    int64_t best_dts = INT64_MAX;
-    int i;
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *avst = s->streams[i];
-        MOVStreamContext *msc = avst->priv_data;
-        if (msc->pb && msc->current_sample < avst->nb_index_entries) {
-            AVIndexEntry *current_sample = &avst->index_entries[msc->current_sample];
-            int64_t dts = av_rescale(current_sample->timestamp, AV_TIME_BASE, msc->time_scale);
-            av_dlog(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
-            if (!sample || (!s->pb->seekable && current_sample->pos < sample->pos) ||
-                (s->pb->seekable &&
-                 ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&
-                 ((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) ||
-                  (FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts)))))) {
-                sample = current_sample;
-                best_dts = dts;
-                *st = avst;
-            }
-        }
-    }
-    return sample;
-}
-
-static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MOVContext *mov = s->priv_data;
-    MOVStreamContext *sc;
-    AVIndexEntry *sample;
-    AVStream *st = NULL;
-    int ret;
- retry:
-    sample = mov_find_next_sample(s, &st);
-    if (!sample) {
-        mov->found_mdat = 0;
-        if (!mov->next_root_atom)
-            return AVERROR_EOF;
-        avio_seek(s->pb, mov->next_root_atom, SEEK_SET);
-        mov->next_root_atom = 0;
-        if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
-            s->pb->eof_reached)
-            return AVERROR_EOF;
-        av_dlog(s, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));
-        goto retry;
-    }
-    sc = st->priv_data;
-    /* must be done just before reading, to avoid infinite loop on sample */
-    sc->current_sample++;
-
-    if (st->discard != AVDISCARD_ALL) {
-        if (avio_seek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {
-            av_log(mov->fc, AV_LOG_ERROR, "stream %d, offset 0x%"PRIx64": partial file\n",
-                   sc->ffindex, sample->pos);
-            return AVERROR_INVALIDDATA;
-        }
-        ret = av_get_packet(sc->pb, pkt, sample->size);
-        if (ret < 0)
-            return ret;
-        if (sc->has_palette) {
-            uint8_t *pal;
-
-            pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, AVPALETTE_SIZE);
-            if (!pal) {
-                av_log(mov->fc, AV_LOG_ERROR, "Cannot append palette to packet\n");
-            } else {
-                memcpy(pal, sc->palette, AVPALETTE_SIZE);
-                sc->has_palette = 0;
-            }
-        }
-#if CONFIG_DV_DEMUXER
-        if (mov->dv_demux && sc->dv_audio_container) {
-            avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size);
-            av_free(pkt->data);
-            pkt->size = 0;
-            ret = avpriv_dv_get_packet(mov->dv_demux, pkt);
-            if (ret < 0)
-                return ret;
-        }
-#endif
-    }
-
-    pkt->stream_index = sc->ffindex;
-    pkt->dts = sample->timestamp;
-    if (sc->ctts_data && sc->ctts_index < sc->ctts_count) {
-        pkt->pts = pkt->dts + sc->dts_shift + sc->ctts_data[sc->ctts_index].duration;
-        /* update ctts context */
-        sc->ctts_sample++;
-        if (sc->ctts_index < sc->ctts_count &&
-            sc->ctts_data[sc->ctts_index].count == sc->ctts_sample) {
-            sc->ctts_index++;
-            sc->ctts_sample = 0;
-        }
-        if (sc->wrong_dts)
-            pkt->dts = AV_NOPTS_VALUE;
-    } else {
-        int64_t next_dts = (sc->current_sample < st->nb_index_entries) ?
-            st->index_entries[sc->current_sample].timestamp : st->duration;
-        pkt->duration = next_dts - pkt->dts;
-        pkt->pts = pkt->dts;
-    }
-    if (st->discard == AVDISCARD_ALL)
-        goto retry;
-    pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? AV_PKT_FLAG_KEY : 0;
-    pkt->pos = sample->pos;
-    av_dlog(s, "stream %d, pts %"PRId64", dts %"PRId64", pos 0x%"PRIx64", duration %d\n",
-            pkt->stream_index, pkt->pts, pkt->dts, pkt->pos, pkt->duration);
-    return 0;
-}
-
-static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, int flags)
-{
-    MOVStreamContext *sc = st->priv_data;
-    int sample, time_sample;
-    int i;
-
-    sample = av_index_search_timestamp(st, timestamp, flags);
-    av_dlog(s, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
-    if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)
-        sample = 0;
-    if (sample < 0) /* not sure what to do */
-        return AVERROR_INVALIDDATA;
-    sc->current_sample = sample;
-    av_dlog(s, "stream %d, found sample %d\n", st->index, sc->current_sample);
-    /* adjust ctts index */
-    if (sc->ctts_data) {
-        time_sample = 0;
-        for (i = 0; i < sc->ctts_count; i++) {
-            int next = time_sample + sc->ctts_data[i].count;
-            if (next > sc->current_sample) {
-                sc->ctts_index = i;
-                sc->ctts_sample = sc->current_sample - time_sample;
-                break;
-            }
-            time_sample = next;
-        }
-    }
-    return sample;
-}
-
-static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags)
-{
-    AVStream *st;
-    int64_t seek_timestamp, timestamp;
-    int sample;
-    int i;
-
-    if (stream_index >= s->nb_streams)
-        return AVERROR_INVALIDDATA;
-    if (sample_time < 0)
-        sample_time = 0;
-
-    st = s->streams[stream_index];
-    sample = mov_seek_stream(s, st, sample_time, flags);
-    if (sample < 0)
-        return sample;
-
-    /* adjust seek timestamp to found sample timestamp */
-    seek_timestamp = st->index_entries[sample].timestamp;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        st = s->streams[i];
-        if (stream_index == i)
-            continue;
-
-        timestamp = av_rescale_q(seek_timestamp, s->streams[stream_index]->time_base, st->time_base);
-        mov_seek_stream(s, st, timestamp, flags);
-    }
-    return 0;
-}
-
-AVInputFormat ff_mov_demuxer = {
-    .name           = "mov,mp4,m4a,3gp,3g2,mj2",
-    .long_name      = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
-    .priv_data_size = sizeof(MOVContext),
-    .read_probe     = mov_probe,
-    .read_header    = mov_read_header,
-    .read_packet    = mov_read_packet,
-    .read_close     = mov_read_close,
-    .read_seek      = mov_read_seek,
-};
diff --git a/deps/libav/libavformat/mov_chan.c b/deps/libav/libavformat/mov_chan.c
deleted file mode 100644
index aa7ba10..0000000
--- a/deps/libav/libavformat/mov_chan.c
+++ /dev/null
@@ -1,589 +0,0 @@
-/*
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * mov 'chan' tag reading/writing.
- * @author Justin Ruggles
- */
-
-#include <stdint.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavcodec/avcodec.h"
-#include "mov_chan.h"
-
-/**
- * Channel Layout Tag
- * This tells which channels are present in the audio stream and the order in
- * which they appear.
- *
- * @note We're using the channel layout tag to indicate channel order
- *       when the value is greater than 0x10000. The Apple documentation has
- *       some contradictions as to how this is actually supposed to be handled.
- *
- *       Core Audio File Format Spec:
- *           "The high 16 bits indicates a specific ordering of the channels."
- *       Core Audio Data Types Reference:
- *           "These identifiers specify the channels included in a layout but
- *            do not specify a particular ordering of those channels."
- */
-enum MovChannelLayoutTag {
-    MOV_CH_LAYOUT_UNKNOWN               = 0xFFFF0000,
-    MOV_CH_LAYOUT_USE_DESCRIPTIONS      = (  0 << 16) | 0,
-    MOV_CH_LAYOUT_USE_BITMAP            = (  1 << 16) | 0,
-    MOV_CH_LAYOUT_DISCRETEINORDER       = (147 << 16) | 0,
-    MOV_CH_LAYOUT_MONO                  = (100 << 16) | 1,
-    MOV_CH_LAYOUT_STEREO                = (101 << 16) | 2,
-    MOV_CH_LAYOUT_STEREOHEADPHONES      = (102 << 16) | 2,
-    MOV_CH_LAYOUT_MATRIXSTEREO          = (103 << 16) | 2,
-    MOV_CH_LAYOUT_MIDSIDE               = (104 << 16) | 2,
-    MOV_CH_LAYOUT_XY                    = (105 << 16) | 2,
-    MOV_CH_LAYOUT_BINAURAL              = (106 << 16) | 2,
-    MOV_CH_LAYOUT_AMBISONIC_B_FORMAT    = (107 << 16) | 4,
-    MOV_CH_LAYOUT_QUADRAPHONIC          = (108 << 16) | 4,
-    MOV_CH_LAYOUT_PENTAGONAL            = (109 << 16) | 5,
-    MOV_CH_LAYOUT_HEXAGONAL             = (110 << 16) | 6,
-    MOV_CH_LAYOUT_OCTAGONAL             = (111 << 16) | 8,
-    MOV_CH_LAYOUT_CUBE                  = (112 << 16) | 8,
-    MOV_CH_LAYOUT_MPEG_3_0_A            = (113 << 16) | 3,
-    MOV_CH_LAYOUT_MPEG_3_0_B            = (114 << 16) | 3,
-    MOV_CH_LAYOUT_MPEG_4_0_A            = (115 << 16) | 4,
-    MOV_CH_LAYOUT_MPEG_4_0_B            = (116 << 16) | 4,
-    MOV_CH_LAYOUT_MPEG_5_0_A            = (117 << 16) | 5,
-    MOV_CH_LAYOUT_MPEG_5_0_B            = (118 << 16) | 5,
-    MOV_CH_LAYOUT_MPEG_5_0_C            = (119 << 16) | 5,
-    MOV_CH_LAYOUT_MPEG_5_0_D            = (120 << 16) | 5,
-    MOV_CH_LAYOUT_MPEG_5_1_A            = (121 << 16) | 6,
-    MOV_CH_LAYOUT_MPEG_5_1_B            = (122 << 16) | 6,
-    MOV_CH_LAYOUT_MPEG_5_1_C            = (123 << 16) | 6,
-    MOV_CH_LAYOUT_MPEG_5_1_D            = (124 << 16) | 6,
-    MOV_CH_LAYOUT_MPEG_6_1_A            = (125 << 16) | 7,
-    MOV_CH_LAYOUT_MPEG_7_1_A            = (126 << 16) | 8,
-    MOV_CH_LAYOUT_MPEG_7_1_B            = (127 << 16) | 8,
-    MOV_CH_LAYOUT_MPEG_7_1_C            = (128 << 16) | 8,
-    MOV_CH_LAYOUT_EMAGIC_DEFAULT_7_1    = (129 << 16) | 8,
-    MOV_CH_LAYOUT_SMPTE_DTV             = (130 << 16) | 8,
-    MOV_CH_LAYOUT_ITU_2_1               = (131 << 16) | 3,
-    MOV_CH_LAYOUT_ITU_2_2               = (132 << 16) | 4,
-    MOV_CH_LAYOUT_DVD_4                 = (133 << 16) | 3,
-    MOV_CH_LAYOUT_DVD_5                 = (134 << 16) | 4,
-    MOV_CH_LAYOUT_DVD_6                 = (135 << 16) | 5,
-    MOV_CH_LAYOUT_DVD_10                = (136 << 16) | 4,
-    MOV_CH_LAYOUT_DVD_11                = (137 << 16) | 5,
-    MOV_CH_LAYOUT_DVD_18                = (138 << 16) | 5,
-    MOV_CH_LAYOUT_AUDIOUNIT_6_0         = (139 << 16) | 6,
-    MOV_CH_LAYOUT_AUDIOUNIT_7_0         = (140 << 16) | 7,
-    MOV_CH_LAYOUT_AUDIOUNIT_7_0_FRONT   = (148 << 16) | 7,
-    MOV_CH_LAYOUT_AAC_6_0               = (141 << 16) | 6,
-    MOV_CH_LAYOUT_AAC_6_1               = (142 << 16) | 7,
-    MOV_CH_LAYOUT_AAC_7_0               = (143 << 16) | 7,
-    MOV_CH_LAYOUT_AAC_OCTAGONAL         = (144 << 16) | 8,
-    MOV_CH_LAYOUT_TMH_10_2_STD          = (145 << 16) | 16,
-    MOV_CH_LAYOUT_TMH_10_2_FULL         = (146 << 16) | 21,
-    MOV_CH_LAYOUT_AC3_1_0_1             = (149 << 16) | 2,
-    MOV_CH_LAYOUT_AC3_3_0               = (150 << 16) | 3,
-    MOV_CH_LAYOUT_AC3_3_1               = (151 << 16) | 4,
-    MOV_CH_LAYOUT_AC3_3_0_1             = (152 << 16) | 4,
-    MOV_CH_LAYOUT_AC3_2_1_1             = (153 << 16) | 4,
-    MOV_CH_LAYOUT_AC3_3_1_1             = (154 << 16) | 5,
-    MOV_CH_LAYOUT_EAC3_6_0_A            = (155 << 16) | 6,
-    MOV_CH_LAYOUT_EAC3_7_0_A            = (156 << 16) | 7,
-    MOV_CH_LAYOUT_EAC3_6_1_A            = (157 << 16) | 7,
-    MOV_CH_LAYOUT_EAC3_6_1_B            = (158 << 16) | 7,
-    MOV_CH_LAYOUT_EAC3_6_1_C            = (159 << 16) | 7,
-    MOV_CH_LAYOUT_EAC3_7_1_A            = (160 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_B            = (161 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_C            = (162 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_D            = (163 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_E            = (164 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_F            = (165 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_G            = (166 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_H            = (167 << 16) | 8,
-    MOV_CH_LAYOUT_DTS_3_1               = (168 << 16) | 4,
-    MOV_CH_LAYOUT_DTS_4_1               = (169 << 16) | 5,
-    MOV_CH_LAYOUT_DTS_6_0_A             = (170 << 16) | 6,
-    MOV_CH_LAYOUT_DTS_6_0_B             = (171 << 16) | 6,
-    MOV_CH_LAYOUT_DTS_6_0_C             = (172 << 16) | 6,
-    MOV_CH_LAYOUT_DTS_6_1_A             = (173 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_6_1_B             = (174 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_6_1_C             = (175 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_6_1_D             = (182 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_7_0               = (176 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_7_1               = (177 << 16) | 8,
-    MOV_CH_LAYOUT_DTS_8_0_A             = (178 << 16) | 8,
-    MOV_CH_LAYOUT_DTS_8_0_B             = (179 << 16) | 8,
-    MOV_CH_LAYOUT_DTS_8_1_A             = (180 << 16) | 9,
-    MOV_CH_LAYOUT_DTS_8_1_B             = (181 << 16) | 9,
-};
-
-struct MovChannelLayoutMap {
-    uint32_t tag;
-    uint64_t layout;
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_misc[] = {
-    { MOV_CH_LAYOUT_USE_DESCRIPTIONS,   0 },
-    { MOV_CH_LAYOUT_USE_BITMAP,         0 },
-    { MOV_CH_LAYOUT_DISCRETEINORDER,    0 },
-    { MOV_CH_LAYOUT_UNKNOWN,            0 },
-    { MOV_CH_LAYOUT_TMH_10_2_STD,       0 }, // L,   R,  C,    Vhc, Lsd, Rsd,
-                                             // Ls,  Rs, Vhl,  Vhr, Lw,  Rw,
-                                             // Csd, Cs, LFE1, LFE2
-    { MOV_CH_LAYOUT_TMH_10_2_FULL,      0 }, // L,   R,  C,    Vhc,  Lsd, Rsd,
-                                             // Ls,  Rs, Vhl,  Vhr,  Lw,  Rw,
-                                             // Csd, Cs, LFE1, LFE2, Lc,  Rc,
-                                             // HI,  VI, Haptic
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_1ch[] = {
-    { MOV_CH_LAYOUT_MONO,               AV_CH_LAYOUT_MONO }, // C
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_2ch[] = {
-    { MOV_CH_LAYOUT_STEREO,             AV_CH_LAYOUT_STEREO         }, // L, R
-    { MOV_CH_LAYOUT_STEREOHEADPHONES,   AV_CH_LAYOUT_STEREO         }, // L, R
-    { MOV_CH_LAYOUT_BINAURAL,           AV_CH_LAYOUT_STEREO         }, // L, R
-    { MOV_CH_LAYOUT_MIDSIDE,            AV_CH_LAYOUT_STEREO         }, // C, sides
-    { MOV_CH_LAYOUT_XY,                 AV_CH_LAYOUT_STEREO         }, // X (left), Y (right)
-
-    { MOV_CH_LAYOUT_MATRIXSTEREO,       AV_CH_LAYOUT_STEREO_DOWNMIX }, // Lt, Rt
-
-    { MOV_CH_LAYOUT_AC3_1_0_1,          AV_CH_LAYOUT_MONO |            // C, LFE
-                                        AV_CH_LOW_FREQUENCY         },
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_3ch[] = {
-    { MOV_CH_LAYOUT_MPEG_3_0_A,         AV_CH_LAYOUT_SURROUND }, // L, R, C
-    { MOV_CH_LAYOUT_MPEG_3_0_B,         AV_CH_LAYOUT_SURROUND }, // C, L, R
-    { MOV_CH_LAYOUT_AC3_3_0,            AV_CH_LAYOUT_SURROUND }, // L, C, R
-
-    { MOV_CH_LAYOUT_ITU_2_1,            AV_CH_LAYOUT_2_1      }, // L, R, Cs
-
-    { MOV_CH_LAYOUT_DVD_4,              AV_CH_LAYOUT_2POINT1  }, // L, R, LFE
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_4ch[] = {
-    { MOV_CH_LAYOUT_AMBISONIC_B_FORMAT, 0 },                    // W, X, Y, Z
-
-    { MOV_CH_LAYOUT_QUADRAPHONIC,       AV_CH_LAYOUT_QUAD    }, // L, R, Rls, Rrs
-
-    { MOV_CH_LAYOUT_MPEG_4_0_A,         AV_CH_LAYOUT_4POINT0 }, // L, R, C, Cs
-    { MOV_CH_LAYOUT_MPEG_4_0_B,         AV_CH_LAYOUT_4POINT0 }, // C, L, R, Cs
-    { MOV_CH_LAYOUT_AC3_3_1,            AV_CH_LAYOUT_4POINT0 }, // L, C, R, Cs
-
-    { MOV_CH_LAYOUT_ITU_2_2,            AV_CH_LAYOUT_2_2     }, // L, R, Ls, Rs
-
-    { MOV_CH_LAYOUT_DVD_5,              AV_CH_LAYOUT_2_1 |      // L, R, LFE, Cs
-                                        AV_CH_LOW_FREQUENCY  },
-    { MOV_CH_LAYOUT_AC3_2_1_1,          AV_CH_LAYOUT_2_1 |      // L, R, Cs, LFE
-                                        AV_CH_LOW_FREQUENCY  },
-
-    { MOV_CH_LAYOUT_DVD_10,             AV_CH_LAYOUT_3POINT1 }, // L, R, C, LFE
-    { MOV_CH_LAYOUT_AC3_3_0_1,          AV_CH_LAYOUT_3POINT1 }, // L, C, R, LFE
-    { MOV_CH_LAYOUT_DTS_3_1,            AV_CH_LAYOUT_3POINT1 }, // C, L, R, LFE
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_5ch[] = {
-    { MOV_CH_LAYOUT_PENTAGONAL,         AV_CH_LAYOUT_5POINT0_BACK }, // L, R, Rls, Rrs, C
-
-    { MOV_CH_LAYOUT_MPEG_5_0_A,         AV_CH_LAYOUT_5POINT0 },      // L, R, C,  Ls, Rs
-    { MOV_CH_LAYOUT_MPEG_5_0_B,         AV_CH_LAYOUT_5POINT0 },      // L, R, Ls, Rs, C
-    { MOV_CH_LAYOUT_MPEG_5_0_C,         AV_CH_LAYOUT_5POINT0 },      // L, C, R,  Ls, Rs
-    { MOV_CH_LAYOUT_MPEG_5_0_D,         AV_CH_LAYOUT_5POINT0 },      // C, L, R,  Ls, Rs
-
-    { MOV_CH_LAYOUT_DVD_6,              AV_CH_LAYOUT_2_2 |           // L, R, LFE, Ls, Rs
-                                        AV_CH_LOW_FREQUENCY },
-    { MOV_CH_LAYOUT_DVD_18,             AV_CH_LAYOUT_2_2 |           // L, R, Ls, Rs, LFE
-                                        AV_CH_LOW_FREQUENCY },
-
-    { MOV_CH_LAYOUT_DVD_11,             AV_CH_LAYOUT_4POINT1 },      // L, R, C, LFE, Cs
-    { MOV_CH_LAYOUT_AC3_3_1_1,          AV_CH_LAYOUT_4POINT1 },      // L, C, R, Cs,  LFE
-    { MOV_CH_LAYOUT_DTS_4_1,            AV_CH_LAYOUT_4POINT1 },      // C, L, R, Cs,  LFE
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_6ch[] = {
-    { MOV_CH_LAYOUT_HEXAGONAL,          AV_CH_LAYOUT_HEXAGONAL },      // L, R,  Rls, Rrs, C,   Cs
-    { MOV_CH_LAYOUT_DTS_6_0_C,          AV_CH_LAYOUT_HEXAGONAL },      // C, Cs, L,   R,   Rls, Rrs
-
-    { MOV_CH_LAYOUT_MPEG_5_1_A,         AV_CH_LAYOUT_5POINT1 },        // L, R, C,  LFE, Ls, Rs
-    { MOV_CH_LAYOUT_MPEG_5_1_B,         AV_CH_LAYOUT_5POINT1 },        // L, R, Ls, Rs,  C,  LFE
-    { MOV_CH_LAYOUT_MPEG_5_1_C,         AV_CH_LAYOUT_5POINT1 },        // L, C, R,  Ls,  Rs, LFE
-    { MOV_CH_LAYOUT_MPEG_5_1_D,         AV_CH_LAYOUT_5POINT1 },        // C, L, R,  Ls,  Rs, LFE
-
-    { MOV_CH_LAYOUT_AUDIOUNIT_6_0,      AV_CH_LAYOUT_6POINT0 },        // L, R, Ls, Rs, C,  Cs
-    { MOV_CH_LAYOUT_AAC_6_0,            AV_CH_LAYOUT_6POINT0 },        // C, L, R,  Ls, Rs, Cs
-    { MOV_CH_LAYOUT_EAC3_6_0_A,         AV_CH_LAYOUT_6POINT0 },        // L, C, R,  Ls, Rs, Cs
-
-    { MOV_CH_LAYOUT_DTS_6_0_A,          AV_CH_LAYOUT_6POINT0_FRONT },  // Lc, Rc, L, R, Ls, Rs
-
-    { MOV_CH_LAYOUT_DTS_6_0_B,          AV_CH_LAYOUT_5POINT0_BACK |    // C, L, R, Rls, Rrs, Ts
-                                        AV_CH_TOP_CENTER },
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_7ch[] = {
-    { MOV_CH_LAYOUT_MPEG_6_1_A,          AV_CH_LAYOUT_6POINT1 },        // L, R, C, LFE, Ls, Rs,  Cs
-    { MOV_CH_LAYOUT_AAC_6_1,             AV_CH_LAYOUT_6POINT1 },        // C, L, R, Ls,  Rs, Cs,  LFE
-    { MOV_CH_LAYOUT_EAC3_6_1_A,          AV_CH_LAYOUT_6POINT1 },        // L, C, R, Ls,  Rs, LFE, Cs
-    { MOV_CH_LAYOUT_DTS_6_1_D,           AV_CH_LAYOUT_6POINT1 },        // C, L, R, Ls,  Rs, LFE, Cs
-
-    { MOV_CH_LAYOUT_AUDIOUNIT_7_0,       AV_CH_LAYOUT_7POINT0 },        // L, R, Ls, Rs, C,  Rls, Rrs
-    { MOV_CH_LAYOUT_AAC_7_0,             AV_CH_LAYOUT_7POINT0 },        // C, L, R,  Ls, Rs, Rls, Rrs
-    { MOV_CH_LAYOUT_EAC3_7_0_A,          AV_CH_LAYOUT_7POINT0 },        // L, C, R,  Ls, Rs, Rls, Rrs
-
-    { MOV_CH_LAYOUT_AUDIOUNIT_7_0_FRONT, AV_CH_LAYOUT_7POINT0_FRONT },  // L,  R, Ls, Rs, C, Lc, Rc
-    { MOV_CH_LAYOUT_DTS_7_0,             AV_CH_LAYOUT_7POINT0_FRONT },  // Lc, C, Rc, L,  R, Ls, Rs
-
-    { MOV_CH_LAYOUT_EAC3_6_1_B,          AV_CH_LAYOUT_5POINT1 |         // L, C, R, Ls, Rs, LFE, Ts
-                                         AV_CH_TOP_CENTER },
-
-    { MOV_CH_LAYOUT_EAC3_6_1_C,          AV_CH_LAYOUT_5POINT1 |         // L, C, R, Ls, Rs, LFE, Vhc
-                                         AV_CH_TOP_FRONT_CENTER },
-
-    { MOV_CH_LAYOUT_DTS_6_1_A,           AV_CH_LAYOUT_6POINT1_FRONT },  // Lc, Rc, L, R, Ls, Rs, LFE
-
-    { MOV_CH_LAYOUT_DTS_6_1_B,           AV_CH_LAYOUT_5POINT1_BACK |    // C, L, R, Rls, Rrs, Ts, LFE
-                                         AV_CH_TOP_CENTER },
-
-    { MOV_CH_LAYOUT_DTS_6_1_C,           AV_CH_LAYOUT_6POINT1_BACK },   // C, Cs, L, R, Rls, Rrs, LFE
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_8ch[] = {
-    { MOV_CH_LAYOUT_OCTAGONAL,           AV_CH_LAYOUT_OCTAGONAL },      // L, R, Rls, Rrs, C,  Cs,  Ls,  Rs
-    { MOV_CH_LAYOUT_AAC_OCTAGONAL,       AV_CH_LAYOUT_OCTAGONAL },      // C, L, R,   Ls,  Rs, Rls, Rrs, Cs
-
-    { MOV_CH_LAYOUT_CUBE,                AV_CH_LAYOUT_QUAD     |        // L, R, Rls, Rrs, Vhl, Vhr, Rlt, Rrt
-                                         AV_CH_TOP_FRONT_LEFT  |
-                                         AV_CH_TOP_FRONT_RIGHT |
-                                         AV_CH_TOP_BACK_LEFT   |
-                                         AV_CH_TOP_BACK_RIGHT },
-
-    { MOV_CH_LAYOUT_MPEG_7_1_A,          AV_CH_LAYOUT_7POINT1_WIDE },   // L,  R,  C,  LFE, Ls, Rs,  Lc, Rc
-    { MOV_CH_LAYOUT_MPEG_7_1_B,          AV_CH_LAYOUT_7POINT1_WIDE },   // C,  Lc, Rc, L,   R,  Ls,  Rs, LFE
-    { MOV_CH_LAYOUT_EMAGIC_DEFAULT_7_1,  AV_CH_LAYOUT_7POINT1_WIDE },   // L,  R,  Ls, Rs,  C,  LFE, Lc, Rc
-    { MOV_CH_LAYOUT_EAC3_7_1_B,          AV_CH_LAYOUT_7POINT1_WIDE },   // L,  C,  R,  Ls,  Rs, LFE, Lc, Rc
-    { MOV_CH_LAYOUT_DTS_7_1,             AV_CH_LAYOUT_7POINT1_WIDE },   // Lc, C,  Rc, L,   R,  Ls,  Rs, LFE
-
-    { MOV_CH_LAYOUT_MPEG_7_1_C,          AV_CH_LAYOUT_7POINT1 },        // L, R, C, LFE, Ls, Rs,  Rls, Rrs
-    { MOV_CH_LAYOUT_EAC3_7_1_A,          AV_CH_LAYOUT_7POINT1 },        // L, C, R, Ls,  Rs, LFE, Rls, Rrs
-
-    { MOV_CH_LAYOUT_SMPTE_DTV,           AV_CH_LAYOUT_5POINT1 |         // L, R, C, LFE, Ls, Rs, Lt, Rt
-                                         AV_CH_LAYOUT_STEREO_DOWNMIX },
-
-    { MOV_CH_LAYOUT_EAC3_7_1_C,          AV_CH_LAYOUT_5POINT1        |  // L, C, R, Ls, Rs, LFE, Lsd, Rsd
-                                         AV_CH_SURROUND_DIRECT_LEFT  |
-                                         AV_CH_SURROUND_DIRECT_RIGHT },
-
-    { MOV_CH_LAYOUT_EAC3_7_1_D,          AV_CH_LAYOUT_5POINT1 |         // L, C, R, Ls, Rs, LFE, Lw, Rw
-                                         AV_CH_WIDE_LEFT      |
-                                         AV_CH_WIDE_RIGHT },
-
-    { MOV_CH_LAYOUT_EAC3_7_1_E,          AV_CH_LAYOUT_5POINT1 |         // L, C, R, Ls, Rs, LFE, Vhl, Vhr
-                                         AV_CH_TOP_FRONT_LEFT |
-                                         AV_CH_TOP_FRONT_RIGHT },
-
-    { MOV_CH_LAYOUT_EAC3_7_1_F,          AV_CH_LAYOUT_5POINT1 |         // L, C, R, Ls, Rs, LFE, Cs, Ts
-                                         AV_CH_BACK_CENTER    |
-                                         AV_CH_TOP_CENTER },
-
-    { MOV_CH_LAYOUT_EAC3_7_1_G,          AV_CH_LAYOUT_5POINT1 |         // L, C, R, Ls, Rs, LFE, Cs, Vhc
-                                         AV_CH_BACK_CENTER    |
-                                         AV_CH_TOP_FRONT_CENTER },
-
-    { MOV_CH_LAYOUT_EAC3_7_1_H,          AV_CH_LAYOUT_5POINT1 |         // L, C, R, Ls, Rs, LFE, Ts, Vhc
-                                         AV_CH_TOP_CENTER     |
-                                         AV_CH_TOP_FRONT_CENTER },
-
-    { MOV_CH_LAYOUT_DTS_8_0_A,           AV_CH_LAYOUT_2_2           |   // Lc, Rc, L, R, Ls, Rs, Rls, Rrs
-                                         AV_CH_BACK_LEFT            |
-                                         AV_CH_BACK_RIGHT           |
-                                         AV_CH_FRONT_LEFT_OF_CENTER |
-                                         AV_CH_FRONT_RIGHT_OF_CENTER },
-
-    { MOV_CH_LAYOUT_DTS_8_0_B,           AV_CH_LAYOUT_5POINT0        |  // Lc, C, Rc, L, R, Ls, Cs, Rs
-                                         AV_CH_FRONT_LEFT_OF_CENTER  |
-                                         AV_CH_FRONT_RIGHT_OF_CENTER |
-                                         AV_CH_BACK_CENTER },
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap mov_ch_layout_map_9ch[] = {
-    { MOV_CH_LAYOUT_DTS_8_1_A,           AV_CH_LAYOUT_2_2            | // Lc, Rc, L, R, Ls, Rs, Rls, Rrs, LFE
-                                         AV_CH_BACK_LEFT             |
-                                         AV_CH_BACK_RIGHT            |
-                                         AV_CH_FRONT_LEFT_OF_CENTER  |
-                                         AV_CH_FRONT_RIGHT_OF_CENTER |
-                                         AV_CH_LOW_FREQUENCY },
-
-    { MOV_CH_LAYOUT_DTS_8_1_B,           AV_CH_LAYOUT_7POINT1_WIDE   | // Lc, C, Rc, L, R, Ls, Cs, Rs, LFE
-                                         AV_CH_BACK_CENTER },
-    { 0, 0 },
-};
-
-static const struct MovChannelLayoutMap *mov_ch_layout_map[] = {
-    mov_ch_layout_map_misc,
-    mov_ch_layout_map_1ch,
-    mov_ch_layout_map_2ch,
-    mov_ch_layout_map_3ch,
-    mov_ch_layout_map_4ch,
-    mov_ch_layout_map_5ch,
-    mov_ch_layout_map_6ch,
-    mov_ch_layout_map_7ch,
-    mov_ch_layout_map_8ch,
-    mov_ch_layout_map_9ch,
-};
-
-static const enum MovChannelLayoutTag mov_ch_layouts_aac[] = {
-    MOV_CH_LAYOUT_MONO,
-    MOV_CH_LAYOUT_STEREO,
-    MOV_CH_LAYOUT_AC3_1_0_1,
-    MOV_CH_LAYOUT_MPEG_3_0_B,
-    MOV_CH_LAYOUT_ITU_2_1,
-    MOV_CH_LAYOUT_DVD_4,
-    MOV_CH_LAYOUT_QUADRAPHONIC,
-    MOV_CH_LAYOUT_MPEG_4_0_B,
-    MOV_CH_LAYOUT_ITU_2_2,
-    MOV_CH_LAYOUT_AC3_2_1_1,
-    MOV_CH_LAYOUT_DTS_3_1,
-    MOV_CH_LAYOUT_MPEG_5_0_D,
-    MOV_CH_LAYOUT_DVD_18,
-    MOV_CH_LAYOUT_DTS_4_1,
-    MOV_CH_LAYOUT_MPEG_5_1_D,
-    MOV_CH_LAYOUT_AAC_6_0,
-    MOV_CH_LAYOUT_DTS_6_0_A,
-    MOV_CH_LAYOUT_AAC_6_1,
-    MOV_CH_LAYOUT_AAC_7_0,
-    MOV_CH_LAYOUT_DTS_6_1_A,
-    MOV_CH_LAYOUT_AAC_OCTAGONAL,
-    MOV_CH_LAYOUT_MPEG_7_1_B,
-    MOV_CH_LAYOUT_DTS_8_0_A,
-    0,
-};
-
-static const enum MovChannelLayoutTag mov_ch_layouts_ac3[] = {
-    MOV_CH_LAYOUT_MONO,
-    MOV_CH_LAYOUT_STEREO,
-    MOV_CH_LAYOUT_AC3_1_0_1,
-    MOV_CH_LAYOUT_AC3_3_0,
-    MOV_CH_LAYOUT_ITU_2_1,
-    MOV_CH_LAYOUT_DVD_4,
-    MOV_CH_LAYOUT_AC3_3_1,
-    MOV_CH_LAYOUT_ITU_2_2,
-    MOV_CH_LAYOUT_AC3_2_1_1,
-    MOV_CH_LAYOUT_AC3_3_0_1,
-    MOV_CH_LAYOUT_MPEG_5_0_C,
-    MOV_CH_LAYOUT_DVD_18,
-    MOV_CH_LAYOUT_AC3_3_1_1,
-    MOV_CH_LAYOUT_MPEG_5_1_C,
-    0,
-};
-
-static const enum MovChannelLayoutTag mov_ch_layouts_alac[] = {
-    MOV_CH_LAYOUT_MONO,
-    MOV_CH_LAYOUT_STEREO,
-    MOV_CH_LAYOUT_MPEG_3_0_B,
-    MOV_CH_LAYOUT_MPEG_4_0_B,
-    MOV_CH_LAYOUT_MPEG_5_0_D,
-    MOV_CH_LAYOUT_MPEG_5_1_D,
-    MOV_CH_LAYOUT_AAC_6_1,
-    MOV_CH_LAYOUT_MPEG_7_1_B,
-    0,
-};
-
-static const enum MovChannelLayoutTag mov_ch_layouts_wav[] = {
-    MOV_CH_LAYOUT_MONO,
-    MOV_CH_LAYOUT_STEREO,
-    MOV_CH_LAYOUT_MATRIXSTEREO,
-    MOV_CH_LAYOUT_MPEG_3_0_A,
-    MOV_CH_LAYOUT_QUADRAPHONIC,
-    MOV_CH_LAYOUT_MPEG_5_0_A,
-    MOV_CH_LAYOUT_MPEG_5_1_A,
-    MOV_CH_LAYOUT_MPEG_6_1_A,
-    MOV_CH_LAYOUT_MPEG_7_1_A,
-    MOV_CH_LAYOUT_MPEG_7_1_C,
-    MOV_CH_LAYOUT_SMPTE_DTV,
-};
-
-static const struct {
-    enum AVCodecID codec_id;
-    const enum MovChannelLayoutTag *layouts;
-} mov_codec_ch_layouts[] = {
-    { AV_CODEC_ID_AAC,     mov_ch_layouts_aac      },
-    { AV_CODEC_ID_AC3,     mov_ch_layouts_ac3      },
-    { AV_CODEC_ID_ALAC,    mov_ch_layouts_alac     },
-    { AV_CODEC_ID_PCM_U8,    mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_S8,    mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_S16LE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_S16BE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_S24LE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_S24BE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_S32LE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_S32BE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_F32LE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_F32BE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_F64LE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_PCM_F64BE, mov_ch_layouts_wav    },
-    { AV_CODEC_ID_NONE,    NULL                    },
-};
-
-uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
-{
-    int i, channels;
-    const struct MovChannelLayoutMap *layout_map;
-
-    /* use ff_mov_get_channel_label() to build a layout instead */
-    if (tag == MOV_CH_LAYOUT_USE_DESCRIPTIONS)
-        return 0;
-
-    /* handle the use of the channel bitmap */
-    if (tag == MOV_CH_LAYOUT_USE_BITMAP)
-        return bitmap < 0x40000 ? bitmap : 0;
-
-    /* get the layout map based on the channel count for the specified layout tag */
-    channels = tag & 0xFFFF;
-    if (channels > 9)
-        channels = 0;
-    layout_map = mov_ch_layout_map[channels];
-
-    /* find the channel layout for the specified layout tag */
-    for (i = 0; layout_map[i].tag != 0; i++) {
-        if (layout_map[i].tag == tag)
-            break;
-    }
-    return layout_map[i].layout;
-}
-
-static uint32_t mov_get_channel_label(uint32_t label)
-{
-    if (label == 0)
-        return 0;
-    if (label <= 18)
-        return 1U << (label - 1);
-    if (label == 38)
-        return AV_CH_STEREO_LEFT;
-    if (label == 39)
-        return AV_CH_STEREO_RIGHT;
-    return 0;
-}
-
-uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id,
-                                       uint64_t channel_layout,
-                                       uint32_t *bitmap)
-{
-    int i, j;
-    uint32_t tag = 0;
-    const enum MovChannelLayoutTag *layouts = NULL;
-
-    /* find the layout list for the specified codec */
-    for (i = 0; mov_codec_ch_layouts[i].codec_id != AV_CODEC_ID_NONE; i++) {
-        if (mov_codec_ch_layouts[i].codec_id == codec_id)
-            break;
-    }
-    if (mov_codec_ch_layouts[i].codec_id != AV_CODEC_ID_NONE)
-        layouts = mov_codec_ch_layouts[i].layouts;
-
-    if (layouts) {
-        int channels;
-        const struct MovChannelLayoutMap *layout_map;
-
-        /* get the layout map based on the channel count */
-        channels = av_get_channel_layout_nb_channels(channel_layout);
-        if (channels > 9)
-            channels = 0;
-        layout_map = mov_ch_layout_map[channels];
-
-        /* find the layout tag for the specified channel layout */
-        for (i = 0; layouts[i] != 0; i++) {
-            if ((layouts[i] & 0xFFFF) != channels)
-                continue;
-            for (j = 0; layout_map[j].tag != 0; j++) {
-                if (layout_map[j].tag    == layouts[i] &&
-                    layout_map[j].layout == channel_layout)
-                    break;
-            }
-            if (layout_map[j].tag)
-                break;
-        }
-        tag = layouts[i];
-    }
-
-    /* if no tag was found, use channel bitmap as a backup if possible */
-    if (tag == 0 && channel_layout > 0 && channel_layout < 0x40000) {
-        tag     = MOV_CH_LAYOUT_USE_BITMAP;
-        *bitmap = (uint32_t)channel_layout;
-    } else
-        *bitmap = 0;
-
-    /* TODO: set channel descriptions as a secondary backup */
-
-    return tag;
-}
-
-int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
-                     int64_t size)
-{
-    uint32_t layout_tag, bitmap, num_descr, label_mask;
-    int i;
-
-    if (size < 12)
-        return AVERROR_INVALIDDATA;
-
-    layout_tag = avio_rb32(pb);
-    bitmap     = avio_rb32(pb);
-    num_descr  = avio_rb32(pb);
-
-    av_dlog(s, "chan: layout=%u bitmap=%u num_descr=%u\n",
-            layout_tag, bitmap, num_descr);
-
-    if (size < 12ULL + num_descr * 20ULL)
-        return 0;
-
-    label_mask = 0;
-    for (i = 0; i < num_descr; i++) {
-        uint32_t label;
-        label     = avio_rb32(pb);          // mChannelLabel
-        avio_rb32(pb);                      // mChannelFlags
-        avio_rl32(pb);                      // mCoordinates[0]
-        avio_rl32(pb);                      // mCoordinates[1]
-        avio_rl32(pb);                      // mCoordinates[2]
-        if (layout_tag == 0) {
-            uint32_t mask_incr = mov_get_channel_label(label);
-            if (mask_incr == 0) {
-                label_mask = 0;
-                break;
-            }
-            label_mask |= mask_incr;
-        }
-    }
-    if (layout_tag == 0) {
-        if (label_mask)
-            st->codec->channel_layout = label_mask;
-    } else
-        st->codec->channel_layout = ff_mov_get_channel_layout(layout_tag, bitmap);
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/mov_chan.h b/deps/libav/libavformat/mov_chan.h
deleted file mode 100644
index 3fae939..0000000
--- a/deps/libav/libavformat/mov_chan.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2011 Justin Ruggles
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * mov 'chan' tag reading/writing.
- * @author Justin Ruggles
- */
-
-#ifndef AVFORMAT_MOV_CHAN_H
-#define AVFORMAT_MOV_CHAN_H
-
-#include <stdint.h>
-
-#include "libavcodec/avcodec.h"
-#include "avformat.h"
-
-/**
- * Get the channel layout for the specified channel layout tag.
- *
- * @param[in]  tag     channel layout tag
- * @param[out] bitmap  channel bitmap (only used if needed)
- * @return             channel layout
- */
-uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap);
-
-/**
- * Get the channel layout tag for the specified codec id and channel layout.
- * If the layout tag was not found, use a channel bitmap if possible.
- *
- * @param[in]  codec_id        codec id
- * @param[in]  channel_layout  channel layout
- * @param[out] bitmap          channel bitmap
- * @return                     channel layout tag
- */
-uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id,
-                                       uint64_t channel_layout,
-                                       uint32_t *bitmap);
-
-/**
- * Read 'chan' tag from the input stream.
- *
- * @param s     AVFormatContext
- * @param pb    AVIOContext
- * @param st    The stream to set codec values for
- * @param size  Remaining size in the 'chan' tag
- * @return      0 if ok, or negative AVERROR code on failure
- */
-int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
-                     int64_t size);
-
-#endif /* AVFORMAT_MOV_CHAN_H */
diff --git a/deps/libav/libavformat/movenc.c b/deps/libav/libavformat/movenc.c
deleted file mode 100644
index 0c688f6..0000000
--- a/deps/libav/libavformat/movenc.c
+++ /dev/null
@@ -1,3715 +0,0 @@
-/*
- * MOV, 3GP, MP4 muxer
- * Copyright (c) 2003 Thomas Raivio
- * Copyright (c) 2004 Gildas Bazin <gbazin at videolan dot org>
- * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "movenc.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "riff.h"
-#include "avio.h"
-#include "isom.h"
-#include "avc.h"
-#include "libavcodec/get_bits.h"
-#include "libavcodec/put_bits.h"
-#include "libavcodec/vc1.h"
-#include "internal.h"
-#include "libavutil/avstring.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/dict.h"
-#include "hevc.h"
-#include "rtpenc.h"
-#include "mov_chan.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-static const AVOption options[] = {
-    { "movflags", "MOV muxer flags", offsetof(MOVMuxContext, flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
-    { "rtphint", "Add RTP hint tracks", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_RTP_HINT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
-    { "empty_moov", "Make the initial moov atom empty (not supported by QuickTime)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_EMPTY_MOOV}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
-    { "frag_keyframe", "Fragment at video keyframes", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_FRAG_KEYFRAME}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
-    { "separate_moof", "Write separate moof/mdat atoms for each track", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_SEPARATE_MOOF}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
-    { "frag_custom", "Flush fragments on caller requests", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_FRAG_CUSTOM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
-    { "isml", "Create a live smooth streaming feed (for pushing to a publishing point)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_ISML}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
-    { "faststart", "Run a second pass to put the index (moov atom) at the beginning of the file", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_FASTSTART}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
-    { "omit_tfhd_offset", "Omit the base data offset in tfhd atoms", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_OMIT_TFHD_OFFSET}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
-    FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
-    { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
-    { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM},
-    { "iods_video_profile", "iods video profile atom.", offsetof(MOVMuxContext, iods_video_profile), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM},
-    { "frag_duration", "Maximum fragment duration", offsetof(MOVMuxContext, max_fragment_duration), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
-    { "min_frag_duration", "Minimum fragment duration", offsetof(MOVMuxContext, min_fragment_duration), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
-    { "frag_size", "Maximum fragment size", offsetof(MOVMuxContext, max_fragment_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
-    { "ism_lookahead", "Number of lookahead entries for ISM files", offsetof(MOVMuxContext, ism_lookahead), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
-    { "brand",    "Override major brand", offsetof(MOVMuxContext, major_brand),   AV_OPT_TYPE_STRING, {.str = NULL}, .flags = AV_OPT_FLAG_ENCODING_PARAM },
-    { NULL },
-};
-
-#define MOV_CLASS(flavor)\
-static const AVClass flavor ## _muxer_class = {\
-    .class_name = #flavor " muxer",\
-    .item_name  = av_default_item_name,\
-    .option     = options,\
-    .version    = LIBAVUTIL_VERSION_INT,\
-};
-
-//FIXME support 64 bit variant with wide placeholders
-static int64_t update_size(AVIOContext *pb, int64_t pos)
-{
-    int64_t curpos = avio_tell(pb);
-    avio_seek(pb, pos, SEEK_SET);
-    avio_wb32(pb, curpos - pos); /* rewrite size */
-    avio_seek(pb, curpos, SEEK_SET);
-
-    return curpos - pos;
-}
-
-static int co64_required(const MOVTrack *track)
-{
-    if (track->entry > 0 && track->cluster[track->entry - 1].pos + track->data_offset > UINT32_MAX)
-        return 1;
-    return 0;
-}
-
-/* Chunk offset atom */
-static int mov_write_stco_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int i;
-    int mode64 = co64_required(track); // use 32 bit size variant if possible
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    if (mode64) {
-        ffio_wfourcc(pb, "co64");
-    } else
-        ffio_wfourcc(pb, "stco");
-    avio_wb32(pb, 0); /* version & flags */
-    avio_wb32(pb, track->entry); /* entry count */
-    for (i = 0; i < track->entry; i++) {
-        if (mode64 == 1)
-            avio_wb64(pb, track->cluster[i].pos + track->data_offset);
-        else
-            avio_wb32(pb, track->cluster[i].pos + track->data_offset);
-    }
-    return update_size(pb, pos);
-}
-
-/* Sample size atom */
-static int mov_write_stsz_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int equalChunks = 1;
-    int i, j, entries = 0, tst = -1, oldtst = -1;
-
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "stsz");
-    avio_wb32(pb, 0); /* version & flags */
-
-    for (i = 0; i < track->entry; i++) {
-        tst = track->cluster[i].size / track->cluster[i].entries;
-        if (oldtst != -1 && tst != oldtst)
-            equalChunks = 0;
-        oldtst = tst;
-        entries += track->cluster[i].entries;
-    }
-    if (equalChunks && track->entry) {
-        int sSize = track->entry ? track->cluster[0].size / track->cluster[0].entries : 0;
-        sSize = FFMAX(1, sSize); // adpcm mono case could make sSize == 0
-        avio_wb32(pb, sSize); // sample size
-        avio_wb32(pb, entries); // sample count
-    } else {
-        avio_wb32(pb, 0); // sample size
-        avio_wb32(pb, entries); // sample count
-        for (i = 0; i < track->entry; i++) {
-            for (j = 0; j < track->cluster[i].entries; j++) {
-                avio_wb32(pb, track->cluster[i].size /
-                          track->cluster[i].entries);
-            }
-        }
-    }
-    return update_size(pb, pos);
-}
-
-/* Sample to chunk atom */
-static int mov_write_stsc_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int index = 0, oldval = -1, i;
-    int64_t entryPos, curpos;
-
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "stsc");
-    avio_wb32(pb, 0); // version & flags
-    entryPos = avio_tell(pb);
-    avio_wb32(pb, track->entry); // entry count
-    for (i = 0; i < track->entry; i++) {
-        if (oldval != track->cluster[i].samples_in_chunk) {
-            avio_wb32(pb, i + 1); // first chunk
-            avio_wb32(pb, track->cluster[i].samples_in_chunk); // samples per chunk
-            avio_wb32(pb, 0x1); // sample description index
-            oldval = track->cluster[i].samples_in_chunk;
-            index++;
-        }
-    }
-    curpos = avio_tell(pb);
-    avio_seek(pb, entryPos, SEEK_SET);
-    avio_wb32(pb, index); // rewrite size
-    avio_seek(pb, curpos, SEEK_SET);
-
-    return update_size(pb, pos);
-}
-
-/* Sync sample atom */
-static int mov_write_stss_tag(AVIOContext *pb, MOVTrack *track, uint32_t flag)
-{
-    int64_t curpos, entryPos;
-    int i, index = 0;
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); // size
-    ffio_wfourcc(pb, flag == MOV_SYNC_SAMPLE ? "stss" : "stps");
-    avio_wb32(pb, 0); // version & flags
-    entryPos = avio_tell(pb);
-    avio_wb32(pb, track->entry); // entry count
-    for (i = 0; i < track->entry; i++) {
-        if (track->cluster[i].flags & flag) {
-            avio_wb32(pb, i + 1);
-            index++;
-        }
-    }
-    curpos = avio_tell(pb);
-    avio_seek(pb, entryPos, SEEK_SET);
-    avio_wb32(pb, index); // rewrite size
-    avio_seek(pb, curpos, SEEK_SET);
-    return update_size(pb, pos);
-}
-
-static int mov_write_amr_tag(AVIOContext *pb, MOVTrack *track)
-{
-    avio_wb32(pb, 0x11); /* size */
-    if (track->mode == MODE_MOV) ffio_wfourcc(pb, "samr");
-    else                         ffio_wfourcc(pb, "damr");
-    ffio_wfourcc(pb, "FFMP");
-    avio_w8(pb, 0); /* decoder version */
-
-    avio_wb16(pb, 0x81FF); /* Mode set (all modes for AMR_NB) */
-    avio_w8(pb, 0x00); /* Mode change period (no restriction) */
-    avio_w8(pb, 0x01); /* Frames per sample */
-    return 0x11;
-}
-
-static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track)
-{
-    GetBitContext gbc;
-    PutBitContext pbc;
-    uint8_t buf[3];
-    int fscod, bsid, bsmod, acmod, lfeon, frmsizecod;
-
-    if (track->vos_len < 7)
-        return -1;
-
-    avio_wb32(pb, 11);
-    ffio_wfourcc(pb, "dac3");
-
-    init_get_bits(&gbc, track->vos_data + 4, (track->vos_len - 4) * 8);
-    fscod      = get_bits(&gbc, 2);
-    frmsizecod = get_bits(&gbc, 6);
-    bsid       = get_bits(&gbc, 5);
-    bsmod      = get_bits(&gbc, 3);
-    acmod      = get_bits(&gbc, 3);
-    if (acmod == 2) {
-        skip_bits(&gbc, 2); // dsurmod
-    } else {
-        if ((acmod & 1) && acmod != 1)
-            skip_bits(&gbc, 2); // cmixlev
-        if (acmod & 4)
-            skip_bits(&gbc, 2); // surmixlev
-    }
-    lfeon = get_bits1(&gbc);
-
-    init_put_bits(&pbc, buf, sizeof(buf));
-    put_bits(&pbc, 2, fscod);
-    put_bits(&pbc, 5, bsid);
-    put_bits(&pbc, 3, bsmod);
-    put_bits(&pbc, 3, acmod);
-    put_bits(&pbc, 1, lfeon);
-    put_bits(&pbc, 5, frmsizecod >> 1); // bit_rate_code
-    put_bits(&pbc, 5, 0); // reserved
-
-    flush_put_bits(&pbc);
-    avio_write(pb, buf, sizeof(buf));
-
-    return 11;
-}
-
-/**
- * This function writes extradata "as is".
- * Extradata must be formatted like a valid atom (with size and tag).
- */
-static int mov_write_extradata_tag(AVIOContext *pb, MOVTrack *track)
-{
-    avio_write(pb, track->enc->extradata, track->enc->extradata_size);
-    return track->enc->extradata_size;
-}
-
-static void put_descr(AVIOContext *pb, int tag, unsigned int size)
-{
-    int i = 3;
-    avio_w8(pb, tag);
-    for (; i > 0; i--)
-        avio_w8(pb, (size >> (7 * i)) | 0x80);
-    avio_w8(pb, size & 0x7F);
-}
-
-static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
-{
-    int64_t pos = avio_tell(pb);
-    int decoder_specific_info_len = track->vos_len ? 5 + track->vos_len : 0;
-
-    avio_wb32(pb, 0); // size
-    ffio_wfourcc(pb, "esds");
-    avio_wb32(pb, 0); // Version
-
-    // ES descriptor
-    put_descr(pb, 0x03, 3 + 5+13 + decoder_specific_info_len + 5+1);
-    avio_wb16(pb, track->track_id);
-    avio_w8(pb, 0x00); // flags (= no flags)
-
-    // DecoderConfig descriptor
-    put_descr(pb, 0x04, 13 + decoder_specific_info_len);
-
-    // Object type indication
-    if ((track->enc->codec_id == AV_CODEC_ID_MP2 ||
-         track->enc->codec_id == AV_CODEC_ID_MP3) &&
-        track->enc->sample_rate > 24000)
-        avio_w8(pb, 0x6B); // 11172-3
-    else
-        avio_w8(pb, ff_codec_get_tag(ff_mp4_obj_type, track->enc->codec_id));
-
-    // the following fields is made of 6 bits to identify the streamtype (4 for video, 5 for audio)
-    // plus 1 bit to indicate upstream and 1 bit set to 1 (reserved)
-    if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
-        avio_w8(pb, 0x15); // flags (= Audiostream)
-    else
-        avio_w8(pb, 0x11); // flags (= Visualstream)
-
-    avio_wb24(pb, track->enc->rc_buffer_size >> 3); // Buffersize DB
-
-    avio_wb32(pb, FFMAX(track->enc->bit_rate, track->enc->rc_max_rate)); // maxbitrate (FIXME should be max rate in any 1 sec window)
-    if (track->enc->rc_max_rate != track->enc->rc_min_rate ||
-        track->enc->rc_min_rate == 0)
-        avio_wb32(pb, 0); // vbr
-    else
-        avio_wb32(pb, track->enc->rc_max_rate); // avg bitrate
-
-    if (track->vos_len) {
-        // DecoderSpecific info descriptor
-        put_descr(pb, 0x05, track->vos_len);
-        avio_write(pb, track->vos_data, track->vos_len);
-    }
-
-    // SL descriptor
-    put_descr(pb, 0x06, 1);
-    avio_w8(pb, 0x02);
-    return update_size(pb, pos);
-}
-
-static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0);
-    avio_wl32(pb, track->tag); // store it byteswapped
-    track->enc->codec_tag = av_bswap16(track->tag >> 16);
-    ff_put_wav_header(pb, track->enc);
-    return update_size(pb, pos);
-}
-
-static int mov_write_wfex_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0);
-    ffio_wfourcc(pb, "wfex");
-    ff_put_wav_header(pb, track->enc);
-    return update_size(pb, pos);
-}
-
-static int mov_write_chan_tag(AVIOContext *pb, MOVTrack *track)
-{
-    uint32_t layout_tag, bitmap;
-    int64_t pos = avio_tell(pb);
-
-    layout_tag = ff_mov_get_channel_layout_tag(track->enc->codec_id,
-                                               track->enc->channel_layout,
-                                               &bitmap);
-    if (!layout_tag) {
-        av_log(track->enc, AV_LOG_WARNING, "not writing 'chan' tag due to "
-               "lack of channel information\n");
-        return 0;
-    }
-
-    avio_wb32(pb, 0);           // Size
-    ffio_wfourcc(pb, "chan");   // Type
-    avio_w8(pb, 0);             // Version
-    avio_wb24(pb, 0);           // Flags
-    avio_wb32(pb, layout_tag);  // mChannelLayoutTag
-    avio_wb32(pb, bitmap);      // mChannelBitmap
-    avio_wb32(pb, 0);           // mNumberChannelDescriptions
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-
-    avio_wb32(pb, 0);     /* size */
-    ffio_wfourcc(pb, "wave");
-
-    avio_wb32(pb, 12);    /* size */
-    ffio_wfourcc(pb, "frma");
-    avio_wl32(pb, track->tag);
-
-    if (track->enc->codec_id == AV_CODEC_ID_AAC) {
-        /* useless atom needed by mplayer, ipod, not needed by quicktime */
-        avio_wb32(pb, 12); /* size */
-        ffio_wfourcc(pb, "mp4a");
-        avio_wb32(pb, 0);
-        mov_write_esds_tag(pb, track);
-    } else if (track->enc->codec_id == AV_CODEC_ID_AMR_NB) {
-        mov_write_amr_tag(pb, track);
-    } else if (track->enc->codec_id == AV_CODEC_ID_AC3) {
-        mov_write_ac3_tag(pb, track);
-    } else if (track->enc->codec_id == AV_CODEC_ID_ALAC) {
-        mov_write_extradata_tag(pb, track);
-    } else if (track->enc->codec_id == AV_CODEC_ID_ADPCM_MS ||
-               track->enc->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV) {
-        mov_write_ms_tag(pb, track);
-    }
-
-    avio_wb32(pb, 8);     /* size */
-    avio_wb32(pb, 0);     /* null tag */
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf)
-{
-    uint8_t *unescaped;
-    const uint8_t *start, *next, *end = track->vos_data + track->vos_len;
-    int unescaped_size, seq_found = 0;
-    int level = 0, interlace = 0;
-    int packet_seq   = track->vc1_info.packet_seq;
-    int packet_entry = track->vc1_info.packet_entry;
-    int slices       = track->vc1_info.slices;
-    PutBitContext pbc;
-
-    if (track->start_dts == AV_NOPTS_VALUE) {
-        /* No packets written yet, vc1_info isn't authoritative yet. */
-        /* Assume inline sequence and entry headers. This will be
-         * overwritten at the end if the file is seekable. */
-        packet_seq = packet_entry = 1;
-    }
-
-    unescaped = av_mallocz(track->vos_len + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!unescaped)
-        return AVERROR(ENOMEM);
-    start = find_next_marker(track->vos_data, end);
-    for (next = start; next < end; start = next) {
-        GetBitContext gb;
-        int size;
-        next = find_next_marker(start + 4, end);
-        size = next - start - 4;
-        if (size <= 0)
-            continue;
-        unescaped_size = vc1_unescape_buffer(start + 4, size, unescaped);
-        init_get_bits(&gb, unescaped, 8 * unescaped_size);
-        if (AV_RB32(start) == VC1_CODE_SEQHDR) {
-            int profile = get_bits(&gb, 2);
-            if (profile != PROFILE_ADVANCED) {
-                av_free(unescaped);
-                return AVERROR(ENOSYS);
-            }
-            seq_found = 1;
-            level = get_bits(&gb, 3);
-            /* chromaformat, frmrtq_postproc, bitrtq_postproc, postprocflag,
-             * width, height */
-            skip_bits_long(&gb, 2 + 3 + 5 + 1 + 2*12);
-            skip_bits(&gb, 1); /* broadcast */
-            interlace = get_bits1(&gb);
-            skip_bits(&gb, 4); /* tfcntrflag, finterpflag, reserved, psf */
-        }
-    }
-    if (!seq_found) {
-        av_free(unescaped);
-        return AVERROR(ENOSYS);
-    }
-
-    init_put_bits(&pbc, buf, 7);
-    /* VC1DecSpecStruc */
-    put_bits(&pbc, 4, 12); /* profile - advanced */
-    put_bits(&pbc, 3, level);
-    put_bits(&pbc, 1, 0); /* reserved */
-    /* VC1AdvDecSpecStruc */
-    put_bits(&pbc, 3, level);
-    put_bits(&pbc, 1, 0); /* cbr */
-    put_bits(&pbc, 6, 0); /* reserved */
-    put_bits(&pbc, 1, !interlace); /* no interlace */
-    put_bits(&pbc, 1, !packet_seq); /* no multiple seq */
-    put_bits(&pbc, 1, !packet_entry); /* no multiple entry */
-    put_bits(&pbc, 1, !slices); /* no slice code */
-    put_bits(&pbc, 1, 0); /* no bframe */
-    put_bits(&pbc, 1, 0); /* reserved */
-    put_bits32(&pbc, track->enc->time_base.den); /* framerate */
-    flush_put_bits(&pbc);
-
-    av_free(unescaped);
-
-    return 0;
-}
-
-static int mov_write_dvc1_tag(AVIOContext *pb, MOVTrack *track)
-{
-    uint8_t buf[7] = { 0 };
-    int ret;
-
-    if ((ret = mov_write_dvc1_structs(track, buf)) < 0)
-        return ret;
-
-    avio_wb32(pb, track->vos_len + 8 + sizeof(buf));
-    ffio_wfourcc(pb, "dvc1");
-    track->vc1_info.struct_offset = avio_tell(pb);
-    avio_write(pb, buf, sizeof(buf));
-    avio_write(pb, track->vos_data, track->vos_len);
-
-    return 0;
-}
-
-static int mov_write_glbl_tag(AVIOContext *pb, MOVTrack *track)
-{
-    avio_wb32(pb, track->vos_len + 8);
-    ffio_wfourcc(pb, "glbl");
-    avio_write(pb, track->vos_data, track->vos_len);
-    return 8 + track->vos_len;
-}
-
-/**
- * Compute flags for 'lpcm' tag.
- * See CoreAudioTypes and AudioStreamBasicDescription at Apple.
- */
-static int mov_get_lpcm_flags(enum AVCodecID codec_id)
-{
-    switch (codec_id) {
-    case AV_CODEC_ID_PCM_F32BE:
-    case AV_CODEC_ID_PCM_F64BE:
-        return 11;
-    case AV_CODEC_ID_PCM_F32LE:
-    case AV_CODEC_ID_PCM_F64LE:
-        return 9;
-    case AV_CODEC_ID_PCM_U8:
-        return 10;
-    case AV_CODEC_ID_PCM_S16BE:
-    case AV_CODEC_ID_PCM_S24BE:
-    case AV_CODEC_ID_PCM_S32BE:
-        return 14;
-    case AV_CODEC_ID_PCM_S8:
-    case AV_CODEC_ID_PCM_S16LE:
-    case AV_CODEC_ID_PCM_S24LE:
-    case AV_CODEC_ID_PCM_S32LE:
-        return 12;
-    default:
-        return 0;
-    }
-}
-
-static int get_cluster_duration(MOVTrack *track, int cluster_idx)
-{
-    int64_t next_dts;
-
-    if (cluster_idx >= track->entry)
-        return 0;
-
-    if (cluster_idx + 1 == track->entry)
-        next_dts = track->track_duration + track->start_dts;
-    else
-        next_dts = track->cluster[cluster_idx + 1].dts;
-
-    return next_dts - track->cluster[cluster_idx].dts;
-}
-
-static int get_samples_per_packet(MOVTrack *track)
-{
-    int i, first_duration;
-
-    /* use 1 for raw PCM */
-    if (!track->audio_vbr)
-        return 1;
-
-    /* check to see if duration is constant for all clusters */
-    if (!track->entry)
-        return 0;
-    first_duration = get_cluster_duration(track, 0);
-    for (i = 1; i < track->entry; i++) {
-        if (get_cluster_duration(track, i) != first_duration)
-            return 0;
-    }
-    return first_duration;
-}
-
-static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    int version = 0;
-    uint32_t tag = track->tag;
-
-    if (track->mode == MODE_MOV) {
-        if (mov_get_lpcm_flags(track->enc->codec_id))
-            tag = AV_RL32("lpcm");
-        version = 2;
-    }
-
-    avio_wb32(pb, 0); /* size */
-    avio_wl32(pb, tag); // store it byteswapped
-    avio_wb32(pb, 0); /* Reserved */
-    avio_wb16(pb, 0); /* Reserved */
-    avio_wb16(pb, 1); /* Data-reference index, XXX  == 1 */
-
-    /* SoundDescription */
-    avio_wb16(pb, version); /* Version */
-    avio_wb16(pb, 0); /* Revision level */
-    avio_wb32(pb, 0); /* Reserved */
-
-    if (version == 2) {
-        avio_wb16(pb, 3);
-        avio_wb16(pb, 16);
-        avio_wb16(pb, 0xfffe);
-        avio_wb16(pb, 0);
-        avio_wb32(pb, 0x00010000);
-        avio_wb32(pb, 72);
-        avio_wb64(pb, av_double2int(track->enc->sample_rate));
-        avio_wb32(pb, track->enc->channels);
-        avio_wb32(pb, 0x7F000000);
-        avio_wb32(pb, av_get_bits_per_sample(track->enc->codec_id));
-        avio_wb32(pb, mov_get_lpcm_flags(track->enc->codec_id));
-        avio_wb32(pb, track->sample_size);
-        avio_wb32(pb, get_samples_per_packet(track));
-    } else {
-        /* reserved for mp4/3gp */
-        avio_wb16(pb, 2);
-        avio_wb16(pb, 16);
-        avio_wb16(pb, 0);
-
-        avio_wb16(pb, 0); /* packet size (= 0) */
-        avio_wb16(pb, track->enc->sample_rate <= UINT16_MAX ?
-                      track->enc->sample_rate : 0);
-        avio_wb16(pb, 0); /* Reserved */
-    }
-
-    if (track->mode == MODE_MOV &&
-        (track->enc->codec_id == AV_CODEC_ID_AAC           ||
-         track->enc->codec_id == AV_CODEC_ID_AC3           ||
-         track->enc->codec_id == AV_CODEC_ID_AMR_NB        ||
-         track->enc->codec_id == AV_CODEC_ID_ALAC          ||
-         track->enc->codec_id == AV_CODEC_ID_ADPCM_MS      ||
-         track->enc->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV))
-        mov_write_wave_tag(pb, track);
-    else if (track->tag == MKTAG('m','p','4','a'))
-        mov_write_esds_tag(pb, track);
-    else if (track->enc->codec_id == AV_CODEC_ID_AMR_NB)
-        mov_write_amr_tag(pb, track);
-    else if (track->enc->codec_id == AV_CODEC_ID_AC3)
-        mov_write_ac3_tag(pb, track);
-    else if (track->enc->codec_id == AV_CODEC_ID_ALAC)
-        mov_write_extradata_tag(pb, track);
-    else if (track->enc->codec_id == AV_CODEC_ID_WMAPRO)
-        mov_write_wfex_tag(pb, track);
-    else if (track->vos_len > 0)
-        mov_write_glbl_tag(pb, track);
-
-    if (track->mode == MODE_MOV && track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
-        mov_write_chan_tag(pb, track);
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_d263_tag(AVIOContext *pb)
-{
-    avio_wb32(pb, 0xf); /* size */
-    ffio_wfourcc(pb, "d263");
-    ffio_wfourcc(pb, "FFMP");
-    avio_w8(pb, 0); /* decoder version */
-    /* FIXME use AVCodecContext level/profile, when encoder will set values */
-    avio_w8(pb, 0xa); /* level */
-    avio_w8(pb, 0); /* profile */
-    return 0xf;
-}
-
-/* TODO: No idea about these values */
-static int mov_write_svq3_tag(AVIOContext *pb)
-{
-    avio_wb32(pb, 0x15);
-    ffio_wfourcc(pb, "SMI ");
-    ffio_wfourcc(pb, "SEQH");
-    avio_wb32(pb, 0x5);
-    avio_wb32(pb, 0xe2c0211d);
-    avio_wb32(pb, 0xc0000000);
-    avio_w8(pb, 0);
-    return 0x15;
-}
-
-static int mov_write_avcc_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-
-    avio_wb32(pb, 0);
-    ffio_wfourcc(pb, "avcC");
-    ff_isom_write_avcc(pb, track->vos_data, track->vos_len);
-    return update_size(pb, pos);
-}
-
-static int mov_write_hvcc_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-
-    avio_wb32(pb, 0);
-    ffio_wfourcc(pb, "hvcC");
-    ff_isom_write_hvcc(pb, track->vos_data, track->vos_len, 0);
-    return update_size(pb, pos);
-}
-
-/* also used by all avid codecs (dv, imx, meridien) and their variants */
-static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int i;
-    avio_wb32(pb, 24); /* size */
-    ffio_wfourcc(pb, "ACLR");
-    ffio_wfourcc(pb, "ACLR");
-    ffio_wfourcc(pb, "0001");
-    avio_wb32(pb, 2); /* yuv range: full 1 / normal 2 */
-    avio_wb32(pb, 0); /* unknown */
-
-    avio_wb32(pb, 24); /* size */
-    ffio_wfourcc(pb, "APRG");
-    ffio_wfourcc(pb, "APRG");
-    ffio_wfourcc(pb, "0001");
-    avio_wb32(pb, 1); /* unknown */
-    avio_wb32(pb, 0); /* unknown */
-
-    avio_wb32(pb, 120); /* size */
-    ffio_wfourcc(pb, "ARES");
-    ffio_wfourcc(pb, "ARES");
-    ffio_wfourcc(pb, "0001");
-    avio_wb32(pb, AV_RB32(track->vos_data + 0x28)); /* dnxhd cid, some id ? */
-    avio_wb32(pb, track->enc->width);
-    /* values below are based on samples created with quicktime and avid codecs */
-    if (track->vos_data[5] & 2) { // interlaced
-        avio_wb32(pb, track->enc->height / 2);
-        avio_wb32(pb, 2); /* unknown */
-        avio_wb32(pb, 0); /* unknown */
-        avio_wb32(pb, 4); /* unknown */
-    } else {
-        avio_wb32(pb, track->enc->height);
-        avio_wb32(pb, 1); /* unknown */
-        avio_wb32(pb, 0); /* unknown */
-        if (track->enc->height == 1080)
-            avio_wb32(pb, 5); /* unknown */
-        else
-            avio_wb32(pb, 6); /* unknown */
-    }
-    /* padding */
-    for (i = 0; i < 10; i++)
-        avio_wb64(pb, 0);
-
-    /* extra padding for stsd needed */
-    avio_wb32(pb, 0);
-    return 0;
-}
-
-static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track)
-{
-    int tag = track->enc->codec_tag;
-
-    if (!ff_codec_get_tag(ff_mp4_obj_type, track->enc->codec_id))
-        return 0;
-
-    if      (track->enc->codec_id == AV_CODEC_ID_H264)      tag = MKTAG('a','v','c','1');
-    else if (track->enc->codec_id == AV_CODEC_ID_HEVC)      tag = MKTAG('h','e','v','1');
-    else if (track->enc->codec_id == AV_CODEC_ID_AC3)       tag = MKTAG('a','c','-','3');
-    else if (track->enc->codec_id == AV_CODEC_ID_DIRAC)     tag = MKTAG('d','r','a','c');
-    else if (track->enc->codec_id == AV_CODEC_ID_MOV_TEXT)  tag = MKTAG('t','x','3','g');
-    else if (track->enc->codec_id == AV_CODEC_ID_VC1)       tag = MKTAG('v','c','-','1');
-    else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO)  tag = MKTAG('m','p','4','v');
-    else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO)  tag = MKTAG('m','p','4','a');
-
-    return tag;
-}
-
-static const AVCodecTag codec_ipod_tags[] = {
-    { AV_CODEC_ID_H264,     MKTAG('a','v','c','1') },
-    { AV_CODEC_ID_MPEG4,    MKTAG('m','p','4','v') },
-    { AV_CODEC_ID_AAC,      MKTAG('m','p','4','a') },
-    { AV_CODEC_ID_ALAC,     MKTAG('a','l','a','c') },
-    { AV_CODEC_ID_AC3,      MKTAG('a','c','-','3') },
-    { AV_CODEC_ID_MOV_TEXT, MKTAG('t','x','3','g') },
-    { AV_CODEC_ID_MOV_TEXT, MKTAG('t','e','x','t') },
-    { AV_CODEC_ID_NONE, 0 },
-};
-
-static int ipod_get_codec_tag(AVFormatContext *s, MOVTrack *track)
-{
-    int tag = track->enc->codec_tag;
-
-    // keep original tag for subs, ipod supports both formats
-    if (!(track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE &&
-          (tag == MKTAG('t', 'x', '3', 'g') ||
-           tag == MKTAG('t', 'e', 'x', 't'))))
-        tag = ff_codec_get_tag(codec_ipod_tags, track->enc->codec_id);
-
-    if (!av_match_ext(s->filename, "m4a") && !av_match_ext(s->filename, "m4v"))
-        av_log(s, AV_LOG_WARNING, "Warning, extension is not .m4a nor .m4v "
-               "Quicktime/Ipod might not play the file\n");
-
-    return tag;
-}
-
-static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track)
-{
-    int tag;
-
-    if (track->enc->width == 720) /* SD */
-        if (track->enc->height == 480) /* NTSC */
-            if  (track->enc->pix_fmt == AV_PIX_FMT_YUV422P) tag = MKTAG('d','v','5','n');
-            else                                            tag = MKTAG('d','v','c',' ');
-        else if (track->enc->pix_fmt == AV_PIX_FMT_YUV422P) tag = MKTAG('d','v','5','p');
-        else if (track->enc->pix_fmt == AV_PIX_FMT_YUV420P) tag = MKTAG('d','v','c','p');
-        else                                                tag = MKTAG('d','v','p','p');
-    else if (track->enc->height == 720) /* HD 720 line */
-        if  (track->enc->time_base.den == 50)               tag = MKTAG('d','v','h','q');
-        else                                                tag = MKTAG('d','v','h','p');
-    else if (track->enc->height == 1080) /* HD 1080 line */
-        if  (track->enc->time_base.den == 25)               tag = MKTAG('d','v','h','5');
-        else                                                tag = MKTAG('d','v','h','6');
-    else {
-        av_log(s, AV_LOG_ERROR, "unsupported height for dv codec\n");
-        return 0;
-    }
-
-    return tag;
-}
-
-static const struct {
-    enum AVPixelFormat pix_fmt;
-    uint32_t tag;
-    unsigned bps;
-} mov_pix_fmt_tags[] = {
-    { AV_PIX_FMT_YUYV422, MKTAG('y','u','v','s'),  0 },
-    { AV_PIX_FMT_UYVY422, MKTAG('2','v','u','y'),  0 },
-    { AV_PIX_FMT_RGB555BE,MKTAG('r','a','w',' '), 16 },
-    { AV_PIX_FMT_RGB555LE,MKTAG('L','5','5','5'), 16 },
-    { AV_PIX_FMT_RGB565LE,MKTAG('L','5','6','5'), 16 },
-    { AV_PIX_FMT_RGB565BE,MKTAG('B','5','6','5'), 16 },
-    { AV_PIX_FMT_GRAY16BE,MKTAG('b','1','6','g'), 16 },
-    { AV_PIX_FMT_RGB24,   MKTAG('r','a','w',' '), 24 },
-    { AV_PIX_FMT_BGR24,   MKTAG('2','4','B','G'), 24 },
-    { AV_PIX_FMT_ARGB,    MKTAG('r','a','w',' '), 32 },
-    { AV_PIX_FMT_BGRA,    MKTAG('B','G','R','A'), 32 },
-    { AV_PIX_FMT_RGBA,    MKTAG('R','G','B','A'), 32 },
-    { AV_PIX_FMT_ABGR,    MKTAG('A','B','G','R'), 32 },
-    { AV_PIX_FMT_RGB48BE, MKTAG('b','4','8','r'), 48 },
-};
-
-static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)
-{
-    int tag = track->enc->codec_tag;
-    int i;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(mov_pix_fmt_tags); i++) {
-        if (track->enc->pix_fmt == mov_pix_fmt_tags[i].pix_fmt) {
-            tag = mov_pix_fmt_tags[i].tag;
-            track->enc->bits_per_coded_sample = mov_pix_fmt_tags[i].bps;
-            break;
-        }
-    }
-
-    return tag;
-}
-
-static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
-{
-    int tag = track->enc->codec_tag;
-
-    if (!tag || (track->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL &&
-                 (track->enc->codec_id == AV_CODEC_ID_DVVIDEO ||
-                  track->enc->codec_id == AV_CODEC_ID_RAWVIDEO ||
-                  track->enc->codec_id == AV_CODEC_ID_H263 ||
-                  av_get_bits_per_sample(track->enc->codec_id)))) { // pcm audio
-        if (track->enc->codec_id == AV_CODEC_ID_DVVIDEO)
-            tag = mov_get_dv_codec_tag(s, track);
-        else if (track->enc->codec_id == AV_CODEC_ID_RAWVIDEO)
-            tag = mov_get_rawvideo_codec_tag(s, track);
-        else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) {
-            tag = ff_codec_get_tag(ff_codec_movvideo_tags, track->enc->codec_id);
-            if (!tag) { // if no mac fcc found, try with Microsoft tags
-                tag = ff_codec_get_tag(ff_codec_bmp_tags, track->enc->codec_id);
-                if (tag)
-                    av_log(s, AV_LOG_WARNING, "Using MS style video codec tag, "
-                           "the file may be unplayable!\n");
-            }
-        } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-            tag = ff_codec_get_tag(ff_codec_movaudio_tags, track->enc->codec_id);
-            if (!tag) { // if no mac fcc found, try with Microsoft tags
-                int ms_tag = ff_codec_get_tag(ff_codec_wav_tags, track->enc->codec_id);
-                if (ms_tag) {
-                    tag = MKTAG('m', 's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff));
-                    av_log(s, AV_LOG_WARNING, "Using MS style audio codec tag, "
-                           "the file may be unplayable!\n");
-                }
-            }
-        } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE)
-            tag = ff_codec_get_tag(ff_codec_movsubtitle_tags, track->enc->codec_id);
-    }
-
-    return tag;
-}
-
-static const AVCodecTag codec_3gp_tags[] = {
-    { AV_CODEC_ID_H263,     MKTAG('s','2','6','3') },
-    { AV_CODEC_ID_H264,     MKTAG('a','v','c','1') },
-    { AV_CODEC_ID_MPEG4,    MKTAG('m','p','4','v') },
-    { AV_CODEC_ID_AAC,      MKTAG('m','p','4','a') },
-    { AV_CODEC_ID_AMR_NB,   MKTAG('s','a','m','r') },
-    { AV_CODEC_ID_AMR_WB,   MKTAG('s','a','w','b') },
-    { AV_CODEC_ID_MOV_TEXT, MKTAG('t','x','3','g') },
-    { AV_CODEC_ID_NONE, 0 },
-};
-
-static const AVCodecTag codec_f4v_tags[] = {
-    { AV_CODEC_ID_MP3,    MKTAG('.','m','p','3') },
-    { AV_CODEC_ID_AAC,    MKTAG('m','p','4','a') },
-    { AV_CODEC_ID_H264,   MKTAG('a','v','c','1') },
-    { AV_CODEC_ID_VP6A,   MKTAG('V','P','6','A') },
-    { AV_CODEC_ID_VP6F,   MKTAG('V','P','6','F') },
-    { AV_CODEC_ID_NONE, 0 },
-};
-
-static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track)
-{
-    int tag;
-
-    if (track->mode == MODE_MP4 || track->mode == MODE_PSP)
-        tag = mp4_get_codec_tag(s, track);
-    else if (track->mode == MODE_ISM) {
-        tag = mp4_get_codec_tag(s, track);
-        if (!tag && track->enc->codec_id == AV_CODEC_ID_WMAPRO)
-            tag = MKTAG('w', 'm', 'a', ' ');
-    } else if (track->mode == MODE_IPOD)
-        tag = ipod_get_codec_tag(s, track);
-    else if (track->mode & MODE_3GP)
-        tag = ff_codec_get_tag(codec_3gp_tags, track->enc->codec_id);
-    else if (track->mode == MODE_F4V)
-        tag = ff_codec_get_tag(codec_f4v_tags, track->enc->codec_id);
-    else
-        tag = mov_get_codec_tag(s, track);
-
-    return tag;
-}
-
-/** Write uuid atom.
- * Needed to make file play in iPods running newest firmware
- * goes after avcC atom in moov.trak.mdia.minf.stbl.stsd.avc1
- */
-static int mov_write_uuid_tag_ipod(AVIOContext *pb)
-{
-    avio_wb32(pb, 28);
-    ffio_wfourcc(pb, "uuid");
-    avio_wb32(pb, 0x6b6840f2);
-    avio_wb32(pb, 0x5f244fc5);
-    avio_wb32(pb, 0xba39a51b);
-    avio_wb32(pb, 0xcf0323f3);
-    avio_wb32(pb, 0x0);
-    return 28;
-}
-
-static const uint16_t fiel_data[] = {
-    0x0000, 0x0100, 0x0201, 0x0206, 0x0209, 0x020e
-};
-
-static int mov_write_fiel_tag(AVIOContext *pb, MOVTrack *track)
-{
-    unsigned mov_field_order = 0;
-    if (track->enc->field_order < FF_ARRAY_ELEMS(fiel_data))
-        mov_field_order = fiel_data[track->enc->field_order];
-    else
-        return 0;
-    avio_wb32(pb, 10);
-    ffio_wfourcc(pb, "fiel");
-    avio_wb16(pb, mov_field_order);
-    return 10;
-}
-
-static int mov_write_subtitle_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0);    /* size */
-    avio_wl32(pb, track->tag); // store it byteswapped
-    avio_wb32(pb, 0);    /* Reserved */
-    avio_wb16(pb, 0);    /* Reserved */
-    avio_wb16(pb, 1);    /* Data-reference index */
-
-    if (track->enc->extradata_size)
-        avio_write(pb, track->enc->extradata, track->enc->extradata_size);
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track)
-{
-    AVRational sar;
-    av_reduce(&sar.num, &sar.den, track->enc->sample_aspect_ratio.num,
-              track->enc->sample_aspect_ratio.den, INT_MAX);
-
-    avio_wb32(pb, 16);
-    ffio_wfourcc(pb, "pasp");
-    avio_wb32(pb, sar.num);
-    avio_wb32(pb, sar.den);
-    return 16;
-}
-
-static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    char compressor_name[32] = { 0 };
-
-    avio_wb32(pb, 0); /* size */
-    avio_wl32(pb, track->tag); // store it byteswapped
-    avio_wb32(pb, 0); /* Reserved */
-    avio_wb16(pb, 0); /* Reserved */
-    avio_wb16(pb, 1); /* Data-reference index */
-
-    avio_wb16(pb, 0); /* Codec stream version */
-    avio_wb16(pb, 0); /* Codec stream revision (=0) */
-    if (track->mode == MODE_MOV) {
-        ffio_wfourcc(pb, "FFMP"); /* Vendor */
-        if (track->enc->codec_id == AV_CODEC_ID_RAWVIDEO) {
-            avio_wb32(pb, 0); /* Temporal Quality */
-            avio_wb32(pb, 0x400); /* Spatial Quality = lossless*/
-        } else {
-            avio_wb32(pb, 0x200); /* Temporal Quality = normal */
-            avio_wb32(pb, 0x200); /* Spatial Quality = normal */
-        }
-    } else {
-        avio_wb32(pb, 0); /* Reserved */
-        avio_wb32(pb, 0); /* Reserved */
-        avio_wb32(pb, 0); /* Reserved */
-    }
-    avio_wb16(pb, track->enc->width); /* Video width */
-    avio_wb16(pb, track->height); /* Video height */
-    avio_wb32(pb, 0x00480000); /* Horizontal resolution 72dpi */
-    avio_wb32(pb, 0x00480000); /* Vertical resolution 72dpi */
-    avio_wb32(pb, 0); /* Data size (= 0) */
-    avio_wb16(pb, 1); /* Frame count (= 1) */
-
-    /* FIXME not sure, ISO 14496-1 draft where it shall be set to 0 */
-    if (track->mode == MODE_MOV && track->enc->codec && track->enc->codec->name)
-        av_strlcpy(compressor_name, track->enc->codec->name, 32);
-    avio_w8(pb, strlen(compressor_name));
-    avio_write(pb, compressor_name, 31);
-
-    if (track->mode == MODE_MOV && track->enc->bits_per_coded_sample)
-        avio_wb16(pb, track->enc->bits_per_coded_sample);
-    else
-        avio_wb16(pb, 0x18); /* Reserved */
-    avio_wb16(pb, 0xffff); /* Reserved */
-    if (track->tag == MKTAG('m','p','4','v'))
-        mov_write_esds_tag(pb, track);
-    else if (track->enc->codec_id == AV_CODEC_ID_H263)
-        mov_write_d263_tag(pb);
-    else if (track->enc->codec_id == AV_CODEC_ID_SVQ3)
-        mov_write_svq3_tag(pb);
-    else if (track->enc->codec_id == AV_CODEC_ID_DNXHD)
-        mov_write_avid_tag(pb, track);
-    else if (track->enc->codec_id == AV_CODEC_ID_HEVC)
-        mov_write_hvcc_tag(pb, track);
-    else if (track->enc->codec_id == AV_CODEC_ID_H264) {
-        mov_write_avcc_tag(pb, track);
-        if (track->mode == MODE_IPOD)
-            mov_write_uuid_tag_ipod(pb);
-    } else if (track->enc->field_order != AV_FIELD_UNKNOWN)
-        mov_write_fiel_tag(pb, track);
-    else if (track->enc->codec_id == AV_CODEC_ID_VC1 && track->vos_len > 0)
-        mov_write_dvc1_tag(pb, track);
-    else if (track->enc->codec_id == AV_CODEC_ID_VP6F ||
-             track->enc->codec_id == AV_CODEC_ID_VP6A) {
-        /* Don't write any potential extradata here - the cropping
-         * is signalled via the normal width/height fields. */
-    } else if (track->vos_len > 0)
-        mov_write_glbl_tag(pb, track);
-
-    if (track->enc->sample_aspect_ratio.den && track->enc->sample_aspect_ratio.num &&
-        track->enc->sample_aspect_ratio.den != track->enc->sample_aspect_ratio.num) {
-        mov_write_pasp_tag(pb, track);
-    }
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_rtp_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "rtp ");
-    avio_wb32(pb, 0); /* Reserved */
-    avio_wb16(pb, 0); /* Reserved */
-    avio_wb16(pb, 1); /* Data-reference index */
-
-    avio_wb16(pb, 1); /* Hint track version */
-    avio_wb16(pb, 1); /* Highest compatible version */
-    avio_wb32(pb, track->max_packet_size); /* Max packet size */
-
-    avio_wb32(pb, 12); /* size */
-    ffio_wfourcc(pb, "tims");
-    avio_wb32(pb, track->timescale);
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "tmcd");               /* Data format */
-    avio_wb32(pb, 0);                       /* Reserved */
-    avio_wb32(pb, 1);                       /* Data reference index */
-    if (track->enc->extradata_size)
-        avio_write(pb, track->enc->extradata, track->enc->extradata_size);
-    return update_size(pb, pos);
-}
-
-static int mov_write_stsd_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "stsd");
-    avio_wb32(pb, 0); /* version & flags */
-    avio_wb32(pb, 1); /* entry count */
-    if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO)
-        mov_write_video_tag(pb, track);
-    else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
-        mov_write_audio_tag(pb, track);
-    else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE)
-        mov_write_subtitle_tag(pb, track);
-    else if (track->enc->codec_tag == MKTAG('r','t','p',' '))
-        mov_write_rtp_tag(pb, track);
-    else if (track->enc->codec_tag == MKTAG('t','m','c','d'))
-        mov_write_tmcd_tag(pb, track);
-    return update_size(pb, pos);
-}
-
-static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
-{
-    MOVStts *ctts_entries;
-    uint32_t entries = 0;
-    uint32_t atom_size;
-    int i;
-
-    ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */
-    ctts_entries[0].count = 1;
-    ctts_entries[0].duration = track->cluster[0].cts;
-    for (i = 1; i < track->entry; i++) {
-        if (track->cluster[i].cts == ctts_entries[entries].duration) {
-            ctts_entries[entries].count++; /* compress */
-        } else {
-            entries++;
-            ctts_entries[entries].duration = track->cluster[i].cts;
-            ctts_entries[entries].count = 1;
-        }
-    }
-    entries++; /* last one */
-    atom_size = 16 + (entries * 8);
-    avio_wb32(pb, atom_size); /* size */
-    ffio_wfourcc(pb, "ctts");
-    avio_wb32(pb, 0); /* version & flags */
-    avio_wb32(pb, entries); /* entry count */
-    for (i = 0; i < entries; i++) {
-        avio_wb32(pb, ctts_entries[i].count);
-        avio_wb32(pb, ctts_entries[i].duration);
-    }
-    av_free(ctts_entries);
-    return atom_size;
-}
-
-/* Time to sample atom */
-static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
-{
-    MOVStts *stts_entries;
-    uint32_t entries = -1;
-    uint32_t atom_size;
-    int i;
-
-    if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO && !track->audio_vbr) {
-        stts_entries = av_malloc(sizeof(*stts_entries)); /* one entry */
-        stts_entries[0].count = track->sample_count;
-        stts_entries[0].duration = 1;
-        entries = 1;
-    } else {
-        stts_entries = track->entry ?
-                       av_malloc(track->entry * sizeof(*stts_entries)) : /* worst case */
-                       NULL;
-        for (i = 0; i < track->entry; i++) {
-            int duration = get_cluster_duration(track, i);
-            if (i && duration == stts_entries[entries].duration) {
-                stts_entries[entries].count++; /* compress */
-            } else {
-                entries++;
-                stts_entries[entries].duration = duration;
-                stts_entries[entries].count = 1;
-            }
-        }
-        entries++; /* last one */
-    }
-    atom_size = 16 + (entries * 8);
-    avio_wb32(pb, atom_size); /* size */
-    ffio_wfourcc(pb, "stts");
-    avio_wb32(pb, 0); /* version & flags */
-    avio_wb32(pb, entries); /* entry count */
-    for (i = 0; i < entries; i++) {
-        avio_wb32(pb, stts_entries[i].count);
-        avio_wb32(pb, stts_entries[i].duration);
-    }
-    av_free(stts_entries);
-    return atom_size;
-}
-
-static int mov_write_dref_tag(AVIOContext *pb)
-{
-    avio_wb32(pb, 28); /* size */
-    ffio_wfourcc(pb, "dref");
-    avio_wb32(pb, 0); /* version & flags */
-    avio_wb32(pb, 1); /* entry count */
-
-    avio_wb32(pb, 0xc); /* size */
-    ffio_wfourcc(pb, "url ");
-    avio_wb32(pb, 1); /* version & flags */
-
-    return 28;
-}
-
-static int mov_write_stbl_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "stbl");
-    mov_write_stsd_tag(pb, track);
-    mov_write_stts_tag(pb, track);
-    if ((track->enc->codec_type == AVMEDIA_TYPE_VIDEO ||
-         track->enc->codec_tag == MKTAG('r','t','p',' ')) &&
-        track->has_keyframes && track->has_keyframes < track->entry)
-        mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE);
-    if (track->mode == MODE_MOV && track->flags & MOV_TRACK_STPS)
-        mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE);
-    if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO &&
-        track->flags & MOV_TRACK_CTTS)
-        mov_write_ctts_tag(pb, track);
-    mov_write_stsc_tag(pb, track);
-    mov_write_stsz_tag(pb, track);
-    mov_write_stco_tag(pb, track);
-    return update_size(pb, pos);
-}
-
-static int mov_write_dinf_tag(AVIOContext *pb)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "dinf");
-    mov_write_dref_tag(pb);
-    return update_size(pb, pos);
-}
-
-static int mov_write_nmhd_tag(AVIOContext *pb)
-{
-    avio_wb32(pb, 12);
-    ffio_wfourcc(pb, "nmhd");
-    avio_wb32(pb, 0);
-    return 12;
-}
-
-static int mov_write_gmhd_tag(AVIOContext *pb)
-{
-    avio_wb32(pb, 0x20);   /* size */
-    ffio_wfourcc(pb, "gmhd");
-    avio_wb32(pb, 0x18);   /* gmin size */
-    ffio_wfourcc(pb, "gmin");/* generic media info */
-    avio_wb32(pb, 0);      /* version & flags */
-    avio_wb16(pb, 0x40);   /* graphics mode = */
-    avio_wb16(pb, 0x8000); /* opColor (r?) */
-    avio_wb16(pb, 0x8000); /* opColor (g?) */
-    avio_wb16(pb, 0x8000); /* opColor (b?) */
-    avio_wb16(pb, 0);      /* balance */
-    avio_wb16(pb, 0);      /* reserved */
-    return 0x20;
-}
-
-static int mov_write_smhd_tag(AVIOContext *pb)
-{
-    avio_wb32(pb, 16); /* size */
-    ffio_wfourcc(pb, "smhd");
-    avio_wb32(pb, 0); /* version & flags */
-    avio_wb16(pb, 0); /* reserved (balance, normally = 0) */
-    avio_wb16(pb, 0); /* reserved */
-    return 16;
-}
-
-static int mov_write_vmhd_tag(AVIOContext *pb)
-{
-    avio_wb32(pb, 0x14); /* size (always 0x14) */
-    ffio_wfourcc(pb, "vmhd");
-    avio_wb32(pb, 0x01); /* version & flags */
-    avio_wb64(pb, 0); /* reserved (graphics mode = copy) */
-    return 0x14;
-}
-
-static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track)
-{
-    const char *hdlr, *descr = NULL, *hdlr_type = NULL;
-    int64_t pos = avio_tell(pb);
-
-    hdlr      = "dhlr";
-    hdlr_type = "url ";
-    descr     = "DataHandler";
-
-    if (track) {
-        hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";
-        if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) {
-            hdlr_type = "vide";
-            descr     = "VideoHandler";
-        } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-            hdlr_type = "soun";
-            descr     = "SoundHandler";
-        } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-            if (track->tag == MKTAG('t','x','3','g')) hdlr_type = "sbtl";
-            else                                      hdlr_type = "text";
-            descr = "SubtitleHandler";
-        } else if (track->enc->codec_tag == MKTAG('r','t','p',' ')) {
-            hdlr_type = "hint";
-            descr     = "HintHandler";
-        } else if (track->enc->codec_tag == MKTAG('t','m','c','d')) {
-            hdlr_type = "tmcd";
-            descr = "TimeCodeHandler";
-        } else {
-            char tag_buf[32];
-            av_get_codec_tag_string(tag_buf, sizeof(tag_buf),
-                                    track->enc->codec_tag);
-
-            av_log(track->enc, AV_LOG_WARNING,
-                   "Unknown hldr_type for %s / 0x%04X, writing dummy values\n",
-                   tag_buf, track->enc->codec_tag);
-        }
-    }
-
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "hdlr");
-    avio_wb32(pb, 0); /* Version & flags */
-    avio_write(pb, hdlr, 4); /* handler */
-    ffio_wfourcc(pb, hdlr_type); /* handler type */
-    avio_wb32(pb, 0); /* reserved */
-    avio_wb32(pb, 0); /* reserved */
-    avio_wb32(pb, 0); /* reserved */
-    if (!track || track->mode == MODE_MOV)
-        avio_w8(pb, strlen(descr)); /* pascal string */
-    avio_write(pb, descr, strlen(descr)); /* handler description */
-    if (track && track->mode != MODE_MOV)
-        avio_w8(pb, 0); /* c string */
-    return update_size(pb, pos);
-}
-
-static int mov_write_hmhd_tag(AVIOContext *pb)
-{
-    /* This atom must be present, but leaving the values at zero
-     * seems harmless. */
-    avio_wb32(pb, 28); /* size */
-    ffio_wfourcc(pb, "hmhd");
-    avio_wb32(pb, 0); /* version, flags */
-    avio_wb16(pb, 0); /* maxPDUsize */
-    avio_wb16(pb, 0); /* avgPDUsize */
-    avio_wb32(pb, 0); /* maxbitrate */
-    avio_wb32(pb, 0); /* avgbitrate */
-    avio_wb32(pb, 0); /* reserved */
-    return 28;
-}
-
-static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "minf");
-    if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO)
-        mov_write_vmhd_tag(pb);
-    else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
-        mov_write_smhd_tag(pb);
-    else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-        if (track->tag == MKTAG('t','e','x','t')) mov_write_gmhd_tag(pb);
-        else                                      mov_write_nmhd_tag(pb);
-    } else if (track->tag == MKTAG('r','t','p',' ')) {
-        mov_write_hmhd_tag(pb);
-    } else if (track->tag == MKTAG('t','m','c','d')) {
-        mov_write_gmhd_tag(pb);
-    }
-    if (track->mode == MODE_MOV) /* FIXME: Why do it for MODE_MOV only ? */
-        mov_write_hdlr_tag(pb, NULL);
-    mov_write_dinf_tag(pb);
-    mov_write_stbl_tag(pb, track);
-    return update_size(pb, pos);
-}
-
-static int mov_write_mdhd_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int version = track->track_duration < INT32_MAX ? 0 : 1;
-
-    if (track->mode == MODE_ISM)
-        version = 1;
-
-    (version == 1) ? avio_wb32(pb, 44) : avio_wb32(pb, 32); /* size */
-    ffio_wfourcc(pb, "mdhd");
-    avio_w8(pb, version);
-    avio_wb24(pb, 0); /* flags */
-    if (version == 1) {
-        avio_wb64(pb, track->time);
-        avio_wb64(pb, track->time);
-    } else {
-        avio_wb32(pb, track->time); /* creation time */
-        avio_wb32(pb, track->time); /* modification time */
-    }
-    avio_wb32(pb, track->timescale); /* time scale (sample rate for audio) */
-    if (!track->entry)
-        (version == 1) ? avio_wb64(pb, UINT64_C(0xffffffffffffffff)) : avio_wb32(pb, 0xffffffff);
-    else
-        (version == 1) ? avio_wb64(pb, track->track_duration) : avio_wb32(pb, track->track_duration); /* duration */
-    avio_wb16(pb, track->language); /* language */
-    avio_wb16(pb, 0); /* reserved (quality) */
-
-    if (version != 0 && track->mode == MODE_MOV) {
-        av_log(NULL, AV_LOG_ERROR,
-               "FATAL error, file duration too long for timebase, this file will not be\n"
-               "playable with quicktime. Choose a different timebase or a different\n"
-               "container format\n");
-    }
-
-    return 32;
-}
-
-static int mov_write_mdia_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "mdia");
-    mov_write_mdhd_tag(pb, track);
-    mov_write_hdlr_tag(pb, track);
-    mov_write_minf_tag(pb, track);
-    return update_size(pb, pos);
-}
-
-static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
-{
-    int64_t duration = av_rescale_rnd(track->track_duration, MOV_TIMESCALE,
-                                      track->timescale, AV_ROUND_UP);
-    int version = duration < INT32_MAX ? 0 : 1;
-
-    if (track->mode == MODE_ISM)
-        version = 1;
-
-    (version == 1) ? avio_wb32(pb, 104) : avio_wb32(pb, 92); /* size */
-    ffio_wfourcc(pb, "tkhd");
-    avio_w8(pb, version);
-    avio_wb24(pb, (track->flags & MOV_TRACK_ENABLED) ?
-                  MOV_TKHD_FLAG_ENABLED | MOV_TKHD_FLAG_IN_MOVIE :
-                  MOV_TKHD_FLAG_IN_MOVIE);
-    if (version == 1) {
-        avio_wb64(pb, track->time);
-        avio_wb64(pb, track->time);
-    } else {
-        avio_wb32(pb, track->time); /* creation time */
-        avio_wb32(pb, track->time); /* modification time */
-    }
-    avio_wb32(pb, track->track_id); /* track-id */
-    avio_wb32(pb, 0); /* reserved */
-    if (!track->entry)
-        (version == 1) ? avio_wb64(pb, UINT64_C(0xffffffffffffffff)) : avio_wb32(pb, 0xffffffff);
-    else
-        (version == 1) ? avio_wb64(pb, duration) : avio_wb32(pb, duration);
-
-    avio_wb32(pb, 0); /* reserved */
-    avio_wb32(pb, 0); /* reserved */
-    avio_wb16(pb, 0); /* layer */
-    avio_wb16(pb, st ? st->codec->codec_type : 0); /* alternate group) */
-    /* Volume, only for audio */
-    if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
-        avio_wb16(pb, 0x0100);
-    else
-        avio_wb16(pb, 0);
-    avio_wb16(pb, 0); /* reserved */
-
-    /* Matrix structure */
-    avio_wb32(pb, 0x00010000); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x00010000); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x40000000); /* reserved */
-
-    /* Track width and height, for visual only */
-    if (st && (track->enc->codec_type == AVMEDIA_TYPE_VIDEO ||
-               track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE)) {
-        if (track->mode == MODE_MOV) {
-            avio_wb32(pb, track->enc->width << 16);
-            avio_wb32(pb, track->height << 16);
-        } else {
-            double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio);
-            if (!sample_aspect_ratio || track->height != track->enc->height)
-                sample_aspect_ratio = 1;
-            avio_wb32(pb, sample_aspect_ratio * track->enc->width * 0x10000);
-            avio_wb32(pb, track->height * 0x10000);
-        }
-    } else {
-        avio_wb32(pb, 0);
-        avio_wb32(pb, 0);
-    }
-    return 0x5c;
-}
-
-static int mov_write_tapt_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int32_t width = av_rescale(track->enc->sample_aspect_ratio.num, track->enc->width,
-                               track->enc->sample_aspect_ratio.den);
-
-    int64_t pos = avio_tell(pb);
-
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "tapt");
-
-    avio_wb32(pb, 20);
-    ffio_wfourcc(pb, "clef");
-    avio_wb32(pb, 0);
-    avio_wb32(pb, width << 16);
-    avio_wb32(pb, track->enc->height << 16);
-
-    avio_wb32(pb, 20);
-    ffio_wfourcc(pb, "enof");
-    avio_wb32(pb, 0);
-    avio_wb32(pb, track->enc->width << 16);
-    avio_wb32(pb, track->enc->height << 16);
-
-    return update_size(pb, pos);
-}
-
-// This box seems important for the psp playback ... without it the movie seems to hang
-static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t duration = av_rescale_rnd(track->track_duration, MOV_TIMESCALE,
-                                      track->timescale, AV_ROUND_UP);
-    int version = duration < INT32_MAX ? 0 : 1;
-    int entry_size, entry_count, size;
-    int64_t delay, start_ct = track->cluster[0].cts;
-    delay = av_rescale_rnd(track->cluster[0].dts + start_ct, MOV_TIMESCALE,
-                           track->timescale, AV_ROUND_DOWN);
-    version |= delay < INT32_MAX ? 0 : 1;
-
-    entry_size = (version == 1) ? 20 : 12;
-    entry_count = 1 + (delay > 0);
-    size = 24 + entry_count * entry_size;
-
-    /* write the atom data */
-    avio_wb32(pb, size);
-    ffio_wfourcc(pb, "edts");
-    avio_wb32(pb, size - 8);
-    ffio_wfourcc(pb, "elst");
-    avio_w8(pb, version);
-    avio_wb24(pb, 0); /* flags */
-
-    avio_wb32(pb, entry_count);
-    if (delay > 0) { /* add an empty edit to delay presentation */
-        if (version == 1) {
-            avio_wb64(pb, delay);
-            avio_wb64(pb, -1);
-        } else {
-            avio_wb32(pb, delay);
-            avio_wb32(pb, -1);
-        }
-        avio_wb32(pb, 0x00010000);
-    }
-
-    /* duration */
-    if (version == 1) {
-        avio_wb64(pb, duration);
-        avio_wb64(pb, start_ct);
-    } else {
-        avio_wb32(pb, duration);
-        avio_wb32(pb, start_ct);
-    }
-    avio_wb32(pb, 0x00010000);
-    return size;
-}
-
-static int mov_write_tref_tag(AVIOContext *pb, MOVTrack *track)
-{
-    avio_wb32(pb, 20);   // size
-    ffio_wfourcc(pb, "tref");
-    avio_wb32(pb, 12);   // size (subatom)
-    avio_wl32(pb, track->tref_tag);
-    avio_wb32(pb, track->tref_id);
-    return 20;
-}
-
-// goes at the end of each track!  ... Critical for PSP playback ("Incompatible data" without it)
-static int mov_write_uuid_tag_psp(AVIOContext *pb, MOVTrack *mov)
-{
-    avio_wb32(pb, 0x34); /* size ... reports as 28 in mp4box! */
-    ffio_wfourcc(pb, "uuid");
-    ffio_wfourcc(pb, "USMT");
-    avio_wb32(pb, 0x21d24fce);
-    avio_wb32(pb, 0xbb88695c);
-    avio_wb32(pb, 0xfac9c740);
-    avio_wb32(pb, 0x1c);     // another size here!
-    ffio_wfourcc(pb, "MTDT");
-    avio_wb32(pb, 0x00010012);
-    avio_wb32(pb, 0x0a);
-    avio_wb32(pb, 0x55c40000);
-    avio_wb32(pb, 0x1);
-    avio_wb32(pb, 0x0);
-    return 0x34;
-}
-
-static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)
-{
-    AVFormatContext *ctx = track->rtp_ctx;
-    char buf[1000] = "";
-    int len;
-
-    ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track,
-                       NULL, NULL, 0, 0, ctx);
-    av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\r\n", track->track_id);
-    len = strlen(buf);
-
-    avio_wb32(pb, len + 24);
-    ffio_wfourcc(pb, "udta");
-    avio_wb32(pb, len + 16);
-    ffio_wfourcc(pb, "hnti");
-    avio_wb32(pb, len + 8);
-    ffio_wfourcc(pb, "sdp ");
-    avio_write(pb, buf, len);
-    return len + 24;
-}
-
-static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              MOVTrack *track, AVStream *st)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "trak");
-    mov_write_tkhd_tag(pb, track, st);
-    if (track->mode == MODE_PSP || track->flags & MOV_TRACK_CTTS ||
-        (track->entry && track->cluster[0].dts)) {
-        if (!(mov->flags & FF_MOV_FLAG_FRAGMENT))
-            mov_write_edts_tag(pb, track);  // PSP Movies require edts box
-    }
-    if (track->tref_tag)
-        mov_write_tref_tag(pb, track);
-    mov_write_mdia_tag(pb, track);
-    if (track->mode == MODE_PSP)
-        mov_write_uuid_tag_psp(pb, track); // PSP Movies require this uuid box
-    if (track->tag == MKTAG('r','t','p',' '))
-        mov_write_udta_sdp(pb, track);
-    if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO && track->mode == MODE_MOV) {
-        double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio);
-        if (0.0 != sample_aspect_ratio && 1.0 != sample_aspect_ratio)
-            mov_write_tapt_tag(pb, track);
-    }
-    return update_size(pb, pos);
-}
-
-static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov)
-{
-    int i, has_audio = 0, has_video = 0;
-    int64_t pos = avio_tell(pb);
-    int audio_profile = mov->iods_audio_profile;
-    int video_profile = mov->iods_video_profile;
-    for (i = 0; i < mov->nb_streams; i++) {
-        if (mov->tracks[i].entry > 0) {
-            has_audio |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_AUDIO;
-            has_video |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_VIDEO;
-        }
-    }
-    if (audio_profile < 0)
-        audio_profile = 0xFF - has_audio;
-    if (video_profile < 0)
-        video_profile = 0xFF - has_video;
-    avio_wb32(pb, 0x0); /* size */
-    ffio_wfourcc(pb, "iods");
-    avio_wb32(pb, 0);    /* version & flags */
-    put_descr(pb, 0x10, 7);
-    avio_wb16(pb, 0x004f);
-    avio_w8(pb, 0xff);
-    avio_w8(pb, 0xff);
-    avio_w8(pb, audio_profile);
-    avio_w8(pb, video_profile);
-    avio_w8(pb, 0xff);
-    return update_size(pb, pos);
-}
-
-static int mov_write_trex_tag(AVIOContext *pb, MOVTrack *track)
-{
-    avio_wb32(pb, 0x20); /* size */
-    ffio_wfourcc(pb, "trex");
-    avio_wb32(pb, 0);   /* version & flags */
-    avio_wb32(pb, track->track_id); /* track ID */
-    avio_wb32(pb, 1);   /* default sample description index */
-    avio_wb32(pb, 0);   /* default sample duration */
-    avio_wb32(pb, 0);   /* default sample size */
-    avio_wb32(pb, 0);   /* default sample flags */
-    return 0;
-}
-
-static int mov_write_mvex_tag(AVIOContext *pb, MOVMuxContext *mov)
-{
-    int64_t pos = avio_tell(pb);
-    int i;
-    avio_wb32(pb, 0x0); /* size */
-    ffio_wfourcc(pb, "mvex");
-    for (i = 0; i < mov->nb_streams; i++)
-        mov_write_trex_tag(pb, &mov->tracks[i]);
-    return update_size(pb, pos);
-}
-
-static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
-{
-    int max_track_id = 1, i;
-    int64_t max_track_len_temp, max_track_len = 0;
-    int version;
-
-    for (i = 0; i < mov->nb_streams; i++) {
-        if (mov->tracks[i].entry > 0 && mov->tracks[i].timescale) {
-            max_track_len_temp = av_rescale_rnd(mov->tracks[i].track_duration,
-                                                MOV_TIMESCALE,
-                                                mov->tracks[i].timescale,
-                                                AV_ROUND_UP);
-            if (max_track_len < max_track_len_temp)
-                max_track_len = max_track_len_temp;
-            if (max_track_id < mov->tracks[i].track_id)
-                max_track_id = mov->tracks[i].track_id;
-        }
-    }
-
-    version = max_track_len < UINT32_MAX ? 0 : 1;
-    (version == 1) ? avio_wb32(pb, 120) : avio_wb32(pb, 108); /* size */
-    ffio_wfourcc(pb, "mvhd");
-    avio_w8(pb, version);
-    avio_wb24(pb, 0); /* flags */
-    if (version == 1) {
-        avio_wb64(pb, mov->time);
-        avio_wb64(pb, mov->time);
-    } else {
-        avio_wb32(pb, mov->time); /* creation time */
-        avio_wb32(pb, mov->time); /* modification time */
-    }
-    avio_wb32(pb, MOV_TIMESCALE);
-    (version == 1) ? avio_wb64(pb, max_track_len) : avio_wb32(pb, max_track_len); /* duration of longest track */
-
-    avio_wb32(pb, 0x00010000); /* reserved (preferred rate) 1.0 = normal */
-    avio_wb16(pb, 0x0100); /* reserved (preferred volume) 1.0 = normal */
-    avio_wb16(pb, 0); /* reserved */
-    avio_wb32(pb, 0); /* reserved */
-    avio_wb32(pb, 0); /* reserved */
-
-    /* Matrix structure */
-    avio_wb32(pb, 0x00010000); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x00010000); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x0); /* reserved */
-    avio_wb32(pb, 0x40000000); /* reserved */
-
-    avio_wb32(pb, 0); /* reserved (preview time) */
-    avio_wb32(pb, 0); /* reserved (preview duration) */
-    avio_wb32(pb, 0); /* reserved (poster time) */
-    avio_wb32(pb, 0); /* reserved (selection time) */
-    avio_wb32(pb, 0); /* reserved (selection duration) */
-    avio_wb32(pb, 0); /* reserved (current time) */
-    avio_wb32(pb, max_track_id + 1); /* Next track id */
-    return 0x6c;
-}
-
-static int mov_write_itunes_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov,
-                                     AVFormatContext *s)
-{
-    avio_wb32(pb, 33); /* size */
-    ffio_wfourcc(pb, "hdlr");
-    avio_wb32(pb, 0);
-    avio_wb32(pb, 0);
-    ffio_wfourcc(pb, "mdir");
-    ffio_wfourcc(pb, "appl");
-    avio_wb32(pb, 0);
-    avio_wb32(pb, 0);
-    avio_w8(pb, 0);
-    return 33;
-}
-
-/* helper function to write a data tag with the specified string as data */
-static int mov_write_string_data_tag(AVIOContext *pb, const char *data, int lang, int long_style)
-{
-    if (long_style) {
-        int size = 16 + strlen(data);
-        avio_wb32(pb, size); /* size */
-        ffio_wfourcc(pb, "data");
-        avio_wb32(pb, 1);
-        avio_wb32(pb, 0);
-        avio_write(pb, data, strlen(data));
-        return size;
-    } else {
-        if (!lang)
-            lang = ff_mov_iso639_to_lang("und", 1);
-        avio_wb16(pb, strlen(data)); /* string length */
-        avio_wb16(pb, lang);
-        avio_write(pb, data, strlen(data));
-        return strlen(data) + 4;
-    }
-}
-
-static int mov_write_string_tag(AVIOContext *pb, const char *name,
-                                const char *value, int lang, int long_style)
-{
-    int size = 0;
-    if (value && value[0]) {
-        int64_t pos = avio_tell(pb);
-        avio_wb32(pb, 0); /* size */
-        ffio_wfourcc(pb, name);
-        mov_write_string_data_tag(pb, value, lang, long_style);
-        size = update_size(pb, pos);
-    }
-    return size;
-}
-
-static int mov_write_string_metadata(AVFormatContext *s, AVIOContext *pb,
-                                     const char *name, const char *tag,
-                                     int long_style)
-{
-    int l, lang = 0, len, len2;
-    AVDictionaryEntry *t, *t2 = NULL;
-    char tag2[16];
-
-    if (!(t = av_dict_get(s->metadata, tag, NULL, 0)))
-        return 0;
-
-    len = strlen(t->key);
-    snprintf(tag2, sizeof(tag2), "%s-", tag);
-    while ((t2 = av_dict_get(s->metadata, tag2, t2, AV_DICT_IGNORE_SUFFIX))) {
-        len2 = strlen(t2->key);
-        if (len2 == len + 4 && !strcmp(t->value, t2->value)
-            && (l = ff_mov_iso639_to_lang(&t2->key[len2 - 3], 1)) >= 0) {
-            lang = l;
-            break;
-        }
-    }
-    return mov_write_string_tag(pb, name, t->value, lang, long_style);
-}
-
-/* iTunes track number */
-static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              AVFormatContext *s)
-{
-    AVDictionaryEntry *t = av_dict_get(s->metadata, "track", NULL, 0);
-    int size = 0, track = t ? atoi(t->value) : 0;
-    if (track) {
-        avio_wb32(pb, 32); /* size */
-        ffio_wfourcc(pb, "trkn");
-        avio_wb32(pb, 24); /* size */
-        ffio_wfourcc(pb, "data");
-        avio_wb32(pb, 0);        // 8 bytes empty
-        avio_wb32(pb, 0);
-        avio_wb16(pb, 0);        // empty
-        avio_wb16(pb, track);    // track number
-        avio_wb16(pb, 0);        // total track number
-        avio_wb16(pb, 0);        // empty
-        size = 32;
-    }
-    return size;
-}
-
-/* iTunes meta data list */
-static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              AVFormatContext *s)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "ilst");
-    mov_write_string_metadata(s, pb, "\251nam", "title"    , 1);
-    mov_write_string_metadata(s, pb, "\251ART", "artist"   , 1);
-    mov_write_string_metadata(s, pb, "aART", "album_artist", 1);
-    mov_write_string_metadata(s, pb, "\251wrt", "composer" , 1);
-    mov_write_string_metadata(s, pb, "\251alb", "album"    , 1);
-    mov_write_string_metadata(s, pb, "\251day", "date"     , 1);
-    if (!mov_write_string_metadata(s, pb, "\251too", "encoding_tool", 1))
-        mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1);
-    mov_write_string_metadata(s, pb, "\251cmt", "comment"  , 1);
-    mov_write_string_metadata(s, pb, "\251gen", "genre"    , 1);
-    mov_write_string_metadata(s, pb, "\251cpy", "copyright", 1);
-    mov_write_string_metadata(s, pb, "\251grp", "grouping" , 1);
-    mov_write_string_metadata(s, pb, "\251lyr", "lyrics"   , 1);
-    mov_write_string_metadata(s, pb, "desc",    "description",1);
-    mov_write_string_metadata(s, pb, "ldes",    "synopsis" , 1);
-    mov_write_string_metadata(s, pb, "tvsh",    "show"     , 1);
-    mov_write_string_metadata(s, pb, "tven",    "episode_id",1);
-    mov_write_string_metadata(s, pb, "tvnn",    "network"  , 1);
-    mov_write_trkn_tag(pb, mov, s);
-    return update_size(pb, pos);
-}
-
-/* iTunes meta data tag */
-static int mov_write_meta_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              AVFormatContext *s)
-{
-    int size = 0;
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "meta");
-    avio_wb32(pb, 0);
-    mov_write_itunes_hdlr_tag(pb, mov, s);
-    mov_write_ilst_tag(pb, mov, s);
-    size = update_size(pb, pos);
-    return size;
-}
-
-static int utf8len(const uint8_t *b)
-{
-    int len = 0;
-    int val;
-    while (*b) {
-        GET_UTF8(val, *b++, return -1;)
-        len++;
-    }
-    return len;
-}
-
-static int ascii_to_wc(AVIOContext *pb, const uint8_t *b)
-{
-    int val;
-    while (*b) {
-        GET_UTF8(val, *b++, return -1;)
-        avio_wb16(pb, val);
-    }
-    avio_wb16(pb, 0x00);
-    return 0;
-}
-
-static uint16_t language_code(const char *str)
-{
-    return (((str[0] - 0x60) & 0x1F) << 10) +
-           (((str[1] - 0x60) & 0x1F) <<  5) +
-           (( str[2] - 0x60) & 0x1F);
-}
-
-static int mov_write_3gp_udta_tag(AVIOContext *pb, AVFormatContext *s,
-                                  const char *tag, const char *str)
-{
-    int64_t pos = avio_tell(pb);
-    AVDictionaryEntry *t = av_dict_get(s->metadata, str, NULL, 0);
-    if (!t || !utf8len(t->value))
-        return 0;
-    avio_wb32(pb, 0);   /* size */
-    ffio_wfourcc(pb, tag); /* type */
-    avio_wb32(pb, 0);   /* version + flags */
-    if (!strcmp(tag, "yrrc"))
-        avio_wb16(pb, atoi(t->value));
-    else {
-        avio_wb16(pb, language_code("eng")); /* language */
-        avio_write(pb, t->value, strlen(t->value) + 1); /* UTF8 string value */
-        if (!strcmp(tag, "albm") &&
-            (t = av_dict_get(s->metadata, "track", NULL, 0)))
-            avio_w8(pb, atoi(t->value));
-    }
-    return update_size(pb, pos);
-}
-
-static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s)
-{
-    int64_t pos = avio_tell(pb);
-    int i, nb_chapters = FFMIN(s->nb_chapters, 255);
-
-    avio_wb32(pb, 0);            // size
-    ffio_wfourcc(pb, "chpl");
-    avio_wb32(pb, 0x01000000);   // version + flags
-    avio_wb32(pb, 0);            // unknown
-    avio_w8(pb, nb_chapters);
-
-    for (i = 0; i < nb_chapters; i++) {
-        AVChapter *c = s->chapters[i];
-        AVDictionaryEntry *t;
-        avio_wb64(pb, av_rescale_q(c->start, c->time_base, (AVRational){1,10000000}));
-
-        if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
-            int len = FFMIN(strlen(t->value), 255);
-            avio_w8(pb, len);
-            avio_write(pb, t->value, len);
-        } else
-            avio_w8(pb, 0);
-    }
-    return update_size(pb, pos);
-}
-
-static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              AVFormatContext *s)
-{
-    AVIOContext *pb_buf;
-    int i, ret, size;
-    uint8_t *buf;
-
-    for (i = 0; i < s->nb_streams; i++)
-        if (mov->tracks[i].enc->flags & CODEC_FLAG_BITEXACT) {
-            return 0;
-        }
-
-    ret = avio_open_dyn_buf(&pb_buf);
-    if (ret < 0)
-        return ret;
-
-    if (mov->mode & MODE_3GP) {
-        mov_write_3gp_udta_tag(pb_buf, s, "perf", "artist");
-        mov_write_3gp_udta_tag(pb_buf, s, "titl", "title");
-        mov_write_3gp_udta_tag(pb_buf, s, "auth", "author");
-        mov_write_3gp_udta_tag(pb_buf, s, "gnre", "genre");
-        mov_write_3gp_udta_tag(pb_buf, s, "dscp", "comment");
-        mov_write_3gp_udta_tag(pb_buf, s, "albm", "album");
-        mov_write_3gp_udta_tag(pb_buf, s, "cprt", "copyright");
-        mov_write_3gp_udta_tag(pb_buf, s, "yrrc", "date");
-    } else if (mov->mode == MODE_MOV) { // the title field breaks gtkpod with mp4 and my suspicion is that stuff is not valid in mp4
-        mov_write_string_metadata(s, pb_buf, "\251ART", "artist",      0);
-        mov_write_string_metadata(s, pb_buf, "\251nam", "title",       0);
-        mov_write_string_metadata(s, pb_buf, "\251aut", "author",      0);
-        mov_write_string_metadata(s, pb_buf, "\251alb", "album",       0);
-        mov_write_string_metadata(s, pb_buf, "\251day", "date",        0);
-        mov_write_string_metadata(s, pb_buf, "\251swr", "encoder",     0);
-        mov_write_string_metadata(s, pb_buf, "\251des", "comment",     0);
-        mov_write_string_metadata(s, pb_buf, "\251gen", "genre",       0);
-        mov_write_string_metadata(s, pb_buf, "\251cpy", "copyright",   0);
-    } else {
-        /* iTunes meta data */
-        mov_write_meta_tag(pb_buf, mov, s);
-    }
-
-    if (s->nb_chapters)
-        mov_write_chpl_tag(pb_buf, s);
-
-    if ((size = avio_close_dyn_buf(pb_buf, &buf)) > 0) {
-        avio_wb32(pb, size + 8);
-        ffio_wfourcc(pb, "udta");
-        avio_write(pb, buf, size);
-    }
-    av_free(buf);
-
-    return 0;
-}
-
-static void mov_write_psp_udta_tag(AVIOContext *pb,
-                                   const char *str, const char *lang, int type)
-{
-    int len = utf8len(str) + 1;
-    if (len <= 0)
-        return;
-    avio_wb16(pb, len * 2 + 10);        /* size */
-    avio_wb32(pb, type);                /* type */
-    avio_wb16(pb, language_code(lang)); /* language */
-    avio_wb16(pb, 0x01);                /* ? */
-    ascii_to_wc(pb, str);
-}
-
-static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
-{
-    AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0);
-    int64_t pos, pos2;
-
-    if (title) {
-        pos = avio_tell(pb);
-        avio_wb32(pb, 0); /* size placeholder*/
-        ffio_wfourcc(pb, "uuid");
-        ffio_wfourcc(pb, "USMT");
-        avio_wb32(pb, 0x21d24fce); /* 96 bit UUID */
-        avio_wb32(pb, 0xbb88695c);
-        avio_wb32(pb, 0xfac9c740);
-
-        pos2 = avio_tell(pb);
-        avio_wb32(pb, 0); /* size placeholder*/
-        ffio_wfourcc(pb, "MTDT");
-        avio_wb16(pb, 4);
-
-        // ?
-        avio_wb16(pb, 0x0C);                 /* size */
-        avio_wb32(pb, 0x0B);                 /* type */
-        avio_wb16(pb, language_code("und")); /* language */
-        avio_wb16(pb, 0x0);                  /* ? */
-        avio_wb16(pb, 0x021C);               /* data */
-
-        mov_write_psp_udta_tag(pb, LIBAVCODEC_IDENT,      "eng", 0x04);
-        mov_write_psp_udta_tag(pb, title->value,          "eng", 0x01);
-        mov_write_psp_udta_tag(pb, "2006/04/01 11:11:11", "und", 0x03);
-
-        update_size(pb, pos2);
-        return update_size(pb, pos);
-    }
-
-    return 0;
-}
-
-static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              AVFormatContext *s)
-{
-    int i;
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size placeholder*/
-    ffio_wfourcc(pb, "moov");
-
-    for (i = 0; i < mov->nb_streams; i++) {
-        if (mov->tracks[i].entry <= 0 && !(mov->flags & FF_MOV_FLAG_FRAGMENT))
-            continue;
-
-        mov->tracks[i].time     = mov->time;
-        mov->tracks[i].track_id = i + 1;
-    }
-
-    if (mov->chapter_track)
-        for (i = 0; i < s->nb_streams; i++) {
-            mov->tracks[i].tref_tag = MKTAG('c','h','a','p');
-            mov->tracks[i].tref_id  = mov->tracks[mov->chapter_track].track_id;
-        }
-    for (i = 0; i < mov->nb_streams; i++) {
-        if (mov->tracks[i].tag == MKTAG('r','t','p',' ')) {
-            mov->tracks[i].tref_tag = MKTAG('h','i','n','t');
-            mov->tracks[i].tref_id =
-                mov->tracks[mov->tracks[i].src_track].track_id;
-        }
-    }
-
-    mov_write_mvhd_tag(pb, mov);
-    if (mov->mode != MODE_MOV && !mov->iods_skip)
-        mov_write_iods_tag(pb, mov);
-    for (i = 0; i < mov->nb_streams; i++) {
-        if (mov->tracks[i].entry > 0 || mov->flags & FF_MOV_FLAG_FRAGMENT) {
-            mov_write_trak_tag(pb, mov, &(mov->tracks[i]), i < s->nb_streams ? s->streams[i] : NULL);
-        }
-    }
-    if (mov->flags & FF_MOV_FLAG_FRAGMENT)
-        mov_write_mvex_tag(pb, mov); /* QuickTime requires trak to precede this */
-
-    if (mov->mode == MODE_PSP)
-        mov_write_uuidusmt_tag(pb, s);
-    else
-        mov_write_udta_tag(pb, mov, s);
-
-    return update_size(pb, pos);
-}
-
-static void param_write_int(AVIOContext *pb, const char *name, int value)
-{
-    avio_printf(pb, "<param name=\"%s\" value=\"%d\" valuetype=\"data\"/>\n", name, value);
-}
-
-static void param_write_string(AVIOContext *pb, const char *name, const char *value)
-{
-    avio_printf(pb, "<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, value);
-}
-
-static void param_write_hex(AVIOContext *pb, const char *name, const uint8_t *value, int len)
-{
-    char buf[150];
-    len = FFMIN(sizeof(buf) / 2 - 1, len);
-    ff_data_to_hex(buf, value, len, 0);
-    buf[2 * len] = '\0';
-    avio_printf(pb, "<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, buf);
-}
-
-static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov)
-{
-    int64_t pos = avio_tell(pb);
-    int i;
-    const uint8_t uuid[] = {
-        0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
-        0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
-    };
-
-    avio_wb32(pb, 0);
-    ffio_wfourcc(pb, "uuid");
-    avio_write(pb, uuid, sizeof(uuid));
-    avio_wb32(pb, 0);
-
-    avio_printf(pb, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
-    avio_printf(pb, "<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n");
-    avio_printf(pb, "<head>\n");
-    avio_printf(pb, "<meta name=\"creator\" content=\"%s\" />\n",
-                    LIBAVFORMAT_IDENT);
-    avio_printf(pb, "</head>\n");
-    avio_printf(pb, "<body>\n");
-    avio_printf(pb, "<switch>\n");
-    for (i = 0; i < mov->nb_streams; i++) {
-        MOVTrack *track = &mov->tracks[i];
-        const char *type;
-        /* track->track_id is initialized in write_moov, and thus isn't known
-         * here yet */
-        int track_id = i + 1;
-
-        if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) {
-            type = "video";
-        } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-            type = "audio";
-        } else {
-            continue;
-        }
-        avio_printf(pb, "<%s systemBitrate=\"%d\">\n", type,
-                                                       track->enc->bit_rate);
-        param_write_int(pb, "systemBitrate", track->enc->bit_rate);
-        param_write_int(pb, "trackID", track_id);
-        if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) {
-            if (track->enc->codec_id == AV_CODEC_ID_H264) {
-                uint8_t *ptr;
-                int size = track->enc->extradata_size;
-                if (!ff_avc_write_annexb_extradata(track->enc->extradata, &ptr,
-                                                   &size)) {
-                    param_write_hex(pb, "CodecPrivateData",
-                                    ptr ? ptr : track->enc->extradata,
-                                    size);
-                    av_free(ptr);
-                }
-                param_write_string(pb, "FourCC", "H264");
-            } else if (track->enc->codec_id == AV_CODEC_ID_VC1) {
-                param_write_string(pb, "FourCC", "WVC1");
-                param_write_hex(pb, "CodecPrivateData", track->enc->extradata,
-                                track->enc->extradata_size);
-            }
-            param_write_int(pb, "MaxWidth", track->enc->width);
-            param_write_int(pb, "MaxHeight", track->enc->height);
-            param_write_int(pb, "DisplayWidth", track->enc->width);
-            param_write_int(pb, "DisplayHeight", track->enc->height);
-        } else {
-            if (track->enc->codec_id == AV_CODEC_ID_AAC) {
-                param_write_string(pb, "FourCC", "AACL");
-            } else if (track->enc->codec_id == AV_CODEC_ID_WMAPRO) {
-                param_write_string(pb, "FourCC", "WMAP");
-            }
-            param_write_hex(pb, "CodecPrivateData", track->enc->extradata,
-                            track->enc->extradata_size);
-            param_write_int(pb, "AudioTag", ff_codec_get_tag(ff_codec_wav_tags,
-                                                             track->enc->codec_id));
-            param_write_int(pb, "Channels", track->enc->channels);
-            param_write_int(pb, "SamplingRate", track->enc->sample_rate);
-            param_write_int(pb, "BitsPerSample", 16);
-            param_write_int(pb, "PacketSize", track->enc->block_align ?
-                                              track->enc->block_align : 4);
-        }
-        avio_printf(pb, "</%s>\n", type);
-    }
-    avio_printf(pb, "</switch>\n");
-    avio_printf(pb, "</body>\n");
-    avio_printf(pb, "</smil>\n");
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_mfhd_tag(AVIOContext *pb, MOVMuxContext *mov)
-{
-    avio_wb32(pb, 16);
-    ffio_wfourcc(pb, "mfhd");
-    avio_wb32(pb, 0);
-    avio_wb32(pb, mov->fragments);
-    return 0;
-}
-
-static int mov_write_tfhd_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              MOVTrack *track, int64_t moof_offset)
-{
-    int64_t pos = avio_tell(pb);
-    uint32_t flags = MOV_TFHD_DEFAULT_SIZE | MOV_TFHD_DEFAULT_DURATION |
-                     MOV_TFHD_BASE_DATA_OFFSET;
-    if (!track->entry) {
-        flags |= MOV_TFHD_DURATION_IS_EMPTY;
-    } else {
-        flags |= MOV_TFHD_DEFAULT_FLAGS;
-    }
-    if (mov->flags & FF_MOV_FLAG_OMIT_TFHD_OFFSET)
-        flags &= ~MOV_TFHD_BASE_DATA_OFFSET;
-
-    /* Don't set a default sample size, the silverlight player refuses
-     * to play files with that set. Don't set a default sample duration,
-     * WMP freaks out if it is set. Don't set a base data offset, PIFF
-     * file format says it MUST NOT be set. */
-    if (track->mode == MODE_ISM)
-        flags &= ~(MOV_TFHD_DEFAULT_SIZE | MOV_TFHD_DEFAULT_DURATION |
-                   MOV_TFHD_BASE_DATA_OFFSET);
-
-    avio_wb32(pb, 0); /* size placeholder */
-    ffio_wfourcc(pb, "tfhd");
-    avio_w8(pb, 0); /* version */
-    avio_wb24(pb, flags);
-
-    avio_wb32(pb, track->track_id); /* track-id */
-    if (flags & MOV_TFHD_BASE_DATA_OFFSET)
-        avio_wb64(pb, moof_offset);
-    if (flags & MOV_TFHD_DEFAULT_DURATION) {
-        track->default_duration = get_cluster_duration(track, 0);
-        avio_wb32(pb, track->default_duration);
-    }
-    if (flags & MOV_TFHD_DEFAULT_SIZE) {
-        track->default_size = track->entry ? track->cluster[0].size : 1;
-        avio_wb32(pb, track->default_size);
-    } else
-        track->default_size = -1;
-
-    if (flags & MOV_TFHD_DEFAULT_FLAGS) {
-        track->default_sample_flags =
-            track->enc->codec_type == AVMEDIA_TYPE_VIDEO ?
-            (MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES | MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC) :
-            MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO;
-        avio_wb32(pb, track->default_sample_flags);
-    }
-
-    return update_size(pb, pos);
-}
-
-static uint32_t get_sample_flags(MOVTrack *track, MOVIentry *entry)
-{
-    return entry->flags & MOV_SYNC_SAMPLE ? MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO :
-           (MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES | MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC);
-}
-
-static int mov_write_trun_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              MOVTrack *track, int moof_size)
-{
-    int64_t pos = avio_tell(pb);
-    uint32_t flags = MOV_TRUN_DATA_OFFSET;
-    int i;
-
-    for (i = 0; i < track->entry; i++) {
-        if (get_cluster_duration(track, i) != track->default_duration)
-            flags |= MOV_TRUN_SAMPLE_DURATION;
-        if (track->cluster[i].size != track->default_size)
-            flags |= MOV_TRUN_SAMPLE_SIZE;
-        if (i > 0 && get_sample_flags(track, &track->cluster[i]) != track->default_sample_flags)
-            flags |= MOV_TRUN_SAMPLE_FLAGS;
-    }
-    if (!(flags & MOV_TRUN_SAMPLE_FLAGS))
-        flags |= MOV_TRUN_FIRST_SAMPLE_FLAGS;
-    if (track->flags & MOV_TRACK_CTTS)
-        flags |= MOV_TRUN_SAMPLE_CTS;
-
-    avio_wb32(pb, 0); /* size placeholder */
-    ffio_wfourcc(pb, "trun");
-    avio_w8(pb, 0); /* version */
-    avio_wb24(pb, flags);
-
-    avio_wb32(pb, track->entry); /* sample count */
-    if (mov->flags & FF_MOV_FLAG_OMIT_TFHD_OFFSET &&
-        !(mov->flags & FF_MOV_FLAG_SEPARATE_MOOF) &&
-        track->track_id != 1)
-        avio_wb32(pb, 0); /* Later tracks follow immediately after the previous one */
-    else
-        avio_wb32(pb, moof_size + 8 + track->data_offset +
-                      track->cluster[0].pos); /* data offset */
-    if (flags & MOV_TRUN_FIRST_SAMPLE_FLAGS)
-        avio_wb32(pb, get_sample_flags(track, &track->cluster[0]));
-
-    for (i = 0; i < track->entry; i++) {
-        if (flags & MOV_TRUN_SAMPLE_DURATION)
-            avio_wb32(pb, get_cluster_duration(track, i));
-        if (flags & MOV_TRUN_SAMPLE_SIZE)
-            avio_wb32(pb, track->cluster[i].size);
-        if (flags & MOV_TRUN_SAMPLE_FLAGS)
-            avio_wb32(pb, get_sample_flags(track, &track->cluster[i]));
-        if (flags & MOV_TRUN_SAMPLE_CTS)
-            avio_wb32(pb, track->cluster[i].cts);
-    }
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_tfxd_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    const uint8_t uuid[] = {
-        0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
-        0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
-    };
-
-    avio_wb32(pb, 0); /* size placeholder */
-    ffio_wfourcc(pb, "uuid");
-    avio_write(pb, uuid, sizeof(uuid));
-    avio_w8(pb, 1);
-    avio_wb24(pb, 0);
-    avio_wb64(pb, track->frag_start);
-    avio_wb64(pb, track->start_dts + track->track_duration -
-                  track->cluster[0].dts);
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_tfrf_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              MOVTrack *track, int entry)
-{
-    int n = track->nb_frag_info - 1 - entry, i;
-    int size = 8 + 16 + 4 + 1 + 16*n;
-    const uint8_t uuid[] = {
-        0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
-        0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f
-    };
-
-    if (entry < 0)
-        return 0;
-
-    avio_seek(pb, track->frag_info[entry].tfrf_offset, SEEK_SET);
-    avio_wb32(pb, size);
-    ffio_wfourcc(pb, "uuid");
-    avio_write(pb, uuid, sizeof(uuid));
-    avio_w8(pb, 1);
-    avio_wb24(pb, 0);
-    avio_w8(pb, n);
-    for (i = 0; i < n; i++) {
-        int index = entry + 1 + i;
-        avio_wb64(pb, track->frag_info[index].time);
-        avio_wb64(pb, track->frag_info[index].duration);
-    }
-    if (n < mov->ism_lookahead) {
-        int free_size = 16 * (mov->ism_lookahead - n);
-        avio_wb32(pb, free_size);
-        ffio_wfourcc(pb, "free");
-        for (i = 0; i < free_size - 8; i++)
-            avio_w8(pb, 0);
-    }
-
-    return 0;
-}
-
-static int mov_write_tfrf_tags(AVIOContext *pb, MOVMuxContext *mov,
-                               MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    int i;
-    for (i = 0; i < mov->ism_lookahead; i++) {
-        /* Update the tfrf tag for the last ism_lookahead fragments,
-         * nb_frag_info - 1 is the next fragment to be written. */
-        mov_write_tfrf_tag(pb, mov, track, track->nb_frag_info - 2 - i);
-    }
-    avio_seek(pb, pos, SEEK_SET);
-    return 0;
-}
-
-static int mov_write_traf_tag(AVIOContext *pb, MOVMuxContext *mov,
-                              MOVTrack *track, int64_t moof_offset,
-                              int moof_size)
-{
-    int64_t pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size placeholder */
-    ffio_wfourcc(pb, "traf");
-
-    mov_write_tfhd_tag(pb, mov, track, moof_offset);
-    mov_write_trun_tag(pb, mov, track, moof_size);
-    if (mov->mode == MODE_ISM) {
-        mov_write_tfxd_tag(pb, track);
-
-        if (mov->ism_lookahead) {
-            int i, size = 16 + 4 + 1 + 16 * mov->ism_lookahead;
-
-            track->tfrf_offset = avio_tell(pb);
-            avio_wb32(pb, 8 + size);
-            ffio_wfourcc(pb, "free");
-            for (i = 0; i < size; i++)
-                avio_w8(pb, 0);
-        }
-    }
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_moof_tag_internal(AVIOContext *pb, MOVMuxContext *mov,
-                                       int tracks, int moof_size)
-{
-    int64_t pos = avio_tell(pb);
-    int i;
-
-    avio_wb32(pb, 0); /* size placeholder */
-    ffio_wfourcc(pb, "moof");
-
-    mov_write_mfhd_tag(pb, mov);
-    for (i = 0; i < mov->nb_streams; i++) {
-        MOVTrack *track = &mov->tracks[i];
-        if (tracks >= 0 && i != tracks)
-            continue;
-        if (!track->entry)
-            continue;
-        mov_write_traf_tag(pb, mov, track, pos, moof_size);
-    }
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_moof_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks)
-{
-    AVIOContext *avio_buf;
-    int ret, moof_size;
-
-    if ((ret = ffio_open_null_buf(&avio_buf)) < 0)
-        return ret;
-    mov_write_moof_tag_internal(avio_buf, mov, tracks, 0);
-    moof_size = ffio_close_null_buf(avio_buf);
-    return mov_write_moof_tag_internal(pb, mov, tracks, moof_size);
-}
-
-static int mov_write_tfra_tag(AVIOContext *pb, MOVTrack *track)
-{
-    int64_t pos = avio_tell(pb);
-    int i;
-
-    avio_wb32(pb, 0); /* size placeholder */
-    ffio_wfourcc(pb, "tfra");
-    avio_w8(pb, 1); /* version */
-    avio_wb24(pb, 0);
-
-    avio_wb32(pb, track->track_id);
-    avio_wb32(pb, 0); /* length of traf/trun/sample num */
-    avio_wb32(pb, track->nb_frag_info);
-    for (i = 0; i < track->nb_frag_info; i++) {
-        avio_wb64(pb, track->frag_info[i].time);
-        avio_wb64(pb, track->frag_info[i].offset);
-        avio_w8(pb, 1); /* traf number */
-        avio_w8(pb, 1); /* trun number */
-        avio_w8(pb, 1); /* sample number */
-    }
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov)
-{
-    int64_t pos = avio_tell(pb);
-    int i;
-
-    avio_wb32(pb, 0); /* size placeholder */
-    ffio_wfourcc(pb, "mfra");
-    /* An empty mfra atom is enough to indicate to the publishing point that
-     * the stream has ended. */
-    if (mov->flags & FF_MOV_FLAG_ISML)
-        return update_size(pb, pos);
-
-    for (i = 0; i < mov->nb_streams; i++) {
-        MOVTrack *track = &mov->tracks[i];
-        if (track->nb_frag_info)
-            mov_write_tfra_tag(pb, track);
-    }
-
-    avio_wb32(pb, 16);
-    ffio_wfourcc(pb, "mfro");
-    avio_wb32(pb, 0); /* version + flags */
-    avio_wb32(pb, avio_tell(pb) + 4 - pos);
-
-    return update_size(pb, pos);
-}
-
-static int mov_write_mdat_tag(AVIOContext *pb, MOVMuxContext *mov)
-{
-    avio_wb32(pb, 8);    // placeholder for extended size field (64 bit)
-    ffio_wfourcc(pb, mov->mode == MODE_MOV ? "wide" : "free");
-
-    mov->mdat_pos = avio_tell(pb);
-    avio_wb32(pb, 0); /* size placeholder*/
-    ffio_wfourcc(pb, "mdat");
-    return 0;
-}
-
-/* TODO: This needs to be more general */
-static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
-{
-    MOVMuxContext *mov = s->priv_data;
-    int64_t pos = avio_tell(pb);
-    int has_h264 = 0, has_video = 0;
-    int minor = 0x200;
-    int i;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-            has_video = 1;
-        if (st->codec->codec_id == AV_CODEC_ID_H264)
-            has_h264 = 1;
-    }
-
-    avio_wb32(pb, 0); /* size */
-    ffio_wfourcc(pb, "ftyp");
-
-    if (mov->major_brand && strlen(mov->major_brand) >= 4)
-        ffio_wfourcc(pb, mov->major_brand);
-    else if (mov->mode == MODE_3GP) {
-        ffio_wfourcc(pb, has_h264 ? "3gp6"  : "3gp4");
-        minor =     has_h264 ?   0x100 :   0x200;
-    } else if (mov->mode & MODE_3G2) {
-        ffio_wfourcc(pb, has_h264 ? "3g2b"  : "3g2a");
-        minor =     has_h264 ? 0x20000 : 0x10000;
-    } else if (mov->mode == MODE_PSP)
-        ffio_wfourcc(pb, "MSNV");
-    else if (mov->mode == MODE_MP4)
-        ffio_wfourcc(pb, "isom");
-    else if (mov->mode == MODE_IPOD)
-        ffio_wfourcc(pb, has_video ? "M4V ":"M4A ");
-    else if (mov->mode == MODE_ISM)
-        ffio_wfourcc(pb, "isml");
-    else if (mov->mode == MODE_F4V)
-        ffio_wfourcc(pb, "f4v ");
-    else
-        ffio_wfourcc(pb, "qt  ");
-
-    avio_wb32(pb, minor);
-
-    if (mov->mode == MODE_MOV)
-        ffio_wfourcc(pb, "qt  ");
-    else if (mov->mode == MODE_ISM) {
-        ffio_wfourcc(pb, "piff");
-        ffio_wfourcc(pb, "iso2");
-    } else {
-        ffio_wfourcc(pb, "isom");
-        ffio_wfourcc(pb, "iso2");
-        if (has_h264)
-            ffio_wfourcc(pb, "avc1");
-    }
-
-    if (mov->mode == MODE_3GP)
-        ffio_wfourcc(pb, has_h264 ? "3gp6":"3gp4");
-    else if (mov->mode & MODE_3G2)
-        ffio_wfourcc(pb, has_h264 ? "3g2b":"3g2a");
-    else if (mov->mode == MODE_PSP)
-        ffio_wfourcc(pb, "MSNV");
-    else if (mov->mode == MODE_MP4)
-        ffio_wfourcc(pb, "mp41");
-    return update_size(pb, pos);
-}
-
-static void mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s)
-{
-    AVCodecContext *video_codec = s->streams[0]->codec;
-    AVCodecContext *audio_codec = s->streams[1]->codec;
-    int audio_rate = audio_codec->sample_rate;
-    int frame_rate = ((video_codec->time_base.den) * (0x10000)) / (video_codec->time_base.num);
-    int audio_kbitrate = audio_codec->bit_rate / 1000;
-    int video_kbitrate = FFMIN(video_codec->bit_rate / 1000, 800 - audio_kbitrate);
-
-    avio_wb32(pb, 0x94); /* size */
-    ffio_wfourcc(pb, "uuid");
-    ffio_wfourcc(pb, "PROF");
-
-    avio_wb32(pb, 0x21d24fce); /* 96 bit UUID */
-    avio_wb32(pb, 0xbb88695c);
-    avio_wb32(pb, 0xfac9c740);
-
-    avio_wb32(pb, 0x0);  /* ? */
-    avio_wb32(pb, 0x3);  /* 3 sections ? */
-
-    avio_wb32(pb, 0x14); /* size */
-    ffio_wfourcc(pb, "FPRF");
-    avio_wb32(pb, 0x0);  /* ? */
-    avio_wb32(pb, 0x0);  /* ? */
-    avio_wb32(pb, 0x0);  /* ? */
-
-    avio_wb32(pb, 0x2c);  /* size */
-    ffio_wfourcc(pb, "APRF"); /* audio */
-    avio_wb32(pb, 0x0);
-    avio_wb32(pb, 0x2);   /* TrackID */
-    ffio_wfourcc(pb, "mp4a");
-    avio_wb32(pb, 0x20f);
-    avio_wb32(pb, 0x0);
-    avio_wb32(pb, audio_kbitrate);
-    avio_wb32(pb, audio_kbitrate);
-    avio_wb32(pb, audio_rate);
-    avio_wb32(pb, audio_codec->channels);
-
-    avio_wb32(pb, 0x34);  /* size */
-    ffio_wfourcc(pb, "VPRF");   /* video */
-    avio_wb32(pb, 0x0);
-    avio_wb32(pb, 0x1);    /* TrackID */
-    if (video_codec->codec_id == AV_CODEC_ID_H264) {
-        ffio_wfourcc(pb, "avc1");
-        avio_wb16(pb, 0x014D);
-        avio_wb16(pb, 0x0015);
-    } else {
-        ffio_wfourcc(pb, "mp4v");
-        avio_wb16(pb, 0x0000);
-        avio_wb16(pb, 0x0103);
-    }
-    avio_wb32(pb, 0x0);
-    avio_wb32(pb, video_kbitrate);
-    avio_wb32(pb, video_kbitrate);
-    avio_wb32(pb, frame_rate);
-    avio_wb32(pb, frame_rate);
-    avio_wb16(pb, video_codec->width);
-    avio_wb16(pb, video_codec->height);
-    avio_wb32(pb, 0x010001); /* ? */
-}
-
-static int mov_parse_mpeg2_frame(AVPacket *pkt, uint32_t *flags)
-{
-    uint32_t c = -1;
-    int i, closed_gop = 0;
-
-    for (i = 0; i < pkt->size - 4; i++) {
-        c = (c << 8) + pkt->data[i];
-        if (c == 0x1b8) { // gop
-            closed_gop = pkt->data[i + 4] >> 6 & 0x01;
-        } else if (c == 0x100) { // pic
-            int temp_ref = (pkt->data[i + 1] << 2) | (pkt->data[i + 2] >> 6);
-            if (!temp_ref || closed_gop) // I picture is not reordered
-                *flags = MOV_SYNC_SAMPLE;
-            else
-                *flags = MOV_PARTIAL_SYNC_SAMPLE;
-            break;
-        }
-    }
-    return 0;
-}
-
-static void mov_parse_vc1_frame(AVPacket *pkt, MOVTrack *trk, int fragment)
-{
-    const uint8_t *start, *next, *end = pkt->data + pkt->size;
-    int seq = 0, entry = 0;
-    int key = pkt->flags & AV_PKT_FLAG_KEY;
-    start = find_next_marker(pkt->data, end);
-    for (next = start; next < end; start = next) {
-        next = find_next_marker(start + 4, end);
-        switch (AV_RB32(start)) {
-        case VC1_CODE_SEQHDR:
-            seq = 1;
-            break;
-        case VC1_CODE_ENTRYPOINT:
-            entry = 1;
-            break;
-        case VC1_CODE_SLICE:
-            trk->vc1_info.slices = 1;
-            break;
-        }
-    }
-    if (!trk->entry && !fragment) {
-        /* First packet in first fragment */
-        trk->vc1_info.first_packet_seq   = seq;
-        trk->vc1_info.first_packet_entry = entry;
-    } else if ((seq && !trk->vc1_info.packet_seq) ||
-               (entry && !trk->vc1_info.packet_entry)) {
-        int i;
-        for (i = 0; i < trk->entry; i++)
-            trk->cluster[i].flags &= ~MOV_SYNC_SAMPLE;
-        trk->has_keyframes = 0;
-        if (seq)
-            trk->vc1_info.packet_seq = 1;
-        if (entry)
-            trk->vc1_info.packet_entry = 1;
-        if (!fragment) {
-            /* First fragment */
-            if ((!seq   || trk->vc1_info.first_packet_seq) &&
-                (!entry || trk->vc1_info.first_packet_entry)) {
-                /* First packet had the same headers as this one, readd the
-                 * sync sample flag. */
-                trk->cluster[0].flags |= MOV_SYNC_SAMPLE;
-                trk->has_keyframes = 1;
-            }
-        }
-    }
-    if (trk->vc1_info.packet_seq && trk->vc1_info.packet_entry)
-        key = seq && entry;
-    else if (trk->vc1_info.packet_seq)
-        key = seq;
-    else if (trk->vc1_info.packet_entry)
-        key = entry;
-    if (key) {
-        trk->cluster[trk->entry].flags |= MOV_SYNC_SAMPLE;
-        trk->has_keyframes++;
-    }
-}
-
-static int mov_flush_fragment(AVFormatContext *s)
-{
-    MOVMuxContext *mov = s->priv_data;
-    int i, first_track = -1;
-    int64_t mdat_size = 0;
-
-    if (!(mov->flags & FF_MOV_FLAG_FRAGMENT))
-        return 0;
-
-    if (!(mov->flags & FF_MOV_FLAG_EMPTY_MOOV) && mov->fragments == 0) {
-        int64_t pos = avio_tell(s->pb);
-        int ret;
-        AVIOContext *moov_buf;
-        uint8_t *buf;
-        int buf_size;
-
-        for (i = 0; i < mov->nb_streams; i++)
-            if (!mov->tracks[i].entry)
-                break;
-        /* Don't write the initial moov unless all tracks have data */
-        if (i < mov->nb_streams)
-            return 0;
-
-        if ((ret = ffio_open_null_buf(&moov_buf)) < 0)
-            return ret;
-        mov_write_moov_tag(moov_buf, mov, s);
-        buf_size = ffio_close_null_buf(moov_buf);
-        for (i = 0; i < mov->nb_streams; i++)
-            mov->tracks[i].data_offset = pos + buf_size + 8;
-
-        mov_write_moov_tag(s->pb, mov, s);
-
-        buf_size = avio_close_dyn_buf(mov->mdat_buf, &buf);
-        mov->mdat_buf = NULL;
-        avio_wb32(s->pb, buf_size + 8);
-        ffio_wfourcc(s->pb, "mdat");
-        avio_write(s->pb, buf, buf_size);
-        av_free(buf);
-
-        mov->fragments++;
-        mov->mdat_size = 0;
-        for (i = 0; i < mov->nb_streams; i++) {
-            if (mov->tracks[i].entry)
-                mov->tracks[i].frag_start += mov->tracks[i].start_dts +
-                                             mov->tracks[i].track_duration -
-                                             mov->tracks[i].cluster[0].dts;
-            mov->tracks[i].entry = 0;
-        }
-        avio_flush(s->pb);
-        return 0;
-    }
-
-    for (i = 0; i < mov->nb_streams; i++) {
-        MOVTrack *track = &mov->tracks[i];
-        if (mov->flags & FF_MOV_FLAG_SEPARATE_MOOF)
-            track->data_offset = 0;
-        else
-            track->data_offset = mdat_size;
-        if (!track->mdat_buf)
-            continue;
-        mdat_size += avio_tell(track->mdat_buf);
-        if (first_track < 0)
-            first_track = i;
-    }
-
-    if (!mdat_size)
-        return 0;
-
-    for (i = 0; i < mov->nb_streams; i++) {
-        MOVTrack *track = &mov->tracks[i];
-        int buf_size, write_moof = 1, moof_tracks = -1;
-        uint8_t *buf;
-        int64_t duration = 0;
-
-        if (track->entry)
-            duration = track->start_dts + track->track_duration -
-                       track->cluster[0].dts;
-        if (mov->flags & FF_MOV_FLAG_SEPARATE_MOOF) {
-            if (!track->mdat_buf)
-                continue;
-            mdat_size = avio_tell(track->mdat_buf);
-            moof_tracks = i;
-        } else {
-            write_moof = i == first_track;
-        }
-
-        if (write_moof) {
-            MOVFragmentInfo *info;
-            avio_flush(s->pb);
-            track->nb_frag_info++;
-            if (track->nb_frag_info >= track->frag_info_capacity) {
-                unsigned new_capacity = track->nb_frag_info + MOV_FRAG_INFO_ALLOC_INCREMENT;
-                if (av_reallocp_array(&track->frag_info,
-                                      new_capacity,
-                                      sizeof(*track->frag_info)))
-                    return AVERROR(ENOMEM);
-                track->frag_info_capacity = new_capacity;
-            }
-            info = &track->frag_info[track->nb_frag_info - 1];
-            info->offset   = avio_tell(s->pb);
-            info->time     = mov->tracks[i].frag_start;
-            info->duration = duration;
-            mov_write_tfrf_tags(s->pb, mov, track);
-
-            mov_write_moof_tag(s->pb, mov, moof_tracks);
-            info->tfrf_offset = track->tfrf_offset;
-            mov->fragments++;
-
-            avio_wb32(s->pb, mdat_size + 8);
-            ffio_wfourcc(s->pb, "mdat");
-        }
-
-        if (track->entry)
-            track->frag_start += duration;
-        track->entry = 0;
-        if (!track->mdat_buf)
-            continue;
-        buf_size = avio_close_dyn_buf(track->mdat_buf, &buf);
-        track->mdat_buf = NULL;
-
-        avio_write(s->pb, buf, buf_size);
-        av_free(buf);
-    }
-
-    mov->mdat_size = 0;
-
-    avio_flush(s->pb);
-    return 0;
-}
-
-int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MOVMuxContext *mov = s->priv_data;
-    AVIOContext *pb = s->pb;
-    MOVTrack *trk = &mov->tracks[pkt->stream_index];
-    AVCodecContext *enc = trk->enc;
-    unsigned int samples_in_chunk = 0;
-    int size = pkt->size;
-    uint8_t *reformatted_data = NULL;
-
-    if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
-        int ret;
-        if (mov->fragments > 0) {
-            if (!trk->mdat_buf) {
-                if ((ret = avio_open_dyn_buf(&trk->mdat_buf)) < 0)
-                    return ret;
-            }
-            pb = trk->mdat_buf;
-        } else {
-            if (!mov->mdat_buf) {
-                if ((ret = avio_open_dyn_buf(&mov->mdat_buf)) < 0)
-                    return ret;
-            }
-            pb = mov->mdat_buf;
-        }
-    }
-
-    if (enc->codec_id == AV_CODEC_ID_AMR_NB) {
-        /* We must find out how many AMR blocks there are in one packet */
-        static uint16_t packed_size[16] =
-            {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 1};
-        int len = 0;
-
-        while (len < size && samples_in_chunk < 100) {
-            len += packed_size[(pkt->data[len] >> 3) & 0x0F];
-            samples_in_chunk++;
-        }
-        if (samples_in_chunk > 1) {
-            av_log(s, AV_LOG_ERROR, "fatal error, input is not a single packet, implement a AVParser for it\n");
-            return -1;
-        }
-    } else if (trk->sample_size)
-        samples_in_chunk = size / trk->sample_size;
-    else
-        samples_in_chunk = 1;
-
-    /* copy extradata if it exists */
-    if (trk->vos_len == 0 && enc->extradata_size > 0) {
-        trk->vos_len  = enc->extradata_size;
-        trk->vos_data = av_malloc(trk->vos_len);
-        memcpy(trk->vos_data, enc->extradata, trk->vos_len);
-    }
-
-    if (enc->codec_id == AV_CODEC_ID_H264 && trk->vos_len > 0 && *(uint8_t *)trk->vos_data != 1) {
-        /* from x264 or from bytestream h264 */
-        /* nal reformating needed */
-        if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
-            ff_avc_parse_nal_units_buf(pkt->data, &reformatted_data,
-                                       &size);
-            avio_write(pb, reformatted_data, size);
-        } else {
-            size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
-        }
-    } else if (enc->codec_id == AV_CODEC_ID_HEVC && trk->vos_len > 6 &&
-               (AV_RB24(trk->vos_data) == 1 || AV_RB32(trk->vos_data) == 1)) {
-        /* extradata is Annex B, assume the bitstream is too and convert it */
-        if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
-            ff_hevc_annexb2mp4_buf(pkt->data, &reformatted_data, &size, 0, NULL);
-            avio_write(pb, reformatted_data, size);
-        } else {
-            size = ff_hevc_annexb2mp4(pb, pkt->data, pkt->size, 0, NULL);
-        }
-    } else {
-        avio_write(pb, pkt->data, size);
-    }
-
-    if ((enc->codec_id == AV_CODEC_ID_DNXHD ||
-         enc->codec_id == AV_CODEC_ID_AC3) && !trk->vos_len) {
-        /* copy frame to create needed atoms */
-        trk->vos_len  = size;
-        trk->vos_data = av_malloc(size);
-        if (!trk->vos_data)
-            return AVERROR(ENOMEM);
-        memcpy(trk->vos_data, pkt->data, size);
-    }
-
-    if (trk->entry >= trk->cluster_capacity) {
-        unsigned new_capacity = 2 * (trk->entry + MOV_INDEX_CLUSTER_SIZE);
-        if (av_reallocp_array(&trk->cluster, new_capacity,
-                              sizeof(*trk->cluster)))
-            return AVERROR(ENOMEM);
-        trk->cluster_capacity = new_capacity;
-    }
-
-    trk->cluster[trk->entry].pos              = avio_tell(pb) - size;
-    trk->cluster[trk->entry].samples_in_chunk = samples_in_chunk;
-    trk->cluster[trk->entry].size             = size;
-    trk->cluster[trk->entry].entries          = samples_in_chunk;
-    trk->cluster[trk->entry].dts              = pkt->dts;
-    if (!trk->entry && trk->start_dts != AV_NOPTS_VALUE) {
-        /* First packet of a new fragment. We already wrote the duration
-         * of the last packet of the previous fragment based on track_duration,
-         * which might not exactly match our dts. Therefore adjust the dts
-         * of this packet to be what the previous packets duration implies. */
-        trk->cluster[trk->entry].dts = trk->start_dts + trk->track_duration;
-    }
-    if (trk->start_dts == AV_NOPTS_VALUE)
-        trk->start_dts = pkt->dts;
-    trk->track_duration = pkt->dts - trk->start_dts + pkt->duration;
-
-    if (pkt->pts == AV_NOPTS_VALUE) {
-        av_log(s, AV_LOG_WARNING, "pts has no value\n");
-        pkt->pts = pkt->dts;
-    }
-    if (pkt->dts != pkt->pts)
-        trk->flags |= MOV_TRACK_CTTS;
-    trk->cluster[trk->entry].cts   = pkt->pts - pkt->dts;
-    trk->cluster[trk->entry].flags = 0;
-    if (enc->codec_id == AV_CODEC_ID_VC1) {
-        mov_parse_vc1_frame(pkt, trk, mov->fragments);
-    } else if (pkt->flags & AV_PKT_FLAG_KEY) {
-        if (mov->mode == MODE_MOV && enc->codec_id == AV_CODEC_ID_MPEG2VIDEO &&
-            trk->entry > 0) { // force sync sample for the first key frame
-            mov_parse_mpeg2_frame(pkt, &trk->cluster[trk->entry].flags);
-            if (trk->cluster[trk->entry].flags & MOV_PARTIAL_SYNC_SAMPLE)
-                trk->flags |= MOV_TRACK_STPS;
-        } else {
-            trk->cluster[trk->entry].flags = MOV_SYNC_SAMPLE;
-        }
-        if (trk->cluster[trk->entry].flags & MOV_SYNC_SAMPLE)
-            trk->has_keyframes++;
-    }
-    trk->entry++;
-    trk->sample_count += samples_in_chunk;
-    mov->mdat_size    += size;
-
-    if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams)
-        ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry,
-                                 reformatted_data, size);
-    av_free(reformatted_data);
-    return 0;
-}
-
-static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    if (!pkt) {
-        mov_flush_fragment(s);
-        return 1;
-    } else {
-        MOVMuxContext *mov = s->priv_data;
-        MOVTrack *trk = &mov->tracks[pkt->stream_index];
-        AVCodecContext *enc = trk->enc;
-        int64_t frag_duration = 0;
-        int size = pkt->size;
-
-        if (!pkt->size)
-            return 0;             /* Discard 0 sized packets */
-
-        if (trk->entry)
-            frag_duration = av_rescale_q(pkt->dts - trk->cluster[0].dts,
-                                         s->streams[pkt->stream_index]->time_base,
-                                         AV_TIME_BASE_Q);
-        if ((mov->max_fragment_duration &&
-             frag_duration >= mov->max_fragment_duration) ||
-             (mov->max_fragment_size && mov->mdat_size + size >= mov->max_fragment_size) ||
-             (mov->flags & FF_MOV_FLAG_FRAG_KEYFRAME &&
-              enc->codec_type == AVMEDIA_TYPE_VIDEO &&
-              trk->entry && pkt->flags & AV_PKT_FLAG_KEY)) {
-            if (frag_duration >= mov->min_fragment_duration)
-                mov_flush_fragment(s);
-        }
-
-        return ff_mov_write_packet(s, pkt);
-    }
-}
-
-// QuickTime chapters involve an additional text track with the chapter names
-// as samples, and a tref pointing from the other tracks to the chapter one.
-static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
-{
-    MOVMuxContext *mov = s->priv_data;
-    MOVTrack *track = &mov->tracks[tracknum];
-    AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY };
-    int i, len;
-    // These properties are required to make QT recognize the chapter track
-    uint8_t chapter_properties[43] = { 0, 0, 0, 0, 0, 0, 0, 1, };
-
-    track->mode = mov->mode;
-    track->tag = MKTAG('t','e','x','t');
-    track->timescale = MOV_TIMESCALE;
-    track->enc = avcodec_alloc_context3(NULL);
-    if (!track->enc)
-        return AVERROR(ENOMEM);
-    track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
-    track->enc->extradata = av_malloc(sizeof(chapter_properties));
-    if (track->enc->extradata == NULL)
-        return AVERROR(ENOMEM);
-    track->enc->extradata_size = sizeof(chapter_properties);
-    memcpy(track->enc->extradata, chapter_properties, sizeof(chapter_properties));
-
-    for (i = 0; i < s->nb_chapters; i++) {
-        AVChapter *c = s->chapters[i];
-        AVDictionaryEntry *t;
-
-        int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE});
-        pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE});
-        pkt.duration = end - pkt.dts;
-
-        if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
-            len      = strlen(t->value);
-            pkt.size = len + 2;
-            pkt.data = av_malloc(pkt.size);
-            if (!pkt.data)
-                return AVERROR(ENOMEM);
-            AV_WB16(pkt.data, len);
-            memcpy(pkt.data + 2, t->value, len);
-            ff_mov_write_packet(s, &pkt);
-            av_freep(&pkt.data);
-        }
-    }
-
-    return 0;
-}
-
-/*
- * st->disposition controls the "enabled" flag in the tkhd tag.
- * QuickTime will not play a track if it is not enabled.  So make sure
- * that one track of each type (audio, video, subtitle) is enabled.
- *
- * Subtitles are special.  For audio and video, setting "enabled" also
- * makes the track "default" (i.e. it is rendered when played). For
- * subtitles, an "enabled" subtitle is not rendered by default, but
- * if no subtitle is enabled, the subtitle menu in QuickTime will be
- * empty!
- */
-static void enable_tracks(AVFormatContext *s)
-{
-    MOVMuxContext *mov = s->priv_data;
-    int i;
-    uint8_t enabled[AVMEDIA_TYPE_NB];
-    int first[AVMEDIA_TYPE_NB];
-
-    for (i = 0; i < AVMEDIA_TYPE_NB; i++) {
-        enabled[i] = 0;
-        first[i] = -1;
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-
-        if (st->codec->codec_type <= AVMEDIA_TYPE_UNKNOWN ||
-            st->codec->codec_type >= AVMEDIA_TYPE_NB)
-            continue;
-
-        if (first[st->codec->codec_type] < 0)
-            first[st->codec->codec_type] = i;
-        if (st->disposition & AV_DISPOSITION_DEFAULT) {
-            mov->tracks[i].flags |= MOV_TRACK_ENABLED;
-            enabled[st->codec->codec_type] = 1;
-        }
-    }
-
-    for (i = 0; i < AVMEDIA_TYPE_NB; i++) {
-        switch (i) {
-        case AVMEDIA_TYPE_VIDEO:
-        case AVMEDIA_TYPE_AUDIO:
-        case AVMEDIA_TYPE_SUBTITLE:
-            if (!enabled[i] && first[i] >= 0)
-                mov->tracks[first[i]].flags |= MOV_TRACK_ENABLED;
-            break;
-        }
-    }
-}
-
-static void mov_free(AVFormatContext *s)
-{
-    MOVMuxContext *mov = s->priv_data;
-    int i;
-
-    if (mov->chapter_track) {
-        if (mov->tracks[mov->chapter_track].enc)
-            av_free(mov->tracks[mov->chapter_track].enc->extradata);
-        av_freep(&mov->tracks[mov->chapter_track].enc);
-    }
-
-    for (i = 0; i < mov->nb_streams; i++) {
-        if (mov->tracks[i].tag == MKTAG('r','t','p',' '))
-            ff_mov_close_hinting(&mov->tracks[i]);
-        av_freep(&mov->tracks[i].cluster);
-        av_freep(&mov->tracks[i].frag_info);
-
-        if (mov->tracks[i].vos_len)
-            av_free(mov->tracks[i].vos_data);
-    }
-
-    av_freep(&mov->tracks);
-}
-
-static int mov_write_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    MOVMuxContext *mov = s->priv_data;
-    AVDictionaryEntry *t;
-    int i, hint_track = 0;
-
-    /* Default mode == MP4 */
-    mov->mode = MODE_MP4;
-
-    if (s->oformat != NULL) {
-        if (!strcmp("3gp", s->oformat->name)) mov->mode = MODE_3GP;
-        else if (!strcmp("3g2", s->oformat->name)) mov->mode = MODE_3GP|MODE_3G2;
-        else if (!strcmp("mov", s->oformat->name)) mov->mode = MODE_MOV;
-        else if (!strcmp("psp", s->oformat->name)) mov->mode = MODE_PSP;
-        else if (!strcmp("ipod",s->oformat->name)) mov->mode = MODE_IPOD;
-        else if (!strcmp("ismv",s->oformat->name)) mov->mode = MODE_ISM;
-        else if (!strcmp("f4v", s->oformat->name)) mov->mode = MODE_F4V;
-    }
-
-    /* Set the FRAGMENT flag if any of the fragmentation methods are
-     * enabled. */
-    if (mov->max_fragment_duration || mov->max_fragment_size ||
-        mov->flags & (FF_MOV_FLAG_EMPTY_MOOV |
-                      FF_MOV_FLAG_FRAG_KEYFRAME |
-                      FF_MOV_FLAG_FRAG_CUSTOM))
-        mov->flags |= FF_MOV_FLAG_FRAGMENT;
-
-    /* Set other implicit flags immediately */
-    if (mov->mode == MODE_ISM)
-        mov->flags |= FF_MOV_FLAG_EMPTY_MOOV | FF_MOV_FLAG_SEPARATE_MOOF |
-                      FF_MOV_FLAG_FRAGMENT;
-
-    /* faststart: moov at the beginning of the file, if supported */
-    if (mov->flags & FF_MOV_FLAG_FASTSTART) {
-        if ((mov->flags & FF_MOV_FLAG_FRAGMENT) ||
-            (s->flags & AVFMT_FLAG_CUSTOM_IO)) {
-            av_log(s, AV_LOG_WARNING, "The faststart flag is incompatible "
-                   "with fragmentation and custom IO, disabling faststart\n");
-            mov->flags &= ~FF_MOV_FLAG_FASTSTART;
-        }
-    }
-
-    /* Non-seekable output is ok if using fragmentation. If ism_lookahead
-     * is enabled, we don't support non-seekable output at all. */
-    if (!s->pb->seekable &&
-        (!(mov->flags & FF_MOV_FLAG_FRAGMENT) || mov->ism_lookahead)) {
-        av_log(s, AV_LOG_ERROR, "muxer does not support non seekable output\n");
-        return AVERROR(EINVAL);
-    }
-
-
-    mov_write_ftyp_tag(pb,s);
-    if (mov->mode == MODE_PSP) {
-        if (s->nb_streams != 2) {
-            av_log(s, AV_LOG_ERROR, "PSP mode need one video and one audio stream\n");
-            return AVERROR(EINVAL);
-        }
-        mov_write_uuidprof_tag(pb, s);
-    }
-
-    mov->nb_streams = s->nb_streams;
-    if (mov->mode & (MODE_MP4|MODE_MOV|MODE_IPOD) && s->nb_chapters)
-        mov->chapter_track = mov->nb_streams++;
-
-    if (mov->flags & FF_MOV_FLAG_RTP_HINT) {
-        /* Add hint tracks for each audio and video stream */
-        hint_track = mov->nb_streams;
-        for (i = 0; i < s->nb_streams; i++) {
-            AVStream *st = s->streams[i];
-            if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
-                st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-                mov->nb_streams++;
-            }
-        }
-    }
-
-    // Reserve an extra stream for chapters for the case where chapters
-    // are written in the trailer
-    mov->tracks = av_mallocz((mov->nb_streams + 1) * sizeof(*mov->tracks));
-    if (!mov->tracks)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st= s->streams[i];
-        MOVTrack *track= &mov->tracks[i];
-        AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0);
-
-        track->enc = st->codec;
-        track->language = ff_mov_iso639_to_lang(lang?lang->value:"und", mov->mode!=MODE_MOV);
-        if (track->language < 0)
-            track->language = 0;
-        track->mode = mov->mode;
-        track->tag  = mov_find_codec_tag(s, track);
-        if (!track->tag) {
-            av_log(s, AV_LOG_ERROR, "track %d: could not find tag, "
-                   "codec not currently supported in container\n", i);
-            goto error;
-        }
-        /* If hinting of this track is enabled by a later hint track,
-         * this is updated. */
-        track->hint_track = -1;
-        track->start_dts  = AV_NOPTS_VALUE;
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            if (track->tag == MKTAG('m','x','3','p') || track->tag == MKTAG('m','x','3','n') ||
-                track->tag == MKTAG('m','x','4','p') || track->tag == MKTAG('m','x','4','n') ||
-                track->tag == MKTAG('m','x','5','p') || track->tag == MKTAG('m','x','5','n')) {
-                if (st->codec->width != 720 || (st->codec->height != 608 && st->codec->height != 512)) {
-                    av_log(s, AV_LOG_ERROR, "D-10/IMX must use 720x608 or 720x512 video resolution\n");
-                    goto error;
-                }
-                track->height = track->tag >> 24 == 'n' ? 486 : 576;
-            }
-            track->timescale = st->codec->time_base.den;
-            if (track->mode == MODE_MOV && track->timescale > 100000)
-                av_log(s, AV_LOG_WARNING,
-                       "WARNING codec timebase is very high. If duration is too long,\n"
-                       "file may not be playable by quicktime. Specify a shorter timebase\n"
-                       "or choose different container.\n");
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            track->timescale = st->codec->sample_rate;
-            /* set sample_size for PCM and ADPCM */
-            if (av_get_bits_per_sample(st->codec->codec_id) ||
-                st->codec->codec_id == AV_CODEC_ID_ILBC) {
-                if (!st->codec->block_align) {
-                    av_log(s, AV_LOG_ERROR, "track %d: codec block align is not set\n", i);
-                    goto error;
-                }
-                track->sample_size = st->codec->block_align;
-            }
-            /* set audio_vbr for compressed audio */
-            if (av_get_bits_per_sample(st->codec->codec_id) < 8) {
-                track->audio_vbr = 1;
-            }
-            if (track->mode != MODE_MOV &&
-                track->enc->codec_id == AV_CODEC_ID_MP3 && track->timescale < 16000) {
-                av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is not supported\n",
-                       i, track->enc->sample_rate);
-                goto error;
-            }
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-            track->timescale = st->codec->time_base.den;
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_DATA) {
-            track->timescale = st->codec->time_base.den;
-        }
-        if (!track->height)
-            track->height = st->codec->height;
-        /* The ism specific timescale isn't mandatory, but is assumed by
-         * some tools, such as mp4split. */
-        if (mov->mode == MODE_ISM)
-            track->timescale = 10000000;
-
-        avpriv_set_pts_info(st, 64, 1, track->timescale);
-
-        /* copy extradata if it exists */
-        if (st->codec->extradata_size) {
-            track->vos_len  = st->codec->extradata_size;
-            track->vos_data = av_malloc(track->vos_len);
-            memcpy(track->vos_data, st->codec->extradata, track->vos_len);
-        }
-    }
-
-    enable_tracks(s);
-
-    if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
-        /* If no fragmentation options have been set, set a default. */
-        if (!(mov->flags & (FF_MOV_FLAG_FRAG_KEYFRAME |
-                            FF_MOV_FLAG_FRAG_CUSTOM)) &&
-            !mov->max_fragment_duration && !mov->max_fragment_size)
-            mov->flags |= FF_MOV_FLAG_FRAG_KEYFRAME;
-    } else {
-        if (mov->flags & FF_MOV_FLAG_FASTSTART)
-            mov->reserved_moov_pos = avio_tell(pb);
-        mov_write_mdat_tag(pb, mov);
-    }
-
-    if (t = av_dict_get(s->metadata, "creation_time", NULL, 0))
-        mov->time = ff_iso8601_to_unix_time(t->value);
-    if (mov->time)
-        mov->time += 0x7C25B080; // 1970 based -> 1904 based
-
-    if (mov->chapter_track)
-        if (mov_create_chapter_track(s, mov->chapter_track) < 0)
-            goto error;
-
-    if (mov->flags & FF_MOV_FLAG_RTP_HINT) {
-        /* Initialize the hint tracks for each audio and video stream */
-        for (i = 0; i < s->nb_streams; i++) {
-            AVStream *st = s->streams[i];
-            if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
-                st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-                ff_mov_init_hinting(s, hint_track, i);
-                hint_track++;
-            }
-        }
-    }
-
-    avio_flush(pb);
-
-    if (mov->flags & FF_MOV_FLAG_ISML)
-        mov_write_isml_manifest(pb, mov);
-
-    if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {
-        mov_write_moov_tag(pb, mov, s);
-        mov->fragments++;
-    }
-
-    return 0;
- error:
-    mov_free(s);
-    return -1;
-}
-
-static int get_moov_size(AVFormatContext *s)
-{
-    int ret;
-    AVIOContext *moov_buf;
-    MOVMuxContext *mov = s->priv_data;
-
-    if ((ret = ffio_open_null_buf(&moov_buf)) < 0)
-        return ret;
-    mov_write_moov_tag(moov_buf, mov, s);
-    return ffio_close_null_buf(moov_buf);
-}
-
-/*
- * This function gets the moov size if moved to the top of the file: the chunk
- * offset table can switch between stco (32-bit entries) to co64 (64-bit
- * entries) when the moov is moved to the beginning, so the size of the moov
- * would change. It also updates the chunk offset tables.
- */
-static int compute_moov_size(AVFormatContext *s)
-{
-    int i, moov_size, moov_size2;
-    MOVMuxContext *mov = s->priv_data;
-
-    moov_size = get_moov_size(s);
-    if (moov_size < 0)
-        return moov_size;
-
-    for (i = 0; i < mov->nb_streams; i++)
-        mov->tracks[i].data_offset += moov_size;
-
-    moov_size2 = get_moov_size(s);
-    if (moov_size2 < 0)
-        return moov_size2;
-
-    /* if the size changed, we just switched from stco to co64 and need to
-     * update the offsets */
-    if (moov_size2 != moov_size)
-        for (i = 0; i < mov->nb_streams; i++)
-            mov->tracks[i].data_offset += moov_size2 - moov_size;
-
-    return moov_size2;
-}
-
-static int shift_data(AVFormatContext *s)
-{
-    int ret = 0, moov_size;
-    MOVMuxContext *mov = s->priv_data;
-    int64_t pos, pos_end = avio_tell(s->pb);
-    uint8_t *buf, *read_buf[2];
-    int read_buf_id = 0;
-    int read_size[2];
-    AVIOContext *read_pb;
-
-    moov_size = compute_moov_size(s);
-    if (moov_size < 0)
-        return moov_size;
-
-    buf = av_malloc(moov_size * 2);
-    if (!buf)
-        return AVERROR(ENOMEM);
-    read_buf[0] = buf;
-    read_buf[1] = buf + moov_size;
-
-    /* Shift the data: the AVIO context of the output can only be used for
-     * writing, so we re-open the same output, but for reading. It also avoids
-     * a read/seek/write/seek back and forth. */
-    avio_flush(s->pb);
-    ret = avio_open(&read_pb, s->filename, AVIO_FLAG_READ);
-    if (ret < 0) {
-        av_log(s, AV_LOG_ERROR, "Unable to re-open %s output file for "
-               "the second pass (faststart)\n", s->filename);
-        goto end;
-    }
-
-    /* mark the end of the shift to up to the last data we wrote, and get ready
-     * for writing */
-    pos_end = avio_tell(s->pb);
-    avio_seek(s->pb, mov->reserved_moov_pos + moov_size, SEEK_SET);
-
-    /* start reading at where the new moov will be placed */
-    avio_seek(read_pb, mov->reserved_moov_pos, SEEK_SET);
-    pos = avio_tell(read_pb);
-
-#define READ_BLOCK do {                                                             \
-    read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], moov_size);  \
-    read_buf_id ^= 1;                                                               \
-} while (0)
-
-    /* shift data by chunk of at most moov_size */
-    READ_BLOCK;
-    do {
-        int n;
-        READ_BLOCK;
-        n = read_size[read_buf_id];
-        if (n <= 0)
-            break;
-        avio_write(s->pb, read_buf[read_buf_id], n);
-        pos += n;
-    } while (pos < pos_end);
-    avio_close(read_pb);
-
-end:
-    av_free(buf);
-    return ret;
-}
-
-static int mov_write_trailer(AVFormatContext *s)
-{
-    MOVMuxContext *mov = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int res = 0;
-    int i;
-    int64_t moov_pos;
-
-    // If there were no chapters when the header was written, but there
-    // are chapters now, write them in the trailer.  This only works
-    // when we are not doing fragments.
-    if (!mov->chapter_track && !(mov->flags & FF_MOV_FLAG_FRAGMENT)) {
-        if (mov->mode & (MODE_MP4|MODE_MOV|MODE_IPOD) && s->nb_chapters) {
-            mov->chapter_track = mov->nb_streams++;
-            if ((res = mov_create_chapter_track(s, mov->chapter_track)) < 0)
-                goto error;
-        }
-    }
-
-    if (!(mov->flags & FF_MOV_FLAG_FRAGMENT)) {
-        moov_pos = avio_tell(pb);
-
-        /* Write size of mdat tag */
-        if (mov->mdat_size + 8 <= UINT32_MAX) {
-            avio_seek(pb, mov->mdat_pos, SEEK_SET);
-            avio_wb32(pb, mov->mdat_size + 8);
-        } else {
-            /* overwrite 'wide' placeholder atom */
-            avio_seek(pb, mov->mdat_pos - 8, SEEK_SET);
-            /* special value: real atom size will be 64 bit value after
-             * tag field */
-            avio_wb32(pb, 1);
-            ffio_wfourcc(pb, "mdat");
-            avio_wb64(pb, mov->mdat_size + 16);
-        }
-        avio_seek(pb, moov_pos, SEEK_SET);
-
-        if (mov->flags & FF_MOV_FLAG_FASTSTART) {
-            av_log(s, AV_LOG_INFO, "Starting second pass: moving the moov atom to the beginning of the file\n");
-            res = shift_data(s);
-            if (res == 0) {
-                avio_seek(s->pb, mov->reserved_moov_pos, SEEK_SET);
-                mov_write_moov_tag(pb, mov, s);
-            }
-        } else {
-            mov_write_moov_tag(pb, mov, s);
-        }
-    } else {
-        mov_flush_fragment(s);
-        mov_write_mfra_tag(pb, mov);
-    }
-
-    for (i = 0; i < mov->nb_streams; i++) {
-        if (mov->flags & FF_MOV_FLAG_FRAGMENT &&
-            mov->tracks[i].vc1_info.struct_offset && s->pb->seekable) {
-            int64_t off = avio_tell(pb);
-            uint8_t buf[7];
-            if (mov_write_dvc1_structs(&mov->tracks[i], buf) >= 0) {
-                avio_seek(pb, mov->tracks[i].vc1_info.struct_offset, SEEK_SET);
-                avio_write(pb, buf, 7);
-                avio_seek(pb, off, SEEK_SET);
-            }
-        }
-    }
-
-error:
-    mov_free(s);
-
-    return res;
-}
-
-#if CONFIG_MOV_MUXER
-MOV_CLASS(mov)
-AVOutputFormat ff_mov_muxer = {
-    .name              = "mov",
-    .long_name         = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
-    .extensions        = "mov",
-    .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = CONFIG_LIBX264_ENCODER ?
-                         AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
-    .write_header      = mov_write_header,
-    .write_packet      = mov_write_packet,
-    .write_trailer     = mov_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){
-        ff_codec_movvideo_tags, ff_codec_movaudio_tags, 0
-    },
-    .priv_class        = &mov_muxer_class,
-};
-#endif
-#if CONFIG_TGP_MUXER
-MOV_CLASS(tgp)
-AVOutputFormat ff_tgp_muxer = {
-    .name              = "3gp",
-    .long_name         = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"),
-    .extensions        = "3gp",
-    .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AMR_NB,
-    .video_codec       = AV_CODEC_ID_H263,
-    .write_header      = mov_write_header,
-    .write_packet      = mov_write_packet,
-    .write_trailer     = mov_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){ codec_3gp_tags, 0 },
-    .priv_class        = &tgp_muxer_class,
-};
-#endif
-#if CONFIG_MP4_MUXER
-MOV_CLASS(mp4)
-AVOutputFormat ff_mp4_muxer = {
-    .name              = "mp4",
-    .long_name         = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"),
-    .mime_type         = "application/mp4",
-    .extensions        = "mp4",
-    .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = CONFIG_LIBX264_ENCODER ?
-                         AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
-    .write_header      = mov_write_header,
-    .write_packet      = mov_write_packet,
-    .write_trailer     = mov_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
-    .priv_class        = &mp4_muxer_class,
-};
-#endif
-#if CONFIG_PSP_MUXER
-MOV_CLASS(psp)
-AVOutputFormat ff_psp_muxer = {
-    .name              = "psp",
-    .long_name         = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"),
-    .extensions        = "mp4,psp",
-    .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = CONFIG_LIBX264_ENCODER ?
-                         AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4,
-    .write_header      = mov_write_header,
-    .write_packet      = mov_write_packet,
-    .write_trailer     = mov_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
-    .priv_class        = &psp_muxer_class,
-};
-#endif
-#if CONFIG_TG2_MUXER
-MOV_CLASS(tg2)
-AVOutputFormat ff_tg2_muxer = {
-    .name              = "3g2",
-    .long_name         = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"),
-    .extensions        = "3g2",
-    .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AMR_NB,
-    .video_codec       = AV_CODEC_ID_H263,
-    .write_header      = mov_write_header,
-    .write_packet      = mov_write_packet,
-    .write_trailer     = mov_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){ codec_3gp_tags, 0 },
-    .priv_class        = &tg2_muxer_class,
-};
-#endif
-#if CONFIG_IPOD_MUXER
-MOV_CLASS(ipod)
-AVOutputFormat ff_ipod_muxer = {
-    .name              = "ipod",
-    .long_name         = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"),
-    .mime_type         = "application/mp4",
-    .extensions        = "m4v,m4a",
-    .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_H264,
-    .write_header      = mov_write_header,
-    .write_packet      = mov_write_packet,
-    .write_trailer     = mov_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){ codec_ipod_tags, 0 },
-    .priv_class        = &ipod_muxer_class,
-};
-#endif
-#if CONFIG_ISMV_MUXER
-MOV_CLASS(ismv)
-AVOutputFormat ff_ismv_muxer = {
-    .name              = "ismv",
-    .long_name         = NULL_IF_CONFIG_SMALL("ISMV/ISMA (Smooth Streaming)"),
-    .mime_type         = "application/mp4",
-    .extensions        = "ismv,isma",
-    .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_H264,
-    .write_header      = mov_write_header,
-    .write_packet      = mov_write_packet,
-    .write_trailer     = mov_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
-    .priv_class        = &ismv_muxer_class,
-};
-#endif
-#if CONFIG_F4V_MUXER
-MOV_CLASS(f4v)
-AVOutputFormat ff_f4v_muxer = {
-    .name              = "f4v",
-    .long_name         = NULL_IF_CONFIG_SMALL("F4V Adobe Flash Video"),
-    .mime_type         = "application/f4v",
-    .extensions        = "f4v",
-    .priv_data_size    = sizeof(MOVMuxContext),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_H264,
-    .write_header      = mov_write_header,
-    .write_packet      = mov_write_packet,
-    .write_trailer     = mov_write_trailer,
-    .flags             = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-    .codec_tag         = (const AVCodecTag* const []){ codec_f4v_tags, 0 },
-    .priv_class        = &f4v_muxer_class,
-};
-#endif
diff --git a/deps/libav/libavformat/movenc.h b/deps/libav/libavformat/movenc.h
deleted file mode 100644
index 226a28f..0000000
--- a/deps/libav/libavformat/movenc.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * MOV, 3GP, MP4 muxer
- * Copyright (c) 2003 Thomas Raivio
- * Copyright (c) 2004 Gildas Bazin <gbazin at videolan dot org>
- * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_MOVENC_H
-#define AVFORMAT_MOVENC_H
-
-#include "avformat.h"
-
-#define MOV_FRAG_INFO_ALLOC_INCREMENT 64
-#define MOV_INDEX_CLUSTER_SIZE 1024
-#define MOV_TIMESCALE 1000
-
-#define RTP_MAX_PACKET_SIZE 1450
-
-#define MODE_MP4  0x01
-#define MODE_MOV  0x02
-#define MODE_3GP  0x04
-#define MODE_PSP  0x08 // example working PSP command line:
-// avconv -i testinput.avi  -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab 32 M4V00001.MP4
-#define MODE_3G2  0x10
-#define MODE_IPOD 0x20
-#define MODE_ISM  0x40
-#define MODE_F4V  0x80
-
-typedef struct MOVIentry {
-    uint64_t     pos;
-    int64_t      dts;
-    unsigned int size;
-    unsigned int samples_in_chunk;
-    unsigned int entries;
-    int          cts;
-#define MOV_SYNC_SAMPLE         0x0001
-#define MOV_PARTIAL_SYNC_SAMPLE 0x0002
-    uint32_t     flags;
-} MOVIentry;
-
-typedef struct HintSample {
-    uint8_t *data;
-    int size;
-    int sample_number;
-    int offset;
-    int own_data;
-} HintSample;
-
-typedef struct HintSampleQueue {
-    int size;
-    int len;
-    HintSample *samples;
-} HintSampleQueue;
-
-typedef struct MOVFragmentInfo {
-    int64_t offset;
-    int64_t time;
-    int64_t duration;
-    int64_t tfrf_offset;
-} MOVFragmentInfo;
-
-typedef struct MOVTrack {
-    int         mode;
-    int         entry;
-    unsigned    timescale;
-    uint64_t    time;
-    int64_t     track_duration;
-    long        sample_count;
-    long        sample_size;
-    int         has_keyframes;
-#define MOV_TRACK_CTTS         0x0001
-#define MOV_TRACK_STPS         0x0002
-#define MOV_TRACK_ENABLED      0x0004
-    uint32_t    flags;
-    int         language;
-    int         track_id;
-    int         tag; ///< stsd fourcc
-    AVCodecContext *enc;
-
-    int         vos_len;
-    uint8_t     *vos_data;
-    MOVIentry   *cluster;
-    unsigned    cluster_capacity;
-    int         audio_vbr;
-    int         height; ///< active picture (w/o VBI) height for D-10/IMX
-    uint32_t    tref_tag;
-    int         tref_id; ///< trackID of the referenced track
-    int64_t     start_dts;
-
-    int         hint_track;   ///< the track that hints this track, -1 if no hint track is set
-    int         src_track;    ///< the track that this hint track describes
-    AVFormatContext *rtp_ctx; ///< the format context for the hinting rtp muxer
-    uint32_t    prev_rtp_ts;
-    int64_t     cur_rtp_ts_unwrapped;
-    uint32_t    max_packet_size;
-
-    int64_t     default_duration;
-    uint32_t    default_sample_flags;
-    uint32_t    default_size;
-
-    HintSampleQueue sample_queue;
-
-    AVIOContext *mdat_buf;
-    int64_t     data_offset;
-    int64_t     frag_start;
-    int64_t     tfrf_offset;
-
-    int         nb_frag_info;
-    MOVFragmentInfo *frag_info;
-    unsigned    frag_info_capacity;
-
-    struct {
-        int64_t struct_offset;
-        int     first_packet_seq;
-        int     first_packet_entry;
-        int     packet_seq;
-        int     packet_entry;
-        int     slices;
-    } vc1_info;
-} MOVTrack;
-
-typedef struct MOVMuxContext {
-    const AVClass *av_class;
-    int     mode;
-    int64_t time;
-    int     nb_streams;
-    int     chapter_track; ///< qt chapter track number
-    int64_t mdat_pos;
-    uint64_t mdat_size;
-    MOVTrack *tracks;
-
-    int flags;
-    int rtp_flags;
-    int iods_skip;
-    int iods_video_profile;
-    int iods_audio_profile;
-
-    int fragments;
-    int max_fragment_duration;
-    int min_fragment_duration;
-    int max_fragment_size;
-    int ism_lookahead;
-    AVIOContext *mdat_buf;
-
-    int64_t reserved_moov_pos;
-
-    char *major_brand;
-} MOVMuxContext;
-
-#define FF_MOV_FLAG_RTP_HINT 1
-#define FF_MOV_FLAG_FRAGMENT 2
-#define FF_MOV_FLAG_EMPTY_MOOV 4
-#define FF_MOV_FLAG_FRAG_KEYFRAME 8
-#define FF_MOV_FLAG_SEPARATE_MOOF 16
-#define FF_MOV_FLAG_FRAG_CUSTOM 32
-#define FF_MOV_FLAG_ISML 64
-#define FF_MOV_FLAG_FASTSTART 128
-#define FF_MOV_FLAG_OMIT_TFHD_OFFSET 256
-
-int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt);
-
-int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index);
-int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
-                             int track_index, int sample,
-                             uint8_t *sample_data, int sample_size);
-void ff_mov_close_hinting(MOVTrack *track);
-
-#endif /* AVFORMAT_MOVENC_H */
diff --git a/deps/libav/libavformat/movenchint.c b/deps/libav/libavformat/movenchint.c
deleted file mode 100644
index a8f5f34..0000000
--- a/deps/libav/libavformat/movenchint.c
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * MOV, 3GP, MP4 muxer RTP hinting
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "movenc.h"
-#include "libavutil/intreadwrite.h"
-#include "internal.h"
-#include "rtpenc_chain.h"
-#include "avio_internal.h"
-#include "rtp.h"
-
-int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index)
-{
-    MOVMuxContext *mov  = s->priv_data;
-    MOVTrack *track     = &mov->tracks[index];
-    MOVTrack *src_track = &mov->tracks[src_index];
-    AVStream *src_st    = s->streams[src_index];
-    int ret = AVERROR(ENOMEM);
-
-    track->tag = MKTAG('r','t','p',' ');
-    track->src_track = src_index;
-
-    track->enc = avcodec_alloc_context3(NULL);
-    if (!track->enc)
-        goto fail;
-    track->enc->codec_type = AVMEDIA_TYPE_DATA;
-    track->enc->codec_tag  = track->tag;
-
-    ret = ff_rtp_chain_mux_open(&track->rtp_ctx, s, src_st, NULL,
-                                RTP_MAX_PACKET_SIZE, src_index);
-    if (ret < 0)
-        goto fail;
-
-    /* Copy the RTP AVStream timebase back to the hint AVStream */
-    track->timescale = track->rtp_ctx->streams[0]->time_base.den;
-
-    /* Mark the hinted track that packets written to it should be
-     * sent to this track for hinting. */
-    src_track->hint_track = index;
-    return 0;
-fail:
-    av_log(s, AV_LOG_WARNING,
-           "Unable to initialize hinting of stream %d\n", src_index);
-    av_freep(&track->enc);
-    /* Set a default timescale, to avoid crashes in av_dump_format */
-    track->timescale = 90000;
-    return ret;
-}
-
-/**
- * Remove the first sample from the sample queue.
- */
-static void sample_queue_pop(HintSampleQueue *queue)
-{
-    if (queue->len <= 0)
-        return;
-    if (queue->samples[0].own_data)
-        av_free(queue->samples[0].data);
-    queue->len--;
-    memmove(queue->samples, queue->samples + 1, sizeof(HintSample)*queue->len);
-}
-
-/**
- * Empty the sample queue, releasing all memory.
- */
-static void sample_queue_free(HintSampleQueue *queue)
-{
-    int i;
-    for (i = 0; i < queue->len; i++)
-        if (queue->samples[i].own_data)
-            av_free(queue->samples[i].data);
-    av_freep(&queue->samples);
-    queue->len  = 0;
-    queue->size = 0;
-}
-
-/**
- * Add a reference to the sample data to the sample queue. The data is
- * not copied. sample_queue_retain should be called before pkt->data
- * is reused/freed.
- */
-static void sample_queue_push(HintSampleQueue *queue, uint8_t *data, int size,
-                              int sample)
-{
-    /* No need to keep track of smaller samples, since describing them
-     * with immediates is more efficient. */
-    if (size <= 14)
-        return;
-    if (!queue->samples || queue->len >= queue->size) {
-        queue->size += 10;
-        if (av_reallocp(&queue->samples, sizeof(*queue->samples) * queue->size) < 0) {
-            queue->len = queue->size = 0;
-            return;
-        }
-    }
-    queue->samples[queue->len].data = data;
-    queue->samples[queue->len].size = size;
-    queue->samples[queue->len].sample_number = sample;
-    queue->samples[queue->len].offset   = 0;
-    queue->samples[queue->len].own_data = 0;
-    queue->len++;
-}
-
-/**
- * Make local copies of all referenced sample data in the queue.
- */
-static void sample_queue_retain(HintSampleQueue *queue)
-{
-    int i;
-    for (i = 0; i < queue->len; ) {
-        HintSample *sample = &queue->samples[i];
-        if (!sample->own_data) {
-            uint8_t *ptr = av_malloc(sample->size);
-            if (!ptr) {
-                /* Unable to allocate memory for this one, remove it */
-                memmove(queue->samples + i, queue->samples + i + 1,
-                        sizeof(HintSample)*(queue->len - i - 1));
-                queue->len--;
-                continue;
-            }
-            memcpy(ptr, sample->data, sample->size);
-            sample->data = ptr;
-            sample->own_data = 1;
-        }
-        i++;
-    }
-}
-
-/**
- * Find matches of needle[n_pos ->] within haystack. If a sufficiently
- * large match is found, matching bytes before n_pos are included
- * in the match, too (within the limits of the arrays).
- *
- * @param haystack buffer that may contain parts of needle
- * @param h_len length of the haystack buffer
- * @param needle buffer containing source data that have been used to
- *               construct haystack
- * @param n_pos start position in needle used for looking for matches
- * @param n_len length of the needle buffer
- * @param match_h_offset_ptr offset of the first matching byte within haystack
- * @param match_n_offset_ptr offset of the first matching byte within needle
- * @param match_len_ptr length of the matched segment
- * @return 0 if a match was found, < 0 if no match was found
- */
-static int match_segments(const uint8_t *haystack, int h_len,
-                          const uint8_t *needle, int n_pos, int n_len,
-                          int *match_h_offset_ptr, int *match_n_offset_ptr,
-                          int *match_len_ptr)
-{
-    int h_pos;
-    for (h_pos = 0; h_pos < h_len; h_pos++) {
-        int match_len = 0;
-        int match_h_pos, match_n_pos;
-
-        /* Check how many bytes match at needle[n_pos] and haystack[h_pos] */
-        while (h_pos + match_len < h_len && n_pos + match_len < n_len &&
-               needle[n_pos + match_len] == haystack[h_pos + match_len])
-            match_len++;
-        if (match_len <= 8)
-            continue;
-
-        /* If a sufficiently large match was found, try to expand
-         * the matched segment backwards. */
-        match_h_pos = h_pos;
-        match_n_pos = n_pos;
-        while (match_n_pos > 0 && match_h_pos > 0 &&
-               needle[match_n_pos - 1] == haystack[match_h_pos - 1]) {
-            match_n_pos--;
-            match_h_pos--;
-            match_len++;
-        }
-        if (match_len <= 14)
-            continue;
-        *match_h_offset_ptr = match_h_pos;
-        *match_n_offset_ptr = match_n_pos;
-        *match_len_ptr = match_len;
-        return 0;
-    }
-    return -1;
-}
-
-/**
- * Look for segments in samples in the sample queue matching the data
- * in ptr. Samples not matching are removed from the queue. If a match
- * is found, the next time it will look for matches starting from the
- * end of the previous matched segment.
- *
- * @param data data to find matches for in the sample queue
- * @param len length of the data buffer
- * @param queue samples used for looking for matching segments
- * @param pos the offset in data of the matched segment
- * @param match_sample the number of the sample that contained the match
- * @param match_offset the offset of the matched segment within the sample
- * @param match_len the length of the matched segment
- * @return 0 if a match was found, < 0 if no match was found
- */
-static int find_sample_match(const uint8_t *data, int len,
-                             HintSampleQueue *queue, int *pos,
-                             int *match_sample, int *match_offset,
-                             int *match_len)
-{
-    while (queue->len > 0) {
-        HintSample *sample = &queue->samples[0];
-        /* If looking for matches in a new sample, skip the first 5 bytes,
-         * since they often may be modified/removed in the output packet. */
-        if (sample->offset == 0 && sample->size > 5)
-            sample->offset = 5;
-
-        if (match_segments(data, len, sample->data, sample->offset,
-                           sample->size, pos, match_offset, match_len) == 0) {
-            *match_sample = sample->sample_number;
-            /* Next time, look for matches at this offset, with a little
-             * margin to this match. */
-            sample->offset = *match_offset + *match_len + 5;
-            if (sample->offset + 10 >= sample->size)
-                sample_queue_pop(queue); /* Not enough useful data left */
-            return 0;
-        }
-
-        if (sample->offset < 10 && sample->size > 20) {
-            /* No match found from the start of the sample,
-             * try from the middle of the sample instead. */
-            sample->offset = sample->size/2;
-        } else {
-            /* No match for this sample, remove it */
-            sample_queue_pop(queue);
-        }
-    }
-    return -1;
-}
-
-static void output_immediate(const uint8_t *data, int size,
-                             AVIOContext *out, int *entries)
-{
-    while (size > 0) {
-        int len = size;
-        if (len > 14)
-            len = 14;
-        avio_w8(out, 1); /* immediate constructor */
-        avio_w8(out, len); /* amount of valid data */
-        avio_write(out, data, len);
-        data += len;
-        size -= len;
-
-        for (; len < 14; len++)
-            avio_w8(out, 0);
-
-        (*entries)++;
-    }
-}
-
-static void output_match(AVIOContext *out, int match_sample,
-                         int match_offset, int match_len, int *entries)
-{
-    avio_w8(out, 2); /* sample constructor */
-    avio_w8(out, 0); /* track reference */
-    avio_wb16(out, match_len);
-    avio_wb32(out, match_sample);
-    avio_wb32(out, match_offset);
-    avio_wb16(out, 1); /* bytes per block */
-    avio_wb16(out, 1); /* samples per block */
-    (*entries)++;
-}
-
-static void describe_payload(const uint8_t *data, int size,
-                             AVIOContext *out, int *entries,
-                             HintSampleQueue *queue)
-{
-    /* Describe the payload using different constructors */
-    while (size > 0) {
-        int match_sample, match_offset, match_len, pos;
-        if (find_sample_match(data, size, queue, &pos, &match_sample,
-                              &match_offset, &match_len) < 0)
-            break;
-        output_immediate(data, pos, out, entries);
-        data += pos;
-        size -= pos;
-        output_match(out, match_sample, match_offset, match_len, entries);
-        data += match_len;
-        size -= match_len;
-    }
-    output_immediate(data, size, out, entries);
-}
-
-/**
- * Write an RTP hint (that may contain one or more RTP packets)
- * for the packets in data. data contains one or more packets with a
- * BE32 size header.
- *
- * @param out buffer where the hints are written
- * @param data buffer containing RTP packets
- * @param size the size of the data buffer
- * @param trk the MOVTrack for the hint track
- * @param dts pointer where the timestamp for the written RTP hint is stored
- * @return the number of RTP packets in the written hint
- */
-static int write_hint_packets(AVIOContext *out, const uint8_t *data,
-                              int size, MOVTrack *trk, int64_t *dts)
-{
-    int64_t curpos;
-    int64_t count_pos, entries_pos;
-    int count = 0, entries;
-
-    count_pos = avio_tell(out);
-    /* RTPsample header */
-    avio_wb16(out, 0); /* packet count */
-    avio_wb16(out, 0); /* reserved */
-
-    while (size > 4) {
-        uint32_t packet_len = AV_RB32(data);
-        uint16_t seq;
-        uint32_t ts;
-        int32_t  ts_diff;
-
-        data += 4;
-        size -= 4;
-        if (packet_len > size || packet_len <= 12)
-            break;
-        if (RTP_PT_IS_RTCP(data[1])) {
-            /* RTCP packet, just skip */
-            data += packet_len;
-            size -= packet_len;
-            continue;
-        }
-
-        if (packet_len > trk->max_packet_size)
-            trk->max_packet_size = packet_len;
-
-        seq = AV_RB16(&data[2]);
-        ts  = AV_RB32(&data[4]);
-
-        if (trk->prev_rtp_ts == 0)
-            trk->prev_rtp_ts = ts;
-        /* Unwrap the 32-bit RTP timestamp that wraps around often
-         * into a not (as often) wrapping 64-bit timestamp. */
-        ts_diff = ts - trk->prev_rtp_ts;
-        if (ts_diff > 0) {
-            trk->cur_rtp_ts_unwrapped += ts_diff;
-            trk->prev_rtp_ts = ts;
-            ts_diff = 0;
-        }
-        if (*dts == AV_NOPTS_VALUE)
-            *dts = trk->cur_rtp_ts_unwrapped;
-
-        count++;
-        /* RTPpacket header */
-        avio_wb32(out, 0); /* relative_time */
-        avio_write(out, data, 2); /* RTP header */
-        avio_wb16(out, seq); /* RTPsequenceseed */
-        avio_wb16(out, ts_diff ? 4 : 0); /* reserved + flags (extra_flag) */
-        entries_pos = avio_tell(out);
-        avio_wb16(out, 0); /* entry count */
-        if (ts_diff) { /* if extra_flag is set */
-            avio_wb32(out, 16); /* extra_information_length */
-            avio_wb32(out, 12); /* rtpoffsetTLV box */
-            avio_write(out, "rtpo", 4);
-            avio_wb32(out, ts_diff);
-        }
-
-        data += 12;
-        size -= 12;
-        packet_len -= 12;
-
-        entries = 0;
-        /* Write one or more constructors describing the payload data */
-        describe_payload(data, packet_len, out, &entries, &trk->sample_queue);
-        data += packet_len;
-        size -= packet_len;
-
-        curpos = avio_tell(out);
-        avio_seek(out, entries_pos, SEEK_SET);
-        avio_wb16(out, entries);
-        avio_seek(out, curpos, SEEK_SET);
-    }
-
-    curpos = avio_tell(out);
-    avio_seek(out, count_pos, SEEK_SET);
-    avio_wb16(out, count);
-    avio_seek(out, curpos, SEEK_SET);
-    return count;
-}
-
-int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
-                             int track_index, int sample,
-                             uint8_t *sample_data, int sample_size)
-{
-    MOVMuxContext *mov = s->priv_data;
-    MOVTrack *trk = &mov->tracks[track_index];
-    AVFormatContext *rtp_ctx = trk->rtp_ctx;
-    uint8_t *buf = NULL;
-    int size;
-    AVIOContext *hintbuf = NULL;
-    AVPacket hint_pkt;
-    int ret = 0, count;
-
-    if (!rtp_ctx)
-        return AVERROR(ENOENT);
-    if (!rtp_ctx->pb)
-        return AVERROR(ENOMEM);
-
-    if (sample_data)
-        sample_queue_push(&trk->sample_queue, sample_data, sample_size, sample);
-    else
-        sample_queue_push(&trk->sample_queue, pkt->data, pkt->size, sample);
-
-    /* Feed the packet to the RTP muxer */
-    ff_write_chained(rtp_ctx, 0, pkt, s);
-
-    /* Fetch the output from the RTP muxer, open a new output buffer
-     * for next time. */
-    size = avio_close_dyn_buf(rtp_ctx->pb, &buf);
-    if ((ret = ffio_open_dyn_packet_buf(&rtp_ctx->pb,
-                                        RTP_MAX_PACKET_SIZE)) < 0)
-        goto done;
-
-    if (size <= 0)
-        goto done;
-
-    /* Open a buffer for writing the hint */
-    if ((ret = avio_open_dyn_buf(&hintbuf)) < 0)
-        goto done;
-    av_init_packet(&hint_pkt);
-    count = write_hint_packets(hintbuf, buf, size, trk, &hint_pkt.dts);
-    av_freep(&buf);
-
-    /* Write the hint data into the hint track */
-    hint_pkt.size = size = avio_close_dyn_buf(hintbuf, &buf);
-    hint_pkt.data = buf;
-    hint_pkt.pts  = hint_pkt.dts;
-    hint_pkt.stream_index = track_index;
-    if (pkt->flags & AV_PKT_FLAG_KEY)
-        hint_pkt.flags |= AV_PKT_FLAG_KEY;
-    if (count > 0)
-        ff_mov_write_packet(s, &hint_pkt);
-done:
-    av_free(buf);
-    sample_queue_retain(&trk->sample_queue);
-    return ret;
-}
-
-void ff_mov_close_hinting(MOVTrack *track)
-{
-    AVFormatContext *rtp_ctx = track->rtp_ctx;
-    uint8_t *ptr;
-
-    av_freep(&track->enc);
-    sample_queue_free(&track->sample_queue);
-    if (!rtp_ctx)
-        return;
-    if (rtp_ctx->pb) {
-        av_write_trailer(rtp_ctx);
-        avio_close_dyn_buf(rtp_ctx->pb, &ptr);
-        av_free(ptr);
-    }
-    avformat_free_context(rtp_ctx);
-}
diff --git a/deps/libav/libavformat/mp3dec.c b/deps/libav/libavformat/mp3dec.c
deleted file mode 100644
index 5c263ed..0000000
--- a/deps/libav/libavformat/mp3dec.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * MP3 demuxer
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "internal.h"
-#include "id3v2.h"
-#include "id3v1.h"
-#include "libavcodec/mpegaudiodecheader.h"
-
-#define XING_FLAG_FRAMES 0x01
-#define XING_FLAG_SIZE   0x02
-#define XING_FLAG_TOC    0x04
-
-#define XING_TOC_COUNT 100
-
-typedef struct MP3DecContext {
-    int xing_toc;
-} MP3DecContext;
-
-/* mp3 read */
-
-static int mp3_read_probe(AVProbeData *p)
-{
-    int max_frames, first_frames = 0;
-    int fsize, frames, sample_rate;
-    uint32_t header;
-    uint8_t *buf, *buf0, *buf2, *end;
-    AVCodecContext avctx;
-
-    buf0 = p->buf;
-    end = p->buf + p->buf_size - sizeof(uint32_t);
-    while(buf0 < end && !*buf0)
-        buf0++;
-
-    max_frames = 0;
-    buf = buf0;
-
-    for(; buf < end; buf= buf2+1) {
-        buf2 = buf;
-
-        for(frames = 0; buf2 < end; frames++) {
-            header = AV_RB32(buf2);
-            fsize = avpriv_mpa_decode_header(&avctx, header, &sample_rate, &sample_rate, &sample_rate, &sample_rate);
-            if(fsize < 0)
-                break;
-            buf2 += fsize;
-        }
-        max_frames = FFMAX(max_frames, frames);
-        if(buf == buf0)
-            first_frames= frames;
-    }
-    // keep this in sync with ac3 probe, both need to avoid
-    // issues with MPEG-files!
-    if (first_frames >= 4) return AVPROBE_SCORE_EXTENSION + 1;
-
-    if (max_frames) {
-        int pes = 0, i;
-        unsigned int code = -1;
-
-#define VIDEO_ID 0x000001e0
-#define AUDIO_ID 0x000001c0
-        /* do a search for mpegps headers to be able to properly bias
-         * towards mpegps if we detect this stream as both. */
-        for (i = 0; i<p->buf_size; i++) {
-            code = (code << 8) + p->buf[i];
-            if ((code & 0xffffff00) == 0x100) {
-                if     ((code & 0x1f0) == VIDEO_ID) pes++;
-                else if((code & 0x1e0) == AUDIO_ID) pes++;
-            }
-        }
-
-        if (pes)
-            max_frames = (max_frames + pes - 1) / pes;
-    }
-    if      (max_frames >  500) return AVPROBE_SCORE_EXTENSION;
-    else if (max_frames >= 4)   return AVPROBE_SCORE_EXTENSION / 2;
-    else if (max_frames >= 1)   return 1;
-    else                        return 0;
-//mpegps_mp3_unrecognized_format.mpg has max_frames=3
-}
-
-static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration)
-{
-    int i;
-    MP3DecContext *mp3 = s->priv_data;
-
-    if (!filesize &&
-        !(filesize = avio_size(s->pb))) {
-        av_log(s, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n");
-        return;
-    }
-
-    for (i = 0; i < XING_TOC_COUNT; i++) {
-        uint8_t b = avio_r8(s->pb);
-
-        av_add_index_entry(s->streams[0],
-                           av_rescale(b, filesize, 256),
-                           av_rescale(i, duration, XING_TOC_COUNT),
-                           0, 0, AVINDEX_KEYFRAME);
-    }
-    mp3->xing_toc = 1;
-}
-
-/**
- * Try to find Xing/Info/VBRI tags and compute duration from info therein
- */
-static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
-{
-    uint32_t v, spf;
-    unsigned frames = 0; /* Total number of frames in file */
-    unsigned size = 0; /* Total number of bytes in the stream */
-    const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}};
-    MPADecodeHeader c;
-    int vbrtag_size = 0;
-    int is_cbr;
-
-    v = avio_rb32(s->pb);
-    if(ff_mpa_check_header(v) < 0)
-      return -1;
-
-    if (avpriv_mpegaudio_decode_header(&c, v) == 0)
-        vbrtag_size = c.frame_size;
-    if(c.layer != 3)
-        return -1;
-
-    spf = c.lsf ? 576 : 1152; /* Samples per frame, layer 3 */
-
-    /* Check for Xing / Info tag */
-    avio_skip(s->pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1]);
-    v = avio_rb32(s->pb);
-    is_cbr = v == MKBETAG('I', 'n', 'f', 'o');
-    if (v == MKBETAG('X', 'i', 'n', 'g') || is_cbr) {
-        v = avio_rb32(s->pb);
-        if(v & XING_FLAG_FRAMES)
-            frames = avio_rb32(s->pb);
-        if(v & XING_FLAG_SIZE)
-            size = avio_rb32(s->pb);
-        if (v & XING_FLAG_TOC && frames)
-            read_xing_toc(s, size, av_rescale_q(frames, (AVRational){spf, c.sample_rate},
-                                    st->time_base));
-    }
-
-    /* Check for VBRI tag (always 32 bytes after end of mpegaudio header) */
-    avio_seek(s->pb, base + 4 + 32, SEEK_SET);
-    v = avio_rb32(s->pb);
-    if(v == MKBETAG('V', 'B', 'R', 'I')) {
-        /* Check tag version */
-        if(avio_rb16(s->pb) == 1) {
-            /* skip delay and quality */
-            avio_skip(s->pb, 4);
-            size = avio_rb32(s->pb);
-            frames = avio_rb32(s->pb);
-        }
-    }
-
-    if(!frames && !size)
-        return -1;
-
-    /* Skip the vbr tag frame */
-    avio_seek(s->pb, base + vbrtag_size, SEEK_SET);
-
-    if(frames)
-        st->duration = av_rescale_q(frames, (AVRational){spf, c.sample_rate},
-                                    st->time_base);
-    if (size && frames && !is_cbr)
-        st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf);
-
-    return 0;
-}
-
-static int mp3_read_header(AVFormatContext *s)
-{
-    AVStream *st;
-    int64_t off;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_MP3;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-    st->start_time = 0;
-
-    // lcm of all mp3 sample rates
-    avpriv_set_pts_info(st, 64, 1, 14112000);
-
-    off = avio_tell(s->pb);
-
-    if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
-        ff_id3v1_read(s);
-
-    if (mp3_parse_vbr_tags(s, st, off) < 0)
-        avio_seek(s->pb, off, SEEK_SET);
-
-    /* the parameters will be extracted from the compressed bitstream */
-    return 0;
-}
-
-#define MP3_PACKET_SIZE 1024
-
-static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret;
-
-    ret = av_get_packet(s->pb, pkt, MP3_PACKET_SIZE);
-    if (ret < 0)
-        return ret;
-
-    pkt->stream_index = 0;
-
-    if (ret > ID3v1_TAG_SIZE &&
-        memcmp(&pkt->data[ret - ID3v1_TAG_SIZE], "TAG", 3) == 0)
-        ret -= ID3v1_TAG_SIZE;
-
-    /* note: we need to modify the packet size here to handle the last
-       packet */
-    pkt->size = ret;
-    return ret;
-}
-
-static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
-                    int flags)
-{
-    MP3DecContext *mp3 = s->priv_data;
-    AVIndexEntry *ie;
-    AVStream *st = s->streams[0];
-    int64_t ret  = av_index_search_timestamp(st, timestamp, flags);
-    uint32_t header = 0;
-
-    if (!mp3->xing_toc)
-        return AVERROR(ENOSYS);
-
-    if (ret < 0)
-        return ret;
-
-    ie = &st->index_entries[ret];
-    ret = avio_seek(s->pb, ie->pos, SEEK_SET);
-    if (ret < 0)
-        return ret;
-
-    while (!s->pb->eof_reached) {
-        header = (header << 8) + avio_r8(s->pb);
-        if (ff_mpa_check_header(header) >= 0) {
-            ff_update_cur_dts(s, st, ie->timestamp);
-            ret = avio_seek(s->pb, -4, SEEK_CUR);
-            return (ret >= 0) ? 0 : ret;
-        }
-    }
-
-    return AVERROR_EOF;
-}
-
-AVInputFormat ff_mp3_demuxer = {
-    .name           = "mp3",
-    .long_name      = NULL_IF_CONFIG_SMALL("MP2/3 (MPEG audio layer 2/3)"),
-    .read_probe     = mp3_read_probe,
-    .read_header    = mp3_read_header,
-    .read_packet    = mp3_read_packet,
-    .read_seek      = mp3_seek,
-    .priv_data_size = sizeof(MP3DecContext),
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "mp2,mp3,m2a,mpa", /* XXX: use probe */
-};
diff --git a/deps/libav/libavformat/mp3enc.c b/deps/libav/libavformat/mp3enc.c
deleted file mode 100644
index 9326258..0000000
--- a/deps/libav/libavformat/mp3enc.c
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
- * MP3 muxer
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "avio_internal.h"
-#include "id3v1.h"
-#include "id3v2.h"
-#include "rawenc.h"
-#include "libavutil/avstring.h"
-#include "libavcodec/mpegaudio.h"
-#include "libavcodec/mpegaudiodata.h"
-#include "libavcodec/mpegaudiodecheader.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/opt.h"
-#include "libavutil/dict.h"
-#include "libavutil/avassert.h"
-
-static int id3v1_set_string(AVFormatContext *s, const char *key,
-                            uint8_t *buf, int buf_size)
-{
-    AVDictionaryEntry *tag;
-    if ((tag = av_dict_get(s->metadata, key, NULL, 0)))
-        av_strlcpy(buf, tag->value, buf_size);
-    return !!tag;
-}
-
-static int id3v1_create_tag(AVFormatContext *s, uint8_t *buf)
-{
-    AVDictionaryEntry *tag;
-    int i, count = 0;
-
-    memset(buf, 0, ID3v1_TAG_SIZE); /* fail safe */
-    buf[0] = 'T';
-    buf[1] = 'A';
-    buf[2] = 'G';
-    count += id3v1_set_string(s, "TIT2",    buf +  3, 30);       //title
-    count += id3v1_set_string(s, "TPE1",    buf + 33, 30);       //author|artist
-    count += id3v1_set_string(s, "TALB",    buf + 63, 30);       //album
-    count += id3v1_set_string(s, "TDRL",    buf + 93,  4);       //date
-    count += id3v1_set_string(s, "comment", buf + 97, 30);
-    if ((tag = av_dict_get(s->metadata, "TRCK", NULL, 0))) { //track
-        buf[125] = 0;
-        buf[126] = atoi(tag->value);
-        count++;
-    }
-    buf[127] = 0xFF; /* default to unknown genre */
-    if ((tag = av_dict_get(s->metadata, "TCON", NULL, 0))) { //genre
-        for(i = 0; i <= ID3v1_GENRE_MAX; i++) {
-            if (!av_strcasecmp(tag->value, ff_id3v1_genre_str[i])) {
-                buf[127] = i;
-                count++;
-                break;
-            }
-        }
-    }
-    return count;
-}
-
-#define XING_NUM_BAGS 400
-#define XING_TOC_SIZE 100
-// maximum size of the xing frame: offset/Xing/flags/frames/size/TOC
-#define XING_MAX_SIZE (32 + 4 + 4 + 4 + 4 + XING_TOC_SIZE)
-
-typedef struct MP3Context {
-    const AVClass *class;
-    ID3v2EncContext id3;
-    int id3v2_version;
-    int write_id3v1;
-    int write_xing;
-
-    /* xing header */
-    int64_t xing_offset;
-    int32_t frames;
-    int32_t size;
-    uint32_t want;
-    uint32_t seen;
-    uint32_t pos;
-    uint64_t bag[XING_NUM_BAGS];
-    int initial_bitrate;
-    int has_variable_bitrate;
-
-    /* index of the audio stream */
-    int audio_stream_idx;
-    /* number of attached pictures we still need to write */
-    int pics_to_write;
-
-    /* audio packets are queued here until we get all the attached pictures */
-    AVPacketList *queue, *queue_end;
-} MP3Context;
-
-static const uint8_t xing_offtbl[2][2] = {{32, 17}, {17, 9}};
-
-/*
- * Write an empty XING header and initialize respective data.
- */
-static void mp3_write_xing(AVFormatContext *s)
-{
-    MP3Context       *mp3 = s->priv_data;
-    AVCodecContext *codec = s->streams[mp3->audio_stream_idx]->codec;
-    int32_t        header;
-    MPADecodeHeader  mpah;
-    int srate_idx, i, channels;
-    int bitrate_idx;
-    int best_bitrate_idx;
-    int best_bitrate_error = INT_MAX;
-    int xing_offset;
-    int ver = 0;
-    int lsf, bytes_needed;
-
-    if (!s->pb->seekable || !mp3->write_xing)
-        return;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(avpriv_mpa_freq_tab); i++) {
-        const uint16_t base_freq = avpriv_mpa_freq_tab[i];
-
-        if      (codec->sample_rate == base_freq)     ver = 0x3; // MPEG 1
-        else if (codec->sample_rate == base_freq / 2) ver = 0x2; // MPEG 2
-        else if (codec->sample_rate == base_freq / 4) ver = 0x0; // MPEG 2.5
-        else continue;
-
-        srate_idx = i;
-        break;
-    }
-    if (i == FF_ARRAY_ELEMS(avpriv_mpa_freq_tab)) {
-        av_log(s, AV_LOG_WARNING, "Unsupported sample rate, not writing Xing "
-               "header.\n");
-        return;
-    }
-
-    switch (codec->channels) {
-    case 1:  channels = MPA_MONO;                                          break;
-    case 2:  channels = MPA_STEREO;                                        break;
-    default: av_log(s, AV_LOG_WARNING, "Unsupported number of channels, "
-                    "not writing Xing header.\n");
-             return;
-    }
-
-    /* dummy MPEG audio header */
-    header  =  0xff                                  << 24; // sync
-    header |= (0x7 << 5 | ver << 3 | 0x1 << 1 | 0x1) << 16; // sync/audio-version/layer 3/no crc*/
-    header |= (srate_idx << 2) << 8;
-    header |= channels << 6;
-
-    lsf = !((header & (1 << 20) && header & (1 << 19)));
-
-    xing_offset  = xing_offtbl[ver != 3][channels == 1];
-    bytes_needed = 4              // header
-                 + xing_offset
-                 + 4              // xing tag
-                 + 4              // frames/size/toc flags
-                 + 4              // frames
-                 + 4              // size
-                 + XING_TOC_SIZE; // toc
-
-    for (bitrate_idx = 1; bitrate_idx < 15; bitrate_idx++) {
-        int bit_rate = 1000 * avpriv_mpa_bitrate_tab[lsf][3 - 1][bitrate_idx];
-        int error    = FFABS(bit_rate - codec->bit_rate);
-
-        if (error < best_bitrate_error){
-            best_bitrate_error = error;
-            best_bitrate_idx   = bitrate_idx;
-        }
-    }
-
-    for (bitrate_idx = best_bitrate_idx; bitrate_idx < 15; bitrate_idx++) {
-        int32_t mask = bitrate_idx << (4 + 8);
-        header |= mask;
-
-        avpriv_mpegaudio_decode_header(&mpah, header);
-
-        if (bytes_needed <= mpah.frame_size)
-            break;
-
-        header &= ~mask;
-    }
-
-    avio_wb32(s->pb, header);
-
-    avpriv_mpegaudio_decode_header(&mpah, header);
-
-    av_assert0(mpah.frame_size >= XING_MAX_SIZE);
-
-    ffio_fill(s->pb, 0, xing_offset);
-    mp3->xing_offset = avio_tell(s->pb);
-    ffio_wfourcc(s->pb, "Xing");
-    avio_wb32(s->pb, 0x01 | 0x02 | 0x04);  // frames / size / TOC
-
-    mp3->size = mpah.frame_size;
-    mp3->want = 1;
-
-    avio_wb32(s->pb, 0);  // frames
-    avio_wb32(s->pb, 0);  // size
-
-    // TOC
-    for (i = 0; i < XING_TOC_SIZE; i++)
-        avio_w8(s->pb, 255 * i / XING_TOC_SIZE);
-
-    ffio_fill(s->pb, 0, mpah.frame_size - bytes_needed);
-}
-
-/*
- * Add a frame to XING data.
- * Following lame's "VbrTag.c".
- */
-static void mp3_xing_add_frame(MP3Context *mp3, AVPacket *pkt)
-{
-    int i;
-
-    mp3->frames++;
-    mp3->seen++;
-    mp3->size += pkt->size;
-
-    if (mp3->want == mp3->seen) {
-        mp3->bag[mp3->pos] = mp3->size;
-
-        if (XING_NUM_BAGS == ++mp3->pos) {
-            /* shrink table to half size by throwing away each second bag. */
-            for (i = 1; i < XING_NUM_BAGS; i += 2)
-                mp3->bag[i / 2] = mp3->bag[i];
-
-            /* double wanted amount per bag. */
-            mp3->want *= 2;
-            /* adjust current position to half of table size. */
-            mp3->pos = XING_NUM_BAGS / 2;
-        }
-
-        mp3->seen = 0;
-    }
-}
-
-static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MP3Context  *mp3 = s->priv_data;
-
-    if (mp3->xing_offset && pkt->size >= 4) {
-        MPADecodeHeader c;
-
-        avpriv_mpegaudio_decode_header(&c, AV_RB32(pkt->data));
-
-        if (!mp3->initial_bitrate)
-            mp3->initial_bitrate = c.bit_rate;
-        if ((c.bit_rate == 0) || (mp3->initial_bitrate != c.bit_rate))
-            mp3->has_variable_bitrate = 1;
-
-        mp3_xing_add_frame(mp3, pkt);
-    }
-
-    return ff_raw_write_packet(s, pkt);
-}
-
-static int mp3_queue_flush(AVFormatContext *s)
-{
-    MP3Context *mp3 = s->priv_data;
-    AVPacketList *pktl;
-    int ret = 0, write = 1;
-
-    ff_id3v2_finish(&mp3->id3, s->pb);
-    mp3_write_xing(s);
-
-    while ((pktl = mp3->queue)) {
-        if (write && (ret = mp3_write_audio_packet(s, &pktl->pkt)) < 0)
-            write = 0;
-        av_free_packet(&pktl->pkt);
-        mp3->queue = pktl->next;
-        av_freep(&pktl);
-    }
-    mp3->queue_end = NULL;
-    return ret;
-}
-
-static void mp3_update_xing(AVFormatContext *s)
-{
-    MP3Context  *mp3 = s->priv_data;
-    int i;
-
-    /* replace "Xing" identification string with "Info" for CBR files. */
-    if (!mp3->has_variable_bitrate) {
-        avio_seek(s->pb, mp3->xing_offset, SEEK_SET);
-        ffio_wfourcc(s->pb, "Info");
-    }
-
-    avio_seek(s->pb, mp3->xing_offset + 8, SEEK_SET);
-    avio_wb32(s->pb, mp3->frames);
-    avio_wb32(s->pb, mp3->size);
-
-    avio_w8(s->pb, 0);  // first toc entry has to be zero.
-
-    for (i = 1; i < XING_TOC_SIZE; ++i) {
-        int j = i * mp3->pos / XING_TOC_SIZE;
-        int seek_point = 256LL * mp3->bag[j] / mp3->size;
-        avio_w8(s->pb, FFMIN(seek_point, 255));
-    }
-
-    avio_seek(s->pb, 0, SEEK_END);
-}
-
-static int mp3_write_trailer(struct AVFormatContext *s)
-{
-    uint8_t buf[ID3v1_TAG_SIZE];
-    MP3Context *mp3 = s->priv_data;
-
-    if (mp3->pics_to_write) {
-        av_log(s, AV_LOG_WARNING, "No packets were sent for some of the "
-               "attached pictures.\n");
-        mp3_queue_flush(s);
-    }
-
-    /* write the id3v1 tag */
-    if (mp3->write_id3v1 && id3v1_create_tag(s, buf) > 0) {
-        avio_write(s->pb, buf, ID3v1_TAG_SIZE);
-    }
-
-    if (mp3->xing_offset)
-        mp3_update_xing(s);
-
-    return 0;
-}
-
-#if CONFIG_MP2_MUXER
-AVOutputFormat ff_mp2_muxer = {
-    .name              = "mp2",
-    .long_name         = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
-    .mime_type         = "audio/x-mpeg",
-    .extensions        = "mp2,m2a,mpa",
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_MP3_MUXER
-
-static const AVOption options[] = {
-    { "id3v2_version", "Select ID3v2 version to write. Currently 3 and 4 are supported.",
-      offsetof(MP3Context, id3v2_version), AV_OPT_TYPE_INT, {.i64 = 4}, 0, 4, AV_OPT_FLAG_ENCODING_PARAM},
-    { "write_id3v1", "Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software.",
-      offsetof(MP3Context, write_id3v1), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
-    { "write_xing",  "Write the Xing header containing file duration.",
-      offsetof(MP3Context, write_xing),  AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
-    { NULL },
-};
-
-static const AVClass mp3_muxer_class = {
-    .class_name     = "MP3 muxer",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MP3Context *mp3 = s->priv_data;
-
-    if (pkt->stream_index == mp3->audio_stream_idx) {
-        if (mp3->pics_to_write) {
-            /* buffer audio packets until we get all the pictures */
-            AVPacketList *pktl = av_mallocz(sizeof(*pktl));
-            if (!pktl)
-                return AVERROR(ENOMEM);
-
-            pktl->pkt     = *pkt;
-            pktl->pkt.buf = av_buffer_ref(pkt->buf);
-            if (!pktl->pkt.buf) {
-                av_freep(&pktl);
-                return AVERROR(ENOMEM);
-            }
-
-            if (mp3->queue_end)
-                mp3->queue_end->next = pktl;
-            else
-                mp3->queue = pktl;
-            mp3->queue_end = pktl;
-        } else
-            return mp3_write_audio_packet(s, pkt);
-    } else {
-        int ret;
-
-        /* warn only once for each stream */
-        if (s->streams[pkt->stream_index]->nb_frames == 1) {
-            av_log(s, AV_LOG_WARNING, "Got more than one picture in stream %d,"
-                   " ignoring.\n", pkt->stream_index);
-        }
-        if (!mp3->pics_to_write || s->streams[pkt->stream_index]->nb_frames >= 1)
-            return 0;
-
-        if ((ret = ff_id3v2_write_apic(s, &mp3->id3, pkt)) < 0)
-            return ret;
-        mp3->pics_to_write--;
-
-        /* flush the buffered audio packets */
-        if (!mp3->pics_to_write &&
-            (ret = mp3_queue_flush(s)) < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-/**
- * Write an ID3v2 header at beginning of stream
- */
-
-static int mp3_write_header(struct AVFormatContext *s)
-{
-    MP3Context  *mp3 = s->priv_data;
-    int ret, i;
-
-    if (mp3->id3v2_version      &&
-        mp3->id3v2_version != 3 &&
-        mp3->id3v2_version != 4) {
-        av_log(s, AV_LOG_ERROR, "Invalid ID3v2 version requested: %d. Only "
-               "3, 4 or 0 (disabled) are allowed.\n", mp3->id3v2_version);
-        return AVERROR(EINVAL);
-    }
-
-    /* check the streams -- we want exactly one audio and arbitrary number of
-     * video (attached pictures) */
-    mp3->audio_stream_idx = -1;
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (mp3->audio_stream_idx >= 0 || st->codec->codec_id != AV_CODEC_ID_MP3) {
-                av_log(s, AV_LOG_ERROR, "Invalid audio stream. Exactly one MP3 "
-                       "audio stream is required.\n");
-                return AVERROR(EINVAL);
-            }
-            mp3->audio_stream_idx = i;
-        } else if (st->codec->codec_type != AVMEDIA_TYPE_VIDEO) {
-            av_log(s, AV_LOG_ERROR, "Only audio streams and pictures are allowed in MP3.\n");
-            return AVERROR(EINVAL);
-        }
-    }
-    if (mp3->audio_stream_idx < 0) {
-        av_log(s, AV_LOG_ERROR, "No audio stream present.\n");
-        return AVERROR(EINVAL);
-    }
-    mp3->pics_to_write = s->nb_streams - 1;
-
-    if (mp3->pics_to_write && !mp3->id3v2_version) {
-        av_log(s, AV_LOG_ERROR, "Attached pictures were requested, but the "
-               "ID3v2 header is disabled.\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (mp3->id3v2_version) {
-        ff_id3v2_start(&mp3->id3, s->pb, mp3->id3v2_version, ID3v2_DEFAULT_MAGIC);
-        ret = ff_id3v2_write_metadata(s, &mp3->id3);
-        if (ret < 0)
-            return ret;
-    }
-
-    if (!mp3->pics_to_write) {
-        if (mp3->id3v2_version)
-            ff_id3v2_finish(&mp3->id3, s->pb);
-        mp3_write_xing(s);
-    }
-
-    return 0;
-}
-
-AVOutputFormat ff_mp3_muxer = {
-    .name              = "mp3",
-    .long_name         = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
-    .mime_type         = "audio/x-mpeg",
-    .extensions        = "mp3",
-    .priv_data_size    = sizeof(MP3Context),
-    .audio_codec       = AV_CODEC_ID_MP3,
-    .video_codec       = AV_CODEC_ID_PNG,
-    .write_header      = mp3_write_header,
-    .write_packet      = mp3_write_packet,
-    .write_trailer     = mp3_write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .priv_class        = &mp3_muxer_class,
-};
-#endif
diff --git a/deps/libav/libavformat/mpc.c b/deps/libav/libavformat/mpc.c
deleted file mode 100644
index 5e771ae..0000000
--- a/deps/libav/libavformat/mpc.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Musepack demuxer
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavcodec/get_bits.h"
-#include "avformat.h"
-#include "internal.h"
-#include "apetag.h"
-#include "id3v1.h"
-#include "libavutil/dict.h"
-
-#define MPC_FRAMESIZE  1152
-#define DELAY_FRAMES   32
-
-static const int mpc_rate[4] = { 44100, 48000, 37800, 32000 };
-typedef struct {
-    int64_t pos;
-    int size, skip;
-}MPCFrame;
-
-typedef struct {
-    int ver;
-    uint32_t curframe, lastframe;
-    uint32_t fcount;
-    MPCFrame *frames;
-    int curbits;
-    int frames_noted;
-} MPCContext;
-
-static int mpc_probe(AVProbeData *p)
-{
-    const uint8_t *d = p->buf;
-    if (d[0] == 'M' && d[1] == 'P' && d[2] == '+' && (d[3] == 0x17 || d[3] == 0x7))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int mpc_read_header(AVFormatContext *s)
-{
-    MPCContext *c = s->priv_data;
-    AVStream *st;
-
-    if(avio_rl24(s->pb) != MKTAG('M', 'P', '+', 0)){
-        av_log(s, AV_LOG_ERROR, "Not a Musepack file\n");
-        return AVERROR_INVALIDDATA;
-    }
-    c->ver = avio_r8(s->pb);
-    if(c->ver != 0x07 && c->ver != 0x17){
-        av_log(s, AV_LOG_ERROR, "Can demux Musepack SV7, got version %02X\n", c->ver);
-        return AVERROR_INVALIDDATA;
-    }
-    c->fcount = avio_rl32(s->pb);
-    if((int64_t)c->fcount * sizeof(MPCFrame) >= UINT_MAX){
-        av_log(s, AV_LOG_ERROR, "Too many frames, seeking is not possible\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if(c->fcount){
-        c->frames = av_malloc(c->fcount * sizeof(MPCFrame));
-        if(!c->frames){
-            av_log(s, AV_LOG_ERROR, "Cannot allocate seektable\n");
-            return AVERROR(ENOMEM);
-        }
-    }else{
-        av_log(s, AV_LOG_WARNING, "Container reports no frames\n");
-    }
-    c->curframe = 0;
-    c->lastframe = -1;
-    c->curbits = 8;
-    c->frames_noted = 0;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_MUSEPACK7;
-    st->codec->channels = 2;
-    st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-    st->codec->bits_per_coded_sample = 16;
-
-    st->codec->extradata_size = 16;
-    st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
-    avio_read(s->pb, st->codec->extradata, 16);
-    st->codec->sample_rate = mpc_rate[st->codec->extradata[2] & 3];
-    avpriv_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate);
-    /* scan for seekpoints */
-    st->start_time = 0;
-    st->duration = c->fcount;
-
-    /* try to read APE tags */
-    if (s->pb->seekable) {
-        int64_t pos = avio_tell(s->pb);
-        ff_ape_parse_tag(s);
-        if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
-            ff_id3v1_read(s);
-        avio_seek(s->pb, pos, SEEK_SET);
-    }
-
-    return 0;
-}
-
-static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MPCContext *c = s->priv_data;
-    int ret, size, size2, curbits, cur = c->curframe;
-    unsigned tmp;
-    int64_t pos;
-
-    if (c->curframe >= c->fcount && c->fcount)
-        return AVERROR_EOF;
-
-    if(c->curframe != c->lastframe + 1){
-        avio_seek(s->pb, c->frames[c->curframe].pos, SEEK_SET);
-        c->curbits = c->frames[c->curframe].skip;
-    }
-    c->lastframe = c->curframe;
-    c->curframe++;
-    curbits = c->curbits;
-    pos = avio_tell(s->pb);
-    tmp = avio_rl32(s->pb);
-    if(curbits <= 12){
-        size2 = (tmp >> (12 - curbits)) & 0xFFFFF;
-    }else{
-        size2 = (tmp << (curbits - 12) | avio_rl32(s->pb) >> (44 - curbits)) & 0xFFFFF;
-    }
-    curbits += 20;
-    avio_seek(s->pb, pos, SEEK_SET);
-
-    size = ((size2 + curbits + 31) & ~31) >> 3;
-    if(cur == c->frames_noted && c->fcount){
-        c->frames[cur].pos = pos;
-        c->frames[cur].size = size;
-        c->frames[cur].skip = curbits - 20;
-        av_add_index_entry(s->streams[0], cur, cur, size, 0, AVINDEX_KEYFRAME);
-        c->frames_noted++;
-    }
-    c->curbits = (curbits + size2) & 0x1F;
-
-    if ((ret = av_new_packet(pkt, size)) < 0)
-        return ret;
-
-    pkt->data[0] = curbits;
-    pkt->data[1] = (c->curframe > c->fcount) && c->fcount;
-    pkt->data[2] = 0;
-    pkt->data[3] = 0;
-
-    pkt->stream_index = 0;
-    pkt->pts = cur;
-    ret = avio_read(s->pb, pkt->data + 4, size);
-    if(c->curbits)
-        avio_seek(s->pb, -4, SEEK_CUR);
-    if(ret < size){
-        av_free_packet(pkt);
-        return ret < 0 ? ret : AVERROR(EIO);
-    }
-    pkt->size = ret + 4;
-
-    return 0;
-}
-
-static int mpc_read_close(AVFormatContext *s)
-{
-    MPCContext *c = s->priv_data;
-
-    av_freep(&c->frames);
-    return 0;
-}
-
-/**
- * Seek to the given position
- * If position is unknown but is within the limits of file
- * then packets are skipped unless desired position is reached
- *
- * Also this function makes use of the fact that timestamp == frameno
- */
-static int mpc_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
-{
-    AVStream *st = s->streams[stream_index];
-    MPCContext *c = s->priv_data;
-    AVPacket pkt1, *pkt = &pkt1;
-    int ret;
-    int index = av_index_search_timestamp(st, timestamp - DELAY_FRAMES, flags);
-    uint32_t lastframe;
-
-    /* if found, seek there */
-    if (index >= 0){
-        c->curframe = st->index_entries[index].pos;
-        return 0;
-    }
-    /* if timestamp is out of bounds, return error */
-    if(timestamp < 0 || timestamp >= c->fcount)
-        return -1;
-    timestamp -= DELAY_FRAMES;
-    /* seek to the furthest known position and read packets until
-       we reach desired position */
-    lastframe = c->curframe;
-    if(c->frames_noted) c->curframe = c->frames_noted - 1;
-    while(c->curframe < timestamp){
-        ret = av_read_frame(s, pkt);
-        if (ret < 0){
-            c->curframe = lastframe;
-            return ret;
-        }
-        av_free_packet(pkt);
-    }
-    return 0;
-}
-
-
-AVInputFormat ff_mpc_demuxer = {
-    .name           = "mpc",
-    .long_name      = NULL_IF_CONFIG_SMALL("Musepack"),
-    .priv_data_size = sizeof(MPCContext),
-    .read_probe     = mpc_probe,
-    .read_header    = mpc_read_header,
-    .read_packet    = mpc_read_packet,
-    .read_close     = mpc_read_close,
-    .read_seek      = mpc_read_seek,
-    .extensions     = "mpc",
-};
diff --git a/deps/libav/libavformat/mpc8.c b/deps/libav/libavformat/mpc8.c
deleted file mode 100644
index 3564e81..0000000
--- a/deps/libav/libavformat/mpc8.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Musepack SV8 demuxer
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/get_bits.h"
-#include "libavcodec/unary.h"
-#include "apetag.h"
-#include "avformat.h"
-#include "internal.h"
-#include "avio_internal.h"
-
-/// Two-byte MPC tag
-#define MKMPCTAG(a, b) (a | (b << 8))
-
-#define TAG_MPCK MKTAG('M','P','C','K')
-
-/// Reserved MPC tags
-enum MPCPacketTags{
-    TAG_STREAMHDR   = MKMPCTAG('S','H'),
-    TAG_STREAMEND   = MKMPCTAG('S','E'),
-
-    TAG_AUDIOPACKET = MKMPCTAG('A','P'),
-
-    TAG_SEEKTBLOFF  = MKMPCTAG('S','O'),
-    TAG_SEEKTABLE   = MKMPCTAG('S','T'),
-
-    TAG_REPLAYGAIN  = MKMPCTAG('R','G'),
-    TAG_ENCINFO     = MKMPCTAG('E','I'),
-};
-
-static const int mpc8_rate[8] = { 44100, 48000, 37800, 32000, -1, -1, -1, -1 };
-
-typedef struct {
-    int ver;
-    int64_t header_pos;
-    int64_t samples;
-
-    int64_t apetag_start;
-} MPCContext;
-
-static inline int64_t bs_get_v(uint8_t **bs)
-{
-    int64_t v = 0;
-    int br = 0;
-    int c;
-
-    do {
-        c = **bs; (*bs)++;
-        v <<= 7;
-        v |= c & 0x7F;
-        br++;
-        if (br > 10)
-            return -1;
-    } while (c & 0x80);
-
-    return v - br;
-}
-
-static int mpc8_probe(AVProbeData *p)
-{
-    uint8_t *bs = p->buf + 4;
-    uint8_t *bs_end = bs + p->buf_size;
-    int64_t size;
-
-    if (p->buf_size < 16)
-        return 0;
-    if (AV_RL32(p->buf) != TAG_MPCK)
-        return 0;
-    while (bs < bs_end + 3) {
-        int header_found = (bs[0] == 'S' && bs[1] == 'H');
-        if (bs[0] < 'A' || bs[0] > 'Z' || bs[1] < 'A' || bs[1] > 'Z')
-            return 0;
-        bs += 2;
-        size = bs_get_v(&bs);
-        if (size < 2)
-            return 0;
-        if (bs + size - 2 >= bs_end)
-            return AVPROBE_SCORE_EXTENSION - 1; // seems to be valid MPC but no header yet
-        if (header_found) {
-            if (size < 11 || size > 28)
-                return 0;
-            if (!AV_RL32(bs)) //zero CRC is invalid
-                return 0;
-            return AVPROBE_SCORE_MAX;
-        } else {
-            bs += size - 2;
-        }
-    }
-    return 0;
-}
-
-static inline int64_t gb_get_v(GetBitContext *gb)
-{
-    int64_t v = 0;
-    int bits = 0;
-    while(get_bits1(gb) && bits < 64-7){
-        v <<= 7;
-        v |= get_bits(gb, 7);
-        bits += 7;
-    }
-    v <<= 7;
-    v |= get_bits(gb, 7);
-
-    return v;
-}
-
-static void mpc8_get_chunk_header(AVIOContext *pb, int *tag, int64_t *size)
-{
-    int64_t pos;
-    pos = avio_tell(pb);
-    *tag = avio_rl16(pb);
-    *size = ffio_read_varlen(pb);
-    *size -= avio_tell(pb) - pos;
-}
-
-static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
-{
-    MPCContext *c = s->priv_data;
-    int tag;
-    int64_t size, pos, ppos[2];
-    uint8_t *buf;
-    int i, t, seekd;
-    GetBitContext gb;
-
-    if (s->nb_streams == 0) {
-        av_log(s, AV_LOG_ERROR, "No stream added before parsing seek table\n");
-        return;
-    }
-
-    avio_seek(s->pb, off, SEEK_SET);
-    mpc8_get_chunk_header(s->pb, &tag, &size);
-    if(tag != TAG_SEEKTABLE){
-        av_log(s, AV_LOG_ERROR, "No seek table at given position\n");
-        return;
-    }
-    if (size < 0 || size >= INT_MAX / 2) {
-        av_log(s, AV_LOG_ERROR, "Bad seek table size\n");
-        return;
-    }
-    if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
-        return;
-    avio_read(s->pb, buf, size);
-    init_get_bits(&gb, buf, size * 8);
-    size = gb_get_v(&gb);
-    if(size > UINT_MAX/4 || size > c->samples/1152){
-        av_log(s, AV_LOG_ERROR, "Seek table is too big\n");
-        return;
-    }
-    seekd = get_bits(&gb, 4);
-    for(i = 0; i < 2; i++){
-        pos = gb_get_v(&gb) + c->header_pos;
-        ppos[1 - i] = pos;
-        av_add_index_entry(s->streams[0], pos, i, 0, 0, AVINDEX_KEYFRAME);
-    }
-    for(; i < size; i++){
-        t = get_unary(&gb, 1, 33) << 12;
-        t += get_bits(&gb, 12);
-        if(t & 1)
-            t = -(t & ~1);
-        pos = (t >> 1) + ppos[0]*2 - ppos[1];
-        av_add_index_entry(s->streams[0], pos, i << seekd, 0, 0, AVINDEX_KEYFRAME);
-        ppos[1] = ppos[0];
-        ppos[0] = pos;
-    }
-    av_free(buf);
-}
-
-static void mpc8_handle_chunk(AVFormatContext *s, int tag, int64_t chunk_pos, int64_t size)
-{
-    AVIOContext *pb = s->pb;
-    int64_t pos, off;
-
-    switch(tag){
-    case TAG_SEEKTBLOFF:
-        pos = avio_tell(pb) + size;
-        off = ffio_read_varlen(pb);
-        mpc8_parse_seektable(s, chunk_pos + off);
-        avio_seek(pb, pos, SEEK_SET);
-        break;
-    default:
-        avio_skip(pb, size);
-    }
-}
-
-static int mpc8_read_header(AVFormatContext *s)
-{
-    MPCContext *c = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    int tag = 0;
-    int64_t size, pos;
-
-    c->header_pos = avio_tell(pb);
-    if(avio_rl32(pb) != TAG_MPCK){
-        av_log(s, AV_LOG_ERROR, "Not a Musepack8 file\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    while(!pb->eof_reached){
-        pos = avio_tell(pb);
-        mpc8_get_chunk_header(pb, &tag, &size);
-        if(tag == TAG_STREAMHDR)
-            break;
-        mpc8_handle_chunk(s, tag, pos, size);
-    }
-    if(tag != TAG_STREAMHDR){
-        av_log(s, AV_LOG_ERROR, "Stream header not found\n");
-        return AVERROR_INVALIDDATA;
-    }
-    pos = avio_tell(pb);
-    avio_skip(pb, 4); //CRC
-    c->ver = avio_r8(pb);
-    if(c->ver != 8){
-        av_log(s, AV_LOG_ERROR, "Unknown stream version %d\n", c->ver);
-        return AVERROR_PATCHWELCOME;
-    }
-    c->samples = ffio_read_varlen(pb);
-    ffio_read_varlen(pb); //silence samples at the beginning
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_MUSEPACK8;
-    st->codec->bits_per_coded_sample = 16;
-
-    st->codec->extradata_size = 2;
-    st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
-    avio_read(pb, st->codec->extradata, st->codec->extradata_size);
-
-    st->codec->channels = (st->codec->extradata[1] >> 4) + 1;
-    st->codec->sample_rate = mpc8_rate[st->codec->extradata[0] >> 5];
-    avpriv_set_pts_info(st, 32, 1152  << (st->codec->extradata[1]&3)*2, st->codec->sample_rate);
-    st->start_time = 0;
-    st->duration = c->samples / (1152 << (st->codec->extradata[1]&3)*2);
-    size -= avio_tell(pb) - pos;
-
-    if (pb->seekable) {
-        int64_t pos = avio_tell(s->pb);
-        c->apetag_start = ff_ape_parse_tag(s);
-        avio_seek(s->pb, pos, SEEK_SET);
-    }
-
-    return 0;
-}
-
-static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MPCContext *c = s->priv_data;
-    int tag;
-    int64_t pos, size;
-
-    while(!s->pb->eof_reached){
-        pos = avio_tell(s->pb);
-
-        /* don't return bogus packets with the ape tag data */
-        if (c->apetag_start && pos >= c->apetag_start)
-            return AVERROR_EOF;
-
-        mpc8_get_chunk_header(s->pb, &tag, &size);
-        if (size < 0)
-            return -1;
-        if(tag == TAG_AUDIOPACKET){
-            if(av_get_packet(s->pb, pkt, size) < 0)
-                return AVERROR(ENOMEM);
-            pkt->stream_index = 0;
-            pkt->duration     = 1;
-            return 0;
-        }
-        if(tag == TAG_STREAMEND)
-            return AVERROR(EIO);
-        mpc8_handle_chunk(s, tag, pos, size);
-    }
-    return AVERROR_EOF;
-}
-
-static int mpc8_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
-{
-    AVStream *st = s->streams[stream_index];
-    int index = av_index_search_timestamp(st, timestamp, flags);
-
-    if(index < 0) return -1;
-    if (avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET) < 0)
-        return -1;
-    ff_update_cur_dts(s, st, st->index_entries[index].timestamp);
-    return 0;
-}
-
-
-AVInputFormat ff_mpc8_demuxer = {
-    .name           = "mpc8",
-    .long_name      = NULL_IF_CONFIG_SMALL("Musepack SV8"),
-    .priv_data_size = sizeof(MPCContext),
-    .read_probe     = mpc8_probe,
-    .read_header    = mpc8_read_header,
-    .read_packet    = mpc8_read_packet,
-    .read_seek      = mpc8_read_seek,
-};
diff --git a/deps/libav/libavformat/mpeg.c b/deps/libav/libavformat/mpeg.c
deleted file mode 100644
index 7430bb0..0000000
--- a/deps/libav/libavformat/mpeg.c
+++ /dev/null
@@ -1,549 +0,0 @@
-/*
- * MPEG1/2 demuxer
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "mpeg.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-/*********************************************/
-/* demux code */
-
-#define MAX_SYNC_SIZE 100000
-
-static int check_pes(uint8_t *p, uint8_t *end){
-    int pes1;
-    int pes2=      (p[3] & 0xC0) == 0x80
-                && (p[4] & 0xC0) != 0x40
-                &&((p[4] & 0xC0) == 0x00 || (p[4]&0xC0)>>2 == (p[6]&0xF0));
-
-    for(p+=3; p<end && *p == 0xFF; p++);
-    if((*p&0xC0) == 0x40) p+=2;
-    if((*p&0xF0) == 0x20){
-        pes1= p[0]&p[2]&p[4]&1;
-    }else if((*p&0xF0) == 0x30){
-        pes1= p[0]&p[2]&p[4]&p[5]&p[7]&p[9]&1;
-    }else
-        pes1 = *p == 0x0F;
-
-    return pes1||pes2;
-}
-
-static int check_pack_header(const uint8_t *buf) {
-    return (buf[1] & 0xC0) == 0x40 || (buf[1] & 0xF0) == 0x20;
-}
-
-static int mpegps_probe(AVProbeData *p)
-{
-    uint32_t code= -1;
-    int sys=0, pspack=0, priv1=0, vid=0, audio=0, invalid=0;
-    int i;
-    int score=0;
-
-    for(i=0; i<p->buf_size; i++){
-        code = (code<<8) + p->buf[i];
-        if ((code & 0xffffff00) == 0x100) {
-            int len= p->buf[i+1] << 8 | p->buf[i+2];
-            int pes= check_pes(p->buf+i, p->buf+p->buf_size);
-            int pack = check_pack_header(p->buf+i);
-
-            if(code == SYSTEM_HEADER_START_CODE) sys++;
-            else if(code == PACK_START_CODE && pack) pspack++;
-            else if((code & 0xf0) == VIDEO_ID &&  pes) vid++;
-            // skip pes payload to avoid start code emulation for private
-            // and audio streams
-            else if((code & 0xe0) == AUDIO_ID &&  pes) {audio++; i+=len;}
-            else if(code == PRIVATE_STREAM_1  &&  pes) {priv1++; i+=len;}
-
-            else if((code & 0xf0) == VIDEO_ID && !pes) invalid++;
-            else if((code & 0xe0) == AUDIO_ID && !pes) invalid++;
-            else if(code == PRIVATE_STREAM_1  && !pes) invalid++;
-        }
-    }
-
-    if(vid+audio > invalid)     /* invalid VDR files nd short PES streams */
-        score = AVPROBE_SCORE_EXTENSION / 2;
-
-    if(sys>invalid && sys*9 <= pspack*10)
-        return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg
-    if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9)
-        return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg
-    if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048 && vid + audio > invalid) /* PES stream */
-        return (audio > 12 || vid > 3) ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2;
-
-    //02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1
-    //mp3_misidentified_2.mp3 has sys:0 priv1:0 pspack:0 vid:0 audio:6
-    return score;
-}
-
-
-typedef struct MpegDemuxContext {
-    int32_t header_state;
-    unsigned char psm_es_type[256];
-    int sofdec;
-} MpegDemuxContext;
-
-static int mpegps_read_header(AVFormatContext *s)
-{
-    MpegDemuxContext *m = s->priv_data;
-    const char *sofdec = "Sofdec";
-    int v, i = 0;
-
-    m->header_state = 0xff;
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    m->sofdec = -1;
-    do {
-        v = avio_r8(s->pb);
-        m->header_state = m->header_state << 8 | v;
-        m->sofdec++;
-    } while (v == sofdec[i] && i++ < 6);
-
-    m->sofdec = (m->sofdec == 6) ? 1 : 0;
-
-    /* no need to do more */
-    return 0;
-}
-
-static int64_t get_pts(AVIOContext *pb, int c)
-{
-    uint8_t buf[5];
-
-    buf[0] = c<0 ? avio_r8(pb) : c;
-    avio_read(pb, buf+1, 4);
-
-    return ff_parse_pes_pts(buf);
-}
-
-static int find_next_start_code(AVIOContext *pb, int *size_ptr,
-                                int32_t *header_state)
-{
-    unsigned int state, v;
-    int val, n;
-
-    state = *header_state;
-    n = *size_ptr;
-    while (n > 0) {
-        if (pb->eof_reached)
-            break;
-        v = avio_r8(pb);
-        n--;
-        if (state == 0x000001) {
-            state = ((state << 8) | v) & 0xffffff;
-            val = state;
-            goto found;
-        }
-        state = ((state << 8) | v) & 0xffffff;
-    }
-    val = -1;
- found:
-    *header_state = state;
-    *size_ptr = n;
-    return val;
-}
-
-/**
- * Extract stream types from a program stream map
- * According to ISO/IEC 13818-1 ('MPEG-2 Systems') table 2-35
- *
- * @return number of bytes occupied by PSM in the bitstream
- */
-static long mpegps_psm_parse(MpegDemuxContext *m, AVIOContext *pb)
-{
-    int psm_length, ps_info_length, es_map_length;
-
-    psm_length = avio_rb16(pb);
-    avio_r8(pb);
-    avio_r8(pb);
-    ps_info_length = avio_rb16(pb);
-
-    /* skip program_stream_info */
-    avio_skip(pb, ps_info_length);
-    es_map_length = avio_rb16(pb);
-
-    /* at least one es available? */
-    while (es_map_length >= 4){
-        unsigned char type      = avio_r8(pb);
-        unsigned char es_id     = avio_r8(pb);
-        uint16_t es_info_length = avio_rb16(pb);
-        /* remember mapping from stream id to stream type */
-        m->psm_es_type[es_id] = type;
-        /* skip program_stream_info */
-        avio_skip(pb, es_info_length);
-        es_map_length -= 4 + es_info_length;
-    }
-    avio_rb32(pb); /* crc32 */
-    return 2 + psm_length;
-}
-
-/* read the next PES header. Return its position in ppos
-   (if not NULL), and its start code, pts and dts.
- */
-static int mpegps_read_pes_header(AVFormatContext *s,
-                                  int64_t *ppos, int *pstart_code,
-                                  int64_t *ppts, int64_t *pdts)
-{
-    MpegDemuxContext *m = s->priv_data;
-    int len, size, startcode, c, flags, header_len;
-    int pes_ext, ext2_len, id_ext, skip;
-    int64_t pts, dts;
-    int64_t last_sync= avio_tell(s->pb);
-
- error_redo:
-        avio_seek(s->pb, last_sync, SEEK_SET);
- redo:
-        /* next start code (should be immediately after) */
-        m->header_state = 0xff;
-        size = MAX_SYNC_SIZE;
-        startcode = find_next_start_code(s->pb, &size, &m->header_state);
-        last_sync = avio_tell(s->pb);
-    if (startcode < 0){
-        if(s->pb->eof_reached)
-            return AVERROR_EOF;
-        //FIXME we should remember header_state
-        return AVERROR(EAGAIN);
-    }
-
-    if (startcode == PACK_START_CODE)
-        goto redo;
-    if (startcode == SYSTEM_HEADER_START_CODE)
-        goto redo;
-    if (startcode == PADDING_STREAM) {
-        avio_skip(s->pb, avio_rb16(s->pb));
-        goto redo;
-    }
-    if (startcode == PRIVATE_STREAM_2) {
-        len = avio_rb16(s->pb);
-        if (!m->sofdec) {
-            while (len-- >= 6) {
-                if (avio_r8(s->pb) == 'S') {
-                    uint8_t buf[5];
-                    avio_read(s->pb, buf, sizeof(buf));
-                    m->sofdec = !memcmp(buf, "ofdec", 5);
-                    len -= sizeof(buf);
-                    break;
-                }
-            }
-            m->sofdec -= !m->sofdec;
-        }
-        avio_skip(s->pb, len);
-        goto redo;
-    }
-    if (startcode == PROGRAM_STREAM_MAP) {
-        mpegps_psm_parse(m, s->pb);
-        goto redo;
-    }
-
-    /* find matching stream */
-    if (!((startcode >= 0x1c0 && startcode <= 0x1df) ||
-          (startcode >= 0x1e0 && startcode <= 0x1ef) ||
-          (startcode == 0x1bd) || (startcode == 0x1fd)))
-        goto redo;
-    if (ppos) {
-        *ppos = avio_tell(s->pb) - 4;
-    }
-    len = avio_rb16(s->pb);
-    pts =
-    dts = AV_NOPTS_VALUE;
-    /* stuffing */
-    for(;;) {
-        if (len < 1)
-            goto error_redo;
-        c = avio_r8(s->pb);
-        len--;
-        /* XXX: for mpeg1, should test only bit 7 */
-        if (c != 0xff)
-            break;
-    }
-    if ((c & 0xc0) == 0x40) {
-        /* buffer scale & size */
-        avio_r8(s->pb);
-        c = avio_r8(s->pb);
-        len -= 2;
-    }
-    if ((c & 0xe0) == 0x20) {
-        dts = pts = get_pts(s->pb, c);
-        len -= 4;
-        if (c & 0x10){
-            dts = get_pts(s->pb, -1);
-            len -= 5;
-        }
-    } else if ((c & 0xc0) == 0x80) {
-        /* mpeg 2 PES */
-        flags = avio_r8(s->pb);
-        header_len = avio_r8(s->pb);
-        len -= 2;
-        if (header_len > len)
-            goto error_redo;
-        len -= header_len;
-        if (flags & 0x80) {
-            dts = pts = get_pts(s->pb, -1);
-            header_len -= 5;
-            if (flags & 0x40) {
-                dts = get_pts(s->pb, -1);
-                header_len -= 5;
-            }
-        }
-        if (flags & 0x3f && header_len == 0){
-            flags &= 0xC0;
-            av_log(s, AV_LOG_WARNING, "Further flags set but no bytes left\n");
-        }
-        if (flags & 0x01) { /* PES extension */
-            pes_ext = avio_r8(s->pb);
-            header_len--;
-            /* Skip PES private data, program packet sequence counter and P-STD buffer */
-            skip = (pes_ext >> 4) & 0xb;
-            skip += skip & 0x9;
-            if (pes_ext & 0x40 || skip > header_len){
-                av_log(s, AV_LOG_WARNING, "pes_ext %X is invalid\n", pes_ext);
-                pes_ext=skip=0;
-            }
-            avio_skip(s->pb, skip);
-            header_len -= skip;
-
-            if (pes_ext & 0x01) { /* PES extension 2 */
-                ext2_len = avio_r8(s->pb);
-                header_len--;
-                if ((ext2_len & 0x7f) > 0) {
-                    id_ext = avio_r8(s->pb);
-                    if ((id_ext & 0x80) == 0)
-                        startcode = ((startcode & 0xff) << 8) | id_ext;
-                    header_len--;
-                }
-            }
-        }
-        if(header_len < 0)
-            goto error_redo;
-        avio_skip(s->pb, header_len);
-    }
-    else if( c!= 0xf )
-        goto redo;
-
-    if (startcode == PRIVATE_STREAM_1 && !m->psm_es_type[startcode & 0xff]) {
-        startcode = avio_r8(s->pb);
-        len--;
-        if (startcode >= 0x80 && startcode <= 0xcf) {
-            /* audio: skip header */
-            avio_r8(s->pb);
-            avio_r8(s->pb);
-            avio_r8(s->pb);
-            len -= 3;
-            if (startcode >= 0xb0 && startcode <= 0xbf) {
-                /* MLP/TrueHD audio has a 4-byte header */
-                avio_r8(s->pb);
-                len--;
-            }
-        }
-    }
-    if(len<0)
-        goto error_redo;
-    if(dts != AV_NOPTS_VALUE && ppos){
-        int i;
-        for(i=0; i<s->nb_streams; i++){
-            if(startcode == s->streams[i]->id &&
-               s->pb->seekable /* index useless on streams anyway */) {
-                ff_reduce_index(s, i);
-                av_add_index_entry(s->streams[i], *ppos, dts, 0, 0, AVINDEX_KEYFRAME /* FIXME keyframe? */);
-            }
-        }
-    }
-
-    *pstart_code = startcode;
-    *ppts = pts;
-    *pdts = dts;
-    return len;
-}
-
-static int mpegps_read_packet(AVFormatContext *s,
-                              AVPacket *pkt)
-{
-    MpegDemuxContext *m = s->priv_data;
-    AVStream *st;
-    int len, startcode, i, es_type, ret;
-    enum AVCodecID codec_id = AV_CODEC_ID_NONE;
-    enum AVMediaType type;
-    int64_t pts, dts, dummy_pos; //dummy_pos is needed for the index building to work
-    uint8_t av_uninit(dvdaudio_substream_type);
-
- redo:
-    len = mpegps_read_pes_header(s, &dummy_pos, &startcode, &pts, &dts);
-    if (len < 0)
-        return len;
-
-    if(startcode == 0x1bd) {
-        dvdaudio_substream_type = avio_r8(s->pb);
-        avio_skip(s->pb, 3);
-        len -= 4;
-    }
-
-    /* now find stream */
-    for(i=0;i<s->nb_streams;i++) {
-        st = s->streams[i];
-        if (st->id == startcode)
-            goto found;
-    }
-
-    es_type = m->psm_es_type[startcode & 0xff];
-    if(es_type > 0 && es_type != STREAM_TYPE_PRIVATE_DATA){
-        if(es_type == STREAM_TYPE_VIDEO_MPEG1){
-            codec_id = AV_CODEC_ID_MPEG2VIDEO;
-            type = AVMEDIA_TYPE_VIDEO;
-        } else if(es_type == STREAM_TYPE_VIDEO_MPEG2){
-            codec_id = AV_CODEC_ID_MPEG2VIDEO;
-            type = AVMEDIA_TYPE_VIDEO;
-        } else if(es_type == STREAM_TYPE_AUDIO_MPEG1 ||
-                  es_type == STREAM_TYPE_AUDIO_MPEG2){
-            codec_id = AV_CODEC_ID_MP3;
-            type = AVMEDIA_TYPE_AUDIO;
-        } else if(es_type == STREAM_TYPE_AUDIO_AAC){
-            codec_id = AV_CODEC_ID_AAC;
-            type = AVMEDIA_TYPE_AUDIO;
-        } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){
-            codec_id = AV_CODEC_ID_MPEG4;
-            type = AVMEDIA_TYPE_VIDEO;
-        } else if(es_type == STREAM_TYPE_VIDEO_H264){
-            codec_id = AV_CODEC_ID_H264;
-            type = AVMEDIA_TYPE_VIDEO;
-        } else if(es_type == STREAM_TYPE_AUDIO_AC3){
-            codec_id = AV_CODEC_ID_AC3;
-            type = AVMEDIA_TYPE_AUDIO;
-        } else {
-            goto skip;
-        }
-    } else if (startcode >= 0x1e0 && startcode <= 0x1ef) {
-        static const unsigned char avs_seqh[4] = { 0, 0, 1, 0xb0 };
-        unsigned char buf[8];
-        avio_read(s->pb, buf, 8);
-        avio_seek(s->pb, -8, SEEK_CUR);
-        if(!memcmp(buf, avs_seqh, 4) && (buf[6] != 0 || buf[7] != 1))
-            codec_id = AV_CODEC_ID_CAVS;
-        else
-            codec_id = AV_CODEC_ID_PROBE;
-        type = AVMEDIA_TYPE_VIDEO;
-    } else if (startcode >= 0x1c0 && startcode <= 0x1df) {
-        type = AVMEDIA_TYPE_AUDIO;
-        codec_id = m->sofdec > 0 ? AV_CODEC_ID_ADPCM_ADX : AV_CODEC_ID_MP2;
-    } else if (startcode >= 0x80 && startcode <= 0x87) {
-        type = AVMEDIA_TYPE_AUDIO;
-        codec_id = AV_CODEC_ID_AC3;
-    } else if (  ( startcode >= 0x88 && startcode <= 0x8f)
-               ||( startcode >= 0x98 && startcode <= 0x9f)) {
-        /* 0x90 - 0x97 is reserved for SDDS in DVD specs */
-        type = AVMEDIA_TYPE_AUDIO;
-        codec_id = AV_CODEC_ID_DTS;
-    } else if (startcode >= 0xa0 && startcode <= 0xaf) {
-        type = AVMEDIA_TYPE_AUDIO;
-        codec_id = AV_CODEC_ID_PCM_DVD;
-    } else if (startcode >= 0xb0 && startcode <= 0xbf) {
-        type = AVMEDIA_TYPE_AUDIO;
-        codec_id = AV_CODEC_ID_TRUEHD;
-    } else if (startcode >= 0xc0 && startcode <= 0xcf) {
-        /* Used for both AC-3 and E-AC-3 in EVOB files */
-        type = AVMEDIA_TYPE_AUDIO;
-        codec_id = AV_CODEC_ID_AC3;
-    } else if (startcode >= 0x20 && startcode <= 0x3f) {
-        type = AVMEDIA_TYPE_SUBTITLE;
-        codec_id = AV_CODEC_ID_DVD_SUBTITLE;
-    } else if (startcode >= 0xfd55 && startcode <= 0xfd5f) {
-        type = AVMEDIA_TYPE_VIDEO;
-        codec_id = AV_CODEC_ID_VC1;
-    } else if (startcode == 0x1bd) {
-        // check dvd audio substream type
-        type = AVMEDIA_TYPE_AUDIO;
-        switch(dvdaudio_substream_type & 0xe0) {
-        case 0xa0:  codec_id = AV_CODEC_ID_PCM_DVD;
-                    break;
-        case 0x80:  if((dvdaudio_substream_type & 0xf8) == 0x88)
-                         codec_id = AV_CODEC_ID_DTS;
-                    else codec_id = AV_CODEC_ID_AC3;
-                    break;
-        default:    av_log(s, AV_LOG_ERROR, "Unknown 0x1bd sub-stream\n");
-                    goto skip;
-        }
-    } else {
-    skip:
-        /* skip packet */
-        avio_skip(s->pb, len);
-        goto redo;
-    }
-    /* no stream found: add a new stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        goto skip;
-    st->id = startcode;
-    st->codec->codec_type = type;
-    st->codec->codec_id = codec_id;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
- found:
-    if(st->discard >= AVDISCARD_ALL)
-        goto skip;
-    ret = av_get_packet(s->pb, pkt, len);
-    pkt->pts = pts;
-    pkt->dts = dts;
-    pkt->pos = dummy_pos;
-    pkt->stream_index = st->index;
-    av_dlog(s, "%d: pts=%0.3f dts=%0.3f size=%d\n",
-            pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0,
-            pkt->size);
-
-    return (ret < 0) ? ret : 0;
-}
-
-static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
-                               int64_t *ppos, int64_t pos_limit)
-{
-    int len, startcode;
-    int64_t pos, pts, dts;
-
-    pos = *ppos;
-    if (avio_seek(s->pb, pos, SEEK_SET) < 0)
-        return AV_NOPTS_VALUE;
-
-    for(;;) {
-        len = mpegps_read_pes_header(s, &pos, &startcode, &pts, &dts);
-        if (len < 0) {
-            av_dlog(s, "none (ret=%d)\n", len);
-            return AV_NOPTS_VALUE;
-        }
-        if (startcode == s->streams[stream_index]->id &&
-            dts != AV_NOPTS_VALUE) {
-            break;
-        }
-        avio_skip(s->pb, len);
-    }
-    av_dlog(s, "pos=0x%"PRIx64" dts=0x%"PRIx64" %0.3f\n",
-            pos, dts, dts / 90000.0);
-    *ppos = pos;
-    return dts;
-}
-
-AVInputFormat ff_mpegps_demuxer = {
-    .name           = "mpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-PS (MPEG-2 Program Stream)"),
-    .priv_data_size = sizeof(MpegDemuxContext),
-    .read_probe     = mpegps_probe,
-    .read_header    = mpegps_read_header,
-    .read_packet    = mpegps_read_packet,
-    .read_timestamp = mpegps_read_dts,
-    .flags          = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
-};
diff --git a/deps/libav/libavformat/mpeg.h b/deps/libav/libavformat/mpeg.h
deleted file mode 100644
index 629f2f0..0000000
--- a/deps/libav/libavformat/mpeg.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * MPEG1/2 muxer and demuxer common defines
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_MPEG_H
-#define AVFORMAT_MPEG_H
-
-#include <stdint.h>
-#include "libavutil/intreadwrite.h"
-
-#define PACK_START_CODE             ((unsigned int)0x000001ba)
-#define SYSTEM_HEADER_START_CODE    ((unsigned int)0x000001bb)
-#define SEQUENCE_END_CODE           ((unsigned int)0x000001b7)
-#define PACKET_START_CODE_MASK      ((unsigned int)0xffffff00)
-#define PACKET_START_CODE_PREFIX    ((unsigned int)0x00000100)
-#define ISO_11172_END_CODE          ((unsigned int)0x000001b9)
-
-/* mpeg2 */
-#define PROGRAM_STREAM_MAP 0x1bc
-#define PRIVATE_STREAM_1   0x1bd
-#define PADDING_STREAM     0x1be
-#define PRIVATE_STREAM_2   0x1bf
-
-#define AUDIO_ID 0xc0
-#define VIDEO_ID 0xe0
-#define AC3_ID   0x80
-#define DTS_ID   0x8a
-#define LPCM_ID  0xa0
-#define SUB_ID   0x20
-
-#define STREAM_TYPE_VIDEO_MPEG1     0x01
-#define STREAM_TYPE_VIDEO_MPEG2     0x02
-#define STREAM_TYPE_AUDIO_MPEG1     0x03
-#define STREAM_TYPE_AUDIO_MPEG2     0x04
-#define STREAM_TYPE_PRIVATE_SECTION 0x05
-#define STREAM_TYPE_PRIVATE_DATA    0x06
-#define STREAM_TYPE_AUDIO_AAC       0x0f
-#define STREAM_TYPE_VIDEO_MPEG4     0x10
-#define STREAM_TYPE_VIDEO_H264      0x1b
-#define STREAM_TYPE_VIDEO_CAVS      0x42
-
-#define STREAM_TYPE_AUDIO_AC3       0x81
-#define STREAM_TYPE_AUDIO_DTS       0x8a
-
-static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 };
-
-/**
- * Parse MPEG-PES five-byte timestamp
- */
-static inline int64_t ff_parse_pes_pts(const uint8_t *buf) {
-    return (int64_t)(*buf & 0x0e) << 29 |
-            (AV_RB16(buf+1) >> 1) << 15 |
-             AV_RB16(buf+3) >> 1;
-}
-
-#endif /* AVFORMAT_MPEG_H */
diff --git a/deps/libav/libavformat/mpegenc.c b/deps/libav/libavformat/mpegenc.c
deleted file mode 100644
index 13d5b03..0000000
--- a/deps/libav/libavformat/mpegenc.c
+++ /dev/null
@@ -1,1233 +0,0 @@
-/*
- * MPEG1/2 muxer
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/fifo.h"
-#include "libavutil/log.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavcodec/put_bits.h"
-#include "avformat.h"
-#include "internal.h"
-#include "mpeg.h"
-
-#define MAX_PAYLOAD_SIZE 4096
-
-#undef NDEBUG
-#include <assert.h>
-
-typedef struct PacketDesc {
-    int64_t pts;
-    int64_t dts;
-    int size;
-    int unwritten_size;
-    int flags;
-    struct PacketDesc *next;
-} PacketDesc;
-
-typedef struct {
-    AVFifoBuffer *fifo;
-    uint8_t id;
-    int max_buffer_size; /* in bytes */
-    int buffer_index;
-    PacketDesc *predecode_packet;
-    PacketDesc *premux_packet;
-    PacketDesc **next_packet;
-    int packet_number;
-    uint8_t lpcm_header[3];
-    int lpcm_align;
-    int bytes_to_iframe;
-    int align_iframe;
-    int64_t vobu_start_pts;
-} StreamInfo;
-
-typedef struct {
-    const AVClass *class;
-    int packet_size; /* required packet size */
-    int packet_number;
-    int pack_header_freq;     /* frequency (in packets^-1) at which we send pack headers */
-    int system_header_freq;
-    int system_header_size;
-    int mux_rate; /* bitrate in units of 50 bytes/s */
-    /* stream info */
-    int audio_bound;
-    int video_bound;
-    int is_mpeg2;
-    int is_vcd;
-    int is_svcd;
-    int is_dvd;
-    int64_t last_scr; /* current system clock */
-
-    double vcd_padding_bitrate; //FIXME floats
-    int64_t vcd_padding_bytes_written;
-
-    int preload;
-} MpegMuxContext;
-
-extern AVOutputFormat ff_mpeg1vcd_muxer;
-extern AVOutputFormat ff_mpeg2dvd_muxer;
-extern AVOutputFormat ff_mpeg2svcd_muxer;
-extern AVOutputFormat ff_mpeg2vob_muxer;
-
-static int put_pack_header(AVFormatContext *ctx,
-                           uint8_t *buf, int64_t timestamp)
-{
-    MpegMuxContext *s = ctx->priv_data;
-    PutBitContext pb;
-
-    init_put_bits(&pb, buf, 128);
-
-    put_bits32(&pb, PACK_START_CODE);
-    if (s->is_mpeg2) {
-        put_bits(&pb, 2, 0x1);
-    } else {
-        put_bits(&pb, 4, 0x2);
-    }
-    put_bits(&pb, 3,  (uint32_t)((timestamp >> 30) & 0x07));
-    put_bits(&pb, 1, 1);
-    put_bits(&pb, 15, (uint32_t)((timestamp >> 15) & 0x7fff));
-    put_bits(&pb, 1, 1);
-    put_bits(&pb, 15, (uint32_t)((timestamp      ) & 0x7fff));
-    put_bits(&pb, 1, 1);
-    if (s->is_mpeg2) {
-        /* clock extension */
-        put_bits(&pb, 9, 0);
-    }
-    put_bits(&pb, 1, 1);
-    put_bits(&pb, 22, s->mux_rate);
-    put_bits(&pb, 1, 1);
-    if (s->is_mpeg2) {
-        put_bits(&pb, 1, 1);
-        put_bits(&pb, 5, 0x1f); /* reserved */
-        put_bits(&pb, 3, 0); /* stuffing length */
-    }
-    flush_put_bits(&pb);
-    return put_bits_ptr(&pb) - pb.buf;
-}
-
-static int put_system_header(AVFormatContext *ctx, uint8_t *buf,int only_for_stream_id)
-{
-    MpegMuxContext *s = ctx->priv_data;
-    int size, i, private_stream_coded, id;
-    PutBitContext pb;
-
-    init_put_bits(&pb, buf, 128);
-
-    put_bits32(&pb, SYSTEM_HEADER_START_CODE);
-    put_bits(&pb, 16, 0);
-    put_bits(&pb, 1, 1);
-
-    put_bits(&pb, 22, s->mux_rate); /* maximum bit rate of the multiplexed stream */
-    put_bits(&pb, 1, 1); /* marker */
-    if (s->is_vcd && only_for_stream_id==VIDEO_ID) {
-        /* This header applies only to the video stream (see VCD standard p. IV-7)*/
-        put_bits(&pb, 6, 0);
-    } else
-        put_bits(&pb, 6, s->audio_bound);
-
-    if (s->is_vcd) {
-        /* see VCD standard, p. IV-7*/
-        put_bits(&pb, 1, 0);
-        put_bits(&pb, 1, 1);
-    } else {
-        put_bits(&pb, 1, 0); /* variable bitrate*/
-        put_bits(&pb, 1, 0); /* non constrainted bit stream */
-    }
-
-    if (s->is_vcd || s->is_dvd) {
-        /* see VCD standard p IV-7 */
-        put_bits(&pb, 1, 1); /* audio locked */
-        put_bits(&pb, 1, 1); /* video locked */
-    } else {
-        put_bits(&pb, 1, 0); /* audio locked */
-        put_bits(&pb, 1, 0); /* video locked */
-    }
-
-    put_bits(&pb, 1, 1); /* marker */
-
-    if (s->is_vcd && (only_for_stream_id & 0xe0) == AUDIO_ID) {
-        /* This header applies only to the audio stream (see VCD standard p. IV-7)*/
-        put_bits(&pb, 5, 0);
-    } else
-        put_bits(&pb, 5, s->video_bound);
-
-    if (s->is_dvd) {
-        put_bits(&pb, 1, 0);    /* packet_rate_restriction_flag */
-        put_bits(&pb, 7, 0x7f); /* reserved byte */
-    } else
-        put_bits(&pb, 8, 0xff); /* reserved byte */
-
-    /* DVD-Video Stream_bound entries
-    id (0xB9) video, maximum P-STD for stream 0xE0. (P-STD_buffer_bound_scale = 1)
-    id (0xB8) audio, maximum P-STD for any MPEG audio (0xC0 to 0xC7) streams. If there are none set to 4096 (32x128). (P-STD_buffer_bound_scale = 0)
-    id (0xBD) private stream 1 (audio other than MPEG and subpictures). (P-STD_buffer_bound_scale = 1)
-    id (0xBF) private stream 2, NAV packs, set to 2x1024. */
-    if (s->is_dvd) {
-
-        int P_STD_max_video = 0;
-        int P_STD_max_mpeg_audio = 0;
-        int P_STD_max_mpeg_PS1 = 0;
-
-        for(i=0;i<ctx->nb_streams;i++) {
-            StreamInfo *stream = ctx->streams[i]->priv_data;
-
-            id = stream->id;
-            if (id == 0xbd && stream->max_buffer_size > P_STD_max_mpeg_PS1) {
-                P_STD_max_mpeg_PS1 = stream->max_buffer_size;
-            } else if (id >= 0xc0 && id <= 0xc7 && stream->max_buffer_size > P_STD_max_mpeg_audio) {
-                P_STD_max_mpeg_audio = stream->max_buffer_size;
-            } else if (id == 0xe0 && stream->max_buffer_size > P_STD_max_video) {
-                P_STD_max_video = stream->max_buffer_size;
-            }
-        }
-
-        /* video */
-        put_bits(&pb, 8, 0xb9); /* stream ID */
-        put_bits(&pb, 2, 3);
-        put_bits(&pb, 1, 1);
-        put_bits(&pb, 13, P_STD_max_video / 1024);
-
-        /* audio */
-        if (P_STD_max_mpeg_audio == 0)
-            P_STD_max_mpeg_audio = 4096;
-        put_bits(&pb, 8, 0xb8); /* stream ID */
-        put_bits(&pb, 2, 3);
-        put_bits(&pb, 1, 0);
-        put_bits(&pb, 13, P_STD_max_mpeg_audio / 128);
-
-        /* private stream 1 */
-        put_bits(&pb, 8, 0xbd); /* stream ID */
-        put_bits(&pb, 2, 3);
-        put_bits(&pb, 1, 0);
-        put_bits(&pb, 13, P_STD_max_mpeg_PS1 / 128);
-
-        /* private stream 2 */
-        put_bits(&pb, 8, 0xbf); /* stream ID */
-        put_bits(&pb, 2, 3);
-        put_bits(&pb, 1, 1);
-        put_bits(&pb, 13, 2);
-    }
-    else {
-        /* audio stream info */
-        private_stream_coded = 0;
-        for(i=0;i<ctx->nb_streams;i++) {
-            StreamInfo *stream = ctx->streams[i]->priv_data;
-
-
-            /* For VCDs, only include the stream info for the stream
-            that the pack which contains this system belongs to.
-            (see VCD standard p. IV-7) */
-            if ( !s->is_vcd || stream->id==only_for_stream_id
-                || only_for_stream_id==0) {
-
-                id = stream->id;
-                if (id < 0xc0) {
-                    /* special case for private streams (AC-3 uses that) */
-                    if (private_stream_coded)
-                        continue;
-                    private_stream_coded = 1;
-                    id = 0xbd;
-                }
-                put_bits(&pb, 8, id); /* stream ID */
-                put_bits(&pb, 2, 3);
-                if (id < 0xe0) {
-                    /* audio */
-                    put_bits(&pb, 1, 0);
-                    put_bits(&pb, 13, stream->max_buffer_size / 128);
-                } else {
-                    /* video */
-                    put_bits(&pb, 1, 1);
-                    put_bits(&pb, 13, stream->max_buffer_size / 1024);
-                }
-            }
-        }
-    }
-
-    flush_put_bits(&pb);
-    size = put_bits_ptr(&pb) - pb.buf;
-    /* patch packet size */
-    buf[4] = (size - 6) >> 8;
-    buf[5] = (size - 6) & 0xff;
-
-    return size;
-}
-
-static int get_system_header_size(AVFormatContext *ctx)
-{
-    int buf_index, i, private_stream_coded;
-    StreamInfo *stream;
-    MpegMuxContext *s = ctx->priv_data;
-
-    if (s->is_dvd)
-       return 18; // DVD-Video system headers are 18 bytes fixed length.
-
-    buf_index = 12;
-    private_stream_coded = 0;
-    for(i=0;i<ctx->nb_streams;i++) {
-        stream = ctx->streams[i]->priv_data;
-        if (stream->id < 0xc0) {
-            if (private_stream_coded)
-                continue;
-            private_stream_coded = 1;
-        }
-        buf_index += 3;
-    }
-    return buf_index;
-}
-
-static av_cold int mpeg_mux_init(AVFormatContext *ctx)
-{
-    MpegMuxContext *s = ctx->priv_data;
-    int bitrate, i, mpa_id, mpv_id, mps_id, ac3_id, dts_id, lpcm_id, j;
-    AVStream *st;
-    StreamInfo *stream;
-    int audio_bitrate;
-    int video_bitrate;
-
-    s->packet_number = 0;
-    s->is_vcd =    (CONFIG_MPEG1VCD_MUXER  && ctx->oformat == &ff_mpeg1vcd_muxer);
-    s->is_svcd =   (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer);
-    s->is_mpeg2 = ((CONFIG_MPEG2VOB_MUXER  && ctx->oformat == &ff_mpeg2vob_muxer) ||
-                   (CONFIG_MPEG2DVD_MUXER  && ctx->oformat == &ff_mpeg2dvd_muxer) ||
-                   (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer));
-    s->is_dvd =    (CONFIG_MPEG2DVD_MUXER  && ctx->oformat == &ff_mpeg2dvd_muxer);
-
-    if(ctx->packet_size) {
-        if (ctx->packet_size < 20 || ctx->packet_size > (1 << 23) + 10) {
-            av_log(ctx, AV_LOG_ERROR, "Invalid packet size %d\n",
-                   ctx->packet_size);
-            goto fail;
-        }
-        s->packet_size = ctx->packet_size;
-    } else
-        s->packet_size = 2048;
-    if (ctx->max_delay < 0) /* Not set by the caller */
-        ctx->max_delay = 0;
-
-    s->vcd_padding_bytes_written = 0;
-    s->vcd_padding_bitrate=0;
-
-    s->audio_bound = 0;
-    s->video_bound = 0;
-    mpa_id = AUDIO_ID;
-    ac3_id = AC3_ID;
-    dts_id = DTS_ID;
-    mpv_id = VIDEO_ID;
-    mps_id = SUB_ID;
-    lpcm_id = LPCM_ID;
-    for(i=0;i<ctx->nb_streams;i++) {
-        st = ctx->streams[i];
-        stream = av_mallocz(sizeof(StreamInfo));
-        if (!stream)
-            goto fail;
-        st->priv_data = stream;
-
-        avpriv_set_pts_info(st, 64, 1, 90000);
-
-        switch(st->codec->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            if        (st->codec->codec_id == AV_CODEC_ID_AC3) {
-                stream->id = ac3_id++;
-            } else if (st->codec->codec_id == AV_CODEC_ID_DTS) {
-                stream->id = dts_id++;
-            } else if (st->codec->codec_id == AV_CODEC_ID_PCM_S16BE) {
-                stream->id = lpcm_id++;
-                for(j = 0; j < 4; j++) {
-                    if (lpcm_freq_tab[j] == st->codec->sample_rate)
-                        break;
-                }
-                if (j == 4)
-                    goto fail;
-                if (st->codec->channels > 8)
-                    return -1;
-                stream->lpcm_header[0] = 0x0c;
-                stream->lpcm_header[1] = (st->codec->channels - 1) | (j << 4);
-                stream->lpcm_header[2] = 0x80;
-                stream->lpcm_align = st->codec->channels * 2;
-            } else {
-                stream->id = mpa_id++;
-            }
-
-            /* This value HAS to be used for VCD (see VCD standard, p. IV-7).
-               Right now it is also used for everything else.*/
-            stream->max_buffer_size = 4 * 1024;
-            s->audio_bound++;
-            break;
-        case AVMEDIA_TYPE_VIDEO:
-            stream->id = mpv_id++;
-            if (st->codec->rc_buffer_size)
-                stream->max_buffer_size = 6*1024 + st->codec->rc_buffer_size/8;
-            else {
-                av_log(ctx, AV_LOG_WARNING, "VBV buffer size not set, muxing may fail\n");
-                stream->max_buffer_size = 230*1024; //FIXME this is probably too small as default
-            }
-            s->video_bound++;
-            break;
-        case AVMEDIA_TYPE_SUBTITLE:
-            stream->id = mps_id++;
-            stream->max_buffer_size = 16 * 1024;
-            break;
-        default:
-            return -1;
-        }
-        stream->fifo= av_fifo_alloc(16);
-        if (!stream->fifo)
-            goto fail;
-    }
-    bitrate = 0;
-    audio_bitrate = 0;
-    video_bitrate = 0;
-    for(i=0;i<ctx->nb_streams;i++) {
-        int codec_rate;
-        st = ctx->streams[i];
-        stream = (StreamInfo*) st->priv_data;
-
-        if(st->codec->rc_max_rate || stream->id==VIDEO_ID)
-            codec_rate= st->codec->rc_max_rate;
-        else
-            codec_rate= st->codec->bit_rate;
-
-        if(!codec_rate)
-            codec_rate= (1<<21)*8*50/ctx->nb_streams;
-
-        bitrate += codec_rate;
-
-        if ((stream->id & 0xe0) == AUDIO_ID)
-            audio_bitrate += codec_rate;
-        else if (stream->id==VIDEO_ID)
-            video_bitrate += codec_rate;
-    }
-
-    if (!s->mux_rate) {
-        /* we increase slightly the bitrate to take into account the
-           headers. XXX: compute it exactly */
-        bitrate += bitrate / 20;
-        bitrate += 10000;
-        s->mux_rate = (bitrate + (8 * 50) - 1) / (8 * 50);
-    }
-
-    if (s->is_vcd) {
-        double overhead_rate;
-
-        /* The VCD standard mandates that the mux_rate field is 3528
-           (see standard p. IV-6).
-           The value is actually "wrong", i.e. if you calculate
-           it using the normal formula and the 75 sectors per second transfer
-           rate you get a different value because the real pack size is 2324,
-           not 2352. But the standard explicitly specifies that the mux_rate
-           field in the header must have this value.*/
-//        s->mux_rate=2352 * 75 / 50;    /* = 3528*/
-
-        /* The VCD standard states that the muxed stream must be
-           exactly 75 packs / second (the data rate of a single speed cdrom).
-           Since the video bitrate (probably 1150000 bits/sec) will be below
-           the theoretical maximum we have to add some padding packets
-           to make up for the lower data rate.
-           (cf. VCD standard p. IV-6 )*/
-
-        /* Add the header overhead to the data rate.
-           2279 data bytes per audio pack, 2294 data bytes per video pack*/
-        overhead_rate  = ((audio_bitrate / 8.0) / 2279) * (2324 - 2279);
-        overhead_rate += ((video_bitrate / 8.0) / 2294) * (2324 - 2294);
-        overhead_rate *= 8;
-
-        /* Add padding so that the full bitrate is 2324*75 bytes/sec */
-        s->vcd_padding_bitrate = 2324 * 75 * 8 - (bitrate + overhead_rate);
-    }
-
-    if (s->is_vcd || s->is_mpeg2)
-        /* every packet */
-        s->pack_header_freq = 1;
-    else
-        /* every 2 seconds */
-        s->pack_header_freq = 2 * bitrate / s->packet_size / 8;
-
-    /* the above seems to make pack_header_freq zero sometimes */
-    if (s->pack_header_freq == 0)
-       s->pack_header_freq = 1;
-
-    if (s->is_mpeg2)
-        /* every 200 packets. Need to look at the spec.  */
-        s->system_header_freq = s->pack_header_freq * 40;
-    else if (s->is_vcd)
-        /* the standard mandates that there are only two system headers
-           in the whole file: one in the first packet of each stream.
-           (see standard p. IV-7 and IV-8) */
-        s->system_header_freq = 0x7fffffff;
-    else
-        s->system_header_freq = s->pack_header_freq * 5;
-
-    for(i=0;i<ctx->nb_streams;i++) {
-        stream = ctx->streams[i]->priv_data;
-        stream->packet_number = 0;
-    }
-    s->system_header_size = get_system_header_size(ctx);
-    s->last_scr = 0;
-    return 0;
- fail:
-    for(i=0;i<ctx->nb_streams;i++) {
-        av_free(ctx->streams[i]->priv_data);
-    }
-    return AVERROR(ENOMEM);
-}
-
-static inline void put_timestamp(AVIOContext *pb, int id, int64_t timestamp)
-{
-    avio_w8(pb,
-             (id << 4) |
-             (((timestamp >> 30) & 0x07) << 1) |
-             1);
-    avio_wb16(pb, (uint16_t)((((timestamp >> 15) & 0x7fff) << 1) | 1));
-    avio_wb16(pb, (uint16_t)((((timestamp      ) & 0x7fff) << 1) | 1));
-}
-
-
-/* return the number of padding bytes that should be inserted into
-   the multiplexed stream.*/
-static int get_vcd_padding_size(AVFormatContext *ctx, int64_t pts)
-{
-    MpegMuxContext *s = ctx->priv_data;
-    int pad_bytes = 0;
-
-    if (s->vcd_padding_bitrate > 0 && pts!=AV_NOPTS_VALUE)
-    {
-        int64_t full_pad_bytes;
-
-        full_pad_bytes = (int64_t)((s->vcd_padding_bitrate * (pts / 90000.0)) / 8.0); //FIXME this is wrong
-        pad_bytes = (int) (full_pad_bytes - s->vcd_padding_bytes_written);
-
-        if (pad_bytes<0)
-            /* might happen if we have already padded to a later timestamp. This
-               can occur if another stream has already advanced further.*/
-            pad_bytes=0;
-    }
-
-    return pad_bytes;
-}
-
-
-/* Write an MPEG padding packet header. */
-static void put_padding_packet(AVFormatContext *ctx, AVIOContext *pb,int packet_bytes)
-{
-    MpegMuxContext *s = ctx->priv_data;
-    int i;
-
-    avio_wb32(pb, PADDING_STREAM);
-    avio_wb16(pb, packet_bytes - 6);
-    if (!s->is_mpeg2) {
-        avio_w8(pb, 0x0f);
-        packet_bytes -= 7;
-    } else
-        packet_bytes -= 6;
-
-    for(i=0;i<packet_bytes;i++)
-        avio_w8(pb, 0xff);
-}
-
-static int get_nb_frames(AVFormatContext *ctx, StreamInfo *stream, int len){
-    int nb_frames=0;
-    PacketDesc *pkt_desc= stream->premux_packet;
-
-    while(len>0){
-        if(pkt_desc->size == pkt_desc->unwritten_size)
-            nb_frames++;
-        len -= pkt_desc->unwritten_size;
-        pkt_desc= pkt_desc->next;
-    }
-
-    return nb_frames;
-}
-
-/* flush the packet on stream stream_index */
-static int flush_packet(AVFormatContext *ctx, int stream_index,
-                         int64_t pts, int64_t dts, int64_t scr, int trailer_size)
-{
-    MpegMuxContext *s = ctx->priv_data;
-    StreamInfo *stream = ctx->streams[stream_index]->priv_data;
-    uint8_t *buf_ptr;
-    int size, payload_size, startcode, id, stuffing_size, i, header_len;
-    int packet_size;
-    uint8_t buffer[128];
-    int zero_trail_bytes = 0;
-    int pad_packet_bytes = 0;
-    int pes_flags;
-    int general_pack = 0;  /*"general" pack without data specific to one stream?*/
-    int nb_frames;
-
-    id = stream->id;
-
-    av_dlog(ctx, "packet ID=%2x PTS=%0.3f\n", id, pts / 90000.0);
-
-    buf_ptr = buffer;
-
-    if ((s->packet_number % s->pack_header_freq) == 0 || s->last_scr != scr) {
-        /* output pack and systems header if needed */
-        size = put_pack_header(ctx, buf_ptr, scr);
-        buf_ptr += size;
-        s->last_scr= scr;
-
-        if (s->is_vcd) {
-            /* there is exactly one system header for each stream in a VCD MPEG,
-               One in the very first video packet and one in the very first
-               audio packet (see VCD standard p. IV-7 and IV-8).*/
-
-            if (stream->packet_number==0) {
-                size = put_system_header(ctx, buf_ptr, id);
-                buf_ptr += size;
-            }
-        } else if (s->is_dvd) {
-            if (stream->align_iframe || s->packet_number == 0){
-                int PES_bytes_to_fill = s->packet_size - size - 10;
-
-                if (pts != AV_NOPTS_VALUE) {
-                    if (dts != pts)
-                        PES_bytes_to_fill -= 5 + 5;
-                    else
-                        PES_bytes_to_fill -= 5;
-                }
-
-                if (stream->bytes_to_iframe == 0 || s->packet_number == 0) {
-                    size = put_system_header(ctx, buf_ptr, 0);
-                    buf_ptr += size;
-                    size = buf_ptr - buffer;
-                    avio_write(ctx->pb, buffer, size);
-
-                    avio_wb32(ctx->pb, PRIVATE_STREAM_2);
-                    avio_wb16(ctx->pb, 0x03d4);         // length
-                    avio_w8(ctx->pb, 0x00);           // substream ID, 00=PCI
-                    for (i = 0; i < 979; i++)
-                        avio_w8(ctx->pb, 0x00);
-
-                    avio_wb32(ctx->pb, PRIVATE_STREAM_2);
-                    avio_wb16(ctx->pb, 0x03fa);         // length
-                    avio_w8(ctx->pb, 0x01);           // substream ID, 01=DSI
-                    for (i = 0; i < 1017; i++)
-                        avio_w8(ctx->pb, 0x00);
-
-                    memset(buffer, 0, 128);
-                    buf_ptr = buffer;
-                    s->packet_number++;
-                    stream->align_iframe = 0;
-                    scr += s->packet_size*90000LL / (s->mux_rate*50LL); //FIXME rounding and first few bytes of each packet
-                    size = put_pack_header(ctx, buf_ptr, scr);
-                    s->last_scr= scr;
-                    buf_ptr += size;
-                    /* GOP Start */
-                } else if (stream->bytes_to_iframe < PES_bytes_to_fill) {
-                    pad_packet_bytes = PES_bytes_to_fill - stream->bytes_to_iframe;
-                }
-            }
-        } else {
-            if ((s->packet_number % s->system_header_freq) == 0) {
-                size = put_system_header(ctx, buf_ptr, 0);
-                buf_ptr += size;
-            }
-        }
-    }
-    size = buf_ptr - buffer;
-    avio_write(ctx->pb, buffer, size);
-
-    packet_size = s->packet_size - size;
-
-    if (s->is_vcd && (id & 0xe0) == AUDIO_ID)
-        /* The VCD standard demands that 20 zero bytes follow
-           each audio pack (see standard p. IV-8).*/
-        zero_trail_bytes += 20;
-
-    if ((s->is_vcd && stream->packet_number==0)
-        || (s->is_svcd && s->packet_number==0)) {
-        /* for VCD the first pack of each stream contains only the pack header,
-           the system header and lots of padding (see VCD standard p. IV-6).
-           In the case of an audio pack, 20 zero bytes are also added at
-           the end.*/
-        /* For SVCD we fill the very first pack to increase compatibility with
-           some DVD players. Not mandated by the standard.*/
-        if (s->is_svcd)
-            general_pack = 1;    /* the system header refers to both streams and no stream data*/
-        pad_packet_bytes = packet_size - zero_trail_bytes;
-    }
-
-    packet_size -= pad_packet_bytes + zero_trail_bytes;
-
-    if (packet_size > 0) {
-
-        /* packet header size */
-        packet_size -= 6;
-
-        /* packet header */
-        if (s->is_mpeg2) {
-            header_len = 3;
-            if (stream->packet_number==0)
-                header_len += 3; /* PES extension */
-            header_len += 1; /* obligatory stuffing byte */
-        } else {
-            header_len = 0;
-        }
-        if (pts != AV_NOPTS_VALUE) {
-            if (dts != pts)
-                header_len += 5 + 5;
-            else
-                header_len += 5;
-        } else {
-            if (!s->is_mpeg2)
-                header_len++;
-        }
-
-        payload_size = packet_size - header_len;
-        if (id < 0xc0) {
-            startcode = PRIVATE_STREAM_1;
-            payload_size -= 1;
-            if (id >= 0x40) {
-                payload_size -= 3;
-                if (id >= 0xa0)
-                    payload_size -= 3;
-            }
-        } else {
-            startcode = 0x100 + id;
-        }
-
-        stuffing_size = payload_size - av_fifo_size(stream->fifo);
-
-        // first byte does not fit -> reset pts/dts + stuffing
-        if(payload_size <= trailer_size && pts != AV_NOPTS_VALUE){
-            int timestamp_len=0;
-            if(dts != pts)
-                timestamp_len += 5;
-            if(pts != AV_NOPTS_VALUE)
-                timestamp_len += s->is_mpeg2 ? 5 : 4;
-            pts=dts= AV_NOPTS_VALUE;
-            header_len -= timestamp_len;
-            if (s->is_dvd && stream->align_iframe) {
-                pad_packet_bytes += timestamp_len;
-                packet_size  -= timestamp_len;
-            } else {
-                payload_size += timestamp_len;
-            }
-            stuffing_size += timestamp_len;
-            if(payload_size > trailer_size)
-                stuffing_size += payload_size - trailer_size;
-        }
-
-        if (pad_packet_bytes > 0 && pad_packet_bytes <= 7) { // can't use padding, so use stuffing
-            packet_size += pad_packet_bytes;
-            payload_size += pad_packet_bytes; // undo the previous adjustment
-            if (stuffing_size < 0) {
-                stuffing_size  = pad_packet_bytes;
-            } else {
-                stuffing_size += pad_packet_bytes;
-            }
-            pad_packet_bytes = 0;
-        }
-
-        if (stuffing_size < 0)
-            stuffing_size = 0;
-
-        if (startcode == PRIVATE_STREAM_1 && id >= 0xa0) {
-            if (payload_size < av_fifo_size(stream->fifo))
-                stuffing_size += payload_size % stream->lpcm_align;
-        }
-
-        if (stuffing_size > 16) {    /*<=16 for MPEG-1, <=32 for MPEG-2*/
-            pad_packet_bytes += stuffing_size;
-            packet_size      -= stuffing_size;
-            payload_size     -= stuffing_size;
-            stuffing_size = 0;
-        }
-
-        nb_frames= get_nb_frames(ctx, stream, payload_size - stuffing_size);
-
-        avio_wb32(ctx->pb, startcode);
-
-        avio_wb16(ctx->pb, packet_size);
-
-        if (!s->is_mpeg2)
-            for(i=0;i<stuffing_size;i++)
-                avio_w8(ctx->pb, 0xff);
-
-        if (s->is_mpeg2) {
-            avio_w8(ctx->pb, 0x80); /* mpeg2 id */
-
-            pes_flags=0;
-
-            if (pts != AV_NOPTS_VALUE) {
-                pes_flags |= 0x80;
-                if (dts != pts)
-                    pes_flags |= 0x40;
-            }
-
-            /* Both the MPEG-2 and the SVCD standards demand that the
-               P-STD_buffer_size field be included in the first packet of
-               every stream. (see SVCD standard p. 26 V.2.3.1 and V.2.3.2
-               and MPEG-2 standard 2.7.7) */
-            if (stream->packet_number == 0)
-                pes_flags |= 0x01;
-
-            avio_w8(ctx->pb, pes_flags); /* flags */
-            avio_w8(ctx->pb, header_len - 3 + stuffing_size);
-
-            if (pes_flags & 0x80)  /*write pts*/
-                put_timestamp(ctx->pb, (pes_flags & 0x40) ? 0x03 : 0x02, pts);
-            if (pes_flags & 0x40)  /*write dts*/
-                put_timestamp(ctx->pb, 0x01, dts);
-
-            if (pes_flags & 0x01) {  /*write pes extension*/
-                avio_w8(ctx->pb, 0x10); /* flags */
-
-                /* P-STD buffer info */
-                if ((id & 0xe0) == AUDIO_ID)
-                    avio_wb16(ctx->pb, 0x4000 | stream->max_buffer_size/ 128);
-                else
-                    avio_wb16(ctx->pb, 0x6000 | stream->max_buffer_size/1024);
-            }
-
-        } else {
-            if (pts != AV_NOPTS_VALUE) {
-                if (dts != pts) {
-                    put_timestamp(ctx->pb, 0x03, pts);
-                    put_timestamp(ctx->pb, 0x01, dts);
-                } else {
-                    put_timestamp(ctx->pb, 0x02, pts);
-                }
-            } else {
-                avio_w8(ctx->pb, 0x0f);
-            }
-        }
-
-        if (s->is_mpeg2) {
-            /* special stuffing byte that is always written
-               to prevent accidental generation of start codes. */
-            avio_w8(ctx->pb, 0xff);
-
-            for(i=0;i<stuffing_size;i++)
-                avio_w8(ctx->pb, 0xff);
-        }
-
-        if (startcode == PRIVATE_STREAM_1) {
-            avio_w8(ctx->pb, id);
-            if (id >= 0xa0) {
-                /* LPCM (XXX: check nb_frames) */
-                avio_w8(ctx->pb, 7);
-                avio_wb16(ctx->pb, 4); /* skip 3 header bytes */
-                avio_w8(ctx->pb, stream->lpcm_header[0]);
-                avio_w8(ctx->pb, stream->lpcm_header[1]);
-                avio_w8(ctx->pb, stream->lpcm_header[2]);
-            } else if (id >= 0x40) {
-                /* AC-3 */
-                avio_w8(ctx->pb, nb_frames);
-                avio_wb16(ctx->pb, trailer_size+1);
-            }
-        }
-
-        /* output data */
-        assert(payload_size - stuffing_size <= av_fifo_size(stream->fifo));
-        av_fifo_generic_read(stream->fifo, ctx->pb, payload_size - stuffing_size, &avio_write);
-        stream->bytes_to_iframe -= payload_size - stuffing_size;
-    }else{
-        payload_size=
-        stuffing_size= 0;
-    }
-
-    if (pad_packet_bytes > 0)
-        put_padding_packet(ctx,ctx->pb, pad_packet_bytes);
-
-    for(i=0;i<zero_trail_bytes;i++)
-        avio_w8(ctx->pb, 0x00);
-
-    avio_flush(ctx->pb);
-
-    s->packet_number++;
-
-    /* only increase the stream packet number if this pack actually contains
-       something that is specific to this stream! I.e. a dedicated header
-       or some data.*/
-    if (!general_pack)
-        stream->packet_number++;
-
-    return payload_size - stuffing_size;
-}
-
-static void put_vcd_padding_sector(AVFormatContext *ctx)
-{
-    /* There are two ways to do this padding: writing a sector/pack
-       of 0 values, or writing an MPEG padding pack. Both seem to
-       work with most decoders, BUT the VCD standard only allows a 0-sector
-       (see standard p. IV-4, IV-5).
-       So a 0-sector it is...*/
-
-    MpegMuxContext *s = ctx->priv_data;
-    int i;
-
-    for(i=0;i<s->packet_size;i++)
-        avio_w8(ctx->pb, 0);
-
-    s->vcd_padding_bytes_written += s->packet_size;
-
-    avio_flush(ctx->pb);
-
-    /* increasing the packet number is correct. The SCR of the following packs
-       is calculated from the packet_number and it has to include the padding
-       sector (it represents the sector index, not the MPEG pack index)
-       (see VCD standard p. IV-6)*/
-    s->packet_number++;
-}
-
-static int remove_decoded_packets(AVFormatContext *ctx, int64_t scr){
-//    MpegMuxContext *s = ctx->priv_data;
-    int i;
-
-    for(i=0; i<ctx->nb_streams; i++){
-        AVStream *st = ctx->streams[i];
-        StreamInfo *stream = st->priv_data;
-        PacketDesc *pkt_desc;
-
-        while((pkt_desc= stream->predecode_packet)
-              && scr > pkt_desc->dts){ //FIXME > vs >=
-            if(stream->buffer_index < pkt_desc->size ||
-               stream->predecode_packet == stream->premux_packet){
-                av_log(ctx, AV_LOG_ERROR,
-                       "buffer underflow i=%d bufi=%d size=%d\n",
-                       i, stream->buffer_index, pkt_desc->size);
-                break;
-            }
-            stream->buffer_index -= pkt_desc->size;
-
-            stream->predecode_packet= pkt_desc->next;
-            av_freep(&pkt_desc);
-        }
-    }
-
-    return 0;
-}
-
-static int output_packet(AVFormatContext *ctx, int flush){
-    MpegMuxContext *s = ctx->priv_data;
-    AVStream *st;
-    StreamInfo *stream;
-    int i, avail_space=0, es_size, trailer_size;
-    int best_i= -1;
-    int best_score= INT_MIN;
-    int ignore_constraints=0;
-    int64_t scr= s->last_scr;
-    PacketDesc *timestamp_packet;
-    const int64_t max_delay= av_rescale(ctx->max_delay, 90000, AV_TIME_BASE);
-
-retry:
-    for(i=0; i<ctx->nb_streams; i++){
-        AVStream *st = ctx->streams[i];
-        StreamInfo *stream = st->priv_data;
-        const int avail_data=  av_fifo_size(stream->fifo);
-        const int space= stream->max_buffer_size - stream->buffer_index;
-        int rel_space= 1024*space / stream->max_buffer_size;
-        PacketDesc *next_pkt= stream->premux_packet;
-
-        /* for subtitle, a single PES packet must be generated,
-           so we flush after every single subtitle packet */
-        if(s->packet_size > avail_data && !flush
-           && st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)
-            return 0;
-        if(avail_data==0)
-            continue;
-        assert(avail_data>0);
-
-        if(space < s->packet_size && !ignore_constraints)
-            continue;
-
-        if(next_pkt && next_pkt->dts - scr > max_delay)
-            continue;
-
-        if(rel_space > best_score){
-            best_score= rel_space;
-            best_i = i;
-            avail_space= space;
-        }
-    }
-
-    if(best_i < 0){
-        int64_t best_dts= INT64_MAX;
-
-        for(i=0; i<ctx->nb_streams; i++){
-            AVStream *st = ctx->streams[i];
-            StreamInfo *stream = st->priv_data;
-            PacketDesc *pkt_desc= stream->predecode_packet;
-            if(pkt_desc && pkt_desc->dts < best_dts)
-                best_dts= pkt_desc->dts;
-        }
-
-        av_dlog(ctx, "bumping scr, scr:%f, dts:%f\n",
-                scr / 90000.0, best_dts / 90000.0);
-        if(best_dts == INT64_MAX)
-            return 0;
-
-        if(scr >= best_dts+1 && !ignore_constraints){
-            av_log(ctx, AV_LOG_ERROR, "packet too large, ignoring buffer limits to mux it\n");
-            ignore_constraints= 1;
-        }
-        scr= FFMAX(best_dts+1, scr);
-        if(remove_decoded_packets(ctx, scr) < 0)
-            return -1;
-        goto retry;
-    }
-
-    assert(best_i >= 0);
-
-    st = ctx->streams[best_i];
-    stream = st->priv_data;
-
-    assert(av_fifo_size(stream->fifo) > 0);
-
-    assert(avail_space >= s->packet_size || ignore_constraints);
-
-    timestamp_packet= stream->premux_packet;
-    if(timestamp_packet->unwritten_size == timestamp_packet->size){
-        trailer_size= 0;
-    }else{
-        trailer_size= timestamp_packet->unwritten_size;
-        timestamp_packet= timestamp_packet->next;
-    }
-
-    if(timestamp_packet){
-        av_dlog(ctx, "dts:%f pts:%f scr:%f stream:%d\n",
-                timestamp_packet->dts / 90000.0,
-                timestamp_packet->pts / 90000.0,
-                scr / 90000.0, best_i);
-        es_size= flush_packet(ctx, best_i, timestamp_packet->pts, timestamp_packet->dts, scr, trailer_size);
-    }else{
-        assert(av_fifo_size(stream->fifo) == trailer_size);
-        es_size= flush_packet(ctx, best_i, AV_NOPTS_VALUE, AV_NOPTS_VALUE, scr, trailer_size);
-    }
-
-    if (s->is_vcd) {
-        /* Write one or more padding sectors, if necessary, to reach
-           the constant overall bitrate.*/
-        int vcd_pad_bytes;
-
-        while((vcd_pad_bytes = get_vcd_padding_size(ctx,stream->premux_packet->pts) ) >= s->packet_size){ //FIXME pts cannot be correct here
-            put_vcd_padding_sector(ctx);
-            s->last_scr += s->packet_size*90000LL / (s->mux_rate*50LL); //FIXME rounding and first few bytes of each packet
-        }
-    }
-
-    stream->buffer_index += es_size;
-    s->last_scr += s->packet_size*90000LL / (s->mux_rate*50LL); //FIXME rounding and first few bytes of each packet
-
-    while(stream->premux_packet && stream->premux_packet->unwritten_size <= es_size){
-        es_size -= stream->premux_packet->unwritten_size;
-        stream->premux_packet= stream->premux_packet->next;
-    }
-    if(es_size)
-        stream->premux_packet->unwritten_size -= es_size;
-
-    if(remove_decoded_packets(ctx, s->last_scr) < 0)
-        return -1;
-
-    return 1;
-}
-
-static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
-{
-    MpegMuxContext *s = ctx->priv_data;
-    int stream_index= pkt->stream_index;
-    int size= pkt->size;
-    uint8_t *buf= pkt->data;
-    AVStream *st = ctx->streams[stream_index];
-    StreamInfo *stream = st->priv_data;
-    int64_t pts, dts;
-    PacketDesc *pkt_desc;
-    int preload;
-    const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & AV_PKT_FLAG_KEY);
-
-    preload = av_rescale(s->preload, 90000, AV_TIME_BASE);
-
-    pts= pkt->pts;
-    dts= pkt->dts;
-
-    if(pts != AV_NOPTS_VALUE) pts += 2*preload;
-    if(dts != AV_NOPTS_VALUE){
-        if(!s->last_scr)
-            s->last_scr= dts + preload;
-        dts += 2*preload;
-    }
-
-    av_dlog(ctx, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n",
-            dts / 90000.0, pts / 90000.0, pkt->flags,
-            pkt->stream_index, pts != AV_NOPTS_VALUE);
-    if (!stream->premux_packet)
-        stream->next_packet = &stream->premux_packet;
-    *stream->next_packet=
-    pkt_desc= av_mallocz(sizeof(PacketDesc));
-    pkt_desc->pts= pts;
-    pkt_desc->dts= dts;
-    pkt_desc->unwritten_size=
-    pkt_desc->size= size;
-    if(!stream->predecode_packet)
-        stream->predecode_packet= pkt_desc;
-    stream->next_packet= &pkt_desc->next;
-
-    if (av_fifo_realloc2(stream->fifo, av_fifo_size(stream->fifo) + size) < 0)
-        return -1;
-
-    if (s->is_dvd){
-        if (is_iframe && (s->packet_number == 0 || (pts - stream->vobu_start_pts >= 36000))) { // min VOBU length 0.4 seconds (mpucoder)
-            stream->bytes_to_iframe = av_fifo_size(stream->fifo);
-            stream->align_iframe = 1;
-            stream->vobu_start_pts = pts;
-        }
-    }
-
-    av_fifo_generic_write(stream->fifo, buf, size, NULL);
-
-    for(;;){
-        int ret= output_packet(ctx, 0);
-        if(ret<=0)
-            return ret;
-    }
-}
-
-static int mpeg_mux_end(AVFormatContext *ctx)
-{
-//    MpegMuxContext *s = ctx->priv_data;
-    StreamInfo *stream;
-    int i;
-
-    for(;;){
-        int ret= output_packet(ctx, 1);
-        if(ret<0)
-            return ret;
-        else if(ret==0)
-            break;
-    }
-
-    /* End header according to MPEG1 systems standard. We do not write
-       it as it is usually not needed by decoders and because it
-       complicates MPEG stream concatenation. */
-    //avio_wb32(ctx->pb, ISO_11172_END_CODE);
-    //avio_flush(ctx->pb);
-
-    for(i=0;i<ctx->nb_streams;i++) {
-        stream = ctx->streams[i]->priv_data;
-
-        assert(av_fifo_size(stream->fifo) == 0);
-        av_fifo_free(stream->fifo);
-    }
-    return 0;
-}
-
-#define OFFSET(x) offsetof(MpegMuxContext, x)
-#define E AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "muxrate", NULL, OFFSET(mux_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
-    { "preload", "Initial demux-decode delay in microseconds.", OFFSET(preload),  AV_OPT_TYPE_INT, {.i64 = 500000}, 0, INT_MAX, E},
-    { NULL },
-};
-
-#define MPEGENC_CLASS(flavor)\
-static const AVClass flavor ## _class = {\
-    .class_name = #flavor " muxer",\
-    .item_name  = av_default_item_name,\
-    .version    = LIBAVUTIL_VERSION_INT,\
-    .option     = options,\
-};
-
-#if CONFIG_MPEG1SYSTEM_MUXER
-MPEGENC_CLASS(mpeg)
-AVOutputFormat ff_mpeg1system_muxer = {
-    .name              = "mpeg",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream"),
-    .mime_type         = "video/mpeg",
-    .extensions        = "mpg,mpeg",
-    .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
-    .write_header      = mpeg_mux_init,
-    .write_packet      = mpeg_mux_write_packet,
-    .write_trailer     = mpeg_mux_end,
-    .priv_class        = &mpeg_class,
-};
-#endif
-#if CONFIG_MPEG1VCD_MUXER
-MPEGENC_CLASS(vcd)
-AVOutputFormat ff_mpeg1vcd_muxer = {
-    .name              = "vcd",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream (VCD)"),
-    .mime_type         = "video/mpeg",
-    .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
-    .write_header      = mpeg_mux_init,
-    .write_packet      = mpeg_mux_write_packet,
-    .write_trailer     = mpeg_mux_end,
-    .priv_class        = &vcd_class,
-};
-#endif
-#if CONFIG_MPEG2VOB_MUXER
-MPEGENC_CLASS(vob)
-AVOutputFormat ff_mpeg2vob_muxer = {
-    .name              = "vob",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-2 PS (VOB)"),
-    .mime_type         = "video/mpeg",
-    .extensions        = "vob",
-    .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_header      = mpeg_mux_init,
-    .write_packet      = mpeg_mux_write_packet,
-    .write_trailer     = mpeg_mux_end,
-    .priv_class        = &vob_class,
-};
-#endif
-
-/* Same as mpeg2vob_mux except that the pack size is 2324 */
-#if CONFIG_MPEG2SVCD_MUXER
-MPEGENC_CLASS(svcd)
-AVOutputFormat ff_mpeg2svcd_muxer = {
-    .name              = "svcd",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-2 PS (SVCD)"),
-    .mime_type         = "video/mpeg",
-    .extensions        = "vob",
-    .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_header      = mpeg_mux_init,
-    .write_packet      = mpeg_mux_write_packet,
-    .write_trailer     = mpeg_mux_end,
-    .priv_class        = &svcd_class,
-};
-#endif
-
-/*  Same as mpeg2vob_mux except the 'is_dvd' flag is set to produce NAV pkts */
-#if CONFIG_MPEG2DVD_MUXER
-MPEGENC_CLASS(dvd)
-AVOutputFormat ff_mpeg2dvd_muxer = {
-    .name              = "dvd",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-2 PS (DVD VOB)"),
-    .mime_type         = "video/mpeg",
-    .extensions        = "dvd",
-    .priv_data_size    = sizeof(MpegMuxContext),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_header      = mpeg_mux_init,
-    .write_packet      = mpeg_mux_write_packet,
-    .write_trailer     = mpeg_mux_end,
-    .priv_class        = &dvd_class,
-};
-#endif
diff --git a/deps/libav/libavformat/mpegts.c b/deps/libav/libavformat/mpegts.c
deleted file mode 100644
index 3f828b4..0000000
--- a/deps/libav/libavformat/mpegts.c
+++ /dev/null
@@ -1,2219 +0,0 @@
-/*
- * MPEG2 transport stream (aka DVB) demuxer
- * Copyright (c) 2002-2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/buffer.h"
-#include "libavutil/crc.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/log.h"
-#include "libavutil/dict.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavcodec/bytestream.h"
-#include "libavcodec/get_bits.h"
-#include "libavcodec/mathops.h"
-#include "avformat.h"
-#include "mpegts.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "seek.h"
-#include "mpeg.h"
-#include "isom.h"
-
-/* maximum size in which we look for synchronisation if
-   synchronisation is lost */
-#define MAX_RESYNC_SIZE 65536
-
-#define MAX_PES_PAYLOAD 200*1024
-
-#define MAX_MP4_DESCR_COUNT 16
-
-enum MpegTSFilterType {
-    MPEGTS_PES,
-    MPEGTS_SECTION,
-};
-
-typedef struct MpegTSFilter MpegTSFilter;
-
-typedef int PESCallback(MpegTSFilter *f, const uint8_t *buf, int len, int is_start, int64_t pos);
-
-typedef struct MpegTSPESFilter {
-    PESCallback *pes_cb;
-    void *opaque;
-} MpegTSPESFilter;
-
-typedef void SectionCallback(MpegTSFilter *f, const uint8_t *buf, int len);
-
-typedef void SetServiceCallback(void *opaque, int ret);
-
-typedef struct MpegTSSectionFilter {
-    int section_index;
-    int section_h_size;
-    uint8_t *section_buf;
-    unsigned int check_crc:1;
-    unsigned int end_of_section_reached:1;
-    SectionCallback *section_cb;
-    void *opaque;
-} MpegTSSectionFilter;
-
-struct MpegTSFilter {
-    int pid;
-    int es_id;
-    int last_cc; /* last cc code (-1 if first packet) */
-    enum MpegTSFilterType type;
-    union {
-        MpegTSPESFilter pes_filter;
-        MpegTSSectionFilter section_filter;
-    } u;
-};
-
-#define MAX_PIDS_PER_PROGRAM 64
-struct Program {
-    unsigned int id; //program id/service id
-    unsigned int nb_pids;
-    unsigned int pids[MAX_PIDS_PER_PROGRAM];
-};
-
-struct MpegTSContext {
-    const AVClass *class;
-    /* user data */
-    AVFormatContext *stream;
-    /** raw packet size, including FEC if present            */
-    int raw_packet_size;
-
-    int pos47;
-    /** position corresponding to pos47, or 0 if pos47 invalid */
-    int64_t pos;
-
-    /** if true, all pids are analyzed to find streams       */
-    int auto_guess;
-
-    /** compute exact PCR for each transport stream packet   */
-    int mpeg2ts_compute_pcr;
-
-    int64_t cur_pcr;    /**< used to estimate the exact PCR  */
-    int pcr_incr;       /**< used to estimate the exact PCR  */
-
-    /* data needed to handle file based ts */
-    /** stop parsing loop                                    */
-    int stop_parse;
-    /** packet containing Audio/Video data                   */
-    AVPacket *pkt;
-    /** to detect seek                                       */
-    int64_t last_pos;
-
-    /******************************************/
-    /* private mpegts data */
-    /* scan context */
-    /** structure to keep track of Program->pids mapping     */
-    unsigned int nb_prg;
-    struct Program *prg;
-
-
-    /** filters for various streams specified by PMT + for the PAT and PMT */
-    MpegTSFilter *pids[NB_PID_MAX];
-};
-
-static const AVOption options[] = {
-    {"compute_pcr", "Compute exact PCR for each transport stream packet.", offsetof(MpegTSContext, mpeg2ts_compute_pcr), AV_OPT_TYPE_INT,
-     {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-static const AVClass mpegtsraw_class = {
-    .class_name = "mpegtsraw demuxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-/* TS stream handling */
-
-enum MpegTSState {
-    MPEGTS_HEADER = 0,
-    MPEGTS_PESHEADER,
-    MPEGTS_PESHEADER_FILL,
-    MPEGTS_PAYLOAD,
-    MPEGTS_SKIP,
-};
-
-/* enough for PES header + length */
-#define PES_START_SIZE  6
-#define PES_HEADER_SIZE 9
-#define MAX_PES_HEADER_SIZE (9 + 255)
-
-typedef struct PESContext {
-    int pid;
-    int pcr_pid; /**< if -1 then all packets containing PCR are considered */
-    int stream_type;
-    MpegTSContext *ts;
-    AVFormatContext *stream;
-    AVStream *st;
-    AVStream *sub_st; /**< stream for the embedded AC3 stream in HDMV TrueHD */
-    enum MpegTSState state;
-    /* used to get the format */
-    int data_index;
-    int flags; /**< copied to the AVPacket flags */
-    int total_size;
-    int pes_header_size;
-    int extended_stream_id;
-    int64_t pts, dts;
-    int64_t ts_packet_pos; /**< position of first TS packet of this PES packet */
-    uint8_t header[MAX_PES_HEADER_SIZE];
-    AVBufferRef *buffer;
-    SLConfigDescr sl;
-} PESContext;
-
-extern AVInputFormat ff_mpegts_demuxer;
-
-static void clear_program(MpegTSContext *ts, unsigned int programid)
-{
-    int i;
-
-    for(i=0; i<ts->nb_prg; i++)
-        if(ts->prg[i].id == programid)
-            ts->prg[i].nb_pids = 0;
-}
-
-static void clear_programs(MpegTSContext *ts)
-{
-    av_freep(&ts->prg);
-    ts->nb_prg=0;
-}
-
-static void add_pat_entry(MpegTSContext *ts, unsigned int programid)
-{
-    struct Program *p;
-    if (av_reallocp_array(&ts->prg, ts->nb_prg + 1, sizeof(*ts->prg)) < 0) {
-        ts->nb_prg = 0;
-        return;
-    }
-    p = &ts->prg[ts->nb_prg];
-    p->id = programid;
-    p->nb_pids = 0;
-    ts->nb_prg++;
-}
-
-static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid, unsigned int pid)
-{
-    int i;
-    struct Program *p = NULL;
-    for(i=0; i<ts->nb_prg; i++) {
-        if(ts->prg[i].id == programid) {
-            p = &ts->prg[i];
-            break;
-        }
-    }
-    if(!p)
-        return;
-
-    if(p->nb_pids >= MAX_PIDS_PER_PROGRAM)
-        return;
-    p->pids[p->nb_pids++] = pid;
-}
-
-/**
- * @brief discard_pid() decides if the pid is to be discarded according
- *                      to caller's programs selection
- * @param ts    : - TS context
- * @param pid   : - pid
- * @return 1 if the pid is only comprised in programs that have .discard=AVDISCARD_ALL
- *         0 otherwise
- */
-static int discard_pid(MpegTSContext *ts, unsigned int pid)
-{
-    int i, j, k;
-    int used = 0, discarded = 0;
-    struct Program *p;
-
-    /* If none of the programs have .discard=AVDISCARD_ALL then there's
-     * no way we have to discard this packet
-     */
-    for (k = 0; k < ts->stream->nb_programs; k++) {
-        if (ts->stream->programs[k]->discard == AVDISCARD_ALL)
-            break;
-    }
-    if (k == ts->stream->nb_programs)
-        return 0;
-
-    for(i=0; i<ts->nb_prg; i++) {
-        p = &ts->prg[i];
-        for(j=0; j<p->nb_pids; j++) {
-            if(p->pids[j] != pid)
-                continue;
-            //is program with id p->id set to be discarded?
-            for(k=0; k<ts->stream->nb_programs; k++) {
-                if(ts->stream->programs[k]->id == p->id) {
-                    if(ts->stream->programs[k]->discard == AVDISCARD_ALL)
-                        discarded++;
-                    else
-                        used++;
-                }
-            }
-        }
-    }
-
-    return !used && discarded;
-}
-
-/**
- *  Assemble PES packets out of TS packets, and then call the "section_cb"
- *  function when they are complete.
- */
-static void write_section_data(AVFormatContext *s, MpegTSFilter *tss1,
-                               const uint8_t *buf, int buf_size, int is_start)
-{
-    MpegTSSectionFilter *tss = &tss1->u.section_filter;
-    int len;
-
-    if (is_start) {
-        memcpy(tss->section_buf, buf, buf_size);
-        tss->section_index = buf_size;
-        tss->section_h_size = -1;
-        tss->end_of_section_reached = 0;
-    } else {
-        if (tss->end_of_section_reached)
-            return;
-        len = 4096 - tss->section_index;
-        if (buf_size < len)
-            len = buf_size;
-        memcpy(tss->section_buf + tss->section_index, buf, len);
-        tss->section_index += len;
-    }
-
-    /* compute section length if possible */
-    if (tss->section_h_size == -1 && tss->section_index >= 3) {
-        len = (AV_RB16(tss->section_buf + 1) & 0xfff) + 3;
-        if (len > 4096)
-            return;
-        tss->section_h_size = len;
-    }
-
-    if (tss->section_h_size != -1 && tss->section_index >= tss->section_h_size) {
-        tss->end_of_section_reached = 1;
-        if (!tss->check_crc ||
-            av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1,
-                   tss->section_buf, tss->section_h_size) == 0)
-            tss->section_cb(tss1, tss->section_buf, tss->section_h_size);
-    }
-}
-
-static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid,
-                                         SectionCallback *section_cb, void *opaque,
-                                         int check_crc)
-
-{
-    MpegTSFilter *filter;
-    MpegTSSectionFilter *sec;
-
-    av_dlog(ts->stream, "Filter: pid=0x%x\n", pid);
-
-    if (pid >= NB_PID_MAX || ts->pids[pid])
-        return NULL;
-    filter = av_mallocz(sizeof(MpegTSFilter));
-    if (!filter)
-        return NULL;
-    ts->pids[pid] = filter;
-    filter->type = MPEGTS_SECTION;
-    filter->pid = pid;
-    filter->es_id = -1;
-    filter->last_cc = -1;
-    sec = &filter->u.section_filter;
-    sec->section_cb = section_cb;
-    sec->opaque = opaque;
-    sec->section_buf = av_malloc(MAX_SECTION_SIZE);
-    sec->check_crc = check_crc;
-    if (!sec->section_buf) {
-        av_free(filter);
-        return NULL;
-    }
-    return filter;
-}
-
-static MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid,
-                                     PESCallback *pes_cb,
-                                     void *opaque)
-{
-    MpegTSFilter *filter;
-    MpegTSPESFilter *pes;
-
-    if (pid >= NB_PID_MAX || ts->pids[pid])
-        return NULL;
-    filter = av_mallocz(sizeof(MpegTSFilter));
-    if (!filter)
-        return NULL;
-    ts->pids[pid] = filter;
-    filter->type = MPEGTS_PES;
-    filter->pid = pid;
-    filter->es_id = -1;
-    filter->last_cc = -1;
-    pes = &filter->u.pes_filter;
-    pes->pes_cb = pes_cb;
-    pes->opaque = opaque;
-    return filter;
-}
-
-static void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter)
-{
-    int pid;
-
-    pid = filter->pid;
-    if (filter->type == MPEGTS_SECTION)
-        av_freep(&filter->u.section_filter.section_buf);
-    else if (filter->type == MPEGTS_PES) {
-        PESContext *pes = filter->u.pes_filter.opaque;
-        av_buffer_unref(&pes->buffer);
-        /* referenced private data will be freed later in
-         * avformat_close_input */
-        if (!((PESContext *)filter->u.pes_filter.opaque)->st) {
-            av_freep(&filter->u.pes_filter.opaque);
-        }
-    }
-
-    av_free(filter);
-    ts->pids[pid] = NULL;
-}
-
-static int analyze(const uint8_t *buf, int size, int packet_size, int *index){
-    int stat[TS_MAX_PACKET_SIZE];
-    int i;
-    int x=0;
-    int best_score=0;
-
-    memset(stat, 0, packet_size*sizeof(int));
-
-    for(x=i=0; i<size-3; i++){
-        if(buf[i] == 0x47 && !(buf[i+1] & 0x80) && (buf[i+3] & 0x30)){
-            stat[x]++;
-            if(stat[x] > best_score){
-                best_score= stat[x];
-                if(index) *index= x;
-            }
-        }
-
-        x++;
-        if(x == packet_size) x= 0;
-    }
-
-    return best_score;
-}
-
-/* autodetect fec presence. Must have at least 1024 bytes  */
-static int get_packet_size(const uint8_t *buf, int size)
-{
-    int score, fec_score, dvhs_score;
-
-    if (size < (TS_FEC_PACKET_SIZE * 5 + 1))
-        return -1;
-
-    score    = analyze(buf, size, TS_PACKET_SIZE, NULL);
-    dvhs_score    = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL);
-    fec_score= analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);
-    av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",
-            score, dvhs_score, fec_score);
-
-    if     (score > fec_score && score > dvhs_score) return TS_PACKET_SIZE;
-    else if(dvhs_score > score && dvhs_score > fec_score) return TS_DVHS_PACKET_SIZE;
-    else if(score < fec_score && dvhs_score < fec_score) return TS_FEC_PACKET_SIZE;
-    else                       return -1;
-}
-
-typedef struct SectionHeader {
-    uint8_t tid;
-    uint16_t id;
-    uint8_t version;
-    uint8_t sec_num;
-    uint8_t last_sec_num;
-} SectionHeader;
-
-static inline int get8(const uint8_t **pp, const uint8_t *p_end)
-{
-    const uint8_t *p;
-    int c;
-
-    p = *pp;
-    if (p >= p_end)
-        return -1;
-    c = *p++;
-    *pp = p;
-    return c;
-}
-
-static inline int get16(const uint8_t **pp, const uint8_t *p_end)
-{
-    const uint8_t *p;
-    int c;
-
-    p = *pp;
-    if ((p + 1) >= p_end)
-        return -1;
-    c = AV_RB16(p);
-    p += 2;
-    *pp = p;
-    return c;
-}
-
-/* read and allocate a DVB string preceded by its length */
-static char *getstr8(const uint8_t **pp, const uint8_t *p_end)
-{
-    int len;
-    const uint8_t *p;
-    char *str;
-
-    p = *pp;
-    len = get8(&p, p_end);
-    if (len < 0)
-        return NULL;
-    if ((p + len) > p_end)
-        return NULL;
-    str = av_malloc(len + 1);
-    if (!str)
-        return NULL;
-    memcpy(str, p, len);
-    str[len] = '\0';
-    p += len;
-    *pp = p;
-    return str;
-}
-
-static int parse_section_header(SectionHeader *h,
-                                const uint8_t **pp, const uint8_t *p_end)
-{
-    int val;
-
-    val = get8(pp, p_end);
-    if (val < 0)
-        return -1;
-    h->tid = val;
-    *pp += 2;
-    val = get16(pp, p_end);
-    if (val < 0)
-        return -1;
-    h->id = val;
-    val = get8(pp, p_end);
-    if (val < 0)
-        return -1;
-    h->version = (val >> 1) & 0x1f;
-    val = get8(pp, p_end);
-    if (val < 0)
-        return -1;
-    h->sec_num = val;
-    val = get8(pp, p_end);
-    if (val < 0)
-        return -1;
-    h->last_sec_num = val;
-    return 0;
-}
-
-typedef struct {
-    uint32_t stream_type;
-    enum AVMediaType codec_type;
-    enum AVCodecID codec_id;
-} StreamType;
-
-static const StreamType ISO_types[] = {
-    { 0x01, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_MPEG2VIDEO },
-    { 0x02, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_MPEG2VIDEO },
-    { 0x03, AVMEDIA_TYPE_AUDIO,        AV_CODEC_ID_MP3 },
-    { 0x04, AVMEDIA_TYPE_AUDIO,        AV_CODEC_ID_MP3 },
-    { 0x0f, AVMEDIA_TYPE_AUDIO,        AV_CODEC_ID_AAC },
-    { 0x10, AVMEDIA_TYPE_VIDEO,      AV_CODEC_ID_MPEG4 },
-    { 0x11, AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_AAC_LATM }, /* LATM syntax */
-    { 0x1b, AVMEDIA_TYPE_VIDEO,       AV_CODEC_ID_H264 },
-    { 0x24, AVMEDIA_TYPE_VIDEO,       AV_CODEC_ID_HEVC },
-    { 0x42, AVMEDIA_TYPE_VIDEO,       AV_CODEC_ID_CAVS },
-    { 0xd1, AVMEDIA_TYPE_VIDEO,      AV_CODEC_ID_DIRAC },
-    { 0xea, AVMEDIA_TYPE_VIDEO,        AV_CODEC_ID_VC1 },
-    { 0 },
-};
-
-static const StreamType HDMV_types[] = {
-    { 0x80, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_PCM_BLURAY },
-    { 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
-    { 0x82, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
-    { 0x83, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_TRUEHD },
-    { 0x84, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_EAC3 },
-    { 0x85, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS }, /* DTS HD */
-    { 0x86, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS }, /* DTS HD MASTER*/
-    { 0x90, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_HDMV_PGS_SUBTITLE },
-    { 0 },
-};
-
-/* ATSC ? */
-static const StreamType MISC_types[] = {
-    { 0x81, AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_AC3 },
-    { 0x8a, AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_DTS },
-    { 0 },
-};
-
-static const StreamType REGD_types[] = {
-    { MKTAG('d','r','a','c'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_DIRAC },
-    { MKTAG('A','C','-','3'), AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_AC3 },
-    { MKTAG('B','S','S','D'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_S302M },
-    { MKTAG('D','T','S','1'), AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_DTS },
-    { MKTAG('D','T','S','2'), AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_DTS },
-    { MKTAG('D','T','S','3'), AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_DTS },
-    { MKTAG('H','E','V','C'), AVMEDIA_TYPE_VIDEO,  AV_CODEC_ID_HEVC },
-    { MKTAG('V','C','-','1'), AVMEDIA_TYPE_VIDEO,   AV_CODEC_ID_VC1 },
-    { 0 },
-};
-
-/* descriptor present */
-static const StreamType DESC_types[] = {
-    { 0x6a, AVMEDIA_TYPE_AUDIO,             AV_CODEC_ID_AC3 }, /* AC-3 descriptor */
-    { 0x7a, AVMEDIA_TYPE_AUDIO,            AV_CODEC_ID_EAC3 }, /* E-AC-3 descriptor */
-    { 0x7b, AVMEDIA_TYPE_AUDIO,             AV_CODEC_ID_DTS },
-    { 0x56, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_DVB_TELETEXT },
-    { 0x59, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */
-    { 0 },
-};
-
-static void mpegts_find_stream_type(AVStream *st,
-                                    uint32_t stream_type, const StreamType *types)
-{
-    for (; types->stream_type; types++) {
-        if (stream_type == types->stream_type) {
-            st->codec->codec_type = types->codec_type;
-            st->codec->codec_id   = types->codec_id;
-            return;
-        }
-    }
-}
-
-static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
-                                  uint32_t stream_type, uint32_t prog_reg_desc)
-{
-    avpriv_set_pts_info(st, 33, 1, 90000);
-    st->priv_data = pes;
-    st->codec->codec_type = AVMEDIA_TYPE_DATA;
-    st->codec->codec_id   = AV_CODEC_ID_NONE;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-    pes->st = st;
-    pes->stream_type = stream_type;
-
-    av_log(pes->stream, AV_LOG_DEBUG,
-           "stream=%d stream_type=%x pid=%x prog_reg_desc=%.4s\n",
-           st->index, pes->stream_type, pes->pid, (char*)&prog_reg_desc);
-
-    st->codec->codec_tag = pes->stream_type;
-
-    mpegts_find_stream_type(st, pes->stream_type, ISO_types);
-    if (prog_reg_desc == AV_RL32("HDMV") &&
-        st->codec->codec_id == AV_CODEC_ID_NONE) {
-        mpegts_find_stream_type(st, pes->stream_type, HDMV_types);
-        if (pes->stream_type == 0x83) {
-            // HDMV TrueHD streams also contain an AC3 coded version of the
-            // audio track - add a second stream for this
-            AVStream *sub_st;
-            // priv_data cannot be shared between streams
-            PESContext *sub_pes = av_malloc(sizeof(*sub_pes));
-            if (!sub_pes)
-                return AVERROR(ENOMEM);
-            memcpy(sub_pes, pes, sizeof(*sub_pes));
-
-            sub_st = avformat_new_stream(pes->stream, NULL);
-            if (!sub_st) {
-                av_free(sub_pes);
-                return AVERROR(ENOMEM);
-            }
-
-            sub_st->id = pes->pid;
-            avpriv_set_pts_info(sub_st, 33, 1, 90000);
-            sub_st->priv_data = sub_pes;
-            sub_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            sub_st->codec->codec_id   = AV_CODEC_ID_AC3;
-            sub_st->need_parsing = AVSTREAM_PARSE_FULL;
-            sub_pes->sub_st = pes->sub_st = sub_st;
-        }
-    }
-    if (st->codec->codec_id == AV_CODEC_ID_NONE)
-        mpegts_find_stream_type(st, pes->stream_type, MISC_types);
-
-    return 0;
-}
-
-static void new_pes_packet(PESContext *pes, AVPacket *pkt)
-{
-    av_init_packet(pkt);
-
-    pkt->buf  = pes->buffer;
-    pkt->data = pes->buffer->data;
-    pkt->size = pes->data_index;
-
-    if(pes->total_size != MAX_PES_PAYLOAD &&
-       pes->pes_header_size + pes->data_index != pes->total_size + PES_START_SIZE) {
-        av_log(pes->stream, AV_LOG_WARNING, "PES packet size mismatch\n");
-        pes->flags |= AV_PKT_FLAG_CORRUPT;
-    }
-    memset(pkt->data+pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-    // Separate out the AC3 substream from an HDMV combined TrueHD/AC3 PID
-    if (pes->sub_st && pes->stream_type == 0x83 && pes->extended_stream_id == 0x76)
-        pkt->stream_index = pes->sub_st->index;
-    else
-        pkt->stream_index = pes->st->index;
-    pkt->pts = pes->pts;
-    pkt->dts = pes->dts;
-    /* store position of first TS packet of this PES packet */
-    pkt->pos = pes->ts_packet_pos;
-    pkt->flags = pes->flags;
-
-    /* reset pts values */
-    pes->pts = AV_NOPTS_VALUE;
-    pes->dts = AV_NOPTS_VALUE;
-    pes->buffer = NULL;
-    pes->data_index = 0;
-    pes->flags = 0;
-}
-
-static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf, int buf_size)
-{
-    GetBitContext gb;
-    int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
-    int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
-    int dts_flag = -1, cts_flag = -1;
-    int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
-    init_get_bits(&gb, buf, buf_size*8);
-
-    if (sl->use_au_start)
-        au_start_flag = get_bits1(&gb);
-    if (sl->use_au_end)
-        au_end_flag = get_bits1(&gb);
-    if (!sl->use_au_start && !sl->use_au_end)
-        au_start_flag = au_end_flag = 1;
-    if (sl->ocr_len > 0)
-        ocr_flag = get_bits1(&gb);
-    if (sl->use_idle)
-        idle_flag = get_bits1(&gb);
-    if (sl->use_padding)
-        padding_flag = get_bits1(&gb);
-    if (padding_flag)
-        padding_bits = get_bits(&gb, 3);
-
-    if (!idle_flag && (!padding_flag || padding_bits != 0)) {
-        if (sl->packet_seq_num_len)
-            skip_bits_long(&gb, sl->packet_seq_num_len);
-        if (sl->degr_prior_len)
-            if (get_bits1(&gb))
-                skip_bits(&gb, sl->degr_prior_len);
-        if (ocr_flag)
-            skip_bits_long(&gb, sl->ocr_len);
-        if (au_start_flag) {
-            if (sl->use_rand_acc_pt)
-                get_bits1(&gb);
-            if (sl->au_seq_num_len > 0)
-                skip_bits_long(&gb, sl->au_seq_num_len);
-            if (sl->use_timestamps) {
-                dts_flag = get_bits1(&gb);
-                cts_flag = get_bits1(&gb);
-            }
-        }
-        if (sl->inst_bitrate_len)
-            inst_bitrate_flag = get_bits1(&gb);
-        if (dts_flag == 1)
-            dts = get_bits64(&gb, sl->timestamp_len);
-        if (cts_flag == 1)
-            cts = get_bits64(&gb, sl->timestamp_len);
-        if (sl->au_len > 0)
-            skip_bits_long(&gb, sl->au_len);
-        if (inst_bitrate_flag)
-            skip_bits_long(&gb, sl->inst_bitrate_len);
-    }
-
-    if (dts != AV_NOPTS_VALUE)
-        pes->dts = dts;
-    if (cts != AV_NOPTS_VALUE)
-        pes->pts = cts;
-
-    if (sl->timestamp_len && sl->timestamp_res)
-        avpriv_set_pts_info(pes->st, sl->timestamp_len, 1, sl->timestamp_res);
-
-    return (get_bits_count(&gb) + 7) >> 3;
-}
-
-/* return non zero if a packet could be constructed */
-static int mpegts_push_data(MpegTSFilter *filter,
-                            const uint8_t *buf, int buf_size, int is_start,
-                            int64_t pos)
-{
-    PESContext *pes = filter->u.pes_filter.opaque;
-    MpegTSContext *ts = pes->ts;
-    const uint8_t *p;
-    int len, code;
-
-    if(!ts->pkt)
-        return 0;
-
-    if (is_start) {
-        if (pes->state == MPEGTS_PAYLOAD && pes->data_index > 0) {
-            new_pes_packet(pes, ts->pkt);
-            ts->stop_parse = 1;
-        }
-        pes->state = MPEGTS_HEADER;
-        pes->data_index = 0;
-        pes->ts_packet_pos = pos;
-    }
-    p = buf;
-    while (buf_size > 0) {
-        switch(pes->state) {
-        case MPEGTS_HEADER:
-            len = PES_START_SIZE - pes->data_index;
-            if (len > buf_size)
-                len = buf_size;
-            memcpy(pes->header + pes->data_index, p, len);
-            pes->data_index += len;
-            p += len;
-            buf_size -= len;
-            if (pes->data_index == PES_START_SIZE) {
-                /* we got all the PES or section header. We can now
-                   decide */
-                if (pes->header[0] == 0x00 && pes->header[1] == 0x00 &&
-                    pes->header[2] == 0x01) {
-                    /* it must be an mpeg2 PES stream */
-                    code = pes->header[3] | 0x100;
-                    av_dlog(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
-
-                    if ((pes->st && pes->st->discard == AVDISCARD_ALL &&
-                         (!pes->sub_st || pes->sub_st->discard == AVDISCARD_ALL)) ||
-                        code == 0x1be) /* padding_stream */
-                        goto skip;
-
-                    /* stream not present in PMT */
-                    if (!pes->st) {
-                        pes->st = avformat_new_stream(ts->stream, NULL);
-                        if (!pes->st)
-                            return AVERROR(ENOMEM);
-                        pes->st->id = pes->pid;
-                        mpegts_set_stream_info(pes->st, pes, 0, 0);
-                    }
-
-                    pes->total_size = AV_RB16(pes->header + 4);
-                    /* NOTE: a zero total size means the PES size is
-                       unbounded */
-                    if (!pes->total_size)
-                        pes->total_size = MAX_PES_PAYLOAD;
-
-                    /* allocate pes buffer */
-                    pes->buffer = av_buffer_alloc(pes->total_size +
-                                                  FF_INPUT_BUFFER_PADDING_SIZE);
-                    if (!pes->buffer)
-                        return AVERROR(ENOMEM);
-
-                    if (code != 0x1bc && code != 0x1bf && /* program_stream_map, private_stream_2 */
-                        code != 0x1f0 && code != 0x1f1 && /* ECM, EMM */
-                        code != 0x1ff && code != 0x1f2 && /* program_stream_directory, DSMCC_stream */
-                        code != 0x1f8) {                  /* ITU-T Rec. H.222.1 type E stream */
-                        pes->state = MPEGTS_PESHEADER;
-                        if (pes->st->codec->codec_id == AV_CODEC_ID_NONE) {
-                            av_dlog(pes->stream, "pid=%x stream_type=%x probing\n",
-                                    pes->pid, pes->stream_type);
-                            pes->st->codec->codec_id = AV_CODEC_ID_PROBE;
-                        }
-                    } else {
-                        pes->state = MPEGTS_PAYLOAD;
-                        pes->data_index = 0;
-                    }
-                } else {
-                    /* otherwise, it should be a table */
-                    /* skip packet */
-                skip:
-                    pes->state = MPEGTS_SKIP;
-                    continue;
-                }
-            }
-            break;
-            /**********************************************/
-            /* PES packing parsing */
-        case MPEGTS_PESHEADER:
-            len = PES_HEADER_SIZE - pes->data_index;
-            if (len < 0)
-                return -1;
-            if (len > buf_size)
-                len = buf_size;
-            memcpy(pes->header + pes->data_index, p, len);
-            pes->data_index += len;
-            p += len;
-            buf_size -= len;
-            if (pes->data_index == PES_HEADER_SIZE) {
-                pes->pes_header_size = pes->header[8] + 9;
-                pes->state = MPEGTS_PESHEADER_FILL;
-            }
-            break;
-        case MPEGTS_PESHEADER_FILL:
-            len = pes->pes_header_size - pes->data_index;
-            if (len < 0)
-                return -1;
-            if (len > buf_size)
-                len = buf_size;
-            memcpy(pes->header + pes->data_index, p, len);
-            pes->data_index += len;
-            p += len;
-            buf_size -= len;
-            if (pes->data_index == pes->pes_header_size) {
-                const uint8_t *r;
-                unsigned int flags, pes_ext, skip;
-
-                flags = pes->header[7];
-                r = pes->header + 9;
-                pes->pts = AV_NOPTS_VALUE;
-                pes->dts = AV_NOPTS_VALUE;
-                if ((flags & 0xc0) == 0x80) {
-                    pes->dts = pes->pts = ff_parse_pes_pts(r);
-                    r += 5;
-                } else if ((flags & 0xc0) == 0xc0) {
-                    pes->pts = ff_parse_pes_pts(r);
-                    r += 5;
-                    pes->dts = ff_parse_pes_pts(r);
-                    r += 5;
-                }
-                pes->extended_stream_id = -1;
-                if (flags & 0x01) { /* PES extension */
-                    pes_ext = *r++;
-                    /* Skip PES private data, program packet sequence counter and P-STD buffer */
-                    skip = (pes_ext >> 4) & 0xb;
-                    skip += skip & 0x9;
-                    r += skip;
-                    if ((pes_ext & 0x41) == 0x01 &&
-                        (r + 2) <= (pes->header + pes->pes_header_size)) {
-                        /* PES extension 2 */
-                        if ((r[0] & 0x7f) > 0 && (r[1] & 0x80) == 0)
-                            pes->extended_stream_id = r[1];
-                    }
-                }
-
-                /* we got the full header. We parse it and get the payload */
-                pes->state = MPEGTS_PAYLOAD;
-                pes->data_index = 0;
-                if (pes->stream_type == 0x12 && buf_size > 0) {
-                    int sl_header_bytes = read_sl_header(pes, &pes->sl, p, buf_size);
-                    pes->pes_header_size += sl_header_bytes;
-                    p += sl_header_bytes;
-                    buf_size -= sl_header_bytes;
-                }
-            }
-            break;
-        case MPEGTS_PAYLOAD:
-            if (buf_size > 0 && pes->buffer) {
-                if (pes->data_index > 0 && pes->data_index+buf_size > pes->total_size) {
-                    new_pes_packet(pes, ts->pkt);
-                    pes->total_size = MAX_PES_PAYLOAD;
-                    pes->buffer = av_buffer_alloc(pes->total_size + FF_INPUT_BUFFER_PADDING_SIZE);
-                    if (!pes->buffer)
-                        return AVERROR(ENOMEM);
-                    ts->stop_parse = 1;
-                } else if (pes->data_index == 0 && buf_size > pes->total_size) {
-                    // pes packet size is < ts size packet and pes data is padded with 0xff
-                    // not sure if this is legal in ts but see issue #2392
-                    buf_size = pes->total_size;
-                }
-                memcpy(pes->buffer->data + pes->data_index, p, buf_size);
-                pes->data_index += buf_size;
-            }
-            buf_size = 0;
-            /* emit complete packets with known packet size
-             * decreases demuxer delay for infrequent packets like subtitles from
-             * a couple of seconds to milliseconds for properly muxed files.
-             * total_size is the number of bytes following pes_packet_length
-             * in the pes header, i.e. not counting the first PES_START_SIZE bytes */
-            if (!ts->stop_parse && pes->total_size < MAX_PES_PAYLOAD &&
-                pes->pes_header_size + pes->data_index == pes->total_size + PES_START_SIZE) {
-                ts->stop_parse = 1;
-                new_pes_packet(pes, ts->pkt);
-            }
-            break;
-        case MPEGTS_SKIP:
-            buf_size = 0;
-            break;
-        }
-    }
-
-    return 0;
-}
-
-static PESContext *add_pes_stream(MpegTSContext *ts, int pid, int pcr_pid)
-{
-    MpegTSFilter *tss;
-    PESContext *pes;
-
-    /* if no pid found, then add a pid context */
-    pes = av_mallocz(sizeof(PESContext));
-    if (!pes)
-        return 0;
-    pes->ts = ts;
-    pes->stream = ts->stream;
-    pes->pid = pid;
-    pes->pcr_pid = pcr_pid;
-    pes->state = MPEGTS_SKIP;
-    pes->pts = AV_NOPTS_VALUE;
-    pes->dts = AV_NOPTS_VALUE;
-    tss = mpegts_open_pes_filter(ts, pid, mpegts_push_data, pes);
-    if (!tss) {
-        av_free(pes);
-        return 0;
-    }
-    return pes;
-}
-
-#define MAX_LEVEL 4
-typedef struct {
-    AVFormatContext *s;
-    AVIOContext pb;
-    Mp4Descr *descr;
-    Mp4Descr *active_descr;
-    int descr_count;
-    int max_descr_count;
-    int level;
-} MP4DescrParseContext;
-
-static int init_MP4DescrParseContext(
-    MP4DescrParseContext *d, AVFormatContext *s, const uint8_t *buf,
-    unsigned size, Mp4Descr *descr, int max_descr_count)
-{
-    int ret;
-    if (size > (1<<30))
-        return AVERROR_INVALIDDATA;
-
-    if ((ret = ffio_init_context(&d->pb, (unsigned char*)buf, size, 0,
-                          NULL, NULL, NULL, NULL)) < 0)
-        return ret;
-
-    d->s = s;
-    d->level = 0;
-    d->descr_count = 0;
-    d->descr = descr;
-    d->active_descr = NULL;
-    d->max_descr_count = max_descr_count;
-
-    return 0;
-}
-
-static void update_offsets(AVIOContext *pb, int64_t *off, int *len) {
-    int64_t new_off = avio_tell(pb);
-    (*len) -= new_off - *off;
-    *off = new_off;
-}
-
-static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
-                           int target_tag);
-
-static int parse_mp4_descr_arr(MP4DescrParseContext *d, int64_t off, int len)
-{
-    while (len > 0) {
-        if (parse_mp4_descr(d, off, len, 0) < 0)
-            return -1;
-        update_offsets(&d->pb, &off, &len);
-    }
-    return 0;
-}
-
-static int parse_MP4IODescrTag(MP4DescrParseContext *d, int64_t off, int len)
-{
-    avio_rb16(&d->pb); // ID
-    avio_r8(&d->pb);
-    avio_r8(&d->pb);
-    avio_r8(&d->pb);
-    avio_r8(&d->pb);
-    avio_r8(&d->pb);
-    update_offsets(&d->pb, &off, &len);
-    return parse_mp4_descr_arr(d, off, len);
-}
-
-static int parse_MP4ODescrTag(MP4DescrParseContext *d, int64_t off, int len)
-{
-    int id_flags;
-    if (len < 2)
-        return 0;
-    id_flags = avio_rb16(&d->pb);
-    if (!(id_flags & 0x0020)) { //URL_Flag
-        update_offsets(&d->pb, &off, &len);
-        return parse_mp4_descr_arr(d, off, len); //ES_Descriptor[]
-    } else {
-        return 0;
-    }
-}
-
-static int parse_MP4ESDescrTag(MP4DescrParseContext *d, int64_t off, int len)
-{
-    int es_id = 0;
-    if (d->descr_count >= d->max_descr_count)
-        return -1;
-    ff_mp4_parse_es_descr(&d->pb, &es_id);
-    d->active_descr = d->descr + (d->descr_count++);
-
-    d->active_descr->es_id = es_id;
-    update_offsets(&d->pb, &off, &len);
-    parse_mp4_descr(d, off, len, MP4DecConfigDescrTag);
-    update_offsets(&d->pb, &off, &len);
-    if (len > 0)
-        parse_mp4_descr(d, off, len, MP4SLDescrTag);
-    d->active_descr = NULL;
-    return 0;
-}
-
-static int parse_MP4DecConfigDescrTag(MP4DescrParseContext *d, int64_t off, int len)
-{
-    Mp4Descr *descr = d->active_descr;
-    if (!descr)
-        return -1;
-    d->active_descr->dec_config_descr = av_malloc(len);
-    if (!descr->dec_config_descr)
-        return AVERROR(ENOMEM);
-    descr->dec_config_descr_len = len;
-    avio_read(&d->pb, descr->dec_config_descr, len);
-    return 0;
-}
-
-static int parse_MP4SLDescrTag(MP4DescrParseContext *d, int64_t off, int len)
-{
-    Mp4Descr *descr = d->active_descr;
-    int predefined;
-    if (!descr)
-        return -1;
-
-    predefined = avio_r8(&d->pb);
-    if (!predefined) {
-        int lengths;
-        int flags = avio_r8(&d->pb);
-        descr->sl.use_au_start       = !!(flags & 0x80);
-        descr->sl.use_au_end         = !!(flags & 0x40);
-        descr->sl.use_rand_acc_pt    = !!(flags & 0x20);
-        descr->sl.use_padding        = !!(flags & 0x08);
-        descr->sl.use_timestamps     = !!(flags & 0x04);
-        descr->sl.use_idle           = !!(flags & 0x02);
-        descr->sl.timestamp_res      = avio_rb32(&d->pb);
-                                       avio_rb32(&d->pb);
-        descr->sl.timestamp_len      = avio_r8(&d->pb);
-        descr->sl.ocr_len            = avio_r8(&d->pb);
-        descr->sl.au_len             = avio_r8(&d->pb);
-        descr->sl.inst_bitrate_len   = avio_r8(&d->pb);
-        lengths                      = avio_rb16(&d->pb);
-        descr->sl.degr_prior_len     = lengths >> 12;
-        descr->sl.au_seq_num_len     = (lengths >> 7) & 0x1f;
-        descr->sl.packet_seq_num_len = (lengths >> 2) & 0x1f;
-    } else {
-        avpriv_report_missing_feature(d->s, "Predefined SLConfigDescriptor");
-    }
-    return 0;
-}
-
-static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
-                           int target_tag) {
-    int tag;
-    int len1 = ff_mp4_read_descr(d->s, &d->pb, &tag);
-    update_offsets(&d->pb, &off, &len);
-    if (len < 0 || len1 > len || len1 <= 0) {
-        av_log(d->s, AV_LOG_ERROR, "Tag %x length violation new length %d bytes remaining %d\n", tag, len1, len);
-        return -1;
-    }
-
-    if (d->level++ >= MAX_LEVEL) {
-        av_log(d->s, AV_LOG_ERROR, "Maximum MP4 descriptor level exceeded\n");
-        goto done;
-    }
-
-    if (target_tag && tag != target_tag) {
-        av_log(d->s, AV_LOG_ERROR, "Found tag %x expected %x\n", tag, target_tag);
-        goto done;
-    }
-
-    switch (tag) {
-    case MP4IODescrTag:
-        parse_MP4IODescrTag(d, off, len1);
-        break;
-    case MP4ODescrTag:
-        parse_MP4ODescrTag(d, off, len1);
-        break;
-    case MP4ESDescrTag:
-        parse_MP4ESDescrTag(d, off, len1);
-        break;
-    case MP4DecConfigDescrTag:
-        parse_MP4DecConfigDescrTag(d, off, len1);
-        break;
-    case MP4SLDescrTag:
-        parse_MP4SLDescrTag(d, off, len1);
-        break;
-    }
-
-done:
-    d->level--;
-    avio_seek(&d->pb, off + len1, SEEK_SET);
-    return 0;
-}
-
-static int mp4_read_iods(AVFormatContext *s, const uint8_t *buf, unsigned size,
-                         Mp4Descr *descr, int *descr_count, int max_descr_count)
-{
-    MP4DescrParseContext d;
-    if (init_MP4DescrParseContext(&d, s, buf, size, descr, max_descr_count) < 0)
-        return -1;
-
-    parse_mp4_descr(&d, avio_tell(&d.pb), size, MP4IODescrTag);
-
-    *descr_count = d.descr_count;
-    return 0;
-}
-
-static int mp4_read_od(AVFormatContext *s, const uint8_t *buf, unsigned size,
-                       Mp4Descr *descr, int *descr_count, int max_descr_count)
-{
-    MP4DescrParseContext d;
-    if (init_MP4DescrParseContext(&d, s, buf, size, descr, max_descr_count) < 0)
-        return -1;
-
-    parse_mp4_descr_arr(&d, avio_tell(&d.pb), size);
-
-    *descr_count = d.descr_count;
-    return 0;
-}
-
-static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
-{
-    MpegTSContext *ts = filter->u.section_filter.opaque;
-    SectionHeader h;
-    const uint8_t *p, *p_end;
-    AVIOContext pb;
-    Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = {{ 0 }};
-    int mp4_descr_count = 0;
-    int i, pid;
-    AVFormatContext *s = ts->stream;
-
-    p_end = section + section_len - 4;
-    p = section;
-    if (parse_section_header(&h, &p, p_end) < 0)
-        return;
-    if (h.tid != M4OD_TID)
-        return;
-
-    mp4_read_od(s, p, (unsigned)(p_end - p), mp4_descr, &mp4_descr_count, MAX_MP4_DESCR_COUNT);
-
-    for (pid = 0; pid < NB_PID_MAX; pid++) {
-        if (!ts->pids[pid])
-             continue;
-        for (i = 0; i < mp4_descr_count; i++) {
-            PESContext *pes;
-            AVStream *st;
-            if (ts->pids[pid]->es_id != mp4_descr[i].es_id)
-                continue;
-            if (!(ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES)) {
-                av_log(s, AV_LOG_ERROR, "pid %x is not PES\n", pid);
-                continue;
-            }
-            pes = ts->pids[pid]->u.pes_filter.opaque;
-            st = pes->st;
-            if (!st) {
-                continue;
-            }
-
-            pes->sl = mp4_descr[i].sl;
-
-            ffio_init_context(&pb, mp4_descr[i].dec_config_descr,
-                              mp4_descr[i].dec_config_descr_len, 0, NULL, NULL, NULL, NULL);
-            ff_mp4_read_dec_config_descr(s, st, &pb);
-            if (st->codec->codec_id == AV_CODEC_ID_AAC &&
-                st->codec->extradata_size > 0)
-                st->need_parsing = 0;
-            if (st->codec->codec_id == AV_CODEC_ID_H264 &&
-                st->codec->extradata_size > 0)
-                st->need_parsing = 0;
-
-            if (st->codec->codec_id <= AV_CODEC_ID_NONE) {
-            } else if (st->codec->codec_id < AV_CODEC_ID_FIRST_AUDIO) {
-                st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            } else if (st->codec->codec_id < AV_CODEC_ID_FIRST_SUBTITLE) {
-                st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            } else if (st->codec->codec_id < AV_CODEC_ID_FIRST_UNKNOWN) {
-                st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-            }
-        }
-    }
-    for (i = 0; i < mp4_descr_count; i++)
-        av_free(mp4_descr[i].dec_config_descr);
-}
-
-int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type,
-                              const uint8_t **pp, const uint8_t *desc_list_end,
-                              Mp4Descr *mp4_descr, int mp4_descr_count, int pid,
-                              MpegTSContext *ts)
-{
-    const uint8_t *desc_end;
-    int desc_len, desc_tag, desc_es_id;
-    char language[252];
-    int i;
-
-    desc_tag = get8(pp, desc_list_end);
-    if (desc_tag < 0)
-        return -1;
-    desc_len = get8(pp, desc_list_end);
-    if (desc_len < 0)
-        return -1;
-    desc_end = *pp + desc_len;
-    if (desc_end > desc_list_end)
-        return -1;
-
-    av_dlog(fc, "tag: 0x%02x len=%d\n", desc_tag, desc_len);
-
-    if (st->codec->codec_id == AV_CODEC_ID_NONE &&
-        stream_type == STREAM_TYPE_PRIVATE_DATA)
-        mpegts_find_stream_type(st, desc_tag, DESC_types);
-
-    switch(desc_tag) {
-    case 0x1E: /* SL descriptor */
-        desc_es_id = get16(pp, desc_end);
-        if (ts && ts->pids[pid])
-            ts->pids[pid]->es_id = desc_es_id;
-        for (i = 0; i < mp4_descr_count; i++)
-        if (mp4_descr[i].dec_config_descr_len &&
-            mp4_descr[i].es_id == desc_es_id) {
-            AVIOContext pb;
-            ffio_init_context(&pb, mp4_descr[i].dec_config_descr,
-                          mp4_descr[i].dec_config_descr_len, 0, NULL, NULL, NULL, NULL);
-            ff_mp4_read_dec_config_descr(fc, st, &pb);
-            if (st->codec->codec_id == AV_CODEC_ID_AAC &&
-                st->codec->extradata_size > 0)
-                st->need_parsing = 0;
-            if (st->codec->codec_id == AV_CODEC_ID_MPEG4SYSTEMS)
-                mpegts_open_section_filter(ts, pid, m4sl_cb, ts, 1);
-        }
-        break;
-    case 0x1F: /* FMC descriptor */
-        get16(pp, desc_end);
-        if (mp4_descr_count > 0 && st->codec->codec_id == AV_CODEC_ID_AAC_LATM &&
-            mp4_descr->dec_config_descr_len && mp4_descr->es_id == pid) {
-            AVIOContext pb;
-            ffio_init_context(&pb, mp4_descr->dec_config_descr,
-                          mp4_descr->dec_config_descr_len, 0, NULL, NULL, NULL, NULL);
-            ff_mp4_read_dec_config_descr(fc, st, &pb);
-            if (st->codec->codec_id == AV_CODEC_ID_AAC &&
-                st->codec->extradata_size > 0)
-                st->need_parsing = 0;
-        }
-        break;
-    case 0x56: /* DVB teletext descriptor */
-        language[0] = get8(pp, desc_end);
-        language[1] = get8(pp, desc_end);
-        language[2] = get8(pp, desc_end);
-        language[3] = 0;
-        av_dict_set(&st->metadata, "language", language, 0);
-        break;
-    case 0x59: /* subtitling descriptor */
-        language[0] = get8(pp, desc_end);
-        language[1] = get8(pp, desc_end);
-        language[2] = get8(pp, desc_end);
-        language[3] = 0;
-        /* hearing impaired subtitles detection */
-        switch(get8(pp, desc_end)) {
-        case 0x20: /* DVB subtitles (for the hard of hearing) with no monitor aspect ratio criticality */
-        case 0x21: /* DVB subtitles (for the hard of hearing) for display on 4:3 aspect ratio monitor */
-        case 0x22: /* DVB subtitles (for the hard of hearing) for display on 16:9 aspect ratio monitor */
-        case 0x23: /* DVB subtitles (for the hard of hearing) for display on 2.21:1 aspect ratio monitor */
-        case 0x24: /* DVB subtitles (for the hard of hearing) for display on a high definition monitor */
-        case 0x25: /* DVB subtitles (for the hard of hearing) with plano-stereoscopic disparity for display on a high definition monitor */
-            st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED;
-            break;
-        }
-        if (st->codec->extradata) {
-            if (st->codec->extradata_size == 4 && memcmp(st->codec->extradata, *pp, 4))
-                avpriv_request_sample(fc, "DVB sub with multiple IDs");
-        } else {
-            st->codec->extradata = av_malloc(4 + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (st->codec->extradata) {
-                st->codec->extradata_size = 4;
-                memcpy(st->codec->extradata, *pp, 4);
-            }
-        }
-        *pp += 4;
-        av_dict_set(&st->metadata, "language", language, 0);
-        break;
-    case 0x0a: /* ISO 639 language descriptor */
-        for (i = 0; i + 4 <= desc_len; i += 4) {
-            language[i + 0] = get8(pp, desc_end);
-            language[i + 1] = get8(pp, desc_end);
-            language[i + 2] = get8(pp, desc_end);
-            language[i + 3] = ',';
-        switch (get8(pp, desc_end)) {
-            case 0x01: st->disposition |= AV_DISPOSITION_CLEAN_EFFECTS; break;
-            case 0x02: st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED; break;
-            case 0x03: st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; break;
-        }
-        }
-        if (i) {
-            language[i - 1] = 0;
-            av_dict_set(&st->metadata, "language", language, 0);
-        }
-        break;
-    case 0x05: /* registration descriptor */
-        st->codec->codec_tag = bytestream_get_le32(pp);
-        av_dlog(fc, "reg_desc=%.4s\n", (char*)&st->codec->codec_tag);
-        if (st->codec->codec_id == AV_CODEC_ID_NONE)
-            mpegts_find_stream_type(st, st->codec->codec_tag, REGD_types);
-        break;
-    default:
-        break;
-    }
-    *pp = desc_end;
-    return 0;
-}
-
-static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
-{
-    MpegTSContext *ts = filter->u.section_filter.opaque;
-    SectionHeader h1, *h = &h1;
-    PESContext *pes;
-    AVStream *st;
-    const uint8_t *p, *p_end, *desc_list_end;
-    int program_info_length, pcr_pid, pid, stream_type;
-    int desc_list_len;
-    uint32_t prog_reg_desc = 0; /* registration descriptor */
-
-    Mp4Descr mp4_descr[MAX_MP4_DESCR_COUNT] = {{ 0 }};
-    int mp4_descr_count = 0;
-    int i;
-
-    av_dlog(ts->stream, "PMT: len %i\n", section_len);
-    hex_dump_debug(ts->stream, section, section_len);
-
-    p_end = section + section_len - 4;
-    p = section;
-    if (parse_section_header(h, &p, p_end) < 0)
-        return;
-
-    av_dlog(ts->stream, "sid=0x%x sec_num=%d/%d\n",
-           h->id, h->sec_num, h->last_sec_num);
-
-    if (h->tid != PMT_TID)
-        return;
-
-    clear_program(ts, h->id);
-    pcr_pid = get16(&p, p_end);
-    if (pcr_pid < 0)
-        return;
-    pcr_pid &= 0x1fff;
-    add_pid_to_pmt(ts, h->id, pcr_pid);
-
-    av_dlog(ts->stream, "pcr_pid=0x%x\n", pcr_pid);
-
-    program_info_length = get16(&p, p_end);
-    if (program_info_length < 0)
-        return;
-    program_info_length &= 0xfff;
-    while(program_info_length >= 2) {
-        uint8_t tag, len;
-        tag = get8(&p, p_end);
-        len = get8(&p, p_end);
-
-        av_dlog(ts->stream, "program tag: 0x%02x len=%d\n", tag, len);
-
-        if(len > program_info_length - 2)
-            //something else is broken, exit the program_descriptors_loop
-            break;
-        program_info_length -= len + 2;
-        if (tag == 0x1d) { // IOD descriptor
-            get8(&p, p_end); // scope
-            get8(&p, p_end); // label
-            len -= 2;
-            mp4_read_iods(ts->stream, p, len, mp4_descr + mp4_descr_count,
-                          &mp4_descr_count, MAX_MP4_DESCR_COUNT);
-        } else if (tag == 0x05 && len >= 4) { // registration descriptor
-            prog_reg_desc = bytestream_get_le32(&p);
-            len -= 4;
-        }
-        p += len;
-    }
-    p += program_info_length;
-    if (p >= p_end)
-        goto out;
-
-    // stop parsing after pmt, we found header
-    if (!ts->stream->nb_streams)
-        ts->stop_parse = 1;
-
-    for(;;) {
-        st = 0;
-        pes = NULL;
-        stream_type = get8(&p, p_end);
-        if (stream_type < 0)
-            break;
-        pid = get16(&p, p_end);
-        if (pid < 0)
-            break;
-        pid &= 0x1fff;
-
-        /* now create stream */
-        if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
-            pes = ts->pids[pid]->u.pes_filter.opaque;
-            if (!pes->st) {
-                pes->st = avformat_new_stream(pes->stream, NULL);
-                pes->st->id = pes->pid;
-            }
-            st = pes->st;
-        } else if (stream_type != 0x13) {
-            if (ts->pids[pid]) mpegts_close_filter(ts, ts->pids[pid]); //wrongly added sdt filter probably
-            pes = add_pes_stream(ts, pid, pcr_pid);
-            if (pes) {
-                st = avformat_new_stream(pes->stream, NULL);
-                st->id = pes->pid;
-            }
-        } else {
-            int idx = ff_find_stream_index(ts->stream, pid);
-            if (idx >= 0) {
-                st = ts->stream->streams[idx];
-            } else {
-                st = avformat_new_stream(ts->stream, NULL);
-                st->id = pid;
-                st->codec->codec_type = AVMEDIA_TYPE_DATA;
-            }
-        }
-
-        if (!st)
-            goto out;
-
-        if (pes && !pes->stream_type)
-            mpegts_set_stream_info(st, pes, stream_type, prog_reg_desc);
-
-        add_pid_to_pmt(ts, h->id, pid);
-
-        ff_program_add_stream_index(ts->stream, h->id, st->index);
-
-        desc_list_len = get16(&p, p_end);
-        if (desc_list_len < 0)
-            break;
-        desc_list_len &= 0xfff;
-        desc_list_end = p + desc_list_len;
-        if (desc_list_end > p_end)
-            break;
-        for(;;) {
-            if (ff_parse_mpeg2_descriptor(ts->stream, st, stream_type, &p, desc_list_end,
-                mp4_descr, mp4_descr_count, pid, ts) < 0)
-                break;
-
-            if (pes && prog_reg_desc == AV_RL32("HDMV") && stream_type == 0x83 && pes->sub_st) {
-                ff_program_add_stream_index(ts->stream, h->id, pes->sub_st->index);
-                pes->sub_st->codec->codec_tag = st->codec->codec_tag;
-            }
-        }
-        p = desc_list_end;
-    }
-
- out:
-    for (i = 0; i < mp4_descr_count; i++)
-        av_free(mp4_descr[i].dec_config_descr);
-}
-
-static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
-{
-    MpegTSContext *ts = filter->u.section_filter.opaque;
-    SectionHeader h1, *h = &h1;
-    const uint8_t *p, *p_end;
-    int sid, pmt_pid;
-
-    av_dlog(ts->stream, "PAT:\n");
-    hex_dump_debug(ts->stream, section, section_len);
-
-    p_end = section + section_len - 4;
-    p = section;
-    if (parse_section_header(h, &p, p_end) < 0)
-        return;
-    if (h->tid != PAT_TID)
-        return;
-
-    clear_programs(ts);
-    for(;;) {
-        sid = get16(&p, p_end);
-        if (sid < 0)
-            break;
-        pmt_pid = get16(&p, p_end);
-        if (pmt_pid < 0)
-            break;
-        pmt_pid &= 0x1fff;
-
-        av_dlog(ts->stream, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
-
-        if (sid == 0x0000) {
-            /* NIT info */
-        } else {
-            av_new_program(ts->stream, sid);
-            if (ts->pids[pmt_pid])
-                mpegts_close_filter(ts, ts->pids[pmt_pid]);
-            mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
-            add_pat_entry(ts, sid);
-            add_pid_to_pmt(ts, sid, 0); //add pat pid to program
-            add_pid_to_pmt(ts, sid, pmt_pid);
-        }
-    }
-}
-
-static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
-{
-    MpegTSContext *ts = filter->u.section_filter.opaque;
-    SectionHeader h1, *h = &h1;
-    const uint8_t *p, *p_end, *desc_list_end, *desc_end;
-    int onid, val, sid, desc_list_len, desc_tag, desc_len, service_type;
-    char *name, *provider_name;
-
-    av_dlog(ts->stream, "SDT:\n");
-    hex_dump_debug(ts->stream, section, section_len);
-
-    p_end = section + section_len - 4;
-    p = section;
-    if (parse_section_header(h, &p, p_end) < 0)
-        return;
-    if (h->tid != SDT_TID)
-        return;
-    onid = get16(&p, p_end);
-    if (onid < 0)
-        return;
-    val = get8(&p, p_end);
-    if (val < 0)
-        return;
-    for(;;) {
-        sid = get16(&p, p_end);
-        if (sid < 0)
-            break;
-        val = get8(&p, p_end);
-        if (val < 0)
-            break;
-        desc_list_len = get16(&p, p_end);
-        if (desc_list_len < 0)
-            break;
-        desc_list_len &= 0xfff;
-        desc_list_end = p + desc_list_len;
-        if (desc_list_end > p_end)
-            break;
-        for(;;) {
-            desc_tag = get8(&p, desc_list_end);
-            if (desc_tag < 0)
-                break;
-            desc_len = get8(&p, desc_list_end);
-            desc_end = p + desc_len;
-            if (desc_end > desc_list_end)
-                break;
-
-            av_dlog(ts->stream, "tag: 0x%02x len=%d\n",
-                   desc_tag, desc_len);
-
-            switch(desc_tag) {
-            case 0x48:
-                service_type = get8(&p, p_end);
-                if (service_type < 0)
-                    break;
-                provider_name = getstr8(&p, p_end);
-                if (!provider_name)
-                    break;
-                name = getstr8(&p, p_end);
-                if (name) {
-                    AVProgram *program = av_new_program(ts->stream, sid);
-                    if(program) {
-                        av_dict_set(&program->metadata, "service_name", name, 0);
-                        av_dict_set(&program->metadata, "service_provider", provider_name, 0);
-                    }
-                }
-                av_free(name);
-                av_free(provider_name);
-                break;
-            default:
-                break;
-            }
-            p = desc_end;
-        }
-        p = desc_list_end;
-    }
-}
-
-/* handle one TS packet */
-static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
-{
-    AVFormatContext *s = ts->stream;
-    MpegTSFilter *tss;
-    int len, pid, cc, expected_cc, cc_ok, afc, is_start, is_discontinuity,
-        has_adaptation, has_payload;
-    const uint8_t *p, *p_end;
-    int64_t pos;
-
-    pid = AV_RB16(packet + 1) & 0x1fff;
-    if(pid && discard_pid(ts, pid))
-        return 0;
-    is_start = packet[1] & 0x40;
-    tss = ts->pids[pid];
-    if (ts->auto_guess && tss == NULL && is_start) {
-        add_pes_stream(ts, pid, -1);
-        tss = ts->pids[pid];
-    }
-    if (!tss)
-        return 0;
-
-    afc = (packet[3] >> 4) & 3;
-    if (afc == 0) /* reserved value */
-        return 0;
-    has_adaptation = afc & 2;
-    has_payload = afc & 1;
-    is_discontinuity = has_adaptation
-                && packet[4] != 0 /* with length > 0 */
-                && (packet[5] & 0x80); /* and discontinuity indicated */
-
-    /* continuity check (currently not used) */
-    cc = (packet[3] & 0xf);
-    expected_cc = has_payload ? (tss->last_cc + 1) & 0x0f : tss->last_cc;
-    cc_ok = pid == 0x1FFF // null packet PID
-            || is_discontinuity
-            || tss->last_cc < 0
-            || expected_cc == cc;
-
-    tss->last_cc = cc;
-    if (!cc_ok) {
-        av_log(ts->stream, AV_LOG_WARNING,
-               "Continuity check failed for pid %d expected %d got %d\n",
-               pid, expected_cc, cc);
-        if(tss->type == MPEGTS_PES) {
-            PESContext *pc = tss->u.pes_filter.opaque;
-            pc->flags |= AV_PKT_FLAG_CORRUPT;
-        }
-    }
-
-    if (!has_payload)
-        return 0;
-    p = packet + 4;
-    if (has_adaptation) {
-        /* skip adaptation field */
-        p += p[0] + 1;
-    }
-    /* if past the end of packet, ignore */
-    p_end = packet + TS_PACKET_SIZE;
-    if (p >= p_end)
-        return 0;
-
-    pos = avio_tell(ts->stream->pb);
-    MOD_UNLIKELY(ts->pos47, pos, ts->raw_packet_size, ts->pos);
-
-    if (tss->type == MPEGTS_SECTION) {
-        if (is_start) {
-            /* pointer field present */
-            len = *p++;
-            if (p + len > p_end)
-                return 0;
-            if (len && cc_ok) {
-                /* write remaining section bytes */
-                write_section_data(s, tss,
-                                   p, len, 0);
-                /* check whether filter has been closed */
-                if (!ts->pids[pid])
-                    return 0;
-            }
-            p += len;
-            if (p < p_end) {
-                write_section_data(s, tss,
-                                   p, p_end - p, 1);
-            }
-        } else {
-            if (cc_ok) {
-                write_section_data(s, tss,
-                                   p, p_end - p, 0);
-            }
-        }
-    } else {
-        int ret;
-        // Note: The position here points actually behind the current packet.
-        if ((ret = tss->u.pes_filter.pes_cb(tss, p, p_end - p, is_start,
-                                            pos - ts->raw_packet_size)) < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-/* XXX: try to find a better synchro over several packets (use
-   get_packet_size() ?) */
-static int mpegts_resync(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    int c, i;
-
-    for(i = 0;i < MAX_RESYNC_SIZE; i++) {
-        c = avio_r8(pb);
-        if (pb->eof_reached)
-            return -1;
-        if (c == 0x47) {
-            avio_seek(pb, -1, SEEK_CUR);
-            return 0;
-        }
-    }
-    av_log(s, AV_LOG_ERROR, "max resync size reached, could not find sync byte\n");
-    /* no sync found */
-    return -1;
-}
-
-/* return -1 if error or EOF. Return 0 if OK. */
-static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size, const uint8_t **data)
-{
-    AVIOContext *pb = s->pb;
-    int len;
-
-    for(;;) {
-        len = ffio_read_indirect(pb, buf, TS_PACKET_SIZE, data);
-        if (len != TS_PACKET_SIZE)
-            return len < 0 ? len : AVERROR_EOF;
-        /* check packet sync byte */
-        if ((*data)[0] != 0x47) {
-            /* find a new packet start */
-            avio_seek(pb, -TS_PACKET_SIZE, SEEK_CUR);
-            if (mpegts_resync(s) < 0)
-                return AVERROR(EAGAIN);
-            else
-                continue;
-        } else {
-            break;
-        }
-    }
-    return 0;
-}
-
-static void finished_reading_packet(AVFormatContext *s, int raw_packet_size)
-{
-    AVIOContext *pb = s->pb;
-    int skip = raw_packet_size - TS_PACKET_SIZE;
-    if (skip > 0)
-        avio_skip(pb, skip);
-}
-
-static int handle_packets(MpegTSContext *ts, int nb_packets)
-{
-    AVFormatContext *s = ts->stream;
-    uint8_t packet[TS_PACKET_SIZE+FF_INPUT_BUFFER_PADDING_SIZE];
-    const uint8_t *data;
-    int packet_num, ret = 0;
-
-    if (avio_tell(s->pb) != ts->last_pos) {
-        int i;
-        av_dlog(ts->stream, "Skipping after seek\n");
-        /* seek detected, flush pes buffer */
-        for (i = 0; i < NB_PID_MAX; i++) {
-            if (ts->pids[i]) {
-                if (ts->pids[i]->type == MPEGTS_PES) {
-                   PESContext *pes = ts->pids[i]->u.pes_filter.opaque;
-                   av_buffer_unref(&pes->buffer);
-                   pes->data_index = 0;
-                   pes->state = MPEGTS_SKIP; /* skip until pes header */
-                }
-                ts->pids[i]->last_cc = -1;
-            }
-        }
-    }
-
-    ts->stop_parse = 0;
-    packet_num = 0;
-    memset(packet + TS_PACKET_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    for(;;) {
-        if (ts->stop_parse>0)
-            break;
-        packet_num++;
-        if (nb_packets != 0 && packet_num >= nb_packets)
-            break;
-        ret = read_packet(s, packet, ts->raw_packet_size, &data);
-        if (ret != 0)
-            break;
-        ret = handle_packet(ts, data);
-        finished_reading_packet(s, ts->raw_packet_size);
-        if (ret != 0)
-            break;
-    }
-    ts->last_pos = avio_tell(s->pb);
-    return ret;
-}
-
-static int mpegts_probe(AVProbeData *p)
-{
-    const int size= p->buf_size;
-    int score, fec_score, dvhs_score;
-    int check_count= size / TS_FEC_PACKET_SIZE;
-#define CHECK_COUNT 10
-
-    if (check_count < CHECK_COUNT)
-        return -1;
-
-    score     = analyze(p->buf, TS_PACKET_SIZE     *check_count, TS_PACKET_SIZE     , NULL)*CHECK_COUNT/check_count;
-    dvhs_score= analyze(p->buf, TS_DVHS_PACKET_SIZE*check_count, TS_DVHS_PACKET_SIZE, NULL)*CHECK_COUNT/check_count;
-    fec_score = analyze(p->buf, TS_FEC_PACKET_SIZE *check_count, TS_FEC_PACKET_SIZE , NULL)*CHECK_COUNT/check_count;
-    av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",
-            score, dvhs_score, fec_score);
-
-// we need a clear definition for the returned score otherwise things will become messy sooner or later
-    if     (score > fec_score && score > dvhs_score && score > 6) return AVPROBE_SCORE_MAX + score     - CHECK_COUNT;
-    else if(dvhs_score > score && dvhs_score > fec_score && dvhs_score > 6) return AVPROBE_SCORE_MAX + dvhs_score  - CHECK_COUNT;
-    else if(                 fec_score > 6) return AVPROBE_SCORE_MAX + fec_score - CHECK_COUNT;
-    else                                    return -1;
-}
-
-/* return the 90kHz PCR and the extension for the 27MHz PCR. return
-   (-1) if not available */
-static int parse_pcr(int64_t *ppcr_high, int *ppcr_low,
-                     const uint8_t *packet)
-{
-    int afc, len, flags;
-    const uint8_t *p;
-    unsigned int v;
-
-    afc = (packet[3] >> 4) & 3;
-    if (afc <= 1)
-        return -1;
-    p = packet + 4;
-    len = p[0];
-    p++;
-    if (len == 0)
-        return -1;
-    flags = *p++;
-    len--;
-    if (!(flags & 0x10))
-        return -1;
-    if (len < 6)
-        return -1;
-    v = AV_RB32(p);
-    *ppcr_high = ((int64_t)v << 1) | (p[4] >> 7);
-    *ppcr_low = ((p[4] & 1) << 8) | p[5];
-    return 0;
-}
-
-static int mpegts_read_header(AVFormatContext *s)
-{
-    MpegTSContext *ts = s->priv_data;
-    AVIOContext *pb = s->pb;
-    uint8_t buf[5*1024];
-    int len;
-    int64_t pos;
-
-    /* read the first 1024 bytes to get packet size */
-    pos = avio_tell(pb);
-    len = avio_read(pb, buf, sizeof(buf));
-    if (len != sizeof(buf))
-        goto fail;
-    ts->raw_packet_size = get_packet_size(buf, sizeof(buf));
-    if (ts->raw_packet_size <= 0)
-        goto fail;
-    ts->stream = s;
-    ts->auto_guess = 0;
-
-    if (s->iformat == &ff_mpegts_demuxer) {
-        /* normal demux */
-
-        /* first do a scan to get all the services */
-        if (avio_seek(pb, pos, SEEK_SET) < 0 && pb->seekable)
-            av_log(s, AV_LOG_ERROR, "Unable to seek back to the start\n");
-
-        mpegts_open_section_filter(ts, SDT_PID, sdt_cb, ts, 1);
-
-        mpegts_open_section_filter(ts, PAT_PID, pat_cb, ts, 1);
-
-        handle_packets(ts, s->probesize / ts->raw_packet_size);
-        /* if could not find service, enable auto_guess */
-
-        ts->auto_guess = 1;
-
-        av_dlog(ts->stream, "tuning done\n");
-
-        s->ctx_flags |= AVFMTCTX_NOHEADER;
-    } else {
-        AVStream *st;
-        int pcr_pid, pid, nb_packets, nb_pcrs, ret, pcr_l;
-        int64_t pcrs[2], pcr_h;
-        int packet_count[2];
-        uint8_t packet[TS_PACKET_SIZE];
-        const uint8_t *data;
-
-        /* only read packets */
-
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            goto fail;
-        avpriv_set_pts_info(st, 60, 1, 27000000);
-        st->codec->codec_type = AVMEDIA_TYPE_DATA;
-        st->codec->codec_id = AV_CODEC_ID_MPEG2TS;
-
-        /* we iterate until we find two PCRs to estimate the bitrate */
-        pcr_pid = -1;
-        nb_pcrs = 0;
-        nb_packets = 0;
-        for(;;) {
-            ret = read_packet(s, packet, ts->raw_packet_size, &data);
-            if (ret < 0)
-                return -1;
-            pid = AV_RB16(data + 1) & 0x1fff;
-            if ((pcr_pid == -1 || pcr_pid == pid) &&
-                parse_pcr(&pcr_h, &pcr_l, data) == 0) {
-                finished_reading_packet(s, ts->raw_packet_size);
-                pcr_pid = pid;
-                packet_count[nb_pcrs] = nb_packets;
-                pcrs[nb_pcrs] = pcr_h * 300 + pcr_l;
-                nb_pcrs++;
-                if (nb_pcrs >= 2)
-                    break;
-            } else {
-                finished_reading_packet(s, ts->raw_packet_size);
-            }
-            nb_packets++;
-        }
-
-        /* NOTE1: the bitrate is computed without the FEC */
-        /* NOTE2: it is only the bitrate of the start of the stream */
-        ts->pcr_incr = (pcrs[1] - pcrs[0]) / (packet_count[1] - packet_count[0]);
-        ts->cur_pcr = pcrs[0] - ts->pcr_incr * packet_count[0];
-        s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr;
-        st->codec->bit_rate = s->bit_rate;
-        st->start_time = ts->cur_pcr;
-        av_dlog(ts->stream, "start=%0.3f pcr=%0.3f incr=%d\n",
-                st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr);
-    }
-
-    avio_seek(pb, pos, SEEK_SET);
-    return 0;
- fail:
-    return -1;
-}
-
-#define MAX_PACKET_READAHEAD ((128 * 1024) / 188)
-
-static int mpegts_raw_read_packet(AVFormatContext *s,
-                                  AVPacket *pkt)
-{
-    MpegTSContext *ts = s->priv_data;
-    int ret, i;
-    int64_t pcr_h, next_pcr_h, pos;
-    int pcr_l, next_pcr_l;
-    uint8_t pcr_buf[12];
-    const uint8_t *data;
-
-    if (av_new_packet(pkt, TS_PACKET_SIZE) < 0)
-        return AVERROR(ENOMEM);
-    pkt->pos= avio_tell(s->pb);
-    ret = read_packet(s, pkt->data, ts->raw_packet_size, &data);
-    if (ret < 0) {
-        av_free_packet(pkt);
-        return ret;
-    }
-    if (data != pkt->data)
-        memcpy(pkt->data, data, ts->raw_packet_size);
-    finished_reading_packet(s, ts->raw_packet_size);
-    if (ts->mpeg2ts_compute_pcr) {
-        /* compute exact PCR for each packet */
-        if (parse_pcr(&pcr_h, &pcr_l, pkt->data) == 0) {
-            /* we read the next PCR (XXX: optimize it by using a bigger buffer */
-            pos = avio_tell(s->pb);
-            for(i = 0; i < MAX_PACKET_READAHEAD; i++) {
-                avio_seek(s->pb, pos + i * ts->raw_packet_size, SEEK_SET);
-                avio_read(s->pb, pcr_buf, 12);
-                if (parse_pcr(&next_pcr_h, &next_pcr_l, pcr_buf) == 0) {
-                    /* XXX: not precise enough */
-                    ts->pcr_incr = ((next_pcr_h - pcr_h) * 300 + (next_pcr_l - pcr_l)) /
-                        (i + 1);
-                    break;
-                }
-            }
-            avio_seek(s->pb, pos, SEEK_SET);
-            /* no next PCR found: we use previous increment */
-            ts->cur_pcr = pcr_h * 300 + pcr_l;
-        }
-        pkt->pts = ts->cur_pcr;
-        pkt->duration = ts->pcr_incr;
-        ts->cur_pcr += ts->pcr_incr;
-    }
-    pkt->stream_index = 0;
-    return 0;
-}
-
-static int mpegts_read_packet(AVFormatContext *s,
-                              AVPacket *pkt)
-{
-    MpegTSContext *ts = s->priv_data;
-    int ret, i;
-
-    pkt->size = -1;
-    ts->pkt = pkt;
-    ret = handle_packets(ts, 0);
-    if (ret < 0) {
-        /* flush pes data left */
-        for (i = 0; i < NB_PID_MAX; i++) {
-            if (ts->pids[i] && ts->pids[i]->type == MPEGTS_PES) {
-                PESContext *pes = ts->pids[i]->u.pes_filter.opaque;
-                if (pes->state == MPEGTS_PAYLOAD && pes->data_index > 0) {
-                    new_pes_packet(pes, pkt);
-                    pes->state = MPEGTS_SKIP;
-                    ret = 0;
-                    break;
-                }
-            }
-        }
-    }
-
-    if (!ret && pkt->size < 0)
-        ret = AVERROR(EINTR);
-    return ret;
-}
-
-static void mpegts_free(MpegTSContext *ts)
-{
-    int i;
-
-    clear_programs(ts);
-
-    for(i=0;i<NB_PID_MAX;i++)
-        if (ts->pids[i]) mpegts_close_filter(ts, ts->pids[i]);
-}
-
-static int mpegts_read_close(AVFormatContext *s)
-{
-    MpegTSContext *ts = s->priv_data;
-    mpegts_free(ts);
-    return 0;
-}
-
-static int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
-                              int64_t *ppos, int64_t pos_limit)
-{
-    MpegTSContext *ts = s->priv_data;
-    int64_t pos, timestamp;
-    uint8_t buf[TS_PACKET_SIZE];
-    int pcr_l, pcr_pid = ((PESContext*)s->streams[stream_index]->priv_data)->pcr_pid;
-    const int find_next= 1;
-    pos = ((*ppos  + ts->raw_packet_size - 1 - ts->pos47) / ts->raw_packet_size) * ts->raw_packet_size + ts->pos47;
-    if (find_next) {
-        for(;;) {
-            avio_seek(s->pb, pos, SEEK_SET);
-            if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)
-                return AV_NOPTS_VALUE;
-            if ((pcr_pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pcr_pid) &&
-                parse_pcr(&timestamp, &pcr_l, buf) == 0) {
-                break;
-            }
-            pos += ts->raw_packet_size;
-        }
-    } else {
-        for(;;) {
-            pos -= ts->raw_packet_size;
-            if (pos < 0)
-                return AV_NOPTS_VALUE;
-            avio_seek(s->pb, pos, SEEK_SET);
-            if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)
-                return AV_NOPTS_VALUE;
-            if ((pcr_pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pcr_pid) &&
-                parse_pcr(&timestamp, &pcr_l, buf) == 0) {
-                break;
-            }
-        }
-    }
-    *ppos = pos;
-
-    return timestamp;
-}
-
-static int read_seek(AVFormatContext *s, int stream_index, int64_t target_ts, int flags){
-    MpegTSContext *ts = s->priv_data;
-    uint8_t buf[TS_PACKET_SIZE];
-    int64_t pos;
-
-    if (ff_seek_frame_binary(s, stream_index, target_ts, flags) < 0)
-        return -1;
-
-    pos= avio_tell(s->pb);
-
-    for(;;) {
-        avio_seek(s->pb, pos, SEEK_SET);
-        if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)
-            return -1;
-//        pid = AV_RB16(buf + 1) & 0x1fff;
-        if(buf[1] & 0x40) break;
-        pos += ts->raw_packet_size;
-    }
-    avio_seek(s->pb, pos, SEEK_SET);
-
-    return 0;
-}
-
-/**************************************************************/
-/* parsing functions - called from other demuxers such as RTP */
-
-MpegTSContext *ff_mpegts_parse_open(AVFormatContext *s)
-{
-    MpegTSContext *ts;
-
-    ts = av_mallocz(sizeof(MpegTSContext));
-    if (!ts)
-        return NULL;
-    /* no stream case, currently used by RTP */
-    ts->raw_packet_size = TS_PACKET_SIZE;
-    ts->stream = s;
-    ts->auto_guess = 1;
-    return ts;
-}
-
-/* return the consumed length if a packet was output, or -1 if no
-   packet is output */
-int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
-                        const uint8_t *buf, int len)
-{
-    int len1;
-
-    len1 = len;
-    ts->pkt = pkt;
-    ts->stop_parse = 0;
-    for(;;) {
-        if (ts->stop_parse>0)
-            break;
-        if (len < TS_PACKET_SIZE)
-            return -1;
-        if (buf[0] != 0x47) {
-            buf++;
-            len--;
-        } else {
-            handle_packet(ts, buf);
-            buf += TS_PACKET_SIZE;
-            len -= TS_PACKET_SIZE;
-        }
-    }
-    return len1 - len;
-}
-
-void ff_mpegts_parse_close(MpegTSContext *ts)
-{
-    mpegts_free(ts);
-    av_free(ts);
-}
-
-AVInputFormat ff_mpegts_demuxer = {
-    .name           = "mpegts",
-    .long_name      = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
-    .priv_data_size = sizeof(MpegTSContext),
-    .read_probe     = mpegts_probe,
-    .read_header    = mpegts_read_header,
-    .read_packet    = mpegts_read_packet,
-    .read_close     = mpegts_read_close,
-    .read_seek      = read_seek,
-    .read_timestamp = mpegts_get_pcr,
-    .flags          = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
-};
-
-AVInputFormat ff_mpegtsraw_demuxer = {
-    .name           = "mpegtsraw",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw MPEG-TS (MPEG-2 Transport Stream)"),
-    .priv_data_size = sizeof(MpegTSContext),
-    .read_header    = mpegts_read_header,
-    .read_packet    = mpegts_raw_read_packet,
-    .read_close     = mpegts_read_close,
-    .read_seek      = read_seek,
-    .read_timestamp = mpegts_get_pcr,
-    .flags          = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
-    .priv_class     = &mpegtsraw_class,
-};
diff --git a/deps/libav/libavformat/mpegts.h b/deps/libav/libavformat/mpegts.h
deleted file mode 100644
index fafe98f..0000000
--- a/deps/libav/libavformat/mpegts.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * MPEG2 transport stream defines
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_MPEGTS_H
-#define AVFORMAT_MPEGTS_H
-
-#include "avformat.h"
-
-#define TS_FEC_PACKET_SIZE 204
-#define TS_DVHS_PACKET_SIZE 192
-#define TS_PACKET_SIZE 188
-#define TS_MAX_PACKET_SIZE 204
-
-#define NB_PID_MAX 8192
-#define MAX_SECTION_SIZE 4096
-
-/* pids */
-#define PAT_PID                 0x0000
-#define SDT_PID                 0x0011
-
-/* table ids */
-#define PAT_TID   0x00
-#define PMT_TID   0x02
-#define M4OD_TID  0x05
-#define SDT_TID   0x42
-
-#define STREAM_TYPE_VIDEO_MPEG1     0x01
-#define STREAM_TYPE_VIDEO_MPEG2     0x02
-#define STREAM_TYPE_AUDIO_MPEG1     0x03
-#define STREAM_TYPE_AUDIO_MPEG2     0x04
-#define STREAM_TYPE_PRIVATE_SECTION 0x05
-#define STREAM_TYPE_PRIVATE_DATA    0x06
-#define STREAM_TYPE_AUDIO_AAC       0x0f
-#define STREAM_TYPE_AUDIO_AAC_LATM  0x11
-#define STREAM_TYPE_VIDEO_MPEG4     0x10
-#define STREAM_TYPE_VIDEO_H264      0x1b
-#define STREAM_TYPE_VIDEO_CAVS      0x42
-#define STREAM_TYPE_VIDEO_VC1       0xea
-#define STREAM_TYPE_VIDEO_DIRAC     0xd1
-
-#define STREAM_TYPE_AUDIO_AC3       0x81
-#define STREAM_TYPE_AUDIO_DTS       0x8a
-
-typedef struct MpegTSContext MpegTSContext;
-
-MpegTSContext *ff_mpegts_parse_open(AVFormatContext *s);
-int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
-                           const uint8_t *buf, int len);
-void ff_mpegts_parse_close(MpegTSContext *ts);
-
-typedef struct SLConfigDescr {
-    int use_au_start;
-    int use_au_end;
-    int use_rand_acc_pt;
-    int use_padding;
-    int use_timestamps;
-    int use_idle;
-    int timestamp_res;
-    int timestamp_len;
-    int ocr_len;
-    int au_len;
-    int inst_bitrate_len;
-    int degr_prior_len;
-    int au_seq_num_len;
-    int packet_seq_num_len;
-} SLConfigDescr;
-
-typedef struct Mp4Descr {
-    int es_id;
-    int dec_config_descr_len;
-    uint8_t *dec_config_descr;
-    SLConfigDescr sl;
-} Mp4Descr;
-
-/**
- * Parse an MPEG-2 descriptor
- * @param[in] fc                    Format context (used for logging only)
- * @param st                        Stream
- * @param stream_type               STREAM_TYPE_xxx
- * @param pp                        Descriptor buffer pointer
- * @param desc_list_end             End of buffer
- * @return <0 to stop processing
- */
-int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type,
-                              const uint8_t **pp, const uint8_t *desc_list_end,
-                              Mp4Descr *mp4_descr, int mp4_descr_count, int pid,
-                              MpegTSContext *ts);
-
-#endif /* AVFORMAT_MPEGTS_H */
diff --git a/deps/libav/libavformat/mpegtsenc.c b/deps/libav/libavformat/mpegtsenc.c
deleted file mode 100644
index 8efd93e..0000000
--- a/deps/libav/libavformat/mpegtsenc.c
+++ /dev/null
@@ -1,1180 +0,0 @@
-/*
- * MPEG2 transport stream (aka DVB) muxer
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/bswap.h"
-#include "libavutil/crc.h"
-#include "libavutil/dict.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavcodec/internal.h"
-#include "avformat.h"
-#include "internal.h"
-#include "mpegts.h"
-
-#define PCR_TIME_BASE 27000000
-
-/* write DVB SI sections */
-
-/*********************************************/
-/* mpegts section writer */
-
-typedef struct MpegTSSection {
-    int pid;
-    int cc;
-    void (*write_packet)(struct MpegTSSection *s, const uint8_t *packet);
-    void *opaque;
-} MpegTSSection;
-
-typedef struct MpegTSService {
-    MpegTSSection pmt; /* MPEG2 pmt table context */
-    int sid;           /* service ID */
-    char *name;
-    char *provider_name;
-    int pcr_pid;
-    int pcr_packet_count;
-    int pcr_packet_period;
-} MpegTSService;
-
-typedef struct MpegTSWrite {
-    const AVClass *av_class;
-    MpegTSSection pat; /* MPEG2 pat table */
-    MpegTSSection sdt; /* MPEG2 sdt table context */
-    MpegTSService **services;
-    int sdt_packet_count;
-    int sdt_packet_period;
-    int pat_packet_count;
-    int pat_packet_period;
-    int nb_services;
-    int onid;
-    int tsid;
-    int64_t first_pcr;
-    int mux_rate; ///< set to 1 when VBR
-    int pes_payload_size;
-
-    int transport_stream_id;
-    int original_network_id;
-    int service_id;
-
-    int pmt_start_pid;
-    int start_pid;
-
-    int reemit_pat_pmt; // backward compatibility
-
-#define MPEGTS_FLAG_REEMIT_PAT_PMT  0x01
-#define MPEGTS_FLAG_AAC_LATM        0x02
-    int flags;
-} MpegTSWrite;
-
-/* a PES packet header is generated every DEFAULT_PES_HEADER_FREQ packets */
-#define DEFAULT_PES_HEADER_FREQ 16
-#define DEFAULT_PES_PAYLOAD_SIZE ((DEFAULT_PES_HEADER_FREQ - 1) * 184 + 170)
-
-static const AVOption options[] = {
-    { "mpegts_transport_stream_id", "Set transport_stream_id field.",
-      offsetof(MpegTSWrite, transport_stream_id), AV_OPT_TYPE_INT, {.i64 = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
-    { "mpegts_original_network_id", "Set original_network_id field.",
-      offsetof(MpegTSWrite, original_network_id), AV_OPT_TYPE_INT, {.i64 = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
-    { "mpegts_service_id", "Set service_id field.",
-      offsetof(MpegTSWrite, service_id), AV_OPT_TYPE_INT, {.i64 = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
-    { "mpegts_pmt_start_pid", "Set the first pid of the PMT.",
-      offsetof(MpegTSWrite, pmt_start_pid), AV_OPT_TYPE_INT, {.i64 = 0x1000 }, 0x1000, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM},
-    { "mpegts_start_pid", "Set the first pid.",
-      offsetof(MpegTSWrite, start_pid), AV_OPT_TYPE_INT, {.i64 = 0x0100 }, 0x0100, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM},
-    { "muxrate", NULL, offsetof(MpegTSWrite, mux_rate), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
-    { "pes_payload_size", "Minimum PES packet payload in bytes",
-      offsetof(MpegTSWrite, pes_payload_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT_PES_PAYLOAD_SIZE}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
-    { "mpegts_flags", "MPEG-TS muxing flags", offsetof(MpegTSWrite, flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, INT_MAX,
-      AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags" },
-    { "resend_headers", "Reemit PAT/PMT before writing the next packet",
-      0, AV_OPT_TYPE_CONST, {.i64 = MPEGTS_FLAG_REEMIT_PAT_PMT}, 0, INT_MAX,
-      AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags"},
-    { "latm", "Use LATM packetization for AAC",
-      0, AV_OPT_TYPE_CONST, {.i64 = MPEGTS_FLAG_AAC_LATM}, 0, INT_MAX,
-      AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags"},
-    // backward compatibility
-    { "resend_headers", "Reemit PAT/PMT before writing the next packet",
-      offsetof(MpegTSWrite, reemit_pat_pmt), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
-    { NULL },
-};
-
-static const AVClass mpegts_muxer_class = {
-    .class_name     = "MPEGTS muxer",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-/* NOTE: 4 bytes must be left at the end for the crc32 */
-static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len)
-{
-    unsigned int crc;
-    unsigned char packet[TS_PACKET_SIZE];
-    const unsigned char *buf_ptr;
-    unsigned char *q;
-    int first, b, len1, left;
-
-    crc = av_bswap32(av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1, buf, len - 4));
-    buf[len - 4] = (crc >> 24) & 0xff;
-    buf[len - 3] = (crc >> 16) & 0xff;
-    buf[len - 2] = (crc >> 8) & 0xff;
-    buf[len - 1] = (crc) & 0xff;
-
-    /* send each packet */
-    buf_ptr = buf;
-    while (len > 0) {
-        first = (buf == buf_ptr);
-        q = packet;
-        *q++ = 0x47;
-        b = (s->pid >> 8);
-        if (first)
-            b |= 0x40;
-        *q++ = b;
-        *q++ = s->pid;
-        s->cc = (s->cc + 1) & 0xf;
-        *q++ = 0x10 | s->cc;
-        if (first)
-            *q++ = 0; /* 0 offset */
-        len1 = TS_PACKET_SIZE - (q - packet);
-        if (len1 > len)
-            len1 = len;
-        memcpy(q, buf_ptr, len1);
-        q += len1;
-        /* add known padding data */
-        left = TS_PACKET_SIZE - (q - packet);
-        if (left > 0)
-            memset(q, 0xff, left);
-
-        s->write_packet(s, packet);
-
-        buf_ptr += len1;
-        len -= len1;
-    }
-}
-
-static inline void put16(uint8_t **q_ptr, int val)
-{
-    uint8_t *q;
-    q = *q_ptr;
-    *q++ = val >> 8;
-    *q++ = val;
-    *q_ptr = q;
-}
-
-static int mpegts_write_section1(MpegTSSection *s, int tid, int id,
-                          int version, int sec_num, int last_sec_num,
-                          uint8_t *buf, int len)
-{
-    uint8_t section[1024], *q;
-    unsigned int tot_len;
-    /* reserved_future_use field must be set to 1 for SDT */
-    unsigned int flags = tid == SDT_TID ? 0xf000 : 0xb000;
-
-    tot_len = 3 + 5 + len + 4;
-    /* check if not too big */
-    if (tot_len > 1024)
-        return -1;
-
-    q = section;
-    *q++ = tid;
-    put16(&q, flags | (len + 5 + 4)); /* 5 byte header + 4 byte CRC */
-    put16(&q, id);
-    *q++ = 0xc1 | (version << 1); /* current_next_indicator = 1 */
-    *q++ = sec_num;
-    *q++ = last_sec_num;
-    memcpy(q, buf, len);
-
-    mpegts_write_section(s, section, tot_len);
-    return 0;
-}
-
-/*********************************************/
-/* mpegts writer */
-
-#define DEFAULT_PROVIDER_NAME   "Libav"
-#define DEFAULT_SERVICE_NAME    "Service01"
-
-/* we retransmit the SI info at this rate */
-#define SDT_RETRANS_TIME 500
-#define PAT_RETRANS_TIME 100
-#define PCR_RETRANS_TIME 20
-
-typedef struct MpegTSWriteStream {
-    struct MpegTSService *service;
-    int pid; /* stream associated pid */
-    int cc;
-    int payload_size;
-    int first_pts_check; ///< first pts check needed
-    int64_t payload_pts;
-    int64_t payload_dts;
-    int payload_flags;
-    uint8_t *payload;
-    AVFormatContext *amux;
-} MpegTSWriteStream;
-
-static void mpegts_write_pat(AVFormatContext *s)
-{
-    MpegTSWrite *ts = s->priv_data;
-    MpegTSService *service;
-    uint8_t data[1012], *q;
-    int i;
-
-    q = data;
-    for(i = 0; i < ts->nb_services; i++) {
-        service = ts->services[i];
-        put16(&q, service->sid);
-        put16(&q, 0xe000 | service->pmt.pid);
-    }
-    mpegts_write_section1(&ts->pat, PAT_TID, ts->tsid, 0, 0, 0,
-                          data, q - data);
-}
-
-static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
-{
-    MpegTSWrite *ts = s->priv_data;
-    uint8_t data[1012], *q, *desc_length_ptr, *program_info_length_ptr;
-    int val, stream_type, i;
-
-    q = data;
-    put16(&q, 0xe000 | service->pcr_pid);
-
-    program_info_length_ptr = q;
-    q += 2; /* patched after */
-
-    /* put program info here */
-
-    val = 0xf000 | (q - program_info_length_ptr - 2);
-    program_info_length_ptr[0] = val >> 8;
-    program_info_length_ptr[1] = val;
-
-    for(i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        MpegTSWriteStream *ts_st = st->priv_data;
-        AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0);
-        switch(st->codec->codec_id) {
-        case AV_CODEC_ID_MPEG1VIDEO:
-        case AV_CODEC_ID_MPEG2VIDEO:
-            stream_type = STREAM_TYPE_VIDEO_MPEG2;
-            break;
-        case AV_CODEC_ID_MPEG4:
-            stream_type = STREAM_TYPE_VIDEO_MPEG4;
-            break;
-        case AV_CODEC_ID_H264:
-            stream_type = STREAM_TYPE_VIDEO_H264;
-            break;
-        case AV_CODEC_ID_CAVS:
-            stream_type = STREAM_TYPE_VIDEO_CAVS;
-            break;
-        case AV_CODEC_ID_DIRAC:
-            stream_type = STREAM_TYPE_VIDEO_DIRAC;
-            break;
-        case AV_CODEC_ID_MP2:
-        case AV_CODEC_ID_MP3:
-            stream_type = STREAM_TYPE_AUDIO_MPEG1;
-            break;
-        case AV_CODEC_ID_AAC:
-            stream_type = (ts->flags & MPEGTS_FLAG_AAC_LATM) ? STREAM_TYPE_AUDIO_AAC_LATM : STREAM_TYPE_AUDIO_AAC;
-            break;
-        case AV_CODEC_ID_AAC_LATM:
-            stream_type = STREAM_TYPE_AUDIO_AAC_LATM;
-            break;
-        case AV_CODEC_ID_AC3:
-            stream_type = STREAM_TYPE_AUDIO_AC3;
-            break;
-        default:
-            stream_type = STREAM_TYPE_PRIVATE_DATA;
-            break;
-        }
-        *q++ = stream_type;
-        put16(&q, 0xe000 | ts_st->pid);
-        desc_length_ptr = q;
-        q += 2; /* patched after */
-
-        /* write optional descriptors here */
-        switch(st->codec->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            if (lang) {
-                char *p;
-                char *next = lang->value;
-                uint8_t *len_ptr;
-
-                *q++ = 0x0a; /* ISO 639 language descriptor */
-                len_ptr = q++;
-                *len_ptr = 0;
-
-                for (p = lang->value; next && *len_ptr < 255 / 4 * 4; p = next + 1) {
-                    next = strchr(p, ',');
-                    if (strlen(p) != 3 && (!next || next != p + 3))
-                        continue; /* not a 3-letter code */
-
-                    *q++ = *p++;
-                    *q++ = *p++;
-                    *q++ = *p++;
-
-                if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
-                    *q++ = 0x01;
-                else if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
-                    *q++ = 0x02;
-                else if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
-                    *q++ = 0x03;
-                else
-                    *q++ = 0; /* undefined type */
-
-                    *len_ptr += 4;
-                }
-
-                if (*len_ptr == 0)
-                    q -= 2; /* no language codes were written */
-            }
-            break;
-        case AVMEDIA_TYPE_SUBTITLE:
-            {
-                const char *language;
-                language = lang && strlen(lang->value)==3 ? lang->value : "eng";
-                *q++ = 0x59;
-                *q++ = 8;
-                *q++ = language[0];
-                *q++ = language[1];
-                *q++ = language[2];
-                *q++ = 0x10; /* normal subtitles (0x20 = if hearing pb) */
-                if(st->codec->extradata_size == 4) {
-                    memcpy(q, st->codec->extradata, 4);
-                    q += 4;
-                } else {
-                    put16(&q, 1); /* page id */
-                    put16(&q, 1); /* ancillary page id */
-                }
-            }
-            break;
-        case AVMEDIA_TYPE_VIDEO:
-            if (stream_type == STREAM_TYPE_VIDEO_DIRAC) {
-                *q++ = 0x05; /*MPEG-2 registration descriptor*/
-                *q++ = 4;
-                *q++ = 'd';
-                *q++ = 'r';
-                *q++ = 'a';
-                *q++ = 'c';
-            }
-            break;
-        }
-
-        val = 0xf000 | (q - desc_length_ptr - 2);
-        desc_length_ptr[0] = val >> 8;
-        desc_length_ptr[1] = val;
-    }
-    mpegts_write_section1(&service->pmt, PMT_TID, service->sid, 0, 0, 0,
-                          data, q - data);
-}
-
-/* NOTE: str == NULL is accepted for an empty string */
-static void putstr8(uint8_t **q_ptr, const char *str)
-{
-    uint8_t *q;
-    int len;
-
-    q = *q_ptr;
-    if (!str)
-        len = 0;
-    else
-        len = strlen(str);
-    *q++ = len;
-    memcpy(q, str, len);
-    q += len;
-    *q_ptr = q;
-}
-
-static void mpegts_write_sdt(AVFormatContext *s)
-{
-    MpegTSWrite *ts = s->priv_data;
-    MpegTSService *service;
-    uint8_t data[1012], *q, *desc_list_len_ptr, *desc_len_ptr;
-    int i, running_status, free_ca_mode, val;
-
-    q = data;
-    put16(&q, ts->onid);
-    *q++ = 0xff;
-    for(i = 0; i < ts->nb_services; i++) {
-        service = ts->services[i];
-        put16(&q, service->sid);
-        *q++ = 0xfc | 0x00; /* currently no EIT info */
-        desc_list_len_ptr = q;
-        q += 2;
-        running_status = 4; /* running */
-        free_ca_mode = 0;
-
-        /* write only one descriptor for the service name and provider */
-        *q++ = 0x48;
-        desc_len_ptr = q;
-        q++;
-        *q++ = 0x01; /* digital television service */
-        putstr8(&q, service->provider_name);
-        putstr8(&q, service->name);
-        desc_len_ptr[0] = q - desc_len_ptr - 1;
-
-        /* fill descriptor length */
-        val = (running_status << 13) | (free_ca_mode << 12) |
-            (q - desc_list_len_ptr - 2);
-        desc_list_len_ptr[0] = val >> 8;
-        desc_list_len_ptr[1] = val;
-    }
-    mpegts_write_section1(&ts->sdt, SDT_TID, ts->tsid, 0, 0, 0,
-                          data, q - data);
-}
-
-static MpegTSService *mpegts_add_service(MpegTSWrite *ts,
-                                         int sid,
-                                         const char *provider_name,
-                                         const char *name)
-{
-    MpegTSService *service;
-
-    service = av_mallocz(sizeof(MpegTSService));
-    if (!service)
-        return NULL;
-    service->pmt.pid = ts->pmt_start_pid + ts->nb_services;
-    service->sid = sid;
-    service->provider_name = av_strdup(provider_name);
-    service->name = av_strdup(name);
-    service->pcr_pid = 0x1fff;
-    dynarray_add(&ts->services, &ts->nb_services, service);
-    return service;
-}
-
-static void section_write_packet(MpegTSSection *s, const uint8_t *packet)
-{
-    AVFormatContext *ctx = s->opaque;
-    avio_write(ctx->pb, packet, TS_PACKET_SIZE);
-}
-
-static int mpegts_write_header(AVFormatContext *s)
-{
-    MpegTSWrite *ts = s->priv_data;
-    MpegTSWriteStream *ts_st;
-    MpegTSService *service;
-    AVStream *st, *pcr_st = NULL;
-    AVDictionaryEntry *title, *provider;
-    int i, j;
-    const char *service_name;
-    const char *provider_name;
-    int *pids;
-    int ret;
-
-    if (s->max_delay < 0) /* Not set by the caller */
-        s->max_delay = 0;
-
-    // round up to a whole number of TS packets
-    ts->pes_payload_size = (ts->pes_payload_size + 14 + 183) / 184 * 184 - 14;
-
-    ts->tsid = ts->transport_stream_id;
-    ts->onid = ts->original_network_id;
-    /* allocate a single DVB service */
-    title = av_dict_get(s->metadata, "service_name", NULL, 0);
-    if (!title)
-        title = av_dict_get(s->metadata, "title", NULL, 0);
-    service_name = title ? title->value : DEFAULT_SERVICE_NAME;
-    provider = av_dict_get(s->metadata, "service_provider", NULL, 0);
-    provider_name = provider ? provider->value : DEFAULT_PROVIDER_NAME;
-    service = mpegts_add_service(ts, ts->service_id, provider_name, service_name);
-    service->pmt.write_packet = section_write_packet;
-    service->pmt.opaque = s;
-    service->pmt.cc = 15;
-
-    ts->pat.pid = PAT_PID;
-    ts->pat.cc = 15; // Initialize at 15 so that it wraps and be equal to 0 for the first packet we write
-    ts->pat.write_packet = section_write_packet;
-    ts->pat.opaque = s;
-
-    ts->sdt.pid = SDT_PID;
-    ts->sdt.cc = 15;
-    ts->sdt.write_packet = section_write_packet;
-    ts->sdt.opaque = s;
-
-    pids = av_malloc(s->nb_streams * sizeof(*pids));
-    if (!pids)
-        return AVERROR(ENOMEM);
-
-    /* assign pids to each stream */
-    for(i = 0;i < s->nb_streams; i++) {
-        st = s->streams[i];
-        avpriv_set_pts_info(st, 33, 1, 90000);
-        ts_st = av_mallocz(sizeof(MpegTSWriteStream));
-        if (!ts_st) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        st->priv_data = ts_st;
-        ts_st->payload = av_mallocz(ts->pes_payload_size);
-        if (!ts_st->payload) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        ts_st->service = service;
-        /* MPEG pid values < 16 are reserved. Applications which set st->id in
-         * this range are assigned a calculated pid. */
-        if (st->id < 16) {
-            ts_st->pid = ts->start_pid + i;
-        } else if (st->id < 0x1FFF) {
-            ts_st->pid = st->id;
-        } else {
-            av_log(s, AV_LOG_ERROR, "Invalid stream id %d, must be less than 8191\n", st->id);
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-        if (ts_st->pid == service->pmt.pid) {
-            av_log(s, AV_LOG_ERROR, "Duplicate stream id %d\n", ts_st->pid);
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-        for (j = 0; j < i; j++)
-            if (pids[j] == ts_st->pid) {
-                av_log(s, AV_LOG_ERROR, "Duplicate stream id %d\n", ts_st->pid);
-                ret = AVERROR(EINVAL);
-                goto fail;
-            }
-        pids[i] = ts_st->pid;
-        ts_st->payload_pts = AV_NOPTS_VALUE;
-        ts_st->payload_dts = AV_NOPTS_VALUE;
-        ts_st->first_pts_check = 1;
-        ts_st->cc = 15;
-        /* update PCR pid by using the first video stream */
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-            service->pcr_pid == 0x1fff) {
-            service->pcr_pid = ts_st->pid;
-            pcr_st = st;
-        }
-        if (st->codec->codec_id == AV_CODEC_ID_AAC &&
-            st->codec->extradata_size > 0)
-        {
-            AVStream *ast;
-            ts_st->amux = avformat_alloc_context();
-            if (!ts_st->amux) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-            ts_st->amux->oformat = av_guess_format((ts->flags & MPEGTS_FLAG_AAC_LATM) ? "latm" : "adts", NULL, NULL);
-            if (!ts_st->amux->oformat) {
-                ret = AVERROR(EINVAL);
-                goto fail;
-            }
-            ast = avformat_new_stream(ts_st->amux, NULL);
-            ret = avcodec_copy_context(ast->codec, st->codec);
-            if (ret != 0)
-                goto fail;
-            ret = avformat_write_header(ts_st->amux, NULL);
-            if (ret < 0)
-                goto fail;
-        }
-    }
-
-    av_free(pids);
-
-    /* if no video stream, use the first stream as PCR */
-    if (service->pcr_pid == 0x1fff && s->nb_streams > 0) {
-        pcr_st = s->streams[0];
-        ts_st = pcr_st->priv_data;
-        service->pcr_pid = ts_st->pid;
-    }
-
-    if (ts->mux_rate > 1) {
-        service->pcr_packet_period = (ts->mux_rate * PCR_RETRANS_TIME) /
-            (TS_PACKET_SIZE * 8 * 1000);
-        ts->sdt_packet_period      = (ts->mux_rate * SDT_RETRANS_TIME) /
-            (TS_PACKET_SIZE * 8 * 1000);
-        ts->pat_packet_period      = (ts->mux_rate * PAT_RETRANS_TIME) /
-            (TS_PACKET_SIZE * 8 * 1000);
-
-        ts->first_pcr = av_rescale(s->max_delay, PCR_TIME_BASE, AV_TIME_BASE);
-    } else {
-        /* Arbitrary values, PAT/PMT could be written on key frames */
-        ts->sdt_packet_period = 200;
-        ts->pat_packet_period = 40;
-        if (pcr_st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (!pcr_st->codec->frame_size) {
-                av_log(s, AV_LOG_WARNING, "frame size not set\n");
-                service->pcr_packet_period =
-                    pcr_st->codec->sample_rate/(10*512);
-            } else {
-                service->pcr_packet_period =
-                    pcr_st->codec->sample_rate/(10*pcr_st->codec->frame_size);
-            }
-        } else {
-            // max delta PCR 0.1s
-            service->pcr_packet_period =
-                pcr_st->codec->time_base.den/(10*pcr_st->codec->time_base.num);
-        }
-    }
-
-    // output a PCR as soon as possible
-    service->pcr_packet_count = service->pcr_packet_period;
-    ts->pat_packet_count = ts->pat_packet_period-1;
-    ts->sdt_packet_count = ts->sdt_packet_period-1;
-
-    if (ts->mux_rate == 1)
-        av_log(s, AV_LOG_VERBOSE, "muxrate VBR, ");
-    else
-        av_log(s, AV_LOG_VERBOSE, "muxrate %d, ", ts->mux_rate);
-    av_log(s, AV_LOG_VERBOSE, "pcr every %d pkts, "
-           "sdt every %d, pat/pmt every %d pkts\n",
-           service->pcr_packet_period,
-           ts->sdt_packet_period, ts->pat_packet_period);
-
-    avio_flush(s->pb);
-
-    return 0;
-
- fail:
-    av_free(pids);
-    for(i = 0;i < s->nb_streams; i++) {
-        MpegTSWriteStream *ts_st;
-        st = s->streams[i];
-        ts_st = st->priv_data;
-        if (ts_st) {
-            av_freep(&ts_st->payload);
-            if (ts_st->amux) {
-                avformat_free_context(ts_st->amux);
-                ts_st->amux = NULL;
-            }
-        }
-        av_freep(&st->priv_data);
-    }
-    return ret;
-}
-
-/* send SDT, PAT and PMT tables regulary */
-static void retransmit_si_info(AVFormatContext *s)
-{
-    MpegTSWrite *ts = s->priv_data;
-    int i;
-
-    if (++ts->sdt_packet_count == ts->sdt_packet_period) {
-        ts->sdt_packet_count = 0;
-        mpegts_write_sdt(s);
-    }
-    if (++ts->pat_packet_count == ts->pat_packet_period) {
-        ts->pat_packet_count = 0;
-        mpegts_write_pat(s);
-        for(i = 0; i < ts->nb_services; i++) {
-            mpegts_write_pmt(s, ts->services[i]);
-        }
-    }
-}
-
-static int64_t get_pcr(const MpegTSWrite *ts, AVIOContext *pb)
-{
-    return av_rescale(avio_tell(pb) + 11, 8 * PCR_TIME_BASE, ts->mux_rate) +
-           ts->first_pcr;
-}
-
-static int write_pcr_bits(uint8_t *buf, int64_t pcr)
-{
-    int64_t pcr_low = pcr % 300, pcr_high = pcr / 300;
-
-    *buf++ = pcr_high >> 25;
-    *buf++ = pcr_high >> 17;
-    *buf++ = pcr_high >> 9;
-    *buf++ = pcr_high >> 1;
-    *buf++ = pcr_high << 7 | pcr_low >> 8 | 0x7e;
-    *buf++ = pcr_low;
-
-    return 6;
-}
-
-/* Write a single null transport stream packet */
-static void mpegts_insert_null_packet(AVFormatContext *s)
-{
-    uint8_t *q;
-    uint8_t buf[TS_PACKET_SIZE];
-
-    q = buf;
-    *q++ = 0x47;
-    *q++ = 0x00 | 0x1f;
-    *q++ = 0xff;
-    *q++ = 0x10;
-    memset(q, 0x0FF, TS_PACKET_SIZE - (q - buf));
-    avio_write(s->pb, buf, TS_PACKET_SIZE);
-}
-
-/* Write a single transport stream packet with a PCR and no payload */
-static void mpegts_insert_pcr_only(AVFormatContext *s, AVStream *st)
-{
-    MpegTSWrite *ts = s->priv_data;
-    MpegTSWriteStream *ts_st = st->priv_data;
-    uint8_t *q;
-    uint8_t buf[TS_PACKET_SIZE];
-
-    q = buf;
-    *q++ = 0x47;
-    *q++ = ts_st->pid >> 8;
-    *q++ = ts_st->pid;
-    *q++ = 0x20 | ts_st->cc;   /* Adaptation only */
-    /* Continuity Count field does not increment (see 13818-1 section 2.4.3.3) */
-    *q++ = TS_PACKET_SIZE - 5; /* Adaptation Field Length */
-    *q++ = 0x10;               /* Adaptation flags: PCR present */
-
-    /* PCR coded into 6 bytes */
-    q += write_pcr_bits(q, get_pcr(ts, s->pb));
-
-    /* stuffing bytes */
-    memset(q, 0xFF, TS_PACKET_SIZE - (q - buf));
-    avio_write(s->pb, buf, TS_PACKET_SIZE);
-}
-
-static void write_pts(uint8_t *q, int fourbits, int64_t pts)
-{
-    int val;
-
-    val = fourbits << 4 | (((pts >> 30) & 0x07) << 1) | 1;
-    *q++ = val;
-    val = (((pts >> 15) & 0x7fff) << 1) | 1;
-    *q++ = val >> 8;
-    *q++ = val;
-    val = (((pts) & 0x7fff) << 1) | 1;
-    *q++ = val >> 8;
-    *q++ = val;
-}
-
-/* Set an adaptation field flag in an MPEG-TS packet*/
-static void set_af_flag(uint8_t *pkt, int flag)
-{
-    // expect at least one flag to set
-    assert(flag);
-
-    if ((pkt[3] & 0x20) == 0) {
-        // no AF yet, set adaptation field flag
-        pkt[3] |= 0x20;
-        // 1 byte length, no flags
-        pkt[4] = 1;
-        pkt[5] = 0;
-    }
-    pkt[5] |= flag;
-}
-
-/* Extend the adaptation field by size bytes */
-static void extend_af(uint8_t *pkt, int size)
-{
-    // expect already existing adaptation field
-    assert(pkt[3] & 0x20);
-    pkt[4] += size;
-}
-
-/* Get a pointer to MPEG-TS payload (right after TS packet header) */
-static uint8_t *get_ts_payload_start(uint8_t *pkt)
-{
-    if (pkt[3] & 0x20)
-        return pkt + 5 + pkt[4];
-    else
-        return pkt + 4;
-}
-
-/* Add a pes header to the front of payload, and segment into an integer number of
- * ts packets. The final ts packet is padded using an over-sized adaptation header
- * to exactly fill the last ts packet.
- * NOTE: 'payload' contains a complete PES payload.
- */
-static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
-                             const uint8_t *payload, int payload_size,
-                             int64_t pts, int64_t dts, int key)
-{
-    MpegTSWriteStream *ts_st = st->priv_data;
-    MpegTSWrite *ts = s->priv_data;
-    uint8_t buf[TS_PACKET_SIZE];
-    uint8_t *q;
-    int val, is_start, len, header_len, write_pcr, private_code, flags;
-    int afc_len, stuffing_len;
-    int64_t pcr = -1; /* avoid warning */
-    int64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE);
-
-    is_start = 1;
-    while (payload_size > 0) {
-        retransmit_si_info(s);
-
-        write_pcr = 0;
-        if (ts_st->pid == ts_st->service->pcr_pid) {
-            if (ts->mux_rate > 1 || is_start) // VBR pcr period is based on frames
-                ts_st->service->pcr_packet_count++;
-            if (ts_st->service->pcr_packet_count >=
-                ts_st->service->pcr_packet_period) {
-                ts_st->service->pcr_packet_count = 0;
-                write_pcr = 1;
-            }
-        }
-
-        if (ts->mux_rate > 1 && dts != AV_NOPTS_VALUE &&
-            (dts - get_pcr(ts, s->pb)/300) > delay) {
-            /* pcr insert gets priority over null packet insert */
-            if (write_pcr)
-                mpegts_insert_pcr_only(s, st);
-            else
-                mpegts_insert_null_packet(s);
-            continue; /* recalculate write_pcr and possibly retransmit si_info */
-        }
-
-        /* prepare packet header */
-        q = buf;
-        *q++ = 0x47;
-        val = (ts_st->pid >> 8);
-        if (is_start)
-            val |= 0x40;
-        *q++ = val;
-        *q++ = ts_st->pid;
-        ts_st->cc = (ts_st->cc + 1) & 0xf;
-        *q++ = 0x10 | ts_st->cc; // payload indicator + CC
-        if (key && is_start && pts != AV_NOPTS_VALUE) {
-            // set Random Access for key frames
-            if (ts_st->pid == ts_st->service->pcr_pid)
-                write_pcr = 1;
-            set_af_flag(buf, 0x40);
-            q = get_ts_payload_start(buf);
-        }
-        if (write_pcr) {
-            set_af_flag(buf, 0x10);
-            q = get_ts_payload_start(buf);
-            // add 11, pcr references the last byte of program clock reference base
-            if (ts->mux_rate > 1)
-                pcr = get_pcr(ts, s->pb);
-            else
-                pcr = (dts - delay)*300;
-            if (dts != AV_NOPTS_VALUE && dts < pcr / 300)
-                av_log(s, AV_LOG_WARNING, "dts < pcr, TS is invalid\n");
-            extend_af(buf, write_pcr_bits(q, pcr));
-            q = get_ts_payload_start(buf);
-        }
-        if (is_start) {
-            int pes_extension = 0;
-            /* write PES header */
-            *q++ = 0x00;
-            *q++ = 0x00;
-            *q++ = 0x01;
-            private_code = 0;
-            if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-                if (st->codec->codec_id == AV_CODEC_ID_DIRAC) {
-                    *q++ = 0xfd;
-                } else
-                    *q++ = 0xe0;
-            } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
-                       (st->codec->codec_id == AV_CODEC_ID_MP2 ||
-                        st->codec->codec_id == AV_CODEC_ID_MP3 ||
-                        st->codec->codec_id == AV_CODEC_ID_AAC)) {
-                *q++ = 0xc0;
-            } else {
-                *q++ = 0xbd;
-                if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-                    private_code = 0x20;
-                }
-            }
-            header_len = 0;
-            flags = 0;
-            if (pts != AV_NOPTS_VALUE) {
-                header_len += 5;
-                flags |= 0x80;
-            }
-            if (dts != AV_NOPTS_VALUE && pts != AV_NOPTS_VALUE && dts != pts) {
-                header_len += 5;
-                flags |= 0x40;
-            }
-            if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-                st->codec->codec_id == AV_CODEC_ID_DIRAC) {
-                /* set PES_extension_flag */
-                pes_extension = 1;
-                flags |= 0x01;
-
-                /*
-                * One byte for PES2 extension flag +
-                * one byte for extension length +
-                * one byte for extension id
-                */
-                header_len += 3;
-            }
-            len = payload_size + header_len + 3;
-            if (private_code != 0)
-                len++;
-            if (len > 0xffff)
-                len = 0;
-            *q++ = len >> 8;
-            *q++ = len;
-            val = 0x80;
-            /* data alignment indicator is required for subtitle data */
-            if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE)
-                val |= 0x04;
-            *q++ = val;
-            *q++ = flags;
-            *q++ = header_len;
-            if (pts != AV_NOPTS_VALUE) {
-                write_pts(q, flags >> 6, pts);
-                q += 5;
-            }
-            if (dts != AV_NOPTS_VALUE && pts != AV_NOPTS_VALUE && dts != pts) {
-                write_pts(q, 1, dts);
-                q += 5;
-            }
-            if (pes_extension && st->codec->codec_id == AV_CODEC_ID_DIRAC) {
-                flags = 0x01;  /* set PES_extension_flag_2 */
-                *q++ = flags;
-                *q++ = 0x80 | 0x01;  /* marker bit + extension length */
-                /*
-                * Set the stream id extension flag bit to 0 and
-                * write the extended stream id
-                */
-                *q++ = 0x00 | 0x60;
-            }
-            if (private_code != 0)
-                *q++ = private_code;
-            is_start = 0;
-        }
-        /* header size */
-        header_len = q - buf;
-        /* data len */
-        len = TS_PACKET_SIZE - header_len;
-        if (len > payload_size)
-            len = payload_size;
-        stuffing_len = TS_PACKET_SIZE - header_len - len;
-        if (stuffing_len > 0) {
-            /* add stuffing with AFC */
-            if (buf[3] & 0x20) {
-                /* stuffing already present: increase its size */
-                afc_len = buf[4] + 1;
-                memmove(buf + 4 + afc_len + stuffing_len,
-                        buf + 4 + afc_len,
-                        header_len - (4 + afc_len));
-                buf[4] += stuffing_len;
-                memset(buf + 4 + afc_len, 0xff, stuffing_len);
-            } else {
-                /* add stuffing */
-                memmove(buf + 4 + stuffing_len, buf + 4, header_len - 4);
-                buf[3] |= 0x20;
-                buf[4] = stuffing_len - 1;
-                if (stuffing_len >= 2) {
-                    buf[5] = 0x00;
-                    memset(buf + 6, 0xff, stuffing_len - 2);
-                }
-            }
-        }
-        memcpy(buf + TS_PACKET_SIZE - len, payload, len);
-        payload += len;
-        payload_size -= len;
-        avio_write(s->pb, buf, TS_PACKET_SIZE);
-    }
-    avio_flush(s->pb);
-}
-
-static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
-{
-    AVStream *st = s->streams[pkt->stream_index];
-    int size = pkt->size;
-    uint8_t *buf= pkt->data;
-    uint8_t *data= NULL;
-    MpegTSWrite *ts = s->priv_data;
-    MpegTSWriteStream *ts_st = st->priv_data;
-    const uint64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE)*2;
-    int64_t dts = AV_NOPTS_VALUE, pts = AV_NOPTS_VALUE;
-
-    if (ts->reemit_pat_pmt) {
-        av_log(s, AV_LOG_WARNING, "resend_headers option is deprecated, use -mpegts_flags resend_headers\n");
-        ts->reemit_pat_pmt = 0;
-        ts->flags |= MPEGTS_FLAG_REEMIT_PAT_PMT;
-    }
-
-    if (ts->flags & MPEGTS_FLAG_REEMIT_PAT_PMT) {
-        ts->pat_packet_count = ts->pat_packet_period - 1;
-        ts->sdt_packet_count = ts->sdt_packet_period - 1;
-        ts->flags &= ~MPEGTS_FLAG_REEMIT_PAT_PMT;
-    }
-
-    if (pkt->pts != AV_NOPTS_VALUE)
-        pts = pkt->pts + delay;
-    if (pkt->dts != AV_NOPTS_VALUE)
-        dts = pkt->dts + delay;
-
-    if (ts_st->first_pts_check && pts == AV_NOPTS_VALUE) {
-        av_log(s, AV_LOG_ERROR, "first pts value must set\n");
-        return AVERROR(EINVAL);
-    }
-    ts_st->first_pts_check = 0;
-
-    if (st->codec->codec_id == AV_CODEC_ID_H264) {
-        const uint8_t *p = buf, *buf_end = p+size;
-        uint32_t state = -1;
-
-        if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001) {
-            av_log(s, AV_LOG_ERROR, "H.264 bitstream malformed, "
-                   "no startcode found, use -bsf h264_mp4toannexb\n");
-            return AVERROR(EINVAL);
-        }
-
-        do {
-            p = avpriv_find_start_code(p, buf_end, &state);
-            av_dlog(s, "nal %d\n", state & 0x1f);
-        } while (p < buf_end && (state & 0x1f) != 9 &&
-                 (state & 0x1f) != 5 && (state & 0x1f) != 1);
-
-        if ((state & 0x1f) != 9) { // AUD NAL
-            data = av_malloc(pkt->size+6);
-            if (!data)
-                return AVERROR(ENOMEM);
-            memcpy(data+6, pkt->data, pkt->size);
-            AV_WB32(data, 0x00000001);
-            data[4] = 0x09;
-            data[5] = 0xf0; // any slice type (0xe) + rbsp stop one bit
-            buf  = data;
-            size = pkt->size+6;
-        }
-    } else if (st->codec->codec_id == AV_CODEC_ID_AAC) {
-        if (pkt->size < 2) {
-            av_log(s, AV_LOG_ERROR, "AAC packet too short\n");
-            return AVERROR(EINVAL);
-        }
-        if ((AV_RB16(pkt->data) & 0xfff0) != 0xfff0) {
-            int ret;
-            AVPacket pkt2;
-
-            if (!ts_st->amux) {
-                av_log(s, AV_LOG_ERROR, "AAC bitstream not in ADTS format "
-                       "and extradata missing\n");
-                return AVERROR(EINVAL);
-            }
-
-            av_init_packet(&pkt2);
-            pkt2.data = pkt->data;
-            pkt2.size = pkt->size;
-            ret = avio_open_dyn_buf(&ts_st->amux->pb);
-            if (ret < 0)
-                return AVERROR(ENOMEM);
-
-            ret = av_write_frame(ts_st->amux, &pkt2);
-            if (ret < 0) {
-                avio_close_dyn_buf(ts_st->amux->pb, &data);
-                ts_st->amux->pb = NULL;
-                av_free(data);
-                return ret;
-            }
-            size = avio_close_dyn_buf(ts_st->amux->pb, &data);
-            ts_st->amux->pb = NULL;
-            buf = data;
-        }
-    }
-
-    if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO) {
-        // for video and subtitle, write a single pes packet
-        mpegts_write_pes(s, st, buf, size, pts, dts, pkt->flags & AV_PKT_FLAG_KEY);
-        av_free(data);
-        return 0;
-    }
-
-    if (ts_st->payload_size + size > ts->pes_payload_size) {
-        if (ts_st->payload_size) {
-            mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_size,
-                             ts_st->payload_pts, ts_st->payload_dts,
-                             ts_st->payload_flags & AV_PKT_FLAG_KEY);
-            ts_st->payload_size = 0;
-        }
-        if (size > ts->pes_payload_size) {
-            mpegts_write_pes(s, st, buf, size, pts, dts,
-                             pkt->flags & AV_PKT_FLAG_KEY);
-            av_free(data);
-            return 0;
-        }
-    }
-
-    if (!ts_st->payload_size) {
-        ts_st->payload_pts = pts;
-        ts_st->payload_dts = dts;
-        ts_st->payload_flags = pkt->flags;
-    }
-
-    memcpy(ts_st->payload + ts_st->payload_size, buf, size);
-    ts_st->payload_size += size;
-
-    av_free(data);
-
-    return 0;
-}
-
-static void mpegts_write_flush(AVFormatContext *s)
-{
-    int i;
-
-    /* flush current packets */
-    for(i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        MpegTSWriteStream *ts_st = st->priv_data;
-        if (ts_st->payload_size > 0) {
-            mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_size,
-                             ts_st->payload_pts, ts_st->payload_dts,
-                             ts_st->payload_flags & AV_PKT_FLAG_KEY);
-            ts_st->payload_size = 0;
-        }
-    }
-    avio_flush(s->pb);
-}
-
-static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    if (!pkt) {
-        mpegts_write_flush(s);
-        return 1;
-    } else {
-        return mpegts_write_packet_internal(s, pkt);
-    }
-}
-
-static int mpegts_write_end(AVFormatContext *s)
-{
-    MpegTSWrite *ts = s->priv_data;
-    MpegTSService *service;
-    int i;
-
-    mpegts_write_flush(s);
-
-    for(i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        MpegTSWriteStream *ts_st = st->priv_data;
-        av_freep(&ts_st->payload);
-        if (ts_st->amux) {
-            avformat_free_context(ts_st->amux);
-            ts_st->amux = NULL;
-        }
-    }
-
-    for(i = 0; i < ts->nb_services; i++) {
-        service = ts->services[i];
-        av_freep(&service->provider_name);
-        av_freep(&service->name);
-        av_free(service);
-    }
-    av_free(ts->services);
-
-    return 0;
-}
-
-AVOutputFormat ff_mpegts_muxer = {
-    .name              = "mpegts",
-    .long_name         = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
-    .mime_type         = "video/x-mpegts",
-    .extensions        = "ts,m2t",
-    .priv_data_size    = sizeof(MpegTSWrite),
-    .audio_codec       = AV_CODEC_ID_MP2,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_header      = mpegts_write_header,
-    .write_packet      = mpegts_write_packet,
-    .write_trailer     = mpegts_write_end,
-    .flags             = AVFMT_ALLOW_FLUSH,
-    .priv_class        = &mpegts_muxer_class,
-};
diff --git a/deps/libav/libavformat/mpegvideodec.c b/deps/libav/libavformat/mpegvideodec.c
deleted file mode 100644
index 96b95a5..0000000
--- a/deps/libav/libavformat/mpegvideodec.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * RAW MPEG video demuxer
- * Copyright (c) 2002-2003 Fabrice Bellard
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawdec.h"
-
-#define SEQ_START_CODE          0x000001b3
-#define GOP_START_CODE          0x000001b8
-#define PICTURE_START_CODE      0x00000100
-#define SLICE_START_CODE        0x00000101
-#define PACK_START_CODE         0x000001ba
-#define VIDEO_ID                0x000001e0
-#define AUDIO_ID                0x000001c0
-
-static int mpegvideo_probe(AVProbeData *p)
-{
-    uint32_t code= -1;
-    int pic=0, seq=0, slice=0, pspack=0, pes=0;
-    int i;
-
-    for(i=0; i<p->buf_size; i++){
-        code = (code<<8) + p->buf[i];
-        if ((code & 0xffffff00) == 0x100) {
-            switch(code){
-            case     SEQ_START_CODE:   seq++; break;
-            case PICTURE_START_CODE:   pic++; break;
-            case   SLICE_START_CODE: slice++; break;
-            case    PACK_START_CODE: pspack++; break;
-            }
-            if     ((code & 0x1f0) == VIDEO_ID)   pes++;
-            else if((code & 0x1e0) == AUDIO_ID)   pes++;
-        }
-    }
-    if(seq && seq*9<=pic*10 && pic*9<=slice*10 && !pspack && !pes)
-        return pic>1 ? AVPROBE_SCORE_EXTENSION + 1 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg
-    return 0;
-}
-
-FF_DEF_RAWVIDEO_DEMUXER(mpegvideo, "raw MPEG video", mpegvideo_probe, NULL, AV_CODEC_ID_MPEG1VIDEO)
diff --git a/deps/libav/libavformat/mpjpeg.c b/deps/libav/libavformat/mpjpeg.c
deleted file mode 100644
index 2114189..0000000
--- a/deps/libav/libavformat/mpjpeg.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Multipart JPEG format
- * Copyright (c) 2000, 2001, 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avformat.h"
-
-/* Multipart JPEG */
-
-#define BOUNDARY_TAG "avserver"
-
-static int mpjpeg_write_header(AVFormatContext *s)
-{
-    uint8_t buf1[256];
-
-    snprintf(buf1, sizeof(buf1), "--%s\n", BOUNDARY_TAG);
-    avio_write(s->pb, buf1, strlen(buf1));
-    avio_flush(s->pb);
-    return 0;
-}
-
-static int mpjpeg_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    uint8_t buf1[256];
-
-    snprintf(buf1, sizeof(buf1), "Content-type: image/jpeg\n\n");
-    avio_write(s->pb, buf1, strlen(buf1));
-    avio_write(s->pb, pkt->data, pkt->size);
-
-    snprintf(buf1, sizeof(buf1), "\n--%s\n", BOUNDARY_TAG);
-    avio_write(s->pb, buf1, strlen(buf1));
-    return 0;
-}
-
-static int mpjpeg_write_trailer(AVFormatContext *s)
-{
-    return 0;
-}
-
-AVOutputFormat ff_mpjpeg_muxer = {
-    .name              = "mpjpeg",
-    .long_name         = NULL_IF_CONFIG_SMALL("MIME multipart JPEG"),
-    .mime_type         = "multipart/x-mixed-replace;boundary=" BOUNDARY_TAG,
-    .extensions        = "mjpg",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MJPEG,
-    .write_header      = mpjpeg_write_header,
-    .write_packet      = mpjpeg_write_packet,
-    .write_trailer     = mpjpeg_write_trailer,
-};
diff --git a/deps/libav/libavformat/msnwc_tcp.c b/deps/libav/libavformat/msnwc_tcp.c
deleted file mode 100644
index b6d30fe..0000000
--- a/deps/libav/libavformat/msnwc_tcp.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2008  Ramiro Polla
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define HEADER_SIZE         24
-
-/*
- * Header structure:
- *  uint16_t    ss;     // struct size
- *  uint16_t    width;  // frame width
- *  uint16_t    height; // frame height
- *  uint16_t    ff;     // keyframe + some other info(???)
- *  uint32_t    size;   // size of data
- *  uint32_t    fourcc; // ML20
- *  uint32_t    u3;     // ?
- *  uint32_t    ts;     // time
- */
-
-static int msnwc_tcp_probe(AVProbeData *p)
-{
-    int i;
-
-    for(i = 0 ; i + HEADER_SIZE <= p->buf_size ; i++) {
-        uint16_t width, height;
-        uint32_t fourcc;
-        const uint8_t *bytestream = p->buf+i;
-
-        if(bytestream_get_le16(&bytestream) != HEADER_SIZE)
-            continue;
-        width  = bytestream_get_le16(&bytestream);
-        height = bytestream_get_le16(&bytestream);
-        if(!(width==320 && height==240) && !(width==160 && height==120))
-            continue;
-        bytestream += 2; // keyframe
-        bytestream += 4; // size
-        fourcc = bytestream_get_le32(&bytestream);
-        if(fourcc != MKTAG('M', 'L', '2', '0'))
-            continue;
-
-        if(i) {
-            if(i < 14)  /* starts with SwitchBoard connection info */
-                return AVPROBE_SCORE_MAX / 2;
-            else        /* starts in the middle of stream */
-                return AVPROBE_SCORE_MAX / 3;
-        } else {
-            return AVPROBE_SCORE_MAX;
-        }
-    }
-
-    return -1;
-}
-
-static int msnwc_tcp_read_header(AVFormatContext *ctx)
-{
-    AVIOContext *pb = ctx->pb;
-    AVCodecContext *codec;
-    AVStream *st;
-
-    st = avformat_new_stream(ctx, NULL);
-    if(!st)
-        return AVERROR(ENOMEM);
-
-    codec = st->codec;
-    codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    codec->codec_id = AV_CODEC_ID_MIMIC;
-    codec->codec_tag = MKTAG('M', 'L', '2', '0');
-
-    avpriv_set_pts_info(st, 32, 1, 1000);
-
-    /* Some files start with "connected\r\n\r\n".
-     * So skip until we find the first byte of struct size */
-    while(avio_r8(pb) != HEADER_SIZE && !pb->eof_reached);
-
-    if(pb->eof_reached) {
-        av_log(ctx, AV_LOG_ERROR, "Could not find valid start.");
-        return -1;
-    }
-
-    return 0;
-}
-
-static int msnwc_tcp_read_packet(AVFormatContext *ctx, AVPacket *pkt)
-{
-    AVIOContext *pb = ctx->pb;
-    uint16_t keyframe;
-    uint32_t size, timestamp;
-
-    avio_skip(pb, 1); /* one byte has been read ahead */
-    avio_skip(pb, 2);
-    avio_skip(pb, 2);
-    keyframe = avio_rl16(pb);
-    size = avio_rl32(pb);
-    avio_skip(pb, 4);
-    avio_skip(pb, 4);
-    timestamp = avio_rl32(pb);
-
-    if(!size || av_get_packet(pb, pkt, size) != size)
-        return -1;
-
-    avio_skip(pb, 1); /* Read ahead one byte of struct size like read_header */
-
-    pkt->pts = timestamp;
-    pkt->dts = timestamp;
-    pkt->stream_index = 0;
-
-    /* Some aMsn generated videos (or was it Mercury Messenger?) don't set
-     * this bit and rely on the codec to get keyframe information */
-    if(keyframe&1)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-
-    return HEADER_SIZE + size;
-}
-
-AVInputFormat ff_msnwc_tcp_demuxer = {
-    .name           = "msnwctcp",
-    .long_name      = NULL_IF_CONFIG_SMALL("MSN TCP Webcam stream"),
-    .read_probe     = msnwc_tcp_probe,
-    .read_header    = msnwc_tcp_read_header,
-    .read_packet    = msnwc_tcp_read_packet,
-};
diff --git a/deps/libav/libavformat/mtv.c b/deps/libav/libavformat/mtv.c
deleted file mode 100644
index ed250bc..0000000
--- a/deps/libav/libavformat/mtv.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * mtv demuxer
- * Copyright (c) 2006 Reynaldo H. Verdejo Pinochet
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * MTV demuxer.
- */
-
-#include "libavutil/bswap.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define MTV_ASUBCHUNK_DATA_SIZE 500
-#define MTV_HEADER_SIZE 512
-#define MTV_AUDIO_PADDING_SIZE 12
-#define AUDIO_SAMPLING_RATE 44100
-
-typedef struct MTVDemuxContext {
-
-    unsigned int file_size;         ///< filesize, not always right
-    unsigned int segments;          ///< number of 512 byte segments
-    unsigned int audio_identifier;  ///< 'MP3' on all files I have seen
-    unsigned int audio_br;          ///< bitrate of audio channel (mp3)
-    unsigned int img_colorfmt;      ///< frame colorfmt rgb 565/555
-    unsigned int img_bpp;           ///< frame bits per pixel
-    unsigned int img_width;         //
-    unsigned int img_height;        //
-    unsigned int img_segment_size;  ///< size of image segment
-    unsigned int video_fps;         //
-    unsigned int full_segment_size;
-
-} MTVDemuxContext;
-
-static int mtv_probe(AVProbeData *p)
-{
-    /* Magic is 'AMV' */
-    if (*p->buf != 'A' || *(p->buf + 1) != 'M' || *(p->buf + 2) != 'V')
-        return 0;
-
-    /* Check for nonzero in bpp and (width|height) header fields */
-    if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54])))
-        return 0;
-
-    /* If width or height are 0 then imagesize header field should not */
-    if(!AV_RL16(&p->buf[52]) || !AV_RL16(&p->buf[54]))
-    {
-        if(!!AV_RL16(&p->buf[56]))
-            return AVPROBE_SCORE_EXTENSION;
-        else
-            return 0;
-    }
-
-    if(p->buf[51] != 16)
-        return AVPROBE_SCORE_EXTENSION / 2; // But we are going to assume 16bpp anyway ..
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int mtv_read_header(AVFormatContext *s)
-{
-    MTVDemuxContext *mtv = s->priv_data;
-    AVIOContext   *pb  = s->pb;
-    AVStream        *st;
-    unsigned int    audio_subsegments;
-
-    avio_skip(pb, 3);
-    mtv->file_size         = avio_rl32(pb);
-    mtv->segments          = avio_rl32(pb);
-    avio_skip(pb, 32);
-    mtv->audio_identifier  = avio_rl24(pb);
-    mtv->audio_br          = avio_rl16(pb);
-    mtv->img_colorfmt      = avio_rl24(pb);
-    mtv->img_bpp           = avio_r8(pb);
-    mtv->img_width         = avio_rl16(pb);
-    mtv->img_height        = avio_rl16(pb);
-    mtv->img_segment_size  = avio_rl16(pb);
-
-    /* Calculate width and height if missing from header */
-
-    if(!mtv->img_width)
-        mtv->img_width=mtv->img_segment_size / (mtv->img_bpp>>3)
-                        / mtv->img_height;
-
-    if(!mtv->img_height)
-        mtv->img_height=mtv->img_segment_size / (mtv->img_bpp>>3)
-                        / mtv->img_width;
-
-    avio_skip(pb, 4);
-    audio_subsegments = avio_rl16(pb);
-
-    if (audio_subsegments == 0) {
-        avpriv_request_sample(s, "MTV files without audio");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    mtv->full_segment_size =
-        audio_subsegments * (MTV_AUDIO_PADDING_SIZE + MTV_ASUBCHUNK_DATA_SIZE) +
-        mtv->img_segment_size;
-    mtv->video_fps         = (mtv->audio_br / 4) / audio_subsegments;
-
-    // FIXME Add sanity check here
-
-    // all systems go! init decoders
-
-    // video - raw rgb565
-
-    st = avformat_new_stream(s, NULL);
-    if(!st)
-        return AVERROR(ENOMEM);
-
-    avpriv_set_pts_info(st, 64, 1, mtv->video_fps);
-    st->codec->codec_type      = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id        = AV_CODEC_ID_RAWVIDEO;
-    st->codec->pix_fmt         = AV_PIX_FMT_RGB565BE;
-    st->codec->width           = mtv->img_width;
-    st->codec->height          = mtv->img_height;
-    st->codec->sample_rate     = mtv->video_fps;
-    st->codec->extradata       = av_strdup("BottomUp");
-    st->codec->extradata_size  = 9;
-
-    // audio - mp3
-
-    st = avformat_new_stream(s, NULL);
-    if(!st)
-        return AVERROR(ENOMEM);
-
-    avpriv_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE);
-    st->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id        = AV_CODEC_ID_MP3;
-    st->codec->bit_rate        = mtv->audio_br;
-    st->need_parsing           = AVSTREAM_PARSE_FULL;
-
-    // Jump over header
-
-    if(avio_seek(pb, MTV_HEADER_SIZE, SEEK_SET) != MTV_HEADER_SIZE)
-        return AVERROR(EIO);
-
-    return 0;
-
-}
-
-static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MTVDemuxContext *mtv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret;
-
-    if((avio_tell(pb) - s->data_offset + mtv->img_segment_size) % mtv->full_segment_size)
-    {
-        avio_skip(pb, MTV_AUDIO_PADDING_SIZE);
-
-        ret = av_get_packet(pb, pkt, MTV_ASUBCHUNK_DATA_SIZE);
-        if(ret < 0)
-            return ret;
-
-        pkt->pos -= MTV_AUDIO_PADDING_SIZE;
-        pkt->stream_index = 1;
-
-    }else
-    {
-        ret = av_get_packet(pb, pkt, mtv->img_segment_size);
-        if(ret < 0)
-            return ret;
-
-        pkt->stream_index = 0;
-    }
-
-    return ret;
-}
-
-AVInputFormat ff_mtv_demuxer = {
-    .name           = "mtv",
-    .long_name      = NULL_IF_CONFIG_SMALL("MTV"),
-    .priv_data_size = sizeof(MTVDemuxContext),
-    .read_probe     = mtv_probe,
-    .read_header    = mtv_read_header,
-    .read_packet    = mtv_read_packet,
-};
diff --git a/deps/libav/libavformat/mux.c b/deps/libav/libavformat/mux.c
deleted file mode 100644
index 59f9c42..0000000
--- a/deps/libav/libavformat/mux.c
+++ /dev/null
@@ -1,727 +0,0 @@
-/*
- * muxing functions for use within Libav
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "libavcodec/internal.h"
-#include "libavcodec/bytestream.h"
-#include "libavutil/opt.h"
-#include "libavutil/dict.h"
-#include "libavutil/pixdesc.h"
-#include "metadata.h"
-#include "id3v2.h"
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/time.h"
-#include "riff.h"
-#include "audiointerleave.h"
-#include "url.h"
-#include <stdarg.h>
-#if CONFIG_NETWORK
-#include "network.h"
-#endif
-
-#undef NDEBUG
-#include <assert.h>
-
-/**
- * @file
- * muxing functions for use within Libav
- */
-
-/* fraction handling */
-
-/**
- * f = val + (num / den) + 0.5.
- *
- * 'num' is normalized so that it is such as 0 <= num < den.
- *
- * @param f fractional number
- * @param val integer value
- * @param num must be >= 0
- * @param den must be >= 1
- */
-static void frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
-{
-    num += (den >> 1);
-    if (num >= den) {
-        val += num / den;
-        num  = num % den;
-    }
-    f->val = val;
-    f->num = num;
-    f->den = den;
-}
-
-/**
- * Fractional addition to f: f = f + (incr / f->den).
- *
- * @param f fractional number
- * @param incr increment, can be positive or negative
- */
-static void frac_add(AVFrac *f, int64_t incr)
-{
-    int64_t num, den;
-
-    num = f->num + incr;
-    den = f->den;
-    if (num < 0) {
-        f->val += num / den;
-        num     = num % den;
-        if (num < 0) {
-            num += den;
-            f->val--;
-        }
-    } else if (num >= den) {
-        f->val += num / den;
-        num     = num % den;
-    }
-    f->num = num;
-}
-
-static int validate_codec_tag(AVFormatContext *s, AVStream *st)
-{
-    const AVCodecTag *avctag;
-    int n;
-    enum AVCodecID id = AV_CODEC_ID_NONE;
-    unsigned int tag  = 0;
-
-    /**
-     * Check that tag + id is in the table
-     * If neither is in the table -> OK
-     * If tag is in the table with another id -> FAIL
-     * If id is in the table with another tag -> FAIL unless strict < normal
-     */
-    for (n = 0; s->oformat->codec_tag[n]; n++) {
-        avctag = s->oformat->codec_tag[n];
-        while (avctag->id != AV_CODEC_ID_NONE) {
-            if (avpriv_toupper4(avctag->tag) == avpriv_toupper4(st->codec->codec_tag)) {
-                id = avctag->id;
-                if (id == st->codec->codec_id)
-                    return 1;
-            }
-            if (avctag->id == st->codec->codec_id)
-                tag = avctag->tag;
-            avctag++;
-        }
-    }
-    if (id != AV_CODEC_ID_NONE)
-        return 0;
-    if (tag && (st->codec->strict_std_compliance >= FF_COMPLIANCE_NORMAL))
-        return 0;
-    return 1;
-}
-
-
-static int init_muxer(AVFormatContext *s, AVDictionary **options)
-{
-    int ret = 0, i;
-    AVStream *st;
-    AVDictionary *tmp = NULL;
-    AVCodecContext *codec = NULL;
-    AVOutputFormat *of = s->oformat;
-
-    if (options)
-        av_dict_copy(&tmp, *options, 0);
-
-    if ((ret = av_opt_set_dict(s, &tmp)) < 0)
-        goto fail;
-
-    // some sanity checks
-    if (s->nb_streams == 0 && !(of->flags & AVFMT_NOSTREAMS)) {
-        av_log(s, AV_LOG_ERROR, "no streams\n");
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        st    = s->streams[i];
-        codec = st->codec;
-
-        switch (codec->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            if (codec->sample_rate <= 0) {
-                av_log(s, AV_LOG_ERROR, "sample rate not set\n");
-                ret = AVERROR(EINVAL);
-                goto fail;
-            }
-            if (!codec->block_align)
-                codec->block_align = codec->channels *
-                                     av_get_bits_per_sample(codec->codec_id) >> 3;
-            break;
-        case AVMEDIA_TYPE_VIDEO:
-            if (codec->time_base.num <= 0 ||
-                codec->time_base.den <= 0) { //FIXME audio too?
-                av_log(s, AV_LOG_ERROR, "time base not set\n");
-                ret = AVERROR(EINVAL);
-                goto fail;
-            }
-
-            if ((codec->width <= 0 || codec->height <= 0) &&
-                !(of->flags & AVFMT_NODIMENSIONS)) {
-                av_log(s, AV_LOG_ERROR, "dimensions not set\n");
-                ret = AVERROR(EINVAL);
-                goto fail;
-            }
-
-            if (av_cmp_q(st->sample_aspect_ratio,
-                         codec->sample_aspect_ratio)) {
-                if (st->sample_aspect_ratio.num != 0 &&
-                    st->sample_aspect_ratio.den != 0 &&
-                    codec->sample_aspect_ratio.den != 0 &&
-                    codec->sample_aspect_ratio.den != 0) {
-                    av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between muxer "
-                            "(%d/%d) and encoder layer (%d/%d)\n",
-                            st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
-                            codec->sample_aspect_ratio.num,
-                            codec->sample_aspect_ratio.den);
-                    ret = AVERROR(EINVAL);
-                    goto fail;
-                }
-            }
-            break;
-        }
-
-        if (of->codec_tag) {
-            if (codec->codec_tag &&
-                codec->codec_id == AV_CODEC_ID_RAWVIDEO &&
-                !av_codec_get_tag(of->codec_tag, codec->codec_id) &&
-                !validate_codec_tag(s, st)) {
-                // the current rawvideo encoding system ends up setting
-                // the wrong codec_tag for avi, we override it here
-                codec->codec_tag = 0;
-            }
-            if (codec->codec_tag) {
-                if (!validate_codec_tag(s, st)) {
-                    char tagbuf[32];
-                    av_get_codec_tag_string(tagbuf, sizeof(tagbuf), codec->codec_tag);
-                    av_log(s, AV_LOG_ERROR,
-                           "Tag %s/0x%08x incompatible with output codec id '%d'\n",
-                           tagbuf, codec->codec_tag, codec->codec_id);
-                    ret = AVERROR_INVALIDDATA;
-                    goto fail;
-                }
-            } else
-                codec->codec_tag = av_codec_get_tag(of->codec_tag, codec->codec_id);
-        }
-
-        if (of->flags & AVFMT_GLOBALHEADER &&
-            !(codec->flags & CODEC_FLAG_GLOBAL_HEADER))
-            av_log(s, AV_LOG_WARNING,
-                   "Codec for stream %d does not use global headers "
-                   "but container format requires global headers\n", i);
-
-        if (codec->codec_type != AVMEDIA_TYPE_ATTACHMENT)
-            s->internal->nb_interleaved_streams++;
-    }
-
-    if (!s->priv_data && of->priv_data_size > 0) {
-        s->priv_data = av_mallocz(of->priv_data_size);
-        if (!s->priv_data) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        if (of->priv_class) {
-            *(const AVClass **)s->priv_data = of->priv_class;
-            av_opt_set_defaults(s->priv_data);
-            if ((ret = av_opt_set_dict(s->priv_data, &tmp)) < 0)
-                goto fail;
-        }
-    }
-
-    /* set muxer identification string */
-    if (s->nb_streams && !(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
-        av_dict_set(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0);
-    }
-
-    if (options) {
-         av_dict_free(options);
-         *options = tmp;
-    }
-
-    return 0;
-
-fail:
-    av_dict_free(&tmp);
-    return ret;
-}
-
-static int init_pts(AVFormatContext *s)
-{
-    int i;
-    AVStream *st;
-
-    /* init PTS generation */
-    for (i = 0; i < s->nb_streams; i++) {
-        int64_t den = AV_NOPTS_VALUE;
-        st = s->streams[i];
-
-        switch (st->codec->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            den = (int64_t)st->time_base.num * st->codec->sample_rate;
-            break;
-        case AVMEDIA_TYPE_VIDEO:
-            den = (int64_t)st->time_base.num * st->codec->time_base.den;
-            break;
-        default:
-            break;
-        }
-        if (den != AV_NOPTS_VALUE) {
-            if (den <= 0)
-                return AVERROR_INVALIDDATA;
-
-            frac_init(&st->pts, 0, 0, den);
-        }
-    }
-
-    return 0;
-}
-
-int avformat_write_header(AVFormatContext *s, AVDictionary **options)
-{
-    int ret = 0;
-
-    if (ret = init_muxer(s, options))
-        return ret;
-
-    if (s->oformat->write_header) {
-        ret = s->oformat->write_header(s);
-        if (ret < 0)
-            return ret;
-    }
-
-    if ((ret = init_pts(s)) < 0)
-        return ret;
-
-    return 0;
-}
-
-//FIXME merge with compute_pkt_fields
-static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
-{
-    int delay = FFMAX(st->codec->has_b_frames, !!st->codec->max_b_frames);
-    int num, den, frame_size, i;
-
-    av_dlog(s, "compute_pkt_fields2: pts:%" PRId64 " dts:%" PRId64 " cur_dts:%" PRId64 " b:%d size:%d st:%d\n",
-            pkt->pts, pkt->dts, st->cur_dts, delay, pkt->size, pkt->stream_index);
-
-/*    if(pkt->pts == AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE)
- *      return AVERROR(EINVAL);*/
-
-    /* duration field */
-    if (pkt->duration == 0) {
-        ff_compute_frame_duration(&num, &den, st, NULL, pkt);
-        if (den && num) {
-            pkt->duration = av_rescale(1, num * (int64_t)st->time_base.den * st->codec->ticks_per_frame, den * (int64_t)st->time_base.num);
-        }
-    }
-
-    if (pkt->pts == AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE && delay == 0)
-        pkt->pts = pkt->dts;
-
-    //XXX/FIXME this is a temporary hack until all encoders output pts
-    if ((pkt->pts == 0 || pkt->pts == AV_NOPTS_VALUE) && pkt->dts == AV_NOPTS_VALUE && !delay) {
-        pkt->dts =
-//        pkt->pts= st->cur_dts;
-            pkt->pts = st->pts.val;
-    }
-
-    //calculate dts from pts
-    if (pkt->pts != AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY) {
-        st->pts_buffer[0] = pkt->pts;
-        for (i = 1; i < delay + 1 && st->pts_buffer[i] == AV_NOPTS_VALUE; i++)
-            st->pts_buffer[i] = pkt->pts + (i - delay - 1) * pkt->duration;
-        for (i = 0; i<delay && st->pts_buffer[i] > st->pts_buffer[i + 1]; i++)
-            FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i + 1]);
-
-        pkt->dts = st->pts_buffer[0];
-    }
-
-    if (st->cur_dts && st->cur_dts != AV_NOPTS_VALUE &&
-        ((!(s->oformat->flags & AVFMT_TS_NONSTRICT) &&
-          st->cur_dts >= pkt->dts) || st->cur_dts > pkt->dts)) {
-        av_log(s, AV_LOG_ERROR,
-               "Application provided invalid, non monotonically increasing dts to muxer in stream %d: %" PRId64 " >= %" PRId64 "\n",
-               st->index, st->cur_dts, pkt->dts);
-        return AVERROR(EINVAL);
-    }
-    if (pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts < pkt->dts) {
-        av_log(s, AV_LOG_ERROR, "pts < dts in stream %d\n", st->index);
-        return AVERROR(EINVAL);
-    }
-
-    av_dlog(s, "av_write_frame: pts2:%"PRId64" dts2:%"PRId64"\n",
-            pkt->pts, pkt->dts);
-    st->cur_dts = pkt->dts;
-    st->pts.val = pkt->dts;
-
-    /* update pts */
-    switch (st->codec->codec_type) {
-    case AVMEDIA_TYPE_AUDIO:
-        frame_size = ff_get_audio_frame_size(st->codec, pkt->size, 1);
-
-        /* HACK/FIXME, we skip the initial 0 size packets as they are most
-         * likely equal to the encoder delay, but it would be better if we
-         * had the real timestamps from the encoder */
-        if (frame_size >= 0 && (pkt->size || st->pts.num != st->pts.den >> 1 || st->pts.val)) {
-            frac_add(&st->pts, (int64_t)st->time_base.den * frame_size);
-        }
-        break;
-    case AVMEDIA_TYPE_VIDEO:
-        frac_add(&st->pts, (int64_t)st->time_base.den * st->codec->time_base.num);
-        break;
-    default:
-        break;
-    }
-    return 0;
-}
-
-/*
- * FIXME: this function should NEVER get undefined pts/dts beside when the
- * AVFMT_NOTIMESTAMPS is set.
- * Those additional safety checks should be dropped once the correct checks
- * are set in the callers.
- */
-
-static int write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret;
-    if (!(s->oformat->flags & (AVFMT_TS_NEGATIVE | AVFMT_NOTIMESTAMPS))) {
-        AVRational time_base = s->streams[pkt->stream_index]->time_base;
-        int64_t offset = 0;
-
-        if (!s->offset && pkt->dts != AV_NOPTS_VALUE && pkt->dts < 0) {
-            s->offset = -pkt->dts;
-            s->offset_timebase = time_base;
-        }
-        if (s->offset)
-            offset = av_rescale_q(s->offset, s->offset_timebase, time_base);
-
-        if (pkt->dts != AV_NOPTS_VALUE)
-            pkt->dts += offset;
-        if (pkt->pts != AV_NOPTS_VALUE)
-            pkt->pts += offset;
-    }
-    ret = s->oformat->write_packet(s, pkt);
-
-    if (s->pb && ret >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
-        avio_flush(s->pb);
-
-    return ret;
-}
-
-static int check_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    if (!pkt)
-        return 0;
-
-    if (pkt->stream_index < 0 || pkt->stream_index >= s->nb_streams) {
-        av_log(s, AV_LOG_ERROR, "Invalid packet stream index: %d\n",
-               pkt->stream_index);
-        return AVERROR(EINVAL);
-    }
-
-    if (s->streams[pkt->stream_index]->codec->codec_type == AVMEDIA_TYPE_ATTACHMENT) {
-        av_log(s, AV_LOG_ERROR, "Received a packet for an attachment stream.\n");
-        return AVERROR(EINVAL);
-    }
-
-    return 0;
-}
-
-int av_write_frame(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret;
-
-    ret = check_packet(s, pkt);
-    if (ret < 0)
-        return ret;
-
-    if (!pkt) {
-        if (s->oformat->flags & AVFMT_ALLOW_FLUSH)
-            return s->oformat->write_packet(s, pkt);
-        return 1;
-    }
-
-    ret = compute_pkt_fields2(s, s->streams[pkt->stream_index], pkt);
-
-    if (ret < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
-        return ret;
-
-    ret = write_packet(s, pkt);
-
-    if (ret >= 0)
-        s->streams[pkt->stream_index]->nb_frames++;
-    return ret;
-}
-
-void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
-                              int (*compare)(AVFormatContext *, AVPacket *, AVPacket *))
-{
-    AVPacketList **next_point, *this_pktl;
-
-    this_pktl      = av_mallocz(sizeof(AVPacketList));
-    this_pktl->pkt = *pkt;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-    pkt->destruct  = NULL;           // do not free original but only the copy
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-    pkt->buf       = NULL;
-    av_dup_packet(&this_pktl->pkt);  // duplicate the packet if it uses non-alloced memory
-
-    if (s->streams[pkt->stream_index]->last_in_packet_buffer) {
-        next_point = &(s->streams[pkt->stream_index]->last_in_packet_buffer->next);
-    } else
-        next_point = &s->packet_buffer;
-
-    if (*next_point) {
-        if (compare(s, &s->packet_buffer_end->pkt, pkt)) {
-            while (!compare(s, &(*next_point)->pkt, pkt))
-                next_point = &(*next_point)->next;
-            goto next_non_null;
-        } else {
-            next_point = &(s->packet_buffer_end->next);
-        }
-    }
-    assert(!*next_point);
-
-    s->packet_buffer_end = this_pktl;
-next_non_null:
-
-    this_pktl->next = *next_point;
-
-    s->streams[pkt->stream_index]->last_in_packet_buffer =
-        *next_point                                      = this_pktl;
-}
-
-static int interleave_compare_dts(AVFormatContext *s, AVPacket *next,
-                                  AVPacket *pkt)
-{
-    AVStream *st  = s->streams[pkt->stream_index];
-    AVStream *st2 = s->streams[next->stream_index];
-    int comp      = av_compare_ts(next->dts, st2->time_base, pkt->dts,
-                                  st->time_base);
-
-    if (comp == 0)
-        return pkt->stream_index < next->stream_index;
-    return comp > 0;
-}
-
-int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
-                                 AVPacket *pkt, int flush)
-{
-    AVPacketList *pktl;
-    int stream_count = 0;
-    int i;
-
-    if (pkt) {
-        ff_interleave_add_packet(s, pkt, interleave_compare_dts);
-    }
-
-    if (s->max_interleave_delta > 0 && s->packet_buffer && !flush) {
-        AVPacket *top_pkt = &s->packet_buffer->pkt;
-        int64_t delta_dts = INT64_MIN;
-        int64_t top_dts = av_rescale_q(top_pkt->dts,
-                                       s->streams[top_pkt->stream_index]->time_base,
-                                       AV_TIME_BASE_Q);
-
-        for (i = 0; i < s->nb_streams; i++) {
-            int64_t last_dts;
-            const AVPacketList *last = s->streams[i]->last_in_packet_buffer;
-
-            if (!last)
-                continue;
-
-            last_dts = av_rescale_q(last->pkt.dts,
-                                    s->streams[i]->time_base,
-                                    AV_TIME_BASE_Q);
-            delta_dts = FFMAX(delta_dts, last_dts - top_dts);
-            stream_count++;
-        }
-
-        if (delta_dts > s->max_interleave_delta) {
-            av_log(s, AV_LOG_DEBUG,
-                   "Delay between the first packet and last packet in the "
-                   "muxing queue is %"PRId64" > %"PRId64": forcing output\n",
-                   delta_dts, s->max_interleave_delta);
-            flush = 1;
-        }
-    } else {
-        for (i = 0; i < s->nb_streams; i++)
-            stream_count += !!s->streams[i]->last_in_packet_buffer;
-    }
-
-
-    if (stream_count && (s->internal->nb_interleaved_streams == stream_count || flush)) {
-        pktl = s->packet_buffer;
-        *out = pktl->pkt;
-
-        s->packet_buffer = pktl->next;
-        if (!s->packet_buffer)
-            s->packet_buffer_end = NULL;
-
-        if (s->streams[out->stream_index]->last_in_packet_buffer == pktl)
-            s->streams[out->stream_index]->last_in_packet_buffer = NULL;
-        av_freep(&pktl);
-        return 1;
-    } else {
-        av_init_packet(out);
-        return 0;
-    }
-}
-
-/**
- * Interleave an AVPacket correctly so it can be muxed.
- * @param out the interleaved packet will be output here
- * @param in the input packet
- * @param flush 1 if no further packets are available as input and all
- *              remaining packets should be output
- * @return 1 if a packet was output, 0 if no packet could be output,
- *         < 0 if an error occurred
- */
-static int interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, int flush)
-{
-    if (s->oformat->interleave_packet) {
-        int ret = s->oformat->interleave_packet(s, out, in, flush);
-        if (in)
-            av_free_packet(in);
-        return ret;
-    } else
-        return ff_interleave_packet_per_dts(s, out, in, flush);
-}
-
-int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, flush = 0;
-
-    ret = check_packet(s, pkt);
-    if (ret < 0)
-        goto fail;
-
-    if (pkt) {
-        AVStream *st = s->streams[pkt->stream_index];
-
-        //FIXME/XXX/HACK drop zero sized packets
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && pkt->size == 0) {
-            ret = 0;
-            goto fail;
-        }
-
-        av_dlog(s, "av_interleaved_write_frame size:%d dts:%" PRId64 " pts:%" PRId64 "\n",
-                pkt->size, pkt->dts, pkt->pts);
-        if ((ret = compute_pkt_fields2(s, st, pkt)) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
-            goto fail;
-
-        if (pkt->dts == AV_NOPTS_VALUE && !(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-    } else {
-        av_dlog(s, "av_interleaved_write_frame FLUSH\n");
-        flush = 1;
-    }
-
-    for (;; ) {
-        AVPacket opkt;
-        int ret = interleave_packet(s, &opkt, pkt, flush);
-        if (pkt) {
-            memset(pkt, 0, sizeof(*pkt));
-            av_init_packet(pkt);
-            pkt = NULL;
-        }
-        if (ret <= 0) //FIXME cleanup needed for ret<0 ?
-            return ret;
-
-        ret = write_packet(s, &opkt);
-        if (ret >= 0)
-            s->streams[opkt.stream_index]->nb_frames++;
-
-        av_free_packet(&opkt);
-
-        if (ret < 0)
-            return ret;
-    }
-fail:
-    av_packet_unref(pkt);
-    return ret;
-}
-
-int av_write_trailer(AVFormatContext *s)
-{
-    int ret, i;
-
-    for (;; ) {
-        AVPacket pkt;
-        ret = interleave_packet(s, &pkt, NULL, 1);
-        if (ret < 0) //FIXME cleanup needed for ret<0 ?
-            goto fail;
-        if (!ret)
-            break;
-
-        ret = write_packet(s, &pkt);
-        if (ret >= 0)
-            s->streams[pkt.stream_index]->nb_frames++;
-
-        av_free_packet(&pkt);
-
-        if (ret < 0)
-            goto fail;
-    }
-
-    if (s->oformat->write_trailer)
-        ret = s->oformat->write_trailer(s);
-
-    if (!(s->oformat->flags & AVFMT_NOFILE))
-        avio_flush(s->pb);
-
-fail:
-    for (i = 0; i < s->nb_streams; i++) {
-        av_freep(&s->streams[i]->priv_data);
-        av_freep(&s->streams[i]->index_entries);
-    }
-    if (s->oformat->priv_class)
-        av_opt_free(s->priv_data);
-    av_freep(&s->priv_data);
-    return ret;
-}
-
-int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
-                     AVFormatContext *src)
-{
-    AVPacket local_pkt;
-
-    local_pkt = *pkt;
-    local_pkt.stream_index = dst_stream;
-    if (pkt->pts != AV_NOPTS_VALUE)
-        local_pkt.pts = av_rescale_q(pkt->pts,
-                                     src->streams[pkt->stream_index]->time_base,
-                                     dst->streams[dst_stream]->time_base);
-    if (pkt->dts != AV_NOPTS_VALUE)
-        local_pkt.dts = av_rescale_q(pkt->dts,
-                                     src->streams[pkt->stream_index]->time_base,
-                                     dst->streams[dst_stream]->time_base);
-    return av_write_frame(dst, &local_pkt);
-}
diff --git a/deps/libav/libavformat/mvi.c b/deps/libav/libavformat/mvi.c
deleted file mode 100644
index 69b0aed..0000000
--- a/deps/libav/libavformat/mvi.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Motion Pixels MVI Demuxer
- * Copyright (c) 2008 Gregory Montoir (cyx at users.sourceforge.net)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define MVI_FRAC_BITS 10
-
-#define MVI_AUDIO_STREAM_INDEX 0
-#define MVI_VIDEO_STREAM_INDEX 1
-
-typedef struct MviDemuxContext {
-    unsigned int (*get_int)(AVIOContext *);
-    uint32_t audio_data_size;
-    uint64_t audio_size_counter;
-    uint64_t audio_frame_size;
-    int audio_size_left;
-    int video_frame_size;
-} MviDemuxContext;
-
-static int read_header(AVFormatContext *s)
-{
-    MviDemuxContext *mvi = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *ast, *vst;
-    unsigned int version, frames_count, msecs_per_frame, player_version;
-
-    ast = avformat_new_stream(s, NULL);
-    if (!ast)
-        return AVERROR(ENOMEM);
-
-    vst = avformat_new_stream(s, NULL);
-    if (!vst)
-        return AVERROR(ENOMEM);
-
-    vst->codec->extradata_size = 2;
-    vst->codec->extradata = av_mallocz(2 + FF_INPUT_BUFFER_PADDING_SIZE);
-
-    version                  = avio_r8(pb);
-    vst->codec->extradata[0] = avio_r8(pb);
-    vst->codec->extradata[1] = avio_r8(pb);
-    frames_count             = avio_rl32(pb);
-    msecs_per_frame          = avio_rl32(pb);
-    vst->codec->width        = avio_rl16(pb);
-    vst->codec->height       = avio_rl16(pb);
-    avio_r8(pb);
-    ast->codec->sample_rate  = avio_rl16(pb);
-    mvi->audio_data_size     = avio_rl32(pb);
-    avio_r8(pb);
-    player_version           = avio_rl32(pb);
-    avio_rl16(pb);
-    avio_r8(pb);
-
-    if (frames_count == 0 || mvi->audio_data_size == 0)
-        return AVERROR_INVALIDDATA;
-
-    if (version != 7 || player_version > 213) {
-        av_log(s, AV_LOG_ERROR, "unhandled version (%d,%d)\n", version, player_version);
-        return AVERROR_INVALIDDATA;
-    }
-
-    avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
-    ast->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    ast->codec->codec_id        = AV_CODEC_ID_PCM_U8;
-    ast->codec->channels        = 1;
-    ast->codec->channel_layout  = AV_CH_LAYOUT_MONO;
-    ast->codec->bits_per_coded_sample = 8;
-    ast->codec->bit_rate        = ast->codec->sample_rate * 8;
-
-    avpriv_set_pts_info(vst, 64, msecs_per_frame, 1000000);
-    vst->avg_frame_rate    = av_inv_q(vst->time_base);
-    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_id   = AV_CODEC_ID_MOTIONPIXELS;
-
-    mvi->get_int = (vst->codec->width * vst->codec->height < (1 << 16)) ? avio_rl16 : avio_rl24;
-
-    mvi->audio_frame_size   = ((uint64_t)mvi->audio_data_size << MVI_FRAC_BITS) / frames_count;
-    if (mvi->audio_frame_size <= 1 << MVI_FRAC_BITS - 1) {
-        av_log(s, AV_LOG_ERROR, "Invalid audio_data_size (%d) or frames_count (%d)\n",
-               mvi->audio_data_size, frames_count);
-        return AVERROR_INVALIDDATA;
-    }
-
-    mvi->audio_size_counter = (ast->codec->sample_rate * 830 / mvi->audio_frame_size - 1) * mvi->audio_frame_size;
-    mvi->audio_size_left    = mvi->audio_data_size;
-
-    return 0;
-}
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, count;
-    MviDemuxContext *mvi = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    if (mvi->video_frame_size == 0) {
-        mvi->video_frame_size = (mvi->get_int)(pb);
-        if (mvi->audio_size_left == 0)
-            return AVERROR(EIO);
-        count = (mvi->audio_size_counter + mvi->audio_frame_size + 512) >> MVI_FRAC_BITS;
-        if (count > mvi->audio_size_left)
-            count = mvi->audio_size_left;
-        if ((ret = av_get_packet(pb, pkt, count)) < 0)
-            return ret;
-        pkt->stream_index = MVI_AUDIO_STREAM_INDEX;
-        mvi->audio_size_left -= count;
-        mvi->audio_size_counter += mvi->audio_frame_size - (count << MVI_FRAC_BITS);
-    } else {
-        if ((ret = av_get_packet(pb, pkt, mvi->video_frame_size)) < 0)
-            return ret;
-        pkt->stream_index = MVI_VIDEO_STREAM_INDEX;
-        mvi->video_frame_size = 0;
-    }
-    return 0;
-}
-
-AVInputFormat ff_mvi_demuxer = {
-    .name           = "mvi",
-    .long_name      = NULL_IF_CONFIG_SMALL("Motion Pixels MVI"),
-    .priv_data_size = sizeof(MviDemuxContext),
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .extensions     = "mvi",
-};
diff --git a/deps/libav/libavformat/mxf.c b/deps/libav/libavformat/mxf.c
deleted file mode 100644
index 040d8a2..0000000
--- a/deps/libav/libavformat/mxf.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * MXF
- * Copyright (c) 2006 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "mxf.h"
-
-/**
- * SMPTE RP224 http://www.smpte-ra.org/mdd/index.html
- */
-const MXFCodecUL ff_mxf_data_definition_uls[] = {
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x01,0x00,0x00,0x00 }, 13, AVMEDIA_TYPE_VIDEO },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x02,0x00,0x00,0x00 }, 13, AVMEDIA_TYPE_AUDIO },
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0,  AVMEDIA_TYPE_DATA },
-};
-
-const MXFCodecUL ff_mxf_codec_uls[] = {
-    /* PictureEssenceCoding */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x01,0x11,0x00 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MP at ML Long GoP */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x01,0x02,0x01,0x01 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* D-10 50Mbps PAL */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x03,0x03,0x00 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MP at HL Long GoP */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x04,0x02,0x00 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* 422P at HL I-Frame */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x20,0x02,0x03 }, 14,      AV_CODEC_ID_MPEG4 }, /* XDCAM proxy_pal030926.mxf */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x02,0x01,0x02,0x00 }, 13,    AV_CODEC_ID_DVVIDEO }, /* DV25 IEC PAL */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14,   AV_CODEC_ID_JPEG2000 }, /* JPEG2000 Codestream */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x01,0x7F,0x00,0x00,0x00 }, 13,   AV_CODEC_ID_RAWVIDEO }, /* Uncompressed */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x03,0x02,0x00,0x00 }, 14,      AV_CODEC_ID_DNXHD }, /* SMPTE VC-3/DNxHD */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14,       AV_CODEC_ID_H264 }, /* H.264/MPEG-4 AVC Intra */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x02,0x00 }, 15,       AV_CODEC_ID_V210 }, /* V210 */
-    /* SoundEssenceCompression */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 }, 13,  AV_CODEC_ID_PCM_S16LE }, /* Uncompressed */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x7F,0x00,0x00,0x00 }, 13,  AV_CODEC_ID_PCM_S16LE },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x02,0x02,0x01,0x7E,0x00,0x00,0x00 }, 13,  AV_CODEC_ID_PCM_S16BE }, /* From Omneon MXF file */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x04,0x04,0x02,0x02,0x02,0x03,0x01,0x01,0x00 }, 15,   AV_CODEC_ID_PCM_ALAW }, /* XDCAM Proxy C0023S01.mxf */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x02,0x03,0x02,0x01,0x00 }, 15,        AV_CODEC_ID_AC3 },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x02,0x03,0x02,0x05,0x00 }, 15,        AV_CODEC_ID_MP2 }, /* MP2 or MP3 */
-  //{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x02,0x03,0x02,0x1C,0x00 }, 15,    AV_CODEC_ID_DOLBY_E }, /* Dolby-E */
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0,       AV_CODEC_ID_NONE },
-};
-
-const MXFCodecUL ff_mxf_pixel_format_uls[] = {
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x01 }, 16, AV_PIX_FMT_UYVY422 },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x02 }, 16, AV_PIX_FMT_YUYV422 },
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0,    AV_PIX_FMT_NONE },
-};
-
-static const struct {
-    enum AVPixelFormat pix_fmt;
-    const char data[16];
-} ff_mxf_pixel_layouts[] = {
-    /**
-     * See SMPTE 377M E.2.46
-     *
-     * Note: Only RGB, palette based and "abnormal" YUV pixel formats like 4:2:2:4 go here.
-     *       For regular YUV, use CDCIPictureEssenceDescriptor.
-     *
-     * Note: Do not use these for encoding descriptors for little-endian formats until we
-     *       get samples or official word from SMPTE on how/if those can be encoded.
-     */
-    {AV_PIX_FMT_ABGR,    {'A', 8,  'B', 8,  'G', 8, 'R', 8                 }},
-    {AV_PIX_FMT_ARGB,    {'A', 8,  'R', 8,  'G', 8, 'B', 8                 }},
-    {AV_PIX_FMT_BGR24,   {'B', 8,  'G', 8,  'R', 8                         }},
-    {AV_PIX_FMT_BGRA,    {'B', 8,  'G', 8,  'R', 8, 'A', 8                 }},
-    {AV_PIX_FMT_RGB24,   {'R', 8,  'G', 8,  'B', 8                         }},
-    {AV_PIX_FMT_RGB444BE,{'F', 4,  'R', 4,  'G', 4, 'B', 4                 }},
-    {AV_PIX_FMT_RGB48BE, {'R', 8,  'r', 8,  'G', 8, 'g', 8, 'B', 8, 'b', 8 }},
-    {AV_PIX_FMT_RGB48BE, {'R', 16, 'G', 16, 'B', 16                        }},
-    {AV_PIX_FMT_RGB48LE, {'r', 8,  'R', 8,  'g', 8, 'G', 8, 'b', 8, 'B', 8 }},
-    {AV_PIX_FMT_RGB555BE,{'F', 1,  'R', 5,  'G', 5, 'B', 5                 }},
-    {AV_PIX_FMT_RGB565BE,{'R', 5,  'G', 6,  'B', 5                         }},
-    {AV_PIX_FMT_RGBA,    {'R', 8,  'G', 8,  'B', 8, 'A', 8                 }},
-    {AV_PIX_FMT_PAL8,    {'P', 8                                           }},
-};
-
-static const int num_pixel_layouts = FF_ARRAY_ELEMS(ff_mxf_pixel_layouts);
-
-int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt)
-{
-    int x;
-
-    for(x = 0; x < num_pixel_layouts; x++) {
-        if (!memcmp(pixel_layout, ff_mxf_pixel_layouts[x].data, 16)) {
-            *pix_fmt = ff_mxf_pixel_layouts[x].pix_fmt;
-            return 0;
-        }
-    }
-
-    return -1;
-}
diff --git a/deps/libav/libavformat/mxf.h b/deps/libav/libavformat/mxf.h
deleted file mode 100644
index 773f30f..0000000
--- a/deps/libav/libavformat/mxf.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * MXF
- * Copyright (c) 2006 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVFORMAT_MXF_H
-#define AVFORMAT_MXF_H
-
-#include "libavcodec/avcodec.h"
-#include <stdint.h>
-
-typedef uint8_t UID[16];
-
-enum MXFMetadataSetType {
-    AnyType,
-    MaterialPackage,
-    SourcePackage,
-    SourceClip,
-    TimecodeComponent,
-    Sequence,
-    MultipleDescriptor,
-    Descriptor,
-    Track,
-    CryptoContext,
-    Preface,
-    Identification,
-    ContentStorage,
-    SubDescriptor,
-    IndexTableSegment,
-    EssenceContainerData,
-    TypeBottom,// add metadata type before this
-};
-
-enum MXFFrameLayout {
-     FullFrame = 0,
-     MixedFields,
-     OneField,
-     SegmentedFrame,
-     SeparateFields
-};
-
-typedef struct KLVPacket {
-    UID key;
-    int64_t offset;
-    uint64_t length;
-} KLVPacket;
-
-typedef struct MXFCodecUL {
-    UID uid;
-    unsigned matching_len;
-    int id;
-} MXFCodecUL;
-
-extern const MXFCodecUL ff_mxf_data_definition_uls[];
-extern const MXFCodecUL ff_mxf_codec_uls[];
-extern const MXFCodecUL ff_mxf_pixel_format_uls[];
-
-int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt);
-
-#define PRINT_KEY(pc, s, x) av_dlog(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \
-                             (x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])
-
-#endif /* AVFORMAT_MXF_H */
diff --git a/deps/libav/libavformat/mxfdec.c b/deps/libav/libavformat/mxfdec.c
deleted file mode 100644
index 158e866..0000000
--- a/deps/libav/libavformat/mxfdec.c
+++ /dev/null
@@ -1,2318 +0,0 @@
-/*
- * MXF demuxer.
- * Copyright (c) 2006 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * References
- * SMPTE 336M KLV Data Encoding Protocol Using Key-Length-Value
- * SMPTE 377M MXF File Format Specifications
- * SMPTE 378M Operational Pattern 1a
- * SMPTE 379M MXF Generic Container
- * SMPTE 381M Mapping MPEG Streams into the MXF Generic Container
- * SMPTE 382M Mapping AES3 and Broadcast Wave Audio into the MXF Generic Container
- * SMPTE 383M Mapping DV-DIF Data to the MXF Generic Container
- *
- * Principle
- * Search for Track numbers which will identify essence element KLV packets.
- * Search for SourcePackage which define tracks which contains Track numbers.
- * Material Package contains tracks with reference to SourcePackage tracks.
- * Search for Descriptors (Picture, Sound) which contains codec info and parameters.
- * Assign Descriptors to correct Tracks.
- *
- * Metadata reading functions read Local Tags, get InstanceUID(0x3C0A) then add MetaDataSet to MXFContext.
- * Metadata parsing resolves Strong References to objects.
- *
- * Simple demuxer, only OP1A supported and some files might not work at all.
- * Only tracks with associated descriptors will be decoded. "Highly Desirable" SMPTE 377M D.1
- */
-
-#include <stdint.h>
-
-#include "libavutil/aes.h"
-#include "libavutil/mathematics.h"
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "internal.h"
-#include "mxf.h"
-
-typedef enum {
-    Header,
-    BodyPartition,
-    Footer
-} MXFPartitionType;
-
-typedef enum {
-    OP1a = 1,
-    OP1b,
-    OP1c,
-    OP2a,
-    OP2b,
-    OP2c,
-    OP3a,
-    OP3b,
-    OP3c,
-    OPAtom,
-    OPSonyOpt,  /* FATE sample, violates the spec in places */
-} MXFOP;
-
-typedef struct {
-    int closed;
-    int complete;
-    MXFPartitionType type;
-    uint64_t previous_partition;
-    int index_sid;
-    int body_sid;
-    int64_t this_partition;
-    int64_t essence_offset;         ///< absolute offset of essence
-    int64_t essence_length;
-    int32_t kag_size;
-    int64_t header_byte_count;
-    int64_t index_byte_count;
-    int pack_length;
-} MXFPartition;
-
-typedef struct {
-    UID uid;
-    enum MXFMetadataSetType type;
-    UID source_container_ul;
-} MXFCryptoContext;
-
-typedef struct {
-    UID uid;
-    enum MXFMetadataSetType type;
-    UID source_package_uid;
-    UID data_definition_ul;
-    int64_t duration;
-    int64_t start_position;
-    int source_track_id;
-} MXFStructuralComponent;
-
-typedef struct {
-    UID uid;
-    enum MXFMetadataSetType type;
-    UID data_definition_ul;
-    UID *structural_components_refs;
-    int structural_components_count;
-    int64_t duration;
-} MXFSequence;
-
-typedef struct {
-    UID uid;
-    enum MXFMetadataSetType type;
-    MXFSequence *sequence; /* mandatory, and only one */
-    UID sequence_ref;
-    int track_id;
-    uint8_t track_number[4];
-    AVRational edit_rate;
-    int intra_only;
-} MXFTrack;
-
-typedef struct {
-    UID uid;
-    enum MXFMetadataSetType type;
-    UID essence_container_ul;
-    UID essence_codec_ul;
-    AVRational sample_rate;
-    AVRational aspect_ratio;
-    int width;
-    int height; /* Field height, not frame height */
-    int frame_layout; /* See MXFFrameLayout enum */
-#define MXF_TFF 1
-#define MXF_BFF 2
-    int field_dominance;
-    int channels;
-    int bits_per_sample;
-    unsigned int component_depth;
-    unsigned int horiz_subsampling;
-    unsigned int vert_subsampling;
-    UID *sub_descriptors_refs;
-    int sub_descriptors_count;
-    int linked_track_id;
-    uint8_t *extradata;
-    int extradata_size;
-    enum AVPixelFormat pix_fmt;
-} MXFDescriptor;
-
-typedef struct {
-    UID uid;
-    enum MXFMetadataSetType type;
-    int edit_unit_byte_count;
-    int index_sid;
-    int body_sid;
-    AVRational index_edit_rate;
-    uint64_t index_start_position;
-    uint64_t index_duration;
-    int8_t *temporal_offset_entries;
-    int *flag_entries;
-    uint64_t *stream_offset_entries;
-    int nb_index_entries;
-} MXFIndexTableSegment;
-
-typedef struct {
-    UID uid;
-    enum MXFMetadataSetType type;
-    UID package_uid;
-    UID *tracks_refs;
-    int tracks_count;
-    MXFDescriptor *descriptor; /* only one */
-    UID descriptor_ref;
-} MXFPackage;
-
-typedef struct {
-    UID uid;
-    enum MXFMetadataSetType type;
-} MXFMetadataSet;
-
-/* decoded index table */
-typedef struct {
-    int index_sid;
-    int body_sid;
-    int nb_ptses;               /* number of PTSes or total duration of index */
-    int64_t first_dts;          /* DTS = EditUnit + first_dts */
-    int64_t *ptses;             /* maps EditUnit -> PTS */
-    int nb_segments;
-    MXFIndexTableSegment **segments;    /* sorted by IndexStartPosition */
-    AVIndexEntry *fake_index;   /* used for calling ff_index_search_timestamp() */
-} MXFIndexTable;
-
-typedef struct {
-    MXFPartition *partitions;
-    unsigned partitions_count;
-    MXFOP op;
-    UID *packages_refs;
-    int packages_count;
-    MXFMetadataSet **metadata_sets;
-    int metadata_sets_count;
-    AVFormatContext *fc;
-    struct AVAES *aesc;
-    uint8_t *local_tags;
-    int local_tags_count;
-    uint64_t footer_partition;
-    KLVPacket current_klv_data;
-    int current_klv_index;
-    int run_in;
-    MXFPartition *current_partition;
-    int parsing_backward;
-    int64_t last_forward_tell;
-    int last_forward_partition;
-    int current_edit_unit;
-    int nb_index_tables;
-    MXFIndexTable *index_tables;
-    int edit_units_per_packet;      ///< how many edit units to read at a time (PCM, OPAtom)
-} MXFContext;
-
-enum MXFWrappingScheme {
-    Frame,
-    Clip,
-};
-
-/* NOTE: klv_offset is not set (-1) for local keys */
-typedef int MXFMetadataReadFunc(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset);
-
-typedef struct {
-    const UID key;
-    MXFMetadataReadFunc *read;
-    int ctx_size;
-    enum MXFMetadataSetType type;
-} MXFMetadataReadTableEntry;
-
-/* partial keys to match */
-static const uint8_t mxf_header_partition_pack_key[]       = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02 };
-static const uint8_t mxf_essence_element_key[]             = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01 };
-static const uint8_t mxf_avid_essence_element_key[]        = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0e,0x04,0x03,0x01 };
-static const uint8_t mxf_system_item_key[]                 = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x03,0x01,0x04 };
-static const uint8_t mxf_klv_key[]                         = { 0x06,0x0e,0x2b,0x34 };
-/* complete keys to match */
-static const uint8_t mxf_crypto_source_container_ul[]      = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x02,0x02,0x00,0x00,0x00 };
-static const uint8_t mxf_encrypted_triplet_key[]           = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 };
-static const uint8_t mxf_encrypted_essence_container[]     = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 };
-static const uint8_t mxf_sony_mpeg4_extradata[]            = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 };
-
-#define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
-
-static int64_t klv_decode_ber_length(AVIOContext *pb)
-{
-    uint64_t size = avio_r8(pb);
-    if (size & 0x80) { /* long form */
-        int bytes_num = size & 0x7f;
-        /* SMPTE 379M 5.3.4 guarantee that bytes_num must not exceed 8 bytes */
-        if (bytes_num > 8)
-            return AVERROR_INVALIDDATA;
-        size = 0;
-        while (bytes_num--)
-            size = size << 8 | avio_r8(pb);
-    }
-    return size;
-}
-
-static int mxf_read_sync(AVIOContext *pb, const uint8_t *key, unsigned size)
-{
-    int i, b;
-    for (i = 0; i < size && !pb->eof_reached; i++) {
-        b = avio_r8(pb);
-        if (b == key[0])
-            i = 0;
-        else if (b != key[i])
-            i = -1;
-    }
-    return i == size;
-}
-
-static int klv_read_packet(KLVPacket *klv, AVIOContext *pb)
-{
-    if (!mxf_read_sync(pb, mxf_klv_key, 4))
-        return AVERROR_INVALIDDATA;
-    klv->offset = avio_tell(pb) - 4;
-    memcpy(klv->key, mxf_klv_key, 4);
-    avio_read(pb, klv->key + 4, 12);
-    klv->length = klv_decode_ber_length(pb);
-    return klv->length == -1 ? -1 : 0;
-}
-
-static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv)
-{
-    int i;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        MXFTrack *track = s->streams[i]->priv_data;
-        /* SMPTE 379M 7.3 */
-        if (!memcmp(klv->key + sizeof(mxf_essence_element_key), track->track_number, sizeof(track->track_number)))
-            return i;
-    }
-    /* return 0 if only one stream, for OP Atom files with 0 as track number */
-    return s->nb_streams == 1 ? 0 : -1;
-}
-
-/* XXX: use AVBitStreamFilter */
-static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt, int64_t length)
-{
-    const uint8_t *buf_ptr, *end_ptr;
-    uint8_t *data_ptr;
-    int i;
-
-    if (length > 61444) /* worst case PAL 1920 samples 8 channels */
-        return AVERROR_INVALIDDATA;
-    length = av_get_packet(pb, pkt, length);
-    if (length < 0)
-        return length;
-    data_ptr = pkt->data;
-    end_ptr = pkt->data + length;
-    buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */
-    for (; end_ptr - buf_ptr >= st->codec->channels * 4; ) {
-        for (i = 0; i < st->codec->channels; i++) {
-            uint32_t sample = bytestream_get_le32(&buf_ptr);
-            if (st->codec->bits_per_coded_sample == 24)
-                bytestream_put_le24(&data_ptr, (sample >> 4) & 0xffffff);
-            else
-                bytestream_put_le16(&data_ptr, (sample >> 12) & 0xffff);
-        }
-        buf_ptr += 32 - st->codec->channels*4; // always 8 channels stored SMPTE 331M
-    }
-    av_shrink_packet(pkt, data_ptr - pkt->data);
-    return 0;
-}
-
-static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv)
-{
-    static const uint8_t checkv[16] = {0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b};
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t end = avio_tell(pb) + klv->length;
-    int64_t size;
-    uint64_t orig_size;
-    uint64_t plaintext_size;
-    uint8_t ivec[16];
-    uint8_t tmpbuf[16];
-    int index;
-
-    if (!mxf->aesc && s->key && s->keylen == 16) {
-        mxf->aesc = av_aes_alloc();
-        if (!mxf->aesc)
-            return AVERROR(ENOMEM);
-        av_aes_init(mxf->aesc, s->key, 128, 1);
-    }
-    // crypto context
-    avio_skip(pb, klv_decode_ber_length(pb));
-    // plaintext offset
-    klv_decode_ber_length(pb);
-    plaintext_size = avio_rb64(pb);
-    // source klv key
-    klv_decode_ber_length(pb);
-    avio_read(pb, klv->key, 16);
-    if (!IS_KLV_KEY(klv, mxf_essence_element_key))
-        return AVERROR_INVALIDDATA;
-    index = mxf_get_stream_index(s, klv);
-    if (index < 0)
-        return AVERROR_INVALIDDATA;
-    // source size
-    klv_decode_ber_length(pb);
-    orig_size = avio_rb64(pb);
-    if (orig_size < plaintext_size)
-        return AVERROR_INVALIDDATA;
-    // enc. code
-    size = klv_decode_ber_length(pb);
-    if (size < 32 || size - 32 < orig_size)
-        return AVERROR_INVALIDDATA;
-    avio_read(pb, ivec, 16);
-    avio_read(pb, tmpbuf, 16);
-    if (mxf->aesc)
-        av_aes_crypt(mxf->aesc, tmpbuf, tmpbuf, 1, ivec, 1);
-    if (memcmp(tmpbuf, checkv, 16))
-        av_log(s, AV_LOG_ERROR, "probably incorrect decryption key\n");
-    size -= 32;
-    size = av_get_packet(pb, pkt, size);
-    if (size < 0)
-        return size;
-    else if (size < plaintext_size)
-        return AVERROR_INVALIDDATA;
-    size -= plaintext_size;
-    if (mxf->aesc)
-        av_aes_crypt(mxf->aesc, &pkt->data[plaintext_size],
-                     &pkt->data[plaintext_size], size >> 4, ivec, 1);
-    av_shrink_packet(pkt, orig_size);
-    pkt->stream_index = index;
-    avio_skip(pb, end - avio_tell(pb));
-    return 0;
-}
-
-static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFContext *mxf = arg;
-    int item_num = avio_rb32(pb);
-    int item_len = avio_rb32(pb);
-
-    if (item_len != 18) {
-        avpriv_request_sample(pb, "Primer pack item length %d", item_len);
-        return AVERROR_PATCHWELCOME;
-    }
-    if (item_num > UINT_MAX / item_len)
-        return AVERROR_INVALIDDATA;
-    mxf->local_tags_count = item_num;
-    mxf->local_tags = av_malloc(item_num*item_len);
-    if (!mxf->local_tags)
-        return AVERROR(ENOMEM);
-    avio_read(pb, mxf->local_tags, item_num*item_len);
-    return 0;
-}
-
-static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFContext *mxf = arg;
-    MXFPartition *partition;
-    UID op;
-    uint64_t footer_partition;
-    uint32_t nb_essence_containers;
-    int err;
-
-    if ((err = av_reallocp_array(&mxf->partitions, mxf->partitions_count + 1,
-                                 sizeof(*mxf->partitions))) < 0) {
-        mxf->partitions_count = 0;
-        return err;
-    }
-
-    if (mxf->parsing_backward) {
-        /* insert the new partition pack in the middle
-         * this makes the entries in mxf->partitions sorted by offset */
-        memmove(&mxf->partitions[mxf->last_forward_partition+1],
-                &mxf->partitions[mxf->last_forward_partition],
-                (mxf->partitions_count - mxf->last_forward_partition)*sizeof(*mxf->partitions));
-        partition = mxf->current_partition = &mxf->partitions[mxf->last_forward_partition];
-    } else {
-        mxf->last_forward_partition++;
-        partition = mxf->current_partition = &mxf->partitions[mxf->partitions_count];
-    }
-
-    memset(partition, 0, sizeof(*partition));
-    mxf->partitions_count++;
-    partition->pack_length = avio_tell(pb) - klv_offset + size;
-
-    switch(uid[13]) {
-    case 2:
-        partition->type = Header;
-        break;
-    case 3:
-        partition->type = BodyPartition;
-        break;
-    case 4:
-        partition->type = Footer;
-        break;
-    default:
-        av_log(mxf->fc, AV_LOG_ERROR, "unknown partition type %i\n", uid[13]);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* consider both footers to be closed (there is only Footer and CompleteFooter) */
-    partition->closed = partition->type == Footer || !(uid[14] & 1);
-    partition->complete = uid[14] > 2;
-    avio_skip(pb, 4);
-    partition->kag_size = avio_rb32(pb);
-    partition->this_partition = avio_rb64(pb);
-    partition->previous_partition = avio_rb64(pb);
-    footer_partition = avio_rb64(pb);
-    partition->header_byte_count = avio_rb64(pb);
-    partition->index_byte_count = avio_rb64(pb);
-    partition->index_sid = avio_rb32(pb);
-    avio_skip(pb, 8);
-    partition->body_sid = avio_rb32(pb);
-    avio_read(pb, op, sizeof(UID));
-    nb_essence_containers = avio_rb32(pb);
-
-    /* some files don'thave FooterPartition set in every partition */
-    if (footer_partition) {
-        if (mxf->footer_partition && mxf->footer_partition != footer_partition) {
-            av_log(mxf->fc, AV_LOG_ERROR,
-                   "inconsistent FooterPartition value: %"PRIu64" != %"PRIu64"\n",
-                   mxf->footer_partition, footer_partition);
-        } else {
-            mxf->footer_partition = footer_partition;
-        }
-    }
-
-    av_dlog(mxf->fc,
-            "PartitionPack: ThisPartition = 0x%"PRIX64
-            ", PreviousPartition = 0x%"PRIX64", "
-            "FooterPartition = 0x%"PRIX64", IndexSID = %i, BodySID = %i\n",
-            partition->this_partition,
-            partition->previous_partition, footer_partition,
-            partition->index_sid, partition->body_sid);
-
-    /* sanity check PreviousPartition if set */
-    if (partition->previous_partition &&
-        mxf->run_in + partition->previous_partition >= klv_offset) {
-        av_log(mxf->fc, AV_LOG_ERROR,
-               "PreviousPartition points to this partition or forward\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if      (op[12] == 1 && op[13] == 1) mxf->op = OP1a;
-    else if (op[12] == 1 && op[13] == 2) mxf->op = OP1b;
-    else if (op[12] == 1 && op[13] == 3) mxf->op = OP1c;
-    else if (op[12] == 2 && op[13] == 1) mxf->op = OP2a;
-    else if (op[12] == 2 && op[13] == 2) mxf->op = OP2b;
-    else if (op[12] == 2 && op[13] == 3) mxf->op = OP2c;
-    else if (op[12] == 3 && op[13] == 1) mxf->op = OP3a;
-    else if (op[12] == 3 && op[13] == 2) mxf->op = OP3b;
-    else if (op[12] == 3 && op[13] == 3) mxf->op = OP3c;
-    else if (op[12] == 64&& op[13] == 1) mxf->op = OPSonyOpt;
-    else if (op[12] == 0x10) {
-        /* SMPTE 390m: "There shall be exactly one essence container"
-         * The following block deals with files that violate this, namely:
-         * 2011_DCPTEST_24FPS.V.mxf - two ECs, OP1a
-         * abcdefghiv016f56415e.mxf - zero ECs, OPAtom, output by Avid AirSpeed */
-        if (nb_essence_containers != 1) {
-            MXFOP op = nb_essence_containers ? OP1a : OPAtom;
-
-            /* only nag once */
-            if (!mxf->op)
-                av_log(mxf->fc, AV_LOG_WARNING,
-                       "\"OPAtom\" with %u ECs - assuming %s\n",
-                       nb_essence_containers,
-                       op == OP1a ? "OP1a" : "OPAtom");
-
-            mxf->op = op;
-        } else
-            mxf->op = OPAtom;
-    } else {
-        av_log(mxf->fc, AV_LOG_ERROR, "unknown operational pattern: %02xh %02xh - guessing OP1a\n", op[12], op[13]);
-        mxf->op = OP1a;
-    }
-
-    if (partition->kag_size <= 0 || partition->kag_size > (1 << 20)) {
-        av_log(mxf->fc, AV_LOG_WARNING, "invalid KAGSize %i - guessing ", partition->kag_size);
-
-        if (mxf->op == OPSonyOpt)
-            partition->kag_size = 512;
-        else
-            partition->kag_size = 1;
-
-        av_log(mxf->fc, AV_LOG_WARNING, "%i\n", partition->kag_size);
-    }
-
-    return 0;
-}
-
-static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set)
-{
-    int err;
-
-    if ((err = av_reallocp_array(&mxf->metadata_sets, mxf->metadata_sets_count + 1,
-                                 sizeof(*mxf->metadata_sets))) < 0) {
-        mxf->metadata_sets_count = 0;
-        return err;
-    }
-    mxf->metadata_sets[mxf->metadata_sets_count] = metadata_set;
-    mxf->metadata_sets_count++;
-    return 0;
-}
-
-static int mxf_read_cryptographic_context(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFCryptoContext *cryptocontext = arg;
-    if (size != 16)
-        return AVERROR_INVALIDDATA;
-    if (IS_KLV_KEY(uid, mxf_crypto_source_container_ul))
-        avio_read(pb, cryptocontext->source_container_ul, 16);
-    return 0;
-}
-
-static int mxf_read_content_storage(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFContext *mxf = arg;
-    switch (tag) {
-    case 0x1901:
-        mxf->packages_count = avio_rb32(pb);
-        if (mxf->packages_count >= UINT_MAX / sizeof(UID))
-            return AVERROR_INVALIDDATA;
-        mxf->packages_refs = av_malloc(mxf->packages_count * sizeof(UID));
-        if (!mxf->packages_refs)
-            return AVERROR(ENOMEM);
-        avio_skip(pb, 4); /* useless size of objects, always 16 according to specs */
-        avio_read(pb, (uint8_t *)mxf->packages_refs, mxf->packages_count * sizeof(UID));
-        break;
-    }
-    return 0;
-}
-
-static int mxf_read_source_clip(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFStructuralComponent *source_clip = arg;
-    switch(tag) {
-    case 0x0202:
-        source_clip->duration = avio_rb64(pb);
-        break;
-    case 0x1201:
-        source_clip->start_position = avio_rb64(pb);
-        break;
-    case 0x1101:
-        /* UMID, only get last 16 bytes */
-        avio_skip(pb, 16);
-        avio_read(pb, source_clip->source_package_uid, 16);
-        break;
-    case 0x1102:
-        source_clip->source_track_id = avio_rb32(pb);
-        break;
-    }
-    return 0;
-}
-
-static int mxf_read_material_package(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFPackage *package = arg;
-    switch(tag) {
-    case 0x4403:
-        package->tracks_count = avio_rb32(pb);
-        if (package->tracks_count >= UINT_MAX / sizeof(UID))
-            return AVERROR_INVALIDDATA;
-        package->tracks_refs = av_malloc(package->tracks_count * sizeof(UID));
-        if (!package->tracks_refs)
-            return AVERROR(ENOMEM);
-        avio_skip(pb, 4); /* useless size of objects, always 16 according to specs */
-        avio_read(pb, (uint8_t *)package->tracks_refs, package->tracks_count * sizeof(UID));
-        break;
-    }
-    return 0;
-}
-
-static int mxf_read_track(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFTrack *track = arg;
-    switch(tag) {
-    case 0x4801:
-        track->track_id = avio_rb32(pb);
-        break;
-    case 0x4804:
-        avio_read(pb, track->track_number, 4);
-        break;
-    case 0x4B01:
-        track->edit_rate.num = avio_rb32(pb);
-        track->edit_rate.den = avio_rb32(pb);
-        break;
-    case 0x4803:
-        avio_read(pb, track->sequence_ref, 16);
-        break;
-    }
-    return 0;
-}
-
-static int mxf_read_sequence(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFSequence *sequence = arg;
-    switch(tag) {
-    case 0x0202:
-        sequence->duration = avio_rb64(pb);
-        break;
-    case 0x0201:
-        avio_read(pb, sequence->data_definition_ul, 16);
-        break;
-    case 0x1001:
-        sequence->structural_components_count = avio_rb32(pb);
-        if (sequence->structural_components_count >= UINT_MAX / sizeof(UID))
-            return AVERROR_INVALIDDATA;
-        sequence->structural_components_refs = av_malloc(sequence->structural_components_count * sizeof(UID));
-        if (!sequence->structural_components_refs)
-            return AVERROR(ENOMEM);
-        avio_skip(pb, 4); /* useless size of objects, always 16 according to specs */
-        avio_read(pb, (uint8_t *)sequence->structural_components_refs, sequence->structural_components_count * sizeof(UID));
-        break;
-    }
-    return 0;
-}
-
-static int mxf_read_source_package(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFPackage *package = arg;
-    switch(tag) {
-    case 0x4403:
-        package->tracks_count = avio_rb32(pb);
-        if (package->tracks_count >= UINT_MAX / sizeof(UID))
-            return AVERROR_INVALIDDATA;
-        package->tracks_refs = av_malloc(package->tracks_count * sizeof(UID));
-        if (!package->tracks_refs)
-            return AVERROR(ENOMEM);
-        avio_skip(pb, 4); /* useless size of objects, always 16 according to specs */
-        avio_read(pb, (uint8_t *)package->tracks_refs, package->tracks_count * sizeof(UID));
-        break;
-    case 0x4401:
-        /* UMID, only get last 16 bytes */
-        avio_skip(pb, 16);
-        avio_read(pb, package->package_uid, 16);
-        break;
-    case 0x4701:
-        avio_read(pb, package->descriptor_ref, 16);
-        break;
-    }
-    return 0;
-}
-
-static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *segment)
-{
-    int i, length;
-
-    segment->nb_index_entries = avio_rb32(pb);
-    if (!segment->nb_index_entries)
-        return 0;
-    else if (segment->nb_index_entries < 0 ||
-             segment->nb_index_entries >
-             (INT_MAX / sizeof(*segment->stream_offset_entries)))
-        return AVERROR(ENOMEM);
-
-    length = avio_rb32(pb);
-
-    segment->temporal_offset_entries = av_mallocz(segment->nb_index_entries *
-                                 sizeof(*segment->temporal_offset_entries));
-    segment->flag_entries            = av_mallocz(segment->nb_index_entries *
-                                 sizeof(*segment->flag_entries));
-    segment->stream_offset_entries   = av_mallocz(segment->nb_index_entries *
-                                 sizeof(*segment->stream_offset_entries));
-
-    if (!segment->flag_entries || !segment->stream_offset_entries ||
-        !segment->temporal_offset_entries) {
-        av_freep(&segment->flag_entries);
-        av_freep(&segment->stream_offset_entries);
-        av_freep(&segment->temporal_offset_entries);
-        return AVERROR(ENOMEM);
-    }
-
-    for (i = 0; i < segment->nb_index_entries; i++) {
-        segment->temporal_offset_entries[i] = avio_r8(pb);
-        avio_r8(pb);                                        /* KeyFrameOffset */
-        segment->flag_entries[i] = avio_r8(pb);
-        segment->stream_offset_entries[i] = avio_rb64(pb);
-        avio_skip(pb, length - 11);
-    }
-    return 0;
-}
-
-static int mxf_read_index_table_segment(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFIndexTableSegment *segment = arg;
-    switch(tag) {
-    case 0x3F05:
-        segment->edit_unit_byte_count = avio_rb32(pb);
-        av_dlog(NULL, "EditUnitByteCount %d\n", segment->edit_unit_byte_count);
-        break;
-    case 0x3F06:
-        segment->index_sid = avio_rb32(pb);
-        av_dlog(NULL, "IndexSID %d\n", segment->index_sid);
-        break;
-    case 0x3F07:
-        segment->body_sid = avio_rb32(pb);
-        av_dlog(NULL, "BodySID %d\n", segment->body_sid);
-        break;
-    case 0x3F0A:
-        av_dlog(NULL, "IndexEntryArray found\n");
-        return mxf_read_index_entry_array(pb, segment);
-    case 0x3F0B:
-        segment->index_edit_rate.num = avio_rb32(pb);
-        segment->index_edit_rate.den = avio_rb32(pb);
-        av_dlog(NULL, "IndexEditRate %d/%d\n", segment->index_edit_rate.num,
-                segment->index_edit_rate.den);
-        break;
-    case 0x3F0C:
-        segment->index_start_position = avio_rb64(pb);
-        av_dlog(NULL, "IndexStartPosition %"PRId64"\n", segment->index_start_position);
-        break;
-    case 0x3F0D:
-        segment->index_duration = avio_rb64(pb);
-        av_dlog(NULL, "IndexDuration %"PRId64"\n", segment->index_duration);
-        break;
-    }
-    return 0;
-}
-
-static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor)
-{
-    int code, value, ofs = 0;
-    char layout[16] = {0};
-
-    do {
-        code = avio_r8(pb);
-        value = avio_r8(pb);
-        av_dlog(NULL, "pixel layout: code %#x\n", code);
-
-        if (ofs < 16) {
-            layout[ofs++] = code;
-            layout[ofs++] = value;
-        }
-    } while (code != 0); /* SMPTE 377M E.2.46 */
-
-    ff_mxf_decode_pixel_layout(layout, &descriptor->pix_fmt);
-}
-
-static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
-{
-    MXFDescriptor *descriptor = arg;
-    descriptor->pix_fmt = AV_PIX_FMT_NONE;
-    switch(tag) {
-    case 0x3F01:
-        descriptor->sub_descriptors_count = avio_rb32(pb);
-        if (descriptor->sub_descriptors_count >= UINT_MAX / sizeof(UID))
-            return AVERROR_INVALIDDATA;
-        descriptor->sub_descriptors_refs = av_malloc(descriptor->sub_descriptors_count * sizeof(UID));
-        if (!descriptor->sub_descriptors_refs)
-            return AVERROR(ENOMEM);
-        avio_skip(pb, 4); /* useless size of objects, always 16 according to specs */
-        avio_read(pb, (uint8_t *)descriptor->sub_descriptors_refs, descriptor->sub_descriptors_count * sizeof(UID));
-        break;
-    case 0x3004:
-        avio_read(pb, descriptor->essence_container_ul, 16);
-        break;
-    case 0x3006:
-        descriptor->linked_track_id = avio_rb32(pb);
-        break;
-    case 0x3201: /* PictureEssenceCoding */
-        avio_read(pb, descriptor->essence_codec_ul, 16);
-        break;
-    case 0x3203:
-        descriptor->width = avio_rb32(pb);
-        break;
-    case 0x3202:
-        descriptor->height = avio_rb32(pb);
-        break;
-    case 0x320C:
-        descriptor->frame_layout = avio_r8(pb);
-        break;
-    case 0x320E:
-        descriptor->aspect_ratio.num = avio_rb32(pb);
-        descriptor->aspect_ratio.den = avio_rb32(pb);
-        break;
-    case 0x3212:
-        descriptor->field_dominance = avio_r8(pb);
-        break;
-    case 0x3301:
-        descriptor->component_depth = avio_rb32(pb);
-        break;
-    case 0x3302:
-        descriptor->horiz_subsampling = avio_rb32(pb);
-        break;
-    case 0x3308:
-        descriptor->vert_subsampling = avio_rb32(pb);
-        break;
-    case 0x3D03:
-        descriptor->sample_rate.num = avio_rb32(pb);
-        descriptor->sample_rate.den = avio_rb32(pb);
-        break;
-    case 0x3D06: /* SoundEssenceCompression */
-        avio_read(pb, descriptor->essence_codec_ul, 16);
-        break;
-    case 0x3D07:
-        descriptor->channels = avio_rb32(pb);
-        break;
-    case 0x3D01:
-        descriptor->bits_per_sample = avio_rb32(pb);
-        break;
-    case 0x3401:
-        mxf_read_pixel_layout(pb, descriptor);
-        break;
-    default:
-        /* Private uid used by SONY C0023S01.mxf */
-        if (IS_KLV_KEY(uid, mxf_sony_mpeg4_extradata)) {
-            av_free(descriptor->extradata);
-            descriptor->extradata_size = 0;
-            descriptor->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!descriptor->extradata)
-                return AVERROR(ENOMEM);
-            descriptor->extradata_size = size;
-            avio_read(pb, descriptor->extradata, size);
-        }
-        break;
-    }
-    return 0;
-}
-
-/*
- * Match an uid independently of the version byte and up to len common bytes
- * Returns: boolean
- */
-static int mxf_match_uid(const UID key, const UID uid, int len)
-{
-    int i;
-    for (i = 0; i < len; i++) {
-        if (i != 7 && key[i] != uid[i])
-            return 0;
-    }
-    return 1;
-}
-
-static const MXFCodecUL *mxf_get_codec_ul(const MXFCodecUL *uls, UID *uid)
-{
-    while (uls->uid[0]) {
-        if(mxf_match_uid(uls->uid, *uid, uls->matching_len))
-            break;
-        uls++;
-    }
-    return uls;
-}
-
-static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMetadataSetType type)
-{
-    int i;
-
-    if (!strong_ref)
-        return NULL;
-    for (i = 0; i < mxf->metadata_sets_count; i++) {
-        if (!memcmp(*strong_ref, mxf->metadata_sets[i]->uid, 16) &&
-            (type == AnyType || mxf->metadata_sets[i]->type == type)) {
-            return mxf->metadata_sets[i];
-        }
-    }
-    return NULL;
-}
-
-static const MXFCodecUL mxf_picture_essence_container_uls[] = {
-    // video essence container uls
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MPEG-ES Frame wrapped */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14,    AV_CODEC_ID_DVVIDEO }, /* DV 625 25mbps */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, 14,   AV_CODEC_ID_RAWVIDEO }, /* Uncompressed Picture */
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0,      AV_CODEC_ID_NONE },
-};
-
-/* EC ULs for intra-only formats */
-static const MXFCodecUL mxf_intra_only_essence_container_uls[] = {
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x00,0x00 }, 14, AV_CODEC_ID_MPEG2VIDEO }, /* MXF-GC SMPTE D-10 Mappings */
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0,       AV_CODEC_ID_NONE },
-};
-
-/* intra-only PictureEssenceCoding ULs, where no corresponding EC UL exists */
-static const MXFCodecUL mxf_intra_only_picture_essence_coding_uls[] = {
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14,       AV_CODEC_ID_H264 }, /* H.264/MPEG-4 AVC Intra Profiles */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14,   AV_CODEC_ID_JPEG2000 }, /* JPEG2000 Codestream */
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0,       AV_CODEC_ID_NONE },
-};
-
-static const MXFCodecUL mxf_sound_essence_container_uls[] = {
-    // sound essence container uls
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 14, AV_CODEC_ID_PCM_S16LE }, /* BWF Frame wrapped */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 14,       AV_CODEC_ID_MP2 }, /* MPEG-ES Frame wrapped, 0x40 ??? stream id */
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14, AV_CODEC_ID_PCM_S16LE }, /* D-10 Mapping 50Mbps PAL Extended Template */
-    { { 0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0xFF,0x4B,0x46,0x41,0x41,0x00,0x0D,0x4D,0x4F }, 14, AV_CODEC_ID_PCM_S16LE }, /* 0001GL00.MXF.A1.mxf_opatom.mxf */
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0,      AV_CODEC_ID_NONE },
-};
-
-static int mxf_get_sorted_table_segments(MXFContext *mxf, int *nb_sorted_segments, MXFIndexTableSegment ***sorted_segments)
-{
-    int i, j, nb_segments = 0;
-    MXFIndexTableSegment **unsorted_segments;
-    int last_body_sid = -1, last_index_sid = -1, last_index_start = -1;
-
-    /* count number of segments, allocate arrays and copy unsorted segments */
-    for (i = 0; i < mxf->metadata_sets_count; i++)
-        if (mxf->metadata_sets[i]->type == IndexTableSegment)
-            nb_segments++;
-
-    if (!nb_segments)
-        return AVERROR_INVALIDDATA;
-
-    *sorted_segments  = av_mallocz(nb_segments * sizeof(**sorted_segments));
-    unsorted_segments = av_mallocz(nb_segments * sizeof(*unsorted_segments));
-    if (!*sorted_segments || !unsorted_segments) {
-        av_freep(sorted_segments);
-        av_free(unsorted_segments);
-        return AVERROR(ENOMEM);
-    }
-
-    for (i = j = 0; i < mxf->metadata_sets_count; i++)
-        if (mxf->metadata_sets[i]->type == IndexTableSegment)
-            unsorted_segments[j++] = (MXFIndexTableSegment*)mxf->metadata_sets[i];
-
-    *nb_sorted_segments = 0;
-
-    /* sort segments by {BodySID, IndexSID, IndexStartPosition}, remove duplicates while we're at it */
-    for (i = 0; i < nb_segments; i++) {
-        int best = -1, best_body_sid = -1, best_index_sid = -1, best_index_start = -1;
-        uint64_t best_index_duration = 0;
-
-        for (j = 0; j < nb_segments; j++) {
-            MXFIndexTableSegment *s = unsorted_segments[j];
-
-            /* Require larger BosySID, IndexSID or IndexStartPosition then the previous entry. This removes duplicates.
-             * We want the smallest values for the keys than what we currently have, unless this is the first such entry this time around.
-             * If we come across an entry with the same IndexStartPosition but larger IndexDuration, then we'll prefer it over the one we currently have.
-             */
-            if ((i == 0     || s->body_sid > last_body_sid || s->index_sid > last_index_sid || s->index_start_position > last_index_start) &&
-                (best == -1 || s->body_sid < best_body_sid || s->index_sid < best_index_sid || s->index_start_position < best_index_start ||
-                (s->index_start_position == best_index_start && s->index_duration > best_index_duration))) {
-                best             = j;
-                best_body_sid    = s->body_sid;
-                best_index_sid   = s->index_sid;
-                best_index_start = s->index_start_position;
-                best_index_duration = s->index_duration;
-            }
-        }
-
-        /* no suitable entry found -> we're done */
-        if (best == -1)
-            break;
-
-        (*sorted_segments)[(*nb_sorted_segments)++] = unsorted_segments[best];
-        last_body_sid    = best_body_sid;
-        last_index_sid   = best_index_sid;
-        last_index_start = best_index_start;
-    }
-
-    av_free(unsorted_segments);
-
-    return 0;
-}
-
-/**
- * Computes the absolute file offset of the given essence container offset
- */
-static int mxf_absolute_bodysid_offset(MXFContext *mxf, int body_sid, int64_t offset, int64_t *offset_out)
-{
-    int x;
-    int64_t offset_in = offset;     /* for logging */
-
-    for (x = 0; x < mxf->partitions_count; x++) {
-        MXFPartition *p = &mxf->partitions[x];
-
-        if (p->body_sid != body_sid)
-            continue;
-
-        if (offset < p->essence_length || !p->essence_length) {
-            *offset_out = p->essence_offset + offset;
-            return 0;
-        }
-
-        offset -= p->essence_length;
-    }
-
-    av_log(mxf->fc, AV_LOG_ERROR,
-           "failed to find absolute offset of %"PRIX64" in BodySID %i - partial file?\n",
-           offset_in, body_sid);
-
-    return AVERROR_INVALIDDATA;
-}
-
-/**
- * Returns the end position of the essence container with given BodySID, or zero if unknown
- */
-static int64_t mxf_essence_container_end(MXFContext *mxf, int body_sid)
-{
-    int x;
-    int64_t ret = 0;
-
-    for (x = 0; x < mxf->partitions_count; x++) {
-        MXFPartition *p = &mxf->partitions[x];
-
-        if (p->body_sid != body_sid)
-            continue;
-
-        if (!p->essence_length)
-            return 0;
-
-        ret = p->essence_offset + p->essence_length;
-    }
-
-    return ret;
-}
-
-/* EditUnit -> absolute offset */
-static int mxf_edit_unit_absolute_offset(MXFContext *mxf, MXFIndexTable *index_table, int64_t edit_unit, int64_t *edit_unit_out, int64_t *offset_out, int nag)
-{
-    int i;
-    int64_t offset_temp = 0;
-
-    for (i = 0; i < index_table->nb_segments; i++) {
-        MXFIndexTableSegment *s = index_table->segments[i];
-
-        edit_unit = FFMAX(edit_unit, s->index_start_position);  /* clamp if trying to seek before start */
-
-        if (edit_unit < s->index_start_position + s->index_duration) {
-            int64_t index = edit_unit - s->index_start_position;
-
-            if (s->edit_unit_byte_count)
-                offset_temp += s->edit_unit_byte_count * index;
-            else if (s->nb_index_entries) {
-                if (s->nb_index_entries == 2 * s->index_duration + 1)
-                    index *= 2;     /* Avid index */
-
-                if (index < 0 || index >= s->nb_index_entries) {
-                    av_log(mxf->fc, AV_LOG_ERROR, "IndexSID %i segment at %"PRId64" IndexEntryArray too small\n",
-                           index_table->index_sid, s->index_start_position);
-                    return AVERROR_INVALIDDATA;
-                }
-
-                offset_temp = s->stream_offset_entries[index];
-            } else {
-                av_log(mxf->fc, AV_LOG_ERROR, "IndexSID %i segment at %"PRId64" missing EditUnitByteCount and IndexEntryArray\n",
-                       index_table->index_sid, s->index_start_position);
-                return AVERROR_INVALIDDATA;
-            }
-
-            if (edit_unit_out)
-                *edit_unit_out = edit_unit;
-
-            return mxf_absolute_bodysid_offset(mxf, index_table->body_sid, offset_temp, offset_out);
-        } else {
-            /* EditUnitByteCount == 0 for VBR indexes, which is fine since they use explicit StreamOffsets */
-            offset_temp += s->edit_unit_byte_count * s->index_duration;
-        }
-    }
-
-    if (nag)
-        av_log(mxf->fc, AV_LOG_ERROR, "failed to map EditUnit %"PRId64" in IndexSID %i to an offset\n", edit_unit, index_table->index_sid);
-
-    return AVERROR_INVALIDDATA;
-}
-
-static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_table)
-{
-    int i, j, x;
-    int8_t max_temporal_offset = -128;
-
-    /* first compute how many entries we have */
-    for (i = 0; i < index_table->nb_segments; i++) {
-        MXFIndexTableSegment *s = index_table->segments[i];
-
-        if (!s->nb_index_entries) {
-            index_table->nb_ptses = 0;
-            return 0;                               /* no TemporalOffsets */
-        }
-
-        index_table->nb_ptses += s->index_duration;
-    }
-
-    /* paranoid check */
-    if (index_table->nb_ptses <= 0)
-        return 0;
-
-    if (index_table->nb_ptses > INT_MAX / sizeof(AVIndexEntry))
-        return AVERROR(ENOMEM);
-
-    index_table->ptses      = av_mallocz(index_table->nb_ptses *
-                                         sizeof(int64_t));
-    index_table->fake_index = av_mallocz(index_table->nb_ptses *
-                                         sizeof(AVIndexEntry));
-    if (!index_table->ptses || !index_table->fake_index) {
-        av_freep(&index_table->ptses);
-        return AVERROR(ENOMEM);
-    }
-
-    /* we may have a few bad TemporalOffsets
-     * make sure the corresponding PTSes don't have the bogus value 0 */
-    for (x = 0; x < index_table->nb_ptses; x++)
-        index_table->ptses[x] = AV_NOPTS_VALUE;
-
-    /**
-     * We have this:
-     *
-     * x  TemporalOffset
-     * 0:  0
-     * 1:  1
-     * 2:  1
-     * 3: -2
-     * 4:  1
-     * 5:  1
-     * 6: -2
-     *
-     * We want to transform it into this:
-     *
-     * x  DTS PTS
-     * 0: -1   0
-     * 1:  0   3
-     * 2:  1   1
-     * 3:  2   2
-     * 4:  3   6
-     * 5:  4   4
-     * 6:  5   5
-     *
-     * We do this by bucket sorting x by x+TemporalOffset[x] into mxf->ptses,
-     * then settings mxf->first_dts = -max(TemporalOffset[x]).
-     * The latter makes DTS <= PTS.
-     */
-    for (i = x = 0; i < index_table->nb_segments; i++) {
-        MXFIndexTableSegment *s = index_table->segments[i];
-        int index_delta = 1;
-        int n = s->nb_index_entries;
-
-        if (s->nb_index_entries == 2 * s->index_duration + 1) {
-            index_delta = 2;    /* Avid index */
-            /* ignore the last entry - it's the size of the essence container */
-            n--;
-        }
-
-        for (j = 0; j < n; j += index_delta, x++) {
-            int offset = s->temporal_offset_entries[j] / index_delta;
-            int index  = x + offset;
-
-            if (x >= index_table->nb_ptses) {
-                av_log(mxf->fc, AV_LOG_ERROR,
-                       "x >= nb_ptses - IndexEntryCount %i < IndexDuration %"PRId64"?\n",
-                       s->nb_index_entries, s->index_duration);
-                break;
-            }
-
-            index_table->fake_index[x].timestamp = x;
-            index_table->fake_index[x].flags = !(s->flag_entries[j] & 0x30) ? AVINDEX_KEYFRAME : 0;
-
-            if (index < 0 || index >= index_table->nb_ptses) {
-                av_log(mxf->fc, AV_LOG_ERROR,
-                       "index entry %i + TemporalOffset %i = %i, which is out of bounds\n",
-                       x, offset, index);
-                continue;
-            }
-
-            index_table->ptses[index] = x;
-            max_temporal_offset = FFMAX(max_temporal_offset, offset);
-        }
-    }
-
-    index_table->first_dts = -max_temporal_offset;
-
-    return 0;
-}
-
-/**
- * Sorts and collects index table segments into index tables.
- * Also computes PTSes if possible.
- */
-static int mxf_compute_index_tables(MXFContext *mxf)
-{
-    int i, j, k, ret, nb_sorted_segments;
-    MXFIndexTableSegment **sorted_segments = NULL;
-
-    if ((ret = mxf_get_sorted_table_segments(mxf, &nb_sorted_segments, &sorted_segments)) ||
-        nb_sorted_segments <= 0) {
-        av_log(mxf->fc, AV_LOG_WARNING, "broken or empty index\n");
-        return 0;
-    }
-
-    /* sanity check and count unique BodySIDs/IndexSIDs */
-    for (i = 0; i < nb_sorted_segments; i++) {
-        if (i == 0 || sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid)
-            mxf->nb_index_tables++;
-        else if (sorted_segments[i-1]->body_sid != sorted_segments[i]->body_sid) {
-            av_log(mxf->fc, AV_LOG_ERROR, "found inconsistent BodySID\n");
-            ret = AVERROR_INVALIDDATA;
-            goto finish_decoding_index;
-        }
-    }
-
-    mxf->index_tables = av_mallocz_array(mxf->nb_index_tables,
-                                         sizeof(*mxf->index_tables));
-    if (!mxf->index_tables) {
-        av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate index tables\n");
-        ret = AVERROR(ENOMEM);
-        goto finish_decoding_index;
-    }
-
-    /* distribute sorted segments to index tables */
-    for (i = j = 0; i < nb_sorted_segments; i++) {
-        if (i != 0 && sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid) {
-            /* next IndexSID */
-            j++;
-        }
-
-        mxf->index_tables[j].nb_segments++;
-    }
-
-    for (i = j = 0; j < mxf->nb_index_tables; i += mxf->index_tables[j++].nb_segments) {
-        MXFIndexTable *t = &mxf->index_tables[j];
-
-        t->segments = av_mallocz_array(t->nb_segments,
-                                       sizeof(*t->segments));
-
-        if (!t->segments) {
-            av_log(mxf->fc, AV_LOG_ERROR, "failed to allocate IndexTableSegment"
-                   " pointer array\n");
-            ret = AVERROR(ENOMEM);
-            goto finish_decoding_index;
-        }
-
-        if (sorted_segments[i]->index_start_position)
-            av_log(mxf->fc, AV_LOG_WARNING, "IndexSID %i starts at EditUnit %"PRId64" - seeking may not work as expected\n",
-                   sorted_segments[i]->index_sid, sorted_segments[i]->index_start_position);
-
-        memcpy(t->segments, &sorted_segments[i], t->nb_segments * sizeof(MXFIndexTableSegment*));
-        t->index_sid = sorted_segments[i]->index_sid;
-        t->body_sid = sorted_segments[i]->body_sid;
-
-        if ((ret = mxf_compute_ptses_fake_index(mxf, t)) < 0)
-            goto finish_decoding_index;
-
-        /* fix zero IndexDurations */
-        for (k = 0; k < t->nb_segments; k++) {
-            if (t->segments[k]->index_duration)
-                continue;
-
-            if (t->nb_segments > 1)
-                av_log(mxf->fc, AV_LOG_WARNING, "IndexSID %i segment %i has zero IndexDuration and there's more than one segment\n",
-                       t->index_sid, k);
-
-            if (mxf->fc->nb_streams <= 0) {
-                av_log(mxf->fc, AV_LOG_WARNING, "no streams?\n");
-                break;
-            }
-
-            /* assume the first stream's duration is reasonable
-             * leave index_duration = 0 on further segments in case we have any (unlikely)
-             */
-            t->segments[k]->index_duration = mxf->fc->streams[0]->duration;
-            break;
-        }
-    }
-
-    ret = 0;
-finish_decoding_index:
-    av_free(sorted_segments);
-    return ret;
-}
-
-static int mxf_is_intra_only(MXFDescriptor *d)
-{
-    return mxf_get_codec_ul(mxf_intra_only_essence_container_uls,
-                            &d->essence_container_ul)->id != AV_CODEC_ID_NONE ||
-           mxf_get_codec_ul(mxf_intra_only_picture_essence_coding_uls,
-                            &d->essence_codec_ul)->id     != AV_CODEC_ID_NONE;
-}
-
-static int mxf_parse_structural_metadata(MXFContext *mxf)
-{
-    MXFPackage *material_package = NULL;
-    MXFPackage *temp_package = NULL;
-    int i, j, k, ret;
-
-    av_dlog(mxf->fc, "metadata sets count %d\n", mxf->metadata_sets_count);
-    /* TODO: handle multiple material packages (OP3x) */
-    for (i = 0; i < mxf->packages_count; i++) {
-        material_package = mxf_resolve_strong_ref(mxf, &mxf->packages_refs[i], MaterialPackage);
-        if (material_package) break;
-    }
-    if (!material_package) {
-        av_log(mxf->fc, AV_LOG_ERROR, "no material package found\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    for (i = 0; i < material_package->tracks_count; i++) {
-        MXFPackage *source_package = NULL;
-        MXFTrack *material_track = NULL;
-        MXFTrack *source_track = NULL;
-        MXFTrack *temp_track = NULL;
-        MXFDescriptor *descriptor = NULL;
-        MXFStructuralComponent *component = NULL;
-        UID *essence_container_ul = NULL;
-        const MXFCodecUL *codec_ul = NULL;
-        const MXFCodecUL *container_ul = NULL;
-        const MXFCodecUL *pix_fmt_ul = NULL;
-        AVStream *st;
-
-        if (!(material_track = mxf_resolve_strong_ref(mxf, &material_package->tracks_refs[i], Track))) {
-            av_log(mxf->fc, AV_LOG_ERROR, "could not resolve material track strong ref\n");
-            continue;
-        }
-
-        if (!(material_track->sequence = mxf_resolve_strong_ref(mxf, &material_track->sequence_ref, Sequence))) {
-            av_log(mxf->fc, AV_LOG_ERROR, "could not resolve material track sequence strong ref\n");
-            continue;
-        }
-
-        /* TODO: handle multiple source clips */
-        for (j = 0; j < material_track->sequence->structural_components_count; j++) {
-            /* TODO: handle timecode component */
-            component = mxf_resolve_strong_ref(mxf, &material_track->sequence->structural_components_refs[j], SourceClip);
-            if (!component)
-                continue;
-
-            for (k = 0; k < mxf->packages_count; k++) {
-                temp_package = mxf_resolve_strong_ref(mxf, &mxf->packages_refs[k], SourcePackage);
-                if (!temp_package)
-                    continue;
-                if (!memcmp(temp_package->package_uid, component->source_package_uid, 16)) {
-                    source_package = temp_package;
-                    break;
-                }
-            }
-            if (!source_package) {
-                av_dlog(mxf->fc, "material track %d: no corresponding source package found\n", material_track->track_id);
-                break;
-            }
-            for (k = 0; k < source_package->tracks_count; k++) {
-                if (!(temp_track = mxf_resolve_strong_ref(mxf, &source_package->tracks_refs[k], Track))) {
-                    av_log(mxf->fc, AV_LOG_ERROR, "could not resolve source track strong ref\n");
-                    ret = AVERROR_INVALIDDATA;
-                    goto fail_and_free;
-                }
-                if (temp_track->track_id == component->source_track_id) {
-                    source_track = temp_track;
-                    break;
-                }
-            }
-            if (!source_track) {
-                av_log(mxf->fc, AV_LOG_ERROR, "material track %d: no corresponding source track found\n", material_track->track_id);
-                break;
-            }
-        }
-        if (!source_track || !component)
-            continue;
-
-        if (!(source_track->sequence = mxf_resolve_strong_ref(mxf, &source_track->sequence_ref, Sequence))) {
-            av_log(mxf->fc, AV_LOG_ERROR, "could not resolve source track sequence strong ref\n");
-            ret = AVERROR_INVALIDDATA;
-            goto fail_and_free;
-        }
-
-        /* 0001GL00.MXF.A1.mxf_opatom.mxf has the same SourcePackageID as 0001GL.MXF.V1.mxf_opatom.mxf
-         * This would result in both files appearing to have two streams. Work around this by sanity checking DataDefinition */
-        if (memcmp(material_track->sequence->data_definition_ul, source_track->sequence->data_definition_ul, 16)) {
-            av_log(mxf->fc, AV_LOG_ERROR, "material track %d: DataDefinition mismatch\n", material_track->track_id);
-            continue;
-        }
-
-        st = avformat_new_stream(mxf->fc, NULL);
-        if (!st) {
-            av_log(mxf->fc, AV_LOG_ERROR, "could not allocate stream\n");
-            ret = AVERROR(ENOMEM);
-            goto fail_and_free;
-        }
-        st->id = source_track->track_id;
-        st->priv_data = source_track;
-        st->duration = component->duration;
-        if (st->duration == -1)
-            st->duration = AV_NOPTS_VALUE;
-        st->start_time = component->start_position;
-        if (material_track->edit_rate.num <= 0 ||
-            material_track->edit_rate.den <= 0) {
-            av_log(mxf->fc, AV_LOG_WARNING,
-                   "Invalid edit rate (%d/%d) found on stream #%d, "
-                   "defaulting to 25/1\n",
-                   material_track->edit_rate.num,
-                   material_track->edit_rate.den, st->index);
-            material_track->edit_rate = (AVRational){25, 1};
-        }
-        avpriv_set_pts_info(st, 64, material_track->edit_rate.den, material_track->edit_rate.num);
-
-        PRINT_KEY(mxf->fc, "data definition   ul", source_track->sequence->data_definition_ul);
-        codec_ul = mxf_get_codec_ul(ff_mxf_data_definition_uls, &source_track->sequence->data_definition_ul);
-        st->codec->codec_type = codec_ul->id;
-
-        source_package->descriptor = mxf_resolve_strong_ref(mxf, &source_package->descriptor_ref, AnyType);
-        if (source_package->descriptor) {
-            if (source_package->descriptor->type == MultipleDescriptor) {
-                for (j = 0; j < source_package->descriptor->sub_descriptors_count; j++) {
-                    MXFDescriptor *sub_descriptor = mxf_resolve_strong_ref(mxf, &source_package->descriptor->sub_descriptors_refs[j], Descriptor);
-
-                    if (!sub_descriptor) {
-                        av_log(mxf->fc, AV_LOG_ERROR, "could not resolve sub descriptor strong ref\n");
-                        continue;
-                    }
-                    if (sub_descriptor->linked_track_id == source_track->track_id) {
-                        descriptor = sub_descriptor;
-                        break;
-                    }
-                }
-            } else if (source_package->descriptor->type == Descriptor)
-                descriptor = source_package->descriptor;
-        }
-        if (!descriptor) {
-            av_log(mxf->fc, AV_LOG_INFO, "source track %d: stream %d, no descriptor found\n", source_track->track_id, st->index);
-            continue;
-        }
-        PRINT_KEY(mxf->fc, "essence codec     ul", descriptor->essence_codec_ul);
-        PRINT_KEY(mxf->fc, "essence container ul", descriptor->essence_container_ul);
-        essence_container_ul = &descriptor->essence_container_ul;
-        /* HACK: replacing the original key with mxf_encrypted_essence_container
-         * is not allowed according to s429-6, try to find correct information anyway */
-        if (IS_KLV_KEY(essence_container_ul, mxf_encrypted_essence_container)) {
-            av_log(mxf->fc, AV_LOG_INFO, "broken encrypted mxf file\n");
-            for (k = 0; k < mxf->metadata_sets_count; k++) {
-                MXFMetadataSet *metadata = mxf->metadata_sets[k];
-                if (metadata->type == CryptoContext) {
-                    essence_container_ul = &((MXFCryptoContext *)metadata)->source_container_ul;
-                    break;
-                }
-            }
-        }
-
-        /* TODO: drop PictureEssenceCoding and SoundEssenceCompression, only check EssenceContainer */
-        codec_ul = mxf_get_codec_ul(ff_mxf_codec_uls, &descriptor->essence_codec_ul);
-        st->codec->codec_id = codec_ul->id;
-
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            source_track->intra_only = mxf_is_intra_only(descriptor);
-            container_ul = mxf_get_codec_ul(mxf_picture_essence_container_uls, essence_container_ul);
-            if (st->codec->codec_id == AV_CODEC_ID_NONE)
-                st->codec->codec_id = container_ul->id;
-            st->codec->width = descriptor->width;
-            /* Field height, not frame height */
-            st->codec->height = descriptor->height;
-            switch (descriptor->frame_layout) {
-                case SegmentedFrame:
-                    /* This one is a weird layout I don't fully understand. */
-                    av_log(mxf->fc, AV_LOG_INFO,
-                           "SegmentedFrame layout isn't currently supported\n");
-                    break;
-                case FullFrame:
-                    st->codec->field_order = AV_FIELD_PROGRESSIVE;
-                    break;
-                case OneField:
-                    /* Every other line is stored and needs to be duplicated. */
-                    av_log(mxf->fc, AV_LOG_INFO,
-                           "OneField frame layout isn't currently supported\n");
-                    break;
-                    /* The correct thing to do here is fall through, but by
-                     * breaking we might be able to decode some streams at half
-                     * the vertical resolution, rather than not al all.
-                     * It's also for compatibility with the old behavior. */
-                case SeparateFields:
-                case MixedFields:
-                    switch (descriptor->field_dominance) {
-                    case MXF_TFF:
-                        st->codec->field_order = AV_FIELD_TT;
-                        break;
-                    case MXF_BFF:
-                        st->codec->field_order = AV_FIELD_BB;
-                        break;
-                    default:
-                        avpriv_request_sample(mxf->fc,
-                                              "Field dominance %d support",
-                                              descriptor->field_dominance);
-                        break;
-                    }
-                    /* Turn field height into frame height. */
-                    st->codec->height *= 2;
-                default:
-                    av_log(mxf->fc, AV_LOG_INFO,
-                           "Unknown frame layout type: %d\n",
-                           descriptor->frame_layout);
-            }
-            if (st->codec->codec_id == AV_CODEC_ID_RAWVIDEO) {
-                st->codec->pix_fmt = descriptor->pix_fmt;
-                if (st->codec->pix_fmt == AV_PIX_FMT_NONE) {
-                    pix_fmt_ul = mxf_get_codec_ul(ff_mxf_pixel_format_uls,
-                                                  &descriptor->essence_codec_ul);
-                    st->codec->pix_fmt = pix_fmt_ul->id;
-                    if (st->codec->pix_fmt == AV_PIX_FMT_NONE) {
-                        /* support files created before RP224v10 by defaulting to UYVY422
-                           if subsampling is 4:2:2 and component depth is 8-bit */
-                        if (descriptor->horiz_subsampling == 2 &&
-                            descriptor->vert_subsampling == 1 &&
-                            descriptor->component_depth == 8) {
-                            st->codec->pix_fmt = AV_PIX_FMT_UYVY422;
-                        }
-                    }
-                }
-            }
-            st->need_parsing = AVSTREAM_PARSE_HEADERS;
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            container_ul = mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul);
-            if (st->codec->codec_id == AV_CODEC_ID_NONE)
-                st->codec->codec_id = container_ul->id;
-            st->codec->channels = descriptor->channels;
-            st->codec->bits_per_coded_sample = descriptor->bits_per_sample;
-
-            if (descriptor->sample_rate.den > 0) {
-                st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den;
-                avpriv_set_pts_info(st, 64, descriptor->sample_rate.den, descriptor->sample_rate.num);
-            } else {
-                av_log(mxf->fc, AV_LOG_WARNING, "invalid sample rate (%d/%d) "
-                       "found for stream #%d, time base forced to 1/48000\n",
-                       descriptor->sample_rate.num, descriptor->sample_rate.den,
-                       st->index);
-                avpriv_set_pts_info(st, 64, 1, 48000);
-            }
-
-            /* TODO: implement AV_CODEC_ID_RAWAUDIO */
-            if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
-                if (descriptor->bits_per_sample > 16 && descriptor->bits_per_sample <= 24)
-                    st->codec->codec_id = AV_CODEC_ID_PCM_S24LE;
-                else if (descriptor->bits_per_sample == 32)
-                    st->codec->codec_id = AV_CODEC_ID_PCM_S32LE;
-            } else if (st->codec->codec_id == AV_CODEC_ID_PCM_S16BE) {
-                if (descriptor->bits_per_sample > 16 && descriptor->bits_per_sample <= 24)
-                    st->codec->codec_id = AV_CODEC_ID_PCM_S24BE;
-                else if (descriptor->bits_per_sample == 32)
-                    st->codec->codec_id = AV_CODEC_ID_PCM_S32BE;
-            } else if (st->codec->codec_id == AV_CODEC_ID_MP2) {
-                st->need_parsing = AVSTREAM_PARSE_FULL;
-            }
-        }
-        if (descriptor->extradata) {
-            st->codec->extradata = av_mallocz(descriptor->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (st->codec->extradata) {
-                memcpy(st->codec->extradata, descriptor->extradata, descriptor->extradata_size);
-                st->codec->extradata_size = descriptor->extradata_size;
-            }
-        } else if (st->codec->codec_id == AV_CODEC_ID_H264) {
-            ret = ff_generate_avci_extradata(st);
-            if (ret < 0)
-                return ret;
-        }
-        if (st->codec->codec_type != AVMEDIA_TYPE_DATA && (*essence_container_ul)[15] > 0x01) {
-            /* TODO: decode timestamps */
-            st->need_parsing = AVSTREAM_PARSE_TIMESTAMPS;
-        }
-    }
-
-    ret = 0;
-fail_and_free:
-    return ret;
-}
-
-static const MXFMetadataReadTableEntry mxf_metadata_read_table[] = {
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x05,0x01,0x00 }, mxf_read_primer_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x02,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x03,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x04,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x01,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x02,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x03,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x04,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x02,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x04,0x00 }, mxf_read_partition_pack },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x18,0x00 }, mxf_read_content_storage, 0, AnyType },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x37,0x00 }, mxf_read_source_package, sizeof(MXFPackage), SourcePackage },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x36,0x00 }, mxf_read_material_package, sizeof(MXFPackage), MaterialPackage },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x0F,0x00 }, mxf_read_sequence, sizeof(MXFSequence), Sequence },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x11,0x00 }, mxf_read_source_clip, sizeof(MXFStructuralComponent), SourceClip },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x44,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), MultipleDescriptor },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x42,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* Generic Sound */
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x28,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* CDCI */
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x29,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* RGBA */
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* MPEG 2 Video */
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* Wave */
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* AES3 */
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Static Track */
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Generic Track */
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x04,0x01,0x02,0x02,0x00,0x00 }, mxf_read_cryptographic_context, sizeof(MXFCryptoContext), CryptoContext },
-    { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x10,0x01,0x00 }, mxf_read_index_table_segment, sizeof(MXFIndexTableSegment), IndexTableSegment },
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, NULL, 0, AnyType },
-};
-
-static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadFunc *read_child, int ctx_size, enum MXFMetadataSetType type)
-{
-    AVIOContext *pb = mxf->fc->pb;
-    MXFMetadataSet *ctx = ctx_size ? av_mallocz(ctx_size) : mxf;
-    uint64_t klv_end = avio_tell(pb) + klv->length;
-
-    if (!ctx)
-        return AVERROR(ENOMEM);
-    while (avio_tell(pb) + 4 < klv_end && !pb->eof_reached) {
-        int ret;
-        int tag = avio_rb16(pb);
-        int size = avio_rb16(pb); /* KLV specified by 0x53 */
-        uint64_t next = avio_tell(pb) + size;
-        UID uid = {0};
-
-        av_dlog(mxf->fc, "local tag %#04x size %d\n", tag, size);
-        if (!size) { /* ignore empty tag, needed for some files with empty UMID tag */
-            av_log(mxf->fc, AV_LOG_ERROR, "local tag %#04x with 0 size\n", tag);
-            continue;
-        }
-        if (tag > 0x7FFF) { /* dynamic tag */
-            int i;
-            for (i = 0; i < mxf->local_tags_count; i++) {
-                int local_tag = AV_RB16(mxf->local_tags+i*18);
-                if (local_tag == tag) {
-                    memcpy(uid, mxf->local_tags+i*18+2, 16);
-                    av_dlog(mxf->fc, "local tag %#04x\n", local_tag);
-                    PRINT_KEY(mxf->fc, "uid", uid);
-                }
-            }
-        }
-        if (ctx_size && tag == 0x3C0A)
-            avio_read(pb, ctx->uid, 16);
-        else if ((ret = read_child(ctx, pb, tag, size, uid, -1)) < 0)
-            return ret;
-
-        /* Accept the 64k local set limit being exceeded (Avid). Don't accept
-         * it extending past the end of the KLV though (zzuf5.mxf). */
-        if (avio_tell(pb) > klv_end) {
-            if (ctx_size)
-                av_free(ctx);
-
-            av_log(mxf->fc, AV_LOG_ERROR,
-                   "local tag %#04x extends past end of local set @ %#"PRIx64"\n",
-                   tag, klv->offset);
-            return AVERROR_INVALIDDATA;
-        } else if (avio_tell(pb) <= next)   /* only seek forward, else this can loop for a long time */
-            avio_seek(pb, next, SEEK_SET);
-    }
-    if (ctx_size) ctx->type = type;
-    return ctx_size ? mxf_add_metadata_set(mxf, ctx) : 0;
-}
-
-/**
- * Seeks to the previous partition, if possible
- * @return <= 0 if we should stop parsing, > 0 if we should keep going
- */
-static int mxf_seek_to_previous_partition(MXFContext *mxf)
-{
-    AVIOContext *pb = mxf->fc->pb;
-
-    if (!mxf->current_partition ||
-        mxf->run_in + mxf->current_partition->previous_partition <= mxf->last_forward_tell)
-        return 0;   /* we've parsed all partitions */
-
-    /* seek to previous partition */
-    avio_seek(pb, mxf->run_in + mxf->current_partition->previous_partition, SEEK_SET);
-    mxf->current_partition = NULL;
-
-    av_dlog(mxf->fc, "seeking to previous partition\n");
-
-    return 1;
-}
-
-/**
- * Called when essence is encountered
- * @return <= 0 if we should stop parsing, > 0 if we should keep going
- */
-static int mxf_parse_handle_essence(MXFContext *mxf)
-{
-    AVIOContext *pb = mxf->fc->pb;
-    int64_t ret;
-
-    if (mxf->parsing_backward) {
-        return mxf_seek_to_previous_partition(mxf);
-    } else {
-        if (!mxf->footer_partition) {
-            av_dlog(mxf->fc, "no footer\n");
-            return 0;
-        }
-
-        av_dlog(mxf->fc, "seeking to footer\n");
-
-        /* remember where we were so we don't end up seeking further back than this */
-        mxf->last_forward_tell = avio_tell(pb);
-
-        if (!pb->seekable) {
-            av_log(mxf->fc, AV_LOG_INFO, "file is not seekable - not parsing footer\n");
-            return -1;
-        }
-
-        /* seek to footer partition and parse backward */
-        if ((ret = avio_seek(pb, mxf->run_in + mxf->footer_partition, SEEK_SET)) < 0) {
-            av_log(mxf->fc, AV_LOG_ERROR, "failed to seek to footer @ 0x%"PRIx64" (%"PRId64") - partial file?\n",
-                   mxf->run_in + mxf->footer_partition, ret);
-            return ret;
-        }
-
-        mxf->current_partition = NULL;
-        mxf->parsing_backward = 1;
-    }
-
-    return 1;
-}
-
-/**
- * Called when the next partition or EOF is encountered
- * @return <= 0 if we should stop parsing, > 0 if we should keep going
- */
-static int mxf_parse_handle_partition_or_eof(MXFContext *mxf)
-{
-    return mxf->parsing_backward ? mxf_seek_to_previous_partition(mxf) : 1;
-}
-
-/**
- * Figure out the proper offset and length of the essence container
- * in each partition
- */
-static void mxf_compute_essence_containers(MXFContext *mxf)
-{
-    int x;
-
-    /* everything is already correct */
-    if (mxf->op == OPAtom)
-        return;
-
-    for (x = 0; x < mxf->partitions_count; x++) {
-        MXFPartition *p = &mxf->partitions[x];
-
-        if (!p->body_sid)
-            continue;       /* BodySID == 0 -> no essence */
-
-        if (x >= mxf->partitions_count - 1)
-            break;          /* last partition - can't compute length (and we don't need to) */
-
-        /* essence container spans to the next partition */
-        p->essence_length = mxf->partitions[x+1].this_partition - p->essence_offset;
-
-        if (p->essence_length < 0) {
-            /* next ThisPartition < essence_offset */
-            p->essence_length = 0;
-            av_log(mxf->fc, AV_LOG_ERROR,
-                   "partition %i: bad ThisPartition = %"PRIX64"\n",
-                   x+1, mxf->partitions[x+1].this_partition);
-        }
-    }
-}
-
-static int64_t round_to_kag(int64_t position, int kag_size)
-{
-    /* TODO: account for run-in? the spec isn't clear whether KAG should account for it */
-    /* NOTE: kag_size may be any integer between 1 - 2^10 */
-    int64_t ret = (position / kag_size) * kag_size;
-    return ret == position ? ret : ret + kag_size;
-}
-
-static inline void compute_partition_essence_offset(AVFormatContext *s,
-                                                    MXFContext *mxf,
-                                                    KLVPacket *klv)
-{
-    MXFPartition *cur_part = mxf->current_partition;
-    /* for OP1a we compute essence_offset
-     * for OPAtom we point essence_offset after the KL
-     *     (usually op1a_essence_offset + 20 or 25)
-     * TODO: for OP1a we could eliminate this entire if statement, always
-     *       stopping parsing at op1a_essence_offset
-     *       for OPAtom we still need the actual essence_offset though
-     *       (the KL's length can vary)
-     */
-    int64_t op1a_essence_offset =
-        round_to_kag(cur_part->this_partition + cur_part->pack_length,
-                     cur_part->kag_size) +
-        round_to_kag(cur_part->header_byte_count, cur_part->kag_size) +
-        round_to_kag(cur_part->index_byte_count, cur_part->kag_size);
-
-    if (mxf->op == OPAtom) {
-        /* point essence_offset to the actual data
-         * OPAtom has all the essence in one big KLV
-         */
-        cur_part->essence_offset = avio_tell(s->pb);
-        cur_part->essence_length = klv->length;
-    } else {
-        /* NOTE: op1a_essence_offset may be less than to klv.offset
-         * (C0023S01.mxf)  */
-        cur_part->essence_offset = op1a_essence_offset;
-    }
-}
-
-static int is_pcm(enum AVCodecID codec_id)
-{
-    /* we only care about "normal" PCM codecs until we get samples */
-    return codec_id >= AV_CODEC_ID_PCM_S16LE && codec_id < AV_CODEC_ID_PCM_S24DAUD;
-}
-
-/**
- * Deal with the case where for some audio atoms EditUnitByteCount is
- * very small (2, 4..). In those cases we should read more than one
- * sample per call to mxf_read_packet().
- */
-static void mxf_handle_small_eubc(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-
-    /* assuming non-OPAtom == frame wrapped
-     * no sane writer would wrap 2 byte PCM packets with 20 byte headers.. */
-    if (mxf->op != OPAtom)
-        return;
-
-    /* expect PCM with exactly one index table segment and a small (< 32) EUBC */
-    if (s->nb_streams != 1                                     ||
-        s->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO ||
-        !is_pcm(s->streams[0]->codec->codec_id)                ||
-        mxf->nb_index_tables != 1                              ||
-        mxf->index_tables[0].nb_segments != 1                  ||
-        mxf->index_tables[0].segments[0]->edit_unit_byte_count >= 32)
-        return;
-
-    /* arbitrarily default to 48 kHz PAL audio frame size */
-    /* TODO: We could compute this from the ratio between the audio
-     *       and video edit rates for 48 kHz NTSC we could use the
-     *       1802-1802-1802-1802-1801 pattern. */
-    mxf->edit_units_per_packet = 1920;
-}
-
-static int mxf_read_header(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    KLVPacket klv;
-    int64_t essence_offset = 0;
-    int ret;
-
-    mxf->last_forward_tell = INT64_MAX;
-    mxf->edit_units_per_packet = 1;
-
-    if (!mxf_read_sync(s->pb, mxf_header_partition_pack_key, 14)) {
-        av_log(s, AV_LOG_ERROR, "could not find header partition pack key\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avio_seek(s->pb, -14, SEEK_CUR);
-    mxf->fc = s;
-    mxf->run_in = avio_tell(s->pb);
-
-    while (!s->pb->eof_reached) {
-        const MXFMetadataReadTableEntry *metadata;
-
-        if (klv_read_packet(&klv, s->pb) < 0) {
-            /* EOF - seek to previous partition or stop */
-            if(mxf_parse_handle_partition_or_eof(mxf) <= 0)
-                break;
-            else
-                continue;
-        }
-
-        PRINT_KEY(s, "read header", klv.key);
-        av_dlog(s, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
-        if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
-            IS_KLV_KEY(klv.key, mxf_essence_element_key) ||
-            IS_KLV_KEY(klv.key, mxf_avid_essence_element_key) ||
-            IS_KLV_KEY(klv.key, mxf_system_item_key)) {
-
-            if (!mxf->current_partition) {
-                av_log(mxf->fc, AV_LOG_ERROR,
-                       "found essence prior to first PartitionPack\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            if (!mxf->current_partition->essence_offset) {
-                compute_partition_essence_offset(s, mxf, &klv);
-            }
-
-            if (!essence_offset)
-                essence_offset = klv.offset;
-
-            /* seek to footer, previous partition or stop */
-            if (mxf_parse_handle_essence(mxf) <= 0)
-                break;
-            continue;
-        } else if (!memcmp(klv.key, mxf_header_partition_pack_key, 13) &&
-                   klv.key[13] >= 2 && klv.key[13] <= 4 && mxf->current_partition) {
-            /* next partition pack - keep going, seek to previous partition or stop */
-            if(mxf_parse_handle_partition_or_eof(mxf) <= 0)
-                break;
-            else if (mxf->parsing_backward)
-                continue;
-            /* we're still parsing forward. proceed to parsing this partition pack */
-        }
-
-        for (metadata = mxf_metadata_read_table; metadata->read; metadata++) {
-            if (IS_KLV_KEY(klv.key, metadata->key)) {
-                int res;
-                if (klv.key[5] == 0x53) {
-                    res = mxf_read_local_tags(mxf, &klv, metadata->read, metadata->ctx_size, metadata->type);
-                } else {
-                    uint64_t next = avio_tell(s->pb) + klv.length;
-                    res = metadata->read(mxf, s->pb, 0, klv.length, klv.key, klv.offset);
-
-                    /* only seek forward, else this can loop for a long time */
-                    if (avio_tell(s->pb) > next) {
-                        av_log(s, AV_LOG_ERROR, "read past end of KLV @ %#"PRIx64"\n",
-                               klv.offset);
-                        return AVERROR_INVALIDDATA;
-                    }
-
-                    avio_seek(s->pb, next, SEEK_SET);
-                }
-                if (res < 0) {
-                    av_log(s, AV_LOG_ERROR, "error reading header metadata\n");
-                    return res;
-                }
-                break;
-            }
-        }
-        if (!metadata->read)
-            avio_skip(s->pb, klv.length);
-    }
-    /* FIXME avoid seek */
-    if (!essence_offset)  {
-        av_log(s, AV_LOG_ERROR, "no essence\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avio_seek(s->pb, essence_offset, SEEK_SET);
-
-    mxf_compute_essence_containers(mxf);
-
-    /* we need to do this before computing the index tables
-     * to be able to fill in zero IndexDurations with st->duration */
-    if ((ret = mxf_parse_structural_metadata(mxf)) < 0)
-        return ret;
-
-    if ((ret = mxf_compute_index_tables(mxf)) < 0)
-        return ret;
-
-    if (mxf->nb_index_tables > 1) {
-        /* TODO: look up which IndexSID to use via EssenceContainerData */
-        av_log(mxf->fc, AV_LOG_INFO, "got %i index tables - only the first one (IndexSID %i) will be used\n",
-               mxf->nb_index_tables, mxf->index_tables[0].index_sid);
-    } else if (mxf->nb_index_tables == 0 && mxf->op == OPAtom) {
-        av_log(mxf->fc, AV_LOG_ERROR, "cannot demux OPAtom without an index\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    mxf_handle_small_eubc(s);
-
-    return 0;
-}
-
-/**
- * Sets mxf->current_edit_unit based on what offset we're currently at.
- * @return next_ofs if OK, <0 on error
- */
-static int64_t mxf_set_current_edit_unit(MXFContext *mxf, int64_t current_offset)
-{
-    int64_t last_ofs = -1, next_ofs = -1;
-    MXFIndexTable *t = &mxf->index_tables[0];
-
-    /* this is called from the OP1a demuxing logic, which means there
-     * may be no index tables */
-    if (mxf->nb_index_tables <= 0)
-        return -1;
-
-    /* find mxf->current_edit_unit so that the next edit unit starts ahead
-     * of current_offset */
-    while (mxf->current_edit_unit >= 0) {
-        if (mxf_edit_unit_absolute_offset(mxf, t, mxf->current_edit_unit + 1,
-                                          NULL, &next_ofs, 0) < 0)
-            return -1;
-
-        if (next_ofs <= last_ofs) {
-            /* large next_ofs didn't change or current_edit_unit wrapped
-             * around this fixes the infinite loop on zzuf3.mxf */
-            av_log(mxf->fc, AV_LOG_ERROR,
-                   "next_ofs didn't change. not deriving packet timestamps\n");
-            return -1;
-        }
-
-        if (next_ofs > current_offset)
-            break;
-
-        last_ofs = next_ofs;
-        mxf->current_edit_unit++;
-    }
-
-    /* not checking mxf->current_edit_unit >= t->nb_ptses here since CBR files
-     * may lack IndexEntryArrays */
-    if (mxf->current_edit_unit < 0)
-        return -1;
-
-    return next_ofs;
-}
-
-static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
-{
-    KLVPacket klv;
-    MXFContext *mxf = s->priv_data;
-
-    while (!s->pb->eof_reached) {
-        if (klv_read_packet(&klv, s->pb) < 0)
-            return -1;
-        PRINT_KEY(s, "read packet", klv.key);
-        av_dlog(s, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset);
-        if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) {
-            int res = mxf_decrypt_triplet(s, pkt, &klv);
-            if (res < 0) {
-                av_log(s, AV_LOG_ERROR, "invalid encoded triplet\n");
-                return -1;
-            }
-            return 0;
-        }
-        if (IS_KLV_KEY(klv.key, mxf_essence_element_key) ||
-            IS_KLV_KEY(klv.key, mxf_avid_essence_element_key)) {
-            int index = mxf_get_stream_index(s, &klv);
-            int64_t next_ofs, next_klv;
-            AVStream *st;
-            MXFTrack *track;
-
-            if (index < 0) {
-                av_log(s, AV_LOG_ERROR, "error getting stream index %d\n", AV_RB32(klv.key+12));
-                goto skip;
-            }
-
-            st = s->streams[index];
-            track = st->priv_data;
-
-            if (s->streams[index]->discard == AVDISCARD_ALL)
-                goto skip;
-
-            next_klv = avio_tell(s->pb) + klv.length;
-            next_ofs = mxf_set_current_edit_unit(mxf, klv.offset);
-
-            if (next_ofs >= 0 && next_klv > next_ofs) {
-                /* if this check is hit then it's possible OPAtom was treated
-                 * as OP1a truncate the packet since it's probably very large
-                 * (>2 GiB is common) */
-                avpriv_request_sample(s,
-                                      "OPAtom misinterpreted as OP1a?"
-                                      "KLV for edit unit %i extending into "
-                                      "next edit unit",
-                                      mxf->current_edit_unit);
-                klv.length = next_ofs - avio_tell(s->pb);
-            }
-
-            /* check for 8 channels AES3 element */
-            if (klv.key[12] == 0x06 && klv.key[13] == 0x01 && klv.key[14] == 0x10) {
-                if (mxf_get_d10_aes3_packet(s->pb, s->streams[index], pkt, klv.length) < 0) {
-                    av_log(s, AV_LOG_ERROR, "error reading D-10 aes3 frame\n");
-                    return -1;
-                }
-            } else {
-                int ret = av_get_packet(s->pb, pkt, klv.length);
-                if (ret < 0)
-                    return ret;
-            }
-            pkt->stream_index = index;
-            pkt->pos = klv.offset;
-
-            if (s->streams[index]->codec->codec_type == AVMEDIA_TYPE_VIDEO && next_ofs >= 0) {
-                /* mxf->current_edit_unit good - see if we have an
-                 * index table to derive timestamps from */
-                MXFIndexTable *t = &mxf->index_tables[0];
-
-                if (mxf->nb_index_tables >= 1 &&
-                    mxf->current_edit_unit < t->nb_ptses) {
-                    pkt->dts = mxf->current_edit_unit + t->first_dts;
-                    pkt->pts = t->ptses[mxf->current_edit_unit];
-                } else if (track->intra_only) {
-                    /* intra-only -> PTS = EditUnit.
-                     * let utils.c figure out DTS since it can be
-                     * < PTS if low_delay = 0 (Sony IMX30) */
-                    pkt->pts = mxf->current_edit_unit;
-                }
-            }
-
-            /* seek for truncated packets */
-            avio_seek(s->pb, next_klv, SEEK_SET);
-
-            return 0;
-        } else
-        skip:
-            avio_skip(s->pb, klv.length);
-    }
-    return AVERROR_EOF;
-}
-
-static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MXFContext *mxf = s->priv_data;
-    int ret, size;
-    int64_t ret64, pos, next_pos;
-    AVStream *st;
-    MXFIndexTable *t;
-    int edit_units;
-
-    if (mxf->op != OPAtom)
-        return mxf_read_packet_old(s, pkt);
-
-    /* OPAtom - clip wrapped demuxing */
-    /* NOTE: mxf_read_header() makes sure nb_index_tables > 0 for OPAtom */
-    st = s->streams[0];
-    t = &mxf->index_tables[0];
-
-    if (mxf->current_edit_unit >= st->duration)
-        return AVERROR_EOF;
-
-    edit_units = FFMIN(mxf->edit_units_per_packet, st->duration - mxf->current_edit_unit);
-
-    if ((ret = mxf_edit_unit_absolute_offset(mxf, t, mxf->current_edit_unit, NULL, &pos, 1)) < 0)
-        return ret;
-
-    /* compute size by finding the next edit unit or the end of the essence container
-     * not pretty, but it works */
-    if ((ret = mxf_edit_unit_absolute_offset(mxf, t, mxf->current_edit_unit + edit_units, NULL, &next_pos, 0)) < 0 &&
-        (next_pos = mxf_essence_container_end(mxf, t->body_sid)) <= 0) {
-        av_log(s, AV_LOG_ERROR, "unable to compute the size of the last packet\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((size = next_pos - pos) <= 0) {
-        av_log(s, AV_LOG_ERROR, "bad size: %i\n", size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret64 = avio_seek(s->pb, pos, SEEK_SET)) < 0)
-        return ret64;
-
-        if ((ret = av_get_packet(s->pb, pkt, size)) != size)
-            return ret < 0 ? ret : AVERROR_EOF;
-
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && t->ptses &&
-        mxf->current_edit_unit >= 0 && mxf->current_edit_unit < t->nb_ptses) {
-        pkt->dts = mxf->current_edit_unit + t->first_dts;
-        pkt->pts = t->ptses[mxf->current_edit_unit];
-    }
-
-    pkt->stream_index = 0;
-    mxf->current_edit_unit += edit_units;
-
-    return 0;
-}
-
-
-static int mxf_read_close(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    MXFIndexTableSegment *seg;
-    int i;
-
-    av_freep(&mxf->packages_refs);
-
-    for (i = 0; i < s->nb_streams; i++)
-        s->streams[i]->priv_data = NULL;
-
-    for (i = 0; i < mxf->metadata_sets_count; i++) {
-        switch (mxf->metadata_sets[i]->type) {
-        case Descriptor:
-            av_freep(&((MXFDescriptor *)mxf->metadata_sets[i])->extradata);
-            break;
-        case MultipleDescriptor:
-            av_freep(&((MXFDescriptor *)mxf->metadata_sets[i])->sub_descriptors_refs);
-            break;
-        case Sequence:
-            av_freep(&((MXFSequence *)mxf->metadata_sets[i])->structural_components_refs);
-            break;
-        case SourcePackage:
-        case MaterialPackage:
-            av_freep(&((MXFPackage *)mxf->metadata_sets[i])->tracks_refs);
-            break;
-        case IndexTableSegment:
-            seg = (MXFIndexTableSegment *)mxf->metadata_sets[i];
-            av_freep(&seg->temporal_offset_entries);
-            av_freep(&seg->flag_entries);
-            av_freep(&seg->stream_offset_entries);
-            break;
-        default:
-            break;
-        }
-        av_freep(&mxf->metadata_sets[i]);
-    }
-    av_freep(&mxf->partitions);
-    av_freep(&mxf->metadata_sets);
-    av_freep(&mxf->aesc);
-    av_freep(&mxf->local_tags);
-
-    for (i = 0; i < mxf->nb_index_tables; i++) {
-        av_freep(&mxf->index_tables[i].segments);
-        av_freep(&mxf->index_tables[i].ptses);
-        av_freep(&mxf->index_tables[i].fake_index);
-    }
-    av_freep(&mxf->index_tables);
-
-    return 0;
-}
-
-static int mxf_probe(AVProbeData *p) {
-    uint8_t *bufp = p->buf;
-    uint8_t *end = p->buf + p->buf_size;
-
-    if (p->buf_size < sizeof(mxf_header_partition_pack_key))
-        return 0;
-
-    /* Must skip Run-In Sequence and search for MXF header partition pack key SMPTE 377M 5.5 */
-    end -= sizeof(mxf_header_partition_pack_key);
-    for (; bufp < end; bufp++) {
-        if (IS_KLV_KEY(bufp, mxf_header_partition_pack_key))
-            return AVPROBE_SCORE_MAX;
-    }
-    return 0;
-}
-
-/* rudimentary byte seek */
-/* XXX: use MXF Index */
-static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags)
-{
-    AVStream *st = s->streams[stream_index];
-    int64_t seconds;
-    MXFContext* mxf = s->priv_data;
-    int64_t seekpos;
-    int ret;
-    MXFIndexTable *t;
-
-    if (mxf->nb_index_tables <= 0) {
-    if (!s->bit_rate)
-        return AVERROR_INVALIDDATA;
-    if (sample_time < 0)
-        sample_time = 0;
-    seconds = av_rescale(sample_time, st->time_base.num, st->time_base.den);
-
-    seekpos = avio_seek(s->pb, (s->bit_rate * seconds) >> 3, SEEK_SET);
-    if (seekpos < 0)
-        return seekpos;
-
-    ff_update_cur_dts(s, st, sample_time);
-    mxf->current_edit_unit = sample_time;
-    } else {
-        t = &mxf->index_tables[0];
-
-        /* clamp above zero, else ff_index_search_timestamp() returns negative
-         * this also means we allow seeking before the start */
-        sample_time = FFMAX(sample_time, 0);
-
-        if (t->fake_index) {
-            /* behave as if we have a proper index */
-            if ((sample_time = ff_index_search_timestamp(t->fake_index, t->nb_ptses, sample_time, flags)) < 0)
-                return sample_time;
-        } else {
-            /* no IndexEntryArray (one or more CBR segments)
-             * make sure we don't seek past the end */
-            sample_time = FFMIN(sample_time, st->duration - 1);
-        }
-
-        if ((ret = mxf_edit_unit_absolute_offset(mxf, t, sample_time, &sample_time, &seekpos, 1)) << 0)
-            return ret;
-
-        ff_update_cur_dts(s, st, sample_time);
-        mxf->current_edit_unit = sample_time;
-        avio_seek(s->pb, seekpos, SEEK_SET);
-    }
-    return 0;
-}
-
-AVInputFormat ff_mxf_demuxer = {
-    .name           = "mxf",
-    .long_name      = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
-    .priv_data_size = sizeof(MXFContext),
-    .read_probe     = mxf_probe,
-    .read_header    = mxf_read_header,
-    .read_packet    = mxf_read_packet,
-    .read_close     = mxf_read_close,
-    .read_seek      = mxf_read_seek,
-};
diff --git a/deps/libav/libavformat/mxfenc.c b/deps/libav/libavformat/mxfenc.c
deleted file mode 100644
index 4fd5687..0000000
--- a/deps/libav/libavformat/mxfenc.c
+++ /dev/null
@@ -1,1927 +0,0 @@
-/*
- * MXF muxer
- * Copyright (c) 2008 GUCAS, Zhentan Feng <spyfeng at gmail dot com>
- * Copyright (c) 2008 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * References
- * SMPTE 336M KLV Data Encoding Protocol Using Key-Length-Value
- * SMPTE 377M MXF File Format Specifications
- * SMPTE 379M MXF Generic Container
- * SMPTE 381M Mapping MPEG Streams into the MXF Generic Container
- * SMPTE RP210: SMPTE Metadata Dictionary
- * SMPTE RP224: Registry of SMPTE Universal Labels
- */
-
-#include <inttypes.h>
-#include <math.h>
-#include <time.h>
-
-#include "libavutil/random_seed.h"
-#include "libavcodec/bytestream.h"
-#include "audiointerleave.h"
-#include "avformat.h"
-#include "internal.h"
-#include "mxf.h"
-
-static const int NTSC_samples_per_frame[] = { 1602, 1601, 1602, 1601, 1602, 0 };
-static const int PAL_samples_per_frame[]  = { 1920, 0 };
-
-extern AVOutputFormat ff_mxf_d10_muxer;
-
-#define EDIT_UNITS_PER_BODY 250
-#define KAG_SIZE 512
-
-typedef struct {
-    int local_tag;
-    UID uid;
-} MXFLocalTagPair;
-
-typedef struct {
-    uint8_t flags;
-    uint64_t offset;
-    unsigned slice_offset; ///< offset of audio slice
-    uint16_t temporal_ref;
-} MXFIndexEntry;
-
-typedef struct {
-    AudioInterleaveContext aic;
-    UID track_essence_element_key;
-    int index;               ///< index in mxf_essence_container_uls table
-    const UID *codec_ul;
-    int order;               ///< interleaving order if dts are equal
-    int interlaced;          ///< whether picture is interlaced
-    int temporal_reordering;
-    AVRational aspect_ratio; ///< display aspect ratio
-    int closed_gop;          ///< gop is closed, used in mpeg-2 frame parsing
-} MXFStreamContext;
-
-typedef struct {
-    UID container_ul;
-    UID element_ul;
-    UID codec_ul;
-    void (*write_desc)(AVFormatContext *, AVStream *);
-} MXFContainerEssenceEntry;
-
-static const struct {
-    enum AVCodecID id;
-    int index;
-} mxf_essence_mappings[] = {
-    { AV_CODEC_ID_MPEG2VIDEO, 0 },
-    { AV_CODEC_ID_PCM_S24LE,  1 },
-    { AV_CODEC_ID_PCM_S16LE,  1 },
-    { AV_CODEC_ID_NONE }
-};
-
-static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st);
-static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st);
-static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st);
-static void mxf_write_cdci_desc(AVFormatContext *s, AVStream *st);
-static void mxf_write_generic_sound_desc(AVFormatContext *s, AVStream *st);
-
-static const MXFContainerEssenceEntry mxf_essence_container_uls[] = {
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x00,0x00,0x00 },
-      mxf_write_mpegvideo_desc },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x03,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x16,0x01,0x03,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
-      mxf_write_aes3_desc },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x16,0x01,0x01,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
-      mxf_write_wav_desc },
-    // D-10 625/50 PAL 50mb/s
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x05,0x01,0x01,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x01,0x02,0x01,0x01 },
-      mxf_write_cdci_desc },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x06,0x01,0x10,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
-      mxf_write_generic_sound_desc },
-    // D-10 525/60 NTSC 50mb/s
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x02,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x05,0x01,0x01,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x01,0x02,0x01,0x02 },
-      mxf_write_cdci_desc },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x02,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x06,0x01,0x10,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
-      mxf_write_generic_sound_desc },
-    // D-10 625/50 PAL 40mb/s
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x03,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x05,0x01,0x01,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x01,0x02,0x01,0x03 },
-      mxf_write_cdci_desc },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x03,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x06,0x01,0x10,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
-      mxf_write_generic_sound_desc },
-    // D-10 525/60 NTSC 40mb/s
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x04,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x05,0x01,0x01,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x01,0x02,0x01,0x04 },
-      mxf_write_cdci_desc },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x04,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x06,0x01,0x10,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
-      mxf_write_generic_sound_desc },
-    // D-10 625/50 PAL 30mb/s
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x05,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x05,0x01,0x01,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x01,0x02,0x01,0x05 },
-      mxf_write_cdci_desc },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x05,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x06,0x01,0x10,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
-      mxf_write_generic_sound_desc },
-    // D-10 525/60 NTSC 30mb/s
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x06,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x05,0x01,0x01,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x01,0x02,0x02,0x01,0x02,0x01,0x06 },
-      mxf_write_cdci_desc },
-    { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x06,0x01 },
-      { 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x06,0x01,0x10,0x00 },
-      { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 },
-      mxf_write_generic_sound_desc },
-    { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
-      { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
-      { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
-      NULL },
-};
-
-typedef struct MXFContext {
-    int64_t footer_partition_offset;
-    int essence_container_count;
-    AVRational time_base;
-    int header_written;
-    MXFIndexEntry *index_entries;
-    unsigned edit_units_count;
-    uint64_t timestamp;   ///< timestamp, as year(16),month(8),day(8),hour(8),minutes(8),msec/4(8)
-    uint8_t slice_count;  ///< index slice count minus 1 (1 if no audio, 0 otherwise)
-    int last_indexed_edit_unit;
-    uint64_t *body_partition_offset;
-    unsigned body_partitions_count;
-    int last_key_index;  ///< index of last key frame
-    uint64_t duration;
-    AVStream *timecode_track;
-    int timecode_base;       ///< rounded time code base (25 or 30)
-    int timecode_start;      ///< frame number computed from mpeg-2 gop header timecode
-    int timecode_drop_frame; ///< time code use drop frame method frop mpeg-2 essence gop header
-    int edit_unit_byte_count; ///< fixed edit unit byte count
-    uint64_t body_offset;
-    uint32_t instance_number;
-    uint8_t umid[16];        ///< unique material identifier
-} MXFContext;
-
-static const uint8_t uuid_base[]            = { 0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff,0x29,0xbd };
-static const uint8_t umid_ul[]              = { 0x06,0x0A,0x2B,0x34,0x01,0x01,0x01,0x05,0x01,0x01,0x0D,0x00,0x13 };
-
-/**
- * complete key for operation pattern, partitions, and primer pack
- */
-static const uint8_t op1a_ul[]                     = { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x02,0x01,0x01,0x01,0x09,0x00 };
-static const uint8_t footer_partition_key[]        = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x02,0x01,0x01,0x04,0x04,0x00 }; // ClosedComplete
-static const uint8_t primer_pack_key[]             = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x02,0x01,0x01,0x05,0x01,0x00 };
-static const uint8_t index_table_segment_key[]     = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x10,0x01,0x00 };
-static const uint8_t random_index_pack_key[]       = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x02,0x01,0x01,0x11,0x01,0x00 };
-static const uint8_t header_open_partition_key[]   = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x02,0x01,0x01,0x02,0x01,0x00 }; // OpenIncomplete
-static const uint8_t header_closed_partition_key[] = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x02,0x01,0x01,0x02,0x04,0x00 }; // ClosedComplete
-static const uint8_t klv_fill_key[]                = { 0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x03,0x01,0x02,0x10,0x01,0x00,0x00,0x00 };
-static const uint8_t body_partition_key[]          = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x02,0x01,0x01,0x03,0x04,0x00 }; // ClosedComplete
-
-/**
- * partial key for header metadata
- */
-static const uint8_t header_metadata_key[]  = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01 };
-static const uint8_t multiple_desc_ul[]     = { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x0D,0x01,0x03,0x01,0x02,0x7F,0x01,0x00 };
-
-/**
- * SMPTE RP210 http://www.smpte-ra.org/mdd/index.html
- */
-static const MXFLocalTagPair mxf_local_tag_batch[] = {
-    // preface set
-    { 0x3C0A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x01,0x01,0x15,0x02,0x00,0x00,0x00,0x00}}, /* Instance UID */
-    { 0x3B02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x04,0x00,0x00}}, /* Last Modified Date */
-    { 0x3B05, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x01,0x02,0x01,0x05,0x00,0x00,0x00}}, /* Version */
-    { 0x3B06, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x04,0x00,0x00}}, /* Identifications reference */
-    { 0x3B03, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x01,0x00,0x00}}, /* Content Storage reference */
-    { 0x3B09, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x01,0x02,0x02,0x03,0x00,0x00,0x00,0x00}}, /* Operational Pattern UL */
-    { 0x3B0A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x01,0x02,0x02,0x10,0x02,0x01,0x00,0x00}}, /* Essence Containers UL batch */
-    { 0x3B0B, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x01,0x02,0x02,0x10,0x02,0x02,0x00,0x00}}, /* DM Schemes UL batch */
-    // Identification
-    { 0x3C09, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x01,0x00,0x00,0x00}}, /* This Generation UID */
-    { 0x3C01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x02,0x01,0x00,0x00}}, /* Company Name */
-    { 0x3C02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x03,0x01,0x00,0x00}}, /* Product Name */
-    { 0x3C04, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x05,0x01,0x00,0x00}}, /* Version String */
-    { 0x3C05, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x07,0x00,0x00,0x00}}, /* Product ID */
-    { 0x3C06, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x03,0x00,0x00}}, /* Modification Date */
-    // Content Storage
-    { 0x1901, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x05,0x01,0x00,0x00}}, /* Package strong reference batch */
-    { 0x1902, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x05,0x02,0x00,0x00}}, /* Package strong reference batch */
-    // Essence Container Data
-    { 0x2701, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x06,0x01,0x00,0x00,0x00}}, /* Linked Package UID */
-    { 0x3F07, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x01,0x03,0x04,0x04,0x00,0x00,0x00,0x00}}, /* BodySID */
-    // Package
-    { 0x4401, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x01,0x01,0x15,0x10,0x00,0x00,0x00,0x00}}, /* Package UID */
-    { 0x4405, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x01,0x03,0x00,0x00}}, /* Package Creation Date */
-    { 0x4404, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x05,0x00,0x00}}, /* Package Modified Date */
-    { 0x4403, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x05,0x00,0x00}}, /* Tracks Strong reference array */
-    { 0x4701, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x03,0x00,0x00}}, /* Descriptor */
-    // Track
-    { 0x4801, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x01,0x07,0x01,0x01,0x00,0x00,0x00,0x00}}, /* Track ID */
-    { 0x4804, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x01,0x04,0x01,0x03,0x00,0x00,0x00,0x00}}, /* Track Number */
-    { 0x4B01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x30,0x04,0x05,0x00,0x00,0x00,0x00}}, /* Edit Rate */
-    { 0x4B02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x03,0x01,0x03,0x00,0x00}}, /* Origin */
-    { 0x4803, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x04,0x00,0x00}}, /* Sequence reference */
-    // Sequence
-    { 0x0201, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x07,0x01,0x00,0x00,0x00,0x00,0x00}}, /* Data Definition UL */
-    { 0x0202, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x02,0x01,0x01,0x03,0x00,0x00}}, /* Duration */
-    { 0x1001, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x09,0x00,0x00}}, /* Structural Components reference array */
-    // Source Clip
-    { 0x1201, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x03,0x01,0x04,0x00,0x00}}, /* Start position */
-    { 0x1101, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x03,0x01,0x00,0x00,0x00}}, /* SourcePackageID */
-    { 0x1102, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x03,0x02,0x00,0x00,0x00}}, /* SourceTrackID */
-    // Timecode Component
-    { 0x1501, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x03,0x01,0x05,0x00,0x00}}, /* Start Time Code */
-    { 0x1502, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x04,0x01,0x01,0x02,0x06,0x00,0x00}}, /* Rounded Time Code Base */
-    { 0x1503, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x04,0x01,0x01,0x05,0x00,0x00,0x00}}, /* Drop Frame */
-    // File Descriptor
-    { 0x3F01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x04,0x06,0x0B,0x00,0x00}}, /* Sub Descriptors reference array */
-    { 0x3006, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x06,0x01,0x01,0x03,0x05,0x00,0x00,0x00}}, /* Linked Track ID */
-    { 0x3001, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x00,0x00,0x00,0x00}}, /* SampleRate */
-    { 0x3004, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x01,0x02,0x00,0x00}}, /* Essence Container */
-    // Generic Picture Essence Descriptor
-    { 0x320C, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x03,0x01,0x04,0x00,0x00,0x00}}, /* Frame Layout */
-    { 0x320D, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x03,0x02,0x05,0x00,0x00,0x00}}, /* Video Line Map */
-    { 0x3203, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x02,0x00,0x00,0x00}}, /* Stored Width */
-    { 0x3202, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x01,0x00,0x00,0x00}}, /* Stored Height */
-    { 0x3209, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0C,0x00,0x00,0x00}}, /* Display Width */
-    { 0x3208, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0B,0x00,0x00,0x00}}, /* Display Height */
-    { 0x320E, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x00,0x00,0x00}}, /* Aspect Ratio */
-    { 0x3201, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x06,0x01,0x00,0x00,0x00,0x00}}, /* Picture Essence Coding */
-    // CDCI Picture Essence Descriptor
-    { 0x3301, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x05,0x03,0x0A,0x00,0x00,0x00}}, /* Component Depth */
-    { 0x3302, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x05,0x00,0x00,0x00}}, /* Horizontal Subsampling */
-    // Generic Sound Essence Descriptor
-    { 0x3D02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x01,0x04,0x00,0x00,0x00}}, /* Locked/Unlocked */
-    { 0x3D03, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x01,0x01,0x01,0x00,0x00}}, /* Audio sampling rate */
-    { 0x3D07, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x01,0x01,0x04,0x00,0x00,0x00}}, /* ChannelCount */
-    { 0x3D01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x03,0x04,0x00,0x00,0x00}}, /* Quantization bits */
-    { 0x3D06, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x02,0x04,0x02,0x00,0x00,0x00,0x00}}, /* Sound Essence Compression */
-    // Index Table Segment
-    { 0x3F0B, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x05,0x30,0x04,0x06,0x00,0x00,0x00,0x00}}, /* Index Edit Rate */
-    { 0x3F0C, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x07,0x02,0x01,0x03,0x01,0x0A,0x00,0x00}}, /* Index Start Position */
-    { 0x3F0D, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x07,0x02,0x02,0x01,0x01,0x02,0x00,0x00}}, /* Index Duration */
-    { 0x3F05, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x06,0x02,0x01,0x00,0x00,0x00,0x00}}, /* Edit Unit Byte Count */
-    { 0x3F06, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x01,0x03,0x04,0x05,0x00,0x00,0x00,0x00}}, /* IndexSID */
-    { 0x3F08, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x04,0x04,0x01,0x01,0x00,0x00,0x00}}, /* Slice Count */
-    { 0x3F09, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x04,0x04,0x01,0x06,0x00,0x00,0x00}}, /* Delta Entry Array */
-    { 0x3F0A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x04,0x04,0x02,0x05,0x00,0x00,0x00}}, /* Index Entry Array */
-    // MPEG video Descriptor
-    { 0x8000, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x01,0x06,0x02,0x01,0x0B,0x00,0x00}}, /* BitRate */
-    { 0x8007, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x01,0x06,0x02,0x01,0x0A,0x00,0x00}}, /* ProfileAndLevel */
-    // Wave Audio Essence Descriptor
-    { 0x3D09, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x03,0x05,0x00,0x00,0x00}}, /* Average Bytes Per Second */
-    { 0x3D0A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x02,0x01,0x00,0x00,0x00}}, /* Block Align */
-};
-
-static void mxf_write_uuid(AVIOContext *pb, enum MXFMetadataSetType type, int value)
-{
-    avio_write(pb, uuid_base, 12);
-    avio_wb16(pb, type);
-    avio_wb16(pb, value);
-}
-
-static void mxf_write_umid(AVFormatContext *s, int type)
-{
-    MXFContext *mxf = s->priv_data;
-    avio_write(s->pb, umid_ul, 13);
-    avio_wb24(s->pb, mxf->instance_number);
-    avio_write(s->pb, mxf->umid, 15);
-    avio_w8(s->pb, type);
-}
-
-static void mxf_write_refs_count(AVIOContext *pb, int ref_count)
-{
-    avio_wb32(pb, ref_count);
-    avio_wb32(pb, 16);
-}
-
-static int klv_ber_length(uint64_t len)
-{
-    if (len < 128)
-        return 1;
-    else
-        return (av_log2(len) >> 3) + 2;
-}
-
-static int klv_encode_ber_length(AVIOContext *pb, uint64_t len)
-{
-    // Determine the best BER size
-    int size;
-    if (len < 128) {
-        //short form
-        avio_w8(pb, len);
-        return 1;
-    }
-
-    size = (av_log2(len) >> 3) + 1;
-
-    // long form
-    avio_w8(pb, 0x80 + size);
-    while(size) {
-        size--;
-        avio_w8(pb, len >> 8 * size & 0xff);
-    }
-    return 0;
-}
-
-static void klv_encode_ber4_length(AVIOContext *pb, int len)
-{
-    avio_w8(pb, 0x80 + 3);
-    avio_wb24(pb, len);
-}
-
-/*
- * Get essence container ul index
- */
-static int mxf_get_essence_container_ul_index(enum AVCodecID id)
-{
-    int i;
-    for (i = 0; mxf_essence_mappings[i].id; i++)
-        if (mxf_essence_mappings[i].id == id)
-            return mxf_essence_mappings[i].index;
-    return -1;
-}
-
-static void mxf_write_primer_pack(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    int local_tag_number, i = 0;
-
-    local_tag_number = FF_ARRAY_ELEMS(mxf_local_tag_batch);
-
-    avio_write(pb, primer_pack_key, 16);
-    klv_encode_ber_length(pb, local_tag_number * 18 + 8);
-
-    avio_wb32(pb, local_tag_number); // local_tag num
-    avio_wb32(pb, 18); // item size, always 18 according to the specs
-
-    for (i = 0; i < local_tag_number; i++) {
-        avio_wb16(pb, mxf_local_tag_batch[i].local_tag);
-        avio_write(pb, mxf_local_tag_batch[i].uid, 16);
-    }
-}
-
-static void mxf_write_local_tag(AVIOContext *pb, int size, int tag)
-{
-    avio_wb16(pb, tag);
-    avio_wb16(pb, size);
-}
-
-static void mxf_write_metadata_key(AVIOContext *pb, unsigned int value)
-{
-    avio_write(pb, header_metadata_key, 13);
-    avio_wb24(pb, value);
-}
-
-static void mxf_free(AVFormatContext *s)
-{
-    int i;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        av_freep(&st->priv_data);
-    }
-}
-
-static const MXFCodecUL *mxf_get_data_definition_ul(int type)
-{
-    const MXFCodecUL *uls = ff_mxf_data_definition_uls;
-    while (uls->uid[0]) {
-        if (type == uls->id)
-            break;
-        uls++;
-    }
-    return uls;
-}
-
-static void mxf_write_essence_container_refs(AVFormatContext *s)
-{
-    MXFContext *c = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int i;
-
-    mxf_write_refs_count(pb, c->essence_container_count);
-    av_log(s,AV_LOG_DEBUG, "essence container count:%d\n", c->essence_container_count);
-    for (i = 0; i < c->essence_container_count; i++) {
-        MXFStreamContext *sc = s->streams[i]->priv_data;
-        avio_write(pb, mxf_essence_container_uls[sc->index].container_ul, 16);
-    }
-}
-
-static void mxf_write_preface(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    mxf_write_metadata_key(pb, 0x012f00);
-    PRINT_KEY(s, "preface key", pb->buf_ptr - 16);
-    klv_encode_ber_length(pb, 130 + 16 * mxf->essence_container_count);
-
-    // write preface set uid
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, Preface, 0);
-    PRINT_KEY(s, "preface uid", pb->buf_ptr - 16);
-
-    // last modified date
-    mxf_write_local_tag(pb, 8, 0x3B02);
-    avio_wb64(pb, mxf->timestamp);
-
-    // write version
-    mxf_write_local_tag(pb, 2, 0x3B05);
-    avio_wb16(pb, 258); // v1.2
-
-    // write identification_refs
-    mxf_write_local_tag(pb, 16 + 8, 0x3B06);
-    mxf_write_refs_count(pb, 1);
-    mxf_write_uuid(pb, Identification, 0);
-
-    // write content_storage_refs
-    mxf_write_local_tag(pb, 16, 0x3B03);
-    mxf_write_uuid(pb, ContentStorage, 0);
-
-    // operational pattern
-    mxf_write_local_tag(pb, 16, 0x3B09);
-    avio_write(pb, op1a_ul, 16);
-
-    // write essence_container_refs
-    mxf_write_local_tag(pb, 8 + 16 * mxf->essence_container_count, 0x3B0A);
-    mxf_write_essence_container_refs(s);
-
-    // write dm_scheme_refs
-    mxf_write_local_tag(pb, 8, 0x3B0B);
-    avio_wb64(pb, 0);
-}
-
-/*
- * Write a local tag containing an ascii string as utf-16
- */
-static void mxf_write_local_tag_utf16(AVIOContext *pb, int tag, const char *value)
-{
-    int i, size = strlen(value);
-    mxf_write_local_tag(pb, size*2, tag);
-    for (i = 0; i < size; i++)
-        avio_wb16(pb, value[i]);
-}
-
-static void mxf_write_identification(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    const char *company = "Libav";
-    const char *product = "OP1a Muxer";
-    const char *version;
-    int length;
-
-    mxf_write_metadata_key(pb, 0x013000);
-    PRINT_KEY(s, "identification key", pb->buf_ptr - 16);
-
-    version = s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT ?
-        "0.0.0" : AV_STRINGIFY(LIBAVFORMAT_VERSION);
-    length = 84 + (strlen(company)+strlen(product)+strlen(version))*2; // utf-16
-    klv_encode_ber_length(pb, length);
-
-    // write uid
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, Identification, 0);
-    PRINT_KEY(s, "identification uid", pb->buf_ptr - 16);
-
-    // write generation uid
-    mxf_write_local_tag(pb, 16, 0x3C09);
-    mxf_write_uuid(pb, Identification, 1);
-
-    mxf_write_local_tag_utf16(pb, 0x3C01, company); // Company Name
-    mxf_write_local_tag_utf16(pb, 0x3C02, product); // Product Name
-    mxf_write_local_tag_utf16(pb, 0x3C04, version); // Version String
-
-    // write product uid
-    mxf_write_local_tag(pb, 16, 0x3C05);
-    mxf_write_uuid(pb, Identification, 2);
-
-    // modification date
-    mxf_write_local_tag(pb, 8, 0x3C06);
-    avio_wb64(pb, mxf->timestamp);
-}
-
-static void mxf_write_content_storage(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-
-    mxf_write_metadata_key(pb, 0x011800);
-    PRINT_KEY(s, "content storage key", pb->buf_ptr - 16);
-    klv_encode_ber_length(pb, 92);
-
-    // write uid
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, ContentStorage, 0);
-    PRINT_KEY(s, "content storage uid", pb->buf_ptr - 16);
-
-    // write package reference
-    mxf_write_local_tag(pb, 16 * 2 + 8, 0x1901);
-    mxf_write_refs_count(pb, 2);
-    mxf_write_uuid(pb, MaterialPackage, 0);
-    mxf_write_uuid(pb, SourcePackage, 0);
-
-    // write essence container data
-    mxf_write_local_tag(pb, 8 + 16, 0x1902);
-    mxf_write_refs_count(pb, 1);
-    mxf_write_uuid(pb, EssenceContainerData, 0);
-}
-
-static void mxf_write_track(AVFormatContext *s, AVStream *st, enum MXFMetadataSetType type)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    MXFStreamContext *sc = st->priv_data;
-
-    mxf_write_metadata_key(pb, 0x013b00);
-    PRINT_KEY(s, "track key", pb->buf_ptr - 16);
-    klv_encode_ber_length(pb, 80);
-
-    // write track uid
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, type == MaterialPackage ? Track : Track + TypeBottom, st->index);
-    PRINT_KEY(s, "track uid", pb->buf_ptr - 16);
-
-    // write track id
-    mxf_write_local_tag(pb, 4, 0x4801);
-    avio_wb32(pb, st->index+2);
-
-    // write track number
-    mxf_write_local_tag(pb, 4, 0x4804);
-    if (type == MaterialPackage)
-        avio_wb32(pb, 0); // track number of material package is 0
-    else
-        avio_write(pb, sc->track_essence_element_key + 12, 4);
-
-    mxf_write_local_tag(pb, 8, 0x4B01);
-    avio_wb32(pb, mxf->time_base.den);
-    avio_wb32(pb, mxf->time_base.num);
-
-    // write origin
-    mxf_write_local_tag(pb, 8, 0x4B02);
-    avio_wb64(pb, 0);
-
-    // write sequence refs
-    mxf_write_local_tag(pb, 16, 0x4803);
-    mxf_write_uuid(pb, type == MaterialPackage ? Sequence: Sequence + TypeBottom, st->index);
-}
-
-static const uint8_t smpte_12m_timecode_track_data_ul[] = { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x01,0x01,0x00,0x00,0x00 };
-
-static void mxf_write_common_fields(AVFormatContext *s, AVStream *st)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    // find data define uls
-    mxf_write_local_tag(pb, 16, 0x0201);
-    if (st == mxf->timecode_track)
-        avio_write(pb, smpte_12m_timecode_track_data_ul, 16);
-    else {
-        const MXFCodecUL *data_def_ul = mxf_get_data_definition_ul(st->codec->codec_type);
-        avio_write(pb, data_def_ul->uid, 16);
-    }
-
-    // write duration
-    mxf_write_local_tag(pb, 8, 0x0202);
-    avio_wb64(pb, mxf->duration);
-}
-
-static void mxf_write_sequence(AVFormatContext *s, AVStream *st, enum MXFMetadataSetType type)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    enum MXFMetadataSetType component;
-
-    mxf_write_metadata_key(pb, 0x010f00);
-    PRINT_KEY(s, "sequence key", pb->buf_ptr - 16);
-    klv_encode_ber_length(pb, 80);
-
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, type == MaterialPackage ? Sequence: Sequence + TypeBottom, st->index);
-
-    PRINT_KEY(s, "sequence uid", pb->buf_ptr - 16);
-    mxf_write_common_fields(s, st);
-
-    // write structural component
-    mxf_write_local_tag(pb, 16 + 8, 0x1001);
-    mxf_write_refs_count(pb, 1);
-    if (st == mxf->timecode_track)
-        component = TimecodeComponent;
-    else
-        component = SourceClip;
-    if (type == SourcePackage)
-        component += TypeBottom;
-    mxf_write_uuid(pb, component, st->index);
-}
-
-static void mxf_write_timecode_component(AVFormatContext *s, AVStream *st, enum MXFMetadataSetType type)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    mxf_write_metadata_key(pb, 0x011400);
-    klv_encode_ber_length(pb, 75);
-
-    // UID
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, type == MaterialPackage ? TimecodeComponent :
-                   TimecodeComponent + TypeBottom, st->index);
-
-    mxf_write_common_fields(s, st);
-
-    // Start Time Code
-    mxf_write_local_tag(pb, 8, 0x1501);
-    avio_wb64(pb, mxf->timecode_start);
-
-    // Rounded Time Code Base
-    mxf_write_local_tag(pb, 2, 0x1502);
-    avio_wb16(pb, mxf->timecode_base);
-
-    // Drop Frame
-    mxf_write_local_tag(pb, 1, 0x1503);
-    avio_w8(pb, mxf->timecode_drop_frame);
-}
-
-static void mxf_write_structural_component(AVFormatContext *s, AVStream *st, enum MXFMetadataSetType type)
-{
-    AVIOContext *pb = s->pb;
-    int i;
-
-    mxf_write_metadata_key(pb, 0x011100);
-    PRINT_KEY(s, "sturctural component key", pb->buf_ptr - 16);
-    klv_encode_ber_length(pb, 108);
-
-    // write uid
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, type == MaterialPackage ? SourceClip: SourceClip + TypeBottom, st->index);
-
-    PRINT_KEY(s, "structural component uid", pb->buf_ptr - 16);
-    mxf_write_common_fields(s, st);
-
-    // write start_position
-    mxf_write_local_tag(pb, 8, 0x1201);
-    avio_wb64(pb, 0);
-
-    // write source package uid, end of the reference
-    mxf_write_local_tag(pb, 32, 0x1101);
-    if (type == SourcePackage) {
-        for (i = 0; i < 4; i++)
-            avio_wb64(pb, 0);
-    } else
-        mxf_write_umid(s, 1);
-
-    // write source track id
-    mxf_write_local_tag(pb, 4, 0x1102);
-    if (type == SourcePackage)
-        avio_wb32(pb, 0);
-    else
-        avio_wb32(pb, st->index+2);
-}
-
-static void mxf_write_multi_descriptor(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    const uint8_t *ul;
-    int i;
-
-    mxf_write_metadata_key(pb, 0x014400);
-    PRINT_KEY(s, "multiple descriptor key", pb->buf_ptr - 16);
-    klv_encode_ber_length(pb, 64 + 16 * s->nb_streams);
-
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, MultipleDescriptor, 0);
-    PRINT_KEY(s, "multi_desc uid", pb->buf_ptr - 16);
-
-    // write sample rate
-    mxf_write_local_tag(pb, 8, 0x3001);
-    avio_wb32(pb, mxf->time_base.den);
-    avio_wb32(pb, mxf->time_base.num);
-
-    // write essence container ul
-    mxf_write_local_tag(pb, 16, 0x3004);
-    if (mxf->essence_container_count > 1)
-        ul = multiple_desc_ul;
-    else {
-        MXFStreamContext *sc = s->streams[0]->priv_data;
-        ul = mxf_essence_container_uls[sc->index].container_ul;
-    }
-    avio_write(pb, ul, 16);
-
-    // write sub descriptor refs
-    mxf_write_local_tag(pb, s->nb_streams * 16 + 8, 0x3F01);
-    mxf_write_refs_count(pb, s->nb_streams);
-    for (i = 0; i < s->nb_streams; i++)
-        mxf_write_uuid(pb, SubDescriptor, i);
-}
-
-static void mxf_write_generic_desc(AVFormatContext *s, AVStream *st, const UID key, unsigned size)
-{
-    MXFContext *mxf = s->priv_data;
-    MXFStreamContext *sc = st->priv_data;
-    AVIOContext *pb = s->pb;
-
-    avio_write(pb, key, 16);
-    klv_encode_ber4_length(pb, size+20+8+12+20);
-
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, SubDescriptor, st->index);
-
-    mxf_write_local_tag(pb, 4, 0x3006);
-    avio_wb32(pb, st->index+2);
-
-    mxf_write_local_tag(pb, 8, 0x3001);
-    avio_wb32(pb, mxf->time_base.den);
-    avio_wb32(pb, mxf->time_base.num);
-
-    mxf_write_local_tag(pb, 16, 0x3004);
-    avio_write(pb, mxf_essence_container_uls[sc->index].container_ul, 16);
-}
-
-static const UID mxf_mpegvideo_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 };
-static const UID mxf_wav_descriptor_key       = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 };
-static const UID mxf_aes3_descriptor_key      = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 };
-static const UID mxf_cdci_descriptor_key      = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x28,0x00 };
-static const UID mxf_generic_sound_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x42,0x00 };
-
-static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID key, unsigned size)
-{
-    MXFStreamContext *sc = st->priv_data;
-    AVIOContext *pb = s->pb;
-    int stored_height = (st->codec->height+15)/16*16;
-    int display_height;
-    int f1, f2;
-
-    mxf_write_generic_desc(s, st, key, size+8+8+8+8+8+8+5+16+sc->interlaced*4+12+20);
-
-    mxf_write_local_tag(pb, 4, 0x3203);
-    avio_wb32(pb, st->codec->width);
-
-    mxf_write_local_tag(pb, 4, 0x3202);
-    avio_wb32(pb, stored_height>>sc->interlaced);
-
-    mxf_write_local_tag(pb, 4, 0x3209);
-    avio_wb32(pb, st->codec->width);
-
-    if (st->codec->height == 608) // PAL + VBI
-        display_height = 576;
-    else if (st->codec->height == 512)  // NTSC + VBI
-        display_height = 486;
-    else
-        display_height = st->codec->height;
-
-    mxf_write_local_tag(pb, 4, 0x3208);
-    avio_wb32(pb, display_height>>sc->interlaced);
-
-    // component depth
-    mxf_write_local_tag(pb, 4, 0x3301);
-    avio_wb32(pb, 8);
-
-    // horizontal subsampling
-    mxf_write_local_tag(pb, 4, 0x3302);
-    avio_wb32(pb, 2);
-
-    // frame layout
-    mxf_write_local_tag(pb, 1, 0x320C);
-    avio_w8(pb, sc->interlaced);
-
-    // video line map
-    switch (st->codec->height) {
-    case  576: f1 = 23; f2 = 336; break;
-    case  608: f1 =  7; f2 = 320; break;
-    case  480: f1 = 20; f2 = 283; break;
-    case  512: f1 =  7; f2 = 270; break;
-    case  720: f1 = 26; f2 =   0; break; // progressive
-    case 1080: f1 = 21; f2 = 584; break;
-    default:   f1 =  0; f2 =   0; break;
-    }
-
-    if (!sc->interlaced) {
-        f2  = 0;
-        f1 *= 2;
-    }
-
-    mxf_write_local_tag(pb, 12+sc->interlaced*4, 0x320D);
-    avio_wb32(pb, sc->interlaced ? 2 : 1);
-    avio_wb32(pb, 4);
-    avio_wb32(pb, f1);
-    if (sc->interlaced)
-        avio_wb32(pb, f2);
-
-    mxf_write_local_tag(pb, 8, 0x320E);
-    avio_wb32(pb, sc->aspect_ratio.num);
-    avio_wb32(pb, sc->aspect_ratio.den);
-
-    mxf_write_local_tag(pb, 16, 0x3201);
-    avio_write(pb, *sc->codec_ul, 16);
-}
-
-static void mxf_write_cdci_desc(AVFormatContext *s, AVStream *st)
-{
-    mxf_write_cdci_common(s, st, mxf_cdci_descriptor_key, 0);
-}
-
-static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st)
-{
-    AVIOContext *pb = s->pb;
-    int profile_and_level = (st->codec->profile<<4) | st->codec->level;
-
-    mxf_write_cdci_common(s, st, mxf_mpegvideo_descriptor_key, 8+5);
-
-    // bit rate
-    mxf_write_local_tag(pb, 4, 0x8000);
-    avio_wb32(pb, st->codec->bit_rate);
-
-    // profile and level
-    mxf_write_local_tag(pb, 1, 0x8007);
-    if (!st->codec->profile)
-        profile_and_level |= 0x80; // escape bit
-    avio_w8(pb, profile_and_level);
-}
-
-static void mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, const UID key, unsigned size)
-{
-    AVIOContext *pb = s->pb;
-
-    mxf_write_generic_desc(s, st, key, size+5+12+8+8);
-
-    // audio locked
-    mxf_write_local_tag(pb, 1, 0x3D02);
-    avio_w8(pb, 1);
-
-    // write audio sampling rate
-    mxf_write_local_tag(pb, 8, 0x3D03);
-    avio_wb32(pb, st->codec->sample_rate);
-    avio_wb32(pb, 1);
-
-    mxf_write_local_tag(pb, 4, 0x3D07);
-    avio_wb32(pb, st->codec->channels);
-
-    mxf_write_local_tag(pb, 4, 0x3D01);
-    avio_wb32(pb, av_get_bits_per_sample(st->codec->codec_id));
-}
-
-static void mxf_write_wav_common(AVFormatContext *s, AVStream *st, const UID key, unsigned size)
-{
-    AVIOContext *pb = s->pb;
-
-    mxf_write_generic_sound_common(s, st, key, size+6+8);
-
-    mxf_write_local_tag(pb, 2, 0x3D0A);
-    avio_wb16(pb, st->codec->block_align);
-
-    // avg bytes per sec
-    mxf_write_local_tag(pb, 4, 0x3D09);
-    avio_wb32(pb, st->codec->block_align*st->codec->sample_rate);
-}
-
-static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st)
-{
-    mxf_write_wav_common(s, st, mxf_wav_descriptor_key, 0);
-}
-
-static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st)
-{
-    mxf_write_wav_common(s, st, mxf_aes3_descriptor_key, 0);
-}
-
-static void mxf_write_generic_sound_desc(AVFormatContext *s, AVStream *st)
-{
-    mxf_write_generic_sound_common(s, st, mxf_generic_sound_descriptor_key, 0);
-}
-
-static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int i, track_count = s->nb_streams+1;
-
-    if (type == MaterialPackage) {
-        mxf_write_metadata_key(pb, 0x013600);
-        PRINT_KEY(s, "Material Package key", pb->buf_ptr - 16);
-        klv_encode_ber_length(pb, 92 + 16*track_count);
-    } else {
-        mxf_write_metadata_key(pb, 0x013700);
-        PRINT_KEY(s, "Source Package key", pb->buf_ptr - 16);
-        klv_encode_ber_length(pb, 112 + 16*track_count); // 20 bytes length for descriptor reference
-    }
-
-    // write uid
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, type, 0);
-    av_log(s,AV_LOG_DEBUG, "package type:%d\n", type);
-    PRINT_KEY(s, "package uid", pb->buf_ptr - 16);
-
-    // write package umid
-    mxf_write_local_tag(pb, 32, 0x4401);
-    mxf_write_umid(s, type == SourcePackage);
-    PRINT_KEY(s, "package umid second part", pb->buf_ptr - 16);
-
-    // package creation date
-    mxf_write_local_tag(pb, 8, 0x4405);
-    avio_wb64(pb, mxf->timestamp);
-
-    // package modified date
-    mxf_write_local_tag(pb, 8, 0x4404);
-    avio_wb64(pb, mxf->timestamp);
-
-    // write track refs
-    mxf_write_local_tag(pb, track_count*16 + 8, 0x4403);
-    mxf_write_refs_count(pb, track_count);
-    mxf_write_uuid(pb, type == MaterialPackage ? Track :
-                   Track + TypeBottom, -1); // timecode track
-    for (i = 0; i < s->nb_streams; i++)
-        mxf_write_uuid(pb, type == MaterialPackage ? Track : Track + TypeBottom, i);
-
-    // write multiple descriptor reference
-    if (type == SourcePackage) {
-        mxf_write_local_tag(pb, 16, 0x4701);
-        if (s->nb_streams > 1) {
-            mxf_write_uuid(pb, MultipleDescriptor, 0);
-            mxf_write_multi_descriptor(s);
-        } else
-            mxf_write_uuid(pb, SubDescriptor, 0);
-    }
-
-    // write timecode track
-    mxf_write_track(s, mxf->timecode_track, type);
-    mxf_write_sequence(s, mxf->timecode_track, type);
-    mxf_write_timecode_component(s, mxf->timecode_track, type);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        mxf_write_track(s, st, type);
-        mxf_write_sequence(s, st, type);
-        mxf_write_structural_component(s, st, type);
-
-        if (type == SourcePackage) {
-            MXFStreamContext *sc = st->priv_data;
-            mxf_essence_container_uls[sc->index].write_desc(s, st);
-        }
-    }
-}
-
-static int mxf_write_essence_container_data(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-
-    mxf_write_metadata_key(pb, 0x012300);
-    klv_encode_ber_length(pb, 72);
-
-    mxf_write_local_tag(pb, 16, 0x3C0A); // Instance UID
-    mxf_write_uuid(pb, EssenceContainerData, 0);
-
-    mxf_write_local_tag(pb, 32, 0x2701); // Linked Package UID
-    mxf_write_umid(s, 1);
-
-    mxf_write_local_tag(pb, 4, 0x3F07); // BodySID
-    avio_wb32(pb, 1);
-
-    mxf_write_local_tag(pb, 4, 0x3F06); // IndexSID
-    avio_wb32(pb, 2);
-
-    return 0;
-}
-
-static int mxf_write_header_metadata_sets(AVFormatContext *s)
-{
-    mxf_write_preface(s);
-    mxf_write_identification(s);
-    mxf_write_content_storage(s);
-    mxf_write_package(s, MaterialPackage);
-    mxf_write_package(s, SourcePackage);
-    mxf_write_essence_container_data(s);
-    return 0;
-}
-
-static unsigned klv_fill_size(uint64_t size)
-{
-    unsigned pad = KAG_SIZE - (size & (KAG_SIZE-1));
-    if (pad < 20) // smallest fill item possible
-        return pad + KAG_SIZE;
-    else
-        return pad & (KAG_SIZE-1);
-}
-
-static void mxf_write_index_table_segment(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int i, j, temporal_reordering = 0;
-    int key_index = mxf->last_key_index;
-
-    av_log(s, AV_LOG_DEBUG, "edit units count %d\n", mxf->edit_units_count);
-
-    if (!mxf->edit_units_count && !mxf->edit_unit_byte_count)
-        return;
-
-    avio_write(pb, index_table_segment_key, 16);
-
-    if (mxf->edit_unit_byte_count) {
-        klv_encode_ber_length(pb, 80);
-    } else {
-        klv_encode_ber_length(pb, 85 + 12+(s->nb_streams+1)*6 +
-                              12+mxf->edit_units_count*(11+mxf->slice_count*4));
-    }
-
-    // instance id
-    mxf_write_local_tag(pb, 16, 0x3C0A);
-    mxf_write_uuid(pb, IndexTableSegment, 0);
-
-    // index edit rate
-    mxf_write_local_tag(pb, 8, 0x3F0B);
-    avio_wb32(pb, mxf->time_base.den);
-    avio_wb32(pb, mxf->time_base.num);
-
-    // index start position
-    mxf_write_local_tag(pb, 8, 0x3F0C);
-    avio_wb64(pb, mxf->last_indexed_edit_unit);
-
-    // index duration
-    mxf_write_local_tag(pb, 8, 0x3F0D);
-    if (mxf->edit_unit_byte_count)
-        avio_wb64(pb, 0); // index table covers whole container
-    else
-        avio_wb64(pb, mxf->edit_units_count);
-
-    // edit unit byte count
-    mxf_write_local_tag(pb, 4, 0x3F05);
-    avio_wb32(pb, mxf->edit_unit_byte_count);
-
-    // index sid
-    mxf_write_local_tag(pb, 4, 0x3F06);
-    avio_wb32(pb, 2);
-
-    // body sid
-    mxf_write_local_tag(pb, 4, 0x3F07);
-    avio_wb32(pb, 1);
-
-    if (!mxf->edit_unit_byte_count) {
-        // real slice count - 1
-        mxf_write_local_tag(pb, 1, 0x3F08);
-        avio_w8(pb, mxf->slice_count);
-
-        // delta entry array
-        mxf_write_local_tag(pb, 8 + (s->nb_streams+1)*6, 0x3F09);
-        avio_wb32(pb, s->nb_streams+1); // num of entries
-        avio_wb32(pb, 6);               // size of one entry
-        // write system item delta entry
-        avio_w8(pb, 0);
-        avio_w8(pb, 0); // slice entry
-        avio_wb32(pb, 0); // element delta
-        for (i = 0; i < s->nb_streams; i++) {
-            AVStream *st = s->streams[i];
-            MXFStreamContext *sc = st->priv_data;
-            avio_w8(pb, sc->temporal_reordering);
-            if (sc->temporal_reordering)
-                temporal_reordering = 1;
-            if (i == 0) { // video track
-                avio_w8(pb, 0); // slice number
-                avio_wb32(pb, KAG_SIZE); // system item size including klv fill
-            } else { // audio track
-                unsigned audio_frame_size = sc->aic.samples[0]*sc->aic.sample_size;
-                audio_frame_size += klv_fill_size(audio_frame_size);
-                avio_w8(pb, 1);
-                avio_wb32(pb, (i-1)*audio_frame_size); // element delta
-            }
-        }
-
-        mxf_write_local_tag(pb, 8 + mxf->edit_units_count*(11+mxf->slice_count*4), 0x3F0A);
-        avio_wb32(pb, mxf->edit_units_count);  // num of entries
-        avio_wb32(pb, 11+mxf->slice_count*4);  // size of one entry
-
-        for (i = 0; i < mxf->edit_units_count; i++) {
-            int temporal_offset = 0;
-
-            if (!(mxf->index_entries[i].flags & 0x33)) { // I frame
-                mxf->last_key_index = key_index;
-                key_index = i;
-            }
-
-            if (temporal_reordering) {
-                int pic_num_in_gop = i - key_index;
-                if (pic_num_in_gop != mxf->index_entries[i].temporal_ref) {
-                    for (j = key_index; j < mxf->edit_units_count; j++) {
-                        if (pic_num_in_gop == mxf->index_entries[j].temporal_ref)
-                            break;
-                    }
-                    if (j == mxf->edit_units_count)
-                        av_log(s, AV_LOG_WARNING, "missing frames\n");
-                    temporal_offset = j - key_index - pic_num_in_gop;
-                }
-            }
-            avio_w8(pb, temporal_offset);
-
-            if ((mxf->index_entries[i].flags & 0x30) == 0x30) { // back and forward prediction
-                avio_w8(pb, mxf->last_key_index - i);
-            } else {
-                avio_w8(pb, key_index - i); // key frame offset
-                if ((mxf->index_entries[i].flags & 0x20) == 0x20) // only forward
-                    mxf->last_key_index = key_index;
-            }
-
-            if (!(mxf->index_entries[i].flags & 0x33) && // I frame
-                mxf->index_entries[i].flags & 0x40 && !temporal_offset)
-                mxf->index_entries[i].flags |= 0x80; // random access
-            avio_w8(pb, mxf->index_entries[i].flags);
-            // stream offset
-            avio_wb64(pb, mxf->index_entries[i].offset);
-            if (s->nb_streams > 1)
-                avio_wb32(pb, mxf->index_entries[i].slice_offset);
-        }
-
-        mxf->last_key_index = key_index - mxf->edit_units_count;
-        mxf->last_indexed_edit_unit += mxf->edit_units_count;
-        mxf->edit_units_count = 0;
-    }
-}
-
-static void mxf_write_klv_fill(AVFormatContext *s)
-{
-    unsigned pad = klv_fill_size(avio_tell(s->pb));
-    if (pad) {
-        avio_write(s->pb, klv_fill_key, 16);
-        pad -= 16 + 4;
-        klv_encode_ber4_length(s->pb, pad);
-        for (; pad; pad--)
-            avio_w8(s->pb, 0);
-        assert(!(avio_tell(s->pb) & (KAG_SIZE-1)));
-    }
-}
-
-static int mxf_write_partition(AVFormatContext *s, int bodysid,
-                                int indexsid,
-                                const uint8_t *key, int write_metadata)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t header_byte_count_offset;
-    unsigned index_byte_count = 0;
-    uint64_t partition_offset = avio_tell(pb);
-    int err;
-
-    if (!mxf->edit_unit_byte_count && mxf->edit_units_count)
-        index_byte_count = 85 + 12+(s->nb_streams+1)*6 +
-            12+mxf->edit_units_count*(11+mxf->slice_count*4);
-    else if (mxf->edit_unit_byte_count && indexsid)
-        index_byte_count = 80;
-
-    if (index_byte_count) {
-        // add encoded ber length
-        index_byte_count += 16 + klv_ber_length(index_byte_count);
-        index_byte_count += klv_fill_size(index_byte_count);
-    }
-
-    if (!memcmp(key, body_partition_key, 16)) {
-        if ((err = av_reallocp_array(&mxf->body_partition_offset, mxf->body_partitions_count + 1,
-                                     sizeof(*mxf->body_partition_offset))) < 0) {
-            mxf->body_partitions_count = 0;
-            return err;
-        }
-        mxf->body_partition_offset[mxf->body_partitions_count++] = partition_offset;
-    }
-
-    // write klv
-    avio_write(pb, key, 16);
-    klv_encode_ber_length(pb, 88 + 16 * mxf->essence_container_count);
-
-    // write partition value
-    avio_wb16(pb, 1); // majorVersion
-    avio_wb16(pb, 2); // minorVersion
-    avio_wb32(pb, KAG_SIZE); // KAGSize
-
-    avio_wb64(pb, partition_offset); // ThisPartition
-
-    if (!memcmp(key, body_partition_key, 16) && mxf->body_partitions_count > 1)
-        avio_wb64(pb, mxf->body_partition_offset[mxf->body_partitions_count-2]); // PreviousPartition
-    else if (!memcmp(key, footer_partition_key, 16) && mxf->body_partitions_count)
-        avio_wb64(pb, mxf->body_partition_offset[mxf->body_partitions_count-1]); // PreviousPartition
-    else
-        avio_wb64(pb, 0);
-
-    avio_wb64(pb, mxf->footer_partition_offset); // footerPartition
-
-    // set offset
-    header_byte_count_offset = avio_tell(pb);
-    avio_wb64(pb, 0); // headerByteCount, update later
-
-    // indexTable
-    avio_wb64(pb, index_byte_count); // indexByteCount
-    avio_wb32(pb, index_byte_count ? indexsid : 0); // indexSID
-
-    // BodyOffset
-    if (bodysid && mxf->edit_units_count && mxf->body_partitions_count) {
-        avio_wb64(pb, mxf->body_offset);
-    } else
-        avio_wb64(pb, 0);
-
-    avio_wb32(pb, bodysid); // bodySID
-
-    // operational pattern
-    avio_write(pb, op1a_ul, 16);
-
-    // essence container
-    mxf_write_essence_container_refs(s);
-
-    if (write_metadata) {
-        // mark the start of the headermetadata and calculate metadata size
-        int64_t pos, start;
-        unsigned header_byte_count;
-
-        mxf_write_klv_fill(s);
-        start = avio_tell(s->pb);
-        mxf_write_primer_pack(s);
-        mxf_write_header_metadata_sets(s);
-        pos = avio_tell(s->pb);
-        header_byte_count = pos - start + klv_fill_size(pos);
-
-        // update header_byte_count
-        avio_seek(pb, header_byte_count_offset, SEEK_SET);
-        avio_wb64(pb, header_byte_count);
-        avio_seek(pb, pos, SEEK_SET);
-    }
-
-    avio_flush(pb);
-
-    return 0;
-}
-
-static const UID mxf_mpeg2_codec_uls[] = {
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x01,0x10,0x00 }, // MP-ML I-Frame
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x01,0x11,0x00 }, // MP-ML Long GOP
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x02,0x02,0x00 }, // 422P-ML I-Frame
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x02,0x03,0x00 }, // 422P-ML Long GOP
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x03,0x02,0x00 }, // MP-HL I-Frame
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x03,0x03,0x00 }, // MP-HL Long GOP
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x04,0x02,0x00 }, // 422P-HL I-Frame
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x04,0x03,0x00 }, // 422P-HL Long GOP
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x05,0x02,0x00 }, // MP at H-14 I-Frame
-    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x03,0x04,0x01,0x02,0x02,0x01,0x05,0x03,0x00 }, // MP at H-14 Long GOP
-};
-
-static const UID *mxf_get_mpeg2_codec_ul(AVCodecContext *avctx)
-{
-    int long_gop = avctx->gop_size > 1 || avctx->has_b_frames;
-
-    if (avctx->profile == 4) { // Main
-        if (avctx->level == 8) // Main
-            return &mxf_mpeg2_codec_uls[0+long_gop];
-        else if (avctx->level == 4) // High
-            return &mxf_mpeg2_codec_uls[4+long_gop];
-        else if (avctx->level == 6) // High 14
-            return &mxf_mpeg2_codec_uls[8+long_gop];
-    } else if (avctx->profile == 0) { // 422
-        if (avctx->level == 5) // Main
-            return &mxf_mpeg2_codec_uls[2+long_gop];
-        else if (avctx->level == 2) // High
-            return &mxf_mpeg2_codec_uls[6+long_gop];
-    }
-    return NULL;
-}
-
-static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st,
-                                 AVPacket *pkt, MXFIndexEntry *e)
-{
-    MXFStreamContext *sc = st->priv_data;
-    MXFContext *mxf = s->priv_data;
-    uint32_t c = -1;
-    int i;
-
-    for(i = 0; i < pkt->size - 4; i++) {
-        c = (c<<8) + pkt->data[i];
-        if (c == 0x1b5) {
-            if ((pkt->data[i+1] & 0xf0) == 0x10) { // seq ext
-                st->codec->profile = pkt->data[i+1] & 0x07;
-                st->codec->level   = pkt->data[i+2] >> 4;
-            } else if (i + 5 < pkt->size && (pkt->data[i+1] & 0xf0) == 0x80) { // pict coding ext
-                sc->interlaced = !(pkt->data[i+5] & 0x80); // progressive frame
-                break;
-            }
-        } else if (c == 0x1b8) { // gop
-            if (pkt->data[i+4]>>6 & 0x01) { // closed
-                sc->closed_gop = 1;
-                if (e->flags & 0x40) // sequence header present
-                    e->flags |= 0x80; // random access
-            }
-            if (!mxf->header_written) {
-                unsigned hours   =  (pkt->data[i+1]>>2) & 0x1f;
-                unsigned minutes = ((pkt->data[i+1] & 0x03) << 4) | (pkt->data[i+2]>>4);
-                unsigned seconds = ((pkt->data[i+2] & 0x07) << 3) | (pkt->data[i+3]>>5);
-                unsigned frames  = ((pkt->data[i+3] & 0x1f) << 1) | (pkt->data[i+4]>>7);
-                mxf->timecode_drop_frame = !!(pkt->data[i+1] & 0x80);
-                mxf->timecode_start = (hours*3600 + minutes*60 + seconds) *
-                    mxf->timecode_base + frames;
-                if (mxf->timecode_drop_frame) {
-                    unsigned tminutes = 60 * hours + minutes;
-                    mxf->timecode_start -= 2 * (tminutes - tminutes / 10);
-                }
-                av_log(s, AV_LOG_DEBUG, "frame %d %d:%d:%d%c%d\n", mxf->timecode_start,
-                       hours, minutes, seconds, mxf->timecode_drop_frame ? ';':':', frames);
-            }
-        } else if (c == 0x1b3) { // seq
-            e->flags |= 0x40;
-            switch ((pkt->data[i+4]>>4) & 0xf) {
-            case 2:  sc->aspect_ratio = (AVRational){  4,  3}; break;
-            case 3:  sc->aspect_ratio = (AVRational){ 16,  9}; break;
-            case 4:  sc->aspect_ratio = (AVRational){221,100}; break;
-            default:
-                av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den,
-                          st->codec->width, st->codec->height, 1024*1024);
-            }
-        } else if (c == 0x100) { // pic
-            int pict_type = (pkt->data[i+2]>>3) & 0x07;
-            e->temporal_ref = (pkt->data[i+1]<<2) | (pkt->data[i+2]>>6);
-            if (pict_type == 2) { // P frame
-                e->flags |= 0x22;
-                sc->closed_gop = 0; // reset closed gop, don't matter anymore
-            } else if (pict_type == 3) { // B frame
-                if (sc->closed_gop)
-                    e->flags |= 0x13; // only backward prediction
-                else
-                    e->flags |= 0x33;
-                sc->temporal_reordering = -1;
-            } else if (!pict_type) {
-                av_log(s, AV_LOG_ERROR, "error parsing mpeg2 frame\n");
-                return 0;
-            }
-        }
-    }
-    if (s->oformat != &ff_mxf_d10_muxer)
-        sc->codec_ul = mxf_get_mpeg2_codec_ul(st->codec);
-    return !!sc->codec_ul;
-}
-
-static uint64_t mxf_parse_timestamp(time_t timestamp)
-{
-    struct tm *time = gmtime(&timestamp);
-    if (!time)
-        return 0;
-    return (uint64_t)(time->tm_year+1900) << 48 |
-           (uint64_t)(time->tm_mon+1)     << 40 |
-           (uint64_t) time->tm_mday       << 32 |
-                      time->tm_hour       << 24 |
-                      time->tm_min        << 16 |
-                      time->tm_sec        << 8;
-}
-
-static void mxf_gen_umid(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    uint32_t seed = av_get_random_seed();
-    uint64_t umid = seed + 0x5294713400000000LL;
-
-    AV_WB64(mxf->umid  , umid);
-    AV_WB64(mxf->umid+8, umid>>8);
-
-    mxf->instance_number = seed;
-}
-
-static int mxf_write_header(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    int i;
-    uint8_t present[FF_ARRAY_ELEMS(mxf_essence_container_uls)] = {0};
-    const int *samples_per_frame = NULL;
-    AVDictionaryEntry *t;
-    int64_t timestamp = 0;
-
-    if (!s->nb_streams)
-        return -1;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        MXFStreamContext *sc = av_mallocz(sizeof(*sc));
-        if (!sc)
-            return AVERROR(ENOMEM);
-        st->priv_data = sc;
-
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            if (i != 0) {
-                av_log(s, AV_LOG_ERROR, "video stream must be first track\n");
-                return -1;
-            }
-            if (fabs(av_q2d(st->codec->time_base) - 1/25.0) < 0.0001) {
-                samples_per_frame = PAL_samples_per_frame;
-                mxf->time_base = (AVRational){ 1, 25 };
-                mxf->timecode_base = 25;
-            } else if (fabs(av_q2d(st->codec->time_base) - 1001/30000.0) < 0.0001) {
-                samples_per_frame = NTSC_samples_per_frame;
-                mxf->time_base = (AVRational){ 1001, 30000 };
-                mxf->timecode_base = 30;
-            } else {
-                av_log(s, AV_LOG_ERROR, "unsupported video frame rate\n");
-                return -1;
-            }
-            avpriv_set_pts_info(st, 64, mxf->time_base.num, mxf->time_base.den);
-            if (s->oformat == &ff_mxf_d10_muxer) {
-                if (st->codec->bit_rate == 50000000)
-                    if (mxf->time_base.den == 25) sc->index = 3;
-                    else                          sc->index = 5;
-                else if (st->codec->bit_rate == 40000000)
-                    if (mxf->time_base.den == 25) sc->index = 7;
-                    else                          sc->index = 9;
-                else if (st->codec->bit_rate == 30000000)
-                    if (mxf->time_base.den == 25) sc->index = 11;
-                    else                          sc->index = 13;
-                else {
-                    av_log(s, AV_LOG_ERROR, "error MXF D-10 only support 30/40/50 mbit/s\n");
-                    return -1;
-                }
-
-                mxf->edit_unit_byte_count = KAG_SIZE; // system element
-                mxf->edit_unit_byte_count += 16 + 4 + (uint64_t)st->codec->bit_rate *
-                    mxf->time_base.num / (8*mxf->time_base.den);
-                mxf->edit_unit_byte_count += klv_fill_size(mxf->edit_unit_byte_count);
-                mxf->edit_unit_byte_count += 16 + 4 + 4 + samples_per_frame[0]*8*4;
-                mxf->edit_unit_byte_count += klv_fill_size(mxf->edit_unit_byte_count);
-            }
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (st->codec->sample_rate != 48000) {
-                av_log(s, AV_LOG_ERROR, "only 48khz is implemented\n");
-                return -1;
-            }
-            avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-            if (s->oformat == &ff_mxf_d10_muxer) {
-                if (st->index != 1) {
-                    av_log(s, AV_LOG_ERROR, "MXF D-10 only support one audio track\n");
-                    return -1;
-                }
-                if (st->codec->codec_id != AV_CODEC_ID_PCM_S16LE &&
-                    st->codec->codec_id != AV_CODEC_ID_PCM_S24LE) {
-                    av_log(s, AV_LOG_ERROR, "MXF D-10 only support 16 or 24 bits le audio\n");
-                }
-                sc->index = ((MXFStreamContext*)s->streams[0]->priv_data)->index + 1;
-            } else
-            mxf->slice_count = 1;
-        }
-
-        if (!sc->index) {
-            sc->index = mxf_get_essence_container_ul_index(st->codec->codec_id);
-            if (sc->index == -1) {
-                av_log(s, AV_LOG_ERROR, "track %d: could not find essence container ul, "
-                       "codec not currently supported in container\n", i);
-                return -1;
-            }
-        }
-
-        sc->codec_ul = &mxf_essence_container_uls[sc->index].codec_ul;
-
-        memcpy(sc->track_essence_element_key, mxf_essence_container_uls[sc->index].element_ul, 15);
-        sc->track_essence_element_key[15] = present[sc->index];
-        PRINT_KEY(s, "track essence element key", sc->track_essence_element_key);
-
-        if (!present[sc->index])
-            mxf->essence_container_count++;
-        present[sc->index]++;
-    }
-
-    if (s->oformat == &ff_mxf_d10_muxer) {
-        mxf->essence_container_count = 1;
-    }
-
-    if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
-        mxf_gen_umid(s);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        MXFStreamContext *sc = s->streams[i]->priv_data;
-        // update element count
-        sc->track_essence_element_key[13] = present[sc->index];
-        sc->order = AV_RB32(sc->track_essence_element_key+12);
-    }
-
-    if (t = av_dict_get(s->metadata, "creation_time", NULL, 0))
-        timestamp = ff_iso8601_to_unix_time(t->value);
-    if (timestamp)
-        mxf->timestamp = mxf_parse_timestamp(timestamp);
-    mxf->duration = -1;
-
-    mxf->timecode_track = av_mallocz(sizeof(*mxf->timecode_track));
-    if (!mxf->timecode_track)
-        return AVERROR(ENOMEM);
-    mxf->timecode_track->priv_data = av_mallocz(sizeof(MXFStreamContext));
-    if (!mxf->timecode_track->priv_data)
-        return AVERROR(ENOMEM);
-    mxf->timecode_track->index = -1;
-
-    if (!samples_per_frame)
-        samples_per_frame = PAL_samples_per_frame;
-
-    if (ff_audio_interleave_init(s, samples_per_frame, mxf->time_base) < 0)
-        return -1;
-
-    return 0;
-}
-
-static const uint8_t system_metadata_pack_key[]        = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x03,0x01,0x04,0x01,0x01,0x00 };
-static const uint8_t system_metadata_package_set_key[] = { 0x06,0x0E,0x2B,0x34,0x02,0x43,0x01,0x01,0x0D,0x01,0x03,0x01,0x04,0x01,0x02,0x01 };
-
-static uint32_t framenum_to_12m_time_code(unsigned frame, int drop, int fps)
-{
-    return (0                                    << 31) | // color frame flag
-           (drop                                 << 30) | // drop  frame flag
-           ( ((frame % fps) / 10)                << 28) | // tens  of frames
-           ( ((frame % fps) % 10)                << 24) | // units of frames
-           (0                                    << 23) | // field phase (NTSC), b0 (PAL)
-           ((((frame / fps) % 60) / 10)          << 20) | // tens  of seconds
-           ((((frame / fps) % 60) % 10)          << 16) | // units of seconds
-           (0                                    << 15) | // b0 (NTSC), b2 (PAL)
-           ((((frame / (fps * 60)) % 60) / 10)   << 12) | // tens  of minutes
-           ((((frame / (fps * 60)) % 60) % 10)   <<  8) | // units of minutes
-           (0                                    <<  7) | // b1
-           (0                                    <<  6) | // b2 (NTSC), field phase (PAL)
-           ((((frame / (fps * 3600) % 24)) / 10) <<  4) | // tens  of hours
-           (  (frame / (fps * 3600) % 24)) % 10;          // units of hours
-}
-
-static void mxf_write_system_item(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned frame;
-    uint32_t time_code;
-
-    frame = mxf->timecode_start + mxf->last_indexed_edit_unit + mxf->edit_units_count;
-
-    // write system metadata pack
-    avio_write(pb, system_metadata_pack_key, 16);
-    klv_encode_ber4_length(pb, 57);
-    avio_w8(pb, 0x5c); // UL, user date/time stamp, picture and sound item present
-    avio_w8(pb, 0x04); // content package rate
-    avio_w8(pb, 0x00); // content package type
-    avio_wb16(pb, 0x00); // channel handle
-    avio_wb16(pb, frame); // continuity count
-    if (mxf->essence_container_count > 1)
-        avio_write(pb, multiple_desc_ul, 16);
-    else {
-        MXFStreamContext *sc = s->streams[0]->priv_data;
-        avio_write(pb, mxf_essence_container_uls[sc->index].container_ul, 16);
-    }
-    avio_w8(pb, 0);
-    avio_wb64(pb, 0);
-    avio_wb64(pb, 0); // creation date/time stamp
-
-    avio_w8(pb, 0x81); // SMPTE 12M time code
-    time_code = framenum_to_12m_time_code(frame, mxf->timecode_drop_frame,
-                                          mxf->timecode_base);
-    avio_wb32(pb, time_code);
-    avio_wb32(pb, 0); // binary group data
-    avio_wb64(pb, 0);
-
-    // write system metadata package set
-    avio_write(pb, system_metadata_package_set_key, 16);
-    klv_encode_ber4_length(pb, 35);
-    avio_w8(pb, 0x83); // UMID
-    avio_wb16(pb, 0x20);
-    mxf_write_umid(s, 1);
-}
-
-static void mxf_write_d10_video_packet(AVFormatContext *s, AVStream *st, AVPacket *pkt)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int packet_size = (uint64_t)st->codec->bit_rate*mxf->time_base.num /
-        (8*mxf->time_base.den); // frame size
-    int pad;
-
-    packet_size += 16 + 4;
-    packet_size += klv_fill_size(packet_size);
-
-    klv_encode_ber4_length(pb, pkt->size);
-    avio_write(pb, pkt->data, pkt->size);
-
-    // ensure CBR muxing by padding to correct video frame size
-    pad = packet_size - pkt->size - 16 - 4;
-    if (pad > 20) {
-        avio_write(s->pb, klv_fill_key, 16);
-        pad -= 16 + 4;
-        klv_encode_ber4_length(s->pb, pad);
-        for (; pad; pad--)
-            avio_w8(s->pb, 0);
-        assert(!(avio_tell(s->pb) & (KAG_SIZE-1)));
-    } else {
-        av_log(s, AV_LOG_WARNING, "cannot fill d-10 video packet\n");
-        for (; pad > 0; pad--)
-            avio_w8(s->pb, 0);
-    }
-}
-
-static void mxf_write_d10_audio_packet(AVFormatContext *s, AVStream *st, AVPacket *pkt)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int frame_size = pkt->size / st->codec->block_align;
-    uint8_t *samples = pkt->data;
-    uint8_t *end = pkt->data + pkt->size;
-    int i;
-
-    klv_encode_ber4_length(pb, 4 + frame_size*4*8);
-
-    avio_w8(pb, (frame_size == 1920 ? 0 : (mxf->edit_units_count-1) % 5 + 1));
-    avio_wl16(pb, frame_size);
-    avio_w8(pb, (1<<st->codec->channels)-1);
-
-    while (samples < end) {
-        for (i = 0; i < st->codec->channels; i++) {
-            uint32_t sample;
-            if (st->codec->codec_id == AV_CODEC_ID_PCM_S24LE) {
-                sample = AV_RL24(samples)<< 4;
-                samples += 3;
-            } else {
-                sample = AV_RL16(samples)<<12;
-                samples += 2;
-            }
-            avio_wl32(pb, sample | i);
-        }
-        for (; i < 8; i++)
-            avio_wl32(pb, i);
-    }
-}
-
-static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st = s->streams[pkt->stream_index];
-    MXFStreamContext *sc = st->priv_data;
-    MXFIndexEntry ie = {0};
-    int err;
-
-    if (!mxf->edit_unit_byte_count && !(mxf->edit_units_count % EDIT_UNITS_PER_BODY)) {
-        if ((err = av_reallocp_array(&mxf->index_entries, mxf->edit_units_count
-                                     + EDIT_UNITS_PER_BODY, sizeof(*mxf->index_entries))) < 0) {
-            mxf->edit_units_count = 0;
-            av_log(s, AV_LOG_ERROR, "could not allocate index entries\n");
-            return err;
-        }
-    }
-
-    if (st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-        if (!mxf_parse_mpeg2_frame(s, st, pkt, &ie)) {
-            av_log(s, AV_LOG_ERROR, "could not get mpeg2 profile and level\n");
-            return -1;
-        }
-    }
-
-    if (!mxf->header_written) {
-        if (mxf->edit_unit_byte_count) {
-            if ((err = mxf_write_partition(s, 1, 2, header_open_partition_key, 1)) < 0)
-                return err;
-            mxf_write_klv_fill(s);
-            mxf_write_index_table_segment(s);
-        } else {
-            if ((err = mxf_write_partition(s, 0, 0, header_open_partition_key, 1)) < 0)
-                return err;
-        }
-        mxf->header_written = 1;
-    }
-
-    if (st->index == 0) {
-        if (!mxf->edit_unit_byte_count &&
-            (!mxf->edit_units_count || mxf->edit_units_count > EDIT_UNITS_PER_BODY) &&
-            !(ie.flags & 0x33)) { // I frame, Gop start
-            mxf_write_klv_fill(s);
-            if ((err = mxf_write_partition(s, 1, 2, body_partition_key, 0)) < 0)
-                return err;
-            mxf_write_klv_fill(s);
-            mxf_write_index_table_segment(s);
-        }
-
-        mxf_write_klv_fill(s);
-        mxf_write_system_item(s);
-
-        if (!mxf->edit_unit_byte_count) {
-            mxf->index_entries[mxf->edit_units_count].offset = mxf->body_offset;
-            mxf->index_entries[mxf->edit_units_count].flags = ie.flags;
-            mxf->index_entries[mxf->edit_units_count].temporal_ref = ie.temporal_ref;
-            mxf->body_offset += KAG_SIZE; // size of system element
-        }
-        mxf->edit_units_count++;
-    } else if (!mxf->edit_unit_byte_count && st->index == 1) {
-        mxf->index_entries[mxf->edit_units_count-1].slice_offset =
-            mxf->body_offset - mxf->index_entries[mxf->edit_units_count-1].offset;
-    }
-
-    mxf_write_klv_fill(s);
-    avio_write(pb, sc->track_essence_element_key, 16); // write key
-    if (s->oformat == &ff_mxf_d10_muxer) {
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-            mxf_write_d10_video_packet(s, st, pkt);
-        else
-            mxf_write_d10_audio_packet(s, st, pkt);
-    } else {
-        klv_encode_ber4_length(pb, pkt->size); // write length
-        avio_write(pb, pkt->data, pkt->size);
-        mxf->body_offset += 16+4+pkt->size + klv_fill_size(16+4+pkt->size);
-    }
-
-    avio_flush(pb);
-
-    return 0;
-}
-
-static void mxf_write_random_index_pack(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    uint64_t pos = avio_tell(pb);
-    int i;
-
-    avio_write(pb, random_index_pack_key, 16);
-    klv_encode_ber_length(pb, 28 + 12*mxf->body_partitions_count);
-
-    if (mxf->edit_unit_byte_count)
-        avio_wb32(pb, 1); // BodySID of header partition
-    else
-        avio_wb32(pb, 0);
-    avio_wb64(pb, 0); // offset of header partition
-
-    for (i = 0; i < mxf->body_partitions_count; i++) {
-        avio_wb32(pb, 1); // BodySID
-        avio_wb64(pb, mxf->body_partition_offset[i]);
-    }
-
-    avio_wb32(pb, 0); // BodySID of footer partition
-    avio_wb64(pb, mxf->footer_partition_offset);
-
-    avio_wb32(pb, avio_tell(pb) - pos + 4);
-}
-
-static int mxf_write_footer(AVFormatContext *s)
-{
-    MXFContext *mxf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int err;
-
-    mxf->duration = mxf->last_indexed_edit_unit + mxf->edit_units_count;
-
-    mxf_write_klv_fill(s);
-    mxf->footer_partition_offset = avio_tell(pb);
-    if (mxf->edit_unit_byte_count) { // no need to repeat index
-        if ((err = mxf_write_partition(s, 0, 0, footer_partition_key, 0)) < 0)
-            return err;
-    } else {
-        if ((err = mxf_write_partition(s, 0, 2, footer_partition_key, 0)) < 0)
-            return err;
-        mxf_write_klv_fill(s);
-        mxf_write_index_table_segment(s);
-    }
-
-    mxf_write_klv_fill(s);
-    mxf_write_random_index_pack(s);
-
-    if (s->pb->seekable) {
-        avio_seek(pb, 0, SEEK_SET);
-        if (mxf->edit_unit_byte_count) {
-            if ((err = mxf_write_partition(s, 1, 2, header_closed_partition_key, 1)) < 0)
-                return err;
-            mxf_write_klv_fill(s);
-            mxf_write_index_table_segment(s);
-        } else {
-            if ((err = mxf_write_partition(s, 0, 0, header_closed_partition_key, 1)) < 0)
-                return err;
-        }
-    }
-
-    ff_audio_interleave_close(s);
-
-    av_freep(&mxf->index_entries);
-    av_freep(&mxf->body_partition_offset);
-    av_freep(&mxf->timecode_track->priv_data);
-    av_freep(&mxf->timecode_track);
-
-    mxf_free(s);
-
-    return 0;
-}
-
-static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)
-{
-    int i, stream_count = 0;
-
-    for (i = 0; i < s->nb_streams; i++)
-        stream_count += !!s->streams[i]->last_in_packet_buffer;
-
-    if (stream_count && (s->nb_streams == stream_count || flush)) {
-        AVPacketList *pktl = s->packet_buffer;
-        if (s->nb_streams != stream_count) {
-            AVPacketList *last = NULL;
-            // find last packet in edit unit
-            while (pktl) {
-                if (!stream_count || pktl->pkt.stream_index == 0)
-                    break;
-                last = pktl;
-                pktl = pktl->next;
-                stream_count--;
-            }
-            // purge packet queue
-            while (pktl) {
-                AVPacketList *next = pktl->next;
-
-                if(s->streams[pktl->pkt.stream_index]->last_in_packet_buffer == pktl)
-                    s->streams[pktl->pkt.stream_index]->last_in_packet_buffer= NULL;
-                av_free_packet(&pktl->pkt);
-                av_freep(&pktl);
-                pktl = next;
-            }
-            if (last)
-                last->next = NULL;
-            else {
-                s->packet_buffer = NULL;
-                s->packet_buffer_end= NULL;
-                goto out;
-            }
-            pktl = s->packet_buffer;
-        }
-
-        *out = pktl->pkt;
-        av_dlog(s, "out st:%d dts:%"PRId64"\n", (*out).stream_index, (*out).dts);
-        s->packet_buffer = pktl->next;
-        if(s->streams[pktl->pkt.stream_index]->last_in_packet_buffer == pktl)
-            s->streams[pktl->pkt.stream_index]->last_in_packet_buffer= NULL;
-        if(!s->packet_buffer)
-            s->packet_buffer_end= NULL;
-        av_freep(&pktl);
-        return 1;
-    } else {
-    out:
-        av_init_packet(out);
-        return 0;
-    }
-}
-
-static int mxf_compare_timestamps(AVFormatContext *s, AVPacket *next, AVPacket *pkt)
-{
-    MXFStreamContext *sc  = s->streams[pkt ->stream_index]->priv_data;
-    MXFStreamContext *sc2 = s->streams[next->stream_index]->priv_data;
-
-    return next->dts > pkt->dts ||
-        (next->dts == pkt->dts && sc->order < sc2->order);
-}
-
-static int mxf_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)
-{
-    return ff_audio_rechunk_interleave(s, out, pkt, flush,
-                               mxf_interleave_get_packet, mxf_compare_timestamps);
-}
-
-AVOutputFormat ff_mxf_muxer = {
-    .name              = "mxf",
-    .long_name         = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
-    .mime_type         = "application/mxf",
-    .extensions        = "mxf",
-    .priv_data_size    = sizeof(MXFContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_header      = mxf_write_header,
-    .write_packet      = mxf_write_packet,
-    .write_trailer     = mxf_write_footer,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .interleave_packet = mxf_interleave,
-};
-
-AVOutputFormat ff_mxf_d10_muxer = {
-    .name              = "mxf_d10",
-    .long_name         = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) D-10 Mapping"),
-    .mime_type         = "application/mxf",
-    .priv_data_size    = sizeof(MXFContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_header      = mxf_write_header,
-    .write_packet      = mxf_write_packet,
-    .write_trailer     = mxf_write_footer,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .interleave_packet = mxf_interleave,
-};
diff --git a/deps/libav/libavformat/mxg.c b/deps/libav/libavformat/mxg.c
deleted file mode 100644
index 1d1488c..0000000
--- a/deps/libav/libavformat/mxg.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * MxPEG clip file demuxer
- * Copyright (c) 2010 Anatoly Nenashev
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/mjpeg.h"
-#include "avformat.h"
-#include "internal.h"
-#include "avio.h"
-
-#define DEFAULT_PACKET_SIZE 1024
-#define OVERREAD_SIZE 3
-
-typedef struct MXGContext {
-    uint8_t *buffer;
-    uint8_t *buffer_ptr;
-    uint8_t *soi_ptr;
-    unsigned int buffer_size;
-    int64_t dts;
-    unsigned int cache_size;
-} MXGContext;
-
-static int mxg_read_header(AVFormatContext *s)
-{
-    AVStream *video_st, *audio_st;
-    MXGContext *mxg = s->priv_data;
-
-    /* video parameters will be extracted from the compressed bitstream */
-    video_st = avformat_new_stream(s, NULL);
-    if (!video_st)
-        return AVERROR(ENOMEM);
-    video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    video_st->codec->codec_id = AV_CODEC_ID_MXPEG;
-    avpriv_set_pts_info(video_st, 64, 1, 1000000);
-
-    audio_st = avformat_new_stream(s, NULL);
-    if (!audio_st)
-        return AVERROR(ENOMEM);
-    audio_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    audio_st->codec->codec_id = AV_CODEC_ID_PCM_ALAW;
-    audio_st->codec->channels = 1;
-    audio_st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    audio_st->codec->sample_rate = 8000;
-    audio_st->codec->bits_per_coded_sample = 8;
-    audio_st->codec->block_align = 1;
-    avpriv_set_pts_info(audio_st, 64, 1, 1000000);
-
-    mxg->soi_ptr = mxg->buffer_ptr = mxg->buffer = 0;
-    mxg->buffer_size = 0;
-    mxg->dts = AV_NOPTS_VALUE;
-    mxg->cache_size = 0;
-
-    return 0;
-}
-
-static uint8_t* mxg_find_startmarker(uint8_t *p, uint8_t *end)
-{
-    for (; p < end - 3; p += 4) {
-        uint32_t x = *(uint32_t*)p;
-
-        if (x & (~(x+0x01010101)) & 0x80808080) {
-            if (p[0] == 0xff) {
-                return p;
-            } else if (p[1] == 0xff) {
-                return p+1;
-            } else if (p[2] == 0xff) {
-                return p+2;
-            } else if (p[3] == 0xff) {
-                return p+3;
-            }
-        }
-    }
-
-    for (; p < end; ++p) {
-        if (*p == 0xff) return p;
-    }
-
-    return end;
-}
-
-static int mxg_update_cache(AVFormatContext *s, unsigned int cache_size)
-{
-    MXGContext *mxg = s->priv_data;
-    unsigned int current_pos = mxg->buffer_ptr - mxg->buffer;
-    unsigned int soi_pos;
-    int ret;
-
-    /* reallocate internal buffer */
-    if (current_pos > current_pos + cache_size)
-        return AVERROR(ENOMEM);
-    if (mxg->soi_ptr) soi_pos = mxg->soi_ptr - mxg->buffer;
-    mxg->buffer = av_fast_realloc(mxg->buffer, &mxg->buffer_size,
-                                  current_pos + cache_size +
-                                  FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!mxg->buffer)
-        return AVERROR(ENOMEM);
-    mxg->buffer_ptr = mxg->buffer + current_pos;
-    if (mxg->soi_ptr) mxg->soi_ptr = mxg->buffer + soi_pos;
-
-    /* get data */
-    ret = avio_read(s->pb, mxg->buffer_ptr + mxg->cache_size,
-                     cache_size - mxg->cache_size);
-    if (ret < 0)
-        return ret;
-
-    mxg->cache_size += ret;
-
-    return ret;
-}
-
-static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret;
-    unsigned int size;
-    uint8_t *startmarker_ptr, *end, *search_end, marker;
-    MXGContext *mxg = s->priv_data;
-
-    while (!s->pb->eof_reached && !s->pb->error){
-        if (mxg->cache_size <= OVERREAD_SIZE) {
-            /* update internal buffer */
-            ret = mxg_update_cache(s, DEFAULT_PACKET_SIZE + OVERREAD_SIZE);
-            if (ret < 0)
-                return ret;
-        }
-        end = mxg->buffer_ptr + mxg->cache_size;
-
-        /* find start marker - 0xff */
-        if (mxg->cache_size > OVERREAD_SIZE) {
-            search_end = end - OVERREAD_SIZE;
-            startmarker_ptr = mxg_find_startmarker(mxg->buffer_ptr, search_end);
-        } else {
-            search_end = end;
-            startmarker_ptr = mxg_find_startmarker(mxg->buffer_ptr, search_end);
-            if (startmarker_ptr >= search_end - 1 ||
-                *(startmarker_ptr + 1) != EOI) break;
-        }
-
-        if (startmarker_ptr != search_end) { /* start marker found */
-            marker = *(startmarker_ptr + 1);
-            mxg->buffer_ptr = startmarker_ptr + 2;
-            mxg->cache_size = end - mxg->buffer_ptr;
-
-            if (marker == SOI) {
-                mxg->soi_ptr = startmarker_ptr;
-            } else if (marker == EOI) {
-                if (!mxg->soi_ptr) {
-                    av_log(s, AV_LOG_WARNING, "Found EOI before SOI, skipping\n");
-                    continue;
-                }
-
-                pkt->pts = pkt->dts = mxg->dts;
-                pkt->stream_index = 0;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-                pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-                pkt->buf  = NULL;
-                pkt->size = mxg->buffer_ptr - mxg->soi_ptr;
-                pkt->data = mxg->soi_ptr;
-
-                if (mxg->soi_ptr - mxg->buffer > mxg->cache_size) {
-                    if (mxg->cache_size > 0) {
-                        memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
-                    }
-
-                    mxg->buffer_ptr = mxg->buffer;
-                }
-                mxg->soi_ptr = 0;
-
-                return pkt->size;
-            } else if ( (SOF0 <= marker && marker <= SOF15) ||
-                        (SOS  <= marker && marker <= COM) ) {
-                /* all other markers that start marker segment also contain
-                   length value (see specification for JPEG Annex B.1) */
-                size = AV_RB16(mxg->buffer_ptr);
-                if (size < 2)
-                    return AVERROR(EINVAL);
-
-                if (mxg->cache_size < size) {
-                    ret = mxg_update_cache(s, size);
-                    if (ret < 0)
-                        return ret;
-                    startmarker_ptr = mxg->buffer_ptr - 2;
-                    mxg->cache_size = 0;
-                } else {
-                    mxg->cache_size -= size;
-                }
-
-                mxg->buffer_ptr += size;
-
-                if (marker == APP13 && size >= 16) { /* audio data */
-                    /* time (GMT) of first sample in usec since 1970, little-endian */
-                    pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8);
-                    pkt->stream_index = 1;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-                    pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-                    pkt->buf  = NULL;
-                    pkt->size = size - 14;
-                    pkt->data = startmarker_ptr + 16;
-
-                    if (startmarker_ptr - mxg->buffer > mxg->cache_size) {
-                        if (mxg->cache_size > 0) {
-                            memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
-                        }
-                        mxg->buffer_ptr = mxg->buffer;
-                    }
-
-                    return pkt->size;
-                } else if (marker == COM && size >= 18 &&
-                           !strncmp(startmarker_ptr + 4, "MXF", 3)) {
-                    /* time (GMT) of video frame in usec since 1970, little-endian */
-                    mxg->dts = AV_RL64(startmarker_ptr + 12);
-                }
-            }
-        } else {
-            /* start marker not found */
-            mxg->buffer_ptr = search_end;
-            mxg->cache_size = OVERREAD_SIZE;
-        }
-    }
-
-    return AVERROR_EOF;
-}
-
-static int mxg_close(struct AVFormatContext *s)
-{
-    MXGContext *mxg = s->priv_data;
-    av_freep(&mxg->buffer);
-    return 0;
-}
-
-AVInputFormat ff_mxg_demuxer = {
-    .name           = "mxg",
-    .long_name      = NULL_IF_CONFIG_SMALL("MxPEG clip"),
-    .priv_data_size = sizeof(MXGContext),
-    .read_header    = mxg_read_header,
-    .read_packet    = mxg_read_packet,
-    .read_close     = mxg_close,
-    .extensions     = "mxg",
-};
diff --git a/deps/libav/libavformat/ncdec.c b/deps/libav/libavformat/ncdec.c
deleted file mode 100644
index 40d8dac..0000000
--- a/deps/libav/libavformat/ncdec.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * NC camera feed demuxer
- * Copyright (c) 2009  Nicolas Martin (martinic at iro dot umontreal dot ca)
- *                     Edouard Auvinet
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define NC_VIDEO_FLAG 0x1A5
-
-static int nc_probe(AVProbeData *probe_packet)
-{
-    int size;
-
-    if (AV_RB32(probe_packet->buf) != NC_VIDEO_FLAG)
-        return 0;
-
-    size = AV_RL16(probe_packet->buf + 5);
-
-    if (size + 20 > probe_packet->buf_size)
-        return AVPROBE_SCORE_MAX/4;
-
-    if (AV_RB32(probe_packet->buf+16+size) == NC_VIDEO_FLAG)
-        return AVPROBE_SCORE_MAX;
-
-    return 0;
-}
-
-static int nc_read_header(AVFormatContext *s)
-{
-    AVStream *st = avformat_new_stream(s, NULL);
-
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_MPEG4;
-    st->need_parsing      = AVSTREAM_PARSE_FULL;
-
-    avpriv_set_pts_info(st, 64, 1, 100);
-
-    return 0;
-}
-
-static int nc_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int size;
-    int ret;
-
-    uint32_t state=-1;
-    while (state != NC_VIDEO_FLAG) {
-        if (s->pb->eof_reached)
-            return AVERROR(EIO);
-        state = (state<<8) + avio_r8(s->pb);
-    }
-
-    avio_r8(s->pb);
-    size = avio_rl16(s->pb);
-    avio_skip(s->pb, 9);
-
-    if (size == 0) {
-        av_log(s, AV_LOG_DEBUG, "Next packet size is zero\n");
-        return AVERROR(EAGAIN);
-    }
-
-    ret = av_get_packet(s->pb, pkt, size);
-    if (ret != size) {
-        if (ret > 0) av_free_packet(pkt);
-        return AVERROR(EIO);
-    }
-
-    pkt->stream_index = 0;
-    return size;
-}
-
-AVInputFormat ff_nc_demuxer = {
-    .name           = "nc",
-    .long_name      = NULL_IF_CONFIG_SMALL("NC camera feed"),
-    .read_probe     = nc_probe,
-    .read_header    = nc_read_header,
-    .read_packet    = nc_read_packet,
-    .extensions     = "v",
-};
diff --git a/deps/libav/libavformat/network.c b/deps/libav/libavformat/network.c
deleted file mode 100644
index 6d308eb..0000000
--- a/deps/libav/libavformat/network.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Copyright (c) 2007 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <fcntl.h>
-#include "network.h"
-#include "url.h"
-#include "libavcodec/internal.h"
-#include "libavutil/mem.h"
-
-#if HAVE_THREADS
-#if HAVE_PTHREADS
-#include <pthread.h>
-#else
-#include "compat/w32pthreads.h"
-#endif
-#endif
-
-#if CONFIG_OPENSSL
-#include <openssl/ssl.h>
-static int openssl_init;
-#if HAVE_THREADS
-#include <openssl/crypto.h>
-#include "libavutil/avutil.h"
-pthread_mutex_t *openssl_mutexes;
-static void openssl_lock(int mode, int type, const char *file, int line)
-{
-    if (mode & CRYPTO_LOCK)
-        pthread_mutex_lock(&openssl_mutexes[type]);
-    else
-        pthread_mutex_unlock(&openssl_mutexes[type]);
-}
-#if !defined(WIN32) && OPENSSL_VERSION_NUMBER < 0x10000000
-static unsigned long openssl_thread_id(void)
-{
-    return (intptr_t) pthread_self();
-}
-#endif
-#endif
-#endif
-#if CONFIG_GNUTLS
-#include <gnutls/gnutls.h>
-#if HAVE_THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00
-#include <gcrypt.h>
-#include <errno.h>
-GCRY_THREAD_OPTION_PTHREAD_IMPL;
-#endif
-#endif
-
-void ff_tls_init(void)
-{
-    avpriv_lock_avformat();
-#if CONFIG_OPENSSL
-    if (!openssl_init) {
-        SSL_library_init();
-        SSL_load_error_strings();
-#if HAVE_THREADS
-        if (!CRYPTO_get_locking_callback()) {
-            int i;
-            openssl_mutexes = av_malloc(sizeof(pthread_mutex_t) * CRYPTO_num_locks());
-            for (i = 0; i < CRYPTO_num_locks(); i++)
-                pthread_mutex_init(&openssl_mutexes[i], NULL);
-            CRYPTO_set_locking_callback(openssl_lock);
-#if !defined(WIN32) && OPENSSL_VERSION_NUMBER < 0x10000000
-            CRYPTO_set_id_callback(openssl_thread_id);
-#endif
-        }
-#endif
-    }
-    openssl_init++;
-#endif
-#if CONFIG_GNUTLS
-#if HAVE_THREADS && GNUTLS_VERSION_NUMBER < 0x020b00
-    if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0)
-        gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
-#endif
-    gnutls_global_init();
-#endif
-    avpriv_unlock_avformat();
-}
-
-void ff_tls_deinit(void)
-{
-    avpriv_lock_avformat();
-#if CONFIG_OPENSSL
-    openssl_init--;
-    if (!openssl_init) {
-#if HAVE_THREADS
-        if (CRYPTO_get_locking_callback() == openssl_lock) {
-            int i;
-            CRYPTO_set_locking_callback(NULL);
-            for (i = 0; i < CRYPTO_num_locks(); i++)
-                pthread_mutex_destroy(&openssl_mutexes[i]);
-            av_free(openssl_mutexes);
-        }
-#endif
-    }
-#endif
-#if CONFIG_GNUTLS
-    gnutls_global_deinit();
-#endif
-    avpriv_unlock_avformat();
-}
-
-int ff_network_inited_globally;
-
-int ff_network_init(void)
-{
-#if HAVE_WINSOCK2_H
-    WSADATA wsaData;
-#endif
-
-    if (!ff_network_inited_globally)
-        av_log(NULL, AV_LOG_WARNING, "Using network protocols without global "
-                                     "network initialization. Please use "
-                                     "avformat_network_init(), this will "
-                                     "become mandatory later.\n");
-#if HAVE_WINSOCK2_H
-    if (WSAStartup(MAKEWORD(1,1), &wsaData))
-        return 0;
-#endif
-    return 1;
-}
-
-int ff_network_wait_fd(int fd, int write)
-{
-    int ev = write ? POLLOUT : POLLIN;
-    struct pollfd p = { .fd = fd, .events = ev, .revents = 0 };
-    int ret;
-    ret = poll(&p, 1, 100);
-    return ret < 0 ? ff_neterrno() : p.revents & (ev | POLLERR | POLLHUP) ? 0 : AVERROR(EAGAIN);
-}
-
-void ff_network_close(void)
-{
-#if HAVE_WINSOCK2_H
-    WSACleanup();
-#endif
-}
-
-#if HAVE_WINSOCK2_H
-int ff_neterrno(void)
-{
-    int err = WSAGetLastError();
-    switch (err) {
-    case WSAEWOULDBLOCK:
-        return AVERROR(EAGAIN);
-    case WSAEINTR:
-        return AVERROR(EINTR);
-    case WSAEPROTONOSUPPORT:
-        return AVERROR(EPROTONOSUPPORT);
-    case WSAETIMEDOUT:
-        return AVERROR(ETIMEDOUT);
-    case WSAECONNREFUSED:
-        return AVERROR(ECONNREFUSED);
-    case WSAEINPROGRESS:
-        return AVERROR(EINPROGRESS);
-    }
-    return -err;
-}
-#endif
-
-int ff_is_multicast_address(struct sockaddr *addr)
-{
-    if (addr->sa_family == AF_INET) {
-        return IN_MULTICAST(ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr));
-    }
-#if HAVE_STRUCT_SOCKADDR_IN6
-    if (addr->sa_family == AF_INET6) {
-        return IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *)addr)->sin6_addr);
-    }
-#endif
-
-    return 0;
-}
-
-static int ff_poll_interrupt(struct pollfd *p, nfds_t nfds, int timeout,
-                             AVIOInterruptCB *cb)
-{
-    int runs = timeout / POLLING_TIME;
-    int ret = 0;
-
-    do {
-        if (ff_check_interrupt(cb))
-            return AVERROR_EXIT;
-        ret = poll(p, nfds, POLLING_TIME);
-        if (ret != 0)
-            break;
-    } while (timeout < 0 || runs-- > 0);
-
-    if (!ret)
-        return AVERROR(ETIMEDOUT);
-    if (ret < 0)
-        return AVERROR(errno);
-    return ret;
-}
-
-int ff_socket(int af, int type, int proto)
-{
-    int fd;
-
-#ifdef SOCK_CLOEXEC
-    fd = socket(af, type | SOCK_CLOEXEC, proto);
-    if (fd == -1 && errno == EINVAL)
-#endif
-    {
-        fd = socket(af, type, proto);
-#if HAVE_FCNTL
-        if (fd != -1)
-            fcntl(fd, F_SETFD, FD_CLOEXEC);
-#endif
-    }
-    return fd;
-}
-
-int ff_listen_bind(int fd, const struct sockaddr *addr,
-                   socklen_t addrlen, int timeout, URLContext *h)
-{
-    int ret;
-    int reuse = 1;
-    struct pollfd lp = { fd, POLLIN, 0 };
-    setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
-    ret = bind(fd, addr, addrlen);
-    if (ret)
-        return ff_neterrno();
-
-    ret = listen(fd, 1);
-    if (ret)
-        return ff_neterrno();
-
-    ret = ff_poll_interrupt(&lp, 1, timeout, &h->interrupt_callback);
-    if (ret < 0)
-        return ret;
-
-    ret = accept(fd, NULL, NULL);
-    if (ret < 0)
-        return ff_neterrno();
-
-    closesocket(fd);
-
-    ff_socket_nonblock(ret, 1);
-    return ret;
-}
-
-int ff_listen_connect(int fd, const struct sockaddr *addr,
-                      socklen_t addrlen, int timeout, URLContext *h,
-                      int will_try_next)
-{
-    struct pollfd p = {fd, POLLOUT, 0};
-    int ret;
-    socklen_t optlen;
-
-    ff_socket_nonblock(fd, 1);
-
-    while ((ret = connect(fd, addr, addrlen))) {
-        ret = ff_neterrno();
-        switch (ret) {
-        case AVERROR(EINTR):
-            if (ff_check_interrupt(&h->interrupt_callback))
-                return AVERROR_EXIT;
-            continue;
-        case AVERROR(EINPROGRESS):
-        case AVERROR(EAGAIN):
-            ret = ff_poll_interrupt(&p, 1, timeout, &h->interrupt_callback);
-            if (ret < 0)
-                return ret;
-            optlen = sizeof(ret);
-            if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen))
-                ret = AVUNERROR(ff_neterrno());
-            if (ret != 0) {
-                char errbuf[100];
-                ret = AVERROR(ret);
-                av_strerror(ret, errbuf, sizeof(errbuf));
-                if (will_try_next)
-                    av_log(h, AV_LOG_WARNING,
-                           "Connection to %s failed (%s), trying next address\n",
-                           h->filename, errbuf);
-                else
-                    av_log(h, AV_LOG_ERROR, "Connection to %s failed: %s\n",
-                           h->filename, errbuf);
-            }
-        default:
-            return ret;
-        }
-    }
-    return ret;
-}
-
-static int match_host_pattern(const char *pattern, const char *hostname)
-{
-    int len_p, len_h;
-    if (!strcmp(pattern, "*"))
-        return 1;
-    // Skip a possible *. at the start of the pattern
-    if (pattern[0] == '*')
-        pattern++;
-    if (pattern[0] == '.')
-        pattern++;
-    len_p = strlen(pattern);
-    len_h = strlen(hostname);
-    if (len_p > len_h)
-        return 0;
-    // Simply check if the end of hostname is equal to 'pattern'
-    if (!strcmp(pattern, &hostname[len_h - len_p])) {
-        if (len_h == len_p)
-            return 1; // Exact match
-        if (hostname[len_h - len_p - 1] == '.')
-            return 1; // The matched substring is a domain and not just a substring of a domain
-    }
-    return 0;
-}
-
-int ff_http_match_no_proxy(const char *no_proxy, const char *hostname)
-{
-    char *buf, *start;
-    int ret = 0;
-    if (!no_proxy)
-        return 0;
-    if (!hostname)
-        return 0;
-    buf = av_strdup(no_proxy);
-    if (!buf)
-        return 0;
-    start = buf;
-    while (start) {
-        char *sep, *next = NULL;
-        start += strspn(start, " ,");
-        sep = start + strcspn(start, " ,");
-        if (*sep) {
-            next = sep + 1;
-            *sep = '\0';
-        }
-        if (match_host_pattern(start, hostname)) {
-            ret = 1;
-            break;
-        }
-        start = next;
-    }
-    av_free(buf);
-    return ret;
-}
diff --git a/deps/libav/libavformat/network.h b/deps/libav/libavformat/network.h
deleted file mode 100644
index 9d8c92f..0000000
--- a/deps/libav/libavformat/network.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (c) 2007 The Libav Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_NETWORK_H
-#define AVFORMAT_NETWORK_H
-
-#include <errno.h>
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/error.h"
-#include "os_support.h"
-#include "url.h"
-
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#include <ws2tcpip.h>
-
-#ifndef EPROTONOSUPPORT
-#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
-#endif
-#ifndef ETIMEDOUT
-#define ETIMEDOUT       WSAETIMEDOUT
-#endif
-#ifndef ECONNREFUSED
-#define ECONNREFUSED    WSAECONNREFUSED
-#endif
-#ifndef EINPROGRESS
-#define EINPROGRESS     WSAEINPROGRESS
-#endif
-
-#define getsockopt(a, b, c, d, e) getsockopt(a, b, c, (char*) d, e)
-#define setsockopt(a, b, c, d, e) setsockopt(a, b, c, (const char*) d, e)
-
-int ff_neterrno(void);
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-
-#define ff_neterrno() AVERROR(errno)
-#endif /* HAVE_WINSOCK2_H */
-
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#if HAVE_POLL_H
-#include <poll.h>
-#endif
-
-int ff_socket_nonblock(int socket, int enable);
-
-extern int ff_network_inited_globally;
-int ff_network_init(void);
-void ff_network_close(void);
-
-void ff_tls_init(void);
-void ff_tls_deinit(void);
-
-int ff_network_wait_fd(int fd, int write);
-
-int ff_inet_aton (const char * str, struct in_addr * add);
-
-#if !HAVE_STRUCT_SOCKADDR_STORAGE
-struct sockaddr_storage {
-#if HAVE_STRUCT_SOCKADDR_SA_LEN
-    uint8_t ss_len;
-    uint8_t ss_family;
-#else
-    uint16_t ss_family;
-#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
-    char ss_pad1[6];
-    int64_t ss_align;
-    char ss_pad2[112];
-};
-#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
-
-#if !HAVE_STRUCT_ADDRINFO
-struct addrinfo {
-    int ai_flags;
-    int ai_family;
-    int ai_socktype;
-    int ai_protocol;
-    int ai_addrlen;
-    struct sockaddr *ai_addr;
-    char *ai_canonname;
-    struct addrinfo *ai_next;
-};
-#endif /* !HAVE_STRUCT_ADDRINFO */
-
-/* getaddrinfo constants */
-#ifndef EAI_AGAIN
-#define EAI_AGAIN 2
-#endif
-#ifndef EAI_BADFLAGS
-#define EAI_BADFLAGS 3
-#endif
-#ifndef EAI_FAIL
-#define EAI_FAIL 4
-#endif
-#ifndef EAI_FAMILY
-#define EAI_FAMILY 5
-#endif
-#ifndef EAI_MEMORY
-#define EAI_MEMORY 6
-#endif
-#ifndef EAI_NODATA
-#define EAI_NODATA 7
-#endif
-#ifndef EAI_NONAME
-#define EAI_NONAME 8
-#endif
-#ifndef EAI_SERVICE
-#define EAI_SERVICE 9
-#endif
-#ifndef EAI_SOCKTYPE
-#define EAI_SOCKTYPE 10
-#endif
-
-#ifndef AI_PASSIVE
-#define AI_PASSIVE 1
-#endif
-
-#ifndef AI_CANONNAME
-#define AI_CANONNAME 2
-#endif
-
-#ifndef AI_NUMERICHOST
-#define AI_NUMERICHOST 4
-#endif
-
-#ifndef NI_NOFQDN
-#define NI_NOFQDN 1
-#endif
-
-#ifndef NI_NUMERICHOST
-#define NI_NUMERICHOST 2
-#endif
-
-#ifndef NI_NAMERQD
-#define NI_NAMERQD 4
-#endif
-
-#ifndef NI_NUMERICSERV
-#define NI_NUMERICSERV 8
-#endif
-
-#ifndef NI_DGRAM
-#define NI_DGRAM 16
-#endif
-
-#if !HAVE_GETADDRINFO
-int ff_getaddrinfo(const char *node, const char *service,
-                   const struct addrinfo *hints, struct addrinfo **res);
-void ff_freeaddrinfo(struct addrinfo *res);
-int ff_getnameinfo(const struct sockaddr *sa, int salen,
-                   char *host, int hostlen,
-                   char *serv, int servlen, int flags);
-#define getaddrinfo ff_getaddrinfo
-#define freeaddrinfo ff_freeaddrinfo
-#define getnameinfo ff_getnameinfo
-#endif /* !HAVE_GETADDRINFO */
-
-#if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H
-const char *ff_gai_strerror(int ecode);
-#undef gai_strerror
-#define gai_strerror ff_gai_strerror
-#endif /* !HAVE_GETADDRINFO || HAVE_WINSOCK2_H */
-
-#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK 0x7f000001
-#endif
-
-#ifndef INET_ADDRSTRLEN
-#define INET_ADDRSTRLEN 16
-#endif
-
-#ifndef INET6_ADDRSTRLEN
-#define INET6_ADDRSTRLEN INET_ADDRSTRLEN
-#endif
-
-#ifndef IN_MULTICAST
-#define IN_MULTICAST(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000)
-#endif
-#ifndef IN6_IS_ADDR_MULTICAST
-#define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff)
-#endif
-
-int ff_is_multicast_address(struct sockaddr *addr);
-
-#define POLLING_TIME 100 /// Time in milliseconds between interrupt check
-
-/**
- * Bind to a file descriptor and poll for a connection.
- *
- * @param fd      First argument of bind().
- * @param addr    Second argument of bind().
- * @param addrlen Third argument of bind().
- * @param timeout Polling timeout in milliseconds.
- * @param h       URLContext providing interrupt check
- *                callback and logging context.
- * @return        A non-blocking file descriptor on success
- *                or an AVERROR on failure.
- */
-int ff_listen_bind(int fd, const struct sockaddr *addr,
-                   socklen_t addrlen, int timeout,
-                   URLContext *h);
-
-/**
- * Connect to a file descriptor and poll for result.
- *
- * @param fd       First argument of connect(),
- *                 will be set as non-blocking.
- * @param addr     Second argument of connect().
- * @param addrlen  Third argument of connect().
- * @param timeout  Polling timeout in milliseconds.
- * @param h        URLContext providing interrupt check
- *                 callback and logging context.
- * @param will_try_next Whether the caller will try to connect to another
- *                 address for the same host name, affecting the form of
- *                 logged errors.
- * @return         0 on success, AVERROR on failure.
- */
-int ff_listen_connect(int fd, const struct sockaddr *addr,
-                      socklen_t addrlen, int timeout,
-                      URLContext *h, int will_try_next);
-
-int ff_http_match_no_proxy(const char *no_proxy, const char *hostname);
-
-int ff_socket(int domain, int type, int protocol);
-
-#endif /* AVFORMAT_NETWORK_H */
diff --git a/deps/libav/libavformat/noproxy-test.c b/deps/libav/libavformat/noproxy-test.c
deleted file mode 100644
index e6cc421..0000000
--- a/deps/libav/libavformat/noproxy-test.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2013 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "network.h"
-
-static void test(const char *pattern, const char *host)
-{
-    int res = ff_http_match_no_proxy(pattern, host);
-    printf("The pattern \"%s\" %s the hostname %s\n",
-           pattern ? pattern : "(null)", res ? "matches" : "does not match",
-           host);
-}
-
-int main(void)
-{
-    test(NULL, "domain.com");
-    test("example.com domain.com", "domain.com");
-    test("example.com other.com", "domain.com");
-    test("example.com,domain.com", "domain.com");
-    test("example.com,domain.com", "otherdomain.com");
-    test("example.com, *.domain.com", "sub.domain.com");
-    test("example.com, *.domain.com", "domain.com");
-    test("example.com, .domain.com", "domain.com");
-    test("*", "domain.com");
-    return 0;
-}
diff --git a/deps/libav/libavformat/nsvdec.c b/deps/libav/libavformat/nsvdec.c
deleted file mode 100644
index 18ebbe3..0000000
--- a/deps/libav/libavformat/nsvdec.c
+++ /dev/null
@@ -1,781 +0,0 @@
-/*
- * NSV demuxer
- * Copyright (c) 2004 The Libav Project
- *
- * first version by Francois Revol <revol at free.fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "internal.h"
-#include "libavutil/dict.h"
-
-/* max bytes to crawl for trying to resync
- * stupid streaming servers don't start at chunk boundaries...
- */
-#define NSV_MAX_RESYNC (500*1024)
-#define NSV_MAX_RESYNC_TRIES 300
-
-/*
- * References:
- * (1) http://www.multimedia.cx/nsv-format.txt
- * seems someone came to the same conclusions as me, and updated it:
- * (2) http://www.stud.ktu.lt/~vitslav/nsv/nsv-format.txt
- *     http://www.stud.ktu.lt/~vitslav/nsv/
- * official docs
- * (3) http://ultravox.aol.com/NSVFormat.rtf
- * Sample files:
- * (S1) http://www.nullsoft.com/nsv/samples/
- * http://www.nullsoft.com/nsv/samples/faster.nsv
- * http://streamripper.sourceforge.net/openbb/read.php?TID=492&page=4
- */
-
-/*
- * notes on the header (Francois Revol):
- *
- * It is followed by strings, then a table, but nothing tells
- * where the table begins according to (1). After checking faster.nsv,
- * I believe NVSf[16-19] gives the size of the strings data
- * (that is the offset of the data table after the header).
- * After checking all samples from (S1) all confirms this.
- *
- * Then, about NSVf[12-15], faster.nsf has 179700. When veiwing it in VLC,
- * I noticed there was about 1 NVSs chunk/s, so I ran
- * strings faster.nsv | grep NSVs | wc -l
- * which gave me 180. That leads me to think that NSVf[12-15] might be the
- * file length in milliseconds.
- * Let's try that:
- * for f in *.nsv; do HTIME="$(od -t x4 "$f" | head -1 | sed 's/.* //')"; echo "'$f' $((0x$HTIME))s = $((0x$HTIME/1000/60)):$((0x$HTIME/1000%60))"; done
- * except for nstrailer (which doesn't have an NSVf header), it repports correct time.
- *
- * nsvtrailer.nsv (S1) does not have any NSVf header, only NSVs chunks,
- * so the header seems to not be mandatory. (for streaming).
- *
- * index slice duration check (excepts nsvtrailer.nsv):
- * for f in [^n]*.nsv; do
- *     DUR="$(avconv -i "$f" 2> /dev/null | grep 'NSVf duration' | cut -d ' ' -f 4)"
- *     IC="$(avconv -i "$f" 2> /dev/null | grep 'INDEX ENTRIES' | cut -d ' ' -f 2)"
- *     echo "duration $DUR, slite time $(($DUR/$IC))"
- * done
- */
-
-/*
- * TODO:
- * - handle timestamps !!!
- * - use index
- * - mime-type in probe()
- * - seek
- */
-
-#if 0
-struct NSVf_header {
-    uint32_t chunk_tag; /* 'NSVf' */
-    uint32_t chunk_size;
-    uint32_t file_size; /* max 4GB ??? no one learns anything it seems :^) */
-    uint32_t file_length; //unknown1;  /* what about MSB of file_size ? */
-    uint32_t info_strings_size; /* size of the info strings */ //unknown2;
-    uint32_t table_entries;
-    uint32_t table_entries_used; /* the left ones should be -1 */
-};
-
-struct NSVs_header {
-    uint32_t chunk_tag; /* 'NSVs' */
-    uint32_t v4cc;      /* or 'NONE' */
-    uint32_t a4cc;      /* or 'NONE' */
-    uint16_t vwidth;    /* assert(vwidth%16==0) */
-    uint16_t vheight;   /* assert(vheight%16==0) */
-    uint8_t framerate;  /* value = (framerate&0x80)?frtable[frameratex0x7f]:framerate */
-    uint16_t unknown;
-};
-
-struct nsv_avchunk_header {
-    uint8_t vchunk_size_lsb;
-    uint16_t vchunk_size_msb; /* value = (vchunk_size_msb << 4) | (vchunk_size_lsb >> 4) */
-    uint16_t achunk_size;
-};
-
-struct nsv_pcm_header {
-    uint8_t bits_per_sample;
-    uint8_t channel_count;
-    uint16_t sample_rate;
-};
-#endif
-
-/* variation from avi.h */
-/*typedef struct CodecTag {
-    int id;
-    unsigned int tag;
-} CodecTag;*/
-
-/* tags */
-
-#define T_NSVF MKTAG('N', 'S', 'V', 'f') /* file header */
-#define T_NSVS MKTAG('N', 'S', 'V', 's') /* chunk header */
-#define T_TOC2 MKTAG('T', 'O', 'C', '2') /* extra index marker */
-#define T_NONE MKTAG('N', 'O', 'N', 'E') /* null a/v 4CC */
-#define T_SUBT MKTAG('S', 'U', 'B', 'T') /* subtitle aux data */
-#define T_ASYN MKTAG('A', 'S', 'Y', 'N') /* async a/v aux marker */
-#define T_KEYF MKTAG('K', 'E', 'Y', 'F') /* video keyframe aux marker (addition) */
-
-#define TB_NSVF MKBETAG('N', 'S', 'V', 'f')
-#define TB_NSVS MKBETAG('N', 'S', 'V', 's')
-
-/* hardcoded stream indexes */
-#define NSV_ST_VIDEO 0
-#define NSV_ST_AUDIO 1
-#define NSV_ST_SUBT 2
-
-enum NSVStatus {
-    NSV_UNSYNC,
-    NSV_FOUND_NSVF,
-    NSV_HAS_READ_NSVF,
-    NSV_FOUND_NSVS,
-    NSV_HAS_READ_NSVS,
-    NSV_FOUND_BEEF,
-    NSV_GOT_VIDEO,
-    NSV_GOT_AUDIO,
-};
-
-typedef struct NSVStream {
-    int frame_offset; /* current frame (video) or byte (audio) counter
-                         (used to compute the pts) */
-    int scale;
-    int rate;
-    int sample_size; /* audio only data */
-    int start;
-
-    int new_frame_offset; /* temporary storage (used during seek) */
-    int cum_len; /* temporary storage (used during seek) */
-} NSVStream;
-
-typedef struct {
-    int  base_offset;
-    int  NSVf_end;
-    uint32_t *nsvs_file_offset;
-    int index_entries;
-    enum NSVStatus state;
-    AVPacket ahead[2]; /* [v, a] if .data is !NULL there is something */
-    /* cached */
-    int64_t duration;
-    uint32_t vtag, atag;
-    uint16_t vwidth, vheight;
-    int16_t avsync;
-    AVRational framerate;
-    uint32_t *nsvs_timestamps;
-    //DVDemuxContext* dv_demux;
-} NSVContext;
-
-static const AVCodecTag nsv_codec_video_tags[] = {
-    { AV_CODEC_ID_VP3, MKTAG('V', 'P', '3', ' ') },
-    { AV_CODEC_ID_VP3, MKTAG('V', 'P', '3', '0') },
-    { AV_CODEC_ID_VP3, MKTAG('V', 'P', '3', '1') },
-    { AV_CODEC_ID_VP5, MKTAG('V', 'P', '5', ' ') },
-    { AV_CODEC_ID_VP5, MKTAG('V', 'P', '5', '0') },
-    { AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', ' ') },
-    { AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', '0') },
-    { AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', '1') },
-    { AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', '2') },
-/*
-    { AV_CODEC_ID_VP4, MKTAG('V', 'P', '4', ' ') },
-    { AV_CODEC_ID_VP4, MKTAG('V', 'P', '4', '0') },
-*/
-    { AV_CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D') }, /* cf sample xvid decoder from nsv_codec_sdk.zip */
-    { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', '3') },
-    { AV_CODEC_ID_NONE, 0 },
-};
-
-static const AVCodecTag nsv_codec_audio_tags[] = {
-    { AV_CODEC_ID_MP3,       MKTAG('M', 'P', '3', ' ') },
-    { AV_CODEC_ID_AAC,       MKTAG('A', 'A', 'C', ' ') },
-    { AV_CODEC_ID_AAC,       MKTAG('A', 'A', 'C', 'P') },
-    { AV_CODEC_ID_SPEEX,     MKTAG('S', 'P', 'X', ' ') },
-    { AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'C', 'M', ' ') },
-    { AV_CODEC_ID_NONE,      0 },
-};
-
-//static int nsv_load_index(AVFormatContext *s);
-static int nsv_read_chunk(AVFormatContext *s, int fill_header);
-
-#define print_tag(str, tag, size)       \
-    av_dlog(NULL, "%s: tag=%c%c%c%c\n", \
-            str, tag & 0xff,            \
-            (tag >> 8) & 0xff,          \
-            (tag >> 16) & 0xff,         \
-            (tag >> 24) & 0xff);
-
-/* try to find something we recognize, and set the state accordingly */
-static int nsv_resync(AVFormatContext *s)
-{
-    NSVContext *nsv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    uint32_t v = 0;
-    int i;
-
-    av_dlog(s, "%s(), offset = %"PRId64", state = %d\n", __FUNCTION__, avio_tell(pb), nsv->state);
-
-    //nsv->state = NSV_UNSYNC;
-
-    for (i = 0; i < NSV_MAX_RESYNC; i++) {
-        if (pb->eof_reached) {
-            av_dlog(s, "NSV EOF\n");
-            nsv->state = NSV_UNSYNC;
-            return -1;
-        }
-        v <<= 8;
-        v |= avio_r8(pb);
-        if (i < 8) {
-            av_dlog(s, "NSV resync: [%d] = %02x\n", i, v & 0x0FF);
-        }
-
-        if ((v & 0x0000ffff) == 0xefbe) { /* BEEF */
-            av_dlog(s, "NSV resynced on BEEF after %d bytes\n", i+1);
-            nsv->state = NSV_FOUND_BEEF;
-            return 0;
-        }
-        /* we read as big-endian, thus the MK*BE* */
-        if (v == TB_NSVF) { /* NSVf */
-            av_dlog(s, "NSV resynced on NSVf after %d bytes\n", i+1);
-            nsv->state = NSV_FOUND_NSVF;
-            return 0;
-        }
-        if (v == MKBETAG('N', 'S', 'V', 's')) { /* NSVs */
-            av_dlog(s, "NSV resynced on NSVs after %d bytes\n", i+1);
-            nsv->state = NSV_FOUND_NSVS;
-            return 0;
-        }
-
-    }
-    av_dlog(s, "NSV sync lost\n");
-    return -1;
-}
-
-static int nsv_parse_NSVf_header(AVFormatContext *s)
-{
-    NSVContext *nsv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned int av_unused file_size;
-    unsigned int size;
-    int64_t duration;
-    int strings_size;
-    int table_entries;
-    int table_entries_used;
-
-    av_dlog(s, "%s()\n", __FUNCTION__);
-
-    nsv->state = NSV_UNSYNC; /* in case we fail */
-
-    size = avio_rl32(pb);
-    if (size < 28)
-        return -1;
-    nsv->NSVf_end = size;
-
-    //s->file_size = (uint32_t)avio_rl32(pb);
-    file_size = (uint32_t)avio_rl32(pb);
-    av_dlog(s, "NSV NSVf chunk_size %u\n", size);
-    av_dlog(s, "NSV NSVf file_size %u\n", file_size);
-
-    nsv->duration = duration = avio_rl32(pb); /* in ms */
-    av_dlog(s, "NSV NSVf duration %"PRId64" ms\n", duration);
-    // XXX: store it in AVStreams
-
-    strings_size = avio_rl32(pb);
-    table_entries = avio_rl32(pb);
-    table_entries_used = avio_rl32(pb);
-    av_dlog(s, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
-            strings_size, table_entries, table_entries_used);
-    if (pb->eof_reached)
-        return -1;
-
-    av_dlog(s, "NSV got header; filepos %"PRId64"\n", avio_tell(pb));
-
-    if (strings_size > 0) {
-        char *strings; /* last byte will be '\0' to play safe with str*() */
-        char *p, *endp;
-        char *token, *value;
-        char quote;
-
-        p = strings = av_mallocz((size_t)strings_size + 1);
-        if (!p)
-            return AVERROR(ENOMEM);
-        endp = strings + strings_size;
-        avio_read(pb, strings, strings_size);
-        while (p < endp) {
-            while (*p == ' ')
-                p++; /* strip out spaces */
-            if (p >= endp-2)
-                break;
-            token = p;
-            p = strchr(p, '=');
-            if (!p || p >= endp-2)
-                break;
-            *p++ = '\0';
-            quote = *p++;
-            value = p;
-            p = strchr(p, quote);
-            if (!p || p >= endp)
-                break;
-            *p++ = '\0';
-            av_dlog(s, "NSV NSVf INFO: %s='%s'\n", token, value);
-            av_dict_set(&s->metadata, token, value, 0);
-        }
-        av_free(strings);
-    }
-    if (pb->eof_reached)
-        return -1;
-
-    av_dlog(s, "NSV got infos; filepos %"PRId64"\n", avio_tell(pb));
-
-    if (table_entries_used > 0) {
-        int i;
-        nsv->index_entries = table_entries_used;
-        if((unsigned)table_entries_used >= UINT_MAX / sizeof(uint32_t))
-            return -1;
-        nsv->nsvs_file_offset = av_malloc((unsigned)table_entries_used * sizeof(uint32_t));
-        if (!nsv->nsvs_file_offset)
-            return AVERROR(ENOMEM);
-
-        for(i=0;i<table_entries_used;i++)
-            nsv->nsvs_file_offset[i] = avio_rl32(pb) + size;
-
-        if(table_entries > table_entries_used &&
-           avio_rl32(pb) == MKTAG('T','O','C','2')) {
-            nsv->nsvs_timestamps = av_malloc((unsigned)table_entries_used*sizeof(uint32_t));
-            if (!nsv->nsvs_timestamps)
-                return AVERROR(ENOMEM);
-            for(i=0;i<table_entries_used;i++) {
-                nsv->nsvs_timestamps[i] = avio_rl32(pb);
-            }
-        }
-    }
-
-    av_dlog(s, "NSV got index; filepos %"PRId64"\n", avio_tell(pb));
-
-    avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
-
-    if (pb->eof_reached)
-        return -1;
-    nsv->state = NSV_HAS_READ_NSVF;
-    return 0;
-}
-
-static int nsv_parse_NSVs_header(AVFormatContext *s)
-{
-    NSVContext *nsv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    uint32_t vtag, atag;
-    uint16_t vwidth, vheight;
-    AVRational framerate;
-    int i;
-    AVStream *st;
-    NSVStream *nst;
-    av_dlog(s, "%s()\n", __FUNCTION__);
-
-    vtag = avio_rl32(pb);
-    atag = avio_rl32(pb);
-    vwidth = avio_rl16(pb);
-    vheight = avio_rl16(pb);
-    i = avio_r8(pb);
-
-    av_dlog(s, "NSV NSVs framerate code %2x\n", i);
-    if(i&0x80) { /* odd way of giving native framerates from docs */
-        int t=(i & 0x7F)>>2;
-        if(t<16) framerate = (AVRational){1, t+1};
-        else     framerate = (AVRational){t-15, 1};
-
-        if(i&1){
-            framerate.num *= 1000;
-            framerate.den *= 1001;
-        }
-
-        if((i&3)==3)      framerate.num *= 24;
-        else if((i&3)==2) framerate.num *= 25;
-        else              framerate.num *= 30;
-    }
-    else
-        framerate= (AVRational){i, 1};
-
-    nsv->avsync = avio_rl16(pb);
-    nsv->framerate = framerate;
-
-    print_tag("NSV NSVs vtag", vtag, 0);
-    print_tag("NSV NSVs atag", atag, 0);
-    av_dlog(s, "NSV NSVs vsize %dx%d\n", vwidth, vheight);
-
-    /* XXX change to ap != NULL ? */
-    if (s->nb_streams == 0) { /* streams not yet published, let's do that */
-        nsv->vtag = vtag;
-        nsv->atag = atag;
-        nsv->vwidth = vwidth;
-        nsv->vheight = vwidth;
-        if (vtag != T_NONE) {
-            int i;
-            st = avformat_new_stream(s, NULL);
-            if (!st)
-                goto fail;
-
-            st->id = NSV_ST_VIDEO;
-            nst = av_mallocz(sizeof(NSVStream));
-            if (!nst)
-                goto fail;
-            st->priv_data = nst;
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_tag = vtag;
-            st->codec->codec_id = ff_codec_get_id(nsv_codec_video_tags, vtag);
-            st->codec->width = vwidth;
-            st->codec->height = vheight;
-            st->codec->bits_per_coded_sample = 24; /* depth XXX */
-
-            avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
-            st->start_time = 0;
-            st->duration = av_rescale(nsv->duration, framerate.num, 1000*framerate.den);
-
-            for(i=0;i<nsv->index_entries;i++) {
-                if(nsv->nsvs_timestamps) {
-                    av_add_index_entry(st, nsv->nsvs_file_offset[i], nsv->nsvs_timestamps[i],
-                                       0, 0, AVINDEX_KEYFRAME);
-                } else {
-                    int64_t ts = av_rescale(i*nsv->duration/nsv->index_entries, framerate.num, 1000*framerate.den);
-                    av_add_index_entry(st, nsv->nsvs_file_offset[i], ts, 0, 0, AVINDEX_KEYFRAME);
-                }
-            }
-        }
-        if (atag != T_NONE) {
-            st = avformat_new_stream(s, NULL);
-            if (!st)
-                goto fail;
-
-            st->id = NSV_ST_AUDIO;
-            nst = av_mallocz(sizeof(NSVStream));
-            if (!nst)
-                goto fail;
-            st->priv_data = nst;
-            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            st->codec->codec_tag = atag;
-            st->codec->codec_id = ff_codec_get_id(nsv_codec_audio_tags, atag);
-
-            st->need_parsing = AVSTREAM_PARSE_FULL; /* for PCM we will read a chunk later and put correct info */
-
-            /* set timebase to common denominator of ms and framerate */
-            avpriv_set_pts_info(st, 64, 1, framerate.num*1000);
-            st->start_time = 0;
-            st->duration = (int64_t)nsv->duration * framerate.num;
-        }
-    } else {
-        if (nsv->vtag != vtag || nsv->atag != atag || nsv->vwidth != vwidth || nsv->vheight != vwidth) {
-            av_dlog(s, "NSV NSVs header values differ from the first one!!!\n");
-            //return -1;
-        }
-    }
-
-    nsv->state = NSV_HAS_READ_NSVS;
-    return 0;
-fail:
-    /* XXX */
-    nsv->state = NSV_UNSYNC;
-    return -1;
-}
-
-static int nsv_read_header(AVFormatContext *s)
-{
-    NSVContext *nsv = s->priv_data;
-    int i, err;
-
-    av_dlog(s, "%s()\n", __FUNCTION__);
-    av_dlog(s, "filename '%s'\n", s->filename);
-
-    nsv->state = NSV_UNSYNC;
-    nsv->ahead[0].data = nsv->ahead[1].data = NULL;
-
-    for (i = 0; i < NSV_MAX_RESYNC_TRIES; i++) {
-        if (nsv_resync(s) < 0)
-            return -1;
-        if (nsv->state == NSV_FOUND_NSVF) {
-            err = nsv_parse_NSVf_header(s);
-            if (err < 0)
-                return err;
-        }
-            /* we need the first NSVs also... */
-        if (nsv->state == NSV_FOUND_NSVS) {
-            err = nsv_parse_NSVs_header(s);
-            if (err < 0)
-                return err;
-            break; /* we just want the first one */
-        }
-    }
-    if (s->nb_streams < 1) /* no luck so far */
-        return -1;
-    /* now read the first chunk, so we can attempt to decode more info */
-    err = nsv_read_chunk(s, 1);
-
-    av_dlog(s, "parsed header\n");
-    return err;
-}
-
-static int nsv_read_chunk(AVFormatContext *s, int fill_header)
-{
-    NSVContext *nsv = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st[2] = {NULL, NULL};
-    NSVStream *nst;
-    AVPacket *pkt;
-    int i, err = 0;
-    uint8_t auxcount; /* number of aux metadata, also 4 bits of vsize */
-    uint32_t vsize;
-    uint16_t asize;
-    uint16_t auxsize;
-
-    av_dlog(s, "%s(%d)\n", __FUNCTION__, fill_header);
-
-    if (nsv->ahead[0].data || nsv->ahead[1].data)
-        return 0; //-1; /* hey! eat what you've in your plate first! */
-
-null_chunk_retry:
-    if (pb->eof_reached)
-        return -1;
-
-    for (i = 0; i < NSV_MAX_RESYNC_TRIES && nsv->state < NSV_FOUND_NSVS && !err; i++)
-        err = nsv_resync(s);
-    if (err < 0)
-        return err;
-    if (nsv->state == NSV_FOUND_NSVS)
-        err = nsv_parse_NSVs_header(s);
-    if (err < 0)
-        return err;
-    if (nsv->state != NSV_HAS_READ_NSVS && nsv->state != NSV_FOUND_BEEF)
-        return -1;
-
-    auxcount = avio_r8(pb);
-    vsize = avio_rl16(pb);
-    asize = avio_rl16(pb);
-    vsize = (vsize << 4) | (auxcount >> 4);
-    auxcount &= 0x0f;
-    av_dlog(s, "NSV CHUNK %d aux, %u bytes video, %d bytes audio\n", auxcount, vsize, asize);
-    /* skip aux stuff */
-    for (i = 0; i < auxcount; i++) {
-        uint32_t av_unused auxtag;
-        auxsize = avio_rl16(pb);
-        auxtag = avio_rl32(pb);
-        av_dlog(s, "NSV aux data: '%c%c%c%c', %d bytes\n",
-              (auxtag & 0x0ff),
-              ((auxtag >> 8) & 0x0ff),
-              ((auxtag >> 16) & 0x0ff),
-              ((auxtag >> 24) & 0x0ff),
-              auxsize);
-        avio_skip(pb, auxsize);
-        vsize -= auxsize + sizeof(uint16_t) + sizeof(uint32_t); /* that's becoming braindead */
-    }
-
-    if (pb->eof_reached)
-        return -1;
-    if (!vsize && !asize) {
-        nsv->state = NSV_UNSYNC;
-        goto null_chunk_retry;
-    }
-
-    /* map back streams to v,a */
-    if (s->nb_streams > 0)
-        st[s->streams[0]->id] = s->streams[0];
-    if (s->nb_streams > 1)
-        st[s->streams[1]->id] = s->streams[1];
-
-    if (vsize && st[NSV_ST_VIDEO]) {
-        nst = st[NSV_ST_VIDEO]->priv_data;
-        pkt = &nsv->ahead[NSV_ST_VIDEO];
-        av_get_packet(pb, pkt, vsize);
-        pkt->stream_index = st[NSV_ST_VIDEO]->index;//NSV_ST_VIDEO;
-        pkt->dts = nst->frame_offset;
-        pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */
-        for (i = 0; i < FFMIN(8, vsize); i++)
-            av_dlog(s, "NSV video: [%d] = %02x\n", i, pkt->data[i]);
-    }
-    if(st[NSV_ST_VIDEO])
-        ((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset++;
-
-    if (asize && st[NSV_ST_AUDIO]) {
-        nst = st[NSV_ST_AUDIO]->priv_data;
-        pkt = &nsv->ahead[NSV_ST_AUDIO];
-        /* read raw audio specific header on the first audio chunk... */
-        /* on ALL audio chunks ?? seems so! */
-        if (asize && st[NSV_ST_AUDIO]->codec->codec_tag == MKTAG('P', 'C', 'M', ' ')/* && fill_header*/) {
-            uint8_t bps;
-            uint8_t channels;
-            uint16_t samplerate;
-            bps = avio_r8(pb);
-            channels = avio_r8(pb);
-            samplerate = avio_rl16(pb);
-            asize-=4;
-            av_dlog(s, "NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate);
-            if (fill_header) {
-                st[NSV_ST_AUDIO]->need_parsing = AVSTREAM_PARSE_NONE; /* we know everything */
-                if (bps != 16) {
-                    av_dlog(s, "NSV AUDIO bit/sample != 16 (%d)!!!\n", bps);
-                }
-                bps /= channels; // ???
-                if (bps == 8)
-                    st[NSV_ST_AUDIO]->codec->codec_id = AV_CODEC_ID_PCM_U8;
-                samplerate /= 4;/* UGH ??? XXX */
-                channels = 1;
-                st[NSV_ST_AUDIO]->codec->channels = channels;
-                st[NSV_ST_AUDIO]->codec->sample_rate = samplerate;
-                av_dlog(s, "NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate);
-            }
-        }
-        av_get_packet(pb, pkt, asize);
-        pkt->stream_index = st[NSV_ST_AUDIO]->index;//NSV_ST_AUDIO;
-        pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */
-        if( nsv->state == NSV_HAS_READ_NSVS && st[NSV_ST_VIDEO] ) {
-            /* on a nsvs frame we have new information on a/v sync */
-            pkt->dts = (((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset-1);
-            pkt->dts *= (int64_t)1000        * nsv->framerate.den;
-            pkt->dts += (int64_t)nsv->avsync * nsv->framerate.num;
-            av_dlog(s, "NSV AUDIO: sync:%d, dts:%"PRId64, nsv->avsync, pkt->dts);
-        }
-        nst->frame_offset++;
-    }
-
-    nsv->state = NSV_UNSYNC;
-    return 0;
-}
-
-
-static int nsv_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    NSVContext *nsv = s->priv_data;
-    int i, err = 0;
-
-    av_dlog(s, "%s()\n", __FUNCTION__);
-
-    /* in case we don't already have something to eat ... */
-    if (nsv->ahead[0].data == NULL && nsv->ahead[1].data == NULL)
-        err = nsv_read_chunk(s, 0);
-    if (err < 0)
-        return err;
-
-    /* now pick one of the plates */
-    for (i = 0; i < 2; i++) {
-        if (nsv->ahead[i].data) {
-            av_dlog(s, "%s: using cached packet[%d]\n", __FUNCTION__, i);
-            /* avoid the cost of new_packet + memcpy(->data) */
-            memcpy(pkt, &nsv->ahead[i], sizeof(AVPacket));
-            nsv->ahead[i].data = NULL; /* we ate that one */
-            return pkt->size;
-        }
-    }
-
-    /* this restaurant is not approvisionned :^] */
-    return -1;
-}
-
-static int nsv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
-{
-    NSVContext *nsv = s->priv_data;
-    AVStream *st = s->streams[stream_index];
-    NSVStream *nst = st->priv_data;
-    int index;
-
-    index = av_index_search_timestamp(st, timestamp, flags);
-    if(index < 0)
-        return -1;
-
-    if (avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET) < 0)
-        return -1;
-
-    nst->frame_offset = st->index_entries[index].timestamp;
-    nsv->state = NSV_UNSYNC;
-    return 0;
-}
-
-static int nsv_read_close(AVFormatContext *s)
-{
-/*     int i; */
-    NSVContext *nsv = s->priv_data;
-
-    av_freep(&nsv->nsvs_file_offset);
-    av_freep(&nsv->nsvs_timestamps);
-    if (nsv->ahead[0].data)
-        av_free_packet(&nsv->ahead[0]);
-    if (nsv->ahead[1].data)
-        av_free_packet(&nsv->ahead[1]);
-
-#if 0
-
-    for(i=0;i<s->nb_streams;i++) {
-        AVStream *st = s->streams[i];
-        NSVStream *ast = st->priv_data;
-        if(ast){
-            av_free(ast->index_entries);
-            av_free(ast);
-        }
-        av_free(st->codec->palctrl);
-    }
-
-#endif
-    return 0;
-}
-
-static int nsv_probe(AVProbeData *p)
-{
-    int i;
-    int score;
-    int vsize, asize, auxcount;
-    score = 0;
-    av_dlog(NULL, "nsv_probe(), buf_size %d\n", p->buf_size);
-    /* check file header */
-    /* streamed files might not have any header */
-    if (p->buf[0] == 'N' && p->buf[1] == 'S' &&
-        p->buf[2] == 'V' && (p->buf[3] == 'f' || p->buf[3] == 's'))
-        return AVPROBE_SCORE_MAX;
-    /* XXX: do streamed files always start at chunk boundary ?? */
-    /* or do we need to search NSVs in the byte stream ? */
-    /* seems the servers don't bother starting clean chunks... */
-    /* sometimes even the first header is at 9KB or something :^) */
-    for (i = 1; i < p->buf_size - 3; i++) {
-        if (p->buf[i+0] == 'N' && p->buf[i+1] == 'S' &&
-            p->buf[i+2] == 'V' && p->buf[i+3] == 's') {
-            score = AVPROBE_SCORE_MAX/5;
-            /* Get the chunk size and check if at the end we are getting 0xBEEF */
-            auxcount = p->buf[i+19];
-            vsize = p->buf[i+20]  | p->buf[i+21] << 8;
-            asize = p->buf[i+22]  | p->buf[i+23] << 8;
-            vsize = (vsize << 4) | (auxcount >> 4);
-            if ((asize + vsize + i + 23) <  p->buf_size - 2) {
-                if (p->buf[i+23+asize+vsize+1] == 0xEF &&
-                    p->buf[i+23+asize+vsize+2] == 0xBE)
-                    return AVPROBE_SCORE_MAX-20;
-            }
-        }
-    }
-    /* so we'll have more luck on extension... */
-    if (av_match_ext(p->filename, "nsv"))
-        return AVPROBE_SCORE_EXTENSION;
-    /* FIXME: add mime-type check */
-    return score;
-}
-
-AVInputFormat ff_nsv_demuxer = {
-    .name           = "nsv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Nullsoft Streaming Video"),
-    .priv_data_size = sizeof(NSVContext),
-    .read_probe     = nsv_probe,
-    .read_header    = nsv_read_header,
-    .read_packet    = nsv_read_packet,
-    .read_close     = nsv_read_close,
-    .read_seek      = nsv_read_seek,
-};
diff --git a/deps/libav/libavformat/nullenc.c b/deps/libav/libavformat/nullenc.c
deleted file mode 100644
index 829f2a8..0000000
--- a/deps/libav/libavformat/nullenc.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * RAW null muxer
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-
-static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    return 0;
-}
-
-AVOutputFormat ff_null_muxer = {
-    .name              = "null",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw null video"),
-    .audio_codec       = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE),
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
-    .write_packet      = null_write_packet,
-    .flags             = AVFMT_NOFILE | AVFMT_NOTIMESTAMPS | AVFMT_RAWPICTURE,
-};
diff --git a/deps/libav/libavformat/nut.c b/deps/libav/libavformat/nut.c
deleted file mode 100644
index d9a042b..0000000
--- a/deps/libav/libavformat/nut.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * nut
- * Copyright (c) 2004-2007 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mathematics.h"
-#include "libavutil/tree.h"
-#include "nut.h"
-#include "riff.h"
-#include "internal.h"
-
-const AVCodecTag ff_nut_subtitle_tags[] = {
-    { AV_CODEC_ID_TEXT,             MKTAG('U', 'T', 'F', '8') },
-    { AV_CODEC_ID_SSA,              MKTAG('S', 'S', 'A',   0) },
-    { AV_CODEC_ID_DVD_SUBTITLE,     MKTAG('D', 'V', 'D', 'S') },
-    { AV_CODEC_ID_DVB_SUBTITLE,     MKTAG('D', 'V', 'B', 'S') },
-    { AV_CODEC_ID_NONE,             0                         }
-};
-
-const AVCodecTag ff_nut_data_tags[] = {
-    { AV_CODEC_ID_TEXT,             MKTAG('U', 'T', 'F', '8') },
-    { AV_CODEC_ID_NONE,             0 }
-};
-
-const AVCodecTag ff_nut_video_tags[] = {
-    { AV_CODEC_ID_VP9,              MKTAG('V', 'P', '9', '0') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('R', 'G', 'B',  15) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', 'G', 'R',  15) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('R', 'G', 'B',  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', 'G', 'R',  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(15,  'B', 'G', 'R') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(15,  'R', 'G', 'B') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,  'B', 'G', 'R') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,  'R', 'G', 'B') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('R', 'G', 'B',  12) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', 'G', 'R',  12) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(12,  'B', 'G', 'R') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(12,  'R', 'G', 'B') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('R', 'G', 'B', 'A') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', 'G', 'R', 'A') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('A', 'B', 'G', 'R') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('A', 'R', 'G', 'B') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('R', 'G', 'B',  24) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', 'G', 'R',  24) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('4', '1', '1', 'P') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('4', '2', '2', 'P') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('4', '2', '2', 'P') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('4', '4', '0', 'P') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('4', '4', '0', 'P') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('4', '4', '4', 'P') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('4', '4', '4', 'P') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', '1', 'W', '0') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', '0', 'W', '1') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', 'G', 'R',   8) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('R', 'G', 'B',   8) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', 'G', 'R',   4) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('R', 'G', 'B',   4) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', '4', 'B', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('R', '4', 'B', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('B', 'G', 'R',  48) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('R', 'G', 'B',  48) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(48,  'B', 'G', 'R') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(48,  'R', 'G', 'B') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '3',  11,  10) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(10,   11, '3', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '3',  10,  10) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(10,   10, '3', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '3',   0,  10) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(10,    0, '3', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '1',   0,  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,    0, '1', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '3',  11,  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,   11, '3', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '3',  10,  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,   10, '3', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '3',   0,  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,    0, '3', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',  11,   8) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '2',   0,   8) },
-
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '1',   0,   9) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(9,     0, '1', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',  11,   9) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(9,    11, '4', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',  10,   9) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(9,    10, '4', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',   0,   9) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(9,     0, '4', 'Y') },
-
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '1',   0,  10) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(10,    0, '1', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',  11,  10) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(10,   11, '4', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',  10,  10) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(10,   10, '4', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',   0,  10) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(10,    0, '4', 'Y') },
-
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '1',   0,  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,    0, '1', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',  11,  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,   11, '4', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',  10,  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,   10, '4', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG('Y', '4',   0,  16) },
-    { AV_CODEC_ID_RAWVIDEO,         MKTAG(16,    0, '4', 'Y') },
-
-    { AV_CODEC_ID_NONE,             0 }
-};
-
-const AVCodecTag ff_nut_audio_tags[] = {
-    { AV_CODEC_ID_PCM_ALAW,         MKTAG('A', 'L', 'A', 'W') },
-    { AV_CODEC_ID_PCM_MULAW,        MKTAG('U', 'L', 'A', 'W') },
-    { AV_CODEC_ID_PCM_F32BE,        MKTAG(32,  'D', 'F', 'P') },
-    { AV_CODEC_ID_PCM_F32LE,        MKTAG('P', 'F', 'D',  32) },
-    { AV_CODEC_ID_PCM_F64BE,        MKTAG(64,  'D', 'F', 'P') },
-    { AV_CODEC_ID_PCM_F64LE,        MKTAG('P', 'F', 'D',  64) },
-    { AV_CODEC_ID_PCM_S16BE,        MKTAG(16,  'D', 'S', 'P') },
-    { AV_CODEC_ID_PCM_S16LE,        MKTAG('P', 'S', 'D',  16) },
-    { AV_CODEC_ID_PCM_S24BE,        MKTAG(24,  'D', 'S', 'P') },
-    { AV_CODEC_ID_PCM_S24LE,        MKTAG('P', 'S', 'D',  24) },
-    { AV_CODEC_ID_PCM_S32BE,        MKTAG(32,  'D', 'S', 'P') },
-    { AV_CODEC_ID_PCM_S32LE,        MKTAG('P', 'S', 'D',  32) },
-    { AV_CODEC_ID_PCM_S8,           MKTAG('P', 'S', 'D',   8) },
-    { AV_CODEC_ID_PCM_U16BE,        MKTAG(16,  'D', 'U', 'P') },
-    { AV_CODEC_ID_PCM_U16LE,        MKTAG('P', 'U', 'D',  16) },
-    { AV_CODEC_ID_PCM_U24BE,        MKTAG(24,  'D', 'U', 'P') },
-    { AV_CODEC_ID_PCM_U24LE,        MKTAG('P', 'U', 'D',  24) },
-    { AV_CODEC_ID_PCM_U32BE,        MKTAG(32,  'D', 'U', 'P') },
-    { AV_CODEC_ID_PCM_U32LE,        MKTAG('P', 'U', 'D',  32) },
-    { AV_CODEC_ID_PCM_U8,           MKTAG('P', 'U', 'D',   8) },
-    { AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P',  16) },
-    { AV_CODEC_ID_PCM_S24LE_PLANAR, MKTAG('P', 'S', 'P',  24) },
-    { AV_CODEC_ID_PCM_S32LE_PLANAR, MKTAG('P', 'S', 'P',  32) },
-    { AV_CODEC_ID_MP3,              MKTAG('M', 'P', '3', ' ') },
-    { AV_CODEC_ID_NONE,             0 }
-};
-
-const AVCodecTag * const ff_nut_codec_tags[] = {
-    ff_nut_video_tags, ff_nut_audio_tags, ff_nut_subtitle_tags,
-    ff_codec_bmp_tags, ff_codec_wav_tags, ff_nut_data_tags, 0
-};
-
-void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val)
-{
-    int i;
-    for (i = 0; i < nut->avf->nb_streams; i++)
-        nut->stream[i].last_pts =
-            av_rescale_rnd(val,
-                           time_base.num * (int64_t)nut->stream[i].time_base->den,
-                           time_base.den * (int64_t)nut->stream[i].time_base->num,
-                           AV_ROUND_DOWN);
-}
-
-int64_t ff_lsb2full(StreamContext *stream, int64_t lsb)
-{
-    int64_t mask  = (1 << stream->msb_pts_shift) - 1;
-    int64_t delta = stream->last_pts - mask / 2;
-    return ((lsb - delta) & mask) + delta;
-}
-
-int ff_nut_sp_pos_cmp(const Syncpoint *a, const Syncpoint *b)
-{
-    return ((a->pos - b->pos) >> 32) - ((b->pos - a->pos) >> 32);
-}
-
-int ff_nut_sp_pts_cmp(const Syncpoint *a, const Syncpoint *b)
-{
-    return ((a->ts - b->ts) >> 32) - ((b->ts - a->ts) >> 32);
-}
-
-int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts)
-{
-    Syncpoint *sp           = av_mallocz(sizeof(Syncpoint));
-    struct AVTreeNode *node = av_tree_node_alloc();
-
-    if (!sp || !node) {
-        av_freep(&sp);
-        av_freep(&node);
-        return AVERROR(ENOMEM);
-    }
-
-    sp->pos      = pos;
-    sp->back_ptr = back_ptr;
-    sp->ts       = ts;
-    av_tree_insert(&nut->syncpoints, sp, (void *) ff_nut_sp_pos_cmp, &node);
-    if (node) {
-        av_free(sp);
-        av_free(node);
-    }
-
-    return 0;
-}
-
-static int enu_free(void *opaque, void *elem)
-{
-    av_free(elem);
-    return 0;
-}
-
-void ff_nut_free_sp(NUTContext *nut)
-{
-    av_tree_enumerate(nut->syncpoints, NULL, NULL, enu_free);
-    av_tree_destroy(nut->syncpoints);
-}
-
-const Dispositions ff_nut_dispositions[] = {
-    { "default",        AV_DISPOSITION_DEFAULT  },
-    { "dub",            AV_DISPOSITION_DUB      },
-    { "original",       AV_DISPOSITION_ORIGINAL },
-    { "comment",        AV_DISPOSITION_COMMENT  },
-    { "lyrics",         AV_DISPOSITION_LYRICS   },
-    { "karaoke",        AV_DISPOSITION_KARAOKE  },
-    { "",               0                       }
-};
-
-const AVMetadataConv ff_nut_metadata_conv[] = {
-    { "Author",         "artist"      },
-    { "X-CreationTime", "date"        },
-    { "CreationTime",   "date"        },
-    { "SourceFilename", "filename"    },
-    { "X-Language",     "language"    },
-    { "X-Disposition",  "disposition" },
-    { "X-Replaces",     "replaces"    },
-    { "X-Depends",      "depends"     },
-    { "X-Uses",         "uses"        },
-    { "X-UsesFont",     "usesfont"    },
-    { 0 },
-};
diff --git a/deps/libav/libavformat/nut.h b/deps/libav/libavformat/nut.h
deleted file mode 100644
index 6357b3d..0000000
--- a/deps/libav/libavformat/nut.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * "NUT" Container Format (de)muxer
- * Copyright (c) 2006 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_NUT_H
-#define AVFORMAT_NUT_H
-
-#include "avformat.h"
-#include "internal.h"
-#include "metadata.h"
-
-#define      MAIN_STARTCODE (0x7A561F5F04ADULL + (((uint64_t)('N'<<8) + 'M')<<48))
-#define    STREAM_STARTCODE (0x11405BF2F9DBULL + (((uint64_t)('N'<<8) + 'S')<<48))
-#define SYNCPOINT_STARTCODE (0xE4ADEECA4569ULL + (((uint64_t)('N'<<8) + 'K')<<48))
-#define     INDEX_STARTCODE (0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48))
-#define      INFO_STARTCODE (0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48))
-
-#define ID_STRING "nut/multimedia container\0"
-
-#define MAX_DISTANCE (1024*32-1)
-
-#define NUT_VERSION 3
-
-typedef enum{
-    FLAG_KEY        =   1, ///<if set, frame is keyframe
-    FLAG_EOR        =   2, ///<if set, stream has no relevance on presentation. (EOR)
-    FLAG_CODED_PTS  =   8, ///<if set, coded_pts is in the frame header
-    FLAG_STREAM_ID  =  16, ///<if set, stream_id is coded in the frame header
-    FLAG_SIZE_MSB   =  32, ///<if set, data_size_msb is at frame header, otherwise data_size_msb is 0
-    FLAG_CHECKSUM   =  64, ///<if set, the frame header contains a checksum
-    FLAG_RESERVED   = 128, ///<if set, reserved_count is coded in the frame header
-    FLAG_HEADER_IDX =1024, ///<If set, header_idx is coded in the frame header.
-    FLAG_MATCH_TIME =2048, ///<If set, match_time_delta is coded in the frame header
-    FLAG_CODED      =4096, ///<if set, coded_flags are stored in the frame header
-    FLAG_INVALID    =8192, ///<if set, frame_code is invalid
-} Flag;
-
-typedef struct Syncpoint {
-    uint64_t pos;
-    uint64_t back_ptr;
-//    uint64_t global_key_pts;
-    int64_t ts;
-} Syncpoint;
-
-typedef struct FrameCode {
-    uint16_t flags;
-    uint8_t  stream_id;
-    uint16_t size_mul;
-    uint16_t size_lsb;
-    int16_t  pts_delta;
-    uint8_t  reserved_count;
-    uint8_t  header_idx;
-} FrameCode;
-
-typedef struct StreamContext {
-    int last_flags;
-    int skip_until_key_frame;
-    int64_t last_pts;
-    int time_base_id;
-    AVRational *time_base;
-    int msb_pts_shift;
-    int max_pts_distance;
-    int decode_delay; //FIXME duplicate of has_b_frames
-} StreamContext;
-
-typedef struct ChapterContext {
-    AVRational *time_base;
-} ChapterContext;
-
-typedef struct NUTContext {
-    AVFormatContext *avf;
-//    int written_packet_size;
-//    int64_t packet_start;
-    FrameCode frame_code[256];
-    uint8_t header_len[128];
-    const uint8_t *header[128];
-    uint64_t next_startcode;     ///< stores the next startcode if it has already been parsed but the stream is not seekable
-    StreamContext *stream;
-    ChapterContext *chapter;
-    unsigned int max_distance;
-    unsigned int time_base_count;
-    int64_t last_syncpoint_pos;
-    int header_count;
-    AVRational *time_base;
-    struct AVTreeNode *syncpoints;
-} NUTContext;
-
-extern const AVCodecTag ff_nut_subtitle_tags[];
-extern const AVCodecTag ff_nut_video_tags[];
-extern const AVCodecTag ff_nut_audio_tags[];
-extern const AVCodecTag ff_nut_data_tags[];
-
-extern const AVCodecTag * const ff_nut_codec_tags[];
-
-typedef struct Dispositions {
-    char str[9];
-    int flag;
-} Dispositions;
-
-void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val);
-int64_t ff_lsb2full(StreamContext *stream, int64_t lsb);
-int ff_nut_sp_pos_cmp(const Syncpoint *a, const Syncpoint *b);
-int ff_nut_sp_pts_cmp(const Syncpoint *a, const Syncpoint *b);
-int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts);
-void ff_nut_free_sp(NUTContext *nut);
-
-extern const Dispositions ff_nut_dispositions[];
-
-extern const AVMetadataConv ff_nut_metadata_conv[];
-
-#endif /* AVFORMAT_NUT_H */
diff --git a/deps/libav/libavformat/nutdec.c b/deps/libav/libavformat/nutdec.c
deleted file mode 100644
index 6328549..0000000
--- a/deps/libav/libavformat/nutdec.c
+++ /dev/null
@@ -1,1011 +0,0 @@
-/*
- * "NUT" Container Format demuxer
- * Copyright (c) 2004-2006 Michael Niedermayer
- * Copyright (c) 2003 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/bswap.h"
-#include "libavutil/dict.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/tree.h"
-#include "avio_internal.h"
-#include "nut.h"
-#include "riff.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-#define NUT_MAX_STREAMS 256    /* arbitrary sanity check value */
-
-static int get_str(AVIOContext *bc, char *string, unsigned int maxlen)
-{
-    unsigned int len = ffio_read_varlen(bc);
-
-    if (len && maxlen)
-        avio_read(bc, string, FFMIN(len, maxlen));
-    while (len > maxlen) {
-        avio_r8(bc);
-        len--;
-    }
-
-    if (maxlen)
-        string[FFMIN(len, maxlen - 1)] = 0;
-
-    if (maxlen == len)
-        return -1;
-    else
-        return 0;
-}
-
-static int64_t get_s(AVIOContext *bc)
-{
-    int64_t v = ffio_read_varlen(bc) + 1;
-
-    if (v & 1)
-        return -(v >> 1);
-    else
-        return  (v >> 1);
-}
-
-static uint64_t get_fourcc(AVIOContext *bc)
-{
-    unsigned int len = ffio_read_varlen(bc);
-
-    if (len == 2)
-        return avio_rl16(bc);
-    else if (len == 4)
-        return avio_rl32(bc);
-    else
-        return -1;
-}
-
-#ifdef TRACE
-static inline uint64_t get_v_trace(AVIOContext *bc, const char *file,
-                                   const char *func, int line)
-{
-    uint64_t v = ffio_read_varlen(bc);
-
-    av_log(NULL, AV_LOG_DEBUG, "get_v %5"PRId64" / %"PRIX64" in %s %s:%d\n",
-           v, v, file, func, line);
-    return v;
-}
-
-static inline int64_t get_s_trace(AVIOContext *bc, const char *file,
-                                  const char *func, int line)
-{
-    int64_t v = get_s(bc);
-
-    av_log(NULL, AV_LOG_DEBUG, "get_s %5"PRId64" / %"PRIX64" in %s %s:%d\n",
-           v, v, file, func, line);
-    return v;
-}
-
-#define ffio_read_varlen(bc) get_v_trace(bc,  __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_s(bc)            get_s_trace(bc,  __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#endif
-
-static int get_packetheader(NUTContext *nut, AVIOContext *bc,
-                            int calculate_checksum, uint64_t startcode)
-{
-    int64_t size;
-//    start = avio_tell(bc) - 8;
-
-    startcode = av_be2ne64(startcode);
-    startcode = ff_crc04C11DB7_update(0, (uint8_t*) &startcode, 8);
-
-    ffio_init_checksum(bc, ff_crc04C11DB7_update, startcode);
-    size = ffio_read_varlen(bc);
-    if (size > 4096)
-        avio_rb32(bc);
-    if (ffio_get_checksum(bc) && size > 4096)
-        return -1;
-
-    ffio_init_checksum(bc, calculate_checksum ? ff_crc04C11DB7_update : NULL, 0);
-
-    return size;
-}
-
-static uint64_t find_any_startcode(AVIOContext *bc, int64_t pos)
-{
-    uint64_t state = 0;
-
-    if (pos >= 0)
-        /* Note, this may fail if the stream is not seekable, but that should
-         * not matter, as in this case we simply start where we currently are */
-        avio_seek(bc, pos, SEEK_SET);
-    while (!bc->eof_reached) {
-        state = (state << 8) | avio_r8(bc);
-        if ((state >> 56) != 'N')
-            continue;
-        switch (state) {
-        case MAIN_STARTCODE:
-        case STREAM_STARTCODE:
-        case SYNCPOINT_STARTCODE:
-        case INFO_STARTCODE:
-        case INDEX_STARTCODE:
-            return state;
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Find the given startcode.
- * @param code the startcode
- * @param pos the start position of the search, or -1 if the current position
- * @return the position of the startcode or -1 if not found
- */
-static int64_t find_startcode(AVIOContext *bc, uint64_t code, int64_t pos)
-{
-    for (;;) {
-        uint64_t startcode = find_any_startcode(bc, pos);
-        if (startcode == code)
-            return avio_tell(bc) - 8;
-        else if (startcode == 0)
-            return -1;
-        pos = -1;
-    }
-}
-
-static int nut_probe(AVProbeData *p)
-{
-    int i;
-    uint64_t code = 0;
-
-    for (i = 0; i < p->buf_size; i++) {
-        code = (code << 8) | p->buf[i];
-        if (code == MAIN_STARTCODE)
-            return AVPROBE_SCORE_MAX;
-    }
-    return 0;
-}
-
-#define GET_V(dst, check)                                                     \
-    do {                                                                      \
-        tmp = ffio_read_varlen(bc);                                           \
-        if (!(check)) {                                                       \
-            av_log(s, AV_LOG_ERROR, "Error " #dst " is (%"PRId64")\n", tmp);  \
-            return AVERROR_INVALIDDATA;                                       \
-        }                                                                     \
-        dst = tmp;                                                            \
-    } while (0)
-
-static int skip_reserved(AVIOContext *bc, int64_t pos)
-{
-    pos -= avio_tell(bc);
-    if (pos < 0) {
-        avio_seek(bc, pos, SEEK_CUR);
-        return AVERROR_INVALIDDATA;
-    } else {
-        while (pos--)
-            avio_r8(bc);
-        return 0;
-    }
-}
-
-static int decode_main_header(NUTContext *nut)
-{
-    AVFormatContext *s = nut->avf;
-    AVIOContext *bc    = s->pb;
-    uint64_t tmp, end;
-    unsigned int stream_count;
-    int i, j, count;
-    int tmp_stream, tmp_mul, tmp_pts, tmp_size, tmp_res, tmp_head_idx;
-
-    end  = get_packetheader(nut, bc, 1, MAIN_STARTCODE);
-    end += avio_tell(bc);
-
-    tmp = ffio_read_varlen(bc);
-    if (tmp < 2 && tmp > NUT_VERSION) {
-        av_log(s, AV_LOG_ERROR, "Version %"PRId64" not supported.\n",
-               tmp);
-        return AVERROR(ENOSYS);
-    }
-
-    GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS);
-
-    nut->max_distance = ffio_read_varlen(bc);
-    if (nut->max_distance > 65536) {
-        av_log(s, AV_LOG_DEBUG, "max_distance %d\n", nut->max_distance);
-        nut->max_distance = 65536;
-    }
-
-    GET_V(nut->time_base_count, tmp > 0 && tmp < INT_MAX / sizeof(AVRational));
-    nut->time_base = av_malloc(nut->time_base_count * sizeof(AVRational));
-
-    for (i = 0; i < nut->time_base_count; i++) {
-        GET_V(nut->time_base[i].num, tmp > 0 && tmp < (1ULL << 31));
-        GET_V(nut->time_base[i].den, tmp > 0 && tmp < (1ULL << 31));
-        if (av_gcd(nut->time_base[i].num, nut->time_base[i].den) != 1) {
-            av_log(s, AV_LOG_ERROR, "time base invalid\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    tmp_pts      = 0;
-    tmp_mul      = 1;
-    tmp_stream   = 0;
-    tmp_head_idx = 0;
-    for (i = 0; i < 256;) {
-        int tmp_flags  = ffio_read_varlen(bc);
-        int tmp_fields = ffio_read_varlen(bc);
-
-        if (tmp_fields > 0)
-            tmp_pts = get_s(bc);
-        if (tmp_fields > 1)
-            tmp_mul = ffio_read_varlen(bc);
-        if (tmp_fields > 2)
-            tmp_stream = ffio_read_varlen(bc);
-        if (tmp_fields > 3)
-            tmp_size = ffio_read_varlen(bc);
-        else
-            tmp_size = 0;
-        if (tmp_fields > 4)
-            tmp_res = ffio_read_varlen(bc);
-        else
-            tmp_res = 0;
-        if (tmp_fields > 5)
-            count = ffio_read_varlen(bc);
-        else
-            count = tmp_mul - tmp_size;
-        if (tmp_fields > 6)
-            get_s(bc);
-        if (tmp_fields > 7)
-            tmp_head_idx = ffio_read_varlen(bc);
-
-        while (tmp_fields-- > 8)
-            ffio_read_varlen(bc);
-
-        if (count == 0 || i + count > 256) {
-            av_log(s, AV_LOG_ERROR, "illegal count %d at %d\n", count, i);
-            return AVERROR_INVALIDDATA;
-        }
-        if (tmp_stream >= stream_count) {
-            av_log(s, AV_LOG_ERROR, "illegal stream number\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        for (j = 0; j < count; j++, i++) {
-            if (i == 'N') {
-                nut->frame_code[i].flags = FLAG_INVALID;
-                j--;
-                continue;
-            }
-            nut->frame_code[i].flags          = tmp_flags;
-            nut->frame_code[i].pts_delta      = tmp_pts;
-            nut->frame_code[i].stream_id      = tmp_stream;
-            nut->frame_code[i].size_mul       = tmp_mul;
-            nut->frame_code[i].size_lsb       = tmp_size + j;
-            nut->frame_code[i].reserved_count = tmp_res;
-            nut->frame_code[i].header_idx     = tmp_head_idx;
-        }
-    }
-    assert(nut->frame_code['N'].flags == FLAG_INVALID);
-
-    if (end > avio_tell(bc) + 4) {
-        int rem = 1024;
-        GET_V(nut->header_count, tmp < 128U);
-        nut->header_count++;
-        for (i = 1; i < nut->header_count; i++) {
-            uint8_t *hdr;
-            GET_V(nut->header_len[i], tmp > 0 && tmp < 256);
-            rem -= nut->header_len[i];
-            if (rem < 0) {
-                av_log(s, AV_LOG_ERROR, "invalid elision header\n");
-                return AVERROR_INVALIDDATA;
-            }
-            hdr = av_malloc(nut->header_len[i]);
-            if (!hdr)
-                return AVERROR(ENOMEM);
-            avio_read(bc, hdr, nut->header_len[i]);
-            nut->header[i] = hdr;
-        }
-        assert(nut->header_len[0] == 0);
-    }
-
-    if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {
-        av_log(s, AV_LOG_ERROR, "main header checksum mismatch\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    nut->stream = av_mallocz(sizeof(StreamContext) * stream_count);
-    for (i = 0; i < stream_count; i++)
-        avformat_new_stream(s, NULL);
-
-    return 0;
-}
-
-static int decode_stream_header(NUTContext *nut)
-{
-    AVFormatContext *s = nut->avf;
-    AVIOContext *bc    = s->pb;
-    StreamContext *stc;
-    int class, stream_id;
-    uint64_t tmp, end;
-    AVStream *st;
-
-    end  = get_packetheader(nut, bc, 1, STREAM_STARTCODE);
-    end += avio_tell(bc);
-
-    GET_V(stream_id, tmp < s->nb_streams && !nut->stream[tmp].time_base);
-    stc = &nut->stream[stream_id];
-    st  = s->streams[stream_id];
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    class                = ffio_read_varlen(bc);
-    tmp                  = get_fourcc(bc);
-    st->codec->codec_tag = tmp;
-    switch (class) {
-    case 0:
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id   = av_codec_get_id((const AVCodecTag * const []) {
-                                                    ff_nut_video_tags,
-                                                    ff_codec_bmp_tags,
-                                                    0
-                                                },
-                                                tmp);
-        break;
-    case 1:
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id   = av_codec_get_id((const AVCodecTag * const []) {
-                                                    ff_nut_audio_tags,
-                                                    ff_codec_wav_tags,
-                                                    0
-                                                },
-                                                tmp);
-        break;
-    case 2:
-        st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-        st->codec->codec_id   = ff_codec_get_id(ff_nut_subtitle_tags, tmp);
-        break;
-    case 3:
-        st->codec->codec_type = AVMEDIA_TYPE_DATA;
-        st->codec->codec_id   = ff_codec_get_id(ff_nut_data_tags, tmp);
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "unknown stream class (%d)\n", class);
-        return AVERROR(ENOSYS);
-    }
-    if (class < 3 && st->codec->codec_id == AV_CODEC_ID_NONE)
-        av_log(s, AV_LOG_ERROR,
-               "Unknown codec tag '0x%04x' for stream number %d\n",
-               (unsigned int) tmp, stream_id);
-
-    GET_V(stc->time_base_id, tmp < nut->time_base_count);
-    GET_V(stc->msb_pts_shift, tmp < 16);
-    stc->max_pts_distance = ffio_read_varlen(bc);
-    GET_V(stc->decode_delay, tmp < 1000); // sanity limit, raise this if Moore's law is true
-    st->codec->has_b_frames = stc->decode_delay;
-    ffio_read_varlen(bc); // stream flags
-
-    GET_V(st->codec->extradata_size, tmp < (1 << 30));
-    if (st->codec->extradata_size) {
-        st->codec->extradata = av_mallocz(st->codec->extradata_size +
-                                          FF_INPUT_BUFFER_PADDING_SIZE);
-        avio_read(bc, st->codec->extradata, st->codec->extradata_size);
-    }
-
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        GET_V(st->codec->width,  tmp > 0);
-        GET_V(st->codec->height, tmp > 0);
-        st->sample_aspect_ratio.num = ffio_read_varlen(bc);
-        st->sample_aspect_ratio.den = ffio_read_varlen(bc);
-        if ((!st->sample_aspect_ratio.num) != (!st->sample_aspect_ratio.den)) {
-            av_log(s, AV_LOG_ERROR, "invalid aspect ratio %d/%d\n",
-                   st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
-            return AVERROR_INVALIDDATA;
-        }
-        ffio_read_varlen(bc); /* csp type */
-    } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-        GET_V(st->codec->sample_rate, tmp > 0);
-        ffio_read_varlen(bc); // samplerate_den
-        GET_V(st->codec->channels, tmp > 0);
-    }
-    if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {
-        av_log(s, AV_LOG_ERROR,
-               "stream header %d checksum mismatch\n", stream_id);
-        return AVERROR_INVALIDDATA;
-    }
-    stc->time_base = &nut->time_base[stc->time_base_id];
-    avpriv_set_pts_info(s->streams[stream_id], 63, stc->time_base->num,
-                        stc->time_base->den);
-    return 0;
-}
-
-static void set_disposition_bits(AVFormatContext *avf, char *value,
-                                 int stream_id)
-{
-    int flag = 0, i;
-
-    for (i = 0; ff_nut_dispositions[i].flag; ++i)
-        if (!strcmp(ff_nut_dispositions[i].str, value))
-            flag = ff_nut_dispositions[i].flag;
-    if (!flag)
-        av_log(avf, AV_LOG_INFO, "unknown disposition type '%s'\n", value);
-    for (i = 0; i < avf->nb_streams; ++i)
-        if (stream_id == i || stream_id == -1)
-            avf->streams[i]->disposition |= flag;
-}
-
-static int decode_info_header(NUTContext *nut)
-{
-    AVFormatContext *s = nut->avf;
-    AVIOContext *bc    = s->pb;
-    uint64_t tmp, chapter_start, chapter_len;
-    unsigned int stream_id_plus1, count;
-    int chapter_id, i;
-    int64_t value, end;
-    char name[256], str_value[1024], type_str[256];
-    const char *type;
-    AVChapter *chapter      = NULL;
-    AVStream *st            = NULL;
-    AVDictionary **metadata = NULL;
-
-    end  = get_packetheader(nut, bc, 1, INFO_STARTCODE);
-    end += avio_tell(bc);
-
-    GET_V(stream_id_plus1, tmp <= s->nb_streams);
-    chapter_id    = get_s(bc);
-    chapter_start = ffio_read_varlen(bc);
-    chapter_len   = ffio_read_varlen(bc);
-    count         = ffio_read_varlen(bc);
-
-    if (chapter_id && !stream_id_plus1) {
-        int64_t start = chapter_start / nut->time_base_count;
-        chapter = avpriv_new_chapter(s, chapter_id,
-                                     nut->time_base[chapter_start %
-                                                    nut->time_base_count],
-                                     start, start + chapter_len, NULL);
-        metadata = &chapter->metadata;
-    } else if (stream_id_plus1) {
-        st       = s->streams[stream_id_plus1 - 1];
-        metadata = &st->metadata;
-    } else
-        metadata = &s->metadata;
-
-    for (i = 0; i < count; i++) {
-        get_str(bc, name, sizeof(name));
-        value = get_s(bc);
-        if (value == -1) {
-            type = "UTF-8";
-            get_str(bc, str_value, sizeof(str_value));
-        } else if (value == -2) {
-            get_str(bc, type_str, sizeof(type_str));
-            type = type_str;
-            get_str(bc, str_value, sizeof(str_value));
-        } else if (value == -3) {
-            type  = "s";
-            value = get_s(bc);
-        } else if (value == -4) {
-            type  = "t";
-            value = ffio_read_varlen(bc);
-        } else if (value < -4) {
-            type = "r";
-            get_s(bc);
-        } else {
-            type = "v";
-        }
-
-        if (stream_id_plus1 > s->nb_streams) {
-            av_log(s, AV_LOG_ERROR, "invalid stream id for info packet\n");
-            continue;
-        }
-
-        if (!strcmp(type, "UTF-8")) {
-            if (chapter_id == 0 && !strcmp(name, "Disposition")) {
-                set_disposition_bits(s, str_value, stream_id_plus1 - 1);
-                continue;
-            }
-            if (metadata && av_strcasecmp(name, "Uses") &&
-                av_strcasecmp(name, "Depends") && av_strcasecmp(name, "Replaces"))
-                av_dict_set(metadata, name, str_value, 0);
-        }
-    }
-
-    if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {
-        av_log(s, AV_LOG_ERROR, "info header checksum mismatch\n");
-        return AVERROR_INVALIDDATA;
-    }
-    return 0;
-}
-
-static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr)
-{
-    AVFormatContext *s = nut->avf;
-    AVIOContext *bc    = s->pb;
-    int64_t end, tmp;
-    int ret;
-
-    nut->last_syncpoint_pos = avio_tell(bc) - 8;
-
-    end  = get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE);
-    end += avio_tell(bc);
-
-    tmp       = ffio_read_varlen(bc);
-    *back_ptr = nut->last_syncpoint_pos - 16 * ffio_read_varlen(bc);
-    if (*back_ptr < 0)
-        return -1;
-
-    ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count],
-                    tmp / nut->time_base_count);
-
-    if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {
-        av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    *ts = tmp / s->nb_streams *
-          av_q2d(nut->time_base[tmp % s->nb_streams]) * AV_TIME_BASE;
-
-    if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts)) < 0)
-        return ret;
-
-    return 0;
-}
-
-static int find_and_decode_index(NUTContext *nut)
-{
-    AVFormatContext *s = nut->avf;
-    AVIOContext *bc    = s->pb;
-    uint64_t tmp, end;
-    int i, j, syncpoint_count;
-    int64_t filesize = avio_size(bc);
-    int64_t *syncpoints;
-    int8_t *has_keyframe;
-    int ret = AVERROR_INVALIDDATA;
-
-    avio_seek(bc, filesize - 12, SEEK_SET);
-    avio_seek(bc, filesize - avio_rb64(bc), SEEK_SET);
-    if (avio_rb64(bc) != INDEX_STARTCODE) {
-        av_log(s, AV_LOG_ERROR, "no index at the end\n");
-        return ret;
-    }
-
-    end  = get_packetheader(nut, bc, 1, INDEX_STARTCODE);
-    end += avio_tell(bc);
-
-    ffio_read_varlen(bc); // max_pts
-    GET_V(syncpoint_count, tmp < INT_MAX / 8 && tmp > 0);
-    syncpoints   = av_malloc(sizeof(int64_t) *  syncpoint_count);
-    has_keyframe = av_malloc(sizeof(int8_t)  * (syncpoint_count + 1));
-    for (i = 0; i < syncpoint_count; i++) {
-        syncpoints[i] = ffio_read_varlen(bc);
-        if (syncpoints[i] <= 0)
-            goto fail;
-        if (i)
-            syncpoints[i] += syncpoints[i - 1];
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        int64_t last_pts = -1;
-        for (j = 0; j < syncpoint_count;) {
-            uint64_t x = ffio_read_varlen(bc);
-            int type   = x & 1;
-            int n      = j;
-            x >>= 1;
-            if (type) {
-                int flag = x & 1;
-                x >>= 1;
-                if (n + x >= syncpoint_count + 1) {
-                    av_log(s, AV_LOG_ERROR, "index overflow A\n");
-                    goto fail;
-                }
-                while (x--)
-                    has_keyframe[n++] = flag;
-                has_keyframe[n++] = !flag;
-            } else {
-                while (x != 1) {
-                    if (n >= syncpoint_count + 1) {
-                        av_log(s, AV_LOG_ERROR, "index overflow B\n");
-                        goto fail;
-                    }
-                    has_keyframe[n++] = x & 1;
-                    x >>= 1;
-                }
-            }
-            if (has_keyframe[0]) {
-                av_log(s, AV_LOG_ERROR, "keyframe before first syncpoint in index\n");
-                goto fail;
-            }
-            assert(n <= syncpoint_count + 1);
-            for (; j < n && j < syncpoint_count; j++) {
-                if (has_keyframe[j]) {
-                    uint64_t B, A = ffio_read_varlen(bc);
-                    if (!A) {
-                        A = ffio_read_varlen(bc);
-                        B = ffio_read_varlen(bc);
-                        // eor_pts[j][i] = last_pts + A + B
-                    } else
-                        B = 0;
-                    av_add_index_entry(s->streams[i], 16 * syncpoints[j - 1],
-                                       last_pts + A, 0, 0, AVINDEX_KEYFRAME);
-                    last_pts += A + B;
-                }
-            }
-        }
-    }
-
-    if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {
-        av_log(s, AV_LOG_ERROR, "index checksum mismatch\n");
-        goto fail;
-    }
-    ret = 0;
-
-fail:
-    av_free(syncpoints);
-    av_free(has_keyframe);
-    return ret;
-}
-
-static int nut_read_header(AVFormatContext *s)
-{
-    NUTContext *nut = s->priv_data;
-    AVIOContext *bc = s->pb;
-    int64_t pos;
-    int initialized_stream_count;
-
-    nut->avf = s;
-
-    /* main header */
-    pos = 0;
-    do {
-        pos = find_startcode(bc, MAIN_STARTCODE, pos) + 1;
-        if (pos < 0 + 1) {
-            av_log(s, AV_LOG_ERROR, "No main startcode found.\n");
-            return AVERROR_INVALIDDATA;
-        }
-    } while (decode_main_header(nut) < 0);
-
-    /* stream headers */
-    pos = 0;
-    for (initialized_stream_count = 0; initialized_stream_count < s->nb_streams;) {
-        pos = find_startcode(bc, STREAM_STARTCODE, pos) + 1;
-        if (pos < 0 + 1) {
-            av_log(s, AV_LOG_ERROR, "Not all stream headers found.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (decode_stream_header(nut) >= 0)
-            initialized_stream_count++;
-    }
-
-    /* info headers */
-    pos = 0;
-    for (;;) {
-        uint64_t startcode = find_any_startcode(bc, pos);
-        pos = avio_tell(bc);
-
-        if (startcode == 0) {
-            av_log(s, AV_LOG_ERROR, "EOF before video frames\n");
-            return AVERROR_INVALIDDATA;
-        } else if (startcode == SYNCPOINT_STARTCODE) {
-            nut->next_startcode = startcode;
-            break;
-        } else if (startcode != INFO_STARTCODE) {
-            continue;
-        }
-
-        decode_info_header(nut);
-    }
-
-    s->data_offset = pos - 8;
-
-    if (bc->seekable) {
-        int64_t orig_pos = avio_tell(bc);
-        find_and_decode_index(nut);
-        avio_seek(bc, orig_pos, SEEK_SET);
-    }
-    assert(nut->next_startcode == SYNCPOINT_STARTCODE);
-
-    ff_metadata_conv_ctx(s, NULL, ff_nut_metadata_conv);
-
-    return 0;
-}
-
-static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id,
-                               uint8_t *header_idx, int frame_code)
-{
-    AVFormatContext *s = nut->avf;
-    AVIOContext *bc    = s->pb;
-    StreamContext *stc;
-    int size, flags, size_mul, pts_delta, i, reserved_count;
-    uint64_t tmp;
-
-    if (avio_tell(bc) > nut->last_syncpoint_pos + nut->max_distance) {
-        av_log(s, AV_LOG_ERROR,
-               "Last frame must have been damaged %"PRId64" > %"PRId64" + %d\n",
-               avio_tell(bc), nut->last_syncpoint_pos, nut->max_distance);
-        return AVERROR_INVALIDDATA;
-    }
-
-    flags          = nut->frame_code[frame_code].flags;
-    size_mul       = nut->frame_code[frame_code].size_mul;
-    size           = nut->frame_code[frame_code].size_lsb;
-    *stream_id     = nut->frame_code[frame_code].stream_id;
-    pts_delta      = nut->frame_code[frame_code].pts_delta;
-    reserved_count = nut->frame_code[frame_code].reserved_count;
-    *header_idx    = nut->frame_code[frame_code].header_idx;
-
-    if (flags & FLAG_INVALID)
-        return AVERROR_INVALIDDATA;
-    if (flags & FLAG_CODED)
-        flags ^= ffio_read_varlen(bc);
-    if (flags & FLAG_STREAM_ID) {
-        GET_V(*stream_id, tmp < s->nb_streams);
-    }
-    stc = &nut->stream[*stream_id];
-    if (flags & FLAG_CODED_PTS) {
-        int coded_pts = ffio_read_varlen(bc);
-        // FIXME check last_pts validity?
-        if (coded_pts < (1 << stc->msb_pts_shift)) {
-            *pts = ff_lsb2full(stc, coded_pts);
-        } else
-            *pts = coded_pts - (1 << stc->msb_pts_shift);
-    } else
-        *pts = stc->last_pts + pts_delta;
-    if (flags & FLAG_SIZE_MSB)
-        size += size_mul * ffio_read_varlen(bc);
-    if (flags & FLAG_MATCH_TIME)
-        get_s(bc);
-    if (flags & FLAG_HEADER_IDX)
-        *header_idx = ffio_read_varlen(bc);
-    if (flags & FLAG_RESERVED)
-        reserved_count = ffio_read_varlen(bc);
-    for (i = 0; i < reserved_count; i++)
-        ffio_read_varlen(bc);
-
-    if (*header_idx >= (unsigned)nut->header_count) {
-        av_log(s, AV_LOG_ERROR, "header_idx invalid\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (size > 4096)
-        *header_idx = 0;
-    size -= nut->header_len[*header_idx];
-
-    if (flags & FLAG_CHECKSUM) {
-        avio_rb32(bc); // FIXME check this
-    } else if (size > 2 * nut->max_distance || FFABS(stc->last_pts - *pts) >
-               stc->max_pts_distance) {
-        av_log(s, AV_LOG_ERROR, "frame size > 2max_distance and no checksum\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    stc->last_pts   = *pts;
-    stc->last_flags = flags;
-
-    return size;
-}
-
-static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
-{
-    AVFormatContext *s = nut->avf;
-    AVIOContext *bc    = s->pb;
-    int size, stream_id, discard;
-    int64_t pts, last_IP_pts;
-    StreamContext *stc;
-    uint8_t header_idx;
-
-    size = decode_frame_header(nut, &pts, &stream_id, &header_idx, frame_code);
-    if (size < 0)
-        return size;
-
-    stc = &nut->stream[stream_id];
-
-    if (stc->last_flags & FLAG_KEY)
-        stc->skip_until_key_frame = 0;
-
-    discard     = s->streams[stream_id]->discard;
-    last_IP_pts = s->streams[stream_id]->last_IP_pts;
-    if ((discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY)) ||
-        (discard >= AVDISCARD_BIDIR  && last_IP_pts != AV_NOPTS_VALUE &&
-         last_IP_pts > pts) ||
-        discard >= AVDISCARD_ALL ||
-        stc->skip_until_key_frame) {
-        avio_skip(bc, size);
-        return 1;
-    }
-
-    av_new_packet(pkt, size + nut->header_len[header_idx]);
-    memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
-    pkt->pos = avio_tell(bc); // FIXME
-    avio_read(bc, pkt->data + nut->header_len[header_idx], size);
-
-    pkt->stream_index = stream_id;
-    if (stc->last_flags & FLAG_KEY)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    pkt->pts = pts;
-
-    return 0;
-}
-
-static int nut_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    NUTContext *nut = s->priv_data;
-    AVIOContext *bc = s->pb;
-    int i, frame_code = 0, ret, skip;
-    int64_t ts, back_ptr;
-
-    for (;;) {
-        int64_t pos  = avio_tell(bc);
-        uint64_t tmp = nut->next_startcode;
-        nut->next_startcode = 0;
-
-        if (tmp) {
-            pos -= 8;
-        } else {
-            frame_code = avio_r8(bc);
-            if (bc->eof_reached)
-                return AVERROR_EOF;
-            if (frame_code == 'N') {
-                tmp = frame_code;
-                for (i = 1; i < 8; i++)
-                    tmp = (tmp << 8) + avio_r8(bc);
-            }
-        }
-        switch (tmp) {
-        case MAIN_STARTCODE:
-        case STREAM_STARTCODE:
-        case INDEX_STARTCODE:
-            skip = get_packetheader(nut, bc, 0, tmp);
-            avio_skip(bc, skip);
-            break;
-        case INFO_STARTCODE:
-            if (decode_info_header(nut) < 0)
-                goto resync;
-            break;
-        case SYNCPOINT_STARTCODE:
-            if (decode_syncpoint(nut, &ts, &back_ptr) < 0)
-                goto resync;
-            frame_code = avio_r8(bc);
-        case 0:
-            ret = decode_frame(nut, pkt, frame_code);
-            if (ret == 0)
-                return 0;
-            else if (ret == 1) // OK but discard packet
-                break;
-        default:
-resync:
-            av_log(s, AV_LOG_DEBUG, "syncing from %"PRId64"\n", pos);
-            tmp = find_any_startcode(bc, nut->last_syncpoint_pos + 1);
-            if (tmp == 0)
-                return AVERROR_INVALIDDATA;
-            av_log(s, AV_LOG_DEBUG, "sync\n");
-            nut->next_startcode = tmp;
-        }
-    }
-}
-
-static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index,
-                                  int64_t *pos_arg, int64_t pos_limit)
-{
-    NUTContext *nut = s->priv_data;
-    AVIOContext *bc = s->pb;
-    int64_t pos, pts, back_ptr;
-    av_log(s, AV_LOG_DEBUG, "read_timestamp(X,%d,%"PRId64",%"PRId64")\n",
-           stream_index, *pos_arg, pos_limit);
-
-    pos = *pos_arg;
-    do {
-        pos = find_startcode(bc, SYNCPOINT_STARTCODE, pos) + 1;
-        if (pos < 1) {
-            assert(nut->next_startcode == 0);
-            av_log(s, AV_LOG_ERROR, "read_timestamp failed.\n");
-            return AV_NOPTS_VALUE;
-        }
-    } while (decode_syncpoint(nut, &pts, &back_ptr) < 0);
-    *pos_arg = pos - 1;
-    assert(nut->last_syncpoint_pos == *pos_arg);
-
-    av_log(s, AV_LOG_DEBUG, "return %"PRId64" %"PRId64"\n", pts, back_ptr);
-    if (stream_index == -1)
-        return pts;
-    else if (stream_index == -2)
-        return back_ptr;
-
-    return AV_NOPTS_VALUE;
-}
-
-static int read_seek(AVFormatContext *s, int stream_index,
-                     int64_t pts, int flags)
-{
-    NUTContext *nut    = s->priv_data;
-    AVStream *st       = s->streams[stream_index];
-    Syncpoint dummy    = { .ts = pts * av_q2d(st->time_base) * AV_TIME_BASE };
-    Syncpoint nopts_sp = { .ts = AV_NOPTS_VALUE, .back_ptr = AV_NOPTS_VALUE };
-    Syncpoint *sp, *next_node[2] = { &nopts_sp, &nopts_sp };
-    int64_t pos, pos2, ts;
-    int i;
-
-    if (st->index_entries) {
-        int index = av_index_search_timestamp(st, pts, flags);
-        if (index < 0)
-            return -1;
-
-        pos2 = st->index_entries[index].pos;
-        ts   = st->index_entries[index].timestamp;
-    } else {
-        av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pts_cmp,
-                     (void **) next_node);
-        av_log(s, AV_LOG_DEBUG, "%"PRIu64"-%"PRIu64" %"PRId64"-%"PRId64"\n",
-               next_node[0]->pos, next_node[1]->pos, next_node[0]->ts,
-               next_node[1]->ts);
-        pos = ff_gen_search(s, -1, dummy.ts, next_node[0]->pos,
-                            next_node[1]->pos, next_node[1]->pos,
-                            next_node[0]->ts, next_node[1]->ts,
-                            AVSEEK_FLAG_BACKWARD, &ts, nut_read_timestamp);
-
-        if (!(flags & AVSEEK_FLAG_BACKWARD)) {
-            dummy.pos    = pos + 16;
-            next_node[1] = &nopts_sp;
-            av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp,
-                         (void **) next_node);
-            pos2 = ff_gen_search(s, -2, dummy.pos, next_node[0]->pos,
-                                 next_node[1]->pos, next_node[1]->pos,
-                                 next_node[0]->back_ptr, next_node[1]->back_ptr,
-                                 flags, &ts, nut_read_timestamp);
-            if (pos2 >= 0)
-                pos = pos2;
-            // FIXME dir but I think it does not matter
-        }
-        dummy.pos = pos;
-        sp = av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp,
-                          NULL);
-
-        assert(sp);
-        pos2 = sp->back_ptr - 15;
-    }
-    av_log(NULL, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos2);
-    pos = find_startcode(s->pb, SYNCPOINT_STARTCODE, pos2);
-    avio_seek(s->pb, pos, SEEK_SET);
-    av_log(NULL, AV_LOG_DEBUG, "SP: %"PRId64"\n", pos);
-    if (pos2 > pos || pos2 + 15 < pos)
-        av_log(NULL, AV_LOG_ERROR, "no syncpoint at backptr pos\n");
-    for (i = 0; i < s->nb_streams; i++)
-        nut->stream[i].skip_until_key_frame = 1;
-
-    return 0;
-}
-
-static int nut_read_close(AVFormatContext *s)
-{
-    NUTContext *nut = s->priv_data;
-    int i;
-
-    av_freep(&nut->time_base);
-    av_freep(&nut->stream);
-    ff_nut_free_sp(nut);
-    for (i = 1; i < nut->header_count; i++)
-        av_freep(&nut->header[i]);
-
-    return 0;
-}
-
-AVInputFormat ff_nut_demuxer = {
-    .name           = "nut",
-    .long_name      = NULL_IF_CONFIG_SMALL("NUT"),
-    .priv_data_size = sizeof(NUTContext),
-    .read_probe     = nut_probe,
-    .read_header    = nut_read_header,
-    .read_packet    = nut_read_packet,
-    .read_close     = nut_read_close,
-    .read_seek      = read_seek,
-    .extensions     = "nut",
-    .codec_tag      = ff_nut_codec_tags,
-};
diff --git a/deps/libav/libavformat/nutenc.c b/deps/libav/libavformat/nutenc.c
deleted file mode 100644
index 2d3862d..0000000
--- a/deps/libav/libavformat/nutenc.c
+++ /dev/null
@@ -1,962 +0,0 @@
-/*
- * nut muxer
- * Copyright (c) 2004-2007 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/tree.h"
-#include "libavutil/dict.h"
-#include "libavcodec/mpegaudiodata.h"
-#include "nut.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "riff.h"
-
-static int find_expected_header(AVCodecContext *c, int size, int key_frame,
-                                uint8_t out[64])
-{
-    int sample_rate = c->sample_rate;
-
-    if (size > 4096)
-        return 0;
-
-    AV_WB24(out, 1);
-
-    if (c->codec_id == AV_CODEC_ID_MPEG4) {
-        if (key_frame) {
-            return 3;
-        } else {
-            out[3] = 0xB6;
-            return 4;
-        }
-    } else if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
-               c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
-        return 3;
-    } else if (c->codec_id == AV_CODEC_ID_H264) {
-        return 3;
-    } else if (c->codec_id == AV_CODEC_ID_MP3 ||
-               c->codec_id == AV_CODEC_ID_MP2) {
-        int lsf, mpeg25, sample_rate_index, bitrate_index, frame_size;
-        int layer           = c->codec_id == AV_CODEC_ID_MP3 ? 3 : 2;
-        unsigned int header = 0xFFF00000;
-
-        lsf           = sample_rate < (24000 + 32000) / 2;
-        mpeg25        = sample_rate < (12000 + 16000) / 2;
-        sample_rate <<= lsf + mpeg25;
-        if (sample_rate < (32000 + 44100) / 2)
-            sample_rate_index = 2;
-        else if (sample_rate < (44100 + 48000) / 2)
-            sample_rate_index = 0;
-        else
-            sample_rate_index = 1;
-
-        sample_rate = avpriv_mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25);
-
-        for (bitrate_index = 2; bitrate_index < 30; bitrate_index++) {
-            frame_size =
-                avpriv_mpa_bitrate_tab[lsf][layer - 1][bitrate_index >> 1];
-            frame_size = (frame_size * 144000) / (sample_rate << lsf) +
-                (bitrate_index & 1);
-
-            if (frame_size == size)
-                break;
-        }
-
-        header |= (!lsf) << 19;
-        header |= (4 - layer) << 17;
-        header |= 1 << 16; //no crc
-        AV_WB32(out, header);
-        if (size <= 0)
-            return 2;  //we guess there is no crc, if there is one the user clearly does not care about overhead
-        if (bitrate_index == 30)
-            return -1;  //something is wrong ...
-
-        header |= (bitrate_index >> 1) << 12;
-        header |= sample_rate_index << 10;
-        header |= (bitrate_index & 1) << 9;
-
-        return 2; //FIXME actually put the needed ones in build_elision_headers()
-        //return 3; //we guess that the private bit is not set
-//FIXME the above assumptions should be checked, if these turn out false too often something should be done
-    }
-    return 0;
-}
-
-static int find_header_idx(AVFormatContext *s, AVCodecContext *c, int size,
-                           int frame_type)
-{
-    NUTContext *nut = s->priv_data;
-    uint8_t out[64];
-    int i;
-    int len = find_expected_header(c, size, frame_type, out);
-
-    for (i = 1; i < nut->header_count; i++) {
-        if (len == nut->header_len[i] && !memcmp(out, nut->header[i], len)) {
-            return i;
-        }
-    }
-
-    return 0;
-}
-
-static void build_elision_headers(AVFormatContext *s)
-{
-    NUTContext *nut = s->priv_data;
-    int i;
-    //FIXME this is lame
-    //FIXME write a 2pass mode to find the maximal headers
-    static const uint8_t headers[][5] = {
-        { 3, 0x00, 0x00, 0x01 },
-        { 4, 0x00, 0x00, 0x01, 0xB6},
-        { 2, 0xFF, 0xFA }, //mp3+crc
-        { 2, 0xFF, 0xFB }, //mp3
-        { 2, 0xFF, 0xFC }, //mp2+crc
-        { 2, 0xFF, 0xFD }, //mp2
-    };
-
-    nut->header_count = 7;
-    for (i = 1; i < nut->header_count; i++) {
-        nut->header_len[i] = headers[i - 1][0];
-        nut->header[i]     = &headers[i - 1][1];
-    }
-}
-
-static void build_frame_code(AVFormatContext *s)
-{
-    NUTContext *nut = s->priv_data;
-    int key_frame, index, pred, stream_id;
-    int start = 1;
-    int end   = 254;
-    int keyframe_0_esc = s->nb_streams > 2;
-    int pred_table[10];
-    FrameCode *ft;
-
-    ft            = &nut->frame_code[start];
-    ft->flags     = FLAG_CODED;
-    ft->size_mul  = 1;
-    ft->pts_delta = 1;
-    start++;
-
-    if (keyframe_0_esc) {
-        /* keyframe = 0 escape */
-        FrameCode *ft = &nut->frame_code[start];
-        ft->flags    = FLAG_STREAM_ID | FLAG_SIZE_MSB | FLAG_CODED_PTS;
-        ft->size_mul = 1;
-        start++;
-    }
-
-    for (stream_id = 0; stream_id < s->nb_streams; stream_id++) {
-        int start2 = start + (end - start) * stream_id       / s->nb_streams;
-        int end2   = start + (end - start) * (stream_id + 1) / s->nb_streams;
-        AVCodecContext *codec = s->streams[stream_id]->codec;
-        int is_audio          = codec->codec_type == AVMEDIA_TYPE_AUDIO;
-        int intra_only        = /*codec->intra_only || */ is_audio;
-        int pred_count;
-
-        for (key_frame = 0; key_frame < 2; key_frame++) {
-            if (!intra_only || !keyframe_0_esc || key_frame != 0) {
-                FrameCode *ft = &nut->frame_code[start2];
-                ft->flags     = FLAG_KEY * key_frame;
-                ft->flags    |= FLAG_SIZE_MSB | FLAG_CODED_PTS;
-                ft->stream_id = stream_id;
-                ft->size_mul  = 1;
-                if (is_audio)
-                    ft->header_idx = find_header_idx(s, codec, -1, key_frame);
-                start2++;
-            }
-        }
-
-        key_frame = intra_only;
-        if (is_audio) {
-            int frame_bytes = codec->frame_size * (int64_t)codec->bit_rate /
-                              (8 * codec->sample_rate);
-            int pts;
-            for (pts = 0; pts < 2; pts++)
-                for (pred = 0; pred < 2; pred++) {
-                    FrameCode *ft = &nut->frame_code[start2];
-                    ft->flags      = FLAG_KEY * key_frame;
-                    ft->stream_id  = stream_id;
-                    ft->size_mul   = frame_bytes + 2;
-                    ft->size_lsb   = frame_bytes + pred;
-                    ft->pts_delta  = pts;
-                    ft->header_idx = find_header_idx(s, codec, frame_bytes + pred, key_frame);
-                    start2++;
-                }
-        } else {
-            FrameCode *ft = &nut->frame_code[start2];
-            ft->flags     = FLAG_KEY | FLAG_SIZE_MSB;
-            ft->stream_id = stream_id;
-            ft->size_mul  = 1;
-            ft->pts_delta = 1;
-            start2++;
-        }
-
-        if (codec->has_b_frames) {
-            pred_count    = 5;
-            pred_table[0] = -2;
-            pred_table[1] = -1;
-            pred_table[2] = 1;
-            pred_table[3] = 3;
-            pred_table[4] = 4;
-        } else if (codec->codec_id == AV_CODEC_ID_VORBIS) {
-            pred_count    = 3;
-            pred_table[0] = 2;
-            pred_table[1] = 9;
-            pred_table[2] = 16;
-        } else {
-            pred_count    = 1;
-            pred_table[0] = 1;
-        }
-
-        for (pred = 0; pred < pred_count; pred++) {
-            int start3 = start2 + (end2 - start2) * pred / pred_count;
-            int end3   = start2 + (end2 - start2) * (pred + 1) / pred_count;
-
-            for (index = start3; index < end3; index++) {
-                FrameCode *ft = &nut->frame_code[index];
-                ft->flags     = FLAG_KEY * key_frame;
-                ft->flags    |= FLAG_SIZE_MSB;
-                ft->stream_id = stream_id;
-//FIXME use single byte size and pred from last
-                ft->size_mul  = end3 - start3;
-                ft->size_lsb  = index - start3;
-                ft->pts_delta = pred_table[pred];
-                if (is_audio)
-                    ft->header_idx = find_header_idx(s, codec, -1, key_frame);
-            }
-        }
-    }
-    memmove(&nut->frame_code['N' + 1], &nut->frame_code['N'],
-            sizeof(FrameCode) * (255 - 'N'));
-    nut->frame_code[0].flags       =
-        nut->frame_code[255].flags =
-        nut->frame_code['N'].flags = FLAG_INVALID;
-}
-
-static void put_tt(NUTContext *nut, AVRational *time_base, AVIOContext *bc,
-                   uint64_t val)
-{
-    val *= nut->time_base_count;
-    val += time_base - nut->time_base;
-    ff_put_v(bc, val);
-}
-/**
- * Store a string as vb.
- */
-static void put_str(AVIOContext *bc, const char *string)
-{
-    int len = strlen(string);
-
-    ff_put_v(bc, len);
-    avio_write(bc, string, len);
-}
-
-static void put_s(AVIOContext *bc, int64_t val)
-{
-    ff_put_v(bc, 2 * FFABS(val) - (val > 0));
-}
-
-#ifdef TRACE
-static inline void ff_put_v_trace(AVIOContext *bc, uint64_t v, const char *file,
-                                  const char *func, int line)
-{
-    av_log(NULL, AV_LOG_DEBUG, "ff_put_v %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line);
-
-    ff_put_v(bc, v);
-}
-
-static inline void put_s_trace(AVIOContext *bc, int64_t v, const char *file,
-                               const char *func, int line)
-{
-    av_log(NULL, AV_LOG_DEBUG, "put_s %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line);
-
-    put_s(bc, v);
-}
-#define ff_put_v(bc, v)  ff_put_v_trace(bc, v, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define put_s(bc, v)  put_s_trace(bc, v, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#endif
-
-//FIXME remove calculate_checksum
-static void put_packet(NUTContext *nut, AVIOContext *bc, AVIOContext *dyn_bc,
-                       int calculate_checksum, uint64_t startcode)
-{
-    uint8_t *dyn_buf = NULL;
-    int dyn_size     = avio_close_dyn_buf(dyn_bc, &dyn_buf);
-    int forw_ptr     = dyn_size + 4 * calculate_checksum;
-
-    if (forw_ptr > 4096)
-        ffio_init_checksum(bc, ff_crc04C11DB7_update, 0);
-    avio_wb64(bc, startcode);
-    ff_put_v(bc, forw_ptr);
-    if (forw_ptr > 4096)
-        avio_wl32(bc, ffio_get_checksum(bc));
-
-    if (calculate_checksum)
-        ffio_init_checksum(bc, ff_crc04C11DB7_update, 0);
-    avio_write(bc, dyn_buf, dyn_size);
-    if (calculate_checksum)
-        avio_wl32(bc, ffio_get_checksum(bc));
-
-    av_free(dyn_buf);
-}
-
-static void write_mainheader(NUTContext *nut, AVIOContext *bc)
-{
-    int i, j, tmp_pts, tmp_flags, tmp_stream, tmp_mul, tmp_size, tmp_fields,
-        tmp_head_idx;
-    int64_t tmp_match;
-
-    ff_put_v(bc, NUT_VERSION);
-    ff_put_v(bc, nut->avf->nb_streams);
-    ff_put_v(bc, nut->max_distance);
-    ff_put_v(bc, nut->time_base_count);
-
-    for (i = 0; i < nut->time_base_count; i++) {
-        ff_put_v(bc, nut->time_base[i].num);
-        ff_put_v(bc, nut->time_base[i].den);
-    }
-
-    tmp_pts      = 0;
-    tmp_mul      = 1;
-    tmp_stream   = 0;
-    tmp_match    = 1 - (1LL << 62);
-    tmp_head_idx = 0;
-    for (i = 0; i < 256; ) {
-        tmp_fields = 0;
-        tmp_size   = 0;
-//        tmp_res=0;
-        if (tmp_pts != nut->frame_code[i].pts_delta)
-            tmp_fields = 1;
-        if (tmp_mul != nut->frame_code[i].size_mul)
-            tmp_fields = 2;
-        if (tmp_stream != nut->frame_code[i].stream_id)
-            tmp_fields = 3;
-        if (tmp_size != nut->frame_code[i].size_lsb)
-            tmp_fields = 4;
-//        if(tmp_res    != nut->frame_code[i].res            ) tmp_fields=5;
-        if (tmp_head_idx != nut->frame_code[i].header_idx)
-            tmp_fields = 8;
-
-        tmp_pts    = nut->frame_code[i].pts_delta;
-        tmp_flags  = nut->frame_code[i].flags;
-        tmp_stream = nut->frame_code[i].stream_id;
-        tmp_mul    = nut->frame_code[i].size_mul;
-        tmp_size   = nut->frame_code[i].size_lsb;
-//        tmp_res   = nut->frame_code[i].res;
-        tmp_head_idx = nut->frame_code[i].header_idx;
-
-        for (j = 0; i < 256; j++, i++) {
-            if (i == 'N') {
-                j--;
-                continue;
-            }
-            if (nut->frame_code[i].pts_delta  != tmp_pts      ||
-                nut->frame_code[i].flags      != tmp_flags    ||
-                nut->frame_code[i].stream_id  != tmp_stream   ||
-                nut->frame_code[i].size_mul   != tmp_mul      ||
-                nut->frame_code[i].size_lsb   != tmp_size + j ||
-//              nut->frame_code[i].res        != tmp_res      ||
-                nut->frame_code[i].header_idx != tmp_head_idx)
-                break;
-        }
-        if (j != tmp_mul - tmp_size)
-            tmp_fields = 6;
-
-        ff_put_v(bc, tmp_flags);
-        ff_put_v(bc, tmp_fields);
-        if (tmp_fields > 0)
-            put_s(bc, tmp_pts);
-        if (tmp_fields > 1)
-            ff_put_v(bc, tmp_mul);
-        if (tmp_fields > 2)
-            ff_put_v(bc, tmp_stream);
-        if (tmp_fields > 3)
-            ff_put_v(bc, tmp_size);
-        if (tmp_fields > 4)
-            ff_put_v(bc, 0 /*tmp_res*/);
-        if (tmp_fields > 5)
-            ff_put_v(bc, j);
-        if (tmp_fields > 6)
-            ff_put_v(bc, tmp_match);
-        if (tmp_fields > 7)
-            ff_put_v(bc, tmp_head_idx);
-    }
-    ff_put_v(bc, nut->header_count - 1);
-    for (i = 1; i < nut->header_count; i++) {
-        ff_put_v(bc, nut->header_len[i]);
-        avio_write(bc, nut->header[i], nut->header_len[i]);
-    }
-}
-
-static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc,
-                              AVStream *st, int i)
-{
-    NUTContext *nut       = avctx->priv_data;
-    AVCodecContext *codec = st->codec;
-    unsigned codec_tag    = av_codec_get_tag(ff_nut_codec_tags, codec->codec_id);
-
-    ff_put_v(bc, i);
-    switch (codec->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-        ff_put_v(bc, 0);
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        ff_put_v(bc, 1);
-        break;
-    case AVMEDIA_TYPE_SUBTITLE:
-        ff_put_v(bc, 2);
-        break;
-    default:
-        ff_put_v(bc, 3);
-        break;
-    }
-    ff_put_v(bc, 4);
-
-    if (!codec_tag || codec->codec_id == AV_CODEC_ID_RAWVIDEO)
-        codec_tag = codec->codec_tag;
-
-    if (codec_tag) {
-        avio_wl32(bc, codec_tag);
-    } else {
-        av_log(avctx, AV_LOG_ERROR, "No codec tag defined for stream %d\n", i);
-        return AVERROR(EINVAL);
-    }
-
-    ff_put_v(bc, nut->stream[i].time_base - nut->time_base);
-    ff_put_v(bc, nut->stream[i].msb_pts_shift);
-    ff_put_v(bc, nut->stream[i].max_pts_distance);
-    ff_put_v(bc, codec->has_b_frames);
-    avio_w8(bc, 0); /* flags: 0x1 - fixed_fps, 0x2 - index_present */
-
-    ff_put_v(bc, codec->extradata_size);
-    avio_write(bc, codec->extradata, codec->extradata_size);
-
-    switch (codec->codec_type) {
-    case AVMEDIA_TYPE_AUDIO:
-        ff_put_v(bc, codec->sample_rate);
-        ff_put_v(bc, 1);
-        ff_put_v(bc, codec->channels);
-        break;
-    case AVMEDIA_TYPE_VIDEO:
-        ff_put_v(bc, codec->width);
-        ff_put_v(bc, codec->height);
-
-        if (st->sample_aspect_ratio.num <= 0 ||
-            st->sample_aspect_ratio.den <= 0) {
-            ff_put_v(bc, 0);
-            ff_put_v(bc, 0);
-        } else {
-            ff_put_v(bc, st->sample_aspect_ratio.num);
-            ff_put_v(bc, st->sample_aspect_ratio.den);
-        }
-        ff_put_v(bc, 0); /* csp type -- unknown */
-        break;
-    default:
-        break;
-    }
-    return 0;
-}
-
-static int add_info(AVIOContext *bc, const char *type, const char *value)
-{
-    put_str(bc, type);
-    put_s(bc, -1);
-    put_str(bc, value);
-    return 1;
-}
-
-static int write_globalinfo(NUTContext *nut, AVIOContext *bc)
-{
-    AVFormatContext *s   = nut->avf;
-    AVDictionaryEntry *t = NULL;
-    AVIOContext *dyn_bc;
-    uint8_t *dyn_buf = NULL;
-    int count        = 0, dyn_size;
-    int ret          = avio_open_dyn_buf(&dyn_bc);
-    if (ret < 0)
-        return ret;
-
-    while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
-        count += add_info(dyn_bc, t->key, t->value);
-
-    ff_put_v(bc, 0); //stream_if_plus1
-    ff_put_v(bc, 0); //chapter_id
-    ff_put_v(bc, 0); //timestamp_start
-    ff_put_v(bc, 0); //length
-
-    ff_put_v(bc, count);
-
-    dyn_size = avio_close_dyn_buf(dyn_bc, &dyn_buf);
-    avio_write(bc, dyn_buf, dyn_size);
-    av_free(dyn_buf);
-    return 0;
-}
-
-static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id){
-    AVFormatContext *s= nut->avf;
-    AVStream* st = s->streams[stream_id];
-    AVIOContext *dyn_bc;
-    uint8_t *dyn_buf=NULL;
-    int count=0, dyn_size, i;
-    int ret = avio_open_dyn_buf(&dyn_bc);
-    if(ret < 0)
-        return ret;
-
-    for (i=0; ff_nut_dispositions[i].flag; ++i) {
-        if (st->disposition & ff_nut_dispositions[i].flag)
-            count += add_info(dyn_bc, "Disposition", ff_nut_dispositions[i].str);
-    }
-    dyn_size = avio_close_dyn_buf(dyn_bc, &dyn_buf);
-
-    if (count) {
-        ff_put_v(bc, stream_id + 1); //stream_id_plus1
-        ff_put_v(bc, 0); //chapter_id
-        ff_put_v(bc, 0); //timestamp_start
-        ff_put_v(bc, 0); //length
-
-        ff_put_v(bc, count);
-
-        avio_write(bc, dyn_buf, dyn_size);
-    }
-
-    av_free(dyn_buf);
-    return count;
-}
-
-static int write_chapter(NUTContext *nut, AVIOContext *bc, int id)
-{
-    AVIOContext *dyn_bc;
-    uint8_t *dyn_buf     = NULL;
-    AVDictionaryEntry *t = NULL;
-    AVChapter *ch        = nut->avf->chapters[id];
-    int ret, dyn_size, count = 0;
-
-    ret = avio_open_dyn_buf(&dyn_bc);
-    if (ret < 0)
-        return ret;
-
-    ff_put_v(bc, 0);                                        // stream_id_plus1
-    put_s(bc, id + 1);                                      // chapter_id
-    put_tt(nut, nut->chapter[id].time_base, bc, ch->start); // chapter_start
-    ff_put_v(bc, ch->end - ch->start);                      // chapter_len
-
-    while ((t = av_dict_get(ch->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
-        count += add_info(dyn_bc, t->key, t->value);
-
-    ff_put_v(bc, count);
-
-    dyn_size = avio_close_dyn_buf(dyn_bc, &dyn_buf);
-    avio_write(bc, dyn_buf, dyn_size);
-    av_freep(&dyn_buf);
-    return 0;
-}
-
-static int write_headers(AVFormatContext *avctx, AVIOContext *bc)
-{
-    NUTContext *nut = avctx->priv_data;
-    AVIOContext *dyn_bc;
-    int i, ret;
-
-    ff_metadata_conv_ctx(avctx, ff_nut_metadata_conv, NULL);
-
-    ret = avio_open_dyn_buf(&dyn_bc);
-    if (ret < 0)
-        return ret;
-    write_mainheader(nut, dyn_bc);
-    put_packet(nut, bc, dyn_bc, 1, MAIN_STARTCODE);
-
-    for (i = 0; i < nut->avf->nb_streams; i++) {
-        ret = avio_open_dyn_buf(&dyn_bc);
-        if (ret < 0)
-            return ret;
-        ret = write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i);
-        if (ret < 0)
-            return ret;
-        put_packet(nut, bc, dyn_bc, 1, STREAM_STARTCODE);
-    }
-
-    ret = avio_open_dyn_buf(&dyn_bc);
-    if (ret < 0)
-        return ret;
-    write_globalinfo(nut, dyn_bc);
-    put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE);
-
-    for (i = 0; i < nut->avf->nb_streams; i++) {
-        ret = avio_open_dyn_buf(&dyn_bc);
-        if (ret < 0)
-            return ret;
-        ret = write_streaminfo(nut, dyn_bc, i);
-        if (ret < 0)
-            return ret;
-        if (ret > 0)
-            put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE);
-        else {
-            uint8_t *buf;
-            avio_close_dyn_buf(dyn_bc, &buf);
-            av_free(buf);
-        }
-    }
-
-    for (i = 0; i < nut->avf->nb_chapters; i++) {
-        ret = avio_open_dyn_buf(&dyn_bc);
-        if (ret < 0)
-            return ret;
-        ret = write_chapter(nut, dyn_bc, i);
-        if (ret < 0) {
-            uint8_t *buf;
-            avio_close_dyn_buf(dyn_bc, &buf);
-            av_freep(&buf);
-            return ret;
-        }
-        put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE);
-    }
-
-    nut->last_syncpoint_pos = INT_MIN;
-    nut->header_count++;
-    return 0;
-}
-
-static int nut_write_header(AVFormatContext *s)
-{
-    NUTContext *nut = s->priv_data;
-    AVIOContext *bc = s->pb;
-    int i, j, ret;
-
-    nut->avf = s;
-
-    nut->stream = av_mallocz(sizeof(StreamContext) * s->nb_streams);
-    if (s->nb_chapters)
-        nut->chapter = av_mallocz(sizeof(ChapterContext) * s->nb_chapters);
-    nut->time_base = av_mallocz(sizeof(AVRational) * (s->nb_streams +
-                                                      s->nb_chapters));
-    if (!nut->stream || (s->nb_chapters && !nut->chapter) || !nut->time_base) {
-        av_freep(&nut->stream);
-        av_freep(&nut->chapter);
-        av_freep(&nut->time_base);
-        return AVERROR(ENOMEM);
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        int ssize;
-        AVRational time_base;
-        ff_parse_specific_params(st->codec, &time_base.den, &ssize,
-                                 &time_base.num);
-
-        avpriv_set_pts_info(st, 64, time_base.num, time_base.den);
-
-        for (j = 0; j < nut->time_base_count; j++)
-            if (!memcmp(&time_base, &nut->time_base[j], sizeof(AVRational))) {
-                break;
-            }
-        nut->time_base[j]        = time_base;
-        nut->stream[i].time_base = &nut->time_base[j];
-        if (j == nut->time_base_count)
-            nut->time_base_count++;
-
-        if (INT64_C(1000) * time_base.num >= time_base.den)
-            nut->stream[i].msb_pts_shift = 7;
-        else
-            nut->stream[i].msb_pts_shift = 14;
-        nut->stream[i].max_pts_distance =
-            FFMAX(time_base.den, time_base.num) / time_base.num;
-    }
-
-    for (i = 0; i < s->nb_chapters; i++) {
-        AVChapter *ch = s->chapters[i];
-
-        for (j = 0; j < nut->time_base_count; j++)
-            if (!memcmp(&ch->time_base, &nut->time_base[j], sizeof(AVRational)))
-                break;
-
-        nut->time_base[j]         = ch->time_base;
-        nut->chapter[i].time_base = &nut->time_base[j];
-        if (j == nut->time_base_count)
-            nut->time_base_count++;
-    }
-
-    nut->max_distance = MAX_DISTANCE;
-    build_elision_headers(s);
-    build_frame_code(s);
-    assert(nut->frame_code['N'].flags == FLAG_INVALID);
-
-    avio_write(bc, ID_STRING, strlen(ID_STRING));
-    avio_w8(bc, 0);
-
-    if ((ret = write_headers(s, bc)) < 0)
-        return ret;
-
-    avio_flush(bc);
-
-    //FIXME index
-
-    return 0;
-}
-
-static int get_needed_flags(NUTContext *nut, StreamContext *nus, FrameCode *fc,
-                            AVPacket *pkt)
-{
-    int flags = 0;
-
-    if (pkt->flags & AV_PKT_FLAG_KEY)
-        flags |= FLAG_KEY;
-    if (pkt->stream_index != fc->stream_id)
-        flags |= FLAG_STREAM_ID;
-    if (pkt->size / fc->size_mul)
-        flags |= FLAG_SIZE_MSB;
-    if (pkt->pts - nus->last_pts != fc->pts_delta)
-        flags |= FLAG_CODED_PTS;
-    if (pkt->size > 2 * nut->max_distance)
-        flags |= FLAG_CHECKSUM;
-    if (FFABS(pkt->pts - nus->last_pts) > nus->max_pts_distance)
-        flags |= FLAG_CHECKSUM;
-    if (pkt->size < nut->header_len[fc->header_idx] ||
-        (pkt->size > 4096 && fc->header_idx)        ||
-        memcmp(pkt->data, nut->header[fc->header_idx],
-               nut->header_len[fc->header_idx]))
-        flags |= FLAG_HEADER_IDX;
-
-    return flags | (fc->flags & FLAG_CODED);
-}
-
-static int find_best_header_idx(NUTContext *nut, AVPacket *pkt)
-{
-    int i;
-    int best_i   = 0;
-    int best_len = 0;
-
-    if (pkt->size > 4096)
-        return 0;
-
-    for (i = 1; i < nut->header_count; i++)
-        if (pkt->size >= nut->header_len[i]
-            && nut->header_len[i] > best_len
-            && !memcmp(pkt->data, nut->header[i], nut->header_len[i])) {
-            best_i   = i;
-            best_len = nut->header_len[i];
-        }
-    return best_i;
-}
-
-static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    NUTContext *nut    = s->priv_data;
-    StreamContext *nus = &nut->stream[pkt->stream_index];
-    AVIOContext *bc    = s->pb, *dyn_bc;
-    FrameCode *fc;
-    int64_t coded_pts;
-    int best_length, frame_code, flags, needed_flags, i, header_idx,
-        best_header_idx;
-    int key_frame = !!(pkt->flags & AV_PKT_FLAG_KEY);
-    int store_sp  = 0;
-    int ret;
-
-    if (pkt->pts < 0) {
-        av_log(s, AV_LOG_ERROR,
-               "Negative pts not supported stream %d, pts %"PRId64"\n",
-               pkt->stream_index, pkt->pts);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (1LL << (20 + 3 * nut->header_count) <= avio_tell(bc))
-        write_headers(s, bc);
-
-    if (key_frame && !(nus->last_flags & FLAG_KEY))
-        store_sp = 1;
-
-    if (pkt->size + 30 /*FIXME check*/ + avio_tell(bc) >=
-        nut->last_syncpoint_pos + nut->max_distance)
-        store_sp = 1;
-
-//FIXME: Ensure store_sp is 1 in the first place.
-
-    if (store_sp) {
-        Syncpoint *sp, dummy = { .pos = INT64_MAX };
-
-        ff_nut_reset_ts(nut, *nus->time_base, pkt->dts);
-        for (i = 0; i < s->nb_streams; i++) {
-            AVStream *st   = s->streams[i];
-            int64_t dts_tb = av_rescale_rnd(pkt->dts,
-                nus->time_base->num * (int64_t)nut->stream[i].time_base->den,
-                nus->time_base->den * (int64_t)nut->stream[i].time_base->num,
-                AV_ROUND_DOWN);
-            int index = av_index_search_timestamp(st, dts_tb,
-                                                  AVSEEK_FLAG_BACKWARD);
-            if (index >= 0)
-                dummy.pos = FFMIN(dummy.pos, st->index_entries[index].pos);
-        }
-        if (dummy.pos == INT64_MAX)
-            dummy.pos = 0;
-        sp = av_tree_find(nut->syncpoints, &dummy, (void *)ff_nut_sp_pos_cmp,
-                          NULL);
-
-        nut->last_syncpoint_pos = avio_tell(bc);
-        ret                     = avio_open_dyn_buf(&dyn_bc);
-        if (ret < 0)
-            return ret;
-        put_tt(nut, nus->time_base, dyn_bc, pkt->dts);
-        ff_put_v(dyn_bc, sp ? (nut->last_syncpoint_pos - sp->pos) >> 4 : 0);
-        put_packet(nut, bc, dyn_bc, 1, SYNCPOINT_STARTCODE);
-
-        if ((ret = ff_nut_add_sp(nut, nut->last_syncpoint_pos, 0 /*unused*/, pkt->dts)) < 0)
-            return ret;
-    }
-    assert(nus->last_pts != AV_NOPTS_VALUE);
-
-    coded_pts = pkt->pts & ((1 << nus->msb_pts_shift) - 1);
-    if (ff_lsb2full(nus, coded_pts) != pkt->pts)
-        coded_pts = pkt->pts + (1 << nus->msb_pts_shift);
-
-    best_header_idx = find_best_header_idx(nut, pkt);
-
-    best_length = INT_MAX;
-    frame_code  = -1;
-    for (i = 0; i < 256; i++) {
-        int length    = 0;
-        FrameCode *fc = &nut->frame_code[i];
-        int flags     = fc->flags;
-
-        if (flags & FLAG_INVALID)
-            continue;
-        needed_flags = get_needed_flags(nut, nus, fc, pkt);
-
-        if (flags & FLAG_CODED) {
-            length++;
-            flags = needed_flags;
-        }
-
-        if ((flags & needed_flags) != needed_flags)
-            continue;
-
-        if ((flags ^ needed_flags) & FLAG_KEY)
-            continue;
-
-        if (flags & FLAG_STREAM_ID)
-            length += ff_get_v_length(pkt->stream_index);
-
-        if (pkt->size % fc->size_mul != fc->size_lsb)
-            continue;
-        if (flags & FLAG_SIZE_MSB)
-            length += ff_get_v_length(pkt->size / fc->size_mul);
-
-        if (flags & FLAG_CHECKSUM)
-            length += 4;
-
-        if (flags & FLAG_CODED_PTS)
-            length += ff_get_v_length(coded_pts);
-
-        if ((flags & FLAG_CODED)
-            && nut->header_len[best_header_idx] >
-            nut->header_len[fc->header_idx] + 1) {
-            flags |= FLAG_HEADER_IDX;
-        }
-
-        if (flags & FLAG_HEADER_IDX) {
-            length += 1 - nut->header_len[best_header_idx];
-        } else {
-            length -= nut->header_len[fc->header_idx];
-        }
-
-        length *= 4;
-        length += !(flags & FLAG_CODED_PTS);
-        length += !(flags & FLAG_CHECKSUM);
-
-        if (length < best_length) {
-            best_length = length;
-            frame_code  = i;
-        }
-    }
-    assert(frame_code != -1);
-    fc           = &nut->frame_code[frame_code];
-    flags        = fc->flags;
-    needed_flags = get_needed_flags(nut, nus, fc, pkt);
-    header_idx   = fc->header_idx;
-
-    ffio_init_checksum(bc, ff_crc04C11DB7_update, 0);
-    avio_w8(bc, frame_code);
-    if (flags & FLAG_CODED) {
-        ff_put_v(bc, (flags ^ needed_flags) & ~(FLAG_CODED));
-        flags = needed_flags;
-    }
-    if (flags & FLAG_STREAM_ID)
-        ff_put_v(bc, pkt->stream_index);
-    if (flags & FLAG_CODED_PTS)
-        ff_put_v(bc, coded_pts);
-    if (flags & FLAG_SIZE_MSB)
-        ff_put_v(bc, pkt->size / fc->size_mul);
-    if (flags & FLAG_HEADER_IDX)
-        ff_put_v(bc, header_idx = best_header_idx);
-
-    if (flags & FLAG_CHECKSUM)
-        avio_wl32(bc, ffio_get_checksum(bc));
-    else
-        ffio_get_checksum(bc);
-
-    avio_write(bc, pkt->data + nut->header_len[header_idx],
-               pkt->size - nut->header_len[header_idx]);
-    nus->last_flags = flags;
-    nus->last_pts   = pkt->pts;
-
-    //FIXME just store one per syncpoint
-    if (flags & FLAG_KEY)
-        av_add_index_entry(
-            s->streams[pkt->stream_index],
-            nut->last_syncpoint_pos,
-            pkt->pts,
-            0,
-            0,
-            AVINDEX_KEYFRAME);
-
-    return 0;
-}
-
-static int nut_write_trailer(AVFormatContext *s)
-{
-    NUTContext *nut = s->priv_data;
-    AVIOContext *bc = s->pb;
-
-    while (nut->header_count < 3)
-        write_headers(s, bc);
-
-    ff_nut_free_sp(nut);
-    av_freep(&nut->stream);
-    av_freep(&nut->chapter);
-    av_freep(&nut->time_base);
-
-    return 0;
-}
-
-AVOutputFormat ff_nut_muxer = {
-    .name           = "nut",
-    .long_name      = NULL_IF_CONFIG_SMALL("NUT"),
-    .mime_type      = "video/x-nut",
-    .extensions     = "nut",
-    .priv_data_size = sizeof(NUTContext),
-    .audio_codec    = CONFIG_LIBVORBIS ? AV_CODEC_ID_VORBIS :
-                      CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_MP2,
-    .video_codec    = AV_CODEC_ID_MPEG4,
-    .write_header   = nut_write_header,
-    .write_packet   = nut_write_packet,
-    .write_trailer  = nut_write_trailer,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
-    .codec_tag      = ff_nut_codec_tags,
-};
diff --git a/deps/libav/libavformat/nuv.c b/deps/libav/libavformat/nuv.c
deleted file mode 100644
index 9336912..0000000
--- a/deps/libav/libavformat/nuv.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * NuppelVideo demuxer.
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "avformat.h"
-#include "internal.h"
-#include "riff.h"
-
-static const AVCodecTag nuv_audio_tags[] = {
-    { AV_CODEC_ID_PCM_S16LE, MKTAG('R', 'A', 'W', 'A') },
-    { AV_CODEC_ID_MP3,       MKTAG('L', 'A', 'M', 'E') },
-    { AV_CODEC_ID_NONE,      0 },
-};
-
-typedef struct {
-    int v_id;
-    int a_id;
-    int rtjpg_video;
-} NUVContext;
-
-typedef enum {
-    NUV_VIDEO     = 'V',
-    NUV_EXTRADATA = 'D',
-    NUV_AUDIO     = 'A',
-    NUV_SEEKP     = 'R',
-    NUV_MYTHEXT   = 'X'
-} nuv_frametype;
-
-static int nuv_probe(AVProbeData *p)
-{
-    if (!memcmp(p->buf, "NuppelVideo", 12))
-        return AVPROBE_SCORE_MAX;
-    if (!memcmp(p->buf, "MythTVVideo", 12))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-/// little macro to sanitize packet size
-#define PKTSIZE(s) (s &  0xffffff)
-
-/**
- * @brief read until we found all data needed for decoding
- * @param vst video stream of which to change parameters
- * @param ast video stream of which to change parameters
- * @param myth set if this is a MythTVVideo format file
- * @return 0 or AVERROR code
- */
-static int get_codec_data(AVIOContext *pb, AVStream *vst,
-                          AVStream *ast, int myth)
-{
-    nuv_frametype frametype;
-
-    if (!vst && !myth)
-        return 1; // no codec data needed
-    while (!pb->eof_reached) {
-        int size, subtype;
-
-        frametype = avio_r8(pb);
-        switch (frametype) {
-        case NUV_EXTRADATA:
-            subtype = avio_r8(pb);
-            avio_skip(pb, 6);
-            size = PKTSIZE(avio_rl32(pb));
-            if (vst && subtype == 'R') {
-                if (vst->codec->extradata) {
-                    av_freep(&vst->codec->extradata);
-                    vst->codec->extradata_size = 0;
-                }
-                vst->codec->extradata = av_malloc(size);
-                if (!vst->codec->extradata)
-                    return AVERROR(ENOMEM);
-                vst->codec->extradata_size = size;
-                avio_read(pb, vst->codec->extradata, size);
-                size = 0;
-                if (!myth)
-                    return 0;
-            }
-            break;
-        case NUV_MYTHEXT:
-            avio_skip(pb, 7);
-            size = PKTSIZE(avio_rl32(pb));
-            if (size != 128 * 4)
-                break;
-            avio_rl32(pb); // version
-            if (vst) {
-                vst->codec->codec_tag = avio_rl32(pb);
-                vst->codec->codec_id =
-                    ff_codec_get_id(ff_codec_bmp_tags, vst->codec->codec_tag);
-                if (vst->codec->codec_tag == MKTAG('R', 'J', 'P', 'G'))
-                    vst->codec->codec_id = AV_CODEC_ID_NUV;
-            } else
-                avio_skip(pb, 4);
-
-            if (ast) {
-                int id;
-
-                ast->codec->codec_tag             = avio_rl32(pb);
-                ast->codec->sample_rate           = avio_rl32(pb);
-                ast->codec->bits_per_coded_sample = avio_rl32(pb);
-                ast->codec->channels              = avio_rl32(pb);
-                ast->codec->channel_layout        = 0;
-
-                id = ff_wav_codec_get_id(ast->codec->codec_tag,
-                                         ast->codec->bits_per_coded_sample);
-                if (id == AV_CODEC_ID_NONE) {
-                    id = ff_codec_get_id(nuv_audio_tags, ast->codec->codec_tag);
-                    if (id == AV_CODEC_ID_PCM_S16LE)
-                        id = ff_get_pcm_codec_id(ast->codec->bits_per_coded_sample,
-                                                 0, 0, ~1);
-                }
-                ast->codec->codec_id = id;
-
-                ast->need_parsing = AVSTREAM_PARSE_FULL;
-            } else
-                avio_skip(pb, 4 * 4);
-
-            size -= 6 * 4;
-            avio_skip(pb, size);
-            return 0;
-        case NUV_SEEKP:
-            size = 11;
-            break;
-        default:
-            avio_skip(pb, 7);
-            size = PKTSIZE(avio_rl32(pb));
-            break;
-        }
-        avio_skip(pb, size);
-    }
-
-    return 0;
-}
-
-static int nuv_header(AVFormatContext *s)
-{
-    NUVContext *ctx = s->priv_data;
-    AVIOContext *pb = s->pb;
-    char id_string[12];
-    double aspect, fps;
-    int is_mythtv, width, height, v_packs, a_packs, ret;
-    AVStream *vst = NULL, *ast = NULL;
-
-    avio_read(pb, id_string, 12);
-    is_mythtv = !memcmp(id_string, "MythTVVideo", 12);
-    avio_skip(pb, 5);       // version string
-    avio_skip(pb, 3);       // padding
-    width  = avio_rl32(pb);
-    height = avio_rl32(pb);
-    avio_rl32(pb);          // unused, "desiredwidth"
-    avio_rl32(pb);          // unused, "desiredheight"
-    avio_r8(pb);            // 'P' == progressive, 'I' == interlaced
-    avio_skip(pb, 3);       // padding
-    aspect = av_int2double(avio_rl64(pb));
-    if (aspect > 0.9999 && aspect < 1.0001)
-        aspect = 4.0 / 3.0;
-    fps = av_int2double(avio_rl64(pb));
-
-    // number of packets per stream type, -1 means unknown, e.g. streaming
-    v_packs = avio_rl32(pb);
-    a_packs = avio_rl32(pb);
-    avio_rl32(pb); // text
-
-    avio_rl32(pb); // keyframe distance (?)
-
-    if (v_packs) {
-        vst = avformat_new_stream(s, NULL);
-        if (!vst)
-            return AVERROR(ENOMEM);
-        ctx->v_id = vst->index;
-
-        vst->codec->codec_type            = AVMEDIA_TYPE_VIDEO;
-        vst->codec->codec_id              = AV_CODEC_ID_NUV;
-        vst->codec->width                 = width;
-        vst->codec->height                = height;
-        vst->codec->bits_per_coded_sample = 10;
-        vst->sample_aspect_ratio          = av_d2q(aspect * height / width,
-                                                   10000);
-        vst->avg_frame_rate = av_d2q(fps, 60000);
-        avpriv_set_pts_info(vst, 32, 1, 1000);
-    } else
-        ctx->v_id = -1;
-
-    if (a_packs) {
-        ast = avformat_new_stream(s, NULL);
-        if (!ast)
-            return AVERROR(ENOMEM);
-        ctx->a_id = ast->index;
-
-        ast->codec->codec_type            = AVMEDIA_TYPE_AUDIO;
-        ast->codec->codec_id              = AV_CODEC_ID_PCM_S16LE;
-        ast->codec->channels              = 2;
-        ast->codec->channel_layout        = AV_CH_LAYOUT_STEREO;
-        ast->codec->sample_rate           = 44100;
-        ast->codec->bit_rate              = 2 * 2 * 44100 * 8;
-        ast->codec->block_align           = 2 * 2;
-        ast->codec->bits_per_coded_sample = 16;
-        avpriv_set_pts_info(ast, 32, 1, 1000);
-    } else
-        ctx->a_id = -1;
-
-    if ((ret = get_codec_data(pb, vst, ast, is_mythtv)) < 0)
-        return ret;
-
-    ctx->rtjpg_video = vst && vst->codec->codec_id == AV_CODEC_ID_NUV;
-
-    return 0;
-}
-
-#define HDRSIZE 12
-
-static int nuv_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    NUVContext *ctx = s->priv_data;
-    AVIOContext *pb = s->pb;
-    uint8_t hdr[HDRSIZE];
-    nuv_frametype frametype;
-    int ret, size;
-
-    while (!pb->eof_reached) {
-        int copyhdrsize = ctx->rtjpg_video ? HDRSIZE : 0;
-        uint64_t pos    = avio_tell(pb);
-
-        ret = avio_read(pb, hdr, HDRSIZE);
-        if (ret < HDRSIZE)
-            return ret < 0 ? ret : AVERROR(EIO);
-
-        frametype = hdr[0];
-        size      = PKTSIZE(AV_RL32(&hdr[8]));
-
-        switch (frametype) {
-        case NUV_EXTRADATA:
-            if (!ctx->rtjpg_video) {
-                avio_skip(pb, size);
-                break;
-            }
-        case NUV_VIDEO:
-            if (ctx->v_id < 0) {
-                av_log(s, AV_LOG_ERROR, "Video packet in file without video stream!\n");
-                avio_skip(pb, size);
-                break;
-            }
-            ret = av_new_packet(pkt, copyhdrsize + size);
-            if (ret < 0)
-                return ret;
-            // HACK: we have no idea if it is a keyframe,
-            // but if we mark none seeking will not work at all.
-            pkt->flags       |= AV_PKT_FLAG_KEY;
-            pkt->pos          = pos;
-            pkt->pts          = AV_RL32(&hdr[4]);
-            pkt->stream_index = ctx->v_id;
-            memcpy(pkt->data, hdr, copyhdrsize);
-            ret = avio_read(pb, pkt->data + copyhdrsize, size);
-            if (ret < 0) {
-                av_free_packet(pkt);
-                return ret;
-            }
-            if (ret < size)
-                av_shrink_packet(pkt, copyhdrsize + ret);
-            return 0;
-        case NUV_AUDIO:
-            if (ctx->a_id < 0) {
-                av_log(s, AV_LOG_ERROR, "Audio packet in file without audio stream!\n");
-                avio_skip(pb, size);
-                break;
-            }
-            ret               = av_get_packet(pb, pkt, size);
-            pkt->flags       |= AV_PKT_FLAG_KEY;
-            pkt->pos          = pos;
-            pkt->pts          = AV_RL32(&hdr[4]);
-            pkt->stream_index = ctx->a_id;
-            if (ret < 0)
-                return ret;
-            return 0;
-        case NUV_SEEKP:
-            // contains no data, size value is invalid
-            break;
-        default:
-            avio_skip(pb, size);
-            break;
-        }
-    }
-
-    return AVERROR(EIO);
-}
-
-AVInputFormat ff_nuv_demuxer = {
-    .name           = "nuv",
-    .long_name      = NULL_IF_CONFIG_SMALL("NuppelVideo"),
-    .priv_data_size = sizeof(NUVContext),
-    .read_probe     = nuv_probe,
-    .read_header    = nuv_header,
-    .read_packet    = nuv_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/oggdec.c b/deps/libav/libavformat/oggdec.c
deleted file mode 100644
index ae9da3a..0000000
--- a/deps/libav/libavformat/oggdec.c
+++ /dev/null
@@ -1,709 +0,0 @@
-/*
- * Ogg bitstream support
- * Luca Barbato <lu_zero at gentoo.org>
- * Based on tcvp implementation
- */
-
-/*
-    Copyright (C) 2005  Michael Ahlberg, Måns Rullgård
-
-    Permission is hereby granted, free of charge, to any person
-    obtaining a copy of this software and associated documentation
-    files (the "Software"), to deal in the Software without
-    restriction, including without limitation the rights to use, copy,
-    modify, merge, publish, distribute, sublicense, and/or sell copies
-    of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be
-    included in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS IN THE SOFTWARE.
- */
-
-
-#include <stdio.h>
-#include "oggdec.h"
-#include "avformat.h"
-#include "internal.h"
-#include "vorbiscomment.h"
-
-#define MAX_PAGE_SIZE 65307
-#define DECODER_BUFFER_SIZE MAX_PAGE_SIZE
-
-static const struct ogg_codec * const ogg_codecs[] = {
-    &ff_skeleton_codec,
-    &ff_dirac_codec,
-    &ff_speex_codec,
-    &ff_vorbis_codec,
-    &ff_theora_codec,
-    &ff_flac_codec,
-    &ff_celt_codec,
-    &ff_opus_codec,
-    &ff_old_dirac_codec,
-    &ff_old_flac_codec,
-    &ff_ogm_video_codec,
-    &ff_ogm_audio_codec,
-    &ff_ogm_text_codec,
-    &ff_ogm_old_codec,
-    NULL
-};
-
-//FIXME We could avoid some structure duplication
-static int ogg_save(AVFormatContext *s)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_state *ost =
-        av_malloc(sizeof(*ost) + (ogg->nstreams - 1) * sizeof(*ogg->streams));
-    int i;
-    ost->pos      = avio_tell(s->pb);
-    ost->curidx   = ogg->curidx;
-    ost->next     = ogg->state;
-    ost->nstreams = ogg->nstreams;
-    memcpy(ost->streams, ogg->streams, ogg->nstreams * sizeof(*ogg->streams));
-
-    for (i = 0; i < ogg->nstreams; i++) {
-        struct ogg_stream *os = ogg->streams + i;
-        os->buf = av_mallocz(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
-        memcpy(os->buf, ost->streams[i].buf, os->bufpos);
-    }
-
-    ogg->state = ost;
-
-    return 0;
-}
-
-static int ogg_restore(AVFormatContext *s, int discard)
-{
-    struct ogg *ogg = s->priv_data;
-    AVIOContext *bc = s->pb;
-    struct ogg_state *ost = ogg->state;
-    int i, err;
-
-    if (!ost)
-        return 0;
-
-    ogg->state = ost->next;
-
-    if (!discard) {
-
-        for (i = 0; i < ogg->nstreams; i++)
-            av_free(ogg->streams[i].buf);
-
-        avio_seek(bc, ost->pos, SEEK_SET);
-        ogg->curidx   = ost->curidx;
-        ogg->nstreams = ost->nstreams;
-        if ((err = av_reallocp_array(&ogg->streams, ogg->nstreams,
-                                     sizeof(*ogg->streams))) < 0) {
-            ogg->nstreams = 0;
-            return err;
-        } else
-            memcpy(ogg->streams, ost->streams,
-                   ost->nstreams * sizeof(*ogg->streams));
-    }
-
-    av_free(ost);
-
-    return 0;
-}
-
-static int ogg_reset(struct ogg *ogg)
-{
-    int i;
-
-    for (i = 0; i < ogg->nstreams; i++) {
-        struct ogg_stream *os = ogg->streams + i;
-        os->bufpos     = 0;
-        os->pstart     = 0;
-        os->psize      = 0;
-        os->granule    = -1;
-        os->lastpts    = AV_NOPTS_VALUE;
-        os->lastdts    = AV_NOPTS_VALUE;
-        os->sync_pos   = -1;
-        os->page_pos   = 0;
-        os->nsegs      = 0;
-        os->segp       = 0;
-        os->incomplete = 0;
-    }
-
-    ogg->curidx = -1;
-
-    return 0;
-}
-
-static const struct ogg_codec *ogg_find_codec(uint8_t *buf, int size)
-{
-    int i;
-
-    for (i = 0; ogg_codecs[i]; i++)
-        if (size >= ogg_codecs[i]->magicsize &&
-            !memcmp(buf, ogg_codecs[i]->magic, ogg_codecs[i]->magicsize))
-            return ogg_codecs[i];
-
-    return NULL;
-}
-
-static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream)
-{
-    struct ogg *ogg = s->priv_data;
-    int idx         = ogg->nstreams++;
-    AVStream *st;
-    struct ogg_stream *os;
-
-    os = av_realloc(ogg->streams, ogg->nstreams * sizeof(*ogg->streams));
-
-    if (!os)
-        return AVERROR(ENOMEM);
-
-    ogg->streams = os;
-
-    memset(ogg->streams + idx, 0, sizeof(*ogg->streams));
-
-    os                = ogg->streams + idx;
-    os->serial        = serial;
-    os->bufsize       = DECODER_BUFFER_SIZE;
-    os->buf           = av_malloc(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
-    os->header        = -1;
-    os->start_granule = OGG_NOGRANULE_VALUE;
-
-    if (new_avstream) {
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-
-        st->id = idx;
-        avpriv_set_pts_info(st, 64, 1, 1000000);
-    }
-
-    return idx;
-}
-
-static int ogg_new_buf(struct ogg *ogg, int idx)
-{
-    struct ogg_stream *os = ogg->streams + idx;
-    uint8_t *nb = av_malloc(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
-    int size = os->bufpos - os->pstart;
-
-    if (os->buf) {
-        memcpy(nb, os->buf + os->pstart, size);
-        av_free(os->buf);
-    }
-
-    os->buf    = nb;
-    os->bufpos = size;
-    os->pstart = 0;
-
-    return 0;
-}
-
-static int ogg_read_page(AVFormatContext *s, int *str)
-{
-    AVIOContext *bc = s->pb;
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os;
-    int ret, i = 0;
-    int flags, nsegs;
-    uint64_t gp;
-    uint32_t serial;
-    int size, idx;
-    uint8_t sync[4];
-    int sp = 0;
-
-    ret = avio_read(bc, sync, 4);
-    if (ret < 4)
-        return ret < 0 ? ret : AVERROR_EOF;
-
-    do {
-        int c;
-
-        if (sync[sp & 3] == 'O' &&
-            sync[(sp + 1) & 3] == 'g' &&
-            sync[(sp + 2) & 3] == 'g' && sync[(sp + 3) & 3] == 'S')
-            break;
-
-        c = avio_r8(bc);
-
-        if (bc->eof_reached)
-            return AVERROR_EOF;
-
-        sync[sp++ & 3] = c;
-    } while (i++ < MAX_PAGE_SIZE);
-
-    if (i >= MAX_PAGE_SIZE) {
-        av_log(s, AV_LOG_INFO, "cannot find sync word\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (avio_r8(bc) != 0)      /* version */
-        return AVERROR_INVALIDDATA;
-
-    flags  = avio_r8(bc);
-    gp     = avio_rl64(bc);
-    serial = avio_rl32(bc);
-    avio_skip(bc, 8); /* seq, crc */
-    nsegs  = avio_r8(bc);
-
-    idx = ogg_find_stream(ogg, serial);
-    if (idx < 0) {
-        if (ogg->headers) {
-            int n;
-
-            for (n = 0; n < ogg->nstreams; n++) {
-                av_freep(&ogg->streams[n].buf);
-                if (!ogg->state ||
-                    ogg->state->streams[n].private != ogg->streams[n].private)
-                    av_freep(&ogg->streams[n].private);
-            }
-
-            ogg->curidx   = -1;
-            ogg->nstreams = 0;
-
-            idx = ogg_new_stream(s, serial, 0);
-        } else {
-            idx = ogg_new_stream(s, serial, 1);
-        }
-        if (idx < 0)
-            return idx;
-    }
-
-    os = ogg->streams + idx;
-    os->page_pos = avio_tell(bc) - 27;
-
-    if (os->psize > 0)
-        ogg_new_buf(ogg, idx);
-
-    ret = avio_read(bc, os->segments, nsegs);
-    if (ret < nsegs)
-        return ret < 0 ? ret : AVERROR_EOF;
-
-    os->nsegs = nsegs;
-    os->segp  = 0;
-
-    size = 0;
-    for (i = 0; i < nsegs; i++)
-        size += os->segments[i];
-
-    if (flags & OGG_FLAG_CONT || os->incomplete) {
-        if (!os->psize) {
-            while (os->segp < os->nsegs) {
-                int seg = os->segments[os->segp++];
-                os->pstart += seg;
-                if (seg < 255)
-                    break;
-            }
-            os->sync_pos = os->page_pos;
-        }
-    } else {
-        os->psize    = 0;
-        os->sync_pos = os->page_pos;
-    }
-
-    if (os->bufsize - os->bufpos < size) {
-        uint8_t *nb = av_malloc((os->bufsize *= 2) + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!nb)
-            return AVERROR(ENOMEM);
-        memcpy(nb, os->buf, os->bufpos);
-        av_free(os->buf);
-        os->buf = nb;
-    }
-
-    ret = avio_read(bc, os->buf + os->bufpos, size);
-    if (ret < size)
-        return ret < 0 ? ret : AVERROR_EOF;
-
-    os->bufpos += size;
-    os->granule = gp;
-    os->flags   = flags;
-
-    memset(os->buf + os->bufpos, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    if (str)
-        *str = idx;
-
-    return 0;
-}
-
-static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
-                      int64_t *fpos)
-{
-    struct ogg *ogg = s->priv_data;
-    int idx, i, ret;
-    struct ogg_stream *os;
-    int complete = 0;
-    int segp     = 0, psize = 0;
-
-    av_dlog(s, "ogg_packet: curidx=%i\n", ogg->curidx);
-
-    do {
-        idx = ogg->curidx;
-
-        while (idx < 0) {
-            ret = ogg_read_page(s, &idx);
-            if (ret < 0)
-                return ret;
-        }
-
-        os = ogg->streams + idx;
-
-        av_dlog(s, "ogg_packet: idx=%d pstart=%d psize=%d segp=%d nsegs=%d\n",
-                idx, os->pstart, os->psize, os->segp, os->nsegs);
-
-        if (!os->codec) {
-            if (os->header < 0) {
-                os->codec = ogg_find_codec(os->buf, os->bufpos);
-                if (!os->codec) {
-                    av_log(s, AV_LOG_WARNING, "Codec not found\n");
-                    os->header = 0;
-                    return 0;
-                }
-            } else {
-                return 0;
-            }
-        }
-
-        segp  = os->segp;
-        psize = os->psize;
-
-        while (os->segp < os->nsegs) {
-            int ss = os->segments[os->segp++];
-            os->psize += ss;
-            if (ss < 255) {
-                complete = 1;
-                break;
-            }
-        }
-
-        if (!complete && os->segp == os->nsegs) {
-            ogg->curidx    = -1;
-            // Do not set incomplete for empty packets.
-            // Together with the code in ogg_read_page
-            // that discards all continuation of empty packets
-            // we would get an infinite loop.
-            os->incomplete = !!os->psize;
-        }
-    } while (!complete);
-
-    av_dlog(s, "ogg_packet: idx %i, frame size %i, start %i\n",
-            idx, os->psize, os->pstart);
-
-    if (os->granule == -1)
-        av_log(s, AV_LOG_WARNING,
-               "Page at %"PRId64" is missing granule\n",
-               os->page_pos);
-
-    ogg->curidx    = idx;
-    os->incomplete = 0;
-
-    if (os->header) {
-        os->header = os->codec->header(s, idx);
-        if (!os->header) {
-            os->segp  = segp;
-            os->psize = psize;
-
-            // We have reached the first non-header packet in this stream.
-            // Unfortunately more header packets may still follow for others,
-            // but if we continue with header parsing we may lose data packets.
-            ogg->headers = 1;
-
-            // Update the header state for all streams and
-            // compute the data_offset.
-            if (!s->data_offset)
-                s->data_offset = os->sync_pos;
-
-            for (i = 0; i < ogg->nstreams; i++) {
-                struct ogg_stream *cur_os = ogg->streams + i;
-
-                // if we have a partial non-header packet, its start is
-                // obviously at or after the data start
-                if (cur_os->incomplete)
-                    s->data_offset = FFMIN(s->data_offset, cur_os->sync_pos);
-            }
-        } else {
-            os->nb_header++;
-            os->pstart += os->psize;
-            os->psize   = 0;
-        }
-    } else {
-        os->pflags    = 0;
-        os->pduration = 0;
-        if (os->codec && os->codec->packet)
-            os->codec->packet(s, idx);
-        if (str)
-            *str = idx;
-        if (dstart)
-            *dstart = os->pstart;
-        if (dsize)
-            *dsize = os->psize;
-        if (fpos)
-            *fpos = os->sync_pos;
-        os->pstart  += os->psize;
-        os->psize    = 0;
-        os->sync_pos = os->page_pos;
-    }
-
-    // determine whether there are more complete packets in this page
-    // if not, the page's granule will apply to this packet
-    os->page_end = 1;
-    for (i = os->segp; i < os->nsegs; i++)
-        if (os->segments[i] < 255) {
-            os->page_end = 0;
-            break;
-        }
-
-    if (os->segp == os->nsegs)
-        ogg->curidx = -1;
-
-    return 0;
-}
-
-static int ogg_get_headers(AVFormatContext *s)
-{
-    struct ogg *ogg = s->priv_data;
-    int ret, i;
-
-    do {
-        ret = ogg_packet(s, NULL, NULL, NULL, NULL);
-        if (ret < 0)
-            return ret;
-    } while (!ogg->headers);
-
-    for (i = 0; i < ogg->nstreams; i++) {
-        struct ogg_stream *os = ogg->streams + i;
-
-        if (os->codec && os->codec->nb_header &&
-            os->nb_header < os->codec->nb_header) {
-            av_log(s, AV_LOG_ERROR,
-                   "Headers mismatch for stream %d: "
-                   "expected %d received %d.\n",
-                   i, os->codec->nb_header, os->nb_header);
-            if (s->error_recognition & AV_EF_EXPLODE)
-                return AVERROR_INVALIDDATA;
-        }
-        if (os->start_granule != OGG_NOGRANULE_VALUE)
-            os->lastpts = s->streams[i]->start_time =
-                ogg_gptopts(s, i, os->start_granule, NULL);
-    }
-    av_dlog(s, "found headers\n");
-
-    return 0;
-}
-
-static int ogg_get_length(AVFormatContext *s)
-{
-    struct ogg *ogg = s->priv_data;
-    int i;
-    int64_t size, end;
-
-    if (!s->pb->seekable)
-        return 0;
-
-// already set
-    if (s->duration != AV_NOPTS_VALUE)
-        return 0;
-
-    size = avio_size(s->pb);
-    if (size < 0)
-        return 0;
-    end = size > MAX_PAGE_SIZE ? size - MAX_PAGE_SIZE : 0;
-
-    ogg_save(s);
-    avio_seek(s->pb, end, SEEK_SET);
-
-    while (!ogg_read_page(s, &i)) {
-        if (ogg->streams[i].granule != -1 && ogg->streams[i].granule != 0 &&
-            ogg->streams[i].codec) {
-            s->streams[i]->duration =
-                ogg_gptopts(s, i, ogg->streams[i].granule, NULL);
-            if (s->streams[i]->start_time != AV_NOPTS_VALUE)
-                s->streams[i]->duration -= s->streams[i]->start_time;
-        }
-    }
-
-    ogg_restore(s, 0);
-
-    return 0;
-}
-
-static int ogg_read_close(AVFormatContext *s)
-{
-    struct ogg *ogg = s->priv_data;
-    int i;
-
-    for (i = 0; i < ogg->nstreams; i++) {
-        av_free(ogg->streams[i].buf);
-        if (ogg->streams[i].codec &&
-            ogg->streams[i].codec->cleanup) {
-            ogg->streams[i].codec->cleanup(s, i);
-        }
-        av_free(ogg->streams[i].private);
-    }
-    av_free(ogg->streams);
-    return 0;
-}
-
-static int ogg_read_header(AVFormatContext *s)
-{
-    struct ogg *ogg = s->priv_data;
-    int ret, i;
-    ogg->curidx = -1;
-    //linear headers seek from start
-    ret = ogg_get_headers(s);
-    if (ret < 0) {
-        ogg_read_close(s);
-        return ret;
-    }
-
-    for (i = 0; i < ogg->nstreams; i++)
-        if (ogg->streams[i].header < 0)
-            ogg->streams[i].codec = NULL;
-
-    //linear granulepos seek from end
-    ogg_get_length(s);
-
-    //fill the extradata in the per codec callbacks
-    return 0;
-}
-
-static int64_t ogg_calc_pts(AVFormatContext *s, int idx, int64_t *dts)
-{
-    struct ogg *ogg       = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    int64_t pts           = AV_NOPTS_VALUE;
-
-    if (dts)
-        *dts = AV_NOPTS_VALUE;
-
-    if (os->lastpts != AV_NOPTS_VALUE) {
-        pts         = os->lastpts;
-        os->lastpts = AV_NOPTS_VALUE;
-    }
-    if (os->lastdts != AV_NOPTS_VALUE) {
-        if (dts)
-            *dts = os->lastdts;
-        os->lastdts = AV_NOPTS_VALUE;
-    }
-    if (os->page_end) {
-        if (os->granule != -1LL) {
-            if (os->codec && os->codec->granule_is_start)
-                pts = ogg_gptopts(s, idx, os->granule, dts);
-            else
-                os->lastpts = ogg_gptopts(s, idx, os->granule, &os->lastdts);
-            os->granule = -1LL;
-        }
-    }
-    return pts;
-}
-
-static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    struct ogg *ogg;
-    struct ogg_stream *os;
-    int idx = -1, ret;
-    int pstart, psize;
-    int64_t fpos, pts, dts;
-
-    //Get an ogg packet
-retry:
-    do {
-        ret = ogg_packet(s, &idx, &pstart, &psize, &fpos);
-        if (ret < 0)
-            return ret;
-    } while (idx < 0 || !s->streams[idx]);
-
-    ogg = s->priv_data;
-    os  = ogg->streams + idx;
-
-    // pflags might not be set until after this
-    pts = ogg_calc_pts(s, idx, &dts);
-
-    if (os->keyframe_seek && !(os->pflags & AV_PKT_FLAG_KEY))
-        goto retry;
-    os->keyframe_seek = 0;
-
-    //Alloc a pkt
-    ret = av_new_packet(pkt, psize);
-    if (ret < 0)
-        return ret;
-    pkt->stream_index = idx;
-    memcpy(pkt->data, os->buf + pstart, psize);
-
-    pkt->pts      = pts;
-    pkt->dts      = dts;
-    pkt->flags    = os->pflags;
-    pkt->duration = os->pduration;
-    pkt->pos      = fpos;
-
-    return psize;
-}
-
-static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
-                                  int64_t *pos_arg, int64_t pos_limit)
-{
-    struct ogg *ogg = s->priv_data;
-    AVIOContext *bc = s->pb;
-    int64_t pts     = AV_NOPTS_VALUE;
-    int i           = -1;
-    avio_seek(bc, *pos_arg, SEEK_SET);
-    ogg_reset(ogg);
-
-    while (avio_tell(bc) < pos_limit &&
-           !ogg_packet(s, &i, NULL, NULL, pos_arg)) {
-        if (i == stream_index) {
-            struct ogg_stream *os = ogg->streams + stream_index;
-            pts = ogg_calc_pts(s, i, NULL);
-            if (os->keyframe_seek && !(os->pflags & AV_PKT_FLAG_KEY))
-                pts = AV_NOPTS_VALUE;
-        }
-        if (pts != AV_NOPTS_VALUE)
-            break;
-    }
-    ogg_reset(ogg);
-    return pts;
-}
-
-static int ogg_read_seek(AVFormatContext *s, int stream_index,
-                         int64_t timestamp, int flags)
-{
-    struct ogg *ogg       = s->priv_data;
-    struct ogg_stream *os = ogg->streams + stream_index;
-    int ret;
-
-    // Try seeking to a keyframe first. If this fails (very possible),
-    // av_seek_frame will fall back to ignoring keyframes
-    if (s->streams[stream_index]->codec->codec_type == AVMEDIA_TYPE_VIDEO
-        && !(flags & AVSEEK_FLAG_ANY))
-        os->keyframe_seek = 1;
-
-    ret = ff_seek_frame_binary(s, stream_index, timestamp, flags);
-    os  = ogg->streams + stream_index;
-    if (ret < 0)
-        os->keyframe_seek = 0;
-    return ret;
-}
-
-static int ogg_probe(AVProbeData *p)
-{
-    if (!memcmp("OggS", p->buf, 5) && p->buf[5] <= 0x7)
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-AVInputFormat ff_ogg_demuxer = {
-    .name           = "ogg",
-    .long_name      = NULL_IF_CONFIG_SMALL("Ogg"),
-    .priv_data_size = sizeof(struct ogg),
-    .read_probe     = ogg_probe,
-    .read_header    = ogg_read_header,
-    .read_packet    = ogg_read_packet,
-    .read_close     = ogg_read_close,
-    .read_seek      = ogg_read_seek,
-    .read_timestamp = ogg_read_timestamp,
-    .extensions     = "ogg",
-    .flags          = AVFMT_GENERIC_INDEX | AVFMT_NOBINSEARCH,
-};
diff --git a/deps/libav/libavformat/oggdec.h b/deps/libav/libavformat/oggdec.h
deleted file mode 100644
index 918378d..0000000
--- a/deps/libav/libavformat/oggdec.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
-    Copyright (C) 2005  Michael Ahlberg, Måns Rullgård
-
-    Permission is hereby granted, free of charge, to any person
-    obtaining a copy of this software and associated documentation
-    files (the "Software"), to deal in the Software without
-    restriction, including without limitation the rights to use, copy,
-    modify, merge, publish, distribute, sublicense, and/or sell copies
-    of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be
-    included in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS IN THE SOFTWARE.
-**/
-
-#ifndef AVFORMAT_OGGDEC_H
-#define AVFORMAT_OGGDEC_H
-
-#include "avformat.h"
-#include "metadata.h"
-
-struct ogg_codec {
-    const int8_t *magic;
-    uint8_t magicsize;
-    const int8_t *name;
-    /**
-     * Attempt to process a packet as a header
-     * @return 1 if the packet was a valid header,
-     *         0 if the packet was not a header (was a data packet)
-     *         -1 if an error occurred or for unsupported stream
-     */
-    int (*header)(AVFormatContext *, int);
-    int (*packet)(AVFormatContext *, int);
-    /**
-     * Translate a granule into a timestamp.
-     * Will set dts if non-null and known.
-     * @return pts
-     */
-    uint64_t (*gptopts)(AVFormatContext *, int, uint64_t, int64_t *dts);
-    /**
-     * 1 if granule is the start time of the associated packet.
-     * 0 if granule is the end time of the associated packet.
-     */
-    int granule_is_start;
-    /**
-     * Number of expected headers
-     */
-    int nb_header;
-    void (*cleanup)(AVFormatContext *s, int idx);
-};
-
-struct ogg_stream {
-    uint8_t *buf;
-    unsigned int bufsize;
-    unsigned int bufpos;
-    unsigned int pstart;
-    unsigned int psize;
-    unsigned int pflags;
-    unsigned int pduration;
-    uint32_t serial;
-    uint64_t granule;
-    uint64_t start_granule;
-    int64_t lastpts;
-    int64_t lastdts;
-    int64_t sync_pos;   ///< file offset of the first page needed to reconstruct the current packet
-    int64_t page_pos;   ///< file offset of the current page
-    int flags;
-    const struct ogg_codec *codec;
-    int header;
-    int nsegs, segp;
-    uint8_t segments[255];
-    int incomplete; ///< whether we're expecting a continuation in the next page
-    int page_end;   ///< current packet is the last one completed in the page
-    int keyframe_seek;
-    int nb_header; ///< set to the number of parsed headers
-    void *private;
-};
-
-struct ogg_state {
-    uint64_t pos;
-    int curidx;
-    struct ogg_state *next;
-    int nstreams;
-    struct ogg_stream streams[1];
-};
-
-struct ogg {
-    struct ogg_stream *streams;
-    int nstreams;
-    int headers;
-    int curidx;
-    struct ogg_state *state;
-};
-
-#define OGG_FLAG_CONT 1
-#define OGG_FLAG_BOS  2
-#define OGG_FLAG_EOS  4
-
-#define OGG_NOGRANULE_VALUE -1ull
-
-extern const struct ogg_codec ff_celt_codec;
-extern const struct ogg_codec ff_dirac_codec;
-extern const struct ogg_codec ff_flac_codec;
-extern const struct ogg_codec ff_ogm_audio_codec;
-extern const struct ogg_codec ff_ogm_old_codec;
-extern const struct ogg_codec ff_ogm_text_codec;
-extern const struct ogg_codec ff_ogm_video_codec;
-extern const struct ogg_codec ff_old_dirac_codec;
-extern const struct ogg_codec ff_old_flac_codec;
-extern const struct ogg_codec ff_opus_codec;
-extern const struct ogg_codec ff_skeleton_codec;
-extern const struct ogg_codec ff_speex_codec;
-extern const struct ogg_codec ff_theora_codec;
-extern const struct ogg_codec ff_vorbis_codec;
-
-int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m, const uint8_t *buf, int size);
-
-static inline int
-ogg_find_stream (struct ogg * ogg, int serial)
-{
-    int i;
-
-    for (i = 0; i < ogg->nstreams; i++)
-        if (ogg->streams[i].serial == serial)
-            return i;
-
-    return -1;
-}
-
-static inline uint64_t
-ogg_gptopts (AVFormatContext * s, int i, uint64_t gp, int64_t *dts)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + i;
-    uint64_t pts = AV_NOPTS_VALUE;
-
-    if(os->codec && os->codec->gptopts){
-        pts = os->codec->gptopts(s, i, gp, dts);
-    } else {
-        pts = gp;
-        if (dts)
-            *dts = pts;
-    }
-
-    return pts;
-}
-
-#endif /* AVFORMAT_OGGDEC_H */
diff --git a/deps/libav/libavformat/oggenc.c b/deps/libav/libavformat/oggenc.c
deleted file mode 100644
index fd102c8..0000000
--- a/deps/libav/libavformat/oggenc.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- * Ogg muxer
- * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at free dot fr>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/crc.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/random_seed.h"
-#include "libavcodec/xiph.h"
-#include "libavcodec/bytestream.h"
-#include "libavcodec/flac.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "vorbiscomment.h"
-
-#define MAX_PAGE_SIZE 65025
-
-typedef struct {
-    int64_t start_granule;
-    int64_t granule;
-    int stream_index;
-    uint8_t flags;
-    uint8_t segments_count;
-    uint8_t segments[255];
-    uint8_t data[MAX_PAGE_SIZE];
-    uint16_t size;
-} OGGPage;
-
-typedef struct {
-    unsigned page_counter;
-    uint8_t *header[3];
-    int header_len[3];
-    /** for theora granule */
-    int kfgshift;
-    int64_t last_kf_pts;
-    int vrev;
-    int eos;
-    unsigned page_count; ///< number of page buffered
-    OGGPage page; ///< current page
-    unsigned serial_num; ///< serial number
-    int64_t last_granule; ///< last packet granule
-} OGGStreamContext;
-
-typedef struct OGGPageList {
-    OGGPage page;
-    struct OGGPageList *next;
-} OGGPageList;
-
-typedef struct {
-    const AVClass *class;
-    OGGPageList *page_list;
-    int pref_size; ///< preferred page size (0 => fill all segments)
-    int64_t pref_duration;      ///< preferred page duration (0 => fill all segments)
-} OGGContext;
-
-#define OFFSET(x) offsetof(OGGContext, x)
-#define PARAM AV_OPT_FLAG_ENCODING_PARAM
-
-static const AVOption options[] = {
-    { "pagesize", "preferred page size in bytes (deprecated)",
-        OFFSET(pref_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_PAGE_SIZE, PARAM },
-    { "page_duration", "preferred page duration, in microseconds",
-        OFFSET(pref_duration), AV_OPT_TYPE_INT, { .i64 = 1000000 }, 0, INT64_MAX, PARAM },
-    { NULL },
-};
-
-static const AVClass ogg_muxer_class = {
-    .class_name = "Ogg muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-
-static void ogg_update_checksum(AVFormatContext *s, AVIOContext *pb, int64_t crc_offset)
-{
-    int64_t pos = avio_tell(pb);
-    uint32_t checksum = ffio_get_checksum(pb);
-    avio_seek(pb, crc_offset, SEEK_SET);
-    avio_wb32(pb, checksum);
-    avio_seek(pb, pos, SEEK_SET);
-}
-
-static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags)
-{
-    OGGStreamContext *oggstream = s->streams[page->stream_index]->priv_data;
-    AVIOContext *pb;
-    int64_t crc_offset;
-    int ret, size;
-    uint8_t *buf;
-
-    ret = avio_open_dyn_buf(&pb);
-    if (ret < 0)
-        return ret;
-    ffio_init_checksum(pb, ff_crc04C11DB7_update, 0);
-    ffio_wfourcc(pb, "OggS");
-    avio_w8(pb, 0);
-    avio_w8(pb, page->flags | extra_flags);
-    avio_wl64(pb, page->granule);
-    avio_wl32(pb, oggstream->serial_num);
-    avio_wl32(pb, oggstream->page_counter++);
-    crc_offset = avio_tell(pb);
-    avio_wl32(pb, 0); // crc
-    avio_w8(pb, page->segments_count);
-    avio_write(pb, page->segments, page->segments_count);
-    avio_write(pb, page->data, page->size);
-
-    ogg_update_checksum(s, pb, crc_offset);
-    avio_flush(pb);
-
-    size = avio_close_dyn_buf(pb, &buf);
-    if (size < 0)
-        return size;
-
-    avio_write(s->pb, buf, size);
-    avio_flush(s->pb);
-    av_free(buf);
-    oggstream->page_count--;
-    return 0;
-}
-
-static int64_t ogg_granule_to_timestamp(OGGStreamContext *oggstream, int64_t granule)
-{
-    if (oggstream->kfgshift)
-        return (granule>>oggstream->kfgshift) +
-            (granule & ((1<<oggstream->kfgshift)-1));
-    else
-        return granule;
-}
-
-static int ogg_compare_granule(AVFormatContext *s, OGGPage *next, OGGPage *page)
-{
-    AVStream *st2 = s->streams[next->stream_index];
-    AVStream *st  = s->streams[page->stream_index];
-    int64_t next_granule, cur_granule;
-
-    if (next->granule == -1 || page->granule == -1)
-        return 0;
-
-    next_granule = av_rescale_q(ogg_granule_to_timestamp(st2->priv_data, next->granule),
-                                st2->time_base, AV_TIME_BASE_Q);
-    cur_granule  = av_rescale_q(ogg_granule_to_timestamp(st->priv_data, page->granule),
-                                st ->time_base, AV_TIME_BASE_Q);
-    return next_granule > cur_granule;
-}
-
-static int ogg_reset_cur_page(OGGStreamContext *oggstream)
-{
-    oggstream->page.granule = -1;
-    oggstream->page.flags = 0;
-    oggstream->page.segments_count = 0;
-    oggstream->page.size = 0;
-    return 0;
-}
-
-static int ogg_buffer_page(AVFormatContext *s, OGGStreamContext *oggstream)
-{
-    OGGContext *ogg = s->priv_data;
-    OGGPageList **p = &ogg->page_list;
-    OGGPageList *l = av_mallocz(sizeof(*l));
-
-    if (!l)
-        return AVERROR(ENOMEM);
-    l->page = oggstream->page;
-
-    oggstream->page.start_granule = oggstream->page.granule;
-    oggstream->page_count++;
-    ogg_reset_cur_page(oggstream);
-
-    while (*p) {
-        if (ogg_compare_granule(s, &(*p)->page, &l->page))
-            break;
-        p = &(*p)->next;
-    }
-    l->next = *p;
-    *p = l;
-
-    return 0;
-}
-
-static int ogg_buffer_data(AVFormatContext *s, AVStream *st,
-                           uint8_t *data, unsigned size, int64_t granule,
-                           int header)
-{
-    OGGStreamContext *oggstream = st->priv_data;
-    OGGContext *ogg = s->priv_data;
-    int total_segments = size / 255 + 1;
-    uint8_t *p = data;
-    int i, segments, len, flush = 0;
-
-    // Handles VFR by flushing page because this frame needs to have a timestamp
-    if (st->codec->codec_id == AV_CODEC_ID_THEORA && !header &&
-        ogg_granule_to_timestamp(oggstream, granule) >
-        ogg_granule_to_timestamp(oggstream, oggstream->last_granule) + 1) {
-        if (oggstream->page.granule != -1)
-            ogg_buffer_page(s, oggstream);
-        flush = 1;
-    }
-
-    // avoid a continued page
-    if (!header && oggstream->page.size > 0 &&
-        MAX_PAGE_SIZE - oggstream->page.size < size) {
-        ogg_buffer_page(s, oggstream);
-    }
-
-    for (i = 0; i < total_segments; ) {
-        OGGPage *page = &oggstream->page;
-
-        segments = FFMIN(total_segments - i, 255 - page->segments_count);
-
-        if (i && !page->segments_count)
-            page->flags |= 1; // continued packet
-
-        memset(page->segments+page->segments_count, 255, segments - 1);
-        page->segments_count += segments - 1;
-
-        len = FFMIN(size, segments*255);
-        page->segments[page->segments_count++] = len - (segments-1)*255;
-        memcpy(page->data+page->size, p, len);
-        p += len;
-        size -= len;
-        i += segments;
-        page->size += len;
-
-        if (i == total_segments)
-            page->granule = granule;
-
-        if (!header) {
-            AVStream *st = s->streams[page->stream_index];
-
-            int64_t start = av_rescale_q(page->start_granule, st->time_base,
-                                         AV_TIME_BASE_Q);
-            int64_t next  = av_rescale_q(page->granule, st->time_base,
-                                         AV_TIME_BASE_Q);
-
-            if (page->segments_count == 255 ||
-                (ogg->pref_size     > 0 && page->size   >= ogg->pref_size) ||
-                (ogg->pref_duration > 0 && next - start >= ogg->pref_duration)) {
-                ogg_buffer_page(s, oggstream);
-            }
-        }
-    }
-
-    if (flush && oggstream->page.granule != -1)
-        ogg_buffer_page(s, oggstream);
-
-    return 0;
-}
-
-static uint8_t *ogg_write_vorbiscomment(int offset, int bitexact,
-                                        int *header_len, AVDictionary **m, int framing_bit)
-{
-    const char *vendor = bitexact ? "Libav" : LIBAVFORMAT_IDENT;
-    int size;
-    uint8_t *p, *p0;
-    unsigned int count;
-
-    ff_metadata_conv(m, ff_vorbiscomment_metadata_conv, NULL);
-
-    size = offset + ff_vorbiscomment_length(*m, vendor, &count) + framing_bit;
-    p = av_mallocz(size);
-    if (!p)
-        return NULL;
-    p0 = p;
-
-    p += offset;
-    ff_vorbiscomment_write(&p, m, vendor, count);
-    if (framing_bit)
-        bytestream_put_byte(&p, 1);
-
-    *header_len = size;
-    return p0;
-}
-
-static int ogg_build_flac_headers(AVCodecContext *avctx,
-                                  OGGStreamContext *oggstream, int bitexact,
-                                  AVDictionary **m)
-{
-    enum FLACExtradataFormat format;
-    uint8_t *streaminfo;
-    uint8_t *p;
-
-    if (!avpriv_flac_is_extradata_valid(avctx, &format, &streaminfo))
-        return -1;
-
-    // first packet: STREAMINFO
-    oggstream->header_len[0] = 51;
-    oggstream->header[0] = av_mallocz(51); // per ogg flac specs
-    p = oggstream->header[0];
-    if (!p)
-        return AVERROR(ENOMEM);
-    bytestream_put_byte(&p, 0x7F);
-    bytestream_put_buffer(&p, "FLAC", 4);
-    bytestream_put_byte(&p, 1); // major version
-    bytestream_put_byte(&p, 0); // minor version
-    bytestream_put_be16(&p, 1); // headers packets without this one
-    bytestream_put_buffer(&p, "fLaC", 4);
-    bytestream_put_byte(&p, 0x00); // streaminfo
-    bytestream_put_be24(&p, 34);
-    bytestream_put_buffer(&p, streaminfo, FLAC_STREAMINFO_SIZE);
-
-    // second packet: VorbisComment
-    p = ogg_write_vorbiscomment(4, bitexact, &oggstream->header_len[1], m, 0);
-    if (!p)
-        return AVERROR(ENOMEM);
-    oggstream->header[1] = p;
-    bytestream_put_byte(&p, 0x84); // last metadata block and vorbis comment
-    bytestream_put_be24(&p, oggstream->header_len[1] - 4);
-
-    return 0;
-}
-
-#define SPEEX_HEADER_SIZE 80
-
-static int ogg_build_speex_headers(AVCodecContext *avctx,
-                                   OGGStreamContext *oggstream, int bitexact,
-                                   AVDictionary **m)
-{
-    uint8_t *p;
-
-    if (avctx->extradata_size < SPEEX_HEADER_SIZE)
-        return -1;
-
-    // first packet: Speex header
-    p = av_mallocz(SPEEX_HEADER_SIZE);
-    if (!p)
-        return AVERROR(ENOMEM);
-    oggstream->header[0] = p;
-    oggstream->header_len[0] = SPEEX_HEADER_SIZE;
-    bytestream_put_buffer(&p, avctx->extradata, SPEEX_HEADER_SIZE);
-    AV_WL32(&oggstream->header[0][68], 0);  // set extra_headers to 0
-
-    // second packet: VorbisComment
-    p = ogg_write_vorbiscomment(0, bitexact, &oggstream->header_len[1], m, 0);
-    if (!p)
-        return AVERROR(ENOMEM);
-    oggstream->header[1] = p;
-
-    return 0;
-}
-
-#define OPUS_HEADER_SIZE 19
-
-static int ogg_build_opus_headers(AVCodecContext *avctx,
-                                  OGGStreamContext *oggstream, int bitexact,
-                                  AVDictionary **m)
-{
-    uint8_t *p;
-
-    if (avctx->extradata_size < OPUS_HEADER_SIZE)
-        return -1;
-
-    /* first packet: Opus header */
-    p = av_mallocz(avctx->extradata_size);
-    if (!p)
-        return AVERROR(ENOMEM);
-    oggstream->header[0] = p;
-    oggstream->header_len[0] = avctx->extradata_size;
-    bytestream_put_buffer(&p, avctx->extradata, avctx->extradata_size);
-
-    /* second packet: VorbisComment */
-    p = ogg_write_vorbiscomment(8, bitexact, &oggstream->header_len[1], m, 0);
-    if (!p)
-        return AVERROR(ENOMEM);
-    oggstream->header[1] = p;
-    bytestream_put_buffer(&p, "OpusTags", 8);
-
-    return 0;
-}
-
-static int ogg_write_header(AVFormatContext *s)
-{
-    OGGContext *ogg = s->priv_data;
-    OGGStreamContext *oggstream;
-    int i, j;
-
-    if (ogg->pref_size)
-        av_log(s, AV_LOG_WARNING, "The pagesize option is deprecated\n");
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        unsigned serial_num = i;
-
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-            if (st->codec->codec_id == AV_CODEC_ID_OPUS)
-                /* Opus requires a fixed 48kHz clock */
-                avpriv_set_pts_info(st, 64, 1, 48000);
-            else
-                avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-        else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-            avpriv_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
-        if (st->codec->codec_id != AV_CODEC_ID_VORBIS &&
-            st->codec->codec_id != AV_CODEC_ID_THEORA &&
-            st->codec->codec_id != AV_CODEC_ID_SPEEX  &&
-            st->codec->codec_id != AV_CODEC_ID_FLAC   &&
-            st->codec->codec_id != AV_CODEC_ID_OPUS) {
-            av_log(s, AV_LOG_ERROR, "Unsupported codec id in stream %d\n", i);
-            return -1;
-        }
-
-        if (!st->codec->extradata || !st->codec->extradata_size) {
-            av_log(s, AV_LOG_ERROR, "No extradata present\n");
-            return -1;
-        }
-        oggstream = av_mallocz(sizeof(*oggstream));
-        oggstream->page.stream_index = i;
-
-        if (!(st->codec->flags & CODEC_FLAG_BITEXACT))
-            do {
-                serial_num = av_get_random_seed();
-                for (j = 0; j < i; j++) {
-                    OGGStreamContext *sc = s->streams[j]->priv_data;
-                    if (serial_num == sc->serial_num)
-                        break;
-                }
-            } while (j < i);
-        oggstream->serial_num = serial_num;
-
-        st->priv_data = oggstream;
-        if (st->codec->codec_id == AV_CODEC_ID_FLAC) {
-            int err = ogg_build_flac_headers(st->codec, oggstream,
-                                             st->codec->flags & CODEC_FLAG_BITEXACT,
-                                             &s->metadata);
-            if (err) {
-                av_log(s, AV_LOG_ERROR, "Error writing FLAC headers\n");
-                av_freep(&st->priv_data);
-                return err;
-            }
-        } else if (st->codec->codec_id == AV_CODEC_ID_SPEEX) {
-            int err = ogg_build_speex_headers(st->codec, oggstream,
-                                              st->codec->flags & CODEC_FLAG_BITEXACT,
-                                              &s->metadata);
-            if (err) {
-                av_log(s, AV_LOG_ERROR, "Error writing Speex headers\n");
-                av_freep(&st->priv_data);
-                return err;
-            }
-        } else if (st->codec->codec_id == AV_CODEC_ID_OPUS) {
-            int err = ogg_build_opus_headers(st->codec, oggstream,
-                                             st->codec->flags & CODEC_FLAG_BITEXACT,
-                                             &s->metadata);
-            if (err) {
-                av_log(s, AV_LOG_ERROR, "Error writing Opus headers\n");
-                av_freep(&st->priv_data);
-                return err;
-            }
-        } else {
-            uint8_t *p;
-            const char *cstr = st->codec->codec_id == AV_CODEC_ID_VORBIS ? "vorbis" : "theora";
-            int header_type = st->codec->codec_id == AV_CODEC_ID_VORBIS ? 3 : 0x81;
-            int framing_bit = st->codec->codec_id == AV_CODEC_ID_VORBIS ? 1 : 0;
-
-            if (avpriv_split_xiph_headers(st->codec->extradata, st->codec->extradata_size,
-                                      st->codec->codec_id == AV_CODEC_ID_VORBIS ? 30 : 42,
-                                      oggstream->header, oggstream->header_len) < 0) {
-                av_log(s, AV_LOG_ERROR, "Extradata corrupted\n");
-                av_freep(&st->priv_data);
-                return -1;
-            }
-
-            p = ogg_write_vorbiscomment(7, st->codec->flags & CODEC_FLAG_BITEXACT,
-                                        &oggstream->header_len[1], &s->metadata,
-                                        framing_bit);
-            oggstream->header[1] = p;
-            if (!p)
-                return AVERROR(ENOMEM);
-
-            bytestream_put_byte(&p, header_type);
-            bytestream_put_buffer(&p, cstr, 6);
-
-            if (st->codec->codec_id == AV_CODEC_ID_THEORA) {
-                /** KFGSHIFT is the width of the less significant section of the granule position
-                    The less significant section is the frame count since the last keyframe */
-                oggstream->kfgshift = ((oggstream->header[0][40]&3)<<3)|(oggstream->header[0][41]>>5);
-                oggstream->vrev = oggstream->header[0][9];
-                av_log(s, AV_LOG_DEBUG, "theora kfgshift %d, vrev %d\n",
-                       oggstream->kfgshift, oggstream->vrev);
-            }
-        }
-    }
-
-    for (j = 0; j < s->nb_streams; j++) {
-        OGGStreamContext *oggstream = s->streams[j]->priv_data;
-        ogg_buffer_data(s, s->streams[j], oggstream->header[0],
-                        oggstream->header_len[0], 0, 1);
-        oggstream->page.flags |= 2; // bos
-        ogg_buffer_page(s, oggstream);
-    }
-    for (j = 0; j < s->nb_streams; j++) {
-        AVStream *st = s->streams[j];
-        OGGStreamContext *oggstream = st->priv_data;
-        for (i = 1; i < 3; i++) {
-            if (oggstream && oggstream->header_len[i])
-                ogg_buffer_data(s, st, oggstream->header[i],
-                                oggstream->header_len[i], 0, 1);
-        }
-        ogg_buffer_page(s, oggstream);
-    }
-
-    oggstream->page.start_granule = AV_NOPTS_VALUE;
-
-    return 0;
-}
-
-static void ogg_write_pages(AVFormatContext *s, int flush)
-{
-    OGGContext *ogg = s->priv_data;
-    OGGPageList *next, *p;
-
-    if (!ogg->page_list)
-        return;
-
-    for (p = ogg->page_list; p; ) {
-        OGGStreamContext *oggstream =
-            s->streams[p->page.stream_index]->priv_data;
-        if (oggstream->page_count < 2 && !flush)
-            break;
-        ogg_write_page(s, &p->page,
-                       flush && oggstream->page_count == 1 ? 4 : 0); // eos
-        next = p->next;
-        av_freep(&p);
-        p = next;
-    }
-    ogg->page_list = p;
-}
-
-static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVStream *st = s->streams[pkt->stream_index];
-    OGGStreamContext *oggstream = st->priv_data;
-    int ret;
-    int64_t granule;
-
-    if (st->codec->codec_id == AV_CODEC_ID_THEORA) {
-        int64_t pts = oggstream->vrev < 1 ? pkt->pts : pkt->pts + pkt->duration;
-        int pframe_count;
-        if (pkt->flags & AV_PKT_FLAG_KEY)
-            oggstream->last_kf_pts = pts;
-        pframe_count = pts - oggstream->last_kf_pts;
-        // prevent frame count from overflow if key frame flag is not set
-        if (pframe_count >= (1<<oggstream->kfgshift)) {
-            oggstream->last_kf_pts += pframe_count;
-            pframe_count = 0;
-        }
-        granule = (oggstream->last_kf_pts<<oggstream->kfgshift) | pframe_count;
-    } else if (st->codec->codec_id == AV_CODEC_ID_OPUS)
-        granule = pkt->pts + pkt->duration + av_rescale_q(st->codec->delay, (AVRational){ 1, st->codec->sample_rate }, st->time_base);
-    else
-        granule = pkt->pts + pkt->duration;
-
-    if (oggstream->page.start_granule == AV_NOPTS_VALUE)
-        oggstream->page.start_granule = pkt->pts;
-
-    ret = ogg_buffer_data(s, st, pkt->data, pkt->size, granule, 0);
-    if (ret < 0)
-        return ret;
-
-    ogg_write_pages(s, 0);
-
-    oggstream->last_granule = granule;
-
-    return 0;
-}
-
-static int ogg_write_trailer(AVFormatContext *s)
-{
-    int i;
-
-    /* flush current page if needed */
-    for (i = 0; i < s->nb_streams; i++) {
-        OGGStreamContext *oggstream = s->streams[i]->priv_data;
-
-        if (oggstream->page.size > 0)
-            ogg_buffer_page(s, oggstream);
-    }
-
-    ogg_write_pages(s, 1);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-        OGGStreamContext *oggstream = st->priv_data;
-        if (st->codec->codec_id == AV_CODEC_ID_FLAC ||
-            st->codec->codec_id == AV_CODEC_ID_SPEEX ||
-            st->codec->codec_id == AV_CODEC_ID_OPUS) {
-            av_free(oggstream->header[0]);
-        }
-        av_freep(&oggstream->header[1]);
-        av_freep(&st->priv_data);
-    }
-    return 0;
-}
-
-AVOutputFormat ff_ogg_muxer = {
-    .name              = "ogg",
-    .long_name         = NULL_IF_CONFIG_SMALL("Ogg"),
-    .mime_type         = "application/ogg",
-    .extensions        = "ogg,ogv,spx,opus",
-    .priv_data_size    = sizeof(OGGContext),
-    .audio_codec       = CONFIG_LIBVORBIS_ENCODER ?
-                         AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
-    .video_codec       = AV_CODEC_ID_THEORA,
-    .write_header      = ogg_write_header,
-    .write_packet      = ogg_write_packet,
-    .write_trailer     = ogg_write_trailer,
-    .flags             = AVFMT_TS_NEGATIVE,
-    .priv_class        = &ogg_muxer_class,
-};
diff --git a/deps/libav/libavformat/oggparsecelt.c b/deps/libav/libavformat/oggparsecelt.c
deleted file mode 100644
index 0deccc2..0000000
--- a/deps/libav/libavformat/oggparsecelt.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Xiph CELT / Opus parser for Ogg
- * Copyright (c) 2011 Nicolas George
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-#include "oggdec.h"
-
-struct oggcelt_private {
-    int extra_headers_left;
-};
-
-static int celt_header(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    AVStream *st = s->streams[idx];
-    struct oggcelt_private *priv = os->private;
-    uint8_t *p = os->buf + os->pstart;
-
-    if (os->psize == 60 &&
-        !memcmp(p, ff_celt_codec.magic, ff_celt_codec.magicsize)) {
-        /* Main header */
-
-        uint32_t version, sample_rate, nb_channels, frame_size;
-        uint32_t overlap, extra_headers;
-        uint8_t *extradata;
-
-        extradata = av_malloc(2 * sizeof(uint32_t) +
-                              FF_INPUT_BUFFER_PADDING_SIZE);
-        priv = av_malloc(sizeof(struct oggcelt_private));
-        if (!extradata || !priv) {
-            av_free(extradata);
-            av_free(priv);
-            return AVERROR(ENOMEM);
-        }
-        version          = AV_RL32(p + 28);
-        /* unused header size field skipped */
-        sample_rate      = AV_RL32(p + 36);
-        nb_channels      = AV_RL32(p + 40);
-        frame_size       = AV_RL32(p + 44);
-        overlap          = AV_RL32(p + 48);
-        /* unused bytes per packet field skipped */
-        extra_headers    = AV_RL32(p + 56);
-        av_free(os->private);
-        av_free(st->codec->extradata);
-        st->codec->codec_type     = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id       = AV_CODEC_ID_CELT;
-        st->codec->sample_rate    = sample_rate;
-        st->codec->channels       = nb_channels;
-        st->codec->frame_size     = frame_size;
-        st->codec->extradata      = extradata;
-        st->codec->extradata_size = 2 * sizeof(uint32_t);
-        if (sample_rate)
-            avpriv_set_pts_info(st, 64, 1, sample_rate);
-        priv->extra_headers_left  = 1 + extra_headers;
-        os->private = priv;
-        AV_WL32(extradata + 0, overlap);
-        AV_WL32(extradata + 4, version);
-        return 1;
-    } else if (priv && priv->extra_headers_left) {
-        /* Extra headers (vorbiscomment) */
-
-        ff_vorbis_comment(s, &st->metadata, p, os->psize);
-        priv->extra_headers_left--;
-        return 1;
-    } else {
-        return 0;
-    }
-}
-
-const struct ogg_codec ff_celt_codec = {
-    .magic     = "CELT    ",
-    .magicsize = 8,
-    .header    = celt_header,
-    .nb_header = 2,
-};
diff --git a/deps/libav/libavformat/oggparsedirac.c b/deps/libav/libavformat/oggparsedirac.c
deleted file mode 100644
index 55a0b59..0000000
--- a/deps/libav/libavformat/oggparsedirac.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2008  David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/get_bits.h"
-#include "libavcodec/dirac.h"
-#include "avformat.h"
-#include "internal.h"
-#include "oggdec.h"
-
-static int dirac_header(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    AVStream *st = s->streams[idx];
-    dirac_source_params source;
-    GetBitContext gb;
-
-    // already parsed the header
-    if (st->codec->codec_id == AV_CODEC_ID_DIRAC)
-        return 0;
-
-    init_get_bits(&gb, os->buf + os->pstart + 13, (os->psize - 13) * 8);
-    if (avpriv_dirac_parse_sequence_header(st->codec, &gb, &source) < 0)
-        return -1;
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_DIRAC;
-    // dirac in ogg always stores timestamps as though the video were interlaced
-    avpriv_set_pts_info(st, 64, st->codec->time_base.num, 2*st->codec->time_base.den);
-    return 1;
-}
-
-// various undocument things: granule is signed (only for dirac!)
-static uint64_t dirac_gptopts(AVFormatContext *s, int idx, uint64_t granule,
-                              int64_t *dts_out)
-{
-    int64_t gp = granule;
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-
-    unsigned dist  = ((gp >> 14) & 0xff00) | (gp & 0xff);
-    int64_t  dts   = (gp >> 31);
-    int64_t  pts   = dts + ((gp >> 9) & 0x1fff);
-
-    if (!dist)
-        os->pflags |= AV_PKT_FLAG_KEY;
-
-    if (dts_out)
-        *dts_out = dts;
-
-    return pts;
-}
-
-static int old_dirac_header(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    AVStream *st = s->streams[idx];
-    uint8_t *buf = os->buf + os->pstart;
-
-    if (buf[0] != 'K')
-        return 0;
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_DIRAC;
-    avpriv_set_pts_info(st, 64, AV_RB32(buf+12), AV_RB32(buf+8));
-    return 1;
-}
-
-static uint64_t old_dirac_gptopts(AVFormatContext *s, int idx, uint64_t gp,
-                                  int64_t *dts)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    uint64_t iframe = gp >> 30;
-    uint64_t pframe = gp & 0x3fffffff;
-
-    if (!pframe)
-        os->pflags |= AV_PKT_FLAG_KEY;
-
-    return iframe + pframe;
-}
-
-const struct ogg_codec ff_dirac_codec = {
-    .magic = "BBCD\0",
-    .magicsize = 5,
-    .header = dirac_header,
-    .gptopts = dirac_gptopts,
-    .granule_is_start = 1,
-    .nb_header = 1,
-};
-
-const struct ogg_codec ff_old_dirac_codec = {
-    .magic = "KW-DIRAC",
-    .magicsize = 8,
-    .header = old_dirac_header,
-    .gptopts = old_dirac_gptopts,
-    .granule_is_start = 1,
-    .nb_header = 1,
-};
diff --git a/deps/libav/libavformat/oggparseflac.c b/deps/libav/libavformat/oggparseflac.c
deleted file mode 100644
index f59b400..0000000
--- a/deps/libav/libavformat/oggparseflac.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *    Copyright (C) 2005  Matthieu CASTET
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include "libavcodec/get_bits.h"
-#include "libavcodec/flac.h"
-#include "avformat.h"
-#include "internal.h"
-#include "oggdec.h"
-
-#define OGG_FLAC_METADATA_TYPE_STREAMINFO 0x7F
-
-static int
-flac_header (AVFormatContext * s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    AVStream *st = s->streams[idx];
-    GetBitContext gb;
-    FLACStreaminfo si;
-    int mdt;
-
-    if (os->buf[os->pstart] == 0xff)
-        return 0;
-
-    init_get_bits(&gb, os->buf + os->pstart, os->psize*8);
-    skip_bits1(&gb); /* metadata_last */
-    mdt = get_bits(&gb, 7);
-
-    if (mdt == OGG_FLAC_METADATA_TYPE_STREAMINFO) {
-        uint8_t *streaminfo_start = os->buf + os->pstart + 5 + 4 + 4 + 4;
-        skip_bits_long(&gb, 4*8); /* "FLAC" */
-        if(get_bits(&gb, 8) != 1) /* unsupported major version */
-            return -1;
-        skip_bits_long(&gb, 8 + 16); /* minor version + header count */
-        skip_bits_long(&gb, 4*8); /* "fLaC" */
-
-        /* METADATA_BLOCK_HEADER */
-        if (get_bits_long(&gb, 32) != FLAC_STREAMINFO_SIZE)
-            return -1;
-
-        avpriv_flac_parse_streaminfo(st->codec, &si, streaminfo_start);
-
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id = AV_CODEC_ID_FLAC;
-        st->need_parsing = AVSTREAM_PARSE_HEADERS;
-
-        st->codec->extradata =
-            av_malloc(FLAC_STREAMINFO_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
-        memcpy(st->codec->extradata, streaminfo_start, FLAC_STREAMINFO_SIZE);
-        st->codec->extradata_size = FLAC_STREAMINFO_SIZE;
-
-        avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    } else if (mdt == FLAC_METADATA_TYPE_VORBIS_COMMENT) {
-        ff_vorbis_comment (s, &st->metadata, os->buf + os->pstart + 4, os->psize - 4);
-    }
-
-    return 1;
-}
-
-static int
-old_flac_header (AVFormatContext * s, int idx)
-{
-    AVStream *st = s->streams[idx];
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_FLAC;
-
-    return 0;
-}
-
-const struct ogg_codec ff_flac_codec = {
-    .magic = "\177FLAC",
-    .magicsize = 5,
-    .header = flac_header,
-    .nb_header = 2,
-};
-
-const struct ogg_codec ff_old_flac_codec = {
-    .magic = "fLaC",
-    .magicsize = 4,
-    .header = old_flac_header,
-    .nb_header = 0,
-};
diff --git a/deps/libav/libavformat/oggparseogm.c b/deps/libav/libavformat/oggparseogm.c
deleted file mode 100644
index 2313625..0000000
--- a/deps/libav/libavformat/oggparseogm.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
-    Copyright (C) 2005  Michael Ahlberg, Måns Rullgård
-
-    Permission is hereby granted, free of charge, to any person
-    obtaining a copy of this software and associated documentation
-    files (the "Software"), to deal in the Software without
-    restriction, including without limitation the rights to use, copy,
-    modify, merge, publish, distribute, sublicense, and/or sell copies
-    of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be
-    included in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS IN THE SOFTWARE.
-**/
-
-#include <stdlib.h>
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/get_bits.h"
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "internal.h"
-#include "oggdec.h"
-#include "riff.h"
-
-static int
-ogm_header(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    AVStream *st = s->streams[idx];
-    GetByteContext p;
-    uint64_t time_unit;
-    uint64_t spu;
-
-    bytestream2_init(&p, os->buf + os->pstart, os->psize);
-    if (!(bytestream2_peek_byte(&p) & 1))
-        return 0;
-
-    if (bytestream2_peek_byte(&p) == 1) {
-        bytestream2_skip(&p, 1);
-
-        if (bytestream2_peek_byte(&p) == 'v'){
-            int tag;
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            bytestream2_skip(&p, 8);
-            tag = bytestream2_get_le32(&p);
-            st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag);
-            st->codec->codec_tag = tag;
-        } else if (bytestream2_peek_byte(&p) == 't') {
-            st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-            st->codec->codec_id = AV_CODEC_ID_TEXT;
-            bytestream2_skip(&p, 12);
-        } else {
-            uint8_t acid[5] = { 0 };
-            int cid;
-            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            bytestream2_skip(&p, 8);
-            bytestream2_get_buffer(&p, acid, 4);
-            acid[4] = 0;
-            cid = strtol(acid, NULL, 16);
-            st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, cid);
-            st->need_parsing = AVSTREAM_PARSE_FULL;
-        }
-
-        bytestream2_skip(&p, 4);    /* useless size field */
-
-        time_unit   = bytestream2_get_le64(&p);
-        spu         = bytestream2_get_le64(&p);
-        if (!time_unit || !spu) {
-            av_log(s, AV_LOG_ERROR, "Invalid timing values.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        bytestream2_skip(&p, 4);    /* default_len */
-        bytestream2_skip(&p, 8);    /* buffersize + bits_per_sample */
-
-        if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){
-            st->codec->width = bytestream2_get_le32(&p);
-            st->codec->height = bytestream2_get_le32(&p);
-            avpriv_set_pts_info(st, 64, time_unit, spu * 10000000);
-        } else {
-            st->codec->channels = bytestream2_get_le16(&p);
-            bytestream2_skip(&p, 2); /* block_align */
-            st->codec->bit_rate = bytestream2_get_le32(&p) * 8;
-            st->codec->sample_rate = spu * 10000000 / time_unit;
-            avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-        }
-    } else if (bytestream2_peek_byte(&p) == 3) {
-        bytestream2_skip(&p, 7);
-        if (bytestream2_get_bytes_left(&p) > 1)
-            ff_vorbis_comment(s, &st->metadata, p.buffer, bytestream2_get_bytes_left(&p) - 1);
-    }
-
-    return 1;
-}
-
-static int
-ogm_dshow_header(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    AVStream *st = s->streams[idx];
-    uint8_t *p = os->buf + os->pstart;
-    uint32_t t;
-
-    if(!(*p & 1))
-        return 0;
-    if(*p != 1)
-        return 1;
-
-    t = AV_RL32(p + 96);
-
-    if(t == 0x05589f80){
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(p + 68));
-        avpriv_set_pts_info(st, 64, AV_RL64(p + 164), 10000000);
-        st->codec->width = AV_RL32(p + 176);
-        st->codec->height = AV_RL32(p + 180);
-    } else if(t == 0x05589f81){
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, AV_RL16(p + 124));
-        st->codec->channels = AV_RL16(p + 126);
-        st->codec->sample_rate = AV_RL32(p + 128);
-        st->codec->bit_rate = AV_RL32(p + 132) * 8;
-    }
-
-    return 1;
-}
-
-static int
-ogm_packet(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    uint8_t *p = os->buf + os->pstart;
-    int lb;
-
-    if(*p & 8)
-        os->pflags |= AV_PKT_FLAG_KEY;
-
-    lb = ((*p & 2) << 1) | ((*p >> 6) & 3);
-    os->pstart += lb + 1;
-    os->psize -= lb + 1;
-
-    while (lb--)
-        os->pduration += p[lb+1] << (lb*8);
-
-    return 0;
-}
-
-const struct ogg_codec ff_ogm_video_codec = {
-    .magic = "\001video",
-    .magicsize = 6,
-    .header = ogm_header,
-    .packet = ogm_packet,
-    .granule_is_start = 1,
-    .nb_header = 2,
-};
-
-const struct ogg_codec ff_ogm_audio_codec = {
-    .magic = "\001audio",
-    .magicsize = 6,
-    .header = ogm_header,
-    .packet = ogm_packet,
-    .granule_is_start = 1,
-    .nb_header = 2,
-};
-
-const struct ogg_codec ff_ogm_text_codec = {
-    .magic = "\001text",
-    .magicsize = 5,
-    .header = ogm_header,
-    .packet = ogm_packet,
-    .granule_is_start = 1,
-    .nb_header = 2,
-};
-
-const struct ogg_codec ff_ogm_old_codec = {
-    .magic = "\001Direct Show Samples embedded in Ogg",
-    .magicsize = 35,
-    .header = ogm_dshow_header,
-    .packet = ogm_packet,
-    .granule_is_start = 1,
-    .nb_header = 1,
-};
diff --git a/deps/libav/libavformat/oggparseopus.c b/deps/libav/libavformat/oggparseopus.c
deleted file mode 100644
index babd0f0..0000000
--- a/deps/libav/libavformat/oggparseopus.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Opus parser for Ogg
- * Copyright (c) 2012 Nicolas George
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-#include "oggdec.h"
-
-struct oggopus_private {
-    int need_comments;
-    unsigned pre_skip;
-    int64_t cur_dts;
-};
-
-#define OPUS_HEAD_SIZE 19
-
-static int opus_header(AVFormatContext *avf, int idx)
-{
-    struct ogg *ogg              = avf->priv_data;
-    struct ogg_stream *os        = &ogg->streams[idx];
-    AVStream *st                 = avf->streams[idx];
-    struct oggopus_private *priv = os->private;
-    uint8_t *packet              = os->buf + os->pstart;
-    uint8_t *extradata;
-
-    if (!priv) {
-        priv = os->private = av_mallocz(sizeof(*priv));
-        if (!priv)
-            return AVERROR(ENOMEM);
-    }
-    if (os->flags & OGG_FLAG_BOS) {
-        if (os->psize < OPUS_HEAD_SIZE || (AV_RL8(packet + 8) & 0xF0) != 0)
-            return AVERROR_INVALIDDATA;
-
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id   = AV_CODEC_ID_OPUS;
-        st->codec->channels   = AV_RL8(packet + 9);
-        priv->pre_skip        = AV_RL16(packet + 10);
-
-        extradata = av_malloc(os->psize + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!extradata)
-            return AVERROR(ENOMEM);
-
-        memcpy(extradata, packet, os->psize);
-        st->codec->extradata      = extradata;
-        st->codec->extradata_size = os->psize;
-
-        st->codec->sample_rate = 48000;
-        avpriv_set_pts_info(st, 64, 1, 48000);
-        priv->need_comments = 1;
-        return 1;
-    }
-
-    if (priv->need_comments) {
-        if (os->psize < 8 || memcmp(packet, "OpusTags", 8))
-            return AVERROR_INVALIDDATA;
-        ff_vorbis_comment(avf, &st->metadata, packet + 8, os->psize - 8);
-        priv->need_comments--;
-        return 1;
-    }
-
-    return 0;
-}
-
-static int opus_packet(AVFormatContext *avf, int idx)
-{
-    struct ogg *ogg              = avf->priv_data;
-    struct ogg_stream *os        = &ogg->streams[idx];
-    AVStream *st                 = avf->streams[idx];
-    struct oggopus_private *priv = os->private;
-    uint8_t *packet              = os->buf + os->pstart;
-    unsigned toc, toc_config, toc_count, frame_size, nb_frames = 1;
-
-    if (!os->psize)
-        return AVERROR_INVALIDDATA;
-
-    toc        = *packet;
-    toc_config = toc >> 3;
-    toc_count  = toc & 3;
-    frame_size = toc_config < 12 ? FFMAX(480, 960 * (toc_config & 3)) :
-                 toc_config < 16 ? 480 << (toc_config & 1) :
-                                   120 << (toc_config & 3);
-    if (toc_count == 3) {
-        if (os->psize < 2)
-            return AVERROR_INVALIDDATA;
-        nb_frames = packet[1] & 0x3F;
-    } else if (toc_count) {
-        nb_frames = 2;
-    }
-
-    os->pduration = frame_size * nb_frames;
-    if (os->lastpts != AV_NOPTS_VALUE) {
-        if (st->start_time == AV_NOPTS_VALUE)
-            st->start_time = os->lastpts;
-        priv->cur_dts = os->lastdts = os->lastpts -= priv->pre_skip;
-    }
-
-    priv->cur_dts += os->pduration;
-    if ((os->flags & OGG_FLAG_EOS)) {
-        int64_t skip = priv->cur_dts - os->granule + priv->pre_skip;
-        skip = FFMIN(skip, os->pduration);
-        if (skip > 0) {
-            os->pduration = skip < os->pduration ? os->pduration - skip : 1;
-            av_log(avf, AV_LOG_WARNING,
-                   "Last packet is truncated to %d (because of unimplemented end trim support).\n",
-                   os->pduration);
-            return AVERROR_PATCHWELCOME;
-        }
-    }
-
-    return 0;
-}
-
-const struct ogg_codec ff_opus_codec = {
-    .name             = "Opus",
-    .magic            = "OpusHead",
-    .magicsize        = 8,
-    .header           = opus_header,
-    .packet           = opus_packet,
-    .granule_is_start = 1,
-    .nb_header        = 1,
-};
diff --git a/deps/libav/libavformat/oggparseskeleton.c b/deps/libav/libavformat/oggparseskeleton.c
deleted file mode 100644
index f437c69..0000000
--- a/deps/libav/libavformat/oggparseskeleton.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2010 David Conrad
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "internal.h"
-#include "oggdec.h"
-
-static int skeleton_header(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    AVStream *st = s->streams[idx];
-    uint8_t *buf = os->buf + os->pstart;
-    int version_major, version_minor;
-    int64_t start_num, start_den;
-    uint64_t start_granule;
-    int target_idx, start_time;
-
-    strcpy(st->codec->codec_name, "skeleton");
-    st->codec->codec_type = AVMEDIA_TYPE_DATA;
-
-    if (os->psize < 8)
-        return -1;
-
-    if (!strncmp(buf, "fishead", 8)) {
-        if (os->psize < 64)
-            return -1;
-
-        version_major = AV_RL16(buf+8);
-        version_minor = AV_RL16(buf+10);
-
-        if (version_major != 3) {
-            av_log(s, AV_LOG_WARNING, "Unknown skeleton version %d.%d\n",
-                   version_major, version_minor);
-            return -1;
-        }
-
-        // This is the overall start time. We use it for the start time of
-        // of the skeleton stream since if left unset lavf assumes 0,
-        // which we don't want since skeleton is timeless
-        // FIXME: the real meaning of this field is "start playback at
-        // this time which can be in the middle of a packet
-        start_num = AV_RL64(buf+12);
-        start_den = AV_RL64(buf+20);
-
-        if (start_den) {
-            int base_den;
-            av_reduce(&start_time, &base_den, start_num, start_den, INT_MAX);
-            avpriv_set_pts_info(st, 64, 1, base_den);
-            os->lastpts =
-            st->start_time = start_time;
-        }
-    } else if (!strncmp(buf, "fisbone", 8)) {
-        if (os->psize < 52)
-            return -1;
-
-        target_idx = ogg_find_stream(ogg, AV_RL32(buf+12));
-        start_granule = AV_RL64(buf+36);
-        if (os->start_granule != OGG_NOGRANULE_VALUE) {
-            avpriv_report_missing_feature(s,
-                                          "Multiple fisbone for the same stream");
-            return 1;
-        }
-        if (target_idx >= 0 && start_granule != OGG_NOGRANULE_VALUE) {
-            os->start_granule = start_granule;
-        }
-    }
-
-    return 1;
-}
-
-const struct ogg_codec ff_skeleton_codec = {
-    .magic = "fishead",
-    .magicsize = 8,
-    .header = skeleton_header,
-    .nb_header = 0,
-};
diff --git a/deps/libav/libavformat/oggparsespeex.c b/deps/libav/libavformat/oggparsespeex.c
deleted file mode 100644
index 42480a3..0000000
--- a/deps/libav/libavformat/oggparsespeex.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-      Copyright (C) 2008  Reimar Döffinger
-
-      Permission is hereby granted, free of charge, to any person
-      obtaining a copy of this software and associated documentation
-      files (the "Software"), to deal in the Software without
-      restriction, including without limitation the rights to use, copy,
-      modify, merge, publish, distribute, sublicense, and/or sell copies
-      of the Software, and to permit persons to whom the Software is
-      furnished to do so, subject to the following conditions:
-
-      The above copyright notice and this permission notice shall be
-      included in all copies or substantial portions of the Software.
-
-      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-      EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-      MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-      NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-      HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-      WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-      DEALINGS IN THE SOFTWARE.
-**/
-
-#include <stdlib.h>
-#include "libavutil/bswap.h"
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavcodec/get_bits.h"
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "internal.h"
-#include "oggdec.h"
-
-struct speex_params {
-    int packet_size;
-    int final_packet_duration;
-    int seq;
-};
-
-static int speex_header(AVFormatContext *s, int idx) {
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    struct speex_params *spxp = os->private;
-    AVStream *st = s->streams[idx];
-    uint8_t *p = os->buf + os->pstart;
-
-    if (!spxp) {
-        spxp = av_mallocz(sizeof(*spxp));
-        os->private = spxp;
-    }
-
-    if (spxp->seq > 1)
-        return 0;
-
-    if (spxp->seq == 0) {
-        int frames_per_packet;
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id = AV_CODEC_ID_SPEEX;
-
-        st->codec->sample_rate = AV_RL32(p + 36);
-        st->codec->channels = AV_RL32(p + 48);
-        if (st->codec->channels < 1 || st->codec->channels > 2) {
-            av_log(s, AV_LOG_ERROR, "invalid channel count. Speex must be mono or stereo.\n");
-            return AVERROR_INVALIDDATA;
-        }
-        st->codec->channel_layout = st->codec->channels == 1 ? AV_CH_LAYOUT_MONO :
-                                                               AV_CH_LAYOUT_STEREO;
-
-        spxp->packet_size  = AV_RL32(p + 56);
-        frames_per_packet  = AV_RL32(p + 64);
-        if (frames_per_packet)
-            spxp->packet_size *= frames_per_packet;
-
-        st->codec->extradata_size = os->psize;
-        st->codec->extradata = av_malloc(st->codec->extradata_size
-                                         + FF_INPUT_BUFFER_PADDING_SIZE);
-        memcpy(st->codec->extradata, p, st->codec->extradata_size);
-
-        avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    } else
-        ff_vorbis_comment(s, &st->metadata, p, os->psize);
-
-    spxp->seq++;
-    return 1;
-}
-
-static int ogg_page_packets(struct ogg_stream *os)
-{
-    int i;
-    int packets = 0;
-    for (i = 0; i < os->nsegs; i++)
-        if (os->segments[i] < 255)
-            packets++;
-    return packets;
-}
-
-static int speex_packet(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    struct speex_params *spxp = os->private;
-    int packet_size = spxp->packet_size;
-
-    if (os->flags & OGG_FLAG_EOS && os->lastpts != AV_NOPTS_VALUE &&
-        os->granule > 0) {
-        /* first packet of final page. we have to calculate the final packet
-           duration here because it is the only place we know the next-to-last
-           granule position. */
-        spxp->final_packet_duration = os->granule - os->lastpts -
-                                      packet_size * (ogg_page_packets(os) - 1);
-    }
-
-    if (!os->lastpts && os->granule > 0)
-        /* first packet */
-        os->lastpts = os->lastdts = os->granule - packet_size *
-                                    ogg_page_packets(os);
-    if (os->flags & OGG_FLAG_EOS && os->segp == os->nsegs &&
-        spxp->final_packet_duration)
-        /* final packet */
-        os->pduration = spxp->final_packet_duration;
-    else
-        os->pduration = packet_size;
-
-    return 0;
-}
-
-const struct ogg_codec ff_speex_codec = {
-    .magic = "Speex   ",
-    .magicsize = 8,
-    .header = speex_header,
-    .packet = speex_packet,
-    .nb_header = 2,
-};
diff --git a/deps/libav/libavformat/oggparsetheora.c b/deps/libav/libavformat/oggparsetheora.c
deleted file mode 100644
index 035bdc2..0000000
--- a/deps/libav/libavformat/oggparsetheora.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/**
- *    Copyright (C) 2005  Matthieu CASTET, Alex Beregszaszi
- *
- *    Permission is hereby granted, free of charge, to any person
- *    obtaining a copy of this software and associated documentation
- *    files (the "Software"), to deal in the Software without
- *    restriction, including without limitation the rights to use, copy,
- *    modify, merge, publish, distribute, sublicense, and/or sell copies
- *    of the Software, and to permit persons to whom the Software is
- *    furnished to do so, subject to the following conditions:
- *
- *    The above copyright notice and this permission notice shall be
- *    included in all copies or substantial portions of the Software.
- *
- *    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- *    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- *    DEALINGS IN THE SOFTWARE.
- **/
-
-#include <stdlib.h>
-#include "libavutil/bswap.h"
-#include "libavcodec/get_bits.h"
-#include "avformat.h"
-#include "internal.h"
-#include "oggdec.h"
-
-typedef struct TheoraParams {
-    int gpshift;
-    int gpmask;
-    unsigned version;
-} TheoraParams;
-
-static int theora_header(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg       = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    AVStream *st          = s->streams[idx];
-    TheoraParams *thp     = os->private;
-    int cds               = st->codec->extradata_size + os->psize + 2;
-    int err;
-    uint8_t *cdp;
-
-    if (!(os->buf[os->pstart] & 0x80))
-        return 0;
-
-    if (!thp) {
-        thp = av_mallocz(sizeof(*thp));
-        if (!thp)
-            return AVERROR(ENOMEM);
-        os->private = thp;
-    }
-
-    switch (os->buf[os->pstart]) {
-    case 0x80: {
-        GetBitContext gb;
-        AVRational timebase;
-
-        init_get_bits(&gb, os->buf + os->pstart, os->psize * 8);
-
-        /* 0x80"theora" */
-        skip_bits_long(&gb, 7 * 8);
-
-        thp->version = get_bits_long(&gb, 24);
-        if (thp->version < 0x030100) {
-            av_log(s, AV_LOG_ERROR,
-                   "Too old or unsupported Theora (%x)\n", thp->version);
-            return AVERROR(ENOSYS);
-        }
-
-        st->codec->width  = get_bits(&gb, 16) << 4;
-        st->codec->height = get_bits(&gb, 16) << 4;
-
-        if (thp->version >= 0x030400)
-            skip_bits(&gb, 100);
-
-        if (thp->version >= 0x030200) {
-            int width  = get_bits_long(&gb, 24);
-            int height = get_bits_long(&gb, 24);
-            if (width  <= st->codec->width  && width  > st->codec->width  - 16 &&
-                height <= st->codec->height && height > st->codec->height - 16) {
-                st->codec->width  = width;
-                st->codec->height = height;
-            }
-
-            skip_bits(&gb, 16);
-        }
-
-        timebase.den = get_bits_long(&gb, 32);
-        timebase.num = get_bits_long(&gb, 32);
-        if (!(timebase.num > 0 && timebase.den > 0)) {
-            av_log(s, AV_LOG_WARNING, "Invalid time base in theora stream, assuming 25 FPS\n");
-            timebase.num = 1;
-            timebase.den = 25;
-        }
-        avpriv_set_pts_info(st, 64, timebase.num, timebase.den);
-
-        st->sample_aspect_ratio.num = get_bits_long(&gb, 24);
-        st->sample_aspect_ratio.den = get_bits_long(&gb, 24);
-
-        if (thp->version >= 0x030200)
-            skip_bits_long(&gb, 38);
-        if (thp->version >= 0x304000)
-            skip_bits(&gb, 2);
-
-        thp->gpshift = get_bits(&gb, 5);
-        thp->gpmask  = (1 << thp->gpshift) - 1;
-
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id   = AV_CODEC_ID_THEORA;
-        st->need_parsing      = AVSTREAM_PARSE_HEADERS;
-    }
-    break;
-    case 0x81:
-        ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7, os->psize - 7);
-    case 0x82:
-        if (!thp->version)
-            return AVERROR_INVALIDDATA;
-        break;
-    default:
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((err = av_reallocp(&st->codec->extradata,
-                           cds + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
-        st->codec->extradata_size = 0;
-        return err;
-    }
-    cdp    = st->codec->extradata + st->codec->extradata_size;
-    *cdp++ = os->psize >> 8;
-    *cdp++ = os->psize & 0xff;
-    memcpy(cdp, os->buf + os->pstart, os->psize);
-    st->codec->extradata_size = cds;
-
-    return 1;
-}
-
-static uint64_t theora_gptopts(AVFormatContext *ctx, int idx, uint64_t gp,
-                               int64_t *dts)
-{
-    struct ogg *ogg       = ctx->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    TheoraParams *thp     = os->private;
-    uint64_t iframe, pframe;
-
-    if (!thp)
-        return AV_NOPTS_VALUE;
-
-    iframe = gp >> thp->gpshift;
-    pframe = gp & thp->gpmask;
-
-    if (thp->version < 0x030201)
-        iframe++;
-
-    if (!pframe)
-        os->pflags |= AV_PKT_FLAG_KEY;
-
-    if (dts)
-        *dts = iframe + pframe;
-
-    return iframe + pframe;
-}
-
-const struct ogg_codec ff_theora_codec = {
-    .magic     = "\200theora",
-    .magicsize = 7,
-    .header    = theora_header,
-    .gptopts   = theora_gptopts,
-    .nb_header = 3,
-};
diff --git a/deps/libav/libavformat/oggparsevorbis.c b/deps/libav/libavformat/oggparsevorbis.c
deleted file mode 100644
index c19b545..0000000
--- a/deps/libav/libavformat/oggparsevorbis.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Copyright (C) 2005  Michael Ahlberg, Måns Rullgård
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be
- *  included in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- *  DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdlib.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/base64.h"
-#include "libavutil/bswap.h"
-#include "libavutil/dict.h"
-#include "libavcodec/bytestream.h"
-#include "libavcodec/get_bits.h"
-#include "libavcodec/vorbis_parser.h"
-#include "avformat.h"
-#include "flac_picture.h"
-#include "internal.h"
-#include "oggdec.h"
-#include "vorbiscomment.h"
-
-static int ogm_chapter(AVFormatContext *as, uint8_t *key, uint8_t *val)
-{
-    int i, cnum, h, m, s, ms, keylen = strlen(key);
-    AVChapter *chapter = NULL;
-
-    if (keylen < 9 || sscanf(key, "CHAPTER%03d", &cnum) != 1)
-        return 0;
-
-    if (keylen <= 10) {
-        if (sscanf(val, "%02d:%02d:%02d.%03d", &h, &m, &s, &ms) < 4)
-            return 0;
-
-        avpriv_new_chapter(as, cnum, (AVRational) { 1, 1000 },
-                           ms + 1000 * (s + 60 * (m + 60 * h)),
-                           AV_NOPTS_VALUE, NULL);
-        av_free(val);
-    } else if (!strcmp(key + keylen - 4, "NAME")) {
-        for (i = 0; i < as->nb_chapters; i++)
-            if (as->chapters[i]->id == cnum) {
-                chapter = as->chapters[i];
-                break;
-            }
-        if (!chapter)
-            return 0;
-
-        av_dict_set(&chapter->metadata, "title", val, AV_DICT_DONT_STRDUP_VAL);
-    } else
-        return 0;
-
-    av_free(key);
-    return 1;
-}
-
-int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
-                      const uint8_t *buf, int size)
-{
-    const uint8_t *p   = buf;
-    const uint8_t *end = buf + size;
-    unsigned n, j;
-    int s;
-
-    /* must have vendor_length and user_comment_list_length */
-    if (size < 8)
-        return AVERROR_INVALIDDATA;
-
-    s = bytestream_get_le32(&p);
-
-    if (end - p - 4 < s || s < 0)
-        return AVERROR_INVALIDDATA;
-
-    p += s;
-
-    n = bytestream_get_le32(&p);
-
-    while (end - p >= 4 && n > 0) {
-        const char *t, *v;
-        int tl, vl;
-
-        s = bytestream_get_le32(&p);
-
-        if (end - p < s || s < 0)
-            break;
-
-        t  = p;
-        p += s;
-        n--;
-
-        v = memchr(t, '=', s);
-        if (!v)
-            continue;
-
-        tl = v - t;
-        vl = s - tl - 1;
-        v++;
-
-        if (tl && vl) {
-            char *tt, *ct;
-
-            tt = av_malloc(tl + 1);
-            ct = av_malloc(vl + 1);
-            if (!tt || !ct) {
-                av_freep(&tt);
-                av_freep(&ct);
-                return AVERROR(ENOMEM);
-            }
-
-            for (j = 0; j < tl; j++)
-                tt[j] = av_toupper(t[j]);
-            tt[tl] = 0;
-
-            memcpy(ct, v, vl);
-            ct[vl] = 0;
-
-            /* The format in which the pictures are stored is the FLAC format.
-             * Xiph says: "The binary FLAC picture structure is base64 encoded
-             * and placed within a VorbisComment with the tag name
-             * 'METADATA_BLOCK_PICTURE'. This is the preferred and
-             * recommended way of embedding cover art within VorbisComments."
-             */
-            if (!strcmp(tt, "METADATA_BLOCK_PICTURE")) {
-                int ret;
-                char *pict = av_malloc(vl);
-
-                if (!pict) {
-                    av_freep(&tt);
-                    av_freep(&ct);
-                    return AVERROR(ENOMEM);
-                }
-                if ((ret = av_base64_decode(pict, ct, vl)) > 0)
-                    ret = ff_flac_parse_picture(as, pict, ret);
-                av_freep(&tt);
-                av_freep(&ct);
-                av_freep(&pict);
-                if (ret < 0) {
-                    av_log(as, AV_LOG_WARNING, "Failed to parse cover art block.\n");
-                    continue;
-                }
-            } else if (!ogm_chapter(as, tt, ct))
-                av_dict_set(m, tt, ct,
-                            AV_DICT_DONT_STRDUP_KEY |
-                            AV_DICT_DONT_STRDUP_VAL);
-        }
-    }
-
-    if (p != end)
-        av_log(as, AV_LOG_INFO,
-               "%ti bytes of comment header remain\n", end - p);
-    if (n > 0)
-        av_log(as, AV_LOG_INFO,
-               "truncated comment header, %i comments not found\n", n);
-
-    ff_metadata_conv(m, NULL, ff_vorbiscomment_metadata_conv);
-
-    return 0;
-}
-
-/*
- * Parse the vorbis header
- *
- * Vorbis Identification header from Vorbis_I_spec.html#vorbis-spec-codec
- * [vorbis_version] = read 32 bits as unsigned integer | Not used
- * [audio_channels] = read 8 bit integer as unsigned | Used
- * [audio_sample_rate] = read 32 bits as unsigned integer | Used
- * [bitrate_maximum] = read 32 bits as signed integer | Not used yet
- * [bitrate_nominal] = read 32 bits as signed integer | Not used yet
- * [bitrate_minimum] = read 32 bits as signed integer | Used as bitrate
- * [blocksize_0] = read 4 bits as unsigned integer | Not Used
- * [blocksize_1] = read 4 bits as unsigned integer | Not Used
- * [framing_flag] = read one bit | Not Used
- */
-
-struct oggvorbis_private {
-    unsigned int len[3];
-    unsigned char *packet[3];
-    VorbisParseContext vp;
-    int64_t final_pts;
-    int final_duration;
-};
-
-static int fixup_vorbis_headers(AVFormatContext *as,
-                                struct oggvorbis_private *priv,
-                                uint8_t **buf)
-{
-    int i, offset, len, err;
-    unsigned char *ptr;
-
-    len = priv->len[0] + priv->len[1] + priv->len[2];
-    ptr = *buf = av_mallocz(len + len / 255 + 64);
-    if (!ptr)
-        return AVERROR(ENOMEM);
-
-    ptr[0]  = 2;
-    offset  = 1;
-    offset += av_xiphlacing(&ptr[offset], priv->len[0]);
-    offset += av_xiphlacing(&ptr[offset], priv->len[1]);
-    for (i = 0; i < 3; i++) {
-        memcpy(&ptr[offset], priv->packet[i], priv->len[i]);
-        offset += priv->len[i];
-        av_freep(&priv->packet[i]);
-    }
-    if ((err = av_reallocp(buf, offset + FF_INPUT_BUFFER_PADDING_SIZE)) < 0)
-        return err;
-    return offset;
-}
-
-static void vorbis_cleanup(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    struct oggvorbis_private *priv = os->private;
-    int i;
-    if (os->private)
-        for (i = 0; i < 3; i++)
-            av_freep(&priv->packet[i]);
-}
-
-static int vorbis_header(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    AVStream *st    = s->streams[idx];
-    struct ogg_stream *os = ogg->streams + idx;
-    struct oggvorbis_private *priv;
-    int pkt_type = os->buf[os->pstart];
-
-    if (!os->private) {
-        os->private = av_mallocz(sizeof(struct oggvorbis_private));
-        if (!os->private)
-            return AVERROR(ENOMEM);
-    }
-
-    if (!(pkt_type & 1))
-        return 0;
-
-    if (os->psize < 1 || pkt_type > 5)
-        return AVERROR_INVALIDDATA;
-
-    priv = os->private;
-
-    if (priv->packet[pkt_type >> 1])
-        return AVERROR_INVALIDDATA;
-    if (pkt_type > 1 && !priv->packet[0] || pkt_type > 3 && !priv->packet[1])
-        return AVERROR_INVALIDDATA;
-
-    priv->len[pkt_type >> 1]    = os->psize;
-    priv->packet[pkt_type >> 1] = av_mallocz(os->psize);
-    if (!priv->packet[pkt_type >> 1])
-        return AVERROR(ENOMEM);
-    memcpy(priv->packet[pkt_type >> 1], os->buf + os->pstart, os->psize);
-    if (os->buf[os->pstart] == 1) {
-        const uint8_t *p = os->buf + os->pstart + 7; /* skip "\001vorbis" tag */
-        unsigned blocksize, bs0, bs1;
-        int srate;
-
-        if (os->psize != 30)
-            return AVERROR_INVALIDDATA;
-
-        if (bytestream_get_le32(&p) != 0) /* vorbis_version */
-            return AVERROR_INVALIDDATA;
-
-        st->codec->channels = bytestream_get_byte(&p);
-        srate               = bytestream_get_le32(&p);
-        p += 4; // skip maximum bitrate
-        st->codec->bit_rate = bytestream_get_le32(&p); // nominal bitrate
-        p += 4; // skip minimum bitrate
-
-        blocksize = bytestream_get_byte(&p);
-        bs0       = blocksize & 15;
-        bs1       = blocksize >> 4;
-
-        if (bs0 > bs1)
-            return AVERROR_INVALIDDATA;
-        if (bs0 < 6 || bs1 > 13)
-            return AVERROR_INVALIDDATA;
-
-        if (bytestream_get_byte(&p) != 1) /* framing_flag */
-            return AVERROR_INVALIDDATA;
-
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id   = AV_CODEC_ID_VORBIS;
-
-        if (srate > 0) {
-            st->codec->sample_rate = srate;
-            avpriv_set_pts_info(st, 64, 1, srate);
-        }
-    } else if (os->buf[os->pstart] == 3) {
-        if (os->psize > 8 &&
-            ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7,
-                              os->psize - 8) >= 0) {
-            // drop all metadata we parsed and which is not required by libvorbis
-            unsigned new_len = 7 + 4 + AV_RL32(priv->packet[1] + 7) + 4 + 1;
-            if (new_len >= 16 && new_len < os->psize) {
-                AV_WL32(priv->packet[1] + new_len - 5, 0);
-                priv->packet[1][new_len - 1] = 1;
-                priv->len[1]                 = new_len;
-            }
-        }
-    } else {
-        int ret = fixup_vorbis_headers(s, priv, &st->codec->extradata);
-        if (ret < 0) {
-            st->codec->extradata_size = 0;
-            return ret;
-        }
-        st->codec->extradata_size = ret;
-        if ((ret = avpriv_vorbis_parse_extradata(st->codec, &priv->vp))) {
-            av_freep(&st->codec->extradata);
-            st->codec->extradata_size = 0;
-            return ret;
-        }
-    }
-
-    return 1;
-}
-
-static int vorbis_packet(AVFormatContext *s, int idx)
-{
-    struct ogg *ogg = s->priv_data;
-    struct ogg_stream *os = ogg->streams + idx;
-    struct oggvorbis_private *priv = os->private;
-    int duration;
-
-    /* first packet handling
-     * here we parse the duration of each packet in the first page and compare
-     * the total duration to the page granule to find the encoder delay and
-     * set the first timestamp */
-    if (!os->lastpts) {
-        int seg;
-        uint8_t *last_pkt  = os->buf + os->pstart;
-        uint8_t *next_pkt  = last_pkt;
-        int first_duration = 0;
-
-        avpriv_vorbis_parse_reset(&priv->vp);
-        duration = 0;
-        for (seg = 0; seg < os->nsegs; seg++) {
-            if (os->segments[seg] < 255) {
-                int d = avpriv_vorbis_parse_frame(&priv->vp, last_pkt, 1);
-                if (d < 0) {
-                    duration = os->granule;
-                    break;
-                }
-                if (!duration)
-                    first_duration = d;
-                duration += d;
-                last_pkt  = next_pkt + os->segments[seg];
-            }
-            next_pkt += os->segments[seg];
-        }
-        os->lastpts                 =
-        os->lastdts                 = os->granule - duration;
-        s->streams[idx]->start_time = os->lastpts + first_duration;
-        if (s->streams[idx]->duration)
-            s->streams[idx]->duration -= s->streams[idx]->start_time;
-        s->streams[idx]->cur_dts = AV_NOPTS_VALUE;
-        priv->final_pts          = AV_NOPTS_VALUE;
-        avpriv_vorbis_parse_reset(&priv->vp);
-    }
-
-    /* parse packet duration */
-    if (os->psize > 0) {
-        duration = avpriv_vorbis_parse_frame(&priv->vp, os->buf + os->pstart, 1);
-        if (duration <= 0) {
-            os->pflags |= AV_PKT_FLAG_CORRUPT;
-            return 0;
-        }
-        os->pduration = duration;
-    }
-
-    /* final packet handling
-     * here we save the pts of the first packet in the final page, sum up all
-     * packet durations in the final page except for the last one, and compare
-     * to the page granule to find the duration of the final packet */
-    if (os->flags & OGG_FLAG_EOS) {
-        if (os->lastpts != AV_NOPTS_VALUE) {
-            priv->final_pts      = os->lastpts;
-            priv->final_duration = 0;
-        }
-        if (os->segp == os->nsegs)
-            os->pduration = os->granule - priv->final_pts - priv->final_duration;
-        priv->final_duration += os->pduration;
-    }
-
-    return 0;
-}
-
-const struct ogg_codec ff_vorbis_codec = {
-    .magic     = "\001vorbis",
-    .magicsize = 7,
-    .header    = vorbis_header,
-    .packet    = vorbis_packet,
-    .cleanup   = vorbis_cleanup,
-    .nb_header = 3,
-};
diff --git a/deps/libav/libavformat/oma.c b/deps/libav/libavformat/oma.c
deleted file mode 100644
index 27b5988..0000000
--- a/deps/libav/libavformat/oma.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Sony OpenMG (OMA) common data
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "internal.h"
-#include "oma.h"
-#include "libavcodec/avcodec.h"
-#include "libavutil/channel_layout.h"
-
-const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 };
-
-const AVCodecTag ff_oma_codec_tags[] = {
-    { AV_CODEC_ID_ATRAC3,      OMA_CODECID_ATRAC3  },
-    { AV_CODEC_ID_ATRAC3P,     OMA_CODECID_ATRAC3P },
-    { AV_CODEC_ID_MP3,         OMA_CODECID_MP3     },
-    { AV_CODEC_ID_PCM_S16BE,   OMA_CODECID_LPCM    },
-    { 0 },
-};
-
-/** map ATRAC-X channel id to internal channel layout */
-const uint64_t ff_oma_chid_to_native_layout[7] = {
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_5POINT1_BACK,
-    AV_CH_LAYOUT_6POINT1_BACK,
-    AV_CH_LAYOUT_7POINT1
-};
-
-/** map ATRAC-X channel id to total number of channels */
-const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8};
diff --git a/deps/libav/libavformat/oma.h b/deps/libav/libavformat/oma.h
deleted file mode 100644
index 9a35da2..0000000
--- a/deps/libav/libavformat/oma.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Sony OpenMG (OMA) common data
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_OMA_H
-#define AVFORMAT_OMA_H
-
-#include <stdint.h>
-
-#include "internal.h"
-
-#define EA3_HEADER_SIZE 96
-#define ID3v2_EA3_MAGIC "ea3"
-#define OMA_ENC_HEADER_SIZE 16
-
-enum {
-    OMA_CODECID_ATRAC3  = 0,
-    OMA_CODECID_ATRAC3P = 1,
-    OMA_CODECID_MP3     = 3,
-    OMA_CODECID_LPCM    = 4,
-    OMA_CODECID_WMA     = 5,
-};
-
-extern const uint16_t ff_oma_srate_tab[8];
-
-extern const AVCodecTag ff_oma_codec_tags[];
-
-extern const uint64_t ff_oma_chid_to_native_layout[7];
-extern const int ff_oma_chid_to_num_channels[7];
-
-#endif /* AVFORMAT_OMA_H */
diff --git a/deps/libav/libavformat/omadec.c b/deps/libav/libavformat/omadec.c
deleted file mode 100644
index 6c27458..0000000
--- a/deps/libav/libavformat/omadec.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * Sony OpenMG (OMA) demuxer
- *
- * Copyright (c) 2008, 2013 Maxim Poliakovski
- *               2008 Benjamin Larsson
- *               2011 David Goldwich
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This is a demuxer for Sony OpenMG Music files
- *
- * Known file extensions: ".oma", "aa3"
- * The format of such files consists of three parts:
- * - "ea3" header carrying overall info and metadata. Except for starting with
- *   "ea" instead of "ID", it's an ID3v2 header.
- * - "EA3" header is a Sony-specific header containing information about
- *   the OpenMG file: codec type (usually ATRAC, can also be MP3 or WMA),
- *   codec specific info (packet size, sample rate, channels and so on)
- *   and DRM related info (file encryption, content id).
- * - Sound data organized in packets follow the EA3 header
- *   (can be encrypted using the Sony DRM!).
- *
- * Supported decoders: ATRAC3, ATRAC3+, MP3, LPCM
- */
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-#include "internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/des.h"
-#include "oma.h"
-#include "pcm.h"
-#include "id3v2.h"
-
-
-static const uint64_t leaf_table[] = {
-    0xd79e8283acea4620, 0x7a9762f445afd0d8,
-    0x354d60a60b8c79f1, 0x584e1cde00b07aee,
-    0x1573cd93da7df623, 0x47f98d79620dd535
-};
-
-typedef struct OMAContext {
-    uint64_t content_start;
-    int encrypted;
-    uint16_t k_size;
-    uint16_t e_size;
-    uint16_t i_size;
-    uint16_t s_size;
-    uint32_t rid;
-    uint8_t r_val[24];
-    uint8_t n_val[24];
-    uint8_t m_val[8];
-    uint8_t s_val[8];
-    uint8_t sm_val[8];
-    uint8_t e_val[8];
-    uint8_t iv[8];
-    struct AVDES av_des;
-} OMAContext;
-
-static void hex_log(AVFormatContext *s, int level,
-                    const char *name, const uint8_t *value, int len)
-{
-    char buf[33];
-    len = FFMIN(len, 16);
-    if (av_log_get_level() < level)
-        return;
-    ff_data_to_hex(buf, value, len, 1);
-    buf[len << 1] = '\0';
-    av_log(s, level, "%s: %s\n", name, buf);
-}
-
-static int kset(AVFormatContext *s, const uint8_t *r_val, const uint8_t *n_val,
-                int len)
-{
-    OMAContext *oc = s->priv_data;
-
-    if (!r_val && !n_val)
-        return -1;
-
-    len = FFMIN(len, 16);
-
-    /* use first 64 bits in the third round again */
-    if (r_val) {
-        if (r_val != oc->r_val) {
-            memset(oc->r_val, 0, 24);
-            memcpy(oc->r_val, r_val, len);
-        }
-        memcpy(&oc->r_val[16], r_val, 8);
-    }
-    if (n_val) {
-        if (n_val != oc->n_val) {
-            memset(oc->n_val, 0, 24);
-            memcpy(oc->n_val, n_val, len);
-        }
-        memcpy(&oc->n_val[16], n_val, 8);
-    }
-
-    return 0;
-}
-
-#define OMA_RPROBE_M_VAL 48 + 1
-
-static int rprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size,
-                  const uint8_t *r_val)
-{
-    OMAContext *oc = s->priv_data;
-    unsigned int pos;
-    struct AVDES av_des;
-
-    if (!enc_header || !r_val ||
-        size < OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size ||
-        size < OMA_RPROBE_M_VAL)
-        return -1;
-
-    /* m_val */
-    av_des_init(&av_des, r_val, 192, 1);
-    av_des_crypt(&av_des, oc->m_val, &enc_header[48], 1, NULL, 1);
-
-    /* s_val */
-    av_des_init(&av_des, oc->m_val, 64, 0);
-    av_des_crypt(&av_des, oc->s_val, NULL, 1, NULL, 0);
-
-    /* sm_val */
-    pos = OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size;
-    av_des_init(&av_des, oc->s_val, 64, 0);
-    av_des_mac(&av_des, oc->sm_val, &enc_header[pos], (oc->i_size >> 3));
-
-    pos += oc->i_size;
-
-    return memcmp(&enc_header[pos], oc->sm_val, 8) ? -1 : 0;
-}
-
-static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size,
-                  const uint8_t *n_val)
-{
-    OMAContext *oc = s->priv_data;
-    uint64_t pos;
-    uint32_t taglen, datalen;
-    struct AVDES av_des;
-
-    if (!enc_header || !n_val ||
-        size < OMA_ENC_HEADER_SIZE + oc->k_size + 4)
-        return -1;
-
-    pos = OMA_ENC_HEADER_SIZE + oc->k_size;
-    if (!memcmp(&enc_header[pos], "EKB ", 4))
-        pos += 32;
-
-    if (size < pos + 44)
-        return -1;
-
-    if (AV_RB32(&enc_header[pos]) != oc->rid)
-        av_log(s, AV_LOG_DEBUG, "Mismatching RID\n");
-
-    taglen  = AV_RB32(&enc_header[pos + 32]);
-    datalen = AV_RB32(&enc_header[pos + 36]) >> 4;
-
-    pos += 44;
-    if (size - pos < taglen)
-        return -1;
-
-    pos += taglen;
-
-    if (datalen << 4 > size - pos)
-        return -1;
-
-    av_des_init(&av_des, n_val, 192, 1);
-    while (datalen-- > 0) {
-        av_des_crypt(&av_des, oc->r_val, &enc_header[pos], 2, NULL, 1);
-        kset(s, oc->r_val, NULL, 16);
-        if (!rprobe(s, enc_header, size, oc->r_val))
-            return 0;
-        pos += 16;
-    }
-
-    return -1;
-}
-
-static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
-{
-    OMAContext *oc = s->priv_data;
-    ID3v2ExtraMetaGEOB *geob = NULL;
-    uint8_t *gdata;
-
-    oc->encrypted = 1;
-    av_log(s, AV_LOG_INFO, "File is encrypted\n");
-
-    /* find GEOB metadata */
-    while (em) {
-        if (!strcmp(em->tag, "GEOB") &&
-            (geob = em->data) &&
-            (!strcmp(geob->description, "OMG_LSI") ||
-             !strcmp(geob->description, "OMG_BKLSI"))) {
-            break;
-        }
-        em = em->next;
-    }
-    if (!em) {
-        av_log(s, AV_LOG_ERROR, "No encryption header found\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (geob->datasize < 64) {
-        av_log(s, AV_LOG_ERROR,
-               "Invalid GEOB data size: %u\n", geob->datasize);
-        return AVERROR_INVALIDDATA;
-    }
-
-    gdata = geob->data;
-
-    if (AV_RB16(gdata) != 1)
-        av_log(s, AV_LOG_WARNING, "Unknown version in encryption header\n");
-
-    oc->k_size = AV_RB16(&gdata[2]);
-    oc->e_size = AV_RB16(&gdata[4]);
-    oc->i_size = AV_RB16(&gdata[6]);
-    oc->s_size = AV_RB16(&gdata[8]);
-
-    if (memcmp(&gdata[OMA_ENC_HEADER_SIZE], "KEYRING     ", 12)) {
-        av_log(s, AV_LOG_ERROR, "Invalid encryption header\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size + 8 > geob->datasize ||
-        OMA_ENC_HEADER_SIZE + 48 > geob->datasize) {
-        av_log(s, AV_LOG_ERROR, "Too little GEOB data\n");
-        return AVERROR_INVALIDDATA;
-    }
-    oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
-    av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid);
-
-    memcpy(oc->iv, &header[0x58], 8);
-    hex_log(s, AV_LOG_DEBUG, "IV", oc->iv, 8);
-
-    hex_log(s, AV_LOG_DEBUG, "CBC-MAC",
-            &gdata[OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size],
-            8);
-
-    if (s->keylen > 0) {
-        kset(s, s->key, s->key, s->keylen);
-    }
-    if (!memcmp(oc->r_val, (const uint8_t[8]){0}, 8) ||
-        rprobe(s, gdata, geob->datasize, oc->r_val) < 0 &&
-        nprobe(s, gdata, geob->datasize, oc->n_val) < 0) {
-        int i;
-        for (i = 0; i < FF_ARRAY_ELEMS(leaf_table); i += 2) {
-            uint8_t buf[16];
-            AV_WL64(buf,     leaf_table[i]);
-            AV_WL64(&buf[8], leaf_table[i + 1]);
-            kset(s, buf, buf, 16);
-            if (!rprobe(s, gdata, geob->datasize, oc->r_val) ||
-                !nprobe(s, gdata, geob->datasize, oc->n_val))
-                break;
-        }
-        if (i >= FF_ARRAY_ELEMS(leaf_table)) {
-            av_log(s, AV_LOG_ERROR, "Invalid key\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    /* e_val */
-    av_des_init(&oc->av_des, oc->m_val, 64, 0);
-    av_des_crypt(&oc->av_des, oc->e_val,
-                 &gdata[OMA_ENC_HEADER_SIZE + 40], 1, NULL, 0);
-    hex_log(s, AV_LOG_DEBUG, "EK", oc->e_val, 8);
-
-    /* init e_val */
-    av_des_init(&oc->av_des, oc->e_val, 64, 1);
-
-    return 0;
-}
-
-static int oma_read_header(AVFormatContext *s)
-{
-    int     ret, framesize, jsflag, samplerate;
-    uint32_t codec_params, channel_id;
-    int16_t eid;
-    uint8_t buf[EA3_HEADER_SIZE];
-    uint8_t *edata;
-    AVStream *st;
-    ID3v2ExtraMeta *extra_meta = NULL;
-    OMAContext *oc = s->priv_data;
-
-    ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta);
-    ret = avio_read(s->pb, buf, EA3_HEADER_SIZE);
-    if (ret < EA3_HEADER_SIZE)
-        return -1;
-
-    if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}), 3) ||
-        buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
-        av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    oc->content_start = avio_tell(s->pb);
-
-    /* encrypted file */
-    eid = AV_RB16(&buf[6]);
-    if (eid != -1 && eid != -128 && decrypt_init(s, extra_meta, buf) < 0) {
-        ff_id3v2_free_extra_meta(&extra_meta);
-        return -1;
-    }
-
-    ff_id3v2_free_extra_meta(&extra_meta);
-
-    codec_params = AV_RB24(&buf[33]);
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->start_time = 0;
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_tag  = buf[32];
-    st->codec->codec_id   = ff_codec_get_id(ff_oma_codec_tags,
-                                            st->codec->codec_tag);
-
-    switch (buf[32]) {
-    case OMA_CODECID_ATRAC3:
-        samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100;
-        if (!samplerate) {
-            av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (samplerate != 44100)
-            avpriv_request_sample(s, "Sample rate %d", samplerate);
-
-        framesize = (codec_params & 0x3FF) * 8;
-
-        /* get stereo coding mode, 1 for joint-stereo */
-        jsflag = (codec_params >> 17) & 1;
-
-        st->codec->channels    = 2;
-        st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-        st->codec->sample_rate = samplerate;
-        st->codec->bit_rate    = st->codec->sample_rate * framesize * 8 / 1024;
-
-        /* fake the ATRAC3 extradata
-         * (wav format, makes stream copy to wav work) */
-        st->codec->extradata_size = 14;
-        edata = av_mallocz(14 + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!edata)
-            return AVERROR(ENOMEM);
-
-        st->codec->extradata = edata;
-        AV_WL16(&edata[0],  1);             // always 1
-        AV_WL32(&edata[2],  samplerate);    // samples rate
-        AV_WL16(&edata[6],  jsflag);        // coding mode
-        AV_WL16(&edata[8],  jsflag);        // coding mode
-        AV_WL16(&edata[10], 1);             // always 1
-        // AV_WL16(&edata[12], 0);          // always 0
-
-        avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-        break;
-    case OMA_CODECID_ATRAC3P:
-        channel_id = (codec_params >> 10) & 7;
-        if (!channel_id) {
-            av_log(s, AV_LOG_ERROR,
-                   "Invalid ATRAC-X channel id: %d\n", channel_id);
-            return AVERROR_INVALIDDATA;
-        }
-        st->codec->channel_layout = ff_oma_chid_to_native_layout[channel_id - 1];
-        st->codec->channels       = ff_oma_chid_to_num_channels[channel_id - 1];
-        framesize = ((codec_params & 0x3FF) * 8) + 8;
-        samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100;
-        if (!samplerate) {
-            av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n");
-            return AVERROR_INVALIDDATA;
-        }
-        st->codec->sample_rate = samplerate;
-        st->codec->bit_rate    = samplerate * framesize * 8 / 2048;
-        avpriv_set_pts_info(st, 64, 1, samplerate);
-        break;
-    case OMA_CODECID_MP3:
-        st->need_parsing = AVSTREAM_PARSE_FULL;
-        framesize = 1024;
-        break;
-    case OMA_CODECID_LPCM:
-        /* PCM 44.1 kHz 16 bit stereo big-endian */
-        st->codec->channels = 2;
-        st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-        st->codec->sample_rate = 44100;
-        framesize = 1024;
-        /* bit rate = sample rate x PCM block align (= 4) x 8 */
-        st->codec->bit_rate = st->codec->sample_rate * 32;
-        st->codec->bits_per_coded_sample =
-            av_get_bits_per_sample(st->codec->codec_id);
-        avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "Unsupported codec %d!\n", buf[32]);
-        return AVERROR(ENOSYS);
-    }
-
-    st->codec->block_align = framesize;
-
-    return 0;
-}
-
-
-static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    OMAContext *oc = s->priv_data;
-    int packet_size = s->streams[0]->codec->block_align;
-    int ret = av_get_packet(s->pb, pkt, packet_size);
-
-    if (ret < packet_size)
-        pkt->flags |= AV_PKT_FLAG_CORRUPT;
-
-    if (ret < 0)
-        return ret;
-    if (!ret)
-        return AVERROR_EOF;
-
-    pkt->stream_index = 0;
-
-    if (oc->encrypted) {
-        /* previous unencrypted block saved in IV for
-         * the next packet (CBC mode) */
-        if (ret == packet_size)
-            av_des_crypt(&oc->av_des, pkt->data, pkt->data,
-                         (packet_size >> 3), oc->iv, 1);
-        else
-            memset(oc->iv, 0, 8);
-    }
-
-    return ret;
-}
-
-static int oma_read_probe(AVProbeData *p)
-{
-    const uint8_t *buf = p->buf;
-    unsigned tag_len = 0;
-
-    if (p->buf_size >= ID3v2_HEADER_SIZE && ff_id3v2_match(buf, ID3v2_EA3_MAGIC))
-        tag_len = ff_id3v2_tag_len(buf);
-
-    /* This check cannot overflow as tag_len has at most 28 bits */
-    if (p->buf_size < tag_len + 5)
-        /* EA3 header comes late, might be outside of the probe buffer */
-        return tag_len ? AVPROBE_SCORE_EXTENSION : 0;
-
-    buf += tag_len;
-
-    if (!memcmp(buf, "EA3", 3) && !buf[4] && buf[5] == EA3_HEADER_SIZE)
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int oma_read_seek(struct AVFormatContext *s,
-                         int stream_index, int64_t timestamp, int flags)
-{
-    OMAContext *oc = s->priv_data;
-    int err = ff_pcm_read_seek(s, stream_index, timestamp, flags);
-
-    if (!oc->encrypted)
-        return err;
-
-    /* readjust IV for CBC */
-    if (err || avio_tell(s->pb) < oc->content_start)
-        goto wipe;
-    if ((err = avio_seek(s->pb, -8, SEEK_CUR)) < 0)
-        goto wipe;
-    if ((err = avio_read(s->pb, oc->iv, 8)) < 8) {
-        if (err >= 0)
-            err = AVERROR_EOF;
-        goto wipe;
-    }
-
-    return 0;
-wipe:
-    memset(oc->iv, 0, 8);
-    return err;
-}
-
-AVInputFormat ff_oma_demuxer = {
-    .name           = "oma",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"),
-    .priv_data_size = sizeof(OMAContext),
-    .read_probe     = oma_read_probe,
-    .read_header    = oma_read_header,
-    .read_packet    = oma_read_packet,
-    .read_seek      = oma_read_seek,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "oma,omg,aa3",
-    .codec_tag      = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
-};
diff --git a/deps/libav/libavformat/omaenc.c b/deps/libav/libavformat/omaenc.c
deleted file mode 100644
index ea28e10..0000000
--- a/deps/libav/libavformat/omaenc.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Sony OpenMG (OMA) muxer
- *
- * Copyright (c) 2011 Michael Karcher
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "avio_internal.h"
-#include "id3v2.h"
-#include "internal.h"
-#include "oma.h"
-#include "rawenc.h"
-
-static av_cold int oma_write_header(AVFormatContext *s)
-{
-    int i;
-    AVCodecContext *format;
-    int srate_index;
-    int isjointstereo;
-
-    format = s->streams[0]->codec;
-    /* check for support of the format first */
-
-    for (srate_index = 0; ; srate_index++) {
-        if (ff_oma_srate_tab[srate_index] == 0) {
-            av_log(s, AV_LOG_ERROR, "Sample rate %d not supported in OpenMG audio\n",
-                   format->sample_rate);
-            return AVERROR(EINVAL);
-        }
-
-        if (ff_oma_srate_tab[srate_index] * 100 == format->sample_rate)
-            break;
-    }
-
-    /* Metadata; OpenMG does not support ID3v2.4 */
-    ff_id3v2_write_simple(s, 3, ID3v2_EA3_MAGIC);
-
-    ffio_wfourcc(s->pb, "EA3\0");
-    avio_w8(s->pb, EA3_HEADER_SIZE >> 7);
-    avio_w8(s->pb, EA3_HEADER_SIZE & 0x7F);
-    avio_wl16(s->pb, 0xFFFF);       /* not encrypted */
-    for (i = 0; i < 6; i++)
-        avio_wl32(s->pb, 0);        /* Padding + DRM id */
-
-    switch(format->codec_tag) {
-    case OMA_CODECID_ATRAC3:
-        if (format->channels != 2) {
-            av_log(s, AV_LOG_ERROR, "ATRAC3 in OMA is only supported with 2 channels");
-            return AVERROR(EINVAL);
-        }
-        if (format->extradata_size == 14) /* WAV format extradata */
-            isjointstereo = format->extradata[6] != 0;
-        else if(format->extradata_size == 10) /* RM format extradata */
-            isjointstereo = format->extradata[8] == 0x12;
-        else {
-            av_log(s, AV_LOG_ERROR, "ATRAC3: Unsupported extradata size\n");
-            return AVERROR(EINVAL);
-        }
-        avio_wb32(s->pb, (OMA_CODECID_ATRAC3 << 24) |
-                         (isjointstereo << 17) |
-                         (srate_index << 13) |
-                         (format->block_align/8));
-        break;
-    case OMA_CODECID_ATRAC3P:
-        avio_wb32(s->pb, (OMA_CODECID_ATRAC3P << 24) |
-                         (srate_index << 13) |
-                         (format->channels << 10) |
-                         (format->block_align/8 - 1));
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "OMA: unsupported codec tag %d for write\n",
-               format->codec_tag);
-    }
-    for (i = 0; i < (EA3_HEADER_SIZE - 36)/4; i++)
-        avio_wl32(s->pb, 0);        /* Padding */
-
-    return 0;
-}
-
-AVOutputFormat ff_oma_muxer = {
-    .name              = "oma",
-    .long_name         = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"),
-    .mime_type         = "audio/x-oma",
-    .extensions        = "oma",
-    .audio_codec       = AV_CODEC_ID_ATRAC3,
-    .write_header      = oma_write_header,
-    .write_packet      = ff_raw_write_packet,
-    .codec_tag         = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
-};
diff --git a/deps/libav/libavformat/options.c b/deps/libav/libavformat/options.c
deleted file mode 100644
index a5646df..0000000
--- a/deps/libav/libavformat/options.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avformat.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "libavutil/opt.h"
-
-/**
- * @file
- * Options definition for AVFormatContext.
- */
-
-#include "options_table.h"
-
-static const char* format_to_name(void* ptr)
-{
-    AVFormatContext* fc = (AVFormatContext*) ptr;
-    if(fc->iformat) return fc->iformat->name;
-    else if(fc->oformat) return fc->oformat->name;
-    else return "NULL";
-}
-
-static void *format_child_next(void *obj, void *prev)
-{
-    AVFormatContext *s = obj;
-    if (!prev && s->priv_data &&
-        ((s->iformat && s->iformat->priv_class) ||
-          s->oformat && s->oformat->priv_class))
-        return s->priv_data;
-    if (s->pb && s->pb->av_class && prev != s->pb)
-        return s->pb;
-    return NULL;
-}
-
-static const AVClass *format_child_class_next(const AVClass *prev)
-{
-    AVInputFormat  *ifmt = NULL;
-    AVOutputFormat *ofmt = NULL;
-
-    if (!prev)
-        return &ffio_url_class;
-
-    while ((ifmt = av_iformat_next(ifmt)))
-        if (ifmt->priv_class == prev)
-            break;
-
-    if (!ifmt)
-        while ((ofmt = av_oformat_next(ofmt)))
-            if (ofmt->priv_class == prev)
-                break;
-    if (!ofmt)
-        while (ifmt = av_iformat_next(ifmt))
-            if (ifmt->priv_class)
-                return ifmt->priv_class;
-
-    while (ofmt = av_oformat_next(ofmt))
-        if (ofmt->priv_class)
-            return ofmt->priv_class;
-
-    return NULL;
-}
-
-static const AVClass av_format_context_class = {
-    .class_name     = "AVFormatContext",
-    .item_name      = format_to_name,
-    .option         = avformat_options,
-    .version        = LIBAVUTIL_VERSION_INT,
-    .child_next     = format_child_next,
-    .child_class_next = format_child_class_next,
-};
-
-static void avformat_get_context_defaults(AVFormatContext *s)
-{
-    memset(s, 0, sizeof(AVFormatContext));
-
-    s->av_class = &av_format_context_class;
-
-    av_opt_set_defaults(s);
-}
-
-AVFormatContext *avformat_alloc_context(void)
-{
-    AVFormatContext *ic;
-    ic = av_malloc(sizeof(AVFormatContext));
-    if (!ic) return ic;
-    avformat_get_context_defaults(ic);
-
-    ic->internal = av_mallocz(sizeof(*ic->internal));
-    if (!ic->internal) {
-        avformat_free_context(ic);
-        return NULL;
-    }
-
-    return ic;
-}
-
-const AVClass *avformat_get_class(void)
-{
-    return &av_format_context_class;
-}
diff --git a/deps/libav/libavformat/options_table.h b/deps/libav/libavformat/options_table.h
deleted file mode 100644
index cc84e1c..0000000
--- a/deps/libav/libavformat/options_table.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_OPTIONS_TABLE_H
-#define AVFORMAT_OPTIONS_TABLE_H
-
-#include <limits.h>
-
-#include "libavutil/opt.h"
-#include "avformat.h"
-
-#define OFFSET(x) offsetof(AVFormatContext,x)
-#define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C
-//these names are too long to be readable
-#define E AV_OPT_FLAG_ENCODING_PARAM
-#define D AV_OPT_FLAG_DECODING_PARAM
-
-static const AVOption avformat_options[] = {
-{"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT, {.i64 = 5000000 }, 32, INT_MAX, D},
-{"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, E},
-{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, D|E, "fflags"},
-{"flush_packets", "reduce the latency by flushing out packets immediately", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, D, "fflags"},
-{"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNIDX }, INT_MIN, INT_MAX, D, "fflags"},
-{"genpts", "generate pts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_GENPTS }, INT_MIN, INT_MAX, D, "fflags"},
-{"nofillin", "do not fill in missing values that can be exactly calculated", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOFILLIN }, INT_MIN, INT_MAX, D, "fflags"},
-{"noparse", "disable AVParsers, this needs nofillin too", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOPARSE }, INT_MIN, INT_MAX, D, "fflags"},
-{"igndts", "ignore dts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNDTS }, INT_MIN, INT_MAX, D, "fflags"},
-{"discardcorrupt", "discard corrupted frames", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_DISCARD_CORRUPT }, INT_MIN, INT_MAX, D, "fflags"},
-{"nobuffer", "reduce the latency introduced by optional buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOBUFFER }, 0, INT_MAX, D, "fflags"},
-{"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT, {.i64 = 5*AV_TIME_BASE }, 0, INT_MAX, D},
-{"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D},
-{"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), AV_OPT_TYPE_INT, {.i64 = 1<<20 }, 0, INT_MAX, D},
-{"rtbufsize", "max memory used for buffering real-time frames", OFFSET(max_picture_buffer), AV_OPT_TYPE_INT, {.i64 = 3041280 }, 0, INT_MAX, D}, /* defaults to 1s of 15fps 352x288 YUYV422 video */
-{"fdebug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, 0, INT_MAX, E|D, "fdebug"},
-{"ts", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_FDEBUG_TS }, INT_MIN, INT_MAX, E|D, "fdebug"},
-{"max_delay", "maximum muxing or demuxing delay in microseconds", OFFSET(max_delay), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, INT_MAX, E|D},
-{"fpsprobesize", "number of frames used to probe fps", OFFSET(fps_probe_size), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX-1, D},
-/* this is a crutch for avconv, since it cannot deal with identically named options in different contexts.
- * to be removed when avconv is fixed */
-{"f_err_detect", "set error detection flags (deprecated; use err_detect, save via avconv)", OFFSET(error_recognition), AV_OPT_TYPE_FLAGS, {.i64 = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, D, "err_detect"},
-{"err_detect", "set error detection flags", OFFSET(error_recognition), AV_OPT_TYPE_FLAGS, {.i64 = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, D, "err_detect"},
-{"crccheck", "verify embedded CRCs", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, D, "err_detect"},
-{"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, D, "err_detect"},
-{"buffer", "detect improper bitstream length", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BUFFER }, INT_MIN, INT_MAX, D, "err_detect"},
-{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, D, "err_detect"},
-{"max_interleave_delta", "maximum buffering duration for interleaving", OFFSET(max_interleave_delta), AV_OPT_TYPE_INT64, { .i64 = 10000000 }, 0, INT64_MAX, E },
-{NULL},
-};
-
-#undef E
-#undef D
-#undef DEFAULT
-#undef OFFSET
-
-#endif /* AVFORMAT_OPTIONS_TABLE_H */
diff --git a/deps/libav/libavformat/os_support.c b/deps/libav/libavformat/os_support.c
deleted file mode 100644
index 650baea..0000000
--- a/deps/libav/libavformat/os_support.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * various OS-feature replacement utilities
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * copyright (c) 2002 Francois Revol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* needed by inet_aton() */
-#define _SVID_SOURCE
-
-#include "config.h"
-#include "avformat.h"
-#include "os_support.h"
-
-#if CONFIG_NETWORK
-#include <fcntl.h>
-#if !HAVE_POLL_H
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif /* HAVE_SYS_TIME_H */
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#elif HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif /* HAVE_WINSOCK2_H */
-#endif /* !HAVE_POLL_H */
-
-#include "network.h"
-
-#if !HAVE_INET_ATON
-#include <stdlib.h>
-
-int ff_inet_aton(const char *str, struct in_addr *add)
-{
-    unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
-
-    if (sscanf(str, "%d.%d.%d.%d", &add1, &add2, &add3, &add4) != 4)
-        return 0;
-
-    if (!add1 || (add1 | add2 | add3 | add4) > 255)
-        return 0;
-
-    add->s_addr = htonl((add1 << 24) + (add2 << 16) + (add3 << 8) + add4);
-
-    return 1;
-}
-#else
-int ff_inet_aton(const char *str, struct in_addr *add)
-{
-    return inet_aton(str, add);
-}
-#endif /* !HAVE_INET_ATON */
-
-#if !HAVE_GETADDRINFO
-int ff_getaddrinfo(const char *node, const char *service,
-                   const struct addrinfo *hints, struct addrinfo **res)
-{
-    struct hostent *h = NULL;
-    struct addrinfo *ai;
-    struct sockaddr_in *sin;
-
-#if HAVE_WINSOCK2_H
-    int (WSAAPI *win_getaddrinfo)(const char *node, const char *service,
-                                  const struct addrinfo *hints,
-                                  struct addrinfo **res);
-    HMODULE ws2mod = GetModuleHandle("ws2_32.dll");
-    win_getaddrinfo = GetProcAddress(ws2mod, "getaddrinfo");
-    if (win_getaddrinfo)
-        return win_getaddrinfo(node, service, hints, res);
-#endif /* HAVE_WINSOCK2_H */
-
-    *res = NULL;
-    sin  = av_mallocz(sizeof(struct sockaddr_in));
-    if (!sin)
-        return EAI_FAIL;
-    sin->sin_family = AF_INET;
-
-    if (node) {
-        if (!ff_inet_aton(node, &sin->sin_addr)) {
-            if (hints && (hints->ai_flags & AI_NUMERICHOST)) {
-                av_free(sin);
-                return EAI_FAIL;
-            }
-            h = gethostbyname(node);
-            if (!h) {
-                av_free(sin);
-                return EAI_FAIL;
-            }
-            memcpy(&sin->sin_addr, h->h_addr_list[0], sizeof(struct in_addr));
-        }
-    } else {
-        if (hints && (hints->ai_flags & AI_PASSIVE))
-            sin->sin_addr.s_addr = INADDR_ANY;
-        else
-            sin->sin_addr.s_addr = INADDR_LOOPBACK;
-    }
-
-    /* Note: getaddrinfo allows service to be a string, which
-     * should be looked up using getservbyname. */
-    if (service)
-        sin->sin_port = htons(atoi(service));
-
-    ai = av_mallocz(sizeof(struct addrinfo));
-    if (!ai) {
-        av_free(sin);
-        return EAI_FAIL;
-    }
-
-    *res            = ai;
-    ai->ai_family   = AF_INET;
-    ai->ai_socktype = hints ? hints->ai_socktype : 0;
-    switch (ai->ai_socktype) {
-    case SOCK_STREAM:
-        ai->ai_protocol = IPPROTO_TCP;
-        break;
-    case SOCK_DGRAM:
-        ai->ai_protocol = IPPROTO_UDP;
-        break;
-    default:
-        ai->ai_protocol = 0;
-        break;
-    }
-
-    ai->ai_addr    = (struct sockaddr *)sin;
-    ai->ai_addrlen = sizeof(struct sockaddr_in);
-    if (hints && (hints->ai_flags & AI_CANONNAME))
-        ai->ai_canonname = h ? av_strdup(h->h_name) : NULL;
-
-    ai->ai_next = NULL;
-    return 0;
-}
-
-void ff_freeaddrinfo(struct addrinfo *res)
-{
-#if HAVE_WINSOCK2_H
-    void (WSAAPI *win_freeaddrinfo)(struct addrinfo *res);
-    HMODULE ws2mod = GetModuleHandle("ws2_32.dll");
-    win_freeaddrinfo = (void (WSAAPI *)(struct addrinfo *res))
-                       GetProcAddress(ws2mod, "freeaddrinfo");
-    if (win_freeaddrinfo) {
-        win_freeaddrinfo(res);
-        return;
-    }
-#endif /* HAVE_WINSOCK2_H */
-
-    av_free(res->ai_canonname);
-    av_free(res->ai_addr);
-    av_free(res);
-}
-
-int ff_getnameinfo(const struct sockaddr *sa, int salen,
-                   char *host, int hostlen,
-                   char *serv, int servlen, int flags)
-{
-    const struct sockaddr_in *sin = (const struct sockaddr_in *)sa;
-
-#if HAVE_WINSOCK2_H
-    int (WSAAPI *win_getnameinfo)(const struct sockaddr *sa, socklen_t salen,
-                                  char *host, DWORD hostlen,
-                                  char *serv, DWORD servlen, int flags);
-    HMODULE ws2mod = GetModuleHandle("ws2_32.dll");
-    win_getnameinfo = GetProcAddress(ws2mod, "getnameinfo");
-    if (win_getnameinfo)
-        return win_getnameinfo(sa, salen, host, hostlen, serv, servlen, flags);
-#endif /* HAVE_WINSOCK2_H */
-
-    if (sa->sa_family != AF_INET)
-        return EAI_FAMILY;
-    if (!host && !serv)
-        return EAI_NONAME;
-
-    if (host && hostlen > 0) {
-        struct hostent *ent = NULL;
-        uint32_t a;
-        if (!(flags & NI_NUMERICHOST))
-            ent = gethostbyaddr((const char *)&sin->sin_addr,
-                                sizeof(sin->sin_addr), AF_INET);
-
-        if (ent) {
-            snprintf(host, hostlen, "%s", ent->h_name);
-        } else if (flags & NI_NAMERQD) {
-            return EAI_NONAME;
-        } else {
-            a = ntohl(sin->sin_addr.s_addr);
-            snprintf(host, hostlen, "%d.%d.%d.%d",
-                     ((a >> 24) & 0xff), ((a >> 16) & 0xff),
-                     ((a >>  8) & 0xff),  (a        & 0xff));
-        }
-    }
-
-    if (serv && servlen > 0) {
-        struct servent *ent = NULL;
-#if HAVE_GETSERVBYPORT
-        if (!(flags & NI_NUMERICSERV))
-            ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : "tcp");
-#endif /* HAVE_GETSERVBYPORT */
-
-        if (ent)
-            snprintf(serv, servlen, "%s", ent->s_name);
-        else
-            snprintf(serv, servlen, "%d", ntohs(sin->sin_port));
-    }
-
-    return 0;
-}
-#endif /* !HAVE_GETADDRINFO */
-
-#if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H
-const char *ff_gai_strerror(int ecode)
-{
-    switch (ecode) {
-    case EAI_AGAIN:
-        return "Temporary failure in name resolution";
-    case EAI_BADFLAGS:
-        return "Invalid flags for ai_flags";
-    case EAI_FAIL:
-        return "A non-recoverable error occurred";
-    case EAI_FAMILY:
-        return "The address family was not recognized or the address "
-               "length was invalid for the specified family";
-    case EAI_MEMORY:
-        return "Memory allocation failure";
-#if EAI_NODATA != EAI_NONAME
-    case EAI_NODATA:
-        return "No address associated with hostname";
-#endif /* EAI_NODATA != EAI_NONAME */
-    case EAI_NONAME:
-        return "The name does not resolve for the supplied parameters";
-    case EAI_SERVICE:
-        return "servname not supported for ai_socktype";
-    case EAI_SOCKTYPE:
-        return "ai_socktype not supported";
-    }
-
-    return "Unknown error";
-}
-#endif /* !HAVE_GETADDRINFO || HAVE_WINSOCK2_H */
-
-int ff_socket_nonblock(int socket, int enable)
-{
-#if HAVE_WINSOCK2_H
-    u_long param = enable;
-    return ioctlsocket(socket, FIONBIO, &param);
-#else
-    if (enable)
-        return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);
-    else
-        return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) & ~O_NONBLOCK);
-#endif /* HAVE_WINSOCK2_H */
-}
-
-#if !HAVE_POLL_H
-int ff_poll(struct pollfd *fds, nfds_t numfds, int timeout)
-{
-    fd_set read_set;
-    fd_set write_set;
-    fd_set exception_set;
-    nfds_t i;
-    int n;
-    int rc;
-
-#if HAVE_WINSOCK2_H
-    if (numfds >= FD_SETSIZE) {
-        errno = EINVAL;
-        return -1;
-    }
-#endif /* HAVE_WINSOCK2_H */
-
-    FD_ZERO(&read_set);
-    FD_ZERO(&write_set);
-    FD_ZERO(&exception_set);
-
-    n = 0;
-    for (i = 0; i < numfds; i++) {
-        if (fds[i].fd < 0)
-            continue;
-#if !HAVE_WINSOCK2_H
-        if (fds[i].fd >= FD_SETSIZE) {
-            errno = EINVAL;
-            return -1;
-        }
-#endif /* !HAVE_WINSOCK2_H */
-
-        if (fds[i].events & POLLIN)
-            FD_SET(fds[i].fd, &read_set);
-        if (fds[i].events & POLLOUT)
-            FD_SET(fds[i].fd, &write_set);
-        if (fds[i].events & POLLERR)
-            FD_SET(fds[i].fd, &exception_set);
-
-        if (fds[i].fd >= n)
-            n = fds[i].fd + 1;
-    }
-
-    if (n == 0)
-        /* Hey!? Nothing to poll, in fact!!! */
-        return 0;
-
-    if (timeout < 0) {
-        rc = select(n, &read_set, &write_set, &exception_set, NULL);
-    } else {
-        struct timeval tv;
-        tv.tv_sec  = timeout / 1000;
-        tv.tv_usec = 1000 * (timeout % 1000);
-        rc         = select(n, &read_set, &write_set, &exception_set, &tv);
-    }
-
-    if (rc < 0)
-        return rc;
-
-    for (i = 0; i < numfds; i++) {
-        fds[i].revents = 0;
-
-        if (FD_ISSET(fds[i].fd, &read_set))
-            fds[i].revents |= POLLIN;
-        if (FD_ISSET(fds[i].fd, &write_set))
-            fds[i].revents |= POLLOUT;
-        if (FD_ISSET(fds[i].fd, &exception_set))
-            fds[i].revents |= POLLERR;
-    }
-
-    return rc;
-}
-#endif /* !HAVE_POLL_H */
-
-#endif /* CONFIG_NETWORK */
diff --git a/deps/libav/libavformat/os_support.h b/deps/libav/libavformat/os_support.h
deleted file mode 100644
index ae8cef7..0000000
--- a/deps/libav/libavformat/os_support.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * various OS-feature replacement utilities
- * copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_OS_SUPPORT_H
-#define AVFORMAT_OS_SUPPORT_H
-
-/**
- * @file
- * miscellaneous OS support macros and functions.
- */
-
-#include "config.h"
-
-#include <sys/stat.h>
-
-#if defined(_WIN32) && !defined(__MINGW32CE__)
-#  include <fcntl.h>
-#  define lseek(f,p,w) _lseeki64((f), (p), (w))
-#  define stat _stati64
-#  define fstat(f,s) _fstati64((f), (s))
-#endif /* defined(__MINGW32__) && !defined(__MINGW32CE__) */
-
-#ifdef _WIN32
-#if HAVE_DIRECT_H
-#include <direct.h>
-#elif HAVE_IO_H
-#include <io.h>
-#endif
-#define mkdir(a, b) _mkdir(a)
-#else
-#include <sys/stat.h>
-#endif
-
-static inline int is_dos_path(const char *path)
-{
-#if HAVE_DOS_PATHS
-    if (path[0] && path[1] == ':')
-        return 1;
-#endif
-    return 0;
-}
-
-#if defined(__OS2__) || defined(__Plan9__)
-#define SHUT_RD 0
-#define SHUT_WR 1
-#define SHUT_RDWR 2
-#endif
-
-#if defined(_WIN32)
-#define SHUT_RD SD_RECEIVE
-#define SHUT_WR SD_SEND
-#define SHUT_RDWR SD_BOTH
-
-#ifndef S_IRUSR
-#define S_IRUSR S_IREAD
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR S_IWRITE
-#endif
-#endif
-
-#if CONFIG_NETWORK
-#if !HAVE_SOCKLEN_T
-typedef int socklen_t;
-#endif
-
-/* most of the time closing a socket is just closing an fd */
-#if !HAVE_CLOSESOCKET
-#define closesocket close
-#endif
-
-#if !HAVE_POLL_H
-typedef unsigned long nfds_t;
-
-#if HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#if !HAVE_STRUCT_POLLFD
-struct pollfd {
-    int fd;
-    short events;  /* events to look for */
-    short revents; /* events that occurred */
-};
-
-/* events & revents */
-#define POLLIN     0x0001  /* any readable data available */
-#define POLLOUT    0x0002  /* file descriptor is writeable */
-#define POLLRDNORM POLLIN
-#define POLLWRNORM POLLOUT
-#define POLLRDBAND 0x0008  /* priority readable data */
-#define POLLWRBAND 0x0010  /* priority data can be written */
-#define POLLPRI    0x0020  /* high priority readable data */
-
-/* revents only */
-#define POLLERR    0x0004  /* errors pending */
-#define POLLHUP    0x0080  /* disconnected */
-#define POLLNVAL   0x1000  /* invalid file descriptor */
-#endif
-
-
-int ff_poll(struct pollfd *fds, nfds_t numfds, int timeout);
-#define poll ff_poll
-#endif /* HAVE_POLL_H */
-#endif /* CONFIG_NETWORK */
-
-#endif /* AVFORMAT_OS_SUPPORT_H */
diff --git a/deps/libav/libavformat/pcm.c b/deps/libav/libavformat/pcm.c
deleted file mode 100644
index 892e8ca..0000000
--- a/deps/libav/libavformat/pcm.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * PCM common functions
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "pcm.h"
-
-int ff_pcm_read_seek(AVFormatContext *s,
-                     int stream_index, int64_t timestamp, int flags)
-{
-    AVStream *st;
-    int block_align, byte_rate;
-    int64_t pos, ret;
-
-    st = s->streams[0];
-
-    block_align = st->codec->block_align ? st->codec->block_align :
-        (av_get_bits_per_sample(st->codec->codec_id) * st->codec->channels) >> 3;
-    byte_rate = st->codec->bit_rate ? st->codec->bit_rate >> 3 :
-        block_align * st->codec->sample_rate;
-
-    if (block_align <= 0 || byte_rate <= 0)
-        return -1;
-    if (timestamp < 0) timestamp = 0;
-
-    /* compute the position by aligning it to block_align */
-    pos = av_rescale_rnd(timestamp * byte_rate,
-                         st->time_base.num,
-                         st->time_base.den * (int64_t)block_align,
-                         (flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP);
-    pos *= block_align;
-
-    /* recompute exact position */
-    st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);
-    if ((ret = avio_seek(s->pb, pos + s->data_offset, SEEK_SET)) < 0)
-        return ret;
-    return 0;
-}
diff --git a/deps/libav/libavformat/pcm.h b/deps/libav/libavformat/pcm.h
deleted file mode 100644
index 30cbc86..0000000
--- a/deps/libav/libavformat/pcm.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * PCM common functions
- * Copyright (C) 2007  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_PCM_H
-#define AVFORMAT_PCM_H
-
-#include "avformat.h"
-
-int ff_pcm_read_seek(AVFormatContext *s,
-                     int stream_index, int64_t timestamp, int flags);
-
-#endif /* AVFORMAT_PCM_H */
diff --git a/deps/libav/libavformat/pcmdec.c b/deps/libav/libavformat/pcmdec.c
deleted file mode 100644
index 1bbbc66..0000000
--- a/deps/libav/libavformat/pcmdec.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * RAW PCM demuxers
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "pcm.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-
-#define RAW_SAMPLES     1024
-
-typedef struct PCMAudioDemuxerContext {
-    AVClass *class;
-    int sample_rate;
-    int channels;
-} PCMAudioDemuxerContext;
-
-static int pcm_read_header(AVFormatContext *s)
-{
-    PCMAudioDemuxerContext *s1 = s->priv_data;
-    AVStream *st;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id    = s->iformat->raw_codec_id;
-    st->codec->sample_rate = s1->sample_rate;
-    st->codec->channels    = s1->channels;
-
-    st->codec->bits_per_coded_sample =
-        av_get_bits_per_sample(st->codec->codec_id);
-
-    assert(st->codec->bits_per_coded_sample > 0);
-
-    st->codec->block_align =
-        st->codec->bits_per_coded_sample * st->codec->channels / 8;
-
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    return 0;
-}
-
-static int pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, size, bps;
-    //    AVStream *st = s->streams[0];
-
-    size= RAW_SAMPLES*s->streams[0]->codec->block_align;
-
-    ret= av_get_packet(s->pb, pkt, size);
-
-    pkt->stream_index = 0;
-    if (ret < 0)
-        return ret;
-
-    bps= av_get_bits_per_sample(s->streams[0]->codec->codec_id);
-    if (!bps) {
-        av_log(s, AV_LOG_ERROR, "Unknown number of bytes per sample.\n");
-        return AVERROR(EINVAL);
-    }
-
-    pkt->dts=
-    pkt->pts= pkt->pos*8 / (bps * s->streams[0]->codec->channels);
-
-    return ret;
-}
-
-static const AVOption pcm_options[] = {
-    { "sample_rate", "", offsetof(PCMAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { "channels",    "", offsetof(PCMAudioDemuxerContext, channels),    AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
-#define PCMDEF(name_, long_name_, ext, codec)               \
-static const AVClass name_ ## _demuxer_class = {            \
-    .class_name = #name_ " demuxer",                        \
-    .item_name  = av_default_item_name,                     \
-    .option     = pcm_options,                              \
-    .version    = LIBAVUTIL_VERSION_INT,                    \
-};                                                          \
-AVInputFormat ff_pcm_ ## name_ ## _demuxer = {              \
-    .name           = #name_,                               \
-    .long_name      = NULL_IF_CONFIG_SMALL(long_name_),     \
-    .priv_data_size = sizeof(PCMAudioDemuxerContext),       \
-    .read_header    = pcm_read_header,                      \
-    .read_packet    = pcm_read_packet,                      \
-    .read_seek      = ff_pcm_read_seek,                     \
-    .flags          = AVFMT_GENERIC_INDEX,                  \
-    .extensions     = ext,                                  \
-    .raw_codec_id   = codec,                                \
-    .priv_class     = &name_ ## _demuxer_class,             \
-};
-
-PCMDEF(f64be, "PCM 64-bit floating-point big-endian",
-       NULL, AV_CODEC_ID_PCM_F64BE)
-
-PCMDEF(f64le, "PCM 64-bit floating-point little-endian",
-       NULL, AV_CODEC_ID_PCM_F64LE)
-
-PCMDEF(f32be, "PCM 32-bit floating-point big-endian",
-       NULL, AV_CODEC_ID_PCM_F32BE)
-
-PCMDEF(f32le, "PCM 32-bit floating-point little-endian",
-       NULL, AV_CODEC_ID_PCM_F32LE)
-
-PCMDEF(s32be, "PCM signed 32-bit big-endian",
-       NULL, AV_CODEC_ID_PCM_S32BE)
-
-PCMDEF(s32le, "PCM signed 32-bit little-endian",
-       NULL, AV_CODEC_ID_PCM_S32LE)
-
-PCMDEF(s24be, "PCM signed 24-bit big-endian",
-       NULL, AV_CODEC_ID_PCM_S24BE)
-
-PCMDEF(s24le, "PCM signed 24-bit little-endian",
-       NULL, AV_CODEC_ID_PCM_S24LE)
-
-PCMDEF(s16be, "PCM signed 16-bit big-endian",
-       AV_NE("sw", NULL), AV_CODEC_ID_PCM_S16BE)
-
-PCMDEF(s16le, "PCM signed 16-bit little-endian",
-       AV_NE(NULL, "sw"), AV_CODEC_ID_PCM_S16LE)
-
-PCMDEF(s8, "PCM signed 8-bit",
-       "sb", AV_CODEC_ID_PCM_S8)
-
-PCMDEF(u32be, "PCM unsigned 32-bit big-endian",
-       NULL, AV_CODEC_ID_PCM_U32BE)
-
-PCMDEF(u32le, "PCM unsigned 32-bit little-endian",
-       NULL, AV_CODEC_ID_PCM_U32LE)
-
-PCMDEF(u24be, "PCM unsigned 24-bit big-endian",
-       NULL, AV_CODEC_ID_PCM_U24BE)
-
-PCMDEF(u24le, "PCM unsigned 24-bit little-endian",
-       NULL, AV_CODEC_ID_PCM_U24LE)
-
-PCMDEF(u16be, "PCM unsigned 16-bit big-endian",
-       AV_NE("uw", NULL), AV_CODEC_ID_PCM_U16BE)
-
-PCMDEF(u16le, "PCM unsigned 16-bit little-endian",
-       AV_NE(NULL, "uw"), AV_CODEC_ID_PCM_U16LE)
-
-PCMDEF(u8, "PCM unsigned 8-bit",
-       "ub", AV_CODEC_ID_PCM_U8)
-
-PCMDEF(alaw, "PCM A-law",
-       "al", AV_CODEC_ID_PCM_ALAW)
-
-PCMDEF(mulaw, "PCM mu-law",
-       "ul", AV_CODEC_ID_PCM_MULAW)
diff --git a/deps/libav/libavformat/pcmenc.c b/deps/libav/libavformat/pcmenc.c
deleted file mode 100644
index e45ab84..0000000
--- a/deps/libav/libavformat/pcmenc.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * RAW PCM muxers
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawenc.h"
-
-#define PCMDEF(name_, long_name_, ext, codec)               \
-AVOutputFormat ff_pcm_ ## name_ ## _muxer = {               \
-    .name         = #name_,                                 \
-    .long_name    = NULL_IF_CONFIG_SMALL(long_name_),       \
-    .extensions   = ext,                                    \
-    .audio_codec  = codec,                                  \
-    .video_codec  = AV_CODEC_ID_NONE,                          \
-    .write_packet = ff_raw_write_packet,                    \
-    .flags        = AVFMT_NOTIMESTAMPS,                     \
-};
-
-PCMDEF(f64be, "PCM 64-bit floating-point big-endian",
-       NULL, AV_CODEC_ID_PCM_F64BE)
-
-PCMDEF(f64le, "PCM 64-bit floating-point little-endian",
-       NULL, AV_CODEC_ID_PCM_F64LE)
-
-PCMDEF(f32be, "PCM 32-bit floating-point big-endian",
-       NULL, AV_CODEC_ID_PCM_F32BE)
-
-PCMDEF(f32le, "PCM 32-bit floating-point little-endian",
-       NULL, AV_CODEC_ID_PCM_F32LE)
-
-PCMDEF(s32be, "PCM signed 32-bit big-endian",
-       NULL, AV_CODEC_ID_PCM_S32BE)
-
-PCMDEF(s32le, "PCM signed 32-bit little-endian",
-       NULL, AV_CODEC_ID_PCM_S32LE)
-
-PCMDEF(s24be, "PCM signed 24-bit big-endian",
-       NULL, AV_CODEC_ID_PCM_S24BE)
-
-PCMDEF(s24le, "PCM signed 24-bit little-endian",
-       NULL, AV_CODEC_ID_PCM_S24LE)
-
-PCMDEF(s16be, "PCM signed 16-bit big-endian",
-       AV_NE("sw", NULL), AV_CODEC_ID_PCM_S16BE)
-
-PCMDEF(s16le, "PCM signed 16-bit little-endian",
-       AV_NE(NULL, "sw"), AV_CODEC_ID_PCM_S16LE)
-
-PCMDEF(s8, "PCM signed 8-bit",
-       "sb", AV_CODEC_ID_PCM_S8)
-
-PCMDEF(u32be, "PCM unsigned 32-bit big-endian",
-       NULL, AV_CODEC_ID_PCM_U32BE)
-
-PCMDEF(u32le, "PCM unsigned 32-bit little-endian",
-       NULL, AV_CODEC_ID_PCM_U32LE)
-
-PCMDEF(u24be, "PCM unsigned 24-bit big-endian",
-       NULL, AV_CODEC_ID_PCM_U24BE)
-
-PCMDEF(u24le, "PCM unsigned 24-bit little-endian",
-       NULL, AV_CODEC_ID_PCM_U24LE)
-
-PCMDEF(u16be, "PCM unsigned 16-bit big-endian",
-       AV_NE("uw", NULL), AV_CODEC_ID_PCM_U16BE)
-
-PCMDEF(u16le, "PCM unsigned 16-bit little-endian",
-       AV_NE(NULL, "uw"), AV_CODEC_ID_PCM_U16LE)
-
-PCMDEF(u8, "PCM unsigned 8-bit",
-       "ub", AV_CODEC_ID_PCM_U8)
-
-PCMDEF(alaw, "PCM A-law",
-       "al", AV_CODEC_ID_PCM_ALAW)
-
-PCMDEF(mulaw, "PCM mu-law",
-       "ul", AV_CODEC_ID_PCM_MULAW)
diff --git a/deps/libav/libavformat/pmpdec.c b/deps/libav/libavformat/pmpdec.c
deleted file mode 100644
index 8ae147f..0000000
--- a/deps/libav/libavformat/pmpdec.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * PMP demuxer
- * Copyright (c) 2011 Reimar Döffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct PMPContext {
-    int       cur_stream;
-    int       num_streams;
-    int       audio_packets;
-    int       current_packet;
-    uint32_t *packet_sizes;
-    int       packet_sizes_alloc;
-} PMPContext;
-
-static int pmp_probe(AVProbeData *p)
-{
-    if (!memcmp(p->buf, "pmpm\1\0\0\0", 8))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int pmp_header(AVFormatContext *s)
-{
-    PMPContext *pmp = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int tb_num, tb_den;
-    int index_cnt;
-    int audio_codec_id = AV_CODEC_ID_NONE;
-    int srate, channels;
-    int i;
-    uint64_t pos;
-    AVStream *vst = avformat_new_stream(s, NULL);
-    if (!vst)
-        return AVERROR(ENOMEM);
-    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    avio_skip(pb, 8);
-    switch (avio_rl32(pb)) {
-    case 0:
-        vst->codec->codec_id = AV_CODEC_ID_MPEG4;
-        break;
-    case 1:
-        vst->codec->codec_id = AV_CODEC_ID_H264;
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "Unsupported video format\n");
-        break;
-    }
-    index_cnt          = avio_rl32(pb);
-    vst->codec->width  = avio_rl32(pb);
-    vst->codec->height = avio_rl32(pb);
-
-    tb_num = avio_rl32(pb);
-    tb_den = avio_rl32(pb);
-    avpriv_set_pts_info(vst, 32, tb_num, tb_den);
-    vst->nb_frames = index_cnt;
-    vst->duration  = index_cnt;
-
-    switch (avio_rl32(pb)) {
-    case 0:
-        audio_codec_id = AV_CODEC_ID_MP3;
-        break;
-    case 1:
-        av_log(s, AV_LOG_WARNING, "AAC is not yet correctly supported\n");
-        audio_codec_id = AV_CODEC_ID_AAC;
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "Unsupported audio format\n");
-        break;
-    }
-    pmp->num_streams = avio_rl16(pb) + 1;
-    avio_skip(pb, 10);
-    srate    = avio_rl32(pb);
-    channels = avio_rl32(pb) + 1;
-    for (i = 1; i < pmp->num_streams; i++) {
-        AVStream *ast = avformat_new_stream(s, NULL);
-        if (!ast)
-            return AVERROR(ENOMEM);
-        ast->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-        ast->codec->codec_id    = audio_codec_id;
-        ast->codec->channels    = channels;
-        ast->codec->sample_rate = srate;
-        avpriv_set_pts_info(ast, 32, 1, srate);
-    }
-    pos = avio_tell(pb) + 4 * index_cnt;
-    for (i = 0; i < index_cnt; i++) {
-        int size  = avio_rl32(pb);
-        int flags = size & 1 ? AVINDEX_KEYFRAME : 0;
-        size >>= 1;
-        av_add_index_entry(vst, pos, i, size, 0, flags);
-        pos += size;
-    }
-    return 0;
-}
-
-static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    PMPContext *pmp = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret = 0;
-    int i;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-    if (pmp->cur_stream == 0) {
-        int num_packets;
-        pmp->audio_packets = avio_r8(pb);
-        if (!pmp->audio_packets) {
-            av_log(s, AV_LOG_ERROR, "No audio packets.\n");
-            return AVERROR_INVALIDDATA;
-        }
-
-        num_packets = (pmp->num_streams - 1) * pmp->audio_packets + 1;
-        avio_skip(pb, 8);
-        pmp->current_packet = 0;
-        av_fast_malloc(&pmp->packet_sizes,
-                       &pmp->packet_sizes_alloc,
-                       num_packets * sizeof(*pmp->packet_sizes));
-        if (!pmp->packet_sizes_alloc) {
-            av_log(s, AV_LOG_ERROR, "Cannot (re)allocate packet buffer\n");
-            return AVERROR(ENOMEM);
-        }
-        for (i = 0; i < num_packets; i++)
-            pmp->packet_sizes[i] = avio_rl32(pb);
-    }
-    ret = av_get_packet(pb, pkt, pmp->packet_sizes[pmp->current_packet]);
-    if (ret > 0) {
-        ret = 0;
-        // FIXME: this is a hack that should be removed once
-        // compute_pkt_fields() can handle timestamps properly
-        if (pmp->cur_stream == 0)
-            pkt->dts = s->streams[0]->cur_dts++;
-        pkt->stream_index = pmp->cur_stream;
-    }
-    pmp->current_packet++;
-    if (pmp->current_packet == 1 || pmp->current_packet > pmp->audio_packets)
-        pmp->cur_stream = (pmp->cur_stream + 1) % pmp->num_streams;
-
-    return ret;
-}
-
-static int pmp_seek(AVFormatContext *s, int stream_idx, int64_t ts, int flags)
-{
-    PMPContext *pmp = s->priv_data;
-    pmp->cur_stream = 0;
-    // fall back on default seek now
-    return -1;
-}
-
-static int pmp_close(AVFormatContext *s)
-{
-    PMPContext *pmp = s->priv_data;
-    av_freep(&pmp->packet_sizes);
-    return 0;
-}
-
-AVInputFormat ff_pmp_demuxer = {
-    .name           = "pmp",
-    .long_name      = NULL_IF_CONFIG_SMALL("Playstation Portable PMP"),
-    .priv_data_size = sizeof(PMPContext),
-    .read_probe     = pmp_probe,
-    .read_header    = pmp_header,
-    .read_packet    = pmp_packet,
-    .read_seek      = pmp_seek,
-    .read_close     = pmp_close,
-};
diff --git a/deps/libav/libavformat/psxstr.c b/deps/libav/libavformat/psxstr.c
deleted file mode 100644
index e662ed7..0000000
--- a/deps/libav/libavformat/psxstr.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Sony Playstation (PSX) STR File Demuxer
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * PSX STR file demuxer
- * by Mike Melanson (melanson at pcisys.net)
- * This module handles streams that have been ripped from Sony Playstation
- * CD games. This demuxer can handle either raw STR files (which are just
- * concatenations of raw compact disc sectors) or STR files with 0x2C-byte
- * RIFF headers, followed by CD sectors.
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define RIFF_TAG MKTAG('R', 'I', 'F', 'F')
-#define CDXA_TAG MKTAG('C', 'D', 'X', 'A')
-
-#define RAW_CD_SECTOR_SIZE      2352
-#define RAW_CD_SECTOR_DATA_SIZE 2304
-#define VIDEO_DATA_CHUNK_SIZE   0x7E0
-#define VIDEO_DATA_HEADER_SIZE  0x38
-#define RIFF_HEADER_SIZE        0x2C
-
-#define CDXA_TYPE_MASK     0x0E
-#define CDXA_TYPE_DATA     0x08
-#define CDXA_TYPE_AUDIO    0x04
-#define CDXA_TYPE_VIDEO    0x02
-
-#define STR_MAGIC (0x80010160)
-
-typedef struct StrChannel {
-    /* video parameters */
-    int video_stream_index;
-    AVPacket tmp_pkt;
-
-    /* audio parameters */
-    int audio_stream_index;
-} StrChannel;
-
-typedef struct StrDemuxContext {
-
-    /* a STR file can contain up to 32 channels of data */
-    StrChannel channels[32];
-} StrDemuxContext;
-
-static const char sync_header[12] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00};
-
-static int str_probe(AVProbeData *p)
-{
-    uint8_t *sector= p->buf;
-
-    if (p->buf_size < RAW_CD_SECTOR_SIZE)
-        return 0;
-
-    if ((AV_RL32(&p->buf[0]) == RIFF_TAG) &&
-        (AV_RL32(&p->buf[8]) == CDXA_TAG)) {
-
-        /* RIFF header seen; skip 0x2C bytes */
-        sector += RIFF_HEADER_SIZE;
-    }
-
-    /* look for CD sync header (00, 0xFF x 10, 00) */
-    if (memcmp(sector,sync_header,sizeof(sync_header)))
-        return 0;
-
-    if(sector[0x11] >= 32)
-        return 0;
-    if(   (sector[0x12] & CDXA_TYPE_MASK) != CDXA_TYPE_VIDEO
-       && (sector[0x12] & CDXA_TYPE_MASK) != CDXA_TYPE_AUDIO
-       && (sector[0x12] & CDXA_TYPE_MASK) != CDXA_TYPE_DATA)
-        return 0;
-
-    /* MPEG files (like those ripped from VCDs) can also look like this;
-     * only return half certainty */
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-static int str_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    StrDemuxContext *str = s->priv_data;
-    unsigned char sector[RAW_CD_SECTOR_SIZE];
-    int start;
-    int i;
-
-    /* skip over any RIFF header */
-    if (avio_read(pb, sector, RIFF_HEADER_SIZE) != RIFF_HEADER_SIZE)
-        return AVERROR(EIO);
-    if (AV_RL32(&sector[0]) == RIFF_TAG)
-        start = RIFF_HEADER_SIZE;
-    else
-        start = 0;
-
-    avio_seek(pb, start, SEEK_SET);
-
-    for(i=0; i<32; i++){
-        str->channels[i].video_stream_index=
-        str->channels[i].audio_stream_index= -1;
-    }
-
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    return 0;
-}
-
-static int str_read_packet(AVFormatContext *s,
-                           AVPacket *ret_pkt)
-{
-    AVIOContext *pb = s->pb;
-    StrDemuxContext *str = s->priv_data;
-    unsigned char sector[RAW_CD_SECTOR_SIZE];
-    int channel;
-    AVPacket *pkt;
-    AVStream *st;
-
-    while (1) {
-
-        if (avio_read(pb, sector, RAW_CD_SECTOR_SIZE) != RAW_CD_SECTOR_SIZE)
-            return AVERROR(EIO);
-
-        channel = sector[0x11];
-        if (channel >= 32)
-            return AVERROR_INVALIDDATA;
-
-        switch (sector[0x12] & CDXA_TYPE_MASK) {
-
-        case CDXA_TYPE_DATA:
-        case CDXA_TYPE_VIDEO:
-            {
-
-                int current_sector = AV_RL16(&sector[0x1C]);
-                int sector_count   = AV_RL16(&sector[0x1E]);
-                int frame_size = AV_RL32(&sector[0x24]);
-
-                if(!(   frame_size>=0
-                     && current_sector < sector_count
-                     && sector_count*VIDEO_DATA_CHUNK_SIZE >=frame_size)){
-                    av_log(s, AV_LOG_ERROR, "Invalid parameters %d %d %d\n", current_sector, sector_count, frame_size);
-                    break;
-                }
-
-                if(str->channels[channel].video_stream_index < 0){
-                    /* allocate a new AVStream */
-                    st = avformat_new_stream(s, NULL);
-                    if (!st)
-                        return AVERROR(ENOMEM);
-                    avpriv_set_pts_info(st, 64, 1, 15);
-
-                    str->channels[channel].video_stream_index = st->index;
-
-                    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-                    st->codec->codec_id   = AV_CODEC_ID_MDEC;
-                    st->codec->codec_tag  = 0;  /* no fourcc */
-                    st->codec->width      = AV_RL16(&sector[0x28]);
-                    st->codec->height     = AV_RL16(&sector[0x2A]);
-                }
-
-                /* if this is the first sector of the frame, allocate a pkt */
-                pkt = &str->channels[channel].tmp_pkt;
-
-                if(pkt->size != sector_count*VIDEO_DATA_CHUNK_SIZE){
-                    if(pkt->data)
-                        av_log(s, AV_LOG_ERROR, "missmatching sector_count\n");
-                    av_free_packet(pkt);
-                    if (av_new_packet(pkt, sector_count*VIDEO_DATA_CHUNK_SIZE))
-                        return AVERROR(EIO);
-
-                    pkt->pos= avio_tell(pb) - RAW_CD_SECTOR_SIZE;
-                    pkt->stream_index =
-                        str->channels[channel].video_stream_index;
-                }
-
-                memcpy(pkt->data + current_sector*VIDEO_DATA_CHUNK_SIZE,
-                       sector + VIDEO_DATA_HEADER_SIZE,
-                       VIDEO_DATA_CHUNK_SIZE);
-
-                if (current_sector == sector_count-1) {
-                    pkt->size= frame_size;
-                    *ret_pkt = *pkt;
-                    pkt->data= NULL;
-                    pkt->size= -1;
-                    pkt->buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-                    pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-                    return 0;
-                }
-
-            }
-            break;
-
-        case CDXA_TYPE_AUDIO:
-            if(str->channels[channel].audio_stream_index < 0){
-                int fmt = sector[0x13];
-                /* allocate a new AVStream */
-                st = avformat_new_stream(s, NULL);
-                if (!st)
-                    return AVERROR(ENOMEM);
-
-                str->channels[channel].audio_stream_index = st->index;
-
-                st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-                st->codec->codec_id    = AV_CODEC_ID_ADPCM_XA;
-                st->codec->codec_tag   = 0;  /* no fourcc */
-                if (fmt & 1) {
-                    st->codec->channels       = 2;
-                    st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-                } else {
-                    st->codec->channels       = 1;
-                    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-                }
-                st->codec->sample_rate = (fmt&4)?18900:37800;
-            //    st->codec->bit_rate = 0; //FIXME;
-                st->codec->block_align = 128;
-
-                avpriv_set_pts_info(st, 64, 18 * 224 / st->codec->channels,
-                                    st->codec->sample_rate);
-                st->start_time = 0;
-            }
-            pkt = ret_pkt;
-            if (av_new_packet(pkt, 2304))
-                return AVERROR(EIO);
-            memcpy(pkt->data,sector+24,2304);
-
-            pkt->stream_index =
-                str->channels[channel].audio_stream_index;
-            pkt->duration = 1;
-            return 0;
-        default:
-            av_log(s, AV_LOG_WARNING, "Unknown sector type %02X\n", sector[0x12]);
-            /* drop the sector and move on */
-            break;
-        }
-
-        if (pb->eof_reached)
-            return AVERROR(EIO);
-    }
-}
-
-static int str_read_close(AVFormatContext *s)
-{
-    StrDemuxContext *str = s->priv_data;
-    int i;
-    for(i=0; i<32; i++){
-        if(str->channels[i].tmp_pkt.data)
-            av_free_packet(&str->channels[i].tmp_pkt);
-    }
-
-    return 0;
-}
-
-AVInputFormat ff_str_demuxer = {
-    .name           = "psxstr",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sony Playstation STR"),
-    .priv_data_size = sizeof(StrDemuxContext),
-    .read_probe     = str_probe,
-    .read_header    = str_read_header,
-    .read_packet    = str_read_packet,
-    .read_close     = str_read_close,
-    .flags          = AVFMT_NO_BYTE_SEEK,
-};
diff --git a/deps/libav/libavformat/pva.c b/deps/libav/libavformat/pva.c
deleted file mode 100644
index 3abfc18..0000000
--- a/deps/libav/libavformat/pva.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * TechnoTrend PVA (.pva) demuxer
- * Copyright (c) 2007, 2008 Ivo van Poorten
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "mpeg.h"
-
-#define PVA_MAX_PAYLOAD_LENGTH  0x17f8
-#define PVA_VIDEO_PAYLOAD       0x01
-#define PVA_AUDIO_PAYLOAD       0x02
-#define PVA_MAGIC               (('A' << 8) + 'V')
-
-typedef struct {
-    int continue_pes;
-} PVAContext;
-
-static int pva_probe(AVProbeData * pd) {
-    unsigned char *buf = pd->buf;
-
-    if (AV_RB16(buf) == PVA_MAGIC && buf[2] && buf[2] < 3 && buf[4] == 0x55)
-        return AVPROBE_SCORE_EXTENSION;
-
-    return 0;
-}
-
-static int pva_read_header(AVFormatContext *s) {
-    AVStream *st;
-
-    if (!(st = avformat_new_stream(s, NULL)))
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_MPEG2VIDEO;
-    st->need_parsing      = AVSTREAM_PARSE_FULL;
-    avpriv_set_pts_info(st, 32, 1, 90000);
-    av_add_index_entry(st, 0, 0, 0, 0, AVINDEX_KEYFRAME);
-
-    if (!(st = avformat_new_stream(s, NULL)))
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id   = AV_CODEC_ID_MP2;
-    st->need_parsing      = AVSTREAM_PARSE_FULL;
-    avpriv_set_pts_info(st, 33, 1, 90000);
-    av_add_index_entry(st, 0, 0, 0, 0, AVINDEX_KEYFRAME);
-
-    /* the parameters will be extracted from the compressed bitstream */
-    return 0;
-}
-
-#define pva_log if (read_packet) av_log
-
-static int read_part_of_packet(AVFormatContext *s, int64_t *pts,
-                               int *len, int *strid, int read_packet) {
-    AVIOContext *pb = s->pb;
-    PVAContext *pvactx = s->priv_data;
-    int syncword, streamid, reserved, flags, length, pts_flag;
-    int64_t pva_pts = AV_NOPTS_VALUE, startpos;
-
-recover:
-    startpos = avio_tell(pb);
-
-    syncword = avio_rb16(pb);
-    streamid = avio_r8(pb);
-    avio_r8(pb);               /* counter not used */
-    reserved = avio_r8(pb);
-    flags    = avio_r8(pb);
-    length   = avio_rb16(pb);
-
-    pts_flag = flags & 0x10;
-
-    if (syncword != PVA_MAGIC) {
-        pva_log(s, AV_LOG_ERROR, "invalid syncword\n");
-        return AVERROR(EIO);
-    }
-    if (streamid != PVA_VIDEO_PAYLOAD && streamid != PVA_AUDIO_PAYLOAD) {
-        pva_log(s, AV_LOG_ERROR, "invalid streamid\n");
-        return AVERROR(EIO);
-    }
-    if (reserved != 0x55) {
-        pva_log(s, AV_LOG_WARNING, "expected reserved byte to be 0x55\n");
-    }
-    if (length > PVA_MAX_PAYLOAD_LENGTH) {
-        pva_log(s, AV_LOG_ERROR, "invalid payload length %u\n", length);
-        return AVERROR(EIO);
-    }
-
-    if (streamid == PVA_VIDEO_PAYLOAD && pts_flag) {
-        pva_pts = avio_rb32(pb);
-        length -= 4;
-    } else if (streamid == PVA_AUDIO_PAYLOAD) {
-        /* PVA Audio Packets either start with a signaled PES packet or
-         * are a continuation of the previous PES packet. New PES packets
-         * always start at the beginning of a PVA Packet, never somewhere in
-         * the middle. */
-        if (!pvactx->continue_pes) {
-            int pes_signal, pes_header_data_length, pes_packet_length,
-                pes_flags;
-            unsigned char pes_header_data[256];
-
-            pes_signal             = avio_rb24(pb);
-            avio_r8(pb);
-            pes_packet_length      = avio_rb16(pb);
-            pes_flags              = avio_rb16(pb);
-            pes_header_data_length = avio_r8(pb);
-
-            if (pes_signal != 1) {
-                pva_log(s, AV_LOG_WARNING, "expected signaled PES packet, "
-                                          "trying to recover\n");
-                avio_skip(pb, length - 9);
-                if (!read_packet)
-                    return AVERROR(EIO);
-                goto recover;
-            }
-
-            avio_read(pb, pes_header_data, pes_header_data_length);
-            length -= 9 + pes_header_data_length;
-
-            pes_packet_length -= 3 + pes_header_data_length;
-
-            pvactx->continue_pes = pes_packet_length;
-
-            if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20)
-                pva_pts = ff_parse_pes_pts(pes_header_data);
-        }
-
-        pvactx->continue_pes -= length;
-
-        if (pvactx->continue_pes < 0) {
-            pva_log(s, AV_LOG_WARNING, "audio data corruption\n");
-            pvactx->continue_pes = 0;
-        }
-    }
-
-    if (pva_pts != AV_NOPTS_VALUE)
-        av_add_index_entry(s->streams[streamid-1], startpos, pva_pts, 0, 0, AVINDEX_KEYFRAME);
-
-    *pts   = pva_pts;
-    *len   = length;
-    *strid = streamid;
-    return 0;
-}
-
-static int pva_read_packet(AVFormatContext *s, AVPacket *pkt) {
-    AVIOContext *pb = s->pb;
-    int64_t pva_pts;
-    int ret, length, streamid;
-
-    if (read_part_of_packet(s, &pva_pts, &length, &streamid, 1) < 0 ||
-       (ret = av_get_packet(pb, pkt, length)) <= 0)
-        return AVERROR(EIO);
-
-    pkt->stream_index = streamid - 1;
-    pkt->pts = pva_pts;
-
-    return ret;
-}
-
-static int64_t pva_read_timestamp(struct AVFormatContext *s, int stream_index,
-                                          int64_t *pos, int64_t pos_limit) {
-    AVIOContext *pb = s->pb;
-    PVAContext *pvactx = s->priv_data;
-    int length, streamid;
-    int64_t res = AV_NOPTS_VALUE;
-
-    pos_limit = FFMIN(*pos+PVA_MAX_PAYLOAD_LENGTH*8, (uint64_t)*pos+pos_limit);
-
-    while (*pos < pos_limit) {
-        res = AV_NOPTS_VALUE;
-        avio_seek(pb, *pos, SEEK_SET);
-
-        pvactx->continue_pes = 0;
-        if (read_part_of_packet(s, &res, &length, &streamid, 0)) {
-            (*pos)++;
-            continue;
-        }
-        if (streamid - 1 != stream_index || res == AV_NOPTS_VALUE) {
-            *pos = avio_tell(pb) + length;
-            continue;
-        }
-        break;
-    }
-
-    pvactx->continue_pes = 0;
-    return res;
-}
-
-AVInputFormat ff_pva_demuxer = {
-    .name           = "pva",
-    .long_name      = NULL_IF_CONFIG_SMALL("TechnoTrend PVA"),
-    .priv_data_size = sizeof(PVAContext),
-    .read_probe     = pva_probe,
-    .read_header    = pva_read_header,
-    .read_packet    = pva_read_packet,
-    .read_timestamp = pva_read_timestamp,
-};
diff --git a/deps/libav/libavformat/qcp.c b/deps/libav/libavformat/qcp.c
deleted file mode 100644
index 30d362f..0000000
--- a/deps/libav/libavformat/qcp.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * QCP format (.qcp) demuxer
- * Copyright (c) 2009 Kenan Gillet
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * QCP format (.qcp) demuxer
- * @author Kenan Gillet
- * @see RFC 3625: "The QCP File Format and Media Types for Speech Data"
- *     http://tools.ietf.org/html/rfc3625
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-
-typedef struct {
-    uint32_t data_size;                     ///< size of data chunk
-
-#define QCP_MAX_MODE 4
-    int16_t rates_per_mode[QCP_MAX_MODE+1]; ///< contains the packet size corresponding
-                                            ///< to each mode, -1 if no size.
-} QCPContext;
-
-/**
- * Last 15 out of 16 bytes of QCELP-13K GUID, as stored in the file;
- * the first byte of the GUID can be either 0x41 or 0x42.
- */
-static const uint8_t guid_qcelp_13k_part[15] = {
-    0x6d, 0x7f, 0x5e, 0x15, 0xb1, 0xd0, 0x11, 0xba,
-    0x91, 0x00, 0x80, 0x5f, 0xb4, 0xb9, 0x7e
-};
-
-/**
- * EVRC GUID as stored in the file
- */
-static const uint8_t guid_evrc[16] = {
-    0x8d, 0xd4, 0x89, 0xe6, 0x76, 0x90, 0xb5, 0x46,
-    0x91, 0xef, 0x73, 0x6a, 0x51, 0x00, 0xce, 0xb4
-};
-
-/**
- * SMV GUID as stored in the file
- */
-static const uint8_t guid_smv[16] = {
-    0x75, 0x2b, 0x7c, 0x8d, 0x97, 0xa7, 0x49, 0xed,
-    0x98, 0x5e, 0xd5, 0x3c, 0x8c, 0xc7, 0x5f, 0x84
-};
-
-/**
- * @param guid contains at least 16 bytes
- * @return 1 if the guid is a qcelp_13k guid, 0 otherwise
- */
-static int is_qcelp_13k_guid(const uint8_t *guid) {
-    return (guid[0] == 0x41 || guid[0] == 0x42)
-        && !memcmp(guid+1, guid_qcelp_13k_part, sizeof(guid_qcelp_13k_part));
-}
-
-static int qcp_probe(AVProbeData *pd)
-{
-    if (AV_RL32(pd->buf  ) == AV_RL32("RIFF") &&
-        AV_RL64(pd->buf+8) == AV_RL64("QLCMfmt "))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int qcp_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    QCPContext    *c  = s->priv_data;
-    AVStream      *st = avformat_new_stream(s, NULL);
-    uint8_t       buf[16];
-    int           i, nb_rates;
-
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    avio_rb32(pb);                    // "RIFF"
-    avio_skip(pb, 4 + 8 + 4 + 1 + 1);    // filesize + "QLCMfmt " + chunk-size + major-version + minor-version
-
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->channels   = 1;
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    avio_read(pb, buf, 16);
-    if (is_qcelp_13k_guid(buf)) {
-        st->codec->codec_id = AV_CODEC_ID_QCELP;
-    } else if (!memcmp(buf, guid_evrc, 16)) {
-        av_log(s, AV_LOG_ERROR, "EVRC codec is not supported.\n");
-        return AVERROR_PATCHWELCOME;
-    } else if (!memcmp(buf, guid_smv, 16)) {
-        av_log(s, AV_LOG_ERROR, "SMV codec is not supported.\n");
-        return AVERROR_PATCHWELCOME;
-    } else {
-        av_log(s, AV_LOG_ERROR, "Unknown codec GUID.\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avio_skip(pb, 2 + 80); // codec-version + codec-name
-    st->codec->bit_rate = avio_rl16(pb);
-
-    s->packet_size = avio_rl16(pb);
-    avio_skip(pb, 2); // block-size
-    st->codec->sample_rate = avio_rl16(pb);
-    avio_skip(pb, 2); // sample-size
-
-    memset(c->rates_per_mode, -1, sizeof(c->rates_per_mode));
-    nb_rates = avio_rl32(pb);
-    nb_rates = FFMIN(nb_rates, 8);
-    for (i=0; i<nb_rates; i++) {
-        int size = avio_r8(pb);
-        int mode = avio_r8(pb);
-        if (mode > QCP_MAX_MODE) {
-            av_log(s, AV_LOG_WARNING, "Unknown entry %d=>%d in rate-map-table.\n ", mode, size);
-        } else
-            c->rates_per_mode[mode] = size;
-    }
-    avio_skip(pb, 16 - 2*nb_rates + 20); // empty entries of rate-map-table + reserved
-
-    return 0;
-}
-
-static int qcp_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    QCPContext    *c  = s->priv_data;
-    unsigned int  chunk_size, tag;
-
-    while(!pb->eof_reached) {
-        if (c->data_size) {
-            int pkt_size, ret, mode = avio_r8(pb);
-
-            if (s->packet_size) {
-                pkt_size = s->packet_size - 1;
-            } else if (mode > QCP_MAX_MODE || (pkt_size = c->rates_per_mode[mode]) < 0) {
-                c->data_size--;
-                continue;
-            }
-
-            if (c->data_size <= pkt_size) {
-                av_log(s, AV_LOG_WARNING, "Data chunk is too small.\n");
-                pkt_size = c->data_size - 1;
-            }
-
-            if ((ret = av_get_packet(pb, pkt, pkt_size)) >= 0) {
-                if (pkt_size != ret)
-                    av_log(s, AV_LOG_ERROR, "Packet size is too small.\n");
-
-                c->data_size -= pkt_size + 1;
-            }
-            return ret;
-        }
-
-        if (avio_tell(pb) & 1 && avio_r8(pb))
-            av_log(s, AV_LOG_WARNING, "Padding should be 0.\n");
-
-        tag        = avio_rl32(pb);
-        chunk_size = avio_rl32(pb);
-        switch (tag) {
-        case MKTAG('v', 'r', 'a', 't'):
-            if (avio_rl32(pb)) // var-rate-flag
-                s->packet_size = 0;
-            avio_skip(pb, 4); // size-in-packets
-            break;
-        case MKTAG('d', 'a', 't', 'a'):
-            c->data_size = chunk_size;
-            break;
-
-        default:
-            avio_skip(pb, chunk_size);
-        }
-    }
-    return AVERROR_EOF;
-}
-
-AVInputFormat ff_qcp_demuxer = {
-    .name           = "qcp",
-    .long_name      = NULL_IF_CONFIG_SMALL("QCP"),
-    .priv_data_size = sizeof(QCPContext),
-    .read_probe     = qcp_probe,
-    .read_header    = qcp_read_header,
-    .read_packet    = qcp_read_packet,
-};
diff --git a/deps/libav/libavformat/qtpalette.h b/deps/libav/libavformat/qtpalette.h
deleted file mode 100644
index ecc85d3..0000000
--- a/deps/libav/libavformat/qtpalette.h
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Default Palettes for Quicktime Files
- *  Automatically generated from a utility derived from XAnim:
- *  http://xanim.va.pubnix.com/home.html
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_QTPALETTE_H
-#define AVFORMAT_QTPALETTE_H
-
-#include <inttypes.h>
-
-static const uint8_t ff_qt_default_palette_4[4 * 3] = {
-  0x93, 0x65, 0x5E,
-  0xFF, 0xFF, 0xFF,
-  0xDF, 0xD0, 0xAB,
-  0x00, 0x00, 0x00
-};
-
-static const uint8_t ff_qt_default_palette_16[16 * 3] = {
-  0xFF, 0xFB, 0xFF,
-  0xEF, 0xD9, 0xBB,
-  0xE8, 0xC9, 0xB1,
-  0x93, 0x65, 0x5E,
-  0xFC, 0xDE, 0xE8,
-  0x9D, 0x88, 0x91,
-  0xFF, 0xFF, 0xFF,
-  0xFF, 0xFF, 0xFF,
-  0xFF, 0xFF, 0xFF,
-  0x47, 0x48, 0x37,
-  0x7A, 0x5E, 0x55,
-  0xDF, 0xD0, 0xAB,
-  0xFF, 0xFB, 0xF9,
-  0xE8, 0xCA, 0xC5,
-  0x8A, 0x7C, 0x77,
-  0x00, 0x00, 0x00
-};
-
-static const uint8_t ff_qt_default_palette_256[256 * 3] = {
-  /*   0, 0x00 */  0xFF, 0xFF, 0xFF,
-  /*   1, 0x01 */  0xFF, 0xFF, 0xCC,
-  /*   2, 0x02 */  0xFF, 0xFF, 0x99,
-  /*   3, 0x03 */  0xFF, 0xFF, 0x66,
-  /*   4, 0x04 */  0xFF, 0xFF, 0x33,
-  /*   5, 0x05 */  0xFF, 0xFF, 0x00,
-  /*   6, 0x06 */  0xFF, 0xCC, 0xFF,
-  /*   7, 0x07 */  0xFF, 0xCC, 0xCC,
-  /*   8, 0x08 */  0xFF, 0xCC, 0x99,
-  /*   9, 0x09 */  0xFF, 0xCC, 0x66,
-  /*  10, 0x0A */  0xFF, 0xCC, 0x33,
-  /*  11, 0x0B */  0xFF, 0xCC, 0x00,
-  /*  12, 0x0C */  0xFF, 0x99, 0xFF,
-  /*  13, 0x0D */  0xFF, 0x99, 0xCC,
-  /*  14, 0x0E */  0xFF, 0x99, 0x99,
-  /*  15, 0x0F */  0xFF, 0x99, 0x66,
-  /*  16, 0x10 */  0xFF, 0x99, 0x33,
-  /*  17, 0x11 */  0xFF, 0x99, 0x00,
-  /*  18, 0x12 */  0xFF, 0x66, 0xFF,
-  /*  19, 0x13 */  0xFF, 0x66, 0xCC,
-  /*  20, 0x14 */  0xFF, 0x66, 0x99,
-  /*  21, 0x15 */  0xFF, 0x66, 0x66,
-  /*  22, 0x16 */  0xFF, 0x66, 0x33,
-  /*  23, 0x17 */  0xFF, 0x66, 0x00,
-  /*  24, 0x18 */  0xFF, 0x33, 0xFF,
-  /*  25, 0x19 */  0xFF, 0x33, 0xCC,
-  /*  26, 0x1A */  0xFF, 0x33, 0x99,
-  /*  27, 0x1B */  0xFF, 0x33, 0x66,
-  /*  28, 0x1C */  0xFF, 0x33, 0x33,
-  /*  29, 0x1D */  0xFF, 0x33, 0x00,
-  /*  30, 0x1E */  0xFF, 0x00, 0xFF,
-  /*  31, 0x1F */  0xFF, 0x00, 0xCC,
-  /*  32, 0x20 */  0xFF, 0x00, 0x99,
-  /*  33, 0x21 */  0xFF, 0x00, 0x66,
-  /*  34, 0x22 */  0xFF, 0x00, 0x33,
-  /*  35, 0x23 */  0xFF, 0x00, 0x00,
-  /*  36, 0x24 */  0xCC, 0xFF, 0xFF,
-  /*  37, 0x25 */  0xCC, 0xFF, 0xCC,
-  /*  38, 0x26 */  0xCC, 0xFF, 0x99,
-  /*  39, 0x27 */  0xCC, 0xFF, 0x66,
-  /*  40, 0x28 */  0xCC, 0xFF, 0x33,
-  /*  41, 0x29 */  0xCC, 0xFF, 0x00,
-  /*  42, 0x2A */  0xCC, 0xCC, 0xFF,
-  /*  43, 0x2B */  0xCC, 0xCC, 0xCC,
-  /*  44, 0x2C */  0xCC, 0xCC, 0x99,
-  /*  45, 0x2D */  0xCC, 0xCC, 0x66,
-  /*  46, 0x2E */  0xCC, 0xCC, 0x33,
-  /*  47, 0x2F */  0xCC, 0xCC, 0x00,
-  /*  48, 0x30 */  0xCC, 0x99, 0xFF,
-  /*  49, 0x31 */  0xCC, 0x99, 0xCC,
-  /*  50, 0x32 */  0xCC, 0x99, 0x99,
-  /*  51, 0x33 */  0xCC, 0x99, 0x66,
-  /*  52, 0x34 */  0xCC, 0x99, 0x33,
-  /*  53, 0x35 */  0xCC, 0x99, 0x00,
-  /*  54, 0x36 */  0xCC, 0x66, 0xFF,
-  /*  55, 0x37 */  0xCC, 0x66, 0xCC,
-  /*  56, 0x38 */  0xCC, 0x66, 0x99,
-  /*  57, 0x39 */  0xCC, 0x66, 0x66,
-  /*  58, 0x3A */  0xCC, 0x66, 0x33,
-  /*  59, 0x3B */  0xCC, 0x66, 0x00,
-  /*  60, 0x3C */  0xCC, 0x33, 0xFF,
-  /*  61, 0x3D */  0xCC, 0x33, 0xCC,
-  /*  62, 0x3E */  0xCC, 0x33, 0x99,
-  /*  63, 0x3F */  0xCC, 0x33, 0x66,
-  /*  64, 0x40 */  0xCC, 0x33, 0x33,
-  /*  65, 0x41 */  0xCC, 0x33, 0x00,
-  /*  66, 0x42 */  0xCC, 0x00, 0xFF,
-  /*  67, 0x43 */  0xCC, 0x00, 0xCC,
-  /*  68, 0x44 */  0xCC, 0x00, 0x99,
-  /*  69, 0x45 */  0xCC, 0x00, 0x66,
-  /*  70, 0x46 */  0xCC, 0x00, 0x33,
-  /*  71, 0x47 */  0xCC, 0x00, 0x00,
-  /*  72, 0x48 */  0x99, 0xFF, 0xFF,
-  /*  73, 0x49 */  0x99, 0xFF, 0xCC,
-  /*  74, 0x4A */  0x99, 0xFF, 0x99,
-  /*  75, 0x4B */  0x99, 0xFF, 0x66,
-  /*  76, 0x4C */  0x99, 0xFF, 0x33,
-  /*  77, 0x4D */  0x99, 0xFF, 0x00,
-  /*  78, 0x4E */  0x99, 0xCC, 0xFF,
-  /*  79, 0x4F */  0x99, 0xCC, 0xCC,
-  /*  80, 0x50 */  0x99, 0xCC, 0x99,
-  /*  81, 0x51 */  0x99, 0xCC, 0x66,
-  /*  82, 0x52 */  0x99, 0xCC, 0x33,
-  /*  83, 0x53 */  0x99, 0xCC, 0x00,
-  /*  84, 0x54 */  0x99, 0x99, 0xFF,
-  /*  85, 0x55 */  0x99, 0x99, 0xCC,
-  /*  86, 0x56 */  0x99, 0x99, 0x99,
-  /*  87, 0x57 */  0x99, 0x99, 0x66,
-  /*  88, 0x58 */  0x99, 0x99, 0x33,
-  /*  89, 0x59 */  0x99, 0x99, 0x00,
-  /*  90, 0x5A */  0x99, 0x66, 0xFF,
-  /*  91, 0x5B */  0x99, 0x66, 0xCC,
-  /*  92, 0x5C */  0x99, 0x66, 0x99,
-  /*  93, 0x5D */  0x99, 0x66, 0x66,
-  /*  94, 0x5E */  0x99, 0x66, 0x33,
-  /*  95, 0x5F */  0x99, 0x66, 0x00,
-  /*  96, 0x60 */  0x99, 0x33, 0xFF,
-  /*  97, 0x61 */  0x99, 0x33, 0xCC,
-  /*  98, 0x62 */  0x99, 0x33, 0x99,
-  /*  99, 0x63 */  0x99, 0x33, 0x66,
-  /* 100, 0x64 */  0x99, 0x33, 0x33,
-  /* 101, 0x65 */  0x99, 0x33, 0x00,
-  /* 102, 0x66 */  0x99, 0x00, 0xFF,
-  /* 103, 0x67 */  0x99, 0x00, 0xCC,
-  /* 104, 0x68 */  0x99, 0x00, 0x99,
-  /* 105, 0x69 */  0x99, 0x00, 0x66,
-  /* 106, 0x6A */  0x99, 0x00, 0x33,
-  /* 107, 0x6B */  0x99, 0x00, 0x00,
-  /* 108, 0x6C */  0x66, 0xFF, 0xFF,
-  /* 109, 0x6D */  0x66, 0xFF, 0xCC,
-  /* 110, 0x6E */  0x66, 0xFF, 0x99,
-  /* 111, 0x6F */  0x66, 0xFF, 0x66,
-  /* 112, 0x70 */  0x66, 0xFF, 0x33,
-  /* 113, 0x71 */  0x66, 0xFF, 0x00,
-  /* 114, 0x72 */  0x66, 0xCC, 0xFF,
-  /* 115, 0x73 */  0x66, 0xCC, 0xCC,
-  /* 116, 0x74 */  0x66, 0xCC, 0x99,
-  /* 117, 0x75 */  0x66, 0xCC, 0x66,
-  /* 118, 0x76 */  0x66, 0xCC, 0x33,
-  /* 119, 0x77 */  0x66, 0xCC, 0x00,
-  /* 120, 0x78 */  0x66, 0x99, 0xFF,
-  /* 121, 0x79 */  0x66, 0x99, 0xCC,
-  /* 122, 0x7A */  0x66, 0x99, 0x99,
-  /* 123, 0x7B */  0x66, 0x99, 0x66,
-  /* 124, 0x7C */  0x66, 0x99, 0x33,
-  /* 125, 0x7D */  0x66, 0x99, 0x00,
-  /* 126, 0x7E */  0x66, 0x66, 0xFF,
-  /* 127, 0x7F */  0x66, 0x66, 0xCC,
-  /* 128, 0x80 */  0x66, 0x66, 0x99,
-  /* 129, 0x81 */  0x66, 0x66, 0x66,
-  /* 130, 0x82 */  0x66, 0x66, 0x33,
-  /* 131, 0x83 */  0x66, 0x66, 0x00,
-  /* 132, 0x84 */  0x66, 0x33, 0xFF,
-  /* 133, 0x85 */  0x66, 0x33, 0xCC,
-  /* 134, 0x86 */  0x66, 0x33, 0x99,
-  /* 135, 0x87 */  0x66, 0x33, 0x66,
-  /* 136, 0x88 */  0x66, 0x33, 0x33,
-  /* 137, 0x89 */  0x66, 0x33, 0x00,
-  /* 138, 0x8A */  0x66, 0x00, 0xFF,
-  /* 139, 0x8B */  0x66, 0x00, 0xCC,
-  /* 140, 0x8C */  0x66, 0x00, 0x99,
-  /* 141, 0x8D */  0x66, 0x00, 0x66,
-  /* 142, 0x8E */  0x66, 0x00, 0x33,
-  /* 143, 0x8F */  0x66, 0x00, 0x00,
-  /* 144, 0x90 */  0x33, 0xFF, 0xFF,
-  /* 145, 0x91 */  0x33, 0xFF, 0xCC,
-  /* 146, 0x92 */  0x33, 0xFF, 0x99,
-  /* 147, 0x93 */  0x33, 0xFF, 0x66,
-  /* 148, 0x94 */  0x33, 0xFF, 0x33,
-  /* 149, 0x95 */  0x33, 0xFF, 0x00,
-  /* 150, 0x96 */  0x33, 0xCC, 0xFF,
-  /* 151, 0x97 */  0x33, 0xCC, 0xCC,
-  /* 152, 0x98 */  0x33, 0xCC, 0x99,
-  /* 153, 0x99 */  0x33, 0xCC, 0x66,
-  /* 154, 0x9A */  0x33, 0xCC, 0x33,
-  /* 155, 0x9B */  0x33, 0xCC, 0x00,
-  /* 156, 0x9C */  0x33, 0x99, 0xFF,
-  /* 157, 0x9D */  0x33, 0x99, 0xCC,
-  /* 158, 0x9E */  0x33, 0x99, 0x99,
-  /* 159, 0x9F */  0x33, 0x99, 0x66,
-  /* 160, 0xA0 */  0x33, 0x99, 0x33,
-  /* 161, 0xA1 */  0x33, 0x99, 0x00,
-  /* 162, 0xA2 */  0x33, 0x66, 0xFF,
-  /* 163, 0xA3 */  0x33, 0x66, 0xCC,
-  /* 164, 0xA4 */  0x33, 0x66, 0x99,
-  /* 165, 0xA5 */  0x33, 0x66, 0x66,
-  /* 166, 0xA6 */  0x33, 0x66, 0x33,
-  /* 167, 0xA7 */  0x33, 0x66, 0x00,
-  /* 168, 0xA8 */  0x33, 0x33, 0xFF,
-  /* 169, 0xA9 */  0x33, 0x33, 0xCC,
-  /* 170, 0xAA */  0x33, 0x33, 0x99,
-  /* 171, 0xAB */  0x33, 0x33, 0x66,
-  /* 172, 0xAC */  0x33, 0x33, 0x33,
-  /* 173, 0xAD */  0x33, 0x33, 0x00,
-  /* 174, 0xAE */  0x33, 0x00, 0xFF,
-  /* 175, 0xAF */  0x33, 0x00, 0xCC,
-  /* 176, 0xB0 */  0x33, 0x00, 0x99,
-  /* 177, 0xB1 */  0x33, 0x00, 0x66,
-  /* 178, 0xB2 */  0x33, 0x00, 0x33,
-  /* 179, 0xB3 */  0x33, 0x00, 0x00,
-  /* 180, 0xB4 */  0x00, 0xFF, 0xFF,
-  /* 181, 0xB5 */  0x00, 0xFF, 0xCC,
-  /* 182, 0xB6 */  0x00, 0xFF, 0x99,
-  /* 183, 0xB7 */  0x00, 0xFF, 0x66,
-  /* 184, 0xB8 */  0x00, 0xFF, 0x33,
-  /* 185, 0xB9 */  0x00, 0xFF, 0x00,
-  /* 186, 0xBA */  0x00, 0xCC, 0xFF,
-  /* 187, 0xBB */  0x00, 0xCC, 0xCC,
-  /* 188, 0xBC */  0x00, 0xCC, 0x99,
-  /* 189, 0xBD */  0x00, 0xCC, 0x66,
-  /* 190, 0xBE */  0x00, 0xCC, 0x33,
-  /* 191, 0xBF */  0x00, 0xCC, 0x00,
-  /* 192, 0xC0 */  0x00, 0x99, 0xFF,
-  /* 193, 0xC1 */  0x00, 0x99, 0xCC,
-  /* 194, 0xC2 */  0x00, 0x99, 0x99,
-  /* 195, 0xC3 */  0x00, 0x99, 0x66,
-  /* 196, 0xC4 */  0x00, 0x99, 0x33,
-  /* 197, 0xC5 */  0x00, 0x99, 0x00,
-  /* 198, 0xC6 */  0x00, 0x66, 0xFF,
-  /* 199, 0xC7 */  0x00, 0x66, 0xCC,
-  /* 200, 0xC8 */  0x00, 0x66, 0x99,
-  /* 201, 0xC9 */  0x00, 0x66, 0x66,
-  /* 202, 0xCA */  0x00, 0x66, 0x33,
-  /* 203, 0xCB */  0x00, 0x66, 0x00,
-  /* 204, 0xCC */  0x00, 0x33, 0xFF,
-  /* 205, 0xCD */  0x00, 0x33, 0xCC,
-  /* 206, 0xCE */  0x00, 0x33, 0x99,
-  /* 207, 0xCF */  0x00, 0x33, 0x66,
-  /* 208, 0xD0 */  0x00, 0x33, 0x33,
-  /* 209, 0xD1 */  0x00, 0x33, 0x00,
-  /* 210, 0xD2 */  0x00, 0x00, 0xFF,
-  /* 211, 0xD3 */  0x00, 0x00, 0xCC,
-  /* 212, 0xD4 */  0x00, 0x00, 0x99,
-  /* 213, 0xD5 */  0x00, 0x00, 0x66,
-  /* 214, 0xD6 */  0x00, 0x00, 0x33,
-  /* 215, 0xD7 */  0xEE, 0x00, 0x00,
-  /* 216, 0xD8 */  0xDD, 0x00, 0x00,
-  /* 217, 0xD9 */  0xBB, 0x00, 0x00,
-  /* 218, 0xDA */  0xAA, 0x00, 0x00,
-  /* 219, 0xDB */  0x88, 0x00, 0x00,
-  /* 220, 0xDC */  0x77, 0x00, 0x00,
-  /* 221, 0xDD */  0x55, 0x00, 0x00,
-  /* 222, 0xDE */  0x44, 0x00, 0x00,
-  /* 223, 0xDF */  0x22, 0x00, 0x00,
-  /* 224, 0xE0 */  0x11, 0x00, 0x00,
-  /* 225, 0xE1 */  0x00, 0xEE, 0x00,
-  /* 226, 0xE2 */  0x00, 0xDD, 0x00,
-  /* 227, 0xE3 */  0x00, 0xBB, 0x00,
-  /* 228, 0xE4 */  0x00, 0xAA, 0x00,
-  /* 229, 0xE5 */  0x00, 0x88, 0x00,
-  /* 230, 0xE6 */  0x00, 0x77, 0x00,
-  /* 231, 0xE7 */  0x00, 0x55, 0x00,
-  /* 232, 0xE8 */  0x00, 0x44, 0x00,
-  /* 233, 0xE9 */  0x00, 0x22, 0x00,
-  /* 234, 0xEA */  0x00, 0x11, 0x00,
-  /* 235, 0xEB */  0x00, 0x00, 0xEE,
-  /* 236, 0xEC */  0x00, 0x00, 0xDD,
-  /* 237, 0xED */  0x00, 0x00, 0xBB,
-  /* 238, 0xEE */  0x00, 0x00, 0xAA,
-  /* 239, 0xEF */  0x00, 0x00, 0x88,
-  /* 240, 0xF0 */  0x00, 0x00, 0x77,
-  /* 241, 0xF1 */  0x00, 0x00, 0x55,
-  /* 242, 0xF2 */  0x00, 0x00, 0x44,
-  /* 243, 0xF3 */  0x00, 0x00, 0x22,
-  /* 244, 0xF4 */  0x00, 0x00, 0x11,
-  /* 245, 0xF5 */  0xEE, 0xEE, 0xEE,
-  /* 246, 0xF6 */  0xDD, 0xDD, 0xDD,
-  /* 247, 0xF7 */  0xBB, 0xBB, 0xBB,
-  /* 248, 0xF8 */  0xAA, 0xAA, 0xAA,
-  /* 249, 0xF9 */  0x88, 0x88, 0x88,
-  /* 250, 0xFA */  0x77, 0x77, 0x77,
-  /* 251, 0xFB */  0x55, 0x55, 0x55,
-  /* 252, 0xFC */  0x44, 0x44, 0x44,
-  /* 253, 0xFD */  0x22, 0x22, 0x22,
-  /* 254, 0xFE */  0x11, 0x11, 0x11,
-  /* 255, 0xFF */  0x00, 0x00, 0x00
-};
-
-#endif /* AVFORMAT_QTPALETTE_H */
diff --git a/deps/libav/libavformat/r3d.c b/deps/libav/libavformat/r3d.c
deleted file mode 100644
index 74a1f2b..0000000
--- a/deps/libav/libavformat/r3d.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * R3D REDCODE demuxer
- * Copyright (c) 2008 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct {
-    unsigned video_offsets_count;
-    unsigned *video_offsets;
-    unsigned rdvo_offset;
-} R3DContext;
-
-typedef struct {
-    unsigned size;
-    uint32_t tag;
-    uint64_t offset;
-} Atom;
-
-static int read_atom(AVFormatContext *s, Atom *atom)
-{
-    atom->offset = avio_tell(s->pb);
-    atom->size = avio_rb32(s->pb);
-    if (atom->size < 8)
-        return -1;
-    atom->tag = avio_rl32(s->pb);
-    av_dlog(s, "atom %u %.4s offset %#"PRIx64"\n",
-            atom->size, (char*)&atom->tag, atom->offset);
-    return atom->size;
-}
-
-static int r3d_read_red1(AVFormatContext *s)
-{
-    AVStream *st = avformat_new_stream(s, NULL);
-    char filename[258];
-    int tmp;
-    int av_unused tmp2;
-    AVRational framerate;
-
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_JPEG2000;
-
-    tmp  = avio_r8(s->pb); // major version
-    tmp2 = avio_r8(s->pb); // minor version
-    av_dlog(s, "version %d.%d\n", tmp, tmp2);
-
-    tmp = avio_rb16(s->pb); // unknown
-    av_dlog(s, "unknown1 %d\n", tmp);
-
-    tmp = avio_rb32(s->pb);
-    avpriv_set_pts_info(st, 32, 1, tmp);
-
-    tmp = avio_rb32(s->pb); // filenum
-    av_dlog(s, "filenum %d\n", tmp);
-
-    avio_skip(s->pb, 32); // unknown
-
-    st->codec->width  = avio_rb32(s->pb);
-    st->codec->height = avio_rb32(s->pb);
-
-    tmp = avio_rb16(s->pb); // unknown
-    av_dlog(s, "unknown2 %d\n", tmp);
-
-    framerate.num = avio_rb16(s->pb);
-    framerate.den = avio_rb16(s->pb);
-    if (framerate.num > 0 && framerate.den > 0) {
-        st->avg_frame_rate = framerate;
-    }
-
-    tmp = avio_r8(s->pb); // audio channels
-    av_dlog(s, "audio channels %d\n", tmp);
-    if (tmp > 0) {
-        AVStream *ast = avformat_new_stream(s, NULL);
-        if (!ast)
-            return AVERROR(ENOMEM);
-        ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        ast->codec->codec_id = AV_CODEC_ID_PCM_S32BE;
-        ast->codec->channels = tmp;
-        avpriv_set_pts_info(ast, 32, 1, st->time_base.den);
-    }
-
-    avio_read(s->pb, filename, 257);
-    filename[sizeof(filename)-1] = 0;
-    av_dict_set(&st->metadata, "filename", filename, 0);
-
-    av_dlog(s, "filename %s\n", filename);
-    av_dlog(s, "resolution %dx%d\n", st->codec->width, st->codec->height);
-    av_dlog(s, "timescale %d\n", st->time_base.den);
-    av_dlog(s, "frame rate %d/%d\n",
-            framerate.num, framerate.den);
-
-    return 0;
-}
-
-static int r3d_read_rdvo(AVFormatContext *s, Atom *atom)
-{
-    R3DContext *r3d = s->priv_data;
-    AVStream *st = s->streams[0];
-    int i;
-
-    r3d->video_offsets_count = (atom->size - 8) / 4;
-    r3d->video_offsets = av_malloc(atom->size);
-    if (!r3d->video_offsets)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < r3d->video_offsets_count; i++) {
-        r3d->video_offsets[i] = avio_rb32(s->pb);
-        if (!r3d->video_offsets[i]) {
-            r3d->video_offsets_count = i;
-            break;
-        }
-        av_dlog(s, "video offset %d: %#x\n", i, r3d->video_offsets[i]);
-    }
-
-    if (st->avg_frame_rate.num)
-        st->duration = av_rescale_q(r3d->video_offsets_count,
-                                    (AVRational){st->avg_frame_rate.den,
-                                                 st->avg_frame_rate.num},
-                                    st->time_base);
-    av_dlog(s, "duration %"PRId64"\n", st->duration);
-
-    return 0;
-}
-
-static void r3d_read_reos(AVFormatContext *s)
-{
-    R3DContext *r3d = s->priv_data;
-    int av_unused tmp;
-
-    r3d->rdvo_offset = avio_rb32(s->pb);
-    avio_rb32(s->pb); // rdvs offset
-    avio_rb32(s->pb); // rdao offset
-    avio_rb32(s->pb); // rdas offset
-
-    tmp = avio_rb32(s->pb);
-    av_dlog(s, "num video chunks %d\n", tmp);
-
-    tmp = avio_rb32(s->pb);
-    av_dlog(s, "num audio chunks %d\n", tmp);
-
-    avio_skip(s->pb, 6*4);
-}
-
-static int r3d_read_header(AVFormatContext *s)
-{
-    R3DContext *r3d = s->priv_data;
-    Atom atom;
-    int ret;
-
-    if (read_atom(s, &atom) < 0) {
-        av_log(s, AV_LOG_ERROR, "error reading atom\n");
-        return -1;
-    }
-    if (atom.tag == MKTAG('R','E','D','1')) {
-        if ((ret = r3d_read_red1(s)) < 0) {
-            av_log(s, AV_LOG_ERROR, "error parsing 'red1' atom\n");
-            return ret;
-        }
-    } else {
-        av_log(s, AV_LOG_ERROR, "could not find 'red1' atom\n");
-        return -1;
-    }
-
-    s->data_offset = avio_tell(s->pb);
-    av_dlog(s, "data offset %#"PRIx64"\n", s->data_offset);
-    if (!s->pb->seekable)
-        return 0;
-    // find REOB/REOF/REOS to load index
-    avio_seek(s->pb, avio_size(s->pb)-48-8, SEEK_SET);
-    if (read_atom(s, &atom) < 0)
-        av_log(s, AV_LOG_ERROR, "error reading end atom\n");
-
-    if (atom.tag != MKTAG('R','E','O','B') &&
-        atom.tag != MKTAG('R','E','O','F') &&
-        atom.tag != MKTAG('R','E','O','S'))
-        goto out;
-
-    r3d_read_reos(s);
-
-    if (r3d->rdvo_offset) {
-        avio_seek(s->pb, r3d->rdvo_offset, SEEK_SET);
-        if (read_atom(s, &atom) < 0)
-            av_log(s, AV_LOG_ERROR, "error reading 'rdvo' atom\n");
-        if (atom.tag == MKTAG('R','D','V','O')) {
-            if (r3d_read_rdvo(s, &atom) < 0)
-                av_log(s, AV_LOG_ERROR, "error parsing 'rdvo' atom\n");
-        }
-    }
-
- out:
-    avio_seek(s->pb, s->data_offset, SEEK_SET);
-    return 0;
-}
-
-static int r3d_read_redv(AVFormatContext *s, AVPacket *pkt, Atom *atom)
-{
-    AVStream *st = s->streams[0];
-    int tmp;
-    int av_unused tmp2;
-    uint64_t pos = avio_tell(s->pb);
-    unsigned dts;
-    int ret;
-
-    dts = avio_rb32(s->pb);
-
-    tmp = avio_rb32(s->pb);
-    av_dlog(s, "frame num %d\n", tmp);
-
-    tmp  = avio_r8(s->pb); // major version
-    tmp2 = avio_r8(s->pb); // minor version
-    av_dlog(s, "version %d.%d\n", tmp, tmp2);
-
-    tmp = avio_rb16(s->pb); // unknown
-    av_dlog(s, "unknown %d\n", tmp);
-
-    if (tmp > 4) {
-        tmp = avio_rb16(s->pb); // unknown
-        av_dlog(s, "unknown %d\n", tmp);
-
-        tmp = avio_rb16(s->pb); // unknown
-        av_dlog(s, "unknown %d\n", tmp);
-
-        tmp = avio_rb32(s->pb);
-        av_dlog(s, "width %d\n", tmp);
-        tmp = avio_rb32(s->pb);
-        av_dlog(s, "height %d\n", tmp);
-
-        tmp = avio_rb32(s->pb);
-        av_dlog(s, "metadata len %d\n", tmp);
-    }
-    tmp = atom->size - 8 - (avio_tell(s->pb) - pos);
-    if (tmp < 0)
-        return -1;
-    ret = av_get_packet(s->pb, pkt, tmp);
-    if (ret < 0) {
-        av_log(s, AV_LOG_ERROR, "error reading video packet\n");
-        return -1;
-    }
-
-    pkt->stream_index = 0;
-    pkt->dts = dts;
-    if (st->avg_frame_rate.num)
-        pkt->duration = (uint64_t)st->time_base.den*
-            st->avg_frame_rate.den/st->avg_frame_rate.num;
-    av_dlog(s, "pkt dts %"PRId64" duration %d\n", pkt->dts, pkt->duration);
-
-    return 0;
-}
-
-static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
-{
-    AVStream *st = s->streams[1];
-    int av_unused tmp, tmp2;
-    int samples, size;
-    uint64_t pos = avio_tell(s->pb);
-    unsigned dts;
-    int ret;
-
-    dts = avio_rb32(s->pb);
-
-    st->codec->sample_rate = avio_rb32(s->pb);
-    if (st->codec->sample_rate <= 0) {
-        av_log(s, AV_LOG_ERROR, "Bad sample rate\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    samples = avio_rb32(s->pb);
-
-    tmp = avio_rb32(s->pb);
-    av_dlog(s, "packet num %d\n", tmp);
-
-    tmp = avio_rb16(s->pb); // unknown
-    av_dlog(s, "unknown %d\n", tmp);
-
-    tmp  = avio_r8(s->pb); // major version
-    tmp2 = avio_r8(s->pb); // minor version
-    av_dlog(s, "version %d.%d\n", tmp, tmp2);
-
-    tmp = avio_rb32(s->pb); // unknown
-    av_dlog(s, "unknown %d\n", tmp);
-
-    size = atom->size - 8 - (avio_tell(s->pb) - pos);
-    if (size < 0)
-        return -1;
-    ret = av_get_packet(s->pb, pkt, size);
-    if (ret < 0) {
-        av_log(s, AV_LOG_ERROR, "error reading audio packet\n");
-        return ret;
-    }
-
-    pkt->stream_index = 1;
-    pkt->dts = dts;
-    pkt->duration = av_rescale(samples, st->time_base.den, st->codec->sample_rate);
-    av_dlog(s, "pkt dts %"PRId64" duration %d samples %d sample rate %d\n",
-            pkt->dts, pkt->duration, samples, st->codec->sample_rate);
-
-    return 0;
-}
-
-static int r3d_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    Atom atom;
-    int err = 0;
-
-    while (!err) {
-        if (read_atom(s, &atom) < 0) {
-            err = -1;
-            break;
-        }
-        switch (atom.tag) {
-        case MKTAG('R','E','D','V'):
-            if (s->streams[0]->discard == AVDISCARD_ALL)
-                goto skip;
-            if (!(err = r3d_read_redv(s, pkt, &atom)))
-                return 0;
-            break;
-        case MKTAG('R','E','D','A'):
-            if (s->nb_streams < 2)
-                return -1;
-            if (s->streams[1]->discard == AVDISCARD_ALL)
-                goto skip;
-            if (!(err = r3d_read_reda(s, pkt, &atom)))
-                return 0;
-            break;
-        default:
-        skip:
-            avio_skip(s->pb, atom.size-8);
-        }
-    }
-    return err;
-}
-
-static int r3d_probe(AVProbeData *p)
-{
-    if (AV_RL32(p->buf + 4) == MKTAG('R','E','D','1'))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags)
-{
-    AVStream *st = s->streams[0]; // video stream
-    R3DContext *r3d = s->priv_data;
-    int frame_num;
-
-    if (!st->avg_frame_rate.num)
-        return -1;
-
-    frame_num = av_rescale_q(sample_time, st->time_base,
-                             (AVRational){st->avg_frame_rate.den, st->avg_frame_rate.num});
-    av_dlog(s, "seek frame num %d timestamp %"PRId64"\n",
-            frame_num, sample_time);
-
-    if (frame_num < r3d->video_offsets_count) {
-        if (avio_seek(s->pb, r3d->video_offsets_count, SEEK_SET) < 0)
-            return -1;
-    } else {
-        av_log(s, AV_LOG_ERROR, "could not seek to frame %d\n", frame_num);
-        return -1;
-    }
-
-    return 0;
-}
-
-static int r3d_close(AVFormatContext *s)
-{
-    R3DContext *r3d = s->priv_data;
-
-    av_freep(&r3d->video_offsets);
-
-    return 0;
-}
-
-AVInputFormat ff_r3d_demuxer = {
-    .name           = "r3d",
-    .long_name      = NULL_IF_CONFIG_SMALL("REDCODE R3D"),
-    .priv_data_size = sizeof(R3DContext),
-    .read_probe     = r3d_probe,
-    .read_header    = r3d_read_header,
-    .read_packet    = r3d_read_packet,
-    .read_close     = r3d_close,
-    .read_seek      = r3d_seek,
-};
diff --git a/deps/libav/libavformat/rawdec.c b/deps/libav/libavformat/rawdec.c
deleted file mode 100644
index 41e1700..0000000
--- a/deps/libav/libavformat/rawdec.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * RAW demuxers
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2005 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "rawdec.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-
-#define RAW_PACKET_SIZE 1024
-
-int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, size;
-
-    size = RAW_PACKET_SIZE;
-
-    if (av_new_packet(pkt, size) < 0)
-        return AVERROR(ENOMEM);
-
-    pkt->pos= avio_tell(s->pb);
-    pkt->stream_index = 0;
-    ret = ffio_read_partial(s->pb, pkt->data, size);
-    if (ret < 0) {
-        av_free_packet(pkt);
-        return ret;
-    } else if (ret < size) {
-        /* initialize end of packet for partial reads to avoid reading
-         * uninitialized data on allowed overreads */
-        memset(pkt->data + ret, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    }
-    pkt->size = ret;
-    return ret;
-}
-
-int ff_raw_audio_read_header(AVFormatContext *s)
-{
-    AVStream *st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = s->iformat->raw_codec_id;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-    st->start_time = 0;
-    /* the parameters will be extracted from the compressed bitstream */
-
-    return 0;
-}
-
-/* MPEG-1/H.263 input */
-int ff_raw_video_read_header(AVFormatContext *s)
-{
-    AVStream *st;
-    FFRawVideoDemuxerContext *s1 = s->priv_data;
-    AVRational framerate;
-    int ret = 0;
-
-
-    st = avformat_new_stream(s, NULL);
-    if (!st) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = s->iformat->raw_codec_id;
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-
-    if ((ret = av_parse_video_rate(&framerate, s1->framerate)) < 0) {
-        av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate);
-        goto fail;
-    }
-
-    st->avg_frame_rate = framerate;
-    avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
-
-fail:
-    return ret;
-}
-
-/* Note: Do not forget to add new entries to the Makefile as well. */
-
-#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-const AVOption ff_rawvideo_options[] = {
-    { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC},
-    { NULL },
-};
-
-#if CONFIG_LATM_DEMUXER
-AVInputFormat ff_latm_demuxer = {
-    .name           = "latm",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw LOAS/LATM"),
-    .read_header    = ff_raw_audio_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "latm",
-    .raw_codec_id   = AV_CODEC_ID_AAC_LATM,
-};
-#endif
-
-#if CONFIG_MJPEG_DEMUXER
-FF_DEF_RAWVIDEO_DEMUXER(mjpeg, "raw MJPEG video", NULL, "mjpg,mjpeg", AV_CODEC_ID_MJPEG)
-#endif
-
-#if CONFIG_MLP_DEMUXER
-AVInputFormat ff_mlp_demuxer = {
-    .name           = "mlp",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw MLP"),
-    .read_header    = ff_raw_audio_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "mlp",
-    .raw_codec_id   = AV_CODEC_ID_MLP,
-};
-#endif
-
-#if CONFIG_TRUEHD_DEMUXER
-AVInputFormat ff_truehd_demuxer = {
-    .name           = "truehd",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw TrueHD"),
-    .read_header    = ff_raw_audio_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "thd",
-    .raw_codec_id   = AV_CODEC_ID_TRUEHD,
-};
-#endif
-
-#if CONFIG_SHORTEN_DEMUXER
-AVInputFormat ff_shorten_demuxer = {
-    .name           = "shn",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw Shorten"),
-    .read_header    = ff_raw_audio_read_header,
-    .read_packet    = ff_raw_read_partial_packet,
-    .flags          = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK,
-    .extensions     = "shn",
-    .raw_codec_id   = AV_CODEC_ID_SHORTEN,
-};
-#endif
-
-#if CONFIG_VC1_DEMUXER
-FF_DEF_RAWVIDEO_DEMUXER(vc1, "raw VC-1", NULL, "vc1", AV_CODEC_ID_VC1)
-#endif
diff --git a/deps/libav/libavformat/rawdec.h b/deps/libav/libavformat/rawdec.h
deleted file mode 100644
index a548778..0000000
--- a/deps/libav/libavformat/rawdec.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * RAW demuxers
- * Copyright (C) 2007  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RAWDEC_H
-#define AVFORMAT_RAWDEC_H
-
-#include "avformat.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-
-typedef struct FFRawVideoDemuxerContext {
-    const AVClass *class;     /**< Class for private options. */
-    char *video_size;         /**< String describing video size, set by a private option. */
-    char *pixel_format;       /**< Set by a private option. */
-    char *framerate;          /**< String describing framerate, set by a private option. */
-} FFRawVideoDemuxerContext;
-
-extern const AVOption ff_rawvideo_options[];
-
-int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt);
-
-int ff_raw_audio_read_header(AVFormatContext *s);
-
-int ff_raw_video_read_header(AVFormatContext *s);
-
-#define FF_RAWVIDEO_DEMUXER_CLASS(name)\
-static const AVClass name ## _demuxer_class = {\
-    .class_name = #name " demuxer",\
-    .item_name  = av_default_item_name,\
-    .option     = ff_rawvideo_options,\
-    .version    = LIBAVUTIL_VERSION_INT,\
-};
-
-#define FF_DEF_RAWVIDEO_DEMUXER(shortname, longname, probe, ext, id)\
-FF_RAWVIDEO_DEMUXER_CLASS(shortname)\
-AVInputFormat ff_ ## shortname ## _demuxer = {\
-    .name           = #shortname,\
-    .long_name      = NULL_IF_CONFIG_SMALL(longname),\
-    .read_probe     = probe,\
-    .read_header    = ff_raw_video_read_header,\
-    .read_packet    = ff_raw_read_partial_packet,\
-    .extensions     = ext,\
-    .flags          = AVFMT_GENERIC_INDEX,\
-    .raw_codec_id   = id,\
-    .priv_data_size = sizeof(FFRawVideoDemuxerContext),\
-    .priv_class     = &shortname ## _demuxer_class,\
-};
-
-#endif /* AVFORMAT_RAWDEC_H */
diff --git a/deps/libav/libavformat/rawenc.c b/deps/libav/libavformat/rawenc.c
deleted file mode 100644
index eb50626..0000000
--- a/deps/libav/libavformat/rawenc.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * RAW muxers
- * Copyright (c) 2001 Fabrice Bellard
- * Copyright (c) 2005 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rawenc.h"
-
-int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    avio_write(s->pb, pkt->data, pkt->size);
-    return 0;
-}
-
-/* Note: Do not forget to add new entries to the Makefile as well. */
-
-#if CONFIG_AC3_MUXER
-AVOutputFormat ff_ac3_muxer = {
-    .name              = "ac3",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw AC-3"),
-    .mime_type         = "audio/x-ac3",
-    .extensions        = "ac3",
-    .audio_codec       = AV_CODEC_ID_AC3,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_ADX_MUXER
-AVOutputFormat ff_adx_muxer = {
-    .name              = "adx",
-    .long_name         = NULL_IF_CONFIG_SMALL("CRI ADX"),
-    .extensions        = "adx",
-    .audio_codec       = AV_CODEC_ID_ADPCM_ADX,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_CAVSVIDEO_MUXER
-AVOutputFormat ff_cavsvideo_muxer = {
-    .name              = "cavsvideo",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
-    .extensions        = "cavs",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_CAVS,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_DIRAC_MUXER
-AVOutputFormat ff_dirac_muxer = {
-    .name              = "dirac",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw Dirac"),
-    .extensions        = "drc",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_DIRAC,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_DNXHD_MUXER
-AVOutputFormat ff_dnxhd_muxer = {
-    .name              = "dnxhd",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
-    .extensions        = "dnxhd",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_DNXHD,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_DTS_MUXER
-AVOutputFormat ff_dts_muxer = {
-    .name              = "dts",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw DTS"),
-    .mime_type         = "audio/x-dca",
-    .extensions        = "dts",
-    .audio_codec       = AV_CODEC_ID_DTS,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_EAC3_MUXER
-AVOutputFormat ff_eac3_muxer = {
-    .name              = "eac3",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
-    .mime_type         = "audio/x-eac3",
-    .extensions        = "eac3",
-    .audio_codec       = AV_CODEC_ID_EAC3,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_G722_MUXER
-AVOutputFormat ff_g722_muxer = {
-    .name              = "g722",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw G.722"),
-    .mime_type         = "audio/G722",
-    .extensions        = "g722",
-    .audio_codec       = AV_CODEC_ID_ADPCM_G722,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_H261_MUXER
-AVOutputFormat ff_h261_muxer = {
-    .name              = "h261",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw H.261"),
-    .mime_type         = "video/x-h261",
-    .extensions        = "h261",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_H261,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_H263_MUXER
-AVOutputFormat ff_h263_muxer = {
-    .name              = "h263",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw H.263"),
-    .mime_type         = "video/x-h263",
-    .extensions        = "h263",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_H263,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_H264_MUXER
-AVOutputFormat ff_h264_muxer = {
-    .name              = "h264",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw H.264 video"),
-    .extensions        = "h264",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_H264,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_HEVC_MUXER
-AVOutputFormat ff_hevc_muxer = {
-    .name              = "hevc",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw HEVC video"),
-    .extensions        = "hevc",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_HEVC,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_M4V_MUXER
-AVOutputFormat ff_m4v_muxer = {
-    .name              = "m4v",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
-    .extensions        = "m4v",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MPEG4,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_MJPEG_MUXER
-AVOutputFormat ff_mjpeg_muxer = {
-    .name              = "mjpeg",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
-    .mime_type         = "video/x-mjpeg",
-    .extensions        = "mjpg,mjpeg",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MJPEG,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_MLP_MUXER
-AVOutputFormat ff_mlp_muxer = {
-    .name              = "mlp",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MLP"),
-    .extensions        = "mlp",
-    .audio_codec       = AV_CODEC_ID_MLP,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_MPEG1VIDEO_MUXER
-AVOutputFormat ff_mpeg1video_muxer = {
-    .name              = "mpeg1video",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
-    .mime_type         = "video/x-mpeg",
-    .extensions        = "mpg,mpeg,m1v",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_MPEG2VIDEO_MUXER
-AVOutputFormat ff_mpeg2video_muxer = {
-    .name              = "mpeg2video",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
-    .extensions        = "m2v",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_RAWVIDEO_MUXER
-AVOutputFormat ff_rawvideo_muxer = {
-    .name              = "rawvideo",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw video"),
-    .extensions        = "yuv,rgb",
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
-
-#if CONFIG_SRT_MUXER
-AVOutputFormat ff_srt_muxer = {
-    .name              = "srt",
-    .long_name         = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
-    .mime_type         = "application/x-subrip",
-    .extensions        = "srt",
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .subtitle_codec    = AV_CODEC_ID_SRT,
-};
-#endif
-
-#if CONFIG_TRUEHD_MUXER
-AVOutputFormat ff_truehd_muxer = {
-    .name              = "truehd",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw TrueHD"),
-    .extensions        = "thd",
-    .audio_codec       = AV_CODEC_ID_TRUEHD,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_packet      = ff_raw_write_packet,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
-#endif
diff --git a/deps/libav/libavformat/rawenc.h b/deps/libav/libavformat/rawenc.h
deleted file mode 100644
index daa5489..0000000
--- a/deps/libav/libavformat/rawenc.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * RAW muxers
- * Copyright (C) 2007  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RAWENC_H
-#define AVFORMAT_RAWENC_H
-
-#include "avformat.h"
-
-int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt);
-
-#endif /* AVFORMAT_RAWENC_H */
diff --git a/deps/libav/libavformat/rawvideodec.c b/deps/libav/libavformat/rawvideodec.c
deleted file mode 100644
index 5f372c9..0000000
--- a/deps/libav/libavformat/rawvideodec.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * RAW video demuxer
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/opt.h"
-#include "internal.h"
-#include "avformat.h"
-
-typedef struct RawVideoDemuxerContext {
-    const AVClass *class;     /**< Class for private options. */
-    char *video_size;         /**< String describing video size, set by a private option. */
-    char *pixel_format;       /**< Set by a private option. */
-    char *framerate;          /**< String describing framerate, set by a private option. */
-} RawVideoDemuxerContext;
-
-
-static int rawvideo_read_header(AVFormatContext *ctx)
-{
-    RawVideoDemuxerContext *s = ctx->priv_data;
-    int width = 0, height = 0, ret = 0;
-    enum AVPixelFormat pix_fmt;
-    AVRational framerate;
-    AVStream *st;
-
-    st = avformat_new_stream(ctx, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-
-    st->codec->codec_id = ctx->iformat->raw_codec_id;
-
-    if (s->video_size &&
-        (ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Couldn't parse video size.\n");
-        return ret;
-    }
-
-    if ((pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
-        av_log(ctx, AV_LOG_ERROR, "No such pixel format: %s.\n",
-               s->pixel_format);
-        return AVERROR(EINVAL);
-    }
-
-    if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n",
-               s->framerate);
-        return ret;
-    }
-
-    avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
-
-    st->codec->width  = width;
-    st->codec->height = height;
-    st->codec->pix_fmt = pix_fmt;
-
-    return 0;
-}
-
-
-static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int packet_size, ret, width, height;
-    AVStream *st = s->streams[0];
-
-    width = st->codec->width;
-    height = st->codec->height;
-
-    packet_size = avpicture_get_size(st->codec->pix_fmt, width, height);
-    if (packet_size < 0)
-        return -1;
-
-    ret = av_get_packet(s->pb, pkt, packet_size);
-    pkt->pts = pkt->dts = pkt->pos / packet_size;
-
-    pkt->stream_index = 0;
-    if (ret < 0)
-        return ret;
-    return 0;
-}
-
-#define OFFSET(x) offsetof(RawVideoDemuxerContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption rawvideo_options[] = {
-    { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
-    { "pixel_format", "", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = "yuv420p"}, 0, 0, DEC },
-    { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
-    { NULL },
-};
-
-static const AVClass rawvideo_demuxer_class = {
-    .class_name = "rawvideo demuxer",
-    .item_name  = av_default_item_name,
-    .option     = rawvideo_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_rawvideo_demuxer = {
-    .name           = "rawvideo",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw video"),
-    .priv_data_size = sizeof(RawVideoDemuxerContext),
-    .read_header    = rawvideo_read_header,
-    .read_packet    = rawvideo_read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "yuv,cif,qcif,rgb",
-    .raw_codec_id   = AV_CODEC_ID_RAWVIDEO,
-    .priv_class     = &rawvideo_demuxer_class,
-};
diff --git a/deps/libav/libavformat/rdt.c b/deps/libav/libavformat/rdt.c
deleted file mode 100644
index a90c168..0000000
--- a/deps/libav/libavformat/rdt.c
+++ /dev/null
@@ -1,573 +0,0 @@
-/*
- * Realmedia RTSP protocol (RDT) support.
- * Copyright (c) 2007 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Realmedia RTSP protocol (RDT) support
- * @author Ronald S. Bultje <rbultje at ronald.bitfreak.net>
- */
-
-#include "avformat.h"
-#include "libavutil/avstring.h"
-#include "rtpdec.h"
-#include "rdt.h"
-#include "libavutil/base64.h"
-#include "libavutil/md5.h"
-#include "rm.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "libavcodec/get_bits.h"
-
-struct RDTDemuxContext {
-    AVFormatContext *ic; /**< the containing (RTSP) demux context */
-    /** Each RDT stream-set (represented by one RTSPStream) can contain
-     * multiple streams (of the same content, but with possibly different
-     * codecs/bitrates). Each such stream is represented by one AVStream
-     * in the AVFormatContext, and this variable points to the offset in
-     * that array such that the first is the first stream of this set. */
-    AVStream **streams;
-    int n_streams; /**< streams with identifical content in this set */
-    void *dynamic_protocol_context;
-    DynamicPayloadPacketHandlerProc parse_packet;
-    uint32_t prev_timestamp;
-    int prev_set_id, prev_stream_id;
-};
-
-RDTDemuxContext *
-ff_rdt_parse_open(AVFormatContext *ic, int first_stream_of_set_idx,
-                  void *priv_data, RTPDynamicProtocolHandler *handler)
-{
-    RDTDemuxContext *s = av_mallocz(sizeof(RDTDemuxContext));
-    if (!s)
-        return NULL;
-
-    s->ic = ic;
-    s->streams = &ic->streams[first_stream_of_set_idx];
-    do {
-        s->n_streams++;
-    } while (first_stream_of_set_idx + s->n_streams < ic->nb_streams &&
-             s->streams[s->n_streams]->id == s->streams[0]->id);
-    s->prev_set_id    = -1;
-    s->prev_stream_id = -1;
-    s->prev_timestamp = -1;
-    s->parse_packet = handler ? handler->parse_packet : NULL;
-    s->dynamic_protocol_context = priv_data;
-
-    return s;
-}
-
-void
-ff_rdt_parse_close(RDTDemuxContext *s)
-{
-    av_free(s);
-}
-
-struct PayloadContext {
-    AVFormatContext *rmctx;
-    int nb_rmst;
-    RMStream **rmst;
-    uint8_t *mlti_data;
-    unsigned int mlti_data_size;
-    char buffer[RTP_MAX_PACKET_LENGTH + FF_INPUT_BUFFER_PADDING_SIZE];
-    int audio_pkt_cnt; /**< remaining audio packets in rmdec */
-};
-
-void
-ff_rdt_calc_response_and_checksum(char response[41], char chksum[9],
-                                  const char *challenge)
-{
-    int ch_len = strlen (challenge), i;
-    unsigned char zres[16],
-        buf[64] = { 0xa1, 0xe9, 0x14, 0x9d, 0x0e, 0x6b, 0x3b, 0x59 };
-#define XOR_TABLE_SIZE 37
-    const unsigned char xor_table[XOR_TABLE_SIZE] = {
-        0x05, 0x18, 0x74, 0xd0, 0x0d, 0x09, 0x02, 0x53,
-        0xc0, 0x01, 0x05, 0x05, 0x67, 0x03, 0x19, 0x70,
-        0x08, 0x27, 0x66, 0x10, 0x10, 0x72, 0x08, 0x09,
-        0x63, 0x11, 0x03, 0x71, 0x08, 0x08, 0x70, 0x02,
-        0x10, 0x57, 0x05, 0x18, 0x54 };
-
-    /* some (length) checks */
-    if (ch_len == 40) /* what a hack... */
-        ch_len = 32;
-    else if (ch_len > 56)
-        ch_len = 56;
-    memcpy(buf + 8, challenge, ch_len);
-
-    /* xor challenge bytewise with xor_table */
-    for (i = 0; i < XOR_TABLE_SIZE; i++)
-        buf[8 + i] ^= xor_table[i];
-
-    av_md5_sum(zres, buf, 64);
-    ff_data_to_hex(response, zres, 16, 1);
-
-    /* add tail */
-    strcpy (response + 32, "01d0a8e3");
-
-    /* calculate checksum */
-    for (i = 0; i < 8; i++)
-        chksum[i] = response[i * 4];
-    chksum[8] = 0;
-}
-
-static int
-rdt_load_mdpr (PayloadContext *rdt, AVStream *st, int rule_nr)
-{
-    AVIOContext pb;
-    int size;
-    uint32_t tag;
-
-    /**
-     * Layout of the MLTI chunk:
-     * 4: MLTI
-     * 2: number of streams
-     * Then for each stream ([number_of_streams] times):
-     *     2: mdpr index
-     * 2: number of mdpr chunks
-     * Then for each mdpr chunk ([number_of_mdpr_chunks] times):
-     *     4: size
-     *     [size]: data
-     * we skip MDPR chunks until we reach the one of the stream
-     * we're interested in, and forward that ([size]+[data]) to
-     * the RM demuxer to parse the stream-specific header data.
-     */
-    if (!rdt->mlti_data)
-        return -1;
-    ffio_init_context(&pb, rdt->mlti_data, rdt->mlti_data_size, 0,
-                  NULL, NULL, NULL, NULL);
-    tag = avio_rl32(&pb);
-    if (tag == MKTAG('M', 'L', 'T', 'I')) {
-        int num, chunk_nr;
-
-        /* read index of MDPR chunk numbers */
-        num = avio_rb16(&pb);
-        if (rule_nr < 0 || rule_nr >= num)
-            return -1;
-        avio_skip(&pb, rule_nr * 2);
-        chunk_nr = avio_rb16(&pb);
-        avio_skip(&pb, (num - 1 - rule_nr) * 2);
-
-        /* read MDPR chunks */
-        num = avio_rb16(&pb);
-        if (chunk_nr >= num)
-            return -1;
-        while (chunk_nr--)
-            avio_skip(&pb, avio_rb32(&pb));
-        size = avio_rb32(&pb);
-    } else {
-        size = rdt->mlti_data_size;
-        avio_seek(&pb, 0, SEEK_SET);
-    }
-    if (ff_rm_read_mdpr_codecdata(rdt->rmctx, &pb, st, rdt->rmst[st->index], size) < 0)
-        return -1;
-
-    return 0;
-}
-
-/**
- * Actual data handling.
- */
-
-int
-ff_rdt_parse_header(const uint8_t *buf, int len,
-                    int *pset_id, int *pseq_no, int *pstream_id,
-                    int *pis_keyframe, uint32_t *ptimestamp)
-{
-    GetBitContext gb;
-    int consumed = 0, set_id, seq_no, stream_id, is_keyframe,
-        len_included, need_reliable;
-    uint32_t timestamp;
-
-    /* skip status packets */
-    while (len >= 5 && buf[1] == 0xFF /* status packet */) {
-        int pkt_len;
-
-        if (!(buf[0] & 0x80))
-            return -1; /* not followed by a data packet */
-
-        pkt_len = AV_RB16(buf+3);
-        buf += pkt_len;
-        len -= pkt_len;
-        consumed += pkt_len;
-    }
-    if (len < 16)
-        return -1;
-    /**
-     * Layout of the header (in bits):
-     * 1:  len_included
-     *     Flag indicating whether this header includes a length field;
-     *     this can be used to concatenate multiple RDT packets in a
-     *     single UDP/TCP data frame and is used to precede RDT data
-     *     by stream status packets
-     * 1:  need_reliable
-     *     Flag indicating whether this header includes a "reliable
-     *     sequence number"; these are apparently sequence numbers of
-     *     data packets alone. For data packets, this flag is always
-     *     set, according to the Real documentation [1]
-     * 5:  set_id
-     *     ID of a set of streams of identical content, possibly with
-     *     different codecs or bitrates
-     * 1:  is_reliable
-     *     Flag set for certain streams deemed less tolerable for packet
-     *     loss
-     * 16: seq_no
-     *     Packet sequence number; if >=0xFF00, this is a non-data packet
-     *     containing stream status info, the second byte indicates the
-     *     type of status packet (see wireshark docs / source code [2])
-     * if (len_included) {
-     *     16: packet_len
-     * } else {
-     *     packet_len = remainder of UDP/TCP frame
-     * }
-     * 1:  is_back_to_back
-     *     Back-to-Back flag; used for timing, set for one in every 10
-     *     packets, according to the Real documentation [1]
-     * 1:  is_slow_data
-     *     Slow-data flag; currently unused, according to Real docs [1]
-     * 5:  stream_id
-     *     ID of the stream within this particular set of streams
-     * 1:  is_no_keyframe
-     *     Non-keyframe flag (unset if packet belongs to a keyframe)
-     * 32: timestamp (PTS)
-     * if (set_id == 0x1F) {
-     *     16: set_id (extended set-of-streams ID; see set_id)
-     * }
-     * if (need_reliable) {
-     *     16: reliable_seq_no
-     *         Reliable sequence number (see need_reliable)
-     * }
-     * if (stream_id == 0x3F) {
-     *     16: stream_id (extended stream ID; see stream_id)
-     * }
-     * [1] https://protocol.helixcommunity.org/files/2005/devdocs/RDT_Feature_Level_20.txt
-     * [2] http://www.wireshark.org/docs/dfref/r/rdt.html and
-     *     http://anonsvn.wireshark.org/viewvc/trunk/epan/dissectors/packet-rdt.c
-     */
-    init_get_bits(&gb, buf, len << 3);
-    len_included  = get_bits1(&gb);
-    need_reliable = get_bits1(&gb);
-    set_id        = get_bits(&gb, 5);
-    skip_bits(&gb, 1);
-    seq_no        = get_bits(&gb, 16);
-    if (len_included)
-        skip_bits(&gb, 16);
-    skip_bits(&gb, 2);
-    stream_id     = get_bits(&gb, 5);
-    is_keyframe   = !get_bits1(&gb);
-    timestamp     = get_bits_long(&gb, 32);
-    if (set_id == 0x1f)
-        set_id    = get_bits(&gb, 16);
-    if (need_reliable)
-        skip_bits(&gb, 16);
-    if (stream_id == 0x1f)
-        stream_id = get_bits(&gb, 16);
-
-    if (pset_id)      *pset_id      = set_id;
-    if (pseq_no)      *pseq_no      = seq_no;
-    if (pstream_id)   *pstream_id   = stream_id;
-    if (pis_keyframe) *pis_keyframe = is_keyframe;
-    if (ptimestamp)   *ptimestamp   = timestamp;
-
-    return consumed + (get_bits_count(&gb) >> 3);
-}
-
-/**< return 0 on packet, no more left, 1 on packet, 1 on partial packet... */
-static int
-rdt_parse_packet (AVFormatContext *ctx, PayloadContext *rdt, AVStream *st,
-                  AVPacket *pkt, uint32_t *timestamp,
-                  const uint8_t *buf, int len, uint16_t rtp_seq, int flags)
-{
-    int seq = 1, res;
-    AVIOContext pb;
-
-    if (rdt->audio_pkt_cnt == 0) {
-        int pos;
-
-        ffio_init_context(&pb, buf, len, 0, NULL, NULL, NULL, NULL);
-        flags = (flags & RTP_FLAG_KEY) ? 2 : 0;
-        res = ff_rm_parse_packet (rdt->rmctx, &pb, st, rdt->rmst[st->index], len, pkt,
-                                  &seq, flags, *timestamp);
-        pos = avio_tell(&pb);
-        if (res < 0)
-            return res;
-        if (res > 0) {
-            if (st->codec->codec_id == AV_CODEC_ID_AAC) {
-                memcpy (rdt->buffer, buf + pos, len - pos);
-                rdt->rmctx->pb = avio_alloc_context (rdt->buffer, len - pos, 0,
-                                                    NULL, NULL, NULL, NULL);
-            }
-            goto get_cache;
-        }
-    } else {
-get_cache:
-        rdt->audio_pkt_cnt =
-            ff_rm_retrieve_cache (rdt->rmctx, rdt->rmctx->pb,
-                                  st, rdt->rmst[st->index], pkt);
-        if (rdt->audio_pkt_cnt == 0 &&
-            st->codec->codec_id == AV_CODEC_ID_AAC)
-            av_freep(&rdt->rmctx->pb);
-    }
-    pkt->stream_index = st->index;
-    pkt->pts = *timestamp;
-
-    return rdt->audio_pkt_cnt > 0;
-}
-
-int
-ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt,
-                    uint8_t **bufptr, int len)
-{
-    uint8_t *buf = bufptr ? *bufptr : NULL;
-    int seq_no, flags = 0, stream_id, set_id, is_keyframe;
-    uint32_t timestamp;
-    int rv= 0;
-
-    if (!s->parse_packet)
-        return -1;
-
-    if (!buf && s->prev_stream_id != -1) {
-        /* return the next packets, if any */
-        timestamp= 0; ///< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned....
-        rv= s->parse_packet(s->ic, s->dynamic_protocol_context,
-                            s->streams[s->prev_stream_id],
-                            pkt, &timestamp, NULL, 0, 0, flags);
-        return rv;
-    }
-
-    if (len < 12)
-        return -1;
-    rv = ff_rdt_parse_header(buf, len, &set_id, &seq_no, &stream_id, &is_keyframe, &timestamp);
-    if (rv < 0)
-        return rv;
-    if (is_keyframe &&
-        (set_id != s->prev_set_id || timestamp != s->prev_timestamp ||
-         stream_id != s->prev_stream_id)) {
-        flags |= RTP_FLAG_KEY;
-        s->prev_set_id    = set_id;
-        s->prev_timestamp = timestamp;
-    }
-    s->prev_stream_id = stream_id;
-    buf += rv;
-    len -= rv;
-
-     if (s->prev_stream_id >= s->n_streams) {
-         s->prev_stream_id = -1;
-         return -1;
-     }
-
-    rv = s->parse_packet(s->ic, s->dynamic_protocol_context,
-                         s->streams[s->prev_stream_id],
-                         pkt, &timestamp, buf, len, 0, flags);
-
-    return rv;
-}
-
-void
-ff_rdt_subscribe_rule (char *cmd, int size,
-                       int stream_nr, int rule_nr)
-{
-    av_strlcatf(cmd, size, "stream=%d;rule=%d,stream=%d;rule=%d",
-                stream_nr, rule_nr * 2, stream_nr, rule_nr * 2 + 1);
-}
-
-static unsigned char *
-rdt_parse_b64buf (unsigned int *target_len, const char *p)
-{
-    unsigned char *target;
-    int len = strlen(p);
-    if (*p == '\"') {
-        p++;
-        len -= 2; /* skip embracing " at start/end */
-    }
-    *target_len = len * 3 / 4;
-    target = av_mallocz(*target_len + FF_INPUT_BUFFER_PADDING_SIZE);
-    av_base64_decode(target, p, *target_len);
-    return target;
-}
-
-static int
-rdt_parse_sdp_line (AVFormatContext *s, int st_index,
-                    PayloadContext *rdt, const char *line)
-{
-    AVStream *stream = s->streams[st_index];
-    const char *p = line;
-
-    if (av_strstart(p, "OpaqueData:buffer;", &p)) {
-        rdt->mlti_data = rdt_parse_b64buf(&rdt->mlti_data_size, p);
-    } else if (av_strstart(p, "StartTime:integer;", &p))
-        stream->first_dts = atoi(p);
-    else if (av_strstart(p, "ASMRuleBook:string;", &p)) {
-        int n, first = -1;
-
-        for (n = 0; n < s->nb_streams; n++)
-            if (s->streams[n]->id == stream->id) {
-                int count = s->streams[n]->index + 1, err;
-                if (first == -1) first = n;
-                if (rdt->nb_rmst < count) {
-                    if ((err = av_reallocp(&rdt->rmst,
-                                           count * sizeof(*rdt->rmst))) < 0) {
-                        rdt->nb_rmst = 0;
-                        return err;
-                    }
-                    memset(rdt->rmst + rdt->nb_rmst, 0,
-                           (count - rdt->nb_rmst) * sizeof(*rdt->rmst));
-                    rdt->nb_rmst = count;
-                }
-                rdt->rmst[s->streams[n]->index] = ff_rm_alloc_rmstream();
-                rdt_load_mdpr(rdt, s->streams[n], (n - first) * 2);
-           }
-    }
-
-    return 0;
-}
-
-static void
-real_parse_asm_rule(AVStream *st, const char *p, const char *end)
-{
-    do {
-        /* can be either averagebandwidth= or AverageBandwidth= */
-        if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%d", &st->codec->bit_rate) == 1)
-            break;
-        if (!(p = strchr(p, ',')) || p > end)
-            p = end;
-        p++;
-    } while (p < end);
-}
-
-static AVStream *
-add_dstream(AVFormatContext *s, AVStream *orig_st)
-{
-    AVStream *st;
-
-    if (!(st = avformat_new_stream(s, NULL)))
-        return NULL;
-    st->id = orig_st->id;
-    st->codec->codec_type = orig_st->codec->codec_type;
-    st->first_dts         = orig_st->first_dts;
-
-    return st;
-}
-
-static void
-real_parse_asm_rulebook(AVFormatContext *s, AVStream *orig_st,
-                        const char *p)
-{
-    const char *end;
-    int n_rules = 0, odd = 0;
-    AVStream *st;
-
-    /**
-     * The ASMRuleBook contains a list of comma-separated strings per rule,
-     * and each rule is separated by a ;. The last one also has a ; at the
-     * end so we can use it as delimiter.
-     * Every rule occurs twice, once for when the RTSP packet header marker
-     * is set and once for if it isn't. We only read the first because we
-     * don't care much (that's what the "odd" variable is for).
-     * Each rule contains a set of one or more statements, optionally
-     * preceded by a single condition. If there's a condition, the rule
-     * starts with a '#'. Multiple conditions are merged between brackets,
-     * so there are never multiple conditions spread out over separate
-     * statements. Generally, these conditions are bitrate limits (min/max)
-     * for multi-bitrate streams.
-     */
-    if (*p == '\"') p++;
-    while (1) {
-        if (!(end = strchr(p, ';')))
-            break;
-        if (!odd && end != p) {
-            if (n_rules > 0)
-                st = add_dstream(s, orig_st);
-            else
-                st = orig_st;
-            if (!st)
-                break;
-            real_parse_asm_rule(st, p, end);
-            n_rules++;
-        }
-        p = end + 1;
-        odd ^= 1;
-    }
-}
-
-void
-ff_real_parse_sdp_a_line (AVFormatContext *s, int stream_index,
-                          const char *line)
-{
-    const char *p = line;
-
-    if (av_strstart(p, "ASMRuleBook:string;", &p))
-        real_parse_asm_rulebook(s, s->streams[stream_index], p);
-}
-
-static PayloadContext *
-rdt_new_context (void)
-{
-    PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));
-
-    int ret = avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);
-    if (ret < 0) {
-        av_free(rdt);
-        return NULL;
-    }
-
-    return rdt;
-}
-
-static void
-rdt_free_context (PayloadContext *rdt)
-{
-    int i;
-
-    for (i = 0; i < rdt->nb_rmst; i++)
-        if (rdt->rmst[i]) {
-            ff_rm_free_rmstream(rdt->rmst[i]);
-            av_freep(&rdt->rmst[i]);
-        }
-    if (rdt->rmctx)
-        avformat_close_input(&rdt->rmctx);
-    av_freep(&rdt->mlti_data);
-    av_freep(&rdt->rmst);
-    av_free(rdt);
-}
-
-#define RDT_HANDLER(n, s, t) \
-static RTPDynamicProtocolHandler rdt_ ## n ## _handler = { \
-    .enc_name         = s, \
-    .codec_type       = t, \
-    .codec_id         = AV_CODEC_ID_NONE, \
-    .parse_sdp_a_line = rdt_parse_sdp_line, \
-    .alloc            = rdt_new_context, \
-    .free             = rdt_free_context, \
-    .parse_packet     = rdt_parse_packet \
-}
-
-RDT_HANDLER(live_video, "x-pn-multirate-realvideo-live", AVMEDIA_TYPE_VIDEO);
-RDT_HANDLER(live_audio, "x-pn-multirate-realaudio-live", AVMEDIA_TYPE_AUDIO);
-RDT_HANDLER(video,      "x-pn-realvideo",                AVMEDIA_TYPE_VIDEO);
-RDT_HANDLER(audio,      "x-pn-realaudio",                AVMEDIA_TYPE_AUDIO);
-
-void ff_register_rdt_dynamic_payload_handlers(void)
-{
-    ff_register_dynamic_payload_handler(&rdt_video_handler);
-    ff_register_dynamic_payload_handler(&rdt_audio_handler);
-    ff_register_dynamic_payload_handler(&rdt_live_video_handler);
-    ff_register_dynamic_payload_handler(&rdt_live_audio_handler);
-}
diff --git a/deps/libav/libavformat/rdt.h b/deps/libav/libavformat/rdt.h
deleted file mode 100644
index bd16890..0000000
--- a/deps/libav/libavformat/rdt.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Realmedia RTSP (RDT) definitions
- * Copyright (c) 2007 Ronald S. Bultje <rbultje at ronald.bitfreak.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RDT_H
-#define AVFORMAT_RDT_H
-
-#include <stdint.h>
-#include "avformat.h"
-#include "rtpdec.h"
-
-typedef struct RDTDemuxContext RDTDemuxContext;
-
-/**
- * Allocate and init the RDT parsing context.
- * @param ic the containing RTSP demuxer context
- * @param first_stream_of_set_idx index to the first AVStream in the RTSP
- *              demuxer context's ic->streams array that is part of this
- *              particular stream's set of streams (with identical content)
- * @param priv_data private data of the payload data handler context
- * @param handler pointer to the parse_packet() payload parsing function
- * @return a newly allocated RDTDemuxContext. Free with ff_rdt_parse_close().
- */
-RDTDemuxContext *ff_rdt_parse_open(AVFormatContext *ic,
-                                   int first_stream_of_set_idx,
-                                   void *priv_data,
-                                   RTPDynamicProtocolHandler *handler);
-void ff_rdt_parse_close(RDTDemuxContext *s);
-
-/**
- * Calculate the response (RealChallenge2 in the RTSP header) to the
- * challenge (RealChallenge1 in the RTSP header from the Real/Helix
- * server), which is used as some sort of client validation.
- *
- * @param response pointer to response buffer, it should be at least 41 bytes
- *                 (40 data + 1 zero) bytes long.
- * @param chksum pointer to buffer containing a checksum of the response,
- *               it should be at least 9 (8 data + 1 zero) bytes long.
- * @param challenge pointer to the RealChallenge1 value provided by the
- *                  server.
- */
-void ff_rdt_calc_response_and_checksum(char response[41], char chksum[9],
-                                       const char *challenge);
-
-/**
- * Register RDT-related dynamic payload handlers with our cache.
- */
-void ff_register_rdt_dynamic_payload_handlers(void);
-
-/**
- * Add subscription information to Subscribe parameter string.
- *
- * @param cmd string to write the subscription information into.
- * @param size size of cmd.
- * @param stream_nr stream number.
- * @param rule_nr rule number to conform to.
- */
-void ff_rdt_subscribe_rule(char *cmd, int size,
-                           int stream_nr, int rule_nr);
-
-/**
- * Parse RDT-style packet header.
- *
- * @param buf input buffer
- * @param len length of input buffer
- * @param pset_id will be set to the set ID this packet belongs to
- * @param pseq_no will be set to the sequence number of the packet
- * @param pstream_id will be set to the stream ID this packet belongs to
- * @param pis_keyframe will be whether this packet belongs to a keyframe
- * @param ptimestamp will be set to the timestamp of the packet
- * @return the amount of bytes consumed, or negative on error
- */
-int ff_rdt_parse_header(const uint8_t *buf, int len,
-                        int *pset_id, int *pseq_no, int *pstream_id,
-                        int *pis_keyframe, uint32_t *ptimestamp);
-
-/**
- * Parse RDT-style packet data (header + media data).
- * Usage similar to rtp_parse_packet().
- */
-int ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt,
-                        uint8_t **buf, int len);
-
-/**
- * Parse a server-related SDP line.
- *
- * @param s the RTSP AVFormatContext
- * @param stream_index the index of the first stream in the set represented
- *               by the SDP m= line (in s->streams)
- * @param buf the SDP line
- */
-void ff_real_parse_sdp_a_line(AVFormatContext *s, int stream_index,
-                              const char *buf);
-
-#endif /* AVFORMAT_RDT_H */
diff --git a/deps/libav/libavformat/riff.c b/deps/libav/libavformat/riff.c
deleted file mode 100644
index 545ecaf..0000000
--- a/deps/libav/libavformat/riff.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * RIFF common functions and data
- * Copyright (c) 2000 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/error.h"
-#include "libavcodec/avcodec.h"
-#include "avformat.h"
-#include "riff.h"
-
-/* Note: When encoding, the first matching tag is used, so order is
- * important if multiple tags are possible for a given codec. */
-const AVCodecTag ff_codec_bmp_tags[] = {
-    { AV_CODEC_ID_H264,         MKTAG('H', '2', '6', '4') },
-    { AV_CODEC_ID_H264,         MKTAG('h', '2', '6', '4') },
-    { AV_CODEC_ID_H264,         MKTAG('X', '2', '6', '4') },
-    { AV_CODEC_ID_H264,         MKTAG('x', '2', '6', '4') },
-    { AV_CODEC_ID_H264,         MKTAG('a', 'v', 'c', '1') },
-    { AV_CODEC_ID_H264,         MKTAG('D', 'A', 'V', 'C') },
-    { AV_CODEC_ID_H264,         MKTAG('V', 'S', 'S', 'H') },
-    { AV_CODEC_ID_H263,         MKTAG('H', '2', '6', '3') },
-    { AV_CODEC_ID_H263,         MKTAG('X', '2', '6', '3') },
-    { AV_CODEC_ID_H263,         MKTAG('T', '2', '6', '3') },
-    { AV_CODEC_ID_H263,         MKTAG('L', '2', '6', '3') },
-    { AV_CODEC_ID_H263,         MKTAG('V', 'X', '1', 'K') },
-    { AV_CODEC_ID_H263,         MKTAG('Z', 'y', 'G', 'o') },
-    { AV_CODEC_ID_H263,         MKTAG('M', '2', '6', '3') },
-    { AV_CODEC_ID_H263P,        MKTAG('H', '2', '6', '3') },
-    { AV_CODEC_ID_H263I,        MKTAG('I', '2', '6', '3') }, /* Intel H.263 */
-    { AV_CODEC_ID_H261,         MKTAG('H', '2', '6', '1') },
-    { AV_CODEC_ID_H263P,        MKTAG('U', '2', '6', '3') },
-    { AV_CODEC_ID_H263P,        MKTAG('v', 'i', 'v', '1') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('F', 'M', 'P', '4') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('D', 'I', 'V', 'X') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('D', 'X', '5', '0') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('X', 'V', 'I', 'D') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('M', 'P', '4', 'S') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('M', '4', 'S', '2') },
-    /* some broken AVIs use this */
-    { AV_CODEC_ID_MPEG4,        MKTAG( 4 ,  0 ,  0 ,  0 ) },
-    /* some broken AVIs use this */
-    { AV_CODEC_ID_MPEG4,        MKTAG('Z', 'M', 'P', '4') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('D', 'I', 'V', '1') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('B', 'L', 'Z', '0') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('m', 'p', '4', 'v') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('U', 'M', 'P', '4') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('W', 'V', '1', 'F') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('S', 'E', 'D', 'G') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('R', 'M', 'P', '4') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('3', 'I', 'V', '2') },
-    /* WaWv MPEG-4 Video Codec */
-    { AV_CODEC_ID_MPEG4,        MKTAG('W', 'A', 'W', 'V') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('F', 'F', 'D', 'S') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('F', 'V', 'F', 'W') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('D', 'C', 'O', 'D') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('M', 'V', 'X', 'M') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('P', 'M', '4', 'V') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('S', 'M', 'P', '4') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('D', 'X', 'G', 'M') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('V', 'I', 'D', 'M') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('M', '4', 'T', '3') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('G', 'E', 'O', 'X') },
-    /* flipped video */
-    { AV_CODEC_ID_MPEG4,        MKTAG('H', 'D', 'X', '4') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('D', 'M', 'K', '2') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('D', 'I', 'G', 'I') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('I', 'N', 'M', 'C') },
-    /* Ephv MPEG-4 */
-    { AV_CODEC_ID_MPEG4,        MKTAG('E', 'P', 'H', 'V') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('E', 'M', '4', 'A') },
-    /* Divio MPEG-4 */
-    { AV_CODEC_ID_MPEG4,        MKTAG('M', '4', 'C', 'C') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('S', 'N', '4', '0') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('V', 'S', 'P', 'X') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('U', 'L', 'D', 'X') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('G', 'E', 'O', 'V') },
-    /* Samsung SHR-6040 */
-    { AV_CODEC_ID_MPEG4,        MKTAG('S', 'I', 'P', 'P') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('X', 'V', 'I', 'X') },
-    { AV_CODEC_ID_MPEG4,        MKTAG('D', 'r', 'e', 'X') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('M', 'P', '4', '3') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('D', 'I', 'V', '3') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('M', 'P', 'G', '3') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('D', 'I', 'V', '5') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('D', 'I', 'V', '6') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('D', 'I', 'V', '4') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('D', 'V', 'X', '3') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('A', 'P', '4', '1') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('C', 'O', 'L', '1') },
-    { AV_CODEC_ID_MSMPEG4V3,    MKTAG('C', 'O', 'L', '0') },
-    { AV_CODEC_ID_MSMPEG4V2,    MKTAG('M', 'P', '4', '2') },
-    { AV_CODEC_ID_MSMPEG4V2,    MKTAG('D', 'I', 'V', '2') },
-    { AV_CODEC_ID_MSMPEG4V1,    MKTAG('M', 'P', 'G', '4') },
-    { AV_CODEC_ID_MSMPEG4V1,    MKTAG('M', 'P', '4', '1') },
-    { AV_CODEC_ID_WMV1,         MKTAG('W', 'M', 'V', '1') },
-    { AV_CODEC_ID_WMV2,         MKTAG('W', 'M', 'V', '2') },
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('d', 'v', 's', 'd') },
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('d', 'v', 'h', 'd') },
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('d', 'v', 'h', '1') },
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('d', 'v', 's', 'l') },
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('d', 'v', '2', '5') },
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('d', 'v', '5', '0') },
-    /* Canopus DV */
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('c', 'd', 'v', 'c') },
-    /* Canopus DV */
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('C', 'D', 'V', 'H') },
-    /* Canopus DV */
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('C', 'D', 'V', '5') },
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('d', 'v', 'c', ' ') },
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('d', 'v', 'c', 's') },
-    { AV_CODEC_ID_DVVIDEO,      MKTAG('d', 'v', 'h', '1') },
-    { AV_CODEC_ID_MPEG1VIDEO,   MKTAG('m', 'p', 'g', '1') },
-    { AV_CODEC_ID_MPEG1VIDEO,   MKTAG('m', 'p', 'g', '2') },
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('m', 'p', 'g', '2') },
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('M', 'P', 'E', 'G') },
-    { AV_CODEC_ID_MPEG1VIDEO,   MKTAG('P', 'I', 'M', '1') },
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('P', 'I', 'M', '2') },
-    { AV_CODEC_ID_MPEG1VIDEO,   MKTAG('V', 'C', 'R', '2') },
-    { AV_CODEC_ID_MPEG1VIDEO,   MKTAG( 1 ,  0 ,  0 ,  16) },
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG( 2 ,  0 ,  0 ,  16) },
-    { AV_CODEC_ID_MPEG4,        MKTAG( 4 ,  0 ,  0 ,  16) },
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('D', 'V', 'R', ' ') },
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('M', 'M', 'E', 'S') },
-    /* Lead MPEG-2 in AVI */
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('L', 'M', 'P', '2') },
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('s', 'l', 'i', 'f') },
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('E', 'M', '2', 'V') },
-    /* Matrox MPEG-2 intra-only */
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('M', '7', '0', '1') },
-    { AV_CODEC_ID_MPEG2VIDEO,   MKTAG('m', 'p', 'g', 'v') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('M', 'J', 'P', 'G') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('L', 'J', 'P', 'G') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('d', 'm', 'b', '1') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('m', 'j', 'p', 'a') },
-    { AV_CODEC_ID_LJPEG,        MKTAG('L', 'J', 'P', 'G') },
-    /* Pegasus lossless JPEG */
-    { AV_CODEC_ID_MJPEG,        MKTAG('J', 'P', 'G', 'L') },
-    /* JPEG-LS custom FOURCC for AVI - encoder */
-    { AV_CODEC_ID_JPEGLS,       MKTAG('M', 'J', 'L', 'S') },
-    { AV_CODEC_ID_JPEGLS,       MKTAG('M', 'J', 'P', 'G') },
-    /* JPEG-LS custom FOURCC for AVI - decoder */
-    { AV_CODEC_ID_MJPEG,        MKTAG('M', 'J', 'L', 'S') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('j', 'p', 'e', 'g') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('I', 'J', 'P', 'G') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('A', 'V', 'R', 'n') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('A', 'C', 'D', 'V') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('Q', 'I', 'V', 'G') },
-    /* SL M-JPEG */
-    { AV_CODEC_ID_MJPEG,        MKTAG('S', 'L', 'M', 'J') },
-    /* Creative Webcam JPEG */
-    { AV_CODEC_ID_MJPEG,        MKTAG('C', 'J', 'P', 'G') },
-    /* Intel JPEG Library Video Codec */
-    { AV_CODEC_ID_MJPEG,        MKTAG('I', 'J', 'L', 'V') },
-    /* Midvid JPEG Video Codec */
-    { AV_CODEC_ID_MJPEG,        MKTAG('M', 'V', 'J', 'P') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('A', 'V', 'I', '1') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('A', 'V', 'I', '2') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('M', 'T', 'S', 'J') },
-    /* Paradigm Matrix M-JPEG Codec */
-    { AV_CODEC_ID_MJPEG,        MKTAG('Z', 'J', 'P', 'G') },
-    { AV_CODEC_ID_MJPEG,        MKTAG('M', 'M', 'J', 'P') },
-    { AV_CODEC_ID_HUFFYUV,      MKTAG('H', 'F', 'Y', 'U') },
-    { AV_CODEC_ID_FFVHUFF,      MKTAG('F', 'F', 'V', 'H') },
-    { AV_CODEC_ID_CYUV,         MKTAG('C', 'Y', 'U', 'V') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG( 0 ,  0 ,  0 ,  0 ) },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG( 3 ,  0 ,  0 ,  0 ) },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('I', '4', '2', '0') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', 'U', 'Y', '2') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', '4', '2', '2') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('V', '4', '2', '2') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', 'U', 'N', 'V') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('U', 'Y', 'N', 'V') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('U', 'Y', 'N', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('u', 'y', 'v', '1') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('2', 'V', 'u', '1') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('2', 'v', 'u', 'y') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('y', 'u', 'v', 's') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('y', 'u', 'v', '2') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('P', '4', '2', '2') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', 'V', '1', '2') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', 'V', '1', '6') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', 'V', '2', '4') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('U', 'Y', 'V', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('V', 'Y', 'U', 'Y') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('I', 'Y', 'U', 'V') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', '8', '0', '0') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', '8', ' ', ' ') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('H', 'D', 'Y', 'C') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', 'V', 'U', '9') },
-    /* SoftLab-NSK VideoTizer */
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('V', 'D', 'T', 'Z') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', '4', '1', '1') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('N', 'V', '1', '2') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('N', 'V', '2', '1') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', '4', '1', 'B') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', '4', '2', 'B') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', 'U', 'V', '9') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('Y', 'V', 'U', '9') },
-    { AV_CODEC_ID_RAWVIDEO,     MKTAG('a', 'u', 'v', '2') },
-    { AV_CODEC_ID_FRWU,         MKTAG('F', 'R', 'W', 'U') },
-    { AV_CODEC_ID_R10K,         MKTAG('R', '1', '0', 'k') },
-    { AV_CODEC_ID_R210,         MKTAG('r', '2', '1', '0') },
-    { AV_CODEC_ID_V210,         MKTAG('v', '2', '1', '0') },
-    { AV_CODEC_ID_V410,         MKTAG('v', '4', '1', '0') },
-    { AV_CODEC_ID_INDEO3,       MKTAG('I', 'V', '3', '1') },
-    { AV_CODEC_ID_INDEO3,       MKTAG('I', 'V', '3', '2') },
-    { AV_CODEC_ID_INDEO4,       MKTAG('I', 'V', '4', '1') },
-    { AV_CODEC_ID_INDEO5,       MKTAG('I', 'V', '5', '0') },
-    { AV_CODEC_ID_VP3,          MKTAG('V', 'P', '3', '1') },
-    { AV_CODEC_ID_VP3,          MKTAG('V', 'P', '3', '0') },
-    { AV_CODEC_ID_VP5,          MKTAG('V', 'P', '5', '0') },
-    { AV_CODEC_ID_VP6,          MKTAG('V', 'P', '6', '0') },
-    { AV_CODEC_ID_VP6,          MKTAG('V', 'P', '6', '1') },
-    { AV_CODEC_ID_VP6,          MKTAG('V', 'P', '6', '2') },
-    { AV_CODEC_ID_VP6A,         MKTAG('V', 'P', '6', 'A') },
-    { AV_CODEC_ID_VP6F,         MKTAG('V', 'P', '6', 'F') },
-    { AV_CODEC_ID_VP6F,         MKTAG('F', 'L', 'V', '4') },
-    { AV_CODEC_ID_VP8,          MKTAG('V', 'P', '8', '0') },
-    { AV_CODEC_ID_ASV1,         MKTAG('A', 'S', 'V', '1') },
-    { AV_CODEC_ID_ASV2,         MKTAG('A', 'S', 'V', '2') },
-    { AV_CODEC_ID_VCR1,         MKTAG('V', 'C', 'R', '1') },
-    { AV_CODEC_ID_FFV1,         MKTAG('F', 'F', 'V', '1') },
-    { AV_CODEC_ID_XAN_WC4,      MKTAG('X', 'x', 'a', 'n') },
-    { AV_CODEC_ID_MIMIC,        MKTAG('L', 'M', '2', '0') },
-    { AV_CODEC_ID_MSRLE,        MKTAG('m', 'r', 'l', 'e') },
-    { AV_CODEC_ID_MSRLE,        MKTAG( 1 ,  0 ,  0 ,  0 ) },
-    { AV_CODEC_ID_MSRLE,        MKTAG( 2 ,  0 ,  0 ,  0 ) },
-    { AV_CODEC_ID_MSVIDEO1,     MKTAG('M', 'S', 'V', 'C') },
-    { AV_CODEC_ID_MSVIDEO1,     MKTAG('m', 's', 'v', 'c') },
-    { AV_CODEC_ID_MSVIDEO1,     MKTAG('C', 'R', 'A', 'M') },
-    { AV_CODEC_ID_MSVIDEO1,     MKTAG('c', 'r', 'a', 'm') },
-    { AV_CODEC_ID_MSVIDEO1,     MKTAG('W', 'H', 'A', 'M') },
-    { AV_CODEC_ID_MSVIDEO1,     MKTAG('w', 'h', 'a', 'm') },
-    { AV_CODEC_ID_CINEPAK,      MKTAG('c', 'v', 'i', 'd') },
-    { AV_CODEC_ID_TRUEMOTION1,  MKTAG('D', 'U', 'C', 'K') },
-    { AV_CODEC_ID_TRUEMOTION1,  MKTAG('P', 'V', 'E', 'Z') },
-    { AV_CODEC_ID_MSZH,         MKTAG('M', 'S', 'Z', 'H') },
-    { AV_CODEC_ID_ZLIB,         MKTAG('Z', 'L', 'I', 'B') },
-    { AV_CODEC_ID_4XM,          MKTAG('4', 'X', 'M', 'V') },
-    { AV_CODEC_ID_FLV1,         MKTAG('F', 'L', 'V', '1') },
-    { AV_CODEC_ID_FLASHSV,      MKTAG('F', 'S', 'V', '1') },
-    { AV_CODEC_ID_SVQ1,         MKTAG('s', 'v', 'q', '1') },
-    { AV_CODEC_ID_TSCC,         MKTAG('t', 's', 'c', 'c') },
-    { AV_CODEC_ID_ULTI,         MKTAG('U', 'L', 'T', 'I') },
-    { AV_CODEC_ID_VIXL,         MKTAG('V', 'I', 'X', 'L') },
-    { AV_CODEC_ID_QPEG,         MKTAG('Q', 'P', 'E', 'G') },
-    { AV_CODEC_ID_QPEG,         MKTAG('Q', '1', '.', '0') },
-    { AV_CODEC_ID_QPEG,         MKTAG('Q', '1', '.', '1') },
-    { AV_CODEC_ID_WMV3,         MKTAG('W', 'M', 'V', '3') },
-    { AV_CODEC_ID_WMV3IMAGE,    MKTAG('W', 'M', 'V', 'P') },
-    { AV_CODEC_ID_VC1,          MKTAG('W', 'V', 'C', '1') },
-    { AV_CODEC_ID_VC1,          MKTAG('W', 'M', 'V', 'A') },
-    { AV_CODEC_ID_VC1IMAGE,     MKTAG('W', 'V', 'P', '2') },
-    { AV_CODEC_ID_LOCO,         MKTAG('L', 'O', 'C', 'O') },
-    { AV_CODEC_ID_WNV1,         MKTAG('W', 'N', 'V', '1') },
-    { AV_CODEC_ID_AASC,         MKTAG('A', 'A', 'S', 'C') },
-    { AV_CODEC_ID_INDEO2,       MKTAG('R', 'T', '2', '1') },
-    { AV_CODEC_ID_FRAPS,        MKTAG('F', 'P', 'S', '1') },
-    { AV_CODEC_ID_THEORA,       MKTAG('t', 'h', 'e', 'o') },
-    { AV_CODEC_ID_TRUEMOTION2,  MKTAG('T', 'M', '2', '0') },
-    { AV_CODEC_ID_CSCD,         MKTAG('C', 'S', 'C', 'D') },
-    { AV_CODEC_ID_ZMBV,         MKTAG('Z', 'M', 'B', 'V') },
-    { AV_CODEC_ID_KMVC,         MKTAG('K', 'M', 'V', 'C') },
-    { AV_CODEC_ID_CAVS,         MKTAG('C', 'A', 'V', 'S') },
-    { AV_CODEC_ID_JPEG2000,     MKTAG('m', 'j', 'p', '2') },
-    { AV_CODEC_ID_JPEG2000,     MKTAG('M', 'J', '2', 'C') },
-    { AV_CODEC_ID_JPEG2000,     MKTAG('L', 'J', '2', 'C') },
-    { AV_CODEC_ID_JPEG2000,     MKTAG('L', 'J', '2', 'K') },
-    { AV_CODEC_ID_VMNC,         MKTAG('V', 'M', 'n', 'c') },
-    { AV_CODEC_ID_TARGA,        MKTAG('t', 'g', 'a', ' ') },
-    { AV_CODEC_ID_PNG,          MKTAG('M', 'P', 'N', 'G') },
-    { AV_CODEC_ID_PNG,          MKTAG('P', 'N', 'G', '1') },
-    { AV_CODEC_ID_CLJR,         MKTAG('C', 'L', 'J', 'R') },
-    { AV_CODEC_ID_DIRAC,        MKTAG('d', 'r', 'a', 'c') },
-    { AV_CODEC_ID_RPZA,         MKTAG('a', 'z', 'p', 'r') },
-    { AV_CODEC_ID_RPZA,         MKTAG('R', 'P', 'Z', 'A') },
-    { AV_CODEC_ID_RPZA,         MKTAG('r', 'p', 'z', 'a') },
-    { AV_CODEC_ID_SP5X,         MKTAG('S', 'P', '5', '4') },
-    { AV_CODEC_ID_AURA,         MKTAG('A', 'U', 'R', 'A') },
-    { AV_CODEC_ID_AURA2,        MKTAG('A', 'U', 'R', '2') },
-    { AV_CODEC_ID_DPX,          MKTAG('d', 'p', 'x', ' ') },
-    { AV_CODEC_ID_KGV1,         MKTAG('K', 'G', 'V', '1') },
-    { AV_CODEC_ID_LAGARITH,     MKTAG('L', 'A', 'G', 'S') },
-    { AV_CODEC_ID_UTVIDEO,      MKTAG('U', 'L', 'R', 'A') },
-    { AV_CODEC_ID_UTVIDEO,      MKTAG('U', 'L', 'R', 'G') },
-    { AV_CODEC_ID_UTVIDEO,      MKTAG('U', 'L', 'Y', '0') },
-    { AV_CODEC_ID_UTVIDEO,      MKTAG('U', 'L', 'Y', '2') },
-    { AV_CODEC_ID_UTVIDEO,      MKTAG('U', 'L', 'H', '0') },
-    { AV_CODEC_ID_UTVIDEO,      MKTAG('U', 'L', 'H', '2') },
-    { AV_CODEC_ID_VBLE,         MKTAG('V', 'B', 'L', 'E') },
-    { AV_CODEC_ID_DXTORY,       MKTAG('x', 't', 'o', 'r') },
-    { AV_CODEC_ID_ZEROCODEC,    MKTAG('Z', 'E', 'C', 'O') },
-    { AV_CODEC_ID_MSS1,         MKTAG('M', 'S', 'S', '1') },
-    { AV_CODEC_ID_MSA1,         MKTAG('M', 'S', 'A', '1') },
-    { AV_CODEC_ID_TSCC2,        MKTAG('T', 'S', 'C', '2') },
-    { AV_CODEC_ID_MTS2,         MKTAG('M', 'T', 'S', '2') },
-    { AV_CODEC_ID_CLLC,         MKTAG('C', 'L', 'L', 'C') },
-    { AV_CODEC_ID_MSS2,         MKTAG('M', 'S', 'S', '2') },
-    { AV_CODEC_ID_SVQ3,         MKTAG('S', 'V', 'Q', '3') },
-    { AV_CODEC_ID_G2M,          MKTAG('G', '2', 'M', '2') },
-    { AV_CODEC_ID_G2M,          MKTAG('G', '2', 'M', '3') },
-    { AV_CODEC_ID_G2M,          MKTAG('G', '2', 'M', '4') },
-    { AV_CODEC_ID_FIC,          MKTAG('F', 'I', 'C', 'V') },
-    { AV_CODEC_ID_NONE,         0 }
-};
-
-const AVCodecTag ff_codec_wav_tags[] = {
-    { AV_CODEC_ID_PCM_S16LE,       0x0001 },
-    /* must come after s16le in this list */
-    { AV_CODEC_ID_PCM_U8,          0x0001 },
-    { AV_CODEC_ID_PCM_S24LE,       0x0001 },
-    { AV_CODEC_ID_PCM_S32LE,       0x0001 },
-    { AV_CODEC_ID_ADPCM_MS,        0x0002 },
-    { AV_CODEC_ID_PCM_F32LE,       0x0003 },
-    /* must come after f32le in this list */
-    { AV_CODEC_ID_PCM_F64LE,       0x0003 },
-    { AV_CODEC_ID_PCM_ALAW,        0x0006 },
-    { AV_CODEC_ID_PCM_MULAW,       0x0007 },
-    { AV_CODEC_ID_WMAVOICE,        0x000A },
-    { AV_CODEC_ID_ADPCM_IMA_WAV,   0x0011 },
-    /* must come after adpcm_ima_wav in this list */
-    { AV_CODEC_ID_PCM_ZORK,        0x0011 },
-    { AV_CODEC_ID_ADPCM_YAMAHA,    0x0020 },
-    { AV_CODEC_ID_TRUESPEECH,      0x0022 },
-    { AV_CODEC_ID_GSM_MS,          0x0031 },
-    { AV_CODEC_ID_GSM_MS,          0x0032 },
-    { AV_CODEC_ID_ADPCM_G726,      0x0045 },
-    { AV_CODEC_ID_MP2,             0x0050 },
-    { AV_CODEC_ID_MP3,             0x0055 },
-    { AV_CODEC_ID_AMR_NB,          0x0057 },
-    { AV_CODEC_ID_AMR_WB,          0x0058 },
-    /* rogue format number */
-    { AV_CODEC_ID_ADPCM_IMA_DK4,   0x0061 },
-    /* rogue format number */
-    { AV_CODEC_ID_ADPCM_IMA_DK3,   0x0062 },
-    { AV_CODEC_ID_ADPCM_IMA_WAV,   0x0069 },
-    { AV_CODEC_ID_METASOUND,       0x0075 },
-    { AV_CODEC_ID_AAC,             0x00ff },
-    { AV_CODEC_ID_SIPR,            0x0130 },
-    { AV_CODEC_ID_WMAV1,           0x0160 },
-    { AV_CODEC_ID_WMAV2,           0x0161 },
-    { AV_CODEC_ID_WMAPRO,          0x0162 },
-    { AV_CODEC_ID_WMALOSSLESS,     0x0163 },
-    { AV_CODEC_ID_ADPCM_CT,        0x0200 },
-    { AV_CODEC_ID_ATRAC3,          0x0270 },
-    { AV_CODEC_ID_ADPCM_G722,      0x028F },
-    { AV_CODEC_ID_IMC,             0x0401 },
-    { AV_CODEC_ID_IAC,             0x0402 },
-    { AV_CODEC_ID_GSM_MS,          0x1500 },
-    { AV_CODEC_ID_TRUESPEECH,      0x1501 },
-    /* ADTS AAC */
-    { AV_CODEC_ID_AAC,             0x1600 },
-    { AV_CODEC_ID_AAC_LATM,        0x1602 },
-    { AV_CODEC_ID_AC3,             0x2000 },
-    { AV_CODEC_ID_DTS,             0x2001 },
-    { AV_CODEC_ID_PCM_MULAW,       0x6c75 },
-    { AV_CODEC_ID_AAC,             0x706d },
-    { AV_CODEC_ID_AAC,             0x4143 },
-    { AV_CODEC_ID_SPEEX,           0xA109 },
-    { AV_CODEC_ID_FLAC,            0xF1AC },
-    { AV_CODEC_ID_ADPCM_SWF,       ('S' << 8) + 'F' },
-    /* HACK/FIXME: Does Vorbis in WAV/AVI have an (in)official ID? */
-    { AV_CODEC_ID_VORBIS,          ('V' << 8) + 'o' },
-    { AV_CODEC_ID_NONE,      0 },
-};
-
-const AVMetadataConv ff_riff_info_conv[] = {
-    { "IART", "artist"     },
-    { "ICMT", "comment"    },
-    { "ICOP", "copyright"  },
-    { "ICRD", "date"       },
-    { "IGNR", "genre"      },
-    { "ILNG", "language"   },
-    { "INAM", "title"      },
-    { "IPRD", "album"      },
-    { "IPRT", "track"      },
-    { "ISFT", "encoder"    },
-    { "ITCH", "encoded_by" },
-    { 0 },
-};
-
-const struct AVCodecTag *avformat_get_riff_video_tags(void)
-{
-    return ff_codec_bmp_tags;
-}
-
-const struct AVCodecTag *avformat_get_riff_audio_tags(void)
-{
-    return ff_codec_wav_tags;
-}
diff --git a/deps/libav/libavformat/riff.h b/deps/libav/libavformat/riff.h
deleted file mode 100644
index f458f26..0000000
--- a/deps/libav/libavformat/riff.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * RIFF common functions and data
- * copyright (c) 2000 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * internal header for RIFF based (de)muxers
- * do NOT include this in end user applications
- */
-
-#ifndef AVFORMAT_RIFF_H
-#define AVFORMAT_RIFF_H
-
-#include "libavcodec/avcodec.h"
-#include "avio.h"
-#include "internal.h"
-#include "metadata.h"
-
-extern const AVMetadataConv ff_riff_info_conv[];
-
-int64_t ff_start_tag(AVIOContext *pb, const char *tag);
-void ff_end_tag(AVIOContext *pb, int64_t start);
-
-/**
- * Read BITMAPINFOHEADER structure and set AVStream codec width, height and
- * bits_per_encoded_sample fields. Does not read extradata.
- * @return codec tag
- */
-int ff_get_bmp_header(AVIOContext *pb, AVStream *st);
-
-void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
-int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc);
-enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps);
-int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size);
-
-extern const AVCodecTag ff_codec_bmp_tags[];
-extern const AVCodecTag ff_codec_wav_tags[];
-
-void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale);
-
-int ff_read_riff_info(AVFormatContext *s, int64_t size);
-
-/**
- * Write all recognized RIFF tags from s->metadata
- */
-void ff_riff_write_info(AVFormatContext *s);
-
-/**
- * Write a single RIFF info tag
- */
-void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str);
-
-typedef uint8_t ff_asf_guid[16];
-
-typedef struct AVCodecGuid {
-    enum AVCodecID id;
-    ff_asf_guid guid;
-} AVCodecGuid;
-
-extern const AVCodecGuid ff_codec_wav_guids[];
-
-#define FF_PRI_GUID \
-    "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
-
-#define FF_ARG_GUID(g) \
-    g[0], g[1], g[2],  g[3],  g[4],  g[5],  g[6],  g[7], \
-    g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15]
-
-#define FF_MEDIASUBTYPE_BASE_GUID \
-    0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71
-
-static av_always_inline int ff_guidcmp(const void *g1, const void *g2)
-{
-    return memcmp(g1, g2, sizeof(ff_asf_guid));
-}
-
-static av_always_inline int ff_get_guid(AVIOContext *s, ff_asf_guid *g)
-{
-    return avio_read(s, *g, sizeof(*g));
-}
-
-enum AVCodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid);
-
-#endif /* AVFORMAT_RIFF_H */
diff --git a/deps/libav/libavformat/riffdec.c b/deps/libav/libavformat/riffdec.c
deleted file mode 100644
index 74f93ac..0000000
--- a/deps/libav/libavformat/riffdec.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * RIFF demuxing functions and data
- * Copyright (c) 2000 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/dict.h"
-#include "libavutil/error.h"
-#include "libavutil/log.h"
-#include "libavutil/mathematics.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "riff.h"
-
-const AVCodecGuid ff_codec_wav_guids[] = {
-    { AV_CODEC_ID_AC3,      { 0x2C, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA } },
-    { AV_CODEC_ID_ATRAC3P,  { 0xBF, 0xAA, 0x23, 0xE9, 0x58, 0xCB, 0x71, 0x44, 0xA1, 0x19, 0xFF, 0xFA, 0x01, 0xE4, 0xCE, 0x62 } },
-    { AV_CODEC_ID_EAC3,     { 0xAF, 0x87, 0xFB, 0xA7, 0x02, 0x2D, 0xFB, 0x42, 0xA4, 0xD4, 0x05, 0xCD, 0x93, 0x84, 0x3B, 0xDD } },
-    { AV_CODEC_ID_MP2,      { 0x2B, 0x80, 0x6D, 0xE0, 0x46, 0xDB, 0xCF, 0x11, 0xB4, 0xD1, 0x00, 0x80, 0x5F, 0x6C, 0xBB, 0xEA } },
-    { AV_CODEC_ID_NONE }
-};
-
-enum AVCodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid)
-{
-    int i;
-    for (i = 0; guids[i].id != AV_CODEC_ID_NONE; i++)
-        if (!ff_guidcmp(guids[i].guid, guid))
-            return guids[i].id;
-    return AV_CODEC_ID_NONE;
-}
-
-/* We could be given one of the three possible structures here:
- * WAVEFORMAT, PCMWAVEFORMAT or WAVEFORMATEX. Each structure
- * is an expansion of the previous one with the fields added
- * at the bottom. PCMWAVEFORMAT adds 'WORD wBitsPerSample' and
- * WAVEFORMATEX adds 'WORD  cbSize' and basically makes itself
- * an openended structure.
- */
-
-static void parse_waveformatex(AVIOContext *pb, AVCodecContext *c)
-{
-    ff_asf_guid subformat;
-    c->bits_per_coded_sample = avio_rl16(pb);
-    c->channel_layout        = avio_rl32(pb); /* dwChannelMask */
-
-    ff_get_guid(pb, &subformat);
-    if (!memcmp(subformat + 4,
-                (const uint8_t[]){ FF_MEDIASUBTYPE_BASE_GUID }, 12)) {
-        c->codec_tag = AV_RL32(subformat);
-        c->codec_id  = ff_wav_codec_get_id(c->codec_tag,
-                                           c->bits_per_coded_sample);
-    } else {
-        c->codec_id = ff_codec_guid_get_id(ff_codec_wav_guids, subformat);
-        if (!c->codec_id)
-            av_log(c, AV_LOG_WARNING,
-                   "unknown subformat:"FF_PRI_GUID"\n",
-                   FF_ARG_GUID(subformat));
-    }
-}
-
-int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
-{
-    int id;
-
-    id                 = avio_rl16(pb);
-    codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    codec->channels    = avio_rl16(pb);
-    codec->sample_rate = avio_rl32(pb);
-    codec->bit_rate    = avio_rl32(pb) * 8;
-    codec->block_align = avio_rl16(pb);
-    if (size == 14) {  /* We're dealing with plain vanilla WAVEFORMAT */
-        codec->bits_per_coded_sample = 8;
-    } else
-        codec->bits_per_coded_sample = avio_rl16(pb);
-    if (id == 0xFFFE) {
-        codec->codec_tag = 0;
-    } else {
-        codec->codec_tag = id;
-        codec->codec_id  = ff_wav_codec_get_id(id,
-                                               codec->bits_per_coded_sample);
-    }
-    if (size >= 18) {  /* We're obviously dealing with WAVEFORMATEX */
-        int cbSize = avio_rl16(pb); /* cbSize */
-        size  -= 18;
-        cbSize = FFMIN(size, cbSize);
-        if (cbSize >= 22 && id == 0xfffe) { /* WAVEFORMATEXTENSIBLE */
-            parse_waveformatex(pb, codec);
-            cbSize -= 22;
-            size   -= 22;
-        }
-        codec->extradata_size = cbSize;
-        if (cbSize > 0) {
-            av_free(codec->extradata);
-            codec->extradata = av_mallocz(codec->extradata_size +
-                                          FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!codec->extradata)
-                return AVERROR(ENOMEM);
-            avio_read(pb, codec->extradata, codec->extradata_size);
-            size -= cbSize;
-        }
-
-        /* It is possible for the chunk to contain garbage at the end */
-        if (size > 0)
-            avio_skip(pb, size);
-    }
-    if (codec->sample_rate <= 0) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Invalid sample rate: %d\n", codec->sample_rate);
-        return AVERROR_INVALIDDATA;
-    }
-    if (codec->codec_id == AV_CODEC_ID_AAC_LATM) {
-        /* Channels and sample_rate values are those prior to applying SBR
-         * and/or PS. */
-        codec->channels    = 0;
-        codec->sample_rate = 0;
-    }
-    /* override bits_per_coded_sample for G.726 */
-    if (codec->codec_id == AV_CODEC_ID_ADPCM_G726)
-        codec->bits_per_coded_sample = codec->bit_rate / codec->sample_rate;
-
-    return 0;
-}
-
-enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps)
-{
-    enum AVCodecID id;
-    id = ff_codec_get_id(ff_codec_wav_tags, tag);
-    if (id <= 0)
-        return id;
-
-    if (id == AV_CODEC_ID_PCM_S16LE)
-        id = ff_get_pcm_codec_id(bps, 0, 0, ~1);
-    else if (id == AV_CODEC_ID_PCM_F32LE)
-        id = ff_get_pcm_codec_id(bps, 1, 0,  0);
-
-    if (id == AV_CODEC_ID_ADPCM_IMA_WAV && bps == 8)
-        id = AV_CODEC_ID_PCM_ZORK;
-    return id;
-}
-
-int ff_get_bmp_header(AVIOContext *pb, AVStream *st)
-{
-    int tag1;
-    avio_rl32(pb); /* size */
-    st->codec->width  = avio_rl32(pb);
-    st->codec->height = (int32_t)avio_rl32(pb);
-    avio_rl16(pb); /* planes */
-    st->codec->bits_per_coded_sample = avio_rl16(pb); /* depth */
-    tag1                             = avio_rl32(pb);
-    avio_rl32(pb); /* ImageSize */
-    avio_rl32(pb); /* XPelsPerMeter */
-    avio_rl32(pb); /* YPelsPerMeter */
-    avio_rl32(pb); /* ClrUsed */
-    avio_rl32(pb); /* ClrImportant */
-    return tag1;
-}
-
-int ff_read_riff_info(AVFormatContext *s, int64_t size)
-{
-    int64_t start, end, cur;
-    AVIOContext *pb = s->pb;
-
-    start = avio_tell(pb);
-    end   = start + size;
-
-    while ((cur = avio_tell(pb)) >= 0 &&
-           cur <= end - 8 /* = tag + size */) {
-        uint32_t chunk_code;
-        int64_t chunk_size;
-        char key[5] = { 0 };
-        char *value;
-
-        chunk_code = avio_rl32(pb);
-        chunk_size = avio_rl32(pb);
-
-        if (chunk_size > end ||
-            end - chunk_size < cur ||
-            chunk_size == UINT_MAX) {
-            av_log(s, AV_LOG_WARNING, "too big INFO subchunk\n");
-            break;
-        }
-
-        chunk_size += (chunk_size & 1);
-
-        if (!chunk_code) {
-            if (chunk_size)
-                avio_skip(pb, chunk_size);
-            else if (pb->eof_reached) {
-                av_log(s, AV_LOG_WARNING, "truncated file\n");
-                return AVERROR_EOF;
-            }
-            continue;
-        }
-
-        value = av_malloc(chunk_size + 1);
-        if (!value) {
-            av_log(s, AV_LOG_ERROR,
-                   "out of memory, unable to read INFO tag\n");
-            return AVERROR(ENOMEM);
-        }
-
-        AV_WL32(key, chunk_code);
-
-        if (avio_read(pb, value, chunk_size) != chunk_size) {
-            av_free(value);
-            av_log(s, AV_LOG_WARNING,
-                   "premature end of file while reading INFO tag\n");
-            break;
-        }
-
-        value[chunk_size] = 0;
-
-        av_dict_set(&s->metadata, key, value, AV_DICT_DONT_STRDUP_VAL);
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/riffenc.c b/deps/libav/libavformat/riffenc.c
deleted file mode 100644
index 98e97c0..0000000
--- a/deps/libav/libavformat/riffenc.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * RIFF muxing functions
- * Copyright (c) 2000 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/dict.h"
-#include "libavutil/log.h"
-#include "libavutil/mathematics.h"
-#include "libavcodec/avcodec.h"
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "riff.h"
-
-int64_t ff_start_tag(AVIOContext *pb, const char *tag)
-{
-    ffio_wfourcc(pb, tag);
-    avio_wl32(pb, 0);
-    return avio_tell(pb);
-}
-
-void ff_end_tag(AVIOContext *pb, int64_t start)
-{
-    int64_t pos;
-
-    pos = avio_tell(pb);
-    avio_seek(pb, start - 4, SEEK_SET);
-    avio_wl32(pb, (uint32_t)(pos - start));
-    avio_seek(pb, pos, SEEK_SET);
-}
-
-/* WAVEFORMATEX header */
-/* returns the size or -1 on error */
-int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
-{
-    int bps, blkalign, bytespersec, frame_size;
-    int hdrsize = 18;
-    int waveformatextensible;
-    uint8_t temp[256];
-    uint8_t *riff_extradata       = temp;
-    uint8_t *riff_extradata_start = temp;
-
-    if (!enc->codec_tag || enc->codec_tag > 0xffff)
-        return -1;
-
-    /* We use the known constant frame size for the codec if known, otherwise
-     * fall back on using AVCodecContext.frame_size, which is not as reliable
-     * for indicating packet duration. */
-    frame_size = av_get_audio_frame_duration(enc, 0);
-    if (!frame_size)
-        frame_size = enc->frame_size;
-
-    waveformatextensible = (enc->channels > 2 && enc->channel_layout) ||
-                           enc->sample_rate > 48000 ||
-                           av_get_bits_per_sample(enc->codec_id) > 16;
-
-    if (waveformatextensible)
-        avio_wl16(pb, 0xfffe);
-    else
-        avio_wl16(pb, enc->codec_tag);
-
-    avio_wl16(pb, enc->channels);
-    avio_wl32(pb, enc->sample_rate);
-    if (enc->codec_id == AV_CODEC_ID_MP2 ||
-        enc->codec_id == AV_CODEC_ID_MP3 ||
-        enc->codec_id == AV_CODEC_ID_GSM_MS) {
-        bps = 0;
-    } else {
-        if (!(bps = av_get_bits_per_sample(enc->codec_id))) {
-            if (enc->bits_per_coded_sample)
-                bps = enc->bits_per_coded_sample;
-            else
-                bps = 16;  // default to 16
-        }
-    }
-    if (bps != enc->bits_per_coded_sample && enc->bits_per_coded_sample) {
-        av_log(enc, AV_LOG_WARNING,
-               "requested bits_per_coded_sample (%d) "
-               "and actually stored (%d) differ\n",
-               enc->bits_per_coded_sample, bps);
-    }
-
-    if (enc->codec_id == AV_CODEC_ID_MP2 ||
-        enc->codec_id == AV_CODEC_ID_MP3) {
-        /* This is wrong, but it seems many demuxers do not work if this
-         * is set correctly. */
-        blkalign = frame_size;
-        // blkalign = 144 * enc->bit_rate/enc->sample_rate;
-    } else if (enc->codec_id == AV_CODEC_ID_AC3) {
-        blkalign = 3840;                /* maximum bytes per frame */
-    } else if (enc->block_align != 0) { /* specified by the codec */
-        blkalign = enc->block_align;
-    } else
-        blkalign = bps * enc->channels / av_gcd(8, bps);
-    if (enc->codec_id == AV_CODEC_ID_PCM_U8 ||
-        enc->codec_id == AV_CODEC_ID_PCM_S24LE ||
-        enc->codec_id == AV_CODEC_ID_PCM_S32LE ||
-        enc->codec_id == AV_CODEC_ID_PCM_F32LE ||
-        enc->codec_id == AV_CODEC_ID_PCM_F64LE ||
-        enc->codec_id == AV_CODEC_ID_PCM_S16LE) {
-        bytespersec = enc->sample_rate * blkalign;
-    } else {
-        bytespersec = enc->bit_rate / 8;
-    }
-    avio_wl32(pb, bytespersec); /* bytes per second */
-    avio_wl16(pb, blkalign);    /* block align */
-    avio_wl16(pb, bps);         /* bits per sample */
-    if (enc->codec_id == AV_CODEC_ID_MP3) {
-        hdrsize += 12;
-        bytestream_put_le16(&riff_extradata, 1);    /* wID */
-        bytestream_put_le32(&riff_extradata, 2);    /* fdwFlags */
-        bytestream_put_le16(&riff_extradata, 1152); /* nBlockSize */
-        bytestream_put_le16(&riff_extradata, 1);    /* nFramesPerBlock */
-        bytestream_put_le16(&riff_extradata, 1393); /* nCodecDelay */
-    } else if (enc->codec_id == AV_CODEC_ID_MP2) {
-        hdrsize += 22;
-        /* fwHeadLayer */
-        bytestream_put_le16(&riff_extradata, 2);
-        /* dwHeadBitrate */
-        bytestream_put_le32(&riff_extradata, enc->bit_rate);
-        /* fwHeadMode */
-        bytestream_put_le16(&riff_extradata, enc->channels == 2 ? 1 : 8);
-        /* fwHeadModeExt */
-        bytestream_put_le16(&riff_extradata, 0);
-        /* wHeadEmphasis */
-        bytestream_put_le16(&riff_extradata, 1);
-        /* fwHeadFlags */
-        bytestream_put_le16(&riff_extradata, 16);
-        /* dwPTSLow */
-        bytestream_put_le32(&riff_extradata, 0);
-        /* dwPTSHigh */
-        bytestream_put_le32(&riff_extradata, 0);
-    } else if (enc->codec_id == AV_CODEC_ID_GSM_MS ||
-               enc->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV) {
-        hdrsize += 2;
-        /* wSamplesPerBlock */
-        bytestream_put_le16(&riff_extradata, frame_size);
-    } else if (enc->extradata_size) {
-        riff_extradata_start = enc->extradata;
-        riff_extradata       = enc->extradata + enc->extradata_size;
-        hdrsize             += enc->extradata_size;
-    }
-    /* write WAVEFORMATEXTENSIBLE extensions */
-    if (waveformatextensible) {
-        hdrsize += 22;
-        /* 22 is WAVEFORMATEXTENSIBLE size */
-        avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
-        /* ValidBitsPerSample || SamplesPerBlock || Reserved */
-        avio_wl16(pb, bps);
-        /* dwChannelMask */
-        avio_wl32(pb, enc->channel_layout);
-        /* GUID + next 3 */
-        avio_wl32(pb, enc->codec_tag);
-        avio_wl32(pb, 0x00100000);
-        avio_wl32(pb, 0xAA000080);
-        avio_wl32(pb, 0x719B3800);
-    } else {
-        avio_wl16(pb, riff_extradata - riff_extradata_start); /* cbSize */
-    }
-    avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
-    if (hdrsize & 1) {
-        hdrsize++;
-        avio_w8(pb, 0);
-    }
-
-    return hdrsize;
-}
-
-/* BITMAPINFOHEADER header */
-void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
-                       const AVCodecTag *tags, int for_asf)
-{
-    /* size */
-    avio_wl32(pb, 40 + enc->extradata_size);
-    avio_wl32(pb, enc->width);
-    //We always store RGB TopDown
-    avio_wl32(pb, enc->codec_tag ? enc->height : -enc->height);
-    /* planes */
-    avio_wl16(pb, 1);
-    /* depth */
-    avio_wl16(pb, enc->bits_per_coded_sample ? enc->bits_per_coded_sample : 24);
-    /* compression type */
-    avio_wl32(pb, enc->codec_tag);
-    avio_wl32(pb, enc->width * enc->height * 3);
-    avio_wl32(pb, 0);
-    avio_wl32(pb, 0);
-    avio_wl32(pb, 0);
-    avio_wl32(pb, 0);
-
-    avio_write(pb, enc->extradata, enc->extradata_size);
-
-    if (!for_asf && enc->extradata_size & 1)
-        avio_w8(pb, 0);
-}
-
-void ff_parse_specific_params(AVCodecContext *stream, int *au_rate,
-                              int *au_ssize, int *au_scale)
-{
-    int gcd;
-    int audio_frame_size;
-
-    /* We use the known constant frame size for the codec if known, otherwise
-     * fall back on using AVCodecContext.frame_size, which is not as reliable
-     * for indicating packet duration. */
-    audio_frame_size = av_get_audio_frame_duration(stream, 0);
-    if (!audio_frame_size)
-        audio_frame_size = stream->frame_size;
-
-    *au_ssize = stream->block_align;
-    if (audio_frame_size && stream->sample_rate) {
-        *au_scale = audio_frame_size;
-        *au_rate  = stream->sample_rate;
-    } else if (stream->codec_type == AVMEDIA_TYPE_VIDEO ||
-               stream->codec_type == AVMEDIA_TYPE_DATA ||
-               stream->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-        *au_scale = stream->time_base.num;
-        *au_rate  = stream->time_base.den;
-    } else {
-        *au_scale = stream->block_align ? stream->block_align * 8 : 8;
-        *au_rate  = stream->bit_rate ? stream->bit_rate :
-                    8 * stream->sample_rate;
-    }
-    gcd        = av_gcd(*au_scale, *au_rate);
-    *au_scale /= gcd;
-    *au_rate  /= gcd;
-}
-
-void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str)
-{
-    int len = strlen(str);
-    if (len > 0) {
-        len++;
-        ffio_wfourcc(pb, tag);
-        avio_wl32(pb, len);
-        avio_put_str(pb, str);
-        if (len & 1)
-            avio_w8(pb, 0);
-    }
-}
-
-static const char riff_tags[][5] = {
-    "IARL", "IART", "ICMS", "ICMT", "ICOP", "ICRD", "ICRP", "IDIM", "IDPI",
-    "IENG", "IGNR", "IKEY", "ILGT", "ILNG", "IMED", "INAM", "IPLT", "IPRD",
-    "IPRT", "ISBJ", "ISFT", "ISHP", "ISRC", "ISRF", "ITCH",
-    { 0 }
-};
-
-static int riff_has_valid_tags(AVFormatContext *s)
-{
-    int i;
-
-    for (i = 0; *riff_tags[i]; i++)
-        if (av_dict_get(s->metadata, riff_tags[i], NULL, AV_DICT_MATCH_CASE))
-            return 1;
-
-    return 0;
-}
-
-void ff_riff_write_info(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    int i;
-    int64_t list_pos;
-    AVDictionaryEntry *t = NULL;
-
-    ff_metadata_conv(&s->metadata, ff_riff_info_conv, NULL);
-
-    /* writing empty LIST is not nice and may cause problems */
-    if (!riff_has_valid_tags(s))
-        return;
-
-    list_pos = ff_start_tag(pb, "LIST");
-    ffio_wfourcc(pb, "INFO");
-    for (i = 0; *riff_tags[i]; i++)
-        if ((t = av_dict_get(s->metadata, riff_tags[i],
-                             NULL, AV_DICT_MATCH_CASE)))
-            ff_riff_write_info_tag(s->pb, t->key, t->value);
-    ff_end_tag(pb, list_pos);
-}
diff --git a/deps/libav/libavformat/rl2.c b/deps/libav/libavformat/rl2.c
deleted file mode 100644
index 5d30bf8..0000000
--- a/deps/libav/libavformat/rl2.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * RL2 Format Demuxer
- * Copyright (c) 2008 Sascha Sommer (saschasommer at freenet.de)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * RL2 file demuxer
- * @file
- * @author Sascha Sommer (saschasommer at freenet.de)
- * @see http://wiki.multimedia.cx/index.php?title=RL2
- *
- * extradata:
- * 2 byte le initial drawing offset within 320x200 viewport
- * 4 byte le number of used colors
- * 256 * 3 bytes rgb palette
- * optional background_frame
- */
-
-#include <stdint.h>
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define EXTRADATA1_SIZE (6 + 256 * 3) ///< video base, clr, palette
-
-#define FORM_TAG MKBETAG('F', 'O', 'R', 'M')
-#define RLV2_TAG MKBETAG('R', 'L', 'V', '2')
-#define RLV3_TAG MKBETAG('R', 'L', 'V', '3')
-
-typedef struct Rl2DemuxContext {
-    unsigned int index_pos[2];   ///< indexes in the sample tables
-} Rl2DemuxContext;
-
-
-/**
- * check if the file is in rl2 format
- * @param p probe buffer
- * @return 0 when the probe buffer does not contain rl2 data, > 0 otherwise
- */
-static int rl2_probe(AVProbeData *p)
-{
-
-    if(AV_RB32(&p->buf[0]) != FORM_TAG)
-        return 0;
-
-    if(AV_RB32(&p->buf[8]) != RLV2_TAG &&
-        AV_RB32(&p->buf[8]) != RLV3_TAG)
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-/**
- * read rl2 header data and setup the avstreams
- * @param s demuxer context
- * @return 0 on success, AVERROR otherwise
- */
-static av_cold int rl2_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    unsigned int frame_count;
-    unsigned int audio_frame_counter = 0;
-    unsigned int video_frame_counter = 0;
-    unsigned int back_size;
-    unsigned short sound_rate;
-    unsigned short rate;
-    unsigned short channels;
-    unsigned short def_sound_size;
-    unsigned int signature;
-    unsigned int pts_den = 11025; /* video only case */
-    unsigned int pts_num = 1103;
-    unsigned int* chunk_offset = NULL;
-    int* chunk_size = NULL;
-    int* audio_size = NULL;
-    int i;
-    int ret = 0;
-
-    avio_skip(pb,4);          /* skip FORM tag */
-    back_size = avio_rl32(pb); /**< get size of the background frame */
-    signature = avio_rb32(pb);
-    avio_skip(pb, 4);         /* data size */
-    frame_count = avio_rl32(pb);
-
-    /* disallow back_sizes and frame_counts that may lead to overflows later */
-    if(back_size > INT_MAX/2  || frame_count > INT_MAX / sizeof(uint32_t))
-        return AVERROR_INVALIDDATA;
-
-    avio_skip(pb, 2);         /* encoding mentod */
-    sound_rate = avio_rl16(pb);
-    rate = avio_rl16(pb);
-    channels = avio_rl16(pb);
-    def_sound_size = avio_rl16(pb);
-    if (!channels || channels > 42) {
-        av_log(s, AV_LOG_ERROR, "Invalid number of channels: %d\n", channels);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /** setup video stream */
-    st = avformat_new_stream(s, NULL);
-    if(!st)
-         return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_RL2;
-    st->codec->codec_tag = 0;  /* no fourcc */
-    st->codec->width = 320;
-    st->codec->height = 200;
-
-    /** allocate and fill extradata */
-    st->codec->extradata_size = EXTRADATA1_SIZE;
-
-    if(signature == RLV3_TAG && back_size > 0)
-        st->codec->extradata_size += back_size;
-
-    st->codec->extradata = av_mallocz(st->codec->extradata_size +
-                                          FF_INPUT_BUFFER_PADDING_SIZE);
-    if(!st->codec->extradata)
-        return AVERROR(ENOMEM);
-
-    if(avio_read(pb,st->codec->extradata,st->codec->extradata_size) !=
-                      st->codec->extradata_size)
-        return AVERROR(EIO);
-
-    /** setup audio stream if present */
-    if(sound_rate){
-        pts_num = def_sound_size;
-        pts_den = rate;
-
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id = AV_CODEC_ID_PCM_U8;
-        st->codec->codec_tag = 1;
-        st->codec->channels = channels;
-        st->codec->bits_per_coded_sample = 8;
-        st->codec->sample_rate = rate;
-        st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
-            st->codec->bits_per_coded_sample;
-        st->codec->block_align = st->codec->channels *
-            st->codec->bits_per_coded_sample / 8;
-        avpriv_set_pts_info(st,32,1,rate);
-    }
-
-    avpriv_set_pts_info(s->streams[0], 32, pts_num, pts_den);
-
-    chunk_size =   av_malloc(frame_count * sizeof(uint32_t));
-    audio_size =   av_malloc(frame_count * sizeof(uint32_t));
-    chunk_offset = av_malloc(frame_count * sizeof(uint32_t));
-
-    if(!chunk_size || !audio_size || !chunk_offset){
-        av_free(chunk_size);
-        av_free(audio_size);
-        av_free(chunk_offset);
-        return AVERROR(ENOMEM);
-    }
-
-    /** read offset and size tables */
-    for(i=0; i < frame_count;i++)
-        chunk_size[i] = avio_rl32(pb);
-    for(i=0; i < frame_count;i++)
-        chunk_offset[i] = avio_rl32(pb);
-    for(i=0; i < frame_count;i++)
-        audio_size[i] = avio_rl32(pb) & 0xFFFF;
-
-    /** build the sample index */
-    for(i=0;i<frame_count;i++){
-        if(chunk_size[i] < 0 || audio_size[i] > chunk_size[i]){
-            ret = AVERROR_INVALIDDATA;
-            break;
-        }
-
-        if(sound_rate && audio_size[i]){
-            av_add_index_entry(s->streams[1], chunk_offset[i],
-                audio_frame_counter,audio_size[i], 0, AVINDEX_KEYFRAME);
-            audio_frame_counter += audio_size[i] / channels;
-        }
-        av_add_index_entry(s->streams[0], chunk_offset[i] + audio_size[i],
-            video_frame_counter,chunk_size[i]-audio_size[i],0,AVINDEX_KEYFRAME);
-        ++video_frame_counter;
-    }
-
-
-    av_free(chunk_size);
-    av_free(audio_size);
-    av_free(chunk_offset);
-
-    return ret;
-}
-
-/**
- * read a single audio or video packet
- * @param s demuxer context
- * @param pkt the packet to be filled
- * @return 0 on success, AVERROR otherwise
- */
-static int rl2_read_packet(AVFormatContext *s,
-                            AVPacket *pkt)
-{
-    Rl2DemuxContext *rl2 = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVIndexEntry *sample = NULL;
-    int i;
-    int ret = 0;
-    int stream_id = -1;
-    int64_t pos = INT64_MAX;
-
-    /** check if there is a valid video or audio entry that can be used */
-    for(i=0; i<s->nb_streams; i++){
-        if(rl2->index_pos[i] < s->streams[i]->nb_index_entries
-              && s->streams[i]->index_entries[ rl2->index_pos[i] ].pos < pos){
-            sample = &s->streams[i]->index_entries[ rl2->index_pos[i] ];
-            pos= sample->pos;
-            stream_id= i;
-        }
-    }
-
-    if(stream_id == -1)
-        return AVERROR(EIO);
-
-    ++rl2->index_pos[stream_id];
-
-    /** position the stream (will probably be there anyway) */
-    avio_seek(pb, sample->pos, SEEK_SET);
-
-    /** fill the packet */
-    ret = av_get_packet(pb, pkt, sample->size);
-    if(ret != sample->size){
-        av_free_packet(pkt);
-        return AVERROR(EIO);
-    }
-
-    pkt->stream_index = stream_id;
-    pkt->pts = sample->timestamp;
-
-    return ret;
-}
-
-/**
- * seek to a new timestamp
- * @param s demuxer context
- * @param stream_index index of the stream that should be seeked
- * @param timestamp wanted timestamp
- * @param flags direction and seeking mode
- * @return 0 on success, -1 otherwise
- */
-static int rl2_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
-{
-    AVStream *st = s->streams[stream_index];
-    Rl2DemuxContext *rl2 = s->priv_data;
-    int i;
-    int index = av_index_search_timestamp(st, timestamp, flags);
-    if(index < 0)
-        return -1;
-
-    rl2->index_pos[stream_index] = index;
-    timestamp = st->index_entries[index].timestamp;
-
-    for(i=0; i < s->nb_streams; i++){
-        AVStream *st2 = s->streams[i];
-        index = av_index_search_timestamp(st2,
-                    av_rescale_q(timestamp, st->time_base, st2->time_base),
-                    flags | AVSEEK_FLAG_BACKWARD);
-
-        if(index < 0)
-            index = 0;
-
-        rl2->index_pos[i] = index;
-    }
-
-    return 0;
-}
-
-AVInputFormat ff_rl2_demuxer = {
-    .name           = "rl2",
-    .long_name      = NULL_IF_CONFIG_SMALL("RL2"),
-    .priv_data_size = sizeof(Rl2DemuxContext),
-    .read_probe     = rl2_probe,
-    .read_header    = rl2_read_header,
-    .read_packet    = rl2_read_packet,
-    .read_seek      = rl2_read_seek,
-};
diff --git a/deps/libav/libavformat/rm.c b/deps/libav/libavformat/rm.c
deleted file mode 100644
index 761be3f..0000000
--- a/deps/libav/libavformat/rm.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * "Real" compatible muxer and demuxer common code.
- * Copyright (c) 2009  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "rm.h"
-
-const char * const ff_rm_metadata[4] = {
-    "title",
-    "author",
-    "copyright",
-    "comment"
-};
-
-const AVCodecTag ff_rm_codec_tags[] = {
-    { AV_CODEC_ID_RV10,   MKTAG('R','V','1','0') },
-    { AV_CODEC_ID_RV20,   MKTAG('R','V','2','0') },
-    { AV_CODEC_ID_RV20,   MKTAG('R','V','T','R') },
-    { AV_CODEC_ID_RV30,   MKTAG('R','V','3','0') },
-    { AV_CODEC_ID_RV40,   MKTAG('R','V','4','0') },
-    { AV_CODEC_ID_AC3,    MKTAG('d','n','e','t') },
-    { AV_CODEC_ID_RA_144, MKTAG('l','p','c','J') },
-    { AV_CODEC_ID_RA_288, MKTAG('2','8','_','8') },
-    { AV_CODEC_ID_COOK,   MKTAG('c','o','o','k') },
-    { AV_CODEC_ID_ATRAC3, MKTAG('a','t','r','c') },
-    { AV_CODEC_ID_SIPR,   MKTAG('s','i','p','r') },
-    { AV_CODEC_ID_AAC,    MKTAG('r','a','a','c') },
-    { AV_CODEC_ID_AAC,    MKTAG('r','a','c','p') },
-    { AV_CODEC_ID_RALF,   MKTAG('L','S','D',':') },
-    { AV_CODEC_ID_NONE },
-};
diff --git a/deps/libav/libavformat/rm.h b/deps/libav/libavformat/rm.h
deleted file mode 100644
index a06ea01..0000000
--- a/deps/libav/libavformat/rm.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * "Real" compatible muxer and demuxer.
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RM_H
-#define AVFORMAT_RM_H
-
-#include "avformat.h"
-#include "internal.h"
-
-extern const char * const ff_rm_metadata[4];
-extern const AVCodecTag ff_rm_codec_tags[];
-
-typedef struct RMStream RMStream;
-
-RMStream *ff_rm_alloc_rmstream (void);
-void      ff_rm_free_rmstream  (RMStream *rms);
-
-/*< input format for Realmedia-style RTSP streams */
-extern AVInputFormat ff_rdt_demuxer;
-
-/**
- * Read the MDPR chunk, which contains stream-specific codec initialization
- * parameters.
- *
- * @param s context containing RMContext and AVIOContext for stream reading
- * @param pb context to read the data from
- * @param st the stream that the MDPR chunk belongs to and where to store the
- *           parameters read from the chunk into
- * @param rst real-specific stream information
- * @param codec_data_size size of the MDPR chunk
- * @return 0 on success, errno codes on error
- */
-int ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
-                               AVStream *st, RMStream *rst,
-                               int codec_data_size);
-
-/**
- * Parse one rm-stream packet from the input bytestream.
- *
- * @param s context containing RMContext and AVIOContext for stream reading
- * @param pb context to read the data from
- * @param st stream to which the packet to be read belongs
- * @param rst Real-specific stream information
- * @param len packet length to read from the input
- * @param pkt packet location to store the parsed packet data
- * @param seq pointer to an integer containing the sequence number, may be
- *            updated
- * @param flags the packet flags
- * @param ts timestamp of the current packet
- * @return <0 on error, 0 if a packet was placed in the pkt pointer. A
- *         value >0 means that no data was placed in pkt, but that cached
- *         data is available by calling ff_rm_retrieve_cache().
- */
-int ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
-                        AVStream *st, RMStream *rst, int len,
-                        AVPacket *pkt, int *seq, int flags, int64_t ts);
-
-/**
- * Retrieve one cached packet from the rm-context. The real container can
- * store several packets (as interpreted by the codec) in a single container
- * packet, which means the demuxer holds some back when the first container
- * packet is parsed and returned. The result is that rm->audio_pkt_cnt is
- * a positive number, the amount of cached packets. Using this function, each
- * of those packets can be retrieved sequentially.
- *
- * @param s context containing RMContext and AVIOContext for stream reading
- * @param pb context to read the data from
- * @param st stream that this packet belongs to
- * @param rst Real-specific stream information
- * @param pkt location to store the packet data
- * @return the number of samples left for subsequent calls to this same
- *          function, or 0 if all samples have been retrieved.
- */
-int ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
-                          AVStream *st, RMStream *rst, AVPacket *pkt);
-
-#endif /* AVFORMAT_RM_H */
diff --git a/deps/libav/libavformat/rmdec.c b/deps/libav/libavformat/rmdec.c
deleted file mode 100644
index d61f569..0000000
--- a/deps/libav/libavformat/rmdec.c
+++ /dev/null
@@ -1,972 +0,0 @@
-/*
- * "Real" compatible demuxer.
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "internal.h"
-#include "rmsipr.h"
-#include "rm.h"
-
-#define DEINT_ID_GENR MKTAG('g', 'e', 'n', 'r') ///< interleaving for Cooker/ATRAC
-#define DEINT_ID_INT0 MKTAG('I', 'n', 't', '0') ///< no interleaving needed
-#define DEINT_ID_INT4 MKTAG('I', 'n', 't', '4') ///< interleaving for 28.8
-#define DEINT_ID_SIPR MKTAG('s', 'i', 'p', 'r') ///< interleaving for Sipro
-#define DEINT_ID_VBRF MKTAG('v', 'b', 'r', 'f') ///< VBR case for AAC
-#define DEINT_ID_VBRS MKTAG('v', 'b', 'r', 's') ///< VBR case for AAC
-
-struct RMStream {
-    AVPacket pkt;      ///< place to store merged video frame / reordered audio data
-    int videobufsize;  ///< current assembled frame size
-    int videobufpos;   ///< position for the next slice in the video buffer
-    int curpic_num;    ///< picture number of current frame
-    int cur_slice, slices;
-    int64_t pktpos;    ///< first slice position in file
-    /// Audio descrambling matrix parameters
-    int64_t audiotimestamp; ///< Audio packet timestamp
-    int sub_packet_cnt; // Subpacket counter, used while reading
-    int sub_packet_size, sub_packet_h, coded_framesize; ///< Descrambling parameters from container
-    int audio_framesize; /// Audio frame size from container
-    int sub_packet_lengths[16]; /// Length of each subpacket
-    int32_t deint_id;  ///< deinterleaver used in audio stream
-};
-
-typedef struct {
-    int nb_packets;
-    int old_format;
-    int current_stream;
-    int remaining_len;
-    int audio_stream_num; ///< Stream number for audio packets
-    int audio_pkt_cnt; ///< Output packet counter
-} RMDemuxContext;
-
-static inline void get_strl(AVIOContext *pb, char *buf, int buf_size, int len)
-{
-    int i;
-    char *q, r;
-
-    q = buf;
-    for(i=0;i<len;i++) {
-        r = avio_r8(pb);
-        if (i < buf_size - 1)
-            *q++ = r;
-    }
-    if (buf_size > 0) *q = '\0';
-}
-
-static void get_str8(AVIOContext *pb, char *buf, int buf_size)
-{
-    get_strl(pb, buf, buf_size, avio_r8(pb));
-}
-
-static int rm_read_extradata(AVIOContext *pb, AVCodecContext *avctx, unsigned size)
-{
-    if (size >= 1<<24)
-        return -1;
-    avctx->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!avctx->extradata)
-        return AVERROR(ENOMEM);
-    avctx->extradata_size = avio_read(pb, avctx->extradata, size);
-    memset(avctx->extradata + avctx->extradata_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    if (avctx->extradata_size != size)
-        return AVERROR(EIO);
-    return 0;
-}
-
-static void rm_read_metadata(AVFormatContext *s, AVIOContext *pb, int wide)
-{
-    char buf[1024];
-    int i;
-    for (i=0; i<FF_ARRAY_ELEMS(ff_rm_metadata); i++) {
-        int len = wide ? avio_rb16(pb) : avio_r8(pb);
-        get_strl(pb, buf, sizeof(buf), len);
-        av_dict_set(&s->metadata, ff_rm_metadata[i], buf, 0);
-    }
-}
-
-RMStream *ff_rm_alloc_rmstream (void)
-{
-    RMStream *rms = av_mallocz(sizeof(RMStream));
-    rms->curpic_num = -1;
-    return rms;
-}
-
-void ff_rm_free_rmstream (RMStream *rms)
-{
-    av_free_packet(&rms->pkt);
-}
-
-static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
-                                     AVStream *st, RMStream *ast, int read_all)
-{
-    char buf[256];
-    uint32_t version;
-    int ret;
-
-    /* ra type header */
-    version = avio_rb16(pb); /* version */
-    if (version == 3) {
-        int header_size = avio_rb16(pb);
-        int64_t startpos = avio_tell(pb);
-        avio_skip(pb, 14);
-        rm_read_metadata(s, pb, 0);
-        if ((startpos + header_size) >= avio_tell(pb) + 2) {
-            // fourcc (should always be "lpcJ")
-            avio_r8(pb);
-            get_str8(pb, buf, sizeof(buf));
-        }
-        // Skip extra header crap (this should never happen)
-        if ((startpos + header_size) > avio_tell(pb))
-            avio_skip(pb, header_size + startpos - avio_tell(pb));
-        st->codec->sample_rate = 8000;
-        st->codec->channels = 1;
-        st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id = AV_CODEC_ID_RA_144;
-        ast->deint_id = DEINT_ID_INT0;
-    } else {
-        int flavor, sub_packet_h, coded_framesize, sub_packet_size;
-        int codecdata_length;
-        /* old version (4) */
-        avio_skip(pb, 2); /* unused */
-        avio_rb32(pb); /* .ra4 */
-        avio_rb32(pb); /* data size */
-        avio_rb16(pb); /* version2 */
-        avio_rb32(pb); /* header size */
-        flavor= avio_rb16(pb); /* add codec info / flavor */
-        ast->coded_framesize = coded_framesize = avio_rb32(pb); /* coded frame size */
-        avio_rb32(pb); /* ??? */
-        avio_rb32(pb); /* ??? */
-        avio_rb32(pb); /* ??? */
-        ast->sub_packet_h = sub_packet_h = avio_rb16(pb); /* 1 */
-        st->codec->block_align= avio_rb16(pb); /* frame size */
-        ast->sub_packet_size = sub_packet_size = avio_rb16(pb); /* sub packet size */
-        avio_rb16(pb); /* ??? */
-        if (version == 5) {
-            avio_rb16(pb); avio_rb16(pb); avio_rb16(pb);
-        }
-        st->codec->sample_rate = avio_rb16(pb);
-        avio_rb32(pb);
-        st->codec->channels = avio_rb16(pb);
-        if (version == 5) {
-            ast->deint_id = avio_rl32(pb);
-            avio_read(pb, buf, 4);
-            buf[4] = 0;
-        } else {
-            get_str8(pb, buf, sizeof(buf)); /* desc */
-            ast->deint_id = AV_RL32(buf);
-            get_str8(pb, buf, sizeof(buf)); /* desc */
-        }
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_tag  = AV_RL32(buf);
-        st->codec->codec_id   = ff_codec_get_id(ff_rm_codec_tags,
-                                                st->codec->codec_tag);
-
-        switch (st->codec->codec_id) {
-        case AV_CODEC_ID_AC3:
-            st->need_parsing = AVSTREAM_PARSE_FULL;
-            break;
-        case AV_CODEC_ID_RA_288:
-            st->codec->extradata_size= 0;
-            ast->audio_framesize = st->codec->block_align;
-            st->codec->block_align = coded_framesize;
-            break;
-        case AV_CODEC_ID_COOK:
-            st->need_parsing = AVSTREAM_PARSE_HEADERS;
-        case AV_CODEC_ID_ATRAC3:
-        case AV_CODEC_ID_SIPR:
-            avio_rb16(pb); avio_r8(pb);
-            if (version == 5)
-                avio_r8(pb);
-            codecdata_length = avio_rb32(pb);
-            if(codecdata_length + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
-                av_log(s, AV_LOG_ERROR, "codecdata_length too large\n");
-                return -1;
-            }
-
-            ast->audio_framesize = st->codec->block_align;
-            if (st->codec->codec_id == AV_CODEC_ID_SIPR) {
-                if (flavor > 3) {
-                    av_log(s, AV_LOG_ERROR, "bad SIPR file flavor %d\n",
-                           flavor);
-                    return -1;
-                }
-                st->codec->block_align = ff_sipr_subpk_size[flavor];
-            } else {
-                if(sub_packet_size <= 0){
-                    av_log(s, AV_LOG_ERROR, "sub_packet_size is invalid\n");
-                    return -1;
-                }
-                st->codec->block_align = ast->sub_packet_size;
-            }
-            if ((ret = rm_read_extradata(pb, st->codec, codecdata_length)) < 0)
-                return ret;
-            break;
-        case AV_CODEC_ID_AAC:
-            avio_rb16(pb); avio_r8(pb);
-            if (version == 5)
-                avio_r8(pb);
-            codecdata_length = avio_rb32(pb);
-            if(codecdata_length + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
-                av_log(s, AV_LOG_ERROR, "codecdata_length too large\n");
-                return -1;
-            }
-            if (codecdata_length >= 1) {
-                avio_r8(pb);
-                if ((ret = rm_read_extradata(pb, st->codec, codecdata_length - 1)) < 0)
-                    return ret;
-            }
-            break;
-        default:
-            av_strlcpy(st->codec->codec_name, buf, sizeof(st->codec->codec_name));
-        }
-        if (ast->deint_id == DEINT_ID_INT4 ||
-            ast->deint_id == DEINT_ID_GENR ||
-            ast->deint_id == DEINT_ID_SIPR) {
-            if (st->codec->block_align <= 0 ||
-                ast->audio_framesize * sub_packet_h > (unsigned)INT_MAX ||
-                ast->audio_framesize * sub_packet_h < st->codec->block_align)
-                return AVERROR_INVALIDDATA;
-            if (av_new_packet(&ast->pkt, ast->audio_framesize * sub_packet_h) < 0)
-                return AVERROR(ENOMEM);
-        }
-        switch (ast->deint_id) {
-        case DEINT_ID_INT4:
-            if (ast->coded_framesize > ast->audio_framesize ||
-                sub_packet_h <= 1 ||
-                ast->coded_framesize * sub_packet_h > (2 + (sub_packet_h & 1)) * ast->audio_framesize)
-                return AVERROR_INVALIDDATA;
-            break;
-        case DEINT_ID_GENR:
-            if (ast->sub_packet_size <= 0 ||
-                ast->sub_packet_size > ast->audio_framesize)
-                return AVERROR_INVALIDDATA;
-            break;
-        case DEINT_ID_SIPR:
-        case DEINT_ID_INT0:
-        case DEINT_ID_VBRS:
-        case DEINT_ID_VBRF:
-            break;
-        default:
-            av_log(NULL,0,"Unknown interleaver %X\n", ast->deint_id);
-            return AVERROR_INVALIDDATA;
-        }
-
-        if (read_all) {
-            avio_r8(pb);
-            avio_r8(pb);
-            avio_r8(pb);
-            rm_read_metadata(s, pb, 0);
-        }
-    }
-    return 0;
-}
-
-int
-ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
-                           AVStream *st, RMStream *rst, int codec_data_size)
-{
-    unsigned int v;
-    int size;
-    int64_t codec_pos;
-    int ret;
-
-    avpriv_set_pts_info(st, 64, 1, 1000);
-    codec_pos = avio_tell(pb);
-    v = avio_rb32(pb);
-    if (v == MKTAG(0xfd, 'a', 'r', '.')) {
-        /* ra type header */
-        if (rm_read_audio_stream_info(s, pb, st, rst, 0))
-            return -1;
-    } else if (v == MKBETAG('L', 'S', 'D', ':')) {
-        avio_seek(pb, -4, SEEK_CUR);
-        if ((ret = rm_read_extradata(pb, st->codec, codec_data_size)) < 0)
-            return ret;
-
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_tag  = AV_RL32(st->codec->extradata);
-        st->codec->codec_id   = ff_codec_get_id(ff_rm_codec_tags,
-                                                st->codec->codec_tag);
-    } else {
-        int fps;
-        if (avio_rl32(pb) != MKTAG('V', 'I', 'D', 'O')) {
-        fail1:
-            av_log(st->codec, AV_LOG_ERROR, "Unsupported video codec\n");
-            goto skip;
-        }
-        st->codec->codec_tag = avio_rl32(pb);
-        st->codec->codec_id  = ff_codec_get_id(ff_rm_codec_tags,
-                                               st->codec->codec_tag);
-        av_dlog(s, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0'));
-        if (st->codec->codec_id == AV_CODEC_ID_NONE)
-            goto fail1;
-        st->codec->width  = avio_rb16(pb);
-        st->codec->height = avio_rb16(pb);
-        avio_skip(pb, 2); // looks like bits per sample
-        avio_skip(pb, 4); // always zero?
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->need_parsing = AVSTREAM_PARSE_TIMESTAMPS;
-        fps = avio_rb32(pb);
-
-        if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0)
-            return ret;
-
-        if (fps > 0) {
-            av_reduce(&st->avg_frame_rate.den, &st->avg_frame_rate.num,
-                      0x10000, fps, (1 << 30) - 1);
-        } else if (s->error_recognition & AV_EF_EXPLODE) {
-            av_log(s, AV_LOG_ERROR, "Invalid framerate\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-skip:
-    /* skip codec info */
-    size = avio_tell(pb) - codec_pos;
-    avio_skip(pb, codec_data_size - size);
-
-    return 0;
-}
-
-/** this function assumes that the demuxer has already seeked to the start
- * of the INDX chunk, and will bail out if not. */
-static int rm_read_index(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    unsigned int size, n_pkts, str_id, next_off, n, pos, pts;
-    AVStream *st;
-
-    do {
-        if (avio_rl32(pb) != MKTAG('I','N','D','X'))
-            return -1;
-        size     = avio_rb32(pb);
-        if (size < 20)
-            return -1;
-        avio_skip(pb, 2);
-        n_pkts   = avio_rb32(pb);
-        str_id   = avio_rb16(pb);
-        next_off = avio_rb32(pb);
-        for (n = 0; n < s->nb_streams; n++)
-            if (s->streams[n]->id == str_id) {
-                st = s->streams[n];
-                break;
-            }
-        if (n == s->nb_streams) {
-            av_log(s, AV_LOG_ERROR,
-                   "Invalid stream index %d for index at pos %"PRId64"\n",
-                   str_id, avio_tell(pb));
-            goto skip;
-        } else if ((avio_size(pb) - avio_tell(pb)) / 14 < n_pkts) {
-            av_log(s, AV_LOG_ERROR,
-                   "Nr. of packets in packet index for stream index %d "
-                   "exceeds filesize (%"PRId64" at %"PRId64" = %"PRId64")\n",
-                   str_id, avio_size(pb), avio_tell(pb),
-                   (avio_size(pb) - avio_tell(pb)) / 14);
-            goto skip;
-        }
-
-        for (n = 0; n < n_pkts; n++) {
-            avio_skip(pb, 2);
-            pts = avio_rb32(pb);
-            pos = avio_rb32(pb);
-            avio_skip(pb, 4); /* packet no. */
-
-            av_add_index_entry(st, pos, pts, 0, 0, AVINDEX_KEYFRAME);
-        }
-
-skip:
-        if (next_off && avio_tell(pb) < next_off &&
-            avio_seek(pb, next_off, SEEK_SET) < 0) {
-            av_log(s, AV_LOG_ERROR,
-                   "Non-linear index detected, not supported\n");
-            return -1;
-        }
-    } while (next_off);
-
-    return 0;
-}
-
-static int rm_read_header_old(AVFormatContext *s)
-{
-    RMDemuxContext *rm = s->priv_data;
-    AVStream *st;
-
-    rm->old_format = 1;
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return -1;
-    st->priv_data = ff_rm_alloc_rmstream();
-    return rm_read_audio_stream_info(s, s->pb, st, st->priv_data, 1);
-}
-
-static int rm_read_header(AVFormatContext *s)
-{
-    RMDemuxContext *rm = s->priv_data;
-    AVStream *st;
-    AVIOContext *pb = s->pb;
-    unsigned int tag;
-    int tag_size;
-    unsigned int start_time, duration;
-    unsigned int data_off = 0, indx_off = 0;
-    char buf[128];
-    int flags = 0;
-
-    tag = avio_rl32(pb);
-    if (tag == MKTAG('.', 'r', 'a', 0xfd)) {
-        /* very old .ra format */
-        return rm_read_header_old(s);
-    } else if (tag != MKTAG('.', 'R', 'M', 'F')) {
-        return AVERROR(EIO);
-    }
-
-    tag_size = avio_rb32(pb);
-    avio_skip(pb, tag_size - 8);
-
-    for(;;) {
-        if (pb->eof_reached)
-            return -1;
-        tag = avio_rl32(pb);
-        tag_size = avio_rb32(pb);
-        avio_rb16(pb);
-        av_dlog(s, "tag=%c%c%c%c (%08x) size=%d\n",
-                (tag      ) & 0xff,
-                (tag >>  8) & 0xff,
-                (tag >> 16) & 0xff,
-                (tag >> 24) & 0xff,
-                tag,
-                tag_size);
-        if (tag_size < 10 && tag != MKTAG('D', 'A', 'T', 'A'))
-            return -1;
-        switch(tag) {
-        case MKTAG('P', 'R', 'O', 'P'):
-            /* file header */
-            avio_rb32(pb); /* max bit rate */
-            avio_rb32(pb); /* avg bit rate */
-            avio_rb32(pb); /* max packet size */
-            avio_rb32(pb); /* avg packet size */
-            avio_rb32(pb); /* nb packets */
-            avio_rb32(pb); /* duration */
-            avio_rb32(pb); /* preroll */
-            indx_off = avio_rb32(pb); /* index offset */
-            data_off = avio_rb32(pb); /* data offset */
-            avio_rb16(pb); /* nb streams */
-            flags = avio_rb16(pb); /* flags */
-            break;
-        case MKTAG('C', 'O', 'N', 'T'):
-            rm_read_metadata(s, pb, 1);
-            break;
-        case MKTAG('M', 'D', 'P', 'R'):
-            st = avformat_new_stream(s, NULL);
-            if (!st)
-                return AVERROR(ENOMEM);
-            st->id = avio_rb16(pb);
-            avio_rb32(pb); /* max bit rate */
-            st->codec->bit_rate = avio_rb32(pb); /* bit rate */
-            avio_rb32(pb); /* max packet size */
-            avio_rb32(pb); /* avg packet size */
-            start_time = avio_rb32(pb); /* start time */
-            avio_rb32(pb); /* preroll */
-            duration = avio_rb32(pb); /* duration */
-            st->start_time = start_time;
-            st->duration = duration;
-            get_str8(pb, buf, sizeof(buf)); /* desc */
-            get_str8(pb, buf, sizeof(buf)); /* mimetype */
-            st->codec->codec_type = AVMEDIA_TYPE_DATA;
-            st->priv_data = ff_rm_alloc_rmstream();
-            if (ff_rm_read_mdpr_codecdata(s, s->pb, st, st->priv_data,
-                                          avio_rb32(pb)) < 0)
-                return -1;
-            break;
-        case MKTAG('D', 'A', 'T', 'A'):
-            goto header_end;
-        default:
-            /* unknown tag: skip it */
-            avio_skip(pb, tag_size - 10);
-            break;
-        }
-    }
- header_end:
-    rm->nb_packets = avio_rb32(pb); /* number of packets */
-    if (!rm->nb_packets && (flags & 4))
-        rm->nb_packets = 3600 * 25;
-    avio_rb32(pb); /* next data header */
-
-    if (!data_off)
-        data_off = avio_tell(pb) - 18;
-    if (indx_off && pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) &&
-        avio_seek(pb, indx_off, SEEK_SET) >= 0) {
-        rm_read_index(s);
-        avio_seek(pb, data_off + 18, SEEK_SET);
-    }
-
-    return 0;
-}
-
-static int get_num(AVIOContext *pb, int *len)
-{
-    int n, n1;
-
-    n = avio_rb16(pb);
-    (*len)-=2;
-    n &= 0x7FFF;
-    if (n >= 0x4000) {
-        return n - 0x4000;
-    } else {
-        n1 = avio_rb16(pb);
-        (*len)-=2;
-        return (n << 16) | n1;
-    }
-}
-
-/* multiple of 20 bytes for ra144 (ugly) */
-#define RAW_PACKET_SIZE 1000
-
-static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos){
-    RMDemuxContext *rm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    uint32_t state=0xFFFFFFFF;
-
-    while(!pb->eof_reached){
-        int len, num, i;
-        *pos= avio_tell(pb) - 3;
-        if(rm->remaining_len > 0){
-            num= rm->current_stream;
-            len= rm->remaining_len;
-            *timestamp = AV_NOPTS_VALUE;
-            *flags= 0;
-        }else{
-            state= (state<<8) + avio_r8(pb);
-
-            if(state == MKBETAG('I', 'N', 'D', 'X')){
-                int n_pkts, expected_len;
-                len = avio_rb32(pb);
-                avio_skip(pb, 2);
-                n_pkts = avio_rb32(pb);
-                expected_len = 20 + n_pkts * 14;
-                if (len == 20)
-                    /* some files don't add index entries to chunk size... */
-                    len = expected_len;
-                else if (len != expected_len)
-                    av_log(s, AV_LOG_WARNING,
-                           "Index size %d (%d pkts) is wrong, should be %d.\n",
-                           len, n_pkts, expected_len);
-                len -= 14; // we already read part of the index header
-                if(len<0)
-                    continue;
-                goto skip;
-            } else if (state == MKBETAG('D','A','T','A')) {
-                av_log(s, AV_LOG_WARNING,
-                       "DATA tag in middle of chunk, file may be broken.\n");
-            }
-
-            if(state > (unsigned)0xFFFF || state <= 12)
-                continue;
-            len=state - 12;
-            state= 0xFFFFFFFF;
-
-            num = avio_rb16(pb);
-            *timestamp = avio_rb32(pb);
-            avio_r8(pb); /* reserved */
-            *flags = avio_r8(pb); /* flags */
-        }
-        for(i=0;i<s->nb_streams;i++) {
-            st = s->streams[i];
-            if (num == st->id)
-                break;
-        }
-        if (i == s->nb_streams) {
-skip:
-            /* skip packet if unknown number */
-            avio_skip(pb, len);
-            rm->remaining_len = 0;
-            continue;
-        }
-        *stream_index= i;
-
-        return len;
-    }
-    return -1;
-}
-
-static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
-                                   RMDemuxContext *rm, RMStream *vst,
-                                   AVPacket *pkt, int len, int *pseq,
-                                   int64_t *timestamp)
-{
-    int hdr, seq, pic_num, len2, pos;
-    int type;
-
-    hdr = avio_r8(pb); len--;
-    type = hdr >> 6;
-
-    if(type != 3){  // not frame as a part of packet
-        seq = avio_r8(pb); len--;
-    }
-    if(type != 1){  // not whole frame
-        len2 = get_num(pb, &len);
-        pos  = get_num(pb, &len);
-        pic_num = avio_r8(pb); len--;
-    }
-    if(len<0)
-        return -1;
-    rm->remaining_len = len;
-    if(type&1){     // frame, not slice
-        if(type == 3){  // frame as a part of packet
-            len= len2;
-            *timestamp = pos;
-        }
-        if(rm->remaining_len < len)
-            return -1;
-        rm->remaining_len -= len;
-        if(av_new_packet(pkt, len + 9) < 0)
-            return AVERROR(EIO);
-        pkt->data[0] = 0;
-        AV_WL32(pkt->data + 1, 1);
-        AV_WL32(pkt->data + 5, 0);
-        avio_read(pb, pkt->data + 9, len);
-        return 0;
-    }
-    //now we have to deal with single slice
-
-    *pseq = seq;
-    if((seq & 0x7F) == 1 || vst->curpic_num != pic_num){
-        vst->slices = ((hdr & 0x3F) << 1) + 1;
-        vst->videobufsize = len2 + 8*vst->slices + 1;
-        av_free_packet(&vst->pkt); //FIXME this should be output.
-        if(av_new_packet(&vst->pkt, vst->videobufsize) < 0)
-            return AVERROR(ENOMEM);
-        vst->videobufpos = 8*vst->slices + 1;
-        vst->cur_slice = 0;
-        vst->curpic_num = pic_num;
-        vst->pktpos = avio_tell(pb);
-    }
-    if(type == 2)
-        len = FFMIN(len, pos);
-
-    if(++vst->cur_slice > vst->slices)
-        return 1;
-    AV_WL32(vst->pkt.data - 7 + 8*vst->cur_slice, 1);
-    AV_WL32(vst->pkt.data - 3 + 8*vst->cur_slice, vst->videobufpos - 8*vst->slices - 1);
-    if(vst->videobufpos + len > vst->videobufsize)
-        return 1;
-    if (avio_read(pb, vst->pkt.data + vst->videobufpos, len) != len)
-        return AVERROR(EIO);
-    vst->videobufpos += len;
-    rm->remaining_len-= len;
-
-    if (type == 2 || vst->videobufpos == vst->videobufsize) {
-        vst->pkt.data[0] = vst->cur_slice-1;
-        *pkt= vst->pkt;
-        vst->pkt.data= NULL;
-        vst->pkt.size= 0;
-        vst->pkt.buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-        vst->pkt.destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-        if(vst->slices != vst->cur_slice) //FIXME find out how to set slices correct from the begin
-            memmove(pkt->data + 1 + 8*vst->cur_slice, pkt->data + 1 + 8*vst->slices,
-                vst->videobufpos - 1 - 8*vst->slices);
-        pkt->size = vst->videobufpos + 8*(vst->cur_slice - vst->slices);
-        pkt->pts = AV_NOPTS_VALUE;
-        pkt->pos = vst->pktpos;
-        vst->slices = 0;
-        return 0;
-    }
-
-    return 1;
-}
-
-static inline void
-rm_ac3_swap_bytes (AVStream *st, AVPacket *pkt)
-{
-    uint8_t *ptr;
-    int j;
-
-    if (st->codec->codec_id == AV_CODEC_ID_AC3) {
-        ptr = pkt->data;
-        for (j=0;j<pkt->size;j+=2) {
-            FFSWAP(int, ptr[0], ptr[1]);
-            ptr += 2;
-        }
-    }
-}
-
-int
-ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
-                    AVStream *st, RMStream *ast, int len, AVPacket *pkt,
-                    int *seq, int flags, int64_t timestamp)
-{
-    RMDemuxContext *rm = s->priv_data;
-
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        rm->current_stream= st->id;
-        if(rm_assemble_video_frame(s, pb, rm, ast, pkt, len, seq, &timestamp))
-            return -1; //got partial frame
-    } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-        if ((ast->deint_id == DEINT_ID_GENR) ||
-            (ast->deint_id == DEINT_ID_INT4) ||
-            (ast->deint_id == DEINT_ID_SIPR)) {
-            int x;
-            int sps = ast->sub_packet_size;
-            int cfs = ast->coded_framesize;
-            int h = ast->sub_packet_h;
-            int y = ast->sub_packet_cnt;
-            int w = ast->audio_framesize;
-
-            if (flags & 2)
-                y = ast->sub_packet_cnt = 0;
-            if (!y)
-                ast->audiotimestamp = timestamp;
-
-            switch (ast->deint_id) {
-                case DEINT_ID_INT4:
-                    for (x = 0; x < h/2; x++)
-                        avio_read(pb, ast->pkt.data+x*2*w+y*cfs, cfs);
-                    break;
-                case DEINT_ID_GENR:
-                    for (x = 0; x < w/sps; x++)
-                        avio_read(pb, ast->pkt.data+sps*(h*x+((h+1)/2)*(y&1)+(y>>1)), sps);
-                    break;
-                case DEINT_ID_SIPR:
-                    avio_read(pb, ast->pkt.data + y * w, w);
-                    break;
-            }
-
-            if (++(ast->sub_packet_cnt) < h)
-                return -1;
-            if (ast->deint_id == DEINT_ID_SIPR)
-                ff_rm_reorder_sipr_data(ast->pkt.data, h, w);
-
-             ast->sub_packet_cnt = 0;
-             rm->audio_stream_num = st->index;
-             rm->audio_pkt_cnt = h * w / st->codec->block_align;
-        } else if ((ast->deint_id == DEINT_ID_VBRF) ||
-                   (ast->deint_id == DEINT_ID_VBRS)) {
-            int x;
-            rm->audio_stream_num = st->index;
-            ast->sub_packet_cnt = (avio_rb16(pb) & 0xf0) >> 4;
-            if (ast->sub_packet_cnt) {
-                for (x = 0; x < ast->sub_packet_cnt; x++)
-                    ast->sub_packet_lengths[x] = avio_rb16(pb);
-                rm->audio_pkt_cnt = ast->sub_packet_cnt;
-                ast->audiotimestamp = timestamp;
-            } else
-                return -1;
-        } else {
-            av_get_packet(pb, pkt, len);
-            rm_ac3_swap_bytes(st, pkt);
-        }
-    } else
-        av_get_packet(pb, pkt, len);
-
-    pkt->stream_index = st->index;
-
-#if 0
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        if(st->codec->codec_id == AV_CODEC_ID_RV20){
-            int seq= 128*(pkt->data[2]&0x7F) + (pkt->data[3]>>1);
-            av_log(s, AV_LOG_DEBUG, "%d %"PRId64" %d\n", *timestamp, *timestamp*512LL/25, seq);
-
-            seq |= (timestamp&~0x3FFF);
-            if(seq - timestamp >  0x2000) seq -= 0x4000;
-            if(seq - timestamp < -0x2000) seq += 0x4000;
-        }
-    }
-#endif
-
-    pkt->pts = timestamp;
-    if (flags & 2)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-
-    return st->codec->codec_type == AVMEDIA_TYPE_AUDIO ? rm->audio_pkt_cnt : 0;
-}
-
-int
-ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
-                      AVStream *st, RMStream *ast, AVPacket *pkt)
-{
-    RMDemuxContext *rm = s->priv_data;
-
-    assert (rm->audio_pkt_cnt > 0);
-
-    if (ast->deint_id == DEINT_ID_VBRF ||
-        ast->deint_id == DEINT_ID_VBRS)
-        av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
-    else {
-        av_new_packet(pkt, st->codec->block_align);
-        memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this
-               (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),
-               st->codec->block_align);
-    }
-    rm->audio_pkt_cnt--;
-    if ((pkt->pts = ast->audiotimestamp) != AV_NOPTS_VALUE) {
-        ast->audiotimestamp = AV_NOPTS_VALUE;
-        pkt->flags = AV_PKT_FLAG_KEY;
-    } else
-        pkt->flags = 0;
-    pkt->stream_index = st->index;
-
-    return rm->audio_pkt_cnt;
-}
-
-static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    RMDemuxContext *rm = s->priv_data;
-    AVStream *st;
-    int i, len, res, seq = 1;
-    int64_t timestamp, pos;
-    int flags;
-
-    for (;;) {
-        if (rm->audio_pkt_cnt) {
-            // If there are queued audio packet return them first
-            st = s->streams[rm->audio_stream_num];
-            ff_rm_retrieve_cache(s, s->pb, st, st->priv_data, pkt);
-            flags = 0;
-        } else {
-            if (rm->old_format) {
-                RMStream *ast;
-
-                st = s->streams[0];
-                ast = st->priv_data;
-                timestamp = AV_NOPTS_VALUE;
-                len = !ast->audio_framesize ? RAW_PACKET_SIZE :
-                    ast->coded_framesize * ast->sub_packet_h / 2;
-                flags = (seq++ == 1) ? 2 : 0;
-                pos = avio_tell(s->pb);
-            } else {
-                len=sync(s, &timestamp, &flags, &i, &pos);
-                if (len > 0)
-                    st = s->streams[i];
-            }
-
-            if(len<0 || s->pb->eof_reached)
-                return AVERROR(EIO);
-
-            res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,
-                                      &seq, flags, timestamp);
-            if((flags&2) && (seq&0x7F) == 1)
-                av_add_index_entry(st, pos, timestamp, 0, 0, AVINDEX_KEYFRAME);
-            if (res)
-                continue;
-        }
-
-        if(  (st->discard >= AVDISCARD_NONKEY && !(flags&2))
-           || st->discard >= AVDISCARD_ALL){
-            av_free_packet(pkt);
-        } else
-            break;
-    }
-
-    return 0;
-}
-
-static int rm_read_close(AVFormatContext *s)
-{
-    int i;
-
-    for (i=0;i<s->nb_streams;i++)
-        ff_rm_free_rmstream(s->streams[i]->priv_data);
-
-    return 0;
-}
-
-static int rm_probe(AVProbeData *p)
-{
-    /* check file header */
-    if ((p->buf[0] == '.' && p->buf[1] == 'R' &&
-         p->buf[2] == 'M' && p->buf[3] == 'F' &&
-         p->buf[4] == 0 && p->buf[5] == 0) ||
-        (p->buf[0] == '.' && p->buf[1] == 'r' &&
-         p->buf[2] == 'a' && p->buf[3] == 0xfd))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
-                               int64_t *ppos, int64_t pos_limit)
-{
-    RMDemuxContext *rm = s->priv_data;
-    int64_t pos, dts;
-    int stream_index2, flags, len, h;
-
-    pos = *ppos;
-
-    if(rm->old_format)
-        return AV_NOPTS_VALUE;
-
-    avio_seek(s->pb, pos, SEEK_SET);
-    rm->remaining_len=0;
-    for(;;){
-        int seq=1;
-        AVStream *st;
-
-        len=sync(s, &dts, &flags, &stream_index2, &pos);
-        if(len<0)
-            return AV_NOPTS_VALUE;
-
-        st = s->streams[stream_index2];
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            h= avio_r8(s->pb); len--;
-            if(!(h & 0x40)){
-                seq = avio_r8(s->pb); len--;
-            }
-        }
-
-        if((flags&2) && (seq&0x7F) == 1){
-            av_dlog(s, "%d %d-%d %"PRId64" %d\n",
-                    flags, stream_index2, stream_index, dts, seq);
-            av_add_index_entry(st, pos, dts, 0, 0, AVINDEX_KEYFRAME);
-            if(stream_index2 == stream_index)
-                break;
-        }
-
-        avio_skip(s->pb, len);
-    }
-    *ppos = pos;
-    return dts;
-}
-
-AVInputFormat ff_rm_demuxer = {
-    .name           = "rm",
-    .long_name      = NULL_IF_CONFIG_SMALL("RealMedia"),
-    .priv_data_size = sizeof(RMDemuxContext),
-    .read_probe     = rm_probe,
-    .read_header    = rm_read_header,
-    .read_packet    = rm_read_packet,
-    .read_close     = rm_read_close,
-    .read_timestamp = rm_read_dts,
-};
-
-AVInputFormat ff_rdt_demuxer = {
-    .name           = "rdt",
-    .long_name      = NULL_IF_CONFIG_SMALL("RDT demuxer"),
-    .priv_data_size = sizeof(RMDemuxContext),
-    .read_close     = rm_read_close,
-    .flags          = AVFMT_NOFILE,
-};
diff --git a/deps/libav/libavformat/rmenc.c b/deps/libav/libavformat/rmenc.c
deleted file mode 100644
index fba8feb..0000000
--- a/deps/libav/libavformat/rmenc.c
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * "Real" compatible muxer.
- * Copyright (c) 2000, 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avformat.h"
-#include "avio_internal.h"
-#include "rm.h"
-#include "libavutil/dict.h"
-
-typedef struct {
-    int nb_packets;
-    int packet_total_size;
-    int packet_max_size;
-    /* codec related output */
-    int bit_rate;
-    float frame_rate;
-    int nb_frames;    /* current frame number */
-    int total_frames; /* total number of frames */
-    int num;
-    AVCodecContext *enc;
-} StreamInfo;
-
-typedef struct {
-    StreamInfo streams[2];
-    StreamInfo *audio_stream, *video_stream;
-    int data_pos; /* position of the data after the header */
-} RMMuxContext;
-
-/* in ms */
-#define BUFFER_DURATION 0
-
-
-static void put_str(AVIOContext *s, const char *tag)
-{
-    avio_wb16(s,strlen(tag));
-    while (*tag) {
-        avio_w8(s, *tag++);
-    }
-}
-
-static void put_str8(AVIOContext *s, const char *tag)
-{
-    avio_w8(s, strlen(tag));
-    while (*tag) {
-        avio_w8(s, *tag++);
-    }
-}
-
-static int rv10_write_header(AVFormatContext *ctx,
-                             int data_size, int index_pos)
-{
-    RMMuxContext *rm = ctx->priv_data;
-    AVIOContext *s = ctx->pb;
-    StreamInfo *stream;
-    unsigned char *data_offset_ptr, *start_ptr;
-    const char *desc, *mimetype;
-    int nb_packets, packet_total_size, packet_max_size, size, packet_avg_size, i;
-    int bit_rate, v, duration, flags, data_pos;
-    AVDictionaryEntry *tag;
-
-    start_ptr = s->buf_ptr;
-
-    ffio_wfourcc(s, ".RMF");
-    avio_wb32(s,18); /* header size */
-    avio_wb16(s,0);
-    avio_wb32(s,0);
-    avio_wb32(s,4 + ctx->nb_streams); /* num headers */
-
-    ffio_wfourcc(s,"PROP");
-    avio_wb32(s, 50);
-    avio_wb16(s, 0);
-    packet_max_size = 0;
-    packet_total_size = 0;
-    nb_packets = 0;
-    bit_rate = 0;
-    duration = 0;
-    for(i=0;i<ctx->nb_streams;i++) {
-        StreamInfo *stream = &rm->streams[i];
-        bit_rate += stream->bit_rate;
-        if (stream->packet_max_size > packet_max_size)
-            packet_max_size = stream->packet_max_size;
-        nb_packets += stream->nb_packets;
-        packet_total_size += stream->packet_total_size;
-        /* select maximum duration */
-        v = (int) (1000.0 * (float)stream->total_frames / stream->frame_rate);
-        if (v > duration)
-            duration = v;
-    }
-    avio_wb32(s, bit_rate); /* max bit rate */
-    avio_wb32(s, bit_rate); /* avg bit rate */
-    avio_wb32(s, packet_max_size);        /* max packet size */
-    if (nb_packets > 0)
-        packet_avg_size = packet_total_size / nb_packets;
-    else
-        packet_avg_size = 0;
-    avio_wb32(s, packet_avg_size);        /* avg packet size */
-    avio_wb32(s, nb_packets);  /* num packets */
-    avio_wb32(s, duration); /* duration */
-    avio_wb32(s, BUFFER_DURATION);           /* preroll */
-    avio_wb32(s, index_pos);           /* index offset */
-    /* computation of data the data offset */
-    data_offset_ptr = s->buf_ptr;
-    avio_wb32(s, 0);           /* data offset : will be patched after */
-    avio_wb16(s, ctx->nb_streams);    /* num streams */
-    flags = 1 | 2; /* save allowed & perfect play */
-    if (!s->seekable)
-        flags |= 4; /* live broadcast */
-    avio_wb16(s, flags);
-
-    /* comments */
-
-    ffio_wfourcc(s,"CONT");
-    size =  4 * 2 + 10;
-    for(i=0; i<FF_ARRAY_ELEMS(ff_rm_metadata); i++) {
-        tag = av_dict_get(ctx->metadata, ff_rm_metadata[i], NULL, 0);
-        if(tag) size += strlen(tag->value);
-    }
-    avio_wb32(s,size);
-    avio_wb16(s,0);
-    for(i=0; i<FF_ARRAY_ELEMS(ff_rm_metadata); i++) {
-        tag = av_dict_get(ctx->metadata, ff_rm_metadata[i], NULL, 0);
-        put_str(s, tag ? tag->value : "");
-    }
-
-    for(i=0;i<ctx->nb_streams;i++) {
-        int codec_data_size;
-
-        stream = &rm->streams[i];
-
-        if (stream->enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-            desc = "The Audio Stream";
-            mimetype = "audio/x-pn-realaudio";
-            codec_data_size = 73;
-        } else {
-            desc = "The Video Stream";
-            mimetype = "video/x-pn-realvideo";
-            codec_data_size = 34;
-        }
-
-        ffio_wfourcc(s,"MDPR");
-        size = 10 + 9 * 4 + strlen(desc) + strlen(mimetype) + codec_data_size;
-        avio_wb32(s, size);
-        avio_wb16(s, 0);
-
-        avio_wb16(s, i); /* stream number */
-        avio_wb32(s, stream->bit_rate); /* max bit rate */
-        avio_wb32(s, stream->bit_rate); /* avg bit rate */
-        avio_wb32(s, stream->packet_max_size);        /* max packet size */
-        if (stream->nb_packets > 0)
-            packet_avg_size = stream->packet_total_size /
-                stream->nb_packets;
-        else
-            packet_avg_size = 0;
-        avio_wb32(s, packet_avg_size);        /* avg packet size */
-        avio_wb32(s, 0);           /* start time */
-        avio_wb32(s, BUFFER_DURATION);           /* preroll */
-        /* duration */
-        if (!s->seekable || !stream->total_frames)
-            avio_wb32(s, (int)(3600 * 1000));
-        else
-            avio_wb32(s, (int)(stream->total_frames * 1000 / stream->frame_rate));
-        put_str8(s, desc);
-        put_str8(s, mimetype);
-        avio_wb32(s, codec_data_size);
-
-        if (stream->enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-            int coded_frame_size, fscode, sample_rate;
-            sample_rate = stream->enc->sample_rate;
-            coded_frame_size = (stream->enc->bit_rate *
-                                stream->enc->frame_size) / (8 * sample_rate);
-            /* audio codec info */
-            avio_write(s, ".ra", 3);
-            avio_w8(s, 0xfd);
-            avio_wb32(s, 0x00040000); /* version */
-            ffio_wfourcc(s, ".ra4");
-            avio_wb32(s, 0x01b53530); /* stream length */
-            avio_wb16(s, 4); /* unknown */
-            avio_wb32(s, 0x39); /* header size */
-
-            switch(sample_rate) {
-            case 48000:
-            case 24000:
-            case 12000:
-                fscode = 1;
-                break;
-            default:
-            case 44100:
-            case 22050:
-            case 11025:
-                fscode = 2;
-                break;
-            case 32000:
-            case 16000:
-            case 8000:
-                fscode = 3;
-            }
-            avio_wb16(s, fscode); /* codec additional info, for AC-3, seems
-                                     to be a frequency code */
-            /* special hack to compensate rounding errors... */
-            if (coded_frame_size == 557)
-                coded_frame_size--;
-            avio_wb32(s, coded_frame_size); /* frame length */
-            avio_wb32(s, 0x51540); /* unknown */
-            avio_wb32(s, 0x249f0); /* unknown */
-            avio_wb32(s, 0x249f0); /* unknown */
-            avio_wb16(s, 0x01);
-            /* frame length : seems to be very important */
-            avio_wb16(s, coded_frame_size);
-            avio_wb32(s, 0); /* unknown */
-            avio_wb16(s, stream->enc->sample_rate); /* sample rate */
-            avio_wb32(s, 0x10); /* unknown */
-            avio_wb16(s, stream->enc->channels);
-            put_str8(s, "Int0"); /* codec name */
-            if (stream->enc->codec_tag) {
-                avio_w8(s, 4); /* tag length */
-                avio_wl32(s, stream->enc->codec_tag);
-            } else {
-                av_log(ctx, AV_LOG_ERROR, "Invalid codec tag\n");
-                return -1;
-            }
-            avio_wb16(s, 0); /* title length */
-            avio_wb16(s, 0); /* author length */
-            avio_wb16(s, 0); /* copyright length */
-            avio_w8(s, 0); /* end of header */
-        } else {
-            /* video codec info */
-            avio_wb32(s,34); /* size */
-            ffio_wfourcc(s, "VIDO");
-            if(stream->enc->codec_id == AV_CODEC_ID_RV10)
-                ffio_wfourcc(s,"RV10");
-            else
-                ffio_wfourcc(s,"RV20");
-            avio_wb16(s, stream->enc->width);
-            avio_wb16(s, stream->enc->height);
-            avio_wb16(s, (int) stream->frame_rate); /* frames per seconds ? */
-            avio_wb32(s,0);     /* unknown meaning */
-            avio_wb16(s, (int) stream->frame_rate);  /* unknown meaning */
-            avio_wb32(s,0);     /* unknown meaning */
-            avio_wb16(s, 8);    /* unknown meaning */
-            /* Seems to be the codec version: only use basic H263. The next
-               versions seems to add a diffential DC coding as in
-               MPEG... nothing new under the sun */
-            if(stream->enc->codec_id == AV_CODEC_ID_RV10)
-                avio_wb32(s,0x10000000);
-            else
-                avio_wb32(s,0x20103001);
-            //avio_wb32(s,0x10003000);
-        }
-    }
-
-    /* patch data offset field */
-    data_pos = s->buf_ptr - start_ptr;
-    rm->data_pos = data_pos;
-    data_offset_ptr[0] = data_pos >> 24;
-    data_offset_ptr[1] = data_pos >> 16;
-    data_offset_ptr[2] = data_pos >> 8;
-    data_offset_ptr[3] = data_pos;
-
-    /* data stream */
-    ffio_wfourcc(s, "DATA");
-    avio_wb32(s,data_size + 10 + 8);
-    avio_wb16(s,0);
-
-    avio_wb32(s, nb_packets); /* number of packets */
-    avio_wb32(s,0); /* next data header */
-    return 0;
-}
-
-static void write_packet_header(AVFormatContext *ctx, StreamInfo *stream,
-                                int length, int key_frame)
-{
-    int timestamp;
-    AVIOContext *s = ctx->pb;
-
-    stream->nb_packets++;
-    stream->packet_total_size += length;
-    if (length > stream->packet_max_size)
-        stream->packet_max_size =  length;
-
-    avio_wb16(s,0); /* version */
-    avio_wb16(s,length + 12);
-    avio_wb16(s, stream->num); /* stream number */
-    timestamp = (1000 * (float)stream->nb_frames) / stream->frame_rate;
-    avio_wb32(s, timestamp); /* timestamp */
-    avio_w8(s, 0); /* reserved */
-    avio_w8(s, key_frame ? 2 : 0); /* flags */
-}
-
-static int rm_write_header(AVFormatContext *s)
-{
-    RMMuxContext *rm = s->priv_data;
-    StreamInfo *stream;
-    int n;
-    AVCodecContext *codec;
-
-    for(n=0;n<s->nb_streams;n++) {
-        s->streams[n]->id = n;
-        codec = s->streams[n]->codec;
-        stream = &rm->streams[n];
-        memset(stream, 0, sizeof(StreamInfo));
-        stream->num = n;
-        stream->bit_rate = codec->bit_rate;
-        stream->enc = codec;
-
-        switch(codec->codec_type) {
-        case AVMEDIA_TYPE_AUDIO:
-            rm->audio_stream = stream;
-            stream->frame_rate = (float)codec->sample_rate / (float)codec->frame_size;
-            /* XXX: dummy values */
-            stream->packet_max_size = 1024;
-            stream->nb_packets = 0;
-            stream->total_frames = stream->nb_packets;
-            break;
-        case AVMEDIA_TYPE_VIDEO:
-            rm->video_stream = stream;
-            stream->frame_rate = (float)codec->time_base.den / (float)codec->time_base.num;
-            /* XXX: dummy values */
-            stream->packet_max_size = 4096;
-            stream->nb_packets = 0;
-            stream->total_frames = stream->nb_packets;
-            break;
-        default:
-            return -1;
-        }
-    }
-
-    if (rv10_write_header(s, 0, 0))
-        return AVERROR_INVALIDDATA;
-    avio_flush(s->pb);
-    return 0;
-}
-
-static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int flags)
-{
-    uint8_t *buf1;
-    RMMuxContext *rm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    StreamInfo *stream = rm->audio_stream;
-    int i;
-
-    /* XXX: suppress this malloc */
-    buf1 = av_malloc(size * sizeof(uint8_t));
-
-    write_packet_header(s, stream, size, !!(flags & AV_PKT_FLAG_KEY));
-
-    if (stream->enc->codec_id == AV_CODEC_ID_AC3) {
-        /* for AC-3, the words seem to be reversed */
-        for(i=0;i<size;i+=2) {
-            buf1[i] = buf[i+1];
-            buf1[i+1] = buf[i];
-        }
-        avio_write(pb, buf1, size);
-    } else {
-        avio_write(pb, buf, size);
-    }
-    stream->nb_frames++;
-    av_free(buf1);
-    return 0;
-}
-
-static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int flags)
-{
-    RMMuxContext *rm = s->priv_data;
-    AVIOContext *pb = s->pb;
-    StreamInfo *stream = rm->video_stream;
-    int key_frame = !!(flags & AV_PKT_FLAG_KEY);
-
-    /* XXX: this is incorrect: should be a parameter */
-
-    /* Well, I spent some time finding the meaning of these bits. I am
-       not sure I understood everything, but it works !! */
-#if 1
-    write_packet_header(s, stream, size + 7 + (size >= 0x4000)*4, key_frame);
-    /* bit 7: '1' if final packet of a frame converted in several packets */
-    avio_w8(pb, 0x81);
-    /* bit 7: '1' if I frame. bits 6..0 : sequence number in current
-       frame starting from 1 */
-    if (key_frame) {
-        avio_w8(pb, 0x81);
-    } else {
-        avio_w8(pb, 0x01);
-    }
-    if(size >= 0x4000){
-        avio_wb32(pb, size); /* total frame size */
-        avio_wb32(pb, size); /* offset from the start or the end */
-    }else{
-        avio_wb16(pb, 0x4000 | size); /* total frame size */
-        avio_wb16(pb, 0x4000 | size); /* offset from the start or the end */
-    }
-#else
-    /* full frame */
-    write_packet_header(s, size + 6);
-    avio_w8(pb, 0xc0);
-    avio_wb16(pb, 0x4000 + size); /* total frame size */
-    avio_wb16(pb, 0x4000 + packet_number * 126); /* position in stream */
-#endif
-    avio_w8(pb, stream->nb_frames & 0xff);
-
-    avio_write(pb, buf, size);
-
-    stream->nb_frames++;
-    return 0;
-}
-
-static int rm_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    if (s->streams[pkt->stream_index]->codec->codec_type ==
-        AVMEDIA_TYPE_AUDIO)
-        return rm_write_audio(s, pkt->data, pkt->size, pkt->flags);
-    else
-        return rm_write_video(s, pkt->data, pkt->size, pkt->flags);
-}
-
-static int rm_write_trailer(AVFormatContext *s)
-{
-    RMMuxContext *rm = s->priv_data;
-    int data_size, index_pos, i;
-    AVIOContext *pb = s->pb;
-
-    if (s->pb->seekable) {
-        /* end of file: finish to write header */
-        index_pos = avio_tell(pb);
-        data_size = index_pos - rm->data_pos;
-
-        /* FIXME: write index */
-
-        /* undocumented end header */
-        avio_wb32(pb, 0);
-        avio_wb32(pb, 0);
-
-        avio_seek(pb, 0, SEEK_SET);
-        for(i=0;i<s->nb_streams;i++)
-            rm->streams[i].total_frames = rm->streams[i].nb_frames;
-        rv10_write_header(s, data_size, 0);
-    } else {
-        /* undocumented end header */
-        avio_wb32(pb, 0);
-        avio_wb32(pb, 0);
-    }
-
-    return 0;
-}
-
-
-AVOutputFormat ff_rm_muxer = {
-    .name              = "rm",
-    .long_name         = NULL_IF_CONFIG_SMALL("RealMedia"),
-    .mime_type         = "application/vnd.rn-realmedia",
-    .extensions        = "rm,ra",
-    .priv_data_size    = sizeof(RMMuxContext),
-    .audio_codec       = AV_CODEC_ID_AC3,
-    .video_codec       = AV_CODEC_ID_RV10,
-    .write_header      = rm_write_header,
-    .write_packet      = rm_write_packet,
-    .write_trailer     = rm_write_trailer,
-    .codec_tag         = (const AVCodecTag* const []){ ff_rm_codec_tags, 0 },
-};
diff --git a/deps/libav/libavformat/rmsipr.c b/deps/libav/libavformat/rmsipr.c
deleted file mode 100644
index 89fbd0e..0000000
--- a/deps/libav/libavformat/rmsipr.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * tables and functions for demuxing SIPR audio muxed RealMedia style
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "rmsipr.h"
-
-const unsigned char ff_sipr_subpk_size[4] = { 29, 19, 37, 20 };
-
-static const unsigned char sipr_swaps[38][2] = {
-    {  0, 63 }, {  1, 22 }, {  2, 44 }, {  3, 90 },
-    {  5, 81 }, {  7, 31 }, {  8, 86 }, {  9, 58 },
-    { 10, 36 }, { 12, 68 }, { 13, 39 }, { 14, 73 },
-    { 15, 53 }, { 16, 69 }, { 17, 57 }, { 19, 88 },
-    { 20, 34 }, { 21, 71 }, { 24, 46 }, { 25, 94 },
-    { 26, 54 }, { 28, 75 }, { 29, 50 }, { 32, 70 },
-    { 33, 92 }, { 35, 74 }, { 38, 85 }, { 40, 56 },
-    { 42, 87 }, { 43, 65 }, { 45, 59 }, { 48, 79 },
-    { 49, 93 }, { 51, 89 }, { 55, 95 }, { 61, 76 },
-    { 67, 83 }, { 77, 80 }
-};
-
-/* This can be optimized, e.g. use memcpy() if data blocks are aligned. */
-void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize)
-{
-    int n, bs = sub_packet_h * framesize * 2 / 96; // nibbles per subpacket
-
-    for (n = 0; n < 38; n++) {
-        int j;
-        int i = bs * sipr_swaps[n][0];
-        int o = bs * sipr_swaps[n][1];
-
-        /* swap 4bit-nibbles of block 'i' with 'o' */
-        for (j = 0; j < bs; j++, i++, o++) {
-            int x = (buf[i >> 1] >> (4 * (i & 1))) & 0xF,
-                y = (buf[o >> 1] >> (4 * (o & 1))) & 0xF;
-
-            buf[o >> 1] = (x << (4 * (o & 1))) |
-                (buf[o >> 1] & (0xF << (4 * !(o & 1))));
-            buf[i >> 1] = (y << (4 * (i & 1))) |
-                (buf[i >> 1] & (0xF << (4 * !(i & 1))));
-        }
-    }
-}
diff --git a/deps/libav/libavformat/rmsipr.h b/deps/libav/libavformat/rmsipr.h
deleted file mode 100644
index c8d3d0a..0000000
--- a/deps/libav/libavformat/rmsipr.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * tables and functions for demuxing SIPR audio muxed RealMedia style
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RMSIPR_H
-#define AVFORMAT_RMSIPR_H
-
-#include <stdint.h>
-
-extern const unsigned char ff_sipr_subpk_size[4];
-
-/**
- * Perform 4-bit block reordering for SIPR data.
- *
- * @param buf SIPR data
- */
-void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize);
-
-#endif /* AVFORMAT_RMSIPR_H */
diff --git a/deps/libav/libavformat/rpl.c b/deps/libav/libavformat/rpl.c
deleted file mode 100644
index 0b22d8a..0000000
--- a/deps/libav/libavformat/rpl.c
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * ARMovie/RPL demuxer
- * Copyright (c) 2007 Christian Ohm, 2008 Eli Friedman
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define RPL_SIGNATURE "ARMovie\x0A"
-#define RPL_SIGNATURE_SIZE 8
-
-/** 256 is arbitrary, but should be big enough for any reasonable file. */
-#define RPL_LINE_LENGTH 256
-
-static int rpl_probe(AVProbeData *p)
-{
-    if (memcmp(p->buf, RPL_SIGNATURE, RPL_SIGNATURE_SIZE))
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-typedef struct RPLContext {
-    // RPL header data
-    int32_t frames_per_chunk;
-
-    // Stream position data
-    uint32_t chunk_number;
-    uint32_t chunk_part;
-    uint32_t frame_in_part;
-} RPLContext;
-
-static int read_line(AVIOContext * pb, char* line, int bufsize)
-{
-    int i;
-    for (i = 0; i < bufsize - 1; i++) {
-        int b = avio_r8(pb);
-        if (b == 0)
-            break;
-        if (b == '\n') {
-            line[i] = '\0';
-            return 0;
-        }
-        line[i] = b;
-    }
-    line[i] = '\0';
-    return -1;
-}
-
-static int32_t read_int(const char* line, const char** endptr, int* error)
-{
-    unsigned long result = 0;
-    for (; *line>='0' && *line<='9'; line++) {
-        if (result > (0x7FFFFFFF - 9) / 10)
-            *error = -1;
-        result = 10 * result + *line - '0';
-    }
-    *endptr = line;
-    return result;
-}
-
-static int32_t read_line_and_int(AVIOContext * pb, int* error)
-{
-    char line[RPL_LINE_LENGTH];
-    const char *endptr;
-    *error |= read_line(pb, line, sizeof(line));
-    return read_int(line, &endptr, error);
-}
-
-/** Parsing for fps, which can be a fraction. Unfortunately,
-  * the spec for the header leaves out a lot of details,
-  * so this is mostly guessing.
-  */
-static AVRational read_fps(const char* line, int* error)
-{
-    int64_t num, den = 1;
-    AVRational result;
-    num = read_int(line, &line, error);
-    if (*line == '.')
-        line++;
-    for (; *line>='0' && *line<='9'; line++) {
-        // Truncate any numerator too large to fit into an int64_t
-        if (num > (INT64_MAX - 9) / 10 || den > INT64_MAX / 10)
-            break;
-        num  = 10 * num + *line - '0';
-        den *= 10;
-    }
-    if (!num)
-        *error = -1;
-    av_reduce(&result.num, &result.den, num, den, 0x7FFFFFFF);
-    return result;
-}
-
-static int rpl_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    RPLContext *rpl = s->priv_data;
-    AVStream *vst = NULL, *ast = NULL;
-    int total_audio_size;
-    int error = 0;
-
-    uint32_t i;
-
-    int32_t audio_format, chunk_catalog_offset, number_of_chunks;
-    AVRational fps;
-
-    char line[RPL_LINE_LENGTH];
-
-    // The header for RPL/ARMovie files is 21 lines of text
-    // containing the various header fields.  The fields are always
-    // in the same order, and other text besides the first
-    // number usually isn't important.
-    // (The spec says that there exists some significance
-    // for the text in a few cases; samples needed.)
-    error |= read_line(pb, line, sizeof(line));      // ARMovie
-    error |= read_line(pb, line, sizeof(line));      // movie name
-    av_dict_set(&s->metadata, "title"    , line, 0);
-    error |= read_line(pb, line, sizeof(line));      // date/copyright
-    av_dict_set(&s->metadata, "copyright", line, 0);
-    error |= read_line(pb, line, sizeof(line));      // author and other
-    av_dict_set(&s->metadata, "author"   , line, 0);
-
-    // video headers
-    vst = avformat_new_stream(s, NULL);
-    if (!vst)
-        return AVERROR(ENOMEM);
-    vst->codec->codec_type      = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_tag       = read_line_and_int(pb, &error);  // video format
-    vst->codec->width           = read_line_and_int(pb, &error);  // video width
-    vst->codec->height          = read_line_and_int(pb, &error);  // video height
-    vst->codec->bits_per_coded_sample = read_line_and_int(pb, &error);  // video bits per sample
-    error |= read_line(pb, line, sizeof(line));                   // video frames per second
-    fps = read_fps(line, &error);
-    avpriv_set_pts_info(vst, 32, fps.den, fps.num);
-
-    // Figure out the video codec
-    switch (vst->codec->codec_tag) {
-#if 0
-        case 122:
-            vst->codec->codec_id = AV_CODEC_ID_ESCAPE122;
-            break;
-#endif
-        case 124:
-            vst->codec->codec_id = AV_CODEC_ID_ESCAPE124;
-            // The header is wrong here, at least sometimes
-            vst->codec->bits_per_coded_sample = 16;
-            break;
-        case 130:
-            vst->codec->codec_id = AV_CODEC_ID_ESCAPE130;
-            break;
-        default:
-            av_log(s, AV_LOG_WARNING,
-                   "RPL video format %i not supported yet!\n",
-                   vst->codec->codec_tag);
-            vst->codec->codec_id = AV_CODEC_ID_NONE;
-    }
-
-    // Audio headers
-
-    // ARMovie supports multiple audio tracks; I don't have any
-    // samples, though. This code will ignore additional tracks.
-    audio_format = read_line_and_int(pb, &error);  // audio format ID
-    if (audio_format) {
-        ast = avformat_new_stream(s, NULL);
-        if (!ast)
-            return AVERROR(ENOMEM);
-        ast->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-        ast->codec->codec_tag       = audio_format;
-        ast->codec->sample_rate     = read_line_and_int(pb, &error);  // audio bitrate
-        ast->codec->channels        = read_line_and_int(pb, &error);  // number of audio channels
-        ast->codec->bits_per_coded_sample = read_line_and_int(pb, &error);  // audio bits per sample
-        // At least one sample uses 0 for ADPCM, which is really 4 bits
-        // per sample.
-        if (ast->codec->bits_per_coded_sample == 0)
-            ast->codec->bits_per_coded_sample = 4;
-
-        ast->codec->bit_rate = ast->codec->sample_rate *
-                               ast->codec->bits_per_coded_sample *
-                               ast->codec->channels;
-
-        ast->codec->codec_id = AV_CODEC_ID_NONE;
-        switch (audio_format) {
-            case 1:
-                if (ast->codec->bits_per_coded_sample == 16) {
-                    // 16-bit audio is always signed
-                    ast->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
-                    break;
-                }
-                // There are some other formats listed as legal per the spec;
-                // samples needed.
-                break;
-            case 101:
-                if (ast->codec->bits_per_coded_sample == 8) {
-                    // The samples with this kind of audio that I have
-                    // are all unsigned.
-                    ast->codec->codec_id = AV_CODEC_ID_PCM_U8;
-                    break;
-                } else if (ast->codec->bits_per_coded_sample == 4) {
-                    ast->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_EA_SEAD;
-                    break;
-                }
-                break;
-        }
-        if (ast->codec->codec_id == AV_CODEC_ID_NONE) {
-            av_log(s, AV_LOG_WARNING,
-                   "RPL audio format %i not supported yet!\n",
-                   audio_format);
-        }
-        avpriv_set_pts_info(ast, 32, 1, ast->codec->bit_rate);
-    } else {
-        for (i = 0; i < 3; i++)
-            error |= read_line(pb, line, sizeof(line));
-    }
-
-    rpl->frames_per_chunk = read_line_and_int(pb, &error);  // video frames per chunk
-    if (rpl->frames_per_chunk > 1 && vst->codec->codec_tag != 124)
-        av_log(s, AV_LOG_WARNING,
-               "Don't know how to split frames for video format %i. "
-               "Video stream will be broken!\n", vst->codec->codec_tag);
-
-    number_of_chunks = read_line_and_int(pb, &error);  // number of chunks in the file
-    // The number in the header is actually the index of the last chunk.
-    number_of_chunks++;
-
-    error |= read_line(pb, line, sizeof(line));  // "even" chunk size in bytes
-    error |= read_line(pb, line, sizeof(line));  // "odd" chunk size in bytes
-    chunk_catalog_offset =                       // offset of the "chunk catalog"
-        read_line_and_int(pb, &error);           //   (file index)
-    error |= read_line(pb, line, sizeof(line));  // offset to "helpful" sprite
-    error |= read_line(pb, line, sizeof(line));  // size of "helpful" sprite
-    error |= read_line(pb, line, sizeof(line));  // offset to key frame list
-
-    // Read the index
-    avio_seek(pb, chunk_catalog_offset, SEEK_SET);
-    total_audio_size = 0;
-    for (i = 0; i < number_of_chunks; i++) {
-        int64_t offset, video_size, audio_size;
-        error |= read_line(pb, line, sizeof(line));
-        if (3 != sscanf(line, "%"PRId64" , %"PRId64" ; %"PRId64,
-                        &offset, &video_size, &audio_size))
-            error = -1;
-        av_add_index_entry(vst, offset, i * rpl->frames_per_chunk,
-                           video_size, rpl->frames_per_chunk, 0);
-        if (ast)
-            av_add_index_entry(ast, offset + video_size, total_audio_size,
-                               audio_size, audio_size * 8, 0);
-        total_audio_size += audio_size * 8;
-    }
-
-    if (error) return AVERROR(EIO);
-
-    return 0;
-}
-
-static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    RPLContext *rpl = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream* stream;
-    AVIndexEntry* index_entry;
-    uint32_t ret;
-
-    if (rpl->chunk_part == s->nb_streams) {
-        rpl->chunk_number++;
-        rpl->chunk_part = 0;
-    }
-
-    stream = s->streams[rpl->chunk_part];
-
-    if (rpl->chunk_number >= stream->nb_index_entries)
-        return -1;
-
-    index_entry = &stream->index_entries[rpl->chunk_number];
-
-    if (rpl->frame_in_part == 0)
-        if (avio_seek(pb, index_entry->pos, SEEK_SET) < 0)
-            return AVERROR(EIO);
-
-    if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-        stream->codec->codec_tag == 124) {
-        // We have to split Escape 124 frames because there are
-        // multiple frames per chunk in Escape 124 samples.
-        uint32_t frame_size;
-
-        avio_skip(pb, 4); /* flags */
-        frame_size = avio_rl32(pb);
-        if (avio_seek(pb, -8, SEEK_CUR) < 0)
-            return AVERROR(EIO);
-
-        ret = av_get_packet(pb, pkt, frame_size);
-        if (ret != frame_size) {
-            av_free_packet(pkt);
-            return AVERROR(EIO);
-        }
-        pkt->duration = 1;
-        pkt->pts = index_entry->timestamp + rpl->frame_in_part;
-        pkt->stream_index = rpl->chunk_part;
-
-        rpl->frame_in_part++;
-        if (rpl->frame_in_part == rpl->frames_per_chunk) {
-            rpl->frame_in_part = 0;
-            rpl->chunk_part++;
-        }
-    } else {
-        ret = av_get_packet(pb, pkt, index_entry->size);
-        if (ret != index_entry->size) {
-            av_free_packet(pkt);
-            return AVERROR(EIO);
-        }
-
-        if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            // frames_per_chunk should always be one here; the header
-            // parsing will warn if it isn't.
-            pkt->duration = rpl->frames_per_chunk;
-        } else {
-            // All the audio codecs supported in this container
-            // (at least so far) are constant-bitrate.
-            pkt->duration = ret * 8;
-        }
-        pkt->pts = index_entry->timestamp;
-        pkt->stream_index = rpl->chunk_part;
-        rpl->chunk_part++;
-    }
-
-    // None of the Escape formats have keyframes, and the ADPCM
-    // format used doesn't have keyframes.
-    if (rpl->chunk_number == 0 && rpl->frame_in_part == 0)
-        pkt->flags |= AV_PKT_FLAG_KEY;
-
-    return ret;
-}
-
-AVInputFormat ff_rpl_demuxer = {
-    .name           = "rpl",
-    .long_name      = NULL_IF_CONFIG_SMALL("RPL / ARMovie"),
-    .priv_data_size = sizeof(RPLContext),
-    .read_probe     = rpl_probe,
-    .read_header    = rpl_read_header,
-    .read_packet    = rpl_read_packet,
-};
diff --git a/deps/libav/libavformat/rso.c b/deps/libav/libavformat/rso.c
deleted file mode 100644
index 4ce61e7..0000000
--- a/deps/libav/libavformat/rso.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * RSO format common data
- * Copyright (c) 2010 Rafael Carre
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "rso.h"
-
-const AVCodecTag ff_codec_rso_tags[] = {
-    { AV_CODEC_ID_PCM_U8,          0x0100 },
-    { AV_CODEC_ID_ADPCM_IMA_WAV,   0x0101 },
-    { AV_CODEC_ID_NONE, 0 },
-};
diff --git a/deps/libav/libavformat/rso.h b/deps/libav/libavformat/rso.h
deleted file mode 100644
index e3e88ea..0000000
--- a/deps/libav/libavformat/rso.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * RSO format common data
- * Copyright (c) 2010 Rafael Carre
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RSO_H
-#define AVFORMAT_RSO_H
-
-#include "internal.h"
-
-#define RSO_HEADER_SIZE 8
-
-/* The libavcodec codecs we support, and the IDs they have in the file */
-extern const AVCodecTag ff_codec_rso_tags[];
-
-#endif /* AVFORMAT_RSO_H */
diff --git a/deps/libav/libavformat/rsodec.c b/deps/libav/libavformat/rsodec.c
deleted file mode 100644
index 1612572..0000000
--- a/deps/libav/libavformat/rsodec.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * RSO demuxer
- * Copyright (c) 2001 Fabrice Bellard (original AU code)
- * Copyright (c) 2010 Rafael Carre
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-#include "pcm.h"
-#include "rso.h"
-
-static int rso_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    int id, rate, bps;
-    unsigned int size;
-    enum AVCodecID codec;
-    AVStream *st;
-
-    id   = avio_rb16(pb);
-    size = avio_rb16(pb);
-    rate = avio_rb16(pb);
-    avio_rb16(pb);   /* play mode ? (0x0000 = don't loop) */
-
-    codec = ff_codec_get_id(ff_codec_rso_tags, id);
-
-    if (codec == AV_CODEC_ID_ADPCM_IMA_WAV) {
-        avpriv_report_missing_feature(s, "ADPCM in RSO");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    bps = av_get_bits_per_sample(codec);
-    if (!bps) {
-        avpriv_request_sample(s, "Unknown bits per sample");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* now we are ready: build format streams */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->duration            = (size * 8) / bps;
-    st->codec->codec_type   = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_tag    = id;
-    st->codec->codec_id     = codec;
-    st->codec->channels     = 1;
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    st->codec->sample_rate  = rate;
-
-    avpriv_set_pts_info(st, 64, 1, rate);
-
-    return 0;
-}
-
-#define BLOCK_SIZE 1024 /* in samples */
-
-static int rso_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int bps = av_get_bits_per_sample(s->streams[0]->codec->codec_id);
-    int ret = av_get_packet(s->pb, pkt, BLOCK_SIZE * bps >> 3);
-
-    if (ret < 0)
-        return ret;
-
-    pkt->stream_index = 0;
-
-    /* note: we need to modify the packet size here to handle the last packet */
-    pkt->size = ret;
-
-    return 0;
-}
-
-AVInputFormat ff_rso_demuxer = {
-    .name           =   "rso",
-    .long_name      =   NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO"),
-    .extensions     =   "rso",
-    .read_header    =   rso_read_header,
-    .read_packet    =   rso_read_packet,
-    .read_seek      =   ff_pcm_read_seek,
-    .codec_tag      =   (const AVCodecTag* const []){ff_codec_rso_tags, 0},
-};
diff --git a/deps/libav/libavformat/rsoenc.c b/deps/libav/libavformat/rsoenc.c
deleted file mode 100644
index cc76f9a..0000000
--- a/deps/libav/libavformat/rsoenc.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * RSO muxer
- * Copyright (c) 2001 Fabrice Bellard (original AU code)
- * Copyright (c) 2010 Rafael Carre
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "riff.h"
-#include "rso.h"
-
-static int rso_write_header(AVFormatContext *s)
-{
-    AVIOContext  *pb  = s->pb;
-    AVCodecContext *enc = s->streams[0]->codec;
-
-    if (!enc->codec_tag)
-        return AVERROR_INVALIDDATA;
-
-    if (enc->channels != 1) {
-        av_log(s, AV_LOG_ERROR, "RSO only supports mono\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!s->pb->seekable) {
-        av_log(s, AV_LOG_ERROR, "muxer does not support non seekable output\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* XXX: find legal sample rates (if any) */
-    if (enc->sample_rate >= 1u<<16) {
-        av_log(s, AV_LOG_ERROR, "Sample rate must be < 65536\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (enc->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV) {
-        av_log(s, AV_LOG_ERROR, "ADPCM in RSO not implemented\n");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* format header */
-    avio_wb16(pb, enc->codec_tag);   /* codec ID */
-    avio_wb16(pb, 0);                /* data size, will be written at EOF */
-    avio_wb16(pb, enc->sample_rate);
-    avio_wb16(pb, 0x0000);           /* play mode ? (0x0000 = don't loop) */
-
-    avio_flush(pb);
-
-    return 0;
-}
-
-static int rso_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    avio_write(s->pb, pkt->data, pkt->size);
-    return 0;
-}
-
-static int rso_write_trailer(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    int64_t file_size;
-    uint16_t coded_file_size;
-
-    file_size = avio_tell(pb);
-
-    if (file_size < 0)
-        return file_size;
-
-    if (file_size > 0xffff + RSO_HEADER_SIZE) {
-        av_log(s, AV_LOG_WARNING,
-               "Output file is too big (%"PRId64" bytes >= 64kB)\n", file_size);
-        coded_file_size = 0xffff;
-    } else {
-        coded_file_size = file_size - RSO_HEADER_SIZE;
-    }
-
-    /* update file size */
-    avio_seek(pb, 2, SEEK_SET);
-    avio_wb16(pb, coded_file_size);
-    avio_seek(pb, file_size, SEEK_SET);
-
-    return 0;
-}
-
-AVOutputFormat ff_rso_muxer = {
-    .name           =   "rso",
-    .long_name      =   NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO"),
-    .extensions     =   "rso",
-    .audio_codec    =   AV_CODEC_ID_PCM_U8,
-    .video_codec    =   AV_CODEC_ID_NONE,
-    .write_header   =   rso_write_header,
-    .write_packet   =   rso_write_packet,
-    .write_trailer  =   rso_write_trailer,
-    .codec_tag      =   (const AVCodecTag* const []){ff_codec_rso_tags, 0},
-};
diff --git a/deps/libav/libavformat/rtmp.h b/deps/libav/libavformat/rtmp.h
deleted file mode 100644
index dc7ba5b..0000000
--- a/deps/libav/libavformat/rtmp.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * RTMP definitions
- * Copyright (c) 2009 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTMP_H
-#define AVFORMAT_RTMP_H
-
-#include "avformat.h"
-
-#define RTMP_DEFAULT_PORT 1935
-#define RTMPS_DEFAULT_PORT 443
-
-#define RTMP_HANDSHAKE_PACKET_SIZE 1536
-
-#define HMAC_IPAD_VAL 0x36
-#define HMAC_OPAD_VAL 0x5C
-
-/**
- * emulated Flash client version - 9.0.124.2 on Linux
- * @{
- */
-#define RTMP_CLIENT_PLATFORM "LNX"
-#define RTMP_CLIENT_VER1    9
-#define RTMP_CLIENT_VER2    0
-#define RTMP_CLIENT_VER3  124
-#define RTMP_CLIENT_VER4    2
-/** @} */ //version defines
-
-/**
- * Calculate HMAC-SHA2 digest for RTMP handshake packets.
- *
- * @param src    input buffer
- * @param len    input buffer length (should be 1536)
- * @param gap    offset in buffer where 32 bytes should not be taken into account
- *               when calculating digest (since it will be used to store that digest)
- * @param key    digest key
- * @param keylen digest key length
- * @param dst    buffer where calculated digest will be stored (32 bytes)
- */
-int ff_rtmp_calc_digest(const uint8_t *src, int len, int gap,
-                        const uint8_t *key, int keylen, uint8_t *dst);
-
-/**
- * Calculate digest position for RTMP handshake packets.
- *
- * @param buf input buffer (should be 1536 bytes)
- * @param off offset in buffer where to start calculating digest position
- * @param mod_val value used for computing modulo
- * @param add_val value added at the end (after computing modulo)
- */
-int ff_rtmp_calc_digest_pos(const uint8_t *buf, int off, int mod_val,
-                            int add_val);
-
-#endif /* AVFORMAT_RTMP_H */
diff --git a/deps/libav/libavformat/rtmpcrypt.c b/deps/libav/libavformat/rtmpcrypt.c
deleted file mode 100644
index dfdd029..0000000
--- a/deps/libav/libavformat/rtmpcrypt.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * RTMPE network protocol
- * Copyright (c) 2008-2009 Andrej Stepanchuk
- * Copyright (c) 2009-2010 Howard Chu
- * Copyright (c) 2012 Samuel Pitoiset
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RTMPE protocol
- */
-
-#include "libavutil/blowfish.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/opt.h"
-#include "libavutil/rc4.h"
-#include "libavutil/xtea.h"
-
-#include "internal.h"
-#include "rtmp.h"
-#include "rtmpdh.h"
-#include "rtmpcrypt.h"
-#include "url.h"
-
-/* protocol handler context */
-typedef struct RTMPEContext {
-    const AVClass *class;
-    URLContext   *stream;            ///< TCP stream
-    FF_DH        *dh;                ///< Diffie-Hellman context
-    struct AVRC4 key_in;             ///< RC4 key used for decrypt data
-    struct AVRC4 key_out;            ///< RC4 key used for encrypt data
-    int          handshaked;         ///< flag indicating when the handshake is performed
-    int          tunneling;          ///< use a HTTP connection (RTMPTE)
-} RTMPEContext;
-
-static const uint8_t rtmpe8_keys[16][16] = {
-    { 0xbf, 0xf0, 0x34, 0xb2, 0x11, 0xd9, 0x08, 0x1f,
-      0xcc, 0xdf, 0xb7, 0x95, 0x74, 0x8d, 0xe7, 0x32 },
-    { 0x08, 0x6a, 0x5e, 0xb6, 0x17, 0x43, 0x09, 0x0e,
-      0x6e, 0xf0, 0x5a, 0xb8, 0xfe, 0x5a, 0x39, 0xe2 },
-    { 0x7b, 0x10, 0x95, 0x6f, 0x76, 0xce, 0x05, 0x21,
-      0x23, 0x88, 0xa7, 0x3a, 0x44, 0x01, 0x49, 0xa1 },
-    { 0xa9, 0x43, 0xf3, 0x17, 0xeb, 0xf1, 0x1b, 0xb2,
-      0xa6, 0x91, 0xa5, 0xee, 0x17, 0xf3, 0x63, 0x39 },
-    { 0x7a, 0x30, 0xe0, 0x0a, 0xb5, 0x29, 0xe2, 0x2c,
-      0xa0, 0x87, 0xae, 0xa5, 0xc0, 0xcb, 0x79, 0xac },
-    { 0xbd, 0xce, 0x0c, 0x23, 0x2f, 0xeb, 0xde, 0xff,
-      0x1c, 0xfa, 0xae, 0x16, 0x11, 0x23, 0x23, 0x9d },
-    { 0x55, 0xdd, 0x3f, 0x7b, 0x77, 0xe7, 0xe6, 0x2e,
-      0x9b, 0xb8, 0xc4, 0x99, 0xc9, 0x48, 0x1e, 0xe4 },
-    { 0x40, 0x7b, 0xb6, 0xb4, 0x71, 0xe8, 0x91, 0x36,
-      0xa7, 0xae, 0xbf, 0x55, 0xca, 0x33, 0xb8, 0x39 },
-    { 0xfc, 0xf6, 0xbd, 0xc3, 0xb6, 0x3c, 0x36, 0x97,
-      0x7c, 0xe4, 0xf8, 0x25, 0x04, 0xd9, 0x59, 0xb2 },
-    { 0x28, 0xe0, 0x91, 0xfd, 0x41, 0x95, 0x4c, 0x4c,
-      0x7f, 0xb7, 0xdb, 0x00, 0xe3, 0xa0, 0x66, 0xf8 },
-    { 0x57, 0x84, 0x5b, 0x76, 0x4f, 0x25, 0x1b, 0x03,
-      0x46, 0xd4, 0x5b, 0xcd, 0xa2, 0xc3, 0x0d, 0x29 },
-    { 0x0a, 0xcc, 0xee, 0xf8, 0xda, 0x55, 0xb5, 0x46,
-      0x03, 0x47, 0x34, 0x52, 0x58, 0x63, 0x71, 0x3b },
-    { 0xb8, 0x20, 0x75, 0xdc, 0xa7, 0x5f, 0x1f, 0xee,
-      0xd8, 0x42, 0x68, 0xe8, 0xa7, 0x2a, 0x44, 0xcc },
-    { 0x07, 0xcf, 0x6e, 0x9e, 0xa1, 0x6d, 0x7b, 0x25,
-      0x9f, 0xa7, 0xae, 0x6c, 0xd9, 0x2f, 0x56, 0x29 },
-    { 0xfe, 0xb1, 0xea, 0xe4, 0x8c, 0x8c, 0x3c, 0xe1,
-      0x4e, 0x00, 0x64, 0xa7, 0x6a, 0x38, 0x7c, 0x2a },
-    { 0x89, 0x3a, 0x94, 0x27, 0xcc, 0x30, 0x13, 0xa2,
-      0xf1, 0x06, 0x38, 0x5b, 0xa8, 0x29, 0xf9, 0x27 }
-};
-
-static const uint8_t rtmpe9_keys[16][24] = {
-    { 0x79, 0x34, 0x77, 0x4c, 0x67, 0xd1, 0x38, 0x3a, 0xdf, 0xb3, 0x56, 0xbe,
-      0x8b, 0x7b, 0xd0, 0x24, 0x38, 0xe0, 0x73, 0x58, 0x41, 0x5d, 0x69, 0x67, },
-    { 0x46, 0xf6, 0xb4, 0xcc, 0x01, 0x93, 0xe3, 0xa1, 0x9e, 0x7d, 0x3c, 0x65,
-      0x55, 0x86, 0xfd, 0x09, 0x8f, 0xf7, 0xb3, 0xc4, 0x6f, 0x41, 0xca, 0x5c, },
-    { 0x1a, 0xe7, 0xe2, 0xf3, 0xf9, 0x14, 0x79, 0x94, 0xc0, 0xd3, 0x97, 0x43,
-      0x08, 0x7b, 0xb3, 0x84, 0x43, 0x2f, 0x9d, 0x84, 0x3f, 0x21, 0x01, 0x9b, },
-    { 0xd3, 0xe3, 0x54, 0xb0, 0xf7, 0x1d, 0xf6, 0x2b, 0x5a, 0x43, 0x4d, 0x04,
-      0x83, 0x64, 0x3e, 0x0d, 0x59, 0x2f, 0x61, 0xcb, 0xb1, 0x6a, 0x59, 0x0d, },
-    { 0xc8, 0xc1, 0xe9, 0xb8, 0x16, 0x56, 0x99, 0x21, 0x7b, 0x5b, 0x36, 0xb7,
-      0xb5, 0x9b, 0xdf, 0x06, 0x49, 0x2c, 0x97, 0xf5, 0x95, 0x48, 0x85, 0x7e, },
-    { 0xeb, 0xe5, 0xe6, 0x2e, 0xa4, 0xba, 0xd4, 0x2c, 0xf2, 0x16, 0xe0, 0x8f,
-      0x66, 0x23, 0xa9, 0x43, 0x41, 0xce, 0x38, 0x14, 0x84, 0x95, 0x00, 0x53, },
-    { 0x66, 0xdb, 0x90, 0xf0, 0x3b, 0x4f, 0xf5, 0x6f, 0xe4, 0x9c, 0x20, 0x89,
-      0x35, 0x5e, 0xd2, 0xb2, 0xc3, 0x9e, 0x9f, 0x7f, 0x63, 0xb2, 0x28, 0x81, },
-    { 0xbb, 0x20, 0xac, 0xed, 0x2a, 0x04, 0x6a, 0x19, 0x94, 0x98, 0x9b, 0xc8,
-      0xff, 0xcd, 0x93, 0xef, 0xc6, 0x0d, 0x56, 0xa7, 0xeb, 0x13, 0xd9, 0x30, },
-    { 0xbc, 0xf2, 0x43, 0x82, 0x09, 0x40, 0x8a, 0x87, 0x25, 0x43, 0x6d, 0xe6,
-      0xbb, 0xa4, 0xb9, 0x44, 0x58, 0x3f, 0x21, 0x7c, 0x99, 0xbb, 0x3f, 0x24, },
-    { 0xec, 0x1a, 0xaa, 0xcd, 0xce, 0xbd, 0x53, 0x11, 0xd2, 0xfb, 0x83, 0xb6,
-      0xc3, 0xba, 0xab, 0x4f, 0x62, 0x79, 0xe8, 0x65, 0xa9, 0x92, 0x28, 0x76, },
-    { 0xc6, 0x0c, 0x30, 0x03, 0x91, 0x18, 0x2d, 0x7b, 0x79, 0xda, 0xe1, 0xd5,
-      0x64, 0x77, 0x9a, 0x12, 0xc5, 0xb1, 0xd7, 0x91, 0x4f, 0x96, 0x4c, 0xa3, },
-    { 0xd7, 0x7c, 0x2a, 0xbf, 0xa6, 0xe7, 0x85, 0x7c, 0x45, 0xad, 0xff, 0x12,
-      0x94, 0xd8, 0xde, 0xa4, 0x5c, 0x3d, 0x79, 0xa4, 0x44, 0x02, 0x5d, 0x22, },
-    { 0x16, 0x19, 0x0d, 0x81, 0x6a, 0x4c, 0xc7, 0xf8, 0xb8, 0xf9, 0x4e, 0xcd,
-      0x2c, 0x9e, 0x90, 0x84, 0xb2, 0x08, 0x25, 0x60, 0xe1, 0x1e, 0xae, 0x18, },
-    { 0xe9, 0x7c, 0x58, 0x26, 0x1b, 0x51, 0x9e, 0x49, 0x82, 0x60, 0x61, 0xfc,
-      0xa0, 0xa0, 0x1b, 0xcd, 0xf5, 0x05, 0xd6, 0xa6, 0x6d, 0x07, 0x88, 0xa3, },
-    { 0x2b, 0x97, 0x11, 0x8b, 0xd9, 0x4e, 0xd9, 0xdf, 0x20, 0xe3, 0x9c, 0x10,
-      0xe6, 0xa1, 0x35, 0x21, 0x11, 0xf9, 0x13, 0x0d, 0x0b, 0x24, 0x65, 0xb2, },
-    { 0x53, 0x6a, 0x4c, 0x54, 0xac, 0x8b, 0x9b, 0xb8, 0x97, 0x29, 0xfc, 0x60,
-      0x2c, 0x5b, 0x3a, 0x85, 0x68, 0xb5, 0xaa, 0x6a, 0x44, 0xcd, 0x3f, 0xa7, },
-};
-
-int ff_rtmpe_gen_pub_key(URLContext *h, uint8_t *buf)
-{
-    RTMPEContext *rt = h->priv_data;
-    int offset, ret;
-
-    if (!(rt->dh = ff_dh_init(1024)))
-        return AVERROR(ENOMEM);
-
-    offset = ff_rtmp_calc_digest_pos(buf, 768, 632, 8);
-    if (offset < 0)
-        return offset;
-
-    /* generate a Diffie-Hellmann public key */
-    if ((ret = ff_dh_generate_public_key(rt->dh)) < 0)
-        return ret;
-
-    /* write the public key into the handshake buffer */
-    if ((ret = ff_dh_write_public_key(rt->dh, buf + offset, 128)) < 0)
-        return ret;
-
-    return 0;
-}
-
-int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata,
-                                const uint8_t *clientdata, int type)
-{
-    RTMPEContext *rt = h->priv_data;
-    uint8_t secret_key[128], digest[32];
-    int server_pos, client_pos;
-    int ret;
-
-    if (type) {
-        if ((server_pos = ff_rtmp_calc_digest_pos(serverdata, 1532, 632, 772)) < 0)
-            return server_pos;
-    } else {
-        if ((server_pos = ff_rtmp_calc_digest_pos(serverdata, 768, 632, 8)) < 0)
-            return server_pos;
-    }
-
-    if ((client_pos = ff_rtmp_calc_digest_pos(clientdata, 768, 632, 8)) < 0)
-        return client_pos;
-
-    /* compute the shared secret secret in order to compute RC4 keys */
-    if ((ret = ff_dh_compute_shared_secret_key(rt->dh, serverdata + server_pos,
-                                               128, secret_key)) < 0)
-        return ret;
-
-    /* set output key */
-    if ((ret = ff_rtmp_calc_digest(serverdata + server_pos, 128, 0, secret_key,
-                                   128, digest)) < 0)
-        return ret;
-    av_rc4_init(&rt->key_out, digest, 16 * 8, 1);
-
-    /* set input key */
-    if ((ret = ff_rtmp_calc_digest(clientdata + client_pos, 128, 0, secret_key,
-                                   128, digest)) < 0)
-        return ret;
-    av_rc4_init(&rt->key_in, digest, 16 * 8, 1);
-
-    return 0;
-}
-
-static void rtmpe8_sig(const uint8_t *in, uint8_t *out, int key_id)
-{
-    struct AVXTEA ctx;
-
-    av_xtea_init(&ctx, rtmpe8_keys[key_id]);
-    av_xtea_crypt(&ctx, out, in, 1, NULL, 0);
-}
-
-static void rtmpe9_sig(const uint8_t *in, uint8_t *out, int key_id)
-{
-    struct AVBlowfish ctx;
-    uint32_t xl, xr;
-
-    xl = AV_RL32(in);
-    xr = AV_RL32(in + 4);
-
-    av_blowfish_init(&ctx, rtmpe9_keys[key_id], 24);
-    av_blowfish_crypt_ecb(&ctx, &xl, &xr, 0);
-
-    AV_WL32(out, xl);
-    AV_WL32(out + 4, xr);
-}
-
-void ff_rtmpe_encrypt_sig(URLContext *h, uint8_t *sig, const uint8_t *digest,
-                          int type)
-{
-    int i;
-
-    for (i = 0; i < 32; i += 8) {
-        if (type == 8) {
-            /* RTMPE type 8 uses XTEA on the signature */
-            rtmpe8_sig(sig + i, sig + i, digest[i] % 15);
-        } else if (type == 9) {
-            /* RTMPE type 9 uses Blowfish on the signature */
-            rtmpe9_sig(sig + i, sig + i, digest[i] % 15);
-        }
-    }
-}
-
-int ff_rtmpe_update_keystream(URLContext *h)
-{
-    RTMPEContext *rt = h->priv_data;
-    char buf[RTMP_HANDSHAKE_PACKET_SIZE];
-
-    /* skip past 1536 bytes of the RC4 bytestream */
-    av_rc4_crypt(&rt->key_in, buf, NULL, sizeof(buf), NULL, 1);
-    av_rc4_crypt(&rt->key_out, buf, NULL, sizeof(buf), NULL, 1);
-
-    /* the next requests will be encrypted using RC4 keys */
-    rt->handshaked = 1;
-
-    return 0;
-}
-
-static int rtmpe_close(URLContext *h)
-{
-    RTMPEContext *rt = h->priv_data;
-
-    ff_dh_free(rt->dh);
-    ffurl_close(rt->stream);
-
-    return 0;
-}
-
-static int rtmpe_open(URLContext *h, const char *uri, int flags)
-{
-    RTMPEContext *rt = h->priv_data;
-    char host[256], url[1024];
-    int ret, port;
-
-    av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, NULL, 0, uri);
-
-    if (rt->tunneling) {
-        if (port < 0)
-            port = 80;
-        ff_url_join(url, sizeof(url), "ffrtmphttp", NULL, host, port, NULL);
-    } else {
-        if (port < 0)
-            port = 1935;
-        ff_url_join(url, sizeof(url), "tcp", NULL, host, port, NULL);
-    }
-
-    /* open the tcp or ffrtmphttp connection */
-    if ((ret = ffurl_open(&rt->stream, url, AVIO_FLAG_READ_WRITE,
-                          &h->interrupt_callback, NULL)) < 0) {
-        rtmpe_close(h);
-        return ret;
-    }
-
-    return 0;
-}
-
-static int rtmpe_read(URLContext *h, uint8_t *buf, int size)
-{
-    RTMPEContext *rt = h->priv_data;
-    int ret;
-
-    rt->stream->flags |= h->flags & AVIO_FLAG_NONBLOCK;
-    ret = ffurl_read(rt->stream, buf, size);
-    rt->stream->flags &= ~AVIO_FLAG_NONBLOCK;
-
-    if (ret < 0 && ret != AVERROR_EOF)
-        return ret;
-
-    if (rt->handshaked && ret > 0) {
-        /* decrypt data received by the server */
-        av_rc4_crypt(&rt->key_in, buf, buf, ret, NULL, 1);
-    }
-
-    return ret;
-}
-
-static int rtmpe_write(URLContext *h, const uint8_t *buf, int size)
-{
-    RTMPEContext *rt = h->priv_data;
-    int ret;
-
-    if (rt->handshaked) {
-        /* encrypt data to send to the server */
-        av_rc4_crypt(&rt->key_out, buf, buf, size, NULL, 1);
-    }
-
-    if ((ret = ffurl_write(rt->stream, buf, size)) < 0)
-        return ret;
-
-    return size;
-}
-
-#define OFFSET(x) offsetof(RTMPEContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-
-static const AVOption ffrtmpcrypt_options[] = {
-    {"ffrtmpcrypt_tunneling", "Use a HTTP tunneling connection (RTMPTE).", OFFSET(tunneling), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC},
-    { NULL },
-};
-
-static const AVClass ffrtmpcrypt_class = {
-    .class_name = "ffrtmpcrypt",
-    .item_name  = av_default_item_name,
-    .option     = ffrtmpcrypt_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-URLProtocol ff_ffrtmpcrypt_protocol = {
-    .name            = "ffrtmpcrypt",
-    .url_open        = rtmpe_open,
-    .url_read        = rtmpe_read,
-    .url_write       = rtmpe_write,
-    .url_close       = rtmpe_close,
-    .priv_data_size  = sizeof(RTMPEContext),
-    .flags           = URL_PROTOCOL_FLAG_NETWORK,
-    .priv_data_class = &ffrtmpcrypt_class,
-};
diff --git a/deps/libav/libavformat/rtmpcrypt.h b/deps/libav/libavformat/rtmpcrypt.h
deleted file mode 100644
index 2799433..0000000
--- a/deps/libav/libavformat/rtmpcrypt.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * RTMPE encryption utilities
- * Copyright (c) 2012 Samuel Pitoiset
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTMPCRYPT_H
-#define AVFORMAT_RTMPCRYPT_H
-
-#include <stdint.h>
-
-#include "url.h"
-
-/**
- * Initialize the Diffie-Hellmann context and generate the public key.
- *
- * @param h     an URLContext
- * @param buf   handshake data (1536 bytes)
- * @return zero on success, negative value otherwise
- */
-int ff_rtmpe_gen_pub_key(URLContext *h, uint8_t *buf);
-
-/**
- * Compute the shared secret key and initialize the RC4 encryption.
- *
- * @param h             an URLContext
- * @param serverdata    server data (1536 bytes)
- * @param clientdata    client data (1536 bytes)
- * @param type          the position of the server digest
- * @return zero on success, negative value otherwise
- */
-int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata,
-                                const uint8_t *clientdata, int type);
-
-/**
- * Encrypt the signature.
- *
- * @param h             an URLContext
- * @param signature     the signature to encrypt
- * @param digest        the digest used for finding the encryption key
- * @param type          type of encryption (8 for XTEA, 9 for Blowfish)
- */
-void ff_rtmpe_encrypt_sig(URLContext *h, uint8_t *signature,
-                          const uint8_t *digest, int type);
-
-/**
- * Update the keystream and set RC4 keys for encryption.
- *
- * @param h an URLContext
- * @return zero on success, negative value otherwise
- */
-int ff_rtmpe_update_keystream(URLContext *h);
-
-#endif /* AVFORMAT_RTMPCRYPT_H */
diff --git a/deps/libav/libavformat/rtmpdh.c b/deps/libav/libavformat/rtmpdh.c
deleted file mode 100644
index 38c2f3d..0000000
--- a/deps/libav/libavformat/rtmpdh.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * RTMP Diffie-Hellmann utilities
- * Copyright (c) 2009 Andrej Stepanchuk
- * Copyright (c) 2009-2010 Howard Chu
- * Copyright (c) 2012 Samuel Pitoiset
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RTMP Diffie-Hellmann utilities
- */
-
-#include "config.h"
-#include "rtmpdh.h"
-#include "libavutil/random_seed.h"
-
-#define P1024                                          \
-    "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \
-    "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \
-    "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \
-    "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \
-    "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381" \
-    "FFFFFFFFFFFFFFFF"
-
-#define Q1024                                          \
-    "7FFFFFFFFFFFFFFFE487ED5110B4611A62633145C06E0E68" \
-    "948127044533E63A0105DF531D89CD9128A5043CC71A026E" \
-    "F7CA8CD9E69D218D98158536F92F8A1BA7F09AB6B6A8E122" \
-    "F242DABB312F3F637A262174D31BF6B585FFAE5B7A035BF6" \
-    "F71C35FDAD44CFD2D74F9208BE258FF324943328F67329C0" \
-    "FFFFFFFFFFFFFFFF"
-
-#if CONFIG_NETTLE || CONFIG_GCRYPT
-#if CONFIG_NETTLE
-#define bn_new(bn)                      \
-    do {                                \
-        bn = av_malloc(sizeof(*bn));    \
-        if (bn)                         \
-            mpz_init2(bn, 1);           \
-    } while (0)
-#define bn_free(bn)     \
-    do {                \
-        mpz_clear(bn);  \
-        av_free(bn);    \
-    } while (0)
-#define bn_set_word(bn, w)          mpz_set_ui(bn, w)
-#define bn_cmp(a, b)                mpz_cmp(a, b)
-#define bn_copy(to, from)           mpz_set(to, from)
-#define bn_sub_word(bn, w)          mpz_sub_ui(bn, bn, w)
-#define bn_cmp_1(bn)                mpz_cmp_ui(bn, 1)
-#define bn_num_bytes(bn)            (mpz_sizeinbase(bn, 2) + 7) / 8
-#define bn_bn2bin(bn, buf, len)     nettle_mpz_get_str_256(len, buf, bn)
-#define bn_bin2bn(bn, buf, len)                     \
-    do {                                            \
-        bn_new(bn);                                 \
-        if (bn)                                     \
-            nettle_mpz_set_str_256_u(bn, len, buf); \
-    } while (0)
-#define bn_hex2bn(bn, buf, ret)                     \
-    do {                                            \
-        bn_new(bn);                                 \
-        if (bn)                                     \
-            ret = (mpz_set_str(bn, buf, 16) == 0);  \
-    } while (0)
-#define bn_modexp(bn, y, q, p)      mpz_powm(bn, y, q, p)
-#define bn_random(bn, num_bytes)                    \
-    do {                                            \
-        gmp_randstate_t rs;                         \
-        gmp_randinit_mt(rs);                        \
-        gmp_randseed_ui(rs, av_get_random_seed());  \
-        mpz_urandomb(bn, rs, num_bytes);            \
-        gmp_randclear(rs);                          \
-    } while (0)
-#elif CONFIG_GCRYPT
-#define bn_new(bn)                  bn = gcry_mpi_new(1)
-#define bn_free(bn)                 gcry_mpi_release(bn)
-#define bn_set_word(bn, w)          gcry_mpi_set_ui(bn, w)
-#define bn_cmp(a, b)                gcry_mpi_cmp(a, b)
-#define bn_copy(to, from)           gcry_mpi_set(to, from)
-#define bn_sub_word(bn, w)          gcry_mpi_sub_ui(bn, bn, w)
-#define bn_cmp_1(bn)                gcry_mpi_cmp_ui(bn, 1)
-#define bn_num_bytes(bn)            (gcry_mpi_get_nbits(bn) + 7) / 8
-#define bn_bn2bin(bn, buf, len)     gcry_mpi_print(GCRYMPI_FMT_USG, buf, len, NULL, bn)
-#define bn_bin2bn(bn, buf, len)     gcry_mpi_scan(&bn, GCRYMPI_FMT_USG, buf, len, NULL)
-#define bn_hex2bn(bn, buf, ret)     ret = (gcry_mpi_scan(&bn, GCRYMPI_FMT_HEX, buf, 0, 0) == 0)
-#define bn_modexp(bn, y, q, p)      gcry_mpi_powm(bn, y, q, p)
-#define bn_random(bn, num_bytes)    gcry_mpi_randomize(bn, num_bytes, GCRY_WEAK_RANDOM)
-#endif
-
-#define MAX_BYTES 18000
-
-#define dh_new()                    av_malloc(sizeof(FF_DH))
-
-static FFBigNum dh_generate_key(FF_DH *dh)
-{
-    int num_bytes;
-
-    num_bytes = bn_num_bytes(dh->p) - 1;
-    if (num_bytes <= 0 || num_bytes > MAX_BYTES)
-        return NULL;
-
-    bn_new(dh->priv_key);
-    if (!dh->priv_key)
-        return NULL;
-    bn_random(dh->priv_key, num_bytes);
-
-    bn_new(dh->pub_key);
-    if (!dh->pub_key) {
-        bn_free(dh->priv_key);
-        return NULL;
-    }
-
-    bn_modexp(dh->pub_key, dh->g, dh->priv_key, dh->p);
-
-    return dh->pub_key;
-}
-
-static int dh_compute_key(FF_DH *dh, FFBigNum pub_key_bn,
-                          uint32_t pub_key_len, uint8_t *secret_key)
-{
-    FFBigNum k;
-    int num_bytes;
-
-    num_bytes = bn_num_bytes(dh->p);
-    if (num_bytes <= 0 || num_bytes > MAX_BYTES)
-        return -1;
-
-    bn_new(k);
-    if (!k)
-        return -1;
-
-    bn_modexp(k, pub_key_bn, dh->priv_key, dh->p);
-    bn_bn2bin(k, secret_key, pub_key_len);
-    bn_free(k);
-
-    /* return the length of the shared secret key like DH_compute_key */
-    return pub_key_len;
-}
-
-void ff_dh_free(FF_DH *dh)
-{
-    bn_free(dh->p);
-    bn_free(dh->g);
-    bn_free(dh->pub_key);
-    bn_free(dh->priv_key);
-    av_free(dh);
-}
-#elif CONFIG_OPENSSL
-#define bn_new(bn)                  bn = BN_new()
-#define bn_free(bn)                 BN_free(bn)
-#define bn_set_word(bn, w)          BN_set_word(bn, w)
-#define bn_cmp(a, b)                BN_cmp(a, b)
-#define bn_copy(to, from)           BN_copy(to, from)
-#define bn_sub_word(bn, w)          BN_sub_word(bn, w)
-#define bn_cmp_1(bn)                BN_cmp(bn, BN_value_one())
-#define bn_num_bytes(bn)            BN_num_bytes(bn)
-#define bn_bn2bin(bn, buf, len)     BN_bn2bin(bn, buf)
-#define bn_bin2bn(bn, buf, len)     bn = BN_bin2bn(buf, len, 0)
-#define bn_hex2bn(bn, buf, ret)     ret = BN_hex2bn(&bn, buf)
-#define bn_modexp(bn, y, q, p)               \
-    do {                                     \
-        BN_CTX *ctx = BN_CTX_new();          \
-        if (!ctx)                            \
-            return AVERROR(ENOMEM);          \
-        if (!BN_mod_exp(bn, y, q, p, ctx)) { \
-            BN_CTX_free(ctx);                \
-            return AVERROR(EINVAL);          \
-        }                                    \
-        BN_CTX_free(ctx);                    \
-    } while (0)
-
-#define dh_new()                                DH_new()
-#define dh_generate_key(dh)                     DH_generate_key(dh)
-#define dh_compute_key(dh, pub, len, secret)    DH_compute_key(secret, pub, dh)
-
-void ff_dh_free(FF_DH *dh)
-{
-    DH_free(dh);
-}
-#endif
-
-static int dh_is_valid_public_key(FFBigNum y, FFBigNum p, FFBigNum q)
-{
-    FFBigNum bn = NULL;
-    int ret = AVERROR(EINVAL);
-
-    bn_new(bn);
-    if (!bn)
-        return AVERROR(ENOMEM);
-
-    /* y must lie in [2, p - 1] */
-    bn_set_word(bn, 1);
-    if (!bn_cmp(y, bn))
-        goto fail;
-
-    /* bn = p - 2 */
-    bn_copy(bn, p);
-    bn_sub_word(bn, 1);
-    if (!bn_cmp(y, bn))
-        goto fail;
-
-    /* Verify with Sophie-Germain prime
-     *
-     * This is a nice test to make sure the public key position is calculated
-     * correctly. This test will fail in about 50% of the cases if applied to
-     * random data.
-     */
-    /* y must fulfill y^q mod p = 1 */
-    bn_modexp(bn, y, q, p);
-
-    if (bn_cmp_1(bn))
-        goto fail;
-
-    ret = 0;
-fail:
-    bn_free(bn);
-
-    return ret;
-}
-
-av_cold FF_DH *ff_dh_init(int key_len)
-{
-    FF_DH *dh;
-    int ret;
-
-    if (!(dh = dh_new()))
-        return NULL;
-
-    bn_new(dh->g);
-    if (!dh->g)
-        goto fail;
-
-    bn_hex2bn(dh->p, P1024, ret);
-    if (!ret)
-        goto fail;
-
-    bn_set_word(dh->g, 2);
-    dh->length = key_len;
-
-    return dh;
-
-fail:
-    ff_dh_free(dh);
-
-    return NULL;
-}
-
-int ff_dh_generate_public_key(FF_DH *dh)
-{
-    int ret = 0;
-
-    while (!ret) {
-        FFBigNum q1 = NULL;
-
-        if (!dh_generate_key(dh))
-            return AVERROR(EINVAL);
-
-        bn_hex2bn(q1, Q1024, ret);
-        if (!ret)
-            return AVERROR(ENOMEM);
-
-        ret = dh_is_valid_public_key(dh->pub_key, dh->p, q1);
-        bn_free(q1);
-
-        if (!ret) {
-            /* the public key is valid */
-            break;
-        }
-    }
-
-    return ret;
-}
-
-int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len)
-{
-    int len;
-
-    /* compute the length of the public key */
-    len = bn_num_bytes(dh->pub_key);
-    if (len <= 0 || len > pub_key_len)
-        return AVERROR(EINVAL);
-
-    /* convert the public key value into big-endian form */
-    memset(pub_key, 0, pub_key_len);
-    bn_bn2bin(dh->pub_key, pub_key + pub_key_len - len, len);
-
-    return 0;
-}
-
-int ff_dh_compute_shared_secret_key(FF_DH *dh, const uint8_t *pub_key,
-                                    int pub_key_len, uint8_t *secret_key)
-{
-    FFBigNum q1 = NULL, pub_key_bn = NULL;
-    int ret;
-
-    /* convert the big-endian form of the public key into a bignum */
-    bn_bin2bn(pub_key_bn, pub_key, pub_key_len);
-    if (!pub_key_bn)
-        return AVERROR(ENOMEM);
-
-    /* convert the string containing a hexadecimal number into a bignum */
-    bn_hex2bn(q1, Q1024, ret);
-    if (!ret) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    /* when the public key is valid we have to compute the shared secret key */
-    if ((ret = dh_is_valid_public_key(pub_key_bn, dh->p, q1)) < 0) {
-        goto fail;
-    } else if ((ret = dh_compute_key(dh, pub_key_bn, pub_key_len,
-                                     secret_key)) < 0) {
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-
-fail:
-    bn_free(pub_key_bn);
-    bn_free(q1);
-
-    return ret;
-}
-
diff --git a/deps/libav/libavformat/rtmpdh.h b/deps/libav/libavformat/rtmpdh.h
deleted file mode 100644
index 5de8bde..0000000
--- a/deps/libav/libavformat/rtmpdh.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * RTMP Diffie-Hellmann utilities
- * Copyright (c) 2012 Samuel Pitoiset
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTMPDH_H
-#define AVFORMAT_RTMPDH_H
-
-#include "avformat.h"
-#include "config.h"
-
-#if CONFIG_NETTLE || CONFIG_GCRYPT
-#if CONFIG_NETTLE
-#include <gmp.h>
-#include <nettle/bignum.h>
-
-typedef mpz_ptr FFBigNum;
-#elif CONFIG_GCRYPT
-#include <gcrypt.h>
-
-typedef gcry_mpi_t FFBigNum;
-#endif
-
-typedef struct FF_DH {
-  FFBigNum p;
-  FFBigNum g;
-  FFBigNum pub_key;
-  FFBigNum priv_key;
-  long length;
-} FF_DH;
-
-#elif CONFIG_OPENSSL
-#include <openssl/bn.h>
-#include <openssl/dh.h>
-
-typedef BIGNUM *FFBigNum;
-typedef DH FF_DH;
-#endif
-
-/**
- * Initialize a Diffie-Hellmann context.
- *
- * @param key_len length of the key
- * @return a new Diffie-Hellmann context on success, NULL otherwise
- */
-FF_DH *ff_dh_init(int key_len);
-
-/**
- * Free a Diffie-Hellmann context.
- *
- * @param dh a Diffie-Hellmann context to free
- */
-void ff_dh_free(FF_DH *dh);
-
-/**
- * Generate a public key.
- *
- * @param dh a Diffie-Hellmann context
- * @return zero on success, negative value otherwise
- */
-int ff_dh_generate_public_key(FF_DH *dh);
-
-/**
- * Write the public key into the given buffer.
- *
- * @param dh            a Diffie-Hellmann context, containing the public key to write
- * @param pub_key       the buffer where the public key is written
- * @param pub_key_len   the length of the buffer
- * @return zero on success, negative value otherwise
- */
-int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len);
-
-/**
- * Compute the shared secret key from the private FF_DH value and the
- * other party's public value.
- *
- * @param dh            a Diffie-Hellmann context, containing the private key
- * @param pub_key       the buffer containing the public key
- * @param pub_key_len   the length of the buffer
- * @param secret_key    the buffer where the secret key is written
- * @return length of the shared secret key on success, negative value otherwise
- */
-int ff_dh_compute_shared_secret_key(FF_DH *dh, const uint8_t *pub_key,
-                                    int pub_key_len, uint8_t *secret_key);
-
-#endif /* AVFORMAT_RTMPDH_H */
diff --git a/deps/libav/libavformat/rtmphttp.c b/deps/libav/libavformat/rtmphttp.c
deleted file mode 100644
index 34c68fb..0000000
--- a/deps/libav/libavformat/rtmphttp.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * RTMP HTTP network protocol
- * Copyright (c) 2012 Samuel Pitoiset
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RTMP HTTP protocol
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/opt.h"
-#include "libavutil/time.h"
-#include "internal.h"
-#include "http.h"
-#include "rtmp.h"
-
-#define RTMPT_DEFAULT_PORT 80
-#define RTMPTS_DEFAULT_PORT RTMPS_DEFAULT_PORT
-
-/* protocol handler context */
-typedef struct RTMP_HTTPContext {
-    const AVClass *class;
-    URLContext   *stream;           ///< HTTP stream
-    char         host[256];         ///< hostname of the server
-    int          port;              ///< port to connect (default is 80)
-    char         client_id[64];     ///< client ID used for all requests except the first one
-    int          seq;               ///< sequence ID used for all requests
-    uint8_t      *out_data;         ///< output buffer
-    int          out_size;          ///< current output buffer size
-    int          out_capacity;      ///< current output buffer capacity
-    int          initialized;       ///< flag indicating when the http context is initialized
-    int          finishing;         ///< flag indicating when the client closes the connection
-    int          nb_bytes_read;     ///< number of bytes read since the last request
-    int          tls;               ///< use Transport Security Layer (RTMPTS)
-} RTMP_HTTPContext;
-
-static int rtmp_http_send_cmd(URLContext *h, const char *cmd)
-{
-    RTMP_HTTPContext *rt = h->priv_data;
-    char uri[2048];
-    uint8_t c;
-    int ret;
-
-    ff_url_join(uri, sizeof(uri), "http", NULL, rt->host, rt->port,
-                "/%s/%s/%d", cmd, rt->client_id, rt->seq++);
-
-    av_opt_set_bin(rt->stream->priv_data, "post_data", rt->out_data,
-                   rt->out_size, 0);
-
-    /* send a new request to the server */
-    if ((ret = ff_http_do_new_request(rt->stream, uri)) < 0)
-        return ret;
-
-    /* re-init output buffer */
-    rt->out_size = 0;
-
-    /* read the first byte which contains the polling interval */
-    if ((ret = ffurl_read(rt->stream, &c, 1)) < 0)
-        return ret;
-
-    /* re-init the number of bytes read */
-    rt->nb_bytes_read = 0;
-
-    return ret;
-}
-
-static int rtmp_http_write(URLContext *h, const uint8_t *buf, int size)
-{
-    RTMP_HTTPContext *rt = h->priv_data;
-
-    if (rt->out_size + size > rt->out_capacity) {
-        int err;
-        rt->out_capacity = (rt->out_size + size) * 2;
-        if ((err = av_reallocp(&rt->out_data, rt->out_capacity)) < 0) {
-            rt->out_size = 0;
-            rt->out_capacity = 0;
-            return err;
-        }
-    }
-
-    memcpy(rt->out_data + rt->out_size, buf, size);
-    rt->out_size += size;
-
-    return size;
-}
-
-static int rtmp_http_read(URLContext *h, uint8_t *buf, int size)
-{
-    RTMP_HTTPContext *rt = h->priv_data;
-    int ret, off = 0;
-
-    /* try to read at least 1 byte of data */
-    do {
-        ret = ffurl_read(rt->stream, buf + off, size);
-        if (ret < 0 && ret != AVERROR_EOF)
-            return ret;
-
-        if (!ret || ret == AVERROR_EOF) {
-            if (rt->finishing) {
-                /* Do not send new requests when the client wants to
-                 * close the connection. */
-                return AVERROR(EAGAIN);
-            }
-
-            /* When the client has reached end of file for the last request,
-             * we have to send a new request if we have buffered data.
-             * Otherwise, we have to send an idle POST. */
-            if (rt->out_size > 0) {
-                if ((ret = rtmp_http_send_cmd(h, "send")) < 0)
-                    return ret;
-            } else {
-                if (rt->nb_bytes_read == 0) {
-                    /* Wait 50ms before retrying to read a server reply in
-                     * order to reduce the number of idle requets. */
-                    av_usleep(50000);
-                }
-
-                if ((ret = rtmp_http_write(h, "", 1)) < 0)
-                    return ret;
-
-                if ((ret = rtmp_http_send_cmd(h, "idle")) < 0)
-                    return ret;
-            }
-
-            if (h->flags & AVIO_FLAG_NONBLOCK) {
-                /* no incoming data to handle in nonblocking mode */
-                return AVERROR(EAGAIN);
-            }
-        } else {
-            off  += ret;
-            size -= ret;
-            rt->nb_bytes_read += ret;
-        }
-    } while (off <= 0);
-
-    return off;
-}
-
-static int rtmp_http_close(URLContext *h)
-{
-    RTMP_HTTPContext *rt = h->priv_data;
-    uint8_t tmp_buf[2048];
-    int ret = 0;
-
-    if (rt->initialized) {
-        /* client wants to close the connection */
-        rt->finishing = 1;
-
-        do {
-            ret = rtmp_http_read(h, tmp_buf, sizeof(tmp_buf));
-        } while (ret > 0);
-
-        /* re-init output buffer before sending the close command */
-        rt->out_size = 0;
-
-        if ((ret = rtmp_http_write(h, "", 1)) == 1)
-            ret = rtmp_http_send_cmd(h, "close");
-    }
-
-    av_freep(&rt->out_data);
-    ffurl_close(rt->stream);
-
-    return ret;
-}
-
-static int rtmp_http_open(URLContext *h, const char *uri, int flags)
-{
-    RTMP_HTTPContext *rt = h->priv_data;
-    char headers[1024], url[1024];
-    int ret, off = 0;
-
-    av_url_split(NULL, 0, NULL, 0, rt->host, sizeof(rt->host), &rt->port,
-                 NULL, 0, uri);
-
-    /* This is the first request that is sent to the server in order to
-     * register a client on the server and start a new session. The server
-     * replies with a unique id (usually a number) that is used by the client
-     * for all future requests.
-     * Note: the reply doesn't contain a value for the polling interval.
-     * A successful connect resets the consecutive index that is used
-     * in the URLs. */
-    if (rt->tls) {
-        if (rt->port < 0)
-            rt->port = RTMPTS_DEFAULT_PORT;
-        ff_url_join(url, sizeof(url), "https", NULL, rt->host, rt->port, "/open/1");
-    } else {
-        if (rt->port < 0)
-            rt->port = RTMPT_DEFAULT_PORT;
-        ff_url_join(url, sizeof(url), "http", NULL, rt->host, rt->port, "/open/1");
-    }
-
-    /* alloc the http context */
-    if ((ret = ffurl_alloc(&rt->stream, url, AVIO_FLAG_READ_WRITE, NULL)) < 0)
-        goto fail;
-
-    /* set options */
-    snprintf(headers, sizeof(headers),
-             "Cache-Control: no-cache\r\n"
-             "Content-type: application/x-fcs\r\n"
-             "User-Agent: Shockwave Flash\r\n");
-    av_opt_set(rt->stream->priv_data, "headers", headers, 0);
-    av_opt_set(rt->stream->priv_data, "multiple_requests", "1", 0);
-    av_opt_set_bin(rt->stream->priv_data, "post_data", "", 1, 0);
-
-    /* open the http context */
-    if ((ret = ffurl_connect(rt->stream, NULL)) < 0)
-        goto fail;
-
-    /* read the server reply which contains a unique ID */
-    for (;;) {
-        ret = ffurl_read(rt->stream, rt->client_id + off, sizeof(rt->client_id) - off);
-        if (!ret || ret == AVERROR_EOF)
-            break;
-        if (ret < 0)
-            goto fail;
-        off += ret;
-        if (off == sizeof(rt->client_id)) {
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-    }
-    while (off > 0 && av_isspace(rt->client_id[off - 1]))
-        off--;
-    rt->client_id[off] = '\0';
-
-    /* http context is now initialized */
-    rt->initialized = 1;
-    return 0;
-
-fail:
-    rtmp_http_close(h);
-    return ret;
-}
-
-#define OFFSET(x) offsetof(RTMP_HTTPContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-
-static const AVOption ffrtmphttp_options[] = {
-    {"ffrtmphttp_tls", "Use a HTTPS tunneling connection (RTMPTS).", OFFSET(tls), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC},
-    { NULL },
-};
-
-static const AVClass ffrtmphttp_class = {
-    .class_name = "ffrtmphttp",
-    .item_name  = av_default_item_name,
-    .option     = ffrtmphttp_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-URLProtocol ff_ffrtmphttp_protocol = {
-    .name           = "ffrtmphttp",
-    .url_open       = rtmp_http_open,
-    .url_read       = rtmp_http_read,
-    .url_write      = rtmp_http_write,
-    .url_close      = rtmp_http_close,
-    .priv_data_size = sizeof(RTMP_HTTPContext),
-    .flags          = URL_PROTOCOL_FLAG_NETWORK,
-    .priv_data_class= &ffrtmphttp_class,
-};
diff --git a/deps/libav/libavformat/rtmppkt.c b/deps/libav/libavformat/rtmppkt.c
deleted file mode 100644
index 81621b1..0000000
--- a/deps/libav/libavformat/rtmppkt.c
+++ /dev/null
@@ -1,645 +0,0 @@
-/*
- * RTMP input format
- * Copyright (c) 2009 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/bytestream.h"
-#include "libavutil/avstring.h"
-#include "libavutil/intfloat.h"
-#include "avformat.h"
-
-#include "rtmppkt.h"
-#include "flv.h"
-#include "url.h"
-
-void ff_amf_write_bool(uint8_t **dst, int val)
-{
-    bytestream_put_byte(dst, AMF_DATA_TYPE_BOOL);
-    bytestream_put_byte(dst, val);
-}
-
-void ff_amf_write_number(uint8_t **dst, double val)
-{
-    bytestream_put_byte(dst, AMF_DATA_TYPE_NUMBER);
-    bytestream_put_be64(dst, av_double2int(val));
-}
-
-void ff_amf_write_string(uint8_t **dst, const char *str)
-{
-    bytestream_put_byte(dst, AMF_DATA_TYPE_STRING);
-    bytestream_put_be16(dst, strlen(str));
-    bytestream_put_buffer(dst, str, strlen(str));
-}
-
-void ff_amf_write_string2(uint8_t **dst, const char *str1, const char *str2)
-{
-    int len1 = 0, len2 = 0;
-    if (str1)
-        len1 = strlen(str1);
-    if (str2)
-        len2 = strlen(str2);
-    bytestream_put_byte(dst, AMF_DATA_TYPE_STRING);
-    bytestream_put_be16(dst, len1 + len2);
-    bytestream_put_buffer(dst, str1, len1);
-    bytestream_put_buffer(dst, str2, len2);
-}
-
-void ff_amf_write_null(uint8_t **dst)
-{
-    bytestream_put_byte(dst, AMF_DATA_TYPE_NULL);
-}
-
-void ff_amf_write_object_start(uint8_t **dst)
-{
-    bytestream_put_byte(dst, AMF_DATA_TYPE_OBJECT);
-}
-
-void ff_amf_write_field_name(uint8_t **dst, const char *str)
-{
-    bytestream_put_be16(dst, strlen(str));
-    bytestream_put_buffer(dst, str, strlen(str));
-}
-
-void ff_amf_write_object_end(uint8_t **dst)
-{
-    /* first two bytes are field name length = 0,
-     * AMF object should end with it and end marker
-     */
-    bytestream_put_be24(dst, AMF_DATA_TYPE_OBJECT_END);
-}
-
-int ff_amf_read_bool(GetByteContext *bc, int *val)
-{
-    if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_BOOL)
-        return AVERROR_INVALIDDATA;
-    *val = bytestream2_get_byte(bc);
-    return 0;
-}
-
-int ff_amf_read_number(GetByteContext *bc, double *val)
-{
-    uint64_t read;
-    if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_NUMBER)
-        return AVERROR_INVALIDDATA;
-    read = bytestream2_get_be64(bc);
-    *val = av_int2double(read);
-    return 0;
-}
-
-int ff_amf_read_string(GetByteContext *bc, uint8_t *str,
-                       int strsize, int *length)
-{
-    int stringlen = 0;
-    int readsize;
-    if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_STRING)
-        return AVERROR_INVALIDDATA;
-    stringlen = bytestream2_get_be16(bc);
-    if (stringlen + 1 > strsize)
-        return AVERROR(EINVAL);
-    readsize = bytestream2_get_buffer(bc, str, stringlen);
-    if (readsize != stringlen) {
-        av_log(NULL, AV_LOG_WARNING,
-               "Unable to read as many bytes as AMF string signaled\n");
-    }
-    str[readsize] = '\0';
-    *length = FFMIN(stringlen, readsize);
-    return 0;
-}
-
-int ff_amf_read_null(GetByteContext *bc)
-{
-    if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_NULL)
-        return AVERROR_INVALIDDATA;
-    return 0;
-}
-
-int ff_rtmp_check_alloc_array(RTMPPacket **prev_pkt, int *nb_prev_pkt,
-                              int channel)
-{
-    int nb_alloc;
-    RTMPPacket *ptr;
-    if (channel < *nb_prev_pkt)
-        return 0;
-
-    nb_alloc = channel + 16;
-    // This can't use the av_reallocp family of functions, since we
-    // would need to free each element in the array before the array
-    // itself is freed.
-    ptr = av_realloc_array(*prev_pkt, nb_alloc, sizeof(**prev_pkt));
-    if (!ptr)
-        return AVERROR(ENOMEM);
-    memset(ptr + *nb_prev_pkt, 0, (nb_alloc - *nb_prev_pkt) * sizeof(*ptr));
-    *prev_pkt = ptr;
-    *nb_prev_pkt = nb_alloc;
-    return 0;
-}
-
-int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p,
-                        int chunk_size, RTMPPacket **prev_pkt, int *nb_prev_pkt)
-{
-    uint8_t hdr;
-
-    if (ffurl_read(h, &hdr, 1) != 1)
-        return AVERROR(EIO);
-
-    return ff_rtmp_packet_read_internal(h, p, chunk_size, prev_pkt,
-                                        nb_prev_pkt, hdr);
-}
-
-static int rtmp_packet_read_one_chunk(URLContext *h, RTMPPacket *p,
-                                      int chunk_size, RTMPPacket **prev_pkt_ptr,
-                                      int *nb_prev_pkt, uint8_t hdr)
-{
-
-    uint8_t buf[16];
-    int channel_id, timestamp, size;
-    uint32_t extra = 0;
-    enum RTMPPacketType type;
-    int written = 0;
-    int ret, toread;
-    RTMPPacket *prev_pkt;
-
-    written++;
-    channel_id = hdr & 0x3F;
-
-    if (channel_id < 2) { //special case for channel number >= 64
-        buf[1] = 0;
-        if (ffurl_read_complete(h, buf, channel_id + 1) != channel_id + 1)
-            return AVERROR(EIO);
-        written += channel_id + 1;
-        channel_id = AV_RL16(buf) + 64;
-    }
-    if ((ret = ff_rtmp_check_alloc_array(prev_pkt_ptr, nb_prev_pkt,
-                                         channel_id)) < 0)
-        return ret;
-    prev_pkt = *prev_pkt_ptr;
-    size  = prev_pkt[channel_id].size;
-    type  = prev_pkt[channel_id].type;
-    extra = prev_pkt[channel_id].extra;
-
-    hdr >>= 6;
-    if (hdr == RTMP_PS_ONEBYTE) {
-        timestamp = prev_pkt[channel_id].ts_delta;
-    } else {
-        if (ffurl_read_complete(h, buf, 3) != 3)
-            return AVERROR(EIO);
-        written += 3;
-        timestamp = AV_RB24(buf);
-        if (hdr != RTMP_PS_FOURBYTES) {
-            if (ffurl_read_complete(h, buf, 3) != 3)
-                return AVERROR(EIO);
-            written += 3;
-            size = AV_RB24(buf);
-            if (ffurl_read_complete(h, buf, 1) != 1)
-                return AVERROR(EIO);
-            written++;
-            type = buf[0];
-            if (hdr == RTMP_PS_TWELVEBYTES) {
-                if (ffurl_read_complete(h, buf, 4) != 4)
-                    return AVERROR(EIO);
-                written += 4;
-                extra = AV_RL32(buf);
-            }
-        }
-        if (timestamp == 0xFFFFFF) {
-            if (ffurl_read_complete(h, buf, 4) != 4)
-                return AVERROR(EIO);
-            timestamp = AV_RB32(buf);
-        }
-    }
-    if (hdr != RTMP_PS_TWELVEBYTES)
-        timestamp += prev_pkt[channel_id].timestamp;
-
-    if (!prev_pkt[channel_id].read) {
-        if ((ret = ff_rtmp_packet_create(p, channel_id, type, timestamp,
-                                         size)) < 0)
-            return ret;
-        p->read = written;
-        p->offset = 0;
-        prev_pkt[channel_id].ts_delta   = timestamp -
-                                          prev_pkt[channel_id].timestamp;
-        prev_pkt[channel_id].timestamp  = timestamp;
-    } else {
-        // previous packet in this channel hasn't completed reading
-        RTMPPacket *prev = &prev_pkt[channel_id];
-        p->data          = prev->data;
-        p->size          = prev->size;
-        p->channel_id    = prev->channel_id;
-        p->type          = prev->type;
-        p->ts_delta      = prev->ts_delta;
-        p->extra         = prev->extra;
-        p->offset        = prev->offset;
-        p->read          = prev->read + written;
-        p->timestamp     = prev->timestamp;
-        prev->data       = NULL;
-    }
-    p->extra = extra;
-    // save history
-    prev_pkt[channel_id].channel_id = channel_id;
-    prev_pkt[channel_id].type       = type;
-    prev_pkt[channel_id].size       = size;
-    prev_pkt[channel_id].extra      = extra;
-    size = size - p->offset;
-
-    toread = FFMIN(size, chunk_size);
-    if (ffurl_read_complete(h, p->data + p->offset, toread) != toread) {
-        ff_rtmp_packet_destroy(p);
-        return AVERROR(EIO);
-    }
-    size      -= toread;
-    p->read   += toread;
-    p->offset += toread;
-
-    if (size > 0) {
-       RTMPPacket *prev = &prev_pkt[channel_id];
-       prev->data = p->data;
-       prev->read = p->read;
-       prev->offset = p->offset;
-       return AVERROR(EAGAIN);
-    }
-
-    prev_pkt[channel_id].read = 0; // read complete; reset if needed
-    return p->read;
-}
-
-int ff_rtmp_packet_read_internal(URLContext *h, RTMPPacket *p, int chunk_size,
-                                 RTMPPacket **prev_pkt, int *nb_prev_pkt,
-                                 uint8_t hdr)
-{
-    while (1) {
-        int ret = rtmp_packet_read_one_chunk(h, p, chunk_size, prev_pkt,
-                                             nb_prev_pkt, hdr);
-        if (ret > 0 || ret != AVERROR(EAGAIN))
-            return ret;
-
-        if (ffurl_read(h, &hdr, 1) != 1)
-            return AVERROR(EIO);
-    }
-}
-
-int ff_rtmp_packet_write(URLContext *h, RTMPPacket *pkt,
-                         int chunk_size, RTMPPacket **prev_pkt_ptr,
-                         int *nb_prev_pkt)
-{
-    uint8_t pkt_hdr[16], *p = pkt_hdr;
-    int mode = RTMP_PS_TWELVEBYTES;
-    int off = 0;
-    int written = 0;
-    int ret;
-    RTMPPacket *prev_pkt;
-
-    if ((ret = ff_rtmp_check_alloc_array(prev_pkt_ptr, nb_prev_pkt,
-                                         pkt->channel_id)) < 0)
-        return ret;
-    prev_pkt = *prev_pkt_ptr;
-
-    pkt->ts_delta = pkt->timestamp - prev_pkt[pkt->channel_id].timestamp;
-
-    //if channel_id = 0, this is first presentation of prev_pkt, send full hdr.
-    if (prev_pkt[pkt->channel_id].channel_id &&
-        pkt->extra == prev_pkt[pkt->channel_id].extra &&
-        pkt->timestamp >= prev_pkt[pkt->channel_id].timestamp) {
-        if (pkt->type == prev_pkt[pkt->channel_id].type &&
-            pkt->size == prev_pkt[pkt->channel_id].size) {
-            mode = RTMP_PS_FOURBYTES;
-            if (pkt->ts_delta == prev_pkt[pkt->channel_id].ts_delta)
-                mode = RTMP_PS_ONEBYTE;
-        } else {
-            mode = RTMP_PS_EIGHTBYTES;
-        }
-    }
-
-    if (pkt->channel_id < 64) {
-        bytestream_put_byte(&p, pkt->channel_id | (mode << 6));
-    } else if (pkt->channel_id < 64 + 256) {
-        bytestream_put_byte(&p, 0               | (mode << 6));
-        bytestream_put_byte(&p, pkt->channel_id - 64);
-    } else {
-        bytestream_put_byte(&p, 1               | (mode << 6));
-        bytestream_put_le16(&p, pkt->channel_id - 64);
-    }
-    if (mode != RTMP_PS_ONEBYTE) {
-        uint32_t timestamp = pkt->timestamp;
-        if (mode != RTMP_PS_TWELVEBYTES)
-            timestamp = pkt->ts_delta;
-        bytestream_put_be24(&p, timestamp >= 0xFFFFFF ? 0xFFFFFF : timestamp);
-        if (mode != RTMP_PS_FOURBYTES) {
-            bytestream_put_be24(&p, pkt->size);
-            bytestream_put_byte(&p, pkt->type);
-            if (mode == RTMP_PS_TWELVEBYTES)
-                bytestream_put_le32(&p, pkt->extra);
-        }
-        if (timestamp >= 0xFFFFFF)
-            bytestream_put_be32(&p, timestamp);
-    }
-    // save history
-    prev_pkt[pkt->channel_id].channel_id = pkt->channel_id;
-    prev_pkt[pkt->channel_id].type       = pkt->type;
-    prev_pkt[pkt->channel_id].size       = pkt->size;
-    prev_pkt[pkt->channel_id].timestamp  = pkt->timestamp;
-    if (mode != RTMP_PS_TWELVEBYTES) {
-        prev_pkt[pkt->channel_id].ts_delta   = pkt->ts_delta;
-    } else {
-        prev_pkt[pkt->channel_id].ts_delta   = pkt->timestamp;
-    }
-    prev_pkt[pkt->channel_id].extra      = pkt->extra;
-
-    if ((ret = ffurl_write(h, pkt_hdr, p - pkt_hdr)) < 0)
-        return ret;
-    written = p - pkt_hdr + pkt->size;
-    while (off < pkt->size) {
-        int towrite = FFMIN(chunk_size, pkt->size - off);
-        if ((ret = ffurl_write(h, pkt->data + off, towrite)) < 0)
-            return ret;
-        off += towrite;
-        if (off < pkt->size) {
-            uint8_t marker = 0xC0 | pkt->channel_id;
-            if ((ret = ffurl_write(h, &marker, 1)) < 0)
-                return ret;
-            written++;
-        }
-    }
-    return written;
-}
-
-int ff_rtmp_packet_create(RTMPPacket *pkt, int channel_id, RTMPPacketType type,
-                          int timestamp, int size)
-{
-    if (size) {
-        pkt->data = av_malloc(size);
-        if (!pkt->data)
-            return AVERROR(ENOMEM);
-    }
-    pkt->size       = size;
-    pkt->channel_id = channel_id;
-    pkt->type       = type;
-    pkt->timestamp  = timestamp;
-    pkt->extra      = 0;
-    pkt->ts_delta   = 0;
-
-    return 0;
-}
-
-void ff_rtmp_packet_destroy(RTMPPacket *pkt)
-{
-    if (!pkt)
-        return;
-    av_freep(&pkt->data);
-    pkt->size = 0;
-}
-
-int ff_amf_tag_size(const uint8_t *data, const uint8_t *data_end)
-{
-    const uint8_t *base = data;
-    AMFDataType type;
-    unsigned nb   = -1;
-    int parse_key = 1;
-
-    if (data >= data_end)
-        return -1;
-    switch ((type = *data++)) {
-    case AMF_DATA_TYPE_NUMBER:      return 9;
-    case AMF_DATA_TYPE_BOOL:        return 2;
-    case AMF_DATA_TYPE_STRING:      return 3 + AV_RB16(data);
-    case AMF_DATA_TYPE_LONG_STRING: return 5 + AV_RB32(data);
-    case AMF_DATA_TYPE_NULL:        return 1;
-    case AMF_DATA_TYPE_ARRAY:
-        parse_key = 0;
-    case AMF_DATA_TYPE_MIXEDARRAY:
-        nb = bytestream_get_be32(&data);
-    case AMF_DATA_TYPE_OBJECT:
-        while (nb-- > 0 || type != AMF_DATA_TYPE_ARRAY) {
-            int t;
-            if (parse_key) {
-                int size = bytestream_get_be16(&data);
-                if (!size) {
-                    data++;
-                    break;
-                }
-                if (size < 0 || size >= data_end - data)
-                    return -1;
-                data += size;
-            }
-            t = ff_amf_tag_size(data, data_end);
-            if (t < 0 || t >= data_end - data)
-                return -1;
-            data += t;
-        }
-        return data - base;
-    case AMF_DATA_TYPE_OBJECT_END:  return 1;
-    default:                        return -1;
-    }
-}
-
-int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
-                           const uint8_t *name, uint8_t *dst, int dst_size)
-{
-    int namelen = strlen(name);
-    int len;
-
-    while (*data != AMF_DATA_TYPE_OBJECT && data < data_end) {
-        len = ff_amf_tag_size(data, data_end);
-        if (len < 0)
-            len = data_end - data;
-        data += len;
-    }
-    if (data_end - data < 3)
-        return -1;
-    data++;
-    for (;;) {
-        int size = bytestream_get_be16(&data);
-        if (!size)
-            break;
-        if (size < 0 || size >= data_end - data)
-            return -1;
-        data += size;
-        if (size == namelen && !memcmp(data-size, name, namelen)) {
-            switch (*data++) {
-            case AMF_DATA_TYPE_NUMBER:
-                snprintf(dst, dst_size, "%g", av_int2double(AV_RB64(data)));
-                break;
-            case AMF_DATA_TYPE_BOOL:
-                snprintf(dst, dst_size, "%s", *data ? "true" : "false");
-                break;
-            case AMF_DATA_TYPE_STRING:
-                len = bytestream_get_be16(&data);
-                av_strlcpy(dst, data, FFMIN(len+1, dst_size));
-                break;
-            default:
-                return -1;
-            }
-            return 0;
-        }
-        len = ff_amf_tag_size(data, data_end);
-        if (len < 0 || len >= data_end - data)
-            return -1;
-        data += len;
-    }
-    return -1;
-}
-
-static const char* rtmp_packet_type(int type)
-{
-    switch (type) {
-    case RTMP_PT_CHUNK_SIZE:     return "chunk size";
-    case RTMP_PT_BYTES_READ:     return "bytes read";
-    case RTMP_PT_PING:           return "ping";
-    case RTMP_PT_SERVER_BW:      return "server bandwidth";
-    case RTMP_PT_CLIENT_BW:      return "client bandwidth";
-    case RTMP_PT_AUDIO:          return "audio packet";
-    case RTMP_PT_VIDEO:          return "video packet";
-    case RTMP_PT_FLEX_STREAM:    return "Flex shared stream";
-    case RTMP_PT_FLEX_OBJECT:    return "Flex shared object";
-    case RTMP_PT_FLEX_MESSAGE:   return "Flex shared message";
-    case RTMP_PT_NOTIFY:         return "notification";
-    case RTMP_PT_SHARED_OBJ:     return "shared object";
-    case RTMP_PT_INVOKE:         return "invoke";
-    case RTMP_PT_METADATA:       return "metadata";
-    default:                     return "unknown";
-    }
-}
-
-static void amf_tag_contents(void *ctx, const uint8_t *data,
-                             const uint8_t *data_end)
-{
-    unsigned int size, nb = -1;
-    char buf[1024];
-    AMFDataType type;
-    int parse_key = 1;
-
-    if (data >= data_end)
-        return;
-    switch ((type = *data++)) {
-    case AMF_DATA_TYPE_NUMBER:
-        av_log(ctx, AV_LOG_DEBUG, " number %g\n", av_int2double(AV_RB64(data)));
-        return;
-    case AMF_DATA_TYPE_BOOL:
-        av_log(ctx, AV_LOG_DEBUG, " bool %d\n", *data);
-        return;
-    case AMF_DATA_TYPE_STRING:
-    case AMF_DATA_TYPE_LONG_STRING:
-        if (type == AMF_DATA_TYPE_STRING) {
-            size = bytestream_get_be16(&data);
-        } else {
-            size = bytestream_get_be32(&data);
-        }
-        size = FFMIN(size, sizeof(buf) - 1);
-        memcpy(buf, data, size);
-        buf[size] = 0;
-        av_log(ctx, AV_LOG_DEBUG, " string '%s'\n", buf);
-        return;
-    case AMF_DATA_TYPE_NULL:
-        av_log(ctx, AV_LOG_DEBUG, " NULL\n");
-        return;
-    case AMF_DATA_TYPE_ARRAY:
-        parse_key = 0;
-    case AMF_DATA_TYPE_MIXEDARRAY:
-        nb = bytestream_get_be32(&data);
-    case AMF_DATA_TYPE_OBJECT:
-        av_log(ctx, AV_LOG_DEBUG, " {\n");
-        while (nb-- > 0 || type != AMF_DATA_TYPE_ARRAY) {
-            int t;
-            if (parse_key) {
-                size = bytestream_get_be16(&data);
-                size = FFMIN(size, sizeof(buf) - 1);
-                if (!size) {
-                    av_log(ctx, AV_LOG_DEBUG, " }\n");
-                    data++;
-                    break;
-                }
-                memcpy(buf, data, size);
-                buf[size] = 0;
-                if (size >= data_end - data)
-                    return;
-                data += size;
-                av_log(ctx, AV_LOG_DEBUG, "  %s: ", buf);
-            }
-            amf_tag_contents(ctx, data, data_end);
-            t = ff_amf_tag_size(data, data_end);
-            if (t < 0 || t >= data_end - data)
-                return;
-            data += t;
-        }
-        return;
-    case AMF_DATA_TYPE_OBJECT_END:
-        av_log(ctx, AV_LOG_DEBUG, " }\n");
-        return;
-    default:
-        return;
-    }
-}
-
-void ff_rtmp_packet_dump(void *ctx, RTMPPacket *p)
-{
-    av_log(ctx, AV_LOG_DEBUG, "RTMP packet type '%s'(%d) for channel %d, timestamp %d, extra field %d size %d\n",
-           rtmp_packet_type(p->type), p->type, p->channel_id, p->timestamp, p->extra, p->size);
-    if (p->type == RTMP_PT_INVOKE || p->type == RTMP_PT_NOTIFY) {
-        uint8_t *src = p->data, *src_end = p->data + p->size;
-        while (src < src_end) {
-            int sz;
-            amf_tag_contents(ctx, src, src_end);
-            sz = ff_amf_tag_size(src, src_end);
-            if (sz < 0)
-                break;
-            src += sz;
-        }
-    } else if (p->type == RTMP_PT_SERVER_BW){
-        av_log(ctx, AV_LOG_DEBUG, "Server BW = %d\n", AV_RB32(p->data));
-    } else if (p->type == RTMP_PT_CLIENT_BW){
-        av_log(ctx, AV_LOG_DEBUG, "Client BW = %d\n", AV_RB32(p->data));
-    } else if (p->type != RTMP_PT_AUDIO && p->type != RTMP_PT_VIDEO && p->type != RTMP_PT_METADATA) {
-        int i;
-        for (i = 0; i < p->size; i++)
-            av_log(ctx, AV_LOG_DEBUG, " %02X", p->data[i]);
-        av_log(ctx, AV_LOG_DEBUG, "\n");
-    }
-}
-
-int ff_amf_match_string(const uint8_t *data, int size, const char *str)
-{
-    int len = strlen(str);
-    int amf_len, type;
-
-    if (size < 1)
-        return 0;
-
-    type = *data++;
-
-    if (type != AMF_DATA_TYPE_LONG_STRING &&
-        type != AMF_DATA_TYPE_STRING)
-        return 0;
-
-    if (type == AMF_DATA_TYPE_LONG_STRING) {
-        if ((size -= 4 + 1) < 0)
-            return 0;
-        amf_len = bytestream_get_be32(&data);
-    } else {
-        if ((size -= 2 + 1) < 0)
-            return 0;
-        amf_len = bytestream_get_be16(&data);
-    }
-
-    if (amf_len > size)
-        return 0;
-
-    if (amf_len != len)
-        return 0;
-
-    return !memcmp(data, str, len);
-}
diff --git a/deps/libav/libavformat/rtmppkt.h b/deps/libav/libavformat/rtmppkt.h
deleted file mode 100644
index 7121d7e..0000000
--- a/deps/libav/libavformat/rtmppkt.h
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * RTMP packet utilities
- * Copyright (c) 2009 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTMPPKT_H
-#define AVFORMAT_RTMPPKT_H
-
-#include "libavcodec/bytestream.h"
-#include "avformat.h"
-#include "url.h"
-
-/** maximum possible number of different RTMP channels */
-#define RTMP_CHANNELS 65599
-
-/**
- * channels used to for RTMP packets with different purposes (i.e. data, network
- * control, remote procedure calls, etc.)
- */
-enum RTMPChannel {
-    RTMP_NETWORK_CHANNEL = 2,   ///< channel for network-related messages (bandwidth report, ping, etc)
-    RTMP_SYSTEM_CHANNEL,        ///< channel for sending server control messages
-    RTMP_AUDIO_CHANNEL,         ///< channel for audio data
-    RTMP_VIDEO_CHANNEL   = 6,   ///< channel for video data
-    RTMP_SOURCE_CHANNEL  = 8,   ///< channel for a/v invokes
-};
-
-/**
- * known RTMP packet types
- */
-typedef enum RTMPPacketType {
-    RTMP_PT_CHUNK_SIZE   =  1,  ///< chunk size change
-    RTMP_PT_BYTES_READ   =  3,  ///< number of bytes read
-    RTMP_PT_PING,               ///< ping
-    RTMP_PT_SERVER_BW,          ///< server bandwidth
-    RTMP_PT_CLIENT_BW,          ///< client bandwidth
-    RTMP_PT_AUDIO        =  8,  ///< audio packet
-    RTMP_PT_VIDEO,              ///< video packet
-    RTMP_PT_FLEX_STREAM  = 15,  ///< Flex shared stream
-    RTMP_PT_FLEX_OBJECT,        ///< Flex shared object
-    RTMP_PT_FLEX_MESSAGE,       ///< Flex shared message
-    RTMP_PT_NOTIFY,             ///< some notification
-    RTMP_PT_SHARED_OBJ,         ///< shared object
-    RTMP_PT_INVOKE,             ///< invoke some stream action
-    RTMP_PT_METADATA     = 22,  ///< FLV metadata
-} RTMPPacketType;
-
-/**
- * possible RTMP packet header sizes
- */
-enum RTMPPacketSize {
-    RTMP_PS_TWELVEBYTES = 0, ///< packet has 12-byte header
-    RTMP_PS_EIGHTBYTES,      ///< packet has 8-byte header
-    RTMP_PS_FOURBYTES,       ///< packet has 4-byte header
-    RTMP_PS_ONEBYTE          ///< packet is really a next chunk of a packet
-};
-
-/**
- * structure for holding RTMP packets
- */
-typedef struct RTMPPacket {
-    int            channel_id; ///< RTMP channel ID (nothing to do with audio/video channels though)
-    RTMPPacketType type;       ///< packet payload type
-    uint32_t       timestamp;  ///< packet full timestamp
-    uint32_t       ts_delta;   ///< timestamp increment to the previous one in milliseconds (latter only for media packets)
-    uint32_t       extra;      ///< probably an additional channel ID used during streaming data
-    uint8_t        *data;      ///< packet payload
-    int            size;       ///< packet payload size
-    int            offset;     ///< amount of data read so far
-    int            read;       ///< amount read, including headers
-} RTMPPacket;
-
-/**
- * Create new RTMP packet with given attributes.
- *
- * @param pkt        packet
- * @param channel_id packet channel ID
- * @param type       packet type
- * @param timestamp  packet timestamp
- * @param size       packet size
- * @return zero on success, negative value otherwise
- */
-int ff_rtmp_packet_create(RTMPPacket *pkt, int channel_id, RTMPPacketType type,
-                          int timestamp, int size);
-
-/**
- * Free RTMP packet.
- *
- * @param pkt packet
- */
-void ff_rtmp_packet_destroy(RTMPPacket *pkt);
-
-/**
- * Read RTMP packet sent by the server.
- *
- * @param h          reader context
- * @param p          packet
- * @param chunk_size current chunk size
- * @param prev_pkt   previously read packet headers for all channels
- *                   (may be needed for restoring incomplete packet header)
- * @param nb_prev_pkt number of allocated elements in prev_pkt
- * @return number of bytes read on success, negative value otherwise
- */
-int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p,
-                        int chunk_size, RTMPPacket **prev_pkt,
-                        int *nb_prev_pkt);
-/**
- * Read internal RTMP packet sent by the server.
- *
- * @param h          reader context
- * @param p          packet
- * @param chunk_size current chunk size
- * @param prev_pkt   previously read packet headers for all channels
- *                   (may be needed for restoring incomplete packet header)
- * @param nb_prev_pkt number of allocated elements in prev_pkt
- * @param c          the first byte already read
- * @return number of bytes read on success, negative value otherwise
- */
-int ff_rtmp_packet_read_internal(URLContext *h, RTMPPacket *p, int chunk_size,
-                                 RTMPPacket **prev_pkt, int *nb_prev_pkt,
-                                 uint8_t c);
-
-/**
- * Send RTMP packet to the server.
- *
- * @param h          reader context
- * @param p          packet to send
- * @param chunk_size current chunk size
- * @param prev_pkt   previously sent packet headers for all channels
- *                   (may be used for packet header compressing)
- * @param nb_prev_pkt number of allocated elements in prev_pkt
- * @return number of bytes written on success, negative value otherwise
- */
-int ff_rtmp_packet_write(URLContext *h, RTMPPacket *p,
-                         int chunk_size, RTMPPacket **prev_pkt,
-                         int *nb_prev_pkt);
-
-/**
- * Print information and contents of RTMP packet.
- *
- * @param ctx        output context
- * @param p          packet to dump
- */
-void ff_rtmp_packet_dump(void *ctx, RTMPPacket *p);
-
-/**
- * Enlarge the prev_pkt array to fit the given channel
- *
- * @param prev_pkt    array with previously sent packet headers
- * @param nb_prev_pkt number of allocated elements in prev_pkt
- * @param channel     the channel number that needs to be allocated
- */
-int ff_rtmp_check_alloc_array(RTMPPacket **prev_pkt, int *nb_prev_pkt,
-                              int channel);
-
-/**
- * @name Functions used to work with the AMF format (which is also used in .flv)
- * @see amf_* funcs in libavformat/flvdec.c
- * @{
- */
-
-/**
- * Calculate number of bytes taken by first AMF entry in data.
- *
- * @param data input data
- * @param data_end input buffer end
- * @return number of bytes used by first AMF entry
- */
-int ff_amf_tag_size(const uint8_t *data, const uint8_t *data_end);
-
-/**
- * Retrieve value of given AMF object field in string form.
- *
- * @param data     AMF object data
- * @param data_end input buffer end
- * @param name     name of field to retrieve
- * @param dst      buffer for storing result
- * @param dst_size output buffer size
- * @return 0 if search and retrieval succeeded, negative value otherwise
- */
-int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
-                           const uint8_t *name, uint8_t *dst, int dst_size);
-
-/**
- * Write boolean value in AMF format to buffer.
- *
- * @param dst pointer to the input buffer (will be modified)
- * @param val value to write
- */
-void ff_amf_write_bool(uint8_t **dst, int val);
-
-/**
- * Write number in AMF format to buffer.
- *
- * @param dst pointer to the input buffer (will be modified)
- * @param num value to write
- */
-void ff_amf_write_number(uint8_t **dst, double num);
-
-/**
- * Write string in AMF format to buffer.
- *
- * @param dst pointer to the input buffer (will be modified)
- * @param str string to write
- */
-void ff_amf_write_string(uint8_t **dst, const char *str);
-
-/**
- * Write a string consisting of two parts in AMF format to a buffer.
- *
- * @param dst pointer to the input buffer (will be modified)
- * @param str1 first string to write, may be null
- * @param str2 second string to write, may be null
- */
-void ff_amf_write_string2(uint8_t **dst, const char *str1, const char *str2);
-
-/**
- * Write AMF NULL value to buffer.
- *
- * @param dst pointer to the input buffer (will be modified)
- */
-void ff_amf_write_null(uint8_t **dst);
-
-/**
- * Write marker for AMF object to buffer.
- *
- * @param dst pointer to the input buffer (will be modified)
- */
-void ff_amf_write_object_start(uint8_t **dst);
-
-/**
- * Write string used as field name in AMF object to buffer.
- *
- * @param dst pointer to the input buffer (will be modified)
- * @param str string to write
- */
-void ff_amf_write_field_name(uint8_t **dst, const char *str);
-
-/**
- * Write marker for end of AMF object to buffer.
- *
- * @param dst pointer to the input buffer (will be modified)
- */
-void ff_amf_write_object_end(uint8_t **dst);
-
-/**
- * Read AMF boolean value.
- *
- *@param[in,out] gbc GetByteContext initialized with AMF-formatted data
- *@param[out]    val 0 or 1
- *@return 0 on success or an AVERROR code on failure
-*/
-int ff_amf_read_bool(GetByteContext *gbc, int *val);
-
-/**
- * Read AMF number value.
- *
- *@param[in,out] gbc GetByteContext initialized with AMF-formatted data
- *@param[out]    val read value
- *@return 0 on success or an AVERROR code on failure
-*/
-int ff_amf_read_number(GetByteContext *gbc, double *val);
-
-/**
- * Read AMF string value.
- *
- * Appends a trailing null byte to output string in order to
- * ease later parsing.
- *
- *@param[in,out] gbc     GetByteContext initialized with AMF-formatted data
- *@param[out]    str     read string
- *@param[in]     strsize buffer size available to store the read string
- *@param[out]    length  read string length
- *@return 0 on success or an AVERROR code on failure
-*/
-int ff_amf_read_string(GetByteContext *gbc, uint8_t *str,
-                       int strsize, int *length);
-
-/**
- * Read AMF NULL value.
- *
- *@param[in,out] gbc GetByteContext initialized with AMF-formatted data
- *@return 0 on success or an AVERROR code on failure
-*/
-int ff_amf_read_null(GetByteContext *gbc);
-
-/**
- * Match AMF string with a NULL-terminated string.
- *
- * @return 0 if the strings do not match.
- */
-
-int ff_amf_match_string(const uint8_t *data, int size, const char *str);
-
-/** @} */ // AMF funcs
-
-#endif /* AVFORMAT_RTMPPKT_H */
diff --git a/deps/libav/libavformat/rtmpproto.c b/deps/libav/libavformat/rtmpproto.c
deleted file mode 100644
index ead5ccd..0000000
--- a/deps/libav/libavformat/rtmpproto.c
+++ /dev/null
@@ -1,2828 +0,0 @@
-/*
- * RTMP network protocol
- * Copyright (c) 2009 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RTMP protocol
- */
-
-#include "libavcodec/bytestream.h"
-#include "libavutil/avstring.h"
-#include "libavutil/base64.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/lfg.h"
-#include "libavutil/md5.h"
-#include "libavutil/opt.h"
-#include "libavutil/random_seed.h"
-#include "libavutil/sha.h"
-#include "avformat.h"
-#include "internal.h"
-
-#include "network.h"
-
-#include "flv.h"
-#include "rtmp.h"
-#include "rtmpcrypt.h"
-#include "rtmppkt.h"
-#include "url.h"
-
-#if CONFIG_ZLIB
-#include <zlib.h>
-#endif
-
-#define APP_MAX_LENGTH 128
-#define PLAYPATH_MAX_LENGTH 256
-#define TCURL_MAX_LENGTH 512
-#define FLASHVER_MAX_LENGTH 64
-#define RTMP_PKTDATA_DEFAULT_SIZE 4096
-#define RTMP_HEADER 11
-
-/** RTMP protocol handler state */
-typedef enum {
-    STATE_START,      ///< client has not done anything yet
-    STATE_HANDSHAKED, ///< client has performed handshake
-    STATE_FCPUBLISH,  ///< client FCPublishing stream (for output)
-    STATE_PLAYING,    ///< client has started receiving multimedia data from server
-    STATE_SEEKING,    ///< client has started the seek operation. Back on STATE_PLAYING when the time comes
-    STATE_PUBLISHING, ///< client has started sending multimedia data to server (for output)
-    STATE_RECEIVING,  ///< received a publish command (for input)
-    STATE_SENDING,    ///< received a play command (for output)
-    STATE_STOPPED,    ///< the broadcast has been stopped
-} ClientState;
-
-typedef struct TrackedMethod {
-    char *name;
-    int id;
-} TrackedMethod;
-
-/** protocol handler context */
-typedef struct RTMPContext {
-    const AVClass *class;
-    URLContext*   stream;                     ///< TCP stream used in interactions with RTMP server
-    RTMPPacket    *prev_pkt[2];               ///< packet history used when reading and sending packets ([0] for reading, [1] for writing)
-    int           nb_prev_pkt[2];             ///< number of elements in prev_pkt
-    int           in_chunk_size;              ///< size of the chunks incoming RTMP packets are divided into
-    int           out_chunk_size;             ///< size of the chunks outgoing RTMP packets are divided into
-    int           is_input;                   ///< input/output flag
-    char          *playpath;                  ///< stream identifier to play (with possible "mp4:" prefix)
-    int           live;                       ///< 0: recorded, -1: live, -2: both
-    char          *app;                       ///< name of application
-    char          *conn;                      ///< append arbitrary AMF data to the Connect message
-    ClientState   state;                      ///< current state
-    int           stream_id;                  ///< ID assigned by the server for the stream
-    uint8_t*      flv_data;                   ///< buffer with data for demuxer
-    int           flv_size;                   ///< current buffer size
-    int           flv_off;                    ///< number of bytes read from current buffer
-    int           flv_nb_packets;             ///< number of flv packets published
-    RTMPPacket    out_pkt;                    ///< rtmp packet, created from flv a/v or metadata (for output)
-    uint32_t      client_report_size;         ///< number of bytes after which client should report to server
-    uint32_t      bytes_read;                 ///< number of bytes read from server
-    uint32_t      last_bytes_read;            ///< number of bytes read last reported to server
-    int           skip_bytes;                 ///< number of bytes to skip from the input FLV stream in the next write call
-    uint8_t       flv_header[RTMP_HEADER];    ///< partial incoming flv packet header
-    int           flv_header_bytes;           ///< number of initialized bytes in flv_header
-    int           nb_invokes;                 ///< keeps track of invoke messages
-    char*         tcurl;                      ///< url of the target stream
-    char*         flashver;                   ///< version of the flash plugin
-    char*         swfhash;                    ///< SHA256 hash of the decompressed SWF file (32 bytes)
-    int           swfhash_len;                ///< length of the SHA256 hash
-    int           swfsize;                    ///< size of the decompressed SWF file
-    char*         swfurl;                     ///< url of the swf player
-    char*         swfverify;                  ///< URL to player swf file, compute hash/size automatically
-    char          swfverification[42];        ///< hash of the SWF verification
-    char*         pageurl;                    ///< url of the web page
-    char*         subscribe;                  ///< name of live stream to subscribe
-    int           server_bw;                  ///< server bandwidth
-    int           client_buffer_time;         ///< client buffer time in ms
-    int           flush_interval;             ///< number of packets flushed in the same request (RTMPT only)
-    int           encrypted;                  ///< use an encrypted connection (RTMPE only)
-    TrackedMethod*tracked_methods;            ///< tracked methods buffer
-    int           nb_tracked_methods;         ///< number of tracked methods
-    int           tracked_methods_size;       ///< size of the tracked methods buffer
-    int           listen;                     ///< listen mode flag
-    int           listen_timeout;             ///< listen timeout to wait for new connections
-    int           nb_streamid;                ///< The next stream id to return on createStream calls
-    char          username[50];
-    char          password[50];
-    char          auth_params[500];
-    int           do_reconnect;
-    int           auth_tried;
-} RTMPContext;
-
-#define PLAYER_KEY_OPEN_PART_LEN 30   ///< length of partial key used for first client digest signing
-/** Client key used for digest signing */
-static const uint8_t rtmp_player_key[] = {
-    'G', 'e', 'n', 'u', 'i', 'n', 'e', ' ', 'A', 'd', 'o', 'b', 'e', ' ',
-    'F', 'l', 'a', 's', 'h', ' ', 'P', 'l', 'a', 'y', 'e', 'r', ' ', '0', '0', '1',
-
-    0xF0, 0xEE, 0xC2, 0x4A, 0x80, 0x68, 0xBE, 0xE8, 0x2E, 0x00, 0xD0, 0xD1, 0x02,
-    0x9E, 0x7E, 0x57, 0x6E, 0xEC, 0x5D, 0x2D, 0x29, 0x80, 0x6F, 0xAB, 0x93, 0xB8,
-    0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE
-};
-
-#define SERVER_KEY_OPEN_PART_LEN 36   ///< length of partial key used for first server digest signing
-/** Key used for RTMP server digest signing */
-static const uint8_t rtmp_server_key[] = {
-    'G', 'e', 'n', 'u', 'i', 'n', 'e', ' ', 'A', 'd', 'o', 'b', 'e', ' ',
-    'F', 'l', 'a', 's', 'h', ' ', 'M', 'e', 'd', 'i', 'a', ' ',
-    'S', 'e', 'r', 'v', 'e', 'r', ' ', '0', '0', '1',
-
-    0xF0, 0xEE, 0xC2, 0x4A, 0x80, 0x68, 0xBE, 0xE8, 0x2E, 0x00, 0xD0, 0xD1, 0x02,
-    0x9E, 0x7E, 0x57, 0x6E, 0xEC, 0x5D, 0x2D, 0x29, 0x80, 0x6F, 0xAB, 0x93, 0xB8,
-    0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE
-};
-
-static int add_tracked_method(RTMPContext *rt, const char *name, int id)
-{
-    int err;
-
-    if (rt->nb_tracked_methods + 1 > rt->tracked_methods_size) {
-        rt->tracked_methods_size = (rt->nb_tracked_methods + 1) * 2;
-        if ((err = av_reallocp(&rt->tracked_methods, rt->tracked_methods_size *
-                               sizeof(*rt->tracked_methods))) < 0) {
-            rt->nb_tracked_methods = 0;
-            rt->tracked_methods_size = 0;
-            return err;
-        }
-    }
-
-    rt->tracked_methods[rt->nb_tracked_methods].name = av_strdup(name);
-    if (!rt->tracked_methods[rt->nb_tracked_methods].name)
-        return AVERROR(ENOMEM);
-    rt->tracked_methods[rt->nb_tracked_methods].id = id;
-    rt->nb_tracked_methods++;
-
-    return 0;
-}
-
-static void del_tracked_method(RTMPContext *rt, int index)
-{
-    memmove(&rt->tracked_methods[index], &rt->tracked_methods[index + 1],
-            sizeof(*rt->tracked_methods) * (rt->nb_tracked_methods - index - 1));
-    rt->nb_tracked_methods--;
-}
-
-static int find_tracked_method(URLContext *s, RTMPPacket *pkt, int offset,
-                               char **tracked_method)
-{
-    RTMPContext *rt = s->priv_data;
-    GetByteContext gbc;
-    double pkt_id;
-    int ret;
-    int i;
-
-    bytestream2_init(&gbc, pkt->data + offset, pkt->size - offset);
-    if ((ret = ff_amf_read_number(&gbc, &pkt_id)) < 0)
-        return ret;
-
-    for (i = 0; i < rt->nb_tracked_methods; i++) {
-        if (rt->tracked_methods[i].id != pkt_id)
-            continue;
-
-        *tracked_method = rt->tracked_methods[i].name;
-        del_tracked_method(rt, i);
-        break;
-    }
-
-    return 0;
-}
-
-static void free_tracked_methods(RTMPContext *rt)
-{
-    int i;
-
-    for (i = 0; i < rt->nb_tracked_methods; i ++)
-        av_free(rt->tracked_methods[i].name);
-    av_free(rt->tracked_methods);
-    rt->tracked_methods      = NULL;
-    rt->tracked_methods_size = 0;
-    rt->nb_tracked_methods   = 0;
-}
-
-static int rtmp_send_packet(RTMPContext *rt, RTMPPacket *pkt, int track)
-{
-    int ret;
-
-    if (pkt->type == RTMP_PT_INVOKE && track) {
-        GetByteContext gbc;
-        char name[128];
-        double pkt_id;
-        int len;
-
-        bytestream2_init(&gbc, pkt->data, pkt->size);
-        if ((ret = ff_amf_read_string(&gbc, name, sizeof(name), &len)) < 0)
-            goto fail;
-
-        if ((ret = ff_amf_read_number(&gbc, &pkt_id)) < 0)
-            goto fail;
-
-        if ((ret = add_tracked_method(rt, name, pkt_id)) < 0)
-            goto fail;
-    }
-
-    ret = ff_rtmp_packet_write(rt->stream, pkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-fail:
-    ff_rtmp_packet_destroy(pkt);
-    return ret;
-}
-
-static int rtmp_write_amf_data(URLContext *s, char *param, uint8_t **p)
-{
-    char *field, *value;
-    char type;
-
-    /* The type must be B for Boolean, N for number, S for string, O for
-     * object, or Z for null. For Booleans the data must be either 0 or 1 for
-     * FALSE or TRUE, respectively. Likewise for Objects the data must be
-     * 0 or 1 to end or begin an object, respectively. Data items in subobjects
-     * may be named, by prefixing the type with 'N' and specifying the name
-     * before the value (ie. NB:myFlag:1). This option may be used multiple times
-     * to construct arbitrary AMF sequences. */
-    if (param[0] && param[1] == ':') {
-        type = param[0];
-        value = param + 2;
-    } else if (param[0] == 'N' && param[1] && param[2] == ':') {
-        type = param[1];
-        field = param + 3;
-        value = strchr(field, ':');
-        if (!value)
-            goto fail;
-        *value = '\0';
-        value++;
-
-        if (!field || !value)
-            goto fail;
-
-        ff_amf_write_field_name(p, field);
-    } else {
-        goto fail;
-    }
-
-    switch (type) {
-    case 'B':
-        ff_amf_write_bool(p, value[0] != '0');
-        break;
-    case 'S':
-        ff_amf_write_string(p, value);
-        break;
-    case 'N':
-        ff_amf_write_number(p, strtod(value, NULL));
-        break;
-    case 'Z':
-        ff_amf_write_null(p);
-        break;
-    case 'O':
-        if (value[0] != '0')
-            ff_amf_write_object_start(p);
-        else
-            ff_amf_write_object_end(p);
-        break;
-    default:
-        goto fail;
-        break;
-    }
-
-    return 0;
-
-fail:
-    av_log(s, AV_LOG_ERROR, "Invalid AMF parameter: %s\n", param);
-    return AVERROR(EINVAL);
-}
-
-/**
- * Generate 'connect' call and send it to the server.
- */
-static int gen_connect(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 4096)) < 0)
-        return ret;
-
-    p = pkt.data;
-
-    ff_amf_write_string(&p, "connect");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_object_start(&p);
-    ff_amf_write_field_name(&p, "app");
-    ff_amf_write_string2(&p, rt->app, rt->auth_params);
-
-    if (!rt->is_input) {
-        ff_amf_write_field_name(&p, "type");
-        ff_amf_write_string(&p, "nonprivate");
-    }
-    ff_amf_write_field_name(&p, "flashVer");
-    ff_amf_write_string(&p, rt->flashver);
-
-    if (rt->swfurl) {
-        ff_amf_write_field_name(&p, "swfUrl");
-        ff_amf_write_string(&p, rt->swfurl);
-    }
-
-    ff_amf_write_field_name(&p, "tcUrl");
-    ff_amf_write_string2(&p, rt->tcurl, rt->auth_params);
-    if (rt->is_input) {
-        ff_amf_write_field_name(&p, "fpad");
-        ff_amf_write_bool(&p, 0);
-        ff_amf_write_field_name(&p, "capabilities");
-        ff_amf_write_number(&p, 15.0);
-
-        /* Tell the server we support all the audio codecs except
-         * SUPPORT_SND_INTEL (0x0008) and SUPPORT_SND_UNUSED (0x0010)
-         * which are unused in the RTMP protocol implementation. */
-        ff_amf_write_field_name(&p, "audioCodecs");
-        ff_amf_write_number(&p, 4071.0);
-        ff_amf_write_field_name(&p, "videoCodecs");
-        ff_amf_write_number(&p, 252.0);
-        ff_amf_write_field_name(&p, "videoFunction");
-        ff_amf_write_number(&p, 1.0);
-
-        if (rt->pageurl) {
-            ff_amf_write_field_name(&p, "pageUrl");
-            ff_amf_write_string(&p, rt->pageurl);
-        }
-    }
-    ff_amf_write_object_end(&p);
-
-    if (rt->conn) {
-        char *param = rt->conn;
-
-        // Write arbitrary AMF data to the Connect message.
-        while (param != NULL) {
-            char *sep;
-            param += strspn(param, " ");
-            if (!*param)
-                break;
-            sep = strchr(param, ' ');
-            if (sep)
-                *sep = '\0';
-            if ((ret = rtmp_write_amf_data(s, param, &p)) < 0) {
-                // Invalid AMF parameter.
-                ff_rtmp_packet_destroy(&pkt);
-                return ret;
-            }
-
-            if (sep)
-                param = sep + 1;
-            else
-                break;
-        }
-    }
-
-    pkt.size = p - pkt.data;
-
-    return rtmp_send_packet(rt, &pkt, 1);
-}
-
-static int read_connect(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt = { 0 };
-    uint8_t *p;
-    const uint8_t *cp;
-    int ret;
-    char command[64];
-    int stringlen;
-    double seqnum;
-    uint8_t tmpstr[256];
-    GetByteContext gbc;
-
-    if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size,
-                                   &rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0)
-        return ret;
-    cp = pkt.data;
-    bytestream2_init(&gbc, cp, pkt.size);
-    if (ff_amf_read_string(&gbc, command, sizeof(command), &stringlen)) {
-        av_log(s, AV_LOG_ERROR, "Unable to read command string\n");
-        ff_rtmp_packet_destroy(&pkt);
-        return AVERROR_INVALIDDATA;
-    }
-    if (strcmp(command, "connect")) {
-        av_log(s, AV_LOG_ERROR, "Expecting connect, got %s\n", command);
-        ff_rtmp_packet_destroy(&pkt);
-        return AVERROR_INVALIDDATA;
-    }
-    ret = ff_amf_read_number(&gbc, &seqnum);
-    if (ret)
-        av_log(s, AV_LOG_WARNING, "SeqNum not found\n");
-    /* Here one could parse an AMF Object with data as flashVers and others. */
-    ret = ff_amf_get_field_value(gbc.buffer,
-                                 gbc.buffer + bytestream2_get_bytes_left(&gbc),
-                                 "app", tmpstr, sizeof(tmpstr));
-    if (ret)
-        av_log(s, AV_LOG_WARNING, "App field not found in connect\n");
-    if (!ret && strcmp(tmpstr, rt->app))
-        av_log(s, AV_LOG_WARNING, "App field don't match up: %s <-> %s\n",
-               tmpstr, rt->app);
-    ff_rtmp_packet_destroy(&pkt);
-
-    // Send Window Acknowledgement Size (as defined in speficication)
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL,
-                                     RTMP_PT_SERVER_BW, 0, 4)) < 0)
-        return ret;
-    p = pkt.data;
-    bytestream_put_be32(&p, rt->server_bw);
-    pkt.size = p - pkt.data;
-    ret = ff_rtmp_packet_write(rt->stream, &pkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-    ff_rtmp_packet_destroy(&pkt);
-    if (ret < 0)
-        return ret;
-    // Send Peer Bandwidth
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL,
-                                     RTMP_PT_CLIENT_BW, 0, 5)) < 0)
-        return ret;
-    p = pkt.data;
-    bytestream_put_be32(&p, rt->server_bw);
-    bytestream_put_byte(&p, 2); // dynamic
-    pkt.size = p - pkt.data;
-    ret = ff_rtmp_packet_write(rt->stream, &pkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-    ff_rtmp_packet_destroy(&pkt);
-    if (ret < 0)
-        return ret;
-
-    // Ping request
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL,
-                                     RTMP_PT_PING, 0, 6)) < 0)
-        return ret;
-
-    p = pkt.data;
-    bytestream_put_be16(&p, 0); // 0 -> Stream Begin
-    bytestream_put_be32(&p, 0);
-    ret = ff_rtmp_packet_write(rt->stream, &pkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-    ff_rtmp_packet_destroy(&pkt);
-    if (ret < 0)
-        return ret;
-
-    // Chunk size
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL,
-                                     RTMP_PT_CHUNK_SIZE, 0, 4)) < 0)
-        return ret;
-
-    p = pkt.data;
-    bytestream_put_be32(&p, rt->out_chunk_size);
-    ret = ff_rtmp_packet_write(rt->stream, &pkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-    ff_rtmp_packet_destroy(&pkt);
-    if (ret < 0)
-        return ret;
-
-    // Send result_ NetConnection.Connect.Success to connect
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL,
-                                     RTMP_PT_INVOKE, 0,
-                                     RTMP_PKTDATA_DEFAULT_SIZE)) < 0)
-        return ret;
-
-    p = pkt.data;
-    ff_amf_write_string(&p, "_result");
-    ff_amf_write_number(&p, seqnum);
-
-    ff_amf_write_object_start(&p);
-    ff_amf_write_field_name(&p, "fmsVer");
-    ff_amf_write_string(&p, "FMS/3,0,1,123");
-    ff_amf_write_field_name(&p, "capabilities");
-    ff_amf_write_number(&p, 31);
-    ff_amf_write_object_end(&p);
-
-    ff_amf_write_object_start(&p);
-    ff_amf_write_field_name(&p, "level");
-    ff_amf_write_string(&p, "status");
-    ff_amf_write_field_name(&p, "code");
-    ff_amf_write_string(&p, "NetConnection.Connect.Success");
-    ff_amf_write_field_name(&p, "description");
-    ff_amf_write_string(&p, "Connection succeeded.");
-    ff_amf_write_field_name(&p, "objectEncoding");
-    ff_amf_write_number(&p, 0);
-    ff_amf_write_object_end(&p);
-
-    pkt.size = p - pkt.data;
-    ret = ff_rtmp_packet_write(rt->stream, &pkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-    ff_rtmp_packet_destroy(&pkt);
-    if (ret < 0)
-        return ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL,
-                                     RTMP_PT_INVOKE, 0, 30)) < 0)
-        return ret;
-    p = pkt.data;
-    ff_amf_write_string(&p, "onBWDone");
-    ff_amf_write_number(&p, 0);
-    ff_amf_write_null(&p);
-    ff_amf_write_number(&p, 8192);
-    pkt.size = p - pkt.data;
-    ret = ff_rtmp_packet_write(rt->stream, &pkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-    ff_rtmp_packet_destroy(&pkt);
-
-    return ret;
-}
-
-/**
- * Generate 'releaseStream' call and send it to the server. It should make
- * the server release some channel for media streams.
- */
-static int gen_release_stream(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 29 + strlen(rt->playpath))) < 0)
-        return ret;
-
-    av_log(s, AV_LOG_DEBUG, "Releasing stream...\n");
-    p = pkt.data;
-    ff_amf_write_string(&p, "releaseStream");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_null(&p);
-    ff_amf_write_string(&p, rt->playpath);
-
-    return rtmp_send_packet(rt, &pkt, 1);
-}
-
-/**
- * Generate 'FCPublish' call and send it to the server. It should make
- * the server preapare for receiving media streams.
- */
-static int gen_fcpublish_stream(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 25 + strlen(rt->playpath))) < 0)
-        return ret;
-
-    av_log(s, AV_LOG_DEBUG, "FCPublish stream...\n");
-    p = pkt.data;
-    ff_amf_write_string(&p, "FCPublish");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_null(&p);
-    ff_amf_write_string(&p, rt->playpath);
-
-    return rtmp_send_packet(rt, &pkt, 1);
-}
-
-/**
- * Generate 'FCUnpublish' call and send it to the server. It should make
- * the server destroy stream.
- */
-static int gen_fcunpublish_stream(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 27 + strlen(rt->playpath))) < 0)
-        return ret;
-
-    av_log(s, AV_LOG_DEBUG, "UnPublishing stream...\n");
-    p = pkt.data;
-    ff_amf_write_string(&p, "FCUnpublish");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_null(&p);
-    ff_amf_write_string(&p, rt->playpath);
-
-    return rtmp_send_packet(rt, &pkt, 0);
-}
-
-/**
- * Generate 'createStream' call and send it to the server. It should make
- * the server allocate some channel for media streams.
- */
-static int gen_create_stream(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    av_log(s, AV_LOG_DEBUG, "Creating stream...\n");
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 25)) < 0)
-        return ret;
-
-    p = pkt.data;
-    ff_amf_write_string(&p, "createStream");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_null(&p);
-
-    return rtmp_send_packet(rt, &pkt, 1);
-}
-
-
-/**
- * Generate 'deleteStream' call and send it to the server. It should make
- * the server remove some channel for media streams.
- */
-static int gen_delete_stream(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    av_log(s, AV_LOG_DEBUG, "Deleting stream...\n");
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 34)) < 0)
-        return ret;
-
-    p = pkt.data;
-    ff_amf_write_string(&p, "deleteStream");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_null(&p);
-    ff_amf_write_number(&p, rt->stream_id);
-
-    return rtmp_send_packet(rt, &pkt, 0);
-}
-
-/**
- * Generate client buffer time and send it to the server.
- */
-static int gen_buffer_time(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL, RTMP_PT_PING,
-                                     1, 10)) < 0)
-        return ret;
-
-    p = pkt.data;
-    bytestream_put_be16(&p, 3);
-    bytestream_put_be32(&p, rt->stream_id);
-    bytestream_put_be32(&p, rt->client_buffer_time);
-
-    return rtmp_send_packet(rt, &pkt, 0);
-}
-
-/**
- * Generate 'play' call and send it to the server, then ping the server
- * to start actual playing.
- */
-static int gen_play(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    av_log(s, AV_LOG_DEBUG, "Sending play command for '%s'\n", rt->playpath);
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SOURCE_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 29 + strlen(rt->playpath))) < 0)
-        return ret;
-
-    pkt.extra = rt->stream_id;
-
-    p = pkt.data;
-    ff_amf_write_string(&p, "play");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_null(&p);
-    ff_amf_write_string(&p, rt->playpath);
-    ff_amf_write_number(&p, rt->live * 1000);
-
-    return rtmp_send_packet(rt, &pkt, 1);
-}
-
-static int gen_seek(URLContext *s, RTMPContext *rt, int64_t timestamp)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    av_log(s, AV_LOG_DEBUG, "Sending seek command for timestamp %"PRId64"\n",
-           timestamp);
-
-    if ((ret = ff_rtmp_packet_create(&pkt, 3, RTMP_PT_INVOKE, 0, 26)) < 0)
-        return ret;
-
-    pkt.extra = rt->stream_id;
-
-    p = pkt.data;
-    ff_amf_write_string(&p, "seek");
-    ff_amf_write_number(&p, 0); //no tracking back responses
-    ff_amf_write_null(&p); //as usual, the first null param
-    ff_amf_write_number(&p, timestamp); //where we want to jump
-
-    return rtmp_send_packet(rt, &pkt, 1);
-}
-
-/**
- * Generate 'publish' call and send it to the server.
- */
-static int gen_publish(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    av_log(s, AV_LOG_DEBUG, "Sending publish command for '%s'\n", rt->playpath);
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SOURCE_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 30 + strlen(rt->playpath))) < 0)
-        return ret;
-
-    pkt.extra = rt->stream_id;
-
-    p = pkt.data;
-    ff_amf_write_string(&p, "publish");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_null(&p);
-    ff_amf_write_string(&p, rt->playpath);
-    ff_amf_write_string(&p, "live");
-
-    return rtmp_send_packet(rt, &pkt, 1);
-}
-
-/**
- * Generate ping reply and send it to the server.
- */
-static int gen_pong(URLContext *s, RTMPContext *rt, RTMPPacket *ppkt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if (ppkt->size < 6) {
-        av_log(s, AV_LOG_ERROR, "Too short ping packet (%d)\n",
-               ppkt->size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL, RTMP_PT_PING,
-                                     ppkt->timestamp + 1, 6)) < 0)
-        return ret;
-
-    p = pkt.data;
-    bytestream_put_be16(&p, 7);
-    bytestream_put_be32(&p, AV_RB32(ppkt->data+2));
-
-    return rtmp_send_packet(rt, &pkt, 0);
-}
-
-/**
- * Generate SWF verification message and send it to the server.
- */
-static int gen_swf_verification(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    av_log(s, AV_LOG_DEBUG, "Sending SWF verification...\n");
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL, RTMP_PT_PING,
-                                     0, 44)) < 0)
-        return ret;
-
-    p = pkt.data;
-    bytestream_put_be16(&p, 27);
-    memcpy(p, rt->swfverification, 42);
-
-    return rtmp_send_packet(rt, &pkt, 0);
-}
-
-/**
- * Generate server bandwidth message and send it to the server.
- */
-static int gen_server_bw(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL, RTMP_PT_SERVER_BW,
-                                     0, 4)) < 0)
-        return ret;
-
-    p = pkt.data;
-    bytestream_put_be32(&p, rt->server_bw);
-
-    return rtmp_send_packet(rt, &pkt, 0);
-}
-
-/**
- * Generate check bandwidth message and send it to the server.
- */
-static int gen_check_bw(URLContext *s, RTMPContext *rt)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 21)) < 0)
-        return ret;
-
-    p = pkt.data;
-    ff_amf_write_string(&p, "_checkbw");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_null(&p);
-
-    return rtmp_send_packet(rt, &pkt, 1);
-}
-
-/**
- * Generate report on bytes read so far and send it to the server.
- */
-static int gen_bytes_read(URLContext *s, RTMPContext *rt, uint32_t ts)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL, RTMP_PT_BYTES_READ,
-                                     ts, 4)) < 0)
-        return ret;
-
-    p = pkt.data;
-    bytestream_put_be32(&p, rt->bytes_read);
-
-    return rtmp_send_packet(rt, &pkt, 0);
-}
-
-static int gen_fcsubscribe_stream(URLContext *s, RTMPContext *rt,
-                                  const char *subscribe)
-{
-    RTMPPacket pkt;
-    uint8_t *p;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
-                                     0, 27 + strlen(subscribe))) < 0)
-        return ret;
-
-    p = pkt.data;
-    ff_amf_write_string(&p, "FCSubscribe");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
-    ff_amf_write_null(&p);
-    ff_amf_write_string(&p, subscribe);
-
-    return rtmp_send_packet(rt, &pkt, 1);
-}
-
-int ff_rtmp_calc_digest(const uint8_t *src, int len, int gap,
-                        const uint8_t *key, int keylen, uint8_t *dst)
-{
-    struct AVSHA *sha;
-    uint8_t hmac_buf[64+32] = {0};
-    int i;
-
-    sha = av_sha_alloc();
-    if (!sha)
-        return AVERROR(ENOMEM);
-
-    if (keylen < 64) {
-        memcpy(hmac_buf, key, keylen);
-    } else {
-        av_sha_init(sha, 256);
-        av_sha_update(sha,key, keylen);
-        av_sha_final(sha, hmac_buf);
-    }
-    for (i = 0; i < 64; i++)
-        hmac_buf[i] ^= HMAC_IPAD_VAL;
-
-    av_sha_init(sha, 256);
-    av_sha_update(sha, hmac_buf, 64);
-    if (gap <= 0) {
-        av_sha_update(sha, src, len);
-    } else { //skip 32 bytes used for storing digest
-        av_sha_update(sha, src, gap);
-        av_sha_update(sha, src + gap + 32, len - gap - 32);
-    }
-    av_sha_final(sha, hmac_buf + 64);
-
-    for (i = 0; i < 64; i++)
-        hmac_buf[i] ^= HMAC_IPAD_VAL ^ HMAC_OPAD_VAL; //reuse XORed key for opad
-    av_sha_init(sha, 256);
-    av_sha_update(sha, hmac_buf, 64+32);
-    av_sha_final(sha, dst);
-
-    av_free(sha);
-
-    return 0;
-}
-
-int ff_rtmp_calc_digest_pos(const uint8_t *buf, int off, int mod_val,
-                            int add_val)
-{
-    int i, digest_pos = 0;
-
-    for (i = 0; i < 4; i++)
-        digest_pos += buf[i + off];
-    digest_pos = digest_pos % mod_val + add_val;
-
-    return digest_pos;
-}
-
-/**
- * Put HMAC-SHA2 digest of packet data (except for the bytes where this digest
- * will be stored) into that packet.
- *
- * @param buf handshake data (1536 bytes)
- * @param encrypted use an encrypted connection (RTMPE)
- * @return offset to the digest inside input data
- */
-static int rtmp_handshake_imprint_with_digest(uint8_t *buf, int encrypted)
-{
-    int ret, digest_pos;
-
-    if (encrypted)
-        digest_pos = ff_rtmp_calc_digest_pos(buf, 772, 728, 776);
-    else
-        digest_pos = ff_rtmp_calc_digest_pos(buf, 8, 728, 12);
-
-    ret = ff_rtmp_calc_digest(buf, RTMP_HANDSHAKE_PACKET_SIZE, digest_pos,
-                              rtmp_player_key, PLAYER_KEY_OPEN_PART_LEN,
-                              buf + digest_pos);
-    if (ret < 0)
-        return ret;
-
-    return digest_pos;
-}
-
-/**
- * Verify that the received server response has the expected digest value.
- *
- * @param buf handshake data received from the server (1536 bytes)
- * @param off position to search digest offset from
- * @return 0 if digest is valid, digest position otherwise
- */
-static int rtmp_validate_digest(uint8_t *buf, int off)
-{
-    uint8_t digest[32];
-    int ret, digest_pos;
-
-    digest_pos = ff_rtmp_calc_digest_pos(buf, off, 728, off + 4);
-
-    ret = ff_rtmp_calc_digest(buf, RTMP_HANDSHAKE_PACKET_SIZE, digest_pos,
-                              rtmp_server_key, SERVER_KEY_OPEN_PART_LEN,
-                              digest);
-    if (ret < 0)
-        return ret;
-
-    if (!memcmp(digest, buf + digest_pos, 32))
-        return digest_pos;
-    return 0;
-}
-
-static int rtmp_calc_swf_verification(URLContext *s, RTMPContext *rt,
-                                      uint8_t *buf)
-{
-    uint8_t *p;
-    int ret;
-
-    if (rt->swfhash_len != 32) {
-        av_log(s, AV_LOG_ERROR,
-               "Hash of the decompressed SWF file is not 32 bytes long.\n");
-        return AVERROR(EINVAL);
-    }
-
-    p = &rt->swfverification[0];
-    bytestream_put_byte(&p, 1);
-    bytestream_put_byte(&p, 1);
-    bytestream_put_be32(&p, rt->swfsize);
-    bytestream_put_be32(&p, rt->swfsize);
-
-    if ((ret = ff_rtmp_calc_digest(rt->swfhash, 32, 0, buf, 32, p)) < 0)
-        return ret;
-
-    return 0;
-}
-
-#if CONFIG_ZLIB
-static int rtmp_uncompress_swfplayer(uint8_t *in_data, int64_t in_size,
-                                     uint8_t **out_data, int64_t *out_size)
-{
-    z_stream zs = { 0 };
-    void *ptr;
-    int size;
-    int ret = 0;
-
-    zs.avail_in = in_size;
-    zs.next_in  = in_data;
-    ret = inflateInit(&zs);
-    if (ret != Z_OK)
-        return AVERROR_UNKNOWN;
-
-    do {
-        uint8_t tmp_buf[16384];
-
-        zs.avail_out = sizeof(tmp_buf);
-        zs.next_out  = tmp_buf;
-
-        ret = inflate(&zs, Z_NO_FLUSH);
-        if (ret != Z_OK && ret != Z_STREAM_END) {
-            ret = AVERROR_UNKNOWN;
-            goto fail;
-        }
-
-        size = sizeof(tmp_buf) - zs.avail_out;
-        if (!(ptr = av_realloc(*out_data, *out_size + size))) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        *out_data = ptr;
-
-        memcpy(*out_data + *out_size, tmp_buf, size);
-        *out_size += size;
-    } while (zs.avail_out == 0);
-
-fail:
-    inflateEnd(&zs);
-    return ret;
-}
-#endif
-
-static int rtmp_calc_swfhash(URLContext *s)
-{
-    RTMPContext *rt = s->priv_data;
-    uint8_t *in_data = NULL, *out_data = NULL, *swfdata;
-    int64_t in_size, out_size;
-    URLContext *stream;
-    char swfhash[32];
-    int swfsize;
-    int ret = 0;
-
-    /* Get the SWF player file. */
-    if ((ret = ffurl_open(&stream, rt->swfverify, AVIO_FLAG_READ,
-                          &s->interrupt_callback, NULL)) < 0) {
-        av_log(s, AV_LOG_ERROR, "Cannot open connection %s.\n", rt->swfverify);
-        goto fail;
-    }
-
-    if ((in_size = ffurl_seek(stream, 0, AVSEEK_SIZE)) < 0) {
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-
-    if (!(in_data = av_malloc(in_size))) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    if ((ret = ffurl_read_complete(stream, in_data, in_size)) < 0)
-        goto fail;
-
-    if (in_size < 3) {
-        ret = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-
-    if (!memcmp(in_data, "CWS", 3)) {
-        /* Decompress the SWF player file using Zlib. */
-        if (!(out_data = av_malloc(8))) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        *in_data = 'F'; // magic stuff
-        memcpy(out_data, in_data, 8);
-        out_size = 8;
-
-#if CONFIG_ZLIB
-        if ((ret = rtmp_uncompress_swfplayer(in_data + 8, in_size - 8,
-                                             &out_data, &out_size)) < 0)
-            goto fail;
-#else
-        av_log(s, AV_LOG_ERROR,
-               "Zlib is required for decompressing the SWF player file.\n");
-        ret = AVERROR(EINVAL);
-        goto fail;
-#endif
-        swfsize = out_size;
-        swfdata = out_data;
-    } else {
-        swfsize = in_size;
-        swfdata = in_data;
-    }
-
-    /* Compute the SHA256 hash of the SWF player file. */
-    if ((ret = ff_rtmp_calc_digest(swfdata, swfsize, 0,
-                                   "Genuine Adobe Flash Player 001", 30,
-                                   swfhash)) < 0)
-        goto fail;
-
-    /* Set SWFVerification parameters. */
-    av_opt_set_bin(rt, "rtmp_swfhash", swfhash, 32, 0);
-    rt->swfsize = swfsize;
-
-fail:
-    av_freep(&in_data);
-    av_freep(&out_data);
-    ffurl_close(stream);
-    return ret;
-}
-
-/**
- * Perform handshake with the server by means of exchanging pseudorandom data
- * signed with HMAC-SHA2 digest.
- *
- * @return 0 if handshake succeeds, negative value otherwise
- */
-static int rtmp_handshake(URLContext *s, RTMPContext *rt)
-{
-    AVLFG rnd;
-    uint8_t tosend    [RTMP_HANDSHAKE_PACKET_SIZE+1] = {
-        3,                // unencrypted data
-        0, 0, 0, 0,       // client uptime
-        RTMP_CLIENT_VER1,
-        RTMP_CLIENT_VER2,
-        RTMP_CLIENT_VER3,
-        RTMP_CLIENT_VER4,
-    };
-    uint8_t clientdata[RTMP_HANDSHAKE_PACKET_SIZE];
-    uint8_t serverdata[RTMP_HANDSHAKE_PACKET_SIZE+1];
-    int i;
-    int server_pos, client_pos;
-    uint8_t digest[32], signature[32];
-    int ret, type = 0;
-
-    av_log(s, AV_LOG_DEBUG, "Handshaking...\n");
-
-    av_lfg_init(&rnd, 0xDEADC0DE);
-    // generate handshake packet - 1536 bytes of pseudorandom data
-    for (i = 9; i <= RTMP_HANDSHAKE_PACKET_SIZE; i++)
-        tosend[i] = av_lfg_get(&rnd) >> 24;
-
-    if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
-        /* When the client wants to use RTMPE, we have to change the command
-         * byte to 0x06 which means to use encrypted data and we have to set
-         * the flash version to at least 9.0.115.0. */
-        tosend[0] = 6;
-        tosend[5] = 128;
-        tosend[6] = 0;
-        tosend[7] = 3;
-        tosend[8] = 2;
-
-        /* Initialize the Diffie-Hellmann context and generate the public key
-         * to send to the server. */
-        if ((ret = ff_rtmpe_gen_pub_key(rt->stream, tosend + 1)) < 0)
-            return ret;
-    }
-
-    client_pos = rtmp_handshake_imprint_with_digest(tosend + 1, rt->encrypted);
-    if (client_pos < 0)
-        return client_pos;
-
-    if ((ret = ffurl_write(rt->stream, tosend,
-                           RTMP_HANDSHAKE_PACKET_SIZE + 1)) < 0) {
-        av_log(s, AV_LOG_ERROR, "Cannot write RTMP handshake request\n");
-        return ret;
-    }
-
-    if ((ret = ffurl_read_complete(rt->stream, serverdata,
-                                   RTMP_HANDSHAKE_PACKET_SIZE + 1)) < 0) {
-        av_log(s, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
-        return ret;
-    }
-
-    if ((ret = ffurl_read_complete(rt->stream, clientdata,
-                                   RTMP_HANDSHAKE_PACKET_SIZE)) < 0) {
-        av_log(s, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
-        return ret;
-    }
-
-    av_log(s, AV_LOG_DEBUG, "Type answer %d\n", serverdata[0]);
-    av_log(s, AV_LOG_DEBUG, "Server version %d.%d.%d.%d\n",
-           serverdata[5], serverdata[6], serverdata[7], serverdata[8]);
-
-    if (rt->is_input && serverdata[5] >= 3) {
-        server_pos = rtmp_validate_digest(serverdata + 1, 772);
-        if (server_pos < 0)
-            return server_pos;
-
-        if (!server_pos) {
-            type = 1;
-            server_pos = rtmp_validate_digest(serverdata + 1, 8);
-            if (server_pos < 0)
-                return server_pos;
-
-            if (!server_pos) {
-                av_log(s, AV_LOG_ERROR, "Server response validating failed\n");
-                return AVERROR(EIO);
-            }
-        }
-
-        /* Generate SWFVerification token (SHA256 HMAC hash of decompressed SWF,
-         * key are the last 32 bytes of the server handshake. */
-        if (rt->swfsize) {
-            if ((ret = rtmp_calc_swf_verification(s, rt, serverdata + 1 +
-                                                  RTMP_HANDSHAKE_PACKET_SIZE - 32)) < 0)
-                return ret;
-        }
-
-        ret = ff_rtmp_calc_digest(tosend + 1 + client_pos, 32, 0,
-                                  rtmp_server_key, sizeof(rtmp_server_key),
-                                  digest);
-        if (ret < 0)
-            return ret;
-
-        ret = ff_rtmp_calc_digest(clientdata, RTMP_HANDSHAKE_PACKET_SIZE - 32,
-                                  0, digest, 32, signature);
-        if (ret < 0)
-            return ret;
-
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
-            /* Compute the shared secret key sent by the server and initialize
-             * the RC4 encryption. */
-            if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
-                                                   tosend + 1, type)) < 0)
-                return ret;
-
-            /* Encrypt the signature received by the server. */
-            ff_rtmpe_encrypt_sig(rt->stream, signature, digest, serverdata[0]);
-        }
-
-        if (memcmp(signature, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) {
-            av_log(s, AV_LOG_ERROR, "Signature mismatch\n");
-            return AVERROR(EIO);
-        }
-
-        for (i = 0; i < RTMP_HANDSHAKE_PACKET_SIZE; i++)
-            tosend[i] = av_lfg_get(&rnd) >> 24;
-        ret = ff_rtmp_calc_digest(serverdata + 1 + server_pos, 32, 0,
-                                  rtmp_player_key, sizeof(rtmp_player_key),
-                                  digest);
-        if (ret < 0)
-            return ret;
-
-        ret = ff_rtmp_calc_digest(tosend, RTMP_HANDSHAKE_PACKET_SIZE - 32, 0,
-                                  digest, 32,
-                                  tosend + RTMP_HANDSHAKE_PACKET_SIZE - 32);
-        if (ret < 0)
-            return ret;
-
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
-            /* Encrypt the signature to be send to the server. */
-            ff_rtmpe_encrypt_sig(rt->stream, tosend +
-                                 RTMP_HANDSHAKE_PACKET_SIZE - 32, digest,
-                                 serverdata[0]);
-        }
-
-        // write reply back to the server
-        if ((ret = ffurl_write(rt->stream, tosend,
-                               RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
-            return ret;
-
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
-            /* Set RC4 keys for encryption and update the keystreams. */
-            if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
-                return ret;
-        }
-    } else {
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
-            /* Compute the shared secret key sent by the server and initialize
-             * the RC4 encryption. */
-            if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
-                            tosend + 1, 1)) < 0)
-                return ret;
-
-            if (serverdata[0] == 9) {
-                /* Encrypt the signature received by the server. */
-                ff_rtmpe_encrypt_sig(rt->stream, signature, digest,
-                                     serverdata[0]);
-            }
-        }
-
-        if ((ret = ffurl_write(rt->stream, serverdata + 1,
-                               RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
-            return ret;
-
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
-            /* Set RC4 keys for encryption and update the keystreams. */
-            if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
-                return ret;
-        }
-    }
-
-    return 0;
-}
-
-static int rtmp_receive_hs_packet(RTMPContext* rt, uint32_t *first_int,
-                                  uint32_t *second_int, char *arraydata,
-                                  int size)
-{
-    int inoutsize;
-
-    inoutsize = ffurl_read_complete(rt->stream, arraydata,
-                                    RTMP_HANDSHAKE_PACKET_SIZE);
-    if (inoutsize <= 0)
-        return AVERROR(EIO);
-    if (inoutsize != RTMP_HANDSHAKE_PACKET_SIZE) {
-        av_log(rt, AV_LOG_ERROR, "Erroneous Message size %d"
-               " not following standard\n", (int)inoutsize);
-        return AVERROR(EINVAL);
-    }
-
-    *first_int  = AV_RB32(arraydata);
-    *second_int = AV_RB32(arraydata + 4);
-    return 0;
-}
-
-static int rtmp_send_hs_packet(RTMPContext* rt, uint32_t first_int,
-                               uint32_t second_int, char *arraydata, int size)
-{
-    int inoutsize;
-
-    AV_WB32(arraydata, first_int);
-    AV_WB32(arraydata + 4, second_int);
-    inoutsize = ffurl_write(rt->stream, arraydata,
-                            RTMP_HANDSHAKE_PACKET_SIZE);
-    if (inoutsize != RTMP_HANDSHAKE_PACKET_SIZE) {
-        av_log(rt, AV_LOG_ERROR, "Unable to write answer\n");
-        return AVERROR(EIO);
-    }
-
-    return 0;
-}
-
-/**
- * rtmp handshake server side
- */
-static int rtmp_server_handshake(URLContext *s, RTMPContext *rt)
-{
-    uint8_t buffer[RTMP_HANDSHAKE_PACKET_SIZE];
-    uint32_t hs_epoch;
-    uint32_t hs_my_epoch;
-    uint8_t hs_c1[RTMP_HANDSHAKE_PACKET_SIZE];
-    uint8_t hs_s1[RTMP_HANDSHAKE_PACKET_SIZE];
-    uint32_t zeroes;
-    uint32_t temp       = 0;
-    int randomidx       = 0;
-    int inoutsize       = 0;
-    int ret;
-
-    inoutsize = ffurl_read_complete(rt->stream, buffer, 1);       // Receive C0
-    if (inoutsize <= 0) {
-        av_log(s, AV_LOG_ERROR, "Unable to read handshake\n");
-        return AVERROR(EIO);
-    }
-    // Check Version
-    if (buffer[0] != 3) {
-        av_log(s, AV_LOG_ERROR, "RTMP protocol version mismatch\n");
-        return AVERROR(EIO);
-    }
-    if (ffurl_write(rt->stream, buffer, 1) <= 0) {                 // Send S0
-        av_log(s, AV_LOG_ERROR,
-               "Unable to write answer - RTMP S0\n");
-        return AVERROR(EIO);
-    }
-    /* Receive C1 */
-    ret = rtmp_receive_hs_packet(rt, &hs_epoch, &zeroes, hs_c1,
-                                 RTMP_HANDSHAKE_PACKET_SIZE);
-    if (ret) {
-        av_log(s, AV_LOG_ERROR, "RTMP Handshake C1 Error\n");
-        return ret;
-    }
-    /* Send S1 */
-    /* By now same epoch will be sent */
-    hs_my_epoch = hs_epoch;
-    /* Generate random */
-    for (randomidx = 8; randomidx < (RTMP_HANDSHAKE_PACKET_SIZE);
-         randomidx += 4)
-        AV_WB32(hs_s1 + randomidx, av_get_random_seed());
-
-    ret = rtmp_send_hs_packet(rt, hs_my_epoch, 0, hs_s1,
-                              RTMP_HANDSHAKE_PACKET_SIZE);
-    if (ret) {
-        av_log(s, AV_LOG_ERROR, "RTMP Handshake S1 Error\n");
-        return ret;
-    }
-    /* Send S2 */
-    ret = rtmp_send_hs_packet(rt, hs_epoch, 0, hs_c1,
-                              RTMP_HANDSHAKE_PACKET_SIZE);
-    if (ret) {
-        av_log(s, AV_LOG_ERROR, "RTMP Handshake S2 Error\n");
-        return ret;
-    }
-    /* Receive C2 */
-    ret = rtmp_receive_hs_packet(rt, &temp, &zeroes, buffer,
-                                 RTMP_HANDSHAKE_PACKET_SIZE);
-    if (ret) {
-        av_log(s, AV_LOG_ERROR, "RTMP Handshake C2 Error\n");
-        return ret;
-    }
-    if (temp != hs_my_epoch)
-        av_log(s, AV_LOG_WARNING,
-               "Erroneous C2 Message epoch does not match up with C1 epoch\n");
-    if (memcmp(buffer + 8, hs_s1 + 8,
-               RTMP_HANDSHAKE_PACKET_SIZE - 8))
-        av_log(s, AV_LOG_WARNING,
-               "Erroneous C2 Message random does not match up\n");
-
-    return 0;
-}
-
-static int handle_chunk_size(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt = s->priv_data;
-    int ret;
-
-    if (pkt->size < 4) {
-        av_log(s, AV_LOG_ERROR,
-               "Too short chunk size change packet (%d)\n",
-               pkt->size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (!rt->is_input) {
-        /* Send the same chunk size change packet back to the server,
-         * setting the outgoing chunk size to the same as the incoming one. */
-        if ((ret = ff_rtmp_packet_write(rt->stream, pkt, rt->out_chunk_size,
-                                        &rt->prev_pkt[1], &rt->nb_prev_pkt[1])) < 0)
-            return ret;
-        rt->out_chunk_size = AV_RB32(pkt->data);
-    }
-
-    rt->in_chunk_size = AV_RB32(pkt->data);
-    if (rt->in_chunk_size <= 0) {
-        av_log(s, AV_LOG_ERROR, "Incorrect chunk size %d\n",
-               rt->in_chunk_size);
-        return AVERROR_INVALIDDATA;
-    }
-    av_log(s, AV_LOG_DEBUG, "New incoming chunk size = %d\n",
-           rt->in_chunk_size);
-
-    return 0;
-}
-
-static int handle_ping(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt = s->priv_data;
-    int t, ret;
-
-    if (pkt->size < 2) {
-        av_log(s, AV_LOG_ERROR, "Too short ping packet (%d)\n",
-               pkt->size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    t = AV_RB16(pkt->data);
-    if (t == 6) {
-        if ((ret = gen_pong(s, rt, pkt)) < 0)
-            return ret;
-    } else if (t == 26) {
-        if (rt->swfsize) {
-            if ((ret = gen_swf_verification(s, rt)) < 0)
-                return ret;
-        } else {
-            av_log(s, AV_LOG_WARNING, "Ignoring SWFVerification request.\n");
-        }
-    }
-
-    return 0;
-}
-
-static int handle_client_bw(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt = s->priv_data;
-
-    if (pkt->size < 4) {
-        av_log(s, AV_LOG_ERROR,
-               "Client bandwidth report packet is less than 4 bytes long (%d)\n",
-               pkt->size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    rt->client_report_size = AV_RB32(pkt->data);
-    if (rt->client_report_size <= 0) {
-        av_log(s, AV_LOG_ERROR, "Incorrect client bandwidth %d\n",
-                rt->client_report_size);
-        return AVERROR_INVALIDDATA;
-
-    }
-    av_log(s, AV_LOG_DEBUG, "Client bandwidth = %d\n", rt->client_report_size);
-    rt->client_report_size >>= 1;
-
-    return 0;
-}
-
-static int handle_server_bw(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt = s->priv_data;
-
-    if (pkt->size < 4) {
-        av_log(s, AV_LOG_ERROR,
-               "Too short server bandwidth report packet (%d)\n",
-               pkt->size);
-        return AVERROR_INVALIDDATA;
-    }
-
-    rt->server_bw = AV_RB32(pkt->data);
-    if (rt->server_bw <= 0) {
-        av_log(s, AV_LOG_ERROR, "Incorrect server bandwidth %d\n",
-               rt->server_bw);
-        return AVERROR_INVALIDDATA;
-    }
-    av_log(s, AV_LOG_DEBUG, "Server bandwidth = %d\n", rt->server_bw);
-
-    return 0;
-}
-
-static int do_adobe_auth(RTMPContext *rt, const char *user, const char *salt,
-                         const char *opaque, const char *challenge)
-{
-    uint8_t hash[16];
-    char hashstr[AV_BASE64_SIZE(sizeof(hash))], challenge2[10];
-    struct AVMD5 *md5 = av_md5_alloc();
-    if (!md5)
-        return AVERROR(ENOMEM);
-
-    snprintf(challenge2, sizeof(challenge2), "%08x", av_get_random_seed());
-
-    av_md5_init(md5);
-    av_md5_update(md5, user, strlen(user));
-    av_md5_update(md5, salt, strlen(salt));
-    av_md5_update(md5, rt->password, strlen(rt->password));
-    av_md5_final(md5, hash);
-    av_base64_encode(hashstr, sizeof(hashstr), hash,
-                     sizeof(hash));
-    av_md5_init(md5);
-    av_md5_update(md5, hashstr, strlen(hashstr));
-    if (opaque)
-        av_md5_update(md5, opaque, strlen(opaque));
-    else if (challenge)
-        av_md5_update(md5, challenge, strlen(challenge));
-    av_md5_update(md5, challenge2, strlen(challenge2));
-    av_md5_final(md5, hash);
-    av_base64_encode(hashstr, sizeof(hashstr), hash,
-                     sizeof(hash));
-    snprintf(rt->auth_params, sizeof(rt->auth_params),
-             "?authmod=%s&user=%s&challenge=%s&response=%s",
-             "adobe", user, challenge2, hashstr);
-    if (opaque)
-        av_strlcatf(rt->auth_params, sizeof(rt->auth_params),
-                    "&opaque=%s", opaque);
-
-    av_free(md5);
-    return 0;
-}
-
-static int do_llnw_auth(RTMPContext *rt, const char *user, const char *nonce)
-{
-    uint8_t hash[16];
-    char hashstr1[33], hashstr2[33];
-    const char *realm = "live";
-    const char *method = "publish";
-    const char *qop = "auth";
-    const char *nc = "00000001";
-    char cnonce[10];
-    struct AVMD5 *md5 = av_md5_alloc();
-    if (!md5)
-        return AVERROR(ENOMEM);
-
-    snprintf(cnonce, sizeof(cnonce), "%08x", av_get_random_seed());
-
-    av_md5_init(md5);
-    av_md5_update(md5, user, strlen(user));
-    av_md5_update(md5, ":", 1);
-    av_md5_update(md5, realm, strlen(realm));
-    av_md5_update(md5, ":", 1);
-    av_md5_update(md5, rt->password, strlen(rt->password));
-    av_md5_final(md5, hash);
-    ff_data_to_hex(hashstr1, hash, 16, 1);
-    hashstr1[32] = '\0';
-
-    av_md5_init(md5);
-    av_md5_update(md5, method, strlen(method));
-    av_md5_update(md5, ":/", 2);
-    av_md5_update(md5, rt->app, strlen(rt->app));
-    if (!strchr(rt->app, '/'))
-        av_md5_update(md5, "/_definst_", strlen("/_definst_"));
-    av_md5_final(md5, hash);
-    ff_data_to_hex(hashstr2, hash, 16, 1);
-    hashstr2[32] = '\0';
-
-    av_md5_init(md5);
-    av_md5_update(md5, hashstr1, strlen(hashstr1));
-    av_md5_update(md5, ":", 1);
-    if (nonce)
-        av_md5_update(md5, nonce, strlen(nonce));
-    av_md5_update(md5, ":", 1);
-    av_md5_update(md5, nc, strlen(nc));
-    av_md5_update(md5, ":", 1);
-    av_md5_update(md5, cnonce, strlen(cnonce));
-    av_md5_update(md5, ":", 1);
-    av_md5_update(md5, qop, strlen(qop));
-    av_md5_update(md5, ":", 1);
-    av_md5_update(md5, hashstr2, strlen(hashstr2));
-    av_md5_final(md5, hash);
-    ff_data_to_hex(hashstr1, hash, 16, 1);
-
-    snprintf(rt->auth_params, sizeof(rt->auth_params),
-             "?authmod=%s&user=%s&nonce=%s&cnonce=%s&nc=%s&response=%s",
-             "llnw", user, nonce, cnonce, nc, hashstr1);
-
-    av_free(md5);
-    return 0;
-}
-
-static int handle_connect_error(URLContext *s, const char *desc)
-{
-    RTMPContext *rt = s->priv_data;
-    char buf[300], *ptr, authmod[15];
-    int i = 0, ret = 0;
-    const char *user = "", *salt = "", *opaque = NULL,
-               *challenge = NULL, *cptr = NULL, *nonce = NULL;
-
-    if (!(cptr = strstr(desc, "authmod=adobe")) &&
-        !(cptr = strstr(desc, "authmod=llnw"))) {
-        av_log(s, AV_LOG_ERROR,
-               "Unknown connect error (unsupported authentication method?)\n");
-        return AVERROR_UNKNOWN;
-    }
-    cptr += strlen("authmod=");
-    while (*cptr && *cptr != ' ' && i < sizeof(authmod) - 1)
-        authmod[i++] = *cptr++;
-    authmod[i] = '\0';
-
-    if (!rt->username[0] || !rt->password[0]) {
-        av_log(s, AV_LOG_ERROR, "No credentials set\n");
-        return AVERROR_UNKNOWN;
-    }
-
-    if (strstr(desc, "?reason=authfailed")) {
-        av_log(s, AV_LOG_ERROR, "Incorrect username/password\n");
-        return AVERROR_UNKNOWN;
-    } else if (strstr(desc, "?reason=nosuchuser")) {
-        av_log(s, AV_LOG_ERROR, "Incorrect username\n");
-        return AVERROR_UNKNOWN;
-    }
-
-    if (rt->auth_tried) {
-        av_log(s, AV_LOG_ERROR, "Authentication failed\n");
-        return AVERROR_UNKNOWN;
-    }
-
-    rt->auth_params[0] = '\0';
-
-    if (strstr(desc, "code=403 need auth")) {
-        snprintf(rt->auth_params, sizeof(rt->auth_params),
-                 "?authmod=%s&user=%s", authmod, rt->username);
-        return 0;
-    }
-
-    if (!(cptr = strstr(desc, "?reason=needauth"))) {
-        av_log(s, AV_LOG_ERROR, "No auth parameters found\n");
-        return AVERROR_UNKNOWN;
-    }
-
-    av_strlcpy(buf, cptr + 1, sizeof(buf));
-    ptr = buf;
-
-    while (ptr) {
-        char *next  = strchr(ptr, '&');
-        char *value = strchr(ptr, '=');
-        if (next)
-            *next++ = '\0';
-        if (value)
-            *value++ = '\0';
-        if (!strcmp(ptr, "user")) {
-            user = value;
-        } else if (!strcmp(ptr, "salt")) {
-            salt = value;
-        } else if (!strcmp(ptr, "opaque")) {
-            opaque = value;
-        } else if (!strcmp(ptr, "challenge")) {
-            challenge = value;
-        } else if (!strcmp(ptr, "nonce")) {
-            nonce = value;
-        }
-        ptr = next;
-    }
-
-    if (!strcmp(authmod, "adobe")) {
-        if ((ret = do_adobe_auth(rt, user, salt, opaque, challenge)) < 0)
-            return ret;
-    } else {
-        if ((ret = do_llnw_auth(rt, user, nonce)) < 0)
-            return ret;
-    }
-
-    rt->auth_tried = 1;
-    return 0;
-}
-
-static int handle_invoke_error(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt = s->priv_data;
-    const uint8_t *data_end = pkt->data + pkt->size;
-    char *tracked_method = NULL;
-    int level = AV_LOG_ERROR;
-    uint8_t tmpstr[256];
-    int ret;
-
-    if ((ret = find_tracked_method(s, pkt, 9, &tracked_method)) < 0)
-        return ret;
-
-    if (!ff_amf_get_field_value(pkt->data + 9, data_end,
-                                "description", tmpstr, sizeof(tmpstr))) {
-        if (tracked_method && (!strcmp(tracked_method, "_checkbw")      ||
-                               !strcmp(tracked_method, "releaseStream") ||
-                               !strcmp(tracked_method, "FCSubscribe")   ||
-                               !strcmp(tracked_method, "FCPublish"))) {
-            /* Gracefully ignore Adobe-specific historical artifact errors. */
-            level = AV_LOG_WARNING;
-            ret = 0;
-        } else if (tracked_method && !strcmp(tracked_method, "connect")) {
-            ret = handle_connect_error(s, tmpstr);
-            if (!ret) {
-                rt->do_reconnect = 1;
-                level = AV_LOG_VERBOSE;
-            }
-        } else
-            ret = AVERROR_UNKNOWN;
-        av_log(s, level, "Server error: %s\n", tmpstr);
-    }
-
-    av_free(tracked_method);
-    return ret;
-}
-
-static int write_begin(URLContext *s)
-{
-    RTMPContext *rt = s->priv_data;
-    PutByteContext pbc;
-    RTMPPacket spkt = { 0 };
-    int ret;
-
-    // Send Stream Begin 1
-    if ((ret = ff_rtmp_packet_create(&spkt, RTMP_NETWORK_CHANNEL,
-                                     RTMP_PT_PING, 0, 6)) < 0) {
-        av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");
-        return ret;
-    }
-
-    bytestream2_init_writer(&pbc, spkt.data, spkt.size);
-    bytestream2_put_be16(&pbc, 0);          // 0 -> Stream Begin
-    bytestream2_put_be32(&pbc, rt->nb_streamid);
-
-    ret = ff_rtmp_packet_write(rt->stream, &spkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-
-    ff_rtmp_packet_destroy(&spkt);
-
-    return ret;
-}
-
-static int write_status(URLContext *s, RTMPPacket *pkt,
-                        const char *status, const char *filename)
-{
-    RTMPContext *rt = s->priv_data;
-    RTMPPacket spkt = { 0 };
-    char statusmsg[128];
-    uint8_t *pp;
-    int ret;
-
-    if ((ret = ff_rtmp_packet_create(&spkt, RTMP_SYSTEM_CHANNEL,
-                                     RTMP_PT_INVOKE, 0,
-                                     RTMP_PKTDATA_DEFAULT_SIZE)) < 0) {
-        av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");
-        return ret;
-    }
-
-    pp = spkt.data;
-    spkt.extra = pkt->extra;
-    ff_amf_write_string(&pp, "onStatus");
-    ff_amf_write_number(&pp, 0);
-    ff_amf_write_null(&pp);
-
-    ff_amf_write_object_start(&pp);
-    ff_amf_write_field_name(&pp, "level");
-    ff_amf_write_string(&pp, "status");
-    ff_amf_write_field_name(&pp, "code");
-    ff_amf_write_string(&pp, status);
-    ff_amf_write_field_name(&pp, "description");
-    snprintf(statusmsg, sizeof(statusmsg),
-             "%s is now published", filename);
-    ff_amf_write_string(&pp, statusmsg);
-    ff_amf_write_field_name(&pp, "details");
-    ff_amf_write_string(&pp, filename);
-    ff_amf_write_field_name(&pp, "clientid");
-    snprintf(statusmsg, sizeof(statusmsg), "%s", LIBAVFORMAT_IDENT);
-    ff_amf_write_string(&pp, statusmsg);
-    ff_amf_write_object_end(&pp);
-
-    spkt.size = pp - spkt.data;
-    ret = ff_rtmp_packet_write(rt->stream, &spkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-    ff_rtmp_packet_destroy(&spkt);
-
-    return ret;
-}
-
-static int send_invoke_response(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt = s->priv_data;
-    double seqnum;
-    char filename[64];
-    char command[64];
-    int stringlen;
-    char *pchar;
-    const uint8_t *p = pkt->data;
-    uint8_t *pp      = NULL;
-    RTMPPacket spkt  = { 0 };
-    GetByteContext gbc;
-    int ret;
-
-    bytestream2_init(&gbc, p, pkt->size);
-    if (ff_amf_read_string(&gbc, command, sizeof(command),
-                           &stringlen)) {
-        av_log(s, AV_LOG_ERROR, "Error in PT_INVOKE\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ret = ff_amf_read_number(&gbc, &seqnum);
-    if (ret)
-        return ret;
-    ret = ff_amf_read_null(&gbc);
-    if (ret)
-        return ret;
-    if (!strcmp(command, "FCPublish") ||
-        !strcmp(command, "publish")) {
-        ret = ff_amf_read_string(&gbc, filename,
-                                 sizeof(filename), &stringlen);
-        // check with url
-        if (s->filename) {
-            pchar = strrchr(s->filename, '/');
-            if (!pchar) {
-                av_log(s, AV_LOG_WARNING,
-                       "Unable to find / in url %s, bad format\n",
-                       s->filename);
-                pchar = s->filename;
-            }
-            pchar++;
-            if (strcmp(pchar, filename))
-                av_log(s, AV_LOG_WARNING, "Unexpected stream %s, expecting"
-                       " %s\n", filename, pchar);
-        }
-        rt->state = STATE_RECEIVING;
-    }
-
-    if (!strcmp(command, "FCPublish")) {
-        if ((ret = ff_rtmp_packet_create(&spkt, RTMP_SYSTEM_CHANNEL,
-                                         RTMP_PT_INVOKE, 0,
-                                         RTMP_PKTDATA_DEFAULT_SIZE)) < 0) {
-            av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");
-            return ret;
-        }
-        pp = spkt.data;
-        ff_amf_write_string(&pp, "onFCPublish");
-    } else if (!strcmp(command, "publish")) {
-        ret = write_begin(s);
-        if (ret < 0)
-            return ret;
-
-        // Send onStatus(NetStream.Publish.Start)
-        return write_status(s, pkt, "NetStream.Publish.Start",
-                           filename);
-    } else if (!strcmp(command, "play")) {
-        ret = write_begin(s);
-        if (ret < 0)
-            return ret;
-        rt->state = STATE_SENDING;
-        return write_status(s, pkt, "NetStream.Play.Start",
-                            filename);
-    } else {
-        if ((ret = ff_rtmp_packet_create(&spkt, RTMP_SYSTEM_CHANNEL,
-                                         RTMP_PT_INVOKE, 0,
-                                         RTMP_PKTDATA_DEFAULT_SIZE)) < 0) {
-            av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");
-            return ret;
-        }
-        pp = spkt.data;
-        ff_amf_write_string(&pp, "_result");
-        ff_amf_write_number(&pp, seqnum);
-        ff_amf_write_null(&pp);
-        if (!strcmp(command, "createStream")) {
-            rt->nb_streamid++;
-            if (rt->nb_streamid == 0 || rt->nb_streamid == 2)
-                rt->nb_streamid++; /* Values 0 and 2 are reserved */
-            ff_amf_write_number(&pp, rt->nb_streamid);
-            /* By now we don't control which streams are removed in
-             * deleteStream. There is no stream creation control
-             * if a client creates more than 2^32 - 2 streams. */
-        }
-    }
-    spkt.size = pp - spkt.data;
-    ret = ff_rtmp_packet_write(rt->stream, &spkt, rt->out_chunk_size,
-                               &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
-    ff_rtmp_packet_destroy(&spkt);
-    return ret;
-}
-
-static int handle_invoke_result(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt = s->priv_data;
-    char *tracked_method = NULL;
-    int ret = 0;
-
-    if ((ret = find_tracked_method(s, pkt, 10, &tracked_method)) < 0)
-        return ret;
-
-    if (!tracked_method) {
-        /* Ignore this reply when the current method is not tracked. */
-        return ret;
-    }
-
-    if (!strcmp(tracked_method, "connect")) {
-        if (!rt->is_input) {
-            if ((ret = gen_release_stream(s, rt)) < 0)
-                goto fail;
-
-            if ((ret = gen_fcpublish_stream(s, rt)) < 0)
-                goto fail;
-        } else {
-            if ((ret = gen_server_bw(s, rt)) < 0)
-                goto fail;
-        }
-
-        if ((ret = gen_create_stream(s, rt)) < 0)
-            goto fail;
-
-        if (rt->is_input) {
-            /* Send the FCSubscribe command when the name of live
-             * stream is defined by the user or if it's a live stream. */
-            if (rt->subscribe) {
-                if ((ret = gen_fcsubscribe_stream(s, rt, rt->subscribe)) < 0)
-                    goto fail;
-            } else if (rt->live == -1) {
-                if ((ret = gen_fcsubscribe_stream(s, rt, rt->playpath)) < 0)
-                    goto fail;
-            }
-        }
-    } else if (!strcmp(tracked_method, "createStream")) {
-        //extract a number from the result
-        if (pkt->data[10] || pkt->data[19] != 5 || pkt->data[20]) {
-            av_log(s, AV_LOG_WARNING, "Unexpected reply on connect()\n");
-        } else {
-            rt->stream_id = av_int2double(AV_RB64(pkt->data + 21));
-        }
-
-        if (!rt->is_input) {
-            if ((ret = gen_publish(s, rt)) < 0)
-                goto fail;
-        } else {
-            if ((ret = gen_play(s, rt)) < 0)
-                goto fail;
-            if ((ret = gen_buffer_time(s, rt)) < 0)
-                goto fail;
-        }
-    }
-
-fail:
-    av_free(tracked_method);
-    return ret;
-}
-
-static int handle_invoke_status(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt = s->priv_data;
-    const uint8_t *data_end = pkt->data + pkt->size;
-    const uint8_t *ptr = pkt->data + RTMP_HEADER;
-    uint8_t tmpstr[256];
-    int i, t;
-
-    for (i = 0; i < 2; i++) {
-        t = ff_amf_tag_size(ptr, data_end);
-        if (t < 0)
-            return 1;
-        ptr += t;
-    }
-
-    t = ff_amf_get_field_value(ptr, data_end, "level", tmpstr, sizeof(tmpstr));
-    if (!t && !strcmp(tmpstr, "error")) {
-        t = ff_amf_get_field_value(ptr, data_end,
-                                   "description", tmpstr, sizeof(tmpstr));
-        if (t || !tmpstr[0])
-            t = ff_amf_get_field_value(ptr, data_end, "code",
-                                       tmpstr, sizeof(tmpstr));
-        if (!t)
-            av_log(s, AV_LOG_ERROR, "Server error: %s\n", tmpstr);
-        return -1;
-    }
-
-    t = ff_amf_get_field_value(ptr, data_end, "code", tmpstr, sizeof(tmpstr));
-    if (!t && !strcmp(tmpstr, "NetStream.Play.Start")) rt->state = STATE_PLAYING;
-    if (!t && !strcmp(tmpstr, "NetStream.Play.Stop")) rt->state = STATE_STOPPED;
-    if (!t && !strcmp(tmpstr, "NetStream.Play.UnpublishNotify")) rt->state = STATE_STOPPED;
-    if (!t && !strcmp(tmpstr, "NetStream.Publish.Start")) rt->state = STATE_PUBLISHING;
-    if (!t && !strcmp(tmpstr, "NetStream.Seek.Notify")) rt->state = STATE_PLAYING;
-
-    return 0;
-}
-
-static int handle_invoke(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt = s->priv_data;
-    int ret = 0;
-
-    //TODO: check for the messages sent for wrong state?
-    if (ff_amf_match_string(pkt->data, pkt->size, "_error")) {
-        if ((ret = handle_invoke_error(s, pkt)) < 0)
-            return ret;
-    } else if (ff_amf_match_string(pkt->data, pkt->size, "_result")) {
-        if ((ret = handle_invoke_result(s, pkt)) < 0)
-            return ret;
-    } else if (ff_amf_match_string(pkt->data, pkt->size, "onStatus")) {
-        if ((ret = handle_invoke_status(s, pkt)) < 0)
-            return ret;
-    } else if (ff_amf_match_string(pkt->data, pkt->size, "onBWDone")) {
-        if ((ret = gen_check_bw(s, rt)) < 0)
-            return ret;
-    } else if (ff_amf_match_string(pkt->data, pkt->size, "releaseStream") ||
-               ff_amf_match_string(pkt->data, pkt->size, "FCPublish")     ||
-               ff_amf_match_string(pkt->data, pkt->size, "publish")       ||
-               ff_amf_match_string(pkt->data, pkt->size, "play")          ||
-               ff_amf_match_string(pkt->data, pkt->size, "_checkbw")      ||
-               ff_amf_match_string(pkt->data, pkt->size, "createStream")) {
-        if ((ret = send_invoke_response(s, pkt)) < 0)
-            return ret;
-    }
-
-    return ret;
-}
-
-static int update_offset(RTMPContext *rt, int size)
-{
-    int old_flv_size;
-
-    // generate packet header and put data into buffer for FLV demuxer
-    if (rt->flv_off < rt->flv_size) {
-        // There is old unread data in the buffer, thus append at the end
-        old_flv_size  = rt->flv_size;
-        rt->flv_size += size;
-    } else {
-        // All data has been read, write the new data at the start of the buffer
-        old_flv_size = 0;
-        rt->flv_size = size;
-        rt->flv_off  = 0;
-    }
-
-    return old_flv_size;
-}
-
-static int append_flv_data(RTMPContext *rt, RTMPPacket *pkt, int skip)
-{
-    int old_flv_size, ret;
-    PutByteContext pbc;
-    const uint8_t *data = pkt->data + skip;
-    const int size      = pkt->size - skip;
-    uint32_t ts         = pkt->timestamp;
-
-    old_flv_size = update_offset(rt, size + 15);
-
-    if ((ret = av_reallocp(&rt->flv_data, rt->flv_size)) < 0) {
-        rt->flv_size = rt->flv_off = 0;
-        return ret;
-    }
-    bytestream2_init_writer(&pbc, rt->flv_data, rt->flv_size);
-    bytestream2_skip_p(&pbc, old_flv_size);
-    bytestream2_put_byte(&pbc, pkt->type);
-    bytestream2_put_be24(&pbc, size);
-    bytestream2_put_be24(&pbc, ts);
-    bytestream2_put_byte(&pbc, ts >> 24);
-    bytestream2_put_be24(&pbc, 0);
-    bytestream2_put_buffer(&pbc, data, size);
-    bytestream2_put_be32(&pbc, 0);
-
-    return 0;
-}
-
-static int handle_notify(URLContext *s, RTMPPacket *pkt)
-{
-    RTMPContext *rt  = s->priv_data;
-    uint8_t commandbuffer[64];
-    char statusmsg[128];
-    int stringlen, ret, skip = 0;
-    GetByteContext gbc;
-
-    bytestream2_init(&gbc, pkt->data, pkt->size);
-    if (ff_amf_read_string(&gbc, commandbuffer, sizeof(commandbuffer),
-                           &stringlen))
-        return AVERROR_INVALIDDATA;
-
-    // Skip the @setDataFrame string and validate it is a notification
-    if (!strcmp(commandbuffer, "@setDataFrame")) {
-        skip = gbc.buffer - pkt->data;
-        ret = ff_amf_read_string(&gbc, statusmsg,
-                                 sizeof(statusmsg), &stringlen);
-        if (ret < 0)
-            return AVERROR_INVALIDDATA;
-    }
-
-    return append_flv_data(rt, pkt, skip);
-}
-
-/**
- * Parse received packet and possibly perform some action depending on
- * the packet contents.
- * @return 0 for no errors, negative values for serious errors which prevent
- *         further communications, positive values for uncritical errors
- */
-static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
-{
-    int ret;
-
-#ifdef DEBUG
-    ff_rtmp_packet_dump(s, pkt);
-#endif
-
-    switch (pkt->type) {
-    case RTMP_PT_BYTES_READ:
-        av_dlog(s, "received bytes read report\n");
-        break;
-    case RTMP_PT_CHUNK_SIZE:
-        if ((ret = handle_chunk_size(s, pkt)) < 0)
-            return ret;
-        break;
-    case RTMP_PT_PING:
-        if ((ret = handle_ping(s, pkt)) < 0)
-            return ret;
-        break;
-    case RTMP_PT_CLIENT_BW:
-        if ((ret = handle_client_bw(s, pkt)) < 0)
-            return ret;
-        break;
-    case RTMP_PT_SERVER_BW:
-        if ((ret = handle_server_bw(s, pkt)) < 0)
-            return ret;
-        break;
-    case RTMP_PT_INVOKE:
-        if ((ret = handle_invoke(s, pkt)) < 0)
-            return ret;
-        break;
-    case RTMP_PT_VIDEO:
-    case RTMP_PT_AUDIO:
-    case RTMP_PT_METADATA:
-    case RTMP_PT_NOTIFY:
-        /* Audio, Video and Metadata packets are parsed in get_packet() */
-        break;
-    default:
-        av_log(s, AV_LOG_VERBOSE, "Unknown packet type received 0x%02X\n", pkt->type);
-        break;
-    }
-    return 0;
-}
-
-static int handle_metadata(RTMPContext *rt, RTMPPacket *pkt)
-{
-    int ret, old_flv_size, type;
-    const uint8_t *next;
-    uint8_t *p;
-    uint32_t size;
-    uint32_t ts, cts, pts = 0;
-
-    old_flv_size = update_offset(rt, pkt->size);
-
-    if ((ret = av_reallocp(&rt->flv_data, rt->flv_size)) < 0) {
-        rt->flv_size = rt->flv_off = 0;
-        return ret;
-    }
-
-    next = pkt->data;
-    p    = rt->flv_data + old_flv_size;
-
-    /* copy data while rewriting timestamps */
-    ts = pkt->timestamp;
-
-    while (next - pkt->data < pkt->size - RTMP_HEADER) {
-        type = bytestream_get_byte(&next);
-        size = bytestream_get_be24(&next);
-        cts  = bytestream_get_be24(&next);
-        cts |= bytestream_get_byte(&next) << 24;
-        if (!pts)
-            pts = cts;
-        ts += cts - pts;
-        pts = cts;
-        if (size + 3 + 4 > pkt->data + pkt->size - next)
-            break;
-        bytestream_put_byte(&p, type);
-        bytestream_put_be24(&p, size);
-        bytestream_put_be24(&p, ts);
-        bytestream_put_byte(&p, ts >> 24);
-        memcpy(p, next, size + 3 + 4);
-        next += size + 3 + 4;
-        p    += size + 3 + 4;
-    }
-    if (p != rt->flv_data + rt->flv_size) {
-        av_log(NULL, AV_LOG_WARNING, "Incomplete flv packets in "
-                                     "RTMP_PT_METADATA packet\n");
-        rt->flv_size = p - rt->flv_data;
-    }
-
-    return 0;
-}
-
-/**
- * Interact with the server by receiving and sending RTMP packets until
- * there is some significant data (media data or expected status notification).
- *
- * @param s          reading context
- * @param for_header non-zero value tells function to work until it
- * gets notification from the server that playing has been started,
- * otherwise function will work until some media data is received (or
- * an error happens)
- * @return 0 for successful operation, negative value in case of error
- */
-static int get_packet(URLContext *s, int for_header)
-{
-    RTMPContext *rt = s->priv_data;
-    int ret;
-
-    if (rt->state == STATE_STOPPED)
-        return AVERROR_EOF;
-
-    for (;;) {
-        RTMPPacket rpkt = { 0 };
-        if ((ret = ff_rtmp_packet_read(rt->stream, &rpkt,
-                                       rt->in_chunk_size, &rt->prev_pkt[0],
-                                       &rt->nb_prev_pkt[0])) <= 0) {
-            if (ret == 0) {
-                return AVERROR(EAGAIN);
-            } else {
-                return AVERROR(EIO);
-            }
-        }
-        rt->bytes_read += ret;
-        if (rt->bytes_read > rt->last_bytes_read + rt->client_report_size) {
-            av_log(s, AV_LOG_DEBUG, "Sending bytes read report\n");
-            if ((ret = gen_bytes_read(s, rt, rpkt.timestamp + 1)) < 0)
-                return ret;
-            rt->last_bytes_read = rt->bytes_read;
-        }
-
-        ret = rtmp_parse_result(s, rt, &rpkt);
-
-        // At this point we must check if we are in the seek state and continue
-        // with the next packet. handle_invoke will get us out of this state
-        // when the right message is encountered
-        if (rt->state == STATE_SEEKING) {
-            ff_rtmp_packet_destroy(&rpkt);
-            // We continue, let the natural flow of things happen:
-            // AVERROR(EAGAIN) or handle_invoke gets us out of here
-            continue;
-        }
-
-        if (ret < 0) {//serious error in current packet
-            ff_rtmp_packet_destroy(&rpkt);
-            return ret;
-        }
-        if (rt->do_reconnect && for_header) {
-            ff_rtmp_packet_destroy(&rpkt);
-            return 0;
-        }
-        if (rt->state == STATE_STOPPED) {
-            ff_rtmp_packet_destroy(&rpkt);
-            return AVERROR_EOF;
-        }
-        if (for_header && (rt->state == STATE_PLAYING    ||
-                           rt->state == STATE_PUBLISHING ||
-                           rt->state == STATE_SENDING    ||
-                           rt->state == STATE_RECEIVING)) {
-            ff_rtmp_packet_destroy(&rpkt);
-            return 0;
-        }
-        if (!rpkt.size || !rt->is_input) {
-            ff_rtmp_packet_destroy(&rpkt);
-            continue;
-        }
-        if (rpkt.type == RTMP_PT_VIDEO || rpkt.type == RTMP_PT_AUDIO) {
-            ret = append_flv_data(rt, &rpkt, 0);
-            ff_rtmp_packet_destroy(&rpkt);
-            return ret;
-        } else if (rpkt.type == RTMP_PT_NOTIFY) {
-            ret = handle_notify(s, &rpkt);
-            ff_rtmp_packet_destroy(&rpkt);
-            return ret;
-        } else if (rpkt.type == RTMP_PT_METADATA) {
-            ret = handle_metadata(rt, &rpkt);
-            ff_rtmp_packet_destroy(&rpkt);
-            return 0;
-        }
-        ff_rtmp_packet_destroy(&rpkt);
-    }
-}
-
-static int rtmp_close(URLContext *h)
-{
-    RTMPContext *rt = h->priv_data;
-    int ret = 0, i, j;
-
-    if (!rt->is_input) {
-        rt->flv_data = NULL;
-        if (rt->out_pkt.size)
-            ff_rtmp_packet_destroy(&rt->out_pkt);
-        if (rt->state > STATE_FCPUBLISH)
-            ret = gen_fcunpublish_stream(h, rt);
-    }
-    if (rt->state > STATE_HANDSHAKED)
-        ret = gen_delete_stream(h, rt);
-    for (i = 0; i < 2; i++) {
-        for (j = 0; j < rt->nb_prev_pkt[i]; j++)
-            ff_rtmp_packet_destroy(&rt->prev_pkt[i][j]);
-        av_freep(&rt->prev_pkt[i]);
-    }
-
-    free_tracked_methods(rt);
-    av_freep(&rt->flv_data);
-    ffurl_close(rt->stream);
-    return ret;
-}
-
-/**
- * Open RTMP connection and verify that the stream can be played.
- *
- * URL syntax: rtmp://server[:port][/app][/playpath]
- *             where 'app' is first one or two directories in the path
- *             (e.g. /ondemand/, /flash/live/, etc.)
- *             and 'playpath' is a file name (the rest of the path,
- *             may be prefixed with "mp4:")
- */
-static int rtmp_open(URLContext *s, const char *uri, int flags)
-{
-    RTMPContext *rt = s->priv_data;
-    char proto[8], hostname[256], path[1024], auth[100], *fname;
-    char *old_app;
-    uint8_t buf[2048];
-    int port;
-    AVDictionary *opts = NULL;
-    int ret;
-
-    if (rt->listen_timeout > 0)
-        rt->listen = 1;
-
-    rt->is_input = !(flags & AVIO_FLAG_WRITE);
-
-    av_url_split(proto, sizeof(proto), auth, sizeof(auth),
-                 hostname, sizeof(hostname), &port,
-                 path, sizeof(path), s->filename);
-
-    if (strchr(path, ' ')) {
-        av_log(s, AV_LOG_WARNING,
-               "Detected librtmp style URL parameters, these aren't supported "
-               "by the libavformat internal RTMP handler currently enabled. "
-               "See the documentation for the correct way to pass parameters.\n");
-    }
-
-    if (auth[0]) {
-        char *ptr = strchr(auth, ':');
-        if (ptr) {
-            *ptr = '\0';
-            av_strlcpy(rt->username, auth, sizeof(rt->username));
-            av_strlcpy(rt->password, ptr + 1, sizeof(rt->password));
-        }
-    }
-
-    if (rt->listen && strcmp(proto, "rtmp")) {
-        av_log(s, AV_LOG_ERROR, "rtmp_listen not available for %s\n",
-               proto);
-        return AVERROR(EINVAL);
-    }
-    if (!strcmp(proto, "rtmpt") || !strcmp(proto, "rtmpts")) {
-        if (!strcmp(proto, "rtmpts"))
-            av_dict_set(&opts, "ffrtmphttp_tls", "1", 1);
-
-        /* open the http tunneling connection */
-        ff_url_join(buf, sizeof(buf), "ffrtmphttp", NULL, hostname, port, NULL);
-    } else if (!strcmp(proto, "rtmps")) {
-        /* open the tls connection */
-        if (port < 0)
-            port = RTMPS_DEFAULT_PORT;
-        ff_url_join(buf, sizeof(buf), "tls", NULL, hostname, port, NULL);
-    } else if (!strcmp(proto, "rtmpe") || (!strcmp(proto, "rtmpte"))) {
-        if (!strcmp(proto, "rtmpte"))
-            av_dict_set(&opts, "ffrtmpcrypt_tunneling", "1", 1);
-
-        /* open the encrypted connection */
-        ff_url_join(buf, sizeof(buf), "ffrtmpcrypt", NULL, hostname, port, NULL);
-        rt->encrypted = 1;
-    } else {
-        /* open the tcp connection */
-        if (port < 0)
-            port = RTMP_DEFAULT_PORT;
-        if (rt->listen)
-            ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port,
-                        "?listen&listen_timeout=%d",
-                        rt->listen_timeout * 1000);
-        else
-            ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
-    }
-
-reconnect:
-    if ((ret = ffurl_open(&rt->stream, buf, AVIO_FLAG_READ_WRITE,
-                          &s->interrupt_callback, &opts)) < 0) {
-        av_log(s , AV_LOG_ERROR, "Cannot open connection %s\n", buf);
-        goto fail;
-    }
-
-    if (rt->swfverify) {
-        if ((ret = rtmp_calc_swfhash(s)) < 0)
-            goto fail;
-    }
-
-    rt->state = STATE_START;
-    if (!rt->listen && (ret = rtmp_handshake(s, rt)) < 0)
-        goto fail;
-    if (rt->listen && (ret = rtmp_server_handshake(s, rt)) < 0)
-        goto fail;
-
-    rt->out_chunk_size = 128;
-    rt->in_chunk_size  = 128; // Probably overwritten later
-    rt->state = STATE_HANDSHAKED;
-
-    // Keep the application name when it has been defined by the user.
-    old_app = rt->app;
-
-    rt->app = av_malloc(APP_MAX_LENGTH);
-    if (!rt->app) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    //extract "app" part from path
-    if (!strncmp(path, "/ondemand/", 10)) {
-        fname = path + 10;
-        memcpy(rt->app, "ondemand", 9);
-    } else {
-        char *next = *path ? path + 1 : path;
-        char *p = strchr(next, '/');
-        if (!p) {
-            fname = next;
-            rt->app[0] = '\0';
-        } else {
-            // make sure we do not mismatch a playpath for an application instance
-            char *c = strchr(p + 1, ':');
-            fname = strchr(p + 1, '/');
-            if (!fname || (c && c < fname)) {
-                fname = p + 1;
-                av_strlcpy(rt->app, path + 1, FFMIN(p - path, APP_MAX_LENGTH));
-            } else {
-                fname++;
-                av_strlcpy(rt->app, path + 1, FFMIN(fname - path - 1, APP_MAX_LENGTH));
-            }
-        }
-    }
-
-    if (old_app) {
-        // The name of application has been defined by the user, override it.
-        av_free(rt->app);
-        rt->app = old_app;
-    }
-
-    if (!rt->playpath) {
-        int len = strlen(fname);
-
-        rt->playpath = av_malloc(PLAYPATH_MAX_LENGTH);
-        if (!rt->playpath) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        if (!strchr(fname, ':') && len >= 4 &&
-            (!strcmp(fname + len - 4, ".f4v") ||
-             !strcmp(fname + len - 4, ".mp4"))) {
-            memcpy(rt->playpath, "mp4:", 5);
-        } else {
-            if (len >= 4 && !strcmp(fname + len - 4, ".flv"))
-                fname[len - 4] = '\0';
-            rt->playpath[0] = 0;
-        }
-        av_strlcat(rt->playpath, fname, PLAYPATH_MAX_LENGTH);
-    }
-
-    if (!rt->tcurl) {
-        rt->tcurl = av_malloc(TCURL_MAX_LENGTH);
-        if (!rt->tcurl) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        ff_url_join(rt->tcurl, TCURL_MAX_LENGTH, proto, NULL, hostname,
-                    port, "/%s", rt->app);
-    }
-
-    if (!rt->flashver) {
-        rt->flashver = av_malloc(FLASHVER_MAX_LENGTH);
-        if (!rt->flashver) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        if (rt->is_input) {
-            snprintf(rt->flashver, FLASHVER_MAX_LENGTH, "%s %d,%d,%d,%d",
-                    RTMP_CLIENT_PLATFORM, RTMP_CLIENT_VER1, RTMP_CLIENT_VER2,
-                    RTMP_CLIENT_VER3, RTMP_CLIENT_VER4);
-        } else {
-            snprintf(rt->flashver, FLASHVER_MAX_LENGTH,
-                    "FMLE/3.0 (compatible; %s)", LIBAVFORMAT_IDENT);
-        }
-    }
-
-    rt->client_report_size = 1048576;
-    rt->bytes_read = 0;
-    rt->last_bytes_read = 0;
-    rt->server_bw = 2500000;
-
-    av_log(s, AV_LOG_DEBUG, "Proto = %s, path = %s, app = %s, fname = %s\n",
-           proto, path, rt->app, rt->playpath);
-    if (!rt->listen) {
-        if ((ret = gen_connect(s, rt)) < 0)
-            goto fail;
-    } else {
-        if ((ret = read_connect(s, s->priv_data)) < 0)
-            goto fail;
-    }
-
-    do {
-        ret = get_packet(s, 1);
-    } while (ret == AVERROR(EAGAIN));
-    if (ret < 0)
-        goto fail;
-
-    if (rt->do_reconnect) {
-        int i;
-        ffurl_close(rt->stream);
-        rt->stream       = NULL;
-        rt->do_reconnect = 0;
-        rt->nb_invokes   = 0;
-        for (i = 0; i < 2; i++)
-            memset(rt->prev_pkt[i], 0,
-                   sizeof(**rt->prev_pkt) * rt->nb_prev_pkt[i]);
-        free_tracked_methods(rt);
-        goto reconnect;
-    }
-
-    if (rt->is_input) {
-        int err;
-        // generate FLV header for demuxer
-        rt->flv_size = 13;
-        if ((err = av_reallocp(&rt->flv_data, rt->flv_size)) < 0)
-            return err;
-        rt->flv_off  = 0;
-        memcpy(rt->flv_data, "FLV\1\5\0\0\0\011\0\0\0\0", rt->flv_size);
-    } else {
-        rt->flv_size = 0;
-        rt->flv_data = NULL;
-        rt->flv_off  = 0;
-        rt->skip_bytes = 13;
-    }
-
-    s->max_packet_size = rt->stream->max_packet_size;
-    s->is_streamed     = 1;
-    return 0;
-
-fail:
-    av_dict_free(&opts);
-    rtmp_close(s);
-    return ret;
-}
-
-static int rtmp_read(URLContext *s, uint8_t *buf, int size)
-{
-    RTMPContext *rt = s->priv_data;
-    int orig_size = size;
-    int ret;
-
-    while (size > 0) {
-        int data_left = rt->flv_size - rt->flv_off;
-
-        if (data_left >= size) {
-            memcpy(buf, rt->flv_data + rt->flv_off, size);
-            rt->flv_off += size;
-            return orig_size;
-        }
-        if (data_left > 0) {
-            memcpy(buf, rt->flv_data + rt->flv_off, data_left);
-            buf  += data_left;
-            size -= data_left;
-            rt->flv_off = rt->flv_size;
-            return data_left;
-        }
-        if ((ret = get_packet(s, 0)) < 0)
-           return ret;
-    }
-    return orig_size;
-}
-
-static int64_t rtmp_seek(URLContext *s, int stream_index, int64_t timestamp,
-                         int flags)
-{
-    RTMPContext *rt = s->priv_data;
-    int ret;
-    av_log(s, AV_LOG_DEBUG,
-           "Seek on stream index %d at timestamp %"PRId64" with flags %08x\n",
-           stream_index, timestamp, flags);
-    if ((ret = gen_seek(s, rt, timestamp)) < 0) {
-        av_log(s, AV_LOG_ERROR,
-               "Unable to send seek command on stream index %d at timestamp "
-               "%"PRId64" with flags %08x\n",
-               stream_index, timestamp, flags);
-        return ret;
-    }
-    rt->flv_off = rt->flv_size;
-    rt->state = STATE_SEEKING;
-    return timestamp;
-}
-
-static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
-{
-    RTMPContext *rt = s->priv_data;
-    int size_temp = size;
-    int pktsize, pkttype;
-    uint32_t ts;
-    const uint8_t *buf_temp = buf;
-    uint8_t c;
-    int ret;
-
-    do {
-        if (rt->skip_bytes) {
-            int skip = FFMIN(rt->skip_bytes, size_temp);
-            buf_temp       += skip;
-            size_temp      -= skip;
-            rt->skip_bytes -= skip;
-            continue;
-        }
-
-        if (rt->flv_header_bytes < RTMP_HEADER) {
-            const uint8_t *header = rt->flv_header;
-            int copy = FFMIN(RTMP_HEADER - rt->flv_header_bytes, size_temp);
-            int channel = RTMP_AUDIO_CHANNEL;
-            bytestream_get_buffer(&buf_temp, rt->flv_header + rt->flv_header_bytes, copy);
-            rt->flv_header_bytes += copy;
-            size_temp            -= copy;
-            if (rt->flv_header_bytes < RTMP_HEADER)
-                break;
-
-            pkttype = bytestream_get_byte(&header);
-            pktsize = bytestream_get_be24(&header);
-            ts = bytestream_get_be24(&header);
-            ts |= bytestream_get_byte(&header) << 24;
-            bytestream_get_be24(&header);
-            rt->flv_size = pktsize;
-
-            if (pkttype == RTMP_PT_VIDEO)
-                channel = RTMP_VIDEO_CHANNEL;
-
-            //force 12bytes header
-            if (((pkttype == RTMP_PT_VIDEO || pkttype == RTMP_PT_AUDIO) && ts == 0) ||
-                pkttype == RTMP_PT_NOTIFY) {
-                if (pkttype == RTMP_PT_NOTIFY)
-                    pktsize += 16;
-                if ((ret = ff_rtmp_check_alloc_array(&rt->prev_pkt[1],
-                                                     &rt->nb_prev_pkt[1],
-                                                     channel)) < 0)
-                    return ret;
-                rt->prev_pkt[1][channel].channel_id = 0;
-            }
-
-            //this can be a big packet, it's better to send it right here
-            if ((ret = ff_rtmp_packet_create(&rt->out_pkt, channel,
-                                             pkttype, ts, pktsize)) < 0)
-                return ret;
-
-            rt->out_pkt.extra = rt->stream_id;
-            rt->flv_data = rt->out_pkt.data;
-
-            if (pkttype == RTMP_PT_NOTIFY)
-                ff_amf_write_string(&rt->flv_data, "@setDataFrame");
-        }
-
-        if (rt->flv_size - rt->flv_off > size_temp) {
-            bytestream_get_buffer(&buf_temp, rt->flv_data + rt->flv_off, size_temp);
-            rt->flv_off += size_temp;
-            size_temp = 0;
-        } else {
-            bytestream_get_buffer(&buf_temp, rt->flv_data + rt->flv_off, rt->flv_size - rt->flv_off);
-            size_temp   -= rt->flv_size - rt->flv_off;
-            rt->flv_off += rt->flv_size - rt->flv_off;
-        }
-
-        if (rt->flv_off == rt->flv_size) {
-            rt->skip_bytes = 4;
-
-            if ((ret = rtmp_send_packet(rt, &rt->out_pkt, 0)) < 0)
-                return ret;
-            rt->flv_size = 0;
-            rt->flv_off = 0;
-            rt->flv_header_bytes = 0;
-            rt->flv_nb_packets++;
-        }
-    } while (buf_temp - buf < size);
-
-    if (rt->flv_nb_packets < rt->flush_interval)
-        return size;
-    rt->flv_nb_packets = 0;
-
-    /* set stream into nonblocking mode */
-    rt->stream->flags |= AVIO_FLAG_NONBLOCK;
-
-    /* try to read one byte from the stream */
-    ret = ffurl_read(rt->stream, &c, 1);
-
-    /* switch the stream back into blocking mode */
-    rt->stream->flags &= ~AVIO_FLAG_NONBLOCK;
-
-    if (ret == AVERROR(EAGAIN)) {
-        /* no incoming data to handle */
-        return size;
-    } else if (ret < 0) {
-        return ret;
-    } else if (ret == 1) {
-        RTMPPacket rpkt = { 0 };
-
-        if ((ret = ff_rtmp_packet_read_internal(rt->stream, &rpkt,
-                                                rt->in_chunk_size,
-                                                &rt->prev_pkt[0],
-                                                &rt->nb_prev_pkt[0], c)) <= 0)
-             return ret;
-
-        if ((ret = rtmp_parse_result(s, rt, &rpkt)) < 0)
-            return ret;
-
-        ff_rtmp_packet_destroy(&rpkt);
-    }
-
-    return size;
-}
-
-#define OFFSET(x) offsetof(RTMPContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-#define ENC AV_OPT_FLAG_ENCODING_PARAM
-
-static const AVOption rtmp_options[] = {
-    {"rtmp_app", "Name of application to connect to on the RTMP server", OFFSET(app), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
-    {"rtmp_buffer", "Set buffer time in milliseconds. The default is 3000.", OFFSET(client_buffer_time), AV_OPT_TYPE_INT, {.i64 = 3000}, 0, INT_MAX, DEC|ENC},
-    {"rtmp_conn", "Append arbitrary AMF data to the Connect message", OFFSET(conn), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
-    {"rtmp_flashver", "Version of the Flash plugin used to run the SWF player.", OFFSET(flashver), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
-    {"rtmp_flush_interval", "Number of packets flushed in the same request (RTMPT only).", OFFSET(flush_interval), AV_OPT_TYPE_INT, {.i64 = 10}, 0, INT_MAX, ENC},
-    {"rtmp_live", "Specify that the media is a live stream.", OFFSET(live), AV_OPT_TYPE_INT, {.i64 = -2}, INT_MIN, INT_MAX, DEC, "rtmp_live"},
-    {"any", "both", 0, AV_OPT_TYPE_CONST, {.i64 = -2}, 0, 0, DEC, "rtmp_live"},
-    {"live", "live stream", 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, DEC, "rtmp_live"},
-    {"recorded", "recorded stream", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, DEC, "rtmp_live"},
-    {"rtmp_pageurl", "URL of the web page in which the media was embedded. By default no value will be sent.", OFFSET(pageurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
-    {"rtmp_playpath", "Stream identifier to play or to publish", OFFSET(playpath), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
-    {"rtmp_subscribe", "Name of live stream to subscribe to. Defaults to rtmp_playpath.", OFFSET(subscribe), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
-    {"rtmp_swfhash", "SHA256 hash of the decompressed SWF file (32 bytes).", OFFSET(swfhash), AV_OPT_TYPE_BINARY, .flags = DEC},
-    {"rtmp_swfsize", "Size of the decompressed SWF file, required for SWFVerification.", OFFSET(swfsize), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, DEC},
-    {"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
-    {"rtmp_swfverify", "URL to player swf file, compute hash/size automatically.", OFFSET(swfverify), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
-    {"rtmp_tcurl", "URL of the target stream. Defaults to proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
-    {"rtmp_listen", "Listen for incoming rtmp connections", OFFSET(listen), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtmp_listen" },
-    {"listen",      "Listen for incoming rtmp connections", OFFSET(listen), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtmp_listen" },
-    {"timeout", "Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies -rtmp_listen 1",  OFFSET(listen_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC, "rtmp_listen" },
-    { NULL },
-};
-
-#define RTMP_PROTOCOL(flavor)                    \
-static const AVClass flavor##_class = {          \
-    .class_name = #flavor,                       \
-    .item_name  = av_default_item_name,          \
-    .option     = rtmp_options,                  \
-    .version    = LIBAVUTIL_VERSION_INT,         \
-};                                               \
-                                                 \
-URLProtocol ff_##flavor##_protocol = {           \
-    .name           = #flavor,                   \
-    .url_open       = rtmp_open,                 \
-    .url_read       = rtmp_read,                 \
-    .url_read_seek  = rtmp_seek,                 \
-    .url_write      = rtmp_write,                \
-    .url_close      = rtmp_close,                \
-    .priv_data_size = sizeof(RTMPContext),       \
-    .flags          = URL_PROTOCOL_FLAG_NETWORK, \
-    .priv_data_class= &flavor##_class,           \
-};
-
-
-RTMP_PROTOCOL(rtmp)
-RTMP_PROTOCOL(rtmpe)
-RTMP_PROTOCOL(rtmps)
-RTMP_PROTOCOL(rtmpt)
-RTMP_PROTOCOL(rtmpte)
-RTMP_PROTOCOL(rtmpts)
diff --git a/deps/libav/libavformat/rtp.c b/deps/libav/libavformat/rtp.c
deleted file mode 100644
index 0a3c411..0000000
--- a/deps/libav/libavformat/rtp.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * RTP input/output format
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/opt.h"
-#include "avformat.h"
-
-#include "rtp.h"
-
-/* from http://www.iana.org/assignments/rtp-parameters last updated 05 January 2005 */
-/* payload types >= 96 are dynamic;
- * payload types between 72 and 76 are reserved for RTCP conflict avoidance;
- * all the other payload types not present in the table are unassigned or
- * reserved
- */
-static const struct {
-    int pt;
-    const char enc_name[6];
-    enum AVMediaType codec_type;
-    enum AVCodecID codec_id;
-    int clock_rate;
-    int audio_channels;
-} rtp_payload_types[] = {
-  {0, "PCMU",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_PCM_MULAW, 8000, 1},
-  {3, "GSM",         AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_NONE, 8000, 1},
-  {4, "G723",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_G723_1, 8000, 1},
-  {5, "DVI4",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_NONE, 8000, 1},
-  {6, "DVI4",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_NONE, 16000, 1},
-  {7, "LPC",         AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_NONE, 8000, 1},
-  {8, "PCMA",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_PCM_ALAW, 8000, 1},
-  {9, "G722",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_ADPCM_G722, 8000, 1},
-  {10, "L16",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_PCM_S16BE, 44100, 2},
-  {11, "L16",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_PCM_S16BE, 44100, 1},
-  {12, "QCELP",      AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_QCELP, 8000, 1},
-  {13, "CN",         AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_NONE, 8000, 1},
-  {14, "MPA",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_MP2, -1, -1},
-  {14, "MPA",        AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_MP3, -1, -1},
-  {15, "G728",       AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_NONE, 8000, 1},
-  {16, "DVI4",       AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_NONE, 11025, 1},
-  {17, "DVI4",       AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_NONE, 22050, 1},
-  {18, "G729",       AVMEDIA_TYPE_AUDIO,   AV_CODEC_ID_NONE, 8000, 1},
-  {25, "CelB",       AVMEDIA_TYPE_VIDEO,   AV_CODEC_ID_NONE, 90000, -1},
-  {26, "JPEG",       AVMEDIA_TYPE_VIDEO,   AV_CODEC_ID_MJPEG, 90000, -1},
-  {28, "nv",         AVMEDIA_TYPE_VIDEO,   AV_CODEC_ID_NONE, 90000, -1},
-  {31, "H261",       AVMEDIA_TYPE_VIDEO,   AV_CODEC_ID_H261, 90000, -1},
-  {32, "MPV",        AVMEDIA_TYPE_VIDEO,   AV_CODEC_ID_MPEG1VIDEO, 90000, -1},
-  {32, "MPV",        AVMEDIA_TYPE_VIDEO,   AV_CODEC_ID_MPEG2VIDEO, 90000, -1},
-  {33, "MP2T",       AVMEDIA_TYPE_DATA,    AV_CODEC_ID_MPEG2TS, 90000, -1},
-  {34, "H263",       AVMEDIA_TYPE_VIDEO,   AV_CODEC_ID_H263, 90000, -1},
-  {-1, "",           AVMEDIA_TYPE_UNKNOWN, AV_CODEC_ID_NONE, -1, -1}
-};
-
-int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type)
-{
-    int i = 0;
-
-    for (i = 0; rtp_payload_types[i].pt >= 0; i++)
-        if (rtp_payload_types[i].pt == payload_type) {
-            if (rtp_payload_types[i].codec_id != AV_CODEC_ID_NONE) {
-                codec->codec_type = rtp_payload_types[i].codec_type;
-                codec->codec_id = rtp_payload_types[i].codec_id;
-                if (rtp_payload_types[i].audio_channels > 0)
-                    codec->channels = rtp_payload_types[i].audio_channels;
-                if (rtp_payload_types[i].clock_rate > 0)
-                    codec->sample_rate = rtp_payload_types[i].clock_rate;
-                return 0;
-            }
-        }
-    return -1;
-}
-
-int ff_rtp_get_payload_type(AVFormatContext *fmt,
-                            AVCodecContext *codec, int idx)
-{
-    int i;
-    AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;
-
-    /* Was the payload type already specified for the RTP muxer? */
-    if (ofmt && ofmt->priv_class && fmt->priv_data) {
-        int64_t payload_type;
-        if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0 &&
-            payload_type >= 0)
-            return (int)payload_type;
-    }
-
-    /* static payload type */
-    for (i = 0; rtp_payload_types[i].pt >= 0; ++i)
-        if (rtp_payload_types[i].codec_id == codec->codec_id) {
-            if (codec->codec_id == AV_CODEC_ID_H263 && (!fmt || !fmt->oformat ||
-                !fmt->oformat->priv_class || !fmt->priv_data ||
-                !av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190")))
-                continue;
-            /* G722 has 8000 as nominal rate even if the sample rate is 16000,
-             * see section 4.5.2 in RFC 3551. */
-            if (codec->codec_id == AV_CODEC_ID_ADPCM_G722 &&
-                codec->sample_rate == 16000 && codec->channels == 1)
-                return rtp_payload_types[i].pt;
-            if (codec->codec_type == AVMEDIA_TYPE_AUDIO &&
-                ((rtp_payload_types[i].clock_rate > 0 &&
-                  codec->sample_rate != rtp_payload_types[i].clock_rate) ||
-                 (rtp_payload_types[i].audio_channels > 0 &&
-                  codec->channels != rtp_payload_types[i].audio_channels)))
-                continue;
-            return rtp_payload_types[i].pt;
-        }
-
-    if (idx < 0)
-        idx = codec->codec_type == AVMEDIA_TYPE_AUDIO;
-
-    /* dynamic payload type */
-    return RTP_PT_PRIVATE + idx;
-}
-
-const char *ff_rtp_enc_name(int payload_type)
-{
-    int i;
-
-    for (i = 0; rtp_payload_types[i].pt >= 0; i++)
-        if (rtp_payload_types[i].pt == payload_type)
-            return rtp_payload_types[i].enc_name;
-
-    return "";
-}
-
-enum AVCodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type)
-{
-    int i;
-
-    for (i = 0; rtp_payload_types[i].pt >= 0; i++)
-        if (!strcmp(buf, rtp_payload_types[i].enc_name) && (codec_type == rtp_payload_types[i].codec_type))
-            return rtp_payload_types[i].codec_id;
-
-    return AV_CODEC_ID_NONE;
-}
diff --git a/deps/libav/libavformat/rtp.h b/deps/libav/libavformat/rtp.h
deleted file mode 100644
index feaf167..0000000
--- a/deps/libav/libavformat/rtp.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * RTP definitions
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVFORMAT_RTP_H
-#define AVFORMAT_RTP_H
-
-#include "libavformat/avformat.h"
-#include "libavcodec/avcodec.h"
-#include "libavutil/mathematics.h"
-
-/**
- * Return the payload type for a given stream used in the given format context.
- * Static payload types are derived from the codec.
- * Dynamic payload type are derived from the id field in AVStream.
- * The format context private option payload_type overrides both.
- *
- * @param fmt   The context of the format
- * @param codec The context of the codec
- * @param idx   The stream index
- * @return The payload type (the 'PT' field in the RTP header).
- */
-int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec,
-                            int idx);
-
-/**
- * Initialize a codec context based on the payload type.
- *
- * Fill the codec_type and codec_id fields of a codec context with
- * information depending on the payload type; for audio codecs, the
- * channels and sample_rate fields are also filled.
- *
- * @param codec The context of the codec
- * @param payload_type The payload type (the 'PT' field in the RTP header)
- * @return In case of unknown payload type or dynamic payload type, a
- * negative value is returned; otherwise, 0 is returned
- */
-int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type);
-
-/**
- * Return the encoding name (as defined in
- * http://www.iana.org/assignments/rtp-parameters) for a given payload type.
- *
- * @param payload_type The payload type (the 'PT' field in the RTP header)
- * @return In case of unknown payload type or dynamic payload type, a pointer
- * to an empty string is returned; otherwise, a pointer to a string containing
- * the encoding name is returned
- */
-const char *ff_rtp_enc_name(int payload_type);
-
-/**
- * Return the codec id for the given encoding name and codec type.
- *
- * @param buf A pointer to the string containing the encoding name
- * @param codec_type The codec type
- * @return In case of unknown encoding name, AV_CODEC_ID_NONE is returned;
- * otherwise, the codec id is returned
- */
-enum AVCodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type);
-
-#define RTP_PT_PRIVATE 96
-#define RTP_VERSION 2
-#define RTP_MAX_SDES 256   /**< maximum text length for SDES */
-
-/* RTCP packets use 0.5% of the bandwidth */
-#define RTCP_TX_RATIO_NUM 5
-#define RTCP_TX_RATIO_DEN 1000
-
-/* An arbitrary id value for RTP Xiph streams - only relevant to indicate
- * that the configuration has changed within a stream (by changing the
- * ident value sent).
- */
-#define RTP_XIPH_IDENT 0xfecdba
-
-/* RTCP packet types */
-enum RTCPType {
-    RTCP_FIR    = 192,
-    RTCP_NACK, // 193
-    RTCP_SMPTETC,// 194
-    RTCP_IJ,   // 195
-    RTCP_SR     = 200,
-    RTCP_RR,   // 201
-    RTCP_SDES, // 202
-    RTCP_BYE,  // 203
-    RTCP_APP,  // 204
-    RTCP_RTPFB,// 205
-    RTCP_PSFB, // 206
-    RTCP_XR,   // 207
-    RTCP_AVB,  // 208
-    RTCP_RSI,  // 209
-    RTCP_TOKEN,// 210
-};
-
-#define RTP_PT_IS_RTCP(x) (((x) >= RTCP_FIR && (x) <= RTCP_IJ) || \
-                           ((x) >= RTCP_SR  && (x) <= RTCP_TOKEN))
-
-#define NTP_TO_RTP_FORMAT(x) av_rescale((x), INT64_C(1) << 32, 1000000)
-
-#endif /* AVFORMAT_RTP_H */
diff --git a/deps/libav/libavformat/rtpdec.c b/deps/libav/libavformat/rtpdec.c
deleted file mode 100644
index 3984489..0000000
--- a/deps/libav/libavformat/rtpdec.c
+++ /dev/null
@@ -1,878 +0,0 @@
-/*
- * RTP input format
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mathematics.h"
-#include "libavutil/avstring.h"
-#include "libavutil/time.h"
-#include "libavcodec/get_bits.h"
-#include "avformat.h"
-#include "network.h"
-#include "srtp.h"
-#include "url.h"
-#include "rtpdec.h"
-#include "rtpdec_formats.h"
-
-#define MIN_FEEDBACK_INTERVAL 200000 /* 200 ms in us */
-
-static RTPDynamicProtocolHandler realmedia_mp3_dynamic_handler = {
-    .enc_name   = "X-MP3-draft-00",
-    .codec_type = AVMEDIA_TYPE_AUDIO,
-    .codec_id   = AV_CODEC_ID_MP3ADU,
-};
-
-static RTPDynamicProtocolHandler speex_dynamic_handler = {
-    .enc_name   = "speex",
-    .codec_type = AVMEDIA_TYPE_AUDIO,
-    .codec_id   = AV_CODEC_ID_SPEEX,
-};
-
-static RTPDynamicProtocolHandler opus_dynamic_handler = {
-    .enc_name   = "opus",
-    .codec_type = AVMEDIA_TYPE_AUDIO,
-    .codec_id   = AV_CODEC_ID_OPUS,
-};
-
-static RTPDynamicProtocolHandler *rtp_first_dynamic_payload_handler = NULL;
-
-void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler)
-{
-    handler->next = rtp_first_dynamic_payload_handler;
-    rtp_first_dynamic_payload_handler = handler;
-}
-
-void ff_register_rtp_dynamic_payload_handlers(void)
-{
-    ff_register_dynamic_payload_handler(&ff_amr_nb_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_amr_wb_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_g726_16_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_g726_24_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_g726_32_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_g726_40_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_h263_1998_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_h263_2000_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_h263_rfc2190_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_h264_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_ilbc_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_jpeg_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_mp4a_latm_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_mp4v_es_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_mpeg_audio_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_mpeg_video_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_mpeg4_generic_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_mpegts_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfa_handler);
-    ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfv_handler);
-    ff_register_dynamic_payload_handler(&ff_qcelp_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_qdm2_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_qt_rtp_aud_handler);
-    ff_register_dynamic_payload_handler(&ff_qt_rtp_vid_handler);
-    ff_register_dynamic_payload_handler(&ff_quicktime_rtp_aud_handler);
-    ff_register_dynamic_payload_handler(&ff_quicktime_rtp_vid_handler);
-    ff_register_dynamic_payload_handler(&ff_svq3_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_theora_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_vorbis_dynamic_handler);
-    ff_register_dynamic_payload_handler(&ff_vp8_dynamic_handler);
-    ff_register_dynamic_payload_handler(&opus_dynamic_handler);
-    ff_register_dynamic_payload_handler(&realmedia_mp3_dynamic_handler);
-    ff_register_dynamic_payload_handler(&speex_dynamic_handler);
-}
-
-RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name,
-                                                       enum AVMediaType codec_type)
-{
-    RTPDynamicProtocolHandler *handler;
-    for (handler = rtp_first_dynamic_payload_handler;
-         handler; handler = handler->next)
-        if (!av_strcasecmp(name, handler->enc_name) &&
-            codec_type == handler->codec_type)
-            return handler;
-    return NULL;
-}
-
-RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id,
-                                                     enum AVMediaType codec_type)
-{
-    RTPDynamicProtocolHandler *handler;
-    for (handler = rtp_first_dynamic_payload_handler;
-         handler; handler = handler->next)
-        if (handler->static_payload_id && handler->static_payload_id == id &&
-            codec_type == handler->codec_type)
-            return handler;
-    return NULL;
-}
-
-static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf,
-                             int len)
-{
-    int payload_len;
-    while (len >= 4) {
-        payload_len = FFMIN(len, (AV_RB16(buf + 2) + 1) * 4);
-
-        switch (buf[1]) {
-        case RTCP_SR:
-            if (payload_len < 20) {
-                av_log(NULL, AV_LOG_ERROR,
-                       "Invalid length for RTCP SR packet\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            s->last_rtcp_reception_time = av_gettime();
-            s->last_rtcp_ntp_time  = AV_RB64(buf + 8);
-            s->last_rtcp_timestamp = AV_RB32(buf + 16);
-            if (s->first_rtcp_ntp_time == AV_NOPTS_VALUE) {
-                s->first_rtcp_ntp_time = s->last_rtcp_ntp_time;
-                if (!s->base_timestamp)
-                    s->base_timestamp = s->last_rtcp_timestamp;
-                s->rtcp_ts_offset = s->last_rtcp_timestamp - s->base_timestamp;
-            }
-
-            break;
-        case RTCP_BYE:
-            return -RTCP_BYE;
-        }
-
-        buf += payload_len;
-        len -= payload_len;
-    }
-    return -1;
-}
-
-#define RTP_SEQ_MOD (1 << 16)
-
-static void rtp_init_statistics(RTPStatistics *s, uint16_t base_sequence)
-{
-    memset(s, 0, sizeof(RTPStatistics));
-    s->max_seq   = base_sequence;
-    s->probation = 1;
-}
-
-/*
- * Called whenever there is a large jump in sequence numbers,
- * or when they get out of probation...
- */
-static void rtp_init_sequence(RTPStatistics *s, uint16_t seq)
-{
-    s->max_seq        = seq;
-    s->cycles         = 0;
-    s->base_seq       = seq - 1;
-    s->bad_seq        = RTP_SEQ_MOD + 1;
-    s->received       = 0;
-    s->expected_prior = 0;
-    s->received_prior = 0;
-    s->jitter         = 0;
-    s->transit        = 0;
-}
-
-/* Returns 1 if we should handle this packet. */
-static int rtp_valid_packet_in_sequence(RTPStatistics *s, uint16_t seq)
-{
-    uint16_t udelta = seq - s->max_seq;
-    const int MAX_DROPOUT    = 3000;
-    const int MAX_MISORDER   = 100;
-    const int MIN_SEQUENTIAL = 2;
-
-    /* source not valid until MIN_SEQUENTIAL packets with sequence
-     * seq. numbers have been received */
-    if (s->probation) {
-        if (seq == s->max_seq + 1) {
-            s->probation--;
-            s->max_seq = seq;
-            if (s->probation == 0) {
-                rtp_init_sequence(s, seq);
-                s->received++;
-                return 1;
-            }
-        } else {
-            s->probation = MIN_SEQUENTIAL - 1;
-            s->max_seq   = seq;
-        }
-    } else if (udelta < MAX_DROPOUT) {
-        // in order, with permissible gap
-        if (seq < s->max_seq) {
-            // sequence number wrapped; count another 64k cycles
-            s->cycles += RTP_SEQ_MOD;
-        }
-        s->max_seq = seq;
-    } else if (udelta <= RTP_SEQ_MOD - MAX_MISORDER) {
-        // sequence made a large jump...
-        if (seq == s->bad_seq) {
-            /* two sequential packets -- assume that the other side
-             * restarted without telling us; just resync. */
-            rtp_init_sequence(s, seq);
-        } else {
-            s->bad_seq = (seq + 1) & (RTP_SEQ_MOD - 1);
-            return 0;
-        }
-    } else {
-        // duplicate or reordered packet...
-    }
-    s->received++;
-    return 1;
-}
-
-static void rtcp_update_jitter(RTPStatistics *s, uint32_t sent_timestamp,
-                               uint32_t arrival_timestamp)
-{
-    // Most of this is pretty straight from RFC 3550 appendix A.8
-    uint32_t transit = arrival_timestamp - sent_timestamp;
-    uint32_t prev_transit = s->transit;
-    int32_t d = transit - prev_transit;
-    // Doing the FFABS() call directly on the "transit - prev_transit"
-    // expression doesn't work, since it's an unsigned expression. Doing the
-    // transit calculation in unsigned is desired though, since it most
-    // probably will need to wrap around.
-    d = FFABS(d);
-    s->transit = transit;
-    if (!prev_transit)
-        return;
-    s->jitter += d - (int32_t) ((s->jitter + 8) >> 4);
-}
-
-int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd,
-                                  AVIOContext *avio, int count)
-{
-    AVIOContext *pb;
-    uint8_t *buf;
-    int len;
-    int rtcp_bytes;
-    RTPStatistics *stats = &s->statistics;
-    uint32_t lost;
-    uint32_t extended_max;
-    uint32_t expected_interval;
-    uint32_t received_interval;
-    int32_t  lost_interval;
-    uint32_t expected;
-    uint32_t fraction;
-
-    if ((!fd && !avio) || (count < 1))
-        return -1;
-
-    /* TODO: I think this is way too often; RFC 1889 has algorithm for this */
-    /* XXX: MPEG pts hardcoded. RTCP send every 0.5 seconds */
-    s->octet_count += count;
-    rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) /
-        RTCP_TX_RATIO_DEN;
-    rtcp_bytes /= 50; // mmu_man: that's enough for me... VLC sends much less btw !?
-    if (rtcp_bytes < 28)
-        return -1;
-    s->last_octet_count = s->octet_count;
-
-    if (!fd)
-        pb = avio;
-    else if (avio_open_dyn_buf(&pb) < 0)
-        return -1;
-
-    // Receiver Report
-    avio_w8(pb, (RTP_VERSION << 6) + 1); /* 1 report block */
-    avio_w8(pb, RTCP_RR);
-    avio_wb16(pb, 7); /* length in words - 1 */
-    // our own SSRC: we use the server's SSRC + 1 to avoid conflicts
-    avio_wb32(pb, s->ssrc + 1);
-    avio_wb32(pb, s->ssrc); // server SSRC
-    // some placeholders we should really fill...
-    // RFC 1889/p64
-    extended_max          = stats->cycles + stats->max_seq;
-    expected              = extended_max - stats->base_seq;
-    lost                  = expected - stats->received;
-    lost                  = FFMIN(lost, 0xffffff); // clamp it since it's only 24 bits...
-    expected_interval     = expected - stats->expected_prior;
-    stats->expected_prior = expected;
-    received_interval     = stats->received - stats->received_prior;
-    stats->received_prior = stats->received;
-    lost_interval         = expected_interval - received_interval;
-    if (expected_interval == 0 || lost_interval <= 0)
-        fraction = 0;
-    else
-        fraction = (lost_interval << 8) / expected_interval;
-
-    fraction = (fraction << 24) | lost;
-
-    avio_wb32(pb, fraction); /* 8 bits of fraction, 24 bits of total packets lost */
-    avio_wb32(pb, extended_max); /* max sequence received */
-    avio_wb32(pb, stats->jitter >> 4); /* jitter */
-
-    if (s->last_rtcp_ntp_time == AV_NOPTS_VALUE) {
-        avio_wb32(pb, 0); /* last SR timestamp */
-        avio_wb32(pb, 0); /* delay since last SR */
-    } else {
-        uint32_t middle_32_bits   = s->last_rtcp_ntp_time >> 16; // this is valid, right? do we need to handle 64 bit values special?
-        uint32_t delay_since_last = av_rescale(av_gettime() - s->last_rtcp_reception_time,
-                                               65536, AV_TIME_BASE);
-
-        avio_wb32(pb, middle_32_bits); /* last SR timestamp */
-        avio_wb32(pb, delay_since_last); /* delay since last SR */
-    }
-
-    // CNAME
-    avio_w8(pb, (RTP_VERSION << 6) + 1); /* 1 report block */
-    avio_w8(pb, RTCP_SDES);
-    len = strlen(s->hostname);
-    avio_wb16(pb, (7 + len + 3) / 4); /* length in words - 1 */
-    avio_wb32(pb, s->ssrc + 1);
-    avio_w8(pb, 0x01);
-    avio_w8(pb, len);
-    avio_write(pb, s->hostname, len);
-    avio_w8(pb, 0); /* END */
-    // padding
-    for (len = (7 + len) % 4; len % 4; len++)
-        avio_w8(pb, 0);
-
-    avio_flush(pb);
-    if (!fd)
-        return 0;
-    len = avio_close_dyn_buf(pb, &buf);
-    if ((len > 0) && buf) {
-        int av_unused result;
-        av_dlog(s->ic, "sending %d bytes of RR\n", len);
-        result = ffurl_write(fd, buf, len);
-        av_dlog(s->ic, "result from ffurl_write: %d\n", result);
-        av_free(buf);
-    }
-    return 0;
-}
-
-void ff_rtp_send_punch_packets(URLContext *rtp_handle)
-{
-    AVIOContext *pb;
-    uint8_t *buf;
-    int len;
-
-    /* Send a small RTP packet */
-    if (avio_open_dyn_buf(&pb) < 0)
-        return;
-
-    avio_w8(pb, (RTP_VERSION << 6));
-    avio_w8(pb, 0); /* Payload type */
-    avio_wb16(pb, 0); /* Seq */
-    avio_wb32(pb, 0); /* Timestamp */
-    avio_wb32(pb, 0); /* SSRC */
-
-    avio_flush(pb);
-    len = avio_close_dyn_buf(pb, &buf);
-    if ((len > 0) && buf)
-        ffurl_write(rtp_handle, buf, len);
-    av_free(buf);
-
-    /* Send a minimal RTCP RR */
-    if (avio_open_dyn_buf(&pb) < 0)
-        return;
-
-    avio_w8(pb, (RTP_VERSION << 6));
-    avio_w8(pb, RTCP_RR); /* receiver report */
-    avio_wb16(pb, 1); /* length in words - 1 */
-    avio_wb32(pb, 0); /* our own SSRC */
-
-    avio_flush(pb);
-    len = avio_close_dyn_buf(pb, &buf);
-    if ((len > 0) && buf)
-        ffurl_write(rtp_handle, buf, len);
-    av_free(buf);
-}
-
-static int find_missing_packets(RTPDemuxContext *s, uint16_t *first_missing,
-                                uint16_t *missing_mask)
-{
-    int i;
-    uint16_t next_seq = s->seq + 1;
-    RTPPacket *pkt = s->queue;
-
-    if (!pkt || pkt->seq == next_seq)
-        return 0;
-
-    *missing_mask = 0;
-    for (i = 1; i <= 16; i++) {
-        uint16_t missing_seq = next_seq + i;
-        while (pkt) {
-            int16_t diff = pkt->seq - missing_seq;
-            if (diff >= 0)
-                break;
-            pkt = pkt->next;
-        }
-        if (!pkt)
-            break;
-        if (pkt->seq == missing_seq)
-            continue;
-        *missing_mask |= 1 << (i - 1);
-    }
-
-    *first_missing = next_seq;
-    return 1;
-}
-
-int ff_rtp_send_rtcp_feedback(RTPDemuxContext *s, URLContext *fd,
-                              AVIOContext *avio)
-{
-    int len, need_keyframe, missing_packets;
-    AVIOContext *pb;
-    uint8_t *buf;
-    int64_t now;
-    uint16_t first_missing = 0, missing_mask = 0;
-
-    if (!fd && !avio)
-        return -1;
-
-    need_keyframe = s->handler && s->handler->need_keyframe &&
-                    s->handler->need_keyframe(s->dynamic_protocol_context);
-    missing_packets = find_missing_packets(s, &first_missing, &missing_mask);
-
-    if (!need_keyframe && !missing_packets)
-        return 0;
-
-    /* Send new feedback if enough time has elapsed since the last
-     * feedback packet. */
-
-    now = av_gettime();
-    if (s->last_feedback_time &&
-        (now - s->last_feedback_time) < MIN_FEEDBACK_INTERVAL)
-        return 0;
-    s->last_feedback_time = now;
-
-    if (!fd)
-        pb = avio;
-    else if (avio_open_dyn_buf(&pb) < 0)
-        return -1;
-
-    if (need_keyframe) {
-        avio_w8(pb, (RTP_VERSION << 6) | 1); /* PLI */
-        avio_w8(pb, RTCP_PSFB);
-        avio_wb16(pb, 2); /* length in words - 1 */
-        // our own SSRC: we use the server's SSRC + 1 to avoid conflicts
-        avio_wb32(pb, s->ssrc + 1);
-        avio_wb32(pb, s->ssrc); // server SSRC
-    }
-
-    if (missing_packets) {
-        avio_w8(pb, (RTP_VERSION << 6) | 1); /* NACK */
-        avio_w8(pb, RTCP_RTPFB);
-        avio_wb16(pb, 3); /* length in words - 1 */
-        avio_wb32(pb, s->ssrc + 1);
-        avio_wb32(pb, s->ssrc); // server SSRC
-
-        avio_wb16(pb, first_missing);
-        avio_wb16(pb, missing_mask);
-    }
-
-    avio_flush(pb);
-    if (!fd)
-        return 0;
-    len = avio_close_dyn_buf(pb, &buf);
-    if (len > 0 && buf) {
-        ffurl_write(fd, buf, len);
-        av_free(buf);
-    }
-    return 0;
-}
-
-/**
- * open a new RTP parse context for stream 'st'. 'st' can be NULL for
- * MPEG2-TS streams.
- */
-RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st,
-                                   int payload_type, int queue_size)
-{
-    RTPDemuxContext *s;
-
-    s = av_mallocz(sizeof(RTPDemuxContext));
-    if (!s)
-        return NULL;
-    s->payload_type        = payload_type;
-    s->last_rtcp_ntp_time  = AV_NOPTS_VALUE;
-    s->first_rtcp_ntp_time = AV_NOPTS_VALUE;
-    s->ic                  = s1;
-    s->st                  = st;
-    s->queue_size          = queue_size;
-    rtp_init_statistics(&s->statistics, 0);
-    if (st) {
-        switch (st->codec->codec_id) {
-        case AV_CODEC_ID_ADPCM_G722:
-            /* According to RFC 3551, the stream clock rate is 8000
-             * even if the sample rate is 16000. */
-            if (st->codec->sample_rate == 8000)
-                st->codec->sample_rate = 16000;
-            break;
-        default:
-            break;
-        }
-    }
-    // needed to send back RTCP RR in RTSP sessions
-    gethostname(s->hostname, sizeof(s->hostname));
-    return s;
-}
-
-void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
-                                       RTPDynamicProtocolHandler *handler)
-{
-    s->dynamic_protocol_context = ctx;
-    s->handler                  = handler;
-}
-
-void ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite,
-                             const char *params)
-{
-    if (!ff_srtp_set_crypto(&s->srtp, suite, params))
-        s->srtp_enabled = 1;
-}
-
-/**
- * This was the second switch in rtp_parse packet.
- * Normalizes time, if required, sets stream_index, etc.
- */
-static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp)
-{
-    if (pkt->pts != AV_NOPTS_VALUE || pkt->dts != AV_NOPTS_VALUE)
-        return; /* Timestamp already set by depacketizer */
-    if (timestamp == RTP_NOTS_VALUE)
-        return;
-
-    if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE && s->ic->nb_streams > 1) {
-        int64_t addend;
-        int delta_timestamp;
-
-        /* compute pts from timestamp with received ntp_time */
-        delta_timestamp = timestamp - s->last_rtcp_timestamp;
-        /* convert to the PTS timebase */
-        addend = av_rescale(s->last_rtcp_ntp_time - s->first_rtcp_ntp_time,
-                            s->st->time_base.den,
-                            (uint64_t) s->st->time_base.num << 32);
-        pkt->pts = s->range_start_offset + s->rtcp_ts_offset + addend +
-                   delta_timestamp;
-        return;
-    }
-
-    if (!s->base_timestamp)
-        s->base_timestamp = timestamp;
-    /* assume that the difference is INT32_MIN < x < INT32_MAX,
-     * but allow the first timestamp to exceed INT32_MAX */
-    if (!s->timestamp)
-        s->unwrapped_timestamp += timestamp;
-    else
-        s->unwrapped_timestamp += (int32_t)(timestamp - s->timestamp);
-    s->timestamp = timestamp;
-    pkt->pts     = s->unwrapped_timestamp + s->range_start_offset -
-                   s->base_timestamp;
-}
-
-static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
-                                     const uint8_t *buf, int len)
-{
-    unsigned int ssrc;
-    int payload_type, seq, flags = 0;
-    int ext, csrc;
-    AVStream *st;
-    uint32_t timestamp;
-    int rv = 0;
-
-    csrc         = buf[0] & 0x0f;
-    ext          = buf[0] & 0x10;
-    payload_type = buf[1] & 0x7f;
-    if (buf[1] & 0x80)
-        flags |= RTP_FLAG_MARKER;
-    seq       = AV_RB16(buf + 2);
-    timestamp = AV_RB32(buf + 4);
-    ssrc      = AV_RB32(buf + 8);
-    /* store the ssrc in the RTPDemuxContext */
-    s->ssrc = ssrc;
-
-    /* NOTE: we can handle only one payload type */
-    if (s->payload_type != payload_type)
-        return -1;
-
-    st = s->st;
-    // only do something with this if all the rtp checks pass...
-    if (!rtp_valid_packet_in_sequence(&s->statistics, seq)) {
-        av_log(st ? st->codec : NULL, AV_LOG_ERROR,
-               "RTP: PT=%02x: bad cseq %04x expected=%04x\n",
-               payload_type, seq, ((s->seq + 1) & 0xffff));
-        return -1;
-    }
-
-    if (buf[0] & 0x20) {
-        int padding = buf[len - 1];
-        if (len >= 12 + padding)
-            len -= padding;
-    }
-
-    s->seq = seq;
-    len   -= 12;
-    buf   += 12;
-
-    len   -= 4 * csrc;
-    buf   += 4 * csrc;
-    if (len < 0)
-        return AVERROR_INVALIDDATA;
-
-    /* RFC 3550 Section 5.3.1 RTP Header Extension handling */
-    if (ext) {
-        if (len < 4)
-            return -1;
-        /* calculate the header extension length (stored as number
-         * of 32-bit words) */
-        ext = (AV_RB16(buf + 2) + 1) << 2;
-
-        if (len < ext)
-            return -1;
-        // skip past RTP header extension
-        len -= ext;
-        buf += ext;
-    }
-
-    if (s->handler && s->handler->parse_packet) {
-        rv = s->handler->parse_packet(s->ic, s->dynamic_protocol_context,
-                                      s->st, pkt, &timestamp, buf, len, seq,
-                                      flags);
-    } else if (st) {
-        if ((rv = av_new_packet(pkt, len)) < 0)
-            return rv;
-        memcpy(pkt->data, buf, len);
-        pkt->stream_index = st->index;
-    } else {
-        return AVERROR(EINVAL);
-    }
-
-    // now perform timestamp things....
-    finalize_packet(s, pkt, timestamp);
-
-    return rv;
-}
-
-void ff_rtp_reset_packet_queue(RTPDemuxContext *s)
-{
-    while (s->queue) {
-        RTPPacket *next = s->queue->next;
-        av_free(s->queue->buf);
-        av_free(s->queue);
-        s->queue = next;
-    }
-    s->seq       = 0;
-    s->queue_len = 0;
-    s->prev_ret  = 0;
-}
-
-static void enqueue_packet(RTPDemuxContext *s, uint8_t *buf, int len)
-{
-    uint16_t seq   = AV_RB16(buf + 2);
-    RTPPacket **cur = &s->queue, *packet;
-
-    /* Find the correct place in the queue to insert the packet */
-    while (*cur) {
-        int16_t diff = seq - (*cur)->seq;
-        if (diff < 0)
-            break;
-        cur = &(*cur)->next;
-    }
-
-    packet = av_mallocz(sizeof(*packet));
-    if (!packet)
-        return;
-    packet->recvtime = av_gettime();
-    packet->seq      = seq;
-    packet->len      = len;
-    packet->buf      = buf;
-    packet->next     = *cur;
-    *cur = packet;
-    s->queue_len++;
-}
-
-static int has_next_packet(RTPDemuxContext *s)
-{
-    return s->queue && s->queue->seq == (uint16_t) (s->seq + 1);
-}
-
-int64_t ff_rtp_queued_packet_time(RTPDemuxContext *s)
-{
-    return s->queue ? s->queue->recvtime : 0;
-}
-
-static int rtp_parse_queued_packet(RTPDemuxContext *s, AVPacket *pkt)
-{
-    int rv;
-    RTPPacket *next;
-
-    if (s->queue_len <= 0)
-        return -1;
-
-    if (!has_next_packet(s))
-        av_log(s->st ? s->st->codec : NULL, AV_LOG_WARNING,
-               "RTP: missed %d packets\n", s->queue->seq - s->seq - 1);
-
-    /* Parse the first packet in the queue, and dequeue it */
-    rv   = rtp_parse_packet_internal(s, pkt, s->queue->buf, s->queue->len);
-    next = s->queue->next;
-    av_free(s->queue->buf);
-    av_free(s->queue);
-    s->queue = next;
-    s->queue_len--;
-    return rv;
-}
-
-static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
-                                uint8_t **bufptr, int len)
-{
-    uint8_t *buf = bufptr ? *bufptr : NULL;
-    int flags = 0;
-    uint32_t timestamp;
-    int rv = 0;
-
-    if (!buf) {
-        /* If parsing of the previous packet actually returned 0 or an error,
-         * there's nothing more to be parsed from that packet, but we may have
-         * indicated that we can return the next enqueued packet. */
-        if (s->prev_ret <= 0)
-            return rtp_parse_queued_packet(s, pkt);
-        /* return the next packets, if any */
-        if (s->handler && s->handler->parse_packet) {
-            /* timestamp should be overwritten by parse_packet, if not,
-             * the packet is left with pts == AV_NOPTS_VALUE */
-            timestamp = RTP_NOTS_VALUE;
-            rv        = s->handler->parse_packet(s->ic, s->dynamic_protocol_context,
-                                                 s->st, pkt, &timestamp, NULL, 0, 0,
-                                                 flags);
-            finalize_packet(s, pkt, timestamp);
-            return rv;
-        }
-    }
-
-    if (len < 12)
-        return -1;
-
-    if ((buf[0] & 0xc0) != (RTP_VERSION << 6))
-        return -1;
-    if (RTP_PT_IS_RTCP(buf[1])) {
-        return rtcp_parse_packet(s, buf, len);
-    }
-
-    if (s->st) {
-        int64_t received = av_gettime();
-        uint32_t arrival_ts = av_rescale_q(received, AV_TIME_BASE_Q,
-                                           s->st->time_base);
-        timestamp = AV_RB32(buf + 4);
-        // Calculate the jitter immediately, before queueing the packet
-        // into the reordering queue.
-        rtcp_update_jitter(&s->statistics, timestamp, arrival_ts);
-    }
-
-    if ((s->seq == 0 && !s->queue) || s->queue_size <= 1) {
-        /* First packet, or no reordering */
-        return rtp_parse_packet_internal(s, pkt, buf, len);
-    } else {
-        uint16_t seq = AV_RB16(buf + 2);
-        int16_t diff = seq - s->seq;
-        if (diff < 0) {
-            /* Packet older than the previously emitted one, drop */
-            av_log(s->st ? s->st->codec : NULL, AV_LOG_WARNING,
-                   "RTP: dropping old packet received too late\n");
-            return -1;
-        } else if (diff <= 1) {
-            /* Correct packet */
-            rv = rtp_parse_packet_internal(s, pkt, buf, len);
-            return rv;
-        } else {
-            /* Still missing some packet, enqueue this one. */
-            enqueue_packet(s, buf, len);
-            *bufptr = NULL;
-            /* Return the first enqueued packet if the queue is full,
-             * even if we're missing something */
-            if (s->queue_len >= s->queue_size)
-                return rtp_parse_queued_packet(s, pkt);
-            return -1;
-        }
-    }
-}
-
-/**
- * Parse an RTP or RTCP packet directly sent as a buffer.
- * @param s RTP parse context.
- * @param pkt returned packet
- * @param bufptr pointer to the input buffer or NULL to read the next packets
- * @param len buffer len
- * @return 0 if a packet is returned, 1 if a packet is returned and more can follow
- * (use buf as NULL to read the next). -1 if no packet (error or no more packet).
- */
-int ff_rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
-                        uint8_t **bufptr, int len)
-{
-    int rv;
-    if (s->srtp_enabled && bufptr && ff_srtp_decrypt(&s->srtp, *bufptr, &len) < 0)
-        return -1;
-    rv = rtp_parse_one_packet(s, pkt, bufptr, len);
-    s->prev_ret = rv;
-    while (rv == AVERROR(EAGAIN) && has_next_packet(s))
-        rv = rtp_parse_queued_packet(s, pkt);
-    return rv ? rv : has_next_packet(s);
-}
-
-void ff_rtp_parse_close(RTPDemuxContext *s)
-{
-    ff_rtp_reset_packet_queue(s);
-    ff_srtp_free(&s->srtp);
-    av_free(s);
-}
-
-int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p,
-                  int (*parse_fmtp)(AVStream *stream,
-                                    PayloadContext *data,
-                                    char *attr, char *value))
-{
-    char attr[256];
-    char *value;
-    int res;
-    int value_size = strlen(p) + 1;
-
-    if (!(value = av_malloc(value_size))) {
-        av_log(NULL, AV_LOG_ERROR, "Failed to allocate data for FMTP.");
-        return AVERROR(ENOMEM);
-    }
-
-    // remove protocol identifier
-    while (*p && *p == ' ')
-        p++;                     // strip spaces
-    while (*p && *p != ' ')
-        p++;                     // eat protocol identifier
-    while (*p && *p == ' ')
-        p++;                     // strip trailing spaces
-
-    while (ff_rtsp_next_attr_and_value(&p,
-                                       attr, sizeof(attr),
-                                       value, value_size)) {
-        res = parse_fmtp(stream, data, attr, value);
-        if (res < 0 && res != AVERROR_PATCHWELCOME) {
-            av_free(value);
-            return res;
-        }
-    }
-    av_free(value);
-    return 0;
-}
-
-int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx)
-{
-    int ret;
-    av_init_packet(pkt);
-
-    pkt->size         = avio_close_dyn_buf(*dyn_buf, &pkt->data);
-    pkt->stream_index = stream_idx;
-    *dyn_buf = NULL;
-    if ((ret = av_packet_from_data(pkt, pkt->data, pkt->size)) < 0) {
-        av_freep(&pkt->data);
-        return ret;
-    }
-    return pkt->size;
-}
diff --git a/deps/libav/libavformat/rtpdec.h b/deps/libav/libavformat/rtpdec.h
deleted file mode 100644
index 6b16117..0000000
--- a/deps/libav/libavformat/rtpdec.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * RTP demuxer definitions
- * Copyright (c) 2002 Fabrice Bellard
- * Copyright (c) 2006 Ryan Martell <rdm4 at martellventures.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTPDEC_H
-#define AVFORMAT_RTPDEC_H
-
-#include "libavcodec/avcodec.h"
-#include "avformat.h"
-#include "rtp.h"
-#include "url.h"
-#include "srtp.h"
-
-typedef struct PayloadContext PayloadContext;
-typedef struct RTPDynamicProtocolHandler RTPDynamicProtocolHandler;
-
-#define RTP_MIN_PACKET_LENGTH 12
-#define RTP_MAX_PACKET_LENGTH 8192
-
-#define RTP_REORDER_QUEUE_DEFAULT_SIZE 10
-
-#define RTP_NOTS_VALUE ((uint32_t)-1)
-
-typedef struct RTPDemuxContext RTPDemuxContext;
-RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st,
-                                   int payload_type, int queue_size);
-void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
-                                       RTPDynamicProtocolHandler *handler);
-void ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite,
-                             const char *params);
-int ff_rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
-                        uint8_t **buf, int len);
-void ff_rtp_parse_close(RTPDemuxContext *s);
-int64_t ff_rtp_queued_packet_time(RTPDemuxContext *s);
-void ff_rtp_reset_packet_queue(RTPDemuxContext *s);
-
-/**
- * Send a dummy packet on both port pairs to set up the connection
- * state in potential NAT routers, so that we're able to receive
- * packets.
- *
- * Note, this only works if the NAT router doesn't remap ports. This
- * isn't a standardized procedure, but it works in many cases in practice.
- *
- * The same routine is used with RDT too, even if RDT doesn't use normal
- * RTP packets otherwise.
- */
-void ff_rtp_send_punch_packets(URLContext* rtp_handle);
-
-/**
- * some rtp servers assume client is dead if they don't hear from them...
- * so we send a Receiver Report to the provided URLContext or AVIOContext
- * (we don't have access to the rtcp handle from here)
- */
-int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd,
-                                  AVIOContext *avio, int count);
-int ff_rtp_send_rtcp_feedback(RTPDemuxContext *s, URLContext *fd,
-                              AVIOContext *avio);
-
-// these statistics are used for rtcp receiver reports...
-typedef struct RTPStatistics {
-    uint16_t max_seq;           ///< highest sequence number seen
-    uint32_t cycles;            ///< shifted count of sequence number cycles
-    uint32_t base_seq;          ///< base sequence number
-    uint32_t bad_seq;           ///< last bad sequence number + 1
-    int probation;              ///< sequence packets till source is valid
-    uint32_t received;          ///< packets received
-    uint32_t expected_prior;    ///< packets expected in last interval
-    uint32_t received_prior;    ///< packets received in last interval
-    uint32_t transit;           ///< relative transit time for previous packet
-    uint32_t jitter;            ///< estimated jitter.
-} RTPStatistics;
-
-#define RTP_FLAG_KEY    0x1 ///< RTP packet contains a keyframe
-#define RTP_FLAG_MARKER 0x2 ///< RTP marker bit was set for this packet
-/**
- * Packet parsing for "private" payloads in the RTP specs.
- *
- * @param ctx RTSP demuxer context
- * @param s stream context
- * @param st stream that this packet belongs to
- * @param pkt packet in which to write the parsed data
- * @param timestamp pointer to the RTP timestamp of the input data, can be
- *                  updated by the function if returning older, buffered data
- * @param buf pointer to raw RTP packet data
- * @param len length of buf
- * @param seq RTP sequence number of the packet
- * @param flags flags from the RTP packet header (RTP_FLAG_*)
- */
-typedef int (*DynamicPayloadPacketHandlerProc)(AVFormatContext *ctx,
-                                               PayloadContext *s,
-                                               AVStream *st, AVPacket *pkt,
-                                               uint32_t *timestamp,
-                                               const uint8_t * buf,
-                                               int len, uint16_t seq, int flags);
-
-struct RTPDynamicProtocolHandler {
-    const char enc_name[50];
-    enum AVMediaType codec_type;
-    enum AVCodecID codec_id;
-    int static_payload_id; /* 0 means no payload id is set. 0 is a valid
-                            * payload ID (PCMU), too, but that format doesn't
-                            * require any custom depacketization code. */
-
-    /** Initialize dynamic protocol handler, called after the full rtpmap line is parsed, may be null */
-    int (*init)(AVFormatContext *s, int st_index, PayloadContext *priv_data);
-    /** Parse the a= line from the sdp field */
-    int (*parse_sdp_a_line)(AVFormatContext *s, int st_index,
-                            PayloadContext *priv_data, const char *line);
-    /** Allocate any data needed by the rtp parsing for this dynamic data. */
-    PayloadContext *(*alloc)(void);
-    /** Free any data needed by the rtp parsing for this dynamic data. */
-    void (*free)(PayloadContext *protocol_data);
-    /** Parse handler for this dynamic packet */
-    DynamicPayloadPacketHandlerProc parse_packet;
-    int (*need_keyframe)(PayloadContext *context);
-
-    struct RTPDynamicProtocolHandler *next;
-};
-
-typedef struct RTPPacket {
-    uint16_t seq;
-    uint8_t *buf;
-    int len;
-    int64_t recvtime;
-    struct RTPPacket *next;
-} RTPPacket;
-
-struct RTPDemuxContext {
-    AVFormatContext *ic;
-    AVStream *st;
-    int payload_type;
-    uint32_t ssrc;
-    uint16_t seq;
-    uint32_t timestamp;
-    uint32_t base_timestamp;
-    uint32_t cur_timestamp;
-    int64_t  unwrapped_timestamp;
-    int64_t  range_start_offset;
-    int max_payload_size;
-    /* used to send back RTCP RR */
-    char hostname[256];
-
-    int srtp_enabled;
-    struct SRTPContext srtp;
-
-    /** Statistics for this stream (used by RTCP receiver reports) */
-    RTPStatistics statistics;
-
-    /** Fields for packet reordering @{ */
-    int prev_ret;     ///< The return value of the actual parsing of the previous packet
-    RTPPacket* queue; ///< A sorted queue of buffered packets not yet returned
-    int queue_len;    ///< The number of packets in queue
-    int queue_size;   ///< The size of queue, or 0 if reordering is disabled
-    /*@}*/
-
-    /* rtcp sender statistics receive */
-    int64_t last_rtcp_ntp_time;
-    int64_t last_rtcp_reception_time;
-    int64_t first_rtcp_ntp_time;
-    uint32_t last_rtcp_timestamp;
-    int64_t rtcp_ts_offset;
-
-    /* rtcp sender statistics */
-    unsigned int packet_count;
-    unsigned int octet_count;
-    unsigned int last_octet_count;
-    int64_t last_feedback_time;
-
-    /* dynamic payload stuff */
-    const RTPDynamicProtocolHandler *handler;
-    PayloadContext *dynamic_protocol_context;
-};
-
-void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler);
-RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name,
-                                                  enum AVMediaType codec_type);
-RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id,
-                                                enum AVMediaType codec_type);
-
-/* from rtsp.c, but used by rtp dynamic protocol handlers. */
-int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size,
-                                char *value, int value_size);
-
-int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p,
-                  int (*parse_fmtp)(AVStream *stream,
-                                    PayloadContext *data,
-                                    char *attr, char *value));
-
-void ff_register_rtp_dynamic_payload_handlers(void);
-
-/**
- * Close the dynamic buffer and make a packet from it.
- */
-int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx);
-
-#endif /* AVFORMAT_RTPDEC_H */
diff --git a/deps/libav/libavformat/rtpdec_amr.c b/deps/libav/libavformat/rtpdec_amr.c
deleted file mode 100644
index fd18ff2..0000000
--- a/deps/libav/libavformat/rtpdec_amr.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * RTP AMR Depacketizer, RFC 3267
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-#include "rtpdec_formats.h"
-#include "libavutil/avstring.h"
-
-static const uint8_t frame_sizes_nb[16] = {
-    12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0
-};
-static const uint8_t frame_sizes_wb[16] = {
-    17, 23, 32, 36, 40, 46, 50, 58, 60, 5, 5, 0, 0, 0, 0, 0
-};
-
-struct PayloadContext {
-    int octet_align;
-    int crc;
-    int interleaving;
-    int channels;
-};
-
-static PayloadContext *amr_new_context(void)
-{
-    PayloadContext *data = av_mallocz(sizeof(PayloadContext));
-    if(!data) return data;
-    data->channels = 1;
-    return data;
-}
-
-static void amr_free_context(PayloadContext *data)
-{
-    av_free(data);
-}
-
-static int amr_handle_packet(AVFormatContext *ctx, PayloadContext *data,
-                             AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                             const uint8_t *buf, int len, uint16_t seq,
-                             int flags)
-{
-    const uint8_t *frame_sizes = NULL;
-    int frames;
-    int i;
-    const uint8_t *speech_data;
-    uint8_t *ptr;
-
-    if (st->codec->codec_id == AV_CODEC_ID_AMR_NB) {
-        frame_sizes = frame_sizes_nb;
-    } else if (st->codec->codec_id == AV_CODEC_ID_AMR_WB) {
-        frame_sizes = frame_sizes_wb;
-    } else {
-        av_log(ctx, AV_LOG_ERROR, "Bad codec ID\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (st->codec->channels != 1) {
-        av_log(ctx, AV_LOG_ERROR, "Only mono AMR is supported\n");
-        return AVERROR_INVALIDDATA;
-    }
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-
-    /* The AMR RTP packet consists of one header byte, followed
-     * by one TOC byte for each AMR frame in the packet, followed
-     * by the speech data for all the AMR frames.
-     *
-     * The header byte contains only a codec mode request, for
-     * requesting what kind of AMR data the sender wants to
-     * receive. Not used at the moment.
-     */
-
-    /* Count the number of frames in the packet. The highest bit
-     * is set in a TOC byte if there are more frames following.
-     */
-    for (frames = 1; frames < len && (buf[frames] & 0x80); frames++) ;
-
-    if (1 + frames >= len) {
-        /* We hit the end of the packet while counting frames. */
-        av_log(ctx, AV_LOG_ERROR, "No speech data found\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    speech_data = buf + 1 + frames;
-
-    /* Everything except the codec mode request byte should be output. */
-    if (av_new_packet(pkt, len - 1)) {
-        av_log(ctx, AV_LOG_ERROR, "Out of memory\n");
-        return AVERROR(ENOMEM);
-    }
-    pkt->stream_index = st->index;
-    ptr = pkt->data;
-
-    for (i = 0; i < frames; i++) {
-        uint8_t toc = buf[1 + i];
-        int frame_size = frame_sizes[(toc >> 3) & 0x0f];
-
-        if (speech_data + frame_size > buf + len) {
-            /* Too little speech data */
-            av_log(ctx, AV_LOG_WARNING, "Too little speech data in the RTP packet\n");
-            /* Set the unwritten part of the packet to zero. */
-            memset(ptr, 0, pkt->data + pkt->size - ptr);
-            pkt->size = ptr - pkt->data;
-            return 0;
-        }
-
-        /* Extract the AMR frame mode from the TOC byte */
-        *ptr++ = toc & 0x7C;
-
-        /* Copy the speech data */
-        memcpy(ptr, speech_data, frame_size);
-        speech_data += frame_size;
-        ptr += frame_size;
-    }
-
-    if (speech_data < buf + len) {
-        av_log(ctx, AV_LOG_WARNING, "Too much speech data in the RTP packet?\n");
-        /* Set the unwritten part of the packet to zero. */
-        memset(ptr, 0, pkt->data + pkt->size - ptr);
-        pkt->size = ptr - pkt->data;
-    }
-
-    return 0;
-}
-
-static int amr_parse_fmtp(AVStream *stream, PayloadContext *data,
-                          char *attr, char *value)
-{
-    /* Some AMR SDP configurations contain "octet-align", without
-     * the trailing =1. Therefore, if the value is empty,
-     * interpret it as "1".
-     */
-    if (!strcmp(value, "")) {
-        av_log(NULL, AV_LOG_WARNING, "AMR fmtp attribute %s had "
-                                     "nonstandard empty value\n", attr);
-        strcpy(value, "1");
-    }
-    if (!strcmp(attr, "octet-align"))
-        data->octet_align = atoi(value);
-    else if (!strcmp(attr, "crc"))
-        data->crc = atoi(value);
-    else if (!strcmp(attr, "interleaving"))
-        data->interleaving = atoi(value);
-    else if (!strcmp(attr, "channels"))
-        data->channels = atoi(value);
-    return 0;
-}
-
-static int amr_parse_sdp_line(AVFormatContext *s, int st_index,
-                              PayloadContext *data, const char *line)
-{
-    const char *p;
-    int ret;
-
-    if (st_index < 0)
-        return 0;
-
-    /* Parse an fmtp line this one:
-     * a=fmtp:97 octet-align=1; interleaving=0
-     * That is, a normal fmtp: line followed by semicolon & space
-     * separated key/value pairs.
-     */
-    if (av_strstart(line, "fmtp:", &p)) {
-        ret = ff_parse_fmtp(s->streams[st_index], data, p, amr_parse_fmtp);
-        if (!data->octet_align || data->crc ||
-            data->interleaving || data->channels != 1) {
-            av_log(s, AV_LOG_ERROR, "Unsupported RTP/AMR configuration!\n");
-            return -1;
-        }
-        return ret;
-    }
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = {
-    .enc_name         = "AMR",
-    .codec_type       = AVMEDIA_TYPE_AUDIO,
-    .codec_id         = AV_CODEC_ID_AMR_NB,
-    .parse_sdp_a_line = amr_parse_sdp_line,
-    .alloc            = amr_new_context,
-    .free             = amr_free_context,
-    .parse_packet     = amr_handle_packet,
-};
-
-RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = {
-    .enc_name         = "AMR-WB",
-    .codec_type       = AVMEDIA_TYPE_AUDIO,
-    .codec_id         = AV_CODEC_ID_AMR_WB,
-    .parse_sdp_a_line = amr_parse_sdp_line,
-    .alloc            = amr_new_context,
-    .free             = amr_free_context,
-    .parse_packet     = amr_handle_packet,
-};
diff --git a/deps/libav/libavformat/rtpdec_asf.c b/deps/libav/libavformat/rtpdec_asf.c
deleted file mode 100644
index 61b1419..0000000
--- a/deps/libav/libavformat/rtpdec_asf.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * Microsoft RTP/ASF support.
- * Copyright (c) 2008 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Microsoft RTP/ASF support
- * @author Ronald S. Bultje <rbultje at ronald.bitfreak.net>
- */
-
-#include "libavutil/base64.h"
-#include "libavutil/avstring.h"
-#include "libavutil/intreadwrite.h"
-#include "rtp.h"
-#include "rtpdec_formats.h"
-#include "rtsp.h"
-#include "asf.h"
-#include "avio_internal.h"
-#include "internal.h"
-
-/**
- * From MSDN 2.2.1.4, we learn that ASF data packets over RTP should not
- * contain any padding. Unfortunately, the header min/max_pktsize are not
- * updated (thus making min_pktsize invalid). Here, we "fix" these faulty
- * min_pktsize values in the ASF file header.
- * @return 0 on success, <0 on failure (currently -1).
- */
-static int rtp_asf_fix_header(uint8_t *buf, int len)
-{
-    uint8_t *p = buf, *end = buf + len;
-
-    if (len < sizeof(ff_asf_guid) * 2 + 22 ||
-        memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) {
-        return -1;
-    }
-    p += sizeof(ff_asf_guid) + 14;
-    do {
-        uint64_t chunksize = AV_RL64(p + sizeof(ff_asf_guid));
-        if (memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) {
-            if (chunksize > end - p)
-                return -1;
-            p += chunksize;
-            continue;
-        }
-
-        /* skip most of the file header, to min_pktsize */
-        p += 6 * 8 + 3 * 4 + sizeof(ff_asf_guid) * 2;
-        if (p + 8 <= end && AV_RL32(p) == AV_RL32(p + 4)) {
-            /* and set that to zero */
-            AV_WL32(p, 0);
-            return 0;
-        }
-        break;
-    } while (end - p >= sizeof(ff_asf_guid) + 8);
-
-    return -1;
-}
-
-/**
- * The following code is basically a buffered AVIOContext,
- * with the added benefit of returning -EAGAIN (instead of 0)
- * on packet boundaries, such that the ASF demuxer can return
- * safely and resume business at the next packet.
- */
-static int packetizer_read(void *opaque, uint8_t *buf, int buf_size)
-{
-    return AVERROR(EAGAIN);
-}
-
-static void init_packetizer(AVIOContext *pb, uint8_t *buf, int len)
-{
-    ffio_init_context(pb, buf, len, 0, NULL, packetizer_read, NULL, NULL);
-
-    /* this "fills" the buffer with its current content */
-    pb->pos     = len;
-    pb->buf_end = buf + len;
-}
-
-int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
-{
-    int ret = 0;
-    if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
-        AVIOContext pb;
-        RTSPState *rt = s->priv_data;
-        AVDictionary *opts = NULL;
-        int len = strlen(p) * 6 / 8;
-        char *buf = av_mallocz(len);
-        av_base64_decode(buf, p, len);
-
-        if (rtp_asf_fix_header(buf, len) < 0)
-            av_log(s, AV_LOG_ERROR,
-                   "Failed to fix invalid RTSP-MS/ASF min_pktsize\n");
-        init_packetizer(&pb, buf, len);
-        if (rt->asf_ctx) {
-            avformat_close_input(&rt->asf_ctx);
-        }
-        if (!(rt->asf_ctx = avformat_alloc_context()))
-            return AVERROR(ENOMEM);
-        rt->asf_ctx->pb      = &pb;
-        av_dict_set(&opts, "no_resync_search", "1", 0);
-        ret = avformat_open_input(&rt->asf_ctx, "", &ff_asf_demuxer, &opts);
-        av_dict_free(&opts);
-        if (ret < 0)
-            return ret;
-        av_dict_copy(&s->metadata, rt->asf_ctx->metadata, 0);
-        rt->asf_pb_pos = avio_tell(&pb);
-        av_free(buf);
-        rt->asf_ctx->pb = NULL;
-    }
-    return ret;
-}
-
-static int asfrtp_parse_sdp_line(AVFormatContext *s, int stream_index,
-                                 PayloadContext *asf, const char *line)
-{
-    if (stream_index < 0)
-        return 0;
-    if (av_strstart(line, "stream:", &line)) {
-        RTSPState *rt = s->priv_data;
-
-        s->streams[stream_index]->id = strtol(line, NULL, 10);
-
-        if (rt->asf_ctx) {
-            int i;
-
-            for (i = 0; i < rt->asf_ctx->nb_streams; i++) {
-                if (s->streams[stream_index]->id == rt->asf_ctx->streams[i]->id) {
-                    *s->streams[stream_index]->codec =
-                        *rt->asf_ctx->streams[i]->codec;
-                    s->streams[stream_index]->need_parsing =
-                        rt->asf_ctx->streams[i]->need_parsing;
-                    rt->asf_ctx->streams[i]->codec->extradata_size = 0;
-                    rt->asf_ctx->streams[i]->codec->extradata = NULL;
-                    avpriv_set_pts_info(s->streams[stream_index], 32, 1, 1000);
-                }
-           }
-        }
-    }
-
-    return 0;
-}
-
-struct PayloadContext {
-    AVIOContext *pktbuf, pb;
-    uint8_t *buf;
-};
-
-/**
- * @return 0 when a packet was written into /p pkt, and no more data is left;
- *         1 when a packet was written into /p pkt, and more packets might be left;
- *        <0 when not enough data was provided to return a full packet, or on error.
- */
-static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
-                               AVStream *st, AVPacket *pkt,
-                               uint32_t *timestamp,
-                               const uint8_t *buf, int len, uint16_t seq,
-                               int flags)
-{
-    AVIOContext *pb = &asf->pb;
-    int res, mflags, len_off;
-    RTSPState *rt = s->priv_data;
-
-    if (!rt->asf_ctx)
-        return -1;
-
-    if (len > 0) {
-        int off, out_len = 0;
-
-        if (len < 4)
-            return -1;
-
-        av_freep(&asf->buf);
-
-        ffio_init_context(pb, buf, len, 0, NULL, NULL, NULL, NULL);
-
-        while (avio_tell(pb) + 4 < len) {
-            int start_off = avio_tell(pb);
-
-            mflags = avio_r8(pb);
-            if (mflags & 0x80)
-                flags |= RTP_FLAG_KEY;
-            len_off = avio_rb24(pb);
-            if (mflags & 0x20)   /**< relative timestamp */
-                avio_skip(pb, 4);
-            if (mflags & 0x10)   /**< has duration */
-                avio_skip(pb, 4);
-            if (mflags & 0x8)    /**< has location ID */
-                avio_skip(pb, 4);
-            off = avio_tell(pb);
-
-            if (!(mflags & 0x40)) {
-                /**
-                 * If 0x40 is not set, the len_off field specifies an offset
-                 * of this packet's payload data in the complete (reassembled)
-                 * ASF packet. This is used to spread one ASF packet over
-                 * multiple RTP packets.
-                 */
-                if (asf->pktbuf && len_off != avio_tell(asf->pktbuf)) {
-                    uint8_t *p;
-                    avio_close_dyn_buf(asf->pktbuf, &p);
-                    asf->pktbuf = NULL;
-                    av_free(p);
-                }
-                if (!len_off && !asf->pktbuf &&
-                    (res = avio_open_dyn_buf(&asf->pktbuf)) < 0)
-                    return res;
-                if (!asf->pktbuf)
-                    return AVERROR(EIO);
-
-                avio_write(asf->pktbuf, buf + off, len - off);
-                avio_skip(pb, len - off);
-                if (!(flags & RTP_FLAG_MARKER))
-                    return -1;
-                out_len     = avio_close_dyn_buf(asf->pktbuf, &asf->buf);
-                asf->pktbuf = NULL;
-            } else {
-                /**
-                 * If 0x40 is set, the len_off field specifies the length of
-                 * the next ASF packet that can be read from this payload
-                 * data alone. This is commonly the same as the payload size,
-                 * but could be less in case of packet splitting (i.e.
-                 * multiple ASF packets in one RTP packet).
-                 */
-
-                int cur_len = start_off + len_off - off;
-                int prev_len = out_len;
-                out_len += cur_len;
-                if (FFMIN(cur_len, len - off) < 0)
-                    return -1;
-                if ((res = av_reallocp(&asf->buf, out_len)) < 0)
-                    return res;
-                memcpy(asf->buf + prev_len, buf + off,
-                       FFMIN(cur_len, len - off));
-                avio_skip(pb, cur_len);
-            }
-        }
-
-        init_packetizer(pb, asf->buf, out_len);
-        pb->pos += rt->asf_pb_pos;
-        pb->eof_reached = 0;
-        rt->asf_ctx->pb = pb;
-    }
-
-    for (;;) {
-        int i;
-
-        res = ff_read_packet(rt->asf_ctx, pkt);
-        rt->asf_pb_pos = avio_tell(pb);
-        if (res != 0)
-            break;
-        for (i = 0; i < s->nb_streams; i++) {
-            if (s->streams[i]->id == rt->asf_ctx->streams[pkt->stream_index]->id) {
-                pkt->stream_index = i;
-                return 1; // FIXME: return 0 if last packet
-            }
-        }
-        av_free_packet(pkt);
-    }
-
-    return res == 1 ? -1 : res;
-}
-
-static PayloadContext *asfrtp_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static void asfrtp_free_context(PayloadContext *asf)
-{
-    if (asf->pktbuf) {
-        uint8_t *p = NULL;
-        avio_close_dyn_buf(asf->pktbuf, &p);
-        asf->pktbuf = NULL;
-        av_free(p);
-    }
-    av_freep(&asf->buf);
-    av_free(asf);
-}
-
-#define RTP_ASF_HANDLER(n, s, t) \
-RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \
-    .enc_name         = s, \
-    .codec_type       = t, \
-    .codec_id         = AV_CODEC_ID_NONE, \
-    .parse_sdp_a_line = asfrtp_parse_sdp_line, \
-    .alloc            = asfrtp_new_context, \
-    .free             = asfrtp_free_context, \
-    .parse_packet     = asfrtp_parse_packet,   \
-}
-
-RTP_ASF_HANDLER(asf_pfv, "x-asf-pf",  AVMEDIA_TYPE_VIDEO);
-RTP_ASF_HANDLER(asf_pfa, "x-asf-pf",  AVMEDIA_TYPE_AUDIO);
diff --git a/deps/libav/libavformat/rtpdec_formats.h b/deps/libav/libavformat/rtpdec_formats.h
deleted file mode 100644
index e5f4ccb..0000000
--- a/deps/libav/libavformat/rtpdec_formats.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * RTP depacketizer declarations
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTPDEC_FORMATS_H
-#define AVFORMAT_RTPDEC_FORMATS_H
-
-#include "rtpdec.h"
-
-/**
- * Parse a Windows Media Server-specific SDP line
- *
- * @param s RTSP demux context
- */
-int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p);
-
-int ff_h263_handle_packet(AVFormatContext *ctx, PayloadContext *data,
-                          AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                          const uint8_t *buf, int len, uint16_t seq, int flags);
-
-extern RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_g726_16_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_g726_24_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_g726_32_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_g726_40_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_h263_1998_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_h263_rfc2190_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_h264_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_ilbc_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_jpeg_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_mpeg_video_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_mpegts_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_ms_rtp_asf_pfa_handler;
-extern RTPDynamicProtocolHandler ff_ms_rtp_asf_pfv_handler;
-extern RTPDynamicProtocolHandler ff_qcelp_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_qdm2_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_qt_rtp_aud_handler;
-extern RTPDynamicProtocolHandler ff_qt_rtp_vid_handler;
-extern RTPDynamicProtocolHandler ff_quicktime_rtp_aud_handler;
-extern RTPDynamicProtocolHandler ff_quicktime_rtp_vid_handler;
-extern RTPDynamicProtocolHandler ff_svq3_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_theora_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_vorbis_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_vp8_dynamic_handler;
-
-#endif /* AVFORMAT_RTPDEC_FORMATS_H */
diff --git a/deps/libav/libavformat/rtpdec_g726.c b/deps/libav/libavformat/rtpdec_g726.c
deleted file mode 100644
index 7b3f6cb..0000000
--- a/deps/libav/libavformat/rtpdec_g726.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2011 Miroslav Slugeň <Thunder.m at seznam.cz>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "avformat.h"
-#include "rtpdec_formats.h"
-
-#define RTP_G726_HANDLER(bitrate) \
-static av_cold int g726_ ## bitrate ##_init(AVFormatContext *s, int st_index, \
-                                            PayloadContext *data) \
-{ \
-    AVStream *stream = s->streams[st_index]; \
-    AVCodecContext *codec = stream->codec; \
-\
-    codec->bits_per_coded_sample = bitrate/8; \
-    codec->bit_rate = codec->bits_per_coded_sample * codec->sample_rate; \
-\
-    return 0; \
-} \
-\
-RTPDynamicProtocolHandler ff_g726_ ## bitrate ## _dynamic_handler = { \
-    .enc_name   = "G726-" #bitrate, \
-    .codec_type = AVMEDIA_TYPE_AUDIO, \
-    .codec_id   = AV_CODEC_ID_ADPCM_G726, \
-    .init       = g726_ ## bitrate ## _init, \
-}
-
-RTP_G726_HANDLER(16);
-RTP_G726_HANDLER(24);
-RTP_G726_HANDLER(32);
-RTP_G726_HANDLER(40);
diff --git a/deps/libav/libavformat/rtpdec_h263.c b/deps/libav/libavformat/rtpdec_h263.c
deleted file mode 100644
index b371491..0000000
--- a/deps/libav/libavformat/rtpdec_h263.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * RTP H.263 Depacketizer, RFC 4629
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpdec_formats.h"
-#include "libavutil/attributes.h"
-#include "libavutil/intreadwrite.h"
-
-static av_cold int h263_init(AVFormatContext *ctx, int st_index,
-                             PayloadContext *data)
-{
-    if (st_index < 0)
-        return 0;
-    ctx->streams[st_index]->need_parsing = AVSTREAM_PARSE_FULL;
-    return 0;
-}
-
-int ff_h263_handle_packet(AVFormatContext *ctx, PayloadContext *data,
-                          AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                          const uint8_t *buf, int len, uint16_t seq, int flags)
-{
-    uint8_t *ptr;
-    uint16_t header;
-    int startcode, vrc, picture_header;
-
-    if (len < 2) {
-        av_log(ctx, AV_LOG_ERROR, "Too short H.263 RTP packet\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Decode the 16 bit H.263+ payload header, as described in section
-     * 5.1 of RFC 4629. The fields of this header are:
-     * - 5 reserved bits, should be ignored.
-     * - One bit (P, startcode), indicating a picture start, picture segment
-     *   start or video sequence end. If set, two zero bytes should be
-     *   prepended to the payload.
-     * - One bit (V, vrc), indicating the presence of an 8 bit Video
-     *   Redundancy Coding field after this 16 bit header.
-     * - 6 bits (PLEN, picture_header), the length (in bytes) of an extra
-     *   picture header, following the VRC field.
-     * - 3 bits (PEBIT), the number of bits to ignore of the last byte
-     *   of the extra picture header. (Not used at the moment.)
-     */
-    header = AV_RB16(buf);
-    startcode      = (header & 0x0400) >> 9;
-    vrc            =  header & 0x0200;
-    picture_header = (header & 0x01f8) >> 3;
-    buf += 2;
-    len -= 2;
-
-    if (vrc) {
-        /* Skip VRC header if present, not used at the moment. */
-        buf += 1;
-        len -= 1;
-    }
-    if (picture_header) {
-        /* Skip extra picture header if present, not used at the moment. */
-        buf += picture_header;
-        len -= picture_header;
-    }
-
-    if (len < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Too short H.263 RTP packet\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (av_new_packet(pkt, len + startcode)) {
-        av_log(ctx, AV_LOG_ERROR, "Out of memory\n");
-        return AVERROR(ENOMEM);
-    }
-    pkt->stream_index = st->index;
-    ptr = pkt->data;
-
-    if (startcode) {
-        *ptr++ = 0;
-        *ptr++ = 0;
-    }
-    memcpy(ptr, buf, len);
-
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_h263_1998_dynamic_handler = {
-    .enc_name         = "H263-1998",
-    .codec_type       = AVMEDIA_TYPE_VIDEO,
-    .codec_id         = AV_CODEC_ID_H263,
-    .init             = h263_init,
-    .parse_packet     = ff_h263_handle_packet,
-};
-
-RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler = {
-    .enc_name         = "H263-2000",
-    .codec_type       = AVMEDIA_TYPE_VIDEO,
-    .codec_id         = AV_CODEC_ID_H263,
-    .init             = h263_init,
-    .parse_packet     = ff_h263_handle_packet,
-};
diff --git a/deps/libav/libavformat/rtpdec_h263_rfc2190.c b/deps/libav/libavformat/rtpdec_h263_rfc2190.c
deleted file mode 100644
index 116db75..0000000
--- a/deps/libav/libavformat/rtpdec_h263_rfc2190.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * RTP H.263 Depacketizer, RFC 2190
- * Copyright (c) 2012 Martin Storsjo
- * Based on the GStreamer H.263 Depayloder:
- * Copyright 2005 Wim Taymans
- * Copyright 2007 Edward Hervey
- * Copyright 2007 Nokia Corporation
- * Copyright 2007 Collabora Ltd, Philippe Kalaf
- * Copyright 2010 Mark Nauwelaerts
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpdec_formats.h"
-#include "libavutil/attributes.h"
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/get_bits.h"
-
-struct PayloadContext {
-    AVIOContext *buf;
-    uint8_t      endbyte;
-    int          endbyte_bits;
-    uint32_t     timestamp;
-    int          newformat;
-};
-
-static PayloadContext *h263_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static void h263_free_context(PayloadContext *data)
-{
-    if (!data)
-        return;
-    if (data->buf) {
-        uint8_t *p;
-        avio_close_dyn_buf(data->buf, &p);
-        av_free(p);
-    }
-    av_free(data);
-}
-
-static av_cold int h263_init(AVFormatContext *ctx, int st_index, PayloadContext *data)
-{
-    if (st_index < 0)
-        return 0;
-    ctx->streams[st_index]->need_parsing = AVSTREAM_PARSE_FULL;
-    return 0;
-}
-
-static int h263_handle_packet(AVFormatContext *ctx, PayloadContext *data,
-                              AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                              const uint8_t *buf, int len, uint16_t seq,
-                              int flags)
-{
-    /* Corresponding to header fields in the RFC */
-    int f, p, i, sbit, ebit, src, r;
-    int header_size, ret;
-
-    if (data->newformat)
-        return ff_h263_handle_packet(ctx, data, st, pkt, timestamp, buf, len,
-                                     seq, flags);
-
-    if (data->buf && data->timestamp != *timestamp) {
-        /* Dropping old buffered, unfinished data */
-        uint8_t *p;
-        avio_close_dyn_buf(data->buf, &p);
-        av_free(p);
-        data->buf = NULL;
-    }
-
-    if (len < 4) {
-        av_log(ctx, AV_LOG_ERROR, "Too short H.263 RTP packet: %d\n", len);
-        return AVERROR_INVALIDDATA;
-    }
-
-    f = buf[0] & 0x80;
-    p = buf[0] & 0x40;
-    if (!f) {
-        /* Mode A */
-        header_size = 4;
-        i = buf[1] & 0x10;
-        r = ((buf[1] & 0x01) << 3) | ((buf[2] & 0xe0) >> 5);
-    } else if (!p) {
-        /* Mode B */
-        header_size = 8;
-        if (len < header_size) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Too short H.263 RTP packet: %d bytes, %d header bytes\n",
-                   len, header_size);
-            return AVERROR_INVALIDDATA;
-        }
-        r = buf[3] & 0x03;
-        i = buf[4] & 0x80;
-    } else {
-        /* Mode C */
-        header_size = 12;
-        if (len < header_size) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Too short H.263 RTP packet: %d bytes, %d header bytes\n",
-                   len, header_size);
-            return AVERROR_INVALIDDATA;
-        }
-        r = buf[3] & 0x03;
-        i = buf[4] & 0x80;
-    }
-    sbit = (buf[0] >> 3) & 0x7;
-    ebit =  buf[0]       & 0x7;
-    src  = (buf[1] & 0xe0) >> 5;
-    if (!(buf[0] & 0xf8)) { /* Reserved bits in RFC 2429/4629 are zero */
-        if ((src == 0 || src >= 6) && r) {
-            /* Invalid src for this format, and bits that should be zero
-             * according to RFC 2190 aren't zero. */
-            av_log(ctx, AV_LOG_WARNING,
-                   "Interpreting H263 RTP data as RFC 2429/4629 even though "
-                   "signalled with a static payload type.\n");
-            data->newformat = 1;
-            return ff_h263_handle_packet(ctx, data, st, pkt, timestamp, buf,
-                                         len, seq, flags);
-        }
-    }
-
-    buf += header_size;
-    len -= header_size;
-
-    if (!data->buf) {
-        /* Check the picture start code, only start buffering a new frame
-         * if this is correct */
-        if (len > 4 && AV_RB32(buf) >> 10 == 0x20) {
-            ret = avio_open_dyn_buf(&data->buf);
-            if (ret < 0)
-                return ret;
-            data->timestamp = *timestamp;
-        } else {
-            /* Frame not started yet, skipping */
-            return AVERROR(EAGAIN);
-        }
-    }
-
-    if (data->endbyte_bits || sbit) {
-        if (data->endbyte_bits == sbit) {
-            data->endbyte |= buf[0] & (0xff >> sbit);
-            data->endbyte_bits = 0;
-            buf++;
-            len--;
-            avio_w8(data->buf, data->endbyte);
-        } else {
-            /* Start/end skip bits not matching - missed packets? */
-            GetBitContext gb;
-            init_get_bits(&gb, buf, len*8 - ebit);
-            skip_bits(&gb, sbit);
-            if (data->endbyte_bits) {
-                data->endbyte |= get_bits(&gb, 8 - data->endbyte_bits);
-                avio_w8(data->buf, data->endbyte);
-            }
-            while (get_bits_left(&gb) >= 8)
-                avio_w8(data->buf, get_bits(&gb, 8));
-            data->endbyte_bits = get_bits_left(&gb);
-            if (data->endbyte_bits)
-                data->endbyte = get_bits(&gb, data->endbyte_bits) <<
-                                (8 - data->endbyte_bits);
-            ebit = 0;
-            len = 0;
-        }
-    }
-    if (ebit) {
-        if (len > 0)
-            avio_write(data->buf, buf, len - 1);
-        data->endbyte_bits = 8 - ebit;
-        data->endbyte = buf[len - 1] & (0xff << ebit);
-    } else {
-        avio_write(data->buf, buf, len);
-    }
-
-    if (!(flags & RTP_FLAG_MARKER))
-        return AVERROR(EAGAIN);
-
-    if (data->endbyte_bits)
-        avio_w8(data->buf, data->endbyte);
-    data->endbyte_bits = 0;
-
-    ret = ff_rtp_finalize_packet(pkt, &data->buf, st->index);
-    if (ret < 0)
-        return ret;
-    if (!i)
-        pkt->flags   |= AV_PKT_FLAG_KEY;
-
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_h263_rfc2190_dynamic_handler = {
-    .codec_type        = AVMEDIA_TYPE_VIDEO,
-    .codec_id          = AV_CODEC_ID_H263,
-    .init              = h263_init,
-    .parse_packet      = h263_handle_packet,
-    .alloc             = h263_new_context,
-    .free              = h263_free_context,
-    .static_payload_id = 34,
-};
diff --git a/deps/libav/libavformat/rtpdec_h264.c b/deps/libav/libavformat/rtpdec_h264.c
deleted file mode 100644
index 982eb72..0000000
--- a/deps/libav/libavformat/rtpdec_h264.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * RTP H264 Protocol (RFC3984)
- * Copyright (c) 2006 Ryan Martell
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief H.264 / RTP Code (RFC3984)
- * @author Ryan Martell <rdm4 at martellventures.com>
- *
- * @note Notes:
- * Notes:
- * This currently supports packetization mode:
- * Single Nal Unit Mode (0), or
- * Non-Interleaved Mode (1).  It currently does not support
- * Interleaved Mode (2). (This requires implementing STAP-B, MTAP16, MTAP24,
- *                        FU-B packet types)
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/base64.h"
-#include "libavutil/avstring.h"
-#include "libavcodec/get_bits.h"
-#include "avformat.h"
-
-#include "network.h"
-#include <assert.h>
-
-#include "rtpdec.h"
-#include "rtpdec_formats.h"
-
-struct PayloadContext {
-    // sdp setup parameters
-    uint8_t profile_idc;
-    uint8_t profile_iop;
-    uint8_t level_idc;
-    int packetization_mode;
-#ifdef DEBUG
-    int packet_types_received[32];
-#endif
-};
-
-#ifdef DEBUG
-#define COUNT_NAL_TYPE(data, nal) data->packet_types_received[(nal) & 0x1f]++
-#else
-#define COUNT_NAL_TYPE(data, nal) do { } while (0)
-#endif
-
-static const uint8_t start_sequence[] = { 0, 0, 0, 1 };
-
-static int sdp_parse_fmtp_config_h264(AVStream *stream,
-                                      PayloadContext *h264_data,
-                                      char *attr, char *value)
-{
-    AVCodecContext *codec = stream->codec;
-    assert(codec->codec_id == AV_CODEC_ID_H264);
-    assert(h264_data != NULL);
-
-    if (!strcmp(attr, "packetization-mode")) {
-        av_log(codec, AV_LOG_DEBUG, "RTP Packetization Mode: %d\n", atoi(value));
-        h264_data->packetization_mode = atoi(value);
-        /*
-         * Packetization Mode:
-         * 0 or not present: Single NAL mode (Only nals from 1-23 are allowed)
-         * 1: Non-interleaved Mode: 1-23, 24 (STAP-A), 28 (FU-A) are allowed.
-         * 2: Interleaved Mode: 25 (STAP-B), 26 (MTAP16), 27 (MTAP24), 28 (FU-A),
-         *                      and 29 (FU-B) are allowed.
-         */
-        if (h264_data->packetization_mode > 1)
-            av_log(codec, AV_LOG_ERROR,
-                   "Interleaved RTP mode is not supported yet.\n");
-    } else if (!strcmp(attr, "profile-level-id")) {
-        if (strlen(value) == 6) {
-            char buffer[3];
-            // 6 characters=3 bytes, in hex.
-            uint8_t profile_idc;
-            uint8_t profile_iop;
-            uint8_t level_idc;
-
-            buffer[0]   = value[0];
-            buffer[1]   = value[1];
-            buffer[2]   = '\0';
-            profile_idc = strtol(buffer, NULL, 16);
-            buffer[0]   = value[2];
-            buffer[1]   = value[3];
-            profile_iop = strtol(buffer, NULL, 16);
-            buffer[0]   = value[4];
-            buffer[1]   = value[5];
-            level_idc   = strtol(buffer, NULL, 16);
-
-            av_log(codec, AV_LOG_DEBUG,
-                   "RTP Profile IDC: %x Profile IOP: %x Level: %x\n",
-                   profile_idc, profile_iop, level_idc);
-            h264_data->profile_idc = profile_idc;
-            h264_data->profile_iop = profile_iop;
-            h264_data->level_idc   = level_idc;
-        }
-    } else if (!strcmp(attr, "sprop-parameter-sets")) {
-        codec->extradata_size = 0;
-        av_freep(&codec->extradata);
-
-        while (*value) {
-            char base64packet[1024];
-            uint8_t decoded_packet[1024];
-            int packet_size;
-            char *dst = base64packet;
-
-            while (*value && *value != ','
-                   && (dst - base64packet) < sizeof(base64packet) - 1) {
-                *dst++ = *value++;
-            }
-            *dst++ = '\0';
-
-            if (*value == ',')
-                value++;
-
-            packet_size = av_base64_decode(decoded_packet, base64packet,
-                                           sizeof(decoded_packet));
-            if (packet_size > 0) {
-                uint8_t *dest = av_malloc(packet_size + sizeof(start_sequence) +
-                                          codec->extradata_size +
-                                          FF_INPUT_BUFFER_PADDING_SIZE);
-                if (!dest) {
-                    av_log(codec, AV_LOG_ERROR,
-                           "Unable to allocate memory for extradata!\n");
-                    return AVERROR(ENOMEM);
-                }
-                if (codec->extradata_size) {
-                    memcpy(dest, codec->extradata, codec->extradata_size);
-                    av_free(codec->extradata);
-                }
-
-                memcpy(dest + codec->extradata_size, start_sequence,
-                       sizeof(start_sequence));
-                memcpy(dest + codec->extradata_size + sizeof(start_sequence),
-                       decoded_packet, packet_size);
-                memset(dest + codec->extradata_size + sizeof(start_sequence) +
-                       packet_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-
-                codec->extradata       = dest;
-                codec->extradata_size += sizeof(start_sequence) + packet_size;
-            }
-        }
-        av_log(codec, AV_LOG_DEBUG, "Extradata set to %p (size: %d)!\n",
-               codec->extradata, codec->extradata_size);
-    }
-    return 0;
-}
-
-// return 0 on packet, no more left, 1 on packet, 1 on partial packet
-static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
-                              AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                              const uint8_t *buf, int len, uint16_t seq,
-                              int flags)
-{
-    uint8_t nal;
-    uint8_t type;
-    int result = 0;
-
-    if (!len) {
-        av_log(ctx, AV_LOG_ERROR, "Empty H264 RTP packet\n");
-        return AVERROR_INVALIDDATA;
-    }
-    nal  = buf[0];
-    type = nal & 0x1f;
-
-    assert(data);
-    assert(buf);
-
-    /* Simplify the case (these are all the nal types used internally by
-     * the h264 codec). */
-    if (type >= 1 && type <= 23)
-        type = 1;
-    switch (type) {
-    case 0:                    // undefined, but pass them through
-    case 1:
-        if ((result = av_new_packet(pkt, len + sizeof(start_sequence))) < 0)
-            return result;
-        memcpy(pkt->data, start_sequence, sizeof(start_sequence));
-        memcpy(pkt->data + sizeof(start_sequence), buf, len);
-        COUNT_NAL_TYPE(data, nal);
-        break;
-
-    case 24:                   // STAP-A (one packet, multiple nals)
-        // consume the STAP-A NAL
-        buf++;
-        len--;
-        // first we are going to figure out the total size
-        {
-            int pass         = 0;
-            int total_length = 0;
-            uint8_t *dst     = NULL;
-
-            for (pass = 0; pass < 2; pass++) {
-                const uint8_t *src = buf;
-                int src_len        = len;
-
-                while (src_len > 2) {
-                    uint16_t nal_size = AV_RB16(src);
-
-                    // consume the length of the aggregate
-                    src     += 2;
-                    src_len -= 2;
-
-                    if (nal_size <= src_len) {
-                        if (pass == 0) {
-                            // counting
-                            total_length += sizeof(start_sequence) + nal_size;
-                        } else {
-                            // copying
-                            assert(dst);
-                            memcpy(dst, start_sequence, sizeof(start_sequence));
-                            dst += sizeof(start_sequence);
-                            memcpy(dst, src, nal_size);
-                            COUNT_NAL_TYPE(data, *src);
-                            dst += nal_size;
-                        }
-                    } else {
-                        av_log(ctx, AV_LOG_ERROR,
-                               "nal size exceeds length: %d %d\n", nal_size, src_len);
-                    }
-
-                    // eat what we handled
-                    src     += nal_size;
-                    src_len -= nal_size;
-
-                    if (src_len < 0)
-                        av_log(ctx, AV_LOG_ERROR,
-                               "Consumed more bytes than we got! (%d)\n", src_len);
-                }
-
-                if (pass == 0) {
-                    /* now we know the total size of the packet (with the
-                     * start sequences added) */
-                    if ((result = av_new_packet(pkt, total_length)) < 0)
-                        return result;
-                    dst = pkt->data;
-                } else {
-                    assert(dst - pkt->data == total_length);
-                }
-            }
-        }
-        break;
-
-    case 25:                   // STAP-B
-    case 26:                   // MTAP-16
-    case 27:                   // MTAP-24
-    case 29:                   // FU-B
-        av_log(ctx, AV_LOG_ERROR,
-               "Unhandled type (%d) (See RFC for implementation details\n",
-               type);
-        result = AVERROR(ENOSYS);
-        break;
-
-    case 28:                   // FU-A (fragmented nal)
-        buf++;
-        len--;                 // skip the fu_indicator
-        if (len > 1) {
-            // these are the same as above, we just redo them here for clarity
-            uint8_t fu_indicator      = nal;
-            uint8_t fu_header         = *buf;
-            uint8_t start_bit         = fu_header >> 7;
-            uint8_t av_unused end_bit = (fu_header & 0x40) >> 6;
-            uint8_t nal_type          = fu_header & 0x1f;
-            uint8_t reconstructed_nal;
-
-            // Reconstruct this packet's true nal; only the data follows.
-            /* The original nal forbidden bit and NRI are stored in this
-             * packet's nal. */
-            reconstructed_nal  = fu_indicator & 0xe0;
-            reconstructed_nal |= nal_type;
-
-            // skip the fu_header
-            buf++;
-            len--;
-
-            if (start_bit)
-                COUNT_NAL_TYPE(data, nal_type);
-            if (start_bit) {
-                /* copy in the start sequence, and the reconstructed nal */
-                if ((result = av_new_packet(pkt, sizeof(start_sequence) + sizeof(nal) + len)) < 0)
-                    return result;
-                memcpy(pkt->data, start_sequence, sizeof(start_sequence));
-                pkt->data[sizeof(start_sequence)] = reconstructed_nal;
-                memcpy(pkt->data + sizeof(start_sequence) + sizeof(nal), buf, len);
-            } else {
-                if ((result = av_new_packet(pkt, len)) < 0)
-                    return result;
-                memcpy(pkt->data, buf, len);
-            }
-        } else {
-            av_log(ctx, AV_LOG_ERROR, "Too short data for FU-A H264 RTP packet\n");
-            result = AVERROR_INVALIDDATA;
-        }
-        break;
-
-    case 30:                   // undefined
-    case 31:                   // undefined
-    default:
-        av_log(ctx, AV_LOG_ERROR, "Undefined type (%d)\n", type);
-        result = AVERROR_INVALIDDATA;
-        break;
-    }
-
-    pkt->stream_index = st->index;
-
-    return result;
-}
-
-static PayloadContext *h264_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext) + FF_INPUT_BUFFER_PADDING_SIZE);
-}
-
-static void h264_free_context(PayloadContext *data)
-{
-#ifdef DEBUG
-    int ii;
-
-    for (ii = 0; ii < 32; ii++) {
-        if (data->packet_types_received[ii])
-            av_log(NULL, AV_LOG_DEBUG, "Received %d packets of type %d\n",
-                   data->packet_types_received[ii], ii);
-    }
-#endif
-
-    av_free(data);
-}
-
-static av_cold int h264_init(AVFormatContext *s, int st_index,
-                             PayloadContext *data)
-{
-    if (st_index < 0)
-        return 0;
-    s->streams[st_index]->need_parsing = AVSTREAM_PARSE_FULL;
-    return 0;
-}
-
-static int parse_h264_sdp_line(AVFormatContext *s, int st_index,
-                               PayloadContext *h264_data, const char *line)
-{
-    AVStream *stream;
-    AVCodecContext *codec;
-    const char *p = line;
-
-    if (st_index < 0)
-        return 0;
-
-    stream = s->streams[st_index];
-    codec  = stream->codec;
-
-    if (av_strstart(p, "framesize:", &p)) {
-        char buf1[50];
-        char *dst = buf1;
-
-        // remove the protocol identifier
-        while (*p && *p == ' ')
-            p++;                     // strip spaces.
-        while (*p && *p != ' ')
-            p++;                     // eat protocol identifier
-        while (*p && *p == ' ')
-            p++;                     // strip trailing spaces.
-        while (*p && *p != '-' && (dst - buf1) < sizeof(buf1) - 1)
-            *dst++ = *p++;
-        *dst = '\0';
-
-        // a='framesize:96 320-240'
-        // set our parameters
-        codec->width   = atoi(buf1);
-        codec->height  = atoi(p + 1); // skip the -
-    } else if (av_strstart(p, "fmtp:", &p)) {
-        return ff_parse_fmtp(stream, h264_data, p, sdp_parse_fmtp_config_h264);
-    } else if (av_strstart(p, "cliprect:", &p)) {
-        // could use this if we wanted.
-    }
-
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_h264_dynamic_handler = {
-    .enc_name         = "H264",
-    .codec_type       = AVMEDIA_TYPE_VIDEO,
-    .codec_id         = AV_CODEC_ID_H264,
-    .init             = h264_init,
-    .parse_sdp_a_line = parse_h264_sdp_line,
-    .alloc            = h264_new_context,
-    .free             = h264_free_context,
-    .parse_packet     = h264_handle_packet
-};
diff --git a/deps/libav/libavformat/rtpdec_ilbc.c b/deps/libav/libavformat/rtpdec_ilbc.c
deleted file mode 100644
index 2e99734..0000000
--- a/deps/libav/libavformat/rtpdec_ilbc.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * RTP iLBC Depacketizer, RFC 3952
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpdec_formats.h"
-#include "libavutil/avstring.h"
-
-static int ilbc_parse_fmtp(AVStream *stream, PayloadContext *data,
-                           char *attr, char *value)
-{
-    if (!strcmp(attr, "mode")) {
-        int mode = atoi(value);
-        switch (mode) {
-        case 20:
-            stream->codec->block_align = 38;
-            break;
-        case 30:
-            stream->codec->block_align = 50;
-            break;
-        default:
-            av_log(NULL, AV_LOG_ERROR, "Unsupported iLBC mode %d\n", mode);
-            return AVERROR(EINVAL);
-        }
-    }
-    return 0;
-}
-
-static int ilbc_parse_sdp_line(AVFormatContext *s, int st_index,
-                               PayloadContext *data, const char *line)
-{
-    const char *p;
-    AVStream *st;
-
-    if (st_index < 0)
-        return 0;
-    st = s->streams[st_index];
-
-    if (av_strstart(line, "fmtp:", &p)) {
-        int ret = ff_parse_fmtp(st, data, p, ilbc_parse_fmtp);
-        if (ret < 0)
-            return ret;
-        if (!st->codec->block_align) {
-            av_log(s, AV_LOG_ERROR, "No iLBC mode set\n");
-            return AVERROR(EINVAL);
-        }
-    }
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_ilbc_dynamic_handler = {
-    .enc_name         = "iLBC",
-    .codec_type       = AVMEDIA_TYPE_AUDIO,
-    .codec_id         = AV_CODEC_ID_ILBC,
-    .parse_sdp_a_line = ilbc_parse_sdp_line,
-};
diff --git a/deps/libav/libavformat/rtpdec_jpeg.c b/deps/libav/libavformat/rtpdec_jpeg.c
deleted file mode 100644
index ed9c86c..0000000
--- a/deps/libav/libavformat/rtpdec_jpeg.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * RTP JPEG-compressed Video Depacketizer, RFC 2435
- * Copyright (c) 2012 Samuel Pitoiset
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpdec.h"
-#include "rtpdec_formats.h"
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/mjpeg.h"
-#include "libavcodec/bytestream.h"
-
-/**
- * RTP/JPEG specific private data.
- */
-struct PayloadContext {
-    AVIOContext *frame;         ///< current frame buffer
-    uint32_t    timestamp;      ///< current frame timestamp
-    int         hdr_size;       ///< size of the current frame header
-    uint8_t     qtables[128][128];
-    uint8_t     qtables_len[128];
-};
-
-static const uint8_t default_quantizers[128] = {
-    /* luma table */
-    16,  11,  12,  14,  12,  10,  16,  14,
-    13,  14,  18,  17,  16,  19,  24,  40,
-    26,  24,  22,  22,  24,  49,  35,  37,
-    29,  40,  58,  51,  61,  60,  57,  51,
-    56,  55,  64,  72,  92,  78,  64,  68,
-    87,  69,  55,  56,  80,  109, 81,  87,
-    95,  98,  103, 104, 103, 62,  77,  113,
-    121, 112, 100, 120, 92,  101, 103, 99,
-
-    /* chroma table */
-    17,  18,  18,  24,  21,  24,  47,  26,
-    26,  47,  99,  66,  56,  66,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99,
-    99,  99,  99,  99,  99,  99,  99,  99
-};
-
-static PayloadContext *jpeg_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static inline void free_frame_if_needed(PayloadContext *jpeg)
-{
-    if (jpeg->frame) {
-        uint8_t *p;
-        avio_close_dyn_buf(jpeg->frame, &p);
-        av_free(p);
-        jpeg->frame = NULL;
-    }
-}
-
-static void jpeg_free_context(PayloadContext *jpeg)
-{
-    free_frame_if_needed(jpeg);
-    av_free(jpeg);
-}
-
-static int jpeg_create_huffman_table(PutByteContext *p, int table_class,
-                                     int table_id, const uint8_t *bits_table,
-                                     const uint8_t *value_table)
-{
-    int i, n = 0;
-
-    bytestream2_put_byte(p, table_class << 4 | table_id);
-
-    for (i = 1; i <= 16; i++) {
-        n += bits_table[i];
-        bytestream2_put_byte(p, bits_table[i]);
-    }
-
-    for (i = 0; i < n; i++) {
-        bytestream2_put_byte(p, value_table[i]);
-    }
-    return n + 17;
-}
-
-static void jpeg_put_marker(PutByteContext *pbc, int code)
-{
-    bytestream2_put_byte(pbc, 0xff);
-    bytestream2_put_byte(pbc, code);
-}
-
-static int jpeg_create_header(uint8_t *buf, int size, uint32_t type, uint32_t w,
-                              uint32_t h, const uint8_t *qtable, int nb_qtable)
-{
-    PutByteContext pbc;
-    uint8_t *dht_size_ptr;
-    int dht_size, i;
-
-    bytestream2_init_writer(&pbc, buf, size);
-
-    /* Convert from blocks to pixels. */
-    w <<= 3;
-    h <<= 3;
-
-    /* SOI */
-    jpeg_put_marker(&pbc, SOI);
-
-    /* JFIF header */
-    jpeg_put_marker(&pbc, APP0);
-    bytestream2_put_be16(&pbc, 16);
-    bytestream2_put_buffer(&pbc, "JFIF", 5);
-    bytestream2_put_be16(&pbc, 0x0201);
-    bytestream2_put_byte(&pbc, 0);
-    bytestream2_put_be16(&pbc, 1);
-    bytestream2_put_be16(&pbc, 1);
-    bytestream2_put_byte(&pbc, 0);
-    bytestream2_put_byte(&pbc, 0);
-
-    /* DQT */
-    jpeg_put_marker(&pbc, DQT);
-    bytestream2_put_be16(&pbc, 2 + nb_qtable * (1 + 64));
-
-    for (i = 0; i < nb_qtable; i++) {
-        bytestream2_put_byte(&pbc, i);
-
-        /* Each table is an array of 64 values given in zig-zag
-         * order, identical to the format used in a JFIF DQT
-         * marker segment. */
-        bytestream2_put_buffer(&pbc, qtable + 64 * i, 64);
-    }
-
-    /* DHT */
-    jpeg_put_marker(&pbc, DHT);
-    dht_size_ptr = pbc.buffer;
-    bytestream2_put_be16(&pbc, 0);
-
-    dht_size  = 2;
-    dht_size += jpeg_create_huffman_table(&pbc, 0, 0,avpriv_mjpeg_bits_dc_luminance,
-                                          avpriv_mjpeg_val_dc);
-    dht_size += jpeg_create_huffman_table(&pbc, 0, 1, avpriv_mjpeg_bits_dc_chrominance,
-                                          avpriv_mjpeg_val_dc);
-    dht_size += jpeg_create_huffman_table(&pbc, 1, 0, avpriv_mjpeg_bits_ac_luminance,
-                                          avpriv_mjpeg_val_ac_luminance);
-    dht_size += jpeg_create_huffman_table(&pbc, 1, 1, avpriv_mjpeg_bits_ac_chrominance,
-                                          avpriv_mjpeg_val_ac_chrominance);
-    AV_WB16(dht_size_ptr, dht_size);
-
-    /* SOF0 */
-    jpeg_put_marker(&pbc, SOF0);
-    bytestream2_put_be16(&pbc, 17); /* size */
-    bytestream2_put_byte(&pbc, 8); /* bits per component */
-    bytestream2_put_be16(&pbc, h);
-    bytestream2_put_be16(&pbc, w);
-    bytestream2_put_byte(&pbc, 3); /* number of components */
-    bytestream2_put_byte(&pbc, 1); /* component number */
-    bytestream2_put_byte(&pbc, (2 << 4) | (type ? 2 : 1)); /* hsample/vsample */
-    bytestream2_put_byte(&pbc, 0); /* matrix number */
-    bytestream2_put_byte(&pbc, 2); /* component number */
-    bytestream2_put_byte(&pbc, 1 << 4 | 1); /* hsample/vsample */
-    bytestream2_put_byte(&pbc, nb_qtable == 2 ? 1 : 0); /* matrix number */
-    bytestream2_put_byte(&pbc, 3); /* component number */
-    bytestream2_put_byte(&pbc, 1 << 4 | 1); /* hsample/vsample */
-    bytestream2_put_byte(&pbc, nb_qtable == 2 ? 1 : 0); /* matrix number */
-
-    /* SOS */
-    jpeg_put_marker(&pbc, SOS);
-    bytestream2_put_be16(&pbc, 12);
-    bytestream2_put_byte(&pbc, 3);
-    bytestream2_put_byte(&pbc, 1);
-    bytestream2_put_byte(&pbc, 0);
-    bytestream2_put_byte(&pbc, 2);
-    bytestream2_put_byte(&pbc, 17);
-    bytestream2_put_byte(&pbc, 3);
-    bytestream2_put_byte(&pbc, 17);
-    bytestream2_put_byte(&pbc, 0);
-    bytestream2_put_byte(&pbc, 63);
-    bytestream2_put_byte(&pbc, 0);
-
-    /* Return the length in bytes of the JPEG header. */
-    return bytestream2_tell_p(&pbc);
-}
-
-static void create_default_qtables(uint8_t *qtables, uint8_t q)
-{
-    int factor = q;
-    int i;
-
-    factor = av_clip(q, 1, 99);
-
-    if (q < 50)
-        q = 5000 / factor;
-    else
-        q = 200 - factor * 2;
-
-    for (i = 0; i < 128; i++) {
-        int val = (default_quantizers[i] * q + 50) / 100;
-
-        /* Limit the quantizers to 1 <= q <= 255. */
-        val = av_clip(val, 1, 255);
-        qtables[i] = val;
-    }
-}
-
-static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
-                             AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                             const uint8_t *buf, int len, uint16_t seq,
-                             int flags)
-{
-    uint8_t type, q, width, height;
-    const uint8_t *qtables = NULL;
-    uint16_t qtable_len;
-    uint32_t off;
-    int ret;
-
-    if (len < 8) {
-        av_log(ctx, AV_LOG_ERROR, "Too short RTP/JPEG packet.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Parse the main JPEG header. */
-    off    = AV_RB24(buf + 1);  /* fragment byte offset */
-    type   = AV_RB8(buf + 4);   /* id of jpeg decoder params */
-    q      = AV_RB8(buf + 5);   /* quantization factor (or table id) */
-    width  = AV_RB8(buf + 6);   /* frame width in 8 pixel blocks */
-    height = AV_RB8(buf + 7);   /* frame height in 8 pixel blocks */
-    buf += 8;
-    len -= 8;
-
-    /* Parse the restart marker header. */
-    if (type > 63) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Unimplemented RTP/JPEG restart marker header.\n");
-        return AVERROR_PATCHWELCOME;
-    }
-    if (type > 1) {
-        av_log(ctx, AV_LOG_ERROR, "Unimplemented RTP/JPEG type %d\n", type);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* Parse the quantization table header. */
-    if (off == 0) {
-        /* Start of JPEG data packet. */
-        uint8_t new_qtables[128];
-        uint8_t hdr[1024];
-
-        if (q > 127) {
-            uint8_t precision;
-            if (len < 4) {
-                av_log(ctx, AV_LOG_ERROR, "Too short RTP/JPEG packet.\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            /* The first byte is reserved for future use. */
-            precision  = AV_RB8(buf + 1);    /* size of coefficients */
-            qtable_len = AV_RB16(buf + 2);   /* length in bytes */
-            buf += 4;
-            len -= 4;
-
-            if (precision)
-                av_log(ctx, AV_LOG_WARNING, "Only 8-bit precision is supported.\n");
-
-            if (qtable_len > 0) {
-                if (len < qtable_len) {
-                    av_log(ctx, AV_LOG_ERROR, "Too short RTP/JPEG packet.\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                qtables = buf;
-                buf += qtable_len;
-                len -= qtable_len;
-                if (q < 255) {
-                    if (jpeg->qtables_len[q - 128] &&
-                        (jpeg->qtables_len[q - 128] != qtable_len ||
-                         memcmp(qtables, &jpeg->qtables[q - 128][0], qtable_len))) {
-                        av_log(ctx, AV_LOG_WARNING,
-                               "Quantization tables for q=%d changed\n", q);
-                    } else if (!jpeg->qtables_len[q - 128] && qtable_len <= 128) {
-                        memcpy(&jpeg->qtables[q - 128][0], qtables,
-                               qtable_len);
-                        jpeg->qtables_len[q - 128] = qtable_len;
-                    }
-                }
-            } else {
-                if (q == 255) {
-                    av_log(ctx, AV_LOG_ERROR,
-                           "Invalid RTP/JPEG packet. Quantization tables not found.\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                if (!jpeg->qtables_len[q - 128]) {
-                    av_log(ctx, AV_LOG_ERROR,
-                           "No quantization tables known for q=%d yet.\n", q);
-                    return AVERROR_INVALIDDATA;
-                }
-                qtables    = &jpeg->qtables[q - 128][0];
-                qtable_len =  jpeg->qtables_len[q - 128];
-            }
-        } else { /* q <= 127 */
-            if (q == 0 || q > 99) {
-                av_log(ctx, AV_LOG_ERROR, "Reserved q value %d\n", q);
-                return AVERROR_INVALIDDATA;
-            }
-            create_default_qtables(new_qtables, q);
-            qtables    = new_qtables;
-            qtable_len = sizeof(new_qtables);
-        }
-
-        /* Skip the current frame in case of the end packet
-         * has been lost somewhere. */
-        free_frame_if_needed(jpeg);
-
-        if ((ret = avio_open_dyn_buf(&jpeg->frame)) < 0)
-            return ret;
-        jpeg->timestamp = *timestamp;
-
-        /* Generate a frame and scan headers that can be prepended to the
-         * RTP/JPEG data payload to produce a JPEG compressed image in
-         * interchange format. */
-        jpeg->hdr_size = jpeg_create_header(hdr, sizeof(hdr), type, width,
-                                            height, qtables,
-                                            qtable_len / 64);
-
-        /* Copy JPEG header to frame buffer. */
-        avio_write(jpeg->frame, hdr, jpeg->hdr_size);
-    }
-
-    if (!jpeg->frame) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Received packet without a start chunk; dropping frame.\n");
-        return AVERROR(EAGAIN);
-    }
-
-    if (jpeg->timestamp != *timestamp) {
-        /* Skip the current frame if timestamp is incorrect.
-         * A start packet has been lost somewhere. */
-        free_frame_if_needed(jpeg);
-        av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (off != avio_tell(jpeg->frame) - jpeg->hdr_size) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Missing packets; dropping frame.\n");
-        return AVERROR(EAGAIN);
-    }
-
-    /* Copy data to frame buffer. */
-    avio_write(jpeg->frame, buf, len);
-
-    if (flags & RTP_FLAG_MARKER) {
-        /* End of JPEG data packet. */
-        uint8_t buf[2] = { 0xff, EOI };
-
-        /* Put EOI marker. */
-        avio_write(jpeg->frame, buf, sizeof(buf));
-
-        /* Prepare the JPEG packet. */
-        if ((ret = ff_rtp_finalize_packet(pkt, &jpeg->frame, st->index)) < 0) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Error occurred when getting frame buffer.\n");
-            return ret;
-        }
-
-        return 0;
-    }
-
-    return AVERROR(EAGAIN);
-}
-
-RTPDynamicProtocolHandler ff_jpeg_dynamic_handler = {
-    .enc_name          = "JPEG",
-    .codec_type        = AVMEDIA_TYPE_VIDEO,
-    .codec_id          = AV_CODEC_ID_MJPEG,
-    .alloc             = jpeg_new_context,
-    .free              = jpeg_free_context,
-    .parse_packet      = jpeg_parse_packet,
-    .static_payload_id = 26,
-};
diff --git a/deps/libav/libavformat/rtpdec_latm.c b/deps/libav/libavformat/rtpdec_latm.c
deleted file mode 100644
index 050595c..0000000
--- a/deps/libav/libavformat/rtpdec_latm.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * RTP Depacketization of MP4A-LATM, RFC 3016
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "rtpdec_formats.h"
-#include "internal.h"
-#include "libavutil/avstring.h"
-#include "libavcodec/get_bits.h"
-
-struct PayloadContext {
-    AVIOContext *dyn_buf;
-    uint8_t *buf;
-    int pos, len;
-    uint32_t timestamp;
-};
-
-static PayloadContext *latm_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static void latm_free_context(PayloadContext *data)
-{
-    if (!data)
-        return;
-    if (data->dyn_buf) {
-        uint8_t *p;
-        avio_close_dyn_buf(data->dyn_buf, &p);
-        av_free(p);
-    }
-    av_free(data->buf);
-    av_free(data);
-}
-
-static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data,
-                             AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                             const uint8_t *buf, int len, uint16_t seq,
-                             int flags)
-{
-    int ret, cur_len;
-
-    if (buf) {
-        if (!data->dyn_buf || data->timestamp != *timestamp) {
-            av_freep(&data->buf);
-            if (data->dyn_buf)
-                avio_close_dyn_buf(data->dyn_buf, &data->buf);
-            data->dyn_buf = NULL;
-            av_freep(&data->buf);
-
-            data->timestamp = *timestamp;
-            if ((ret = avio_open_dyn_buf(&data->dyn_buf)) < 0)
-                return ret;
-        }
-        avio_write(data->dyn_buf, buf, len);
-
-        if (!(flags & RTP_FLAG_MARKER))
-            return AVERROR(EAGAIN);
-        av_free(data->buf);
-        data->len = avio_close_dyn_buf(data->dyn_buf, &data->buf);
-        data->dyn_buf = NULL;
-        data->pos = 0;
-    }
-
-    if (!data->buf) {
-        av_log(ctx, AV_LOG_ERROR, "No data available yet\n");
-        return AVERROR(EIO);
-    }
-
-    cur_len = 0;
-    while (data->pos < data->len) {
-        uint8_t val = data->buf[data->pos++];
-        cur_len += val;
-        if (val != 0xff)
-            break;
-    }
-    if (data->pos + cur_len > data->len) {
-        av_log(ctx, AV_LOG_ERROR, "Malformed LATM packet\n");
-        return AVERROR(EIO);
-    }
-
-    if ((ret = av_new_packet(pkt, cur_len)) < 0)
-        return ret;
-    memcpy(pkt->data, data->buf + data->pos, cur_len);
-    data->pos += cur_len;
-    pkt->stream_index = st->index;
-    return data->pos < data->len;
-}
-
-static int parse_fmtp_config(AVStream *st, char *value)
-{
-    int len = ff_hex_to_data(NULL, value), i, ret = 0;
-    GetBitContext gb;
-    uint8_t *config;
-    int audio_mux_version, same_time_framing, num_programs, num_layers;
-
-    /* Pad this buffer, too, to avoid out of bounds reads with get_bits below */
-    config = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!config)
-        return AVERROR(ENOMEM);
-    ff_hex_to_data(config, value);
-    init_get_bits(&gb, config, len*8);
-    audio_mux_version = get_bits(&gb, 1);
-    same_time_framing = get_bits(&gb, 1);
-    skip_bits(&gb, 6); /* num_sub_frames */
-    num_programs      = get_bits(&gb, 4);
-    num_layers        = get_bits(&gb, 3);
-    if (audio_mux_version != 0 || same_time_framing != 1 || num_programs != 0 ||
-        num_layers != 0) {
-        av_log(NULL, AV_LOG_WARNING, "Unsupported LATM config (%d,%d,%d,%d)\n",
-                                     audio_mux_version, same_time_framing,
-                                     num_programs, num_layers);
-        ret = AVERROR_PATCHWELCOME;
-        goto end;
-    }
-    av_freep(&st->codec->extradata);
-    st->codec->extradata_size = (get_bits_left(&gb) + 7)/8;
-    st->codec->extradata = av_mallocz(st->codec->extradata_size +
-                                      FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata) {
-        ret = AVERROR(ENOMEM);
-        goto end;
-    }
-    for (i = 0; i < st->codec->extradata_size; i++)
-        st->codec->extradata[i] = get_bits(&gb, 8);
-
-end:
-    av_free(config);
-    return ret;
-}
-
-static int parse_fmtp(AVStream *stream, PayloadContext *data,
-                      char *attr, char *value)
-{
-    int res;
-
-    if (!strcmp(attr, "config")) {
-        res = parse_fmtp_config(stream, value);
-        if (res < 0)
-            return res;
-    } else if (!strcmp(attr, "cpresent")) {
-        int cpresent = atoi(value);
-        if (cpresent != 0)
-            avpriv_request_sample(NULL,
-                                  "RTP MP4A-LATM with in-band configuration");
-    }
-
-    return 0;
-}
-
-static int latm_parse_sdp_line(AVFormatContext *s, int st_index,
-                               PayloadContext *data, const char *line)
-{
-    const char *p;
-
-    if (st_index < 0)
-        return 0;
-
-    if (av_strstart(line, "fmtp:", &p))
-        return ff_parse_fmtp(s->streams[st_index], data, p, parse_fmtp);
-
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler = {
-    .enc_name           = "MP4A-LATM",
-    .codec_type         = AVMEDIA_TYPE_AUDIO,
-    .codec_id           = AV_CODEC_ID_AAC,
-    .parse_sdp_a_line   = latm_parse_sdp_line,
-    .alloc              = latm_new_context,
-    .free               = latm_free_context,
-    .parse_packet       = latm_parse_packet
-};
diff --git a/deps/libav/libavformat/rtpdec_mpeg12.c b/deps/libav/libavformat/rtpdec_mpeg12.c
deleted file mode 100644
index b059fcf..0000000
--- a/deps/libav/libavformat/rtpdec_mpeg12.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Common code for the RTP depacketization of MPEG-1/2 formats.
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/intreadwrite.h"
-#include "rtpdec_formats.h"
-
-static av_cold int mpeg_init(AVFormatContext *ctx, int st_index, PayloadContext *data)
-{
-    if (st_index < 0)
-        return 0;
-    ctx->streams[st_index]->need_parsing = AVSTREAM_PARSE_FULL;
-    return 0;
-}
-
-static int mpeg_parse_packet(AVFormatContext *ctx, PayloadContext *data,
-                             AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                             const uint8_t *buf, int len, uint16_t seq,
-                             int flags)
-{
-    unsigned int h;
-    if (len <= 4)
-        return AVERROR_INVALIDDATA;
-    h    = AV_RB32(buf);
-    buf += 4;
-    len -= 4;
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && h & (1 << 26)) {
-        /* MPEG-2 */
-        if (len <= 4)
-            return AVERROR_INVALIDDATA;
-        buf += 4;
-        len -= 4;
-    }
-    if (av_new_packet(pkt, len) < 0)
-        return AVERROR(ENOMEM);
-    memcpy(pkt->data, buf, len);
-    pkt->stream_index = st->index;
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler = {
-    .codec_type        = AVMEDIA_TYPE_AUDIO,
-    .codec_id          = AV_CODEC_ID_MP3,
-    .init              = mpeg_init,
-    .parse_packet      = mpeg_parse_packet,
-    .static_payload_id = 14,
-};
-
-RTPDynamicProtocolHandler ff_mpeg_video_dynamic_handler = {
-    .codec_type        = AVMEDIA_TYPE_VIDEO,
-    .codec_id          = AV_CODEC_ID_MPEG2VIDEO,
-    .init              = mpeg_init,
-    .parse_packet      = mpeg_parse_packet,
-    .static_payload_id = 32,
-};
diff --git a/deps/libav/libavformat/rtpdec_mpeg4.c b/deps/libav/libavformat/rtpdec_mpeg4.c
deleted file mode 100644
index bec5c7d..0000000
--- a/deps/libav/libavformat/rtpdec_mpeg4.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Common code for the RTP depacketization of MPEG-4 formats.
- * Copyright (c) 2010 Fabrice Bellard
- *                    Romain Degez
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief MPEG4 / RTP Code
- * @author Fabrice Bellard
- * @author Romain Degez
- */
-
-#include "rtpdec_formats.h"
-#include "internal.h"
-#include "libavutil/attributes.h"
-#include "libavutil/avstring.h"
-#include "libavcodec/get_bits.h"
-
-/** Structure listing useful vars to parse RTP packet payload */
-struct PayloadContext {
-    int sizelength;
-    int indexlength;
-    int indexdeltalength;
-    int profile_level_id;
-    int streamtype;
-    int objecttype;
-    char *mode;
-
-    /** mpeg 4 AU headers */
-    struct AUHeaders {
-        int size;
-        int index;
-        int cts_flag;
-        int cts;
-        int dts_flag;
-        int dts;
-        int rap_flag;
-        int streamstate;
-    } *au_headers;
-    int au_headers_allocated;
-    int nb_au_headers;
-    int au_headers_length_bytes;
-    int cur_au_index;
-
-    uint8_t buf[RTP_MAX_PACKET_LENGTH];
-    int buf_pos, buf_size;
-};
-
-typedef struct {
-    const char *str;
-    uint16_t    type;
-    uint32_t    offset;
-} AttrNameMap;
-
-/* All known fmtp parameters and the corresponding RTPAttrTypeEnum */
-#define ATTR_NAME_TYPE_INT 0
-#define ATTR_NAME_TYPE_STR 1
-static const AttrNameMap attr_names[] = {
-    { "SizeLength",       ATTR_NAME_TYPE_INT,
-      offsetof(PayloadContext, sizelength) },
-    { "IndexLength",      ATTR_NAME_TYPE_INT,
-      offsetof(PayloadContext, indexlength) },
-    { "IndexDeltaLength", ATTR_NAME_TYPE_INT,
-      offsetof(PayloadContext, indexdeltalength) },
-    { "profile-level-id", ATTR_NAME_TYPE_INT,
-      offsetof(PayloadContext, profile_level_id) },
-    { "StreamType",       ATTR_NAME_TYPE_INT,
-      offsetof(PayloadContext, streamtype) },
-    { "mode",             ATTR_NAME_TYPE_STR,
-      offsetof(PayloadContext, mode) },
-    { NULL, -1, -1 },
-};
-
-static PayloadContext *new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static void free_context(PayloadContext *data)
-{
-    av_free(data->au_headers);
-    av_free(data->mode);
-    av_free(data);
-}
-
-static int parse_fmtp_config(AVCodecContext *codec, char *value)
-{
-    /* decode the hexa encoded parameter */
-    int len = ff_hex_to_data(NULL, value);
-    av_free(codec->extradata);
-    codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!codec->extradata)
-        return AVERROR(ENOMEM);
-    codec->extradata_size = len;
-    ff_hex_to_data(codec->extradata, value);
-    return 0;
-}
-
-static int rtp_parse_mp4_au(PayloadContext *data, const uint8_t *buf, int len)
-{
-    int au_headers_length, au_header_size, i;
-    GetBitContext getbitcontext;
-
-    if (len < 2)
-        return AVERROR_INVALIDDATA;
-
-    /* decode the first 2 bytes where the AUHeader sections are stored
-       length in bits */
-    au_headers_length = AV_RB16(buf);
-
-    if (au_headers_length > RTP_MAX_PACKET_LENGTH)
-      return -1;
-
-    data->au_headers_length_bytes = (au_headers_length + 7) / 8;
-
-    /* skip AU headers length section (2 bytes) */
-    buf += 2;
-    len -= 2;
-
-    if (len < data->au_headers_length_bytes)
-        return AVERROR_INVALIDDATA;
-
-    init_get_bits(&getbitcontext, buf, data->au_headers_length_bytes * 8);
-
-    /* XXX: Wrong if optionnal additional sections are present (cts, dts etc...) */
-    au_header_size = data->sizelength + data->indexlength;
-    if (au_header_size <= 0 || (au_headers_length % au_header_size != 0))
-        return -1;
-
-    data->nb_au_headers = au_headers_length / au_header_size;
-    if (!data->au_headers || data->au_headers_allocated < data->nb_au_headers) {
-        av_free(data->au_headers);
-        data->au_headers = av_malloc(sizeof(struct AUHeaders) * data->nb_au_headers);
-        if (!data->au_headers)
-            return AVERROR(ENOMEM);
-        data->au_headers_allocated = data->nb_au_headers;
-    }
-
-    for (i = 0; i < data->nb_au_headers; ++i) {
-        data->au_headers[i].size  = get_bits_long(&getbitcontext, data->sizelength);
-        data->au_headers[i].index = get_bits_long(&getbitcontext, data->indexlength);
-    }
-
-    return 0;
-}
-
-
-/* Follows RFC 3640 */
-static int aac_parse_packet(AVFormatContext *ctx, PayloadContext *data,
-                            AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                            const uint8_t *buf, int len, uint16_t seq,
-                            int flags)
-{
-    int ret;
-
-    if (!buf) {
-        if (data->cur_au_index > data->nb_au_headers)
-            return AVERROR_INVALIDDATA;
-        if (data->buf_size - data->buf_pos < data->au_headers[data->cur_au_index].size)
-            return AVERROR_INVALIDDATA;
-        if ((ret = av_new_packet(pkt, data->au_headers[data->cur_au_index].size)) < 0)
-            return ret;
-        memcpy(pkt->data, &data->buf[data->buf_pos], data->au_headers[data->cur_au_index].size);
-        data->buf_pos += data->au_headers[data->cur_au_index].size;
-        pkt->stream_index = st->index;
-        data->cur_au_index++;
-        return data->cur_au_index < data->nb_au_headers;
-    }
-
-    if (rtp_parse_mp4_au(data, buf, len))
-        return -1;
-
-    buf += data->au_headers_length_bytes + 2;
-    len -= data->au_headers_length_bytes + 2;
-
-    if (len < data->au_headers[0].size)
-        return AVERROR_INVALIDDATA;
-    if ((ret = av_new_packet(pkt, data->au_headers[0].size)) < 0)
-        return ret;
-    memcpy(pkt->data, buf, data->au_headers[0].size);
-    len -= data->au_headers[0].size;
-    buf += data->au_headers[0].size;
-    pkt->stream_index = st->index;
-
-    if (len > 0 && data->nb_au_headers > 1) {
-        data->buf_size = FFMIN(len, sizeof(data->buf));
-        memcpy(data->buf, buf, data->buf_size);
-        data->cur_au_index = 1;
-        data->buf_pos = 0;
-        return 1;
-    }
-
-    return 0;
-}
-
-static int parse_fmtp(AVStream *stream, PayloadContext *data,
-                      char *attr, char *value)
-{
-    AVCodecContext *codec = stream->codec;
-    int res, i;
-
-    if (!strcmp(attr, "config")) {
-        res = parse_fmtp_config(codec, value);
-
-        if (res < 0)
-            return res;
-    }
-
-    if (codec->codec_id == AV_CODEC_ID_AAC) {
-        /* Looking for a known attribute */
-        for (i = 0; attr_names[i].str; ++i) {
-            if (!av_strcasecmp(attr, attr_names[i].str)) {
-                if (attr_names[i].type == ATTR_NAME_TYPE_INT) {
-                    *(int *)((char *)data+
-                        attr_names[i].offset) = atoi(value);
-                } else if (attr_names[i].type == ATTR_NAME_TYPE_STR)
-                    *(char **)((char *)data+
-                        attr_names[i].offset) = av_strdup(value);
-            }
-        }
-    }
-    return 0;
-}
-
-static int parse_sdp_line(AVFormatContext *s, int st_index,
-                          PayloadContext *data, const char *line)
-{
-    const char *p;
-
-    if (st_index < 0)
-        return 0;
-
-    if (av_strstart(line, "fmtp:", &p))
-        return ff_parse_fmtp(s->streams[st_index], data, p, parse_fmtp);
-
-    return 0;
-}
-
-static av_cold int init_video(AVFormatContext *s, int st_index,
-                              PayloadContext *data)
-{
-    if (st_index < 0)
-        return 0;
-    s->streams[st_index]->need_parsing = AVSTREAM_PARSE_FULL;
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler = {
-    .enc_name           = "MP4V-ES",
-    .codec_type         = AVMEDIA_TYPE_VIDEO,
-    .codec_id           = AV_CODEC_ID_MPEG4,
-    .init               = init_video,
-    .parse_sdp_a_line   = parse_sdp_line,
-};
-
-RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler = {
-    .enc_name           = "mpeg4-generic",
-    .codec_type         = AVMEDIA_TYPE_AUDIO,
-    .codec_id           = AV_CODEC_ID_AAC,
-    .parse_sdp_a_line   = parse_sdp_line,
-    .alloc              = new_context,
-    .free               = free_context,
-    .parse_packet       = aac_parse_packet
-};
diff --git a/deps/libav/libavformat/rtpdec_mpegts.c b/deps/libav/libavformat/rtpdec_mpegts.c
deleted file mode 100644
index b3ef261..0000000
--- a/deps/libav/libavformat/rtpdec_mpegts.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * RTP MPEG2TS depacketizer
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "mpegts.h"
-#include "rtpdec_formats.h"
-
-struct PayloadContext {
-    struct MpegTSContext *ts;
-    int read_buf_index;
-    int read_buf_size;
-    uint8_t buf[RTP_MAX_PACKET_LENGTH];
-};
-
-static PayloadContext *mpegts_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static void mpegts_free_context(PayloadContext *data)
-{
-    if (!data)
-        return;
-    if (data->ts)
-        ff_mpegts_parse_close(data->ts);
-    av_free(data);
-}
-
-static av_cold int mpegts_init(AVFormatContext *ctx, int st_index,
-                               PayloadContext *data)
-{
-    data->ts = ff_mpegts_parse_open(ctx);
-    if (!data->ts)
-        return AVERROR(ENOMEM);
-    return 0;
-}
-
-static int mpegts_handle_packet(AVFormatContext *ctx, PayloadContext *data,
-                                AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                                const uint8_t *buf, int len, uint16_t seq,
-                                int flags)
-{
-    int ret;
-
-    // We don't want to use the RTP timestamps at all. If the mpegts demuxer
-    // doesn't set any pts/dts, the generic rtpdec code shouldn't try to
-    // fill it in either, since the mpegts and RTP timestamps are in totally
-    // different ranges.
-    *timestamp = RTP_NOTS_VALUE;
-
-    if (!data->ts)
-        return AVERROR(EINVAL);
-
-    if (!buf) {
-        if (data->read_buf_index >= data->read_buf_size)
-            return AVERROR(EAGAIN);
-        ret = ff_mpegts_parse_packet(data->ts, pkt, data->buf + data->read_buf_index,
-                                     data->read_buf_size - data->read_buf_index);
-        if (ret < 0)
-            return AVERROR(EAGAIN);
-        data->read_buf_index += ret;
-        if (data->read_buf_index < data->read_buf_size)
-            return 1;
-        else
-            return 0;
-    }
-
-    ret = ff_mpegts_parse_packet(data->ts, pkt, buf, len);
-    /* The only error that can be returned from ff_mpegts_parse_packet
-     * is "no more data to return from the provided buffer", so return
-     * AVERROR(EAGAIN) for all errors */
-    if (ret < 0)
-        return AVERROR(EAGAIN);
-    if (ret < len) {
-        data->read_buf_size = FFMIN(len - ret, sizeof(data->buf));
-        memcpy(data->buf, buf + ret, data->read_buf_size);
-        data->read_buf_index = 0;
-        return 1;
-    }
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_mpegts_dynamic_handler = {
-    .codec_type        = AVMEDIA_TYPE_DATA,
-    .parse_packet      = mpegts_handle_packet,
-    .alloc             = mpegts_new_context,
-    .init              = mpegts_init,
-    .free              = mpegts_free_context,
-    .static_payload_id = 33,
-};
diff --git a/deps/libav/libavformat/rtpdec_qcelp.c b/deps/libav/libavformat/rtpdec_qcelp.c
deleted file mode 100644
index 45a89ae..0000000
--- a/deps/libav/libavformat/rtpdec_qcelp.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * RTP Depacketization of QCELP/PureVoice, RFC 2658
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "rtpdec_formats.h"
-
-static const uint8_t frame_sizes[] = {
-    1, 4, 8, 17, 35
-};
-
-typedef struct {
-    int pos;
-    int size;
-    /* The largest frame is 35 bytes, only 10 frames are allowed per
-     * packet, and we return the first one immediately, so allocate
-     * space for 9 frames */
-    uint8_t data[35*9];
-} InterleavePacket;
-
-struct PayloadContext {
-    int interleave_size;
-    int interleave_index;
-    InterleavePacket group[6];
-    int group_finished;
-
-    /* The maximum packet size, 10 frames of 35 bytes each, and one
-     * packet header byte. */
-    uint8_t  next_data[1 + 35*10];
-    int      next_size;
-    uint32_t next_timestamp;
-};
-
-static PayloadContext *qcelp_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static void qcelp_free_context(PayloadContext *data)
-{
-    av_free(data);
-}
-
-static int return_stored_frame(AVFormatContext *ctx, PayloadContext *data,
-                               AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                               const uint8_t *buf, int len);
-
-static int store_packet(AVFormatContext *ctx, PayloadContext *data,
-                        AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                        const uint8_t *buf, int len)
-{
-    int interleave_size, interleave_index;
-    int frame_size, ret;
-    InterleavePacket* ip;
-
-    if (len < 2)
-        return AVERROR_INVALIDDATA;
-
-    interleave_size  = buf[0] >> 3 & 7;
-    interleave_index = buf[0]      & 7;
-
-    if (interleave_size > 5) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid interleave size %d\n",
-                                   interleave_size);
-        return AVERROR_INVALIDDATA;
-    }
-    if (interleave_index > interleave_size) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid interleave index %d/%d\n",
-                                   interleave_index, interleave_size);
-        return AVERROR_INVALIDDATA;
-    }
-    if (interleave_size != data->interleave_size) {
-        int i;
-        /* First packet, or changed interleave size */
-        data->interleave_size = interleave_size;
-        data->interleave_index = 0;
-        for (i = 0; i < 6; i++)
-            data->group[i].size = 0;
-    }
-
-    if (interleave_index < data->interleave_index) {
-        /* Wrapped around - missed the last packet of the previous group. */
-        if (data->group_finished) {
-            /* No more data in the packets in this interleaving group, just
-             * start processing the next one */
-            data->interleave_index = 0;
-        } else {
-            /* Stash away the current packet, emit everything we have of the
-             * previous group. */
-            for (; data->interleave_index <= interleave_size;
-                 data->interleave_index++)
-                data->group[data->interleave_index].size = 0;
-
-            if (len > sizeof(data->next_data))
-                return AVERROR_INVALIDDATA;
-            memcpy(data->next_data, buf, len);
-            data->next_size = len;
-            data->next_timestamp = *timestamp;
-            *timestamp = RTP_NOTS_VALUE;
-
-            data->interleave_index = 0;
-            return return_stored_frame(ctx, data, st, pkt, timestamp, buf, len);
-        }
-    }
-    if (interleave_index > data->interleave_index) {
-        /* We missed a packet */
-        for (; data->interleave_index < interleave_index;
-             data->interleave_index++)
-            data->group[data->interleave_index].size = 0;
-    }
-    data->interleave_index = interleave_index;
-
-    if (buf[1] >= FF_ARRAY_ELEMS(frame_sizes))
-        return AVERROR_INVALIDDATA;
-    frame_size = frame_sizes[buf[1]];
-    if (1 + frame_size > len)
-        return AVERROR_INVALIDDATA;
-
-    if (len - 1 - frame_size > sizeof(data->group[0].data))
-        return AVERROR_INVALIDDATA;
-
-    if ((ret = av_new_packet(pkt, frame_size)) < 0)
-        return ret;
-    memcpy(pkt->data, &buf[1], frame_size);
-    pkt->stream_index = st->index;
-
-    ip = &data->group[data->interleave_index];
-    ip->size = len - 1 - frame_size;
-    ip->pos = 0;
-    memcpy(ip->data, &buf[1 + frame_size], ip->size);
-    /* Each packet must contain the same number of frames according to the
-     * RFC. If there's no data left in this packet, there shouldn't be any
-     * in any of the other frames in the interleaving group either. */
-    data->group_finished = ip->size == 0;
-
-    if (interleave_index == interleave_size) {
-        data->interleave_index = 0;
-        return !data->group_finished;
-    } else {
-        data->interleave_index++;
-        return 0;
-    }
-}
-
-static int return_stored_frame(AVFormatContext *ctx, PayloadContext *data,
-                               AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                               const uint8_t *buf, int len)
-{
-    InterleavePacket* ip = &data->group[data->interleave_index];
-    int frame_size, ret;
-
-    if (data->group_finished && data->interleave_index == 0) {
-        *timestamp = data->next_timestamp;
-        ret = store_packet(ctx, data, st, pkt, timestamp, data->next_data,
-                           data->next_size);
-        data->next_size = 0;
-        return ret;
-    }
-
-    if (ip->size == 0) {
-        /* No stored data for this interleave block, output an empty packet */
-        if ((ret = av_new_packet(pkt, 1)) < 0)
-            return ret;
-        pkt->data[0] = 0; // Blank - could also be 14, Erasure
-    } else {
-        if (ip->pos >= ip->size)
-            return AVERROR_INVALIDDATA;
-        if (ip->data[ip->pos] >= FF_ARRAY_ELEMS(frame_sizes))
-            return AVERROR_INVALIDDATA;
-        frame_size = frame_sizes[ip->data[ip->pos]];
-        if (ip->pos + frame_size > ip->size)
-            return AVERROR_INVALIDDATA;
-
-        if ((ret = av_new_packet(pkt, frame_size)) < 0)
-            return ret;
-        memcpy(pkt->data, &ip->data[ip->pos], frame_size);
-
-        ip->pos += frame_size;
-        data->group_finished = ip->pos >= ip->size;
-    }
-    pkt->stream_index = st->index;
-
-    if (data->interleave_index == data->interleave_size) {
-        data->interleave_index = 0;
-        if (!data->group_finished)
-            return 1;
-        else
-            return data->next_size > 0;
-    } else {
-        data->interleave_index++;
-        return 1;
-    }
-}
-
-static int qcelp_parse_packet(AVFormatContext *ctx, PayloadContext *data,
-                              AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                              const uint8_t *buf, int len, uint16_t seq,
-                              int flags)
-{
-    if (buf)
-        return store_packet(ctx, data, st, pkt, timestamp, buf, len);
-    else
-        return return_stored_frame(ctx, data, st, pkt, timestamp, buf, len);
-}
-
-RTPDynamicProtocolHandler ff_qcelp_dynamic_handler = {
-    .enc_name           = "x-Purevoice",
-    .codec_type         = AVMEDIA_TYPE_AUDIO,
-    .codec_id           = AV_CODEC_ID_QCELP,
-    .static_payload_id  = 12,
-    .alloc              = qcelp_new_context,
-    .free               = qcelp_free_context,
-    .parse_packet       = qcelp_parse_packet
-};
diff --git a/deps/libav/libavformat/rtpdec_qdm2.c b/deps/libav/libavformat/rtpdec_qdm2.c
deleted file mode 100644
index 0d7b5bb..0000000
--- a/deps/libav/libavformat/rtpdec_qdm2.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * QDesign Music 2 (QDM2) payload for RTP
- * Copyright (c) 2010 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief RTP support for the QDM2 payload (todo: wiki)
- * @author Ronald S. Bultje <rbultje at ronald.bitfreak.net>
- */
-
-#include <string.h>
-#include "libavutil/intreadwrite.h"
-#include "libavcodec/avcodec.h"
-#include "rtp.h"
-#include "rtpdec.h"
-#include "rtpdec_formats.h"
-
-struct PayloadContext {
-    /** values read from the config header, used as packet headers */
-    //@{
-    int block_type;            ///< superblock type, value 2 .. 8
-    int block_size;            ///< from extradata, used as pkt length
-    int subpkts_per_block;     ///< max. nr. of subpackets to add per output buffer
-    //@}
-
-    /** Temporary storage for superblock restoring, per packet ID (0x80 total) */
-    //@{
-    uint16_t len[0x80];        ///< how much the temporary buffer is filled
-    uint8_t  buf[0x80][0x800]; ///< the temporary storage buffer
-
-    unsigned int cache;        ///< number of data packets that we have cached right now
-    unsigned int n_pkts;       ///< number of RTP packets received since last packet output / config
-    uint32_t timestamp;        ///< timestamp of next-to-be-returned packet
-    //@}
-};
-
-/**
- * Parse configuration (basically the codec-specific extradata) from
- * an RTP config subpacket (starts with 0xff).
- *
- * Layout of the config subpacket (in bytes):
- * 1: 0xFF          <- config ID
- * then an array {
- *     1: size      <- of the current item
- *     1: item type <- 0 .. 4
- *     size-2: data <- data depends on the item type
- * }
- *
- * Item 0 implies the end of the config subpacket, and has no data.
- * Item 1 implies a stream configuration without extradata.
- * Item 2 max. nr. of subpackets per superblock
- * Item 3 superblock type for the stream
- * Item 4 implies a stream configuration with extradata (size >= 0x1c).
- *
- * @return <0 on error, otherwise the number of bytes parsed from the
- *         input buffer.
- */
-static int qdm2_parse_config(PayloadContext *qdm, AVStream *st,
-                             const uint8_t *buf, const uint8_t *end)
-{
-    const uint8_t *p = buf;
-
-    while (end - p >= 2) {
-        unsigned int item_len = p[0], config_item = p[1];
-
-        if (item_len < 2 || end - p < item_len || config_item > 4)
-            return AVERROR_INVALIDDATA;
-
-        switch (config_item) {
-            case 0: /* end of config block */
-                return p - buf + item_len;
-            case 1: /* stream without extradata */
-                /* FIXME: set default qdm->block_size */
-                break;
-            case 2: /**< subpackets per block */
-                if (item_len < 3)
-                    return AVERROR_INVALIDDATA;
-                qdm->subpkts_per_block = p[2];
-                break;
-            case 3: /* superblock type */
-                if (item_len < 4)
-                    return AVERROR_INVALIDDATA;
-                qdm->block_type = AV_RB16(p + 2);
-                break;
-            case 4: /* stream with extradata */
-                if (item_len < 30)
-                    return AVERROR_INVALIDDATA;
-                av_freep(&st->codec->extradata);
-                st->codec->extradata_size = 26 + item_len;
-                if (!(st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE))) {
-                    st->codec->extradata_size = 0;
-                    return AVERROR(ENOMEM);
-                }
-                AV_WB32(st->codec->extradata, 12);
-                memcpy(st->codec->extradata + 4, "frma", 4);
-                memcpy(st->codec->extradata + 8, "QDM2", 4);
-                AV_WB32(st->codec->extradata + 12, 6 + item_len);
-                memcpy(st->codec->extradata + 16, "QDCA", 4);
-                memcpy(st->codec->extradata + 20, p + 2, item_len - 2);
-                AV_WB32(st->codec->extradata + 18 + item_len, 8);
-                AV_WB32(st->codec->extradata + 22 + item_len, 0);
-
-                qdm->block_size = AV_RB32(p + 26);
-                break;
-        }
-
-        p += item_len;
-    }
-
-    return AVERROR(EAGAIN); /* not enough data */
-}
-
-/**
- * Parse a single subpacket. We store this subpacket in an intermediate
- * buffer (position depends on the ID (byte[0]). When called, at least
- * 4 bytes are available for reading (see qdm2_parse_packet()).
- *
- * Layout of a single subpacket (RTP packets commonly contain multiple
- * such subpackets) - length in bytes:
- * 1:    ordering ID        <- 0 .. 0x7F
- * 1:    subpacket type     <- 0 .. 0x7F; value & 0x80 means subpacket length = 2 bytes, else 1 byte
- * 1/2:  subpacket length   <- length of the data following the flags/length fields
- * if (subpacket type & 0x7F) == 0x7F
- *   1:  subpacket type, higher bits
- * size: subpacket data
- *
- * The subpackets come in randomly, and should be encapsulated into 1
- * or more superblocks (containing qdm->subpkts_per_block subpackets
- * each) per RTP packet, in order of ascending "ordering ID", see
- * qdm2_restore_block().
- *
- * @return <0 on error, otherwise the number of bytes parsed from the
- *         input buffer.
- */
-static int qdm2_parse_subpacket(PayloadContext *qdm, AVStream *st,
-                                const uint8_t *buf, const uint8_t *end)
-{
-    const uint8_t *p = buf;
-    unsigned int id, len, type, to_copy;
-
-    /* parse header so we know the size of the header/data */
-    id       = *p++;
-    type     = *p++;
-    if (type & 0x80) {
-        len   = AV_RB16(p);
-        p    += 2;
-        type &= 0x7F;
-    } else
-        len = *p++;
-
-    if (end - p < len + (type == 0x7F) || id >= 0x80)
-        return AVERROR_INVALIDDATA;
-    if (type == 0x7F)
-        type |= *p++ << 8;
-
-    /* copy data into a temporary buffer */
-    to_copy = FFMIN(len + (p - &buf[1]), 0x800 - qdm->len[id]);
-    memcpy(&qdm->buf[id][qdm->len[id]], buf + 1, to_copy);
-    qdm->len[id] += to_copy;
-
-    return p + len - buf;
-}
-
-/**
- * Add a superblock header around a set of subpackets.
- *
- * @return <0 on error, else 0.
- */
-static int qdm2_restore_block(PayloadContext *qdm, AVStream *st, AVPacket *pkt)
-{
-    int to_copy, n, res, include_csum;
-    uint8_t *p, *csum_pos = NULL;
-
-    /* create packet to hold subpkts into a superblock */
-    assert(qdm->cache > 0);
-    for (n = 0; n < 0x80; n++)
-        if (qdm->len[n] > 0)
-            break;
-    assert(n < 0x80);
-
-    if ((res = av_new_packet(pkt, qdm->block_size)) < 0)
-        return res;
-    memset(pkt->data, 0, pkt->size);
-    pkt->stream_index  = st->index;
-    p                  = pkt->data;
-
-    /* superblock header */
-    if (qdm->len[n] > 0xff) {
-        *p++ = qdm->block_type | 0x80;
-        AV_WB16(p, qdm->len[n]);
-        p   += 2;
-    } else {
-        *p++ = qdm->block_type;
-        *p++ = qdm->len[n];
-    }
-    if ((include_csum = (qdm->block_type == 2 || qdm->block_type == 4))) {
-        csum_pos = p;
-        p       += 2;
-    }
-
-    /* subpacket data */
-    to_copy = FFMIN(qdm->len[n], pkt->size - (p - pkt->data));
-    memcpy(p, qdm->buf[n], to_copy);
-    qdm->len[n] = 0;
-
-    /* checksum header */
-    if (include_csum) {
-        unsigned int total = 0;
-        uint8_t *q;
-
-        for (q = pkt->data; q < &pkt->data[qdm->block_size]; q++)
-            total += *q;
-        AV_WB16(csum_pos, (uint16_t) total);
-    }
-
-    return 0;
-}
-
-/** return 0 on packet, no more left, 1 on packet, -1 on partial packet... */
-static int qdm2_parse_packet(AVFormatContext *s, PayloadContext *qdm,
-                             AVStream *st, AVPacket *pkt,
-                             uint32_t *timestamp,
-                             const uint8_t *buf, int len, uint16_t seq,
-                             int flags)
-{
-    int res = AVERROR_INVALIDDATA, n;
-    const uint8_t *end = buf + len, *p = buf;
-
-    if (len > 0) {
-        if (len < 2)
-            return AVERROR_INVALIDDATA;
-
-        /* configuration block */
-        if (*p == 0xff) {
-            if (qdm->n_pkts > 0) {
-                av_log(s, AV_LOG_WARNING,
-                       "Out of sequence config - dropping queue\n");
-                qdm->n_pkts = 0;
-                memset(qdm->len, 0, sizeof(qdm->len));
-            }
-
-            if ((res = qdm2_parse_config(qdm, st, ++p, end)) < 0)
-                return res;
-            p += res;
-
-            /* We set codec_id to AV_CODEC_ID_NONE initially to
-             * delay decoder initialization since extradata is
-             * carried within the RTP stream, not SDP. Here,
-             * by setting codec_id to AV_CODEC_ID_QDM2, we are signalling
-             * to the decoder that it is OK to initialize. */
-            st->codec->codec_id = AV_CODEC_ID_QDM2;
-        }
-        if (st->codec->codec_id == AV_CODEC_ID_NONE)
-            return AVERROR(EAGAIN);
-
-        /* subpackets */
-        while (end - p >= 4) {
-            if ((res = qdm2_parse_subpacket(qdm, st, p, end)) < 0)
-                return res;
-            p += res;
-        }
-
-        qdm->timestamp = *timestamp;
-        if (++qdm->n_pkts < qdm->subpkts_per_block)
-            return AVERROR(EAGAIN);
-        qdm->cache = 0;
-        for (n = 0; n < 0x80; n++)
-            if (qdm->len[n] > 0)
-                qdm->cache++;
-    }
-
-    /* output the subpackets into freshly created superblock structures */
-    if (!qdm->cache || (res = qdm2_restore_block(qdm, st, pkt)) < 0)
-        return res;
-    if (--qdm->cache == 0)
-        qdm->n_pkts = 0;
-
-    *timestamp = qdm->timestamp;
-    qdm->timestamp = RTP_NOTS_VALUE;
-
-    return (qdm->cache > 0) ? 1 : 0;
-}
-
-static PayloadContext *qdm2_extradata_new(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static void qdm2_extradata_free(PayloadContext *qdm)
-{
-    av_free(qdm);
-}
-
-RTPDynamicProtocolHandler ff_qdm2_dynamic_handler = {
-    .enc_name         = "X-QDM",
-    .codec_type       = AVMEDIA_TYPE_AUDIO,
-    .codec_id         = AV_CODEC_ID_NONE,
-    .alloc            = qdm2_extradata_new,
-    .free             = qdm2_extradata_free,
-    .parse_packet     = qdm2_parse_packet,
-};
diff --git a/deps/libav/libavformat/rtpdec_qt.c b/deps/libav/libavformat/rtpdec_qt.c
deleted file mode 100644
index 2d9c603..0000000
--- a/deps/libav/libavformat/rtpdec_qt.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * RTP/Quicktime support.
- * Copyright (c) 2009 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Quicktime-style RTP support
- * @author Ronald S. Bultje <rbultje at ronald.bitfreak.net>
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "rtp.h"
-#include "rtpdec.h"
-#include "isom.h"
-#include "libavcodec/get_bits.h"
-
-struct PayloadContext {
-    AVPacket pkt;
-    int bytes_per_frame, remaining;
-    uint32_t timestamp;
-};
-
-static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
-                               AVStream *st, AVPacket *pkt,
-                               uint32_t *timestamp, const uint8_t *buf,
-                               int len, uint16_t seq, int flags)
-{
-    AVIOContext pb;
-    GetBitContext gb;
-    int packing_scheme, has_payload_desc, has_packet_info, alen,
-        has_marker_bit = flags & RTP_FLAG_MARKER;
-
-    if (qt->remaining) {
-        int num = qt->pkt.size / qt->bytes_per_frame;
-
-        if (av_new_packet(pkt, qt->bytes_per_frame))
-            return AVERROR(ENOMEM);
-        pkt->stream_index = st->index;
-        pkt->flags        = qt->pkt.flags;
-        memcpy(pkt->data,
-               &qt->pkt.data[(num - qt->remaining) * qt->bytes_per_frame],
-               qt->bytes_per_frame);
-        if (--qt->remaining == 0) {
-            av_freep(&qt->pkt.data);
-            qt->pkt.size = 0;
-        }
-        return qt->remaining > 0;
-    }
-
-    /**
-     * The RTP payload is described in:
-     * http://developer.apple.com/quicktime/icefloe/dispatch026.html
-     */
-    init_get_bits(&gb, buf, len << 3);
-    ffio_init_context(&pb, buf, len, 0, NULL, NULL, NULL, NULL);
-
-    if (len < 4)
-        return AVERROR_INVALIDDATA;
-
-    skip_bits(&gb, 4); // version
-    if ((packing_scheme = get_bits(&gb, 2)) == 0)
-        return AVERROR_INVALIDDATA;
-    if (get_bits1(&gb))
-        flags          |= RTP_FLAG_KEY;
-    has_payload_desc    = get_bits1(&gb);
-    has_packet_info     = get_bits1(&gb);
-    skip_bits(&gb, 23); // reserved:7, cache payload info:1, payload ID:15
-
-    if (has_payload_desc) {
-        int data_len, pos, is_start, is_finish;
-        uint32_t tag;
-
-        pos = get_bits_count(&gb) >> 3;
-        if (pos + 12 > len)
-            return AVERROR_INVALIDDATA;
-
-        skip_bits(&gb, 2); // has non-I frames:1, is sparse:1
-        is_start  = get_bits1(&gb);
-        is_finish = get_bits1(&gb);
-        if (!is_start || !is_finish) {
-            avpriv_request_sample(s, "RTP-X-QT with payload description "
-                                  "split over several packets");
-            return AVERROR_PATCHWELCOME;
-        }
-        skip_bits(&gb, 12); // reserved
-        data_len = get_bits(&gb, 16);
-
-        avio_seek(&pb, pos + 4, SEEK_SET);
-        tag = avio_rl32(&pb);
-        if ((st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-                 tag != MKTAG('v','i','d','e')) ||
-            (st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
-                 tag != MKTAG('s','o','u','n')))
-            return AVERROR_INVALIDDATA;
-        avpriv_set_pts_info(st, 32, 1, avio_rb32(&pb));
-
-        if (pos + data_len > len)
-            return AVERROR_INVALIDDATA;
-        /* TLVs */
-        while (avio_tell(&pb) + 4 < pos + data_len) {
-            int tlv_len = avio_rb16(&pb);
-            tag = avio_rl16(&pb);
-            if (avio_tell(&pb) + tlv_len > pos + data_len)
-                return AVERROR_INVALIDDATA;
-
-#define MKTAG16(a,b) MKTAG(a,b,0,0)
-            switch (tag) {
-            case MKTAG16('s','d'): {
-                MOVStreamContext *msc;
-                void *priv_data = st->priv_data;
-                int nb_streams = s->nb_streams;
-                MOVContext *mc = av_mallocz(sizeof(*mc));
-                if (!mc)
-                    return AVERROR(ENOMEM);
-                mc->fc = s;
-                st->priv_data = msc = av_mallocz(sizeof(MOVStreamContext));
-                if (!msc) {
-                    av_free(mc);
-                    st->priv_data = priv_data;
-                    return AVERROR(ENOMEM);
-                }
-                /* ff_mov_read_stsd_entries updates stream s->nb_streams-1,
-                 * so set it temporarily to indicate which stream to update. */
-                s->nb_streams = st->index + 1;
-                ff_mov_read_stsd_entries(mc, &pb, 1);
-                qt->bytes_per_frame = msc->bytes_per_frame;
-                av_free(msc);
-                av_free(mc);
-                st->priv_data = priv_data;
-                s->nb_streams = nb_streams;
-                break;
-            }
-            default:
-                avio_skip(&pb, tlv_len);
-                break;
-            }
-        }
-
-        /* 32-bit alignment */
-        avio_skip(&pb, ((avio_tell(&pb) + 3) & ~3) - avio_tell(&pb));
-    } else
-        avio_seek(&pb, 4, SEEK_SET);
-
-    if (has_packet_info) {
-        avpriv_request_sample(s, "RTP-X-QT with packet-specific info");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    alen = len - avio_tell(&pb);
-    if (alen <= 0)
-        return AVERROR_INVALIDDATA;
-
-    switch (packing_scheme) {
-    case 3: /* one data packet spread over 1 or multiple RTP packets */
-        if (qt->pkt.size > 0 && qt->timestamp == *timestamp) {
-            int err;
-            if ((err = av_reallocp(&qt->pkt.data, qt->pkt.size + alen +
-                                   FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
-                qt->pkt.size = 0;
-                return err;
-            }
-        } else {
-            av_freep(&qt->pkt.data);
-            av_init_packet(&qt->pkt);
-            qt->pkt.data = av_realloc(NULL, alen + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!qt->pkt.data)
-                return AVERROR(ENOMEM);
-            qt->pkt.size = 0;
-            qt->timestamp = *timestamp;
-        }
-        memcpy(qt->pkt.data + qt->pkt.size, buf + avio_tell(&pb), alen);
-        qt->pkt.size += alen;
-        if (has_marker_bit) {
-            int ret = av_packet_from_data(pkt, qt->pkt.data, qt->pkt.size);
-            if (ret < 0)
-                return ret;
-
-            qt->pkt.size = 0;
-            qt->pkt.data = NULL;
-            pkt->flags        = flags & RTP_FLAG_KEY ? AV_PKT_FLAG_KEY : 0;
-            pkt->stream_index = st->index;
-            memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-            return 0;
-        }
-        return AVERROR(EAGAIN);
-
-    case 1: /* constant packet size, multiple packets per RTP packet */
-        if (qt->bytes_per_frame == 0 ||
-            alen % qt->bytes_per_frame != 0)
-            return AVERROR_INVALIDDATA; /* wrongly padded */
-        qt->remaining = (alen / qt->bytes_per_frame) - 1;
-        if (av_new_packet(pkt, qt->bytes_per_frame))
-            return AVERROR(ENOMEM);
-        memcpy(pkt->data, buf + avio_tell(&pb), qt->bytes_per_frame);
-        pkt->flags = flags & RTP_FLAG_KEY ? AV_PKT_FLAG_KEY : 0;
-        pkt->stream_index = st->index;
-        if (qt->remaining > 0) {
-            av_freep(&qt->pkt.data);
-            qt->pkt.data = av_realloc(NULL, qt->remaining * qt->bytes_per_frame);
-            if (!qt->pkt.data) {
-                av_free_packet(pkt);
-                return AVERROR(ENOMEM);
-            }
-            qt->pkt.size = qt->remaining * qt->bytes_per_frame;
-            memcpy(qt->pkt.data,
-                   buf + avio_tell(&pb) + qt->bytes_per_frame,
-                   qt->remaining * qt->bytes_per_frame);
-            qt->pkt.flags = pkt->flags;
-            return 1;
-        }
-        return 0;
-
-    default:  /* unimplemented */
-        avpriv_request_sample(NULL, "RTP-X-QT with packing scheme 2");
-        return AVERROR_PATCHWELCOME;
-    }
-}
-
-static PayloadContext *qt_rtp_new(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static void qt_rtp_free(PayloadContext *qt)
-{
-    av_freep(&qt->pkt.data);
-    av_free(qt);
-}
-
-#define RTP_QT_HANDLER(m, n, s, t) \
-RTPDynamicProtocolHandler ff_ ## m ## _rtp_ ## n ## _handler = { \
-    .enc_name         = s, \
-    .codec_type       = t, \
-    .codec_id         = AV_CODEC_ID_NONE, \
-    .alloc            = qt_rtp_new,    \
-    .free             = qt_rtp_free,   \
-    .parse_packet     = qt_rtp_parse_packet, \
-}
-
-RTP_QT_HANDLER(qt,        vid, "X-QT",        AVMEDIA_TYPE_VIDEO);
-RTP_QT_HANDLER(qt,        aud, "X-QT",        AVMEDIA_TYPE_AUDIO);
-RTP_QT_HANDLER(quicktime, vid, "X-QUICKTIME", AVMEDIA_TYPE_VIDEO);
-RTP_QT_HANDLER(quicktime, aud, "X-QUICKTIME", AVMEDIA_TYPE_AUDIO);
diff --git a/deps/libav/libavformat/rtpdec_svq3.c b/deps/libav/libavformat/rtpdec_svq3.c
deleted file mode 100644
index aa880e5..0000000
--- a/deps/libav/libavformat/rtpdec_svq3.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Sorenson-3 (SVQ3/SV3V) payload for RTP
- * Copyright (c) 2010 Ronald S. Bultje
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief RTP support for the SV3V (SVQ3) payload
- * @author Ronald S. Bultje <rbultje at ronald.bitfreak.net>
- * @see http://wiki.multimedia.cx/index.php?title=Sorenson_Video_3#Packetization
- */
-
-#include <string.h>
-#include "libavutil/intreadwrite.h"
-#include "rtp.h"
-#include "rtpdec.h"
-#include "rtpdec_formats.h"
-
-struct PayloadContext {
-    AVIOContext *pktbuf;
-    int64_t        timestamp;
-};
-
-/** return 0 on packet, <0 on partial packet or error... */
-static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv,
-                              AVStream *st, AVPacket *pkt,
-                              uint32_t *timestamp,
-                              const uint8_t *buf, int len, uint16_t seq,
-                              int flags)
-{
-    int config_packet, start_packet, end_packet;
-
-    if (len < 2)
-        return AVERROR_INVALIDDATA;
-
-    config_packet = buf[0] & 0x40;
-    start_packet  = buf[0] & 0x20;
-    end_packet    = buf[0] & 0x10;
-    buf += 2;     // ignore buf[1]
-    len -= 2;
-
-    if (config_packet) {
-
-        av_freep(&st->codec->extradata);
-        st->codec->extradata_size = 0;
-
-        if (len < 2 || !(st->codec->extradata =
-                         av_malloc(len + 8 + FF_INPUT_BUFFER_PADDING_SIZE)))
-            return AVERROR_INVALIDDATA;
-
-        st->codec->extradata_size = len + 8;
-        memcpy(st->codec->extradata, "SEQH", 4);
-        AV_WB32(st->codec->extradata + 4, len);
-        memcpy(st->codec->extradata + 8, buf, len);
-
-        /* We set codec_id to AV_CODEC_ID_NONE initially to
-         * delay decoder initialization since extradata is
-         * carried within the RTP stream, not SDP. Here,
-         * by setting codec_id to AV_CODEC_ID_SVQ3, we are signalling
-         * to the decoder that it is OK to initialize. */
-        st->codec->codec_id = AV_CODEC_ID_SVQ3;
-
-        return AVERROR(EAGAIN);
-    }
-
-    if (start_packet) {
-        int res;
-
-        if (sv->pktbuf) {
-            uint8_t *tmp;
-            avio_close_dyn_buf(sv->pktbuf, &tmp);
-            av_free(tmp);
-        }
-        if ((res = avio_open_dyn_buf(&sv->pktbuf)) < 0)
-            return res;
-        sv->timestamp   = *timestamp;
-    }
-
-    if (!sv->pktbuf)
-        return AVERROR_INVALIDDATA;
-
-    avio_write(sv->pktbuf, buf, len);
-
-    if (end_packet) {
-        int ret = ff_rtp_finalize_packet(pkt, &sv->pktbuf, st->index);
-        if (ret < 0)
-            return ret;
-
-        *timestamp        = sv->timestamp;
-        return 0;
-    }
-
-    return AVERROR(EAGAIN);
-}
-
-static PayloadContext *svq3_extradata_new(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static void svq3_extradata_free(PayloadContext *sv)
-{
-    if (sv->pktbuf) {
-        uint8_t *buf;
-        avio_close_dyn_buf(sv->pktbuf, &buf);
-        av_free(buf);
-    }
-    av_free(sv);
-}
-
-RTPDynamicProtocolHandler ff_svq3_dynamic_handler = {
-    .enc_name         = "X-SV3V-ES",
-    .codec_type       = AVMEDIA_TYPE_VIDEO,
-    .codec_id         = AV_CODEC_ID_NONE,      // see if (config_packet) above
-    .alloc            = svq3_extradata_new,
-    .free             = svq3_extradata_free,
-    .parse_packet     = svq3_parse_packet,
-};
diff --git a/deps/libav/libavformat/rtpdec_vp8.c b/deps/libav/libavformat/rtpdec_vp8.c
deleted file mode 100644
index fc86ac1..0000000
--- a/deps/libav/libavformat/rtpdec_vp8.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * RTP VP8 Depacketizer
- * Copyright (c) 2010 Josh Allmann
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief RTP support for the VP8 payload
- * @author Josh Allmann <joshua.allmann at gmail.com>
- * @see http://tools.ietf.org/html/draft-ietf-payload-vp8-05
- */
-
-#include "libavcodec/bytestream.h"
-
-#include "rtpdec_formats.h"
-
-struct PayloadContext {
-    AVIOContext *data;
-    uint32_t     timestamp;
-    int          is_keyframe;
-    /* If sequence_ok is set, we keep returning data (even if we might have
-     * lost some data, but we haven't lost any too critical data that would
-     * cause the decoder to desynchronize and output random garbage).
-     */
-    int          sequence_ok;
-    int          first_part_size;
-    uint16_t     prev_seq;
-    int          prev_pictureid;
-    int          broken_frame;
-    /* If sequence_dirty is set, we have lost some data (critical or
-     * non-critical) and decoding will have some sort of artefacts, and
-     * we thus should request a new keyframe.
-     */
-    int          sequence_dirty;
-    int          got_keyframe;
-};
-
-static void vp8_free_buffer(PayloadContext *vp8)
-{
-    uint8_t *tmp;
-    if (!vp8->data)
-        return;
-    avio_close_dyn_buf(vp8->data, &tmp);
-    av_free(tmp);
-    vp8->data = NULL;
-}
-
-static int vp8_broken_sequence(AVFormatContext *ctx, PayloadContext *vp8,
-                               const char *msg)
-{
-    vp8->sequence_ok = 0;
-    av_log(ctx, AV_LOG_WARNING, "%s", msg);
-    vp8_free_buffer(vp8);
-    return AVERROR(EAGAIN);
-}
-
-static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
-                             AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                             const uint8_t *buf, int len, uint16_t seq,
-                             int flags)
-{
-    int start_partition, end_packet;
-    int extended_bits, part_id;
-    int pictureid_present = 0, tl0picidx_present = 0, tid_present = 0,
-        keyidx_present = 0;
-    int pictureid = -1, pictureid_mask = 0;
-    int returned_old_frame = 0;
-    uint32_t old_timestamp = 0;
-
-    if (!buf) {
-        if (vp8->data) {
-            int ret = ff_rtp_finalize_packet(pkt, &vp8->data, st->index);
-            if (ret < 0)
-                return ret;
-            *timestamp = vp8->timestamp;
-            if (vp8->sequence_dirty)
-                pkt->flags |= AV_PKT_FLAG_CORRUPT;
-            return 0;
-        }
-        return AVERROR(EAGAIN);
-    }
-
-    if (len < 1)
-        return AVERROR_INVALIDDATA;
-
-    extended_bits   = buf[0] & 0x80;
-    start_partition = buf[0] & 0x10;
-    part_id         = buf[0] & 0x0f;
-    end_packet      = flags & RTP_FLAG_MARKER;
-    buf++;
-    len--;
-    if (extended_bits) {
-        if (len < 1)
-            return AVERROR_INVALIDDATA;
-        pictureid_present = buf[0] & 0x80;
-        tl0picidx_present = buf[0] & 0x40;
-        tid_present       = buf[0] & 0x20;
-        keyidx_present    = buf[0] & 0x10;
-        buf++;
-        len--;
-    }
-    if (pictureid_present) {
-        if (len < 1)
-            return AVERROR_INVALIDDATA;
-        if (buf[0] & 0x80) {
-            if (len < 2)
-                return AVERROR_INVALIDDATA;
-            pictureid = AV_RB16(buf) & 0x7fff;
-            pictureid_mask = 0x7fff;
-            buf += 2;
-            len -= 2;
-        } else {
-            pictureid = buf[0] & 0x7f;
-            pictureid_mask = 0x7f;
-            buf++;
-            len--;
-        }
-    }
-    if (tl0picidx_present) {
-        // Ignoring temporal level zero index
-        buf++;
-        len--;
-    }
-    if (tid_present || keyidx_present) {
-        // Ignoring temporal layer index, layer sync bit and keyframe index
-        buf++;
-        len--;
-    }
-    if (len < 1)
-        return AVERROR_INVALIDDATA;
-
-    if (start_partition && part_id == 0 && len >= 3) {
-        int res;
-        int non_key = buf[0] & 0x01;
-        if (!non_key) {
-            vp8_free_buffer(vp8);
-            // Keyframe, decoding ok again
-            vp8->sequence_ok = 1;
-            vp8->sequence_dirty = 0;
-            vp8->got_keyframe = 1;
-        } else {
-            int can_continue = vp8->data && !vp8->is_keyframe &&
-                               avio_tell(vp8->data) >= vp8->first_part_size;
-            if (!vp8->sequence_ok)
-                return AVERROR(EAGAIN);
-            if (!vp8->got_keyframe)
-                return vp8_broken_sequence(ctx, vp8, "Keyframe missing\n");
-            if (pictureid >= 0) {
-                if (pictureid != ((vp8->prev_pictureid + 1) & pictureid_mask)) {
-                    return vp8_broken_sequence(ctx, vp8,
-                                               "Missed a picture, sequence broken\n");
-                } else {
-                    if (vp8->data && !can_continue)
-                        return vp8_broken_sequence(ctx, vp8,
-                                                   "Missed a picture, sequence broken\n");
-                }
-            } else {
-                uint16_t expected_seq = vp8->prev_seq + 1;
-                int16_t diff = seq - expected_seq;
-                if (vp8->data) {
-                    // No picture id, so we can't know if missed packets
-                    // contained any new frames. If diff == 0, we did get
-                    // later packets from the same frame (matching timestamp),
-                    // so we know we didn't miss any frame. If diff == 1 and
-                    // we still have data (not flushed by the end of frame
-                    // marker), the single missed packet must have been part
-                    // of the same frame.
-                    if ((diff == 0 || diff == 1) && can_continue) {
-                        // Proceed with what we have
-                    } else {
-                        return vp8_broken_sequence(ctx, vp8,
-                                                   "Missed too much, sequence broken\n");
-                    }
-                } else {
-                    if (diff != 0)
-                        return vp8_broken_sequence(ctx, vp8,
-                                                   "Missed unknown data, sequence broken\n");
-                }
-            }
-            if (vp8->data) {
-                vp8->sequence_dirty = 1;
-                if (avio_tell(vp8->data) >= vp8->first_part_size) {
-                    int ret = ff_rtp_finalize_packet(pkt, &vp8->data, st->index);
-                    if (ret < 0)
-                        return ret;
-                    pkt->flags |= AV_PKT_FLAG_CORRUPT;
-                    returned_old_frame = 1;
-                    old_timestamp = vp8->timestamp;
-                } else {
-                    // Shouldn't happen
-                    vp8_free_buffer(vp8);
-                }
-            }
-        }
-        vp8->first_part_size = (AV_RL16(&buf[1]) << 3 | buf[0] >> 5) + 3;
-        if ((res = avio_open_dyn_buf(&vp8->data)) < 0)
-            return res;
-        vp8->timestamp = *timestamp;
-        vp8->broken_frame = 0;
-        vp8->prev_pictureid = pictureid;
-        vp8->is_keyframe = !non_key;
-    } else {
-        uint16_t expected_seq = vp8->prev_seq + 1;
-
-        if (!vp8->sequence_ok)
-            return AVERROR(EAGAIN);
-
-        if (vp8->timestamp != *timestamp) {
-            // Missed the start of the new frame, sequence broken
-            return vp8_broken_sequence(ctx, vp8,
-                                       "Received no start marker; dropping frame\n");
-        }
-
-        if (seq != expected_seq) {
-            if (vp8->is_keyframe) {
-                return vp8_broken_sequence(ctx, vp8,
-                                           "Missed part of a keyframe, sequence broken\n");
-            } else if (vp8->data && avio_tell(vp8->data) >= vp8->first_part_size) {
-                vp8->broken_frame = 1;
-                vp8->sequence_dirty = 1;
-            } else {
-                return vp8_broken_sequence(ctx, vp8,
-                                           "Missed part of the first partition, sequence broken\n");
-            }
-        }
-    }
-
-    if (!vp8->data)
-        return vp8_broken_sequence(ctx, vp8, "Received no start marker\n");
-
-    vp8->prev_seq = seq;
-    if (!vp8->broken_frame)
-        avio_write(vp8->data, buf, len);
-
-    if (returned_old_frame) {
-        *timestamp = old_timestamp;
-        return end_packet ? 1 : 0;
-    }
-
-    if (end_packet) {
-        int ret;
-        ret = ff_rtp_finalize_packet(pkt, &vp8->data, st->index);
-        if (ret < 0)
-            return ret;
-        if (vp8->sequence_dirty)
-            pkt->flags |= AV_PKT_FLAG_CORRUPT;
-        return 0;
-    }
-
-    return AVERROR(EAGAIN);
-}
-
-static PayloadContext *vp8_new_context(void)
-{
-    PayloadContext *vp8 = av_mallocz(sizeof(PayloadContext));
-    if (!vp8)
-        return NULL;
-    vp8->sequence_ok = 1;
-    return vp8;
-}
-
-static void vp8_free_context(PayloadContext *vp8)
-{
-    vp8_free_buffer(vp8);
-    av_free(vp8);
-}
-
-static int vp8_need_keyframe(PayloadContext *vp8)
-{
-    return vp8->sequence_dirty || !vp8->sequence_ok;
-}
-
-RTPDynamicProtocolHandler ff_vp8_dynamic_handler = {
-    .enc_name       = "VP8",
-    .codec_type     = AVMEDIA_TYPE_VIDEO,
-    .codec_id       = AV_CODEC_ID_VP8,
-    .alloc          = vp8_new_context,
-    .free           = vp8_free_context,
-    .parse_packet   = vp8_handle_packet,
-    .need_keyframe  = vp8_need_keyframe,
-};
diff --git a/deps/libav/libavformat/rtpdec_xiph.c b/deps/libav/libavformat/rtpdec_xiph.c
deleted file mode 100644
index 2049e4f..0000000
--- a/deps/libav/libavformat/rtpdec_xiph.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Xiph RTP Protocols
- * Copyright (c) 2009 Colin McQuillian
- * Copyright (c) 2010 Josh Allmann
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Xiph / RTP Code
- * @author Colin McQuillan <m.niloc at gmail.com>
- * @author Josh Allmann <joshua.allmann at gmail.com>
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/avstring.h"
-#include "libavutil/base64.h"
-#include "libavcodec/bytestream.h"
-
-#include <assert.h>
-
-#include "rtpdec.h"
-#include "rtpdec_formats.h"
-
-/**
- * RTP/Xiph specific private data.
- */
-struct PayloadContext {
-    unsigned ident;             ///< 24-bit stream configuration identifier
-    uint32_t timestamp;
-    AVIOContext* fragment;    ///< buffer for split payloads
-    uint8_t *split_buf;
-    int split_pos, split_buf_len, split_buf_size;
-    int split_pkts;
-};
-
-static PayloadContext *xiph_new_context(void)
-{
-    return av_mallocz(sizeof(PayloadContext));
-}
-
-static inline void free_fragment_if_needed(PayloadContext * data)
-{
-    if (data->fragment) {
-        uint8_t* p;
-        avio_close_dyn_buf(data->fragment, &p);
-        av_free(p);
-        data->fragment = NULL;
-    }
-}
-
-static void xiph_free_context(PayloadContext * data)
-{
-    free_fragment_if_needed(data);
-    av_free(data->split_buf);
-    av_free(data);
-}
-
-static av_cold int xiph_vorbis_init(AVFormatContext *ctx, int st_index,
-                                    PayloadContext *data)
-{
-    if (st_index < 0)
-        return 0;
-    ctx->streams[st_index]->need_parsing = AVSTREAM_PARSE_HEADERS;
-    return 0;
-}
-
-
-static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data,
-                              AVStream *st, AVPacket *pkt, uint32_t *timestamp,
-                              const uint8_t *buf, int len, uint16_t seq,
-                              int flags)
-{
-
-    int ident, fragmented, tdt, num_pkts, pkt_len;
-
-    if (!buf) {
-        if (!data->split_buf || data->split_pos + 2 > data->split_buf_len ||
-            data->split_pkts <= 0) {
-            av_log(ctx, AV_LOG_ERROR, "No more data to return\n");
-            return AVERROR_INVALIDDATA;
-        }
-        pkt_len = AV_RB16(data->split_buf + data->split_pos);
-        data->split_pos += 2;
-        if (data->split_pos + pkt_len > data->split_buf_len) {
-            av_log(ctx, AV_LOG_ERROR, "Not enough data to return\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (av_new_packet(pkt, pkt_len)) {
-            av_log(ctx, AV_LOG_ERROR, "Out of memory.\n");
-            return AVERROR(ENOMEM);
-        }
-        pkt->stream_index = st->index;
-        memcpy(pkt->data, data->split_buf + data->split_pos, pkt_len);
-        data->split_pos += pkt_len;
-        data->split_pkts--;
-        return data->split_pkts > 0;
-    }
-
-    if (len < 6) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid %d byte packet\n", len);
-        return AVERROR_INVALIDDATA;
-    }
-
-    // read xiph rtp headers
-    ident       = AV_RB24(buf);
-    fragmented  = buf[3] >> 6;
-    tdt         = (buf[3] >> 4) & 3;
-    num_pkts    = buf[3] & 0xf;
-    pkt_len     = AV_RB16(buf + 4);
-
-    if (pkt_len > len - 6) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Invalid packet length %d in %d byte packet\n", pkt_len,
-               len);
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (ident != data->ident) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Unimplemented Xiph SDP configuration change detected\n");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (tdt) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Unimplemented RTP Xiph packet settings (%d,%d,%d)\n",
-               fragmented, tdt, num_pkts);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    buf += 6; // move past header bits
-    len -= 6;
-
-    if (fragmented == 0) {
-        if (av_new_packet(pkt, pkt_len)) {
-            av_log(ctx, AV_LOG_ERROR, "Out of memory.\n");
-            return AVERROR(ENOMEM);
-        }
-        pkt->stream_index = st->index;
-        memcpy(pkt->data, buf, pkt_len);
-        buf += pkt_len;
-        len -= pkt_len;
-        num_pkts--;
-
-        if (num_pkts > 0) {
-            if (len > data->split_buf_size || !data->split_buf) {
-                av_freep(&data->split_buf);
-                data->split_buf_size = 2 * len;
-                data->split_buf = av_malloc(data->split_buf_size);
-                if (!data->split_buf) {
-                    av_log(ctx, AV_LOG_ERROR, "Out of memory.\n");
-                    av_free_packet(pkt);
-                    return AVERROR(ENOMEM);
-                }
-            }
-            memcpy(data->split_buf, buf, len);
-            data->split_buf_len = len;
-            data->split_pos = 0;
-            data->split_pkts = num_pkts;
-            return 1;
-        }
-
-        return 0;
-
-    } else if (fragmented == 1) {
-        // start of xiph data fragment
-        int res;
-
-        // end packet has been lost somewhere, so drop buffered data
-        free_fragment_if_needed(data);
-
-        if((res = avio_open_dyn_buf(&data->fragment)) < 0)
-            return res;
-
-        avio_write(data->fragment, buf, pkt_len);
-        data->timestamp = *timestamp;
-
-    } else {
-        assert(fragmented < 4);
-        if (data->timestamp != *timestamp) {
-            // skip if fragmented timestamp is incorrect;
-            // a start packet has been lost somewhere
-            free_fragment_if_needed(data);
-            av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match!\n");
-            return AVERROR_INVALIDDATA;
-        }
-        if (!data->fragment) {
-            av_log(ctx, AV_LOG_WARNING,
-                   "Received packet without a start fragment; dropping.\n");
-            return AVERROR(EAGAIN);
-        }
-
-        // copy data to fragment buffer
-        avio_write(data->fragment, buf, pkt_len);
-
-        if (fragmented == 3) {
-            // end of xiph data packet
-            int ret = ff_rtp_finalize_packet(pkt, &data->fragment, st->index);
-            if (ret < 0) {
-                av_log(ctx, AV_LOG_ERROR,
-                       "Error occurred when getting fragment buffer.");
-                return ret;
-            }
-
-            return 0;
-        }
-    }
-
-   return AVERROR(EAGAIN);
-}
-
-/**
- * Length encoding described in RFC5215 section 3.1.1.
- */
-static int get_base128(const uint8_t ** buf, const uint8_t * buf_end)
-{
-    int n = 0;
-    for (; *buf < buf_end; ++*buf) {
-        n <<= 7;
-        n += **buf & 0x7f;
-        if (!(**buf & 0x80)) {
-            ++*buf;
-            return n;
-        }
-    }
-    return 0;
-}
-
-/**
- * Based off parse_packed_headers in Vorbis RTP
- */
-static int
-parse_packed_headers(const uint8_t * packed_headers,
-                     const uint8_t * packed_headers_end,
-                     AVCodecContext * codec, PayloadContext * xiph_data)
-{
-
-    unsigned num_packed, num_headers, length, length1, length2, extradata_alloc;
-    uint8_t *ptr;
-
-    if (packed_headers_end - packed_headers < 9) {
-        av_log(codec, AV_LOG_ERROR,
-               "Invalid %td byte packed header.",
-               packed_headers_end - packed_headers);
-        return AVERROR_INVALIDDATA;
-    }
-
-    num_packed         = bytestream_get_be32(&packed_headers);
-    xiph_data->ident   = bytestream_get_be24(&packed_headers);
-    length             = bytestream_get_be16(&packed_headers);
-    num_headers        = get_base128(&packed_headers, packed_headers_end);
-    length1            = get_base128(&packed_headers, packed_headers_end);
-    length2            = get_base128(&packed_headers, packed_headers_end);
-
-    if (num_packed != 1 || num_headers > 3) {
-        av_log(codec, AV_LOG_ERROR,
-               "Unimplemented number of headers: %d packed headers, %d headers\n",
-               num_packed, num_headers);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (packed_headers_end - packed_headers != length ||
-        length1 > length || length2 > length - length1) {
-        av_log(codec, AV_LOG_ERROR,
-               "Bad packed header lengths (%d,%d,%td,%d)\n", length1,
-               length2, packed_headers_end - packed_headers, length);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* allocate extra space:
-     * -- length/255 +2 for xiphlacing
-     * -- one for the '2' marker
-     * -- FF_INPUT_BUFFER_PADDING_SIZE required */
-    extradata_alloc = length + length/255 + 3 + FF_INPUT_BUFFER_PADDING_SIZE;
-
-    ptr = codec->extradata = av_malloc(extradata_alloc);
-    if (!ptr) {
-        av_log(codec, AV_LOG_ERROR, "Out of memory\n");
-        return AVERROR(ENOMEM);
-    }
-    *ptr++ = 2;
-    ptr += av_xiphlacing(ptr, length1);
-    ptr += av_xiphlacing(ptr, length2);
-    memcpy(ptr, packed_headers, length);
-    ptr += length;
-    codec->extradata_size = ptr - codec->extradata;
-    // clear out remaining parts of the buffer
-    memset(ptr, 0, extradata_alloc - codec->extradata_size);
-
-    return 0;
-}
-
-static int xiph_parse_fmtp_pair(AVStream* stream,
-                                PayloadContext *xiph_data,
-                                char *attr, char *value)
-{
-    AVCodecContext *codec = stream->codec;
-    int result = 0;
-
-    if (!strcmp(attr, "sampling")) {
-        if (!strcmp(value, "YCbCr-4:2:0")) {
-            codec->pix_fmt = AV_PIX_FMT_YUV420P;
-        } else if (!strcmp(value, "YCbCr-4:4:2")) {
-            codec->pix_fmt = AV_PIX_FMT_YUV422P;
-        } else if (!strcmp(value, "YCbCr-4:4:4")) {
-            codec->pix_fmt = AV_PIX_FMT_YUV444P;
-        } else {
-            av_log(codec, AV_LOG_ERROR,
-                   "Unsupported pixel format %s\n", attr);
-            return AVERROR_INVALIDDATA;
-        }
-    } else if (!strcmp(attr, "width")) {
-        /* This is an integer between 1 and 1048561
-         * and MUST be in multiples of 16. */
-        codec->width = atoi(value);
-        return 0;
-    } else if (!strcmp(attr, "height")) {
-        /* This is an integer between 1 and 1048561
-         * and MUST be in multiples of 16. */
-        codec->height = atoi(value);
-        return 0;
-    } else if (!strcmp(attr, "delivery-method")) {
-        /* Possible values are: inline, in_band, out_band/specific_name. */
-        return AVERROR_PATCHWELCOME;
-    } else if (!strcmp(attr, "configuration-uri")) {
-        /* NOTE: configuration-uri is supported only under 2 conditions:
-         *--after the delivery-method tag
-         * --with a delivery-method value of out_band */
-        return AVERROR_PATCHWELCOME;
-    } else if (!strcmp(attr, "configuration")) {
-        /* NOTE: configuration is supported only AFTER the delivery-method tag
-         * The configuration value is a base64 encoded packed header */
-        uint8_t *decoded_packet = NULL;
-        int packet_size;
-        size_t decoded_alloc = strlen(value) / 4 * 3 + 4;
-
-        if (decoded_alloc <= INT_MAX) {
-            decoded_packet = av_malloc(decoded_alloc);
-            if (decoded_packet) {
-                packet_size =
-                    av_base64_decode(decoded_packet, value, decoded_alloc);
-
-                result = parse_packed_headers
-                    (decoded_packet, decoded_packet + packet_size, codec,
-                    xiph_data);
-            } else {
-                av_log(codec, AV_LOG_ERROR,
-                       "Out of memory while decoding SDP configuration.\n");
-                result = AVERROR(ENOMEM);
-            }
-        } else {
-            av_log(codec, AV_LOG_ERROR, "Packet too large\n");
-            result = AVERROR_INVALIDDATA;
-        }
-        av_free(decoded_packet);
-    }
-    return result;
-}
-
-static int xiph_parse_sdp_line(AVFormatContext *s, int st_index,
-                               PayloadContext *data, const char *line)
-{
-    const char *p;
-
-    if (st_index < 0)
-        return 0;
-
-    if (av_strstart(line, "fmtp:", &p)) {
-        return ff_parse_fmtp(s->streams[st_index], data, p,
-                             xiph_parse_fmtp_pair);
-    }
-
-    return 0;
-}
-
-RTPDynamicProtocolHandler ff_theora_dynamic_handler = {
-    .enc_name         = "theora",
-    .codec_type       = AVMEDIA_TYPE_VIDEO,
-    .codec_id         = AV_CODEC_ID_THEORA,
-    .parse_sdp_a_line = xiph_parse_sdp_line,
-    .alloc            = xiph_new_context,
-    .free             = xiph_free_context,
-    .parse_packet     = xiph_handle_packet
-};
-
-RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = {
-    .enc_name         = "vorbis",
-    .codec_type       = AVMEDIA_TYPE_AUDIO,
-    .codec_id         = AV_CODEC_ID_VORBIS,
-    .init             = xiph_vorbis_init,
-    .parse_sdp_a_line = xiph_parse_sdp_line,
-    .alloc            = xiph_new_context,
-    .free             = xiph_free_context,
-    .parse_packet     = xiph_handle_packet
-};
diff --git a/deps/libav/libavformat/rtpenc.c b/deps/libav/libavformat/rtpenc.c
deleted file mode 100644
index 83167eb..0000000
--- a/deps/libav/libavformat/rtpenc.c
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
- * RTP output format
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "mpegts.h"
-#include "internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/random_seed.h"
-#include "libavutil/opt.h"
-
-#include "rtpenc.h"
-
-static const AVOption options[] = {
-    FF_RTP_FLAG_OPTS(RTPMuxContext, flags),
-    { "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM },
-    { "ssrc", "Stream identifier", offsetof(RTPMuxContext, ssrc), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
-    { "cname", "CNAME to include in RTCP SR packets", offsetof(RTPMuxContext, cname), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
-    { "seq", "Starting sequence number", offsetof(RTPMuxContext, seq), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 65535, AV_OPT_FLAG_ENCODING_PARAM },
-    { NULL },
-};
-
-static const AVClass rtp_muxer_class = {
-    .class_name = "RTP muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-#define RTCP_SR_SIZE 28
-
-static int is_supported(enum AVCodecID id)
-{
-    switch(id) {
-    case AV_CODEC_ID_H263:
-    case AV_CODEC_ID_H263P:
-    case AV_CODEC_ID_H264:
-    case AV_CODEC_ID_MPEG1VIDEO:
-    case AV_CODEC_ID_MPEG2VIDEO:
-    case AV_CODEC_ID_MPEG4:
-    case AV_CODEC_ID_AAC:
-    case AV_CODEC_ID_MP2:
-    case AV_CODEC_ID_MP3:
-    case AV_CODEC_ID_PCM_ALAW:
-    case AV_CODEC_ID_PCM_MULAW:
-    case AV_CODEC_ID_PCM_S8:
-    case AV_CODEC_ID_PCM_S16BE:
-    case AV_CODEC_ID_PCM_S16LE:
-    case AV_CODEC_ID_PCM_U16BE:
-    case AV_CODEC_ID_PCM_U16LE:
-    case AV_CODEC_ID_PCM_U8:
-    case AV_CODEC_ID_MPEG2TS:
-    case AV_CODEC_ID_AMR_NB:
-    case AV_CODEC_ID_AMR_WB:
-    case AV_CODEC_ID_VORBIS:
-    case AV_CODEC_ID_THEORA:
-    case AV_CODEC_ID_VP8:
-    case AV_CODEC_ID_ADPCM_G722:
-    case AV_CODEC_ID_ADPCM_G726:
-    case AV_CODEC_ID_ILBC:
-    case AV_CODEC_ID_MJPEG:
-    case AV_CODEC_ID_SPEEX:
-    case AV_CODEC_ID_OPUS:
-        return 1;
-    default:
-        return 0;
-    }
-}
-
-static int rtp_write_header(AVFormatContext *s1)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int n;
-    AVStream *st;
-
-    if (s1->nb_streams != 1) {
-        av_log(s1, AV_LOG_ERROR, "Only one stream supported in the RTP muxer\n");
-        return AVERROR(EINVAL);
-    }
-    st = s1->streams[0];
-    if (!is_supported(st->codec->codec_id)) {
-        av_log(s1, AV_LOG_ERROR, "Unsupported codec %x\n", st->codec->codec_id);
-
-        return -1;
-    }
-
-    if (s->payload_type < 0) {
-        /* Re-validate non-dynamic payload types */
-        if (st->id < RTP_PT_PRIVATE)
-            st->id = ff_rtp_get_payload_type(s1, st->codec, -1);
-
-        s->payload_type = st->id;
-    } else {
-        /* private option takes priority */
-        st->id = s->payload_type;
-    }
-
-    s->base_timestamp = av_get_random_seed();
-    s->timestamp = s->base_timestamp;
-    s->cur_timestamp = 0;
-    if (!s->ssrc)
-        s->ssrc = av_get_random_seed();
-    s->first_packet = 1;
-    s->first_rtcp_ntp_time = ff_ntp_time();
-    if (s1->start_time_realtime)
-        /* Round the NTP time to whole milliseconds. */
-        s->first_rtcp_ntp_time = (s1->start_time_realtime / 1000) * 1000 +
-                                 NTP_OFFSET_US;
-    // Pick a random sequence start number, but in the lower end of the
-    // available range, so that any wraparound doesn't happen immediately.
-    // (Immediate wraparound would be an issue for SRTP.)
-    if (s->seq < 0)
-        s->seq = av_get_random_seed() & 0x0fff;
-    else
-        s->seq &= 0xffff; // Use the given parameter, wrapped to the right interval
-
-    if (s1->packet_size) {
-        if (s1->pb->max_packet_size)
-            s1->packet_size = FFMIN(s1->packet_size,
-                                    s1->pb->max_packet_size);
-    } else
-        s1->packet_size = s1->pb->max_packet_size;
-    if (s1->packet_size <= 12) {
-        av_log(s1, AV_LOG_ERROR, "Max packet size %d too low\n", s1->packet_size);
-        return AVERROR(EIO);
-    }
-    s->buf = av_malloc(s1->packet_size);
-    if (s->buf == NULL) {
-        return AVERROR(ENOMEM);
-    }
-    s->max_payload_size = s1->packet_size - 12;
-
-    s->max_frames_per_packet = 0;
-    if (s1->max_delay > 0) {
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            int frame_size = av_get_audio_frame_duration(st->codec, 0);
-            if (!frame_size)
-                frame_size = st->codec->frame_size;
-            if (frame_size == 0) {
-                av_log(s1, AV_LOG_ERROR, "Cannot respect max delay: frame size = 0\n");
-            } else {
-                s->max_frames_per_packet =
-                        av_rescale_q_rnd(s1->max_delay,
-                                         AV_TIME_BASE_Q,
-                                         (AVRational){ frame_size, st->codec->sample_rate },
-                                         AV_ROUND_DOWN);
-            }
-        }
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            /* FIXME: We should round down here... */
-            s->max_frames_per_packet = av_rescale_q(s1->max_delay, (AVRational){1, 1000000}, st->codec->time_base);
-        }
-    }
-
-    avpriv_set_pts_info(st, 32, 1, 90000);
-    switch(st->codec->codec_id) {
-    case AV_CODEC_ID_MP2:
-    case AV_CODEC_ID_MP3:
-        s->buf_ptr = s->buf + 4;
-        break;
-    case AV_CODEC_ID_MPEG1VIDEO:
-    case AV_CODEC_ID_MPEG2VIDEO:
-        break;
-    case AV_CODEC_ID_MPEG2TS:
-        n = s->max_payload_size / TS_PACKET_SIZE;
-        if (n < 1)
-            n = 1;
-        s->max_payload_size = n * TS_PACKET_SIZE;
-        s->buf_ptr = s->buf;
-        break;
-    case AV_CODEC_ID_H264:
-        /* check for H.264 MP4 syntax */
-        if (st->codec->extradata_size > 4 && st->codec->extradata[0] == 1) {
-            s->nal_length_size = (st->codec->extradata[4] & 0x03) + 1;
-        }
-        break;
-    case AV_CODEC_ID_VORBIS:
-    case AV_CODEC_ID_THEORA:
-        if (!s->max_frames_per_packet) s->max_frames_per_packet = 15;
-        s->max_frames_per_packet = av_clip(s->max_frames_per_packet, 1, 15);
-        s->max_payload_size -= 6; // ident+frag+tdt/vdt+pkt_num+pkt_length
-        s->num_frames = 0;
-        goto defaultcase;
-    case AV_CODEC_ID_ADPCM_G722:
-        /* Due to a historical error, the clock rate for G722 in RTP is
-         * 8000, even if the sample rate is 16000. See RFC 3551. */
-        avpriv_set_pts_info(st, 32, 1, 8000);
-        break;
-    case AV_CODEC_ID_OPUS:
-        if (st->codec->channels > 2) {
-            av_log(s1, AV_LOG_ERROR, "Multistream opus not supported in RTP\n");
-            goto fail;
-        }
-        /* The opus RTP RFC says that all opus streams should use 48000 Hz
-         * as clock rate, since all opus sample rates can be expressed in
-         * this clock rate, and sample rate changes on the fly are supported. */
-        avpriv_set_pts_info(st, 32, 1, 48000);
-        break;
-    case AV_CODEC_ID_ILBC:
-        if (st->codec->block_align != 38 && st->codec->block_align != 50) {
-            av_log(s1, AV_LOG_ERROR, "Incorrect iLBC block size specified\n");
-            goto fail;
-        }
-        if (!s->max_frames_per_packet)
-            s->max_frames_per_packet = 1;
-        s->max_frames_per_packet = FFMIN(s->max_frames_per_packet,
-                                         s->max_payload_size / st->codec->block_align);
-        goto defaultcase;
-    case AV_CODEC_ID_AMR_NB:
-    case AV_CODEC_ID_AMR_WB:
-        if (!s->max_frames_per_packet)
-            s->max_frames_per_packet = 12;
-        if (st->codec->codec_id == AV_CODEC_ID_AMR_NB)
-            n = 31;
-        else
-            n = 61;
-        /* max_header_toc_size + the largest AMR payload must fit */
-        if (1 + s->max_frames_per_packet + n > s->max_payload_size) {
-            av_log(s1, AV_LOG_ERROR, "RTP max payload size too small for AMR\n");
-            goto fail;
-        }
-        if (st->codec->channels != 1) {
-            av_log(s1, AV_LOG_ERROR, "Only mono is supported\n");
-            goto fail;
-        }
-    case AV_CODEC_ID_AAC:
-        s->num_frames = 0;
-    default:
-defaultcase:
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            avpriv_set_pts_info(st, 32, 1, st->codec->sample_rate);
-        }
-        s->buf_ptr = s->buf;
-        break;
-    }
-
-    return 0;
-
-fail:
-    av_freep(&s->buf);
-    return AVERROR(EINVAL);
-}
-
-/* send an rtcp sender report packet */
-static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time, int bye)
-{
-    RTPMuxContext *s = s1->priv_data;
-    uint32_t rtp_ts;
-
-    av_dlog(s1, "RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp);
-
-    s->last_rtcp_ntp_time = ntp_time;
-    rtp_ts = av_rescale_q(ntp_time - s->first_rtcp_ntp_time, (AVRational){1, 1000000},
-                          s1->streams[0]->time_base) + s->base_timestamp;
-    avio_w8(s1->pb, RTP_VERSION << 6);
-    avio_w8(s1->pb, RTCP_SR);
-    avio_wb16(s1->pb, 6); /* length in words - 1 */
-    avio_wb32(s1->pb, s->ssrc);
-    avio_wb64(s1->pb, NTP_TO_RTP_FORMAT(ntp_time));
-    avio_wb32(s1->pb, rtp_ts);
-    avio_wb32(s1->pb, s->packet_count);
-    avio_wb32(s1->pb, s->octet_count);
-
-    if (s->cname) {
-        int len = FFMIN(strlen(s->cname), 255);
-        avio_w8(s1->pb, (RTP_VERSION << 6) + 1);
-        avio_w8(s1->pb, RTCP_SDES);
-        avio_wb16(s1->pb, (7 + len + 3) / 4); /* length in words - 1 */
-
-        avio_wb32(s1->pb, s->ssrc);
-        avio_w8(s1->pb, 0x01); /* CNAME */
-        avio_w8(s1->pb, len);
-        avio_write(s1->pb, s->cname, len);
-        avio_w8(s1->pb, 0); /* END */
-        for (len = (7 + len) % 4; len % 4; len++)
-            avio_w8(s1->pb, 0);
-    }
-
-    if (bye) {
-        avio_w8(s1->pb, (RTP_VERSION << 6) | 1);
-        avio_w8(s1->pb, RTCP_BYE);
-        avio_wb16(s1->pb, 1); /* length in words - 1 */
-        avio_wb32(s1->pb, s->ssrc);
-    }
-
-    avio_flush(s1->pb);
-}
-
-/* send an rtp packet. sequence number is incremented, but the caller
-   must update the timestamp itself */
-void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
-{
-    RTPMuxContext *s = s1->priv_data;
-
-    av_dlog(s1, "rtp_send_data size=%d\n", len);
-
-    /* build the RTP header */
-    avio_w8(s1->pb, RTP_VERSION << 6);
-    avio_w8(s1->pb, (s->payload_type & 0x7f) | ((m & 0x01) << 7));
-    avio_wb16(s1->pb, s->seq);
-    avio_wb32(s1->pb, s->timestamp);
-    avio_wb32(s1->pb, s->ssrc);
-
-    avio_write(s1->pb, buf1, len);
-    avio_flush(s1->pb);
-
-    s->seq = (s->seq + 1) & 0xffff;
-    s->octet_count += len;
-    s->packet_count++;
-}
-
-/* send an integer number of samples and compute time stamp and fill
-   the rtp send buffer before sending. */
-static int rtp_send_samples(AVFormatContext *s1,
-                            const uint8_t *buf1, int size, int sample_size_bits)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int len, max_packet_size, n;
-    /* Calculate the number of bytes to get samples aligned on a byte border */
-    int aligned_samples_size = sample_size_bits/av_gcd(sample_size_bits, 8);
-
-    max_packet_size = (s->max_payload_size / aligned_samples_size) * aligned_samples_size;
-    /* Not needed, but who knows. Don't check if samples aren't an even number of bytes. */
-    if ((sample_size_bits % 8) == 0 && ((8 * size) % sample_size_bits) != 0)
-        return AVERROR(EINVAL);
-    n = 0;
-    while (size > 0) {
-        s->buf_ptr = s->buf;
-        len = FFMIN(max_packet_size, size);
-
-        /* copy data */
-        memcpy(s->buf_ptr, buf1, len);
-        s->buf_ptr += len;
-        buf1 += len;
-        size -= len;
-        s->timestamp = s->cur_timestamp + n * 8 / sample_size_bits;
-        ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0);
-        n += (s->buf_ptr - s->buf);
-    }
-    return 0;
-}
-
-static void rtp_send_mpegaudio(AVFormatContext *s1,
-                               const uint8_t *buf1, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int len, count, max_packet_size;
-
-    max_packet_size = s->max_payload_size;
-
-    /* test if we must flush because not enough space */
-    len = (s->buf_ptr - s->buf);
-    if ((len + size) > max_packet_size) {
-        if (len > 4) {
-            ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0);
-            s->buf_ptr = s->buf + 4;
-        }
-    }
-    if (s->buf_ptr == s->buf + 4) {
-        s->timestamp = s->cur_timestamp;
-    }
-
-    /* add the packet */
-    if (size > max_packet_size) {
-        /* big packet: fragment */
-        count = 0;
-        while (size > 0) {
-            len = max_packet_size - 4;
-            if (len > size)
-                len = size;
-            /* build fragmented packet */
-            s->buf[0] = 0;
-            s->buf[1] = 0;
-            s->buf[2] = count >> 8;
-            s->buf[3] = count;
-            memcpy(s->buf + 4, buf1, len);
-            ff_rtp_send_data(s1, s->buf, len + 4, 0);
-            size -= len;
-            buf1 += len;
-            count += len;
-        }
-    } else {
-        if (s->buf_ptr == s->buf + 4) {
-            /* no fragmentation possible */
-            s->buf[0] = 0;
-            s->buf[1] = 0;
-            s->buf[2] = 0;
-            s->buf[3] = 0;
-        }
-        memcpy(s->buf_ptr, buf1, size);
-        s->buf_ptr += size;
-    }
-}
-
-static void rtp_send_raw(AVFormatContext *s1,
-                         const uint8_t *buf1, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int len, max_packet_size;
-
-    max_packet_size = s->max_payload_size;
-
-    while (size > 0) {
-        len = max_packet_size;
-        if (len > size)
-            len = size;
-
-        s->timestamp = s->cur_timestamp;
-        ff_rtp_send_data(s1, buf1, len, (len == size));
-
-        buf1 += len;
-        size -= len;
-    }
-}
-
-/* NOTE: size is assumed to be an integer multiple of TS_PACKET_SIZE */
-static void rtp_send_mpegts_raw(AVFormatContext *s1,
-                                const uint8_t *buf1, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int len, out_len;
-
-    while (size >= TS_PACKET_SIZE) {
-        len = s->max_payload_size - (s->buf_ptr - s->buf);
-        if (len > size)
-            len = size;
-        memcpy(s->buf_ptr, buf1, len);
-        buf1 += len;
-        size -= len;
-        s->buf_ptr += len;
-
-        out_len = s->buf_ptr - s->buf;
-        if (out_len >= s->max_payload_size) {
-            ff_rtp_send_data(s1, s->buf, out_len, 0);
-            s->buf_ptr = s->buf;
-        }
-    }
-}
-
-static int rtp_send_ilbc(AVFormatContext *s1, const uint8_t *buf, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    AVStream *st = s1->streams[0];
-    int frame_duration = av_get_audio_frame_duration(st->codec, 0);
-    int frame_size = st->codec->block_align;
-    int frames = size / frame_size;
-
-    while (frames > 0) {
-        int n = FFMIN(s->max_frames_per_packet - s->num_frames, frames);
-
-        if (!s->num_frames) {
-            s->buf_ptr = s->buf;
-            s->timestamp = s->cur_timestamp;
-        }
-        memcpy(s->buf_ptr, buf, n * frame_size);
-        frames           -= n;
-        s->num_frames    += n;
-        s->buf_ptr       += n * frame_size;
-        buf              += n * frame_size;
-        s->cur_timestamp += n * frame_duration;
-
-        if (s->num_frames == s->max_frames_per_packet) {
-            ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 1);
-            s->num_frames = 0;
-        }
-    }
-    return 0;
-}
-
-static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
-{
-    RTPMuxContext *s = s1->priv_data;
-    AVStream *st = s1->streams[0];
-    int rtcp_bytes;
-    int size= pkt->size;
-
-    av_dlog(s1, "%d: write len=%d\n", pkt->stream_index, size);
-
-    rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) /
-        RTCP_TX_RATIO_DEN;
-    if ((s->first_packet || ((rtcp_bytes >= RTCP_SR_SIZE) &&
-                            (ff_ntp_time() - s->last_rtcp_ntp_time > 5000000))) &&
-        !(s->flags & FF_RTP_FLAG_SKIP_RTCP)) {
-        rtcp_send_sr(s1, ff_ntp_time(), 0);
-        s->last_octet_count = s->octet_count;
-        s->first_packet = 0;
-    }
-    s->cur_timestamp = s->base_timestamp + pkt->pts;
-
-    switch(st->codec->codec_id) {
-    case AV_CODEC_ID_PCM_MULAW:
-    case AV_CODEC_ID_PCM_ALAW:
-    case AV_CODEC_ID_PCM_U8:
-    case AV_CODEC_ID_PCM_S8:
-        return rtp_send_samples(s1, pkt->data, size, 8 * st->codec->channels);
-    case AV_CODEC_ID_PCM_U16BE:
-    case AV_CODEC_ID_PCM_U16LE:
-    case AV_CODEC_ID_PCM_S16BE:
-    case AV_CODEC_ID_PCM_S16LE:
-        return rtp_send_samples(s1, pkt->data, size, 16 * st->codec->channels);
-    case AV_CODEC_ID_ADPCM_G722:
-        /* The actual sample size is half a byte per sample, but since the
-         * stream clock rate is 8000 Hz while the sample rate is 16000 Hz,
-         * the correct parameter for send_samples_bits is 8 bits per stream
-         * clock. */
-        return rtp_send_samples(s1, pkt->data, size, 8 * st->codec->channels);
-    case AV_CODEC_ID_ADPCM_G726:
-        return rtp_send_samples(s1, pkt->data, size,
-                                st->codec->bits_per_coded_sample * st->codec->channels);
-    case AV_CODEC_ID_MP2:
-    case AV_CODEC_ID_MP3:
-        rtp_send_mpegaudio(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_MPEG1VIDEO:
-    case AV_CODEC_ID_MPEG2VIDEO:
-        ff_rtp_send_mpegvideo(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_AAC:
-        if (s->flags & FF_RTP_FLAG_MP4A_LATM)
-            ff_rtp_send_latm(s1, pkt->data, size);
-        else
-            ff_rtp_send_aac(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_AMR_NB:
-    case AV_CODEC_ID_AMR_WB:
-        ff_rtp_send_amr(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_MPEG2TS:
-        rtp_send_mpegts_raw(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_H264:
-        ff_rtp_send_h264(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_H263:
-        if (s->flags & FF_RTP_FLAG_RFC2190) {
-            int mb_info_size = 0;
-            const uint8_t *mb_info =
-                av_packet_get_side_data(pkt, AV_PKT_DATA_H263_MB_INFO,
-                                        &mb_info_size);
-            ff_rtp_send_h263_rfc2190(s1, pkt->data, size, mb_info, mb_info_size);
-            break;
-        }
-        /* Fallthrough */
-    case AV_CODEC_ID_H263P:
-        ff_rtp_send_h263(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_VORBIS:
-    case AV_CODEC_ID_THEORA:
-        ff_rtp_send_xiph(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_VP8:
-        ff_rtp_send_vp8(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_ILBC:
-        rtp_send_ilbc(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_MJPEG:
-        ff_rtp_send_jpeg(s1, pkt->data, size);
-        break;
-    case AV_CODEC_ID_OPUS:
-        if (size > s->max_payload_size) {
-            av_log(s1, AV_LOG_ERROR,
-                   "Packet size %d too large for max RTP payload size %d\n",
-                   size, s->max_payload_size);
-            return AVERROR(EINVAL);
-        }
-        /* Intentional fallthrough */
-    default:
-        /* better than nothing : send the codec raw data */
-        rtp_send_raw(s1, pkt->data, size);
-        break;
-    }
-    return 0;
-}
-
-static int rtp_write_trailer(AVFormatContext *s1)
-{
-    RTPMuxContext *s = s1->priv_data;
-
-    /* If the caller closes and recreates ->pb, this might actually
-     * be NULL here even if it was successfully allocated at the start. */
-    if (s1->pb && (s->flags & FF_RTP_FLAG_SEND_BYE))
-        rtcp_send_sr(s1, ff_ntp_time(), 1);
-    av_freep(&s->buf);
-
-    return 0;
-}
-
-AVOutputFormat ff_rtp_muxer = {
-    .name              = "rtp",
-    .long_name         = NULL_IF_CONFIG_SMALL("RTP output"),
-    .priv_data_size    = sizeof(RTPMuxContext),
-    .audio_codec       = AV_CODEC_ID_PCM_MULAW,
-    .video_codec       = AV_CODEC_ID_MPEG4,
-    .write_header      = rtp_write_header,
-    .write_packet      = rtp_write_packet,
-    .write_trailer     = rtp_write_trailer,
-    .priv_class        = &rtp_muxer_class,
-};
diff --git a/deps/libav/libavformat/rtpenc.h b/deps/libav/libavformat/rtpenc.h
deleted file mode 100644
index 35ee151..0000000
--- a/deps/libav/libavformat/rtpenc.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * RTP muxer definitions
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVFORMAT_RTPENC_H
-#define AVFORMAT_RTPENC_H
-
-#include "avformat.h"
-#include "rtp.h"
-
-struct RTPMuxContext {
-    const AVClass *av_class;
-    AVFormatContext *ic;
-    AVStream *st;
-    int payload_type;
-    uint32_t ssrc;
-    const char *cname;
-    int seq;
-    uint32_t timestamp;
-    uint32_t base_timestamp;
-    uint32_t cur_timestamp;
-    int max_payload_size;
-    int num_frames;
-
-    /* rtcp sender statistics */
-    int64_t last_rtcp_ntp_time;
-    int64_t first_rtcp_ntp_time;
-    unsigned int packet_count;
-    unsigned int octet_count;
-    unsigned int last_octet_count;
-    int first_packet;
-    /* buffer for output */
-    uint8_t *buf;
-    uint8_t *buf_ptr;
-
-    int max_frames_per_packet;
-
-    /**
-     * Number of bytes used for H.264 NAL length, if the MP4 syntax is used
-     * (1, 2 or 4)
-     */
-    int nal_length_size;
-
-    int flags;
-
-    unsigned int frame_count;
-};
-
-typedef struct RTPMuxContext RTPMuxContext;
-
-#define FF_RTP_FLAG_MP4A_LATM 1
-#define FF_RTP_FLAG_RFC2190   2
-#define FF_RTP_FLAG_SKIP_RTCP 4
-#define FF_RTP_FLAG_H264_MODE0 8
-#define FF_RTP_FLAG_SEND_BYE  16
-
-#define FF_RTP_FLAG_OPTS(ctx, fieldname) \
-    { "rtpflags", "RTP muxer flags", offsetof(ctx, fieldname), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \
-    { "latm", "Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_MP4A_LATM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \
-    { "rfc2190", "Use RFC 2190 packetization instead of RFC 4629 for H.263", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_RFC2190}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \
-    { "skip_rtcp", "Don't send RTCP sender reports", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_SKIP_RTCP}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \
-    { "h264_mode0", "Use mode 0 for H264 in RTP", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_H264_MODE0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \
-    { "send_bye", "Send RTCP BYE packets when finishing", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_SEND_BYE}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" } \
-
-void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);
-
-void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size);
-void ff_rtp_send_h263(AVFormatContext *s1, const uint8_t *buf1, int size);
-void ff_rtp_send_h263_rfc2190(AVFormatContext *s1, const uint8_t *buf1, int size,
-                              const uint8_t *mb_info, int mb_info_size);
-void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size);
-void ff_rtp_send_latm(AVFormatContext *s1, const uint8_t *buff, int size);
-void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size);
-void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size);
-void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size);
-void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buff, int size);
-void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buff, int size);
-
-const uint8_t *ff_h263_find_resync_marker_reverse(const uint8_t *restrict start,
-                                                  const uint8_t *restrict end);
-
-#endif /* AVFORMAT_RTPENC_H */
diff --git a/deps/libav/libavformat/rtpenc_aac.c b/deps/libav/libavformat/rtpenc_aac.c
deleted file mode 100644
index 1b2fa0a..0000000
--- a/deps/libav/libavformat/rtpenc_aac.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * copyright (c) 2007 Luca Abeni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpenc.h"
-
-
-void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int len, max_packet_size;
-    uint8_t *p;
-    const int max_frames_per_packet = s->max_frames_per_packet ? s->max_frames_per_packet : 5;
-    const int max_au_headers_size = 2 + 2 * max_frames_per_packet;
-
-    /* skip ADTS header, if present */
-    if ((s1->streams[0]->codec->extradata_size) == 0) {
-        size -= 7;
-        buff += 7;
-    }
-    max_packet_size = s->max_payload_size - max_au_headers_size;
-
-    /* test if the packet must be sent */
-    len = (s->buf_ptr - s->buf);
-    if ((s->num_frames == max_frames_per_packet) || (len && (len + size) > s->max_payload_size)) {
-        int au_size = s->num_frames * 2;
-
-        p = s->buf + max_au_headers_size - au_size - 2;
-        if (p != s->buf) {
-            memmove(p + 2, s->buf + 2, au_size);
-        }
-        /* Write the AU header size */
-        p[0] =  au_size >> 5;
-        p[1] = (au_size & 0x1F) << 3;
-
-        ff_rtp_send_data(s1, p, s->buf_ptr - p, 1);
-
-        s->num_frames = 0;
-    }
-    if (s->num_frames == 0) {
-        s->buf_ptr = s->buf + max_au_headers_size;
-        s->timestamp = s->cur_timestamp;
-    }
-
-    if (size <= max_packet_size) {
-        p = s->buf + s->num_frames++ * 2 + 2;
-        *p++ = size >> 5;
-        *p = (size & 0x1F) << 3;
-        memcpy(s->buf_ptr, buff, size);
-        s->buf_ptr += size;
-    } else {
-        int au_size = size;
-
-        max_packet_size = s->max_payload_size - 4;
-        p = s->buf;
-        p[0] = 0;
-        p[1] = 16;
-        while (size > 0) {
-            len = FFMIN(size, max_packet_size);
-            p[2] = au_size >> 5;
-            p[3] = (au_size & 0x1F) << 3;
-            memcpy(p + 4, buff, len);
-            ff_rtp_send_data(s1, p, len + 4, len == size);
-            size -= len;
-            buff += len;
-        }
-    }
-}
diff --git a/deps/libav/libavformat/rtpenc_amr.c b/deps/libav/libavformat/rtpenc_amr.c
deleted file mode 100644
index 73da8c8..0000000
--- a/deps/libav/libavformat/rtpenc_amr.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * RTP packetization for AMR audio
- * Copyright (c) 2007 Luca Abeni
- * Copyright (c) 2009 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpenc.h"
-
-/**
- * Packetize AMR frames into RTP packets according to RFC 3267,
- * in octet-aligned mode.
- */
-void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size)
-{
-    RTPMuxContext *s          = s1->priv_data;
-    int max_header_toc_size   = 1 + s->max_frames_per_packet;
-    uint8_t *p;
-    int len;
-
-    /* Test if the packet must be sent. */
-    len = s->buf_ptr - s->buf;
-    if (s->num_frames == s->max_frames_per_packet || (len && len + size - 1 > s->max_payload_size)) {
-        int header_size = s->num_frames + 1;
-        p = s->buf + max_header_toc_size - header_size;
-        if (p != s->buf)
-            memmove(p, s->buf, header_size);
-
-        ff_rtp_send_data(s1, p, s->buf_ptr - p, 1);
-
-        s->num_frames = 0;
-    }
-
-    if (!s->num_frames) {
-        s->buf[0]    = 0xf0;
-        s->buf_ptr   = s->buf + max_header_toc_size;
-        s->timestamp = s->cur_timestamp;
-    } else {
-        /* Mark the previous TOC entry as having more entries following. */
-        s->buf[1 + s->num_frames - 1] |= 0x80;
-    }
-
-    /* Copy the frame type and quality bits. */
-    s->buf[1 + s->num_frames++] = buff[0] & 0x7C;
-    buff++;
-    size--;
-    memcpy(s->buf_ptr, buff, size);
-    s->buf_ptr += size;
-}
diff --git a/deps/libav/libavformat/rtpenc_chain.c b/deps/libav/libavformat/rtpenc_chain.c
deleted file mode 100644
index 10c4020..0000000
--- a/deps/libav/libavformat/rtpenc_chain.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * RTP muxer chaining code
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "avio_internal.h"
-#include "rtpenc_chain.h"
-#include "avio_internal.h"
-#include "rtp.h"
-#include "libavutil/opt.h"
-
-int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
-                          AVStream *st, URLContext *handle, int packet_size,
-                          int idx)
-{
-    AVFormatContext *rtpctx = NULL;
-    int ret;
-    AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
-    uint8_t *rtpflags;
-    AVDictionary *opts = NULL;
-
-    if (!rtp_format) {
-        ret = AVERROR(ENOSYS);
-        goto fail;
-    }
-
-    /* Allocate an AVFormatContext for each output stream */
-    rtpctx = avformat_alloc_context();
-    if (!rtpctx) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    rtpctx->oformat = rtp_format;
-    if (!avformat_new_stream(rtpctx, NULL)) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-    /* Pass the interrupt callback on */
-    rtpctx->interrupt_callback = s->interrupt_callback;
-    /* Copy the max delay setting; the rtp muxer reads this. */
-    rtpctx->max_delay = s->max_delay;
-    /* Copy other stream parameters. */
-    rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio;
-    /* Get the payload type from the codec */
-    if (st->id < RTP_PT_PRIVATE)
-        rtpctx->streams[0]->id =
-            ff_rtp_get_payload_type(s, st->codec, idx);
-    else
-        rtpctx->streams[0]->id = st->id;
-
-    if (av_opt_get(s, "rtpflags", AV_OPT_SEARCH_CHILDREN, &rtpflags) >= 0)
-        av_dict_set(&opts, "rtpflags", rtpflags, AV_DICT_DONT_STRDUP_VAL);
-
-    /* Set the synchronized start time. */
-    rtpctx->start_time_realtime = s->start_time_realtime;
-
-    avcodec_copy_context(rtpctx->streams[0]->codec, st->codec);
-
-    if (handle) {
-        ret = ffio_fdopen(&rtpctx->pb, handle);
-        if (ret < 0)
-            ffurl_close(handle);
-    } else
-        ret = ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size);
-    if (!ret)
-        ret = avformat_write_header(rtpctx, &opts);
-    av_dict_free(&opts);
-
-    if (ret) {
-        if (handle && rtpctx->pb) {
-            avio_close(rtpctx->pb);
-        } else if (rtpctx->pb) {
-            uint8_t *ptr;
-            avio_close_dyn_buf(rtpctx->pb, &ptr);
-            av_free(ptr);
-        }
-        avformat_free_context(rtpctx);
-        return ret;
-    }
-
-    *out = rtpctx;
-    return 0;
-
-fail:
-    av_free(rtpctx);
-    if (handle)
-        ffurl_close(handle);
-    return ret;
-}
diff --git a/deps/libav/libavformat/rtpenc_chain.h b/deps/libav/libavformat/rtpenc_chain.h
deleted file mode 100644
index 4117239..0000000
--- a/deps/libav/libavformat/rtpenc_chain.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * RTP muxer chaining code
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTPENC_CHAIN_H
-#define AVFORMAT_RTPENC_CHAIN_H
-
-#include "avformat.h"
-#include "url.h"
-
-int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
-                          AVStream *st, URLContext *handle, int packet_size,
-                          int id);
-
-#endif /* AVFORMAT_RTPENC_CHAIN_H */
diff --git a/deps/libav/libavformat/rtpenc_h263.c b/deps/libav/libavformat/rtpenc_h263.c
deleted file mode 100644
index 87f0bd7..0000000
--- a/deps/libav/libavformat/rtpenc_h263.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * RTP packetization for H.263 video
- * Copyright (c) 2009 Luca Abeni
- * Copyright (c) 2009 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpenc.h"
-
-const uint8_t *ff_h263_find_resync_marker_reverse(const uint8_t *restrict start,
-                                                  const uint8_t *restrict end)
-{
-    const uint8_t *p = end - 1;
-    start += 1; /* Make sure we never return the original start. */
-    for (; p > start; p -= 2) {
-        if (!*p) {
-            if      (!p[ 1] && p[2]) return p;
-            else if (!p[-1] && p[1]) return p - 1;
-        }
-    }
-    return end;
-}
-
-/**
- * Packetize H.263 frames into RTP packets according to RFC 4629
- */
-void ff_rtp_send_h263(AVFormatContext *s1, const uint8_t *buf1, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int len, max_packet_size;
-    uint8_t *q;
-
-    max_packet_size = s->max_payload_size;
-
-    while (size > 0) {
-        q = s->buf;
-        if (size >= 2 && (buf1[0] == 0) && (buf1[1] == 0)) {
-            *q++ = 0x04;
-            buf1 += 2;
-            size -= 2;
-        } else {
-            *q++ = 0;
-        }
-        *q++ = 0;
-
-        len = FFMIN(max_packet_size - 2, size);
-
-        /* Look for a better place to split the frame into packets. */
-        if (len < size) {
-            const uint8_t *end = ff_h263_find_resync_marker_reverse(buf1,
-                                                                    buf1 + len);
-            len = end - buf1;
-        }
-
-        memcpy(q, buf1, len);
-        q += len;
-
-        /* 90 KHz time stamp */
-        s->timestamp = s->cur_timestamp;
-        ff_rtp_send_data(s1, s->buf, q - s->buf, (len == size));
-
-        buf1 += len;
-        size -= len;
-    }
-}
diff --git a/deps/libav/libavformat/rtpenc_h263_rfc2190.c b/deps/libav/libavformat/rtpenc_h263_rfc2190.c
deleted file mode 100644
index f714d01..0000000
--- a/deps/libav/libavformat/rtpenc_h263_rfc2190.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * RTP packetization for H.263 video
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpenc.h"
-#include "libavcodec/put_bits.h"
-#include "libavcodec/get_bits.h"
-
-struct H263Info {
-    int src;
-    int i;
-    int u;
-    int s;
-    int a;
-    int pb;
-    int tr;
-};
-
-struct H263State {
-    int gobn;
-    int mba;
-    int hmv1, vmv1, hmv2, vmv2;
-    int quant;
-};
-
-static void send_mode_a(AVFormatContext *s1, const struct H263Info *info,
-                        const uint8_t *buf, int len, int ebits, int m)
-{
-    RTPMuxContext *s = s1->priv_data;
-    PutBitContext pb;
-
-    init_put_bits(&pb, s->buf, 32);
-    put_bits(&pb, 1, 0); /* F - 0, mode A */
-    put_bits(&pb, 1, 0); /* P - 0, normal I/P */
-    put_bits(&pb, 3, 0); /* SBIT - 0 bits */
-    put_bits(&pb, 3, ebits); /* EBIT */
-    put_bits(&pb, 3, info->src); /* SRC - source format */
-    put_bits(&pb, 1, info->i); /* I - inter/intra */
-    put_bits(&pb, 1, info->u); /* U - unrestricted motion vector */
-    put_bits(&pb, 1, info->s); /* S - syntax-baesd arithmetic coding */
-    put_bits(&pb, 1, info->a); /* A - advanced prediction */
-    put_bits(&pb, 4, 0); /* R - reserved */
-    put_bits(&pb, 2, 0); /* DBQ - 0 */
-    put_bits(&pb, 3, 0); /* TRB - 0 */
-    put_bits(&pb, 8, info->tr); /* TR */
-    flush_put_bits(&pb);
-    memcpy(s->buf + 4, buf, len);
-
-    ff_rtp_send_data(s1, s->buf, len + 4, m);
-}
-
-static void send_mode_b(AVFormatContext *s1, const struct H263Info *info,
-                        const struct H263State *state, const uint8_t *buf,
-                        int len, int sbits, int ebits, int m)
-{
-    RTPMuxContext *s = s1->priv_data;
-    PutBitContext pb;
-
-    init_put_bits(&pb, s->buf, 64);
-    put_bits(&pb, 1, 1); /* F - 1, mode B */
-    put_bits(&pb, 1, 0); /* P - 0, mode B */
-    put_bits(&pb, 3, sbits); /* SBIT - 0 bits */
-    put_bits(&pb, 3, ebits); /* EBIT - 0 bits */
-    put_bits(&pb, 3, info->src); /* SRC - source format */
-    put_bits(&pb, 5, state->quant); /* QUANT - quantizer for the first MB */
-    put_bits(&pb, 5, state->gobn); /* GOBN - GOB number */
-    put_bits(&pb, 9, state->mba); /* MBA - MB address */
-    put_bits(&pb, 2, 0); /* R - reserved */
-    put_bits(&pb, 1, info->i); /* I - inter/intra */
-    put_bits(&pb, 1, info->u); /* U - unrestricted motion vector */
-    put_bits(&pb, 1, info->s); /* S - syntax-baesd arithmetic coding */
-    put_bits(&pb, 1, info->a); /* A - advanced prediction */
-    put_bits(&pb, 7, state->hmv1); /* HVM1 - horizontal motion vector 1 */
-    put_bits(&pb, 7, state->vmv1); /* VMV1 - vertical motion vector 1 */
-    put_bits(&pb, 7, state->hmv2); /* HVM2 - horizontal motion vector 2 */
-    put_bits(&pb, 7, state->vmv2); /* VMV2 - vertical motion vector 2 */
-    flush_put_bits(&pb);
-    memcpy(s->buf + 8, buf, len);
-
-    ff_rtp_send_data(s1, s->buf, len + 8, m);
-}
-
-void ff_rtp_send_h263_rfc2190(AVFormatContext *s1, const uint8_t *buf, int size,
-                              const uint8_t *mb_info, int mb_info_size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int len, sbits = 0, ebits = 0;
-    GetBitContext gb;
-    struct H263Info info = { 0 };
-    struct H263State state = { 0 };
-    int mb_info_pos = 0, mb_info_count = mb_info_size / 12;
-    const uint8_t *buf_base = buf;
-
-    s->timestamp = s->cur_timestamp;
-
-    init_get_bits(&gb, buf, size*8);
-    if (get_bits(&gb, 22) == 0x20) { /* Picture Start Code */
-        info.tr  = get_bits(&gb, 8);
-        skip_bits(&gb, 2); /* PTYPE start, H261 disambiguation */
-        skip_bits(&gb, 3); /* Split screen, document camera, freeze picture release */
-        info.src = get_bits(&gb, 3);
-        info.i   = get_bits(&gb, 1);
-        info.u   = get_bits(&gb, 1);
-        info.s   = get_bits(&gb, 1);
-        info.a   = get_bits(&gb, 1);
-        info.pb  = get_bits(&gb, 1);
-    }
-
-    while (size > 0) {
-        struct H263State packet_start_state = state;
-        len = FFMIN(s->max_payload_size - 8, size);
-
-        /* Look for a better place to split the frame into packets. */
-        if (len < size) {
-            const uint8_t *end = ff_h263_find_resync_marker_reverse(buf,
-                                                                    buf + len);
-            len = end - buf;
-            if (len == s->max_payload_size - 8) {
-                /* Skip mb info prior to the start of the current ptr */
-                while (mb_info_pos < mb_info_count) {
-                    uint32_t pos = AV_RL32(&mb_info[12*mb_info_pos])/8;
-                    if (pos >= buf - buf_base)
-                        break;
-                    mb_info_pos++;
-                }
-                /* Find the first mb info past the end pointer */
-                while (mb_info_pos + 1 < mb_info_count) {
-                    uint32_t pos = AV_RL32(&mb_info[12*(mb_info_pos + 1)])/8;
-                    if (pos >= end - buf_base)
-                        break;
-                    mb_info_pos++;
-                }
-                if (mb_info_pos < mb_info_count) {
-                    const uint8_t *ptr = &mb_info[12*mb_info_pos];
-                    uint32_t bit_pos = AV_RL32(ptr);
-                    uint32_t pos = (bit_pos + 7)/8;
-                    if (pos <= end - buf_base) {
-                        state.quant = ptr[4];
-                        state.gobn  = ptr[5];
-                        state.mba   = AV_RL16(&ptr[6]);
-                        state.hmv1  = (int8_t) ptr[8];
-                        state.vmv1  = (int8_t) ptr[9];
-                        state.hmv2  = (int8_t) ptr[10];
-                        state.vmv2  = (int8_t) ptr[11];
-                        ebits = 8 * pos - bit_pos;
-                        len   = pos - (buf - buf_base);
-                        mb_info_pos++;
-                    } else {
-                        av_log(s1, AV_LOG_ERROR,
-                               "Unable to split H263 packet, use -mb_info %d "
-                               "or lower.\n", s->max_payload_size - 8);
-                    }
-                } else {
-                    av_log(s1, AV_LOG_ERROR, "Unable to split H263 packet, "
-                           "use -mb_info %d or -ps 1.\n",
-                           s->max_payload_size - 8);
-                }
-            }
-        }
-
-        if (size > 2 && !buf[0] && !buf[1])
-            send_mode_a(s1, &info, buf, len, ebits, len == size);
-        else
-            send_mode_b(s1, &info, &packet_start_state, buf, len, sbits,
-                        ebits, len == size);
-
-        if (ebits) {
-            sbits = 8 - ebits;
-            len--;
-        } else {
-            sbits = 0;
-        }
-        buf  += len;
-        size -= len;
-        ebits = 0;
-    }
-}
diff --git a/deps/libav/libavformat/rtpenc_h264.c b/deps/libav/libavformat/rtpenc_h264.c
deleted file mode 100644
index 206d9ba..0000000
--- a/deps/libav/libavformat/rtpenc_h264.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * RTP packetization for H.264 (RFC3984)
- * Copyright (c) 2008 Luca Abeni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief H.264 packetization
- * @author Luca Abeni <lucabe72 at email.it>
- */
-
-#include "avformat.h"
-#include "avc.h"
-#include "rtpenc.h"
-
-static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t *end, int nal_length_size)
-{
-    unsigned int res = 0;
-
-    if (end - start < nal_length_size)
-        return NULL;
-    while (nal_length_size--)
-        res = (res << 8) | *start++;
-
-    if (res > end - start)
-        return NULL;
-
-    return start + res;
-}
-
-static void nal_send(AVFormatContext *s1, const uint8_t *buf, int size, int last)
-{
-    RTPMuxContext *s = s1->priv_data;
-
-    av_log(s1, AV_LOG_DEBUG, "Sending NAL %x of len %d M=%d\n", buf[0] & 0x1F, size, last);
-    if (size <= s->max_payload_size) {
-        ff_rtp_send_data(s1, buf, size, last);
-    } else {
-        uint8_t type = buf[0] & 0x1F;
-        uint8_t nri = buf[0] & 0x60;
-
-        if (s->flags & FF_RTP_FLAG_H264_MODE0) {
-            av_log(s1, AV_LOG_ERROR,
-                   "NAL size %d > %d, try -slice-max-size %d\n", size,
-                   s->max_payload_size, s->max_payload_size);
-            return;
-        }
-        av_log(s1, AV_LOG_DEBUG, "NAL size %d > %d\n", size, s->max_payload_size);
-        s->buf[0] = 28;        /* FU Indicator; Type = 28 ---> FU-A */
-        s->buf[0] |= nri;
-        s->buf[1] = type;
-        s->buf[1] |= 1 << 7;
-        buf += 1;
-        size -= 1;
-        while (size + 2 > s->max_payload_size) {
-            memcpy(&s->buf[2], buf, s->max_payload_size - 2);
-            ff_rtp_send_data(s1, s->buf, s->max_payload_size, 0);
-            buf += s->max_payload_size - 2;
-            size -= s->max_payload_size - 2;
-            s->buf[1] &= ~(1 << 7);
-        }
-        s->buf[1] |= 1 << 6;
-        memcpy(&s->buf[2], buf, size);
-        ff_rtp_send_data(s1, s->buf, size + 2, last);
-    }
-}
-
-void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size)
-{
-    const uint8_t *r, *end = buf1 + size;
-    RTPMuxContext *s = s1->priv_data;
-
-    s->timestamp = s->cur_timestamp;
-    if (s->nal_length_size)
-        r = avc_mp4_find_startcode(buf1, end, s->nal_length_size) ? buf1 : end;
-    else
-        r = ff_avc_find_startcode(buf1, end);
-    while (r < end) {
-        const uint8_t *r1;
-
-        if (s->nal_length_size) {
-            r1 = avc_mp4_find_startcode(r, end, s->nal_length_size);
-            if (!r1)
-                r1 = end;
-            r += s->nal_length_size;
-        } else {
-            while (!*(r++));
-            r1 = ff_avc_find_startcode(r, end);
-        }
-        nal_send(s1, r, r1 - r, r1 == end);
-        r = r1;
-    }
-}
diff --git a/deps/libav/libavformat/rtpenc_jpeg.c b/deps/libav/libavformat/rtpenc_jpeg.c
deleted file mode 100644
index 04df658..0000000
--- a/deps/libav/libavformat/rtpenc_jpeg.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * RTP JPEG-compressed video Packetizer, RFC 2435
- * Copyright (c) 2012 Samuel Pitoiset
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/bytestream.h"
-#include "libavcodec/mjpeg.h"
-#include "libavutil/intreadwrite.h"
-#include "rtpenc.h"
-
-void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    const uint8_t *qtables = NULL;
-    int nb_qtables = 0;
-    uint8_t type = 1; /* default pixel format is AV_PIX_FMT_YUVJ420P */
-    uint8_t w, h;
-    uint8_t *p;
-    int off = 0; /* fragment offset of the current JPEG frame */
-    int len;
-    int i;
-
-    s->buf_ptr   = s->buf;
-    s->timestamp = s->cur_timestamp;
-
-    /* convert video pixel dimensions from pixels to blocks */
-    w = s1->streams[0]->codec->width  >> 3;
-    h = s1->streams[0]->codec->height >> 3;
-
-    /* check if pixel format is not the normal 420 case */
-    if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ422P) {
-        type = 0;
-    } else if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ420P) {
-        type = 1;
-    } else {
-        av_log(s1, AV_LOG_ERROR, "Unsupported pixel format\n");
-        return;
-    }
-
-    /* preparse the header for getting some infos */
-    for (i = 0; i < size; i++) {
-        if (buf[i] != 0xff)
-            continue;
-
-        if (buf[i + 1] == DQT) {
-            if (buf[i + 4])
-                av_log(s1, AV_LOG_WARNING,
-                       "Only 8-bit precision is supported.\n");
-
-            /* a quantization table is 64 bytes long */
-            nb_qtables = AV_RB16(&buf[i + 2]) / 65;
-            if (i + 4 + nb_qtables * 65 > size) {
-                av_log(s1, AV_LOG_ERROR, "Too short JPEG header. Aborted!\n");
-                return;
-            }
-
-            qtables = &buf[i + 4];
-        } else if (buf[i + 1] == SOF0) {
-            if (buf[i + 14] != 17 || buf[i + 17] != 17) {
-                av_log(s1, AV_LOG_ERROR,
-                       "Only 1x1 chroma blocks are supported. Aborted!\n");
-                return;
-            }
-        } else if (buf[i + 1] == SOS) {
-            /* SOS is last marker in the header */
-            i += AV_RB16(&buf[i + 2]) + 2;
-            break;
-        }
-    }
-
-    /* skip JPEG header */
-    buf  += i;
-    size -= i;
-
-    for (i = size - 2; i >= 0; i--) {
-        if (buf[i] == 0xff && buf[i + 1] == EOI) {
-            /* Remove the EOI marker */
-            size = i;
-            break;
-        }
-    }
-
-    p = s->buf_ptr;
-    while (size > 0) {
-        int hdr_size = 8;
-
-        if (off == 0 && nb_qtables)
-            hdr_size += 4 + 64 * nb_qtables;
-
-        /* payload max in one packet */
-        len = FFMIN(size, s->max_payload_size - hdr_size);
-
-        /* set main header */
-        bytestream_put_byte(&p, 0);
-        bytestream_put_be24(&p, off);
-        bytestream_put_byte(&p, type);
-        bytestream_put_byte(&p, 255);
-        bytestream_put_byte(&p, w);
-        bytestream_put_byte(&p, h);
-
-        if (off == 0 && nb_qtables) {
-            /* set quantization tables header */
-            bytestream_put_byte(&p, 0);
-            bytestream_put_byte(&p, 0);
-            bytestream_put_be16(&p, 64 * nb_qtables);
-
-            for (i = 0; i < nb_qtables; i++)
-                bytestream_put_buffer(&p, &qtables[65 * i + 1], 64);
-        }
-
-        /* copy payload data */
-        memcpy(p, buf, len);
-
-        /* marker bit is last packet in frame */
-        ff_rtp_send_data(s1, s->buf, len + hdr_size, size == len);
-
-        buf  += len;
-        size -= len;
-        off  += len;
-        p     = s->buf;
-    }
-}
diff --git a/deps/libav/libavformat/rtpenc_latm.c b/deps/libav/libavformat/rtpenc_latm.c
deleted file mode 100644
index 6467677..0000000
--- a/deps/libav/libavformat/rtpenc_latm.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * RTP Packetization of MPEG-4 Audio (RFC 3016)
- * Copyright (c) 2011 Juan Carlos Rodriguez <ing.juancarlosrodriguez at hotmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpenc.h"
-
-void ff_rtp_send_latm(AVFormatContext *s1, const uint8_t *buff, int size)
-{
-    /* MP4A-LATM
-     * The RTP payload format specification is described in RFC 3016
-     * The encoding specifications are provided in ISO/IEC 14496-3 */
-
-    RTPMuxContext *s = s1->priv_data;
-    int header_size;
-    int offset = 0;
-    int len    = 0;
-
-    /* skip ADTS header, if present */
-    if ((s1->streams[0]->codec->extradata_size) == 0) {
-        size -= 7;
-        buff += 7;
-    }
-
-    /* PayloadLengthInfo() */
-    header_size = size/0xFF + 1;
-    memset(s->buf, 0xFF, header_size - 1);
-    s->buf[header_size - 1] = size % 0xFF;
-
-    s->timestamp = s->cur_timestamp;
-
-    /* PayloadMux() */
-    while (size > 0) {
-        len   = FFMIN(size, s->max_payload_size - (!offset ? header_size : 0));
-        size -= len;
-        if (!offset) {
-            memcpy(s->buf + header_size, buff, len);
-            ff_rtp_send_data(s1, s->buf, header_size + len, !size);
-        } else {
-            ff_rtp_send_data(s1, buff + offset, len, !size);
-        }
-        offset += len;
-    }
-}
diff --git a/deps/libav/libavformat/rtpenc_mpv.c b/deps/libav/libavformat/rtpenc_mpv.c
deleted file mode 100644
index 70248c4..0000000
--- a/deps/libav/libavformat/rtpenc_mpv.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * RTP packetization for MPEG video
- * Copyright (c) 2002 Fabrice Bellard
- * Copyright (c) 2007 Luca Abeni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/internal.h"
-#include "avformat.h"
-#include "rtpenc.h"
-
-/* NOTE: a single frame must be passed with sequence header if
-   needed. XXX: use slices. */
-void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int len, h, max_packet_size;
-    uint8_t *q;
-    const uint8_t *end = buf1 + size;
-    int begin_of_slice, end_of_slice, frame_type, temporal_reference;
-
-    max_packet_size = s->max_payload_size;
-    begin_of_slice = 1;
-    end_of_slice = 0;
-    frame_type = 0;
-    temporal_reference = 0;
-
-    while (size > 0) {
-        int begin_of_sequence;
-
-        begin_of_sequence = 0;
-        len = max_packet_size - 4;
-
-        if (len >= size) {
-            len = size;
-            end_of_slice = 1;
-        } else {
-            const uint8_t *r, *r1;
-            int start_code;
-
-            r1 = buf1;
-            while (1) {
-                start_code = -1;
-                r = avpriv_find_start_code(r1, end, &start_code);
-                if((start_code & 0xFFFFFF00) == 0x100) {
-                    /* New start code found */
-                    if (start_code == 0x100) {
-                        frame_type = (r[1] & 0x38) >> 3;
-                        temporal_reference = (int)r[0] << 2 | r[1] >> 6;
-                    }
-                    if (start_code == 0x1B8) {
-                        begin_of_sequence = 1;
-                    }
-
-                    if (r - buf1 - 4 <= len) {
-                        /* The current slice fits in the packet */
-                        if (begin_of_slice == 0) {
-                            /* no slice at the beginning of the packet... */
-                            end_of_slice = 1;
-                            len = r - buf1 - 4;
-                            break;
-                        }
-                        r1 = r;
-                    } else {
-                        if ((r1 - buf1 > 4) && (r - r1 < max_packet_size)) {
-                            len = r1 - buf1 - 4;
-                            end_of_slice = 1;
-                        }
-                        break;
-                    }
-                } else {
-                    break;
-                }
-            }
-        }
-
-        h = 0;
-        h |= temporal_reference << 16;
-        h |= begin_of_sequence << 13;
-        h |= begin_of_slice << 12;
-        h |= end_of_slice << 11;
-        h |= frame_type << 8;
-
-        q = s->buf;
-        *q++ = h >> 24;
-        *q++ = h >> 16;
-        *q++ = h >> 8;
-        *q++ = h;
-
-        memcpy(q, buf1, len);
-        q += len;
-
-        /* 90kHz time stamp */
-        s->timestamp = s->cur_timestamp;
-        ff_rtp_send_data(s1, s->buf, q - s->buf, (len == size));
-
-        buf1 += len;
-        size -= len;
-        begin_of_slice = end_of_slice;
-        end_of_slice = 0;
-    }
-}
diff --git a/deps/libav/libavformat/rtpenc_vp8.c b/deps/libav/libavformat/rtpenc_vp8.c
deleted file mode 100644
index d24c8bc..0000000
--- a/deps/libav/libavformat/rtpenc_vp8.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * RTP VP8 Packetizer
- * Copyright (c) 2010 Josh Allmann
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "rtpenc.h"
-
-/* Based on a draft spec for VP8 RTP.
- * ( http://tools.ietf.org/html/draft-ietf-payload-vp8-05 ) */
-void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buf, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int len, max_packet_size, header_size;
-
-    s->buf_ptr      = s->buf;
-    s->timestamp    = s->cur_timestamp;
-
-    // extended control bit set, reference frame, start of partition,
-    // partition id 0
-    *s->buf_ptr++ = 0x90;
-    *s->buf_ptr++ = 0x80; // Picture id present
-    *s->buf_ptr++ = s->frame_count++ & 0x7f;
-    // Calculate the number of remaining bytes
-    header_size     = s->buf_ptr - s->buf;
-    max_packet_size = s->max_payload_size - header_size;
-
-    while (size > 0) {
-        len = FFMIN(size, max_packet_size);
-
-        memcpy(s->buf_ptr, buf, len);
-        // marker bit is last packet in frame
-        ff_rtp_send_data(s1, s->buf, len + header_size, size == len);
-
-        size         -= len;
-        buf          += len;
-        // Clear the partition start bit, keep the rest of the header untouched
-        s->buf[0]    &= ~0x10;
-    }
-}
diff --git a/deps/libav/libavformat/rtpenc_xiph.c b/deps/libav/libavformat/rtpenc_xiph.c
deleted file mode 100644
index 07086b1..0000000
--- a/deps/libav/libavformat/rtpenc_xiph.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * RTP packetization for Xiph audio and video
- * Copyright (c) 2010 Josh Allmann
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "rtpenc.h"
-
-/**
- * Packetize Xiph frames into RTP according to
- * RFC 5215 (Vorbis) and the Theora RFC draft.
- * (http://svn.xiph.org/trunk/theora/doc/draft-ietf-avt-rtp-theora-00.txt)
- */
-void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size)
-{
-    RTPMuxContext *s = s1->priv_data;
-    int max_pkt_size, xdt, frag;
-    uint8_t *q;
-
-    max_pkt_size = s->max_payload_size;
-
-    // set xiph data type
-    switch (*buff) {
-    case 0x01:   // vorbis id
-    case 0x05:   // vorbis setup
-    case 0x80:   // theora header
-    case 0x82:   // theora tables
-        xdt = 1; // packed config payload
-        break;
-    case 0x03:   // vorbis comments
-    case 0x81:   // theora comments
-        xdt = 2; // comment payload
-        break;
-    default:
-        xdt = 0; // raw data payload
-        break;
-    }
-
-    // Set ident.
-    // Probably need a non-fixed way of generating
-    // this, but it has to be done in SDP and passed in from there.
-    q = s->buf;
-    *q++ = (RTP_XIPH_IDENT >> 16) & 0xff;
-    *q++ = (RTP_XIPH_IDENT >>  8) & 0xff;
-    *q++ = (RTP_XIPH_IDENT      ) & 0xff;
-
-    // set fragment
-    // 0 - whole frame (possibly multiple frames)
-    // 1 - first fragment
-    // 2 - fragment continuation
-    // 3 - last fragmement
-    frag = size <= max_pkt_size ? 0 : 1;
-
-    if (!frag && !xdt) { // do we have a whole frame of raw data?
-        uint8_t *end_ptr = s->buf + 6 + max_pkt_size; // what we're allowed to write
-        uint8_t *ptr     = s->buf_ptr + 2 + size; // what we're going to write
-        int remaining    = end_ptr - ptr;
-
-        assert(s->num_frames <= s->max_frames_per_packet);
-        if ((s->num_frames > 0 && remaining < 0) ||
-            s->num_frames == s->max_frames_per_packet) {
-            // send previous packets now; no room for new data
-            ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0);
-            s->num_frames = 0;
-        }
-
-        // buffer current frame to send later
-        if (0 == s->num_frames) s->timestamp = s->cur_timestamp;
-        s->num_frames++;
-
-        // Set packet header. Normally, this is OR'd with frag and xdt,
-        // but those are zero, so omitted here
-        *q++ = s->num_frames;
-
-        if (s->num_frames > 1) q = s->buf_ptr; // jump ahead if needed
-        *q++ = (size >> 8) & 0xff;
-        *q++ = size & 0xff;
-        memcpy(q, buff, size);
-        q += size;
-        s->buf_ptr = q;
-
-        return;
-    } else if (s->num_frames) {
-        // immediately send buffered frames if buffer is not raw data,
-        // or if current frame is fragmented.
-        ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0);
-    }
-
-    s->timestamp = s->cur_timestamp;
-    s->num_frames = 0;
-    s->buf_ptr = q;
-    while (size > 0) {
-        int len = (!frag || frag == 3) ? size : max_pkt_size;
-        q = s->buf_ptr;
-
-        // set packet headers
-        *q++ = (frag << 6) | (xdt << 4); // num_frames = 0
-        *q++ = (len >> 8) & 0xff;
-        *q++ = len & 0xff;
-        // set packet body
-        memcpy(q, buff, len);
-        q += len;
-        buff += len;
-        size -= len;
-
-        ff_rtp_send_data(s1, s->buf, q - s->buf, 0);
-
-        frag = size <= max_pkt_size ? 3 : 2;
-    }
-}
diff --git a/deps/libav/libavformat/rtpproto.c b/deps/libav/libavformat/rtpproto.c
deleted file mode 100644
index 0f31539..0000000
--- a/deps/libav/libavformat/rtpproto.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
- * RTP network protocol
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * RTP protocol
- */
-
-#include "libavutil/parseutils.h"
-#include "libavutil/avstring.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "rtp.h"
-#include "rtpproto.h"
-#include "url.h"
-
-#include <stdarg.h>
-#include "internal.h"
-#include "network.h"
-#include "os_support.h"
-#include <fcntl.h>
-#if HAVE_POLL_H
-#include <sys/poll.h>
-#endif
-
-typedef struct RTPContext {
-    URLContext *rtp_hd, *rtcp_hd;
-    int rtp_fd, rtcp_fd, nb_ssm_include_addrs, nb_ssm_exclude_addrs;
-    struct sockaddr_storage **ssm_include_addrs, **ssm_exclude_addrs;
-    int write_to_source;
-    struct sockaddr_storage last_rtp_source, last_rtcp_source;
-    socklen_t last_rtp_source_len, last_rtcp_source_len;
-} RTPContext;
-
-/**
- * If no filename is given to av_open_input_file because you want to
- * get the local port first, then you must call this function to set
- * the remote server address.
- *
- * @param h media file context
- * @param uri of the remote server
- * @return zero if no error.
- */
-
-int ff_rtp_set_remote_url(URLContext *h, const char *uri)
-{
-    RTPContext *s = h->priv_data;
-    char hostname[256];
-    int port, rtcp_port;
-    const char *p;
-
-    char buf[1024];
-    char path[1024];
-
-    av_url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port,
-                 path, sizeof(path), uri);
-    rtcp_port = port + 1;
-
-    p = strchr(uri, '?');
-    if (p) {
-        if (av_find_info_tag(buf, sizeof(buf), "rtcpport", p)) {
-            rtcp_port = strtol(buf, NULL, 10);
-        }
-    }
-
-    ff_url_join(buf, sizeof(buf), "udp", NULL, hostname, port, "%s", path);
-    ff_udp_set_remote_url(s->rtp_hd, buf);
-
-    ff_url_join(buf, sizeof(buf), "udp", NULL, hostname, rtcp_port, "%s", path);
-    ff_udp_set_remote_url(s->rtcp_hd, buf);
-    return 0;
-}
-
-static struct addrinfo* rtp_resolve_host(const char *hostname, int port,
-                                         int type, int family, int flags)
-{
-    struct addrinfo hints = { 0 }, *res = 0;
-    int error;
-    char service[16];
-
-    snprintf(service, sizeof(service), "%d", port);
-    hints.ai_socktype = type;
-    hints.ai_family   = family;
-    hints.ai_flags    = flags;
-    if ((error = getaddrinfo(hostname, service, &hints, &res))) {
-        res = NULL;
-        av_log(NULL, AV_LOG_ERROR, "rtp_resolve_host: %s\n", gai_strerror(error));
-    }
-
-    return res;
-}
-
-static int compare_addr(const struct sockaddr_storage *a,
-                        const struct sockaddr_storage *b)
-{
-    if (a->ss_family != b->ss_family)
-        return 1;
-    if (a->ss_family == AF_INET) {
-        return (((const struct sockaddr_in *)a)->sin_addr.s_addr !=
-                ((const struct sockaddr_in *)b)->sin_addr.s_addr);
-    }
-
-#if HAVE_STRUCT_SOCKADDR_IN6
-    if (a->ss_family == AF_INET6) {
-        const uint8_t *s6_addr_a = ((const struct sockaddr_in6 *)a)->sin6_addr.s6_addr;
-        const uint8_t *s6_addr_b = ((const struct sockaddr_in6 *)b)->sin6_addr.s6_addr;
-        return memcmp(s6_addr_a, s6_addr_b, 16);
-    }
-#endif
-    return 1;
-}
-
-static int get_port(const struct sockaddr_storage *ss)
-{
-    if (ss->ss_family == AF_INET)
-        return ntohs(((const struct sockaddr_in *)ss)->sin_port);
-#if HAVE_STRUCT_SOCKADDR_IN6
-    if (ss->ss_family == AF_INET6)
-        return ntohs(((const struct sockaddr_in6 *)ss)->sin6_port);
-#endif
-    return 0;
-}
-
-static void set_port(struct sockaddr_storage *ss, int port)
-{
-    if (ss->ss_family == AF_INET)
-        ((struct sockaddr_in *)ss)->sin_port = htons(port);
-#if HAVE_STRUCT_SOCKADDR_IN6
-    else if (ss->ss_family == AF_INET6)
-        ((struct sockaddr_in6 *)ss)->sin6_port = htons(port);
-#endif
-}
-
-static int rtp_check_source_lists(RTPContext *s, struct sockaddr_storage *source_addr_ptr)
-{
-    int i;
-    if (s->nb_ssm_exclude_addrs) {
-        for (i = 0; i < s->nb_ssm_exclude_addrs; i++) {
-            if (!compare_addr(source_addr_ptr, s->ssm_exclude_addrs[i]))
-                return 1;
-        }
-    }
-    if (s->nb_ssm_include_addrs) {
-        for (i = 0; i < s->nb_ssm_include_addrs; i++) {
-            if (!compare_addr(source_addr_ptr, s->ssm_include_addrs[i]))
-                return 0;
-        }
-        return 1;
-    }
-    return 0;
-}
-
-/**
- * add option to url of the form:
- * "http://host:port/path?option1=val1&option2=val2...
- */
-
-static av_printf_format(3, 4) void url_add_option(char *buf, int buf_size, const char *fmt, ...)
-{
-    char buf1[1024];
-    va_list ap;
-
-    va_start(ap, fmt);
-    if (strchr(buf, '?'))
-        av_strlcat(buf, "&", buf_size);
-    else
-        av_strlcat(buf, "?", buf_size);
-    vsnprintf(buf1, sizeof(buf1), fmt, ap);
-    av_strlcat(buf, buf1, buf_size);
-    va_end(ap);
-}
-
-static void build_udp_url(char *buf, int buf_size,
-                          const char *hostname, int port,
-                          int local_port, int ttl,
-                          int max_packet_size, int connect,
-                          const char *include_sources,
-                          const char *exclude_sources)
-{
-    ff_url_join(buf, buf_size, "udp", NULL, hostname, port, NULL);
-    if (local_port >= 0)
-        url_add_option(buf, buf_size, "localport=%d", local_port);
-    if (ttl >= 0)
-        url_add_option(buf, buf_size, "ttl=%d", ttl);
-    if (max_packet_size >=0)
-        url_add_option(buf, buf_size, "pkt_size=%d", max_packet_size);
-    if (connect)
-        url_add_option(buf, buf_size, "connect=1");
-    if (include_sources && include_sources[0])
-        url_add_option(buf, buf_size, "sources=%s", include_sources);
-    if (exclude_sources && exclude_sources[0])
-        url_add_option(buf, buf_size, "block=%s", exclude_sources);
-}
-
-static void rtp_parse_addr_list(URLContext *h, char *buf,
-                                struct sockaddr_storage ***address_list_ptr,
-                                int *address_list_size_ptr)
-{
-    struct addrinfo *ai = NULL;
-    struct sockaddr_storage *source_addr;
-    char tmp = '\0', *p = buf, *next;
-
-    /* Resolve all of the IPs */
-
-    while (p && p[0]) {
-        next = strchr(p, ',');
-
-        if (next) {
-            tmp = *next;
-            *next = '\0';
-        }
-
-        ai = rtp_resolve_host(p, 0, SOCK_DGRAM, AF_UNSPEC, 0);
-        if (ai) {
-            source_addr = av_mallocz(sizeof(struct sockaddr_storage));
-            if (!source_addr)
-                break;
-
-            memcpy(source_addr, ai->ai_addr, ai->ai_addrlen);
-            freeaddrinfo(ai);
-            dynarray_add(address_list_ptr, address_list_size_ptr, source_addr);
-        } else {
-            av_log(h, AV_LOG_WARNING, "Unable to resolve %s\n", p);
-        }
-
-        if (next) {
-            *next = tmp;
-            p = next + 1;
-        } else {
-            p = NULL;
-        }
-    }
-}
-
-/**
- * url syntax: rtp://host:port[?option=val...]
- * option: 'ttl=n'            : set the ttl value (for multicast only)
- *         'rtcpport=n'       : set the remote rtcp port to n
- *         'localrtpport=n'   : set the local rtp port to n
- *         'localrtcpport=n'  : set the local rtcp port to n
- *         'pkt_size=n'       : set max packet size
- *         'connect=0/1'      : do a connect() on the UDP socket
- *         'sources=ip[,ip]'  : list allowed source IP addresses
- *         'block=ip[,ip]'    : list disallowed source IP addresses
- *         'write_to_source=0/1' : send packets to the source address of the latest received packet
- * deprecated option:
- *         'localport=n'      : set the local port to n
- *
- * if rtcpport isn't set the rtcp port will be the rtp port + 1
- * if local rtp port isn't set any available port will be used for the local
- * rtp and rtcp ports
- * if the local rtcp port is not set it will be the local rtp port + 1
- */
-
-static int rtp_open(URLContext *h, const char *uri, int flags)
-{
-    RTPContext *s = h->priv_data;
-    int rtp_port, rtcp_port,
-        ttl, connect,
-        local_rtp_port, local_rtcp_port, max_packet_size;
-    char hostname[256], include_sources[1024] = "", exclude_sources[1024] = "";
-    char buf[1024];
-    char path[1024];
-    const char *p;
-
-    av_url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &rtp_port,
-                 path, sizeof(path), uri);
-    /* extract parameters */
-    ttl = -1;
-    rtcp_port = rtp_port+1;
-    local_rtp_port = -1;
-    local_rtcp_port = -1;
-    max_packet_size = -1;
-    connect = 0;
-
-    p = strchr(uri, '?');
-    if (p) {
-        if (av_find_info_tag(buf, sizeof(buf), "ttl", p)) {
-            ttl = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "rtcpport", p)) {
-            rtcp_port = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "localport", p)) {
-            local_rtp_port = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "localrtpport", p)) {
-            local_rtp_port = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "localrtcpport", p)) {
-            local_rtcp_port = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "pkt_size", p)) {
-            max_packet_size = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "connect", p)) {
-            connect = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "write_to_source", p)) {
-            s->write_to_source = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "sources", p)) {
-            av_strlcpy(include_sources, buf, sizeof(include_sources));
-            rtp_parse_addr_list(h, buf, &s->ssm_include_addrs, &s->nb_ssm_include_addrs);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "block", p)) {
-            av_strlcpy(exclude_sources, buf, sizeof(exclude_sources));
-            rtp_parse_addr_list(h, buf, &s->ssm_exclude_addrs, &s->nb_ssm_exclude_addrs);
-        }
-    }
-
-    build_udp_url(buf, sizeof(buf),
-                  hostname, rtp_port, local_rtp_port, ttl, max_packet_size,
-                  connect, include_sources, exclude_sources);
-    if (ffurl_open(&s->rtp_hd, buf, flags, &h->interrupt_callback, NULL) < 0)
-        goto fail;
-    if (local_rtp_port>=0 && local_rtcp_port<0)
-        local_rtcp_port = ff_udp_get_local_port(s->rtp_hd) + 1;
-
-    build_udp_url(buf, sizeof(buf),
-                  hostname, rtcp_port, local_rtcp_port, ttl, max_packet_size,
-                  connect, include_sources, exclude_sources);
-    if (ffurl_open(&s->rtcp_hd, buf, flags, &h->interrupt_callback, NULL) < 0)
-        goto fail;
-
-    /* just to ease handle access. XXX: need to suppress direct handle
-       access */
-    s->rtp_fd = ffurl_get_file_handle(s->rtp_hd);
-    s->rtcp_fd = ffurl_get_file_handle(s->rtcp_hd);
-
-    h->max_packet_size = s->rtp_hd->max_packet_size;
-    h->is_streamed = 1;
-    return 0;
-
- fail:
-    if (s->rtp_hd)
-        ffurl_close(s->rtp_hd);
-    if (s->rtcp_hd)
-        ffurl_close(s->rtcp_hd);
-    return AVERROR(EIO);
-}
-
-static int rtp_read(URLContext *h, uint8_t *buf, int size)
-{
-    RTPContext *s = h->priv_data;
-    int len, n, i;
-    struct pollfd p[2] = {{s->rtp_fd, POLLIN, 0}, {s->rtcp_fd, POLLIN, 0}};
-    int poll_delay = h->flags & AVIO_FLAG_NONBLOCK ? 0 : 100;
-    struct sockaddr_storage *addrs[2] = { &s->last_rtp_source, &s->last_rtcp_source };
-    socklen_t *addr_lens[2] = { &s->last_rtp_source_len, &s->last_rtcp_source_len };
-
-    for(;;) {
-        if (ff_check_interrupt(&h->interrupt_callback))
-            return AVERROR_EXIT;
-        n = poll(p, 2, poll_delay);
-        if (n > 0) {
-            /* first try RTCP, then RTP */
-            for (i = 1; i >= 0; i--) {
-                if (!(p[i].revents & POLLIN))
-                    continue;
-                *addr_lens[i] = sizeof(*addrs[i]);
-                len = recvfrom(p[i].fd, buf, size, 0,
-                                (struct sockaddr *)addrs[i], addr_lens[i]);
-                if (len < 0) {
-                    if (ff_neterrno() == AVERROR(EAGAIN) ||
-                        ff_neterrno() == AVERROR(EINTR))
-                        continue;
-                    return AVERROR(EIO);
-                }
-                if (rtp_check_source_lists(s, addrs[i]))
-                    continue;
-                return len;
-            }
-        } else if (n < 0) {
-            if (ff_neterrno() == AVERROR(EINTR))
-                continue;
-            return AVERROR(EIO);
-        }
-        if (h->flags & AVIO_FLAG_NONBLOCK)
-            return AVERROR(EAGAIN);
-    }
-    return len;
-}
-
-static int rtp_write(URLContext *h, const uint8_t *buf, int size)
-{
-    RTPContext *s = h->priv_data;
-    int ret;
-    URLContext *hd;
-
-    if (size < 2)
-        return AVERROR(EINVAL);
-
-    if (s->write_to_source) {
-        int fd;
-        struct sockaddr_storage *source, temp_source;
-        socklen_t *source_len, temp_len;
-        if (!s->last_rtp_source.ss_family && !s->last_rtcp_source.ss_family) {
-            av_log(h, AV_LOG_ERROR,
-                   "Unable to send packet to source, no packets received yet\n");
-            // Intentionally not returning an error here
-            return size;
-        }
-
-        if (RTP_PT_IS_RTCP(buf[1])) {
-            fd = s->rtcp_fd;
-            source     = &s->last_rtcp_source;
-            source_len = &s->last_rtcp_source_len;
-        } else {
-            fd = s->rtp_fd;
-            source     = &s->last_rtp_source;
-            source_len = &s->last_rtp_source_len;
-        }
-        if (!source->ss_family) {
-            source      = &temp_source;
-            source_len  = &temp_len;
-            if (RTP_PT_IS_RTCP(buf[1])) {
-                temp_source = s->last_rtp_source;
-                temp_len    = s->last_rtp_source_len;
-                set_port(source, get_port(source) + 1);
-                av_log(h, AV_LOG_INFO,
-                       "Not received any RTCP packets yet, inferring peer port "
-                       "from the RTP port\n");
-            } else {
-                temp_source = s->last_rtcp_source;
-                temp_len    = s->last_rtcp_source_len;
-                set_port(source, get_port(source) - 1);
-                av_log(h, AV_LOG_INFO,
-                       "Not received any RTP packets yet, inferring peer port "
-                       "from the RTCP port\n");
-            }
-        }
-
-        if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
-            ret = ff_network_wait_fd(fd, 1);
-            if (ret < 0)
-                return ret;
-        }
-        ret = sendto(fd, buf, size, 0, (struct sockaddr *) source,
-                     *source_len);
-
-        return ret < 0 ? ff_neterrno() : ret;
-    }
-
-    if (RTP_PT_IS_RTCP(buf[1])) {
-        /* RTCP payload type */
-        hd = s->rtcp_hd;
-    } else {
-        /* RTP payload type */
-        hd = s->rtp_hd;
-    }
-
-    ret = ffurl_write(hd, buf, size);
-    return ret;
-}
-
-static int rtp_close(URLContext *h)
-{
-    RTPContext *s = h->priv_data;
-    int i;
-
-    for (i = 0; i < s->nb_ssm_include_addrs; i++)
-        av_free(s->ssm_include_addrs[i]);
-    av_freep(&s->ssm_include_addrs);
-    for (i = 0; i < s->nb_ssm_exclude_addrs; i++)
-        av_free(s->ssm_exclude_addrs[i]);
-    av_freep(&s->ssm_exclude_addrs);
-
-    ffurl_close(s->rtp_hd);
-    ffurl_close(s->rtcp_hd);
-    return 0;
-}
-
-/**
- * Return the local rtp port used by the RTP connection
- * @param h media file context
- * @return the local port number
- */
-
-int ff_rtp_get_local_rtp_port(URLContext *h)
-{
-    RTPContext *s = h->priv_data;
-    return ff_udp_get_local_port(s->rtp_hd);
-}
-
-/**
- * Return the local rtcp port used by the RTP connection
- * @param h media file context
- * @return the local port number
- */
-
-int ff_rtp_get_local_rtcp_port(URLContext *h)
-{
-    RTPContext *s = h->priv_data;
-    return ff_udp_get_local_port(s->rtcp_hd);
-}
-
-static int rtp_get_file_handle(URLContext *h)
-{
-    RTPContext *s = h->priv_data;
-    return s->rtp_fd;
-}
-
-static int rtp_get_multi_file_handle(URLContext *h, int **handles,
-                                     int *numhandles)
-{
-    RTPContext *s = h->priv_data;
-    int *hs       = *handles = av_malloc(sizeof(**handles) * 2);
-    if (!hs)
-        return AVERROR(ENOMEM);
-    hs[0] = s->rtp_fd;
-    hs[1] = s->rtcp_fd;
-    *numhandles = 2;
-    return 0;
-}
-
-URLProtocol ff_rtp_protocol = {
-    .name                      = "rtp",
-    .url_open                  = rtp_open,
-    .url_read                  = rtp_read,
-    .url_write                 = rtp_write,
-    .url_close                 = rtp_close,
-    .url_get_file_handle       = rtp_get_file_handle,
-    .url_get_multi_file_handle = rtp_get_multi_file_handle,
-    .priv_data_size            = sizeof(RTPContext),
-    .flags                     = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/rtpproto.h b/deps/libav/libavformat/rtpproto.h
deleted file mode 100644
index 7acc80e..0000000
--- a/deps/libav/libavformat/rtpproto.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * RTP network protocol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTPPROTO_H
-#define AVFORMAT_RTPPROTO_H
-
-#include "url.h"
-
-int ff_rtp_set_remote_url(URLContext *h, const char *uri);
-
-int ff_rtp_get_local_rtp_port(URLContext *h);
-int ff_rtp_get_local_rtcp_port(URLContext *h);
-
-#endif /* AVFORMAT_RTPPROTO_H */
diff --git a/deps/libav/libavformat/rtsp.c b/deps/libav/libavformat/rtsp.c
deleted file mode 100644
index b95be46..0000000
--- a/deps/libav/libavformat/rtsp.c
+++ /dev/null
@@ -1,2347 +0,0 @@
-/*
- * RTSP/SDP client
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/base64.h"
-#include "libavutil/avstring.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/random_seed.h"
-#include "libavutil/dict.h"
-#include "libavutil/opt.h"
-#include "libavutil/time.h"
-#include "avformat.h"
-#include "avio_internal.h"
-
-#if HAVE_POLL_H
-#include <poll.h>
-#endif
-#include "internal.h"
-#include "network.h"
-#include "os_support.h"
-#include "http.h"
-#include "rtsp.h"
-
-#include "rtpdec.h"
-#include "rtpproto.h"
-#include "rdt.h"
-#include "rtpdec_formats.h"
-#include "rtpenc_chain.h"
-#include "url.h"
-#include "rtpenc.h"
-#include "mpegts.h"
-
-/* Timeout values for socket poll, in ms,
- * and read_packet(), in seconds  */
-#define POLL_TIMEOUT_MS 100
-#define READ_PACKET_TIMEOUT_S 10
-#define MAX_TIMEOUTS READ_PACKET_TIMEOUT_S * 1000 / POLL_TIMEOUT_MS
-#define SDP_MAX_SIZE 16384
-#define RECVBUF_SIZE 10 * RTP_MAX_PACKET_LENGTH
-#define DEFAULT_REORDERING_DELAY 100000
-
-#define OFFSET(x) offsetof(RTSPState, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-#define ENC AV_OPT_FLAG_ENCODING_PARAM
-
-#define RTSP_FLAG_OPTS(name, longname) \
-    { name, longname, OFFSET(rtsp_flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtsp_flags" }, \
-    { "filter_src", "Only receive packets from the negotiated peer IP", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_FILTER_SRC}, 0, 0, DEC, "rtsp_flags" }
-
-#define RTSP_MEDIATYPE_OPTS(name, longname) \
-    { name, longname, OFFSET(media_type_mask), AV_OPT_TYPE_FLAGS, { .i64 = (1 << (AVMEDIA_TYPE_DATA+1)) - 1 }, INT_MIN, INT_MAX, DEC, "allowed_media_types" }, \
-    { "video", "Video", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_VIDEO}, 0, 0, DEC, "allowed_media_types" }, \
-    { "audio", "Audio", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_AUDIO}, 0, 0, DEC, "allowed_media_types" }, \
-    { "data", "Data", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_DATA}, 0, 0, DEC, "allowed_media_types" }
-
-#define RTSP_REORDERING_OPTS() \
-    { "reorder_queue_size", "Number of packets to buffer for handling of reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC }
-
-const AVOption ff_rtsp_options[] = {
-    { "initial_pause",  "Don't start playing the stream immediately", OFFSET(initial_pause), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
-    FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags),
-    { "rtsp_transport", "RTSP transport protocols", OFFSET(lower_transport_mask), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, DEC|ENC, "rtsp_transport" }, \
-    { "udp", "UDP", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << RTSP_LOWER_TRANSPORT_UDP}, 0, 0, DEC|ENC, "rtsp_transport" }, \
-    { "tcp", "TCP", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << RTSP_LOWER_TRANSPORT_TCP}, 0, 0, DEC|ENC, "rtsp_transport" }, \
-    { "udp_multicast", "UDP multicast", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << RTSP_LOWER_TRANSPORT_UDP_MULTICAST}, 0, 0, DEC, "rtsp_transport" },
-    { "http", "HTTP tunneling", 0, AV_OPT_TYPE_CONST, {.i64 = (1 << RTSP_LOWER_TRANSPORT_HTTP)}, 0, 0, DEC, "rtsp_transport" },
-    RTSP_FLAG_OPTS("rtsp_flags", "RTSP flags"),
-    { "listen", "Wait for incoming connections", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_LISTEN}, 0, 0, DEC, "rtsp_flags" },
-    RTSP_MEDIATYPE_OPTS("allowed_media_types", "Media types to accept from the server"),
-    { "min_port", "Minimum local UDP port", OFFSET(rtp_port_min), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MIN}, 0, 65535, DEC|ENC },
-    { "max_port", "Maximum local UDP port", OFFSET(rtp_port_max), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MAX}, 0, 65535, DEC|ENC },
-    { "timeout", "Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies flag listen", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC },
-    RTSP_REORDERING_OPTS(),
-    { NULL },
-};
-
-static const AVOption sdp_options[] = {
-    RTSP_FLAG_OPTS("sdp_flags", "SDP flags"),
-    { "custom_io", "Use custom IO", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_CUSTOM_IO}, 0, 0, DEC, "rtsp_flags" },
-    { "rtcp_to_source", "Send RTCP packets to the source address of received packets", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_RTCP_TO_SOURCE}, 0, 0, DEC, "rtsp_flags" },
-    RTSP_MEDIATYPE_OPTS("allowed_media_types", "Media types to accept from the server"),
-    RTSP_REORDERING_OPTS(),
-    { NULL },
-};
-
-static const AVOption rtp_options[] = {
-    RTSP_FLAG_OPTS("rtp_flags", "RTP flags"),
-    RTSP_REORDERING_OPTS(),
-    { NULL },
-};
-
-static void get_word_until_chars(char *buf, int buf_size,
-                                 const char *sep, const char **pp)
-{
-    const char *p;
-    char *q;
-
-    p = *pp;
-    p += strspn(p, SPACE_CHARS);
-    q = buf;
-    while (!strchr(sep, *p) && *p != '\0') {
-        if ((q - buf) < buf_size - 1)
-            *q++ = *p;
-        p++;
-    }
-    if (buf_size > 0)
-        *q = '\0';
-    *pp = p;
-}
-
-static void get_word_sep(char *buf, int buf_size, const char *sep,
-                         const char **pp)
-{
-    if (**pp == '/') (*pp)++;
-    get_word_until_chars(buf, buf_size, sep, pp);
-}
-
-static void get_word(char *buf, int buf_size, const char **pp)
-{
-    get_word_until_chars(buf, buf_size, SPACE_CHARS, pp);
-}
-
-/** Parse a string p in the form of Range:npt=xx-xx, and determine the start
- *  and end time.
- *  Used for seeking in the rtp stream.
- */
-static void rtsp_parse_range_npt(const char *p, int64_t *start, int64_t *end)
-{
-    char buf[256];
-
-    p += strspn(p, SPACE_CHARS);
-    if (!av_stristart(p, "npt=", &p))
-        return;
-
-    *start = AV_NOPTS_VALUE;
-    *end = AV_NOPTS_VALUE;
-
-    get_word_sep(buf, sizeof(buf), "-", &p);
-    av_parse_time(start, buf, 1);
-    if (*p == '-') {
-        p++;
-        get_word_sep(buf, sizeof(buf), "-", &p);
-        av_parse_time(end, buf, 1);
-    }
-}
-
-static int get_sockaddr(const char *buf, struct sockaddr_storage *sock)
-{
-    struct addrinfo hints = { 0 }, *ai = NULL;
-    hints.ai_flags = AI_NUMERICHOST;
-    if (getaddrinfo(buf, NULL, &hints, &ai))
-        return -1;
-    memcpy(sock, ai->ai_addr, FFMIN(sizeof(*sock), ai->ai_addrlen));
-    freeaddrinfo(ai);
-    return 0;
-}
-
-#if CONFIG_RTPDEC
-static void init_rtp_handler(RTPDynamicProtocolHandler *handler,
-                             RTSPStream *rtsp_st, AVCodecContext *codec)
-{
-    if (!handler)
-        return;
-    if (codec)
-        codec->codec_id          = handler->codec_id;
-    rtsp_st->dynamic_handler = handler;
-    if (handler->alloc) {
-        rtsp_st->dynamic_protocol_context = handler->alloc();
-        if (!rtsp_st->dynamic_protocol_context)
-            rtsp_st->dynamic_handler = NULL;
-    }
-}
-
-/* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */
-static int sdp_parse_rtpmap(AVFormatContext *s,
-                            AVStream *st, RTSPStream *rtsp_st,
-                            int payload_type, const char *p)
-{
-    AVCodecContext *codec = st->codec;
-    char buf[256];
-    int i;
-    AVCodec *c;
-    const char *c_name;
-
-    /* See if we can handle this kind of payload.
-     * The space should normally not be there but some Real streams or
-     * particular servers ("RealServer Version 6.1.3.970", see issue 1658)
-     * have a trailing space. */
-    get_word_sep(buf, sizeof(buf), "/ ", &p);
-    if (payload_type < RTP_PT_PRIVATE) {
-        /* We are in a standard case
-         * (from http://www.iana.org/assignments/rtp-parameters). */
-        codec->codec_id = ff_rtp_codec_id(buf, codec->codec_type);
-    }
-
-    if (codec->codec_id == AV_CODEC_ID_NONE) {
-        RTPDynamicProtocolHandler *handler =
-            ff_rtp_handler_find_by_name(buf, codec->codec_type);
-        init_rtp_handler(handler, rtsp_st, codec);
-        /* If no dynamic handler was found, check with the list of standard
-         * allocated types, if such a stream for some reason happens to
-         * use a private payload type. This isn't handled in rtpdec.c, since
-         * the format name from the rtpmap line never is passed into rtpdec. */
-        if (!rtsp_st->dynamic_handler)
-            codec->codec_id = ff_rtp_codec_id(buf, codec->codec_type);
-    }
-
-    c = avcodec_find_decoder(codec->codec_id);
-    if (c && c->name)
-        c_name = c->name;
-    else
-        c_name = "(null)";
-
-    get_word_sep(buf, sizeof(buf), "/", &p);
-    i = atoi(buf);
-    switch (codec->codec_type) {
-    case AVMEDIA_TYPE_AUDIO:
-        av_log(s, AV_LOG_DEBUG, "audio codec set to: %s\n", c_name);
-        codec->sample_rate = RTSP_DEFAULT_AUDIO_SAMPLERATE;
-        codec->channels = RTSP_DEFAULT_NB_AUDIO_CHANNELS;
-        if (i > 0) {
-            codec->sample_rate = i;
-            avpriv_set_pts_info(st, 32, 1, codec->sample_rate);
-            get_word_sep(buf, sizeof(buf), "/", &p);
-            i = atoi(buf);
-            if (i > 0)
-                codec->channels = i;
-        }
-        av_log(s, AV_LOG_DEBUG, "audio samplerate set to: %i\n",
-               codec->sample_rate);
-        av_log(s, AV_LOG_DEBUG, "audio channels set to: %i\n",
-               codec->channels);
-        break;
-    case AVMEDIA_TYPE_VIDEO:
-        av_log(s, AV_LOG_DEBUG, "video codec set to: %s\n", c_name);
-        if (i > 0)
-            avpriv_set_pts_info(st, 32, 1, i);
-        break;
-    default:
-        break;
-    }
-    if (rtsp_st->dynamic_handler && rtsp_st->dynamic_handler->init)
-        rtsp_st->dynamic_handler->init(s, st->index,
-                                       rtsp_st->dynamic_protocol_context);
-    return 0;
-}
-
-/* parse the attribute line from the fmtp a line of an sdp response. This
- * is broken out as a function because it is used in rtp_h264.c, which is
- * forthcoming. */
-int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size,
-                                char *value, int value_size)
-{
-    *p += strspn(*p, SPACE_CHARS);
-    if (**p) {
-        get_word_sep(attr, attr_size, "=", p);
-        if (**p == '=')
-            (*p)++;
-        get_word_sep(value, value_size, ";", p);
-        if (**p == ';')
-            (*p)++;
-        return 1;
-    }
-    return 0;
-}
-
-typedef struct SDPParseState {
-    /* SDP only */
-    struct sockaddr_storage default_ip;
-    int            default_ttl;
-    int            skip_media;  ///< set if an unknown m= line occurs
-    int nb_default_include_source_addrs; /**< Number of source-specific multicast include source IP address (from SDP content) */
-    struct RTSPSource **default_include_source_addrs; /**< Source-specific multicast include source IP address (from SDP content) */
-    int nb_default_exclude_source_addrs; /**< Number of source-specific multicast exclude source IP address (from SDP content) */
-    struct RTSPSource **default_exclude_source_addrs; /**< Source-specific multicast exclude source IP address (from SDP content) */
-} SDPParseState;
-
-static void copy_default_source_addrs(struct RTSPSource **addrs, int count,
-                                      struct RTSPSource ***dest, int *dest_count)
-{
-    RTSPSource *rtsp_src, *rtsp_src2;
-    int i;
-    for (i = 0; i < count; i++) {
-        rtsp_src = addrs[i];
-        rtsp_src2 = av_malloc(sizeof(*rtsp_src2));
-        if (!rtsp_src2)
-            continue;
-        memcpy(rtsp_src2, rtsp_src, sizeof(*rtsp_src));
-        dynarray_add(dest, dest_count, rtsp_src2);
-    }
-}
-
-static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
-                           int letter, const char *buf)
-{
-    RTSPState *rt = s->priv_data;
-    char buf1[64], st_type[64];
-    const char *p;
-    enum AVMediaType codec_type;
-    int payload_type, i;
-    AVStream *st;
-    RTSPStream *rtsp_st;
-    RTSPSource *rtsp_src;
-    struct sockaddr_storage sdp_ip;
-    int ttl;
-
-    av_dlog(s, "sdp: %c='%s'\n", letter, buf);
-
-    p = buf;
-    if (s1->skip_media && letter != 'm')
-        return;
-    switch (letter) {
-    case 'c':
-        get_word(buf1, sizeof(buf1), &p);
-        if (strcmp(buf1, "IN") != 0)
-            return;
-        get_word(buf1, sizeof(buf1), &p);
-        if (strcmp(buf1, "IP4") && strcmp(buf1, "IP6"))
-            return;
-        get_word_sep(buf1, sizeof(buf1), "/", &p);
-        if (get_sockaddr(buf1, &sdp_ip))
-            return;
-        ttl = 16;
-        if (*p == '/') {
-            p++;
-            get_word_sep(buf1, sizeof(buf1), "/", &p);
-            ttl = atoi(buf1);
-        }
-        if (s->nb_streams == 0) {
-            s1->default_ip = sdp_ip;
-            s1->default_ttl = ttl;
-        } else {
-            rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
-            rtsp_st->sdp_ip = sdp_ip;
-            rtsp_st->sdp_ttl = ttl;
-        }
-        break;
-    case 's':
-        av_dict_set(&s->metadata, "title", p, 0);
-        break;
-    case 'i':
-        if (s->nb_streams == 0) {
-            av_dict_set(&s->metadata, "comment", p, 0);
-            break;
-        }
-        break;
-    case 'm':
-        /* new stream */
-        s1->skip_media = 0;
-        codec_type = AVMEDIA_TYPE_UNKNOWN;
-        get_word(st_type, sizeof(st_type), &p);
-        if (!strcmp(st_type, "audio")) {
-            codec_type = AVMEDIA_TYPE_AUDIO;
-        } else if (!strcmp(st_type, "video")) {
-            codec_type = AVMEDIA_TYPE_VIDEO;
-        } else if (!strcmp(st_type, "application")) {
-            codec_type = AVMEDIA_TYPE_DATA;
-        }
-        if (codec_type == AVMEDIA_TYPE_UNKNOWN || !(rt->media_type_mask & (1 << codec_type))) {
-            s1->skip_media = 1;
-            return;
-        }
-        rtsp_st = av_mallocz(sizeof(RTSPStream));
-        if (!rtsp_st)
-            return;
-        rtsp_st->stream_index = -1;
-        dynarray_add(&rt->rtsp_streams, &rt->nb_rtsp_streams, rtsp_st);
-
-        rtsp_st->sdp_ip = s1->default_ip;
-        rtsp_st->sdp_ttl = s1->default_ttl;
-
-        copy_default_source_addrs(s1->default_include_source_addrs,
-                                  s1->nb_default_include_source_addrs,
-                                  &rtsp_st->include_source_addrs,
-                                  &rtsp_st->nb_include_source_addrs);
-        copy_default_source_addrs(s1->default_exclude_source_addrs,
-                                  s1->nb_default_exclude_source_addrs,
-                                  &rtsp_st->exclude_source_addrs,
-                                  &rtsp_st->nb_exclude_source_addrs);
-
-        get_word(buf1, sizeof(buf1), &p); /* port */
-        rtsp_st->sdp_port = atoi(buf1);
-
-        get_word(buf1, sizeof(buf1), &p); /* protocol */
-        if (!strcmp(buf1, "udp"))
-            rt->transport = RTSP_TRANSPORT_RAW;
-        else if (strstr(buf1, "/AVPF") || strstr(buf1, "/SAVPF"))
-            rtsp_st->feedback = 1;
-
-        /* XXX: handle list of formats */
-        get_word(buf1, sizeof(buf1), &p); /* format list */
-        rtsp_st->sdp_payload_type = atoi(buf1);
-
-        if (!strcmp(ff_rtp_enc_name(rtsp_st->sdp_payload_type), "MP2T")) {
-            /* no corresponding stream */
-            if (rt->transport == RTSP_TRANSPORT_RAW) {
-                if (!rt->ts && CONFIG_RTPDEC)
-                    rt->ts = ff_mpegts_parse_open(s);
-            } else {
-                RTPDynamicProtocolHandler *handler;
-                handler = ff_rtp_handler_find_by_id(
-                              rtsp_st->sdp_payload_type, AVMEDIA_TYPE_DATA);
-                init_rtp_handler(handler, rtsp_st, NULL);
-                if (handler && handler->init)
-                    handler->init(s, -1, rtsp_st->dynamic_protocol_context);
-            }
-        } else if (rt->server_type == RTSP_SERVER_WMS &&
-                   codec_type == AVMEDIA_TYPE_DATA) {
-            /* RTX stream, a stream that carries all the other actual
-             * audio/video streams. Don't expose this to the callers. */
-        } else {
-            st = avformat_new_stream(s, NULL);
-            if (!st)
-                return;
-            st->id = rt->nb_rtsp_streams - 1;
-            rtsp_st->stream_index = st->index;
-            st->codec->codec_type = codec_type;
-            if (rtsp_st->sdp_payload_type < RTP_PT_PRIVATE) {
-                RTPDynamicProtocolHandler *handler;
-                /* if standard payload type, we can find the codec right now */
-                ff_rtp_get_codec_info(st->codec, rtsp_st->sdp_payload_type);
-                if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
-                    st->codec->sample_rate > 0)
-                    avpriv_set_pts_info(st, 32, 1, st->codec->sample_rate);
-                /* Even static payload types may need a custom depacketizer */
-                handler = ff_rtp_handler_find_by_id(
-                              rtsp_st->sdp_payload_type, st->codec->codec_type);
-                init_rtp_handler(handler, rtsp_st, st->codec);
-                if (handler && handler->init)
-                    handler->init(s, st->index,
-                                  rtsp_st->dynamic_protocol_context);
-            }
-        }
-        /* put a default control url */
-        av_strlcpy(rtsp_st->control_url, rt->control_uri,
-                   sizeof(rtsp_st->control_url));
-        break;
-    case 'a':
-        if (av_strstart(p, "control:", &p)) {
-            if (s->nb_streams == 0) {
-                if (!strncmp(p, "rtsp://", 7))
-                    av_strlcpy(rt->control_uri, p,
-                               sizeof(rt->control_uri));
-            } else {
-                char proto[32];
-                /* get the control url */
-                rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
-
-                /* XXX: may need to add full url resolution */
-                av_url_split(proto, sizeof(proto), NULL, 0, NULL, 0,
-                             NULL, NULL, 0, p);
-                if (proto[0] == '\0') {
-                    /* relative control URL */
-                    if (rtsp_st->control_url[strlen(rtsp_st->control_url)-1]!='/')
-                    av_strlcat(rtsp_st->control_url, "/",
-                               sizeof(rtsp_st->control_url));
-                    av_strlcat(rtsp_st->control_url, p,
-                               sizeof(rtsp_st->control_url));
-                } else
-                    av_strlcpy(rtsp_st->control_url, p,
-                               sizeof(rtsp_st->control_url));
-            }
-        } else if (av_strstart(p, "rtpmap:", &p) && s->nb_streams > 0) {
-            /* NOTE: rtpmap is only supported AFTER the 'm=' tag */
-            get_word(buf1, sizeof(buf1), &p);
-            payload_type = atoi(buf1);
-            rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
-            if (rtsp_st->stream_index >= 0) {
-                st = s->streams[rtsp_st->stream_index];
-                sdp_parse_rtpmap(s, st, rtsp_st, payload_type, p);
-            }
-        } else if (av_strstart(p, "fmtp:", &p) ||
-                   av_strstart(p, "framesize:", &p)) {
-            /* NOTE: fmtp is only supported AFTER the 'a=rtpmap:xxx' tag */
-            // let dynamic protocol handlers have a stab at the line.
-            get_word(buf1, sizeof(buf1), &p);
-            payload_type = atoi(buf1);
-            for (i = 0; i < rt->nb_rtsp_streams; i++) {
-                rtsp_st = rt->rtsp_streams[i];
-                if (rtsp_st->sdp_payload_type == payload_type &&
-                    rtsp_st->dynamic_handler &&
-                    rtsp_st->dynamic_handler->parse_sdp_a_line)
-                    rtsp_st->dynamic_handler->parse_sdp_a_line(s, i,
-                        rtsp_st->dynamic_protocol_context, buf);
-            }
-        } else if (av_strstart(p, "range:", &p)) {
-            int64_t start, end;
-
-            // this is so that seeking on a streamed file can work.
-            rtsp_parse_range_npt(p, &start, &end);
-            s->start_time = start;
-            /* AV_NOPTS_VALUE means live broadcast (and can't seek) */
-            s->duration   = (end == AV_NOPTS_VALUE) ?
-                            AV_NOPTS_VALUE : end - start;
-        } else if (av_strstart(p, "IsRealDataType:integer;",&p)) {
-            if (atoi(p) == 1)
-                rt->transport = RTSP_TRANSPORT_RDT;
-        } else if (av_strstart(p, "SampleRate:integer;", &p) &&
-                   s->nb_streams > 0) {
-            st = s->streams[s->nb_streams - 1];
-            st->codec->sample_rate = atoi(p);
-        } else if (av_strstart(p, "crypto:", &p) && s->nb_streams > 0) {
-            // RFC 4568
-            rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
-            get_word(buf1, sizeof(buf1), &p); // ignore tag
-            get_word(rtsp_st->crypto_suite, sizeof(rtsp_st->crypto_suite), &p);
-            p += strspn(p, SPACE_CHARS);
-            if (av_strstart(p, "inline:", &p))
-                get_word(rtsp_st->crypto_params, sizeof(rtsp_st->crypto_params), &p);
-        } else if (av_strstart(p, "source-filter:", &p)) {
-            int exclude = 0;
-            get_word(buf1, sizeof(buf1), &p);
-            if (strcmp(buf1, "incl") && strcmp(buf1, "excl"))
-                return;
-            exclude = !strcmp(buf1, "excl");
-
-            get_word(buf1, sizeof(buf1), &p);
-            if (strcmp(buf1, "IN") != 0)
-                return;
-            get_word(buf1, sizeof(buf1), &p);
-            if (strcmp(buf1, "IP4") && strcmp(buf1, "IP6") && strcmp(buf1, "*"))
-                return;
-            // not checking that the destination address actually matches or is wildcard
-            get_word(buf1, sizeof(buf1), &p);
-
-            while (*p != '\0') {
-                rtsp_src = av_mallocz(sizeof(*rtsp_src));
-                if (!rtsp_src)
-                    return;
-                get_word(rtsp_src->addr, sizeof(rtsp_src->addr), &p);
-                if (exclude) {
-                    if (s->nb_streams == 0) {
-                        dynarray_add(&s1->default_exclude_source_addrs, &s1->nb_default_exclude_source_addrs, rtsp_src);
-                    } else {
-                        rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
-                        dynarray_add(&rtsp_st->exclude_source_addrs, &rtsp_st->nb_exclude_source_addrs, rtsp_src);
-                    }
-                } else {
-                    if (s->nb_streams == 0) {
-                        dynarray_add(&s1->default_include_source_addrs, &s1->nb_default_include_source_addrs, rtsp_src);
-                    } else {
-                        rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
-                        dynarray_add(&rtsp_st->include_source_addrs, &rtsp_st->nb_include_source_addrs, rtsp_src);
-                    }
-                }
-            }
-        } else {
-            if (rt->server_type == RTSP_SERVER_WMS)
-                ff_wms_parse_sdp_a_line(s, p);
-            if (s->nb_streams > 0) {
-                rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
-
-                if (rt->server_type == RTSP_SERVER_REAL)
-                    ff_real_parse_sdp_a_line(s, rtsp_st->stream_index, p);
-
-                if (rtsp_st->dynamic_handler &&
-                    rtsp_st->dynamic_handler->parse_sdp_a_line)
-                    rtsp_st->dynamic_handler->parse_sdp_a_line(s,
-                        rtsp_st->stream_index,
-                        rtsp_st->dynamic_protocol_context, buf);
-            }
-        }
-        break;
-    }
-}
-
-int ff_sdp_parse(AVFormatContext *s, const char *content)
-{
-    RTSPState *rt = s->priv_data;
-    const char *p;
-    int letter, i;
-    /* Some SDP lines, particularly for Realmedia or ASF RTSP streams,
-     * contain long SDP lines containing complete ASF Headers (several
-     * kB) or arrays of MDPR (RM stream descriptor) headers plus
-     * "rulebooks" describing their properties. Therefore, the SDP line
-     * buffer is large.
-     *
-     * The Vorbis FMTP line can be up to 16KB - see xiph_parse_sdp_line
-     * in rtpdec_xiph.c. */
-    char buf[16384], *q;
-    SDPParseState sdp_parse_state = { { 0 } }, *s1 = &sdp_parse_state;
-
-    p = content;
-    for (;;) {
-        p += strspn(p, SPACE_CHARS);
-        letter = *p;
-        if (letter == '\0')
-            break;
-        p++;
-        if (*p != '=')
-            goto next_line;
-        p++;
-        /* get the content */
-        q = buf;
-        while (*p != '\n' && *p != '\r' && *p != '\0') {
-            if ((q - buf) < sizeof(buf) - 1)
-                *q++ = *p;
-            p++;
-        }
-        *q = '\0';
-        sdp_parse_line(s, s1, letter, buf);
-    next_line:
-        while (*p != '\n' && *p != '\0')
-            p++;
-        if (*p == '\n')
-            p++;
-    }
-
-    for (i = 0; i < s1->nb_default_include_source_addrs; i++)
-        av_free(s1->default_include_source_addrs[i]);
-    av_freep(&s1->default_include_source_addrs);
-    for (i = 0; i < s1->nb_default_exclude_source_addrs; i++)
-        av_free(s1->default_exclude_source_addrs[i]);
-    av_freep(&s1->default_exclude_source_addrs);
-
-    rt->p = av_malloc(sizeof(struct pollfd)*2*(rt->nb_rtsp_streams+1));
-    if (!rt->p) return AVERROR(ENOMEM);
-    return 0;
-}
-#endif /* CONFIG_RTPDEC */
-
-void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets)
-{
-    RTSPState *rt = s->priv_data;
-    int i;
-
-    for (i = 0; i < rt->nb_rtsp_streams; i++) {
-        RTSPStream *rtsp_st = rt->rtsp_streams[i];
-        if (!rtsp_st)
-            continue;
-        if (rtsp_st->transport_priv) {
-            if (s->oformat) {
-                AVFormatContext *rtpctx = rtsp_st->transport_priv;
-                av_write_trailer(rtpctx);
-                if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
-                    uint8_t *ptr;
-                    if (CONFIG_RTSP_MUXER && rtpctx->pb && send_packets)
-                        ff_rtsp_tcp_write_packet(s, rtsp_st);
-                    avio_close_dyn_buf(rtpctx->pb, &ptr);
-                    av_free(ptr);
-                } else {
-                    avio_close(rtpctx->pb);
-                }
-                avformat_free_context(rtpctx);
-            } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
-                ff_rdt_parse_close(rtsp_st->transport_priv);
-            else if (rt->transport == RTSP_TRANSPORT_RTP && CONFIG_RTPDEC)
-                ff_rtp_parse_close(rtsp_st->transport_priv);
-        }
-        rtsp_st->transport_priv = NULL;
-        if (rtsp_st->rtp_handle)
-            ffurl_close(rtsp_st->rtp_handle);
-        rtsp_st->rtp_handle = NULL;
-    }
-}
-
-/* close and free RTSP streams */
-void ff_rtsp_close_streams(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    int i, j;
-    RTSPStream *rtsp_st;
-
-    ff_rtsp_undo_setup(s, 0);
-    for (i = 0; i < rt->nb_rtsp_streams; i++) {
-        rtsp_st = rt->rtsp_streams[i];
-        if (rtsp_st) {
-            if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context)
-                rtsp_st->dynamic_handler->free(
-                    rtsp_st->dynamic_protocol_context);
-            for (j = 0; j < rtsp_st->nb_include_source_addrs; j++)
-                av_free(rtsp_st->include_source_addrs[j]);
-            av_freep(&rtsp_st->include_source_addrs);
-            for (j = 0; j < rtsp_st->nb_exclude_source_addrs; j++)
-                av_free(rtsp_st->exclude_source_addrs[j]);
-            av_freep(&rtsp_st->exclude_source_addrs);
-
-            av_free(rtsp_st);
-        }
-    }
-    av_free(rt->rtsp_streams);
-    if (rt->asf_ctx) {
-        avformat_close_input(&rt->asf_ctx);
-    }
-    if (rt->ts && CONFIG_RTPDEC)
-        ff_mpegts_parse_close(rt->ts);
-    av_free(rt->p);
-    av_free(rt->recvbuf);
-}
-
-int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
-{
-    RTSPState *rt = s->priv_data;
-    AVStream *st = NULL;
-    int reordering_queue_size = rt->reordering_queue_size;
-    if (reordering_queue_size < 0) {
-        if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP || !s->max_delay)
-            reordering_queue_size = 0;
-        else
-            reordering_queue_size = RTP_REORDER_QUEUE_DEFAULT_SIZE;
-    }
-
-    /* open the RTP context */
-    if (rtsp_st->stream_index >= 0)
-        st = s->streams[rtsp_st->stream_index];
-    if (!st)
-        s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    if (s->oformat && CONFIG_RTSP_MUXER) {
-        int ret = ff_rtp_chain_mux_open((AVFormatContext **)&rtsp_st->transport_priv,
-                                        s, st, rtsp_st->rtp_handle,
-                                        RTSP_TCP_MAX_PACKET_SIZE,
-                                        rtsp_st->stream_index);
-        /* Ownership of rtp_handle is passed to the rtp mux context */
-        rtsp_st->rtp_handle = NULL;
-        if (ret < 0)
-            return ret;
-    } else if (rt->transport == RTSP_TRANSPORT_RAW) {
-        return 0; // Don't need to open any parser here
-    } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
-        rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
-                                            rtsp_st->dynamic_protocol_context,
-                                            rtsp_st->dynamic_handler);
-    else if (CONFIG_RTPDEC)
-        rtsp_st->transport_priv = ff_rtp_parse_open(s, st,
-                                         rtsp_st->sdp_payload_type,
-                                         reordering_queue_size);
-
-    if (!rtsp_st->transport_priv) {
-         return AVERROR(ENOMEM);
-    } else if (rt->transport == RTSP_TRANSPORT_RTP && CONFIG_RTPDEC) {
-        if (rtsp_st->dynamic_handler) {
-            ff_rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv,
-                                              rtsp_st->dynamic_protocol_context,
-                                              rtsp_st->dynamic_handler);
-        }
-        if (rtsp_st->crypto_suite[0])
-            ff_rtp_parse_set_crypto(rtsp_st->transport_priv,
-                                    rtsp_st->crypto_suite,
-                                    rtsp_st->crypto_params);
-    }
-
-    return 0;
-}
-
-#if CONFIG_RTSP_DEMUXER || CONFIG_RTSP_MUXER
-static void rtsp_parse_range(int *min_ptr, int *max_ptr, const char **pp)
-{
-    const char *q;
-    char *p;
-    int v;
-
-    q = *pp;
-    q += strspn(q, SPACE_CHARS);
-    v = strtol(q, &p, 10);
-    if (*p == '-') {
-        p++;
-        *min_ptr = v;
-        v = strtol(p, &p, 10);
-        *max_ptr = v;
-    } else {
-        *min_ptr = v;
-        *max_ptr = v;
-    }
-    *pp = p;
-}
-
-/* XXX: only one transport specification is parsed */
-static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
-{
-    char transport_protocol[16];
-    char profile[16];
-    char lower_transport[16];
-    char parameter[16];
-    RTSPTransportField *th;
-    char buf[256];
-
-    reply->nb_transports = 0;
-
-    for (;;) {
-        p += strspn(p, SPACE_CHARS);
-        if (*p == '\0')
-            break;
-
-        th = &reply->transports[reply->nb_transports];
-
-        get_word_sep(transport_protocol, sizeof(transport_protocol),
-                     "/", &p);
-        if (!av_strcasecmp (transport_protocol, "rtp")) {
-            get_word_sep(profile, sizeof(profile), "/;,", &p);
-            lower_transport[0] = '\0';
-            /* rtp/avp/<protocol> */
-            if (*p == '/') {
-                get_word_sep(lower_transport, sizeof(lower_transport),
-                             ";,", &p);
-            }
-            th->transport = RTSP_TRANSPORT_RTP;
-        } else if (!av_strcasecmp (transport_protocol, "x-pn-tng") ||
-                   !av_strcasecmp (transport_protocol, "x-real-rdt")) {
-            /* x-pn-tng/<protocol> */
-            get_word_sep(lower_transport, sizeof(lower_transport), "/;,", &p);
-            profile[0] = '\0';
-            th->transport = RTSP_TRANSPORT_RDT;
-        } else if (!av_strcasecmp(transport_protocol, "raw")) {
-            get_word_sep(profile, sizeof(profile), "/;,", &p);
-            lower_transport[0] = '\0';
-            /* raw/raw/<protocol> */
-            if (*p == '/') {
-                get_word_sep(lower_transport, sizeof(lower_transport),
-                             ";,", &p);
-            }
-            th->transport = RTSP_TRANSPORT_RAW;
-        }
-        if (!av_strcasecmp(lower_transport, "TCP"))
-            th->lower_transport = RTSP_LOWER_TRANSPORT_TCP;
-        else
-            th->lower_transport = RTSP_LOWER_TRANSPORT_UDP;
-
-        if (*p == ';')
-            p++;
-        /* get each parameter */
-        while (*p != '\0' && *p != ',') {
-            get_word_sep(parameter, sizeof(parameter), "=;,", &p);
-            if (!strcmp(parameter, "port")) {
-                if (*p == '=') {
-                    p++;
-                    rtsp_parse_range(&th->port_min, &th->port_max, &p);
-                }
-            } else if (!strcmp(parameter, "client_port")) {
-                if (*p == '=') {
-                    p++;
-                    rtsp_parse_range(&th->client_port_min,
-                                     &th->client_port_max, &p);
-                }
-            } else if (!strcmp(parameter, "server_port")) {
-                if (*p == '=') {
-                    p++;
-                    rtsp_parse_range(&th->server_port_min,
-                                     &th->server_port_max, &p);
-                }
-            } else if (!strcmp(parameter, "interleaved")) {
-                if (*p == '=') {
-                    p++;
-                    rtsp_parse_range(&th->interleaved_min,
-                                     &th->interleaved_max, &p);
-                }
-            } else if (!strcmp(parameter, "multicast")) {
-                if (th->lower_transport == RTSP_LOWER_TRANSPORT_UDP)
-                    th->lower_transport = RTSP_LOWER_TRANSPORT_UDP_MULTICAST;
-            } else if (!strcmp(parameter, "ttl")) {
-                if (*p == '=') {
-                    char *end;
-                    p++;
-                    th->ttl = strtol(p, &end, 10);
-                    p = end;
-                }
-            } else if (!strcmp(parameter, "destination")) {
-                if (*p == '=') {
-                    p++;
-                    get_word_sep(buf, sizeof(buf), ";,", &p);
-                    get_sockaddr(buf, &th->destination);
-                }
-            } else if (!strcmp(parameter, "source")) {
-                if (*p == '=') {
-                    p++;
-                    get_word_sep(buf, sizeof(buf), ";,", &p);
-                    av_strlcpy(th->source, buf, sizeof(th->source));
-                }
-            } else if (!strcmp(parameter, "mode")) {
-                if (*p == '=') {
-                    p++;
-                    get_word_sep(buf, sizeof(buf), ";, ", &p);
-                    if (!strcmp(buf, "record") ||
-                        !strcmp(buf, "receive"))
-                        th->mode_record = 1;
-                }
-            }
-
-            while (*p != ';' && *p != '\0' && *p != ',')
-                p++;
-            if (*p == ';')
-                p++;
-        }
-        if (*p == ',')
-            p++;
-
-        reply->nb_transports++;
-    }
-}
-
-static void handle_rtp_info(RTSPState *rt, const char *url,
-                            uint32_t seq, uint32_t rtptime)
-{
-    int i;
-    if (!rtptime || !url[0])
-        return;
-    if (rt->transport != RTSP_TRANSPORT_RTP)
-        return;
-    for (i = 0; i < rt->nb_rtsp_streams; i++) {
-        RTSPStream *rtsp_st = rt->rtsp_streams[i];
-        RTPDemuxContext *rtpctx = rtsp_st->transport_priv;
-        if (!rtpctx)
-            continue;
-        if (!strcmp(rtsp_st->control_url, url)) {
-            rtpctx->base_timestamp = rtptime;
-            break;
-        }
-    }
-}
-
-static void rtsp_parse_rtp_info(RTSPState *rt, const char *p)
-{
-    int read = 0;
-    char key[20], value[1024], url[1024] = "";
-    uint32_t seq = 0, rtptime = 0;
-
-    for (;;) {
-        p += strspn(p, SPACE_CHARS);
-        if (!*p)
-            break;
-        get_word_sep(key, sizeof(key), "=", &p);
-        if (*p != '=')
-            break;
-        p++;
-        get_word_sep(value, sizeof(value), ";, ", &p);
-        read++;
-        if (!strcmp(key, "url"))
-            av_strlcpy(url, value, sizeof(url));
-        else if (!strcmp(key, "seq"))
-            seq = strtoul(value, NULL, 10);
-        else if (!strcmp(key, "rtptime"))
-            rtptime = strtoul(value, NULL, 10);
-        if (*p == ',') {
-            handle_rtp_info(rt, url, seq, rtptime);
-            url[0] = '\0';
-            seq = rtptime = 0;
-            read = 0;
-        }
-        if (*p)
-            p++;
-    }
-    if (read > 0)
-        handle_rtp_info(rt, url, seq, rtptime);
-}
-
-void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
-                        RTSPState *rt, const char *method)
-{
-    const char *p;
-
-    /* NOTE: we do case independent match for broken servers */
-    p = buf;
-    if (av_stristart(p, "Session:", &p)) {
-        int t;
-        get_word_sep(reply->session_id, sizeof(reply->session_id), ";", &p);
-        if (av_stristart(p, ";timeout=", &p) &&
-            (t = strtol(p, NULL, 10)) > 0) {
-            reply->timeout = t;
-        }
-    } else if (av_stristart(p, "Content-Length:", &p)) {
-        reply->content_length = strtol(p, NULL, 10);
-    } else if (av_stristart(p, "Transport:", &p)) {
-        rtsp_parse_transport(reply, p);
-    } else if (av_stristart(p, "CSeq:", &p)) {
-        reply->seq = strtol(p, NULL, 10);
-    } else if (av_stristart(p, "Range:", &p)) {
-        rtsp_parse_range_npt(p, &reply->range_start, &reply->range_end);
-    } else if (av_stristart(p, "RealChallenge1:", &p)) {
-        p += strspn(p, SPACE_CHARS);
-        av_strlcpy(reply->real_challenge, p, sizeof(reply->real_challenge));
-    } else if (av_stristart(p, "Server:", &p)) {
-        p += strspn(p, SPACE_CHARS);
-        av_strlcpy(reply->server, p, sizeof(reply->server));
-    } else if (av_stristart(p, "Notice:", &p) ||
-               av_stristart(p, "X-Notice:", &p)) {
-        reply->notice = strtol(p, NULL, 10);
-    } else if (av_stristart(p, "Location:", &p)) {
-        p += strspn(p, SPACE_CHARS);
-        av_strlcpy(reply->location, p , sizeof(reply->location));
-    } else if (av_stristart(p, "WWW-Authenticate:", &p) && rt) {
-        p += strspn(p, SPACE_CHARS);
-        ff_http_auth_handle_header(&rt->auth_state, "WWW-Authenticate", p);
-    } else if (av_stristart(p, "Authentication-Info:", &p) && rt) {
-        p += strspn(p, SPACE_CHARS);
-        ff_http_auth_handle_header(&rt->auth_state, "Authentication-Info", p);
-    } else if (av_stristart(p, "Content-Base:", &p) && rt) {
-        p += strspn(p, SPACE_CHARS);
-        if (method && !strcmp(method, "DESCRIBE"))
-            av_strlcpy(rt->control_uri, p , sizeof(rt->control_uri));
-    } else if (av_stristart(p, "RTP-Info:", &p) && rt) {
-        p += strspn(p, SPACE_CHARS);
-        if (method && !strcmp(method, "PLAY"))
-            rtsp_parse_rtp_info(rt, p);
-    } else if (av_stristart(p, "Public:", &p) && rt) {
-        if (strstr(p, "GET_PARAMETER") &&
-            method && !strcmp(method, "OPTIONS"))
-            rt->get_parameter_supported = 1;
-    } else if (av_stristart(p, "x-Accept-Dynamic-Rate:", &p) && rt) {
-        p += strspn(p, SPACE_CHARS);
-        rt->accept_dynamic_rate = atoi(p);
-    } else if (av_stristart(p, "Content-Type:", &p)) {
-        p += strspn(p, SPACE_CHARS);
-        av_strlcpy(reply->content_type, p, sizeof(reply->content_type));
-    }
-}
-
-/* skip a RTP/TCP interleaved packet */
-void ff_rtsp_skip_packet(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    int ret, len, len1;
-    uint8_t buf[1024];
-
-    ret = ffurl_read_complete(rt->rtsp_hd, buf, 3);
-    if (ret != 3)
-        return;
-    len = AV_RB16(buf + 1);
-
-    av_dlog(s, "skipping RTP packet len=%d\n", len);
-
-    /* skip payload */
-    while (len > 0) {
-        len1 = len;
-        if (len1 > sizeof(buf))
-            len1 = sizeof(buf);
-        ret = ffurl_read_complete(rt->rtsp_hd, buf, len1);
-        if (ret != len1)
-            return;
-        len -= len1;
-    }
-}
-
-int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
-                       unsigned char **content_ptr,
-                       int return_on_interleaved_data, const char *method)
-{
-    RTSPState *rt = s->priv_data;
-    char buf[4096], buf1[1024], *q;
-    unsigned char ch;
-    const char *p;
-    int ret, content_length, line_count = 0, request = 0;
-    unsigned char *content = NULL;
-
-start:
-    line_count = 0;
-    request = 0;
-    content = NULL;
-    memset(reply, 0, sizeof(*reply));
-
-    /* parse reply (XXX: use buffers) */
-    rt->last_reply[0] = '\0';
-    for (;;) {
-        q = buf;
-        for (;;) {
-            ret = ffurl_read_complete(rt->rtsp_hd, &ch, 1);
-            av_dlog(s, "ret=%d c=%02x [%c]\n", ret, ch, ch);
-            if (ret != 1)
-                return AVERROR_EOF;
-            if (ch == '\n')
-                break;
-            if (ch == '$') {
-                /* XXX: only parse it if first char on line ? */
-                if (return_on_interleaved_data) {
-                    return 1;
-                } else
-                    ff_rtsp_skip_packet(s);
-            } else if (ch != '\r') {
-                if ((q - buf) < sizeof(buf) - 1)
-                    *q++ = ch;
-            }
-        }
-        *q = '\0';
-
-        av_dlog(s, "line='%s'\n", buf);
-
-        /* test if last line */
-        if (buf[0] == '\0')
-            break;
-        p = buf;
-        if (line_count == 0) {
-            /* get reply code */
-            get_word(buf1, sizeof(buf1), &p);
-            if (!strncmp(buf1, "RTSP/", 5)) {
-                get_word(buf1, sizeof(buf1), &p);
-                reply->status_code = atoi(buf1);
-                av_strlcpy(reply->reason, p, sizeof(reply->reason));
-            } else {
-                av_strlcpy(reply->reason, buf1, sizeof(reply->reason)); // method
-                get_word(buf1, sizeof(buf1), &p); // object
-                request = 1;
-            }
-        } else {
-            ff_rtsp_parse_line(reply, p, rt, method);
-            av_strlcat(rt->last_reply, p,    sizeof(rt->last_reply));
-            av_strlcat(rt->last_reply, "\n", sizeof(rt->last_reply));
-        }
-        line_count++;
-    }
-
-    if (rt->session_id[0] == '\0' && reply->session_id[0] != '\0' && !request)
-        av_strlcpy(rt->session_id, reply->session_id, sizeof(rt->session_id));
-
-    content_length = reply->content_length;
-    if (content_length > 0) {
-        /* leave some room for a trailing '\0' (useful for simple parsing) */
-        content = av_malloc(content_length + 1);
-        ffurl_read_complete(rt->rtsp_hd, content, content_length);
-        content[content_length] = '\0';
-    }
-    if (content_ptr)
-        *content_ptr = content;
-    else
-        av_free(content);
-
-    if (request) {
-        char buf[1024];
-        char base64buf[AV_BASE64_SIZE(sizeof(buf))];
-        const char* ptr = buf;
-
-        if (!strcmp(reply->reason, "OPTIONS")) {
-            snprintf(buf, sizeof(buf), "RTSP/1.0 200 OK\r\n");
-            if (reply->seq)
-                av_strlcatf(buf, sizeof(buf), "CSeq: %d\r\n", reply->seq);
-            if (reply->session_id[0])
-                av_strlcatf(buf, sizeof(buf), "Session: %s\r\n",
-                                              reply->session_id);
-        } else {
-            snprintf(buf, sizeof(buf), "RTSP/1.0 501 Not Implemented\r\n");
-        }
-        av_strlcat(buf, "\r\n", sizeof(buf));
-
-        if (rt->control_transport == RTSP_MODE_TUNNEL) {
-            av_base64_encode(base64buf, sizeof(base64buf), buf, strlen(buf));
-            ptr = base64buf;
-        }
-        ffurl_write(rt->rtsp_hd_out, ptr, strlen(ptr));
-
-        rt->last_cmd_time = av_gettime();
-        /* Even if the request from the server had data, it is not the data
-         * that the caller wants or expects. The memory could also be leaked
-         * if the actual following reply has content data. */
-        if (content_ptr)
-            av_freep(content_ptr);
-        /* If method is set, this is called from ff_rtsp_send_cmd,
-         * where a reply to exactly this request is awaited. For
-         * callers from within packet receiving, we just want to
-         * return to the caller and go back to receiving packets. */
-        if (method)
-            goto start;
-        return 0;
-    }
-
-    if (rt->seq != reply->seq) {
-        av_log(s, AV_LOG_WARNING, "CSeq %d expected, %d received.\n",
-            rt->seq, reply->seq);
-    }
-
-    /* EOS */
-    if (reply->notice == 2101 /* End-of-Stream Reached */      ||
-        reply->notice == 2104 /* Start-of-Stream Reached */    ||
-        reply->notice == 2306 /* Continuous Feed Terminated */) {
-        rt->state = RTSP_STATE_IDLE;
-    } else if (reply->notice >= 4400 && reply->notice < 5500) {
-        return AVERROR(EIO); /* data or server error */
-    } else if (reply->notice == 2401 /* Ticket Expired */ ||
-             (reply->notice >= 5500 && reply->notice < 5600) /* end of term */ )
-        return AVERROR(EPERM);
-
-    return 0;
-}
-
-/**
- * Send a command to the RTSP server without waiting for the reply.
- *
- * @param s RTSP (de)muxer context
- * @param method the method for the request
- * @param url the target url for the request
- * @param headers extra header lines to include in the request
- * @param send_content if non-null, the data to send as request body content
- * @param send_content_length the length of the send_content data, or 0 if
- *                            send_content is null
- *
- * @return zero if success, nonzero otherwise
- */
-static int rtsp_send_cmd_with_content_async(AVFormatContext *s,
-                                            const char *method, const char *url,
-                                            const char *headers,
-                                            const unsigned char *send_content,
-                                            int send_content_length)
-{
-    RTSPState *rt = s->priv_data;
-    char buf[4096], *out_buf;
-    char base64buf[AV_BASE64_SIZE(sizeof(buf))];
-
-    /* Add in RTSP headers */
-    out_buf = buf;
-    rt->seq++;
-    snprintf(buf, sizeof(buf), "%s %s RTSP/1.0\r\n", method, url);
-    if (headers)
-        av_strlcat(buf, headers, sizeof(buf));
-    av_strlcatf(buf, sizeof(buf), "CSeq: %d\r\n", rt->seq);
-    av_strlcatf(buf, sizeof(buf), "User-Agent: %s\r\n", LIBAVFORMAT_IDENT);
-    if (rt->session_id[0] != '\0' && (!headers ||
-        !strstr(headers, "\nIf-Match:"))) {
-        av_strlcatf(buf, sizeof(buf), "Session: %s\r\n", rt->session_id);
-    }
-    if (rt->auth[0]) {
-        char *str = ff_http_auth_create_response(&rt->auth_state,
-                                                 rt->auth, url, method);
-        if (str)
-            av_strlcat(buf, str, sizeof(buf));
-        av_free(str);
-    }
-    if (send_content_length > 0 && send_content)
-        av_strlcatf(buf, sizeof(buf), "Content-Length: %d\r\n", send_content_length);
-    av_strlcat(buf, "\r\n", sizeof(buf));
-
-    /* base64 encode rtsp if tunneling */
-    if (rt->control_transport == RTSP_MODE_TUNNEL) {
-        av_base64_encode(base64buf, sizeof(base64buf), buf, strlen(buf));
-        out_buf = base64buf;
-    }
-
-    av_dlog(s, "Sending:\n%s--\n", buf);
-
-    ffurl_write(rt->rtsp_hd_out, out_buf, strlen(out_buf));
-    if (send_content_length > 0 && send_content) {
-        if (rt->control_transport == RTSP_MODE_TUNNEL) {
-            av_log(s, AV_LOG_ERROR, "tunneling of RTSP requests "
-                                    "with content data not supported\n");
-            return AVERROR_PATCHWELCOME;
-        }
-        ffurl_write(rt->rtsp_hd_out, send_content, send_content_length);
-    }
-    rt->last_cmd_time = av_gettime();
-
-    return 0;
-}
-
-int ff_rtsp_send_cmd_async(AVFormatContext *s, const char *method,
-                           const char *url, const char *headers)
-{
-    return rtsp_send_cmd_with_content_async(s, method, url, headers, NULL, 0);
-}
-
-int ff_rtsp_send_cmd(AVFormatContext *s, const char *method, const char *url,
-                     const char *headers, RTSPMessageHeader *reply,
-                     unsigned char **content_ptr)
-{
-    return ff_rtsp_send_cmd_with_content(s, method, url, headers, reply,
-                                         content_ptr, NULL, 0);
-}
-
-int ff_rtsp_send_cmd_with_content(AVFormatContext *s,
-                                  const char *method, const char *url,
-                                  const char *header,
-                                  RTSPMessageHeader *reply,
-                                  unsigned char **content_ptr,
-                                  const unsigned char *send_content,
-                                  int send_content_length)
-{
-    RTSPState *rt = s->priv_data;
-    HTTPAuthType cur_auth_type;
-    int ret, attempts = 0;
-
-retry:
-    cur_auth_type = rt->auth_state.auth_type;
-    if ((ret = rtsp_send_cmd_with_content_async(s, method, url, header,
-                                                send_content,
-                                                send_content_length)))
-        return ret;
-
-    if ((ret = ff_rtsp_read_reply(s, reply, content_ptr, 0, method) ) < 0)
-        return ret;
-    attempts++;
-
-    if (reply->status_code == 401 &&
-        (cur_auth_type == HTTP_AUTH_NONE || rt->auth_state.stale) &&
-        rt->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 2)
-        goto retry;
-
-    if (reply->status_code > 400){
-        av_log(s, AV_LOG_ERROR, "method %s failed: %d%s\n",
-               method,
-               reply->status_code,
-               reply->reason);
-        av_log(s, AV_LOG_DEBUG, "%s\n", rt->last_reply);
-    }
-
-    return 0;
-}
-
-int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
-                              int lower_transport, const char *real_challenge)
-{
-    RTSPState *rt = s->priv_data;
-    int rtx = 0, j, i, err, interleave = 0, port_off;
-    RTSPStream *rtsp_st;
-    RTSPMessageHeader reply1, *reply = &reply1;
-    char cmd[2048];
-    const char *trans_pref;
-
-    if (rt->transport == RTSP_TRANSPORT_RDT)
-        trans_pref = "x-pn-tng";
-    else if (rt->transport == RTSP_TRANSPORT_RAW)
-        trans_pref = "RAW/RAW";
-    else
-        trans_pref = "RTP/AVP";
-
-    /* default timeout: 1 minute */
-    rt->timeout = 60;
-
-    /* for each stream, make the setup request */
-    /* XXX: we assume the same server is used for the control of each
-     * RTSP stream */
-
-    /* Choose a random starting offset within the first half of the
-     * port range, to allow for a number of ports to try even if the offset
-     * happens to be at the end of the random range. */
-    port_off = av_get_random_seed() % ((rt->rtp_port_max - rt->rtp_port_min)/2);
-    /* even random offset */
-    port_off -= port_off & 0x01;
-
-    for (j = rt->rtp_port_min + port_off, i = 0; i < rt->nb_rtsp_streams; ++i) {
-        char transport[2048];
-
-        /*
-         * WMS serves all UDP data over a single connection, the RTX, which
-         * isn't necessarily the first in the SDP but has to be the first
-         * to be set up, else the second/third SETUP will fail with a 461.
-         */
-        if (lower_transport == RTSP_LOWER_TRANSPORT_UDP &&
-             rt->server_type == RTSP_SERVER_WMS) {
-            if (i == 0) {
-                /* rtx first */
-                for (rtx = 0; rtx < rt->nb_rtsp_streams; rtx++) {
-                    int len = strlen(rt->rtsp_streams[rtx]->control_url);
-                    if (len >= 4 &&
-                        !strcmp(rt->rtsp_streams[rtx]->control_url + len - 4,
-                                "/rtx"))
-                        break;
-                }
-                if (rtx == rt->nb_rtsp_streams)
-                    return -1; /* no RTX found */
-                rtsp_st = rt->rtsp_streams[rtx];
-            } else
-                rtsp_st = rt->rtsp_streams[i > rtx ? i : i - 1];
-        } else
-            rtsp_st = rt->rtsp_streams[i];
-
-        /* RTP/UDP */
-        if (lower_transport == RTSP_LOWER_TRANSPORT_UDP) {
-            char buf[256];
-
-            if (rt->server_type == RTSP_SERVER_WMS && i > 1) {
-                port = reply->transports[0].client_port_min;
-                goto have_port;
-            }
-
-            /* first try in specified port range */
-            while (j <= rt->rtp_port_max) {
-                ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1,
-                            "?localport=%d", j);
-                /* we will use two ports per rtp stream (rtp and rtcp) */
-                j += 2;
-                if (!ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE,
-                               &s->interrupt_callback, NULL))
-                    goto rtp_opened;
-            }
-
-            av_log(s, AV_LOG_ERROR, "Unable to open an input RTP port\n");
-            err = AVERROR(EIO);
-            goto fail;
-
-        rtp_opened:
-            port = ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle);
-        have_port:
-            snprintf(transport, sizeof(transport) - 1,
-                     "%s/UDP;", trans_pref);
-            if (rt->server_type != RTSP_SERVER_REAL)
-                av_strlcat(transport, "unicast;", sizeof(transport));
-            av_strlcatf(transport, sizeof(transport),
-                     "client_port=%d", port);
-            if (rt->transport == RTSP_TRANSPORT_RTP &&
-                !(rt->server_type == RTSP_SERVER_WMS && i > 0))
-                av_strlcatf(transport, sizeof(transport), "-%d", port + 1);
-        }
-
-        /* RTP/TCP */
-        else if (lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
-            /* For WMS streams, the application streams are only used for
-             * UDP. When trying to set it up for TCP streams, the server
-             * will return an error. Therefore, we skip those streams. */
-            if (rt->server_type == RTSP_SERVER_WMS &&
-                (rtsp_st->stream_index < 0 ||
-                 s->streams[rtsp_st->stream_index]->codec->codec_type ==
-                    AVMEDIA_TYPE_DATA))
-                continue;
-            snprintf(transport, sizeof(transport) - 1,
-                     "%s/TCP;", trans_pref);
-            if (rt->transport != RTSP_TRANSPORT_RDT)
-                av_strlcat(transport, "unicast;", sizeof(transport));
-            av_strlcatf(transport, sizeof(transport),
-                        "interleaved=%d-%d",
-                        interleave, interleave + 1);
-            interleave += 2;
-        }
-
-        else if (lower_transport == RTSP_LOWER_TRANSPORT_UDP_MULTICAST) {
-            snprintf(transport, sizeof(transport) - 1,
-                     "%s/UDP;multicast", trans_pref);
-        }
-        if (s->oformat) {
-            av_strlcat(transport, ";mode=record", sizeof(transport));
-        } else if (rt->server_type == RTSP_SERVER_REAL ||
-                   rt->server_type == RTSP_SERVER_WMS)
-            av_strlcat(transport, ";mode=play", sizeof(transport));
-        snprintf(cmd, sizeof(cmd),
-                 "Transport: %s\r\n",
-                 transport);
-        if (rt->accept_dynamic_rate)
-            av_strlcat(cmd, "x-Dynamic-Rate: 0\r\n", sizeof(cmd));
-        if (i == 0 && rt->server_type == RTSP_SERVER_REAL && CONFIG_RTPDEC) {
-            char real_res[41], real_csum[9];
-            ff_rdt_calc_response_and_checksum(real_res, real_csum,
-                                              real_challenge);
-            av_strlcatf(cmd, sizeof(cmd),
-                        "If-Match: %s\r\n"
-                        "RealChallenge2: %s, sd=%s\r\n",
-                        rt->session_id, real_res, real_csum);
-        }
-        ff_rtsp_send_cmd(s, "SETUP", rtsp_st->control_url, cmd, reply, NULL);
-        if (reply->status_code == 461 /* Unsupported protocol */ && i == 0) {
-            err = 1;
-            goto fail;
-        } else if (reply->status_code != RTSP_STATUS_OK ||
-                   reply->nb_transports != 1) {
-            err = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-
-        /* XXX: same protocol for all streams is required */
-        if (i > 0) {
-            if (reply->transports[0].lower_transport != rt->lower_transport ||
-                reply->transports[0].transport != rt->transport) {
-                err = AVERROR_INVALIDDATA;
-                goto fail;
-            }
-        } else {
-            rt->lower_transport = reply->transports[0].lower_transport;
-            rt->transport = reply->transports[0].transport;
-        }
-
-        /* Fail if the server responded with another lower transport mode
-         * than what we requested. */
-        if (reply->transports[0].lower_transport != lower_transport) {
-            av_log(s, AV_LOG_ERROR, "Nonmatching transport in server reply\n");
-            err = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-
-        switch(reply->transports[0].lower_transport) {
-        case RTSP_LOWER_TRANSPORT_TCP:
-            rtsp_st->interleaved_min = reply->transports[0].interleaved_min;
-            rtsp_st->interleaved_max = reply->transports[0].interleaved_max;
-            break;
-
-        case RTSP_LOWER_TRANSPORT_UDP: {
-            char url[1024], options[30] = "";
-            const char *peer = host;
-
-            if (rt->rtsp_flags & RTSP_FLAG_FILTER_SRC)
-                av_strlcpy(options, "?connect=1", sizeof(options));
-            /* Use source address if specified */
-            if (reply->transports[0].source[0])
-                peer = reply->transports[0].source;
-            ff_url_join(url, sizeof(url), "rtp", NULL, peer,
-                        reply->transports[0].server_port_min, "%s", options);
-            if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) &&
-                ff_rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) {
-                err = AVERROR_INVALIDDATA;
-                goto fail;
-            }
-            /* Try to initialize the connection state in a
-             * potential NAT router by sending dummy packets.
-             * RTP/RTCP dummy packets are used for RDT, too.
-             */
-            if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) && s->iformat &&
-                CONFIG_RTPDEC)
-                ff_rtp_send_punch_packets(rtsp_st->rtp_handle);
-            break;
-        }
-        case RTSP_LOWER_TRANSPORT_UDP_MULTICAST: {
-            char url[1024], namebuf[50], optbuf[20] = "";
-            struct sockaddr_storage addr;
-            int port, ttl;
-
-            if (reply->transports[0].destination.ss_family) {
-                addr      = reply->transports[0].destination;
-                port      = reply->transports[0].port_min;
-                ttl       = reply->transports[0].ttl;
-            } else {
-                addr      = rtsp_st->sdp_ip;
-                port      = rtsp_st->sdp_port;
-                ttl       = rtsp_st->sdp_ttl;
-            }
-            if (ttl > 0)
-                snprintf(optbuf, sizeof(optbuf), "?ttl=%d", ttl);
-            getnameinfo((struct sockaddr*) &addr, sizeof(addr),
-                        namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST);
-            ff_url_join(url, sizeof(url), "rtp", NULL, namebuf,
-                        port, "%s", optbuf);
-            if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
-                           &s->interrupt_callback, NULL) < 0) {
-                err = AVERROR_INVALIDDATA;
-                goto fail;
-            }
-            break;
-        }
-        }
-
-        if ((err = ff_rtsp_open_transport_ctx(s, rtsp_st)))
-            goto fail;
-    }
-
-    if (rt->nb_rtsp_streams && reply->timeout > 0)
-        rt->timeout = reply->timeout;
-
-    if (rt->server_type == RTSP_SERVER_REAL)
-        rt->need_subscription = 1;
-
-    return 0;
-
-fail:
-    ff_rtsp_undo_setup(s, 0);
-    return err;
-}
-
-void ff_rtsp_close_connections(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    if (rt->rtsp_hd_out != rt->rtsp_hd) ffurl_close(rt->rtsp_hd_out);
-    ffurl_close(rt->rtsp_hd);
-    rt->rtsp_hd = rt->rtsp_hd_out = NULL;
-}
-
-int ff_rtsp_connect(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    char host[1024], path[1024], tcpname[1024], cmd[2048], auth[128];
-    int port, err, tcp_fd;
-    RTSPMessageHeader reply1 = {0}, *reply = &reply1;
-    int lower_transport_mask = 0;
-    char real_challenge[64] = "";
-    struct sockaddr_storage peer;
-    socklen_t peer_len = sizeof(peer);
-
-    if (rt->rtp_port_max < rt->rtp_port_min) {
-        av_log(s, AV_LOG_ERROR, "Invalid UDP port range, max port %d less "
-                                "than min port %d\n", rt->rtp_port_max,
-                                                      rt->rtp_port_min);
-        return AVERROR(EINVAL);
-    }
-
-    if (!ff_network_init())
-        return AVERROR(EIO);
-
-    if (s->max_delay < 0) /* Not set by the caller */
-        s->max_delay = s->iformat ? DEFAULT_REORDERING_DELAY : 0;
-
-    rt->control_transport = RTSP_MODE_PLAIN;
-    if (rt->lower_transport_mask & (1 << RTSP_LOWER_TRANSPORT_HTTP)) {
-        rt->lower_transport_mask = 1 << RTSP_LOWER_TRANSPORT_TCP;
-        rt->control_transport = RTSP_MODE_TUNNEL;
-    }
-    /* Only pass through valid flags from here */
-    rt->lower_transport_mask &= (1 << RTSP_LOWER_TRANSPORT_NB) - 1;
-
-redirect:
-    lower_transport_mask = rt->lower_transport_mask;
-    /* extract hostname and port */
-    av_url_split(NULL, 0, auth, sizeof(auth),
-                 host, sizeof(host), &port, path, sizeof(path), s->filename);
-    if (*auth) {
-        av_strlcpy(rt->auth, auth, sizeof(rt->auth));
-    }
-    if (port < 0)
-        port = RTSP_DEFAULT_PORT;
-
-    if (!lower_transport_mask)
-        lower_transport_mask = (1 << RTSP_LOWER_TRANSPORT_NB) - 1;
-
-    if (s->oformat) {
-        /* Only UDP or TCP - UDP multicast isn't supported. */
-        lower_transport_mask &= (1 << RTSP_LOWER_TRANSPORT_UDP) |
-                                (1 << RTSP_LOWER_TRANSPORT_TCP);
-        if (!lower_transport_mask || rt->control_transport == RTSP_MODE_TUNNEL) {
-            av_log(s, AV_LOG_ERROR, "Unsupported lower transport method, "
-                                    "only UDP and TCP are supported for output.\n");
-            err = AVERROR(EINVAL);
-            goto fail;
-        }
-    }
-
-    /* Construct the URI used in request; this is similar to s->filename,
-     * but with authentication credentials removed and RTSP specific options
-     * stripped out. */
-    ff_url_join(rt->control_uri, sizeof(rt->control_uri), "rtsp", NULL,
-                host, port, "%s", path);
-
-    if (rt->control_transport == RTSP_MODE_TUNNEL) {
-        /* set up initial handshake for tunneling */
-        char httpname[1024];
-        char sessioncookie[17];
-        char headers[1024];
-
-        ff_url_join(httpname, sizeof(httpname), "http", auth, host, port, "%s", path);
-        snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x",
-                 av_get_random_seed(), av_get_random_seed());
-
-        /* GET requests */
-        if (ffurl_alloc(&rt->rtsp_hd, httpname, AVIO_FLAG_READ,
-                        &s->interrupt_callback) < 0) {
-            err = AVERROR(EIO);
-            goto fail;
-        }
-
-        /* generate GET headers */
-        snprintf(headers, sizeof(headers),
-                 "x-sessioncookie: %s\r\n"
-                 "Accept: application/x-rtsp-tunnelled\r\n"
-                 "Pragma: no-cache\r\n"
-                 "Cache-Control: no-cache\r\n",
-                 sessioncookie);
-        av_opt_set(rt->rtsp_hd->priv_data, "headers", headers, 0);
-
-        /* complete the connection */
-        if (ffurl_connect(rt->rtsp_hd, NULL)) {
-            err = AVERROR(EIO);
-            goto fail;
-        }
-
-        /* POST requests */
-        if (ffurl_alloc(&rt->rtsp_hd_out, httpname, AVIO_FLAG_WRITE,
-                        &s->interrupt_callback) < 0 ) {
-            err = AVERROR(EIO);
-            goto fail;
-        }
-
-        /* generate POST headers */
-        snprintf(headers, sizeof(headers),
-                 "x-sessioncookie: %s\r\n"
-                 "Content-Type: application/x-rtsp-tunnelled\r\n"
-                 "Pragma: no-cache\r\n"
-                 "Cache-Control: no-cache\r\n"
-                 "Content-Length: 32767\r\n"
-                 "Expires: Sun, 9 Jan 1972 00:00:00 GMT\r\n",
-                 sessioncookie);
-        av_opt_set(rt->rtsp_hd_out->priv_data, "headers", headers, 0);
-        av_opt_set(rt->rtsp_hd_out->priv_data, "chunked_post", "0", 0);
-
-        /* Initialize the authentication state for the POST session. The HTTP
-         * protocol implementation doesn't properly handle multi-pass
-         * authentication for POST requests, since it would require one of
-         * the following:
-         * - implementing Expect: 100-continue, which many HTTP servers
-         *   don't support anyway, even less the RTSP servers that do HTTP
-         *   tunneling
-         * - sending the whole POST data until getting a 401 reply specifying
-         *   what authentication method to use, then resending all that data
-         * - waiting for potential 401 replies directly after sending the
-         *   POST header (waiting for some unspecified time)
-         * Therefore, we copy the full auth state, which works for both basic
-         * and digest. (For digest, we would have to synchronize the nonce
-         * count variable between the two sessions, if we'd do more requests
-         * with the original session, though.)
-         */
-        ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
-
-        /* complete the connection */
-        if (ffurl_connect(rt->rtsp_hd_out, NULL)) {
-            err = AVERROR(EIO);
-            goto fail;
-        }
-    } else {
-        /* open the tcp connection */
-        ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, NULL);
-        if (ffurl_open(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
-                       &s->interrupt_callback, NULL) < 0) {
-            err = AVERROR(EIO);
-            goto fail;
-        }
-        rt->rtsp_hd_out = rt->rtsp_hd;
-    }
-    rt->seq = 0;
-
-    tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
-    if (!getpeername(tcp_fd, (struct sockaddr*) &peer, &peer_len)) {
-        getnameinfo((struct sockaddr*) &peer, peer_len, host, sizeof(host),
-                    NULL, 0, NI_NUMERICHOST);
-    }
-
-    /* request options supported by the server; this also detects server
-     * type */
-    for (rt->server_type = RTSP_SERVER_RTP;;) {
-        cmd[0] = 0;
-        if (rt->server_type == RTSP_SERVER_REAL)
-            av_strlcat(cmd,
-                       /*
-                        * The following entries are required for proper
-                        * streaming from a Realmedia server. They are
-                        * interdependent in some way although we currently
-                        * don't quite understand how. Values were copied
-                        * from mplayer SVN r23589.
-                        *   ClientChallenge is a 16-byte ID in hex
-                        *   CompanyID is a 16-byte ID in base64
-                        */
-                       "ClientChallenge: 9e26d33f2984236010ef6253fb1887f7\r\n"
-                       "PlayerStarttime: [28/03/2003:22:50:23 00:00]\r\n"
-                       "CompanyID: KnKV4M4I/B2FjJ1TToLycw==\r\n"
-                       "GUID: 00000000-0000-0000-0000-000000000000\r\n",
-                       sizeof(cmd));
-        ff_rtsp_send_cmd(s, "OPTIONS", rt->control_uri, cmd, reply, NULL);
-        if (reply->status_code != RTSP_STATUS_OK) {
-            err = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-
-        /* detect server type if not standard-compliant RTP */
-        if (rt->server_type != RTSP_SERVER_REAL && reply->real_challenge[0]) {
-            rt->server_type = RTSP_SERVER_REAL;
-            continue;
-        } else if (!av_strncasecmp(reply->server, "WMServer/", 9)) {
-            rt->server_type = RTSP_SERVER_WMS;
-        } else if (rt->server_type == RTSP_SERVER_REAL)
-            strcpy(real_challenge, reply->real_challenge);
-        break;
-    }
-
-    if (s->iformat && CONFIG_RTSP_DEMUXER)
-        err = ff_rtsp_setup_input_streams(s, reply);
-    else if (CONFIG_RTSP_MUXER)
-        err = ff_rtsp_setup_output_streams(s, host);
-    if (err)
-        goto fail;
-
-    do {
-        int lower_transport = ff_log2_tab[lower_transport_mask &
-                                  ~(lower_transport_mask - 1)];
-
-        err = ff_rtsp_make_setup_request(s, host, port, lower_transport,
-                                 rt->server_type == RTSP_SERVER_REAL ?
-                                     real_challenge : NULL);
-        if (err < 0)
-            goto fail;
-        lower_transport_mask &= ~(1 << lower_transport);
-        if (lower_transport_mask == 0 && err == 1) {
-            err = AVERROR(EPROTONOSUPPORT);
-            goto fail;
-        }
-    } while (err);
-
-    rt->lower_transport_mask = lower_transport_mask;
-    av_strlcpy(rt->real_challenge, real_challenge, sizeof(rt->real_challenge));
-    rt->state = RTSP_STATE_IDLE;
-    rt->seek_timestamp = 0; /* default is to start stream at position zero */
-    return 0;
- fail:
-    ff_rtsp_close_streams(s);
-    ff_rtsp_close_connections(s);
-    if (reply->status_code >=300 && reply->status_code < 400 && s->iformat) {
-        av_strlcpy(s->filename, reply->location, sizeof(s->filename));
-        av_log(s, AV_LOG_INFO, "Status %d: Redirecting to %s\n",
-               reply->status_code,
-               s->filename);
-        goto redirect;
-    }
-    ff_network_close();
-    return err;
-}
-#endif /* CONFIG_RTSP_DEMUXER || CONFIG_RTSP_MUXER */
-
-#if CONFIG_RTPDEC
-static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
-                           uint8_t *buf, int buf_size, int64_t wait_end)
-{
-    RTSPState *rt = s->priv_data;
-    RTSPStream *rtsp_st;
-    int n, i, ret, tcp_fd, timeout_cnt = 0;
-    int max_p = 0;
-    struct pollfd *p = rt->p;
-    int *fds = NULL, fdsnum, fdsidx;
-
-    for (;;) {
-        if (ff_check_interrupt(&s->interrupt_callback))
-            return AVERROR_EXIT;
-        if (wait_end && wait_end - av_gettime() < 0)
-            return AVERROR(EAGAIN);
-        max_p = 0;
-        if (rt->rtsp_hd) {
-            tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
-            p[max_p].fd = tcp_fd;
-            p[max_p++].events = POLLIN;
-        } else {
-            tcp_fd = -1;
-        }
-        for (i = 0; i < rt->nb_rtsp_streams; i++) {
-            rtsp_st = rt->rtsp_streams[i];
-            if (rtsp_st->rtp_handle) {
-                if (ret = ffurl_get_multi_file_handle(rtsp_st->rtp_handle,
-                                                      &fds, &fdsnum)) {
-                    av_log(s, AV_LOG_ERROR, "Unable to recover rtp ports\n");
-                    return ret;
-                }
-                if (fdsnum != 2) {
-                    av_log(s, AV_LOG_ERROR,
-                           "Number of fds %d not supported\n", fdsnum);
-                    return AVERROR_INVALIDDATA;
-                }
-                for (fdsidx = 0; fdsidx < fdsnum; fdsidx++) {
-                    p[max_p].fd       = fds[fdsidx];
-                    p[max_p++].events = POLLIN;
-                }
-                av_free(fds);
-            }
-        }
-        n = poll(p, max_p, POLL_TIMEOUT_MS);
-        if (n > 0) {
-            int j = 1 - (tcp_fd == -1);
-            timeout_cnt = 0;
-            for (i = 0; i < rt->nb_rtsp_streams; i++) {
-                rtsp_st = rt->rtsp_streams[i];
-                if (rtsp_st->rtp_handle) {
-                    if (p[j].revents & POLLIN || p[j+1].revents & POLLIN) {
-                        ret = ffurl_read(rtsp_st->rtp_handle, buf, buf_size);
-                        if (ret > 0) {
-                            *prtsp_st = rtsp_st;
-                            return ret;
-                        }
-                    }
-                    j+=2;
-                }
-            }
-#if CONFIG_RTSP_DEMUXER
-            if (tcp_fd != -1 && p[0].revents & POLLIN) {
-                if (rt->rtsp_flags & RTSP_FLAG_LISTEN) {
-                    if (rt->state == RTSP_STATE_STREAMING) {
-                        if (!ff_rtsp_parse_streaming_commands(s))
-                            return AVERROR_EOF;
-                        else
-                            av_log(s, AV_LOG_WARNING,
-                                   "Unable to answer to TEARDOWN\n");
-                    } else
-                        return 0;
-                } else {
-                    RTSPMessageHeader reply;
-                    ret = ff_rtsp_read_reply(s, &reply, NULL, 0, NULL);
-                    if (ret < 0)
-                        return ret;
-                    /* XXX: parse message */
-                    if (rt->state != RTSP_STATE_STREAMING)
-                        return 0;
-                }
-            }
-#endif
-        } else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {
-            return AVERROR(ETIMEDOUT);
-        } else if (n < 0 && errno != EINTR)
-            return AVERROR(errno);
-    }
-}
-
-static int pick_stream(AVFormatContext *s, RTSPStream **rtsp_st,
-                       const uint8_t *buf, int len)
-{
-    RTSPState *rt = s->priv_data;
-    int i;
-    if (len < 0)
-        return len;
-    if (rt->nb_rtsp_streams == 1) {
-        *rtsp_st = rt->rtsp_streams[0];
-        return len;
-    }
-    if (len >= 8 && rt->transport == RTSP_TRANSPORT_RTP) {
-        if (RTP_PT_IS_RTCP(rt->recvbuf[1])) {
-            int no_ssrc = 0;
-            for (i = 0; i < rt->nb_rtsp_streams; i++) {
-                RTPDemuxContext *rtpctx = rt->rtsp_streams[i]->transport_priv;
-                if (!rtpctx)
-                    continue;
-                if (rtpctx->ssrc == AV_RB32(&buf[4])) {
-                    *rtsp_st = rt->rtsp_streams[i];
-                    return len;
-                }
-                if (!rtpctx->ssrc)
-                    no_ssrc = 1;
-            }
-            if (no_ssrc) {
-                av_log(s, AV_LOG_WARNING,
-                       "Unable to pick stream for packet - SSRC not known for "
-                       "all streams\n");
-                return AVERROR(EAGAIN);
-            }
-        } else {
-            for (i = 0; i < rt->nb_rtsp_streams; i++) {
-                if ((buf[1] & 0x7f) == rt->rtsp_streams[i]->sdp_payload_type) {
-                    *rtsp_st = rt->rtsp_streams[i];
-                    return len;
-                }
-            }
-        }
-    }
-    av_log(s, AV_LOG_WARNING, "Unable to pick stream for packet\n");
-    return AVERROR(EAGAIN);
-}
-
-int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    RTSPState *rt = s->priv_data;
-    int ret, len;
-    RTSPStream *rtsp_st, *first_queue_st = NULL;
-    int64_t wait_end = 0;
-
-    if (rt->nb_byes == rt->nb_rtsp_streams)
-        return AVERROR_EOF;
-
-    /* get next frames from the same RTP packet */
-    if (rt->cur_transport_priv) {
-        if (rt->transport == RTSP_TRANSPORT_RDT) {
-            ret = ff_rdt_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
-        } else if (rt->transport == RTSP_TRANSPORT_RTP) {
-            ret = ff_rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
-        } else if (rt->ts && CONFIG_RTPDEC) {
-            ret = ff_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf + rt->recvbuf_pos, rt->recvbuf_len - rt->recvbuf_pos);
-            if (ret >= 0) {
-                rt->recvbuf_pos += ret;
-                ret = rt->recvbuf_pos < rt->recvbuf_len;
-            }
-        } else
-            ret = -1;
-        if (ret == 0) {
-            rt->cur_transport_priv = NULL;
-            return 0;
-        } else if (ret == 1) {
-            return 0;
-        } else
-            rt->cur_transport_priv = NULL;
-    }
-
-redo:
-    if (rt->transport == RTSP_TRANSPORT_RTP) {
-        int i;
-        int64_t first_queue_time = 0;
-        for (i = 0; i < rt->nb_rtsp_streams; i++) {
-            RTPDemuxContext *rtpctx = rt->rtsp_streams[i]->transport_priv;
-            int64_t queue_time;
-            if (!rtpctx)
-                continue;
-            queue_time = ff_rtp_queued_packet_time(rtpctx);
-            if (queue_time && (queue_time - first_queue_time < 0 ||
-                               !first_queue_time)) {
-                first_queue_time = queue_time;
-                first_queue_st   = rt->rtsp_streams[i];
-            }
-        }
-        if (first_queue_time) {
-            wait_end = first_queue_time + s->max_delay;
-        } else {
-            wait_end = 0;
-            first_queue_st = NULL;
-        }
-    }
-
-    /* read next RTP packet */
-    if (!rt->recvbuf) {
-        rt->recvbuf = av_malloc(RECVBUF_SIZE);
-        if (!rt->recvbuf)
-            return AVERROR(ENOMEM);
-    }
-
-    switch(rt->lower_transport) {
-    default:
-#if CONFIG_RTSP_DEMUXER
-    case RTSP_LOWER_TRANSPORT_TCP:
-        len = ff_rtsp_tcp_read_packet(s, &rtsp_st, rt->recvbuf, RECVBUF_SIZE);
-        break;
-#endif
-    case RTSP_LOWER_TRANSPORT_UDP:
-    case RTSP_LOWER_TRANSPORT_UDP_MULTICAST:
-        len = udp_read_packet(s, &rtsp_st, rt->recvbuf, RECVBUF_SIZE, wait_end);
-        if (len > 0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP)
-            ff_rtp_check_and_send_back_rr(rtsp_st->transport_priv, rtsp_st->rtp_handle, NULL, len);
-        break;
-    case RTSP_LOWER_TRANSPORT_CUSTOM:
-        if (first_queue_st && rt->transport == RTSP_TRANSPORT_RTP &&
-            wait_end && wait_end < av_gettime())
-            len = AVERROR(EAGAIN);
-        else
-            len = ffio_read_partial(s->pb, rt->recvbuf, RECVBUF_SIZE);
-        len = pick_stream(s, &rtsp_st, rt->recvbuf, len);
-        if (len > 0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP)
-            ff_rtp_check_and_send_back_rr(rtsp_st->transport_priv, NULL, s->pb, len);
-        break;
-    }
-    if (len == AVERROR(EAGAIN) && first_queue_st &&
-        rt->transport == RTSP_TRANSPORT_RTP) {
-        rtsp_st = first_queue_st;
-        ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, NULL, 0);
-        goto end;
-    }
-    if (len < 0)
-        return len;
-    if (len == 0)
-        return AVERROR_EOF;
-    if (rt->transport == RTSP_TRANSPORT_RDT) {
-        ret = ff_rdt_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len);
-    } else if (rt->transport == RTSP_TRANSPORT_RTP) {
-        ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len);
-        if (rtsp_st->feedback) {
-            AVIOContext *pb = NULL;
-            if (rt->lower_transport == RTSP_LOWER_TRANSPORT_CUSTOM)
-                pb = s->pb;
-            ff_rtp_send_rtcp_feedback(rtsp_st->transport_priv, rtsp_st->rtp_handle, pb);
-        }
-        if (ret < 0) {
-            /* Either bad packet, or a RTCP packet. Check if the
-             * first_rtcp_ntp_time field was initialized. */
-            RTPDemuxContext *rtpctx = rtsp_st->transport_priv;
-            if (rtpctx->first_rtcp_ntp_time != AV_NOPTS_VALUE) {
-                /* first_rtcp_ntp_time has been initialized for this stream,
-                 * copy the same value to all other uninitialized streams,
-                 * in order to map their timestamp origin to the same ntp time
-                 * as this one. */
-                int i;
-                AVStream *st = NULL;
-                if (rtsp_st->stream_index >= 0)
-                    st = s->streams[rtsp_st->stream_index];
-                for (i = 0; i < rt->nb_rtsp_streams; i++) {
-                    RTPDemuxContext *rtpctx2 = rt->rtsp_streams[i]->transport_priv;
-                    AVStream *st2 = NULL;
-                    if (rt->rtsp_streams[i]->stream_index >= 0)
-                        st2 = s->streams[rt->rtsp_streams[i]->stream_index];
-                    if (rtpctx2 && st && st2 &&
-                        rtpctx2->first_rtcp_ntp_time == AV_NOPTS_VALUE) {
-                        rtpctx2->first_rtcp_ntp_time = rtpctx->first_rtcp_ntp_time;
-                        rtpctx2->rtcp_ts_offset = av_rescale_q(
-                            rtpctx->rtcp_ts_offset, st->time_base,
-                            st2->time_base);
-                    }
-                }
-            }
-            if (ret == -RTCP_BYE) {
-                rt->nb_byes++;
-
-                av_log(s, AV_LOG_DEBUG, "Received BYE for stream %d (%d/%d)\n",
-                       rtsp_st->stream_index, rt->nb_byes, rt->nb_rtsp_streams);
-
-                if (rt->nb_byes == rt->nb_rtsp_streams)
-                    return AVERROR_EOF;
-            }
-        }
-    } else if (rt->ts && CONFIG_RTPDEC) {
-        ret = ff_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf, len);
-        if (ret >= 0) {
-            if (ret < len) {
-                rt->recvbuf_len = len;
-                rt->recvbuf_pos = ret;
-                rt->cur_transport_priv = rt->ts;
-                return 1;
-            } else {
-                ret = 0;
-            }
-        }
-    } else {
-        return AVERROR_INVALIDDATA;
-    }
-end:
-    if (ret < 0)
-        goto redo;
-    if (ret == 1)
-        /* more packets may follow, so we save the RTP context */
-        rt->cur_transport_priv = rtsp_st->transport_priv;
-
-    return ret;
-}
-#endif /* CONFIG_RTPDEC */
-
-#if CONFIG_SDP_DEMUXER
-static int sdp_probe(AVProbeData *p1)
-{
-    const char *p = p1->buf, *p_end = p1->buf + p1->buf_size;
-
-    /* we look for a line beginning "c=IN IP" */
-    while (p < p_end && *p != '\0') {
-        if (p + sizeof("c=IN IP") - 1 < p_end &&
-            av_strstart(p, "c=IN IP", NULL))
-            return AVPROBE_SCORE_EXTENSION;
-
-        while (p < p_end - 1 && *p != '\n') p++;
-        if (++p >= p_end)
-            break;
-        if (*p == '\r')
-            p++;
-    }
-    return 0;
-}
-
-static void append_source_addrs(char *buf, int size, const char *name,
-                                int count, struct RTSPSource **addrs)
-{
-    int i;
-    if (!count)
-        return;
-    av_strlcatf(buf, size, "&%s=%s", name, addrs[0]->addr);
-    for (i = 1; i < count; i++)
-        av_strlcatf(buf, size, ",%s", addrs[i]->addr);
-}
-
-static int sdp_read_header(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    RTSPStream *rtsp_st;
-    int size, i, err;
-    char *content;
-    char url[1024];
-
-    if (!ff_network_init())
-        return AVERROR(EIO);
-
-    if (s->max_delay < 0) /* Not set by the caller */
-        s->max_delay = DEFAULT_REORDERING_DELAY;
-    if (rt->rtsp_flags & RTSP_FLAG_CUSTOM_IO)
-        rt->lower_transport = RTSP_LOWER_TRANSPORT_CUSTOM;
-
-    /* read the whole sdp file */
-    /* XXX: better loading */
-    content = av_malloc(SDP_MAX_SIZE);
-    size = avio_read(s->pb, content, SDP_MAX_SIZE - 1);
-    if (size <= 0) {
-        av_free(content);
-        return AVERROR_INVALIDDATA;
-    }
-    content[size] ='\0';
-
-    err = ff_sdp_parse(s, content);
-    av_free(content);
-    if (err) goto fail;
-
-    /* open each RTP stream */
-    for (i = 0; i < rt->nb_rtsp_streams; i++) {
-        char namebuf[50];
-        rtsp_st = rt->rtsp_streams[i];
-
-        if (!(rt->rtsp_flags & RTSP_FLAG_CUSTOM_IO)) {
-            getnameinfo((struct sockaddr*) &rtsp_st->sdp_ip, sizeof(rtsp_st->sdp_ip),
-                        namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST);
-            ff_url_join(url, sizeof(url), "rtp", NULL,
-                        namebuf, rtsp_st->sdp_port,
-                        "?localport=%d&ttl=%d&connect=%d&write_to_source=%d",
-                        rtsp_st->sdp_port, rtsp_st->sdp_ttl,
-                        rt->rtsp_flags & RTSP_FLAG_FILTER_SRC ? 1 : 0,
-                        rt->rtsp_flags & RTSP_FLAG_RTCP_TO_SOURCE ? 1 : 0);
-
-            append_source_addrs(url, sizeof(url), "sources",
-                                rtsp_st->nb_include_source_addrs,
-                                rtsp_st->include_source_addrs);
-            append_source_addrs(url, sizeof(url), "block",
-                                rtsp_st->nb_exclude_source_addrs,
-                                rtsp_st->exclude_source_addrs);
-            if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
-                           &s->interrupt_callback, NULL) < 0) {
-                err = AVERROR_INVALIDDATA;
-                goto fail;
-            }
-        }
-        if ((err = ff_rtsp_open_transport_ctx(s, rtsp_st)))
-            goto fail;
-    }
-    return 0;
-fail:
-    ff_rtsp_close_streams(s);
-    ff_network_close();
-    return err;
-}
-
-static int sdp_read_close(AVFormatContext *s)
-{
-    ff_rtsp_close_streams(s);
-    ff_network_close();
-    return 0;
-}
-
-static const AVClass sdp_demuxer_class = {
-    .class_name     = "SDP demuxer",
-    .item_name      = av_default_item_name,
-    .option         = sdp_options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_sdp_demuxer = {
-    .name           = "sdp",
-    .long_name      = NULL_IF_CONFIG_SMALL("SDP"),
-    .priv_data_size = sizeof(RTSPState),
-    .read_probe     = sdp_probe,
-    .read_header    = sdp_read_header,
-    .read_packet    = ff_rtsp_fetch_packet,
-    .read_close     = sdp_read_close,
-    .priv_class     = &sdp_demuxer_class,
-};
-#endif /* CONFIG_SDP_DEMUXER */
-
-#if CONFIG_RTP_DEMUXER
-static int rtp_probe(AVProbeData *p)
-{
-    if (av_strstart(p->filename, "rtp:", NULL))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int rtp_read_header(AVFormatContext *s)
-{
-    uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-    char host[500], sdp[500];
-    int ret, port;
-    URLContext* in = NULL;
-    int payload_type;
-    AVCodecContext codec = { 0 };
-    struct sockaddr_storage addr;
-    AVIOContext pb;
-    socklen_t addrlen = sizeof(addr);
-    RTSPState *rt = s->priv_data;
-
-    if (!ff_network_init())
-        return AVERROR(EIO);
-
-    ret = ffurl_open(&in, s->filename, AVIO_FLAG_READ,
-                     &s->interrupt_callback, NULL);
-    if (ret)
-        goto fail;
-
-    while (1) {
-        ret = ffurl_read(in, recvbuf, sizeof(recvbuf));
-        if (ret == AVERROR(EAGAIN))
-            continue;
-        if (ret < 0)
-            goto fail;
-        if (ret < 12) {
-            av_log(s, AV_LOG_WARNING, "Received too short packet\n");
-            continue;
-        }
-
-        if ((recvbuf[0] & 0xc0) != 0x80) {
-            av_log(s, AV_LOG_WARNING, "Unsupported RTP version packet "
-                                      "received\n");
-            continue;
-        }
-
-        if (RTP_PT_IS_RTCP(recvbuf[1]))
-            continue;
-
-        payload_type = recvbuf[1] & 0x7f;
-        break;
-    }
-    getsockname(ffurl_get_file_handle(in), (struct sockaddr*) &addr, &addrlen);
-    ffurl_close(in);
-    in = NULL;
-
-    if (ff_rtp_get_codec_info(&codec, payload_type)) {
-        av_log(s, AV_LOG_ERROR, "Unable to receive RTP payload type %d "
-                                "without an SDP file describing it\n",
-                                 payload_type);
-        goto fail;
-    }
-    if (codec.codec_type != AVMEDIA_TYPE_DATA) {
-        av_log(s, AV_LOG_WARNING, "Guessing on RTP content - if not received "
-                                  "properly you need an SDP file "
-                                  "describing it\n");
-    }
-
-    av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
-                 NULL, 0, s->filename);
-
-    snprintf(sdp, sizeof(sdp),
-             "v=0\r\nc=IN IP%d %s\r\nm=%s %d RTP/AVP %d\r\n",
-             addr.ss_family == AF_INET ? 4 : 6, host,
-             codec.codec_type == AVMEDIA_TYPE_DATA  ? "application" :
-             codec.codec_type == AVMEDIA_TYPE_VIDEO ? "video" : "audio",
-             port, payload_type);
-    av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
-
-    ffio_init_context(&pb, sdp, strlen(sdp), 0, NULL, NULL, NULL, NULL);
-    s->pb = &pb;
-
-    /* sdp_read_header initializes this again */
-    ff_network_close();
-
-    rt->media_type_mask = (1 << (AVMEDIA_TYPE_DATA+1)) - 1;
-
-    ret = sdp_read_header(s);
-    s->pb = NULL;
-    return ret;
-
-fail:
-    if (in)
-        ffurl_close(in);
-    ff_network_close();
-    return ret;
-}
-
-static const AVClass rtp_demuxer_class = {
-    .class_name     = "RTP demuxer",
-    .item_name      = av_default_item_name,
-    .option         = rtp_options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_rtp_demuxer = {
-    .name           = "rtp",
-    .long_name      = NULL_IF_CONFIG_SMALL("RTP input"),
-    .priv_data_size = sizeof(RTSPState),
-    .read_probe     = rtp_probe,
-    .read_header    = rtp_read_header,
-    .read_packet    = ff_rtsp_fetch_packet,
-    .read_close     = sdp_read_close,
-    .flags          = AVFMT_NOFILE,
-    .priv_class     = &rtp_demuxer_class,
-};
-#endif /* CONFIG_RTP_DEMUXER */
diff --git a/deps/libav/libavformat/rtsp.h b/deps/libav/libavformat/rtsp.h
deleted file mode 100644
index 7a910b0..0000000
--- a/deps/libav/libavformat/rtsp.h
+++ /dev/null
@@ -1,622 +0,0 @@
-/*
- * RTSP definitions
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVFORMAT_RTSP_H
-#define AVFORMAT_RTSP_H
-
-#include <stdint.h>
-#include "avformat.h"
-#include "rtspcodes.h"
-#include "rtpdec.h"
-#include "network.h"
-#include "httpauth.h"
-
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-
-/**
- * Network layer over which RTP/etc packet data will be transported.
- */
-enum RTSPLowerTransport {
-    RTSP_LOWER_TRANSPORT_UDP = 0,           /**< UDP/unicast */
-    RTSP_LOWER_TRANSPORT_TCP = 1,           /**< TCP; interleaved in RTSP */
-    RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2, /**< UDP/multicast */
-    RTSP_LOWER_TRANSPORT_NB,
-    RTSP_LOWER_TRANSPORT_HTTP = 8,          /**< HTTP tunneled - not a proper
-                                                 transport mode as such,
-                                                 only for use via AVOptions */
-    RTSP_LOWER_TRANSPORT_CUSTOM = 16,       /**< Custom IO - not a public
-                                                 option for lower_transport_mask,
-                                                 but set in the SDP demuxer based
-                                                 on a flag. */
-};
-
-/**
- * Packet profile of the data that we will be receiving. Real servers
- * commonly send RDT (although they can sometimes send RTP as well),
- * whereas most others will send RTP.
- */
-enum RTSPTransport {
-    RTSP_TRANSPORT_RTP, /**< Standards-compliant RTP */
-    RTSP_TRANSPORT_RDT, /**< Realmedia Data Transport */
-    RTSP_TRANSPORT_RAW, /**< Raw data (over UDP) */
-    RTSP_TRANSPORT_NB
-};
-
-/**
- * Transport mode for the RTSP data. This may be plain, or
- * tunneled, which is done over HTTP.
- */
-enum RTSPControlTransport {
-    RTSP_MODE_PLAIN,   /**< Normal RTSP */
-    RTSP_MODE_TUNNEL   /**< RTSP over HTTP (tunneling) */
-};
-
-#define RTSP_DEFAULT_PORT   554
-#define RTSP_MAX_TRANSPORTS 8
-#define RTSP_TCP_MAX_PACKET_SIZE 1472
-#define RTSP_DEFAULT_NB_AUDIO_CHANNELS 1
-#define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100
-#define RTSP_RTP_PORT_MIN 5000
-#define RTSP_RTP_PORT_MAX 10000
-
-/**
- * This describes a single item in the "Transport:" line of one stream as
- * negotiated by the SETUP RTSP command. Multiple transports are comma-
- * separated ("Transport: x-read-rdt/tcp;interleaved=0-1,rtp/avp/udp;
- * client_port=1000-1001;server_port=1800-1801") and described in separate
- * RTSPTransportFields.
- */
-typedef struct RTSPTransportField {
-    /** interleave ids, if TCP transport; each TCP/RTSP data packet starts
-     * with a '$', stream length and stream ID. If the stream ID is within
-     * the range of this interleaved_min-max, then the packet belongs to
-     * this stream. */
-    int interleaved_min, interleaved_max;
-
-    /** UDP multicast port range; the ports to which we should connect to
-     * receive multicast UDP data. */
-    int port_min, port_max;
-
-    /** UDP client ports; these should be the local ports of the UDP RTP
-     * (and RTCP) sockets over which we receive RTP/RTCP data. */
-    int client_port_min, client_port_max;
-
-    /** UDP unicast server port range; the ports to which we should connect
-     * to receive unicast UDP RTP/RTCP data. */
-    int server_port_min, server_port_max;
-
-    /** time-to-live value (required for multicast); the amount of HOPs that
-     * packets will be allowed to make before being discarded. */
-    int ttl;
-
-    /** transport set to record data */
-    int mode_record;
-
-    struct sockaddr_storage destination; /**< destination IP address */
-    char source[INET6_ADDRSTRLEN + 1]; /**< source IP address */
-
-    /** data/packet transport protocol; e.g. RTP or RDT */
-    enum RTSPTransport transport;
-
-    /** network layer transport protocol; e.g. TCP or UDP uni-/multicast */
-    enum RTSPLowerTransport lower_transport;
-} RTSPTransportField;
-
-/**
- * This describes the server response to each RTSP command.
- */
-typedef struct RTSPMessageHeader {
-    /** length of the data following this header */
-    int content_length;
-
-    enum RTSPStatusCode status_code; /**< response code from server */
-
-    /** number of items in the 'transports' variable below */
-    int nb_transports;
-
-    /** Time range of the streams that the server will stream. In
-     * AV_TIME_BASE unit, AV_NOPTS_VALUE if not used */
-    int64_t range_start, range_end;
-
-    /** describes the complete "Transport:" line of the server in response
-     * to a SETUP RTSP command by the client */
-    RTSPTransportField transports[RTSP_MAX_TRANSPORTS];
-
-    int seq;                         /**< sequence number */
-
-    /** the "Session:" field. This value is initially set by the server and
-     * should be re-transmitted by the client in every RTSP command. */
-    char session_id[512];
-
-    /** the "Location:" field. This value is used to handle redirection.
-     */
-    char location[4096];
-
-    /** the "RealChallenge1:" field from the server */
-    char real_challenge[64];
-
-    /** the "Server: field, which can be used to identify some special-case
-     * servers that are not 100% standards-compliant. We use this to identify
-     * Windows Media Server, which has a value "WMServer/v.e.r.sion", where
-     * version is a sequence of digits (e.g. 9.0.0.3372). Helix/Real servers
-     * use something like "Helix [..] Server Version v.e.r.sion (platform)
-     * (RealServer compatible)" or "RealServer Version v.e.r.sion (platform)",
-     * where platform is the output of $uname -msr | sed 's/ /-/g'. */
-    char server[64];
-
-    /** The "timeout" comes as part of the server response to the "SETUP"
-     * command, in the "Session: <xyz>[;timeout=<value>]" line. It is the
-     * time, in seconds, that the server will go without traffic over the
-     * RTSP/TCP connection before it closes the connection. To prevent
-     * this, sent dummy requests (e.g. OPTIONS) with intervals smaller
-     * than this value. */
-    int timeout;
-
-    /** The "Notice" or "X-Notice" field value. See
-     * http://tools.ietf.org/html/draft-stiemerling-rtsp-announce-00
-     * for a complete list of supported values. */
-    int notice;
-
-    /** The "reason" is meant to specify better the meaning of the error code
-     * returned
-     */
-    char reason[256];
-
-    /**
-     * Content type header
-     */
-    char content_type[64];
-} RTSPMessageHeader;
-
-/**
- * Client state, i.e. whether we are currently receiving data (PLAYING) or
- * setup-but-not-receiving (PAUSED). State can be changed in applications
- * by calling av_read_play/pause().
- */
-enum RTSPClientState {
-    RTSP_STATE_IDLE,    /**< not initialized */
-    RTSP_STATE_STREAMING, /**< initialized and sending/receiving data */
-    RTSP_STATE_PAUSED,  /**< initialized, but not receiving data */
-    RTSP_STATE_SEEKING, /**< initialized, requesting a seek */
-};
-
-/**
- * Identify particular servers that require special handling, such as
- * standards-incompliant "Transport:" lines in the SETUP request.
- */
-enum RTSPServerType {
-    RTSP_SERVER_RTP,  /**< Standards-compliant RTP-server */
-    RTSP_SERVER_REAL, /**< Realmedia-style server */
-    RTSP_SERVER_WMS,  /**< Windows Media server */
-    RTSP_SERVER_NB
-};
-
-/**
- * Private data for the RTSP demuxer.
- *
- * @todo Use AVIOContext instead of URLContext
- */
-typedef struct RTSPState {
-    const AVClass *class;             /**< Class for private options. */
-    URLContext *rtsp_hd; /* RTSP TCP connection handle */
-
-    /** number of items in the 'rtsp_streams' variable */
-    int nb_rtsp_streams;
-
-    struct RTSPStream **rtsp_streams; /**< streams in this session */
-
-    /** indicator of whether we are currently receiving data from the
-     * server. Basically this isn't more than a simple cache of the
-     * last PLAY/PAUSE command sent to the server, to make sure we don't
-     * send 2x the same unexpectedly or commands in the wrong state. */
-    enum RTSPClientState state;
-
-    /** the seek value requested when calling av_seek_frame(). This value
-     * is subsequently used as part of the "Range" parameter when emitting
-     * the RTSP PLAY command. If we are currently playing, this command is
-     * called instantly. If we are currently paused, this command is called
-     * whenever we resume playback. Either way, the value is only used once,
-     * see rtsp_read_play() and rtsp_read_seek(). */
-    int64_t seek_timestamp;
-
-    int seq;                          /**< RTSP command sequence number */
-
-    /** copy of RTSPMessageHeader->session_id, i.e. the server-provided session
-     * identifier that the client should re-transmit in each RTSP command */
-    char session_id[512];
-
-    /** copy of RTSPMessageHeader->timeout, i.e. the time (in seconds) that
-     * the server will go without traffic on the RTSP/TCP line before it
-     * closes the connection. */
-    int timeout;
-
-    /** timestamp of the last RTSP command that we sent to the RTSP server.
-     * This is used to calculate when to send dummy commands to keep the
-     * connection alive, in conjunction with timeout. */
-    int64_t last_cmd_time;
-
-    /** the negotiated data/packet transport protocol; e.g. RTP or RDT */
-    enum RTSPTransport transport;
-
-    /** the negotiated network layer transport protocol; e.g. TCP or UDP
-     * uni-/multicast */
-    enum RTSPLowerTransport lower_transport;
-
-    /** brand of server that we're talking to; e.g. WMS, REAL or other.
-     * Detected based on the value of RTSPMessageHeader->server or the presence
-     * of RTSPMessageHeader->real_challenge */
-    enum RTSPServerType server_type;
-
-    /** the "RealChallenge1:" field from the server */
-    char real_challenge[64];
-
-    /** plaintext authorization line (username:password) */
-    char auth[128];
-
-    /** authentication state */
-    HTTPAuthState auth_state;
-
-    /** The last reply of the server to a RTSP command */
-    char last_reply[2048]; /* XXX: allocate ? */
-
-    /** RTSPStream->transport_priv of the last stream that we read a
-     * packet from */
-    void *cur_transport_priv;
-
-    /** The following are used for Real stream selection */
-    //@{
-    /** whether we need to send a "SET_PARAMETER Subscribe:" command */
-    int need_subscription;
-
-    /** stream setup during the last frame read. This is used to detect if
-     * we need to subscribe or unsubscribe to any new streams. */
-    enum AVDiscard *real_setup_cache;
-
-    /** current stream setup. This is a temporary buffer used to compare
-     * current setup to previous frame setup. */
-    enum AVDiscard *real_setup;
-
-    /** the last value of the "SET_PARAMETER Subscribe:" RTSP command.
-     * this is used to send the same "Unsubscribe:" if stream setup changed,
-     * before sending a new "Subscribe:" command. */
-    char last_subscription[1024];
-    //@}
-
-    /** The following are used for RTP/ASF streams */
-    //@{
-    /** ASF demuxer context for the embedded ASF stream from WMS servers */
-    AVFormatContext *asf_ctx;
-
-    /** cache for position of the asf demuxer, since we load a new
-     * data packet in the bytecontext for each incoming RTSP packet. */
-    uint64_t asf_pb_pos;
-    //@}
-
-    /** some MS RTSP streams contain a URL in the SDP that we need to use
-     * for all subsequent RTSP requests, rather than the input URI; in
-     * other cases, this is a copy of AVFormatContext->filename. */
-    char control_uri[1024];
-
-    /** The following are used for parsing raw mpegts in udp */
-    //@{
-    struct MpegTSContext *ts;
-    int recvbuf_pos;
-    int recvbuf_len;
-    //@}
-
-    /** Additional output handle, used when input and output are done
-     * separately, eg for HTTP tunneling. */
-    URLContext *rtsp_hd_out;
-
-    /** RTSP transport mode, such as plain or tunneled. */
-    enum RTSPControlTransport control_transport;
-
-    /* Number of RTCP BYE packets the RTSP session has received.
-     * An EOF is propagated back if nb_byes == nb_streams.
-     * This is reset after a seek. */
-    int nb_byes;
-
-    /** Reusable buffer for receiving packets */
-    uint8_t* recvbuf;
-
-    /**
-     * A mask with all requested transport methods
-     */
-    int lower_transport_mask;
-
-    /**
-     * The number of returned packets
-     */
-    uint64_t packets;
-
-    /**
-     * Polling array for udp
-     */
-    struct pollfd *p;
-
-    /**
-     * Whether the server supports the GET_PARAMETER method.
-     */
-    int get_parameter_supported;
-
-    /**
-     * Do not begin to play the stream immediately.
-     */
-    int initial_pause;
-
-    /**
-     * Option flags for the chained RTP muxer.
-     */
-    int rtp_muxer_flags;
-
-    /** Whether the server accepts the x-Dynamic-Rate header */
-    int accept_dynamic_rate;
-
-    /**
-     * Various option flags for the RTSP muxer/demuxer.
-     */
-    int rtsp_flags;
-
-    /**
-     * Mask of all requested media types
-     */
-    int media_type_mask;
-
-    /**
-     * Minimum and maximum local UDP ports.
-     */
-    int rtp_port_min, rtp_port_max;
-
-    /**
-     * Timeout to wait for incoming connections.
-     */
-    int initial_timeout;
-
-    /**
-     * Size of RTP packet reordering queue.
-     */
-    int reordering_queue_size;
-} RTSPState;
-
-#define RTSP_FLAG_FILTER_SRC  0x1    /**< Filter incoming UDP packets -
-                                          receive packets only from the right
-                                          source address and port. */
-#define RTSP_FLAG_LISTEN      0x2    /**< Wait for incoming connections. */
-#define RTSP_FLAG_CUSTOM_IO   0x4    /**< Do all IO via the AVIOContext. */
-#define RTSP_FLAG_RTCP_TO_SOURCE 0x8 /**< Send RTCP packets to the source
-                                          address of received packets. */
-
-typedef struct RTSPSource {
-    char addr[128]; /**< Source-specific multicast include source IP address (from SDP content) */
-} RTSPSource;
-
-/**
- * Describe a single stream, as identified by a single m= line block in the
- * SDP content. In the case of RDT, one RTSPStream can represent multiple
- * AVStreams. In this case, each AVStream in this set has similar content
- * (but different codec/bitrate).
- */
-typedef struct RTSPStream {
-    URLContext *rtp_handle;   /**< RTP stream handle (if UDP) */
-    void *transport_priv; /**< RTP/RDT parse context if input, RTP AVFormatContext if output */
-
-    /** corresponding stream index, if any. -1 if none (MPEG2TS case) */
-    int stream_index;
-
-    /** interleave IDs; copies of RTSPTransportField->interleaved_min/max
-     * for the selected transport. Only used for TCP. */
-    int interleaved_min, interleaved_max;
-
-    char control_url[1024];   /**< url for this stream (from SDP) */
-
-    /** The following are used only in SDP, not RTSP */
-    //@{
-    int sdp_port;             /**< port (from SDP content) */
-    struct sockaddr_storage sdp_ip; /**< IP address (from SDP content) */
-    int nb_include_source_addrs; /**< Number of source-specific multicast include source IP addresses (from SDP content) */
-    struct RTSPSource **include_source_addrs; /**< Source-specific multicast include source IP addresses (from SDP content) */
-    int nb_exclude_source_addrs; /**< Number of source-specific multicast exclude source IP addresses (from SDP content) */
-    struct RTSPSource **exclude_source_addrs; /**< Source-specific multicast exclude source IP addresses (from SDP content) */
-    int sdp_ttl;              /**< IP Time-To-Live (from SDP content) */
-    int sdp_payload_type;     /**< payload type */
-    //@}
-
-    /** The following are used for dynamic protocols (rtpdec_*.c/rdt.c) */
-    //@{
-    /** handler structure */
-    RTPDynamicProtocolHandler *dynamic_handler;
-
-    /** private data associated with the dynamic protocol */
-    PayloadContext *dynamic_protocol_context;
-    //@}
-
-    /** Enable sending RTCP feedback messages according to RFC 4585 */
-    int feedback;
-
-    char crypto_suite[40];
-    char crypto_params[100];
-} RTSPStream;
-
-void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
-                        RTSPState *rt, const char *method);
-
-/**
- * Send a command to the RTSP server without waiting for the reply.
- *
- * @see rtsp_send_cmd_with_content_async
- */
-int ff_rtsp_send_cmd_async(AVFormatContext *s, const char *method,
-                           const char *url, const char *headers);
-
-/**
- * Send a command to the RTSP server and wait for the reply.
- *
- * @param s RTSP (de)muxer context
- * @param method the method for the request
- * @param url the target url for the request
- * @param headers extra header lines to include in the request
- * @param reply pointer where the RTSP message header will be stored
- * @param content_ptr pointer where the RTSP message body, if any, will
- *                    be stored (length is in reply)
- * @param send_content if non-null, the data to send as request body content
- * @param send_content_length the length of the send_content data, or 0 if
- *                            send_content is null
- *
- * @return zero if success, nonzero otherwise
- */
-int ff_rtsp_send_cmd_with_content(AVFormatContext *s,
-                                  const char *method, const char *url,
-                                  const char *headers,
-                                  RTSPMessageHeader *reply,
-                                  unsigned char **content_ptr,
-                                  const unsigned char *send_content,
-                                  int send_content_length);
-
-/**
- * Send a command to the RTSP server and wait for the reply.
- *
- * @see rtsp_send_cmd_with_content
- */
-int ff_rtsp_send_cmd(AVFormatContext *s, const char *method,
-                     const char *url, const char *headers,
-                     RTSPMessageHeader *reply, unsigned char **content_ptr);
-
-/**
- * Read a RTSP message from the server, or prepare to read data
- * packets if we're reading data interleaved over the TCP/RTSP
- * connection as well.
- *
- * @param s RTSP (de)muxer context
- * @param reply pointer where the RTSP message header will be stored
- * @param content_ptr pointer where the RTSP message body, if any, will
- *                    be stored (length is in reply)
- * @param return_on_interleaved_data whether the function may return if we
- *                   encounter a data marker ('$'), which precedes data
- *                   packets over interleaved TCP/RTSP connections. If this
- *                   is set, this function will return 1 after encountering
- *                   a '$'. If it is not set, the function will skip any
- *                   data packets (if they are encountered), until a reply
- *                   has been fully parsed. If no more data is available
- *                   without parsing a reply, it will return an error.
- * @param method the RTSP method this is a reply to. This affects how
- *               some response headers are acted upon. May be NULL.
- *
- * @return 1 if a data packets is ready to be received, -1 on error,
- *          and 0 on success.
- */
-int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
-                       unsigned char **content_ptr,
-                       int return_on_interleaved_data, const char *method);
-
-/**
- * Skip a RTP/TCP interleaved packet.
- */
-void ff_rtsp_skip_packet(AVFormatContext *s);
-
-/**
- * Connect to the RTSP server and set up the individual media streams.
- * This can be used for both muxers and demuxers.
- *
- * @param s RTSP (de)muxer context
- *
- * @return 0 on success, < 0 on error. Cleans up all allocations done
- *          within the function on error.
- */
-int ff_rtsp_connect(AVFormatContext *s);
-
-/**
- * Close and free all streams within the RTSP (de)muxer
- *
- * @param s RTSP (de)muxer context
- */
-void ff_rtsp_close_streams(AVFormatContext *s);
-
-/**
- * Close all connection handles within the RTSP (de)muxer
- *
- * @param s RTSP (de)muxer context
- */
-void ff_rtsp_close_connections(AVFormatContext *s);
-
-/**
- * Get the description of the stream and set up the RTSPStream child
- * objects.
- */
-int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply);
-
-/**
- * Announce the stream to the server and set up the RTSPStream child
- * objects for each media stream.
- */
-int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr);
-
-/**
- * Parse RTSP commands (OPTIONS, PAUSE and TEARDOWN) during streaming in
- * listen mode.
- */
-int ff_rtsp_parse_streaming_commands(AVFormatContext *s);
-
-/**
- * Parse an SDP description of streams by populating an RTSPState struct
- * within the AVFormatContext; also allocate the RTP streams and the
- * pollfd array used for UDP streams.
- */
-int ff_sdp_parse(AVFormatContext *s, const char *content);
-
-/**
- * Receive one RTP packet from an TCP interleaved RTSP stream.
- */
-int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
-                            uint8_t *buf, int buf_size);
-
-/**
- * Send buffered packets over TCP.
- */
-int ff_rtsp_tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st);
-
-/**
- * Receive one packet from the RTSPStreams set up in the AVFormatContext
- * (which should contain a RTSPState struct as priv_data).
- */
-int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Do the SETUP requests for each stream for the chosen
- * lower transport mode.
- * @return 0 on success, <0 on error, 1 if protocol is unavailable
- */
-int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
-                               int lower_transport, const char *real_challenge);
-
-/**
- * Undo the effect of ff_rtsp_make_setup_request, close the
- * transport_priv and rtp_handle fields.
- */
-void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets);
-
-/**
- * Open RTSP transport context.
- */
-int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st);
-
-extern const AVOption ff_rtsp_options[];
-
-#endif /* AVFORMAT_RTSP_H */
diff --git a/deps/libav/libavformat/rtspcodes.h b/deps/libav/libavformat/rtspcodes.h
deleted file mode 100644
index 31ab336..0000000
--- a/deps/libav/libavformat/rtspcodes.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * RTSP definitions
- * copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_RTSPCODES_H
-#define AVFORMAT_RTSPCODES_H
-
-/** RTSP handling */
-enum RTSPStatusCode {
-RTSP_STATUS_OK              =200, /**< OK */
-RTSP_STATUS_METHOD          =405, /**< Method Not Allowed */
-RTSP_STATUS_BANDWIDTH       =453, /**< Not Enough Bandwidth */
-RTSP_STATUS_SESSION         =454, /**< Session Not Found */
-RTSP_STATUS_STATE           =455, /**< Method Not Valid in This State */
-RTSP_STATUS_AGGREGATE       =459, /**< Aggregate operation not allowed */
-RTSP_STATUS_ONLY_AGGREGATE  =460, /**< Only aggregate operation allowed */
-RTSP_STATUS_TRANSPORT       =461, /**< Unsupported transport */
-RTSP_STATUS_INTERNAL        =500, /**< Internal Server Error */
-RTSP_STATUS_SERVICE         =503, /**< Service Unavailable */
-RTSP_STATUS_VERSION         =505, /**< RTSP Version not supported */
-};
-
-enum RTSPMethod {
-    DESCRIBE,
-    ANNOUNCE,
-    OPTIONS,
-    SETUP,
-    PLAY,
-    PAUSE,
-    TEARDOWN,
-    GET_PARAMETER,
-    SET_PARAMETER,
-    REDIRECT,
-    RECORD,
-    UNKNOWN = -1,
-};
-#endif /* AVFORMAT_RTSPCODES_H */
diff --git a/deps/libav/libavformat/rtspdec.c b/deps/libav/libavformat/rtspdec.c
deleted file mode 100644
index 583070a..0000000
--- a/deps/libav/libavformat/rtspdec.c
+++ /dev/null
@@ -1,938 +0,0 @@
-/*
- * RTSP demuxer
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avstring.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/random_seed.h"
-#include "libavutil/time.h"
-#include "avformat.h"
-
-#include "internal.h"
-#include "network.h"
-#include "os_support.h"
-#include "rtpproto.h"
-#include "rtsp.h"
-#include "rdt.h"
-#include "url.h"
-
-static const struct RTSPStatusMessage {
-    enum RTSPStatusCode code;
-    const char *message;
-} status_messages[] = {
-    { RTSP_STATUS_OK,             "OK"                               },
-    { RTSP_STATUS_METHOD,         "Method Not Allowed"               },
-    { RTSP_STATUS_BANDWIDTH,      "Not Enough Bandwidth"             },
-    { RTSP_STATUS_SESSION,        "Session Not Found"                },
-    { RTSP_STATUS_STATE,          "Method Not Valid in This State"   },
-    { RTSP_STATUS_AGGREGATE,      "Aggregate operation not allowed"  },
-    { RTSP_STATUS_ONLY_AGGREGATE, "Only aggregate operation allowed" },
-    { RTSP_STATUS_TRANSPORT,      "Unsupported transport"            },
-    { RTSP_STATUS_INTERNAL,       "Internal Server Error"            },
-    { RTSP_STATUS_SERVICE,        "Service Unavailable"              },
-    { RTSP_STATUS_VERSION,        "RTSP Version not supported"       },
-    { 0,                          "NULL"                             }
-};
-
-static int rtsp_read_close(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-
-    if (!(rt->rtsp_flags & RTSP_FLAG_LISTEN))
-        ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL);
-
-    ff_rtsp_close_streams(s);
-    ff_rtsp_close_connections(s);
-    ff_network_close();
-    rt->real_setup = NULL;
-    av_freep(&rt->real_setup_cache);
-    return 0;
-}
-
-static inline int read_line(AVFormatContext *s, char *rbuf, const int rbufsize,
-                            int *rbuflen)
-{
-    RTSPState *rt = s->priv_data;
-    int idx       = 0;
-    int ret       = 0;
-    *rbuflen      = 0;
-
-    do {
-        ret = ffurl_read_complete(rt->rtsp_hd, rbuf + idx, 1);
-        if (ret <= 0)
-            return ret ? ret : AVERROR_EOF;
-        if (rbuf[idx] == '\r') {
-            /* Ignore */
-        } else if (rbuf[idx] == '\n') {
-            rbuf[idx] = '\0';
-            *rbuflen  = idx;
-            return 0;
-        } else
-            idx++;
-    } while (idx < rbufsize);
-    av_log(s, AV_LOG_ERROR, "Message too long\n");
-    return AVERROR(EIO);
-}
-
-static int rtsp_send_reply(AVFormatContext *s, enum RTSPStatusCode code,
-                           const char *extracontent, uint16_t seq)
-{
-    RTSPState *rt = s->priv_data;
-    char message[4096];
-    int index = 0;
-    while (status_messages[index].code) {
-        if (status_messages[index].code == code) {
-            snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n",
-                     code, status_messages[index].message);
-            break;
-        }
-        index++;
-    }
-    if (!status_messages[index].code)
-        return AVERROR(EINVAL);
-    av_strlcatf(message, sizeof(message), "CSeq: %d\r\n", seq);
-    av_strlcatf(message, sizeof(message), "Server: %s\r\n", LIBAVFORMAT_IDENT);
-    if (extracontent)
-        av_strlcat(message, extracontent, sizeof(message));
-    av_strlcat(message, "\r\n", sizeof(message));
-    av_dlog(s, "Sending response:\n%s", message);
-    ffurl_write(rt->rtsp_hd, message, strlen(message));
-
-    return 0;
-}
-
-static inline int check_sessionid(AVFormatContext *s,
-                                  RTSPMessageHeader *request)
-{
-    RTSPState *rt = s->priv_data;
-    unsigned char *session_id = rt->session_id;
-    if (!session_id[0]) {
-        av_log(s, AV_LOG_WARNING, "There is no session-id at the moment\n");
-        return 0;
-    }
-    if (strcmp(session_id, request->session_id)) {
-        av_log(s, AV_LOG_ERROR, "Unexpected session-id %s\n",
-               request->session_id);
-        rtsp_send_reply(s, RTSP_STATUS_SESSION, NULL, request->seq);
-        return AVERROR_STREAM_NOT_FOUND;
-    }
-    return 0;
-}
-
-static inline int rtsp_read_request(AVFormatContext *s,
-                                    RTSPMessageHeader *request,
-                                    const char *method)
-{
-    RTSPState *rt = s->priv_data;
-    char rbuf[1024];
-    int rbuflen, ret;
-    do {
-        ret = read_line(s, rbuf, sizeof(rbuf), &rbuflen);
-        if (ret)
-            return ret;
-        if (rbuflen > 1) {
-            av_dlog(s, "Parsing[%d]: %s\n", rbuflen, rbuf);
-            ff_rtsp_parse_line(request, rbuf, rt, method);
-        }
-    } while (rbuflen > 0);
-    if (request->seq != rt->seq + 1) {
-        av_log(s, AV_LOG_ERROR, "Unexpected Sequence number %d\n",
-               request->seq);
-        return AVERROR(EINVAL);
-    }
-    if (rt->session_id[0] && strcmp(method, "OPTIONS")) {
-        ret = check_sessionid(s, request);
-        if (ret)
-            return ret;
-    }
-
-    return 0;
-}
-
-static int rtsp_read_announce(AVFormatContext *s)
-{
-    RTSPState *rt             = s->priv_data;
-    RTSPMessageHeader request = { 0 };
-    char sdp[4096];
-    int  ret;
-
-    ret = rtsp_read_request(s, &request, "ANNOUNCE");
-    if (ret)
-        return ret;
-    rt->seq++;
-    if (strcmp(request.content_type, "application/sdp")) {
-        av_log(s, AV_LOG_ERROR, "Unexpected content type %s\n",
-               request.content_type);
-        rtsp_send_reply(s, RTSP_STATUS_SERVICE, NULL, request.seq);
-        return AVERROR_OPTION_NOT_FOUND;
-    }
-    if (request.content_length && request.content_length < sizeof(sdp) - 1) {
-        /* Read SDP */
-        if (ffurl_read_complete(rt->rtsp_hd, sdp, request.content_length)
-            < request.content_length) {
-            av_log(s, AV_LOG_ERROR,
-                   "Unable to get complete SDP Description in ANNOUNCE\n");
-            rtsp_send_reply(s, RTSP_STATUS_INTERNAL, NULL, request.seq);
-            return AVERROR(EIO);
-        }
-        sdp[request.content_length] = '\0';
-        av_log(s, AV_LOG_VERBOSE, "SDP: %s\n", sdp);
-        ret = ff_sdp_parse(s, sdp);
-        if (ret)
-            return ret;
-        rtsp_send_reply(s, RTSP_STATUS_OK, NULL, request.seq);
-        return 0;
-    }
-    av_log(s, AV_LOG_ERROR,
-           "Content-Length header value exceeds sdp allocated buffer (4KB)\n");
-    rtsp_send_reply(s, RTSP_STATUS_INTERNAL,
-                    "Content-Length exceeds buffer size", request.seq);
-    return AVERROR(EIO);
-}
-
-static int rtsp_read_options(AVFormatContext *s)
-{
-    RTSPState *rt             = s->priv_data;
-    RTSPMessageHeader request = { 0 };
-    int ret                   = 0;
-
-    /* Parsing headers */
-    ret = rtsp_read_request(s, &request, "OPTIONS");
-    if (ret)
-        return ret;
-    rt->seq++;
-    /* Send Reply */
-    rtsp_send_reply(s, RTSP_STATUS_OK,
-                    "Public: ANNOUNCE, PAUSE, SETUP, TEARDOWN, RECORD\r\n",
-                    request.seq);
-    return 0;
-}
-
-static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
-{
-    RTSPState *rt             = s->priv_data;
-    RTSPMessageHeader request = { 0 };
-    int ret                   = 0;
-    char url[1024];
-    RTSPStream *rtsp_st;
-    char responseheaders[1024];
-    int localport    = -1;
-    int transportidx = 0;
-    int streamid     = 0;
-
-    ret = rtsp_read_request(s, &request, "SETUP");
-    if (ret)
-        return ret;
-    rt->seq++;
-    if (!request.nb_transports) {
-        av_log(s, AV_LOG_ERROR, "No transport defined in SETUP\n");
-        return AVERROR_INVALIDDATA;
-    }
-    for (transportidx = 0; transportidx < request.nb_transports;
-         transportidx++) {
-        if (!request.transports[transportidx].mode_record ||
-            (request.transports[transportidx].lower_transport !=
-             RTSP_LOWER_TRANSPORT_UDP &&
-             request.transports[transportidx].lower_transport !=
-             RTSP_LOWER_TRANSPORT_TCP)) {
-            av_log(s, AV_LOG_ERROR, "mode=record/receive not set or transport"
-                   " protocol not supported (yet)\n");
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    if (request.nb_transports > 1)
-        av_log(s, AV_LOG_WARNING, "More than one transport not supported, "
-               "using first of all\n");
-    for (streamid = 0; streamid < rt->nb_rtsp_streams; streamid++) {
-        if (!strcmp(rt->rtsp_streams[streamid]->control_url,
-                    controlurl))
-            break;
-    }
-    if (streamid == rt->nb_rtsp_streams) {
-        av_log(s, AV_LOG_ERROR, "Unable to find requested track\n");
-        return AVERROR_STREAM_NOT_FOUND;
-    }
-    rtsp_st   = rt->rtsp_streams[streamid];
-    localport = rt->rtp_port_min;
-
-    if (request.transports[0].lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
-        rt->lower_transport = RTSP_LOWER_TRANSPORT_TCP;
-        if ((ret = ff_rtsp_open_transport_ctx(s, rtsp_st))) {
-            rtsp_send_reply(s, RTSP_STATUS_TRANSPORT, NULL, request.seq);
-            return ret;
-        }
-        rtsp_st->interleaved_min = request.transports[0].interleaved_min;
-        rtsp_st->interleaved_max = request.transports[0].interleaved_max;
-        snprintf(responseheaders, sizeof(responseheaders), "Transport: "
-                 "RTP/AVP/TCP;unicast;mode=receive;interleaved=%d-%d"
-                 "\r\n", request.transports[0].interleaved_min,
-                 request.transports[0].interleaved_max);
-    } else {
-        do {
-            ff_url_join(url, sizeof(url), "rtp", NULL, host, localport, NULL);
-            av_dlog(s, "Opening: %s", url);
-            ret = ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
-                             &s->interrupt_callback, NULL);
-            if (ret)
-                localport += 2;
-        } while (ret || localport > rt->rtp_port_max);
-        if (localport > rt->rtp_port_max) {
-            rtsp_send_reply(s, RTSP_STATUS_TRANSPORT, NULL, request.seq);
-            return ret;
-        }
-
-        av_dlog(s, "Listening on: %d",
-                ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle));
-        if ((ret = ff_rtsp_open_transport_ctx(s, rtsp_st))) {
-            rtsp_send_reply(s, RTSP_STATUS_TRANSPORT, NULL, request.seq);
-            return ret;
-        }
-
-        localport = ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle);
-        snprintf(responseheaders, sizeof(responseheaders), "Transport: "
-                 "RTP/AVP/UDP;unicast;mode=receive;source=%s;"
-                 "client_port=%d-%d;server_port=%d-%d\r\n",
-                 host, request.transports[0].client_port_min,
-                 request.transports[0].client_port_max, localport,
-                 localport + 1);
-    }
-
-    /* Establish sessionid if not previously set */
-    /* Put this in a function? */
-    /* RFC 2326: session id must be at least 8 digits */
-    while (strlen(rt->session_id) < 8)
-        av_strlcatf(rt->session_id, 512, "%u", av_get_random_seed());
-
-    av_strlcatf(responseheaders, sizeof(responseheaders), "Session: %s\r\n",
-                rt->session_id);
-    /* Send Reply */
-    rtsp_send_reply(s, RTSP_STATUS_OK, responseheaders, request.seq);
-
-    rt->state = RTSP_STATE_PAUSED;
-    return 0;
-}
-
-static int rtsp_read_record(AVFormatContext *s)
-{
-    RTSPState *rt             = s->priv_data;
-    RTSPMessageHeader request = { 0 };
-    int ret                   = 0;
-    char responseheaders[1024];
-
-    ret = rtsp_read_request(s, &request, "RECORD");
-    if (ret)
-        return ret;
-    ret = check_sessionid(s, &request);
-    if (ret)
-        return ret;
-    rt->seq++;
-    snprintf(responseheaders, sizeof(responseheaders), "Session: %s\r\n",
-             rt->session_id);
-    rtsp_send_reply(s, RTSP_STATUS_OK, responseheaders, request.seq);
-
-    rt->state = RTSP_STATE_STREAMING;
-    return 0;
-}
-
-static inline int parse_command_line(AVFormatContext *s, const char *line,
-                                     int linelen, char *uri, int urisize,
-                                     char *method, int methodsize,
-                                     enum RTSPMethod *methodcode)
-{
-    RTSPState *rt = s->priv_data;
-    const char *linept, *searchlinept;
-    linept = strchr(line, ' ');
-    if (linept - line > methodsize - 1) {
-        av_log(s, AV_LOG_ERROR, "Method string too long\n");
-        return AVERROR(EIO);
-    }
-    memcpy(method, line, linept - line);
-    method[linept - line] = '\0';
-    linept++;
-    if (!strcmp(method, "ANNOUNCE"))
-        *methodcode = ANNOUNCE;
-    else if (!strcmp(method, "OPTIONS"))
-        *methodcode = OPTIONS;
-    else if (!strcmp(method, "RECORD"))
-        *methodcode = RECORD;
-    else if (!strcmp(method, "SETUP"))
-        *methodcode = SETUP;
-    else if (!strcmp(method, "PAUSE"))
-        *methodcode = PAUSE;
-    else if (!strcmp(method, "TEARDOWN"))
-        *methodcode = TEARDOWN;
-    else
-        *methodcode = UNKNOWN;
-    /* Check method with the state  */
-    if (rt->state == RTSP_STATE_IDLE) {
-        if ((*methodcode != ANNOUNCE) && (*methodcode != OPTIONS)) {
-            av_log(s, AV_LOG_ERROR, "Unexpected command in Idle State %s\n",
-                   line);
-            return AVERROR_PROTOCOL_NOT_FOUND;
-        }
-    } else if (rt->state == RTSP_STATE_PAUSED) {
-        if ((*methodcode != OPTIONS) && (*methodcode != RECORD)
-            && (*methodcode != SETUP)) {
-            av_log(s, AV_LOG_ERROR, "Unexpected command in Paused State %s\n",
-                   line);
-            return AVERROR_PROTOCOL_NOT_FOUND;
-        }
-    } else if (rt->state == RTSP_STATE_STREAMING) {
-        if ((*methodcode != PAUSE) && (*methodcode != OPTIONS)
-            && (*methodcode != TEARDOWN)) {
-            av_log(s, AV_LOG_ERROR, "Unexpected command in Streaming State"
-                   " %s\n", line);
-            return AVERROR_PROTOCOL_NOT_FOUND;
-        }
-    } else {
-        av_log(s, AV_LOG_ERROR, "Unexpected State [%d]\n", rt->state);
-        return AVERROR_BUG;
-    }
-
-    searchlinept = strchr(linept, ' ');
-    if (searchlinept == NULL) {
-        av_log(s, AV_LOG_ERROR, "Error parsing message URI\n");
-        return AVERROR_INVALIDDATA;
-    }
-    if (searchlinept - linept > urisize - 1) {
-        av_log(s, AV_LOG_ERROR, "uri string length exceeded buffer size\n");
-        return AVERROR(EIO);
-    }
-    memcpy(uri, linept, searchlinept - linept);
-    uri[searchlinept - linept] = '\0';
-    if (strcmp(rt->control_uri, uri)) {
-        char host[128], path[512], auth[128];
-        int port;
-        char ctl_host[128], ctl_path[512], ctl_auth[128];
-        int ctl_port;
-        av_url_split(NULL, 0, auth, sizeof(auth), host, sizeof(host), &port,
-                     path, sizeof(path), uri);
-        av_url_split(NULL, 0, ctl_auth, sizeof(ctl_auth), ctl_host,
-                     sizeof(ctl_host), &ctl_port, ctl_path, sizeof(ctl_path),
-                     rt->control_uri);
-        if (strcmp(host, ctl_host))
-            av_log(s, AV_LOG_INFO, "Host %s differs from expected %s\n",
-                   host, ctl_host);
-        if (strcmp(path, ctl_path) && *methodcode != SETUP)
-            av_log(s, AV_LOG_WARNING, "WARNING: Path %s differs from expected"
-                   " %s\n", path, ctl_path);
-        if (*methodcode == ANNOUNCE) {
-            av_log(s, AV_LOG_INFO,
-                   "Updating control URI to %s\n", uri);
-            av_strlcpy(rt->control_uri, uri, sizeof(rt->control_uri));
-        }
-    }
-
-    linept = searchlinept + 1;
-    if (!av_strstart(linept, "RTSP/1.0", NULL)) {
-        av_log(s, AV_LOG_ERROR, "Error parsing protocol or version\n");
-        return AVERROR_PROTOCOL_NOT_FOUND;
-    }
-    return 0;
-}
-
-int ff_rtsp_parse_streaming_commands(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    unsigned char rbuf[4096];
-    unsigned char method[10];
-    char uri[500];
-    int ret;
-    int rbuflen               = 0;
-    RTSPMessageHeader request = { 0 };
-    enum RTSPMethod methodcode;
-
-    ret = read_line(s, rbuf, sizeof(rbuf), &rbuflen);
-    if (ret < 0)
-        return ret;
-    ret = parse_command_line(s, rbuf, rbuflen, uri, sizeof(uri), method,
-                             sizeof(method), &methodcode);
-    if (ret) {
-        av_log(s, AV_LOG_ERROR, "RTSP: Unexpected Command\n");
-        return ret;
-    }
-
-    ret = rtsp_read_request(s, &request, method);
-    if (ret)
-        return ret;
-    rt->seq++;
-    if (methodcode == PAUSE) {
-        rt->state = RTSP_STATE_PAUSED;
-        ret       = rtsp_send_reply(s, RTSP_STATUS_OK, NULL , request.seq);
-        // TODO: Missing date header in response
-    } else if (methodcode == OPTIONS) {
-        ret = rtsp_send_reply(s, RTSP_STATUS_OK,
-                              "Public: ANNOUNCE, PAUSE, SETUP, TEARDOWN, "
-                              "RECORD\r\n", request.seq);
-    } else if (methodcode == TEARDOWN) {
-        rt->state = RTSP_STATE_IDLE;
-        ret       = rtsp_send_reply(s, RTSP_STATUS_OK, NULL , request.seq);
-        return 0;
-    }
-    return ret;
-}
-
-static int rtsp_read_play(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    RTSPMessageHeader reply1, *reply = &reply1;
-    int i;
-    char cmd[1024];
-
-    av_log(s, AV_LOG_DEBUG, "hello state=%d\n", rt->state);
-    rt->nb_byes = 0;
-
-    if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) {
-        if (rt->transport == RTSP_TRANSPORT_RTP) {
-            for (i = 0; i < rt->nb_rtsp_streams; i++) {
-                RTSPStream *rtsp_st = rt->rtsp_streams[i];
-                RTPDemuxContext *rtpctx = rtsp_st->transport_priv;
-                if (!rtpctx)
-                    continue;
-                ff_rtp_reset_packet_queue(rtpctx);
-                rtpctx->last_rtcp_ntp_time  = AV_NOPTS_VALUE;
-                rtpctx->first_rtcp_ntp_time = AV_NOPTS_VALUE;
-                rtpctx->base_timestamp      = 0;
-                rtpctx->timestamp           = 0;
-                rtpctx->unwrapped_timestamp = 0;
-                rtpctx->rtcp_ts_offset      = 0;
-            }
-        }
-        if (rt->state == RTSP_STATE_PAUSED) {
-            cmd[0] = 0;
-        } else {
-            snprintf(cmd, sizeof(cmd),
-                     "Range: npt=%"PRId64".%03"PRId64"-\r\n",
-                     rt->seek_timestamp / AV_TIME_BASE,
-                     rt->seek_timestamp / (AV_TIME_BASE / 1000) % 1000);
-        }
-        ff_rtsp_send_cmd(s, "PLAY", rt->control_uri, cmd, reply, NULL);
-        if (reply->status_code != RTSP_STATUS_OK) {
-            return -1;
-        }
-        if (rt->transport == RTSP_TRANSPORT_RTP &&
-            reply->range_start != AV_NOPTS_VALUE) {
-            for (i = 0; i < rt->nb_rtsp_streams; i++) {
-                RTSPStream *rtsp_st = rt->rtsp_streams[i];
-                RTPDemuxContext *rtpctx = rtsp_st->transport_priv;
-                AVStream *st = NULL;
-                if (!rtpctx || rtsp_st->stream_index < 0)
-                    continue;
-                st = s->streams[rtsp_st->stream_index];
-                rtpctx->range_start_offset =
-                    av_rescale_q(reply->range_start, AV_TIME_BASE_Q,
-                                 st->time_base);
-            }
-        }
-    }
-    rt->state = RTSP_STATE_STREAMING;
-    return 0;
-}
-
-/* pause the stream */
-static int rtsp_read_pause(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    RTSPMessageHeader reply1, *reply = &reply1;
-
-    if (rt->state != RTSP_STATE_STREAMING)
-        return 0;
-    else if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) {
-        ff_rtsp_send_cmd(s, "PAUSE", rt->control_uri, NULL, reply, NULL);
-        if (reply->status_code != RTSP_STATUS_OK) {
-            return -1;
-        }
-    }
-    rt->state = RTSP_STATE_PAUSED;
-    return 0;
-}
-
-int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
-{
-    RTSPState *rt = s->priv_data;
-    char cmd[1024];
-    unsigned char *content = NULL;
-    int ret;
-
-    /* describe the stream */
-    snprintf(cmd, sizeof(cmd),
-             "Accept: application/sdp\r\n");
-    if (rt->server_type == RTSP_SERVER_REAL) {
-        /**
-         * The Require: attribute is needed for proper streaming from
-         * Realmedia servers.
-         */
-        av_strlcat(cmd,
-                   "Require: com.real.retain-entity-for-setup\r\n",
-                   sizeof(cmd));
-    }
-    ff_rtsp_send_cmd(s, "DESCRIBE", rt->control_uri, cmd, reply, &content);
-    if (!content)
-        return AVERROR_INVALIDDATA;
-    if (reply->status_code != RTSP_STATUS_OK) {
-        av_freep(&content);
-        return AVERROR_INVALIDDATA;
-    }
-
-    av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", content);
-    /* now we got the SDP description, we parse it */
-    ret = ff_sdp_parse(s, (const char *)content);
-    av_freep(&content);
-    if (ret < 0)
-        return ret;
-
-    return 0;
-}
-
-static int rtsp_listen(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    char host[128], path[512], auth[128];
-    char uri[500];
-    int port;
-    char tcpname[500];
-    unsigned char rbuf[4096];
-    unsigned char method[10];
-    int rbuflen = 0;
-    int ret;
-    enum RTSPMethod methodcode;
-
-    /* extract hostname and port */
-    av_url_split(NULL, 0, auth, sizeof(auth), host, sizeof(host), &port,
-                 path, sizeof(path), s->filename);
-
-    /* ff_url_join. No authorization by now (NULL) */
-    ff_url_join(rt->control_uri, sizeof(rt->control_uri), "rtsp", NULL, host,
-                port, "%s", path);
-
-    if (port < 0)
-        port = RTSP_DEFAULT_PORT;
-
-    /* Create TCP connection */
-    ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port,
-                "?listen&listen_timeout=%d", rt->initial_timeout * 1000);
-
-    if (ret = ffurl_open(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
-                         &s->interrupt_callback, NULL)) {
-        av_log(s, AV_LOG_ERROR, "Unable to open RTSP for listening\n");
-        return ret;
-    }
-    rt->state       = RTSP_STATE_IDLE;
-    rt->rtsp_hd_out = rt->rtsp_hd;
-    for (;;) { /* Wait for incoming RTSP messages */
-        ret = read_line(s, rbuf, sizeof(rbuf), &rbuflen);
-        if (ret < 0)
-            return ret;
-        ret = parse_command_line(s, rbuf, rbuflen, uri, sizeof(uri), method,
-                                 sizeof(method), &methodcode);
-        if (ret) {
-            av_log(s, AV_LOG_ERROR, "RTSP: Unexpected Command\n");
-            return ret;
-        }
-
-        if (methodcode == ANNOUNCE) {
-            ret       = rtsp_read_announce(s);
-            rt->state = RTSP_STATE_PAUSED;
-        } else if (methodcode == OPTIONS) {
-            ret = rtsp_read_options(s);
-        } else if (methodcode == RECORD) {
-            ret = rtsp_read_record(s);
-            if (!ret)
-                return 0; // We are ready for streaming
-        } else if (methodcode == SETUP)
-            ret = rtsp_read_setup(s, host, uri);
-        if (ret) {
-            ffurl_close(rt->rtsp_hd);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-    return 0;
-}
-
-static int rtsp_probe(AVProbeData *p)
-{
-    if (av_strstart(p->filename, "rtsp:", NULL))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int rtsp_read_header(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    int ret;
-
-    if (rt->initial_timeout > 0)
-        rt->rtsp_flags |= RTSP_FLAG_LISTEN;
-
-    if (rt->rtsp_flags & RTSP_FLAG_LISTEN) {
-        ret = rtsp_listen(s);
-        if (ret)
-            return ret;
-    } else {
-        ret = ff_rtsp_connect(s);
-        if (ret)
-            return ret;
-
-        rt->real_setup_cache = !s->nb_streams ? NULL :
-            av_mallocz(2 * s->nb_streams * sizeof(*rt->real_setup_cache));
-        if (!rt->real_setup_cache && s->nb_streams)
-            return AVERROR(ENOMEM);
-        rt->real_setup = rt->real_setup_cache + s->nb_streams;
-
-        if (rt->initial_pause) {
-            /* do not start immediately */
-        } else {
-            if (rtsp_read_play(s) < 0) {
-                ff_rtsp_close_streams(s);
-                ff_rtsp_close_connections(s);
-                return AVERROR_INVALIDDATA;
-            }
-        }
-    }
-
-    return 0;
-}
-
-int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
-                            uint8_t *buf, int buf_size)
-{
-    RTSPState *rt = s->priv_data;
-    int id, len, i, ret;
-    RTSPStream *rtsp_st;
-
-    av_dlog(s, "tcp_read_packet:\n");
-redo:
-    for (;;) {
-        RTSPMessageHeader reply;
-
-        ret = ff_rtsp_read_reply(s, &reply, NULL, 1, NULL);
-        if (ret < 0)
-            return ret;
-        if (ret == 1) /* received '$' */
-            break;
-        /* XXX: parse message */
-        if (rt->state != RTSP_STATE_STREAMING)
-            return 0;
-    }
-    ret = ffurl_read_complete(rt->rtsp_hd, buf, 3);
-    if (ret != 3)
-        return -1;
-    id  = buf[0];
-    len = AV_RB16(buf + 1);
-    av_dlog(s, "id=%d len=%d\n", id, len);
-    if (len > buf_size || len < 12)
-        goto redo;
-    /* get the data */
-    ret = ffurl_read_complete(rt->rtsp_hd, buf, len);
-    if (ret != len)
-        return -1;
-    if (rt->transport == RTSP_TRANSPORT_RDT &&
-        ff_rdt_parse_header(buf, len, &id, NULL, NULL, NULL, NULL) < 0)
-        return -1;
-
-    /* find the matching stream */
-    for (i = 0; i < rt->nb_rtsp_streams; i++) {
-        rtsp_st = rt->rtsp_streams[i];
-        if (id >= rtsp_st->interleaved_min &&
-            id <= rtsp_st->interleaved_max)
-            goto found;
-    }
-    goto redo;
-found:
-    *prtsp_st = rtsp_st;
-    return len;
-}
-
-static int resetup_tcp(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    char host[1024];
-    int port;
-
-    av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, NULL, 0,
-                 s->filename);
-    ff_rtsp_undo_setup(s, 0);
-    return ff_rtsp_make_setup_request(s, host, port, RTSP_LOWER_TRANSPORT_TCP,
-                                      rt->real_challenge);
-}
-
-static int rtsp_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    RTSPState *rt = s->priv_data;
-    int ret;
-    RTSPMessageHeader reply1, *reply = &reply1;
-    char cmd[1024];
-
-retry:
-    if (rt->server_type == RTSP_SERVER_REAL) {
-        int i;
-
-        for (i = 0; i < s->nb_streams; i++)
-            rt->real_setup[i] = s->streams[i]->discard;
-
-        if (!rt->need_subscription) {
-            if (memcmp (rt->real_setup, rt->real_setup_cache,
-                        sizeof(enum AVDiscard) * s->nb_streams)) {
-                snprintf(cmd, sizeof(cmd),
-                         "Unsubscribe: %s\r\n",
-                         rt->last_subscription);
-                ff_rtsp_send_cmd(s, "SET_PARAMETER", rt->control_uri,
-                                 cmd, reply, NULL);
-                if (reply->status_code != RTSP_STATUS_OK)
-                    return AVERROR_INVALIDDATA;
-                rt->need_subscription = 1;
-            }
-        }
-
-        if (rt->need_subscription) {
-            int r, rule_nr, first = 1;
-
-            memcpy(rt->real_setup_cache, rt->real_setup,
-                   sizeof(enum AVDiscard) * s->nb_streams);
-            rt->last_subscription[0] = 0;
-
-            snprintf(cmd, sizeof(cmd),
-                     "Subscribe: ");
-            for (i = 0; i < rt->nb_rtsp_streams; i++) {
-                rule_nr = 0;
-                for (r = 0; r < s->nb_streams; r++) {
-                    if (s->streams[r]->id == i) {
-                        if (s->streams[r]->discard != AVDISCARD_ALL) {
-                            if (!first)
-                                av_strlcat(rt->last_subscription, ",",
-                                           sizeof(rt->last_subscription));
-                            ff_rdt_subscribe_rule(
-                                rt->last_subscription,
-                                sizeof(rt->last_subscription), i, rule_nr);
-                            first = 0;
-                        }
-                        rule_nr++;
-                    }
-                }
-            }
-            av_strlcatf(cmd, sizeof(cmd), "%s\r\n", rt->last_subscription);
-            ff_rtsp_send_cmd(s, "SET_PARAMETER", rt->control_uri,
-                             cmd, reply, NULL);
-            if (reply->status_code != RTSP_STATUS_OK)
-                return AVERROR_INVALIDDATA;
-            rt->need_subscription = 0;
-
-            if (rt->state == RTSP_STATE_STREAMING)
-                rtsp_read_play (s);
-        }
-    }
-
-    ret = ff_rtsp_fetch_packet(s, pkt);
-    if (ret < 0) {
-        if (ret == AVERROR(ETIMEDOUT) && !rt->packets) {
-            if (rt->lower_transport == RTSP_LOWER_TRANSPORT_UDP &&
-                rt->lower_transport_mask & (1 << RTSP_LOWER_TRANSPORT_TCP)) {
-                RTSPMessageHeader reply1, *reply = &reply1;
-                av_log(s, AV_LOG_WARNING, "UDP timeout, retrying with TCP\n");
-                if (rtsp_read_pause(s) != 0)
-                    return -1;
-                // TEARDOWN is required on Real-RTSP, but might make
-                // other servers close the connection.
-                if (rt->server_type == RTSP_SERVER_REAL)
-                    ff_rtsp_send_cmd(s, "TEARDOWN", rt->control_uri, NULL,
-                                     reply, NULL);
-                rt->session_id[0] = '\0';
-                if (resetup_tcp(s) == 0) {
-                    rt->state = RTSP_STATE_IDLE;
-                    rt->need_subscription = 1;
-                    if (rtsp_read_play(s) != 0)
-                        return -1;
-                    goto retry;
-                }
-            }
-        }
-        return ret;
-    }
-    rt->packets++;
-
-    if (!(rt->rtsp_flags & RTSP_FLAG_LISTEN)) {
-        /* send dummy request to keep TCP connection alive */
-        if ((av_gettime() - rt->last_cmd_time) / 1000000 >= rt->timeout / 2 ||
-            rt->auth_state.stale) {
-            if (rt->server_type == RTSP_SERVER_WMS ||
-                (rt->server_type != RTSP_SERVER_REAL &&
-                 rt->get_parameter_supported)) {
-                ff_rtsp_send_cmd_async(s, "GET_PARAMETER", rt->control_uri, NULL);
-            } else {
-                ff_rtsp_send_cmd_async(s, "OPTIONS", rt->control_uri, NULL);
-            }
-            /* The stale flag should be reset when creating the auth response in
-             * ff_rtsp_send_cmd_async, but reset it here just in case we never
-             * called the auth code (if we didn't have any credentials set). */
-            rt->auth_state.stale = 0;
-        }
-    }
-
-    return 0;
-}
-
-static int rtsp_read_seek(AVFormatContext *s, int stream_index,
-                          int64_t timestamp, int flags)
-{
-    RTSPState *rt = s->priv_data;
-
-    rt->seek_timestamp = av_rescale_q(timestamp,
-                                      s->streams[stream_index]->time_base,
-                                      AV_TIME_BASE_Q);
-    switch(rt->state) {
-    default:
-    case RTSP_STATE_IDLE:
-        break;
-    case RTSP_STATE_STREAMING:
-        if (rtsp_read_pause(s) != 0)
-            return -1;
-        rt->state = RTSP_STATE_SEEKING;
-        if (rtsp_read_play(s) != 0)
-            return -1;
-        break;
-    case RTSP_STATE_PAUSED:
-        rt->state = RTSP_STATE_IDLE;
-        break;
-    }
-    return 0;
-}
-
-static const AVClass rtsp_demuxer_class = {
-    .class_name     = "RTSP demuxer",
-    .item_name      = av_default_item_name,
-    .option         = ff_rtsp_options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_rtsp_demuxer = {
-    .name           = "rtsp",
-    .long_name      = NULL_IF_CONFIG_SMALL("RTSP input"),
-    .priv_data_size = sizeof(RTSPState),
-    .read_probe     = rtsp_probe,
-    .read_header    = rtsp_read_header,
-    .read_packet    = rtsp_read_packet,
-    .read_close     = rtsp_read_close,
-    .read_seek      = rtsp_read_seek,
-    .flags          = AVFMT_NOFILE,
-    .read_play      = rtsp_read_play,
-    .read_pause     = rtsp_read_pause,
-    .priv_class     = &rtsp_demuxer_class,
-};
diff --git a/deps/libav/libavformat/rtspenc.c b/deps/libav/libavformat/rtspenc.c
deleted file mode 100644
index 8a334ec..0000000
--- a/deps/libav/libavformat/rtspenc.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * RTSP muxer
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-
-#if HAVE_POLL_H
-#include <poll.h>
-#endif
-#include "network.h"
-#include "os_support.h"
-#include "rtsp.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/avstring.h"
-#include "libavutil/time.h"
-#include "url.h"
-
-#define SDP_MAX_SIZE 16384
-
-static const AVClass rtsp_muxer_class = {
-    .class_name = "RTSP muxer",
-    .item_name  = av_default_item_name,
-    .option     = ff_rtsp_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr)
-{
-    RTSPState *rt = s->priv_data;
-    RTSPMessageHeader reply1, *reply = &reply1;
-    int i;
-    char *sdp;
-    AVFormatContext sdp_ctx, *ctx_array[1];
-
-    s->start_time_realtime = av_gettime();
-
-    /* Announce the stream */
-    sdp = av_mallocz(SDP_MAX_SIZE);
-    if (sdp == NULL)
-        return AVERROR(ENOMEM);
-    /* We create the SDP based on the RTSP AVFormatContext where we
-     * aren't allowed to change the filename field. (We create the SDP
-     * based on the RTSP context since the contexts for the RTP streams
-     * don't exist yet.) In order to specify a custom URL with the actual
-     * peer IP instead of the originally specified hostname, we create
-     * a temporary copy of the AVFormatContext, where the custom URL is set.
-     *
-     * FIXME: Create the SDP without copying the AVFormatContext.
-     * This either requires setting up the RTP stream AVFormatContexts
-     * already here (complicating things immensely) or getting a more
-     * flexible SDP creation interface.
-     */
-    sdp_ctx = *s;
-    ff_url_join(sdp_ctx.filename, sizeof(sdp_ctx.filename),
-                "rtsp", NULL, addr, -1, NULL);
-    ctx_array[0] = &sdp_ctx;
-    if (av_sdp_create(ctx_array, 1, sdp, SDP_MAX_SIZE)) {
-        av_free(sdp);
-        return AVERROR_INVALIDDATA;
-    }
-    av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sdp);
-    ff_rtsp_send_cmd_with_content(s, "ANNOUNCE", rt->control_uri,
-                                  "Content-Type: application/sdp\r\n",
-                                  reply, NULL, sdp, strlen(sdp));
-    av_free(sdp);
-    if (reply->status_code != RTSP_STATUS_OK)
-        return AVERROR_INVALIDDATA;
-
-    /* Set up the RTSPStreams for each AVStream */
-    for (i = 0; i < s->nb_streams; i++) {
-        RTSPStream *rtsp_st;
-
-        rtsp_st = av_mallocz(sizeof(RTSPStream));
-        if (!rtsp_st)
-            return AVERROR(ENOMEM);
-        dynarray_add(&rt->rtsp_streams, &rt->nb_rtsp_streams, rtsp_st);
-
-        rtsp_st->stream_index = i;
-
-        av_strlcpy(rtsp_st->control_url, rt->control_uri, sizeof(rtsp_st->control_url));
-        /* Note, this must match the relative uri set in the sdp content */
-        av_strlcatf(rtsp_st->control_url, sizeof(rtsp_st->control_url),
-                    "/streamid=%d", i);
-    }
-
-    return 0;
-}
-
-static int rtsp_write_record(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-    RTSPMessageHeader reply1, *reply = &reply1;
-    char cmd[1024];
-
-    snprintf(cmd, sizeof(cmd),
-             "Range: npt=0.000-\r\n");
-    ff_rtsp_send_cmd(s, "RECORD", rt->control_uri, cmd, reply, NULL);
-    if (reply->status_code != RTSP_STATUS_OK)
-        return -1;
-    rt->state = RTSP_STATE_STREAMING;
-    return 0;
-}
-
-static int rtsp_write_header(AVFormatContext *s)
-{
-    int ret;
-
-    ret = ff_rtsp_connect(s);
-    if (ret)
-        return ret;
-
-    if (rtsp_write_record(s) < 0) {
-        ff_rtsp_close_streams(s);
-        ff_rtsp_close_connections(s);
-        return AVERROR_INVALIDDATA;
-    }
-    return 0;
-}
-
-int ff_rtsp_tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
-{
-    RTSPState *rt = s->priv_data;
-    AVFormatContext *rtpctx = rtsp_st->transport_priv;
-    uint8_t *buf, *ptr;
-    int size;
-    uint8_t *interleave_header, *interleaved_packet;
-
-    size = avio_close_dyn_buf(rtpctx->pb, &buf);
-    rtpctx->pb = NULL;
-    ptr = buf;
-    while (size > 4) {
-        uint32_t packet_len = AV_RB32(ptr);
-        int id;
-        /* The interleaving header is exactly 4 bytes, which happens to be
-         * the same size as the packet length header from
-         * ffio_open_dyn_packet_buf. So by writing the interleaving header
-         * over these bytes, we get a consecutive interleaved packet
-         * that can be written in one call. */
-        interleaved_packet = interleave_header = ptr;
-        ptr += 4;
-        size -= 4;
-        if (packet_len > size || packet_len < 2)
-            break;
-        if (RTP_PT_IS_RTCP(ptr[1]))
-            id = rtsp_st->interleaved_max; /* RTCP */
-        else
-            id = rtsp_st->interleaved_min; /* RTP */
-        interleave_header[0] = '$';
-        interleave_header[1] = id;
-        AV_WB16(interleave_header + 2, packet_len);
-        ffurl_write(rt->rtsp_hd_out, interleaved_packet, 4 + packet_len);
-        ptr += packet_len;
-        size -= packet_len;
-    }
-    av_free(buf);
-    return ffio_open_dyn_packet_buf(&rtpctx->pb, RTSP_TCP_MAX_PACKET_SIZE);
-}
-
-static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    RTSPState *rt = s->priv_data;
-    RTSPStream *rtsp_st;
-    int n;
-    struct pollfd p = {ffurl_get_file_handle(rt->rtsp_hd), POLLIN, 0};
-    AVFormatContext *rtpctx;
-    int ret;
-
-    while (1) {
-        n = poll(&p, 1, 0);
-        if (n <= 0)
-            break;
-        if (p.revents & POLLIN) {
-            RTSPMessageHeader reply;
-
-            /* Don't let ff_rtsp_read_reply handle interleaved packets,
-             * since it would block and wait for an RTSP reply on the socket
-             * (which may not be coming any time soon) if it handles
-             * interleaved packets internally. */
-            ret = ff_rtsp_read_reply(s, &reply, NULL, 1, NULL);
-            if (ret < 0)
-                return AVERROR(EPIPE);
-            if (ret == 1)
-                ff_rtsp_skip_packet(s);
-            /* XXX: parse message */
-            if (rt->state != RTSP_STATE_STREAMING)
-                return AVERROR(EPIPE);
-        }
-    }
-
-    if (pkt->stream_index < 0 || pkt->stream_index >= rt->nb_rtsp_streams)
-        return AVERROR_INVALIDDATA;
-    rtsp_st = rt->rtsp_streams[pkt->stream_index];
-    rtpctx = rtsp_st->transport_priv;
-
-    ret = ff_write_chained(rtpctx, 0, pkt, s);
-    /* ff_write_chained does all the RTP packetization. If using TCP as
-     * transport, rtpctx->pb is only a dyn_packet_buf that queues up the
-     * packets, so we need to send them out on the TCP connection separately.
-     */
-    if (!ret && rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP)
-        ret = ff_rtsp_tcp_write_packet(s, rtsp_st);
-    return ret;
-}
-
-static int rtsp_write_close(AVFormatContext *s)
-{
-    RTSPState *rt = s->priv_data;
-
-    // If we want to send RTCP_BYE packets, these are sent by av_write_trailer.
-    // Thus call this on all streams before doing the teardown. This is
-    // done within ff_rtsp_undo_setup.
-    ff_rtsp_undo_setup(s, 1);
-
-    ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL);
-
-    ff_rtsp_close_streams(s);
-    ff_rtsp_close_connections(s);
-    ff_network_close();
-    return 0;
-}
-
-AVOutputFormat ff_rtsp_muxer = {
-    .name              = "rtsp",
-    .long_name         = NULL_IF_CONFIG_SMALL("RTSP output"),
-    .priv_data_size    = sizeof(RTSPState),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_MPEG4,
-    .write_header      = rtsp_write_header,
-    .write_packet      = rtsp_write_packet,
-    .write_trailer     = rtsp_write_close,
-    .flags             = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
-    .priv_class        = &rtsp_muxer_class,
-};
diff --git a/deps/libav/libavformat/sapdec.c b/deps/libav/libavformat/sapdec.c
deleted file mode 100644
index 0280cea..0000000
--- a/deps/libav/libavformat/sapdec.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Session Announcement Protocol (RFC 2974) demuxer
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "libavutil/avstring.h"
-#include "libavutil/intreadwrite.h"
-#include "network.h"
-#include "os_support.h"
-#include "internal.h"
-#include "avio_internal.h"
-#include "url.h"
-#include "rtpdec.h"
-#if HAVE_POLL_H
-#include <poll.h>
-#endif
-
-struct SAPState {
-    URLContext *ann_fd;
-    AVFormatContext *sdp_ctx;
-    AVIOContext sdp_pb;
-    uint16_t hash;
-    char *sdp;
-    int eof;
-};
-
-static int sap_probe(AVProbeData *p)
-{
-    if (av_strstart(p->filename, "sap:", NULL))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int sap_read_close(AVFormatContext *s)
-{
-    struct SAPState *sap = s->priv_data;
-    if (sap->sdp_ctx)
-        avformat_close_input(&sap->sdp_ctx);
-    if (sap->ann_fd)
-        ffurl_close(sap->ann_fd);
-    av_freep(&sap->sdp);
-    ff_network_close();
-    return 0;
-}
-
-static int sap_read_header(AVFormatContext *s)
-{
-    struct SAPState *sap = s->priv_data;
-    char host[1024], path[1024], url[1024];
-    uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-    int port;
-    int ret, i;
-    AVInputFormat* infmt;
-
-    if (!ff_network_init())
-        return AVERROR(EIO);
-
-    av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port,
-                 path, sizeof(path), s->filename);
-    if (port < 0)
-        port = 9875;
-
-    if (!host[0]) {
-        /* Listen for announcements on sap.mcast.net if no host was specified */
-        av_strlcpy(host, "224.2.127.254", sizeof(host));
-    }
-
-    ff_url_join(url, sizeof(url), "udp", NULL, host, port, "?localport=%d",
-                port);
-    ret = ffurl_open(&sap->ann_fd, url, AVIO_FLAG_READ,
-                     &s->interrupt_callback, NULL);
-    if (ret)
-        goto fail;
-
-    while (1) {
-        int addr_type, auth_len;
-        int pos;
-
-        ret = ffurl_read(sap->ann_fd, recvbuf, sizeof(recvbuf) - 1);
-        if (ret == AVERROR(EAGAIN))
-            continue;
-        if (ret < 0)
-            goto fail;
-        recvbuf[ret] = '\0'; /* Null terminate for easier parsing */
-        if (ret < 8) {
-            av_log(s, AV_LOG_WARNING, "Received too short packet\n");
-            continue;
-        }
-
-        if ((recvbuf[0] & 0xe0) != 0x20) {
-            av_log(s, AV_LOG_WARNING, "Unsupported SAP version packet "
-                                      "received\n");
-            continue;
-        }
-
-        if (recvbuf[0] & 0x04) {
-            av_log(s, AV_LOG_WARNING, "Received stream deletion "
-                                      "announcement\n");
-            continue;
-        }
-        addr_type = recvbuf[0] & 0x10;
-        auth_len  = recvbuf[1];
-        sap->hash = AV_RB16(&recvbuf[2]);
-        pos = 4;
-        if (addr_type)
-            pos += 16; /* IPv6 */
-        else
-            pos += 4; /* IPv4 */
-        pos += auth_len * 4;
-        if (pos + 4 >= ret) {
-            av_log(s, AV_LOG_WARNING, "Received too short packet\n");
-            continue;
-        }
-#define MIME "application/sdp"
-        if (strcmp(&recvbuf[pos], MIME) == 0) {
-            pos += strlen(MIME) + 1;
-        } else if (strncmp(&recvbuf[pos], "v=0\r\n", 5) == 0) {
-            // Direct SDP without a mime type
-        } else {
-            av_log(s, AV_LOG_WARNING, "Unsupported mime type %s\n",
-                                      &recvbuf[pos]);
-            continue;
-        }
-
-        sap->sdp = av_strdup(&recvbuf[pos]);
-        break;
-    }
-
-    av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", sap->sdp);
-    ffio_init_context(&sap->sdp_pb, sap->sdp, strlen(sap->sdp), 0, NULL, NULL,
-                  NULL, NULL);
-
-    infmt = av_find_input_format("sdp");
-    if (!infmt)
-        goto fail;
-    sap->sdp_ctx = avformat_alloc_context();
-    if (!sap->sdp_ctx) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-    sap->sdp_ctx->max_delay = s->max_delay;
-    sap->sdp_ctx->pb        = &sap->sdp_pb;
-    sap->sdp_ctx->interrupt_callback = s->interrupt_callback;
-    ret = avformat_open_input(&sap->sdp_ctx, "temp.sdp", infmt, NULL);
-    if (ret < 0)
-        goto fail;
-    if (sap->sdp_ctx->ctx_flags & AVFMTCTX_NOHEADER)
-        s->ctx_flags |= AVFMTCTX_NOHEADER;
-    for (i = 0; i < sap->sdp_ctx->nb_streams; i++) {
-        AVStream *st = avformat_new_stream(s, NULL);
-        if (!st) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        st->id = i;
-        avcodec_copy_context(st->codec, sap->sdp_ctx->streams[i]->codec);
-        st->time_base = sap->sdp_ctx->streams[i]->time_base;
-    }
-
-    return 0;
-
-fail:
-    sap_read_close(s);
-    return ret;
-}
-
-static int sap_fetch_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    struct SAPState *sap = s->priv_data;
-    int fd = ffurl_get_file_handle(sap->ann_fd);
-    int n, ret;
-    struct pollfd p = {fd, POLLIN, 0};
-    uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
-
-    if (sap->eof)
-        return AVERROR_EOF;
-
-    while (1) {
-        n = poll(&p, 1, 0);
-        if (n <= 0 || !(p.revents & POLLIN))
-            break;
-        ret = ffurl_read(sap->ann_fd, recvbuf, sizeof(recvbuf));
-        if (ret >= 8) {
-            uint16_t hash = AV_RB16(&recvbuf[2]);
-            /* Should ideally check the source IP address, too */
-            if (recvbuf[0] & 0x04 && hash == sap->hash) {
-                /* Stream deletion */
-                sap->eof = 1;
-                return AVERROR_EOF;
-            }
-        }
-    }
-    ret = av_read_frame(sap->sdp_ctx, pkt);
-    if (ret < 0)
-        return ret;
-    if (s->ctx_flags & AVFMTCTX_NOHEADER) {
-        while (sap->sdp_ctx->nb_streams > s->nb_streams) {
-            int i = s->nb_streams;
-            AVStream *st = avformat_new_stream(s, NULL);
-            if (!st) {
-                av_free_packet(pkt);
-                return AVERROR(ENOMEM);
-            }
-            st->id = i;
-            avcodec_copy_context(st->codec, sap->sdp_ctx->streams[i]->codec);
-            st->time_base = sap->sdp_ctx->streams[i]->time_base;
-        }
-    }
-    return ret;
-}
-
-AVInputFormat ff_sap_demuxer = {
-    .name           = "sap",
-    .long_name      = NULL_IF_CONFIG_SMALL("SAP input"),
-    .priv_data_size = sizeof(struct SAPState),
-    .read_probe     = sap_probe,
-    .read_header    = sap_read_header,
-    .read_packet    = sap_fetch_packet,
-    .read_close     = sap_read_close,
-    .flags          = AVFMT_NOFILE,
-};
diff --git a/deps/libav/libavformat/sapenc.c b/deps/libav/libavformat/sapenc.c
deleted file mode 100644
index 7e2bba7..0000000
--- a/deps/libav/libavformat/sapenc.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Session Announcement Protocol (RFC 2974) muxer
- * Copyright (c) 2010 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/random_seed.h"
-#include "libavutil/avstring.h"
-#include "libavutil/dict.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/time.h"
-#include "internal.h"
-#include "network.h"
-#include "os_support.h"
-#include "rtpenc_chain.h"
-#include "url.h"
-
-struct SAPState {
-    uint8_t    *ann;
-    int         ann_size;
-    URLContext *ann_fd;
-    int64_t     last_time;
-};
-
-static int sap_write_close(AVFormatContext *s)
-{
-    struct SAPState *sap = s->priv_data;
-    int i;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVFormatContext *rtpctx = s->streams[i]->priv_data;
-        if (!rtpctx)
-            continue;
-        av_write_trailer(rtpctx);
-        avio_close(rtpctx->pb);
-        avformat_free_context(rtpctx);
-        s->streams[i]->priv_data = NULL;
-    }
-
-    if (sap->last_time && sap->ann && sap->ann_fd) {
-        sap->ann[0] |= 4; /* Session deletion*/
-        ffurl_write(sap->ann_fd, sap->ann, sap->ann_size);
-    }
-
-    av_freep(&sap->ann);
-    if (sap->ann_fd)
-        ffurl_close(sap->ann_fd);
-    ff_network_close();
-    return 0;
-}
-
-static int sap_write_header(AVFormatContext *s)
-{
-    struct SAPState *sap = s->priv_data;
-    char host[1024], path[1024], url[1024], announce_addr[50] = "";
-    char *option_list;
-    int port = 9875, base_port = 5004, i, pos = 0, same_port = 0, ttl = 255;
-    AVFormatContext **contexts = NULL;
-    int ret = 0;
-    struct sockaddr_storage localaddr;
-    socklen_t addrlen = sizeof(localaddr);
-    int udp_fd;
-    AVDictionaryEntry* title = av_dict_get(s->metadata, "title", NULL, 0);
-
-    if (!ff_network_init())
-        return AVERROR(EIO);
-
-    /* extract hostname and port */
-    av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &base_port,
-                 path, sizeof(path), s->filename);
-    if (base_port < 0)
-        base_port = 5004;
-
-    /* search for options */
-    option_list = strrchr(path, '?');
-    if (option_list) {
-        char buf[50];
-        if (av_find_info_tag(buf, sizeof(buf), "announce_port", option_list)) {
-            port = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "same_port", option_list)) {
-            same_port = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "ttl", option_list)) {
-            ttl = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "announce_addr", option_list)) {
-            av_strlcpy(announce_addr, buf, sizeof(announce_addr));
-        }
-    }
-
-    if (!announce_addr[0]) {
-        struct addrinfo hints = { 0 }, *ai = NULL;
-        hints.ai_family = AF_UNSPEC;
-        if (getaddrinfo(host, NULL, &hints, &ai)) {
-            av_log(s, AV_LOG_ERROR, "Unable to resolve %s\n", host);
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        if (ai->ai_family == AF_INET) {
-            /* Also known as sap.mcast.net */
-            av_strlcpy(announce_addr, "224.2.127.254", sizeof(announce_addr));
-#if HAVE_STRUCT_SOCKADDR_IN6
-        } else if (ai->ai_family == AF_INET6) {
-            /* With IPv6, you can use the same destination in many different
-             * multicast subnets, to choose how far you want it routed.
-             * This one is intended to be routed globally. */
-            av_strlcpy(announce_addr, "ff0e::2:7ffe", sizeof(announce_addr));
-#endif
-        } else {
-            freeaddrinfo(ai);
-            av_log(s, AV_LOG_ERROR, "Host %s resolved to unsupported "
-                                    "address family\n", host);
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        freeaddrinfo(ai);
-    }
-
-    contexts = av_mallocz(sizeof(AVFormatContext*) * s->nb_streams);
-    if (!contexts) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    s->start_time_realtime = av_gettime();
-    for (i = 0; i < s->nb_streams; i++) {
-        URLContext *fd;
-
-        ff_url_join(url, sizeof(url), "rtp", NULL, host, base_port,
-                    "?ttl=%d", ttl);
-        if (!same_port)
-            base_port += 2;
-        ret = ffurl_open(&fd, url, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL);
-        if (ret) {
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        ret = ff_rtp_chain_mux_open(&contexts[i], s, s->streams[i], fd, 0, i);
-        if (ret < 0)
-            goto fail;
-        s->streams[i]->priv_data = contexts[i];
-        av_strlcpy(contexts[i]->filename, url, sizeof(contexts[i]->filename));
-    }
-
-    if (s->nb_streams > 0 && title)
-        av_dict_set(&contexts[0]->metadata, "title", title->value, 0);
-
-    ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port,
-                "?ttl=%d&connect=1", ttl);
-    ret = ffurl_open(&sap->ann_fd, url, AVIO_FLAG_WRITE,
-                     &s->interrupt_callback, NULL);
-    if (ret) {
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-
-    udp_fd = ffurl_get_file_handle(sap->ann_fd);
-    if (getsockname(udp_fd, (struct sockaddr*) &localaddr, &addrlen)) {
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-    if (localaddr.ss_family != AF_INET
-#if HAVE_STRUCT_SOCKADDR_IN6
-        && localaddr.ss_family != AF_INET6
-#endif
-        ) {
-        av_log(s, AV_LOG_ERROR, "Unsupported protocol family\n");
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-    sap->ann_size = 8192;
-    sap->ann = av_mallocz(sap->ann_size);
-    if (!sap->ann) {
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-    sap->ann[pos] = (1 << 5);
-#if HAVE_STRUCT_SOCKADDR_IN6
-    if (localaddr.ss_family == AF_INET6)
-        sap->ann[pos] |= 0x10;
-#endif
-    pos++;
-    sap->ann[pos++] = 0; /* Authentication length */
-    AV_WB16(&sap->ann[pos], av_get_random_seed());
-    pos += 2;
-    if (localaddr.ss_family == AF_INET) {
-        memcpy(&sap->ann[pos], &((struct sockaddr_in*)&localaddr)->sin_addr,
-               sizeof(struct in_addr));
-        pos += sizeof(struct in_addr);
-#if HAVE_STRUCT_SOCKADDR_IN6
-    } else {
-        memcpy(&sap->ann[pos], &((struct sockaddr_in6*)&localaddr)->sin6_addr,
-               sizeof(struct in6_addr));
-        pos += sizeof(struct in6_addr);
-#endif
-    }
-
-    av_strlcpy(&sap->ann[pos], "application/sdp", sap->ann_size - pos);
-    pos += strlen(&sap->ann[pos]) + 1;
-
-    if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos],
-                      sap->ann_size - pos)) {
-        ret = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-    av_freep(&contexts);
-    av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", &sap->ann[pos]);
-    pos += strlen(&sap->ann[pos]);
-    sap->ann_size = pos;
-
-    if (sap->ann_size > sap->ann_fd->max_packet_size) {
-        av_log(s, AV_LOG_ERROR, "Announcement too large to send in one "
-                                "packet\n");
-        goto fail;
-    }
-
-    return 0;
-
-fail:
-    av_free(contexts);
-    sap_write_close(s);
-    return ret;
-}
-
-static int sap_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVFormatContext *rtpctx;
-    struct SAPState *sap = s->priv_data;
-    int64_t now = av_gettime();
-
-    if (!sap->last_time || now - sap->last_time > 5000000) {
-        int ret = ffurl_write(sap->ann_fd, sap->ann, sap->ann_size);
-        /* Don't abort even if we get "Destination unreachable" */
-        if (ret < 0 && ret != AVERROR(ECONNREFUSED))
-            return ret;
-        sap->last_time = now;
-    }
-    rtpctx = s->streams[pkt->stream_index]->priv_data;
-    return ff_write_chained(rtpctx, 0, pkt, s);
-}
-
-AVOutputFormat ff_sap_muxer = {
-    .name              = "sap",
-    .long_name         = NULL_IF_CONFIG_SMALL("SAP output"),
-    .priv_data_size    = sizeof(struct SAPState),
-    .audio_codec       = AV_CODEC_ID_AAC,
-    .video_codec       = AV_CODEC_ID_MPEG4,
-    .write_header      = sap_write_header,
-    .write_packet      = sap_write_packet,
-    .write_trailer     = sap_write_close,
-    .flags             = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
-};
diff --git a/deps/libav/libavformat/sauce.c b/deps/libav/libavformat/sauce.c
deleted file mode 100644
index a125241..0000000
--- a/deps/libav/libavformat/sauce.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * SAUCE header parser
- * Copyright (c) 2010 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * SAUCE header parser
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "sauce.h"
-
-int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height)
-{
-    AVIOContext *pb = avctx->pb;
-    char buf[36];
-    int datatype, filetype, t1, t2, nb_comments;
-    uint64_t start_pos = avio_size(pb) - 128;
-
-    avio_seek(pb, start_pos, SEEK_SET);
-    if (avio_read(pb, buf, 7) != 7)
-        return -1;
-    if (memcmp(buf, "SAUCE00", 7))
-        return -1;
-
-#define GET_SAUCE_META(name,size) \
-    if (avio_read(pb, buf, size) == size && buf[0]) { \
-        buf[size] = 0; \
-        av_dict_set(&avctx->metadata, name, buf, 0); \
-    }
-
-    GET_SAUCE_META("title",     35)
-    GET_SAUCE_META("artist",    20)
-    GET_SAUCE_META("publisher", 20)
-    GET_SAUCE_META("date",      8)
-    avio_skip(pb, 4);
-    datatype    = avio_r8(pb);
-    filetype    = avio_r8(pb);
-    t1          = avio_rl16(pb);
-    t2          = avio_rl16(pb);
-    nb_comments = avio_r8(pb);
-    avio_skip(pb, 1); /* flags */
-    avio_skip(pb, 4);
-    GET_SAUCE_META("encoder",   22);
-
-    if (got_width && datatype && filetype) {
-        if ((datatype == 1 && filetype <=2) || (datatype == 5 && filetype == 255) || datatype == 6) {
-            if (t1) {
-                avctx->streams[0]->codec->width = t1<<3;
-                *got_width = 1;
-            }
-            if (get_height && t2)
-                avctx->streams[0]->codec->height = t2<<4;
-        } else if (datatype == 5) {
-            if (filetype > 1) {
-                avctx->streams[0]->codec->width = (filetype == 1 ? t1 : filetype) << 4;
-                *got_width = 1;
-            }
-            if (get_height && t2)
-                avctx->streams[0]->codec->height = t2<<4;
-        }
-    }
-
-    *fsize -= 128;
-
-    if (nb_comments > 0) {
-        avio_seek(pb, start_pos - 64*nb_comments - 5, SEEK_SET);
-        if (avio_read(pb, buf, 5) == 5 && !memcmp(buf, "COMNT", 5)) {
-            int i;
-            char *str = av_malloc(65*nb_comments + 1);
-            *fsize -= 64*nb_comments + 5;
-            if (!str)
-                return 0;
-            for (i = 0; i < nb_comments; i++) {
-                if (avio_read(pb, str + 65*i, 64) != 64)
-                    break;
-                str[65*i + 64] = '\n';
-            }
-            str[65*i] = 0;
-            av_dict_set(&avctx->metadata, "comment", str, AV_DICT_DONT_STRDUP_VAL);
-        }
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/sauce.h b/deps/libav/libavformat/sauce.h
deleted file mode 100644
index 62d8e68..0000000
--- a/deps/libav/libavformat/sauce.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SAUCE header parser
- * Copyright (c) 2010 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * SAUCE header parser
- */
-
-#ifndef AVFORMAT_SAUCE_H
-#define AVFORMAT_SAUCE_H
-
-#include "avformat.h"
-
-/**
- * @param avctx AVFormatContext
- * @param[out] fsize return length of file, less SAUCE header
- * @param[out] got_width set to non-zero if SAUCE header reported height
- * @param get_height Tell SAUCE header to parse height
- */
-int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height);
-
-#endif /* AVFORMAT_SAUCE_H */
diff --git a/deps/libav/libavformat/sctp.c b/deps/libav/libavformat/sctp.c
deleted file mode 100644
index 66b31cc..0000000
--- a/deps/libav/libavformat/sctp.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * SCTP protocol
- * Copyright (c) 2012 Luca Barbato
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- *
- * sctp url_protocol
- *
- * url syntax: sctp://host:port[?option=val...]
- * option: 'listen'        : listen for an incoming connection
- *         'max_streams=n' : set the maximum number of streams
- *         'reuse=1'       : enable reusing the socket [TBD]
- *
- * by setting the maximum number of streams the protocol will use the
- * first two bytes of the incoming/outgoing buffer to store the
- * stream number of the packet being read/written.
- * @see sctp_read
- * @see sctp_write
- */
-
-
-#include <netinet/in.h>
-#include <netinet/sctp.h>
-
-#include "config.h"
-
-#if HAVE_POLL_H
-#include <poll.h>
-#endif
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/parseutils.h"
-#include "avformat.h"
-#include "internal.h"
-#include "network.h"
-#include "os_support.h"
-#include "url.h"
-
-/*
- * The sctp_recvmsg and sctp_sendmsg functions are part of the user
- * library that offers support for the SCTP kernel Implementation.
- * To avoid build-time clashes the functions sport an ff_-prefix here.
- * The main purpose of this code is to provide the SCTP Socket API
- * mappings for user applications to interface with SCTP in the kernel.
- *
- * This implementation is based on the Socket API Extensions for SCTP
- * defined in <draft-ietf-tsvwg-sctpsocket-10.txt>
- *
- * Copyright (c) 2003 International Business Machines, Corp.
- *
- * Written or modified by:
- *  Ryan Layer <rmlayer at us.ibm.com>
- */
-
-static int ff_sctp_recvmsg(int s, void *msg, size_t len, struct sockaddr *from,
-                           socklen_t *fromlen, struct sctp_sndrcvinfo *sinfo,
-                           int *msg_flags)
-{
-    int recvb;
-    struct iovec iov;
-    char incmsg[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))];
-    struct msghdr inmsg  = { 0 };
-    struct cmsghdr *cmsg = NULL;
-
-    iov.iov_base = msg;
-    iov.iov_len  = len;
-
-    inmsg.msg_name       = from;
-    inmsg.msg_namelen    = fromlen ? *fromlen : 0;
-    inmsg.msg_iov        = &iov;
-    inmsg.msg_iovlen     = 1;
-    inmsg.msg_control    = incmsg;
-    inmsg.msg_controllen = sizeof(incmsg);
-
-    if ((recvb = recvmsg(s, &inmsg, msg_flags ? *msg_flags : 0)) < 0)
-        return recvb;
-
-    if (fromlen)
-        *fromlen   = inmsg.msg_namelen;
-    if (msg_flags)
-        *msg_flags = inmsg.msg_flags;
-
-    for (cmsg = CMSG_FIRSTHDR(&inmsg); cmsg != NULL;
-         cmsg = CMSG_NXTHDR(&inmsg, cmsg)) {
-        if ((IPPROTO_SCTP == cmsg->cmsg_level) &&
-            (SCTP_SNDRCV  == cmsg->cmsg_type))
-            break;
-    }
-
-    /* Copy sinfo. */
-    if (cmsg)
-        memcpy(sinfo, CMSG_DATA(cmsg), sizeof(struct sctp_sndrcvinfo));
-
-    return recvb;
-}
-
-static int ff_sctp_send(int s, const void *msg, size_t len,
-                        const struct sctp_sndrcvinfo *sinfo, int flags)
-{
-    struct msghdr outmsg;
-    struct iovec iov;
-
-    outmsg.msg_name       = NULL;
-    outmsg.msg_namelen    = 0;
-    outmsg.msg_iov        = &iov;
-    iov.iov_base          = msg;
-    iov.iov_len           = len;
-    outmsg.msg_iovlen     = 1;
-    outmsg.msg_controllen = 0;
-
-    if (sinfo) {
-        char outcmsg[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))];
-        struct cmsghdr *cmsg;
-
-        outmsg.msg_control    = outcmsg;
-        outmsg.msg_controllen = sizeof(outcmsg);
-        outmsg.msg_flags      = 0;
-
-        cmsg             = CMSG_FIRSTHDR(&outmsg);
-        cmsg->cmsg_level = IPPROTO_SCTP;
-        cmsg->cmsg_type  = SCTP_SNDRCV;
-        cmsg->cmsg_len   = CMSG_LEN(sizeof(struct sctp_sndrcvinfo));
-
-        outmsg.msg_controllen = cmsg->cmsg_len;
-        memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo));
-    }
-
-    return sendmsg(s, &outmsg, flags);
-}
-
-typedef struct SCTPContext {
-    int fd;
-    int max_streams;
-    struct sockaddr_storage dest_addr;
-    socklen_t dest_addr_len;
-} SCTPContext;
-
-static int sctp_open(URLContext *h, const char *uri, int flags)
-{
-    struct addrinfo *ai, *cur_ai;
-    struct addrinfo hints             = { 0 };
-    struct sctp_event_subscribe event = { 0 };
-    struct sctp_initmsg initparams    = { 0 };
-    int port;
-    int fd         = -1;
-    SCTPContext *s = h->priv_data;
-    const char *p;
-    char buf[256];
-    int ret, listen_socket = 0;
-    char hostname[1024], proto[1024], path[1024];
-    char portstr[10];
-
-    av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
-                 &port, path, sizeof(path), uri);
-    if (strcmp(proto, "sctp"))
-        return AVERROR(EINVAL);
-    if (port <= 0 || port >= 65536) {
-        av_log(s, AV_LOG_ERROR, "Port missing in uri\n");
-        return AVERROR(EINVAL);
-    }
-
-    s->max_streams = 0;
-    p = strchr(uri, '?');
-    if (p) {
-        if (av_find_info_tag(buf, sizeof(buf), "listen", p))
-            listen_socket = 1;
-        if (av_find_info_tag(buf, sizeof(buf), "max_streams", p))
-            s->max_streams = strtol(buf, NULL, 10);
-    }
-
-    hints.ai_family   = AF_UNSPEC;
-    hints.ai_socktype = SOCK_STREAM;
-    snprintf(portstr, sizeof(portstr), "%d", port);
-    ret = getaddrinfo(hostname, portstr, &hints, &ai);
-    if (ret) {
-        av_log(h, AV_LOG_ERROR, "Failed to resolve hostname %s: %s\n",
-               hostname, gai_strerror(ret));
-        return AVERROR(EIO);
-    }
-
-    cur_ai = ai;
-
-    fd = ff_socket(cur_ai->ai_family, SOCK_STREAM, IPPROTO_SCTP);
-    if (fd < 0)
-        goto fail;
-
-    s->dest_addr_len = sizeof(s->dest_addr);
-
-    if (listen_socket) {
-        int fd1;
-        ret = bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);
-        listen(fd, 100);
-        fd1 = accept(fd, NULL, NULL);
-        closesocket(fd);
-        fd  = fd1;
-    } else
-        ret = connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);
-
-    ff_socket_nonblock(fd, 1);
-
-    event.sctp_data_io_event = 1;
-    /* TODO: Subscribe to more event types and handle them */
-
-    if (setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS, &event,
-                   sizeof(event)) != 0) {
-        av_log(h, AV_LOG_ERROR,
-               "SCTP ERROR: Unable to subscribe to events\n");
-        goto fail;
-    }
-
-    if (s->max_streams) {
-        initparams.sinit_max_instreams = s->max_streams;
-        initparams.sinit_num_ostreams  = s->max_streams;
-        if (setsockopt(fd, IPPROTO_SCTP, SCTP_INITMSG, &initparams,
-                       sizeof(initparams)) < 0)
-            av_log(h, AV_LOG_ERROR,
-                   "SCTP ERROR: Unable to initialize socket max streams %d\n",
-                   s->max_streams);
-    }
-
-    h->priv_data   = s;
-    h->is_streamed = 1;
-    s->fd          = fd;
-    freeaddrinfo(ai);
-    return 0;
-
-fail:
-    ret = AVERROR(EIO);
-    freeaddrinfo(ai);
-    return ret;
-}
-
-static int sctp_wait_fd(int fd, int write)
-{
-    int ev          = write ? POLLOUT : POLLIN;
-    struct pollfd p = { .fd = fd, .events = ev, .revents = 0 };
-    int ret;
-
-    ret = poll(&p, 1, 100);
-    return ret < 0 ? ff_neterrno() : p.revents & ev ? 0 : AVERROR(EAGAIN);
-}
-
-static int sctp_read(URLContext *h, uint8_t *buf, int size)
-{
-    SCTPContext *s = h->priv_data;
-    int ret;
-
-    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
-        ret = sctp_wait_fd(s->fd, 0);
-        if (ret < 0)
-            return ret;
-    }
-
-    if (s->max_streams) {
-        /*StreamId is introduced as a 2byte code into the stream*/
-        struct sctp_sndrcvinfo info = { 0 };
-        ret = ff_sctp_recvmsg(s->fd, buf + 2, size - 2, NULL, 0, &info, 0);
-        AV_WB16(buf, info.sinfo_stream);
-        ret = ret < 0 ? ret : ret + 2;
-    } else
-        ret = recv(s->fd, buf, size, 0);
-
-    return ret < 0 ? ff_neterrno() : ret;
-}
-
-static int sctp_write(URLContext *h, const uint8_t *buf, int size)
-{
-    SCTPContext *s = h->priv_data;
-    int ret;
-
-    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
-        ret = sctp_wait_fd(s->fd, 1);
-        if (ret < 0)
-            return ret;
-    }
-
-    if (s->max_streams) {
-        /*StreamId is introduced as a 2byte code into the stream*/
-        struct sctp_sndrcvinfo info = { 0 };
-        info.sinfo_stream           = AV_RB16(buf);
-        if (info.sinfo_stream > s->max_streams)
-            abort();
-        ret = ff_sctp_send(s->fd, buf + 2, size - 2, &info, MSG_EOR);
-    } else
-        ret = send(s->fd, buf, size, 0);
-
-    return ret < 0 ? ff_neterrno() : ret;
-}
-
-static int sctp_close(URLContext *h)
-{
-    SCTPContext *s = h->priv_data;
-    closesocket(s->fd);
-    return 0;
-}
-
-static int sctp_get_file_handle(URLContext *h)
-{
-    SCTPContext *s = h->priv_data;
-    return s->fd;
-}
-
-URLProtocol ff_sctp_protocol = {
-    .name                = "sctp",
-    .url_open            = sctp_open,
-    .url_read            = sctp_read,
-    .url_write           = sctp_write,
-    .url_close           = sctp_close,
-    .url_get_file_handle = sctp_get_file_handle,
-    .priv_data_size      = sizeof(SCTPContext),
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/sdp.c b/deps/libav/libavformat/sdp.c
deleted file mode 100644
index 895b9d6..0000000
--- a/deps/libav/libavformat/sdp.c
+++ /dev/null
@@ -1,699 +0,0 @@
-/*
- * copyright (c) 2007 Luca Abeni
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-#include "libavutil/avstring.h"
-#include "libavutil/base64.h"
-#include "libavutil/dict.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/opt.h"
-#include "libavcodec/xiph.h"
-#include "libavcodec/mpeg4audio.h"
-#include "avformat.h"
-#include "internal.h"
-#include "avc.h"
-#include "rtp.h"
-#if CONFIG_NETWORK
-#include "network.h"
-#endif
-
-#if CONFIG_RTP_MUXER
-#define MAX_EXTRADATA_SIZE ((INT_MAX - 10) / 2)
-
-struct sdp_session_level {
-    int sdp_version;      /**< protocol version (currently 0) */
-    int id;               /**< session ID */
-    int version;          /**< session version */
-    int start_time;       /**< session start time (NTP time, in seconds),
-                               or 0 in case of permanent session */
-    int end_time;         /**< session end time (NTP time, in seconds),
-                               or 0 if the session is not bounded */
-    int ttl;              /**< TTL, in case of multicast stream */
-    const char *user;     /**< username of the session's creator */
-    const char *src_addr; /**< IP address of the machine from which the session was created */
-    const char *src_type; /**< address type of src_addr */
-    const char *dst_addr; /**< destination IP address (can be multicast) */
-    const char *dst_type; /**< destination IP address type */
-    const char *name;     /**< session name (can be an empty string) */
-};
-
-static void sdp_write_address(char *buff, int size, const char *dest_addr,
-                              const char *dest_type, int ttl)
-{
-    if (dest_addr) {
-        if (!dest_type)
-            dest_type = "IP4";
-        if (ttl > 0 && !strcmp(dest_type, "IP4")) {
-            /* The TTL should only be specified for IPv4 multicast addresses,
-             * not for IPv6. */
-            av_strlcatf(buff, size, "c=IN %s %s/%d\r\n", dest_type, dest_addr, ttl);
-        } else {
-            av_strlcatf(buff, size, "c=IN %s %s\r\n", dest_type, dest_addr);
-        }
-    }
-}
-
-static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)
-{
-    av_strlcatf(buff, size, "v=%d\r\n"
-                            "o=- %d %d IN %s %s\r\n"
-                            "s=%s\r\n",
-                            s->sdp_version,
-                            s->id, s->version, s->src_type, s->src_addr,
-                            s->name);
-    sdp_write_address(buff, size, s->dst_addr, s->dst_type, s->ttl);
-    av_strlcatf(buff, size, "t=%d %d\r\n"
-                            "a=tool:libavformat " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n",
-                            s->start_time, s->end_time);
-}
-
-#if CONFIG_NETWORK
-static int resolve_destination(char *dest_addr, int size, char *type,
-                               int type_size)
-{
-    struct addrinfo hints = { 0 }, *ai;
-    int is_multicast;
-
-    av_strlcpy(type, "IP4", type_size);
-    if (!dest_addr[0])
-        return 0;
-
-    /* Resolve the destination, since it must be written
-     * as a numeric IP address in the SDP. */
-
-    if (getaddrinfo(dest_addr, NULL, &hints, &ai))
-        return 0;
-    getnameinfo(ai->ai_addr, ai->ai_addrlen, dest_addr, size,
-                NULL, 0, NI_NUMERICHOST);
-#ifdef AF_INET6
-    if (ai->ai_family == AF_INET6)
-        av_strlcpy(type, "IP6", type_size);
-#endif
-    is_multicast = ff_is_multicast_address(ai->ai_addr);
-    freeaddrinfo(ai);
-    return is_multicast;
-}
-#else
-static int resolve_destination(char *dest_addr, int size, char *type,
-                               int type_size)
-{
-    return 0;
-}
-#endif
-
-static int sdp_get_address(char *dest_addr, int size, int *ttl, const char *url)
-{
-    int port;
-    const char *p;
-    char proto[32];
-
-    av_url_split(proto, sizeof(proto), NULL, 0, dest_addr, size, &port, NULL, 0, url);
-
-    *ttl = 0;
-
-    if (strcmp(proto, "rtp") && strcmp(proto, "srtp")) {
-        /* The url isn't for the actual rtp sessions,
-         * don't parse out anything else than the destination.
-         */
-        return 0;
-    }
-
-    p = strchr(url, '?');
-    if (p) {
-        char buff[64];
-
-        if (av_find_info_tag(buff, sizeof(buff), "ttl", p)) {
-            *ttl = strtol(buff, NULL, 10);
-        } else {
-            *ttl = 5;
-        }
-    }
-
-    return port;
-}
-
-#define MAX_PSET_SIZE 1024
-static char *extradata2psets(AVCodecContext *c)
-{
-    char *psets, *p;
-    const uint8_t *r;
-    static const char pset_string[] = "; sprop-parameter-sets=";
-    static const char profile_string[] = "; profile-level-id=";
-    uint8_t *orig_extradata = NULL;
-    int orig_extradata_size = 0;
-    const uint8_t *sps = NULL, *sps_end;
-
-    if (c->extradata_size > MAX_EXTRADATA_SIZE) {
-        av_log(c, AV_LOG_ERROR, "Too much extradata!\n");
-
-        return NULL;
-    }
-    if (c->extradata[0] == 1) {
-        uint8_t *dummy_p;
-        int dummy_int;
-        AVBitStreamFilterContext *bsfc= av_bitstream_filter_init("h264_mp4toannexb");
-
-        if (!bsfc) {
-            av_log(c, AV_LOG_ERROR, "Cannot open the h264_mp4toannexb BSF!\n");
-
-            return NULL;
-        }
-
-        orig_extradata_size = c->extradata_size;
-        orig_extradata = av_mallocz(orig_extradata_size +
-                                    FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!orig_extradata) {
-            av_bitstream_filter_close(bsfc);
-            return NULL;
-        }
-        memcpy(orig_extradata, c->extradata, orig_extradata_size);
-        av_bitstream_filter_filter(bsfc, c, NULL, &dummy_p, &dummy_int, NULL, 0, 0);
-        av_bitstream_filter_close(bsfc);
-    }
-
-    psets = av_mallocz(MAX_PSET_SIZE);
-    if (psets == NULL) {
-        av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the parameter sets.\n");
-        av_free(orig_extradata);
-        return NULL;
-    }
-    memcpy(psets, pset_string, strlen(pset_string));
-    p = psets + strlen(pset_string);
-    r = ff_avc_find_startcode(c->extradata, c->extradata + c->extradata_size);
-    while (r < c->extradata + c->extradata_size) {
-        const uint8_t *r1;
-        uint8_t nal_type;
-
-        while (!*(r++));
-        nal_type = *r & 0x1f;
-        r1 = ff_avc_find_startcode(r, c->extradata + c->extradata_size);
-        if (nal_type != 7 && nal_type != 8) { /* Only output SPS and PPS */
-            r = r1;
-            continue;
-        }
-        if (p != (psets + strlen(pset_string))) {
-            *p = ',';
-            p++;
-        }
-        if (!sps) {
-            sps = r;
-            sps_end = r1;
-        }
-        if (av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r) == NULL) {
-            av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
-            av_free(psets);
-
-            return NULL;
-        }
-        p += strlen(p);
-        r = r1;
-    }
-    if (sps && sps_end - sps >= 4) {
-        memcpy(p, profile_string, strlen(profile_string));
-        p += strlen(p);
-        ff_data_to_hex(p, sps + 1, 3, 0);
-        p[6] = '\0';
-    }
-    if (orig_extradata) {
-        av_free(c->extradata);
-        c->extradata      = orig_extradata;
-        c->extradata_size = orig_extradata_size;
-    }
-
-    return psets;
-}
-
-static char *extradata2config(AVCodecContext *c)
-{
-    char *config;
-
-    if (c->extradata_size > MAX_EXTRADATA_SIZE) {
-        av_log(c, AV_LOG_ERROR, "Too much extradata!\n");
-
-        return NULL;
-    }
-    config = av_malloc(10 + c->extradata_size * 2);
-    if (config == NULL) {
-        av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the config info.\n");
-        return NULL;
-    }
-    memcpy(config, "; config=", 9);
-    ff_data_to_hex(config + 9, c->extradata, c->extradata_size, 0);
-    config[9 + c->extradata_size * 2] = 0;
-
-    return config;
-}
-
-static char *xiph_extradata2config(AVCodecContext *c)
-{
-    char *config, *encoded_config;
-    uint8_t *header_start[3];
-    int headers_len, header_len[3], config_len;
-    int first_header_size;
-
-    switch (c->codec_id) {
-    case AV_CODEC_ID_THEORA:
-        first_header_size = 42;
-        break;
-    case AV_CODEC_ID_VORBIS:
-        first_header_size = 30;
-        break;
-    default:
-        av_log(c, AV_LOG_ERROR, "Unsupported Xiph codec ID\n");
-        return NULL;
-    }
-
-    if (avpriv_split_xiph_headers(c->extradata, c->extradata_size,
-                              first_header_size, header_start,
-                              header_len) < 0) {
-        av_log(c, AV_LOG_ERROR, "Extradata corrupt.\n");
-        return NULL;
-    }
-
-    headers_len = header_len[0] + header_len[2];
-    config_len = 4 +          // count
-                 3 +          // ident
-                 2 +          // packet size
-                 1 +          // header count
-                 2 +          // header size
-                 headers_len; // and the rest
-
-    config = av_malloc(config_len);
-    if (!config)
-        goto xiph_fail;
-
-    encoded_config = av_malloc(AV_BASE64_SIZE(config_len));
-    if (!encoded_config) {
-        av_free(config);
-        goto xiph_fail;
-    }
-
-    config[0] = config[1] = config[2] = 0;
-    config[3] = 1;
-    config[4] = (RTP_XIPH_IDENT >> 16) & 0xff;
-    config[5] = (RTP_XIPH_IDENT >>  8) & 0xff;
-    config[6] = (RTP_XIPH_IDENT      ) & 0xff;
-    config[7] = (headers_len >> 8) & 0xff;
-    config[8] = headers_len & 0xff;
-    config[9] = 2;
-    config[10] = header_len[0];
-    config[11] = 0; // size of comment header; nonexistent
-    memcpy(config + 12, header_start[0], header_len[0]);
-    memcpy(config + 12 + header_len[0], header_start[2], header_len[2]);
-
-    av_base64_encode(encoded_config, AV_BASE64_SIZE(config_len),
-                     config, config_len);
-    av_free(config);
-
-    return encoded_config;
-
-xiph_fail:
-    av_log(c, AV_LOG_ERROR,
-           "Not enough memory for configuration string\n");
-    return NULL;
-}
-
-static int latm_context2profilelevel(AVCodecContext *c)
-{
-    /* MP4A-LATM
-     * The RTP payload format specification is described in RFC 3016
-     * The encoding specifications are provided in ISO/IEC 14496-3 */
-
-    int profile_level = 0x2B;
-
-    /* TODO: AAC Profile only supports AAC LC Object Type.
-     * Different Object Types should implement different Profile Levels */
-
-    if (c->sample_rate <= 24000) {
-        if (c->channels <= 2)
-            profile_level = 0x28; // AAC Profile, Level 1
-    } else if (c->sample_rate <= 48000) {
-        if (c->channels <= 2) {
-            profile_level = 0x29; // AAC Profile, Level 2
-        } else if (c->channels <= 5) {
-            profile_level = 0x2A; // AAC Profile, Level 4
-        }
-    } else if (c->sample_rate <= 96000) {
-        if (c->channels <= 5) {
-            profile_level = 0x2B; // AAC Profile, Level 5
-        }
-    }
-
-    return profile_level;
-}
-
-static char *latm_context2config(AVCodecContext *c)
-{
-    /* MP4A-LATM
-     * The RTP payload format specification is described in RFC 3016
-     * The encoding specifications are provided in ISO/IEC 14496-3 */
-
-    uint8_t config_byte[6];
-    int rate_index;
-    char *config;
-
-    for (rate_index = 0; rate_index < 16; rate_index++)
-        if (avpriv_mpeg4audio_sample_rates[rate_index] == c->sample_rate)
-            break;
-    if (rate_index == 16) {
-        av_log(c, AV_LOG_ERROR, "Unsupported sample rate\n");
-        return NULL;
-    }
-
-    config_byte[0] = 0x40;
-    config_byte[1] = 0;
-    config_byte[2] = 0x20 | rate_index;
-    config_byte[3] = c->channels << 4;
-    config_byte[4] = 0x3f;
-    config_byte[5] = 0xc0;
-
-    config = av_malloc(6*2+1);
-    if (!config) {
-        av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the config info.\n");
-        return NULL;
-    }
-    ff_data_to_hex(config, config_byte, 6, 1);
-    config[12] = 0;
-
-    return config;
-}
-
-static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, int payload_type, AVFormatContext *fmt)
-{
-    char *config = NULL;
-
-    switch (c->codec_id) {
-        case AV_CODEC_ID_H264: {
-            int mode = 1;
-            if (fmt && fmt->oformat && fmt->oformat->priv_class &&
-                av_opt_flag_is_set(fmt->priv_data, "rtpflags", "h264_mode0"))
-                mode = 0;
-            if (c->extradata_size) {
-                config = extradata2psets(c);
-            }
-            av_strlcatf(buff, size, "a=rtpmap:%d H264/90000\r\n"
-                                    "a=fmtp:%d packetization-mode=%d%s\r\n",
-                                     payload_type,
-                                     payload_type, mode, config ? config : "");
-            break;
-        }
-        case AV_CODEC_ID_H263:
-        case AV_CODEC_ID_H263P:
-            /* a=framesize is required by 3GPP TS 26.234 (PSS). It
-             * actually specifies the maximum video size, but we only know
-             * the current size. This is required for playback on Android
-             * stagefright and on Samsung bada. */
-            if (!fmt || !fmt->oformat->priv_class ||
-                !av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190") ||
-                c->codec_id == AV_CODEC_ID_H263P)
-            av_strlcatf(buff, size, "a=rtpmap:%d H263-2000/90000\r\n"
-                                    "a=framesize:%d %d-%d\r\n",
-                                    payload_type,
-                                    payload_type, c->width, c->height);
-            break;
-        case AV_CODEC_ID_MPEG4:
-            if (c->extradata_size) {
-                config = extradata2config(c);
-            }
-            av_strlcatf(buff, size, "a=rtpmap:%d MP4V-ES/90000\r\n"
-                                    "a=fmtp:%d profile-level-id=1%s\r\n",
-                                     payload_type,
-                                     payload_type, config ? config : "");
-            break;
-        case AV_CODEC_ID_AAC:
-            if (fmt && fmt->oformat->priv_class &&
-                av_opt_flag_is_set(fmt->priv_data, "rtpflags", "latm")) {
-                config = latm_context2config(c);
-                if (!config)
-                    return NULL;
-                av_strlcatf(buff, size, "a=rtpmap:%d MP4A-LATM/%d/%d\r\n"
-                                        "a=fmtp:%d profile-level-id=%d;cpresent=0;config=%s\r\n",
-                                         payload_type, c->sample_rate, c->channels,
-                                         payload_type, latm_context2profilelevel(c), config);
-            } else {
-                if (c->extradata_size) {
-                    config = extradata2config(c);
-                } else {
-                    /* FIXME: maybe we can forge config information based on the
-                     *        codec parameters...
-                     */
-                    av_log(c, AV_LOG_ERROR, "AAC with no global headers is currently not supported.\n");
-                    return NULL;
-                }
-                if (config == NULL) {
-                    return NULL;
-                }
-                av_strlcatf(buff, size, "a=rtpmap:%d MPEG4-GENERIC/%d/%d\r\n"
-                                        "a=fmtp:%d profile-level-id=1;"
-                                        "mode=AAC-hbr;sizelength=13;indexlength=3;"
-                                        "indexdeltalength=3%s\r\n",
-                                         payload_type, c->sample_rate, c->channels,
-                                         payload_type, config);
-            }
-            break;
-        case AV_CODEC_ID_PCM_S16BE:
-            if (payload_type >= RTP_PT_PRIVATE)
-                av_strlcatf(buff, size, "a=rtpmap:%d L16/%d/%d\r\n",
-                                         payload_type,
-                                         c->sample_rate, c->channels);
-            break;
-        case AV_CODEC_ID_PCM_MULAW:
-            if (payload_type >= RTP_PT_PRIVATE)
-                av_strlcatf(buff, size, "a=rtpmap:%d PCMU/%d/%d\r\n",
-                                         payload_type,
-                                         c->sample_rate, c->channels);
-            break;
-        case AV_CODEC_ID_PCM_ALAW:
-            if (payload_type >= RTP_PT_PRIVATE)
-                av_strlcatf(buff, size, "a=rtpmap:%d PCMA/%d/%d\r\n",
-                                         payload_type,
-                                         c->sample_rate, c->channels);
-            break;
-        case AV_CODEC_ID_AMR_NB:
-            av_strlcatf(buff, size, "a=rtpmap:%d AMR/%d/%d\r\n"
-                                    "a=fmtp:%d octet-align=1\r\n",
-                                     payload_type, c->sample_rate, c->channels,
-                                     payload_type);
-            break;
-        case AV_CODEC_ID_AMR_WB:
-            av_strlcatf(buff, size, "a=rtpmap:%d AMR-WB/%d/%d\r\n"
-                                    "a=fmtp:%d octet-align=1\r\n",
-                                     payload_type, c->sample_rate, c->channels,
-                                     payload_type);
-            break;
-        case AV_CODEC_ID_VORBIS:
-            if (c->extradata_size)
-                config = xiph_extradata2config(c);
-            else
-                av_log(c, AV_LOG_ERROR, "Vorbis configuration info missing\n");
-            if (!config)
-                return NULL;
-
-            av_strlcatf(buff, size, "a=rtpmap:%d vorbis/%d/%d\r\n"
-                                    "a=fmtp:%d configuration=%s\r\n",
-                                    payload_type, c->sample_rate, c->channels,
-                                    payload_type, config);
-            break;
-        case AV_CODEC_ID_THEORA: {
-            const char *pix_fmt;
-            switch (c->pix_fmt) {
-            case AV_PIX_FMT_YUV420P:
-                pix_fmt = "YCbCr-4:2:0";
-                break;
-            case AV_PIX_FMT_YUV422P:
-                pix_fmt = "YCbCr-4:2:2";
-                break;
-            case AV_PIX_FMT_YUV444P:
-                pix_fmt = "YCbCr-4:4:4";
-                break;
-            default:
-                av_log(c, AV_LOG_ERROR, "Unsupported pixel format.\n");
-                return NULL;
-            }
-
-            if (c->extradata_size)
-                config = xiph_extradata2config(c);
-            else
-                av_log(c, AV_LOG_ERROR, "Theora configuation info missing\n");
-            if (!config)
-                return NULL;
-
-            av_strlcatf(buff, size, "a=rtpmap:%d theora/90000\r\n"
-                                    "a=fmtp:%d delivery-method=inline; "
-                                    "width=%d; height=%d; sampling=%s; "
-                                    "configuration=%s\r\n",
-                                    payload_type, payload_type,
-                                    c->width, c->height, pix_fmt, config);
-            break;
-        }
-        case AV_CODEC_ID_VP8:
-            av_strlcatf(buff, size, "a=rtpmap:%d VP8/90000\r\n",
-                                     payload_type);
-            break;
-        case AV_CODEC_ID_MJPEG:
-            if (payload_type >= RTP_PT_PRIVATE)
-                av_strlcatf(buff, size, "a=rtpmap:%d JPEG/90000\r\n",
-                                         payload_type);
-            break;
-        case AV_CODEC_ID_ADPCM_G722:
-            if (payload_type >= RTP_PT_PRIVATE)
-                av_strlcatf(buff, size, "a=rtpmap:%d G722/%d/%d\r\n",
-                                         payload_type,
-                                         8000, c->channels);
-            break;
-        case AV_CODEC_ID_ADPCM_G726: {
-            if (payload_type >= RTP_PT_PRIVATE)
-                av_strlcatf(buff, size, "a=rtpmap:%d G726-%d/%d\r\n",
-                                         payload_type,
-                                         c->bits_per_coded_sample*8,
-                                         c->sample_rate);
-            break;
-        }
-        case AV_CODEC_ID_ILBC:
-            av_strlcatf(buff, size, "a=rtpmap:%d iLBC/%d\r\n"
-                                    "a=fmtp:%d mode=%d\r\n",
-                                     payload_type, c->sample_rate,
-                                     payload_type, c->block_align == 38 ? 20 : 30);
-            break;
-        case AV_CODEC_ID_SPEEX:
-            av_strlcatf(buff, size, "a=rtpmap:%d speex/%d\r\n",
-                                     payload_type, c->sample_rate);
-            break;
-        case AV_CODEC_ID_OPUS:
-            av_strlcatf(buff, size, "a=rtpmap:%d opus/48000\r\n",
-                                     payload_type);
-            break;
-        default:
-            /* Nothing special to do here... */
-            break;
-    }
-
-    av_free(config);
-
-    return buff;
-}
-
-void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,
-                        const char *dest_addr, const char *dest_type,
-                        int port, int ttl, AVFormatContext *fmt)
-{
-    AVCodecContext *c = st->codec;
-    const char *type;
-    int payload_type;
-
-    payload_type = ff_rtp_get_payload_type(fmt, c, idx);
-
-    switch (c->codec_type) {
-        case AVMEDIA_TYPE_VIDEO   : type = "video"      ; break;
-        case AVMEDIA_TYPE_AUDIO   : type = "audio"      ; break;
-        case AVMEDIA_TYPE_SUBTITLE: type = "text"       ; break;
-        default                 : type = "application"; break;
-    }
-
-    av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type);
-    sdp_write_address(buff, size, dest_addr, dest_type, ttl);
-    if (c->bit_rate) {
-        av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000);
-    }
-
-    sdp_write_media_attributes(buff, size, c, payload_type, fmt);
-}
-
-int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
-{
-    AVDictionaryEntry *title = av_dict_get(ac[0]->metadata, "title", NULL, 0);
-    struct sdp_session_level s = { 0 };
-    int i, j, port, ttl, is_multicast, index = 0;
-    char dst[32], dst_type[5];
-
-    memset(buf, 0, size);
-    s.user = "-";
-    s.src_addr = "127.0.0.1";    /* FIXME: Properly set this */
-    s.src_type = "IP4";
-    s.name = title ? title->value : "No Name";
-
-    port = 0;
-    ttl = 0;
-    if (n_files == 1) {
-        port = sdp_get_address(dst, sizeof(dst), &ttl, ac[0]->filename);
-        is_multicast = resolve_destination(dst, sizeof(dst), dst_type,
-                                           sizeof(dst_type));
-        if (!is_multicast)
-            ttl = 0;
-        if (dst[0]) {
-            s.dst_addr = dst;
-            s.dst_type = dst_type;
-            s.ttl = ttl;
-            if (!strcmp(dst_type, "IP6")) {
-                s.src_addr = "::1";
-                s.src_type = "IP6";
-            }
-        }
-    }
-    sdp_write_header(buf, size, &s);
-
-    dst[0] = 0;
-    for (i = 0; i < n_files; i++) {
-        if (n_files != 1) {
-            port = sdp_get_address(dst, sizeof(dst), &ttl, ac[i]->filename);
-            is_multicast = resolve_destination(dst, sizeof(dst), dst_type,
-                                               sizeof(dst_type));
-            if (!is_multicast)
-                ttl = 0;
-        }
-        for (j = 0; j < ac[i]->nb_streams; j++) {
-            ff_sdp_write_media(buf, size, ac[i]->streams[j], index++,
-                               dst[0] ? dst : NULL, dst_type,
-                               (port > 0) ? port + j * 2 : 0,
-                               ttl, ac[i]);
-            if (port <= 0) {
-                av_strlcatf(buf, size,
-                                   "a=control:streamid=%d\r\n", i + j);
-            }
-            if (ac[i]->pb && ac[i]->pb->av_class) {
-                uint8_t *crypto_suite = NULL, *crypto_params = NULL;
-                av_opt_get(ac[i]->pb, "srtp_out_suite",  AV_OPT_SEARCH_CHILDREN,
-                           &crypto_suite);
-                av_opt_get(ac[i]->pb, "srtp_out_params", AV_OPT_SEARCH_CHILDREN,
-                           &crypto_params);
-                if (crypto_suite && crypto_suite[0])
-                    av_strlcatf(buf, size,
-                                "a=crypto:1 %s inline:%s\r\n",
-                                crypto_suite, crypto_params);
-                av_free(crypto_suite);
-                av_free(crypto_params);
-            }
-        }
-    }
-
-    return 0;
-}
-#else
-int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
-{
-    return AVERROR(ENOSYS);
-}
-
-void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,
-                        const char *dest_addr, const char *dest_type,
-                        int port, int ttl, AVFormatContext *fmt)
-{
-}
-#endif
diff --git a/deps/libav/libavformat/seek-test.c b/deps/libav/libavformat/seek-test.c
deleted file mode 100644
index 143f0b5..0000000
--- a/deps/libav/libavformat/seek-test.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2007 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "libavformat/avformat.h"
-
-static char buffer[20];
-
-static const char *ret_str(int v)
-{
-    switch (v) {
-    case AVERROR_EOF:     return "-EOF";
-    case AVERROR(EIO):    return "-EIO";
-    case AVERROR(ENOMEM): return "-ENOMEM";
-    case AVERROR(EINVAL): return "-EINVAL";
-    default:
-        snprintf(buffer, sizeof(buffer), "%2d", v);
-        return buffer;
-    }
-}
-
-static void ts_str(char buffer[60], int64_t ts, AVRational base)
-{
-    double tsval;
-    if (ts == AV_NOPTS_VALUE) {
-        strcpy(buffer, " NOPTS   ");
-        return;
-    }
-    tsval = ts * av_q2d(base);
-    snprintf(buffer, 60, "%9f", tsval);
-}
-
-int main(int argc, char **argv)
-{
-    const char *filename;
-    AVFormatContext *ic = NULL;
-    int i, ret, stream_id;
-    int64_t timestamp;
-    AVDictionary *format_opts = NULL;
-
-    av_dict_set(&format_opts, "channels", "1", 0);
-    av_dict_set(&format_opts, "sample_rate", "22050", 0);
-
-    /* initialize libavcodec, and register all codecs and formats */
-    av_register_all();
-
-    if (argc != 2) {
-        printf("usage: %s input_file\n"
-               "\n", argv[0]);
-        return 1;
-    }
-
-    filename = argv[1];
-
-    ret = avformat_open_input(&ic, filename, NULL, &format_opts);
-    av_dict_free(&format_opts);
-    if (ret < 0) {
-        fprintf(stderr, "cannot open %s\n", filename);
-        return 1;
-    }
-
-    ret = avformat_find_stream_info(ic, NULL);
-    if (ret < 0) {
-        fprintf(stderr, "%s: could not find codec parameters\n", filename);
-        return 1;
-    }
-
-    for(i=0; ; i++){
-        AVPacket pkt = { 0 };
-        AVStream *av_uninit(st);
-        char ts_buf[60];
-
-        if(ret>=0){
-            ret= av_read_frame(ic, &pkt);
-            if(ret>=0){
-                char dts_buf[60];
-                st= ic->streams[pkt.stream_index];
-                ts_str(dts_buf, pkt.dts, st->time_base);
-                ts_str(ts_buf,  pkt.pts, st->time_base);
-                printf("ret:%-10s st:%2d flags:%d dts:%s pts:%s pos:%7" PRId64 " size:%6d", ret_str(ret), pkt.stream_index, pkt.flags, dts_buf, ts_buf, pkt.pos, pkt.size);
-                av_free_packet(&pkt);
-            } else
-                printf("ret:%s", ret_str(ret)); // necessary to avoid trailing whitespace
-            printf("\n");
-        }
-
-        if(i>25) break;
-
-        stream_id= (i>>1)%(ic->nb_streams+1) - 1;
-        timestamp= (i*19362894167LL) % (4*AV_TIME_BASE) - AV_TIME_BASE;
-        if(stream_id>=0){
-            st= ic->streams[stream_id];
-            timestamp= av_rescale_q(timestamp, AV_TIME_BASE_Q, st->time_base);
-        }
-        //FIXME fully test the new seek API
-        if(i&1) ret = avformat_seek_file(ic, stream_id, INT64_MIN, timestamp, timestamp, 0);
-        else    ret = avformat_seek_file(ic, stream_id, timestamp, timestamp, INT64_MAX, 0);
-        ts_str(ts_buf, timestamp, stream_id < 0 ? AV_TIME_BASE_Q : st->time_base);
-        printf("ret:%-10s st:%2d flags:%d  ts:%s\n", ret_str(ret), stream_id, i&1, ts_buf);
-    }
-
-    avformat_close_input(&ic);
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/seek.c b/deps/libav/libavformat/seek.c
deleted file mode 100644
index 9be8db9..0000000
--- a/deps/libav/libavformat/seek.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * seek utility functions for use within format handlers
- *
- * Copyright (c) 2009 Ivan Schreter
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "seek.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/mem.h"
-#include "internal.h"
-
-// NOTE: implementation should be moved here in another patch, to keep patches
-// separated.
-
-/**
- * helper structure describing keyframe search state of one stream
- */
-typedef struct {
-    int64_t     pos_lo;      ///< position of the frame with low timestamp in file or INT64_MAX if not found (yet)
-    int64_t     ts_lo;       ///< frame presentation timestamp or same as pos_lo for byte seeking
-
-    int64_t     pos_hi;      ///< position of the frame with high timestamp in file or INT64_MAX if not found (yet)
-    int64_t     ts_hi;       ///< frame presentation timestamp or same as pos_hi for byte seeking
-
-    int64_t     last_pos;    ///< last known position of a frame, for multi-frame packets
-
-    int64_t     term_ts;     ///< termination timestamp (which TS we already read)
-    AVRational  term_ts_tb;  ///< timebase for term_ts
-    int64_t     first_ts;    ///< first packet timestamp in this iteration (to fill term_ts later)
-    AVRational  first_ts_tb; ///< timebase for first_ts
-
-    int         terminated;  ///< termination flag for the current iteration
-} AVSyncPoint;
-
-/**
- * Compute a distance between timestamps.
- *
- * Distances are only comparable, if same time bases are used for computing
- * distances.
- *
- * @param ts_hi high timestamp
- * @param tb_hi high timestamp time base
- * @param ts_lo low timestamp
- * @param tb_lo low timestamp time base
- * @return representation of distance between high and low timestamps
- */
-static int64_t ts_distance(int64_t ts_hi,
-                           AVRational tb_hi,
-                           int64_t ts_lo,
-                           AVRational tb_lo)
-{
-    int64_t hi, lo;
-
-    hi = ts_hi * tb_hi.num * tb_lo.den;
-    lo = ts_lo * tb_lo.num * tb_hi.den;
-
-    return hi - lo;
-}
-
-/**
- * Partial search for keyframes in multiple streams.
- *
- * This routine searches in each stream for the next lower and the next higher
- * timestamp compared to the given target timestamp. The search starts at the current
- * file position and ends at the file position, where all streams have already been
- * examined (or when all higher key frames are found in the first iteration).
- *
- * This routine is called iteratively with an exponential backoff to find the lower
- * timestamp.
- *
- * @param s                 format context
- * @param timestamp         target timestamp (or position, if AVSEEK_FLAG_BYTE)
- * @param timebase          time base for timestamps
- * @param flags             seeking flags
- * @param sync              array with information per stream
- * @param keyframes_to_find count of keyframes to find in total
- * @param found_lo          ptr to the count of already found low timestamp keyframes
- * @param found_hi          ptr to the count of already found high timestamp keyframes
- * @param first_iter        flag for first iteration
- */
-static void search_hi_lo_keyframes(AVFormatContext *s,
-                                   int64_t timestamp,
-                                   AVRational timebase,
-                                   int flags,
-                                   AVSyncPoint *sync,
-                                   int keyframes_to_find,
-                                   int *found_lo,
-                                   int *found_hi,
-                                   int first_iter)
-{
-    AVPacket pkt;
-    AVSyncPoint *sp;
-    AVStream *st;
-    int idx;
-    int flg;
-    int terminated_count = 0;
-    int64_t pos;
-    int64_t pts, dts;   // PTS/DTS from stream
-    int64_t ts;         // PTS in stream-local time base or position for byte seeking
-    AVRational ts_tb;   // Time base of the stream or 1:1 for byte seeking
-
-    for (;;) {
-        if (av_read_frame(s, &pkt) < 0) {
-            // EOF or error, make sure high flags are set
-            for (idx = 0; idx < s->nb_streams; ++idx) {
-                if (s->streams[idx]->discard < AVDISCARD_ALL) {
-                    sp = &sync[idx];
-                    if (sp->pos_hi == INT64_MAX) {
-                        // no high frame exists for this stream
-                        (*found_hi)++;
-                        sp->ts_hi  = INT64_MAX;
-                        sp->pos_hi = INT64_MAX - 1;
-                    }
-                }
-            }
-            break;
-        }
-
-        idx = pkt.stream_index;
-        st = s->streams[idx];
-        if (st->discard >= AVDISCARD_ALL)
-            // this stream is not active, skip packet
-            continue;
-
-        sp = &sync[idx];
-
-        flg = pkt.flags;
-        pos = pkt.pos;
-        pts = pkt.pts;
-        dts = pkt.dts;
-        if (pts == AV_NOPTS_VALUE)
-            // some formats don't provide PTS, only DTS
-            pts = dts;
-
-        av_free_packet(&pkt);
-
-        // Multi-frame packets only return position for the very first frame.
-        // Other frames are read with position == -1. Therefore, we note down
-        // last known position of a frame and use it if a frame without
-        // position arrives. In this way, it's possible to seek to proper
-        // position. Additionally, for parsers not providing position at all,
-        // an approximation will be used (starting position of this iteration).
-        if (pos < 0)
-            pos = sp->last_pos;
-        else
-            sp->last_pos = pos;
-
-        // Evaluate key frames with known TS (or any frames, if AVSEEK_FLAG_ANY set).
-        if (pts != AV_NOPTS_VALUE &&
-            ((flg & AV_PKT_FLAG_KEY) || (flags & AVSEEK_FLAG_ANY))) {
-            if (flags & AVSEEK_FLAG_BYTE) {
-                // for byte seeking, use position as timestamp
-                ts        = pos;
-                ts_tb.num = 1;
-                ts_tb.den = 1;
-            } else {
-                // otherwise, get stream time_base
-                ts    = pts;
-                ts_tb = st->time_base;
-            }
-
-            if (sp->first_ts == AV_NOPTS_VALUE) {
-                // Note down termination timestamp for the next iteration - when
-                // we encounter a packet with the same timestamp, we will ignore
-                // any further packets for this stream in next iteration (as they
-                // are already evaluated).
-                sp->first_ts    = ts;
-                sp->first_ts_tb = ts_tb;
-            }
-
-            if (sp->term_ts != AV_NOPTS_VALUE &&
-                av_compare_ts(ts, ts_tb, sp->term_ts, sp->term_ts_tb) > 0) {
-                // past the end position from last iteration, ignore packet
-                if (!sp->terminated) {
-                    sp->terminated = 1;
-                    ++terminated_count;
-                    if (sp->pos_hi == INT64_MAX) {
-                        // no high frame exists for this stream
-                        (*found_hi)++;
-                        sp->ts_hi  = INT64_MAX;
-                        sp->pos_hi = INT64_MAX - 1;
-                    }
-                    if (terminated_count == keyframes_to_find)
-                        break;  // all terminated, iteration done
-                }
-                continue;
-            }
-
-            if (av_compare_ts(ts, ts_tb, timestamp, timebase) <= 0) {
-                // keyframe found before target timestamp
-                if (sp->pos_lo == INT64_MAX) {
-                    // found first keyframe lower than target timestamp
-                    (*found_lo)++;
-                    sp->ts_lo  = ts;
-                    sp->pos_lo = pos;
-                } else if (sp->ts_lo < ts) {
-                    // found a better match (closer to target timestamp)
-                    sp->ts_lo  = ts;
-                    sp->pos_lo = pos;
-                }
-            }
-            if (av_compare_ts(ts, ts_tb, timestamp, timebase) >= 0) {
-                // keyframe found after target timestamp
-                if (sp->pos_hi == INT64_MAX) {
-                    // found first keyframe higher than target timestamp
-                    (*found_hi)++;
-                    sp->ts_hi  = ts;
-                    sp->pos_hi = pos;
-                    if (*found_hi >= keyframes_to_find && first_iter) {
-                        // We found high frame for all. They may get updated
-                        // to TS closer to target TS in later iterations (which
-                        // will stop at start position of previous iteration).
-                        break;
-                    }
-                } else if (sp->ts_hi > ts) {
-                    // found a better match (actually, shouldn't happen)
-                    sp->ts_hi  = ts;
-                    sp->pos_hi = pos;
-                }
-            }
-        }
-    }
-
-    // Clean up the parser.
-    ff_read_frame_flush(s);
-}
-
-int64_t ff_gen_syncpoint_search(AVFormatContext *s,
-                                int stream_index,
-                                int64_t pos,
-                                int64_t ts_min,
-                                int64_t ts,
-                                int64_t ts_max,
-                                int flags)
-{
-    AVSyncPoint *sync, *sp;
-    AVStream *st;
-    int i;
-    int keyframes_to_find = 0;
-    int64_t curpos;
-    int64_t step;
-    int found_lo = 0, found_hi = 0;
-    int64_t min_distance, distance;
-    int64_t min_pos = 0;
-    int first_iter = 1;
-    AVRational time_base;
-
-    if (flags & AVSEEK_FLAG_BYTE) {
-        // for byte seeking, we have exact 1:1 "timestamps" - positions
-        time_base.num = 1;
-        time_base.den = 1;
-    } else {
-        if (stream_index >= 0) {
-            // we have a reference stream, which time base we use
-            st = s->streams[stream_index];
-            time_base = st->time_base;
-        } else {
-            // no reference stream, use AV_TIME_BASE as reference time base
-            time_base.num = 1;
-            time_base.den = AV_TIME_BASE;
-        }
-    }
-
-    // Initialize syncpoint structures for each stream.
-    sync = av_malloc(s->nb_streams * sizeof(AVSyncPoint));
-    if (!sync)
-        // cannot allocate helper structure
-        return -1;
-
-    for (i = 0; i < s->nb_streams; ++i) {
-        st = s->streams[i];
-        sp = &sync[i];
-
-        sp->pos_lo     = INT64_MAX;
-        sp->ts_lo      = INT64_MAX;
-        sp->pos_hi     = INT64_MAX;
-        sp->ts_hi      = INT64_MAX;
-        sp->terminated = 0;
-        sp->first_ts   = AV_NOPTS_VALUE;
-        sp->term_ts    = ts_max;
-        sp->term_ts_tb = time_base;
-        sp->last_pos   = pos;
-
-        st->cur_dts    = AV_NOPTS_VALUE;
-
-        if (st->discard < AVDISCARD_ALL)
-            ++keyframes_to_find;
-    }
-
-    if (!keyframes_to_find) {
-        // no stream active, error
-        av_free(sync);
-        return -1;
-    }
-
-    // Find keyframes in all active streams with timestamp/position just before
-    // and just after requested timestamp/position.
-    step = s->pb->buffer_size;
-    curpos = FFMAX(pos - step / 2, 0);
-    for (;;) {
-        avio_seek(s->pb, curpos, SEEK_SET);
-        search_hi_lo_keyframes(s,
-                               ts, time_base,
-                               flags,
-                               sync,
-                               keyframes_to_find,
-                               &found_lo, &found_hi,
-                               first_iter);
-        if (found_lo == keyframes_to_find && found_hi == keyframes_to_find)
-            break;  // have all keyframes we wanted
-        if (!curpos)
-            break;  // cannot go back anymore
-
-        curpos = pos - step;
-        if (curpos < 0)
-            curpos = 0;
-        step *= 2;
-
-        // switch termination positions
-        for (i = 0; i < s->nb_streams; ++i) {
-            st = s->streams[i];
-            st->cur_dts = AV_NOPTS_VALUE;
-
-            sp = &sync[i];
-            if (sp->first_ts != AV_NOPTS_VALUE) {
-                sp->term_ts    = sp->first_ts;
-                sp->term_ts_tb = sp->first_ts_tb;
-                sp->first_ts   = AV_NOPTS_VALUE;
-            }
-            sp->terminated = 0;
-            sp->last_pos = curpos;
-        }
-        first_iter = 0;
-    }
-
-    // Find actual position to start decoding so that decoder synchronizes
-    // closest to ts and between ts_min and ts_max.
-    pos = INT64_MAX;
-
-    for (i = 0; i < s->nb_streams; ++i) {
-        st = s->streams[i];
-        if (st->discard < AVDISCARD_ALL) {
-            sp = &sync[i];
-            min_distance = INT64_MAX;
-            // Find timestamp closest to requested timestamp within min/max limits.
-            if (sp->pos_lo != INT64_MAX
-                && av_compare_ts(ts_min, time_base, sp->ts_lo, st->time_base) <= 0
-                && av_compare_ts(sp->ts_lo, st->time_base, ts_max, time_base) <= 0) {
-                // low timestamp is in range
-                min_distance = ts_distance(ts, time_base, sp->ts_lo, st->time_base);
-                min_pos = sp->pos_lo;
-            }
-            if (sp->pos_hi != INT64_MAX
-                && av_compare_ts(ts_min, time_base, sp->ts_hi, st->time_base) <= 0
-                && av_compare_ts(sp->ts_hi, st->time_base, ts_max, time_base) <= 0) {
-                // high timestamp is in range, check distance
-                distance = ts_distance(sp->ts_hi, st->time_base, ts, time_base);
-                if (distance < min_distance) {
-                    min_distance = distance;
-                    min_pos = sp->pos_hi;
-                }
-            }
-            if (min_distance == INT64_MAX) {
-                // no timestamp is in range, cannot seek
-                av_free(sync);
-                return -1;
-            }
-            if (min_pos < pos)
-                pos = min_pos;
-        }
-    }
-
-    avio_seek(s->pb, pos, SEEK_SET);
-    av_free(sync);
-    return pos;
-}
-
-AVParserState *ff_store_parser_state(AVFormatContext *s)
-{
-    int i;
-    AVStream *st;
-    AVParserStreamState *ss;
-    AVParserState *state = av_malloc(sizeof(AVParserState));
-    if (!state)
-        return NULL;
-
-    state->stream_states = av_malloc(sizeof(AVParserStreamState) * s->nb_streams);
-    if (!state->stream_states) {
-        av_free(state);
-        return NULL;
-    }
-
-    state->fpos = avio_tell(s->pb);
-
-    // copy context structures
-    state->packet_buffer                    = s->packet_buffer;
-    state->parse_queue                      = s->parse_queue;
-    state->raw_packet_buffer                = s->raw_packet_buffer;
-    state->raw_packet_buffer_remaining_size = s->raw_packet_buffer_remaining_size;
-
-    s->packet_buffer                        = NULL;
-    s->parse_queue                          = NULL;
-    s->raw_packet_buffer                    = NULL;
-    s->raw_packet_buffer_remaining_size     = RAW_PACKET_BUFFER_SIZE;
-
-    // copy stream structures
-    state->nb_streams = s->nb_streams;
-    for (i = 0; i < s->nb_streams; i++) {
-        st = s->streams[i];
-        ss = &state->stream_states[i];
-
-        ss->parser        = st->parser;
-        ss->last_IP_pts   = st->last_IP_pts;
-        ss->cur_dts       = st->cur_dts;
-        ss->probe_packets = st->probe_packets;
-
-        st->parser        = NULL;
-        st->last_IP_pts   = AV_NOPTS_VALUE;
-        st->cur_dts       = AV_NOPTS_VALUE;
-        st->probe_packets = MAX_PROBE_PACKETS;
-    }
-
-    return state;
-}
-
-void ff_restore_parser_state(AVFormatContext *s, AVParserState *state)
-{
-    int i;
-    AVStream *st;
-    AVParserStreamState *ss;
-    ff_read_frame_flush(s);
-
-    if (!state)
-        return;
-
-    avio_seek(s->pb, state->fpos, SEEK_SET);
-
-    // copy context structures
-    s->packet_buffer                    = state->packet_buffer;
-    s->parse_queue                      = state->parse_queue;
-    s->raw_packet_buffer                = state->raw_packet_buffer;
-    s->raw_packet_buffer_remaining_size = state->raw_packet_buffer_remaining_size;
-
-    // copy stream structures
-    for (i = 0; i < state->nb_streams; i++) {
-        st = s->streams[i];
-        ss = &state->stream_states[i];
-
-        st->parser        = ss->parser;
-        st->last_IP_pts   = ss->last_IP_pts;
-        st->cur_dts       = ss->cur_dts;
-        st->probe_packets = ss->probe_packets;
-    }
-
-    av_free(state->stream_states);
-    av_free(state);
-}
-
-static void free_packet_list(AVPacketList *pktl)
-{
-    AVPacketList *cur;
-    while (pktl) {
-        cur = pktl;
-        pktl = cur->next;
-        av_free_packet(&cur->pkt);
-        av_free(cur);
-    }
-}
-
-void ff_free_parser_state(AVFormatContext *s, AVParserState *state)
-{
-    int i;
-    AVParserStreamState *ss;
-
-    if (!state)
-        return;
-
-    for (i = 0; i < state->nb_streams; i++) {
-        ss = &state->stream_states[i];
-        if (ss->parser)
-            av_parser_close(ss->parser);
-    }
-
-    free_packet_list(state->packet_buffer);
-    free_packet_list(state->parse_queue);
-    free_packet_list(state->raw_packet_buffer);
-
-    av_free(state->stream_states);
-    av_free(state);
-}
diff --git a/deps/libav/libavformat/seek.h b/deps/libav/libavformat/seek.h
deleted file mode 100644
index 44cd369..0000000
--- a/deps/libav/libavformat/seek.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * seek utility functions for use within format handlers
- *
- * Copyright (c) 2009 Ivan Schreter
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_SEEK_H
-#define AVFORMAT_SEEK_H
-
-#include "avformat.h"
-
-/**
- * structure to store parser state of one AVStream
- */
-typedef struct AVParserStreamState {
-    // saved members of AVStream
-    AVCodecParserContext   *parser;
-    int64_t                 last_IP_pts;
-    int64_t                 cur_dts;
-    int                     probe_packets;
-} AVParserStreamState;
-
-/**
- * structure to store parser state of AVFormat
- */
-typedef struct AVParserState {
-    int64_t         fpos;                   ///< file position at the time of call
-
-    // saved members of AVFormatContext
-    AVPacketList   *packet_buffer;          ///< packet buffer of original state
-    AVPacketList   *parse_queue;            ///< parse queue of original state
-    AVPacketList   *raw_packet_buffer;      ///< raw packet buffer of original state
-    int raw_packet_buffer_remaining_size;   ///< remaining space in raw_packet_buffer
-
-    // saved info for streams
-    int                  nb_streams;        ///< number of streams with stored state
-    AVParserStreamState *stream_states;     ///< states of individual streams (array)
-} AVParserState;
-
-/**
- * Search for the sync point of all active streams.
- *
- * This routine is not supposed to be called directly by a user application,
- * but by demuxers.
- *
- * A sync point is defined as a point in stream, such that, when decoding start
- * from this point, the decoded output of all streams synchronizes closest
- * to the given timestamp ts. This routine also takes timestamp limits into account.
- * Thus, the output will synchronize no sooner than ts_min and no later than ts_max.
- *
- * @param stream_index stream index for time base reference of timestamps
- * @param pos          approximate position where to start searching for key frames
- * @param min_ts       minimum allowed timestamp (position, if AVSEEK_FLAG_BYTE set)
- * @param ts           target timestamp (or position, if AVSEEK_FLAG_BYTE set in flags)
- * @param max_ts       maximum allowed timestamp (position, if AVSEEK_FLAG_BYTE set)
- * @param flags        if AVSEEK_FLAG_ANY is set, seek to any frame, otherwise only
- *                     to a keyframe. If AVSEEK_FLAG_BYTE is set, search by
- *                     position, not by timestamp.
- * @return -1 if no such sync point could be found, otherwise stream position
- *                     (stream is repositioned to this position)
- */
-int64_t ff_gen_syncpoint_search(AVFormatContext *s,
-                                int stream_index,
-                                int64_t pos,
-                                int64_t min_ts,
-                                int64_t ts,
-                                int64_t max_ts,
-                                int flags);
-
-/**
- * Store current parser state and file position.
- *
- * This function can be used by demuxers before a destructive seeking algorithm
- * to store the parser state. Depending on the outcome of the seek, either the original
- * state can be restored or the new state kept and the original state freed.
- *
- * @note As a side effect, the original parser state is reset, since structures
- *       are relinked to the stored state instead of being deeply-copied (for
- *       performance reasons and to keep the code simple).
- *
- * @param s context from which to save state
- * @return parser state object or NULL if memory could not be allocated
- */
-AVParserState *ff_store_parser_state(AVFormatContext *s);
-
-/**
- * Restore previously saved parser state and file position.
- *
- * Saved state will be invalidated and freed by this call, since internal
- * structures will be relinked back to the stored state instead of being
- * deeply-copied.
- *
- * @param s     context to which to restore state (same as used for storing state)
- * @param state state to restore
- */
-void ff_restore_parser_state(AVFormatContext *s, AVParserState *state);
-
-/**
- * Free previously saved parser state.
- *
- * @param s     context to which the state belongs (same as used for storing state)
- * @param state state to free
- */
-void ff_free_parser_state(AVFormatContext *s, AVParserState *state);
-
-#endif /* AVFORMAT_SEEK_H */
diff --git a/deps/libav/libavformat/segafilm.c b/deps/libav/libavformat/segafilm.c
deleted file mode 100644
index 53e2066..0000000
--- a/deps/libav/libavformat/segafilm.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Sega FILM Format (CPK) Demuxer
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sega FILM (.cpk) file demuxer
- * by Mike Melanson (melanson at pcisys.net)
- * For more information regarding the Sega FILM file format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define FILM_TAG MKBETAG('F', 'I', 'L', 'M')
-#define FDSC_TAG MKBETAG('F', 'D', 'S', 'C')
-#define STAB_TAG MKBETAG('S', 'T', 'A', 'B')
-#define CVID_TAG MKBETAG('c', 'v', 'i', 'd')
-#define RAW_TAG  MKBETAG('r', 'a', 'w', ' ')
-
-typedef struct {
-  int stream;
-  int64_t sample_offset;
-  unsigned int sample_size;
-  int64_t pts;
-  int keyframe;
-} film_sample;
-
-typedef struct FilmDemuxContext {
-    int video_stream_index;
-    int audio_stream_index;
-
-    enum AVCodecID audio_type;
-    unsigned int audio_samplerate;
-    unsigned int audio_bits;
-    unsigned int audio_channels;
-
-    enum AVCodecID video_type;
-    unsigned int sample_count;
-    film_sample *sample_table;
-    unsigned int current_sample;
-
-    unsigned int base_clock;
-    unsigned int version;
-
-    /* buffer used for interleaving stereo PCM data */
-    unsigned char *stereo_buffer;
-    int stereo_buffer_size;
-} FilmDemuxContext;
-
-static int film_probe(AVProbeData *p)
-{
-    if (AV_RB32(&p->buf[0]) != FILM_TAG)
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int film_read_close(AVFormatContext *s)
-{
-    FilmDemuxContext *film = s->priv_data;
-
-    av_freep(&film->sample_table);
-    av_freep(&film->stereo_buffer);
-
-    return 0;
-}
-
-static int film_read_header(AVFormatContext *s)
-{
-    FilmDemuxContext *film = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    unsigned char scratch[256];
-    int i, ret;
-    unsigned int data_offset;
-    unsigned int audio_frame_counter;
-
-    film->sample_table = NULL;
-    film->stereo_buffer = NULL;
-    film->stereo_buffer_size = 0;
-
-    /* load the main FILM header */
-    if (avio_read(pb, scratch, 16) != 16)
-        return AVERROR(EIO);
-    data_offset = AV_RB32(&scratch[4]);
-    film->version = AV_RB32(&scratch[8]);
-
-    /* load the FDSC chunk */
-    if (film->version == 0) {
-        /* special case for Lemmings .film files; 20-byte header */
-        if (avio_read(pb, scratch, 20) != 20)
-            return AVERROR(EIO);
-        /* make some assumptions about the audio parameters */
-        film->audio_type = AV_CODEC_ID_PCM_S8;
-        film->audio_samplerate = 22050;
-        film->audio_channels = 1;
-        film->audio_bits = 8;
-    } else {
-        /* normal Saturn .cpk files; 32-byte header */
-        if (avio_read(pb, scratch, 32) != 32)
-            return AVERROR(EIO);
-        film->audio_samplerate = AV_RB16(&scratch[24]);
-        film->audio_channels = scratch[21];
-        if (!film->audio_channels || film->audio_channels > 2) {
-            av_log(s, AV_LOG_ERROR,
-                   "Invalid number of channels: %d\n", film->audio_channels);
-            return AVERROR_INVALIDDATA;
-        }
-        film->audio_bits = scratch[22];
-        if (scratch[23] == 2)
-            film->audio_type = AV_CODEC_ID_ADPCM_ADX;
-        else if (film->audio_channels > 0) {
-            if (film->audio_bits == 8)
-                film->audio_type = AV_CODEC_ID_PCM_S8;
-            else if (film->audio_bits == 16)
-                film->audio_type = AV_CODEC_ID_PCM_S16BE;
-            else
-                film->audio_type = AV_CODEC_ID_NONE;
-        } else
-            film->audio_type = AV_CODEC_ID_NONE;
-    }
-
-    if (AV_RB32(&scratch[0]) != FDSC_TAG)
-        return AVERROR_INVALIDDATA;
-
-    if (AV_RB32(&scratch[8]) == CVID_TAG) {
-        film->video_type = AV_CODEC_ID_CINEPAK;
-    } else if (AV_RB32(&scratch[8]) == RAW_TAG) {
-        film->video_type = AV_CODEC_ID_RAWVIDEO;
-    } else {
-        film->video_type = AV_CODEC_ID_NONE;
-    }
-
-    /* initialize the decoder streams */
-    if (film->video_type) {
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        film->video_stream_index = st->index;
-        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-        st->codec->codec_id = film->video_type;
-        st->codec->codec_tag = 0;  /* no fourcc */
-        st->codec->width = AV_RB32(&scratch[16]);
-        st->codec->height = AV_RB32(&scratch[12]);
-
-        if (film->video_type == AV_CODEC_ID_RAWVIDEO) {
-            if (scratch[20] == 24) {
-                st->codec->pix_fmt = AV_PIX_FMT_RGB24;
-            } else {
-                av_log(s, AV_LOG_ERROR, "raw video is using unhandled %dbpp\n", scratch[20]);
-                return -1;
-            }
-        }
-    }
-
-    if (film->audio_type) {
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        film->audio_stream_index = st->index;
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id = film->audio_type;
-        st->codec->codec_tag = 1;
-        st->codec->channels = film->audio_channels;
-        st->codec->sample_rate = film->audio_samplerate;
-
-        if (film->audio_type == AV_CODEC_ID_ADPCM_ADX) {
-            st->codec->bits_per_coded_sample = 18 * 8 / 32;
-            st->codec->block_align = st->codec->channels * 18;
-            st->need_parsing = AVSTREAM_PARSE_FULL;
-        } else {
-            st->codec->bits_per_coded_sample = film->audio_bits;
-            st->codec->block_align = st->codec->channels *
-                st->codec->bits_per_coded_sample / 8;
-        }
-
-        st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
-            st->codec->bits_per_coded_sample;
-    }
-
-    /* load the sample table */
-    if (avio_read(pb, scratch, 16) != 16)
-        return AVERROR(EIO);
-    if (AV_RB32(&scratch[0]) != STAB_TAG)
-        return AVERROR_INVALIDDATA;
-    film->base_clock = AV_RB32(&scratch[8]);
-    film->sample_count = AV_RB32(&scratch[12]);
-    if(film->sample_count >= UINT_MAX / sizeof(film_sample))
-        return -1;
-    film->sample_table = av_malloc(film->sample_count * sizeof(film_sample));
-    if (!film->sample_table)
-        return AVERROR(ENOMEM);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        st = s->streams[i];
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-            avpriv_set_pts_info(st, 33, 1, film->base_clock);
-        else
-            avpriv_set_pts_info(st, 64, 1, film->audio_samplerate);
-    }
-
-    audio_frame_counter = 0;
-    for (i = 0; i < film->sample_count; i++) {
-        /* load the next sample record and transfer it to an internal struct */
-        if (avio_read(pb, scratch, 16) != 16) {
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        film->sample_table[i].sample_offset =
-            data_offset + AV_RB32(&scratch[0]);
-        film->sample_table[i].sample_size = AV_RB32(&scratch[4]);
-        if (film->sample_table[i].sample_size > INT_MAX / 4) {
-            ret = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-        if (AV_RB32(&scratch[8]) == 0xFFFFFFFF) {
-            film->sample_table[i].stream = film->audio_stream_index;
-            film->sample_table[i].pts = audio_frame_counter;
-
-            if (film->audio_type == AV_CODEC_ID_ADPCM_ADX)
-                audio_frame_counter += (film->sample_table[i].sample_size * 32 /
-                    (18 * film->audio_channels));
-            else if (film->audio_type != AV_CODEC_ID_NONE)
-                audio_frame_counter += (film->sample_table[i].sample_size /
-                    (film->audio_channels * film->audio_bits / 8));
-        } else {
-            film->sample_table[i].stream = film->video_stream_index;
-            film->sample_table[i].pts = AV_RB32(&scratch[8]) & 0x7FFFFFFF;
-            film->sample_table[i].keyframe = (scratch[8] & 0x80) ? 0 : 1;
-        }
-    }
-
-    film->current_sample = 0;
-
-    return 0;
-fail:
-    film_read_close(s);
-    return ret;
-}
-
-static int film_read_packet(AVFormatContext *s,
-                            AVPacket *pkt)
-{
-    FilmDemuxContext *film = s->priv_data;
-    AVIOContext *pb = s->pb;
-    film_sample *sample;
-    int ret = 0;
-    int i;
-    int left, right;
-
-    if (film->current_sample >= film->sample_count)
-        return AVERROR(EIO);
-
-    sample = &film->sample_table[film->current_sample];
-
-    /* position the stream (will probably be there anyway) */
-    avio_seek(pb, sample->sample_offset, SEEK_SET);
-
-    /* do a special song and dance when loading FILM Cinepak chunks */
-    if ((sample->stream == film->video_stream_index) &&
-        (film->video_type == AV_CODEC_ID_CINEPAK)) {
-        pkt->pos= avio_tell(pb);
-        if (av_new_packet(pkt, sample->sample_size))
-            return AVERROR(ENOMEM);
-        avio_read(pb, pkt->data, sample->sample_size);
-    } else if ((sample->stream == film->audio_stream_index) &&
-        (film->audio_channels == 2) &&
-        (film->audio_type != AV_CODEC_ID_ADPCM_ADX)) {
-        /* stereo PCM needs to be interleaved */
-
-        if (av_new_packet(pkt, sample->sample_size))
-            return AVERROR(ENOMEM);
-
-        /* make sure the interleave buffer is large enough */
-        if (sample->sample_size > film->stereo_buffer_size) {
-            av_free(film->stereo_buffer);
-            film->stereo_buffer_size = sample->sample_size;
-            film->stereo_buffer = av_malloc(film->stereo_buffer_size);
-            if (!film->stereo_buffer) {
-                film->stereo_buffer_size = 0;
-                return AVERROR(ENOMEM);
-            }
-        }
-
-        pkt->pos= avio_tell(pb);
-        ret = avio_read(pb, film->stereo_buffer, sample->sample_size);
-        if (ret != sample->sample_size)
-            ret = AVERROR(EIO);
-
-        left = 0;
-        right = sample->sample_size / 2;
-        for (i = 0; i < sample->sample_size; ) {
-            if (film->audio_bits == 8) {
-                pkt->data[i++] = film->stereo_buffer[left++];
-                pkt->data[i++] = film->stereo_buffer[right++];
-            } else {
-                pkt->data[i++] = film->stereo_buffer[left++];
-                pkt->data[i++] = film->stereo_buffer[left++];
-                pkt->data[i++] = film->stereo_buffer[right++];
-                pkt->data[i++] = film->stereo_buffer[right++];
-            }
-        }
-    } else {
-        ret= av_get_packet(pb, pkt, sample->sample_size);
-        if (ret != sample->sample_size)
-            ret = AVERROR(EIO);
-    }
-
-    pkt->stream_index = sample->stream;
-    pkt->pts = sample->pts;
-
-    film->current_sample++;
-
-    return ret;
-}
-
-AVInputFormat ff_segafilm_demuxer = {
-    .name           = "film_cpk",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"),
-    .priv_data_size = sizeof(FilmDemuxContext),
-    .read_probe     = film_probe,
-    .read_header    = film_read_header,
-    .read_packet    = film_read_packet,
-    .read_close     = film_read_close,
-};
diff --git a/deps/libav/libavformat/segment.c b/deps/libav/libavformat/segment.c
deleted file mode 100644
index d79a327..0000000
--- a/deps/libav/libavformat/segment.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Generic segmenter
- * Copyright (c) 2011, Luca Barbato
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <float.h>
-
-#include "avformat.h"
-#include "internal.h"
-
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/avstring.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/mathematics.h"
-
-typedef struct {
-    const AVClass *class;  /**< Class for private options. */
-    int number;
-    AVOutputFormat *oformat;
-    AVFormatContext *avf;
-    char *format;          /**< Set by a private option. */
-    char *list;            /**< Set by a private option. */
-    int  list_type;        /**< Set by a private option. */
-    float time;            /**< Set by a private option. */
-    int  size;             /**< Set by a private option. */
-    int  wrap;             /**< Set by a private option. */
-    int  individual_header_trailer; /**< Set by a private option. */
-    int  write_header_trailer; /**< Set by a private option. */
-    int64_t offset_time;
-    int64_t recording_time;
-    int has_video;
-    AVIOContext *pb;
-} SegmentContext;
-
-enum {
-    LIST_FLAT,
-    LIST_HLS
-};
-
-static int segment_mux_init(AVFormatContext *s)
-{
-    SegmentContext *seg = s->priv_data;
-    AVFormatContext *oc;
-    int i;
-
-    seg->avf = oc = avformat_alloc_context();
-    if (!oc)
-        return AVERROR(ENOMEM);
-
-    oc->oformat            = seg->oformat;
-    oc->interrupt_callback = s->interrupt_callback;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st;
-        if (!(st = avformat_new_stream(oc, NULL)))
-            return AVERROR(ENOMEM);
-        avcodec_copy_context(st->codec, s->streams[i]->codec);
-        st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
-    }
-
-    return 0;
-}
-
-static int segment_hls_window(AVFormatContext *s, int last)
-{
-    SegmentContext *seg = s->priv_data;
-    int i, ret = 0;
-    char buf[1024];
-
-    if ((ret = avio_open2(&seg->pb, seg->list, AVIO_FLAG_WRITE,
-                              &s->interrupt_callback, NULL)) < 0)
-        goto fail;
-
-    avio_printf(seg->pb, "#EXTM3U\n");
-    avio_printf(seg->pb, "#EXT-X-VERSION:3\n");
-    avio_printf(seg->pb, "#EXT-X-TARGETDURATION:%d\n", (int)seg->time);
-    avio_printf(seg->pb, "#EXT-X-MEDIA-SEQUENCE:%d\n",
-                FFMAX(0, seg->number - seg->size));
-
-    for (i = FFMAX(0, seg->number - seg->size);
-         i < seg->number; i++) {
-        avio_printf(seg->pb, "#EXTINF:%d,\n", (int)seg->time);
-        av_get_frame_filename(buf, sizeof(buf), s->filename, i);
-        avio_printf(seg->pb, "%s\n", buf);
-    }
-
-    if (last)
-        avio_printf(seg->pb, "#EXT-X-ENDLIST\n");
-fail:
-    avio_closep(&seg->pb);
-    return ret;
-}
-
-static int segment_start(AVFormatContext *s, int write_header)
-{
-    SegmentContext *c = s->priv_data;
-    AVFormatContext *oc = c->avf;
-    int err = 0;
-
-    if (write_header) {
-        avformat_free_context(oc);
-        c->avf = NULL;
-        if ((err = segment_mux_init(s)) < 0)
-            return err;
-        oc = c->avf;
-    }
-
-    if (c->wrap)
-        c->number %= c->wrap;
-
-    if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
-                              s->filename, c->number++) < 0)
-        return AVERROR(EINVAL);
-
-    if ((err = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
-                          &s->interrupt_callback, NULL)) < 0)
-        return err;
-
-    if (oc->oformat->priv_class && oc->priv_data)
-        av_opt_set(oc->priv_data, "resend_headers", "1", 0); /* mpegts specific */
-
-    if (write_header) {
-        if ((err = avformat_write_header(oc, NULL)) < 0)
-            return err;
-    }
-
-    return 0;
-}
-
-static int segment_end(AVFormatContext *oc, int write_trailer)
-{
-    int ret = 0;
-
-    av_write_frame(oc, NULL); /* Flush any buffered data (fragmented mp4) */
-    if (write_trailer)
-        av_write_trailer(oc);
-    avio_close(oc->pb);
-
-    return ret;
-}
-
-static int open_null_ctx(AVIOContext **ctx)
-{
-    int buf_size = 32768;
-    uint8_t *buf = av_malloc(buf_size);
-    if (!buf)
-        return AVERROR(ENOMEM);
-    *ctx = avio_alloc_context(buf, buf_size, AVIO_FLAG_WRITE, NULL, NULL, NULL, NULL);
-    if (!*ctx) {
-        av_free(buf);
-        return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
-static void close_null_ctx(AVIOContext *pb)
-{
-    av_free(pb->buffer);
-    av_free(pb);
-}
-
-static int seg_write_header(AVFormatContext *s)
-{
-    SegmentContext *seg = s->priv_data;
-    AVFormatContext *oc = NULL;
-    int ret, i;
-
-    seg->number = 0;
-    seg->offset_time = 0;
-    seg->recording_time = seg->time * 1000000;
-    if (!seg->write_header_trailer)
-        seg->individual_header_trailer = 0;
-
-    if (seg->list && seg->list_type != LIST_HLS)
-        if ((ret = avio_open2(&seg->pb, seg->list, AVIO_FLAG_WRITE,
-                              &s->interrupt_callback, NULL)) < 0)
-            goto fail;
-
-    for (i = 0; i < s->nb_streams; i++)
-        seg->has_video +=
-            (s->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO);
-
-    if (seg->has_video > 1)
-        av_log(s, AV_LOG_WARNING,
-               "More than a single video stream present, "
-               "expect issues decoding it.\n");
-
-    seg->oformat = av_guess_format(seg->format, s->filename, NULL);
-
-    if (!seg->oformat) {
-        ret = AVERROR_MUXER_NOT_FOUND;
-        goto fail;
-    }
-    if (seg->oformat->flags & AVFMT_NOFILE) {
-        av_log(s, AV_LOG_ERROR, "format %s not supported.\n",
-               seg->oformat->name);
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-
-    if ((ret = segment_mux_init(s)) < 0)
-        goto fail;
-    oc = seg->avf;
-
-    if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
-                              s->filename, seg->number++) < 0) {
-        ret = AVERROR(EINVAL);
-        goto fail;
-    }
-
-    if (seg->write_header_trailer) {
-        if ((ret = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
-                              &s->interrupt_callback, NULL)) < 0)
-            goto fail;
-    } else {
-        if ((ret = open_null_ctx(&oc->pb)) < 0)
-            goto fail;
-    }
-
-    if ((ret = avformat_write_header(oc, NULL)) < 0) {
-        avio_close(oc->pb);
-        goto fail;
-    }
-
-    if (!seg->write_header_trailer) {
-        close_null_ctx(oc->pb);
-        if ((ret = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
-                              &s->interrupt_callback, NULL)) < 0)
-            goto fail;
-    }
-
-    if (seg->list) {
-        if (seg->list_type == LIST_HLS) {
-            if ((ret = segment_hls_window(s, 0)) < 0)
-                goto fail;
-        } else {
-            avio_printf(seg->pb, "%s\n", oc->filename);
-            avio_flush(seg->pb);
-        }
-    }
-
-fail:
-    if (ret) {
-        if (seg->list)
-            avio_close(seg->pb);
-        if (seg->avf)
-            avformat_free_context(seg->avf);
-    }
-    return ret;
-}
-
-static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    SegmentContext *seg = s->priv_data;
-    AVFormatContext *oc = seg->avf;
-    AVStream *st = s->streams[pkt->stream_index];
-    int64_t end_pts = seg->recording_time * seg->number;
-    int ret, can_split = 1;
-
-    if (seg->has_video) {
-        can_split = st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-                    pkt->flags & AV_PKT_FLAG_KEY;
-    }
-
-    if (can_split && av_compare_ts(pkt->pts, st->time_base, end_pts,
-                                   AV_TIME_BASE_Q) >= 0) {
-        av_log(s, AV_LOG_DEBUG, "Next segment starts at %d %"PRId64"\n",
-               pkt->stream_index, pkt->pts);
-
-        ret = segment_end(oc, seg->individual_header_trailer);
-
-        if (!ret)
-            ret = segment_start(s, seg->individual_header_trailer);
-
-        if (ret)
-            goto fail;
-
-        oc = seg->avf;
-
-        if (seg->list) {
-            if (seg->list_type == LIST_HLS) {
-                if ((ret = segment_hls_window(s, 0)) < 0)
-                    goto fail;
-            } else {
-                avio_printf(seg->pb, "%s\n", oc->filename);
-                avio_flush(seg->pb);
-                if (seg->size && !(seg->number % seg->size)) {
-                    avio_closep(&seg->pb);
-                    if ((ret = avio_open2(&seg->pb, seg->list, AVIO_FLAG_WRITE,
-                                          &s->interrupt_callback, NULL)) < 0)
-                        goto fail;
-                }
-            }
-        }
-    }
-
-    ret = ff_write_chained(oc, pkt->stream_index, pkt, s);
-
-fail:
-    if (ret < 0) {
-        if (seg->list)
-            avio_close(seg->pb);
-        avformat_free_context(oc);
-    }
-
-    return ret;
-}
-
-static int seg_write_trailer(struct AVFormatContext *s)
-{
-    SegmentContext *seg = s->priv_data;
-    AVFormatContext *oc = seg->avf;
-    int ret;
-    if (!seg->write_header_trailer) {
-        if ((ret = segment_end(oc, 0)) < 0)
-            goto fail;
-        open_null_ctx(&oc->pb);
-        ret = av_write_trailer(oc);
-        close_null_ctx(oc->pb);
-    } else {
-        ret = segment_end(oc, 1);
-    }
-
-    if (ret < 0)
-        goto fail;
-
-    if (seg->list && seg->list_type == LIST_HLS) {
-        if ((ret = segment_hls_window(s, 1) < 0))
-            goto fail;
-    }
-
-fail:
-    avio_close(seg->pb);
-    avformat_free_context(oc);
-    return ret;
-}
-
-#define OFFSET(x) offsetof(SegmentContext, x)
-#define E AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "segment_format",    "container format used for the segments",  OFFSET(format),  AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,       E },
-    { "segment_time",      "segment length in seconds",               OFFSET(time),    AV_OPT_TYPE_FLOAT,  {.dbl = 2},     0, FLT_MAX, E },
-    { "segment_list",      "output the segment list",                 OFFSET(list),    AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,       E },
-    { "segment_list_size", "maximum number of playlist entries",      OFFSET(size),    AV_OPT_TYPE_INT,    {.i64 = 5},     0, INT_MAX, E },
-    { "segment_list_type", "segment list format",                     OFFSET(list_type),    AV_OPT_TYPE_INT,    {.i64 = LIST_FLAT},     0, 2, E, "list_type" },
-    {   "flat",            "plain list (default)",                    0,               AV_OPT_TYPE_CONST,  {.i64 = LIST_FLAT}, 0, 0, E, "list_type" },
-    {   "hls",             "Apple HTTP Live Streaming compatible",    0,               AV_OPT_TYPE_CONST,  {.i64 = LIST_HLS},  0, 0, E, "list_type" },
-    { "segment_wrap",      "number after which the index wraps",      OFFSET(wrap),    AV_OPT_TYPE_INT,    {.i64 = 0},     0, INT_MAX, E },
-    { "individual_header_trailer", "write header/trailer to each segment", OFFSET(individual_header_trailer), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E },
-    { "write_header_trailer", "write a header to the first segment and a trailer to the last one", OFFSET(write_header_trailer), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E },
-    { NULL },
-};
-
-static const AVClass seg_class = {
-    .class_name = "segment muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-
-AVOutputFormat ff_segment_muxer = {
-    .name           = "segment",
-    .long_name      = NULL_IF_CONFIG_SMALL("segment"),
-    .priv_data_size = sizeof(SegmentContext),
-    .flags          = AVFMT_NOFILE,
-    .write_header   = seg_write_header,
-    .write_packet   = seg_write_packet,
-    .write_trailer  = seg_write_trailer,
-    .priv_class     = &seg_class,
-};
diff --git a/deps/libav/libavformat/sierravmd.c b/deps/libav/libavformat/sierravmd.c
deleted file mode 100644
index 8316388..0000000
--- a/deps/libav/libavformat/sierravmd.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Sierra VMD Format Demuxer
- * Copyright (c) 2004 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Sierra VMD file demuxer
- * by Vladimir "VAG" Gneushev (vagsoft at mail.ru)
- * for more information on the Sierra VMD file format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define VMD_HEADER_SIZE 0x0330
-#define BYTES_PER_FRAME_RECORD 16
-
-typedef struct {
-  int stream_index;
-  int64_t frame_offset;
-  unsigned int frame_size;
-  int64_t pts;
-  int keyframe;
-  unsigned char frame_record[BYTES_PER_FRAME_RECORD];
-} vmd_frame;
-
-typedef struct VmdDemuxContext {
-    int video_stream_index;
-    int audio_stream_index;
-
-    unsigned int frame_count;
-    unsigned int frames_per_block;
-    vmd_frame *frame_table;
-    unsigned int current_frame;
-    int is_indeo3;
-
-    int sample_rate;
-    int64_t audio_sample_counter;
-    int skiphdr;
-
-    unsigned char vmd_header[VMD_HEADER_SIZE];
-} VmdDemuxContext;
-
-static int vmd_probe(AVProbeData *p)
-{
-    int w, h;
-    if (p->buf_size < 16)
-        return 0;
-    /* check if the first 2 bytes of the file contain the appropriate size
-     * of a VMD header chunk */
-    if (AV_RL16(&p->buf[0]) != VMD_HEADER_SIZE - 2)
-        return 0;
-    w = AV_RL16(&p->buf[12]);
-    h = AV_RL16(&p->buf[14]);
-    if (!w || w > 2048 || !h || h > 2048)
-        return 0;
-
-    /* only return half certainty since this check is a bit sketchy */
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-static int vmd_read_header(AVFormatContext *s)
-{
-    VmdDemuxContext *vmd = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st = NULL, *vst;
-    unsigned int toc_offset;
-    unsigned char *raw_frame_table;
-    int raw_frame_table_size;
-    int64_t current_offset;
-    int i, j, ret;
-    unsigned int total_frames;
-    int64_t current_audio_pts = 0;
-    unsigned char chunk[BYTES_PER_FRAME_RECORD];
-    int num, den;
-    int sound_buffers;
-
-    /* fetch the main header, including the 2 header length bytes */
-    avio_seek(pb, 0, SEEK_SET);
-    if (avio_read(pb, vmd->vmd_header, VMD_HEADER_SIZE) != VMD_HEADER_SIZE)
-        return AVERROR(EIO);
-
-    if(vmd->vmd_header[24] == 'i' && vmd->vmd_header[25] == 'v' && vmd->vmd_header[26] == '3')
-        vmd->is_indeo3 = 1;
-    else
-        vmd->is_indeo3 = 0;
-    /* start up the decoders */
-    vst = avformat_new_stream(s, NULL);
-    if (!vst)
-        return AVERROR(ENOMEM);
-    avpriv_set_pts_info(vst, 33, 1, 10);
-    vmd->video_stream_index = vst->index;
-    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_id = vmd->is_indeo3 ? AV_CODEC_ID_INDEO3 : AV_CODEC_ID_VMDVIDEO;
-    vst->codec->codec_tag = 0;  /* no fourcc */
-    vst->codec->width = AV_RL16(&vmd->vmd_header[12]);
-    vst->codec->height = AV_RL16(&vmd->vmd_header[14]);
-    if(vmd->is_indeo3 && vst->codec->width > 320){
-        vst->codec->width >>= 1;
-        vst->codec->height >>= 1;
-    }
-    vst->codec->extradata_size = VMD_HEADER_SIZE;
-    vst->codec->extradata = av_mallocz(VMD_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
-    memcpy(vst->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE);
-
-    /* if sample rate is 0, assume no audio */
-    vmd->sample_rate = AV_RL16(&vmd->vmd_header[804]);
-    if (vmd->sample_rate) {
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return AVERROR(ENOMEM);
-        vmd->audio_stream_index = st->index;
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id = AV_CODEC_ID_VMDAUDIO;
-        st->codec->codec_tag = 0;  /* no fourcc */
-        if (vmd->vmd_header[811] & 0x80) {
-            st->codec->channels       = 2;
-            st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-        } else {
-            st->codec->channels       = 1;
-            st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-        }
-        st->codec->sample_rate = vmd->sample_rate;
-        st->codec->block_align = AV_RL16(&vmd->vmd_header[806]);
-        if (st->codec->block_align & 0x8000) {
-            st->codec->bits_per_coded_sample = 16;
-            st->codec->block_align = -(st->codec->block_align - 0x10000);
-        } else {
-            st->codec->bits_per_coded_sample = 8;
-        }
-        st->codec->bit_rate = st->codec->sample_rate *
-            st->codec->bits_per_coded_sample * st->codec->channels;
-
-        /* calculate pts */
-        num = st->codec->block_align;
-        den = st->codec->sample_rate * st->codec->channels;
-        av_reduce(&den, &num, den, num, (1UL<<31)-1);
-        avpriv_set_pts_info(vst, 33, num, den);
-        avpriv_set_pts_info(st, 33, num, den);
-    }
-
-    toc_offset = AV_RL32(&vmd->vmd_header[812]);
-    vmd->frame_count = AV_RL16(&vmd->vmd_header[6]);
-    vmd->frames_per_block = AV_RL16(&vmd->vmd_header[18]);
-    avio_seek(pb, toc_offset, SEEK_SET);
-
-    raw_frame_table = NULL;
-    vmd->frame_table = NULL;
-    sound_buffers = AV_RL16(&vmd->vmd_header[808]);
-    raw_frame_table_size = vmd->frame_count * 6;
-    if(vmd->frame_count * vmd->frames_per_block >= UINT_MAX / sizeof(vmd_frame) - sound_buffers){
-        av_log(s, AV_LOG_ERROR, "vmd->frame_count * vmd->frames_per_block too large\n");
-        return -1;
-    }
-    raw_frame_table = av_malloc(raw_frame_table_size);
-    vmd->frame_table = av_malloc((vmd->frame_count * vmd->frames_per_block + sound_buffers) * sizeof(vmd_frame));
-    if (!raw_frame_table || !vmd->frame_table) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-    if (avio_read(pb, raw_frame_table, raw_frame_table_size) !=
-        raw_frame_table_size) {
-        ret = AVERROR(EIO);
-        goto error;
-    }
-
-    total_frames = 0;
-    for (i = 0; i < vmd->frame_count; i++) {
-
-        current_offset = AV_RL32(&raw_frame_table[6 * i + 2]);
-
-        /* handle each entry in index block */
-        for (j = 0; j < vmd->frames_per_block; j++) {
-            int type;
-            uint32_t size;
-
-            avio_read(pb, chunk, BYTES_PER_FRAME_RECORD);
-            type = chunk[0];
-            size = AV_RL32(&chunk[2]);
-            if (size > INT_MAX / 2) {
-                av_log(s, AV_LOG_ERROR, "Invalid frame size\n");
-                ret = AVERROR_INVALIDDATA;
-                goto error;
-            }
-            if(!size && type != 1)
-                continue;
-            switch(type) {
-            case 1: /* Audio Chunk */
-                if (!st) break;
-                /* first audio chunk contains several audio buffers */
-                vmd->frame_table[total_frames].frame_offset = current_offset;
-                vmd->frame_table[total_frames].stream_index = vmd->audio_stream_index;
-                vmd->frame_table[total_frames].frame_size = size;
-                memcpy(vmd->frame_table[total_frames].frame_record, chunk, BYTES_PER_FRAME_RECORD);
-                vmd->frame_table[total_frames].pts = current_audio_pts;
-                total_frames++;
-                if(!current_audio_pts)
-                    current_audio_pts += sound_buffers - 1;
-                else
-                    current_audio_pts++;
-                break;
-            case 2: /* Video Chunk */
-                vmd->frame_table[total_frames].frame_offset = current_offset;
-                vmd->frame_table[total_frames].stream_index = vmd->video_stream_index;
-                vmd->frame_table[total_frames].frame_size = size;
-                memcpy(vmd->frame_table[total_frames].frame_record, chunk, BYTES_PER_FRAME_RECORD);
-                vmd->frame_table[total_frames].pts = i;
-                total_frames++;
-                break;
-            }
-            current_offset += size;
-        }
-    }
-
-    av_free(raw_frame_table);
-
-    vmd->current_frame = 0;
-    vmd->frame_count = total_frames;
-
-    return 0;
-
-error:
-    av_free(raw_frame_table);
-    av_free(vmd->frame_table);
-    return ret;
-}
-
-static int vmd_read_packet(AVFormatContext *s,
-                           AVPacket *pkt)
-{
-    VmdDemuxContext *vmd = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret = 0;
-    vmd_frame *frame;
-
-    if (vmd->current_frame >= vmd->frame_count)
-        return AVERROR(EIO);
-
-    frame = &vmd->frame_table[vmd->current_frame];
-    /* position the stream (will probably be there already) */
-    avio_seek(pb, frame->frame_offset, SEEK_SET);
-
-    if (av_new_packet(pkt, frame->frame_size + BYTES_PER_FRAME_RECORD))
-        return AVERROR(ENOMEM);
-    pkt->pos= avio_tell(pb);
-    memcpy(pkt->data, frame->frame_record, BYTES_PER_FRAME_RECORD);
-    if(vmd->is_indeo3 && frame->frame_record[0] == 0x02)
-        ret = avio_read(pb, pkt->data, frame->frame_size);
-    else
-        ret = avio_read(pb, pkt->data + BYTES_PER_FRAME_RECORD,
-            frame->frame_size);
-
-    if (ret != frame->frame_size) {
-        av_free_packet(pkt);
-        ret = AVERROR(EIO);
-    }
-    pkt->stream_index = frame->stream_index;
-    pkt->pts = frame->pts;
-    av_log(s, AV_LOG_DEBUG, " dispatching %s frame with %d bytes and pts %"PRId64"\n",
-            (frame->frame_record[0] == 0x02) ? "video" : "audio",
-            frame->frame_size + BYTES_PER_FRAME_RECORD,
-            pkt->pts);
-
-    vmd->current_frame++;
-
-    return ret;
-}
-
-static int vmd_read_close(AVFormatContext *s)
-{
-    VmdDemuxContext *vmd = s->priv_data;
-
-    av_free(vmd->frame_table);
-
-    return 0;
-}
-
-AVInputFormat ff_vmd_demuxer = {
-    .name           = "vmd",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sierra VMD"),
-    .priv_data_size = sizeof(VmdDemuxContext),
-    .read_probe     = vmd_probe,
-    .read_header    = vmd_read_header,
-    .read_packet    = vmd_read_packet,
-    .read_close     = vmd_read_close,
-};
diff --git a/deps/libav/libavformat/siff.c b/deps/libav/libavformat/siff.c
deleted file mode 100644
index 8ba7c60..0000000
--- a/deps/libav/libavformat/siff.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Beam Software SIFF demuxer
- * Copyright (c) 2007 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-enum SIFFTags{
-    TAG_SIFF = MKTAG('S', 'I', 'F', 'F'),
-    TAG_BODY = MKTAG('B', 'O', 'D', 'Y'),
-    TAG_VBHD = MKTAG('V', 'B', 'H', 'D'),
-    TAG_SHDR = MKTAG('S', 'H', 'D', 'R'),
-    TAG_VBV1 = MKTAG('V', 'B', 'V', '1'),
-    TAG_SOUN = MKTAG('S', 'O', 'U', 'N'),
-};
-
-enum VBFlags{
-    VB_HAS_GMC     = 0x01,
-    VB_HAS_AUDIO   = 0x04,
-    VB_HAS_VIDEO   = 0x08,
-    VB_HAS_PALETTE = 0x10,
-    VB_HAS_LENGTH  = 0x20
-};
-
-typedef struct SIFFContext{
-    int frames;
-    int cur_frame;
-    int rate;
-    int bits;
-    int block_align;
-
-    int has_video;
-    int has_audio;
-
-    int curstrm;
-    int pktsize;
-    int gmcsize;
-    int sndsize;
-
-    int flags;
-    uint8_t gmc[4];
-}SIFFContext;
-
-static int siff_probe(AVProbeData *p)
-{
-    uint32_t tag = AV_RL32(p->buf + 8);
-    /* check file header */
-    if (AV_RL32(p->buf) != TAG_SIFF ||
-        (tag != TAG_VBV1 && tag != TAG_SOUN))
-        return 0;
-    return AVPROBE_SCORE_MAX;
-}
-
-static int create_audio_stream(AVFormatContext *s, SIFFContext *c)
-{
-    AVStream *ast;
-    ast = avformat_new_stream(s, NULL);
-    if (!ast)
-        return -1;
-    ast->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    ast->codec->codec_id        = AV_CODEC_ID_PCM_U8;
-    ast->codec->channels        = 1;
-    ast->codec->channel_layout  = AV_CH_LAYOUT_MONO;
-    ast->codec->bits_per_coded_sample = 8;
-    ast->codec->sample_rate     = c->rate;
-    avpriv_set_pts_info(ast, 16, 1, c->rate);
-    ast->start_time = 0;
-    return 0;
-}
-
-static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, AVIOContext *pb)
-{
-    AVStream *st;
-    int width, height;
-
-    if (avio_rl32(pb) != TAG_VBHD){
-        av_log(s, AV_LOG_ERROR, "Header chunk is missing\n");
-        return -1;
-    }
-    if(avio_rb32(pb) != 32){
-        av_log(s, AV_LOG_ERROR, "Header chunk size is incorrect\n");
-        return -1;
-    }
-    if(avio_rl16(pb) != 1){
-        av_log(s, AV_LOG_ERROR, "Incorrect header version\n");
-        return -1;
-    }
-    width = avio_rl16(pb);
-    height = avio_rl16(pb);
-    avio_skip(pb, 4);
-    c->frames = avio_rl16(pb);
-    if(!c->frames){
-        av_log(s, AV_LOG_ERROR, "File contains no frames ???\n");
-        return -1;
-    }
-    c->bits = avio_rl16(pb);
-    c->rate = avio_rl16(pb);
-    c->block_align = c->rate * (c->bits >> 3);
-
-    avio_skip(pb, 16); //zeroes
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return -1;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = AV_CODEC_ID_VB;
-    st->codec->codec_tag  = MKTAG('V', 'B', 'V', '1');
-    st->codec->width      = width;
-    st->codec->height     = height;
-    st->codec->pix_fmt    = AV_PIX_FMT_PAL8;
-    avpriv_set_pts_info(st, 16, 1, 12);
-
-    c->cur_frame = 0;
-    c->has_video = 1;
-    c->has_audio = !!c->rate;
-    c->curstrm = -1;
-    if (c->has_audio && create_audio_stream(s, c) < 0)
-        return -1;
-    return 0;
-}
-
-static int siff_parse_soun(AVFormatContext *s, SIFFContext *c, AVIOContext *pb)
-{
-    if (avio_rl32(pb) != TAG_SHDR){
-        av_log(s, AV_LOG_ERROR, "Header chunk is missing\n");
-        return -1;
-    }
-    if(avio_rb32(pb) != 8){
-        av_log(s, AV_LOG_ERROR, "Header chunk size is incorrect\n");
-        return -1;
-    }
-    avio_skip(pb, 4); //unknown value
-    c->rate = avio_rl16(pb);
-    c->bits = avio_rl16(pb);
-    c->block_align = c->rate * (c->bits >> 3);
-    return create_audio_stream(s, c);
-}
-
-static int siff_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    SIFFContext *c = s->priv_data;
-    uint32_t tag;
-
-    if (avio_rl32(pb) != TAG_SIFF)
-        return -1;
-    avio_skip(pb, 4); //ignore size
-    tag = avio_rl32(pb);
-
-    if (tag != TAG_VBV1 && tag != TAG_SOUN){
-        av_log(s, AV_LOG_ERROR, "Not a VBV file\n");
-        return -1;
-    }
-
-    if (tag == TAG_VBV1 && siff_parse_vbv1(s, c, pb) < 0)
-        return -1;
-    if (tag == TAG_SOUN && siff_parse_soun(s, c, pb) < 0)
-        return -1;
-    if (avio_rl32(pb) != MKTAG('B', 'O', 'D', 'Y')){
-        av_log(s, AV_LOG_ERROR, "'BODY' chunk is missing\n");
-        return -1;
-    }
-    avio_skip(pb, 4); //ignore size
-
-    return 0;
-}
-
-static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    SIFFContext *c = s->priv_data;
-    int size;
-
-    if (c->has_video){
-        if (c->cur_frame >= c->frames)
-            return AVERROR(EIO);
-        if (c->curstrm == -1){
-            c->pktsize = avio_rl32(s->pb) - 4;
-            c->flags = avio_rl16(s->pb);
-            c->gmcsize = (c->flags & VB_HAS_GMC) ? 4 : 0;
-            if (c->gmcsize)
-                avio_read(s->pb, c->gmc, c->gmcsize);
-            c->sndsize = (c->flags & VB_HAS_AUDIO) ? avio_rl32(s->pb): 0;
-            c->curstrm = !!(c->flags & VB_HAS_AUDIO);
-        }
-
-        if (!c->curstrm){
-            size = c->pktsize - c->sndsize;
-            if (av_new_packet(pkt, size) < 0)
-                return AVERROR(ENOMEM);
-            AV_WL16(pkt->data, c->flags);
-            if (c->gmcsize)
-                memcpy(pkt->data + 2, c->gmc, c->gmcsize);
-            avio_read(s->pb, pkt->data + 2 + c->gmcsize, size - c->gmcsize - 2);
-            pkt->stream_index = 0;
-            c->curstrm = -1;
-        }else{
-            if ((size = av_get_packet(s->pb, pkt, c->sndsize - 4)) < 0)
-                return AVERROR(EIO);
-            pkt->stream_index = 1;
-            pkt->duration     = size;
-            c->curstrm = 0;
-        }
-        if(!c->cur_frame || c->curstrm)
-            pkt->flags |= AV_PKT_FLAG_KEY;
-        if (c->curstrm == -1)
-            c->cur_frame++;
-    }else{
-        size = av_get_packet(s->pb, pkt, c->block_align);
-        if(size <= 0)
-            return AVERROR(EIO);
-        pkt->duration = size;
-    }
-    return pkt->size;
-}
-
-AVInputFormat ff_siff_demuxer = {
-    .name           = "siff",
-    .long_name      = NULL_IF_CONFIG_SMALL("Beam Software SIFF"),
-    .priv_data_size = sizeof(SIFFContext),
-    .read_probe     = siff_probe,
-    .read_header    = siff_read_header,
-    .read_packet    = siff_read_packet,
-    .extensions     = "vb,son",
-};
diff --git a/deps/libav/libavformat/smacker.c b/deps/libav/libavformat/smacker.c
deleted file mode 100644
index 5af5e50..0000000
--- a/deps/libav/libavformat/smacker.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Smacker demuxer
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Based on http://wiki.multimedia.cx/index.php?title=Smacker
- */
-
-#include "libavutil/bswap.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define SMACKER_PAL 0x01
-#define SMACKER_FLAG_RING_FRAME 0x01
-
-enum SAudFlags {
-    SMK_AUD_PACKED  = 0x80,
-    SMK_AUD_16BITS  = 0x20,
-    SMK_AUD_STEREO  = 0x10,
-    SMK_AUD_BINKAUD = 0x08,
-    SMK_AUD_USEDCT  = 0x04
-};
-
-typedef struct SmackerContext {
-    /* Smacker file header */
-    uint32_t magic;
-    uint32_t width, height;
-    uint32_t frames;
-    int      pts_inc;
-    uint32_t flags;
-    uint32_t audio[7];
-    uint32_t treesize;
-    uint32_t mmap_size, mclr_size, full_size, type_size;
-    uint8_t  aflags[7];
-    uint32_t rates[7];
-    uint32_t pad;
-    /* frame info */
-    uint32_t *frm_size;
-    uint8_t  *frm_flags;
-    /* internal variables */
-    int cur_frame;
-    int is_ver4;
-    int64_t cur_pts;
-    /* current frame for demuxing */
-    uint8_t pal[768];
-    int indexes[7];
-    int videoindex;
-    uint8_t *bufs[7];
-    int buf_sizes[7];
-    int stream_id[7];
-    int curstream;
-    int64_t nextpos;
-    int64_t aud_pts[7];
-} SmackerContext;
-
-typedef struct SmackerFrame {
-    int64_t pts;
-    int stream;
-} SmackerFrame;
-
-/* palette used in Smacker */
-static const uint8_t smk_pal[64] = {
-    0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C,
-    0x20, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
-    0x41, 0x45, 0x49, 0x4D, 0x51, 0x55, 0x59, 0x5D,
-    0x61, 0x65, 0x69, 0x6D, 0x71, 0x75, 0x79, 0x7D,
-    0x82, 0x86, 0x8A, 0x8E, 0x92, 0x96, 0x9A, 0x9E,
-    0xA2, 0xA6, 0xAA, 0xAE, 0xB2, 0xB6, 0xBA, 0xBE,
-    0xC3, 0xC7, 0xCB, 0xCF, 0xD3, 0xD7, 0xDB, 0xDF,
-    0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF
-};
-
-
-static int smacker_probe(AVProbeData *p)
-{
-    if(p->buf[0] == 'S' && p->buf[1] == 'M' && p->buf[2] == 'K'
-        && (p->buf[3] == '2' || p->buf[3] == '4'))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int smacker_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    SmackerContext *smk = s->priv_data;
-    AVStream *st, *ast[7];
-    int i, ret;
-    int tbase;
-
-    /* read and check header */
-    smk->magic = avio_rl32(pb);
-    if (smk->magic != MKTAG('S', 'M', 'K', '2') && smk->magic != MKTAG('S', 'M', 'K', '4'))
-        return -1;
-    smk->width = avio_rl32(pb);
-    smk->height = avio_rl32(pb);
-    smk->frames = avio_rl32(pb);
-    smk->pts_inc = (int32_t)avio_rl32(pb);
-    smk->flags = avio_rl32(pb);
-    if(smk->flags & SMACKER_FLAG_RING_FRAME)
-        smk->frames++;
-    for(i = 0; i < 7; i++)
-        smk->audio[i] = avio_rl32(pb);
-    smk->treesize = avio_rl32(pb);
-
-    if(smk->treesize >= UINT_MAX/4){ // smk->treesize + 16 must not overflow (this check is probably redundant)
-        av_log(s, AV_LOG_ERROR, "treesize too large\n");
-        return -1;
-    }
-
-//FIXME remove extradata "rebuilding"
-    smk->mmap_size = avio_rl32(pb);
-    smk->mclr_size = avio_rl32(pb);
-    smk->full_size = avio_rl32(pb);
-    smk->type_size = avio_rl32(pb);
-    for(i = 0; i < 7; i++) {
-        smk->rates[i]  = avio_rl24(pb);
-        smk->aflags[i] = avio_r8(pb);
-    }
-    smk->pad = avio_rl32(pb);
-    /* setup data */
-    if(smk->frames > 0xFFFFFF) {
-        av_log(s, AV_LOG_ERROR, "Too many frames: %i\n", smk->frames);
-        return -1;
-    }
-    smk->frm_size = av_malloc(smk->frames * 4);
-    smk->frm_flags = av_malloc(smk->frames);
-
-    smk->is_ver4 = (smk->magic != MKTAG('S', 'M', 'K', '2'));
-
-    /* read frame info */
-    for(i = 0; i < smk->frames; i++) {
-        smk->frm_size[i] = avio_rl32(pb);
-    }
-    for(i = 0; i < smk->frames; i++) {
-        smk->frm_flags[i] = avio_r8(pb);
-    }
-
-    /* init video codec */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return -1;
-    smk->videoindex = st->index;
-    st->codec->width = smk->width;
-    st->codec->height = smk->height;
-    st->codec->pix_fmt = AV_PIX_FMT_PAL8;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_SMACKVIDEO;
-    st->codec->codec_tag = smk->magic;
-    /* Smacker uses 100000 as internal timebase */
-    if(smk->pts_inc < 0)
-        smk->pts_inc = -smk->pts_inc;
-    else
-        smk->pts_inc *= 100;
-    tbase = 100000;
-    av_reduce(&tbase, &smk->pts_inc, tbase, smk->pts_inc, (1UL<<31)-1);
-    avpriv_set_pts_info(st, 33, smk->pts_inc, tbase);
-    st->duration = smk->frames;
-    /* handle possible audio streams */
-    for(i = 0; i < 7; i++) {
-        smk->indexes[i] = -1;
-        if (smk->rates[i]) {
-            ast[i] = avformat_new_stream(s, NULL);
-            smk->indexes[i] = ast[i]->index;
-            ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            if (smk->aflags[i] & SMK_AUD_BINKAUD) {
-                ast[i]->codec->codec_id = AV_CODEC_ID_BINKAUDIO_RDFT;
-            } else if (smk->aflags[i] & SMK_AUD_USEDCT) {
-                ast[i]->codec->codec_id = AV_CODEC_ID_BINKAUDIO_DCT;
-            } else if (smk->aflags[i] & SMK_AUD_PACKED){
-                ast[i]->codec->codec_id = AV_CODEC_ID_SMACKAUDIO;
-                ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A');
-            } else {
-                ast[i]->codec->codec_id = AV_CODEC_ID_PCM_U8;
-            }
-            if (smk->aflags[i] & SMK_AUD_STEREO) {
-                ast[i]->codec->channels       = 2;
-                ast[i]->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-            } else {
-                ast[i]->codec->channels       = 1;
-                ast[i]->codec->channel_layout = AV_CH_LAYOUT_MONO;
-            }
-            ast[i]->codec->sample_rate = smk->rates[i];
-            ast[i]->codec->bits_per_coded_sample = (smk->aflags[i] & SMK_AUD_16BITS) ? 16 : 8;
-            if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == AV_CODEC_ID_PCM_U8)
-                ast[i]->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
-            avpriv_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate
-                    * ast[i]->codec->channels * ast[i]->codec->bits_per_coded_sample / 8);
-        }
-    }
-
-
-    /* load trees to extradata, they will be unpacked by decoder */
-    st->codec->extradata = av_mallocz(smk->treesize + 16 +
-                                      FF_INPUT_BUFFER_PADDING_SIZE);
-    st->codec->extradata_size = smk->treesize + 16;
-    if(!st->codec->extradata){
-        av_log(s, AV_LOG_ERROR, "Cannot allocate %i bytes of extradata\n", smk->treesize + 16);
-        av_free(smk->frm_size);
-        av_free(smk->frm_flags);
-        return -1;
-    }
-    ret = avio_read(pb, st->codec->extradata + 16, st->codec->extradata_size - 16);
-    if(ret != st->codec->extradata_size - 16){
-        av_free(smk->frm_size);
-        av_free(smk->frm_flags);
-        return AVERROR(EIO);
-    }
-    ((int32_t*)st->codec->extradata)[0] = av_le2ne32(smk->mmap_size);
-    ((int32_t*)st->codec->extradata)[1] = av_le2ne32(smk->mclr_size);
-    ((int32_t*)st->codec->extradata)[2] = av_le2ne32(smk->full_size);
-    ((int32_t*)st->codec->extradata)[3] = av_le2ne32(smk->type_size);
-
-    smk->curstream = -1;
-    smk->nextpos = avio_tell(pb);
-
-    return 0;
-}
-
-
-static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    SmackerContext *smk = s->priv_data;
-    int flags;
-    int ret;
-    int i;
-    int frame_size = 0;
-    int palchange = 0;
-
-    if (s->pb->eof_reached || smk->cur_frame >= smk->frames)
-        return AVERROR_EOF;
-
-    /* if we demuxed all streams, pass another frame */
-    if(smk->curstream < 0) {
-        avio_seek(s->pb, smk->nextpos, 0);
-        frame_size = smk->frm_size[smk->cur_frame] & (~3);
-        flags = smk->frm_flags[smk->cur_frame];
-        /* handle palette change event */
-        if(flags & SMACKER_PAL){
-            int size, sz, t, off, j, pos;
-            uint8_t *pal = smk->pal;
-            uint8_t oldpal[768];
-
-            memcpy(oldpal, pal, 768);
-            size = avio_r8(s->pb);
-            size = size * 4 - 1;
-            frame_size -= size;
-            frame_size--;
-            sz = 0;
-            pos = avio_tell(s->pb) + size;
-            while(sz < 256){
-                t = avio_r8(s->pb);
-                if(t & 0x80){ /* skip palette entries */
-                    sz += (t & 0x7F) + 1;
-                    pal += ((t & 0x7F) + 1) * 3;
-                } else if(t & 0x40){ /* copy with offset */
-                    off = avio_r8(s->pb);
-                    j = (t & 0x3F) + 1;
-                    if (off + j > 0x100) {
-                        av_log(s, AV_LOG_ERROR,
-                               "Invalid palette update, offset=%d length=%d extends beyond palette size\n",
-                               off, j);
-                        return AVERROR_INVALIDDATA;
-                    }
-                    off *= 3;
-                    while(j-- && sz < 256) {
-                        *pal++ = oldpal[off + 0];
-                        *pal++ = oldpal[off + 1];
-                        *pal++ = oldpal[off + 2];
-                        sz++;
-                        off += 3;
-                    }
-                } else { /* new entries */
-                    *pal++ = smk_pal[t];
-                    *pal++ = smk_pal[avio_r8(s->pb) & 0x3F];
-                    *pal++ = smk_pal[avio_r8(s->pb) & 0x3F];
-                    sz++;
-                }
-            }
-            avio_seek(s->pb, pos, 0);
-            palchange |= 1;
-        }
-        flags >>= 1;
-        smk->curstream = -1;
-        /* if audio chunks are present, put them to stack and retrieve later */
-        for(i = 0; i < 7; i++) {
-            if(flags & 1) {
-                uint32_t size;
-                int err;
-
-                size = avio_rl32(s->pb) - 4;
-                if (!size || size > frame_size) {
-                    av_log(s, AV_LOG_ERROR, "Invalid audio part size\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                frame_size -= size;
-                frame_size -= 4;
-                smk->curstream++;
-                if ((err = av_reallocp(&smk->bufs[smk->curstream], size)) < 0) {
-                    smk->buf_sizes[smk->curstream] = 0;
-                    return err;
-                }
-                smk->buf_sizes[smk->curstream] = size;
-                ret = avio_read(s->pb, smk->bufs[smk->curstream], size);
-                if(ret != size)
-                    return AVERROR(EIO);
-                smk->stream_id[smk->curstream] = smk->indexes[i];
-            }
-            flags >>= 1;
-        }
-        if (frame_size < 0 || frame_size >= INT_MAX/2)
-            return AVERROR_INVALIDDATA;
-        if (av_new_packet(pkt, frame_size + 769))
-            return AVERROR(ENOMEM);
-        if(smk->frm_size[smk->cur_frame] & 1)
-            palchange |= 2;
-        pkt->data[0] = palchange;
-        memcpy(pkt->data + 1, smk->pal, 768);
-        ret = avio_read(s->pb, pkt->data + 769, frame_size);
-        if(ret != frame_size)
-            return AVERROR(EIO);
-        pkt->stream_index = smk->videoindex;
-        pkt->pts          = smk->cur_frame;
-        pkt->size = ret + 769;
-        smk->cur_frame++;
-        smk->nextpos = avio_tell(s->pb);
-    } else {
-        if (smk->stream_id[smk->curstream] < 0)
-            return AVERROR_INVALIDDATA;
-        if (av_new_packet(pkt, smk->buf_sizes[smk->curstream]))
-            return AVERROR(ENOMEM);
-        memcpy(pkt->data, smk->bufs[smk->curstream], smk->buf_sizes[smk->curstream]);
-        pkt->size = smk->buf_sizes[smk->curstream];
-        pkt->stream_index = smk->stream_id[smk->curstream];
-        pkt->pts = smk->aud_pts[smk->curstream];
-        smk->aud_pts[smk->curstream] += AV_RL32(pkt->data);
-        smk->curstream--;
-    }
-
-    return 0;
-}
-
-static int smacker_read_close(AVFormatContext *s)
-{
-    SmackerContext *smk = s->priv_data;
-    int i;
-
-    for(i = 0; i < 7; i++)
-        av_free(smk->bufs[i]);
-    av_free(smk->frm_size);
-    av_free(smk->frm_flags);
-
-    return 0;
-}
-
-AVInputFormat ff_smacker_demuxer = {
-    .name           = "smk",
-    .long_name      = NULL_IF_CONFIG_SMALL("Smacker video"),
-    .priv_data_size = sizeof(SmackerContext),
-    .read_probe     = smacker_probe,
-    .read_header    = smacker_read_header,
-    .read_packet    = smacker_read_packet,
-    .read_close     = smacker_read_close,
-};
diff --git a/deps/libav/libavformat/smjpeg.c b/deps/libav/libavformat/smjpeg.c
deleted file mode 100644
index 52e45e9..0000000
--- a/deps/libav/libavformat/smjpeg.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SMJPEG common code
- * Copyright (c) 2011-2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * SMJPEG common code
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "smjpeg.h"
-
-const AVCodecTag ff_codec_smjpeg_video_tags[] = {
-    { AV_CODEC_ID_MJPEG,             MKTAG('J', 'F', 'I', 'F') },
-    { AV_CODEC_ID_NONE, 0 },
-};
-
-const AVCodecTag ff_codec_smjpeg_audio_tags[] = {
-    { AV_CODEC_ID_ADPCM_IMA_SMJPEG,  MKTAG('A', 'P', 'C', 'M') },
-    { AV_CODEC_ID_PCM_S16LE,         MKTAG('N', 'O', 'N', 'E') },
-    { AV_CODEC_ID_NONE, 0 },
-};
diff --git a/deps/libav/libavformat/smjpeg.h b/deps/libav/libavformat/smjpeg.h
deleted file mode 100644
index c56fe46..0000000
--- a/deps/libav/libavformat/smjpeg.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * SMJPEG common code
- * Copyright (c) 2011-2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * SMJPEG common code
- */
-
-#ifndef AVFORMAT_SMJPEG_H
-#define AVFORMAT_SMJPEG_H
-
-#include "internal.h"
-
-#define SMJPEG_MAGIC "\x0\xaSMJPEG"
-
-#define SMJPEG_DONE     MKTAG('D', 'O', 'N', 'E')
-#define SMJPEG_HEND     MKTAG('H', 'E', 'N', 'D')
-#define SMJPEG_SND      MKTAG('_', 'S', 'N', 'D')
-#define SMJPEG_SNDD     MKTAG('s', 'n', 'd', 'D')
-#define SMJPEG_TXT      MKTAG('_', 'T', 'X', 'T')
-#define SMJPEG_VID      MKTAG('_', 'V', 'I', 'D')
-#define SMJPEG_VIDD     MKTAG('v', 'i', 'd', 'D')
-
-extern const AVCodecTag ff_codec_smjpeg_video_tags[];
-extern const AVCodecTag ff_codec_smjpeg_audio_tags[];
-
-#endif /* AVFORMAT_SMJPEG_H */
diff --git a/deps/libav/libavformat/smjpegdec.c b/deps/libav/libavformat/smjpegdec.c
deleted file mode 100644
index 623df71..0000000
--- a/deps/libav/libavformat/smjpegdec.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * SMJPEG demuxer
- * Copyright (c) 2011 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This is a demuxer for Loki SDL Motion JPEG files
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "riff.h"
-#include "smjpeg.h"
-
-typedef struct SMJPEGContext {
-    int audio_stream_index;
-    int video_stream_index;
-} SMJPEGContext;
-
-static int smjpeg_probe(AVProbeData *p)
-{
-    if (!memcmp(p->buf, SMJPEG_MAGIC, 8))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int smjpeg_read_header(AVFormatContext *s)
-{
-    SMJPEGContext *sc = s->priv_data;
-    AVStream *ast = NULL, *vst = NULL;
-    AVIOContext *pb = s->pb;
-    uint32_t version, htype, hlength, duration;
-    char *comment;
-
-    avio_skip(pb, 8); // magic
-    version = avio_rb32(pb);
-    if (version)
-        avpriv_request_sample(s, "Unknown version %d", version);
-
-    duration = avio_rb32(pb); // in msec
-
-    while (!pb->eof_reached) {
-        htype = avio_rl32(pb);
-        switch (htype) {
-        case SMJPEG_TXT:
-            hlength = avio_rb32(pb);
-            if (!hlength || hlength > 512)
-                return AVERROR_INVALIDDATA;
-            comment = av_malloc(hlength + 1);
-            if (!comment)
-                return AVERROR(ENOMEM);
-            if (avio_read(pb, comment, hlength) != hlength) {
-                av_freep(&comment);
-                av_log(s, AV_LOG_ERROR, "error when reading comment\n");
-                return AVERROR_INVALIDDATA;
-            }
-            comment[hlength] = 0;
-            av_dict_set(&s->metadata, "comment", comment,
-                        AV_DICT_DONT_STRDUP_VAL);
-            break;
-        case SMJPEG_SND:
-            if (ast) {
-                avpriv_request_sample(s, "Multiple audio streams");
-                return AVERROR_PATCHWELCOME;
-            }
-            hlength = avio_rb32(pb);
-            if (hlength < 8)
-                return AVERROR_INVALIDDATA;
-            ast = avformat_new_stream(s, 0);
-            if (!ast)
-                return AVERROR(ENOMEM);
-            ast->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-            ast->codec->sample_rate = avio_rb16(pb);
-            ast->codec->bits_per_coded_sample = avio_r8(pb);
-            ast->codec->channels    = avio_r8(pb);
-            ast->codec->codec_tag   = avio_rl32(pb);
-            ast->codec->codec_id    = ff_codec_get_id(ff_codec_smjpeg_audio_tags,
-                                                      ast->codec->codec_tag);
-            ast->duration           = duration;
-            sc->audio_stream_index  = ast->index;
-            avpriv_set_pts_info(ast, 32, 1, 1000);
-            avio_skip(pb, hlength - 8);
-            break;
-        case SMJPEG_VID:
-            if (vst) {
-                avpriv_request_sample(s, "Multiple video streams");
-                return AVERROR_INVALIDDATA;
-            }
-            hlength = avio_rb32(pb);
-            if (hlength < 12)
-                return AVERROR_INVALIDDATA;
-            avio_skip(pb, 4); // number of frames
-            vst = avformat_new_stream(s, 0);
-            if (!vst)
-                return AVERROR(ENOMEM);
-            vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            vst->codec->width      = avio_rb16(pb);
-            vst->codec->height     = avio_rb16(pb);
-            vst->codec->codec_tag  = avio_rl32(pb);
-            vst->codec->codec_id   = ff_codec_get_id(ff_codec_smjpeg_video_tags,
-                                                     vst->codec->codec_tag);
-            vst->duration          = duration;
-            sc->video_stream_index = vst->index;
-            avpriv_set_pts_info(vst, 32, 1, 1000);
-            avio_skip(pb, hlength - 12);
-            break;
-        case SMJPEG_HEND:
-            return 0;
-        default:
-            av_log(s, AV_LOG_ERROR, "unknown header %x\n", htype);
-            return AVERROR_INVALIDDATA;
-        }
-    }
-
-    return AVERROR_EOF;
-}
-
-static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    SMJPEGContext *sc = s->priv_data;
-    uint32_t dtype, size, timestamp;
-    int64_t pos;
-    int ret;
-
-    if (s->pb->eof_reached)
-        return AVERROR_EOF;
-    pos   = avio_tell(s->pb);
-    dtype = avio_rl32(s->pb);
-    switch (dtype) {
-    case SMJPEG_SNDD:
-        timestamp = avio_rb32(s->pb);
-        size = avio_rb32(s->pb);
-        ret = av_get_packet(s->pb, pkt, size);
-        pkt->stream_index = sc->audio_stream_index;
-        pkt->pts = timestamp;
-        pkt->pos = pos;
-        break;
-    case SMJPEG_VIDD:
-        timestamp = avio_rb32(s->pb);
-        size = avio_rb32(s->pb);
-        ret = av_get_packet(s->pb, pkt, size);
-        pkt->stream_index = sc->video_stream_index;
-        pkt->pts = timestamp;
-        pkt->pos = pos;
-        break;
-    case SMJPEG_DONE:
-        ret = AVERROR_EOF;
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "unknown chunk %x\n", dtype);
-        ret = AVERROR_INVALIDDATA;
-        break;
-    }
-    return ret;
-}
-
-AVInputFormat ff_smjpeg_demuxer = {
-    .name           = "smjpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("Loki SDL MJPEG"),
-    .priv_data_size = sizeof(SMJPEGContext),
-    .read_probe     = smjpeg_probe,
-    .read_header    = smjpeg_read_header,
-    .read_packet    = smjpeg_read_packet,
-    .extensions     = "mjpg",
-    .flags          = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/smjpegenc.c b/deps/libav/libavformat/smjpegenc.c
deleted file mode 100644
index 551af89..0000000
--- a/deps/libav/libavformat/smjpegenc.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * SMJPEG muxer
- * Copyright (c) 2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * This is a muxer for Loki SDL Motion JPEG files
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "smjpeg.h"
-
-typedef struct SMJPEGMuxContext {
-    uint32_t duration;
-} SMJPEGMuxContext;
-
-static int smjpeg_write_header(AVFormatContext *s)
-{
-    AVDictionaryEntry *t = NULL;
-    AVIOContext *pb = s->pb;
-    int n, tag;
-
-    if (s->nb_streams > 2) {
-        av_log(s, AV_LOG_ERROR, "more than >2 streams are not supported\n");
-        return AVERROR(EINVAL);
-    }
-    avio_write(pb, SMJPEG_MAGIC, 8);
-    avio_wb32(pb, 0);
-    avio_wb32(pb, 0);
-
-    while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) {
-        avio_wl32(pb, SMJPEG_TXT);
-        avio_wb32(pb, strlen(t->key) + strlen(t->value) + 3);
-        avio_write(pb, t->key, strlen(t->key));
-        avio_write(pb, " = ", 3);
-        avio_write(pb, t->value, strlen(t->value));
-    }
-
-    for (n = 0; n < s->nb_streams; n++) {
-        AVStream *st = s->streams[n];
-        AVCodecContext *codec = st->codec;
-        if (codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            tag = ff_codec_get_tag(ff_codec_smjpeg_audio_tags, codec->codec_id);
-            if (!tag) {
-                av_log(s, AV_LOG_ERROR, "unsupported audio codec\n");
-                return AVERROR(EINVAL);
-            }
-            avio_wl32(pb, SMJPEG_SND);
-            avio_wb32(pb, 8);
-            avio_wb16(pb, codec->sample_rate);
-            avio_w8(pb, av_get_bits_per_sample(codec->codec_id));
-            avio_w8(pb, codec->channels);
-            avio_wl32(pb, tag);
-            avpriv_set_pts_info(st, 32, 1, 1000);
-        } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            tag = ff_codec_get_tag(ff_codec_smjpeg_video_tags, codec->codec_id);
-            if (!tag) {
-                av_log(s, AV_LOG_ERROR, "unsupported video codec\n");
-                return AVERROR(EINVAL);
-            }
-            avio_wl32(pb, SMJPEG_VID);
-            avio_wb32(pb, 12);
-            avio_wb32(pb, 0);
-            avio_wb16(pb, codec->width);
-            avio_wb16(pb, codec->height);
-            avio_wl32(pb, tag);
-            avpriv_set_pts_info(st, 32, 1, 1000);
-        }
-    }
-
-    avio_wl32(pb, SMJPEG_HEND);
-    avio_flush(pb);
-
-    return 0;
-}
-
-static int smjpeg_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    SMJPEGMuxContext *smc = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st = s->streams[pkt->stream_index];
-    AVCodecContext *codec = st->codec;
-
-    if (codec->codec_type == AVMEDIA_TYPE_AUDIO)
-        avio_wl32(pb, SMJPEG_SNDD);
-    else if (codec->codec_type == AVMEDIA_TYPE_VIDEO)
-        avio_wl32(pb, SMJPEG_VIDD);
-    else
-        return 0;
-
-    avio_wb32(pb, pkt->pts);
-    avio_wb32(pb, pkt->size);
-    avio_write(pb, pkt->data, pkt->size);
-
-    smc->duration = FFMAX(smc->duration, pkt->pts + pkt->duration);
-    return 0;
-}
-
-static int smjpeg_write_trailer(AVFormatContext *s)
-{
-    SMJPEGMuxContext *smc = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t currentpos;
-
-    if (pb->seekable) {
-        currentpos = avio_tell(pb);
-        avio_seek(pb, 12, SEEK_SET);
-        avio_wb32(pb, smc->duration);
-        avio_seek(pb, currentpos, SEEK_SET);
-    }
-
-    avio_wl32(pb, SMJPEG_DONE);
-
-    return 0;
-}
-
-AVOutputFormat ff_smjpeg_muxer = {
-    .name           = "smjpeg",
-    .long_name      = NULL_IF_CONFIG_SMALL("Loki SDL MJPEG"),
-    .priv_data_size = sizeof(SMJPEGMuxContext),
-    .audio_codec    = AV_CODEC_ID_PCM_S16LE,
-    .video_codec    = AV_CODEC_ID_MJPEG,
-    .write_header   = smjpeg_write_header,
-    .write_packet   = smjpeg_write_packet,
-    .write_trailer  = smjpeg_write_trailer,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
-    .codec_tag      = (const AVCodecTag *const []){ ff_codec_smjpeg_video_tags, ff_codec_smjpeg_audio_tags, 0 },
-};
diff --git a/deps/libav/libavformat/smoothstreamingenc.c b/deps/libav/libavformat/smoothstreamingenc.c
deleted file mode 100644
index 2fe01b1..0000000
--- a/deps/libav/libavformat/smoothstreamingenc.c
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
- * Live smooth streaming fragmenter
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <float.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "avformat.h"
-#include "internal.h"
-#include "os_support.h"
-#include "avc.h"
-#include "url.h"
-#include "isom.h"
-
-#include "libavutil/opt.h"
-#include "libavutil/avstring.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/intreadwrite.h"
-
-typedef struct {
-    char file[1024];
-    char infofile[1024];
-    int64_t start_time, duration;
-    int n;
-    int64_t start_pos, size;
-} Fragment;
-
-typedef struct {
-    AVFormatContext *ctx;
-    int ctx_inited;
-    char dirname[1024];
-    uint8_t iobuf[32768];
-    URLContext *out;  // Current output stream where all output is written
-    URLContext *out2; // Auxiliary output stream where all output is also written
-    URLContext *tail_out; // The actual main output stream, if we're currently seeked back to write elsewhere
-    int64_t tail_pos, cur_pos, cur_start_pos;
-    int packets_written;
-    const char *stream_type_tag;
-    int nb_fragments, fragments_size, fragment_index;
-    Fragment **fragments;
-
-    const char *fourcc;
-    char *private_str;
-    int packet_size;
-    int audio_tag;
-} OutputStream;
-
-typedef struct {
-    const AVClass *class;  /* Class for private options. */
-    int window_size;
-    int extra_window_size;
-    int lookahead_count;
-    int min_frag_duration;
-    int remove_at_exit;
-    OutputStream *streams;
-    int has_video, has_audio;
-    int nb_fragments;
-} SmoothStreamingContext;
-
-static int ism_write(void *opaque, uint8_t *buf, int buf_size)
-{
-    OutputStream *os = opaque;
-    if (os->out)
-        ffurl_write(os->out, buf, buf_size);
-    if (os->out2)
-        ffurl_write(os->out2, buf, buf_size);
-    os->cur_pos += buf_size;
-    if (os->cur_pos >= os->tail_pos)
-        os->tail_pos = os->cur_pos;
-    return buf_size;
-}
-
-static int64_t ism_seek(void *opaque, int64_t offset, int whence)
-{
-    OutputStream *os = opaque;
-    int i;
-    if (whence != SEEK_SET)
-        return AVERROR(ENOSYS);
-    if (os->tail_out) {
-        if (os->out) {
-            ffurl_close(os->out);
-        }
-        if (os->out2) {
-            ffurl_close(os->out2);
-        }
-        os->out = os->tail_out;
-        os->out2 = NULL;
-        os->tail_out = NULL;
-    }
-    if (offset >= os->cur_start_pos) {
-        if (os->out)
-            ffurl_seek(os->out, offset - os->cur_start_pos, SEEK_SET);
-        os->cur_pos = offset;
-        return offset;
-    }
-    for (i = os->nb_fragments - 1; i >= 0; i--) {
-        Fragment *frag = os->fragments[i];
-        if (offset >= frag->start_pos && offset < frag->start_pos + frag->size) {
-            int ret;
-            AVDictionary *opts = NULL;
-            os->tail_out = os->out;
-            av_dict_set(&opts, "truncate", "0", 0);
-            ret = ffurl_open(&os->out, frag->file, AVIO_FLAG_READ_WRITE, &os->ctx->interrupt_callback, &opts);
-            av_dict_free(&opts);
-            if (ret < 0) {
-                os->out = os->tail_out;
-                os->tail_out = NULL;
-                return ret;
-            }
-            av_dict_set(&opts, "truncate", "0", 0);
-            ffurl_open(&os->out2, frag->infofile, AVIO_FLAG_READ_WRITE, &os->ctx->interrupt_callback, &opts);
-            av_dict_free(&opts);
-            ffurl_seek(os->out, offset - frag->start_pos, SEEK_SET);
-            if (os->out2)
-                ffurl_seek(os->out2, offset - frag->start_pos, SEEK_SET);
-            os->cur_pos = offset;
-            return offset;
-        }
-    }
-    return AVERROR(EIO);
-}
-
-static void get_private_data(OutputStream *os)
-{
-    AVCodecContext *codec = os->ctx->streams[0]->codec;
-    uint8_t *ptr = codec->extradata;
-    int size = codec->extradata_size;
-    int i;
-    if (codec->codec_id == AV_CODEC_ID_H264) {
-        ff_avc_write_annexb_extradata(ptr, &ptr, &size);
-        if (!ptr)
-            ptr = codec->extradata;
-    }
-    if (!ptr)
-        return;
-    os->private_str = av_mallocz(2*size + 1);
-    for (i = 0; i < size; i++)
-        snprintf(&os->private_str[2*i], 3, "%02x", ptr[i]);
-    if (ptr != codec->extradata)
-        av_free(ptr);
-}
-
-static void ism_free(AVFormatContext *s)
-{
-    SmoothStreamingContext *c = s->priv_data;
-    int i, j;
-    if (!c->streams)
-        return;
-    for (i = 0; i < s->nb_streams; i++) {
-        OutputStream *os = &c->streams[i];
-        ffurl_close(os->out);
-        ffurl_close(os->out2);
-        ffurl_close(os->tail_out);
-        os->out = os->out2 = os->tail_out = NULL;
-        if (os->ctx && os->ctx_inited)
-            av_write_trailer(os->ctx);
-        if (os->ctx && os->ctx->pb)
-            av_free(os->ctx->pb);
-        if (os->ctx)
-            avformat_free_context(os->ctx);
-        av_free(os->private_str);
-        for (j = 0; j < os->nb_fragments; j++)
-            av_free(os->fragments[j]);
-        av_free(os->fragments);
-    }
-    av_freep(&c->streams);
-}
-
-static void output_chunk_list(OutputStream *os, AVIOContext *out, int final, int skip, int window_size)
-{
-    int removed = 0, i, start = 0;
-    if (os->nb_fragments <= 0)
-        return;
-    if (os->fragments[0]->n > 0)
-        removed = 1;
-    if (final)
-        skip = 0;
-    if (window_size)
-        start = FFMAX(os->nb_fragments - skip - window_size, 0);
-    for (i = start; i < os->nb_fragments - skip; i++) {
-        Fragment *frag = os->fragments[i];
-        if (!final || removed)
-            avio_printf(out, "<c t=\"%"PRIu64"\" d=\"%"PRIu64"\" />\n", frag->start_time, frag->duration);
-        else
-            avio_printf(out, "<c n=\"%d\" d=\"%"PRIu64"\" />\n", frag->n, frag->duration);
-    }
-}
-
-static int write_manifest(AVFormatContext *s, int final)
-{
-    SmoothStreamingContext *c = s->priv_data;
-    AVIOContext *out;
-    char filename[1024], temp_filename[1024];
-    int ret, i, video_chunks = 0, audio_chunks = 0, video_streams = 0, audio_streams = 0;
-    int64_t duration = 0;
-
-    snprintf(filename, sizeof(filename), "%s/Manifest", s->filename);
-    snprintf(temp_filename, sizeof(temp_filename), "%s/Manifest.tmp", s->filename);
-    ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL);
-    if (ret < 0) {
-        av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename);
-        return ret;
-    }
-    avio_printf(out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
-    for (i = 0; i < s->nb_streams; i++) {
-        OutputStream *os = &c->streams[i];
-        if (os->nb_fragments > 0) {
-            Fragment *last = os->fragments[os->nb_fragments - 1];
-            duration = last->start_time + last->duration;
-        }
-        if (s->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            video_chunks = os->nb_fragments;
-            video_streams++;
-        } else {
-            audio_chunks = os->nb_fragments;
-            audio_streams++;
-        }
-    }
-    if (!final) {
-        duration = 0;
-        video_chunks = audio_chunks = 0;
-    }
-    if (c->window_size) {
-        video_chunks = FFMIN(video_chunks, c->window_size);
-        audio_chunks = FFMIN(audio_chunks, c->window_size);
-    }
-    avio_printf(out, "<SmoothStreamingMedia MajorVersion=\"2\" MinorVersion=\"0\" Duration=\"%"PRIu64"\"", duration);
-    if (!final)
-        avio_printf(out, " IsLive=\"true\" LookAheadFragmentCount=\"%d\" DVRWindowLength=\"0\"", c->lookahead_count);
-    avio_printf(out, ">\n");
-    if (c->has_video) {
-        int last = -1, index = 0;
-        avio_printf(out, "<StreamIndex Type=\"video\" QualityLevels=\"%d\" Chunks=\"%d\" Url=\"QualityLevels({bitrate})/Fragments(video={start time})\">\n", video_streams, video_chunks);
-        for (i = 0; i < s->nb_streams; i++) {
-            OutputStream *os = &c->streams[i];
-            if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_VIDEO)
-                continue;
-            last = i;
-            avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%d\" FourCC=\"%s\" MaxWidth=\"%d\" MaxHeight=\"%d\" CodecPrivateData=\"%s\" />\n", index, s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->width, s->streams[i]->codec->height, os->private_str);
-            index++;
-        }
-        output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size);
-        avio_printf(out, "</StreamIndex>\n");
-    }
-    if (c->has_audio) {
-        int last = -1, index = 0;
-        avio_printf(out, "<StreamIndex Type=\"audio\" QualityLevels=\"%d\" Chunks=\"%d\" Url=\"QualityLevels({bitrate})/Fragments(audio={start time})\">\n", audio_streams, audio_chunks);
-        for (i = 0; i < s->nb_streams; i++) {
-            OutputStream *os = &c->streams[i];
-            if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_AUDIO)
-                continue;
-            last = i;
-            avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%d\" FourCC=\"%s\" SamplingRate=\"%d\" Channels=\"%d\" BitsPerSample=\"16\" PacketSize=\"%d\" AudioTag=\"%d\" CodecPrivateData=\"%s\" />\n", index, s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->sample_rate, s->streams[i]->codec->channels, os->packet_size, os->audio_tag, os->private_str);
-            index++;
-        }
-        output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size);
-        avio_printf(out, "</StreamIndex>\n");
-    }
-    avio_printf(out, "</SmoothStreamingMedia>\n");
-    avio_flush(out);
-    avio_close(out);
-    rename(temp_filename, filename);
-    return 0;
-}
-
-static int ism_write_header(AVFormatContext *s)
-{
-    SmoothStreamingContext *c = s->priv_data;
-    int ret = 0, i;
-    AVOutputFormat *oformat;
-
-    mkdir(s->filename, 0777);
-
-    oformat = av_guess_format("ismv", NULL, NULL);
-    if (!oformat) {
-        ret = AVERROR_MUXER_NOT_FOUND;
-        goto fail;
-    }
-
-    c->streams = av_mallocz(sizeof(*c->streams) * s->nb_streams);
-    if (!c->streams) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    for (i = 0; i < s->nb_streams; i++) {
-        OutputStream *os = &c->streams[i];
-        AVFormatContext *ctx;
-        AVStream *st;
-        AVDictionary *opts = NULL;
-        char buf[10];
-
-        if (!s->streams[i]->codec->bit_rate) {
-            av_log(s, AV_LOG_ERROR, "No bit rate set for stream %d\n", i);
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-        snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%d)", s->filename, s->streams[i]->codec->bit_rate);
-        mkdir(os->dirname, 0777);
-
-        ctx = avformat_alloc_context();
-        if (!ctx) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        os->ctx = ctx;
-        ctx->oformat = oformat;
-        ctx->interrupt_callback = s->interrupt_callback;
-
-        if (!(st = avformat_new_stream(ctx, NULL))) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        avcodec_copy_context(st->codec, s->streams[i]->codec);
-        st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
-
-        ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf), AVIO_FLAG_WRITE, os, NULL, ism_write, ism_seek);
-        if (!ctx->pb) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        snprintf(buf, sizeof(buf), "%d", c->lookahead_count);
-        av_dict_set(&opts, "ism_lookahead", buf, 0);
-        av_dict_set(&opts, "movflags", "frag_custom", 0);
-        if ((ret = avformat_write_header(ctx, &opts)) < 0) {
-             goto fail;
-        }
-        os->ctx_inited = 1;
-        avio_flush(ctx->pb);
-        av_dict_free(&opts);
-        s->streams[i]->time_base = st->time_base;
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            c->has_video = 1;
-            os->stream_type_tag = "video";
-            if (st->codec->codec_id == AV_CODEC_ID_H264) {
-                os->fourcc = "H264";
-            } else if (st->codec->codec_id == AV_CODEC_ID_VC1) {
-                os->fourcc = "WVC1";
-            } else {
-                av_log(s, AV_LOG_ERROR, "Unsupported video codec\n");
-                ret = AVERROR(EINVAL);
-                goto fail;
-            }
-        } else {
-            c->has_audio = 1;
-            os->stream_type_tag = "audio";
-            if (st->codec->codec_id == AV_CODEC_ID_AAC) {
-                os->fourcc = "AACL";
-                os->audio_tag = 0xff;
-            } else if (st->codec->codec_id == AV_CODEC_ID_WMAPRO) {
-                os->fourcc = "WMAP";
-                os->audio_tag = 0x0162;
-            } else {
-                av_log(s, AV_LOG_ERROR, "Unsupported audio codec\n");
-                ret = AVERROR(EINVAL);
-                goto fail;
-            }
-            os->packet_size = st->codec->block_align ? st->codec->block_align : 4;
-        }
-        get_private_data(os);
-    }
-
-    if (!c->has_video && c->min_frag_duration <= 0) {
-        av_log(s, AV_LOG_WARNING, "no video stream and no min frag duration set\n");
-        ret = AVERROR(EINVAL);
-    }
-    ret = write_manifest(s, 0);
-
-fail:
-    if (ret)
-        ism_free(s);
-    return ret;
-}
-
-static int parse_fragment(AVFormatContext *s, const char *filename, int64_t *start_ts, int64_t *duration, int64_t *moof_size, int64_t size)
-{
-    AVIOContext *in;
-    int ret;
-    uint32_t len;
-    if ((ret = avio_open2(&in, filename, AVIO_FLAG_READ, &s->interrupt_callback, NULL)) < 0)
-        return ret;
-    ret = AVERROR(EIO);
-    *moof_size = avio_rb32(in);
-    if (*moof_size < 8 || *moof_size > size)
-        goto fail;
-    if (avio_rl32(in) != MKTAG('m','o','o','f'))
-        goto fail;
-    len = avio_rb32(in);
-    if (len > *moof_size)
-        goto fail;
-    if (avio_rl32(in) != MKTAG('m','f','h','d'))
-        goto fail;
-    avio_seek(in, len - 8, SEEK_CUR);
-    avio_rb32(in); /* traf size */
-    if (avio_rl32(in) != MKTAG('t','r','a','f'))
-        goto fail;
-    while (avio_tell(in) < *moof_size) {
-        uint32_t len = avio_rb32(in);
-        uint32_t tag = avio_rl32(in);
-        int64_t end = avio_tell(in) + len - 8;
-        if (len < 8 || len >= *moof_size)
-            goto fail;
-        if (tag == MKTAG('u','u','i','d')) {
-            const uint8_t tfxd[] = {
-                0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
-                0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
-            };
-            uint8_t uuid[16];
-            avio_read(in, uuid, 16);
-            if (!memcmp(uuid, tfxd, 16) && len >= 8 + 16 + 4 + 16) {
-                avio_seek(in, 4, SEEK_CUR);
-                *start_ts = avio_rb64(in);
-                *duration = avio_rb64(in);
-                ret = 0;
-                break;
-            }
-        }
-        avio_seek(in, end, SEEK_SET);
-    }
-fail:
-    avio_close(in);
-    return ret;
-}
-
-static int add_fragment(OutputStream *os, const char *file, const char *infofile, int64_t start_time, int64_t duration, int64_t start_pos, int64_t size)
-{
-    int err;
-    Fragment *frag;
-    if (os->nb_fragments >= os->fragments_size) {
-        os->fragments_size = (os->fragments_size + 1) * 2;
-        if ((err = av_reallocp(&os->fragments, sizeof(*os->fragments) *
-                               os->fragments_size)) < 0) {
-            os->fragments_size = 0;
-            os->nb_fragments = 0;
-            return err;
-        }
-    }
-    frag = av_mallocz(sizeof(*frag));
-    if (!frag)
-        return AVERROR(ENOMEM);
-    av_strlcpy(frag->file, file, sizeof(frag->file));
-    av_strlcpy(frag->infofile, infofile, sizeof(frag->infofile));
-    frag->start_time = start_time;
-    frag->duration = duration;
-    frag->start_pos = start_pos;
-    frag->size = size;
-    frag->n = os->fragment_index;
-    os->fragments[os->nb_fragments++] = frag;
-    os->fragment_index++;
-    return 0;
-}
-
-static int copy_moof(AVFormatContext *s, const char* infile, const char *outfile, int64_t size)
-{
-    AVIOContext *in, *out;
-    int ret = 0;
-    if ((ret = avio_open2(&in, infile, AVIO_FLAG_READ, &s->interrupt_callback, NULL)) < 0)
-        return ret;
-    if ((ret = avio_open2(&out, outfile, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL)) < 0) {
-        avio_close(in);
-        return ret;
-    }
-    while (size > 0) {
-        uint8_t buf[8192];
-        int n = FFMIN(size, sizeof(buf));
-        n = avio_read(in, buf, n);
-        if (n <= 0) {
-            ret = AVERROR(EIO);
-            break;
-        }
-        avio_write(out, buf, n);
-        size -= n;
-    }
-    avio_flush(out);
-    avio_close(out);
-    avio_close(in);
-    return ret;
-}
-
-static int ism_flush(AVFormatContext *s, int final)
-{
-    SmoothStreamingContext *c = s->priv_data;
-    int i, ret = 0;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        OutputStream *os = &c->streams[i];
-        char filename[1024], target_filename[1024], header_filename[1024];
-        int64_t start_pos = os->tail_pos, size;
-        int64_t start_ts, duration, moof_size;
-        if (!os->packets_written)
-            continue;
-
-        snprintf(filename, sizeof(filename), "%s/temp", os->dirname);
-        ret = ffurl_open(&os->out, filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL);
-        if (ret < 0)
-            break;
-        os->cur_start_pos = os->tail_pos;
-        av_write_frame(os->ctx, NULL);
-        avio_flush(os->ctx->pb);
-        os->packets_written = 0;
-        if (!os->out || os->tail_out)
-            return AVERROR(EIO);
-
-        ffurl_close(os->out);
-        os->out = NULL;
-        size = os->tail_pos - start_pos;
-        if ((ret = parse_fragment(s, filename, &start_ts, &duration, &moof_size, size)) < 0)
-            break;
-        snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts);
-        snprintf(target_filename, sizeof(target_filename), "%s/Fragments(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts);
-        copy_moof(s, filename, header_filename, moof_size);
-        rename(filename, target_filename);
-        add_fragment(os, target_filename, header_filename, start_ts, duration, start_pos, size);
-    }
-
-    if (c->window_size || (final && c->remove_at_exit)) {
-        for (i = 0; i < s->nb_streams; i++) {
-            OutputStream *os = &c->streams[i];
-            int j;
-            int remove = os->nb_fragments - c->window_size - c->extra_window_size - c->lookahead_count;
-            if (final && c->remove_at_exit)
-                remove = os->nb_fragments;
-            if (remove > 0) {
-                for (j = 0; j < remove; j++) {
-                    unlink(os->fragments[j]->file);
-                    unlink(os->fragments[j]->infofile);
-                    av_free(os->fragments[j]);
-                }
-                os->nb_fragments -= remove;
-                memmove(os->fragments, os->fragments + remove, os->nb_fragments * sizeof(*os->fragments));
-            }
-            if (final && c->remove_at_exit)
-                rmdir(os->dirname);
-        }
-    }
-
-    if (ret >= 0)
-        ret = write_manifest(s, final);
-    return ret;
-}
-
-static int ism_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    SmoothStreamingContext *c = s->priv_data;
-    AVStream *st = s->streams[pkt->stream_index];
-    OutputStream *os = &c->streams[pkt->stream_index];
-    int64_t end_dts = (c->nb_fragments + 1) * c->min_frag_duration;
-    int ret;
-
-    if (st->first_dts == AV_NOPTS_VALUE)
-        st->first_dts = pkt->dts;
-
-    if ((!c->has_video || st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
-        av_compare_ts(pkt->dts - st->first_dts, st->time_base,
-                      end_dts, AV_TIME_BASE_Q) >= 0 &&
-        pkt->flags & AV_PKT_FLAG_KEY && os->packets_written) {
-
-        if ((ret = ism_flush(s, 0)) < 0)
-            return ret;
-        c->nb_fragments++;
-    }
-
-    os->packets_written++;
-    return ff_write_chained(os->ctx, 0, pkt, s);
-}
-
-static int ism_write_trailer(AVFormatContext *s)
-{
-    SmoothStreamingContext *c = s->priv_data;
-    ism_flush(s, 1);
-
-    if (c->remove_at_exit) {
-        char filename[1024];
-        snprintf(filename, sizeof(filename), "%s/Manifest", s->filename);
-        unlink(filename);
-        rmdir(s->filename);
-    }
-
-    ism_free(s);
-    return 0;
-}
-
-#define OFFSET(x) offsetof(SmoothStreamingContext, x)
-#define E AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "window_size", "number of fragments kept in the manifest", OFFSET(window_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, E },
-    { "extra_window_size", "number of fragments kept outside of the manifest before removing from disk", OFFSET(extra_window_size), AV_OPT_TYPE_INT, { .i64 = 5 }, 0, INT_MAX, E },
-    { "lookahead_count", "number of lookahead fragments", OFFSET(lookahead_count), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, INT_MAX, E },
-    { "min_frag_duration", "minimum fragment duration (in microseconds)", OFFSET(min_frag_duration), AV_OPT_TYPE_INT64, { .i64 = 5000000 }, 0, INT_MAX, E },
-    { "remove_at_exit", "remove all fragments when finished", OFFSET(remove_at_exit), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E },
-    { NULL },
-};
-
-static const AVClass ism_class = {
-    .class_name = "smooth streaming muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-
-AVOutputFormat ff_smoothstreaming_muxer = {
-    .name           = "smoothstreaming",
-    .long_name      = NULL_IF_CONFIG_SMALL("Smooth Streaming Muxer"),
-    .priv_data_size = sizeof(SmoothStreamingContext),
-    .audio_codec    = AV_CODEC_ID_AAC,
-    .video_codec    = AV_CODEC_ID_H264,
-    .flags          = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
-    .write_header   = ism_write_header,
-    .write_packet   = ism_write_packet,
-    .write_trailer  = ism_write_trailer,
-    .codec_tag      = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
-    .priv_class     = &ism_class,
-};
diff --git a/deps/libav/libavformat/sol.c b/deps/libav/libavformat/sol.c
deleted file mode 100644
index 92599b1..0000000
--- a/deps/libav/libavformat/sol.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Sierra SOL demuxer
- * Copyright Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Based on documents from Game Audio Player and own research
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-#include "pcm.h"
-
-/* if we don't know the size in advance */
-#define AU_UNKNOWN_SIZE ((uint32_t)(~0))
-
-static int sol_probe(AVProbeData *p)
-{
-    /* check file header */
-    uint16_t magic = AV_RL32(p->buf);
-    if ((magic == 0x0B8D || magic == 0x0C0D || magic == 0x0C8D) &&
-        p->buf[2] == 'S' && p->buf[3] == 'O' &&
-        p->buf[4] == 'L' && p->buf[5] == 0)
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-#define SOL_DPCM    1
-#define SOL_16BIT   4
-#define SOL_STEREO 16
-
-static enum AVCodecID sol_codec_id(int magic, int type)
-{
-    if (magic == 0x0B8D)
-    {
-        if (type & SOL_DPCM) return AV_CODEC_ID_SOL_DPCM;
-        else return AV_CODEC_ID_PCM_U8;
-    }
-    if (type & SOL_DPCM)
-    {
-        if (type & SOL_16BIT) return AV_CODEC_ID_SOL_DPCM;
-        else if (magic == 0x0C8D) return AV_CODEC_ID_SOL_DPCM;
-        else return AV_CODEC_ID_SOL_DPCM;
-    }
-    if (type & SOL_16BIT) return AV_CODEC_ID_PCM_S16LE;
-    return AV_CODEC_ID_PCM_U8;
-}
-
-static int sol_codec_type(int magic, int type)
-{
-    if (magic == 0x0B8D) return 1;//SOL_DPCM_OLD;
-    if (type & SOL_DPCM)
-    {
-        if (type & SOL_16BIT) return 3;//SOL_DPCM_NEW16;
-        else if (magic == 0x0C8D) return 1;//SOL_DPCM_OLD;
-        else return 2;//SOL_DPCM_NEW8;
-    }
-    return -1;
-}
-
-static int sol_channels(int magic, int type)
-{
-    if (magic == 0x0B8D || !(type & SOL_STEREO)) return 1;
-    return 2;
-}
-
-static int sol_read_header(AVFormatContext *s)
-{
-    unsigned int magic,tag;
-    AVIOContext *pb = s->pb;
-    unsigned int id, channels, rate, type;
-    enum AVCodecID codec;
-    AVStream *st;
-
-    /* check ".snd" header */
-    magic = avio_rl16(pb);
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('S', 'O', 'L', 0))
-        return -1;
-    rate = avio_rl16(pb);
-    type = avio_r8(pb);
-    avio_skip(pb, 4); /* size */
-    if (magic != 0x0B8D)
-        avio_r8(pb); /* newer SOLs contain padding byte */
-
-    codec = sol_codec_id(magic, type);
-    channels = sol_channels(magic, type);
-
-    if (codec == AV_CODEC_ID_SOL_DPCM)
-        id = sol_codec_type(magic, type);
-    else id = 0;
-
-    /* now we are ready: build format streams */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return -1;
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_tag = id;
-    st->codec->codec_id = codec;
-    st->codec->channels = channels;
-    st->codec->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO :
-                                                AV_CH_LAYOUT_STEREO;
-    st->codec->sample_rate = rate;
-    avpriv_set_pts_info(st, 64, 1, rate);
-    return 0;
-}
-
-#define MAX_SIZE 4096
-
-static int sol_read_packet(AVFormatContext *s,
-                          AVPacket *pkt)
-{
-    int ret;
-
-    if (s->pb->eof_reached)
-        return AVERROR(EIO);
-    ret= av_get_packet(s->pb, pkt, MAX_SIZE);
-    if (ret < 0)
-        return ret;
-    pkt->stream_index = 0;
-
-    /* note: we need to modify the packet size here to handle the last
-       packet */
-    pkt->size = ret;
-    return 0;
-}
-
-AVInputFormat ff_sol_demuxer = {
-    .name           = "sol",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sierra SOL"),
-    .read_probe     = sol_probe,
-    .read_header    = sol_read_header,
-    .read_packet    = sol_read_packet,
-    .read_seek      = ff_pcm_read_seek,
-};
diff --git a/deps/libav/libavformat/sox.h b/deps/libav/libavformat/sox.h
deleted file mode 100644
index e59531b..0000000
--- a/deps/libav/libavformat/sox.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * SoX native format common data
- * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_SOX_H
-#define AVFORMAT_SOX_H
-
-#define SOX_FIXED_HDR (4 + 8 + 8 + 4 + 4) /**< Size of fixed header without magic */
-
-#define SOX_TAG MKTAG('.', 'S', 'o', 'X')
-
-#endif /* AVFORMAT_SOX_H */
diff --git a/deps/libav/libavformat/soxdec.c b/deps/libav/libavformat/soxdec.c
deleted file mode 100644
index ec94675..0000000
--- a/deps/libav/libavformat/soxdec.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * SoX native format demuxer
- * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>
- *
- * Based on libSoX sox-fmt.c
- * Copyright (c) 2008 robs at users.sourceforge.net
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * SoX native format demuxer
- * @author Daniel Verkamp
- * @see http://wiki.multimedia.cx/index.php?title=SoX_native_intermediate_format
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "internal.h"
-#include "pcm.h"
-#include "sox.h"
-
-static int sox_probe(AVProbeData *p)
-{
-    if (AV_RL32(p->buf) == SOX_TAG || AV_RB32(p->buf) == SOX_TAG)
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int sox_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    unsigned header_size, comment_size;
-    double sample_rate, sample_rate_frac;
-    AVStream *st;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-
-    if (avio_rl32(pb) == SOX_TAG) {
-        st->codec->codec_id = AV_CODEC_ID_PCM_S32LE;
-        header_size         = avio_rl32(pb);
-        avio_skip(pb, 8); /* sample count */
-        sample_rate         = av_int2double(avio_rl64(pb));
-        st->codec->channels = avio_rl32(pb);
-        comment_size        = avio_rl32(pb);
-    } else {
-        st->codec->codec_id = AV_CODEC_ID_PCM_S32BE;
-        header_size         = avio_rb32(pb);
-        avio_skip(pb, 8); /* sample count */
-        sample_rate         = av_int2double(avio_rb64(pb));
-        st->codec->channels = avio_rb32(pb);
-        comment_size        = avio_rb32(pb);
-    }
-
-    if (comment_size > 0xFFFFFFFFU - SOX_FIXED_HDR - 4U) {
-        av_log(s, AV_LOG_ERROR, "invalid comment size (%u)\n", comment_size);
-        return -1;
-    }
-
-    if (sample_rate <= 0 || sample_rate > INT_MAX) {
-        av_log(s, AV_LOG_ERROR, "invalid sample rate (%f)\n", sample_rate);
-        return -1;
-    }
-
-    sample_rate_frac = sample_rate - floor(sample_rate);
-    if (sample_rate_frac)
-        av_log(s, AV_LOG_WARNING,
-               "truncating fractional part of sample rate (%f)\n",
-               sample_rate_frac);
-
-    if ((header_size + 4) & 7 || header_size < SOX_FIXED_HDR + comment_size
-        || st->codec->channels > 65535) /* Reserve top 16 bits */ {
-        av_log(s, AV_LOG_ERROR, "invalid header\n");
-        return -1;
-    }
-
-    if (comment_size && comment_size < UINT_MAX) {
-        char *comment = av_malloc(comment_size+1);
-        if (avio_read(pb, comment, comment_size) != comment_size) {
-            av_freep(&comment);
-            return AVERROR(EIO);
-        }
-        comment[comment_size] = 0;
-
-        av_dict_set(&s->metadata, "comment", comment,
-                               AV_DICT_DONT_STRDUP_VAL);
-    }
-
-    avio_skip(pb, header_size - SOX_FIXED_HDR - comment_size);
-
-    st->codec->sample_rate           = sample_rate;
-    st->codec->bits_per_coded_sample = 32;
-    st->codec->bit_rate              = st->codec->sample_rate *
-                                       st->codec->bits_per_coded_sample *
-                                       st->codec->channels;
-    st->codec->block_align           = st->codec->bits_per_coded_sample *
-                                       st->codec->channels / 8;
-
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-
-    return 0;
-}
-
-#define SOX_SAMPLES 1024
-
-static int sox_read_packet(AVFormatContext *s,
-                           AVPacket *pkt)
-{
-    int ret, size;
-
-    if (s->pb->eof_reached)
-        return AVERROR_EOF;
-
-    size = SOX_SAMPLES*s->streams[0]->codec->block_align;
-    ret = av_get_packet(s->pb, pkt, size);
-    if (ret < 0)
-        return AVERROR(EIO);
-    pkt->stream_index = 0;
-    pkt->size = ret;
-
-    return 0;
-}
-
-AVInputFormat ff_sox_demuxer = {
-    .name           = "sox",
-    .long_name      = NULL_IF_CONFIG_SMALL("SoX native"),
-    .read_probe     = sox_probe,
-    .read_header    = sox_read_header,
-    .read_packet    = sox_read_packet,
-    .read_seek      = ff_pcm_read_seek,
-};
diff --git a/deps/libav/libavformat/soxenc.c b/deps/libav/libavformat/soxenc.c
deleted file mode 100644
index 3e5d2e3..0000000
--- a/deps/libav/libavformat/soxenc.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * SoX native format muxer
- * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>
- *
- * Based on libSoX sox-fmt.c
- * Copyright (c) 2008 robs at users.sourceforge.net
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * SoX native format muxer
- * @author Daniel Verkamp
- * @see http://wiki.multimedia.cx/index.php?title=SoX_native_intermediate_format
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "sox.h"
-
-typedef struct {
-    int64_t header_size;
-} SoXContext;
-
-static int sox_write_header(AVFormatContext *s)
-{
-    SoXContext *sox = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVCodecContext *enc = s->streams[0]->codec;
-    AVDictionaryEntry *comment;
-    size_t comment_len = 0, comment_size;
-
-    comment = av_dict_get(s->metadata, "comment", NULL, 0);
-    if (comment)
-        comment_len = strlen(comment->value);
-    comment_size = (comment_len + 7) & ~7;
-
-    sox->header_size = SOX_FIXED_HDR + comment_size;
-
-    if (enc->codec_id == AV_CODEC_ID_PCM_S32LE) {
-        ffio_wfourcc(pb, ".SoX");
-        avio_wl32(pb, sox->header_size);
-        avio_wl64(pb, 0); /* number of samples */
-        avio_wl64(pb, av_double2int(enc->sample_rate));
-        avio_wl32(pb, enc->channels);
-        avio_wl32(pb, comment_size);
-    } else if (enc->codec_id == AV_CODEC_ID_PCM_S32BE) {
-        ffio_wfourcc(pb, "XoS.");
-        avio_wb32(pb, sox->header_size);
-        avio_wb64(pb, 0); /* number of samples */
-        avio_wb64(pb, av_double2int(enc->sample_rate));
-        avio_wb32(pb, enc->channels);
-        avio_wb32(pb, comment_size);
-    } else {
-        av_log(s, AV_LOG_ERROR, "invalid codec; use pcm_s32le or pcm_s32be\n");
-        return -1;
-    }
-
-    if (comment_len)
-        avio_write(pb, comment->value, comment_len);
-
-    for ( ; comment_size > comment_len; comment_len++)
-        avio_w8(pb, 0);
-
-    avio_flush(pb);
-
-    return 0;
-}
-
-static int sox_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    avio_write(pb, pkt->data, pkt->size);
-    return 0;
-}
-
-static int sox_write_trailer(AVFormatContext *s)
-{
-    SoXContext *sox = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVCodecContext *enc = s->streams[0]->codec;
-
-    if (s->pb->seekable) {
-        /* update number of samples */
-        int64_t file_size = avio_tell(pb);
-        int64_t num_samples = (file_size - sox->header_size - 4LL) >> 2LL;
-        avio_seek(pb, 8, SEEK_SET);
-        if (enc->codec_id == AV_CODEC_ID_PCM_S32LE) {
-            avio_wl64(pb, num_samples);
-        } else
-            avio_wb64(pb, num_samples);
-        avio_seek(pb, file_size, SEEK_SET);
-
-        avio_flush(pb);
-    }
-
-    return 0;
-}
-
-AVOutputFormat ff_sox_muxer = {
-    .name              = "sox",
-    .long_name         = NULL_IF_CONFIG_SMALL("SoX native"),
-    .extensions        = "sox",
-    .priv_data_size    = sizeof(SoXContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S32LE,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = sox_write_header,
-    .write_packet      = sox_write_packet,
-    .write_trailer     = sox_write_trailer,
-};
diff --git a/deps/libav/libavformat/spdif.c b/deps/libav/libavformat/spdif.c
deleted file mode 100644
index 777ac47..0000000
--- a/deps/libav/libavformat/spdif.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * IEC 61937 common code
- * Copyright (c) 2009 Bartlomiej Wolowiec
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "spdif.h"
-#include "libavutil/bswap.h"
-
-//TODO move to DSP
-void ff_spdif_bswap_buf16(uint16_t *dst, const uint16_t *src, int w)
-{
-    int i;
-
-    for (i = 0; i + 8 <= w; i += 8) {
-        dst[i + 0] = av_bswap16(src[i + 0]);
-        dst[i + 1] = av_bswap16(src[i + 1]);
-        dst[i + 2] = av_bswap16(src[i + 2]);
-        dst[i + 3] = av_bswap16(src[i + 3]);
-        dst[i + 4] = av_bswap16(src[i + 4]);
-        dst[i + 5] = av_bswap16(src[i + 5]);
-        dst[i + 6] = av_bswap16(src[i + 6]);
-        dst[i + 7] = av_bswap16(src[i + 7]);
-    }
-    for (; i < w; i++)
-        dst[i + 0] = av_bswap16(src[i + 0]);
-}
diff --git a/deps/libav/libavformat/spdif.h b/deps/libav/libavformat/spdif.h
deleted file mode 100644
index f5b15eb..0000000
--- a/deps/libav/libavformat/spdif.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * IEC 61937 common header
- * Copyright (c) 2009 Bartlomiej Wolowiec
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_SPDIF_H
-#define AVFORMAT_SPDIF_H
-
-#include <stdint.h>
-
-#define SYNCWORD1 0xF872
-#define SYNCWORD2 0x4E1F
-#define BURST_HEADER_SIZE 0x8
-
-enum IEC61937DataType {
-    IEC61937_AC3                = 0x01,          ///< AC-3 data
-    IEC61937_MPEG1_LAYER1       = 0x04,          ///< MPEG-1 layer 1
-    IEC61937_MPEG1_LAYER23      = 0x05,          ///< MPEG-1 layer 2 or 3 data or MPEG-2 without extension
-    IEC61937_MPEG2_EXT          = 0x06,          ///< MPEG-2 data with extension
-    IEC61937_MPEG2_AAC          = 0x07,          ///< MPEG-2 AAC ADTS
-    IEC61937_MPEG2_LAYER1_LSF   = 0x08,          ///< MPEG-2, layer-1 low sampling frequency
-    IEC61937_MPEG2_LAYER2_LSF   = 0x09,          ///< MPEG-2, layer-2 low sampling frequency
-    IEC61937_MPEG2_LAYER3_LSF   = 0x0A,          ///< MPEG-2, layer-3 low sampling frequency
-    IEC61937_DTS1               = 0x0B,          ///< DTS type I   (512 samples)
-    IEC61937_DTS2               = 0x0C,          ///< DTS type II  (1024 samples)
-    IEC61937_DTS3               = 0x0D,          ///< DTS type III (2048 samples)
-    IEC61937_ATRAC              = 0x0E,          ///< ATRAC data
-    IEC61937_ATRAC3             = 0x0F,          ///< ATRAC3 data
-    IEC61937_ATRACX             = 0x10,          ///< ATRAC3+ data
-    IEC61937_DTSHD              = 0x11,          ///< DTS HD data
-    IEC61937_WMAPRO             = 0x12,          ///< WMA 9 Professional data
-    IEC61937_MPEG2_AAC_LSF_2048 = 0x13,          ///< MPEG-2 AAC ADTS half-rate low sampling frequency
-    IEC61937_MPEG2_AAC_LSF_4096 = 0x13 | 0x20,   ///< MPEG-2 AAC ADTS quarter-rate low sampling frequency
-    IEC61937_EAC3               = 0x15,          ///< E-AC-3 data
-    IEC61937_TRUEHD             = 0x16,          ///< TrueHD data
-};
-
-static const uint16_t spdif_mpeg_pkt_offset[2][3] = {
-    //LAYER1  LAYER2  LAYER3
-    { 3072,    9216,   4608 }, // MPEG2 LSF
-    { 1536,    4608,   4608 }, // MPEG1
-};
-
-void ff_spdif_bswap_buf16(uint16_t *dst, const uint16_t *src, int w);
-
-#endif /* AVFORMAT_SPDIF_H */
diff --git a/deps/libav/libavformat/spdifdec.c b/deps/libav/libavformat/spdifdec.c
deleted file mode 100644
index 2fb9477..0000000
--- a/deps/libav/libavformat/spdifdec.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * IEC 61937 demuxer
- * Copyright (c) 2010 Anssi Hannula <anssi.hannula at iki.fi>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * IEC 61937 demuxer, used for compressed data in S/PDIF
- * @author Anssi Hannula
- */
-
-#include "avformat.h"
-#include "spdif.h"
-#include "libavcodec/ac3.h"
-#include "libavcodec/aacadtsdec.h"
-
-static int spdif_get_offset_and_codec(AVFormatContext *s,
-                                      enum IEC61937DataType data_type,
-                                      const char *buf, int *offset,
-                                      enum AVCodecID *codec)
-{
-    AACADTSHeaderInfo aac_hdr;
-    GetBitContext gbc;
-
-    switch (data_type & 0xff) {
-    case IEC61937_AC3:
-        *offset = AC3_FRAME_SIZE << 2;
-        *codec = AV_CODEC_ID_AC3;
-        break;
-    case IEC61937_MPEG1_LAYER1:
-        *offset = spdif_mpeg_pkt_offset[1][0];
-        *codec = AV_CODEC_ID_MP1;
-        break;
-    case IEC61937_MPEG1_LAYER23:
-        *offset = spdif_mpeg_pkt_offset[1][0];
-        *codec = AV_CODEC_ID_MP3;
-        break;
-    case IEC61937_MPEG2_EXT:
-        *offset = 4608;
-        *codec = AV_CODEC_ID_MP3;
-        break;
-    case IEC61937_MPEG2_AAC:
-        init_get_bits(&gbc, buf, AAC_ADTS_HEADER_SIZE * 8);
-        if (avpriv_aac_parse_header(&gbc, &aac_hdr)) {
-            if (s) /* be silent during a probe */
-                av_log(s, AV_LOG_ERROR, "Invalid AAC packet in IEC 61937\n");
-            return AVERROR_INVALIDDATA;
-        }
-        *offset = aac_hdr.samples << 2;
-        *codec = AV_CODEC_ID_AAC;
-        break;
-    case IEC61937_MPEG2_LAYER1_LSF:
-        *offset = spdif_mpeg_pkt_offset[0][0];
-        *codec = AV_CODEC_ID_MP1;
-        break;
-    case IEC61937_MPEG2_LAYER2_LSF:
-        *offset = spdif_mpeg_pkt_offset[0][1];
-        *codec = AV_CODEC_ID_MP2;
-        break;
-    case IEC61937_MPEG2_LAYER3_LSF:
-        *offset = spdif_mpeg_pkt_offset[0][2];
-        *codec = AV_CODEC_ID_MP3;
-        break;
-    case IEC61937_DTS1:
-        *offset = 2048;
-        *codec = AV_CODEC_ID_DTS;
-        break;
-    case IEC61937_DTS2:
-        *offset = 4096;
-        *codec = AV_CODEC_ID_DTS;
-        break;
-    case IEC61937_DTS3:
-        *offset = 8192;
-        *codec = AV_CODEC_ID_DTS;
-        break;
-    default:
-        if (s) { /* be silent during a probe */
-            avpriv_request_sample(s, "Data type 0x%04x in IEC 61937",
-                                  data_type);
-        }
-        return AVERROR_PATCHWELCOME;
-    }
-    return 0;
-}
-
-/* Largest offset between bursts we currently handle, i.e. AAC with
-   aac_hdr.samples = 4096 */
-#define SPDIF_MAX_OFFSET 16384
-
-static int spdif_probe(AVProbeData *p)
-{
-    const uint8_t *buf = p->buf;
-    const uint8_t *probe_end = p->buf + FFMIN(2 * SPDIF_MAX_OFFSET, p->buf_size - 1);
-    const uint8_t *expected_code = buf + 7;
-    uint32_t state = 0;
-    int sync_codes = 0;
-    int consecutive_codes = 0;
-    int offset;
-    enum AVCodecID codec;
-
-    for (; buf < probe_end; buf++) {
-        state = (state << 8) | *buf;
-
-        if (state == (AV_BSWAP16C(SYNCWORD1) << 16 | AV_BSWAP16C(SYNCWORD2))
-                && buf[1] < 0x37) {
-            sync_codes++;
-
-            if (buf == expected_code) {
-                if (++consecutive_codes >= 2)
-                    return AVPROBE_SCORE_MAX;
-            } else
-                consecutive_codes = 0;
-
-            if (buf + 4 + AAC_ADTS_HEADER_SIZE > p->buf + p->buf_size)
-                break;
-
-            /* continue probing to find more sync codes */
-            probe_end = FFMIN(buf + SPDIF_MAX_OFFSET, p->buf + p->buf_size - 1);
-
-            /* skip directly to the next sync code */
-            if (!spdif_get_offset_and_codec(NULL, (buf[2] << 8) | buf[1],
-                                            &buf[5], &offset, &codec)) {
-                if (buf + offset >= p->buf + p->buf_size)
-                    break;
-                expected_code = buf + offset;
-                buf = expected_code - 7;
-            }
-        }
-    }
-
-    if (!sync_codes)
-        return 0;
-
-    if (sync_codes >= 6)
-        /* good amount of sync codes but with unexpected offsets */
-        return AVPROBE_SCORE_EXTENSION;
-
-    /* some sync codes were found */
-    return AVPROBE_SCORE_EXTENSION / 4;
-}
-
-static int spdif_read_header(AVFormatContext *s)
-{
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-    return 0;
-}
-
-static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    enum IEC61937DataType data_type;
-    enum AVCodecID codec_id;
-    uint32_t state = 0;
-    int pkt_size_bits, offset, ret;
-
-    while (state != (AV_BSWAP16C(SYNCWORD1) << 16 | AV_BSWAP16C(SYNCWORD2))) {
-        state = (state << 8) | avio_r8(pb);
-        if (pb->eof_reached)
-            return AVERROR_EOF;
-    }
-
-    data_type = avio_rl16(pb);
-    pkt_size_bits = avio_rl16(pb);
-
-    if (pkt_size_bits % 16)
-        avpriv_request_sample(s, "Packet not ending at a 16-bit boundary");
-
-    ret = av_new_packet(pkt, FFALIGN(pkt_size_bits, 16) >> 3);
-    if (ret)
-        return ret;
-
-    pkt->pos = avio_tell(pb) - BURST_HEADER_SIZE;
-
-    if (avio_read(pb, pkt->data, pkt->size) < pkt->size) {
-        av_free_packet(pkt);
-        return AVERROR_EOF;
-    }
-    ff_spdif_bswap_buf16((uint16_t *)pkt->data, (uint16_t *)pkt->data, pkt->size >> 1);
-
-    ret = spdif_get_offset_and_codec(s, data_type, pkt->data,
-                                     &offset, &codec_id);
-    if (ret) {
-        av_free_packet(pkt);
-        return ret;
-    }
-
-    /* skip over the padding to the beginning of the next frame */
-    avio_skip(pb, offset - pkt->size - BURST_HEADER_SIZE);
-
-    if (!s->nb_streams) {
-        /* first packet, create a stream */
-        AVStream *st = avformat_new_stream(s, NULL);
-        if (!st) {
-            av_free_packet(pkt);
-            return AVERROR(ENOMEM);
-        }
-        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-        st->codec->codec_id = codec_id;
-    } else if (codec_id != s->streams[0]->codec->codec_id) {
-        avpriv_report_missing_feature(s, "Codec change in IEC 61937");
-        return AVERROR_PATCHWELCOME;
-    }
-
-    if (!s->bit_rate && s->streams[0]->codec->sample_rate)
-        /* stream bitrate matches 16-bit stereo PCM bitrate for currently
-           supported codecs */
-        s->bit_rate = 2 * 16 * s->streams[0]->codec->sample_rate;
-
-    return 0;
-}
-
-AVInputFormat ff_spdif_demuxer = {
-    .name           = "spdif",
-    .long_name      = NULL_IF_CONFIG_SMALL("IEC 61937 (compressed data in S/PDIF)"),
-    .read_probe     = spdif_probe,
-    .read_header    = spdif_read_header,
-    .read_packet    = spdif_read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/spdifenc.c b/deps/libav/libavformat/spdifenc.c
deleted file mode 100644
index c350f72..0000000
--- a/deps/libav/libavformat/spdifenc.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * IEC 61937 muxer
- * Copyright (c) 2009 Bartlomiej Wolowiec
- * Copyright (c) 2010 Anssi Hannula
- * Copyright (c) 2010 Carl Eugen Hoyos
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * IEC-61937 encapsulation of various formats, used by S/PDIF
- * @author Bartlomiej Wolowiec
- * @author Anssi Hannula
- * @author Carl Eugen Hoyos
- */
-
-/*
- * Terminology used in specification:
- * data-burst - IEC61937 frame, contains header and encapsuled frame
- * burst-preambule - IEC61937 frame header, contains 16-bits words named Pa, Pb, Pc and Pd
- * burst-payload - encapsuled frame
- * Pa, Pb - syncword - 0xF872, 0x4E1F
- * Pc - burst-info, contains data-type (bits 0-6), error flag (bit 7), data-type-dependent info (bits 8-12)
- *      and bitstream number (bits 13-15)
- * data-type - determines type of encapsuled frames
- * Pd - length code (number of bits or bytes of encapsuled frame - according to data_type)
- *
- * IEC 61937 frames at normal usage start every specific count of bytes,
- *      dependent from data-type (spaces between packets are filled by zeros)
- */
-
-#include "avformat.h"
-#include "avio_internal.h"
-#include "spdif.h"
-#include "libavcodec/ac3.h"
-#include "libavcodec/dca.h"
-#include "libavcodec/aacadtsdec.h"
-#include "libavutil/opt.h"
-
-typedef struct IEC61937Context {
-    const AVClass *av_class;
-    enum IEC61937DataType data_type;///< burst info - reference to type of payload of the data-burst
-    int length_code;                ///< length code in bits or bytes, depending on data type
-    int pkt_offset;                 ///< data burst repetition period in bytes
-    uint8_t *buffer;                ///< allocated buffer, used for swap bytes
-    int buffer_size;                ///< size of allocated buffer
-
-    uint8_t *out_buf;               ///< pointer to the outgoing data before byte-swapping
-    int out_bytes;                  ///< amount of outgoing bytes
-
-    int use_preamble;               ///< preamble enabled (disabled for exactly pre-padded DTS)
-    int extra_bswap;                ///< extra bswap for payload (for LE DTS => standard BE DTS)
-
-    uint8_t *hd_buf;                ///< allocated buffer to concatenate hd audio frames
-    int hd_buf_size;                ///< size of the hd audio buffer
-    int hd_buf_count;               ///< number of frames in the hd audio buffer
-    int hd_buf_filled;              ///< amount of bytes in the hd audio buffer
-
-    int dtshd_skip;                 ///< counter used for skipping DTS-HD frames
-
-    /* AVOptions: */
-    int dtshd_rate;
-    int dtshd_fallback;
-#define SPDIF_FLAG_BIGENDIAN    0x01
-    int spdif_flags;
-
-    /// function, which generates codec dependent header information.
-    /// Sets data_type and pkt_offset, and length_code, out_bytes, out_buf if necessary
-    int (*header_info) (AVFormatContext *s, AVPacket *pkt);
-} IEC61937Context;
-
-static const AVOption options[] = {
-{ "spdif_flags", "IEC 61937 encapsulation flags", offsetof(IEC61937Context, spdif_flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" },
-{ "be", "output in big-endian format (for use as s16be)", 0, AV_OPT_TYPE_CONST, {.i64 = SPDIF_FLAG_BIGENDIAN},  0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" },
-{ "dtshd_rate", "mux complete DTS frames in HD mode at the specified IEC958 rate (in Hz, default 0=disabled)", offsetof(IEC61937Context, dtshd_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 768000, AV_OPT_FLAG_ENCODING_PARAM },
-{ "dtshd_fallback_time", "min secs to strip HD for after an overflow (-1: till the end, default 60)", offsetof(IEC61937Context, dtshd_fallback), AV_OPT_TYPE_INT, {.i64 = 60}, -1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
-{ NULL },
-};
-
-static const AVClass class = {
-    .class_name     = "spdif",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-static int spdif_header_ac3(AVFormatContext *s, AVPacket *pkt)
-{
-    IEC61937Context *ctx = s->priv_data;
-    int bitstream_mode = pkt->data[5] & 0x7;
-
-    ctx->data_type  = IEC61937_AC3 | (bitstream_mode << 8);
-    ctx->pkt_offset = AC3_FRAME_SIZE << 2;
-    return 0;
-}
-
-static int spdif_header_eac3(AVFormatContext *s, AVPacket *pkt)
-{
-    IEC61937Context *ctx = s->priv_data;
-    static const uint8_t eac3_repeat[4] = {6, 3, 2, 1};
-    int repeat = 1;
-
-    if ((pkt->data[4] & 0xc0) != 0xc0) /* fscod */
-        repeat = eac3_repeat[(pkt->data[4] & 0x30) >> 4]; /* numblkscod */
-
-    ctx->hd_buf = av_fast_realloc(ctx->hd_buf, &ctx->hd_buf_size, ctx->hd_buf_filled + pkt->size);
-    if (!ctx->hd_buf)
-        return AVERROR(ENOMEM);
-
-    memcpy(&ctx->hd_buf[ctx->hd_buf_filled], pkt->data, pkt->size);
-
-    ctx->hd_buf_filled += pkt->size;
-    if (++ctx->hd_buf_count < repeat){
-        ctx->pkt_offset = 0;
-        return 0;
-    }
-    ctx->data_type   = IEC61937_EAC3;
-    ctx->pkt_offset  = 24576;
-    ctx->out_buf     = ctx->hd_buf;
-    ctx->out_bytes   = ctx->hd_buf_filled;
-    ctx->length_code = ctx->hd_buf_filled;
-
-    ctx->hd_buf_count  = 0;
-    ctx->hd_buf_filled = 0;
-    return 0;
-}
-
-/*
- * DTS type IV (DTS-HD) can be transmitted with various frame repetition
- * periods; longer repetition periods allow for longer packets and therefore
- * higher bitrate. Longer repetition periods mean that the constant bitrate of
- * the outputted IEC 61937 stream is higher.
- * The repetition period is measured in IEC 60958 frames (4 bytes).
- */
-static int spdif_dts4_subtype(int period)
-{
-    switch (period) {
-    case 512:   return 0x0;
-    case 1024:  return 0x1;
-    case 2048:  return 0x2;
-    case 4096:  return 0x3;
-    case 8192:  return 0x4;
-    case 16384: return 0x5;
-    }
-    return -1;
-}
-
-static int spdif_header_dts4(AVFormatContext *s, AVPacket *pkt, int core_size,
-                             int sample_rate, int blocks)
-{
-    IEC61937Context *ctx = s->priv_data;
-    static const char dtshd_start_code[10] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe };
-    int pkt_size = pkt->size;
-    int period;
-    int subtype;
-
-    if (!core_size) {
-        av_log(s, AV_LOG_ERROR, "HD mode not supported for this format\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (!sample_rate) {
-        av_log(s, AV_LOG_ERROR, "Unknown DTS sample rate for HD\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    period = ctx->dtshd_rate * (blocks << 5) / sample_rate;
-    subtype = spdif_dts4_subtype(period);
-
-    if (subtype < 0) {
-        av_log(s, AV_LOG_ERROR, "Specified HD rate of %d Hz would require an "
-               "impossible repetition period of %d for the current DTS stream"
-               " (blocks = %d, sample rate = %d)\n", ctx->dtshd_rate, period,
-               blocks << 5, sample_rate);
-        return AVERROR(EINVAL);
-    }
-
-    /* set pkt_offset and DTS IV subtype according to the requested output
-     * rate */
-    ctx->pkt_offset = period * 4;
-    ctx->data_type = IEC61937_DTSHD | subtype << 8;
-
-    /* If the bitrate is too high for transmitting at the selected
-     * repetition period setting, strip DTS-HD until a good amount
-     * of consecutive non-overflowing HD frames have been observed.
-     * This generally only happens if the caller is cramming a Master
-     * Audio stream into 192kHz IEC 60958 (which may or may not fit). */
-    if (sizeof(dtshd_start_code) + 2 + pkt_size
-            > ctx->pkt_offset - BURST_HEADER_SIZE && core_size) {
-        if (!ctx->dtshd_skip)
-            av_log(s, AV_LOG_WARNING, "DTS-HD bitrate too high, "
-                                      "temporarily sending core only\n");
-        if (ctx->dtshd_fallback > 0)
-            ctx->dtshd_skip = sample_rate * ctx->dtshd_fallback / (blocks << 5);
-        else
-            /* skip permanently (dtshd_fallback == -1) or just once
-             * (dtshd_fallback == 0) */
-            ctx->dtshd_skip = 1;
-    }
-    if (ctx->dtshd_skip && core_size) {
-        pkt_size = core_size;
-        if (ctx->dtshd_fallback >= 0)
-            --ctx->dtshd_skip;
-    }
-
-    ctx->out_bytes   = sizeof(dtshd_start_code) + 2 + pkt_size;
-
-    /* Align so that (length_code & 0xf) == 0x8. This is reportedly needed
-     * with some receivers, but the exact requirement is unconfirmed. */
-    ctx->length_code = FFALIGN(ctx->out_bytes + 0x8, 0x10) - 0x8;
-
-    av_fast_malloc(&ctx->hd_buf, &ctx->hd_buf_size, ctx->out_bytes);
-    if (!ctx->hd_buf)
-        return AVERROR(ENOMEM);
-
-    ctx->out_buf = ctx->hd_buf;
-
-    memcpy(ctx->hd_buf, dtshd_start_code, sizeof(dtshd_start_code));
-    AV_WB16(ctx->hd_buf + sizeof(dtshd_start_code), pkt_size);
-    memcpy(ctx->hd_buf + sizeof(dtshd_start_code) + 2, pkt->data, pkt_size);
-
-    return 0;
-}
-
-static int spdif_header_dts(AVFormatContext *s, AVPacket *pkt)
-{
-    IEC61937Context *ctx = s->priv_data;
-    uint32_t syncword_dts = AV_RB32(pkt->data);
-    int blocks;
-    int sample_rate = 0;
-    int core_size = 0;
-
-    if (pkt->size < 9)
-        return AVERROR_INVALIDDATA;
-
-    switch (syncword_dts) {
-    case DCA_MARKER_RAW_BE:
-        blocks = (AV_RB16(pkt->data + 4) >> 2) & 0x7f;
-        core_size = ((AV_RB24(pkt->data + 5) >> 4) & 0x3fff) + 1;
-        sample_rate = avpriv_dca_sample_rates[(pkt->data[8] >> 2) & 0x0f];
-        break;
-    case DCA_MARKER_RAW_LE:
-        blocks = (AV_RL16(pkt->data + 4) >> 2) & 0x7f;
-        ctx->extra_bswap = 1;
-        break;
-    case DCA_MARKER_14B_BE:
-        blocks =
-            (((pkt->data[5] & 0x07) << 4) | ((pkt->data[6] & 0x3f) >> 2));
-        break;
-    case DCA_MARKER_14B_LE:
-        blocks =
-            (((pkt->data[4] & 0x07) << 4) | ((pkt->data[7] & 0x3f) >> 2));
-        ctx->extra_bswap = 1;
-        break;
-    case DCA_HD_MARKER:
-        /* We only handle HD frames that are paired with core. However,
-           sometimes DTS-HD streams with core have a stray HD frame without
-           core in the beginning of the stream. */
-        av_log(s, AV_LOG_ERROR, "stray DTS-HD frame\n");
-        return AVERROR_INVALIDDATA;
-    default:
-        av_log(s, AV_LOG_ERROR, "bad DTS syncword 0x%x\n", syncword_dts);
-        return AVERROR_INVALIDDATA;
-    }
-    blocks++;
-
-    if (ctx->dtshd_rate)
-        /* DTS type IV output requested */
-        return spdif_header_dts4(s, pkt, core_size, sample_rate, blocks);
-
-    switch (blocks) {
-    case  512 >> 5: ctx->data_type = IEC61937_DTS1; break;
-    case 1024 >> 5: ctx->data_type = IEC61937_DTS2; break;
-    case 2048 >> 5: ctx->data_type = IEC61937_DTS3; break;
-    default:
-        av_log(s, AV_LOG_ERROR, "%i samples in DTS frame not supported\n",
-               blocks << 5);
-        return AVERROR(ENOSYS);
-    }
-
-    /* discard extraneous data by default */
-    if (core_size && core_size < pkt->size) {
-        ctx->out_bytes = core_size;
-        ctx->length_code = core_size << 3;
-    }
-
-    ctx->pkt_offset = blocks << 7;
-
-    if (ctx->out_bytes == ctx->pkt_offset) {
-        /* The DTS stream fits exactly into the output stream, so skip the
-         * preamble as it would not fit in there. This is the case for dts
-         * discs and dts-in-wav. */
-        ctx->use_preamble = 0;
-    } else if (ctx->out_bytes > ctx->pkt_offset - BURST_HEADER_SIZE) {
-        avpriv_request_sample(s, "Unrecognized large DTS frame");
-        /* This will fail with a "bitrate too high" in the caller */
-    }
-
-    return 0;
-}
-
-static const enum IEC61937DataType mpeg_data_type[2][3] = {
-    //     LAYER1                      LAYER2                  LAYER3
-    { IEC61937_MPEG2_LAYER1_LSF, IEC61937_MPEG2_LAYER2_LSF, IEC61937_MPEG2_LAYER3_LSF },//MPEG2 LSF
-    { IEC61937_MPEG1_LAYER1,     IEC61937_MPEG1_LAYER23,    IEC61937_MPEG1_LAYER23 },   //MPEG1
-};
-
-static int spdif_header_mpeg(AVFormatContext *s, AVPacket *pkt)
-{
-    IEC61937Context *ctx = s->priv_data;
-    int version =      (pkt->data[1] >> 3) & 3;
-    int layer   = 3 - ((pkt->data[1] >> 1) & 3);
-    int extension = pkt->data[2] & 1;
-
-    if (layer == 3 || version == 1) {
-        av_log(s, AV_LOG_ERROR, "Wrong MPEG file format\n");
-        return AVERROR_INVALIDDATA;
-    }
-    av_log(s, AV_LOG_DEBUG, "version: %i layer: %i extension: %i\n", version, layer, extension);
-    if (version == 2 && extension) {
-        ctx->data_type  = IEC61937_MPEG2_EXT;
-        ctx->pkt_offset = 4608;
-    } else {
-        ctx->data_type  = mpeg_data_type [version & 1][layer];
-        ctx->pkt_offset = spdif_mpeg_pkt_offset[version & 1][layer];
-    }
-    // TODO Data type dependent info (normal/karaoke, dynamic range control)
-    return 0;
-}
-
-static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
-{
-    IEC61937Context *ctx = s->priv_data;
-    AACADTSHeaderInfo hdr;
-    GetBitContext gbc;
-    int ret;
-
-    init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
-    ret = avpriv_aac_parse_header(&gbc, &hdr);
-    if (ret < 0) {
-        av_log(s, AV_LOG_ERROR, "Wrong AAC file format\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ctx->pkt_offset = hdr.samples << 2;
-    switch (hdr.num_aac_frames) {
-    case 1:
-        ctx->data_type = IEC61937_MPEG2_AAC;
-        break;
-    case 2:
-        ctx->data_type = IEC61937_MPEG2_AAC_LSF_2048;
-        break;
-    case 4:
-        ctx->data_type = IEC61937_MPEG2_AAC_LSF_4096;
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "%i samples in AAC frame not supported\n",
-               hdr.samples);
-        return AVERROR(EINVAL);
-    }
-    //TODO Data type dependent info (LC profile/SBR)
-    return 0;
-}
-
-
-/*
- * It seems Dolby TrueHD frames have to be encapsulated in MAT frames before
- * they can be encapsulated in IEC 61937.
- * Here we encapsulate 24 TrueHD frames in a single MAT frame, padding them
- * to achieve constant rate.
- * The actual format of a MAT frame is unknown, but the below seems to work.
- * However, it seems it is not actually necessary for the 24 TrueHD frames to
- * be in an exact alignment with the MAT frame.
- */
-#define MAT_FRAME_SIZE          61424
-#define TRUEHD_FRAME_OFFSET     2560
-#define MAT_MIDDLE_CODE_OFFSET  -4
-
-static int spdif_header_truehd(AVFormatContext *s, AVPacket *pkt)
-{
-    IEC61937Context *ctx = s->priv_data;
-    int mat_code_length = 0;
-    const char mat_end_code[16] = { 0xC3, 0xC2, 0xC0, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x11 };
-
-    if (!ctx->hd_buf_count) {
-        const char mat_start_code[20] = { 0x07, 0x9E, 0x00, 0x03, 0x84, 0x01, 0x01, 0x01, 0x80, 0x00, 0x56, 0xA5, 0x3B, 0xF4, 0x81, 0x83, 0x49, 0x80, 0x77, 0xE0 };
-        mat_code_length = sizeof(mat_start_code) + BURST_HEADER_SIZE;
-        memcpy(ctx->hd_buf, mat_start_code, sizeof(mat_start_code));
-
-    } else if (ctx->hd_buf_count == 12) {
-        const char mat_middle_code[12] = { 0xC3, 0xC1, 0x42, 0x49, 0x3B, 0xFA, 0x82, 0x83, 0x49, 0x80, 0x77, 0xE0 };
-        mat_code_length = sizeof(mat_middle_code) + MAT_MIDDLE_CODE_OFFSET;
-        memcpy(&ctx->hd_buf[12 * TRUEHD_FRAME_OFFSET - BURST_HEADER_SIZE + MAT_MIDDLE_CODE_OFFSET],
-               mat_middle_code, sizeof(mat_middle_code));
-    }
-
-    if (pkt->size > TRUEHD_FRAME_OFFSET - mat_code_length) {
-        /* if such frames exist, we'd need some more complex logic to
-         * distribute the TrueHD frames in the MAT frame */
-        avpriv_request_sample(s, "Too large TrueHD frame of %d bytes",
-                              pkt->size);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    memcpy(&ctx->hd_buf[ctx->hd_buf_count * TRUEHD_FRAME_OFFSET - BURST_HEADER_SIZE + mat_code_length],
-           pkt->data, pkt->size);
-    memset(&ctx->hd_buf[ctx->hd_buf_count * TRUEHD_FRAME_OFFSET - BURST_HEADER_SIZE + mat_code_length + pkt->size],
-           0, TRUEHD_FRAME_OFFSET - pkt->size - mat_code_length);
-
-    if (++ctx->hd_buf_count < 24){
-        ctx->pkt_offset = 0;
-        return 0;
-    }
-    memcpy(&ctx->hd_buf[MAT_FRAME_SIZE - sizeof(mat_end_code)], mat_end_code, sizeof(mat_end_code));
-    ctx->hd_buf_count = 0;
-
-    ctx->data_type   = IEC61937_TRUEHD;
-    ctx->pkt_offset  = 61440;
-    ctx->out_buf     = ctx->hd_buf;
-    ctx->out_bytes   = MAT_FRAME_SIZE;
-    ctx->length_code = MAT_FRAME_SIZE;
-    return 0;
-}
-
-static int spdif_write_header(AVFormatContext *s)
-{
-    IEC61937Context *ctx = s->priv_data;
-
-    switch (s->streams[0]->codec->codec_id) {
-    case AV_CODEC_ID_AC3:
-        ctx->header_info = spdif_header_ac3;
-        break;
-    case AV_CODEC_ID_EAC3:
-        ctx->header_info = spdif_header_eac3;
-        break;
-    case AV_CODEC_ID_MP1:
-    case AV_CODEC_ID_MP2:
-    case AV_CODEC_ID_MP3:
-        ctx->header_info = spdif_header_mpeg;
-        break;
-    case AV_CODEC_ID_DTS:
-        ctx->header_info = spdif_header_dts;
-        break;
-    case AV_CODEC_ID_AAC:
-        ctx->header_info = spdif_header_aac;
-        break;
-    case AV_CODEC_ID_TRUEHD:
-        ctx->header_info = spdif_header_truehd;
-        ctx->hd_buf = av_malloc(MAT_FRAME_SIZE);
-        if (!ctx->hd_buf)
-            return AVERROR(ENOMEM);
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "codec not supported\n");
-        return AVERROR_PATCHWELCOME;
-    }
-    return 0;
-}
-
-static int spdif_write_trailer(AVFormatContext *s)
-{
-    IEC61937Context *ctx = s->priv_data;
-    av_freep(&ctx->buffer);
-    av_freep(&ctx->hd_buf);
-    return 0;
-}
-
-static av_always_inline void spdif_put_16(IEC61937Context *ctx,
-                                          AVIOContext *pb, unsigned int val)
-{
-    if (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN)
-        avio_wb16(pb, val);
-    else
-        avio_wl16(pb, val);
-}
-
-static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    IEC61937Context *ctx = s->priv_data;
-    int ret, padding;
-
-    ctx->out_buf = pkt->data;
-    ctx->out_bytes = pkt->size;
-    ctx->length_code = FFALIGN(pkt->size, 2) << 3;
-    ctx->use_preamble = 1;
-    ctx->extra_bswap = 0;
-
-    ret = ctx->header_info(s, pkt);
-    if (ret < 0)
-        return ret;
-    if (!ctx->pkt_offset)
-        return 0;
-
-    padding = (ctx->pkt_offset - ctx->use_preamble * BURST_HEADER_SIZE - ctx->out_bytes) & ~1;
-    if (padding < 0) {
-        av_log(s, AV_LOG_ERROR, "bitrate is too high\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (ctx->use_preamble) {
-        spdif_put_16(ctx, s->pb, SYNCWORD1);       //Pa
-        spdif_put_16(ctx, s->pb, SYNCWORD2);       //Pb
-        spdif_put_16(ctx, s->pb, ctx->data_type);  //Pc
-        spdif_put_16(ctx, s->pb, ctx->length_code);//Pd
-    }
-
-    if (ctx->extra_bswap ^ (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN)) {
-    avio_write(s->pb, ctx->out_buf, ctx->out_bytes & ~1);
-    } else {
-    av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!ctx->buffer)
-        return AVERROR(ENOMEM);
-    ff_spdif_bswap_buf16((uint16_t *)ctx->buffer, (uint16_t *)ctx->out_buf, ctx->out_bytes >> 1);
-    avio_write(s->pb, ctx->buffer, ctx->out_bytes & ~1);
-    }
-
-    /* a final lone byte has to be MSB aligned */
-    if (ctx->out_bytes & 1)
-        spdif_put_16(ctx, s->pb, ctx->out_buf[ctx->out_bytes - 1] << 8);
-
-    ffio_fill(s->pb, 0, padding);
-
-    av_log(s, AV_LOG_DEBUG, "type=%x len=%i pkt_offset=%i\n",
-           ctx->data_type, ctx->out_bytes, ctx->pkt_offset);
-
-    return 0;
-}
-
-AVOutputFormat ff_spdif_muxer = {
-    .name              = "spdif",
-    .long_name         = NULL_IF_CONFIG_SMALL("IEC 61937 (used on S/PDIF - IEC958)"),
-    .extensions        = "spdif",
-    .priv_data_size    = sizeof(IEC61937Context),
-    .audio_codec       = AV_CODEC_ID_AC3,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = spdif_write_header,
-    .write_packet      = spdif_write_packet,
-    .write_trailer     = spdif_write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
-    .priv_class        = &class,
-};
diff --git a/deps/libav/libavformat/srtdec.c b/deps/libav/libavformat/srtdec.c
deleted file mode 100644
index 9db5133..0000000
--- a/deps/libav/libavformat/srtdec.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * SubRip subtitle demuxer
- * Copyright (c) 2010  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "libavutil/intreadwrite.h"
-
-static int srt_probe(AVProbeData *p)
-{
-    unsigned char *ptr = p->buf;
-    int i, v, num = 0;
-
-    if (AV_RB24(ptr) == 0xEFBBBF)
-        ptr += 3;  /* skip UTF-8 BOM */
-
-    for (i=0; i<2; i++) {
-        if (num == i && sscanf(ptr, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
-            return AVPROBE_SCORE_MAX;
-        num = atoi(ptr);
-        ptr += strcspn(ptr, "\n") + 1;
-    }
-    return 0;
-}
-
-static int srt_read_header(AVFormatContext *s)
-{
-    AVStream *st = avformat_new_stream(s, NULL);
-    if (!st)
-        return -1;
-    avpriv_set_pts_info(st, 64, 1, 1000);
-    st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
-    st->codec->codec_id   = AV_CODEC_ID_SRT;
-    return 0;
-}
-
-static int64_t get_pts(const char *buf)
-{
-    int i, v, hour, min, sec, hsec;
-
-    for (i=0; i<2; i++) {
-        if (sscanf(buf, "%d:%2d:%2d%*1[,.]%3d --> %*d:%*2d:%*2d%*1[,.]%3d",
-                   &hour, &min, &sec, &hsec, &v) == 5) {
-            min += 60*hour;
-            sec += 60*min;
-            return sec*1000+hsec;
-        }
-        buf += strcspn(buf, "\n") + 1;
-    }
-    return AV_NOPTS_VALUE;
-}
-
-static inline int is_eol(char c)
-{
-    return c == '\r' || c == '\n';
-}
-
-static int srt_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    char buffer[2048], *ptr = buffer, *ptr2;
-    int64_t pos = avio_tell(s->pb);
-    int res = AVERROR_EOF;
-
-    do {
-        ptr2 = ptr;
-        ptr += ff_get_line(s->pb, ptr, sizeof(buffer)+buffer-ptr);
-    } while (!is_eol(*ptr2) && !s->pb->eof_reached && ptr-buffer<sizeof(buffer)-1);
-
-    if (buffer[0] && !(res = av_new_packet(pkt, ptr-buffer))) {
-        memcpy(pkt->data, buffer, pkt->size);
-        pkt->flags |= AV_PKT_FLAG_KEY;
-        pkt->pos = pos;
-        pkt->pts = pkt->dts = get_pts(pkt->data);
-    }
-    return res;
-}
-
-AVInputFormat ff_srt_demuxer = {
-    .name        = "srt",
-    .long_name   = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
-    .read_probe  = srt_probe,
-    .read_header = srt_read_header,
-    .read_packet = srt_read_packet,
-    .flags       = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/srtp.c b/deps/libav/libavformat/srtp.c
deleted file mode 100644
index 6659bfc..0000000
--- a/deps/libav/libavformat/srtp.c
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * SRTP encryption/decryption
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/base64.h"
-#include "libavutil/aes.h"
-#include "libavutil/hmac.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/log.h"
-#include "rtp.h"
-#include "rtpdec.h"
-#include "srtp.h"
-
-void ff_srtp_free(struct SRTPContext *s)
-{
-    if (!s)
-        return;
-    av_freep(&s->aes);
-    if (s->hmac)
-        av_hmac_free(s->hmac);
-    s->hmac = NULL;
-}
-
-static void encrypt_counter(struct AVAES *aes, uint8_t *iv, uint8_t *outbuf,
-                            int outlen)
-{
-    int i, j, outpos;
-    for (i = 0, outpos = 0; outpos < outlen; i++) {
-        uint8_t keystream[16];
-        AV_WB16(&iv[14], i);
-        av_aes_crypt(aes, keystream, iv, 1, NULL, 0);
-        for (j = 0; j < 16 && outpos < outlen; j++, outpos++)
-            outbuf[outpos] ^= keystream[j];
-    }
-}
-
-static void derive_key(struct AVAES *aes, const uint8_t *salt, int label,
-                       uint8_t *out, int outlen)
-{
-    uint8_t input[16] = { 0 };
-    memcpy(input, salt, 14);
-    // Key derivation rate assumed to be zero
-    input[14 - 7] ^= label;
-    memset(out, 0, outlen);
-    encrypt_counter(aes, input, out, outlen);
-}
-
-int ff_srtp_set_crypto(struct SRTPContext *s, const char *suite,
-                       const char *params)
-{
-    uint8_t buf[30];
-
-    ff_srtp_free(s);
-
-    // RFC 4568
-    if (!strcmp(suite, "AES_CM_128_HMAC_SHA1_80") ||
-        !strcmp(suite, "SRTP_AES128_CM_HMAC_SHA1_80")) {
-        s->rtp_hmac_size = s->rtcp_hmac_size = 10;
-    } else if (!strcmp(suite, "AES_CM_128_HMAC_SHA1_32")) {
-        s->rtp_hmac_size = s->rtcp_hmac_size = 4;
-    } else if (!strcmp(suite, "SRTP_AES128_CM_HMAC_SHA1_32")) {
-        // RFC 5764 section 4.1.2
-        s->rtp_hmac_size  = 4;
-        s->rtcp_hmac_size = 10;
-    } else {
-        av_log(NULL, AV_LOG_WARNING, "SRTP Crypto suite %s not supported\n",
-                                     suite);
-        return AVERROR(EINVAL);
-    }
-    if (av_base64_decode(buf, params, sizeof(buf)) != sizeof(buf)) {
-        av_log(NULL, AV_LOG_WARNING, "Incorrect amount of SRTP params\n");
-        return AVERROR(EINVAL);
-    }
-    // MKI and lifetime not handled yet
-    s->aes  = av_aes_alloc();
-    s->hmac = av_hmac_alloc(AV_HMAC_SHA1);
-    if (!s->aes || !s->hmac)
-        return AVERROR(ENOMEM);
-    memcpy(s->master_key, buf, 16);
-    memcpy(s->master_salt, buf + 16, 14);
-
-    // RFC 3711
-    av_aes_init(s->aes, s->master_key, 128, 0);
-
-    derive_key(s->aes, s->master_salt, 0x00, s->rtp_key, sizeof(s->rtp_key));
-    derive_key(s->aes, s->master_salt, 0x02, s->rtp_salt, sizeof(s->rtp_salt));
-    derive_key(s->aes, s->master_salt, 0x01, s->rtp_auth, sizeof(s->rtp_auth));
-
-    derive_key(s->aes, s->master_salt, 0x03, s->rtcp_key, sizeof(s->rtcp_key));
-    derive_key(s->aes, s->master_salt, 0x05, s->rtcp_salt, sizeof(s->rtcp_salt));
-    derive_key(s->aes, s->master_salt, 0x04, s->rtcp_auth, sizeof(s->rtcp_auth));
-    return 0;
-}
-
-static void create_iv(uint8_t *iv, const uint8_t *salt, uint64_t index,
-                      uint32_t ssrc)
-{
-    uint8_t indexbuf[8];
-    int i;
-    memset(iv, 0, 16);
-    AV_WB32(&iv[4], ssrc);
-    AV_WB64(indexbuf, index);
-    for (i = 0; i < 8; i++) // index << 16
-        iv[6 + i] ^= indexbuf[i];
-    for (i = 0; i < 14; i++)
-        iv[i] ^= salt[i];
-}
-
-int ff_srtp_decrypt(struct SRTPContext *s, uint8_t *buf, int *lenptr)
-{
-    uint8_t iv[16] = { 0 }, hmac[20];
-    int len = *lenptr;
-    int av_uninit(seq_largest);
-    uint32_t ssrc, av_uninit(roc);
-    uint64_t index;
-    int rtcp, hmac_size;
-
-    // TODO: Missing replay protection
-
-    if (len < 2)
-        return AVERROR_INVALIDDATA;
-
-    rtcp = RTP_PT_IS_RTCP(buf[1]);
-    hmac_size = rtcp ? s->rtcp_hmac_size : s->rtp_hmac_size;
-
-    if (len < hmac_size)
-        return AVERROR_INVALIDDATA;
-
-    // Authentication HMAC
-    av_hmac_init(s->hmac, rtcp ? s->rtcp_auth : s->rtp_auth, sizeof(s->rtp_auth));
-    // If MKI is used, this should exclude the MKI as well
-    av_hmac_update(s->hmac, buf, len - hmac_size);
-
-    if (!rtcp) {
-        int seq = AV_RB16(buf + 2);
-        uint32_t v;
-        uint8_t rocbuf[4];
-
-        // RFC 3711 section 3.3.1, appendix A
-        seq_largest = s->seq_initialized ? s->seq_largest : seq;
-        v = roc = s->roc;
-        if (seq_largest < 32768) {
-            if (seq - seq_largest > 32768)
-                v = roc - 1;
-        } else {
-            if (seq_largest - 32768 > seq)
-                v = roc + 1;
-        }
-        if (v == roc) {
-            seq_largest = FFMAX(seq_largest, seq);
-        } else if (v == roc + 1) {
-            seq_largest = seq;
-            roc = v;
-        }
-        index = seq + (((uint64_t)v) << 16);
-
-        AV_WB32(rocbuf, roc);
-        av_hmac_update(s->hmac, rocbuf, 4);
-    }
-
-    av_hmac_final(s->hmac, hmac, sizeof(hmac));
-    if (memcmp(hmac, buf + len - hmac_size, hmac_size)) {
-        av_log(NULL, AV_LOG_WARNING, "HMAC mismatch\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    len -= hmac_size;
-    *lenptr = len;
-
-    if (len < 12)
-        return AVERROR_INVALIDDATA;
-
-    if (rtcp) {
-        uint32_t srtcp_index = AV_RB32(buf + len - 4);
-        len -= 4;
-        *lenptr = len;
-
-        ssrc = AV_RB32(buf + 4);
-        index = srtcp_index & 0x7fffffff;
-
-        buf += 8;
-        len -= 8;
-        if (!(srtcp_index & 0x80000000))
-            return 0;
-    } else {
-        int ext, csrc;
-        s->seq_initialized = 1;
-        s->seq_largest     = seq_largest;
-        s->roc             = roc;
-
-        csrc = buf[0] & 0x0f;
-        ext  = buf[0] & 0x10;
-        ssrc = AV_RB32(buf + 8);
-
-        buf += 12;
-        len -= 12;
-
-        buf += 4 * csrc;
-        len -= 4 * csrc;
-        if (len < 0)
-            return AVERROR_INVALIDDATA;
-
-        if (ext) {
-            if (len < 4)
-                return AVERROR_INVALIDDATA;
-            ext = (AV_RB16(buf + 2) + 1) * 4;
-            if (len < ext)
-                return AVERROR_INVALIDDATA;
-            len -= ext;
-            buf += ext;
-        }
-    }
-
-    create_iv(iv, rtcp ? s->rtcp_salt : s->rtp_salt, index, ssrc);
-    av_aes_init(s->aes, rtcp ? s->rtcp_key : s->rtp_key, 128, 0);
-    encrypt_counter(s->aes, iv, buf, len);
-
-    return 0;
-}
-
-int ff_srtp_encrypt(struct SRTPContext *s, const uint8_t *in, int len,
-                    uint8_t *out, int outlen)
-{
-    uint8_t iv[16] = { 0 }, hmac[20];
-    uint64_t index;
-    uint32_t ssrc;
-    int rtcp, hmac_size, padding;
-    uint8_t *buf;
-
-    if (len < 8)
-        return AVERROR_INVALIDDATA;
-
-    rtcp = RTP_PT_IS_RTCP(in[1]);
-    hmac_size = rtcp ? s->rtcp_hmac_size : s->rtp_hmac_size;
-    padding = hmac_size;
-    if (rtcp)
-        padding += 4; // For the RTCP index
-
-    if (len + padding > outlen)
-        return 0;
-
-    memcpy(out, in, len);
-    buf = out;
-
-    if (rtcp) {
-        ssrc = AV_RB32(buf + 4);
-        index = s->rtcp_index++;
-
-        buf += 8;
-        len -= 8;
-    } else {
-        int ext, csrc;
-        int seq = AV_RB16(buf + 2);
-
-        if (len < 12)
-            return AVERROR_INVALIDDATA;
-
-        ssrc = AV_RB32(buf + 8);
-
-        if (seq < s->seq_largest)
-            s->roc++;
-        s->seq_largest = seq;
-        index = seq + (((uint64_t)s->roc) << 16);
-
-        csrc = buf[0] & 0x0f;
-        ext = buf[0] & 0x10;
-
-        buf += 12;
-        len -= 12;
-
-        buf += 4 * csrc;
-        len -= 4 * csrc;
-        if (len < 0)
-            return AVERROR_INVALIDDATA;
-
-        if (ext) {
-            if (len < 4)
-                return AVERROR_INVALIDDATA;
-            ext = (AV_RB16(buf + 2) + 1) * 4;
-            if (len < ext)
-                return AVERROR_INVALIDDATA;
-            len -= ext;
-            buf += ext;
-        }
-    }
-
-    create_iv(iv, rtcp ? s->rtcp_salt : s->rtp_salt, index, ssrc);
-    av_aes_init(s->aes, rtcp ? s->rtcp_key : s->rtp_key, 128, 0);
-    encrypt_counter(s->aes, iv, buf, len);
-
-    if (rtcp) {
-        AV_WB32(buf + len, 0x80000000 | index);
-        len += 4;
-    }
-
-    av_hmac_init(s->hmac, rtcp ? s->rtcp_auth : s->rtp_auth, sizeof(s->rtp_auth));
-    av_hmac_update(s->hmac, out, buf + len - out);
-    if (!rtcp) {
-        uint8_t rocbuf[4];
-        AV_WB32(rocbuf, s->roc);
-        av_hmac_update(s->hmac, rocbuf, 4);
-    }
-    av_hmac_final(s->hmac, hmac, sizeof(hmac));
-
-    memcpy(buf + len, hmac, hmac_size);
-    len += hmac_size;
-    return buf + len - out;
-}
-
-#ifdef TEST
-#include <stdio.h>
-
-static const char *aes128_80_key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn";
-
-static const uint8_t rtp_aes128_80[] = {
-    // RTP header
-    0x80, 0xe0, 0x12, 0x34, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78,
-    // encrypted payload
-    0x62, 0x69, 0x76, 0xca, 0xc5,
-    // HMAC
-    0xa1, 0xac, 0x1b, 0xb4, 0xa0, 0x1c, 0xd5, 0x49, 0x28, 0x99,
-};
-
-static const uint8_t rtcp_aes128_80[] = {
-    // RTCP header
-    0x81, 0xc9, 0x00, 0x07, 0x12, 0x34, 0x56, 0x78,
-    // encrypted payload
-    0x8a, 0xac, 0xdc, 0xa5, 0x4c, 0xf6, 0x78, 0xa6, 0x62, 0x8f, 0x24, 0xda,
-    0x6c, 0x09, 0x3f, 0xa9, 0x28, 0x7a, 0xb5, 0x7f, 0x1f, 0x0f, 0xc9, 0x35,
-    // RTCP index
-    0x80, 0x00, 0x00, 0x03,
-    // HMAC
-    0xe9, 0x3b, 0xc0, 0x5c, 0x0c, 0x06, 0x9f, 0xab, 0xc0, 0xde,
-};
-
-static const char *aes128_32_key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn";
-
-static const uint8_t rtp_aes128_32[] = {
-    // RTP header
-    0x80, 0xe0, 0x12, 0x34, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78,
-    // encrypted payload
-    0x62, 0x69, 0x76, 0xca, 0xc5,
-    // HMAC
-    0xa1, 0xac, 0x1b, 0xb4,
-};
-
-static const uint8_t rtcp_aes128_32[] = {
-    // RTCP header
-    0x81, 0xc9, 0x00, 0x07, 0x12, 0x34, 0x56, 0x78,
-    // encrypted payload
-    0x35, 0xe9, 0xb5, 0xff, 0x0d, 0xd1, 0xde, 0x70, 0x74, 0x10, 0xaa, 0x1b,
-    0xb2, 0x8d, 0xf0, 0x20, 0x02, 0x99, 0x6b, 0x1b, 0x0b, 0xd0, 0x47, 0x34,
-    // RTCP index
-    0x80, 0x00, 0x00, 0x04,
-    // HMAC
-    0x5b, 0xd2, 0xa9, 0x9d,
-};
-
-static const char *aes128_80_32_key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn";
-
-static const uint8_t rtp_aes128_80_32[] = {
-    // RTP header
-    0x80, 0xe0, 0x12, 0x34, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78,
-    // encrypted payload
-    0x62, 0x69, 0x76, 0xca, 0xc5,
-    // HMAC
-    0xa1, 0xac, 0x1b, 0xb4,
-};
-
-static const uint8_t rtcp_aes128_80_32[] = {
-    // RTCP header
-    0x81, 0xc9, 0x00, 0x07, 0x12, 0x34, 0x56, 0x78,
-    // encrypted payload
-    0xd6, 0xae, 0xc1, 0x58, 0x63, 0x70, 0xc9, 0x88, 0x66, 0x26, 0x1c, 0x53,
-    0xff, 0x5d, 0x5d, 0x2b, 0x0f, 0x8c, 0x72, 0x3e, 0xc9, 0x1d, 0x43, 0xf9,
-    // RTCP index
-    0x80, 0x00, 0x00, 0x05,
-    // HMAC
-    0x09, 0x16, 0xb4, 0x27, 0x9a, 0xe9, 0x92, 0x26, 0x4e, 0x10,
-};
-
-static void print_data(const uint8_t *buf, int len)
-{
-    int i;
-    for (i = 0; i < len; i++)
-        printf("%02x", buf[i]);
-    printf("\n");
-}
-
-static int test_decrypt(struct SRTPContext *srtp, const uint8_t *in, int len,
-                        uint8_t *out)
-{
-    memcpy(out, in, len);
-    if (!ff_srtp_decrypt(srtp, out, &len)) {
-        print_data(out, len);
-        return len;
-    } else
-        return -1;
-}
-
-static void test_encrypt(const uint8_t *data, int in_len, const char *suite,
-                         const char *key)
-{
-    struct SRTPContext enc = { 0 }, dec = { 0 };
-    int len;
-    char buf[RTP_MAX_PACKET_LENGTH];
-    ff_srtp_set_crypto(&enc, suite, key);
-    ff_srtp_set_crypto(&dec, suite, key);
-    len = ff_srtp_encrypt(&enc, data, in_len, buf, sizeof(buf));
-    if (!ff_srtp_decrypt(&dec, buf, &len)) {
-        if (len == in_len && !memcmp(buf, data, len))
-            printf("Decrypted content matches input\n");
-        else
-            printf("Decrypted content doesn't match input\n");
-    } else {
-        printf("Decryption failed\n");
-    }
-    ff_srtp_free(&enc);
-    ff_srtp_free(&dec);
-}
-
-int main(void)
-{
-    static const char *aes128_80_suite = "AES_CM_128_HMAC_SHA1_80";
-    static const char *aes128_32_suite = "AES_CM_128_HMAC_SHA1_32";
-    static const char *aes128_80_32_suite = "SRTP_AES128_CM_HMAC_SHA1_32";
-    static const char *test_key = "abcdefghijklmnopqrstuvwxyz1234567890ABCD";
-    uint8_t buf[RTP_MAX_PACKET_LENGTH];
-    struct SRTPContext srtp = { 0 };
-    int len;
-    ff_srtp_set_crypto(&srtp, aes128_80_suite, aes128_80_key);
-    len = test_decrypt(&srtp, rtp_aes128_80, sizeof(rtp_aes128_80), buf);
-    test_encrypt(buf, len, aes128_80_suite, test_key);
-    test_encrypt(buf, len, aes128_32_suite, test_key);
-    test_encrypt(buf, len, aes128_80_32_suite, test_key);
-    test_decrypt(&srtp, rtcp_aes128_80, sizeof(rtcp_aes128_80), buf);
-    test_encrypt(buf, len, aes128_80_suite, test_key);
-    test_encrypt(buf, len, aes128_32_suite, test_key);
-    test_encrypt(buf, len, aes128_80_32_suite, test_key);
-    ff_srtp_free(&srtp);
-
-    memset(&srtp, 0, sizeof(srtp)); // Clear the context
-    ff_srtp_set_crypto(&srtp, aes128_32_suite, aes128_32_key);
-    test_decrypt(&srtp, rtp_aes128_32, sizeof(rtp_aes128_32), buf);
-    test_decrypt(&srtp, rtcp_aes128_32, sizeof(rtcp_aes128_32), buf);
-    ff_srtp_free(&srtp);
-
-    memset(&srtp, 0, sizeof(srtp)); // Clear the context
-    ff_srtp_set_crypto(&srtp, aes128_80_32_suite, aes128_80_32_key);
-    test_decrypt(&srtp, rtp_aes128_80_32, sizeof(rtp_aes128_80_32), buf);
-    test_decrypt(&srtp, rtcp_aes128_80_32, sizeof(rtcp_aes128_80_32), buf);
-    ff_srtp_free(&srtp);
-    return 0;
-}
-#endif /* TEST */
diff --git a/deps/libav/libavformat/srtp.h b/deps/libav/libavformat/srtp.h
deleted file mode 100644
index 18ed177..0000000
--- a/deps/libav/libavformat/srtp.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * SRTP encryption/decryption
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_SRTP_H
-#define AVFORMAT_SRTP_H
-
-#include <stdint.h>
-
-struct AVAES;
-struct AVHMAC;
-
-struct SRTPContext {
-    struct AVAES *aes;
-    struct AVHMAC *hmac;
-    int rtp_hmac_size, rtcp_hmac_size;
-    uint8_t master_key[16];
-    uint8_t master_salt[14];
-    uint8_t rtp_key[16],  rtcp_key[16];
-    uint8_t rtp_salt[14], rtcp_salt[14];
-    uint8_t rtp_auth[20], rtcp_auth[20];
-    int seq_largest, seq_initialized;
-    uint32_t roc;
-
-    uint32_t rtcp_index;
-};
-
-int ff_srtp_set_crypto(struct SRTPContext *s, const char *suite,
-                       const char *params);
-void ff_srtp_free(struct SRTPContext *s);
-int ff_srtp_decrypt(struct SRTPContext *s, uint8_t *buf, int *lenptr);
-int ff_srtp_encrypt(struct SRTPContext *s, const uint8_t *in, int len,
-                    uint8_t *out, int outlen);
-
-#endif /* AVFORMAT_SRTP_H */
diff --git a/deps/libav/libavformat/srtpproto.c b/deps/libav/libavformat/srtpproto.c
deleted file mode 100644
index f9b94d7..0000000
--- a/deps/libav/libavformat/srtpproto.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * SRTP network protocol
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/opt.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "url.h"
-
-#include "internal.h"
-#include "rtpdec.h"
-#include "srtp.h"
-
-typedef struct SRTPProtoContext {
-    const AVClass *class;
-    URLContext *rtp_hd;
-    const char *out_suite, *out_params;
-    const char *in_suite, *in_params;
-    struct SRTPContext srtp_out, srtp_in;
-    uint8_t encryptbuf[RTP_MAX_PACKET_LENGTH];
-} SRTPProtoContext;
-
-#define D AV_OPT_FLAG_DECODING_PARAM
-#define E AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "srtp_out_suite", "", offsetof(SRTPProtoContext, out_suite), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
-    { "srtp_out_params", "", offsetof(SRTPProtoContext, out_params), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
-    { "srtp_in_suite", "", offsetof(SRTPProtoContext, in_suite), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
-    { "srtp_in_params", "", offsetof(SRTPProtoContext, in_params), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
-    { NULL }
-};
-
-static const AVClass srtp_context_class = {
-    .class_name     = "srtp",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-static int srtp_close(URLContext *h)
-{
-    SRTPProtoContext *s = h->priv_data;
-    ff_srtp_free(&s->srtp_out);
-    ff_srtp_free(&s->srtp_in);
-    ffurl_close(s->rtp_hd);
-    s->rtp_hd = NULL;
-    return 0;
-}
-
-static int srtp_open(URLContext *h, const char *uri, int flags)
-{
-    SRTPProtoContext *s = h->priv_data;
-    char hostname[256], buf[1024], path[1024];
-    int rtp_port, ret;
-
-    if (s->out_suite && s->out_params)
-        if ((ret = ff_srtp_set_crypto(&s->srtp_out, s->out_suite, s->out_params)) < 0)
-            goto fail;
-    if (s->in_suite && s->in_params)
-        if ((ret = ff_srtp_set_crypto(&s->srtp_in, s->in_suite, s->in_params)) < 0)
-            goto fail;
-
-    av_url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &rtp_port,
-                 path, sizeof(path), uri);
-    ff_url_join(buf, sizeof(buf), "rtp", NULL, hostname, rtp_port, "%s", path);
-    if ((ret = ffurl_open(&s->rtp_hd, buf, flags, &h->interrupt_callback, NULL)) < 0)
-        goto fail;
-
-    h->max_packet_size = FFMIN(s->rtp_hd->max_packet_size,
-                               sizeof(s->encryptbuf)) - 14;
-    h->is_streamed = 1;
-    return 0;
-
-fail:
-    srtp_close(h);
-    return ret;
-}
-
-static int srtp_read(URLContext *h, uint8_t *buf, int size)
-{
-    SRTPProtoContext *s = h->priv_data;
-    int ret;
-start:
-    ret = ffurl_read(s->rtp_hd, buf, size);
-    if (ret > 0 && s->srtp_in.aes) {
-        if (ff_srtp_decrypt(&s->srtp_in, buf, &ret) < 0)
-            goto start;
-    }
-    return ret;
-}
-
-static int srtp_write(URLContext *h, const uint8_t *buf, int size)
-{
-    SRTPProtoContext *s = h->priv_data;
-    if (!s->srtp_out.aes)
-        return ffurl_write(s->rtp_hd, buf, size);
-    size = ff_srtp_encrypt(&s->srtp_out, buf, size, s->encryptbuf,
-                           sizeof(s->encryptbuf));
-    if (size < 0)
-        return size;
-    return ffurl_write(s->rtp_hd, s->encryptbuf, size);
-}
-
-static int srtp_get_file_handle(URLContext *h)
-{
-    SRTPProtoContext *s = h->priv_data;
-    return ffurl_get_file_handle(s->rtp_hd);
-}
-
-static int srtp_get_multi_file_handle(URLContext *h, int **handles,
-                                      int *numhandles)
-{
-    SRTPProtoContext *s = h->priv_data;
-    return ffurl_get_multi_file_handle(s->rtp_hd, handles, numhandles);
-}
-
-URLProtocol ff_srtp_protocol = {
-    .name                      = "srtp",
-    .url_open                  = srtp_open,
-    .url_read                  = srtp_read,
-    .url_write                 = srtp_write,
-    .url_close                 = srtp_close,
-    .url_get_file_handle       = srtp_get_file_handle,
-    .url_get_multi_file_handle = srtp_get_multi_file_handle,
-    .priv_data_size            = sizeof(SRTPProtoContext),
-    .priv_data_class           = &srtp_context_class,
-    .flags                     = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/swf.c b/deps/libav/libavformat/swf.c
deleted file mode 100644
index e6adf69..0000000
--- a/deps/libav/libavformat/swf.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Flash Compatible Streaming Format
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2003 Tinic Uro
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "internal.h"
-
-const AVCodecTag ff_swf_codec_tags[] = {
-    { AV_CODEC_ID_FLV1, 0x02 },
-    { AV_CODEC_ID_VP6F, 0x04 },
-    { AV_CODEC_ID_NONE,    0 },
-};
diff --git a/deps/libav/libavformat/swf.h b/deps/libav/libavformat/swf.h
deleted file mode 100644
index 79c3c1d..0000000
--- a/deps/libav/libavformat/swf.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Flash Compatible Streaming Format common header.
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2003 Tinic Uro
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_SWF_H
-#define AVFORMAT_SWF_H
-
-#include "libavutil/fifo.h"
-#include "avformat.h"
-#include "avio.h"
-#include "internal.h"
-
-/* should have a generic way to indicate probable size */
-#define DUMMY_FILE_SIZE   (100 * 1024 * 1024)
-#define DUMMY_DURATION    600 /* in seconds */
-
-#define TAG_END           0
-#define TAG_SHOWFRAME     1
-#define TAG_DEFINESHAPE   2
-#define TAG_FREECHARACTER 3
-#define TAG_PLACEOBJECT   4
-#define TAG_REMOVEOBJECT  5
-#define TAG_STREAMHEAD    18
-#define TAG_STREAMBLOCK   19
-#define TAG_JPEG2         21
-#define TAG_PLACEOBJECT2  26
-#define TAG_STREAMHEAD2   45
-#define TAG_VIDEOSTREAM   60
-#define TAG_VIDEOFRAME    61
-#define TAG_FILEATTRIBUTES 69
-
-#define TAG_LONG         0x100
-
-/* flags for shape definition */
-#define FLAG_MOVETO      0x01
-#define FLAG_SETFILL0    0x02
-#define FLAG_SETFILL1    0x04
-
-#define AUDIO_FIFO_SIZE 65536
-
-/* character id used */
-#define BITMAP_ID 0
-#define VIDEO_ID 0
-#define SHAPE_ID  1
-
-#undef NDEBUG
-#include <assert.h>
-
-typedef struct SWFContext {
-    int64_t duration_pos;
-    int64_t tag_pos;
-    int64_t vframes_pos;
-    int samples_per_frame;
-    int sound_samples;
-    int swf_frame_number;
-    int video_frame_number;
-    int frame_rate;
-    int tag;
-    AVFifoBuffer *audio_fifo;
-    AVCodecContext *audio_enc, *video_enc;
-} SWFContext;
-
-extern const AVCodecTag ff_swf_codec_tags[];
-
-#endif /* AVFORMAT_SWF_H */
diff --git a/deps/libav/libavformat/swfdec.c b/deps/libav/libavformat/swfdec.c
deleted file mode 100644
index d7a5314..0000000
--- a/deps/libav/libavformat/swfdec.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Flash Compatible Streaming Format demuxer
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2003 Tinic Uro
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "swf.h"
-
-static const AVCodecTag swf_audio_codec_tags[] = {
-    { AV_CODEC_ID_PCM_S16LE,  0x00 },
-    { AV_CODEC_ID_ADPCM_SWF,  0x01 },
-    { AV_CODEC_ID_MP3,        0x02 },
-    { AV_CODEC_ID_PCM_S16LE,  0x03 },
-//  { AV_CODEC_ID_NELLYMOSER, 0x06 },
-    { AV_CODEC_ID_NONE,          0 },
-};
-
-static int get_swf_tag(AVIOContext *pb, int *len_ptr)
-{
-    int tag, len;
-
-    if (pb->eof_reached)
-        return -1;
-
-    tag = avio_rl16(pb);
-    len = tag & 0x3f;
-    tag = tag >> 6;
-    if (len == 0x3f) {
-        len = avio_rl32(pb);
-    }
-    *len_ptr = len;
-    return tag;
-}
-
-
-static int swf_probe(AVProbeData *p)
-{
-    /* check file header */
-    if ((p->buf[0] == 'F' || p->buf[0] == 'C') && p->buf[1] == 'W' &&
-        p->buf[2] == 'S')
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int swf_read_header(AVFormatContext *s)
-{
-    SWFContext *swf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int nbits, len, tag;
-
-    tag = avio_rb32(pb) & 0xffffff00;
-
-    if (tag == MKBETAG('C', 'W', 'S', 0)) {
-        av_log(s, AV_LOG_ERROR, "Compressed SWF format not supported\n");
-        return AVERROR(EIO);
-    }
-    if (tag != MKBETAG('F', 'W', 'S', 0))
-        return AVERROR(EIO);
-    avio_rl32(pb);
-    /* skip rectangle size */
-    nbits = avio_r8(pb) >> 3;
-    len = (4 * nbits - 3 + 7) / 8;
-    avio_skip(pb, len);
-    swf->frame_rate = avio_rl16(pb); /* 8.8 fixed */
-    avio_rl16(pb); /* frame count */
-
-    swf->samples_per_frame = 0;
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-    return 0;
-}
-
-static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    SWFContext *swf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *vst = NULL, *ast = NULL, *st = 0;
-    int tag, len, i, frame, v, res;
-
-    for(;;) {
-        uint64_t pos = avio_tell(pb);
-        tag = get_swf_tag(pb, &len);
-        if (tag < 0)
-            return AVERROR(EIO);
-        if (len < 0) {
-            av_log(s, AV_LOG_ERROR, "invalid tag length: %d\n", len);
-            return AVERROR_INVALIDDATA;
-        }
-        if (tag == TAG_VIDEOSTREAM) {
-            int ch_id = avio_rl16(pb);
-            len -= 2;
-
-            for (i=0; i<s->nb_streams; i++) {
-                st = s->streams[i];
-                if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id)
-                    goto skip;
-            }
-
-            avio_rl16(pb);
-            avio_rl16(pb);
-            avio_rl16(pb);
-            avio_r8(pb);
-            /* Check for FLV1 */
-            vst = avformat_new_stream(s, NULL);
-            if (!vst)
-                return -1;
-            vst->id = ch_id;
-            vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            vst->codec->codec_id = ff_codec_get_id(ff_swf_codec_tags, avio_r8(pb));
-            avpriv_set_pts_info(vst, 16, 256, swf->frame_rate);
-            len -= 8;
-        } else if (tag == TAG_STREAMHEAD || tag == TAG_STREAMHEAD2) {
-            /* streaming found */
-            int sample_rate_code;
-
-            for (i=0; i<s->nb_streams; i++) {
-                st = s->streams[i];
-                if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1)
-                    goto skip;
-            }
-
-            avio_r8(pb);
-            v = avio_r8(pb);
-            swf->samples_per_frame = avio_rl16(pb);
-            ast = avformat_new_stream(s, NULL);
-            if (!ast)
-                return -1;
-            ast->id = -1; /* -1 to avoid clash with video stream ch_id */
-            if (v & 1) {
-                ast->codec->channels       = 2;
-                ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-            } else {
-                ast->codec->channels       = 1;
-                ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
-            }
-            ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            ast->codec->codec_id = ff_codec_get_id(swf_audio_codec_tags, (v>>4) & 15);
-            ast->need_parsing = AVSTREAM_PARSE_FULL;
-            sample_rate_code= (v>>2) & 3;
-            ast->codec->sample_rate = 44100 >> (3 - sample_rate_code);
-            avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
-            len -= 4;
-        } else if (tag == TAG_VIDEOFRAME) {
-            int ch_id = avio_rl16(pb);
-            len -= 2;
-            for(i=0; i<s->nb_streams; i++) {
-                st = s->streams[i];
-                if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id) {
-                    frame = avio_rl16(pb);
-                    len -= 2;
-                    if (len <= 0)
-                        goto skip;
-                    if ((res = av_get_packet(pb, pkt, len)) < 0)
-                        return res;
-                    pkt->pos = pos;
-                    pkt->pts = frame;
-                    pkt->stream_index = st->index;
-                    return pkt->size;
-                }
-            }
-        } else if (tag == TAG_STREAMBLOCK) {
-            for (i = 0; i < s->nb_streams; i++) {
-                st = s->streams[i];
-                if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) {
-                    if (st->codec->codec_id == AV_CODEC_ID_MP3) {
-                        avio_skip(pb, 4);
-                        len -= 4;
-                        if (len <= 0)
-                            goto skip;
-                        if ((res = av_get_packet(pb, pkt, len)) < 0)
-                            return res;
-                    } else { // ADPCM, PCM
-                        if (len <= 0)
-                            goto skip;
-                        if ((res = av_get_packet(pb, pkt, len)) < 0)
-                            return res;
-                    }
-                    pkt->pos          = pos;
-                    pkt->stream_index = st->index;
-                    return pkt->size;
-                }
-            }
-        } else if (tag == TAG_JPEG2) {
-            for (i=0; i<s->nb_streams; i++) {
-                st = s->streams[i];
-                if (st->codec->codec_id == AV_CODEC_ID_MJPEG && st->id == -2)
-                    break;
-            }
-            if (i == s->nb_streams) {
-                vst = avformat_new_stream(s, NULL);
-                if (!vst)
-                    return -1;
-                vst->id = -2; /* -2 to avoid clash with video stream and audio stream */
-                vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-                vst->codec->codec_id = AV_CODEC_ID_MJPEG;
-                avpriv_set_pts_info(vst, 64, 256, swf->frame_rate);
-                st = vst;
-            }
-            avio_rl16(pb); /* BITMAP_ID */
-            len -= 2;
-            if (len < 4)
-                goto skip;
-            if ((res = av_new_packet(pkt, len)) < 0)
-                return res;
-            avio_read(pb, pkt->data, 4);
-            if (AV_RB32(pkt->data) == 0xffd8ffd9 ||
-                AV_RB32(pkt->data) == 0xffd9ffd8) {
-                /* old SWF files containing SOI/EOI as data start */
-                /* files created by swink have reversed tag */
-                pkt->size -= 4;
-                avio_read(pb, pkt->data, pkt->size);
-            } else {
-                avio_read(pb, pkt->data + 4, pkt->size - 4);
-            }
-            pkt->pos = pos;
-            pkt->stream_index = st->index;
-            return pkt->size;
-        }
-    skip:
-        len = FFMAX(0, len);
-        avio_skip(pb, len);
-    }
-}
-
-AVInputFormat ff_swf_demuxer = {
-    .name           = "swf",
-    .long_name      = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
-    .priv_data_size = sizeof(SWFContext),
-    .read_probe     = swf_probe,
-    .read_header    = swf_read_header,
-    .read_packet    = swf_read_packet,
-};
diff --git a/deps/libav/libavformat/swfenc.c b/deps/libav/libavformat/swfenc.c
deleted file mode 100644
index be2e5cd..0000000
--- a/deps/libav/libavformat/swfenc.c
+++ /dev/null
@@ -1,536 +0,0 @@
-/*
- * Flash Compatible Streaming Format muxer
- * Copyright (c) 2000 Fabrice Bellard
- * Copyright (c) 2003 Tinic Uro
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/put_bits.h"
-#include "avformat.h"
-#include "swf.h"
-
-static void put_swf_tag(AVFormatContext *s, int tag)
-{
-    SWFContext *swf = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    swf->tag_pos = avio_tell(pb);
-    swf->tag = tag;
-    /* reserve some room for the tag */
-    if (tag & TAG_LONG) {
-        avio_wl16(pb, 0);
-        avio_wl32(pb, 0);
-    } else {
-        avio_wl16(pb, 0);
-    }
-}
-
-static void put_swf_end_tag(AVFormatContext *s)
-{
-    SWFContext *swf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t pos;
-    int tag_len, tag;
-
-    pos = avio_tell(pb);
-    tag_len = pos - swf->tag_pos - 2;
-    tag = swf->tag;
-    avio_seek(pb, swf->tag_pos, SEEK_SET);
-    if (tag & TAG_LONG) {
-        tag &= ~TAG_LONG;
-        avio_wl16(pb, (tag << 6) | 0x3f);
-        avio_wl32(pb, tag_len - 4);
-    } else {
-        assert(tag_len < 0x3f);
-        avio_wl16(pb, (tag << 6) | tag_len);
-    }
-    avio_seek(pb, pos, SEEK_SET);
-}
-
-static inline void max_nbits(int *nbits_ptr, int val)
-{
-    int n;
-
-    if (val == 0)
-        return;
-    val = abs(val);
-    n = 1;
-    while (val != 0) {
-        n++;
-        val >>= 1;
-    }
-    if (n > *nbits_ptr)
-        *nbits_ptr = n;
-}
-
-static void put_swf_rect(AVIOContext *pb,
-                         int xmin, int xmax, int ymin, int ymax)
-{
-    PutBitContext p;
-    uint8_t buf[256];
-    int nbits, mask;
-
-    init_put_bits(&p, buf, sizeof(buf));
-
-    nbits = 0;
-    max_nbits(&nbits, xmin);
-    max_nbits(&nbits, xmax);
-    max_nbits(&nbits, ymin);
-    max_nbits(&nbits, ymax);
-    mask = (1 << nbits) - 1;
-
-    /* rectangle info */
-    put_bits(&p, 5, nbits);
-    put_bits(&p, nbits, xmin & mask);
-    put_bits(&p, nbits, xmax & mask);
-    put_bits(&p, nbits, ymin & mask);
-    put_bits(&p, nbits, ymax & mask);
-
-    flush_put_bits(&p);
-    avio_write(pb, buf, put_bits_ptr(&p) - p.buf);
-}
-
-static void put_swf_line_edge(PutBitContext *pb, int dx, int dy)
-{
-    int nbits, mask;
-
-    put_bits(pb, 1, 1); /* edge */
-    put_bits(pb, 1, 1); /* line select */
-    nbits = 2;
-    max_nbits(&nbits, dx);
-    max_nbits(&nbits, dy);
-
-    mask = (1 << nbits) - 1;
-    put_bits(pb, 4, nbits - 2); /* 16 bits precision */
-    if (dx == 0) {
-        put_bits(pb, 1, 0);
-        put_bits(pb, 1, 1);
-        put_bits(pb, nbits, dy & mask);
-    } else if (dy == 0) {
-        put_bits(pb, 1, 0);
-        put_bits(pb, 1, 0);
-        put_bits(pb, nbits, dx & mask);
-    } else {
-        put_bits(pb, 1, 1);
-        put_bits(pb, nbits, dx & mask);
-        put_bits(pb, nbits, dy & mask);
-    }
-}
-
-#define FRAC_BITS 16
-
-static void put_swf_matrix(AVIOContext *pb,
-                           int a, int b, int c, int d, int tx, int ty)
-{
-    PutBitContext p;
-    uint8_t buf[256];
-    int nbits;
-
-    init_put_bits(&p, buf, sizeof(buf));
-
-    put_bits(&p, 1, 1); /* a, d present */
-    nbits = 1;
-    max_nbits(&nbits, a);
-    max_nbits(&nbits, d);
-    put_bits(&p, 5, nbits); /* nb bits */
-    put_bits(&p, nbits, a);
-    put_bits(&p, nbits, d);
-
-    put_bits(&p, 1, 1); /* b, c present */
-    nbits = 1;
-    max_nbits(&nbits, c);
-    max_nbits(&nbits, b);
-    put_bits(&p, 5, nbits); /* nb bits */
-    put_bits(&p, nbits, c);
-    put_bits(&p, nbits, b);
-
-    nbits = 1;
-    max_nbits(&nbits, tx);
-    max_nbits(&nbits, ty);
-    put_bits(&p, 5, nbits); /* nb bits */
-    put_bits(&p, nbits, tx);
-    put_bits(&p, nbits, ty);
-
-    flush_put_bits(&p);
-    avio_write(pb, buf, put_bits_ptr(&p) - p.buf);
-}
-
-static int swf_write_header(AVFormatContext *s)
-{
-    SWFContext *swf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    PutBitContext p;
-    uint8_t buf1[256];
-    int i, width, height, rate, rate_base;
-    int version;
-
-    swf->sound_samples = 0;
-    swf->swf_frame_number = 0;
-    swf->video_frame_number = 0;
-
-    for(i=0;i<s->nb_streams;i++) {
-        AVCodecContext *enc = s->streams[i]->codec;
-        if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (swf->audio_enc) {
-                av_log(s, AV_LOG_ERROR, "SWF muxer only supports 1 audio stream\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (enc->codec_id == AV_CODEC_ID_MP3) {
-                swf->audio_enc = enc;
-                swf->audio_fifo= av_fifo_alloc(AUDIO_FIFO_SIZE);
-                if (!swf->audio_fifo)
-                    return AVERROR(ENOMEM);
-            } else {
-                av_log(s, AV_LOG_ERROR, "SWF muxer only supports MP3\n");
-                return -1;
-            }
-        } else {
-            if (swf->video_enc) {
-                av_log(s, AV_LOG_ERROR, "SWF muxer only supports 1 video stream\n");
-                return AVERROR_INVALIDDATA;
-            }
-            if (enc->codec_id == AV_CODEC_ID_VP6F ||
-                enc->codec_id == AV_CODEC_ID_FLV1 ||
-                enc->codec_id == AV_CODEC_ID_MJPEG) {
-                swf->video_enc = enc;
-            } else {
-                av_log(s, AV_LOG_ERROR, "SWF muxer only supports VP6, FLV1 and MJPEG\n");
-                return -1;
-            }
-        }
-    }
-
-    if (!swf->video_enc) {
-        /* currently, cannot work correctly if audio only */
-        width = 320;
-        height = 200;
-        rate = 10;
-        rate_base= 1;
-    } else {
-        width = swf->video_enc->width;
-        height = swf->video_enc->height;
-        rate = swf->video_enc->time_base.den;
-        rate_base = swf->video_enc->time_base.num;
-    }
-
-    if (!swf->audio_enc)
-        swf->samples_per_frame = (44100.0 * rate_base) / rate;
-    else
-        swf->samples_per_frame = (swf->audio_enc->sample_rate * rate_base) / rate;
-
-    avio_write(pb, "FWS", 3);
-
-    if (!strcmp("avm2", s->oformat->name))
-        version = 9;
-    else if (swf->video_enc && swf->video_enc->codec_id == AV_CODEC_ID_VP6F)
-        version = 8; /* version 8 and above support VP6 codec */
-    else if (swf->video_enc && swf->video_enc->codec_id == AV_CODEC_ID_FLV1)
-        version = 6; /* version 6 and above support FLV1 codec */
-    else
-        version = 4; /* version 4 for mpeg audio support */
-    avio_w8(pb, version);
-
-    avio_wl32(pb, DUMMY_FILE_SIZE); /* dummy size
-                                      (will be patched if not streamed) */
-
-    put_swf_rect(pb, 0, width * 20, 0, height * 20);
-    avio_wl16(pb, (rate * 256) / rate_base); /* frame rate */
-    swf->duration_pos = avio_tell(pb);
-    avio_wl16(pb, (uint16_t)(DUMMY_DURATION * (int64_t)rate / rate_base)); /* frame count */
-
-    /* avm2/swf v9 (also v8?) files require a file attribute tag */
-    if (version == 9) {
-        put_swf_tag(s, TAG_FILEATTRIBUTES);
-        avio_wl32(pb, 1<<3); /* set ActionScript v3/AVM2 flag */
-        put_swf_end_tag(s);
-    }
-
-    /* define a shape with the jpeg inside */
-    if (swf->video_enc && swf->video_enc->codec_id == AV_CODEC_ID_MJPEG) {
-        put_swf_tag(s, TAG_DEFINESHAPE);
-
-        avio_wl16(pb, SHAPE_ID); /* ID of shape */
-        /* bounding rectangle */
-        put_swf_rect(pb, 0, width, 0, height);
-        /* style info */
-        avio_w8(pb, 1); /* one fill style */
-        avio_w8(pb, 0x41); /* clipped bitmap fill */
-        avio_wl16(pb, BITMAP_ID); /* bitmap ID */
-        /* position of the bitmap */
-        put_swf_matrix(pb, (int)(1.0 * (1 << FRAC_BITS)), 0,
-                       0, (int)(1.0 * (1 << FRAC_BITS)), 0, 0);
-        avio_w8(pb, 0); /* no line style */
-
-        /* shape drawing */
-        init_put_bits(&p, buf1, sizeof(buf1));
-        put_bits(&p, 4, 1); /* one fill bit */
-        put_bits(&p, 4, 0); /* zero line bit */
-
-        put_bits(&p, 1, 0); /* not an edge */
-        put_bits(&p, 5, FLAG_MOVETO | FLAG_SETFILL0);
-        put_bits(&p, 5, 1); /* nbits */
-        put_bits(&p, 1, 0); /* X */
-        put_bits(&p, 1, 0); /* Y */
-        put_bits(&p, 1, 1); /* set fill style 1 */
-
-        /* draw the rectangle ! */
-        put_swf_line_edge(&p, width, 0);
-        put_swf_line_edge(&p, 0, height);
-        put_swf_line_edge(&p, -width, 0);
-        put_swf_line_edge(&p, 0, -height);
-
-        /* end of shape */
-        put_bits(&p, 1, 0); /* not an edge */
-        put_bits(&p, 5, 0);
-
-        flush_put_bits(&p);
-        avio_write(pb, buf1, put_bits_ptr(&p) - p.buf);
-
-        put_swf_end_tag(s);
-    }
-
-    if (swf->audio_enc && swf->audio_enc->codec_id == AV_CODEC_ID_MP3) {
-        int v = 0;
-
-        /* start sound */
-        put_swf_tag(s, TAG_STREAMHEAD2);
-        switch(swf->audio_enc->sample_rate) {
-        case 11025: v |= 1 << 2; break;
-        case 22050: v |= 2 << 2; break;
-        case 44100: v |= 3 << 2; break;
-        default:
-            /* not supported */
-            av_log(s, AV_LOG_ERROR, "swf does not support that sample rate, choose from (44100, 22050, 11025).\n");
-            return -1;
-        }
-        v |= 0x02; /* 16 bit playback */
-        if (swf->audio_enc->channels == 2)
-            v |= 0x01; /* stereo playback */
-        avio_w8(s->pb, v);
-        v |= 0x20; /* mp3 compressed */
-        avio_w8(s->pb, v);
-        avio_wl16(s->pb, swf->samples_per_frame);  /* avg samples per frame */
-        avio_wl16(s->pb, 0);
-
-        put_swf_end_tag(s);
-    }
-
-    avio_flush(s->pb);
-    return 0;
-}
-
-static int swf_write_video(AVFormatContext *s,
-                           AVCodecContext *enc, const uint8_t *buf, int size)
-{
-    SWFContext *swf = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    /* Flash Player limit */
-    if (swf->swf_frame_number == 16000)
-        av_log(enc, AV_LOG_INFO, "warning: Flash Player limit of 16000 frames reached\n");
-
-    if (enc->codec_id == AV_CODEC_ID_VP6F ||
-        enc->codec_id == AV_CODEC_ID_FLV1) {
-        if (swf->video_frame_number == 0) {
-            /* create a new video object */
-            put_swf_tag(s, TAG_VIDEOSTREAM);
-            avio_wl16(pb, VIDEO_ID);
-            swf->vframes_pos = avio_tell(pb);
-            avio_wl16(pb, 15000); /* hard flash player limit */
-            avio_wl16(pb, enc->width);
-            avio_wl16(pb, enc->height);
-            avio_w8(pb, 0);
-            avio_w8(pb,ff_codec_get_tag(ff_swf_codec_tags, enc->codec_id));
-            put_swf_end_tag(s);
-
-            /* place the video object for the first time */
-            put_swf_tag(s, TAG_PLACEOBJECT2);
-            avio_w8(pb, 0x36);
-            avio_wl16(pb, 1);
-            avio_wl16(pb, VIDEO_ID);
-            put_swf_matrix(pb, 1 << FRAC_BITS, 0, 0, 1 << FRAC_BITS, 0, 0);
-            avio_wl16(pb, swf->video_frame_number);
-            avio_write(pb, "video", 5);
-            avio_w8(pb, 0x00);
-            put_swf_end_tag(s);
-        } else {
-            /* mark the character for update */
-            put_swf_tag(s, TAG_PLACEOBJECT2);
-            avio_w8(pb, 0x11);
-            avio_wl16(pb, 1);
-            avio_wl16(pb, swf->video_frame_number);
-            put_swf_end_tag(s);
-        }
-
-        /* set video frame data */
-        put_swf_tag(s, TAG_VIDEOFRAME | TAG_LONG);
-        avio_wl16(pb, VIDEO_ID);
-        avio_wl16(pb, swf->video_frame_number++);
-        avio_write(pb, buf, size);
-        put_swf_end_tag(s);
-    } else if (enc->codec_id == AV_CODEC_ID_MJPEG) {
-        if (swf->swf_frame_number > 0) {
-            /* remove the shape */
-            put_swf_tag(s, TAG_REMOVEOBJECT);
-            avio_wl16(pb, SHAPE_ID); /* shape ID */
-            avio_wl16(pb, 1); /* depth */
-            put_swf_end_tag(s);
-
-            /* free the bitmap */
-            put_swf_tag(s, TAG_FREECHARACTER);
-            avio_wl16(pb, BITMAP_ID);
-            put_swf_end_tag(s);
-        }
-
-        put_swf_tag(s, TAG_JPEG2 | TAG_LONG);
-
-        avio_wl16(pb, BITMAP_ID); /* ID of the image */
-
-        /* a dummy jpeg header seems to be required */
-        avio_wb32(pb, 0xffd8ffd9);
-        /* write the jpeg image */
-        avio_write(pb, buf, size);
-
-        put_swf_end_tag(s);
-
-        /* draw the shape */
-
-        put_swf_tag(s, TAG_PLACEOBJECT);
-        avio_wl16(pb, SHAPE_ID); /* shape ID */
-        avio_wl16(pb, 1); /* depth */
-        put_swf_matrix(pb, 20 << FRAC_BITS, 0, 0, 20 << FRAC_BITS, 0, 0);
-        put_swf_end_tag(s);
-    }
-
-    swf->swf_frame_number++;
-
-    /* streaming sound always should be placed just before showframe tags */
-    if (swf->audio_enc && av_fifo_size(swf->audio_fifo)) {
-        int frame_size = av_fifo_size(swf->audio_fifo);
-        put_swf_tag(s, TAG_STREAMBLOCK | TAG_LONG);
-        avio_wl16(pb, swf->sound_samples);
-        avio_wl16(pb, 0); // seek samples
-        av_fifo_generic_read(swf->audio_fifo, pb, frame_size, &avio_write);
-        put_swf_end_tag(s);
-
-        /* update FIFO */
-        swf->sound_samples = 0;
-    }
-
-    /* output the frame */
-    put_swf_tag(s, TAG_SHOWFRAME);
-    put_swf_end_tag(s);
-
-    return 0;
-}
-
-static int swf_write_audio(AVFormatContext *s,
-                           AVCodecContext *enc, uint8_t *buf, int size)
-{
-    SWFContext *swf = s->priv_data;
-
-    /* Flash Player limit */
-    if (swf->swf_frame_number == 16000)
-        av_log(enc, AV_LOG_INFO, "warning: Flash Player limit of 16000 frames reached\n");
-
-    if (av_fifo_size(swf->audio_fifo) + size > AUDIO_FIFO_SIZE) {
-        av_log(s, AV_LOG_ERROR, "audio fifo too small to mux audio essence\n");
-        return -1;
-    }
-
-    av_fifo_generic_write(swf->audio_fifo, buf, size, NULL);
-    swf->sound_samples += av_get_audio_frame_duration(enc, size);
-
-    /* if audio only stream make sure we add swf frames */
-    if (!swf->video_enc)
-        swf_write_video(s, enc, 0, 0);
-
-    return 0;
-}
-
-static int swf_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
-    if (codec->codec_type == AVMEDIA_TYPE_AUDIO)
-        return swf_write_audio(s, codec, pkt->data, pkt->size);
-    else
-        return swf_write_video(s, codec, pkt->data, pkt->size);
-}
-
-static int swf_write_trailer(AVFormatContext *s)
-{
-    SWFContext *swf = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVCodecContext *enc, *video_enc;
-    int file_size, i;
-
-    video_enc = NULL;
-    for(i=0;i<s->nb_streams;i++) {
-        enc = s->streams[i]->codec;
-        if (enc->codec_type == AVMEDIA_TYPE_VIDEO)
-            video_enc = enc;
-        else
-            av_fifo_free(swf->audio_fifo);
-    }
-
-    put_swf_tag(s, TAG_END);
-    put_swf_end_tag(s);
-
-    /* patch file size and number of frames if not streamed */
-    if (s->pb->seekable && video_enc) {
-        file_size = avio_tell(pb);
-        avio_seek(pb, 4, SEEK_SET);
-        avio_wl32(pb, file_size);
-        avio_seek(pb, swf->duration_pos, SEEK_SET);
-        avio_wl16(pb, swf->video_frame_number);
-        avio_seek(pb, swf->vframes_pos, SEEK_SET);
-        avio_wl16(pb, swf->video_frame_number);
-        avio_seek(pb, file_size, SEEK_SET);
-    }
-    return 0;
-}
-
-#if CONFIG_SWF_MUXER
-AVOutputFormat ff_swf_muxer = {
-    .name              = "swf",
-    .long_name         = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
-    .mime_type         = "application/x-shockwave-flash",
-    .extensions        = "swf",
-    .priv_data_size    = sizeof(SWFContext),
-    .audio_codec       = AV_CODEC_ID_MP3,
-    .video_codec       = AV_CODEC_ID_FLV1,
-    .write_header      = swf_write_header,
-    .write_packet      = swf_write_packet,
-    .write_trailer     = swf_write_trailer,
-    .flags             = AVFMT_TS_NONSTRICT,
-};
-#endif
-#if CONFIG_AVM2_MUXER
-AVOutputFormat ff_avm2_muxer = {
-    .name              = "avm2",
-    .long_name         = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash) (AVM2)"),
-    .mime_type         = "application/x-shockwave-flash",
-    .priv_data_size    = sizeof(SWFContext),
-    .audio_codec       = AV_CODEC_ID_MP3,
-    .video_codec       = AV_CODEC_ID_FLV1,
-    .write_header      = swf_write_header,
-    .write_packet      = swf_write_packet,
-    .write_trailer     = swf_write_trailer,
-    .flags             = AVFMT_TS_NONSTRICT,
-};
-#endif
diff --git a/deps/libav/libavformat/takdec.c b/deps/libav/libavformat/takdec.c
deleted file mode 100644
index 584cbcc..0000000
--- a/deps/libav/libavformat/takdec.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Raw TAK demuxer
- * Copyright (c) 2012 Paul B Mahol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/tak.h"
-#include "avformat.h"
-#include "internal.h"
-#include "rawdec.h"
-#include "apetag.h"
-
-typedef struct TAKDemuxContext {
-    int     mlast_frame;
-    int64_t data_end;
-} TAKDemuxContext;
-
-static int tak_probe(AVProbeData *p)
-{
-    if (!memcmp(p->buf, "tBaK", 4))
-        return AVPROBE_SCORE_EXTENSION;
-    return 0;
-}
-
-static int tak_read_header(AVFormatContext *s)
-{
-    TAKDemuxContext *tc = s->priv_data;
-    AVIOContext *pb     = s->pb;
-    GetBitContext gb;
-    AVStream *st;
-    uint8_t *buffer = NULL;
-    int ret;
-
-    st = avformat_new_stream(s, 0);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id   = AV_CODEC_ID_TAK;
-    st->need_parsing      = AVSTREAM_PARSE_FULL;
-
-    tc->mlast_frame = 0;
-    if (avio_rl32(pb) != MKTAG('t', 'B', 'a', 'K')) {
-        avio_seek(pb, -4, SEEK_CUR);
-        return 0;
-    }
-
-    while (!pb->eof_reached) {
-        enum TAKMetaDataType type;
-        int size;
-
-        type = avio_r8(pb) & 0x7f;
-        size = avio_rl24(pb);
-
-        switch (type) {
-        case TAK_METADATA_STREAMINFO:
-        case TAK_METADATA_LAST_FRAME:
-        case TAK_METADATA_ENCODER:
-            buffer = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!buffer)
-                return AVERROR(ENOMEM);
-
-            if (avio_read(pb, buffer, size) != size) {
-                av_freep(&buffer);
-                return AVERROR(EIO);
-            }
-
-            init_get_bits(&gb, buffer, size * 8);
-            break;
-        case TAK_METADATA_MD5: {
-            uint8_t md5[16];
-            int i;
-
-            if (size != 19)
-                return AVERROR_INVALIDDATA;
-            avio_read(pb, md5, 16);
-            avio_skip(pb, 3);
-            av_log(s, AV_LOG_VERBOSE, "MD5=");
-            for (i = 0; i < 16; i++)
-                av_log(s, AV_LOG_VERBOSE, "%02x", md5[i]);
-            av_log(s, AV_LOG_VERBOSE, "\n");
-            break;
-        }
-        case TAK_METADATA_END: {
-            int64_t curpos = avio_tell(pb);
-
-            if (pb->seekable) {
-                ff_ape_parse_tag(s);
-                avio_seek(pb, curpos, SEEK_SET);
-            }
-
-            tc->data_end += curpos;
-            return 0;
-        }
-        default:
-            ret = avio_skip(pb, size);
-            if (ret < 0)
-                return ret;
-        }
-
-        if (type == TAK_METADATA_STREAMINFO) {
-            TAKStreamInfo ti;
-
-            avpriv_tak_parse_streaminfo(&gb, &ti);
-            if (ti.samples > 0)
-                st->duration = ti.samples;
-            st->codec->bits_per_coded_sample = ti.bps;
-            if (ti.ch_layout)
-                st->codec->channel_layout = ti.ch_layout;
-            st->codec->sample_rate           = ti.sample_rate;
-            st->codec->channels              = ti.channels;
-            st->start_time                   = 0;
-            avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-            st->codec->extradata             = buffer;
-            st->codec->extradata_size        = size;
-            buffer                           = NULL;
-        } else if (type == TAK_METADATA_LAST_FRAME) {
-            if (size != 11)
-                return AVERROR_INVALIDDATA;
-            tc->mlast_frame = 1;
-            tc->data_end    = get_bits64(&gb, TAK_LAST_FRAME_POS_BITS) +
-                              get_bits(&gb, TAK_LAST_FRAME_SIZE_BITS);
-            av_freep(&buffer);
-        } else if (type == TAK_METADATA_ENCODER) {
-            av_log(s, AV_LOG_VERBOSE, "encoder version: %0X\n",
-                   get_bits_long(&gb, TAK_ENCODER_VERSION_BITS));
-            av_freep(&buffer);
-        }
-    }
-
-    return AVERROR_EOF;
-}
-
-static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    TAKDemuxContext *tc = s->priv_data;
-    int ret;
-
-    if (tc->mlast_frame) {
-        AVIOContext *pb = s->pb;
-        int64_t size, left;
-
-        left = tc->data_end - avio_tell(s->pb);
-        size = FFMIN(left, 1024);
-        if (size <= 0)
-            return AVERROR_EOF;
-
-        ret = av_get_packet(pb, pkt, size);
-        if (ret < 0)
-            return ret;
-
-        pkt->stream_index = 0;
-    } else {
-        ret = ff_raw_read_partial_packet(s, pkt);
-    }
-
-    return ret;
-}
-
-AVInputFormat ff_tak_demuxer = {
-    .name           = "tak",
-    .long_name      = NULL_IF_CONFIG_SMALL("raw TAK"),
-    .priv_data_size = sizeof(TAKDemuxContext),
-    .read_probe     = tak_probe,
-    .read_header    = tak_read_header,
-    .read_packet    = raw_read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .extensions     = "tak",
-    .raw_codec_id   = AV_CODEC_ID_TAK,
-};
diff --git a/deps/libav/libavformat/tcp.c b/deps/libav/libavformat/tcp.c
deleted file mode 100644
index cbd5142..0000000
--- a/deps/libav/libavformat/tcp.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * TCP protocol
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avformat.h"
-#include "libavutil/parseutils.h"
-#include "internal.h"
-#include "network.h"
-#include "os_support.h"
-#include "url.h"
-#if HAVE_POLL_H
-#include <poll.h>
-#endif
-
-typedef struct TCPContext {
-    int fd;
-} TCPContext;
-
-/* return non zero if error */
-static int tcp_open(URLContext *h, const char *uri, int flags)
-{
-    struct addrinfo hints = { 0 }, *ai, *cur_ai;
-    int port, fd = -1;
-    TCPContext *s = h->priv_data;
-    int listen_socket = 0;
-    const char *p;
-    char buf[256];
-    int ret;
-    int timeout = 100, listen_timeout = -1;
-    char hostname[1024],proto[1024],path[1024];
-    char portstr[10];
-
-    av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
-        &port, path, sizeof(path), uri);
-    if (strcmp(proto, "tcp"))
-        return AVERROR(EINVAL);
-    if (port <= 0 || port >= 65536) {
-        av_log(h, AV_LOG_ERROR, "Port missing in uri\n");
-        return AVERROR(EINVAL);
-    }
-    p = strchr(uri, '?');
-    if (p) {
-        if (av_find_info_tag(buf, sizeof(buf), "listen", p))
-            listen_socket = 1;
-        if (av_find_info_tag(buf, sizeof(buf), "timeout", p)) {
-            timeout = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "listen_timeout", p)) {
-            listen_timeout = strtol(buf, NULL, 10);
-        }
-    }
-    hints.ai_family = AF_UNSPEC;
-    hints.ai_socktype = SOCK_STREAM;
-    snprintf(portstr, sizeof(portstr), "%d", port);
-    if (listen_socket)
-        hints.ai_flags |= AI_PASSIVE;
-    if (!hostname[0])
-        ret = getaddrinfo(NULL, portstr, &hints, &ai);
-    else
-        ret = getaddrinfo(hostname, portstr, &hints, &ai);
-    if (ret) {
-        av_log(h, AV_LOG_ERROR,
-               "Failed to resolve hostname %s: %s\n",
-               hostname, gai_strerror(ret));
-        return AVERROR(EIO);
-    }
-
-    cur_ai = ai;
-
- restart:
-    fd = ff_socket(cur_ai->ai_family,
-                   cur_ai->ai_socktype,
-                   cur_ai->ai_protocol);
-    if (fd < 0) {
-        ret = ff_neterrno();
-        goto fail;
-    }
-
-    if (listen_socket) {
-        if ((fd = ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
-                                 listen_timeout, h)) < 0) {
-            ret = fd;
-            goto fail1;
-        }
-    } else {
-        if ((ret = ff_listen_connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
-                                     timeout * 100, h, !!cur_ai->ai_next)) < 0) {
-
-            if (ret == AVERROR_EXIT)
-                goto fail1;
-            else
-                goto fail;
-        }
-    }
-
-    h->is_streamed = 1;
-    s->fd = fd;
-    freeaddrinfo(ai);
-    return 0;
-
- fail:
-    if (cur_ai->ai_next) {
-        /* Retry with the next sockaddr */
-        cur_ai = cur_ai->ai_next;
-        if (fd >= 0)
-            closesocket(fd);
-        ret = 0;
-        goto restart;
-    }
- fail1:
-    if (fd >= 0)
-        closesocket(fd);
-    freeaddrinfo(ai);
-    return ret;
-}
-
-static int tcp_read(URLContext *h, uint8_t *buf, int size)
-{
-    TCPContext *s = h->priv_data;
-    int ret;
-
-    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
-        ret = ff_network_wait_fd(s->fd, 0);
-        if (ret < 0)
-            return ret;
-    }
-    ret = recv(s->fd, buf, size, 0);
-    return ret < 0 ? ff_neterrno() : ret;
-}
-
-static int tcp_write(URLContext *h, const uint8_t *buf, int size)
-{
-    TCPContext *s = h->priv_data;
-    int ret;
-
-    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
-        ret = ff_network_wait_fd(s->fd, 1);
-        if (ret < 0)
-            return ret;
-    }
-    ret = send(s->fd, buf, size, 0);
-    return ret < 0 ? ff_neterrno() : ret;
-}
-
-static int tcp_shutdown(URLContext *h, int flags)
-{
-    TCPContext *s = h->priv_data;
-    int how;
-
-    if (flags & AVIO_FLAG_WRITE && flags & AVIO_FLAG_READ) {
-        how = SHUT_RDWR;
-    } else if (flags & AVIO_FLAG_WRITE) {
-        how = SHUT_WR;
-    } else {
-        how = SHUT_RD;
-    }
-
-    return shutdown(s->fd, how);
-}
-
-static int tcp_close(URLContext *h)
-{
-    TCPContext *s = h->priv_data;
-    closesocket(s->fd);
-    return 0;
-}
-
-static int tcp_get_file_handle(URLContext *h)
-{
-    TCPContext *s = h->priv_data;
-    return s->fd;
-}
-
-URLProtocol ff_tcp_protocol = {
-    .name                = "tcp",
-    .url_open            = tcp_open,
-    .url_read            = tcp_read,
-    .url_write           = tcp_write,
-    .url_close           = tcp_close,
-    .url_get_file_handle = tcp_get_file_handle,
-    .url_shutdown        = tcp_shutdown,
-    .priv_data_size      = sizeof(TCPContext),
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/thp.c b/deps/libav/libavformat/thp.c
deleted file mode 100644
index e8ca04f..0000000
--- a/deps/libav/libavformat/thp.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * THP Demuxer
- * Copyright (c) 2007 Marco Gerards
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct ThpDemuxContext {
-    int              version;
-    int              first_frame;
-    int              first_framesz;
-    int              last_frame;
-    int              compoff;
-    int              framecnt;
-    AVRational       fps;
-    int              frame;
-    int              next_frame;
-    int              next_framesz;
-    int              video_stream_index;
-    int              audio_stream_index;
-    int              compcount;
-    unsigned char    components[16];
-    AVStream*        vst;
-    int              has_audio;
-    int              audiosize;
-} ThpDemuxContext;
-
-
-static int thp_probe(AVProbeData *p)
-{
-    /* check file header */
-    if (AV_RL32(p->buf) == MKTAG('T', 'H', 'P', '\0'))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int thp_read_header(AVFormatContext *s)
-{
-    ThpDemuxContext *thp = s->priv_data;
-    AVStream *st;
-    AVIOContext *pb = s->pb;
-    int i;
-
-    /* Read the file header.  */
-                           avio_rb32(pb); /* Skip Magic.  */
-    thp->version         = avio_rb32(pb);
-
-                           avio_rb32(pb); /* Max buf size.  */
-                           avio_rb32(pb); /* Max samples.  */
-
-    thp->fps             = av_d2q(av_int2float(avio_rb32(pb)), INT_MAX);
-    thp->framecnt        = avio_rb32(pb);
-    thp->first_framesz   = avio_rb32(pb);
-                           avio_rb32(pb); /* Data size.  */
-
-    thp->compoff         = avio_rb32(pb);
-                           avio_rb32(pb); /* offsetDataOffset.  */
-    thp->first_frame     = avio_rb32(pb);
-    thp->last_frame      = avio_rb32(pb);
-
-    thp->next_framesz    = thp->first_framesz;
-    thp->next_frame      = thp->first_frame;
-
-    /* Read the component structure.  */
-    avio_seek (pb, thp->compoff, SEEK_SET);
-    thp->compcount       = avio_rb32(pb);
-
-    /* Read the list of component types.  */
-    avio_read(pb, thp->components, 16);
-
-    for (i = 0; i < thp->compcount; i++) {
-        if (thp->components[i] == 0) {
-            if (thp->vst != 0)
-                break;
-
-            /* Video component.  */
-            st = avformat_new_stream(s, NULL);
-            if (!st)
-                return AVERROR(ENOMEM);
-
-            /* The denominator and numerator are switched because 1/fps
-               is required.  */
-            avpriv_set_pts_info(st, 64, thp->fps.den, thp->fps.num);
-            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-            st->codec->codec_id = AV_CODEC_ID_THP;
-            st->codec->codec_tag = 0;  /* no fourcc */
-            st->codec->width = avio_rb32(pb);
-            st->codec->height = avio_rb32(pb);
-            st->codec->sample_rate = av_q2d(thp->fps);
-            thp->vst = st;
-            thp->video_stream_index = st->index;
-
-            if (thp->version == 0x11000)
-                avio_rb32(pb); /* Unknown.  */
-        } else if (thp->components[i] == 1) {
-            if (thp->has_audio != 0)
-                break;
-
-            /* Audio component.  */
-            st = avformat_new_stream(s, NULL);
-            if (!st)
-                return AVERROR(ENOMEM);
-
-            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-            st->codec->codec_id = AV_CODEC_ID_ADPCM_THP;
-            st->codec->codec_tag = 0;  /* no fourcc */
-            st->codec->channels    = avio_rb32(pb); /* numChannels.  */
-            st->codec->sample_rate = avio_rb32(pb); /* Frequency.  */
-
-            avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-
-            thp->audio_stream_index = st->index;
-            thp->has_audio = 1;
-        }
-    }
-
-    return 0;
-}
-
-static int thp_read_packet(AVFormatContext *s,
-                            AVPacket *pkt)
-{
-    ThpDemuxContext *thp = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int size;
-    int ret;
-
-    if (thp->audiosize == 0) {
-        /* Terminate when last frame is reached.  */
-        if (thp->frame >= thp->framecnt)
-            return AVERROR(EIO);
-
-        avio_seek(pb, thp->next_frame, SEEK_SET);
-
-        /* Locate the next frame and read out its size.  */
-        thp->next_frame += thp->next_framesz;
-        thp->next_framesz = avio_rb32(pb);
-
-                        avio_rb32(pb); /* Previous total size.  */
-        size          = avio_rb32(pb); /* Total size of this frame.  */
-
-        /* Store the audiosize so the next time this function is called,
-           the audio can be read.  */
-        if (thp->has_audio)
-            thp->audiosize = avio_rb32(pb); /* Audio size.  */
-        else
-            thp->frame++;
-
-        ret = av_get_packet(pb, pkt, size);
-        if (ret != size) {
-            av_free_packet(pkt);
-            return AVERROR(EIO);
-        }
-
-        pkt->stream_index = thp->video_stream_index;
-    } else {
-        ret = av_get_packet(pb, pkt, thp->audiosize);
-        if (ret != thp->audiosize) {
-            av_free_packet(pkt);
-            return AVERROR(EIO);
-        }
-
-        pkt->stream_index = thp->audio_stream_index;
-        if (thp->audiosize >= 8)
-            pkt->duration = AV_RB32(&pkt->data[4]);
-
-        thp->audiosize = 0;
-        thp->frame++;
-    }
-
-    return 0;
-}
-
-AVInputFormat ff_thp_demuxer = {
-    .name           = "thp",
-    .long_name      = NULL_IF_CONFIG_SMALL("THP"),
-    .priv_data_size = sizeof(ThpDemuxContext),
-    .read_probe     = thp_probe,
-    .read_header    = thp_read_header,
-    .read_packet    = thp_read_packet
-};
diff --git a/deps/libav/libavformat/tiertexseq.c b/deps/libav/libavformat/tiertexseq.c
deleted file mode 100644
index 45300f9..0000000
--- a/deps/libav/libavformat/tiertexseq.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Tiertex Limited SEQ File Demuxer
- * Copyright (c) 2006 Gregory Montoir (cyx at users.sourceforge.net)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Tiertex Limited SEQ file demuxer
- */
-
-#include "libavutil/channel_layout.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define SEQ_FRAME_SIZE         6144
-#define SEQ_FRAME_W            256
-#define SEQ_FRAME_H            128
-#define SEQ_NUM_FRAME_BUFFERS  30
-#define SEQ_AUDIO_BUFFER_SIZE  882
-#define SEQ_SAMPLE_RATE        22050
-#define SEQ_FRAME_RATE         25
-
-
-typedef struct TiertexSeqFrameBuffer {
-    int fill_size;
-    int data_size;
-    unsigned char *data;
-} TiertexSeqFrameBuffer;
-
-typedef struct SeqDemuxContext {
-    int audio_stream_index;
-    int video_stream_index;
-    int current_frame_pts;
-    int current_frame_offs;
-    TiertexSeqFrameBuffer frame_buffers[SEQ_NUM_FRAME_BUFFERS];
-    int frame_buffers_count;
-    unsigned int current_audio_data_size;
-    unsigned int current_audio_data_offs;
-    unsigned int current_pal_data_size;
-    unsigned int current_pal_data_offs;
-    unsigned int current_video_data_size;
-    unsigned char *current_video_data_ptr;
-    int audio_buffer_full;
-} SeqDemuxContext;
-
-
-static int seq_probe(AVProbeData *p)
-{
-    int i;
-
-    if (p->buf_size < 258)
-        return 0;
-
-    /* there's no real header in a .seq file, the only thing they have in common */
-    /* is the first 256 bytes of the file which are always filled with 0 */
-    for (i = 0; i < 256; i++)
-        if (p->buf[i])
-            return 0;
-
-    if(p->buf[256]==0 && p->buf[257]==0)
-        return 0;
-
-    /* only one fourth of the score since the previous check is too naive */
-    return AVPROBE_SCORE_MAX / 4;
-}
-
-static int seq_init_frame_buffers(SeqDemuxContext *seq, AVIOContext *pb)
-{
-    int i, sz;
-    TiertexSeqFrameBuffer *seq_buffer;
-
-    avio_seek(pb, 256, SEEK_SET);
-
-    for (i = 0; i < SEQ_NUM_FRAME_BUFFERS; i++) {
-        sz = avio_rl16(pb);
-        if (sz == 0)
-            break;
-        else {
-            seq_buffer = &seq->frame_buffers[i];
-            seq_buffer->fill_size = 0;
-            seq_buffer->data_size = sz;
-            seq_buffer->data = av_malloc(sz);
-            if (!seq_buffer->data)
-                return AVERROR(ENOMEM);
-        }
-    }
-    seq->frame_buffers_count = i;
-    return 0;
-}
-
-static int seq_fill_buffer(SeqDemuxContext *seq, AVIOContext *pb, int buffer_num, unsigned int data_offs, int data_size)
-{
-    TiertexSeqFrameBuffer *seq_buffer;
-
-    if (buffer_num >= SEQ_NUM_FRAME_BUFFERS)
-        return AVERROR_INVALIDDATA;
-
-    seq_buffer = &seq->frame_buffers[buffer_num];
-    if (seq_buffer->fill_size + data_size > seq_buffer->data_size || data_size <= 0)
-        return AVERROR_INVALIDDATA;
-
-    avio_seek(pb, seq->current_frame_offs + data_offs, SEEK_SET);
-    if (avio_read(pb, seq_buffer->data + seq_buffer->fill_size, data_size) != data_size)
-        return AVERROR(EIO);
-
-    seq_buffer->fill_size += data_size;
-    return 0;
-}
-
-static int seq_parse_frame_data(SeqDemuxContext *seq, AVIOContext *pb)
-{
-    unsigned int offset_table[4], buffer_num[4];
-    TiertexSeqFrameBuffer *seq_buffer;
-    int i, e, err;
-
-    seq->current_frame_offs += SEQ_FRAME_SIZE;
-    avio_seek(pb, seq->current_frame_offs, SEEK_SET);
-
-    /* sound data */
-    seq->current_audio_data_offs = avio_rl16(pb);
-    if (seq->current_audio_data_offs) {
-        seq->current_audio_data_size = SEQ_AUDIO_BUFFER_SIZE * 2;
-    } else {
-        seq->current_audio_data_size = 0;
-    }
-
-    /* palette data */
-    seq->current_pal_data_offs = avio_rl16(pb);
-    if (seq->current_pal_data_offs) {
-        seq->current_pal_data_size = 768;
-    } else {
-        seq->current_pal_data_size = 0;
-    }
-
-    /* video data */
-    for (i = 0; i < 4; i++)
-        buffer_num[i] = avio_r8(pb);
-
-    for (i = 0; i < 4; i++)
-        offset_table[i] = avio_rl16(pb);
-
-    for (i = 0; i < 3; i++) {
-        if (offset_table[i]) {
-            for (e = i + 1; e < 3 && offset_table[e] == 0; e++);
-            err = seq_fill_buffer(seq, pb, buffer_num[1 + i],
-              offset_table[i],
-              offset_table[e] - offset_table[i]);
-            if (err)
-                return err;
-        }
-    }
-
-    if (buffer_num[0] != 255) {
-        if (buffer_num[0] >= SEQ_NUM_FRAME_BUFFERS)
-            return AVERROR_INVALIDDATA;
-
-        seq_buffer = &seq->frame_buffers[buffer_num[0]];
-        seq->current_video_data_size = seq_buffer->fill_size;
-        seq->current_video_data_ptr  = seq_buffer->data;
-        seq_buffer->fill_size = 0;
-    } else {
-        seq->current_video_data_size = 0;
-        seq->current_video_data_ptr  = 0;
-    }
-
-    return 0;
-}
-
-static int seq_read_header(AVFormatContext *s)
-{
-    int i, rc;
-    SeqDemuxContext *seq = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-
-    /* init internal buffers */
-    rc = seq_init_frame_buffers(seq, pb);
-    if (rc)
-        return rc;
-
-    seq->current_frame_offs = 0;
-
-    /* preload (no audio data, just buffer operations related data) */
-    for (i = 1; i <= 100; i++) {
-        rc = seq_parse_frame_data(seq, pb);
-        if (rc)
-            return rc;
-    }
-
-    seq->current_frame_pts = 0;
-
-    seq->audio_buffer_full = 0;
-
-    /* initialize the video decoder stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    avpriv_set_pts_info(st, 32, 1, SEQ_FRAME_RATE);
-    seq->video_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_TIERTEXSEQVIDEO;
-    st->codec->codec_tag = 0;  /* no fourcc */
-    st->codec->width = SEQ_FRAME_W;
-    st->codec->height = SEQ_FRAME_H;
-
-    /* initialize the audio decoder stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->start_time = 0;
-    avpriv_set_pts_info(st, 32, 1, SEQ_SAMPLE_RATE);
-    seq->audio_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
-    st->codec->codec_tag = 0;  /* no tag */
-    st->codec->channels = 1;
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    st->codec->sample_rate = SEQ_SAMPLE_RATE;
-    st->codec->bits_per_coded_sample = 16;
-    st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels;
-    st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample / 8;
-
-    return 0;
-}
-
-static int seq_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int rc;
-    SeqDemuxContext *seq = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    if (!seq->audio_buffer_full) {
-        rc = seq_parse_frame_data(seq, pb);
-        if (rc)
-            return rc;
-
-        /* video packet */
-        if (seq->current_pal_data_size + seq->current_video_data_size != 0) {
-            if (av_new_packet(pkt, 1 + seq->current_pal_data_size + seq->current_video_data_size))
-                return AVERROR(ENOMEM);
-
-            pkt->data[0] = 0;
-            if (seq->current_pal_data_size) {
-                pkt->data[0] |= 1;
-                avio_seek(pb, seq->current_frame_offs + seq->current_pal_data_offs, SEEK_SET);
-                if (avio_read(pb, &pkt->data[1], seq->current_pal_data_size) != seq->current_pal_data_size)
-                    return AVERROR(EIO);
-            }
-            if (seq->current_video_data_size) {
-                pkt->data[0] |= 2;
-                memcpy(&pkt->data[1 + seq->current_pal_data_size],
-                  seq->current_video_data_ptr,
-                  seq->current_video_data_size);
-            }
-            pkt->stream_index = seq->video_stream_index;
-            pkt->pts = seq->current_frame_pts;
-
-            /* sound buffer will be processed on next read_packet() call */
-            seq->audio_buffer_full = 1;
-            return 0;
-       }
-    }
-
-    /* audio packet */
-    if (seq->current_audio_data_offs == 0) /* end of data reached */
-        return AVERROR(EIO);
-
-    avio_seek(pb, seq->current_frame_offs + seq->current_audio_data_offs, SEEK_SET);
-    rc = av_get_packet(pb, pkt, seq->current_audio_data_size);
-    if (rc < 0)
-        return rc;
-
-    pkt->stream_index = seq->audio_stream_index;
-    seq->current_frame_pts++;
-
-    seq->audio_buffer_full = 0;
-    return 0;
-}
-
-static int seq_read_close(AVFormatContext *s)
-{
-    int i;
-    SeqDemuxContext *seq = s->priv_data;
-
-    for (i = 0; i < SEQ_NUM_FRAME_BUFFERS; i++)
-        av_free(seq->frame_buffers[i].data);
-
-    return 0;
-}
-
-AVInputFormat ff_tiertexseq_demuxer = {
-    .name           = "tiertexseq",
-    .long_name      = NULL_IF_CONFIG_SMALL("Tiertex Limited SEQ"),
-    .priv_data_size = sizeof(SeqDemuxContext),
-    .read_probe     = seq_probe,
-    .read_header    = seq_read_header,
-    .read_packet    = seq_read_packet,
-    .read_close     = seq_read_close,
-};
diff --git a/deps/libav/libavformat/tls.c b/deps/libav/libavformat/tls.c
deleted file mode 100644
index 1baecf4..0000000
--- a/deps/libav/libavformat/tls.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * TLS/SSL Protocol
- * Copyright (c) 2011 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "url.h"
-#include "libavutil/avstring.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#if CONFIG_GNUTLS
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-#define TLS_read(c, buf, size)  gnutls_record_recv(c->session, buf, size)
-#define TLS_write(c, buf, size) gnutls_record_send(c->session, buf, size)
-#define TLS_shutdown(c)         gnutls_bye(c->session, GNUTLS_SHUT_RDWR)
-#define TLS_free(c) do { \
-        if (c->session) \
-            gnutls_deinit(c->session); \
-        if (c->cred) \
-            gnutls_certificate_free_credentials(c->cred); \
-    } while (0)
-#elif CONFIG_OPENSSL
-#include <openssl/bio.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#define TLS_read(c, buf, size)  SSL_read(c->ssl,  buf, size)
-#define TLS_write(c, buf, size) SSL_write(c->ssl, buf, size)
-#define TLS_shutdown(c)         SSL_shutdown(c->ssl)
-#define TLS_free(c) do { \
-        if (c->ssl) \
-            SSL_free(c->ssl); \
-        if (c->ctx) \
-            SSL_CTX_free(c->ctx); \
-    } while (0)
-#endif
-#include "network.h"
-#include "os_support.h"
-#include "internal.h"
-#if HAVE_POLL_H
-#include <poll.h>
-#endif
-
-typedef struct {
-    const AVClass *class;
-    URLContext *tcp;
-#if CONFIG_GNUTLS
-    gnutls_session_t session;
-    gnutls_certificate_credentials_t cred;
-#elif CONFIG_OPENSSL
-    SSL_CTX *ctx;
-    SSL *ssl;
-#endif
-    int fd;
-    char *ca_file;
-    int verify;
-    char *cert_file;
-    char *key_file;
-    int listen;
-} TLSContext;
-
-#define OFFSET(x) offsetof(TLSContext, x)
-#define D AV_OPT_FLAG_DECODING_PARAM
-#define E AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    {"ca_file",    "Certificate Authority database file", OFFSET(ca_file),   AV_OPT_TYPE_STRING, .flags = D|E },
-    {"tls_verify", "Verify the peer certificate",         OFFSET(verify),    AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = D|E },
-    {"cert_file",  "Certificate file",                    OFFSET(cert_file), AV_OPT_TYPE_STRING, .flags = D|E },
-    {"key_file",   "Private key file",                    OFFSET(key_file),  AV_OPT_TYPE_STRING, .flags = D|E },
-    {"listen",     "Listen for incoming connections",     OFFSET(listen),    AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = D|E },
-    { NULL }
-};
-
-static const AVClass tls_class = {
-    .class_name = "tls",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static int do_tls_poll(URLContext *h, int ret)
-{
-    TLSContext *c = h->priv_data;
-    struct pollfd p = { c->fd, 0, 0 };
-#if CONFIG_GNUTLS
-    switch (ret) {
-    case GNUTLS_E_AGAIN:
-    case GNUTLS_E_INTERRUPTED:
-        break;
-    case GNUTLS_E_WARNING_ALERT_RECEIVED:
-        av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));
-        break;
-    default:
-        av_log(h, AV_LOG_ERROR, "%s\n", gnutls_strerror(ret));
-        return AVERROR(EIO);
-    }
-    if (gnutls_record_get_direction(c->session))
-        p.events = POLLOUT;
-    else
-        p.events = POLLIN;
-#elif CONFIG_OPENSSL
-    ret = SSL_get_error(c->ssl, ret);
-    if (ret == SSL_ERROR_WANT_READ) {
-        p.events = POLLIN;
-    } else if (ret == SSL_ERROR_WANT_WRITE) {
-        p.events = POLLOUT;
-    } else {
-        av_log(h, AV_LOG_ERROR, "%s\n", ERR_error_string(ERR_get_error(), NULL));
-        return AVERROR(EIO);
-    }
-#endif
-    if (h->flags & AVIO_FLAG_NONBLOCK)
-        return AVERROR(EAGAIN);
-    while (1) {
-        int n = poll(&p, 1, 100);
-        if (n > 0)
-            break;
-        if (ff_check_interrupt(&h->interrupt_callback))
-            return AVERROR(EINTR);
-    }
-    return 0;
-}
-
-static int tls_open(URLContext *h, const char *uri, int flags)
-{
-    TLSContext *c = h->priv_data;
-    int ret;
-    int port;
-    char buf[200], host[200], opts[50] = "";
-    int numerichost = 0;
-    struct addrinfo hints = { 0 }, *ai = NULL;
-    const char *proxy_path;
-    int use_proxy;
-
-    ff_tls_init();
-
-    if (c->listen)
-        snprintf(opts, sizeof(opts), "?listen=1");
-
-    av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, NULL, 0, uri);
-    ff_url_join(buf, sizeof(buf), "tcp", NULL, host, port, "%s", opts);
-
-    hints.ai_flags = AI_NUMERICHOST;
-    if (!getaddrinfo(host, NULL, &hints, &ai)) {
-        numerichost = 1;
-        freeaddrinfo(ai);
-    }
-
-    proxy_path = getenv("http_proxy");
-    use_proxy = !ff_http_match_no_proxy(getenv("no_proxy"), host) &&
-                proxy_path != NULL && av_strstart(proxy_path, "http://", NULL);
-
-    if (use_proxy) {
-        char proxy_host[200], proxy_auth[200], dest[200];
-        int proxy_port;
-        av_url_split(NULL, 0, proxy_auth, sizeof(proxy_auth),
-                     proxy_host, sizeof(proxy_host), &proxy_port, NULL, 0,
-                     proxy_path);
-        ff_url_join(dest, sizeof(dest), NULL, NULL, host, port, NULL);
-        ff_url_join(buf, sizeof(buf), "httpproxy", proxy_auth, proxy_host,
-                    proxy_port, "/%s", dest);
-    }
-
-    ret = ffurl_open(&c->tcp, buf, AVIO_FLAG_READ_WRITE,
-                     &h->interrupt_callback, NULL);
-    if (ret)
-        goto fail;
-    c->fd = ffurl_get_file_handle(c->tcp);
-
-#if CONFIG_GNUTLS
-    gnutls_init(&c->session, c->listen ? GNUTLS_SERVER : GNUTLS_CLIENT);
-    if (!c->listen && !numerichost)
-        gnutls_server_name_set(c->session, GNUTLS_NAME_DNS, host, strlen(host));
-    gnutls_certificate_allocate_credentials(&c->cred);
-    if (c->ca_file)
-        gnutls_certificate_set_x509_trust_file(c->cred, c->ca_file, GNUTLS_X509_FMT_PEM);
-#if GNUTLS_VERSION_MAJOR >= 3
-    else
-        gnutls_certificate_set_x509_system_trust(c->cred);
-#endif
-    gnutls_certificate_set_verify_flags(c->cred, c->verify ?
-                                        GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT : 0);
-    if (c->cert_file && c->key_file) {
-        ret = gnutls_certificate_set_x509_key_file(c->cred,
-                                                   c->cert_file, c->key_file,
-                                                   GNUTLS_X509_FMT_PEM);
-        if (ret < 0) {
-            av_log(h, AV_LOG_ERROR,
-                   "Unable to set cert/key files %s and %s: %s\n",
-                   c->cert_file, c->key_file, gnutls_strerror(ret));
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-    }
-    gnutls_credentials_set(c->session, GNUTLS_CRD_CERTIFICATE, c->cred);
-    gnutls_transport_set_ptr(c->session, (gnutls_transport_ptr_t)
-                                         (intptr_t) c->fd);
-    gnutls_priority_set_direct(c->session, "NORMAL", NULL);
-    while (1) {
-        ret = gnutls_handshake(c->session);
-        if (ret == 0)
-            break;
-        if ((ret = do_tls_poll(h, ret)) < 0)
-            goto fail;
-    }
-    if (c->verify) {
-        unsigned int status, cert_list_size;
-        gnutls_x509_crt_t cert;
-        const gnutls_datum_t *cert_list;
-        if ((ret = gnutls_certificate_verify_peers2(c->session, &status)) < 0) {
-            av_log(h, AV_LOG_ERROR, "Unable to verify peer certificate: %s\n",
-                                    gnutls_strerror(ret));
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        if (status & GNUTLS_CERT_INVALID) {
-            av_log(h, AV_LOG_ERROR, "Peer certificate failed verification\n");
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        if (gnutls_certificate_type_get(c->session) != GNUTLS_CRT_X509) {
-            av_log(h, AV_LOG_ERROR, "Unsupported certificate type\n");
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        gnutls_x509_crt_init(&cert);
-        cert_list = gnutls_certificate_get_peers(c->session, &cert_list_size);
-        gnutls_x509_crt_import(cert, cert_list, GNUTLS_X509_FMT_DER);
-        ret = gnutls_x509_crt_check_hostname(cert, host);
-        gnutls_x509_crt_deinit(cert);
-        if (!ret) {
-            av_log(h, AV_LOG_ERROR,
-                   "The certificate's owner does not match hostname %s\n", host);
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-    }
-#elif CONFIG_OPENSSL
-    c->ctx = SSL_CTX_new(c->listen ? TLSv1_server_method() : TLSv1_client_method());
-    if (!c->ctx) {
-        av_log(h, AV_LOG_ERROR, "%s\n", ERR_error_string(ERR_get_error(), NULL));
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-    if (c->ca_file)
-        SSL_CTX_load_verify_locations(c->ctx, c->ca_file, NULL);
-    if (c->cert_file && !SSL_CTX_use_certificate_chain_file(c->ctx, c->cert_file)) {
-        av_log(h, AV_LOG_ERROR, "Unable to load cert file %s: %s\n",
-               c->cert_file, ERR_error_string(ERR_get_error(), NULL));
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-    if (c->key_file && !SSL_CTX_use_PrivateKey_file(c->ctx, c->key_file, SSL_FILETYPE_PEM)) {
-        av_log(h, AV_LOG_ERROR, "Unable to load key file %s: %s\n",
-               c->key_file, ERR_error_string(ERR_get_error(), NULL));
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-    // Note, this doesn't check that the peer certificate actually matches
-    // the requested hostname.
-    if (c->verify)
-        SSL_CTX_set_verify(c->ctx, SSL_VERIFY_PEER, NULL);
-    c->ssl = SSL_new(c->ctx);
-    if (!c->ssl) {
-        av_log(h, AV_LOG_ERROR, "%s\n", ERR_error_string(ERR_get_error(), NULL));
-        ret = AVERROR(EIO);
-        goto fail;
-    }
-    SSL_set_fd(c->ssl, c->fd);
-    if (!c->listen && !numerichost)
-        SSL_set_tlsext_host_name(c->ssl, host);
-    while (1) {
-        ret = c->listen ? SSL_accept(c->ssl) : SSL_connect(c->ssl);
-        if (ret > 0)
-            break;
-        if (ret == 0) {
-            av_log(h, AV_LOG_ERROR, "Unable to negotiate TLS/SSL session\n");
-            ret = AVERROR(EIO);
-            goto fail;
-        }
-        if ((ret = do_tls_poll(h, ret)) < 0)
-            goto fail;
-    }
-#endif
-    return 0;
-fail:
-    TLS_free(c);
-    if (c->tcp)
-        ffurl_close(c->tcp);
-    ff_tls_deinit();
-    return ret;
-}
-
-static int tls_read(URLContext *h, uint8_t *buf, int size)
-{
-    TLSContext *c = h->priv_data;
-    while (1) {
-        int ret = TLS_read(c, buf, size);
-        if (ret > 0)
-            return ret;
-        if (ret == 0)
-            return AVERROR_EOF;
-        if ((ret = do_tls_poll(h, ret)) < 0)
-            return ret;
-    }
-    return 0;
-}
-
-static int tls_write(URLContext *h, const uint8_t *buf, int size)
-{
-    TLSContext *c = h->priv_data;
-    while (1) {
-        int ret = TLS_write(c, buf, size);
-        if (ret > 0)
-            return ret;
-        if (ret == 0)
-            return AVERROR_EOF;
-        if ((ret = do_tls_poll(h, ret)) < 0)
-            return ret;
-    }
-    return 0;
-}
-
-static int tls_close(URLContext *h)
-{
-    TLSContext *c = h->priv_data;
-    TLS_shutdown(c);
-    TLS_free(c);
-    ffurl_close(c->tcp);
-    ff_tls_deinit();
-    return 0;
-}
-
-URLProtocol ff_tls_protocol = {
-    .name           = "tls",
-    .url_open       = tls_open,
-    .url_read       = tls_read,
-    .url_write      = tls_write,
-    .url_close      = tls_close,
-    .priv_data_size = sizeof(TLSContext),
-    .flags          = URL_PROTOCOL_FLAG_NETWORK,
-    .priv_data_class = &tls_class,
-};
diff --git a/deps/libav/libavformat/tmv.c b/deps/libav/libavformat/tmv.c
deleted file mode 100644
index 103ac4a..0000000
--- a/deps/libav/libavformat/tmv.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * 8088flex TMV file demuxer
- * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * 8088flex TMV file demuxer
- * @author Daniel Verkamp
- * @see http://www.oldskool.org/pc/8088_Corruption
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-enum {
-    TMV_PADDING = 0x01,
-    TMV_STEREO  = 0x02,
-};
-
-#define TMV_TAG MKTAG('T', 'M', 'A', 'V')
-
-typedef struct TMVContext {
-    unsigned audio_chunk_size;
-    unsigned video_chunk_size;
-    unsigned padding;
-    unsigned stream_index;
-} TMVContext;
-
-#define TMV_HEADER_SIZE       12
-
-#define PROBE_MIN_SAMPLE_RATE 5000
-#define PROBE_MAX_FPS         120
-#define PROBE_MIN_AUDIO_SIZE  (PROBE_MIN_SAMPLE_RATE / PROBE_MAX_FPS)
-
-static int tmv_probe(AVProbeData *p)
-{
-    if (AV_RL32(p->buf)   == TMV_TAG &&
-        AV_RL16(p->buf+4) >= PROBE_MIN_SAMPLE_RATE &&
-        AV_RL16(p->buf+6) >= PROBE_MIN_AUDIO_SIZE  &&
-               !p->buf[8] && // compression method
-                p->buf[9] && // char cols
-                p->buf[10])  // char rows
-        return AVPROBE_SCORE_MAX /
-            ((p->buf[9] == 40 && p->buf[10] == 25) ? 1 : 4);
-    return 0;
-}
-
-static int tmv_read_header(AVFormatContext *s)
-{
-    TMVContext *tmv   = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *vst, *ast;
-    AVRational fps;
-    unsigned comp_method, char_cols, char_rows, features;
-
-    if (avio_rl32(pb) != TMV_TAG)
-        return -1;
-
-    if (!(vst = avformat_new_stream(s, NULL)))
-        return AVERROR(ENOMEM);
-
-    if (!(ast = avformat_new_stream(s, NULL)))
-        return AVERROR(ENOMEM);
-
-    ast->codec->sample_rate = avio_rl16(pb);
-    if (!ast->codec->sample_rate) {
-        av_log(s, AV_LOG_ERROR, "invalid sample rate\n");
-        return -1;
-    }
-
-    tmv->audio_chunk_size   = avio_rl16(pb);
-    if (!tmv->audio_chunk_size) {
-        av_log(s, AV_LOG_ERROR, "invalid audio chunk size\n");
-        return -1;
-    }
-
-    comp_method             = avio_r8(pb);
-    if (comp_method) {
-        av_log(s, AV_LOG_ERROR, "unsupported compression method %d\n",
-               comp_method);
-        return -1;
-    }
-
-    char_cols = avio_r8(pb);
-    char_rows = avio_r8(pb);
-    tmv->video_chunk_size = char_cols * char_rows * 2;
-
-    features  = avio_r8(pb);
-    if (features & ~(TMV_PADDING | TMV_STEREO)) {
-        av_log(s, AV_LOG_ERROR, "unsupported features 0x%02x\n",
-               features & ~(TMV_PADDING | TMV_STEREO));
-        return -1;
-    }
-
-    ast->codec->codec_type            = AVMEDIA_TYPE_AUDIO;
-    ast->codec->codec_id              = AV_CODEC_ID_PCM_U8;
-    if (features & TMV_STEREO) {
-        ast->codec->channels       = 2;
-        ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-    } else {
-        ast->codec->channels       = 1;
-        ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    }
-    ast->codec->bits_per_coded_sample = 8;
-    ast->codec->bit_rate              = ast->codec->sample_rate *
-                                        ast->codec->bits_per_coded_sample;
-    avpriv_set_pts_info(ast, 32, 1, ast->codec->sample_rate);
-
-    fps.num = ast->codec->sample_rate * ast->codec->channels;
-    fps.den = tmv->audio_chunk_size;
-    av_reduce(&fps.num, &fps.den, fps.num, fps.den, 0xFFFFFFFFLL);
-
-    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_id   = AV_CODEC_ID_TMV;
-    vst->codec->pix_fmt    = AV_PIX_FMT_PAL8;
-    vst->codec->width      = char_cols * 8;
-    vst->codec->height     = char_rows * 8;
-    avpriv_set_pts_info(vst, 32, fps.den, fps.num);
-
-    if (features & TMV_PADDING)
-        tmv->padding =
-            ((tmv->video_chunk_size + tmv->audio_chunk_size + 511) & ~511) -
-             (tmv->video_chunk_size + tmv->audio_chunk_size);
-
-    vst->codec->bit_rate = ((tmv->video_chunk_size + tmv->padding) *
-                            fps.num * 8) / fps.den;
-
-    return 0;
-}
-
-static int tmv_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    TMVContext *tmv   = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret, pkt_size = tmv->stream_index ?
-                        tmv->audio_chunk_size : tmv->video_chunk_size;
-
-    if (pb->eof_reached)
-        return AVERROR_EOF;
-
-    ret = av_get_packet(pb, pkt, pkt_size);
-
-    if (tmv->stream_index)
-        avio_skip(pb, tmv->padding);
-
-    pkt->stream_index  = tmv->stream_index;
-    tmv->stream_index ^= 1;
-    pkt->flags        |= AV_PKT_FLAG_KEY;
-
-    return ret;
-}
-
-static int tmv_read_seek(AVFormatContext *s, int stream_index,
-                         int64_t timestamp, int flags)
-{
-    TMVContext *tmv = s->priv_data;
-    int64_t pos;
-
-    if (stream_index)
-        return -1;
-
-    pos = timestamp *
-          (tmv->audio_chunk_size + tmv->video_chunk_size + tmv->padding);
-
-    if (avio_seek(s->pb, pos + TMV_HEADER_SIZE, SEEK_SET) < 0)
-        return -1;
-    tmv->stream_index = 0;
-    return 0;
-}
-
-AVInputFormat ff_tmv_demuxer = {
-    .name           = "tmv",
-    .long_name      = NULL_IF_CONFIG_SMALL("8088flex TMV"),
-    .priv_data_size = sizeof(TMVContext),
-    .read_probe     = tmv_probe,
-    .read_header    = tmv_read_header,
-    .read_packet    = tmv_read_packet,
-    .read_seek      = tmv_read_seek,
-    .flags          = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/tta.c b/deps/libav/libavformat/tta.c
deleted file mode 100644
index e5e6e71..0000000
--- a/deps/libav/libavformat/tta.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * TTA demuxer
- * Copyright (c) 2006 Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavcodec/get_bits.h"
-#include "avformat.h"
-#include "internal.h"
-#include "id3v1.h"
-#include "libavutil/dict.h"
-
-typedef struct {
-    int totalframes, currentframe;
-    int frame_size;
-    int last_frame_size;
-} TTAContext;
-
-static int tta_probe(AVProbeData *p)
-{
-    const uint8_t *d = p->buf;
-
-    if (d[0] == 'T' && d[1] == 'T' && d[2] == 'A' && d[3] == '1')
-        return AVPROBE_SCORE_EXTENSION + 30;
-    return 0;
-}
-
-static int tta_read_header(AVFormatContext *s)
-{
-    TTAContext *c = s->priv_data;
-    AVStream *st;
-    int i, channels, bps, samplerate, datalen;
-    uint64_t framepos, start_offset;
-
-    if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
-        ff_id3v1_read(s);
-
-    start_offset = avio_tell(s->pb);
-    if (avio_rl32(s->pb) != AV_RL32("TTA1"))
-        return -1; // not tta file
-
-    avio_skip(s->pb, 2); // FIXME: flags
-    channels = avio_rl16(s->pb);
-    bps = avio_rl16(s->pb);
-    samplerate = avio_rl32(s->pb);
-    if(samplerate <= 0 || samplerate > 1000000){
-        av_log(s, AV_LOG_ERROR, "nonsense samplerate\n");
-        return -1;
-    }
-
-    datalen = avio_rl32(s->pb);
-    if(datalen < 0){
-        av_log(s, AV_LOG_ERROR, "nonsense datalen\n");
-        return -1;
-    }
-
-    avio_skip(s->pb, 4); // header crc
-
-    c->frame_size      = samplerate * 256 / 245;
-    c->last_frame_size = datalen % c->frame_size;
-    if (!c->last_frame_size)
-        c->last_frame_size = c->frame_size;
-    c->totalframes = datalen / c->frame_size + (c->last_frame_size < c->frame_size);
-    c->currentframe = 0;
-
-    if(c->totalframes >= UINT_MAX/sizeof(uint32_t)){
-        av_log(s, AV_LOG_ERROR, "totalframes too large\n");
-        return -1;
-    }
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    avpriv_set_pts_info(st, 64, 1, samplerate);
-    st->start_time = 0;
-    st->duration = datalen;
-
-    framepos = avio_tell(s->pb) + 4*c->totalframes + 4;
-
-    for (i = 0; i < c->totalframes; i++) {
-        uint32_t size = avio_rl32(s->pb);
-        av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
-                           AVINDEX_KEYFRAME);
-        framepos += size;
-    }
-    avio_skip(s->pb, 4); // seektable crc
-
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_TTA;
-    st->codec->channels = channels;
-    st->codec->sample_rate = samplerate;
-    st->codec->bits_per_coded_sample = bps;
-
-    st->codec->extradata_size = avio_tell(s->pb) - start_offset;
-    if(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){
-        //this check is redundant as avio_read should fail
-        av_log(s, AV_LOG_ERROR, "extradata_size too large\n");
-        return -1;
-    }
-    st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata) {
-        st->codec->extradata_size = 0;
-        return AVERROR(ENOMEM);
-    }
-    avio_seek(s->pb, start_offset, SEEK_SET);
-    avio_read(s->pb, st->codec->extradata, st->codec->extradata_size);
-
-    return 0;
-}
-
-static int tta_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    TTAContext *c = s->priv_data;
-    AVStream *st = s->streams[0];
-    int size, ret;
-
-    // FIXME!
-    if (c->currentframe >= c->totalframes)
-        return AVERROR_EOF;
-
-    size = st->index_entries[c->currentframe].size;
-
-    ret = av_get_packet(s->pb, pkt, size);
-    pkt->dts = st->index_entries[c->currentframe++].timestamp;
-    pkt->duration = c->currentframe == c->totalframes ? c->last_frame_size :
-                                                        c->frame_size;
-    return ret;
-}
-
-static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
-{
-    TTAContext *c = s->priv_data;
-    AVStream *st = s->streams[stream_index];
-    int index = av_index_search_timestamp(st, timestamp, flags);
-    if (index < 0)
-        return -1;
-    if (avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET) < 0)
-        return -1;
-
-    c->currentframe = index;
-
-    return 0;
-}
-
-AVInputFormat ff_tta_demuxer = {
-    .name           = "tta",
-    .long_name      = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
-    .priv_data_size = sizeof(TTAContext),
-    .read_probe     = tta_probe,
-    .read_header    = tta_read_header,
-    .read_packet    = tta_read_packet,
-    .read_seek      = tta_read_seek,
-    .extensions     = "tta",
-};
diff --git a/deps/libav/libavformat/tty.c b/deps/libav/libavformat/tty.c
deleted file mode 100644
index 0ae1510..0000000
--- a/deps/libav/libavformat/tty.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Tele-typewriter demuxer
- * Copyright (c) 2010 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Tele-typewriter demuxer
- */
-
-#include "libavutil/intreadwrite.h"
-#include "libavutil/avstring.h"
-#include "libavutil/log.h"
-#include "libavutil/dict.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "avformat.h"
-#include "internal.h"
-#include "sauce.h"
-
-typedef struct {
-    AVClass *class;
-    int chars_per_frame;
-    uint64_t fsize;  /**< file size less metadata buffer */
-    char *video_size;/**< A string describing video size, set by a private option. */
-    char *framerate; /**< Set by a private option. */
-} TtyDemuxContext;
-
-/**
- * Parse EFI header
- */
-static int efi_read(AVFormatContext *avctx, uint64_t start_pos)
-{
-    TtyDemuxContext *s = avctx->priv_data;
-    AVIOContext *pb = avctx->pb;
-    char buf[37];
-    int len;
-
-    avio_seek(pb, start_pos, SEEK_SET);
-    if (avio_r8(pb) != 0x1A)
-        return -1;
-
-#define GET_EFI_META(name,size) \
-    len = avio_r8(pb); \
-    if (len < 1 || len > size) \
-        return -1; \
-    if (avio_read(pb, buf, size) == size) { \
-        buf[len] = 0; \
-        av_dict_set(&avctx->metadata, name, buf, 0); \
-    }
-
-    GET_EFI_META("filename", 12)
-    GET_EFI_META("title",    36)
-
-    s->fsize = start_pos;
-    return 0;
-}
-
-static int read_header(AVFormatContext *avctx)
-{
-    TtyDemuxContext *s = avctx->priv_data;
-    int width = 0, height = 0, ret = 0;
-    AVStream *st = avformat_new_stream(avctx, NULL);
-    AVRational framerate;
-
-    if (!st) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-    st->codec->codec_tag   = 0;
-    st->codec->codec_type  = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id    = AV_CODEC_ID_ANSI;
-
-    if (s->video_size && (ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
-        av_log (avctx, AV_LOG_ERROR, "Couldn't parse video size.\n");
-        goto fail;
-    }
-    if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate);
-        goto fail;
-    }
-    st->codec->width  = width;
-    st->codec->height = height;
-    avpriv_set_pts_info(st, 60, framerate.den, framerate.num);
-    st->avg_frame_rate = framerate;
-
-    /* simulate tty display speed */
-    s->chars_per_frame = FFMAX(av_q2d(st->time_base)*s->chars_per_frame, 1);
-
-    if (avctx->pb->seekable) {
-        s->fsize = avio_size(avctx->pb);
-        st->duration = (s->fsize + s->chars_per_frame - 1) / s->chars_per_frame;
-
-        if (ff_sauce_read(avctx, &s->fsize, 0, 0) < 0)
-            efi_read(avctx, s->fsize - 51);
-
-        avio_seek(avctx->pb, 0, SEEK_SET);
-    }
-
-fail:
-    return ret;
-}
-
-static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
-{
-    TtyDemuxContext *s = avctx->priv_data;
-    int n;
-
-    if (avctx->pb->eof_reached)
-        return AVERROR_EOF;
-
-    n = s->chars_per_frame;
-    if (s->fsize) {
-        // ignore metadata buffer
-        uint64_t p = avio_tell(avctx->pb);
-        if (p + s->chars_per_frame > s->fsize)
-            n = s->fsize - p;
-    }
-
-    pkt->size = av_get_packet(avctx->pb, pkt, n);
-    if (pkt->size <= 0)
-        return AVERROR(EIO);
-    pkt->flags |= AV_PKT_FLAG_KEY;
-    return 0;
-}
-
-#define OFFSET(x) offsetof(TtyDemuxContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
-    { "chars_per_frame", "", offsetof(TtyDemuxContext, chars_per_frame), AV_OPT_TYPE_INT, {.i64 = 6000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM},
-    { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
-    { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
-    { NULL },
-};
-
-static const AVClass tty_demuxer_class = {
-    .class_name     = "TTY demuxer",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
-};
-
-AVInputFormat ff_tty_demuxer = {
-    .name           = "tty",
-    .long_name      = NULL_IF_CONFIG_SMALL("Tele-typewriter"),
-    .priv_data_size = sizeof(TtyDemuxContext),
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .extensions     = "ans,art,asc,diz,ice,nfo,txt,vt",
-    .priv_class     = &tty_demuxer_class,
-};
diff --git a/deps/libav/libavformat/txd.c b/deps/libav/libavformat/txd.c
deleted file mode 100644
index 5897881..0000000
--- a/deps/libav/libavformat/txd.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Renderware TeXture Dictionary (.txd) demuxer
- * Copyright (c) 2007 Ivo van Poorten
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-
-#define TXD_FILE            0x16
-#define TXD_INFO            0x01
-#define TXD_EXTRA           0x03
-#define TXD_TEXTURE         0x15
-#define TXD_TEXTURE_DATA    0x01
-#define TXD_MARKER          0x1803ffff
-#define TXD_MARKER2         0x1003ffff
-
-static int txd_probe(AVProbeData * pd) {
-    if (AV_RL32(pd->buf  ) == TXD_FILE &&
-       (AV_RL32(pd->buf+8) == TXD_MARKER || AV_RL32(pd->buf+8) == TXD_MARKER2))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int txd_read_header(AVFormatContext *s) {
-    AVStream *st;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_TXD;
-    st->codec->time_base.den = 5;
-    st->codec->time_base.num = 1;
-    /* the parameters will be extracted from the compressed bitstream */
-    return 0;
-}
-
-static int txd_read_packet(AVFormatContext *s, AVPacket *pkt) {
-    AVIOContext *pb = s->pb;
-    unsigned int id, chunk_size, marker;
-    int ret;
-
-next_chunk:
-    id         = avio_rl32(pb);
-    chunk_size = avio_rl32(pb);
-    marker     = avio_rl32(pb);
-
-    if (s->pb->eof_reached)
-        return AVERROR_EOF;
-    if (marker != TXD_MARKER && marker != TXD_MARKER2) {
-        av_log(s, AV_LOG_ERROR, "marker does not match\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    switch (id) {
-        case TXD_INFO:
-            if (chunk_size > 100)
-                break;
-        case TXD_EXTRA:
-            avio_skip(s->pb, chunk_size);
-        case TXD_FILE:
-        case TXD_TEXTURE:
-            goto next_chunk;
-        default:
-            av_log(s, AV_LOG_ERROR, "unknown chunk id %i\n", id);
-            return AVERROR_INVALIDDATA;
-    }
-
-    ret = av_get_packet(s->pb, pkt, chunk_size);
-    if (ret < 0)
-        return ret;
-    pkt->stream_index = 0;
-
-    return 0;
-}
-
-AVInputFormat ff_txd_demuxer = {
-    .name        = "txd",
-    .long_name   = NULL_IF_CONFIG_SMALL("Renderware TeXture Dictionary"),
-    .read_probe  = txd_probe,
-    .read_header = txd_read_header,
-    .read_packet = txd_read_packet,
-};
diff --git a/deps/libav/libavformat/udp.c b/deps/libav/libavformat/udp.c
deleted file mode 100644
index bfa8cf2..0000000
--- a/deps/libav/libavformat/udp.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * UDP prototype streaming system
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * UDP protocol
- */
-
-#define _BSD_SOURCE     /* Needed for using struct ip_mreq with recent glibc */
-
-#include "avformat.h"
-#include "avio_internal.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/avstring.h"
-#include "internal.h"
-#include "network.h"
-#include "os_support.h"
-#include "url.h"
-
-#ifndef IPV6_ADD_MEMBERSHIP
-#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
-#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
-#endif
-
-typedef struct {
-    int udp_fd;
-    int ttl;
-    int buffer_size;
-    int is_multicast;
-    int local_port;
-    int reuse_socket;
-    struct sockaddr_storage dest_addr;
-    int dest_addr_len;
-    int is_connected;
-} UDPContext;
-
-#define UDP_TX_BUF_SIZE 32768
-#define UDP_MAX_PKT_SIZE 65536
-
-static void log_net_error(void *ctx, int level, const char* prefix)
-{
-    char errbuf[100];
-    av_strerror(ff_neterrno(), errbuf, sizeof(errbuf));
-    av_log(ctx, level, "%s: %s\n", prefix, errbuf);
-}
-
-static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
-                                 struct sockaddr *addr)
-{
-#ifdef IP_MULTICAST_TTL
-    if (addr->sa_family == AF_INET) {
-        if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, sizeof(mcastTTL)) < 0) {
-            log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IP_MULTICAST_TTL)");
-            return -1;
-        }
-    }
-#endif
-#if defined(IPPROTO_IPV6) && defined(IPV6_MULTICAST_HOPS)
-    if (addr->sa_family == AF_INET6) {
-        if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &mcastTTL, sizeof(mcastTTL)) < 0) {
-            log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IPV6_MULTICAST_HOPS)");
-            return -1;
-        }
-    }
-#endif
-    return 0;
-}
-
-static int udp_join_multicast_group(int sockfd, struct sockaddr *addr)
-{
-#ifdef IP_ADD_MEMBERSHIP
-    if (addr->sa_family == AF_INET) {
-        struct ip_mreq mreq;
-
-        mreq.imr_multiaddr.s_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
-        mreq.imr_interface.s_addr= INADDR_ANY;
-        if (setsockopt(sockfd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const void *)&mreq, sizeof(mreq)) < 0) {
-            log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IP_ADD_MEMBERSHIP)");
-            return -1;
-        }
-    }
-#endif
-#if HAVE_STRUCT_IPV6_MREQ && defined(IPPROTO_IPV6)
-    if (addr->sa_family == AF_INET6) {
-        struct ipv6_mreq mreq6;
-
-        memcpy(&mreq6.ipv6mr_multiaddr, &(((struct sockaddr_in6 *)addr)->sin6_addr), sizeof(struct in6_addr));
-        mreq6.ipv6mr_interface= 0;
-        if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq6, sizeof(mreq6)) < 0) {
-            log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IPV6_ADD_MEMBERSHIP)");
-            return -1;
-        }
-    }
-#endif
-    return 0;
-}
-
-static int udp_leave_multicast_group(int sockfd, struct sockaddr *addr)
-{
-#ifdef IP_DROP_MEMBERSHIP
-    if (addr->sa_family == AF_INET) {
-        struct ip_mreq mreq;
-
-        mreq.imr_multiaddr.s_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
-        mreq.imr_interface.s_addr= INADDR_ANY;
-        if (setsockopt(sockfd, IPPROTO_IP, IP_DROP_MEMBERSHIP, (const void *)&mreq, sizeof(mreq)) < 0) {
-            log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IP_DROP_MEMBERSHIP)");
-            return -1;
-        }
-    }
-#endif
-#if HAVE_STRUCT_IPV6_MREQ && defined(IPPROTO_IPV6)
-    if (addr->sa_family == AF_INET6) {
-        struct ipv6_mreq mreq6;
-
-        memcpy(&mreq6.ipv6mr_multiaddr, &(((struct sockaddr_in6 *)addr)->sin6_addr), sizeof(struct in6_addr));
-        mreq6.ipv6mr_interface= 0;
-        if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, &mreq6, sizeof(mreq6)) < 0) {
-            log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IPV6_DROP_MEMBERSHIP)");
-            return -1;
-        }
-    }
-#endif
-    return 0;
-}
-
-static struct addrinfo* udp_resolve_host(const char *hostname, int port,
-                                         int type, int family, int flags)
-{
-    struct addrinfo hints = { 0 }, *res = 0;
-    int error;
-    char sport[16];
-    const char *node = 0, *service = "0";
-
-    if (port > 0) {
-        snprintf(sport, sizeof(sport), "%d", port);
-        service = sport;
-    }
-    if ((hostname) && (hostname[0] != '\0') && (hostname[0] != '?')) {
-        node = hostname;
-    }
-    hints.ai_socktype = type;
-    hints.ai_family   = family;
-    hints.ai_flags = flags;
-    if ((error = getaddrinfo(node, service, &hints, &res))) {
-        res = NULL;
-        av_log(NULL, AV_LOG_ERROR, "udp_resolve_host: %s\n", gai_strerror(error));
-    }
-
-    return res;
-}
-
-static int udp_set_multicast_sources(int sockfd, struct sockaddr *addr,
-                                     int addr_len, char **sources,
-                                     int nb_sources, int include)
-{
-#if HAVE_STRUCT_GROUP_SOURCE_REQ && defined(MCAST_BLOCK_SOURCE) && !defined(_WIN32)
-    /* These ones are available in the microsoft SDK, but don't seem to work
-     * as on linux, so just prefer the v4-only approach there for now. */
-    int i;
-    for (i = 0; i < nb_sources; i++) {
-        struct group_source_req mreqs;
-        int level = addr->sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
-        struct addrinfo *sourceaddr = udp_resolve_host(sources[i], 0,
-                                                       SOCK_DGRAM, AF_UNSPEC,
-                                                       0);
-        if (!sourceaddr)
-            return AVERROR(ENOENT);
-
-        mreqs.gsr_interface = 0;
-        memcpy(&mreqs.gsr_group, addr, addr_len);
-        memcpy(&mreqs.gsr_source, sourceaddr->ai_addr, sourceaddr->ai_addrlen);
-        freeaddrinfo(sourceaddr);
-
-        if (setsockopt(sockfd, level,
-                       include ? MCAST_JOIN_SOURCE_GROUP : MCAST_BLOCK_SOURCE,
-                       (const void *)&mreqs, sizeof(mreqs)) < 0) {
-            if (include)
-                log_net_error(NULL, AV_LOG_ERROR, "setsockopt(MCAST_JOIN_SOURCE_GROUP)");
-            else
-                log_net_error(NULL, AV_LOG_ERROR, "setsockopt(MCAST_BLOCK_SOURCE)");
-            return ff_neterrno();
-        }
-    }
-#elif HAVE_STRUCT_IP_MREQ_SOURCE && defined(IP_BLOCK_SOURCE)
-    int i;
-    if (addr->sa_family != AF_INET) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Setting multicast sources only supported for IPv4\n");
-        return AVERROR(EINVAL);
-    }
-    for (i = 0; i < nb_sources; i++) {
-        struct ip_mreq_source mreqs;
-        struct addrinfo *sourceaddr = udp_resolve_host(sources[i], 0,
-                                                       SOCK_DGRAM, AF_UNSPEC,
-                                                       0);
-        if (!sourceaddr)
-            return AVERROR(ENOENT);
-        if (sourceaddr->ai_addr->sa_family != AF_INET) {
-            freeaddrinfo(sourceaddr);
-            av_log(NULL, AV_LOG_ERROR, "%s is of incorrect protocol family\n",
-                   sources[i]);
-            return AVERROR(EINVAL);
-        }
-
-        mreqs.imr_multiaddr.s_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
-        mreqs.imr_interface.s_addr = INADDR_ANY;
-        mreqs.imr_sourceaddr.s_addr = ((struct sockaddr_in *)sourceaddr->ai_addr)->sin_addr.s_addr;
-        freeaddrinfo(sourceaddr);
-
-        if (setsockopt(sockfd, IPPROTO_IP,
-                       include ? IP_ADD_SOURCE_MEMBERSHIP : IP_BLOCK_SOURCE,
-                       (const void *)&mreqs, sizeof(mreqs)) < 0) {
-            if (include)
-                log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IP_ADD_SOURCE_MEMBERSHIP)");
-            else
-                log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IP_BLOCK_SOURCE)");
-            return ff_neterrno();
-        }
-    }
-#else
-    return AVERROR(ENOSYS);
-#endif
-    return 0;
-}
-static int udp_set_url(struct sockaddr_storage *addr,
-                       const char *hostname, int port)
-{
-    struct addrinfo *res0;
-    int addr_len;
-
-    res0 = udp_resolve_host(hostname, port, SOCK_DGRAM, AF_UNSPEC, 0);
-    if (res0 == 0) return AVERROR(EIO);
-    memcpy(addr, res0->ai_addr, res0->ai_addrlen);
-    addr_len = res0->ai_addrlen;
-    freeaddrinfo(res0);
-
-    return addr_len;
-}
-
-static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr,
-                             socklen_t *addr_len, const char *localaddr)
-{
-    int udp_fd = -1;
-    struct addrinfo *res0 = NULL, *res = NULL;
-    int family = AF_UNSPEC;
-
-    if (((struct sockaddr *) &s->dest_addr)->sa_family)
-        family = ((struct sockaddr *) &s->dest_addr)->sa_family;
-    res0 = udp_resolve_host(localaddr[0] ? localaddr : NULL, s->local_port,
-                            SOCK_DGRAM, family, AI_PASSIVE);
-    if (res0 == 0)
-        goto fail;
-    for (res = res0; res; res=res->ai_next) {
-        udp_fd = ff_socket(res->ai_family, SOCK_DGRAM, 0);
-        if (udp_fd != -1) break;
-        log_net_error(NULL, AV_LOG_ERROR, "socket");
-    }
-
-    if (udp_fd < 0)
-        goto fail;
-
-    memcpy(addr, res->ai_addr, res->ai_addrlen);
-    *addr_len = res->ai_addrlen;
-
-    freeaddrinfo(res0);
-
-    return udp_fd;
-
- fail:
-    if (udp_fd >= 0)
-        closesocket(udp_fd);
-    if(res0)
-        freeaddrinfo(res0);
-    return -1;
-}
-
-static int udp_port(struct sockaddr_storage *addr, int addr_len)
-{
-    char sbuf[sizeof(int)*3+1];
-    int error;
-
-    if ((error = getnameinfo((struct sockaddr *)addr, addr_len, NULL, 0,  sbuf, sizeof(sbuf), NI_NUMERICSERV)) != 0) {
-        av_log(NULL, AV_LOG_ERROR, "getnameinfo: %s\n", gai_strerror(error));
-        return -1;
-    }
-
-    return strtol(sbuf, NULL, 10);
-}
-
-
-/**
- * If no filename is given to av_open_input_file because you want to
- * get the local port first, then you must call this function to set
- * the remote server address.
- *
- * url syntax: udp://host:port[?option=val...]
- * option: 'ttl=n'       : set the ttl value (for multicast only)
- *         'localport=n' : set the local port
- *         'pkt_size=n'  : set max packet size
- *         'reuse=1'     : enable reusing the socket
- *
- * @param h media file context
- * @param uri of the remote server
- * @return zero if no error.
- */
-int ff_udp_set_remote_url(URLContext *h, const char *uri)
-{
-    UDPContext *s = h->priv_data;
-    char hostname[256], buf[10];
-    int port;
-    const char *p;
-
-    av_url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port, NULL, 0, uri);
-
-    /* set the destination address */
-    s->dest_addr_len = udp_set_url(&s->dest_addr, hostname, port);
-    if (s->dest_addr_len < 0) {
-        return AVERROR(EIO);
-    }
-    s->is_multicast = ff_is_multicast_address((struct sockaddr*) &s->dest_addr);
-    p = strchr(uri, '?');
-    if (p) {
-        if (av_find_info_tag(buf, sizeof(buf), "connect", p)) {
-            int was_connected = s->is_connected;
-            s->is_connected = strtol(buf, NULL, 10);
-            if (s->is_connected && !was_connected) {
-                if (connect(s->udp_fd, (struct sockaddr *) &s->dest_addr,
-                            s->dest_addr_len)) {
-                    s->is_connected = 0;
-                    log_net_error(h, AV_LOG_ERROR, "connect");
-                    return AVERROR(EIO);
-                }
-            }
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Return the local port used by the UDP connection
- * @param h media file context
- * @return the local port number
- */
-int ff_udp_get_local_port(URLContext *h)
-{
-    UDPContext *s = h->priv_data;
-    return s->local_port;
-}
-
-/**
- * Return the udp file handle for select() usage to wait for several RTP
- * streams at the same time.
- * @param h media file context
- */
-static int udp_get_file_handle(URLContext *h)
-{
-    UDPContext *s = h->priv_data;
-    return s->udp_fd;
-}
-
-static int parse_source_list(char *buf, char **sources, int *num_sources,
-                             int max_sources)
-{
-    char *source_start;
-
-    source_start = buf;
-    while (1) {
-        char *next = strchr(source_start, ',');
-        if (next)
-            *next = '\0';
-        sources[*num_sources] = av_strdup(source_start);
-        if (!sources[*num_sources])
-            return AVERROR(ENOMEM);
-        source_start = next + 1;
-        (*num_sources)++;
-        if (*num_sources >= max_sources || !next)
-            break;
-    }
-    return 0;
-}
-
-/* put it in UDP context */
-/* return non zero if error */
-static int udp_open(URLContext *h, const char *uri, int flags)
-{
-    char hostname[1024], localaddr[1024] = "";
-    int port, udp_fd = -1, tmp, bind_ret = -1;
-    UDPContext *s = h->priv_data;
-    int is_output;
-    const char *p;
-    char buf[256];
-    struct sockaddr_storage my_addr;
-    socklen_t len;
-    int reuse_specified = 0;
-    int i, num_include_sources = 0, num_exclude_sources = 0;
-    char *include_sources[32], *exclude_sources[32];
-
-    h->is_streamed = 1;
-    h->max_packet_size = 1472;
-
-    is_output = !(flags & AVIO_FLAG_READ);
-
-    s->ttl = 16;
-    s->buffer_size = is_output ? UDP_TX_BUF_SIZE : UDP_MAX_PKT_SIZE;
-
-    p = strchr(uri, '?');
-    if (p) {
-        if (av_find_info_tag(buf, sizeof(buf), "reuse", p)) {
-            char *endptr = NULL;
-            s->reuse_socket = strtol(buf, &endptr, 10);
-            /* assume if no digits were found it is a request to enable it */
-            if (buf == endptr)
-                s->reuse_socket = 1;
-            reuse_specified = 1;
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "ttl", p)) {
-            s->ttl = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "localport", p)) {
-            s->local_port = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "pkt_size", p)) {
-            h->max_packet_size = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "buffer_size", p)) {
-            s->buffer_size = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "connect", p)) {
-            s->is_connected = strtol(buf, NULL, 10);
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "localaddr", p)) {
-            av_strlcpy(localaddr, buf, sizeof(localaddr));
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "sources", p)) {
-            if (parse_source_list(buf, include_sources, &num_include_sources,
-                                  FF_ARRAY_ELEMS(include_sources)))
-                goto fail;
-        }
-        if (av_find_info_tag(buf, sizeof(buf), "block", p)) {
-            if (parse_source_list(buf, exclude_sources, &num_exclude_sources,
-                                  FF_ARRAY_ELEMS(exclude_sources)))
-                goto fail;
-        }
-    }
-
-    /* fill the dest addr */
-    av_url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port, NULL, 0, uri);
-
-    /* XXX: fix av_url_split */
-    if (hostname[0] == '\0' || hostname[0] == '?') {
-        /* only accepts null hostname if input */
-        if (!(flags & AVIO_FLAG_READ))
-            goto fail;
-    } else {
-        if (ff_udp_set_remote_url(h, uri) < 0)
-            goto fail;
-    }
-
-    if ((s->is_multicast || !s->local_port) && (h->flags & AVIO_FLAG_READ))
-        s->local_port = port;
-    udp_fd = udp_socket_create(s, &my_addr, &len, localaddr);
-    if (udp_fd < 0)
-        goto fail;
-
-    /* Follow the requested reuse option, unless it's multicast in which
-     * case enable reuse unless explicitly disabled.
-     */
-    if (s->reuse_socket || (s->is_multicast && !reuse_specified)) {
-        s->reuse_socket = 1;
-        if (setsockopt (udp_fd, SOL_SOCKET, SO_REUSEADDR, &(s->reuse_socket), sizeof(s->reuse_socket)) != 0)
-            goto fail;
-    }
-
-    /* If multicast, try binding the multicast address first, to avoid
-     * receiving UDP packets from other sources aimed at the same UDP
-     * port. This fails on windows. This makes sending to the same address
-     * using sendto() fail, so only do it if we're opened in read-only mode. */
-    if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE)) {
-        bind_ret = bind(udp_fd,(struct sockaddr *)&s->dest_addr, len);
-    }
-    /* bind to the local address if not multicast or if the multicast
-     * bind failed */
-    /* the bind is needed to give a port to the socket now */
-    if (bind_ret < 0 && bind(udp_fd,(struct sockaddr *)&my_addr, len) < 0) {
-        log_net_error(h, AV_LOG_ERROR, "bind failed");
-        goto fail;
-    }
-
-    len = sizeof(my_addr);
-    getsockname(udp_fd, (struct sockaddr *)&my_addr, &len);
-    s->local_port = udp_port(&my_addr, len);
-
-    if (s->is_multicast) {
-        if (h->flags & AVIO_FLAG_WRITE) {
-            /* output */
-            if (udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0)
-                goto fail;
-        }
-        if (h->flags & AVIO_FLAG_READ) {
-            /* input */
-            if (num_include_sources && num_exclude_sources) {
-                av_log(h, AV_LOG_ERROR, "Simultaneously including and excluding multicast sources is not supported\n");
-                goto fail;
-            }
-            if (num_include_sources) {
-                if (udp_set_multicast_sources(udp_fd, (struct sockaddr *)&s->dest_addr, s->dest_addr_len, include_sources, num_include_sources, 1) < 0)
-                    goto fail;
-            } else {
-                if (udp_join_multicast_group(udp_fd, (struct sockaddr *)&s->dest_addr) < 0)
-                    goto fail;
-            }
-            if (num_exclude_sources) {
-                if (udp_set_multicast_sources(udp_fd, (struct sockaddr *)&s->dest_addr, s->dest_addr_len, exclude_sources, num_exclude_sources, 0) < 0)
-                    goto fail;
-            }
-        }
-    }
-
-    if (is_output) {
-        /* limit the tx buf size to limit latency */
-        tmp = s->buffer_size;
-        if (setsockopt(udp_fd, SOL_SOCKET, SO_SNDBUF, &tmp, sizeof(tmp)) < 0) {
-            log_net_error(h, AV_LOG_ERROR, "setsockopt(SO_SNDBUF)");
-            goto fail;
-        }
-    } else {
-        /* set udp recv buffer size to the largest possible udp packet size to
-         * avoid losing data on OSes that set this too low by default. */
-        tmp = s->buffer_size;
-        if (setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)) < 0) {
-            log_net_error(h, AV_LOG_WARNING, "setsockopt(SO_RECVBUF)");
-        }
-        /* make the socket non-blocking */
-        ff_socket_nonblock(udp_fd, 1);
-    }
-    if (s->is_connected) {
-        if (connect(udp_fd, (struct sockaddr *) &s->dest_addr, s->dest_addr_len)) {
-            log_net_error(h, AV_LOG_ERROR, "connect");
-            goto fail;
-        }
-    }
-
-    for (i = 0; i < num_include_sources; i++)
-        av_freep(&include_sources[i]);
-    for (i = 0; i < num_exclude_sources; i++)
-        av_freep(&exclude_sources[i]);
-
-    s->udp_fd = udp_fd;
-    return 0;
- fail:
-    if (udp_fd >= 0)
-        closesocket(udp_fd);
-    for (i = 0; i < num_include_sources; i++)
-        av_freep(&include_sources[i]);
-    for (i = 0; i < num_exclude_sources; i++)
-        av_freep(&exclude_sources[i]);
-    return AVERROR(EIO);
-}
-
-static int udp_read(URLContext *h, uint8_t *buf, int size)
-{
-    UDPContext *s = h->priv_data;
-    int ret;
-
-    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
-        ret = ff_network_wait_fd(s->udp_fd, 0);
-        if (ret < 0)
-            return ret;
-    }
-    ret = recv(s->udp_fd, buf, size, 0);
-    return ret < 0 ? ff_neterrno() : ret;
-}
-
-static int udp_write(URLContext *h, const uint8_t *buf, int size)
-{
-    UDPContext *s = h->priv_data;
-    int ret;
-
-    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
-        ret = ff_network_wait_fd(s->udp_fd, 1);
-        if (ret < 0)
-            return ret;
-    }
-
-    if (!s->is_connected) {
-        ret = sendto (s->udp_fd, buf, size, 0,
-                      (struct sockaddr *) &s->dest_addr,
-                      s->dest_addr_len);
-    } else
-        ret = send(s->udp_fd, buf, size, 0);
-
-    return ret < 0 ? ff_neterrno() : ret;
-}
-
-static int udp_close(URLContext *h)
-{
-    UDPContext *s = h->priv_data;
-
-    if (s->is_multicast && (h->flags & AVIO_FLAG_READ))
-        udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr);
-    closesocket(s->udp_fd);
-    return 0;
-}
-
-URLProtocol ff_udp_protocol = {
-    .name                = "udp",
-    .url_open            = udp_open,
-    .url_read            = udp_read,
-    .url_write           = udp_write,
-    .url_close           = udp_close,
-    .url_get_file_handle = udp_get_file_handle,
-    .priv_data_size      = sizeof(UDPContext),
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/unix.c b/deps/libav/libavformat/unix.c
deleted file mode 100644
index ab57c68..0000000
--- a/deps/libav/libavformat/unix.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Unix socket protocol
- * Copyright (c) 2013 Luca Barbato
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- *
- * Unix socket url_protocol
- *
- */
-
-#include <sys/un.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/opt.h"
-#include "os_support.h"
-#include "network.h"
-#include "url.h"
-
-typedef struct UnixContext {
-    const AVClass *class;
-    struct sockaddr_un addr;
-    int timeout;
-    int listen;
-    int type;
-    int fd;
-} UnixContext;
-
-#define OFFSET(x) offsetof(UnixContext, x)
-#define ED AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption unix_options[] = {
-    { "listen",    "Open socket for listening",             OFFSET(listen),  AV_OPT_TYPE_INT,   { .i64 = 0 },                    0,       1, ED },
-    { "timeout",   "Timeout in ms",                         OFFSET(timeout), AV_OPT_TYPE_INT,   { .i64 = -1 },                  -1, INT_MAX, ED },
-    { "type",      "Socket type",                           OFFSET(type),    AV_OPT_TYPE_INT,   { .i64 = SOCK_STREAM },    INT_MIN, INT_MAX, ED, "type" },
-    { "stream",    "Stream (reliable stream-oriented)",     0,               AV_OPT_TYPE_CONST, { .i64 = SOCK_STREAM },    INT_MIN, INT_MAX, ED, "type" },
-    { "datagram",  "Datagram (unreliable packet-oriented)", 0,               AV_OPT_TYPE_CONST, { .i64 = SOCK_DGRAM },     INT_MIN, INT_MAX, ED, "type" },
-    { "seqpacket", "Seqpacket (reliable packet-oriented",   0,               AV_OPT_TYPE_CONST, { .i64 = SOCK_SEQPACKET }, INT_MIN, INT_MAX, ED, "type" },
-    { NULL }
-};
-
-static const AVClass unix_class = {
-    .class_name = "unix",
-    .item_name  = av_default_item_name,
-    .option     = unix_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-static int unix_open(URLContext *h, const char *filename, int flags)
-{
-    UnixContext *s = h->priv_data;
-    int fd, ret;
-
-    av_strstart(filename, "unix:", &filename);
-    s->addr.sun_family = AF_UNIX;
-    av_strlcpy(s->addr.sun_path, filename, sizeof(s->addr.sun_path));
-
-    if ((fd = ff_socket(AF_UNIX, s->type, 0)) < 0)
-        return ff_neterrno();
-
-    if (s->listen) {
-        fd = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
-                            sizeof(s->addr), s->timeout, h);
-        if (fd < 0) {
-            ret = fd;
-            goto fail;
-        }
-    } else {
-        ret = ff_listen_connect(fd, (struct sockaddr *)&s->addr,
-                                sizeof(s->addr), s->timeout, h, 0);
-        if (ret < 0)
-            goto fail;
-    }
-
-    s->fd = fd;
-
-    return 0;
-
-fail:
-    if (s->listen && AVUNERROR(ret) != EADDRINUSE)
-        unlink(s->addr.sun_path);
-    if (fd >= 0)
-        closesocket(fd);
-    return ret;
-}
-
-static int unix_read(URLContext *h, uint8_t *buf, int size)
-{
-    UnixContext *s = h->priv_data;
-    int ret;
-
-    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
-        ret = ff_network_wait_fd(s->fd, 0);
-        if (ret < 0)
-            return ret;
-    }
-    ret = recv(s->fd, buf, size, 0);
-    return ret < 0 ? ff_neterrno() : ret;
-}
-
-static int unix_write(URLContext *h, const uint8_t *buf, int size)
-{
-    UnixContext *s = h->priv_data;
-    int ret;
-
-    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
-        ret = ff_network_wait_fd(s->fd, 1);
-        if (ret < 0)
-            return ret;
-    }
-    ret = send(s->fd, buf, size, 0);
-    return ret < 0 ? ff_neterrno() : ret;
-}
-
-static int unix_close(URLContext *h)
-{
-    UnixContext *s = h->priv_data;
-    if (s->listen)
-        unlink(s->addr.sun_path);
-    closesocket(s->fd);
-    return 0;
-}
-
-static int unix_get_file_handle(URLContext *h)
-{
-    UnixContext *s = h->priv_data;
-    return s->fd;
-}
-
-URLProtocol ff_unix_protocol = {
-    .name                = "unix",
-    .url_open            = unix_open,
-    .url_read            = unix_read,
-    .url_write           = unix_write,
-    .url_close           = unix_close,
-    .url_get_file_handle = unix_get_file_handle,
-    .priv_data_size      = sizeof(UnixContext),
-    .priv_data_class     = &unix_class,
-    .flags               = URL_PROTOCOL_FLAG_NETWORK,
-};
diff --git a/deps/libav/libavformat/url-test.c b/deps/libav/libavformat/url-test.c
deleted file mode 100644
index 503b36e..0000000
--- a/deps/libav/libavformat/url-test.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "url.h"
-
-static void test(const char *base, const char *rel)
-{
-    char buf[200], buf2[200];
-    ff_make_absolute_url(buf, sizeof(buf), base, rel);
-    printf("%s\n", buf);
-    if (base) {
-        /* Test in-buffer replacement */
-        snprintf(buf2, sizeof(buf2), "%s", base);
-        ff_make_absolute_url(buf2, sizeof(buf2), buf2, rel);
-        if (strcmp(buf, buf2)) {
-            printf("In-place handling of %s + %s failed\n", base, rel);
-            exit(1);
-        }
-    }
-}
-
-int main(void)
-{
-    test(NULL, "baz");
-    test("/foo/bar", "baz");
-    test("/foo/bar", "../baz");
-    test("/foo/bar", "/baz");
-    test("http://server/foo/", "baz");
-    test("http://server/foo/bar", "baz");
-    test("http://server/foo/", "../baz");
-    test("http://server/foo/bar/123", "../../baz");
-    test("http://server/foo/bar/123", "/baz");
-    test("http://server/foo/bar/123", "https://other/url");
-    test("http://server/foo/bar?param=value/with/slashes", "/baz");
-    test("http://server/foo/bar?param&otherparam", "?someparam");
-    test("http://server/foo/bar", "//other/url");
-    return 0;
-}
diff --git a/deps/libav/libavformat/url.c b/deps/libav/libavformat/url.c
deleted file mode 100644
index eeda1f0..0000000
--- a/deps/libav/libavformat/url.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * URL utility functions
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-#include "avformat.h"
-#include "config.h"
-#include "url.h"
-#if CONFIG_NETWORK
-#include "network.h"
-#endif
-#include "libavutil/avstring.h"
-
-/**
- * @file
- * URL utility functions.
- */
-
-int ff_url_join(char *str, int size, const char *proto,
-                const char *authorization, const char *hostname,
-                int port, const char *fmt, ...)
-{
-#if CONFIG_NETWORK
-    struct addrinfo hints = { 0 }, *ai;
-#endif
-
-    str[0] = '\0';
-    if (proto)
-        av_strlcatf(str, size, "%s://", proto);
-    if (authorization && authorization[0])
-        av_strlcatf(str, size, "%s@", authorization);
-#if CONFIG_NETWORK && defined(AF_INET6)
-    /* Determine if hostname is a numerical IPv6 address,
-     * properly escape it within [] in that case. */
-    hints.ai_flags = AI_NUMERICHOST;
-    if (!getaddrinfo(hostname, NULL, &hints, &ai)) {
-        if (ai->ai_family == AF_INET6) {
-            av_strlcat(str, "[", size);
-            av_strlcat(str, hostname, size);
-            av_strlcat(str, "]", size);
-        } else {
-            av_strlcat(str, hostname, size);
-        }
-        freeaddrinfo(ai);
-    } else
-#endif
-        /* Not an IPv6 address, just output the plain string. */
-        av_strlcat(str, hostname, size);
-
-    if (port >= 0)
-        av_strlcatf(str, size, ":%d", port);
-    if (fmt) {
-        va_list vl;
-        int len = strlen(str);
-
-        va_start(vl, fmt);
-        vsnprintf(str + len, size > len ? size - len : 0, fmt, vl);
-        va_end(vl);
-    }
-    return strlen(str);
-}
-
-void ff_make_absolute_url(char *buf, int size, const char *base,
-                          const char *rel)
-{
-    char *sep, *path_query;
-    /* Absolute path, relative to the current server */
-    if (base && strstr(base, "://") && rel[0] == '/') {
-        if (base != buf)
-            av_strlcpy(buf, base, size);
-        sep = strstr(buf, "://");
-        if (sep) {
-            /* Take scheme from base url */
-            if (rel[1] == '/') {
-                sep[1] = '\0';
-            } else {
-                /* Take scheme and host from base url */
-                sep += 3;
-                sep = strchr(sep, '/');
-                if (sep)
-                    *sep = '\0';
-            }
-        }
-        av_strlcat(buf, rel, size);
-        return;
-    }
-    /* If rel actually is an absolute url, just copy it */
-    if (!base || strstr(rel, "://") || rel[0] == '/') {
-        av_strlcpy(buf, rel, size);
-        return;
-    }
-    if (base != buf)
-        av_strlcpy(buf, base, size);
-
-    /* Strip off any query string from base */
-    path_query = strchr(buf, '?');
-    if (path_query != NULL)
-        *path_query = '\0';
-
-    /* Is relative path just a new query part? */
-    if (rel[0] == '?') {
-        av_strlcat(buf, rel, size);
-        return;
-    }
-
-    /* Remove the file name from the base url */
-    sep = strrchr(buf, '/');
-    if (sep)
-        sep[1] = '\0';
-    else
-        buf[0] = '\0';
-    while (av_strstart(rel, "../", NULL) && sep) {
-        /* Remove the path delimiter at the end */
-        sep[0] = '\0';
-        sep = strrchr(buf, '/');
-        /* If the next directory name to pop off is "..", break here */
-        if (!strcmp(sep ? &sep[1] : buf, "..")) {
-            /* Readd the slash we just removed */
-            av_strlcat(buf, "/", size);
-            break;
-        }
-        /* Cut off the directory name */
-        if (sep)
-            sep[1] = '\0';
-        else
-            buf[0] = '\0';
-        rel += 3;
-    }
-    av_strlcat(buf, rel, size);
-}
diff --git a/deps/libav/libavformat/url.h b/deps/libav/libavformat/url.h
deleted file mode 100644
index ff1e21b..0000000
--- a/deps/libav/libavformat/url.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * unbuffered private I/O API
- */
-
-#ifndef AVFORMAT_URL_H
-#define AVFORMAT_URL_H
-
-#include "avio.h"
-#include "libavformat/version.h"
-
-#include "libavutil/dict.h"
-#include "libavutil/log.h"
-
-#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */
-#define URL_PROTOCOL_FLAG_NETWORK       2 /*< The protocol uses network */
-
-extern int (*url_interrupt_cb)(void);
-
-extern const AVClass ffurl_context_class;
-
-typedef struct URLContext {
-    const AVClass *av_class;    /**< information for av_log(). Set by url_open(). */
-    struct URLProtocol *prot;
-    void *priv_data;
-    char *filename;             /**< specified URL */
-    int flags;
-    int max_packet_size;        /**< if non zero, the stream is packetized with this max packet size */
-    int is_streamed;            /**< true if streamed (no seek possible), default = false */
-    int is_connected;
-    AVIOInterruptCB interrupt_callback;
-} URLContext;
-
-typedef struct URLProtocol {
-    const char *name;
-    int     (*url_open)( URLContext *h, const char *url, int flags);
-    /**
-     * This callback is to be used by protocols which open further nested
-     * protocols. options are then to be passed to ffurl_open()/ffurl_connect()
-     * for those nested protocols.
-     */
-    int     (*url_open2)(URLContext *h, const char *url, int flags, AVDictionary **options);
-
-    /**
-     * Read data from the protocol.
-     * If data is immediately available (even less than size), EOF is
-     * reached or an error occurs (including EINTR), return immediately.
-     * Otherwise:
-     * In non-blocking mode, return AVERROR(EAGAIN) immediately.
-     * In blocking mode, wait for data/EOF/error with a short timeout (0.1s),
-     * and return AVERROR(EAGAIN) on timeout.
-     * Checking interrupt_callback, looping on EINTR and EAGAIN and until
-     * enough data has been read is left to the calling function; see
-     * retry_transfer_wrapper in avio.c.
-     */
-    int     (*url_read)( URLContext *h, unsigned char *buf, int size);
-    int     (*url_write)(URLContext *h, const unsigned char *buf, int size);
-    int64_t (*url_seek)( URLContext *h, int64_t pos, int whence);
-    int     (*url_close)(URLContext *h);
-    struct URLProtocol *next;
-    int (*url_read_pause)(URLContext *h, int pause);
-    int64_t (*url_read_seek)(URLContext *h, int stream_index,
-                             int64_t timestamp, int flags);
-    int (*url_get_file_handle)(URLContext *h);
-    int (*url_get_multi_file_handle)(URLContext *h, int **handles,
-                                     int *numhandles);
-    int (*url_shutdown)(URLContext *h, int flags);
-    int priv_data_size;
-    const AVClass *priv_data_class;
-    int flags;
-    int (*url_check)(URLContext *h, int mask);
-} URLProtocol;
-
-/**
- * Create a URLContext for accessing to the resource indicated by
- * url, but do not initiate the connection yet.
- *
- * @param puc pointer to the location where, in case of success, the
- * function puts the pointer to the created URLContext
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @param int_cb interrupt callback to use for the URLContext, may be
- * NULL
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int ffurl_alloc(URLContext **puc, const char *filename, int flags,
-                const AVIOInterruptCB *int_cb);
-
-/**
- * Connect an URLContext that has been allocated by ffurl_alloc
- *
- * @param options  A dictionary filled with options for nested protocols,
- * i.e. it will be passed to url_open2() for protocols implementing it.
- * This parameter will be destroyed and replaced with a dict containing options
- * that were not found. May be NULL.
- */
-int ffurl_connect(URLContext *uc, AVDictionary **options);
-
-/**
- * Create an URLContext for accessing to the resource indicated by
- * url, and open it.
- *
- * @param puc pointer to the location where, in case of success, the
- * function puts the pointer to the created URLContext
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @param int_cb interrupt callback to use for the URLContext, may be
- * NULL
- * @param options  A dictionary filled with protocol-private options. On return
- * this parameter will be destroyed and replaced with a dict containing options
- * that were not found. May be NULL.
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int ffurl_open(URLContext **puc, const char *filename, int flags,
-               const AVIOInterruptCB *int_cb, AVDictionary **options);
-
-/**
- * Read up to size bytes from the resource accessed by h, and store
- * the read bytes in buf.
- *
- * @return The number of bytes actually read, or a negative value
- * corresponding to an AVERROR code in case of error. A value of zero
- * indicates that it is not possible to read more from the accessed
- * resource (except if the value of the size argument is also zero).
- */
-int ffurl_read(URLContext *h, unsigned char *buf, int size);
-
-/**
- * Read as many bytes as possible (up to size), calling the
- * read function multiple times if necessary.
- * This makes special short-read handling in applications
- * unnecessary, if the return value is < size then it is
- * certain there was either an error or the end of file was reached.
- */
-int ffurl_read_complete(URLContext *h, unsigned char *buf, int size);
-
-/**
- * Write size bytes from buf to the resource accessed by h.
- *
- * @return the number of bytes actually written, or a negative value
- * corresponding to an AVERROR code in case of failure
- */
-int ffurl_write(URLContext *h, const unsigned char *buf, int size);
-
-/**
- * Change the position that will be used by the next read/write
- * operation on the resource accessed by h.
- *
- * @param pos specifies the new position to set
- * @param whence specifies how pos should be interpreted, it must be
- * one of SEEK_SET (seek from the beginning), SEEK_CUR (seek from the
- * current position), SEEK_END (seek from the end), or AVSEEK_SIZE
- * (return the filesize of the requested resource, pos is ignored).
- * @return a negative value corresponding to an AVERROR code in case
- * of failure, or the resulting file position, measured in bytes from
- * the beginning of the file. You can use this feature together with
- * SEEK_CUR to read the current file position.
- */
-int64_t ffurl_seek(URLContext *h, int64_t pos, int whence);
-
-/**
- * Close the resource accessed by the URLContext h, and free the
- * memory used by it.
- *
- * @return a negative value if an error condition occurred, 0
- * otherwise
- */
-int ffurl_close(URLContext *h);
-
-/**
- * Return the filesize of the resource accessed by h, AVERROR(ENOSYS)
- * if the operation is not supported by h, or another negative value
- * corresponding to an AVERROR error code in case of failure.
- */
-int64_t ffurl_size(URLContext *h);
-
-/**
- * Return the file descriptor associated with this URL. For RTP, this
- * will return only the RTP file descriptor, not the RTCP file descriptor.
- *
- * @return the file descriptor associated with this URL, or <0 on error.
- */
-int ffurl_get_file_handle(URLContext *h);
-
-/**
- * Return the file descriptors associated with this URL.
- *
- * @return 0 on success or <0 on error.
- */
-int ffurl_get_multi_file_handle(URLContext *h, int **handles, int *numhandles);
-
-/**
- * Signal the URLContext that we are done reading or writing the stream.
- *
- * @param h pointer to the resource
- * @param flags flags which control how the resource indicated by url
- * is to be shutdown
- *
- * @return a negative value if an error condition occurred, 0
- * otherwise
- */
-int ffurl_shutdown(URLContext *h, int flags);
-
-/**
- * Register the URLProtocol protocol.
- */
-int ffurl_register_protocol(URLProtocol *protocol);
-
-/**
- * Check if the user has requested to interrup a blocking function
- * associated with cb.
- */
-int ff_check_interrupt(AVIOInterruptCB *cb);
-
-/**
- * Iterate over all available protocols.
- *
- * @param prev result of the previous call to this functions or NULL.
- */
-URLProtocol *ffurl_protocol_next(URLProtocol *prev);
-
-/* udp.c */
-int ff_udp_set_remote_url(URLContext *h, const char *uri);
-int ff_udp_get_local_port(URLContext *h);
-
-/**
- * Assemble a URL string from components. This is the reverse operation
- * of av_url_split.
- *
- * Note, this requires networking to be initialized, so the caller must
- * ensure ff_network_init has been called.
- *
- * @see av_url_split
- *
- * @param str the buffer to fill with the url
- * @param size the size of the str buffer
- * @param proto the protocol identifier, if null, the separator
- *              after the identifier is left out, too
- * @param authorization an optional authorization string, may be null.
- *                      An empty string is treated the same as a null string.
- * @param hostname the host name string
- * @param port the port number, left out from the string if negative
- * @param fmt a generic format string for everything to add after the
- *            host/port, may be null
- * @return the number of characters written to the destination buffer
- */
-int ff_url_join(char *str, int size, const char *proto,
-                const char *authorization, const char *hostname,
-                int port, const char *fmt, ...) av_printf_format(7, 8);
-
-/*
- * Convert a relative url into an absolute url, given a base url.
- *
- * @param buf the buffer where output absolute url is written
- * @param size the size of buf
- * @param base the base url, may be equal to buf.
- * @param rel the new url, which is interpreted relative to base
- */
-void ff_make_absolute_url(char *buf, int size, const char *base,
-                          const char *rel);
-
-
-#endif /* AVFORMAT_URL_H */
diff --git a/deps/libav/libavformat/urldecode.c b/deps/libav/libavformat/urldecode.c
deleted file mode 100644
index 49af9ba..0000000
--- a/deps/libav/libavformat/urldecode.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Simple URL decoding function
- * Copyright (c) 2012 Antti Seppälä
- *
- * References:
- *  RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
- *       T. Berners-Lee et al. The Internet Society, 2005
- *
- * based on http://www.icosaedro.it/apache/urldecode.c
- *          from Umberto Salsi (salsi at icosaedro.it)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "libavutil/mem.h"
-#include "libavutil/avstring.h"
-#include "urldecode.h"
-
-char *ff_urldecode(const char *url)
-{
-    int s = 0, d = 0, url_len = 0;
-    char c;
-    char *dest = NULL;
-
-    if (!url)
-        return NULL;
-
-    url_len = strlen(url) + 1;
-    dest = av_malloc(url_len);
-
-    if (!dest)
-        return NULL;
-
-    while (s < url_len) {
-        c = url[s++];
-
-        if (c == '%' && s + 2 < url_len) {
-            char c2 = url[s++];
-            char c3 = url[s++];
-            if (av_isxdigit(c2) && av_isxdigit(c3)) {
-                c2 = av_tolower(c2);
-                c3 = av_tolower(c3);
-
-                if (c2 <= '9')
-                    c2 = c2 - '0';
-                else
-                    c2 = c2 - 'a' + 10;
-
-                if (c3 <= '9')
-                    c3 = c3 - '0';
-                else
-                    c3 = c3 - 'a' + 10;
-
-                dest[d++] = 16 * c2 + c3;
-
-            } else { /* %zz or something other invalid */
-                dest[d++] = c;
-                dest[d++] = c2;
-                dest[d++] = c3;
-            }
-        } else if (c == '+') {
-            dest[d++] = ' ';
-        } else {
-            dest[d++] = c;
-        }
-
-    }
-
-    return dest;
-}
diff --git a/deps/libav/libavformat/urldecode.h b/deps/libav/libavformat/urldecode.h
deleted file mode 100644
index b43f319..0000000
--- a/deps/libav/libavformat/urldecode.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_URLDECODE_H
-#define AVFORMAT_URLDECODE_H
-
-/**
- * Decodes an URL from its percent-encoded form back into normal
- * representation. This function returns the decoded URL in a string.
- * The URL to be decoded does not necessarily have to be encoded but
- * in that case the original string is duplicated.
- *
- * @param url a string to be decoded.
- * @return new string with the URL decoded or NULL if decoding failed.
- * Note that the returned string should be explicitly freed when not
- * used anymore.
- */
-char *ff_urldecode(const char *url);
-
-#endif /* AVFORMAT_URLDECODE_H */
diff --git a/deps/libav/libavformat/utils.c b/deps/libav/libavformat/utils.c
deleted file mode 100644
index fca588b..0000000
--- a/deps/libav/libavformat/utils.c
+++ /dev/null
@@ -1,3492 +0,0 @@
-/*
- * various utility functions for use within Libav
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#undef NDEBUG
-#include <assert.h>
-#include <stdarg.h>
-#include <stdint.h>
-
-#include "config.h"
-
-#include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
-#include "libavutil/dict.h"
-#include "libavutil/internal.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/time.h"
-
-#include "libavcodec/bytestream.h"
-#include "libavcodec/internal.h"
-
-#include "audiointerleave.h"
-#include "avformat.h"
-#include "avio_internal.h"
-#include "id3v2.h"
-#include "internal.h"
-#include "metadata.h"
-#if CONFIG_NETWORK
-#include "network.h"
-#endif
-#include "riff.h"
-#include "url.h"
-
-/**
- * @file
- * various utility functions for use within Libav
- */
-
-unsigned avformat_version(void)
-{
-    return LIBAVFORMAT_VERSION_INT;
-}
-
-const char *avformat_configuration(void)
-{
-    return LIBAV_CONFIGURATION;
-}
-
-const char *avformat_license(void)
-{
-#define LICENSE_PREFIX "libavformat license: "
-    return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
-}
-
-/* an arbitrarily chosen "sane" max packet size -- 50M */
-#define SANE_CHUNK_SIZE (50000000)
-
-/* Read the data in sane-sized chunks and append to pkt.
- * Return the number of bytes read or an error. */
-static int append_packet_chunked(AVIOContext *s, AVPacket *pkt, int size)
-{
-    int64_t chunk_size = size;
-    int64_t orig_pos   = pkt->pos; // av_grow_packet might reset pos
-    int orig_size      = pkt->size;
-    int ret = 0;
-
-    do {
-        int prev_size = pkt->size;
-        int read_size;
-
-        /* When the caller requests a lot of data, limit it to the amount
-         * left in file or SANE_CHUNK_SIZE when it is not known. */
-        if (size > SANE_CHUNK_SIZE) {
-            int64_t filesize = avio_size(s) - avio_tell(s);
-            chunk_size = FFMAX(filesize, SANE_CHUNK_SIZE);
-        }
-        read_size = FFMIN(size, chunk_size);
-
-        ret = av_grow_packet(pkt, read_size);
-        if (ret < 0)
-            break;
-
-        ret = avio_read(s, pkt->data + prev_size, read_size);
-        if (ret != read_size) {
-            av_shrink_packet(pkt, prev_size + FFMAX(ret, 0));
-            break;
-        }
-
-        size -= read_size;
-    } while (size > 0);
-
-    pkt->pos = orig_pos;
-    if (!pkt->size)
-        av_free_packet(pkt);
-    return pkt->size > orig_size ? pkt->size - orig_size : ret;
-}
-
-int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
-{
-    av_init_packet(pkt);
-    pkt->data = NULL;
-    pkt->size = 0;
-    pkt->pos  = avio_tell(s);
-
-    return append_packet_chunked(s, pkt, size);
-}
-
-int av_append_packet(AVIOContext *s, AVPacket *pkt, int size)
-{
-    if (!pkt->size)
-        return av_get_packet(s, pkt, size);
-    return append_packet_chunked(s, pkt, size);
-}
-
-int av_filename_number_test(const char *filename)
-{
-    char buf[1024];
-    return filename &&
-           (av_get_frame_filename(buf, sizeof(buf), filename, 1) >= 0);
-}
-
-AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened,
-                                      int *score_max)
-{
-    AVProbeData lpd = *pd;
-    AVInputFormat *fmt1 = NULL, *fmt;
-    int score, id3 = 0;
-
-    if (lpd.buf_size > 10 && ff_id3v2_match(lpd.buf, ID3v2_DEFAULT_MAGIC)) {
-        int id3len = ff_id3v2_tag_len(lpd.buf);
-        if (lpd.buf_size > id3len + 16) {
-            lpd.buf      += id3len;
-            lpd.buf_size -= id3len;
-        }
-        id3 = 1;
-    }
-
-    fmt = NULL;
-    while ((fmt1 = av_iformat_next(fmt1))) {
-        if (!is_opened == !(fmt1->flags & AVFMT_NOFILE))
-            continue;
-        score = 0;
-        if (fmt1->read_probe) {
-            score = fmt1->read_probe(&lpd);
-        } else if (fmt1->extensions) {
-            if (av_match_ext(lpd.filename, fmt1->extensions))
-                score = AVPROBE_SCORE_EXTENSION;
-        }
-        if (score > *score_max) {
-            *score_max = score;
-            fmt        = fmt1;
-        } else if (score == *score_max)
-            fmt = NULL;
-    }
-
-    // A hack for files with huge id3v2 tags -- try to guess by file extension.
-    if (!fmt && is_opened && *score_max < AVPROBE_SCORE_EXTENSION / 2) {
-        while ((fmt = av_iformat_next(fmt)))
-            if (fmt->extensions &&
-                av_match_ext(lpd.filename, fmt->extensions)) {
-                *score_max = AVPROBE_SCORE_EXTENSION / 2;
-                break;
-            }
-    }
-
-    if (!fmt && id3 && *score_max < AVPROBE_SCORE_EXTENSION / 2 - 1) {
-        while ((fmt = av_iformat_next(fmt)))
-            if (fmt->extensions && av_match_ext("mp3", fmt->extensions)) {
-                *score_max = AVPROBE_SCORE_EXTENSION / 2 - 1;
-                break;
-            }
-    }
-
-    return fmt;
-}
-
-AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened)
-{
-    int score = 0;
-    return av_probe_input_format2(pd, is_opened, &score);
-}
-
-static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
-                                     AVProbeData *pd, int score)
-{
-    static const struct {
-        const char *name;
-        enum AVCodecID id;
-        enum AVMediaType type;
-    } fmt_id_type[] = {
-        { "aac",       AV_CODEC_ID_AAC,        AVMEDIA_TYPE_AUDIO },
-        { "ac3",       AV_CODEC_ID_AC3,        AVMEDIA_TYPE_AUDIO },
-        { "dts",       AV_CODEC_ID_DTS,        AVMEDIA_TYPE_AUDIO },
-        { "eac3",      AV_CODEC_ID_EAC3,       AVMEDIA_TYPE_AUDIO },
-        { "h264",      AV_CODEC_ID_H264,       AVMEDIA_TYPE_VIDEO },
-        { "m4v",       AV_CODEC_ID_MPEG4,      AVMEDIA_TYPE_VIDEO },
-        { "mp3",       AV_CODEC_ID_MP3,        AVMEDIA_TYPE_AUDIO },
-        { "mpegvideo", AV_CODEC_ID_MPEG2VIDEO, AVMEDIA_TYPE_VIDEO },
-        { 0 }
-    };
-    AVInputFormat *fmt = av_probe_input_format2(pd, 1, &score);
-
-    if (fmt) {
-        int i;
-        av_log(s, AV_LOG_DEBUG,
-               "Probe with size=%d, packets=%d detected %s with score=%d\n",
-               pd->buf_size, MAX_PROBE_PACKETS - st->probe_packets,
-               fmt->name, score);
-        for (i = 0; fmt_id_type[i].name; i++) {
-            if (!strcmp(fmt->name, fmt_id_type[i].name)) {
-                st->codec->codec_id   = fmt_id_type[i].id;
-                st->codec->codec_type = fmt_id_type[i].type;
-                break;
-            }
-        }
-    }
-    return !!fmt;
-}
-
-/************************************************************/
-/* input media file */
-
-/** size of probe buffer, for guessing file type from file contents */
-#define PROBE_BUF_MIN 2048
-#define PROBE_BUF_MAX (1 << 20)
-
-int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
-                          const char *filename, void *logctx,
-                          unsigned int offset, unsigned int max_probe_size)
-{
-    AVProbeData pd = { filename ? filename : "" };
-    uint8_t *buf = NULL;
-    int ret = 0, probe_size;
-
-    if (!max_probe_size)
-        max_probe_size = PROBE_BUF_MAX;
-    else if (max_probe_size > PROBE_BUF_MAX)
-        max_probe_size = PROBE_BUF_MAX;
-    else if (max_probe_size < PROBE_BUF_MIN)
-        return AVERROR(EINVAL);
-
-    if (offset >= max_probe_size)
-        return AVERROR(EINVAL);
-    avio_skip(pb, offset);
-    max_probe_size -= offset;
-
-    for (probe_size = PROBE_BUF_MIN; probe_size <= max_probe_size && !*fmt;
-         probe_size = FFMIN(probe_size << 1,
-                            FFMAX(max_probe_size, probe_size + 1))) {
-        int score = probe_size < max_probe_size ? AVPROBE_SCORE_MAX / 4 : 0;
-
-        /* Read probe data. */
-        if ((ret = av_reallocp(&buf, probe_size + AVPROBE_PADDING_SIZE)) < 0)
-            return ret;
-        if ((ret = avio_read(pb, buf + pd.buf_size,
-                             probe_size - pd.buf_size)) < 0) {
-            /* Fail if error was not end of file, otherwise, lower score. */
-            if (ret != AVERROR_EOF) {
-                av_free(buf);
-                return ret;
-            }
-            score = 0;
-            ret   = 0;          /* error was end of file, nothing read */
-        }
-        pd.buf_size += ret;
-        pd.buf       = buf;
-
-        memset(pd.buf + pd.buf_size, 0, AVPROBE_PADDING_SIZE);
-
-        /* Guess file format. */
-        *fmt = av_probe_input_format2(&pd, 1, &score);
-        if (*fmt) {
-            /* This can only be true in the last iteration. */
-            if (score <= AVPROBE_SCORE_MAX / 4) {
-                av_log(logctx, AV_LOG_WARNING,
-                       "Format detected only with low score of %d, "
-                       "misdetection possible!\n", score);
-            } else
-                av_log(logctx, AV_LOG_DEBUG,
-                       "Probed with size=%d and score=%d\n", probe_size, score);
-        }
-    }
-
-    if (!*fmt) {
-        av_free(buf);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* Rewind. Reuse probe buffer to avoid seeking. */
-    if ((ret = ffio_rewind_with_probe_data(pb, buf, pd.buf_size)) < 0)
-        av_free(buf);
-
-    return ret;
-}
-
-/* Open input file and probe the format if necessary. */
-static int init_input(AVFormatContext *s, const char *filename,
-                      AVDictionary **options)
-{
-    int ret;
-    AVProbeData pd = { filename, NULL, 0 };
-
-    if (s->pb) {
-        s->flags |= AVFMT_FLAG_CUSTOM_IO;
-        if (!s->iformat)
-            return av_probe_input_buffer(s->pb, &s->iformat, filename,
-                                         s, 0, s->probesize);
-        else if (s->iformat->flags & AVFMT_NOFILE)
-            return AVERROR(EINVAL);
-        return 0;
-    }
-
-    if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
-        (!s->iformat && (s->iformat = av_probe_input_format(&pd, 0))))
-        return 0;
-
-    if ((ret = avio_open2(&s->pb, filename, AVIO_FLAG_READ,
-                          &s->interrupt_callback, options)) < 0)
-        return ret;
-    if (s->iformat)
-        return 0;
-    return av_probe_input_buffer(s->pb, &s->iformat, filename,
-                                 s, 0, s->probesize);
-}
-
-static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt,
-                               AVPacketList **plast_pktl)
-{
-    AVPacketList *pktl = av_mallocz(sizeof(AVPacketList));
-    if (!pktl)
-        return NULL;
-
-    if (*packet_buffer)
-        (*plast_pktl)->next = pktl;
-    else
-        *packet_buffer = pktl;
-
-    /* Add the packet in the buffered packet list. */
-    *plast_pktl = pktl;
-    pktl->pkt   = *pkt;
-    return &pktl->pkt;
-}
-
-static int queue_attached_pictures(AVFormatContext *s)
-{
-    int i;
-    for (i = 0; i < s->nb_streams; i++)
-        if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC &&
-            s->streams[i]->discard < AVDISCARD_ALL) {
-            AVPacket copy = s->streams[i]->attached_pic;
-            copy.buf = av_buffer_ref(copy.buf);
-            if (!copy.buf)
-                return AVERROR(ENOMEM);
-
-            add_to_pktbuf(&s->raw_packet_buffer, &copy,
-                          &s->raw_packet_buffer_end);
-        }
-    return 0;
-}
-
-int avformat_open_input(AVFormatContext **ps, const char *filename,
-                        AVInputFormat *fmt, AVDictionary **options)
-{
-    AVFormatContext *s = *ps;
-    int ret = 0;
-    AVDictionary *tmp = NULL;
-    ID3v2ExtraMeta *id3v2_extra_meta = NULL;
-
-    if (!s && !(s = avformat_alloc_context()))
-        return AVERROR(ENOMEM);
-    if (fmt)
-        s->iformat = fmt;
-
-    if (options)
-        av_dict_copy(&tmp, *options, 0);
-
-    if ((ret = av_opt_set_dict(s, &tmp)) < 0)
-        goto fail;
-
-    if ((ret = init_input(s, filename, &tmp)) < 0)
-        goto fail;
-
-    /* Check filename in case an image number is expected. */
-    if (s->iformat->flags & AVFMT_NEEDNUMBER) {
-        if (!av_filename_number_test(filename)) {
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-    }
-
-    s->duration = s->start_time = AV_NOPTS_VALUE;
-    av_strlcpy(s->filename, filename ? filename : "", sizeof(s->filename));
-
-    /* Allocate private data. */
-    if (s->iformat->priv_data_size > 0) {
-        if (!(s->priv_data = av_mallocz(s->iformat->priv_data_size))) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        if (s->iformat->priv_class) {
-            *(const AVClass **) s->priv_data = s->iformat->priv_class;
-            av_opt_set_defaults(s->priv_data);
-            if ((ret = av_opt_set_dict(s->priv_data, &tmp)) < 0)
-                goto fail;
-        }
-    }
-
-    /* e.g. AVFMT_NOFILE formats will not have a AVIOContext */
-    if (s->pb)
-        ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
-
-    if (s->iformat->read_header)
-        if ((ret = s->iformat->read_header(s)) < 0)
-            goto fail;
-
-    if (id3v2_extra_meta &&
-        (ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0)
-        goto fail;
-    ff_id3v2_free_extra_meta(&id3v2_extra_meta);
-
-    if ((ret = queue_attached_pictures(s)) < 0)
-        goto fail;
-
-    if (s->pb && !s->data_offset)
-        s->data_offset = avio_tell(s->pb);
-
-    s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
-
-    if (options) {
-        av_dict_free(options);
-        *options = tmp;
-    }
-    *ps = s;
-    return 0;
-
-fail:
-    ff_id3v2_free_extra_meta(&id3v2_extra_meta);
-    av_dict_free(&tmp);
-    if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))
-        avio_close(s->pb);
-    avformat_free_context(s);
-    *ps = NULL;
-    return ret;
-}
-
-/*******************************************************/
-
-static int probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
-{
-    if (st->codec->codec_id == AV_CODEC_ID_PROBE) {
-        AVProbeData *pd = &st->probe_data;
-        av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);
-        --st->probe_packets;
-
-        if (pkt) {
-            int err;
-            if ((err = av_reallocp(&pd->buf, pd->buf_size + pkt->size +
-                                   AVPROBE_PADDING_SIZE)) < 0)
-                return err;
-            memcpy(pd->buf + pd->buf_size, pkt->data, pkt->size);
-            pd->buf_size += pkt->size;
-            memset(pd->buf + pd->buf_size, 0, AVPROBE_PADDING_SIZE);
-        } else {
-            st->probe_packets = 0;
-            if (!pd->buf_size) {
-                av_log(s, AV_LOG_ERROR,
-                       "nothing to probe for stream %d\n", st->index);
-                return 0;
-            }
-        }
-
-        if (!st->probe_packets ||
-            av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {
-            set_codec_from_probe_data(s, st, pd, st->probe_packets > 0
-                                                 ? AVPROBE_SCORE_MAX / 4 : 0);
-            if (st->codec->codec_id != AV_CODEC_ID_PROBE) {
-                pd->buf_size = 0;
-                av_freep(&pd->buf);
-                av_log(s, AV_LOG_DEBUG, "probed stream %d\n", st->index);
-            }
-        }
-    }
-    return 0;
-}
-
-int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, i, err;
-    AVStream *st;
-
-    for (;;) {
-        AVPacketList *pktl = s->raw_packet_buffer;
-
-        if (pktl) {
-            *pkt = pktl->pkt;
-            st   = s->streams[pkt->stream_index];
-            if (st->codec->codec_id != AV_CODEC_ID_PROBE ||
-                !st->probe_packets ||
-                s->raw_packet_buffer_remaining_size < pkt->size) {
-                AVProbeData *pd;
-                if (st->probe_packets)
-                    if ((err = probe_codec(s, st, NULL)) < 0)
-                        return err;
-                pd = &st->probe_data;
-                av_freep(&pd->buf);
-                pd->buf_size = 0;
-                s->raw_packet_buffer                 = pktl->next;
-                s->raw_packet_buffer_remaining_size += pkt->size;
-                av_free(pktl);
-                return 0;
-            }
-        }
-
-        pkt->data = NULL;
-        pkt->size = 0;
-        av_init_packet(pkt);
-        ret = s->iformat->read_packet(s, pkt);
-        if (ret < 0) {
-            if (!pktl || ret == AVERROR(EAGAIN))
-                return ret;
-            for (i = 0; i < s->nb_streams; i++) {
-                st = s->streams[i];
-                if (st->probe_packets)
-                    if ((err = probe_codec(s, st, NULL)) < 0)
-                        return err;
-            }
-            continue;
-        }
-
-        if ((s->flags & AVFMT_FLAG_DISCARD_CORRUPT) &&
-            (pkt->flags & AV_PKT_FLAG_CORRUPT)) {
-            av_log(s, AV_LOG_WARNING,
-                   "Dropped corrupted packet (stream = %d)\n",
-                   pkt->stream_index);
-            av_free_packet(pkt);
-            continue;
-        }
-
-        st = s->streams[pkt->stream_index];
-
-        switch (st->codec->codec_type) {
-        case AVMEDIA_TYPE_VIDEO:
-            if (s->video_codec_id)
-                st->codec->codec_id = s->video_codec_id;
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            if (s->audio_codec_id)
-                st->codec->codec_id = s->audio_codec_id;
-            break;
-        case AVMEDIA_TYPE_SUBTITLE:
-            if (s->subtitle_codec_id)
-                st->codec->codec_id = s->subtitle_codec_id;
-            break;
-        }
-
-        if (!pktl && (st->codec->codec_id != AV_CODEC_ID_PROBE ||
-                      !st->probe_packets))
-            return ret;
-
-        add_to_pktbuf(&s->raw_packet_buffer, pkt, &s->raw_packet_buffer_end);
-        s->raw_packet_buffer_remaining_size -= pkt->size;
-
-        if ((err = probe_codec(s, st, pkt)) < 0)
-            return err;
-    }
-}
-
-/**********************************************************/
-
-/**
- * Get the number of samples of an audio frame. Return -1 on error.
- */
-int ff_get_audio_frame_size(AVCodecContext *enc, int size, int mux)
-{
-    int frame_size;
-
-    /* give frame_size priority if demuxing */
-    if (!mux && enc->frame_size > 1)
-        return enc->frame_size;
-
-    if ((frame_size = av_get_audio_frame_duration(enc, size)) > 0)
-        return frame_size;
-
-    /* Fall back on using frame_size if muxing. */
-    if (enc->frame_size > 1)
-        return enc->frame_size;
-
-    return -1;
-}
-
-/**
- * Return the frame duration in seconds. Return 0 if not available.
- */
-void ff_compute_frame_duration(int *pnum, int *pden, AVStream *st,
-                               AVCodecParserContext *pc, AVPacket *pkt)
-{
-    int frame_size;
-
-    *pnum = 0;
-    *pden = 0;
-    switch (st->codec->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-        if (st->avg_frame_rate.num) {
-            *pnum = st->avg_frame_rate.den;
-            *pden = st->avg_frame_rate.num;
-        } else if (st->time_base.num * 1000LL > st->time_base.den) {
-            *pnum = st->time_base.num;
-            *pden = st->time_base.den;
-        } else if (st->codec->time_base.num * 1000LL > st->codec->time_base.den) {
-            *pnum = st->codec->time_base.num;
-            *pden = st->codec->time_base.den;
-            if (pc && pc->repeat_pict) {
-                if (*pnum > INT_MAX / (1 + pc->repeat_pict))
-                    *pden /= 1 + pc->repeat_pict;
-                else
-                    *pnum *= 1 + pc->repeat_pict;
-            }
-            /* If this codec can be interlaced or progressive then we need
-             * a parser to compute duration of a packet. Thus if we have
-             * no parser in such case leave duration undefined. */
-            if (st->codec->ticks_per_frame > 1 && !pc)
-                *pnum = *pden = 0;
-        }
-        break;
-    case AVMEDIA_TYPE_AUDIO:
-        frame_size = ff_get_audio_frame_size(st->codec, pkt->size, 0);
-        if (frame_size <= 0 || st->codec->sample_rate <= 0)
-            break;
-        *pnum = frame_size;
-        *pden = st->codec->sample_rate;
-        break;
-    default:
-        break;
-    }
-}
-
-static int is_intra_only(enum AVCodecID id)
-{
-    const AVCodecDescriptor *d = avcodec_descriptor_get(id);
-    if (!d)
-        return 0;
-    if (d->type == AVMEDIA_TYPE_VIDEO && !(d->props & AV_CODEC_PROP_INTRA_ONLY))
-        return 0;
-    return 1;
-}
-
-static void update_initial_timestamps(AVFormatContext *s, int stream_index,
-                                      int64_t dts, int64_t pts)
-{
-    AVStream *st       = s->streams[stream_index];
-    AVPacketList *pktl = s->packet_buffer;
-
-    if (st->first_dts != AV_NOPTS_VALUE ||
-        dts           == AV_NOPTS_VALUE ||
-        st->cur_dts   == AV_NOPTS_VALUE)
-        return;
-
-    st->first_dts = dts - st->cur_dts;
-    st->cur_dts   = dts;
-
-    for (; pktl; pktl = pktl->next) {
-        if (pktl->pkt.stream_index != stream_index)
-            continue;
-        // FIXME: think more about this check
-        if (pktl->pkt.pts != AV_NOPTS_VALUE && pktl->pkt.pts == pktl->pkt.dts)
-            pktl->pkt.pts += st->first_dts;
-
-        if (pktl->pkt.dts != AV_NOPTS_VALUE)
-            pktl->pkt.dts += st->first_dts;
-
-        if (st->start_time == AV_NOPTS_VALUE && pktl->pkt.pts != AV_NOPTS_VALUE)
-            st->start_time = pktl->pkt.pts;
-    }
-    if (st->start_time == AV_NOPTS_VALUE)
-        st->start_time = pts;
-}
-
-static void update_initial_durations(AVFormatContext *s, AVStream *st,
-                                     int stream_index, int duration)
-{
-    AVPacketList *pktl = s->packet_buffer;
-    int64_t cur_dts    = 0;
-
-    if (st->first_dts != AV_NOPTS_VALUE) {
-        cur_dts = st->first_dts;
-        for (; pktl; pktl = pktl->next) {
-            if (pktl->pkt.stream_index == stream_index) {
-                if (pktl->pkt.pts != pktl->pkt.dts  ||
-                    pktl->pkt.dts != AV_NOPTS_VALUE ||
-                    pktl->pkt.duration)
-                    break;
-                cur_dts -= duration;
-            }
-        }
-        pktl          = s->packet_buffer;
-        st->first_dts = cur_dts;
-    } else if (st->cur_dts)
-        return;
-
-    for (; pktl; pktl = pktl->next) {
-        if (pktl->pkt.stream_index != stream_index)
-            continue;
-        if (pktl->pkt.pts == pktl->pkt.dts  &&
-            pktl->pkt.dts == AV_NOPTS_VALUE &&
-            !pktl->pkt.duration) {
-            pktl->pkt.dts = cur_dts;
-            if (!st->codec->has_b_frames)
-                pktl->pkt.pts = cur_dts;
-            cur_dts += duration;
-            if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO)
-                pktl->pkt.duration = duration;
-        } else
-            break;
-    }
-    if (st->first_dts == AV_NOPTS_VALUE)
-        st->cur_dts = cur_dts;
-}
-
-static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
-                               AVCodecParserContext *pc, AVPacket *pkt)
-{
-    int num, den, presentation_delayed, delay, i;
-    int64_t offset;
-
-    if (s->flags & AVFMT_FLAG_NOFILLIN)
-        return;
-
-    if ((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE)
-        pkt->dts = AV_NOPTS_VALUE;
-
-    /* do we have a video B-frame ? */
-    delay = st->codec->has_b_frames;
-    presentation_delayed = 0;
-
-    /* XXX: need has_b_frame, but cannot get it if the codec is
-     *  not initialized */
-    if (delay &&
-        pc && pc->pict_type != AV_PICTURE_TYPE_B)
-        presentation_delayed = 1;
-
-    if (pkt->pts != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE &&
-        st->pts_wrap_bits < 63 &&
-        pkt->dts - (1LL << (st->pts_wrap_bits - 1)) > pkt->pts) {
-        pkt->dts -= 1LL << st->pts_wrap_bits;
-    }
-
-    /* Some MPEG-2 in MPEG-PS lack dts (issue #171 / input_file.mpg).
-     * We take the conservative approach and discard both.
-     * Note: If this is misbehaving for an H.264 file, then possibly
-     * presentation_delayed is not set correctly. */
-    if (delay == 1 && pkt->dts == pkt->pts &&
-        pkt->dts != AV_NOPTS_VALUE && presentation_delayed) {
-        av_log(s, AV_LOG_DEBUG, "invalid dts/pts combination\n");
-        pkt->dts = pkt->pts = AV_NOPTS_VALUE;
-    }
-
-    if (pkt->duration == 0 && st->codec->codec_type != AVMEDIA_TYPE_AUDIO) {
-        ff_compute_frame_duration(&num, &den, st, pc, pkt);
-        if (den && num) {
-            pkt->duration = av_rescale_rnd(1, num * (int64_t) st->time_base.den,
-                                           den * (int64_t) st->time_base.num,
-                                           AV_ROUND_DOWN);
-
-            if (pkt->duration != 0 && s->packet_buffer)
-                update_initial_durations(s, st, pkt->stream_index,
-                                         pkt->duration);
-        }
-    }
-
-    /* Correct timestamps with byte offset if demuxers only have timestamps
-     * on packet boundaries */
-    if (pc && st->need_parsing == AVSTREAM_PARSE_TIMESTAMPS && pkt->size) {
-        /* this will estimate bitrate based on this frame's duration and size */
-        offset = av_rescale(pc->offset, pkt->duration, pkt->size);
-        if (pkt->pts != AV_NOPTS_VALUE)
-            pkt->pts += offset;
-        if (pkt->dts != AV_NOPTS_VALUE)
-            pkt->dts += offset;
-    }
-
-    /* This may be redundant, but it should not hurt. */
-    if (pkt->dts != AV_NOPTS_VALUE &&
-        pkt->pts != AV_NOPTS_VALUE &&
-        pkt->pts > pkt->dts)
-        presentation_delayed = 1;
-
-    av_dlog(NULL,
-            "IN delayed:%d pts:%"PRId64", dts:%"PRId64" "
-            "cur_dts:%"PRId64" st:%d pc:%p\n",
-            presentation_delayed, pkt->pts, pkt->dts, st->cur_dts,
-            pkt->stream_index, pc);
-    /* Interpolate PTS and DTS if they are not present. We skip H.264
-     * currently because delay and has_b_frames are not reliably set. */
-    if ((delay == 0 || (delay == 1 && pc)) &&
-        st->codec->codec_id != AV_CODEC_ID_H264) {
-        if (presentation_delayed) {
-            /* DTS = decompression timestamp */
-            /* PTS = presentation timestamp */
-            if (pkt->dts == AV_NOPTS_VALUE)
-                pkt->dts = st->last_IP_pts;
-            update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts);
-            if (pkt->dts == AV_NOPTS_VALUE)
-                pkt->dts = st->cur_dts;
-
-            /* This is tricky: the dts must be incremented by the duration
-             * of the frame we are displaying, i.e. the last I- or P-frame. */
-            if (st->last_IP_duration == 0)
-                st->last_IP_duration = pkt->duration;
-            if (pkt->dts != AV_NOPTS_VALUE)
-                st->cur_dts = pkt->dts + st->last_IP_duration;
-            st->last_IP_duration = pkt->duration;
-            st->last_IP_pts      = pkt->pts;
-            /* Cannot compute PTS if not present (we can compute it only
-             * by knowing the future. */
-        } else if (pkt->pts != AV_NOPTS_VALUE ||
-                   pkt->dts != AV_NOPTS_VALUE ||
-                   pkt->duration              ||
-                   st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            int duration = pkt->duration;
-            if (!duration && st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-                ff_compute_frame_duration(&num, &den, st, pc, pkt);
-                if (den && num) {
-                    duration = av_rescale_rnd(1,
-                                              num * (int64_t) st->time_base.den,
-                                              den * (int64_t) st->time_base.num,
-                                              AV_ROUND_DOWN);
-                    if (duration != 0 && s->packet_buffer)
-                        update_initial_durations(s, st, pkt->stream_index,
-                                                 duration);
-                }
-            }
-
-            if (pkt->pts != AV_NOPTS_VALUE || pkt->dts != AV_NOPTS_VALUE ||
-                duration) {
-                /* presentation is not delayed : PTS and DTS are the same */
-                if (pkt->pts == AV_NOPTS_VALUE)
-                    pkt->pts = pkt->dts;
-                update_initial_timestamps(s, pkt->stream_index, pkt->pts,
-                                          pkt->pts);
-                if (pkt->pts == AV_NOPTS_VALUE)
-                    pkt->pts = st->cur_dts;
-                pkt->dts = pkt->pts;
-                if (pkt->pts != AV_NOPTS_VALUE)
-                    st->cur_dts = pkt->pts + duration;
-            }
-        }
-    }
-
-    if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY) {
-        st->pts_buffer[0] = pkt->pts;
-        for (i = 0; i<delay && st->pts_buffer[i] > st->pts_buffer[i + 1]; i++)
-            FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i + 1]);
-        if (pkt->dts == AV_NOPTS_VALUE)
-            pkt->dts = st->pts_buffer[0];
-        // We skipped it above so we try here.
-        if (st->codec->codec_id == AV_CODEC_ID_H264)
-            // This should happen on the first packet
-            update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts);
-        if (pkt->dts > st->cur_dts)
-            st->cur_dts = pkt->dts;
-    }
-
-    av_dlog(NULL,
-            "OUTdelayed:%d/%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64"\n",
-            presentation_delayed, delay, pkt->pts, pkt->dts, st->cur_dts);
-
-    /* update flags */
-    if (is_intra_only(st->codec->codec_id))
-        pkt->flags |= AV_PKT_FLAG_KEY;
-    if (pc)
-        pkt->convergence_duration = pc->convergence_duration;
-}
-
-static void free_packet_buffer(AVPacketList **pkt_buf, AVPacketList **pkt_buf_end)
-{
-    while (*pkt_buf) {
-        AVPacketList *pktl = *pkt_buf;
-        *pkt_buf = pktl->next;
-        av_free_packet(&pktl->pkt);
-        av_freep(&pktl);
-    }
-    *pkt_buf_end = NULL;
-}
-
-/**
- * Parse a packet, add all split parts to parse_queue.
- *
- * @param pkt Packet to parse, NULL when flushing the parser at end of stream.
- */
-static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
-{
-    AVPacket out_pkt = { 0 }, flush_pkt = { 0 };
-    AVStream *st = s->streams[stream_index];
-    uint8_t *data = pkt ? pkt->data : NULL;
-    int size      = pkt ? pkt->size : 0;
-    int ret = 0, got_output = 0;
-
-    if (!pkt) {
-        av_init_packet(&flush_pkt);
-        pkt        = &flush_pkt;
-        got_output = 1;
-    }
-
-    while (size > 0 || (pkt == &flush_pkt && got_output)) {
-        int len;
-
-        av_init_packet(&out_pkt);
-        len = av_parser_parse2(st->parser, st->codec,
-                               &out_pkt.data, &out_pkt.size, data, size,
-                               pkt->pts, pkt->dts, pkt->pos);
-
-        pkt->pts = pkt->dts = AV_NOPTS_VALUE;
-        /* increment read pointer */
-        data += len;
-        size -= len;
-
-        got_output = !!out_pkt.size;
-
-        if (!out_pkt.size)
-            continue;
-
-        if (pkt->side_data) {
-            out_pkt.side_data       = pkt->side_data;
-            out_pkt.side_data_elems = pkt->side_data_elems;
-            pkt->side_data          = NULL;
-            pkt->side_data_elems    = 0;
-        }
-
-        /* set the duration */
-        out_pkt.duration = 0;
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (st->codec->sample_rate > 0) {
-                out_pkt.duration =
-                    av_rescale_q_rnd(st->parser->duration,
-                                     (AVRational) { 1, st->codec->sample_rate },
-                                     st->time_base,
-                                     AV_ROUND_DOWN);
-            }
-        } else if (st->codec->time_base.num != 0 &&
-                   st->codec->time_base.den != 0) {
-            out_pkt.duration = av_rescale_q_rnd(st->parser->duration,
-                                                st->codec->time_base,
-                                                st->time_base,
-                                                AV_ROUND_DOWN);
-        }
-
-        out_pkt.stream_index = st->index;
-        out_pkt.pts          = st->parser->pts;
-        out_pkt.dts          = st->parser->dts;
-        out_pkt.pos          = st->parser->pos;
-
-        if (st->parser->key_frame == 1 ||
-            (st->parser->key_frame == -1 &&
-             st->parser->pict_type == AV_PICTURE_TYPE_I))
-            out_pkt.flags |= AV_PKT_FLAG_KEY;
-
-        compute_pkt_fields(s, st, st->parser, &out_pkt);
-
-        if ((s->iformat->flags & AVFMT_GENERIC_INDEX) &&
-            out_pkt.flags & AV_PKT_FLAG_KEY) {
-            ff_reduce_index(s, st->index);
-            av_add_index_entry(st, st->parser->frame_offset, out_pkt.dts,
-                               0, 0, AVINDEX_KEYFRAME);
-        }
-
-        if (out_pkt.data == pkt->data && out_pkt.size == pkt->size) {
-            out_pkt.buf = pkt->buf;
-            pkt->buf    = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-            out_pkt.destruct = pkt->destruct;
-            pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-        }
-        if ((ret = av_dup_packet(&out_pkt)) < 0)
-            goto fail;
-
-        if (!add_to_pktbuf(&s->parse_queue, &out_pkt, &s->parse_queue_end)) {
-            av_free_packet(&out_pkt);
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-    }
-
-    /* end of the stream => close and free the parser */
-    if (pkt == &flush_pkt) {
-        av_parser_close(st->parser);
-        st->parser = NULL;
-    }
-
-fail:
-    av_free_packet(pkt);
-    return ret;
-}
-
-static int read_from_packet_buffer(AVPacketList **pkt_buffer,
-                                   AVPacketList **pkt_buffer_end,
-                                   AVPacket      *pkt)
-{
-    AVPacketList *pktl;
-    av_assert0(*pkt_buffer);
-    pktl        = *pkt_buffer;
-    *pkt        = pktl->pkt;
-    *pkt_buffer = pktl->next;
-    if (!pktl->next)
-        *pkt_buffer_end = NULL;
-    av_freep(&pktl);
-    return 0;
-}
-
-static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret = 0, i, got_packet = 0;
-
-    av_init_packet(pkt);
-
-    while (!got_packet && !s->parse_queue) {
-        AVStream *st;
-        AVPacket cur_pkt;
-
-        /* read next packet */
-        ret = ff_read_packet(s, &cur_pkt);
-        if (ret < 0) {
-            if (ret == AVERROR(EAGAIN))
-                return ret;
-            /* flush the parsers */
-            for (i = 0; i < s->nb_streams; i++) {
-                st = s->streams[i];
-                if (st->parser && st->need_parsing)
-                    parse_packet(s, NULL, st->index);
-            }
-            /* all remaining packets are now in parse_queue =>
-             * really terminate parsing */
-            break;
-        }
-        ret = 0;
-        st  = s->streams[cur_pkt.stream_index];
-
-        if (cur_pkt.pts != AV_NOPTS_VALUE &&
-            cur_pkt.dts != AV_NOPTS_VALUE &&
-            cur_pkt.pts < cur_pkt.dts) {
-            av_log(s, AV_LOG_WARNING,
-                   "Invalid timestamps stream=%d, pts=%"PRId64", "
-                   "dts=%"PRId64", size=%d\n",
-                   cur_pkt.stream_index, cur_pkt.pts,
-                   cur_pkt.dts, cur_pkt.size);
-        }
-        if (s->debug & FF_FDEBUG_TS)
-            av_log(s, AV_LOG_DEBUG,
-                   "ff_read_packet stream=%d, pts=%"PRId64", dts=%"PRId64", "
-                   "size=%d, duration=%d, flags=%d\n",
-                   cur_pkt.stream_index, cur_pkt.pts, cur_pkt.dts,
-                   cur_pkt.size, cur_pkt.duration, cur_pkt.flags);
-
-        if (st->need_parsing && !st->parser && !(s->flags & AVFMT_FLAG_NOPARSE)) {
-            st->parser = av_parser_init(st->codec->codec_id);
-            if (!st->parser)
-                /* no parser available: just output the raw packets */
-                st->need_parsing = AVSTREAM_PARSE_NONE;
-            else if (st->need_parsing == AVSTREAM_PARSE_HEADERS)
-                st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
-            else if (st->need_parsing == AVSTREAM_PARSE_FULL_ONCE)
-                st->parser->flags |= PARSER_FLAG_ONCE;
-        }
-
-        if (!st->need_parsing || !st->parser) {
-            /* no parsing needed: we just output the packet as is */
-            *pkt = cur_pkt;
-            compute_pkt_fields(s, st, NULL, pkt);
-            if ((s->iformat->flags & AVFMT_GENERIC_INDEX) &&
-                (pkt->flags & AV_PKT_FLAG_KEY) && pkt->dts != AV_NOPTS_VALUE) {
-                ff_reduce_index(s, st->index);
-                av_add_index_entry(st, pkt->pos, pkt->dts,
-                                   0, 0, AVINDEX_KEYFRAME);
-            }
-            got_packet = 1;
-        } else if (st->discard < AVDISCARD_ALL) {
-            if ((ret = parse_packet(s, &cur_pkt, cur_pkt.stream_index)) < 0)
-                return ret;
-        } else {
-            /* free packet */
-            av_free_packet(&cur_pkt);
-        }
-    }
-
-    if (!got_packet && s->parse_queue)
-        ret = read_from_packet_buffer(&s->parse_queue, &s->parse_queue_end, pkt);
-
-    if (s->debug & FF_FDEBUG_TS)
-        av_log(s, AV_LOG_DEBUG,
-               "read_frame_internal stream=%d, pts=%"PRId64", dts=%"PRId64", "
-               "size=%d, duration=%d, flags=%d\n",
-               pkt->stream_index, pkt->pts, pkt->dts,
-               pkt->size, pkt->duration, pkt->flags);
-
-    return ret;
-}
-
-int av_read_frame(AVFormatContext *s, AVPacket *pkt)
-{
-    const int genpts = s->flags & AVFMT_FLAG_GENPTS;
-    int eof = 0;
-
-    if (!genpts)
-        return s->packet_buffer
-               ? read_from_packet_buffer(&s->packet_buffer,
-                                         &s->packet_buffer_end, pkt)
-               : read_frame_internal(s, pkt);
-
-    for (;;) {
-        int ret;
-        AVPacketList *pktl = s->packet_buffer;
-
-        if (pktl) {
-            AVPacket *next_pkt = &pktl->pkt;
-
-            if (next_pkt->dts != AV_NOPTS_VALUE) {
-                int wrap_bits = s->streams[next_pkt->stream_index]->pts_wrap_bits;
-                while (pktl && next_pkt->pts == AV_NOPTS_VALUE) {
-                    if (pktl->pkt.stream_index == next_pkt->stream_index &&
-                        (av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2LL << (wrap_bits - 1)) < 0) &&
-                         av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2LL << (wrap_bits - 1))) {
-                        // not B-frame
-                        next_pkt->pts = pktl->pkt.dts;
-                    }
-                    pktl = pktl->next;
-                }
-                pktl = s->packet_buffer;
-            }
-
-            /* read packet from packet buffer, if there is data */
-            if (!(next_pkt->pts == AV_NOPTS_VALUE &&
-                  next_pkt->dts != AV_NOPTS_VALUE && !eof))
-                return read_from_packet_buffer(&s->packet_buffer,
-                                               &s->packet_buffer_end, pkt);
-        }
-
-        ret = read_frame_internal(s, pkt);
-        if (ret < 0) {
-            if (pktl && ret != AVERROR(EAGAIN)) {
-                eof = 1;
-                continue;
-            } else
-                return ret;
-        }
-
-        if (av_dup_packet(add_to_pktbuf(&s->packet_buffer, pkt,
-                                        &s->packet_buffer_end)) < 0)
-            return AVERROR(ENOMEM);
-    }
-}
-
-/* XXX: suppress the packet queue */
-static void flush_packet_queue(AVFormatContext *s)
-{
-    free_packet_buffer(&s->parse_queue,       &s->parse_queue_end);
-    free_packet_buffer(&s->packet_buffer,     &s->packet_buffer_end);
-    free_packet_buffer(&s->raw_packet_buffer, &s->raw_packet_buffer_end);
-
-    s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
-}
-
-/*******************************************************/
-/* seek support */
-
-int av_find_default_stream_index(AVFormatContext *s)
-{
-    int first_audio_index = -1;
-    int i;
-    AVStream *st;
-
-    if (s->nb_streams <= 0)
-        return -1;
-    for (i = 0; i < s->nb_streams; i++) {
-        st = s->streams[i];
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
-            !(st->disposition & AV_DISPOSITION_ATTACHED_PIC)) {
-            return i;
-        }
-        if (first_audio_index < 0 &&
-            st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
-            first_audio_index = i;
-    }
-    return first_audio_index >= 0 ? first_audio_index : 0;
-}
-
-/** Flush the frame reader. */
-void ff_read_frame_flush(AVFormatContext *s)
-{
-    AVStream *st;
-    int i, j;
-
-    flush_packet_queue(s);
-
-    /* Reset read state for each stream. */
-    for (i = 0; i < s->nb_streams; i++) {
-        st = s->streams[i];
-
-        if (st->parser) {
-            av_parser_close(st->parser);
-            st->parser = NULL;
-        }
-        st->last_IP_pts = AV_NOPTS_VALUE;
-        /* We set the current DTS to an unspecified origin. */
-        st->cur_dts     = AV_NOPTS_VALUE;
-
-        st->probe_packets = MAX_PROBE_PACKETS;
-
-        for (j = 0; j < MAX_REORDER_DELAY + 1; j++)
-            st->pts_buffer[j] = AV_NOPTS_VALUE;
-    }
-}
-
-void ff_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
-{
-    int i;
-
-    for (i = 0; i < s->nb_streams; i++) {
-        AVStream *st = s->streams[i];
-
-        st->cur_dts =
-            av_rescale(timestamp,
-                       st->time_base.den * (int64_t) ref_st->time_base.num,
-                       st->time_base.num * (int64_t) ref_st->time_base.den);
-    }
-}
-
-void ff_reduce_index(AVFormatContext *s, int stream_index)
-{
-    AVStream *st             = s->streams[stream_index];
-    unsigned int max_entries = s->max_index_size / sizeof(AVIndexEntry);
-
-    if ((unsigned) st->nb_index_entries >= max_entries) {
-        int i;
-        for (i = 0; 2 * i < st->nb_index_entries; i++)
-            st->index_entries[i] = st->index_entries[2 * i];
-        st->nb_index_entries = i;
-    }
-}
-
-int ff_add_index_entry(AVIndexEntry **index_entries,
-                       int *nb_index_entries,
-                       unsigned int *index_entries_allocated_size,
-                       int64_t pos, int64_t timestamp,
-                       int size, int distance, int flags)
-{
-    AVIndexEntry *entries, *ie;
-    int index;
-
-    if ((unsigned) *nb_index_entries + 1 >= UINT_MAX / sizeof(AVIndexEntry))
-        return -1;
-
-    entries = av_fast_realloc(*index_entries,
-                              index_entries_allocated_size,
-                              (*nb_index_entries + 1) *
-                              sizeof(AVIndexEntry));
-    if (!entries)
-        return -1;
-
-    *index_entries = entries;
-
-    index = ff_index_search_timestamp(*index_entries, *nb_index_entries,
-                                      timestamp, AVSEEK_FLAG_ANY);
-
-    if (index < 0) {
-        index = (*nb_index_entries)++;
-        ie    = &entries[index];
-        assert(index == 0 || ie[-1].timestamp < timestamp);
-    } else {
-        ie = &entries[index];
-        if (ie->timestamp != timestamp) {
-            if (ie->timestamp <= timestamp)
-                return -1;
-            memmove(entries + index + 1, entries + index,
-                    sizeof(AVIndexEntry) * (*nb_index_entries - index));
-            (*nb_index_entries)++;
-        } else if (ie->pos == pos && distance < ie->min_distance)
-            // do not reduce the distance
-            distance = ie->min_distance;
-    }
-
-    ie->pos          = pos;
-    ie->timestamp    = timestamp;
-    ie->min_distance = distance;
-    ie->size         = size;
-    ie->flags        = flags;
-
-    return index;
-}
-
-int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
-                       int size, int distance, int flags)
-{
-    return ff_add_index_entry(&st->index_entries, &st->nb_index_entries,
-                              &st->index_entries_allocated_size, pos,
-                              timestamp, size, distance, flags);
-}
-
-int ff_index_search_timestamp(const AVIndexEntry *entries, int nb_entries,
-                              int64_t wanted_timestamp, int flags)
-{
-    int a, b, m;
-    int64_t timestamp;
-
-    a = -1;
-    b = nb_entries;
-
-    // Optimize appending index entries at the end.
-    if (b && entries[b - 1].timestamp < wanted_timestamp)
-        a = b - 1;
-
-    while (b - a > 1) {
-        m         = (a + b) >> 1;
-        timestamp = entries[m].timestamp;
-        if (timestamp >= wanted_timestamp)
-            b = m;
-        if (timestamp <= wanted_timestamp)
-            a = m;
-    }
-    m = (flags & AVSEEK_FLAG_BACKWARD) ? a : b;
-
-    if (!(flags & AVSEEK_FLAG_ANY))
-        while (m >= 0 && m < nb_entries &&
-               !(entries[m].flags & AVINDEX_KEYFRAME))
-            m += (flags & AVSEEK_FLAG_BACKWARD) ? -1 : 1;
-
-    if (m == nb_entries)
-        return -1;
-    return m;
-}
-
-int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp, int flags)
-{
-    return ff_index_search_timestamp(st->index_entries, st->nb_index_entries,
-                                     wanted_timestamp, flags);
-}
-
-int ff_seek_frame_binary(AVFormatContext *s, int stream_index,
-                         int64_t target_ts, int flags)
-{
-    AVInputFormat *avif = s->iformat;
-    int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit;
-    int64_t ts_min, ts_max, ts;
-    int index;
-    int64_t ret;
-    AVStream *st;
-
-    if (stream_index < 0)
-        return -1;
-
-    av_dlog(s, "read_seek: %d %"PRId64"\n", stream_index, target_ts);
-
-    ts_max =
-    ts_min = AV_NOPTS_VALUE;
-    pos_limit = -1; // GCC falsely says it may be uninitialized.
-
-    st = s->streams[stream_index];
-    if (st->index_entries) {
-        AVIndexEntry *e;
-
-        /* FIXME: Whole function must be checked for non-keyframe entries in
-         * index case, especially read_timestamp(). */
-        index = av_index_search_timestamp(st, target_ts,
-                                          flags | AVSEEK_FLAG_BACKWARD);
-        index = FFMAX(index, 0);
-        e     = &st->index_entries[index];
-
-        if (e->timestamp <= target_ts || e->pos == e->min_distance) {
-            pos_min = e->pos;
-            ts_min  = e->timestamp;
-            av_dlog(s, "using cached pos_min=0x%"PRIx64" dts_min=%"PRId64"\n",
-                    pos_min, ts_min);
-        } else {
-            assert(index == 0);
-        }
-
-        index = av_index_search_timestamp(st, target_ts,
-                                          flags & ~AVSEEK_FLAG_BACKWARD);
-        assert(index < st->nb_index_entries);
-        if (index >= 0) {
-            e = &st->index_entries[index];
-            assert(e->timestamp >= target_ts);
-            pos_max   = e->pos;
-            ts_max    = e->timestamp;
-            pos_limit = pos_max - e->min_distance;
-            av_dlog(s, "using cached pos_max=0x%"PRIx64" pos_limit=0x%"PRIx64
-                    " dts_max=%"PRId64"\n", pos_max, pos_limit, ts_max);
-        }
-    }
-
-    pos = ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, pos_limit,
-                        ts_min, ts_max, flags, &ts, avif->read_timestamp);
-    if (pos < 0)
-        return -1;
-
-    /* do the seek */
-    if ((ret = avio_seek(s->pb, pos, SEEK_SET)) < 0)
-        return ret;
-
-    ff_update_cur_dts(s, st, ts);
-
-    return 0;
-}
-
-int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
-                      int64_t pos_min, int64_t pos_max, int64_t pos_limit,
-                      int64_t ts_min, int64_t ts_max,
-                      int flags, int64_t *ts_ret,
-                      int64_t (*read_timestamp)(struct AVFormatContext *, int,
-                                                int64_t *, int64_t))
-{
-    int64_t pos, ts;
-    int64_t start_pos, filesize;
-    int no_change;
-
-    av_dlog(s, "gen_seek: %d %"PRId64"\n", stream_index, target_ts);
-
-    if (ts_min == AV_NOPTS_VALUE) {
-        pos_min = s->data_offset;
-        ts_min  = read_timestamp(s, stream_index, &pos_min, INT64_MAX);
-        if (ts_min == AV_NOPTS_VALUE)
-            return -1;
-    }
-
-    if (ts_max == AV_NOPTS_VALUE) {
-        int step = 1024;
-        filesize = avio_size(s->pb);
-        pos_max  = filesize - 1;
-        do {
-            pos_max -= step;
-            ts_max   = read_timestamp(s, stream_index, &pos_max,
-                                      pos_max + step);
-            step    += step;
-        } while (ts_max == AV_NOPTS_VALUE && pos_max >= step);
-        if (ts_max == AV_NOPTS_VALUE)
-            return -1;
-
-        for (;;) {
-            int64_t tmp_pos = pos_max + 1;
-            int64_t tmp_ts  = read_timestamp(s, stream_index,
-                                             &tmp_pos, INT64_MAX);
-            if (tmp_ts == AV_NOPTS_VALUE)
-                break;
-            ts_max  = tmp_ts;
-            pos_max = tmp_pos;
-            if (tmp_pos >= filesize)
-                break;
-        }
-        pos_limit = pos_max;
-    }
-
-    if (ts_min > ts_max)
-        return -1;
-    else if (ts_min == ts_max)
-        pos_limit = pos_min;
-
-    no_change = 0;
-    while (pos_min < pos_limit) {
-        av_dlog(s, "pos_min=0x%"PRIx64" pos_max=0x%"PRIx64" dts_min=%"PRId64
-                " dts_max=%"PRId64"\n", pos_min, pos_max, ts_min, ts_max);
-        assert(pos_limit <= pos_max);
-
-        if (no_change == 0) {
-            int64_t approximate_keyframe_distance = pos_max - pos_limit;
-            // interpolate position (better than dichotomy)
-            pos = av_rescale(target_ts - ts_min, pos_max - pos_min,
-                             ts_max - ts_min) +
-                  pos_min - approximate_keyframe_distance;
-        } else if (no_change == 1) {
-            // bisection if interpolation did not change min / max pos last time
-            pos = (pos_min + pos_limit) >> 1;
-        } else {
-            /* linear search if bisection failed, can only happen if there
-             * are very few or no keyframes between min/max */
-            pos = pos_min;
-        }
-        if (pos <= pos_min)
-            pos = pos_min + 1;
-        else if (pos > pos_limit)
-            pos = pos_limit;
-        start_pos = pos;
-
-        // May pass pos_limit instead of -1.
-        ts = read_timestamp(s, stream_index, &pos, INT64_MAX);
-        if (pos == pos_max)
-            no_change++;
-        else
-            no_change = 0;
-        av_dlog(s, "%"PRId64" %"PRId64" %"PRId64" / %"PRId64" %"PRId64" %"PRId64
-                " target:%"PRId64" limit:%"PRId64" start:%"PRId64" noc:%d\n",
-                pos_min, pos, pos_max, ts_min, ts, ts_max, target_ts,
-                pos_limit, start_pos, no_change);
-        if (ts == AV_NOPTS_VALUE) {
-            av_log(s, AV_LOG_ERROR, "read_timestamp() failed in the middle\n");
-            return -1;
-        }
-        assert(ts != AV_NOPTS_VALUE);
-        if (target_ts <= ts) {
-            pos_limit = start_pos - 1;
-            pos_max   = pos;
-            ts_max    = ts;
-        }
-        if (target_ts >= ts) {
-            pos_min = pos;
-            ts_min  = ts;
-        }
-    }
-
-    pos     = (flags & AVSEEK_FLAG_BACKWARD) ? pos_min : pos_max;
-    ts      = (flags & AVSEEK_FLAG_BACKWARD) ? ts_min  : ts_max;
-    pos_min = pos;
-    ts_min  = read_timestamp(s, stream_index, &pos_min, INT64_MAX);
-    pos_min++;
-    ts_max = read_timestamp(s, stream_index, &pos_min, INT64_MAX);
-    av_dlog(s, "pos=0x%"PRIx64" %"PRId64"<=%"PRId64"<=%"PRId64"\n",
-            pos, ts_min, target_ts, ts_max);
-    *ts_ret = ts;
-    return pos;
-}
-
-static int seek_frame_byte(AVFormatContext *s, int stream_index,
-                           int64_t pos, int flags)
-{
-    int64_t pos_min, pos_max;
-
-    pos_min = s->data_offset;
-    pos_max = avio_size(s->pb) - 1;
-
-    if (pos < pos_min)
-        pos = pos_min;
-    else if (pos > pos_max)
-        pos = pos_max;
-
-    avio_seek(s->pb, pos, SEEK_SET);
-
-    return 0;
-}
-
-static int seek_frame_generic(AVFormatContext *s, int stream_index,
-                              int64_t timestamp, int flags)
-{
-    int index;
-    int64_t ret;
-    AVStream *st;
-    AVIndexEntry *ie;
-
-    st = s->streams[stream_index];
-
-    index = av_index_search_timestamp(st, timestamp, flags);
-
-    if (index < 0 && st->nb_index_entries &&
-        timestamp < st->index_entries[0].timestamp)
-        return -1;
-
-    if (index < 0 || index == st->nb_index_entries - 1) {
-        AVPacket pkt;
-
-        if (st->nb_index_entries) {
-            assert(st->index_entries);
-            ie = &st->index_entries[st->nb_index_entries - 1];
-            if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
-                return ret;
-            ff_update_cur_dts(s, st, ie->timestamp);
-        } else {
-            if ((ret = avio_seek(s->pb, s->data_offset, SEEK_SET)) < 0)
-                return ret;
-        }
-        for (;;) {
-            int read_status;
-            do {
-                read_status = av_read_frame(s, &pkt);
-            } while (read_status == AVERROR(EAGAIN));
-            if (read_status < 0)
-                break;
-            av_free_packet(&pkt);
-            if (stream_index == pkt.stream_index)
-                if ((pkt.flags & AV_PKT_FLAG_KEY) && pkt.dts > timestamp)
-                    break;
-        }
-        index = av_index_search_timestamp(st, timestamp, flags);
-    }
-    if (index < 0)
-        return -1;
-
-    ff_read_frame_flush(s);
-    if (s->iformat->read_seek)
-        if (s->iformat->read_seek(s, stream_index, timestamp, flags) >= 0)
-            return 0;
-    ie = &st->index_entries[index];
-    if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
-        return ret;
-    ff_update_cur_dts(s, st, ie->timestamp);
-
-    return 0;
-}
-
-static int seek_frame_internal(AVFormatContext *s, int stream_index,
-                               int64_t timestamp, int flags)
-{
-    int ret;
-    AVStream *st;
-
-    if (flags & AVSEEK_FLAG_BYTE) {
-        if (s->iformat->flags & AVFMT_NO_BYTE_SEEK)
-            return -1;
-        ff_read_frame_flush(s);
-        return seek_frame_byte(s, stream_index, timestamp, flags);
-    }
-
-    if (stream_index < 0) {
-        stream_index = av_find_default_stream_index(s);
-        if (stream_index < 0)
-            return -1;
-
-        st = s->streams[stream_index];
-        /* timestamp for default must be expressed in AV_TIME_BASE units */
-        timestamp = av_rescale(timestamp, st->time_base.den,
-                               AV_TIME_BASE * (int64_t) st->time_base.num);
-    }
-
-    /* first, we try the format specific seek */
-    if (s->iformat->read_seek) {
-        ff_read_frame_flush(s);
-        ret = s->iformat->read_seek(s, stream_index, timestamp, flags);
-    } else
-        ret = -1;
-    if (ret >= 0)
-        return 0;
-
-    if (s->iformat->read_timestamp &&
-        !(s->iformat->flags & AVFMT_NOBINSEARCH)) {
-        ff_read_frame_flush(s);
-        return ff_seek_frame_binary(s, stream_index, timestamp, flags);
-    } else if (!(s->iformat->flags & AVFMT_NOGENSEARCH)) {
-        ff_read_frame_flush(s);
-        return seek_frame_generic(s, stream_index, timestamp, flags);
-    } else
-        return -1;
-}
-
-int av_seek_frame(AVFormatContext *s, int stream_index,
-                  int64_t timestamp, int flags)
-{
-    int ret = seek_frame_internal(s, stream_index, timestamp, flags);
-
-    if (ret >= 0)
-        ret = queue_attached_pictures(s);
-
-    return ret;
-}
-
-int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts,
-                       int64_t ts, int64_t max_ts, int flags)
-{
-    if (min_ts > ts || max_ts < ts)
-        return -1;
-
-    if (s->iformat->read_seek2) {
-        int ret;
-        ff_read_frame_flush(s);
-        ret = s->iformat->read_seek2(s, stream_index, min_ts,
-                                     ts, max_ts, flags);
-
-        if (ret >= 0)
-            ret = queue_attached_pictures(s);
-        return ret;
-    }
-
-    if (s->iformat->read_timestamp) {
-        // try to seek via read_timestamp()
-    }
-
-    // Fall back on old API if new is not implemented but old is.
-    // Note the old API has somewhat different semantics.
-    if (s->iformat->read_seek || 1)
-        return av_seek_frame(s, stream_index, ts,
-                             flags | ((uint64_t) ts - min_ts >
-                                      (uint64_t) max_ts - ts
-                                      ? AVSEEK_FLAG_BACKWARD : 0));
-
-    // try some generic seek like seek_frame_generic() but with new ts semantics
-}
-
-/*******************************************************/
-
-/**
- * Return TRUE if the stream has accurate duration in any stream.
- *
- * @return TRUE if the stream has accurate duration for at least one component.
- */
-static int has_duration(AVFormatContext *ic)
-{
-    int i;
-    AVStream *st;
-
-    for (i = 0; i < ic->nb_streams; i++) {
-        st = ic->streams[i];
-        if (st->duration != AV_NOPTS_VALUE)
-            return 1;
-    }
-    if (ic->duration != AV_NOPTS_VALUE)
-        return 1;
-    return 0;
-}
-
-/**
- * Estimate the stream timings from the one of each components.
- *
- * Also computes the global bitrate if possible.
- */
-static void update_stream_timings(AVFormatContext *ic)
-{
-    int64_t start_time, start_time1, end_time, end_time1;
-    int64_t duration, duration1, filesize;
-    int i;
-    AVStream *st;
-
-    start_time = INT64_MAX;
-    end_time   = INT64_MIN;
-    duration   = INT64_MIN;
-    for (i = 0; i < ic->nb_streams; i++) {
-        st = ic->streams[i];
-        if (st->start_time != AV_NOPTS_VALUE && st->time_base.den) {
-            start_time1 = av_rescale_q(st->start_time, st->time_base,
-                                       AV_TIME_BASE_Q);
-            start_time  = FFMIN(start_time, start_time1);
-            if (st->duration != AV_NOPTS_VALUE) {
-                end_time1 = start_time1 +
-                            av_rescale_q(st->duration, st->time_base,
-                                         AV_TIME_BASE_Q);
-                end_time = FFMAX(end_time, end_time1);
-            }
-        }
-        if (st->duration != AV_NOPTS_VALUE) {
-            duration1 = av_rescale_q(st->duration, st->time_base,
-                                     AV_TIME_BASE_Q);
-            duration  = FFMAX(duration, duration1);
-        }
-    }
-    if (start_time != INT64_MAX) {
-        ic->start_time = start_time;
-        if (end_time != INT64_MIN)
-            duration = FFMAX(duration, end_time - start_time);
-    }
-    if (duration != INT64_MIN) {
-        ic->duration = duration;
-        if (ic->pb && (filesize = avio_size(ic->pb)) > 0)
-            /* compute the bitrate */
-            ic->bit_rate = (double) filesize * 8.0 * AV_TIME_BASE /
-                           (double) ic->duration;
-    }
-}
-
-static void fill_all_stream_timings(AVFormatContext *ic)
-{
-    int i;
-    AVStream *st;
-
-    update_stream_timings(ic);
-    for (i = 0; i < ic->nb_streams; i++) {
-        st = ic->streams[i];
-        if (st->start_time == AV_NOPTS_VALUE) {
-            if (ic->start_time != AV_NOPTS_VALUE)
-                st->start_time = av_rescale_q(ic->start_time, AV_TIME_BASE_Q,
-                                              st->time_base);
-            if (ic->duration != AV_NOPTS_VALUE)
-                st->duration = av_rescale_q(ic->duration, AV_TIME_BASE_Q,
-                                            st->time_base);
-        }
-    }
-}
-
-static void estimate_timings_from_bit_rate(AVFormatContext *ic)
-{
-    int64_t filesize, duration;
-    int i;
-    AVStream *st;
-
-    /* if bit_rate is already set, we believe it */
-    if (ic->bit_rate <= 0) {
-        int bit_rate = 0;
-        for (i = 0; i < ic->nb_streams; i++) {
-            st = ic->streams[i];
-            if (st->codec->bit_rate > 0) {
-                if (INT_MAX - st->codec->bit_rate < bit_rate) {
-                    bit_rate = 0;
-                    break;
-                }
-                bit_rate += st->codec->bit_rate;
-            }
-        }
-        ic->bit_rate = bit_rate;
-    }
-
-    /* if duration is already set, we believe it */
-    if (ic->duration == AV_NOPTS_VALUE &&
-        ic->bit_rate != 0) {
-        filesize = ic->pb ? avio_size(ic->pb) : 0;
-        if (filesize > 0) {
-            for (i = 0; i < ic->nb_streams; i++) {
-                st       = ic->streams[i];
-                duration = av_rescale(8 * filesize, st->time_base.den,
-                                      ic->bit_rate *
-                                      (int64_t) st->time_base.num);
-                if (st->duration == AV_NOPTS_VALUE)
-                    st->duration = duration;
-            }
-        }
-    }
-}
-
-#define DURATION_MAX_READ_SIZE 250000
-#define DURATION_MAX_RETRY 3
-
-/* only usable for MPEG-PS streams */
-static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
-{
-    AVPacket pkt1, *pkt = &pkt1;
-    AVStream *st;
-    int read_size, i, ret;
-    int64_t end_time;
-    int64_t filesize, offset, duration;
-    int retry = 0;
-
-    /* flush packet queue */
-    flush_packet_queue(ic);
-
-    for (i = 0; i < ic->nb_streams; i++) {
-        st = ic->streams[i];
-        if (st->start_time == AV_NOPTS_VALUE && st->first_dts == AV_NOPTS_VALUE)
-            av_log(st->codec, AV_LOG_WARNING,
-                   "start time is not set in estimate_timings_from_pts\n");
-
-        if (st->parser) {
-            av_parser_close(st->parser);
-            st->parser = NULL;
-        }
-    }
-
-    /* estimate the end time (duration) */
-    /* XXX: may need to support wrapping */
-    filesize = ic->pb ? avio_size(ic->pb) : 0;
-    end_time = AV_NOPTS_VALUE;
-    do {
-        offset = filesize - (DURATION_MAX_READ_SIZE << retry);
-        if (offset < 0)
-            offset = 0;
-
-        avio_seek(ic->pb, offset, SEEK_SET);
-        read_size = 0;
-        for (;;) {
-            if (read_size >= DURATION_MAX_READ_SIZE << (FFMAX(retry - 1, 0)))
-                break;
-
-            do {
-                ret = ff_read_packet(ic, pkt);
-            } while (ret == AVERROR(EAGAIN));
-            if (ret != 0)
-                break;
-            read_size += pkt->size;
-            st         = ic->streams[pkt->stream_index];
-            if (pkt->pts != AV_NOPTS_VALUE &&
-                (st->start_time != AV_NOPTS_VALUE ||
-                 st->first_dts  != AV_NOPTS_VALUE)) {
-                duration = end_time = pkt->pts;
-                if (st->start_time != AV_NOPTS_VALUE)
-                    duration -= st->start_time;
-                else
-                    duration -= st->first_dts;
-                if (duration < 0)
-                    duration += 1LL << st->pts_wrap_bits;
-                if (duration > 0) {
-                    if (st->duration == AV_NOPTS_VALUE || st->duration < duration)
-                        st->duration = duration;
-                }
-            }
-            av_free_packet(pkt);
-        }
-    } while (end_time == AV_NOPTS_VALUE &&
-             filesize > (DURATION_MAX_READ_SIZE << retry) &&
-             ++retry <= DURATION_MAX_RETRY);
-
-    fill_all_stream_timings(ic);
-
-    avio_seek(ic->pb, old_offset, SEEK_SET);
-    for (i = 0; i < ic->nb_streams; i++) {
-        st              = ic->streams[i];
-        st->cur_dts     = st->first_dts;
-        st->last_IP_pts = AV_NOPTS_VALUE;
-    }
-}
-
-static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
-{
-    int64_t file_size;
-
-    /* get the file size, if possible */
-    if (ic->iformat->flags & AVFMT_NOFILE) {
-        file_size = 0;
-    } else {
-        file_size = avio_size(ic->pb);
-        file_size = FFMAX(0, file_size);
-    }
-
-    if ((!strcmp(ic->iformat->name, "mpeg") ||
-         !strcmp(ic->iformat->name, "mpegts")) &&
-        file_size && ic->pb->seekable) {
-        /* get accurate estimate from the PTSes */
-        estimate_timings_from_pts(ic, old_offset);
-    } else if (has_duration(ic)) {
-        /* at least one component has timings - we use them for all
-         * the components */
-        fill_all_stream_timings(ic);
-    } else {
-        av_log(ic, AV_LOG_WARNING,
-               "Estimating duration from bitrate, this may be inaccurate\n");
-        /* less precise: use bitrate info */
-        estimate_timings_from_bit_rate(ic);
-    }
-    update_stream_timings(ic);
-
-    {
-        int i;
-        AVStream av_unused *st;
-        for (i = 0; i < ic->nb_streams; i++) {
-            st = ic->streams[i];
-            av_dlog(ic, "%d: start_time: %0.3f duration: %0.3f\n", i,
-                    (double) st->start_time / AV_TIME_BASE,
-                    (double) st->duration   / AV_TIME_BASE);
-        }
-        av_dlog(ic,
-                "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
-                (double) ic->start_time / AV_TIME_BASE,
-                (double) ic->duration   / AV_TIME_BASE,
-                ic->bit_rate / 1000);
-    }
-}
-
-static int has_codec_parameters(AVStream *st)
-{
-    AVCodecContext *avctx = st->codec;
-    int val;
-
-    switch (avctx->codec_type) {
-    case AVMEDIA_TYPE_AUDIO:
-        val = avctx->sample_rate && avctx->channels;
-        if (st->info->found_decoder >= 0 &&
-            avctx->sample_fmt == AV_SAMPLE_FMT_NONE)
-            return 0;
-        break;
-    case AVMEDIA_TYPE_VIDEO:
-        val = avctx->width;
-        if (st->info->found_decoder >= 0 && avctx->pix_fmt == AV_PIX_FMT_NONE)
-            return 0;
-        break;
-    default:
-        val = 1;
-        break;
-    }
-    return avctx->codec_id != AV_CODEC_ID_NONE && val != 0;
-}
-
-static int has_decode_delay_been_guessed(AVStream *st)
-{
-    return st->codec->codec_id != AV_CODEC_ID_H264 ||
-           st->info->nb_decoded_frames >= 6;
-}
-
-/* returns 1 or 0 if or if not decoded data was returned, or a negative error */
-static int try_decode_frame(AVStream *st, AVPacket *avpkt,
-                            AVDictionary **options)
-{
-    const AVCodec *codec;
-    int got_picture = 1, ret = 0;
-    AVFrame *frame = av_frame_alloc();
-    AVPacket pkt = *avpkt;
-
-    if (!frame)
-        return AVERROR(ENOMEM);
-
-    if (!avcodec_is_open(st->codec) && !st->info->found_decoder) {
-        AVDictionary *thread_opt = NULL;
-
-        codec = st->codec->codec ? st->codec->codec
-                                 : avcodec_find_decoder(st->codec->codec_id);
-
-        if (!codec) {
-            st->info->found_decoder = -1;
-            ret                     = -1;
-            goto fail;
-        }
-
-        /* Force thread count to 1 since the H.264 decoder will not extract
-         * SPS and PPS to extradata during multi-threaded decoding. */
-        av_dict_set(options ? options : &thread_opt, "threads", "1", 0);
-        ret = avcodec_open2(st->codec, codec, options ? options : &thread_opt);
-        if (!options)
-            av_dict_free(&thread_opt);
-        if (ret < 0) {
-            st->info->found_decoder = -1;
-            goto fail;
-        }
-        st->info->found_decoder = 1;
-    } else if (!st->info->found_decoder)
-        st->info->found_decoder = 1;
-
-    if (st->info->found_decoder < 0) {
-        ret = -1;
-        goto fail;
-    }
-
-    while ((pkt.size > 0 || (!pkt.data && got_picture)) &&
-           ret >= 0 &&
-           (!has_codec_parameters(st) || !has_decode_delay_been_guessed(st) ||
-            (!st->codec_info_nb_frames &&
-             st->codec->codec->capabilities & CODEC_CAP_CHANNEL_CONF))) {
-        got_picture = 0;
-        switch (st->codec->codec_type) {
-        case AVMEDIA_TYPE_VIDEO:
-            ret = avcodec_decode_video2(st->codec, frame,
-                                        &got_picture, &pkt);
-            break;
-        case AVMEDIA_TYPE_AUDIO:
-            ret = avcodec_decode_audio4(st->codec, frame, &got_picture, &pkt);
-            break;
-        default:
-            break;
-        }
-        if (ret >= 0) {
-            if (got_picture)
-                st->info->nb_decoded_frames++;
-            pkt.data += ret;
-            pkt.size -= ret;
-            ret       = got_picture;
-        }
-    }
-
-fail:
-    av_frame_free(&frame);
-    return ret;
-}
-
-unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum AVCodecID id)
-{
-    while (tags->id != AV_CODEC_ID_NONE) {
-        if (tags->id == id)
-            return tags->tag;
-        tags++;
-    }
-    return 0;
-}
-
-enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
-{
-    int i;
-    for (i = 0; tags[i].id != AV_CODEC_ID_NONE; i++)
-        if (tag == tags[i].tag)
-            return tags[i].id;
-    for (i = 0; tags[i].id != AV_CODEC_ID_NONE; i++)
-        if (avpriv_toupper4(tag) == avpriv_toupper4(tags[i].tag))
-            return tags[i].id;
-    return AV_CODEC_ID_NONE;
-}
-
-enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags)
-{
-    if (flt) {
-        switch (bps) {
-        case 32:
-            return be ? AV_CODEC_ID_PCM_F32BE : AV_CODEC_ID_PCM_F32LE;
-        case 64:
-            return be ? AV_CODEC_ID_PCM_F64BE : AV_CODEC_ID_PCM_F64LE;
-        default:
-            return AV_CODEC_ID_NONE;
-        }
-    } else {
-        bps >>= 3;
-        if (sflags & (1 << (bps - 1))) {
-            switch (bps) {
-            case 1:
-                return AV_CODEC_ID_PCM_S8;
-            case 2:
-                return be ? AV_CODEC_ID_PCM_S16BE : AV_CODEC_ID_PCM_S16LE;
-            case 3:
-                return be ? AV_CODEC_ID_PCM_S24BE : AV_CODEC_ID_PCM_S24LE;
-            case 4:
-                return be ? AV_CODEC_ID_PCM_S32BE : AV_CODEC_ID_PCM_S32LE;
-            default:
-                return AV_CODEC_ID_NONE;
-            }
-        } else {
-            switch (bps) {
-            case 1:
-                return AV_CODEC_ID_PCM_U8;
-            case 2:
-                return be ? AV_CODEC_ID_PCM_U16BE : AV_CODEC_ID_PCM_U16LE;
-            case 3:
-                return be ? AV_CODEC_ID_PCM_U24BE : AV_CODEC_ID_PCM_U24LE;
-            case 4:
-                return be ? AV_CODEC_ID_PCM_U32BE : AV_CODEC_ID_PCM_U32LE;
-            default:
-                return AV_CODEC_ID_NONE;
-            }
-        }
-    }
-}
-
-unsigned int av_codec_get_tag(const AVCodecTag *const *tags, enum AVCodecID id)
-{
-    int i;
-    for (i = 0; tags && tags[i]; i++) {
-        int tag = ff_codec_get_tag(tags[i], id);
-        if (tag)
-            return tag;
-    }
-    return 0;
-}
-
-enum AVCodecID av_codec_get_id(const AVCodecTag *const *tags, unsigned int tag)
-{
-    int i;
-    for (i = 0; tags && tags[i]; i++) {
-        enum AVCodecID id = ff_codec_get_id(tags[i], tag);
-        if (id != AV_CODEC_ID_NONE)
-            return id;
-    }
-    return AV_CODEC_ID_NONE;
-}
-
-static void compute_chapters_end(AVFormatContext *s)
-{
-    unsigned int i, j;
-    int64_t max_time = s->duration +
-                       ((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);
-
-    for (i = 0; i < s->nb_chapters; i++)
-        if (s->chapters[i]->end == AV_NOPTS_VALUE) {
-            AVChapter *ch = s->chapters[i];
-            int64_t end = max_time ? av_rescale_q(max_time, AV_TIME_BASE_Q,
-                                                  ch->time_base)
-                                   : INT64_MAX;
-
-            for (j = 0; j < s->nb_chapters; j++) {
-                AVChapter *ch1     = s->chapters[j];
-                int64_t next_start = av_rescale_q(ch1->start, ch1->time_base,
-                                                  ch->time_base);
-                if (j != i && next_start > ch->start && next_start < end)
-                    end = next_start;
-            }
-            ch->end = (end == INT64_MAX) ? ch->start : end;
-        }
-}
-
-static int get_std_framerate(int i)
-{
-    if (i < 60 * 12)
-        return (i + 1) * 1001;
-    else
-        return ((const int[]) { 24, 30, 60, 12, 15 })[i - 60 * 12] * 1000 * 12;
-}
-
-/* Is the time base unreliable?
- * This is a heuristic to balance between quick acceptance of the values in
- * the headers vs. some extra checks.
- * Old DivX and Xvid often have nonsense timebases like 1fps or 2fps.
- * MPEG-2 commonly misuses field repeat flags to store different framerates.
- * And there are "variable" fps files this needs to detect as well. */
-static int tb_unreliable(AVCodecContext *c)
-{
-    if (c->time_base.den >= 101L * c->time_base.num ||
-        c->time_base.den <    5L * c->time_base.num ||
-        // c->codec_tag == AV_RL32("DIVX") ||
-        // c->codec_tag == AV_RL32("XVID") ||
-        c->codec_id == AV_CODEC_ID_MPEG2VIDEO ||
-        c->codec_id == AV_CODEC_ID_H264)
-        return 1;
-    return 0;
-}
-
-int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
-{
-    int i, count, ret, read_size, j;
-    AVStream *st;
-    AVPacket pkt1, *pkt;
-    int64_t old_offset  = avio_tell(ic->pb);
-    // new streams might appear, no options for those
-    int orig_nb_streams = ic->nb_streams;
-
-    for (i = 0; i < ic->nb_streams; i++) {
-        const AVCodec *codec;
-        AVDictionary *thread_opt = NULL;
-        st = ic->streams[i];
-
-        // only for the split stuff
-        if (!st->parser && !(ic->flags & AVFMT_FLAG_NOPARSE)) {
-            st->parser = av_parser_init(st->codec->codec_id);
-            if (st->need_parsing == AVSTREAM_PARSE_HEADERS && st->parser)
-                st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
-        }
-        codec = st->codec->codec ? st->codec->codec
-                                 : avcodec_find_decoder(st->codec->codec_id);
-
-        /* Force thread count to 1 since the H.264 decoder will not extract
-         * SPS and PPS to extradata during multi-threaded decoding. */
-        av_dict_set(options ? &options[i] : &thread_opt, "threads", "1", 0);
-
-        /* Ensure that subtitle_header is properly set. */
-        if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
-            && codec && !st->codec->codec)
-            avcodec_open2(st->codec, codec,
-                          options ? &options[i] : &thread_opt);
-
-        // Try to just open decoders, in case this is enough to get parameters.
-        if (!has_codec_parameters(st)) {
-            if (codec && !st->codec->codec)
-                avcodec_open2(st->codec, codec,
-                              options ? &options[i] : &thread_opt);
-        }
-        if (!options)
-            av_dict_free(&thread_opt);
-    }
-
-    for (i = 0; i < ic->nb_streams; i++) {
-        ic->streams[i]->info->fps_first_dts = AV_NOPTS_VALUE;
-        ic->streams[i]->info->fps_last_dts  = AV_NOPTS_VALUE;
-    }
-
-    count     = 0;
-    read_size = 0;
-    for (;;) {
-        if (ff_check_interrupt(&ic->interrupt_callback)) {
-            ret = AVERROR_EXIT;
-            av_log(ic, AV_LOG_DEBUG, "interrupted\n");
-            break;
-        }
-
-        /* check if one codec still needs to be handled */
-        for (i = 0; i < ic->nb_streams; i++) {
-            int fps_analyze_framecount = 20;
-
-            st = ic->streams[i];
-            if (!has_codec_parameters(st))
-                break;
-            /* If the timebase is coarse (like the usual millisecond precision
-             * of mkv), we need to analyze more frames to reliably arrive at
-             * the correct fps. */
-            if (av_q2d(st->time_base) > 0.0005)
-                fps_analyze_framecount *= 2;
-            if (ic->fps_probe_size >= 0)
-                fps_analyze_framecount = ic->fps_probe_size;
-            /* variable fps and no guess at the real fps */
-            if (tb_unreliable(st->codec) && !st->avg_frame_rate.num &&
-                st->codec_info_nb_frames < fps_analyze_framecount &&
-                st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-                break;
-            if (st->parser && st->parser->parser->split &&
-                !st->codec->extradata)
-                break;
-            if (st->first_dts == AV_NOPTS_VALUE &&
-                (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
-                 st->codec->codec_type == AVMEDIA_TYPE_AUDIO))
-                break;
-        }
-        if (i == ic->nb_streams) {
-            /* NOTE: If the format has no header, then we need to read some
-             * packets to get most of the streams, so we cannot stop here. */
-            if (!(ic->ctx_flags & AVFMTCTX_NOHEADER)) {
-                /* If we found the info for all the codecs, we can stop. */
-                ret = count;
-                av_log(ic, AV_LOG_DEBUG, "All info found\n");
-                break;
-            }
-        }
-        /* We did not get all the codec info, but we read too much data. */
-        if (read_size >= ic->probesize) {
-            ret = count;
-            av_log(ic, AV_LOG_DEBUG,
-                   "Probe buffer size limit %d reached\n", ic->probesize);
-            break;
-        }
-
-        /* NOTE: A new stream can be added there if no header in file
-         * (AVFMTCTX_NOHEADER). */
-        ret = read_frame_internal(ic, &pkt1);
-        if (ret == AVERROR(EAGAIN))
-            continue;
-
-        if (ret < 0) {
-            /* EOF or error*/
-            AVPacket empty_pkt = { 0 };
-            int err = 0;
-            av_init_packet(&empty_pkt);
-
-            /* We could not have all the codec parameters before EOF. */
-            ret = -1;
-            for (i = 0; i < ic->nb_streams; i++) {
-                st = ic->streams[i];
-
-                /* flush the decoders */
-                if (st->info->found_decoder == 1) {
-                    do {
-                        err = try_decode_frame(st, &empty_pkt,
-                                               (options && i < orig_nb_streams)
-                                               ? &options[i] : NULL);
-                    } while (err > 0 && !has_codec_parameters(st));
-                }
-
-                if (err < 0) {
-                    av_log(ic, AV_LOG_WARNING,
-                           "decoding for stream %d failed\n", st->index);
-                } else if (!has_codec_parameters(st)) {
-                    char buf[256];
-                    avcodec_string(buf, sizeof(buf), st->codec, 0);
-                    av_log(ic, AV_LOG_WARNING,
-                           "Could not find codec parameters (%s)\n", buf);
-                } else {
-                    ret = 0;
-                }
-            }
-            break;
-        }
-
-        if (ic->flags & AVFMT_FLAG_NOBUFFER) {
-            pkt = &pkt1;
-        } else {
-            pkt = add_to_pktbuf(&ic->packet_buffer, &pkt1,
-                                &ic->packet_buffer_end);
-            if ((ret = av_dup_packet(pkt)) < 0)
-                goto find_stream_info_err;
-        }
-
-        read_size += pkt->size;
-
-        st = ic->streams[pkt->stream_index];
-        if (pkt->dts != AV_NOPTS_VALUE && st->codec_info_nb_frames > 1) {
-            /* check for non-increasing dts */
-            if (st->info->fps_last_dts != AV_NOPTS_VALUE &&
-                st->info->fps_last_dts >= pkt->dts) {
-                av_log(ic, AV_LOG_WARNING,
-                       "Non-increasing DTS in stream %d: packet %d with DTS "
-                       "%"PRId64", packet %d with DTS %"PRId64"\n",
-                       st->index, st->info->fps_last_dts_idx,
-                       st->info->fps_last_dts, st->codec_info_nb_frames,
-                       pkt->dts);
-                st->info->fps_first_dts =
-                st->info->fps_last_dts  = AV_NOPTS_VALUE;
-            }
-            /* Check for a discontinuity in dts. If the difference in dts
-             * is more than 1000 times the average packet duration in the
-             * sequence, we treat it as a discontinuity. */
-            if (st->info->fps_last_dts != AV_NOPTS_VALUE &&
-                st->info->fps_last_dts_idx > st->info->fps_first_dts_idx &&
-                (pkt->dts - st->info->fps_last_dts) / 1000 >
-                (st->info->fps_last_dts     - st->info->fps_first_dts) /
-                (st->info->fps_last_dts_idx - st->info->fps_first_dts_idx)) {
-                av_log(ic, AV_LOG_WARNING,
-                       "DTS discontinuity in stream %d: packet %d with DTS "
-                       "%"PRId64", packet %d with DTS %"PRId64"\n",
-                       st->index, st->info->fps_last_dts_idx,
-                       st->info->fps_last_dts, st->codec_info_nb_frames,
-                       pkt->dts);
-                st->info->fps_first_dts =
-                st->info->fps_last_dts  = AV_NOPTS_VALUE;
-            }
-
-            /* update stored dts values */
-            if (st->info->fps_first_dts == AV_NOPTS_VALUE) {
-                st->info->fps_first_dts     = pkt->dts;
-                st->info->fps_first_dts_idx = st->codec_info_nb_frames;
-            }
-            st->info->fps_last_dts     = pkt->dts;
-            st->info->fps_last_dts_idx = st->codec_info_nb_frames;
-
-            /* check max_analyze_duration */
-            if (av_rescale_q(pkt->dts - st->info->fps_first_dts, st->time_base,
-                             AV_TIME_BASE_Q) >= ic->max_analyze_duration) {
-                av_log(ic, AV_LOG_WARNING, "max_analyze_duration reached\n");
-                break;
-            }
-        }
-        if (st->parser && st->parser->parser->split && !st->codec->extradata) {
-            int i = st->parser->parser->split(st->codec, pkt->data, pkt->size);
-            if (i > 0 && i < FF_MAX_EXTRADATA_SIZE) {
-                st->codec->extradata_size = i;
-                st->codec->extradata = av_malloc(st->codec->extradata_size +
-                                                 FF_INPUT_BUFFER_PADDING_SIZE);
-                if (!st->codec->extradata)
-                    return AVERROR(ENOMEM);
-                memcpy(st->codec->extradata, pkt->data,
-                       st->codec->extradata_size);
-                memset(st->codec->extradata + i, 0,
-                       FF_INPUT_BUFFER_PADDING_SIZE);
-            }
-        }
-
-        /* If still no information, we try to open the codec and to
-         * decompress the frame. We try to avoid that in most cases as
-         * it takes longer and uses more memory. For MPEG-4, we need to
-         * decompress for QuickTime.
-         *
-         * If CODEC_CAP_CHANNEL_CONF is set this will force decoding of at
-         * least one frame of codec data, this makes sure the codec initializes
-         * the channel configuration and does not only trust the values from
-         * the container. */
-        try_decode_frame(st, pkt,
-                         (options && i < orig_nb_streams) ? &options[i] : NULL);
-
-        st->codec_info_nb_frames++;
-        count++;
-    }
-
-    // close codecs which were opened in try_decode_frame()
-    for (i = 0; i < ic->nb_streams; i++) {
-        st = ic->streams[i];
-        avcodec_close(st->codec);
-    }
-    for (i = 0; i < ic->nb_streams; i++) {
-        st = ic->streams[i];
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            /* estimate average framerate if not set by demuxer */
-            if (!st->avg_frame_rate.num &&
-                st->info->fps_last_dts != st->info->fps_first_dts) {
-                int64_t delta_dts = st->info->fps_last_dts -
-                                    st->info->fps_first_dts;
-                int delta_packets = st->info->fps_last_dts_idx -
-                                    st->info->fps_first_dts_idx;
-                int best_fps      = 0;
-                double best_error = 0.01;
-
-                if (delta_dts     >= INT64_MAX / st->time_base.num ||
-                    delta_packets >= INT64_MAX / st->time_base.den ||
-                    delta_dts < 0)
-                    continue;
-                av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
-                          delta_packets * (int64_t) st->time_base.den,
-                          delta_dts * (int64_t) st->time_base.num, 60000);
-
-                /* Round guessed framerate to a "standard" framerate if it's
-                 * within 1% of the original estimate. */
-                for (j = 0; j < MAX_STD_TIMEBASES; j++) {
-                    AVRational std_fps = { get_std_framerate(j), 12 * 1001 };
-                    double error       = fabs(av_q2d(st->avg_frame_rate) /
-                                              av_q2d(std_fps) - 1);
-
-                    if (error < best_error) {
-                        best_error = error;
-                        best_fps   = std_fps.num;
-                    }
-                }
-                if (best_fps)
-                    av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
-                              best_fps, 12 * 1001, INT_MAX);
-            }
-        } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (!st->codec->bits_per_coded_sample)
-                st->codec->bits_per_coded_sample =
-                    av_get_bits_per_sample(st->codec->codec_id);
-            // set stream disposition based on audio service type
-            switch (st->codec->audio_service_type) {
-            case AV_AUDIO_SERVICE_TYPE_EFFECTS:
-                st->disposition = AV_DISPOSITION_CLEAN_EFFECTS;
-                break;
-            case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED:
-                st->disposition = AV_DISPOSITION_VISUAL_IMPAIRED;
-                break;
-            case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED:
-                st->disposition = AV_DISPOSITION_HEARING_IMPAIRED;
-                break;
-            case AV_AUDIO_SERVICE_TYPE_COMMENTARY:
-                st->disposition = AV_DISPOSITION_COMMENT;
-                break;
-            case AV_AUDIO_SERVICE_TYPE_KARAOKE:
-                st->disposition = AV_DISPOSITION_KARAOKE;
-                break;
-            }
-        }
-    }
-
-    estimate_timings(ic, old_offset);
-
-    compute_chapters_end(ic);
-
-find_stream_info_err:
-    for (i = 0; i < ic->nb_streams; i++) {
-        ic->streams[i]->codec->thread_count = 0;
-        av_freep(&ic->streams[i]->info);
-    }
-    return ret;
-}
-
-static AVProgram *find_program_from_stream(AVFormatContext *ic, int s)
-{
-    int i, j;
-
-    for (i = 0; i < ic->nb_programs; i++)
-        for (j = 0; j < ic->programs[i]->nb_stream_indexes; j++)
-            if (ic->programs[i]->stream_index[j] == s)
-                return ic->programs[i];
-    return NULL;
-}
-
-int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
-                        int wanted_stream_nb, int related_stream,
-                        AVCodec **decoder_ret, int flags)
-{
-    int i, nb_streams = ic->nb_streams;
-    int ret = AVERROR_STREAM_NOT_FOUND, best_count = -1;
-    unsigned *program = NULL;
-    AVCodec *decoder = NULL, *best_decoder = NULL;
-
-    if (related_stream >= 0 && wanted_stream_nb < 0) {
-        AVProgram *p = find_program_from_stream(ic, related_stream);
-        if (p) {
-            program    = p->stream_index;
-            nb_streams = p->nb_stream_indexes;
-        }
-    }
-    for (i = 0; i < nb_streams; i++) {
-        int real_stream_index = program ? program[i] : i;
-        AVStream *st          = ic->streams[real_stream_index];
-        AVCodecContext *avctx = st->codec;
-        if (avctx->codec_type != type)
-            continue;
-        if (wanted_stream_nb >= 0 && real_stream_index != wanted_stream_nb)
-            continue;
-        if (st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED |
-                               AV_DISPOSITION_VISUAL_IMPAIRED))
-            continue;
-        if (decoder_ret) {
-            decoder = avcodec_find_decoder(st->codec->codec_id);
-            if (!decoder) {
-                if (ret < 0)
-                    ret = AVERROR_DECODER_NOT_FOUND;
-                continue;
-            }
-        }
-        if (best_count >= st->codec_info_nb_frames)
-            continue;
-        best_count   = st->codec_info_nb_frames;
-        ret          = real_stream_index;
-        best_decoder = decoder;
-        if (program && i == nb_streams - 1 && ret < 0) {
-            program    = NULL;
-            nb_streams = ic->nb_streams;
-            /* no related stream found, try again with everything */
-            i = 0;
-        }
-    }
-    if (decoder_ret)
-        *decoder_ret = best_decoder;
-    return ret;
-}
-
-/*******************************************************/
-
-int av_read_play(AVFormatContext *s)
-{
-    if (s->iformat->read_play)
-        return s->iformat->read_play(s);
-    if (s->pb)
-        return avio_pause(s->pb, 0);
-    return AVERROR(ENOSYS);
-}
-
-int av_read_pause(AVFormatContext *s)
-{
-    if (s->iformat->read_pause)
-        return s->iformat->read_pause(s);
-    if (s->pb)
-        return avio_pause(s->pb, 1);
-    return AVERROR(ENOSYS);
-}
-
-void avformat_free_context(AVFormatContext *s)
-{
-    int i;
-    AVStream *st;
-
-    av_opt_free(s);
-    if (s->iformat && s->iformat->priv_class && s->priv_data)
-        av_opt_free(s->priv_data);
-
-    for (i = 0; i < s->nb_streams; i++) {
-        /* free all data in a stream component */
-        st = s->streams[i];
-        if (st->parser) {
-            av_parser_close(st->parser);
-        }
-        if (st->attached_pic.data)
-            av_free_packet(&st->attached_pic);
-        av_dict_free(&st->metadata);
-        av_freep(&st->probe_data.buf);
-        av_free(st->index_entries);
-        av_free(st->codec->extradata);
-        av_free(st->codec->subtitle_header);
-        av_free(st->codec);
-        av_free(st->priv_data);
-        av_free(st->info);
-        av_free(st);
-    }
-    for (i = s->nb_programs - 1; i >= 0; i--) {
-        av_dict_free(&s->programs[i]->metadata);
-        av_freep(&s->programs[i]->stream_index);
-        av_freep(&s->programs[i]);
-    }
-    av_freep(&s->programs);
-    av_freep(&s->priv_data);
-    while (s->nb_chapters--) {
-        av_dict_free(&s->chapters[s->nb_chapters]->metadata);
-        av_free(s->chapters[s->nb_chapters]);
-    }
-    av_freep(&s->chapters);
-    av_dict_free(&s->metadata);
-    av_freep(&s->streams);
-    av_freep(&s->internal);
-    av_free(s);
-}
-
-void avformat_close_input(AVFormatContext **ps)
-{
-    AVFormatContext *s = *ps;
-    AVIOContext *pb    = s->pb;
-
-    if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
-        (s->flags & AVFMT_FLAG_CUSTOM_IO))
-        pb = NULL;
-
-    flush_packet_queue(s);
-
-    if (s->iformat)
-        if (s->iformat->read_close)
-            s->iformat->read_close(s);
-
-    avformat_free_context(s);
-
-    *ps = NULL;
-
-    avio_close(pb);
-}
-
-AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)
-{
-    AVStream *st;
-    int i;
-
-    if (av_reallocp_array(&s->streams, s->nb_streams + 1,
-                          sizeof(*s->streams)) < 0) {
-        s->nb_streams = 0;
-        return NULL;
-    }
-
-    st = av_mallocz(sizeof(AVStream));
-    if (!st)
-        return NULL;
-    if (!(st->info = av_mallocz(sizeof(*st->info)))) {
-        av_free(st);
-        return NULL;
-    }
-
-    st->codec = avcodec_alloc_context3(c);
-    if (s->iformat)
-        /* no default bitrate if decoding */
-        st->codec->bit_rate = 0;
-    st->index      = s->nb_streams;
-    st->start_time = AV_NOPTS_VALUE;
-    st->duration   = AV_NOPTS_VALUE;
-    /* we set the current DTS to 0 so that formats without any timestamps
-     * but durations get some timestamps, formats with some unknown
-     * timestamps have their first few packets buffered and the
-     * timestamps corrected before they are returned to the user */
-    st->cur_dts       = 0;
-    st->first_dts     = AV_NOPTS_VALUE;
-    st->probe_packets = MAX_PROBE_PACKETS;
-
-    /* default pts setting is MPEG-like */
-    avpriv_set_pts_info(st, 33, 1, 90000);
-    st->last_IP_pts = AV_NOPTS_VALUE;
-    for (i = 0; i < MAX_REORDER_DELAY + 1; i++)
-        st->pts_buffer[i] = AV_NOPTS_VALUE;
-
-    st->sample_aspect_ratio = (AVRational) { 0, 1 };
-
-    st->info->fps_first_dts = AV_NOPTS_VALUE;
-    st->info->fps_last_dts  = AV_NOPTS_VALUE;
-
-    s->streams[s->nb_streams++] = st;
-    return st;
-}
-
-AVProgram *av_new_program(AVFormatContext *ac, int id)
-{
-    AVProgram *program = NULL;
-    int i;
-
-    av_dlog(ac, "new_program: id=0x%04x\n", id);
-
-    for (i = 0; i < ac->nb_programs; i++)
-        if (ac->programs[i]->id == id)
-            program = ac->programs[i];
-
-    if (!program) {
-        program = av_mallocz(sizeof(AVProgram));
-        if (!program)
-            return NULL;
-        dynarray_add(&ac->programs, &ac->nb_programs, program);
-        program->discard = AVDISCARD_NONE;
-    }
-    program->id = id;
-
-    return program;
-}
-
-AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base,
-                              int64_t start, int64_t end, const char *title)
-{
-    AVChapter *chapter = NULL;
-    int i;
-
-    for (i = 0; i < s->nb_chapters; i++)
-        if (s->chapters[i]->id == id)
-            chapter = s->chapters[i];
-
-    if (!chapter) {
-        chapter = av_mallocz(sizeof(AVChapter));
-        if (!chapter)
-            return NULL;
-        dynarray_add(&s->chapters, &s->nb_chapters, chapter);
-    }
-    av_dict_set(&chapter->metadata, "title", title, 0);
-    chapter->id        = id;
-    chapter->time_base = time_base;
-    chapter->start     = start;
-    chapter->end       = end;
-
-    return chapter;
-}
-
-void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned idx)
-{
-    int i, j;
-    AVProgram *program = NULL;
-
-    if (idx >= ac->nb_streams) {
-        av_log(ac, AV_LOG_ERROR, "stream index %d is not valid\n", idx);
-        return;
-    }
-
-    for (i = 0; i < ac->nb_programs; i++) {
-        if (ac->programs[i]->id != progid)
-            continue;
-        program = ac->programs[i];
-        for (j = 0; j < program->nb_stream_indexes; j++)
-            if (program->stream_index[j] == idx)
-                return;
-
-        if (av_reallocp_array(&program->stream_index,
-                              program->nb_stream_indexes + 1,
-                              sizeof(*program->stream_index)) < 0) {
-            program->nb_stream_indexes = 0;
-            return;
-        }
-        program->stream_index[program->nb_stream_indexes++] = idx;
-        return;
-    }
-}
-
-static void print_fps(double d, const char *postfix)
-{
-    uint64_t v = lrintf(d * 100);
-    if (v % 100)
-        av_log(NULL, AV_LOG_INFO, ", %3.2f %s", d, postfix);
-    else if (v % (100 * 1000))
-        av_log(NULL, AV_LOG_INFO, ", %1.0f %s", d, postfix);
-    else
-        av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d / 1000, postfix);
-}
-
-static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
-{
-    if (m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 0))) {
-        AVDictionaryEntry *tag = NULL;
-
-        av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
-        while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX)))
-            if (strcmp("language", tag->key))
-                av_log(ctx, AV_LOG_INFO,
-                       "%s  %-16s: %s\n", indent, tag->key, tag->value);
-    }
-}
-
-/* "user interface" functions */
-static void dump_stream_format(AVFormatContext *ic, int i,
-                               int index, int is_output)
-{
-    char buf[256];
-    int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
-    AVStream *st = ic->streams[i];
-    int g = av_gcd(st->time_base.num, st->time_base.den);
-    AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
-    avcodec_string(buf, sizeof(buf), st->codec, is_output);
-    av_log(NULL, AV_LOG_INFO, "    Stream #%d.%d", index, i);
-    /* the pid is an important information, so we display it */
-    /* XXX: add a generic system */
-    if (flags & AVFMT_SHOW_IDS)
-        av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id);
-    if (lang)
-        av_log(NULL, AV_LOG_INFO, "(%s)", lang->value);
-    av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames,
-           st->time_base.num / g, st->time_base.den / g);
-    av_log(NULL, AV_LOG_INFO, ": %s", buf);
-    if (st->sample_aspect_ratio.num && // default
-        av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
-        AVRational display_aspect_ratio;
-        av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
-                  st->codec->width  * st->sample_aspect_ratio.num,
-                  st->codec->height * st->sample_aspect_ratio.den,
-                  1024 * 1024);
-        av_log(NULL, AV_LOG_INFO, ", PAR %d:%d DAR %d:%d",
-               st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
-               display_aspect_ratio.num, display_aspect_ratio.den);
-    }
-    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-        if (st->avg_frame_rate.den && st->avg_frame_rate.num)
-            print_fps(av_q2d(st->avg_frame_rate), "fps");
-        if (st->time_base.den && st->time_base.num)
-            print_fps(1 / av_q2d(st->time_base), "tbn");
-        if (st->codec->time_base.den && st->codec->time_base.num)
-            print_fps(1 / av_q2d(st->codec->time_base), "tbc");
-    }
-    if (st->disposition & AV_DISPOSITION_DEFAULT)
-        av_log(NULL, AV_LOG_INFO, " (default)");
-    if (st->disposition & AV_DISPOSITION_DUB)
-        av_log(NULL, AV_LOG_INFO, " (dub)");
-    if (st->disposition & AV_DISPOSITION_ORIGINAL)
-        av_log(NULL, AV_LOG_INFO, " (original)");
-    if (st->disposition & AV_DISPOSITION_COMMENT)
-        av_log(NULL, AV_LOG_INFO, " (comment)");
-    if (st->disposition & AV_DISPOSITION_LYRICS)
-        av_log(NULL, AV_LOG_INFO, " (lyrics)");
-    if (st->disposition & AV_DISPOSITION_KARAOKE)
-        av_log(NULL, AV_LOG_INFO, " (karaoke)");
-    if (st->disposition & AV_DISPOSITION_FORCED)
-        av_log(NULL, AV_LOG_INFO, " (forced)");
-    if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
-        av_log(NULL, AV_LOG_INFO, " (hearing impaired)");
-    if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
-        av_log(NULL, AV_LOG_INFO, " (visual impaired)");
-    if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
-        av_log(NULL, AV_LOG_INFO, " (clean effects)");
-    av_log(NULL, AV_LOG_INFO, "\n");
-    dump_metadata(NULL, st->metadata, "    ");
-}
-
-void av_dump_format(AVFormatContext *ic, int index,
-                    const char *url, int is_output)
-{
-    int i;
-    uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL;
-    if (ic->nb_streams && !printed)
-        return;
-
-    av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
-           is_output ? "Output" : "Input",
-           index,
-           is_output ? ic->oformat->name : ic->iformat->name,
-           is_output ? "to" : "from", url);
-    dump_metadata(NULL, ic->metadata, "  ");
-    if (!is_output) {
-        av_log(NULL, AV_LOG_INFO, "  Duration: ");
-        if (ic->duration != AV_NOPTS_VALUE) {
-            int hours, mins, secs, us;
-            secs  = ic->duration / AV_TIME_BASE;
-            us    = ic->duration % AV_TIME_BASE;
-            mins  = secs / 60;
-            secs %= 60;
-            hours = mins / 60;
-            mins %= 60;
-            av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%02d", hours, mins, secs,
-                   (100 * us) / AV_TIME_BASE);
-        } else {
-            av_log(NULL, AV_LOG_INFO, "N/A");
-        }
-        if (ic->start_time != AV_NOPTS_VALUE) {
-            int secs, us;
-            av_log(NULL, AV_LOG_INFO, ", start: ");
-            secs = ic->start_time / AV_TIME_BASE;
-            us   = abs(ic->start_time % AV_TIME_BASE);
-            av_log(NULL, AV_LOG_INFO, "%d.%06d",
-                   secs, (int) av_rescale(us, 1000000, AV_TIME_BASE));
-        }
-        av_log(NULL, AV_LOG_INFO, ", bitrate: ");
-        if (ic->bit_rate)
-            av_log(NULL, AV_LOG_INFO, "%d kb/s", ic->bit_rate / 1000);
-        else
-            av_log(NULL, AV_LOG_INFO, "N/A");
-        av_log(NULL, AV_LOG_INFO, "\n");
-    }
-    for (i = 0; i < ic->nb_chapters; i++) {
-        AVChapter *ch = ic->chapters[i];
-        av_log(NULL, AV_LOG_INFO, "    Chapter #%d.%d: ", index, i);
-        av_log(NULL, AV_LOG_INFO,
-               "start %f, ", ch->start * av_q2d(ch->time_base));
-        av_log(NULL, AV_LOG_INFO,
-               "end %f\n", ch->end * av_q2d(ch->time_base));
-
-        dump_metadata(NULL, ch->metadata, "    ");
-    }
-    if (ic->nb_programs) {
-        int j, k, total = 0;
-        for (j = 0; j < ic->nb_programs; j++) {
-            AVDictionaryEntry *name = av_dict_get(ic->programs[j]->metadata,
-                                                  "name", NULL, 0);
-            av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", ic->programs[j]->id,
-                   name ? name->value : "");
-            dump_metadata(NULL, ic->programs[j]->metadata, "    ");
-            for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {
-                dump_stream_format(ic, ic->programs[j]->stream_index[k],
-                                   index, is_output);
-                printed[ic->programs[j]->stream_index[k]] = 1;
-            }
-            total += ic->programs[j]->nb_stream_indexes;
-        }
-        if (total < ic->nb_streams)
-            av_log(NULL, AV_LOG_INFO, "  No Program\n");
-    }
-    for (i = 0; i < ic->nb_streams; i++)
-        if (!printed[i])
-            dump_stream_format(ic, i, index, is_output);
-
-    av_free(printed);
-}
-
-uint64_t ff_ntp_time(void)
-{
-    return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US;
-}
-
-int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
-{
-    const char *p;
-    char *q, buf1[20], c;
-    int nd, len, percentd_found;
-
-    q = buf;
-    p = path;
-    percentd_found = 0;
-    for (;;) {
-        c = *p++;
-        if (c == '\0')
-            break;
-        if (c == '%') {
-            do {
-                nd = 0;
-                while (av_isdigit(*p))
-                    nd = nd * 10 + *p++ - '0';
-                c = *p++;
-            } while (av_isdigit(c));
-
-            switch (c) {
-            case '%':
-                goto addchar;
-            case 'd':
-                if (percentd_found)
-                    goto fail;
-                percentd_found = 1;
-                snprintf(buf1, sizeof(buf1), "%0*d", nd, number);
-                len = strlen(buf1);
-                if ((q - buf + len) > buf_size - 1)
-                    goto fail;
-                memcpy(q, buf1, len);
-                q += len;
-                break;
-            default:
-                goto fail;
-            }
-        } else {
-addchar:
-            if ((q - buf) < buf_size - 1)
-                *q++ = c;
-        }
-    }
-    if (!percentd_found)
-        goto fail;
-    *q = '\0';
-    return 0;
-fail:
-    *q = '\0';
-    return -1;
-}
-
-#define HEXDUMP_PRINT(...)                      \
-    do {                                        \
-        if (!f)                                 \
-            av_log(avcl, level, __VA_ARGS__);   \
-        else                                    \
-            fprintf(f, __VA_ARGS__);            \
-    } while (0)
-
-static void hex_dump_internal(void *avcl, FILE *f, int level,
-                              const uint8_t *buf, int size)
-{
-    int len, i, j, c;
-
-    for (i = 0; i < size; i += 16) {
-        len = size - i;
-        if (len > 16)
-            len = 16;
-        HEXDUMP_PRINT("%08x ", i);
-        for (j = 0; j < 16; j++) {
-            if (j < len)
-                HEXDUMP_PRINT(" %02x", buf[i + j]);
-            else
-                HEXDUMP_PRINT("   ");
-        }
-        HEXDUMP_PRINT(" ");
-        for (j = 0; j < len; j++) {
-            c = buf[i + j];
-            if (c < ' ' || c > '~')
-                c = '.';
-            HEXDUMP_PRINT("%c", c);
-        }
-        HEXDUMP_PRINT("\n");
-    }
-}
-
-void av_hex_dump(FILE *f, const uint8_t *buf, int size)
-{
-    hex_dump_internal(NULL, f, 0, buf, size);
-}
-
-void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
-{
-    hex_dump_internal(avcl, NULL, level, buf, size);
-}
-
-static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt,
-                              int dump_payload, AVRational time_base)
-{
-    HEXDUMP_PRINT("stream #%d:\n", pkt->stream_index);
-    HEXDUMP_PRINT("  keyframe=%d\n", (pkt->flags & AV_PKT_FLAG_KEY) != 0);
-    HEXDUMP_PRINT("  duration=%0.3f\n", pkt->duration * av_q2d(time_base));
-    /* DTS is _always_ valid after av_read_frame() */
-    HEXDUMP_PRINT("  dts=");
-    if (pkt->dts == AV_NOPTS_VALUE)
-        HEXDUMP_PRINT("N/A");
-    else
-        HEXDUMP_PRINT("%0.3f", pkt->dts * av_q2d(time_base));
-    /* PTS may not be known if B-frames are present. */
-    HEXDUMP_PRINT("  pts=");
-    if (pkt->pts == AV_NOPTS_VALUE)
-        HEXDUMP_PRINT("N/A");
-    else
-        HEXDUMP_PRINT("%0.3f", pkt->pts * av_q2d(time_base));
-    HEXDUMP_PRINT("\n");
-    HEXDUMP_PRINT("  size=%d\n", pkt->size);
-    if (dump_payload)
-        av_hex_dump(f, pkt->data, pkt->size);
-}
-
-void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st)
-{
-    pkt_dump_internal(NULL, f, 0, pkt, dump_payload, st->time_base);
-}
-
-void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
-                      AVStream *st)
-{
-    pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base);
-}
-
-void av_url_split(char *proto, int proto_size,
-                  char *authorization, int authorization_size,
-                  char *hostname, int hostname_size,
-                  int *port_ptr, char *path, int path_size, const char *url)
-{
-    const char *p, *ls, *at, *col, *brk;
-
-    if (port_ptr)
-        *port_ptr = -1;
-    if (proto_size > 0)
-        proto[0] = 0;
-    if (authorization_size > 0)
-        authorization[0] = 0;
-    if (hostname_size > 0)
-        hostname[0] = 0;
-    if (path_size > 0)
-        path[0] = 0;
-
-    /* parse protocol */
-    if ((p = strchr(url, ':'))) {
-        av_strlcpy(proto, url, FFMIN(proto_size, p + 1 - url));
-        p++; /* skip ':' */
-        if (*p == '/')
-            p++;
-        if (*p == '/')
-            p++;
-    } else {
-        /* no protocol means plain filename */
-        av_strlcpy(path, url, path_size);
-        return;
-    }
-
-    /* separate path from hostname */
-    ls = strchr(p, '/');
-    if (!ls)
-        ls = strchr(p, '?');
-    if (ls)
-        av_strlcpy(path, ls, path_size);
-    else
-        ls = &p[strlen(p)];  // XXX
-
-    /* the rest is hostname, use that to parse auth/port */
-    if (ls != p) {
-        /* authorization (user[:pass]@hostname) */
-        if ((at = strchr(p, '@')) && at < ls) {
-            av_strlcpy(authorization, p,
-                       FFMIN(authorization_size, at + 1 - p));
-            p = at + 1; /* skip '@' */
-        }
-
-        if (*p == '[' && (brk = strchr(p, ']')) && brk < ls) {
-            /* [host]:port */
-            av_strlcpy(hostname, p + 1,
-                       FFMIN(hostname_size, brk - p));
-            if (brk[1] == ':' && port_ptr)
-                *port_ptr = atoi(brk + 2);
-        } else if ((col = strchr(p, ':')) && col < ls) {
-            av_strlcpy(hostname, p,
-                       FFMIN(col + 1 - p, hostname_size));
-            if (port_ptr)
-                *port_ptr = atoi(col + 1);
-        } else
-            av_strlcpy(hostname, p,
-                       FFMIN(ls + 1 - p, hostname_size));
-    }
-}
-
-char *ff_data_to_hex(char *buff, const uint8_t *src, int s, int lowercase)
-{
-    int i;
-    static const char hex_table_uc[16] = { '0', '1', '2', '3',
-                                           '4', '5', '6', '7',
-                                           '8', '9', 'A', 'B',
-                                           'C', 'D', 'E', 'F' };
-    static const char hex_table_lc[16] = { '0', '1', '2', '3',
-                                           '4', '5', '6', '7',
-                                           '8', '9', 'a', 'b',
-                                           'c', 'd', 'e', 'f' };
-    const char *hex_table = lowercase ? hex_table_lc : hex_table_uc;
-
-    for (i = 0; i < s; i++) {
-        buff[i * 2]     = hex_table[src[i] >> 4];
-        buff[i * 2 + 1] = hex_table[src[i] & 0xF];
-    }
-
-    return buff;
-}
-
-int ff_hex_to_data(uint8_t *data, const char *p)
-{
-    int c, len, v;
-
-    len = 0;
-    v   = 1;
-    for (;;) {
-        p += strspn(p, SPACE_CHARS);
-        if (*p == '\0')
-            break;
-        c = av_toupper((unsigned char) *p++);
-        if (c >= '0' && c <= '9')
-            c = c - '0';
-        else if (c >= 'A' && c <= 'F')
-            c = c - 'A' + 10;
-        else
-            break;
-        v = (v << 4) | c;
-        if (v & 0x100) {
-            if (data)
-                data[len] = v;
-            len++;
-            v = 1;
-        }
-    }
-    return len;
-}
-
-void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits,
-                         unsigned int pts_num, unsigned int pts_den)
-{
-    AVRational new_tb;
-    if (av_reduce(&new_tb.num, &new_tb.den, pts_num, pts_den, INT_MAX)) {
-        if (new_tb.num != pts_num)
-            av_log(NULL, AV_LOG_DEBUG,
-                   "st:%d removing common factor %d from timebase\n",
-                   s->index, pts_num / new_tb.num);
-    } else
-        av_log(NULL, AV_LOG_WARNING,
-               "st:%d has too large timebase, reducing\n", s->index);
-
-    if (new_tb.num <= 0 || new_tb.den <= 0) {
-        av_log(NULL, AV_LOG_ERROR,
-               "Ignoring attempt to set invalid timebase for st:%d\n",
-               s->index);
-        return;
-    }
-    s->time_base     = new_tb;
-    s->pts_wrap_bits = pts_wrap_bits;
-}
-
-void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
-                        void *context)
-{
-    const char *ptr = str;
-
-    /* Parse key=value pairs. */
-    for (;;) {
-        const char *key;
-        char *dest = NULL, *dest_end;
-        int key_len, dest_len = 0;
-
-        /* Skip whitespace and potential commas. */
-        while (*ptr && (av_isspace(*ptr) || *ptr == ','))
-            ptr++;
-        if (!*ptr)
-            break;
-
-        key = ptr;
-
-        if (!(ptr = strchr(key, '=')))
-            break;
-        ptr++;
-        key_len = ptr - key;
-
-        callback_get_buf(context, key, key_len, &dest, &dest_len);
-        dest_end = dest + dest_len - 1;
-
-        if (*ptr == '\"') {
-            ptr++;
-            while (*ptr && *ptr != '\"') {
-                if (*ptr == '\\') {
-                    if (!ptr[1])
-                        break;
-                    if (dest && dest < dest_end)
-                        *dest++ = ptr[1];
-                    ptr += 2;
-                } else {
-                    if (dest && dest < dest_end)
-                        *dest++ = *ptr;
-                    ptr++;
-                }
-            }
-            if (*ptr == '\"')
-                ptr++;
-        } else {
-            for (; *ptr && !(av_isspace(*ptr) || *ptr == ','); ptr++)
-                if (dest && dest < dest_end)
-                    *dest++ = *ptr;
-        }
-        if (dest)
-            *dest = 0;
-    }
-}
-
-int ff_find_stream_index(AVFormatContext *s, int id)
-{
-    int i;
-    for (i = 0; i < s->nb_streams; i++)
-        if (s->streams[i]->id == id)
-            return i;
-    return -1;
-}
-
-int64_t ff_iso8601_to_unix_time(const char *datestr)
-{
-#if HAVE_STRPTIME
-    struct tm time1 = { 0 }, time2 = { 0 };
-    char *ret1, *ret2;
-    ret1 = strptime(datestr, "%Y - %m - %d %T", &time1);
-    ret2 = strptime(datestr, "%Y - %m - %dT%T", &time2);
-    if (ret2 && !ret1)
-        return av_timegm(&time2);
-    else
-        return av_timegm(&time1);
-#else
-    av_log(NULL, AV_LOG_WARNING,
-           "strptime() unavailable on this system, cannot convert "
-           "the date string.\n");
-    return 0;
-#endif
-}
-
-int avformat_query_codec(AVOutputFormat *ofmt, enum AVCodecID codec_id,
-                         int std_compliance)
-{
-    if (ofmt) {
-        if (ofmt->query_codec)
-            return ofmt->query_codec(codec_id, std_compliance);
-        else if (ofmt->codec_tag)
-            return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
-        else if (codec_id == ofmt->video_codec ||
-                 codec_id == ofmt->audio_codec ||
-                 codec_id == ofmt->subtitle_codec)
-            return 1;
-    }
-    return AVERROR_PATCHWELCOME;
-}
-
-int avformat_network_init(void)
-{
-#if CONFIG_NETWORK
-    int ret;
-    ff_network_inited_globally = 1;
-    if ((ret = ff_network_init()) < 0)
-        return ret;
-    ff_tls_init();
-#endif
-    return 0;
-}
-
-int avformat_network_deinit(void)
-{
-#if CONFIG_NETWORK
-    ff_network_close();
-    ff_tls_deinit();
-#endif
-    return 0;
-}
-
-int ff_add_param_change(AVPacket *pkt, int32_t channels,
-                        uint64_t channel_layout, int32_t sample_rate,
-                        int32_t width, int32_t height)
-{
-    uint32_t flags = 0;
-    int size = 4;
-    uint8_t *data;
-    if (!pkt)
-        return AVERROR(EINVAL);
-    if (channels) {
-        size  += 4;
-        flags |= AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT;
-    }
-    if (channel_layout) {
-        size  += 8;
-        flags |= AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT;
-    }
-    if (sample_rate) {
-        size  += 4;
-        flags |= AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE;
-    }
-    if (width || height) {
-        size  += 8;
-        flags |= AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS;
-    }
-    data = av_packet_new_side_data(pkt, AV_PKT_DATA_PARAM_CHANGE, size);
-    if (!data)
-        return AVERROR(ENOMEM);
-    bytestream_put_le32(&data, flags);
-    if (channels)
-        bytestream_put_le32(&data, channels);
-    if (channel_layout)
-        bytestream_put_le64(&data, channel_layout);
-    if (sample_rate)
-        bytestream_put_le32(&data, sample_rate);
-    if (width || height) {
-        bytestream_put_le32(&data, width);
-        bytestream_put_le32(&data, height);
-    }
-    return 0;
-}
-
-int ff_generate_avci_extradata(AVStream *st)
-{
-    static const uint8_t avci100_1080p_extradata[] = {
-        // SPS
-        0x00, 0x00, 0x00, 0x01, 0x67, 0x7a, 0x10, 0x29,
-        0xb6, 0xd4, 0x20, 0x22, 0x33, 0x19, 0xc6, 0x63,
-        0x23, 0x21, 0x01, 0x11, 0x98, 0xce, 0x33, 0x19,
-        0x18, 0x21, 0x02, 0x56, 0xb9, 0x3d, 0x7d, 0x7e,
-        0x4f, 0xe3, 0x3f, 0x11, 0xf1, 0x9e, 0x08, 0xb8,
-        0x8c, 0x54, 0x43, 0xc0, 0x78, 0x02, 0x27, 0xe2,
-        0x70, 0x1e, 0x30, 0x10, 0x10, 0x14, 0x00, 0x00,
-        0x03, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0xca,
-        0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        // PPS
-        0x00, 0x00, 0x00, 0x01, 0x68, 0xce, 0x33, 0x48,
-        0xd0
-    };
-    static const uint8_t avci100_1080i_extradata[] = {
-        // SPS
-        0x00, 0x00, 0x00, 0x01, 0x67, 0x7a, 0x10, 0x29,
-        0xb6, 0xd4, 0x20, 0x22, 0x33, 0x19, 0xc6, 0x63,
-        0x23, 0x21, 0x01, 0x11, 0x98, 0xce, 0x33, 0x19,
-        0x18, 0x21, 0x03, 0x3a, 0x46, 0x65, 0x6a, 0x65,
-        0x24, 0xad, 0xe9, 0x12, 0x32, 0x14, 0x1a, 0x26,
-        0x34, 0xad, 0xa4, 0x41, 0x82, 0x23, 0x01, 0x50,
-        0x2b, 0x1a, 0x24, 0x69, 0x48, 0x30, 0x40, 0x2e,
-        0x11, 0x12, 0x08, 0xc6, 0x8c, 0x04, 0x41, 0x28,
-        0x4c, 0x34, 0xf0, 0x1e, 0x01, 0x13, 0xf2, 0xe0,
-        0x3c, 0x60, 0x20, 0x20, 0x28, 0x00, 0x00, 0x03,
-        0x00, 0x08, 0x00, 0x00, 0x03, 0x01, 0x94, 0x00,
-        // PPS
-        0x00, 0x00, 0x00, 0x01, 0x68, 0xce, 0x33, 0x48,
-        0xd0
-    };
-    static const uint8_t avci50_1080i_extradata[] = {
-        // SPS
-        0x00, 0x00, 0x00, 0x01, 0x67, 0x6e, 0x10, 0x28,
-        0xa6, 0xd4, 0x20, 0x32, 0x33, 0x0c, 0x71, 0x18,
-        0x88, 0x62, 0x10, 0x19, 0x19, 0x86, 0x38, 0x8c,
-        0x44, 0x30, 0x21, 0x02, 0x56, 0x4e, 0x6e, 0x61,
-        0x87, 0x3e, 0x73, 0x4d, 0x98, 0x0c, 0x03, 0x06,
-        0x9c, 0x0b, 0x73, 0xe6, 0xc0, 0xb5, 0x18, 0x63,
-        0x0d, 0x39, 0xe0, 0x5b, 0x02, 0xd4, 0xc6, 0x19,
-        0x1a, 0x79, 0x8c, 0x32, 0x34, 0x24, 0xf0, 0x16,
-        0x81, 0x13, 0xf7, 0xff, 0x80, 0x01, 0x80, 0x02,
-        0x71, 0x80, 0x80, 0x80, 0xa0, 0x00, 0x00, 0x03,
-        0x00, 0x20, 0x00, 0x00, 0x06, 0x50, 0x80, 0x00,
-        // PPS
-        0x00, 0x00, 0x00, 0x01, 0x68, 0xee, 0x31, 0x12,
-        0x11
-    };
-    static const uint8_t avci100_720p_extradata[] = {
-        // SPS
-        0x00, 0x00, 0x00, 0x01, 0x67, 0x7a, 0x10, 0x29,
-        0xb6, 0xd4, 0x20, 0x2a, 0x33, 0x1d, 0xc7, 0x62,
-        0xa1, 0x08, 0x40, 0x54, 0x66, 0x3b, 0x8e, 0xc5,
-        0x42, 0x02, 0x10, 0x25, 0x64, 0x2c, 0x89, 0xe8,
-        0x85, 0xe4, 0x21, 0x4b, 0x90, 0x83, 0x06, 0x95,
-        0xd1, 0x06, 0x46, 0x97, 0x20, 0xc8, 0xd7, 0x43,
-        0x08, 0x11, 0xc2, 0x1e, 0x4c, 0x91, 0x0f, 0x01,
-        0x40, 0x16, 0xec, 0x07, 0x8c, 0x04, 0x04, 0x05,
-        0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x03,
-        0x00, 0x64, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00,
-        // PPS
-        0x00, 0x00, 0x00, 0x01, 0x68, 0xce, 0x31, 0x12,
-        0x11
-    };
-
-    const uint8_t *data = NULL;
-    int size            = 0;
-
-    if (st->codec->width == 1920) {
-        if (st->codec->field_order == AV_FIELD_PROGRESSIVE) {
-            data = avci100_1080p_extradata;
-            size = sizeof(avci100_1080p_extradata);
-        } else {
-            data = avci100_1080i_extradata;
-            size = sizeof(avci100_1080i_extradata);
-        }
-    } else if (st->codec->width == 1440) {
-        data = avci50_1080i_extradata;
-        size = sizeof(avci50_1080i_extradata);
-    } else if (st->codec->width == 1280) {
-        data = avci100_720p_extradata;
-        size = sizeof(avci100_720p_extradata);
-    }
-
-    if (!size)
-        return 0;
-
-    av_freep(&st->codec->extradata);
-    st->codec->extradata_size = 0;
-    st->codec->extradata      = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!st->codec->extradata)
-        return AVERROR(ENOMEM);
-
-    memcpy(st->codec->extradata, data, size);
-    st->codec->extradata_size = size;
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/vc1test.c b/deps/libav/libavformat/vc1test.c
deleted file mode 100644
index 859188f..0000000
--- a/deps/libav/libavformat/vc1test.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * VC1 Test Bitstreams Format Demuxer
- * Copyright (c) 2006, 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * VC1 test bitstream file demuxer
- * by Konstantin Shishkov
- * Format specified in SMPTE standard 421 Annex L
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define VC1_EXTRADATA_SIZE 4
-
-static int vc1t_probe(AVProbeData *p)
-{
-    if (p->buf_size < 24)
-        return 0;
-    if (p->buf[3] != 0xC5 || AV_RL32(&p->buf[4]) != 4 || AV_RL32(&p->buf[20]) != 0xC)
-        return 0;
-
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-static int vc1t_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    int frames;
-    uint32_t fps;
-
-    frames = avio_rl24(pb);
-    if(avio_r8(pb) != 0xC5 || avio_rl32(pb) != 4)
-        return -1;
-
-    /* init video codec */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return -1;
-
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_WMV3;
-
-    st->codec->extradata = av_malloc(VC1_EXTRADATA_SIZE);
-    st->codec->extradata_size = VC1_EXTRADATA_SIZE;
-    avio_read(pb, st->codec->extradata, VC1_EXTRADATA_SIZE);
-    st->codec->height = avio_rl32(pb);
-    st->codec->width = avio_rl32(pb);
-    if(avio_rl32(pb) != 0xC)
-        return -1;
-    avio_skip(pb, 8);
-    fps = avio_rl32(pb);
-    if(fps == 0xFFFFFFFF)
-        avpriv_set_pts_info(st, 32, 1, 1000);
-    else{
-        if (!fps) {
-            av_log(s, AV_LOG_ERROR, "Zero FPS specified, defaulting to 1 FPS\n");
-            fps = 1;
-        }
-        avpriv_set_pts_info(st, 24, 1, fps);
-        st->duration = frames;
-    }
-
-    return 0;
-}
-
-static int vc1t_read_packet(AVFormatContext *s,
-                           AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    int frame_size;
-    int keyframe = 0;
-    uint32_t pts;
-
-    if(pb->eof_reached)
-        return AVERROR(EIO);
-
-    frame_size = avio_rl24(pb);
-    if(avio_r8(pb) & 0x80)
-        keyframe = 1;
-    pts = avio_rl32(pb);
-    if(av_get_packet(pb, pkt, frame_size) < 0)
-        return AVERROR(EIO);
-    if(s->streams[0]->time_base.den == 1000)
-        pkt->pts = pts;
-    pkt->flags |= keyframe ? AV_PKT_FLAG_KEY : 0;
-    pkt->pos -= 8;
-
-    return pkt->size;
-}
-
-AVInputFormat ff_vc1t_demuxer = {
-    .name           = "vc1test",
-    .long_name      = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"),
-    .read_probe     = vc1t_probe,
-    .read_header    = vc1t_read_header,
-    .read_packet    = vc1t_read_packet,
-    .flags          = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/vc1testenc.c b/deps/libav/libavformat/vc1testenc.c
deleted file mode 100644
index 9d55fee..0000000
--- a/deps/libav/libavformat/vc1testenc.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * VC-1 test bitstreams format muxer.
- * Copyright (c) 2008 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct RCVContext {
-    int frames;
-} RCVContext;
-
-static int vc1test_write_header(AVFormatContext *s)
-{
-    AVCodecContext *avc = s->streams[0]->codec;
-    AVIOContext *pb = s->pb;
-
-    if (avc->codec_id != AV_CODEC_ID_WMV3) {
-        av_log(s, AV_LOG_ERROR, "Only WMV3 is accepted!\n");
-        return -1;
-    }
-    avio_wl24(pb, 0); //frames count will be here
-    avio_w8(pb, 0xC5);
-    avio_wl32(pb, 4);
-    avio_write(pb, avc->extradata, 4);
-    avio_wl32(pb, avc->height);
-    avio_wl32(pb, avc->width);
-    avio_wl32(pb, 0xC);
-    avio_wl24(pb, 0); // hrd_buffer
-    avio_w8(pb, 0x80); // level|cbr|res1
-    avio_wl32(pb, 0); // hrd_rate
-    if (s->streams[0]->avg_frame_rate.den && s->streams[0]->avg_frame_rate.num == 1)
-        avio_wl32(pb, s->streams[0]->avg_frame_rate.den);
-    else
-        avio_wl32(pb, 0xFFFFFFFF); //variable framerate
-    avpriv_set_pts_info(s->streams[0], 32, 1, 1000);
-
-    return 0;
-}
-
-static int vc1test_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    RCVContext *ctx = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    if (!pkt->size)
-        return 0;
-    avio_wl32(pb, pkt->size | ((pkt->flags & AV_PKT_FLAG_KEY) ? 0x80000000 : 0));
-    avio_wl32(pb, pkt->pts);
-    avio_write(pb, pkt->data, pkt->size);
-    ctx->frames++;
-
-    return 0;
-}
-
-static int vc1test_write_trailer(AVFormatContext *s)
-{
-    RCVContext *ctx = s->priv_data;
-    AVIOContext *pb = s->pb;
-
-    if (s->pb->seekable) {
-        avio_seek(pb, 0, SEEK_SET);
-        avio_wl24(pb, ctx->frames);
-        avio_flush(pb);
-    }
-    return 0;
-}
-
-AVOutputFormat ff_vc1t_muxer = {
-    .name              = "rcv",
-    .long_name         = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"),
-    .mime_type         = "",
-    .extensions        = "rcv",
-    .priv_data_size    = sizeof(RCVContext),
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_WMV3,
-    .write_header      = vc1test_write_header,
-    .write_packet      = vc1test_write_packet,
-    .write_trailer     = vc1test_write_trailer,
-};
diff --git a/deps/libav/libavformat/version.h b/deps/libav/libavformat/version.h
deleted file mode 100644
index 3d1e21f..0000000
--- a/deps/libav/libavformat/version.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Version macros.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_VERSION_H
-#define AVFORMAT_VERSION_H
-
-/**
- * @file
- * @ingroup libavf
- * Libavformat version macros
- */
-
-#include "libavutil/version.h"
-
-#define LIBAVFORMAT_VERSION_MAJOR 55
-#define LIBAVFORMAT_VERSION_MINOR 12
-#define LIBAVFORMAT_VERSION_MICRO  0
-
-#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-                                               LIBAVFORMAT_VERSION_MINOR, \
-                                               LIBAVFORMAT_VERSION_MICRO)
-#define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \
-                                           LIBAVFORMAT_VERSION_MINOR,   \
-                                           LIBAVFORMAT_VERSION_MICRO)
-#define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
-
-#define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
-
-/**
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- */
-#ifndef FF_API_REFERENCE_DTS
-#define FF_API_REFERENCE_DTS            (LIBAVFORMAT_VERSION_MAJOR < 56)
-#endif
-
-#endif /* AVFORMAT_VERSION_H */
diff --git a/deps/libav/libavformat/voc.c b/deps/libav/libavformat/voc.c
deleted file mode 100644
index 1b7d499..0000000
--- a/deps/libav/libavformat/voc.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Creative Voice File common data.
- * Copyright (c) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "voc.h"
-#include "internal.h"
-
-const unsigned char ff_voc_magic[21] = "Creative Voice File\x1A";
-
-const AVCodecTag ff_voc_codec_tags[] = {
-    {AV_CODEC_ID_PCM_U8,        0x00},
-    {AV_CODEC_ID_ADPCM_SBPRO_4, 0x01},
-    {AV_CODEC_ID_ADPCM_SBPRO_3, 0x02},
-    {AV_CODEC_ID_ADPCM_SBPRO_2, 0x03},
-    {AV_CODEC_ID_PCM_S16LE,     0x04},
-    {AV_CODEC_ID_PCM_ALAW,      0x06},
-    {AV_CODEC_ID_PCM_MULAW,     0x07},
-    {AV_CODEC_ID_ADPCM_CT,    0x0200},
-    {AV_CODEC_ID_NONE,             0},
-};
diff --git a/deps/libav/libavformat/voc.h b/deps/libav/libavformat/voc.h
deleted file mode 100644
index d2c0cb4..0000000
--- a/deps/libav/libavformat/voc.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Creative Voice File demuxer.
- * Copyright (c) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_VOC_H
-#define AVFORMAT_VOC_H
-
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct voc_dec_context {
-    int64_t remaining_size;
-} VocDecContext;
-
-typedef enum voc_type {
-    VOC_TYPE_EOF              = 0x00,
-    VOC_TYPE_VOICE_DATA       = 0x01,
-    VOC_TYPE_VOICE_DATA_CONT  = 0x02,
-    VOC_TYPE_SILENCE          = 0x03,
-    VOC_TYPE_MARKER           = 0x04,
-    VOC_TYPE_ASCII            = 0x05,
-    VOC_TYPE_REPETITION_START = 0x06,
-    VOC_TYPE_REPETITION_END   = 0x07,
-    VOC_TYPE_EXTENDED         = 0x08,
-    VOC_TYPE_NEW_VOICE_DATA   = 0x09,
-} VocType;
-
-extern const unsigned char ff_voc_magic[21];
-extern const AVCodecTag ff_voc_codec_tags[];
-
-int ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt,
-                      AVStream *st, int max_size);
-
-#endif /* AVFORMAT_VOC_H */
diff --git a/deps/libav/libavformat/vocdec.c b/deps/libav/libavformat/vocdec.c
deleted file mode 100644
index 2fb8440..0000000
--- a/deps/libav/libavformat/vocdec.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Creative Voice File demuxer.
- * Copyright (c) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "voc.h"
-#include "internal.h"
-
-
-static int voc_probe(AVProbeData *p)
-{
-    int version, check;
-
-    if (memcmp(p->buf, ff_voc_magic, sizeof(ff_voc_magic) - 1))
-        return 0;
-    version = AV_RL16(p->buf + 22);
-    check = AV_RL16(p->buf + 24);
-    if (~version + 0x1234 != check)
-        return 10;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int voc_read_header(AVFormatContext *s)
-{
-    VocDecContext *voc = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int header_size;
-    AVStream *st;
-
-    avio_skip(pb, 20);
-    header_size = avio_rl16(pb) - 22;
-    if (header_size != 4) {
-        av_log(s, AV_LOG_ERROR, "unknown header size: %d\n", header_size);
-        return AVERROR(ENOSYS);
-    }
-    avio_skip(pb, header_size);
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-
-    voc->remaining_size = 0;
-    return 0;
-}
-
-int
-ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
-{
-    VocDecContext *voc = s->priv_data;
-    AVCodecContext *dec = st->codec;
-    AVIOContext *pb = s->pb;
-    VocType type;
-    int size, tmp_codec=-1;
-    int sample_rate = 0;
-    int channels = 1;
-
-    while (!voc->remaining_size) {
-        type = avio_r8(pb);
-        if (type == VOC_TYPE_EOF)
-            return AVERROR(EIO);
-        voc->remaining_size = avio_rl24(pb);
-        if (!voc->remaining_size) {
-            if (!s->pb->seekable)
-                return AVERROR(EIO);
-            voc->remaining_size = avio_size(pb) - avio_tell(pb);
-        }
-        max_size -= 4;
-
-        switch (type) {
-        case VOC_TYPE_VOICE_DATA:
-            if (!dec->sample_rate) {
-                dec->sample_rate = 1000000 / (256 - avio_r8(pb));
-                if (sample_rate)
-                    dec->sample_rate = sample_rate;
-                avpriv_set_pts_info(st, 64, 1, dec->sample_rate);
-                dec->channels = channels;
-                dec->bits_per_coded_sample = av_get_bits_per_sample(dec->codec_id);
-            } else
-                avio_skip(pb, 1);
-            tmp_codec = avio_r8(pb);
-            voc->remaining_size -= 2;
-            max_size -= 2;
-            channels = 1;
-            break;
-
-        case VOC_TYPE_VOICE_DATA_CONT:
-            break;
-
-        case VOC_TYPE_EXTENDED:
-            sample_rate = avio_rl16(pb);
-            avio_r8(pb);
-            channels = avio_r8(pb) + 1;
-            sample_rate = 256000000 / (channels * (65536 - sample_rate));
-            voc->remaining_size = 0;
-            max_size -= 4;
-            break;
-
-        case VOC_TYPE_NEW_VOICE_DATA:
-            if (!dec->sample_rate) {
-                dec->sample_rate = avio_rl32(pb);
-                avpriv_set_pts_info(st, 64, 1, dec->sample_rate);
-                dec->bits_per_coded_sample = avio_r8(pb);
-                dec->channels = avio_r8(pb);
-            } else
-                avio_skip(pb, 6);
-            tmp_codec = avio_rl16(pb);
-            avio_skip(pb, 4);
-            voc->remaining_size -= 12;
-            max_size -= 12;
-            break;
-
-        default:
-            avio_skip(pb, voc->remaining_size);
-            max_size -= voc->remaining_size;
-            voc->remaining_size = 0;
-            break;
-        }
-    }
-
-    if (tmp_codec >= 0) {
-        tmp_codec = ff_codec_get_id(ff_voc_codec_tags, tmp_codec);
-        if (dec->codec_id == AV_CODEC_ID_NONE)
-            dec->codec_id = tmp_codec;
-        else if (dec->codec_id != tmp_codec)
-            av_log(s, AV_LOG_WARNING, "Ignoring mid-stream change in audio codec\n");
-        if (dec->codec_id == AV_CODEC_ID_NONE) {
-            if (s->audio_codec_id == AV_CODEC_ID_NONE) {
-                av_log(s, AV_LOG_ERROR, "unknown codec tag\n");
-                return AVERROR(EINVAL);
-            }
-            av_log(s, AV_LOG_WARNING, "unknown codec tag\n");
-        }
-    }
-
-    dec->bit_rate = dec->sample_rate * dec->bits_per_coded_sample;
-
-    if (max_size <= 0)
-        max_size = 2048;
-    size = FFMIN(voc->remaining_size, max_size);
-    voc->remaining_size -= size;
-    return av_get_packet(pb, pkt, size);
-}
-
-static int voc_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    return ff_voc_get_packet(s, pkt, s->streams[0], 0);
-}
-
-AVInputFormat ff_voc_demuxer = {
-    .name           = "voc",
-    .long_name      = NULL_IF_CONFIG_SMALL("Creative Voice"),
-    .priv_data_size = sizeof(VocDecContext),
-    .read_probe     = voc_probe,
-    .read_header    = voc_read_header,
-    .read_packet    = voc_read_packet,
-    .codec_tag      = (const AVCodecTag* const []){ ff_voc_codec_tags, 0 },
-};
diff --git a/deps/libav/libavformat/vocenc.c b/deps/libav/libavformat/vocenc.c
deleted file mode 100644
index d18eac2..0000000
--- a/deps/libav/libavformat/vocenc.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Creative Voice File muxer.
- * Copyright (c) 2006  Aurelien Jacobs <aurel at gnuage.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "voc.h"
-#include "internal.h"
-
-
-typedef struct voc_enc_context {
-    int param_written;
-} VocEncContext;
-
-static int voc_write_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    const int header_size = 26;
-    const int version = 0x0114;
-
-    if (s->nb_streams != 1
-        || s->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO)
-        return AVERROR_PATCHWELCOME;
-
-    avio_write(pb, ff_voc_magic, sizeof(ff_voc_magic) - 1);
-    avio_wl16(pb, header_size);
-    avio_wl16(pb, version);
-    avio_wl16(pb, ~version + 0x1234);
-
-    return 0;
-}
-
-static int voc_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    VocEncContext *voc = s->priv_data;
-    AVCodecContext *enc = s->streams[0]->codec;
-    AVIOContext *pb = s->pb;
-
-    if (!voc->param_written) {
-        if (enc->codec_tag > 0xFF) {
-            avio_w8(pb, VOC_TYPE_NEW_VOICE_DATA);
-            avio_wl24(pb, pkt->size + 12);
-            avio_wl32(pb, enc->sample_rate);
-            avio_w8(pb, enc->bits_per_coded_sample);
-            avio_w8(pb, enc->channels);
-            avio_wl16(pb, enc->codec_tag);
-            avio_wl32(pb, 0);
-        } else {
-            if (s->streams[0]->codec->channels > 1) {
-                avio_w8(pb, VOC_TYPE_EXTENDED);
-                avio_wl24(pb, 4);
-                avio_wl16(pb, 65536-256000000/(enc->sample_rate*enc->channels));
-                avio_w8(pb, enc->codec_tag);
-                avio_w8(pb, enc->channels - 1);
-            }
-            avio_w8(pb, VOC_TYPE_VOICE_DATA);
-            avio_wl24(pb, pkt->size + 2);
-            avio_w8(pb, 256 - 1000000 / enc->sample_rate);
-            avio_w8(pb, enc->codec_tag);
-        }
-        voc->param_written = 1;
-    } else {
-        avio_w8(pb, VOC_TYPE_VOICE_DATA_CONT);
-        avio_wl24(pb, pkt->size);
-    }
-
-    avio_write(pb, pkt->data, pkt->size);
-    return 0;
-}
-
-static int voc_write_trailer(AVFormatContext *s)
-{
-    avio_w8(s->pb, 0);
-    return 0;
-}
-
-AVOutputFormat ff_voc_muxer = {
-    .name              = "voc",
-    .long_name         = NULL_IF_CONFIG_SMALL("Creative Voice"),
-    .mime_type         = "audio/x-voc",
-    .extensions        = "voc",
-    .priv_data_size    = sizeof(VocEncContext),
-    .audio_codec       = AV_CODEC_ID_PCM_U8,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = voc_write_header,
-    .write_packet      = voc_write_packet,
-    .write_trailer     = voc_write_trailer,
-    .codec_tag         = (const AVCodecTag* const []){ ff_voc_codec_tags, 0 },
-};
diff --git a/deps/libav/libavformat/vorbiscomment.c b/deps/libav/libavformat/vorbiscomment.c
deleted file mode 100644
index 56936d7..0000000
--- a/deps/libav/libavformat/vorbiscomment.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * VorbisComment writer
- * Copyright (c) 2009 James Darnley
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "metadata.h"
-#include "vorbiscomment.h"
-#include "libavcodec/bytestream.h"
-#include "libavutil/dict.h"
-
-/**
- * VorbisComment metadata conversion mapping.
- * from Ogg Vorbis I format specification: comment field and header specification
- * http://xiph.org/vorbis/doc/v-comment.html
- */
-const AVMetadataConv ff_vorbiscomment_metadata_conv[] = {
-    { "ALBUMARTIST", "album_artist"},
-    { "TRACKNUMBER", "track"  },
-    { "DISCNUMBER",  "disc"   },
-    { 0 }
-};
-
-int ff_vorbiscomment_length(AVDictionary *m, const char *vendor_string,
-                            unsigned *count)
-{
-    int len = 8;
-    len += strlen(vendor_string);
-    *count = 0;
-    if (m) {
-        AVDictionaryEntry *tag = NULL;
-        while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
-            len += 4 +strlen(tag->key) + 1 + strlen(tag->value);
-            (*count)++;
-        }
-    }
-    return len;
-}
-
-int ff_vorbiscomment_write(uint8_t **p, AVDictionary **m,
-                           const char *vendor_string, const unsigned count)
-{
-    bytestream_put_le32(p, strlen(vendor_string));
-    bytestream_put_buffer(p, vendor_string, strlen(vendor_string));
-    if (*m) {
-        AVDictionaryEntry *tag = NULL;
-        bytestream_put_le32(p, count);
-        while ((tag = av_dict_get(*m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
-            unsigned int len1 = strlen(tag->key);
-            unsigned int len2 = strlen(tag->value);
-            bytestream_put_le32(p, len1+1+len2);
-            bytestream_put_buffer(p, tag->key, len1);
-            bytestream_put_byte(p, '=');
-            bytestream_put_buffer(p, tag->value, len2);
-        }
-    } else
-        bytestream_put_le32(p, 0);
-    return 0;
-}
diff --git a/deps/libav/libavformat/vorbiscomment.h b/deps/libav/libavformat/vorbiscomment.h
deleted file mode 100644
index 95e1a56..0000000
--- a/deps/libav/libavformat/vorbiscomment.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * VorbisComment writer
- * Copyright (c) 2009 James Darnley
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_VORBISCOMMENT_H
-#define AVFORMAT_VORBISCOMMENT_H
-
-#include "avformat.h"
-#include "metadata.h"
-
-/**
- * Calculate the length in bytes of a VorbisComment. This is the minimum
- * size required by ff_vorbiscomment_write().
- *
- * @param m The metadata structure to be parsed. For no metadata, set to NULL.
- * @param vendor_string The vendor string to be added into the VorbisComment.
- * For no string, set to an empty string.
- * @param count Pointer to store the number of tags in m because m->count is "not allowed"
- * @return The length in bytes.
- */
-int ff_vorbiscomment_length(AVDictionary *m, const char *vendor_string,
-                            unsigned *count);
-
-/**
- * Write a VorbisComment into a buffer. The buffer, p, must have enough
- * data to hold the whole VorbisComment. The minimum size required can be
- * obtained by passing the same AVDictionary and vendor_string to
- * ff_vorbiscomment_length()
- *
- * @param p The buffer in which to write.
- * @param m The metadata struct to write.
- * @param vendor_string The vendor string to write.
- * @param count The number of tags in m because m->count is "not allowed"
- */
-int ff_vorbiscomment_write(uint8_t **p, AVDictionary **m,
-                           const char *vendor_string, const unsigned count);
-
-extern const AVMetadataConv ff_vorbiscomment_metadata_conv[];
-
-#endif /* AVFORMAT_VORBISCOMMENT_H */
diff --git a/deps/libav/libavformat/vqf.c b/deps/libav/libavformat/vqf.c
deleted file mode 100644
index a43829b..0000000
--- a/deps/libav/libavformat/vqf.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * VQF demuxer
- * Copyright (c) 2009 Vitor Sessak
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avformat.h"
-#include "internal.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "libavutil/mathematics.h"
-#include "riff.h"
-
-typedef struct VqfContext {
-    int frame_bit_len;
-    uint8_t last_frame_bits;
-    int remaining_bits;
-} VqfContext;
-
-static int vqf_probe(AVProbeData *probe_packet)
-{
-    if (AV_RL32(probe_packet->buf) != MKTAG('T','W','I','N'))
-        return 0;
-
-    if (!memcmp(probe_packet->buf + 4, "97012000", 8))
-        return AVPROBE_SCORE_MAX;
-
-    if (!memcmp(probe_packet->buf + 4, "00052200", 8))
-        return AVPROBE_SCORE_MAX;
-
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-static void add_metadata(AVFormatContext *s, uint32_t tag,
-                         unsigned int tag_len, unsigned int remaining)
-{
-    int len = FFMIN(tag_len, remaining);
-    char *buf, key[5] = {0};
-
-    if (len == UINT_MAX)
-        return;
-
-    buf = av_malloc(len+1);
-    if (!buf)
-        return;
-    avio_read(s->pb, buf, len);
-    buf[len] = 0;
-    AV_WL32(key, tag);
-    av_dict_set(&s->metadata, key, buf, AV_DICT_DONT_STRDUP_VAL);
-}
-
-static const AVMetadataConv vqf_metadata_conv[] = {
-    { "(c) ", "copyright" },
-    { "ARNG", "arranger"  },
-    { "AUTH", "author"    },
-    { "BAND", "band"      },
-    { "CDCT", "conductor" },
-    { "COMT", "comment"   },
-    { "FILE", "filename"  },
-    { "GENR", "genre"     },
-    { "LABL", "publisher" },
-    { "MUSC", "composer"  },
-    { "NAME", "title"     },
-    { "NOTE", "note"      },
-    { "PROD", "producer"  },
-    { "PRSN", "personnel" },
-    { "REMX", "remixer"   },
-    { "SING", "singer"    },
-    { "TRCK", "track"     },
-    { "WORD", "words"     },
-    { 0 },
-};
-
-static int vqf_read_header(AVFormatContext *s)
-{
-    VqfContext *c = s->priv_data;
-    AVStream *st  = avformat_new_stream(s, NULL);
-    int chunk_tag;
-    int rate_flag = -1;
-    int header_size;
-    int read_bitrate = 0;
-    int size;
-    uint8_t comm_chunk[12];
-
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    avio_skip(s->pb, 12);
-
-    header_size = avio_rb32(s->pb);
-
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id   = AV_CODEC_ID_TWINVQ;
-    st->start_time = 0;
-
-    do {
-        int len;
-        chunk_tag = avio_rl32(s->pb);
-
-        if (chunk_tag == MKTAG('D','A','T','A'))
-            break;
-
-        len = avio_rb32(s->pb);
-
-        if ((unsigned) len > INT_MAX/2) {
-            av_log(s, AV_LOG_ERROR, "Malformed header\n");
-            return -1;
-        }
-
-        header_size -= 8;
-
-        switch(chunk_tag){
-        case MKTAG('C','O','M','M'):
-            avio_read(s->pb, comm_chunk, 12);
-            st->codec->channels = AV_RB32(comm_chunk    ) + 1;
-            read_bitrate        = AV_RB32(comm_chunk + 4);
-            rate_flag           = AV_RB32(comm_chunk + 8);
-            avio_skip(s->pb, len-12);
-
-            st->codec->bit_rate              = read_bitrate*1000;
-            break;
-        case MKTAG('D','S','I','Z'): // size of compressed data
-        {
-            char buf[8] = {0};
-            int size = avio_rb32(s->pb);
-
-            snprintf(buf, sizeof(buf), "%d", size);
-            av_dict_set(&s->metadata, "size", buf, 0);
-        }
-            break;
-        case MKTAG('Y','E','A','R'): // recording date
-        case MKTAG('E','N','C','D'): // compression date
-        case MKTAG('E','X','T','R'): // reserved
-        case MKTAG('_','Y','M','H'): // reserved
-        case MKTAG('_','N','T','T'): // reserved
-        case MKTAG('_','I','D','3'): // reserved for ID3 tags
-            avio_skip(s->pb, FFMIN(len, header_size));
-            break;
-        default:
-            add_metadata(s, chunk_tag, len, header_size);
-            break;
-        }
-
-        header_size -= len;
-
-    } while (header_size >= 0);
-
-    switch (rate_flag) {
-    case -1:
-        av_log(s, AV_LOG_ERROR, "COMM tag not found!\n");
-        return -1;
-    case 44:
-        st->codec->sample_rate = 44100;
-        break;
-    case 22:
-        st->codec->sample_rate = 22050;
-        break;
-    case 11:
-        st->codec->sample_rate = 11025;
-        break;
-    default:
-        if (rate_flag < 8 || rate_flag > 44) {
-            av_log(s, AV_LOG_ERROR, "Invalid rate flag %d\n", rate_flag);
-            return AVERROR_INVALIDDATA;
-        }
-        st->codec->sample_rate = rate_flag*1000;
-        break;
-    }
-
-    if (read_bitrate / st->codec->channels <  8 ||
-        read_bitrate / st->codec->channels > 48) {
-        av_log(s, AV_LOG_ERROR, "Invalid bitrate per channel %d\n",
-               read_bitrate / st->codec->channels);
-        return AVERROR_INVALIDDATA;
-    }
-
-    switch (((st->codec->sample_rate/1000) << 8) +
-            read_bitrate/st->codec->channels) {
-    case (11<<8) + 8 :
-    case (8 <<8) + 8 :
-    case (11<<8) + 10:
-    case (22<<8) + 32:
-        size = 512;
-        break;
-    case (16<<8) + 16:
-    case (22<<8) + 20:
-    case (22<<8) + 24:
-        size = 1024;
-        break;
-    case (44<<8) + 40:
-    case (44<<8) + 48:
-        size = 2048;
-        break;
-    default:
-        av_log(s, AV_LOG_ERROR, "Mode not suported: %d Hz, %d kb/s.\n",
-               st->codec->sample_rate, st->codec->bit_rate);
-        return -1;
-    }
-    c->frame_bit_len = st->codec->bit_rate*size/st->codec->sample_rate;
-    avpriv_set_pts_info(st, 64, size, st->codec->sample_rate);
-
-    /* put first 12 bytes of COMM chunk in extradata */
-    if (!(st->codec->extradata = av_malloc(12 + FF_INPUT_BUFFER_PADDING_SIZE)))
-        return AVERROR(ENOMEM);
-    st->codec->extradata_size = 12;
-    memcpy(st->codec->extradata, comm_chunk, 12);
-
-    ff_metadata_conv_ctx(s, NULL, vqf_metadata_conv);
-
-    return 0;
-}
-
-static int vqf_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    VqfContext *c = s->priv_data;
-    int ret;
-    int size = (c->frame_bit_len - c->remaining_bits + 7)>>3;
-
-    if (av_new_packet(pkt, size+2) < 0)
-        return AVERROR(EIO);
-
-    pkt->pos          = avio_tell(s->pb);
-    pkt->stream_index = 0;
-    pkt->duration     = 1;
-
-    pkt->data[0] = 8 - c->remaining_bits; // Number of bits to skip
-    pkt->data[1] = c->last_frame_bits;
-    ret = avio_read(s->pb, pkt->data+2, size);
-
-    if (ret<=0) {
-        av_free_packet(pkt);
-        return AVERROR(EIO);
-    }
-
-    c->last_frame_bits = pkt->data[size+1];
-    c->remaining_bits  = (size << 3) - c->frame_bit_len + c->remaining_bits;
-
-    return size+2;
-}
-
-static int vqf_read_seek(AVFormatContext *s,
-                         int stream_index, int64_t timestamp, int flags)
-{
-    VqfContext *c = s->priv_data;
-    AVStream *st;
-    int ret;
-    int64_t pos;
-
-    st = s->streams[stream_index];
-    pos = av_rescale_rnd(timestamp * st->codec->bit_rate,
-                         st->time_base.num,
-                         st->time_base.den * (int64_t)c->frame_bit_len,
-                         (flags & AVSEEK_FLAG_BACKWARD) ?
-                                                   AV_ROUND_DOWN : AV_ROUND_UP);
-    pos *= c->frame_bit_len;
-
-    st->cur_dts = av_rescale(pos, st->time_base.den,
-                             st->codec->bit_rate * (int64_t)st->time_base.num);
-
-    if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + s->data_offset, SEEK_SET)) < 0)
-        return ret;
-
-    c->remaining_bits = -7 - ((pos-7)&7);
-    return 0;
-}
-
-AVInputFormat ff_vqf_demuxer = {
-    .name           = "vqf",
-    .long_name      = NULL_IF_CONFIG_SMALL("Nippon Telegraph and Telephone Corporation (NTT) TwinVQ"),
-    .priv_data_size = sizeof(VqfContext),
-    .read_probe     = vqf_probe,
-    .read_header    = vqf_read_header,
-    .read_packet    = vqf_read_packet,
-    .read_seek      = vqf_read_seek,
-    .extensions     = "vqf,vql,vqe",
-};
diff --git a/deps/libav/libavformat/wavdec.c b/deps/libav/libavformat/wavdec.c
deleted file mode 100644
index f65a66a..0000000
--- a/deps/libav/libavformat/wavdec.c
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * WAV demuxer
- * Copyright (c) 2001, 2002 Fabrice Bellard
- *
- * Sony Wave64 demuxer
- * RF64 demuxer
- * Copyright (c) 2009 Daniel Verkamp
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/avassert.h"
-#include "libavutil/dict.h"
-#include "libavutil/log.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "avformat.h"
-#include "avio.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "metadata.h"
-#include "pcm.h"
-#include "riff.h"
-
-typedef struct WAVDemuxContext {
-    int64_t data_end;
-    int w64;
-} WAVDemuxContext;
-
-#if CONFIG_WAV_DEMUXER
-
-static int64_t next_tag(AVIOContext *pb, uint32_t *tag)
-{
-    *tag = avio_rl32(pb);
-    return avio_rl32(pb);
-}
-
-/* RIFF chunks are always on a even offset. */
-static int64_t wav_seek_tag(AVIOContext *s, int64_t offset, int whence)
-{
-    return avio_seek(s, offset + (offset & 1), whence);
-}
-
-/* return the size of the found tag */
-static int64_t find_tag(AVIOContext *pb, uint32_t tag1)
-{
-    unsigned int tag;
-    int64_t size;
-
-    for (;;) {
-        if (pb->eof_reached)
-            return -1;
-        size = next_tag(pb, &tag);
-        if (tag == tag1)
-            break;
-        wav_seek_tag(pb, size, SEEK_CUR);
-    }
-    return size;
-}
-
-static int wav_probe(AVProbeData *p)
-{
-    /* check file header */
-    if (p->buf_size <= 32)
-        return 0;
-    if (!memcmp(p->buf + 8, "WAVE", 4)) {
-        if (!memcmp(p->buf, "RIFF", 4))
-            /* Since the ACT demuxer has a standard WAV header at the top of
-             * its own, the returned score is decreased to avoid a probe
-             * conflict between ACT and WAV. */
-            return AVPROBE_SCORE_MAX - 1;
-        else if (!memcmp(p->buf,      "RF64", 4) &&
-                 !memcmp(p->buf + 12, "ds64", 4))
-            return AVPROBE_SCORE_MAX;
-    }
-    return 0;
-}
-
-static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
-{
-    AVIOContext *pb = s->pb;
-    int ret;
-
-    /* parse fmt header */
-    *st = avformat_new_stream(s, NULL);
-    if (!*st)
-        return AVERROR(ENOMEM);
-
-    ret = ff_get_wav_header(pb, (*st)->codec, size);
-    if (ret < 0)
-        return ret;
-    (*st)->need_parsing = AVSTREAM_PARSE_FULL;
-
-    avpriv_set_pts_info(*st, 64, 1, (*st)->codec->sample_rate);
-
-    return 0;
-}
-
-static inline int wav_parse_bext_string(AVFormatContext *s, const char *key,
-                                        int length)
-{
-    char temp[257];
-    int ret;
-
-    av_assert0(length <= sizeof(temp));
-    if ((ret = avio_read(s->pb, temp, length)) < 0)
-        return ret;
-
-    temp[length] = 0;
-
-    if (strlen(temp))
-        return av_dict_set(&s->metadata, key, temp, 0);
-
-    return 0;
-}
-
-static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
-{
-    char temp[131], *coding_history;
-    int ret, x;
-    uint64_t time_reference;
-    int64_t umid_parts[8], umid_mask = 0;
-
-    if ((ret = wav_parse_bext_string(s, "description", 256)) < 0 ||
-        (ret = wav_parse_bext_string(s, "originator", 32)) < 0 ||
-        (ret = wav_parse_bext_string(s, "originator_reference", 32)) < 0 ||
-        (ret = wav_parse_bext_string(s, "origination_date", 10)) < 0 ||
-        (ret = wav_parse_bext_string(s, "origination_time", 8)) < 0)
-        return ret;
-
-    time_reference = avio_rl64(s->pb);
-    snprintf(temp, sizeof(temp), "%"PRIu64, time_reference);
-    if ((ret = av_dict_set(&s->metadata, "time_reference", temp, 0)) < 0)
-        return ret;
-
-    /* check if version is >= 1, in which case an UMID may be present */
-    if (avio_rl16(s->pb) >= 1) {
-        for (x = 0; x < 8; x++)
-            umid_mask |= umid_parts[x] = avio_rb64(s->pb);
-
-        if (umid_mask) {
-            /* the string formatting below is per SMPTE 330M-2004 Annex C */
-            if (umid_parts[4] == 0 && umid_parts[5] == 0 &&
-                umid_parts[6] == 0 && umid_parts[7] == 0) {
-                /* basic UMID */
-                snprintf(temp, sizeof(temp),
-                         "0x%016"PRIX64"%016"PRIX64"%016"PRIX64"%016"PRIX64,
-                         umid_parts[0], umid_parts[1],
-                         umid_parts[2], umid_parts[3]);
-            } else {
-                /* extended UMID */
-                snprintf(temp, sizeof(temp),
-                         "0x%016"PRIX64"%016"PRIX64"%016"PRIX64"%016"PRIX64
-                         "0x%016"PRIX64"%016"PRIX64"%016"PRIX64"%016"PRIX64,
-                         umid_parts[0], umid_parts[1],
-                         umid_parts[2], umid_parts[3],
-                         umid_parts[4], umid_parts[5],
-                         umid_parts[6], umid_parts[7]);
-            }
-
-            if ((ret = av_dict_set(&s->metadata, "umid", temp, 0)) < 0)
-                return ret;
-        }
-
-        avio_skip(s->pb, 190);
-    } else
-        avio_skip(s->pb, 254);
-
-    if (size > 602) {
-        /* CodingHistory present */
-        size -= 602;
-
-        if (!(coding_history = av_malloc(size + 1)))
-            return AVERROR(ENOMEM);
-
-        if ((ret = avio_read(s->pb, coding_history, size)) < 0)
-            return ret;
-
-        coding_history[size] = 0;
-        if ((ret = av_dict_set(&s->metadata, "coding_history", coding_history,
-                               AV_DICT_DONT_STRDUP_VAL)) < 0)
-            return ret;
-    }
-
-    return 0;
-}
-
-static const AVMetadataConv wav_metadata_conv[] = {
-    { "description",      "comment"       },
-    { "originator",       "encoded_by"    },
-    { "origination_date", "date"          },
-    { "origination_time", "creation_time" },
-    { 0 },
-};
-
-/* wav input */
-static int wav_read_header(AVFormatContext *s)
-{
-    int64_t size, av_uninit(data_size);
-    int64_t sample_count = 0;
-    int rf64;
-    uint32_t tag;
-    AVIOContext *pb      = s->pb;
-    AVStream *st         = NULL;
-    WAVDemuxContext *wav = s->priv_data;
-    int ret, got_fmt = 0;
-    int64_t next_tag_ofs, data_ofs = -1;
-
-    /* check RIFF header */
-    tag = avio_rl32(pb);
-
-    rf64 = tag == MKTAG('R', 'F', '6', '4');
-    if (!rf64 && tag != MKTAG('R', 'I', 'F', 'F'))
-        return AVERROR_INVALIDDATA;
-    avio_rl32(pb); /* file size */
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('W', 'A', 'V', 'E'))
-        return AVERROR_INVALIDDATA;
-
-    if (rf64) {
-        if (avio_rl32(pb) != MKTAG('d', 's', '6', '4'))
-            return AVERROR_INVALIDDATA;
-        size = avio_rl32(pb);
-        if (size < 16)
-            return AVERROR_INVALIDDATA;
-        avio_rl64(pb); /* RIFF size */
-
-        data_size    = avio_rl64(pb);
-        sample_count = avio_rl64(pb);
-
-        if (data_size < 0 || sample_count < 0) {
-            av_log(s, AV_LOG_ERROR, "negative data_size and/or sample_count in "
-                   "ds64: data_size = %"PRId64", sample_count = %"PRId64"\n",
-                   data_size, sample_count);
-            return AVERROR_INVALIDDATA;
-        }
-        avio_skip(pb, size - 16); /* skip rest of ds64 chunk */
-    }
-
-    for (;;) {
-        size         = next_tag(pb, &tag);
-        next_tag_ofs = avio_tell(pb) + size;
-
-        if (pb->eof_reached)
-            break;
-
-        switch (tag) {
-        case MKTAG('f', 'm', 't', ' '):
-            /* only parse the first 'fmt ' tag found */
-            if (!got_fmt && (ret = wav_parse_fmt_tag(s, size, &st) < 0)) {
-                return ret;
-            } else if (got_fmt)
-                av_log(s, AV_LOG_WARNING, "found more than one 'fmt ' tag\n");
-
-            got_fmt = 1;
-            break;
-        case MKTAG('d', 'a', 't', 'a'):
-            if (!got_fmt) {
-                av_log(s, AV_LOG_ERROR,
-                       "found no 'fmt ' tag before the 'data' tag\n");
-                return AVERROR_INVALIDDATA;
-            }
-
-            if (rf64) {
-                next_tag_ofs = wav->data_end = avio_tell(pb) + data_size;
-            } else {
-                data_size    = size;
-                next_tag_ofs = wav->data_end = size ? next_tag_ofs : INT64_MAX;
-            }
-
-            data_ofs = avio_tell(pb);
-
-            /* don't look for footer metadata if we can't seek or if we don't
-             * know where the data tag ends
-             */
-            if (!pb->seekable || (!rf64 && !size))
-                goto break_loop;
-            break;
-        case MKTAG('f', 'a', 'c', 't'):
-            if (!sample_count)
-                sample_count = avio_rl32(pb);
-            break;
-        case MKTAG('b', 'e', 'x', 't'):
-            if ((ret = wav_parse_bext_tag(s, size)) < 0)
-                return ret;
-            break;
-        case MKTAG('L', 'I', 'S', 'T'):
-            if (size < 4) {
-                av_log(s, AV_LOG_ERROR, "too short LIST");
-                return AVERROR_INVALIDDATA;
-            }
-            switch (avio_rl32(pb)) {
-            case MKTAG('I', 'N', 'F', 'O'):
-                if ((ret = ff_read_riff_info(s, size - 4)) < 0)
-                    return ret;
-            }
-            break;
-        }
-
-        /* seek to next tag unless we know that we'll run into EOF */
-        if ((avio_size(pb) > 0 && next_tag_ofs >= avio_size(pb)) ||
-            wav_seek_tag(pb, next_tag_ofs, SEEK_SET) < 0) {
-            break;
-        }
-    }
-
-break_loop:
-    if (data_ofs < 0) {
-        av_log(s, AV_LOG_ERROR, "no 'data' tag found\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avio_seek(pb, data_ofs, SEEK_SET);
-
-    if (!sample_count && st->codec->channels &&
-        av_get_bits_per_sample(st->codec->codec_id))
-        sample_count = (data_size << 3) /
-                       (st->codec->channels *
-                        (uint64_t)av_get_bits_per_sample(st->codec->codec_id));
-    if (sample_count)
-        st->duration = sample_count;
-
-    ff_metadata_conv_ctx(s, NULL, wav_metadata_conv);
-    ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv);
-
-    return 0;
-}
-
-/**
- * Find chunk with w64 GUID by skipping over other chunks.
- * @return the size of the found chunk
- */
-static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16])
-{
-    uint8_t guid[16];
-    int64_t size;
-
-    while (!pb->eof_reached) {
-        avio_read(pb, guid, 16);
-        size = avio_rl64(pb);
-        if (size <= 24)
-            return -1;
-        if (!memcmp(guid, guid1, 16))
-            return size;
-        avio_skip(pb, FFALIGN(size, INT64_C(8)) - 24);
-    }
-    return -1;
-}
-
-static const uint8_t guid_data[16] = {
-    'd',  'a',  't',  'a',
-    0xF3, 0xAC, 0xD3, 0x11,0x8C,  0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A
-};
-
-#define MAX_SIZE 4096
-
-static int wav_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, size;
-    int64_t left;
-    AVStream *st;
-    WAVDemuxContext *wav = s->priv_data;
-
-    st = s->streams[0];
-
-    left = wav->data_end - avio_tell(s->pb);
-    if (left <= 0) {
-        if (CONFIG_W64_DEMUXER && wav->w64)
-            left = find_guid(s->pb, guid_data) - 24;
-        else
-            left = find_tag(s->pb, MKTAG('d', 'a', 't', 'a'));
-        if (left < 0)
-            return AVERROR_EOF;
-        wav->data_end = avio_tell(s->pb) + left;
-    }
-
-    size = MAX_SIZE;
-    if (st->codec->block_align > 1) {
-        if (size < st->codec->block_align)
-            size = st->codec->block_align;
-        size = (size / st->codec->block_align) * st->codec->block_align;
-    }
-    size = FFMIN(size, left);
-    ret  = av_get_packet(s->pb, pkt, size);
-    if (ret < 0)
-        return ret;
-    pkt->stream_index = 0;
-
-    return ret;
-}
-
-static int wav_read_seek(AVFormatContext *s,
-                         int stream_index, int64_t timestamp, int flags)
-{
-    AVStream *st;
-
-    st = s->streams[0];
-    switch (st->codec->codec_id) {
-    case AV_CODEC_ID_MP2:
-    case AV_CODEC_ID_MP3:
-    case AV_CODEC_ID_AC3:
-    case AV_CODEC_ID_DTS:
-        /* use generic seeking with dynamically generated indexes */
-        return -1;
-    default:
-        break;
-    }
-    return ff_pcm_read_seek(s, stream_index, timestamp, flags);
-}
-
-AVInputFormat ff_wav_demuxer = {
-    .name           = "wav",
-    .long_name      = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
-    .priv_data_size = sizeof(WAVDemuxContext),
-    .read_probe     = wav_probe,
-    .read_header    = wav_read_header,
-    .read_packet    = wav_read_packet,
-    .read_seek      = wav_read_seek,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .codec_tag      = (const AVCodecTag * const []) { ff_codec_wav_tags,  0 },
-};
-#endif /* CONFIG_WAV_DEMUXER */
-
-#if CONFIG_W64_DEMUXER
-static const uint8_t guid_riff[16] = {
-    'r',  'i',  'f',  'f',
-    0x2E, 0x91, 0xCF, 0x11,0xA5,  0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00
-};
-
-static const uint8_t guid_wave[16] = {
-    'w',  'a',  'v',  'e',
-    0xF3, 0xAC, 0xD3, 0x11,0x8C,  0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A
-};
-
-static const uint8_t guid_fmt[16] = {
-    'f',  'm',  't',  ' ',
-    0xF3, 0xAC, 0xD3, 0x11,0x8C,  0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A
-};
-
-static int w64_probe(AVProbeData *p)
-{
-    if (p->buf_size <= 40)
-        return 0;
-    if (!memcmp(p->buf,      guid_riff, 16) &&
-        !memcmp(p->buf + 24, guid_wave, 16))
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int w64_read_header(AVFormatContext *s)
-{
-    int64_t size;
-    AVIOContext *pb      = s->pb;
-    WAVDemuxContext *wav = s->priv_data;
-    AVStream *st;
-    uint8_t guid[16];
-    int ret;
-
-    avio_read(pb, guid, 16);
-    if (memcmp(guid, guid_riff, 16))
-        return AVERROR_INVALIDDATA;
-
-    /* riff + wave + fmt + sizes */
-    if (avio_rl64(pb) < 16 + 8 + 16 + 8 + 16 + 8)
-        return AVERROR_INVALIDDATA;
-
-    avio_read(pb, guid, 16);
-    if (memcmp(guid, guid_wave, 16)) {
-        av_log(s, AV_LOG_ERROR, "could not find wave guid\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    size = find_guid(pb, guid_fmt);
-    if (size < 0) {
-        av_log(s, AV_LOG_ERROR, "could not find fmt guid\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    /* subtract chunk header size - normal wav file doesn't count it */
-    ret = ff_get_wav_header(pb, st->codec, size - 24);
-    if (ret < 0)
-        return ret;
-    avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
-
-    st->need_parsing = AVSTREAM_PARSE_FULL;
-
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-
-    size = find_guid(pb, guid_data);
-    if (size < 0) {
-        av_log(s, AV_LOG_ERROR, "could not find data guid\n");
-        return AVERROR_INVALIDDATA;
-    }
-    wav->data_end = avio_tell(pb) + size - 24;
-    wav->w64      = 1;
-
-    return 0;
-}
-
-AVInputFormat ff_w64_demuxer = {
-    .name           = "w64",
-    .long_name      = NULL_IF_CONFIG_SMALL("Sony Wave64"),
-    .priv_data_size = sizeof(WAVDemuxContext),
-    .read_probe     = w64_probe,
-    .read_header    = w64_read_header,
-    .read_packet    = wav_read_packet,
-    .read_seek      = wav_read_seek,
-    .flags          = AVFMT_GENERIC_INDEX,
-    .codec_tag      = (const AVCodecTag * const []) { ff_codec_wav_tags, 0 },
-};
-#endif /* CONFIG_W64_DEMUXER */
diff --git a/deps/libav/libavformat/wavenc.c b/deps/libav/libavformat/wavenc.c
deleted file mode 100644
index 86ed557..0000000
--- a/deps/libav/libavformat/wavenc.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * WAV muxer
- * Copyright (c) 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include "libavutil/dict.h"
-#include "libavutil/common.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-
-#include "avformat.h"
-#include "avio.h"
-#include "avio_internal.h"
-#include "internal.h"
-#include "riff.h"
-
-typedef struct WAVMuxContext {
-    const AVClass *class;
-    int64_t data;
-    int64_t fact_pos;
-    int64_t minpts;
-    int64_t maxpts;
-    int last_duration;
-    int write_bext;
-} WAVMuxContext;
-
-static inline void bwf_write_bext_string(AVFormatContext *s, const char *key, int maxlen)
-{
-    AVDictionaryEntry *tag;
-    int len = 0;
-
-    if (tag = av_dict_get(s->metadata, key, NULL, 0)) {
-        len = strlen(tag->value);
-        len = FFMIN(len, maxlen);
-        avio_write(s->pb, tag->value, len);
-    }
-
-    ffio_fill(s->pb, 0, maxlen - len);
-}
-
-static void bwf_write_bext_chunk(AVFormatContext *s)
-{
-    AVDictionaryEntry *tmp_tag;
-    uint64_t time_reference = 0;
-    int64_t bext = ff_start_tag(s->pb, "bext");
-
-    bwf_write_bext_string(s, "description", 256);
-    bwf_write_bext_string(s, "originator", 32);
-    bwf_write_bext_string(s, "originator_reference", 32);
-    bwf_write_bext_string(s, "origination_date", 10);
-    bwf_write_bext_string(s, "origination_time", 8);
-
-    if (tmp_tag = av_dict_get(s->metadata, "time_reference", NULL, 0))
-        time_reference = strtoll(tmp_tag->value, NULL, 10);
-    avio_wl64(s->pb, time_reference);
-    avio_wl16(s->pb, 1);  // set version to 1
-
-    if (tmp_tag = av_dict_get(s->metadata, "umid", NULL, 0)) {
-        unsigned char umidpart_str[17] = {0};
-        int i;
-        uint64_t umidpart;
-        int len = strlen(tmp_tag->value+2);
-
-        for (i = 0; i < len/16; i++) {
-            memcpy(umidpart_str, tmp_tag->value + 2 + (i*16), 16);
-            umidpart = strtoll(umidpart_str, NULL, 16);
-            avio_wb64(s->pb, umidpart);
-        }
-        ffio_fill(s->pb, 0, 64 - i*8);
-    } else
-        ffio_fill(s->pb, 0, 64); // zero UMID
-
-    ffio_fill(s->pb, 0, 190); // Reserved
-
-    if (tmp_tag = av_dict_get(s->metadata, "coding_history", NULL, 0))
-        avio_put_str(s->pb, tmp_tag->value);
-
-    ff_end_tag(s->pb, bext);
-}
-
-static int wav_write_header(AVFormatContext *s)
-{
-    WAVMuxContext *wav = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int64_t fmt;
-
-    ffio_wfourcc(pb, "RIFF");
-    avio_wl32(pb, 0); /* file length */
-    ffio_wfourcc(pb, "WAVE");
-
-    /* format header */
-    fmt = ff_start_tag(pb, "fmt ");
-    if (ff_put_wav_header(pb, s->streams[0]->codec) < 0) {
-        av_log(s, AV_LOG_ERROR, "%s codec not supported in WAVE format\n",
-               s->streams[0]->codec->codec ? s->streams[0]->codec->codec->name : "NONE");
-        return -1;
-    }
-    ff_end_tag(pb, fmt);
-
-    if (s->streams[0]->codec->codec_tag != 0x01 /* hence for all other than PCM */
-        && s->pb->seekable) {
-        wav->fact_pos = ff_start_tag(pb, "fact");
-        avio_wl32(pb, 0);
-        ff_end_tag(pb, wav->fact_pos);
-    }
-
-    if (wav->write_bext)
-        bwf_write_bext_chunk(s);
-
-    avpriv_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
-    wav->maxpts = wav->last_duration = 0;
-    wav->minpts = INT64_MAX;
-
-    /* info header */
-    ff_riff_write_info(s);
-
-    /* data header */
-    wav->data = ff_start_tag(pb, "data");
-
-    avio_flush(pb);
-
-    return 0;
-}
-
-static int wav_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVIOContext *pb  = s->pb;
-    WAVMuxContext    *wav = s->priv_data;
-    avio_write(pb, pkt->data, pkt->size);
-    if(pkt->pts != AV_NOPTS_VALUE) {
-        wav->minpts        = FFMIN(wav->minpts, pkt->pts);
-        wav->maxpts        = FFMAX(wav->maxpts, pkt->pts);
-        wav->last_duration = pkt->duration;
-    } else
-        av_log(s, AV_LOG_ERROR, "wav_write_packet: NOPTS\n");
-    return 0;
-}
-
-static int wav_write_trailer(AVFormatContext *s)
-{
-    AVIOContext *pb  = s->pb;
-    WAVMuxContext    *wav = s->priv_data;
-    int64_t file_size;
-
-    avio_flush(pb);
-
-    if (s->pb->seekable) {
-        ff_end_tag(pb, wav->data);
-
-        /* update file size */
-        file_size = avio_tell(pb);
-        avio_seek(pb, 4, SEEK_SET);
-        avio_wl32(pb, (uint32_t)(file_size - 8));
-        avio_seek(pb, file_size, SEEK_SET);
-
-        avio_flush(pb);
-
-        if(s->streams[0]->codec->codec_tag != 0x01) {
-            /* Update num_samps in fact chunk */
-            int number_of_samples;
-            number_of_samples = av_rescale(wav->maxpts - wav->minpts + wav->last_duration,
-                                           s->streams[0]->codec->sample_rate * (int64_t)s->streams[0]->time_base.num,
-                                           s->streams[0]->time_base.den);
-            avio_seek(pb, wav->fact_pos, SEEK_SET);
-            avio_wl32(pb, number_of_samples);
-            avio_seek(pb, file_size, SEEK_SET);
-            avio_flush(pb);
-        }
-    }
-    return 0;
-}
-
-#define OFFSET(x) offsetof(WAVMuxContext, x)
-#define ENC AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption options[] = {
-    { "write_bext", "Write BEXT chunk.", OFFSET(write_bext), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, ENC },
-    { NULL },
-};
-
-static const AVClass wav_muxer_class = {
-    .class_name = "WAV muxer",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVOutputFormat ff_wav_muxer = {
-    .name              = "wav",
-    .long_name         = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
-    .mime_type         = "audio/x-wav",
-    .extensions        = "wav",
-    .priv_data_size    = sizeof(WAVMuxContext),
-    .audio_codec       = AV_CODEC_ID_PCM_S16LE,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = wav_write_header,
-    .write_packet      = wav_write_packet,
-    .write_trailer     = wav_write_trailer,
-    .flags             = AVFMT_TS_NONSTRICT,
-    .codec_tag         = (const AVCodecTag* const []){ ff_codec_wav_tags, 0 },
-    .priv_class        = &wav_muxer_class,
-};
diff --git a/deps/libav/libavformat/wc3movie.c b/deps/libav/libavformat/wc3movie.c
deleted file mode 100644
index c894253..0000000
--- a/deps/libav/libavformat/wc3movie.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Wing Commander III Movie (.mve) File Demuxer
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Wing Commander III Movie file demuxer
- * by Mike Melanson (melanson at pcisys.net)
- * for more information on the WC3 .mve file format, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define FORM_TAG MKTAG('F', 'O', 'R', 'M')
-#define MOVE_TAG MKTAG('M', 'O', 'V', 'E')
-#define  PC__TAG MKTAG('_', 'P', 'C', '_')
-#define SOND_TAG MKTAG('S', 'O', 'N', 'D')
-#define BNAM_TAG MKTAG('B', 'N', 'A', 'M')
-#define SIZE_TAG MKTAG('S', 'I', 'Z', 'E')
-#define PALT_TAG MKTAG('P', 'A', 'L', 'T')
-#define INDX_TAG MKTAG('I', 'N', 'D', 'X')
-#define BRCH_TAG MKTAG('B', 'R', 'C', 'H')
-#define SHOT_TAG MKTAG('S', 'H', 'O', 'T')
-#define VGA__TAG MKTAG('V', 'G', 'A', ' ')
-#define TEXT_TAG MKTAG('T', 'E', 'X', 'T')
-#define AUDI_TAG MKTAG('A', 'U', 'D', 'I')
-
-/* video resolution unless otherwise specified */
-#define WC3_DEFAULT_WIDTH 320
-#define WC3_DEFAULT_HEIGHT 165
-
-/* always use the same PCM audio parameters */
-#define WC3_SAMPLE_RATE 22050
-#define WC3_AUDIO_CHANNELS 1
-#define WC3_AUDIO_BITS 16
-
-/* nice, constant framerate */
-#define WC3_FRAME_FPS 15
-
-#define PALETTE_SIZE (256 * 3)
-
-typedef struct Wc3DemuxContext {
-    int width;
-    int height;
-    int64_t pts;
-    int video_stream_index;
-    int audio_stream_index;
-
-    AVPacket vpkt;
-
-} Wc3DemuxContext;
-
-static int wc3_probe(AVProbeData *p)
-{
-    if (p->buf_size < 12)
-        return 0;
-
-    if ((AV_RL32(&p->buf[0]) != FORM_TAG) ||
-        (AV_RL32(&p->buf[8]) != MOVE_TAG))
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int wc3_read_header(AVFormatContext *s)
-{
-    Wc3DemuxContext *wc3 = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned int fourcc_tag;
-    unsigned int size;
-    AVStream *st;
-    int ret = 0;
-    char *buffer;
-
-    /* default context members */
-    wc3->width = WC3_DEFAULT_WIDTH;
-    wc3->height = WC3_DEFAULT_HEIGHT;
-    wc3->pts = 0;
-    wc3->video_stream_index = wc3->audio_stream_index = 0;
-    av_init_packet(&wc3->vpkt);
-    wc3->vpkt.data = NULL; wc3->vpkt.size = 0;
-
-    /* skip the first 3 32-bit numbers */
-    avio_skip(pb, 12);
-
-    /* traverse through the chunks and load the header information before
-     * the first BRCH tag */
-    fourcc_tag = avio_rl32(pb);
-    size = (avio_rb32(pb) + 1) & (~1);
-
-    do {
-        switch (fourcc_tag) {
-
-        case SOND_TAG:
-        case INDX_TAG:
-            /* SOND unknown, INDX unnecessary; ignore both */
-            avio_skip(pb, size);
-            break;
-
-        case PC__TAG:
-            /* number of palettes, unneeded */
-            avio_skip(pb, 12);
-            break;
-
-        case BNAM_TAG:
-            /* load up the name */
-            buffer = av_malloc(size+1);
-            if (!buffer)
-                return AVERROR(ENOMEM);
-            if ((ret = avio_read(pb, buffer, size)) != size)
-                return AVERROR(EIO);
-            buffer[size] = 0;
-            av_dict_set(&s->metadata, "title", buffer,
-                                   AV_DICT_DONT_STRDUP_VAL);
-            break;
-
-        case SIZE_TAG:
-            /* video resolution override */
-            wc3->width  = avio_rl32(pb);
-            wc3->height = avio_rl32(pb);
-            break;
-
-        case PALT_TAG:
-            /* one of several palettes */
-            avio_seek(pb, -8, SEEK_CUR);
-            av_append_packet(pb, &wc3->vpkt, 8 + PALETTE_SIZE);
-            break;
-
-        default:
-            av_log(s, AV_LOG_ERROR, "  unrecognized WC3 chunk: %c%c%c%c (0x%02X%02X%02X%02X)\n",
-                (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24),
-                (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24));
-            return AVERROR_INVALIDDATA;
-        }
-
-        fourcc_tag = avio_rl32(pb);
-        /* chunk sizes are 16-bit aligned */
-        size = (avio_rb32(pb) + 1) & (~1);
-        if (pb->eof_reached)
-            return AVERROR(EIO);
-
-    } while (fourcc_tag != BRCH_TAG);
-
-    /* initialize the decoder streams */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    avpriv_set_pts_info(st, 33, 1, WC3_FRAME_FPS);
-    wc3->video_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_XAN_WC3;
-    st->codec->codec_tag = 0;  /* no fourcc */
-    st->codec->width = wc3->width;
-    st->codec->height = wc3->height;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    avpriv_set_pts_info(st, 33, 1, WC3_FRAME_FPS);
-    wc3->audio_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
-    st->codec->codec_tag = 1;
-    st->codec->channels = WC3_AUDIO_CHANNELS;
-    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-    st->codec->bits_per_coded_sample = WC3_AUDIO_BITS;
-    st->codec->sample_rate = WC3_SAMPLE_RATE;
-    st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
-        st->codec->bits_per_coded_sample;
-    st->codec->block_align = WC3_AUDIO_BITS * WC3_AUDIO_CHANNELS;
-
-    return 0;
-}
-
-static int wc3_read_packet(AVFormatContext *s,
-                           AVPacket *pkt)
-{
-    Wc3DemuxContext *wc3 = s->priv_data;
-    AVIOContext *pb = s->pb;
-    unsigned int fourcc_tag;
-    unsigned int size;
-    int packet_read = 0;
-    int ret = 0;
-    unsigned char text[1024];
-
-    while (!packet_read) {
-
-        fourcc_tag = avio_rl32(pb);
-        /* chunk sizes are 16-bit aligned */
-        size = (avio_rb32(pb) + 1) & (~1);
-        if (pb->eof_reached)
-            return AVERROR(EIO);
-
-        switch (fourcc_tag) {
-
-        case BRCH_TAG:
-            /* no-op */
-            break;
-
-        case SHOT_TAG:
-            /* load up new palette */
-            avio_seek(pb, -8, SEEK_CUR);
-            av_append_packet(pb, &wc3->vpkt, 8 + 4);
-            break;
-
-        case VGA__TAG:
-            /* send out video chunk */
-            avio_seek(pb, -8, SEEK_CUR);
-            ret= av_append_packet(pb, &wc3->vpkt, 8 + size);
-            // ignore error if we have some data
-            if (wc3->vpkt.size > 0)
-                ret = 0;
-            *pkt = wc3->vpkt;
-            wc3->vpkt.data = NULL; wc3->vpkt.size = 0;
-            pkt->stream_index = wc3->video_stream_index;
-            pkt->pts = wc3->pts;
-            packet_read = 1;
-            break;
-
-        case TEXT_TAG:
-            /* subtitle chunk */
-#if 0
-            avio_skip(pb, size);
-#else
-            if ((unsigned)size > sizeof(text) || (ret = avio_read(pb, text, size)) != size)
-                ret = AVERROR(EIO);
-            else {
-                int i = 0;
-                av_log (s, AV_LOG_DEBUG, "Subtitle time!\n");
-                av_log (s, AV_LOG_DEBUG, "  inglish: %s\n", &text[i + 1]);
-                i += text[i] + 1;
-                av_log (s, AV_LOG_DEBUG, "  doytsch: %s\n", &text[i + 1]);
-                i += text[i] + 1;
-                av_log (s, AV_LOG_DEBUG, "  fronsay: %s\n", &text[i + 1]);
-            }
-#endif
-            break;
-
-        case AUDI_TAG:
-            /* send out audio chunk */
-            ret= av_get_packet(pb, pkt, size);
-            pkt->stream_index = wc3->audio_stream_index;
-            pkt->pts = wc3->pts;
-
-            /* time to advance pts */
-            wc3->pts++;
-
-            packet_read = 1;
-            break;
-
-        default:
-            av_log (s, AV_LOG_ERROR, "  unrecognized WC3 chunk: %c%c%c%c (0x%02X%02X%02X%02X)\n",
-                (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24),
-                (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24));
-            ret = AVERROR_INVALIDDATA;
-            packet_read = 1;
-            break;
-        }
-    }
-
-    return ret;
-}
-
-static int wc3_read_close(AVFormatContext *s)
-{
-    Wc3DemuxContext *wc3 = s->priv_data;
-
-    if (wc3->vpkt.size > 0)
-        av_free_packet(&wc3->vpkt);
-
-    return 0;
-}
-
-AVInputFormat ff_wc3_demuxer = {
-    .name           = "wc3movie",
-    .long_name      = NULL_IF_CONFIG_SMALL("Wing Commander III movie"),
-    .priv_data_size = sizeof(Wc3DemuxContext),
-    .read_probe     = wc3_probe,
-    .read_header    = wc3_read_header,
-    .read_packet    = wc3_read_packet,
-    .read_close     = wc3_read_close,
-};
diff --git a/deps/libav/libavformat/westwood_aud.c b/deps/libav/libavformat/westwood_aud.c
deleted file mode 100644
index 611d223..0000000
--- a/deps/libav/libavformat/westwood_aud.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Westwood Studios AUD Format Demuxer
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Westwood Studios AUD file demuxer
- * by Mike Melanson (melanson at pcisys.net)
- * for more information on the Westwood file formats, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *   http://www.geocities.com/SiliconValley/8682/aud3.txt
- *
- * Implementation note: There is no definite file signature for AUD files.
- * The demuxer uses a probabilistic strategy for content detection. This
- * entails performing sanity checks on certain header values in order to
- * qualify a file. Refer to wsaud_probe() for the precise parameters.
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define AUD_HEADER_SIZE 12
-#define AUD_CHUNK_PREAMBLE_SIZE 8
-#define AUD_CHUNK_SIGNATURE 0x0000DEAF
-
-static int wsaud_probe(AVProbeData *p)
-{
-    int field;
-
-    /* Probabilistic content detection strategy: There is no file signature
-     * so perform sanity checks on various header parameters:
-     *   8000 <= sample rate (16 bits) <= 48000  ==> 40001 acceptable numbers
-     *   flags <= 0x03 (2 LSBs are used)         ==> 4 acceptable numbers
-     *   compression type (8 bits) = 1 or 99     ==> 2 acceptable numbers
-     *   first audio chunk signature (32 bits)   ==> 1 acceptable number
-     * The number space contains 2^64 numbers. There are 40001 * 4 * 2 * 1 =
-     * 320008 acceptable number combinations.
-     */
-
-    if (p->buf_size < AUD_HEADER_SIZE + AUD_CHUNK_PREAMBLE_SIZE)
-        return 0;
-
-    /* check sample rate */
-    field = AV_RL16(&p->buf[0]);
-    if ((field < 8000) || (field > 48000))
-        return 0;
-
-    /* enforce the rule that the top 6 bits of this flags field are reserved (0);
-     * this might not be true, but enforce it until deemed unnecessary */
-    if (p->buf[10] & 0xFC)
-        return 0;
-
-    /* note: only check for WS IMA (type 99) right now since there is no
-     * support for type 1 */
-    if (p->buf[11] != 99 && p->buf[11] != 1)
-        return 0;
-
-    /* read ahead to the first audio chunk and validate the first header signature */
-    if (AV_RL32(&p->buf[16]) != AUD_CHUNK_SIGNATURE)
-        return 0;
-
-    /* return 1/2 certainty since this file check is a little sketchy */
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-static int wsaud_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    unsigned char header[AUD_HEADER_SIZE];
-    int sample_rate, channels, codec;
-
-    if (avio_read(pb, header, AUD_HEADER_SIZE) != AUD_HEADER_SIZE)
-        return AVERROR(EIO);
-
-    sample_rate = AV_RL16(&header[0]);
-    channels    = (header[10] & 0x1) + 1;
-    codec       = header[11];
-
-    /* initialize the audio decoder stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    switch (codec) {
-    case  1:
-        if (channels != 1) {
-            avpriv_request_sample(s, "Stereo WS-SND1");
-            return AVERROR_PATCHWELCOME;
-        }
-        st->codec->codec_id = AV_CODEC_ID_WESTWOOD_SND1;
-        break;
-    case 99:
-        st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_WS;
-        st->codec->bits_per_coded_sample = 4;
-        st->codec->bit_rate = channels * sample_rate * 4;
-        break;
-    default:
-        avpriv_request_sample(s, "Unknown codec: %d", codec);
-        return AVERROR_PATCHWELCOME;
-    }
-    avpriv_set_pts_info(st, 64, 1, sample_rate);
-    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
-    st->codec->channels    = channels;
-    st->codec->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO :
-                                                AV_CH_LAYOUT_STEREO;
-    st->codec->sample_rate = sample_rate;
-
-    return 0;
-}
-
-static int wsaud_read_packet(AVFormatContext *s,
-                             AVPacket *pkt)
-{
-    AVIOContext *pb = s->pb;
-    unsigned char preamble[AUD_CHUNK_PREAMBLE_SIZE];
-    unsigned int chunk_size;
-    int ret = 0;
-    AVStream *st = s->streams[0];
-
-    if (avio_read(pb, preamble, AUD_CHUNK_PREAMBLE_SIZE) !=
-        AUD_CHUNK_PREAMBLE_SIZE)
-        return AVERROR(EIO);
-
-    /* validate the chunk */
-    if (AV_RL32(&preamble[4]) != AUD_CHUNK_SIGNATURE)
-        return AVERROR_INVALIDDATA;
-
-    chunk_size = AV_RL16(&preamble[0]);
-
-    if (st->codec->codec_id == AV_CODEC_ID_WESTWOOD_SND1) {
-        /* For Westwood SND1 audio we need to add the output size and input
-           size to the start of the packet to match what is in VQA.
-           Specifically, this is needed to signal when a packet should be
-           decoding as raw 8-bit pcm or variable-size ADPCM. */
-        int out_size = AV_RL16(&preamble[2]);
-        if ((ret = av_new_packet(pkt, chunk_size + 4)))
-            return ret;
-        if ((ret = avio_read(pb, &pkt->data[4], chunk_size)) != chunk_size)
-            return ret < 0 ? ret : AVERROR(EIO);
-        AV_WL16(&pkt->data[0], out_size);
-        AV_WL16(&pkt->data[2], chunk_size);
-
-        pkt->duration = out_size;
-    } else {
-        ret = av_get_packet(pb, pkt, chunk_size);
-        if (ret != chunk_size)
-            return AVERROR(EIO);
-
-        /* 2 samples/byte, 1 or 2 samples per frame depending on stereo */
-        pkt->duration = (chunk_size * 2) / st->codec->channels;
-    }
-    pkt->stream_index = st->index;
-
-    return ret;
-}
-
-AVInputFormat ff_wsaud_demuxer = {
-    .name           = "wsaud",
-    .long_name      = NULL_IF_CONFIG_SMALL("Westwood Studios audio"),
-    .read_probe     = wsaud_probe,
-    .read_header    = wsaud_read_header,
-    .read_packet    = wsaud_read_packet,
-};
diff --git a/deps/libav/libavformat/westwood_vqa.c b/deps/libav/libavformat/westwood_vqa.c
deleted file mode 100644
index 77da375..0000000
--- a/deps/libav/libavformat/westwood_vqa.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Westwood Studios VQA Format Demuxer
- * Copyright (c) 2003 The ffmpeg Project
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Westwood Studios VQA file demuxer
- * by Mike Melanson (melanson at pcisys.net)
- * for more information on the Westwood file formats, visit:
- *   http://www.pcisys.net/~melanson/codecs/
- *   http://www.geocities.com/SiliconValley/8682/aud3.txt
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define FORM_TAG MKBETAG('F', 'O', 'R', 'M')
-#define WVQA_TAG MKBETAG('W', 'V', 'Q', 'A')
-#define VQHD_TAG MKBETAG('V', 'Q', 'H', 'D')
-#define FINF_TAG MKBETAG('F', 'I', 'N', 'F')
-#define SND0_TAG MKBETAG('S', 'N', 'D', '0')
-#define SND1_TAG MKBETAG('S', 'N', 'D', '1')
-#define SND2_TAG MKBETAG('S', 'N', 'D', '2')
-#define VQFR_TAG MKBETAG('V', 'Q', 'F', 'R')
-
-/* don't know what these tags are for, but acknowledge their existence */
-#define CINF_TAG MKBETAG('C', 'I', 'N', 'F')
-#define CINH_TAG MKBETAG('C', 'I', 'N', 'H')
-#define CIND_TAG MKBETAG('C', 'I', 'N', 'D')
-#define PINF_TAG MKBETAG('P', 'I', 'N', 'F')
-#define PINH_TAG MKBETAG('P', 'I', 'N', 'H')
-#define PIND_TAG MKBETAG('P', 'I', 'N', 'D')
-#define CMDS_TAG MKBETAG('C', 'M', 'D', 'S')
-
-#define VQA_HEADER_SIZE 0x2A
-#define VQA_PREAMBLE_SIZE 8
-
-typedef struct WsVqaDemuxContext {
-    int version;
-    int bps;
-    int channels;
-    int sample_rate;
-    int audio_stream_index;
-    int video_stream_index;
-} WsVqaDemuxContext;
-
-static int wsvqa_probe(AVProbeData *p)
-{
-    /* need 12 bytes to qualify */
-    if (p->buf_size < 12)
-        return 0;
-
-    /* check for the VQA signatures */
-    if ((AV_RB32(&p->buf[0]) != FORM_TAG) ||
-        (AV_RB32(&p->buf[8]) != WVQA_TAG))
-        return 0;
-
-    return AVPROBE_SCORE_MAX;
-}
-
-static int wsvqa_read_header(AVFormatContext *s)
-{
-    WsVqaDemuxContext *wsvqa = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    unsigned char *header;
-    unsigned char scratch[VQA_PREAMBLE_SIZE];
-    unsigned int chunk_tag;
-    unsigned int chunk_size;
-    int fps;
-
-    /* initialize the video decoder stream */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->start_time = 0;
-    wsvqa->video_stream_index = st->index;
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = AV_CODEC_ID_WS_VQA;
-    st->codec->codec_tag = 0;  /* no fourcc */
-
-    /* skip to the start of the VQA header */
-    avio_seek(pb, 20, SEEK_SET);
-
-    /* the VQA header needs to go to the decoder */
-    st->codec->extradata_size = VQA_HEADER_SIZE;
-    st->codec->extradata = av_mallocz(VQA_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
-    header = (unsigned char *)st->codec->extradata;
-    if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
-        VQA_HEADER_SIZE) {
-        return AVERROR(EIO);
-    }
-    st->codec->width = AV_RL16(&header[6]);
-    st->codec->height = AV_RL16(&header[8]);
-    fps = header[12];
-    st->nb_frames =
-    st->duration  = AV_RL16(&header[4]);
-    if (fps < 1 || fps > 30) {
-        av_log(s, AV_LOG_ERROR, "invalid fps: %d\n", fps);
-        return AVERROR_INVALIDDATA;
-    }
-    avpriv_set_pts_info(st, 64, 1, fps);
-
-    wsvqa->version      = AV_RL16(&header[ 0]);
-    wsvqa->sample_rate  = AV_RL16(&header[24]);
-    wsvqa->channels     = header[26];
-    wsvqa->bps          = header[27];
-    wsvqa->audio_stream_index = -1;
-
-    s->ctx_flags |= AVFMTCTX_NOHEADER;
-
-    /* there are 0 or more chunks before the FINF chunk; iterate until
-     * FINF has been skipped and the file will be ready to be demuxed */
-    do {
-        if (avio_read(pb, scratch, VQA_PREAMBLE_SIZE) != VQA_PREAMBLE_SIZE) {
-            return AVERROR(EIO);
-        }
-        chunk_tag = AV_RB32(&scratch[0]);
-        chunk_size = AV_RB32(&scratch[4]);
-
-        /* catch any unknown header tags, for curiousity */
-        switch (chunk_tag) {
-        case CINF_TAG:
-        case CINH_TAG:
-        case CIND_TAG:
-        case PINF_TAG:
-        case PINH_TAG:
-        case PIND_TAG:
-        case FINF_TAG:
-        case CMDS_TAG:
-            break;
-
-        default:
-            av_log (s, AV_LOG_ERROR, " note: unknown chunk seen (%c%c%c%c)\n",
-                scratch[0], scratch[1],
-                scratch[2], scratch[3]);
-            break;
-        }
-
-        avio_skip(pb, chunk_size);
-    } while (chunk_tag != FINF_TAG);
-
-    return 0;
-}
-
-static int wsvqa_read_packet(AVFormatContext *s,
-                             AVPacket *pkt)
-{
-    WsVqaDemuxContext *wsvqa = s->priv_data;
-    AVIOContext *pb = s->pb;
-    int ret = -1;
-    unsigned char preamble[VQA_PREAMBLE_SIZE];
-    unsigned int chunk_type;
-    unsigned int chunk_size;
-    int skip_byte;
-
-    while (avio_read(pb, preamble, VQA_PREAMBLE_SIZE) == VQA_PREAMBLE_SIZE) {
-        chunk_type = AV_RB32(&preamble[0]);
-        chunk_size = AV_RB32(&preamble[4]);
-        skip_byte = chunk_size & 0x01;
-
-        if ((chunk_type == SND0_TAG) || (chunk_type == SND1_TAG) ||
-            (chunk_type == SND2_TAG) || (chunk_type == VQFR_TAG)) {
-
-            if (av_new_packet(pkt, chunk_size))
-                return AVERROR(EIO);
-            ret = avio_read(pb, pkt->data, chunk_size);
-            if (ret != chunk_size) {
-                av_free_packet(pkt);
-                return AVERROR(EIO);
-            }
-
-            switch (chunk_type) {
-            case SND0_TAG:
-            case SND1_TAG:
-            case SND2_TAG:
-                if (wsvqa->audio_stream_index == -1) {
-                    AVStream *st = avformat_new_stream(s, NULL);
-                    if (!st)
-                        return AVERROR(ENOMEM);
-
-                    wsvqa->audio_stream_index = st->index;
-                    if (!wsvqa->sample_rate)
-                        wsvqa->sample_rate = 22050;
-                    if (!wsvqa->channels)
-                        wsvqa->channels = 1;
-                    if (!wsvqa->bps)
-                        wsvqa->bps = 8;
-                    st->codec->sample_rate = wsvqa->sample_rate;
-                    st->codec->bits_per_coded_sample = wsvqa->bps;
-                    st->codec->channels = wsvqa->channels;
-                    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-
-                    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-
-                    switch (chunk_type) {
-                    case SND0_TAG:
-                        if (wsvqa->bps == 16)
-                            st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
-                        else
-                            st->codec->codec_id = AV_CODEC_ID_PCM_U8;
-                        break;
-                    case SND1_TAG:
-                        st->codec->codec_id = AV_CODEC_ID_WESTWOOD_SND1;
-                        break;
-                    case SND2_TAG:
-                        st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_WS;
-                        st->codec->extradata_size = 2;
-                        st->codec->extradata = av_mallocz(2 + FF_INPUT_BUFFER_PADDING_SIZE);
-                        if (!st->codec->extradata)
-                            return AVERROR(ENOMEM);
-                        AV_WL16(st->codec->extradata, wsvqa->version);
-                        break;
-                    }
-                }
-
-                pkt->stream_index = wsvqa->audio_stream_index;
-                switch (chunk_type) {
-                case SND1_TAG:
-                    /* unpacked size is stored in header */
-                    pkt->duration = AV_RL16(pkt->data) / wsvqa->channels;
-                    break;
-                case SND2_TAG:
-                    /* 2 samples/byte, 1 or 2 samples per frame depending on stereo */
-                    pkt->duration = (chunk_size * 2) / wsvqa->channels;
-                    break;
-                }
-                break;
-            case VQFR_TAG:
-                pkt->stream_index = wsvqa->video_stream_index;
-                pkt->duration = 1;
-                break;
-            }
-
-            /* stay on 16-bit alignment */
-            if (skip_byte)
-                avio_skip(pb, 1);
-
-            return ret;
-        } else {
-            switch(chunk_type){
-            case CMDS_TAG:
-                break;
-            default:
-                av_log(s, AV_LOG_INFO, "Skipping unknown chunk 0x%08X\n", chunk_type);
-            }
-            avio_skip(pb, chunk_size + skip_byte);
-        }
-    }
-
-    return ret;
-}
-
-AVInputFormat ff_wsvqa_demuxer = {
-    .name           = "wsvqa",
-    .long_name      = NULL_IF_CONFIG_SMALL("Westwood Studios VQA"),
-    .priv_data_size = sizeof(WsVqaDemuxContext),
-    .read_probe     = wsvqa_probe,
-    .read_header    = wsvqa_read_header,
-    .read_packet    = wsvqa_read_packet,
-};
diff --git a/deps/libav/libavformat/wtv.c b/deps/libav/libavformat/wtv.c
deleted file mode 100644
index 0c24fd7..0000000
--- a/deps/libav/libavformat/wtv.c
+++ /dev/null
@@ -1,1115 +0,0 @@
-/*
- * Windows Television (WTV) demuxer
- * Copyright (c) 2010-2011 Peter Ross <pross at xvid.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Windows Television (WTV) demuxer
- * @author Peter Ross <pross at xvid.org>
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "internal.h"
-#include "riff.h"
-#include "asf.h"
-#include "mpegts.h"
-
-/* Macros for formating GUIDs */
-#define PRI_PRETTY_GUID \
-    "%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x"
-#define ARG_PRETTY_GUID(g) \
-    AV_RL32(g),AV_RL16(g+4),AV_RL16(g+6),g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]
-#define LEN_PRETTY_GUID 34
-
-/*
- *
- * File system routines
- *
- */
-
-#define WTV_SECTOR_BITS    12
-#define WTV_SECTOR_SIZE    (1 << WTV_SECTOR_BITS)
-#define WTV_BIGSECTOR_BITS 18
-
-#define SHIFT_SECTOR_BITS(a) ((int64_t)(a) << WTV_SECTOR_BITS)
-
-typedef struct {
-    AVIOContext *pb_filesystem;  /** file system (AVFormatContext->pb) */
-
-    int sector_bits;     /** sector shift bits; used to convert sector number into pb_filesystem offset */
-    uint32_t *sectors;   /** file allocation table */
-    int nb_sectors;      /** number of sectors */
-
-    int error;
-    int64_t position;
-    int64_t length;
-} WtvFile;
-
-static int64_t seek_by_sector(AVIOContext *pb, int64_t sector, int64_t offset)
-{
-    return avio_seek(pb, SHIFT_SECTOR_BITS(sector) + offset, SEEK_SET);
-}
-
-/**
- * @return bytes read, 0 on end of file, or <0 on error
- */
-static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
-{
-    WtvFile *wf = opaque;
-    AVIOContext *pb = wf->pb_filesystem;
-    int nread = 0;
-
-    if (wf->error || pb->error)
-        return -1;
-    if (wf->position >= wf->length || pb->eof_reached)
-        return 0;
-
-    buf_size = FFMIN(buf_size, wf->length - wf->position);
-    while(nread < buf_size) {
-        int n;
-        int remaining_in_sector = (1 << wf->sector_bits) - (wf->position & ((1 << wf->sector_bits) - 1));
-        int read_request        = FFMIN(buf_size - nread, remaining_in_sector);
-
-        n = avio_read(pb, buf, read_request);
-        if (n <= 0)
-            break;
-        nread += n;
-        buf += n;
-        wf->position += n;
-        if (n == remaining_in_sector) {
-            int i = wf->position >> wf->sector_bits;
-            if (i >= wf->nb_sectors ||
-                (wf->sectors[i] != wf->sectors[i - 1] + (1 << (wf->sector_bits - WTV_SECTOR_BITS)) &&
-                seek_by_sector(pb, wf->sectors[i], 0) < 0)) {
-                wf->error = 1;
-                break;
-            }
-        }
-    }
-    return nread;
-}
-
-/**
- * @return position (or file length)
- */
-static int64_t wtvfile_seek(void *opaque, int64_t offset, int whence)
-{
-    WtvFile *wf = opaque;
-    AVIOContext *pb = wf->pb_filesystem;
-
-    if (whence == AVSEEK_SIZE)
-        return wf->length;
-    else if (whence == SEEK_CUR)
-        offset = wf->position + offset;
-    else if (whence == SEEK_END)
-        offset = wf->length;
-
-    wf->error = offset < 0 || offset >= wf->length ||
-                seek_by_sector(pb, wf->sectors[offset >> wf->sector_bits],
-                               offset & ((1 << wf->sector_bits) - 1)) < 0;
-    wf->position = offset;
-    return offset;
-}
-
-/**
- * read non-zero integers (le32) from input stream
- * @param pb
- * @param[out] data destination
- * @param     count maximum number of integers to read
- * @return    total number of integers read
- */
-static int read_ints(AVIOContext *pb, uint32_t *data, int count)
-{
-    int i, total = 0;
-    for (i = 0; i < count; i++) {
-        if ((data[total] = avio_rl32(pb)))
-           total++;
-    }
-    return total;
-}
-
-/**
- * Open file
- * @param first_sector  First sector
- * @param length        Length of file (bytes)
- * @param depth         File allocation table depth
- * @return NULL on error
- */
-static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s)
-{
-    AVIOContext *pb;
-    WtvFile *wf;
-    uint8_t *buffer;
-
-    if (seek_by_sector(s->pb, first_sector, 0) < 0)
-        return NULL;
-
-    wf = av_mallocz(sizeof(WtvFile));
-    if (!wf)
-        return NULL;
-
-    if (depth == 0) {
-        wf->sectors = av_malloc(sizeof(uint32_t));
-        if (!wf->sectors) {
-            av_free(wf);
-            return NULL;
-        }
-        wf->sectors[0]  = first_sector;
-        wf->nb_sectors  = 1;
-        wf->sector_bits = WTV_SECTOR_BITS;
-    } else if (depth == 1) {
-        wf->sectors = av_malloc(WTV_SECTOR_SIZE);
-        if (!wf->sectors) {
-            av_free(wf);
-            return NULL;
-        }
-        wf->nb_sectors  = read_ints(s->pb, wf->sectors, WTV_SECTOR_SIZE / 4);
-        wf->sector_bits = length & (1ULL<<63) ? WTV_SECTOR_BITS : WTV_BIGSECTOR_BITS;
-    } else if (depth == 2) {
-        uint32_t sectors1[WTV_SECTOR_SIZE / 4];
-        int nb_sectors1 = read_ints(s->pb, sectors1, WTV_SECTOR_SIZE / 4);
-        int i;
-
-        wf->sectors = av_malloc(SHIFT_SECTOR_BITS(nb_sectors1));
-        if (!wf->sectors) {
-            av_free(wf);
-            return NULL;
-        }
-        wf->nb_sectors = 0;
-        for (i = 0; i < nb_sectors1; i++) {
-            if (seek_by_sector(s->pb, sectors1[i], 0) < 0)
-                break;
-            wf->nb_sectors += read_ints(s->pb, wf->sectors + i * WTV_SECTOR_SIZE / 4, WTV_SECTOR_SIZE / 4);
-        }
-        wf->sector_bits = length & (1ULL<<63) ? WTV_SECTOR_BITS : WTV_BIGSECTOR_BITS;
-    } else {
-        av_log(s, AV_LOG_ERROR, "unsupported file allocation table depth (0x%x)\n", depth);
-        av_free(wf);
-        return NULL;
-    }
-
-    if (!wf->nb_sectors) {
-        av_free(wf->sectors);
-        av_free(wf);
-        return NULL;
-    }
-
-    /* check length */
-    length &= 0xFFFFFFFFFFFF;
-    if (length > ((int64_t)wf->nb_sectors << wf->sector_bits)) {
-        av_log(s, AV_LOG_WARNING, "reported file length (0x%"PRIx64") exceeds number of available sectors (0x%"PRIx64")\n", length, (int64_t)wf->nb_sectors << wf->sector_bits);
-        length = (int64_t)wf->nb_sectors <<  wf->sector_bits;
-    }
-    wf->length = length;
-
-    /* seek to initial sector */
-    wf->position = 0;
-    if (seek_by_sector(s->pb, wf->sectors[0], 0) < 0) {
-        av_free(wf->sectors);
-        av_free(wf);
-        return NULL;
-    }
-
-    wf->pb_filesystem = s->pb;
-    buffer = av_malloc(1 << wf->sector_bits);
-    if (!buffer) {
-        av_free(wf->sectors);
-        av_free(wf);
-        return NULL;
-    }
-
-    pb = avio_alloc_context(buffer, 1 << wf->sector_bits, 0, wf,
-                           wtvfile_read_packet, NULL, wtvfile_seek);
-    if (!pb) {
-        av_free(buffer);
-        av_free(wf->sectors);
-        av_free(wf);
-    }
-    return pb;
-}
-
-static const ff_asf_guid dir_entry_guid =
-    {0x92,0xB7,0x74,0x91,0x59,0x70,0x70,0x44,0x88,0xDF,0x06,0x3B,0x82,0xCC,0x21,0x3D};
-
-/**
- * Open file using filename
- * @param[in]  buf       directory buffer
- * @param      buf_size  directory buffer size
- * @param[in]  filename
- * @param      filename_size size of filename
- * @return NULL on error
- */
-static AVIOContext * wtvfile_open2(AVFormatContext *s, const uint8_t *buf, int buf_size, const uint8_t *filename, int filename_size)
-{
-    const uint8_t *buf_end = buf + buf_size;
-
-    while(buf + 48 <= buf_end) {
-        int dir_length, name_size, first_sector, depth;
-        uint64_t file_length;
-        const uint8_t *name;
-        if (ff_guidcmp(buf, dir_entry_guid)) {
-            av_log(s, AV_LOG_ERROR, "unknown guid "FF_PRI_GUID", expected dir_entry_guid; "
-                   "remaining directory entries ignored\n", FF_ARG_GUID(buf));
-            break;
-        }
-        dir_length  = AV_RL16(buf + 16);
-        file_length = AV_RL64(buf + 24);
-        name_size   = 2 * AV_RL32(buf + 32);
-        if (name_size < 0) {
-            av_log(s, AV_LOG_ERROR,
-                   "bad filename length, remaining directory entries ignored\n");
-            break;
-        }
-        if (48 + name_size > buf_end - buf) {
-            av_log(s, AV_LOG_ERROR, "filename exceeds buffer size; remaining directory entries ignored\n");
-            break;
-        }
-        first_sector = AV_RL32(buf + 40 + name_size);
-        depth        = AV_RL32(buf + 44 + name_size);
-
-        /* compare file name; test optional null terminator */
-        name = buf + 40;
-        if (name_size >= filename_size &&
-            !memcmp(name, filename, filename_size) &&
-            (name_size < filename_size + 2 || !AV_RN16(name + filename_size)))
-            return wtvfile_open_sector(first_sector, file_length, depth, s);
-
-        buf += dir_length;
-    }
-    return 0;
-}
-
-#define wtvfile_open(s, buf, buf_size, filename) \
-    wtvfile_open2(s, buf, buf_size, filename, sizeof(filename))
-
-/**
- * Close file opened with wtvfile_open_sector(), or wtv_open()
- */
-static void wtvfile_close(AVIOContext *pb)
-{
-    WtvFile *wf = pb->opaque;
-    av_free(wf->sectors);
-    av_free(wf);
-    av_free(pb->buffer);
-    av_free(pb);
-}
-
-/*
- *
- * Main demuxer
- *
- */
-
-typedef struct {
-    int seen_data;
-} WtvStream;
-
-typedef struct {
-    AVIOContext *pb;       /** timeline file */
-    int64_t epoch;
-    int64_t pts;             /** pts for next data chunk */
-    int64_t last_valid_pts;  /** latest valid pts, used for interative seeking */
-
-    /* maintain private seek index, as the AVIndexEntry->pos is relative to the
-       start of the 'timeline' file, not the file system (AVFormatContext->pb) */
-    AVIndexEntry *index_entries;
-    int nb_index_entries;
-    unsigned int index_entries_allocated_size;
-} WtvContext;
-
-/* WTV GUIDs */
-static const ff_asf_guid wtv_guid =
-    {0xB7,0xD8,0x00,0x20,0x37,0x49,0xDA,0x11,0xA6,0x4E,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
-static const ff_asf_guid metadata_guid =
-    {0x5A,0xFE,0xD7,0x6D,0xC8,0x1D,0x8F,0x4A,0x99,0x22,0xFA,0xB1,0x1C,0x38,0x14,0x53};
-static const ff_asf_guid timestamp_guid =
-    {0x5B,0x05,0xE6,0x1B,0x97,0xA9,0x49,0x43,0x88,0x17,0x1A,0x65,0x5A,0x29,0x8A,0x97};
-static const ff_asf_guid data_guid =
-    {0x95,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
-static const ff_asf_guid stream_guid =
-    {0xED,0xA4,0x13,0x23,0x2D,0xBF,0x4F,0x45,0xAD,0x8A,0xD9,0x5B,0xA7,0xF9,0x1F,0xEE};
-static const ff_asf_guid stream2_guid =
-    {0xA2,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
-static const ff_asf_guid EVENTID_SubtitleSpanningEvent =
-    {0x48,0xC0,0xCE,0x5D,0xB9,0xD0,0x63,0x41,0x87,0x2C,0x4F,0x32,0x22,0x3B,0xE8,0x8A};
-static const ff_asf_guid EVENTID_LanguageSpanningEvent =
-    {0x6D,0x66,0x92,0xE2,0x02,0x9C,0x8D,0x44,0xAA,0x8D,0x78,0x1A,0x93,0xFD,0xC3,0x95};
-static const ff_asf_guid EVENTID_AudioDescriptorSpanningEvent =
-    {0x1C,0xD4,0x7B,0x10,0xDA,0xA6,0x91,0x46,0x83,0x69,0x11,0xB2,0xCD,0xAA,0x28,0x8E};
-static const ff_asf_guid EVENTID_CtxADescriptorSpanningEvent =
-    {0xE6,0xA2,0xB4,0x3A,0x47,0x42,0x34,0x4B,0x89,0x6C,0x30,0xAF,0xA5,0xD2,0x1C,0x24};
-static const ff_asf_guid EVENTID_CSDescriptorSpanningEvent =
-    {0xD9,0x79,0xE7,0xEf,0xF0,0x97,0x86,0x47,0x80,0x0D,0x95,0xCF,0x50,0x5D,0xDC,0x66};
-static const ff_asf_guid EVENTID_DVBScramblingControlSpanningEvent =
-    {0xC4,0xE1,0xD4,0x4B,0xA1,0x90,0x09,0x41,0x82,0x36,0x27,0xF0,0x0E,0x7D,0xCC,0x5B};
-static const ff_asf_guid EVENTID_StreamIDSpanningEvent =
-    {0x68,0xAB,0xF1,0xCA,0x53,0xE1,0x41,0x4D,0xA6,0xB3,0xA7,0xC9,0x98,0xDB,0x75,0xEE};
-static const ff_asf_guid EVENTID_TeletextSpanningEvent =
-    {0x50,0xD9,0x99,0x95,0x33,0x5F,0x17,0x46,0xAF,0x7C,0x1E,0x54,0xB5,0x10,0xDA,0xA3};
-static const ff_asf_guid EVENTID_AudioTypeSpanningEvent =
-    {0xBE,0xBF,0x1C,0x50,0x49,0xB8,0xCE,0x42,0x9B,0xE9,0x3D,0xB8,0x69,0xFB,0x82,0xB3};
-
-/* Windows media GUIDs */
-
-/* Media types */
-static const ff_asf_guid mediatype_audio =
-    {'a','u','d','s',FF_MEDIASUBTYPE_BASE_GUID};
-static const ff_asf_guid mediatype_video =
-    {'v','i','d','s',FF_MEDIASUBTYPE_BASE_GUID};
-static const ff_asf_guid mediasubtype_mpeg1payload =
-    {0x81,0xEB,0x36,0xE4,0x4F,0x52,0xCE,0x11,0x9F,0x53,0x00,0x20,0xAF,0x0B,0xA7,0x70};
-static const ff_asf_guid mediatype_mpeg2_sections =
-    {0x6C,0x17,0x5F,0x45,0x06,0x4B,0xCE,0x47,0x9A,0xEF,0x8C,0xAE,0xF7,0x3D,0xF7,0xB5};
-static const ff_asf_guid mediatype_mpeg2_pes =
-    {0x20,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA};
-static const ff_asf_guid mediatype_mstvcaption =
-    {0x89,0x8A,0x8B,0xB8,0x49,0xB0,0x80,0x4C,0xAD,0xCF,0x58,0x98,0x98,0x5E,0x22,0xC1};
-
-/* Media subtypes */
-static const ff_asf_guid mediasubtype_cpfilters_processed =
-    {0x28,0xBD,0xAD,0x46,0xD0,0x6F,0x96,0x47,0x93,0xB2,0x15,0x5C,0x51,0xDC,0x04,0x8D};
-static const ff_asf_guid mediasubtype_dvb_subtitle =
-    {0xC3,0xCB,0xFF,0x34,0xB3,0xD5,0x71,0x41,0x90,0x02,0xD4,0xC6,0x03,0x01,0x69,0x7F};
-static const ff_asf_guid mediasubtype_teletext =
-    {0xE3,0x76,0x2A,0xF7,0x0A,0xEB,0xD0,0x11,0xAC,0xE4,0x00,0x00,0xC0,0xCC,0x16,0xBA};
-static const ff_asf_guid mediasubtype_dtvccdata =
-    {0xAA,0xDD,0x2A,0xF5,0xF0,0x36,0xF5,0x43,0x95,0xEA,0x6D,0x86,0x64,0x84,0x26,0x2A};
-static const ff_asf_guid mediasubtype_mpeg2_sections =
-    {0x79,0x85,0x9F,0x4A,0xF8,0x6B,0x92,0x43,0x8A,0x6D,0xD2,0xDD,0x09,0xFA,0x78,0x61};
-
-/* Formats */
-static const ff_asf_guid format_cpfilters_processed =
-    {0x6F,0xB3,0x39,0x67,0x5F,0x1D,0xC2,0x4A,0x81,0x92,0x28,0xBB,0x0E,0x73,0xD1,0x6A};
-static const ff_asf_guid format_waveformatex =
-    {0x81,0x9F,0x58,0x05,0x56,0xC3,0xCE,0x11,0xBF,0x01,0x00,0xAA,0x00,0x55,0x59,0x5A};
-static const ff_asf_guid format_videoinfo2 =
-    {0xA0,0x76,0x2A,0xF7,0x0A,0xEB,0xD0,0x11,0xAC,0xE4,0x00,0x00,0xC0,0xCC,0x16,0xBA};
-static const ff_asf_guid format_mpeg2_video =
-    {0xE3,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA};
-static const ff_asf_guid format_none =
-    {0xD6,0x17,0x64,0x0F,0x18,0xC3,0xD0,0x11,0xA4,0x3F,0x00,0xA0,0xC9,0x22,0x31,0x96};
-
-static const AVCodecGuid video_guids[] = {
-    {AV_CODEC_ID_MPEG2VIDEO, {0x26,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA}},
-    {AV_CODEC_ID_NONE}
-};
-
-static int read_probe(AVProbeData *p)
-{
-    return ff_guidcmp(p->buf, wtv_guid) ? 0 : AVPROBE_SCORE_MAX;
-}
-
-/**
- * Convert win32 FILETIME to ISO-8601 string
- */
-static void filetime_to_iso8601(char *buf, int buf_size, int64_t value)
-{
-    time_t t = (value / 10000000LL) - 11644473600LL;
-    struct tm *tm = gmtime(&t);
-    if (tm)
-        strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t));
-    else
-        buf[0] = '\0';
-}
-
-/**
- * Convert crazy time (100ns since 1 Jan 0001) to ISO-8601 string
- */
-static void crazytime_to_iso8601(char *buf, int buf_size, int64_t value)
-{
-    time_t t = (value / 10000000LL) - 719162LL*86400LL;
-    struct tm *tm = gmtime(&t);
-    if (tm)
-        strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t));
-    else
-        buf[0] = '\0';
-}
-
-/**
- * Convert OLE DATE to ISO-8601 string
- */
-static void oledate_to_iso8601(char *buf, int buf_size, int64_t value)
-{
-    time_t t = 631112400LL + 86400*av_int2double(value);
-    struct tm *tm = gmtime(&t);
-    if (tm)
-        strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t));
-    else
-        buf[0] = '\0';
-}
-
-static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
-{
-    char mime[1024];
-    char description[1024];
-    unsigned int filesize;
-    AVStream *st;
-    int64_t pos = avio_tell(pb);
-
-    avio_get_str16le(pb, INT_MAX, mime, sizeof(mime));
-    if (strcmp(mime, "image/jpeg"))
-        goto done;
-
-    avio_r8(pb);
-    avio_get_str16le(pb, INT_MAX, description, sizeof(description));
-    filesize = avio_rl32(pb);
-    if (!filesize)
-        goto done;
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        goto done;
-    av_dict_set(&st->metadata, "title", description, 0);
-    st->codec->codec_id   = AV_CODEC_ID_MJPEG;
-    st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
-    st->codec->extradata  = av_mallocz(filesize);
-    st->id = -1;
-    if (!st->codec->extradata)
-        goto done;
-    st->codec->extradata_size = filesize;
-    avio_read(pb, st->codec->extradata, filesize);
-done:
-    avio_seek(pb, pos + length, SEEK_SET);
-}
-
-static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int type, int length)
-{
-    int buf_size = FFMAX(2*length, LEN_PRETTY_GUID) + 1;
-    char *buf = av_malloc(buf_size);
-    if (!buf)
-        return;
-
-    if (type == 0 && length == 4) {
-        snprintf(buf, buf_size, "%"PRIi32, avio_rl32(pb));
-    } else if (type == 1) {
-        avio_get_str16le(pb, length, buf, buf_size);
-        if (!strlen(buf)) {
-           av_free(buf);
-           return;
-        }
-    } else if (type == 3 && length == 4) {
-        strcpy(buf, avio_rl32(pb) ? "true" : "false");
-    } else if (type == 4 && length == 8) {
-        int64_t num = avio_rl64(pb);
-        if (!strcmp(key, "WM/EncodingTime") ||
-            !strcmp(key, "WM/MediaOriginalBroadcastDateTime"))
-            filetime_to_iso8601(buf, buf_size, num);
-        else if (!strcmp(key, "WM/WMRVEncodeTime") ||
-                 !strcmp(key, "WM/WMRVEndTime"))
-            crazytime_to_iso8601(buf, buf_size, num);
-        else if (!strcmp(key, "WM/WMRVExpirationDate"))
-            oledate_to_iso8601(buf, buf_size, num);
-        else if (!strcmp(key, "WM/WMRVBitrate"))
-            snprintf(buf, buf_size, "%f", av_int2double(num));
-        else
-            snprintf(buf, buf_size, "%"PRIi64, num);
-    } else if (type == 5 && length == 2) {
-        snprintf(buf, buf_size, "%u", avio_rl16(pb));
-    } else if (type == 6 && length == 16) {
-        ff_asf_guid guid;
-        avio_read(pb, guid, 16);
-        snprintf(buf, buf_size, PRI_PRETTY_GUID, ARG_PRETTY_GUID(guid));
-    } else if (type == 2 && !strcmp(key, "WM/Picture")) {
-        get_attachment(s, pb, length);
-        av_freep(&buf);
-        return;
-    } else {
-        av_freep(&buf);
-        av_log(s, AV_LOG_WARNING, "unsupported metadata entry; key:%s, type:%d, length:0x%x\n", key, type, length);
-        avio_skip(pb, length);
-        return;
-    }
-
-    av_dict_set(&s->metadata, key, buf, 0);
-    av_freep(&buf);
-}
-
-/**
- * Parse metadata entries
- */
-static void parse_legacy_attrib(AVFormatContext *s, AVIOContext *pb)
-{
-    ff_asf_guid guid;
-    int length, type;
-    while(!pb->eof_reached) {
-        char key[1024];
-        ff_get_guid(pb, &guid);
-        type   = avio_rl32(pb);
-        length = avio_rl32(pb);
-        if (!length)
-            break;
-        if (ff_guidcmp(&guid, metadata_guid)) {
-            av_log(s, AV_LOG_WARNING, "unknown guid "FF_PRI_GUID", expected metadata_guid; "
-                   "remaining metadata entries ignored\n", FF_ARG_GUID(guid));
-            break;
-        }
-        avio_get_str16le(pb, INT_MAX, key, sizeof(key));
-        get_tag(s, pb, key, type, length);
-    }
-
-    ff_metadata_conv(&s->metadata, NULL, ff_asf_metadata_conv);
-}
-
-/**
- * parse VIDEOINFOHEADER2 structure
- * @return bytes consumed
- */
-static int parse_videoinfoheader2(AVFormatContext *s, AVStream *st)
-{
-    WtvContext *wtv = s->priv_data;
-    AVIOContext *pb = wtv->pb;
-
-    avio_skip(pb, 72);  // picture aspect ratio is unreliable
-    ff_get_bmp_header(pb, st);
-
-    return 72 + 40;
-}
-
-/**
- * Parse MPEG1WAVEFORMATEX extradata structure
- */
-static void parse_mpeg1waveformatex(AVStream *st)
-{
-    /* fwHeadLayer */
-    switch (AV_RL16(st->codec->extradata)) {
-    case 0x0001 : st->codec->codec_id = AV_CODEC_ID_MP1; break;
-    case 0x0002 : st->codec->codec_id = AV_CODEC_ID_MP2; break;
-    case 0x0004 : st->codec->codec_id = AV_CODEC_ID_MP3; break;
-    }
-
-    st->codec->bit_rate = AV_RL32(st->codec->extradata + 2); /* dwHeadBitrate */
-
-    /* dwHeadMode */
-    switch (AV_RL16(st->codec->extradata + 6)) {
-    case 1 :
-    case 2 :
-    case 4 : st->codec->channels       = 2;
-             st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
-             break;
-    case 8 : st->codec->channels       = 1;
-             st->codec->channel_layout = AV_CH_LAYOUT_MONO;
-             break;
-    }
-}
-
-/**
- * Initialise stream
- * @param st Stream to initialise, or NULL to create and initialise new stream
- * @return NULL on error
- */
-static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int codec_type)
-{
-    if (st) {
-        if (st->codec->extradata) {
-            av_freep(&st->codec->extradata);
-            st->codec->extradata_size = 0;
-        }
-    } else {
-        WtvStream *wst = av_mallocz(sizeof(WtvStream));
-        if (!wst)
-            return NULL;
-        st = avformat_new_stream(s, NULL);
-        if (!st)
-            return NULL;
-        st->id = sid;
-        st->priv_data = wst;
-    }
-    st->codec->codec_type = codec_type;
-    st->need_parsing      = AVSTREAM_PARSE_FULL;
-    avpriv_set_pts_info(st, 64, 1, 10000000);
-    return st;
-}
-
-/**
- * parse Media Type structure and populate stream
- * @param st         Stream, or NULL to create new stream
- * @param mediatype  Mediatype GUID
- * @param subtype    Subtype GUID
- * @param formattype Format GUID
- * @param size       Size of format buffer
- * @return NULL on error
- */
-static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
-                                   ff_asf_guid mediatype, ff_asf_guid subtype,
-                                   ff_asf_guid formattype, int size)
-{
-    WtvContext *wtv = s->priv_data;
-    AVIOContext *pb = wtv->pb;
-    if (!ff_guidcmp(subtype, mediasubtype_cpfilters_processed) &&
-        !ff_guidcmp(formattype, format_cpfilters_processed)) {
-        ff_asf_guid actual_subtype;
-        ff_asf_guid actual_formattype;
-
-        if (size < 32) {
-            av_log(s, AV_LOG_WARNING, "format buffer size underflow\n");
-            avio_skip(pb, size);
-            return NULL;
-        }
-
-        avio_skip(pb, size - 32);
-        ff_get_guid(pb, &actual_subtype);
-        ff_get_guid(pb, &actual_formattype);
-        avio_seek(pb, -size, SEEK_CUR);
-
-        st = parse_media_type(s, st, sid, mediatype, actual_subtype, actual_formattype, size - 32);
-        avio_skip(pb, 32);
-        return st;
-    } else if (!ff_guidcmp(mediatype, mediatype_audio)) {
-        st = new_stream(s, st, sid, AVMEDIA_TYPE_AUDIO);
-        if (!st)
-            return NULL;
-        if (!ff_guidcmp(formattype, format_waveformatex)) {
-            int ret = ff_get_wav_header(pb, st->codec, size);
-            if (ret < 0)
-                return NULL;
-        } else {
-            if (ff_guidcmp(formattype, format_none))
-                av_log(s, AV_LOG_WARNING, "unknown formattype:"FF_PRI_GUID"\n", FF_ARG_GUID(formattype));
-            avio_skip(pb, size);
-        }
-
-        if (!memcmp(subtype + 4, (const uint8_t[]){FF_MEDIASUBTYPE_BASE_GUID}, 12)) {
-            st->codec->codec_id = ff_wav_codec_get_id(AV_RL32(subtype), st->codec->bits_per_coded_sample);
-        } else if (!ff_guidcmp(subtype, mediasubtype_mpeg1payload)) {
-            if (st->codec->extradata && st->codec->extradata_size >= 22)
-                parse_mpeg1waveformatex(st);
-            else
-                av_log(s, AV_LOG_WARNING, "MPEG1WAVEFORMATEX underflow\n");
-        } else {
-            st->codec->codec_id = ff_codec_guid_get_id(ff_codec_wav_guids, subtype);
-            if (st->codec->codec_id == AV_CODEC_ID_NONE)
-                av_log(s, AV_LOG_WARNING, "unknown subtype:"FF_PRI_GUID"\n", FF_ARG_GUID(subtype));
-        }
-        return st;
-    } else if (!ff_guidcmp(mediatype, mediatype_video)) {
-        st = new_stream(s, st, sid, AVMEDIA_TYPE_VIDEO);
-        if (!st)
-            return NULL;
-        if (!ff_guidcmp(formattype, format_videoinfo2)) {
-            int consumed = parse_videoinfoheader2(s, st);
-            avio_skip(pb, FFMAX(size - consumed, 0));
-        } else if (!ff_guidcmp(formattype, format_mpeg2_video)) {
-            int consumed = parse_videoinfoheader2(s, st);
-            avio_skip(pb, FFMAX(size - consumed, 0));
-        } else {
-            if (ff_guidcmp(formattype, format_none))
-                av_log(s, AV_LOG_WARNING, "unknown formattype:"FF_PRI_GUID"\n", FF_ARG_GUID(formattype));
-            avio_skip(pb, size);
-        }
-
-        if (!memcmp(subtype + 4, (const uint8_t[]){FF_MEDIASUBTYPE_BASE_GUID}, 12)) {
-            st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(subtype));
-        } else {
-            st->codec->codec_id = ff_codec_guid_get_id(video_guids, subtype);
-        }
-        if (st->codec->codec_id == AV_CODEC_ID_NONE)
-            av_log(s, AV_LOG_WARNING, "unknown subtype:"FF_PRI_GUID"\n", FF_ARG_GUID(subtype));
-        return st;
-    } else if (!ff_guidcmp(mediatype, mediatype_mpeg2_pes) &&
-               !ff_guidcmp(subtype, mediasubtype_dvb_subtitle)) {
-        st = new_stream(s, st, sid, AVMEDIA_TYPE_SUBTITLE);
-        if (!st)
-            return NULL;
-        if (ff_guidcmp(formattype, format_none))
-            av_log(s, AV_LOG_WARNING, "unknown formattype:"FF_PRI_GUID"\n", FF_ARG_GUID(formattype));
-        avio_skip(pb, size);
-        st->codec->codec_id = AV_CODEC_ID_DVB_SUBTITLE;
-        return st;
-    } else if (!ff_guidcmp(mediatype, mediatype_mstvcaption) &&
-               (!ff_guidcmp(subtype, mediasubtype_teletext) || !ff_guidcmp(subtype, mediasubtype_dtvccdata))) {
-        st = new_stream(s, st, sid, AVMEDIA_TYPE_SUBTITLE);
-        if (!st)
-            return NULL;
-        if (ff_guidcmp(formattype, format_none))
-            av_log(s, AV_LOG_WARNING, "unknown formattype:"FF_PRI_GUID"\n", FF_ARG_GUID(formattype));
-        avio_skip(pb, size);
-        st->codec->codec_id   = AV_CODEC_ID_DVB_TELETEXT;
-        return st;
-    } else if (!ff_guidcmp(mediatype, mediatype_mpeg2_sections) &&
-               !ff_guidcmp(subtype, mediasubtype_mpeg2_sections)) {
-        if (ff_guidcmp(formattype, format_none))
-            av_log(s, AV_LOG_WARNING, "unknown formattype:"FF_PRI_GUID"\n", FF_ARG_GUID(formattype));
-        avio_skip(pb, size);
-        return NULL;
-    }
-
-    av_log(s, AV_LOG_WARNING, "unknown media type, mediatype:"FF_PRI_GUID
-                              ", subtype:"FF_PRI_GUID", formattype:"FF_PRI_GUID"\n",
-                              FF_ARG_GUID(mediatype), FF_ARG_GUID(subtype), FF_ARG_GUID(formattype));
-    avio_skip(pb, size);
-    return NULL;
-}
-
-enum {
-    SEEK_TO_DATA = 0,
-    SEEK_TO_PTS,
-};
-
-/**
- * Parse WTV chunks
- * @param mode SEEK_TO_DATA or SEEK_TO_PTS
- * @param seekts timestamp
- * @param[out] len_ptr Length of data chunk
- * @return stream index of data chunk, or <0 on error
- */
-static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_ptr)
-{
-    WtvContext *wtv = s->priv_data;
-    AVIOContext *pb = wtv->pb;
-    while (!pb->eof_reached) {
-        ff_asf_guid g;
-        int len, sid, consumed;
-
-        ff_get_guid(pb, &g);
-        len = avio_rl32(pb);
-        if (len < 32)
-            break;
-        sid = avio_rl32(pb) & 0x7FFF;
-        avio_skip(pb, 8);
-        consumed = 32;
-
-        if (!ff_guidcmp(g, stream_guid)) {
-            if (ff_find_stream_index(s, sid) < 0) {
-                ff_asf_guid mediatype, subtype, formattype;
-                int size;
-                avio_skip(pb, 28);
-                ff_get_guid(pb, &mediatype);
-                ff_get_guid(pb, &subtype);
-                avio_skip(pb, 12);
-                ff_get_guid(pb, &formattype);
-                size = avio_rl32(pb);
-                parse_media_type(s, 0, sid, mediatype, subtype, formattype, size);
-                consumed += 92 + size;
-            }
-        } else if (!ff_guidcmp(g, stream2_guid)) {
-            int stream_index = ff_find_stream_index(s, sid);
-            if (stream_index >= 0 && !((WtvStream*)s->streams[stream_index]->priv_data)->seen_data) {
-                ff_asf_guid mediatype, subtype, formattype;
-                int size;
-                avio_skip(pb, 12);
-                ff_get_guid(pb, &mediatype);
-                ff_get_guid(pb, &subtype);
-                avio_skip(pb, 12);
-                ff_get_guid(pb, &formattype);
-                size = avio_rl32(pb);
-                parse_media_type(s, s->streams[stream_index], sid, mediatype, subtype, formattype, size);
-                consumed += 76 + size;
-            }
-        } else if (!ff_guidcmp(g, EVENTID_AudioDescriptorSpanningEvent) ||
-                   !ff_guidcmp(g, EVENTID_CtxADescriptorSpanningEvent) ||
-                   !ff_guidcmp(g, EVENTID_CSDescriptorSpanningEvent) ||
-                   !ff_guidcmp(g, EVENTID_StreamIDSpanningEvent) ||
-                   !ff_guidcmp(g, EVENTID_SubtitleSpanningEvent) ||
-                   !ff_guidcmp(g, EVENTID_TeletextSpanningEvent)) {
-            int stream_index = ff_find_stream_index(s, sid);
-            if (stream_index >= 0) {
-                AVStream *st = s->streams[stream_index];
-                uint8_t buf[258];
-                const uint8_t *pbuf = buf;
-                int buf_size;
-
-                avio_skip(pb, 8);
-                consumed += 8;
-                if (!ff_guidcmp(g, EVENTID_CtxADescriptorSpanningEvent) ||
-                    !ff_guidcmp(g, EVENTID_CSDescriptorSpanningEvent)) {
-                    avio_skip(pb, 6);
-                    consumed += 6;
-                }
-
-                buf_size = FFMIN(len - consumed, sizeof(buf));
-                avio_read(pb, buf, buf_size);
-                consumed += buf_size;
-                ff_parse_mpeg2_descriptor(s, st, 0, &pbuf, buf + buf_size, NULL, 0, 0, NULL);
-            }
-        } else if (!ff_guidcmp(g, EVENTID_AudioTypeSpanningEvent)) {
-            int stream_index = ff_find_stream_index(s, sid);
-            if (stream_index >= 0) {
-                AVStream *st = s->streams[stream_index];
-                int audio_type;
-                avio_skip(pb, 8);
-                audio_type = avio_r8(pb);
-                if (audio_type == 2)
-                    st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED;
-                else if (audio_type == 3)
-                    st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
-                consumed += 9;
-            }
-        } else if (!ff_guidcmp(g, EVENTID_DVBScramblingControlSpanningEvent)) {
-            int stream_index = ff_find_stream_index(s, sid);
-            if (stream_index >= 0) {
-                avio_skip(pb, 12);
-                if (avio_rl32(pb))
-                    av_log(s, AV_LOG_WARNING, "DVB scrambled stream detected (st:%d), decoding will likely fail\n", stream_index);
-                consumed += 16;
-            }
-        } else if (!ff_guidcmp(g, EVENTID_LanguageSpanningEvent)) {
-            int stream_index = ff_find_stream_index(s, sid);
-            if (stream_index >= 0) {
-                AVStream *st = s->streams[stream_index];
-                uint8_t language[4];
-                avio_skip(pb, 12);
-                avio_read(pb, language, 3);
-                if (language[0]) {
-                    language[3] = 0;
-                    av_dict_set(&st->metadata, "language", language, 0);
-                    if (!strcmp(language, "nar") || !strcmp(language, "NAR"))
-                        st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
-                }
-                consumed += 15;
-            }
-        } else if (!ff_guidcmp(g, timestamp_guid)) {
-            int stream_index = ff_find_stream_index(s, sid);
-            if (stream_index >= 0) {
-                avio_skip(pb, 8);
-                wtv->pts = avio_rl64(pb);
-                consumed += 16;
-                if (wtv->pts == -1)
-                    wtv->pts = AV_NOPTS_VALUE;
-                else {
-                    wtv->last_valid_pts = wtv->pts;
-                    if (wtv->epoch == AV_NOPTS_VALUE || wtv->pts < wtv->epoch)
-                        wtv->epoch = wtv->pts;
-                if (mode == SEEK_TO_PTS && wtv->pts >= seekts) {
-#define WTV_PAD8(x) (((x) + 7) & ~7)
-                    avio_skip(pb, WTV_PAD8(len) - consumed);
-                    return 0;
-                }
-                }
-            }
-        } else if (!ff_guidcmp(g, data_guid)) {
-            int stream_index = ff_find_stream_index(s, sid);
-            if (mode == SEEK_TO_DATA && stream_index >= 0 && len > 32) {
-                WtvStream *wst = s->streams[stream_index]->priv_data;
-                wst->seen_data = 1;
-                if (len_ptr) {
-                    *len_ptr = len;
-                }
-                return stream_index;
-            }
-        } else if (
-            !ff_guidcmp(g, /* DSATTRIB_CAPTURE_STREAMTIME */ (const ff_asf_guid){0x14,0x56,0x1A,0x0C,0xCD,0x30,0x40,0x4F,0xBC,0xBF,0xD0,0x3E,0x52,0x30,0x62,0x07}) ||
-            !ff_guidcmp(g, /* DSATTRIB_PicSampleSeq */ (const ff_asf_guid){0x02,0xAE,0x5B,0x2F,0x8F,0x7B,0x60,0x4F,0x82,0xD6,0xE4,0xEA,0x2F,0x1F,0x4C,0x99}) ||
-            !ff_guidcmp(g, /* DSATTRIB_TRANSPORT_PROPERTIES */ (const ff_asf_guid){0x12,0xF6,0x22,0xB6,0xAD,0x47,0x71,0x46,0xAD,0x6C,0x05,0xA9,0x8E,0x65,0xDE,0x3A}) ||
-            !ff_guidcmp(g, /* dvr_ms_vid_frame_rep_data */ (const ff_asf_guid){0xCC,0x32,0x64,0xDD,0x29,0xE2,0xDB,0x40,0x80,0xF6,0xD2,0x63,0x28,0xD2,0x76,0x1F}) ||
-            !ff_guidcmp(g, /* EVENTID_ChannelChangeSpanningEvent */ (const ff_asf_guid){0xE5,0xC5,0x67,0x90,0x5C,0x4C,0x05,0x42,0x86,0xC8,0x7A,0xFE,0x20,0xFE,0x1E,0xFA}) ||
-            !ff_guidcmp(g, /* EVENTID_ChannelInfoSpanningEvent */ (const ff_asf_guid){0x80,0x6D,0xF3,0x41,0x32,0x41,0xC2,0x4C,0xB1,0x21,0x01,0xA4,0x32,0x19,0xD8,0x1B}) ||
-            !ff_guidcmp(g, /* EVENTID_ChannelTypeSpanningEvent */ (const ff_asf_guid){0x51,0x1D,0xAB,0x72,0xD2,0x87,0x9B,0x48,0xBA,0x11,0x0E,0x08,0xDC,0x21,0x02,0x43}) ||
-            !ff_guidcmp(g, /* EVENTID_PIDListSpanningEvent */ (const ff_asf_guid){0x65,0x8F,0xFC,0x47,0xBB,0xE2,0x34,0x46,0x9C,0xEF,0xFD,0xBF,0xE6,0x26,0x1D,0x5C}) ||
-            !ff_guidcmp(g, /* EVENTID_SignalAndServiceStatusSpanningEvent */ (const ff_asf_guid){0xCB,0xC5,0x68,0x80,0x04,0x3C,0x2B,0x49,0xB4,0x7D,0x03,0x08,0x82,0x0D,0xCE,0x51}) ||
-            !ff_guidcmp(g, /* EVENTID_StreamTypeSpanningEvent */ (const ff_asf_guid){0xBC,0x2E,0xAF,0x82,0xA6,0x30,0x64,0x42,0xA8,0x0B,0xAD,0x2E,0x13,0x72,0xAC,0x60}) ||
-            !ff_guidcmp(g, (const ff_asf_guid){0x1E,0xBE,0xC3,0xC5,0x43,0x92,0xDC,0x11,0x85,0xE5,0x00,0x12,0x3F,0x6F,0x73,0xB9}) ||
-            !ff_guidcmp(g, (const ff_asf_guid){0x3B,0x86,0xA2,0xB1,0xEB,0x1E,0xC3,0x44,0x8C,0x88,0x1C,0xA3,0xFF,0xE3,0xE7,0x6A}) ||
-            !ff_guidcmp(g, (const ff_asf_guid){0x4E,0x7F,0x4C,0x5B,0xC4,0xD0,0x38,0x4B,0xA8,0x3E,0x21,0x7F,0x7B,0xBF,0x52,0xE7}) ||
-            !ff_guidcmp(g, (const ff_asf_guid){0x63,0x36,0xEB,0xFE,0xA1,0x7E,0xD9,0x11,0x83,0x08,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) ||
-            !ff_guidcmp(g, (const ff_asf_guid){0x70,0xE9,0xF1,0xF8,0x89,0xA4,0x4C,0x4D,0x83,0x73,0xB8,0x12,0xE0,0xD5,0xF8,0x1E}) ||
-            !ff_guidcmp(g, (const ff_asf_guid){0x96,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) ||
-            !ff_guidcmp(g, (const ff_asf_guid){0x97,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) ||
-            !ff_guidcmp(g, (const ff_asf_guid){0xA1,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D})) {
-            //ignore known guids
-        } else
-            av_log(s, AV_LOG_WARNING, "unsupported chunk:"FF_PRI_GUID"\n", FF_ARG_GUID(g));
-
-        avio_skip(pb, WTV_PAD8(len) - consumed);
-    }
-    return AVERROR_EOF;
-}
-
-/* declare utf16le strings */
-#define _ , 0,
-static const uint8_t timeline_le16[] =
-    {'t'_'i'_'m'_'e'_'l'_'i'_'n'_'e', 0};
-static const uint8_t table_0_entries_legacy_attrib_le16[] =
-    {'t'_'a'_'b'_'l'_'e'_'.'_'0'_'.'_'e'_'n'_'t'_'r'_'i'_'e'_'s'_'.'_'l'_'e'_'g'_'a'_'c'_'y'_'_'_'a'_'t'_'t'_'r'_'i'_'b', 0};
-static const uint8_t table_0_entries_time_le16[] =
-    {'t'_'a'_'b'_'l'_'e'_'.'_'0'_'.'_'e'_'n'_'t'_'r'_'i'_'e'_'s'_'.'_'t'_'i'_'m'_'e', 0};
-static const uint8_t timeline_table_0_entries_Events_le16[] =
-    {'t'_'i'_'m'_'e'_'l'_'i'_'n'_'e'_'.'_'t'_'a'_'b'_'l'_'e'_'.'_'0'_'.'_'e'_'n'_'t'_'r'_'i'_'e'_'s'_'.'_'E'_'v'_'e'_'n'_'t'_'s', 0};
-#undef _
-
-static int read_header(AVFormatContext *s)
-{
-    WtvContext *wtv = s->priv_data;
-    int root_sector, root_size;
-    uint8_t root[WTV_SECTOR_SIZE];
-    AVIOContext *pb;
-    int64_t timeline_pos;
-    int ret;
-
-    wtv->epoch          =
-    wtv->pts            =
-    wtv->last_valid_pts = AV_NOPTS_VALUE;
-
-    /* read root directory sector */
-    avio_skip(s->pb, 0x30);
-    root_size = avio_rl32(s->pb);
-    if (root_size > sizeof(root)) {
-        av_log(s, AV_LOG_ERROR, "root directory size exceeds sector size\n");
-        return AVERROR_INVALIDDATA;
-    }
-    avio_skip(s->pb, 4);
-    root_sector = avio_rl32(s->pb);
-
-    seek_by_sector(s->pb, root_sector, 0);
-    root_size = avio_read(s->pb, root, root_size);
-    if (root_size < 0)
-        return AVERROR_INVALIDDATA;
-
-    /* parse chunks up until first data chunk */
-    wtv->pb = wtvfile_open(s, root, root_size, timeline_le16);
-    if (!wtv->pb) {
-        av_log(s, AV_LOG_ERROR, "timeline data missing\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    ret = parse_chunks(s, SEEK_TO_DATA, 0, 0);
-    if (ret < 0)
-        return ret;
-    avio_seek(wtv->pb, -32, SEEK_CUR);
-
-    timeline_pos = avio_tell(s->pb); // save before opening another file
-
-    /* read metadata */
-    pb = wtvfile_open(s, root, root_size, table_0_entries_legacy_attrib_le16);
-    if (pb) {
-        parse_legacy_attrib(s, pb);
-        wtvfile_close(pb);
-    }
-
-    /* read seek index */
-    if (s->nb_streams) {
-        AVStream *st = s->streams[0];
-        pb = wtvfile_open(s, root, root_size, table_0_entries_time_le16);
-        if (pb) {
-            while(1) {
-                uint64_t timestamp = avio_rl64(pb);
-                uint64_t frame_nb  = avio_rl64(pb);
-                if (pb->eof_reached)
-                    break;
-                ff_add_index_entry(&wtv->index_entries, &wtv->nb_index_entries, &wtv->index_entries_allocated_size,
-                                   0, timestamp, frame_nb, 0, AVINDEX_KEYFRAME);
-            }
-            wtvfile_close(pb);
-
-            if (wtv->nb_index_entries) {
-                pb = wtvfile_open(s, root, root_size, timeline_table_0_entries_Events_le16);
-                if (pb) {
-                    int i;
-                    while (1) {
-                        uint64_t frame_nb = avio_rl64(pb);
-                        uint64_t position = avio_rl64(pb);
-                        if (pb->eof_reached)
-                            break;
-                        for (i = wtv->nb_index_entries - 1; i >= 0; i--) {
-                            AVIndexEntry *e = wtv->index_entries + i;
-                            if (frame_nb > e->size)
-                                break;
-                            if (position > e->pos)
-                                e->pos = position;
-                        }
-                    }
-                    wtvfile_close(pb);
-                    st->duration = wtv->index_entries[wtv->nb_index_entries - 1].timestamp;
-                }
-            }
-        }
-    }
-
-    avio_seek(s->pb, timeline_pos, SEEK_SET);
-    return 0;
-}
-
-static int read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    WtvContext *wtv = s->priv_data;
-    AVIOContext *pb = wtv->pb;
-    int stream_index, len, ret;
-
-    stream_index = parse_chunks(s, SEEK_TO_DATA, 0, &len);
-    if (stream_index < 0)
-        return stream_index;
-
-    ret = av_get_packet(pb, pkt, len - 32);
-    if (ret < 0)
-        return ret;
-    pkt->stream_index = stream_index;
-    pkt->pts          = wtv->pts;
-    avio_skip(pb, WTV_PAD8(len) - len);
-    return 0;
-}
-
-static int read_seek(AVFormatContext *s, int stream_index,
-                     int64_t ts, int flags)
-{
-    WtvContext *wtv = s->priv_data;
-    AVIOContext *pb = wtv->pb;
-    AVStream *st = s->streams[0];
-    int64_t ts_relative;
-    int i;
-
-    if ((flags & AVSEEK_FLAG_FRAME) || (flags & AVSEEK_FLAG_BYTE))
-        return AVERROR(ENOSYS);
-
-    /* timestamp adjustment is required because wtv->pts values are absolute,
-     * whereas AVIndexEntry->timestamp values are relative to epoch. */
-    ts_relative = ts;
-    if (wtv->epoch != AV_NOPTS_VALUE)
-        ts_relative -= wtv->epoch;
-
-    i = ff_index_search_timestamp(wtv->index_entries, wtv->nb_index_entries, ts_relative, flags);
-    if (i < 0) {
-        if (wtv->last_valid_pts == AV_NOPTS_VALUE || ts < wtv->last_valid_pts)
-            avio_seek(pb, 0, SEEK_SET);
-        else if (st->duration != AV_NOPTS_VALUE && ts_relative > st->duration && wtv->nb_index_entries)
-            avio_seek(pb, wtv->index_entries[wtv->nb_index_entries - 1].pos, SEEK_SET);
-        if (parse_chunks(s, SEEK_TO_PTS, ts, 0) < 0)
-            return AVERROR(ERANGE);
-        return 0;
-    }
-    wtv->pts = wtv->index_entries[i].timestamp;
-    if (wtv->epoch != AV_NOPTS_VALUE)
-        wtv->pts += wtv->epoch;
-    wtv->last_valid_pts = wtv->pts;
-    avio_seek(pb, wtv->index_entries[i].pos, SEEK_SET);
-    return 0;
-}
-
-static int read_close(AVFormatContext *s)
-{
-    WtvContext *wtv = s->priv_data;
-    av_free(wtv->index_entries);
-    wtvfile_close(wtv->pb);
-    return 0;
-}
-
-AVInputFormat ff_wtv_demuxer = {
-    .name           = "wtv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Windows Television (WTV)"),
-    .priv_data_size = sizeof(WtvContext),
-    .read_probe     = read_probe,
-    .read_header    = read_header,
-    .read_packet    = read_packet,
-    .read_seek      = read_seek,
-    .read_close     = read_close,
-    .flags          = AVFMT_SHOW_IDS,
-};
diff --git a/deps/libav/libavformat/wv.c b/deps/libav/libavformat/wv.c
deleted file mode 100644
index 724256b..0000000
--- a/deps/libav/libavformat/wv.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * WavPack shared functions
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
-
-#include "wv.h"
-
-int ff_wv_parse_header(WvHeader *wv, const uint8_t *data)
-{
-    memset(wv, 0, sizeof(*wv));
-
-    if (AV_RL32(data) != MKTAG('w', 'v', 'p', 'k'))
-        return AVERROR_INVALIDDATA;
-
-    wv->blocksize     = AV_RL32(data + 4);
-    if (wv->blocksize < 24 || wv->blocksize > WV_BLOCK_LIMIT)
-        return AVERROR_INVALIDDATA;
-    wv->blocksize -= 24;
-
-    wv->version       = AV_RL16(data + 8);
-    wv->total_samples = AV_RL32(data + 12);
-    wv->block_idx     = AV_RL32(data + 16);
-    wv->samples       = AV_RL32(data + 20);
-    wv->flags         = AV_RL32(data + 24);
-    wv->crc           = AV_RL32(data + 28);
-
-    wv->initial = !!(wv->flags & WV_FLAG_INITIAL_BLOCK);
-    wv->final   = !!(wv->flags & WV_FLAG_FINAL_BLOCK);
-
-    return 0;
-}
diff --git a/deps/libav/libavformat/wv.h b/deps/libav/libavformat/wv.h
deleted file mode 100644
index ef285d2..0000000
--- a/deps/libav/libavformat/wv.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * WavPack shared functions
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_WV_H
-#define AVFORMAT_WV_H
-
-#include <stdint.h>
-
-#define WV_HEADER_SIZE 32
-
-#define WV_FLAG_INITIAL_BLOCK (1 << 11)
-#define WV_FLAG_FINAL_BLOCK   (1 << 12)
-
-// specs say that maximum block size is 1Mb
-#define WV_BLOCK_LIMIT 1048576
-
-typedef struct WvHeader {
-    uint32_t blocksize;     //< size of the block data (excluding the header)
-    uint16_t version;       //< bitstream version
-    uint32_t total_samples; //< total number of samples in the stream
-    uint32_t block_idx;     //< index of the first sample in this block
-    uint32_t samples;       //< number of samples in this block
-    uint32_t flags;
-    uint32_t crc;
-
-    int initial, final;
-} WvHeader;
-
-/**
- * Parse a WavPack block header.
- *
- * @param wv   this struct will be filled with parse header information
- * @param data header data, must be WV_HEADER_SIZE bytes long
- *
- * @return 0 on success, a negative AVERROR code on failure
- */
-int ff_wv_parse_header(WvHeader *wv, const uint8_t *data);
-
-#endif /* AVFORMAT_WV_H */
diff --git a/deps/libav/libavformat/wvdec.c b/deps/libav/libavformat/wvdec.c
deleted file mode 100644
index 1a2a722..0000000
--- a/deps/libav/libavformat/wvdec.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * WavPack demuxer
- * Copyright (c) 2006,2011 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/dict.h"
-#include "avformat.h"
-#include "internal.h"
-#include "apetag.h"
-#include "id3v1.h"
-#include "wv.h"
-
-enum WV_FLAGS {
-    WV_MONO   = 0x0004,
-    WV_HYBRID = 0x0008,
-    WV_JOINT  = 0x0010,
-    WV_CROSSD = 0x0020,
-    WV_HSHAPE = 0x0040,
-    WV_FLOAT  = 0x0080,
-    WV_INT32  = 0x0100,
-    WV_HBR    = 0x0200,
-    WV_HBAL   = 0x0400,
-    WV_MCINIT = 0x0800,
-    WV_MCEND  = 0x1000,
-};
-
-static const int wv_rates[16] = {
-     6000,  8000,  9600, 11025, 12000, 16000,  22050, 24000,
-    32000, 44100, 48000, 64000, 88200, 96000, 192000,    -1
-};
-
-typedef struct {
-    uint8_t block_header[WV_HEADER_SIZE];
-    WvHeader header;
-    int rate, chan, bpp;
-    uint32_t chmask;
-    int multichannel;
-    int block_parsed;
-    int64_t pos;
-
-    int64_t apetag_start;
-} WVContext;
-
-static int wv_probe(AVProbeData *p)
-{
-    /* check file header */
-    if (p->buf_size <= 32)
-        return 0;
-    if (p->buf[0] == 'w' && p->buf[1] == 'v' &&
-        p->buf[2] == 'p' && p->buf[3] == 'k')
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb)
-{
-    WVContext *wc = ctx->priv_data;
-    int ret;
-    int rate, bpp, chan;
-    uint32_t chmask, flags;
-
-    wc->pos = avio_tell(pb);
-
-    /* don't return bogus packets with the ape tag data */
-    if (wc->apetag_start && wc->pos >= wc->apetag_start)
-        return AVERROR_EOF;
-
-    ret = avio_read(pb, wc->block_header, WV_HEADER_SIZE);
-    if (ret != WV_HEADER_SIZE)
-        return (ret < 0) ? ret : AVERROR_EOF;
-
-    ret = ff_wv_parse_header(&wc->header, wc->block_header);
-    if (ret < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid block header.\n");
-        return ret;
-    }
-
-    if (wc->header.version < 0x402 || wc->header.version > 0x410) {
-        av_log(ctx, AV_LOG_ERROR, "Unsupported version %03X\n", wc->header.version);
-        return AVERROR_PATCHWELCOME;
-    }
-
-    /* Blocks with zero samples don't contain actual audio information
-     * and should be ignored */
-    if (!wc->header.samples)
-        return 0;
-    // parse flags
-    flags  = wc->header.flags;
-    bpp    = ((flags & 3) + 1) << 3;
-    chan   = 1 + !(flags & WV_MONO);
-    chmask = flags & WV_MONO ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
-    rate   = wv_rates[(flags >> 23) & 0xF];
-    wc->multichannel = !(wc->header.initial && wc->header.final);
-    if (wc->multichannel) {
-        chan   = wc->chan;
-        chmask = wc->chmask;
-    }
-    if ((rate == -1 || !chan) && !wc->block_parsed) {
-        int64_t block_end = avio_tell(pb) + wc->header.blocksize;
-        if (!pb->seekable) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Cannot determine additional parameters\n");
-            return AVERROR_INVALIDDATA;
-        }
-        while (avio_tell(pb) < block_end) {
-            int id, size;
-            id   = avio_r8(pb);
-            size = (id & 0x80) ? avio_rl24(pb) : avio_r8(pb);
-            size <<= 1;
-            if (id & 0x40)
-                size--;
-            switch (id & 0x3F) {
-            case 0xD:
-                if (size <= 1) {
-                    av_log(ctx, AV_LOG_ERROR,
-                           "Insufficient channel information\n");
-                    return AVERROR_INVALIDDATA;
-                }
-                chan = avio_r8(pb);
-                switch (size - 2) {
-                case 0:
-                    chmask = avio_r8(pb);
-                    break;
-                case 1:
-                    chmask = avio_rl16(pb);
-                    break;
-                case 2:
-                    chmask = avio_rl24(pb);
-                    break;
-                case 3:
-                    chmask = avio_rl32(pb);
-                    break;
-                case 5:
-                    avio_skip(pb, 1);
-                    chan  |= (avio_r8(pb) & 0xF) << 8;
-                    chmask = avio_rl24(pb);
-                    break;
-                default:
-                    av_log(ctx, AV_LOG_ERROR,
-                           "Invalid channel info size %d\n", size);
-                    return AVERROR_INVALIDDATA;
-                }
-                break;
-            case 0x27:
-                rate = avio_rl24(pb);
-                break;
-            default:
-                avio_skip(pb, size);
-            }
-            if (id & 0x40)
-                avio_skip(pb, 1);
-        }
-        if (rate == -1) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Cannot determine custom sampling rate\n");
-            return AVERROR_INVALIDDATA;
-        }
-        avio_seek(pb, block_end - wc->header.blocksize, SEEK_SET);
-    }
-    if (!wc->bpp)
-        wc->bpp    = bpp;
-    if (!wc->chan)
-        wc->chan   = chan;
-    if (!wc->chmask)
-        wc->chmask = chmask;
-    if (!wc->rate)
-        wc->rate   = rate;
-
-    if (flags && bpp != wc->bpp) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Bits per sample differ, this block: %i, header block: %i\n",
-               bpp, wc->bpp);
-        return AVERROR_INVALIDDATA;
-    }
-    if (flags && !wc->multichannel && chan != wc->chan) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Channels differ, this block: %i, header block: %i\n",
-               chan, wc->chan);
-        return AVERROR_INVALIDDATA;
-    }
-    if (flags && rate != -1 && rate != wc->rate) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Sampling rate differ, this block: %i, header block: %i\n",
-               rate, wc->rate);
-        return AVERROR_INVALIDDATA;
-    }
-    return 0;
-}
-
-static int wv_read_header(AVFormatContext *s)
-{
-    AVIOContext *pb = s->pb;
-    WVContext *wc = s->priv_data;
-    AVStream *st;
-    int ret;
-
-    wc->block_parsed = 0;
-    for (;;) {
-        if ((ret = wv_read_block_header(s, pb)) < 0)
-            return ret;
-        if (!wc->header.samples)
-            avio_skip(pb, wc->header.blocksize);
-        else
-            break;
-    }
-
-    /* now we are ready: build format streams */
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->codec_type            = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id              = AV_CODEC_ID_WAVPACK;
-    st->codec->channels              = wc->chan;
-    st->codec->channel_layout        = wc->chmask;
-    st->codec->sample_rate           = wc->rate;
-    st->codec->bits_per_coded_sample = wc->bpp;
-    avpriv_set_pts_info(st, 64, 1, wc->rate);
-    st->start_time = 0;
-    st->duration   = wc->header.total_samples;
-
-    if (s->pb->seekable) {
-        int64_t cur = avio_tell(s->pb);
-        wc->apetag_start = ff_ape_parse_tag(s);
-        if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
-            ff_id3v1_read(s);
-        avio_seek(s->pb, cur, SEEK_SET);
-    }
-
-    return 0;
-}
-
-static int wv_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    WVContext *wc = s->priv_data;
-    int ret;
-    int off;
-    int64_t pos;
-    uint32_t block_samples;
-
-    if (s->pb->eof_reached)
-        return AVERROR_EOF;
-    if (wc->block_parsed) {
-        if ((ret = wv_read_block_header(s, s->pb)) < 0)
-            return ret;
-    }
-
-    pos = wc->pos;
-    if (av_new_packet(pkt, wc->header.blocksize + WV_HEADER_SIZE) < 0)
-        return AVERROR(ENOMEM);
-    memcpy(pkt->data, wc->block_header, WV_HEADER_SIZE);
-    ret = avio_read(s->pb, pkt->data + WV_HEADER_SIZE, wc->header.blocksize);
-    if (ret != wc->header.blocksize) {
-        av_free_packet(pkt);
-        return AVERROR(EIO);
-    }
-    while (!(wc->header.flags & WV_FLAG_FINAL_BLOCK)) {
-        if ((ret = wv_read_block_header(s, s->pb)) < 0) {
-            av_free_packet(pkt);
-            return ret;
-        }
-
-        off = pkt->size;
-        if ((ret = av_grow_packet(pkt, WV_HEADER_SIZE + wc->header.blocksize)) < 0) {
-            av_free_packet(pkt);
-            return ret;
-        }
-        memcpy(pkt->data + off, wc->block_header, WV_HEADER_SIZE);
-
-        ret = avio_read(s->pb, pkt->data + off + WV_HEADER_SIZE, wc->header.blocksize);
-        if (ret != wc->header.blocksize) {
-            av_free_packet(pkt);
-            return (ret < 0) ? ret : AVERROR_EOF;
-        }
-    }
-    pkt->stream_index = 0;
-    wc->block_parsed  = 1;
-    pkt->pts          = wc->header.block_idx;
-    block_samples     = wc->header.samples;
-    if (block_samples > INT32_MAX)
-        av_log(s, AV_LOG_WARNING,
-               "Too many samples in block: %"PRIu32"\n", block_samples);
-    else
-        pkt->duration = block_samples;
-
-    av_add_index_entry(s->streams[0], pos, pkt->pts, 0, 0, AVINDEX_KEYFRAME);
-    return 0;
-}
-
-static int wv_read_seek(AVFormatContext *s, int stream_index,
-                        int64_t timestamp, int flags)
-{
-    AVStream  *st = s->streams[stream_index];
-    WVContext *wc = s->priv_data;
-    AVPacket pkt1, *pkt = &pkt1;
-    int ret;
-    int index = av_index_search_timestamp(st, timestamp, flags);
-    int64_t pos, pts;
-
-    /* if found, seek there */
-    if (index >= 0 &&
-        timestamp <= st->index_entries[st->nb_index_entries - 1].timestamp) {
-        wc->block_parsed = 1;
-        avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
-        return 0;
-    }
-    /* if timestamp is out of bounds, return error */
-    if (timestamp < 0 || timestamp >= s->duration)
-        return AVERROR(EINVAL);
-
-    pos = avio_tell(s->pb);
-    do {
-        ret = av_read_frame(s, pkt);
-        if (ret < 0) {
-            avio_seek(s->pb, pos, SEEK_SET);
-            return ret;
-        }
-        pts = pkt->pts;
-        av_free_packet(pkt);
-    } while(pts < timestamp);
-    return 0;
-}
-
-AVInputFormat ff_wv_demuxer = {
-    .name           = "wv",
-    .long_name      = NULL_IF_CONFIG_SMALL("WavPack"),
-    .priv_data_size = sizeof(WVContext),
-    .read_probe     = wv_probe,
-    .read_header    = wv_read_header,
-    .read_packet    = wv_read_packet,
-    .read_seek      = wv_read_seek,
-};
diff --git a/deps/libav/libavformat/wvenc.c b/deps/libav/libavformat/wvenc.c
deleted file mode 100644
index 2e150e1..0000000
--- a/deps/libav/libavformat/wvenc.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-
-#include "apetag.h"
-#include "avformat.h"
-#include "wv.h"
-
-typedef struct WvMuxContext {
-    int64_t samples;
-} WvMuxContext;
-
-static av_cold int wv_write_header(AVFormatContext *ctx)
-{
-    if (ctx->nb_streams > 1 ||
-        ctx->streams[0]->codec->codec_id != AV_CODEC_ID_WAVPACK) {
-        av_log(ctx, AV_LOG_ERROR, "This muxer only supports a single WavPack stream.\n");
-        return AVERROR(EINVAL);
-    }
-
-    return 0;
-}
-
-static int wv_write_packet(AVFormatContext *ctx, AVPacket *pkt)
-{
-    WvMuxContext *s = ctx->priv_data;
-    WvHeader header;
-    int ret;
-
-    if (pkt->size < WV_HEADER_SIZE ||
-        (ret = ff_wv_parse_header(&header, pkt->data)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Invalid WavPack packet.\n");
-        return AVERROR(EINVAL);
-    }
-    s->samples += header.samples;
-
-    avio_write(ctx->pb, pkt->data, pkt->size);
-
-    return 0;
-}
-
-static av_cold int wv_write_trailer(AVFormatContext *ctx)
-{
-    WvMuxContext *s = ctx->priv_data;
-
-    /* update total number of samples in the first block */
-    if (ctx->pb->seekable && s->samples &&
-        s->samples < UINT32_MAX) {
-        int64_t pos = avio_tell(ctx->pb);
-        avio_seek(ctx->pb, 12, SEEK_SET);
-        avio_wl32(ctx->pb, s->samples);
-        avio_seek(ctx->pb, pos, SEEK_SET);
-    }
-
-    ff_ape_write_tag(ctx);
-    return 0;
-}
-
-AVOutputFormat ff_wv_muxer = {
-    .name              = "wv",
-    .long_name         = NULL_IF_CONFIG_SMALL("raw WavPack"),
-    .mime_type         = "audio/x-wavpack",
-    .extensions        = "wv",
-    .priv_data_size    = sizeof(WvMuxContext),
-    .audio_codec       = AV_CODEC_ID_WAVPACK,
-    .video_codec       = AV_CODEC_ID_NONE,
-    .write_header      = wv_write_header,
-    .write_packet      = wv_write_packet,
-    .write_trailer     = wv_write_trailer,
-    .flags             = AVFMT_NOTIMESTAMPS,
-};
diff --git a/deps/libav/libavformat/xa.c b/deps/libav/libavformat/xa.c
deleted file mode 100644
index 57a36bc..0000000
--- a/deps/libav/libavformat/xa.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Maxis XA (.xa) File Demuxer
- * Copyright (c) 2008 Robert Marston
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Maxis XA File Demuxer
- * by Robert Marston (rmarston at gmail.com)
- * for more information on the XA audio format see
- *   http://wiki.multimedia.cx/index.php?title=Maxis_XA
- */
-
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define XA00_TAG MKTAG('X', 'A', 0, 0)
-#define XAI0_TAG MKTAG('X', 'A', 'I', 0)
-#define XAJ0_TAG MKTAG('X', 'A', 'J', 0)
-
-typedef struct MaxisXADemuxContext {
-    uint32_t out_size;
-    uint32_t sent_bytes;
-} MaxisXADemuxContext;
-
-static int xa_probe(AVProbeData *p)
-{
-    int channels, srate, bits_per_sample;
-    if (p->buf_size < 24)
-        return 0;
-    switch(AV_RL32(p->buf)) {
-    case XA00_TAG:
-    case XAI0_TAG:
-    case XAJ0_TAG:
-        break;
-    default:
-        return 0;
-    }
-    channels        = AV_RL16(p->buf + 10);
-    srate           = AV_RL32(p->buf + 12);
-    bits_per_sample = AV_RL16(p->buf + 22);
-    if (!channels || channels > 8 || !srate || srate > 192000 ||
-        bits_per_sample < 4 || bits_per_sample > 32)
-        return 0;
-    return AVPROBE_SCORE_EXTENSION;
-}
-
-static int xa_read_header(AVFormatContext *s)
-{
-    MaxisXADemuxContext *xa = s->priv_data;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-
-    /*Set up the XA Audio Decoder*/
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    st->codec->codec_type   = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id     = AV_CODEC_ID_ADPCM_EA_MAXIS_XA;
-    avio_skip(pb, 4);       /* Skip the XA ID */
-    xa->out_size            =  avio_rl32(pb);
-    avio_skip(pb, 2);       /* Skip the tag */
-    st->codec->channels     = avio_rl16(pb);
-    st->codec->sample_rate  = avio_rl32(pb);
-    avio_skip(pb, 4);       /* Skip average byte rate */
-    avio_skip(pb, 2);       /* Skip block align */
-    avio_skip(pb, 2);       /* Skip bits-per-sample */
-
-    st->codec->bit_rate = av_clip(15LL * st->codec->channels * 8 *
-                                  st->codec->sample_rate / 28, 0, INT_MAX);
-
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    st->start_time = 0;
-
-    return 0;
-}
-
-static int xa_read_packet(AVFormatContext *s,
-                          AVPacket *pkt)
-{
-    MaxisXADemuxContext *xa = s->priv_data;
-    AVStream *st = s->streams[0];
-    AVIOContext *pb = s->pb;
-    unsigned int packet_size;
-    int ret;
-
-    if (xa->sent_bytes >= xa->out_size)
-        return AVERROR_EOF;
-    /* 1 byte header and 14 bytes worth of samples * number channels per block */
-    packet_size = 15*st->codec->channels;
-
-    ret = av_get_packet(pb, pkt, packet_size);
-    if(ret < 0)
-        return ret;
-
-    pkt->stream_index = st->index;
-    xa->sent_bytes += packet_size;
-    pkt->duration = 28;
-
-    return ret;
-}
-
-AVInputFormat ff_xa_demuxer = {
-    .name           = "xa",
-    .long_name      = NULL_IF_CONFIG_SMALL("Maxis XA"),
-    .priv_data_size = sizeof(MaxisXADemuxContext),
-    .read_probe     = xa_probe,
-    .read_header    = xa_read_header,
-    .read_packet    = xa_read_packet,
-};
diff --git a/deps/libav/libavformat/xmv.c b/deps/libav/libavformat/xmv.c
deleted file mode 100644
index 2b2fd45..0000000
--- a/deps/libav/libavformat/xmv.c
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * Microsoft XMV demuxer
- * Copyright (c) 2011 Sven Hesse <drmccoy at drmccoy.de>
- * Copyright (c) 2011 Matthew Hoops <clone2727 at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Microsoft XMV demuxer
- */
-
-#include <stdint.h>
-
-#include "libavutil/intreadwrite.h"
-
-#include "avformat.h"
-#include "internal.h"
-#include "riff.h"
-
-#define XMV_MIN_HEADER_SIZE 36
-
-#define XMV_AUDIO_ADPCM51_FRONTLEFTRIGHT 1
-#define XMV_AUDIO_ADPCM51_FRONTCENTERLOW 2
-#define XMV_AUDIO_ADPCM51_REARLEFTRIGHT  4
-
-#define XMV_AUDIO_ADPCM51 (XMV_AUDIO_ADPCM51_FRONTLEFTRIGHT | \
-                           XMV_AUDIO_ADPCM51_FRONTCENTERLOW | \
-                           XMV_AUDIO_ADPCM51_REARLEFTRIGHT)
-
-#define XMV_BLOCK_ALIGN_SIZE 36
-
-typedef struct XMVAudioTrack {
-    uint16_t compression;
-    uint16_t channels;
-    uint32_t sample_rate;
-    uint16_t bits_per_sample;
-    uint32_t bit_rate;
-    uint16_t flags;
-    uint16_t block_align;
-    uint16_t block_samples;
-
-    enum AVCodecID codec_id;
-} XMVAudioTrack;
-
-typedef struct XMVVideoPacket {
-    /* The decoder stream index for this video packet. */
-    int stream_index;
-
-    uint32_t data_size;
-    uint32_t data_offset;
-
-    uint32_t current_frame;
-    uint32_t frame_count;
-
-    /* Does the video packet contain extra data? */
-    int has_extradata;
-
-    /* Extra data */
-    uint8_t extradata[4];
-
-    int64_t last_pts;
-    int64_t pts;
-} XMVVideoPacket;
-
-typedef struct XMVAudioPacket {
-    /* The decoder stream index for this audio packet. */
-    int stream_index;
-
-    /* The audio track this packet encodes. */
-    XMVAudioTrack *track;
-
-    uint32_t data_size;
-    uint32_t data_offset;
-
-    uint32_t frame_size;
-
-    uint32_t block_count;
-} XMVAudioPacket;
-
-typedef struct XMVDemuxContext {
-    uint16_t audio_track_count;
-
-    XMVAudioTrack *audio_tracks;
-
-    uint32_t this_packet_size;
-    uint32_t next_packet_size;
-
-    uint32_t this_packet_offset;
-    uint32_t next_packet_offset;
-
-    uint16_t current_stream;
-    uint16_t stream_count;
-
-    XMVVideoPacket  video;
-    XMVAudioPacket *audio;
-} XMVDemuxContext;
-
-static int xmv_probe(AVProbeData *p)
-{
-    uint32_t file_version;
-
-    if (p->buf_size < XMV_MIN_HEADER_SIZE)
-        return 0;
-
-    file_version = AV_RL32(p->buf + 16);
-    if ((file_version == 0) || (file_version > 4))
-        return 0;
-
-    if (!memcmp(p->buf + 12, "xobX", 4))
-        return AVPROBE_SCORE_MAX;
-
-    return 0;
-}
-
-static int xmv_read_close(AVFormatContext *s)
-{
-    XMVDemuxContext *xmv = s->priv_data;
-
-    av_free(xmv->audio);
-    av_free(xmv->audio_tracks);
-
-    return 0;
-}
-
-static int xmv_read_header(AVFormatContext *s)
-{
-    XMVDemuxContext *xmv = s->priv_data;
-    AVIOContext     *pb  = s->pb;
-    AVStream        *vst = NULL;
-
-    uint32_t file_version;
-    uint32_t this_packet_size;
-    uint16_t audio_track;
-    int ret;
-
-    avio_skip(pb, 4); /* Next packet size */
-
-    this_packet_size = avio_rl32(pb);
-
-    avio_skip(pb, 4); /* Max packet size */
-    avio_skip(pb, 4); /* "xobX" */
-
-    file_version = avio_rl32(pb);
-    if ((file_version != 4) && (file_version != 2))
-        avpriv_request_sample(s, "Uncommon version %d", file_version);
-
-
-    /* Video track */
-
-    vst = avformat_new_stream(s, NULL);
-    if (!vst)
-        return AVERROR(ENOMEM);
-
-    avpriv_set_pts_info(vst, 32, 1, 1000);
-
-    vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    vst->codec->codec_id   = AV_CODEC_ID_WMV2;
-    vst->codec->codec_tag  = MKBETAG('W', 'M', 'V', '2');
-    vst->codec->width      = avio_rl32(pb);
-    vst->codec->height     = avio_rl32(pb);
-
-    vst->duration          = avio_rl32(pb);
-
-    xmv->video.stream_index = vst->index;
-
-    /* Audio tracks */
-
-    xmv->audio_track_count = avio_rl16(pb);
-
-    avio_skip(pb, 2); /* Unknown (padding?) */
-
-    xmv->audio_tracks = av_malloc(xmv->audio_track_count * sizeof(XMVAudioTrack));
-    if (!xmv->audio_tracks)
-        return AVERROR(ENOMEM);
-
-    xmv->audio = av_malloc(xmv->audio_track_count * sizeof(XMVAudioPacket));
-    if (!xmv->audio) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    for (audio_track = 0; audio_track < xmv->audio_track_count; audio_track++) {
-        XMVAudioTrack  *track  = &xmv->audio_tracks[audio_track];
-        XMVAudioPacket *packet = &xmv->audio       [audio_track];
-        AVStream *ast = NULL;
-
-        track->compression     = avio_rl16(pb);
-        track->channels        = avio_rl16(pb);
-        track->sample_rate     = avio_rl32(pb);
-        track->bits_per_sample = avio_rl16(pb);
-        track->flags           = avio_rl16(pb);
-
-        track->bit_rate      = track->bits_per_sample *
-                               track->sample_rate *
-                               track->channels;
-        track->block_align   = XMV_BLOCK_ALIGN_SIZE * track->channels;
-        track->block_samples = 64;
-        track->codec_id      = ff_wav_codec_get_id(track->compression,
-                                                   track->bits_per_sample);
-
-        packet->track        = track;
-        packet->stream_index = -1;
-
-        packet->frame_size  = 0;
-        packet->block_count = 0;
-
-        /* TODO: ADPCM'd 5.1 sound is encoded in three separate streams.
-         *       Those need to be interleaved to a proper 5.1 stream. */
-        if (track->flags & XMV_AUDIO_ADPCM51)
-            av_log(s, AV_LOG_WARNING, "Unsupported 5.1 ADPCM audio stream "
-                                      "(0x%04X)\n", track->flags);
-
-        if (!track->channels || !track->sample_rate ||
-             track->channels >= UINT16_MAX / XMV_BLOCK_ALIGN_SIZE) {
-            av_log(s, AV_LOG_ERROR, "Invalid parameters for audio track %d.\n",
-                   audio_track);
-            ret = AVERROR_INVALIDDATA;
-            goto fail;
-        }
-
-        ast = avformat_new_stream(s, NULL);
-        if (!ast) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-
-        ast->codec->codec_type            = AVMEDIA_TYPE_AUDIO;
-        ast->codec->codec_id              = track->codec_id;
-        ast->codec->codec_tag             = track->compression;
-        ast->codec->channels              = track->channels;
-        ast->codec->sample_rate           = track->sample_rate;
-        ast->codec->bits_per_coded_sample = track->bits_per_sample;
-        ast->codec->bit_rate              = track->bit_rate;
-        ast->codec->block_align           = 36 * track->channels;
-
-        avpriv_set_pts_info(ast, 32, track->block_samples, track->sample_rate);
-
-        packet->stream_index = ast->index;
-
-        ast->duration = vst->duration;
-    }
-
-
-    /** Initialize the packet context */
-
-    xmv->next_packet_offset = avio_tell(pb);
-    xmv->next_packet_size   = this_packet_size - xmv->next_packet_offset;
-    xmv->stream_count       = xmv->audio_track_count + 1;
-
-    return 0;
-
-fail:
-    xmv_read_close(s);
-    return ret;
-}
-
-static void xmv_read_extradata(uint8_t *extradata, AVIOContext *pb)
-{
-    /* Read the XMV extradata */
-
-    uint32_t data = avio_rl32(pb);
-
-    int mspel_bit        = !!(data & 0x01);
-    int loop_filter      = !!(data & 0x02);
-    int abt_flag         = !!(data & 0x04);
-    int j_type_bit       = !!(data & 0x08);
-    int top_left_mv_flag = !!(data & 0x10);
-    int per_mb_rl_bit    = !!(data & 0x20);
-    int slice_count      = (data >> 6) & 7;
-
-    /* Write it back as standard WMV2 extradata */
-
-    data = 0;
-
-    data |= mspel_bit        << 15;
-    data |= loop_filter      << 14;
-    data |= abt_flag         << 13;
-    data |= j_type_bit       << 12;
-    data |= top_left_mv_flag << 11;
-    data |= per_mb_rl_bit    << 10;
-    data |= slice_count      <<  7;
-
-    AV_WB32(extradata, data);
-}
-
-static int xmv_process_packet_header(AVFormatContext *s)
-{
-    XMVDemuxContext *xmv = s->priv_data;
-    AVIOContext     *pb  = s->pb;
-
-    uint8_t  data[8];
-    uint16_t audio_track;
-    uint32_t data_offset;
-
-    /* Next packet size */
-    xmv->next_packet_size = avio_rl32(pb);
-
-    /* Packet video header */
-
-    if (avio_read(pb, data, 8) != 8)
-        return AVERROR(EIO);
-
-    xmv->video.data_size     = AV_RL32(data) & 0x007FFFFF;
-
-    xmv->video.current_frame = 0;
-    xmv->video.frame_count   = (AV_RL32(data) >> 23) & 0xFF;
-
-    xmv->video.has_extradata = (data[3] & 0x80) != 0;
-
-    /* Adding the audio data sizes and the video data size keeps you 4 bytes
-     * short for every audio track. But as playing around with XMV files with
-     * ADPCM audio showed, taking the extra 4 bytes from the audio data gives
-     * you either completely distorted audio or click (when skipping the
-     * remaining 68 bytes of the ADPCM block). Subtracting 4 bytes for every
-     * audio track from the video data works at least for the audio. Probably
-     * some alignment thing?
-     * The video data has (always?) lots of padding, so it should work out...
-     */
-    xmv->video.data_size -= xmv->audio_track_count * 4;
-
-    xmv->current_stream = 0;
-    if (!xmv->video.frame_count) {
-        xmv->video.frame_count = 1;
-        xmv->current_stream    = 1;
-    }
-
-    /* Packet audio header */
-
-    for (audio_track = 0; audio_track < xmv->audio_track_count; audio_track++) {
-        XMVAudioPacket *packet = &xmv->audio[audio_track];
-
-        if (avio_read(pb, data, 4) != 4)
-            return AVERROR(EIO);
-
-        packet->data_size = AV_RL32(data) & 0x007FFFFF;
-        if ((packet->data_size == 0) && (audio_track != 0))
-            /* This happens when I create an XMV with several identical audio
-             * streams. From the size calculations, duplicating the previous
-             * stream's size works out, but the track data itself is silent.
-             * Maybe this should also redirect the offset to the previous track?
-             */
-            packet->data_size = xmv->audio[audio_track - 1].data_size;
-
-        /** Carve up the audio data in frame_count slices */
-        packet->frame_size  = packet->data_size  / xmv->video.frame_count;
-        packet->frame_size -= packet->frame_size % packet->track->block_align;
-    }
-
-    /* Packet data offsets */
-
-    data_offset = avio_tell(pb);
-
-    xmv->video.data_offset = data_offset;
-    data_offset += xmv->video.data_size;
-
-    for (audio_track = 0; audio_track < xmv->audio_track_count; audio_track++) {
-        xmv->audio[audio_track].data_offset = data_offset;
-        data_offset += xmv->audio[audio_track].data_size;
-    }
-
-    /* Video frames header */
-
-    /* Read new video extra data */
-    if (xmv->video.data_size > 0) {
-        if (xmv->video.has_extradata) {
-            xmv_read_extradata(xmv->video.extradata, pb);
-
-            xmv->video.data_size   -= 4;
-            xmv->video.data_offset += 4;
-
-            if (xmv->video.stream_index >= 0) {
-                AVStream *vst = s->streams[xmv->video.stream_index];
-
-                assert(xmv->video.stream_index < s->nb_streams);
-
-                if (vst->codec->extradata_size < 4) {
-                    av_free(vst->codec->extradata);
-
-                    vst->codec->extradata =
-                        av_malloc(4 + FF_INPUT_BUFFER_PADDING_SIZE);
-                    vst->codec->extradata_size = 4;
-                }
-
-                memcpy(vst->codec->extradata, xmv->video.extradata, 4);
-            }
-        }
-    }
-
-    return 0;
-}
-
-static int xmv_fetch_new_packet(AVFormatContext *s)
-{
-    XMVDemuxContext *xmv = s->priv_data;
-    AVIOContext     *pb  = s->pb;
-    int result;
-
-    /* Seek to it */
-    xmv->this_packet_offset = xmv->next_packet_offset;
-    if (avio_seek(pb, xmv->this_packet_offset, SEEK_SET) != xmv->this_packet_offset)
-        return AVERROR(EIO);
-
-    /* Update the size */
-    xmv->this_packet_size = xmv->next_packet_size;
-    if (xmv->this_packet_size < (12 + xmv->audio_track_count * 4))
-        return AVERROR(EIO);
-
-    /* Process the header */
-    result = xmv_process_packet_header(s);
-    if (result)
-        return result;
-
-    /* Update the offset */
-    xmv->next_packet_offset = xmv->this_packet_offset + xmv->this_packet_size;
-
-    return 0;
-}
-
-static int xmv_fetch_audio_packet(AVFormatContext *s,
-                                  AVPacket *pkt, uint32_t stream)
-{
-    XMVDemuxContext *xmv   = s->priv_data;
-    AVIOContext     *pb    = s->pb;
-    XMVAudioPacket  *audio = &xmv->audio[stream];
-
-    uint32_t data_size;
-    uint32_t block_count;
-    int result;
-
-    /* Seek to it */
-    if (avio_seek(pb, audio->data_offset, SEEK_SET) != audio->data_offset)
-        return AVERROR(EIO);
-
-    if ((xmv->video.current_frame + 1) < xmv->video.frame_count)
-        /* Not the last frame, get at most frame_size bytes. */
-        data_size = FFMIN(audio->frame_size, audio->data_size);
-    else
-        /* Last frame, get the rest. */
-        data_size = audio->data_size;
-
-    /* Read the packet */
-    result = av_get_packet(pb, pkt, data_size);
-    if (result <= 0)
-        return result;
-
-    pkt->stream_index = audio->stream_index;
-
-    /* Calculate the PTS */
-
-    block_count = data_size / audio->track->block_align;
-
-    pkt->duration = block_count;
-    pkt->pts      = audio->block_count;
-    pkt->dts      = AV_NOPTS_VALUE;
-
-    audio->block_count += block_count;
-
-    /* Advance offset */
-    audio->data_size   -= data_size;
-    audio->data_offset += data_size;
-
-    return 0;
-}
-
-static int xmv_fetch_video_packet(AVFormatContext *s,
-                                  AVPacket *pkt)
-{
-    XMVDemuxContext *xmv   = s->priv_data;
-    AVIOContext     *pb    = s->pb;
-    XMVVideoPacket  *video = &xmv->video;
-
-    int result;
-    uint32_t frame_header;
-    uint32_t frame_size, frame_timestamp;
-    uint32_t i;
-
-    /* Seek to it */
-    if (avio_seek(pb, video->data_offset, SEEK_SET) != video->data_offset)
-        return AVERROR(EIO);
-
-    /* Read the frame header */
-    frame_header = avio_rl32(pb);
-
-    frame_size      = (frame_header & 0x1FFFF) * 4 + 4;
-    frame_timestamp = (frame_header >> 17);
-
-    if ((frame_size + 4) > video->data_size)
-        return AVERROR(EIO);
-
-    /* Create the packet */
-    result = av_new_packet(pkt, frame_size);
-    if (result)
-        return result;
-
-    /* Contrary to normal WMV2 video, the bit stream in XMV's
-     * WMV2 is little-endian.
-     * TODO: This manual swap is of course suboptimal.
-     */
-    for (i = 0; i < frame_size; i += 4)
-        AV_WB32(pkt->data + i, avio_rl32(pb));
-
-    pkt->stream_index = video->stream_index;
-
-    /* Calculate the PTS */
-
-    video->last_pts = frame_timestamp + video->pts;
-
-    pkt->duration = 0;
-    pkt->pts      = video->last_pts;
-    pkt->dts      = AV_NOPTS_VALUE;
-
-    video->pts += frame_timestamp;
-
-    /* Keyframe? */
-    pkt->flags = (pkt->data[0] & 0x80) ? 0 : AV_PKT_FLAG_KEY;
-
-    /* Advance offset */
-    video->data_size   -= frame_size + 4;
-    video->data_offset += frame_size + 4;
-
-    return 0;
-}
-
-static int xmv_read_packet(AVFormatContext *s,
-                           AVPacket *pkt)
-{
-    XMVDemuxContext *xmv = s->priv_data;
-    int result;
-
-    if (xmv->video.current_frame == xmv->video.frame_count) {
-        /* No frames left in this packet, so we fetch a new one */
-
-        result = xmv_fetch_new_packet(s);
-        if (result)
-            return result;
-    }
-
-    if (xmv->current_stream == 0) {
-        /* Fetch a video frame */
-
-        result = xmv_fetch_video_packet(s, pkt);
-        if (result)
-            return result;
-
-    } else {
-        /* Fetch an audio frame */
-
-        result = xmv_fetch_audio_packet(s, pkt, xmv->current_stream - 1);
-        if (result)
-            return result;
-    }
-
-    /* Increase our counters */
-    if (++xmv->current_stream >= xmv->stream_count) {
-        xmv->current_stream       = 0;
-        xmv->video.current_frame += 1;
-    }
-
-    return 0;
-}
-
-AVInputFormat ff_xmv_demuxer = {
-    .name           = "xmv",
-    .long_name      = NULL_IF_CONFIG_SMALL("Microsoft XMV"),
-    .priv_data_size = sizeof(XMVDemuxContext),
-    .read_probe     = xmv_probe,
-    .read_header    = xmv_read_header,
-    .read_packet    = xmv_read_packet,
-    .read_close     = xmv_read_close,
-};
diff --git a/deps/libav/libavformat/xwma.c b/deps/libav/libavformat/xwma.c
deleted file mode 100644
index 45d74de..0000000
--- a/deps/libav/libavformat/xwma.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * xWMA demuxer
- * Copyright (c) 2011 Max Horn
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-#include <stdint.h>
-
-#include "avformat.h"
-#include "internal.h"
-#include "riff.h"
-
-/*
- * Demuxer for xWMA, a Microsoft audio container used by XAudio 2.
- */
-
-typedef struct {
-    int64_t data_end;
-} XWMAContext;
-
-static int xwma_probe(AVProbeData *p)
-{
-    if (!memcmp(p->buf, "RIFF", 4) && !memcmp(p->buf + 8, "XWMA", 4))
-        return AVPROBE_SCORE_MAX;
-    return 0;
-}
-
-static int xwma_read_header(AVFormatContext *s)
-{
-    int64_t size;
-    int ret;
-    uint32_t dpds_table_size = 0;
-    uint32_t *dpds_table = 0;
-    unsigned int tag;
-    AVIOContext *pb = s->pb;
-    AVStream *st;
-    XWMAContext *xwma = s->priv_data;
-    int i;
-
-    /* The following code is mostly copied from wav.c, with some
-     * minor alterations.
-     */
-
-    /* check RIFF header */
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('R', 'I', 'F', 'F'))
-        return -1;
-    avio_rl32(pb); /* file size */
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('X', 'W', 'M', 'A'))
-        return -1;
-
-    /* parse fmt header */
-    tag = avio_rl32(pb);
-    if (tag != MKTAG('f', 'm', 't', ' '))
-        return -1;
-    size = avio_rl32(pb);
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-
-    ret = ff_get_wav_header(pb, st->codec, size);
-    if (ret < 0)
-        return ret;
-    st->need_parsing = AVSTREAM_PARSE_NONE;
-
-    /* All xWMA files I have seen contained WMAv2 data. If there are files
-     * using WMA Pro or some other codec, then we need to figure out the right
-     * extradata for that. Thus, ask the user for feedback, but try to go on
-     * anyway.
-     */
-    if (st->codec->codec_id != AV_CODEC_ID_WMAV2) {
-        avpriv_request_sample(s, "Unexpected codec (tag 0x04%x; id %d)",
-                              st->codec->codec_tag, st->codec->codec_id);
-    } else {
-        /* In all xWMA files I have seen, there is no extradata. But the WMA
-         * codecs require extradata, so we provide our own fake extradata.
-         *
-         * First, check that there really was no extradata in the header. If
-         * there was, then try to use it, after asking the user to provide a
-         * sample of this unusual file.
-         */
-        if (st->codec->extradata_size != 0) {
-            /* Surprise, surprise: We *did* get some extradata. No idea
-             * if it will work, but just go on and try it, after asking
-             * the user for a sample.
-             */
-            avpriv_request_sample(s, "Unexpected extradata (%d bytes)",
-                                  st->codec->extradata_size);
-        } else {
-            st->codec->extradata_size = 6;
-            st->codec->extradata      = av_mallocz(6 + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!st->codec->extradata)
-                return AVERROR(ENOMEM);
-
-            /* setup extradata with our experimentally obtained value */
-            st->codec->extradata[4] = 31;
-        }
-    }
-
-    if (!st->codec->channels) {
-        av_log(s, AV_LOG_WARNING, "Invalid channel count: %d\n",
-               st->codec->channels);
-        return AVERROR_INVALIDDATA;
-    }
-    if (!st->codec->bits_per_coded_sample) {
-        av_log(s, AV_LOG_WARNING, "Invalid bits_per_coded_sample: %d\n",
-               st->codec->bits_per_coded_sample);
-        return AVERROR_INVALIDDATA;
-    }
-
-    /* set the sample rate */
-    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
-
-    /* parse the remaining RIFF chunks */
-    for (;;) {
-        if (pb->eof_reached)
-            return -1;
-        /* read next chunk tag */
-        tag = avio_rl32(pb);
-        size = avio_rl32(pb);
-        if (tag == MKTAG('d', 'a', 't', 'a')) {
-            /* We assume that the data chunk comes last. */
-            break;
-        } else if (tag == MKTAG('d','p','d','s')) {
-            /* Quoting the MSDN xWMA docs on the dpds chunk: "Contains the
-             * decoded packet cumulative data size array, each element is the
-             * number of bytes accumulated after the corresponding xWMA packet
-             * is decoded in order."
-             *
-             * Each packet has size equal to st->codec->block_align, which in
-             * all cases I saw so far was always 2230. Thus, we can use the
-             * dpds data to compute a seeking index.
-             */
-
-            /* Error out if there is more than one dpds chunk. */
-            if (dpds_table) {
-                av_log(s, AV_LOG_ERROR, "two dpds chunks present\n");
-                return -1;
-            }
-
-            /* Compute the number of entries in the dpds chunk. */
-            if (size & 3) {  /* Size should be divisible by four */
-                av_log(s, AV_LOG_WARNING,
-                       "dpds chunk size %"PRId64" not divisible by 4\n", size);
-            }
-            dpds_table_size = size / 4;
-            if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
-                av_log(s, AV_LOG_ERROR,
-                       "dpds chunk size %"PRId64" invalid\n", size);
-                return -1;
-            }
-
-            /* Allocate some temporary storage to keep the dpds data around.
-             * for processing later on.
-             */
-            dpds_table = av_malloc(dpds_table_size * sizeof(uint32_t));
-            if (!dpds_table) {
-                return AVERROR(ENOMEM);
-            }
-
-            for (i = 0; i < dpds_table_size; ++i) {
-                dpds_table[i] = avio_rl32(pb);
-                size -= 4;
-            }
-        }
-        avio_skip(pb, size);
-    }
-
-    /* Determine overall data length */
-    if (size < 0)
-        return -1;
-    if (!size) {
-        xwma->data_end = INT64_MAX;
-    } else
-        xwma->data_end = avio_tell(pb) + size;
-
-
-    if (dpds_table && dpds_table_size) {
-        int64_t cur_pos;
-        const uint32_t bytes_per_sample
-                = (st->codec->channels * st->codec->bits_per_coded_sample) >> 3;
-
-        /* Estimate the duration from the total number of output bytes. */
-        const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1];
-
-        if (!bytes_per_sample) {
-            av_log(s, AV_LOG_ERROR,
-                   "Invalid bits_per_coded_sample %d for %d channels\n",
-                   st->codec->bits_per_coded_sample, st->codec->channels);
-            return AVERROR_INVALIDDATA;
-        }
-
-        st->duration = total_decoded_bytes / bytes_per_sample;
-
-        /* Use the dpds data to build a seek table.  We can only do this after
-         * we know the offset to the data chunk, as we need that to determine
-         * the actual offset to each input block.
-         * Note: If we allowed ourselves to assume that the data chunk always
-         * follows immediately after the dpds block, we could of course guess
-         * the data block's start offset already while reading the dpds chunk.
-         * I decided against that, just in case other chunks ever are
-         * discovered.
-         */
-        cur_pos = avio_tell(pb);
-        for (i = 0; i < dpds_table_size; ++i) {
-            /* From the number of output bytes that would accumulate in the
-             * output buffer after decoding the first (i+1) packets, we compute
-             * an offset / timestamp pair.
-             */
-            av_add_index_entry(st,
-                               cur_pos + (i+1) * st->codec->block_align, /* pos */
-                               dpds_table[i] / bytes_per_sample,         /* timestamp */
-                               st->codec->block_align,                   /* size */
-                               0,                                        /* duration */
-                               AVINDEX_KEYFRAME);
-        }
-    } else if (st->codec->bit_rate) {
-        /* No dpds chunk was present (or only an empty one), so estimate
-         * the total duration using the average bits per sample and the
-         * total data length.
-         */
-        st->duration = (size<<3) * st->codec->sample_rate / st->codec->bit_rate;
-    }
-
-    av_free(dpds_table);
-
-    return 0;
-}
-
-static int xwma_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int ret, size;
-    int64_t left;
-    AVStream *st;
-    XWMAContext *xwma = s->priv_data;
-
-    st = s->streams[0];
-
-    left = xwma->data_end - avio_tell(s->pb);
-    if (left <= 0) {
-        return AVERROR_EOF;
-    }
-
-    /* read a single block; the default block size is 2230. */
-    size = (st->codec->block_align > 1) ? st->codec->block_align : 2230;
-    size = FFMIN(size, left);
-
-    ret  = av_get_packet(s->pb, pkt, size);
-    if (ret < 0)
-        return ret;
-
-    pkt->stream_index = 0;
-    return ret;
-}
-
-AVInputFormat ff_xwma_demuxer = {
-    .name           = "xwma",
-    .long_name      = NULL_IF_CONFIG_SMALL("Microsoft xWMA"),
-    .priv_data_size = sizeof(XWMAContext),
-    .read_probe     = xwma_probe,
-    .read_header    = xwma_read_header,
-    .read_packet    = xwma_read_packet,
-};
diff --git a/deps/libav/libavformat/yop.c b/deps/libav/libavformat/yop.c
deleted file mode 100644
index 8caeb07..0000000
--- a/deps/libav/libavformat/yop.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Psygnosis YOP demuxer
- *
- * Copyright (C) 2010 Mohamed Naufal Basheer <naufal11 at gmail.com>
- * derived from the code by
- * Copyright (C) 2009 Thomas P. Higdon <thomas.p.higdon at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/intreadwrite.h"
-#include "avformat.h"
-#include "internal.h"
-
-typedef struct yop_dec_context {
-    AVPacket video_packet;
-
-    int odd_frame;
-    int frame_size;
-    int audio_block_length;
-    int palette_size;
-} YopDecContext;
-
-static int yop_probe(AVProbeData *probe_packet)
-{
-    if (AV_RB16(probe_packet->buf) == AV_RB16("YO")  &&
-        probe_packet->buf[6]                         &&
-        probe_packet->buf[7]                         &&
-        !(probe_packet->buf[8] & 1)                  &&
-        !(probe_packet->buf[10] & 1))
-        return AVPROBE_SCORE_MAX * 3 / 4;
-
-    return 0;
-}
-
-static int yop_read_header(AVFormatContext *s)
-{
-    YopDecContext *yop = s->priv_data;
-    AVIOContext *pb  = s->pb;
-
-    AVCodecContext *audio_dec, *video_dec;
-    AVStream *audio_stream, *video_stream;
-
-    int frame_rate, ret;
-
-    audio_stream = avformat_new_stream(s, NULL);
-    video_stream = avformat_new_stream(s, NULL);
-
-    // Extra data that will be passed to the decoder
-    video_stream->codec->extradata_size = 8;
-
-    video_stream->codec->extradata = av_mallocz(video_stream->codec->extradata_size +
-                                                FF_INPUT_BUFFER_PADDING_SIZE);
-
-    if (!video_stream->codec->extradata)
-        return AVERROR(ENOMEM);
-
-    // Audio
-    audio_dec               = audio_stream->codec;
-    audio_dec->codec_type   = AVMEDIA_TYPE_AUDIO;
-    audio_dec->codec_id     = AV_CODEC_ID_ADPCM_IMA_APC;
-    audio_dec->channels     = 1;
-    audio_dec->channel_layout = AV_CH_LAYOUT_MONO;
-    audio_dec->sample_rate  = 22050;
-
-    // Video
-    video_dec               = video_stream->codec;
-    video_dec->codec_type   = AVMEDIA_TYPE_VIDEO;
-    video_dec->codec_id     = AV_CODEC_ID_YOP;
-
-    avio_skip(pb, 6);
-
-    frame_rate              = avio_r8(pb);
-    yop->frame_size         = avio_r8(pb) * 2048;
-    video_dec->width        = avio_rl16(pb);
-    video_dec->height       = avio_rl16(pb);
-
-    video_stream->sample_aspect_ratio = (AVRational){1, 2};
-
-    ret = avio_read(pb, video_dec->extradata, 8);
-    if (ret < 8)
-        return ret < 0 ? ret : AVERROR_EOF;
-
-    yop->palette_size       = video_dec->extradata[0] * 3 + 4;
-    yop->audio_block_length = AV_RL16(video_dec->extradata + 6);
-
-    // 1840 samples per frame, 1 nibble per sample; hence 1840/2 = 920
-    if (yop->audio_block_length < 920 ||
-        yop->audio_block_length + yop->palette_size >= yop->frame_size) {
-        av_log(s, AV_LOG_ERROR, "YOP has invalid header\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    avio_seek(pb, 2048, SEEK_SET);
-
-    avpriv_set_pts_info(video_stream, 32, 1, frame_rate);
-
-    return 0;
-}
-
-static int yop_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    YopDecContext *yop = s->priv_data;
-    AVIOContext *pb  = s->pb;
-
-    int ret;
-    int actual_video_data_size = yop->frame_size -
-                                 yop->audio_block_length - yop->palette_size;
-
-    yop->video_packet.stream_index = 1;
-
-    if (yop->video_packet.data) {
-        *pkt                   =  yop->video_packet;
-        yop->video_packet.data =  NULL;
-        yop->video_packet.buf  =  NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
-        yop->video_packet.destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-        yop->video_packet.size =  0;
-        pkt->data[0]           =  yop->odd_frame;
-        pkt->flags             |= AV_PKT_FLAG_KEY;
-        yop->odd_frame         ^= 1;
-        return pkt->size;
-    }
-    ret = av_new_packet(&yop->video_packet,
-                        yop->frame_size - yop->audio_block_length);
-    if (ret < 0)
-        return ret;
-
-    yop->video_packet.pos = avio_tell(pb);
-
-    ret = avio_read(pb, yop->video_packet.data, yop->palette_size);
-    if (ret < 0) {
-        goto err_out;
-    }else if (ret < yop->palette_size) {
-        ret = AVERROR_EOF;
-        goto err_out;
-    }
-
-    ret = av_get_packet(pb, pkt, 920);
-    if (ret < 0)
-        goto err_out;
-
-    // Set position to the start of the frame
-    pkt->pos = yop->video_packet.pos;
-
-    avio_skip(pb, yop->audio_block_length - ret);
-
-    ret = avio_read(pb, yop->video_packet.data + yop->palette_size,
-                     actual_video_data_size);
-    if (ret < 0)
-        goto err_out;
-    else if (ret < actual_video_data_size)
-        av_shrink_packet(&yop->video_packet, yop->palette_size + ret);
-
-    // Arbitrarily return the audio data first
-    return yop->audio_block_length;
-
-err_out:
-    av_free_packet(&yop->video_packet);
-    return ret;
-}
-
-static int yop_read_close(AVFormatContext *s)
-{
-    YopDecContext *yop = s->priv_data;
-    av_free_packet(&yop->video_packet);
-    return 0;
-}
-
-static int yop_read_seek(AVFormatContext *s, int stream_index,
-                         int64_t timestamp, int flags)
-{
-    YopDecContext *yop = s->priv_data;
-    int64_t frame_pos, pos_min, pos_max;
-    int frame_count;
-
-    if (!stream_index)
-        return -1;
-
-    pos_min        = s->data_offset;
-    pos_max        = avio_size(s->pb) - yop->frame_size;
-    frame_count    = (pos_max - pos_min) / yop->frame_size;
-
-    timestamp      = FFMAX(0, FFMIN(frame_count, timestamp));
-
-    frame_pos      = timestamp * yop->frame_size + pos_min;
-
-    if (avio_seek(s->pb, frame_pos, SEEK_SET) < 0)
-        return -1;
-
-    av_free_packet(&yop->video_packet);
-    yop->odd_frame = timestamp & 1;
-
-    return 0;
-}
-
-AVInputFormat ff_yop_demuxer = {
-    .name           = "yop",
-    .long_name      = NULL_IF_CONFIG_SMALL("Psygnosis YOP"),
-    .priv_data_size = sizeof(YopDecContext),
-    .read_probe     = yop_probe,
-    .read_header    = yop_read_header,
-    .read_packet    = yop_read_packet,
-    .read_close     = yop_read_close,
-    .read_seek      = yop_read_seek,
-    .extensions     = "yop",
-    .flags          = AVFMT_GENERIC_INDEX,
-};
diff --git a/deps/libav/libavformat/yuv4mpeg.c b/deps/libav/libavformat/yuv4mpeg.c
deleted file mode 100644
index f793a0e..0000000
--- a/deps/libav/libavformat/yuv4mpeg.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * YUV4MPEG format
- * Copyright (c) 2001, 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/pixdesc.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define Y4M_MAGIC "YUV4MPEG2"
-#define Y4M_FRAME_MAGIC "FRAME"
-#define Y4M_LINE_MAX 256
-
-struct frame_attributes {
-    int interlaced_frame;
-    int top_field_first;
-};
-
-#if CONFIG_YUV4MPEGPIPE_MUXER
-static int yuv4_generate_header(AVFormatContext *s, char* buf)
-{
-    AVStream *st;
-    int width, height;
-    int raten, rated, aspectn, aspectd, n;
-    char inter;
-    const char *colorspace = "";
-
-    st     = s->streams[0];
-    width  = st->codec->width;
-    height = st->codec->height;
-
-    av_reduce(&raten, &rated, st->codec->time_base.den,
-              st->codec->time_base.num, (1UL << 31) - 1);
-
-    aspectn = st->sample_aspect_ratio.num;
-    aspectd = st->sample_aspect_ratio.den;
-
-    if (aspectn == 0 && aspectd == 1)
-        aspectd = 0;  // 0:0 means unknown
-
-    inter = 'p'; /* progressive is the default */
-    if (st->codec->coded_frame && st->codec->coded_frame->interlaced_frame)
-        inter = st->codec->coded_frame->top_field_first ? 't' : 'b';
-
-    switch (st->codec->pix_fmt) {
-    case AV_PIX_FMT_GRAY8:
-        colorspace = " Cmono";
-        break;
-    case AV_PIX_FMT_YUV411P:
-        colorspace = " C411 XYSCSS=411";
-        break;
-    case AV_PIX_FMT_YUV420P:
-        switch (st->codec->chroma_sample_location) {
-        case AVCHROMA_LOC_TOPLEFT: colorspace = " C420paldv XYSCSS=420PALDV"; break;
-        case AVCHROMA_LOC_LEFT:    colorspace = " C420mpeg2 XYSCSS=420MPEG2"; break;
-        default:                   colorspace = " C420jpeg XYSCSS=420JPEG";   break;
-        }
-        break;
-    case AV_PIX_FMT_YUV422P:
-        colorspace = " C422 XYSCSS=422";
-        break;
-    case AV_PIX_FMT_YUV444P:
-        colorspace = " C444 XYSCSS=444";
-        break;
-    }
-
-    /* construct stream header, if this is the first frame */
-    n = snprintf(buf, Y4M_LINE_MAX, "%s W%d H%d F%d:%d I%c A%d:%d%s\n",
-                 Y4M_MAGIC, width, height, raten, rated, inter,
-                 aspectn, aspectd, colorspace);
-
-    return n;
-}
-
-static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    AVStream *st = s->streams[pkt->stream_index];
-    AVIOContext *pb = s->pb;
-    AVPicture *picture;
-    int* first_pkt = s->priv_data;
-    int width, height, h_chroma_shift, v_chroma_shift;
-    int i;
-    char buf2[Y4M_LINE_MAX + 1];
-    char buf1[20];
-    uint8_t *ptr, *ptr1, *ptr2;
-
-    picture = (AVPicture *)pkt->data;
-
-    /* for the first packet we have to output the header as well */
-    if (*first_pkt) {
-        *first_pkt = 0;
-        if (yuv4_generate_header(s, buf2) < 0) {
-            av_log(s, AV_LOG_ERROR,
-                   "Error. YUV4MPEG stream header write failed.\n");
-            return AVERROR(EIO);
-        } else {
-            avio_write(pb, buf2, strlen(buf2));
-        }
-    }
-
-    /* construct frame header */
-
-    snprintf(buf1, sizeof(buf1), "%s\n", Y4M_FRAME_MAGIC);
-    avio_write(pb, buf1, strlen(buf1));
-
-    width  = st->codec->width;
-    height = st->codec->height;
-
-    ptr = picture->data[0];
-    for (i = 0; i < height; i++) {
-        avio_write(pb, ptr, width);
-        ptr += picture->linesize[0];
-    }
-
-    if (st->codec->pix_fmt != AV_PIX_FMT_GRAY8) {
-        // Adjust for smaller Cb and Cr planes
-        av_pix_fmt_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,
-                                         &v_chroma_shift);
-        // Shift right, rounding up
-        width  = -(-width  >> h_chroma_shift);
-        height = -(-height >> v_chroma_shift);
-
-        ptr1 = picture->data[1];
-        ptr2 = picture->data[2];
-        for (i = 0; i < height; i++) {     /* Cb */
-            avio_write(pb, ptr1, width);
-            ptr1 += picture->linesize[1];
-        }
-        for (i = 0; i < height; i++) {     /* Cr */
-            avio_write(pb, ptr2, width);
-            ptr2 += picture->linesize[2];
-        }
-    }
-    return 0;
-}
-
-static int yuv4_write_header(AVFormatContext *s)
-{
-    int *first_pkt = s->priv_data;
-
-    if (s->nb_streams != 1)
-        return AVERROR(EIO);
-
-    if (s->streams[0]->codec->codec_id != AV_CODEC_ID_RAWVIDEO) {
-        av_log(s, AV_LOG_ERROR, "ERROR: Only rawvideo supported.\n");
-        return AVERROR_INVALIDDATA;
-    }
-
-    if (s->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV411P) {
-        av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV "
-               "stream, some mjpegtools might not work.\n");
-    } else if ((s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV420P) &&
-               (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV422P) &&
-               (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_GRAY8)   &&
-               (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV444P)) {
-        av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, "
-               "yuv422p, yuv420p, yuv411p and gray pixel formats. "
-               "Use -pix_fmt to select one.\n");
-        return AVERROR(EIO);
-    }
-
-    *first_pkt = 1;
-    return 0;
-}
-
-AVOutputFormat ff_yuv4mpegpipe_muxer = {
-    .name              = "yuv4mpegpipe",
-    .long_name         = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe"),
-    .mime_type         = "",
-    .extensions        = "y4m",
-    .priv_data_size    = sizeof(int),
-    .audio_codec       = AV_CODEC_ID_NONE,
-    .video_codec       = AV_CODEC_ID_RAWVIDEO,
-    .write_header      = yuv4_write_header,
-    .write_packet      = yuv4_write_packet,
-    .flags             = AVFMT_RAWPICTURE,
-};
-#endif
-
-/* Header size increased to allow room for optional flags */
-#define MAX_YUV4_HEADER 80
-#define MAX_FRAME_HEADER 80
-
-static int yuv4_read_header(AVFormatContext *s)
-{
-    char header[MAX_YUV4_HEADER + 10];  // Include headroom for
-                                        // the longest option
-    char *tokstart, *tokend, *header_end;
-    int i;
-    AVIOContext *pb = s->pb;
-    int width = -1, height  = -1, raten   = 0,
-        rated =  0, aspectn =  0, aspectd = 0;
-    enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE, alt_pix_fmt = AV_PIX_FMT_NONE;
-    enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;
-    AVStream *st;
-    struct frame_attributes *s1 = s->priv_data;
-
-    for (i = 0; i < MAX_YUV4_HEADER; i++) {
-        header[i] = avio_r8(pb);
-        if (header[i] == '\n') {
-            header[i + 1] = 0x20;  // Add a space after last option.
-                                   // Makes parsing "444" vs "444alpha" easier.
-            header[i + 2] = 0;
-            break;
-        }
-    }
-    if (i == MAX_YUV4_HEADER)
-        return -1;
-    if (strncmp(header, Y4M_MAGIC, strlen(Y4M_MAGIC)))
-        return -1;
-
-    s1->interlaced_frame = 0;
-    s1->top_field_first = 0;
-    header_end = &header[i + 1]; // Include space
-    for (tokstart = &header[strlen(Y4M_MAGIC) + 1];
-         tokstart < header_end; tokstart++) {
-        if (*tokstart == 0x20)
-            continue;
-        switch (*tokstart++) {
-        case 'W': // Width. Required.
-            width    = strtol(tokstart, &tokend, 10);
-            tokstart = tokend;
-            break;
-        case 'H': // Height. Required.
-            height   = strtol(tokstart, &tokend, 10);
-            tokstart = tokend;
-            break;
-        case 'C': // Color space
-            if (strncmp("420jpeg", tokstart, 7) == 0) {
-                pix_fmt = AV_PIX_FMT_YUV420P;
-                chroma_sample_location = AVCHROMA_LOC_CENTER;
-            } else if (strncmp("420mpeg2", tokstart, 8) == 0) {
-                pix_fmt = AV_PIX_FMT_YUV420P;
-                chroma_sample_location = AVCHROMA_LOC_LEFT;
-            } else if (strncmp("420paldv", tokstart, 8) == 0) {
-                pix_fmt = AV_PIX_FMT_YUV420P;
-                chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
-            } else if (strncmp("420", tokstart, 3) == 0) {
-                pix_fmt = AV_PIX_FMT_YUV420P;
-                chroma_sample_location = AVCHROMA_LOC_CENTER;
-            } else if (strncmp("411", tokstart, 3) == 0)
-                pix_fmt = AV_PIX_FMT_YUV411P;
-            else if (strncmp("422", tokstart, 3) == 0)
-                pix_fmt = AV_PIX_FMT_YUV422P;
-            else if (strncmp("444alpha", tokstart, 8) == 0 ) {
-                av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 "
-                       "YUV4MPEG stream.\n");
-                return -1;
-            } else if (strncmp("444", tokstart, 3) == 0)
-                pix_fmt = AV_PIX_FMT_YUV444P;
-            else if (strncmp("mono", tokstart, 4) == 0) {
-                pix_fmt = AV_PIX_FMT_GRAY8;
-            } else {
-                av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown "
-                       "pixel format.\n");
-                return -1;
-            }
-            while (tokstart < header_end && *tokstart != 0x20)
-                tokstart++;
-            break;
-        case 'I': // Interlace type
-            switch (*tokstart++){
-            case '?':
-                break;
-            case 'p':
-                s1->interlaced_frame = 0;
-                break;
-            case 't':
-                s1->interlaced_frame = 1;
-                s1->top_field_first = 1;
-                break;
-            case 'b':
-                s1->interlaced_frame = 1;
-                s1->top_field_first = 0;
-                break;
-            case 'm':
-                av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains mixed "
-                       "interlaced and non-interlaced frames.\n");
-                return -1;
-            default:
-                av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n");
-                return -1;
-            }
-            break;
-        case 'F': // Frame rate
-            sscanf(tokstart, "%d:%d", &raten, &rated); // 0:0 if unknown
-            while (tokstart < header_end && *tokstart != 0x20)
-                tokstart++;
-            break;
-        case 'A': // Pixel aspect
-            sscanf(tokstart, "%d:%d", &aspectn, &aspectd); // 0:0 if unknown
-            while (tokstart < header_end && *tokstart != 0x20)
-                tokstart++;
-            break;
-        case 'X': // Vendor extensions
-            if (strncmp("YSCSS=", tokstart, 6) == 0) {
-                // Older nonstandard pixel format representation
-                tokstart += 6;
-                if (strncmp("420JPEG", tokstart, 7) == 0)
-                    alt_pix_fmt = AV_PIX_FMT_YUV420P;
-                else if (strncmp("420MPEG2", tokstart, 8) == 0)
-                    alt_pix_fmt = AV_PIX_FMT_YUV420P;
-                else if (strncmp("420PALDV", tokstart, 8) == 0)
-                    alt_pix_fmt = AV_PIX_FMT_YUV420P;
-                else if (strncmp("411", tokstart, 3) == 0)
-                    alt_pix_fmt = AV_PIX_FMT_YUV411P;
-                else if (strncmp("422", tokstart, 3) == 0)
-                    alt_pix_fmt = AV_PIX_FMT_YUV422P;
-                else if (strncmp("444", tokstart, 3) == 0)
-                    alt_pix_fmt = AV_PIX_FMT_YUV444P;
-            }
-            while (tokstart < header_end && *tokstart != 0x20)
-                tokstart++;
-            break;
-        }
-    }
-
-    if (width == -1 || height == -1) {
-        av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n");
-        return -1;
-    }
-
-    if (pix_fmt == AV_PIX_FMT_NONE) {
-        if (alt_pix_fmt == AV_PIX_FMT_NONE)
-            pix_fmt = AV_PIX_FMT_YUV420P;
-        else
-            pix_fmt = alt_pix_fmt;
-    }
-
-    if (raten <= 0 || rated <= 0) {
-        // Frame rate unknown
-        raten = 25;
-        rated = 1;
-    }
-
-    if (aspectn == 0 && aspectd == 0) {
-        // Pixel aspect unknown
-        aspectd = 1;
-    }
-
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    st->codec->width  = width;
-    st->codec->height = height;
-    av_reduce(&raten, &rated, raten, rated, (1UL << 31) - 1);
-    avpriv_set_pts_info(st, 64, rated, raten);
-    st->avg_frame_rate                = av_inv_q(st->time_base);
-    st->codec->pix_fmt                = pix_fmt;
-    st->codec->codec_type             = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id               = AV_CODEC_ID_RAWVIDEO;
-    st->sample_aspect_ratio           = (AVRational){ aspectn, aspectd };
-    st->codec->chroma_sample_location = chroma_sample_location;
-
-    return 0;
-}
-
-static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    int i;
-    char header[MAX_FRAME_HEADER+1];
-    int packet_size, width, height, ret;
-    AVStream *st = s->streams[0];
-    struct frame_attributes *s1 = s->priv_data;
-
-    for (i = 0; i < MAX_FRAME_HEADER; i++) {
-        header[i] = avio_r8(s->pb);
-        if (header[i] == '\n') {
-            header[i + 1] = 0;
-            break;
-        }
-    }
-    if (s->pb->error)
-        return s->pb->error;
-    else if (s->pb->eof_reached)
-        return AVERROR_EOF;
-    else if (i == MAX_FRAME_HEADER)
-        return AVERROR_INVALIDDATA;
-
-    if (strncmp(header, Y4M_FRAME_MAGIC, strlen(Y4M_FRAME_MAGIC)))
-        return AVERROR_INVALIDDATA;
-
-    width  = st->codec->width;
-    height = st->codec->height;
-
-    packet_size = avpicture_get_size(st->codec->pix_fmt, width, height);
-    if (packet_size < 0)
-        return packet_size;
-
-    ret = av_get_packet(s->pb, pkt, packet_size);
-    if (ret < 0)
-        return ret;
-    else if (ret != packet_size)
-        return s->pb->eof_reached ? AVERROR_EOF : AVERROR(EIO);
-
-    if (st->codec->coded_frame) {
-        st->codec->coded_frame->interlaced_frame = s1->interlaced_frame;
-        st->codec->coded_frame->top_field_first  = s1->top_field_first;
-    }
-
-    pkt->stream_index = 0;
-    return 0;
-}
-
-static int yuv4_probe(AVProbeData *pd)
-{
-    /* check file header */
-    if (strncmp(pd->buf, Y4M_MAGIC, sizeof(Y4M_MAGIC) - 1) == 0)
-        return AVPROBE_SCORE_MAX;
-    else
-        return 0;
-}
-
-#if CONFIG_YUV4MPEGPIPE_DEMUXER
-AVInputFormat ff_yuv4mpegpipe_demuxer = {
-    .name           = "yuv4mpegpipe",
-    .long_name      = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe"),
-    .priv_data_size = sizeof(struct frame_attributes),
-    .read_probe     = yuv4_probe,
-    .read_header    = yuv4_read_header,
-    .read_packet    = yuv4_read_packet,
-    .extensions     = "y4m",
-};
-#endif
diff --git a/deps/libav/libavresample/Makefile b/deps/libav/libavresample/Makefile
deleted file mode 100644
index 6805280..0000000
--- a/deps/libav/libavresample/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-NAME = avresample
-FFLIBS = avutil
-
-HEADERS = avresample.h                                                  \
-          version.h                                                     \
-
-OBJS = audio_convert.o                                                  \
-       audio_data.o                                                     \
-       audio_mix.o                                                      \
-       audio_mix_matrix.o                                               \
-       dither.o                                                         \
-       options.o                                                        \
-       resample.o                                                       \
-       utils.o                                                          \
-
-TESTPROGS = avresample
diff --git a/deps/libav/libavresample/aarch64/Makefile b/deps/libav/libavresample/aarch64/Makefile
deleted file mode 100644
index 13ba193..0000000
--- a/deps/libav/libavresample/aarch64/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-OBJS-$(CONFIG_NEON_CLOBBER_TEST) += aarch64/neontest.o
diff --git a/deps/libav/libavresample/aarch64/neontest.c b/deps/libav/libavresample/aarch64/neontest.c
deleted file mode 100644
index 20e563d..0000000
--- a/deps/libav/libavresample/aarch64/neontest.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * check NEON registers for clobbers
- * Copyright (c) 2013 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavresample/avresample.h"
-#include "libavutil/aarch64/neontest.h"
-
-wrap(avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
-                        int out_plane_size, int out_samples, uint8_t **input,
-                        int in_plane_size, int in_samples))
-{
-    testneonclobbers(avresample_convert, avr, output, out_plane_size,
-                     out_samples, input, in_plane_size, in_samples);
-}
diff --git a/deps/libav/libavresample/arm/Makefile b/deps/libav/libavresample/arm/Makefile
deleted file mode 100644
index 60f3f6d..0000000
--- a/deps/libav/libavresample/arm/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-OBJS      += arm/audio_convert_init.o
-
-OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o
-
-NEON-OBJS += arm/audio_convert_neon.o
diff --git a/deps/libav/libavresample/arm/audio_convert_init.c b/deps/libav/libavresample/arm/audio_convert_init.c
deleted file mode 100644
index bbb7bae..0000000
--- a/deps/libav/libavresample/arm/audio_convert_init.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/arm/cpu.h"
-#include "libavutil/samplefmt.h"
-#include "libavresample/audio_convert.h"
-
-void ff_conv_flt_to_s16_neon(int16_t *dst, const float *src, int len);
-void ff_conv_fltp_to_s16_neon(int16_t *dst, float *const *src,
-                              int len, int channels);
-void ff_conv_fltp_to_s16_2ch_neon(int16_t *dst, float *const *src,
-                                  int len, int channels);
-
-av_cold void ff_audio_convert_init_arm(AudioConvert *ac)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_neon(cpu_flags)) {
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT,
-                                  0, 16, 8, "NEON",
-                                  ff_conv_flt_to_s16_neon);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
-                                  0, 16, 8, "NEON",
-                                  ff_conv_fltp_to_s16_neon);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
-                                  2, 16, 8, "NEON",
-                                  ff_conv_fltp_to_s16_2ch_neon);
-    }
-}
diff --git a/deps/libav/libavresample/arm/audio_convert_neon.S b/deps/libav/libavresample/arm/audio_convert_neon.S
deleted file mode 100644
index 98945c4..0000000
--- a/deps/libav/libavresample/arm/audio_convert_neon.S
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/arm/asm.S"
-
-function ff_conv_flt_to_s16_neon, export=1
-        subs            r2,  r2,  #8
-        vld1.32         {q0},     [r1,:128]!
-        vcvt.s32.f32    q8,  q0,  #31
-        vld1.32         {q1},     [r1,:128]!
-        vcvt.s32.f32    q9,  q1,  #31
-        beq             3f
-        bics            r12, r2,  #15
-        beq             2f
-1:      subs            r12, r12, #16
-        vqrshrn.s32     d4,  q8,  #16
-        vld1.32         {q0},     [r1,:128]!
-        vcvt.s32.f32    q0,  q0,  #31
-        vqrshrn.s32     d5,  q9,  #16
-        vld1.32         {q1},     [r1,:128]!
-        vcvt.s32.f32    q1,  q1,  #31
-        vqrshrn.s32     d6,  q0,  #16
-        vst1.16         {q2},     [r0,:128]!
-        vqrshrn.s32     d7,  q1,  #16
-        vld1.32         {q8},     [r1,:128]!
-        vcvt.s32.f32    q8,  q8,  #31
-        vld1.32         {q9},     [r1,:128]!
-        vcvt.s32.f32    q9,  q9,  #31
-        vst1.16         {q3},     [r0,:128]!
-        bne             1b
-        ands            r2,  r2,  #15
-        beq             3f
-2:      vld1.32         {q0},     [r1,:128]!
-        vqrshrn.s32     d4,  q8,  #16
-        vcvt.s32.f32    q0,  q0,  #31
-        vld1.32         {q1},     [r1,:128]!
-        vqrshrn.s32     d5,  q9,  #16
-        vcvt.s32.f32    q1,  q1,  #31
-        vqrshrn.s32     d6,  q0,  #16
-        vst1.16         {q2},     [r0,:128]!
-        vqrshrn.s32     d7,  q1,  #16
-        vst1.16         {q3},     [r0,:128]!
-        bx              lr
-3:      vqrshrn.s32     d4,  q8,  #16
-        vqrshrn.s32     d5,  q9,  #16
-        vst1.16         {q2},     [r0,:128]!
-        bx              lr
-endfunc
-
-function ff_conv_fltp_to_s16_2ch_neon, export=1
-        ldm             r1,  {r1, r3}
-        subs            r2,  r2,  #8
-        vld1.32         {q0},     [r1,:128]!
-        vcvt.s32.f32    q8,  q0,  #31
-        vld1.32         {q1},     [r1,:128]!
-        vcvt.s32.f32    q9,  q1,  #31
-        vld1.32         {q10},    [r3,:128]!
-        vcvt.s32.f32    q10, q10, #31
-        vld1.32         {q11},    [r3,:128]!
-        vcvt.s32.f32    q11, q11, #31
-        beq             3f
-        bics            r12, r2,  #15
-        beq             2f
-1:      subs            r12, r12, #16
-        vld1.32         {q0},     [r1,:128]!
-        vcvt.s32.f32    q0,  q0,  #31
-        vsri.32         q10, q8,  #16
-        vld1.32         {q1},     [r1,:128]!
-        vcvt.s32.f32    q1,  q1,  #31
-        vld1.32         {q12},    [r3,:128]!
-        vcvt.s32.f32    q12, q12, #31
-        vld1.32         {q13},    [r3,:128]!
-        vsri.32         q11, q9,  #16
-        vst1.16         {q10},    [r0,:128]!
-        vcvt.s32.f32    q13, q13, #31
-        vst1.16         {q11},    [r0,:128]!
-        vsri.32         q12, q0,  #16
-        vld1.32         {q8},     [r1,:128]!
-        vsri.32         q13, q1,  #16
-        vst1.16         {q12},    [r0,:128]!
-        vcvt.s32.f32    q8,  q8,  #31
-        vld1.32         {q9},     [r1,:128]!
-        vcvt.s32.f32    q9,  q9,  #31
-        vld1.32         {q10},    [r3,:128]!
-        vcvt.s32.f32    q10, q10, #31
-        vld1.32         {q11},    [r3,:128]!
-        vcvt.s32.f32    q11, q11, #31
-        vst1.16         {q13},    [r0,:128]!
-        bne             1b
-        ands            r2,  r2,  #15
-        beq             3f
-2:      vsri.32         q10, q8,  #16
-        vld1.32         {q0},     [r1,:128]!
-        vcvt.s32.f32    q0,  q0,  #31
-        vld1.32         {q1},     [r1,:128]!
-        vcvt.s32.f32    q1,  q1,  #31
-        vld1.32         {q12},    [r3,:128]!
-        vcvt.s32.f32    q12, q12, #31
-        vsri.32         q11, q9,  #16
-        vld1.32         {q13},    [r3,:128]!
-        vcvt.s32.f32    q13, q13, #31
-        vst1.16         {q10},    [r0,:128]!
-        vsri.32         q12, q0,  #16
-        vst1.16         {q11},    [r0,:128]!
-        vsri.32         q13, q1,  #16
-        vst1.16         {q12-q13},[r0,:128]!
-        bx              lr
-3:      vsri.32         q10, q8,  #16
-        vsri.32         q11, q9,  #16
-        vst1.16         {q10-q11},[r0,:128]!
-        bx              lr
-endfunc
-
-function ff_conv_fltp_to_s16_neon, export=1
-        cmp             r3,  #2
-        itt             lt
-        ldrlt           r1,  [r1]
-        blt             X(ff_conv_flt_to_s16_neon)
-        beq             X(ff_conv_fltp_to_s16_2ch_neon)
-
-        push            {r4-r8, lr}
-        cmp             r3,  #4
-        lsl             r12, r3,  #1
-        blt             4f
-
-        @ 4 channels
-5:      ldm             r1!, {r4-r7}
-        mov             lr,  r2
-        mov             r8,  r0
-        vld1.32         {q8},     [r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #31
-        vld1.32         {q9},     [r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #31
-        vld1.32         {q10},    [r6,:128]!
-        vcvt.s32.f32    q10, q10, #31
-        vld1.32         {q11},    [r7,:128]!
-        vcvt.s32.f32    q11, q11, #31
-6:      subs            lr,  lr,  #8
-        vld1.32         {q0},     [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #31
-        vsri.32         q9,  q8,  #16
-        vld1.32         {q1},     [r5,:128]!
-        vcvt.s32.f32    q1,  q1,  #31
-        vsri.32         q11, q10, #16
-        vld1.32         {q2},     [r6,:128]!
-        vcvt.s32.f32    q2,  q2,  #31
-        vzip.32         d18, d22
-        vld1.32         {q3},     [r7,:128]!
-        vcvt.s32.f32    q3,  q3,  #31
-        vzip.32         d19, d23
-        vst1.16         {d18},    [r8], r12
-        vsri.32         q1,  q0,  #16
-        vst1.16         {d22},    [r8], r12
-        vsri.32         q3,  q2,  #16
-        vst1.16         {d19},    [r8], r12
-        vzip.32         d2,  d6
-        vst1.16         {d23},    [r8], r12
-        vzip.32         d3,  d7
-        beq             7f
-        vld1.32         {q8},     [r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #31
-        vst1.16         {d2},     [r8], r12
-        vld1.32         {q9},     [r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #31
-        vst1.16         {d6},     [r8], r12
-        vld1.32         {q10},    [r6,:128]!
-        vcvt.s32.f32    q10, q10, #31
-        vst1.16         {d3},     [r8], r12
-        vld1.32         {q11},    [r7,:128]!
-        vcvt.s32.f32    q11, q11, #31
-        vst1.16         {d7},     [r8], r12
-        b               6b
-7:      vst1.16         {d2},     [r8], r12
-        vst1.16         {d6},     [r8], r12
-        vst1.16         {d3},     [r8], r12
-        vst1.16         {d7},     [r8], r12
-        subs            r3,  r3,  #4
-        it              eq
-        popeq           {r4-r8, pc}
-        cmp             r3,  #4
-        add             r0,  r0,  #8
-        bge             5b
-
-        @ 2 channels
-4:      cmp             r3,  #2
-        blt             4f
-        ldm             r1!, {r4-r5}
-        mov             lr,  r2
-        mov             r8,  r0
-        tst             lr,  #8
-        vld1.32         {q8},     [r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #31
-        vld1.32         {q9},     [r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #31
-        vld1.32         {q10},    [r4,:128]!
-        vcvt.s32.f32    q10, q10, #31
-        vld1.32         {q11},    [r5,:128]!
-        vcvt.s32.f32    q11, q11, #31
-        beq             6f
-        subs            lr,  lr,  #8
-        beq             7f
-        vsri.32         d18, d16, #16
-        vsri.32         d19, d17, #16
-        vld1.32         {q8},     [r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #31
-        vst1.32         {d18[0]}, [r8], r12
-        vsri.32         d22, d20, #16
-        vst1.32         {d18[1]}, [r8], r12
-        vsri.32         d23, d21, #16
-        vst1.32         {d19[0]}, [r8], r12
-        vst1.32         {d19[1]}, [r8], r12
-        vld1.32         {q9},     [r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #31
-        vst1.32         {d22[0]}, [r8], r12
-        vst1.32         {d22[1]}, [r8], r12
-        vld1.32         {q10},    [r4,:128]!
-        vcvt.s32.f32    q10, q10, #31
-        vst1.32         {d23[0]}, [r8], r12
-        vst1.32         {d23[1]}, [r8], r12
-        vld1.32         {q11},    [r5,:128]!
-        vcvt.s32.f32    q11, q11, #31
-6:      subs            lr,  lr,  #16
-        vld1.32         {q0},     [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #31
-        vsri.32         d18, d16, #16
-        vld1.32         {q1},     [r5,:128]!
-        vcvt.s32.f32    q1,  q1,  #31
-        vsri.32         d19, d17, #16
-        vld1.32         {q2},     [r4,:128]!
-        vcvt.s32.f32    q2,  q2,  #31
-        vld1.32         {q3},     [r5,:128]!
-        vcvt.s32.f32    q3,  q3,  #31
-        vst1.32         {d18[0]}, [r8], r12
-        vsri.32         d22, d20, #16
-        vst1.32         {d18[1]}, [r8], r12
-        vsri.32         d23, d21, #16
-        vst1.32         {d19[0]}, [r8], r12
-        vsri.32         d2,  d0,  #16
-        vst1.32         {d19[1]}, [r8], r12
-        vsri.32         d3,  d1,  #16
-        vst1.32         {d22[0]}, [r8], r12
-        vsri.32         d6,  d4,  #16
-        vst1.32         {d22[1]}, [r8], r12
-        vsri.32         d7,  d5,  #16
-        vst1.32         {d23[0]}, [r8], r12
-        vst1.32         {d23[1]}, [r8], r12
-        beq             6f
-        vld1.32         {q8},     [r4,:128]!
-        vcvt.s32.f32    q8,  q8,  #31
-        vst1.32         {d2[0]},  [r8], r12
-        vst1.32         {d2[1]},  [r8], r12
-        vld1.32         {q9},     [r5,:128]!
-        vcvt.s32.f32    q9,  q9,  #31
-        vst1.32         {d3[0]},  [r8], r12
-        vst1.32         {d3[1]},  [r8], r12
-        vld1.32         {q10},    [r4,:128]!
-        vcvt.s32.f32    q10, q10, #31
-        vst1.32         {d6[0]},  [r8], r12
-        vst1.32         {d6[1]},  [r8], r12
-        vld1.32         {q11},    [r5,:128]!
-        vcvt.s32.f32    q11, q11, #31
-        vst1.32         {d7[0]},  [r8], r12
-        vst1.32         {d7[1]},  [r8], r12
-        bgt             6b
-6:      vst1.32         {d2[0]},  [r8], r12
-        vst1.32         {d2[1]},  [r8], r12
-        vst1.32         {d3[0]},  [r8], r12
-        vst1.32         {d3[1]},  [r8], r12
-        vst1.32         {d6[0]},  [r8], r12
-        vst1.32         {d6[1]},  [r8], r12
-        vst1.32         {d7[0]},  [r8], r12
-        vst1.32         {d7[1]},  [r8], r12
-        b               8f
-7:      vsri.32         d18, d16, #16
-        vsri.32         d19, d17, #16
-        vst1.32         {d18[0]}, [r8], r12
-        vsri.32         d22, d20, #16
-        vst1.32         {d18[1]}, [r8], r12
-        vsri.32         d23, d21, #16
-        vst1.32         {d19[0]}, [r8], r12
-        vst1.32         {d19[1]}, [r8], r12
-        vst1.32         {d22[0]}, [r8], r12
-        vst1.32         {d22[1]}, [r8], r12
-        vst1.32         {d23[0]}, [r8], r12
-        vst1.32         {d23[1]}, [r8], r12
-8:      subs            r3,  r3,  #2
-        add             r0,  r0,  #4
-        it              eq
-        popeq           {r4-r8, pc}
-
-        @ 1 channel
-4:      ldr             r4,  [r1]
-        tst             r2,  #8
-        mov             lr,  r2
-        mov             r5,  r0
-        vld1.32         {q0},     [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #31
-        vld1.32         {q1},     [r4,:128]!
-        vcvt.s32.f32    q1,  q1,  #31
-        bne             8f
-6:      subs            lr,  lr,  #16
-        vld1.32         {q2},     [r4,:128]!
-        vcvt.s32.f32    q2,  q2,  #31
-        vld1.32         {q3},     [r4,:128]!
-        vcvt.s32.f32    q3,  q3,  #31
-        vst1.16         {d0[1]},  [r5,:16], r12
-        vst1.16         {d0[3]},  [r5,:16], r12
-        vst1.16         {d1[1]},  [r5,:16], r12
-        vst1.16         {d1[3]},  [r5,:16], r12
-        vst1.16         {d2[1]},  [r5,:16], r12
-        vst1.16         {d2[3]},  [r5,:16], r12
-        vst1.16         {d3[1]},  [r5,:16], r12
-        vst1.16         {d3[3]},  [r5,:16], r12
-        beq             7f
-        vld1.32         {q0},     [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #31
-        vld1.32         {q1},     [r4,:128]!
-        vcvt.s32.f32    q1,  q1,  #31
-7:      vst1.16         {d4[1]},  [r5,:16], r12
-        vst1.16         {d4[3]},  [r5,:16], r12
-        vst1.16         {d5[1]},  [r5,:16], r12
-        vst1.16         {d5[3]},  [r5,:16], r12
-        vst1.16         {d6[1]},  [r5,:16], r12
-        vst1.16         {d6[3]},  [r5,:16], r12
-        vst1.16         {d7[1]},  [r5,:16], r12
-        vst1.16         {d7[3]},  [r5,:16], r12
-        bgt             6b
-        pop             {r4-r8, pc}
-8:      subs            lr,  lr,  #8
-        vst1.16         {d0[1]},  [r5,:16], r12
-        vst1.16         {d0[3]},  [r5,:16], r12
-        vst1.16         {d1[1]},  [r5,:16], r12
-        vst1.16         {d1[3]},  [r5,:16], r12
-        vst1.16         {d2[1]},  [r5,:16], r12
-        vst1.16         {d2[3]},  [r5,:16], r12
-        vst1.16         {d3[1]},  [r5,:16], r12
-        vst1.16         {d3[3]},  [r5,:16], r12
-        it              eq
-        popeq           {r4-r8, pc}
-        vld1.32         {q0},     [r4,:128]!
-        vcvt.s32.f32    q0,  q0,  #31
-        vld1.32         {q1},     [r4,:128]!
-        vcvt.s32.f32    q1,  q1,  #31
-        b               6b
-endfunc
diff --git a/deps/libav/libavresample/arm/neontest.c b/deps/libav/libavresample/arm/neontest.c
deleted file mode 100644
index d96d4d2..0000000
--- a/deps/libav/libavresample/arm/neontest.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * check NEON registers for clobbers
- * Copyright (c) 2013 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavresample/avresample.h"
-#include "libavutil/arm/neontest.h"
-
-wrap(avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
-                        int out_plane_size, int out_samples, uint8_t **input,
-                        int in_plane_size, int in_samples))
-{
-    testneonclobbers(avresample_convert, avr, output, out_plane_size,
-                     out_samples, input, in_plane_size, in_samples);
-}
diff --git a/deps/libav/libavresample/audio_convert.c b/deps/libav/libavresample/audio_convert.c
deleted file mode 100644
index 371617c..0000000
--- a/deps/libav/libavresample/audio_convert.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/common.h"
-#include "libavutil/libm.h"
-#include "libavutil/log.h"
-#include "libavutil/mem.h"
-#include "libavutil/samplefmt.h"
-#include "audio_convert.h"
-#include "audio_data.h"
-#include "dither.h"
-
-enum ConvFuncType {
-    CONV_FUNC_TYPE_FLAT,
-    CONV_FUNC_TYPE_INTERLEAVE,
-    CONV_FUNC_TYPE_DEINTERLEAVE,
-};
-
-typedef void (conv_func_flat)(uint8_t *out, const uint8_t *in, int len);
-
-typedef void (conv_func_interleave)(uint8_t *out, uint8_t *const *in,
-                                    int len, int channels);
-
-typedef void (conv_func_deinterleave)(uint8_t **out, const uint8_t *in, int len,
-                                      int channels);
-
-struct AudioConvert {
-    AVAudioResampleContext *avr;
-    DitherContext *dc;
-    enum AVSampleFormat in_fmt;
-    enum AVSampleFormat out_fmt;
-    int apply_map;
-    int channels;
-    int planes;
-    int ptr_align;
-    int samples_align;
-    int has_optimized_func;
-    const char *func_descr;
-    const char *func_descr_generic;
-    enum ConvFuncType func_type;
-    conv_func_flat         *conv_flat;
-    conv_func_flat         *conv_flat_generic;
-    conv_func_interleave   *conv_interleave;
-    conv_func_interleave   *conv_interleave_generic;
-    conv_func_deinterleave *conv_deinterleave;
-    conv_func_deinterleave *conv_deinterleave_generic;
-};
-
-void ff_audio_convert_set_func(AudioConvert *ac, enum AVSampleFormat out_fmt,
-                               enum AVSampleFormat in_fmt, int channels,
-                               int ptr_align, int samples_align,
-                               const char *descr, void *conv)
-{
-    int found = 0;
-
-    switch (ac->func_type) {
-    case CONV_FUNC_TYPE_FLAT:
-        if (av_get_packed_sample_fmt(ac->in_fmt)  == in_fmt &&
-            av_get_packed_sample_fmt(ac->out_fmt) == out_fmt) {
-            ac->conv_flat     = conv;
-            ac->func_descr    = descr;
-            ac->ptr_align     = ptr_align;
-            ac->samples_align = samples_align;
-            if (ptr_align == 1 && samples_align == 1) {
-                ac->conv_flat_generic  = conv;
-                ac->func_descr_generic = descr;
-            } else {
-                ac->has_optimized_func = 1;
-            }
-            found = 1;
-        }
-        break;
-    case CONV_FUNC_TYPE_INTERLEAVE:
-        if (ac->in_fmt == in_fmt && ac->out_fmt == out_fmt &&
-            (!channels || ac->channels == channels)) {
-            ac->conv_interleave = conv;
-            ac->func_descr      = descr;
-            ac->ptr_align       = ptr_align;
-            ac->samples_align   = samples_align;
-            if (ptr_align == 1 && samples_align == 1) {
-                ac->conv_interleave_generic = conv;
-                ac->func_descr_generic      = descr;
-            } else {
-                ac->has_optimized_func = 1;
-            }
-            found = 1;
-        }
-        break;
-    case CONV_FUNC_TYPE_DEINTERLEAVE:
-        if (ac->in_fmt == in_fmt && ac->out_fmt == out_fmt &&
-            (!channels || ac->channels == channels)) {
-            ac->conv_deinterleave = conv;
-            ac->func_descr        = descr;
-            ac->ptr_align         = ptr_align;
-            ac->samples_align     = samples_align;
-            if (ptr_align == 1 && samples_align == 1) {
-                ac->conv_deinterleave_generic = conv;
-                ac->func_descr_generic        = descr;
-            } else {
-                ac->has_optimized_func = 1;
-            }
-            found = 1;
-        }
-        break;
-    }
-    if (found) {
-        av_log(ac->avr, AV_LOG_DEBUG, "audio_convert: found function: %-4s "
-               "to %-4s (%s)\n", av_get_sample_fmt_name(ac->in_fmt),
-               av_get_sample_fmt_name(ac->out_fmt), descr);
-    }
-}
-
-#define CONV_FUNC_NAME(dst_fmt, src_fmt) conv_ ## src_fmt ## _to_ ## dst_fmt
-
-#define CONV_LOOP(otype, expr)                                              \
-    do {                                                                    \
-        *(otype *)po = expr;                                                \
-        pi += is;                                                           \
-        po += os;                                                           \
-    } while (po < end);                                                     \
-
-#define CONV_FUNC_FLAT(ofmt, otype, ifmt, itype, expr)                      \
-static void CONV_FUNC_NAME(ofmt, ifmt)(uint8_t *out, const uint8_t *in,     \
-                                       int len)                             \
-{                                                                           \
-    int is       = sizeof(itype);                                           \
-    int os       = sizeof(otype);                                           \
-    const uint8_t *pi = in;                                                 \
-    uint8_t       *po = out;                                                \
-    uint8_t *end = out + os * len;                                          \
-    CONV_LOOP(otype, expr)                                                  \
-}
-
-#define CONV_FUNC_INTERLEAVE(ofmt, otype, ifmt, itype, expr)                \
-static void CONV_FUNC_NAME(ofmt, ifmt)(uint8_t *out, const uint8_t **in,    \
-                                       int len, int channels)               \
-{                                                                           \
-    int ch;                                                                 \
-    int out_bps = sizeof(otype);                                            \
-    int is      = sizeof(itype);                                            \
-    int os      = channels * out_bps;                                       \
-    for (ch = 0; ch < channels; ch++) {                                     \
-        const uint8_t *pi = in[ch];                                         \
-        uint8_t       *po = out + ch * out_bps;                             \
-        uint8_t      *end = po + os * len;                                  \
-        CONV_LOOP(otype, expr)                                              \
-    }                                                                       \
-}
-
-#define CONV_FUNC_DEINTERLEAVE(ofmt, otype, ifmt, itype, expr)              \
-static void CONV_FUNC_NAME(ofmt, ifmt)(uint8_t **out, const uint8_t *in,    \
-                                       int len, int channels)               \
-{                                                                           \
-    int ch;                                                                 \
-    int in_bps = sizeof(itype);                                             \
-    int is     = channels * in_bps;                                         \
-    int os     = sizeof(otype);                                             \
-    for (ch = 0; ch < channels; ch++) {                                     \
-        const uint8_t *pi = in  + ch * in_bps;                              \
-        uint8_t       *po = out[ch];                                        \
-        uint8_t      *end = po + os * len;                                  \
-        CONV_LOOP(otype, expr)                                              \
-    }                                                                       \
-}
-
-#define CONV_FUNC_GROUP(ofmt, otype, ifmt, itype, expr) \
-CONV_FUNC_FLAT(        ofmt,      otype, ifmt,      itype, expr) \
-CONV_FUNC_INTERLEAVE(  ofmt,      otype, ifmt ## P, itype, expr) \
-CONV_FUNC_DEINTERLEAVE(ofmt ## P, otype, ifmt,      itype, expr)
-
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  uint8_t, AV_SAMPLE_FMT_U8,  uint8_t,  *(const uint8_t *)pi)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_U8,  uint8_t, (*(const uint8_t *)pi - 0x80) <<  8)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_U8,  uint8_t, (*(const uint8_t *)pi - 0x80) << 24)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float,   AV_SAMPLE_FMT_U8,  uint8_t, (*(const uint8_t *)pi - 0x80) * (1.0f / (1 << 7)))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double,  AV_SAMPLE_FMT_U8,  uint8_t, (*(const uint8_t *)pi - 0x80) * (1.0  / (1 << 7)))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  uint8_t, AV_SAMPLE_FMT_S16, int16_t, (*(const int16_t *)pi >> 8) + 0x80)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_S16, int16_t,  *(const int16_t *)pi)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_S16, int16_t,  *(const int16_t *)pi << 16)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float,   AV_SAMPLE_FMT_S16, int16_t,  *(const int16_t *)pi * (1.0f / (1 << 15)))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double,  AV_SAMPLE_FMT_S16, int16_t,  *(const int16_t *)pi * (1.0  / (1 << 15)))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  uint8_t, AV_SAMPLE_FMT_S32, int32_t, (*(const int32_t *)pi >> 24) + 0x80)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_S32, int32_t,  *(const int32_t *)pi >> 16)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_S32, int32_t,  *(const int32_t *)pi)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float,   AV_SAMPLE_FMT_S32, int32_t,  *(const int32_t *)pi * (1.0f / (1U << 31)))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double,  AV_SAMPLE_FMT_S32, int32_t,  *(const int32_t *)pi * (1.0  / (1U << 31)))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  uint8_t, AV_SAMPLE_FMT_FLT, float,   av_clip_uint8(  lrintf(*(const float *)pi * (1  <<  7)) + 0x80))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float,   av_clip_int16(  lrintf(*(const float *)pi * (1  << 15))))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float,   av_clipl_int32(llrintf(*(const float *)pi * (1U << 31))))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float,   AV_SAMPLE_FMT_FLT, float,   *(const float *)pi)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double,  AV_SAMPLE_FMT_FLT, float,   *(const float *)pi)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  uint8_t, AV_SAMPLE_FMT_DBL, double,  av_clip_uint8(  lrint(*(const double *)pi * (1  <<  7)) + 0x80))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double,  av_clip_int16(  lrint(*(const double *)pi * (1  << 15))))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double,  av_clipl_int32(llrint(*(const double *)pi * (1U << 31))))
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float,   AV_SAMPLE_FMT_DBL, double,  *(const double *)pi)
-CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double,  AV_SAMPLE_FMT_DBL, double,  *(const double *)pi)
-
-#define SET_CONV_FUNC_GROUP(ofmt, ifmt)                                                             \
-ff_audio_convert_set_func(ac, ofmt,      ifmt,      0, 1, 1, "C", CONV_FUNC_NAME(ofmt,      ifmt)); \
-ff_audio_convert_set_func(ac, ofmt ## P, ifmt,      0, 1, 1, "C", CONV_FUNC_NAME(ofmt ## P, ifmt)); \
-ff_audio_convert_set_func(ac, ofmt,      ifmt ## P, 0, 1, 1, "C", CONV_FUNC_NAME(ofmt,      ifmt ## P));
-
-static void set_generic_function(AudioConvert *ac)
-{
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  AV_SAMPLE_FMT_U8)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_U8)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_U8)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_U8)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_U8)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  AV_SAMPLE_FMT_S16)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S16)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  AV_SAMPLE_FMT_S32)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S32)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  AV_SAMPLE_FMT_FLT)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLT)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_FLT)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8,  AV_SAMPLE_FMT_DBL)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_DBL)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_DBL)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL)
-    SET_CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBL)
-}
-
-void ff_audio_convert_free(AudioConvert **ac)
-{
-    if (!*ac)
-        return;
-    ff_dither_free(&(*ac)->dc);
-    av_freep(ac);
-}
-
-AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr,
-                                     enum AVSampleFormat out_fmt,
-                                     enum AVSampleFormat in_fmt,
-                                     int channels, int sample_rate,
-                                     int apply_map)
-{
-    AudioConvert *ac;
-    int in_planar, out_planar;
-
-    ac = av_mallocz(sizeof(*ac));
-    if (!ac)
-        return NULL;
-
-    ac->avr      = avr;
-    ac->out_fmt  = out_fmt;
-    ac->in_fmt   = in_fmt;
-    ac->channels = channels;
-    ac->apply_map = apply_map;
-
-    if (avr->dither_method != AV_RESAMPLE_DITHER_NONE          &&
-        av_get_packed_sample_fmt(out_fmt) == AV_SAMPLE_FMT_S16 &&
-        av_get_bytes_per_sample(in_fmt) > 2) {
-        ac->dc = ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate,
-                                 apply_map);
-        if (!ac->dc) {
-            av_free(ac);
-            return NULL;
-        }
-        return ac;
-    }
-
-    in_planar  = av_sample_fmt_is_planar(in_fmt);
-    out_planar = av_sample_fmt_is_planar(out_fmt);
-
-    if (in_planar == out_planar) {
-        ac->func_type = CONV_FUNC_TYPE_FLAT;
-        ac->planes    = in_planar ? ac->channels : 1;
-    } else if (in_planar)
-        ac->func_type = CONV_FUNC_TYPE_INTERLEAVE;
-    else
-        ac->func_type = CONV_FUNC_TYPE_DEINTERLEAVE;
-
-    set_generic_function(ac);
-
-    if (ARCH_ARM)
-        ff_audio_convert_init_arm(ac);
-    if (ARCH_X86)
-        ff_audio_convert_init_x86(ac);
-
-    return ac;
-}
-
-int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in)
-{
-    int use_generic = 1;
-    int len         = in->nb_samples;
-    int p;
-
-    if (ac->dc) {
-        /* dithered conversion */
-        av_dlog(ac->avr, "%d samples - audio_convert: %s to %s (dithered)\n",
-                len, av_get_sample_fmt_name(ac->in_fmt),
-                av_get_sample_fmt_name(ac->out_fmt));
-
-        return ff_convert_dither(ac->dc, out, in);
-    }
-
-    /* determine whether to use the optimized function based on pointer and
-       samples alignment in both the input and output */
-    if (ac->has_optimized_func) {
-        int ptr_align     = FFMIN(in->ptr_align,     out->ptr_align);
-        int samples_align = FFMIN(in->samples_align, out->samples_align);
-        int aligned_len   = FFALIGN(len, ac->samples_align);
-        if (!(ptr_align % ac->ptr_align) && samples_align >= aligned_len) {
-            len = aligned_len;
-            use_generic = 0;
-        }
-    }
-    av_dlog(ac->avr, "%d samples - audio_convert: %s to %s (%s)\n", len,
-            av_get_sample_fmt_name(ac->in_fmt),
-            av_get_sample_fmt_name(ac->out_fmt),
-            use_generic ? ac->func_descr_generic : ac->func_descr);
-
-    if (ac->apply_map) {
-        ChannelMapInfo *map = &ac->avr->ch_map_info;
-
-        if (!av_sample_fmt_is_planar(ac->out_fmt)) {
-            av_log(ac->avr, AV_LOG_ERROR, "cannot remap packed format during conversion\n");
-            return AVERROR(EINVAL);
-        }
-
-        if (map->do_remap) {
-            if (av_sample_fmt_is_planar(ac->in_fmt)) {
-                conv_func_flat *convert = use_generic ? ac->conv_flat_generic :
-                                                        ac->conv_flat;
-
-                for (p = 0; p < ac->planes; p++)
-                    if (map->channel_map[p] >= 0)
-                        convert(out->data[p], in->data[map->channel_map[p]], len);
-            } else {
-                uint8_t *data[AVRESAMPLE_MAX_CHANNELS];
-                conv_func_deinterleave *convert = use_generic ?
-                                                  ac->conv_deinterleave_generic :
-                                                  ac->conv_deinterleave;
-
-                for (p = 0; p < ac->channels; p++)
-                    data[map->input_map[p]] = out->data[p];
-
-                convert(data, in->data[0], len, ac->channels);
-            }
-        }
-        if (map->do_copy || map->do_zero) {
-            for (p = 0; p < ac->planes; p++) {
-                if (map->channel_copy[p])
-                    memcpy(out->data[p], out->data[map->channel_copy[p]],
-                           len * out->stride);
-                else if (map->channel_zero[p])
-                    av_samples_set_silence(&out->data[p], 0, len, 1, ac->out_fmt);
-            }
-        }
-    } else {
-        switch (ac->func_type) {
-        case CONV_FUNC_TYPE_FLAT: {
-            if (!in->is_planar)
-                len *= in->channels;
-            if (use_generic) {
-                for (p = 0; p < ac->planes; p++)
-                    ac->conv_flat_generic(out->data[p], in->data[p], len);
-            } else {
-                for (p = 0; p < ac->planes; p++)
-                    ac->conv_flat(out->data[p], in->data[p], len);
-            }
-            break;
-        }
-        case CONV_FUNC_TYPE_INTERLEAVE:
-            if (use_generic)
-                ac->conv_interleave_generic(out->data[0], in->data, len,
-                                            ac->channels);
-            else
-                ac->conv_interleave(out->data[0], in->data, len, ac->channels);
-            break;
-        case CONV_FUNC_TYPE_DEINTERLEAVE:
-            if (use_generic)
-                ac->conv_deinterleave_generic(out->data, in->data[0], len,
-                                              ac->channels);
-            else
-                ac->conv_deinterleave(out->data, in->data[0], len,
-                                      ac->channels);
-            break;
-        }
-    }
-
-    out->nb_samples = in->nb_samples;
-    return 0;
-}
diff --git a/deps/libav/libavresample/audio_convert.h b/deps/libav/libavresample/audio_convert.h
deleted file mode 100644
index 6a3089d..0000000
--- a/deps/libav/libavresample/audio_convert.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVRESAMPLE_AUDIO_CONVERT_H
-#define AVRESAMPLE_AUDIO_CONVERT_H
-
-#include "libavutil/samplefmt.h"
-#include "avresample.h"
-#include "internal.h"
-#include "audio_data.h"
-
-/**
- * Set conversion function if the parameters match.
- *
- * This compares the parameters of the conversion function to the parameters
- * in the AudioConvert context. If the parameters do not match, no changes are
- * made to the active functions. If the parameters do match and the alignment
- * is not constrained, the function is set as the generic conversion function.
- * If the parameters match and the alignment is constrained, the function is
- * set as the optimized conversion function.
- *
- * @param ac             AudioConvert context
- * @param out_fmt        output sample format
- * @param in_fmt         input sample format
- * @param channels       number of channels, or 0 for any number of channels
- * @param ptr_align      buffer pointer alignment, in bytes
- * @param samples_align  buffer size alignment, in samples
- * @param descr          function type description (e.g. "C" or "SSE")
- * @param conv           conversion function pointer
- */
-void ff_audio_convert_set_func(AudioConvert *ac, enum AVSampleFormat out_fmt,
-                               enum AVSampleFormat in_fmt, int channels,
-                               int ptr_align, int samples_align,
-                               const char *descr, void *conv);
-
-/**
- * Allocate and initialize AudioConvert context for sample format conversion.
- *
- * @param avr         AVAudioResampleContext
- * @param out_fmt     output sample format
- * @param in_fmt      input sample format
- * @param channels    number of channels
- * @param sample_rate sample rate (used for dithering)
- * @param apply_map   apply channel map during conversion
- * @return            newly-allocated AudioConvert context
- */
-AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr,
-                                     enum AVSampleFormat out_fmt,
-                                     enum AVSampleFormat in_fmt,
-                                     int channels, int sample_rate,
-                                     int apply_map);
-
-/**
- * Free AudioConvert.
- *
- * The AudioConvert must have been previously allocated with ff_audio_convert_alloc().
- *
- * @param ac  AudioConvert struct
- */
-void ff_audio_convert_free(AudioConvert **ac);
-
-/**
- * Convert audio data from one sample format to another.
- *
- * For each call, the alignment of the input and output AudioData buffers are
- * examined to determine whether to use the generic or optimized conversion
- * function (when available).
- *
- * The number of samples to convert is determined by in->nb_samples. The output
- * buffer must be large enough to handle this many samples. out->nb_samples is
- * set by this function before a successful return.
- *
- * @param ac     AudioConvert context
- * @param out    output audio data
- * @param in     input audio data
- * @return       0 on success, negative AVERROR code on failure
- */
-int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in);
-
-/* arch-specific initialization functions */
-
-void ff_audio_convert_init_arm(AudioConvert *ac);
-void ff_audio_convert_init_x86(AudioConvert *ac);
-
-#endif /* AVRESAMPLE_AUDIO_CONVERT_H */
diff --git a/deps/libav/libavresample/audio_data.c b/deps/libav/libavresample/audio_data.c
deleted file mode 100644
index c52f518..0000000
--- a/deps/libav/libavresample/audio_data.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include "libavutil/mem.h"
-#include "audio_data.h"
-
-static const AVClass audio_data_class = {
-    .class_name = "AudioData",
-    .item_name  = av_default_item_name,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-/*
- * Calculate alignment for data pointers.
- */
-static void calc_ptr_alignment(AudioData *a)
-{
-    int p;
-    int min_align = 128;
-
-    for (p = 0; p < a->planes; p++) {
-        int cur_align = 128;
-        while ((intptr_t)a->data[p] % cur_align)
-            cur_align >>= 1;
-        if (cur_align < min_align)
-            min_align = cur_align;
-    }
-    a->ptr_align = min_align;
-}
-
-int ff_audio_data_set_channels(AudioData *a, int channels)
-{
-    if (channels < 1 || channels > AVRESAMPLE_MAX_CHANNELS ||
-        channels > a->allocated_channels)
-        return AVERROR(EINVAL);
-
-    a->channels  = channels;
-    a->planes    = a->is_planar ? channels : 1;
-
-    calc_ptr_alignment(a);
-
-    return 0;
-}
-
-int ff_audio_data_init(AudioData *a, uint8_t **src, int plane_size, int channels,
-                       int nb_samples, enum AVSampleFormat sample_fmt,
-                       int read_only, const char *name)
-{
-    int p;
-
-    memset(a, 0, sizeof(*a));
-    a->class = &audio_data_class;
-
-    if (channels < 1 || channels > AVRESAMPLE_MAX_CHANNELS) {
-        av_log(a, AV_LOG_ERROR, "invalid channel count: %d\n", channels);
-        return AVERROR(EINVAL);
-    }
-
-    a->sample_size = av_get_bytes_per_sample(sample_fmt);
-    if (!a->sample_size) {
-        av_log(a, AV_LOG_ERROR, "invalid sample format\n");
-        return AVERROR(EINVAL);
-    }
-    a->is_planar = av_sample_fmt_is_planar(sample_fmt);
-    a->planes    = a->is_planar ? channels : 1;
-    a->stride    = a->sample_size * (a->is_planar ? 1 : channels);
-
-    for (p = 0; p < (a->is_planar ? channels : 1); p++) {
-        if (!src[p]) {
-            av_log(a, AV_LOG_ERROR, "invalid NULL pointer for src[%d]\n", p);
-            return AVERROR(EINVAL);
-        }
-        a->data[p] = src[p];
-    }
-    a->allocated_samples  = nb_samples * !read_only;
-    a->nb_samples         = nb_samples;
-    a->sample_fmt         = sample_fmt;
-    a->channels           = channels;
-    a->allocated_channels = channels;
-    a->read_only          = read_only;
-    a->allow_realloc      = 0;
-    a->name               = name ? name : "{no name}";
-
-    calc_ptr_alignment(a);
-    a->samples_align = plane_size / a->stride;
-
-    return 0;
-}
-
-AudioData *ff_audio_data_alloc(int channels, int nb_samples,
-                               enum AVSampleFormat sample_fmt, const char *name)
-{
-    AudioData *a;
-    int ret;
-
-    if (channels < 1 || channels > AVRESAMPLE_MAX_CHANNELS)
-        return NULL;
-
-    a = av_mallocz(sizeof(*a));
-    if (!a)
-        return NULL;
-
-    a->sample_size = av_get_bytes_per_sample(sample_fmt);
-    if (!a->sample_size) {
-        av_free(a);
-        return NULL;
-    }
-    a->is_planar = av_sample_fmt_is_planar(sample_fmt);
-    a->planes    = a->is_planar ? channels : 1;
-    a->stride    = a->sample_size * (a->is_planar ? 1 : channels);
-
-    a->class              = &audio_data_class;
-    a->sample_fmt         = sample_fmt;
-    a->channels           = channels;
-    a->allocated_channels = channels;
-    a->read_only          = 0;
-    a->allow_realloc      = 1;
-    a->name               = name ? name : "{no name}";
-
-    if (nb_samples > 0) {
-        ret = ff_audio_data_realloc(a, nb_samples);
-        if (ret < 0) {
-            av_free(a);
-            return NULL;
-        }
-        return a;
-    } else {
-        calc_ptr_alignment(a);
-        return a;
-    }
-}
-
-int ff_audio_data_realloc(AudioData *a, int nb_samples)
-{
-    int ret, new_buf_size, plane_size, p;
-
-    /* check if buffer is already large enough */
-    if (a->allocated_samples >= nb_samples)
-        return 0;
-
-    /* validate that the output is not read-only and realloc is allowed */
-    if (a->read_only || !a->allow_realloc)
-        return AVERROR(EINVAL);
-
-    new_buf_size = av_samples_get_buffer_size(&plane_size,
-                                              a->allocated_channels, nb_samples,
-                                              a->sample_fmt, 0);
-    if (new_buf_size < 0)
-        return new_buf_size;
-
-    /* if there is already data in the buffer and the sample format is planar,
-       allocate a new buffer and copy the data, otherwise just realloc the
-       internal buffer and set new data pointers */
-    if (a->nb_samples > 0 && a->is_planar) {
-        uint8_t *new_data[AVRESAMPLE_MAX_CHANNELS] = { NULL };
-
-        ret = av_samples_alloc(new_data, &plane_size, a->allocated_channels,
-                               nb_samples, a->sample_fmt, 0);
-        if (ret < 0)
-            return ret;
-
-        for (p = 0; p < a->planes; p++)
-            memcpy(new_data[p], a->data[p], a->nb_samples * a->stride);
-
-        av_freep(&a->buffer);
-        memcpy(a->data, new_data, sizeof(new_data));
-        a->buffer = a->data[0];
-    } else {
-        av_freep(&a->buffer);
-        a->buffer = av_malloc(new_buf_size);
-        if (!a->buffer)
-            return AVERROR(ENOMEM);
-        ret = av_samples_fill_arrays(a->data, &plane_size, a->buffer,
-                                     a->allocated_channels, nb_samples,
-                                     a->sample_fmt, 0);
-        if (ret < 0)
-            return ret;
-    }
-    a->buffer_size       = new_buf_size;
-    a->allocated_samples = nb_samples;
-
-    calc_ptr_alignment(a);
-    a->samples_align = plane_size / a->stride;
-
-    return 0;
-}
-
-void ff_audio_data_free(AudioData **a)
-{
-    if (!*a)
-        return;
-    av_free((*a)->buffer);
-    av_freep(a);
-}
-
-int ff_audio_data_copy(AudioData *dst, AudioData *src, ChannelMapInfo *map)
-{
-    int ret, p;
-
-    /* validate input/output compatibility */
-    if (dst->sample_fmt != src->sample_fmt || dst->channels < src->channels)
-        return AVERROR(EINVAL);
-
-    if (map && !src->is_planar) {
-        av_log(src, AV_LOG_ERROR, "cannot remap packed format during copy\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* if the input is empty, just empty the output */
-    if (!src->nb_samples) {
-        dst->nb_samples = 0;
-        return 0;
-    }
-
-    /* reallocate output if necessary */
-    ret = ff_audio_data_realloc(dst, src->nb_samples);
-    if (ret < 0)
-        return ret;
-
-    /* copy data */
-    if (map) {
-        if (map->do_remap) {
-            for (p = 0; p < src->planes; p++) {
-                if (map->channel_map[p] >= 0)
-                    memcpy(dst->data[p], src->data[map->channel_map[p]],
-                           src->nb_samples * src->stride);
-            }
-        }
-        if (map->do_copy || map->do_zero) {
-            for (p = 0; p < src->planes; p++) {
-                if (map->channel_copy[p])
-                    memcpy(dst->data[p], dst->data[map->channel_copy[p]],
-                           src->nb_samples * src->stride);
-                else if (map->channel_zero[p])
-                    av_samples_set_silence(&dst->data[p], 0, src->nb_samples,
-                                           1, dst->sample_fmt);
-            }
-        }
-    } else {
-        for (p = 0; p < src->planes; p++)
-            memcpy(dst->data[p], src->data[p], src->nb_samples * src->stride);
-    }
-
-    dst->nb_samples = src->nb_samples;
-
-    return 0;
-}
-
-int ff_audio_data_combine(AudioData *dst, int dst_offset, AudioData *src,
-                          int src_offset, int nb_samples)
-{
-    int ret, p, dst_offset2, dst_move_size;
-
-    /* validate input/output compatibility */
-    if (dst->sample_fmt != src->sample_fmt || dst->channels != src->channels) {
-        av_log(src, AV_LOG_ERROR, "sample format mismatch\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* validate offsets are within the buffer bounds */
-    if (dst_offset < 0 || dst_offset > dst->nb_samples ||
-        src_offset < 0 || src_offset > src->nb_samples) {
-        av_log(src, AV_LOG_ERROR, "offset out-of-bounds: src=%d dst=%d\n",
-               src_offset, dst_offset);
-        return AVERROR(EINVAL);
-    }
-
-    /* check offsets and sizes to see if we can just do nothing and return */
-    if (nb_samples > src->nb_samples - src_offset)
-        nb_samples = src->nb_samples - src_offset;
-    if (nb_samples <= 0)
-        return 0;
-
-    /* validate that the output is not read-only */
-    if (dst->read_only) {
-        av_log(dst, AV_LOG_ERROR, "dst is read-only\n");
-        return AVERROR(EINVAL);
-    }
-
-    /* reallocate output if necessary */
-    ret = ff_audio_data_realloc(dst, dst->nb_samples + nb_samples);
-    if (ret < 0) {
-        av_log(dst, AV_LOG_ERROR, "error reallocating dst\n");
-        return ret;
-    }
-
-    dst_offset2   = dst_offset + nb_samples;
-    dst_move_size = dst->nb_samples - dst_offset;
-
-    for (p = 0; p < src->planes; p++) {
-        if (dst_move_size > 0) {
-            memmove(dst->data[p] + dst_offset2 * dst->stride,
-                    dst->data[p] + dst_offset  * dst->stride,
-                    dst_move_size * dst->stride);
-        }
-        memcpy(dst->data[p] + dst_offset * dst->stride,
-               src->data[p] + src_offset * src->stride,
-               nb_samples * src->stride);
-    }
-    dst->nb_samples += nb_samples;
-
-    return 0;
-}
-
-void ff_audio_data_drain(AudioData *a, int nb_samples)
-{
-    if (a->nb_samples <= nb_samples) {
-        /* drain the whole buffer */
-        a->nb_samples = 0;
-    } else {
-        int p;
-        int move_offset = a->stride * nb_samples;
-        int move_size   = a->stride * (a->nb_samples - nb_samples);
-
-        for (p = 0; p < a->planes; p++)
-            memmove(a->data[p], a->data[p] + move_offset, move_size);
-
-        a->nb_samples -= nb_samples;
-    }
-}
-
-int ff_audio_data_add_to_fifo(AVAudioFifo *af, AudioData *a, int offset,
-                              int nb_samples)
-{
-    uint8_t *offset_data[AVRESAMPLE_MAX_CHANNELS];
-    int offset_size, p;
-
-    if (offset >= a->nb_samples)
-        return 0;
-    offset_size = offset * a->stride;
-    for (p = 0; p < a->planes; p++)
-        offset_data[p] = a->data[p] + offset_size;
-
-    return av_audio_fifo_write(af, (void **)offset_data, nb_samples);
-}
-
-int ff_audio_data_read_from_fifo(AVAudioFifo *af, AudioData *a, int nb_samples)
-{
-    int ret;
-
-    if (a->read_only)
-        return AVERROR(EINVAL);
-
-    ret = ff_audio_data_realloc(a, nb_samples);
-    if (ret < 0)
-        return ret;
-
-    ret = av_audio_fifo_read(af, (void **)a->data, nb_samples);
-    if (ret >= 0)
-        a->nb_samples = ret;
-    return ret;
-}
diff --git a/deps/libav/libavresample/audio_data.h b/deps/libav/libavresample/audio_data.h
deleted file mode 100644
index 97236bb..0000000
--- a/deps/libav/libavresample/audio_data.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVRESAMPLE_AUDIO_DATA_H
-#define AVRESAMPLE_AUDIO_DATA_H
-
-#include <stdint.h>
-
-#include "libavutil/audio_fifo.h"
-#include "libavutil/log.h"
-#include "libavutil/samplefmt.h"
-#include "avresample.h"
-#include "internal.h"
-
-/**
- * Audio buffer used for intermediate storage between conversion phases.
- */
-struct AudioData {
-    const AVClass *class;               /**< AVClass for logging            */
-    uint8_t *data[AVRESAMPLE_MAX_CHANNELS]; /**< data plane pointers        */
-    uint8_t *buffer;                    /**< data buffer                    */
-    unsigned int buffer_size;           /**< allocated buffer size          */
-    int allocated_samples;              /**< number of samples the buffer can hold */
-    int nb_samples;                     /**< current number of samples      */
-    enum AVSampleFormat sample_fmt;     /**< sample format                  */
-    int channels;                       /**< channel count                  */
-    int allocated_channels;             /**< allocated channel count        */
-    int is_planar;                      /**< sample format is planar        */
-    int planes;                         /**< number of data planes          */
-    int sample_size;                    /**< bytes per sample               */
-    int stride;                         /**< sample byte offset within a plane */
-    int read_only;                      /**< data is read-only              */
-    int allow_realloc;                  /**< realloc is allowed             */
-    int ptr_align;                      /**< minimum data pointer alignment */
-    int samples_align;                  /**< allocated samples alignment    */
-    const char *name;                   /**< name for debug logging         */
-};
-
-int ff_audio_data_set_channels(AudioData *a, int channels);
-
-/**
- * Initialize AudioData using a given source.
- *
- * This does not allocate an internal buffer. It only sets the data pointers
- * and audio parameters.
- *
- * @param a               AudioData struct
- * @param src             source data pointers
- * @param plane_size      plane size, in bytes.
- *                        This can be 0 if unknown, but that will lead to
- *                        optimized functions not being used in many cases,
- *                        which could slow down some conversions.
- * @param channels        channel count
- * @param nb_samples      number of samples in the source data
- * @param sample_fmt      sample format
- * @param read_only       indicates if buffer is read only or read/write
- * @param name            name for debug logging (can be NULL)
- * @return                0 on success, negative AVERROR value on error
- */
-int ff_audio_data_init(AudioData *a, uint8_t **src, int plane_size, int channels,
-                       int nb_samples, enum AVSampleFormat sample_fmt,
-                       int read_only, const char *name);
-
-/**
- * Allocate AudioData.
- *
- * This allocates an internal buffer and sets audio parameters.
- *
- * @param channels        channel count
- * @param nb_samples      number of samples to allocate space for
- * @param sample_fmt      sample format
- * @param name            name for debug logging (can be NULL)
- * @return                newly allocated AudioData struct, or NULL on error
- */
-AudioData *ff_audio_data_alloc(int channels, int nb_samples,
-                               enum AVSampleFormat sample_fmt,
-                               const char *name);
-
-/**
- * Reallocate AudioData.
- *
- * The AudioData must have been previously allocated with ff_audio_data_alloc().
- *
- * @param a           AudioData struct
- * @param nb_samples  number of samples to allocate space for
- * @return            0 on success, negative AVERROR value on error
- */
-int ff_audio_data_realloc(AudioData *a, int nb_samples);
-
-/**
- * Free AudioData.
- *
- * The AudioData must have been previously allocated with ff_audio_data_alloc().
- *
- * @param a  AudioData struct
- */
-void ff_audio_data_free(AudioData **a);
-
-/**
- * Copy data from one AudioData to another.
- *
- * @param out  output AudioData
- * @param in   input AudioData
- * @param map  channel map, NULL if not remapping
- * @return     0 on success, negative AVERROR value on error
- */
-int ff_audio_data_copy(AudioData *out, AudioData *in, ChannelMapInfo *map);
-
-/**
- * Append data from one AudioData to the end of another.
- *
- * @param dst         destination AudioData
- * @param dst_offset  offset, in samples, to start writing, relative to the
- *                    start of dst
- * @param src         source AudioData
- * @param src_offset  offset, in samples, to start copying, relative to the
- *                    start of the src
- * @param nb_samples  number of samples to copy
- * @return            0 on success, negative AVERROR value on error
- */
-int ff_audio_data_combine(AudioData *dst, int dst_offset, AudioData *src,
-                          int src_offset, int nb_samples);
-
-/**
- * Drain samples from the start of the AudioData.
- *
- * Remaining samples are shifted to the start of the AudioData.
- *
- * @param a           AudioData struct
- * @param nb_samples  number of samples to drain
- */
-void ff_audio_data_drain(AudioData *a, int nb_samples);
-
-/**
- * Add samples in AudioData to an AVAudioFifo.
- *
- * @param af          Audio FIFO Buffer
- * @param a           AudioData struct
- * @param offset      number of samples to skip from the start of the data
- * @param nb_samples  number of samples to add to the FIFO
- * @return            number of samples actually added to the FIFO, or
- *                    negative AVERROR code on error
- */
-int ff_audio_data_add_to_fifo(AVAudioFifo *af, AudioData *a, int offset,
-                              int nb_samples);
-
-/**
- * Read samples from an AVAudioFifo to AudioData.
- *
- * @param af          Audio FIFO Buffer
- * @param a           AudioData struct
- * @param nb_samples  number of samples to read from the FIFO
- * @return            number of samples actually read from the FIFO, or
- *                    negative AVERROR code on error
- */
-int ff_audio_data_read_from_fifo(AVAudioFifo *af, AudioData *a, int nb_samples);
-
-#endif /* AVRESAMPLE_AUDIO_DATA_H */
diff --git a/deps/libav/libavresample/audio_mix.c b/deps/libav/libavresample/audio_mix.c
deleted file mode 100644
index 8619c1a..0000000
--- a/deps/libav/libavresample/audio_mix.c
+++ /dev/null
@@ -1,742 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "libavutil/libm.h"
-#include "libavutil/samplefmt.h"
-#include "avresample.h"
-#include "internal.h"
-#include "audio_data.h"
-#include "audio_mix.h"
-
-static const char *coeff_type_names[] = { "q8", "q15", "flt" };
-
-struct AudioMix {
-    AVAudioResampleContext *avr;
-    enum AVSampleFormat fmt;
-    enum AVMixCoeffType coeff_type;
-    uint64_t in_layout;
-    uint64_t out_layout;
-    int in_channels;
-    int out_channels;
-
-    int ptr_align;
-    int samples_align;
-    int has_optimized_func;
-    const char *func_descr;
-    const char *func_descr_generic;
-    mix_func *mix;
-    mix_func *mix_generic;
-
-    int in_matrix_channels;
-    int out_matrix_channels;
-    int output_zero[AVRESAMPLE_MAX_CHANNELS];
-    int input_skip[AVRESAMPLE_MAX_CHANNELS];
-    int output_skip[AVRESAMPLE_MAX_CHANNELS];
-    int16_t *matrix_q8[AVRESAMPLE_MAX_CHANNELS];
-    int32_t *matrix_q15[AVRESAMPLE_MAX_CHANNELS];
-    float   *matrix_flt[AVRESAMPLE_MAX_CHANNELS];
-    void   **matrix;
-};
-
-void ff_audio_mix_set_func(AudioMix *am, enum AVSampleFormat fmt,
-                           enum AVMixCoeffType coeff_type, int in_channels,
-                           int out_channels, int ptr_align, int samples_align,
-                           const char *descr, void *mix_func)
-{
-    if (fmt == am->fmt && coeff_type == am->coeff_type &&
-        ( in_channels ==  am->in_matrix_channels ||  in_channels == 0) &&
-        (out_channels == am->out_matrix_channels || out_channels == 0)) {
-        char chan_str[16];
-        am->mix           = mix_func;
-        am->func_descr    = descr;
-        am->ptr_align     = ptr_align;
-        am->samples_align = samples_align;
-        if (ptr_align == 1 && samples_align == 1) {
-            am->mix_generic        = mix_func;
-            am->func_descr_generic = descr;
-        } else {
-            am->has_optimized_func = 1;
-        }
-        if (in_channels) {
-            if (out_channels)
-                snprintf(chan_str, sizeof(chan_str), "[%d to %d] ",
-                         in_channels, out_channels);
-            else
-                snprintf(chan_str, sizeof(chan_str), "[%d to any] ",
-                         in_channels);
-        } else if (out_channels) {
-                snprintf(chan_str, sizeof(chan_str), "[any to %d] ",
-                         out_channels);
-        } else {
-            snprintf(chan_str, sizeof(chan_str), "[any to any] ");
-        }
-        av_log(am->avr, AV_LOG_DEBUG, "audio_mix: found function: [fmt=%s] "
-               "[c=%s] %s(%s)\n", av_get_sample_fmt_name(fmt),
-               coeff_type_names[coeff_type], chan_str, descr);
-    }
-}
-
-#define MIX_FUNC_NAME(fmt, cfmt) mix_any_ ## fmt ##_## cfmt ##_c
-
-#define MIX_FUNC_GENERIC(fmt, cfmt, stype, ctype, sumtype, expr)            \
-static void MIX_FUNC_NAME(fmt, cfmt)(stype **samples, ctype **matrix,       \
-                                     int len, int out_ch, int in_ch)        \
-{                                                                           \
-    int i, in, out;                                                         \
-    stype temp[AVRESAMPLE_MAX_CHANNELS];                                    \
-    for (i = 0; i < len; i++) {                                             \
-        for (out = 0; out < out_ch; out++) {                                \
-            sumtype sum = 0;                                                \
-            for (in = 0; in < in_ch; in++)                                  \
-                sum += samples[in][i] * matrix[out][in];                    \
-            temp[out] = expr;                                               \
-        }                                                                   \
-        for (out = 0; out < out_ch; out++)                                  \
-            samples[out][i] = temp[out];                                    \
-    }                                                                       \
-}
-
-MIX_FUNC_GENERIC(FLTP, FLT, float,   float,   float,   sum)
-MIX_FUNC_GENERIC(S16P, FLT, int16_t, float,   float,   av_clip_int16(lrintf(sum)))
-MIX_FUNC_GENERIC(S16P, Q15, int16_t, int32_t, int64_t, av_clip_int16(sum >> 15))
-MIX_FUNC_GENERIC(S16P, Q8,  int16_t, int16_t, int32_t, av_clip_int16(sum >>  8))
-
-/* TODO: templatize the channel-specific C functions */
-
-static void mix_2_to_1_fltp_flt_c(float **samples, float **matrix, int len,
-                                  int out_ch, int in_ch)
-{
-    float *src0 = samples[0];
-    float *src1 = samples[1];
-    float *dst  = src0;
-    float m0    = matrix[0][0];
-    float m1    = matrix[0][1];
-
-    while (len > 4) {
-        *dst++ = *src0++ * m0 + *src1++ * m1;
-        *dst++ = *src0++ * m0 + *src1++ * m1;
-        *dst++ = *src0++ * m0 + *src1++ * m1;
-        *dst++ = *src0++ * m0 + *src1++ * m1;
-        len -= 4;
-    }
-    while (len > 0) {
-        *dst++ = *src0++ * m0 + *src1++ * m1;
-        len--;
-    }
-}
-
-static void mix_2_to_1_s16p_flt_c(int16_t **samples, float **matrix, int len,
-                                  int out_ch, int in_ch)
-{
-    int16_t *src0 = samples[0];
-    int16_t *src1 = samples[1];
-    int16_t *dst  = src0;
-    float m0      = matrix[0][0];
-    float m1      = matrix[0][1];
-
-    while (len > 4) {
-        *dst++ = av_clip_int16(lrintf(*src0++ * m0 + *src1++ * m1));
-        *dst++ = av_clip_int16(lrintf(*src0++ * m0 + *src1++ * m1));
-        *dst++ = av_clip_int16(lrintf(*src0++ * m0 + *src1++ * m1));
-        *dst++ = av_clip_int16(lrintf(*src0++ * m0 + *src1++ * m1));
-        len -= 4;
-    }
-    while (len > 0) {
-        *dst++ = av_clip_int16(lrintf(*src0++ * m0 + *src1++ * m1));
-        len--;
-    }
-}
-
-static void mix_2_to_1_s16p_q8_c(int16_t **samples, int16_t **matrix, int len,
-                                 int out_ch, int in_ch)
-{
-    int16_t *src0 = samples[0];
-    int16_t *src1 = samples[1];
-    int16_t *dst  = src0;
-    int16_t m0    = matrix[0][0];
-    int16_t m1    = matrix[0][1];
-
-    while (len > 4) {
-        *dst++ = (*src0++ * m0 + *src1++ * m1) >> 8;
-        *dst++ = (*src0++ * m0 + *src1++ * m1) >> 8;
-        *dst++ = (*src0++ * m0 + *src1++ * m1) >> 8;
-        *dst++ = (*src0++ * m0 + *src1++ * m1) >> 8;
-        len -= 4;
-    }
-    while (len > 0) {
-        *dst++ = (*src0++ * m0 + *src1++ * m1) >> 8;
-        len--;
-    }
-}
-
-static void mix_1_to_2_fltp_flt_c(float **samples, float **matrix, int len,
-                                  int out_ch, int in_ch)
-{
-    float v;
-    float *dst0 = samples[0];
-    float *dst1 = samples[1];
-    float *src  = dst0;
-    float m0    = matrix[0][0];
-    float m1    = matrix[1][0];
-
-    while (len > 4) {
-        v = *src++;
-        *dst0++ = v * m0;
-        *dst1++ = v * m1;
-        v = *src++;
-        *dst0++ = v * m0;
-        *dst1++ = v * m1;
-        v = *src++;
-        *dst0++ = v * m0;
-        *dst1++ = v * m1;
-        v = *src++;
-        *dst0++ = v * m0;
-        *dst1++ = v * m1;
-        len -= 4;
-    }
-    while (len > 0) {
-        v = *src++;
-        *dst0++ = v * m0;
-        *dst1++ = v * m1;
-        len--;
-    }
-}
-
-static void mix_6_to_2_fltp_flt_c(float **samples, float **matrix, int len,
-                                  int out_ch, int in_ch)
-{
-    float v0, v1;
-    float *src0 = samples[0];
-    float *src1 = samples[1];
-    float *src2 = samples[2];
-    float *src3 = samples[3];
-    float *src4 = samples[4];
-    float *src5 = samples[5];
-    float *dst0 = src0;
-    float *dst1 = src1;
-    float *m0   = matrix[0];
-    float *m1   = matrix[1];
-
-    while (len > 0) {
-        v0 = *src0++;
-        v1 = *src1++;
-        *dst0++ = v0      * m0[0] +
-                  v1      * m0[1] +
-                  *src2   * m0[2] +
-                  *src3   * m0[3] +
-                  *src4   * m0[4] +
-                  *src5   * m0[5];
-        *dst1++ = v0      * m1[0] +
-                  v1      * m1[1] +
-                  *src2++ * m1[2] +
-                  *src3++ * m1[3] +
-                  *src4++ * m1[4] +
-                  *src5++ * m1[5];
-        len--;
-    }
-}
-
-static void mix_2_to_6_fltp_flt_c(float **samples, float **matrix, int len,
-                                  int out_ch, int in_ch)
-{
-    float v0, v1;
-    float *dst0 = samples[0];
-    float *dst1 = samples[1];
-    float *dst2 = samples[2];
-    float *dst3 = samples[3];
-    float *dst4 = samples[4];
-    float *dst5 = samples[5];
-    float *src0 = dst0;
-    float *src1 = dst1;
-
-    while (len > 0) {
-        v0 = *src0++;
-        v1 = *src1++;
-        *dst0++ = v0 * matrix[0][0] + v1 * matrix[0][1];
-        *dst1++ = v0 * matrix[1][0] + v1 * matrix[1][1];
-        *dst2++ = v0 * matrix[2][0] + v1 * matrix[2][1];
-        *dst3++ = v0 * matrix[3][0] + v1 * matrix[3][1];
-        *dst4++ = v0 * matrix[4][0] + v1 * matrix[4][1];
-        *dst5++ = v0 * matrix[5][0] + v1 * matrix[5][1];
-        len--;
-    }
-}
-
-static av_cold int mix_function_init(AudioMix *am)
-{
-    am->func_descr = am->func_descr_generic = "n/a";
-    am->mix = am->mix_generic = NULL;
-
-    /* no need to set a mix function when we're skipping mixing */
-    if (!am->in_matrix_channels || !am->out_matrix_channels)
-        return 0;
-
-    /* any-to-any C versions */
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,
-                          0, 0, 1, 1, "C", MIX_FUNC_NAME(FLTP, FLT));
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,
-                          0, 0, 1, 1, "C", MIX_FUNC_NAME(S16P, FLT));
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_Q15,
-                          0, 0, 1, 1, "C", MIX_FUNC_NAME(S16P, Q15));
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_Q8,
-                          0, 0, 1, 1, "C", MIX_FUNC_NAME(S16P, Q8));
-
-    /* channel-specific C versions */
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,
-                          2, 1, 1, 1, "C", mix_2_to_1_fltp_flt_c);
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,
-                          2, 1, 1, 1, "C", mix_2_to_1_s16p_flt_c);
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_Q8,
-                          2, 1, 1, 1, "C", mix_2_to_1_s16p_q8_c);
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,
-                          1, 2, 1, 1, "C", mix_1_to_2_fltp_flt_c);
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,
-                          6, 2, 1, 1, "C", mix_6_to_2_fltp_flt_c);
-
-    ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,
-                          2, 6, 1, 1, "C", mix_2_to_6_fltp_flt_c);
-
-    if (ARCH_X86)
-        ff_audio_mix_init_x86(am);
-
-    if (!am->mix) {
-        av_log(am->avr, AV_LOG_ERROR, "audio_mix: NO FUNCTION FOUND: [fmt=%s] "
-               "[c=%s] [%d to %d]\n", av_get_sample_fmt_name(am->fmt),
-               coeff_type_names[am->coeff_type], am->in_channels,
-               am->out_channels);
-        return AVERROR_PATCHWELCOME;
-    }
-    return 0;
-}
-
-AudioMix *ff_audio_mix_alloc(AVAudioResampleContext *avr)
-{
-    AudioMix *am;
-    int ret;
-
-    am = av_mallocz(sizeof(*am));
-    if (!am)
-        return NULL;
-    am->avr = avr;
-
-    if (avr->internal_sample_fmt != AV_SAMPLE_FMT_S16P &&
-        avr->internal_sample_fmt != AV_SAMPLE_FMT_FLTP) {
-        av_log(avr, AV_LOG_ERROR, "Unsupported internal format for "
-               "mixing: %s\n",
-               av_get_sample_fmt_name(avr->internal_sample_fmt));
-        goto error;
-    }
-
-    am->fmt          = avr->internal_sample_fmt;
-    am->coeff_type   = avr->mix_coeff_type;
-    am->in_layout    = avr->in_channel_layout;
-    am->out_layout   = avr->out_channel_layout;
-    am->in_channels  = avr->in_channels;
-    am->out_channels = avr->out_channels;
-
-    /* build matrix if the user did not already set one */
-    if (avr->mix_matrix) {
-        ret = ff_audio_mix_set_matrix(am, avr->mix_matrix, avr->in_channels);
-        if (ret < 0)
-            goto error;
-        av_freep(&avr->mix_matrix);
-    } else {
-        double *matrix_dbl = av_mallocz(avr->out_channels * avr->in_channels *
-                                        sizeof(*matrix_dbl));
-        if (!matrix_dbl)
-            goto error;
-
-        ret = avresample_build_matrix(avr->in_channel_layout,
-                                      avr->out_channel_layout,
-                                      avr->center_mix_level,
-                                      avr->surround_mix_level,
-                                      avr->lfe_mix_level,
-                                      avr->normalize_mix_level,
-                                      matrix_dbl,
-                                      avr->in_channels,
-                                      avr->matrix_encoding);
-        if (ret < 0) {
-            av_free(matrix_dbl);
-            goto error;
-        }
-
-        ret = ff_audio_mix_set_matrix(am, matrix_dbl, avr->in_channels);
-        if (ret < 0) {
-            av_log(avr, AV_LOG_ERROR, "error setting mix matrix\n");
-            av_free(matrix_dbl);
-            goto error;
-        }
-
-        av_free(matrix_dbl);
-    }
-
-    return am;
-
-error:
-    av_free(am);
-    return NULL;
-}
-
-void ff_audio_mix_free(AudioMix **am_p)
-{
-    AudioMix *am;
-
-    if (!*am_p)
-        return;
-    am = *am_p;
-
-    if (am->matrix) {
-        av_free(am->matrix[0]);
-        am->matrix = NULL;
-    }
-    memset(am->matrix_q8,  0, sizeof(am->matrix_q8 ));
-    memset(am->matrix_q15, 0, sizeof(am->matrix_q15));
-    memset(am->matrix_flt, 0, sizeof(am->matrix_flt));
-
-    av_freep(am_p);
-}
-
-int ff_audio_mix(AudioMix *am, AudioData *src)
-{
-    int use_generic = 1;
-    int len = src->nb_samples;
-    int i, j;
-
-    /* determine whether to use the optimized function based on pointer and
-       samples alignment in both the input and output */
-    if (am->has_optimized_func) {
-        int aligned_len = FFALIGN(len, am->samples_align);
-        if (!(src->ptr_align % am->ptr_align) &&
-            src->samples_align >= aligned_len) {
-            len = aligned_len;
-            use_generic = 0;
-        }
-    }
-    av_dlog(am->avr, "audio_mix: %d samples - %d to %d channels (%s)\n",
-            src->nb_samples, am->in_channels, am->out_channels,
-            use_generic ? am->func_descr_generic : am->func_descr);
-
-    if (am->in_matrix_channels && am->out_matrix_channels) {
-        uint8_t **data;
-        uint8_t *data0[AVRESAMPLE_MAX_CHANNELS] = { NULL };
-
-        if (am->out_matrix_channels < am->out_channels ||
-             am->in_matrix_channels <  am->in_channels) {
-            for (i = 0, j = 0; i < FFMAX(am->in_channels, am->out_channels); i++) {
-                if (am->input_skip[i] || am->output_skip[i] || am->output_zero[i])
-                    continue;
-                data0[j++] = src->data[i];
-            }
-            data = data0;
-        } else {
-            data = src->data;
-        }
-
-        if (use_generic)
-            am->mix_generic(data, am->matrix, len, am->out_matrix_channels,
-                            am->in_matrix_channels);
-        else
-            am->mix(data, am->matrix, len, am->out_matrix_channels,
-                    am->in_matrix_channels);
-    }
-
-    if (am->out_matrix_channels < am->out_channels) {
-        for (i = 0; i < am->out_channels; i++)
-            if (am->output_zero[i])
-                av_samples_set_silence(&src->data[i], 0, len, 1, am->fmt);
-    }
-
-    ff_audio_data_set_channels(src, am->out_channels);
-
-    return 0;
-}
-
-int ff_audio_mix_get_matrix(AudioMix *am, double *matrix, int stride)
-{
-    int i, o, i0, o0;
-
-    if ( am->in_channels <= 0 ||  am->in_channels > AVRESAMPLE_MAX_CHANNELS ||
-        am->out_channels <= 0 || am->out_channels > AVRESAMPLE_MAX_CHANNELS) {
-        av_log(am->avr, AV_LOG_ERROR, "Invalid channel counts\n");
-        return AVERROR(EINVAL);
-    }
-
-#define GET_MATRIX_CONVERT(suffix, scale)                                   \
-    if (!am->matrix_ ## suffix[0]) {                                        \
-        av_log(am->avr, AV_LOG_ERROR, "matrix is not set\n");               \
-        return AVERROR(EINVAL);                                             \
-    }                                                                       \
-    for (o = 0, o0 = 0; o < am->out_channels; o++) {                        \
-        for (i = 0, i0 = 0; i < am->in_channels; i++) {                     \
-            if (am->input_skip[i] || am->output_zero[o])                    \
-                matrix[o * stride + i] = 0.0;                               \
-            else                                                            \
-                matrix[o * stride + i] = am->matrix_ ## suffix[o0][i0] *    \
-                                         (scale);                           \
-            if (!am->input_skip[i])                                         \
-                i0++;                                                       \
-        }                                                                   \
-        if (!am->output_zero[o])                                            \
-            o0++;                                                           \
-    }
-
-    switch (am->coeff_type) {
-    case AV_MIX_COEFF_TYPE_Q8:
-        GET_MATRIX_CONVERT(q8, 1.0 / 256.0);
-        break;
-    case AV_MIX_COEFF_TYPE_Q15:
-        GET_MATRIX_CONVERT(q15, 1.0 / 32768.0);
-        break;
-    case AV_MIX_COEFF_TYPE_FLT:
-        GET_MATRIX_CONVERT(flt, 1.0);
-        break;
-    default:
-        av_log(am->avr, AV_LOG_ERROR, "Invalid mix coeff type\n");
-        return AVERROR(EINVAL);
-    }
-
-    return 0;
-}
-
-static void reduce_matrix(AudioMix *am, const double *matrix, int stride)
-{
-    int i, o;
-
-    memset(am->output_zero, 0, sizeof(am->output_zero));
-    memset(am->input_skip,  0, sizeof(am->input_skip));
-    memset(am->output_skip, 0, sizeof(am->output_skip));
-
-    /* exclude output channels if they can be zeroed instead of mixed */
-    for (o = 0; o < am->out_channels; o++) {
-        int zero = 1;
-
-        /* check if the output is always silent */
-        for (i = 0; i < am->in_channels; i++) {
-            if (matrix[o * stride + i] != 0.0) {
-                zero = 0;
-                break;
-            }
-        }
-        /* check if the corresponding input channel makes a contribution to
-           any output channel */
-        if (o < am->in_channels) {
-            for (i = 0; i < am->out_channels; i++) {
-                if (matrix[i * stride + o] != 0.0) {
-                    zero = 0;
-                    break;
-                }
-            }
-        }
-        if (zero) {
-            am->output_zero[o] = 1;
-            am->out_matrix_channels--;
-            if (o < am->in_channels)
-                am->in_matrix_channels--;
-        }
-    }
-    if (am->out_matrix_channels == 0 || am->in_matrix_channels == 0) {
-        am->out_matrix_channels = 0;
-        am->in_matrix_channels = 0;
-        return;
-    }
-
-    /* skip input channels that contribute fully only to the corresponding
-       output channel */
-    for (i = 0; i < FFMIN(am->in_channels, am->out_channels); i++) {
-        int skip = 1;
-
-        for (o = 0; o < am->out_channels; o++) {
-            int i0;
-            if ((o != i && matrix[o * stride + i] != 0.0) ||
-                (o == i && matrix[o * stride + i] != 1.0)) {
-                skip = 0;
-                break;
-            }
-            /* if the input contributes fully to the output, also check that no
-               other inputs contribute to this output */
-            if (o == i) {
-                for (i0 = 0; i0 < am->in_channels; i0++) {
-                    if (i0 != i && matrix[o * stride + i0] != 0.0) {
-                        skip = 0;
-                        break;
-                    }
-                }
-            }
-        }
-        if (skip) {
-            am->input_skip[i] = 1;
-            am->in_matrix_channels--;
-        }
-    }
-    /* skip input channels that do not contribute to any output channel */
-    for (; i < am->in_channels; i++) {
-        int contrib = 0;
-
-        for (o = 0; o < am->out_channels; o++) {
-            if (matrix[o * stride + i] != 0.0) {
-                contrib = 1;
-                break;
-            }
-        }
-        if (!contrib) {
-            am->input_skip[i] = 1;
-            am->in_matrix_channels--;
-        }
-    }
-    if (am->in_matrix_channels == 0) {
-        am->out_matrix_channels = 0;
-        return;
-    }
-
-    /* skip output channels that only get full contribution from the
-       corresponding input channel */
-    for (o = 0; o < FFMIN(am->in_channels, am->out_channels); o++) {
-        int skip = 1;
-        int o0;
-
-        for (i = 0; i < am->in_channels; i++) {
-            if ((o != i && matrix[o * stride + i] != 0.0) ||
-                (o == i && matrix[o * stride + i] != 1.0)) {
-                skip = 0;
-                break;
-            }
-        }
-        /* check if the corresponding input channel makes a contribution to
-           any other output channel */
-        i = o;
-        for (o0 = 0; o0 < am->out_channels; o0++) {
-            if (o0 != i && matrix[o0 * stride + i] != 0.0) {
-                skip = 0;
-                break;
-            }
-        }
-        if (skip) {
-            am->output_skip[o] = 1;
-            am->out_matrix_channels--;
-        }
-    }
-    if (am->out_matrix_channels == 0) {
-        am->in_matrix_channels = 0;
-        return;
-    }
-}
-
-int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride)
-{
-    int i, o, i0, o0, ret;
-    char in_layout_name[128];
-    char out_layout_name[128];
-
-    if ( am->in_channels <= 0 ||  am->in_channels > AVRESAMPLE_MAX_CHANNELS ||
-        am->out_channels <= 0 || am->out_channels > AVRESAMPLE_MAX_CHANNELS) {
-        av_log(am->avr, AV_LOG_ERROR, "Invalid channel counts\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (am->matrix) {
-        av_free(am->matrix[0]);
-        am->matrix = NULL;
-    }
-
-    am->in_matrix_channels  = am->in_channels;
-    am->out_matrix_channels = am->out_channels;
-
-    reduce_matrix(am, matrix, stride);
-
-#define CONVERT_MATRIX(type, expr)                                          \
-    am->matrix_## type[0] = av_mallocz(am->out_matrix_channels *            \
-                                       am->in_matrix_channels  *            \
-                                       sizeof(*am->matrix_## type[0]));     \
-    if (!am->matrix_## type[0])                                             \
-        return AVERROR(ENOMEM);                                             \
-    for (o = 0, o0 = 0; o < am->out_channels; o++) {                        \
-        if (am->output_zero[o] || am->output_skip[o])                       \
-            continue;                                                       \
-        if (o0 > 0)                                                         \
-            am->matrix_## type[o0] = am->matrix_## type[o0 - 1] +           \
-                                     am->in_matrix_channels;                \
-        for (i = 0, i0 = 0; i < am->in_channels; i++) {                     \
-            double v;                                                       \
-            if (am->input_skip[i] || am->output_zero[i])                    \
-                continue;                                                   \
-            v = matrix[o * stride + i];                                     \
-            am->matrix_## type[o0][i0] = expr;                              \
-            i0++;                                                           \
-        }                                                                   \
-        o0++;                                                               \
-    }                                                                       \
-    am->matrix = (void **)am->matrix_## type;
-
-    if (am->in_matrix_channels && am->out_matrix_channels) {
-        switch (am->coeff_type) {
-        case AV_MIX_COEFF_TYPE_Q8:
-            CONVERT_MATRIX(q8, av_clip_int16(lrint(256.0 * v)))
-            break;
-        case AV_MIX_COEFF_TYPE_Q15:
-            CONVERT_MATRIX(q15, av_clipl_int32(llrint(32768.0 * v)))
-            break;
-        case AV_MIX_COEFF_TYPE_FLT:
-            CONVERT_MATRIX(flt, v)
-            break;
-        default:
-            av_log(am->avr, AV_LOG_ERROR, "Invalid mix coeff type\n");
-            return AVERROR(EINVAL);
-        }
-    }
-
-    ret = mix_function_init(am);
-    if (ret < 0)
-        return ret;
-
-    av_get_channel_layout_string(in_layout_name, sizeof(in_layout_name),
-                                 am->in_channels, am->in_layout);
-    av_get_channel_layout_string(out_layout_name, sizeof(out_layout_name),
-                                 am->out_channels, am->out_layout);
-    av_log(am->avr, AV_LOG_DEBUG, "audio_mix: %s to %s\n",
-           in_layout_name, out_layout_name);
-    av_log(am->avr, AV_LOG_DEBUG, "matrix size: %d x %d\n",
-           am->in_matrix_channels, am->out_matrix_channels);
-    for (o = 0; o < am->out_channels; o++) {
-        for (i = 0; i < am->in_channels; i++) {
-            if (am->output_zero[o])
-                av_log(am->avr, AV_LOG_DEBUG, "  (ZERO)");
-            else if (am->input_skip[i] || am->output_zero[i] || am->output_skip[o])
-                av_log(am->avr, AV_LOG_DEBUG, "  (SKIP)");
-            else
-                av_log(am->avr, AV_LOG_DEBUG, "  %0.3f ",
-                       matrix[o * am->in_channels + i]);
-        }
-        av_log(am->avr, AV_LOG_DEBUG, "\n");
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavresample/audio_mix.h b/deps/libav/libavresample/audio_mix.h
deleted file mode 100644
index 5bae5ab..0000000
--- a/deps/libav/libavresample/audio_mix.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVRESAMPLE_AUDIO_MIX_H
-#define AVRESAMPLE_AUDIO_MIX_H
-
-#include <stdint.h>
-
-#include "libavutil/samplefmt.h"
-#include "avresample.h"
-#include "internal.h"
-#include "audio_data.h"
-
-typedef void (mix_func)(uint8_t **src, void **matrix, int len, int out_ch,
-                        int in_ch);
-
-/**
- * Set mixing function if the parameters match.
- *
- * This compares the parameters of the mixing function to the parameters in the
- * AudioMix context. If the parameters do not match, no changes are made to the
- * active functions. If the parameters do match and the alignment is not
- * constrained, the function is set as the generic mixing function. If the
- * parameters match and the alignment is constrained, the function is set as
- * the optimized mixing function.
- *
- * @param am             AudioMix context
- * @param fmt            input/output sample format
- * @param coeff_type     mixing coefficient type
- * @param in_channels    number of input channels, or 0 for any number of channels
- * @param out_channels   number of output channels, or 0 for any number of channels
- * @param ptr_align      buffer pointer alignment, in bytes
- * @param samples_align  buffer size alignment, in samples
- * @param descr          function type description (e.g. "C" or "SSE")
- * @param mix_func       mixing function pointer
- */
-void ff_audio_mix_set_func(AudioMix *am, enum AVSampleFormat fmt,
-                           enum AVMixCoeffType coeff_type, int in_channels,
-                           int out_channels, int ptr_align, int samples_align,
-                           const char *descr, void *mix_func);
-
-/**
- * Allocate and initialize an AudioMix context.
- *
- * The parameters in the AVAudioResampleContext are used to initialize the
- * AudioMix context.
- *
- * @param avr  AVAudioResampleContext
- * @return     newly-allocated AudioMix context.
- */
-AudioMix *ff_audio_mix_alloc(AVAudioResampleContext *avr);
-
-/**
- * Free an AudioMix context.
- */
-void ff_audio_mix_free(AudioMix **am);
-
-/**
- * Apply channel mixing to audio data using the current mixing matrix.
- */
-int ff_audio_mix(AudioMix *am, AudioData *src);
-
-/**
- * Get the current mixing matrix.
- */
-int ff_audio_mix_get_matrix(AudioMix *am, double *matrix, int stride);
-
-/**
- * Set the current mixing matrix.
- */
-int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride);
-
-/* arch-specific initialization functions */
-
-void ff_audio_mix_init_x86(AudioMix *am);
-
-#endif /* AVRESAMPLE_AUDIO_MIX_H */
diff --git a/deps/libav/libavresample/audio_mix_matrix.c b/deps/libav/libavresample/audio_mix_matrix.c
deleted file mode 100644
index 487869b..0000000
--- a/deps/libav/libavresample/audio_mix_matrix.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright (C) 2011 Michael Niedermayer (michaelni at gmx.at)
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "libavutil/libm.h"
-#include "libavutil/samplefmt.h"
-#include "avresample.h"
-#include "internal.h"
-#include "audio_data.h"
-#include "audio_mix.h"
-
-/* channel positions */
-#define FRONT_LEFT              0
-#define FRONT_RIGHT             1
-#define FRONT_CENTER            2
-#define LOW_FREQUENCY           3
-#define BACK_LEFT               4
-#define BACK_RIGHT              5
-#define FRONT_LEFT_OF_CENTER    6
-#define FRONT_RIGHT_OF_CENTER   7
-#define BACK_CENTER             8
-#define SIDE_LEFT               9
-#define SIDE_RIGHT             10
-#define TOP_CENTER             11
-#define TOP_FRONT_LEFT         12
-#define TOP_FRONT_CENTER       13
-#define TOP_FRONT_RIGHT        14
-#define TOP_BACK_LEFT          15
-#define TOP_BACK_CENTER        16
-#define TOP_BACK_RIGHT         17
-#define STEREO_LEFT            29
-#define STEREO_RIGHT           30
-#define WIDE_LEFT              31
-#define WIDE_RIGHT             32
-#define SURROUND_DIRECT_LEFT   33
-#define SURROUND_DIRECT_RIGHT  34
-#define LOW_FREQUENCY_2        35
-
-#define SQRT3_2      1.22474487139158904909  /* sqrt(3/2) */
-
-static av_always_inline int even(uint64_t layout)
-{
-    return (!layout || (layout & (layout - 1)));
-}
-
-static int sane_layout(uint64_t layout)
-{
-    /* check that there is at least 1 front speaker */
-    if (!(layout & AV_CH_LAYOUT_SURROUND))
-        return 0;
-
-    /* check for left/right symmetry */
-    if (!even(layout & (AV_CH_FRONT_LEFT           | AV_CH_FRONT_RIGHT))           ||
-        !even(layout & (AV_CH_SIDE_LEFT            | AV_CH_SIDE_RIGHT))            ||
-        !even(layout & (AV_CH_BACK_LEFT            | AV_CH_BACK_RIGHT))            ||
-        !even(layout & (AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER)) ||
-        !even(layout & (AV_CH_TOP_FRONT_LEFT       | AV_CH_TOP_FRONT_RIGHT))       ||
-        !even(layout & (AV_CH_TOP_BACK_LEFT        | AV_CH_TOP_BACK_RIGHT))        ||
-        !even(layout & (AV_CH_STEREO_LEFT          | AV_CH_STEREO_RIGHT))          ||
-        !even(layout & (AV_CH_WIDE_LEFT            | AV_CH_WIDE_RIGHT))            ||
-        !even(layout & (AV_CH_SURROUND_DIRECT_LEFT | AV_CH_SURROUND_DIRECT_RIGHT)))
-        return 0;
-
-    return 1;
-}
-
-int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
-                            double center_mix_level, double surround_mix_level,
-                            double lfe_mix_level, int normalize,
-                            double *matrix_out, int stride,
-                            enum AVMatrixEncoding matrix_encoding)
-{
-    int i, j, out_i, out_j;
-    double matrix[64][64] = {{0}};
-    int64_t unaccounted;
-    double maxcoef = 0;
-    int in_channels, out_channels;
-
-    if ((out_layout & AV_CH_LAYOUT_STEREO_DOWNMIX) == AV_CH_LAYOUT_STEREO_DOWNMIX) {
-        out_layout = AV_CH_LAYOUT_STEREO;
-    }
-
-    unaccounted = in_layout & ~out_layout;
-
-    in_channels  = av_get_channel_layout_nb_channels( in_layout);
-    out_channels = av_get_channel_layout_nb_channels(out_layout);
-
-    memset(matrix_out, 0, out_channels * stride * sizeof(*matrix_out));
-
-    /* check if layouts are supported */
-    if (!in_layout || in_channels > AVRESAMPLE_MAX_CHANNELS)
-        return AVERROR(EINVAL);
-    if (!out_layout || out_channels > AVRESAMPLE_MAX_CHANNELS)
-        return AVERROR(EINVAL);
-
-    /* check if layouts are unbalanced or abnormal */
-    if (!sane_layout(in_layout) || !sane_layout(out_layout))
-        return AVERROR_PATCHWELCOME;
-
-    /* route matching input/output channels */
-    for (i = 0; i < 64; i++) {
-        if (in_layout & out_layout & (1ULL << i))
-            matrix[i][i] = 1.0;
-    }
-
-    /* mix front center to front left/right */
-    if (unaccounted & AV_CH_FRONT_CENTER) {
-        if ((out_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO) {
-            if ((in_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO) {
-                matrix[FRONT_LEFT ][FRONT_CENTER] += center_mix_level;
-                matrix[FRONT_RIGHT][FRONT_CENTER] += center_mix_level;
-            } else {
-                matrix[FRONT_LEFT ][FRONT_CENTER] += M_SQRT1_2;
-                matrix[FRONT_RIGHT][FRONT_CENTER] += M_SQRT1_2;
-            }
-        } else
-            return AVERROR_PATCHWELCOME;
-    }
-    /* mix front left/right to center */
-    if (unaccounted & AV_CH_LAYOUT_STEREO) {
-        if (out_layout & AV_CH_FRONT_CENTER) {
-            matrix[FRONT_CENTER][FRONT_LEFT ] += M_SQRT1_2;
-            matrix[FRONT_CENTER][FRONT_RIGHT] += M_SQRT1_2;
-            /* mix left/right/center to center */
-            if (in_layout & AV_CH_FRONT_CENTER)
-                matrix[FRONT_CENTER][FRONT_CENTER] = center_mix_level * M_SQRT2;
-        } else
-            return AVERROR_PATCHWELCOME;
-    }
-    /* mix back center to back, side, or front */
-    if (unaccounted & AV_CH_BACK_CENTER) {
-        if (out_layout & AV_CH_BACK_LEFT) {
-            matrix[BACK_LEFT ][BACK_CENTER] += M_SQRT1_2;
-            matrix[BACK_RIGHT][BACK_CENTER] += M_SQRT1_2;
-        } else if (out_layout & AV_CH_SIDE_LEFT) {
-            matrix[SIDE_LEFT ][BACK_CENTER] += M_SQRT1_2;
-            matrix[SIDE_RIGHT][BACK_CENTER] += M_SQRT1_2;
-        } else if (out_layout & AV_CH_FRONT_LEFT) {
-            if (matrix_encoding == AV_MATRIX_ENCODING_DOLBY ||
-                matrix_encoding == AV_MATRIX_ENCODING_DPLII) {
-                if (unaccounted & (AV_CH_BACK_LEFT | AV_CH_SIDE_LEFT)) {
-                    matrix[FRONT_LEFT ][BACK_CENTER] -= surround_mix_level * M_SQRT1_2;
-                    matrix[FRONT_RIGHT][BACK_CENTER] += surround_mix_level * M_SQRT1_2;
-                } else {
-                    matrix[FRONT_LEFT ][BACK_CENTER] -= surround_mix_level;
-                    matrix[FRONT_RIGHT][BACK_CENTER] += surround_mix_level;
-                }
-            } else {
-                matrix[FRONT_LEFT ][BACK_CENTER] += surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_RIGHT][BACK_CENTER] += surround_mix_level * M_SQRT1_2;
-            }
-        } else if (out_layout & AV_CH_FRONT_CENTER) {
-            matrix[FRONT_CENTER][BACK_CENTER] += surround_mix_level * M_SQRT1_2;
-        } else
-            return AVERROR_PATCHWELCOME;
-    }
-    /* mix back left/right to back center, side, or front */
-    if (unaccounted & AV_CH_BACK_LEFT) {
-        if (out_layout & AV_CH_BACK_CENTER) {
-            matrix[BACK_CENTER][BACK_LEFT ] += M_SQRT1_2;
-            matrix[BACK_CENTER][BACK_RIGHT] += M_SQRT1_2;
-        } else if (out_layout & AV_CH_SIDE_LEFT) {
-            /* if side channels do not exist in the input, just copy back
-               channels to side channels, otherwise mix back into side */
-            if (in_layout & AV_CH_SIDE_LEFT) {
-                matrix[SIDE_LEFT ][BACK_LEFT ] += M_SQRT1_2;
-                matrix[SIDE_RIGHT][BACK_RIGHT] += M_SQRT1_2;
-            } else {
-                matrix[SIDE_LEFT ][BACK_LEFT ] += 1.0;
-                matrix[SIDE_RIGHT][BACK_RIGHT] += 1.0;
-            }
-        } else if (out_layout & AV_CH_FRONT_LEFT) {
-            if (matrix_encoding == AV_MATRIX_ENCODING_DOLBY) {
-                matrix[FRONT_LEFT ][BACK_LEFT ] -= surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_LEFT ][BACK_RIGHT] -= surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_RIGHT][BACK_LEFT ] += surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_RIGHT][BACK_RIGHT] += surround_mix_level * M_SQRT1_2;
-            } else if (matrix_encoding == AV_MATRIX_ENCODING_DPLII) {
-                matrix[FRONT_LEFT ][BACK_LEFT ] -= surround_mix_level * SQRT3_2;
-                matrix[FRONT_LEFT ][BACK_RIGHT] -= surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_RIGHT][BACK_LEFT ] += surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_RIGHT][BACK_RIGHT] += surround_mix_level * SQRT3_2;
-            } else {
-                matrix[FRONT_LEFT ][BACK_LEFT ] += surround_mix_level;
-                matrix[FRONT_RIGHT][BACK_RIGHT] += surround_mix_level;
-            }
-        } else if (out_layout & AV_CH_FRONT_CENTER) {
-            matrix[FRONT_CENTER][BACK_LEFT ] += surround_mix_level * M_SQRT1_2;
-            matrix[FRONT_CENTER][BACK_RIGHT] += surround_mix_level * M_SQRT1_2;
-        } else
-            return AVERROR_PATCHWELCOME;
-    }
-    /* mix side left/right into back or front */
-    if (unaccounted & AV_CH_SIDE_LEFT) {
-        if (out_layout & AV_CH_BACK_LEFT) {
-            /* if back channels do not exist in the input, just copy side
-               channels to back channels, otherwise mix side into back */
-            if (in_layout & AV_CH_BACK_LEFT) {
-                matrix[BACK_LEFT ][SIDE_LEFT ] += M_SQRT1_2;
-                matrix[BACK_RIGHT][SIDE_RIGHT] += M_SQRT1_2;
-            } else {
-                matrix[BACK_LEFT ][SIDE_LEFT ] += 1.0;
-                matrix[BACK_RIGHT][SIDE_RIGHT] += 1.0;
-            }
-        } else if (out_layout & AV_CH_BACK_CENTER) {
-            matrix[BACK_CENTER][SIDE_LEFT ] += M_SQRT1_2;
-            matrix[BACK_CENTER][SIDE_RIGHT] += M_SQRT1_2;
-        } else if (out_layout & AV_CH_FRONT_LEFT) {
-            if (matrix_encoding == AV_MATRIX_ENCODING_DOLBY) {
-                matrix[FRONT_LEFT ][SIDE_LEFT ] -= surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_LEFT ][SIDE_RIGHT] -= surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_RIGHT][SIDE_LEFT ] += surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_RIGHT][SIDE_RIGHT] += surround_mix_level * M_SQRT1_2;
-            } else if (matrix_encoding == AV_MATRIX_ENCODING_DPLII) {
-                matrix[FRONT_LEFT ][SIDE_LEFT ] -= surround_mix_level * SQRT3_2;
-                matrix[FRONT_LEFT ][SIDE_RIGHT] -= surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_RIGHT][SIDE_LEFT ] += surround_mix_level * M_SQRT1_2;
-                matrix[FRONT_RIGHT][SIDE_RIGHT] += surround_mix_level * SQRT3_2;
-            } else {
-                matrix[FRONT_LEFT ][SIDE_LEFT ] += surround_mix_level;
-                matrix[FRONT_RIGHT][SIDE_RIGHT] += surround_mix_level;
-            }
-        } else if (out_layout & AV_CH_FRONT_CENTER) {
-            matrix[FRONT_CENTER][SIDE_LEFT ] += surround_mix_level * M_SQRT1_2;
-            matrix[FRONT_CENTER][SIDE_RIGHT] += surround_mix_level * M_SQRT1_2;
-        } else
-            return AVERROR_PATCHWELCOME;
-    }
-    /* mix left-of-center/right-of-center into front left/right or center */
-    if (unaccounted & AV_CH_FRONT_LEFT_OF_CENTER) {
-        if (out_layout & AV_CH_FRONT_LEFT) {
-            matrix[FRONT_LEFT ][FRONT_LEFT_OF_CENTER ] += 1.0;
-            matrix[FRONT_RIGHT][FRONT_RIGHT_OF_CENTER] += 1.0;
-        } else if (out_layout & AV_CH_FRONT_CENTER) {
-            matrix[FRONT_CENTER][FRONT_LEFT_OF_CENTER ] += M_SQRT1_2;
-            matrix[FRONT_CENTER][FRONT_RIGHT_OF_CENTER] += M_SQRT1_2;
-        } else
-            return AVERROR_PATCHWELCOME;
-    }
-    /* mix LFE into front left/right or center */
-    if (unaccounted & AV_CH_LOW_FREQUENCY) {
-        if (out_layout & AV_CH_FRONT_CENTER) {
-            matrix[FRONT_CENTER][LOW_FREQUENCY] += lfe_mix_level;
-        } else if (out_layout & AV_CH_FRONT_LEFT) {
-            matrix[FRONT_LEFT ][LOW_FREQUENCY] += lfe_mix_level * M_SQRT1_2;
-            matrix[FRONT_RIGHT][LOW_FREQUENCY] += lfe_mix_level * M_SQRT1_2;
-        } else
-            return AVERROR_PATCHWELCOME;
-    }
-
-    /* transfer internal matrix to output matrix and calculate maximum
-       per-channel coefficient sum */
-    for (out_i = i = 0; out_i < out_channels && i < 64; i++) {
-        double sum = 0;
-        for (out_j = j = 0; out_j < in_channels && j < 64; j++) {
-            matrix_out[out_i * stride + out_j] = matrix[i][j];
-            sum += fabs(matrix[i][j]);
-            if (in_layout & (1ULL << j))
-                out_j++;
-        }
-        maxcoef = FFMAX(maxcoef, sum);
-        if (out_layout & (1ULL << i))
-            out_i++;
-    }
-
-    /* normalize */
-    if (normalize && maxcoef > 1.0) {
-        for (i = 0; i < out_channels; i++)
-            for (j = 0; j < in_channels; j++)
-                matrix_out[i * stride + j] /= maxcoef;
-    }
-
-    return 0;
-}
diff --git a/deps/libav/libavresample/avresample-test.c b/deps/libav/libavresample/avresample-test.c
deleted file mode 100644
index 697b4ba..0000000
--- a/deps/libav/libavresample/avresample-test.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 2002 Fabrice Bellard
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <stdio.h>
-
-#include "libavutil/avstring.h"
-#include "libavutil/common.h"
-#include "libavutil/lfg.h"
-#include "libavutil/libm.h"
-#include "libavutil/log.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-#include "avresample.h"
-
-static double dbl_rand(AVLFG *lfg)
-{
-    return 2.0 * (av_lfg_get(lfg) / (double)UINT_MAX) - 1.0;
-}
-
-#define PUT_FUNC(name, fmt, type, expr)                                     \
-static void put_sample_ ## name(void **data, enum AVSampleFormat sample_fmt,\
-                                int channels, int sample, int ch,           \
-                                double v_dbl)                               \
-{                                                                           \
-    type v = expr;                                                          \
-    type **out = (type **)data;                                             \
-    if (av_sample_fmt_is_planar(sample_fmt))                                \
-        out[ch][sample] = v;                                                \
-    else                                                                    \
-        out[0][sample * channels + ch] = v;                                 \
-}
-
-PUT_FUNC(u8,  AV_SAMPLE_FMT_U8,  uint8_t, av_clip_uint8 ( lrint(v_dbl * (1  <<  7)) + 128))
-PUT_FUNC(s16, AV_SAMPLE_FMT_S16, int16_t, av_clip_int16 ( lrint(v_dbl * (1  << 15))))
-PUT_FUNC(s32, AV_SAMPLE_FMT_S32, int32_t, av_clipl_int32(llrint(v_dbl * (1U << 31))))
-PUT_FUNC(flt, AV_SAMPLE_FMT_FLT, float,   v_dbl)
-PUT_FUNC(dbl, AV_SAMPLE_FMT_DBL, double,  v_dbl)
-
-static void put_sample(void **data, enum AVSampleFormat sample_fmt,
-                       int channels, int sample, int ch, double v_dbl)
-{
-    switch (av_get_packed_sample_fmt(sample_fmt)) {
-    case AV_SAMPLE_FMT_U8:
-        put_sample_u8(data, sample_fmt, channels, sample, ch, v_dbl);
-        break;
-    case AV_SAMPLE_FMT_S16:
-        put_sample_s16(data, sample_fmt, channels, sample, ch, v_dbl);
-        break;
-    case AV_SAMPLE_FMT_S32:
-        put_sample_s32(data, sample_fmt, channels, sample, ch, v_dbl);
-        break;
-    case AV_SAMPLE_FMT_FLT:
-        put_sample_flt(data, sample_fmt, channels, sample, ch, v_dbl);
-        break;
-    case AV_SAMPLE_FMT_DBL:
-        put_sample_dbl(data, sample_fmt, channels, sample, ch, v_dbl);
-        break;
-    }
-}
-
-static void audiogen(AVLFG *rnd, void **data, enum AVSampleFormat sample_fmt,
-                     int channels, int sample_rate, int nb_samples)
-{
-    int i, ch, k;
-    double v, f, a, ampa;
-    double tabf1[AVRESAMPLE_MAX_CHANNELS];
-    double tabf2[AVRESAMPLE_MAX_CHANNELS];
-    double taba[AVRESAMPLE_MAX_CHANNELS];
-
-#define PUT_SAMPLE put_sample(data, sample_fmt, channels, k, ch, v);
-
-    k = 0;
-
-    /* 1 second of single freq sine at 1000 Hz */
-    a = 0;
-    for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {
-        v = sin(a) * 0.30;
-        for (ch = 0; ch < channels; ch++)
-            PUT_SAMPLE
-        a += M_PI * 1000.0 * 2.0 / sample_rate;
-    }
-
-    /* 1 second of varying frequency between 100 and 10000 Hz */
-    a = 0;
-    for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {
-        v = sin(a) * 0.30;
-        for (ch = 0; ch < channels; ch++)
-            PUT_SAMPLE
-        f  = 100.0 + (((10000.0 - 100.0) * i) / sample_rate);
-        a += M_PI * f * 2.0 / sample_rate;
-    }
-
-    /* 0.5 second of low amplitude white noise */
-    for (i = 0; i < sample_rate / 2 && k < nb_samples; i++, k++) {
-        v = dbl_rand(rnd) * 0.30;
-        for (ch = 0; ch < channels; ch++)
-            PUT_SAMPLE
-    }
-
-    /* 0.5 second of high amplitude white noise */
-    for (i = 0; i < sample_rate / 2 && k < nb_samples; i++, k++) {
-        v = dbl_rand(rnd);
-        for (ch = 0; ch < channels; ch++)
-            PUT_SAMPLE
-    }
-
-    /* 1 second of unrelated ramps for each channel */
-    for (ch = 0; ch < channels; ch++) {
-        taba[ch]  = 0;
-        tabf1[ch] = 100 + av_lfg_get(rnd) % 5000;
-        tabf2[ch] = 100 + av_lfg_get(rnd) % 5000;
-    }
-    for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {
-        for (ch = 0; ch < channels; ch++) {
-            v = sin(taba[ch]) * 0.30;
-            PUT_SAMPLE
-            f = tabf1[ch] + (((tabf2[ch] - tabf1[ch]) * i) / sample_rate);
-            taba[ch] += M_PI * f * 2.0 / sample_rate;
-        }
-    }
-
-    /* 2 seconds of 500 Hz with varying volume */
-    a    = 0;
-    ampa = 0;
-    for (i = 0; i < 2 * sample_rate && k < nb_samples; i++, k++) {
-        for (ch = 0; ch < channels; ch++) {
-            double amp = (1.0 + sin(ampa)) * 0.15;
-            if (ch & 1)
-                amp = 0.30 - amp;
-            v = sin(a) * amp;
-            PUT_SAMPLE
-            a    += M_PI * 500.0 * 2.0 / sample_rate;
-            ampa += M_PI *  2.0 / sample_rate;
-        }
-    }
-}
-
-/* formats, rates, and layouts are ordered for priority in testing.
-   e.g. 'avresample-test 4 2 2' will test all input/output combinations of
-   S16/FLTP/S16P/FLT, 48000/44100, and stereo/mono */
-
-static const enum AVSampleFormat formats[] = {
-    AV_SAMPLE_FMT_S16,
-    AV_SAMPLE_FMT_FLTP,
-    AV_SAMPLE_FMT_S16P,
-    AV_SAMPLE_FMT_FLT,
-    AV_SAMPLE_FMT_S32P,
-    AV_SAMPLE_FMT_S32,
-    AV_SAMPLE_FMT_U8P,
-    AV_SAMPLE_FMT_U8,
-    AV_SAMPLE_FMT_DBLP,
-    AV_SAMPLE_FMT_DBL,
-};
-
-static const int rates[] = {
-    48000,
-    44100,
-    16000
-};
-
-static const uint64_t layouts[] = {
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_MONO,
-    AV_CH_LAYOUT_5POINT1,
-    AV_CH_LAYOUT_7POINT1,
-};
-
-int main(int argc, char **argv)
-{
-    AVAudioResampleContext *s;
-    AVLFG rnd;
-    int ret = 0;
-    uint8_t *in_buf = NULL;
-    uint8_t *out_buf = NULL;
-    unsigned int in_buf_size;
-    unsigned int out_buf_size;
-    uint8_t  *in_data[AVRESAMPLE_MAX_CHANNELS] = { 0 };
-    uint8_t *out_data[AVRESAMPLE_MAX_CHANNELS] = { 0 };
-    int in_linesize;
-    int out_linesize;
-    uint64_t in_ch_layout;
-    int in_channels;
-    enum AVSampleFormat in_fmt;
-    int in_rate;
-    uint64_t out_ch_layout;
-    int out_channels;
-    enum AVSampleFormat out_fmt;
-    int out_rate;
-    int num_formats, num_rates, num_layouts;
-    int i, j, k, l, m, n;
-
-    num_formats = 2;
-    num_rates   = 2;
-    num_layouts = 2;
-    if (argc > 1) {
-        if (!av_strncasecmp(argv[1], "-h", 3)) {
-            av_log(NULL, AV_LOG_INFO, "Usage: avresample-test [<num formats> "
-                   "[<num sample rates> [<num channel layouts>]]]\n"
-                   "Default is 2 2 2\n");
-            return 0;
-        }
-        num_formats = strtol(argv[1], NULL, 0);
-        num_formats = av_clip(num_formats, 1, FF_ARRAY_ELEMS(formats));
-    }
-    if (argc > 2) {
-        num_rates = strtol(argv[2], NULL, 0);
-        num_rates = av_clip(num_rates, 1, FF_ARRAY_ELEMS(rates));
-    }
-    if (argc > 3) {
-        num_layouts = strtol(argv[3], NULL, 0);
-        num_layouts = av_clip(num_layouts, 1, FF_ARRAY_ELEMS(layouts));
-    }
-
-    av_log_set_level(AV_LOG_DEBUG);
-
-    av_lfg_init(&rnd, 0xC0FFEE);
-
-    in_buf_size = av_samples_get_buffer_size(&in_linesize, 8, 48000 * 6,
-                                             AV_SAMPLE_FMT_DBLP, 0);
-    out_buf_size = in_buf_size;
-
-    in_buf = av_malloc(in_buf_size);
-    if (!in_buf)
-        goto end;
-    out_buf = av_malloc(out_buf_size);
-    if (!out_buf)
-        goto end;
-
-    s = avresample_alloc_context();
-    if (!s) {
-        av_log(NULL, AV_LOG_ERROR, "Error allocating AVAudioResampleContext\n");
-        ret = 1;
-        goto end;
-    }
-
-    for (i = 0; i < num_formats; i++) {
-        in_fmt = formats[i];
-        for (k = 0; k < num_layouts; k++) {
-            in_ch_layout = layouts[k];
-            in_channels  = av_get_channel_layout_nb_channels(in_ch_layout);
-            for (m = 0; m < num_rates; m++) {
-                in_rate = rates[m];
-
-                ret = av_samples_fill_arrays(in_data, &in_linesize, in_buf,
-                                             in_channels, in_rate * 6,
-                                             in_fmt, 0);
-                if (ret < 0) {
-                    av_log(s, AV_LOG_ERROR, "failed in_data fill arrays\n");
-                    goto end;
-                }
-                audiogen(&rnd, (void **)in_data, in_fmt, in_channels, in_rate, in_rate * 6);
-
-                for (j = 0; j < num_formats; j++) {
-                    out_fmt = formats[j];
-                    for (l = 0; l < num_layouts; l++) {
-                        out_ch_layout = layouts[l];
-                        out_channels  = av_get_channel_layout_nb_channels(out_ch_layout);
-                        for (n = 0; n < num_rates; n++) {
-                            out_rate = rates[n];
-
-                            av_log(NULL, AV_LOG_INFO, "%s to %s, %d to %d channels, %d Hz to %d Hz\n",
-                                   av_get_sample_fmt_name(in_fmt), av_get_sample_fmt_name(out_fmt),
-                                   in_channels, out_channels, in_rate, out_rate);
-
-                            ret = av_samples_fill_arrays(out_data, &out_linesize,
-                                                         out_buf, out_channels,
-                                                         out_rate * 6, out_fmt, 0);
-                            if (ret < 0) {
-                                av_log(s, AV_LOG_ERROR, "failed out_data fill arrays\n");
-                                goto end;
-                            }
-
-                            av_opt_set_int(s, "in_channel_layout",  in_ch_layout,  0);
-                            av_opt_set_int(s, "in_sample_fmt",      in_fmt,        0);
-                            av_opt_set_int(s, "in_sample_rate",     in_rate,       0);
-                            av_opt_set_int(s, "out_channel_layout", out_ch_layout, 0);
-                            av_opt_set_int(s, "out_sample_fmt",     out_fmt,       0);
-                            av_opt_set_int(s, "out_sample_rate",    out_rate,      0);
-
-                            av_opt_set_int(s, "internal_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
-
-                            ret = avresample_open(s);
-                            if (ret < 0) {
-                                av_log(s, AV_LOG_ERROR, "Error opening context\n");
-                                goto end;
-                            }
-
-                            ret = avresample_convert(s, out_data, out_linesize, out_rate * 6,
-                                                         in_data,  in_linesize,  in_rate * 6);
-                            if (ret < 0) {
-                                char errbuf[256];
-                                av_strerror(ret, errbuf, sizeof(errbuf));
-                                av_log(NULL, AV_LOG_ERROR, "%s\n", errbuf);
-                                goto end;
-                            }
-                            av_log(NULL, AV_LOG_INFO, "Converted %d samples to %d samples\n",
-                                   in_rate * 6, ret);
-                            if (avresample_get_delay(s) > 0)
-                                av_log(NULL, AV_LOG_INFO, "%d delay samples not converted\n",
-                                       avresample_get_delay(s));
-                            if (avresample_available(s) > 0)
-                                av_log(NULL, AV_LOG_INFO, "%d samples available for output\n",
-                                       avresample_available(s));
-                            av_log(NULL, AV_LOG_INFO, "\n");
-
-                            avresample_close(s);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    ret = 0;
-
-end:
-    av_freep(&in_buf);
-    av_freep(&out_buf);
-    avresample_free(&s);
-    return ret;
-}
diff --git a/deps/libav/libavresample/avresample.h b/deps/libav/libavresample/avresample.h
deleted file mode 100644
index d26f2ca..0000000
--- a/deps/libav/libavresample/avresample.h
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVRESAMPLE_AVRESAMPLE_H
-#define AVRESAMPLE_AVRESAMPLE_H
-
-/**
- * @file
- * @ingroup lavr
- * external API header
- */
-
-/**
- * @defgroup lavr Libavresample
- * @{
- *
- * Libavresample (lavr) is a library that handles audio resampling, sample
- * format conversion and mixing.
- *
- * Interaction with lavr is done through AVAudioResampleContext, which is
- * allocated with avresample_alloc_context(). It is opaque, so all parameters
- * must be set with the @ref avoptions API.
- *
- * For example the following code will setup conversion from planar float sample
- * format to interleaved signed 16-bit integer, downsampling from 48kHz to
- * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
- * matrix):
- * @code
- * AVAudioResampleContext *avr = avresample_alloc_context();
- * av_opt_set_int(avr, "in_channel_layout",  AV_CH_LAYOUT_5POINT1, 0);
- * av_opt_set_int(avr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
- * av_opt_set_int(avr, "in_sample_rate",     48000,                0);
- * av_opt_set_int(avr, "out_sample_rate",    44100,                0);
- * av_opt_set_int(avr, "in_sample_fmt",      AV_SAMPLE_FMT_FLTP,   0);
- * av_opt_set_int(avr, "out_sample_fmt",     AV_SAMPLE_FMT_S16,    0);
- * @endcode
- *
- * Once the context is initialized, it must be opened with avresample_open(). If
- * you need to change the conversion parameters, you must close the context with
- * avresample_close(), change the parameters as described above, then reopen it
- * again.
- *
- * The conversion itself is done by repeatedly calling avresample_convert().
- * Note that the samples may get buffered in two places in lavr. The first one
- * is the output FIFO, where the samples end up if the output buffer is not
- * large enough. The data stored in there may be retrieved at any time with
- * avresample_read(). The second place is the resampling delay buffer,
- * applicable only when resampling is done. The samples in it require more input
- * before they can be processed. Their current amount is returned by
- * avresample_get_delay(). At the end of conversion the resampling buffer can be
- * flushed by calling avresample_convert() with NULL input.
- *
- * The following code demonstrates the conversion loop assuming the parameters
- * from above and caller-defined functions get_input() and handle_output():
- * @code
- * uint8_t **input;
- * int in_linesize, in_samples;
- *
- * while (get_input(&input, &in_linesize, &in_samples)) {
- *     uint8_t *output
- *     int out_linesize;
- *     int out_samples = avresample_available(avr) +
- *                       av_rescale_rnd(avresample_get_delay(avr) +
- *                                      in_samples, 44100, 48000, AV_ROUND_UP);
- *     av_samples_alloc(&output, &out_linesize, 2, out_samples,
- *                      AV_SAMPLE_FMT_S16, 0);
- *     out_samples = avresample_convert(avr, &output, out_linesize, out_samples,
- *                                      input, in_linesize, in_samples);
- *     handle_output(output, out_linesize, out_samples);
- *     av_freep(&output);
- *  }
- *  @endcode
- *
- *  When the conversion is finished and the FIFOs are flushed if required, the
- *  conversion context and everything associated with it must be freed with
- *  avresample_free().
- */
-
-#include "libavutil/avutil.h"
-#include "libavutil/channel_layout.h"
-#include "libavutil/dict.h"
-#include "libavutil/log.h"
-
-#include "libavresample/version.h"
-
-#define AVRESAMPLE_MAX_CHANNELS 32
-
-typedef struct AVAudioResampleContext AVAudioResampleContext;
-
-/** Mixing Coefficient Types */
-enum AVMixCoeffType {
-    AV_MIX_COEFF_TYPE_Q8,   /** 16-bit 8.8 fixed-point                      */
-    AV_MIX_COEFF_TYPE_Q15,  /** 32-bit 17.15 fixed-point                    */
-    AV_MIX_COEFF_TYPE_FLT,  /** floating-point                              */
-    AV_MIX_COEFF_TYPE_NB,   /** Number of coeff types. Not part of ABI      */
-};
-
-/** Resampling Filter Types */
-enum AVResampleFilterType {
-    AV_RESAMPLE_FILTER_TYPE_CUBIC,              /**< Cubic */
-    AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL,   /**< Blackman Nuttall Windowed Sinc */
-    AV_RESAMPLE_FILTER_TYPE_KAISER,             /**< Kaiser Windowed Sinc */
-};
-
-enum AVResampleDitherMethod {
-    AV_RESAMPLE_DITHER_NONE,            /**< Do not use dithering */
-    AV_RESAMPLE_DITHER_RECTANGULAR,     /**< Rectangular Dither */
-    AV_RESAMPLE_DITHER_TRIANGULAR,      /**< Triangular Dither*/
-    AV_RESAMPLE_DITHER_TRIANGULAR_HP,   /**< Triangular Dither with High Pass */
-    AV_RESAMPLE_DITHER_TRIANGULAR_NS,   /**< Triangular Dither with Noise Shaping */
-    AV_RESAMPLE_DITHER_NB,              /**< Number of dither types. Not part of ABI. */
-};
-
-/**
- * Return the LIBAVRESAMPLE_VERSION_INT constant.
- */
-unsigned avresample_version(void);
-
-/**
- * Return the libavresample build-time configuration.
- * @return  configure string
- */
-const char *avresample_configuration(void);
-
-/**
- * Return the libavresample license.
- */
-const char *avresample_license(void);
-
-/**
- * Get the AVClass for AVAudioResampleContext.
- *
- * Can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options
- * without allocating a context.
- *
- * @see av_opt_find().
- *
- * @return AVClass for AVAudioResampleContext
- */
-const AVClass *avresample_get_class(void);
-
-/**
- * Allocate AVAudioResampleContext and set options.
- *
- * @return  allocated audio resample context, or NULL on failure
- */
-AVAudioResampleContext *avresample_alloc_context(void);
-
-/**
- * Initialize AVAudioResampleContext.
- *
- * @param avr  audio resample context
- * @return     0 on success, negative AVERROR code on failure
- */
-int avresample_open(AVAudioResampleContext *avr);
-
-/**
- * Close AVAudioResampleContext.
- *
- * This closes the context, but it does not change the parameters. The context
- * can be reopened with avresample_open(). It does, however, clear the output
- * FIFO and any remaining leftover samples in the resampling delay buffer. If
- * there was a custom matrix being used, that is also cleared.
- *
- * @see avresample_convert()
- * @see avresample_set_matrix()
- *
- * @param avr  audio resample context
- */
-void avresample_close(AVAudioResampleContext *avr);
-
-/**
- * Free AVAudioResampleContext and associated AVOption values.
- *
- * This also calls avresample_close() before freeing.
- *
- * @param avr  audio resample context
- */
-void avresample_free(AVAudioResampleContext **avr);
-
-/**
- * Generate a channel mixing matrix.
- *
- * This function is the one used internally by libavresample for building the
- * default mixing matrix. It is made public just as a utility function for
- * building custom matrices.
- *
- * @param in_layout           input channel layout
- * @param out_layout          output channel layout
- * @param center_mix_level    mix level for the center channel
- * @param surround_mix_level  mix level for the surround channel(s)
- * @param lfe_mix_level       mix level for the low-frequency effects channel
- * @param normalize           if 1, coefficients will be normalized to prevent
- *                            overflow. if 0, coefficients will not be
- *                            normalized.
- * @param[out] matrix         mixing coefficients; matrix[i + stride * o] is
- *                            the weight of input channel i in output channel o.
- * @param stride              distance between adjacent input channels in the
- *                            matrix array
- * @param matrix_encoding     matrixed stereo downmix mode (e.g. dplii)
- * @return                    0 on success, negative AVERROR code on failure
- */
-int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
-                            double center_mix_level, double surround_mix_level,
-                            double lfe_mix_level, int normalize, double *matrix,
-                            int stride, enum AVMatrixEncoding matrix_encoding);
-
-/**
- * Get the current channel mixing matrix.
- *
- * If no custom matrix has been previously set or the AVAudioResampleContext is
- * not open, an error is returned.
- *
- * @param avr     audio resample context
- * @param matrix  mixing coefficients; matrix[i + stride * o] is the weight of
- *                input channel i in output channel o.
- * @param stride  distance between adjacent input channels in the matrix array
- * @return        0 on success, negative AVERROR code on failure
- */
-int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
-                          int stride);
-
-/**
- * Set channel mixing matrix.
- *
- * Allows for setting a custom mixing matrix, overriding the default matrix
- * generated internally during avresample_open(). This function can be called
- * anytime on an allocated context, either before or after calling
- * avresample_open(), as long as the channel layouts have been set.
- * avresample_convert() always uses the current matrix.
- * Calling avresample_close() on the context will clear the current matrix.
- *
- * @see avresample_close()
- *
- * @param avr     audio resample context
- * @param matrix  mixing coefficients; matrix[i + stride * o] is the weight of
- *                input channel i in output channel o.
- * @param stride  distance between adjacent input channels in the matrix array
- * @return        0 on success, negative AVERROR code on failure
- */
-int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
-                          int stride);
-
-/**
- * Set a customized input channel mapping.
- *
- * This function can only be called when the allocated context is not open.
- * Also, the input channel layout must have already been set.
- *
- * Calling avresample_close() on the context will clear the channel mapping.
- *
- * The map for each input channel specifies the channel index in the source to
- * use for that particular channel, or -1 to mute the channel. Source channels
- * can be duplicated by using the same index for multiple input channels.
- *
- * Examples:
- *
- * Reordering 5.1 AAC order (C,L,R,Ls,Rs,LFE) to Libav order (L,R,C,LFE,Ls,Rs):
- * { 1, 2, 0, 5, 3, 4 }
- *
- * Muting the 3rd channel in 4-channel input:
- * { 0, 1, -1, 3 }
- *
- * Duplicating the left channel of stereo input:
- * { 0, 0 }
- *
- * @param avr         audio resample context
- * @param channel_map customized input channel mapping
- * @return            0 on success, negative AVERROR code on failure
- */
-int avresample_set_channel_mapping(AVAudioResampleContext *avr,
-                                   const int *channel_map);
-
-/**
- * Set compensation for resampling.
- *
- * This can be called anytime after avresample_open(). If resampling is not
- * automatically enabled because of a sample rate conversion, the
- * "force_resampling" option must have been set to 1 when opening the context
- * in order to use resampling compensation.
- *
- * @param avr                    audio resample context
- * @param sample_delta           compensation delta, in samples
- * @param compensation_distance  compensation distance, in samples
- * @return                       0 on success, negative AVERROR code on failure
- */
-int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
-                                int compensation_distance);
-
-/**
- * Convert input samples and write them to the output FIFO.
- *
- * The upper bound on the number of output samples is given by
- * avresample_available() + (avresample_get_delay() + number of input samples) *
- * output sample rate / input sample rate.
- *
- * The output data can be NULL or have fewer allocated samples than required.
- * In this case, any remaining samples not written to the output will be added
- * to an internal FIFO buffer, to be returned at the next call to this function
- * or to avresample_read().
- *
- * If converting sample rate, there may be data remaining in the internal
- * resampling delay buffer. avresample_get_delay() tells the number of remaining
- * samples. To get this data as output, call avresample_convert() with NULL
- * input.
- *
- * At the end of the conversion process, there may be data remaining in the
- * internal FIFO buffer. avresample_available() tells the number of remaining
- * samples. To get this data as output, either call avresample_convert() with
- * NULL input or call avresample_read().
- *
- * @see avresample_available()
- * @see avresample_read()
- * @see avresample_get_delay()
- *
- * @param avr             audio resample context
- * @param output          output data pointers
- * @param out_plane_size  output plane size, in bytes.
- *                        This can be 0 if unknown, but that will lead to
- *                        optimized functions not being used directly on the
- *                        output, which could slow down some conversions.
- * @param out_samples     maximum number of samples that the output buffer can hold
- * @param input           input data pointers
- * @param in_plane_size   input plane size, in bytes
- *                        This can be 0 if unknown, but that will lead to
- *                        optimized functions not being used directly on the
- *                        input, which could slow down some conversions.
- * @param in_samples      number of input samples to convert
- * @return                number of samples written to the output buffer,
- *                        not including converted samples added to the internal
- *                        output FIFO
- */
-int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
-                       int out_plane_size, int out_samples, uint8_t **input,
-                       int in_plane_size, int in_samples);
-
-/**
- * Return the number of samples currently in the resampling delay buffer.
- *
- * When resampling, there may be a delay between the input and output. Any
- * unconverted samples in each call are stored internally in a delay buffer.
- * This function allows the user to determine the current number of samples in
- * the delay buffer, which can be useful for synchronization.
- *
- * @see avresample_convert()
- *
- * @param avr  audio resample context
- * @return     number of samples currently in the resampling delay buffer
- */
-int avresample_get_delay(AVAudioResampleContext *avr);
-
-/**
- * Return the number of available samples in the output FIFO.
- *
- * During conversion, if the user does not specify an output buffer or
- * specifies an output buffer that is smaller than what is needed, remaining
- * samples that are not written to the output are stored to an internal FIFO
- * buffer. The samples in the FIFO can be read with avresample_read() or
- * avresample_convert().
- *
- * @see avresample_read()
- * @see avresample_convert()
- *
- * @param avr  audio resample context
- * @return     number of samples available for reading
- */
-int avresample_available(AVAudioResampleContext *avr);
-
-/**
- * Read samples from the output FIFO.
- *
- * During conversion, if the user does not specify an output buffer or
- * specifies an output buffer that is smaller than what is needed, remaining
- * samples that are not written to the output are stored to an internal FIFO
- * buffer. This function can be used to read samples from that internal FIFO.
- *
- * @see avresample_available()
- * @see avresample_convert()
- *
- * @param avr         audio resample context
- * @param output      output data pointers. May be NULL, in which case
- *                    nb_samples of data is discarded from output FIFO.
- * @param nb_samples  number of samples to read from the FIFO
- * @return            the number of samples written to output
- */
-int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples);
-
-/**
- * @}
- */
-
-#endif /* AVRESAMPLE_AVRESAMPLE_H */
diff --git a/deps/libav/libavresample/dither.c b/deps/libav/libavresample/dither.c
deleted file mode 100644
index 17de829..0000000
--- a/deps/libav/libavresample/dither.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * Triangular with Noise Shaping is based on opusfile.
- * Copyright (c) 1994-2012 by the Xiph.Org Foundation and contributors
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Dithered Audio Sample Quantization
- *
- * Converts from dbl, flt, or s32 to s16 using dithering.
- */
-
-#include <math.h>
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/common.h"
-#include "libavutil/lfg.h"
-#include "libavutil/mem.h"
-#include "libavutil/samplefmt.h"
-#include "audio_convert.h"
-#include "dither.h"
-#include "internal.h"
-
-typedef struct DitherState {
-    int mute;
-    unsigned int seed;
-    AVLFG lfg;
-    float *noise_buf;
-    int noise_buf_size;
-    int noise_buf_ptr;
-    float dither_a[4];
-    float dither_b[4];
-} DitherState;
-
-struct DitherContext {
-    DitherDSPContext  ddsp;
-    enum AVResampleDitherMethod method;
-    int apply_map;
-    ChannelMapInfo *ch_map_info;
-
-    int mute_dither_threshold;  // threshold for disabling dither
-    int mute_reset_threshold;   // threshold for resetting noise shaping
-    const float *ns_coef_b;     // noise shaping coeffs
-    const float *ns_coef_a;     // noise shaping coeffs
-
-    int channels;
-    DitherState *state;         // dither states for each channel
-
-    AudioData *flt_data;        // input data in fltp
-    AudioData *s16_data;        // dithered output in s16p
-    AudioConvert *ac_in;        // converter for input to fltp
-    AudioConvert *ac_out;       // converter for s16p to s16 (if needed)
-
-    void (*quantize)(int16_t *dst, const float *src, float *dither, int len);
-    int samples_align;
-};
-
-/* mute threshold, in seconds */
-#define MUTE_THRESHOLD_SEC 0.000333
-
-/* scale factor for 16-bit output.
-   The signal is attenuated slightly to avoid clipping */
-#define S16_SCALE 32753.0f
-
-/* scale to convert lfg from INT_MIN/INT_MAX to -0.5/0.5 */
-#define LFG_SCALE (1.0f / (2.0f * INT32_MAX))
-
-/* noise shaping coefficients */
-
-static const float ns_48_coef_b[4] = {
-    2.2374f, -0.7339f, -0.1251f, -0.6033f
-};
-
-static const float ns_48_coef_a[4] = {
-    0.9030f, 0.0116f, -0.5853f, -0.2571f
-};
-
-static const float ns_44_coef_b[4] = {
-    2.2061f, -0.4707f, -0.2534f, -0.6213f
-};
-
-static const float ns_44_coef_a[4] = {
-    1.0587f, 0.0676f, -0.6054f, -0.2738f
-};
-
-static void dither_int_to_float_rectangular_c(float *dst, int *src, int len)
-{
-    int i;
-    for (i = 0; i < len; i++)
-        dst[i] = src[i] * LFG_SCALE;
-}
-
-static void dither_int_to_float_triangular_c(float *dst, int *src0, int len)
-{
-    int i;
-    int *src1  = src0 + len;
-
-    for (i = 0; i < len; i++) {
-        float r = src0[i] * LFG_SCALE;
-        r      += src1[i] * LFG_SCALE;
-        dst[i]  = r;
-    }
-}
-
-static void quantize_c(int16_t *dst, const float *src, float *dither, int len)
-{
-    int i;
-    for (i = 0; i < len; i++)
-        dst[i] = av_clip_int16(lrintf(src[i] * S16_SCALE + dither[i]));
-}
-
-#define SQRT_1_6 0.40824829046386301723f
-
-static void dither_highpass_filter(float *src, int len)
-{
-    int i;
-
-    /* filter is from libswresample in FFmpeg */
-    for (i = 0; i < len - 2; i++)
-        src[i] = (-src[i] + 2 * src[i + 1] - src[i + 2]) * SQRT_1_6;
-}
-
-static int generate_dither_noise(DitherContext *c, DitherState *state,
-                                 int min_samples)
-{
-    int i;
-    int nb_samples  = FFALIGN(min_samples, 16) + 16;
-    int buf_samples = nb_samples *
-                      (c->method == AV_RESAMPLE_DITHER_RECTANGULAR ? 1 : 2);
-    unsigned int *noise_buf_ui;
-
-    av_freep(&state->noise_buf);
-    state->noise_buf_size = state->noise_buf_ptr = 0;
-
-    state->noise_buf = av_malloc(buf_samples * sizeof(*state->noise_buf));
-    if (!state->noise_buf)
-        return AVERROR(ENOMEM);
-    state->noise_buf_size = FFALIGN(min_samples, 16);
-    noise_buf_ui          = (unsigned int *)state->noise_buf;
-
-    av_lfg_init(&state->lfg, state->seed);
-    for (i = 0; i < buf_samples; i++)
-        noise_buf_ui[i] = av_lfg_get(&state->lfg);
-
-    c->ddsp.dither_int_to_float(state->noise_buf, noise_buf_ui, nb_samples);
-
-    if (c->method == AV_RESAMPLE_DITHER_TRIANGULAR_HP)
-        dither_highpass_filter(state->noise_buf, nb_samples);
-
-    return 0;
-}
-
-static void quantize_triangular_ns(DitherContext *c, DitherState *state,
-                                   int16_t *dst, const float *src,
-                                   int nb_samples)
-{
-    int i, j;
-    float *dither = &state->noise_buf[state->noise_buf_ptr];
-
-    if (state->mute > c->mute_reset_threshold)
-        memset(state->dither_a, 0, sizeof(state->dither_a));
-
-    for (i = 0; i < nb_samples; i++) {
-        float err = 0;
-        float sample = src[i] * S16_SCALE;
-
-        for (j = 0; j < 4; j++) {
-            err += c->ns_coef_b[j] * state->dither_b[j] -
-                   c->ns_coef_a[j] * state->dither_a[j];
-        }
-        for (j = 3; j > 0; j--) {
-            state->dither_a[j] = state->dither_a[j - 1];
-            state->dither_b[j] = state->dither_b[j - 1];
-        }
-        state->dither_a[0] = err;
-        sample -= err;
-
-        if (state->mute > c->mute_dither_threshold) {
-            dst[i]             = av_clip_int16(lrintf(sample));
-            state->dither_b[0] = 0;
-        } else {
-            dst[i]             = av_clip_int16(lrintf(sample + dither[i]));
-            state->dither_b[0] = av_clipf(dst[i] - sample, -1.5f, 1.5f);
-        }
-
-        state->mute++;
-        if (src[i])
-            state->mute = 0;
-    }
-}
-
-static int convert_samples(DitherContext *c, int16_t **dst, float * const *src,
-                           int channels, int nb_samples)
-{
-    int ch, ret;
-    int aligned_samples = FFALIGN(nb_samples, 16);
-
-    for (ch = 0; ch < channels; ch++) {
-        DitherState *state = &c->state[ch];
-
-        if (state->noise_buf_size < aligned_samples) {
-            ret = generate_dither_noise(c, state, nb_samples);
-            if (ret < 0)
-                return ret;
-        } else if (state->noise_buf_size - state->noise_buf_ptr < aligned_samples) {
-            state->noise_buf_ptr = 0;
-        }
-
-        if (c->method == AV_RESAMPLE_DITHER_TRIANGULAR_NS) {
-            quantize_triangular_ns(c, state, dst[ch], src[ch], nb_samples);
-        } else {
-            c->quantize(dst[ch], src[ch],
-                        &state->noise_buf[state->noise_buf_ptr],
-                        FFALIGN(nb_samples, c->samples_align));
-        }
-
-        state->noise_buf_ptr += aligned_samples;
-    }
-
-    return 0;
-}
-
-int ff_convert_dither(DitherContext *c, AudioData *dst, AudioData *src)
-{
-    int ret;
-    AudioData *flt_data;
-
-    /* output directly to dst if it is planar */
-    if (dst->sample_fmt == AV_SAMPLE_FMT_S16P)
-        c->s16_data = dst;
-    else {
-        /* make sure s16_data is large enough for the output */
-        ret = ff_audio_data_realloc(c->s16_data, src->nb_samples);
-        if (ret < 0)
-            return ret;
-    }
-
-    if (src->sample_fmt != AV_SAMPLE_FMT_FLTP || c->apply_map) {
-        /* make sure flt_data is large enough for the input */
-        ret = ff_audio_data_realloc(c->flt_data, src->nb_samples);
-        if (ret < 0)
-            return ret;
-        flt_data = c->flt_data;
-    }
-
-    if (src->sample_fmt != AV_SAMPLE_FMT_FLTP) {
-        /* convert input samples to fltp and scale to s16 range */
-        ret = ff_audio_convert(c->ac_in, flt_data, src);
-        if (ret < 0)
-            return ret;
-    } else if (c->apply_map) {
-        ret = ff_audio_data_copy(flt_data, src, c->ch_map_info);
-        if (ret < 0)
-            return ret;
-    } else {
-        flt_data = src;
-    }
-
-    /* check alignment and padding constraints */
-    if (c->method != AV_RESAMPLE_DITHER_TRIANGULAR_NS) {
-        int ptr_align     = FFMIN(flt_data->ptr_align,     c->s16_data->ptr_align);
-        int samples_align = FFMIN(flt_data->samples_align, c->s16_data->samples_align);
-        int aligned_len   = FFALIGN(src->nb_samples, c->ddsp.samples_align);
-
-        if (!(ptr_align % c->ddsp.ptr_align) && samples_align >= aligned_len) {
-            c->quantize      = c->ddsp.quantize;
-            c->samples_align = c->ddsp.samples_align;
-        } else {
-            c->quantize      = quantize_c;
-            c->samples_align = 1;
-        }
-    }
-
-    ret = convert_samples(c, (int16_t **)c->s16_data->data,
-                          (float * const *)flt_data->data, src->channels,
-                          src->nb_samples);
-    if (ret < 0)
-        return ret;
-
-    c->s16_data->nb_samples = src->nb_samples;
-
-    /* interleave output to dst if needed */
-    if (dst->sample_fmt == AV_SAMPLE_FMT_S16) {
-        ret = ff_audio_convert(c->ac_out, dst, c->s16_data);
-        if (ret < 0)
-            return ret;
-    } else
-        c->s16_data = NULL;
-
-    return 0;
-}
-
-void ff_dither_free(DitherContext **cp)
-{
-    DitherContext *c = *cp;
-    int ch;
-
-    if (!c)
-        return;
-    ff_audio_data_free(&c->flt_data);
-    ff_audio_data_free(&c->s16_data);
-    ff_audio_convert_free(&c->ac_in);
-    ff_audio_convert_free(&c->ac_out);
-    for (ch = 0; ch < c->channels; ch++)
-        av_free(c->state[ch].noise_buf);
-    av_free(c->state);
-    av_freep(cp);
-}
-
-static av_cold void dither_init(DitherDSPContext *ddsp,
-                                enum AVResampleDitherMethod method)
-{
-    ddsp->quantize      = quantize_c;
-    ddsp->ptr_align     = 1;
-    ddsp->samples_align = 1;
-
-    if (method == AV_RESAMPLE_DITHER_RECTANGULAR)
-        ddsp->dither_int_to_float = dither_int_to_float_rectangular_c;
-    else
-        ddsp->dither_int_to_float = dither_int_to_float_triangular_c;
-
-    if (ARCH_X86)
-        ff_dither_init_x86(ddsp, method);
-}
-
-DitherContext *ff_dither_alloc(AVAudioResampleContext *avr,
-                               enum AVSampleFormat out_fmt,
-                               enum AVSampleFormat in_fmt,
-                               int channels, int sample_rate, int apply_map)
-{
-    AVLFG seed_gen;
-    DitherContext *c;
-    int ch;
-
-    if (av_get_packed_sample_fmt(out_fmt) != AV_SAMPLE_FMT_S16 ||
-        av_get_bytes_per_sample(in_fmt) <= 2) {
-        av_log(avr, AV_LOG_ERROR, "dithering %s to %s is not supported\n",
-               av_get_sample_fmt_name(in_fmt), av_get_sample_fmt_name(out_fmt));
-        return NULL;
-    }
-
-    c = av_mallocz(sizeof(*c));
-    if (!c)
-        return NULL;
-
-    c->apply_map = apply_map;
-    if (apply_map)
-        c->ch_map_info = &avr->ch_map_info;
-
-    if (avr->dither_method == AV_RESAMPLE_DITHER_TRIANGULAR_NS &&
-        sample_rate != 48000 && sample_rate != 44100) {
-        av_log(avr, AV_LOG_WARNING, "sample rate must be 48000 or 44100 Hz "
-               "for triangular_ns dither. using triangular_hp instead.\n");
-        avr->dither_method = AV_RESAMPLE_DITHER_TRIANGULAR_HP;
-    }
-    c->method = avr->dither_method;
-    dither_init(&c->ddsp, c->method);
-
-    if (c->method == AV_RESAMPLE_DITHER_TRIANGULAR_NS) {
-        if (sample_rate == 48000) {
-            c->ns_coef_b = ns_48_coef_b;
-            c->ns_coef_a = ns_48_coef_a;
-        } else {
-            c->ns_coef_b = ns_44_coef_b;
-            c->ns_coef_a = ns_44_coef_a;
-        }
-    }
-
-    /* Either s16 or s16p output format is allowed, but s16p is used
-       internally, so we need to use a temp buffer and interleave if the output
-       format is s16 */
-    if (out_fmt != AV_SAMPLE_FMT_S16P) {
-        c->s16_data = ff_audio_data_alloc(channels, 1024, AV_SAMPLE_FMT_S16P,
-                                          "dither s16 buffer");
-        if (!c->s16_data)
-            goto fail;
-
-        c->ac_out = ff_audio_convert_alloc(avr, out_fmt, AV_SAMPLE_FMT_S16P,
-                                           channels, sample_rate, 0);
-        if (!c->ac_out)
-            goto fail;
-    }
-
-    if (in_fmt != AV_SAMPLE_FMT_FLTP || c->apply_map) {
-        c->flt_data = ff_audio_data_alloc(channels, 1024, AV_SAMPLE_FMT_FLTP,
-                                          "dither flt buffer");
-        if (!c->flt_data)
-            goto fail;
-    }
-    if (in_fmt != AV_SAMPLE_FMT_FLTP) {
-        c->ac_in = ff_audio_convert_alloc(avr, AV_SAMPLE_FMT_FLTP, in_fmt,
-                                          channels, sample_rate, c->apply_map);
-        if (!c->ac_in)
-            goto fail;
-    }
-
-    c->state = av_mallocz(channels * sizeof(*c->state));
-    if (!c->state)
-        goto fail;
-    c->channels = channels;
-
-    /* calculate thresholds for turning off dithering during periods of
-       silence to avoid replacing digital silence with quiet dither noise */
-    c->mute_dither_threshold = lrintf(sample_rate * MUTE_THRESHOLD_SEC);
-    c->mute_reset_threshold  = c->mute_dither_threshold * 4;
-
-    /* initialize dither states */
-    av_lfg_init(&seed_gen, 0xC0FFEE);
-    for (ch = 0; ch < channels; ch++) {
-        DitherState *state = &c->state[ch];
-        state->mute = c->mute_reset_threshold + 1;
-        state->seed = av_lfg_get(&seed_gen);
-        generate_dither_noise(c, state, FFMAX(32768, sample_rate / 2));
-    }
-
-    return c;
-
-fail:
-    ff_dither_free(&c);
-    return NULL;
-}
diff --git a/deps/libav/libavresample/dither.h b/deps/libav/libavresample/dither.h
deleted file mode 100644
index 8db3714..0000000
--- a/deps/libav/libavresample/dither.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVRESAMPLE_DITHER_H
-#define AVRESAMPLE_DITHER_H
-
-#include "avresample.h"
-#include "audio_data.h"
-
-typedef struct DitherContext DitherContext;
-
-typedef struct DitherDSPContext {
-    /**
-     * Convert samples from flt to s16 with added dither noise.
-     *
-     * @param dst    destination float array, range -0.5 to 0.5
-     * @param src    source int array, range INT_MIN to INT_MAX.
-     * @param dither float dither noise array
-     * @param len    number of samples
-     */
-    void (*quantize)(int16_t *dst, const float *src, float *dither, int len);
-
-    int ptr_align;      ///< src and dst constraits for quantize()
-    int samples_align;  ///< len constraits for quantize()
-
-    /**
-     * Convert dither noise from int to float with triangular distribution.
-     *
-     * @param dst  destination float array, range -0.5 to 0.5
-     *             constraints: 32-byte aligned
-     * @param src0 source int array, range INT_MIN to INT_MAX.
-     *             the array size is len * 2
-     *             constraints: 32-byte aligned
-     * @param len  number of output noise samples
-     *             constraints: multiple of 16
-     */
-    void (*dither_int_to_float)(float *dst, int *src0, int len);
-} DitherDSPContext;
-
-/**
- * Allocate and initialize a DitherContext.
- *
- * The parameters in the AVAudioResampleContext are used to initialize the
- * DitherContext.
- *
- * @param avr  AVAudioResampleContext
- * @return     newly-allocated DitherContext
- */
-DitherContext *ff_dither_alloc(AVAudioResampleContext *avr,
-                               enum AVSampleFormat out_fmt,
-                               enum AVSampleFormat in_fmt,
-                               int channels, int sample_rate, int apply_map);
-
-/**
- * Free a DitherContext.
- *
- * @param c  DitherContext
- */
-void ff_dither_free(DitherContext **c);
-
-/**
- * Convert audio sample format with dithering.
- *
- * @param c    DitherContext
- * @param dst  destination audio data
- * @param src  source audio data
- * @return     0 if ok, negative AVERROR code on failure
- */
-int ff_convert_dither(DitherContext *c, AudioData *dst, AudioData *src);
-
-/* arch-specific initialization functions */
-
-void ff_dither_init_x86(DitherDSPContext *ddsp,
-                        enum AVResampleDitherMethod method);
-
-#endif /* AVRESAMPLE_DITHER_H */
diff --git a/deps/libav/libavresample/internal.h b/deps/libav/libavresample/internal.h
deleted file mode 100644
index 057f89a..0000000
--- a/deps/libav/libavresample/internal.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVRESAMPLE_INTERNAL_H
-#define AVRESAMPLE_INTERNAL_H
-
-#include "libavutil/audio_fifo.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/samplefmt.h"
-#include "avresample.h"
-
-typedef struct AudioData AudioData;
-typedef struct AudioConvert AudioConvert;
-typedef struct AudioMix AudioMix;
-typedef struct ResampleContext ResampleContext;
-
-enum RemapPoint {
-    REMAP_NONE,
-    REMAP_IN_COPY,
-    REMAP_IN_CONVERT,
-    REMAP_OUT_COPY,
-    REMAP_OUT_CONVERT,
-};
-
-typedef struct ChannelMapInfo {
-    int channel_map[AVRESAMPLE_MAX_CHANNELS];   /**< source index of each output channel, -1 if not remapped */
-    int do_remap;                               /**< remap needed */
-    int channel_copy[AVRESAMPLE_MAX_CHANNELS];  /**< dest index to copy from */
-    int do_copy;                                /**< copy needed */
-    int channel_zero[AVRESAMPLE_MAX_CHANNELS];  /**< dest index to zero */
-    int do_zero;                                /**< zeroing needed */
-    int input_map[AVRESAMPLE_MAX_CHANNELS];     /**< dest index of each input channel */
-} ChannelMapInfo;
-
-struct AVAudioResampleContext {
-    const AVClass *av_class;        /**< AVClass for logging and AVOptions  */
-
-    uint64_t in_channel_layout;                 /**< input channel layout   */
-    enum AVSampleFormat in_sample_fmt;          /**< input sample format    */
-    int in_sample_rate;                         /**< input sample rate      */
-    uint64_t out_channel_layout;                /**< output channel layout  */
-    enum AVSampleFormat out_sample_fmt;         /**< output sample format   */
-    int out_sample_rate;                        /**< output sample rate     */
-    enum AVSampleFormat internal_sample_fmt;    /**< internal sample format */
-    enum AVMixCoeffType mix_coeff_type;         /**< mixing coefficient type */
-    double center_mix_level;                    /**< center mix level       */
-    double surround_mix_level;                  /**< surround mix level     */
-    double lfe_mix_level;                       /**< lfe mix level          */
-    int normalize_mix_level;                    /**< enable mix level normalization */
-    int force_resampling;                       /**< force resampling       */
-    int filter_size;                            /**< length of each FIR filter in the resampling filterbank relative to the cutoff frequency */
-    int phase_shift;                            /**< log2 of the number of entries in the resampling polyphase filterbank */
-    int linear_interp;                          /**< if 1 then the resampling FIR filter will be linearly interpolated */
-    double cutoff;                              /**< resampling cutoff frequency. 1.0 corresponds to half the output sample rate */
-    enum AVResampleFilterType filter_type;      /**< resampling filter type */
-    int kaiser_beta;                            /**< beta value for Kaiser window (only applicable if filter_type == AV_FILTER_TYPE_KAISER) */
-    enum AVResampleDitherMethod dither_method;  /**< dither method          */
-
-    int in_channels;        /**< number of input channels                   */
-    int out_channels;       /**< number of output channels                  */
-    int resample_channels;  /**< number of channels used for resampling     */
-    int downmix_needed;     /**< downmixing is needed                       */
-    int upmix_needed;       /**< upmixing is needed                         */
-    int mixing_needed;      /**< either upmixing or downmixing is needed    */
-    int resample_needed;    /**< resampling is needed                       */
-    int in_convert_needed;  /**< input sample format conversion is needed   */
-    int out_convert_needed; /**< output sample format conversion is needed  */
-    int in_copy_needed;     /**< input data copy is needed                  */
-
-    AudioData *in_buffer;           /**< buffer for converted input         */
-    AudioData *resample_out_buffer; /**< buffer for output from resampler   */
-    AudioData *out_buffer;          /**< buffer for converted output        */
-    AVAudioFifo *out_fifo;          /**< FIFO for output samples            */
-
-    AudioConvert *ac_in;        /**< input sample format conversion context  */
-    AudioConvert *ac_out;       /**< output sample format conversion context */
-    ResampleContext *resample;  /**< resampling context                      */
-    AudioMix *am;               /**< channel mixing context                  */
-    enum AVMatrixEncoding matrix_encoding;      /**< matrixed stereo encoding */
-
-    /**
-     * mix matrix
-     * only used if avresample_set_matrix() is called before avresample_open()
-     */
-    double *mix_matrix;
-
-    int use_channel_map;
-    enum RemapPoint remap_point;
-    ChannelMapInfo ch_map_info;
-};
-
-#endif /* AVRESAMPLE_INTERNAL_H */
diff --git a/deps/libav/libavresample/libavresample.v b/deps/libav/libavresample/libavresample.v
deleted file mode 100644
index b8c7c7d..0000000
--- a/deps/libav/libavresample/libavresample.v
+++ /dev/null
@@ -1,4 +0,0 @@
-LIBAVRESAMPLE_$MAJOR {
-        global: av*;
-        local:  *;
-};
diff --git a/deps/libav/libavresample/options.c b/deps/libav/libavresample/options.c
deleted file mode 100644
index 6249f90..0000000
--- a/deps/libav/libavresample/options.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/mathematics.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-#include "avresample.h"
-#include "internal.h"
-#include "audio_mix.h"
-
-/**
- * @file
- * Options definition for AVAudioResampleContext.
- */
-
-#define OFFSET(x) offsetof(AVAudioResampleContext, x)
-#define PARAM AV_OPT_FLAG_AUDIO_PARAM
-
-static const AVOption avresample_options[] = {
-    { "in_channel_layout",      "Input Channel Layout",     OFFSET(in_channel_layout),      AV_OPT_TYPE_INT64,  { .i64 = 0              }, INT64_MIN,            INT64_MAX,              PARAM },
-    { "in_sample_fmt",          "Input Sample Format",      OFFSET(in_sample_fmt),          AV_OPT_TYPE_INT,    { .i64 = AV_SAMPLE_FMT_S16 }, AV_SAMPLE_FMT_U8,     AV_SAMPLE_FMT_NB-1,     PARAM },
-    { "in_sample_rate",         "Input Sample Rate",        OFFSET(in_sample_rate),         AV_OPT_TYPE_INT,    { .i64 = 48000          }, 1,                    INT_MAX,                PARAM },
-    { "out_channel_layout",     "Output Channel Layout",    OFFSET(out_channel_layout),     AV_OPT_TYPE_INT64,  { .i64 = 0              }, INT64_MIN,            INT64_MAX,              PARAM },
-    { "out_sample_fmt",         "Output Sample Format",     OFFSET(out_sample_fmt),         AV_OPT_TYPE_INT,    { .i64 = AV_SAMPLE_FMT_S16 }, AV_SAMPLE_FMT_U8,     AV_SAMPLE_FMT_NB-1,     PARAM },
-    { "out_sample_rate",        "Output Sample Rate",       OFFSET(out_sample_rate),        AV_OPT_TYPE_INT,    { .i64 = 48000          }, 1,                    INT_MAX,                PARAM },
-    { "internal_sample_fmt",    "Internal Sample Format",   OFFSET(internal_sample_fmt),    AV_OPT_TYPE_INT,    { .i64 = AV_SAMPLE_FMT_NONE }, AV_SAMPLE_FMT_NONE,   AV_SAMPLE_FMT_NB-1,     PARAM, "internal_sample_fmt" },
-        {"u8" ,  "8-bit unsigned integer",        0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_U8   }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-        {"s16",  "16-bit signed integer",         0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_S16  }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-        {"s32",  "32-bit signed integer",         0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_S32  }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-        {"flt",  "32-bit float",                  0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_FLT  }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-        {"dbl",  "64-bit double",                 0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_DBL  }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-        {"u8p" , "8-bit unsigned integer planar", 0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_U8P  }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-        {"s16p", "16-bit signed integer planar",  0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_S16P }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-        {"s32p", "32-bit signed integer planar",  0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_S32P }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-        {"fltp", "32-bit float planar",           0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_FLTP }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-        {"dblp", "64-bit double planar",          0, AV_OPT_TYPE_CONST, {.i64 = AV_SAMPLE_FMT_DBLP }, INT_MIN, INT_MAX, PARAM, "internal_sample_fmt"},
-    { "mix_coeff_type",         "Mixing Coefficient Type",  OFFSET(mix_coeff_type),         AV_OPT_TYPE_INT,    { .i64 = AV_MIX_COEFF_TYPE_FLT }, AV_MIX_COEFF_TYPE_Q8, AV_MIX_COEFF_TYPE_NB-1, PARAM, "mix_coeff_type" },
-        { "q8",  "16-bit 8.8 Fixed-Point",   0, AV_OPT_TYPE_CONST, { .i64 = AV_MIX_COEFF_TYPE_Q8  }, INT_MIN, INT_MAX, PARAM, "mix_coeff_type" },
-        { "q15", "32-bit 17.15 Fixed-Point", 0, AV_OPT_TYPE_CONST, { .i64 = AV_MIX_COEFF_TYPE_Q15 }, INT_MIN, INT_MAX, PARAM, "mix_coeff_type" },
-        { "flt", "Floating-Point",           0, AV_OPT_TYPE_CONST, { .i64 = AV_MIX_COEFF_TYPE_FLT }, INT_MIN, INT_MAX, PARAM, "mix_coeff_type" },
-    { "center_mix_level",       "Center Mix Level",         OFFSET(center_mix_level),       AV_OPT_TYPE_DOUBLE, { .dbl = M_SQRT1_2      }, -32.0,                32.0,                   PARAM },
-    { "surround_mix_level",     "Surround Mix Level",       OFFSET(surround_mix_level),     AV_OPT_TYPE_DOUBLE, { .dbl = M_SQRT1_2      }, -32.0,                32.0,                   PARAM },
-    { "lfe_mix_level",          "LFE Mix Level",            OFFSET(lfe_mix_level),          AV_OPT_TYPE_DOUBLE, { .dbl = 0.0            }, -32.0,                32.0,                   PARAM },
-    { "normalize_mix_level",    "Normalize Mix Level",      OFFSET(normalize_mix_level),    AV_OPT_TYPE_INT,    { .i64 = 1              }, 0,                    1,                      PARAM },
-    { "force_resampling",       "Force Resampling",         OFFSET(force_resampling),       AV_OPT_TYPE_INT,    { .i64 = 0              }, 0,                    1,                      PARAM },
-    { "filter_size",            "Resampling Filter Size",   OFFSET(filter_size),            AV_OPT_TYPE_INT,    { .i64 = 16             }, 0,                    32, /* ??? */           PARAM },
-    { "phase_shift",            "Resampling Phase Shift",   OFFSET(phase_shift),            AV_OPT_TYPE_INT,    { .i64 = 10             }, 0,                    30, /* ??? */           PARAM },
-    { "linear_interp",          "Use Linear Interpolation", OFFSET(linear_interp),          AV_OPT_TYPE_INT,    { .i64 = 0              }, 0,                    1,                      PARAM },
-    { "cutoff",                 "Cutoff Frequency Ratio",   OFFSET(cutoff),                 AV_OPT_TYPE_DOUBLE, { .dbl = 0.8            }, 0.0,                  1.0,                    PARAM },
-    /* duplicate option in order to work with avconv */
-    { "resample_cutoff",        "Cutoff Frequency Ratio",   OFFSET(cutoff),                 AV_OPT_TYPE_DOUBLE, { .dbl = 0.8            }, 0.0,                  1.0,                    PARAM },
-    { "matrix_encoding",        "Matrixed Stereo Encoding", OFFSET(matrix_encoding),        AV_OPT_TYPE_INT,    {.i64 =  AV_MATRIX_ENCODING_NONE}, AV_MATRIX_ENCODING_NONE,     AV_MATRIX_ENCODING_NB-1, PARAM, "matrix_encoding" },
-        { "none",  "None",               0, AV_OPT_TYPE_CONST, { .i64 = AV_MATRIX_ENCODING_NONE  }, INT_MIN, INT_MAX, PARAM, "matrix_encoding" },
-        { "dolby", "Dolby",              0, AV_OPT_TYPE_CONST, { .i64 = AV_MATRIX_ENCODING_DOLBY }, INT_MIN, INT_MAX, PARAM, "matrix_encoding" },
-        { "dplii", "Dolby Pro Logic II", 0, AV_OPT_TYPE_CONST, { .i64 = AV_MATRIX_ENCODING_DPLII }, INT_MIN, INT_MAX, PARAM, "matrix_encoding" },
-    { "filter_type",            "Filter Type",              OFFSET(filter_type),            AV_OPT_TYPE_INT,    { .i64 = AV_RESAMPLE_FILTER_TYPE_KAISER }, AV_RESAMPLE_FILTER_TYPE_CUBIC, AV_RESAMPLE_FILTER_TYPE_KAISER,  PARAM, "filter_type" },
-        { "cubic",            "Cubic",                          0, AV_OPT_TYPE_CONST, { .i64 = AV_RESAMPLE_FILTER_TYPE_CUBIC            }, INT_MIN, INT_MAX, PARAM, "filter_type" },
-        { "blackman_nuttall", "Blackman Nuttall Windowed Sinc", 0, AV_OPT_TYPE_CONST, { .i64 = AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL }, INT_MIN, INT_MAX, PARAM, "filter_type" },
-        { "kaiser",           "Kaiser Windowed Sinc",           0, AV_OPT_TYPE_CONST, { .i64 = AV_RESAMPLE_FILTER_TYPE_KAISER           }, INT_MIN, INT_MAX, PARAM, "filter_type" },
-    { "kaiser_beta",            "Kaiser Window Beta",       OFFSET(kaiser_beta),            AV_OPT_TYPE_INT,    { .i64 = 9              }, 2,                    16,                     PARAM },
-    { "dither_method",          "Dither Method",            OFFSET(dither_method),          AV_OPT_TYPE_INT,    { .i64 = AV_RESAMPLE_DITHER_NONE }, 0, AV_RESAMPLE_DITHER_NB-1, PARAM, "dither_method"},
-        {"none",          "No Dithering",                         0, AV_OPT_TYPE_CONST, { .i64 = AV_RESAMPLE_DITHER_NONE          }, INT_MIN, INT_MAX, PARAM, "dither_method"},
-        {"rectangular",   "Rectangular Dither",                   0, AV_OPT_TYPE_CONST, { .i64 = AV_RESAMPLE_DITHER_RECTANGULAR   }, INT_MIN, INT_MAX, PARAM, "dither_method"},
-        {"triangular",    "Triangular Dither",                    0, AV_OPT_TYPE_CONST, { .i64 = AV_RESAMPLE_DITHER_TRIANGULAR    }, INT_MIN, INT_MAX, PARAM, "dither_method"},
-        {"triangular_hp", "Triangular Dither With High Pass",     0, AV_OPT_TYPE_CONST, { .i64 = AV_RESAMPLE_DITHER_TRIANGULAR_HP }, INT_MIN, INT_MAX, PARAM, "dither_method"},
-        {"triangular_ns", "Triangular Dither With Noise Shaping", 0, AV_OPT_TYPE_CONST, { .i64 = AV_RESAMPLE_DITHER_TRIANGULAR_NS }, INT_MIN, INT_MAX, PARAM, "dither_method"},
-    { NULL },
-};
-
-static const AVClass av_resample_context_class = {
-    .class_name = "AVAudioResampleContext",
-    .item_name  = av_default_item_name,
-    .option     = avresample_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-AVAudioResampleContext *avresample_alloc_context(void)
-{
-    AVAudioResampleContext *avr;
-
-    avr = av_mallocz(sizeof(*avr));
-    if (!avr)
-        return NULL;
-
-    avr->av_class = &av_resample_context_class;
-    av_opt_set_defaults(avr);
-
-    return avr;
-}
-
-const AVClass *avresample_get_class(void)
-{
-    return &av_resample_context_class;
-}
diff --git a/deps/libav/libavresample/resample.c b/deps/libav/libavresample/resample.c
deleted file mode 100644
index 69c9bab..0000000
--- a/deps/libav/libavresample/resample.c
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * Copyright (c) 2004 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/libm.h"
-#include "libavutil/log.h"
-#include "internal.h"
-#include "resample.h"
-#include "audio_data.h"
-
-struct ResampleContext {
-    AVAudioResampleContext *avr;
-    AudioData *buffer;
-    uint8_t *filter_bank;
-    int filter_length;
-    int ideal_dst_incr;
-    int dst_incr;
-    int index;
-    int frac;
-    int src_incr;
-    int compensation_distance;
-    int phase_shift;
-    int phase_mask;
-    int linear;
-    enum AVResampleFilterType filter_type;
-    int kaiser_beta;
-    double factor;
-    void (*set_filter)(void *filter, double *tab, int phase, int tap_count);
-    void (*resample_one)(struct ResampleContext *c, int no_filter, void *dst0,
-                         int dst_index, const void *src0, int src_size,
-                         int index, int frac);
-};
-
-
-/* double template */
-#define CONFIG_RESAMPLE_DBL
-#include "resample_template.c"
-#undef CONFIG_RESAMPLE_DBL
-
-/* float template */
-#define CONFIG_RESAMPLE_FLT
-#include "resample_template.c"
-#undef CONFIG_RESAMPLE_FLT
-
-/* s32 template */
-#define CONFIG_RESAMPLE_S32
-#include "resample_template.c"
-#undef CONFIG_RESAMPLE_S32
-
-/* s16 template */
-#include "resample_template.c"
-
-
-/* 0th order modified bessel function of the first kind. */
-static double bessel(double x)
-{
-    double v     = 1;
-    double lastv = 0;
-    double t     = 1;
-    int i;
-
-    x = x * x / 4;
-    for (i = 1; v != lastv; i++) {
-        lastv = v;
-        t    *= x / (i * i);
-        v    += t;
-    }
-    return v;
-}
-
-/* Build a polyphase filterbank. */
-static int build_filter(ResampleContext *c)
-{
-    int ph, i;
-    double x, y, w, factor;
-    double *tab;
-    int tap_count    = c->filter_length;
-    int phase_count  = 1 << c->phase_shift;
-    const int center = (tap_count - 1) / 2;
-
-    tab = av_malloc(tap_count * sizeof(*tab));
-    if (!tab)
-        return AVERROR(ENOMEM);
-
-    /* if upsampling, only need to interpolate, no filter */
-    factor = FFMIN(c->factor, 1.0);
-
-    for (ph = 0; ph < phase_count; ph++) {
-        double norm = 0;
-        for (i = 0; i < tap_count; i++) {
-            x = M_PI * ((double)(i - center) - (double)ph / phase_count) * factor;
-            if (x == 0) y = 1.0;
-            else        y = sin(x) / x;
-            switch (c->filter_type) {
-            case AV_RESAMPLE_FILTER_TYPE_CUBIC: {
-                const float d = -0.5; //first order derivative = -0.5
-                x = fabs(((double)(i - center) - (double)ph / phase_count) * factor);
-                if (x < 1.0) y = 1 - 3 * x*x + 2 * x*x*x + d * (                -x*x + x*x*x);
-                else         y =                           d * (-4 + 8 * x - 5 * x*x + x*x*x);
-                break;
-            }
-            case AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL:
-                w  = 2.0 * x / (factor * tap_count) + M_PI;
-                y *= 0.3635819 - 0.4891775 * cos(    w) +
-                                 0.1365995 * cos(2 * w) -
-                                 0.0106411 * cos(3 * w);
-                break;
-            case AV_RESAMPLE_FILTER_TYPE_KAISER:
-                w  = 2.0 * x / (factor * tap_count * M_PI);
-                y *= bessel(c->kaiser_beta * sqrt(FFMAX(1 - w * w, 0)));
-                break;
-            }
-
-            tab[i] = y;
-            norm  += y;
-        }
-        /* normalize so that an uniform color remains the same */
-        for (i = 0; i < tap_count; i++)
-            tab[i] = tab[i] / norm;
-
-        c->set_filter(c->filter_bank, tab, ph, tap_count);
-    }
-
-    av_free(tab);
-    return 0;
-}
-
-ResampleContext *ff_audio_resample_init(AVAudioResampleContext *avr)
-{
-    ResampleContext *c;
-    int out_rate    = avr->out_sample_rate;
-    int in_rate     = avr->in_sample_rate;
-    double factor   = FFMIN(out_rate * avr->cutoff / in_rate, 1.0);
-    int phase_count = 1 << avr->phase_shift;
-    int felem_size;
-
-    if (avr->internal_sample_fmt != AV_SAMPLE_FMT_S16P &&
-        avr->internal_sample_fmt != AV_SAMPLE_FMT_S32P &&
-        avr->internal_sample_fmt != AV_SAMPLE_FMT_FLTP &&
-        avr->internal_sample_fmt != AV_SAMPLE_FMT_DBLP) {
-        av_log(avr, AV_LOG_ERROR, "Unsupported internal format for "
-               "resampling: %s\n",
-               av_get_sample_fmt_name(avr->internal_sample_fmt));
-        return NULL;
-    }
-    c = av_mallocz(sizeof(*c));
-    if (!c)
-        return NULL;
-
-    c->avr           = avr;
-    c->phase_shift   = avr->phase_shift;
-    c->phase_mask    = phase_count - 1;
-    c->linear        = avr->linear_interp;
-    c->factor        = factor;
-    c->filter_length = FFMAX((int)ceil(avr->filter_size / factor), 1);
-    c->filter_type   = avr->filter_type;
-    c->kaiser_beta   = avr->kaiser_beta;
-
-    switch (avr->internal_sample_fmt) {
-    case AV_SAMPLE_FMT_DBLP:
-        c->resample_one  = resample_one_dbl;
-        c->set_filter    = set_filter_dbl;
-        break;
-    case AV_SAMPLE_FMT_FLTP:
-        c->resample_one  = resample_one_flt;
-        c->set_filter    = set_filter_flt;
-        break;
-    case AV_SAMPLE_FMT_S32P:
-        c->resample_one  = resample_one_s32;
-        c->set_filter    = set_filter_s32;
-        break;
-    case AV_SAMPLE_FMT_S16P:
-        c->resample_one  = resample_one_s16;
-        c->set_filter    = set_filter_s16;
-        break;
-    }
-
-    felem_size = av_get_bytes_per_sample(avr->internal_sample_fmt);
-    c->filter_bank = av_mallocz(c->filter_length * (phase_count + 1) * felem_size);
-    if (!c->filter_bank)
-        goto error;
-
-    if (build_filter(c) < 0)
-        goto error;
-
-    memcpy(&c->filter_bank[(c->filter_length * phase_count + 1) * felem_size],
-           c->filter_bank, (c->filter_length - 1) * felem_size);
-    memcpy(&c->filter_bank[c->filter_length * phase_count * felem_size],
-           &c->filter_bank[(c->filter_length - 1) * felem_size], felem_size);
-
-    c->compensation_distance = 0;
-    if (!av_reduce(&c->src_incr, &c->dst_incr, out_rate,
-                   in_rate * (int64_t)phase_count, INT32_MAX / 2))
-        goto error;
-    c->ideal_dst_incr = c->dst_incr;
-
-    c->index = -phase_count * ((c->filter_length - 1) / 2);
-    c->frac  = 0;
-
-    /* allocate internal buffer */
-    c->buffer = ff_audio_data_alloc(avr->resample_channels, 0,
-                                    avr->internal_sample_fmt,
-                                    "resample buffer");
-    if (!c->buffer)
-        goto error;
-
-    av_log(avr, AV_LOG_DEBUG, "resample: %s from %d Hz to %d Hz\n",
-           av_get_sample_fmt_name(avr->internal_sample_fmt),
-           avr->in_sample_rate, avr->out_sample_rate);
-
-    return c;
-
-error:
-    ff_audio_data_free(&c->buffer);
-    av_free(c->filter_bank);
-    av_free(c);
-    return NULL;
-}
-
-void ff_audio_resample_free(ResampleContext **c)
-{
-    if (!*c)
-        return;
-    ff_audio_data_free(&(*c)->buffer);
-    av_free((*c)->filter_bank);
-    av_freep(c);
-}
-
-int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
-                                int compensation_distance)
-{
-    ResampleContext *c;
-    AudioData *fifo_buf = NULL;
-    int ret = 0;
-
-    if (compensation_distance < 0)
-        return AVERROR(EINVAL);
-    if (!compensation_distance && sample_delta)
-        return AVERROR(EINVAL);
-
-    if (!avr->resample_needed) {
-#if FF_API_RESAMPLE_CLOSE_OPEN
-        /* if resampling was not enabled previously, re-initialize the
-           AVAudioResampleContext and force resampling */
-        int fifo_samples;
-        int restore_matrix = 0;
-        double matrix[AVRESAMPLE_MAX_CHANNELS * AVRESAMPLE_MAX_CHANNELS] = { 0 };
-
-        /* buffer any remaining samples in the output FIFO before closing */
-        fifo_samples = av_audio_fifo_size(avr->out_fifo);
-        if (fifo_samples > 0) {
-            fifo_buf = ff_audio_data_alloc(avr->out_channels, fifo_samples,
-                                           avr->out_sample_fmt, NULL);
-            if (!fifo_buf)
-                return AVERROR(EINVAL);
-            ret = ff_audio_data_read_from_fifo(avr->out_fifo, fifo_buf,
-                                               fifo_samples);
-            if (ret < 0)
-                goto reinit_fail;
-        }
-        /* save the channel mixing matrix */
-        if (avr->am) {
-            ret = avresample_get_matrix(avr, matrix, AVRESAMPLE_MAX_CHANNELS);
-            if (ret < 0)
-                goto reinit_fail;
-            restore_matrix = 1;
-        }
-
-        /* close the AVAudioResampleContext */
-        avresample_close(avr);
-
-        avr->force_resampling = 1;
-
-        /* restore the channel mixing matrix */
-        if (restore_matrix) {
-            ret = avresample_set_matrix(avr, matrix, AVRESAMPLE_MAX_CHANNELS);
-            if (ret < 0)
-                goto reinit_fail;
-        }
-
-        /* re-open the AVAudioResampleContext */
-        ret = avresample_open(avr);
-        if (ret < 0)
-            goto reinit_fail;
-
-        /* restore buffered samples to the output FIFO */
-        if (fifo_samples > 0) {
-            ret = ff_audio_data_add_to_fifo(avr->out_fifo, fifo_buf, 0,
-                                            fifo_samples);
-            if (ret < 0)
-                goto reinit_fail;
-            ff_audio_data_free(&fifo_buf);
-        }
-#else
-        av_log(avr, AV_LOG_ERROR, "Unable to set resampling compensation\n");
-        return AVERROR(EINVAL);
-#endif
-    }
-    c = avr->resample;
-    c->compensation_distance = compensation_distance;
-    if (compensation_distance) {
-        c->dst_incr = c->ideal_dst_incr - c->ideal_dst_incr *
-                      (int64_t)sample_delta / compensation_distance;
-    } else {
-        c->dst_incr = c->ideal_dst_incr;
-    }
-    return 0;
-
-reinit_fail:
-    ff_audio_data_free(&fifo_buf);
-    return ret;
-}
-
-static int resample(ResampleContext *c, void *dst, const void *src,
-                    int *consumed, int src_size, int dst_size, int update_ctx)
-{
-    int dst_index;
-    int index         = c->index;
-    int frac          = c->frac;
-    int dst_incr_frac = c->dst_incr % c->src_incr;
-    int dst_incr      = c->dst_incr / c->src_incr;
-    int compensation_distance = c->compensation_distance;
-
-    if (!dst != !src)
-        return AVERROR(EINVAL);
-
-    if (compensation_distance == 0 && c->filter_length == 1 &&
-        c->phase_shift == 0) {
-        int64_t index2 = ((int64_t)index) << 32;
-        int64_t incr   = (1LL << 32) * c->dst_incr / c->src_incr;
-        dst_size       = FFMIN(dst_size,
-                               (src_size-1-index) * (int64_t)c->src_incr /
-                               c->dst_incr);
-
-        if (dst) {
-            for(dst_index = 0; dst_index < dst_size; dst_index++) {
-                c->resample_one(c, 1, dst, dst_index, src, 0, index2 >> 32, 0);
-                index2 += incr;
-            }
-        } else {
-            dst_index = dst_size;
-        }
-        index += dst_index * dst_incr;
-        index += (frac + dst_index * (int64_t)dst_incr_frac) / c->src_incr;
-        frac   = (frac + dst_index * (int64_t)dst_incr_frac) % c->src_incr;
-    } else {
-        for (dst_index = 0; dst_index < dst_size; dst_index++) {
-            int sample_index = index >> c->phase_shift;
-
-            if (sample_index + c->filter_length > src_size ||
-                -sample_index >= src_size)
-                break;
-
-            if (dst)
-                c->resample_one(c, 0, dst, dst_index, src, src_size, index, frac);
-
-            frac  += dst_incr_frac;
-            index += dst_incr;
-            if (frac >= c->src_incr) {
-                frac -= c->src_incr;
-                index++;
-            }
-            if (dst_index + 1 == compensation_distance) {
-                compensation_distance = 0;
-                dst_incr_frac = c->ideal_dst_incr % c->src_incr;
-                dst_incr      = c->ideal_dst_incr / c->src_incr;
-            }
-        }
-    }
-    if (consumed)
-        *consumed = FFMAX(index, 0) >> c->phase_shift;
-
-    if (update_ctx) {
-        if (index >= 0)
-            index &= c->phase_mask;
-
-        if (compensation_distance) {
-            compensation_distance -= dst_index;
-            if (compensation_distance <= 0)
-                return AVERROR_BUG;
-        }
-        c->frac     = frac;
-        c->index    = index;
-        c->dst_incr = dst_incr_frac + c->src_incr*dst_incr;
-        c->compensation_distance = compensation_distance;
-    }
-
-    return dst_index;
-}
-
-int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src)
-{
-    int ch, in_samples, in_leftover, consumed = 0, out_samples = 0;
-    int ret = AVERROR(EINVAL);
-
-    in_samples  = src ? src->nb_samples : 0;
-    in_leftover = c->buffer->nb_samples;
-
-    /* add input samples to the internal buffer */
-    if (src) {
-        ret = ff_audio_data_combine(c->buffer, in_leftover, src, 0, in_samples);
-        if (ret < 0)
-            return ret;
-    } else if (!in_leftover) {
-        /* no remaining samples to flush */
-        return 0;
-    } else {
-        /* TODO: pad buffer to flush completely */
-    }
-
-    /* calculate output size and reallocate output buffer if needed */
-    /* TODO: try to calculate this without the dummy resample() run */
-    if (!dst->read_only && dst->allow_realloc) {
-        out_samples = resample(c, NULL, NULL, NULL, c->buffer->nb_samples,
-                               INT_MAX, 0);
-        ret = ff_audio_data_realloc(dst, out_samples);
-        if (ret < 0) {
-            av_log(c->avr, AV_LOG_ERROR, "error reallocating output\n");
-            return ret;
-        }
-    }
-
-    /* resample each channel plane */
-    for (ch = 0; ch < c->buffer->channels; ch++) {
-        out_samples = resample(c, (void *)dst->data[ch],
-                               (const void *)c->buffer->data[ch], &consumed,
-                               c->buffer->nb_samples, dst->allocated_samples,
-                               ch + 1 == c->buffer->channels);
-    }
-    if (out_samples < 0) {
-        av_log(c->avr, AV_LOG_ERROR, "error during resampling\n");
-        return out_samples;
-    }
-
-    /* drain consumed samples from the internal buffer */
-    ff_audio_data_drain(c->buffer, consumed);
-
-    av_dlog(c->avr, "resampled %d in + %d leftover to %d out + %d leftover\n",
-            in_samples, in_leftover, out_samples, c->buffer->nb_samples);
-
-    dst->nb_samples = out_samples;
-    return 0;
-}
-
-int avresample_get_delay(AVAudioResampleContext *avr)
-{
-    if (!avr->resample_needed || !avr->resample)
-        return 0;
-
-    return avr->resample->buffer->nb_samples;
-}
diff --git a/deps/libav/libavresample/resample.h b/deps/libav/libavresample/resample.h
deleted file mode 100644
index 4544dab..0000000
--- a/deps/libav/libavresample/resample.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVRESAMPLE_RESAMPLE_H
-#define AVRESAMPLE_RESAMPLE_H
-
-#include "avresample.h"
-#include "internal.h"
-#include "audio_data.h"
-
-/**
- * Allocate and initialize a ResampleContext.
- *
- * The parameters in the AVAudioResampleContext are used to initialize the
- * ResampleContext.
- *
- * @param avr  AVAudioResampleContext
- * @return     newly-allocated ResampleContext
- */
-ResampleContext *ff_audio_resample_init(AVAudioResampleContext *avr);
-
-/**
- * Free a ResampleContext.
- *
- * @param c  ResampleContext
- */
-void ff_audio_resample_free(ResampleContext **c);
-
-/**
- * Resample audio data.
- *
- * Changes the sample rate.
- *
- * @par
- * All samples in the source data may not be consumed depending on the
- * resampling parameters and the size of the output buffer. The unconsumed
- * samples are automatically added to the start of the source in the next call.
- * If the destination data can be reallocated, that may be done in this function
- * in order to fit all available output. If it cannot be reallocated, fewer
- * input samples will be consumed in order to have the output fit in the
- * destination data buffers.
- *
- * @param c         ResampleContext
- * @param dst       destination audio data
- * @param src       source audio data
- * @return          0 on success, negative AVERROR code on failure
- */
-int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src);
-
-#endif /* AVRESAMPLE_RESAMPLE_H */
diff --git a/deps/libav/libavresample/resample_template.c b/deps/libav/libavresample/resample_template.c
deleted file mode 100644
index 5b0fbec..0000000
--- a/deps/libav/libavresample/resample_template.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2004 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#if defined(CONFIG_RESAMPLE_DBL)
-#define SET_TYPE(func)  func ## _dbl
-#define FELEM         double
-#define FELEM2        double
-#define FELEML        double
-#define OUT(d, v) d = v
-#define DBL_TO_FELEM(d, v) d = v
-#elif defined(CONFIG_RESAMPLE_FLT)
-#define SET_TYPE(func)  func ## _flt
-#define FELEM         float
-#define FELEM2        float
-#define FELEML        float
-#define OUT(d, v) d = v
-#define DBL_TO_FELEM(d, v) d = v
-#elif defined(CONFIG_RESAMPLE_S32)
-#define SET_TYPE(func)  func ## _s32
-#define FELEM         int32_t
-#define FELEM2        int64_t
-#define FELEML        int64_t
-#define OUT(d, v) d = av_clipl_int32((v + (1 << 29)) >> 30)
-#define DBL_TO_FELEM(d, v) d = av_clipl_int32(llrint(v * (1 << 30)));
-#else
-#define SET_TYPE(func)  func ## _s16
-#define FELEM         int16_t
-#define FELEM2        int32_t
-#define FELEML        int64_t
-#define OUT(d, v) d = av_clip_int16((v + (1 << 14)) >> 15)
-#define DBL_TO_FELEM(d, v) d = av_clip_int16(lrint(v * (1 << 15)))
-#endif
-
-static void SET_TYPE(resample_one)(ResampleContext *c, int no_filter,
-                                   void *dst0, int dst_index, const void *src0,
-                                   int src_size, int index, int frac)
-{
-    FELEM *dst = dst0;
-    const FELEM *src = src0;
-
-    if (no_filter) {
-        dst[dst_index] = src[index];
-    } else {
-        int i;
-        int sample_index = index >> c->phase_shift;
-        FELEM2 val = 0;
-        FELEM *filter = ((FELEM *)c->filter_bank) +
-                        c->filter_length * (index & c->phase_mask);
-
-        if (sample_index < 0) {
-            for (i = 0; i < c->filter_length; i++)
-                val += src[FFABS(sample_index + i) % src_size] *
-                       (FELEM2)filter[i];
-        } else if (c->linear) {
-            FELEM2 v2 = 0;
-            for (i = 0; i < c->filter_length; i++) {
-                val += src[abs(sample_index + i)] * (FELEM2)filter[i];
-                v2  += src[abs(sample_index + i)] * (FELEM2)filter[i + c->filter_length];
-            }
-            val += (v2 - val) * (FELEML)frac / c->src_incr;
-        } else {
-            for (i = 0; i < c->filter_length; i++)
-                val += src[sample_index + i] * (FELEM2)filter[i];
-        }
-
-        OUT(dst[dst_index], val);
-    }
-}
-
-static void SET_TYPE(set_filter)(void *filter0, double *tab, int phase,
-                                 int tap_count)
-{
-    int i;
-    FELEM *filter = ((FELEM *)filter0) + phase * tap_count;
-    for (i = 0; i < tap_count; i++) {
-        DBL_TO_FELEM(filter[i], tab[i]);
-    }
-}
-
-#undef SET_TYPE
-#undef FELEM
-#undef FELEM2
-#undef FELEML
-#undef OUT
-#undef DBL_TO_FELEM
diff --git a/deps/libav/libavresample/utils.c b/deps/libav/libavresample/utils.c
deleted file mode 100644
index bc295d6..0000000
--- a/deps/libav/libavresample/utils.c
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/common.h"
-#include "libavutil/dict.h"
-#include "libavutil/error.h"
-#include "libavutil/log.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-
-#include "avresample.h"
-#include "internal.h"
-#include "audio_data.h"
-#include "audio_convert.h"
-#include "audio_mix.h"
-#include "resample.h"
-
-int avresample_open(AVAudioResampleContext *avr)
-{
-    int ret;
-
-    /* set channel mixing parameters */
-    avr->in_channels = av_get_channel_layout_nb_channels(avr->in_channel_layout);
-    if (avr->in_channels <= 0 || avr->in_channels > AVRESAMPLE_MAX_CHANNELS) {
-        av_log(avr, AV_LOG_ERROR, "Invalid input channel layout: %"PRIu64"\n",
-               avr->in_channel_layout);
-        return AVERROR(EINVAL);
-    }
-    avr->out_channels = av_get_channel_layout_nb_channels(avr->out_channel_layout);
-    if (avr->out_channels <= 0 || avr->out_channels > AVRESAMPLE_MAX_CHANNELS) {
-        av_log(avr, AV_LOG_ERROR, "Invalid output channel layout: %"PRIu64"\n",
-               avr->out_channel_layout);
-        return AVERROR(EINVAL);
-    }
-    avr->resample_channels = FFMIN(avr->in_channels, avr->out_channels);
-    avr->downmix_needed    = avr->in_channels  > avr->out_channels;
-    avr->upmix_needed      = avr->out_channels > avr->in_channels ||
-                             (!avr->downmix_needed && (avr->mix_matrix ||
-                              avr->in_channel_layout != avr->out_channel_layout));
-    avr->mixing_needed     = avr->downmix_needed || avr->upmix_needed;
-
-    /* set resampling parameters */
-    avr->resample_needed   = avr->in_sample_rate != avr->out_sample_rate ||
-                             avr->force_resampling;
-
-    /* select internal sample format if not specified by the user */
-    if (avr->internal_sample_fmt == AV_SAMPLE_FMT_NONE &&
-        (avr->mixing_needed || avr->resample_needed)) {
-        enum AVSampleFormat  in_fmt = av_get_planar_sample_fmt(avr->in_sample_fmt);
-        enum AVSampleFormat out_fmt = av_get_planar_sample_fmt(avr->out_sample_fmt);
-        int max_bps = FFMAX(av_get_bytes_per_sample(in_fmt),
-                            av_get_bytes_per_sample(out_fmt));
-        if (max_bps <= 2) {
-            avr->internal_sample_fmt = AV_SAMPLE_FMT_S16P;
-        } else if (avr->mixing_needed) {
-            avr->internal_sample_fmt = AV_SAMPLE_FMT_FLTP;
-        } else {
-            if (max_bps <= 4) {
-                if (in_fmt  == AV_SAMPLE_FMT_S32P ||
-                    out_fmt == AV_SAMPLE_FMT_S32P) {
-                    if (in_fmt  == AV_SAMPLE_FMT_FLTP ||
-                        out_fmt == AV_SAMPLE_FMT_FLTP) {
-                        /* if one is s32 and the other is flt, use dbl */
-                        avr->internal_sample_fmt = AV_SAMPLE_FMT_DBLP;
-                    } else {
-                        /* if one is s32 and the other is s32, s16, or u8, use s32 */
-                        avr->internal_sample_fmt = AV_SAMPLE_FMT_S32P;
-                    }
-                } else {
-                    /* if one is flt and the other is flt, s16 or u8, use flt */
-                    avr->internal_sample_fmt = AV_SAMPLE_FMT_FLTP;
-                }
-            } else {
-                /* if either is dbl, use dbl */
-                avr->internal_sample_fmt = AV_SAMPLE_FMT_DBLP;
-            }
-        }
-        av_log(avr, AV_LOG_DEBUG, "Using %s as internal sample format\n",
-               av_get_sample_fmt_name(avr->internal_sample_fmt));
-    }
-
-    /* treat all mono as planar for easier comparison */
-    if (avr->in_channels == 1)
-        avr->in_sample_fmt = av_get_planar_sample_fmt(avr->in_sample_fmt);
-    if (avr->out_channels == 1)
-        avr->out_sample_fmt = av_get_planar_sample_fmt(avr->out_sample_fmt);
-
-    /* we may need to add an extra conversion in order to remap channels if
-       the output format is not planar */
-    if (avr->use_channel_map && !avr->mixing_needed && !avr->resample_needed &&
-        !av_sample_fmt_is_planar(avr->out_sample_fmt)) {
-        avr->internal_sample_fmt = av_get_planar_sample_fmt(avr->out_sample_fmt);
-    }
-
-    /* set sample format conversion parameters */
-    if (avr->resample_needed || avr->mixing_needed)
-        avr->in_convert_needed = avr->in_sample_fmt != avr->internal_sample_fmt;
-    else
-        avr->in_convert_needed = avr->use_channel_map &&
-                                 !av_sample_fmt_is_planar(avr->out_sample_fmt);
-
-    if (avr->resample_needed || avr->mixing_needed || avr->in_convert_needed)
-        avr->out_convert_needed = avr->internal_sample_fmt != avr->out_sample_fmt;
-    else
-        avr->out_convert_needed = avr->in_sample_fmt != avr->out_sample_fmt;
-
-    avr->in_copy_needed = !avr->in_convert_needed && (avr->mixing_needed ||
-                          (avr->use_channel_map && avr->resample_needed));
-
-    if (avr->use_channel_map) {
-        if (avr->in_copy_needed) {
-            avr->remap_point = REMAP_IN_COPY;
-            av_dlog(avr, "remap channels during in_copy\n");
-        } else if (avr->in_convert_needed) {
-            avr->remap_point = REMAP_IN_CONVERT;
-            av_dlog(avr, "remap channels during in_convert\n");
-        } else if (avr->out_convert_needed) {
-            avr->remap_point = REMAP_OUT_CONVERT;
-            av_dlog(avr, "remap channels during out_convert\n");
-        } else {
-            avr->remap_point = REMAP_OUT_COPY;
-            av_dlog(avr, "remap channels during out_copy\n");
-        }
-
-#ifdef DEBUG
-        {
-            int ch;
-            av_dlog(avr, "output map: ");
-            if (avr->ch_map_info.do_remap)
-                for (ch = 0; ch < avr->in_channels; ch++)
-                    av_dlog(avr, " % 2d", avr->ch_map_info.channel_map[ch]);
-            else
-                av_dlog(avr, "n/a");
-            av_dlog(avr, "\n");
-            av_dlog(avr, "copy map:   ");
-            if (avr->ch_map_info.do_copy)
-                for (ch = 0; ch < avr->in_channels; ch++)
-                    av_dlog(avr, " % 2d", avr->ch_map_info.channel_copy[ch]);
-            else
-                av_dlog(avr, "n/a");
-            av_dlog(avr, "\n");
-            av_dlog(avr, "zero map:   ");
-            if (avr->ch_map_info.do_zero)
-                for (ch = 0; ch < avr->in_channels; ch++)
-                    av_dlog(avr, " % 2d", avr->ch_map_info.channel_zero[ch]);
-            else
-                av_dlog(avr, "n/a");
-            av_dlog(avr, "\n");
-            av_dlog(avr, "input map:  ");
-            for (ch = 0; ch < avr->in_channels; ch++)
-                av_dlog(avr, " % 2d", avr->ch_map_info.input_map[ch]);
-            av_dlog(avr, "\n");
-        }
-#endif
-    } else
-        avr->remap_point = REMAP_NONE;
-
-    /* allocate buffers */
-    if (avr->in_copy_needed || avr->in_convert_needed) {
-        avr->in_buffer = ff_audio_data_alloc(FFMAX(avr->in_channels, avr->out_channels),
-                                             0, avr->internal_sample_fmt,
-                                             "in_buffer");
-        if (!avr->in_buffer) {
-            ret = AVERROR(EINVAL);
-            goto error;
-        }
-    }
-    if (avr->resample_needed) {
-        avr->resample_out_buffer = ff_audio_data_alloc(avr->out_channels,
-                                                       1024, avr->internal_sample_fmt,
-                                                       "resample_out_buffer");
-        if (!avr->resample_out_buffer) {
-            ret = AVERROR(EINVAL);
-            goto error;
-        }
-    }
-    if (avr->out_convert_needed) {
-        avr->out_buffer = ff_audio_data_alloc(avr->out_channels, 0,
-                                              avr->out_sample_fmt, "out_buffer");
-        if (!avr->out_buffer) {
-            ret = AVERROR(EINVAL);
-            goto error;
-        }
-    }
-    avr->out_fifo = av_audio_fifo_alloc(avr->out_sample_fmt, avr->out_channels,
-                                        1024);
-    if (!avr->out_fifo) {
-        ret = AVERROR(ENOMEM);
-        goto error;
-    }
-
-    /* setup contexts */
-    if (avr->in_convert_needed) {
-        avr->ac_in = ff_audio_convert_alloc(avr, avr->internal_sample_fmt,
-                                            avr->in_sample_fmt, avr->in_channels,
-                                            avr->in_sample_rate,
-                                            avr->remap_point == REMAP_IN_CONVERT);
-        if (!avr->ac_in) {
-            ret = AVERROR(ENOMEM);
-            goto error;
-        }
-    }
-    if (avr->out_convert_needed) {
-        enum AVSampleFormat src_fmt;
-        if (avr->in_convert_needed)
-            src_fmt = avr->internal_sample_fmt;
-        else
-            src_fmt = avr->in_sample_fmt;
-        avr->ac_out = ff_audio_convert_alloc(avr, avr->out_sample_fmt, src_fmt,
-                                             avr->out_channels,
-                                             avr->out_sample_rate,
-                                             avr->remap_point == REMAP_OUT_CONVERT);
-        if (!avr->ac_out) {
-            ret = AVERROR(ENOMEM);
-            goto error;
-        }
-    }
-    if (avr->resample_needed) {
-        avr->resample = ff_audio_resample_init(avr);
-        if (!avr->resample) {
-            ret = AVERROR(ENOMEM);
-            goto error;
-        }
-    }
-    if (avr->mixing_needed) {
-        avr->am = ff_audio_mix_alloc(avr);
-        if (!avr->am) {
-            ret = AVERROR(ENOMEM);
-            goto error;
-        }
-    }
-
-    return 0;
-
-error:
-    avresample_close(avr);
-    return ret;
-}
-
-void avresample_close(AVAudioResampleContext *avr)
-{
-    ff_audio_data_free(&avr->in_buffer);
-    ff_audio_data_free(&avr->resample_out_buffer);
-    ff_audio_data_free(&avr->out_buffer);
-    av_audio_fifo_free(avr->out_fifo);
-    avr->out_fifo = NULL;
-    ff_audio_convert_free(&avr->ac_in);
-    ff_audio_convert_free(&avr->ac_out);
-    ff_audio_resample_free(&avr->resample);
-    ff_audio_mix_free(&avr->am);
-    av_freep(&avr->mix_matrix);
-
-    avr->use_channel_map = 0;
-}
-
-void avresample_free(AVAudioResampleContext **avr)
-{
-    if (!*avr)
-        return;
-    avresample_close(*avr);
-    av_opt_free(*avr);
-    av_freep(avr);
-}
-
-static int handle_buffered_output(AVAudioResampleContext *avr,
-                                  AudioData *output, AudioData *converted)
-{
-    int ret;
-
-    if (!output || av_audio_fifo_size(avr->out_fifo) > 0 ||
-        (converted && output->allocated_samples < converted->nb_samples)) {
-        if (converted) {
-            /* if there are any samples in the output FIFO or if the
-               user-supplied output buffer is not large enough for all samples,
-               we add to the output FIFO */
-            av_dlog(avr, "[FIFO] add %s to out_fifo\n", converted->name);
-            ret = ff_audio_data_add_to_fifo(avr->out_fifo, converted, 0,
-                                            converted->nb_samples);
-            if (ret < 0)
-                return ret;
-        }
-
-        /* if the user specified an output buffer, read samples from the output
-           FIFO to the user output */
-        if (output && output->allocated_samples > 0) {
-            av_dlog(avr, "[FIFO] read from out_fifo to output\n");
-            av_dlog(avr, "[end conversion]\n");
-            return ff_audio_data_read_from_fifo(avr->out_fifo, output,
-                                                output->allocated_samples);
-        }
-    } else if (converted) {
-        /* copy directly to output if it is large enough or there is not any
-           data in the output FIFO */
-        av_dlog(avr, "[copy] %s to output\n", converted->name);
-        output->nb_samples = 0;
-        ret = ff_audio_data_copy(output, converted,
-                                 avr->remap_point == REMAP_OUT_COPY ?
-                                 &avr->ch_map_info : NULL);
-        if (ret < 0)
-            return ret;
-        av_dlog(avr, "[end conversion]\n");
-        return output->nb_samples;
-    }
-    av_dlog(avr, "[end conversion]\n");
-    return 0;
-}
-
-int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
-                                           uint8_t **output, int out_plane_size,
-                                           int out_samples, uint8_t **input,
-                                           int in_plane_size, int in_samples)
-{
-    AudioData input_buffer;
-    AudioData output_buffer;
-    AudioData *current_buffer;
-    int ret, direct_output;
-
-    /* reset internal buffers */
-    if (avr->in_buffer) {
-        avr->in_buffer->nb_samples = 0;
-        ff_audio_data_set_channels(avr->in_buffer,
-                                   avr->in_buffer->allocated_channels);
-    }
-    if (avr->resample_out_buffer) {
-        avr->resample_out_buffer->nb_samples = 0;
-        ff_audio_data_set_channels(avr->resample_out_buffer,
-                                   avr->resample_out_buffer->allocated_channels);
-    }
-    if (avr->out_buffer) {
-        avr->out_buffer->nb_samples = 0;
-        ff_audio_data_set_channels(avr->out_buffer,
-                                   avr->out_buffer->allocated_channels);
-    }
-
-    av_dlog(avr, "[start conversion]\n");
-
-    /* initialize output_buffer with output data */
-    direct_output = output && av_audio_fifo_size(avr->out_fifo) == 0;
-    if (output) {
-        ret = ff_audio_data_init(&output_buffer, output, out_plane_size,
-                                 avr->out_channels, out_samples,
-                                 avr->out_sample_fmt, 0, "output");
-        if (ret < 0)
-            return ret;
-        output_buffer.nb_samples = 0;
-    }
-
-    if (input) {
-        /* initialize input_buffer with input data */
-        ret = ff_audio_data_init(&input_buffer, input, in_plane_size,
-                                 avr->in_channels, in_samples,
-                                 avr->in_sample_fmt, 1, "input");
-        if (ret < 0)
-            return ret;
-        current_buffer = &input_buffer;
-
-        if (avr->upmix_needed && !avr->in_convert_needed && !avr->resample_needed &&
-            !avr->out_convert_needed && direct_output && out_samples >= in_samples) {
-            /* in some rare cases we can copy input to output and upmix
-               directly in the output buffer */
-            av_dlog(avr, "[copy] %s to output\n", current_buffer->name);
-            ret = ff_audio_data_copy(&output_buffer, current_buffer,
-                                     avr->remap_point == REMAP_OUT_COPY ?
-                                     &avr->ch_map_info : NULL);
-            if (ret < 0)
-                return ret;
-            current_buffer = &output_buffer;
-        } else if (avr->remap_point == REMAP_OUT_COPY &&
-                   (!direct_output || out_samples < in_samples)) {
-            /* if remapping channels during output copy, we may need to
-             * use an intermediate buffer in order to remap before adding
-             * samples to the output fifo */
-            av_dlog(avr, "[copy] %s to out_buffer\n", current_buffer->name);
-            ret = ff_audio_data_copy(avr->out_buffer, current_buffer,
-                                     &avr->ch_map_info);
-            if (ret < 0)
-                return ret;
-            current_buffer = avr->out_buffer;
-        } else if (avr->in_copy_needed || avr->in_convert_needed) {
-            /* if needed, copy or convert input to in_buffer, and downmix if
-               applicable */
-            if (avr->in_convert_needed) {
-                ret = ff_audio_data_realloc(avr->in_buffer,
-                                            current_buffer->nb_samples);
-                if (ret < 0)
-                    return ret;
-                av_dlog(avr, "[convert] %s to in_buffer\n", current_buffer->name);
-                ret = ff_audio_convert(avr->ac_in, avr->in_buffer,
-                                       current_buffer);
-                if (ret < 0)
-                    return ret;
-            } else {
-                av_dlog(avr, "[copy] %s to in_buffer\n", current_buffer->name);
-                ret = ff_audio_data_copy(avr->in_buffer, current_buffer,
-                                         avr->remap_point == REMAP_IN_COPY ?
-                                         &avr->ch_map_info : NULL);
-                if (ret < 0)
-                    return ret;
-            }
-            ff_audio_data_set_channels(avr->in_buffer, avr->in_channels);
-            if (avr->downmix_needed) {
-                av_dlog(avr, "[downmix] in_buffer\n");
-                ret = ff_audio_mix(avr->am, avr->in_buffer);
-                if (ret < 0)
-                    return ret;
-            }
-            current_buffer = avr->in_buffer;
-        }
-    } else {
-        /* flush resampling buffer and/or output FIFO if input is NULL */
-        if (!avr->resample_needed)
-            return handle_buffered_output(avr, output ? &output_buffer : NULL,
-                                          NULL);
-        current_buffer = NULL;
-    }
-
-    if (avr->resample_needed) {
-        AudioData *resample_out;
-
-        if (!avr->out_convert_needed && direct_output && out_samples > 0)
-            resample_out = &output_buffer;
-        else
-            resample_out = avr->resample_out_buffer;
-        av_dlog(avr, "[resample] %s to %s\n",
-                current_buffer ? current_buffer->name : "null",
-                resample_out->name);
-        ret = ff_audio_resample(avr->resample, resample_out,
-                                current_buffer);
-        if (ret < 0)
-            return ret;
-
-        /* if resampling did not produce any samples, just return 0 */
-        if (resample_out->nb_samples == 0) {
-            av_dlog(avr, "[end conversion]\n");
-            return 0;
-        }
-
-        current_buffer = resample_out;
-    }
-
-    if (avr->upmix_needed) {
-        av_dlog(avr, "[upmix] %s\n", current_buffer->name);
-        ret = ff_audio_mix(avr->am, current_buffer);
-        if (ret < 0)
-            return ret;
-    }
-
-    /* if we resampled or upmixed directly to output, return here */
-    if (current_buffer == &output_buffer) {
-        av_dlog(avr, "[end conversion]\n");
-        return current_buffer->nb_samples;
-    }
-
-    if (avr->out_convert_needed) {
-        if (direct_output && out_samples >= current_buffer->nb_samples) {
-            /* convert directly to output */
-            av_dlog(avr, "[convert] %s to output\n", current_buffer->name);
-            ret = ff_audio_convert(avr->ac_out, &output_buffer, current_buffer);
-            if (ret < 0)
-                return ret;
-
-            av_dlog(avr, "[end conversion]\n");
-            return output_buffer.nb_samples;
-        } else {
-            ret = ff_audio_data_realloc(avr->out_buffer,
-                                        current_buffer->nb_samples);
-            if (ret < 0)
-                return ret;
-            av_dlog(avr, "[convert] %s to out_buffer\n", current_buffer->name);
-            ret = ff_audio_convert(avr->ac_out, avr->out_buffer,
-                                   current_buffer);
-            if (ret < 0)
-                return ret;
-            current_buffer = avr->out_buffer;
-        }
-    }
-
-    return handle_buffered_output(avr, output ? &output_buffer : NULL,
-                                  current_buffer);
-}
-
-int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
-                          int stride)
-{
-    int in_channels, out_channels, i, o;
-
-    if (avr->am)
-        return ff_audio_mix_get_matrix(avr->am, matrix, stride);
-
-    in_channels  = av_get_channel_layout_nb_channels(avr->in_channel_layout);
-    out_channels = av_get_channel_layout_nb_channels(avr->out_channel_layout);
-
-    if ( in_channels <= 0 ||  in_channels > AVRESAMPLE_MAX_CHANNELS ||
-        out_channels <= 0 || out_channels > AVRESAMPLE_MAX_CHANNELS) {
-        av_log(avr, AV_LOG_ERROR, "Invalid channel layouts\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (!avr->mix_matrix) {
-        av_log(avr, AV_LOG_ERROR, "matrix is not set\n");
-        return AVERROR(EINVAL);
-    }
-
-    for (o = 0; o < out_channels; o++)
-        for (i = 0; i < in_channels; i++)
-            matrix[o * stride + i] = avr->mix_matrix[o * in_channels + i];
-
-    return 0;
-}
-
-int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
-                          int stride)
-{
-    int in_channels, out_channels, i, o;
-
-    if (avr->am)
-        return ff_audio_mix_set_matrix(avr->am, matrix, stride);
-
-    in_channels  = av_get_channel_layout_nb_channels(avr->in_channel_layout);
-    out_channels = av_get_channel_layout_nb_channels(avr->out_channel_layout);
-
-    if ( in_channels <= 0 ||  in_channels > AVRESAMPLE_MAX_CHANNELS ||
-        out_channels <= 0 || out_channels > AVRESAMPLE_MAX_CHANNELS) {
-        av_log(avr, AV_LOG_ERROR, "Invalid channel layouts\n");
-        return AVERROR(EINVAL);
-    }
-
-    if (avr->mix_matrix)
-        av_freep(&avr->mix_matrix);
-    avr->mix_matrix = av_malloc(in_channels * out_channels *
-                                sizeof(*avr->mix_matrix));
-    if (!avr->mix_matrix)
-        return AVERROR(ENOMEM);
-
-    for (o = 0; o < out_channels; o++)
-        for (i = 0; i < in_channels; i++)
-            avr->mix_matrix[o * in_channels + i] = matrix[o * stride + i];
-
-    return 0;
-}
-
-int avresample_set_channel_mapping(AVAudioResampleContext *avr,
-                                   const int *channel_map)
-{
-    ChannelMapInfo *info = &avr->ch_map_info;
-    int in_channels, ch, i;
-
-    in_channels = av_get_channel_layout_nb_channels(avr->in_channel_layout);
-    if (in_channels <= 0 ||  in_channels > AVRESAMPLE_MAX_CHANNELS) {
-        av_log(avr, AV_LOG_ERROR, "Invalid input channel layout\n");
-        return AVERROR(EINVAL);
-    }
-
-    memset(info, 0, sizeof(*info));
-    memset(info->input_map, -1, sizeof(info->input_map));
-
-    for (ch = 0; ch < in_channels; ch++) {
-        if (channel_map[ch] >= in_channels) {
-            av_log(avr, AV_LOG_ERROR, "Invalid channel map\n");
-            return AVERROR(EINVAL);
-        }
-        if (channel_map[ch] < 0) {
-            info->channel_zero[ch] =  1;
-            info->channel_map[ch]  = -1;
-            info->do_zero          =  1;
-        } else if (info->input_map[channel_map[ch]] >= 0) {
-            info->channel_copy[ch] = info->input_map[channel_map[ch]];
-            info->channel_map[ch]  = -1;
-            info->do_copy          =  1;
-        } else {
-            info->channel_map[ch]            = channel_map[ch];
-            info->input_map[channel_map[ch]] = ch;
-            info->do_remap                   =  1;
-        }
-    }
-    /* Fill-in unmapped input channels with unmapped output channels.
-       This is used when remapping during conversion from interleaved to
-       planar format. */
-    for (ch = 0, i = 0; ch < in_channels && i < in_channels; ch++, i++) {
-        while (ch < in_channels && info->input_map[ch] >= 0)
-            ch++;
-        while (i < in_channels && info->channel_map[i] >= 0)
-            i++;
-        if (ch >= in_channels || i >= in_channels)
-            break;
-        info->input_map[ch] = i;
-    }
-
-    avr->use_channel_map = 1;
-    return 0;
-}
-
-int avresample_available(AVAudioResampleContext *avr)
-{
-    return av_audio_fifo_size(avr->out_fifo);
-}
-
-int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples)
-{
-    if (!output)
-        return av_audio_fifo_drain(avr->out_fifo, nb_samples);
-    return av_audio_fifo_read(avr->out_fifo, (void**)output, nb_samples);
-}
-
-unsigned avresample_version(void)
-{
-    return LIBAVRESAMPLE_VERSION_INT;
-}
-
-const char *avresample_license(void)
-{
-#define LICENSE_PREFIX "libavresample license: "
-    return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
-}
-
-const char *avresample_configuration(void)
-{
-    return LIBAV_CONFIGURATION;
-}
diff --git a/deps/libav/libavresample/version.h b/deps/libav/libavresample/version.h
deleted file mode 100644
index fce5770..0000000
--- a/deps/libav/libavresample/version.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVRESAMPLE_VERSION_H
-#define AVRESAMPLE_VERSION_H
-
-/**
- * @file
- * @ingroup lavr
- * Libavresample version macros.
- */
-
-#include "libavutil/version.h"
-
-#define LIBAVRESAMPLE_VERSION_MAJOR  1
-#define LIBAVRESAMPLE_VERSION_MINOR  1
-#define LIBAVRESAMPLE_VERSION_MICRO  0
-
-#define LIBAVRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \
-                                                  LIBAVRESAMPLE_VERSION_MINOR, \
-                                                  LIBAVRESAMPLE_VERSION_MICRO)
-#define LIBAVRESAMPLE_VERSION          AV_VERSION(LIBAVRESAMPLE_VERSION_MAJOR, \
-                                                  LIBAVRESAMPLE_VERSION_MINOR, \
-                                                  LIBAVRESAMPLE_VERSION_MICRO)
-#define LIBAVRESAMPLE_BUILD        LIBAVRESAMPLE_VERSION_INT
-
-#define LIBAVRESAMPLE_IDENT        "Lavr" AV_STRINGIFY(LIBAVRESAMPLE_VERSION)
-
-/**
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- */
-
-#ifndef FF_API_RESAMPLE_CLOSE_OPEN
-#define FF_API_RESAMPLE_CLOSE_OPEN (LIBAVRESAMPLE_VERSION_MAJOR < 2)
-#endif
-
-#endif /* AVRESAMPLE_VERSION_H */
diff --git a/deps/libav/libavresample/x86/Makefile b/deps/libav/libavresample/x86/Makefile
deleted file mode 100644
index 0ca2d79..0000000
--- a/deps/libav/libavresample/x86/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-OBJS      += x86/audio_convert_init.o                                   \
-             x86/audio_mix_init.o                                       \
-             x86/dither_init.o                                          \
-
-OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
-
-YASM-OBJS += x86/audio_convert.o                                        \
-             x86/audio_mix.o                                            \
-             x86/dither.o                                               \
diff --git a/deps/libav/libavresample/x86/audio_convert.asm b/deps/libav/libavresample/x86/audio_convert.asm
deleted file mode 100644
index 1af1429..0000000
--- a/deps/libav/libavresample/x86/audio_convert.asm
+++ /dev/null
@@ -1,1227 +0,0 @@
-;******************************************************************************
-;* x86 optimized Format Conversion Utils
-;* Copyright (c) 2008 Loren Merritt
-;* Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-%include "util.asm"
-
-SECTION_RODATA 32
-
-pf_s32_inv_scale: times 8 dd 0x30000000
-pf_s32_scale:     times 8 dd 0x4f000000
-pf_s32_clip:      times 8 dd 0x4effffff
-pf_s16_inv_scale: times 4 dd 0x38000000
-pf_s16_scale:     times 4 dd 0x47000000
-pb_shuf_unpack_even:      db -1, -1,  0,  1, -1, -1,  2,  3, -1, -1,  8,  9, -1, -1, 10, 11
-pb_shuf_unpack_odd:       db -1, -1,  4,  5, -1, -1,  6,  7, -1, -1, 12, 13, -1, -1, 14, 15
-pb_interleave_words: SHUFFLE_MASK_W  0,  4,  1,  5,  2,  6,  3,  7
-pb_deinterleave_words: SHUFFLE_MASK_W  0,  2,  4,  6,  1,  3,  5,  7
-pw_zero_even:     times 4 dw 0x0000, 0xffff
-
-SECTION_TEXT
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16_to_s32(int32_t *dst, const int16_t *src, int len);
-;------------------------------------------------------------------------------
-
-INIT_XMM sse2
-cglobal conv_s16_to_s32, 3,3,3, dst, src, len
-    lea      lenq, [2*lend]
-    lea      dstq, [dstq+2*lenq]
-    add      srcq, lenq
-    neg      lenq
-.loop:
-    mova       m2, [srcq+lenq]
-    pxor       m0, m0
-    pxor       m1, m1
-    punpcklwd  m0, m2
-    punpckhwd  m1, m2
-    mova  [dstq+2*lenq       ], m0
-    mova  [dstq+2*lenq+mmsize], m1
-    add      lenq, mmsize
-    jl .loop
-    REP_RET
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16_to_flt(float *dst, const int16_t *src, int len);
-;------------------------------------------------------------------------------
-
-%macro CONV_S16_TO_FLT 0
-cglobal conv_s16_to_flt, 3,3,3, dst, src, len
-    lea      lenq, [2*lend]
-    add      srcq, lenq
-    lea      dstq, [dstq + 2*lenq]
-    neg      lenq
-    mova       m2, [pf_s16_inv_scale]
-    ALIGN 16
-.loop:
-    mova       m0, [srcq+lenq]
-    S16_TO_S32_SX 0, 1
-    cvtdq2ps   m0, m0
-    cvtdq2ps   m1, m1
-    mulps      m0, m2
-    mulps      m1, m2
-    mova  [dstq+2*lenq       ], m0
-    mova  [dstq+2*lenq+mmsize], m1
-    add      lenq, mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S16_TO_FLT
-INIT_XMM sse4
-CONV_S16_TO_FLT
-
-;------------------------------------------------------------------------------
-; void ff_conv_s32_to_s16(int16_t *dst, const int32_t *src, int len);
-;------------------------------------------------------------------------------
-
-%macro CONV_S32_TO_S16 0
-cglobal conv_s32_to_s16, 3,3,4, dst, src, len
-    lea     lenq, [2*lend]
-    lea     srcq, [srcq+2*lenq]
-    add     dstq, lenq
-    neg     lenq
-.loop:
-    mova      m0, [srcq+2*lenq         ]
-    mova      m1, [srcq+2*lenq+  mmsize]
-    mova      m2, [srcq+2*lenq+2*mmsize]
-    mova      m3, [srcq+2*lenq+3*mmsize]
-    psrad     m0, 16
-    psrad     m1, 16
-    psrad     m2, 16
-    psrad     m3, 16
-    packssdw  m0, m1
-    packssdw  m2, m3
-    mova  [dstq+lenq       ], m0
-    mova  [dstq+lenq+mmsize], m2
-    add     lenq, mmsize*2
-    jl .loop
-%if mmsize == 8
-    emms
-    RET
-%else
-    REP_RET
-%endif
-%endmacro
-
-INIT_MMX mmx
-CONV_S32_TO_S16
-INIT_XMM sse2
-CONV_S32_TO_S16
-
-;------------------------------------------------------------------------------
-; void ff_conv_s32_to_flt(float *dst, const int32_t *src, int len);
-;------------------------------------------------------------------------------
-
-%macro CONV_S32_TO_FLT 0
-cglobal conv_s32_to_flt, 3,3,3, dst, src, len
-    lea     lenq, [4*lend]
-    add     srcq, lenq
-    add     dstq, lenq
-    neg     lenq
-    mova      m0, [pf_s32_inv_scale]
-    ALIGN 16
-.loop:
-    cvtdq2ps  m1, [srcq+lenq       ]
-    cvtdq2ps  m2, [srcq+lenq+mmsize]
-    mulps     m1, m1, m0
-    mulps     m2, m2, m0
-    mova  [dstq+lenq       ], m1
-    mova  [dstq+lenq+mmsize], m2
-    add     lenq, mmsize*2
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S32_TO_FLT
-INIT_YMM avx
-CONV_S32_TO_FLT
-
-;------------------------------------------------------------------------------
-; void ff_conv_flt_to_s16(int16_t *dst, const float *src, int len);
-;------------------------------------------------------------------------------
-
-INIT_XMM sse2
-cglobal conv_flt_to_s16, 3,3,5, dst, src, len
-    lea     lenq, [2*lend]
-    lea     srcq, [srcq+2*lenq]
-    add     dstq, lenq
-    neg     lenq
-    mova      m4, [pf_s16_scale]
-.loop:
-    mova      m0, [srcq+2*lenq         ]
-    mova      m1, [srcq+2*lenq+1*mmsize]
-    mova      m2, [srcq+2*lenq+2*mmsize]
-    mova      m3, [srcq+2*lenq+3*mmsize]
-    mulps     m0, m4
-    mulps     m1, m4
-    mulps     m2, m4
-    mulps     m3, m4
-    cvtps2dq  m0, m0
-    cvtps2dq  m1, m1
-    cvtps2dq  m2, m2
-    cvtps2dq  m3, m3
-    packssdw  m0, m1
-    packssdw  m2, m3
-    mova  [dstq+lenq       ], m0
-    mova  [dstq+lenq+mmsize], m2
-    add     lenq, mmsize*2
-    jl .loop
-    REP_RET
-
-;------------------------------------------------------------------------------
-; void ff_conv_flt_to_s32(int32_t *dst, const float *src, int len);
-;------------------------------------------------------------------------------
-
-%macro CONV_FLT_TO_S32 0
-cglobal conv_flt_to_s32, 3,3,6, dst, src, len
-    lea     lenq, [lend*4]
-    add     srcq, lenq
-    add     dstq, lenq
-    neg     lenq
-    mova      m4, [pf_s32_scale]
-    mova      m5, [pf_s32_clip]
-.loop:
-    mulps     m0, m4, [srcq+lenq         ]
-    mulps     m1, m4, [srcq+lenq+1*mmsize]
-    mulps     m2, m4, [srcq+lenq+2*mmsize]
-    mulps     m3, m4, [srcq+lenq+3*mmsize]
-    minps     m0, m0, m5
-    minps     m1, m1, m5
-    minps     m2, m2, m5
-    minps     m3, m3, m5
-    cvtps2dq  m0, m0
-    cvtps2dq  m1, m1
-    cvtps2dq  m2, m2
-    cvtps2dq  m3, m3
-    mova  [dstq+lenq         ], m0
-    mova  [dstq+lenq+1*mmsize], m1
-    mova  [dstq+lenq+2*mmsize], m2
-    mova  [dstq+lenq+3*mmsize], m3
-    add     lenq, mmsize*4
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_FLT_TO_S32
-INIT_YMM avx
-CONV_FLT_TO_S32
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16p_to_s16_2ch(int16_t *dst, int16_t *const *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_S16P_TO_S16_2CH 0
-cglobal conv_s16p_to_s16_2ch, 3,4,5, dst, src0, len, src1
-    mov       src1q, [src0q+gprsize]
-    mov       src0q, [src0q        ]
-    lea        lenq, [2*lend]
-    add       src0q, lenq
-    add       src1q, lenq
-    lea        dstq, [dstq+2*lenq]
-    neg        lenq
-.loop:
-    mova         m0, [src0q+lenq       ]
-    mova         m1, [src1q+lenq       ]
-    mova         m2, [src0q+lenq+mmsize]
-    mova         m3, [src1q+lenq+mmsize]
-    SBUTTERFLY2  wd, 0, 1, 4
-    SBUTTERFLY2  wd, 2, 3, 4
-    mova  [dstq+2*lenq+0*mmsize], m0
-    mova  [dstq+2*lenq+1*mmsize], m1
-    mova  [dstq+2*lenq+2*mmsize], m2
-    mova  [dstq+2*lenq+3*mmsize], m3
-    add        lenq, 2*mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S16P_TO_S16_2CH
-INIT_XMM avx
-CONV_S16P_TO_S16_2CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16p_to_s16_6ch(int16_t *dst, int16_t *const *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-;------------------------------------------------------------------------------
-; NOTE: In the 6-channel functions, len could be used as an index on x86-64
-;       instead of just a counter, which would avoid incrementing the
-;       pointers, but the extra complexity and amount of code is not worth
-;       the small gain. On x86-32 there are not enough registers to use len
-;       as an index without keeping two of the pointers on the stack and
-;       loading them in each iteration.
-;------------------------------------------------------------------------------
-
-%macro CONV_S16P_TO_S16_6CH 0
-%if ARCH_X86_64
-cglobal conv_s16p_to_s16_6ch, 3,8,7, dst, src0, len, src1, src2, src3, src4, src5
-%else
-cglobal conv_s16p_to_s16_6ch, 2,7,7, dst, src0, src1, src2, src3, src4, src5
-%define lend dword r2m
-%endif
-    mov      src1q, [src0q+1*gprsize]
-    mov      src2q, [src0q+2*gprsize]
-    mov      src3q, [src0q+3*gprsize]
-    mov      src4q, [src0q+4*gprsize]
-    mov      src5q, [src0q+5*gprsize]
-    mov      src0q, [src0q]
-    sub      src1q, src0q
-    sub      src2q, src0q
-    sub      src3q, src0q
-    sub      src4q, src0q
-    sub      src5q, src0q
-.loop:
-%if cpuflag(sse2slow)
-    movq        m0, [src0q      ]   ; m0 =  0,  6, 12, 18,  x,  x,  x,  x
-    movq        m1, [src0q+src1q]   ; m1 =  1,  7, 13, 19,  x,  x,  x,  x
-    movq        m2, [src0q+src2q]   ; m2 =  2,  8, 14, 20,  x,  x,  x,  x
-    movq        m3, [src0q+src3q]   ; m3 =  3,  9, 15, 21,  x,  x,  x,  x
-    movq        m4, [src0q+src4q]   ; m4 =  4, 10, 16, 22,  x,  x,  x,  x
-    movq        m5, [src0q+src5q]   ; m5 =  5, 11, 17, 23,  x,  x,  x,  x
-                                    ; unpack words:
-    punpcklwd   m0, m1              ; m0 =  0,  1,  6,  7, 12, 13, 18, 19
-    punpcklwd   m2, m3              ; m2 =  4,  5, 10, 11, 16, 17, 22, 23
-    punpcklwd   m4, m5              ; m4 =  2,  3,  8,  9, 14, 15, 20, 21
-                                    ; blend dwords
-    shufps      m1, m0, m2, q2020   ; m1 =  0,  1, 12, 13,  2,  3, 14, 15
-    shufps      m0, m4, q2031       ; m0 =  6,  7, 18, 19,  4,  5, 16, 17
-    shufps      m2, m4, q3131       ; m2 =  8,  9, 20, 21, 10, 11, 22, 23
-                                    ; shuffle dwords
-    pshufd      m0, m0, q1302       ; m0 =  4,  5,  6,  7, 16, 17, 18, 19
-    pshufd      m1, m1, q3120       ; m1 =  0,  1,  2,  3, 12, 13, 14, 15
-    pshufd      m2, m2, q3120       ; m2 =  8,  9, 10, 11, 20, 21, 22, 23
-    movq   [dstq+0*mmsize/2], m1
-    movq   [dstq+1*mmsize/2], m0
-    movq   [dstq+2*mmsize/2], m2
-    movhps [dstq+3*mmsize/2], m1
-    movhps [dstq+4*mmsize/2], m0
-    movhps [dstq+5*mmsize/2], m2
-    add      src0q, mmsize/2
-    add       dstq, mmsize*3
-    sub       lend, mmsize/4
-%else
-    mova        m0, [src0q      ]   ; m0 =  0,  6, 12, 18, 24, 30, 36, 42
-    mova        m1, [src0q+src1q]   ; m1 =  1,  7, 13, 19, 25, 31, 37, 43
-    mova        m2, [src0q+src2q]   ; m2 =  2,  8, 14, 20, 26, 32, 38, 44
-    mova        m3, [src0q+src3q]   ; m3 =  3,  9, 15, 21, 27, 33, 39, 45
-    mova        m4, [src0q+src4q]   ; m4 =  4, 10, 16, 22, 28, 34, 40, 46
-    mova        m5, [src0q+src5q]   ; m5 =  5, 11, 17, 23, 29, 35, 41, 47
-                                    ; unpack words:
-    SBUTTERFLY2 wd, 0, 1, 6         ; m0 =  0,  1,  6,  7, 12, 13, 18, 19
-                                    ; m1 = 24, 25, 30, 31, 36, 37, 42, 43
-    SBUTTERFLY2 wd, 2, 3, 6         ; m2 =  2,  3,  8,  9, 14, 15, 20, 21
-                                    ; m3 = 26, 27, 32, 33, 38, 39, 44, 45
-    SBUTTERFLY2 wd, 4, 5, 6         ; m4 =  4,  5, 10, 11, 16, 17, 22, 23
-                                    ; m5 = 28, 29, 34, 35, 40, 41, 46, 47
-                                    ; blend dwords
-    shufps      m6, m0, m2, q2020   ; m6 =  0,  1, 12, 13,  2,  3, 14, 15
-    shufps      m0, m4, q2031       ; m0 =  6,  7, 18, 19,  4,  5, 16, 17
-    shufps      m2, m4, q3131       ; m2 =  8,  9, 20, 21, 10, 11, 22, 23
-    SWAP 4,6                        ; m4 =  0,  1, 12, 13,  2,  3, 14, 15
-    shufps      m6, m1, m3, q2020   ; m6 = 24, 25, 36, 37, 26, 27, 38, 39
-    shufps      m1, m5, q2031       ; m1 = 30, 31, 42, 43, 28, 29, 40, 41
-    shufps      m3, m5, q3131       ; m3 = 32, 33, 44, 45, 34, 35, 46, 47
-    SWAP 5,6                        ; m5 = 24, 25, 36, 37, 26, 27, 38, 39
-                                    ; shuffle dwords
-    pshufd      m0, m0, q1302       ; m0 =  4,  5,  6,  7, 16, 17, 18, 19
-    pshufd      m2, m2, q3120       ; m2 =  8,  9, 10, 11, 20, 21, 22, 23
-    pshufd      m4, m4, q3120       ; m4 =  0,  1,  2,  3, 12, 13, 14, 15
-    pshufd      m1, m1, q1302       ; m1 = 28, 29, 30, 31, 40, 41, 42, 43
-    pshufd      m3, m3, q3120       ; m3 = 32, 33, 34, 35, 44, 45, 46, 47
-    pshufd      m5, m5, q3120       ; m5 = 24, 25, 26, 27, 36, 37, 38, 39
-                                    ; shuffle qwords
-    punpcklqdq  m6, m4, m0          ; m6 =  0,  1,  2,  3,  4,  5,  6,  7
-    punpckhqdq  m0, m2              ; m0 = 16, 17, 18, 19, 20, 21, 22, 23
-    shufps      m2, m4, q3210       ; m2 =  8,  9, 10, 11, 12, 13, 14, 15
-    SWAP 4,6                        ; m4 =  0,  1,  2,  3,  4,  5,  6,  7
-    punpcklqdq  m6, m5, m1          ; m6 = 24, 25, 26, 27, 28, 29, 30, 31
-    punpckhqdq  m1, m3              ; m1 = 40, 41, 42, 43, 44, 45, 46, 47
-    shufps      m3, m5, q3210       ; m3 = 32, 33, 34, 35, 36, 37, 38, 39
-    SWAP 5,6                        ; m5 = 24, 25, 26, 27, 28, 29, 30, 31
-    mova   [dstq+0*mmsize], m4
-    mova   [dstq+1*mmsize], m2
-    mova   [dstq+2*mmsize], m0
-    mova   [dstq+3*mmsize], m5
-    mova   [dstq+4*mmsize], m3
-    mova   [dstq+5*mmsize], m1
-    add      src0q, mmsize
-    add       dstq, mmsize*6
-    sub       lend, mmsize/2
-%endif
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S16P_TO_S16_6CH
-INIT_XMM sse2slow
-CONV_S16P_TO_S16_6CH
-INIT_XMM avx
-CONV_S16P_TO_S16_6CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16p_to_flt_2ch(float *dst, int16_t *const *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_S16P_TO_FLT_2CH 0
-cglobal conv_s16p_to_flt_2ch, 3,4,6, dst, src0, len, src1
-    lea       lenq, [2*lend]
-    mov      src1q, [src0q+gprsize]
-    mov      src0q, [src0q        ]
-    lea       dstq, [dstq+4*lenq]
-    add      src0q, lenq
-    add      src1q, lenq
-    neg       lenq
-    mova        m5, [pf_s32_inv_scale]
-.loop:
-    mova        m2, [src0q+lenq]    ; m2 =  0,  2,  4,  6,  8, 10, 12, 14
-    mova        m4, [src1q+lenq]    ; m4 =  1,  3,  5,  7,  9, 11, 13, 15
-    SBUTTERFLY2 wd, 2, 4, 3         ; m2 =  0,  1,  2,  3,  4,  5,  6,  7
-                                    ; m4 =  8,  9, 10, 11, 12, 13, 14, 15
-    pxor        m3, m3
-    punpcklwd   m0, m3, m2          ; m0 =      0,      1,      2,      3
-    punpckhwd   m1, m3, m2          ; m1 =      4,      5,      6,      7
-    punpcklwd   m2, m3, m4          ; m2 =      8,      9,     10,     11
-    punpckhwd   m3, m4              ; m3 =     12,     13,     14,     15
-    cvtdq2ps    m0, m0
-    cvtdq2ps    m1, m1
-    cvtdq2ps    m2, m2
-    cvtdq2ps    m3, m3
-    mulps       m0, m5
-    mulps       m1, m5
-    mulps       m2, m5
-    mulps       m3, m5
-    mova  [dstq+4*lenq         ], m0
-    mova  [dstq+4*lenq+  mmsize], m1
-    mova  [dstq+4*lenq+2*mmsize], m2
-    mova  [dstq+4*lenq+3*mmsize], m3
-    add       lenq, mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S16P_TO_FLT_2CH
-INIT_XMM avx
-CONV_S16P_TO_FLT_2CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16p_to_flt_6ch(float *dst, int16_t *const *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_S16P_TO_FLT_6CH 0
-%if ARCH_X86_64
-cglobal conv_s16p_to_flt_6ch, 3,8,8, dst, src, len, src1, src2, src3, src4, src5
-%else
-cglobal conv_s16p_to_flt_6ch, 2,7,8, dst, src, src1, src2, src3, src4, src5
-%define lend dword r2m
-%endif
-    mov     src1q, [srcq+1*gprsize]
-    mov     src2q, [srcq+2*gprsize]
-    mov     src3q, [srcq+3*gprsize]
-    mov     src4q, [srcq+4*gprsize]
-    mov     src5q, [srcq+5*gprsize]
-    mov      srcq, [srcq]
-    sub     src1q, srcq
-    sub     src2q, srcq
-    sub     src3q, srcq
-    sub     src4q, srcq
-    sub     src5q, srcq
-    mova       m7, [pf_s32_inv_scale]
-%if cpuflag(ssse3)
-    %define unpack_even m6
-    mova       m6, [pb_shuf_unpack_even]
-%if ARCH_X86_64
-    %define unpack_odd m8
-    mova       m8, [pb_shuf_unpack_odd]
-%else
-    %define unpack_odd [pb_shuf_unpack_odd]
-%endif
-%endif
-.loop:
-    movq       m0, [srcq      ]  ; m0 =  0,  6, 12, 18,  x,  x,  x,  x
-    movq       m1, [srcq+src1q]  ; m1 =  1,  7, 13, 19,  x,  x,  x,  x
-    movq       m2, [srcq+src2q]  ; m2 =  2,  8, 14, 20,  x,  x,  x,  x
-    movq       m3, [srcq+src3q]  ; m3 =  3,  9, 15, 21,  x,  x,  x,  x
-    movq       m4, [srcq+src4q]  ; m4 =  4, 10, 16, 22,  x,  x,  x,  x
-    movq       m5, [srcq+src5q]  ; m5 =  5, 11, 17, 23,  x,  x,  x,  x
-                                 ; unpack words:
-    punpcklwd  m0, m1            ; m0 =  0,  1,  6,  7, 12, 13, 18, 19
-    punpcklwd  m2, m3            ; m2 =  2,  3,  8,  9, 14, 15, 20, 21
-    punpcklwd  m4, m5            ; m4 =  4,  5, 10, 11, 16, 17, 22, 23
-                                 ; blend dwords
-    shufps     m1, m4, m0, q3120 ; m1 =  4,  5, 16, 17,  6,  7, 18, 19
-    shufps         m0, m2, q2020 ; m0 =  0,  1, 12, 13,  2,  3, 14, 15
-    shufps         m2, m4, q3131 ; m2 =  8,  9, 20, 21, 10, 11, 22, 23
-%if cpuflag(ssse3)
-    pshufb     m3, m0, unpack_odd   ; m3 =  12,     13,     14,     15
-    pshufb         m0, unpack_even  ; m0 =   0,      1,      2,      3
-    pshufb     m4, m1, unpack_odd   ; m4 =  16,     17,     18,     19
-    pshufb         m1, unpack_even  ; m1 =   4,      5,      6,      7
-    pshufb     m5, m2, unpack_odd   ; m5 =  20,     21,     22,     23
-    pshufb         m2, unpack_even  ; m2 =   8,      9,     10,     11
-%else
-                                 ; shuffle dwords
-    pshufd     m0, m0, q3120     ; m0 =  0,  1,  2,  3, 12, 13, 14, 15
-    pshufd     m1, m1, q3120     ; m1 =  4,  5,  6,  7, 16, 17, 18, 19
-    pshufd     m2, m2, q3120     ; m2 =  8,  9, 10, 11, 20, 21, 22, 23
-    pxor       m6, m6            ; convert s16 in m0-m2 to s32 in m0-m5
-    punpcklwd  m3, m6, m0        ; m3 =      0,      1,      2,      3
-    punpckhwd  m4, m6, m0        ; m4 =     12,     13,     14,     15
-    punpcklwd  m0, m6, m1        ; m0 =      4,      5,      6,      7
-    punpckhwd  m5, m6, m1        ; m5 =     16,     17,     18,     19
-    punpcklwd  m1, m6, m2        ; m1 =      8,      9,     10,     11
-    punpckhwd      m6, m2        ; m6 =     20,     21,     22,     23
-    SWAP 6,2,1,0,3,4,5           ; swap registers 3,0,1,4,5,6 to 0,1,2,3,4,5
-%endif
-    cvtdq2ps   m0, m0            ; convert s32 to float
-    cvtdq2ps   m1, m1
-    cvtdq2ps   m2, m2
-    cvtdq2ps   m3, m3
-    cvtdq2ps   m4, m4
-    cvtdq2ps   m5, m5
-    mulps      m0, m7            ; scale float from s32 range to [-1.0,1.0]
-    mulps      m1, m7
-    mulps      m2, m7
-    mulps      m3, m7
-    mulps      m4, m7
-    mulps      m5, m7
-    mova  [dstq         ], m0
-    mova  [dstq+  mmsize], m1
-    mova  [dstq+2*mmsize], m2
-    mova  [dstq+3*mmsize], m3
-    mova  [dstq+4*mmsize], m4
-    mova  [dstq+5*mmsize], m5
-    add      srcq, mmsize/2
-    add      dstq, mmsize*6
-    sub      lend, mmsize/4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S16P_TO_FLT_6CH
-INIT_XMM ssse3
-CONV_S16P_TO_FLT_6CH
-INIT_XMM avx
-CONV_S16P_TO_FLT_6CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_fltp_to_s16_2ch(int16_t *dst, float *const *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_FLTP_TO_S16_2CH 0
-cglobal conv_fltp_to_s16_2ch, 3,4,3, dst, src0, len, src1
-    lea      lenq, [4*lend]
-    mov     src1q, [src0q+gprsize]
-    mov     src0q, [src0q        ]
-    add      dstq, lenq
-    add     src0q, lenq
-    add     src1q, lenq
-    neg      lenq
-    mova       m2, [pf_s16_scale]
-%if cpuflag(ssse3)
-    mova       m3, [pb_interleave_words]
-%endif
-.loop:
-    mulps      m0, m2, [src0q+lenq] ; m0 =    0,    2,    4,    6
-    mulps      m1, m2, [src1q+lenq] ; m1 =    1,    3,    5,    7
-    cvtps2dq   m0, m0
-    cvtps2dq   m1, m1
-%if cpuflag(ssse3)
-    packssdw   m0, m1               ; m0 = 0, 2, 4, 6, 1, 3, 5, 7
-    pshufb     m0, m3               ; m0 = 0, 1, 2, 3, 4, 5, 6, 7
-%else
-    packssdw   m0, m0               ; m0 = 0, 2, 4, 6, x, x, x, x
-    packssdw   m1, m1               ; m1 = 1, 3, 5, 7, x, x, x, x
-    punpcklwd  m0, m1               ; m0 = 0, 1, 2, 3, 4, 5, 6, 7
-%endif
-    mova  [dstq+lenq], m0
-    add      lenq, mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_FLTP_TO_S16_2CH
-INIT_XMM ssse3
-CONV_FLTP_TO_S16_2CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_fltp_to_s16_6ch(int16_t *dst, float *const *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_FLTP_TO_S16_6CH 0
-%if ARCH_X86_64
-cglobal conv_fltp_to_s16_6ch, 3,8,7, dst, src, len, src1, src2, src3, src4, src5
-%else
-cglobal conv_fltp_to_s16_6ch, 2,7,7, dst, src, src1, src2, src3, src4, src5
-%define lend dword r2m
-%endif
-    mov        src1q, [srcq+1*gprsize]
-    mov        src2q, [srcq+2*gprsize]
-    mov        src3q, [srcq+3*gprsize]
-    mov        src4q, [srcq+4*gprsize]
-    mov        src5q, [srcq+5*gprsize]
-    mov         srcq, [srcq]
-    sub        src1q, srcq
-    sub        src2q, srcq
-    sub        src3q, srcq
-    sub        src4q, srcq
-    sub        src5q, srcq
-    movaps      xmm6, [pf_s16_scale]
-.loop:
-%if cpuflag(sse2)
-    mulps         m0, m6, [srcq      ]
-    mulps         m1, m6, [srcq+src1q]
-    mulps         m2, m6, [srcq+src2q]
-    mulps         m3, m6, [srcq+src3q]
-    mulps         m4, m6, [srcq+src4q]
-    mulps         m5, m6, [srcq+src5q]
-    cvtps2dq      m0, m0
-    cvtps2dq      m1, m1
-    cvtps2dq      m2, m2
-    cvtps2dq      m3, m3
-    cvtps2dq      m4, m4
-    cvtps2dq      m5, m5
-    packssdw      m0, m3            ; m0 =  0,  6, 12, 18,  3,  9, 15, 21
-    packssdw      m1, m4            ; m1 =  1,  7, 13, 19,  4, 10, 16, 22
-    packssdw      m2, m5            ; m2 =  2,  8, 14, 20,  5, 11, 17, 23
-                                    ; unpack words:
-    movhlps       m3, m0            ; m3 =  3,  9, 15, 21,  x,  x,  x,  x
-    punpcklwd     m0, m1            ; m0 =  0,  1,  6,  7, 12, 13, 18, 19
-    punpckhwd     m1, m2            ; m1 =  4,  5, 10, 11, 16, 17, 22, 23
-    punpcklwd     m2, m3            ; m2 =  2,  3,  8,  9, 14, 15, 20, 21
-                                    ; blend dwords:
-    shufps        m3, m0, m2, q2020 ; m3 =  0,  1, 12, 13,  2,  3, 14, 15
-    shufps        m0, m1, q2031     ; m0 =  6,  7, 18, 19,  4,  5, 16, 17
-    shufps        m2, m1, q3131     ; m2 =  8,  9, 20, 21, 10, 11, 22, 23
-                                    ; shuffle dwords:
-    shufps        m1, m2, m3, q3120 ; m1 =  8,  9, 10, 11, 12, 13, 14, 15
-    shufps        m3, m0,     q0220 ; m3 =  0,  1,  2,  3,  4,  5,  6,  7
-    shufps        m0, m2,     q3113 ; m0 = 16, 17, 18, 19, 20, 21, 22, 23
-    mova  [dstq+0*mmsize], m3
-    mova  [dstq+1*mmsize], m1
-    mova  [dstq+2*mmsize], m0
-%else ; sse
-    movlps      xmm0, [srcq      ]
-    movlps      xmm1, [srcq+src1q]
-    movlps      xmm2, [srcq+src2q]
-    movlps      xmm3, [srcq+src3q]
-    movlps      xmm4, [srcq+src4q]
-    movlps      xmm5, [srcq+src5q]
-    mulps       xmm0, xmm6
-    mulps       xmm1, xmm6
-    mulps       xmm2, xmm6
-    mulps       xmm3, xmm6
-    mulps       xmm4, xmm6
-    mulps       xmm5, xmm6
-    cvtps2pi     mm0, xmm0
-    cvtps2pi     mm1, xmm1
-    cvtps2pi     mm2, xmm2
-    cvtps2pi     mm3, xmm3
-    cvtps2pi     mm4, xmm4
-    cvtps2pi     mm5, xmm5
-    packssdw     mm0, mm3           ; m0 =  0,  6,  3,  9
-    packssdw     mm1, mm4           ; m1 =  1,  7,  4, 10
-    packssdw     mm2, mm5           ; m2 =  2,  8,  5, 11
-                                    ; unpack words
-    pshufw       mm3, mm0, q1032    ; m3 =  3,  9,  0,  6
-    punpcklwd    mm0, mm1           ; m0 =  0,  1,  6,  7
-    punpckhwd    mm1, mm2           ; m1 =  4,  5, 10, 11
-    punpcklwd    mm2, mm3           ; m2 =  2,  3,  8,  9
-                                    ; unpack dwords
-    pshufw       mm3, mm0, q1032    ; m3 =  6,  7,  0,  1
-    punpckldq    mm0, mm2           ; m0 =  0,  1,  2,  3 (final)
-    punpckhdq    mm2, mm1           ; m2 =  8,  9, 10, 11 (final)
-    punpckldq    mm1, mm3           ; m1 =  4,  5,  6,  7 (final)
-    mova  [dstq+0*mmsize], mm0
-    mova  [dstq+1*mmsize], mm1
-    mova  [dstq+2*mmsize], mm2
-%endif
-    add       srcq, mmsize
-    add       dstq, mmsize*3
-    sub       lend, mmsize/4
-    jg .loop
-%if mmsize == 8
-    emms
-    RET
-%else
-    REP_RET
-%endif
-%endmacro
-
-INIT_MMX sse
-CONV_FLTP_TO_S16_6CH
-INIT_XMM sse2
-CONV_FLTP_TO_S16_6CH
-INIT_XMM avx
-CONV_FLTP_TO_S16_6CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_fltp_to_flt_2ch(float *dst, float *const *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_FLTP_TO_FLT_2CH 0
-cglobal conv_fltp_to_flt_2ch, 3,4,5, dst, src0, len, src1
-    mov  src1q, [src0q+gprsize]
-    mov  src0q, [src0q]
-    lea   lenq, [4*lend]
-    add  src0q, lenq
-    add  src1q, lenq
-    lea   dstq, [dstq+2*lenq]
-    neg   lenq
-.loop:
-    mova    m0, [src0q+lenq       ]
-    mova    m1, [src1q+lenq       ]
-    mova    m2, [src0q+lenq+mmsize]
-    mova    m3, [src1q+lenq+mmsize]
-    SBUTTERFLYPS 0, 1, 4
-    SBUTTERFLYPS 2, 3, 4
-    mova  [dstq+2*lenq+0*mmsize], m0
-    mova  [dstq+2*lenq+1*mmsize], m1
-    mova  [dstq+2*lenq+2*mmsize], m2
-    mova  [dstq+2*lenq+3*mmsize], m3
-    add   lenq, 2*mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-CONV_FLTP_TO_FLT_2CH
-INIT_XMM avx
-CONV_FLTP_TO_FLT_2CH
-
-;-----------------------------------------------------------------------------
-; void ff_conv_fltp_to_flt_6ch(float *dst, float *const *src, int len,
-;                              int channels);
-;-----------------------------------------------------------------------------
-
-%macro CONV_FLTP_TO_FLT_6CH 0
-cglobal conv_fltp_to_flt_6ch, 2,8,7, dst, src, src1, src2, src3, src4, src5, len
-%if ARCH_X86_64
-    mov     lend, r2d
-%else
-    %define lend dword r2m
-%endif
-    mov    src1q, [srcq+1*gprsize]
-    mov    src2q, [srcq+2*gprsize]
-    mov    src3q, [srcq+3*gprsize]
-    mov    src4q, [srcq+4*gprsize]
-    mov    src5q, [srcq+5*gprsize]
-    mov     srcq, [srcq]
-    sub    src1q, srcq
-    sub    src2q, srcq
-    sub    src3q, srcq
-    sub    src4q, srcq
-    sub    src5q, srcq
-.loop:
-    mova      m0, [srcq      ]
-    mova      m1, [srcq+src1q]
-    mova      m2, [srcq+src2q]
-    mova      m3, [srcq+src3q]
-    mova      m4, [srcq+src4q]
-    mova      m5, [srcq+src5q]
-%if cpuflag(sse4)
-    SBUTTERFLYPS 0, 1, 6
-    SBUTTERFLYPS 2, 3, 6
-    SBUTTERFLYPS 4, 5, 6
-
-    blendps   m6, m4, m0, 1100b
-    movlhps   m0, m2
-    movhlps   m4, m2
-    blendps   m2, m5, m1, 1100b
-    movlhps   m1, m3
-    movhlps   m5, m3
-
-    movaps [dstq   ], m0
-    movaps [dstq+16], m6
-    movaps [dstq+32], m4
-    movaps [dstq+48], m1
-    movaps [dstq+64], m2
-    movaps [dstq+80], m5
-%else ; mmx
-    SBUTTERFLY dq, 0, 1, 6
-    SBUTTERFLY dq, 2, 3, 6
-    SBUTTERFLY dq, 4, 5, 6
-
-    movq   [dstq   ], m0
-    movq   [dstq+ 8], m2
-    movq   [dstq+16], m4
-    movq   [dstq+24], m1
-    movq   [dstq+32], m3
-    movq   [dstq+40], m5
-%endif
-    add      srcq, mmsize
-    add      dstq, mmsize*6
-    sub      lend, mmsize/4
-    jg .loop
-%if mmsize == 8
-    emms
-    RET
-%else
-    REP_RET
-%endif
-%endmacro
-
-INIT_MMX mmx
-CONV_FLTP_TO_FLT_6CH
-INIT_XMM sse4
-CONV_FLTP_TO_FLT_6CH
-INIT_XMM avx
-CONV_FLTP_TO_FLT_6CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16_to_s16p_2ch(int16_t *const *dst, int16_t *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_S16_TO_S16P_2CH 0
-cglobal conv_s16_to_s16p_2ch, 3,4,4, dst0, src, len, dst1
-    lea       lenq, [2*lend]
-    mov      dst1q, [dst0q+gprsize]
-    mov      dst0q, [dst0q        ]
-    lea       srcq, [srcq+2*lenq]
-    add      dst0q, lenq
-    add      dst1q, lenq
-    neg       lenq
-%if cpuflag(ssse3)
-    mova        m3, [pb_deinterleave_words]
-%endif
-.loop:
-    mova        m0, [srcq+2*lenq       ]  ; m0 =  0,  1,  2,  3,  4,  5,  6,  7
-    mova        m1, [srcq+2*lenq+mmsize]  ; m1 =  8,  9, 10, 11, 12, 13, 14, 15
-%if cpuflag(ssse3)
-    pshufb      m0, m3                    ; m0 =  0,  2,  4,  6,  1,  3,  5,  7
-    pshufb      m1, m3                    ; m1 =  8, 10, 12, 14,  9, 11, 13, 15
-    SBUTTERFLY2 qdq, 0, 1, 2              ; m0 =  0,  2,  4,  6,  8, 10, 12, 14
-                                          ; m1 =  1,  3,  5,  7,  9, 11, 13, 15
-%else ; sse2
-    pshuflw     m0, m0, q3120             ; m0 =  0,  2,  1,  3,  4,  5,  6,  7
-    pshufhw     m0, m0, q3120             ; m0 =  0,  2,  1,  3,  4,  6,  5,  7
-    pshuflw     m1, m1, q3120             ; m1 =  8, 10,  9, 11, 12, 13, 14, 15
-    pshufhw     m1, m1, q3120             ; m1 =  8, 10,  9, 11, 12, 14, 13, 15
-    DEINT2_PS    0, 1, 2                  ; m0 =  0,  2,  4,  6,  8, 10, 12, 14
-                                          ; m1 =  1,  3,  5,  7,  9, 11, 13, 15
-%endif
-    mova  [dst0q+lenq], m0
-    mova  [dst1q+lenq], m1
-    add       lenq, mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S16_TO_S16P_2CH
-INIT_XMM ssse3
-CONV_S16_TO_S16P_2CH
-INIT_XMM avx
-CONV_S16_TO_S16P_2CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16_to_s16p_6ch(int16_t *const *dst, int16_t *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_S16_TO_S16P_6CH 0
-%if ARCH_X86_64
-cglobal conv_s16_to_s16p_6ch, 3,8,5, dst, src, len, dst1, dst2, dst3, dst4, dst5
-%else
-cglobal conv_s16_to_s16p_6ch, 2,7,5, dst, src, dst1, dst2, dst3, dst4, dst5
-%define lend dword r2m
-%endif
-    mov     dst1q, [dstq+  gprsize]
-    mov     dst2q, [dstq+2*gprsize]
-    mov     dst3q, [dstq+3*gprsize]
-    mov     dst4q, [dstq+4*gprsize]
-    mov     dst5q, [dstq+5*gprsize]
-    mov      dstq, [dstq          ]
-    sub     dst1q, dstq
-    sub     dst2q, dstq
-    sub     dst3q, dstq
-    sub     dst4q, dstq
-    sub     dst5q, dstq
-.loop:
-    mova       m0, [srcq+0*mmsize]      ; m0 =  0,  1,  2,  3,  4,  5,  6,  7
-    mova       m3, [srcq+1*mmsize]      ; m3 =  8,  9, 10, 11, 12, 13, 14, 15
-    mova       m2, [srcq+2*mmsize]      ; m2 = 16, 17, 18, 19, 20, 21, 22, 23
-    PALIGNR    m1, m3, m0, 12, m4       ; m1 =  6,  7,  8,  9, 10, 11,  x,  x
-    shufps     m3, m2, q1032            ; m3 = 12, 13, 14, 15, 16, 17, 18, 19
-    psrldq     m2, 4                    ; m2 = 18, 19, 20, 21, 22, 23,  x,  x
-    SBUTTERFLY2 wd, 0, 1, 4             ; m0 =  0,  6,  1,  7,  2,  8,  3,  9
-                                        ; m1 =  4, 10,  5, 11,  x,  x,  x,  x
-    SBUTTERFLY2 wd, 3, 2, 4             ; m3 = 12, 18, 13, 19, 14, 20, 15, 21
-                                        ; m2 = 16, 22, 17, 23,  x,  x,  x,  x
-    SBUTTERFLY2 dq, 0, 3, 4             ; m0 =  0,  6, 12, 18,  1,  7, 13, 19
-                                        ; m3 =  2,  8, 14, 20,  3,  9, 15, 21
-    punpckldq  m1, m2                   ; m1 =  4, 10, 16, 22,  5, 11, 17, 23
-    movq    [dstq      ], m0
-    movhps  [dstq+dst1q], m0
-    movq    [dstq+dst2q], m3
-    movhps  [dstq+dst3q], m3
-    movq    [dstq+dst4q], m1
-    movhps  [dstq+dst5q], m1
-    add      srcq, mmsize*3
-    add      dstq, mmsize/2
-    sub      lend, mmsize/4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S16_TO_S16P_6CH
-INIT_XMM ssse3
-CONV_S16_TO_S16P_6CH
-INIT_XMM avx
-CONV_S16_TO_S16P_6CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16_to_fltp_2ch(float *const *dst, int16_t *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_S16_TO_FLTP_2CH 0
-cglobal conv_s16_to_fltp_2ch, 3,4,5, dst0, src, len, dst1
-    lea       lenq, [4*lend]
-    mov      dst1q, [dst0q+gprsize]
-    mov      dst0q, [dst0q        ]
-    add       srcq, lenq
-    add      dst0q, lenq
-    add      dst1q, lenq
-    neg       lenq
-    mova        m3, [pf_s32_inv_scale]
-    mova        m4, [pw_zero_even]
-.loop:
-    mova        m1, [srcq+lenq]
-    pslld       m0, m1, 16
-    pand        m1, m4
-    cvtdq2ps    m0, m0
-    cvtdq2ps    m1, m1
-    mulps       m0, m0, m3
-    mulps       m1, m1, m3
-    mova  [dst0q+lenq], m0
-    mova  [dst1q+lenq], m1
-    add       lenq, mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S16_TO_FLTP_2CH
-INIT_XMM avx
-CONV_S16_TO_FLTP_2CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_s16_to_fltp_6ch(float *const *dst, int16_t *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_S16_TO_FLTP_6CH 0
-%if ARCH_X86_64
-cglobal conv_s16_to_fltp_6ch, 3,8,7, dst, src, len, dst1, dst2, dst3, dst4, dst5
-%else
-cglobal conv_s16_to_fltp_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5
-%define lend dword r2m
-%endif
-    mov     dst1q, [dstq+  gprsize]
-    mov     dst2q, [dstq+2*gprsize]
-    mov     dst3q, [dstq+3*gprsize]
-    mov     dst4q, [dstq+4*gprsize]
-    mov     dst5q, [dstq+5*gprsize]
-    mov      dstq, [dstq          ]
-    sub     dst1q, dstq
-    sub     dst2q, dstq
-    sub     dst3q, dstq
-    sub     dst4q, dstq
-    sub     dst5q, dstq
-    mova       m6, [pf_s16_inv_scale]
-.loop:
-    mova       m0, [srcq+0*mmsize]  ; m0 =  0,  1,  2,  3,  4,  5,  6,  7
-    mova       m3, [srcq+1*mmsize]  ; m3 =  8,  9, 10, 11, 12, 13, 14, 15
-    mova       m2, [srcq+2*mmsize]  ; m2 = 16, 17, 18, 19, 20, 21, 22, 23
-    PALIGNR    m1, m3, m0, 12, m4   ; m1 =  6,  7,  8,  9, 10, 11,  x,  x
-    shufps     m3, m2, q1032        ; m3 = 12, 13, 14, 15, 16, 17, 18, 19
-    psrldq     m2, 4                ; m2 = 18, 19, 20, 21, 22, 23,  x,  x
-    SBUTTERFLY2 wd, 0, 1, 4         ; m0 =  0,  6,  1,  7,  2,  8,  3,  9
-                                    ; m1 =  4, 10,  5, 11,  x,  x,  x,  x
-    SBUTTERFLY2 wd, 3, 2, 4         ; m3 = 12, 18, 13, 19, 14, 20, 15, 21
-                                    ; m2 = 16, 22, 17, 23,  x,  x,  x,  x
-    SBUTTERFLY2 dq, 0, 3, 4         ; m0 =  0,  6, 12, 18,  1,  7, 13, 19
-                                    ; m3 =  2,  8, 14, 20,  3,  9, 15, 21
-    punpckldq  m1, m2               ; m1 =  4, 10, 16, 22,  5, 11, 17, 23
-    S16_TO_S32_SX 0, 2              ; m0 =      0,      6,     12,     18
-                                    ; m2 =      1,      7,     13,     19
-    S16_TO_S32_SX 3, 4              ; m3 =      2,      8,     14,     20
-                                    ; m4 =      3,      9,     15,     21
-    S16_TO_S32_SX 1, 5              ; m1 =      4,     10,     16,     22
-                                    ; m5 =      5,     11,     17,     23
-    SWAP 1,2,3,4
-    cvtdq2ps   m0, m0
-    cvtdq2ps   m1, m1
-    cvtdq2ps   m2, m2
-    cvtdq2ps   m3, m3
-    cvtdq2ps   m4, m4
-    cvtdq2ps   m5, m5
-    mulps      m0, m6
-    mulps      m1, m6
-    mulps      m2, m6
-    mulps      m3, m6
-    mulps      m4, m6
-    mulps      m5, m6
-    mova  [dstq      ], m0
-    mova  [dstq+dst1q], m1
-    mova  [dstq+dst2q], m2
-    mova  [dstq+dst3q], m3
-    mova  [dstq+dst4q], m4
-    mova  [dstq+dst5q], m5
-    add      srcq, mmsize*3
-    add      dstq, mmsize
-    sub      lend, mmsize/4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_S16_TO_FLTP_6CH
-INIT_XMM ssse3
-CONV_S16_TO_FLTP_6CH
-INIT_XMM sse4
-CONV_S16_TO_FLTP_6CH
-INIT_XMM avx
-CONV_S16_TO_FLTP_6CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_flt_to_s16p_2ch(int16_t *const *dst, float *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_FLT_TO_S16P_2CH 0
-cglobal conv_flt_to_s16p_2ch, 3,4,6, dst0, src, len, dst1
-    lea       lenq, [2*lend]
-    mov      dst1q, [dst0q+gprsize]
-    mov      dst0q, [dst0q        ]
-    lea       srcq, [srcq+4*lenq]
-    add      dst0q, lenq
-    add      dst1q, lenq
-    neg       lenq
-    mova        m5, [pf_s16_scale]
-.loop:
-    mova       m0, [srcq+4*lenq         ]
-    mova       m1, [srcq+4*lenq+  mmsize]
-    mova       m2, [srcq+4*lenq+2*mmsize]
-    mova       m3, [srcq+4*lenq+3*mmsize]
-    DEINT2_PS   0, 1, 4
-    DEINT2_PS   2, 3, 4
-    mulps      m0, m0, m5
-    mulps      m1, m1, m5
-    mulps      m2, m2, m5
-    mulps      m3, m3, m5
-    cvtps2dq   m0, m0
-    cvtps2dq   m1, m1
-    cvtps2dq   m2, m2
-    cvtps2dq   m3, m3
-    packssdw   m0, m2
-    packssdw   m1, m3
-    mova  [dst0q+lenq], m0
-    mova  [dst1q+lenq], m1
-    add      lenq, mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_FLT_TO_S16P_2CH
-INIT_XMM avx
-CONV_FLT_TO_S16P_2CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_flt_to_s16p_6ch(int16_t *const *dst, float *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_FLT_TO_S16P_6CH 0
-%if ARCH_X86_64
-cglobal conv_flt_to_s16p_6ch, 3,8,7, dst, src, len, dst1, dst2, dst3, dst4, dst5
-%else
-cglobal conv_flt_to_s16p_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5
-%define lend dword r2m
-%endif
-    mov     dst1q, [dstq+  gprsize]
-    mov     dst2q, [dstq+2*gprsize]
-    mov     dst3q, [dstq+3*gprsize]
-    mov     dst4q, [dstq+4*gprsize]
-    mov     dst5q, [dstq+5*gprsize]
-    mov      dstq, [dstq          ]
-    sub     dst1q, dstq
-    sub     dst2q, dstq
-    sub     dst3q, dstq
-    sub     dst4q, dstq
-    sub     dst5q, dstq
-    mova       m6, [pf_s16_scale]
-.loop:
-    mulps      m0, m6, [srcq+0*mmsize]
-    mulps      m3, m6, [srcq+1*mmsize]
-    mulps      m1, m6, [srcq+2*mmsize]
-    mulps      m4, m6, [srcq+3*mmsize]
-    mulps      m2, m6, [srcq+4*mmsize]
-    mulps      m5, m6, [srcq+5*mmsize]
-    cvtps2dq   m0, m0
-    cvtps2dq   m1, m1
-    cvtps2dq   m2, m2
-    cvtps2dq   m3, m3
-    cvtps2dq   m4, m4
-    cvtps2dq   m5, m5
-    packssdw   m0, m3               ; m0 =  0,  1,  2,  3,  4,  5,  6,  7
-    packssdw   m1, m4               ; m1 =  8,  9, 10, 11, 12, 13, 14, 15
-    packssdw   m2, m5               ; m2 = 16, 17, 18, 19, 20, 21, 22, 23
-    PALIGNR    m3, m1, m0, 12, m4   ; m3 =  6,  7,  8,  9, 10, 11,  x,  x
-    shufps     m1, m2, q1032        ; m1 = 12, 13, 14, 15, 16, 17, 18, 19
-    psrldq     m2, 4                ; m2 = 18, 19, 20, 21, 22, 23,  x,  x
-    SBUTTERFLY2 wd, 0, 3, 4         ; m0 =  0,  6,  1,  7,  2,  8,  3,  9
-                                    ; m3 =  4, 10,  5, 11,  x,  x,  x,  x
-    SBUTTERFLY2 wd, 1, 2, 4         ; m1 = 12, 18, 13, 19, 14, 20, 15, 21
-                                    ; m2 = 16, 22, 17, 23,  x,  x,  x,  x
-    SBUTTERFLY2 dq, 0, 1, 4         ; m0 =  0,  6, 12, 18,  1,  7, 13, 19
-                                    ; m1 =  2,  8, 14, 20,  3,  9, 15, 21
-    punpckldq  m3, m2               ; m3 =  4, 10, 16, 22,  5, 11, 17, 23
-    movq    [dstq      ], m0
-    movhps  [dstq+dst1q], m0
-    movq    [dstq+dst2q], m1
-    movhps  [dstq+dst3q], m1
-    movq    [dstq+dst4q], m3
-    movhps  [dstq+dst5q], m3
-    add      srcq, mmsize*6
-    add      dstq, mmsize/2
-    sub      lend, mmsize/4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_FLT_TO_S16P_6CH
-INIT_XMM ssse3
-CONV_FLT_TO_S16P_6CH
-INIT_XMM avx
-CONV_FLT_TO_S16P_6CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_flt_to_fltp_2ch(float *const *dst, float *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_FLT_TO_FLTP_2CH 0
-cglobal conv_flt_to_fltp_2ch, 3,4,3, dst0, src, len, dst1
-    lea    lenq, [4*lend]
-    mov   dst1q, [dst0q+gprsize]
-    mov   dst0q, [dst0q        ]
-    lea    srcq, [srcq+2*lenq]
-    add   dst0q, lenq
-    add   dst1q, lenq
-    neg    lenq
-.loop:
-    mova     m0, [srcq+2*lenq       ]
-    mova     m1, [srcq+2*lenq+mmsize]
-    DEINT2_PS 0, 1, 2
-    mova  [dst0q+lenq], m0
-    mova  [dst1q+lenq], m1
-    add    lenq, mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-CONV_FLT_TO_FLTP_2CH
-INIT_XMM avx
-CONV_FLT_TO_FLTP_2CH
-
-;------------------------------------------------------------------------------
-; void ff_conv_flt_to_fltp_6ch(float *const *dst, float *src, int len,
-;                              int channels);
-;------------------------------------------------------------------------------
-
-%macro CONV_FLT_TO_FLTP_6CH 0
-%if ARCH_X86_64
-cglobal conv_flt_to_fltp_6ch, 3,8,7, dst, src, len, dst1, dst2, dst3, dst4, dst5
-%else
-cglobal conv_flt_to_fltp_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5
-%define lend dword r2m
-%endif
-    mov     dst1q, [dstq+  gprsize]
-    mov     dst2q, [dstq+2*gprsize]
-    mov     dst3q, [dstq+3*gprsize]
-    mov     dst4q, [dstq+4*gprsize]
-    mov     dst5q, [dstq+5*gprsize]
-    mov      dstq, [dstq          ]
-    sub     dst1q, dstq
-    sub     dst2q, dstq
-    sub     dst3q, dstq
-    sub     dst4q, dstq
-    sub     dst5q, dstq
-.loop:
-    mova       m0, [srcq+0*mmsize]  ; m0 =  0,  1,  2,  3
-    mova       m1, [srcq+1*mmsize]  ; m1 =  4,  5,  6,  7
-    mova       m2, [srcq+2*mmsize]  ; m2 =  8,  9, 10, 11
-    mova       m3, [srcq+3*mmsize]  ; m3 = 12, 13, 14, 15
-    mova       m4, [srcq+4*mmsize]  ; m4 = 16, 17, 18, 19
-    mova       m5, [srcq+5*mmsize]  ; m5 = 20, 21, 22, 23
-
-    SBUTTERFLY2 dq, 0, 3, 6         ; m0 =  0, 12,  1, 13
-                                    ; m3 =  2, 14,  3, 15
-    SBUTTERFLY2 dq, 1, 4, 6         ; m1 =  4, 16,  5, 17
-                                    ; m4 =  6, 18,  7, 19
-    SBUTTERFLY2 dq, 2, 5, 6         ; m2 =  8, 20,  9, 21
-                                    ; m5 = 10, 22, 11, 23
-    SBUTTERFLY2 dq, 0, 4, 6         ; m0 =  0,  6, 12, 18
-                                    ; m4 =  1,  7, 13, 19
-    SBUTTERFLY2 dq, 3, 2, 6         ; m3 =  2,  8, 14, 20
-                                    ; m2 =  3,  9, 15, 21
-    SBUTTERFLY2 dq, 1, 5, 6         ; m1 =  4, 10, 16, 22
-                                    ; m5 =  5, 11, 17, 23
-    mova [dstq      ], m0
-    mova [dstq+dst1q], m4
-    mova [dstq+dst2q], m3
-    mova [dstq+dst3q], m2
-    mova [dstq+dst4q], m1
-    mova [dstq+dst5q], m5
-    add      srcq, mmsize*6
-    add      dstq, mmsize
-    sub      lend, mmsize/4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-CONV_FLT_TO_FLTP_6CH
-INIT_XMM avx
-CONV_FLT_TO_FLTP_6CH
diff --git a/deps/libav/libavresample/x86/audio_convert_init.c b/deps/libav/libavresample/x86/audio_convert_init.c
deleted file mode 100644
index d85ca84..0000000
--- a/deps/libav/libavresample/x86/audio_convert_init.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavresample/audio_convert.h"
-
-/* flat conversions */
-
-void ff_conv_s16_to_s32_sse2(int16_t *dst, const int32_t *src, int len);
-
-void ff_conv_s16_to_flt_sse2(float *dst, const int16_t *src, int len);
-void ff_conv_s16_to_flt_sse4(float *dst, const int16_t *src, int len);
-
-void ff_conv_s32_to_s16_mmx (int16_t *dst, const int32_t *src, int len);
-void ff_conv_s32_to_s16_sse2(int16_t *dst, const int32_t *src, int len);
-
-void ff_conv_s32_to_flt_sse2(float *dst, const int32_t *src, int len);
-void ff_conv_s32_to_flt_avx (float *dst, const int32_t *src, int len);
-
-void ff_conv_flt_to_s16_sse2(int16_t *dst, const float *src, int len);
-
-void ff_conv_flt_to_s32_sse2(int32_t *dst, const float *src, int len);
-void ff_conv_flt_to_s32_avx (int32_t *dst, const float *src, int len);
-
-/* interleave conversions */
-
-void ff_conv_s16p_to_s16_2ch_sse2(int16_t *dst, int16_t *const *src,
-                                  int len, int channels);
-void ff_conv_s16p_to_s16_2ch_avx (int16_t *dst, int16_t *const *src,
-                                  int len, int channels);
-
-void ff_conv_s16p_to_s16_6ch_sse2(int16_t *dst, int16_t *const *src,
-                                  int len, int channels);
-void ff_conv_s16p_to_s16_6ch_sse2slow(int16_t *dst, int16_t *const *src,
-                                      int len, int channels);
-void ff_conv_s16p_to_s16_6ch_avx (int16_t *dst, int16_t *const *src,
-                                  int len, int channels);
-
-void ff_conv_s16p_to_flt_2ch_sse2(float *dst, int16_t *const *src,
-                                  int len, int channels);
-void ff_conv_s16p_to_flt_2ch_avx (float *dst, int16_t *const *src,
-                                  int len, int channels);
-
-void ff_conv_s16p_to_flt_6ch_sse2 (float *dst, int16_t *const *src,
-                                   int len, int channels);
-void ff_conv_s16p_to_flt_6ch_ssse3(float *dst, int16_t *const *src,
-                                  int len, int channels);
-void ff_conv_s16p_to_flt_6ch_avx  (float *dst, int16_t *const *src,
-                                   int len, int channels);
-
-void ff_conv_fltp_to_s16_2ch_sse2 (int16_t *dst, float *const *src,
-                                   int len, int channels);
-void ff_conv_fltp_to_s16_2ch_ssse3(int16_t *dst, float *const *src,
-                                   int len, int channels);
-
-void ff_conv_fltp_to_s16_6ch_sse (int16_t *dst, float *const *src,
-                                  int len, int channels);
-void ff_conv_fltp_to_s16_6ch_sse2(int16_t *dst, float *const *src,
-                                  int len, int channels);
-void ff_conv_fltp_to_s16_6ch_avx (int16_t *dst, float *const *src,
-                                  int len, int channels);
-
-void ff_conv_fltp_to_flt_2ch_sse(float *dst, float *const *src, int len,
-                                 int channels);
-void ff_conv_fltp_to_flt_2ch_avx(float *dst, float *const *src, int len,
-                                 int channels);
-
-void ff_conv_fltp_to_flt_6ch_mmx (float *dst, float *const *src, int len,
-                                  int channels);
-void ff_conv_fltp_to_flt_6ch_sse4(float *dst, float *const *src, int len,
-                                  int channels);
-void ff_conv_fltp_to_flt_6ch_avx (float *dst, float *const *src, int len,
-                                  int channels);
-
-/* deinterleave conversions */
-
-void ff_conv_s16_to_s16p_2ch_sse2(int16_t *const *dst, int16_t *src,
-                                  int len, int channels);
-void ff_conv_s16_to_s16p_2ch_ssse3(int16_t *const *dst, int16_t *src,
-                                   int len, int channels);
-void ff_conv_s16_to_s16p_2ch_avx (int16_t *const *dst, int16_t *src,
-                                  int len, int channels);
-
-void ff_conv_s16_to_s16p_6ch_sse2 (int16_t *const *dst, int16_t *src,
-                                   int len, int channels);
-void ff_conv_s16_to_s16p_6ch_ssse3(int16_t *const *dst, int16_t *src,
-                                   int len, int channels);
-void ff_conv_s16_to_s16p_6ch_avx  (int16_t *const *dst, int16_t *src,
-                                   int len, int channels);
-
-void ff_conv_s16_to_fltp_2ch_sse2(float *const *dst, int16_t *src,
-                                  int len, int channels);
-void ff_conv_s16_to_fltp_2ch_avx (float *const *dst, int16_t *src,
-                                  int len, int channels);
-
-void ff_conv_s16_to_fltp_6ch_sse2 (float *const *dst, int16_t *src,
-                                   int len, int channels);
-void ff_conv_s16_to_fltp_6ch_ssse3(float *const *dst, int16_t *src,
-                                   int len, int channels);
-void ff_conv_s16_to_fltp_6ch_sse4 (float *const *dst, int16_t *src,
-                                   int len, int channels);
-void ff_conv_s16_to_fltp_6ch_avx  (float *const *dst, int16_t *src,
-                                   int len, int channels);
-
-void ff_conv_flt_to_s16p_2ch_sse2(int16_t *const *dst, float *src,
-                                  int len, int channels);
-void ff_conv_flt_to_s16p_2ch_avx (int16_t *const *dst, float *src,
-                                  int len, int channels);
-
-void ff_conv_flt_to_s16p_6ch_sse2 (int16_t *const *dst, float *src,
-                                   int len, int channels);
-void ff_conv_flt_to_s16p_6ch_ssse3(int16_t *const *dst, float *src,
-                                   int len, int channels);
-void ff_conv_flt_to_s16p_6ch_avx  (int16_t *const *dst, float *src,
-                                   int len, int channels);
-
-void ff_conv_flt_to_fltp_2ch_sse(float *const *dst, float *src, int len,
-                                 int channels);
-void ff_conv_flt_to_fltp_2ch_avx(float *const *dst, float *src, int len,
-                                 int channels);
-
-void ff_conv_flt_to_fltp_6ch_sse2(float *const *dst, float *src, int len,
-                                  int channels);
-void ff_conv_flt_to_fltp_6ch_avx (float *const *dst, float *src, int len,
-                                  int channels);
-
-av_cold void ff_audio_convert_init_x86(AudioConvert *ac)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_MMX(cpu_flags)) {
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32,
-                                  0, 1, 8, "MMX", ff_conv_s32_to_s16_mmx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
-                                  6, 1, 4, "MMX", ff_conv_fltp_to_flt_6ch_mmx);
-    }
-    if (EXTERNAL_SSE(cpu_flags)) {
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
-                                  6, 1, 2, "SSE", ff_conv_fltp_to_s16_6ch_sse);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
-                                  2, 16, 8, "SSE", ff_conv_fltp_to_flt_2ch_sse);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT,
-                                  2, 16, 4, "SSE", ff_conv_flt_to_fltp_2ch_sse);
-    }
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
-            ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32,
-                                      0, 16, 16, "SSE2", ff_conv_s32_to_s16_sse2);
-            ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
-                                      6, 16, 8, "SSE2", ff_conv_s16p_to_s16_6ch_sse2);
-            ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
-                                      6, 16, 4, "SSE2", ff_conv_fltp_to_s16_6ch_sse2);
-        } else {
-            ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
-                                      6, 1, 4, "SSE2SLOW", ff_conv_s16p_to_s16_6ch_sse2slow);
-        }
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16,
-                                  0, 16, 8, "SSE2", ff_conv_s16_to_s32_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16,
-                                  0, 16, 8, "SSE2", ff_conv_s16_to_flt_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32,
-                                  0, 16, 8, "SSE2", ff_conv_s32_to_flt_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT,
-                                  0, 16, 16, "SSE2", ff_conv_flt_to_s16_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT,
-                                  0, 16, 16, "SSE2", ff_conv_flt_to_s32_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
-                                  2, 16, 16, "SSE2", ff_conv_s16p_to_s16_2ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16P,
-                                  2, 16, 8, "SSE2", ff_conv_s16p_to_flt_2ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16P,
-                                  6, 16, 4, "SSE2", ff_conv_s16p_to_flt_6ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
-                                  2, 16, 4, "SSE2", ff_conv_fltp_to_s16_2ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
-                                  2, 16, 8, "SSE2", ff_conv_s16_to_s16p_2ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
-                                  6, 16, 4, "SSE2", ff_conv_s16_to_s16p_6ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16,
-                                  2, 16, 8, "SSE2", ff_conv_s16_to_fltp_2ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16,
-                                  6, 16, 4, "SSE2", ff_conv_s16_to_fltp_6ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_FLT,
-                                  2, 16, 8, "SSE2", ff_conv_flt_to_s16p_2ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_FLT,
-                                  6, 16, 4, "SSE2", ff_conv_flt_to_s16p_6ch_sse2);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT,
-                                  6, 16, 4, "SSE2", ff_conv_flt_to_fltp_6ch_sse2);
-    }
-    if (EXTERNAL_SSSE3(cpu_flags)) {
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16P,
-                                  6, 16, 4, "SSSE3", ff_conv_s16p_to_flt_6ch_ssse3);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
-                                  2, 16, 4, "SSSE3", ff_conv_fltp_to_s16_2ch_ssse3);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
-                                  2, 16, 8, "SSSE3", ff_conv_s16_to_s16p_2ch_ssse3);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
-                                  6, 16, 4, "SSSE3", ff_conv_s16_to_s16p_6ch_ssse3);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16,
-                                  6, 16, 4, "SSSE3", ff_conv_s16_to_fltp_6ch_ssse3);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_FLT,
-                                  6, 16, 4, "SSSE3", ff_conv_flt_to_s16p_6ch_ssse3);
-    }
-    if (EXTERNAL_SSE4(cpu_flags)) {
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16,
-                                  0, 16, 8, "SSE4", ff_conv_s16_to_flt_sse4);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
-                                  6, 16, 4, "SSE4", ff_conv_fltp_to_flt_6ch_sse4);
-    }
-    if (EXTERNAL_AVX(cpu_flags)) {
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32,
-                                  0, 32, 16, "AVX", ff_conv_s32_to_flt_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT,
-                                  0, 32, 32, "AVX", ff_conv_flt_to_s32_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
-                                  2, 16, 16, "AVX", ff_conv_s16p_to_s16_2ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
-                                  6, 16, 8, "AVX", ff_conv_s16p_to_s16_6ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16P,
-                                  2, 16, 8, "AVX", ff_conv_s16p_to_flt_2ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16P,
-                                  6, 16, 4, "AVX", ff_conv_s16p_to_flt_6ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP,
-                                  6, 16, 4, "AVX", ff_conv_fltp_to_s16_6ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
-                                  6, 16, 4, "AVX", ff_conv_fltp_to_flt_6ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
-                                  2, 16, 8, "AVX", ff_conv_s16_to_s16p_2ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16,
-                                  6, 16, 4, "AVX", ff_conv_s16_to_s16p_6ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16,
-                                  2, 16, 8, "AVX", ff_conv_s16_to_fltp_2ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16,
-                                  6, 16, 4, "AVX", ff_conv_s16_to_fltp_6ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_FLT,
-                                  2, 16, 8, "AVX", ff_conv_flt_to_s16p_2ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_FLT,
-                                  6, 16, 4, "AVX", ff_conv_flt_to_s16p_6ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT,
-                                  2, 16, 4, "AVX", ff_conv_flt_to_fltp_2ch_avx);
-        ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT,
-                                  6, 16, 4, "AVX", ff_conv_flt_to_fltp_6ch_avx);
-    }
-}
diff --git a/deps/libav/libavresample/x86/audio_mix.asm b/deps/libav/libavresample/x86/audio_mix.asm
deleted file mode 100644
index 2c657b5..0000000
--- a/deps/libav/libavresample/x86/audio_mix.asm
+++ /dev/null
@@ -1,503 +0,0 @@
-;******************************************************************************
-;* x86 optimized channel mixing
-;* Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-%include "util.asm"
-
-SECTION_TEXT
-
-;-----------------------------------------------------------------------------
-; void ff_mix_2_to_1_fltp_flt(float **src, float **matrix, int len,
-;                             int out_ch, int in_ch);
-;-----------------------------------------------------------------------------
-
-%macro MIX_2_TO_1_FLTP_FLT 0
-cglobal mix_2_to_1_fltp_flt, 3,4,6, src, matrix, len, src1
-    mov       src1q, [srcq+gprsize]
-    mov        srcq, [srcq        ]
-    sub       src1q, srcq
-    mov     matrixq, [matrixq  ]
-    VBROADCASTSS m4, [matrixq  ]
-    VBROADCASTSS m5, [matrixq+4]
-    ALIGN 16
-.loop:
-    mulps        m0, m4, [srcq             ]
-    mulps        m1, m5, [srcq+src1q       ]
-    mulps        m2, m4, [srcq+      mmsize]
-    mulps        m3, m5, [srcq+src1q+mmsize]
-    addps        m0, m0, m1
-    addps        m2, m2, m3
-    mova  [srcq       ], m0
-    mova  [srcq+mmsize], m2
-    add        srcq, mmsize*2
-    sub        lend, mmsize*2/4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-MIX_2_TO_1_FLTP_FLT
-INIT_YMM avx
-MIX_2_TO_1_FLTP_FLT
-
-;-----------------------------------------------------------------------------
-; void ff_mix_2_to_1_s16p_flt(int16_t **src, float **matrix, int len,
-;                             int out_ch, int in_ch);
-;-----------------------------------------------------------------------------
-
-%macro MIX_2_TO_1_S16P_FLT 0
-cglobal mix_2_to_1_s16p_flt, 3,4,6, src, matrix, len, src1
-    mov       src1q, [srcq+gprsize]
-    mov        srcq, [srcq]
-    sub       src1q, srcq
-    mov     matrixq, [matrixq  ]
-    VBROADCASTSS m4, [matrixq  ]
-    VBROADCASTSS m5, [matrixq+4]
-    ALIGN 16
-.loop:
-    mova         m0, [srcq      ]
-    mova         m2, [srcq+src1q]
-    S16_TO_S32_SX 0, 1
-    S16_TO_S32_SX 2, 3
-    cvtdq2ps     m0, m0
-    cvtdq2ps     m1, m1
-    cvtdq2ps     m2, m2
-    cvtdq2ps     m3, m3
-    mulps        m0, m4
-    mulps        m1, m4
-    mulps        m2, m5
-    mulps        m3, m5
-    addps        m0, m2
-    addps        m1, m3
-    cvtps2dq     m0, m0
-    cvtps2dq     m1, m1
-    packssdw     m0, m1
-    mova     [srcq], m0
-    add        srcq, mmsize
-    sub        lend, mmsize/2
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-MIX_2_TO_1_S16P_FLT
-INIT_XMM sse4
-MIX_2_TO_1_S16P_FLT
-
-;-----------------------------------------------------------------------------
-; void ff_mix_2_to_1_s16p_q8(int16_t **src, int16_t **matrix, int len,
-;                            int out_ch, int in_ch);
-;-----------------------------------------------------------------------------
-
-INIT_XMM sse2
-cglobal mix_2_to_1_s16p_q8, 3,4,6, src, matrix, len, src1
-    mov       src1q, [srcq+gprsize]
-    mov        srcq, [srcq]
-    sub       src1q, srcq
-    mov     matrixq, [matrixq]
-    movd         m4, [matrixq]
-    movd         m5, [matrixq]
-    SPLATW       m4, m4, 0
-    SPLATW       m5, m5, 1
-    pxor         m0, m0
-    punpcklwd    m4, m0
-    punpcklwd    m5, m0
-    ALIGN 16
-.loop:
-    mova         m0, [srcq      ]
-    mova         m2, [srcq+src1q]
-    punpckhwd    m1, m0, m0
-    punpcklwd    m0, m0
-    punpckhwd    m3, m2, m2
-    punpcklwd    m2, m2
-    pmaddwd      m0, m4
-    pmaddwd      m1, m4
-    pmaddwd      m2, m5
-    pmaddwd      m3, m5
-    paddd        m0, m2
-    paddd        m1, m3
-    psrad        m0, 8
-    psrad        m1, 8
-    packssdw     m0, m1
-    mova     [srcq], m0
-    add        srcq, mmsize
-    sub        lend, mmsize/2
-    jg .loop
-    REP_RET
-
-;-----------------------------------------------------------------------------
-; void ff_mix_1_to_2_fltp_flt(float **src, float **matrix, int len,
-;                             int out_ch, int in_ch);
-;-----------------------------------------------------------------------------
-
-%macro MIX_1_TO_2_FLTP_FLT 0
-cglobal mix_1_to_2_fltp_flt, 3,5,4, src0, matrix0, len, src1, matrix1
-    mov       src1q, [src0q+gprsize]
-    mov       src0q, [src0q]
-    sub       src1q, src0q
-    mov    matrix1q, [matrix0q+gprsize]
-    mov    matrix0q, [matrix0q]
-    VBROADCASTSS m2, [matrix0q]
-    VBROADCASTSS m3, [matrix1q]
-    ALIGN 16
-.loop:
-    mova         m0, [src0q]
-    mulps        m1, m0, m3
-    mulps        m0, m0, m2
-    mova  [src0q      ], m0
-    mova  [src0q+src1q], m1
-    add       src0q, mmsize
-    sub        lend, mmsize/4
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-MIX_1_TO_2_FLTP_FLT
-INIT_YMM avx
-MIX_1_TO_2_FLTP_FLT
-
-;-----------------------------------------------------------------------------
-; void ff_mix_1_to_2_s16p_flt(int16_t **src, float **matrix, int len,
-;                             int out_ch, int in_ch);
-;-----------------------------------------------------------------------------
-
-%macro MIX_1_TO_2_S16P_FLT 0
-cglobal mix_1_to_2_s16p_flt, 3,5,6, src0, matrix0, len, src1, matrix1
-    mov       src1q, [src0q+gprsize]
-    mov       src0q, [src0q]
-    sub       src1q, src0q
-    mov    matrix1q, [matrix0q+gprsize]
-    mov    matrix0q, [matrix0q]
-    VBROADCASTSS m4, [matrix0q]
-    VBROADCASTSS m5, [matrix1q]
-    ALIGN 16
-.loop:
-    mova         m0, [src0q]
-    S16_TO_S32_SX 0, 2
-    cvtdq2ps     m0, m0
-    cvtdq2ps     m2, m2
-    mulps        m1, m0, m5
-    mulps        m0, m0, m4
-    mulps        m3, m2, m5
-    mulps        m2, m2, m4
-    cvtps2dq     m0, m0
-    cvtps2dq     m1, m1
-    cvtps2dq     m2, m2
-    cvtps2dq     m3, m3
-    packssdw     m0, m2
-    packssdw     m1, m3
-    mova  [src0q      ], m0
-    mova  [src0q+src1q], m1
-    add       src0q, mmsize
-    sub        lend, mmsize/2
-    jg .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-MIX_1_TO_2_S16P_FLT
-INIT_XMM sse4
-MIX_1_TO_2_S16P_FLT
-INIT_XMM avx
-MIX_1_TO_2_S16P_FLT
-
-;-----------------------------------------------------------------------------
-; void ff_mix_3_8_to_1_2_fltp/s16p_flt(float/int16_t **src, float **matrix,
-;                                      int len, int out_ch, int in_ch);
-;-----------------------------------------------------------------------------
-
-%macro MIX_3_8_TO_1_2_FLT 3 ; %1 = in channels, %2 = out channels, %3 = s16p or fltp
-; define some names to make the code clearer
-%assign  in_channels %1
-%assign out_channels %2
-%assign stereo out_channels - 1
-%ifidn %3, s16p
-    %assign is_s16 1
-%else
-    %assign is_s16 0
-%endif
-
-; determine how many matrix elements must go on the stack vs. mmregs
-%assign matrix_elements in_channels * out_channels
-%if is_s16
-    %if stereo
-        %assign needed_mmregs 7
-    %else
-        %assign needed_mmregs 5
-    %endif
-%else
-    %if stereo
-        %assign needed_mmregs 4
-    %else
-        %assign needed_mmregs 3
-    %endif
-%endif
-%assign matrix_elements_mm num_mmregs - needed_mmregs
-%if matrix_elements < matrix_elements_mm
-    %assign matrix_elements_mm matrix_elements
-%endif
-%if matrix_elements_mm < matrix_elements
-    %assign matrix_elements_stack matrix_elements - matrix_elements_mm
-%else
-    %assign matrix_elements_stack 0
-%endif
-%assign matrix_stack_size matrix_elements_stack * mmsize
-
-%assign needed_stack_size -1 * matrix_stack_size
-%if ARCH_X86_32 && in_channels >= 7
-%assign needed_stack_size needed_stack_size - 16
-%endif
-
-cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, needed_stack_size, src0, src1, len, src2, src3, src4, src5, src6, src7
-
-; define src pointers on stack if needed
-%if matrix_elements_stack > 0 && ARCH_X86_32 && in_channels >= 7
-    %define src5m [rsp+matrix_stack_size+0]
-    %define src6m [rsp+matrix_stack_size+4]
-    %define src7m [rsp+matrix_stack_size+8]
-%endif
-
-; load matrix pointers
-%define matrix0q r1q
-%define matrix1q r3q
-%if stereo
-    mov      matrix1q, [matrix0q+gprsize]
-%endif
-    mov      matrix0q, [matrix0q]
-
-; define matrix coeff names
-%assign %%i 0
-%assign %%j needed_mmregs
-%rep in_channels
-    %if %%i >= matrix_elements_mm
-        CAT_XDEFINE mx_stack_0_, %%i, 1
-        CAT_XDEFINE mx_0_, %%i, [rsp+(%%i-matrix_elements_mm)*mmsize]
-    %else
-        CAT_XDEFINE mx_stack_0_, %%i, 0
-        CAT_XDEFINE mx_0_, %%i, m %+ %%j
-        %assign %%j %%j+1
-    %endif
-    %assign %%i %%i+1
-%endrep
-%if stereo
-%assign %%i 0
-%rep in_channels
-    %if in_channels + %%i >= matrix_elements_mm
-        CAT_XDEFINE mx_stack_1_, %%i, 1
-        CAT_XDEFINE mx_1_, %%i, [rsp+(in_channels+%%i-matrix_elements_mm)*mmsize]
-    %else
-        CAT_XDEFINE mx_stack_1_, %%i, 0
-        CAT_XDEFINE mx_1_, %%i, m %+ %%j
-        %assign %%j %%j+1
-    %endif
-    %assign %%i %%i+1
-%endrep
-%endif
-
-; load/splat matrix coeffs
-%assign %%i 0
-%rep in_channels
-    %if mx_stack_0_ %+ %%i
-        VBROADCASTSS m0, [matrix0q+4*%%i]
-        mova  mx_0_ %+ %%i, m0
-    %else
-        VBROADCASTSS mx_0_ %+ %%i, [matrix0q+4*%%i]
-    %endif
-    %if stereo
-    %if mx_stack_1_ %+ %%i
-        VBROADCASTSS m0, [matrix1q+4*%%i]
-        mova  mx_1_ %+ %%i, m0
-    %else
-        VBROADCASTSS mx_1_ %+ %%i, [matrix1q+4*%%i]
-    %endif
-    %endif
-    %assign %%i %%i+1
-%endrep
-
-; load channel pointers to registers as offsets from the first channel pointer
-%if ARCH_X86_64
-    movsxd       lenq, r2d
-%endif
-    shl          lenq, 2-is_s16
-%assign %%i 1
-%rep (in_channels - 1)
-    %if ARCH_X86_32 && in_channels >= 7 && %%i >= 5
-    mov         src5q, [src0q+%%i*gprsize]
-    add         src5q, lenq
-    mov         src %+ %%i %+ m, src5q
-    %else
-    mov         src %+ %%i %+ q, [src0q+%%i*gprsize]
-    add         src %+ %%i %+ q, lenq
-    %endif
-    %assign %%i %%i+1
-%endrep
-    mov         src0q, [src0q]
-    add         src0q, lenq
-    neg          lenq
-.loop:
-; for x86-32 with 7-8 channels we do not have enough gp registers for all src
-; pointers, so we have to load some of them from the stack each time
-%define copy_src_from_stack ARCH_X86_32 && in_channels >= 7 && %%i >= 5
-%if is_s16
-    ; mix with s16p input
-    mova           m0, [src0q+lenq]
-    S16_TO_S32_SX   0, 1
-    cvtdq2ps       m0, m0
-    cvtdq2ps       m1, m1
-    %if stereo
-    mulps          m2, m0, mx_1_0
-    mulps          m3, m1, mx_1_0
-    %endif
-    mulps          m0, m0, mx_0_0
-    mulps          m1, m1, mx_0_0
-%assign %%i 1
-%rep (in_channels - 1)
-    %if copy_src_from_stack
-        %define src_ptr src5q
-    %else
-        %define src_ptr src %+ %%i %+ q
-    %endif
-    %if stereo
-    %if copy_src_from_stack
-    mov       src_ptr, src %+ %%i %+ m
-    %endif
-    mova           m4, [src_ptr+lenq]
-    S16_TO_S32_SX   4, 5
-    cvtdq2ps       m4, m4
-    cvtdq2ps       m5, m5
-    FMULADD_PS     m2, m4, mx_1_ %+ %%i, m2, m6
-    FMULADD_PS     m3, m5, mx_1_ %+ %%i, m3, m6
-    FMULADD_PS     m0, m4, mx_0_ %+ %%i, m0, m4
-    FMULADD_PS     m1, m5, mx_0_ %+ %%i, m1, m5
-    %else
-    %if copy_src_from_stack
-    mov       src_ptr, src %+ %%i %+ m
-    %endif
-    mova           m2, [src_ptr+lenq]
-    S16_TO_S32_SX   2, 3
-    cvtdq2ps       m2, m2
-    cvtdq2ps       m3, m3
-    FMULADD_PS     m0, m2, mx_0_ %+ %%i, m0, m4
-    FMULADD_PS     m1, m3, mx_0_ %+ %%i, m1, m4
-    %endif
-    %assign %%i %%i+1
-%endrep
-    %if stereo
-    cvtps2dq       m2, m2
-    cvtps2dq       m3, m3
-    packssdw       m2, m3
-    mova [src1q+lenq], m2
-    %endif
-    cvtps2dq       m0, m0
-    cvtps2dq       m1, m1
-    packssdw       m0, m1
-    mova [src0q+lenq], m0
-%else
-    ; mix with fltp input
-    %if stereo || mx_stack_0_0
-    mova           m0, [src0q+lenq]
-    %endif
-    %if stereo
-    mulps          m1, m0, mx_1_0
-    %endif
-    %if stereo || mx_stack_0_0
-    mulps          m0, m0, mx_0_0
-    %else
-    mulps          m0, mx_0_0, [src0q+lenq]
-    %endif
-%assign %%i 1
-%rep (in_channels - 1)
-    %if copy_src_from_stack
-        %define src_ptr src5q
-        mov   src_ptr, src %+ %%i %+ m
-    %else
-        %define src_ptr src %+ %%i %+ q
-    %endif
-    ; avoid extra load for mono if matrix is in a mm register
-    %if stereo || mx_stack_0_ %+ %%i
-    mova           m2, [src_ptr+lenq]
-    %endif
-    %if stereo
-    FMULADD_PS     m1, m2, mx_1_ %+ %%i, m1, m3
-    %endif
-    %if stereo || mx_stack_0_ %+ %%i
-    FMULADD_PS     m0, m2, mx_0_ %+ %%i, m0, m2
-    %else
-    FMULADD_PS     m0, mx_0_ %+ %%i, [src_ptr+lenq], m0, m1
-    %endif
-    %assign %%i %%i+1
-%endrep
-    mova [src0q+lenq], m0
-    %if stereo
-    mova [src1q+lenq], m1
-    %endif
-%endif
-
-    add          lenq, mmsize
-    jl .loop
-; zero ymm high halves
-%if mmsize == 32
-    vzeroupper
-%endif
-    RET
-%endmacro
-
-%macro MIX_3_8_TO_1_2_FLT_FUNCS 0
-%assign %%i 3
-%rep 6
-    INIT_XMM sse
-    MIX_3_8_TO_1_2_FLT %%i, 1, fltp
-    MIX_3_8_TO_1_2_FLT %%i, 2, fltp
-    INIT_XMM sse2
-    MIX_3_8_TO_1_2_FLT %%i, 1, s16p
-    MIX_3_8_TO_1_2_FLT %%i, 2, s16p
-    INIT_XMM sse4
-    MIX_3_8_TO_1_2_FLT %%i, 1, s16p
-    MIX_3_8_TO_1_2_FLT %%i, 2, s16p
-    ; do not use ymm AVX or FMA4 in x86-32 for 6 or more channels due to stack alignment issues
-    %if ARCH_X86_64 || %%i < 6
-    INIT_YMM avx
-    %else
-    INIT_XMM avx
-    %endif
-    MIX_3_8_TO_1_2_FLT %%i, 1, fltp
-    MIX_3_8_TO_1_2_FLT %%i, 2, fltp
-    INIT_XMM avx
-    MIX_3_8_TO_1_2_FLT %%i, 1, s16p
-    MIX_3_8_TO_1_2_FLT %%i, 2, s16p
-    %if HAVE_FMA4_EXTERNAL
-    %if ARCH_X86_64 || %%i < 6
-    INIT_YMM fma4
-    %else
-    INIT_XMM fma4
-    %endif
-    MIX_3_8_TO_1_2_FLT %%i, 1, fltp
-    MIX_3_8_TO_1_2_FLT %%i, 2, fltp
-    INIT_XMM fma4
-    MIX_3_8_TO_1_2_FLT %%i, 1, s16p
-    MIX_3_8_TO_1_2_FLT %%i, 2, s16p
-    %endif
-    %assign %%i %%i+1
-%endrep
-%endmacro
-
-MIX_3_8_TO_1_2_FLT_FUNCS
diff --git a/deps/libav/libavresample/x86/audio_mix_init.c b/deps/libav/libavresample/x86/audio_mix_init.c
deleted file mode 100644
index 932f6f2..0000000
--- a/deps/libav/libavresample/x86/audio_mix_init.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavresample/audio_mix.h"
-
-void ff_mix_2_to_1_fltp_flt_sse(float **src, float **matrix, int len,
-                                int out_ch, int in_ch);
-void ff_mix_2_to_1_fltp_flt_avx(float **src, float **matrix, int len,
-                                int out_ch, int in_ch);
-
-void ff_mix_2_to_1_s16p_flt_sse2(int16_t **src, float **matrix, int len,
-                                 int out_ch, int in_ch);
-void ff_mix_2_to_1_s16p_flt_sse4(int16_t **src, float **matrix, int len,
-                                 int out_ch, int in_ch);
-
-void ff_mix_2_to_1_s16p_q8_sse2(int16_t **src, int16_t **matrix,
-                                int len, int out_ch, int in_ch);
-
-void ff_mix_1_to_2_fltp_flt_sse(float **src, float **matrix, int len,
-                                int out_ch, int in_ch);
-void ff_mix_1_to_2_fltp_flt_avx(float **src, float **matrix, int len,
-                                int out_ch, int in_ch);
-
-void ff_mix_1_to_2_s16p_flt_sse2(int16_t **src, float **matrix, int len,
-                                 int out_ch, int in_ch);
-void ff_mix_1_to_2_s16p_flt_sse4(int16_t **src, float **matrix, int len,
-                                 int out_ch, int in_ch);
-void ff_mix_1_to_2_s16p_flt_avx (int16_t **src, float **matrix, int len,
-                                 int out_ch, int in_ch);
-
-#define DEFINE_MIX_3_8_TO_1_2(chan)                                     \
-void ff_mix_ ## chan ## _to_1_fltp_flt_sse(float **src,                 \
-                                           float **matrix, int len,     \
-                                           int out_ch, int in_ch);      \
-void ff_mix_ ## chan ## _to_2_fltp_flt_sse(float **src,                 \
-                                           float **matrix, int len,     \
-                                           int out_ch, int in_ch);      \
-                                                                        \
-void ff_mix_ ## chan ## _to_1_s16p_flt_sse2(int16_t **src,              \
-                                            float **matrix, int len,    \
-                                            int out_ch, int in_ch);     \
-void ff_mix_ ## chan ## _to_2_s16p_flt_sse2(int16_t **src,              \
-                                            float **matrix, int len,    \
-                                            int out_ch, int in_ch);     \
-                                                                        \
-void ff_mix_ ## chan ## _to_1_s16p_flt_sse4(int16_t **src,              \
-                                            float **matrix, int len,    \
-                                            int out_ch, int in_ch);     \
-void ff_mix_ ## chan ## _to_2_s16p_flt_sse4(int16_t **src,              \
-                                            float **matrix, int len,    \
-                                            int out_ch, int in_ch);     \
-                                                                        \
-void ff_mix_ ## chan ## _to_1_fltp_flt_avx(float **src,                 \
-                                           float **matrix, int len,     \
-                                           int out_ch, int in_ch);      \
-void ff_mix_ ## chan ## _to_2_fltp_flt_avx(float **src,                 \
-                                           float **matrix, int len,     \
-                                           int out_ch, int in_ch);      \
-                                                                        \
-void ff_mix_ ## chan ## _to_1_s16p_flt_avx(int16_t **src,               \
-                                           float **matrix, int len,     \
-                                           int out_ch, int in_ch);      \
-void ff_mix_ ## chan ## _to_2_s16p_flt_avx(int16_t **src,               \
-                                           float **matrix, int len,     \
-                                           int out_ch, int in_ch);      \
-                                                                        \
-void ff_mix_ ## chan ## _to_1_fltp_flt_fma4(float **src,                \
-                                            float **matrix, int len,    \
-                                            int out_ch, int in_ch);     \
-void ff_mix_ ## chan ## _to_2_fltp_flt_fma4(float **src,                \
-                                            float **matrix, int len,    \
-                                            int out_ch, int in_ch);     \
-                                                                        \
-void ff_mix_ ## chan ## _to_1_s16p_flt_fma4(int16_t **src,              \
-                                            float **matrix, int len,    \
-                                            int out_ch, int in_ch);     \
-void ff_mix_ ## chan ## _to_2_s16p_flt_fma4(int16_t **src,              \
-                                            float **matrix, int len,    \
-                                            int out_ch, int in_ch);
-
-DEFINE_MIX_3_8_TO_1_2(3)
-DEFINE_MIX_3_8_TO_1_2(4)
-DEFINE_MIX_3_8_TO_1_2(5)
-DEFINE_MIX_3_8_TO_1_2(6)
-DEFINE_MIX_3_8_TO_1_2(7)
-DEFINE_MIX_3_8_TO_1_2(8)
-
-#define SET_MIX_3_8_TO_1_2(chan)                                            \
-    if (EXTERNAL_SSE(cpu_flags)) {                                          \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 1, 16, 4, "SSE",                        \
-                              ff_mix_ ## chan ## _to_1_fltp_flt_sse);       \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 2, 16, 4, "SSE",                        \
-                              ff_mix_## chan ##_to_2_fltp_flt_sse);         \
-    }                                                                       \
-    if (EXTERNAL_SSE2(cpu_flags)) {                                         \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 1, 16, 8, "SSE2",                       \
-                              ff_mix_ ## chan ## _to_1_s16p_flt_sse2);      \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 2, 16, 8, "SSE2",                       \
-                              ff_mix_ ## chan ## _to_2_s16p_flt_sse2);      \
-    }                                                                       \
-    if (EXTERNAL_SSE4(cpu_flags)) {                                         \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 1, 16, 8, "SSE4",                       \
-                              ff_mix_ ## chan ## _to_1_s16p_flt_sse4);      \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 2, 16, 8, "SSE4",                       \
-                              ff_mix_ ## chan ## _to_2_s16p_flt_sse4);      \
-    }                                                                       \
-    if (EXTERNAL_AVX(cpu_flags)) {                                          \
-        int ptr_align = 32;                                                 \
-        int smp_align = 8;                                                  \
-        if (ARCH_X86_32 || chan >= 6) {                                     \
-            ptr_align = 16;                                                 \
-            smp_align = 4;                                                  \
-        }                                                                   \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 1, ptr_align, smp_align, "AVX",         \
-                              ff_mix_ ## chan ## _to_1_fltp_flt_avx);       \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 2, ptr_align, smp_align, "AVX",         \
-                              ff_mix_ ## chan ## _to_2_fltp_flt_avx);       \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 1, 16, 8, "AVX",                        \
-                              ff_mix_ ## chan ## _to_1_s16p_flt_avx);       \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 2, 16, 8, "AVX",                        \
-                              ff_mix_ ## chan ## _to_2_s16p_flt_avx);       \
-    }                                                                       \
-    if (EXTERNAL_FMA4(cpu_flags)) {                                         \
-        int ptr_align = 32;                                                 \
-        int smp_align = 8;                                                  \
-        if (ARCH_X86_32 || chan >= 6) {                                     \
-            ptr_align = 16;                                                 \
-            smp_align = 4;                                                  \
-        }                                                                   \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 1, ptr_align, smp_align, "FMA4",        \
-                              ff_mix_ ## chan ## _to_1_fltp_flt_fma4);      \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 2, ptr_align, smp_align, "FMA4",        \
-                              ff_mix_ ## chan ## _to_2_fltp_flt_fma4);      \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 1, 16, 8, "FMA4",                       \
-                              ff_mix_ ## chan ## _to_1_s16p_flt_fma4);      \
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\
-                              chan, 2, 16, 8, "FMA4",                       \
-                              ff_mix_ ## chan ## _to_2_s16p_flt_fma4);      \
-    }
-
-av_cold void ff_audio_mix_init_x86(AudioMix *am)
-{
-#if HAVE_YASM
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_SSE(cpu_flags)) {
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,
-                              2, 1, 16, 8, "SSE", ff_mix_2_to_1_fltp_flt_sse);
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,
-                              1, 2, 16, 4, "SSE", ff_mix_1_to_2_fltp_flt_sse);
-    }
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,
-                              2, 1, 16, 8, "SSE2", ff_mix_2_to_1_s16p_flt_sse2);
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_Q8,
-                              2, 1, 16, 8, "SSE2", ff_mix_2_to_1_s16p_q8_sse2);
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,
-                              1, 2, 16, 8, "SSE2", ff_mix_1_to_2_s16p_flt_sse2);
-    }
-    if (EXTERNAL_SSE4(cpu_flags)) {
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,
-                              2, 1, 16, 8, "SSE4", ff_mix_2_to_1_s16p_flt_sse4);
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,
-                              1, 2, 16, 8, "SSE4", ff_mix_1_to_2_s16p_flt_sse4);
-    }
-    if (EXTERNAL_AVX(cpu_flags)) {
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,
-                              2, 1, 32, 16, "AVX", ff_mix_2_to_1_fltp_flt_avx);
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,
-                              1, 2, 32, 8, "AVX", ff_mix_1_to_2_fltp_flt_avx);
-        ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,
-                              1, 2, 16, 8, "AVX", ff_mix_1_to_2_s16p_flt_avx);
-    }
-
-    SET_MIX_3_8_TO_1_2(3)
-    SET_MIX_3_8_TO_1_2(4)
-    SET_MIX_3_8_TO_1_2(5)
-    SET_MIX_3_8_TO_1_2(6)
-    SET_MIX_3_8_TO_1_2(7)
-    SET_MIX_3_8_TO_1_2(8)
-#endif /* HAVE_YASM */
-}
diff --git a/deps/libav/libavresample/x86/dither.asm b/deps/libav/libavresample/x86/dither.asm
deleted file mode 100644
index 2192e98..0000000
--- a/deps/libav/libavresample/x86/dither.asm
+++ /dev/null
@@ -1,117 +0,0 @@
-;******************************************************************************
-;* x86 optimized dithering format conversion
-;* Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA 32
-
-; 1.0f / (2.0f * INT32_MAX)
-pf_dither_scale: times 8 dd 2.32830643762e-10
-
-pf_s16_scale: times 4 dd 32753.0
-
-SECTION_TEXT
-
-;------------------------------------------------------------------------------
-; void ff_quantize(int16_t *dst, float *src, float *dither, int len);
-;------------------------------------------------------------------------------
-
-INIT_XMM sse2
-cglobal quantize, 4,4,3, dst, src, dither, len
-    lea         lenq, [2*lend]
-    add         dstq, lenq
-    lea         srcq, [srcq+2*lenq]
-    lea      ditherq, [ditherq+2*lenq]
-    neg         lenq
-    mova          m2, [pf_s16_scale]
-.loop:
-    mulps         m0, m2, [srcq+2*lenq]
-    mulps         m1, m2, [srcq+2*lenq+mmsize]
-    addps         m0, [ditherq+2*lenq]
-    addps         m1, [ditherq+2*lenq+mmsize]
-    cvtps2dq      m0, m0
-    cvtps2dq      m1, m1
-    packssdw      m0, m1
-    mova     [dstq+lenq], m0
-    add         lenq, mmsize
-    jl .loop
-    REP_RET
-
-;------------------------------------------------------------------------------
-; void ff_dither_int_to_float_rectangular(float *dst, int *src, int len)
-;------------------------------------------------------------------------------
-
-%macro DITHER_INT_TO_FLOAT_RECTANGULAR 0
-cglobal dither_int_to_float_rectangular, 3,3,3, dst, src, len
-    lea         lenq, [4*lend]
-    add         srcq, lenq
-    add         dstq, lenq
-    neg         lenq
-    mova          m0, [pf_dither_scale]
-.loop:
-    cvtdq2ps      m1, [srcq+lenq]
-    cvtdq2ps      m2, [srcq+lenq+mmsize]
-    mulps         m1, m1, m0
-    mulps         m2, m2, m0
-    mova  [dstq+lenq], m1
-    mova  [dstq+lenq+mmsize], m2
-    add         lenq, 2*mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-DITHER_INT_TO_FLOAT_RECTANGULAR
-INIT_YMM avx
-DITHER_INT_TO_FLOAT_RECTANGULAR
-
-;------------------------------------------------------------------------------
-; void ff_dither_int_to_float_triangular(float *dst, int *src0, int len)
-;------------------------------------------------------------------------------
-
-%macro DITHER_INT_TO_FLOAT_TRIANGULAR 0
-cglobal dither_int_to_float_triangular, 3,4,5, dst, src0, len, src1
-    lea         lenq, [4*lend]
-    lea        src1q, [src0q+2*lenq]
-    add        src0q, lenq
-    add         dstq, lenq
-    neg         lenq
-    mova          m0, [pf_dither_scale]
-.loop:
-    cvtdq2ps      m1, [src0q+lenq]
-    cvtdq2ps      m2, [src0q+lenq+mmsize]
-    cvtdq2ps      m3, [src1q+lenq]
-    cvtdq2ps      m4, [src1q+lenq+mmsize]
-    addps         m1, m1, m3
-    addps         m2, m2, m4
-    mulps         m1, m1, m0
-    mulps         m2, m2, m0
-    mova  [dstq+lenq], m1
-    mova  [dstq+lenq+mmsize], m2
-    add         lenq, 2*mmsize
-    jl .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-DITHER_INT_TO_FLOAT_TRIANGULAR
-INIT_YMM avx
-DITHER_INT_TO_FLOAT_TRIANGULAR
diff --git a/deps/libav/libavresample/x86/dither_init.c b/deps/libav/libavresample/x86/dither_init.c
deleted file mode 100644
index 8349d5e..0000000
--- a/deps/libav/libavresample/x86/dither_init.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/x86/cpu.h"
-#include "libavresample/dither.h"
-
-void ff_quantize_sse2(int16_t *dst, const float *src, float *dither, int len);
-
-void ff_dither_int_to_float_rectangular_sse2(float *dst, int *src, int len);
-void ff_dither_int_to_float_rectangular_avx(float *dst, int *src, int len);
-
-void ff_dither_int_to_float_triangular_sse2(float *dst, int *src0, int len);
-void ff_dither_int_to_float_triangular_avx(float *dst, int *src0, int len);
-
-av_cold void ff_dither_init_x86(DitherDSPContext *ddsp,
-                                enum AVResampleDitherMethod method)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        ddsp->quantize      = ff_quantize_sse2;
-        ddsp->ptr_align     = 16;
-        ddsp->samples_align = 8;
-    }
-
-    if (method == AV_RESAMPLE_DITHER_RECTANGULAR) {
-        if (EXTERNAL_SSE2(cpu_flags)) {
-            ddsp->dither_int_to_float = ff_dither_int_to_float_rectangular_sse2;
-        }
-        if (EXTERNAL_AVX(cpu_flags)) {
-            ddsp->dither_int_to_float = ff_dither_int_to_float_rectangular_avx;
-        }
-    } else {
-        if (EXTERNAL_SSE2(cpu_flags)) {
-            ddsp->dither_int_to_float = ff_dither_int_to_float_triangular_sse2;
-        }
-        if (EXTERNAL_AVX(cpu_flags)) {
-            ddsp->dither_int_to_float = ff_dither_int_to_float_triangular_avx;
-        }
-    }
-}
diff --git a/deps/libav/libavresample/x86/util.asm b/deps/libav/libavresample/x86/util.asm
deleted file mode 100644
index 0ce9531..0000000
--- a/deps/libav/libavresample/x86/util.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;******************************************************************************
-;* x86 utility macros for libavresample
-;* Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%macro S16_TO_S32_SX 2 ; src/low dst, high dst
-%if cpuflag(sse4)
-    pmovsxwd     m%2, m%1
-    psrldq       m%1, 8
-    pmovsxwd     m%1, m%1
-    SWAP %1, %2
-%else
-    mova         m%2, m%1
-    punpckhwd    m%2, m%2
-    punpcklwd    m%1, m%1
-    psrad        m%2, 16
-    psrad        m%1, 16
-%endif
-%endmacro
-
-%macro DEINT2_PS 3 ; src0/even dst, src1/odd dst, temp
-    shufps  m%3, m%1, m%2, q3131
-    shufps       m%1, m%2, q2020
-    SWAP %2,%3
-%endmacro
diff --git a/deps/libav/libavresample/x86/w64xmmtest.c b/deps/libav/libavresample/x86/w64xmmtest.c
deleted file mode 100644
index 51a400e..0000000
--- a/deps/libav/libavresample/x86/w64xmmtest.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * check XMM registers for clobbers on Win64
- * Copyright (c) 2013 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavresample/avresample.h"
-#include "libavutil/x86/w64xmmtest.h"
-
-wrap(avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
-                        int out_plane_size, int out_samples, uint8_t **input,
-                        int in_plane_size, int in_samples))
-{
-    testxmmclobbers(avresample_convert, avr, output, out_plane_size,
-                    out_samples, input, in_plane_size, in_samples);
-}
diff --git a/deps/libav/libavutil/Makefile b/deps/libav/libavutil/Makefile
deleted file mode 100644
index f663f18..0000000
--- a/deps/libav/libavutil/Makefile
+++ /dev/null
@@ -1,133 +0,0 @@
-NAME = avutil
-
-HEADERS = adler32.h                                                     \
-          aes.h                                                         \
-          attributes.h                                                  \
-          audio_fifo.h                                                  \
-          audioconvert.h                                                \
-          avassert.h                                                    \
-          avstring.h                                                    \
-          avutil.h                                                      \
-          base64.h                                                      \
-          blowfish.h                                                    \
-          bswap.h                                                       \
-          buffer.h                                                      \
-          channel_layout.h                                              \
-          common.h                                                      \
-          cpu.h                                                         \
-          crc.h                                                         \
-          downmix_info.h                                                \
-          error.h                                                       \
-          eval.h                                                        \
-          fifo.h                                                        \
-          file.h                                                        \
-          frame.h                                                       \
-          hmac.h                                                        \
-          imgutils.h                                                    \
-          intfloat.h                                                    \
-          intreadwrite.h                                                \
-          lfg.h                                                         \
-          log.h                                                         \
-          macros.h                                                      \
-          mathematics.h                                                 \
-          md5.h                                                         \
-          mem.h                                                         \
-          dict.h                                                        \
-          old_pix_fmts.h                                                \
-          opt.h                                                         \
-          parseutils.h                                                  \
-          pixdesc.h                                                     \
-          pixfmt.h                                                      \
-          random_seed.h                                                 \
-          rational.h                                                    \
-          samplefmt.h                                                   \
-          sha.h                                                         \
-          stereo3d.h                                                    \
-          time.h                                                        \
-          version.h                                                     \
-          xtea.h                                                        \
-
-HEADERS-$(CONFIG_LZO)                   += lzo.h
-
-ARCH_HEADERS = bswap.h                                                  \
-               intmath.h                                                \
-               intreadwrite.h                                           \
-               timer.h                                                  \
-
-BUILT_HEADERS = avconfig.h
-
-OBJS = adler32.o                                                        \
-       aes.o                                                            \
-       atomic.o                                                         \
-       audio_fifo.o                                                     \
-       avstring.o                                                       \
-       base64.o                                                         \
-       blowfish.o                                                       \
-       buffer.o                                                         \
-       channel_layout.o                                                 \
-       cpu.o                                                            \
-       crc.o                                                            \
-       des.o                                                            \
-       downmix_info.o                                                   \
-       error.o                                                          \
-       eval.o                                                           \
-       fifo.o                                                           \
-       file.o                                                           \
-       file_open.o                                                      \
-       float_dsp.o                                                      \
-       frame.o                                                          \
-       hmac.o                                                           \
-       imgutils.o                                                       \
-       intmath.o                                                        \
-       lfg.o                                                            \
-       lls.o                                                            \
-       log.o                                                            \
-       log2_tab.o                                                       \
-       mathematics.o                                                    \
-       md5.o                                                            \
-       mem.o                                                            \
-       dict.o                                                           \
-       opt.o                                                            \
-       parseutils.o                                                     \
-       pixdesc.o                                                        \
-       random_seed.o                                                    \
-       rational.o                                                       \
-       rc4.o                                                            \
-       samplefmt.o                                                      \
-       sha.o                                                            \
-       stereo3d.o                                                       \
-       time.o                                                           \
-       tree.o                                                           \
-       utils.o                                                          \
-       xtea.o                                                           \
-
-OBJS-$(CONFIG_LZO)                      += lzo.o
-
-OBJS += $(COMPAT_OBJS:%=../compat/%)
-
-SKIPHEADERS          = old_pix_fmts.h
-
-SKIPHEADERS-$(HAVE_ATOMICS_GCC)        += atomic_gcc.h
-SKIPHEADERS-$(HAVE_ATOMICS_SUNCC)      += atomic_suncc.h
-SKIPHEADERS-$(HAVE_ATOMICS_WIN32)      += atomic_win32.h
-
-TESTPROGS = adler32                                                     \
-            aes                                                         \
-            atomic                                                      \
-            avstring                                                    \
-            base64                                                      \
-            blowfish                                                    \
-            cpu                                                         \
-            crc                                                         \
-            des                                                         \
-            eval                                                        \
-            fifo                                                        \
-            hmac                                                        \
-            lfg                                                         \
-            lls                                                         \
-            md5                                                         \
-            opt                                                         \
-            parseutils                                                  \
-            sha                                                         \
-            tree                                                        \
-            xtea                                                        \
diff --git a/deps/libav/libavutil/aarch64/Makefile b/deps/libav/libavutil/aarch64/Makefile
deleted file mode 100644
index 13d26a1..0000000
--- a/deps/libav/libavutil/aarch64/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-OBJS += aarch64/cpu.o
diff --git a/deps/libav/libavutil/aarch64/asm.S b/deps/libav/libavutil/aarch64/asm.S
deleted file mode 100644
index 94e5a84..0000000
--- a/deps/libav/libavutil/aarch64/asm.S
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#ifdef __ELF__
-#   define ELF
-#else
-#   define ELF //
-#endif
-
-.macro  function name, export=0, align=2
-    .macro endfunc
-ELF     .size   \name, . - \name
-        .endfunc
-        .purgem endfunc
-    .endm
-        .text
-        .align          \align
-    .if \export
-        .global EXTERN_ASM\name
-EXTERN_ASM\name:
-    .endif
-ELF     .type   \name, %function
-        .func   \name
-\name:
-.endm
-
-.macro  const   name, align=2
-    .macro endconst
-ELF     .size   \name, . - \name
-        .purgem endconst
-    .endm
-        .section        .rodata
-        .align          \align
-\name:
-.endm
-
-.macro  movrel rd, val
-#if CONFIG_PIC
-        adrp            \rd, #:pg_hi21:\val
-        add             \rd, \rd, #:lo12:\val
-#else
-        ldr             \rd, =\val
-#endif
-.endm
diff --git a/deps/libav/libavutil/aarch64/bswap.h b/deps/libav/libavutil/aarch64/bswap.h
deleted file mode 100644
index 0c001ce..0000000
--- a/deps/libav/libavutil/aarch64/bswap.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AARCH64_BSWAP_H
-#define AVUTIL_AARCH64_BSWAP_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#if HAVE_INLINE_ASM
-
-#define av_bswap16 av_bswap16
-static av_always_inline av_const unsigned av_bswap16(unsigned x)
-{
-    __asm__("rev16 %w0, %w0" : "+r"(x));
-    return x;
-}
-
-#define av_bswap32 av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-    __asm__("rev %w0, %w0" : "+r"(x));
-    return x;
-}
-
-#define av_bswap64 av_bswap64
-static av_always_inline av_const uint64_t av_bswap64(uint64_t x)
-{
-    __asm__("rev %0, %0" : "+r"(x));
-    return x;
-}
-
-#endif /* HAVE_INLINE_ASM */
-#endif /* AVUTIL_AARCH64_BSWAP_H */
diff --git a/deps/libav/libavutil/aarch64/cpu.c b/deps/libav/libavutil/aarch64/cpu.c
deleted file mode 100644
index 2cc2ccd..0000000
--- a/deps/libav/libavutil/aarch64/cpu.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/cpu.h"
-#include "libavutil/cpu_internal.h"
-#include "config.h"
-
-int ff_get_cpu_flags_aarch64(void)
-{
-    return AV_CPU_FLAG_NEON * HAVE_NEON |
-           AV_CPU_FLAG_VFP  * HAVE_VFP;
-}
diff --git a/deps/libav/libavutil/aarch64/cpu.h b/deps/libav/libavutil/aarch64/cpu.h
deleted file mode 100644
index 704df48..0000000
--- a/deps/libav/libavutil/aarch64/cpu.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AARCH64_CPU_H
-#define AVUTIL_AARCH64_CPU_H
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/cpu_internal.h"
-
-#define have_neon(flags) CPUEXT(flags, NEON)
-#define have_vfp(flags)  CPUEXT(flags, VFP)
-
-#endif /* AVUTIL_AARCH64_CPU_H */
diff --git a/deps/libav/libavutil/aarch64/neontest.h b/deps/libav/libavutil/aarch64/neontest.h
deleted file mode 100644
index de841bb..0000000
--- a/deps/libav/libavutil/aarch64/neontest.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * check NEON registers for clobbering
- * Copyright (c) 2008 Ramiro Polla <ramiro.polla at gmail.com>
- * Copyright (c) 2013 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include "libavutil/bswap.h"
-
-#define storeneonregs(mem)                \
-    __asm__ volatile(                     \
-        "stp d8,  d9,  [%0]\n\t"          \
-        "stp d10, d11, [%0, #16]\n\t"     \
-        "stp d12, d13, [%0, #32]\n\t"     \
-        "stp d14, d15, [%0, #48]\n\t"     \
-        :: "r"(mem) : "memory")
-
-#define testneonclobbers(func, ctx, ...)                        \
-    uint64_t neon[2][8];                                        \
-    int ret;                                                    \
-    storeneonregs(neon[0]);                                     \
-    ret = __real_ ## func(ctx, __VA_ARGS__);                    \
-    storeneonregs(neon[1]);                                     \
-    if (memcmp(neon[0], neon[1], sizeof(neon[0]))) {            \
-        int i;                                                  \
-        av_log(ctx, AV_LOG_ERROR,                               \
-               "NEON REGS CLOBBERED IN %s!\n", #func);          \
-        for (i = 0; i < 8; i ++)                                \
-            if (neon[0][i] != neon[1][i]) {                     \
-                av_log(ctx, AV_LOG_ERROR,                       \
-                       "d%-2d = %016"PRIx64"\n",                \
-                       8 + i, av_bswap64(neon[0][i]));          \
-                av_log(ctx, AV_LOG_ERROR,                       \
-                       "   -> %016"PRIx64"\n",                  \
-                       av_bswap64(neon[1][i]));                 \
-            }                                                   \
-        abort();                                                \
-    }                                                           \
-    return ret
-
-#define wrap(func)      \
-int __real_ ## func;    \
-int __wrap_ ## func;    \
-int __wrap_ ## func
diff --git a/deps/libav/libavutil/adler32.c b/deps/libav/libavutil/adler32.c
deleted file mode 100644
index 7f5afdb..0000000
--- a/deps/libav/libavutil/adler32.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Compute the Adler-32 checksum of a data stream.
- * This is a modified version based on adler32.c from the zlib library.
- *
- * Copyright (C) 1995 Mark Adler
- *
- * This software is provided 'as-is', without any express or implied
- * warranty.  In no event will the authors be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- *    claim that you wrote the original software. If you use this software
- *    in a product, an acknowledgment in the product documentation would be
- *    appreciated but is not required.
- * 2. Altered source versions must be plainly marked as such, and must not be
- *    misrepresented as being the original software.
- * 3. This notice may not be removed or altered from any source distribution.
- */
-
-#include "config.h"
-#include "adler32.h"
-
-#define BASE 65521L /* largest prime smaller than 65536 */
-
-#define DO1(buf)  { s1 += *buf++; s2 += s1; }
-#define DO4(buf)  DO1(buf); DO1(buf); DO1(buf); DO1(buf);
-#define DO16(buf) DO4(buf); DO4(buf); DO4(buf); DO4(buf);
-
-unsigned long av_adler32_update(unsigned long adler, const uint8_t * buf,
-                                unsigned int len)
-{
-    unsigned long s1 = adler & 0xffff;
-    unsigned long s2 = adler >> 16;
-
-    while (len > 0) {
-#if CONFIG_SMALL
-        while (len > 4  && s2 < (1U << 31)) {
-            DO4(buf);
-            len -= 4;
-        }
-#else
-        while (len > 16 && s2 < (1U << 31)) {
-            DO16(buf);
-            len -= 16;
-        }
-#endif
-        DO1(buf); len--;
-        s1 %= BASE;
-        s2 %= BASE;
-    }
-    return (s2 << 16) | s1;
-}
-
-#ifdef TEST
-#include <string.h>
-#include "log.h"
-#include "timer.h"
-#define LEN 7001
-
-static volatile int checksum;
-
-int main(int argc, char **argv)
-{
-    int i;
-    char data[LEN];
-
-    av_log_set_level(AV_LOG_DEBUG);
-
-    for (i = 0; i < LEN; i++)
-        data[i] = ((i * i) >> 3) + 123 * i;
-
-    if (argc > 1 && !strcmp(argv[1], "-t")) {
-        for (i = 0; i < 1000; i++) {
-            START_TIMER;
-            checksum = av_adler32_update(1, data, LEN);
-            STOP_TIMER("adler");
-        }
-    } else {
-        checksum = av_adler32_update(1, data, LEN);
-    }
-
-    av_log(NULL, AV_LOG_DEBUG, "%X (expected 50E6E508)\n", checksum);
-    return checksum == 0x50e6e508 ? 0 : 1;
-}
-#endif
diff --git a/deps/libav/libavutil/adler32.h b/deps/libav/libavutil/adler32.h
deleted file mode 100644
index a8ff6f9..0000000
--- a/deps/libav/libavutil/adler32.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * copyright (c) 2006 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ADLER32_H
-#define AVUTIL_ADLER32_H
-
-#include <stdint.h>
-#include "attributes.h"
-
-/**
- * @ingroup lavu_crypto
- * Calculate the Adler32 checksum of a buffer.
- *
- * Passing the return value to a subsequent av_adler32_update() call
- * allows the checksum of multiple buffers to be calculated as though
- * they were concatenated.
- *
- * @param adler initial checksum value
- * @param buf   pointer to input buffer
- * @param len   size of input buffer
- * @return      updated checksum
- */
-unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
-                                unsigned int len) av_pure;
-
-#endif /* AVUTIL_ADLER32_H */
diff --git a/deps/libav/libavutil/aes.c b/deps/libav/libavutil/aes.c
deleted file mode 100644
index 3ba5e9a..0000000
--- a/deps/libav/libavutil/aes.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * copyright (c) 2007 Michael Niedermayer <michaelni at gmx.at>
- *
- * some optimization ideas from aes128.c by Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "common.h"
-#include "aes.h"
-#include "intreadwrite.h"
-#include "timer.h"
-
-typedef union {
-    uint64_t u64[2];
-    uint32_t u32[4];
-    uint8_t u8x4[4][4];
-    uint8_t u8[16];
-} av_aes_block;
-
-typedef struct AVAES {
-    // Note: round_key[16] is accessed in the init code, but this only
-    // overwrites state, which does not matter (see also commit ba554c0).
-    av_aes_block round_key[15];
-    av_aes_block state[2];
-    int rounds;
-} AVAES;
-
-#if FF_API_CONTEXT_SIZE
-const int av_aes_size= sizeof(AVAES);
-#endif
-
-struct AVAES *av_aes_alloc(void)
-{
-    return av_mallocz(sizeof(struct AVAES));
-}
-
-static const uint8_t rcon[10] = {
-  0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36
-};
-
-static uint8_t     sbox[256];
-static uint8_t inv_sbox[256];
-#if CONFIG_SMALL
-static uint32_t enc_multbl[1][256];
-static uint32_t dec_multbl[1][256];
-#else
-static uint32_t enc_multbl[4][256];
-static uint32_t dec_multbl[4][256];
-#endif
-
-#if HAVE_BIGENDIAN
-#   define ROT(x, s) ((x >> s) | (x << (32-s)))
-#else
-#   define ROT(x, s) ((x << s) | (x >> (32-s)))
-#endif
-
-static inline void addkey(av_aes_block *dst, const av_aes_block *src,
-                          const av_aes_block *round_key)
-{
-    dst->u64[0] = src->u64[0] ^ round_key->u64[0];
-    dst->u64[1] = src->u64[1] ^ round_key->u64[1];
-}
-
-static inline void addkey_s(av_aes_block *dst, const uint8_t *src,
-                            const av_aes_block *round_key)
-{
-    dst->u64[0] = AV_RN64(src)     ^ round_key->u64[0];
-    dst->u64[1] = AV_RN64(src + 8) ^ round_key->u64[1];
-}
-
-static inline void addkey_d(uint8_t *dst, const av_aes_block *src,
-                            const av_aes_block *round_key)
-{
-    AV_WN64(dst,     src->u64[0] ^ round_key->u64[0]);
-    AV_WN64(dst + 8, src->u64[1] ^ round_key->u64[1]);
-}
-
-static void subshift(av_aes_block s0[2], int s, const uint8_t *box)
-{
-    av_aes_block *s1 = (av_aes_block *) (s0[0].u8 - s);
-    av_aes_block *s3 = (av_aes_block *) (s0[0].u8 + s);
-
-    s0[0].u8[ 0] = box[s0[1].u8[ 0]];
-    s0[0].u8[ 4] = box[s0[1].u8[ 4]];
-    s0[0].u8[ 8] = box[s0[1].u8[ 8]];
-    s0[0].u8[12] = box[s0[1].u8[12]];
-    s1[0].u8[ 3] = box[s1[1].u8[ 7]];
-    s1[0].u8[ 7] = box[s1[1].u8[11]];
-    s1[0].u8[11] = box[s1[1].u8[15]];
-    s1[0].u8[15] = box[s1[1].u8[ 3]];
-    s0[0].u8[ 2] = box[s0[1].u8[10]];
-    s0[0].u8[10] = box[s0[1].u8[ 2]];
-    s0[0].u8[ 6] = box[s0[1].u8[14]];
-    s0[0].u8[14] = box[s0[1].u8[ 6]];
-    s3[0].u8[ 1] = box[s3[1].u8[13]];
-    s3[0].u8[13] = box[s3[1].u8[ 9]];
-    s3[0].u8[ 9] = box[s3[1].u8[ 5]];
-    s3[0].u8[ 5] = box[s3[1].u8[ 1]];
-}
-
-static inline int mix_core(uint32_t multbl[][256], int a, int b, int c, int d){
-#if CONFIG_SMALL
-    return multbl[0][a] ^ ROT(multbl[0][b], 8) ^ ROT(multbl[0][c], 16) ^ ROT(multbl[0][d], 24);
-#else
-    return multbl[0][a] ^ multbl[1][b] ^ multbl[2][c] ^ multbl[3][d];
-#endif
-}
-
-static inline void mix(av_aes_block state[2], uint32_t multbl[][256], int s1, int s3){
-    uint8_t (*src)[4] = state[1].u8x4;
-    state[0].u32[0] = mix_core(multbl, src[0][0], src[s1  ][1], src[2][2], src[s3  ][3]);
-    state[0].u32[1] = mix_core(multbl, src[1][0], src[s3-1][1], src[3][2], src[s1-1][3]);
-    state[0].u32[2] = mix_core(multbl, src[2][0], src[s3  ][1], src[0][2], src[s1  ][3]);
-    state[0].u32[3] = mix_core(multbl, src[3][0], src[s1-1][1], src[1][2], src[s3-1][3]);
-}
-
-static inline void crypt(AVAES *a, int s, const uint8_t *sbox,
-                         uint32_t multbl[][256])
-{
-    int r;
-
-    for (r = a->rounds - 1; r > 0; r--) {
-        mix(a->state, multbl, 3 - s, 1 + s);
-        addkey(&a->state[1], &a->state[0], &a->round_key[r]);
-    }
-
-    subshift(&a->state[0], s, sbox);
-}
-
-void av_aes_crypt(AVAES *a, uint8_t *dst, const uint8_t *src,
-                  int count, uint8_t *iv, int decrypt)
-{
-    while (count--) {
-        addkey_s(&a->state[1], src, &a->round_key[a->rounds]);
-        if (decrypt) {
-            crypt(a, 0, inv_sbox, dec_multbl);
-            if (iv) {
-                addkey_s(&a->state[0], iv, &a->state[0]);
-                memcpy(iv, src, 16);
-            }
-            addkey_d(dst, &a->state[0], &a->round_key[0]);
-        } else {
-            if (iv)
-                addkey_s(&a->state[1], iv, &a->state[1]);
-            crypt(a, 2, sbox, enc_multbl);
-            addkey_d(dst, &a->state[0], &a->round_key[0]);
-            if (iv)
-                memcpy(iv, dst, 16);
-        }
-        src += 16;
-        dst += 16;
-    }
-}
-
-static void init_multbl2(uint32_t tbl[][256], const int c[4],
-                         const uint8_t *log8, const uint8_t *alog8,
-                         const uint8_t *sbox)
-{
-    int i;
-
-    for (i = 0; i < 256; i++) {
-        int x = sbox[i];
-        if (x) {
-            int k, l, m, n;
-            x = log8[x];
-            k = alog8[x + log8[c[0]]];
-            l = alog8[x + log8[c[1]]];
-            m = alog8[x + log8[c[2]]];
-            n = alog8[x + log8[c[3]]];
-            tbl[0][i] = AV_NE(MKBETAG(k,l,m,n), MKTAG(k,l,m,n));
-#if !CONFIG_SMALL
-            tbl[1][i] = ROT(tbl[0][i], 8);
-            tbl[2][i] = ROT(tbl[0][i], 16);
-            tbl[3][i] = ROT(tbl[0][i], 24);
-#endif
-        }
-    }
-}
-
-// this is based on the reference AES code by Paulo Barreto and Vincent Rijmen
-int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt)
-{
-    int i, j, t, rconpointer = 0;
-    uint8_t tk[8][4];
-    int KC = key_bits >> 5;
-    int rounds = KC + 6;
-    uint8_t log8[256];
-    uint8_t alog8[512];
-
-    if (!enc_multbl[FF_ARRAY_ELEMS(enc_multbl)-1][FF_ARRAY_ELEMS(enc_multbl[0])-1]) {
-        j = 1;
-        for (i = 0; i < 255; i++) {
-            alog8[i] = alog8[i + 255] = j;
-            log8[j] = i;
-            j ^= j + j;
-            if (j > 255)
-                j ^= 0x11B;
-        }
-        for (i = 0; i < 256; i++) {
-            j = i ? alog8[255 - log8[i]] : 0;
-            j ^= (j << 1) ^ (j << 2) ^ (j << 3) ^ (j << 4);
-            j = (j ^ (j >> 8) ^ 99) & 255;
-            inv_sbox[j] = i;
-            sbox[i] = j;
-        }
-        init_multbl2(dec_multbl, (const int[4]) { 0xe, 0x9, 0xd, 0xb },
-                     log8, alog8, inv_sbox);
-        init_multbl2(enc_multbl, (const int[4]) { 0x2, 0x1, 0x1, 0x3 },
-                     log8, alog8, sbox);
-    }
-
-    if (key_bits != 128 && key_bits != 192 && key_bits != 256)
-        return -1;
-
-    a->rounds = rounds;
-
-    memcpy(tk, key, KC * 4);
-    memcpy(a->round_key[0].u8, key, KC * 4);
-
-    for (t = KC * 4; t < (rounds + 1) * 16; t += KC * 4) {
-        for (i = 0; i < 4; i++)
-            tk[0][i] ^= sbox[tk[KC - 1][(i + 1) & 3]];
-        tk[0][0] ^= rcon[rconpointer++];
-
-        for (j = 1; j < KC; j++) {
-            if (KC != 8 || j != KC >> 1)
-                for (i = 0; i < 4; i++)
-                    tk[j][i] ^= tk[j - 1][i];
-            else
-                for (i = 0; i < 4; i++)
-                    tk[j][i] ^= sbox[tk[j - 1][i]];
-        }
-
-        memcpy(a->round_key[0].u8 + t, tk, KC * 4);
-    }
-
-    if (decrypt) {
-        for (i = 1; i < rounds; i++) {
-            av_aes_block tmp[3];
-            tmp[2] = a->round_key[i];
-            subshift(&tmp[1], 0, sbox);
-            mix(tmp, dec_multbl, 1, 3);
-            a->round_key[i] = tmp[0];
-        }
-    } else {
-        for (i = 0; i < (rounds + 1) >> 1; i++) {
-            FFSWAP(av_aes_block, a->round_key[i], a->round_key[rounds-i]);
-        }
-    }
-
-    return 0;
-}
-
-#ifdef TEST
-#include <string.h>
-#include "lfg.h"
-#include "log.h"
-
-int main(int argc, char **argv)
-{
-    int i, j;
-    AVAES b;
-    uint8_t rkey[2][16] = {
-        { 0 },
-        { 0x10, 0xa5, 0x88, 0x69, 0xd7, 0x4b, 0xe5, 0xa3,
-          0x74, 0xcf, 0x86, 0x7c, 0xfb, 0x47, 0x38, 0x59 }
-    };
-    uint8_t pt[16], rpt[2][16]= {
-        { 0x6a, 0x84, 0x86, 0x7c, 0xd7, 0x7e, 0x12, 0xad,
-          0x07, 0xea, 0x1b, 0xe8, 0x95, 0xc5, 0x3f, 0xa3 },
-        { 0 }
-    };
-    uint8_t rct[2][16]= {
-        { 0x73, 0x22, 0x81, 0xc0, 0xa0, 0xaa, 0xb8, 0xf7,
-          0xa5, 0x4a, 0x0c, 0x67, 0xa0, 0xc4, 0x5e, 0xcf },
-        { 0x6d, 0x25, 0x1e, 0x69, 0x44, 0xb0, 0x51, 0xe0,
-          0x4e, 0xaa, 0x6f, 0xb4, 0xdb, 0xf7, 0x84, 0x65 }
-    };
-    uint8_t temp[16];
-    int err = 0;
-
-    av_log_set_level(AV_LOG_DEBUG);
-
-    for (i = 0; i < 2; i++) {
-        av_aes_init(&b, rkey[i], 128, 1);
-        av_aes_crypt(&b, temp, rct[i], 1, NULL, 1);
-        for (j = 0; j < 16; j++) {
-            if (rpt[i][j] != temp[j]) {
-                av_log(NULL, AV_LOG_ERROR, "%d %02X %02X\n",
-                       j, rpt[i][j], temp[j]);
-                err = 1;
-            }
-        }
-    }
-
-    if (argc > 1 && !strcmp(argv[1], "-t")) {
-        AVAES ae, ad;
-        AVLFG prng;
-
-        av_aes_init(&ae, "PI=3.141592654..", 128, 0);
-        av_aes_init(&ad, "PI=3.141592654..", 128, 1);
-        av_lfg_init(&prng, 1);
-
-        for (i = 0; i < 10000; i++) {
-            for (j = 0; j < 16; j++) {
-                pt[j] = av_lfg_get(&prng);
-            }
-            {
-                START_TIMER;
-                av_aes_crypt(&ae, temp, pt, 1, NULL, 0);
-                if (!(i & (i - 1)))
-                    av_log(NULL, AV_LOG_ERROR, "%02X %02X %02X %02X\n",
-                           temp[0], temp[5], temp[10], temp[15]);
-                av_aes_crypt(&ad, temp, temp, 1, NULL, 1);
-                STOP_TIMER("aes");
-            }
-            for (j = 0; j < 16; j++) {
-                if (pt[j] != temp[j]) {
-                    av_log(NULL, AV_LOG_ERROR, "%d %d %02X %02X\n",
-                           i, j, pt[j], temp[j]);
-                }
-            }
-        }
-    }
-    return err;
-}
-#endif
diff --git a/deps/libav/libavutil/aes.h b/deps/libav/libavutil/aes.h
deleted file mode 100644
index edff275..0000000
--- a/deps/libav/libavutil/aes.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * copyright (c) 2007 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AES_H
-#define AVUTIL_AES_H
-
-#include <stdint.h>
-
-#include "attributes.h"
-#include "version.h"
-
-/**
- * @defgroup lavu_aes AES
- * @ingroup lavu_crypto
- * @{
- */
-
-#if FF_API_CONTEXT_SIZE
-extern attribute_deprecated const int av_aes_size;
-#endif
-
-struct AVAES;
-
-/**
- * Allocate an AVAES context.
- */
-struct AVAES *av_aes_alloc(void);
-
-/**
- * Initialize an AVAES context.
- * @param key_bits 128, 192 or 256
- * @param decrypt 0 for encryption, 1 for decryption
- */
-int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
-
-/**
- * Encrypt or decrypt a buffer using a previously initialized context.
- * @param count number of 16 byte blocks
- * @param dst destination array, can be equal to src
- * @param src source array, can be equal to dst
- * @param iv initialization vector for CBC mode, if NULL then ECB will be used
- * @param decrypt 0 for encryption, 1 for decryption
- */
-void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_AES_H */
diff --git a/deps/libav/libavutil/arm/Makefile b/deps/libav/libavutil/arm/Makefile
deleted file mode 100644
index 5da44b0..0000000
--- a/deps/libav/libavutil/arm/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-OBJS += arm/cpu.o                                                       \
-        arm/float_dsp_init_arm.o                                        \
-
-VFP-OBJS += arm/float_dsp_init_vfp.o                                    \
-            arm/float_dsp_vfp.o                                         \
-
-NEON-OBJS += arm/float_dsp_init_neon.o                                  \
-             arm/float_dsp_neon.o                                       \
diff --git a/deps/libav/libavutil/arm/asm.S b/deps/libav/libavutil/arm/asm.S
deleted file mode 100644
index 5884e17..0000000
--- a/deps/libav/libavutil/arm/asm.S
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#ifdef __ELF__
-#   define ELF
-#else
-#   define ELF @
-#endif
-
-#if CONFIG_THUMB
-#   define A @
-#   define T
-#else
-#   define A
-#   define T @
-#endif
-
-#if   HAVE_NEON
-        .arch           armv7-a
-#elif HAVE_ARMV6T2
-        .arch           armv6t2
-#elif HAVE_ARMV6
-        .arch           armv6
-#elif HAVE_ARMV5TE
-        .arch           armv5te
-#endif
-
-#if   HAVE_NEON
-        .fpu            neon
-#elif HAVE_VFP
-        .fpu            vfp
-#endif
-
-        .syntax unified
-T       .thumb
-ELF     .eabi_attribute 25, 1           @ Tag_ABI_align_preserved
-ELF     .section .note.GNU-stack,"",%progbits @ Mark stack as non-executable
-
-.macro  function name, export=0, align=2
-        .set            .Lpic_idx, 0
-        .set            .Lpic_gp, 0
-    .macro endfunc
-      .if .Lpic_idx
-        .align          2
-        .altmacro
-        put_pic         %(.Lpic_idx - 1)
-        .noaltmacro
-      .endif
-ELF     .size   \name, . - \name
-        .endfunc
-        .purgem endfunc
-    .endm
-        .text
-        .align          \align
-    .if \export
-        .global EXTERN_ASM\name
-ELF     .type   EXTERN_ASM\name, %function
-        .func   EXTERN_ASM\name
-EXTERN_ASM\name:
-    .else
-ELF     .type   \name, %function
-        .func   \name
-\name:
-    .endif
-.endm
-
-.macro  const   name, align=2
-    .macro endconst
-ELF     .size   \name, . - \name
-        .purgem endconst
-    .endm
-        .section        .rodata
-        .align          \align
-\name:
-.endm
-
-#if !HAVE_ARMV6T2_EXTERNAL
-.macro  movw    rd, val
-        mov     \rd, \val &  255
-        orr     \rd, \val & ~255
-.endm
-#endif
-
-.macro  mov32   rd, val
-#if HAVE_ARMV6T2_EXTERNAL
-        movw            \rd, #(\val) & 0xffff
-    .if (\val) >> 16
-        movt            \rd, #(\val) >> 16
-    .endif
-#else
-        ldr             \rd, =\val
-#endif
-.endm
-
-.macro  put_pic         num
-        put_pic_\num
-.endm
-
-.macro  do_def_pic      num, val, label
-    .macro put_pic_\num
-      .if \num
-        .altmacro
-        put_pic         %(\num - 1)
-        .noaltmacro
-      .endif
-\label: .word           \val
-        .purgem         put_pic_\num
-    .endm
-.endm
-
-.macro  def_pic         val, label
-        .altmacro
-        do_def_pic      %.Lpic_idx, \val, \label
-        .noaltmacro
-        .set            .Lpic_idx, .Lpic_idx + 1
-.endm
-
-.macro  ldpic           rd,  val, indir=0
-        ldr             \rd, .Lpicoff\@
-.Lpic\@:
-    .if \indir
-A       ldr             \rd, [pc, \rd]
-T       add             \rd, pc
-T       ldr             \rd, [\rd]
-    .else
-        add             \rd, pc
-    .endif
-        def_pic         \val - (.Lpic\@ + (8 >> CONFIG_THUMB)), .Lpicoff\@
-.endm
-
-.macro  movrel rd, val
-#if CONFIG_PIC
-        ldpic           \rd, \val
-#elif HAVE_ARMV6T2_EXTERNAL && !defined(__APPLE__)
-        movw            \rd, #:lower16:\val
-        movt            \rd, #:upper16:\val
-#else
-        ldr             \rd, =\val
-#endif
-.endm
-
-.macro  movrelx         rd,  val, gp
-#if CONFIG_PIC && defined(__ELF__)
-    .ifnb \gp
-      .if .Lpic_gp
-        .unreq          gp
-      .endif
-        gp      .req    \gp
-        ldpic           gp,  _GLOBAL_OFFSET_TABLE_
-    .elseif !.Lpic_gp
-        gp      .req    r12
-        ldpic           gp,  _GLOBAL_OFFSET_TABLE_
-    .endif
-        .set            .Lpic_gp, 1
-        ldr             \rd, .Lpicoff\@
-        ldr             \rd, [gp, \rd]
-        def_pic         \val(GOT), .Lpicoff\@
-#elif CONFIG_PIC && defined(__APPLE__)
-        ldpic           \rd, .Lpic\@, indir=1
-        .non_lazy_symbol_pointer
-.Lpic\@:
-        .indirect_symbol \val
-        .word           0
-        .text
-#else
-        movrel          \rd, \val
-#endif
-.endm
-
-.macro  add_sh          rd,  rn,  rm,  sh:vararg
-A       add             \rd, \rn, \rm, \sh
-T       mov             \rm, \rm, \sh
-T       add             \rd, \rn, \rm
-.endm
-
-.macro  ldr_pre         rt,  rn,  rm:vararg
-A       ldr             \rt, [\rn, \rm]!
-T       add             \rn, \rn, \rm
-T       ldr             \rt, [\rn]
-.endm
-
-.macro  ldr_dpre        rt,  rn,  rm:vararg
-A       ldr             \rt, [\rn, -\rm]!
-T       sub             \rn, \rn, \rm
-T       ldr             \rt, [\rn]
-.endm
-
-.macro  ldr_nreg        rt,  rn,  rm:vararg
-A       ldr             \rt, [\rn, -\rm]
-T       sub             \rt, \rn, \rm
-T       ldr             \rt, [\rt]
-.endm
-
-.macro  ldr_post        rt,  rn,  rm:vararg
-A       ldr             \rt, [\rn], \rm
-T       ldr             \rt, [\rn]
-T       add             \rn, \rn, \rm
-.endm
-
-.macro  ldrc_pre        cc,  rt,  rn,  rm:vararg
-A       ldr\cc          \rt, [\rn, \rm]!
-T       itt             \cc
-T       add\cc          \rn, \rn, \rm
-T       ldr\cc          \rt, [\rn]
-.endm
-
-.macro  ldrd_reg        rt,  rt2, rn,  rm
-A       ldrd            \rt, \rt2, [\rn, \rm]
-T       add             \rt, \rn, \rm
-T       ldrd            \rt, \rt2, [\rt]
-.endm
-
-.macro  ldrd_post       rt,  rt2, rn,  rm
-A       ldrd            \rt, \rt2, [\rn], \rm
-T       ldrd            \rt, \rt2, [\rn]
-T       add             \rn, \rn, \rm
-.endm
-
-.macro  ldrh_pre        rt,  rn,  rm
-A       ldrh            \rt, [\rn, \rm]!
-T       add             \rn, \rn, \rm
-T       ldrh            \rt, [\rn]
-.endm
-
-.macro  ldrh_dpre       rt,  rn,  rm
-A       ldrh            \rt, [\rn, -\rm]!
-T       sub             \rn, \rn, \rm
-T       ldrh            \rt, [\rn]
-.endm
-
-.macro  ldrh_post       rt,  rn,  rm
-A       ldrh            \rt, [\rn], \rm
-T       ldrh            \rt, [\rn]
-T       add             \rn, \rn, \rm
-.endm
-
-.macro  ldrb_post       rt,  rn,  rm
-A       ldrb            \rt, [\rn], \rm
-T       ldrb            \rt, [\rn]
-T       add             \rn, \rn, \rm
-.endm
-
-.macro  str_post       rt,  rn,  rm:vararg
-A       str             \rt, [\rn], \rm
-T       str             \rt, [\rn]
-T       add             \rn, \rn, \rm
-.endm
-
-.macro  strb_post       rt,  rn,  rm:vararg
-A       strb            \rt, [\rn], \rm
-T       strb            \rt, [\rn]
-T       add             \rn, \rn, \rm
-.endm
-
-.macro  strd_post       rt,  rt2, rn,  rm
-A       strd            \rt, \rt2, [\rn], \rm
-T       strd            \rt, \rt2, [\rn]
-T       add             \rn, \rn, \rm
-.endm
-
-.macro  strh_pre        rt,  rn,  rm
-A       strh            \rt, [\rn, \rm]!
-T       add             \rn, \rn, \rm
-T       strh            \rt, [\rn]
-.endm
-
-.macro  strh_dpre       rt,  rn,  rm
-A       strh            \rt, [\rn, -\rm]!
-T       sub             \rn, \rn, \rm
-T       strh            \rt, [\rn]
-.endm
-
-.macro  strh_post       rt,  rn,  rm
-A       strh            \rt, [\rn], \rm
-T       strh            \rt, [\rn]
-T       add             \rn, \rn, \rm
-.endm
-
-.macro  strh_dpost       rt,  rn,  rm
-A       strh            \rt, [\rn], -\rm
-T       strh            \rt, [\rn]
-T       sub             \rn, \rn, \rm
-.endm
-
-#if HAVE_VFP_ARGS
-ELF     .eabi_attribute 28, 1
-#   define VFP
-#   define NOVFP @
-#else
-#   define VFP   @
-#   define NOVFP
-#endif
-
-#define GLUE(a, b) a ## b
-#define JOIN(a, b) GLUE(a, b)
-#define X(s) JOIN(EXTERN_ASM, s)
diff --git a/deps/libav/libavutil/arm/bswap.h b/deps/libav/libavutil/arm/bswap.h
deleted file mode 100644
index 8bc7d9a..0000000
--- a/deps/libav/libavutil/arm/bswap.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ARM_BSWAP_H
-#define AVUTIL_ARM_BSWAP_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#ifdef __ARMCC_VERSION
-
-#if HAVE_ARMV6
-#define av_bswap32 av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-    return __rev(x);
-}
-#endif /* HAVE_ARMV6 */
-
-#elif HAVE_INLINE_ASM
-
-#if HAVE_ARMV6_INLINE
-#define av_bswap16 av_bswap16
-static av_always_inline av_const unsigned av_bswap16(unsigned x)
-{
-    __asm__("rev16 %0, %0" : "+r"(x));
-    return x;
-}
-#endif
-
-#if !AV_GCC_VERSION_AT_LEAST(4,5)
-#define av_bswap32 av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-#if HAVE_ARMV6_INLINE
-    __asm__("rev %0, %0" : "+r"(x));
-#else
-    uint32_t t;
-    __asm__ ("eor %1, %0, %0, ror #16 \n\t"
-             "bic %1, %1, #0xFF0000   \n\t"
-             "mov %0, %0, ror #8      \n\t"
-             "eor %0, %0, %1, lsr #8  \n\t"
-             : "+r"(x), "=&r"(t));
-#endif /* HAVE_ARMV6_INLINE */
-    return x;
-}
-#endif /* !AV_GCC_VERSION_AT_LEAST(4,5) */
-
-#endif /* __ARMCC_VERSION */
-
-#endif /* AVUTIL_ARM_BSWAP_H */
diff --git a/deps/libav/libavutil/arm/cpu.c b/deps/libav/libavutil/arm/cpu.c
deleted file mode 100644
index 85ea662..0000000
--- a/deps/libav/libavutil/arm/cpu.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/cpu.h"
-#include "libavutil/cpu_internal.h"
-#include "config.h"
-
-#define CORE_FLAG(f) \
-    (AV_CPU_FLAG_ ## f * (HAVE_ ## f ## _EXTERNAL || HAVE_ ## f ## _INLINE))
-
-#define CORE_CPU_FLAGS                          \
-    (CORE_FLAG(ARMV5TE) |                       \
-     CORE_FLAG(ARMV6)   |                       \
-     CORE_FLAG(ARMV6T2) |                       \
-     CORE_FLAG(VFP)     |                       \
-     CORE_FLAG(VFPV3)   |                       \
-     CORE_FLAG(NEON))
-
-#if defined __linux__ || defined __ANDROID__
-
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include "libavutil/avstring.h"
-
-#define AT_HWCAP        16
-
-/* Relevant HWCAP values from kernel headers */
-#define HWCAP_VFP       (1 << 6)
-#define HWCAP_EDSP      (1 << 7)
-#define HWCAP_THUMBEE   (1 << 11)
-#define HWCAP_NEON      (1 << 12)
-#define HWCAP_VFPv3     (1 << 13)
-#define HWCAP_TLS       (1 << 15)
-
-static int get_hwcap(uint32_t *hwcap)
-{
-    struct { uint32_t a_type; uint32_t a_val; } auxv;
-    FILE *f = fopen("/proc/self/auxv", "r");
-    int err = -1;
-
-    if (!f)
-        return -1;
-
-    while (fread(&auxv, sizeof(auxv), 1, f) > 0) {
-        if (auxv.a_type == AT_HWCAP) {
-            *hwcap = auxv.a_val;
-            err = 0;
-            break;
-        }
-    }
-
-    fclose(f);
-    return err;
-}
-
-static int get_cpuinfo(uint32_t *hwcap)
-{
-    FILE *f = fopen("/proc/cpuinfo", "r");
-    char buf[200];
-
-    if (!f)
-        return -1;
-
-    *hwcap = 0;
-    while (fgets(buf, sizeof(buf), f)) {
-        if (av_strstart(buf, "Features", NULL)) {
-            if (strstr(buf, " edsp "))
-                *hwcap |= HWCAP_EDSP;
-            if (strstr(buf, " tls "))
-                *hwcap |= HWCAP_TLS;
-            if (strstr(buf, " thumbee "))
-                *hwcap |= HWCAP_THUMBEE;
-            if (strstr(buf, " vfp "))
-                *hwcap |= HWCAP_VFP;
-            if (strstr(buf, " vfpv3 "))
-                *hwcap |= HWCAP_VFPv3;
-            if (strstr(buf, " neon "))
-                *hwcap |= HWCAP_NEON;
-            break;
-        }
-    }
-    fclose(f);
-    return 0;
-}
-
-int ff_get_cpu_flags_arm(void)
-{
-    int flags = CORE_CPU_FLAGS;
-    uint32_t hwcap;
-
-    if (get_hwcap(&hwcap) < 0)
-        if (get_cpuinfo(&hwcap) < 0)
-            return flags;
-
-#define check_cap(cap, flag) do {               \
-        if (hwcap & HWCAP_ ## cap)              \
-            flags |= AV_CPU_FLAG_ ## flag;      \
-    } while (0)
-
-    /* No flags explicitly indicate v6 or v6T2 so check others which
-       imply support. */
-    check_cap(EDSP,    ARMV5TE);
-    check_cap(TLS,     ARMV6);
-    check_cap(THUMBEE, ARMV6T2);
-    check_cap(VFP,     VFP);
-    check_cap(VFPv3,   VFPV3);
-    check_cap(NEON,    NEON);
-
-    /* The v6 checks above are not reliable so let higher flags
-       trickle down. */
-    if (flags & (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON))
-        flags |= AV_CPU_FLAG_ARMV6T2;
-    if (flags & AV_CPU_FLAG_ARMV6T2)
-        flags |= AV_CPU_FLAG_ARMV6;
-
-    return flags;
-}
-
-#else
-
-int ff_get_cpu_flags_arm(void)
-{
-    return AV_CPU_FLAG_ARMV5TE * HAVE_ARMV5TE |
-           AV_CPU_FLAG_ARMV6   * HAVE_ARMV6   |
-           AV_CPU_FLAG_ARMV6T2 * HAVE_ARMV6T2 |
-           AV_CPU_FLAG_VFP     * HAVE_VFP     |
-           AV_CPU_FLAG_VFPV3   * HAVE_VFPV3   |
-           AV_CPU_FLAG_NEON    * HAVE_NEON;
-}
-
-#endif
diff --git a/deps/libav/libavutil/arm/cpu.h b/deps/libav/libavutil/arm/cpu.h
deleted file mode 100644
index 52e839c..0000000
--- a/deps/libav/libavutil/arm/cpu.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ARM_CPU_H
-#define AVUTIL_ARM_CPU_H
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/cpu_internal.h"
-
-#define have_armv5te(flags) CPUEXT(flags, ARMV5TE)
-#define have_armv6(flags)   CPUEXT(flags, ARMV6)
-#define have_armv6t2(flags) CPUEXT(flags, ARMV6T2)
-#define have_vfp(flags)     CPUEXT(flags, VFP)
-#define have_vfpv3(flags)   CPUEXT(flags, VFPV3)
-#define have_neon(flags)    CPUEXT(flags, NEON)
-
-#endif /* AVUTIL_ARM_CPU_H */
diff --git a/deps/libav/libavutil/arm/float_dsp_arm.h b/deps/libav/libavutil/arm/float_dsp_arm.h
deleted file mode 100644
index ec925ec..0000000
--- a/deps/libav/libavutil/arm/float_dsp_arm.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ARM_FLOAT_DSP_ARM_H
-#define AVUTIL_ARM_FLOAT_DSP_ARM_H
-
-#include "libavutil/float_dsp.h"
-
-void ff_float_dsp_init_vfp(AVFloatDSPContext *fdsp, int cpu_flags);
-void ff_float_dsp_init_neon(AVFloatDSPContext *fdsp);
-
-#endif /* AVUTIL_ARM_FLOAT_DSP_ARM_H */
diff --git a/deps/libav/libavutil/arm/float_dsp_init_arm.c b/deps/libav/libavutil/arm/float_dsp_init_arm.c
deleted file mode 100644
index 39a5e95..0000000
--- a/deps/libav/libavutil/arm/float_dsp_init_arm.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * ARM optimized DSP utils
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/float_dsp.h"
-#include "cpu.h"
-#include "float_dsp_arm.h"
-
-av_cold void ff_float_dsp_init_arm(AVFloatDSPContext *fdsp)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-    if (have_vfp(cpu_flags))
-        ff_float_dsp_init_vfp(fdsp, cpu_flags);
-    if (have_neon(cpu_flags))
-        ff_float_dsp_init_neon(fdsp);
-}
diff --git a/deps/libav/libavutil/arm/float_dsp_init_neon.c b/deps/libav/libavutil/arm/float_dsp_init_neon.c
deleted file mode 100644
index 617bf5d..0000000
--- a/deps/libav/libavutil/arm/float_dsp_init_neon.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * ARM NEON optimised Float DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/float_dsp.h"
-#include "float_dsp_arm.h"
-
-void ff_vector_fmul_neon(float *dst, const float *src0, const float *src1, int len);
-
-void ff_vector_fmac_scalar_neon(float *dst, const float *src, float mul,
-                                int len);
-
-void ff_vector_fmul_scalar_neon(float *dst, const float *src, float mul,
-                                int len);
-
-void ff_vector_fmul_window_neon(float *dst, const float *src0,
-                                const float *src1, const float *win, int len);
-
-void ff_vector_fmul_add_neon(float *dst, const float *src0, const float *src1,
-                             const float *src2, int len);
-
-void ff_vector_fmul_reverse_neon(float *dst, const float *src0,
-                                 const float *src1, int len);
-
-void ff_butterflies_float_neon(float *v1, float *v2, int len);
-
-float ff_scalarproduct_float_neon(const float *v1, const float *v2, int len);
-
-av_cold void ff_float_dsp_init_neon(AVFloatDSPContext *fdsp)
-{
-    fdsp->vector_fmul = ff_vector_fmul_neon;
-    fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_neon;
-    fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_neon;
-    fdsp->vector_fmul_window = ff_vector_fmul_window_neon;
-    fdsp->vector_fmul_add    = ff_vector_fmul_add_neon;
-    fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_neon;
-    fdsp->butterflies_float = ff_butterflies_float_neon;
-    fdsp->scalarproduct_float = ff_scalarproduct_float_neon;
-}
diff --git a/deps/libav/libavutil/arm/float_dsp_init_vfp.c b/deps/libav/libavutil/arm/float_dsp_init_vfp.c
deleted file mode 100644
index 31cb6ae..0000000
--- a/deps/libav/libavutil/arm/float_dsp_init_vfp.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2008 Siarhei Siamashka <ssvb at users.sourceforge.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/float_dsp.h"
-#include "cpu.h"
-#include "float_dsp_arm.h"
-
-void ff_vector_fmul_vfp(float *dst, const float *src0, const float *src1,
-                        int len);
-
-void ff_vector_fmul_reverse_vfp(float *dst, const float *src0,
-                                const float *src1, int len);
-
-av_cold void ff_float_dsp_init_vfp(AVFloatDSPContext *fdsp, int cpu_flags)
-{
-    if (!have_vfpv3(cpu_flags))
-        fdsp->vector_fmul = ff_vector_fmul_vfp;
-    fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_vfp;
-}
diff --git a/deps/libav/libavutil/arm/float_dsp_neon.S b/deps/libav/libavutil/arm/float_dsp_neon.S
deleted file mode 100644
index 559b565..0000000
--- a/deps/libav/libavutil/arm/float_dsp_neon.S
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * ARM NEON optimised Float DSP functions
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "asm.S"
-
-function ff_vector_fmul_neon, export=1
-        subs            r3,  r3,  #8
-        vld1.32         {d0-d3},  [r1,:128]!
-        vld1.32         {d4-d7},  [r2,:128]!
-        vmul.f32        q8,  q0,  q2
-        vmul.f32        q9,  q1,  q3
-        beq             3f
-        bics            ip,  r3,  #15
-        beq             2f
-1:      subs            ip,  ip,  #16
-        vld1.32         {d0-d1},  [r1,:128]!
-        vld1.32         {d4-d5},  [r2,:128]!
-        vmul.f32        q10, q0,  q2
-        vld1.32         {d2-d3},  [r1,:128]!
-        vld1.32         {d6-d7},  [r2,:128]!
-        vmul.f32        q11, q1,  q3
-        vst1.32         {d16-d19},[r0,:128]!
-        vld1.32         {d0-d1},  [r1,:128]!
-        vld1.32         {d4-d5},  [r2,:128]!
-        vmul.f32        q8,  q0,  q2
-        vld1.32         {d2-d3},  [r1,:128]!
-        vld1.32         {d6-d7},  [r2,:128]!
-        vmul.f32        q9,  q1,  q3
-        vst1.32         {d20-d23},[r0,:128]!
-        bne             1b
-        ands            r3,  r3,  #15
-        beq             3f
-2:      vld1.32         {d0-d1},  [r1,:128]!
-        vld1.32         {d4-d5},  [r2,:128]!
-        vst1.32         {d16-d17},[r0,:128]!
-        vmul.f32        q8,  q0,  q2
-        vld1.32         {d2-d3},  [r1,:128]!
-        vld1.32         {d6-d7},  [r2,:128]!
-        vst1.32         {d18-d19},[r0,:128]!
-        vmul.f32        q9,  q1,  q3
-3:      vst1.32         {d16-d19},[r0,:128]!
-        bx              lr
-endfunc
-
-function ff_vector_fmac_scalar_neon, export=1
-VFP     len .req r2
-VFP     acc .req r3
-NOVFP   len .req r3
-NOVFP   acc .req r2
-VFP     vdup.32         q15, d0[0]
-NOVFP   vdup.32         q15, r2
-        bics            r12, len, #15
-        mov             acc, r0
-        beq             3f
-        vld1.32         {q0},     [r1,:128]!
-        vld1.32         {q8},     [acc,:128]!
-        vld1.32         {q1},     [r1,:128]!
-        vld1.32         {q9},     [acc,:128]!
-1:      vmla.f32        q8,  q0,  q15
-        vld1.32         {q2},     [r1,:128]!
-        vld1.32         {q10},    [acc,:128]!
-        vmla.f32        q9,  q1,  q15
-        vld1.32         {q3},     [r1,:128]!
-        vld1.32         {q11},    [acc,:128]!
-        vmla.f32        q10, q2,  q15
-        vst1.32         {q8},     [r0,:128]!
-        vmla.f32        q11, q3,  q15
-        vst1.32         {q9},     [r0,:128]!
-        subs            r12, r12, #16
-        beq             2f
-        vld1.32         {q0},     [r1,:128]!
-        vld1.32         {q8},     [acc,:128]!
-        vst1.32         {q10},    [r0,:128]!
-        vld1.32         {q1},     [r1,:128]!
-        vld1.32         {q9},     [acc,:128]!
-        vst1.32         {q11},    [r0,:128]!
-        b               1b
-2:      vst1.32         {q10},    [r0,:128]!
-        vst1.32         {q11},    [r0,:128]!
-        ands            len, len, #15
-        it              eq
-        bxeq            lr
-3:      vld1.32         {q0},     [r1,:128]!
-        vld1.32         {q8},     [acc,:128]!
-        vmla.f32        q8,  q0,  q15
-        vst1.32         {q8},     [r0,:128]!
-        subs            len, len, #4
-        bgt             3b
-        bx              lr
-        .unreq          len
-endfunc
-
-function ff_vector_fmul_scalar_neon, export=1
-VFP     len .req r2
-NOVFP   len .req r3
-VFP     vdup.32         q8,  d0[0]
-NOVFP   vdup.32         q8,  r2
-        bics            r12, len, #15
-        beq             3f
-        vld1.32         {q0},[r1,:128]!
-        vld1.32         {q1},[r1,:128]!
-1:      vmul.f32        q0,  q0,  q8
-        vld1.32         {q2},[r1,:128]!
-        vmul.f32        q1,  q1,  q8
-        vld1.32         {q3},[r1,:128]!
-        vmul.f32        q2,  q2,  q8
-        vst1.32         {q0},[r0,:128]!
-        vmul.f32        q3,  q3,  q8
-        vst1.32         {q1},[r0,:128]!
-        subs            r12, r12, #16
-        beq             2f
-        vld1.32         {q0},[r1,:128]!
-        vst1.32         {q2},[r0,:128]!
-        vld1.32         {q1},[r1,:128]!
-        vst1.32         {q3},[r0,:128]!
-        b               1b
-2:      vst1.32         {q2},[r0,:128]!
-        vst1.32         {q3},[r0,:128]!
-        ands            len, len, #15
-        it              eq
-        bxeq            lr
-3:      vld1.32         {q0},[r1,:128]!
-        vmul.f32        q0,  q0,  q8
-        vst1.32         {q0},[r0,:128]!
-        subs            len, len, #4
-        bgt             3b
-        bx              lr
-        .unreq          len
-endfunc
-
-function ff_vector_fmul_window_neon, export=1
-        push            {r4,r5,lr}
-        ldr             lr,  [sp, #12]
-        sub             r2,  r2,  #8
-        sub             r5,  lr,  #2
-        add             r2,  r2,  r5, lsl #2
-        add             r4,  r3,  r5, lsl #3
-        add             ip,  r0,  r5, lsl #3
-        mov             r5,  #-16
-        vld1.32         {d0,d1},  [r1,:128]!
-        vld1.32         {d2,d3},  [r2,:128], r5
-        vld1.32         {d4,d5},  [r3,:128]!
-        vld1.32         {d6,d7},  [r4,:128], r5
-1:      subs            lr,  lr,  #4
-        vmul.f32        d22, d0,  d4
-        vrev64.32       q3,  q3
-        vmul.f32        d23, d1,  d5
-        vrev64.32       q1,  q1
-        vmul.f32        d20, d0,  d7
-        vmul.f32        d21, d1,  d6
-        beq             2f
-        vmla.f32        d22, d3,  d7
-        vld1.32         {d0,d1},  [r1,:128]!
-        vmla.f32        d23, d2,  d6
-        vld1.32         {d18,d19},[r2,:128], r5
-        vmls.f32        d20, d3,  d4
-        vld1.32         {d24,d25},[r3,:128]!
-        vmls.f32        d21, d2,  d5
-        vld1.32         {d6,d7},  [r4,:128], r5
-        vmov            q1,  q9
-        vrev64.32       q11, q11
-        vmov            q2,  q12
-        vswp            d22, d23
-        vst1.32         {d20,d21},[r0,:128]!
-        vst1.32         {d22,d23},[ip,:128], r5
-        b               1b
-2:      vmla.f32        d22, d3,  d7
-        vmla.f32        d23, d2,  d6
-        vmls.f32        d20, d3,  d4
-        vmls.f32        d21, d2,  d5
-        vrev64.32       q11, q11
-        vswp            d22, d23
-        vst1.32         {d20,d21},[r0,:128]!
-        vst1.32         {d22,d23},[ip,:128], r5
-        pop             {r4,r5,pc}
-endfunc
-
-function ff_vector_fmul_add_neon, export=1
-        ldr             r12, [sp]
-        vld1.32         {q0-q1},  [r1,:128]!
-        vld1.32         {q8-q9},  [r2,:128]!
-        vld1.32         {q2-q3},  [r3,:128]!
-        vmul.f32        q10, q0,  q8
-        vmul.f32        q11, q1,  q9
-1:      vadd.f32        q12, q2,  q10
-        vadd.f32        q13, q3,  q11
-        pld             [r1, #16]
-        pld             [r2, #16]
-        pld             [r3, #16]
-        subs            r12, r12, #8
-        beq             2f
-        vld1.32         {q0},     [r1,:128]!
-        vld1.32         {q8},     [r2,:128]!
-        vmul.f32        q10, q0,  q8
-        vld1.32         {q1},     [r1,:128]!
-        vld1.32         {q9},     [r2,:128]!
-        vmul.f32        q11, q1,  q9
-        vld1.32         {q2-q3},  [r3,:128]!
-        vst1.32         {q12-q13},[r0,:128]!
-        b               1b
-2:      vst1.32         {q12-q13},[r0,:128]!
-        bx              lr
-endfunc
-
-function ff_vector_fmul_reverse_neon, export=1
-        add             r2,  r2,  r3,  lsl #2
-        sub             r2,  r2,  #32
-        mov             r12, #-32
-        vld1.32         {q0-q1},  [r1,:128]!
-        vld1.32         {q2-q3},  [r2,:128], r12
-1:      pld             [r1, #32]
-        vrev64.32       q3,  q3
-        vmul.f32        d16, d0,  d7
-        vmul.f32        d17, d1,  d6
-        pld             [r2, #-32]
-        vrev64.32       q2,  q2
-        vmul.f32        d18, d2,  d5
-        vmul.f32        d19, d3,  d4
-        subs            r3,  r3,  #8
-        beq             2f
-        vld1.32         {q0-q1},  [r1,:128]!
-        vld1.32         {q2-q3},  [r2,:128], r12
-        vst1.32         {q8-q9},  [r0,:128]!
-        b               1b
-2:      vst1.32         {q8-q9},  [r0,:128]!
-        bx              lr
-endfunc
-
-function ff_butterflies_float_neon, export=1
-1:      vld1.32         {q0},[r0,:128]
-        vld1.32         {q1},[r1,:128]
-        vsub.f32        q2,  q0,  q1
-        vadd.f32        q1,  q0,  q1
-        vst1.32         {q2},[r1,:128]!
-        vst1.32         {q1},[r0,:128]!
-        subs            r2,  r2,  #4
-        bgt             1b
-        bx              lr
-endfunc
-
-function ff_scalarproduct_float_neon, export=1
-        vmov.f32        q2,  #0.0
-1:      vld1.32         {q0},[r0,:128]!
-        vld1.32         {q1},[r1,:128]!
-        vmla.f32        q2,  q0,  q1
-        subs            r2,  r2,  #4
-        bgt             1b
-        vadd.f32        d0,  d4,  d5
-        vpadd.f32       d0,  d0,  d0
-NOVFP   vmov.32         r0,  d0[0]
-        bx              lr
-endfunc
diff --git a/deps/libav/libavutil/arm/float_dsp_vfp.S b/deps/libav/libavutil/arm/float_dsp_vfp.S
deleted file mode 100644
index 8295280..0000000
--- a/deps/libav/libavutil/arm/float_dsp_vfp.S
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2008 Siarhei Siamashka <ssvb at users.sourceforge.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "asm.S"
-
-/**
- * Assume that len is a positive number and is multiple of 8
- */
-@ void ff_vector_fmul_vfp(float *dst, const float *src0, const float *src1, int len)
-function ff_vector_fmul_vfp, export=1
-        vpush           {d8-d15}
-        fmrx            r12, fpscr
-        orr             r12, r12, #(3 << 16) /* set vector size to 4 */
-        fmxr            fpscr, r12
-
-        vldmia          r1!, {s0-s3}
-        vldmia          r2!, {s8-s11}
-        vldmia          r1!, {s4-s7}
-        vldmia          r2!, {s12-s15}
-        vmul.f32        s8,  s0,  s8
-1:
-        subs            r3,  r3,  #16
-        vmul.f32        s12, s4,  s12
-        itttt           ge
-        vldmiage        r1!, {s16-s19}
-        vldmiage        r2!, {s24-s27}
-        vldmiage        r1!, {s20-s23}
-        vldmiage        r2!, {s28-s31}
-        it              ge
-        vmulge.f32      s24, s16, s24
-        vstmia          r0!, {s8-s11}
-        vstmia          r0!, {s12-s15}
-        it              ge
-        vmulge.f32      s28, s20, s28
-        itttt           gt
-        vldmiagt        r1!, {s0-s3}
-        vldmiagt        r2!, {s8-s11}
-        vldmiagt        r1!, {s4-s7}
-        vldmiagt        r2!, {s12-s15}
-        ittt            ge
-        vmulge.f32      s8,  s0,  s8
-        vstmiage        r0!, {s24-s27}
-        vstmiage        r0!, {s28-s31}
-        bgt             1b
-
-        bic             r12, r12, #(7 << 16) /* set vector size back to 1 */
-        fmxr            fpscr, r12
-        vpop            {d8-d15}
-        bx              lr
-endfunc
-
-/**
- * ARM VFP optimized implementation of 'vector_fmul_reverse_c' function.
- * Assume that len is a positive number and is multiple of 8
- */
-@ void ff_vector_fmul_reverse_vfp(float *dst, const float *src0,
-@                                 const float *src1, int len)
-function ff_vector_fmul_reverse_vfp, export=1
-        vpush           {d8-d15}
-        add             r2,  r2,  r3, lsl #2
-        vldmdb          r2!, {s0-s3}
-        vldmia          r1!, {s8-s11}
-        vldmdb          r2!, {s4-s7}
-        vldmia          r1!, {s12-s15}
-        vmul.f32        s8,  s3,  s8
-        vmul.f32        s9,  s2,  s9
-        vmul.f32        s10, s1,  s10
-        vmul.f32        s11, s0,  s11
-1:
-        subs            r3,  r3,  #16
-        it              ge
-        vldmdbge        r2!, {s16-s19}
-        vmul.f32        s12, s7,  s12
-        it              ge
-        vldmiage        r1!, {s24-s27}
-        vmul.f32        s13, s6,  s13
-        it              ge
-        vldmdbge        r2!, {s20-s23}
-        vmul.f32        s14, s5,  s14
-        it              ge
-        vldmiage        r1!, {s28-s31}
-        vmul.f32        s15, s4,  s15
-        it              ge
-        vmulge.f32      s24, s19, s24
-        it              gt
-        vldmdbgt        r2!, {s0-s3}
-        it              ge
-        vmulge.f32      s25, s18, s25
-        vstmia          r0!, {s8-s13}
-        it              ge
-        vmulge.f32      s26, s17, s26
-        it              gt
-        vldmiagt        r1!, {s8-s11}
-        itt             ge
-        vmulge.f32      s27, s16, s27
-        vmulge.f32      s28, s23, s28
-        it              gt
-        vldmdbgt        r2!, {s4-s7}
-        it              ge
-        vmulge.f32      s29, s22, s29
-        vstmia          r0!, {s14-s15}
-        ittt            ge
-        vmulge.f32      s30, s21, s30
-        vmulge.f32      s31, s20, s31
-        vmulge.f32      s8,  s3,  s8
-        it              gt
-        vldmiagt        r1!, {s12-s15}
-        itttt           ge
-        vmulge.f32      s9,  s2,  s9
-        vmulge.f32      s10, s1,  s10
-        vstmiage        r0!, {s24-s27}
-        vmulge.f32      s11, s0,  s11
-        it              ge
-        vstmiage        r0!, {s28-s31}
-        bgt             1b
-
-        vpop            {d8-d15}
-        bx              lr
-endfunc
diff --git a/deps/libav/libavutil/arm/intmath.h b/deps/libav/libavutil/arm/intmath.h
deleted file mode 100644
index 56fcdb3..0000000
--- a/deps/libav/libavutil/arm/intmath.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ARM_INTMATH_H
-#define AVUTIL_ARM_INTMATH_H
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#if HAVE_INLINE_ASM
-
-#if HAVE_ARMV6_INLINE
-
-#define av_clip_uint8 av_clip_uint8_arm
-static av_always_inline av_const unsigned av_clip_uint8_arm(int a)
-{
-    unsigned x;
-    __asm__ ("usat %0, #8,  %1" : "=r"(x) : "r"(a));
-    return x;
-}
-
-#define av_clip_int8 av_clip_int8_arm
-static av_always_inline av_const int av_clip_int8_arm(int a)
-{
-    int x;
-    __asm__ ("ssat %0, #8,  %1" : "=r"(x) : "r"(a));
-    return x;
-}
-
-#define av_clip_uint16 av_clip_uint16_arm
-static av_always_inline av_const unsigned av_clip_uint16_arm(int a)
-{
-    unsigned x;
-    __asm__ ("usat %0, #16, %1" : "=r"(x) : "r"(a));
-    return x;
-}
-
-#define av_clip_int16 av_clip_int16_arm
-static av_always_inline av_const int av_clip_int16_arm(int a)
-{
-    int x;
-    __asm__ ("ssat %0, #16, %1" : "=r"(x) : "r"(a));
-    return x;
-}
-
-#define av_clip_uintp2 av_clip_uintp2_arm
-static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
-{
-    unsigned x;
-    __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
-    return x;
-}
-
-#define av_sat_add32 av_sat_add32_arm
-static av_always_inline int av_sat_add32_arm(int a, int b)
-{
-    int r;
-    __asm__ ("qadd %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
-    return r;
-}
-
-#define av_sat_dadd32 av_sat_dadd32_arm
-static av_always_inline int av_sat_dadd32_arm(int a, int b)
-{
-    int r;
-    __asm__ ("qdadd %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
-    return r;
-}
-
-#endif /* HAVE_ARMV6_INLINE */
-
-#if HAVE_ASM_MOD_Q
-
-#define av_clipl_int32 av_clipl_int32_arm
-static av_always_inline av_const int32_t av_clipl_int32_arm(int64_t a)
-{
-    int x, y;
-    __asm__ ("adds   %1, %R2, %Q2, lsr #31  \n\t"
-             "itet   ne                     \n\t"
-             "mvnne  %1, #1<<31             \n\t"
-             "moveq  %0, %Q2                \n\t"
-             "eorne  %0, %1,  %R2, asr #31  \n\t"
-             : "=r"(x), "=&r"(y) : "r"(a) : "cc");
-    return x;
-}
-
-#endif /* HAVE_ASM_MOD_Q */
-
-#endif /* HAVE_INLINE_ASM */
-
-#endif /* AVUTIL_ARM_INTMATH_H */
diff --git a/deps/libav/libavutil/arm/intreadwrite.h b/deps/libav/libavutil/arm/intreadwrite.h
deleted file mode 100644
index 6eff733..0000000
--- a/deps/libav/libavutil/arm/intreadwrite.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ARM_INTREADWRITE_H
-#define AVUTIL_ARM_INTREADWRITE_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#if HAVE_FAST_UNALIGNED && HAVE_INLINE_ASM && !AV_GCC_VERSION_AT_LEAST(4,7)
-
-#define AV_RN16 AV_RN16
-static av_always_inline unsigned AV_RN16(const void *p)
-{
-    const uint8_t *q = p;
-    unsigned v;
-#if !AV_GCC_VERSION_AT_LEAST(4,6)
-    __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)q));
-#elif defined __thumb__
-    __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(q[0]), "m"(q[1]));
-#else
-    __asm__ ("ldrh %0, %1" : "=r"(v) : "Uq"(q[0]), "m"(q[1]));
-#endif
-    return v;
-}
-
-#define AV_WN16 AV_WN16
-static av_always_inline void AV_WN16(void *p, uint16_t v)
-{
-    __asm__ ("strh %1, %0" : "=m"(*(uint16_t *)p) : "r"(v));
-}
-
-#define AV_RN32 AV_RN32
-static av_always_inline uint32_t AV_RN32(const void *p)
-{
-    const struct __attribute__((packed)) { uint32_t v; } *q = p;
-    uint32_t v;
-    __asm__ ("ldr  %0, %1" : "=r"(v) : "m"(*q));
-    return v;
-}
-
-#define AV_WN32 AV_WN32
-static av_always_inline void AV_WN32(void *p, uint32_t v)
-{
-    __asm__ ("str  %1, %0" : "=m"(*(uint32_t *)p) : "r"(v));
-}
-
-#if HAVE_ASM_MOD_Q
-
-#define AV_RN64 AV_RN64
-static av_always_inline uint64_t AV_RN64(const void *p)
-{
-    const struct __attribute__((packed)) { uint32_t v; } *q = p;
-    uint64_t v;
-    __asm__ ("ldr   %Q0, %1  \n\t"
-             "ldr   %R0, %2  \n\t"
-             : "=&r"(v)
-             : "m"(q[0]), "m"(q[1]));
-    return v;
-}
-
-#define AV_WN64 AV_WN64
-static av_always_inline void AV_WN64(void *p, uint64_t v)
-{
-    __asm__ ("str  %Q2, %0  \n\t"
-             "str  %R2, %1  \n\t"
-             : "=m"(*(uint32_t*)p), "=m"(*((uint32_t*)p+1))
-             : "r"(v));
-}
-
-#endif /* HAVE_ASM_MOD_Q */
-
-#endif /* HAVE_INLINE_ASM */
-
-#endif /* AVUTIL_ARM_INTREADWRITE_H */
diff --git a/deps/libav/libavutil/arm/neontest.h b/deps/libav/libavutil/arm/neontest.h
deleted file mode 100644
index eb46df8..0000000
--- a/deps/libav/libavutil/arm/neontest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * check NEON registers for clobbering
- * Copyright (c) 2008 Ramiro Polla <ramiro.polla at gmail.com>
- * Copyright (c) 2013 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include "libavutil/bswap.h"
-
-#define storeneonregs(mem)                \
-    __asm__ volatile(                     \
-        "vstm %0, {d8-d15}\n\t"           \
-        :: "r"(mem) : "memory")
-
-#define testneonclobbers(func, ctx, ...)                        \
-    uint64_t neon[2][8];                                        \
-    int ret;                                                    \
-    storeneonregs(neon[0]);                                     \
-    ret = __real_ ## func(ctx, __VA_ARGS__);                    \
-    storeneonregs(neon[1]);                                     \
-    if (memcmp(neon[0], neon[1], sizeof(neon[0]))) {            \
-        int i;                                                  \
-        av_log(ctx, AV_LOG_ERROR,                               \
-               "NEON REGS CLOBBERED IN %s!\n", #func);          \
-        for (i = 0; i < 8; i ++)                                \
-            if (neon[0][i] != neon[1][i]) {                     \
-                av_log(ctx, AV_LOG_ERROR,                       \
-                       "d%-2d = %016"PRIx64"\n",                \
-                       8 + i, av_bswap64(neon[0][i]));          \
-                av_log(ctx, AV_LOG_ERROR,                       \
-                       "   -> %016"PRIx64"\n",                  \
-                       av_bswap64(neon[1][i]));                 \
-            }                                                   \
-        abort();                                                \
-    }                                                           \
-    return ret
-
-#define wrap(func)      \
-int __real_ ## func;    \
-int __wrap_ ## func;    \
-int __wrap_ ## func
diff --git a/deps/libav/libavutil/arm/timer.h b/deps/libav/libavutil/arm/timer.h
deleted file mode 100644
index 4bca877..0000000
--- a/deps/libav/libavutil/arm/timer.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ARM_TIMER_H
-#define AVUTIL_ARM_TIMER_H
-
-#include <stdint.h>
-#include "config.h"
-
-#if HAVE_INLINE_ASM && defined(__ARM_ARCH_7A__)
-
-#define AV_READ_TIME read_time
-
-static inline uint64_t read_time(void)
-{
-    unsigned cc;
-    __asm__ volatile ("mrc p15, 0, %0, c9, c13, 0" : "=r"(cc));
-    return cc;
-}
-
-#endif /* HAVE_INLINE_ASM && __ARM_ARCH_7A__ */
-
-#endif /* AVUTIL_ARM_TIMER_H */
diff --git a/deps/libav/libavutil/atomic.c b/deps/libav/libavutil/atomic.c
deleted file mode 100644
index e4fa957..0000000
--- a/deps/libav/libavutil/atomic.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "atomic.h"
-
-#if !HAVE_ATOMICS_NATIVE
-
-#if HAVE_PTHREADS
-
-#include <pthread.h>
-
-static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER;
-
-int avpriv_atomic_int_get(volatile int *ptr)
-{
-    int res;
-
-    pthread_mutex_lock(&atomic_lock);
-    res = *ptr;
-    pthread_mutex_unlock(&atomic_lock);
-
-    return res;
-}
-
-void avpriv_atomic_int_set(volatile int *ptr, int val)
-{
-    pthread_mutex_lock(&atomic_lock);
-    *ptr = val;
-    pthread_mutex_unlock(&atomic_lock);
-}
-
-int avpriv_atomic_int_add_and_fetch(volatile int *ptr, int inc)
-{
-    int res;
-
-    pthread_mutex_lock(&atomic_lock);
-    *ptr += inc;
-    res = *ptr;
-    pthread_mutex_unlock(&atomic_lock);
-
-    return res;
-}
-
-void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval)
-{
-    void *ret;
-    pthread_mutex_lock(&atomic_lock);
-    ret = *ptr;
-    if (*ptr == oldval)
-        *ptr = newval;
-    pthread_mutex_unlock(&atomic_lock);
-    return ret;
-}
-
-#elif !HAVE_THREADS
-
-int avpriv_atomic_int_get(volatile int *ptr)
-{
-    return *ptr;
-}
-
-void avpriv_atomic_int_set(volatile int *ptr, int val)
-{
-    *ptr = val;
-}
-
-int avpriv_atomic_int_add_and_fetch(volatile int *ptr, int inc)
-{
-    *ptr += inc;
-    return *ptr;
-}
-
-void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval)
-{
-    if (*ptr == oldval) {
-        *ptr = newval;
-        return oldval;
-    }
-    return *ptr;
-}
-
-#else
-
-#error "Threading is enabled, but there is no implementation of atomic operations available"
-
-#endif /* HAVE_PTHREADS */
-
-#endif /* !HAVE_ATOMICS_NATIVE */
-
-#ifdef TEST
-#include <assert.h>
-
-int main(void)
-{
-    volatile int val = 1;
-    int res;
-
-    res = avpriv_atomic_int_add_and_fetch(&val, 1);
-    assert(res == 2);
-    avpriv_atomic_int_set(&val, 3);
-    res = avpriv_atomic_int_get(&val);
-    assert(res == 3);
-
-    return 0;
-}
-#endif
diff --git a/deps/libav/libavutil/atomic.h b/deps/libav/libavutil/atomic.h
deleted file mode 100644
index 57a0c19..0000000
--- a/deps/libav/libavutil/atomic.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ATOMIC_H
-#define AVUTIL_ATOMIC_H
-
-#include "config.h"
-
-#if HAVE_ATOMICS_NATIVE
-
-#if HAVE_ATOMICS_GCC
-#include "atomic_gcc.h"
-#elif HAVE_ATOMICS_WIN32
-#include "atomic_win32.h"
-#elif HAVE_ATOMICS_SUNCC
-#include "atomic_suncc.h"
-#endif
-
-#else
-
-/**
- * Load the current value stored in an atomic integer.
- *
- * @param ptr atomic integer
- * @return the current value of the atomic integer
- * @note This acts as a memory barrier.
- */
-int avpriv_atomic_int_get(volatile int *ptr);
-
-/**
- * Store a new value in an atomic integer.
- *
- * @param ptr atomic integer
- * @param val the value to store in the atomic integer
- * @note This acts as a memory barrier.
- */
-void avpriv_atomic_int_set(volatile int *ptr, int val);
-
-/**
- * Add a value to an atomic integer.
- *
- * @param ptr atomic integer
- * @param inc the value to add to the atomic integer (may be negative)
- * @return the new value of the atomic integer.
- * @note This does NOT act as a memory barrier. This is primarily
- *       intended for reference counting.
- */
-int avpriv_atomic_int_add_and_fetch(volatile int *ptr, int inc);
-
-/**
- * Atomic pointer compare and swap.
- *
- * @param ptr pointer to the pointer to operate on
- * @param oldval do the swap if the current value of *ptr equals to oldval
- * @param newval value to replace *ptr with
- * @return the value of *ptr before comparison
- */
-void *avpriv_atomic_ptr_cas(void * volatile *ptr, void *oldval, void *newval);
-
-#endif /* HAVE_ATOMICS_NATIVE */
-
-#endif /* AVUTIL_ATOMIC_H */
diff --git a/deps/libav/libavutil/atomic_gcc.h b/deps/libav/libavutil/atomic_gcc.h
deleted file mode 100644
index 9470e8e..0000000
--- a/deps/libav/libavutil/atomic_gcc.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ATOMIC_GCC_H
-#define AVUTIL_ATOMIC_GCC_H
-
-#include <stdint.h>
-
-#include "atomic.h"
-
-#define avpriv_atomic_int_get atomic_int_get_gcc
-static inline int atomic_int_get_gcc(volatile int *ptr)
-{
-    __sync_synchronize();
-    return *ptr;
-}
-
-#define avpriv_atomic_int_set atomic_int_set_gcc
-static inline void atomic_int_set_gcc(volatile int *ptr, int val)
-{
-    *ptr = val;
-    __sync_synchronize();
-}
-
-#define avpriv_atomic_int_add_and_fetch atomic_int_add_and_fetch_gcc
-static inline int atomic_int_add_and_fetch_gcc(volatile int *ptr, int inc)
-{
-    return __sync_add_and_fetch(ptr, inc);
-}
-
-#define avpriv_atomic_ptr_cas atomic_ptr_cas_gcc
-static inline void *atomic_ptr_cas_gcc(void * volatile *ptr,
-                                       void *oldval, void *newval)
-{
-#ifdef __ARMCC_VERSION
-    // armcc will throw an error if ptr is not an integer type
-    volatile uintptr_t *tmp = (volatile uintptr_t*)ptr;
-    return (void*)__sync_val_compare_and_swap(tmp, oldval, newval);
-#else
-    return __sync_val_compare_and_swap(ptr, oldval, newval);
-#endif
-}
-
-#endif /* AVUTIL_ATOMIC_GCC_H */
diff --git a/deps/libav/libavutil/atomic_suncc.h b/deps/libav/libavutil/atomic_suncc.h
deleted file mode 100644
index 5c11b57..0000000
--- a/deps/libav/libavutil/atomic_suncc.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ATOMIC_SUNCC_H
-#define AVUTIL_ATOMIC_SUNCC_H
-
-#include <atomic.h>
-#include <mbarrier.h>
-
-#include "atomic.h"
-
-#define avpriv_atomic_int_get atomic_int_get_suncc
-static inline int atomic_int_get_suncc(volatile int *ptr)
-{
-    __machine_rw_barrier();
-    return *ptr;
-}
-
-#define avpriv_atomic_int_set atomic_int_set_suncc
-static inline void atomic_int_set_suncc(volatile int *ptr, int val)
-{
-    *ptr = val;
-    __machine_rw_barrier();
-}
-
-#define avpriv_atomic_int_add_and_fetch atomic_int_add_and_fetch_suncc
-static inline int atomic_int_add_and_fetch_suncc(volatile int *ptr, int inc)
-{
-    return atomic_add_int_nv(ptr, inc);
-}
-
-#define avpriv_atomic_ptr_cas atomic_ptr_cas_suncc
-static inline void *atomic_ptr_cas_suncc(void * volatile *ptr,
-                                         void *oldval, void *newval)
-{
-    return atomic_cas_ptr(ptr, oldval, newval);
-}
-
-#endif /* AVUTIL_ATOMIC_SUNCC_H */
diff --git a/deps/libav/libavutil/atomic_win32.h b/deps/libav/libavutil/atomic_win32.h
deleted file mode 100644
index 84e8b7f..0000000
--- a/deps/libav/libavutil/atomic_win32.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_ATOMIC_WIN32_H
-#define AVUTIL_ATOMIC_WIN32_H
-
-#include <windows.h>
-
-#include "atomic.h"
-
-#define avpriv_atomic_int_get atomic_int_get_win32
-static inline int atomic_int_get_win32(volatile int *ptr)
-{
-    MemoryBarrier();
-    return *ptr;
-}
-
-#define avpriv_atomic_int_set atomic_int_set_win32
-static inline void atomic_int_set_win32(volatile int *ptr, int val)
-{
-    *ptr = val;
-    MemoryBarrier();
-}
-
-#define avpriv_atomic_int_add_and_fetch atomic_int_add_and_fetch_win32
-static inline int atomic_int_add_and_fetch_win32(volatile int *ptr, int inc)
-{
-    return inc + InterlockedExchangeAdd(ptr, inc);
-}
-
-#define avpriv_atomic_ptr_cas atomic_ptr_cas_win32
-static inline void *atomic_ptr_cas_win32(void * volatile *ptr,
-                                         void *oldval, void *newval)
-{
-    return InterlockedCompareExchangePointer(ptr, newval, oldval);
-}
-
-#endif /* AVUTIL_ATOMIC_WIN32_H */
diff --git a/deps/libav/libavutil/attributes.h b/deps/libav/libavutil/attributes.h
deleted file mode 100644
index d7f2bb5..0000000
--- a/deps/libav/libavutil/attributes.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Macro definitions for various function/variable attributes
- */
-
-#ifndef AVUTIL_ATTRIBUTES_H
-#define AVUTIL_ATTRIBUTES_H
-
-#ifdef __GNUC__
-#    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
-#else
-#    define AV_GCC_VERSION_AT_LEAST(x,y) 0
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_always_inline __attribute__((always_inline)) inline
-#elif defined(_MSC_VER)
-#    define av_always_inline __forceinline
-#else
-#    define av_always_inline inline
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_noinline __attribute__((noinline))
-#elif defined(_MSC_VER)
-#    define av_noinline __declspec(noinline)
-#else
-#    define av_noinline
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_pure __attribute__((pure))
-#else
-#    define av_pure
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(2,6)
-#    define av_const __attribute__((const))
-#else
-#    define av_const
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(4,3)
-#    define av_cold __attribute__((cold))
-#else
-#    define av_cold
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__llvm__)
-#    define av_flatten __attribute__((flatten))
-#else
-#    define av_flatten
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define attribute_deprecated __attribute__((deprecated))
-#elif defined(_MSC_VER)
-#    define attribute_deprecated __declspec(deprecated)
-#else
-#    define attribute_deprecated
-#endif
-
-#if defined(__GNUC__)
-#    define av_unused __attribute__((unused))
-#else
-#    define av_unused
-#endif
-
-/**
- * Mark a variable as used and prevent the compiler from optimizing it
- * away.  This is useful for variables accessed only from inline
- * assembler without the compiler being aware.
- */
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_used __attribute__((used))
-#else
-#    define av_used
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,3)
-#   define av_alias __attribute__((may_alias))
-#else
-#   define av_alias
-#endif
-
-#if defined(__GNUC__) && !defined(__ICC)
-#    define av_uninit(x) x=x
-#else
-#    define av_uninit(x) x
-#endif
-
-#ifdef __GNUC__
-#    define av_builtin_constant_p __builtin_constant_p
-#    define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
-#else
-#    define av_builtin_constant_p(x) 0
-#    define av_printf_format(fmtpos, attrpos)
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(2,5)
-#    define av_noreturn __attribute__((noreturn))
-#else
-#    define av_noreturn
-#endif
-
-#endif /* AVUTIL_ATTRIBUTES_H */
diff --git a/deps/libav/libavutil/audio_fifo.c b/deps/libav/libavutil/audio_fifo.c
deleted file mode 100644
index b562537..0000000
--- a/deps/libav/libavutil/audio_fifo.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Audio FIFO
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Audio FIFO
- */
-
-#include "avutil.h"
-#include "audio_fifo.h"
-#include "common.h"
-#include "fifo.h"
-#include "mem.h"
-#include "samplefmt.h"
-
-struct AVAudioFifo {
-    AVFifoBuffer **buf;             /**< single buffer for interleaved, per-channel buffers for planar */
-    int nb_buffers;                 /**< number of buffers */
-    int nb_samples;                 /**< number of samples currently in the FIFO */
-    int allocated_samples;          /**< current allocated size, in samples */
-
-    int channels;                   /**< number of channels */
-    enum AVSampleFormat sample_fmt; /**< sample format */
-    int sample_size;                /**< size, in bytes, of one sample in a buffer */
-};
-
-void av_audio_fifo_free(AVAudioFifo *af)
-{
-    if (af) {
-        if (af->buf) {
-            int i;
-            for (i = 0; i < af->nb_buffers; i++) {
-                if (af->buf[i])
-                    av_fifo_free(af->buf[i]);
-            }
-            av_free(af->buf);
-        }
-        av_free(af);
-    }
-}
-
-AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
-                                 int nb_samples)
-{
-    AVAudioFifo *af;
-    int buf_size, i;
-
-    /* get channel buffer size (also validates parameters) */
-    if (av_samples_get_buffer_size(&buf_size, channels, nb_samples, sample_fmt, 1) < 0)
-        return NULL;
-
-    af = av_mallocz(sizeof(*af));
-    if (!af)
-        return NULL;
-
-    af->channels    = channels;
-    af->sample_fmt  = sample_fmt;
-    af->sample_size = buf_size / nb_samples;
-    af->nb_buffers  = av_sample_fmt_is_planar(sample_fmt) ? channels : 1;
-
-    af->buf = av_mallocz(af->nb_buffers * sizeof(*af->buf));
-    if (!af->buf)
-        goto error;
-
-    for (i = 0; i < af->nb_buffers; i++) {
-        af->buf[i] = av_fifo_alloc(buf_size);
-        if (!af->buf[i])
-            goto error;
-    }
-    af->allocated_samples = nb_samples;
-
-    return af;
-
-error:
-    av_audio_fifo_free(af);
-    return NULL;
-}
-
-int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples)
-{
-    int i, ret, buf_size;
-
-    if ((ret = av_samples_get_buffer_size(&buf_size, af->channels, nb_samples,
-                                          af->sample_fmt, 1)) < 0)
-        return ret;
-
-    for (i = 0; i < af->nb_buffers; i++) {
-        if ((ret = av_fifo_realloc2(af->buf[i], buf_size)) < 0)
-            return ret;
-    }
-    af->allocated_samples = nb_samples;
-    return 0;
-}
-
-int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
-{
-    int i, ret, size;
-
-    /* automatically reallocate buffers if needed */
-    if (av_audio_fifo_space(af) < nb_samples) {
-        int current_size = av_audio_fifo_size(af);
-        /* check for integer overflow in new size calculation */
-        if (INT_MAX / 2 - current_size < nb_samples)
-            return AVERROR(EINVAL);
-        /* reallocate buffers */
-        if ((ret = av_audio_fifo_realloc(af, 2 * (current_size + nb_samples))) < 0)
-            return ret;
-    }
-
-    size = nb_samples * af->sample_size;
-    for (i = 0; i < af->nb_buffers; i++) {
-        ret = av_fifo_generic_write(af->buf[i], data[i], size, NULL);
-        if (ret != size)
-            return AVERROR_BUG;
-    }
-    af->nb_samples += nb_samples;
-
-    return nb_samples;
-}
-
-int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples)
-{
-    int i, ret, size;
-
-    if (nb_samples < 0)
-        return AVERROR(EINVAL);
-    nb_samples = FFMIN(nb_samples, af->nb_samples);
-    if (!nb_samples)
-        return 0;
-
-    size = nb_samples * af->sample_size;
-    for (i = 0; i < af->nb_buffers; i++) {
-        if ((ret = av_fifo_generic_read(af->buf[i], data[i], size, NULL)) < 0)
-            return AVERROR_BUG;
-    }
-    af->nb_samples -= nb_samples;
-
-    return nb_samples;
-}
-
-int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples)
-{
-    int i, size;
-
-    if (nb_samples < 0)
-        return AVERROR(EINVAL);
-    nb_samples = FFMIN(nb_samples, af->nb_samples);
-
-    if (nb_samples) {
-        size = nb_samples * af->sample_size;
-        for (i = 0; i < af->nb_buffers; i++)
-            av_fifo_drain(af->buf[i], size);
-        af->nb_samples -= nb_samples;
-    }
-    return 0;
-}
-
-void av_audio_fifo_reset(AVAudioFifo *af)
-{
-    int i;
-
-    for (i = 0; i < af->nb_buffers; i++)
-        av_fifo_reset(af->buf[i]);
-
-    af->nb_samples = 0;
-}
-
-int av_audio_fifo_size(AVAudioFifo *af)
-{
-    return af->nb_samples;
-}
-
-int av_audio_fifo_space(AVAudioFifo *af)
-{
-    return af->allocated_samples - af->nb_samples;
-}
diff --git a/deps/libav/libavutil/audio_fifo.h b/deps/libav/libavutil/audio_fifo.h
deleted file mode 100644
index 8c76388..0000000
--- a/deps/libav/libavutil/audio_fifo.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Audio FIFO
- * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Audio FIFO Buffer
- */
-
-#ifndef AVUTIL_AUDIO_FIFO_H
-#define AVUTIL_AUDIO_FIFO_H
-
-#include "avutil.h"
-#include "fifo.h"
-#include "samplefmt.h"
-
-/**
- * @addtogroup lavu_audio
- * @{
- */
-
-/**
- * Context for an Audio FIFO Buffer.
- *
- * - Operates at the sample level rather than the byte level.
- * - Supports multiple channels with either planar or packed sample format.
- * - Automatic reallocation when writing to a full buffer.
- */
-typedef struct AVAudioFifo AVAudioFifo;
-
-/**
- * Free an AVAudioFifo.
- *
- * @param af  AVAudioFifo to free
- */
-void av_audio_fifo_free(AVAudioFifo *af);
-
-/**
- * Allocate an AVAudioFifo.
- *
- * @param sample_fmt  sample format
- * @param channels    number of channels
- * @param nb_samples  initial allocation size, in samples
- * @return            newly allocated AVAudioFifo, or NULL on error
- */
-AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
-                                 int nb_samples);
-
-/**
- * Reallocate an AVAudioFifo.
- *
- * @param af          AVAudioFifo to reallocate
- * @param nb_samples  new allocation size, in samples
- * @return            0 if OK, or negative AVERROR code on failure
- */
-int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
-
-/**
- * Write data to an AVAudioFifo.
- *
- * The AVAudioFifo will be reallocated automatically if the available space
- * is less than nb_samples.
- *
- * @see enum AVSampleFormat
- * The documentation for AVSampleFormat describes the data layout.
- *
- * @param af          AVAudioFifo to write to
- * @param data        audio data plane pointers
- * @param nb_samples  number of samples to write
- * @return            number of samples actually written, or negative AVERROR
- *                    code on failure.
- */
-int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
-
-/**
- * Read data from an AVAudioFifo.
- *
- * @see enum AVSampleFormat
- * The documentation for AVSampleFormat describes the data layout.
- *
- * @param af          AVAudioFifo to read from
- * @param data        audio data plane pointers
- * @param nb_samples  number of samples to read
- * @return            number of samples actually read, or negative AVERROR code
- *                    on failure.
- */
-int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples);
-
-/**
- * Drain data from an AVAudioFifo.
- *
- * Removes the data without reading it.
- *
- * @param af          AVAudioFifo to drain
- * @param nb_samples  number of samples to drain
- * @return            0 if OK, or negative AVERROR code on failure
- */
-int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples);
-
-/**
- * Reset the AVAudioFifo buffer.
- *
- * This empties all data in the buffer.
- *
- * @param af  AVAudioFifo to reset
- */
-void av_audio_fifo_reset(AVAudioFifo *af);
-
-/**
- * Get the current number of samples in the AVAudioFifo available for reading.
- *
- * @param af  the AVAudioFifo to query
- * @return    number of samples available for reading
- */
-int av_audio_fifo_size(AVAudioFifo *af);
-
-/**
- * Get the current number of samples in the AVAudioFifo available for writing.
- *
- * @param af  the AVAudioFifo to query
- * @return    number of samples available for writing
- */
-int av_audio_fifo_space(AVAudioFifo *af);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_AUDIO_FIFO_H */
diff --git a/deps/libav/libavutil/audioconvert.h b/deps/libav/libavutil/audioconvert.h
deleted file mode 100644
index 300a67c..0000000
--- a/deps/libav/libavutil/audioconvert.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-#include "version.h"
-
-#if FF_API_AUDIOCONVERT
-#include "channel_layout.h"
-#endif
diff --git a/deps/libav/libavutil/avassert.h b/deps/libav/libavutil/avassert.h
deleted file mode 100644
index b223d26..0000000
--- a/deps/libav/libavutil/avassert.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * copyright (c) 2010 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * simple assert() macros that are a bit more flexible than ISO C assert().
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVUTIL_AVASSERT_H
-#define AVUTIL_AVASSERT_H
-
-#include <stdlib.h>
-#include "avutil.h"
-#include "log.h"
-
-/**
- * assert() equivalent, that is always enabled.
- */
-#define av_assert0(cond) do {                                           \
-    if (!(cond)) {                                                      \
-        av_log(NULL, AV_LOG_FATAL, "Assertion %s failed at %s:%d\n",    \
-               AV_STRINGIFY(cond), __FILE__, __LINE__);                 \
-        abort();                                                        \
-    }                                                                   \
-} while (0)
-
-
-/**
- * assert() equivalent, that does not lie in speed critical code.
- * These asserts() thus can be enabled without fearing speedloss.
- */
-#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
-#define av_assert1(cond) av_assert0(cond)
-#else
-#define av_assert1(cond) ((void)0)
-#endif
-
-
-/**
- * assert() equivalent, that does lie in speed critical code.
- */
-#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
-#define av_assert2(cond) av_assert0(cond)
-#else
-#define av_assert2(cond) ((void)0)
-#endif
-
-#endif /* AVUTIL_AVASSERT_H */
diff --git a/deps/libav/libavutil/avr32/bswap.h b/deps/libav/libavutil/avr32/bswap.h
deleted file mode 100644
index 857f024..0000000
--- a/deps/libav/libavutil/avr32/bswap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AVR32_BSWAP_H
-#define AVUTIL_AVR32_BSWAP_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#if HAVE_INLINE_ASM
-
-#define av_bswap16 av_bswap16
-static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
-{
-    __asm__ ("swap.bh %0" : "+r"(x));
-    return x;
-}
-
-#define av_bswap32 av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-    __asm__ ("swap.b  %0" : "+r"(x));
-    return x;
-}
-
-#endif /* HAVE_INLINE_ASM */
-
-#endif /* AVUTIL_AVR32_BSWAP_H */
diff --git a/deps/libav/libavutil/avr32/intreadwrite.h b/deps/libav/libavutil/avr32/intreadwrite.h
deleted file mode 100644
index e0049fe..0000000
--- a/deps/libav/libavutil/avr32/intreadwrite.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AVR32_INTREADWRITE_H
-#define AVUTIL_AVR32_INTREADWRITE_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/bswap.h"
-
-/*
- * AVR32 does not support unaligned memory accesses, except for the AP
- * series which suppports unaligned 32-bit loads and stores.  16-bit
- * and 64-bit accesses must be aligned to 16 and 32 bits, respectively.
- * This means we cannot use the byte-swapping load/store instructions
- * here.
- *
- * For 16-bit, 24-bit, and (on UC series) 32-bit loads, we instead use
- * the LDINS.B instruction, which gcc fails to utilise with the
- * generic code.  GCC also fails to use plain LD.W and ST.W even for
- * AP processors, so we override the generic code.  The 64-bit
- * versions are improved by using our optimised 32-bit functions.
- */
-
-#define AV_RL16 AV_RL16
-static av_always_inline uint16_t AV_RL16(const void *p)
-{
-    uint16_t v;
-    __asm__ ("ld.ub    %0,   %1  \n\t"
-             "ldins.b  %0:l, %2  \n\t"
-             : "=&r"(v)
-             : "m"(*(const uint8_t*)p), "RKs12"(*((const uint8_t*)p+1)));
-    return v;
-}
-
-#define AV_RB16 AV_RB16
-static av_always_inline uint16_t AV_RB16(const void *p)
-{
-    uint16_t v;
-    __asm__ ("ld.ub    %0,   %2  \n\t"
-             "ldins.b  %0:l, %1  \n\t"
-             : "=&r"(v)
-             : "RKs12"(*(const uint8_t*)p), "m"(*((const uint8_t*)p+1)));
-    return v;
-}
-
-#define AV_RB24 AV_RB24
-static av_always_inline uint32_t AV_RB24(const void *p)
-{
-    uint32_t v;
-    __asm__ ("ld.ub    %0,   %3  \n\t"
-             "ldins.b  %0:l, %2  \n\t"
-             "ldins.b  %0:u, %1  \n\t"
-             : "=&r"(v)
-             : "RKs12"(* (const uint8_t*)p),
-               "RKs12"(*((const uint8_t*)p+1)),
-               "m"    (*((const uint8_t*)p+2)));
-    return v;
-}
-
-#define AV_RL24 AV_RL24
-static av_always_inline uint32_t AV_RL24(const void *p)
-{
-    uint32_t v;
-    __asm__ ("ld.ub    %0,   %1  \n\t"
-             "ldins.b  %0:l, %2  \n\t"
-             "ldins.b  %0:u, %3  \n\t"
-             : "=&r"(v)
-             : "m"    (* (const uint8_t*)p),
-               "RKs12"(*((const uint8_t*)p+1)),
-               "RKs12"(*((const uint8_t*)p+2)));
-    return v;
-}
-
-#if ARCH_AVR32_AP
-
-#define AV_RB32 AV_RB32
-static av_always_inline uint32_t AV_RB32(const void *p)
-{
-    uint32_t v;
-    __asm__ ("ld.w %0, %1" : "=r"(v) : "m"(*(const uint32_t*)p));
-    return v;
-}
-
-#define AV_WB32 AV_WB32
-static av_always_inline void AV_WB32(void *p, uint32_t v)
-{
-    __asm__ ("st.w %0, %1" : "=m"(*(uint32_t*)p) : "r"(v));
-}
-
-/* These two would be defined by generic code, but we need them sooner. */
-#define AV_RL32(p)    av_bswap32(AV_RB32(p))
-#define AV_WL32(p, v) AV_WB32(p, av_bswap32(v))
-
-#define AV_WB64 AV_WB64
-static av_always_inline void AV_WB64(void *p, uint64_t v)
-{
-    union { uint64_t v; uint32_t hl[2]; } vv = { v };
-    AV_WB32(p, vv.hl[0]);
-    AV_WB32((uint32_t*)p+1, vv.hl[1]);
-}
-
-#define AV_WL64 AV_WL64
-static av_always_inline void AV_WL64(void *p, uint64_t v)
-{
-    union { uint64_t v; uint32_t hl[2]; } vv = { v };
-    AV_WL32(p, vv.hl[1]);
-    AV_WL32((uint32_t*)p+1, vv.hl[0]);
-}
-
-#else /* ARCH_AVR32_AP */
-
-#define AV_RB32 AV_RB32
-static av_always_inline uint32_t AV_RB32(const void *p)
-{
-    uint32_t v;
-    __asm__ ("ld.ub    %0,   %4  \n\t"
-             "ldins.b  %0:l, %3  \n\t"
-             "ldins.b  %0:u, %2  \n\t"
-             "ldins.b  %0:t, %1  \n\t"
-             : "=&r"(v)
-             : "RKs12"(* (const uint8_t*)p),
-               "RKs12"(*((const uint8_t*)p+1)),
-               "RKs12"(*((const uint8_t*)p+2)),
-               "m"    (*((const uint8_t*)p+3)));
-    return v;
-}
-
-#define AV_RL32 AV_RL32
-static av_always_inline uint32_t AV_RL32(const void *p)
-{
-    uint32_t v;
-    __asm__ ("ld.ub    %0,   %1  \n\t"
-             "ldins.b  %0:l, %2  \n\t"
-             "ldins.b  %0:u, %3  \n\t"
-             "ldins.b  %0:t, %4  \n\t"
-             : "=&r"(v)
-             : "m"    (* (const uint8_t*)p),
-               "RKs12"(*((const uint8_t*)p+1)),
-               "RKs12"(*((const uint8_t*)p+2)),
-               "RKs12"(*((const uint8_t*)p+3)));
-    return v;
-}
-
-#endif /* ARCH_AVR32_AP */
-
-#define AV_RB64 AV_RB64
-static av_always_inline uint64_t AV_RB64(const void *p)
-{
-    union { uint64_t v; uint32_t hl[2]; } v;
-    v.hl[0] = AV_RB32(p);
-    v.hl[1] = AV_RB32((const uint32_t*)p+1);
-    return v.v;
-}
-
-#define AV_RL64 AV_RL64
-static av_always_inline uint64_t AV_RL64(const void *p)
-{
-    union { uint64_t v; uint32_t hl[2]; } v;
-    v.hl[1] = AV_RL32(p);
-    v.hl[0] = AV_RL32((const uint32_t*)p+1);
-    return v.v;
-}
-
-#endif /* AVUTIL_AVR32_INTREADWRITE_H */
diff --git a/deps/libav/libavutil/avstring.c b/deps/libav/libavutil/avstring.c
deleted file mode 100644
index 3ea7be0..0000000
--- a/deps/libav/libavutil/avstring.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2007 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "config.h"
-#include "common.h"
-#include "mem.h"
-#include "avstring.h"
-
-int av_strstart(const char *str, const char *pfx, const char **ptr)
-{
-    while (*pfx && *pfx == *str) {
-        pfx++;
-        str++;
-    }
-    if (!*pfx && ptr)
-        *ptr = str;
-    return !*pfx;
-}
-
-int av_stristart(const char *str, const char *pfx, const char **ptr)
-{
-    while (*pfx && av_toupper((unsigned)*pfx) == av_toupper((unsigned)*str)) {
-        pfx++;
-        str++;
-    }
-    if (!*pfx && ptr)
-        *ptr = str;
-    return !*pfx;
-}
-
-char *av_stristr(const char *s1, const char *s2)
-{
-    if (!*s2)
-        return s1;
-
-    do
-        if (av_stristart(s1, s2, NULL))
-            return s1;
-    while (*s1++);
-
-    return NULL;
-}
-
-char *av_strnstr(const char *haystack, const char *needle, size_t hay_length)
-{
-    size_t needle_len = strlen(needle);
-    if (!needle_len)
-        return haystack;
-    while (hay_length >= needle_len) {
-        hay_length--;
-        if (!memcmp(haystack, needle, needle_len))
-            return haystack;
-        haystack++;
-    }
-    return NULL;
-}
-
-size_t av_strlcpy(char *dst, const char *src, size_t size)
-{
-    size_t len = 0;
-    while (++len < size && *src)
-        *dst++ = *src++;
-    if (len <= size)
-        *dst = 0;
-    return len + strlen(src) - 1;
-}
-
-size_t av_strlcat(char *dst, const char *src, size_t size)
-{
-    size_t len = strlen(dst);
-    if (size <= len + 1)
-        return len + strlen(src);
-    return len + av_strlcpy(dst + len, src, size - len);
-}
-
-size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
-{
-    int len = strlen(dst);
-    va_list vl;
-
-    va_start(vl, fmt);
-    len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
-    va_end(vl);
-
-    return len;
-}
-
-char *av_d2str(double d)
-{
-    char *str = av_malloc(16);
-    if (str)
-        snprintf(str, 16, "%f", d);
-    return str;
-}
-
-#define WHITESPACES " \n\t"
-
-char *av_get_token(const char **buf, const char *term)
-{
-    char *out     = av_malloc(strlen(*buf) + 1);
-    char *ret     = out, *end = out;
-    const char *p = *buf;
-    if (!out)
-        return NULL;
-    p += strspn(p, WHITESPACES);
-
-    while (*p && !strspn(p, term)) {
-        char c = *p++;
-        if (c == '\\' && *p) {
-            *out++ = *p++;
-            end    = out;
-        } else if (c == '\'') {
-            while (*p && *p != '\'')
-                *out++ = *p++;
-            if (*p) {
-                p++;
-                end = out;
-            }
-        } else {
-            *out++ = c;
-        }
-    }
-
-    do
-        *out-- = 0;
-    while (out >= end && strspn(out, WHITESPACES));
-
-    *buf = p;
-
-    return ret;
-}
-
-int av_strcasecmp(const char *a, const char *b)
-{
-    uint8_t c1, c2;
-    do {
-        c1 = av_tolower(*a++);
-        c2 = av_tolower(*b++);
-    } while (c1 && c1 == c2);
-    return c1 - c2;
-}
-
-int av_strncasecmp(const char *a, const char *b, size_t n)
-{
-    const char *end = a + n;
-    uint8_t c1, c2;
-    do {
-        c1 = av_tolower(*a++);
-        c2 = av_tolower(*b++);
-    } while (a < end && c1 && c1 == c2);
-    return c1 - c2;
-}
-
-const char *av_basename(const char *path)
-{
-    char *p = strrchr(path, '/');
-
-#if HAVE_DOS_PATHS
-    char *q = strrchr(path, '\\');
-    char *d = strchr(path, ':');
-
-    p = FFMAX3(p, q, d);
-#endif
-
-    if (!p)
-        return path;
-
-    return p + 1;
-}
-
-const char *av_dirname(char *path)
-{
-    char *p = strrchr(path, '/');
-
-#if HAVE_DOS_PATHS
-    char *q = strrchr(path, '\\');
-    char *d = strchr(path, ':');
-
-    d = d ? d + 1 : d;
-
-    p = FFMAX3(p, q, d);
-#endif
-
-    if (!p)
-        return ".";
-
-    *p = '\0';
-
-    return path;
-}
-
-int av_isdigit(int c)
-{
-    return c >= '0' && c <= '9';
-}
-
-int av_isgraph(int c)
-{
-    return c > 32 && c < 127;
-}
-
-int av_isspace(int c)
-{
-    return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' ||
-           c == '\v';
-}
-
-int av_isxdigit(int c)
-{
-    c = av_tolower(c);
-    return av_isdigit(c) || (c >= 'a' && c <= 'f');
-}
-
-#ifdef TEST
-
-int main(void)
-{
-    int i;
-    const char *strings[] = {
-        "''",
-        "",
-        ":",
-        "\\",
-        "'",
-        "    ''    :",
-        "    ''  ''  :",
-        "foo   '' :",
-        "'foo'",
-        "foo     ",
-        "  '  foo  '  ",
-        "foo\\",
-        "foo':  blah:blah",
-        "foo\\:  blah:blah",
-        "foo\'",
-        "'foo :  '  :blahblah",
-        "\\ :blah",
-        "     foo",
-        "      foo       ",
-        "      foo     \\ ",
-        "foo ':blah",
-        " foo   bar    :   blahblah",
-        "\\f\\o\\o",
-        "'foo : \\ \\  '   : blahblah",
-        "'\\fo\\o:': blahblah",
-        "\\'fo\\o\\:':  foo  '  :blahblah"
-    };
-
-    printf("Testing av_get_token()\n");
-    for (i = 0; i < FF_ARRAY_ELEMS(strings); i++) {
-        const char *p = strings[i];
-        char *q;
-        printf("|%s|", p);
-        q = av_get_token(&p, ":");
-        printf(" -> |%s|", q);
-        printf(" + |%s|\n", p);
-        av_free(q);
-    }
-
-    return 0;
-}
-
-#endif /* TEST */
diff --git a/deps/libav/libavutil/avstring.h b/deps/libav/libavutil/avstring.h
deleted file mode 100644
index b7d1098..0000000
--- a/deps/libav/libavutil/avstring.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2007 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AVSTRING_H
-#define AVUTIL_AVSTRING_H
-
-#include <stddef.h>
-#include "attributes.h"
-
-/**
- * @addtogroup lavu_string
- * @{
- */
-
-/**
- * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
- * the address of the first character in str after the prefix.
- *
- * @param str input string
- * @param pfx prefix to test
- * @param ptr updated if the prefix is matched inside str
- * @return non-zero if the prefix matches, zero otherwise
- */
-int av_strstart(const char *str, const char *pfx, const char **ptr);
-
-/**
- * Return non-zero if pfx is a prefix of str independent of case. If
- * it is, *ptr is set to the address of the first character in str
- * after the prefix.
- *
- * @param str input string
- * @param pfx prefix to test
- * @param ptr updated if the prefix is matched inside str
- * @return non-zero if the prefix matches, zero otherwise
- */
-int av_stristart(const char *str, const char *pfx, const char **ptr);
-
-/**
- * Locate the first case-independent occurrence in the string haystack
- * of the string needle.  A zero-length string needle is considered to
- * match at the start of haystack.
- *
- * This function is a case-insensitive version of the standard strstr().
- *
- * @param haystack string to search in
- * @param needle   string to search for
- * @return         pointer to the located match within haystack
- *                 or a null pointer if no match
- */
-char *av_stristr(const char *haystack, const char *needle);
-
-/**
- * Locate the first occurrence of the string needle in the string haystack
- * where not more than hay_length characters are searched. A zero-length
- * string needle is considered to match at the start of haystack.
- *
- * This function is a length-limited version of the standard strstr().
- *
- * @param haystack   string to search in
- * @param needle     string to search for
- * @param hay_length length of string to search in
- * @return           pointer to the located match within haystack
- *                   or a null pointer if no match
- */
-char *av_strnstr(const char *haystack, const char *needle, size_t hay_length);
-
-/**
- * Copy the string src to dst, but no more than size - 1 bytes, and
- * null-terminate dst.
- *
- * This function is the same as BSD strlcpy().
- *
- * @param dst destination buffer
- * @param src source string
- * @param size size of destination buffer
- * @return the length of src
- *
- * @warning since the return value is the length of src, src absolutely
- * _must_ be a properly 0-terminated string, otherwise this will read beyond
- * the end of the buffer and possibly crash.
- */
-size_t av_strlcpy(char *dst, const char *src, size_t size);
-
-/**
- * Append the string src to the string dst, but to a total length of
- * no more than size - 1 bytes, and null-terminate dst.
- *
- * This function is similar to BSD strlcat(), but differs when
- * size <= strlen(dst).
- *
- * @param dst destination buffer
- * @param src source string
- * @param size size of destination buffer
- * @return the total length of src and dst
- *
- * @warning since the return value use the length of src and dst, these
- * absolutely _must_ be a properly 0-terminated strings, otherwise this
- * will read beyond the end of the buffer and possibly crash.
- */
-size_t av_strlcat(char *dst, const char *src, size_t size);
-
-/**
- * Append output to a string, according to a format. Never write out of
- * the destination buffer, and always put a terminating 0 within
- * the buffer.
- * @param dst destination buffer (string to which the output is
- *  appended)
- * @param size total size of the destination buffer
- * @param fmt printf-compatible format string, specifying how the
- *  following parameters are used
- * @return the length of the string that would have been generated
- *  if enough space had been available
- */
-size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
-
-/**
- * Convert a number to a av_malloced string.
- */
-char *av_d2str(double d);
-
-/**
- * Unescape the given string until a non escaped terminating char,
- * and return the token corresponding to the unescaped string.
- *
- * The normal \ and ' escaping is supported. Leading and trailing
- * whitespaces are removed, unless they are escaped with '\' or are
- * enclosed between ''.
- *
- * @param buf the buffer to parse, buf will be updated to point to the
- * terminating char
- * @param term a 0-terminated list of terminating chars
- * @return the malloced unescaped string, which must be av_freed by
- * the user, NULL in case of allocation failure
- */
-char *av_get_token(const char **buf, const char *term);
-
-/**
- * Locale-independent conversion of ASCII isdigit.
- */
-int av_isdigit(int c);
-
-/**
- * Locale-independent conversion of ASCII isgraph.
- */
-int av_isgraph(int c);
-
-/**
- * Locale-independent conversion of ASCII isspace.
- */
-int av_isspace(int c);
-
-/**
- * Locale-independent conversion of ASCII characters to uppercase.
- */
-static inline int av_toupper(int c)
-{
-    if (c >= 'a' && c <= 'z')
-        c ^= 0x20;
-    return c;
-}
-
-/**
- * Locale-independent conversion of ASCII characters to lowercase.
- */
-static inline int av_tolower(int c)
-{
-    if (c >= 'A' && c <= 'Z')
-        c ^= 0x20;
-    return c;
-}
-
-/**
- * Locale-independent conversion of ASCII isxdigit.
- */
-int av_isxdigit(int c);
-
-/*
- * Locale-independent case-insensitive compare.
- * @note This means only ASCII-range characters are case-insensitive
- */
-int av_strcasecmp(const char *a, const char *b);
-
-/**
- * Locale-independent case-insensitive compare.
- * @note This means only ASCII-range characters are case-insensitive
- */
-int av_strncasecmp(const char *a, const char *b, size_t n);
-
-
-/**
- * Thread safe basename.
- * @param path the path, on DOS both \ and / are considered separators.
- * @return pointer to the basename substring.
- */
-const char *av_basename(const char *path);
-
-/**
- * Thread safe dirname.
- * @param path the path, on DOS both \ and / are considered separators.
- * @return the path with the separator replaced by the string terminator or ".".
- * @note the function may change the input string.
- */
-const char *av_dirname(char *path);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_AVSTRING_H */
diff --git a/deps/libav/libavutil/avutil.h b/deps/libav/libavutil/avutil.h
deleted file mode 100644
index a0d35d1..0000000
--- a/deps/libav/libavutil/avutil.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AVUTIL_H
-#define AVUTIL_AVUTIL_H
-
-/**
- * @file
- * external API header
- */
-
-/**
- * @mainpage
- *
- * @section libav_intro Introduction
- *
- * This document describes the usage of the different libraries
- * provided by Libav.
- *
- * @li @ref libavc "libavcodec" encoding/decoding library
- * @li @ref lavfi "libavfilter" graph-based frame editing library
- * @li @ref libavf "libavformat" I/O and muxing/demuxing library
- * @li @ref lavd "libavdevice" special devices muxing/demuxing library
- * @li @ref lavu "libavutil" common utility library
- * @li @ref lavr "libavresample" audio resampling, format conversion and mixing
- * @li @ref libsws "libswscale"  color conversion and scaling library
- *
- * @section libav_versioning Versioning and compatibility
- *
- * Each of the Libav libraries contains a version.h header, which defines a
- * major, minor and micro version number with the
- * <em>LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO}</em> macros. The major version
- * number is incremented with backward incompatible changes - e.g. removing
- * parts of the public API, reordering public struct members, etc. The minor
- * version number is incremented for backward compatible API changes or major
- * new features - e.g. adding a new public function or a new decoder. The micro
- * version number is incremented for smaller changes that a calling program
- * might still want to check for - e.g. changing behavior in a previously
- * unspecified situation.
- *
- * Libav guarantees backward API and ABI compatibility for each library as long
- * as its major version number is unchanged. This means that no public symbols
- * will be removed or renamed. Types and names of the public struct members and
- * values of public macros and enums will remain the same (unless they were
- * explicitly declared as not part of the public API). Documented behavior will
- * not change.
- *
- * In other words, any correct program that works with a given Libav snapshot
- * should work just as well without any changes with any later snapshot with the
- * same major versions. This applies to both rebuilding the program against new
- * Libav versions or to replacing the dynamic Libav libraries that a program
- * links against.
- *
- * However, new public symbols may be added and new members may be appended to
- * public structs whose size is not part of public ABI (most public structs in
- * Libav). New macros and enum values may be added. Behavior in undocumented
- * situations may change slightly (and be documented). All those are accompanied
- * by an entry in doc/APIchanges and incrementing either the minor or micro
- * version number.
- */
-
-/**
- * @defgroup lavu Common utility functions
- *
- * @brief
- * libavutil contains the code shared across all the other Libav
- * libraries
- *
- * @note In order to use the functions provided by avutil you must include
- * the specific header.
- *
- * @{
- *
- * @defgroup lavu_crypto Crypto and Hashing
- *
- * @{
- * @}
- *
- * @defgroup lavu_math Maths
- * @{
- *
- * @}
- *
- * @defgroup lavu_string String Manipulation
- *
- * @{
- *
- * @}
- *
- * @defgroup lavu_mem Memory Management
- *
- * @{
- *
- * @}
- *
- * @defgroup lavu_data Data Structures
- * @{
- *
- * @}
- *
- * @defgroup lavu_audio Audio related
- *
- * @{
- *
- * @}
- *
- * @defgroup lavu_error Error Codes
- *
- * @{
- *
- * @}
- *
- * @defgroup lavu_log Logging Facility
- *
- * @{
- *
- * @}
- *
- * @defgroup lavu_misc Other
- *
- * @{
- *
- * @defgroup lavu_internal Internal
- *
- * Not exported functions, for internal usage only
- *
- * @{
- *
- * @}
- *
- * @defgroup preproc_misc Preprocessor String Macros
- *
- * @{
- *
- * @}
- */
-
-
-/**
- * @addtogroup lavu_ver
- * @{
- */
-
-/**
- * Return the LIBAVUTIL_VERSION_INT constant.
- */
-unsigned avutil_version(void);
-
-/**
- * Return the libavutil build-time configuration.
- */
-const char *avutil_configuration(void);
-
-/**
- * Return the libavutil license.
- */
-const char *avutil_license(void);
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavu_media Media Type
- * @brief Media Type
- */
-
-enum AVMediaType {
-    AVMEDIA_TYPE_UNKNOWN = -1,  ///< Usually treated as AVMEDIA_TYPE_DATA
-    AVMEDIA_TYPE_VIDEO,
-    AVMEDIA_TYPE_AUDIO,
-    AVMEDIA_TYPE_DATA,          ///< Opaque data information usually continuous
-    AVMEDIA_TYPE_SUBTITLE,
-    AVMEDIA_TYPE_ATTACHMENT,    ///< Opaque data information usually sparse
-    AVMEDIA_TYPE_NB
-};
-
-/**
- * @defgroup lavu_const Constants
- * @{
- *
- * @defgroup lavu_enc Encoding specific
- *
- * @note those definition should move to avcodec
- * @{
- */
-
-#define FF_LAMBDA_SHIFT 7
-#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
-#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
-#define FF_LAMBDA_MAX (256*128-1)
-
-#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
-
-/**
- * @}
- * @defgroup lavu_time Timestamp specific
- *
- * Libav internal timebase and timestamp definitions
- *
- * @{
- */
-
-/**
- * @brief Undefined timestamp value
- *
- * Usually reported by demuxer that work on containers that do not provide
- * either pts or dts.
- */
-
-#define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
-
-/**
- * Internal time base represented as integer
- */
-
-#define AV_TIME_BASE            1000000
-
-/**
- * Internal time base represented as fractional value
- */
-
-#define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
-
-/**
- * @}
- * @}
- * @defgroup lavu_picture Image related
- *
- * AVPicture types, pixel formats and basic image planes manipulation.
- *
- * @{
- */
-
-enum AVPictureType {
-    AV_PICTURE_TYPE_I = 1, ///< Intra
-    AV_PICTURE_TYPE_P,     ///< Predicted
-    AV_PICTURE_TYPE_B,     ///< Bi-dir predicted
-    AV_PICTURE_TYPE_S,     ///< S(GMC)-VOP MPEG4
-    AV_PICTURE_TYPE_SI,    ///< Switching Intra
-    AV_PICTURE_TYPE_SP,    ///< Switching Predicted
-    AV_PICTURE_TYPE_BI,    ///< BI type
-};
-
-/**
- * Return a single letter to describe the given picture type
- * pict_type.
- *
- * @param[in] pict_type the picture type @return a single character
- * representing the picture type, '?' if pict_type is unknown
- */
-char av_get_picture_type_char(enum AVPictureType pict_type);
-
-/**
- * @}
- */
-
-#include "error.h"
-#include "version.h"
-#include "macros.h"
-
-/**
- * @}
- * @}
- */
-
-#endif /* AVUTIL_AVUTIL_H */
diff --git a/deps/libav/libavutil/base64.c b/deps/libav/libavutil/base64.c
deleted file mode 100644
index 725b035..0000000
--- a/deps/libav/libavutil/base64.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2006 Ryan Martell. (rdm4 at martellventures.com)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @brief Base64 encode/decode
- * @author Ryan Martell <rdm4 at martellventures.com> (with lots of Michael)
- */
-
-#include "common.h"
-#include "base64.h"
-
-/* ---------------- private code */
-static const uint8_t map2[] =
-{
-    0x3e, 0xff, 0xff, 0xff, 0x3f, 0x34, 0x35, 0x36,
-    0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0xff,
-    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01,
-    0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
-    0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
-    0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
-    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x1b,
-    0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
-    0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
-    0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33
-};
-
-int av_base64_decode(uint8_t *out, const char *in, int out_size)
-{
-    int i;
-    unsigned v = 0;
-    uint8_t *dst = out;
-
-    for (i = 0; in[i] && in[i] != '='; i++) {
-        unsigned int index= in[i]-43;
-        if (index>=FF_ARRAY_ELEMS(map2) || map2[index] == 0xff)
-            return -1;
-        v = (v << 6) + map2[index];
-        if (i & 3) {
-            if (dst - out < out_size) {
-                *dst++ = v >> (6 - 2 * (i & 3));
-            }
-        }
-    }
-
-    return dst - out;
-}
-
-/*****************************************************************************
-* b64_encode: Stolen from VLC's http.c.
-* Simplified by Michael.
-* Fixed edge cases and made it work from data (vs. strings) by Ryan.
-*****************************************************************************/
-
-char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size)
-{
-    static const char b64[] =
-        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-    char *ret, *dst;
-    unsigned i_bits = 0;
-    int i_shift = 0;
-    int bytes_remaining = in_size;
-
-    if (in_size >= UINT_MAX / 4 ||
-        out_size < AV_BASE64_SIZE(in_size))
-        return NULL;
-    ret = dst = out;
-    while (bytes_remaining) {
-        i_bits = (i_bits << 8) + *in++;
-        bytes_remaining--;
-        i_shift += 8;
-
-        do {
-            *dst++ = b64[(i_bits << 6 >> i_shift) & 0x3f];
-            i_shift -= 6;
-        } while (i_shift > 6 || (bytes_remaining == 0 && i_shift > 0));
-    }
-    while ((dst - ret) & 3)
-        *dst++ = '=';
-    *dst = '\0';
-
-    return ret;
-}
-
-#ifdef TEST
-
-#define MAX_DATA_SIZE    1024
-#define MAX_ENCODED_SIZE 2048
-
-static int test_encode_decode(const uint8_t *data, unsigned int data_size,
-                              const char *encoded_ref)
-{
-    char  encoded[MAX_ENCODED_SIZE];
-    uint8_t data2[MAX_DATA_SIZE];
-    int data2_size, max_data2_size = MAX_DATA_SIZE;
-
-    if (!av_base64_encode(encoded, MAX_ENCODED_SIZE, data, data_size)) {
-        printf("Failed: cannot encode the input data\n");
-        return 1;
-    }
-    if (encoded_ref && strcmp(encoded, encoded_ref)) {
-        printf("Failed: encoded string differs from reference\n"
-               "Encoded:\n%s\nReference:\n%s\n", encoded, encoded_ref);
-        return 1;
-    }
-
-    if ((data2_size = av_base64_decode(data2, encoded, max_data2_size)) < 0) {
-        printf("Failed: cannot decode the encoded string\n"
-               "Encoded:\n%s\n", encoded);
-        return 1;
-    }
-    if (memcmp(data2, data, data_size)) {
-        printf("Failed: encoded/decoded data differs from original data\n");
-        return 1;
-    }
-
-    printf("Passed!\n");
-    return 0;
-}
-
-int main(void)
-{
-    int i, error_count = 0;
-    struct test {
-        const uint8_t *data;
-        const char *encoded_ref;
-    } tests[] = {
-        { "",        ""},
-        { "1",       "MQ=="},
-        { "22",      "MjI="},
-        { "333",     "MzMz"},
-        { "4444",    "NDQ0NA=="},
-        { "55555",   "NTU1NTU="},
-        { "666666",  "NjY2NjY2"},
-        { "abc:def", "YWJjOmRlZg=="},
-    };
-
-    printf("Encoding/decoding tests\n");
-    for (i = 0; i < FF_ARRAY_ELEMS(tests); i++)
-        error_count += test_encode_decode(tests[i].data, strlen(tests[i].data), tests[i].encoded_ref);
-
-    if (error_count)
-        printf("Error Count: %d.\n", error_count);
-
-    return !!error_count;
-}
-
-#endif
diff --git a/deps/libav/libavutil/base64.h b/deps/libav/libavutil/base64.h
deleted file mode 100644
index 4750cf5..0000000
--- a/deps/libav/libavutil/base64.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2006 Ryan Martell. (rdm4 at martellventures.com)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_BASE64_H
-#define AVUTIL_BASE64_H
-
-#include <stdint.h>
-
-/**
- * @defgroup lavu_base64 Base64
- * @ingroup lavu_crypto
- * @{
- */
-
-
-/**
- * Decode a base64-encoded string.
- *
- * @param out      buffer for decoded data
- * @param in       null-terminated input string
- * @param out_size size in bytes of the out buffer, must be at
- *                 least 3/4 of the length of in
- * @return         number of bytes written, or a negative value in case of
- *                 invalid input
- */
-int av_base64_decode(uint8_t *out, const char *in, int out_size);
-
-/**
- * Encode data to base64 and null-terminate.
- *
- * @param out      buffer for encoded data
- * @param out_size size in bytes of the output buffer, must be at
- *                 least AV_BASE64_SIZE(in_size)
- * @param in_size  size in bytes of the 'in' buffer
- * @return         'out' or NULL in case of error
- */
-char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
-
-/**
- * Calculate the output size needed to base64-encode x bytes.
- */
-#define AV_BASE64_SIZE(x)  (((x)+2) / 3 * 4 + 1)
-
- /**
-  * @}
-  */
-
-#endif /* AVUTIL_BASE64_H */
diff --git a/deps/libav/libavutil/bfin/bswap.h b/deps/libav/libavutil/bfin/bswap.h
deleted file mode 100644
index 2837a2f..0000000
--- a/deps/libav/libavutil/bfin/bswap.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2007 Marc Hoffman
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * byte swapping routines
- */
-
-#ifndef AVUTIL_BFIN_BSWAP_H
-#define AVUTIL_BFIN_BSWAP_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#define av_bswap32 av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-    unsigned tmp;
-    __asm__("%1 = %0 >> 8 (V);      \n\t"
-            "%0 = %0 << 8 (V);      \n\t"
-            "%0 = %0 | %1;          \n\t"
-            "%0 = PACK(%0.L, %0.H); \n\t"
-            : "+d"(x), "=&d"(tmp));
-    return x;
-}
-
-#endif /* AVUTIL_BFIN_BSWAP_H */
diff --git a/deps/libav/libavutil/bfin/timer.h b/deps/libav/libavutil/bfin/timer.h
deleted file mode 100644
index 49d32a8..0000000
--- a/deps/libav/libavutil/bfin/timer.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2007 Marc Hoffman
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_BFIN_TIMER_H
-#define AVUTIL_BFIN_TIMER_H
-
-#include <stdint.h>
-
-#define AV_READ_TIME read_time
-
-static inline uint64_t read_time(void)
-{
-    union {
-        struct {
-            unsigned lo;
-            unsigned hi;
-        } p;
-        unsigned long long c;
-    } t;
-    __asm__ volatile ("%0=cycles; %1=cycles2;" : "=d" (t.p.lo), "=d" (t.p.hi));
-    return t.c;
-}
-
-#endif /* AVUTIL_BFIN_TIMER_H */
diff --git a/deps/libav/libavutil/blowfish.c b/deps/libav/libavutil/blowfish.c
deleted file mode 100644
index 8437dd6..0000000
--- a/deps/libav/libavutil/blowfish.c
+++ /dev/null
@@ -1,596 +0,0 @@
-/*
- * Blowfish algorithm
- * Copyright (c) 2012 Samuel Pitoiset
- *
- * loosely based on Paul Kocher's implementation
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avutil.h"
-#include "common.h"
-#include "intreadwrite.h"
-#include "blowfish.h"
-
-static const uint32_t orig_p[AV_BF_ROUNDS + 2] = {
-    0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,
-    0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,
-    0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C,
-    0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917,
-    0x9216D5D9, 0x8979FB1B
-};
-
-static const uint32_t orig_s[4][256] = {
-    { 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7,
-      0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99,
-      0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16,
-      0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E,
-      0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE,
-      0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013,
-      0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF,
-      0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E,
-      0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60,
-      0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440,
-      0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE,
-      0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A,
-      0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E,
-      0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677,
-      0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193,
-      0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032,
-      0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88,
-      0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239,
-      0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E,
-      0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0,
-      0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3,
-      0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98,
-      0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88,
-      0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE,
-      0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6,
-      0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D,
-      0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B,
-      0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7,
-      0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA,
-      0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463,
-      0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F,
-      0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09,
-      0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3,
-      0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB,
-      0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279,
-      0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8,
-      0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB,
-      0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82,
-      0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB,
-      0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573,
-      0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0,
-      0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B,
-      0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790,
-      0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8,
-      0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4,
-      0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0,
-      0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7,
-      0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C,
-      0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD,
-      0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1,
-      0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299,
-      0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9,
-      0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477,
-      0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF,
-      0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49,
-      0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF,
-      0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA,
-      0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5,
-      0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41,
-      0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915,
-      0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400,
-      0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915,
-      0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664,
-      0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A },
-    { 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623,
-      0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266,
-      0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1,
-      0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E,
-      0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6,
-      0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1,
-      0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E,
-      0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1,
-      0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737,
-      0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8,
-      0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF,
-      0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD,
-      0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701,
-      0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7,
-      0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41,
-      0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331,
-      0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF,
-      0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF,
-      0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E,
-      0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87,
-      0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C,
-      0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2,
-      0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16,
-      0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD,
-      0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B,
-      0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509,
-      0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E,
-      0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3,
-      0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F,
-      0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A,
-      0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4,
-      0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960,
-      0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66,
-      0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28,
-      0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802,
-      0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84,
-      0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510,
-      0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF,
-      0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14,
-      0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E,
-      0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50,
-      0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7,
-      0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8,
-      0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281,
-      0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99,
-      0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696,
-      0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128,
-      0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73,
-      0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0,
-      0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0,
-      0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105,
-      0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250,
-      0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3,
-      0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285,
-      0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00,
-      0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061,
-      0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB,
-      0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E,
-      0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735,
-      0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC,
-      0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9,
-      0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340,
-      0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20,
-      0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 },
-    { 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934,
-      0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068,
-      0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF,
-      0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840,
-      0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45,
-      0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504,
-      0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A,
-      0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB,
-      0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE,
-      0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6,
-      0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42,
-      0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B,
-      0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2,
-      0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB,
-      0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527,
-      0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B,
-      0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33,
-      0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C,
-      0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3,
-      0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC,
-      0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17,
-      0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564,
-      0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B,
-      0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115,
-      0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922,
-      0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728,
-      0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0,
-      0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E,
-      0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37,
-      0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D,
-      0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804,
-      0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B,
-      0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3,
-      0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB,
-      0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D,
-      0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C,
-      0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350,
-      0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9,
-      0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A,
-      0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE,
-      0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D,
-      0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC,
-      0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F,
-      0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61,
-      0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2,
-      0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9,
-      0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2,
-      0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C,
-      0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E,
-      0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633,
-      0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10,
-      0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169,
-      0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52,
-      0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027,
-      0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5,
-      0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62,
-      0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634,
-      0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76,
-      0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24,
-      0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC,
-      0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4,
-      0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C,
-      0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837,
-      0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 },
-    { 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B,
-      0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE,
-      0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B,
-      0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4,
-      0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8,
-      0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6,
-      0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304,
-      0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22,
-      0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4,
-      0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6,
-      0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9,
-      0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59,
-      0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593,
-      0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51,
-      0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28,
-      0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C,
-      0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B,
-      0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28,
-      0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C,
-      0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD,
-      0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A,
-      0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319,
-      0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB,
-      0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F,
-      0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991,
-      0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32,
-      0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680,
-      0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166,
-      0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE,
-      0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB,
-      0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5,
-      0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47,
-      0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370,
-      0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D,
-      0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84,
-      0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048,
-      0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8,
-      0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD,
-      0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9,
-      0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7,
-      0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38,
-      0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F,
-      0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C,
-      0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525,
-      0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1,
-      0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442,
-      0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964,
-      0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E,
-      0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8,
-      0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D,
-      0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F,
-      0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299,
-      0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02,
-      0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC,
-      0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614,
-      0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A,
-      0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6,
-      0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B,
-      0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0,
-      0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060,
-      0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E,
-      0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9,
-      0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F,
-      0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 }
-};
-
-static void F(AVBlowfish *ctx, uint32_t *xl, uint32_t *xr, int i)
-{
-    uint32_t Xl, Xr;
-    uint32_t y;
-
-    Xl = *xl;
-    Xr = *xr;
-
-    Xl ^= ctx->p[i];
-    y   = ctx->s[0][(Xl >> 24) & 0xFF];
-    y  += ctx->s[1][(Xl >> 16) & 0xFF];
-    y  ^= ctx->s[2][(Xl >>  8) & 0xFF];
-    y  += ctx->s[3][ Xl        & 0xFF];
-    Xr ^= y;
-
-    *xl = Xr;
-    *xr = Xl;
-}
-
-av_cold void av_blowfish_init(AVBlowfish *ctx, const uint8_t *key, int key_len)
-{
-    uint32_t data, data_l, data_r;
-    int i, j, k;
-
-    memcpy(ctx->s, orig_s, sizeof(orig_s));
-
-    j = 0;
-    for (i = 0; i < AV_BF_ROUNDS + 2; ++i) {
-        data = 0;
-        for (k = 0; k < 4; k++) {
-            data = (data << 8) | key[j];
-            if (++j >= key_len)
-                j = 0;
-        }
-        ctx->p[i] = orig_p[i] ^ data;
-    }
-
-    data_l = data_r = 0;
-
-    for (i = 0; i < AV_BF_ROUNDS + 2; i += 2) {
-        av_blowfish_crypt_ecb(ctx, &data_l, &data_r, 0);
-        ctx->p[i]     = data_l;
-        ctx->p[i + 1] = data_r;
-    }
-
-    for (i = 0; i < 4; ++i) {
-        for (j = 0; j < 256; j += 2) {
-            av_blowfish_crypt_ecb(ctx, &data_l, &data_r, 0);
-            ctx->s[i][j]     = data_l;
-            ctx->s[i][j + 1] = data_r;
-        }
-    }
-}
-
-void av_blowfish_crypt_ecb(AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
-                           int decrypt)
-{
-    uint32_t Xl, Xr;
-    int i;
-
-    Xl = *xl;
-    Xr = *xr;
-
-    if (decrypt) {
-        for (i = AV_BF_ROUNDS + 1; i > 1; --i)
-            F(ctx, &Xl, &Xr, i);
-
-        Xl = Xl ^ ctx->p[1];
-        Xr = Xr ^ ctx->p[0];
-    } else {
-        for (i = 0; i < AV_BF_ROUNDS; ++i)
-            F(ctx, &Xl, &Xr, i);
-
-        Xl = Xl ^ ctx->p[AV_BF_ROUNDS];
-        Xr = Xr ^ ctx->p[AV_BF_ROUNDS + 1];
-    }
-
-    *xl = Xr;
-    *xr = Xl;
-}
-
-void av_blowfish_crypt(AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
-                       int count, uint8_t *iv, int decrypt)
-{
-    uint32_t v0, v1;
-    int i;
-
-    if (decrypt) {
-        while (count--) {
-            v0 = AV_RB32(src);
-            v1 = AV_RB32(src + 4);
-
-            av_blowfish_crypt_ecb(ctx, &v0, &v1, decrypt);
-
-            if (iv) {
-                v0 ^= AV_RB32(iv);
-                v1 ^= AV_RB32(iv + 4);
-                memcpy(iv, src, 8);
-            }
-
-            AV_WB32(dst, v0);
-            AV_WB32(dst + 4, v1);
-
-            src   += 8;
-            dst   += 8;
-        }
-    } else {
-        while (count--) {
-            if (iv) {
-                for (i = 0; i < 8; i++)
-                    dst[i] = src[i] ^ iv[i];
-                v0 = AV_RB32(dst);
-                v1 = AV_RB32(dst + 4);
-            } else {
-                v0 = AV_RB32(src);
-                v1 = AV_RB32(src + 4);
-            }
-
-            av_blowfish_crypt_ecb(ctx, &v0, &v1, decrypt);
-
-            AV_WB32(dst, v0);
-            AV_WB32(dst + 4, v1);
-
-            if (iv)
-                memcpy(iv, dst, 8);
-
-            src   += 8;
-            dst   += 8;
-        }
-    }
-}
-
-#ifdef TEST
-#include <stdio.h>
-
-#define NUM_VARIABLE_KEY_TESTS 34
-
-/* plaintext bytes -- left halves */
-static const uint32_t plaintext_l[NUM_VARIABLE_KEY_TESTS] = {
-    0x00000000, 0xFFFFFFFF, 0x10000000, 0x11111111, 0x11111111,
-    0x01234567, 0x00000000, 0x01234567, 0x01A1D6D0, 0x5CD54CA8,
-    0x0248D438, 0x51454B58, 0x42FD4430, 0x059B5E08, 0x0756D8E0,
-    0x762514B8, 0x3BDD1190, 0x26955F68, 0x164D5E40, 0x6B056E18,
-    0x004BD6EF, 0x480D3900, 0x437540C8, 0x072D43A0, 0x02FE5577,
-    0x1D9D5C50, 0x30553228, 0x01234567, 0x01234567, 0x01234567,
-    0xFFFFFFFF, 0x00000000, 0x00000000, 0xFFFFFFFF
-};
-
-/* plaintext bytes -- right halves */
-static const uint32_t plaintext_r[NUM_VARIABLE_KEY_TESTS] = {
-    0x00000000, 0xFFFFFFFF, 0x00000001, 0x11111111, 0x11111111,
-    0x89ABCDEF, 0x00000000, 0x89ABCDEF, 0x39776742, 0x3DEF57DA,
-    0x06F67172, 0x2DDF440A, 0x59577FA2, 0x51CF143A, 0x774761D2,
-    0x29BF486A, 0x49372802, 0x35AF609A, 0x4F275232, 0x759F5CCA,
-    0x09176062, 0x6EE762F2, 0x698F3CFA, 0x77075292, 0x8117F12A,
-    0x18F728C2, 0x6D6F295A, 0x89ABCDEF, 0x89ABCDEF, 0x89ABCDEF,
-    0xFFFFFFFF, 0x00000000, 0x00000000, 0xFFFFFFFF
-};
-
-/* key bytes for variable key tests */
-static const uint8_t variable_key[NUM_VARIABLE_KEY_TESTS][8] = {
-    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-    { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
-    { 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-    { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 },
-    { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF },
-    { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 },
-    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-    { 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10 },
-    { 0x7C, 0xA1, 0x10, 0x45, 0x4A, 0x1A, 0x6E, 0x57 },
-    { 0x01, 0x31, 0xD9, 0x61, 0x9D, 0xC1, 0x37, 0x6E },
-    { 0x07, 0xA1, 0x13, 0x3E, 0x4A, 0x0B, 0x26, 0x86 },
-    { 0x38, 0x49, 0x67, 0x4C, 0x26, 0x02, 0x31, 0x9E },
-    { 0x04, 0xB9, 0x15, 0xBA, 0x43, 0xFE, 0xB5, 0xB6 },
-    { 0x01, 0x13, 0xB9, 0x70, 0xFD, 0x34, 0xF2, 0xCE },
-    { 0x01, 0x70, 0xF1, 0x75, 0x46, 0x8F, 0xB5, 0xE6 },
-    { 0x43, 0x29, 0x7F, 0xAD, 0x38, 0xE3, 0x73, 0xFE },
-    { 0x07, 0xA7, 0x13, 0x70, 0x45, 0xDA, 0x2A, 0x16 },
-    { 0x04, 0x68, 0x91, 0x04, 0xC2, 0xFD, 0x3B, 0x2F },
-    { 0x37, 0xD0, 0x6B, 0xB5, 0x16, 0xCB, 0x75, 0x46 },
-    { 0x1F, 0x08, 0x26, 0x0D, 0x1A, 0xC2, 0x46, 0x5E },
-    { 0x58, 0x40, 0x23, 0x64, 0x1A, 0xBA, 0x61, 0x76 },
-    { 0x02, 0x58, 0x16, 0x16, 0x46, 0x29, 0xB0, 0x07 },
-    { 0x49, 0x79, 0x3E, 0xBC, 0x79, 0xB3, 0x25, 0x8F },
-    { 0x4F, 0xB0, 0x5E, 0x15, 0x15, 0xAB, 0x73, 0xA7 },
-    { 0x49, 0xE9, 0x5D, 0x6D, 0x4C, 0xA2, 0x29, 0xBF },
-    { 0x01, 0x83, 0x10, 0xDC, 0x40, 0x9B, 0x26, 0xD6 },
-    { 0x1C, 0x58, 0x7F, 0x1C, 0x13, 0x92, 0x4F, 0xEF },
-    { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 },
-    { 0x1F, 0x1F, 0x1F, 0x1F, 0x0E, 0x0E, 0x0E, 0x0E },
-    { 0xE0, 0xFE, 0xE0, 0xFE, 0xF1, 0xFE, 0xF1, 0xFE },
-    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-    { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
-    { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF },
-    { 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10 }
-};
-
-/* ciphertext bytes -- left halves */
-static const uint32_t ciphertext_l[NUM_VARIABLE_KEY_TESTS] = {
-    0x4EF99745, 0x51866FD5, 0x7D856F9A, 0x2466DD87, 0x61F9C380,
-    0x7D0CC630, 0x4EF99745, 0x0ACEAB0F, 0x59C68245, 0xB1B8CC0B,
-    0x1730E577, 0xA25E7856, 0x353882B1, 0x48F4D088, 0x432193B7,
-    0x13F04154, 0x2EEDDA93, 0xD887E039, 0x5F99D04F, 0x4A057A3B,
-    0x452031C1, 0x7555AE39, 0x53C55F9C, 0x7A8E7BFA, 0xCF9C5D7A,
-    0xD1ABB290, 0x55CB3774, 0xFA34EC48, 0xA7907951, 0xC39E072D,
-    0x014933E0, 0xF21E9A77, 0x24594688, 0x6B5C5A9C
-};
-
-/* ciphertext bytes -- right halves */
-static const uint32_t ciphertext_r[NUM_VARIABLE_KEY_TESTS] = {
-    0x6198DD78, 0xB85ECB8A, 0x613063F2, 0x8B963C9D, 0x2281B096,
-    0xAFDA1EC7, 0x6198DD78, 0xC6A0A28D, 0xEB05282B, 0x250F09A0,
-    0x8BEA1DA4, 0xCF2651EB, 0x09CE8F1A, 0x4C379918, 0x8951FC98,
-    0xD69D1AE5, 0xFFD39C79, 0x3C2DA6E3, 0x5B163969, 0x24D3977B,
-    0xE4FADA8E, 0xF59B87BD, 0xB49FC019, 0x937E89A3, 0x4986ADB5,
-    0x658BC778, 0xD13EF201, 0x47B268B2, 0x08EA3CAE, 0x9FAC631D,
-    0xCDAFF6E4, 0xB71C49BC, 0x5754369A, 0x5D9E0A5A
-};
-
-/* plaintext bytes */
-static const uint8_t plaintext[8] = "BLOWFISH";
-
-static const uint8_t plaintext2[16] = "BLOWFISHBLOWFISH";
-
-/* ciphertext bytes */
-static const uint8_t ciphertext[8] = {
-    0x32, 0x4E, 0xD0, 0xFE, 0xF4, 0x13, 0xA2, 0x03
-};
-
-static const uint8_t ciphertext2[16] = {
-    0x53, 0x00, 0x40, 0x06, 0x63, 0xf2, 0x1d, 0x99,
-    0x3b, 0x9b, 0x27, 0x64, 0x46, 0xfd, 0x20, 0xc1,
-};
-
-#define IV "blowfish"
-
-static void test_blowfish(AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
-                          const uint8_t *ref, int len, uint8_t *iv, int dir,
-                          const char *test)
-{
-    av_blowfish_crypt(ctx, dst, src, len, iv, dir);
-    if (memcmp(dst, ref, 8*len)) {
-        int i;
-        printf("%s failed\ngot      ", test);
-        for (i = 0; i < 8*len; i++)
-            printf("%02x ", dst[i]);
-        printf("\nexpected ");
-        for (i = 0; i < 8*len; i++)
-            printf("%02x ", ref[i]);
-        printf("\n");
-        exit(1);
-    }
-}
-
-int main(void)
-{
-    AVBlowfish ctx;
-    uint32_t tmptext_l[NUM_VARIABLE_KEY_TESTS];
-    uint32_t tmptext_r[NUM_VARIABLE_KEY_TESTS];
-    uint8_t tmp[16], iv[8];
-    int i;
-
-    av_blowfish_init(&ctx, "abcdefghijklmnopqrstuvwxyz", 26);
-
-    test_blowfish(&ctx, tmp, plaintext, ciphertext, 1, NULL, 0, "encryption");
-    test_blowfish(&ctx, tmp, ciphertext, plaintext, 1, NULL, 1, "decryption");
-    test_blowfish(&ctx, tmp, tmp, ciphertext, 1, NULL, 0, "Inplace encryption");
-    test_blowfish(&ctx, tmp, tmp, plaintext,  1, NULL, 1, "Inplace decryption");
-    memcpy(iv, IV, 8);
-    test_blowfish(&ctx, tmp, plaintext2, ciphertext2, 2, iv, 0, "CBC encryption");
-    memcpy(iv, IV, 8);
-    test_blowfish(&ctx, tmp, ciphertext2, plaintext2, 2, iv, 1, "CBC decryption");
-    memcpy(iv, IV, 8);
-    test_blowfish(&ctx, tmp, tmp, ciphertext2, 2, iv, 0, "Inplace CBC encryption");
-    memcpy(iv, IV, 8);
-    test_blowfish(&ctx, tmp, tmp, plaintext2,  2, iv, 1, "Inplace CBC decryption");
-
-    memcpy(tmptext_l, plaintext_l, sizeof(*plaintext_l) * NUM_VARIABLE_KEY_TESTS);
-    memcpy(tmptext_r, plaintext_r, sizeof(*plaintext_r) * NUM_VARIABLE_KEY_TESTS);
-
-    for (i = 0; i < NUM_VARIABLE_KEY_TESTS; i++) {
-        av_blowfish_init(&ctx, variable_key[i], 8);
-
-        av_blowfish_crypt_ecb(&ctx, &tmptext_l[i], &tmptext_r[i], 0);
-        if (tmptext_l[i] != ciphertext_l[i] || tmptext_r[i] != ciphertext_r[i]) {
-            printf("Test encryption failed.\n");
-            return 1;
-        }
-
-        av_blowfish_crypt_ecb(&ctx, &tmptext_l[i], &tmptext_r[i], 1);
-        if (tmptext_l[i] != plaintext_l[i] || tmptext_r[i] != plaintext_r[i]) {
-            printf("Test decryption failed.\n");
-            return 1;
-        }
-    }
-    printf("Test encryption/decryption success.\n");
-
-    return 0;
-}
-
-#endif
diff --git a/deps/libav/libavutil/blowfish.h b/deps/libav/libavutil/blowfish.h
deleted file mode 100644
index 8c29536..0000000
--- a/deps/libav/libavutil/blowfish.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Blowfish algorithm
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_BLOWFISH_H
-#define AVUTIL_BLOWFISH_H
-
-#include <stdint.h>
-
-/**
- * @defgroup lavu_blowfish Blowfish
- * @ingroup lavu_crypto
- * @{
- */
-
-#define AV_BF_ROUNDS 16
-
-typedef struct AVBlowfish {
-    uint32_t p[AV_BF_ROUNDS + 2];
-    uint32_t s[4][256];
-} AVBlowfish;
-
-/**
- * Initialize an AVBlowfish context.
- *
- * @param ctx an AVBlowfish context
- * @param key a key
- * @param key_len length of the key
- */
-void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len);
-
-/**
- * Encrypt or decrypt a buffer using a previously initialized context.
- *
- * @param ctx an AVBlowfish context
- * @param xl left four bytes halves of input to be encrypted
- * @param xr right four bytes halves of input to be encrypted
- * @param decrypt 0 for encryption, 1 for decryption
- */
-void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
-                           int decrypt);
-
-/**
- * Encrypt or decrypt a buffer using a previously initialized context.
- *
- * @param ctx an AVBlowfish context
- * @param dst destination array, can be equal to src
- * @param src source array, can be equal to dst
- * @param count number of 8 byte blocks
- * @param iv initialization vector for CBC mode, if NULL ECB will be used
- * @param decrypt 0 for encryption, 1 for decryption
- */
-void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
-                       int count, uint8_t *iv, int decrypt);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_BLOWFISH_H */
diff --git a/deps/libav/libavutil/bswap.h b/deps/libav/libavutil/bswap.h
deleted file mode 100644
index 93a6016..0000000
--- a/deps/libav/libavutil/bswap.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * byte swapping routines
- */
-
-#ifndef AVUTIL_BSWAP_H
-#define AVUTIL_BSWAP_H
-
-#include <stdint.h>
-#include "libavutil/avconfig.h"
-#include "attributes.h"
-
-#ifdef HAVE_AV_CONFIG_H
-
-#include "config.h"
-
-#if   ARCH_AARCH64
-#   include "aarch64/bswap.h"
-#elif ARCH_ARM
-#   include "arm/bswap.h"
-#elif ARCH_AVR32
-#   include "avr32/bswap.h"
-#elif ARCH_BFIN
-#   include "bfin/bswap.h"
-#elif ARCH_SH4
-#   include "sh4/bswap.h"
-#elif ARCH_X86
-#   include "x86/bswap.h"
-#endif
-
-#endif /* HAVE_AV_CONFIG_H */
-
-#define AV_BSWAP16C(x) (((x) << 8 & 0xff00)  | ((x) >> 8 & 0x00ff))
-#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
-#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
-
-#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
-
-#ifndef av_bswap16
-static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
-{
-    x= (x>>8) | (x<<8);
-    return x;
-}
-#endif
-
-#ifndef av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-    return AV_BSWAP32C(x);
-}
-#endif
-
-#ifndef av_bswap64
-static inline uint64_t av_const av_bswap64(uint64_t x)
-{
-    return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
-}
-#endif
-
-// be2ne ... big-endian to native-endian
-// le2ne ... little-endian to native-endian
-
-#if AV_HAVE_BIGENDIAN
-#define av_be2ne16(x) (x)
-#define av_be2ne32(x) (x)
-#define av_be2ne64(x) (x)
-#define av_le2ne16(x) av_bswap16(x)
-#define av_le2ne32(x) av_bswap32(x)
-#define av_le2ne64(x) av_bswap64(x)
-#define AV_BE2NEC(s, x) (x)
-#define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
-#else
-#define av_be2ne16(x) av_bswap16(x)
-#define av_be2ne32(x) av_bswap32(x)
-#define av_be2ne64(x) av_bswap64(x)
-#define av_le2ne16(x) (x)
-#define av_le2ne32(x) (x)
-#define av_le2ne64(x) (x)
-#define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
-#define AV_LE2NEC(s, x) (x)
-#endif
-
-#define AV_BE2NE16C(x) AV_BE2NEC(16, x)
-#define AV_BE2NE32C(x) AV_BE2NEC(32, x)
-#define AV_BE2NE64C(x) AV_BE2NEC(64, x)
-#define AV_LE2NE16C(x) AV_LE2NEC(16, x)
-#define AV_LE2NE32C(x) AV_LE2NEC(32, x)
-#define AV_LE2NE64C(x) AV_LE2NEC(64, x)
-
-#endif /* AVUTIL_BSWAP_H */
diff --git a/deps/libav/libavutil/buffer.c b/deps/libav/libavutil/buffer.c
deleted file mode 100644
index 2b38081..0000000
--- a/deps/libav/libavutil/buffer.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include "atomic.h"
-#include "buffer_internal.h"
-#include "common.h"
-#include "mem.h"
-
-AVBufferRef *av_buffer_create(uint8_t *data, int size,
-                              void (*free)(void *opaque, uint8_t *data),
-                              void *opaque, int flags)
-{
-    AVBufferRef *ref = NULL;
-    AVBuffer    *buf = NULL;
-
-    buf = av_mallocz(sizeof(*buf));
-    if (!buf)
-        return NULL;
-
-    buf->data     = data;
-    buf->size     = size;
-    buf->free     = free ? free : av_buffer_default_free;
-    buf->opaque   = opaque;
-    buf->refcount = 1;
-
-    if (flags & AV_BUFFER_FLAG_READONLY)
-        buf->flags |= BUFFER_FLAG_READONLY;
-
-    ref = av_mallocz(sizeof(*ref));
-    if (!ref) {
-        av_freep(&buf);
-        return NULL;
-    }
-
-    ref->buffer = buf;
-    ref->data   = data;
-    ref->size   = size;
-
-    return ref;
-}
-
-void av_buffer_default_free(void *opaque, uint8_t *data)
-{
-    av_free(data);
-}
-
-AVBufferRef *av_buffer_alloc(int size)
-{
-    AVBufferRef *ret = NULL;
-    uint8_t    *data = NULL;
-
-    data = av_malloc(size);
-    if (!data)
-        return NULL;
-
-    ret = av_buffer_create(data, size, av_buffer_default_free, NULL, 0);
-    if (!ret)
-        av_freep(&data);
-
-    return ret;
-}
-
-AVBufferRef *av_buffer_allocz(int size)
-{
-    AVBufferRef *ret = av_buffer_alloc(size);
-    if (!ret)
-        return NULL;
-
-    memset(ret->data, 0, size);
-    return ret;
-}
-
-AVBufferRef *av_buffer_ref(AVBufferRef *buf)
-{
-    AVBufferRef *ret = av_mallocz(sizeof(*ret));
-
-    if (!ret)
-        return NULL;
-
-    *ret = *buf;
-
-    avpriv_atomic_int_add_and_fetch(&buf->buffer->refcount, 1);
-
-    return ret;
-}
-
-void av_buffer_unref(AVBufferRef **buf)
-{
-    AVBuffer *b;
-
-    if (!buf || !*buf)
-        return;
-    b = (*buf)->buffer;
-    av_freep(buf);
-
-    if (!avpriv_atomic_int_add_and_fetch(&b->refcount, -1)) {
-        b->free(b->opaque, b->data);
-        av_freep(&b);
-    }
-}
-
-int av_buffer_is_writable(const AVBufferRef *buf)
-{
-    if (buf->buffer->flags & AV_BUFFER_FLAG_READONLY)
-        return 0;
-
-    return avpriv_atomic_int_add_and_fetch(&buf->buffer->refcount, 0) == 1;
-}
-
-int av_buffer_make_writable(AVBufferRef **pbuf)
-{
-    AVBufferRef *newbuf, *buf = *pbuf;
-
-    if (av_buffer_is_writable(buf))
-        return 0;
-
-    newbuf = av_buffer_alloc(buf->size);
-    if (!newbuf)
-        return AVERROR(ENOMEM);
-
-    memcpy(newbuf->data, buf->data, buf->size);
-    av_buffer_unref(pbuf);
-    *pbuf = newbuf;
-
-    return 0;
-}
-
-int av_buffer_realloc(AVBufferRef **pbuf, int size)
-{
-    AVBufferRef *buf = *pbuf;
-    uint8_t *tmp;
-
-    if (!buf) {
-        /* allocate a new buffer with av_realloc(), so it will be reallocatable
-         * later */
-        uint8_t *data = av_realloc(NULL, size);
-        if (!data)
-            return AVERROR(ENOMEM);
-
-        buf = av_buffer_create(data, size, av_buffer_default_free, NULL, 0);
-        if (!buf) {
-            av_freep(&data);
-            return AVERROR(ENOMEM);
-        }
-
-        buf->buffer->flags |= BUFFER_FLAG_REALLOCATABLE;
-        *pbuf = buf;
-
-        return 0;
-    } else if (buf->size == size)
-        return 0;
-
-    if (!(buf->buffer->flags & BUFFER_FLAG_REALLOCATABLE) ||
-        !av_buffer_is_writable(buf)) {
-        /* cannot realloc, allocate a new reallocable buffer and copy data */
-        AVBufferRef *new = NULL;
-
-        av_buffer_realloc(&new, size);
-        if (!new)
-            return AVERROR(ENOMEM);
-
-        memcpy(new->data, buf->data, FFMIN(size, buf->size));
-
-        av_buffer_unref(pbuf);
-        *pbuf = new;
-        return 0;
-    }
-
-    tmp = av_realloc(buf->buffer->data, size);
-    if (!tmp)
-        return AVERROR(ENOMEM);
-
-    buf->buffer->data = buf->data = tmp;
-    buf->buffer->size = buf->size = size;
-    return 0;
-}
-
-AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size))
-{
-    AVBufferPool *pool = av_mallocz(sizeof(*pool));
-    if (!pool)
-        return NULL;
-
-    pool->size     = size;
-    pool->alloc    = alloc ? alloc : av_buffer_alloc;
-
-    avpriv_atomic_int_set(&pool->refcount, 1);
-
-    return pool;
-}
-
-/*
- * This function gets called when the pool has been uninited and
- * all the buffers returned to it.
- */
-static void buffer_pool_free(AVBufferPool *pool)
-{
-    while (pool->pool) {
-        BufferPoolEntry *buf = pool->pool;
-        pool->pool = buf->next;
-
-        buf->free(buf->opaque, buf->data);
-        av_freep(&buf);
-    }
-    av_freep(&pool);
-}
-
-void av_buffer_pool_uninit(AVBufferPool **ppool)
-{
-    AVBufferPool *pool;
-
-    if (!ppool || !*ppool)
-        return;
-    pool   = *ppool;
-    *ppool = NULL;
-
-    if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1))
-        buffer_pool_free(pool);
-}
-
-/* remove the whole buffer list from the pool and return it */
-static BufferPoolEntry *get_pool(AVBufferPool *pool)
-{
-    BufferPoolEntry *cur = NULL, *last = NULL;
-
-    do {
-        FFSWAP(BufferPoolEntry*, cur, last);
-        cur = avpriv_atomic_ptr_cas((void * volatile *)&pool->pool, last, NULL);
-        if (!cur)
-            return NULL;
-    } while (cur != last);
-
-    return cur;
-}
-
-static void add_to_pool(BufferPoolEntry *buf)
-{
-    AVBufferPool *pool;
-    BufferPoolEntry *cur, *end = buf;
-
-    if (!buf)
-        return;
-    pool = buf->pool;
-
-    while (end->next)
-        end = end->next;
-
-    while ((cur = avpriv_atomic_ptr_cas((void * volatile *)&pool->pool, NULL, buf))) {
-        /* pool is not empty, retrieve it and append it to our list */
-        cur = get_pool(pool);
-        end->next = cur;
-        while (end->next)
-            end = end->next;
-    }
-}
-
-static void pool_release_buffer(void *opaque, uint8_t *data)
-{
-    BufferPoolEntry *buf = opaque;
-    AVBufferPool *pool = buf->pool;
-    add_to_pool(buf);
-    if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1))
-        buffer_pool_free(pool);
-}
-
-/* allocate a new buffer and override its free() callback so that
- * it is returned to the pool on free */
-static AVBufferRef *pool_alloc_buffer(AVBufferPool *pool)
-{
-    BufferPoolEntry *buf;
-    AVBufferRef     *ret;
-
-    ret = pool->alloc(pool->size);
-    if (!ret)
-        return NULL;
-
-    buf = av_mallocz(sizeof(*buf));
-    if (!buf) {
-        av_buffer_unref(&ret);
-        return NULL;
-    }
-
-    buf->data   = ret->buffer->data;
-    buf->opaque = ret->buffer->opaque;
-    buf->free   = ret->buffer->free;
-    buf->pool   = pool;
-
-    ret->buffer->opaque = buf;
-    ret->buffer->free   = pool_release_buffer;
-
-    avpriv_atomic_int_add_and_fetch(&pool->refcount, 1);
-
-    return ret;
-}
-
-AVBufferRef *av_buffer_pool_get(AVBufferPool *pool)
-{
-    AVBufferRef *ret;
-    BufferPoolEntry *buf;
-
-    /* check whether the pool is empty */
-    buf = get_pool(pool);
-    if (!buf)
-        return pool_alloc_buffer(pool);
-
-    /* keep the first entry, return the rest of the list to the pool */
-    add_to_pool(buf->next);
-    buf->next = NULL;
-
-    ret = av_buffer_create(buf->data, pool->size, pool_release_buffer,
-                           buf, 0);
-    if (!ret) {
-        add_to_pool(buf);
-        return NULL;
-    }
-    avpriv_atomic_int_add_and_fetch(&pool->refcount, 1);
-
-    return ret;
-}
diff --git a/deps/libav/libavutil/buffer.h b/deps/libav/libavutil/buffer.h
deleted file mode 100644
index 56b4d02..0000000
--- a/deps/libav/libavutil/buffer.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @ingroup lavu_buffer
- * refcounted data buffer API
- */
-
-#ifndef AVUTIL_BUFFER_H
-#define AVUTIL_BUFFER_H
-
-#include <stdint.h>
-
-/**
- * @defgroup lavu_buffer AVBuffer
- * @ingroup lavu_data
- *
- * @{
- * AVBuffer is an API for reference-counted data buffers.
- *
- * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer
- * represents the data buffer itself; it is opaque and not meant to be accessed
- * by the caller directly, but only through AVBufferRef. However, the caller may
- * e.g. compare two AVBuffer pointers to check whether two different references
- * are describing the same data buffer. AVBufferRef represents a single
- * reference to an AVBuffer and it is the object that may be manipulated by the
- * caller directly.
- *
- * There are two functions provided for creating a new AVBuffer with a single
- * reference -- av_buffer_alloc() to just allocate a new buffer, and
- * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing
- * reference, additional references may be created with av_buffer_ref().
- * Use av_buffer_unref() to free a reference (this will automatically free the
- * data once all the references are freed).
- *
- * The convention throughout this API and the rest of Libav is such that the
- * buffer is considered writable if there exists only one reference to it (and
- * it has not been marked as read-only). The av_buffer_is_writable() function is
- * provided to check whether this is true and av_buffer_make_writable() will
- * automatically create a new writable buffer when necessary.
- * Of course nothing prevents the calling code from violating this convention,
- * however that is safe only when all the existing references are under its
- * control.
- *
- * @note Referencing and unreferencing the buffers is thread-safe and thus
- * may be done from multiple threads simultaneously without any need for
- * additional locking.
- *
- * @note Two different references to the same buffer can point to different
- * parts of the buffer (i.e. their AVBufferRef.data will not be equal).
- */
-
-/**
- * A reference counted buffer type. It is opaque and is meant to be used through
- * references (AVBufferRef).
- */
-typedef struct AVBuffer AVBuffer;
-
-/**
- * A reference to a data buffer.
- *
- * The size of this struct is not a part of the public ABI and it is not meant
- * to be allocated directly.
- */
-typedef struct AVBufferRef {
-    AVBuffer *buffer;
-
-    /**
-     * The data buffer. It is considered writable if and only if
-     * this is the only reference to the buffer, in which case
-     * av_buffer_is_writable() returns 1.
-     */
-    uint8_t *data;
-    /**
-     * Size of data in bytes.
-     */
-    int      size;
-} AVBufferRef;
-
-/**
- * Allocate an AVBuffer of the given size using av_malloc().
- *
- * @return an AVBufferRef of given size or NULL when out of memory
- */
-AVBufferRef *av_buffer_alloc(int size);
-
-/**
- * Same as av_buffer_alloc(), except the returned buffer will be initialized
- * to zero.
- */
-AVBufferRef *av_buffer_allocz(int size);
-
-/**
- * Always treat the buffer as read-only, even when it has only one
- * reference.
- */
-#define AV_BUFFER_FLAG_READONLY (1 << 0)
-
-/**
- * Create an AVBuffer from an existing array.
- *
- * If this function is successful, data is owned by the AVBuffer. The caller may
- * only access data through the returned AVBufferRef and references derived from
- * it.
- * If this function fails, data is left untouched.
- * @param data   data array
- * @param size   size of data in bytes
- * @param free   a callback for freeing this buffer's data
- * @param opaque parameter to be passed to free
- * @param flags  a combination of AV_BUFFER_FLAG_*
- *
- * @return an AVBufferRef referring to data on success, NULL on failure.
- */
-AVBufferRef *av_buffer_create(uint8_t *data, int size,
-                              void (*free)(void *opaque, uint8_t *data),
-                              void *opaque, int flags);
-
-/**
- * Default free callback, which calls av_free() on the buffer data.
- * This function is meant to be passed to av_buffer_create(), not called
- * directly.
- */
-void av_buffer_default_free(void *opaque, uint8_t *data);
-
-/**
- * Create a new reference to an AVBuffer.
- *
- * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on
- * failure.
- */
-AVBufferRef *av_buffer_ref(AVBufferRef *buf);
-
-/**
- * Free a given reference and automatically free the buffer if there are no more
- * references to it.
- *
- * @param buf the reference to be freed. The pointer is set to NULL on return.
- */
-void av_buffer_unref(AVBufferRef **buf);
-
-/**
- * @return 1 if the caller may write to the data referred to by buf (which is
- * true if and only if buf is the only reference to the underlying AVBuffer).
- * Return 0 otherwise.
- * A positive answer is valid until av_buffer_ref() is called on buf.
- */
-int av_buffer_is_writable(const AVBufferRef *buf);
-
-/**
- * Create a writable reference from a given buffer reference, avoiding data copy
- * if possible.
- *
- * @param buf buffer reference to make writable. On success, buf is either left
- *            untouched, or it is unreferenced and a new writable AVBufferRef is
- *            written in its place. On failure, buf is left untouched.
- * @return 0 on success, a negative AVERROR on failure.
- */
-int av_buffer_make_writable(AVBufferRef **buf);
-
-/**
- * Reallocate a given buffer.
- *
- * @param buf  a buffer reference to reallocate. On success, buf will be
- *             unreferenced and a new reference with the required size will be
- *             written in its place. On failure buf will be left untouched. *buf
- *             may be NULL, then a new buffer is allocated.
- * @param size required new buffer size.
- * @return 0 on success, a negative AVERROR on failure.
- *
- * @note the buffer is actually reallocated with av_realloc() only if it was
- * initially allocated through av_buffer_realloc(NULL) and there is only one
- * reference to it (i.e. the one passed to this function). In all other cases
- * a new buffer is allocated and the data is copied.
- */
-int av_buffer_realloc(AVBufferRef **buf, int size);
-
-/**
- * @}
- */
-
-/**
- * @defgroup lavu_bufferpool AVBufferPool
- * @ingroup lavu_data
- *
- * @{
- * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers.
- *
- * Frequently allocating and freeing large buffers may be slow. AVBufferPool is
- * meant to solve this in cases when the caller needs a set of buffers of the
- * same size (the most obvious use case being buffers for raw video or audio
- * frames).
- *
- * At the beginning, the user must call av_buffer_pool_init() to create the
- * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to
- * get a reference to a new buffer, similar to av_buffer_alloc(). This new
- * reference works in all aspects the same way as the one created by
- * av_buffer_alloc(). However, when the last reference to this buffer is
- * unreferenced, it is returned to the pool instead of being freed and will be
- * reused for subsequent av_buffer_pool_get() calls.
- *
- * When the caller is done with the pool and no longer needs to allocate any new
- * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable.
- * Once all the buffers are released, it will automatically be freed.
- *
- * Allocating and releasing buffers with this API is thread-safe as long as
- * either the default alloc callback is used, or the user-supplied one is
- * thread-safe.
- */
-
-/**
- * The buffer pool. This structure is opaque and not meant to be accessed
- * directly. It is allocated with av_buffer_pool_init() and freed with
- * av_buffer_pool_uninit().
- */
-typedef struct AVBufferPool AVBufferPool;
-
-/**
- * Allocate and initialize a buffer pool.
- *
- * @param size size of each buffer in this pool
- * @param alloc a function that will be used to allocate new buffers when the
- * pool is empty. May be NULL, then the default allocator will be used
- * (av_buffer_alloc()).
- * @return newly created buffer pool on success, NULL on error.
- */
-AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size));
-
-/**
- * Mark the pool as being available for freeing. It will actually be freed only
- * once all the allocated buffers associated with the pool are released. Thus it
- * is safe to call this function while some of the allocated buffers are still
- * in use.
- *
- * @param pool pointer to the pool to be freed. It will be set to NULL.
- * @see av_buffer_pool_can_uninit()
- */
-void av_buffer_pool_uninit(AVBufferPool **pool);
-
-/**
- * Allocate a new AVBuffer, reusing an old buffer from the pool when available.
- * This function may be called simultaneously from multiple threads.
- *
- * @return a reference to the new buffer on success, NULL on error.
- */
-AVBufferRef *av_buffer_pool_get(AVBufferPool *pool);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_BUFFER_H */
diff --git a/deps/libav/libavutil/buffer_internal.h b/deps/libav/libavutil/buffer_internal.h
deleted file mode 100644
index cce83c3..0000000
--- a/deps/libav/libavutil/buffer_internal.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_BUFFER_INTERNAL_H
-#define AVUTIL_BUFFER_INTERNAL_H
-
-#include <stdint.h>
-
-#include "buffer.h"
-
-/**
- * The buffer is always treated as read-only.
- */
-#define BUFFER_FLAG_READONLY      (1 << 0)
-/**
- * The buffer was av_realloc()ed, so it is reallocatable.
- */
-#define BUFFER_FLAG_REALLOCATABLE (1 << 1)
-
-struct AVBuffer {
-    uint8_t *data; /**< data described by this buffer */
-    int      size; /**< size of data in bytes */
-
-    /**
-     *  number of existing AVBufferRef instances referring to this buffer
-     */
-    volatile int refcount;
-
-    /**
-     * a callback for freeing the data
-     */
-    void (*free)(void *opaque, uint8_t *data);
-
-    /**
-     * an opaque pointer, to be used by the freeing callback
-     */
-    void *opaque;
-
-    /**
-     * A combination of BUFFER_FLAG_*
-     */
-    int flags;
-};
-
-typedef struct BufferPoolEntry {
-    uint8_t *data;
-
-    /*
-     * Backups of the original opaque/free of the AVBuffer corresponding to
-     * data. They will be used to free the buffer when the pool is freed.
-     */
-    void *opaque;
-    void (*free)(void *opaque, uint8_t *data);
-
-    AVBufferPool *pool;
-    struct BufferPoolEntry * volatile next;
-} BufferPoolEntry;
-
-struct AVBufferPool {
-    BufferPoolEntry * volatile pool;
-
-    /*
-     * This is used to track when the pool is to be freed.
-     * The pointer to the pool itself held by the caller is considered to
-     * be one reference. Each buffer requested by the caller increases refcount
-     * by one, returning the buffer to the pool decreases it by one.
-     * refcount reaches zero when the buffer has been uninited AND all the
-     * buffers have been released, then it's safe to free the pool and all
-     * the buffers in it.
-     */
-    volatile int refcount;
-
-    int size;
-    AVBufferRef* (*alloc)(int size);
-};
-
-#endif /* AVUTIL_BUFFER_INTERNAL_H */
diff --git a/deps/libav/libavutil/channel_layout.c b/deps/libav/libavutil/channel_layout.c
deleted file mode 100644
index 253c495..0000000
--- a/deps/libav/libavutil/channel_layout.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * audio channel layout utility functions
- */
-
-#include <stdint.h>
-
-#include "avstring.h"
-#include "avutil.h"
-#include "channel_layout.h"
-#include "common.h"
-
-static const char * const channel_names[] = {
-    [0]  = "FL",        /* front left */
-    [1]  = "FR",        /* front right */
-    [2]  = "FC",        /* front center */
-    [3]  = "LFE",       /* low frequency */
-    [4]  = "BL",        /* back left */
-    [5]  = "BR",        /* back right */
-    [6]  = "FLC",       /* front left-of-center  */
-    [7]  = "FRC",       /* front right-of-center */
-    [8]  = "BC",        /* back-center */
-    [9]  = "SL",        /* side left */
-    [10] = "SR",        /* side right */
-    [11] = "TC",        /* top center */
-    [12] = "TFL",       /* top front left */
-    [13] = "TFC",       /* top front center */
-    [14] = "TFR",       /* top front right */
-    [15] = "TBL",       /* top back left */
-    [16] = "TBC",       /* top back center */
-    [17] = "TBR",       /* top back right */
-    [29] = "DL",        /* downmix left */
-    [30] = "DR",        /* downmix right */
-    [31] = "WL",        /* wide left */
-    [32] = "WR",        /* wide right */
-    [33] = "SDL",       /* surround direct left */
-    [34] = "SDR",       /* surround direct right */
-    [35] = "LFE2",      /* low frequency 2 */
-};
-
-static const char *get_channel_name(int channel_id)
-{
-    if (channel_id < 0 || channel_id >= FF_ARRAY_ELEMS(channel_names))
-        return NULL;
-    return channel_names[channel_id];
-}
-
-static const struct {
-    const char *name;
-    int         nb_channels;
-    uint64_t     layout;
-} channel_layout_map[] = {
-    { "mono",        1,  AV_CH_LAYOUT_MONO },
-    { "stereo",      2,  AV_CH_LAYOUT_STEREO },
-    { "stereo",      2,  AV_CH_LAYOUT_STEREO_DOWNMIX },
-    { "2.1",         3,  AV_CH_LAYOUT_2POINT1 },
-    { "3.0",         3,  AV_CH_LAYOUT_SURROUND },
-    { "3.0(back)",   3,  AV_CH_LAYOUT_2_1 },
-    { "3.1",         4,  AV_CH_LAYOUT_3POINT1 },
-    { "4.0",         4,  AV_CH_LAYOUT_4POINT0 },
-    { "quad",        4,  AV_CH_LAYOUT_QUAD },
-    { "quad(side)",  4,  AV_CH_LAYOUT_2_2 },
-    { "4.1",         5,  AV_CH_LAYOUT_4POINT1 },
-    { "5.0",         5,  AV_CH_LAYOUT_5POINT0 },
-    { "5.0",         5,  AV_CH_LAYOUT_5POINT0_BACK },
-    { "5.1",         6,  AV_CH_LAYOUT_5POINT1 },
-    { "5.1",         6,  AV_CH_LAYOUT_5POINT1_BACK },
-    { "6.0",         6,  AV_CH_LAYOUT_6POINT0 },
-    { "6.0(front)",  6,  AV_CH_LAYOUT_6POINT0_FRONT },
-    { "hexagonal",   6,  AV_CH_LAYOUT_HEXAGONAL },
-    { "6.1",         7,  AV_CH_LAYOUT_6POINT1 },
-    { "6.1",         7,  AV_CH_LAYOUT_6POINT1_BACK },
-    { "6.1(front)",  7,  AV_CH_LAYOUT_6POINT1_FRONT },
-    { "7.0",         7,  AV_CH_LAYOUT_7POINT0 },
-    { "7.0(front)",  7,  AV_CH_LAYOUT_7POINT0_FRONT },
-    { "7.1",         8,  AV_CH_LAYOUT_7POINT1 },
-    { "7.1(wide)",   8,  AV_CH_LAYOUT_7POINT1_WIDE },
-    { "7.1(wide)",   8,  AV_CH_LAYOUT_7POINT1_WIDE_BACK },
-    { "octagonal",   8,  AV_CH_LAYOUT_OCTAGONAL },
-    { "downmix",     2,  AV_CH_LAYOUT_STEREO_DOWNMIX, },
-    { 0 }
-};
-
-static uint64_t get_channel_layout_single(const char *name, int name_len)
-{
-    int i;
-    char *end;
-    int64_t layout;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map) - 1; i++) {
-        if (strlen(channel_layout_map[i].name) == name_len &&
-            !memcmp(channel_layout_map[i].name, name, name_len))
-            return channel_layout_map[i].layout;
-    }
-    for (i = 0; i < FF_ARRAY_ELEMS(channel_names); i++)
-        if (channel_names[i] &&
-            strlen(channel_names[i]) == name_len &&
-            !memcmp(channel_names[i], name, name_len))
-            return (int64_t)1 << i;
-    i = strtol(name, &end, 10);
-    if (end - name == name_len ||
-        (end + 1 - name == name_len && *end  == 'c'))
-        return av_get_default_channel_layout(i);
-    layout = strtoll(name, &end, 0);
-    if (end - name == name_len)
-        return FFMAX(layout, 0);
-    return 0;
-}
-
-uint64_t av_get_channel_layout(const char *name)
-{
-    const char *n, *e;
-    const char *name_end = name + strlen(name);
-    int64_t layout = 0, layout_single;
-
-    for (n = name; n < name_end; n = e + 1) {
-        for (e = n; e < name_end && *e != '+' && *e != '|'; e++);
-        layout_single = get_channel_layout_single(n, e - n);
-        if (!layout_single)
-            return 0;
-        layout |= layout_single;
-    }
-    return layout;
-}
-
-void av_get_channel_layout_string(char *buf, int buf_size,
-                                  int nb_channels, uint64_t channel_layout)
-{
-    int i;
-
-    if (nb_channels <= 0)
-        nb_channels = av_get_channel_layout_nb_channels(channel_layout);
-
-    for (i = 0; channel_layout_map[i].name; i++)
-        if (nb_channels    == channel_layout_map[i].nb_channels &&
-            channel_layout == channel_layout_map[i].layout) {
-            av_strlcpy(buf, channel_layout_map[i].name, buf_size);
-            return;
-        }
-
-    snprintf(buf, buf_size, "%d channels", nb_channels);
-    if (channel_layout) {
-        int i, ch;
-        av_strlcat(buf, " (", buf_size);
-        for (i = 0, ch = 0; i < 64; i++) {
-            if ((channel_layout & (UINT64_C(1) << i))) {
-                const char *name = get_channel_name(i);
-                if (name) {
-                    if (ch > 0)
-                        av_strlcat(buf, "|", buf_size);
-                    av_strlcat(buf, name, buf_size);
-                }
-                ch++;
-            }
-        }
-        av_strlcat(buf, ")", buf_size);
-    }
-}
-
-int av_get_channel_layout_nb_channels(uint64_t channel_layout)
-{
-    return av_popcount64(channel_layout);
-}
-
-uint64_t av_get_default_channel_layout(int nb_channels)
-{
-    switch(nb_channels) {
-    case 1: return AV_CH_LAYOUT_MONO;
-    case 2: return AV_CH_LAYOUT_STEREO;
-    case 3: return AV_CH_LAYOUT_SURROUND;
-    case 4: return AV_CH_LAYOUT_QUAD;
-    case 5: return AV_CH_LAYOUT_5POINT0;
-    case 6: return AV_CH_LAYOUT_5POINT1;
-    case 7: return AV_CH_LAYOUT_6POINT1;
-    case 8: return AV_CH_LAYOUT_7POINT1;
-    default: return 0;
-    }
-}
-
-int av_get_channel_layout_channel_index(uint64_t channel_layout,
-                                        uint64_t channel)
-{
-    if (!(channel_layout & channel) ||
-        av_get_channel_layout_nb_channels(channel) != 1)
-        return AVERROR(EINVAL);
-    channel_layout &= channel - 1;
-    return av_get_channel_layout_nb_channels(channel_layout);
-}
-
-const char *av_get_channel_name(uint64_t channel)
-{
-    int i;
-    if (av_get_channel_layout_nb_channels(channel) != 1)
-        return NULL;
-    for (i = 0; i < 64; i++)
-        if ((1ULL<<i) & channel)
-            return get_channel_name(i);
-    return NULL;
-}
-
-uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
-{
-    int i;
-
-    if (av_get_channel_layout_nb_channels(channel_layout) <= index)
-        return 0;
-
-    for (i = 0; i < 64; i++) {
-        if ((1ULL << i) & channel_layout && !index--)
-            return 1ULL << i;
-    }
-    return 0;
-}
diff --git a/deps/libav/libavutil/channel_layout.h b/deps/libav/libavutil/channel_layout.h
deleted file mode 100644
index 6a1f830..0000000
--- a/deps/libav/libavutil/channel_layout.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2008 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_CHANNEL_LAYOUT_H
-#define AVUTIL_CHANNEL_LAYOUT_H
-
-#include <stdint.h>
-
-/**
- * @file
- * audio channel layout utility functions
- */
-
-/**
- * @addtogroup lavu_audio
- * @{
- */
-
-/**
- * @defgroup channel_masks Audio channel masks
- * @{
- */
-#define AV_CH_FRONT_LEFT             0x00000001
-#define AV_CH_FRONT_RIGHT            0x00000002
-#define AV_CH_FRONT_CENTER           0x00000004
-#define AV_CH_LOW_FREQUENCY          0x00000008
-#define AV_CH_BACK_LEFT              0x00000010
-#define AV_CH_BACK_RIGHT             0x00000020
-#define AV_CH_FRONT_LEFT_OF_CENTER   0x00000040
-#define AV_CH_FRONT_RIGHT_OF_CENTER  0x00000080
-#define AV_CH_BACK_CENTER            0x00000100
-#define AV_CH_SIDE_LEFT              0x00000200
-#define AV_CH_SIDE_RIGHT             0x00000400
-#define AV_CH_TOP_CENTER             0x00000800
-#define AV_CH_TOP_FRONT_LEFT         0x00001000
-#define AV_CH_TOP_FRONT_CENTER       0x00002000
-#define AV_CH_TOP_FRONT_RIGHT        0x00004000
-#define AV_CH_TOP_BACK_LEFT          0x00008000
-#define AV_CH_TOP_BACK_CENTER        0x00010000
-#define AV_CH_TOP_BACK_RIGHT         0x00020000
-#define AV_CH_STEREO_LEFT            0x20000000  ///< Stereo downmix.
-#define AV_CH_STEREO_RIGHT           0x40000000  ///< See AV_CH_STEREO_LEFT.
-#define AV_CH_WIDE_LEFT              0x0000000080000000ULL
-#define AV_CH_WIDE_RIGHT             0x0000000100000000ULL
-#define AV_CH_SURROUND_DIRECT_LEFT   0x0000000200000000ULL
-#define AV_CH_SURROUND_DIRECT_RIGHT  0x0000000400000000ULL
-#define AV_CH_LOW_FREQUENCY_2        0x0000000800000000ULL
-
-/** Channel mask value used for AVCodecContext.request_channel_layout
-    to indicate that the user requests the channel order of the decoder output
-    to be the native codec channel order. */
-#define AV_CH_LAYOUT_NATIVE          0x8000000000000000ULL
-
-/**
- * @}
- * @defgroup channel_mask_c Audio channel convenience macros
- * @{
- * */
-#define AV_CH_LAYOUT_MONO              (AV_CH_FRONT_CENTER)
-#define AV_CH_LAYOUT_STEREO            (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
-#define AV_CH_LAYOUT_2POINT1           (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_2_1               (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_SURROUND          (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
-#define AV_CH_LAYOUT_3POINT1           (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_4POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_4POINT1           (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_2_2               (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
-#define AV_CH_LAYOUT_QUAD              (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_5POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
-#define AV_CH_LAYOUT_5POINT1           (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_5POINT0_BACK      (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_5POINT1_BACK      (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_6POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_6POINT0_FRONT     (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_HEXAGONAL         (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_6POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_6POINT1_BACK      (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_6POINT1_FRONT     (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_7POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_7POINT0_FRONT     (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_OCTAGONAL         (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_STEREO_DOWNMIX    (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
-
-enum AVMatrixEncoding {
-    AV_MATRIX_ENCODING_NONE,
-    AV_MATRIX_ENCODING_DOLBY,
-    AV_MATRIX_ENCODING_DPLII,
-    AV_MATRIX_ENCODING_DPLIIX,
-    AV_MATRIX_ENCODING_DPLIIZ,
-    AV_MATRIX_ENCODING_DOLBYEX,
-    AV_MATRIX_ENCODING_DOLBYHEADPHONE,
-    AV_MATRIX_ENCODING_NB
-};
-
-/**
- * @}
- */
-
-/**
- * Return a channel layout id that matches name, or 0 if no match is found.
- *
- * name can be one or several of the following notations,
- * separated by '+' or '|':
- * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
- *   5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
- * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
- *   SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
- * - a number of channels, in decimal, optionally followed by 'c', yielding
- *   the default channel layout for that number of channels (@see
- *   av_get_default_channel_layout);
- * - a channel layout mask, in hexadecimal starting with "0x" (see the
- *   AV_CH_* macros).
- *
- * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
- */
-uint64_t av_get_channel_layout(const char *name);
-
-/**
- * Return a description of a channel layout.
- * If nb_channels is <= 0, it is guessed from the channel_layout.
- *
- * @param buf put here the string containing the channel layout
- * @param buf_size size in bytes of the buffer
- */
-void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
-
-/**
- * Return the number of channels in the channel layout.
- */
-int av_get_channel_layout_nb_channels(uint64_t channel_layout);
-
-/**
- * Return default channel layout for a given number of channels.
- */
-uint64_t av_get_default_channel_layout(int nb_channels);
-
-/**
- * Get the index of a channel in channel_layout.
- *
- * @param channel a channel layout describing exactly one channel which must be
- *                present in channel_layout.
- *
- * @return index of channel in channel_layout on success, a negative AVERROR
- *         on error.
- */
-int av_get_channel_layout_channel_index(uint64_t channel_layout,
-                                        uint64_t channel);
-
-/**
- * Get the channel with the given index in channel_layout.
- */
-uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
-
-/**
- * Get the name of a given channel.
- *
- * @return channel name on success, NULL on error.
- */
-const char *av_get_channel_name(uint64_t channel);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_CHANNEL_LAYOUT_H */
diff --git a/deps/libav/libavutil/colorspace.h b/deps/libav/libavutil/colorspace.h
deleted file mode 100644
index 8757566..0000000
--- a/deps/libav/libavutil/colorspace.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Colorspace conversion defines
- * Copyright (c) 2001, 2002, 2003 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Various defines for YUV<->RGB conversion
- */
-
-#ifndef AVUTIL_COLORSPACE_H
-#define AVUTIL_COLORSPACE_H
-
-#define SCALEBITS 10
-#define ONE_HALF  (1 << (SCALEBITS - 1))
-#define FIX(x)    ((int) ((x) * (1<<SCALEBITS) + 0.5))
-
-#define YUV_TO_RGB1_CCIR(cb1, cr1)\
-{\
-    cb = (cb1) - 128;\
-    cr = (cr1) - 128;\
-    r_add = FIX(1.40200*255.0/224.0) * cr + ONE_HALF;\
-    g_add = - FIX(0.34414*255.0/224.0) * cb - FIX(0.71414*255.0/224.0) * cr + \
-            ONE_HALF;\
-    b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\
-}
-
-#define YUV_TO_RGB2_CCIR(r, g, b, y1)\
-{\
-    y = ((y1) - 16) * FIX(255.0/219.0);\
-    r = cm[(y + r_add) >> SCALEBITS];\
-    g = cm[(y + g_add) >> SCALEBITS];\
-    b = cm[(y + b_add) >> SCALEBITS];\
-}
-
-#define YUV_TO_RGB1(cb1, cr1)\
-{\
-    cb = (cb1) - 128;\
-    cr = (cr1) - 128;\
-    r_add = FIX(1.40200) * cr + ONE_HALF;\
-    g_add = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\
-    b_add = FIX(1.77200) * cb + ONE_HALF;\
-}
-
-#define YUV_TO_RGB2(r, g, b, y1)\
-{\
-    y = (y1) << SCALEBITS;\
-    r = cm[(y + r_add) >> SCALEBITS];\
-    g = cm[(y + g_add) >> SCALEBITS];\
-    b = cm[(y + b_add) >> SCALEBITS];\
-}
-
-#define Y_CCIR_TO_JPEG(y)\
- cm[((y) * FIX(255.0/219.0) + (ONE_HALF - 16 * FIX(255.0/219.0))) >> SCALEBITS]
-
-#define Y_JPEG_TO_CCIR(y)\
- (((y) * FIX(219.0/255.0) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS)
-
-#define C_CCIR_TO_JPEG(y)\
- cm[(((y) - 128) * FIX(127.0/112.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS]
-
-/* NOTE: the clamp is really necessary! */
-static inline int C_JPEG_TO_CCIR(int y) {
-    y = (((y - 128) * FIX(112.0/127.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS);
-    if (y < 16)
-        y = 16;
-    return y;
-}
-
-
-#define RGB_TO_Y(r, g, b) \
-((FIX(0.29900) * (r) + FIX(0.58700) * (g) + \
-  FIX(0.11400) * (b) + ONE_HALF) >> SCALEBITS)
-
-#define RGB_TO_U(r1, g1, b1, shift)\
-(((- FIX(0.16874) * r1 - FIX(0.33126) * g1 +         \
-     FIX(0.50000) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_V(r1, g1, b1, shift)\
-(((FIX(0.50000) * r1 - FIX(0.41869) * g1 -           \
-   FIX(0.08131) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_Y_CCIR(r, g, b) \
-((FIX(0.29900*219.0/255.0) * (r) + FIX(0.58700*219.0/255.0) * (g) + \
-  FIX(0.11400*219.0/255.0) * (b) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS)
-
-#define RGB_TO_U_CCIR(r1, g1, b1, shift)\
-(((- FIX(0.16874*224.0/255.0) * r1 - FIX(0.33126*224.0/255.0) * g1 +         \
-     FIX(0.50000*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_V_CCIR(r1, g1, b1, shift)\
-(((FIX(0.50000*224.0/255.0) * r1 - FIX(0.41869*224.0/255.0) * g1 -           \
-   FIX(0.08131*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#endif /* AVUTIL_COLORSPACE_H */
diff --git a/deps/libav/libavutil/common.h b/deps/libav/libavutil/common.h
deleted file mode 100644
index eb40e12..0000000
--- a/deps/libav/libavutil/common.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * common internal and external API header
- */
-
-#ifndef AVUTIL_COMMON_H
-#define AVUTIL_COMMON_H
-
-#include <errno.h>
-#include <inttypes.h>
-#include <limits.h>
-#include <math.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "attributes.h"
-#include "version.h"
-#include "libavutil/avconfig.h"
-
-#if AV_HAVE_BIGENDIAN
-#   define AV_NE(be, le) (be)
-#else
-#   define AV_NE(be, le) (le)
-#endif
-
-//rounded division & shift
-#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
-/* assume b>0 */
-#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
-#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
-#define FFSIGN(a) ((a) > 0 ? 1 : -1)
-
-#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
-#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
-#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
-#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
-
-#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
-#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
-#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
-
-/* misc math functions */
-
-#if FF_API_AV_REVERSE
-extern attribute_deprecated const uint8_t av_reverse[256];
-#endif
-
-#ifdef HAVE_AV_CONFIG_H
-#   include "config.h"
-#   include "intmath.h"
-#endif
-
-/* Pull in unguarded fallback defines at the end of this file. */
-#include "common.h"
-
-#ifndef av_log2
-av_const int av_log2(unsigned v);
-#endif
-
-#ifndef av_log2_16bit
-av_const int av_log2_16bit(unsigned v);
-#endif
-
-/**
- * Clip a signed integer value into the amin-amax range.
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
-{
-    if      (a < amin) return amin;
-    else if (a > amax) return amax;
-    else               return a;
-}
-
-/**
- * Clip a signed integer value into the 0-255 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
-{
-    if (a&(~0xFF)) return (-a)>>31;
-    else           return a;
-}
-
-/**
- * Clip a signed integer value into the -128,127 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const int8_t av_clip_int8_c(int a)
-{
-    if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
-    else                  return a;
-}
-
-/**
- * Clip a signed integer value into the 0-65535 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
-{
-    if (a&(~0xFFFF)) return (-a)>>31;
-    else             return a;
-}
-
-/**
- * Clip a signed integer value into the -32768,32767 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const int16_t av_clip_int16_c(int a)
-{
-    if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
-    else                      return a;
-}
-
-/**
- * Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
-{
-    if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
-    else                                         return a;
-}
-
-/**
- * Clip a signed integer to an unsigned power of two range.
- * @param  a value to clip
- * @param  p bit position to clip at
- * @return clipped value
- */
-static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
-{
-    if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
-    else                   return  a;
-}
-
-/**
- * Add two signed 32-bit values with saturation.
- *
- * @param  a one value
- * @param  b another value
- * @return sum with signed saturation
- */
-static av_always_inline int av_sat_add32_c(int a, int b)
-{
-    return av_clipl_int32((int64_t)a + b);
-}
-
-/**
- * Add a doubled value to another value with saturation at both stages.
- *
- * @param  a first value
- * @param  b value doubled and added to a
- * @return sum with signed saturation
- */
-static av_always_inline int av_sat_dadd32_c(int a, int b)
-{
-    return av_sat_add32(a, av_sat_add32(b, b));
-}
-
-/**
- * Clip a float value into the amin-amax range.
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
-{
-    if      (a < amin) return amin;
-    else if (a > amax) return amax;
-    else               return a;
-}
-
-/** Compute ceil(log2(x)).
- * @param x value used to compute ceil(log2(x))
- * @return computed ceiling of log2(x)
- */
-static av_always_inline av_const int av_ceil_log2_c(int x)
-{
-    return av_log2((x - 1) << 1);
-}
-
-/**
- * Count number of bits set to one in x
- * @param x value to count bits of
- * @return the number of bits set to one in x
- */
-static av_always_inline av_const int av_popcount_c(uint32_t x)
-{
-    x -= (x >> 1) & 0x55555555;
-    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
-    x = (x + (x >> 4)) & 0x0F0F0F0F;
-    x += x >> 8;
-    return (x + (x >> 16)) & 0x3F;
-}
-
-/**
- * Count number of bits set to one in x
- * @param x value to count bits of
- * @return the number of bits set to one in x
- */
-static av_always_inline av_const int av_popcount64_c(uint64_t x)
-{
-    return av_popcount(x) + av_popcount(x >> 32);
-}
-
-#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
-#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
-
-/**
- * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
- *
- * @param val      Output value, must be an lvalue of type uint32_t.
- * @param GET_BYTE Expression reading one byte from the input.
- *                 Evaluated up to 7 times (4 for the currently
- *                 assigned Unicode range).  With a memory buffer
- *                 input, this could be *ptr++.
- * @param ERROR    Expression to be evaluated on invalid input,
- *                 typically a goto statement.
- */
-#define GET_UTF8(val, GET_BYTE, ERROR)\
-    val= GET_BYTE;\
-    {\
-        uint32_t top = (val & 128) >> 1;\
-        if ((val & 0xc0) == 0x80)\
-            ERROR\
-        while (val & top) {\
-            int tmp= GET_BYTE - 128;\
-            if(tmp>>6)\
-                ERROR\
-            val= (val<<6) + tmp;\
-            top <<= 5;\
-        }\
-        val &= (top << 1) - 1;\
-    }
-
-/**
- * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
- *
- * @param val       Output value, must be an lvalue of type uint32_t.
- * @param GET_16BIT Expression returning two bytes of UTF-16 data converted
- *                  to native byte order.  Evaluated one or two times.
- * @param ERROR     Expression to be evaluated on invalid input,
- *                  typically a goto statement.
- */
-#define GET_UTF16(val, GET_16BIT, ERROR)\
-    val = GET_16BIT;\
-    {\
-        unsigned int hi = val - 0xD800;\
-        if (hi < 0x800) {\
-            val = GET_16BIT - 0xDC00;\
-            if (val > 0x3FFU || hi > 0x3FFU)\
-                ERROR\
-            val += (hi<<10) + 0x10000;\
-        }\
-    }\
-
-/**
- * @def PUT_UTF8(val, tmp, PUT_BYTE)
- * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
- * @param val is an input-only argument and should be of type uint32_t. It holds
- * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
- * val is given as a function it is executed only once.
- * @param tmp is a temporary variable and should be of type uint8_t. It
- * represents an intermediate value during conversion that is to be
- * output by PUT_BYTE.
- * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
- * It could be a function or a statement, and uses tmp as the input byte.
- * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
- * executed up to 4 times for values in the valid UTF-8 range and up to
- * 7 times in the general case, depending on the length of the converted
- * Unicode character.
- */
-#define PUT_UTF8(val, tmp, PUT_BYTE)\
-    {\
-        int bytes, shift;\
-        uint32_t in = val;\
-        if (in < 0x80) {\
-            tmp = in;\
-            PUT_BYTE\
-        } else {\
-            bytes = (av_log2(in) + 4) / 5;\
-            shift = (bytes - 1) * 6;\
-            tmp = (256 - (256 >> bytes)) | (in >> shift);\
-            PUT_BYTE\
-            while (shift >= 6) {\
-                shift -= 6;\
-                tmp = 0x80 | ((in >> shift) & 0x3f);\
-                PUT_BYTE\
-            }\
-        }\
-    }
-
-/**
- * @def PUT_UTF16(val, tmp, PUT_16BIT)
- * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
- * @param val is an input-only argument and should be of type uint32_t. It holds
- * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
- * val is given as a function it is executed only once.
- * @param tmp is a temporary variable and should be of type uint16_t. It
- * represents an intermediate value during conversion that is to be
- * output by PUT_16BIT.
- * @param PUT_16BIT writes the converted UTF-16 data to any proper destination
- * in desired endianness. It could be a function or a statement, and uses tmp
- * as the input byte.  For example, PUT_BYTE could be "*output++ = tmp;"
- * PUT_BYTE will be executed 1 or 2 times depending on input character.
- */
-#define PUT_UTF16(val, tmp, PUT_16BIT)\
-    {\
-        uint32_t in = val;\
-        if (in < 0x10000) {\
-            tmp = in;\
-            PUT_16BIT\
-        } else {\
-            tmp = 0xD800 | ((in - 0x10000) >> 10);\
-            PUT_16BIT\
-            tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
-            PUT_16BIT\
-        }\
-    }\
-
-
-
-#include "mem.h"
-
-#ifdef HAVE_AV_CONFIG_H
-#    include "internal.h"
-#endif /* HAVE_AV_CONFIG_H */
-
-#endif /* AVUTIL_COMMON_H */
-
-/*
- * The following definitions are outside the multiple inclusion guard
- * to ensure they are immediately available in intmath.h.
- */
-
-#ifndef av_ceil_log2
-#   define av_ceil_log2     av_ceil_log2_c
-#endif
-#ifndef av_clip
-#   define av_clip          av_clip_c
-#endif
-#ifndef av_clip_uint8
-#   define av_clip_uint8    av_clip_uint8_c
-#endif
-#ifndef av_clip_int8
-#   define av_clip_int8     av_clip_int8_c
-#endif
-#ifndef av_clip_uint16
-#   define av_clip_uint16   av_clip_uint16_c
-#endif
-#ifndef av_clip_int16
-#   define av_clip_int16    av_clip_int16_c
-#endif
-#ifndef av_clipl_int32
-#   define av_clipl_int32   av_clipl_int32_c
-#endif
-#ifndef av_clip_uintp2
-#   define av_clip_uintp2   av_clip_uintp2_c
-#endif
-#ifndef av_sat_add32
-#   define av_sat_add32     av_sat_add32_c
-#endif
-#ifndef av_sat_dadd32
-#   define av_sat_dadd32    av_sat_dadd32_c
-#endif
-#ifndef av_clipf
-#   define av_clipf         av_clipf_c
-#endif
-#ifndef av_popcount
-#   define av_popcount      av_popcount_c
-#endif
-#ifndef av_popcount64
-#   define av_popcount64    av_popcount64_c
-#endif
diff --git a/deps/libav/libavutil/cpu.c b/deps/libav/libavutil/cpu.c
deleted file mode 100644
index 8c2cfb8..0000000
--- a/deps/libav/libavutil/cpu.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "cpu.h"
-#include "cpu_internal.h"
-#include "config.h"
-#include "opt.h"
-#include "common.h"
-
-#if HAVE_SCHED_GETAFFINITY
-#define _GNU_SOURCE
-#include <sched.h>
-#endif
-#if HAVE_GETPROCESSAFFINITYMASK
-#include <windows.h>
-#endif
-#if HAVE_SYSCTL
-#if HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#endif
-#if HAVE_SYSCONF
-#include <unistd.h>
-#endif
-
-static int cpuflags_mask = -1, checked;
-
-int av_get_cpu_flags(void)
-{
-    static int flags;
-
-    if (checked)
-        return flags;
-
-    if (ARCH_AARCH64)
-        flags = ff_get_cpu_flags_aarch64();
-    if (ARCH_ARM)
-        flags = ff_get_cpu_flags_arm();
-    if (ARCH_PPC)
-        flags = ff_get_cpu_flags_ppc();
-    if (ARCH_X86)
-        flags = ff_get_cpu_flags_x86();
-
-    flags  &= cpuflags_mask;
-    checked = 1;
-
-    return flags;
-}
-
-void av_set_cpu_flags_mask(int mask)
-{
-    cpuflags_mask = mask;
-    checked       = 0;
-}
-
-int av_parse_cpu_flags(const char *s)
-{
-#define CPUFLAG_MMXEXT   (AV_CPU_FLAG_MMX      | AV_CPU_FLAG_MMXEXT | AV_CPU_FLAG_CMOV)
-#define CPUFLAG_3DNOW    (AV_CPU_FLAG_3DNOW    | AV_CPU_FLAG_MMX)
-#define CPUFLAG_3DNOWEXT (AV_CPU_FLAG_3DNOWEXT | CPUFLAG_3DNOW)
-#define CPUFLAG_SSE      (AV_CPU_FLAG_SSE      | CPUFLAG_MMXEXT)
-#define CPUFLAG_SSE2     (AV_CPU_FLAG_SSE2     | CPUFLAG_SSE)
-#define CPUFLAG_SSE2SLOW (AV_CPU_FLAG_SSE2SLOW | CPUFLAG_SSE2)
-#define CPUFLAG_SSE3     (AV_CPU_FLAG_SSE3     | CPUFLAG_SSE2)
-#define CPUFLAG_SSE3SLOW (AV_CPU_FLAG_SSE3SLOW | CPUFLAG_SSE3)
-#define CPUFLAG_SSSE3    (AV_CPU_FLAG_SSSE3    | CPUFLAG_SSE3)
-#define CPUFLAG_SSE4     (AV_CPU_FLAG_SSE4     | CPUFLAG_SSSE3)
-#define CPUFLAG_SSE42    (AV_CPU_FLAG_SSE42    | CPUFLAG_SSE4)
-#define CPUFLAG_AVX      (AV_CPU_FLAG_AVX      | CPUFLAG_SSE42)
-#define CPUFLAG_XOP      (AV_CPU_FLAG_XOP      | CPUFLAG_AVX)
-#define CPUFLAG_FMA4     (AV_CPU_FLAG_FMA4     | CPUFLAG_AVX)
-#define CPUFLAG_AVX2     (AV_CPU_FLAG_AVX2     | CPUFLAG_AVX)
-    static const AVOption cpuflags_opts[] = {
-        { "flags"   , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
-#if   ARCH_PPC
-        { "altivec" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ALTIVEC  },    .unit = "flags" },
-#elif ARCH_X86
-        { "mmx"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX      },    .unit = "flags" },
-        { "mmxext"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_MMXEXT       },    .unit = "flags" },
-        { "sse"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE          },    .unit = "flags" },
-        { "sse2"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE2         },    .unit = "flags" },
-        { "sse2slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE2SLOW     },    .unit = "flags" },
-        { "sse3"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE3         },    .unit = "flags" },
-        { "sse3slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE3SLOW     },    .unit = "flags" },
-        { "ssse3"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSSE3        },    .unit = "flags" },
-        { "atom"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ATOM     },    .unit = "flags" },
-        { "sse4.1"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE4         },    .unit = "flags" },
-        { "sse4.2"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE42        },    .unit = "flags" },
-        { "avx"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX          },    .unit = "flags" },
-        { "xop"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_XOP          },    .unit = "flags" },
-        { "fma4"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_FMA4         },    .unit = "flags" },
-        { "avx2"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX2         },    .unit = "flags" },
-        { "3dnow"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOW        },    .unit = "flags" },
-        { "3dnowext", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOWEXT     },    .unit = "flags" },
-        { "cmov",     NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_CMOV     },    .unit = "flags" },
-#elif ARCH_ARM
-        { "armv5te",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV5TE  },    .unit = "flags" },
-        { "armv6",    NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV6    },    .unit = "flags" },
-        { "armv6t2",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV6T2  },    .unit = "flags" },
-        { "vfp",      NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP      },    .unit = "flags" },
-        { "vfpv3",    NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFPV3    },    .unit = "flags" },
-        { "neon",     NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON     },    .unit = "flags" },
-#elif ARCH_AARCH64
-        { "neon",     NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON     },    .unit = "flags" },
-        { "vfp",      NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP      },    .unit = "flags" },
-#endif
-        { NULL },
-    };
-    static const AVClass class = {
-        .class_name = "cpuflags",
-        .item_name  = av_default_item_name,
-        .option     = cpuflags_opts,
-        .version    = LIBAVUTIL_VERSION_INT,
-    };
-
-    int flags = 0, ret;
-    const AVClass *pclass = &class;
-
-    if ((ret = av_opt_eval_flags(&pclass, &cpuflags_opts[0], s, &flags)) < 0)
-        return ret;
-
-    return flags & INT_MAX;
-}
-
-int av_cpu_count(void)
-{
-    int nb_cpus = 1;
-#if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT)
-    cpu_set_t cpuset;
-
-    CPU_ZERO(&cpuset);
-
-    if (!sched_getaffinity(0, sizeof(cpuset), &cpuset))
-        nb_cpus = CPU_COUNT(&cpuset);
-#elif HAVE_GETPROCESSAFFINITYMASK
-    DWORD_PTR proc_aff, sys_aff;
-    if (GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff))
-        nb_cpus = av_popcount64(proc_aff);
-#elif HAVE_SYSCTL && defined(HW_NCPU)
-    int mib[2] = { CTL_HW, HW_NCPU };
-    size_t len = sizeof(nb_cpus);
-
-    if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1)
-        nb_cpus = 0;
-#elif HAVE_SYSCONF && defined(_SC_NPROC_ONLN)
-    nb_cpus = sysconf(_SC_NPROC_ONLN);
-#elif HAVE_SYSCONF && defined(_SC_NPROCESSORS_ONLN)
-    nb_cpus = sysconf(_SC_NPROCESSORS_ONLN);
-#endif
-
-    return nb_cpus;
-}
-
-#ifdef TEST
-
-#include <stdio.h>
-
-static const struct {
-    int flag;
-    const char *name;
-} cpu_flag_tab[] = {
-#if   ARCH_AARCH64
-    { AV_CPU_FLAG_NEON,      "neon"       },
-    { AV_CPU_FLAG_VFP,       "vfp"        },
-#elif ARCH_ARM
-    { AV_CPU_FLAG_ARMV5TE,   "armv5te"    },
-    { AV_CPU_FLAG_ARMV6,     "armv6"      },
-    { AV_CPU_FLAG_ARMV6T2,   "armv6t2"    },
-    { AV_CPU_FLAG_VFP,       "vfp"        },
-    { AV_CPU_FLAG_VFPV3,     "vfpv3"      },
-    { AV_CPU_FLAG_NEON,      "neon"       },
-#elif ARCH_PPC
-    { AV_CPU_FLAG_ALTIVEC,   "altivec"    },
-#elif ARCH_X86
-    { AV_CPU_FLAG_MMX,       "mmx"        },
-    { AV_CPU_FLAG_MMXEXT,    "mmxext"     },
-    { AV_CPU_FLAG_SSE,       "sse"        },
-    { AV_CPU_FLAG_SSE2,      "sse2"       },
-    { AV_CPU_FLAG_SSE2SLOW,  "sse2(slow)" },
-    { AV_CPU_FLAG_SSE3,      "sse3"       },
-    { AV_CPU_FLAG_SSE3SLOW,  "sse3(slow)" },
-    { AV_CPU_FLAG_SSSE3,     "ssse3"      },
-    { AV_CPU_FLAG_ATOM,      "atom"       },
-    { AV_CPU_FLAG_SSE4,      "sse4.1"     },
-    { AV_CPU_FLAG_SSE42,     "sse4.2"     },
-    { AV_CPU_FLAG_AVX,       "avx"        },
-    { AV_CPU_FLAG_XOP,       "xop"        },
-    { AV_CPU_FLAG_FMA4,      "fma4"       },
-    { AV_CPU_FLAG_3DNOW,     "3dnow"      },
-    { AV_CPU_FLAG_3DNOWEXT,  "3dnowext"   },
-    { AV_CPU_FLAG_CMOV,      "cmov"       },
-    { AV_CPU_FLAG_AVX2,      "avx2"       },
-#endif
-    { 0 }
-};
-
-int main(void)
-{
-    int cpu_flags = av_get_cpu_flags();
-    int i;
-
-    printf("cpu_flags = 0x%08X\n", cpu_flags);
-    printf("cpu_flags =");
-    for (i = 0; cpu_flag_tab[i].flag; i++)
-        if (cpu_flags & cpu_flag_tab[i].flag)
-            printf(" %s", cpu_flag_tab[i].name);
-    printf("\n");
-
-    return 0;
-}
-
-#endif
diff --git a/deps/libav/libavutil/cpu.h b/deps/libav/libavutil/cpu.h
deleted file mode 100644
index 29036e3..0000000
--- a/deps/libav/libavutil/cpu.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_CPU_H
-#define AVUTIL_CPU_H
-
-#include "version.h"
-
-#define AV_CPU_FLAG_FORCE    0x80000000 /* force usage of selected flags (OR) */
-
-    /* lower 16 bits - CPU features */
-#define AV_CPU_FLAG_MMX          0x0001 ///< standard MMX
-#define AV_CPU_FLAG_MMXEXT       0x0002 ///< SSE integer functions or AMD MMX ext
-#if FF_API_CPU_FLAG_MMX2
-#define AV_CPU_FLAG_MMX2         0x0002 ///< SSE integer functions or AMD MMX ext
-#endif
-#define AV_CPU_FLAG_3DNOW        0x0004 ///< AMD 3DNOW
-#define AV_CPU_FLAG_SSE          0x0008 ///< SSE functions
-#define AV_CPU_FLAG_SSE2         0x0010 ///< PIV SSE2 functions
-#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
-                                        ///< than regular MMX/SSE (e.g. Core1)
-#define AV_CPU_FLAG_3DNOWEXT     0x0020 ///< AMD 3DNowExt
-#define AV_CPU_FLAG_SSE3         0x0040 ///< Prescott SSE3 functions
-#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
-                                        ///< than regular MMX/SSE (e.g. Core1)
-#define AV_CPU_FLAG_SSSE3        0x0080 ///< Conroe SSSE3 functions
-#define AV_CPU_FLAG_ATOM     0x10000000 ///< Atom processor, some SSSE3 instructions are slower
-#define AV_CPU_FLAG_SSE4         0x0100 ///< Penryn SSE4.1 functions
-#define AV_CPU_FLAG_SSE42        0x0200 ///< Nehalem SSE4.2 functions
-#define AV_CPU_FLAG_AVX          0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
-#define AV_CPU_FLAG_XOP          0x0400 ///< Bulldozer XOP functions
-#define AV_CPU_FLAG_FMA4         0x0800 ///< Bulldozer FMA4 functions
-#define AV_CPU_FLAG_CMOV         0x1000 ///< i686 cmov
-#define AV_CPU_FLAG_AVX2         0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't used
-
-#define AV_CPU_FLAG_ALTIVEC      0x0001 ///< standard
-
-#define AV_CPU_FLAG_ARMV5TE      (1 << 0)
-#define AV_CPU_FLAG_ARMV6        (1 << 1)
-#define AV_CPU_FLAG_ARMV6T2      (1 << 2)
-#define AV_CPU_FLAG_VFP          (1 << 3)
-#define AV_CPU_FLAG_VFPV3        (1 << 4)
-#define AV_CPU_FLAG_NEON         (1 << 5)
-
-/**
- * Return the flags which specify extensions supported by the CPU.
- */
-int av_get_cpu_flags(void);
-
-/**
- * Set a mask on flags returned by av_get_cpu_flags().
- * This function is mainly useful for testing.
- *
- * @warning this function is not thread safe.
- */
-void av_set_cpu_flags_mask(int mask);
-
-/**
- * Parse CPU flags from a string.
- *
- * @return a combination of AV_CPU_* flags, negative on error.
- */
-int av_parse_cpu_flags(const char *s);
-
-/**
- * @return the number of logical CPU cores present.
- */
-int av_cpu_count(void);
-
-#endif /* AVUTIL_CPU_H */
diff --git a/deps/libav/libavutil/cpu_internal.h b/deps/libav/libavutil/cpu_internal.h
deleted file mode 100644
index 3bfe8a8..0000000
--- a/deps/libav/libavutil/cpu_internal.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_CPU_INTERNAL_H
-#define AVUTIL_CPU_INTERNAL_H
-
-#include "cpu.h"
-
-#define CPUEXT_SUFFIX(flags, suffix, cpuext)                            \
-    (HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext))
-
-#define CPUEXT(flags, cpuext) CPUEXT_SUFFIX(flags, , cpuext)
-
-int ff_get_cpu_flags_aarch64(void);
-int ff_get_cpu_flags_arm(void);
-int ff_get_cpu_flags_ppc(void);
-int ff_get_cpu_flags_x86(void);
-
-#endif /* AVUTIL_CPU_INTERNAL_H */
diff --git a/deps/libav/libavutil/crc.c b/deps/libav/libavutil/crc.c
deleted file mode 100644
index 2cdf588..0000000
--- a/deps/libav/libavutil/crc.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "common.h"
-#include "bswap.h"
-#include "crc.h"
-
-#if CONFIG_HARDCODED_TABLES
-static const AVCRC av_crc_table[AV_CRC_MAX][257] = {
-    [AV_CRC_8_ATM] = {
-        0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15, 0x38, 0x3F, 0x36, 0x31,
-        0x24, 0x23, 0x2A, 0x2D, 0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65,
-        0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D, 0xE0, 0xE7, 0xEE, 0xE9,
-        0xFC, 0xFB, 0xF2, 0xF5, 0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD,
-        0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85, 0xA8, 0xAF, 0xA6, 0xA1,
-        0xB4, 0xB3, 0xBA, 0xBD, 0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2,
-        0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA, 0xB7, 0xB0, 0xB9, 0xBE,
-        0xAB, 0xAC, 0xA5, 0xA2, 0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A,
-        0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32, 0x1F, 0x18, 0x11, 0x16,
-        0x03, 0x04, 0x0D, 0x0A, 0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42,
-        0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A, 0x89, 0x8E, 0x87, 0x80,
-        0x95, 0x92, 0x9B, 0x9C, 0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4,
-        0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC, 0xC1, 0xC6, 0xCF, 0xC8,
-        0xDD, 0xDA, 0xD3, 0xD4, 0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C,
-        0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44, 0x19, 0x1E, 0x17, 0x10,
-        0x05, 0x02, 0x0B, 0x0C, 0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34,
-        0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B, 0x76, 0x71, 0x78, 0x7F,
-        0x6A, 0x6D, 0x64, 0x63, 0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B,
-        0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13, 0xAE, 0xA9, 0xA0, 0xA7,
-        0xB2, 0xB5, 0xBC, 0xBB, 0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83,
-        0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB, 0xE6, 0xE1, 0xE8, 0xEF,
-        0xFA, 0xFD, 0xF4, 0xF3, 0x01
-    },
-    [AV_CRC_16_ANSI] = {
-        0x0000, 0x0580, 0x0F80, 0x0A00, 0x1B80, 0x1E00, 0x1400, 0x1180,
-        0x3380, 0x3600, 0x3C00, 0x3980, 0x2800, 0x2D80, 0x2780, 0x2200,
-        0x6380, 0x6600, 0x6C00, 0x6980, 0x7800, 0x7D80, 0x7780, 0x7200,
-        0x5000, 0x5580, 0x5F80, 0x5A00, 0x4B80, 0x4E00, 0x4400, 0x4180,
-        0xC380, 0xC600, 0xCC00, 0xC980, 0xD800, 0xDD80, 0xD780, 0xD200,
-        0xF000, 0xF580, 0xFF80, 0xFA00, 0xEB80, 0xEE00, 0xE400, 0xE180,
-        0xA000, 0xA580, 0xAF80, 0xAA00, 0xBB80, 0xBE00, 0xB400, 0xB180,
-        0x9380, 0x9600, 0x9C00, 0x9980, 0x8800, 0x8D80, 0x8780, 0x8200,
-        0x8381, 0x8601, 0x8C01, 0x8981, 0x9801, 0x9D81, 0x9781, 0x9201,
-        0xB001, 0xB581, 0xBF81, 0xBA01, 0xAB81, 0xAE01, 0xA401, 0xA181,
-        0xE001, 0xE581, 0xEF81, 0xEA01, 0xFB81, 0xFE01, 0xF401, 0xF181,
-        0xD381, 0xD601, 0xDC01, 0xD981, 0xC801, 0xCD81, 0xC781, 0xC201,
-        0x4001, 0x4581, 0x4F81, 0x4A01, 0x5B81, 0x5E01, 0x5401, 0x5181,
-        0x7381, 0x7601, 0x7C01, 0x7981, 0x6801, 0x6D81, 0x6781, 0x6201,
-        0x2381, 0x2601, 0x2C01, 0x2981, 0x3801, 0x3D81, 0x3781, 0x3201,
-        0x1001, 0x1581, 0x1F81, 0x1A01, 0x0B81, 0x0E01, 0x0401, 0x0181,
-        0x0383, 0x0603, 0x0C03, 0x0983, 0x1803, 0x1D83, 0x1783, 0x1203,
-        0x3003, 0x3583, 0x3F83, 0x3A03, 0x2B83, 0x2E03, 0x2403, 0x2183,
-        0x6003, 0x6583, 0x6F83, 0x6A03, 0x7B83, 0x7E03, 0x7403, 0x7183,
-        0x5383, 0x5603, 0x5C03, 0x5983, 0x4803, 0x4D83, 0x4783, 0x4203,
-        0xC003, 0xC583, 0xCF83, 0xCA03, 0xDB83, 0xDE03, 0xD403, 0xD183,
-        0xF383, 0xF603, 0xFC03, 0xF983, 0xE803, 0xED83, 0xE783, 0xE203,
-        0xA383, 0xA603, 0xAC03, 0xA983, 0xB803, 0xBD83, 0xB783, 0xB203,
-        0x9003, 0x9583, 0x9F83, 0x9A03, 0x8B83, 0x8E03, 0x8403, 0x8183,
-        0x8002, 0x8582, 0x8F82, 0x8A02, 0x9B82, 0x9E02, 0x9402, 0x9182,
-        0xB382, 0xB602, 0xBC02, 0xB982, 0xA802, 0xAD82, 0xA782, 0xA202,
-        0xE382, 0xE602, 0xEC02, 0xE982, 0xF802, 0xFD82, 0xF782, 0xF202,
-        0xD002, 0xD582, 0xDF82, 0xDA02, 0xCB82, 0xCE02, 0xC402, 0xC182,
-        0x4382, 0x4602, 0x4C02, 0x4982, 0x5802, 0x5D82, 0x5782, 0x5202,
-        0x7002, 0x7582, 0x7F82, 0x7A02, 0x6B82, 0x6E02, 0x6402, 0x6182,
-        0x2002, 0x2582, 0x2F82, 0x2A02, 0x3B82, 0x3E02, 0x3402, 0x3182,
-        0x1382, 0x1602, 0x1C02, 0x1982, 0x0802, 0x0D82, 0x0782, 0x0202,
-        0x0001
-    },
-    [AV_CRC_16_CCITT] = {
-        0x0000, 0x2110, 0x4220, 0x6330, 0x8440, 0xA550, 0xC660, 0xE770,
-        0x0881, 0x2991, 0x4AA1, 0x6BB1, 0x8CC1, 0xADD1, 0xCEE1, 0xEFF1,
-        0x3112, 0x1002, 0x7332, 0x5222, 0xB552, 0x9442, 0xF772, 0xD662,
-        0x3993, 0x1883, 0x7BB3, 0x5AA3, 0xBDD3, 0x9CC3, 0xFFF3, 0xDEE3,
-        0x6224, 0x4334, 0x2004, 0x0114, 0xE664, 0xC774, 0xA444, 0x8554,
-        0x6AA5, 0x4BB5, 0x2885, 0x0995, 0xEEE5, 0xCFF5, 0xACC5, 0x8DD5,
-        0x5336, 0x7226, 0x1116, 0x3006, 0xD776, 0xF666, 0x9556, 0xB446,
-        0x5BB7, 0x7AA7, 0x1997, 0x3887, 0xDFF7, 0xFEE7, 0x9DD7, 0xBCC7,
-        0xC448, 0xE558, 0x8668, 0xA778, 0x4008, 0x6118, 0x0228, 0x2338,
-        0xCCC9, 0xEDD9, 0x8EE9, 0xAFF9, 0x4889, 0x6999, 0x0AA9, 0x2BB9,
-        0xF55A, 0xD44A, 0xB77A, 0x966A, 0x711A, 0x500A, 0x333A, 0x122A,
-        0xFDDB, 0xDCCB, 0xBFFB, 0x9EEB, 0x799B, 0x588B, 0x3BBB, 0x1AAB,
-        0xA66C, 0x877C, 0xE44C, 0xC55C, 0x222C, 0x033C, 0x600C, 0x411C,
-        0xAEED, 0x8FFD, 0xECCD, 0xCDDD, 0x2AAD, 0x0BBD, 0x688D, 0x499D,
-        0x977E, 0xB66E, 0xD55E, 0xF44E, 0x133E, 0x322E, 0x511E, 0x700E,
-        0x9FFF, 0xBEEF, 0xDDDF, 0xFCCF, 0x1BBF, 0x3AAF, 0x599F, 0x788F,
-        0x8891, 0xA981, 0xCAB1, 0xEBA1, 0x0CD1, 0x2DC1, 0x4EF1, 0x6FE1,
-        0x8010, 0xA100, 0xC230, 0xE320, 0x0450, 0x2540, 0x4670, 0x6760,
-        0xB983, 0x9893, 0xFBA3, 0xDAB3, 0x3DC3, 0x1CD3, 0x7FE3, 0x5EF3,
-        0xB102, 0x9012, 0xF322, 0xD232, 0x3542, 0x1452, 0x7762, 0x5672,
-        0xEAB5, 0xCBA5, 0xA895, 0x8985, 0x6EF5, 0x4FE5, 0x2CD5, 0x0DC5,
-        0xE234, 0xC324, 0xA014, 0x8104, 0x6674, 0x4764, 0x2454, 0x0544,
-        0xDBA7, 0xFAB7, 0x9987, 0xB897, 0x5FE7, 0x7EF7, 0x1DC7, 0x3CD7,
-        0xD326, 0xF236, 0x9106, 0xB016, 0x5766, 0x7676, 0x1546, 0x3456,
-        0x4CD9, 0x6DC9, 0x0EF9, 0x2FE9, 0xC899, 0xE989, 0x8AB9, 0xABA9,
-        0x4458, 0x6548, 0x0678, 0x2768, 0xC018, 0xE108, 0x8238, 0xA328,
-        0x7DCB, 0x5CDB, 0x3FEB, 0x1EFB, 0xF98B, 0xD89B, 0xBBAB, 0x9ABB,
-        0x754A, 0x545A, 0x376A, 0x167A, 0xF10A, 0xD01A, 0xB32A, 0x923A,
-        0x2EFD, 0x0FED, 0x6CDD, 0x4DCD, 0xAABD, 0x8BAD, 0xE89D, 0xC98D,
-        0x267C, 0x076C, 0x645C, 0x454C, 0xA23C, 0x832C, 0xE01C, 0xC10C,
-        0x1FEF, 0x3EFF, 0x5DCF, 0x7CDF, 0x9BAF, 0xBABF, 0xD98F, 0xF89F,
-        0x176E, 0x367E, 0x554E, 0x745E, 0x932E, 0xB23E, 0xD10E, 0xF01E,
-        0x0001
-    },
-    [AV_CRC_32_IEEE] = {
-        0x00000000, 0xB71DC104, 0x6E3B8209, 0xD926430D, 0xDC760413, 0x6B6BC517,
-        0xB24D861A, 0x0550471E, 0xB8ED0826, 0x0FF0C922, 0xD6D68A2F, 0x61CB4B2B,
-        0x649B0C35, 0xD386CD31, 0x0AA08E3C, 0xBDBD4F38, 0x70DB114C, 0xC7C6D048,
-        0x1EE09345, 0xA9FD5241, 0xACAD155F, 0x1BB0D45B, 0xC2969756, 0x758B5652,
-        0xC836196A, 0x7F2BD86E, 0xA60D9B63, 0x11105A67, 0x14401D79, 0xA35DDC7D,
-        0x7A7B9F70, 0xCD665E74, 0xE0B62398, 0x57ABE29C, 0x8E8DA191, 0x39906095,
-        0x3CC0278B, 0x8BDDE68F, 0x52FBA582, 0xE5E66486, 0x585B2BBE, 0xEF46EABA,
-        0x3660A9B7, 0x817D68B3, 0x842D2FAD, 0x3330EEA9, 0xEA16ADA4, 0x5D0B6CA0,
-        0x906D32D4, 0x2770F3D0, 0xFE56B0DD, 0x494B71D9, 0x4C1B36C7, 0xFB06F7C3,
-        0x2220B4CE, 0x953D75CA, 0x28803AF2, 0x9F9DFBF6, 0x46BBB8FB, 0xF1A679FF,
-        0xF4F63EE1, 0x43EBFFE5, 0x9ACDBCE8, 0x2DD07DEC, 0x77708634, 0xC06D4730,
-        0x194B043D, 0xAE56C539, 0xAB068227, 0x1C1B4323, 0xC53D002E, 0x7220C12A,
-        0xCF9D8E12, 0x78804F16, 0xA1A60C1B, 0x16BBCD1F, 0x13EB8A01, 0xA4F64B05,
-        0x7DD00808, 0xCACDC90C, 0x07AB9778, 0xB0B6567C, 0x69901571, 0xDE8DD475,
-        0xDBDD936B, 0x6CC0526F, 0xB5E61162, 0x02FBD066, 0xBF469F5E, 0x085B5E5A,
-        0xD17D1D57, 0x6660DC53, 0x63309B4D, 0xD42D5A49, 0x0D0B1944, 0xBA16D840,
-        0x97C6A5AC, 0x20DB64A8, 0xF9FD27A5, 0x4EE0E6A1, 0x4BB0A1BF, 0xFCAD60BB,
-        0x258B23B6, 0x9296E2B2, 0x2F2BAD8A, 0x98366C8E, 0x41102F83, 0xF60DEE87,
-        0xF35DA999, 0x4440689D, 0x9D662B90, 0x2A7BEA94, 0xE71DB4E0, 0x500075E4,
-        0x892636E9, 0x3E3BF7ED, 0x3B6BB0F3, 0x8C7671F7, 0x555032FA, 0xE24DF3FE,
-        0x5FF0BCC6, 0xE8ED7DC2, 0x31CB3ECF, 0x86D6FFCB, 0x8386B8D5, 0x349B79D1,
-        0xEDBD3ADC, 0x5AA0FBD8, 0xEEE00C69, 0x59FDCD6D, 0x80DB8E60, 0x37C64F64,
-        0x3296087A, 0x858BC97E, 0x5CAD8A73, 0xEBB04B77, 0x560D044F, 0xE110C54B,
-        0x38368646, 0x8F2B4742, 0x8A7B005C, 0x3D66C158, 0xE4408255, 0x535D4351,
-        0x9E3B1D25, 0x2926DC21, 0xF0009F2C, 0x471D5E28, 0x424D1936, 0xF550D832,
-        0x2C769B3F, 0x9B6B5A3B, 0x26D61503, 0x91CBD407, 0x48ED970A, 0xFFF0560E,
-        0xFAA01110, 0x4DBDD014, 0x949B9319, 0x2386521D, 0x0E562FF1, 0xB94BEEF5,
-        0x606DADF8, 0xD7706CFC, 0xD2202BE2, 0x653DEAE6, 0xBC1BA9EB, 0x0B0668EF,
-        0xB6BB27D7, 0x01A6E6D3, 0xD880A5DE, 0x6F9D64DA, 0x6ACD23C4, 0xDDD0E2C0,
-        0x04F6A1CD, 0xB3EB60C9, 0x7E8D3EBD, 0xC990FFB9, 0x10B6BCB4, 0xA7AB7DB0,
-        0xA2FB3AAE, 0x15E6FBAA, 0xCCC0B8A7, 0x7BDD79A3, 0xC660369B, 0x717DF79F,
-        0xA85BB492, 0x1F467596, 0x1A163288, 0xAD0BF38C, 0x742DB081, 0xC3307185,
-        0x99908A5D, 0x2E8D4B59, 0xF7AB0854, 0x40B6C950, 0x45E68E4E, 0xF2FB4F4A,
-        0x2BDD0C47, 0x9CC0CD43, 0x217D827B, 0x9660437F, 0x4F460072, 0xF85BC176,
-        0xFD0B8668, 0x4A16476C, 0x93300461, 0x242DC565, 0xE94B9B11, 0x5E565A15,
-        0x87701918, 0x306DD81C, 0x353D9F02, 0x82205E06, 0x5B061D0B, 0xEC1BDC0F,
-        0x51A69337, 0xE6BB5233, 0x3F9D113E, 0x8880D03A, 0x8DD09724, 0x3ACD5620,
-        0xE3EB152D, 0x54F6D429, 0x7926A9C5, 0xCE3B68C1, 0x171D2BCC, 0xA000EAC8,
-        0xA550ADD6, 0x124D6CD2, 0xCB6B2FDF, 0x7C76EEDB, 0xC1CBA1E3, 0x76D660E7,
-        0xAFF023EA, 0x18EDE2EE, 0x1DBDA5F0, 0xAAA064F4, 0x738627F9, 0xC49BE6FD,
-        0x09FDB889, 0xBEE0798D, 0x67C63A80, 0xD0DBFB84, 0xD58BBC9A, 0x62967D9E,
-        0xBBB03E93, 0x0CADFF97, 0xB110B0AF, 0x060D71AB, 0xDF2B32A6, 0x6836F3A2,
-        0x6D66B4BC, 0xDA7B75B8, 0x035D36B5, 0xB440F7B1, 0x00000001
-    },
-    [AV_CRC_32_IEEE_LE] = {
-        0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F,
-        0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
-        0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2,
-        0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
-        0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,
-        0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
-        0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C,
-        0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
-        0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423,
-        0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
-        0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106,
-        0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
-        0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D,
-        0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
-        0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,
-        0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
-        0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7,
-        0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
-        0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA,
-        0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
-        0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81,
-        0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
-        0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84,
-        0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
-        0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,
-        0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
-        0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E,
-        0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
-        0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55,
-        0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
-        0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28,
-        0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
-        0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F,
-        0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
-        0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,
-        0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
-        0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69,
-        0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
-        0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC,
-        0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
-        0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693,
-        0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
-        0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D, 0x00000001
-    },
-};
-#else
-static struct {
-    uint8_t  le;
-    uint8_t  bits;
-    uint32_t poly;
-} av_crc_table_params[AV_CRC_MAX] = {
-    [AV_CRC_8_ATM]      = { 0,  8,       0x07 },
-    [AV_CRC_16_ANSI]    = { 0, 16,     0x8005 },
-    [AV_CRC_16_CCITT]   = { 0, 16,     0x1021 },
-    [AV_CRC_32_IEEE]    = { 0, 32, 0x04C11DB7 },
-    [AV_CRC_32_IEEE_LE] = { 1, 32, 0xEDB88320 },
-};
-static AVCRC av_crc_table[AV_CRC_MAX][257];
-#endif
-
-int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
-{
-    unsigned i, j;
-    uint32_t c;
-
-    if (bits < 8 || bits > 32 || poly >= (1LL << bits))
-        return -1;
-    if (ctx_size != sizeof(AVCRC) * 257 && ctx_size != sizeof(AVCRC) * 1024)
-        return -1;
-
-    for (i = 0; i < 256; i++) {
-        if (le) {
-            for (c = i, j = 0; j < 8; j++)
-                c = (c >> 1) ^ (poly & (-(c & 1)));
-            ctx[i] = c;
-        } else {
-            for (c = i << 24, j = 0; j < 8; j++)
-                c = (c << 1) ^ ((poly << (32 - bits)) & (((int32_t) c) >> 31));
-            ctx[i] = av_bswap32(c);
-        }
-    }
-    ctx[256] = 1;
-#if !CONFIG_SMALL
-    if (ctx_size >= sizeof(AVCRC) * 1024)
-        for (i = 0; i < 256; i++)
-            for (j = 0; j < 3; j++)
-                ctx[256 *(j + 1) + i] =
-                    (ctx[256 * j + i] >> 8) ^ ctx[ctx[256 * j + i] & 0xFF];
-#endif
-
-    return 0;
-}
-
-const AVCRC *av_crc_get_table(AVCRCId crc_id)
-{
-#if !CONFIG_HARDCODED_TABLES
-    if (!av_crc_table[crc_id][FF_ARRAY_ELEMS(av_crc_table[crc_id]) - 1])
-        if (av_crc_init(av_crc_table[crc_id],
-                        av_crc_table_params[crc_id].le,
-                        av_crc_table_params[crc_id].bits,
-                        av_crc_table_params[crc_id].poly,
-                        sizeof(av_crc_table[crc_id])) < 0)
-            return NULL;
-#endif
-    return av_crc_table[crc_id];
-}
-
-uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
-                const uint8_t *buffer, size_t length)
-{
-    const uint8_t *end = buffer + length;
-
-#if !CONFIG_SMALL
-    if (!ctx[256]) {
-        while (((intptr_t) buffer & 3) && buffer < end)
-            crc = ctx[((uint8_t) crc) ^ *buffer++] ^ (crc >> 8);
-
-        while (buffer < end - 3) {
-            crc ^= av_le2ne32(*(const uint32_t *) buffer); buffer += 4;
-            crc = ctx[3 * 256 + ( crc        & 0xFF)] ^
-                  ctx[2 * 256 + ((crc >> 8 ) & 0xFF)] ^
-                  ctx[1 * 256 + ((crc >> 16) & 0xFF)] ^
-                  ctx[0 * 256 + ((crc >> 24)       )];
-        }
-    }
-#endif
-    while (buffer < end)
-        crc = ctx[((uint8_t) crc) ^ *buffer++] ^ (crc >> 8);
-
-    return crc;
-}
-
-#ifdef TEST
-int main(void)
-{
-    uint8_t buf[1999];
-    int i;
-    int p[4][3] = { { AV_CRC_32_IEEE_LE, 0xEDB88320, 0x3D5CDD04 },
-                    { AV_CRC_32_IEEE   , 0x04C11DB7, 0xC0F5BAE0 },
-                    { AV_CRC_16_ANSI   , 0x8005    , 0x1FBB     },
-                    { AV_CRC_8_ATM     , 0x07      , 0xE3       }
-    };
-    const AVCRC *ctx;
-
-    for (i = 0; i < sizeof(buf); i++)
-        buf[i] = i + i * i;
-
-    for (i = 0; i < 4; i++) {
-        ctx = av_crc_get_table(p[i][0]);
-        printf("crc %08X = %X\n", p[i][1], av_crc(ctx, 0, buf, sizeof(buf)));
-    }
-    return 0;
-}
-#endif
diff --git a/deps/libav/libavutil/crc.h b/deps/libav/libavutil/crc.h
deleted file mode 100644
index 0540619..0000000
--- a/deps/libav/libavutil/crc.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_CRC_H
-#define AVUTIL_CRC_H
-
-#include <stdint.h>
-#include <stddef.h>
-#include "attributes.h"
-
-typedef uint32_t AVCRC;
-
-typedef enum {
-    AV_CRC_8_ATM,
-    AV_CRC_16_ANSI,
-    AV_CRC_16_CCITT,
-    AV_CRC_32_IEEE,
-    AV_CRC_32_IEEE_LE,  /*< reversed bitorder version of AV_CRC_32_IEEE */
-    AV_CRC_MAX,         /*< Not part of public API! Do not use outside libavutil. */
-}AVCRCId;
-
-/**
- * Initialize a CRC table.
- * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
- * @param le If 1, the lowest bit represents the coefficient for the highest
- *           exponent of the corresponding polynomial (both for poly and
- *           actual CRC).
- *           If 0, you must swap the CRC parameter and the result of av_crc
- *           if you need the standard representation (can be simplified in
- *           most cases to e.g. bswap16):
- *           av_bswap32(crc << (32-bits))
- * @param bits number of bits for the CRC
- * @param poly generator polynomial without the x**bits coefficient, in the
- *             representation as specified by le
- * @param ctx_size size of ctx in bytes
- * @return <0 on failure
- */
-int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
-
-/**
- * Get an initialized standard CRC table.
- * @param crc_id ID of a standard CRC
- * @return a pointer to the CRC table or NULL on failure
- */
-const AVCRC *av_crc_get_table(AVCRCId crc_id);
-
-/**
- * Calculate the CRC of a block.
- * @param crc CRC of previous blocks if any or initial value for CRC
- * @return CRC updated with the data from the given block
- *
- * @see av_crc_init() "le" parameter
- */
-uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
-                const uint8_t *buffer, size_t length) av_pure;
-
-#endif /* AVUTIL_CRC_H */
diff --git a/deps/libav/libavutil/des.c b/deps/libav/libavutil/des.c
deleted file mode 100644
index ab0fc2f..0000000
--- a/deps/libav/libavutil/des.c
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * DES encryption/decryption
- * Copyright (c) 2007 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <inttypes.h>
-#include "avutil.h"
-#include "common.h"
-#include "intreadwrite.h"
-#include "des.h"
-
-typedef struct AVDES AVDES;
-
-#define T(a, b, c, d, e, f, g, h) 64-a,64-b,64-c,64-d,64-e,64-f,64-g,64-h
-static const uint8_t IP_shuffle[] = {
-    T(58, 50, 42, 34, 26, 18, 10, 2),
-    T(60, 52, 44, 36, 28, 20, 12, 4),
-    T(62, 54, 46, 38, 30, 22, 14, 6),
-    T(64, 56, 48, 40, 32, 24, 16, 8),
-    T(57, 49, 41, 33, 25, 17,  9, 1),
-    T(59, 51, 43, 35, 27, 19, 11, 3),
-    T(61, 53, 45, 37, 29, 21, 13, 5),
-    T(63, 55, 47, 39, 31, 23, 15, 7)
-};
-#undef T
-
-#if CONFIG_SMALL || defined(GENTABLES)
-#define T(a, b, c, d) 32-a,32-b,32-c,32-d
-static const uint8_t P_shuffle[] = {
-    T(16,  7, 20, 21),
-    T(29, 12, 28, 17),
-    T( 1, 15, 23, 26),
-    T( 5, 18, 31, 10),
-    T( 2,  8, 24, 14),
-    T(32, 27,  3,  9),
-    T(19, 13, 30,  6),
-    T(22, 11,  4, 25)
-};
-#undef T
-#endif
-
-#define T(a, b, c, d, e, f, g) 64-a,64-b,64-c,64-d,64-e,64-f,64-g
-static const uint8_t PC1_shuffle[] = {
-    T(57, 49, 41, 33, 25, 17,  9),
-    T( 1, 58, 50, 42, 34, 26, 18),
-    T(10,  2, 59, 51, 43, 35, 27),
-    T(19, 11,  3, 60, 52, 44, 36),
-    T(63, 55, 47, 39, 31, 23, 15),
-    T( 7, 62, 54, 46, 38, 30, 22),
-    T(14,  6, 61, 53, 45, 37, 29),
-    T(21, 13,  5, 28, 20, 12,  4)
-};
-#undef T
-
-#define T(a, b, c, d, e, f) 56-a,56-b,56-c,56-d,56-e,56-f
-static const uint8_t PC2_shuffle[] = {
-    T(14, 17, 11, 24,  1,  5),
-    T( 3, 28, 15,  6, 21, 10),
-    T(23, 19, 12,  4, 26,  8),
-    T(16,  7, 27, 20, 13,  2),
-    T(41, 52, 31, 37, 47, 55),
-    T(30, 40, 51, 45, 33, 48),
-    T(44, 49, 39, 56, 34, 53),
-    T(46, 42, 50, 36, 29, 32)
-};
-#undef T
-
-#if CONFIG_SMALL
-static const uint8_t S_boxes[8][32] = {
-    {
-    0x0e, 0xf4, 0x7d, 0x41, 0xe2, 0x2f, 0xdb, 0x18, 0xa3, 0x6a, 0xc6, 0xbc, 0x95, 0x59, 0x30, 0x87,
-    0xf4, 0xc1, 0x8e, 0x28, 0x4d, 0x96, 0x12, 0x7b, 0x5f, 0xbc, 0x39, 0xe7, 0xa3, 0x0a, 0x65, 0xd0,
-    }, {
-    0x3f, 0xd1, 0x48, 0x7e, 0xf6, 0x2b, 0x83, 0xe4, 0xc9, 0x07, 0x12, 0xad, 0x6c, 0x90, 0xb5, 0x5a,
-    0xd0, 0x8e, 0xa7, 0x1b, 0x3a, 0xf4, 0x4d, 0x21, 0xb5, 0x68, 0x7c, 0xc6, 0x09, 0x53, 0xe2, 0x9f,
-    }, {
-    0xda, 0x70, 0x09, 0x9e, 0x36, 0x43, 0x6f, 0xa5, 0x21, 0x8d, 0x5c, 0xe7, 0xcb, 0xb4, 0xf2, 0x18,
-    0x1d, 0xa6, 0xd4, 0x09, 0x68, 0x9f, 0x83, 0x70, 0x4b, 0xf1, 0xe2, 0x3c, 0xb5, 0x5a, 0x2e, 0xc7,
-    }, {
-    0xd7, 0x8d, 0xbe, 0x53, 0x60, 0xf6, 0x09, 0x3a, 0x41, 0x72, 0x28, 0xc5, 0x1b, 0xac, 0xe4, 0x9f,
-    0x3a, 0xf6, 0x09, 0x60, 0xac, 0x1b, 0xd7, 0x8d, 0x9f, 0x41, 0x53, 0xbe, 0xc5, 0x72, 0x28, 0xe4,
-    }, {
-    0xe2, 0xbc, 0x24, 0xc1, 0x47, 0x7a, 0xdb, 0x16, 0x58, 0x05, 0xf3, 0xaf, 0x3d, 0x90, 0x8e, 0x69,
-    0xb4, 0x82, 0xc1, 0x7b, 0x1a, 0xed, 0x27, 0xd8, 0x6f, 0xf9, 0x0c, 0x95, 0xa6, 0x43, 0x50, 0x3e,
-    }, {
-    0xac, 0xf1, 0x4a, 0x2f, 0x79, 0xc2, 0x96, 0x58, 0x60, 0x1d, 0xd3, 0xe4, 0x0e, 0xb7, 0x35, 0x8b,
-    0x49, 0x3e, 0x2f, 0xc5, 0x92, 0x58, 0xfc, 0xa3, 0xb7, 0xe0, 0x14, 0x7a, 0x61, 0x0d, 0x8b, 0xd6,
-    }, {
-    0xd4, 0x0b, 0xb2, 0x7e, 0x4f, 0x90, 0x18, 0xad, 0xe3, 0x3c, 0x59, 0xc7, 0x25, 0xfa, 0x86, 0x61,
-    0x61, 0xb4, 0xdb, 0x8d, 0x1c, 0x43, 0xa7, 0x7e, 0x9a, 0x5f, 0x06, 0xf8, 0xe0, 0x25, 0x39, 0xc2,
-    }, {
-    0x1d, 0xf2, 0xd8, 0x84, 0xa6, 0x3f, 0x7b, 0x41, 0xca, 0x59, 0x63, 0xbe, 0x05, 0xe0, 0x9c, 0x27,
-    0x27, 0x1b, 0xe4, 0x71, 0x49, 0xac, 0x8e, 0xd2, 0xf0, 0xc6, 0x9a, 0x0d, 0x3f, 0x53, 0x65, 0xb8,
-    }
-};
-#else
-/**
- * This table contains the results of applying both the S-box and P-shuffle.
- * It can be regenerated by compiling this file with -DCONFIG_SMALL -DTEST -DGENTABLES
- */
-static const uint32_t S_boxes_P_shuffle[8][64] = {
-    {
-    0x00808200, 0x00000000, 0x00008000, 0x00808202, 0x00808002, 0x00008202, 0x00000002, 0x00008000,
-    0x00000200, 0x00808200, 0x00808202, 0x00000200, 0x00800202, 0x00808002, 0x00800000, 0x00000002,
-    0x00000202, 0x00800200, 0x00800200, 0x00008200, 0x00008200, 0x00808000, 0x00808000, 0x00800202,
-    0x00008002, 0x00800002, 0x00800002, 0x00008002, 0x00000000, 0x00000202, 0x00008202, 0x00800000,
-    0x00008000, 0x00808202, 0x00000002, 0x00808000, 0x00808200, 0x00800000, 0x00800000, 0x00000200,
-    0x00808002, 0x00008000, 0x00008200, 0x00800002, 0x00000200, 0x00000002, 0x00800202, 0x00008202,
-    0x00808202, 0x00008002, 0x00808000, 0x00800202, 0x00800002, 0x00000202, 0x00008202, 0x00808200,
-    0x00000202, 0x00800200, 0x00800200, 0x00000000, 0x00008002, 0x00008200, 0x00000000, 0x00808002,
-    },
-    {
-    0x40084010, 0x40004000, 0x00004000, 0x00084010, 0x00080000, 0x00000010, 0x40080010, 0x40004010,
-    0x40000010, 0x40084010, 0x40084000, 0x40000000, 0x40004000, 0x00080000, 0x00000010, 0x40080010,
-    0x00084000, 0x00080010, 0x40004010, 0x00000000, 0x40000000, 0x00004000, 0x00084010, 0x40080000,
-    0x00080010, 0x40000010, 0x00000000, 0x00084000, 0x00004010, 0x40084000, 0x40080000, 0x00004010,
-    0x00000000, 0x00084010, 0x40080010, 0x00080000, 0x40004010, 0x40080000, 0x40084000, 0x00004000,
-    0x40080000, 0x40004000, 0x00000010, 0x40084010, 0x00084010, 0x00000010, 0x00004000, 0x40000000,
-    0x00004010, 0x40084000, 0x00080000, 0x40000010, 0x00080010, 0x40004010, 0x40000010, 0x00080010,
-    0x00084000, 0x00000000, 0x40004000, 0x00004010, 0x40000000, 0x40080010, 0x40084010, 0x00084000,
-    },
-    {
-    0x00000104, 0x04010100, 0x00000000, 0x04010004, 0x04000100, 0x00000000, 0x00010104, 0x04000100,
-    0x00010004, 0x04000004, 0x04000004, 0x00010000, 0x04010104, 0x00010004, 0x04010000, 0x00000104,
-    0x04000000, 0x00000004, 0x04010100, 0x00000100, 0x00010100, 0x04010000, 0x04010004, 0x00010104,
-    0x04000104, 0x00010100, 0x00010000, 0x04000104, 0x00000004, 0x04010104, 0x00000100, 0x04000000,
-    0x04010100, 0x04000000, 0x00010004, 0x00000104, 0x00010000, 0x04010100, 0x04000100, 0x00000000,
-    0x00000100, 0x00010004, 0x04010104, 0x04000100, 0x04000004, 0x00000100, 0x00000000, 0x04010004,
-    0x04000104, 0x00010000, 0x04000000, 0x04010104, 0x00000004, 0x00010104, 0x00010100, 0x04000004,
-    0x04010000, 0x04000104, 0x00000104, 0x04010000, 0x00010104, 0x00000004, 0x04010004, 0x00010100,
-    },
-    {
-    0x80401000, 0x80001040, 0x80001040, 0x00000040, 0x00401040, 0x80400040, 0x80400000, 0x80001000,
-    0x00000000, 0x00401000, 0x00401000, 0x80401040, 0x80000040, 0x00000000, 0x00400040, 0x80400000,
-    0x80000000, 0x00001000, 0x00400000, 0x80401000, 0x00000040, 0x00400000, 0x80001000, 0x00001040,
-    0x80400040, 0x80000000, 0x00001040, 0x00400040, 0x00001000, 0x00401040, 0x80401040, 0x80000040,
-    0x00400040, 0x80400000, 0x00401000, 0x80401040, 0x80000040, 0x00000000, 0x00000000, 0x00401000,
-    0x00001040, 0x00400040, 0x80400040, 0x80000000, 0x80401000, 0x80001040, 0x80001040, 0x00000040,
-    0x80401040, 0x80000040, 0x80000000, 0x00001000, 0x80400000, 0x80001000, 0x00401040, 0x80400040,
-    0x80001000, 0x00001040, 0x00400000, 0x80401000, 0x00000040, 0x00400000, 0x00001000, 0x00401040,
-    },
-    {
-    0x00000080, 0x01040080, 0x01040000, 0x21000080, 0x00040000, 0x00000080, 0x20000000, 0x01040000,
-    0x20040080, 0x00040000, 0x01000080, 0x20040080, 0x21000080, 0x21040000, 0x00040080, 0x20000000,
-    0x01000000, 0x20040000, 0x20040000, 0x00000000, 0x20000080, 0x21040080, 0x21040080, 0x01000080,
-    0x21040000, 0x20000080, 0x00000000, 0x21000000, 0x01040080, 0x01000000, 0x21000000, 0x00040080,
-    0x00040000, 0x21000080, 0x00000080, 0x01000000, 0x20000000, 0x01040000, 0x21000080, 0x20040080,
-    0x01000080, 0x20000000, 0x21040000, 0x01040080, 0x20040080, 0x00000080, 0x01000000, 0x21040000,
-    0x21040080, 0x00040080, 0x21000000, 0x21040080, 0x01040000, 0x00000000, 0x20040000, 0x21000000,
-    0x00040080, 0x01000080, 0x20000080, 0x00040000, 0x00000000, 0x20040000, 0x01040080, 0x20000080,
-    },
-    {
-    0x10000008, 0x10200000, 0x00002000, 0x10202008, 0x10200000, 0x00000008, 0x10202008, 0x00200000,
-    0x10002000, 0x00202008, 0x00200000, 0x10000008, 0x00200008, 0x10002000, 0x10000000, 0x00002008,
-    0x00000000, 0x00200008, 0x10002008, 0x00002000, 0x00202000, 0x10002008, 0x00000008, 0x10200008,
-    0x10200008, 0x00000000, 0x00202008, 0x10202000, 0x00002008, 0x00202000, 0x10202000, 0x10000000,
-    0x10002000, 0x00000008, 0x10200008, 0x00202000, 0x10202008, 0x00200000, 0x00002008, 0x10000008,
-    0x00200000, 0x10002000, 0x10000000, 0x00002008, 0x10000008, 0x10202008, 0x00202000, 0x10200000,
-    0x00202008, 0x10202000, 0x00000000, 0x10200008, 0x00000008, 0x00002000, 0x10200000, 0x00202008,
-    0x00002000, 0x00200008, 0x10002008, 0x00000000, 0x10202000, 0x10000000, 0x00200008, 0x10002008,
-    },
-    {
-    0x00100000, 0x02100001, 0x02000401, 0x00000000, 0x00000400, 0x02000401, 0x00100401, 0x02100400,
-    0x02100401, 0x00100000, 0x00000000, 0x02000001, 0x00000001, 0x02000000, 0x02100001, 0x00000401,
-    0x02000400, 0x00100401, 0x00100001, 0x02000400, 0x02000001, 0x02100000, 0x02100400, 0x00100001,
-    0x02100000, 0x00000400, 0x00000401, 0x02100401, 0x00100400, 0x00000001, 0x02000000, 0x00100400,
-    0x02000000, 0x00100400, 0x00100000, 0x02000401, 0x02000401, 0x02100001, 0x02100001, 0x00000001,
-    0x00100001, 0x02000000, 0x02000400, 0x00100000, 0x02100400, 0x00000401, 0x00100401, 0x02100400,
-    0x00000401, 0x02000001, 0x02100401, 0x02100000, 0x00100400, 0x00000000, 0x00000001, 0x02100401,
-    0x00000000, 0x00100401, 0x02100000, 0x00000400, 0x02000001, 0x02000400, 0x00000400, 0x00100001,
-    },
-    {
-    0x08000820, 0x00000800, 0x00020000, 0x08020820, 0x08000000, 0x08000820, 0x00000020, 0x08000000,
-    0x00020020, 0x08020000, 0x08020820, 0x00020800, 0x08020800, 0x00020820, 0x00000800, 0x00000020,
-    0x08020000, 0x08000020, 0x08000800, 0x00000820, 0x00020800, 0x00020020, 0x08020020, 0x08020800,
-    0x00000820, 0x00000000, 0x00000000, 0x08020020, 0x08000020, 0x08000800, 0x00020820, 0x00020000,
-    0x00020820, 0x00020000, 0x08020800, 0x00000800, 0x00000020, 0x08020020, 0x00000800, 0x00020820,
-    0x08000800, 0x00000020, 0x08000020, 0x08020000, 0x08020020, 0x08000000, 0x00020000, 0x08000820,
-    0x00000000, 0x08020820, 0x00020020, 0x08000020, 0x08020000, 0x08000800, 0x08000820, 0x00000000,
-    0x08020820, 0x00020800, 0x00020800, 0x00000820, 0x00000820, 0x00020020, 0x08000000, 0x08020800,
-    },
-};
-#endif
-
-static uint64_t shuffle(uint64_t in, const uint8_t *shuffle, int shuffle_len) {
-    int i;
-    uint64_t res = 0;
-    for (i = 0; i < shuffle_len; i++)
-        res += res + ((in >> *shuffle++) & 1);
-    return res;
-}
-
-static uint64_t shuffle_inv(uint64_t in, const uint8_t *shuffle, int shuffle_len) {
-    int i;
-    uint64_t res = 0;
-    shuffle += shuffle_len - 1;
-    for (i = 0; i < shuffle_len; i++) {
-        res |= (in & 1) << *shuffle--;
-        in >>= 1;
-    }
-    return res;
-}
-
-static uint32_t f_func(uint32_t r, uint64_t k) {
-    int i;
-    uint32_t out = 0;
-    // rotate to get first part of E-shuffle in the lowest 6 bits
-    r = (r << 1) | (r >> 31);
-    // apply S-boxes, those compress the data again from 8 * 6 to 8 * 4 bits
-    for (i = 7; i >= 0; i--) {
-        uint8_t tmp = (r ^ k) & 0x3f;
-#if CONFIG_SMALL
-        uint8_t v = S_boxes[i][tmp >> 1];
-        if (tmp & 1) v >>= 4;
-        out = (out >> 4) | (v << 28);
-#else
-        out |= S_boxes_P_shuffle[i][tmp];
-#endif
-        // get next 6 bits of E-shuffle and round key k into the lowest bits
-        r = (r >> 4) | (r << 28);
-        k >>= 6;
-    }
-#if CONFIG_SMALL
-    out = shuffle(out, P_shuffle, sizeof(P_shuffle));
-#endif
-    return out;
-}
-
-/**
- * @brief rotate the two halves of the expanded 56 bit key each 1 bit left
- *
- * Note: the specification calls this "shift", so I kept it although
- * it is confusing.
- */
-static uint64_t key_shift_left(uint64_t CDn) {
-    uint64_t carries = (CDn >> 27) & 0x10000001;
-    CDn <<= 1;
-    CDn &= ~0x10000001;
-    CDn |= carries;
-    return CDn;
-}
-
-static void gen_roundkeys(uint64_t K[16], uint64_t key) {
-    int i;
-    // discard parity bits from key and shuffle it into C and D parts
-    uint64_t CDn = shuffle(key, PC1_shuffle, sizeof(PC1_shuffle));
-    // generate round keys
-    for (i = 0; i < 16; i++) {
-        CDn = key_shift_left(CDn);
-        if (i > 1 && i != 8 && i != 15)
-            CDn = key_shift_left(CDn);
-        K[i] = shuffle(CDn, PC2_shuffle, sizeof(PC2_shuffle));
-    }
-}
-
-static uint64_t des_encdec(uint64_t in, uint64_t K[16], int decrypt) {
-    int i;
-    // used to apply round keys in reverse order for decryption
-    decrypt = decrypt ? 15 : 0;
-    // shuffle irrelevant to security but to ease hardware implementations
-    in = shuffle(in, IP_shuffle, sizeof(IP_shuffle));
-    for (i = 0; i < 16; i++) {
-        uint32_t f_res;
-        f_res = f_func(in, K[decrypt ^ i]);
-        in = (in << 32) | (in >> 32);
-        in ^= f_res;
-    }
-    in = (in << 32) | (in >> 32);
-    // reverse shuffle used to ease hardware implementations
-    in = shuffle_inv(in, IP_shuffle, sizeof(IP_shuffle));
-    return in;
-}
-
-int av_des_init(AVDES *d, const uint8_t *key, int key_bits, int decrypt) {
-    if (key_bits != 64 && key_bits != 192)
-        return -1;
-    d->triple_des = key_bits > 64;
-    gen_roundkeys(d->round_keys[0], AV_RB64(key));
-    if (d->triple_des) {
-        gen_roundkeys(d->round_keys[1], AV_RB64(key +  8));
-        gen_roundkeys(d->round_keys[2], AV_RB64(key + 16));
-    }
-    return 0;
-}
-
-static void av_des_crypt_mac(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt, int mac) {
-    uint64_t iv_val = iv ? AV_RB64(iv) : 0;
-    while (count-- > 0) {
-        uint64_t dst_val;
-        uint64_t src_val = src ? AV_RB64(src) : 0;
-        if (decrypt) {
-            uint64_t tmp = src_val;
-            if (d->triple_des) {
-                src_val = des_encdec(src_val, d->round_keys[2], 1);
-                src_val = des_encdec(src_val, d->round_keys[1], 0);
-            }
-            dst_val = des_encdec(src_val, d->round_keys[0], 1) ^ iv_val;
-            iv_val = iv ? tmp : 0;
-        } else {
-            dst_val = des_encdec(src_val ^ iv_val, d->round_keys[0], 0);
-            if (d->triple_des) {
-                dst_val = des_encdec(dst_val, d->round_keys[1], 1);
-                dst_val = des_encdec(dst_val, d->round_keys[2], 0);
-            }
-            iv_val = iv ? dst_val : 0;
-        }
-        AV_WB64(dst, dst_val);
-        src += 8;
-        if (!mac)
-            dst += 8;
-    }
-    if (iv)
-        AV_WB64(iv, iv_val);
-}
-
-void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt) {
-    av_des_crypt_mac(d, dst, src, count, iv, decrypt, 0);
-}
-
-void av_des_mac(AVDES *d, uint8_t *dst, const uint8_t *src, int count) {
-    av_des_crypt_mac(d, dst, src, count, (uint8_t[8]){0}, 0, 1);
-}
-
-#ifdef TEST
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "time.h"
-
-static uint64_t rand64(void) {
-    uint64_t r = rand();
-    r = (r << 32) | rand();
-    return r;
-}
-
-static const uint8_t test_key[] = {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0};
-static const DECLARE_ALIGNED(8, uint8_t, plain)[] = {0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10};
-static const DECLARE_ALIGNED(8, uint8_t, crypt)[] = {0x4a, 0xb6, 0x5b, 0x3d, 0x4b, 0x06, 0x15, 0x18};
-static DECLARE_ALIGNED(8, uint8_t, tmp)[8];
-static DECLARE_ALIGNED(8, uint8_t, large_buffer)[10002][8];
-static const uint8_t cbc_key[] = {
-    0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
-    0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01,
-    0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23
-};
-
-static int run_test(int cbc, int decrypt) {
-    AVDES d;
-    int delay = cbc && !decrypt ? 2 : 1;
-    uint64_t res;
-    AV_WB64(large_buffer[0], 0x4e6f772069732074ULL);
-    AV_WB64(large_buffer[1], 0x1234567890abcdefULL);
-    AV_WB64(tmp,             0x1234567890abcdefULL);
-    av_des_init(&d, cbc_key, 192, decrypt);
-    av_des_crypt(&d, large_buffer[delay], large_buffer[0], 10000, cbc ? tmp : NULL, decrypt);
-    res = AV_RB64(large_buffer[9999 + delay]);
-    if (cbc) {
-        if (decrypt)
-            return res == 0xc5cecf63ecec514cULL;
-        else
-            return res == 0xcb191f85d1ed8439ULL;
-    } else {
-        if (decrypt)
-            return res == 0x8325397644091a0aULL;
-        else
-            return res == 0xdd17e8b8b437d232ULL;
-    }
-}
-
-int main(void) {
-    AVDES d;
-    int i;
-#ifdef GENTABLES
-    int j;
-#endif
-    uint64_t key[3];
-    uint64_t data;
-    uint64_t ct;
-    uint64_t roundkeys[16];
-    srand(av_gettime());
-    key[0] = AV_RB64(test_key);
-    data = AV_RB64(plain);
-    gen_roundkeys(roundkeys, key[0]);
-    if (des_encdec(data, roundkeys, 0) != AV_RB64(crypt)) {
-        printf("Test 1 failed\n");
-        return 1;
-    }
-    av_des_init(&d, test_key, 64, 0);
-    av_des_crypt(&d, tmp, plain, 1, NULL, 0);
-    if (memcmp(tmp, crypt, sizeof(crypt))) {
-        printf("Public API decryption failed\n");
-        return 1;
-    }
-    if (!run_test(0, 0) || !run_test(0, 1) || !run_test(1, 0) || !run_test(1, 1)) {
-        printf("Partial Monte-Carlo test failed\n");
-        return 1;
-    }
-    for (i = 0; i < 1000; i++) {
-        key[0] = rand64(); key[1] = rand64(); key[2] = rand64();
-        data = rand64();
-        av_des_init(&d, key, 192, 0);
-        av_des_crypt(&d, &ct, &data, 1, NULL, 0);
-        av_des_init(&d, key, 192, 1);
-        av_des_crypt(&d, &ct, &ct, 1, NULL, 1);
-        if (ct != data) {
-            printf("Test 2 failed\n");
-            return 1;
-        }
-    }
-#ifdef GENTABLES
-    printf("static const uint32_t S_boxes_P_shuffle[8][64] = {\n");
-    for (i = 0; i < 8; i++) {
-        printf("    {");
-        for (j = 0; j < 64; j++) {
-            uint32_t v = S_boxes[i][j >> 1];
-            v = j & 1 ? v >> 4 : v & 0xf;
-            v <<= 28 - 4 * i;
-            v = shuffle(v, P_shuffle, sizeof(P_shuffle));
-            printf((j & 7) == 0 ? "\n    " : " ");
-            printf("0x%08X,", v);
-        }
-        printf("\n    },\n");
-    }
-    printf("};\n");
-#endif
-    return 0;
-}
-#endif
diff --git a/deps/libav/libavutil/des.h b/deps/libav/libavutil/des.h
deleted file mode 100644
index cda9812..0000000
--- a/deps/libav/libavutil/des.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * DES encryption/decryption
- * Copyright (c) 2007 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_DES_H
-#define AVUTIL_DES_H
-
-#include <stdint.h>
-
-struct AVDES {
-    uint64_t round_keys[3][16];
-    int triple_des;
-};
-
-/**
- * @brief Initializes an AVDES context.
- *
- * @param key_bits must be 64 or 192
- * @param decrypt 0 for encryption/CBC-MAC, 1 for decryption
- */
-int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt);
-
-/**
- * @brief Encrypts / decrypts using the DES algorithm.
- *
- * @param count number of 8 byte blocks
- * @param dst destination array, can be equal to src, must be 8-byte aligned
- * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
- * @param iv initialization vector for CBC mode, if NULL then ECB will be used,
- *           must be 8-byte aligned
- * @param decrypt 0 for encryption, 1 for decryption
- */
-void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
-
-/**
- * @brief Calculates CBC-MAC using the DES algorithm.
- *
- * @param count number of 8 byte blocks
- * @param dst destination array, can be equal to src, must be 8-byte aligned
- * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
- */
-void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);
-
-#endif /* AVUTIL_DES_H */
diff --git a/deps/libav/libavutil/dict.c b/deps/libav/libavutil/dict.c
deleted file mode 100644
index 9ac4831..0000000
--- a/deps/libav/libavutil/dict.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * copyright (c) 2009 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "avstring.h"
-#include "dict.h"
-#include "internal.h"
-#include "mem.h"
-
-struct AVDictionary {
-    int count;
-    AVDictionaryEntry *elems;
-};
-
-int av_dict_count(const AVDictionary *m)
-{
-    return m ? m->count : 0;
-}
-
-AVDictionaryEntry *
-av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
-{
-    unsigned int i, j;
-
-    if(!m)
-        return NULL;
-
-    if(prev) i= prev - m->elems + 1;
-    else     i= 0;
-
-    for(; i<m->count; i++){
-        const char *s= m->elems[i].key;
-        if(flags & AV_DICT_MATCH_CASE) for(j=0;         s[j]  ==         key[j]  && key[j]; j++);
-        else                               for(j=0; av_toupper(s[j]) == av_toupper(key[j]) && key[j]; j++);
-        if(key[j])
-            continue;
-        if(s[j] && !(flags & AV_DICT_IGNORE_SUFFIX))
-            continue;
-        return &m->elems[i];
-    }
-    return NULL;
-}
-
-int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
-{
-    AVDictionary      *m = *pm;
-    AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags);
-    char *oldval = NULL;
-
-    if(!m)
-        m = *pm = av_mallocz(sizeof(*m));
-
-    if(tag) {
-        if (flags & AV_DICT_DONT_OVERWRITE)
-            return 0;
-        if (flags & AV_DICT_APPEND)
-            oldval = tag->value;
-        else
-            av_free(tag->value);
-        av_free(tag->key);
-        *tag = m->elems[--m->count];
-    } else {
-        AVDictionaryEntry *tmp = av_realloc(m->elems, (m->count+1) * sizeof(*m->elems));
-        if(tmp) {
-            m->elems = tmp;
-        } else
-            return AVERROR(ENOMEM);
-    }
-    if (value) {
-        if (flags & AV_DICT_DONT_STRDUP_KEY) {
-            m->elems[m->count].key  = key;
-        } else
-        m->elems[m->count].key  = av_strdup(key  );
-        if (flags & AV_DICT_DONT_STRDUP_VAL) {
-            m->elems[m->count].value = value;
-        } else if (oldval && flags & AV_DICT_APPEND) {
-            int len = strlen(oldval) + strlen(value) + 1;
-            if (!(oldval = av_realloc(oldval, len)))
-                return AVERROR(ENOMEM);
-            av_strlcat(oldval, value, len);
-            m->elems[m->count].value = oldval;
-        } else
-            m->elems[m->count].value = av_strdup(value);
-        m->count++;
-    }
-    if (!m->count) {
-        av_free(m->elems);
-        av_freep(pm);
-    }
-
-    return 0;
-}
-
-static int parse_key_value_pair(AVDictionary **pm, const char **buf,
-                                const char *key_val_sep, const char *pairs_sep,
-                                int flags)
-{
-    char *key = av_get_token(buf, key_val_sep);
-    char *val = NULL;
-    int ret;
-
-    if (key && *key && strspn(*buf, key_val_sep)) {
-        (*buf)++;
-        val = av_get_token(buf, pairs_sep);
-    }
-
-    if (key && *key && val && *val)
-        ret = av_dict_set(pm, key, val, flags);
-    else
-        ret = AVERROR(EINVAL);
-
-    av_freep(&key);
-    av_freep(&val);
-
-    return ret;
-}
-
-int av_dict_parse_string(AVDictionary **pm, const char *str,
-                         const char *key_val_sep, const char *pairs_sep,
-                         int flags)
-{
-    int ret;
-
-    if (!str)
-        return 0;
-
-    /* ignore STRDUP flags */
-    flags &= ~(AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
-
-    while (*str) {
-        if ((ret = parse_key_value_pair(pm, &str, key_val_sep, pairs_sep, flags)) < 0)
-            return ret;
-
-        if (*str)
-            str++;
-    }
-
-    return 0;
-}
-
-void av_dict_free(AVDictionary **pm)
-{
-    AVDictionary *m = *pm;
-
-    if (m) {
-        while(m->count--) {
-            av_free(m->elems[m->count].key);
-            av_free(m->elems[m->count].value);
-        }
-        av_free(m->elems);
-    }
-    av_freep(pm);
-}
-
-void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags)
-{
-    AVDictionaryEntry *t = NULL;
-
-    while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX)))
-        av_dict_set(dst, t->key, t->value, flags);
-}
diff --git a/deps/libav/libavutil/dict.h b/deps/libav/libavutil/dict.h
deleted file mode 100644
index e0a91ae..0000000
--- a/deps/libav/libavutil/dict.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Public dictionary API.
- */
-
-#ifndef AVUTIL_DICT_H
-#define AVUTIL_DICT_H
-
-/**
- * @addtogroup lavu_dict AVDictionary
- * @ingroup lavu_data
- *
- * @brief Simple key:value store
- *
- * @{
- * Dictionaries are used for storing key:value pairs. To create
- * an AVDictionary, simply pass an address of a NULL pointer to
- * av_dict_set(). NULL can be used as an empty dictionary wherever
- * a pointer to an AVDictionary is required.
- * Use av_dict_get() to retrieve an entry or iterate over all
- * entries and finally av_dict_free() to free the dictionary
- * and all its contents.
- *
- @code
-   AVDictionary *d = NULL;           // "create" an empty dictionary
-   AVDictionaryEntry *t = NULL;
-
-   av_dict_set(&d, "foo", "bar", 0); // add an entry
-
-   char *k = av_strdup("key");       // if your strings are already allocated,
-   char *v = av_strdup("value");     // you can avoid copying them like this
-   av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
-
-   while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
-       <....>                             // iterate over all entries in d
-   }
-   av_dict_free(&d);
- @endcode
- *
- */
-
-#define AV_DICT_MATCH_CASE      1
-#define AV_DICT_IGNORE_SUFFIX   2
-#define AV_DICT_DONT_STRDUP_KEY 4   /**< Take ownership of a key that's been
-                                         allocated with av_malloc() and children. */
-#define AV_DICT_DONT_STRDUP_VAL 8   /**< Take ownership of a value that's been
-                                         allocated with av_malloc() and chilren. */
-#define AV_DICT_DONT_OVERWRITE 16   ///< Don't overwrite existing entries.
-#define AV_DICT_APPEND         32   /**< If the entry already exists, append to it.  Note that no
-                                      delimiter is added, the strings are simply concatenated. */
-
-typedef struct AVDictionaryEntry {
-    char *key;
-    char *value;
-} AVDictionaryEntry;
-
-typedef struct AVDictionary AVDictionary;
-
-/**
- * Get a dictionary entry with matching key.
- *
- * @param prev Set to the previous matching element to find the next.
- *             If set to NULL the first matching element is returned.
- * @param flags Allows case as well as suffix-insensitive comparisons.
- * @return Found entry or NULL, changing key or value leads to undefined behavior.
- */
-AVDictionaryEntry *
-av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
-
-/**
- * Get number of entries in dictionary.
- *
- * @param m dictionary
- * @return  number of entries in dictionary
- */
-int av_dict_count(const AVDictionary *m);
-
-/**
- * Set the given entry in *pm, overwriting an existing entry.
- *
- * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL
- * a dictionary struct is allocated and put in *pm.
- * @param key entry key to add to *pm (will be av_strduped depending on flags)
- * @param value entry value to add to *pm (will be av_strduped depending on flags).
- *        Passing a NULL value will cause an existing entry to be deleted.
- * @return >= 0 on success otherwise an error code <0
- */
-int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
-
-/**
- * Parse the key/value pairs list and add to a dictionary.
- *
- * @param key_val_sep  a 0-terminated list of characters used to separate
- *                     key from value
- * @param pairs_sep    a 0-terminated list of characters used to separate
- *                     two pairs from each other
- * @param flags        flags to use when adding to dictionary.
- *                     AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL
- *                     are ignored since the key/value tokens will always
- *                     be duplicated.
- * @return             0 on success, negative AVERROR code on failure
- */
-int av_dict_parse_string(AVDictionary **pm, const char *str,
-                         const char *key_val_sep, const char *pairs_sep,
-                         int flags);
-
-/**
- * Copy entries from one AVDictionary struct into another.
- * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
- *            this function will allocate a struct for you and put it in *dst
- * @param src pointer to source AVDictionary struct
- * @param flags flags to use when setting entries in *dst
- * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
- */
-void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
-
-/**
- * Free all the memory allocated for an AVDictionary struct
- * and all keys and values.
- */
-void av_dict_free(AVDictionary **m);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_DICT_H */
diff --git a/deps/libav/libavutil/downmix_info.c b/deps/libav/libavutil/downmix_info.c
deleted file mode 100644
index 51505c8..0000000
--- a/deps/libav/libavutil/downmix_info.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2014 Tim Walker <tdskywalker at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "downmix_info.h"
-#include "frame.h"
-
-AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame)
-{
-    AVFrameSideData *side_data;
-
-    side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_DOWNMIX_INFO);
-
-    if (!side_data)
-        side_data = av_frame_new_side_data(frame, AV_FRAME_DATA_DOWNMIX_INFO,
-                                           sizeof(AVDownmixInfo));
-
-    if (!side_data)
-        return NULL;
-
-    return (AVDownmixInfo*)side_data->data;
-}
diff --git a/deps/libav/libavutil/downmix_info.h b/deps/libav/libavutil/downmix_info.h
deleted file mode 100644
index 69969f6..0000000
--- a/deps/libav/libavutil/downmix_info.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2014 Tim Walker <tdskywalker at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_DOWNMIX_INFO_H
-#define AVUTIL_DOWNMIX_INFO_H
-
-#include "frame.h"
-
-/**
- * @file
- * audio downmix medatata
- */
-
-/**
- * @addtogroup lavu_audio
- * @{
- */
-
-/**
- * @defgroup downmix_info Audio downmix metadata
- * @{
- */
-
-/**
- * Possible downmix types.
- */
-enum AVDownmixType {
-    AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */
-    AV_DOWNMIX_TYPE_LORO,    /**< Lo/Ro 2-channel downmix (Stereo). */
-    AV_DOWNMIX_TYPE_LTRT,    /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */
-    AV_DOWNMIX_TYPE_DPLII,   /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */
-    AV_DOWNMIX_TYPE_NB       /**< Number of downmix types. Not part of ABI. */
-};
-
-/**
- * This structure describes optional metadata relevant to a downmix procedure.
- *
- * All fields are set by the decoder to the value indicated in the audio
- * bitstream (if present), or to a "sane" default otherwise.
- */
-typedef struct AVDownmixInfo {
-    /**
-     * Type of downmix preferred by the mastering engineer.
-     */
-    enum AVDownmixType preferred_downmix_type;
-
-    /**
-     * Absolute scale factor representing the nominal level of the center
-     * channel during a regular downmix.
-     */
-    double center_mix_level;
-
-    /**
-     * Absolute scale factor representing the nominal level of the center
-     * channel during an Lt/Rt compatible downmix.
-     */
-    double center_mix_level_ltrt;
-
-    /**
-     * Absolute scale factor representing the nominal level of the surround
-     * channels during a regular downmix.
-     */
-    double surround_mix_level;
-
-    /**
-     * Absolute scale factor representing the nominal level of the surround
-     * channels during an Lt/Rt compatible downmix.
-     */
-    double surround_mix_level_ltrt;
-
-    /**
-     * Absolute scale factor representing the level at which the LFE data is
-     * mixed into L/R channels during downmixing.
-     */
-    double lfe_mix_level;
-} AVDownmixInfo;
-
-/**
- * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing.
- *
- * The side data is created and added to the frame if it's absent.
- *
- * @param frame the frame for which the side data is to be obtained.
- *
- * @return the AVDownmixInfo structure to be edited by the caller.
- */
-AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame);
-
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_DOWNMIX_INFO_H */
diff --git a/deps/libav/libavutil/error.c b/deps/libav/libavutil/error.c
deleted file mode 100644
index 6803d2d..0000000
--- a/deps/libav/libavutil/error.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avutil.h"
-#include "avstring.h"
-#include "common.h"
-
-int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
-{
-    int ret = 0;
-    const char *errstr = NULL;
-
-    switch (errnum) {
-    case AVERROR_BSF_NOT_FOUND:     errstr = "Bitstream filter not found"                   ; break;
-    case AVERROR_DECODER_NOT_FOUND: errstr = "Decoder not found"                            ; break;
-    case AVERROR_DEMUXER_NOT_FOUND: errstr = "Demuxer not found"                            ; break;
-    case AVERROR_ENCODER_NOT_FOUND: errstr = "Encoder not found"                            ; break;
-    case AVERROR_EOF:               errstr = "End of file"                                  ; break;
-    case AVERROR_EXIT:              errstr = "Immediate exit requested"                     ; break;
-    case AVERROR_FILTER_NOT_FOUND:  errstr = "Filter not found"                             ; break;
-    case AVERROR_INVALIDDATA:       errstr = "Invalid data found when processing input"     ; break;
-    case AVERROR_MUXER_NOT_FOUND:   errstr = "Muxer not found"                              ; break;
-    case AVERROR_OPTION_NOT_FOUND:  errstr = "Option not found"                             ; break;
-    case AVERROR_PATCHWELCOME:      errstr = "Not yet implemented in Libav, patches welcome"; break;
-    case AVERROR_PROTOCOL_NOT_FOUND:errstr = "Protocol not found"                           ; break;
-    case AVERROR_STREAM_NOT_FOUND:  errstr = "Stream not found"                             ; break;
-    case AVERROR_BUG:               errstr = "Bug detected, please report the issue"        ; break;
-    case AVERROR_UNKNOWN:           errstr = "Unknown error occurred"                       ; break;
-    case AVERROR_EXPERIMENTAL:      errstr = "Experimental feature"                         ; break;
-    }
-
-    if (errstr) {
-        av_strlcpy(errbuf, errstr, errbuf_size);
-    } else {
-#if HAVE_STRERROR_R
-        ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size);
-#else
-        ret = -1;
-#endif
-        if (ret < 0)
-            snprintf(errbuf, errbuf_size, "Error number %d occurred", errnum);
-    }
-
-    return ret;
-}
diff --git a/deps/libav/libavutil/error.h b/deps/libav/libavutil/error.h
deleted file mode 100644
index 268a032..0000000
--- a/deps/libav/libavutil/error.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * error code definitions
- */
-
-#ifndef AVUTIL_ERROR_H
-#define AVUTIL_ERROR_H
-
-#include <errno.h>
-#include <stddef.h>
-
-/**
- * @addtogroup lavu_error
- *
- * @{
- */
-
-
-/* error handling */
-#if EDOM > 0
-#define AVERROR(e) (-(e))   ///< Returns a negative error code from a POSIX error code, to return from library functions.
-#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
-#else
-/* Some platforms have E* and errno already negated. */
-#define AVERROR(e) (e)
-#define AVUNERROR(e) (e)
-#endif
-
-#define AVERROR_BSF_NOT_FOUND      (-0x39acbd08) ///< Bitstream filter not found
-#define AVERROR_DECODER_NOT_FOUND  (-0x3cbabb08) ///< Decoder not found
-#define AVERROR_DEMUXER_NOT_FOUND  (-0x32babb08) ///< Demuxer not found
-#define AVERROR_ENCODER_NOT_FOUND  (-0x3cb1ba08) ///< Encoder not found
-#define AVERROR_EOF                (-0x5fb9b0bb) ///< End of file
-#define AVERROR_EXIT               (-0x2bb6a7bb) ///< Immediate exit was requested; the called function should not be restarted
-#define AVERROR_FILTER_NOT_FOUND   (-0x33b6b908) ///< Filter not found
-#define AVERROR_INVALIDDATA        (-0x3ebbb1b7) ///< Invalid data found when processing input
-#define AVERROR_MUXER_NOT_FOUND    (-0x27aab208) ///< Muxer not found
-#define AVERROR_OPTION_NOT_FOUND   (-0x2bafb008) ///< Option not found
-#define AVERROR_PATCHWELCOME       (-0x3aa8beb0) ///< Not yet implemented in Libav, patches welcome
-#define AVERROR_PROTOCOL_NOT_FOUND (-0x30adaf08) ///< Protocol not found
-#define AVERROR_STREAM_NOT_FOUND   (-0x2dabac08) ///< Stream not found
-#define AVERROR_BUG                (-0x5fb8aabe) ///< Bug detected, please report the issue
-#define AVERROR_UNKNOWN            (-0x31b4b1ab) ///< Unknown error, typically from an external library
-#define AVERROR_EXPERIMENTAL       (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
-
-/**
- * Put a description of the AVERROR code errnum in errbuf.
- * In case of failure the global variable errno is set to indicate the
- * error. Even in case of failure av_strerror() will print a generic
- * error message indicating the errnum provided to errbuf.
- *
- * @param errnum      error code to describe
- * @param errbuf      buffer to which description is written
- * @param errbuf_size the size in bytes of errbuf
- * @return 0 on success, a negative value if a description for errnum
- * cannot be found
- */
-int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_ERROR_H */
diff --git a/deps/libav/libavutil/eval.c b/deps/libav/libavutil/eval.c
deleted file mode 100644
index 72f976c..0000000
--- a/deps/libav/libavutil/eval.c
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- * Copyright (c) 2002-2006 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2006 Oded Shimon <ods15 at ods15.dyndns.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * simple arithmetic expression evaluator.
- *
- * see http://joe.hotchkiss.com/programming/eval/eval.html
- */
-
-#include "attributes.h"
-#include "avutil.h"
-#include "common.h"
-#include "eval.h"
-#include "log.h"
-#include "mathematics.h"
-#include "avstring.h"
-#include "timer.h"
-
-typedef struct Parser {
-    const AVClass *class;
-    int stack_index;
-    char *s;
-    const double *const_values;
-    const char * const *const_names;          // NULL terminated
-    double (* const *funcs1)(void *, double a);           // NULL terminated
-    const char * const *func1_names;          // NULL terminated
-    double (* const *funcs2)(void *, double a, double b); // NULL terminated
-    const char * const *func2_names;          // NULL terminated
-    void *opaque;
-    int log_offset;
-    void *log_ctx;
-#define VARS 10
-    double var[VARS];
-} Parser;
-
-static const AVClass class = { "Eval", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(Parser,log_offset), offsetof(Parser,log_ctx) };
-
-static const int8_t si_prefixes['z' - 'E' + 1] = {
-    ['y'-'E']= -24,
-    ['z'-'E']= -21,
-    ['a'-'E']= -18,
-    ['f'-'E']= -15,
-    ['p'-'E']= -12,
-    ['n'-'E']= - 9,
-    ['u'-'E']= - 6,
-    ['m'-'E']= - 3,
-    ['c'-'E']= - 2,
-    ['d'-'E']= - 1,
-    ['h'-'E']=   2,
-    ['k'-'E']=   3,
-    ['K'-'E']=   3,
-    ['M'-'E']=   6,
-    ['G'-'E']=   9,
-    ['T'-'E']=  12,
-    ['P'-'E']=  15,
-    ['E'-'E']=  18,
-    ['Z'-'E']=  21,
-    ['Y'-'E']=  24,
-};
-
-double av_strtod(const char *numstr, char **tail)
-{
-    double d;
-    char *next;
-    d = strtod(numstr, &next);
-    /* if parsing succeeded, check for and interpret postfixes */
-    if (next!=numstr) {
-        if (next[0] == 'd' && next[1] == 'B') {
-            /* treat dB as decibels instead of decibytes */
-            d = pow(10, d / 20);
-            next += 2;
-        } else if (*next >= 'E' && *next <= 'z') {
-            int e= si_prefixes[*next - 'E'];
-            if (e) {
-                if (next[1] == 'i') {
-                    d*= pow( 2, e/0.3);
-                    next+=2;
-                } else {
-                    d*= pow(10, e);
-                    next++;
-                }
-            }
-        }
-
-        if (*next=='B') {
-            d*=8;
-            next++;
-        }
-    }
-    /* if requested, fill in tail with the position after the last parsed
-       character */
-    if (tail)
-        *tail = next;
-    return d;
-}
-
-#define IS_IDENTIFIER_CHAR(c) ((c) - '0' <= 9U || (c) - 'a' <= 25U || (c) - 'A' <= 25U || (c) == '_')
-
-static int strmatch(const char *s, const char *prefix)
-{
-    int i;
-    for (i=0; prefix[i]; i++) {
-        if (prefix[i] != s[i]) return 0;
-    }
-    /* return 1 only if the s identifier is terminated */
-    return !IS_IDENTIFIER_CHAR(s[i]);
-}
-
-struct AVExpr {
-    enum {
-        e_value, e_const, e_func0, e_func1, e_func2,
-        e_squish, e_gauss, e_ld, e_isnan, e_isinf,
-        e_mod, e_max, e_min, e_eq, e_gt, e_gte,
-        e_pow, e_mul, e_div, e_add,
-        e_last, e_st, e_while, e_floor, e_ceil, e_trunc,
-        e_sqrt, e_not,
-    } type;
-    double value; // is sign in other types
-    union {
-        int const_index;
-        double (*func0)(double);
-        double (*func1)(void *, double);
-        double (*func2)(void *, double, double);
-    } a;
-    struct AVExpr *param[2];
-};
-
-static double eval_expr(Parser *p, AVExpr *e)
-{
-    switch (e->type) {
-        case e_value:  return e->value;
-        case e_const:  return e->value * p->const_values[e->a.const_index];
-        case e_func0:  return e->value * e->a.func0(eval_expr(p, e->param[0]));
-        case e_func1:  return e->value * e->a.func1(p->opaque, eval_expr(p, e->param[0]));
-        case e_func2:  return e->value * e->a.func2(p->opaque, eval_expr(p, e->param[0]), eval_expr(p, e->param[1]));
-        case e_squish: return 1/(1+exp(4*eval_expr(p, e->param[0])));
-        case e_gauss: { double d = eval_expr(p, e->param[0]); return exp(-d*d/2)/sqrt(2*M_PI); }
-        case e_ld:     return e->value * p->var[av_clip(eval_expr(p, e->param[0]), 0, VARS-1)];
-        case e_isnan:  return e->value * !!isnan(eval_expr(p, e->param[0]));
-        case e_isinf:  return e->value * !!isinf(eval_expr(p, e->param[0]));
-        case e_floor:  return e->value * floor(eval_expr(p, e->param[0]));
-        case e_ceil :  return e->value * ceil (eval_expr(p, e->param[0]));
-        case e_trunc:  return e->value * trunc(eval_expr(p, e->param[0]));
-        case e_sqrt:   return e->value * sqrt (eval_expr(p, e->param[0]));
-        case e_not:    return e->value * eval_expr(p, e->param[0]) == 0;
-        case e_while: {
-            double d = NAN;
-            while (eval_expr(p, e->param[0]))
-                d=eval_expr(p, e->param[1]);
-            return d;
-        }
-        default: {
-            double d = eval_expr(p, e->param[0]);
-            double d2 = eval_expr(p, e->param[1]);
-            switch (e->type) {
-                case e_mod: return e->value * (d - floor(d/d2)*d2);
-                case e_max: return e->value * (d >  d2 ?   d : d2);
-                case e_min: return e->value * (d <  d2 ?   d : d2);
-                case e_eq:  return e->value * (d == d2 ? 1.0 : 0.0);
-                case e_gt:  return e->value * (d >  d2 ? 1.0 : 0.0);
-                case e_gte: return e->value * (d >= d2 ? 1.0 : 0.0);
-                case e_pow: return e->value * pow(d, d2);
-                case e_mul: return e->value * (d * d2);
-                case e_div: return e->value * (d / d2);
-                case e_add: return e->value * (d + d2);
-                case e_last:return e->value * d2;
-                case e_st : return e->value * (p->var[av_clip(d, 0, VARS-1)]= d2);
-            }
-        }
-    }
-    return NAN;
-}
-
-static int parse_expr(AVExpr **e, Parser *p);
-
-void av_expr_free(AVExpr *e)
-{
-    if (!e) return;
-    av_expr_free(e->param[0]);
-    av_expr_free(e->param[1]);
-    av_freep(&e);
-}
-
-static int parse_primary(AVExpr **e, Parser *p)
-{
-    AVExpr *d = av_mallocz(sizeof(AVExpr));
-    char *next = p->s, *s0 = p->s;
-    int ret, i;
-
-    if (!d)
-        return AVERROR(ENOMEM);
-
-    /* number */
-    d->value = av_strtod(p->s, &next);
-    if (next != p->s) {
-        d->type = e_value;
-        p->s= next;
-        *e = d;
-        return 0;
-    }
-    d->value = 1;
-
-    /* named constants */
-    for (i=0; p->const_names && p->const_names[i]; i++) {
-        if (strmatch(p->s, p->const_names[i])) {
-            p->s+= strlen(p->const_names[i]);
-            d->type = e_const;
-            d->a.const_index = i;
-            *e = d;
-            return 0;
-        }
-    }
-
-    p->s= strchr(p->s, '(');
-    if (p->s==NULL) {
-        av_log(p, AV_LOG_ERROR, "Undefined constant or missing '(' in '%s'\n", s0);
-        p->s= next;
-        av_expr_free(d);
-        return AVERROR(EINVAL);
-    }
-    p->s++; // "("
-    if (*next == '(') { // special case do-nothing
-        av_freep(&d);
-        if ((ret = parse_expr(&d, p)) < 0)
-            return ret;
-        if (p->s[0] != ')') {
-            av_log(p, AV_LOG_ERROR, "Missing ')' in '%s'\n", s0);
-            av_expr_free(d);
-            return AVERROR(EINVAL);
-        }
-        p->s++; // ")"
-        *e = d;
-        return 0;
-    }
-    if ((ret = parse_expr(&(d->param[0]), p)) < 0) {
-        av_expr_free(d);
-        return ret;
-    }
-    if (p->s[0]== ',') {
-        p->s++; // ","
-        parse_expr(&d->param[1], p);
-    }
-    if (p->s[0] != ')') {
-        av_log(p, AV_LOG_ERROR, "Missing ')' or too many args in '%s'\n", s0);
-        av_expr_free(d);
-        return AVERROR(EINVAL);
-    }
-    p->s++; // ")"
-
-    d->type = e_func0;
-         if (strmatch(next, "sinh"  )) d->a.func0 = sinh;
-    else if (strmatch(next, "cosh"  )) d->a.func0 = cosh;
-    else if (strmatch(next, "tanh"  )) d->a.func0 = tanh;
-    else if (strmatch(next, "sin"   )) d->a.func0 = sin;
-    else if (strmatch(next, "cos"   )) d->a.func0 = cos;
-    else if (strmatch(next, "tan"   )) d->a.func0 = tan;
-    else if (strmatch(next, "atan"  )) d->a.func0 = atan;
-    else if (strmatch(next, "asin"  )) d->a.func0 = asin;
-    else if (strmatch(next, "acos"  )) d->a.func0 = acos;
-    else if (strmatch(next, "exp"   )) d->a.func0 = exp;
-    else if (strmatch(next, "log"   )) d->a.func0 = log;
-    else if (strmatch(next, "abs"   )) d->a.func0 = fabs;
-    else if (strmatch(next, "squish")) d->type = e_squish;
-    else if (strmatch(next, "gauss" )) d->type = e_gauss;
-    else if (strmatch(next, "mod"   )) d->type = e_mod;
-    else if (strmatch(next, "max"   )) d->type = e_max;
-    else if (strmatch(next, "min"   )) d->type = e_min;
-    else if (strmatch(next, "eq"    )) d->type = e_eq;
-    else if (strmatch(next, "gte"   )) d->type = e_gte;
-    else if (strmatch(next, "gt"    )) d->type = e_gt;
-    else if (strmatch(next, "lte"   )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gte; }
-    else if (strmatch(next, "lt"    )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gt; }
-    else if (strmatch(next, "ld"    )) d->type = e_ld;
-    else if (strmatch(next, "isnan" )) d->type = e_isnan;
-    else if (strmatch(next, "isinf" )) d->type = e_isinf;
-    else if (strmatch(next, "st"    )) d->type = e_st;
-    else if (strmatch(next, "while" )) d->type = e_while;
-    else if (strmatch(next, "floor" )) d->type = e_floor;
-    else if (strmatch(next, "ceil"  )) d->type = e_ceil;
-    else if (strmatch(next, "trunc" )) d->type = e_trunc;
-    else if (strmatch(next, "sqrt"  )) d->type = e_sqrt;
-    else if (strmatch(next, "not"   )) d->type = e_not;
-    else {
-        for (i=0; p->func1_names && p->func1_names[i]; i++) {
-            if (strmatch(next, p->func1_names[i])) {
-                d->a.func1 = p->funcs1[i];
-                d->type = e_func1;
-                *e = d;
-                return 0;
-            }
-        }
-
-        for (i=0; p->func2_names && p->func2_names[i]; i++) {
-            if (strmatch(next, p->func2_names[i])) {
-                d->a.func2 = p->funcs2[i];
-                d->type = e_func2;
-                *e = d;
-                return 0;
-            }
-        }
-
-        av_log(p, AV_LOG_ERROR, "Unknown function in '%s'\n", s0);
-        av_expr_free(d);
-        return AVERROR(EINVAL);
-    }
-
-    *e = d;
-    return 0;
-}
-
-static AVExpr *new_eval_expr(int type, int value, AVExpr *p0, AVExpr *p1)
-{
-    AVExpr *e = av_mallocz(sizeof(AVExpr));
-    if (!e)
-        return NULL;
-    e->type     =type   ;
-    e->value    =value  ;
-    e->param[0] =p0     ;
-    e->param[1] =p1     ;
-    return e;
-}
-
-static int parse_pow(AVExpr **e, Parser *p, int *sign)
-{
-    *sign= (*p->s == '+') - (*p->s == '-');
-    p->s += *sign&1;
-    return parse_primary(e, p);
-}
-
-static int parse_dB(AVExpr **e, Parser *p, int *sign)
-{
-    /* do not filter out the negative sign when parsing a dB value.
-       for example, -3dB is not the same as -(3dB) */
-    if (*p->s == '-') {
-        char *next;
-        double av_unused ignored = strtod(p->s, &next);
-        if (next != p->s && next[0] == 'd' && next[1] == 'B') {
-            *sign = 0;
-            return parse_primary(e, p);
-        }
-    }
-    return parse_pow(e, p, sign);
-}
-
-static int parse_factor(AVExpr **e, Parser *p)
-{
-    int sign, sign2, ret;
-    AVExpr *e0, *e1, *e2;
-    if ((ret = parse_dB(&e0, p, &sign)) < 0)
-        return ret;
-    while(p->s[0]=='^'){
-        e1 = e0;
-        p->s++;
-        if ((ret = parse_dB(&e2, p, &sign2)) < 0) {
-            av_expr_free(e1);
-            return ret;
-        }
-        e0 = new_eval_expr(e_pow, 1, e1, e2);
-        if (!e0) {
-            av_expr_free(e1);
-            av_expr_free(e2);
-            return AVERROR(ENOMEM);
-        }
-        if (e0->param[1]) e0->param[1]->value *= (sign2|1);
-    }
-    if (e0) e0->value *= (sign|1);
-
-    *e = e0;
-    return 0;
-}
-
-static int parse_term(AVExpr **e, Parser *p)
-{
-    int ret;
-    AVExpr *e0, *e1, *e2;
-    if ((ret = parse_factor(&e0, p)) < 0)
-        return ret;
-    while (p->s[0]=='*' || p->s[0]=='/') {
-        int c= *p->s++;
-        e1 = e0;
-        if ((ret = parse_factor(&e2, p)) < 0) {
-            av_expr_free(e1);
-            return ret;
-        }
-        e0 = new_eval_expr(c == '*' ? e_mul : e_div, 1, e1, e2);
-        if (!e0) {
-            av_expr_free(e1);
-            av_expr_free(e2);
-            return AVERROR(ENOMEM);
-        }
-    }
-    *e = e0;
-    return 0;
-}
-
-static int parse_subexpr(AVExpr **e, Parser *p)
-{
-    int ret;
-    AVExpr *e0, *e1, *e2;
-    if ((ret = parse_term(&e0, p)) < 0)
-        return ret;
-    while (*p->s == '+' || *p->s == '-') {
-        e1 = e0;
-        if ((ret = parse_term(&e2, p)) < 0) {
-            av_expr_free(e1);
-            return ret;
-        }
-        e0 = new_eval_expr(e_add, 1, e1, e2);
-        if (!e0) {
-            av_expr_free(e1);
-            av_expr_free(e2);
-            return AVERROR(ENOMEM);
-        }
-    };
-
-    *e = e0;
-    return 0;
-}
-
-static int parse_expr(AVExpr **e, Parser *p)
-{
-    int ret;
-    AVExpr *e0, *e1, *e2;
-    if (p->stack_index <= 0) //protect against stack overflows
-        return AVERROR(EINVAL);
-    p->stack_index--;
-
-    if ((ret = parse_subexpr(&e0, p)) < 0)
-        return ret;
-    while (*p->s == ';') {
-        p->s++;
-        e1 = e0;
-        if ((ret = parse_subexpr(&e2, p)) < 0) {
-            av_expr_free(e1);
-            return ret;
-        }
-        e0 = new_eval_expr(e_last, 1, e1, e2);
-        if (!e0) {
-            av_expr_free(e1);
-            av_expr_free(e2);
-            return AVERROR(ENOMEM);
-        }
-    };
-
-    p->stack_index++;
-    *e = e0;
-    return 0;
-}
-
-static int verify_expr(AVExpr *e)
-{
-    if (!e) return 0;
-    switch (e->type) {
-        case e_value:
-        case e_const: return 1;
-        case e_func0:
-        case e_func1:
-        case e_squish:
-        case e_ld:
-        case e_gauss:
-        case e_isnan:
-        case e_isinf:
-        case e_floor:
-        case e_ceil:
-        case e_trunc:
-        case e_sqrt:
-        case e_not:
-            return verify_expr(e->param[0]);
-        default: return verify_expr(e->param[0]) && verify_expr(e->param[1]);
-    }
-}
-
-int av_expr_parse(AVExpr **expr, const char *s,
-                  const char * const *const_names,
-                  const char * const *func1_names, double (* const *funcs1)(void *, double),
-                  const char * const *func2_names, double (* const *funcs2)(void *, double, double),
-                  int log_offset, void *log_ctx)
-{
-    Parser p = { 0 };
-    AVExpr *e = NULL;
-    char *w = av_malloc(strlen(s) + 1);
-    char *wp = w;
-    const char *s0 = s;
-    int ret = 0;
-
-    if (!w)
-        return AVERROR(ENOMEM);
-
-    while (*s)
-        if (!av_isspace(*s++)) *wp++ = s[-1];
-    *wp++ = 0;
-
-    p.class      = &class;
-    p.stack_index=100;
-    p.s= w;
-    p.const_names = const_names;
-    p.funcs1      = funcs1;
-    p.func1_names = func1_names;
-    p.funcs2      = funcs2;
-    p.func2_names = func2_names;
-    p.log_offset = log_offset;
-    p.log_ctx    = log_ctx;
-
-    if ((ret = parse_expr(&e, &p)) < 0)
-        goto end;
-    if (*p.s) {
-        av_expr_free(e);
-        av_log(&p, AV_LOG_ERROR, "Invalid chars '%s' at the end of expression '%s'\n", p.s, s0);
-        ret = AVERROR(EINVAL);
-        goto end;
-    }
-    if (!verify_expr(e)) {
-        av_expr_free(e);
-        ret = AVERROR(EINVAL);
-        goto end;
-    }
-    *expr = e;
-end:
-    av_free(w);
-    return ret;
-}
-
-double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
-{
-    Parser p = { 0 };
-
-    p.const_values = const_values;
-    p.opaque     = opaque;
-    return eval_expr(&p, e);
-}
-
-int av_expr_parse_and_eval(double *d, const char *s,
-                           const char * const *const_names, const double *const_values,
-                           const char * const *func1_names, double (* const *funcs1)(void *, double),
-                           const char * const *func2_names, double (* const *funcs2)(void *, double, double),
-                           void *opaque, int log_offset, void *log_ctx)
-{
-    AVExpr *e = NULL;
-    int ret = av_expr_parse(&e, s, const_names, func1_names, funcs1, func2_names, funcs2, log_offset, log_ctx);
-
-    if (ret < 0) {
-        *d = NAN;
-        return ret;
-    }
-    *d = av_expr_eval(e, const_values, opaque);
-    av_expr_free(e);
-    return isnan(*d) ? AVERROR(EINVAL) : 0;
-}
-
-#ifdef TEST
-#include <string.h>
-
-static const double const_values[] = {
-    M_PI,
-    M_E,
-    0
-};
-
-static const char *const const_names[] = {
-    "PI",
-    "E",
-    0
-};
-
-int main(int argc, char **argv)
-{
-    int i;
-    double d;
-    const char *const *expr;
-    static const char *const exprs[] = {
-        "",
-        "1;2",
-        "-20",
-        "-PI",
-        "+PI",
-        "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
-        "80G/80Gi",
-        "1k",
-        "1Gi",
-        "1gi",
-        "1GiFoo",
-        "1k+1k",
-        "1Gi*3foo",
-        "foo",
-        "foo(",
-        "foo()",
-        "foo)",
-        "sin",
-        "sin(",
-        "sin()",
-        "sin)",
-        "sin 10",
-        "sin(1,2,3)",
-        "sin(1 )",
-        "1",
-        "1foo",
-        "bar + PI + E + 100f*2 + foo",
-        "13k + 12f - foo(1, 2)",
-        "1gi",
-        "1Gi",
-        "st(0, 123)",
-        "st(1, 123); ld(1)",
-        "lte(0, 1)",
-        "lte(1, 1)",
-        "lte(1, 0)",
-        "lt(0, 1)",
-        "lt(1, 1)",
-        "gt(1, 0)",
-        "gt(2, 7)",
-        "gte(122, 122)",
-        /* compute 1+2+...+N */
-        "st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)",
-        /* compute Fib(N) */
-        "st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)",
-        "while(0, 10)",
-        "st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))",
-        "isnan(1)",
-        "isnan(NAN)",
-        "isnan(INF)",
-        "isinf(1)",
-        "isinf(NAN)",
-        "isinf(INF)",
-        "floor(NAN)",
-        "floor(123.123)",
-        "floor(-123.123)",
-        "trunc(123.123)",
-        "trunc(-123.123)",
-        "ceil(123.123)",
-        "ceil(-123.123)",
-        "sqrt(1764)",
-        "isnan(sqrt(-1))",
-        "not(1)",
-        "not(NAN)",
-        "not(0)",
-        "6.0206dB",
-        "-3.0103dB",
-        NULL
-    };
-
-    for (expr = exprs; *expr; expr++) {
-        printf("Evaluating '%s'\n", *expr);
-        av_expr_parse_and_eval(&d, *expr,
-                               const_names, const_values,
-                               NULL, NULL, NULL, NULL, NULL, 0, NULL);
-        if (isnan(d))
-            printf("'%s' -> nan\n\n", *expr);
-        else
-            printf("'%s' -> %f\n\n", *expr, d);
-    }
-
-    av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
-                           const_names, const_values,
-                           NULL, NULL, NULL, NULL, NULL, 0, NULL);
-    printf("%f == 12.7\n", d);
-    av_expr_parse_and_eval(&d, "80G/80Gi",
-                           const_names, const_values,
-                           NULL, NULL, NULL, NULL, NULL, 0, NULL);
-    printf("%f == 0.931322575\n", d);
-
-    if (argc > 1 && !strcmp(argv[1], "-t")) {
-        for (i = 0; i < 1050; i++) {
-            START_TIMER;
-            av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
-                                   const_names, const_values,
-                                   NULL, NULL, NULL, NULL, NULL, 0, NULL);
-            STOP_TIMER("av_expr_parse_and_eval");
-        }
-    }
-
-    return 0;
-}
-#endif
diff --git a/deps/libav/libavutil/eval.h b/deps/libav/libavutil/eval.h
deleted file mode 100644
index ccb29e7..0000000
--- a/deps/libav/libavutil/eval.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2002 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * simple arithmetic expression evaluator
- */
-
-#ifndef AVUTIL_EVAL_H
-#define AVUTIL_EVAL_H
-
-#include "avutil.h"
-
-typedef struct AVExpr AVExpr;
-
-/**
- * Parse and evaluate an expression.
- * Note, this is significantly slower than av_expr_eval().
- *
- * @param res a pointer to a double where is put the result value of
- * the expression, or NAN in case of error
- * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
- * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
- * @param const_values a zero terminated array of values for the identifiers from const_names
- * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
- * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
- * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
- * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
- * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
- * @param log_ctx parent logging context
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code otherwise
- */
-int av_expr_parse_and_eval(double *res, const char *s,
-                           const char * const *const_names, const double *const_values,
-                           const char * const *func1_names, double (* const *funcs1)(void *, double),
-                           const char * const *func2_names, double (* const *funcs2)(void *, double, double),
-                           void *opaque, int log_offset, void *log_ctx);
-
-/**
- * Parse an expression.
- *
- * @param expr a pointer where is put an AVExpr containing the parsed
- * value in case of successful parsing, or NULL otherwise.
- * The pointed to AVExpr must be freed with av_expr_free() by the user
- * when it is not needed anymore.
- * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
- * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
- * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
- * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
- * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
- * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
- * @param log_ctx parent logging context
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code otherwise
- */
-int av_expr_parse(AVExpr **expr, const char *s,
-                  const char * const *const_names,
-                  const char * const *func1_names, double (* const *funcs1)(void *, double),
-                  const char * const *func2_names, double (* const *funcs2)(void *, double, double),
-                  int log_offset, void *log_ctx);
-
-/**
- * Evaluate a previously parsed expression.
- *
- * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
- * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
- * @return the value of the expression
- */
-double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
-
-/**
- * Free a parsed expression previously created with av_expr_parse().
- */
-void av_expr_free(AVExpr *e);
-
-/**
- * Parse the string in numstr and return its value as a double. If
- * the string is empty, contains only whitespaces, or does not contain
- * an initial substring that has the expected syntax for a
- * floating-point number, no conversion is performed. In this case,
- * returns a value of zero and the value returned in tail is the value
- * of numstr.
- *
- * @param numstr a string representing a number, may contain one of
- * the International System number postfixes, for example 'K', 'M',
- * 'G'. If 'i' is appended after the postfix, powers of 2 are used
- * instead of powers of 10. The 'B' postfix multiplies the value for
- * 8, and can be appended after another postfix or used alone. This
- * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
- * @param tail if non-NULL puts here the pointer to the char next
- * after the last parsed character
- */
-double av_strtod(const char *numstr, char **tail);
-
-#endif /* AVUTIL_EVAL_H */
diff --git a/deps/libav/libavutil/fifo.c b/deps/libav/libavutil/fifo.c
deleted file mode 100644
index dffaf54..0000000
--- a/deps/libav/libavutil/fifo.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * a very simple circular buffer FIFO implementation
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- * Copyright (c) 2006 Roman Shaposhnik
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "common.h"
-#include "fifo.h"
-
-AVFifoBuffer *av_fifo_alloc(unsigned int size)
-{
-    AVFifoBuffer *f = av_mallocz(sizeof(AVFifoBuffer));
-    if (!f)
-        return NULL;
-    f->buffer = av_malloc(size);
-    f->end    = f->buffer + size;
-    av_fifo_reset(f);
-    if (!f->buffer)
-        av_freep(&f);
-    return f;
-}
-
-void av_fifo_free(AVFifoBuffer *f)
-{
-    if (f) {
-        av_free(f->buffer);
-        av_free(f);
-    }
-}
-
-void av_fifo_reset(AVFifoBuffer *f)
-{
-    f->wptr = f->rptr = f->buffer;
-    f->wndx = f->rndx = 0;
-}
-
-int av_fifo_size(AVFifoBuffer *f)
-{
-    return (uint32_t)(f->wndx - f->rndx);
-}
-
-int av_fifo_space(AVFifoBuffer *f)
-{
-    return f->end - f->buffer - av_fifo_size(f);
-}
-
-int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size)
-{
-    unsigned int old_size = f->end - f->buffer;
-
-    if (old_size < new_size) {
-        int len          = av_fifo_size(f);
-        AVFifoBuffer *f2 = av_fifo_alloc(new_size);
-
-        if (!f2)
-            return -1;
-        av_fifo_generic_read(f, f2->buffer, len, NULL);
-        f2->wptr += len;
-        f2->wndx += len;
-        av_free(f->buffer);
-        *f = *f2;
-        av_free(f2);
-    }
-    return 0;
-}
-
-/* src must NOT be const as it can be a context for func that may need
- * updating (like a pointer or byte counter) */
-int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size,
-                          int (*func)(void *, void *, int))
-{
-    int total = size;
-    do {
-        int len = FFMIN(f->end - f->wptr, size);
-        if (func) {
-            if (func(src, f->wptr, len) <= 0)
-                break;
-        } else {
-            memcpy(f->wptr, src, len);
-            src = (uint8_t *)src + len;
-        }
-// Write memory barrier needed for SMP here in theory
-        f->wptr += len;
-        if (f->wptr >= f->end)
-            f->wptr = f->buffer;
-        f->wndx += len;
-        size    -= len;
-    } while (size > 0);
-    return total - size;
-}
-
-int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size,
-                         void (*func)(void *, void *, int))
-{
-// Read memory barrier needed for SMP here in theory
-    do {
-        int len = FFMIN(f->end - f->rptr, buf_size);
-        if (func)
-            func(dest, f->rptr, len);
-        else {
-            memcpy(dest, f->rptr, len);
-            dest = (uint8_t *)dest + len;
-        }
-// memory barrier needed for SMP here in theory
-        av_fifo_drain(f, len);
-        buf_size -= len;
-    } while (buf_size > 0);
-    return 0;
-}
-
-/** Discard data from the FIFO. */
-void av_fifo_drain(AVFifoBuffer *f, int size)
-{
-    f->rptr += size;
-    if (f->rptr >= f->end)
-        f->rptr -= f->end - f->buffer;
-    f->rndx += size;
-}
-
-#ifdef TEST
-
-int main(void)
-{
-    /* create a FIFO buffer */
-    AVFifoBuffer *fifo = av_fifo_alloc(13 * sizeof(int));
-    int i, j, n;
-
-    /* fill data */
-    for (i = 0; av_fifo_space(fifo) >= sizeof(int); i++)
-        av_fifo_generic_write(fifo, &i, sizeof(int), NULL);
-
-    /* peek at FIFO */
-    n = av_fifo_size(fifo) / sizeof(int);
-    for (i = -n + 1; i < n; i++) {
-        int *v = (int *)av_fifo_peek2(fifo, i * sizeof(int));
-        printf("%d: %d\n", i, *v);
-    }
-    printf("\n");
-
-    /* read data */
-    for (i = 0; av_fifo_size(fifo) >= sizeof(int); i++) {
-        av_fifo_generic_read(fifo, &j, sizeof(int), NULL);
-        printf("%d ", j);
-    }
-    printf("\n");
-
-    av_fifo_free(fifo);
-
-    return 0;
-}
-
-#endif
diff --git a/deps/libav/libavutil/fifo.h b/deps/libav/libavutil/fifo.h
deleted file mode 100644
index ea30f5d..0000000
--- a/deps/libav/libavutil/fifo.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * a very simple circular buffer FIFO implementation
- */
-
-#ifndef AVUTIL_FIFO_H
-#define AVUTIL_FIFO_H
-
-#include <stdint.h>
-#include "avutil.h"
-#include "attributes.h"
-
-typedef struct AVFifoBuffer {
-    uint8_t *buffer;
-    uint8_t *rptr, *wptr, *end;
-    uint32_t rndx, wndx;
-} AVFifoBuffer;
-
-/**
- * Initialize an AVFifoBuffer.
- * @param size of FIFO
- * @return AVFifoBuffer or NULL in case of memory allocation failure
- */
-AVFifoBuffer *av_fifo_alloc(unsigned int size);
-
-/**
- * Free an AVFifoBuffer.
- * @param f AVFifoBuffer to free
- */
-void av_fifo_free(AVFifoBuffer *f);
-
-/**
- * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
- * @param f AVFifoBuffer to reset
- */
-void av_fifo_reset(AVFifoBuffer *f);
-
-/**
- * Return the amount of data in bytes in the AVFifoBuffer, that is the
- * amount of data you can read from it.
- * @param f AVFifoBuffer to read from
- * @return size
- */
-int av_fifo_size(AVFifoBuffer *f);
-
-/**
- * Return the amount of space in bytes in the AVFifoBuffer, that is the
- * amount of data you can write into it.
- * @param f AVFifoBuffer to write into
- * @return size
- */
-int av_fifo_space(AVFifoBuffer *f);
-
-/**
- * Feed data from an AVFifoBuffer to a user-supplied callback.
- * @param f AVFifoBuffer to read from
- * @param buf_size number of bytes to read
- * @param func generic read function
- * @param dest data destination
- */
-int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
-
-/**
- * Feed data from a user-supplied callback to an AVFifoBuffer.
- * @param f AVFifoBuffer to write to
- * @param src data source; non-const since it may be used as a
- * modifiable context by the function defined in func
- * @param size number of bytes to write
- * @param func generic write function; the first parameter is src,
- * the second is dest_buf, the third is dest_buf_size.
- * func must return the number of bytes written to dest_buf, or <= 0 to
- * indicate no more data available to write.
- * If func is NULL, src is interpreted as a simple byte array for source data.
- * @return the number of bytes written to the FIFO
- */
-int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
-
-/**
- * Resize an AVFifoBuffer.
- * @param f AVFifoBuffer to resize
- * @param size new AVFifoBuffer size in bytes
- * @return <0 for failure, >=0 otherwise
- */
-int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
-
-/**
- * Read and discard the specified amount of data from an AVFifoBuffer.
- * @param f AVFifoBuffer to read from
- * @param size amount of data to read in bytes
- */
-void av_fifo_drain(AVFifoBuffer *f, int size);
-
-/**
- * Return a pointer to the data stored in a FIFO buffer at a certain offset.
- * The FIFO buffer is not modified.
- *
- * @param f    AVFifoBuffer to peek at, f must be non-NULL
- * @param offs an offset in bytes, its absolute value must be less
- *             than the used buffer size or the returned pointer will
- *             point outside to the buffer data.
- *             The used buffer size can be checked with av_fifo_size().
- */
-static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
-{
-    uint8_t *ptr = f->rptr + offs;
-    if (ptr >= f->end)
-        ptr = f->buffer + (ptr - f->end);
-    else if (ptr < f->buffer)
-        ptr = f->end - (f->buffer - ptr);
-    return ptr;
-}
-
-#endif /* AVUTIL_FIFO_H */
diff --git a/deps/libav/libavutil/file.c b/deps/libav/libavutil/file.c
deleted file mode 100644
index d2765b8..0000000
--- a/deps/libav/libavutil/file.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "file.h"
-#include "internal.h"
-#include "log.h"
-#include "mem.h"
-#include <fcntl.h>
-#include <sys/stat.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_IO_H
-#include <io.h>
-#endif
-#if HAVE_MMAP
-#include <sys/mman.h>
-#elif HAVE_MAPVIEWOFFILE
-#include <windows.h>
-#endif
-
-typedef struct {
-    const AVClass *class;
-    int   log_offset;
-    void *log_ctx;
-} FileLogContext;
-
-static const AVClass file_log_ctx_class = {
-    "FILE", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT,
-    offsetof(FileLogContext, log_offset), offsetof(FileLogContext, log_ctx)
-};
-
-int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
-                int log_offset, void *log_ctx)
-{
-    FileLogContext file_log_ctx = { &file_log_ctx_class, log_offset, log_ctx };
-    int err, fd = avpriv_open(filename, O_RDONLY);
-    struct stat st;
-    av_unused void *ptr;
-    off_t off_size;
-    char errbuf[128];
-    *bufptr = NULL;
-
-    if (fd < 0) {
-        err = AVERROR(errno);
-        av_strerror(err, errbuf, sizeof(errbuf));
-        av_log(&file_log_ctx, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename, errbuf);
-        return err;
-    }
-
-    if (fstat(fd, &st) < 0) {
-        err = AVERROR(errno);
-        av_strerror(err, errbuf, sizeof(errbuf));
-        av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in fstat(): %s\n", errbuf);
-        close(fd);
-        return err;
-    }
-
-    off_size = st.st_size;
-    if (off_size > SIZE_MAX) {
-        av_log(&file_log_ctx, AV_LOG_ERROR,
-               "File size for file '%s' is too big\n", filename);
-        close(fd);
-        return AVERROR(EINVAL);
-    }
-    *size = off_size;
-
-#if HAVE_MMAP
-    ptr = mmap(NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
-    if (ptr == MAP_FAILED) {
-        err = AVERROR(errno);
-        av_strerror(err, errbuf, sizeof(errbuf));
-        av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in mmap(): %s\n", errbuf);
-        close(fd);
-        return err;
-    }
-    *bufptr = ptr;
-#elif HAVE_MAPVIEWOFFILE
-    {
-        HANDLE mh, fh = (HANDLE)_get_osfhandle(fd);
-
-        mh = CreateFileMapping(fh, NULL, PAGE_READONLY, 0, 0, NULL);
-        if (!mh) {
-            av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in CreateFileMapping()\n");
-            close(fd);
-            return -1;
-        }
-
-        ptr = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, *size);
-        CloseHandle(mh);
-        if (!ptr) {
-            av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in MapViewOfFile()\n");
-            close(fd);
-            return -1;
-        }
-
-        *bufptr = ptr;
-    }
-#else
-    *bufptr = av_malloc(*size);
-    if (!*bufptr) {
-        av_log(&file_log_ctx, AV_LOG_ERROR, "Memory allocation error occurred\n");
-        close(fd);
-        return AVERROR(ENOMEM);
-    }
-    read(fd, *bufptr, *size);
-#endif
-
-    close(fd);
-    return 0;
-}
-
-void av_file_unmap(uint8_t *bufptr, size_t size)
-{
-#if HAVE_MMAP
-    munmap(bufptr, size);
-#elif HAVE_MAPVIEWOFFILE
-    UnmapViewOfFile(bufptr);
-#else
-    av_free(bufptr);
-#endif
-}
diff --git a/deps/libav/libavutil/file.h b/deps/libav/libavutil/file.h
deleted file mode 100644
index e3f02a8..0000000
--- a/deps/libav/libavutil/file.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_FILE_H
-#define AVUTIL_FILE_H
-
-#include <stdint.h>
-
-#include "avutil.h"
-
-/**
- * @file
- * Misc file utilities.
- */
-
-/**
- * Read the file with name filename, and put its content in a newly
- * allocated buffer or map it with mmap() when available.
- * In case of success set *bufptr to the read or mmapped buffer, and
- * *size to the size in bytes of the buffer in *bufptr.
- * The returned buffer must be released with av_file_unmap().
- *
- * @param log_offset loglevel offset used for logging
- * @param log_ctx context used for logging
- * @return a non negative number in case of success, a negative value
- * corresponding to an AVERROR error code in case of failure
- */
-int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
-                int log_offset, void *log_ctx);
-
-/**
- * Unmap or free the buffer bufptr created by av_file_map().
- *
- * @param size size in bytes of bufptr, must be the same as returned
- * by av_file_map()
- */
-void av_file_unmap(uint8_t *bufptr, size_t size);
-
-#endif /* AVUTIL_FILE_H */
diff --git a/deps/libav/libavutil/file_open.c b/deps/libav/libavutil/file_open.c
deleted file mode 100644
index 765eb60..0000000
--- a/deps/libav/libavutil/file_open.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "internal.h"
-#include "mem.h"
-#include <stdarg.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_IO_H
-#include <io.h>
-#endif
-
-#if defined(_WIN32) && !defined(__MINGW32CE__)
-#undef open
-#undef lseek
-#undef stat
-#undef fstat
-#include <windows.h>
-#include <share.h>
-#include <errno.h>
-
-static int win32_open(const char *filename_utf8, int oflag, int pmode)
-{
-    int fd;
-    int num_chars;
-    wchar_t *filename_w;
-
-    /* convert UTF-8 to wide chars */
-    num_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename_utf8, -1, NULL, 0);
-    if (num_chars <= 0)
-        goto fallback;
-    filename_w = av_mallocz(sizeof(wchar_t) * num_chars);
-    if (!filename_w) {
-        errno = ENOMEM;
-        return -1;
-    }
-    MultiByteToWideChar(CP_UTF8, 0, filename_utf8, -1, filename_w, num_chars);
-
-    fd = _wsopen(filename_w, oflag, SH_DENYNO, pmode);
-    av_freep(&filename_w);
-
-    if (fd != -1 || (oflag & O_CREAT))
-        return fd;
-
-fallback:
-    /* filename may be be in CP_ACP */
-    return _sopen(filename_utf8, oflag, SH_DENYNO, pmode);
-}
-#define open win32_open
-#endif
-
-int avpriv_open(const char *filename, int flags, ...)
-{
-    int fd;
-    unsigned int mode = 0;
-    va_list ap;
-
-    va_start(ap, flags);
-    if (flags & O_CREAT)
-        mode = va_arg(ap, unsigned int);
-    va_end(ap);
-
-#ifdef O_CLOEXEC
-    flags |= O_CLOEXEC;
-#endif
-
-    fd = open(filename, flags, mode);
-#if HAVE_FCNTL
-    if (fd != -1)
-        fcntl(fd, F_SETFD, FD_CLOEXEC);
-#endif
-
-    return fd;
-}
diff --git a/deps/libav/libavutil/float_dsp.c b/deps/libav/libavutil/float_dsp.c
deleted file mode 100644
index 3707e06..0000000
--- a/deps/libav/libavutil/float_dsp.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "attributes.h"
-#include "float_dsp.h"
-
-static void vector_fmul_c(float *dst, const float *src0, const float *src1,
-                          int len)
-{
-    int i;
-    for (i = 0; i < len; i++)
-        dst[i] = src0[i] * src1[i];
-}
-
-static void vector_fmac_scalar_c(float *dst, const float *src, float mul,
-                                 int len)
-{
-    int i;
-    for (i = 0; i < len; i++)
-        dst[i] += src[i] * mul;
-}
-
-static void vector_fmul_scalar_c(float *dst, const float *src, float mul,
-                                 int len)
-{
-    int i;
-    for (i = 0; i < len; i++)
-        dst[i] = src[i] * mul;
-}
-
-static void vector_dmul_scalar_c(double *dst, const double *src, double mul,
-                                 int len)
-{
-    int i;
-    for (i = 0; i < len; i++)
-        dst[i] = src[i] * mul;
-}
-
-static void vector_fmul_window_c(float *dst, const float *src0,
-                                 const float *src1, const float *win, int len)
-{
-    int i, j;
-
-    dst  += len;
-    win  += len;
-    src0 += len;
-
-    for (i = -len, j = len - 1; i < 0; i++, j--) {
-        float s0 = src0[i];
-        float s1 = src1[j];
-        float wi = win[i];
-        float wj = win[j];
-        dst[i] = s0 * wj - s1 * wi;
-        dst[j] = s0 * wi + s1 * wj;
-    }
-}
-
-static void vector_fmul_add_c(float *dst, const float *src0, const float *src1,
-                              const float *src2, int len){
-    int i;
-
-    for (i = 0; i < len; i++)
-        dst[i] = src0[i] * src1[i] + src2[i];
-}
-
-static void vector_fmul_reverse_c(float *dst, const float *src0,
-                                  const float *src1, int len)
-{
-    int i;
-
-    src1 += len-1;
-    for (i = 0; i < len; i++)
-        dst[i] = src0[i] * src1[-i];
-}
-
-static void butterflies_float_c(float *restrict v1, float *restrict v2,
-                                int len)
-{
-    int i;
-
-    for (i = 0; i < len; i++) {
-        float t = v1[i] - v2[i];
-        v1[i] += v2[i];
-        v2[i] = t;
-    }
-}
-
-float avpriv_scalarproduct_float_c(const float *v1, const float *v2, int len)
-{
-    float p = 0.0;
-    int i;
-
-    for (i = 0; i < len; i++)
-        p += v1[i] * v2[i];
-
-    return p;
-}
-
-av_cold void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact)
-{
-    fdsp->vector_fmul = vector_fmul_c;
-    fdsp->vector_fmac_scalar = vector_fmac_scalar_c;
-    fdsp->vector_fmul_scalar = vector_fmul_scalar_c;
-    fdsp->vector_dmul_scalar = vector_dmul_scalar_c;
-    fdsp->vector_fmul_window = vector_fmul_window_c;
-    fdsp->vector_fmul_add = vector_fmul_add_c;
-    fdsp->vector_fmul_reverse = vector_fmul_reverse_c;
-    fdsp->butterflies_float = butterflies_float_c;
-    fdsp->scalarproduct_float = avpriv_scalarproduct_float_c;
-
-#if ARCH_ARM
-    ff_float_dsp_init_arm(fdsp);
-#elif ARCH_PPC
-    ff_float_dsp_init_ppc(fdsp, bit_exact);
-#elif ARCH_X86
-    ff_float_dsp_init_x86(fdsp);
-#endif
-}
diff --git a/deps/libav/libavutil/float_dsp.h b/deps/libav/libavutil/float_dsp.h
deleted file mode 100644
index 0eb02f8..0000000
--- a/deps/libav/libavutil/float_dsp.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_FLOAT_DSP_H
-#define AVUTIL_FLOAT_DSP_H
-
-#include "config.h"
-
-typedef struct AVFloatDSPContext {
-    /**
-     * Calculate the product of two vectors of floats and store the result in
-     * a vector of floats.
-     *
-     * @param dst  output vector
-     *             constraints: 32-byte aligned
-     * @param src0 first input vector
-     *             constraints: 32-byte aligned
-     * @param src1 second input vector
-     *             constraints: 32-byte aligned
-     * @param len  number of elements in the input
-     *             constraints: multiple of 16
-     */
-    void (*vector_fmul)(float *dst, const float *src0, const float *src1,
-                        int len);
-
-    /**
-     * Multiply a vector of floats by a scalar float and add to
-     * destination vector.  Source and destination vectors must
-     * overlap exactly or not at all.
-     *
-     * @param dst result vector
-     *            constraints: 32-byte aligned
-     * @param src input vector
-     *            constraints: 32-byte aligned
-     * @param mul scalar value
-     * @param len length of vector
-     *            constraints: multiple of 16
-     */
-    void (*vector_fmac_scalar)(float *dst, const float *src, float mul,
-                               int len);
-
-    /**
-     * Multiply a vector of floats by a scalar float.  Source and
-     * destination vectors must overlap exactly or not at all.
-     *
-     * @param dst result vector
-     *            constraints: 16-byte aligned
-     * @param src input vector
-     *            constraints: 16-byte aligned
-     * @param mul scalar value
-     * @param len length of vector
-     *            constraints: multiple of 4
-     */
-    void (*vector_fmul_scalar)(float *dst, const float *src, float mul,
-                               int len);
-
-    /**
-     * Multiply a vector of double by a scalar double.  Source and
-     * destination vectors must overlap exactly or not at all.
-     *
-     * @param dst result vector
-     *            constraints: 32-byte aligned
-     * @param src input vector
-     *            constraints: 32-byte aligned
-     * @param mul scalar value
-     * @param len length of vector
-     *            constraints: multiple of 8
-     */
-    void (*vector_dmul_scalar)(double *dst, const double *src, double mul,
-                               int len);
-
-    /**
-     * Overlap/add with window function.
-     * Used primarily by MDCT-based audio codecs.
-     * Source and destination vectors must overlap exactly or not at all.
-     *
-     * @param dst  result vector
-     *             constraints: 16-byte aligned
-     * @param src0 first source vector
-     *             constraints: 16-byte aligned
-     * @param src1 second source vector
-     *             constraints: 16-byte aligned
-     * @param win  half-window vector
-     *             constraints: 16-byte aligned
-     * @param len  length of vector
-     *             constraints: multiple of 4
-     */
-    void (*vector_fmul_window)(float *dst, const float *src0,
-                               const float *src1, const float *win, int len);
-
-    /**
-     * Calculate the product of two vectors of floats, add a third vector of
-     * floats and store the result in a vector of floats.
-     *
-     * @param dst  output vector
-     *             constraints: 32-byte aligned
-     * @param src0 first input vector
-     *             constraints: 32-byte aligned
-     * @param src1 second input vector
-     *             constraints: 32-byte aligned
-     * @param src2 third input vector
-     *             constraints: 32-byte aligned
-     * @param len  number of elements in the input
-     *             constraints: multiple of 16
-     */
-    void (*vector_fmul_add)(float *dst, const float *src0, const float *src1,
-                            const float *src2, int len);
-
-    /**
-     * Calculate the product of two vectors of floats, and store the result
-     * in a vector of floats. The second vector of floats is iterated over
-     * in reverse order.
-     *
-     * @param dst  output vector
-     *             constraints: 32-byte aligned
-     * @param src0 first input vector
-     *             constraints: 32-byte aligned
-     * @param src1 second input vector
-     *             constraints: 32-byte aligned
-     * @param len  number of elements in the input
-     *             constraints: multiple of 16
-     */
-    void (*vector_fmul_reverse)(float *dst, const float *src0,
-                                const float *src1, int len);
-
-    /**
-     * Calculate the sum and difference of two vectors of floats.
-     *
-     * @param v1  first input vector, sum output, 16-byte aligned
-     * @param v2  second input vector, difference output, 16-byte aligned
-     * @param len length of vectors, multiple of 4
-     */
-    void (*butterflies_float)(float *restrict v1, float *restrict v2, int len);
-
-    /**
-     * Calculate the scalar product of two vectors of floats.
-     *
-     * @param v1  first vector, 16-byte aligned
-     * @param v2  second vector, 16-byte aligned
-     * @param len length of vectors, multiple of 4
-     *
-     * @return sum of elementwise products
-     */
-    float (*scalarproduct_float)(const float *v1, const float *v2, int len);
-} AVFloatDSPContext;
-
-/**
- * Return the scalar product of two vectors.
- *
- * @param v1  first input vector
- * @param v2  first input vector
- * @param len number of elements
- *
- * @return sum of elementwise products
- */
-float avpriv_scalarproduct_float_c(const float *v1, const float *v2, int len);
-
-/**
- * Initialize a float DSP context.
- *
- * @param fdsp    float DSP context
- * @param strict  setting to non-zero avoids using functions which may not be IEEE-754 compliant
- */
-void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int strict);
-
-
-void ff_float_dsp_init_arm(AVFloatDSPContext *fdsp);
-void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int strict);
-void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp);
-
-#endif /* AVUTIL_FLOAT_DSP_H */
diff --git a/deps/libav/libavutil/frame.c b/deps/libav/libavutil/frame.c
deleted file mode 100644
index 2529ae5..0000000
--- a/deps/libav/libavutil/frame.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "channel_layout.h"
-#include "buffer.h"
-#include "common.h"
-#include "dict.h"
-#include "frame.h"
-#include "imgutils.h"
-#include "mem.h"
-#include "samplefmt.h"
-
-static void get_frame_defaults(AVFrame *frame)
-{
-    if (frame->extended_data != frame->data)
-        av_freep(&frame->extended_data);
-
-    memset(frame, 0, sizeof(*frame));
-
-    frame->pts                 = AV_NOPTS_VALUE;
-    frame->key_frame           = 1;
-    frame->sample_aspect_ratio = (AVRational){ 0, 1 };
-    frame->format              = -1; /* unknown */
-    frame->extended_data       = frame->data;
-}
-
-AVFrame *av_frame_alloc(void)
-{
-    AVFrame *frame = av_mallocz(sizeof(*frame));
-
-    if (!frame)
-        return NULL;
-
-    get_frame_defaults(frame);
-
-    return frame;
-}
-
-void av_frame_free(AVFrame **frame)
-{
-    if (!frame || !*frame)
-        return;
-
-    av_frame_unref(*frame);
-    av_freep(frame);
-}
-
-static int get_video_buffer(AVFrame *frame, int align)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
-    int ret, i;
-
-    if (!desc)
-        return AVERROR(EINVAL);
-
-    if ((ret = av_image_check_size(frame->width, frame->height, 0, NULL)) < 0)
-        return ret;
-
-    if (!frame->linesize[0]) {
-        ret = av_image_fill_linesizes(frame->linesize, frame->format,
-                                      frame->width);
-        if (ret < 0)
-            return ret;
-
-        for (i = 0; i < 4 && frame->linesize[i]; i++)
-            frame->linesize[i] = FFALIGN(frame->linesize[i], align);
-    }
-
-    for (i = 0; i < 4 && frame->linesize[i]; i++) {
-        int h = frame->height;
-        if (i == 1 || i == 2)
-            h = -((-h) >> desc->log2_chroma_h);
-
-        frame->buf[i] = av_buffer_alloc(frame->linesize[i] * h);
-        if (!frame->buf[i])
-            goto fail;
-
-        frame->data[i] = frame->buf[i]->data;
-    }
-    if (desc->flags & AV_PIX_FMT_FLAG_PAL || desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
-        av_buffer_unref(&frame->buf[1]);
-        frame->buf[1] = av_buffer_alloc(1024);
-        if (!frame->buf[1])
-            goto fail;
-        frame->data[1] = frame->buf[1]->data;
-    }
-
-    frame->extended_data = frame->data;
-
-    return 0;
-fail:
-    av_frame_unref(frame);
-    return AVERROR(ENOMEM);
-}
-
-static int get_audio_buffer(AVFrame *frame, int align)
-{
-    int channels = av_get_channel_layout_nb_channels(frame->channel_layout);
-    int planar   = av_sample_fmt_is_planar(frame->format);
-    int planes   = planar ? channels : 1;
-    int ret, i;
-
-    if (!frame->linesize[0]) {
-        ret = av_samples_get_buffer_size(&frame->linesize[0], channels,
-                                         frame->nb_samples, frame->format,
-                                         align);
-        if (ret < 0)
-            return ret;
-    }
-
-    if (planes > AV_NUM_DATA_POINTERS) {
-        frame->extended_data = av_mallocz(planes *
-                                          sizeof(*frame->extended_data));
-        frame->extended_buf  = av_mallocz((planes - AV_NUM_DATA_POINTERS) *
-                                          sizeof(*frame->extended_buf));
-        if (!frame->extended_data || !frame->extended_buf) {
-            av_freep(&frame->extended_data);
-            av_freep(&frame->extended_buf);
-            return AVERROR(ENOMEM);
-        }
-        frame->nb_extended_buf = planes - AV_NUM_DATA_POINTERS;
-    } else
-        frame->extended_data = frame->data;
-
-    for (i = 0; i < FFMIN(planes, AV_NUM_DATA_POINTERS); i++) {
-        frame->buf[i] = av_buffer_alloc(frame->linesize[0]);
-        if (!frame->buf[i]) {
-            av_frame_unref(frame);
-            return AVERROR(ENOMEM);
-        }
-        frame->extended_data[i] = frame->data[i] = frame->buf[i]->data;
-    }
-    for (i = 0; i < planes - AV_NUM_DATA_POINTERS; i++) {
-        frame->extended_buf[i] = av_buffer_alloc(frame->linesize[0]);
-        if (!frame->extended_buf[i]) {
-            av_frame_unref(frame);
-            return AVERROR(ENOMEM);
-        }
-        frame->extended_data[i + AV_NUM_DATA_POINTERS] = frame->extended_buf[i]->data;
-    }
-    return 0;
-
-}
-
-int av_frame_get_buffer(AVFrame *frame, int align)
-{
-    if (frame->format < 0)
-        return AVERROR(EINVAL);
-
-    if (frame->width > 0 && frame->height > 0)
-        return get_video_buffer(frame, align);
-    else if (frame->nb_samples > 0 && frame->channel_layout)
-        return get_audio_buffer(frame, align);
-
-    return AVERROR(EINVAL);
-}
-
-int av_frame_ref(AVFrame *dst, const AVFrame *src)
-{
-    int i, ret = 0;
-
-    dst->format         = src->format;
-    dst->width          = src->width;
-    dst->height         = src->height;
-    dst->channel_layout = src->channel_layout;
-    dst->nb_samples     = src->nb_samples;
-
-    ret = av_frame_copy_props(dst, src);
-    if (ret < 0)
-        return ret;
-
-    /* duplicate the frame data if it's not refcounted */
-    if (!src->buf[0]) {
-        ret = av_frame_get_buffer(dst, 32);
-        if (ret < 0)
-            return ret;
-
-        if (src->nb_samples) {
-            int ch = av_get_channel_layout_nb_channels(src->channel_layout);
-            av_samples_copy(dst->extended_data, src->extended_data, 0, 0,
-                            dst->nb_samples, ch, dst->format);
-        } else {
-            av_image_copy(dst->data, dst->linesize, src->data, src->linesize,
-                          dst->format, dst->width, dst->height);
-        }
-        return 0;
-    }
-
-    /* ref the buffers */
-    for (i = 0; i < FF_ARRAY_ELEMS(src->buf) && src->buf[i]; i++) {
-        dst->buf[i] = av_buffer_ref(src->buf[i]);
-        if (!dst->buf[i]) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-    }
-
-    if (src->extended_buf) {
-        dst->extended_buf = av_mallocz(sizeof(*dst->extended_buf) *
-                                       src->nb_extended_buf);
-        if (!dst->extended_buf) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        dst->nb_extended_buf = src->nb_extended_buf;
-
-        for (i = 0; i < src->nb_extended_buf; i++) {
-            dst->extended_buf[i] = av_buffer_ref(src->extended_buf[i]);
-            if (!dst->extended_buf[i]) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-        }
-    }
-
-    /* duplicate extended data */
-    if (src->extended_data != src->data) {
-        int ch = av_get_channel_layout_nb_channels(src->channel_layout);
-
-        if (!ch) {
-            ret = AVERROR(EINVAL);
-            goto fail;
-        }
-
-        dst->extended_data = av_malloc(sizeof(*dst->extended_data) * ch);
-        if (!dst->extended_data) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        memcpy(dst->extended_data, src->extended_data, sizeof(*src->extended_data) * ch);
-    } else
-        dst->extended_data = dst->data;
-
-    memcpy(dst->data,     src->data,     sizeof(src->data));
-    memcpy(dst->linesize, src->linesize, sizeof(src->linesize));
-
-    return 0;
-
-fail:
-    av_frame_unref(dst);
-    return ret;
-}
-
-AVFrame *av_frame_clone(const AVFrame *src)
-{
-    AVFrame *ret = av_frame_alloc();
-
-    if (!ret)
-        return NULL;
-
-    if (av_frame_ref(ret, src) < 0)
-        av_frame_free(&ret);
-
-    return ret;
-}
-
-void av_frame_unref(AVFrame *frame)
-{
-    int i;
-
-    for (i = 0; i < frame->nb_side_data; i++) {
-        av_freep(&frame->side_data[i]->data);
-        av_dict_free(&frame->side_data[i]->metadata);
-        av_freep(&frame->side_data[i]);
-    }
-    av_freep(&frame->side_data);
-
-    for (i = 0; i < FF_ARRAY_ELEMS(frame->buf); i++)
-        av_buffer_unref(&frame->buf[i]);
-    for (i = 0; i < frame->nb_extended_buf; i++)
-        av_buffer_unref(&frame->extended_buf[i]);
-    av_freep(&frame->extended_buf);
-    get_frame_defaults(frame);
-}
-
-void av_frame_move_ref(AVFrame *dst, AVFrame *src)
-{
-    *dst = *src;
-    if (src->extended_data == src->data)
-        dst->extended_data = dst->data;
-    memset(src, 0, sizeof(*src));
-    get_frame_defaults(src);
-}
-
-int av_frame_is_writable(AVFrame *frame)
-{
-    int i, ret = 1;
-
-    /* assume non-refcounted frames are not writable */
-    if (!frame->buf[0])
-        return 0;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(frame->buf) && frame->buf[i]; i++)
-        ret &= !!av_buffer_is_writable(frame->buf[i]);
-    for (i = 0; i < frame->nb_extended_buf; i++)
-        ret &= !!av_buffer_is_writable(frame->extended_buf[i]);
-
-    return ret;
-}
-
-int av_frame_make_writable(AVFrame *frame)
-{
-    AVFrame tmp;
-    int ret;
-
-    if (!frame->buf[0])
-        return AVERROR(EINVAL);
-
-    if (av_frame_is_writable(frame))
-        return 0;
-
-    memset(&tmp, 0, sizeof(tmp));
-    tmp.format         = frame->format;
-    tmp.width          = frame->width;
-    tmp.height         = frame->height;
-    tmp.channel_layout = frame->channel_layout;
-    tmp.nb_samples     = frame->nb_samples;
-    ret = av_frame_get_buffer(&tmp, 32);
-    if (ret < 0)
-        return ret;
-
-    if (tmp.nb_samples) {
-        int ch = av_get_channel_layout_nb_channels(tmp.channel_layout);
-        av_samples_copy(tmp.extended_data, frame->extended_data, 0, 0,
-                        frame->nb_samples, ch, frame->format);
-    } else {
-        av_image_copy(tmp.data, tmp.linesize, frame->data, frame->linesize,
-                      frame->format, frame->width, frame->height);
-    }
-
-    ret = av_frame_copy_props(&tmp, frame);
-    if (ret < 0) {
-        av_frame_unref(&tmp);
-        return ret;
-    }
-
-    av_frame_unref(frame);
-
-    *frame = tmp;
-    if (tmp.data == tmp.extended_data)
-        frame->extended_data = frame->data;
-
-    return 0;
-}
-
-int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
-{
-    int i;
-
-    dst->key_frame              = src->key_frame;
-    dst->pict_type              = src->pict_type;
-    dst->sample_aspect_ratio    = src->sample_aspect_ratio;
-    dst->pts                    = src->pts;
-    dst->repeat_pict            = src->repeat_pict;
-    dst->interlaced_frame       = src->interlaced_frame;
-    dst->top_field_first        = src->top_field_first;
-    dst->palette_has_changed    = src->palette_has_changed;
-    dst->sample_rate            = src->sample_rate;
-    dst->opaque                 = src->opaque;
-    dst->pkt_pts                = src->pkt_pts;
-    dst->pkt_dts                = src->pkt_dts;
-    dst->reordered_opaque       = src->reordered_opaque;
-    dst->quality                = src->quality;
-    dst->coded_picture_number   = src->coded_picture_number;
-    dst->display_picture_number = src->display_picture_number;
-    dst->flags                  = src->flags;
-
-    memcpy(dst->error, src->error, sizeof(dst->error));
-
-    for (i = 0; i < src->nb_side_data; i++) {
-        const AVFrameSideData *sd_src = src->side_data[i];
-        AVFrameSideData *sd_dst = av_frame_new_side_data(dst, sd_src->type,
-                                                         sd_src->size);
-        if (!sd_dst) {
-            for (i = 0; i < dst->nb_side_data; i++) {
-                av_freep(&dst->side_data[i]->data);
-                av_freep(&dst->side_data[i]);
-                av_dict_free(&dst->side_data[i]->metadata);
-            }
-            av_freep(&dst->side_data);
-            return AVERROR(ENOMEM);
-        }
-        memcpy(sd_dst->data, sd_src->data, sd_src->size);
-        av_dict_copy(&sd_dst->metadata, sd_src->metadata, 0);
-    }
-
-    return 0;
-}
-
-AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane)
-{
-    uint8_t *data;
-    int planes, i;
-
-    if (frame->nb_samples) {
-        int channels = av_get_channel_layout_nb_channels(frame->channel_layout);
-        if (!channels)
-            return NULL;
-        planes = av_sample_fmt_is_planar(frame->format) ? channels : 1;
-    } else
-        planes = 4;
-
-    if (plane < 0 || plane >= planes || !frame->extended_data[plane])
-        return NULL;
-    data = frame->extended_data[plane];
-
-    for (i = 0; i < FF_ARRAY_ELEMS(frame->buf) && frame->buf[i]; i++) {
-        AVBufferRef *buf = frame->buf[i];
-        if (data >= buf->data && data < buf->data + buf->size)
-            return buf;
-    }
-    for (i = 0; i < frame->nb_extended_buf; i++) {
-        AVBufferRef *buf = frame->extended_buf[i];
-        if (data >= buf->data && data < buf->data + buf->size)
-            return buf;
-    }
-    return NULL;
-}
-
-AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
-                                        enum AVFrameSideDataType type,
-                                        int size)
-{
-    AVFrameSideData *ret, **tmp;
-
-    if (frame->nb_side_data > INT_MAX / sizeof(*frame->side_data) - 1)
-        return NULL;
-
-    tmp = av_realloc(frame->side_data,
-                     (frame->nb_side_data + 1) * sizeof(*frame->side_data));
-    if (!tmp)
-        return NULL;
-    frame->side_data = tmp;
-
-    ret = av_mallocz(sizeof(*ret));
-    if (!ret)
-        return NULL;
-
-    ret->data = av_malloc(size);
-    if (!ret->data) {
-        av_freep(&ret);
-        return NULL;
-    }
-
-    ret->size = size;
-    ret->type = type;
-
-    frame->side_data[frame->nb_side_data++] = ret;
-
-    return ret;
-}
-
-AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
-                                        enum AVFrameSideDataType type)
-{
-    int i;
-
-    for (i = 0; i < frame->nb_side_data; i++) {
-        if (frame->side_data[i]->type == type)
-            return frame->side_data[i];
-    }
-    return NULL;
-}
diff --git a/deps/libav/libavutil/frame.h b/deps/libav/libavutil/frame.h
deleted file mode 100644
index 63ed219..0000000
--- a/deps/libav/libavutil/frame.h
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @ingroup lavu_frame
- * reference-counted frame API
- */
-
-#ifndef AVUTIL_FRAME_H
-#define AVUTIL_FRAME_H
-
-#include <stdint.h>
-
-#include "avutil.h"
-#include "buffer.h"
-#include "dict.h"
-#include "rational.h"
-#include "samplefmt.h"
-#include "version.h"
-
-
-/**
- * @defgroup lavu_frame AVFrame
- * @ingroup lavu_data
- *
- * @{
- * AVFrame is an abstraction for reference-counted raw multimedia data.
- */
-
-enum AVFrameSideDataType {
-    /**
-     * The data is the AVPanScan struct defined in libavcodec.
-     */
-    AV_FRAME_DATA_PANSCAN,
-    /**
-     * ATSC A53 Part 4 Closed Captions.
-     * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data.
-     * The number of bytes of CC data is AVFrameSideData.size.
-     */
-    AV_FRAME_DATA_A53_CC,
-    /**
-     * Stereoscopic 3d metadata.
-     * The data is the AVStereo3D struct defined in libavutil/stereo3d.h.
-     */
-    AV_FRAME_DATA_STEREO3D,
-    /**
-     * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
-     */
-    AV_FRAME_DATA_MATRIXENCODING,
-    /**
-     * Metadata relevant to a downmix procedure.
-     * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h.
-     */
-    AV_FRAME_DATA_DOWNMIX_INFO,
-};
-
-typedef struct AVFrameSideData {
-    enum AVFrameSideDataType type;
-    uint8_t *data;
-    int      size;
-    AVDictionary *metadata;
-} AVFrameSideData;
-
-/**
- * This structure describes decoded (raw) audio or video data.
- *
- * AVFrame must be allocated using av_frame_alloc(). Note that this only
- * allocates the AVFrame itself, the buffers for the data must be managed
- * through other means (see below).
- * AVFrame must be freed with av_frame_free().
- *
- * AVFrame is typically allocated once and then reused multiple times to hold
- * different data (e.g. a single AVFrame to hold frames received from a
- * decoder). In such a case, av_frame_unref() will free any references held by
- * the frame and reset it to its original clean state before it
- * is reused again.
- *
- * The data described by an AVFrame is usually reference counted through the
- * AVBuffer API. The underlying buffer references are stored in AVFrame.buf /
- * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at
- * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case,
- * every single data plane must be contained in one of the buffers in
- * AVFrame.buf or AVFrame.extended_buf.
- * There may be a single buffer for all the data, or one separate buffer for
- * each plane, or anything in between.
- *
- * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added
- * to the end with a minor bump.
- */
-typedef struct AVFrame {
-#define AV_NUM_DATA_POINTERS 8
-    /**
-     * pointer to the picture/channel planes.
-     * This might be different from the first allocated byte
-     */
-    uint8_t *data[AV_NUM_DATA_POINTERS];
-
-    /**
-     * For video, size in bytes of each picture line.
-     * For audio, size in bytes of each plane.
-     *
-     * For audio, only linesize[0] may be set. For planar audio, each channel
-     * plane must be the same size.
-     *
-     * @note The linesize may be larger than the size of usable data -- there
-     * may be extra padding present for performance reasons.
-     */
-    int linesize[AV_NUM_DATA_POINTERS];
-
-    /**
-     * pointers to the data planes/channels.
-     *
-     * For video, this should simply point to data[].
-     *
-     * For planar audio, each channel has a separate data pointer, and
-     * linesize[0] contains the size of each channel buffer.
-     * For packed audio, there is just one data pointer, and linesize[0]
-     * contains the total size of the buffer for all channels.
-     *
-     * Note: Both data and extended_data should always be set in a valid frame,
-     * but for planar audio with more channels that can fit in data,
-     * extended_data must be used in order to access all channels.
-     */
-    uint8_t **extended_data;
-
-    /**
-     * width and height of the video frame
-     */
-    int width, height;
-
-    /**
-     * number of audio samples (per channel) described by this frame
-     */
-    int nb_samples;
-
-    /**
-     * format of the frame, -1 if unknown or unset
-     * Values correspond to enum AVPixelFormat for video frames,
-     * enum AVSampleFormat for audio)
-     */
-    int format;
-
-    /**
-     * 1 -> keyframe, 0-> not
-     */
-    int key_frame;
-
-    /**
-     * Picture type of the frame.
-     */
-    enum AVPictureType pict_type;
-
-#if FF_API_AVFRAME_LAVC
-    attribute_deprecated
-    uint8_t *base[AV_NUM_DATA_POINTERS];
-#endif
-
-    /**
-     * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
-     */
-    AVRational sample_aspect_ratio;
-
-    /**
-     * Presentation timestamp in time_base units (time when frame should be shown to user).
-     */
-    int64_t pts;
-
-    /**
-     * PTS copied from the AVPacket that was decoded to produce this frame.
-     */
-    int64_t pkt_pts;
-
-    /**
-     * DTS copied from the AVPacket that triggered returning this frame.
-     */
-    int64_t pkt_dts;
-
-    /**
-     * picture number in bitstream order
-     */
-    int coded_picture_number;
-    /**
-     * picture number in display order
-     */
-    int display_picture_number;
-
-    /**
-     * quality (between 1 (good) and FF_LAMBDA_MAX (bad))
-     */
-    int quality;
-
-#if FF_API_AVFRAME_LAVC
-    attribute_deprecated
-    int reference;
-
-    /**
-     * QP table
-     */
-    attribute_deprecated
-    int8_t *qscale_table;
-    /**
-     * QP store stride
-     */
-    attribute_deprecated
-    int qstride;
-
-    attribute_deprecated
-    int qscale_type;
-
-    /**
-     * mbskip_table[mb]>=1 if MB didn't change
-     * stride= mb_width = (width+15)>>4
-     */
-    attribute_deprecated
-    uint8_t *mbskip_table;
-
-    /**
-     * motion vector table
-     * @code
-     * example:
-     * int mv_sample_log2= 4 - motion_subsample_log2;
-     * int mb_width= (width+15)>>4;
-     * int mv_stride= (mb_width << mv_sample_log2) + 1;
-     * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
-     * @endcode
-     */
-    attribute_deprecated
-    int16_t (*motion_val[2])[2];
-
-    /**
-     * macroblock type table
-     * mb_type_base + mb_width + 2
-     */
-    attribute_deprecated
-    uint32_t *mb_type;
-
-    /**
-     * DCT coefficients
-     */
-    attribute_deprecated
-    short *dct_coeff;
-
-    /**
-     * motion reference frame index
-     * the order in which these are stored can depend on the codec.
-     */
-    attribute_deprecated
-    int8_t *ref_index[2];
-#endif
-
-    /**
-     * for some private data of the user
-     */
-    void *opaque;
-
-    /**
-     * error
-     */
-    uint64_t error[AV_NUM_DATA_POINTERS];
-
-#if FF_API_AVFRAME_LAVC
-    attribute_deprecated
-    int type;
-#endif
-
-    /**
-     * When decoding, this signals how much the picture must be delayed.
-     * extra_delay = repeat_pict / (2*fps)
-     */
-    int repeat_pict;
-
-    /**
-     * The content of the picture is interlaced.
-     */
-    int interlaced_frame;
-
-    /**
-     * If the content is interlaced, is top field displayed first.
-     */
-    int top_field_first;
-
-    /**
-     * Tell user application that palette has changed from previous frame.
-     */
-    int palette_has_changed;
-
-#if FF_API_AVFRAME_LAVC
-    attribute_deprecated
-    int buffer_hints;
-
-    /**
-     * Pan scan.
-     */
-    attribute_deprecated
-    struct AVPanScan *pan_scan;
-#endif
-
-    /**
-     * reordered opaque 64bit (generally an integer or a double precision float
-     * PTS but can be anything).
-     * The user sets AVCodecContext.reordered_opaque to represent the input at
-     * that time,
-     * the decoder reorders values as needed and sets AVFrame.reordered_opaque
-     * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
-     * @deprecated in favor of pkt_pts
-     */
-    int64_t reordered_opaque;
-
-#if FF_API_AVFRAME_LAVC
-    /**
-     * @deprecated this field is unused
-     */
-    attribute_deprecated void *hwaccel_picture_private;
-
-    attribute_deprecated
-    struct AVCodecContext *owner;
-    attribute_deprecated
-    void *thread_opaque;
-
-    /**
-     * log2 of the size of the block which a single vector in motion_val represents:
-     * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
-     */
-    attribute_deprecated
-    uint8_t motion_subsample_log2;
-#endif
-
-    /**
-     * Sample rate of the audio data.
-     */
-    int sample_rate;
-
-    /**
-     * Channel layout of the audio data.
-     */
-    uint64_t channel_layout;
-
-    /**
-     * AVBuffer references backing the data for this frame. If all elements of
-     * this array are NULL, then this frame is not reference counted.
-     *
-     * There may be at most one AVBuffer per data plane, so for video this array
-     * always contains all the references. For planar audio with more than
-     * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
-     * this array. Then the extra AVBufferRef pointers are stored in the
-     * extended_buf array.
-     */
-    AVBufferRef *buf[AV_NUM_DATA_POINTERS];
-
-    /**
-     * For planar audio which requires more than AV_NUM_DATA_POINTERS
-     * AVBufferRef pointers, this array will hold all the references which
-     * cannot fit into AVFrame.buf.
-     *
-     * Note that this is different from AVFrame.extended_data, which always
-     * contains all the pointers. This array only contains the extra pointers,
-     * which cannot fit into AVFrame.buf.
-     *
-     * This array is always allocated using av_malloc() by whoever constructs
-     * the frame. It is freed in av_frame_unref().
-     */
-    AVBufferRef **extended_buf;
-    /**
-     * Number of elements in extended_buf.
-     */
-    int        nb_extended_buf;
-
-    AVFrameSideData **side_data;
-    int            nb_side_data;
-
-/**
- * @defgroup lavu_frame_flags AV_FRAME_FLAGS
- * Flags describing additional frame properties.
- *
- * @{
- */
-
-/**
- * The frame data may be corrupted, e.g. due to decoding errors.
- */
-#define AV_FRAME_FLAG_CORRUPT       (1 << 0)
-/**
- * @}
- */
-
-    /**
-     * Frame flags, a combination of @ref lavu_frame_flags
-     */
-    int flags;
-} AVFrame;
-
-/**
- * Allocate an AVFrame and set its fields to default values.  The resulting
- * struct must be freed using av_frame_free().
- *
- * @return An AVFrame filled with default values or NULL on failure.
- *
- * @note this only allocates the AVFrame itself, not the data buffers. Those
- * must be allocated through other means, e.g. with av_frame_get_buffer() or
- * manually.
- */
-AVFrame *av_frame_alloc(void);
-
-/**
- * Free the frame and any dynamically allocated objects in it,
- * e.g. extended_data. If the frame is reference counted, it will be
- * unreferenced first.
- *
- * @param frame frame to be freed. The pointer will be set to NULL.
- */
-void av_frame_free(AVFrame **frame);
-
-/**
- * Set up a new reference to the data described by the source frame.
- *
- * Copy frame properties from src to dst and create a new reference for each
- * AVBufferRef from src.
- *
- * If src is not reference counted, new buffers are allocated and the data is
- * copied.
- *
- * @return 0 on success, a negative AVERROR on error
- */
-int av_frame_ref(AVFrame *dst, const AVFrame *src);
-
-/**
- * Create a new frame that references the same data as src.
- *
- * This is a shortcut for av_frame_alloc()+av_frame_ref().
- *
- * @return newly created AVFrame on success, NULL on error.
- */
-AVFrame *av_frame_clone(const AVFrame *src);
-
-/**
- * Unreference all the buffers referenced by frame and reset the frame fields.
- */
-void av_frame_unref(AVFrame *frame);
-
-/**
- * Move everythnig contained in src to dst and reset src.
- */
-void av_frame_move_ref(AVFrame *dst, AVFrame *src);
-
-/**
- * Allocate new buffer(s) for audio or video data.
- *
- * The following fields must be set on frame before calling this function:
- * - format (pixel format for video, sample format for audio)
- * - width and height for video
- * - nb_samples and channel_layout for audio
- *
- * This function will fill AVFrame.data and AVFrame.buf arrays and, if
- * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf.
- * For planar formats, one buffer will be allocated for each plane.
- *
- * @param frame frame in which to store the new buffers.
- * @param align required buffer size alignment
- *
- * @return 0 on success, a negative AVERROR on error.
- */
-int av_frame_get_buffer(AVFrame *frame, int align);
-
-/**
- * Check if the frame data is writable.
- *
- * @return A positive value if the frame data is writable (which is true if and
- * only if each of the underlying buffers has only one reference, namely the one
- * stored in this frame). Return 0 otherwise.
- *
- * If 1 is returned the answer is valid until av_buffer_ref() is called on any
- * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly).
- *
- * @see av_frame_make_writable(), av_buffer_is_writable()
- */
-int av_frame_is_writable(AVFrame *frame);
-
-/**
- * Ensure that the frame data is writable, avoiding data copy if possible.
- *
- * Do nothing if the frame is writable, allocate new buffers and copy the data
- * if it is not.
- *
- * @return 0 on success, a negative AVERROR on error.
- *
- * @see av_frame_is_writable(), av_buffer_is_writable(),
- * av_buffer_make_writable()
- */
-int av_frame_make_writable(AVFrame *frame);
-
-/**
- * Copy only "metadata" fields from src to dst.
- *
- * Metadata for the purpose of this function are those fields that do not affect
- * the data layout in the buffers.  E.g. pts, sample rate (for audio) or sample
- * aspect ratio (for video), but not width/height or channel layout.
- * Side data is also copied.
- */
-int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
-
-/**
- * Get the buffer reference a given data plane is stored in.
- *
- * @param plane index of the data plane of interest in frame->extended_data.
- *
- * @return the buffer reference that contains the plane or NULL if the input
- * frame is not valid.
- */
-AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
-
-/**
- * Add a new side data to a frame.
- *
- * @param frame a frame to which the side data should be added
- * @param type type of the added side data
- * @param size size of the side data
- *
- * @return newly added side data on success, NULL on error
- */
-AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
-                                        enum AVFrameSideDataType type,
-                                        int size);
-
-/**
- * @return a pointer to the side data of a given type on success, NULL if there
- * is no side data with such type in this frame.
- */
-AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
-                                        enum AVFrameSideDataType type);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_FRAME_H */
diff --git a/deps/libav/libavutil/hmac.c b/deps/libav/libavutil/hmac.c
deleted file mode 100644
index f87728e..0000000
--- a/deps/libav/libavutil/hmac.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (C) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "attributes.h"
-#include "hmac.h"
-#include "md5.h"
-#include "sha.h"
-#include "mem.h"
-
-#define MAX_HASHLEN 20
-#define MAX_BLOCKLEN 64
-
-struct AVHMAC {
-    void *hash;
-    int blocklen, hashlen;
-    void (*final)(void*, uint8_t*);
-    void (*update)(void*, const uint8_t*, int len);
-    void (*init)(void*);
-    uint8_t key[MAX_BLOCKLEN];
-    int keylen;
-};
-
-static av_cold void sha1_init(void *ctx)
-{
-    av_sha_init(ctx, 160);
-}
-
-AVHMAC *av_hmac_alloc(enum AVHMACType type)
-{
-    AVHMAC *c = av_mallocz(sizeof(*c));
-    if (!c)
-        return NULL;
-    switch (type) {
-    case AV_HMAC_MD5:
-        c->blocklen = 64;
-        c->hashlen  = 16;
-        c->init     = av_md5_init;
-        c->update   = av_md5_update;
-        c->final    = av_md5_final;
-        c->hash     = av_md5_alloc();
-        break;
-    case AV_HMAC_SHA1:
-        c->blocklen = 64;
-        c->hashlen  = 20;
-        c->init     = sha1_init;
-        c->update   = av_sha_update;
-        c->final    = av_sha_final;
-        c->hash     = av_sha_alloc();
-        break;
-    default:
-        av_free(c);
-        return NULL;
-    }
-    if (!c->hash) {
-        av_free(c);
-        return NULL;
-    }
-    return c;
-}
-
-void av_hmac_free(AVHMAC *c)
-{
-    if (!c)
-        return;
-    av_free(c->hash);
-    av_free(c);
-}
-
-void av_hmac_init(AVHMAC *c, const uint8_t *key, unsigned int keylen)
-{
-    int i;
-    uint8_t block[MAX_BLOCKLEN];
-    if (keylen > c->blocklen) {
-        c->init(c->hash);
-        c->update(c->hash, key, keylen);
-        c->final(c->hash, c->key);
-        c->keylen = c->hashlen;
-    } else {
-        memcpy(c->key, key, keylen);
-        c->keylen = keylen;
-    }
-    c->init(c->hash);
-    for (i = 0; i < c->keylen; i++)
-        block[i] = c->key[i] ^ 0x36;
-    for (i = c->keylen; i < c->blocklen; i++)
-        block[i] = 0x36;
-    c->update(c->hash, block, c->blocklen);
-}
-
-void av_hmac_update(AVHMAC *c, const uint8_t *data, unsigned int len)
-{
-    c->update(c->hash, data, len);
-}
-
-int av_hmac_final(AVHMAC *c, uint8_t *out, unsigned int outlen)
-{
-    uint8_t block[MAX_BLOCKLEN];
-    int i;
-    if (outlen < c->hashlen)
-        return AVERROR(EINVAL);
-    c->final(c->hash, out);
-    c->init(c->hash);
-    for (i = 0; i < c->keylen; i++)
-        block[i] = c->key[i] ^ 0x5C;
-    for (i = c->keylen; i < c->blocklen; i++)
-        block[i] = 0x5C;
-    c->update(c->hash, block, c->blocklen);
-    c->update(c->hash, out, c->hashlen);
-    c->final(c->hash, out);
-    return c->hashlen;
-}
-
-int av_hmac_calc(AVHMAC *c, const uint8_t *data, unsigned int len,
-                 const uint8_t *key, unsigned int keylen,
-                 uint8_t *out, unsigned int outlen)
-{
-    av_hmac_init(c, key, keylen);
-    av_hmac_update(c, data, len);
-    return av_hmac_final(c, out, outlen);
-}
-
-#ifdef TEST
-#include <stdio.h>
-
-static void test(AVHMAC *hmac, const uint8_t *key, int keylen,
-                 const uint8_t *data, int datalen)
-{
-    uint8_t buf[MAX_HASHLEN];
-    int out, i;
-    // Some of the test vectors are strings, where sizeof() includes the
-    // trailing null byte - remove that.
-    if (!key[keylen - 1])
-        keylen--;
-    if (!data[datalen - 1])
-        datalen--;
-    out = av_hmac_calc(hmac, data, datalen, key, keylen, buf, sizeof(buf));
-    for (i = 0; i < out; i++)
-        printf("%02x", buf[i]);
-    printf("\n");
-}
-
-int main(void)
-{
-    uint8_t key1[16], key3[16], data3[50], key4[63], key5[64], key6[65];
-    const uint8_t key2[]  = "Jefe";
-    const uint8_t data1[] = "Hi There";
-    const uint8_t data2[] = "what do ya want for nothing?";
-    AVHMAC *hmac = av_hmac_alloc(AV_HMAC_MD5);
-    if (!hmac)
-        return 1;
-    memset(key1, 0x0b, sizeof(key1));
-    memset(key3, 0xaa, sizeof(key3));
-    memset(key4, 0x44, sizeof(key4));
-    memset(key5, 0x55, sizeof(key5));
-    memset(key6, 0x66, sizeof(key6));
-    memset(data3, 0xdd, sizeof(data3));
-    // RFC 2104 test vectors
-    test(hmac, key1, sizeof(key1), data1, sizeof(data1));
-    test(hmac, key2, sizeof(key2), data2, sizeof(data2));
-    test(hmac, key3, sizeof(key3), data3, sizeof(data3));
-    // Additional tests, to test cases where the key is too long
-    test(hmac, key4, sizeof(key4), data1, sizeof(data1));
-    test(hmac, key5, sizeof(key5), data2, sizeof(data2));
-    test(hmac, key6, sizeof(key6), data3, sizeof(data3));
-    av_hmac_free(hmac);
-    return 0;
-}
-#endif /* TEST */
diff --git a/deps/libav/libavutil/hmac.h b/deps/libav/libavutil/hmac.h
deleted file mode 100644
index 28c2062..0000000
--- a/deps/libav/libavutil/hmac.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_HMAC_H
-#define AVUTIL_HMAC_H
-
-#include <stdint.h>
-
-/**
- * @defgroup lavu_hmac HMAC
- * @ingroup lavu_crypto
- * @{
- */
-
-enum AVHMACType {
-    AV_HMAC_MD5,
-    AV_HMAC_SHA1,
-};
-
-typedef struct AVHMAC AVHMAC;
-
-/**
- * Allocate an AVHMAC context.
- * @param type The hash function used for the HMAC.
- */
-AVHMAC *av_hmac_alloc(enum AVHMACType type);
-
-/**
- * Free an AVHMAC context.
- * @param ctx The context to free, may be NULL
- */
-void av_hmac_free(AVHMAC *ctx);
-
-/**
- * Initialize an AVHMAC context with an authentication key.
- * @param ctx    The HMAC context
- * @param key    The authentication key
- * @param keylen The length of the key, in bytes
- */
-void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen);
-
-/**
- * Hash data with the HMAC.
- * @param ctx  The HMAC context
- * @param data The data to hash
- * @param len  The length of the data, in bytes
- */
-void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len);
-
-/**
- * Finish hashing and output the HMAC digest.
- * @param ctx    The HMAC context
- * @param out    The output buffer to write the digest into
- * @param outlen The length of the out buffer, in bytes
- * @return       The number of bytes written to out, or a negative error code.
- */
-int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen);
-
-/**
- * Hash an array of data with a key.
- * @param ctx    The HMAC context
- * @param data   The data to hash
- * @param len    The length of the data, in bytes
- * @param key    The authentication key
- * @param keylen The length of the key, in bytes
- * @param out    The output buffer to write the digest into
- * @param outlen The length of the out buffer, in bytes
- * @return       The number of bytes written to out, or a negative error code.
- */
-int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len,
-                 const uint8_t *key, unsigned int keylen,
-                 uint8_t *out, unsigned int outlen);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_HMAC_H */
diff --git a/deps/libav/libavutil/imgutils.c b/deps/libav/libavutil/imgutils.c
deleted file mode 100644
index a8b4d2a..0000000
--- a/deps/libav/libavutil/imgutils.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * misc image utilities
- */
-
-#include "common.h"
-#include "imgutils.h"
-#include "internal.h"
-#include "log.h"
-#include "pixdesc.h"
-
-void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
-                                const AVPixFmtDescriptor *pixdesc)
-{
-    int i;
-    memset(max_pixsteps, 0, 4*sizeof(max_pixsteps[0]));
-    if (max_pixstep_comps)
-        memset(max_pixstep_comps, 0, 4*sizeof(max_pixstep_comps[0]));
-
-    for (i = 0; i < 4; i++) {
-        const AVComponentDescriptor *comp = &(pixdesc->comp[i]);
-        if ((comp->step_minus1+1) > max_pixsteps[comp->plane]) {
-            max_pixsteps[comp->plane] = comp->step_minus1+1;
-            if (max_pixstep_comps)
-                max_pixstep_comps[comp->plane] = i;
-        }
-    }
-}
-
-int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    int max_step     [4];       /* max pixel step for each plane */
-    int max_step_comp[4];       /* the component for each plane which has the max pixel step */
-    int s;
-
-    if (!desc)
-        return AVERROR(EINVAL);
-
-    if (desc->flags & AV_PIX_FMT_FLAG_BITSTREAM)
-        return (width * (desc->comp[0].step_minus1+1) + 7) >> 3;
-
-    av_image_fill_max_pixsteps(max_step, max_step_comp, desc);
-    s = (max_step_comp[plane] == 1 || max_step_comp[plane] == 2) ? desc->log2_chroma_w : 0;
-    return max_step[plane] * (((width + (1 << s) - 1)) >> s);
-}
-
-int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
-{
-    int i;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    int max_step     [4];       /* max pixel step for each plane */
-    int max_step_comp[4];       /* the component for each plane which has the max pixel step */
-
-    memset(linesizes, 0, 4*sizeof(linesizes[0]));
-
-    if (!desc || desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
-        return AVERROR(EINVAL);
-
-    if (desc->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
-        if (width > (INT_MAX -7) / (desc->comp[0].step_minus1+1))
-            return AVERROR(EINVAL);
-        linesizes[0] = (width * (desc->comp[0].step_minus1+1) + 7) >> 3;
-        return 0;
-    }
-
-    av_image_fill_max_pixsteps(max_step, max_step_comp, desc);
-    for (i = 0; i < 4; i++) {
-        int s = (max_step_comp[i] == 1 || max_step_comp[i] == 2) ? desc->log2_chroma_w : 0;
-        int shifted_w = ((width + (1 << s) - 1)) >> s;
-        if (max_step[i] > INT_MAX / shifted_w)
-            return AVERROR(EINVAL);
-        linesizes[i] = max_step[i] * shifted_w;
-    }
-
-    return 0;
-}
-
-int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height,
-                           uint8_t *ptr, const int linesizes[4])
-{
-    int i, total_size, size[4] = { 0 }, has_plane[4] = { 0 };
-
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    memset(data     , 0, sizeof(data[0])*4);
-
-    if (!desc || desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
-        return AVERROR(EINVAL);
-
-    data[0] = ptr;
-    if (linesizes[0] > (INT_MAX - 1024) / height)
-        return AVERROR(EINVAL);
-    size[0] = linesizes[0] * height;
-
-    if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
-        desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
-        size[0] = (size[0] + 3) & ~3;
-        data[1] = ptr + size[0]; /* palette is stored here as 256 32 bits words */
-        return size[0] + 256 * 4;
-    }
-
-    for (i = 0; i < 4; i++)
-        has_plane[desc->comp[i].plane] = 1;
-
-    total_size = size[0];
-    for (i = 1; i < 4 && has_plane[i]; i++) {
-        int h, s = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
-        data[i] = data[i-1] + size[i-1];
-        h = (height + (1 << s) - 1) >> s;
-        if (linesizes[i] > INT_MAX / h)
-            return AVERROR(EINVAL);
-        size[i] = h * linesizes[i];
-        if (total_size > INT_MAX - size[i])
-            return AVERROR(EINVAL);
-        total_size += size[i];
-    }
-
-    return total_size;
-}
-
-int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt)
-{
-    int i;
-
-    for (i = 0; i < 256; i++) {
-        int r, g, b;
-
-        switch (pix_fmt) {
-        case AV_PIX_FMT_RGB8:
-            r = (i>>5    )*36;
-            g = ((i>>2)&7)*36;
-            b = (i&3     )*85;
-            break;
-        case AV_PIX_FMT_BGR8:
-            b = (i>>6    )*85;
-            g = ((i>>3)&7)*36;
-            r = (i&7     )*36;
-            break;
-        case AV_PIX_FMT_RGB4_BYTE:
-            r = (i>>3    )*255;
-            g = ((i>>1)&3)*85;
-            b = (i&1     )*255;
-            break;
-        case AV_PIX_FMT_BGR4_BYTE:
-            b = (i>>3    )*255;
-            g = ((i>>1)&3)*85;
-            r = (i&1     )*255;
-            break;
-        case AV_PIX_FMT_GRAY8:
-            r = b = g = i;
-            break;
-        default:
-            return AVERROR(EINVAL);
-        }
-        pal[i] = b + (g<<8) + (r<<16);
-    }
-
-    return 0;
-}
-
-int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
-                   int w, int h, enum AVPixelFormat pix_fmt, int align)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    int i, ret;
-    uint8_t *buf;
-
-    if (!desc)
-        return AVERROR(EINVAL);
-
-    if ((ret = av_image_check_size(w, h, 0, NULL)) < 0)
-        return ret;
-    if ((ret = av_image_fill_linesizes(linesizes, pix_fmt, w)) < 0)
-        return ret;
-
-    for (i = 0; i < 4; i++)
-        linesizes[i] = FFALIGN(linesizes[i], align);
-
-    if ((ret = av_image_fill_pointers(pointers, pix_fmt, h, NULL, linesizes)) < 0)
-        return ret;
-    buf = av_malloc(ret + align);
-    if (!buf)
-        return AVERROR(ENOMEM);
-    if ((ret = av_image_fill_pointers(pointers, pix_fmt, h, buf, linesizes)) < 0) {
-        av_free(buf);
-        return ret;
-    }
-    if (desc->flags & AV_PIX_FMT_FLAG_PAL || desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)
-        avpriv_set_systematic_pal2((uint32_t*)pointers[1], pix_fmt);
-
-    return ret;
-}
-
-typedef struct ImgUtils {
-    const AVClass *class;
-    int   log_offset;
-    void *log_ctx;
-} ImgUtils;
-
-static const AVClass imgutils_class = { "IMGUTILS", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(ImgUtils, log_offset), offsetof(ImgUtils, log_ctx) };
-
-int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
-{
-    ImgUtils imgutils = { &imgutils_class, log_offset, log_ctx };
-
-    if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
-        return 0;
-
-    av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h);
-    return AVERROR(EINVAL);
-}
-
-void av_image_copy_plane(uint8_t       *dst, int dst_linesize,
-                         const uint8_t *src, int src_linesize,
-                         int bytewidth, int height)
-{
-    if (!dst || !src)
-        return;
-    for (;height > 0; height--) {
-        memcpy(dst, src, bytewidth);
-        dst += dst_linesize;
-        src += src_linesize;
-    }
-}
-
-void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
-                   const uint8_t *src_data[4], const int src_linesizes[4],
-                   enum AVPixelFormat pix_fmt, int width, int height)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-
-    if (!desc || desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
-        return;
-
-    if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
-        desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
-        av_image_copy_plane(dst_data[0], dst_linesizes[0],
-                            src_data[0], src_linesizes[0],
-                            width, height);
-        /* copy the palette */
-        memcpy(dst_data[1], src_data[1], 4*256);
-    } else {
-        int i, planes_nb = 0;
-
-        for (i = 0; i < desc->nb_components; i++)
-            planes_nb = FFMAX(planes_nb, desc->comp[i].plane + 1);
-
-        for (i = 0; i < planes_nb; i++) {
-            int h = height;
-            int bwidth = av_image_get_linesize(pix_fmt, width, i);
-            if (i == 1 || i == 2) {
-                h= -((-height)>>desc->log2_chroma_h);
-            }
-            av_image_copy_plane(dst_data[i], dst_linesizes[i],
-                                src_data[i], src_linesizes[i],
-                                bwidth, h);
-        }
-    }
-}
diff --git a/deps/libav/libavutil/imgutils.h b/deps/libav/libavutil/imgutils.h
deleted file mode 100644
index 7151013..0000000
--- a/deps/libav/libavutil/imgutils.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_IMGUTILS_H
-#define AVUTIL_IMGUTILS_H
-
-/**
- * @file
- * misc image utilities
- *
- * @addtogroup lavu_picture
- * @{
- */
-
-#include "avutil.h"
-#include "pixdesc.h"
-
-/**
- * Compute the max pixel step for each plane of an image with a
- * format described by pixdesc.
- *
- * The pixel step is the distance in bytes between the first byte of
- * the group of bytes which describe a pixel component and the first
- * byte of the successive group in the same plane for the same
- * component.
- *
- * @param max_pixsteps an array which is filled with the max pixel step
- * for each plane. Since a plane may contain different pixel
- * components, the computed max_pixsteps[plane] is relative to the
- * component in the plane with the max pixel step.
- * @param max_pixstep_comps an array which is filled with the component
- * for each plane which has the max pixel step. May be NULL.
- */
-void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
-                                const AVPixFmtDescriptor *pixdesc);
-
-/**
- * Compute the size of an image line with format pix_fmt and width
- * width for the plane plane.
- *
- * @return the computed size in bytes
- */
-int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane);
-
-/**
- * Fill plane linesizes for an image with pixel format pix_fmt and
- * width width.
- *
- * @param linesizes array to be filled with the linesize for each plane
- * @return >= 0 in case of success, a negative error code otherwise
- */
-int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width);
-
-/**
- * Fill plane data pointers for an image with pixel format pix_fmt and
- * height height.
- *
- * @param data pointers array to be filled with the pointer for each image plane
- * @param ptr the pointer to a buffer which will contain the image
- * @param linesizes the array containing the linesize for each
- * plane, should be filled by av_image_fill_linesizes()
- * @return the size in bytes required for the image buffer, a negative
- * error code in case of failure
- */
-int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height,
-                           uint8_t *ptr, const int linesizes[4]);
-
-/**
- * Allocate an image with size w and h and pixel format pix_fmt, and
- * fill pointers and linesizes accordingly.
- * The allocated image buffer has to be freed by using
- * av_freep(&pointers[0]).
- *
- * @param align the value to use for buffer size alignment
- * @return the size in bytes required for the image buffer, a negative
- * error code in case of failure
- */
-int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
-                   int w, int h, enum AVPixelFormat pix_fmt, int align);
-
-/**
- * Copy image plane from src to dst.
- * That is, copy "height" number of lines of "bytewidth" bytes each.
- * The first byte of each successive line is separated by *_linesize
- * bytes.
- *
- * @param dst_linesize linesize for the image plane in dst
- * @param src_linesize linesize for the image plane in src
- */
-void av_image_copy_plane(uint8_t       *dst, int dst_linesize,
-                         const uint8_t *src, int src_linesize,
-                         int bytewidth, int height);
-
-/**
- * Copy image in src_data to dst_data.
- *
- * @param dst_linesizes linesizes for the image in dst_data
- * @param src_linesizes linesizes for the image in src_data
- */
-void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
-                   const uint8_t *src_data[4], const int src_linesizes[4],
-                   enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * Check if the given dimension of an image is valid, meaning that all
- * bytes of the image can be addressed with a signed int.
- *
- * @param w the width of the picture
- * @param h the height of the picture
- * @param log_offset the offset to sum to the log level for logging with log_ctx
- * @param log_ctx the parent logging context, it may be NULL
- * @return >= 0 if valid, a negative error code otherwise
- */
-int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
-
-int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt);
-
-/**
- * @}
- */
-
-
-#endif /* AVUTIL_IMGUTILS_H */
diff --git a/deps/libav/libavutil/internal.h b/deps/libav/libavutil/internal.h
deleted file mode 100644
index ecd535b..0000000
--- a/deps/libav/libavutil/internal.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * common internal API header
- */
-
-#ifndef AVUTIL_INTERNAL_H
-#define AVUTIL_INTERNAL_H
-
-#if !defined(DEBUG) && !defined(NDEBUG)
-#    define NDEBUG
-#endif
-
-#include <limits.h>
-#include <stdint.h>
-#include <stddef.h>
-#include <assert.h>
-#include "config.h"
-#include "attributes.h"
-#include "dict.h"
-
-#if ARCH_X86
-#   include "x86/emms.h"
-#endif
-
-#ifndef emms_c
-#   define emms_c()
-#endif
-
-#ifndef attribute_align_arg
-#if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2)
-#    define attribute_align_arg __attribute__((force_align_arg_pointer))
-#else
-#    define attribute_align_arg
-#endif
-#endif
-
-#if defined(_MSC_VER) && CONFIG_SHARED
-#    define av_export __declspec(dllimport)
-#else
-#    define av_export
-#endif
-
-#if HAVE_PRAGMA_DEPRECATED
-#    if defined(__ICL)
-#        define FF_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:1478))
-#        define FF_ENABLE_DEPRECATION_WARNINGS  __pragma(warning(pop))
-#    elif defined(_MSC_VER)
-#        define FF_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:4996))
-#        define FF_ENABLE_DEPRECATION_WARNINGS  __pragma(warning(pop))
-#    else
-#        define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
-#        define FF_ENABLE_DEPRECATION_WARNINGS  _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"")
-#    endif
-#else
-#    define FF_DISABLE_DEPRECATION_WARNINGS
-#    define FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
-#ifndef INT_BIT
-#    define INT_BIT (CHAR_BIT * sizeof(int))
-#endif
-
-// Some broken preprocessors need a second expansion
-// to be forced to tokenize __VA_ARGS__
-#define E1(x) x
-
-#define LOCAL_ALIGNED_A(a, t, v, s, o, ...)             \
-    uint8_t la_##v[sizeof(t s o) + (a)];                \
-    t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
-
-#define LOCAL_ALIGNED_D(a, t, v, s, o, ...)             \
-    DECLARE_ALIGNED(a, t, la_##v) s o;                  \
-    t (*v) o = la_##v
-
-#define LOCAL_ALIGNED(a, t, v, ...) E1(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,))
-
-#if HAVE_LOCAL_ALIGNED_8
-#   define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
-#else
-#   define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__)
-#endif
-
-#if HAVE_LOCAL_ALIGNED_16
-#   define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
-#else
-#   define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
-#endif
-
-#define FF_ALLOC_OR_GOTO(ctx, p, size, label)\
-{\
-    p = av_malloc(size);\
-    if (p == NULL && (size) != 0) {\
-        av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
-        goto label;\
-    }\
-}
-
-#define FF_ALLOCZ_OR_GOTO(ctx, p, size, label)\
-{\
-    p = av_mallocz(size);\
-    if (p == NULL && (size) != 0) {\
-        av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
-        goto label;\
-    }\
-}
-
-#include "libm.h"
-
-#if defined(_MSC_VER)
-#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_strtod")
-#pragma comment(linker, "/include:"EXTERN_PREFIX"avpriv_snprintf")
-#endif
-
-/**
- * Return NULL if CONFIG_SMALL is true, otherwise the argument
- * without modification. Used to disable the definition of strings
- * (for example AVCodec long_names).
- */
-#if CONFIG_SMALL
-#   define NULL_IF_CONFIG_SMALL(x) NULL
-#else
-#   define NULL_IF_CONFIG_SMALL(x) x
-#endif
-
-
-/**
- * Define a function with only the non-default version specified.
- *
- * On systems with ELF shared libraries, all symbols exported from
- * Libav libraries are tagged with the name and major version of the
- * library to which they belong.  If a function is moved from one
- * library to another, a wrapper must be retained in the original
- * location to preserve binary compatibility.
- *
- * Functions defined with this macro will never be used to resolve
- * symbols by the build-time linker.
- *
- * @param type return type of function
- * @param name name of function
- * @param args argument list of function
- * @param ver  version tag to assign function
- */
-#if HAVE_SYMVER_ASM_LABEL
-#   define FF_SYMVER(type, name, args, ver)                     \
-    type ff_##name args __asm__ (EXTERN_PREFIX #name "@" ver);  \
-    type ff_##name args
-#elif HAVE_SYMVER_GNU_ASM
-#   define FF_SYMVER(type, name, args, ver)                             \
-    __asm__ (".symver ff_" #name "," EXTERN_PREFIX #name "@" ver);      \
-    type ff_##name args;                                                \
-    type ff_##name args
-#endif
-
-/**
- * Return NULL if a threading library has not been enabled.
- * Used to disable threading functions in AVCodec definitions
- * when not needed.
- */
-#if HAVE_THREADS
-#   define ONLY_IF_THREADS_ENABLED(x) x
-#else
-#   define ONLY_IF_THREADS_ENABLED(x) NULL
-#endif
-
-/**
- * Log a generic warning message about a missing feature.
- *
- * @param[in] avc a pointer to an arbitrary struct of which the first
- *                field is a pointer to an AVClass struct
- * @param[in] msg string containing the name of the missing feature
- */
-void avpriv_report_missing_feature(void *avc,
-                                   const char *msg, ...) av_printf_format(2, 3);
-
-/**
- * Log a generic warning message about a missing feature.
- * Additionally request that a sample showcasing the feature be uploaded.
- *
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- *                a pointer to an AVClass struct
- * @param[in] msg string containing the name of the missing feature
- */
-void avpriv_request_sample(void *avc,
-                           const char *msg, ...) av_printf_format(2, 3);
-
-#if HAVE_LIBC_MSVCRT
-#define avpriv_open ff_open
-#endif
-
-/**
- * A wrapper for open() setting O_CLOEXEC.
- */
-int avpriv_open(const char *filename, int flags, ...);
-
-#endif /* AVUTIL_INTERNAL_H */
diff --git a/deps/libav/libavutil/intfloat.h b/deps/libav/libavutil/intfloat.h
deleted file mode 100644
index 38d26ad..0000000
--- a/deps/libav/libavutil/intfloat.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2011 Mans Rullgard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_INTFLOAT_H
-#define AVUTIL_INTFLOAT_H
-
-#include <stdint.h>
-#include "attributes.h"
-
-union av_intfloat32 {
-    uint32_t i;
-    float    f;
-};
-
-union av_intfloat64 {
-    uint64_t i;
-    double   f;
-};
-
-/**
- * Reinterpret a 32-bit integer as a float.
- */
-static av_always_inline float av_int2float(uint32_t i)
-{
-    union av_intfloat32 v;
-    v.i = i;
-    return v.f;
-}
-
-/**
- * Reinterpret a float as a 32-bit integer.
- */
-static av_always_inline uint32_t av_float2int(float f)
-{
-    union av_intfloat32 v;
-    v.f = f;
-    return v.i;
-}
-
-/**
- * Reinterpret a 64-bit integer as a double.
- */
-static av_always_inline double av_int2double(uint64_t i)
-{
-    union av_intfloat64 v;
-    v.i = i;
-    return v.f;
-}
-
-/**
- * Reinterpret a double as a 64-bit integer.
- */
-static av_always_inline uint64_t av_double2int(double f)
-{
-    union av_intfloat64 v;
-    v.f = f;
-    return v.i;
-}
-
-#endif /* AVUTIL_INTFLOAT_H */
diff --git a/deps/libav/libavutil/intmath.c b/deps/libav/libavutil/intmath.c
deleted file mode 100644
index 8db425c..0000000
--- a/deps/libav/libavutil/intmath.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "intmath.h"
-
-/* undef these to get the function prototypes from common.h */
-#undef av_log2
-#undef av_log2_16bit
-#include "common.h"
-
-int av_log2(unsigned v)
-{
-    return ff_log2(v);
-}
-
-int av_log2_16bit(unsigned v)
-{
-    return ff_log2_16bit(v);
-}
-
-int av_ctz(int v)
-{
-    return ff_ctz(v);
-}
diff --git a/deps/libav/libavutil/intmath.h b/deps/libav/libavutil/intmath.h
deleted file mode 100644
index a5ee652..0000000
--- a/deps/libav/libavutil/intmath.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_INTMATH_H
-#define AVUTIL_INTMATH_H
-
-#include <stdint.h>
-
-#include "config.h"
-#include "attributes.h"
-
-#if ARCH_ARM
-#   include "arm/intmath.h"
-#endif
-
-/**
- * @addtogroup lavu_internal
- * @{
- */
-
-#if HAVE_FAST_CLZ && AV_GCC_VERSION_AT_LEAST(3,4)
-
-#ifndef ff_log2
-#   define ff_log2(x) (31 - __builtin_clz((x)|1))
-#   ifndef ff_log2_16bit
-#      define ff_log2_16bit av_log2
-#   endif
-#endif /* ff_log2 */
-
-#endif /* AV_GCC_VERSION_AT_LEAST(3,4) */
-
-extern const uint8_t ff_log2_tab[256];
-
-#ifndef ff_log2
-#define ff_log2 ff_log2_c
-static av_always_inline av_const int ff_log2_c(unsigned int v)
-{
-    int n = 0;
-    if (v & 0xffff0000) {
-        v >>= 16;
-        n += 16;
-    }
-    if (v & 0xff00) {
-        v >>= 8;
-        n += 8;
-    }
-    n += ff_log2_tab[v];
-
-    return n;
-}
-#endif
-
-#ifndef ff_log2_16bit
-#define ff_log2_16bit ff_log2_16bit_c
-static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
-{
-    int n = 0;
-    if (v & 0xff00) {
-        v >>= 8;
-        n += 8;
-    }
-    n += ff_log2_tab[v];
-
-    return n;
-}
-#endif
-
-#define av_log2       ff_log2
-#define av_log2_16bit ff_log2_16bit
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavu_math
- * @{
- */
-
-#if HAVE_FAST_CLZ && AV_GCC_VERSION_AT_LEAST(3,4)
-#ifndef ff_ctz
-#define ff_ctz(v) __builtin_ctz(v)
-#endif
-#endif
-
-#ifndef ff_ctz
-#define ff_ctz ff_ctz_c
-static av_always_inline av_const int ff_ctz_c(int v)
-{
-    int c;
-
-    if (v & 0x1)
-        return 0;
-
-    c = 1;
-    if (!(v & 0xffff)) {
-        v >>= 16;
-        c += 16;
-    }
-    if (!(v & 0xff)) {
-        v >>= 8;
-        c += 8;
-    }
-    if (!(v & 0xf)) {
-        v >>= 4;
-        c += 4;
-    }
-    if (!(v & 0x3)) {
-        v >>= 2;
-        c += 2;
-    }
-    c -= v & 0x1;
-
-    return c;
-}
-#endif
-
-/**
- * Trailing zero bit count.
- *
- * @param v  input value. If v is 0, the result is undefined.
- * @return   the number of trailing 0-bits
- */
-int av_ctz(int v);
-
-/**
- * @}
- */
-#endif /* AVUTIL_INTMATH_H */
diff --git a/deps/libav/libavutil/intreadwrite.h b/deps/libav/libavutil/intreadwrite.h
deleted file mode 100644
index f77fd60..0000000
--- a/deps/libav/libavutil/intreadwrite.h
+++ /dev/null
@@ -1,549 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_INTREADWRITE_H
-#define AVUTIL_INTREADWRITE_H
-
-#include <stdint.h>
-#include "libavutil/avconfig.h"
-#include "attributes.h"
-#include "bswap.h"
-
-typedef union {
-    uint64_t u64;
-    uint32_t u32[2];
-    uint16_t u16[4];
-    uint8_t  u8 [8];
-    double   f64;
-    float    f32[2];
-} av_alias av_alias64;
-
-typedef union {
-    uint32_t u32;
-    uint16_t u16[2];
-    uint8_t  u8 [4];
-    float    f32;
-} av_alias av_alias32;
-
-typedef union {
-    uint16_t u16;
-    uint8_t  u8 [2];
-} av_alias av_alias16;
-
-/*
- * Arch-specific headers can provide any combination of
- * AV_[RW][BLN](16|24|32|64) and AV_(COPY|SWAP|ZERO)(64|128) macros.
- * Preprocessor symbols must be defined, even if these are implemented
- * as inline functions.
- */
-
-#ifdef HAVE_AV_CONFIG_H
-
-#include "config.h"
-
-#if   ARCH_ARM
-#   include "arm/intreadwrite.h"
-#elif ARCH_AVR32
-#   include "avr32/intreadwrite.h"
-#elif ARCH_MIPS
-#   include "mips/intreadwrite.h"
-#elif ARCH_PPC
-#   include "ppc/intreadwrite.h"
-#elif ARCH_TOMI
-#   include "tomi/intreadwrite.h"
-#elif ARCH_X86
-#   include "x86/intreadwrite.h"
-#endif
-
-#endif /* HAVE_AV_CONFIG_H */
-
-/*
- * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers.
- */
-
-#if AV_HAVE_BIGENDIAN
-
-#   if    defined(AV_RN16) && !defined(AV_RB16)
-#       define AV_RB16(p) AV_RN16(p)
-#   elif !defined(AV_RN16) &&  defined(AV_RB16)
-#       define AV_RN16(p) AV_RB16(p)
-#   endif
-
-#   if    defined(AV_WN16) && !defined(AV_WB16)
-#       define AV_WB16(p, v) AV_WN16(p, v)
-#   elif !defined(AV_WN16) &&  defined(AV_WB16)
-#       define AV_WN16(p, v) AV_WB16(p, v)
-#   endif
-
-#   if    defined(AV_RN24) && !defined(AV_RB24)
-#       define AV_RB24(p) AV_RN24(p)
-#   elif !defined(AV_RN24) &&  defined(AV_RB24)
-#       define AV_RN24(p) AV_RB24(p)
-#   endif
-
-#   if    defined(AV_WN24) && !defined(AV_WB24)
-#       define AV_WB24(p, v) AV_WN24(p, v)
-#   elif !defined(AV_WN24) &&  defined(AV_WB24)
-#       define AV_WN24(p, v) AV_WB24(p, v)
-#   endif
-
-#   if    defined(AV_RN32) && !defined(AV_RB32)
-#       define AV_RB32(p) AV_RN32(p)
-#   elif !defined(AV_RN32) &&  defined(AV_RB32)
-#       define AV_RN32(p) AV_RB32(p)
-#   endif
-
-#   if    defined(AV_WN32) && !defined(AV_WB32)
-#       define AV_WB32(p, v) AV_WN32(p, v)
-#   elif !defined(AV_WN32) &&  defined(AV_WB32)
-#       define AV_WN32(p, v) AV_WB32(p, v)
-#   endif
-
-#   if    defined(AV_RN64) && !defined(AV_RB64)
-#       define AV_RB64(p) AV_RN64(p)
-#   elif !defined(AV_RN64) &&  defined(AV_RB64)
-#       define AV_RN64(p) AV_RB64(p)
-#   endif
-
-#   if    defined(AV_WN64) && !defined(AV_WB64)
-#       define AV_WB64(p, v) AV_WN64(p, v)
-#   elif !defined(AV_WN64) &&  defined(AV_WB64)
-#       define AV_WN64(p, v) AV_WB64(p, v)
-#   endif
-
-#else /* AV_HAVE_BIGENDIAN */
-
-#   if    defined(AV_RN16) && !defined(AV_RL16)
-#       define AV_RL16(p) AV_RN16(p)
-#   elif !defined(AV_RN16) &&  defined(AV_RL16)
-#       define AV_RN16(p) AV_RL16(p)
-#   endif
-
-#   if    defined(AV_WN16) && !defined(AV_WL16)
-#       define AV_WL16(p, v) AV_WN16(p, v)
-#   elif !defined(AV_WN16) &&  defined(AV_WL16)
-#       define AV_WN16(p, v) AV_WL16(p, v)
-#   endif
-
-#   if    defined(AV_RN24) && !defined(AV_RL24)
-#       define AV_RL24(p) AV_RN24(p)
-#   elif !defined(AV_RN24) &&  defined(AV_RL24)
-#       define AV_RN24(p) AV_RL24(p)
-#   endif
-
-#   if    defined(AV_WN24) && !defined(AV_WL24)
-#       define AV_WL24(p, v) AV_WN24(p, v)
-#   elif !defined(AV_WN24) &&  defined(AV_WL24)
-#       define AV_WN24(p, v) AV_WL24(p, v)
-#   endif
-
-#   if    defined(AV_RN32) && !defined(AV_RL32)
-#       define AV_RL32(p) AV_RN32(p)
-#   elif !defined(AV_RN32) &&  defined(AV_RL32)
-#       define AV_RN32(p) AV_RL32(p)
-#   endif
-
-#   if    defined(AV_WN32) && !defined(AV_WL32)
-#       define AV_WL32(p, v) AV_WN32(p, v)
-#   elif !defined(AV_WN32) &&  defined(AV_WL32)
-#       define AV_WN32(p, v) AV_WL32(p, v)
-#   endif
-
-#   if    defined(AV_RN64) && !defined(AV_RL64)
-#       define AV_RL64(p) AV_RN64(p)
-#   elif !defined(AV_RN64) &&  defined(AV_RL64)
-#       define AV_RN64(p) AV_RL64(p)
-#   endif
-
-#   if    defined(AV_WN64) && !defined(AV_WL64)
-#       define AV_WL64(p, v) AV_WN64(p, v)
-#   elif !defined(AV_WN64) &&  defined(AV_WL64)
-#       define AV_WN64(p, v) AV_WL64(p, v)
-#   endif
-
-#endif /* !AV_HAVE_BIGENDIAN */
-
-/*
- * Define AV_[RW]N helper macros to simplify definitions not provided
- * by per-arch headers.
- */
-
-#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
-
-union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
-union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
-union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
-
-#   define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
-#   define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
-
-#elif defined(__DECC)
-
-#   define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
-#   define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
-
-#elif AV_HAVE_FAST_UNALIGNED
-
-#   define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
-#   define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v))
-
-#else
-
-#ifndef AV_RB16
-#   define AV_RB16(x)                           \
-    ((((const uint8_t*)(x))[0] << 8) |          \
-      ((const uint8_t*)(x))[1])
-#endif
-#ifndef AV_WB16
-#   define AV_WB16(p, d) do {                   \
-        ((uint8_t*)(p))[1] = (d);               \
-        ((uint8_t*)(p))[0] = (d)>>8;            \
-    } while(0)
-#endif
-
-#ifndef AV_RL16
-#   define AV_RL16(x)                           \
-    ((((const uint8_t*)(x))[1] << 8) |          \
-      ((const uint8_t*)(x))[0])
-#endif
-#ifndef AV_WL16
-#   define AV_WL16(p, d) do {                   \
-        ((uint8_t*)(p))[0] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-    } while(0)
-#endif
-
-#ifndef AV_RB32
-#   define AV_RB32(x)                                \
-    (((uint32_t)((const uint8_t*)(x))[0] << 24) |    \
-               (((const uint8_t*)(x))[1] << 16) |    \
-               (((const uint8_t*)(x))[2] <<  8) |    \
-                ((const uint8_t*)(x))[3])
-#endif
-#ifndef AV_WB32
-#   define AV_WB32(p, d) do {                   \
-        ((uint8_t*)(p))[3] = (d);               \
-        ((uint8_t*)(p))[2] = (d)>>8;            \
-        ((uint8_t*)(p))[1] = (d)>>16;           \
-        ((uint8_t*)(p))[0] = (d)>>24;           \
-    } while(0)
-#endif
-
-#ifndef AV_RL32
-#   define AV_RL32(x)                                \
-    (((uint32_t)((const uint8_t*)(x))[3] << 24) |    \
-               (((const uint8_t*)(x))[2] << 16) |    \
-               (((const uint8_t*)(x))[1] <<  8) |    \
-                ((const uint8_t*)(x))[0])
-#endif
-#ifndef AV_WL32
-#   define AV_WL32(p, d) do {                   \
-        ((uint8_t*)(p))[0] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-        ((uint8_t*)(p))[2] = (d)>>16;           \
-        ((uint8_t*)(p))[3] = (d)>>24;           \
-    } while(0)
-#endif
-
-#ifndef AV_RB64
-#   define AV_RB64(x)                                   \
-    (((uint64_t)((const uint8_t*)(x))[0] << 56) |       \
-     ((uint64_t)((const uint8_t*)(x))[1] << 48) |       \
-     ((uint64_t)((const uint8_t*)(x))[2] << 40) |       \
-     ((uint64_t)((const uint8_t*)(x))[3] << 32) |       \
-     ((uint64_t)((const uint8_t*)(x))[4] << 24) |       \
-     ((uint64_t)((const uint8_t*)(x))[5] << 16) |       \
-     ((uint64_t)((const uint8_t*)(x))[6] <<  8) |       \
-      (uint64_t)((const uint8_t*)(x))[7])
-#endif
-#ifndef AV_WB64
-#   define AV_WB64(p, d) do {                   \
-        ((uint8_t*)(p))[7] = (d);               \
-        ((uint8_t*)(p))[6] = (d)>>8;            \
-        ((uint8_t*)(p))[5] = (d)>>16;           \
-        ((uint8_t*)(p))[4] = (d)>>24;           \
-        ((uint8_t*)(p))[3] = (d)>>32;           \
-        ((uint8_t*)(p))[2] = (d)>>40;           \
-        ((uint8_t*)(p))[1] = (d)>>48;           \
-        ((uint8_t*)(p))[0] = (d)>>56;           \
-    } while(0)
-#endif
-
-#ifndef AV_RL64
-#   define AV_RL64(x)                                   \
-    (((uint64_t)((const uint8_t*)(x))[7] << 56) |       \
-     ((uint64_t)((const uint8_t*)(x))[6] << 48) |       \
-     ((uint64_t)((const uint8_t*)(x))[5] << 40) |       \
-     ((uint64_t)((const uint8_t*)(x))[4] << 32) |       \
-     ((uint64_t)((const uint8_t*)(x))[3] << 24) |       \
-     ((uint64_t)((const uint8_t*)(x))[2] << 16) |       \
-     ((uint64_t)((const uint8_t*)(x))[1] <<  8) |       \
-      (uint64_t)((const uint8_t*)(x))[0])
-#endif
-#ifndef AV_WL64
-#   define AV_WL64(p, d) do {                   \
-        ((uint8_t*)(p))[0] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-        ((uint8_t*)(p))[2] = (d)>>16;           \
-        ((uint8_t*)(p))[3] = (d)>>24;           \
-        ((uint8_t*)(p))[4] = (d)>>32;           \
-        ((uint8_t*)(p))[5] = (d)>>40;           \
-        ((uint8_t*)(p))[6] = (d)>>48;           \
-        ((uint8_t*)(p))[7] = (d)>>56;           \
-    } while(0)
-#endif
-
-#if AV_HAVE_BIGENDIAN
-#   define AV_RN(s, p)    AV_RB##s(p)
-#   define AV_WN(s, p, v) AV_WB##s(p, v)
-#else
-#   define AV_RN(s, p)    AV_RL##s(p)
-#   define AV_WN(s, p, v) AV_WL##s(p, v)
-#endif
-
-#endif /* HAVE_FAST_UNALIGNED */
-
-#ifndef AV_RN16
-#   define AV_RN16(p) AV_RN(16, p)
-#endif
-
-#ifndef AV_RN32
-#   define AV_RN32(p) AV_RN(32, p)
-#endif
-
-#ifndef AV_RN64
-#   define AV_RN64(p) AV_RN(64, p)
-#endif
-
-#ifndef AV_WN16
-#   define AV_WN16(p, v) AV_WN(16, p, v)
-#endif
-
-#ifndef AV_WN32
-#   define AV_WN32(p, v) AV_WN(32, p, v)
-#endif
-
-#ifndef AV_WN64
-#   define AV_WN64(p, v) AV_WN(64, p, v)
-#endif
-
-#if AV_HAVE_BIGENDIAN
-#   define AV_RB(s, p)    AV_RN##s(p)
-#   define AV_WB(s, p, v) AV_WN##s(p, v)
-#   define AV_RL(s, p)    av_bswap##s(AV_RN##s(p))
-#   define AV_WL(s, p, v) AV_WN##s(p, av_bswap##s(v))
-#else
-#   define AV_RB(s, p)    av_bswap##s(AV_RN##s(p))
-#   define AV_WB(s, p, v) AV_WN##s(p, av_bswap##s(v))
-#   define AV_RL(s, p)    AV_RN##s(p)
-#   define AV_WL(s, p, v) AV_WN##s(p, v)
-#endif
-
-#define AV_RB8(x)     (((const uint8_t*)(x))[0])
-#define AV_WB8(p, d)  do { ((uint8_t*)(p))[0] = (d); } while(0)
-
-#define AV_RL8(x)     AV_RB8(x)
-#define AV_WL8(p, d)  AV_WB8(p, d)
-
-#ifndef AV_RB16
-#   define AV_RB16(p)    AV_RB(16, p)
-#endif
-#ifndef AV_WB16
-#   define AV_WB16(p, v) AV_WB(16, p, v)
-#endif
-
-#ifndef AV_RL16
-#   define AV_RL16(p)    AV_RL(16, p)
-#endif
-#ifndef AV_WL16
-#   define AV_WL16(p, v) AV_WL(16, p, v)
-#endif
-
-#ifndef AV_RB32
-#   define AV_RB32(p)    AV_RB(32, p)
-#endif
-#ifndef AV_WB32
-#   define AV_WB32(p, v) AV_WB(32, p, v)
-#endif
-
-#ifndef AV_RL32
-#   define AV_RL32(p)    AV_RL(32, p)
-#endif
-#ifndef AV_WL32
-#   define AV_WL32(p, v) AV_WL(32, p, v)
-#endif
-
-#ifndef AV_RB64
-#   define AV_RB64(p)    AV_RB(64, p)
-#endif
-#ifndef AV_WB64
-#   define AV_WB64(p, v) AV_WB(64, p, v)
-#endif
-
-#ifndef AV_RL64
-#   define AV_RL64(p)    AV_RL(64, p)
-#endif
-#ifndef AV_WL64
-#   define AV_WL64(p, v) AV_WL(64, p, v)
-#endif
-
-#ifndef AV_RB24
-#   define AV_RB24(x)                           \
-    ((((const uint8_t*)(x))[0] << 16) |         \
-     (((const uint8_t*)(x))[1] <<  8) |         \
-      ((const uint8_t*)(x))[2])
-#endif
-#ifndef AV_WB24
-#   define AV_WB24(p, d) do {                   \
-        ((uint8_t*)(p))[2] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-        ((uint8_t*)(p))[0] = (d)>>16;           \
-    } while(0)
-#endif
-
-#ifndef AV_RL24
-#   define AV_RL24(x)                           \
-    ((((const uint8_t*)(x))[2] << 16) |         \
-     (((const uint8_t*)(x))[1] <<  8) |         \
-      ((const uint8_t*)(x))[0])
-#endif
-#ifndef AV_WL24
-#   define AV_WL24(p, d) do {                   \
-        ((uint8_t*)(p))[0] = (d);               \
-        ((uint8_t*)(p))[1] = (d)>>8;            \
-        ((uint8_t*)(p))[2] = (d)>>16;           \
-    } while(0)
-#endif
-
-/*
- * The AV_[RW]NA macros access naturally aligned data
- * in a type-safe way.
- */
-
-#define AV_RNA(s, p)    (((const av_alias##s*)(p))->u##s)
-#define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v))
-
-#ifndef AV_RN16A
-#   define AV_RN16A(p) AV_RNA(16, p)
-#endif
-
-#ifndef AV_RN32A
-#   define AV_RN32A(p) AV_RNA(32, p)
-#endif
-
-#ifndef AV_RN64A
-#   define AV_RN64A(p) AV_RNA(64, p)
-#endif
-
-#ifndef AV_WN16A
-#   define AV_WN16A(p, v) AV_WNA(16, p, v)
-#endif
-
-#ifndef AV_WN32A
-#   define AV_WN32A(p, v) AV_WNA(32, p, v)
-#endif
-
-#ifndef AV_WN64A
-#   define AV_WN64A(p, v) AV_WNA(64, p, v)
-#endif
-
-/*
- * The AV_COPYxxU macros are suitable for copying data to/from unaligned
- * memory locations.
- */
-
-#define AV_COPYU(n, d, s) AV_WN##n(d, AV_RN##n(s));
-
-#ifndef AV_COPY16U
-#   define AV_COPY16U(d, s) AV_COPYU(16, d, s)
-#endif
-
-#ifndef AV_COPY32U
-#   define AV_COPY32U(d, s) AV_COPYU(32, d, s)
-#endif
-
-#ifndef AV_COPY64U
-#   define AV_COPY64U(d, s) AV_COPYU(64, d, s)
-#endif
-
-#ifndef AV_COPY128U
-#   define AV_COPY128U(d, s)                                    \
-    do {                                                        \
-        AV_COPY64U(d, s);                                       \
-        AV_COPY64U((char *)(d) + 8, (const char *)(s) + 8);     \
-    } while(0)
-#endif
-
-/* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be
- * naturally aligned. They may be implemented using MMX,
- * so emms_c() must be called before using any float code
- * afterwards.
- */
-
-#define AV_COPY(n, d, s) \
-    (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n)
-
-#ifndef AV_COPY16
-#   define AV_COPY16(d, s) AV_COPY(16, d, s)
-#endif
-
-#ifndef AV_COPY32
-#   define AV_COPY32(d, s) AV_COPY(32, d, s)
-#endif
-
-#ifndef AV_COPY64
-#   define AV_COPY64(d, s) AV_COPY(64, d, s)
-#endif
-
-#ifndef AV_COPY128
-#   define AV_COPY128(d, s)                    \
-    do {                                       \
-        AV_COPY64(d, s);                       \
-        AV_COPY64((char*)(d)+8, (char*)(s)+8); \
-    } while(0)
-#endif
-
-#define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b))
-
-#ifndef AV_SWAP64
-#   define AV_SWAP64(a, b) AV_SWAP(64, a, b)
-#endif
-
-#define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0)
-
-#ifndef AV_ZERO16
-#   define AV_ZERO16(d) AV_ZERO(16, d)
-#endif
-
-#ifndef AV_ZERO32
-#   define AV_ZERO32(d) AV_ZERO(32, d)
-#endif
-
-#ifndef AV_ZERO64
-#   define AV_ZERO64(d) AV_ZERO(64, d)
-#endif
-
-#ifndef AV_ZERO128
-#   define AV_ZERO128(d)         \
-    do {                         \
-        AV_ZERO64(d);            \
-        AV_ZERO64((char*)(d)+8); \
-    } while(0)
-#endif
-
-#endif /* AVUTIL_INTREADWRITE_H */
diff --git a/deps/libav/libavutil/lfg.c b/deps/libav/libavutil/lfg.c
deleted file mode 100644
index 4221e62..0000000
--- a/deps/libav/libavutil/lfg.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Lagged Fibonacci PRNG
- * Copyright (c) 2008 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-#include <limits.h>
-#include <math.h>
-#include "lfg.h"
-#include "md5.h"
-#include "intreadwrite.h"
-#include "attributes.h"
-
-av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
-{
-    uint8_t tmp[16] = { 0 };
-    int i;
-
-    for (i = 8; i < 64; i += 4) {
-        AV_WL32(tmp, seed);
-        tmp[4] = i;
-        av_md5_sum(tmp, tmp, 16);
-        c->state[i    ] = AV_RL32(tmp);
-        c->state[i + 1] = AV_RL32(tmp + 4);
-        c->state[i + 2] = AV_RL32(tmp + 8);
-        c->state[i + 3] = AV_RL32(tmp + 12);
-    }
-    c->index = 0;
-}
-
-void av_bmg_get(AVLFG *lfg, double out[2])
-{
-    double x1, x2, w;
-
-    do {
-        x1 = 2.0 / UINT_MAX * av_lfg_get(lfg) - 1.0;
-        x2 = 2.0 / UINT_MAX * av_lfg_get(lfg) - 1.0;
-        w  = x1 * x1 + x2 * x2;
-    } while (w >= 1.0);
-
-    w = sqrt((-2.0 * log(w)) / w);
-    out[0] = x1 * w;
-    out[1] = x2 * w;
-}
-
-#ifdef TEST
-#include "log.h"
-#include "timer.h"
-
-int main(void)
-{
-    int x = 0;
-    int i, j;
-    AVLFG state;
-
-    av_lfg_init(&state, 0xdeadbeef);
-    for (j = 0; j < 10000; j++) {
-        START_TIMER
-        for (i = 0; i < 624; i++)
-            x += av_lfg_get(&state);
-        STOP_TIMER("624 calls of av_lfg_get");
-    }
-    av_log(NULL, AV_LOG_ERROR, "final value:%X\n", x);
-
-    /* BMG usage example */
-    {
-        double mean   = 1000;
-        double stddev = 53;
-
-        av_lfg_init(&state, 42);
-
-        for (i = 0; i < 1000; i += 2) {
-            double bmg_out[2];
-            av_bmg_get(&state, bmg_out);
-            av_log(NULL, AV_LOG_INFO,
-                   "%f\n%f\n",
-                   bmg_out[0] * stddev + mean,
-                   bmg_out[1] * stddev + mean);
-        }
-    }
-
-    return 0;
-}
-#endif
diff --git a/deps/libav/libavutil/lfg.h b/deps/libav/libavutil/lfg.h
deleted file mode 100644
index 5e526c1..0000000
--- a/deps/libav/libavutil/lfg.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Lagged Fibonacci PRNG
- * Copyright (c) 2008 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LFG_H
-#define AVUTIL_LFG_H
-
-typedef struct AVLFG {
-    unsigned int state[64];
-    int index;
-} AVLFG;
-
-void av_lfg_init(AVLFG *c, unsigned int seed);
-
-/**
- * Get the next random unsigned 32-bit number using an ALFG.
- *
- * Please also consider a simple LCG like state= state*1664525+1013904223,
- * it may be good enough and faster for your specific use case.
- */
-static inline unsigned int av_lfg_get(AVLFG *c){
-    c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
-    return c->state[c->index++ & 63];
-}
-
-/**
- * Get the next random unsigned 32-bit number using a MLFG.
- *
- * Please also consider av_lfg_get() above, it is faster.
- */
-static inline unsigned int av_mlfg_get(AVLFG *c){
-    unsigned int a= c->state[(c->index-55) & 63];
-    unsigned int b= c->state[(c->index-24) & 63];
-    return c->state[c->index++ & 63] = 2*a*b+a+b;
-}
-
-/**
- * Get the next two numbers generated by a Box-Muller Gaussian
- * generator using the random numbers issued by lfg.
- *
- * @param out array where the two generated numbers are placed
- */
-void av_bmg_get(AVLFG *lfg, double out[2]);
-
-#endif /* AVUTIL_LFG_H */
diff --git a/deps/libav/libavutil/libavutil.v b/deps/libav/libavutil/libavutil.v
deleted file mode 100644
index e9f04cb..0000000
--- a/deps/libav/libavutil/libavutil.v
+++ /dev/null
@@ -1,4 +0,0 @@
-LIBAVUTIL_$MAJOR {
-        global: av*;
-        local: *;
-};
diff --git a/deps/libav/libavutil/libm.h b/deps/libav/libavutil/libm.h
deleted file mode 100644
index d6c2cf8..0000000
--- a/deps/libav/libavutil/libm.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Replacements for frequently missing libm functions
- */
-
-#ifndef AVUTIL_LIBM_H
-#define AVUTIL_LIBM_H
-
-#include <math.h>
-#include "config.h"
-#include "attributes.h"
-#include "intfloat.h"
-
-#if !HAVE_ATANF
-#undef atanf
-#define atanf(x) ((float)atan(x))
-#endif
-
-#if !HAVE_ATAN2F
-#undef atan2f
-#define atan2f(y, x) ((float)atan2(y, x))
-#endif
-
-#if !HAVE_POWF
-#undef powf
-#define powf(x, y) ((float)pow(x, y))
-#endif
-
-#if !HAVE_CBRTF
-static av_always_inline float cbrtf(float x)
-{
-    return x < 0 ? -powf(-x, 1.0 / 3.0) : powf(x, 1.0 / 3.0);
-}
-#endif
-
-#if !HAVE_COSF
-#undef cosf
-#define cosf(x) ((float)cos(x))
-#endif
-
-#if !HAVE_EXPF
-#undef expf
-#define expf(x) ((float)exp(x))
-#endif
-
-#if !HAVE_EXP2
-#undef exp2
-#define exp2(x) exp((x) * 0.693147180559945)
-#endif /* HAVE_EXP2 */
-
-#if !HAVE_EXP2F
-#undef exp2f
-#define exp2f(x) ((float)exp2(x))
-#endif /* HAVE_EXP2F */
-
-#if !HAVE_ISINF
-static av_always_inline av_const int isinf(float x)
-{
-    uint32_t v = av_float2int(x);
-    if ((v & 0x7f800000) != 0x7f800000)
-        return 0;
-    return !(v & 0x007fffff);
-}
-#endif /* HAVE_ISINF */
-
-#if !HAVE_ISNAN
-static av_always_inline av_const int isnan(float x)
-{
-    uint32_t v = av_float2int(x);
-    if ((v & 0x7f800000) != 0x7f800000)
-        return 0;
-    return v & 0x007fffff;
-}
-#endif /* HAVE_ISNAN */
-
-#if !HAVE_LDEXPF
-#undef ldexpf
-#define ldexpf(x, exp) ((float)ldexp(x, exp))
-#endif
-
-#if !HAVE_LLRINT
-#undef llrint
-#define llrint(x) ((long long)rint(x))
-#endif /* HAVE_LLRINT */
-
-#if !HAVE_LLRINTF
-#undef llrintf
-#define llrintf(x) ((long long)rint(x))
-#endif /* HAVE_LLRINT */
-
-#if !HAVE_LOG2
-#undef log2
-#define log2(x) (log(x) * 1.44269504088896340736)
-#endif /* HAVE_LOG2 */
-
-#if !HAVE_LOG2F
-#undef log2f
-#define log2f(x) ((float)log2(x))
-#endif /* HAVE_LOG2F */
-
-#if !HAVE_LOG10F
-#undef log10f
-#define log10f(x) ((float)log10(x))
-#endif
-
-#if !HAVE_SINF
-#undef sinf
-#define sinf(x) ((float)sin(x))
-#endif
-
-#if !HAVE_RINT
-static inline double rint(double x)
-{
-    return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5);
-}
-#endif /* HAVE_RINT */
-
-#if !HAVE_LRINT
-static av_always_inline av_const long int lrint(double x)
-{
-    return rint(x);
-}
-#endif /* HAVE_LRINT */
-
-#if !HAVE_LRINTF
-static av_always_inline av_const long int lrintf(float x)
-{
-    return (int)(rint(x));
-}
-#endif /* HAVE_LRINTF */
-
-#if !HAVE_ROUND
-static av_always_inline av_const double round(double x)
-{
-    return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5);
-}
-#endif /* HAVE_ROUND */
-
-#if !HAVE_ROUNDF
-static av_always_inline av_const float roundf(float x)
-{
-    return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5);
-}
-#endif /* HAVE_ROUNDF */
-
-#if !HAVE_TRUNC
-static av_always_inline av_const double trunc(double x)
-{
-    return (x > 0) ? floor(x) : ceil(x);
-}
-#endif /* HAVE_TRUNC */
-
-#if !HAVE_TRUNCF
-static av_always_inline av_const float truncf(float x)
-{
-    return (x > 0) ? floor(x) : ceil(x);
-}
-#endif /* HAVE_TRUNCF */
-
-#endif /* AVUTIL_LIBM_H */
diff --git a/deps/libav/libavutil/lls.c b/deps/libav/libavutil/lls.c
deleted file mode 100644
index f87c2cd..0000000
--- a/deps/libav/libavutil/lls.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * linear least squares model
- *
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * linear least squares model
- */
-
-#include <math.h>
-#include <string.h>
-
-#include "attributes.h"
-#include "version.h"
-#include "lls.h"
-
-static void update_lls(LLSModel *m, double *var)
-{
-    int i, j;
-
-    for (i = 0; i <= m->indep_count; i++) {
-        for (j = i; j <= m->indep_count; j++) {
-            m->covariance[i][j] += var[i] * var[j];
-        }
-    }
-}
-
-void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order)
-{
-    int i, j, k;
-    double (*factor)[MAX_VARS_ALIGN] = (void *) &m->covariance[1][0];
-    double (*covar) [MAX_VARS_ALIGN] = (void *) &m->covariance[1][1];
-    double *covar_y                = m->covariance[0];
-    int count                      = m->indep_count;
-
-    for (i = 0; i < count; i++) {
-        for (j = i; j < count; j++) {
-            double sum = covar[i][j];
-
-            for (k = i - 1; k >= 0; k--)
-                sum -= factor[i][k] * factor[j][k];
-
-            if (i == j) {
-                if (sum < threshold)
-                    sum = 1.0;
-                factor[i][i] = sqrt(sum);
-            } else {
-                factor[j][i] = sum / factor[i][i];
-            }
-        }
-    }
-
-    for (i = 0; i < count; i++) {
-        double sum = covar_y[i + 1];
-
-        for (k = i - 1; k >= 0; k--)
-            sum -= factor[i][k] * m->coeff[0][k];
-
-        m->coeff[0][i] = sum / factor[i][i];
-    }
-
-    for (j = count - 1; j >= min_order; j--) {
-        for (i = j; i >= 0; i--) {
-            double sum = m->coeff[0][i];
-
-            for (k = i + 1; k <= j; k++)
-                sum -= factor[k][i] * m->coeff[j][k];
-
-            m->coeff[j][i] = sum / factor[i][i];
-        }
-
-        m->variance[j] = covar_y[0];
-
-        for (i = 0; i <= j; i++) {
-            double sum = m->coeff[j][i] * covar[i][i] - 2 * covar_y[i + 1];
-
-            for (k = 0; k < i; k++)
-                sum += 2 * m->coeff[j][k] * covar[k][i];
-
-            m->variance[j] += m->coeff[j][i] * sum;
-        }
-    }
-}
-
-static double evaluate_lls(LLSModel *m, double *param, int order)
-{
-    int i;
-    double out = 0;
-
-    for (i = 0; i <= order; i++)
-        out += param[i] * m->coeff[order][i];
-
-    return out;
-}
-
-av_cold void avpriv_init_lls(LLSModel *m, int indep_count)
-{
-    memset(m, 0, sizeof(LLSModel));
-    m->indep_count = indep_count;
-    m->update_lls = update_lls;
-    m->evaluate_lls = evaluate_lls;
-    if (ARCH_X86)
-        ff_init_lls_x86(m);
-}
-
-#if FF_API_LLS_PRIVATE
-av_cold void av_init_lls(LLSModel *m, int indep_count)
-{
-    avpriv_init_lls(m, indep_count);
-}
-void av_update_lls(LLSModel *m, double *param, double decay)
-{
-    m->update_lls(m, param);
-}
-void av_solve_lls(LLSModel *m, double threshold, int min_order)
-{
-    avpriv_solve_lls(m, threshold, min_order);
-}
-double av_evaluate_lls(LLSModel *m, double *param, int order)
-{
-    return m->evaluate_lls(m, param, order);
-}
-#endif /* FF_API_LLS_PRIVATE */
-
-#ifdef TEST
-
-#include <stdio.h>
-#include <limits.h>
-#include "lfg.h"
-
-int main(void)
-{
-    LLSModel m;
-    int i, order;
-    AVLFG lfg;
-
-    av_lfg_init(&lfg, 1);
-    avpriv_init_lls(&m, 3);
-
-    for (i = 0; i < 100; i++) {
-        LOCAL_ALIGNED(32, double, var, [4]);
-        double eval;
-
-        var[0] = (av_lfg_get(&lfg) / (double) UINT_MAX - 0.5) * 2;
-        var[1] = var[0] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
-        var[2] = var[1] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
-        var[3] = var[2] + av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
-        m.update_lls(&m, var);
-        avpriv_solve_lls(&m, 0.001, 0);
-        for (order = 0; order < 3; order++) {
-            eval = m.evaluate_lls(&m, var + 1, order);
-            printf("real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n",
-                   var[0], order, eval, sqrt(m.variance[order] / (i + 1)),
-                   m.coeff[order][0], m.coeff[order][1],
-                   m.coeff[order][2]);
-        }
-    }
-    return 0;
-}
-
-#endif
diff --git a/deps/libav/libavutil/lls.h b/deps/libav/libavutil/lls.h
deleted file mode 100644
index 27c0d5e..0000000
--- a/deps/libav/libavutil/lls.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * linear least squares model
- *
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LLS_H
-#define AVUTIL_LLS_H
-
-#include "common.h"
-#include "mem.h"
-#include "version.h"
-
-#define MAX_VARS 32
-#define MAX_VARS_ALIGN FFALIGN(MAX_VARS+1,4)
-
-//FIXME avoid direct access to LLSModel from outside
-
-/**
- * Linear least squares model.
- */
-typedef struct LLSModel {
-    DECLARE_ALIGNED(32, double, covariance[MAX_VARS_ALIGN][MAX_VARS_ALIGN]);
-    DECLARE_ALIGNED(32, double, coeff[MAX_VARS][MAX_VARS]);
-    double variance[MAX_VARS];
-    int indep_count;
-    /**
-     * Take the outer-product of var[] with itself, and add to the covariance matrix.
-     * @param m this context
-     * @param var training samples, starting with the value to be predicted
-     *            32-byte aligned, and any padding elements must be initialized
-     *            (i.e not denormal/nan).
-     */
-    void (*update_lls)(struct LLSModel *m, double *var);
-    /**
-     * Inner product of var[] and the LPC coefs.
-     * @param m this context
-     * @param var training samples, excluding the value to be predicted. unaligned.
-     * @param order lpc order
-     */
-    double (*evaluate_lls)(struct LLSModel *m, double *var, int order);
-} LLSModel;
-
-void avpriv_init_lls(LLSModel *m, int indep_count);
-void ff_init_lls_x86(LLSModel *m);
-void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order);
-
-#if FF_API_LLS_PRIVATE
-void av_init_lls(LLSModel *m, int indep_count);
-void av_update_lls(LLSModel *m, double *param, double decay);
-void av_solve_lls(LLSModel *m, double threshold, int min_order);
-double av_evaluate_lls(LLSModel *m, double *param, int order);
-#endif /* FF_API_LLS_PRIVATE */
-
-#endif /* AVUTIL_LLS_H */
diff --git a/deps/libav/libavutil/log.c b/deps/libav/libavutil/log.c
deleted file mode 100644
index 3cc811b..0000000
--- a/deps/libav/libavutil/log.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * log functions
- * Copyright (c) 2003 Michel Bardiaux
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * logging functions
- */
-
-#include "config.h"
-
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_IO_H
-#include <io.h>
-#endif
-#include <stdarg.h>
-#include <stdlib.h>
-#include "avstring.h"
-#include "avutil.h"
-#include "common.h"
-#include "internal.h"
-#include "log.h"
-
-static int av_log_level = AV_LOG_INFO;
-static int flags;
-
-#if HAVE_SETCONSOLETEXTATTRIBUTE
-#include <windows.h>
-static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 11 };
-static int16_t background, attr_orig;
-static HANDLE con;
-#define set_color(x)  SetConsoleTextAttribute(con, background | color[x])
-#define reset_color() SetConsoleTextAttribute(con, attr_orig)
-#else
-static const uint8_t color[] = { 0x41, 0x41, 0x11, 0x03, 9, 0x02, 0x06 };
-#define set_color(x)  fprintf(stderr, "\033[%d;3%dm", color[x] >> 4, color[x]&15)
-#define reset_color() fprintf(stderr, "\033[0m")
-#endif
-static int use_color = -1;
-
-static void colored_fputs(int level, const char *str)
-{
-    if (use_color < 0) {
-#if HAVE_SETCONSOLETEXTATTRIBUTE
-        CONSOLE_SCREEN_BUFFER_INFO con_info;
-        con = GetStdHandle(STD_ERROR_HANDLE);
-        use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&
-                    !getenv("AV_LOG_FORCE_NOCOLOR");
-        if (use_color) {
-            GetConsoleScreenBufferInfo(con, &con_info);
-            attr_orig  = con_info.wAttributes;
-            background = attr_orig & 0xF0;
-        }
-#elif HAVE_ISATTY
-        use_color = !getenv("NO_COLOR") && !getenv("AV_LOG_FORCE_NOCOLOR") &&
-                    (getenv("TERM") && isatty(2) ||
-                     getenv("AV_LOG_FORCE_COLOR"));
-#else
-        use_color = getenv("AV_LOG_FORCE_COLOR") && !getenv("NO_COLOR") &&
-                   !getenv("AV_LOG_FORCE_NOCOLOR");
-#endif
-    }
-
-    if (use_color) {
-        set_color(level);
-    }
-    fputs(str, stderr);
-    if (use_color) {
-        reset_color();
-    }
-}
-
-const char *av_default_item_name(void *ptr)
-{
-    return (*(AVClass **) ptr)->class_name;
-}
-
-void av_log_default_callback(void *avcl, int level, const char *fmt, va_list vl)
-{
-    static int print_prefix = 1;
-    static int count;
-    static char prev[1024];
-    char line[1024];
-    static int is_atty;
-    AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
-    if (level > av_log_level)
-        return;
-    line[0] = 0;
-    if (print_prefix && avc) {
-        if (avc->parent_log_context_offset) {
-            AVClass** parent = *(AVClass ***) (((uint8_t *) avcl) +
-                                   avc->parent_log_context_offset);
-            if (parent && *parent) {
-                snprintf(line, sizeof(line), "[%s @ %p] ",
-                         (*parent)->item_name(parent), parent);
-            }
-        }
-        snprintf(line + strlen(line), sizeof(line) - strlen(line), "[%s @ %p] ",
-                 avc->item_name(avcl), avcl);
-    }
-
-    vsnprintf(line + strlen(line), sizeof(line) - strlen(line), fmt, vl);
-
-    print_prefix = strlen(line) && line[strlen(line) - 1] == '\n';
-
-#if HAVE_ISATTY
-    if (!is_atty)
-        is_atty = isatty(2) ? 1 : -1;
-#endif
-
-    if (print_prefix && (flags & AV_LOG_SKIP_REPEATED) &&
-        !strncmp(line, prev, sizeof line)) {
-        count++;
-        if (is_atty == 1)
-            fprintf(stderr, "    Last message repeated %d times\r", count);
-        return;
-    }
-    if (count > 0) {
-        fprintf(stderr, "    Last message repeated %d times\n", count);
-        count = 0;
-    }
-    colored_fputs(av_clip(level >> 3, 0, 6), line);
-    av_strlcpy(prev, line, sizeof line);
-}
-
-static void (*av_log_callback)(void*, int, const char*, va_list) =
-    av_log_default_callback;
-
-void av_log(void* avcl, int level, const char *fmt, ...)
-{
-    AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
-    va_list vl;
-    va_start(vl, fmt);
-    if (avc && avc->version >= (50 << 16 | 15 << 8 | 2) &&
-        avc->log_level_offset_offset && level >= AV_LOG_FATAL)
-        level += *(int *) (((uint8_t *) avcl) + avc->log_level_offset_offset);
-    av_vlog(avcl, level, fmt, vl);
-    va_end(vl);
-}
-
-void av_vlog(void* avcl, int level, const char *fmt, va_list vl)
-{
-    av_log_callback(avcl, level, fmt, vl);
-}
-
-int av_log_get_level(void)
-{
-    return av_log_level;
-}
-
-void av_log_set_level(int level)
-{
-    av_log_level = level;
-}
-
-void av_log_set_flags(int arg)
-{
-    flags = arg;
-}
-
-void av_log_set_callback(void (*callback)(void*, int, const char*, va_list))
-{
-    av_log_callback = callback;
-}
-
-static void missing_feature_sample(int sample, void *avc, const char *msg,
-                                   va_list argument_list)
-{
-    av_vlog(avc, AV_LOG_WARNING, msg, argument_list);
-    av_log(avc, AV_LOG_WARNING, " is not implemented. Update your Libav "
-           "version to the newest one from Git. If the problem still "
-           "occurs, it means that your file has a feature which has not "
-           "been implemented.\n");
-    if (sample)
-        av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample "
-               "of this file to ftp://upload.libav.org/incoming/ "
-               "and contact the libav-devel mailing list.\n");
-}
-
-void avpriv_request_sample(void *avc, const char *msg, ...)
-{
-    va_list argument_list;
-
-    va_start(argument_list, msg);
-    missing_feature_sample(1, avc, msg, argument_list);
-    va_end(argument_list);
-}
-
-void avpriv_report_missing_feature(void *avc, const char *msg, ...)
-{
-    va_list argument_list;
-
-    va_start(argument_list, msg);
-    missing_feature_sample(0, avc, msg, argument_list);
-    va_end(argument_list);
-}
diff --git a/deps/libav/libavutil/log.h b/deps/libav/libavutil/log.h
deleted file mode 100644
index 6d26b67..0000000
--- a/deps/libav/libavutil/log.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LOG_H
-#define AVUTIL_LOG_H
-
-#include <stdarg.h>
-#include "avutil.h"
-#include "attributes.h"
-
-/**
- * Describe the class of an AVClass context structure. That is an
- * arbitrary struct of which the first field is a pointer to an
- * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
- */
-typedef struct AVClass {
-    /**
-     * The name of the class; usually it is the same name as the
-     * context structure type to which the AVClass is associated.
-     */
-    const char* class_name;
-
-    /**
-     * A pointer to a function which returns the name of a context
-     * instance ctx associated with the class.
-     */
-    const char* (*item_name)(void* ctx);
-
-    /**
-     * a pointer to the first option specified in the class if any or NULL
-     *
-     * @see av_set_default_options()
-     */
-    const struct AVOption *option;
-
-    /**
-     * LIBAVUTIL_VERSION with which this structure was created.
-     * This is used to allow fields to be added without requiring major
-     * version bumps everywhere.
-     */
-
-    int version;
-
-    /**
-     * Offset in the structure where log_level_offset is stored.
-     * 0 means there is no such variable
-     */
-    int log_level_offset_offset;
-
-    /**
-     * Offset in the structure where a pointer to the parent context for
-     * logging is stored. For example a decoder could pass its AVCodecContext
-     * to eval as such a parent context, which an av_log() implementation
-     * could then leverage to display the parent context.
-     * The offset can be NULL.
-     */
-    int parent_log_context_offset;
-
-    /**
-     * Return next AVOptions-enabled child or NULL
-     */
-    void* (*child_next)(void *obj, void *prev);
-
-    /**
-     * Return an AVClass corresponding to the next potential
-     * AVOptions-enabled child.
-     *
-     * The difference between child_next and this is that
-     * child_next iterates over _already existing_ objects, while
-     * child_class_next iterates over _all possible_ children.
-     */
-    const struct AVClass* (*child_class_next)(const struct AVClass *prev);
-} AVClass;
-
-/**
- * @addtogroup lavu_log
- *
- * @{
- *
- * @defgroup lavu_log_constants Logging Constants
- *
- * @{
- */
-
-/**
- * Print no output.
- */
-#define AV_LOG_QUIET    -8
-
-/**
- * Something went really wrong and we will crash now.
- */
-#define AV_LOG_PANIC     0
-
-/**
- * Something went wrong and recovery is not possible.
- * For example, no header was found for a format which depends
- * on headers or an illegal combination of parameters is used.
- */
-#define AV_LOG_FATAL     8
-
-/**
- * Something went wrong and cannot losslessly be recovered.
- * However, not all future data is affected.
- */
-#define AV_LOG_ERROR    16
-
-/**
- * Something somehow does not look correct. This may or may not
- * lead to problems. An example would be the use of '-vstrict -2'.
- */
-#define AV_LOG_WARNING  24
-
-/**
- * Standard information.
- */
-#define AV_LOG_INFO     32
-
-/**
- * Detailed information.
- */
-#define AV_LOG_VERBOSE  40
-
-/**
- * Stuff which is only useful for libav* developers.
- */
-#define AV_LOG_DEBUG    48
-
-/**
- * @}
- */
-
-/**
- * Send the specified message to the log if the level is less than or equal
- * to the current av_log_level. By default, all logging messages are sent to
- * stderr. This behavior can be altered by setting a different logging callback
- * function.
- * @see av_log_set_callback
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- *        pointer to an AVClass struct.
- * @param level The importance level of the message expressed using a @ref
- *        lavu_log_constants "Logging Constant".
- * @param fmt The format string (printf-compatible) that specifies how
- *        subsequent arguments are converted to output.
- */
-void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
-
-
-/**
- * Send the specified message to the log if the level is less than or equal
- * to the current av_log_level. By default, all logging messages are sent to
- * stderr. This behavior can be altered by setting a different logging callback
- * function.
- * @see av_log_set_callback
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- *        pointer to an AVClass struct.
- * @param level The importance level of the message expressed using a @ref
- *        lavu_log_constants "Logging Constant".
- * @param fmt The format string (printf-compatible) that specifies how
- *        subsequent arguments are converted to output.
- * @param vl The arguments referenced by the format string.
- */
-void av_vlog(void *avcl, int level, const char *fmt, va_list vl);
-
-/**
- * Get the current log level
- *
- * @see lavu_log_constants
- *
- * @return Current log level
- */
-int av_log_get_level(void);
-
-/**
- * Set the log level
- *
- * @see lavu_log_constants
- *
- * @param level Logging level
- */
-void av_log_set_level(int level);
-
-/**
- * Set the logging callback
- *
- * @see av_log_default_callback
- *
- * @param callback A logging function with a compatible signature.
- */
-void av_log_set_callback(void (*callback)(void*, int, const char*, va_list));
-
-/**
- * Default logging callback
- *
- * It prints the message to stderr, optionally colorizing it.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- *        pointer to an AVClass struct.
- * @param level The importance level of the message expressed using a @ref
- *        lavu_log_constants "Logging Constant".
- * @param fmt The format string (printf-compatible) that specifies how
- *        subsequent arguments are converted to output.
- * @param vl The arguments referenced by the format string.
- */
-void av_log_default_callback(void *avcl, int level, const char *fmt,
-                             va_list vl);
-
-/**
- * Return the context name
- *
- * @param  ctx The AVClass context
- *
- * @return The AVClass class_name
- */
-const char* av_default_item_name(void* ctx);
-
-/**
- * av_dlog macros
- * Useful to print debug messages that shouldn't get compiled in normally.
- */
-
-#ifdef DEBUG
-#    define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
-#else
-#    define av_dlog(pctx, ...)
-#endif
-
-/**
- * Skip repeated messages, this requires the user app to use av_log() instead of
- * (f)printf as the 2 would otherwise interfere and lead to
- * "Last message repeated x times" messages below (f)printf messages with some
- * bad luck.
- * Also to receive the last, "last repeated" line if any, the user app must
- * call av_log(NULL, AV_LOG_QUIET, ""); at the end
- */
-#define AV_LOG_SKIP_REPEATED 1
-void av_log_set_flags(int arg);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_LOG_H */
diff --git a/deps/libav/libavutil/log2_tab.c b/deps/libav/libavutil/log2_tab.c
deleted file mode 100644
index f6cbe79..0000000
--- a/deps/libav/libavutil/log2_tab.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-const uint8_t ff_log2_tab[256]={
-        0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
-        5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-        6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-        6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
-};
diff --git a/deps/libav/libavutil/lzo.c b/deps/libav/libavutil/lzo.c
deleted file mode 100644
index 5c5ebc8..0000000
--- a/deps/libav/libavutil/lzo.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * LZO 1x decompression
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "avutil.h"
-#include "common.h"
-#include "intreadwrite.h"
-#include "lzo.h"
-
-/// Define if we may write up to 12 bytes beyond the output buffer.
-#define OUTBUF_PADDED 1
-/// Define if we may read up to 8 bytes beyond the input buffer.
-#define INBUF_PADDED 1
-
-typedef struct LZOContext {
-    const uint8_t *in, *in_end;
-    uint8_t *out_start, *out, *out_end;
-    int error;
-} LZOContext;
-
-/**
- * @brief Reads one byte from the input buffer, avoiding an overrun.
- * @return byte read
- */
-static inline int get_byte(LZOContext *c)
-{
-    if (c->in < c->in_end)
-        return *c->in++;
-    c->error |= AV_LZO_INPUT_DEPLETED;
-    return 1;
-}
-
-#ifdef INBUF_PADDED
-#define GETB(c) (*(c).in++)
-#else
-#define GETB(c) get_byte(&(c))
-#endif
-
-/**
- * @brief Decodes a length value in the coding used by lzo.
- * @param x previous byte value
- * @param mask bits used from x
- * @return decoded length value
- */
-static inline int get_len(LZOContext *c, int x, int mask)
-{
-    int cnt = x & mask;
-    if (!cnt) {
-        while (!(x = get_byte(c)))
-            cnt += 255;
-        cnt += mask + x;
-    }
-    return cnt;
-}
-
-/**
- * @brief Copies bytes from input to output buffer with checking.
- * @param cnt number of bytes to copy, must be >= 0
- */
-static inline void copy(LZOContext *c, int cnt)
-{
-    register const uint8_t *src = c->in;
-    register uint8_t *dst       = c->out;
-    if (cnt > c->in_end - src) {
-        cnt       = FFMAX(c->in_end - src, 0);
-        c->error |= AV_LZO_INPUT_DEPLETED;
-    }
-    if (cnt > c->out_end - dst) {
-        cnt       = FFMAX(c->out_end - dst, 0);
-        c->error |= AV_LZO_OUTPUT_FULL;
-    }
-#if defined(INBUF_PADDED) && defined(OUTBUF_PADDED)
-    AV_COPY32U(dst, src);
-    src += 4;
-    dst += 4;
-    cnt -= 4;
-    if (cnt > 0)
-#endif
-    memcpy(dst, src, cnt);
-    c->in  = src + cnt;
-    c->out = dst + cnt;
-}
-
-/**
- * @brief Copies previously decoded bytes to current position.
- * @param back how many bytes back we start
- * @param cnt number of bytes to copy, must be >= 0
- *
- * cnt > back is valid, this will copy the bytes we just copied,
- * thus creating a repeating pattern with a period length of back.
- */
-static inline void copy_backptr(LZOContext *c, int back, int cnt)
-{
-    register uint8_t *dst       = c->out;
-    if (dst - c->out_start < back) {
-        c->error |= AV_LZO_INVALID_BACKPTR;
-        return;
-    }
-    if (cnt > c->out_end - dst) {
-        cnt       = FFMAX(c->out_end - dst, 0);
-        c->error |= AV_LZO_OUTPUT_FULL;
-    }
-    av_memcpy_backptr(dst, back, cnt);
-    c->out = dst + cnt;
-}
-
-int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen)
-{
-    int state = 0;
-    int x;
-    LZOContext c;
-    if (!*outlen || !*inlen) {
-        int res = 0;
-        if (!*outlen)
-            res |= AV_LZO_OUTPUT_FULL;
-        if (!*inlen)
-            res |= AV_LZO_INPUT_DEPLETED;
-        return res;
-    }
-    c.in      = in;
-    c.in_end  = (const uint8_t *)in + *inlen;
-    c.out     = c.out_start = out;
-    c.out_end = (uint8_t *)out + *outlen;
-    c.error   = 0;
-    x         = GETB(c);
-    if (x > 17) {
-        copy(&c, x - 17);
-        x = GETB(c);
-        if (x < 16)
-            c.error |= AV_LZO_ERROR;
-    }
-    if (c.in > c.in_end)
-        c.error |= AV_LZO_INPUT_DEPLETED;
-    while (!c.error) {
-        int cnt, back;
-        if (x > 15) {
-            if (x > 63) {
-                cnt  = (x >> 5) - 1;
-                back = (GETB(c) << 3) + ((x >> 2) & 7) + 1;
-            } else if (x > 31) {
-                cnt  = get_len(&c, x, 31);
-                x    = GETB(c);
-                back = (GETB(c) << 6) + (x >> 2) + 1;
-            } else {
-                cnt   = get_len(&c, x, 7);
-                back  = (1 << 14) + ((x & 8) << 11);
-                x     = GETB(c);
-                back += (GETB(c) << 6) + (x >> 2);
-                if (back == (1 << 14)) {
-                    if (cnt != 1)
-                        c.error |= AV_LZO_ERROR;
-                    break;
-                }
-            }
-        } else if (!state) {
-            cnt = get_len(&c, x, 15);
-            copy(&c, cnt + 3);
-            x = GETB(c);
-            if (x > 15)
-                continue;
-            cnt  = 1;
-            back = (1 << 11) + (GETB(c) << 2) + (x >> 2) + 1;
-        } else {
-            cnt  = 0;
-            back = (GETB(c) << 2) + (x >> 2) + 1;
-        }
-        copy_backptr(&c, back, cnt + 2);
-        state =
-        cnt   = x & 3;
-        copy(&c, cnt);
-        x = GETB(c);
-    }
-    *inlen = c.in_end - c.in;
-    if (c.in > c.in_end)
-        *inlen = 0;
-    *outlen = c.out_end - c.out;
-    return c.error;
-}
diff --git a/deps/libav/libavutil/lzo.h b/deps/libav/libavutil/lzo.h
deleted file mode 100644
index 9d7e8f1..0000000
--- a/deps/libav/libavutil/lzo.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * LZO 1x decompression
- * copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LZO_H
-#define AVUTIL_LZO_H
-
-/**
- * @defgroup lavu_lzo LZO
- * @ingroup lavu_crypto
- *
- * @{
- */
-
-#include <stdint.h>
-
-/** @name Error flags returned by av_lzo1x_decode
- * @{ */
-/// end of the input buffer reached before decoding finished
-#define AV_LZO_INPUT_DEPLETED  1
-/// decoded data did not fit into output buffer
-#define AV_LZO_OUTPUT_FULL     2
-/// a reference to previously decoded data was wrong
-#define AV_LZO_INVALID_BACKPTR 4
-/// a non-specific error in the compressed bitstream
-#define AV_LZO_ERROR           8
-/** @} */
-
-#define AV_LZO_INPUT_PADDING   8
-#define AV_LZO_OUTPUT_PADDING 12
-
-/**
- * @brief Decodes LZO 1x compressed data.
- * @param out output buffer
- * @param outlen size of output buffer, number of bytes left are returned here
- * @param in input buffer
- * @param inlen size of input buffer, number of bytes left are returned here
- * @return 0 on success, otherwise a combination of the error flags above
- *
- * Make sure all buffers are appropriately padded, in must provide
- * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
- */
-int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_LZO_H */
diff --git a/deps/libav/libavutil/macros.h b/deps/libav/libavutil/macros.h
deleted file mode 100644
index bf3eb9b..0000000
--- a/deps/libav/libavutil/macros.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * @ingroup lavu
- * Utility Preprocessor macros
- */
-
-#ifndef AVUTIL_MACROS_H
-#define AVUTIL_MACROS_H
-
-/**
- * @addtogroup preproc_misc Preprocessor String Macros
- *
- * String manipulation macros
- *
- * @{
- */
-
-#define AV_STRINGIFY(s)         AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define AV_GLUE(a, b) a ## b
-#define AV_JOIN(a, b) AV_GLUE(a, b)
-
-/**
- * @}
- */
-
-#define AV_PRAGMA(s) _Pragma(#s)
-
-#endif /* AVUTIL_MACROS_H */
diff --git a/deps/libav/libavutil/mathematics.c b/deps/libav/libavutil/mathematics.c
deleted file mode 100644
index 1a38f64..0000000
--- a/deps/libav/libavutil/mathematics.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2005 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * miscellaneous math routines and tables
- */
-
-#include <stdint.h>
-#include <limits.h>
-
-#include "mathematics.h"
-#include "version.h"
-
-#if FF_API_AV_REVERSE
-const uint8_t av_reverse[256]={
-0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
-0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
-0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
-0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
-0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
-0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
-0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
-0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
-0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
-0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
-0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
-0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
-0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
-0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
-0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
-0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
-};
-#endif
-
-int64_t av_gcd(int64_t a, int64_t b){
-    if(b) return av_gcd(b, a%b);
-    else  return a;
-}
-
-int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
-    int64_t r=0;
-
-    if (c <= 0 || b < 0 || rnd == 4 || rnd > 5)
-        return INT64_MIN;
-
-    if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
-
-    if(rnd==AV_ROUND_NEAR_INF) r= c/2;
-    else if(rnd&1)             r= c-1;
-
-    if(b<=INT_MAX && c<=INT_MAX){
-        if(a<=INT_MAX)
-            return (a * b + r)/c;
-        else
-            return a/c*b + (a%c*b + r)/c;
-    }else{
-#if 1
-        uint64_t a0= a&0xFFFFFFFF;
-        uint64_t a1= a>>32;
-        uint64_t b0= b&0xFFFFFFFF;
-        uint64_t b1= b>>32;
-        uint64_t t1= a0*b1 + a1*b0;
-        uint64_t t1a= t1<<32;
-        int i;
-
-        a0 = a0*b0 + t1a;
-        a1 = a1*b1 + (t1>>32) + (a0<t1a);
-        a0 += r;
-        a1 += a0<r;
-
-        for(i=63; i>=0; i--){
-//            int o= a1 & 0x8000000000000000ULL;
-            a1+= a1 + ((a0>>i)&1);
-            t1+=t1;
-            if(/*o || */c <= a1){
-                a1 -= c;
-                t1++;
-            }
-        }
-        return t1;
-    }
-#else
-        AVInteger ai;
-        ai= av_mul_i(av_int2i(a), av_int2i(b));
-        ai= av_add_i(ai, av_int2i(r));
-
-        return av_i2int(av_div_i(ai, av_int2i(c)));
-    }
-#endif
-}
-
-int64_t av_rescale(int64_t a, int64_t b, int64_t c){
-    return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
-}
-
-int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
-                         enum AVRounding rnd)
-{
-    int64_t b= bq.num * (int64_t)cq.den;
-    int64_t c= cq.num * (int64_t)bq.den;
-    return av_rescale_rnd(a, b, c, rnd);
-}
-
-int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
-{
-    return av_rescale_q_rnd(a, bq, cq, AV_ROUND_NEAR_INF);
-}
-
-int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b){
-    int64_t a= tb_a.num * (int64_t)tb_b.den;
-    int64_t b= tb_b.num * (int64_t)tb_a.den;
-    if (av_rescale_rnd(ts_a, a, b, AV_ROUND_DOWN) < ts_b) return -1;
-    if (av_rescale_rnd(ts_b, b, a, AV_ROUND_DOWN) < ts_a) return  1;
-    return 0;
-}
-
-int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod){
-    int64_t c= (a-b) & (mod-1);
-    if(c > (mod>>1))
-        c-= mod;
-    return c;
-}
diff --git a/deps/libav/libavutil/mathematics.h b/deps/libav/libavutil/mathematics.h
deleted file mode 100644
index 043dd0f..0000000
--- a/deps/libav/libavutil/mathematics.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_MATHEMATICS_H
-#define AVUTIL_MATHEMATICS_H
-
-#include <stdint.h>
-#include <math.h>
-#include "attributes.h"
-#include "rational.h"
-#include "intfloat.h"
-
-#ifndef M_LOG2_10
-#define M_LOG2_10      3.32192809488736234787  /* log_2 10 */
-#endif
-#ifndef M_PHI
-#define M_PHI          1.61803398874989484820   /* phi / golden ratio */
-#endif
-#ifndef NAN
-#define NAN            av_int2float(0x7fc00000)
-#endif
-#ifndef INFINITY
-#define INFINITY       av_int2float(0x7f800000)
-#endif
-
-/**
- * @addtogroup lavu_math
- * @{
- */
-
-
-enum AVRounding {
-    AV_ROUND_ZERO     = 0, ///< Round toward zero.
-    AV_ROUND_INF      = 1, ///< Round away from zero.
-    AV_ROUND_DOWN     = 2, ///< Round toward -infinity.
-    AV_ROUND_UP       = 3, ///< Round toward +infinity.
-    AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
-};
-
-/**
- * Return the greatest common divisor of a and b.
- * If both a and b are 0 or either or both are <0 then behavior is
- * undefined.
- */
-int64_t av_const av_gcd(int64_t a, int64_t b);
-
-/**
- * Rescale a 64-bit integer with rounding to nearest.
- * A simple a*b/c isn't possible as it can overflow.
- */
-int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
-
-/**
- * Rescale a 64-bit integer with specified rounding.
- * A simple a*b/c isn't possible as it can overflow.
- */
-int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
-
-/**
- * Rescale a 64-bit integer by 2 rational numbers.
- */
-int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
-
-/**
- * Rescale a 64-bit integer by 2 rational numbers with specified rounding.
- */
-int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
-                         enum AVRounding) av_const;
-
-/**
- * Compare 2 timestamps each in its own timebases.
- * The result of the function is undefined if one of the timestamps
- * is outside the int64_t range when represented in the others timebase.
- * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
- */
-int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
-
-/**
- * Compare 2 integers modulo mod.
- * That is we compare integers a and b for which only the least
- * significant log2(mod) bits are known.
- *
- * @param mod must be a power of 2
- * @return a negative value if a is smaller than b
- *         a positive value if a is greater than b
- *         0                if a equals          b
- */
-int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_MATHEMATICS_H */
diff --git a/deps/libav/libavutil/md5.c b/deps/libav/libavutil/md5.c
deleted file mode 100644
index efb993e..0000000
--- a/deps/libav/libavutil/md5.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (C) 2006 Michael Niedermayer (michaelni at gmx.at)
- * Copyright (C) 2003-2005 by Christopher R. Hertel (crh at ubiqx.mn.org)
- *
- * References:
- *  IETF RFC 1321: The MD5 Message-Digest Algorithm
- *       Ron Rivest. IETF, April, 1992
- *
- * based on http://ubiqx.org/libcifs/source/Auth/MD5.c
- *          from Christopher R. Hertel (crh at ubiqx.mn.org)
- * Simplified, cleaned and IMO redundant comments removed by michael.
- *
- * If you use gcc, then version 4.1 or later and -fomit-frame-pointer is
- * strongly recommended.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-#include "bswap.h"
-#include "intreadwrite.h"
-#include "md5.h"
-#include "mem.h"
-
-typedef struct AVMD5{
-    uint64_t len;
-    uint8_t  block[64];
-    uint32_t ABCD[4];
-} AVMD5;
-
-#if FF_API_CONTEXT_SIZE
-const int av_md5_size = sizeof(AVMD5);
-#endif
-
-struct AVMD5 *av_md5_alloc(void)
-{
-    return av_mallocz(sizeof(struct AVMD5));
-}
-
-static const uint8_t S[4][4] = {
-    { 7, 12, 17, 22 },  /* round 1 */
-    { 5,  9, 14, 20 },  /* round 2 */
-    { 4, 11, 16, 23 },  /* round 3 */
-    { 6, 10, 15, 21 }   /* round 4 */
-};
-
-static const uint32_t T[64] = { // T[i]= fabs(sin(i+1)<<32)
-    0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,   /* round 1 */
-    0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
-    0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
-    0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
-
-    0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,   /* round 2 */
-    0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
-    0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
-    0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
-
-    0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,   /* round 3 */
-    0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
-    0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05,
-    0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
-
-    0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,   /* round 4 */
-    0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
-    0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
-    0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
-};
-
-#define CORE(i, a, b, c, d) do {                                        \
-        t = S[i >> 4][i & 3];                                           \
-        a += T[i];                                                      \
-                                                                        \
-        if (i < 32) {                                                   \
-            if (i < 16) a += (d ^ (b & (c ^ d))) + X[       i  & 15];   \
-            else        a += (c ^ (d & (c ^ b))) + X[(1 + 5*i) & 15];   \
-        } else {                                                        \
-            if (i < 48) a += (b ^ c ^ d)         + X[(5 + 3*i) & 15];   \
-            else        a += (c ^ (b | ~d))      + X[(    7*i) & 15];   \
-        }                                                               \
-        a = b + (a << t | a >> (32 - t));                               \
-    } while (0)
-
-static void body(uint32_t ABCD[4], uint32_t X[16])
-{
-    int t;
-    int i av_unused;
-    unsigned int a = ABCD[3];
-    unsigned int b = ABCD[2];
-    unsigned int c = ABCD[1];
-    unsigned int d = ABCD[0];
-
-#if HAVE_BIGENDIAN
-    for (i = 0; i < 16; i++)
-        X[i] = av_bswap32(X[i]);
-#endif
-
-#if CONFIG_SMALL
-    for (i = 0; i < 64; i++) {
-        CORE(i, a, b, c, d);
-        t = d;
-        d = c;
-        c = b;
-        b = a;
-        a = t;
-    }
-#else
-#define CORE2(i)                                                        \
-    CORE( i,   a,b,c,d); CORE((i+1),d,a,b,c);                           \
-    CORE((i+2),c,d,a,b); CORE((i+3),b,c,d,a)
-#define CORE4(i) CORE2(i); CORE2((i+4)); CORE2((i+8)); CORE2((i+12))
-    CORE4(0); CORE4(16); CORE4(32); CORE4(48);
-#endif
-
-    ABCD[0] += d;
-    ABCD[1] += c;
-    ABCD[2] += b;
-    ABCD[3] += a;
-}
-
-void av_md5_init(AVMD5 *ctx)
-{
-    ctx->len     = 0;
-
-    ctx->ABCD[0] = 0x10325476;
-    ctx->ABCD[1] = 0x98badcfe;
-    ctx->ABCD[2] = 0xefcdab89;
-    ctx->ABCD[3] = 0x67452301;
-}
-
-void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len)
-{
-    int i, j;
-
-    j = ctx->len & 63;
-    ctx->len += len;
-
-    for (i = 0; i < len; i++) {
-        ctx->block[j++] = src[i];
-        if (j == 64) {
-            body(ctx->ABCD, (uint32_t *) ctx->block);
-            j = 0;
-        }
-    }
-}
-
-void av_md5_final(AVMD5 *ctx, uint8_t *dst)
-{
-    int i;
-    uint64_t finalcount = av_le2ne64(ctx->len << 3);
-
-    av_md5_update(ctx, "\200", 1);
-    while ((ctx->len & 63) != 56)
-        av_md5_update(ctx, "", 1);
-
-    av_md5_update(ctx, (uint8_t *)&finalcount, 8);
-
-    for (i = 0; i < 4; i++)
-        AV_WL32(dst + 4*i, ctx->ABCD[3 - i]);
-}
-
-void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len)
-{
-    AVMD5 ctx;
-
-    av_md5_init(&ctx);
-    av_md5_update(&ctx, src, len);
-    av_md5_final(&ctx, dst);
-}
-
-#ifdef TEST
-#include <stdio.h>
-
-static void print_md5(uint8_t *md5)
-{
-    int i;
-    for (i = 0; i < 16; i++)
-        printf("%02x", md5[i]);
-    printf("\n");
-}
-
-int main(void){
-    uint8_t md5val[16];
-    int i;
-    uint8_t in[1000];
-
-    for (i = 0; i < 1000; i++)
-        in[i] = i * i;
-    av_md5_sum(md5val, in, 1000); print_md5(md5val);
-    av_md5_sum(md5val, in,   63); print_md5(md5val);
-    av_md5_sum(md5val, in,   64); print_md5(md5val);
-    av_md5_sum(md5val, in,   65); print_md5(md5val);
-    for (i = 0; i < 1000; i++)
-        in[i] = i % 127;
-    av_md5_sum(md5val, in,  999); print_md5(md5val);
-
-    return 0;
-}
-#endif
diff --git a/deps/libav/libavutil/md5.h b/deps/libav/libavutil/md5.h
deleted file mode 100644
index 29e4e7c..0000000
--- a/deps/libav/libavutil/md5.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_MD5_H
-#define AVUTIL_MD5_H
-
-#include <stdint.h>
-
-#include "attributes.h"
-#include "version.h"
-
-/**
- * @defgroup lavu_md5 MD5
- * @ingroup lavu_crypto
- * @{
- */
-
-#if FF_API_CONTEXT_SIZE
-extern attribute_deprecated const int av_md5_size;
-#endif
-
-struct AVMD5;
-
-struct AVMD5 *av_md5_alloc(void);
-void av_md5_init(struct AVMD5 *ctx);
-void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
-void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
-void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_MD5_H */
diff --git a/deps/libav/libavutil/mem.c b/deps/libav/libavutil/mem.c
deleted file mode 100644
index be42342..0000000
--- a/deps/libav/libavutil/mem.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * default memory allocator for libavutil
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * default memory allocator for libavutil
- */
-
-#include "config.h"
-
-#include <limits.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#if HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
-#include "avutil.h"
-#include "common.h"
-#include "intreadwrite.h"
-#include "mem.h"
-
-#ifdef MALLOC_PREFIX
-
-#define malloc         AV_JOIN(MALLOC_PREFIX, malloc)
-#define memalign       AV_JOIN(MALLOC_PREFIX, memalign)
-#define posix_memalign AV_JOIN(MALLOC_PREFIX, posix_memalign)
-#define realloc        AV_JOIN(MALLOC_PREFIX, realloc)
-#define free           AV_JOIN(MALLOC_PREFIX, free)
-
-void *malloc(size_t size);
-void *memalign(size_t align, size_t size);
-int   posix_memalign(void **ptr, size_t align, size_t size);
-void *realloc(void *ptr, size_t size);
-void  free(void *ptr);
-
-#endif /* MALLOC_PREFIX */
-
-/* You can redefine av_malloc and av_free in your project to use your
- * memory allocator. You do not need to suppress this file because the
- * linker will do it automatically. */
-
-void *av_malloc(size_t size)
-{
-    void *ptr = NULL;
-#if CONFIG_MEMALIGN_HACK
-    long diff;
-#endif
-
-    /* let's disallow possibly ambiguous cases */
-    if (size > (INT_MAX - 32) || !size)
-        return NULL;
-
-#if CONFIG_MEMALIGN_HACK
-    ptr = malloc(size + 32);
-    if (!ptr)
-        return ptr;
-    diff              = ((-(long)ptr - 1) & 31) + 1;
-    ptr               = (char *)ptr + diff;
-    ((char *)ptr)[-1] = diff;
-#elif HAVE_POSIX_MEMALIGN
-    if (posix_memalign(&ptr, 32, size))
-        ptr = NULL;
-#elif HAVE_ALIGNED_MALLOC
-    ptr = _aligned_malloc(size, 32);
-#elif HAVE_MEMALIGN
-    ptr = memalign(32, size);
-    /* Why 64?
-     * Indeed, we should align it:
-     *   on  4 for 386
-     *   on 16 for 486
-     *   on 32 for 586, PPro - K6-III
-     *   on 64 for K7 (maybe for P3 too).
-     * Because L1 and L2 caches are aligned on those values.
-     * But I don't want to code such logic here!
-     */
-    /* Why 32?
-     * For AVX ASM. SSE / NEON needs only 16.
-     * Why not larger? Because I did not see a difference in benchmarks ...
-     */
-    /* benchmarks with P3
-     * memalign(64) + 1          3071, 3051, 3032
-     * memalign(64) + 2          3051, 3032, 3041
-     * memalign(64) + 4          2911, 2896, 2915
-     * memalign(64) + 8          2545, 2554, 2550
-     * memalign(64) + 16         2543, 2572, 2563
-     * memalign(64) + 32         2546, 2545, 2571
-     * memalign(64) + 64         2570, 2533, 2558
-     *
-     * BTW, malloc seems to do 8-byte alignment by default here.
-     */
-#else
-    ptr = malloc(size);
-#endif
-    return ptr;
-}
-
-void *av_realloc(void *ptr, size_t size)
-{
-#if CONFIG_MEMALIGN_HACK
-    int diff;
-#endif
-
-    /* let's disallow possibly ambiguous cases */
-    if (size > (INT_MAX - 16))
-        return NULL;
-
-#if CONFIG_MEMALIGN_HACK
-    //FIXME this isn't aligned correctly, though it probably isn't needed
-    if (!ptr)
-        return av_malloc(size);
-    diff = ((char *)ptr)[-1];
-    return (char *)realloc((char *)ptr - diff, size + diff) + diff;
-#elif HAVE_ALIGNED_MALLOC
-    return _aligned_realloc(ptr, size, 32);
-#else
-    return realloc(ptr, size);
-#endif
-}
-
-int av_reallocp(void *ptr, size_t size)
-{
-    void **ptrptr = ptr;
-    void *ret;
-
-    if (!size) {
-        av_freep(ptr);
-        return 0;
-    }
-    ret = av_realloc(*ptrptr, size);
-
-    if (!ret) {
-        av_freep(ptr);
-        return AVERROR(ENOMEM);
-    }
-
-    *ptrptr = ret;
-    return 0;
-}
-
-void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
-{
-    if (!size || nmemb >= INT_MAX / size)
-        return NULL;
-    return av_realloc(ptr, nmemb * size);
-}
-
-int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
-{
-    void **ptrptr = ptr;
-    void *ret;
-    if (!size || nmemb >= INT_MAX / size)
-        return AVERROR(ENOMEM);
-    if (!nmemb) {
-        av_freep(ptr);
-        return 0;
-    }
-    ret = av_realloc(*ptrptr, nmemb * size);
-    if (!ret) {
-        av_freep(ptr);
-        return AVERROR(ENOMEM);
-    }
-    *ptrptr = ret;
-    return 0;
-}
-
-void av_free(void *ptr)
-{
-#if CONFIG_MEMALIGN_HACK
-    if (ptr)
-        free((char *)ptr - ((char *)ptr)[-1]);
-#elif HAVE_ALIGNED_MALLOC
-    _aligned_free(ptr);
-#else
-    free(ptr);
-#endif
-}
-
-void av_freep(void *arg)
-{
-    void **ptr = (void **)arg;
-    av_free(*ptr);
-    *ptr = NULL;
-}
-
-void *av_mallocz(size_t size)
-{
-    void *ptr = av_malloc(size);
-    if (ptr)
-        memset(ptr, 0, size);
-    return ptr;
-}
-
-char *av_strdup(const char *s)
-{
-    char *ptr = NULL;
-    if (s) {
-        int len = strlen(s) + 1;
-        ptr = av_realloc(NULL, len);
-        if (ptr)
-            memcpy(ptr, s, len);
-    }
-    return ptr;
-}
-
-static void fill16(uint8_t *dst, int len)
-{
-    uint32_t v = AV_RN16(dst - 2);
-
-    v |= v << 16;
-
-    while (len >= 4) {
-        AV_WN32(dst, v);
-        dst += 4;
-        len -= 4;
-    }
-
-    while (len--) {
-        *dst = dst[-2];
-        dst++;
-    }
-}
-
-static void fill24(uint8_t *dst, int len)
-{
-#if HAVE_BIGENDIAN
-    uint32_t v = AV_RB24(dst - 3);
-    uint32_t a = v << 8  | v >> 16;
-    uint32_t b = v << 16 | v >> 8;
-    uint32_t c = v << 24 | v;
-#else
-    uint32_t v = AV_RL24(dst - 3);
-    uint32_t a = v       | v << 24;
-    uint32_t b = v >> 8  | v << 16;
-    uint32_t c = v >> 16 | v << 8;
-#endif
-
-    while (len >= 12) {
-        AV_WN32(dst,     a);
-        AV_WN32(dst + 4, b);
-        AV_WN32(dst + 8, c);
-        dst += 12;
-        len -= 12;
-    }
-
-    if (len >= 4) {
-        AV_WN32(dst, a);
-        dst += 4;
-        len -= 4;
-    }
-
-    if (len >= 4) {
-        AV_WN32(dst, b);
-        dst += 4;
-        len -= 4;
-    }
-
-    while (len--) {
-        *dst = dst[-3];
-        dst++;
-    }
-}
-
-static void fill32(uint8_t *dst, int len)
-{
-    uint32_t v = AV_RN32(dst - 4);
-
-    while (len >= 4) {
-        AV_WN32(dst, v);
-        dst += 4;
-        len -= 4;
-    }
-
-    while (len--) {
-        *dst = dst[-4];
-        dst++;
-    }
-}
-
-void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
-{
-    const uint8_t *src = &dst[-back];
-    if (!back)
-        return;
-
-    if (back == 1) {
-        memset(dst, *src, cnt);
-    } else if (back == 2) {
-        fill16(dst, cnt);
-    } else if (back == 3) {
-        fill24(dst, cnt);
-    } else if (back == 4) {
-        fill32(dst, cnt);
-    } else {
-        if (cnt >= 16) {
-            int blocklen = back;
-            while (cnt > blocklen) {
-                memcpy(dst, src, blocklen);
-                dst       += blocklen;
-                cnt       -= blocklen;
-                blocklen <<= 1;
-            }
-            memcpy(dst, src, cnt);
-            return;
-        }
-        if (cnt >= 8) {
-            AV_COPY32U(dst,     src);
-            AV_COPY32U(dst + 4, src + 4);
-            src += 8;
-            dst += 8;
-            cnt -= 8;
-        }
-        if (cnt >= 4) {
-            AV_COPY32U(dst, src);
-            src += 4;
-            dst += 4;
-            cnt -= 4;
-        }
-        if (cnt >= 2) {
-            AV_COPY16U(dst, src);
-            src += 2;
-            dst += 2;
-            cnt -= 2;
-        }
-        if (cnt)
-            *dst = *src;
-    }
-}
-
-void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
-{
-    if (min_size < *size)
-        return ptr;
-
-    min_size = FFMAX(17 * min_size / 16 + 32, min_size);
-
-    ptr = av_realloc(ptr, min_size);
-    /* we could set this to the unmodified min_size but this is safer
-     * if the user lost the ptr and uses NULL now
-     */
-    if (!ptr)
-        min_size = 0;
-
-    *size = min_size;
-
-    return ptr;
-}
-
-void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
-{
-    void **p = ptr;
-    if (min_size < *size)
-        return;
-    min_size = FFMAX(17 * min_size / 16 + 32, min_size);
-    av_free(*p);
-    *p = av_malloc(min_size);
-    if (!*p)
-        min_size = 0;
-    *size = min_size;
-}
diff --git a/deps/libav/libavutil/mem.h b/deps/libav/libavutil/mem.h
deleted file mode 100644
index 4a5e362..0000000
--- a/deps/libav/libavutil/mem.h
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * memory handling functions
- */
-
-#ifndef AVUTIL_MEM_H
-#define AVUTIL_MEM_H
-
-#include <limits.h>
-#include <stdint.h>
-
-#include "attributes.h"
-#include "avutil.h"
-
-/**
- * @addtogroup lavu_mem
- * @{
- */
-
-
-#if defined(__ICC) && __ICC < 1200 || defined(__SUNPRO_C)
-    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
-    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
-#elif defined(__TI_COMPILER_VERSION__)
-    #define DECLARE_ALIGNED(n,t,v)                      \
-        AV_PRAGMA(DATA_ALIGN(v,n))                      \
-        t __attribute__((aligned(n))) v
-    #define DECLARE_ASM_CONST(n,t,v)                    \
-        AV_PRAGMA(DATA_ALIGN(v,n))                      \
-        static const t __attribute__((aligned(n))) v
-#elif defined(__GNUC__)
-    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
-    #define DECLARE_ASM_CONST(n,t,v)    static const t av_used __attribute__ ((aligned (n))) v
-#elif defined(_MSC_VER)
-    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
-    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
-#else
-    #define DECLARE_ALIGNED(n,t,v)      t v
-    #define DECLARE_ASM_CONST(n,t,v)    static const t v
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-    #define av_malloc_attrib __attribute__((__malloc__))
-#else
-    #define av_malloc_attrib
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(4,3)
-    #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
-#else
-    #define av_alloc_size(...)
-#endif
-
-/**
- * Allocate a block of size bytes with alignment suitable for all
- * memory accesses (including vectors if available on the CPU).
- * @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if the block cannot
- * be allocated.
- * @see av_mallocz()
- */
-void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
-
-/**
- * Allocate a block of size * nmemb bytes with av_malloc().
- * @param nmemb Number of elements
- * @param size Size of the single element
- * @return Pointer to the allocated block, NULL if the block cannot
- * be allocated.
- * @see av_malloc()
- */
-av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
-{
-    if (!size || nmemb >= INT_MAX / size)
-        return NULL;
-    return av_malloc(nmemb * size);
-}
-
-/**
- * Allocate or reallocate a block of memory.
- * If ptr is NULL and size > 0, allocate a new block. If
- * size is zero, free the memory block pointed to by ptr.
- * @param ptr Pointer to a memory block already allocated with
- * av_realloc() or NULL.
- * @param size Size in bytes of the memory block to be allocated or
- * reallocated.
- * @return Pointer to a newly-reallocated block or NULL if the block
- * cannot be reallocated or the function is used to free the memory block.
- * @warning Pointers originating from the av_malloc() family of functions must
- *          not be passed to av_realloc(). The former can be implemented using
- *          memalign() (or other functions), and there is no guarantee that
- *          pointers from such functions can be passed to realloc() at all.
- *          The situation is undefined according to POSIX and may crash with
- *          some libc implementations.
- * @see av_fast_realloc()
- */
-void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
-
-/**
- * Allocate or reallocate a block of memory.
- * If *ptr is NULL and size > 0, allocate a new block. If
- * size is zero, free the memory block pointed to by ptr.
- * @param   ptr Pointer to a pointer to a memory block already allocated
- *          with av_realloc(), or pointer to a pointer to NULL.
- *          The pointer is updated on success, or freed on failure.
- * @param   size Size in bytes for the memory block to be allocated or
- *          reallocated
- * @return  Zero on success, an AVERROR error code on failure.
- * @warning Pointers originating from the av_malloc() family of functions must
- *          not be passed to av_reallocp(). The former can be implemented using
- *          memalign() (or other functions), and there is no guarantee that
- *          pointers from such functions can be passed to realloc() at all.
- *          The situation is undefined according to POSIX and may crash with
- *          some libc implementations.
- */
-int av_reallocp(void *ptr, size_t size);
-
-/**
- * Allocate or reallocate an array.
- * If ptr is NULL and nmemb > 0, allocate a new block. If
- * nmemb is zero, free the memory block pointed to by ptr.
- * @param ptr Pointer to a memory block already allocated with
- * av_realloc() or NULL.
- * @param nmemb Number of elements
- * @param size Size of the single element
- * @return Pointer to a newly-reallocated block or NULL if the block
- * cannot be reallocated or the function is used to free the memory block.
- * @warning Pointers originating from the av_malloc() family of functions must
- *          not be passed to av_realloc(). The former can be implemented using
- *          memalign() (or other functions), and there is no guarantee that
- *          pointers from such functions can be passed to realloc() at all.
- *          The situation is undefined according to POSIX and may crash with
- *          some libc implementations.
- */
-av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size);
-
-/**
- * Allocate or reallocate an array through a pointer to a pointer.
- * If *ptr is NULL and nmemb > 0, allocate a new block. If
- * nmemb is zero, free the memory block pointed to by ptr.
- * @param ptr Pointer to a pointer to a memory block already allocated
- * with av_realloc(), or pointer to a pointer to NULL.
- * The pointer is updated on success, or freed on failure.
- * @param nmemb Number of elements
- * @param size Size of the single element
- * @return Zero on success, an AVERROR error code on failure.
- * @warning Pointers originating from the av_malloc() family of functions must
- *          not be passed to av_realloc(). The former can be implemented using
- *          memalign() (or other functions), and there is no guarantee that
- *          pointers from such functions can be passed to realloc() at all.
- *          The situation is undefined according to POSIX and may crash with
- *          some libc implementations.
- */
-av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
-
-/**
- * Free a memory block which has been allocated with av_malloc(z)() or
- * av_realloc().
- * @param ptr Pointer to the memory block which should be freed.
- * @note ptr = NULL is explicitly allowed.
- * @note It is recommended that you use av_freep() instead.
- * @see av_freep()
- */
-void av_free(void *ptr);
-
-/**
- * Allocate a block of size bytes with alignment suitable for all
- * memory accesses (including vectors if available on the CPU) and
- * zero all the bytes of the block.
- * @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if it cannot be allocated.
- * @see av_malloc()
- */
-void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
-
-/**
- * Allocate a block of size * nmemb bytes with av_mallocz().
- * @param nmemb Number of elements
- * @param size Size of the single element
- * @return Pointer to the allocated block, NULL if the block cannot
- * be allocated.
- * @see av_mallocz()
- * @see av_malloc_array()
- */
-av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
-{
-    if (!size || nmemb >= INT_MAX / size)
-        return NULL;
-    return av_mallocz(nmemb * size);
-}
-
-/**
- * Duplicate the string s.
- * @param s string to be duplicated
- * @return Pointer to a newly-allocated string containing a
- * copy of s or NULL if the string cannot be allocated.
- */
-char *av_strdup(const char *s) av_malloc_attrib;
-
-/**
- * Free a memory block which has been allocated with av_malloc(z)() or
- * av_realloc() and set the pointer pointing to it to NULL.
- * @param ptr Pointer to the pointer to the memory block which should
- * be freed.
- * @see av_free()
- */
-void av_freep(void *ptr);
-
-/**
- * deliberately overlapping memcpy implementation
- * @param dst destination buffer
- * @param back how many bytes back we start (the initial size of the overlapping window)
- * @param cnt number of bytes to copy, must be >= 0
- *
- * cnt > back is valid, this will copy the bytes we just copied,
- * thus creating a repeating pattern with a period length of back.
- */
-void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
-
-/**
- * Reallocate the given block if it is not large enough, otherwise do nothing.
- *
- * @see av_realloc
- */
-void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
-
-/**
- * Allocate a buffer, reusing the given one if large enough.
- *
- * Contrary to av_fast_realloc the current buffer contents might not be
- * preserved and on error the old buffer is freed, thus no special
- * handling to avoid memleaks is necessary.
- *
- * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
- * @param size size of the buffer *ptr points to
- * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
- *                 *size 0 if an error occurred.
- */
-void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_MEM_H */
diff --git a/deps/libav/libavutil/mips/intreadwrite.h b/deps/libav/libavutil/mips/intreadwrite.h
deleted file mode 100644
index 4dabbe6..0000000
--- a/deps/libav/libavutil/mips/intreadwrite.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_MIPS_INTREADWRITE_H
-#define AVUTIL_MIPS_INTREADWRITE_H
-
-#include <stdint.h>
-#include "config.h"
-
-#if ARCH_MIPS64 && HAVE_INLINE_ASM
-
-#define AV_RN32 AV_RN32
-static av_always_inline uint32_t AV_RN32(const void *p)
-{
-    struct __attribute__((packed)) u32 { uint32_t v; };
-    const uint8_t *q = p;
-    const struct u32 *pl = (const struct u32 *)(q + 3 * !HAVE_BIGENDIAN);
-    const struct u32 *pr = (const struct u32 *)(q + 3 *  HAVE_BIGENDIAN);
-    uint32_t v;
-    __asm__ ("lwl %0, %1  \n\t"
-             "lwr %0, %2  \n\t"
-             : "=&r"(v)
-             : "m"(*pl), "m"(*pr));
-    return v;
-}
-
-#endif /* ARCH_MIPS64 && HAVE_INLINE_ASM */
-
-#endif /* AVUTIL_MIPS_INTREADWRITE_H */
diff --git a/deps/libav/libavutil/old_pix_fmts.h b/deps/libav/libavutil/old_pix_fmts.h
deleted file mode 100644
index d3e1e5b..0000000
--- a/deps/libav/libavutil/old_pix_fmts.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_OLD_PIX_FMTS_H
-#define AVUTIL_OLD_PIX_FMTS_H
-
-/*
- * This header exists to prevent new pixel formats from being accidentally added
- * to the deprecated list.
- * Do not include it directly. It will be removed on next major bump
- *
- * Do not add new items to this list. Use the AVPixelFormat enum instead.
- */
-    PIX_FMT_NONE = AV_PIX_FMT_NONE,
-    PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
-    PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
-    PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
-    PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
-    PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
-    PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
-    PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
-    PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
-    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
-    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
-    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
-    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
-    PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
-    PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
-    PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
-#if FF_API_XVMC
-    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
-    PIX_FMT_XVMC_MPEG2_IDCT,
-#endif /* FF_API_XVMC */
-    PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
-    PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
-    PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
-    PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
-    PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
-    PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
-    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
-    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
-
-    PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
-    PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
-    PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
-    PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
-
-    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
-    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
-    PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
-    PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
-    PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
-#if FF_API_VDPAU
-    PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
-    PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
-    PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
-
-    PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
-    PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
-    PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
-    PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
-
-    PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
-    PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
-    PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
-    PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
-
-    PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
-    PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
-    PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-
-    PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-#if FF_API_VDPAU
-    PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
-    PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
-
-    PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
-    PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
-    PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
-    PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
-    PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
-    PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
-    PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
-    PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
-    PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
-    PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big endian
-    PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little endian
-    PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big endian
-    PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little endian
-    PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big endian
-    PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
-    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
-
-#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/deps/libav/libavutil/opt.c b/deps/libav/libavutil/opt.c
deleted file mode 100644
index ede4a49..0000000
--- a/deps/libav/libavutil/opt.c
+++ /dev/null
@@ -1,789 +0,0 @@
-/*
- * AVOptions
- * Copyright (c) 2005 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * AVOptions
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "avutil.h"
-#include "avstring.h"
-#include "common.h"
-#include "opt.h"
-#include "eval.h"
-#include "dict.h"
-#include "log.h"
-#include "mathematics.h"
-
-const AVOption *av_opt_next(void *obj, const AVOption *last)
-{
-    AVClass *class = *(AVClass**)obj;
-    if (!last && class->option && class->option[0].name)
-        return class->option;
-    if (last && last[1].name)
-        return ++last;
-    return NULL;
-}
-
-static int read_number(const AVOption *o, void *dst, double *num, int *den, int64_t *intnum)
-{
-    switch (o->type) {
-    case AV_OPT_TYPE_FLAGS:     *intnum = *(unsigned int*)dst;return 0;
-    case AV_OPT_TYPE_INT:       *intnum = *(int         *)dst;return 0;
-    case AV_OPT_TYPE_INT64:     *intnum = *(int64_t     *)dst;return 0;
-    case AV_OPT_TYPE_FLOAT:     *num    = *(float       *)dst;return 0;
-    case AV_OPT_TYPE_DOUBLE:    *num    = *(double      *)dst;return 0;
-    case AV_OPT_TYPE_RATIONAL:  *intnum = ((AVRational*)dst)->num;
-                                *den    = ((AVRational*)dst)->den;
-                                                        return 0;
-    }
-    return AVERROR(EINVAL);
-}
-
-static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)
-{
-    if (o->type != AV_OPT_TYPE_FLAGS &&
-        (o->max * den < num * intnum || o->min * den > num * intnum)) {
-        av_log(obj, AV_LOG_ERROR, "Value %f for parameter '%s' out of range\n",
-               num*intnum/den, o->name);
-        return AVERROR(ERANGE);
-    }
-
-    switch (o->type) {
-    case AV_OPT_TYPE_FLAGS:
-    case AV_OPT_TYPE_INT:   *(int       *)dst= llrint(num/den)*intnum; break;
-    case AV_OPT_TYPE_INT64: *(int64_t   *)dst= llrint(num/den)*intnum; break;
-    case AV_OPT_TYPE_FLOAT: *(float     *)dst= num*intnum/den;         break;
-    case AV_OPT_TYPE_DOUBLE:*(double    *)dst= num*intnum/den;         break;
-    case AV_OPT_TYPE_RATIONAL:
-        if ((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den};
-        else                 *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24);
-        break;
-    default:
-        return AVERROR(EINVAL);
-    }
-    return 0;
-}
-
-static const double const_values[] = {
-    M_PI,
-    M_E,
-    FF_QP2LAMBDA,
-    0
-};
-
-static const char * const const_names[] = {
-    "PI",
-    "E",
-    "QP2LAMBDA",
-    0
-};
-
-static int hexchar2int(char c) {
-    if (c >= '0' && c <= '9') return c - '0';
-    if (c >= 'a' && c <= 'f') return c - 'a' + 10;
-    if (c >= 'A' && c <= 'F') return c - 'A' + 10;
-    return -1;
-}
-
-static int set_string_binary(void *obj, const AVOption *o, const char *val, uint8_t **dst)
-{
-    int *lendst = (int *)(dst + 1);
-    uint8_t *bin, *ptr;
-    int len = strlen(val);
-
-    av_freep(dst);
-    *lendst = 0;
-
-    if (len & 1)
-        return AVERROR(EINVAL);
-    len /= 2;
-
-    ptr = bin = av_malloc(len);
-    while (*val) {
-        int a = hexchar2int(*val++);
-        int b = hexchar2int(*val++);
-        if (a < 0 || b < 0) {
-            av_free(bin);
-            return AVERROR(EINVAL);
-        }
-        *ptr++ = (a << 4) | b;
-    }
-    *dst = bin;
-    *lendst = len;
-
-    return 0;
-}
-
-static int set_string(void *obj, const AVOption *o, const char *val, uint8_t **dst)
-{
-    av_freep(dst);
-    *dst = av_strdup(val);
-    return 0;
-}
-
-#define DEFAULT_NUMVAL(opt) ((opt->type == AV_OPT_TYPE_INT64 || \
-                              opt->type == AV_OPT_TYPE_CONST || \
-                              opt->type == AV_OPT_TYPE_FLAGS || \
-                              opt->type == AV_OPT_TYPE_INT) ? \
-                             opt->default_val.i64 : opt->default_val.dbl)
-
-static int set_string_number(void *obj, void *target_obj, const AVOption *o, const char *val, void *dst)
-{
-    int ret = 0, notfirst = 0;
-    for (;;) {
-        int i, den = 1;
-        char buf[256];
-        int cmd = 0;
-        double d, num = 1;
-        int64_t intnum = 1;
-
-        i = 0;
-        if (*val == '+' || *val == '-') {
-            if (o->type == AV_OPT_TYPE_FLAGS)
-                cmd = *(val++);
-            else if (!notfirst)
-                buf[i++] = *val;
-        }
-
-        for (; i < sizeof(buf) - 1 && val[i] && val[i] != '+' && val[i] != '-'; i++)
-            buf[i] = val[i];
-        buf[i] = 0;
-
-        {
-            const AVOption *o_named = av_opt_find(target_obj, buf, o->unit, 0, 0);
-            if (o_named && o_named->type == AV_OPT_TYPE_CONST)
-                d = DEFAULT_NUMVAL(o_named);
-            else if (!strcmp(buf, "default")) d = DEFAULT_NUMVAL(o);
-            else if (!strcmp(buf, "max"    )) d = o->max;
-            else if (!strcmp(buf, "min"    )) d = o->min;
-            else if (!strcmp(buf, "none"   )) d = 0;
-            else if (!strcmp(buf, "all"    )) d = ~0;
-            else {
-                int res = av_expr_parse_and_eval(&d, buf, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, obj);
-                if (res < 0) {
-                    av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", val);
-                    return res;
-                }
-            }
-        }
-        if (o->type == AV_OPT_TYPE_FLAGS) {
-            read_number(o, dst, NULL, NULL, &intnum);
-            if      (cmd == '+') d = intnum | (int64_t)d;
-            else if (cmd == '-') d = intnum &~(int64_t)d;
-        } else {
-            read_number(o, dst, &num, &den, &intnum);
-            if      (cmd == '+') d = notfirst*num*intnum/den + d;
-            else if (cmd == '-') d = notfirst*num*intnum/den - d;
-        }
-
-        if ((ret = write_number(obj, o, dst, d, 1, 1)) < 0)
-            return ret;
-        val += i;
-        if (!*val)
-            return 0;
-        notfirst = 1;
-    }
-
-    return 0;
-}
-
-int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
-{
-    void *dst, *target_obj;
-    const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
-    if (!o || !target_obj)
-        return AVERROR_OPTION_NOT_FOUND;
-    if (!val)
-        return AVERROR(EINVAL);
-
-    dst = ((uint8_t*)target_obj) + o->offset;
-    switch (o->type) {
-    case AV_OPT_TYPE_STRING:   return set_string(obj, o, val, dst);
-    case AV_OPT_TYPE_BINARY:   return set_string_binary(obj, o, val, dst);
-    case AV_OPT_TYPE_FLAGS:
-    case AV_OPT_TYPE_INT:
-    case AV_OPT_TYPE_INT64:
-    case AV_OPT_TYPE_FLOAT:
-    case AV_OPT_TYPE_DOUBLE:
-    case AV_OPT_TYPE_RATIONAL: return set_string_number(obj, target_obj, o, val, dst);
-    }
-
-    av_log(obj, AV_LOG_ERROR, "Invalid option type.\n");
-    return AVERROR(EINVAL);
-}
-
-#define OPT_EVAL_NUMBER(name, opttype, vartype)\
-    int av_opt_eval_ ## name(void *obj, const AVOption *o, const char *val, vartype *name ## _out)\
-    {\
-        if (!o || o->type != opttype)\
-            return AVERROR(EINVAL);\
-        return set_string_number(obj, obj, o, val, name ## _out);\
-    }
-
-OPT_EVAL_NUMBER(flags,  AV_OPT_TYPE_FLAGS,    int)
-OPT_EVAL_NUMBER(int,    AV_OPT_TYPE_INT,      int)
-OPT_EVAL_NUMBER(int64,  AV_OPT_TYPE_INT64,    int64_t)
-OPT_EVAL_NUMBER(float,  AV_OPT_TYPE_FLOAT,    float)
-OPT_EVAL_NUMBER(double, AV_OPT_TYPE_DOUBLE,   double)
-OPT_EVAL_NUMBER(q,      AV_OPT_TYPE_RATIONAL, AVRational)
-
-static int set_number(void *obj, const char *name, double num, int den, int64_t intnum,
-                                  int search_flags)
-{
-    void *dst, *target_obj;
-    const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
-
-    if (!o || !target_obj)
-        return AVERROR_OPTION_NOT_FOUND;
-
-    dst = ((uint8_t*)target_obj) + o->offset;
-    return write_number(obj, o, dst, num, den, intnum);
-}
-
-int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
-{
-    return set_number(obj, name, 1, 1, val, search_flags);
-}
-
-int av_opt_set_double(void *obj, const char *name, double val, int search_flags)
-{
-    return set_number(obj, name, val, 1, 1, search_flags);
-}
-
-int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags)
-{
-    return set_number(obj, name, val.num, val.den, 1, search_flags);
-}
-
-int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags)
-{
-    void *target_obj;
-    const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
-    uint8_t *ptr;
-    uint8_t **dst;
-    int *lendst;
-
-    if (!o || !target_obj)
-        return AVERROR_OPTION_NOT_FOUND;
-
-    if (o->type != AV_OPT_TYPE_BINARY)
-        return AVERROR(EINVAL);
-
-    ptr = av_malloc(len);
-    if (!ptr)
-        return AVERROR(ENOMEM);
-
-    dst = (uint8_t **)(((uint8_t *)target_obj) + o->offset);
-    lendst = (int *)(dst + 1);
-
-    av_free(*dst);
-    *dst = ptr;
-    *lendst = len;
-    memcpy(ptr, val, len);
-
-    return 0;
-}
-
-int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
-{
-    void *dst, *target_obj;
-    const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
-    uint8_t *bin, buf[128];
-    int len, i, ret;
-
-    if (!o || !target_obj)
-        return AVERROR_OPTION_NOT_FOUND;
-
-    dst = (uint8_t*)target_obj + o->offset;
-
-    buf[0] = 0;
-    switch (o->type) {
-    case AV_OPT_TYPE_FLAGS:     ret = snprintf(buf, sizeof(buf), "0x%08X",  *(int    *)dst);break;
-    case AV_OPT_TYPE_INT:       ret = snprintf(buf, sizeof(buf), "%d" ,     *(int    *)dst);break;
-    case AV_OPT_TYPE_INT64:     ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break;
-    case AV_OPT_TYPE_FLOAT:     ret = snprintf(buf, sizeof(buf), "%f" ,     *(float  *)dst);break;
-    case AV_OPT_TYPE_DOUBLE:    ret = snprintf(buf, sizeof(buf), "%f" ,     *(double *)dst);break;
-    case AV_OPT_TYPE_RATIONAL:  ret = snprintf(buf, sizeof(buf), "%d/%d",   ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;
-    case AV_OPT_TYPE_STRING:
-        if (*(uint8_t**)dst)
-            *out_val = av_strdup(*(uint8_t**)dst);
-        else
-            *out_val = av_strdup("");
-        return 0;
-    case AV_OPT_TYPE_BINARY:
-        len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));
-        if ((uint64_t)len*2 + 1 > INT_MAX)
-            return AVERROR(EINVAL);
-        if (!(*out_val = av_malloc(len*2 + 1)))
-            return AVERROR(ENOMEM);
-        bin = *(uint8_t**)dst;
-        for (i = 0; i < len; i++)
-            snprintf(*out_val + i*2, 3, "%02X", bin[i]);
-        return 0;
-    default:
-        return AVERROR(EINVAL);
-    }
-
-    if (ret >= sizeof(buf))
-        return AVERROR(EINVAL);
-    *out_val = av_strdup(buf);
-    return 0;
-}
-
-static int get_number(void *obj, const char *name, double *num, int *den, int64_t *intnum,
-                      int search_flags)
-{
-    void *dst, *target_obj;
-    const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
-    if (!o || !target_obj)
-        goto error;
-
-    dst = ((uint8_t*)target_obj) + o->offset;
-
-    return read_number(o, dst, num, den, intnum);
-
-error:
-    *den=*intnum=0;
-    return -1;
-}
-
-int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
-{
-    int64_t intnum = 1;
-    double     num = 1;
-    int   ret, den = 1;
-
-    if ((ret = get_number(obj, name, &num, &den, &intnum, search_flags)) < 0)
-        return ret;
-    *out_val = num*intnum/den;
-    return 0;
-}
-
-int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val)
-{
-    int64_t intnum = 1;
-    double     num = 1;
-    int   ret, den = 1;
-
-    if ((ret = get_number(obj, name, &num, &den, &intnum, search_flags)) < 0)
-        return ret;
-    *out_val = num*intnum/den;
-    return 0;
-}
-
-int av_opt_get_q(void *obj, const char *name, int search_flags, AVRational *out_val)
-{
-    int64_t intnum = 1;
-    double     num = 1;
-    int   ret, den = 1;
-
-    if ((ret = get_number(obj, name, &num, &den, &intnum, search_flags)) < 0)
-        return ret;
-
-    if (num == 1.0 && (int)intnum == intnum)
-        *out_val = (AVRational){intnum, den};
-    else
-        *out_val = av_d2q(num*intnum/den, 1<<24);
-    return 0;
-}
-
-int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
-{
-    const AVOption *field = av_opt_find(obj, field_name, NULL, 0, 0);
-    const AVOption *flag  = av_opt_find(obj, flag_name,
-                                        field ? field->unit : NULL, 0, 0);
-    int64_t res;
-
-    if (!field || !flag || flag->type != AV_OPT_TYPE_CONST ||
-        av_opt_get_int(obj, field_name, 0, &res) < 0)
-        return 0;
-    return res & flag->default_val.i64;
-}
-
-static void opt_list(void *obj, void *av_log_obj, const char *unit,
-                     int req_flags, int rej_flags)
-{
-    const AVOption *opt=NULL;
-
-    while ((opt = av_opt_next(obj, opt))) {
-        if (!(opt->flags & req_flags) || (opt->flags & rej_flags))
-            continue;
-
-        /* Don't print CONST's on level one.
-         * Don't print anything but CONST's on level two.
-         * Only print items from the requested unit.
-         */
-        if (!unit && opt->type==AV_OPT_TYPE_CONST)
-            continue;
-        else if (unit && opt->type!=AV_OPT_TYPE_CONST)
-            continue;
-        else if (unit && opt->type==AV_OPT_TYPE_CONST && strcmp(unit, opt->unit))
-            continue;
-        else if (unit && opt->type == AV_OPT_TYPE_CONST)
-            av_log(av_log_obj, AV_LOG_INFO, "   %-15s ", opt->name);
-        else
-            av_log(av_log_obj, AV_LOG_INFO, "-%-17s ", opt->name);
-
-        switch (opt->type) {
-            case AV_OPT_TYPE_FLAGS:
-                av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<flags>");
-                break;
-            case AV_OPT_TYPE_INT:
-                av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<int>");
-                break;
-            case AV_OPT_TYPE_INT64:
-                av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<int64>");
-                break;
-            case AV_OPT_TYPE_DOUBLE:
-                av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<double>");
-                break;
-            case AV_OPT_TYPE_FLOAT:
-                av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<float>");
-                break;
-            case AV_OPT_TYPE_STRING:
-                av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<string>");
-                break;
-            case AV_OPT_TYPE_RATIONAL:
-                av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<rational>");
-                break;
-            case AV_OPT_TYPE_BINARY:
-                av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<binary>");
-                break;
-            case AV_OPT_TYPE_CONST:
-            default:
-                av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "");
-                break;
-        }
-        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_ENCODING_PARAM) ? 'E' : '.');
-        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_DECODING_PARAM) ? 'D' : '.');
-        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_VIDEO_PARAM   ) ? 'V' : '.');
-        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_AUDIO_PARAM   ) ? 'A' : '.');
-        av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.');
-
-        if (opt->help)
-            av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help);
-        av_log(av_log_obj, AV_LOG_INFO, "\n");
-        if (opt->unit && opt->type != AV_OPT_TYPE_CONST) {
-            opt_list(obj, av_log_obj, opt->unit, req_flags, rej_flags);
-        }
-    }
-}
-
-int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags)
-{
-    if (!obj)
-        return -1;
-
-    av_log(av_log_obj, AV_LOG_INFO, "%s AVOptions:\n", (*(AVClass**)obj)->class_name);
-
-    opt_list(obj, av_log_obj, NULL, req_flags, rej_flags);
-
-    return 0;
-}
-
-void av_opt_set_defaults(void *s)
-{
-    const AVOption *opt = NULL;
-    while ((opt = av_opt_next(s, opt)) != NULL) {
-        switch (opt->type) {
-            case AV_OPT_TYPE_CONST:
-                /* Nothing to be done here */
-            break;
-            case AV_OPT_TYPE_FLAGS:
-            case AV_OPT_TYPE_INT:
-            case AV_OPT_TYPE_INT64:
-                av_opt_set_int(s, opt->name, opt->default_val.i64, 0);
-            break;
-            case AV_OPT_TYPE_DOUBLE:
-            case AV_OPT_TYPE_FLOAT: {
-                double val;
-                val = opt->default_val.dbl;
-                av_opt_set_double(s, opt->name, val, 0);
-            }
-            break;
-            case AV_OPT_TYPE_RATIONAL: {
-                AVRational val;
-                val = av_d2q(opt->default_val.dbl, INT_MAX);
-                av_opt_set_q(s, opt->name, val, 0);
-            }
-            break;
-            case AV_OPT_TYPE_STRING:
-                av_opt_set(s, opt->name, opt->default_val.str, 0);
-                break;
-            case AV_OPT_TYPE_BINARY:
-                /* Cannot set default for binary */
-            break;
-            default:
-                av_log(s, AV_LOG_DEBUG, "AVOption type %d of option %s not implemented yet\n", opt->type, opt->name);
-        }
-    }
-}
-
-/**
- * Store the value in the field in ctx that is named like key.
- * ctx must be an AVClass context, storing is done using AVOptions.
- *
- * @param buf the string to parse, buf will be updated to point at the
- * separator just after the parsed key/value pair
- * @param key_val_sep a 0-terminated list of characters used to
- * separate key from value
- * @param pairs_sep a 0-terminated list of characters used to separate
- * two pairs from each other
- * @return 0 if the key/value pair has been successfully parsed and
- * set, or a negative value corresponding to an AVERROR code in case
- * of error:
- * AVERROR(EINVAL) if the key/value pair cannot be parsed,
- * the error code issued by av_opt_set() if the key/value pair
- * cannot be set
- */
-static int parse_key_value_pair(void *ctx, const char **buf,
-                                const char *key_val_sep, const char *pairs_sep)
-{
-    char *key = av_get_token(buf, key_val_sep);
-    char *val;
-    int ret;
-
-    if (!key)
-        return AVERROR(ENOMEM);
-
-    if (*key && strspn(*buf, key_val_sep)) {
-        (*buf)++;
-        val = av_get_token(buf, pairs_sep);
-        if (!val) {
-            av_freep(&key);
-            return AVERROR(ENOMEM);
-        }
-    } else {
-        av_log(ctx, AV_LOG_ERROR, "Missing key or no key/value separator found after key '%s'\n", key);
-        av_free(key);
-        return AVERROR(EINVAL);
-    }
-
-    av_log(ctx, AV_LOG_DEBUG, "Setting value '%s' for key '%s'\n", val, key);
-
-    ret = av_opt_set(ctx, key, val, AV_OPT_SEARCH_CHILDREN);
-    if (ret == AVERROR_OPTION_NOT_FOUND)
-        av_log(ctx, AV_LOG_ERROR, "Key '%s' not found.\n", key);
-
-    av_free(key);
-    av_free(val);
-    return ret;
-}
-
-int av_set_options_string(void *ctx, const char *opts,
-                          const char *key_val_sep, const char *pairs_sep)
-{
-    int ret, count = 0;
-
-    if (!opts)
-        return 0;
-
-    while (*opts) {
-        if ((ret = parse_key_value_pair(ctx, &opts, key_val_sep, pairs_sep)) < 0)
-            return ret;
-        count++;
-
-        if (*opts)
-            opts++;
-    }
-
-    return count;
-}
-
-void av_opt_free(void *obj)
-{
-    const AVOption *o = NULL;
-    while ((o = av_opt_next(obj, o)))
-        if (o->type == AV_OPT_TYPE_STRING || o->type == AV_OPT_TYPE_BINARY)
-            av_freep((uint8_t *)obj + o->offset);
-}
-
-int av_opt_set_dict(void *obj, AVDictionary **options)
-{
-    AVDictionaryEntry *t = NULL;
-    AVDictionary    *tmp = NULL;
-    int ret = 0;
-
-    while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
-        ret = av_opt_set(obj, t->key, t->value, 0);
-        if (ret == AVERROR_OPTION_NOT_FOUND)
-            av_dict_set(&tmp, t->key, t->value, 0);
-        else if (ret < 0) {
-            av_log(obj, AV_LOG_ERROR, "Error setting option %s to value %s.\n", t->key, t->value);
-            break;
-        }
-        ret = 0;
-    }
-    av_dict_free(options);
-    *options = tmp;
-    return ret;
-}
-
-const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
-                            int opt_flags, int search_flags)
-{
-    return av_opt_find2(obj, name, unit, opt_flags, search_flags, NULL);
-}
-
-const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
-                             int opt_flags, int search_flags, void **target_obj)
-{
-    const AVClass  *c = *(AVClass**)obj;
-    const AVOption *o = NULL;
-
-    if (!c)
-        return NULL;
-
-    if (search_flags & AV_OPT_SEARCH_CHILDREN) {
-        if (search_flags & AV_OPT_SEARCH_FAKE_OBJ) {
-            const AVClass *child = NULL;
-            while (child = av_opt_child_class_next(c, child))
-                if (o = av_opt_find2(&child, name, unit, opt_flags, search_flags, NULL))
-                    return o;
-        } else {
-            void *child = NULL;
-            while (child = av_opt_child_next(obj, child))
-                if (o = av_opt_find2(child, name, unit, opt_flags, search_flags, target_obj))
-                    return o;
-        }
-    }
-
-    while (o = av_opt_next(obj, o)) {
-        if (!strcmp(o->name, name) && (o->flags & opt_flags) == opt_flags &&
-            ((!unit && o->type != AV_OPT_TYPE_CONST) ||
-             (unit  && o->unit && !strcmp(o->unit, unit)))) {
-            if (target_obj) {
-                if (!(search_flags & AV_OPT_SEARCH_FAKE_OBJ))
-                    *target_obj = obj;
-                else
-                    *target_obj = NULL;
-            }
-            return o;
-        }
-    }
-    return NULL;
-}
-
-void *av_opt_child_next(void *obj, void *prev)
-{
-    const AVClass *c = *(AVClass**)obj;
-    if (c->child_next)
-        return c->child_next(obj, prev);
-    return NULL;
-}
-
-const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev)
-{
-    if (parent->child_class_next)
-        return parent->child_class_next(prev);
-    return NULL;
-}
-
-#ifdef TEST
-
-typedef struct TestContext
-{
-    const AVClass *class;
-    int num;
-    int toggle;
-    char *string;
-    int flags;
-    AVRational rational;
-} TestContext;
-
-#define OFFSET(x) offsetof(TestContext, x)
-
-#define TEST_FLAG_COOL 01
-#define TEST_FLAG_LAME 02
-#define TEST_FLAG_MU   04
-
-static const AVOption test_options[]= {
-{"num",      "set num",        OFFSET(num),      AV_OPT_TYPE_INT,      {.i64 = 0},       0,        100                 },
-{"toggle",   "set toggle",     OFFSET(toggle),   AV_OPT_TYPE_INT,      {.i64 = 0},       0,        1                   },
-{"rational", "set rational",   OFFSET(rational), AV_OPT_TYPE_RATIONAL, {.dbl = 0},  0,        10                  },
-{"string",   "set string",     OFFSET(string),   AV_OPT_TYPE_STRING,   {0},              CHAR_MIN, CHAR_MAX            },
-{"flags",    "set flags",      OFFSET(flags),    AV_OPT_TYPE_FLAGS,    {.i64 = 0},       0,        INT_MAX, 0, "flags" },
-{"cool",     "set cool flag ", 0,                AV_OPT_TYPE_CONST,    {.i64 = TEST_FLAG_COOL}, INT_MIN,  INT_MAX, 0, "flags" },
-{"lame",     "set lame flag ", 0,                AV_OPT_TYPE_CONST,    {.i64 = TEST_FLAG_LAME}, INT_MIN,  INT_MAX, 0, "flags" },
-{"mu",       "set mu flag ",   0,                AV_OPT_TYPE_CONST,    {.i64 = TEST_FLAG_MU},   INT_MIN,  INT_MAX, 0, "flags" },
-{NULL},
-};
-
-static const char *test_get_name(void *ctx)
-{
-    return "test";
-}
-
-static const AVClass test_class = {
-    "TestContext",
-    test_get_name,
-    test_options
-};
-
-int main(void)
-{
-    int i;
-
-    printf("\nTesting av_set_options_string()\n");
-    {
-        TestContext test_ctx;
-        const char *options[] = {
-            "",
-            ":",
-            "=",
-            "foo=:",
-            ":=foo",
-            "=foo",
-            "foo=",
-            "foo",
-            "foo=val",
-            "foo==val",
-            "toggle=:",
-            "string=:",
-            "toggle=1 : foo",
-            "toggle=100",
-            "toggle==1",
-            "flags=+mu-lame : num=42: toggle=0",
-            "num=42 : string=blahblah",
-            "rational=0 : rational=1/2 : rational=1/-1",
-            "rational=-1/0",
-        };
-
-        test_ctx.class = &test_class;
-        av_opt_set_defaults(&test_ctx);
-        test_ctx.string = av_strdup("default");
-
-        av_log_set_level(AV_LOG_DEBUG);
-
-        for (i=0; i < FF_ARRAY_ELEMS(options); i++) {
-            av_log(&test_ctx, AV_LOG_DEBUG, "Setting options string '%s'\n", options[i]);
-            if (av_set_options_string(&test_ctx, options[i], "=", ":") < 0)
-                av_log(&test_ctx, AV_LOG_ERROR, "Error setting options string: '%s'\n", options[i]);
-            printf("\n");
-        }
-    }
-
-    return 0;
-}
-
-#endif
diff --git a/deps/libav/libavutil/opt.h b/deps/libav/libavutil/opt.h
deleted file mode 100644
index 0181379..0000000
--- a/deps/libav/libavutil/opt.h
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * AVOptions
- * copyright (c) 2005 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_OPT_H
-#define AVUTIL_OPT_H
-
-/**
- * @file
- * AVOptions
- */
-
-#include "rational.h"
-#include "avutil.h"
-#include "dict.h"
-#include "log.h"
-
-/**
- * @defgroup avoptions AVOptions
- * @ingroup lavu_data
- * @{
- * AVOptions provide a generic system to declare options on arbitrary structs
- * ("objects"). An option can have a help text, a type and a range of possible
- * values. Options may then be enumerated, read and written to.
- *
- * @section avoptions_implement Implementing AVOptions
- * This section describes how to add AVOptions capabilities to a struct.
- *
- * All AVOptions-related information is stored in an AVClass. Therefore
- * the first member of the struct must be a pointer to an AVClass describing it.
- * The option field of the AVClass must be set to a NULL-terminated static array
- * of AVOptions. Each AVOption must have a non-empty name, a type, a default
- * value and for number-type AVOptions also a range of allowed values. It must
- * also declare an offset in bytes from the start of the struct, where the field
- * associated with this AVOption is located. Other fields in the AVOption struct
- * should also be set when applicable, but are not required.
- *
- * The following example illustrates an AVOptions-enabled struct:
- * @code
- * typedef struct test_struct {
- *     AVClass *class;
- *     int      int_opt;
- *     char    *str_opt;
- *     uint8_t *bin_opt;
- *     int      bin_len;
- * } test_struct;
- *
- * static const AVOption test_options[] = {
- *   { "test_int", "This is a test option of int type.", offsetof(test_struct, int_opt),
- *     AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX },
- *   { "test_str", "This is a test option of string type.", offsetof(test_struct, str_opt),
- *     AV_OPT_TYPE_STRING },
- *   { "test_bin", "This is a test option of binary type.", offsetof(test_struct, bin_opt),
- *     AV_OPT_TYPE_BINARY },
- *   { NULL },
- * };
- *
- * static const AVClass test_class = {
- *     .class_name = "test class",
- *     .item_name  = av_default_item_name,
- *     .option     = test_options,
- *     .version    = LIBAVUTIL_VERSION_INT,
- * };
- * @endcode
- *
- * Next, when allocating your struct, you must ensure that the AVClass pointer
- * is set to the correct value. Then, av_opt_set_defaults() must be called to
- * initialize defaults. After that the struct is ready to be used with the
- * AVOptions API.
- *
- * When cleaning up, you may use the av_opt_free() function to automatically
- * free all the allocated string and binary options.
- *
- * Continuing with the above example:
- *
- * @code
- * test_struct *alloc_test_struct(void)
- * {
- *     test_struct *ret = av_malloc(sizeof(*ret));
- *     ret->class = &test_class;
- *     av_opt_set_defaults(ret);
- *     return ret;
- * }
- * void free_test_struct(test_struct **foo)
- * {
- *     av_opt_free(*foo);
- *     av_freep(foo);
- * }
- * @endcode
- *
- * @subsection avoptions_implement_nesting Nesting
- *      It may happen that an AVOptions-enabled struct contains another
- *      AVOptions-enabled struct as a member (e.g. AVCodecContext in
- *      libavcodec exports generic options, while its priv_data field exports
- *      codec-specific options). In such a case, it is possible to set up the
- *      parent struct to export a child's options. To do that, simply
- *      implement AVClass.child_next() and AVClass.child_class_next() in the
- *      parent struct's AVClass.
- *      Assuming that the test_struct from above now also contains a
- *      child_struct field:
- *
- *      @code
- *      typedef struct child_struct {
- *          AVClass *class;
- *          int flags_opt;
- *      } child_struct;
- *      static const AVOption child_opts[] = {
- *          { "test_flags", "This is a test option of flags type.",
- *            offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX },
- *          { NULL },
- *      };
- *      static const AVClass child_class = {
- *          .class_name = "child class",
- *          .item_name  = av_default_item_name,
- *          .option     = child_opts,
- *          .version    = LIBAVUTIL_VERSION_INT,
- *      };
- *
- *      void *child_next(void *obj, void *prev)
- *      {
- *          test_struct *t = obj;
- *          if (!prev && t->child_struct)
- *              return t->child_struct;
- *          return NULL
- *      }
- *      const AVClass child_class_next(const AVClass *prev)
- *      {
- *          return prev ? NULL : &child_class;
- *      }
- *      @endcode
- *      Putting child_next() and child_class_next() as defined above into
- *      test_class will now make child_struct's options accessible through
- *      test_struct (again, proper setup as described above needs to be done on
- *      child_struct right after it is created).
- *
- *      From the above example it might not be clear why both child_next()
- *      and child_class_next() are needed. The distinction is that child_next()
- *      iterates over actually existing objects, while child_class_next()
- *      iterates over all possible child classes. E.g. if an AVCodecContext
- *      was initialized to use a codec which has private options, then its
- *      child_next() will return AVCodecContext.priv_data and finish
- *      iterating. OTOH child_class_next() on AVCodecContext.av_class will
- *      iterate over all available codecs with private options.
- *
- * @subsection avoptions_implement_named_constants Named constants
- *      It is possible to create named constants for options. Simply set the unit
- *      field of the option the constants should apply to to a string and
- *      create the constants themselves as options of type AV_OPT_TYPE_CONST
- *      with their unit field set to the same string.
- *      Their default_val field should contain the value of the named
- *      constant.
- *      For example, to add some named constants for the test_flags option
- *      above, put the following into the child_opts array:
- *      @code
- *      { "test_flags", "This is a test option of flags type.",
- *        offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX, "test_unit" },
- *      { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { .i64 = 16 }, 0, 0, "test_unit" },
- *      @endcode
- *
- * @section avoptions_use Using AVOptions
- * This section deals with accessing options in an AVOptions-enabled struct.
- * Such structs in Libav are e.g. AVCodecContext in libavcodec or
- * AVFormatContext in libavformat.
- *
- * @subsection avoptions_use_examine Examining AVOptions
- * The basic functions for examining options are av_opt_next(), which iterates
- * over all options defined for one object, and av_opt_find(), which searches
- * for an option with the given name.
- *
- * The situation is more complicated with nesting. An AVOptions-enabled struct
- * may have AVOptions-enabled children. Passing the AV_OPT_SEARCH_CHILDREN flag
- * to av_opt_find() will make the function search children recursively.
- *
- * For enumerating there are basically two cases. The first is when you want to
- * get all options that may potentially exist on the struct and its children
- * (e.g.  when constructing documentation). In that case you should call
- * av_opt_child_class_next() recursively on the parent struct's AVClass.  The
- * second case is when you have an already initialized struct with all its
- * children and you want to get all options that can be actually written or read
- * from it. In that case you should call av_opt_child_next() recursively (and
- * av_opt_next() on each result).
- *
- * @subsection avoptions_use_get_set Reading and writing AVOptions
- * When setting options, you often have a string read directly from the
- * user. In such a case, simply passing it to av_opt_set() is enough. For
- * non-string type options, av_opt_set() will parse the string according to the
- * option type.
- *
- * Similarly av_opt_get() will read any option type and convert it to a string
- * which will be returned. Do not forget that the string is allocated, so you
- * have to free it with av_free().
- *
- * In some cases it may be more convenient to put all options into an
- * AVDictionary and call av_opt_set_dict() on it. A specific case of this
- * are the format/codec open functions in lavf/lavc which take a dictionary
- * filled with option as a parameter. This allows to set some options
- * that cannot be set otherwise, since e.g. the input file format is not known
- * before the file is actually opened.
- */
-
-enum AVOptionType{
-    AV_OPT_TYPE_FLAGS,
-    AV_OPT_TYPE_INT,
-    AV_OPT_TYPE_INT64,
-    AV_OPT_TYPE_DOUBLE,
-    AV_OPT_TYPE_FLOAT,
-    AV_OPT_TYPE_STRING,
-    AV_OPT_TYPE_RATIONAL,
-    AV_OPT_TYPE_BINARY,  ///< offset must point to a pointer immediately followed by an int for the length
-    AV_OPT_TYPE_CONST = 128,
-};
-
-/**
- * AVOption
- */
-typedef struct AVOption {
-    const char *name;
-
-    /**
-     * short English help text
-     * @todo What about other languages?
-     */
-    const char *help;
-
-    /**
-     * The offset relative to the context structure where the option
-     * value is stored. It should be 0 for named constants.
-     */
-    int offset;
-    enum AVOptionType type;
-
-    /**
-     * the default value for scalar options
-     */
-    union {
-        int64_t i64;
-        double dbl;
-        const char *str;
-        /* TODO those are unused now */
-        AVRational q;
-    } default_val;
-    double min;                 ///< minimum valid value for the option
-    double max;                 ///< maximum valid value for the option
-
-    int flags;
-#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
-#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
-#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
-#define AV_OPT_FLAG_AUDIO_PARAM     8
-#define AV_OPT_FLAG_VIDEO_PARAM     16
-#define AV_OPT_FLAG_SUBTITLE_PARAM  32
-//FIXME think about enc-audio, ... style flags
-
-    /**
-     * The logical unit to which the option belongs. Non-constant
-     * options and corresponding named constants share the same
-     * unit. May be NULL.
-     */
-    const char *unit;
-} AVOption;
-
-/**
- * Show the obj options.
- *
- * @param req_flags requested flags for the options to show. Show only the
- * options for which it is opt->flags & req_flags.
- * @param rej_flags rejected flags for the options to show. Show only the
- * options for which it is !(opt->flags & req_flags).
- * @param av_log_obj log context to use for showing the options
- */
-int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
-
-/**
- * Set the values of all AVOption fields to their default values.
- *
- * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass)
- */
-void av_opt_set_defaults(void *s);
-
-/**
- * Parse the key/value pairs list in opts. For each key/value pair
- * found, stores the value in the field in ctx that is named like the
- * key. ctx must be an AVClass context, storing is done using
- * AVOptions.
- *
- * @param key_val_sep a 0-terminated list of characters used to
- * separate key from value
- * @param pairs_sep a 0-terminated list of characters used to separate
- * two pairs from each other
- * @return the number of successfully set key/value pairs, or a negative
- * value corresponding to an AVERROR code in case of error:
- * AVERROR(EINVAL) if opts cannot be parsed,
- * the error code issued by av_set_string3() if a key/value pair
- * cannot be set
- */
-int av_set_options_string(void *ctx, const char *opts,
-                          const char *key_val_sep, const char *pairs_sep);
-
-/**
- * Free all string and binary options in obj.
- */
-void av_opt_free(void *obj);
-
-/**
- * Check whether a particular flag is set in a flags field.
- *
- * @param field_name the name of the flag field option
- * @param flag_name the name of the flag to check
- * @return non-zero if the flag is set, zero if the flag isn't set,
- *         isn't of the right type, or the flags field doesn't exist.
- */
-int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
-
-/*
- * Set all the options from a given dictionary on an object.
- *
- * @param obj a struct whose first element is a pointer to AVClass
- * @param options options to process. This dictionary will be freed and replaced
- *                by a new one containing all options not found in obj.
- *                Of course this new dictionary needs to be freed by caller
- *                with av_dict_free().
- *
- * @return 0 on success, a negative AVERROR if some option was found in obj,
- *         but could not be set.
- *
- * @see av_dict_copy()
- */
-int av_opt_set_dict(void *obj, struct AVDictionary **options);
-
-/**
- * @defgroup opt_eval_funcs Evaluating option strings
- * @{
- * This group of functions can be used to evaluate option strings
- * and get numbers out of them. They do the same thing as av_opt_set(),
- * except the result is written into the caller-supplied pointer.
- *
- * @param obj a struct whose first element is a pointer to AVClass.
- * @param o an option for which the string is to be evaluated.
- * @param val string to be evaluated.
- * @param *_out value of the string will be written here.
- *
- * @return 0 on success, a negative number on failure.
- */
-int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int        *flags_out);
-int av_opt_eval_int   (void *obj, const AVOption *o, const char *val, int        *int_out);
-int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t    *int64_out);
-int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float      *float_out);
-int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double     *double_out);
-int av_opt_eval_q     (void *obj, const AVOption *o, const char *val, AVRational *q_out);
-/**
- * @}
- */
-
-#define AV_OPT_SEARCH_CHILDREN   0x0001 /**< Search in possible children of the
-                                             given object first. */
-/**
- *  The obj passed to av_opt_find() is fake -- only a double pointer to AVClass
- *  instead of a required pointer to a struct containing AVClass. This is
- *  useful for searching for options without needing to allocate the corresponding
- *  object.
- */
-#define AV_OPT_SEARCH_FAKE_OBJ   0x0002
-
-/**
- * Look for an option in an object. Consider only options which
- * have all the specified flags set.
- *
- * @param[in] obj A pointer to a struct whose first element is a
- *                pointer to an AVClass.
- *                Alternatively a double pointer to an AVClass, if
- *                AV_OPT_SEARCH_FAKE_OBJ search flag is set.
- * @param[in] name The name of the option to look for.
- * @param[in] unit When searching for named constants, name of the unit
- *                 it belongs to.
- * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
- * @param search_flags A combination of AV_OPT_SEARCH_*.
- *
- * @return A pointer to the option found, or NULL if no option
- *         was found.
- *
- * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable
- * directly with av_set_string3(). Use special calls which take an options
- * AVDictionary (e.g. avformat_open_input()) to set options found with this
- * flag.
- */
-const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
-                            int opt_flags, int search_flags);
-
-/**
- * Look for an option in an object. Consider only options which
- * have all the specified flags set.
- *
- * @param[in] obj A pointer to a struct whose first element is a
- *                pointer to an AVClass.
- *                Alternatively a double pointer to an AVClass, if
- *                AV_OPT_SEARCH_FAKE_OBJ search flag is set.
- * @param[in] name The name of the option to look for.
- * @param[in] unit When searching for named constants, name of the unit
- *                 it belongs to.
- * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
- * @param search_flags A combination of AV_OPT_SEARCH_*.
- * @param[out] target_obj if non-NULL, an object to which the option belongs will be
- * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present
- * in search_flags. This parameter is ignored if search_flags contain
- * AV_OPT_SEARCH_FAKE_OBJ.
- *
- * @return A pointer to the option found, or NULL if no option
- *         was found.
- */
-const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
-                             int opt_flags, int search_flags, void **target_obj);
-
-/**
- * Iterate over all AVOptions belonging to obj.
- *
- * @param obj an AVOptions-enabled struct or a double pointer to an
- *            AVClass describing it.
- * @param prev result of the previous call to av_opt_next() on this object
- *             or NULL
- * @return next AVOption or NULL
- */
-const AVOption *av_opt_next(void *obj, const AVOption *prev);
-
-/**
- * Iterate over AVOptions-enabled children of obj.
- *
- * @param prev result of a previous call to this function or NULL
- * @return next AVOptions-enabled child or NULL
- */
-void *av_opt_child_next(void *obj, void *prev);
-
-/**
- * Iterate over potential AVOptions-enabled children of parent.
- *
- * @param prev result of a previous call to this function or NULL
- * @return AVClass corresponding to next potential child or NULL
- */
-const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
-
-/**
- * @defgroup opt_set_funcs Option setting functions
- * @{
- * Those functions set the field of obj with the given name to value.
- *
- * @param[in] obj A struct whose first element is a pointer to an AVClass.
- * @param[in] name the name of the field to set
- * @param[in] val The value to set. In case of av_opt_set() if the field is not
- * of a string type, then the given string is parsed.
- * SI postfixes and some named scalars are supported.
- * If the field is of a numeric type, it has to be a numeric or named
- * scalar. Behavior with more than one scalar and +- infix operators
- * is undefined.
- * If the field is of a flags type, it has to be a sequence of numeric
- * scalars or named flags separated by '+' or '-'. Prefixing a flag
- * with '+' causes it to be set without affecting the other flags;
- * similarly, '-' unsets a flag.
- * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
- * is passed here, then the option may be set on a child of obj.
- *
- * @return 0 if the value has been set, or an AVERROR code in case of
- * error:
- * AVERROR_OPTION_NOT_FOUND if no matching option exists
- * AVERROR(ERANGE) if the value is out of range
- * AVERROR(EINVAL) if the value is not valid
- */
-int av_opt_set       (void *obj, const char *name, const char *val, int search_flags);
-int av_opt_set_int   (void *obj, const char *name, int64_t     val, int search_flags);
-int av_opt_set_double(void *obj, const char *name, double      val, int search_flags);
-int av_opt_set_q     (void *obj, const char *name, AVRational  val, int search_flags);
-int av_opt_set_bin   (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
-/**
- * @}
- */
-
-/**
- * @defgroup opt_get_funcs Option getting functions
- * @{
- * Those functions get a value of the option with the given name from an object.
- *
- * @param[in] obj a struct whose first element is a pointer to an AVClass.
- * @param[in] name name of the option to get.
- * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
- * is passed here, then the option may be found in a child of obj.
- * @param[out] out_val value of the option will be written here
- * @return 0 on success, a negative error code otherwise
- */
-/**
- * @note the returned string will av_malloc()ed and must be av_free()ed by the caller
- */
-int av_opt_get       (void *obj, const char *name, int search_flags, uint8_t   **out_val);
-int av_opt_get_int   (void *obj, const char *name, int search_flags, int64_t    *out_val);
-int av_opt_get_double(void *obj, const char *name, int search_flags, double     *out_val);
-int av_opt_get_q     (void *obj, const char *name, int search_flags, AVRational *out_val);
-/**
- * @}
- * @}
- */
-
-#endif /* AVUTIL_OPT_H */
diff --git a/deps/libav/libavutil/parseutils.c b/deps/libav/libavutil/parseutils.c
deleted file mode 100644
index 414cd47..0000000
--- a/deps/libav/libavutil/parseutils.c
+++ /dev/null
@@ -1,742 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * misc parsing utilities
- */
-
-#include <time.h>
-
-#include "avstring.h"
-#include "avutil.h"
-#include "common.h"
-#include "eval.h"
-#include "log.h"
-#include "random_seed.h"
-#include "parseutils.h"
-
-typedef struct {
-    const char *abbr;
-    int width, height;
-} VideoSizeAbbr;
-
-typedef struct {
-    const char *abbr;
-    AVRational rate;
-} VideoRateAbbr;
-
-static const VideoSizeAbbr video_size_abbrs[] = {
-    { "ntsc",      720, 480 },
-    { "pal",       720, 576 },
-    { "qntsc",     352, 240 }, /* VCD compliant NTSC */
-    { "qpal",      352, 288 }, /* VCD compliant PAL */
-    { "sntsc",     640, 480 }, /* square pixel NTSC */
-    { "spal",      768, 576 }, /* square pixel PAL */
-    { "film",      352, 240 },
-    { "ntsc-film", 352, 240 },
-    { "sqcif",     128,  96 },
-    { "qcif",      176, 144 },
-    { "cif",       352, 288 },
-    { "4cif",      704, 576 },
-    { "16cif",    1408,1152 },
-    { "qqvga",     160, 120 },
-    { "qvga",      320, 240 },
-    { "vga",       640, 480 },
-    { "svga",      800, 600 },
-    { "xga",      1024, 768 },
-    { "uxga",     1600,1200 },
-    { "qxga",     2048,1536 },
-    { "sxga",     1280,1024 },
-    { "qsxga",    2560,2048 },
-    { "hsxga",    5120,4096 },
-    { "wvga",      852, 480 },
-    { "wxga",     1366, 768 },
-    { "wsxga",    1600,1024 },
-    { "wuxga",    1920,1200 },
-    { "woxga",    2560,1600 },
-    { "wqsxga",   3200,2048 },
-    { "wquxga",   3840,2400 },
-    { "whsxga",   6400,4096 },
-    { "whuxga",   7680,4800 },
-    { "cga",       320, 200 },
-    { "ega",       640, 350 },
-    { "hd480",     852, 480 },
-    { "hd720",    1280, 720 },
-    { "hd1080",   1920,1080 },
-};
-
-static const VideoRateAbbr video_rate_abbrs[]= {
-    { "ntsc",      { 30000, 1001 } },
-    { "pal",       {    25,    1 } },
-    { "qntsc",     { 30000, 1001 } }, /* VCD compliant NTSC */
-    { "qpal",      {    25,    1 } }, /* VCD compliant PAL */
-    { "sntsc",     { 30000, 1001 } }, /* square pixel NTSC */
-    { "spal",      {    25,    1 } }, /* square pixel PAL */
-    { "film",      {    24,    1 } },
-    { "ntsc-film", { 24000, 1001 } },
-};
-
-int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
-{
-    int i;
-    int n = FF_ARRAY_ELEMS(video_size_abbrs);
-    char *p;
-    int width = 0, height = 0;
-
-    for (i = 0; i < n; i++) {
-        if (!strcmp(video_size_abbrs[i].abbr, str)) {
-            width  = video_size_abbrs[i].width;
-            height = video_size_abbrs[i].height;
-            break;
-        }
-    }
-    if (i == n) {
-        width = strtol(str, &p, 10);
-        if (*p)
-            p++;
-        height = strtol(p, &p, 10);
-    }
-    if (width <= 0 || height <= 0)
-        return AVERROR(EINVAL);
-    *width_ptr  = width;
-    *height_ptr = height;
-    return 0;
-}
-
-int av_parse_video_rate(AVRational *rate, const char *arg)
-{
-    int i, ret;
-    int n = FF_ARRAY_ELEMS(video_rate_abbrs);
-    double res;
-
-    /* First, we check our abbreviation table */
-    for (i = 0; i < n; ++i)
-        if (!strcmp(video_rate_abbrs[i].abbr, arg)) {
-            *rate = video_rate_abbrs[i].rate;
-            return 0;
-        }
-
-    /* Then, we try to parse it as fraction */
-    if ((ret = av_expr_parse_and_eval(&res, arg, NULL, NULL, NULL, NULL, NULL, NULL,
-                                      NULL, 0, NULL)) < 0)
-        return ret;
-    *rate = av_d2q(res, 1001000);
-    if (rate->num <= 0 || rate->den <= 0)
-        return AVERROR(EINVAL);
-    return 0;
-}
-
-typedef struct {
-    const char *name;            ///< a string representing the name of the color
-    uint8_t     rgb_color[3];    ///< RGB values for the color
-} ColorEntry;
-
-static ColorEntry color_table[] = {
-    { "AliceBlue",            { 0xF0, 0xF8, 0xFF } },
-    { "AntiqueWhite",         { 0xFA, 0xEB, 0xD7 } },
-    { "Aqua",                 { 0x00, 0xFF, 0xFF } },
-    { "Aquamarine",           { 0x7F, 0xFF, 0xD4 } },
-    { "Azure",                { 0xF0, 0xFF, 0xFF } },
-    { "Beige",                { 0xF5, 0xF5, 0xDC } },
-    { "Bisque",               { 0xFF, 0xE4, 0xC4 } },
-    { "Black",                { 0x00, 0x00, 0x00 } },
-    { "BlanchedAlmond",       { 0xFF, 0xEB, 0xCD } },
-    { "Blue",                 { 0x00, 0x00, 0xFF } },
-    { "BlueViolet",           { 0x8A, 0x2B, 0xE2 } },
-    { "Brown",                { 0xA5, 0x2A, 0x2A } },
-    { "BurlyWood",            { 0xDE, 0xB8, 0x87 } },
-    { "CadetBlue",            { 0x5F, 0x9E, 0xA0 } },
-    { "Chartreuse",           { 0x7F, 0xFF, 0x00 } },
-    { "Chocolate",            { 0xD2, 0x69, 0x1E } },
-    { "Coral",                { 0xFF, 0x7F, 0x50 } },
-    { "CornflowerBlue",       { 0x64, 0x95, 0xED } },
-    { "Cornsilk",             { 0xFF, 0xF8, 0xDC } },
-    { "Crimson",              { 0xDC, 0x14, 0x3C } },
-    { "Cyan",                 { 0x00, 0xFF, 0xFF } },
-    { "DarkBlue",             { 0x00, 0x00, 0x8B } },
-    { "DarkCyan",             { 0x00, 0x8B, 0x8B } },
-    { "DarkGoldenRod",        { 0xB8, 0x86, 0x0B } },
-    { "DarkGray",             { 0xA9, 0xA9, 0xA9 } },
-    { "DarkGreen",            { 0x00, 0x64, 0x00 } },
-    { "DarkKhaki",            { 0xBD, 0xB7, 0x6B } },
-    { "DarkMagenta",          { 0x8B, 0x00, 0x8B } },
-    { "DarkOliveGreen",       { 0x55, 0x6B, 0x2F } },
-    { "Darkorange",           { 0xFF, 0x8C, 0x00 } },
-    { "DarkOrchid",           { 0x99, 0x32, 0xCC } },
-    { "DarkRed",              { 0x8B, 0x00, 0x00 } },
-    { "DarkSalmon",           { 0xE9, 0x96, 0x7A } },
-    { "DarkSeaGreen",         { 0x8F, 0xBC, 0x8F } },
-    { "DarkSlateBlue",        { 0x48, 0x3D, 0x8B } },
-    { "DarkSlateGray",        { 0x2F, 0x4F, 0x4F } },
-    { "DarkTurquoise",        { 0x00, 0xCE, 0xD1 } },
-    { "DarkViolet",           { 0x94, 0x00, 0xD3 } },
-    { "DeepPink",             { 0xFF, 0x14, 0x93 } },
-    { "DeepSkyBlue",          { 0x00, 0xBF, 0xFF } },
-    { "DimGray",              { 0x69, 0x69, 0x69 } },
-    { "DodgerBlue",           { 0x1E, 0x90, 0xFF } },
-    { "FireBrick",            { 0xB2, 0x22, 0x22 } },
-    { "FloralWhite",          { 0xFF, 0xFA, 0xF0 } },
-    { "ForestGreen",          { 0x22, 0x8B, 0x22 } },
-    { "Fuchsia",              { 0xFF, 0x00, 0xFF } },
-    { "Gainsboro",            { 0xDC, 0xDC, 0xDC } },
-    { "GhostWhite",           { 0xF8, 0xF8, 0xFF } },
-    { "Gold",                 { 0xFF, 0xD7, 0x00 } },
-    { "GoldenRod",            { 0xDA, 0xA5, 0x20 } },
-    { "Gray",                 { 0x80, 0x80, 0x80 } },
-    { "Green",                { 0x00, 0x80, 0x00 } },
-    { "GreenYellow",          { 0xAD, 0xFF, 0x2F } },
-    { "HoneyDew",             { 0xF0, 0xFF, 0xF0 } },
-    { "HotPink",              { 0xFF, 0x69, 0xB4 } },
-    { "IndianRed",            { 0xCD, 0x5C, 0x5C } },
-    { "Indigo",               { 0x4B, 0x00, 0x82 } },
-    { "Ivory",                { 0xFF, 0xFF, 0xF0 } },
-    { "Khaki",                { 0xF0, 0xE6, 0x8C } },
-    { "Lavender",             { 0xE6, 0xE6, 0xFA } },
-    { "LavenderBlush",        { 0xFF, 0xF0, 0xF5 } },
-    { "LawnGreen",            { 0x7C, 0xFC, 0x00 } },
-    { "LemonChiffon",         { 0xFF, 0xFA, 0xCD } },
-    { "LightBlue",            { 0xAD, 0xD8, 0xE6 } },
-    { "LightCoral",           { 0xF0, 0x80, 0x80 } },
-    { "LightCyan",            { 0xE0, 0xFF, 0xFF } },
-    { "LightGoldenRodYellow", { 0xFA, 0xFA, 0xD2 } },
-    { "LightGrey",            { 0xD3, 0xD3, 0xD3 } },
-    { "LightGreen",           { 0x90, 0xEE, 0x90 } },
-    { "LightPink",            { 0xFF, 0xB6, 0xC1 } },
-    { "LightSalmon",          { 0xFF, 0xA0, 0x7A } },
-    { "LightSeaGreen",        { 0x20, 0xB2, 0xAA } },
-    { "LightSkyBlue",         { 0x87, 0xCE, 0xFA } },
-    { "LightSlateGray",       { 0x77, 0x88, 0x99 } },
-    { "LightSteelBlue",       { 0xB0, 0xC4, 0xDE } },
-    { "LightYellow",          { 0xFF, 0xFF, 0xE0 } },
-    { "Lime",                 { 0x00, 0xFF, 0x00 } },
-    { "LimeGreen",            { 0x32, 0xCD, 0x32 } },
-    { "Linen",                { 0xFA, 0xF0, 0xE6 } },
-    { "Magenta",              { 0xFF, 0x00, 0xFF } },
-    { "Maroon",               { 0x80, 0x00, 0x00 } },
-    { "MediumAquaMarine",     { 0x66, 0xCD, 0xAA } },
-    { "MediumBlue",           { 0x00, 0x00, 0xCD } },
-    { "MediumOrchid",         { 0xBA, 0x55, 0xD3 } },
-    { "MediumPurple",         { 0x93, 0x70, 0xD8 } },
-    { "MediumSeaGreen",       { 0x3C, 0xB3, 0x71 } },
-    { "MediumSlateBlue",      { 0x7B, 0x68, 0xEE } },
-    { "MediumSpringGreen",    { 0x00, 0xFA, 0x9A } },
-    { "MediumTurquoise",      { 0x48, 0xD1, 0xCC } },
-    { "MediumVioletRed",      { 0xC7, 0x15, 0x85 } },
-    { "MidnightBlue",         { 0x19, 0x19, 0x70 } },
-    { "MintCream",            { 0xF5, 0xFF, 0xFA } },
-    { "MistyRose",            { 0xFF, 0xE4, 0xE1 } },
-    { "Moccasin",             { 0xFF, 0xE4, 0xB5 } },
-    { "NavajoWhite",          { 0xFF, 0xDE, 0xAD } },
-    { "Navy",                 { 0x00, 0x00, 0x80 } },
-    { "OldLace",              { 0xFD, 0xF5, 0xE6 } },
-    { "Olive",                { 0x80, 0x80, 0x00 } },
-    { "OliveDrab",            { 0x6B, 0x8E, 0x23 } },
-    { "Orange",               { 0xFF, 0xA5, 0x00 } },
-    { "OrangeRed",            { 0xFF, 0x45, 0x00 } },
-    { "Orchid",               { 0xDA, 0x70, 0xD6 } },
-    { "PaleGoldenRod",        { 0xEE, 0xE8, 0xAA } },
-    { "PaleGreen",            { 0x98, 0xFB, 0x98 } },
-    { "PaleTurquoise",        { 0xAF, 0xEE, 0xEE } },
-    { "PaleVioletRed",        { 0xD8, 0x70, 0x93 } },
-    { "PapayaWhip",           { 0xFF, 0xEF, 0xD5 } },
-    { "PeachPuff",            { 0xFF, 0xDA, 0xB9 } },
-    { "Peru",                 { 0xCD, 0x85, 0x3F } },
-    { "Pink",                 { 0xFF, 0xC0, 0xCB } },
-    { "Plum",                 { 0xDD, 0xA0, 0xDD } },
-    { "PowderBlue",           { 0xB0, 0xE0, 0xE6 } },
-    { "Purple",               { 0x80, 0x00, 0x80 } },
-    { "Red",                  { 0xFF, 0x00, 0x00 } },
-    { "RosyBrown",            { 0xBC, 0x8F, 0x8F } },
-    { "RoyalBlue",            { 0x41, 0x69, 0xE1 } },
-    { "SaddleBrown",          { 0x8B, 0x45, 0x13 } },
-    { "Salmon",               { 0xFA, 0x80, 0x72 } },
-    { "SandyBrown",           { 0xF4, 0xA4, 0x60 } },
-    { "SeaGreen",             { 0x2E, 0x8B, 0x57 } },
-    { "SeaShell",             { 0xFF, 0xF5, 0xEE } },
-    { "Sienna",               { 0xA0, 0x52, 0x2D } },
-    { "Silver",               { 0xC0, 0xC0, 0xC0 } },
-    { "SkyBlue",              { 0x87, 0xCE, 0xEB } },
-    { "SlateBlue",            { 0x6A, 0x5A, 0xCD } },
-    { "SlateGray",            { 0x70, 0x80, 0x90 } },
-    { "Snow",                 { 0xFF, 0xFA, 0xFA } },
-    { "SpringGreen",          { 0x00, 0xFF, 0x7F } },
-    { "SteelBlue",            { 0x46, 0x82, 0xB4 } },
-    { "Tan",                  { 0xD2, 0xB4, 0x8C } },
-    { "Teal",                 { 0x00, 0x80, 0x80 } },
-    { "Thistle",              { 0xD8, 0xBF, 0xD8 } },
-    { "Tomato",               { 0xFF, 0x63, 0x47 } },
-    { "Turquoise",            { 0x40, 0xE0, 0xD0 } },
-    { "Violet",               { 0xEE, 0x82, 0xEE } },
-    { "Wheat",                { 0xF5, 0xDE, 0xB3 } },
-    { "White",                { 0xFF, 0xFF, 0xFF } },
-    { "WhiteSmoke",           { 0xF5, 0xF5, 0xF5 } },
-    { "Yellow",               { 0xFF, 0xFF, 0x00 } },
-    { "YellowGreen",          { 0x9A, 0xCD, 0x32 } },
-};
-
-static int color_table_compare(const void *lhs, const void *rhs)
-{
-    return av_strcasecmp(lhs, ((const ColorEntry *)rhs)->name);
-}
-
-#define ALPHA_SEP '@'
-
-int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
-                   void *log_ctx)
-{
-    char *tail, color_string2[128];
-    const ColorEntry *entry;
-    int len, hex_offset = 0;
-
-    if (color_string[0] == '#') {
-        hex_offset = 1;
-    } else if (!strncmp(color_string, "0x", 2))
-        hex_offset = 2;
-
-    if (slen < 0)
-        slen = strlen(color_string);
-    av_strlcpy(color_string2, color_string + hex_offset,
-               FFMIN(slen-hex_offset+1, sizeof(color_string2)));
-    if ((tail = strchr(color_string2, ALPHA_SEP)))
-        *tail++ = 0;
-    len = strlen(color_string2);
-    rgba_color[3] = 255;
-
-    if (!av_strcasecmp(color_string2, "random") || !av_strcasecmp(color_string2, "bikeshed")) {
-        int rgba = av_get_random_seed();
-        rgba_color[0] = rgba >> 24;
-        rgba_color[1] = rgba >> 16;
-        rgba_color[2] = rgba >> 8;
-        rgba_color[3] = rgba;
-    } else if (hex_offset ||
-               strspn(color_string2, "0123456789ABCDEFabcdef") == len) {
-        char *tail;
-        unsigned int rgba = strtoul(color_string2, &tail, 16);
-
-        if (*tail || (len != 6 && len != 8)) {
-            av_log(log_ctx, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", color_string2);
-            return AVERROR(EINVAL);
-        }
-        if (len == 8) {
-            rgba_color[3] = rgba;
-            rgba >>= 8;
-        }
-        rgba_color[0] = rgba >> 16;
-        rgba_color[1] = rgba >> 8;
-        rgba_color[2] = rgba;
-    } else {
-        entry = bsearch(color_string2,
-                        color_table,
-                        FF_ARRAY_ELEMS(color_table),
-                        sizeof(ColorEntry),
-                        color_table_compare);
-        if (!entry) {
-            av_log(log_ctx, AV_LOG_ERROR, "Cannot find color '%s'\n", color_string2);
-            return AVERROR(EINVAL);
-        }
-        memcpy(rgba_color, entry->rgb_color, 3);
-    }
-
-    if (tail) {
-        double alpha;
-        const char *alpha_string = tail;
-        if (!strncmp(alpha_string, "0x", 2)) {
-            alpha = strtoul(alpha_string, &tail, 16);
-        } else {
-            alpha = 255 * strtod(alpha_string, &tail);
-        }
-
-        if (tail == alpha_string || *tail || alpha > 255 || alpha < 0) {
-            av_log(log_ctx, AV_LOG_ERROR, "Invalid alpha value specifier '%s' in '%s'\n",
-                   alpha_string, color_string);
-            return AVERROR(EINVAL);
-        }
-        rgba_color[3] = alpha;
-    }
-
-    return 0;
-}
-
-/* get a positive number between n_min and n_max, for a maximum length
-   of len_max. Return -1 if error. */
-static int date_get_num(const char **pp,
-                        int n_min, int n_max, int len_max)
-{
-    int i, val, c;
-    const char *p;
-
-    p = *pp;
-    val = 0;
-    for(i = 0; i < len_max; i++) {
-        c = *p;
-        if (!av_isdigit(c))
-            break;
-        val = (val * 10) + c - '0';
-        p++;
-    }
-    /* no number read ? */
-    if (p == *pp)
-        return -1;
-    if (val < n_min || val > n_max)
-        return -1;
-    *pp = p;
-    return val;
-}
-
-static const char *small_strptime(const char *p, const char *fmt, struct tm *dt)
-{
-    int c, val;
-
-    for(;;) {
-        c = *fmt++;
-        if (c == '\0') {
-            return p;
-        } else if (c == '%') {
-            c = *fmt++;
-            switch(c) {
-            case 'H':
-                val = date_get_num(&p, 0, 23, 2);
-                if (val == -1)
-                    return NULL;
-                dt->tm_hour = val;
-                break;
-            case 'M':
-                val = date_get_num(&p, 0, 59, 2);
-                if (val == -1)
-                    return NULL;
-                dt->tm_min = val;
-                break;
-            case 'S':
-                val = date_get_num(&p, 0, 59, 2);
-                if (val == -1)
-                    return NULL;
-                dt->tm_sec = val;
-                break;
-            case 'Y':
-                val = date_get_num(&p, 0, 9999, 4);
-                if (val == -1)
-                    return NULL;
-                dt->tm_year = val - 1900;
-                break;
-            case 'm':
-                val = date_get_num(&p, 1, 12, 2);
-                if (val == -1)
-                    return NULL;
-                dt->tm_mon = val - 1;
-                break;
-            case 'd':
-                val = date_get_num(&p, 1, 31, 2);
-                if (val == -1)
-                    return NULL;
-                dt->tm_mday = val;
-                break;
-            case '%':
-                goto match;
-            default:
-                return NULL;
-            }
-        } else {
-        match:
-            if (c != *p)
-                return NULL;
-            p++;
-        }
-    }
-}
-
-time_t av_timegm(struct tm *tm)
-{
-    time_t t;
-
-    int y = tm->tm_year + 1900, m = tm->tm_mon + 1, d = tm->tm_mday;
-
-    if (m < 3) {
-        m += 12;
-        y--;
-    }
-
-    t = 86400 *
-        (d + (153 * m - 457) / 5 + 365 * y + y / 4 - y / 100 + y / 400 - 719469);
-
-    t += 3600 * tm->tm_hour + 60 * tm->tm_min + tm->tm_sec;
-
-    return t;
-}
-
-int av_parse_time(int64_t *timeval, const char *timestr, int duration)
-{
-    const char *p;
-    int64_t t;
-    struct tm dt = { 0 };
-    int i;
-    static const char * const date_fmt[] = {
-        "%Y-%m-%d",
-        "%Y%m%d",
-    };
-    static const char * const time_fmt[] = {
-        "%H:%M:%S",
-        "%H%M%S",
-    };
-    const char *q;
-    int is_utc, len;
-    char lastch;
-    int negative = 0;
-
-    time_t now = time(0);
-
-    len = strlen(timestr);
-    if (len > 0)
-        lastch = timestr[len - 1];
-    else
-        lastch = '\0';
-    is_utc = (lastch == 'z' || lastch == 'Z');
-
-    p = timestr;
-    q = NULL;
-    if (!duration) {
-        if (!av_strncasecmp(timestr, "now", len)) {
-            *timeval = (int64_t) now * 1000000;
-            return 0;
-        }
-
-        /* parse the year-month-day part */
-        for (i = 0; i < FF_ARRAY_ELEMS(date_fmt); i++) {
-            q = small_strptime(p, date_fmt[i], &dt);
-            if (q) {
-                break;
-            }
-        }
-
-        /* if the year-month-day part is missing, then take the
-         * current year-month-day time */
-        if (!q) {
-            if (is_utc) {
-                dt = *gmtime(&now);
-            } else {
-                dt = *localtime(&now);
-            }
-            dt.tm_hour = dt.tm_min = dt.tm_sec = 0;
-        } else {
-            p = q;
-        }
-
-        if (*p == 'T' || *p == 't' || *p == ' ')
-            p++;
-
-        /* parse the hour-minute-second part */
-        for (i = 0; i < FF_ARRAY_ELEMS(time_fmt); i++) {
-            q = small_strptime(p, time_fmt[i], &dt);
-            if (q) {
-                break;
-            }
-        }
-    } else {
-        /* parse timestr as a duration */
-        if (p[0] == '-') {
-            negative = 1;
-            ++p;
-        }
-        /* parse timestr as HH:MM:SS */
-        q = small_strptime(p, time_fmt[0], &dt);
-        if (!q) {
-            char *o;
-            /* parse timestr as S+ */
-            dt.tm_sec = strtol(p, &o, 10);
-            if (o == p) {
-                /* the parsing didn't succeed */
-                *timeval = INT64_MIN;
-                return AVERROR(EINVAL);
-            }
-            dt.tm_min = 0;
-            dt.tm_hour = 0;
-            q = o;
-        }
-    }
-
-    /* Now we have all the fields that we can get */
-    if (!q) {
-        *timeval = INT64_MIN;
-        return AVERROR(EINVAL);
-    }
-
-    if (duration) {
-        t = dt.tm_hour * 3600 + dt.tm_min * 60 + dt.tm_sec;
-    } else {
-        dt.tm_isdst = -1;       /* unknown */
-        if (is_utc) {
-            t = av_timegm(&dt);
-        } else {
-            t = mktime(&dt);
-        }
-    }
-
-    t *= 1000000;
-
-    /* parse the .m... part */
-    if (*q == '.') {
-        int val, n;
-        q++;
-        for (val = 0, n = 100000; n >= 1; n /= 10, q++) {
-            if (!av_isdigit(*q))
-                break;
-            val += n * (*q - '0');
-        }
-        t += val;
-    }
-    *timeval = negative ? -t : t;
-    return 0;
-}
-
-int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info)
-{
-    const char *p;
-    char tag[128], *q;
-
-    p = info;
-    if (*p == '?')
-        p++;
-    for(;;) {
-        q = tag;
-        while (*p != '\0' && *p != '=' && *p != '&') {
-            if ((q - tag) < sizeof(tag) - 1)
-                *q++ = *p;
-            p++;
-        }
-        *q = '\0';
-        q = arg;
-        if (*p == '=') {
-            p++;
-            while (*p != '&' && *p != '\0') {
-                if ((q - arg) < arg_size - 1) {
-                    if (*p == '+')
-                        *q++ = ' ';
-                    else
-                        *q++ = *p;
-                }
-                p++;
-            }
-        }
-        *q = '\0';
-        if (!strcmp(tag, tag1))
-            return 1;
-        if (*p != '&')
-            break;
-        p++;
-    }
-    return 0;
-}
-
-#ifdef TEST
-
-int main(void)
-{
-    printf("Testing av_parse_video_rate()\n");
-    {
-        int i;
-        static const char *const rates[] = {
-            "-inf",
-            "inf",
-            "nan",
-            "123/0",
-            "-123 / 0",
-            "",
-            "/",
-            " 123  /  321",
-            "foo/foo",
-            "foo/1",
-            "1/foo",
-            "0/0",
-            "/0",
-            "1/",
-            "1",
-            "0",
-            "-123/123",
-            "-foo",
-            "123.23",
-            ".23",
-            "-.23",
-            "-0.234",
-            "-0.0000001",
-            "  21332.2324   ",
-            " -21332.2324   ",
-        };
-
-        for (i = 0; i < FF_ARRAY_ELEMS(rates); i++) {
-            int ret;
-            AVRational q = { 0, 0 };
-            ret = av_parse_video_rate(&q, rates[i]);
-            printf("'%s' -> %d/%d %s\n",
-                   rates[i], q.num, q.den, ret ? "ERROR" : "OK");
-        }
-    }
-
-    printf("\nTesting av_parse_color()\n");
-    {
-        int i;
-        uint8_t rgba[4];
-        static const char *const color_names[] = {
-            "foo",
-            "red",
-            "Red ",
-            "RED",
-            "Violet",
-            "Yellow",
-            "Red",
-            "0x000000",
-            "0x0000000",
-            "0xff000000",
-            "0x3e34ff",
-            "0x3e34ffaa",
-            "0xffXXee",
-            "0xfoobar",
-            "0xffffeeeeeeee",
-            "#ff0000",
-            "#ffXX00",
-            "ff0000",
-            "ffXX00",
-            "red at foo",
-            "random at 10",
-            "0xff0000 at 1.0",
-            "red@",
-            "red at 0xfff",
-            "red at 0xf",
-            "red at 2",
-            "red at 0.1",
-            "red at -1",
-            "red at 0.5",
-            "red at 1.0",
-            "red at 256",
-            "red at 10foo",
-            "red at -1.0",
-            "red at -0.0",
-        };
-
-        av_log_set_level(AV_LOG_DEBUG);
-
-        for (i = 0;  i < FF_ARRAY_ELEMS(color_names); i++) {
-            if (av_parse_color(rgba, color_names[i], -1, NULL) >= 0)
-                printf("%s -> R(%d) G(%d) B(%d) A(%d)\n",
-                       color_names[i], rgba[0], rgba[1], rgba[2], rgba[3]);
-        }
-    }
-
-    return 0;
-}
-
-#endif /* TEST */
diff --git a/deps/libav/libavutil/parseutils.h b/deps/libav/libavutil/parseutils.h
deleted file mode 100644
index 0844abb..0000000
--- a/deps/libav/libavutil/parseutils.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PARSEUTILS_H
-#define AVUTIL_PARSEUTILS_H
-
-#include <time.h>
-
-#include "rational.h"
-
-/**
- * @file
- * misc parsing utilities
- */
-
-/**
- * Parse str and put in width_ptr and height_ptr the detected values.
- *
- * @param[in,out] width_ptr pointer to the variable which will contain the detected
- * width value
- * @param[in,out] height_ptr pointer to the variable which will contain the detected
- * height value
- * @param[in] str the string to parse: it has to be a string in the format
- * width x height or a valid video size abbreviation.
- * @return >= 0 on success, a negative error code otherwise
- */
-int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str);
-
-/**
- * Parse str and store the detected values in *rate.
- *
- * @param[in,out] rate pointer to the AVRational which will contain the detected
- * frame rate
- * @param[in] str the string to parse: it has to be a string in the format
- * rate_num / rate_den, a float number or a valid video rate abbreviation
- * @return >= 0 on success, a negative error code otherwise
- */
-int av_parse_video_rate(AVRational *rate, const char *str);
-
-/**
- * Put the RGBA values that correspond to color_string in rgba_color.
- *
- * @param color_string a string specifying a color. It can be the name of
- * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence,
- * possibly followed by "@" and a string representing the alpha
- * component.
- * The alpha component may be a string composed by "0x" followed by an
- * hexadecimal number or a decimal number between 0.0 and 1.0, which
- * represents the opacity value (0x00/0.0 means completely transparent,
- * 0xff/1.0 completely opaque).
- * If the alpha component is not specified then 0xff is assumed.
- * The string "random" will result in a random color.
- * @param slen length of the initial part of color_string containing the
- * color. It can be set to -1 if color_string is a null terminated string
- * containing nothing else than the color.
- * @return >= 0 in case of success, a negative value in case of
- * failure (for example if color_string cannot be parsed).
- */
-int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
-                   void *log_ctx);
-
-/**
- * Parse timestr and return in *time a corresponding number of
- * microseconds.
- *
- * @param timeval puts here the number of microseconds corresponding
- * to the string in timestr. If the string represents a duration, it
- * is the number of microseconds contained in the time interval.  If
- * the string is a date, is the number of microseconds since 1st of
- * January, 1970 up to the time of the parsed date.  If timestr cannot
- * be successfully parsed, set *time to INT64_MIN.
-
- * @param timestr a string representing a date or a duration.
- * - If a date the syntax is:
- * @code
- * [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z]
- * now
- * @endcode
- * If the value is "now" it takes the current time.
- * Time is local time unless Z is appended, in which case it is
- * interpreted as UTC.
- * If the year-month-day part is not specified it takes the current
- * year-month-day.
- * - If a duration the syntax is:
- * @code
- * [-]HH[:MM[:SS[.m...]]]
- * [-]S+[.m...]
- * @endcode
- * @param duration flag which tells how to interpret timestr, if not
- * zero timestr is interpreted as a duration, otherwise as a date
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code otherwise
- */
-int av_parse_time(int64_t *timeval, const char *timestr, int duration);
-
-/**
- * Attempt to find a specific tag in a URL.
- *
- * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
- * Return 1 if found.
- */
-int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
-
-/**
- * Convert the decomposed UTC time in tm to a time_t value.
- */
-time_t av_timegm(struct tm *tm);
-
-#endif /* AVUTIL_PARSEUTILS_H */
diff --git a/deps/libav/libavutil/pixdesc.c b/deps/libav/libavutil/pixdesc.c
deleted file mode 100644
index 37ce173..0000000
--- a/deps/libav/libavutil/pixdesc.c
+++ /dev/null
@@ -1,1606 +0,0 @@
-/*
- * pixel format descriptor
- * Copyright (c) 2009 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "common.h"
-#include "pixfmt.h"
-#include "pixdesc.h"
-#include "internal.h"
-#include "intreadwrite.h"
-#include "version.h"
-
-void av_read_image_line(uint16_t *dst,
-                        const uint8_t *data[4], const int linesize[4],
-                        const AVPixFmtDescriptor *desc,
-                        int x, int y, int c, int w,
-                        int read_pal_component)
-{
-    AVComponentDescriptor comp = desc->comp[c];
-    int plane = comp.plane;
-    int depth = comp.depth_minus1 + 1;
-    int mask  = (1 << depth) - 1;
-    int shift = comp.shift;
-    int step  = comp.step_minus1 + 1;
-    int flags = desc->flags;
-
-    if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
-        int skip = x * step + comp.offset_plus1 - 1;
-        const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
-        int shift = 8 - depth - (skip & 7);
-
-        while (w--) {
-            int val = (*p >> shift) & mask;
-            if (read_pal_component)
-                val = data[1][4*val + c];
-            shift -= step;
-            p -= shift >> 3;
-            shift &= 7;
-            *dst++ = val;
-        }
-    } else {
-        const uint8_t *p = data[plane] + y * linesize[plane] +
-                           x * step + comp.offset_plus1 - 1;
-        int is_8bit = shift + depth <= 8;
-
-        if (is_8bit)
-            p += !!(flags & AV_PIX_FMT_FLAG_BE);
-
-        while (w--) {
-            int val = is_8bit ? *p :
-                flags & AV_PIX_FMT_FLAG_BE ? AV_RB16(p) : AV_RL16(p);
-            val = (val >> shift) & mask;
-            if (read_pal_component)
-                val = data[1][4 * val + c];
-            p += step;
-            *dst++ = val;
-        }
-    }
-}
-
-void av_write_image_line(const uint16_t *src,
-                         uint8_t *data[4], const int linesize[4],
-                         const AVPixFmtDescriptor *desc,
-                         int x, int y, int c, int w)
-{
-    AVComponentDescriptor comp = desc->comp[c];
-    int plane = comp.plane;
-    int depth = comp.depth_minus1 + 1;
-    int step  = comp.step_minus1 + 1;
-    int flags = desc->flags;
-
-    if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
-        int skip = x * step + comp.offset_plus1 - 1;
-        uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3);
-        int shift = 8 - depth - (skip & 7);
-
-        while (w--) {
-            *p |= *src++ << shift;
-            shift -= step;
-            p -= shift >> 3;
-            shift &= 7;
-        }
-    } else {
-        int shift = comp.shift;
-        uint8_t *p = data[plane] + y * linesize[plane] +
-                     x * step + comp.offset_plus1 - 1;
-
-        if (shift + depth <= 8) {
-            p += !!(flags & AV_PIX_FMT_FLAG_BE);
-            while (w--) {
-                *p |= (*src++ << shift);
-                p += step;
-            }
-        } else {
-            while (w--) {
-                if (flags & AV_PIX_FMT_FLAG_BE) {
-                    uint16_t val = AV_RB16(p) | (*src++ << shift);
-                    AV_WB16(p, val);
-                } else {
-                    uint16_t val = AV_RL16(p) | (*src++ << shift);
-                    AV_WL16(p, val);
-                }
-                p += step;
-            }
-        }
-    }
-}
-
-#if !FF_API_PIX_FMT_DESC
-static
-#endif
-const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
-    [AV_PIX_FMT_YUV420P] = {
-        .name = "yuv420p",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUYV422] = {
-        .name = "yuyv422",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 7 },        /* Y */
-            { 0, 3, 2, 0, 7 },        /* U */
-            { 0, 3, 4, 0, 7 },        /* V */
-        },
-    },
-    [AV_PIX_FMT_RGB24] = {
-        .name = "rgb24",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 2, 1, 0, 7 },        /* R */
-            { 0, 2, 2, 0, 7 },        /* G */
-            { 0, 2, 3, 0, 7 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_BGR24] = {
-        .name = "bgr24",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 2, 1, 0, 7 },        /* B */
-            { 0, 2, 2, 0, 7 },        /* G */
-            { 0, 2, 3, 0, 7 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_YUV422P] = {
-        .name = "yuv422p",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV444P] = {
-        .name = "yuv444p",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV410P] = {
-        .name = "yuv410p",
-        .nb_components = 3,
-        .log2_chroma_w = 2,
-        .log2_chroma_h = 2,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV411P] = {
-        .name = "yuv411p",
-        .nb_components = 3,
-        .log2_chroma_w = 2,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_GRAY8] = {
-        .name = "gray",
-        .nb_components = 1,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-        },
-        .flags = AV_PIX_FMT_FLAG_PSEUDOPAL,
-    },
-    [AV_PIX_FMT_MONOWHITE] = {
-        .name = "monow",
-        .nb_components = 1,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 0 },        /* Y */
-        },
-        .flags = AV_PIX_FMT_FLAG_BITSTREAM,
-    },
-    [AV_PIX_FMT_MONOBLACK] = {
-        .name = "monob",
-        .nb_components = 1,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 7, 0 },        /* Y */
-        },
-        .flags = AV_PIX_FMT_FLAG_BITSTREAM,
-    },
-    [AV_PIX_FMT_PAL8] = {
-        .name = "pal8",
-        .nb_components = 1,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },
-        },
-        .flags = AV_PIX_FMT_FLAG_PAL,
-    },
-    [AV_PIX_FMT_YUVJ420P] = {
-        .name = "yuvj420p",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUVJ422P] = {
-        .name = "yuvj422p",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUVJ444P] = {
-        .name = "yuvj444p",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            {0, 0, 1, 0, 7},        /* Y */
-            {1, 0, 1, 0, 7},        /* U */
-            {2, 0, 1, 0, 7},        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-#if FF_API_XVMC
-    [AV_PIX_FMT_XVMC_MPEG2_MC] = {
-        .name = "xvmcmc",
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_XVMC_MPEG2_IDCT] = {
-        .name = "xvmcidct",
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-#endif /* FF_API_XVMC */
-    [AV_PIX_FMT_UYVY422] = {
-        .name = "uyvy422",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 2, 0, 7 },        /* Y */
-            { 0, 3, 1, 0, 7 },        /* U */
-            { 0, 3, 3, 0, 7 },        /* V */
-        },
-    },
-    [AV_PIX_FMT_UYYVYY411] = {
-        .name = "uyyvyy411",
-        .nb_components = 3,
-        .log2_chroma_w = 2,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 3, 2, 0, 7 },        /* Y */
-            { 0, 5, 1, 0, 7 },        /* U */
-            { 0, 5, 4, 0, 7 },        /* V */
-        },
-    },
-    [AV_PIX_FMT_BGR8] = {
-        .name = "bgr8",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 6, 1 },        /* B */
-            { 0, 0, 1, 3, 2 },        /* G */
-            { 0, 0, 1, 0, 2 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
-    },
-    [AV_PIX_FMT_BGR4] = {
-        .name = "bgr4",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 3, 1, 0, 0 },        /* B */
-            { 0, 3, 2, 0, 1 },        /* G */
-            { 0, 3, 4, 0, 0 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_BGR4_BYTE] = {
-        .name = "bgr4_byte",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 3, 0 },        /* B */
-            { 0, 0, 1, 1, 1 },        /* G */
-            { 0, 0, 1, 0, 0 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
-    },
-    [AV_PIX_FMT_RGB8] = {
-        .name = "rgb8",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 6, 1 },        /* R */
-            { 0, 0, 1, 3, 2 },        /* G */
-            { 0, 0, 1, 0, 2 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
-    },
-    [AV_PIX_FMT_RGB4] = {
-        .name = "rgb4",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 3, 1, 0, 0 },        /* R */
-            { 0, 3, 2, 0, 1 },        /* G */
-            { 0, 3, 4, 0, 0 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_RGB4_BYTE] = {
-        .name = "rgb4_byte",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 3, 0 },        /* R */
-            { 0, 0, 1, 1, 1 },        /* G */
-            { 0, 0, 1, 0, 0 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
-    },
-    [AV_PIX_FMT_NV12] = {
-        .name = "nv12",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 1, 1, 0, 7 },        /* U */
-            { 1, 1, 2, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_NV21] = {
-        .name = "nv21",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 1, 1, 0, 7 },        /* V */
-            { 1, 1, 2, 0, 7 },        /* U */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_ARGB] = {
-        .name = "argb",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 3, 1, 0, 7 },        /* A */
-            { 0, 3, 2, 0, 7 },        /* R */
-            { 0, 3, 3, 0, 7 },        /* G */
-            { 0, 3, 4, 0, 7 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_RGBA] = {
-        .name = "rgba",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 3, 1, 0, 7 },        /* R */
-            { 0, 3, 2, 0, 7 },        /* G */
-            { 0, 3, 3, 0, 7 },        /* B */
-            { 0, 3, 4, 0, 7 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_ABGR] = {
-        .name = "abgr",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 3, 1, 0, 7 },        /* A */
-            { 0, 3, 2, 0, 7 },        /* B */
-            { 0, 3, 3, 0, 7 },        /* G */
-            { 0, 3, 4, 0, 7 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_BGRA] = {
-        .name = "bgra",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 3, 1, 0, 7 },        /* B */
-            { 0, 3, 2, 0, 7 },        /* G */
-            { 0, 3, 3, 0, 7 },        /* R */
-            { 0, 3, 4, 0, 7 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_GRAY16BE] = {
-        .name = "gray16be",
-        .nb_components = 1,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },       /* Y */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE,
-    },
-    [AV_PIX_FMT_GRAY16LE] = {
-        .name = "gray16le",
-        .nb_components = 1,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },       /* Y */
-        },
-    },
-    [AV_PIX_FMT_YUV440P] = {
-        .name = "yuv440p",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUVJ440P] = {
-        .name = "yuvj440p",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUVA420P] = {
-        .name = "yuva420p",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-            { 3, 0, 1, 0, 7 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-        [AV_PIX_FMT_YUVA422P] = {
-        .name = "yuva422p",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-            { 3, 0, 1, 0, 7 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA444P] = {
-        .name = "yuva444p",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 0, 1, 0, 7 },        /* U */
-            { 2, 0, 1, 0, 7 },        /* V */
-            { 3, 0, 1, 0, 7 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA420P9BE] = {
-        .name = "yuva420p9be",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-            { 3, 1, 1, 0, 8 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUVA420P9LE] = {
-        .name = "yuva420p9le",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-            { 3, 1, 1, 0, 8 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA422P9BE] = {
-        .name = "yuva422p9be",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-            { 3, 1, 1, 0, 8 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA422P9LE] = {
-        .name = "yuva422p9le",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-            { 3, 1, 1, 0, 8 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA444P9BE] = {
-        .name = "yuva444p9be",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-            { 3, 1, 1, 0, 8 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA444P9LE] = {
-        .name = "yuva444p9le",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-            { 3, 1, 1, 0, 8 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA420P10BE] = {
-        .name = "yuva420p10be",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-            { 3, 1, 1, 0, 9 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA420P10LE] = {
-        .name = "yuva420p10le",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-            { 3, 1, 1, 0, 9 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA422P10BE] = {
-        .name = "yuva422p10be",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-            { 3, 1, 1, 0, 9 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA422P10LE] = {
-        .name = "yuva422p10le",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-            { 3, 1, 1, 0, 9 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA444P10BE] = {
-        .name = "yuva444p10be",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-            { 3, 1, 1, 0, 9 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA444P10LE] = {
-        .name = "yuva444p10le",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-            { 3, 1, 1, 0, 9 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA420P16BE] = {
-        .name = "yuva420p16be",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-            { 3, 1, 1, 0, 15 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA420P16LE] = {
-        .name = "yuva420p16le",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-            { 3, 1, 1, 0, 15 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA422P16BE] = {
-        .name = "yuva422p16be",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-            { 3, 1, 1, 0, 15 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA422P16LE] = {
-        .name = "yuva422p16le",
-        .nb_components = 4,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-            { 3, 1, 1, 0, 15 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA444P16BE] = {
-        .name = "yuva444p16be",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-            { 3, 1, 1, 0, 15 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_YUVA444P16LE] = {
-        .name = "yuva444p16le",
-        .nb_components = 4,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-            { 3, 1, 1, 0, 15 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
-    },
-#if FF_API_VDPAU
-    [AV_PIX_FMT_VDPAU_H264] = {
-        .name = "vdpau_h264",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_VDPAU_MPEG1] = {
-        .name = "vdpau_mpeg1",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_VDPAU_MPEG2] = {
-        .name = "vdpau_mpeg2",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_VDPAU_WMV3] = {
-        .name = "vdpau_wmv3",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_VDPAU_VC1] = {
-        .name = "vdpau_vc1",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_VDPAU_MPEG4] = {
-        .name = "vdpau_mpeg4",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-#endif
-    [AV_PIX_FMT_RGB48BE] = {
-        .name = "rgb48be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 5, 1, 0, 15 },       /* R */
-            { 0, 5, 3, 0, 15 },       /* G */
-            { 0, 5, 5, 0, 15 },       /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE,
-    },
-    [AV_PIX_FMT_RGB48LE] = {
-        .name = "rgb48le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 5, 1, 0, 15 },       /* R */
-            { 0, 5, 3, 0, 15 },       /* G */
-            { 0, 5, 5, 0, 15 },       /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_RGB565BE] = {
-        .name = "rgb565be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 0, 3, 4 },        /* R */
-            { 0, 1, 1, 5, 5 },        /* G */
-            { 0, 1, 1, 0, 4 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_RGB565LE] = {
-        .name = "rgb565le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 2, 3, 4 },        /* R */
-            { 0, 1, 1, 5, 5 },        /* G */
-            { 0, 1, 1, 0, 4 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_RGB555BE] = {
-        .name = "rgb555be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 0, 2, 4 },        /* R */
-            { 0, 1, 1, 5, 4 },        /* G */
-            { 0, 1, 1, 0, 4 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_RGB555LE] = {
-        .name = "rgb555le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 2, 2, 4 },        /* R */
-            { 0, 1, 1, 5, 4 },        /* G */
-            { 0, 1, 1, 0, 4 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_RGB444BE] = {
-        .name = "rgb444be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 0, 0, 3 },        /* R */
-            { 0, 1, 1, 4, 3 },        /* G */
-            { 0, 1, 1, 0, 3 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_RGB444LE] = {
-        .name = "rgb444le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 2, 0, 3 },        /* R */
-            { 0, 1, 1, 4, 3 },        /* G */
-            { 0, 1, 1, 0, 3 },        /* B */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_BGR48BE] = {
-        .name = "bgr48be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 5, 1, 0, 15 },       /* B */
-            { 0, 5, 3, 0, 15 },       /* G */
-            { 0, 5, 5, 0, 15 },       /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_BGR48LE] = {
-        .name = "bgr48le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 5, 1, 0, 15 },       /* B */
-            { 0, 5, 3, 0, 15 },       /* G */
-            { 0, 5, 5, 0, 15 },       /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_BGR565BE] = {
-        .name = "bgr565be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 0, 3, 4 },        /* B */
-            { 0, 1, 1, 5, 5 },        /* G */
-            { 0, 1, 1, 0, 4 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_BGR565LE] = {
-        .name = "bgr565le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 2, 3, 4 },        /* B */
-            { 0, 1, 1, 5, 5 },        /* G */
-            { 0, 1, 1, 0, 4 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_BGR555BE] = {
-        .name = "bgr555be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 0, 2, 4 },       /* B */
-            { 0, 1, 1, 5, 4 },       /* G */
-            { 0, 1, 1, 0, 4 },       /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
-     },
-    [AV_PIX_FMT_BGR555LE] = {
-        .name = "bgr555le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 2, 2, 4 },        /* B */
-            { 0, 1, 1, 5, 4 },        /* G */
-            { 0, 1, 1, 0, 4 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_BGR444BE] = {
-        .name = "bgr444be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 0, 0, 3 },       /* B */
-            { 0, 1, 1, 4, 3 },       /* G */
-            { 0, 1, 1, 0, 3 },       /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
-     },
-    [AV_PIX_FMT_BGR444LE] = {
-        .name = "bgr444le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 2, 0, 3 },        /* B */
-            { 0, 1, 1, 4, 3 },        /* G */
-            { 0, 1, 1, 0, 3 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_VAAPI_MOCO] = {
-        .name = "vaapi_moco",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_VAAPI_IDCT] = {
-        .name = "vaapi_idct",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_VAAPI_VLD] = {
-        .name = "vaapi_vld",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_VDA_VLD] = {
-        .name = "vda_vld",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_YUV420P9LE] = {
-        .name = "yuv420p9le",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV420P9BE] = {
-        .name = "yuv420p9be",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV420P10LE] = {
-        .name = "yuv420p10le",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV420P10BE] = {
-        .name = "yuv420p10be",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV420P16LE] = {
-        .name = "yuv420p16le",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV420P16BE] = {
-        .name = "yuv420p16be",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV422P9LE] = {
-        .name = "yuv422p9le",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV422P9BE] = {
-        .name = "yuv422p9be",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV422P10LE] = {
-        .name = "yuv422p10le",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV422P10BE] = {
-        .name = "yuv422p10be",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV422P16LE] = {
-        .name = "yuv422p16le",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV422P16BE] = {
-        .name = "yuv422p16be",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV444P16LE] = {
-        .name = "yuv444p16le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV444P16BE] = {
-        .name = "yuv444p16be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },        /* Y */
-            { 1, 1, 1, 0, 15 },        /* U */
-            { 2, 1, 1, 0, 15 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV444P10LE] = {
-        .name = "yuv444p10le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV444P10BE] = {
-        .name = "yuv444p10be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 1, 1, 0, 9 },        /* U */
-            { 2, 1, 1, 0, 9 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV444P9LE] = {
-        .name = "yuv444p9le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_YUV444P9BE] = {
-        .name = "yuv444p9be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* Y */
-            { 1, 1, 1, 0, 8 },        /* U */
-            { 2, 1, 1, 0, 8 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_DXVA2_VLD] = {
-        .name = "dxva2_vld",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_Y400A] = {
-        .name = "y400a",
-        .nb_components = 2,
-        .comp = {
-            { 0, 1, 1, 0, 7 },        /* Y */
-            { 0, 1, 2, 0, 7 },        /* A */
-        },
-        .flags = AV_PIX_FMT_FLAG_ALPHA,
-    },
-    [AV_PIX_FMT_GBRP] = {
-        .name = "gbrp",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* G */
-            { 1, 0, 1, 0, 7 },        /* B */
-            { 2, 0, 1, 0, 7 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_GBRP9LE] = {
-        .name = "gbrp9le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* G */
-            { 1, 1, 1, 0, 8 },        /* B */
-            { 2, 1, 1, 0, 8 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_GBRP9BE] = {
-        .name = "gbrp9be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 8 },        /* G */
-            { 1, 1, 1, 0, 8 },        /* B */
-            { 2, 1, 1, 0, 8 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_GBRP10LE] = {
-        .name = "gbrp10le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* G */
-            { 1, 1, 1, 0, 9 },        /* B */
-            { 2, 1, 1, 0, 9 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_GBRP10BE] = {
-        .name = "gbrp10be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* G */
-            { 1, 1, 1, 0, 9 },        /* B */
-            { 2, 1, 1, 0, 9 },        /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_GBRP16LE] = {
-        .name = "gbrp16le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },       /* G */
-            { 1, 1, 1, 0, 15 },       /* B */
-            { 2, 1, 1, 0, 15 },       /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_GBRP16BE] = {
-        .name = "gbrp16be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 15 },       /* G */
-            { 1, 1, 1, 0, 15 },       /* B */
-            { 2, 1, 1, 0, 15 },       /* R */
-        },
-        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
-    },
-    [AV_PIX_FMT_VDPAU] = {
-        .name = "vdpau",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = AV_PIX_FMT_FLAG_HWACCEL,
-    },
-    [AV_PIX_FMT_XYZ12LE] = {
-        .name = "xyz12le",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 5, 1, 4, 11 },       /* X */
-            { 0, 5, 3, 4, 11 },       /* Y */
-            { 0, 5, 5, 4, 11 },       /* Z */
-      },
-      /*.flags = -- not used*/
-    },
-    [AV_PIX_FMT_XYZ12BE] = {
-        .name = "xyz12be",
-        .nb_components = 3,
-        .log2_chroma_w = 0,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 5, 1, 4, 11 },       /* X */
-            { 0, 5, 3, 4, 11 },       /* Y */
-            { 0, 5, 5, 4, 11 },       /* Z */
-       },
-        .flags = AV_PIX_FMT_FLAG_BE,
-    },
-    [AV_PIX_FMT_NV16] = {
-        .name = "nv16",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 1, 1, 0, 7 },        /* U */
-            { 1, 1, 2, 0, 7 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_NV20LE] = {
-        .name = "nv20le",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 3, 1, 0, 9 },        /* U */
-            { 1, 3, 3, 0, 9 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR,
-    },
-    [AV_PIX_FMT_NV20BE] = {
-        .name = "nv20be",
-        .nb_components = 3,
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 0,
-        .comp = {
-            { 0, 1, 1, 0, 9 },        /* Y */
-            { 1, 3, 1, 0, 9 },        /* U */
-            { 1, 3, 3, 0, 9 },        /* V */
-        },
-        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
-    },
-};
-
-FF_DISABLE_DEPRECATION_WARNINGS
-static enum AVPixelFormat get_pix_fmt_internal(const char *name)
-{
-    enum AVPixelFormat pix_fmt;
-
-    for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
-        if (av_pix_fmt_descriptors[pix_fmt].name &&
-            !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name))
-            return pix_fmt;
-
-    return AV_PIX_FMT_NONE;
-}
-
-const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
-{
-    return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
-        av_pix_fmt_descriptors[pix_fmt].name : NULL;
-}
-
-#if HAVE_BIGENDIAN
-#   define X_NE(be, le) be
-#else
-#   define X_NE(be, le) le
-#endif
-
-enum AVPixelFormat av_get_pix_fmt(const char *name)
-{
-    enum AVPixelFormat pix_fmt;
-
-    if (!strcmp(name, "rgb32"))
-        name = X_NE("argb", "bgra");
-    else if (!strcmp(name, "bgr32"))
-        name = X_NE("abgr", "rgba");
-
-    pix_fmt = get_pix_fmt_internal(name);
-    if (pix_fmt == AV_PIX_FMT_NONE) {
-        char name2[32];
-
-        snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
-        pix_fmt = get_pix_fmt_internal(name2);
-    }
-    return pix_fmt;
-}
-
-int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
-{
-    int c, bits = 0;
-    int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
-
-    for (c = 0; c < pixdesc->nb_components; c++) {
-        int s = c == 1 || c == 2 ? 0 : log2_pixels;
-        bits += (pixdesc->comp[c].depth_minus1 + 1) << s;
-    }
-
-    return bits >> log2_pixels;
-}
-
-char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt)
-{
-    /* print header */
-    if (pix_fmt < 0) {
-       snprintf (buf, buf_size, "name" " nb_components" " nb_bits");
-    } else {
-        const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
-        snprintf(buf, buf_size, "%-11s %7d %10d", pixdesc->name,
-                 pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
-    }
-
-    return buf;
-}
-
-const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
-{
-    if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
-        return NULL;
-    return &av_pix_fmt_descriptors[pix_fmt];
-}
-
-const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
-{
-    if (!prev)
-        return &av_pix_fmt_descriptors[0];
-    if (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1)
-        return prev + 1;
-    return NULL;
-}
-
-enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
-{
-    if (desc < av_pix_fmt_descriptors ||
-        desc >= av_pix_fmt_descriptors + FF_ARRAY_ELEMS(av_pix_fmt_descriptors))
-        return AV_PIX_FMT_NONE;
-
-    return desc - av_pix_fmt_descriptors;
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-
-int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
-                                     int *h_shift, int *v_shift)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    if (!desc)
-        return AVERROR(ENOSYS);
-    *h_shift = desc->log2_chroma_w;
-    *v_shift = desc->log2_chroma_h;
-
-    return 0;
-}
-
-int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    int i, planes[4] = { 0 }, ret = 0;
-
-    if (!desc)
-        return AVERROR(EINVAL);
-
-    for (i = 0; i < desc->nb_components; i++)
-        planes[desc->comp[i].plane] = 1;
-    for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
-        ret += planes[i];
-    return ret;
-}
-
-
-enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
-{
-#define PIX_FMT_SWAP_ENDIANNESS(fmt)                                           \
-    case AV_PIX_FMT_ ## fmt ## BE: return AV_PIX_FMT_ ## fmt ## LE;            \
-    case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE
-
-    switch (pix_fmt) {
-    PIX_FMT_SWAP_ENDIANNESS(GRAY16);
-    PIX_FMT_SWAP_ENDIANNESS(RGB48);
-    PIX_FMT_SWAP_ENDIANNESS(RGB565);
-    PIX_FMT_SWAP_ENDIANNESS(RGB555);
-    PIX_FMT_SWAP_ENDIANNESS(RGB444);
-    PIX_FMT_SWAP_ENDIANNESS(BGR48);
-    PIX_FMT_SWAP_ENDIANNESS(BGR565);
-    PIX_FMT_SWAP_ENDIANNESS(BGR555);
-    PIX_FMT_SWAP_ENDIANNESS(BGR444);
-
-    PIX_FMT_SWAP_ENDIANNESS(YUV420P9);
-    PIX_FMT_SWAP_ENDIANNESS(YUV422P9);
-    PIX_FMT_SWAP_ENDIANNESS(YUV444P9);
-    PIX_FMT_SWAP_ENDIANNESS(YUV420P10);
-    PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
-    PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
-    PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
-    PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
-    PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
-
-    PIX_FMT_SWAP_ENDIANNESS(GBRP9);
-    PIX_FMT_SWAP_ENDIANNESS(GBRP10);
-    PIX_FMT_SWAP_ENDIANNESS(GBRP16);
-    PIX_FMT_SWAP_ENDIANNESS(YUVA420P9);
-    PIX_FMT_SWAP_ENDIANNESS(YUVA422P9);
-    PIX_FMT_SWAP_ENDIANNESS(YUVA444P9);
-    PIX_FMT_SWAP_ENDIANNESS(YUVA420P10);
-    PIX_FMT_SWAP_ENDIANNESS(YUVA422P10);
-    PIX_FMT_SWAP_ENDIANNESS(YUVA444P10);
-    PIX_FMT_SWAP_ENDIANNESS(YUVA420P16);
-    PIX_FMT_SWAP_ENDIANNESS(YUVA422P16);
-    PIX_FMT_SWAP_ENDIANNESS(YUVA444P16);
-
-    PIX_FMT_SWAP_ENDIANNESS(XYZ12);
-    default:
-        return AV_PIX_FMT_NONE;
-    }
-#undef PIX_FMT_SWAP_ENDIANNESS
-}
diff --git a/deps/libav/libavutil/pixdesc.h b/deps/libav/libavutil/pixdesc.h
deleted file mode 100644
index e5a16f4..0000000
--- a/deps/libav/libavutil/pixdesc.h
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * pixel format descriptor
- * Copyright (c) 2009 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PIXDESC_H
-#define AVUTIL_PIXDESC_H
-
-#include <inttypes.h>
-
-#include "attributes.h"
-#include "pixfmt.h"
-
-typedef struct AVComponentDescriptor{
-    uint16_t plane        :2;            ///< which of the 4 planes contains the component
-
-    /**
-     * Number of elements between 2 horizontally consecutive pixels minus 1.
-     * Elements are bits for bitstream formats, bytes otherwise.
-     */
-    uint16_t step_minus1  :3;
-
-    /**
-     * Number of elements before the component of the first pixel plus 1.
-     * Elements are bits for bitstream formats, bytes otherwise.
-     */
-    uint16_t offset_plus1 :3;
-    uint16_t shift        :3;            ///< number of least significant bits that must be shifted away to get the value
-    uint16_t depth_minus1 :4;            ///< number of bits in the component minus 1
-}AVComponentDescriptor;
-
-/**
- * Descriptor that unambiguously describes how the bits of a pixel are
- * stored in the up to 4 data planes of an image. It also stores the
- * subsampling factors and number of components.
- *
- * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV
- *       and all the YUV variants) AVPixFmtDescriptor just stores how values
- *       are stored not what these values represent.
- */
-typedef struct AVPixFmtDescriptor{
-    const char *name;
-    uint8_t nb_components;      ///< The number of components each pixel has, (1-4)
-
-    /**
-     * Amount to shift the luma width right to find the chroma width.
-     * For YV12 this is 1 for example.
-     * chroma_width = -((-luma_width) >> log2_chroma_w)
-     * The note above is needed to ensure rounding up.
-     * This value only refers to the chroma components.
-     */
-    uint8_t log2_chroma_w;      ///< chroma_width = -((-luma_width )>>log2_chroma_w)
-
-    /**
-     * Amount to shift the luma height right to find the chroma height.
-     * For YV12 this is 1 for example.
-     * chroma_height= -((-luma_height) >> log2_chroma_h)
-     * The note above is needed to ensure rounding up.
-     * This value only refers to the chroma components.
-     */
-    uint8_t log2_chroma_h;
-    uint8_t flags;
-
-    /**
-     * Parameters that describe how pixels are packed. If the format
-     * has chroma components, they must be stored in comp[1] and
-     * comp[2].
-     */
-    AVComponentDescriptor comp[4];
-}AVPixFmtDescriptor;
-
-/**
- * Pixel format is big-endian.
- */
-#define AV_PIX_FMT_FLAG_BE           (1 << 0)
-/**
- * Pixel format has a palette in data[1], values are indexes in this palette.
- */
-#define AV_PIX_FMT_FLAG_PAL          (1 << 1)
-/**
- * All values of a component are bit-wise packed end to end.
- */
-#define AV_PIX_FMT_FLAG_BITSTREAM    (1 << 2)
-/**
- * Pixel format is an HW accelerated format.
- */
-#define AV_PIX_FMT_FLAG_HWACCEL      (1 << 3)
-/**
- * At least one pixel component is not in the first data plane.
- */
-#define AV_PIX_FMT_FLAG_PLANAR       (1 << 4)
-/**
- * The pixel format contains RGB-like data (as opposed to YUV/grayscale).
- */
-#define AV_PIX_FMT_FLAG_RGB          (1 << 5)
-/**
- * The pixel format is "pseudo-paletted". This means that Libav treats it as
- * paletted internally, but the palette is generated by the decoder and is not
- * stored in the file.
- */
-#define AV_PIX_FMT_FLAG_PSEUDOPAL    (1 << 6)
-/**
- * The pixel format has an alpha channel.
- */
-#define AV_PIX_FMT_FLAG_ALPHA        (1 << 7)
-
-#if FF_API_PIX_FMT
-/**
- * @deprecated use the AV_PIX_FMT_FLAG_* flags
- */
-#define PIX_FMT_BE        AV_PIX_FMT_FLAG_BE
-#define PIX_FMT_PAL       AV_PIX_FMT_FLAG_PAL
-#define PIX_FMT_BITSTREAM AV_PIX_FMT_FLAG_BITSTREAM
-#define PIX_FMT_HWACCEL   AV_PIX_FMT_FLAG_HWACCEL
-#define PIX_FMT_PLANAR    AV_PIX_FMT_FLAG_PLANAR
-#define PIX_FMT_RGB       AV_PIX_FMT_FLAG_RGB
-#define PIX_FMT_PSEUDOPAL AV_PIX_FMT_FLAG_PSEUDOPAL
-#define PIX_FMT_ALPHA     AV_PIX_FMT_FLAG_ALPHA
-#endif
-
-#if FF_API_PIX_FMT_DESC
-/**
- * The array of all the pixel format descriptors.
- */
-extern attribute_deprecated const AVPixFmtDescriptor av_pix_fmt_descriptors[];
-#endif
-
-/**
- * Read a line from an image, and write the values of the
- * pixel format component c to dst.
- *
- * @param data the array containing the pointers to the planes of the image
- * @param linesize the array containing the linesizes of the image
- * @param desc the pixel format descriptor for the image
- * @param x the horizontal coordinate of the first pixel to read
- * @param y the vertical coordinate of the first pixel to read
- * @param w the width of the line to read, that is the number of
- * values to write to dst
- * @param read_pal_component if not zero and the format is a paletted
- * format writes the values corresponding to the palette
- * component c in data[1] to dst, rather than the palette indexes in
- * data[0]. The behavior is undefined if the format is not paletted.
- */
-void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
-                        const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
-
-/**
- * Write the values from src to the pixel format component c of an
- * image line.
- *
- * @param src array containing the values to write
- * @param data the array containing the pointers to the planes of the
- * image to write into. It is supposed to be zeroed.
- * @param linesize the array containing the linesizes of the image
- * @param desc the pixel format descriptor for the image
- * @param x the horizontal coordinate of the first pixel to write
- * @param y the vertical coordinate of the first pixel to write
- * @param w the width of the line to write, that is the number of
- * values to write to the image line
- */
-void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
-                         const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
-
-/**
- * Return the pixel format corresponding to name.
- *
- * If there is no pixel format with name name, then looks for a
- * pixel format with the name corresponding to the native endian
- * format of name.
- * For example in a little-endian system, first looks for "gray16",
- * then for "gray16le".
- *
- * Finally if no pixel format has been found, returns PIX_FMT_NONE.
- */
-enum AVPixelFormat av_get_pix_fmt(const char *name);
-
-/**
- * Return the short name for a pixel format, NULL in case pix_fmt is
- * unknown.
- *
- * @see av_get_pix_fmt(), av_get_pix_fmt_string()
- */
-const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
-
-/**
- * Print in buf the string corresponding to the pixel format with
- * number pix_fmt, or an header if pix_fmt is negative.
- *
- * @param buf the buffer where to write the string
- * @param buf_size the size of buf
- * @param pix_fmt the number of the pixel format to print the
- * corresponding info string, or a negative value to print the
- * corresponding header.
- */
-char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
-
-/**
- * Return the number of bits per pixel used by the pixel format
- * described by pixdesc. Note that this is not the same as the number
- * of bits per sample.
- *
- * The returned number of bits refers to the number of bits actually
- * used for storing the pixel information, that is padding bits are
- * not counted.
- */
-int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
-
-/**
- * @return a pixel format descriptor for provided pixel format or NULL if
- * this pixel format is unknown.
- */
-const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt);
-
-/**
- * Iterate over all pixel format descriptors known to libavutil.
- *
- * @param prev previous descriptor. NULL to get the first descriptor.
- *
- * @return next descriptor or NULL after the last descriptor
- */
-const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
-
-/**
- * @return an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc
- * is not a valid pointer to a pixel format descriptor.
- */
-enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
-
-/**
- * Utility function to access log2_chroma_w log2_chroma_h from
- * the pixel format AVPixFmtDescriptor.
- *
- * @param[in]  pix_fmt the pixel format
- * @param[out] h_shift store log2_chroma_h
- * @param[out] v_shift store log2_chroma_w
- *
- * @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
- */
-int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
-                                     int *h_shift, int *v_shift);
-
-/**
- * @return number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a
- * valid pixel format.
- */
-int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt);
-
-
-/**
- * Utility function to swap the endianness of a pixel format.
- *
- * @param[in]  pix_fmt the pixel format
- *
- * @return pixel format with swapped endianness if it exists,
- * otherwise AV_PIX_FMT_NONE
- */
-enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt);
-
-
-#endif /* AVUTIL_PIXDESC_H */
diff --git a/deps/libav/libavutil/pixfmt.h b/deps/libav/libavutil/pixfmt.h
deleted file mode 100644
index 0d6e0a3..0000000
--- a/deps/libav/libavutil/pixfmt.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PIXFMT_H
-#define AVUTIL_PIXFMT_H
-
-/**
- * @file
- * pixel format definitions
- *
- */
-
-#include "libavutil/avconfig.h"
-#include "version.h"
-
-/**
- * Pixel format.
- *
- * @note
- * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
- * color is put together as:
- *  (A << 24) | (R << 16) | (G << 8) | B
- * This is stored as BGRA on little-endian CPU architectures and ARGB on
- * big-endian CPUs.
- *
- * @par
- * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
- * image data is stored in AVFrame.data[0]. The palette is transported in
- * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
- * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
- * also endian-specific). Note also that the individual RGB palette
- * components stored in AVFrame.data[1] should be in the range 0..255.
- * This is important as many custom PAL8 video codecs that were designed
- * to run on the IBM VGA graphics adapter use 6-bit palette components.
- *
- * @par
- * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
- * for pal8. This palette is filled in automatically by the function
- * allocating the picture.
- *
- * @note
- * Make sure that all newly added big-endian formats have pix_fmt & 1 == 1
- * and that all newly added little-endian formats have pix_fmt & 1 == 0.
- * This allows simpler detection of big vs little-endian.
- */
-enum AVPixelFormat {
-    AV_PIX_FMT_NONE = -1,
-    AV_PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
-    AV_PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
-    AV_PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
-    AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
-    AV_PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
-    AV_PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
-    AV_PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
-    AV_PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
-    AV_PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
-    AV_PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
-    AV_PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
-    AV_PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
-    AV_PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
-    AV_PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
-    AV_PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
-#if FF_API_XVMC
-    AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
-    AV_PIX_FMT_XVMC_MPEG2_IDCT,
-#endif /* FF_API_XVMC */
-    AV_PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
-    AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
-    AV_PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
-    AV_PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
-    AV_PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
-    AV_PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
-    AV_PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
-    AV_PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
-
-    AV_PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
-    AV_PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
-    AV_PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
-    AV_PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
-
-    AV_PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
-    AV_PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
-    AV_PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
-    AV_PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
-    AV_PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
-#if FF_API_VDPAU
-    AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
-    AV_PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
-    AV_PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
-
-    AV_PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
-    AV_PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
-    AV_PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
-    AV_PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
-
-    AV_PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
-    AV_PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
-    AV_PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
-    AV_PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
-
-    AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
-    AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
-    AV_PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-
-    AV_PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    AV_PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    AV_PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    AV_PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    AV_PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    AV_PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-#if FF_API_VDPAU
-    AV_PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
-    AV_PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
-
-    AV_PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
-    AV_PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
-    AV_PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
-    AV_PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
-    AV_PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
-    AV_PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
-    AV_PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
-    AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    AV_PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
-    AV_PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
-    AV_PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big-endian
-    AV_PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little-endian
-    AV_PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big-endian
-    AV_PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little-endian
-    AV_PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big-endian
-    AV_PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little-endian
-    AV_PIX_FMT_YUVA422P,  ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
-    AV_PIX_FMT_YUVA444P,  ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
-    AV_PIX_FMT_YUVA420P9BE,  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
-    AV_PIX_FMT_YUVA420P9LE,  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
-    AV_PIX_FMT_YUVA422P9BE,  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
-    AV_PIX_FMT_YUVA422P9LE,  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
-    AV_PIX_FMT_YUVA444P9BE,  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
-    AV_PIX_FMT_YUVA444P9LE,  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
-    AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
-    AV_PIX_FMT_VDPAU,     ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface
-    AV_PIX_FMT_XYZ12LE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0
-    AV_PIX_FMT_XYZ12BE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0
-    AV_PIX_FMT_NV16,         ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
-    AV_PIX_FMT_NV20LE,       ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    AV_PIX_FMT_NV20BE,       ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    AV_PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
-
-#if FF_API_PIX_FMT
-#include "old_pix_fmts.h"
-#endif
-};
-
-#if AV_HAVE_BIGENDIAN
-#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be
-#else
-#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le
-#endif
-
-#define AV_PIX_FMT_RGB32   AV_PIX_FMT_NE(ARGB, BGRA)
-#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR)
-#define AV_PIX_FMT_BGR32   AV_PIX_FMT_NE(ABGR, RGBA)
-#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
-
-#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
-#define AV_PIX_FMT_RGB48  AV_PIX_FMT_NE(RGB48BE,  RGB48LE)
-#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
-#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
-#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
-#define AV_PIX_FMT_BGR48  AV_PIX_FMT_NE(BGR48BE,  BGR48LE)
-#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
-#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
-#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
-
-#define AV_PIX_FMT_YUV420P9  AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
-#define AV_PIX_FMT_YUV422P9  AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
-#define AV_PIX_FMT_YUV444P9  AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
-#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
-#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
-#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
-#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
-#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
-#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
-
-#define AV_PIX_FMT_GBRP9     AV_PIX_FMT_NE(GBRP9BE ,    GBRP9LE)
-#define AV_PIX_FMT_GBRP10    AV_PIX_FMT_NE(GBRP10BE,    GBRP10LE)
-#define AV_PIX_FMT_GBRP16    AV_PIX_FMT_NE(GBRP16BE,    GBRP16LE)
-
-#define AV_PIX_FMT_YUVA420P9  AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
-#define AV_PIX_FMT_YUVA422P9  AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
-#define AV_PIX_FMT_YUVA444P9  AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
-#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE)
-#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE)
-#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE)
-#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE)
-#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE)
-#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE)
-
-#define AV_PIX_FMT_XYZ12      AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
-#define AV_PIX_FMT_NV20       AV_PIX_FMT_NE(NV20BE,  NV20LE)
-
-#if FF_API_PIX_FMT
-#define PixelFormat AVPixelFormat
-
-#define PIX_FMT_NE(be, le) AV_PIX_FMT_NE(be, le)
-
-#define PIX_FMT_RGB32   AV_PIX_FMT_RGB32
-#define PIX_FMT_RGB32_1 AV_PIX_FMT_RGB32_1
-#define PIX_FMT_BGR32   AV_PIX_FMT_BGR32
-#define PIX_FMT_BGR32_1 AV_PIX_FMT_BGR32_1
-
-#define PIX_FMT_GRAY16 AV_PIX_FMT_GRAY16
-#define PIX_FMT_RGB48  AV_PIX_FMT_RGB48
-#define PIX_FMT_RGB565 AV_PIX_FMT_RGB565
-#define PIX_FMT_RGB555 AV_PIX_FMT_RGB555
-#define PIX_FMT_RGB444 AV_PIX_FMT_RGB444
-#define PIX_FMT_BGR48  AV_PIX_FMT_BGR48
-#define PIX_FMT_BGR565 AV_PIX_FMT_BGR565
-#define PIX_FMT_BGR555 AV_PIX_FMT_BGR555
-#define PIX_FMT_BGR444 AV_PIX_FMT_BGR444
-
-#define PIX_FMT_YUV420P9  AV_PIX_FMT_YUV420P9
-#define PIX_FMT_YUV422P9  AV_PIX_FMT_YUV422P9
-#define PIX_FMT_YUV444P9  AV_PIX_FMT_YUV444P9
-#define PIX_FMT_YUV420P10 AV_PIX_FMT_YUV420P10
-#define PIX_FMT_YUV422P10 AV_PIX_FMT_YUV422P10
-#define PIX_FMT_YUV444P10 AV_PIX_FMT_YUV444P10
-#define PIX_FMT_YUV420P16 AV_PIX_FMT_YUV420P16
-#define PIX_FMT_YUV422P16 AV_PIX_FMT_YUV422P16
-#define PIX_FMT_YUV444P16 AV_PIX_FMT_YUV444P16
-
-#define PIX_FMT_GBRP9  AV_PIX_FMT_GBRP9
-#define PIX_FMT_GBRP10 AV_PIX_FMT_GBRP10
-#define PIX_FMT_GBRP16 AV_PIX_FMT_GBRP16
-#endif
-
-#endif /* AVUTIL_PIXFMT_H */
diff --git a/deps/libav/libavutil/ppc/Makefile b/deps/libav/libavutil/ppc/Makefile
deleted file mode 100644
index 4fd8d6d..0000000
--- a/deps/libav/libavutil/ppc/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-OBJS += ppc/cpu.o                                                       \
-        ppc/float_dsp_init.o                                            \
-
-ALTIVEC-OBJS += ppc/float_dsp_altivec.o                                 \
diff --git a/deps/libav/libavutil/ppc/cpu.c b/deps/libav/libavutil/ppc/cpu.c
deleted file mode 100644
index 50107e1..0000000
--- a/deps/libav/libavutil/ppc/cpu.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifdef __APPLE__
-#include <sys/sysctl.h>
-#elif defined(__OpenBSD__)
-#include <sys/param.h>
-#include <sys/sysctl.h>
-#include <machine/cpu.h>
-#elif defined(__AMIGAOS4__)
-#include <exec/exec.h>
-#include <interfaces/exec.h>
-#include <proto/exec.h>
-#endif /* __APPLE__ */
-
-#include "libavutil/cpu.h"
-#include "libavutil/cpu_internal.h"
-#include "config.h"
-
-/**
- * This function MAY rely on signal() or fork() in order to make sure AltiVec
- * is present.
- */
-int ff_get_cpu_flags_ppc(void)
-{
-#if HAVE_ALTIVEC
-#ifdef __AMIGAOS4__
-    ULONG result = 0;
-    extern struct ExecIFace *IExec;
-
-    IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE);
-    if (result == VECTORTYPE_ALTIVEC)
-        return AV_CPU_FLAG_ALTIVEC;
-    return 0;
-#elif defined(__APPLE__) || defined(__OpenBSD__)
-#ifdef __OpenBSD__
-    int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
-#else
-    int sels[2] = {CTL_HW, HW_VECTORUNIT};
-#endif
-    int has_vu = 0;
-    size_t len = sizeof(has_vu);
-    int err;
-
-    err = sysctl(sels, 2, &has_vu, &len, NULL, 0);
-
-    if (err == 0)
-        return has_vu ? AV_CPU_FLAG_ALTIVEC : 0;
-    return 0;
-#elif CONFIG_RUNTIME_CPUDETECT
-    int proc_ver;
-    // Support of mfspr PVR emulation added in Linux 2.6.17.
-    __asm__ volatile("mfspr %0, 287" : "=r" (proc_ver));
-    proc_ver >>= 16;
-    if (proc_ver  & 0x8000 ||
-        proc_ver == 0x000c ||
-        proc_ver == 0x0039 || proc_ver == 0x003c ||
-        proc_ver == 0x0044 || proc_ver == 0x0045 ||
-        proc_ver == 0x0070)
-        return AV_CPU_FLAG_ALTIVEC;
-    return 0;
-#else
-    // Since we were compiled for AltiVec, just assume we have it
-    // until someone comes up with a proper way (not involving signal hacks).
-    return AV_CPU_FLAG_ALTIVEC;
-#endif /* __AMIGAOS4__ */
-#endif /* HAVE_ALTIVEC */
-    return 0;
-}
diff --git a/deps/libav/libavutil/ppc/cpu.h b/deps/libav/libavutil/ppc/cpu.h
deleted file mode 100644
index f8fae58..0000000
--- a/deps/libav/libavutil/ppc/cpu.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PPC_CPU_H
-#define AVUTIL_PPC_CPU_H
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/cpu_internal.h"
-
-#define PPC_ALTIVEC(flags) CPUEXT(flags, ALTIVEC)
-
-#endif /* AVUTIL_PPC_CPU_H */
diff --git a/deps/libav/libavutil/ppc/float_dsp_altivec.c b/deps/libav/libavutil/ppc/float_dsp_altivec.c
deleted file mode 100644
index fee4e7c..0000000
--- a/deps/libav/libavutil/ppc/float_dsp_altivec.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2006 Luca Barbato <lu_zero at gentoo.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "util_altivec.h"
-#include "float_dsp_altivec.h"
-
-void ff_vector_fmul_altivec(float *dst, const float *src0, const float *src1,
-                            int len)
-{
-    int i;
-    vector float d0, d1, s, zero = (vector float)vec_splat_u32(0);
-    for (i = 0; i < len - 7; i += 8) {
-        d0 = vec_ld( 0, src0 + i);
-        s  = vec_ld( 0, src1 + i);
-        d1 = vec_ld(16, src0 + i);
-        d0 = vec_madd(d0, s, zero);
-        d1 = vec_madd(d1, vec_ld(16, src1 + i), zero);
-        vec_st(d0,  0, dst + i);
-        vec_st(d1, 16, dst + i);
-    }
-}
-
-void ff_vector_fmul_window_altivec(float *dst, const float *src0,
-                                   const float *src1, const float *win, int len)
-{
-    vector float zero, t0, t1, s0, s1, wi, wj;
-    const vector unsigned char reverse = vcprm(3, 2, 1, 0);
-    int i, j;
-
-    dst  += len;
-    win  += len;
-    src0 += len;
-
-    zero = (vector float)vec_splat_u32(0);
-
-    for (i = -len * 4, j = len * 4 - 16; i < 0; i += 16, j -= 16) {
-        s0 = vec_ld(i, src0);
-        s1 = vec_ld(j, src1);
-        wi = vec_ld(i, win);
-        wj = vec_ld(j, win);
-
-        s1 = vec_perm(s1, s1, reverse);
-        wj = vec_perm(wj, wj, reverse);
-
-        t0 = vec_madd(s0, wj, zero);
-        t0 = vec_nmsub(s1, wi, t0);
-        t1 = vec_madd(s0, wi, zero);
-        t1 = vec_madd(s1, wj, t1);
-        t1 = vec_perm(t1, t1, reverse);
-
-        vec_st(t0, i, dst);
-        vec_st(t1, j, dst);
-    }
-}
-
-void ff_vector_fmul_add_altivec(float *dst, const float *src0,
-                                const float *src1, const float *src2,
-                                int len)
-{
-    int i;
-    vector float d, s0, s1, s2, t0, t1, edges;
-    vector unsigned char align = vec_lvsr(0,dst),
-                         mask = vec_lvsl(0, dst);
-
-    for (i = 0; i < len - 3; i += 4) {
-        t0 = vec_ld(0, dst + i);
-        t1 = vec_ld(15, dst + i);
-        s0 = vec_ld(0, src0 + i);
-        s1 = vec_ld(0, src1 + i);
-        s2 = vec_ld(0, src2 + i);
-        edges = vec_perm(t1, t0, mask);
-        d = vec_madd(s0, s1, s2);
-        t1 = vec_perm(d, edges, align);
-        t0 = vec_perm(edges, d, align);
-        vec_st(t1, 15, dst + i);
-        vec_st(t0, 0, dst + i);
-    }
-}
-
-void ff_vector_fmul_reverse_altivec(float *dst, const float *src0,
-                                    const float *src1, int len)
-{
-    int i;
-    vector float d, s0, s1, h0, l0,
-                s2, s3, zero = (vector float) vec_splat_u32(0);
-
-    src1 += len-4;
-    for(i = 0; i < len - 7; i += 8) {
-        s1 = vec_ld(0, src1 - i);              // [a,b,c,d]
-        s0 = vec_ld(0, src0 + i);
-        l0 = vec_mergel(s1, s1);               // [c,c,d,d]
-        s3 = vec_ld(-16, src1 - i);
-        h0 = vec_mergeh(s1, s1);               // [a,a,b,b]
-        s2 = vec_ld(16, src0 + i);
-        s1 = vec_mergeh(vec_mergel(l0, h0),    // [d,b,d,b]
-                        vec_mergeh(l0, h0));   // [c,a,c,a]
-        // [d,c,b,a]
-        l0 = vec_mergel(s3, s3);
-        d = vec_madd(s0, s1, zero);
-        h0 = vec_mergeh(s3, s3);
-        vec_st(d, 0, dst + i);
-        s3 = vec_mergeh(vec_mergel(l0, h0),
-                        vec_mergeh(l0, h0));
-        d = vec_madd(s2, s3, zero);
-        vec_st(d, 16, dst + i);
-    }
-}
diff --git a/deps/libav/libavutil/ppc/float_dsp_altivec.h b/deps/libav/libavutil/ppc/float_dsp_altivec.h
deleted file mode 100644
index 87d50a8..0000000
--- a/deps/libav/libavutil/ppc/float_dsp_altivec.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2006 Luca Barbato <lu_zero at gentoo.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H
-#define AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H
-
-void ff_vector_fmul_altivec(float *dst, const float *src0,
-                            const float *src1, int len);
-
-void ff_vector_fmul_window_altivec(float *dst, const float *src0,
-                                   const float *src1, const float *win,
-                                   int len);
-
-void ff_vector_fmul_add_altivec(float *dst, const float *src0,
-                                const float *src1, const float *src2,
-                                int len);
-
-void ff_vector_fmul_reverse_altivec(float *dst, const float *src0,
-                                    const float *src1, int len);
-
-#endif /* AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H */
diff --git a/deps/libav/libavutil/ppc/float_dsp_init.c b/deps/libav/libavutil/ppc/float_dsp_init.c
deleted file mode 100644
index 60d0f19..0000000
--- a/deps/libav/libavutil/ppc/float_dsp_init.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2006 Luca Barbato <lu_zero at gentoo.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/float_dsp.h"
-#include "libavutil/ppc/cpu.h"
-#include "float_dsp_altivec.h"
-
-av_cold void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int bit_exact)
-{
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
-    fdsp->vector_fmul = ff_vector_fmul_altivec;
-    fdsp->vector_fmul_add = ff_vector_fmul_add_altivec;
-    fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_altivec;
-
-    if (!bit_exact) {
-        fdsp->vector_fmul_window = ff_vector_fmul_window_altivec;
-    }
-}
diff --git a/deps/libav/libavutil/ppc/intreadwrite.h b/deps/libav/libavutil/ppc/intreadwrite.h
deleted file mode 100644
index fec54e6..0000000
--- a/deps/libav/libavutil/ppc/intreadwrite.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2008 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PPC_INTREADWRITE_H
-#define AVUTIL_PPC_INTREADWRITE_H
-
-#include <stdint.h>
-#include "config.h"
-
-#if HAVE_XFORM_ASM
-
-#define AV_RL16 AV_RL16
-static av_always_inline uint16_t AV_RL16(const void *p)
-{
-    uint16_t v;
-    __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
-    return v;
-}
-
-#define AV_WL16 AV_WL16
-static av_always_inline void AV_WL16(void *p, uint16_t v)
-{
-    __asm__ ("sthbrx  %1, %y0" : "=Z"(*(uint16_t*)p) : "r"(v));
-}
-
-#define AV_RL32 AV_RL32
-static av_always_inline uint32_t AV_RL32(const void *p)
-{
-    uint32_t v;
-    __asm__ ("lwbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p));
-    return v;
-}
-
-#define AV_WL32 AV_WL32
-static av_always_inline void AV_WL32(void *p, uint32_t v)
-{
-    __asm__ ("stwbrx  %1, %y0" : "=Z"(*(uint32_t*)p) : "r"(v));
-}
-
-#if HAVE_LDBRX
-
-#define AV_RL64 AV_RL64
-static av_always_inline uint64_t AV_RL64(const void *p)
-{
-    uint64_t v;
-    __asm__ ("ldbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint64_t*)p));
-    return v;
-}
-
-#define AV_WL64 AV_WL64
-static av_always_inline void AV_WL64(void *p, uint64_t v)
-{
-    __asm__ ("stdbrx  %1, %y0" : "=Z"(*(uint64_t*)p) : "r"(v));
-}
-
-#else
-
-#define AV_RL64 AV_RL64
-static av_always_inline uint64_t AV_RL64(const void *p)
-{
-    union { uint64_t v; uint32_t hl[2]; } v;
-    __asm__ ("lwbrx   %0, %y2  \n\t"
-             "lwbrx   %1, %y3  \n\t"
-             : "=&r"(v.hl[1]), "=r"(v.hl[0])
-             : "Z"(*(const uint32_t*)p), "Z"(*((const uint32_t*)p+1)));
-    return v.v;
-}
-
-#define AV_WL64 AV_WL64
-static av_always_inline void AV_WL64(void *p, uint64_t v)
-{
-    union { uint64_t v; uint32_t hl[2]; } vv = { v };
-    __asm__ ("stwbrx  %2, %y0  \n\t"
-             "stwbrx  %3, %y1  \n\t"
-             : "=Z"(*(uint32_t*)p), "=Z"(*((uint32_t*)p+1))
-             : "r"(vv.hl[1]), "r"(vv.hl[0]));
-}
-
-#endif /* HAVE_LDBRX */
-
-#endif /* HAVE_XFORM_ASM */
-
-/*
- * GCC fails miserably on the packed struct version which is used by
- * default, so we override it here.
- */
-
-#define AV_RB64(p) (*(const uint64_t *)(p))
-#define AV_WB64(p, v) (*(uint64_t *)(p) = (v))
-
-#endif /* AVUTIL_PPC_INTREADWRITE_H */
diff --git a/deps/libav/libavutil/ppc/timer.h b/deps/libav/libavutil/ppc/timer.h
deleted file mode 100644
index 8d08d28..0000000
--- a/deps/libav/libavutil/ppc/timer.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2005 Luca Barbato <lu_zero at gentoo.org>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PPC_TIMER_H
-#define AVUTIL_PPC_TIMER_H
-
-#include <stdint.h>
-
-#include "config.h"
-
-#if HAVE_INLINE_ASM_LABELS
-
-#define AV_READ_TIME read_time
-
-static inline uint64_t read_time(void)
-{
-    uint32_t tbu, tbl, temp;
-
-     /* from section 2.2.1 of the 32-bit PowerPC PEM */
-     __asm__ volatile(
-         "1:\n"
-         "mftbu  %2\n"
-         "mftb   %0\n"
-         "mftbu  %1\n"
-         "cmpw   %2,%1\n"
-         "bne    1b\n"
-     : "=r"(tbl), "=r"(tbu), "=r"(temp)
-     :
-     : "cc");
-
-     return (((uint64_t)tbu)<<32) | (uint64_t)tbl;
-}
-
-#endif /* HAVE_INLINE_ASM_LABELS */
-
-#endif /* AVUTIL_PPC_TIMER_H */
diff --git a/deps/libav/libavutil/ppc/types_altivec.h b/deps/libav/libavutil/ppc/types_altivec.h
deleted file mode 100644
index 0a4eaf8..0000000
--- a/deps/libav/libavutil/ppc/types_altivec.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2006 Guillaume Poirier <gpoirier at mplayerhq.hu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PPC_TYPES_ALTIVEC_H
-#define AVUTIL_PPC_TYPES_ALTIVEC_H
-
-/***********************************************************************
- * Vector types
- **********************************************************************/
-#define vec_u8  vector unsigned char
-#define vec_s8  vector signed char
-#define vec_u16 vector unsigned short
-#define vec_s16 vector signed short
-#define vec_u32 vector unsigned int
-#define vec_s32 vector signed int
-#define vec_f   vector float
-
-/***********************************************************************
- * Null vector
- **********************************************************************/
-#define LOAD_ZERO const vec_u8 zerov = vec_splat_u8( 0 )
-
-#define zero_u8v  (vec_u8)  zerov
-#define zero_s8v  (vec_s8)  zerov
-#define zero_u16v (vec_u16) zerov
-#define zero_s16v (vec_s16) zerov
-#define zero_u32v (vec_u32) zerov
-#define zero_s32v (vec_s32) zerov
-
-#endif /* AVUTIL_PPC_TYPES_ALTIVEC_H */
diff --git a/deps/libav/libavutil/ppc/util_altivec.h b/deps/libav/libavutil/ppc/util_altivec.h
deleted file mode 100644
index f2e0b13..0000000
--- a/deps/libav/libavutil/ppc/util_altivec.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Contains misc utility macros and inline functions
- */
-
-#ifndef AVUTIL_PPC_UTIL_ALTIVEC_H
-#define AVUTIL_PPC_UTIL_ALTIVEC_H
-
-#include <stdint.h>
-
-#include "config.h"
-
-#if HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-
-#include "types_altivec.h"
-
-#if HAVE_ALTIVEC
-
-// used to build registers permutation vectors (vcprm)
-// the 's' are for words in the _s_econd vector
-#define WORD_0 0x00,0x01,0x02,0x03
-#define WORD_1 0x04,0x05,0x06,0x07
-#define WORD_2 0x08,0x09,0x0a,0x0b
-#define WORD_3 0x0c,0x0d,0x0e,0x0f
-#define WORD_s0 0x10,0x11,0x12,0x13
-#define WORD_s1 0x14,0x15,0x16,0x17
-#define WORD_s2 0x18,0x19,0x1a,0x1b
-#define WORD_s3 0x1c,0x1d,0x1e,0x1f
-
-#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
-#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
-
-// vcprmle is used to keep the same index as in the SSE version.
-// it's the same as vcprm, with the index inversed
-// ('le' is Little Endian)
-#define vcprmle(a,b,c,d) vcprm(d,c,b,a)
-
-// used to build inverse/identity vectors (vcii)
-// n is _n_egative, p is _p_ositive
-#define FLOAT_n -1.
-#define FLOAT_p 1.
-
-
-// Transpose 8x8 matrix of 16-bit elements (in-place)
-#define TRANSPOSE8(a,b,c,d,e,f,g,h) \
-do { \
-    vector signed short A1, B1, C1, D1, E1, F1, G1, H1; \
-    vector signed short A2, B2, C2, D2, E2, F2, G2, H2; \
- \
-    A1 = vec_mergeh (a, e); \
-    B1 = vec_mergel (a, e); \
-    C1 = vec_mergeh (b, f); \
-    D1 = vec_mergel (b, f); \
-    E1 = vec_mergeh (c, g); \
-    F1 = vec_mergel (c, g); \
-    G1 = vec_mergeh (d, h); \
-    H1 = vec_mergel (d, h); \
- \
-    A2 = vec_mergeh (A1, E1); \
-    B2 = vec_mergel (A1, E1); \
-    C2 = vec_mergeh (B1, F1); \
-    D2 = vec_mergel (B1, F1); \
-    E2 = vec_mergeh (C1, G1); \
-    F2 = vec_mergel (C1, G1); \
-    G2 = vec_mergeh (D1, H1); \
-    H2 = vec_mergel (D1, H1); \
- \
-    a = vec_mergeh (A2, E2); \
-    b = vec_mergel (A2, E2); \
-    c = vec_mergeh (B2, F2); \
-    d = vec_mergel (B2, F2); \
-    e = vec_mergeh (C2, G2); \
-    f = vec_mergel (C2, G2); \
-    g = vec_mergeh (D2, H2); \
-    h = vec_mergel (D2, H2); \
-} while (0)
-
-
-/** @brief loads unaligned vector @a *src with offset @a offset
-    and returns it */
-static inline vector unsigned char unaligned_load(int offset, uint8_t *src)
-{
-    register vector unsigned char first = vec_ld(offset, src);
-    register vector unsigned char second = vec_ld(offset+15, src);
-    register vector unsigned char mask = vec_lvsl(offset, src);
-    return vec_perm(first, second, mask);
-}
-
-/**
- * loads vector known misalignment
- * @param perm_vec the align permute vector to combine the two loads from lvsl
- */
-static inline vec_u8 load_with_perm_vec(int offset, uint8_t *src, vec_u8 perm_vec)
-{
-    vec_u8 a = vec_ld(offset, src);
-    vec_u8 b = vec_ld(offset+15, src);
-    return vec_perm(a, b, perm_vec);
-}
-
-#endif /* HAVE_ALTIVEC */
-
-#endif /* AVUTIL_PPC_UTIL_ALTIVEC_H */
diff --git a/deps/libav/libavutil/random_seed.c b/deps/libav/libavutil/random_seed.c
deleted file mode 100644
index 26884cb..0000000
--- a/deps/libav/libavutil/random_seed.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_CRYPTGENRANDOM
-#include <windows.h>
-#include <wincrypt.h>
-#endif
-#include <fcntl.h>
-#include <math.h>
-#include <time.h>
-#include "internal.h"
-#include "intreadwrite.h"
-#include "mem.h"
-#include "timer.h"
-#include "random_seed.h"
-#include "sha.h"
-
-static int read_random(uint32_t *dst, const char *file)
-{
-#if HAVE_UNISTD_H
-    int fd = avpriv_open(file, O_RDONLY);
-    int err = -1;
-
-    if (fd == -1)
-        return -1;
-    err = read(fd, dst, sizeof(*dst));
-    close(fd);
-
-    return err;
-#else
-    return -1;
-#endif
-}
-
-static uint32_t get_generic_seed(void)
-{
-    struct AVSHA *sha = av_sha_alloc();
-    clock_t last_t  = 0;
-    static uint64_t i = 0;
-    static uint32_t buffer[512] = { 0 };
-    unsigned char digest[20];
-    uint64_t last_i = i;
-
-    for (;;) {
-        clock_t t = clock();
-
-        if (last_t == t) {
-            buffer[i & 511]++;
-        } else {
-            buffer[++i & 511] += (t - last_t) % 3294638521U;
-            if (last_i && i - last_i > 4 || i - last_i > 64)
-                break;
-        }
-        last_t = t;
-    }
-
-    if (!sha) {
-        uint32_t seed = 0;
-        int j;
-        // Unable to allocate an sha context, just xor the buffer together
-        // to create something hopefully unique.
-        for (j = 0; j < 512; j++)
-            seed ^= buffer[j];
-        return seed;
-    }
-    av_sha_init(sha, 160);
-    av_sha_update(sha, (const uint8_t *) buffer, sizeof(buffer));
-    av_sha_final(sha, digest);
-    av_free(sha);
-    return AV_RB32(digest) + AV_RB32(digest + 16);
-}
-
-uint32_t av_get_random_seed(void)
-{
-    uint32_t seed;
-
-#if HAVE_CRYPTGENRANDOM
-    HCRYPTPROV provider;
-    if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
-                            CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
-        BOOL ret = CryptGenRandom(provider, sizeof(seed), (PBYTE) &seed);
-        CryptReleaseContext(provider, 0);
-        if (ret)
-            return seed;
-    }
-#endif
-
-    if (read_random(&seed, "/dev/urandom") == sizeof(seed))
-        return seed;
-    if (read_random(&seed, "/dev/random")  == sizeof(seed))
-        return seed;
-    return get_generic_seed();
-}
diff --git a/deps/libav/libavutil/random_seed.h b/deps/libav/libavutil/random_seed.h
deleted file mode 100644
index b1fad13..0000000
--- a/deps/libav/libavutil/random_seed.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_RANDOM_SEED_H
-#define AVUTIL_RANDOM_SEED_H
-
-#include <stdint.h>
-/**
- * @addtogroup lavu_crypto
- * @{
- */
-
-/**
- * Get random data.
- *
- * This function can be called repeatedly to generate more random bits
- * as needed. It is generally quite slow, and usually used to seed a
- * PRNG.  As it uses /dev/urandom and /dev/random, the quality of the
- * returned random data depends on the platform.
- */
-uint32_t av_get_random_seed(void);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_RANDOM_SEED_H */
diff --git a/deps/libav/libavutil/rational.c b/deps/libav/libavutil/rational.c
deleted file mode 100644
index 4053936..0000000
--- a/deps/libav/libavutil/rational.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * rational numbers
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * rational numbers
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#include "avassert.h"
-#include <limits.h>
-
-#include "common.h"
-#include "mathematics.h"
-#include "rational.h"
-
-int av_reduce(int *dst_num, int *dst_den,
-              int64_t num, int64_t den, int64_t max)
-{
-    AVRational a0 = { 0, 1 }, a1 = { 1, 0 };
-    int sign = (num < 0) ^ (den < 0);
-    int64_t gcd = av_gcd(FFABS(num), FFABS(den));
-
-    if (gcd) {
-        num = FFABS(num) / gcd;
-        den = FFABS(den) / gcd;
-    }
-    if (num <= max && den <= max) {
-        a1 = (AVRational) { num, den };
-        den = 0;
-    }
-
-    while (den) {
-        uint64_t x        = num / den;
-        int64_t next_den  = num - den * x;
-        int64_t a2n       = x * a1.num + a0.num;
-        int64_t a2d       = x * a1.den + a0.den;
-
-        if (a2n > max || a2d > max) {
-            if (a1.num) x =          (max - a0.num) / a1.num;
-            if (a1.den) x = FFMIN(x, (max - a0.den) / a1.den);
-
-            if (den * (2 * x * a1.den + a0.den) > num * a1.den)
-                a1 = (AVRational) { x * a1.num + a0.num, x * a1.den + a0.den };
-            break;
-        }
-
-        a0  = a1;
-        a1  = (AVRational) { a2n, a2d };
-        num = den;
-        den = next_den;
-    }
-    av_assert2(av_gcd(a1.num, a1.den) <= 1U);
-
-    *dst_num = sign ? -a1.num : a1.num;
-    *dst_den = a1.den;
-
-    return den == 0;
-}
-
-AVRational av_mul_q(AVRational b, AVRational c)
-{
-    av_reduce(&b.num, &b.den,
-               b.num * (int64_t) c.num,
-               b.den * (int64_t) c.den, INT_MAX);
-    return b;
-}
-
-AVRational av_div_q(AVRational b, AVRational c)
-{
-    return av_mul_q(b, (AVRational) { c.den, c.num });
-}
-
-AVRational av_add_q(AVRational b, AVRational c) {
-    av_reduce(&b.num, &b.den,
-               b.num * (int64_t) c.den +
-               c.num * (int64_t) b.den,
-               b.den * (int64_t) c.den, INT_MAX);
-    return b;
-}
-
-AVRational av_sub_q(AVRational b, AVRational c)
-{
-    return av_add_q(b, (AVRational) { -c.num, c.den });
-}
-
-AVRational av_d2q(double d, int max)
-{
-    AVRational a;
-#define LOG2  0.69314718055994530941723212145817656807550013436025
-    int exponent;
-    int64_t den;
-    if (isnan(d))
-        return (AVRational) { 0,0 };
-    if (isinf(d))
-        return (AVRational) { d < 0 ? -1 : 1, 0 };
-    exponent = FFMAX( (int)(log(fabs(d) + 1e-20)/LOG2), 0);
-    den = 1LL << (61 - exponent);
-    av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max);
-
-    return a;
-}
-
-int av_nearer_q(AVRational q, AVRational q1, AVRational q2)
-{
-    /* n/d is q, a/b is the median between q1 and q2 */
-    int64_t a = q1.num * (int64_t)q2.den + q2.num * (int64_t)q1.den;
-    int64_t b = 2 * (int64_t)q1.den * q2.den;
-
-    /* rnd_up(a*d/b) > n => a*d/b > n */
-    int64_t x_up = av_rescale_rnd(a, q.den, b, AV_ROUND_UP);
-
-    /* rnd_down(a*d/b) < n => a*d/b < n */
-    int64_t x_down = av_rescale_rnd(a, q.den, b, AV_ROUND_DOWN);
-
-    return ((x_up > q.num) - (x_down < q.num)) * av_cmp_q(q2, q1);
-}
-
-int av_find_nearest_q_idx(AVRational q, const AVRational* q_list)
-{
-    int i, nearest_q_idx = 0;
-    for (i = 0; q_list[i].den; i++)
-        if (av_nearer_q(q, q_list[i], q_list[nearest_q_idx]) > 0)
-            nearest_q_idx = i;
-
-    return nearest_q_idx;
-}
diff --git a/deps/libav/libavutil/rational.h b/deps/libav/libavutil/rational.h
deleted file mode 100644
index 5d7dab7..0000000
--- a/deps/libav/libavutil/rational.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * rational numbers
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * rational numbers
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVUTIL_RATIONAL_H
-#define AVUTIL_RATIONAL_H
-
-#include <stdint.h>
-#include <limits.h>
-#include "attributes.h"
-
-/**
- * @addtogroup lavu_math
- * @{
- */
-
-/**
- * rational number numerator/denominator
- */
-typedef struct AVRational{
-    int num; ///< numerator
-    int den; ///< denominator
-} AVRational;
-
-/**
- * Compare two rationals.
- * @param a first rational
- * @param b second rational
- * @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the
- * values is of the form 0/0
- */
-static inline int av_cmp_q(AVRational a, AVRational b){
-    const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
-
-    if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
-    else if(b.den && a.den) return 0;
-    else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
-    else                    return INT_MIN;
-}
-
-/**
- * Convert rational to double.
- * @param a rational to convert
- * @return (double) a
- */
-static inline double av_q2d(AVRational a){
-    return a.num / (double) a.den;
-}
-
-/**
- * Reduce a fraction.
- * This is useful for framerate calculations.
- * @param dst_num destination numerator
- * @param dst_den destination denominator
- * @param num source numerator
- * @param den source denominator
- * @param max the maximum allowed for dst_num & dst_den
- * @return 1 if exact, 0 otherwise
- */
-int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
-
-/**
- * Multiply two rationals.
- * @param b first rational
- * @param c second rational
- * @return b*c
- */
-AVRational av_mul_q(AVRational b, AVRational c) av_const;
-
-/**
- * Divide one rational by another.
- * @param b first rational
- * @param c second rational
- * @return b/c
- */
-AVRational av_div_q(AVRational b, AVRational c) av_const;
-
-/**
- * Add two rationals.
- * @param b first rational
- * @param c second rational
- * @return b+c
- */
-AVRational av_add_q(AVRational b, AVRational c) av_const;
-
-/**
- * Subtract one rational from another.
- * @param b first rational
- * @param c second rational
- * @return b-c
- */
-AVRational av_sub_q(AVRational b, AVRational c) av_const;
-
-/**
- * Invert a rational.
- * @param q value
- * @return 1 / q
- */
-static av_always_inline AVRational av_inv_q(AVRational q)
-{
-    AVRational r = { q.den, q.num };
-    return r;
-}
-
-/**
- * Convert a double precision floating point number to a rational.
- * inf is expressed as {1,0} or {-1,0} depending on the sign.
- *
- * @param d double to convert
- * @param max the maximum allowed numerator and denominator
- * @return (AVRational) d
- */
-AVRational av_d2q(double d, int max) av_const;
-
-/**
- * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
- * than q1, 0 if they have the same distance.
- */
-int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
-
-/**
- * Find the nearest value in q_list to q.
- * @param q_list an array of rationals terminated by {0, 0}
- * @return the index of the nearest value found in the array
- */
-int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_RATIONAL_H */
diff --git a/deps/libav/libavutil/rc4.c b/deps/libav/libavutil/rc4.c
deleted file mode 100644
index 3bf710f..0000000
--- a/deps/libav/libavutil/rc4.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * RC4 encryption/decryption/pseudo-random number generator
- * Copyright (c) 2007 Reimar Doeffinger
- *
- * loosely based on LibTomCrypt by Tom St Denis
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avutil.h"
-#include "common.h"
-#include "rc4.h"
-
-typedef struct AVRC4 AVRC4;
-
-int av_rc4_init(AVRC4 *r, const uint8_t *key, int key_bits, int decrypt) {
-    int i, j;
-    uint8_t y;
-    uint8_t *state = r->state;
-    int keylen = key_bits >> 3;
-    if (key_bits & 7)
-        return -1;
-    for (i = 0; i < 256; i++)
-        state[i] = i;
-    y = 0;
-    // j is i % keylen
-    for (j = 0, i = 0; i < 256; i++, j++) {
-        if (j == keylen) j = 0;
-        y += state[i] + key[j];
-        FFSWAP(uint8_t, state[i], state[y]);
-    }
-    r->x = 1;
-    r->y = state[1];
-    return 0;
-}
-
-void av_rc4_crypt(AVRC4 *r, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt) {
-    uint8_t x = r->x, y = r->y;
-    uint8_t *state = r->state;
-    while (count-- > 0) {
-        uint8_t sum = state[x] + state[y];
-        FFSWAP(uint8_t, state[x], state[y]);
-        *dst++ = src ? *src++ ^ state[sum] : state[sum];
-        x++;
-        y += state[x];
-    }
-    r->x = x; r->y = y;
-}
diff --git a/deps/libav/libavutil/rc4.h b/deps/libav/libavutil/rc4.h
deleted file mode 100644
index ec3b47c..0000000
--- a/deps/libav/libavutil/rc4.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * RC4 encryption/decryption/pseudo-random number generator
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_RC4_H
-#define AVUTIL_RC4_H
-
-#include <stdint.h>
-
-struct AVRC4 {
-    uint8_t state[256];
-    int x, y;
-};
-
-/**
- * @brief Initializes an AVRC4 context.
- *
- * @param key_bits must be a multiple of 8
- * @param decrypt 0 for encryption, 1 for decryption, currently has no effect
- */
-int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt);
-
-/**
- * @brief Encrypts / decrypts using the RC4 algorithm.
- *
- * @param count number of bytes
- * @param dst destination array, can be equal to src
- * @param src source array, can be equal to dst, may be NULL
- * @param iv not (yet) used for RC4, should be NULL
- * @param decrypt 0 for encryption, 1 for decryption, not (yet) used
- */
-void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
-
-#endif /* AVUTIL_RC4_H */
diff --git a/deps/libav/libavutil/samplefmt.c b/deps/libav/libavutil/samplefmt.c
deleted file mode 100644
index bff6004..0000000
--- a/deps/libav/libavutil/samplefmt.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "common.h"
-#include "samplefmt.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef struct SampleFmtInfo {
-    const char *name;
-    int bits;
-    int planar;
-    enum AVSampleFormat altform; ///< planar<->packed alternative form
-} SampleFmtInfo;
-
-/** this table gives more information about formats */
-static const SampleFmtInfo sample_fmt_info[AV_SAMPLE_FMT_NB] = {
-    [AV_SAMPLE_FMT_U8]   = { .name =   "u8", .bits =  8, .planar = 0, .altform = AV_SAMPLE_FMT_U8P  },
-    [AV_SAMPLE_FMT_S16]  = { .name =  "s16", .bits = 16, .planar = 0, .altform = AV_SAMPLE_FMT_S16P },
-    [AV_SAMPLE_FMT_S32]  = { .name =  "s32", .bits = 32, .planar = 0, .altform = AV_SAMPLE_FMT_S32P },
-    [AV_SAMPLE_FMT_FLT]  = { .name =  "flt", .bits = 32, .planar = 0, .altform = AV_SAMPLE_FMT_FLTP },
-    [AV_SAMPLE_FMT_DBL]  = { .name =  "dbl", .bits = 64, .planar = 0, .altform = AV_SAMPLE_FMT_DBLP },
-    [AV_SAMPLE_FMT_U8P]  = { .name =  "u8p", .bits =  8, .planar = 1, .altform = AV_SAMPLE_FMT_U8   },
-    [AV_SAMPLE_FMT_S16P] = { .name = "s16p", .bits = 16, .planar = 1, .altform = AV_SAMPLE_FMT_S16  },
-    [AV_SAMPLE_FMT_S32P] = { .name = "s32p", .bits = 32, .planar = 1, .altform = AV_SAMPLE_FMT_S32  },
-    [AV_SAMPLE_FMT_FLTP] = { .name = "fltp", .bits = 32, .planar = 1, .altform = AV_SAMPLE_FMT_FLT  },
-    [AV_SAMPLE_FMT_DBLP] = { .name = "dblp", .bits = 64, .planar = 1, .altform = AV_SAMPLE_FMT_DBL  },
-};
-
-const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
-{
-    if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
-        return NULL;
-    return sample_fmt_info[sample_fmt].name;
-}
-
-enum AVSampleFormat av_get_sample_fmt(const char *name)
-{
-    int i;
-
-    for (i = 0; i < AV_SAMPLE_FMT_NB; i++)
-        if (!strcmp(sample_fmt_info[i].name, name))
-            return i;
-    return AV_SAMPLE_FMT_NONE;
-}
-
-enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt)
-{
-    if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
-        return AV_SAMPLE_FMT_NONE;
-    if (sample_fmt_info[sample_fmt].planar)
-        return sample_fmt_info[sample_fmt].altform;
-    return sample_fmt;
-}
-
-enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt)
-{
-    if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
-        return AV_SAMPLE_FMT_NONE;
-    if (sample_fmt_info[sample_fmt].planar)
-        return sample_fmt;
-    return sample_fmt_info[sample_fmt].altform;
-}
-
-char *av_get_sample_fmt_string (char *buf, int buf_size, enum AVSampleFormat sample_fmt)
-{
-    /* print header */
-    if (sample_fmt < 0)
-        snprintf(buf, buf_size, "name  " " depth");
-    else if (sample_fmt < AV_SAMPLE_FMT_NB) {
-        SampleFmtInfo info = sample_fmt_info[sample_fmt];
-        snprintf (buf, buf_size, "%-6s" "   %2d ", info.name, info.bits);
-    }
-
-    return buf;
-}
-
-int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
-{
-     return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ?
-        0 : sample_fmt_info[sample_fmt].bits >> 3;
-}
-
-int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
-{
-     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
-         return 0;
-     return sample_fmt_info[sample_fmt].planar;
-}
-
-int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
-                               enum AVSampleFormat sample_fmt, int align)
-{
-    int line_size;
-    int sample_size = av_get_bytes_per_sample(sample_fmt);
-    int planar      = av_sample_fmt_is_planar(sample_fmt);
-
-    /* validate parameter ranges */
-    if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
-        return AVERROR(EINVAL);
-
-    /* auto-select alignment if not specified */
-    if (!align) {
-        if (nb_samples > INT_MAX - 31)
-            return AVERROR(EINVAL);
-        align = 1;
-        nb_samples = FFALIGN(nb_samples, 32);
-    }
-
-    /* check for integer overflow */
-    if (nb_channels > INT_MAX / align ||
-        (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)
-        return AVERROR(EINVAL);
-
-    line_size = planar ? FFALIGN(nb_samples * sample_size,               align) :
-                         FFALIGN(nb_samples * sample_size * nb_channels, align);
-    if (linesize)
-        *linesize = line_size;
-
-    return planar ? line_size * nb_channels : line_size;
-}
-
-int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
-                           const uint8_t *buf, int nb_channels, int nb_samples,
-                           enum AVSampleFormat sample_fmt, int align)
-{
-    int ch, planar, buf_size, line_size;
-
-    planar   = av_sample_fmt_is_planar(sample_fmt);
-    buf_size = av_samples_get_buffer_size(&line_size, nb_channels, nb_samples,
-                                          sample_fmt, align);
-    if (buf_size < 0)
-        return buf_size;
-
-    audio_data[0] = buf;
-    for (ch = 1; planar && ch < nb_channels; ch++)
-        audio_data[ch] = audio_data[ch-1] + line_size;
-
-    if (linesize)
-        *linesize = line_size;
-
-    return 0;
-}
-
-int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
-                     int nb_samples, enum AVSampleFormat sample_fmt, int align)
-{
-    uint8_t *buf;
-    int size = av_samples_get_buffer_size(NULL, nb_channels, nb_samples,
-                                          sample_fmt, align);
-    if (size < 0)
-        return size;
-
-    buf = av_malloc(size);
-    if (!buf)
-        return AVERROR(ENOMEM);
-
-    size = av_samples_fill_arrays(audio_data, linesize, buf, nb_channels,
-                                  nb_samples, sample_fmt, align);
-    if (size < 0) {
-        av_free(buf);
-        return size;
-    }
-
-    av_samples_set_silence(audio_data, 0, nb_samples, nb_channels, sample_fmt);
-
-    return 0;
-}
-
-int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
-                    int src_offset, int nb_samples, int nb_channels,
-                    enum AVSampleFormat sample_fmt)
-{
-    int planar      = av_sample_fmt_is_planar(sample_fmt);
-    int planes      = planar ? nb_channels : 1;
-    int block_align = av_get_bytes_per_sample(sample_fmt) * (planar ? 1 : nb_channels);
-    int data_size   = nb_samples * block_align;
-    int i;
-
-    dst_offset *= block_align;
-    src_offset *= block_align;
-
-    for (i = 0; i < planes; i++)
-        memcpy(dst[i] + dst_offset, src[i] + src_offset, data_size);
-
-    return 0;
-}
-
-int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
-                           int nb_channels, enum AVSampleFormat sample_fmt)
-{
-    int planar      = av_sample_fmt_is_planar(sample_fmt);
-    int planes      = planar ? nb_channels : 1;
-    int block_align = av_get_bytes_per_sample(sample_fmt) * (planar ? 1 : nb_channels);
-    int data_size   = nb_samples * block_align;
-    int fill_char   = (sample_fmt == AV_SAMPLE_FMT_U8 ||
-                     sample_fmt == AV_SAMPLE_FMT_U8P) ? 0x80 : 0x00;
-    int i;
-
-    offset *= block_align;
-
-    for (i = 0; i < planes; i++)
-        memset(audio_data[i] + offset, fill_char, data_size);
-
-    return 0;
-}
diff --git a/deps/libav/libavutil/samplefmt.h b/deps/libav/libavutil/samplefmt.h
deleted file mode 100644
index 33cbded..0000000
--- a/deps/libav/libavutil/samplefmt.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_SAMPLEFMT_H
-#define AVUTIL_SAMPLEFMT_H
-
-#include <stdint.h>
-
-#include "avutil.h"
-#include "attributes.h"
-
-/**
- * Audio Sample Formats
- *
- * @par
- * The data described by the sample format is always in native-endian order.
- * Sample values can be expressed by native C types, hence the lack of a signed
- * 24-bit sample format even though it is a common raw audio data format.
- *
- * @par
- * The floating-point formats are based on full volume being in the range
- * [-1.0, 1.0]. Any values outside this range are beyond full volume level.
- *
- * @par
- * The data layout as used in av_samples_fill_arrays() and elsewhere in Libav
- * (such as AVFrame in libavcodec) is as follows:
- *
- * For planar sample formats, each audio channel is in a separate data plane,
- * and linesize is the buffer size, in bytes, for a single plane. All data
- * planes must be the same size. For packed sample formats, only the first data
- * plane is used, and samples for each channel are interleaved. In this case,
- * linesize is the buffer size, in bytes, for the 1 plane.
- */
-enum AVSampleFormat {
-    AV_SAMPLE_FMT_NONE = -1,
-    AV_SAMPLE_FMT_U8,          ///< unsigned 8 bits
-    AV_SAMPLE_FMT_S16,         ///< signed 16 bits
-    AV_SAMPLE_FMT_S32,         ///< signed 32 bits
-    AV_SAMPLE_FMT_FLT,         ///< float
-    AV_SAMPLE_FMT_DBL,         ///< double
-
-    AV_SAMPLE_FMT_U8P,         ///< unsigned 8 bits, planar
-    AV_SAMPLE_FMT_S16P,        ///< signed 16 bits, planar
-    AV_SAMPLE_FMT_S32P,        ///< signed 32 bits, planar
-    AV_SAMPLE_FMT_FLTP,        ///< float, planar
-    AV_SAMPLE_FMT_DBLP,        ///< double, planar
-
-    AV_SAMPLE_FMT_NB           ///< Number of sample formats. DO NOT USE if linking dynamically
-};
-
-/**
- * Return the name of sample_fmt, or NULL if sample_fmt is not
- * recognized.
- */
-const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
-
-/**
- * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
- * on error.
- */
-enum AVSampleFormat av_get_sample_fmt(const char *name);
-
-/**
- * Get the packed alternative form of the given sample format.
- *
- * If the passed sample_fmt is already in packed format, the format returned is
- * the same as the input.
- *
- * @return  the packed alternative form of the given sample format or
-            AV_SAMPLE_FMT_NONE on error.
- */
-enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt);
-
-/**
- * Get the planar alternative form of the given sample format.
- *
- * If the passed sample_fmt is already in planar format, the format returned is
- * the same as the input.
- *
- * @return  the planar alternative form of the given sample format or
-            AV_SAMPLE_FMT_NONE on error.
- */
-enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt);
-
-/**
- * Generate a string corresponding to the sample format with
- * sample_fmt, or a header if sample_fmt is negative.
- *
- * @param buf the buffer where to write the string
- * @param buf_size the size of buf
- * @param sample_fmt the number of the sample format to print the
- * corresponding info string, or a negative value to print the
- * corresponding header.
- * @return the pointer to the filled buffer or NULL if sample_fmt is
- * unknown or in case of other errors
- */
-char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
-
-/**
- * Return number of bytes per sample.
- *
- * @param sample_fmt the sample format
- * @return number of bytes per sample or zero if unknown for the given
- * sample format
- */
-int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
-
-/**
- * Check if the sample format is planar.
- *
- * @param sample_fmt the sample format to inspect
- * @return 1 if the sample format is planar, 0 if it is interleaved
- */
-int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
-
-/**
- * Get the required buffer size for the given audio parameters.
- *
- * @param[out] linesize calculated linesize, may be NULL
- * @param nb_channels   the number of channels
- * @param nb_samples    the number of samples in a single channel
- * @param sample_fmt    the sample format
- * @param align         buffer size alignment (0 = default, 1 = no alignment)
- * @return              required buffer size, or negative error code on failure
- */
-int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
-                               enum AVSampleFormat sample_fmt, int align);
-
-/**
- * Fill channel data pointers and linesize for samples with sample
- * format sample_fmt.
- *
- * The pointers array is filled with the pointers to the samples data:
- * for planar, set the start point of each channel's data within the buffer,
- * for packed, set the start point of the entire buffer only.
- *
- * The linesize array is filled with the aligned size of each channel's data
- * buffer for planar layout, or the aligned size of the buffer for all channels
- * for packed layout.
- *
- * @see enum AVSampleFormat
- * The documentation for AVSampleFormat describes the data layout.
- *
- * @param[out] audio_data  array to be filled with the pointer for each channel
- * @param[out] linesize    calculated linesize, may be NULL
- * @param buf              the pointer to a buffer containing the samples
- * @param nb_channels      the number of channels
- * @param nb_samples       the number of samples in a single channel
- * @param sample_fmt       the sample format
- * @param align            buffer size alignment (0 = default, 1 = no alignment)
- * @return                 0 on success or a negative error code on failure
- */
-int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
-                           const uint8_t *buf,
-                           int nb_channels, int nb_samples,
-                           enum AVSampleFormat sample_fmt, int align);
-
-/**
- * Allocate a samples buffer for nb_samples samples, and fill data pointers and
- * linesize accordingly.
- * The allocated samples buffer can be freed by using av_freep(&audio_data[0])
- * Allocated data will be initialized to silence.
- *
- * @see enum AVSampleFormat
- * The documentation for AVSampleFormat describes the data layout.
- *
- * @param[out] audio_data  array to be filled with the pointer for each channel
- * @param[out] linesize    aligned size for audio buffer(s), may be NULL
- * @param nb_channels      number of audio channels
- * @param nb_samples       number of samples per channel
- * @param align            buffer size alignment (0 = default, 1 = no alignment)
- * @return                 0 on success or a negative error code on failure
- * @see av_samples_fill_arrays()
- */
-int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
-                     int nb_samples, enum AVSampleFormat sample_fmt, int align);
-
-/**
- * Copy samples from src to dst.
- *
- * @param dst destination array of pointers to data planes
- * @param src source array of pointers to data planes
- * @param dst_offset offset in samples at which the data will be written to dst
- * @param src_offset offset in samples at which the data will be read from src
- * @param nb_samples number of samples to be copied
- * @param nb_channels number of audio channels
- * @param sample_fmt audio sample format
- */
-int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
-                    int src_offset, int nb_samples, int nb_channels,
-                    enum AVSampleFormat sample_fmt);
-
-/**
- * Fill an audio buffer with silence.
- *
- * @param audio_data  array of pointers to data planes
- * @param offset      offset in samples at which to start filling
- * @param nb_samples  number of samples to fill
- * @param nb_channels number of audio channels
- * @param sample_fmt  audio sample format
- */
-int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
-                           int nb_channels, enum AVSampleFormat sample_fmt);
-
-#endif /* AVUTIL_SAMPLEFMT_H */
diff --git a/deps/libav/libavutil/sh4/bswap.h b/deps/libav/libavutil/sh4/bswap.h
deleted file mode 100644
index 1ff1bfd..0000000
--- a/deps/libav/libavutil/sh4/bswap.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * byte swapping routines
- */
-
-#ifndef AVUTIL_SH4_BSWAP_H
-#define AVUTIL_SH4_BSWAP_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#define av_bswap16 av_bswap16
-static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
-{
-    __asm__("swap.b %0,%0" : "+r"(x));
-    return x;
-}
-
-#define av_bswap32 av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-    __asm__("swap.b %0,%0\n"
-            "swap.w %0,%0\n"
-            "swap.b %0,%0\n"
-            : "+r"(x));
-    return x;
-}
-
-#endif /* AVUTIL_SH4_BSWAP_H */
diff --git a/deps/libav/libavutil/sha.c b/deps/libav/libavutil/sha.c
deleted file mode 100644
index 2d9b58c..0000000
--- a/deps/libav/libavutil/sha.c
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Copyright (C) 2007 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (C) 2009 Konstantin Shishkov
- * based on public domain SHA-1 code by Steve Reid <steve at edmweb.com>
- * and on BSD-licensed SHA-2 code by Aaron D. Gifford
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-
-#include "attributes.h"
-#include "avutil.h"
-#include "bswap.h"
-#include "sha.h"
-#include "intreadwrite.h"
-#include "mem.h"
-
-/** hash context */
-typedef struct AVSHA {
-    uint8_t  digest_len;  ///< digest length in 32-bit words
-    uint64_t count;       ///< number of bytes in buffer
-    uint8_t  buffer[64];  ///< 512-bit buffer of input values used in hash updating
-    uint32_t state[8];    ///< current hash value
-    /** function used to update hash for 512-bit input block */
-    void     (*transform)(uint32_t *state, const uint8_t buffer[64]);
-} AVSHA;
-
-#if FF_API_CONTEXT_SIZE
-const int av_sha_size = sizeof(AVSHA);
-#endif
-
-struct AVSHA *av_sha_alloc(void)
-{
-    return av_mallocz(sizeof(struct AVSHA));
-}
-
-#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
-
-/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
-#define blk0(i) (block[i] = AV_RB32(buffer + 4 * (i)))
-#define blk(i)  (block[i] = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1))
-
-#define R0(v,w,x,y,z,i) z += ((w&(x^y))^y)     + blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30);
-#define R1(v,w,x,y,z,i) z += ((w&(x^y))^y)     + blk (i) + 0x5A827999 + rol(v, 5); w = rol(w, 30);
-#define R2(v,w,x,y,z,i) z += ( w^x     ^y)     + blk (i) + 0x6ED9EBA1 + rol(v, 5); w = rol(w, 30);
-#define R3(v,w,x,y,z,i) z += (((w|x)&y)|(w&x)) + blk (i) + 0x8F1BBCDC + rol(v, 5); w = rol(w, 30);
-#define R4(v,w,x,y,z,i) z += ( w^x     ^y)     + blk (i) + 0xCA62C1D6 + rol(v, 5); w = rol(w, 30);
-
-/* Hash a single 512-bit block. This is the core of the algorithm. */
-
-static void sha1_transform(uint32_t state[5], const uint8_t buffer[64])
-{
-    uint32_t block[80];
-    unsigned int i, a, b, c, d, e;
-
-    a = state[0];
-    b = state[1];
-    c = state[2];
-    d = state[3];
-    e = state[4];
-#if CONFIG_SMALL
-    for (i = 0; i < 80; i++) {
-        int t;
-        if (i < 16)
-            t = AV_RB32(buffer + 4 * i);
-        else
-            t = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1);
-        block[i] = t;
-        t += e + rol(a, 5);
-        if (i < 40) {
-            if (i < 20)
-                t += ((b&(c^d))^d)     + 0x5A827999;
-            else
-                t += ( b^c     ^d)     + 0x6ED9EBA1;
-        } else {
-            if (i < 60)
-                t += (((b|c)&d)|(b&c)) + 0x8F1BBCDC;
-            else
-                t += ( b^c     ^d)     + 0xCA62C1D6;
-        }
-        e = d;
-        d = c;
-        c = rol(b, 30);
-        b = a;
-        a = t;
-    }
-#else
-    for (i = 0; i < 15; i += 5) {
-        R0(a, b, c, d, e, 0 + i);
-        R0(e, a, b, c, d, 1 + i);
-        R0(d, e, a, b, c, 2 + i);
-        R0(c, d, e, a, b, 3 + i);
-        R0(b, c, d, e, a, 4 + i);
-    }
-    R0(a, b, c, d, e, 15);
-    R1(e, a, b, c, d, 16);
-    R1(d, e, a, b, c, 17);
-    R1(c, d, e, a, b, 18);
-    R1(b, c, d, e, a, 19);
-    for (i = 20; i < 40; i += 5) {
-        R2(a, b, c, d, e, 0 + i);
-        R2(e, a, b, c, d, 1 + i);
-        R2(d, e, a, b, c, 2 + i);
-        R2(c, d, e, a, b, 3 + i);
-        R2(b, c, d, e, a, 4 + i);
-    }
-    for (; i < 60; i += 5) {
-        R3(a, b, c, d, e, 0 + i);
-        R3(e, a, b, c, d, 1 + i);
-        R3(d, e, a, b, c, 2 + i);
-        R3(c, d, e, a, b, 3 + i);
-        R3(b, c, d, e, a, 4 + i);
-    }
-    for (; i < 80; i += 5) {
-        R4(a, b, c, d, e, 0 + i);
-        R4(e, a, b, c, d, 1 + i);
-        R4(d, e, a, b, c, 2 + i);
-        R4(c, d, e, a, b, 3 + i);
-        R4(b, c, d, e, a, 4 + i);
-    }
-#endif
-    state[0] += a;
-    state[1] += b;
-    state[2] += c;
-    state[3] += d;
-    state[4] += e;
-}
-
-static const uint32_t K256[64] = {
-    0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
-    0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
-    0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
-    0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
-    0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
-    0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
-    0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
-    0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
-    0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
-    0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
-    0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
-    0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
-    0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
-    0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
-    0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
-    0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
-};
-
-
-#define Ch(x,y,z)   (((x) & ((y) ^ (z))) ^ (z))
-#define Maj(x,y,z)  ((((x) | (y)) & (z)) | ((x) & (y)))
-
-#define Sigma0_256(x)   (rol((x), 30) ^ rol((x), 19) ^ rol((x), 10))
-#define Sigma1_256(x)   (rol((x), 26) ^ rol((x), 21) ^ rol((x),  7))
-#define sigma0_256(x)   (rol((x), 25) ^ rol((x), 14) ^ ((x) >> 3))
-#define sigma1_256(x)   (rol((x), 15) ^ rol((x), 13) ^ ((x) >> 10))
-
-#undef blk
-#define blk(i)  (block[i] = block[i - 16] + sigma0_256(block[i - 15]) + \
-                            sigma1_256(block[i - 2]) + block[i - 7])
-
-#define ROUND256(a,b,c,d,e,f,g,h)   \
-    T1 += (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[i]; \
-    (d) += T1; \
-    (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
-    i++
-
-#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h)   \
-    T1 = blk0(i); \
-    ROUND256(a,b,c,d,e,f,g,h)
-
-#define ROUND256_16_TO_63(a,b,c,d,e,f,g,h)   \
-    T1 = blk(i); \
-    ROUND256(a,b,c,d,e,f,g,h)
-
-static void sha256_transform(uint32_t *state, const uint8_t buffer[64])
-{
-    unsigned int i, a, b, c, d, e, f, g, h;
-    uint32_t block[64];
-    uint32_t T1;
-
-    a = state[0];
-    b = state[1];
-    c = state[2];
-    d = state[3];
-    e = state[4];
-    f = state[5];
-    g = state[6];
-    h = state[7];
-#if CONFIG_SMALL
-    for (i = 0; i < 64; i++) {
-        uint32_t T2;
-        if (i < 16)
-            T1 = blk0(i);
-        else
-            T1 = blk(i);
-        T1 += h + Sigma1_256(e) + Ch(e, f, g) + K256[i];
-        T2 = Sigma0_256(a) + Maj(a, b, c);
-        h = g;
-        g = f;
-        f = e;
-        e = d + T1;
-        d = c;
-        c = b;
-        b = a;
-        a = T1 + T2;
-    }
-#else
-    for (i = 0; i < 16;) {
-        ROUND256_0_TO_15(a, b, c, d, e, f, g, h);
-        ROUND256_0_TO_15(h, a, b, c, d, e, f, g);
-        ROUND256_0_TO_15(g, h, a, b, c, d, e, f);
-        ROUND256_0_TO_15(f, g, h, a, b, c, d, e);
-        ROUND256_0_TO_15(e, f, g, h, a, b, c, d);
-        ROUND256_0_TO_15(d, e, f, g, h, a, b, c);
-        ROUND256_0_TO_15(c, d, e, f, g, h, a, b);
-        ROUND256_0_TO_15(b, c, d, e, f, g, h, a);
-    }
-
-    for (; i < 64;) {
-        ROUND256_16_TO_63(a, b, c, d, e, f, g, h);
-        ROUND256_16_TO_63(h, a, b, c, d, e, f, g);
-        ROUND256_16_TO_63(g, h, a, b, c, d, e, f);
-        ROUND256_16_TO_63(f, g, h, a, b, c, d, e);
-        ROUND256_16_TO_63(e, f, g, h, a, b, c, d);
-        ROUND256_16_TO_63(d, e, f, g, h, a, b, c);
-        ROUND256_16_TO_63(c, d, e, f, g, h, a, b);
-        ROUND256_16_TO_63(b, c, d, e, f, g, h, a);
-    }
-#endif
-    state[0] += a;
-    state[1] += b;
-    state[2] += c;
-    state[3] += d;
-    state[4] += e;
-    state[5] += f;
-    state[6] += g;
-    state[7] += h;
-}
-
-
-av_cold int av_sha_init(AVSHA *ctx, int bits)
-{
-    ctx->digest_len = bits >> 5;
-    switch (bits) {
-    case 160: // SHA-1
-        ctx->state[0] = 0x67452301;
-        ctx->state[1] = 0xEFCDAB89;
-        ctx->state[2] = 0x98BADCFE;
-        ctx->state[3] = 0x10325476;
-        ctx->state[4] = 0xC3D2E1F0;
-        ctx->transform = sha1_transform;
-        break;
-    case 224: // SHA-224
-        ctx->state[0] = 0xC1059ED8;
-        ctx->state[1] = 0x367CD507;
-        ctx->state[2] = 0x3070DD17;
-        ctx->state[3] = 0xF70E5939;
-        ctx->state[4] = 0xFFC00B31;
-        ctx->state[5] = 0x68581511;
-        ctx->state[6] = 0x64F98FA7;
-        ctx->state[7] = 0xBEFA4FA4;
-        ctx->transform = sha256_transform;
-        break;
-    case 256: // SHA-256
-        ctx->state[0] = 0x6A09E667;
-        ctx->state[1] = 0xBB67AE85;
-        ctx->state[2] = 0x3C6EF372;
-        ctx->state[3] = 0xA54FF53A;
-        ctx->state[4] = 0x510E527F;
-        ctx->state[5] = 0x9B05688C;
-        ctx->state[6] = 0x1F83D9AB;
-        ctx->state[7] = 0x5BE0CD19;
-        ctx->transform = sha256_transform;
-        break;
-    default:
-        return -1;
-    }
-    ctx->count = 0;
-    return 0;
-}
-
-void av_sha_update(AVSHA* ctx, const uint8_t* data, unsigned int len)
-{
-    unsigned int i, j;
-
-    j = ctx->count & 63;
-    ctx->count += len;
-#if CONFIG_SMALL
-    for (i = 0; i < len; i++) {
-        ctx->buffer[j++] = data[i];
-        if (64 == j) {
-            ctx->transform(ctx->state, ctx->buffer);
-            j = 0;
-        }
-    }
-#else
-    if ((j + len) > 63) {
-        memcpy(&ctx->buffer[j], data, (i = 64 - j));
-        ctx->transform(ctx->state, ctx->buffer);
-        for (; i + 63 < len; i += 64)
-            ctx->transform(ctx->state, &data[i]);
-        j = 0;
-    } else
-        i = 0;
-    memcpy(&ctx->buffer[j], &data[i], len - i);
-#endif
-}
-
-void av_sha_final(AVSHA* ctx, uint8_t *digest)
-{
-    int i;
-    uint64_t finalcount = av_be2ne64(ctx->count << 3);
-
-    av_sha_update(ctx, "\200", 1);
-    while ((ctx->count & 63) != 56)
-        av_sha_update(ctx, "", 1);
-    av_sha_update(ctx, (uint8_t *)&finalcount, 8); /* Should cause a transform() */
-    for (i = 0; i < ctx->digest_len; i++)
-        AV_WB32(digest + i*4, ctx->state[i]);
-}
-
-#ifdef TEST
-#include <stdio.h>
-
-int main(void)
-{
-    int i, j, k;
-    AVSHA ctx;
-    unsigned char digest[32];
-    const int lengths[3] = { 160, 224, 256 };
-
-    for (j = 0; j < 3; j++) {
-        printf("Testing SHA-%d\n", lengths[j]);
-        for (k = 0; k < 3; k++) {
-            av_sha_init(&ctx, lengths[j]);
-            if (k == 0)
-                av_sha_update(&ctx, "abc", 3);
-            else if (k == 1)
-                av_sha_update(&ctx, "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 56);
-            else
-                for (i = 0; i < 1000*1000; i++)
-                    av_sha_update(&ctx, "a", 1);
-            av_sha_final(&ctx, digest);
-            for (i = 0; i < lengths[j] >> 3; i++)
-                printf("%02X", digest[i]);
-            putchar('\n');
-        }
-        switch (j) {
-        case 0:
-            //test vectors (from FIPS PUB 180-1)
-            printf("A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D\n"
-                   "84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1\n"
-                   "34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F\n");
-            break;
-        case 1:
-            //test vectors (from FIPS PUB 180-2 Appendix A)
-            printf("23097d22 3405d822 8642a477 bda255b3 2aadbce4 bda0b3f7 e36c9da7\n"
-                   "75388b16 512776cc 5dba5da1 fd890150 b0c6455c b4f58b19 52522525\n"
-                   "20794655 980c91d8 bbb4c1ea 97618a4b f03f4258 1948b2ee 4ee7ad67\n");
-            break;
-        case 2:
-            //test vectors (from FIPS PUB 180-2)
-            printf("ba7816bf 8f01cfea 414140de 5dae2223 b00361a3 96177a9c b410ff61 f20015ad\n"
-                   "248d6a61 d20638b8 e5c02693 0c3e6039 a33ce459 64ff2167 f6ecedd4 19db06c1\n"
-                   "cdc76e5c 9914fb92 81a1c7e2 84d73e67 f1809a48 a497200e 046d39cc c7112cd0\n");
-            break;
-        }
-    }
-
-    return 0;
-}
-#endif
diff --git a/deps/libav/libavutil/sha.h b/deps/libav/libavutil/sha.h
deleted file mode 100644
index 4c9a0c9..0000000
--- a/deps/libav/libavutil/sha.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2007 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_SHA_H
-#define AVUTIL_SHA_H
-
-#include <stdint.h>
-
-#include "attributes.h"
-#include "version.h"
-
-/**
- * @defgroup lavu_sha SHA
- * @ingroup lavu_crypto
- * @{
- */
-
-#if FF_API_CONTEXT_SIZE
-extern attribute_deprecated const int av_sha_size;
-#endif
-
-struct AVSHA;
-
-/**
- * Allocate an AVSHA context.
- */
-struct AVSHA *av_sha_alloc(void);
-
-/**
- * Initialize SHA-1 or SHA-2 hashing.
- *
- * @param context pointer to the function context (of size av_sha_size)
- * @param bits    number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
- * @return        zero if initialization succeeded, -1 otherwise
- */
-int av_sha_init(struct AVSHA* context, int bits);
-
-/**
- * Update hash value.
- *
- * @param context hash function context
- * @param data    input data to update hash with
- * @param len     input data length
- */
-void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len);
-
-/**
- * Finish hashing and output digest value.
- *
- * @param context hash function context
- * @param digest  buffer where output digest value is stored
- */
-void av_sha_final(struct AVSHA* context, uint8_t *digest);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_SHA_H */
diff --git a/deps/libav/libavutil/stereo3d.c b/deps/libav/libavutil/stereo3d.c
deleted file mode 100644
index 850fd75..0000000
--- a/deps/libav/libavutil/stereo3d.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "mem.h"
-#include "stereo3d.h"
-
-AVStereo3D *av_stereo3d_alloc(void)
-{
-    return av_mallocz(sizeof(AVStereo3D));
-}
-
-AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame)
-{
-    AVFrameSideData *side_data = av_frame_new_side_data(frame,
-                                                        AV_FRAME_DATA_STEREO3D,
-                                                        sizeof(AVStereo3D));
-    if (!side_data)
-        return NULL;
-
-    return (AVStereo3D *)side_data->data;
-}
diff --git a/deps/libav/libavutil/stereo3d.h b/deps/libav/libavutil/stereo3d.h
deleted file mode 100644
index 695d6f1..0000000
--- a/deps/libav/libavutil/stereo3d.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "frame.h"
-
-/**
- * List of possible 3D Types
- */
-enum AVStereo3DType {
-    /**
-     * Video is not stereoscopic (and metadata has to be there).
-     */
-    AV_STEREO3D_2D,
-
-    /**
-     * Views are next to each other.
-     *
-     *    LLLLRRRR
-     *    LLLLRRRR
-     *    LLLLRRRR
-     *    ...
-     */
-    AV_STEREO3D_SIDEBYSIDE,
-
-    /**
-     * Views are on top of each other.
-     *
-     *    LLLLLLLL
-     *    LLLLLLLL
-     *    RRRRRRRR
-     *    RRRRRRRR
-     */
-    AV_STEREO3D_TOPBOTTOM,
-
-    /**
-     * Views are alternated temporally.
-     *
-     *     frame0   frame1   frame2   ...
-     *    LLLLLLLL RRRRRRRR LLLLLLLL
-     *    LLLLLLLL RRRRRRRR LLLLLLLL
-     *    LLLLLLLL RRRRRRRR LLLLLLLL
-     *    ...      ...      ...
-     */
-    AV_STEREO3D_FRAMESEQUENCE,
-
-    /**
-     * Views are packed in a checkerboard-like structure per pixel.
-     *
-     *    LRLRLRLR
-     *    RLRLRLRL
-     *    LRLRLRLR
-     *    ...
-     */
-    AV_STEREO3D_CHECKERBOARD,
-
-    /**
-     * Views are next to each other, but when upscaling
-     * apply a checkerboard pattern.
-     *
-     *     LLLLRRRR          L L L L    R R R R
-     *     LLLLRRRR    =>     L L L L  R R R R
-     *     LLLLRRRR          L L L L    R R R R
-     *     LLLLRRRR           L L L L  R R R R
-     */
-    AV_STEREO3D_SIDEBYSIDE_QUINCUNX,
-
-    /**
-     * Views are packed per line, as if interlaced.
-     *
-     *    LLLLLLLL
-     *    RRRRRRRR
-     *    LLLLLLLL
-     *    ...
-     */
-    AV_STEREO3D_LINES,
-
-    /**
-     * Views are packed per column.
-     *
-     *    LRLRLRLR
-     *    LRLRLRLR
-     *    LRLRLRLR
-     *    ...
-     */
-    AV_STEREO3D_COLUMNS,
-};
-
-
-/**
- * Inverted views, Right/Bottom represents the left view.
- */
-#define AV_STEREO3D_FLAG_INVERT     (1 << 0)
-
-/**
- * Stereo 3D type: this structure describes how two videos are packed
- * within a single video surface, with additional information as needed.
- *
- * @note The struct must be allocated with av_stereo3d_alloc() and
- *       its size is not a part of the public ABI.
- */
-typedef struct AVStereo3D {
-    /**
-     * How views are packed within the video.
-     */
-    enum AVStereo3DType type;
-
-    /**
-     * Additional information about the frame packing.
-     */
-    int flags;
-} AVStereo3D;
-
-/**
- * Allocate an AVStereo3D structure and set its fields to default values.
- * The resulting struct can be freed using av_freep().
- *
- * @return An AVStereo3D filled with default values or NULL on failure.
- */
-AVStereo3D *av_stereo3d_alloc(void);
-
-/**
- * Allocate a complete AVFrameSideData and add it to the frame.
- *
- * @param frame The frame which side data is added to.
- *
- * @return The AVStereo3D structure to be filled by caller.
- */
-AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame);
diff --git a/deps/libav/libavutil/time.c b/deps/libav/libavutil/time.c
deleted file mode 100644
index 62cd445..0000000
--- a/deps/libav/libavutil/time.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include <stddef.h>
-#include <stdint.h>
-#include <time.h>
-#if HAVE_GETTIMEOFDAY
-#include <sys/time.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-#include "time.h"
-#include "error.h"
-
-int64_t av_gettime(void)
-{
-#if HAVE_GETTIMEOFDAY
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
-#elif HAVE_GETSYSTEMTIMEASFILETIME
-    FILETIME ft;
-    int64_t t;
-    GetSystemTimeAsFileTime(&ft);
-    t = (int64_t)ft.dwHighDateTime << 32 | ft.dwLowDateTime;
-    return t / 10 - 11644473600000000; /* Jan 1, 1601 */
-#else
-    return -1;
-#endif
-}
-
-int av_usleep(unsigned usec)
-{
-#if HAVE_NANOSLEEP
-    struct timespec ts = { usec / 1000000, usec % 1000000 * 1000 };
-    while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
-    return 0;
-#elif HAVE_USLEEP
-    return usleep(usec);
-#elif HAVE_SLEEP
-    Sleep(usec / 1000);
-    return 0;
-#else
-    return AVERROR(ENOSYS);
-#endif
-}
diff --git a/deps/libav/libavutil/time.h b/deps/libav/libavutil/time.h
deleted file mode 100644
index b01a97d..0000000
--- a/deps/libav/libavutil/time.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_TIME_H
-#define AVUTIL_TIME_H
-
-#include <stdint.h>
-
-/**
- * Get the current time in microseconds.
- */
-int64_t av_gettime(void);
-
-/**
- * Sleep for a period of time.  Although the duration is expressed in
- * microseconds, the actual delay may be rounded to the precision of the
- * system timer.
- *
- * @param  usec Number of microseconds to sleep.
- * @return zero on success or (negative) error code.
- */
-int av_usleep(unsigned usec);
-
-#endif /* AVUTIL_TIME_H */
diff --git a/deps/libav/libavutil/timer.h b/deps/libav/libavutil/timer.h
deleted file mode 100644
index d2c5001..0000000
--- a/deps/libav/libavutil/timer.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * high precision timer, useful to profile code
- */
-
-#ifndef AVUTIL_TIMER_H
-#define AVUTIL_TIMER_H
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "config.h"
-
-#include "log.h"
-
-#if   ARCH_ARM
-#   include "arm/timer.h"
-#elif ARCH_BFIN
-#   include "bfin/timer.h"
-#elif ARCH_PPC
-#   include "ppc/timer.h"
-#elif ARCH_X86
-#   include "x86/timer.h"
-#endif
-
-#if !defined(AV_READ_TIME) && HAVE_GETHRTIME
-#   define AV_READ_TIME gethrtime
-#endif
-
-#ifdef AV_READ_TIME
-#define START_TIMER                             \
-    uint64_t tend;                              \
-    uint64_t tstart = AV_READ_TIME();           \
-
-#define STOP_TIMER(id)                                                    \
-    tend = AV_READ_TIME();                                                \
-    {                                                                     \
-        static uint64_t tsum   = 0;                                       \
-        static int tcount      = 0;                                       \
-        static int tskip_count = 0;                                       \
-        if (tcount < 2                        ||                          \
-            tend - tstart < 8 * tsum / tcount ||                          \
-            tend - tstart < 2000) {                                       \
-            tsum+= tend - tstart;                                         \
-            tcount++;                                                     \
-        } else                                                            \
-            tskip_count++;                                                \
-        if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \
-            av_log(NULL, AV_LOG_ERROR,                                    \
-                   "%"PRIu64" decicycles in %s, %d runs, %d skips\n",     \
-                   tsum * 10 / tcount, id, tcount, tskip_count);          \
-        }                                                                 \
-    }
-#else
-#define START_TIMER
-#define STOP_TIMER(id) { }
-#endif
-
-#endif /* AVUTIL_TIMER_H */
diff --git a/deps/libav/libavutil/tomi/intreadwrite.h b/deps/libav/libavutil/tomi/intreadwrite.h
deleted file mode 100644
index baf592a..0000000
--- a/deps/libav/libavutil/tomi/intreadwrite.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2010 Mans Rullgard <mans at mansr.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_TOMI_INTREADWRITE_H
-#define AVUTIL_TOMI_INTREADWRITE_H
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#define AV_RB16 AV_RB16
-static av_always_inline uint16_t AV_RB16(const void *p)
-{
-    uint16_t v;
-    __asm__ ("loadacc,   (%1+) \n\t"
-             "rol8             \n\t"
-             "storeacc,  %0    \n\t"
-             "loadacc,   (%1+) \n\t"
-             "add,       %0    \n\t"
-             : "=r"(v), "+a"(p));
-    return v;
-}
-
-#define AV_WB16 AV_WB16
-static av_always_inline void AV_WB16(void *p, uint16_t v)
-{
-    __asm__ volatile ("loadacc,   %1    \n\t"
-                      "lsr8             \n\t"
-                      "storeacc,  (%0+) \n\t"
-                      "loadacc,   %1    \n\t"
-                      "storeacc,  (%0+) \n\t"
-                      : "+&a"(p) : "r"(v));
-}
-
-#define AV_RL16 AV_RL16
-static av_always_inline uint16_t AV_RL16(const void *p)
-{
-    uint16_t v;
-    __asm__ ("loadacc,   (%1+) \n\t"
-             "storeacc,  %0    \n\t"
-             "loadacc,   (%1+) \n\t"
-             "rol8             \n\t"
-             "add,       %0    \n\t"
-             : "=r"(v), "+a"(p));
-    return v;
-}
-
-#define AV_WL16 AV_WL16
-static av_always_inline void AV_WL16(void *p, uint16_t v)
-{
-    __asm__ volatile ("loadacc,   %1    \n\t"
-                      "storeacc,  (%0+) \n\t"
-                      "lsr8             \n\t"
-                      "storeacc,  (%0+) \n\t"
-                      : "+&a"(p) : "r"(v));
-}
-
-#define AV_RB32 AV_RB32
-static av_always_inline uint32_t AV_RB32(const void *p)
-{
-    uint32_t v;
-    __asm__ ("loadacc,   (%1+) \n\t"
-             "rol8             \n\t"
-             "rol8             \n\t"
-             "rol8             \n\t"
-             "storeacc,  %0    \n\t"
-             "loadacc,   (%1+) \n\t"
-             "rol8             \n\t"
-             "rol8             \n\t"
-             "add,       %0    \n\t"
-             "loadacc,   (%1+) \n\t"
-             "rol8             \n\t"
-             "add,       %0    \n\t"
-             "loadacc,   (%1+) \n\t"
-             "add,       %0    \n\t"
-             : "=r"(v), "+a"(p));
-    return v;
-}
-
-#define AV_WB32 AV_WB32
-static av_always_inline void AV_WB32(void *p, uint32_t v)
-{
-    __asm__ volatile ("loadacc,   #4    \n\t"
-                      "add,       %0    \n\t"
-                      "loadacc,   %1    \n\t"
-                      "storeacc,  (-%0) \n\t"
-                      "lsr8             \n\t"
-                      "storeacc,  (-%0) \n\t"
-                      "lsr8             \n\t"
-                      "storeacc,  (-%0) \n\t"
-                      "lsr8             \n\t"
-                      "storeacc,  (-%0) \n\t"
-                      : "+&a"(p) : "r"(v));
-}
-
-#define AV_RL32 AV_RL32
-static av_always_inline uint32_t AV_RL32(const void *p)
-{
-    uint32_t v;
-    __asm__ ("loadacc,   (%1+) \n\t"
-             "storeacc,  %0    \n\t"
-             "loadacc,   (%1+) \n\t"
-             "rol8             \n\t"
-             "add,       %0    \n\t"
-             "loadacc,   (%1+) \n\t"
-             "rol8             \n\t"
-             "rol8             \n\t"
-             "add,       %0    \n\t"
-             "loadacc,   (%1+) \n\t"
-             "rol8             \n\t"
-             "rol8             \n\t"
-             "rol8             \n\t"
-             "add,       %0    \n\t"
-             : "=r"(v), "+a"(p));
-    return v;
-}
-
-#define AV_WL32 AV_WL32
-static av_always_inline void AV_WL32(void *p, uint32_t v)
-{
-    __asm__ volatile ("loadacc,   %1    \n\t"
-                      "storeacc,  (%0+) \n\t"
-                      "lsr8             \n\t"
-                      "storeacc,  (%0+) \n\t"
-                      "lsr8             \n\t"
-                      "storeacc,  (%0+) \n\t"
-                      "lsr8             \n\t"
-                      "storeacc,  (%0+) \n\t"
-                      : "+&a"(p) : "r"(v));
-}
-
-#endif /* AVUTIL_TOMI_INTREADWRITE_H */
diff --git a/deps/libav/libavutil/tree.c b/deps/libav/libavutil/tree.c
deleted file mode 100644
index d48d01a..0000000
--- a/deps/libav/libavutil/tree.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "error.h"
-#include "log.h"
-#include "mem.h"
-#include "tree.h"
-
-typedef struct AVTreeNode {
-    struct AVTreeNode *child[2];
-    void *elem;
-    int state;
-} AVTreeNode;
-
-#if FF_API_CONTEXT_SIZE
-const int av_tree_node_size = sizeof(AVTreeNode);
-#endif
-
-struct AVTreeNode *av_tree_node_alloc(void)
-{
-    return av_mallocz(sizeof(struct AVTreeNode));
-}
-
-void *av_tree_find(const AVTreeNode *t, void *key,
-                   int (*cmp)(void *key, const void *b), void *next[2])
-{
-    if (t) {
-        unsigned int v = cmp(key, t->elem);
-        if (v) {
-            if (next)
-                next[v >> 31] = t->elem;
-            return av_tree_find(t->child[(v >> 31) ^ 1], key, cmp, next);
-        } else {
-            if (next) {
-                av_tree_find(t->child[0], key, cmp, next);
-                av_tree_find(t->child[1], key, cmp, next);
-            }
-            return t->elem;
-        }
-    }
-    return NULL;
-}
-
-void *av_tree_insert(AVTreeNode **tp, void *key,
-                     int (*cmp)(void *key, const void *b), AVTreeNode **next)
-{
-    AVTreeNode *t = *tp;
-    if (t) {
-        unsigned int v = cmp(t->elem, key);
-        void *ret;
-        if (!v) {
-            if (*next)
-                return t->elem;
-            else if (t->child[0] || t->child[1]) {
-                int i = !t->child[0];
-                void *next_elem[2];
-                av_tree_find(t->child[i], key, cmp, next_elem);
-                key = t->elem = next_elem[i];
-                v   = -i;
-            } else {
-                *next = t;
-                *tp   = NULL;
-                return NULL;
-            }
-        }
-        ret = av_tree_insert(&t->child[v >> 31], key, cmp, next);
-        if (!ret) {
-            int i              = (v >> 31) ^ !!*next;
-            AVTreeNode **child = &t->child[i];
-            t->state += 2 * i - 1;
-
-            if (!(t->state & 1)) {
-                if (t->state) {
-                    /* The following code is equivalent to
-                     * if ((*child)->state * 2 == -t->state)
-                     *     rotate(child, i ^ 1);
-                     * rotate(tp, i);
-                     *
-                     * with rotate():
-                     * static void rotate(AVTreeNode **tp, int i)
-                     * {
-                     *     AVTreeNode *t= *tp;
-                     *
-                     *     *tp = t->child[i];
-                     *     t->child[i] = t->child[i]->child[i ^ 1];
-                     *     (*tp)->child[i ^ 1] = t;
-                     *     i = 4 * t->state + 2 * (*tp)->state + 12;
-                     *     t->state     = ((0x614586 >> i) & 3) - 1;
-                     *     (*tp)->state = ((0x400EEA >> i) & 3) - 1 +
-                     *                    ((*tp)->state >> 1);
-                     * }
-                     * but such a rotate function is both bigger and slower
-                     */
-                    if ((*child)->state * 2 == -t->state) {
-                        *tp                    = (*child)->child[i ^ 1];
-                        (*child)->child[i ^ 1] = (*tp)->child[i];
-                        (*tp)->child[i]        = *child;
-                        *child                 = (*tp)->child[i ^ 1];
-                        (*tp)->child[i ^ 1]    = t;
-
-                        (*tp)->child[0]->state = -((*tp)->state > 0);
-                        (*tp)->child[1]->state = (*tp)->state < 0;
-                        (*tp)->state           = 0;
-                    } else {
-                        *tp                 = *child;
-                        *child              = (*child)->child[i ^ 1];
-                        (*tp)->child[i ^ 1] = t;
-                        if ((*tp)->state)
-                            t->state = 0;
-                        else
-                            t->state >>= 1;
-                        (*tp)->state = -t->state;
-                    }
-                }
-            }
-            if (!(*tp)->state ^ !!*next)
-                return key;
-        }
-        return ret;
-    } else {
-        *tp   = *next;
-        *next = NULL;
-        if (*tp) {
-            (*tp)->elem = key;
-            return NULL;
-        } else
-            return key;
-    }
-}
-
-void av_tree_destroy(AVTreeNode *t)
-{
-    if (t) {
-        av_tree_destroy(t->child[0]);
-        av_tree_destroy(t->child[1]);
-        av_free(t);
-    }
-}
-
-void av_tree_enumerate(AVTreeNode *t, void *opaque,
-                       int (*cmp)(void *opaque, void *elem),
-                       int (*enu)(void *opaque, void *elem))
-{
-    if (t) {
-        int v = cmp ? cmp(opaque, t->elem) : 0;
-        if (v >= 0)
-            av_tree_enumerate(t->child[0], opaque, cmp, enu);
-        if (v == 0)
-            enu(opaque, t->elem);
-        if (v <= 0)
-            av_tree_enumerate(t->child[1], opaque, cmp, enu);
-    }
-}
-
-#ifdef TEST
-
-#include "common.h"
-#include "lfg.h"
-
-static int check(AVTreeNode *t)
-{
-    if (t) {
-        int left  = check(t->child[0]);
-        int right = check(t->child[1]);
-
-        if (left > 999 || right > 999)
-            return 1000;
-        if (right - left != t->state)
-            return 1000;
-        if (t->state > 1 || t->state < -1)
-            return 1000;
-        return FFMAX(left, right) + 1;
-    }
-    return 0;
-}
-
-static void print(AVTreeNode *t, int depth)
-{
-    int i;
-    for (i = 0; i < depth * 4; i++)
-        av_log(NULL, AV_LOG_ERROR, " ");
-    if (t) {
-        av_log(NULL, AV_LOG_ERROR, "Node %p %2d %p\n", t, t->state, t->elem);
-        print(t->child[0], depth + 1);
-        print(t->child[1], depth + 1);
-    } else
-        av_log(NULL, AV_LOG_ERROR, "NULL\n");
-}
-
-static int cmp(void *a, const void *b)
-{
-    return (uint8_t *) a - (const uint8_t *) b;
-}
-
-int main(void)
-{
-    int i;
-    AVTreeNode *root = NULL, *node = NULL;
-    AVLFG prng;
-
-    av_lfg_init(&prng, 1);
-
-    for (i = 0; i < 10000; i++) {
-        AVTreeNode *node2 = NULL;
-        intptr_t j = av_lfg_get(&prng) % 86294;
-        void *ret, *jj = (void *)(j + 1);
-
-        while (ret = av_tree_find(root, jj, cmp, NULL)) {
-            j  = av_lfg_get(&prng) % 86294;
-            jj = (void *)(j + 1);
-        }
-
-        if (check(root) > 999) {
-            av_log(NULL, AV_LOG_ERROR, "FATAL error %d\n", i);
-            print(root, 0);
-            return 1;
-        }
-
-        if (!node)
-            node = av_tree_node_alloc();
-        if (!node) {
-            av_log(NULL, AV_LOG_ERROR, "Memory allocation failure.\n");
-            return 1;
-        }
-        av_tree_insert(&root, jj, cmp, &node);
-
-        while (ret = av_tree_find(root, jj, cmp, NULL)) {
-            j  = av_lfg_get(&prng) % 86294;
-            jj = (void *)(j + 1);
-        }
-
-        ret = av_tree_insert(&root, jj, cmp, &node2);
-        if (ret != jj)
-            av_tree_destroy(node2);
-        ret = av_tree_find(root, jj, cmp, NULL);
-        if (ret)
-            av_log(NULL, AV_LOG_ERROR, "removal failure %d\n", i);
-    }
-
-    av_tree_destroy(root);
-
-    return 0;
-}
-#endif
diff --git a/deps/libav/libavutil/tree.h b/deps/libav/libavutil/tree.h
deleted file mode 100644
index 424656e..0000000
--- a/deps/libav/libavutil/tree.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * A tree container.
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
-#ifndef AVUTIL_TREE_H
-#define AVUTIL_TREE_H
-
-#include "attributes.h"
-#include "version.h"
-
-/**
- * @addtogroup lavu_tree AVTree
- * @ingroup lavu_data
- *
- * Low-complexity tree container
- *
- * Insertion, removal, finding equal, largest which is smaller than and
- * smallest which is larger than, all have O(log n) worst-case complexity.
- * @{
- */
-
-
-struct AVTreeNode;
-#if FF_API_CONTEXT_SIZE
-extern attribute_deprecated const int av_tree_node_size;
-#endif
-
-/**
- * Allocate an AVTreeNode.
- */
-struct AVTreeNode *av_tree_node_alloc(void);
-
-/**
- * Find an element.
- * @param root a pointer to the root node of the tree
- * @param next If next is not NULL, then next[0] will contain the previous
- *             element and next[1] the next element. If either does not exist,
- *             then the corresponding entry in next is unchanged.
- * @return An element with cmp(key, elem) == 0 or NULL if no such element
- *         exists in the tree.
- */
-void *av_tree_find(const struct AVTreeNode *root, void *key,
-                   int (*cmp)(void *key, const void *b), void *next[2]);
-
-/**
- * Insert or remove an element.
- * If *next is NULL, then the supplied element will be removed if it exists.
- * If *next is not NULL, then the supplied element will be inserted, unless
- * it already exists in the tree.
- * @param rootp A pointer to a pointer to the root node of the tree; note that
- *              the root node can change during insertions, this is required
- *              to keep the tree balanced.
- * @param next Used to allocate and free AVTreeNodes. For insertion the user
- *             must set it to an allocated and zeroed object of at least
- *             av_tree_node_size bytes size. av_tree_insert() will set it to
- *             NULL if it has been consumed.
- *             For deleting elements *next is set to NULL by the user and
- *             av_tree_node_size() will set it to the AVTreeNode which was
- *             used for the removed element.
- *             This allows the use of flat arrays, which have
- *             lower overhead compared to many malloced elements.
- *             You might want to define a function like:
- *             @code
- *             void *tree_insert(struct AVTreeNode **rootp, void *key,
- *                               int (*cmp)(void *key, const void *b),
- *                               AVTreeNode **next)
- *             {
- *                 if (!*next)
- *                     *next = av_mallocz(av_tree_node_size);
- *                 return av_tree_insert(rootp, key, cmp, next);
- *             }
- *             void *tree_remove(struct AVTreeNode **rootp, void *key,
- *                               int (*cmp)(void *key, const void *b, AVTreeNode **next))
- *             {
- *                 av_freep(next);
- *                 return av_tree_insert(rootp, key, cmp, next);
- *             }
- *             @endcode
- * @return If no insertion happened, the found element; if an insertion or
- *         removal happened, then either key or NULL will be returned.
- *         Which one it is depends on the tree state and the implementation. You
- *         should make no assumptions that it's one or the other in the code.
- */
-void *av_tree_insert(struct AVTreeNode **rootp, void *key,
-                     int (*cmp)(void *key, const void *b),
-                     struct AVTreeNode **next);
-
-void av_tree_destroy(struct AVTreeNode *t);
-
-/**
- * Apply enu(opaque, &elem) to all the elements in the tree in a given range.
- *
- * @param cmp a comparison function that returns < 0 for a element below the
- *            range, > 0 for a element above the range and == 0 for a
- *            element inside the range
- *
- * @note The cmp function should use the same ordering used to construct the
- *       tree.
- */
-void av_tree_enumerate(struct AVTreeNode *t, void *opaque,
-                       int (*cmp)(void *opaque, void *elem),
-                       int (*enu)(void *opaque, void *elem));
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_TREE_H */
diff --git a/deps/libav/libavutil/utils.c b/deps/libav/libavutil/utils.c
deleted file mode 100644
index 9b18c97..0000000
--- a/deps/libav/libavutil/utils.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "avutil.h"
-
-/**
- * @file
- * various utility functions
- */
-
-unsigned avutil_version(void)
-{
-    return LIBAVUTIL_VERSION_INT;
-}
-
-const char *avutil_configuration(void)
-{
-    return LIBAV_CONFIGURATION;
-}
-
-const char *avutil_license(void)
-{
-#define LICENSE_PREFIX "libavutil license: "
-    return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
-}
-
-char av_get_picture_type_char(enum AVPictureType pict_type)
-{
-    switch (pict_type) {
-    case AV_PICTURE_TYPE_I:  return 'I';
-    case AV_PICTURE_TYPE_P:  return 'P';
-    case AV_PICTURE_TYPE_B:  return 'B';
-    case AV_PICTURE_TYPE_S:  return 'S';
-    case AV_PICTURE_TYPE_SI: return 'i';
-    case AV_PICTURE_TYPE_SP: return 'p';
-    case AV_PICTURE_TYPE_BI: return 'b';
-    default:                 return '?';
-    }
-}
diff --git a/deps/libav/libavutil/version.h b/deps/libav/libavutil/version.h
deleted file mode 100644
index 5196a67..0000000
--- a/deps/libav/libavutil/version.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_VERSION_H
-#define AVUTIL_VERSION_H
-
-#include "macros.h"
-
-/**
- * @defgroup version_utils Library Version Macros
- *
- * Useful to check and match library version in order to maintain
- * backward compatibility.
- *
- * @{
- */
-
-#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
-#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
-#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
-
-/**
- * @}
- */
-
-/**
- * @file
- * @ingroup lavu
- * Libavutil version macros
- */
-
-/**
- * @defgroup lavu_ver Version and Build diagnostics
- *
- * Macros and function useful to check at compiletime and at runtime
- * which version of libavutil is in use.
- *
- * @{
- */
-
-#define LIBAVUTIL_VERSION_MAJOR 53
-#define LIBAVUTIL_VERSION_MINOR  3
-#define LIBAVUTIL_VERSION_MICRO  0
-
-#define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-                                               LIBAVUTIL_VERSION_MINOR, \
-                                               LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_VERSION       AV_VERSION(LIBAVUTIL_VERSION_MAJOR,     \
-                                           LIBAVUTIL_VERSION_MINOR,     \
-                                           LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_BUILD         LIBAVUTIL_VERSION_INT
-
-#define LIBAVUTIL_IDENT         "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
-
-/**
- * @}
- *
- * @defgroup depr_guards Deprecation guards
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- *
- * @{
- */
-
-#ifndef FF_API_PIX_FMT
-#define FF_API_PIX_FMT                  (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_CONTEXT_SIZE
-#define FF_API_CONTEXT_SIZE             (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_PIX_FMT_DESC
-#define FF_API_PIX_FMT_DESC             (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_AV_REVERSE
-#define FF_API_AV_REVERSE               (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_AUDIOCONVERT
-#define FF_API_AUDIOCONVERT             (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_CPU_FLAG_MMX2
-#define FF_API_CPU_FLAG_MMX2            (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_LLS_PRIVATE
-#define FF_API_LLS_PRIVATE              (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_AVFRAME_LAVC
-#define FF_API_AVFRAME_LAVC             (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_VDPAU
-#define FF_API_VDPAU                    (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-#ifndef FF_API_XVMC
-#define FF_API_XVMC                     (LIBAVUTIL_VERSION_MAJOR < 54)
-#endif
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_VERSION_H */
diff --git a/deps/libav/libavutil/x86/Makefile b/deps/libav/libavutil/x86/Makefile
deleted file mode 100644
index 1e19082..0000000
--- a/deps/libav/libavutil/x86/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-OBJS += x86/cpu.o                                                       \
-        x86/float_dsp_init.o                                            \
-        x86/lls_init.o                                                  \
-
-YASM-OBJS += x86/cpuid.o                                                \
-             x86/emms.o                                                 \
-             x86/float_dsp.o                                            \
-             x86/lls.o                                                  \
diff --git a/deps/libav/libavutil/x86/asm.h b/deps/libav/libavutil/x86/asm.h
deleted file mode 100644
index e30f5db..0000000
--- a/deps/libav/libavutil/x86/asm.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_X86_ASM_H
-#define AVUTIL_X86_ASM_H
-
-#include <stdint.h>
-#include "config.h"
-
-typedef struct xmm_reg { uint64_t a, b; } xmm_reg;
-
-#if ARCH_X86_64
-#    define OPSIZE "q"
-#    define REG_a "rax"
-#    define REG_b "rbx"
-#    define REG_c "rcx"
-#    define REG_d "rdx"
-#    define REG_D "rdi"
-#    define REG_S "rsi"
-#    define PTR_SIZE "8"
-typedef int64_t x86_reg;
-
-#    define REG_SP "rsp"
-#    define REG_BP "rbp"
-#    define REGBP   rbp
-#    define REGa    rax
-#    define REGb    rbx
-#    define REGc    rcx
-#    define REGd    rdx
-#    define REGSP   rsp
-
-#elif ARCH_X86_32
-
-#    define OPSIZE "l"
-#    define REG_a "eax"
-#    define REG_b "ebx"
-#    define REG_c "ecx"
-#    define REG_d "edx"
-#    define REG_D "edi"
-#    define REG_S "esi"
-#    define PTR_SIZE "4"
-typedef int32_t x86_reg;
-
-#    define REG_SP "esp"
-#    define REG_BP "ebp"
-#    define REGBP   ebp
-#    define REGa    eax
-#    define REGb    ebx
-#    define REGc    ecx
-#    define REGd    edx
-#    define REGSP   esp
-#else
-typedef int x86_reg;
-#endif
-
-#define HAVE_7REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE && HAVE_EBP_AVAILABLE))
-#define HAVE_6REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE || HAVE_EBP_AVAILABLE))
-
-#if ARCH_X86_64 && defined(PIC)
-#    define BROKEN_RELOCATIONS 1
-#endif
-
-/*
- * If gcc is not set to support sse (-msse) it will not accept xmm registers
- * in the clobber list for inline asm. XMM_CLOBBERS takes a list of xmm
- * registers to be marked as clobbered and evaluates to nothing if they are
- * not supported, or to the list itself if they are supported. Since a clobber
- * list may not be empty, XMM_CLOBBERS_ONLY should be used if the xmm
- * registers are the only in the clobber list.
- * For example a list with "eax" and "xmm0" as clobbers should become:
- * : XMM_CLOBBERS("xmm0",) "eax"
- * and a list with only "xmm0" should become:
- * XMM_CLOBBERS_ONLY("xmm0")
- */
-#if HAVE_XMM_CLOBBERS
-#    define XMM_CLOBBERS(...)        __VA_ARGS__
-#    define XMM_CLOBBERS_ONLY(...) : __VA_ARGS__
-#else
-#    define XMM_CLOBBERS(...)
-#    define XMM_CLOBBERS_ONLY(...)
-#endif
-
-/* Use to export labels from asm. */
-#define LABEL_MANGLE(a) EXTERN_PREFIX #a
-
-// Use rip-relative addressing if compiling PIC code on x86-64.
-#if ARCH_X86_64 && defined(PIC)
-#    define LOCAL_MANGLE(a) #a "(%%rip)"
-#else
-#    define LOCAL_MANGLE(a) #a
-#endif
-
-#define MANGLE(a) EXTERN_PREFIX LOCAL_MANGLE(a)
-
-#endif /* AVUTIL_X86_ASM_H */
diff --git a/deps/libav/libavutil/x86/bswap.h b/deps/libav/libavutil/x86/bswap.h
deleted file mode 100644
index c73be9a..0000000
--- a/deps/libav/libavutil/x86/bswap.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * byte swapping routines
- */
-
-#ifndef AVUTIL_X86_BSWAP_H
-#define AVUTIL_X86_BSWAP_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#if HAVE_INLINE_ASM
-
-#if !AV_GCC_VERSION_AT_LEAST(4,1)
-#define av_bswap16 av_bswap16
-static av_always_inline av_const unsigned av_bswap16(unsigned x)
-{
-    __asm__("rorw $8, %w0" : "+r"(x));
-    return x;
-}
-#endif /* !AV_GCC_VERSION_AT_LEAST(4,1) */
-
-#if !AV_GCC_VERSION_AT_LEAST(4,5)
-#define av_bswap32 av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-    __asm__("bswap   %0" : "+r" (x));
-    return x;
-}
-
-#if ARCH_X86_64
-#define av_bswap64 av_bswap64
-static inline uint64_t av_const av_bswap64(uint64_t x)
-{
-    __asm__("bswap  %0": "=r" (x) : "0" (x));
-    return x;
-}
-#endif
-#endif /* !AV_GCC_VERSION_AT_LEAST(4,5) */
-
-#endif /* HAVE_INLINE_ASM */
-#endif /* AVUTIL_X86_BSWAP_H */
diff --git a/deps/libav/libavutil/x86/cpu.c b/deps/libav/libavutil/x86/cpu.c
deleted file mode 100644
index 0e06d5d..0000000
--- a/deps/libav/libavutil/x86/cpu.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * CPU detection code, extracted from mmx.h
- * (c)1997-99 by H. Dietz and R. Fisher
- * Converted to C and improved by Fabrice Bellard.
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavutil/cpu.h"
-#include "libavutil/cpu_internal.h"
-
-#if HAVE_YASM
-
-#define cpuid(index, eax, ebx, ecx, edx)        \
-    ff_cpu_cpuid(index, &eax, &ebx, &ecx, &edx)
-
-#define xgetbv(index, eax, edx)                 \
-    ff_cpu_xgetbv(index, &eax, &edx)
-
-#elif HAVE_INLINE_ASM
-
-/* ebx saving is necessary for PIC. gcc seems unable to see it alone */
-#define cpuid(index, eax, ebx, ecx, edx)                        \
-    __asm__ volatile (                                          \
-        "mov    %%"REG_b", %%"REG_S" \n\t"                      \
-        "cpuid                       \n\t"                      \
-        "xchg   %%"REG_b", %%"REG_S                             \
-        : "=a" (eax), "=S" (ebx), "=c" (ecx), "=d" (edx)        \
-        : "0" (index))
-
-#define xgetbv(index, eax, edx)                                 \
-    __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index))
-
-#define get_eflags(x)                           \
-    __asm__ volatile ("pushfl     \n"           \
-                      "pop    %0  \n"           \
-                      : "=r"(x))
-
-#define set_eflags(x)                           \
-    __asm__ volatile ("push    %0 \n"           \
-                      "popfl      \n"           \
-                      :: "r"(x))
-
-#endif /* HAVE_INLINE_ASM */
-
-#if ARCH_X86_64
-
-#define cpuid_test() 1
-
-#elif HAVE_YASM
-
-#define cpuid_test ff_cpu_cpuid_test
-
-#elif HAVE_INLINE_ASM
-
-static int cpuid_test(void)
-{
-    x86_reg a, c;
-
-    /* Check if CPUID is supported by attempting to toggle the ID bit in
-     * the EFLAGS register. */
-    get_eflags(a);
-    set_eflags(a ^ 0x200000);
-    get_eflags(c);
-
-    return a != c;
-}
-#endif
-
-/* Function to test if multimedia instructions are supported...  */
-int ff_get_cpu_flags_x86(void)
-{
-    int rval = 0;
-
-#ifdef cpuid
-
-    int eax, ebx, ecx, edx;
-    int max_std_level, max_ext_level, std_caps = 0, ext_caps = 0;
-    int family = 0, model = 0;
-    union { int i[3]; char c[12]; } vendor;
-
-    if (!cpuid_test())
-        return 0; /* CPUID not supported */
-
-    cpuid(0, max_std_level, vendor.i[0], vendor.i[2], vendor.i[1]);
-
-    if (max_std_level >= 1) {
-        cpuid(1, eax, ebx, ecx, std_caps);
-        family = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
-        model  = ((eax >> 4) & 0xf) + ((eax >> 12) & 0xf0);
-        if (std_caps & (1 << 15))
-            rval |= AV_CPU_FLAG_CMOV;
-        if (std_caps & (1 << 23))
-            rval |= AV_CPU_FLAG_MMX;
-        if (std_caps & (1 << 25))
-            rval |= AV_CPU_FLAG_MMXEXT;
-#if HAVE_SSE
-        if (std_caps & (1 << 25))
-            rval |= AV_CPU_FLAG_SSE;
-        if (std_caps & (1 << 26))
-            rval |= AV_CPU_FLAG_SSE2;
-        if (ecx & 1)
-            rval |= AV_CPU_FLAG_SSE3;
-        if (ecx & 0x00000200 )
-            rval |= AV_CPU_FLAG_SSSE3;
-        if (ecx & 0x00080000 )
-            rval |= AV_CPU_FLAG_SSE4;
-        if (ecx & 0x00100000 )
-            rval |= AV_CPU_FLAG_SSE42;
-#if HAVE_AVX
-        /* Check OXSAVE and AVX bits */
-        if ((ecx & 0x18000000) == 0x18000000) {
-            /* Check for OS support */
-            xgetbv(0, eax, edx);
-            if ((eax & 0x6) == 0x6)
-                rval |= AV_CPU_FLAG_AVX;
-        }
-#if HAVE_AVX2
-    if (max_std_level >= 7) {
-        cpuid(7, eax, ebx, ecx, edx);
-        if (ebx&0x00000020)
-            rval |= AV_CPU_FLAG_AVX2;
-        /* TODO: BMI1/2 */
-    }
-#endif /* HAVE_AVX2 */
-#endif /* HAVE_AVX */
-#endif /* HAVE_SSE */
-    }
-
-    cpuid(0x80000000, max_ext_level, ebx, ecx, edx);
-
-    if (max_ext_level >= 0x80000001) {
-        cpuid(0x80000001, eax, ebx, ecx, ext_caps);
-        if (ext_caps & (1U << 31))
-            rval |= AV_CPU_FLAG_3DNOW;
-        if (ext_caps & (1 << 30))
-            rval |= AV_CPU_FLAG_3DNOWEXT;
-        if (ext_caps & (1 << 23))
-            rval |= AV_CPU_FLAG_MMX;
-        if (ext_caps & (1 << 22))
-            rval |= AV_CPU_FLAG_MMXEXT;
-
-        /* Allow for selectively disabling SSE2 functions on AMD processors
-           with SSE2 support but not SSE4a. This includes Athlon64, some
-           Opteron, and some Sempron processors. MMX, SSE, or 3DNow! are faster
-           than SSE2 often enough to utilize this special-case flag.
-           AV_CPU_FLAG_SSE2 and AV_CPU_FLAG_SSE2SLOW are both set in this case
-           so that SSE2 is used unless explicitly disabled by checking
-           AV_CPU_FLAG_SSE2SLOW. */
-        if (!strncmp(vendor.c, "AuthenticAMD", 12) &&
-            rval & AV_CPU_FLAG_SSE2 && !(ecx & 0x00000040)) {
-            rval |= AV_CPU_FLAG_SSE2SLOW;
-        }
-
-        /* XOP and FMA4 use the AVX instruction coding scheme, so they can't be
-         * used unless the OS has AVX support. */
-        if (rval & AV_CPU_FLAG_AVX) {
-            if (ecx & 0x00000800)
-                rval |= AV_CPU_FLAG_XOP;
-            if (ecx & 0x00010000)
-                rval |= AV_CPU_FLAG_FMA4;
-        }
-    }
-
-    if (!strncmp(vendor.c, "GenuineIntel", 12)) {
-        if (family == 6 && (model == 9 || model == 13 || model == 14)) {
-            /* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and
-             * 6/14 (core1 "yonah") theoretically support sse2, but it's
-             * usually slower than mmx, so let's just pretend they don't.
-             * AV_CPU_FLAG_SSE2 is disabled and AV_CPU_FLAG_SSE2SLOW is
-             * enabled so that SSE2 is not used unless explicitly enabled
-             * by checking AV_CPU_FLAG_SSE2SLOW. The same situation
-             * applies for AV_CPU_FLAG_SSE3 and AV_CPU_FLAG_SSE3SLOW. */
-            if (rval & AV_CPU_FLAG_SSE2)
-                rval ^= AV_CPU_FLAG_SSE2SLOW | AV_CPU_FLAG_SSE2;
-            if (rval & AV_CPU_FLAG_SSE3)
-                rval ^= AV_CPU_FLAG_SSE3SLOW | AV_CPU_FLAG_SSE3;
-        }
-        /* The Atom processor has SSSE3 support, which is useful in many cases,
-         * but sometimes the SSSE3 version is slower than the SSE2 equivalent
-         * on the Atom, but is generally faster on other processors supporting
-         * SSSE3. This flag allows for selectively disabling certain SSSE3
-         * functions on the Atom. */
-        if (family == 6 && model == 28)
-            rval |= AV_CPU_FLAG_ATOM;
-    }
-
-#endif /* cpuid */
-
-    return rval;
-}
diff --git a/deps/libav/libavutil/x86/cpu.h b/deps/libav/libavutil/x86/cpu.h
deleted file mode 100644
index 5303c5a..0000000
--- a/deps/libav/libavutil/x86/cpu.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_X86_CPU_H
-#define AVUTIL_X86_CPU_H
-
-#include "config.h"
-#include "libavutil/cpu.h"
-#include "libavutil/cpu_internal.h"
-
-#define AV_CPU_FLAG_AMD3DNOW    AV_CPU_FLAG_3DNOW
-#define AV_CPU_FLAG_AMD3DNOWEXT AV_CPU_FLAG_3DNOWEXT
-
-#define X86_AMD3DNOW(flags)         CPUEXT(flags, AMD3DNOW)
-#define X86_AMD3DNOWEXT(flags)      CPUEXT(flags, AMD3DNOWEXT)
-#define X86_MMX(flags)              CPUEXT(flags, MMX)
-#define X86_MMXEXT(flags)           CPUEXT(flags, MMXEXT)
-#define X86_SSE(flags)              CPUEXT(flags, SSE)
-#define X86_SSE2(flags)             CPUEXT(flags, SSE2)
-#define X86_SSE3(flags)             CPUEXT(flags, SSE3)
-#define X86_SSSE3(flags)            CPUEXT(flags, SSSE3)
-#define X86_SSE4(flags)             CPUEXT(flags, SSE4)
-#define X86_SSE42(flags)            CPUEXT(flags, SSE42)
-#define X86_AVX(flags)              CPUEXT(flags, AVX)
-#define X86_FMA4(flags)             CPUEXT(flags, FMA4)
-#define X86_AVX2(flags)             CPUEXT(flags, AVX2)
-
-#define EXTERNAL_AMD3DNOW(flags)    CPUEXT_SUFFIX(flags, _EXTERNAL, AMD3DNOW)
-#define EXTERNAL_AMD3DNOWEXT(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, AMD3DNOWEXT)
-#define EXTERNAL_MMX(flags)         CPUEXT_SUFFIX(flags, _EXTERNAL, MMX)
-#define EXTERNAL_MMXEXT(flags)      CPUEXT_SUFFIX(flags, _EXTERNAL, MMXEXT)
-#define EXTERNAL_SSE(flags)         CPUEXT_SUFFIX(flags, _EXTERNAL, SSE)
-#define EXTERNAL_SSE2(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, SSE2)
-#define EXTERNAL_SSE3(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, SSE3)
-#define EXTERNAL_SSSE3(flags)       CPUEXT_SUFFIX(flags, _EXTERNAL, SSSE3)
-#define EXTERNAL_SSE4(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, SSE4)
-#define EXTERNAL_SSE42(flags)       CPUEXT_SUFFIX(flags, _EXTERNAL, SSE42)
-#define EXTERNAL_AVX(flags)         CPUEXT_SUFFIX(flags, _EXTERNAL, AVX)
-#define EXTERNAL_FMA4(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, FMA4)
-#define EXTERNAL_AVX2(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, AVX2)
-
-#define INLINE_AMD3DNOW(flags)      CPUEXT_SUFFIX(flags, _INLINE, AMD3DNOW)
-#define INLINE_AMD3DNOWEXT(flags)   CPUEXT_SUFFIX(flags, _INLINE, AMD3DNOWEXT)
-#define INLINE_MMX(flags)           CPUEXT_SUFFIX(flags, _INLINE, MMX)
-#define INLINE_MMXEXT(flags)        CPUEXT_SUFFIX(flags, _INLINE, MMXEXT)
-#define INLINE_SSE(flags)           CPUEXT_SUFFIX(flags, _INLINE, SSE)
-#define INLINE_SSE2(flags)          CPUEXT_SUFFIX(flags, _INLINE, SSE2)
-#define INLINE_SSE3(flags)          CPUEXT_SUFFIX(flags, _INLINE, SSE3)
-#define INLINE_SSSE3(flags)         CPUEXT_SUFFIX(flags, _INLINE, SSSE3)
-#define INLINE_SSE4(flags)          CPUEXT_SUFFIX(flags, _INLINE, SSE4)
-#define INLINE_SSE42(flags)         CPUEXT_SUFFIX(flags, _INLINE, SSE42)
-#define INLINE_AVX(flags)           CPUEXT_SUFFIX(flags, _INLINE, AVX)
-#define INLINE_FMA4(flags)          CPUEXT_SUFFIX(flags, _INLINE, FMA4)
-#define INLINE_AVX2(flags)          CPUEXT_SUFFIX(flags, _INLINE, AVX2)
-
-void ff_cpu_cpuid(int index, int *eax, int *ebx, int *ecx, int *edx);
-void ff_cpu_xgetbv(int op, int *eax, int *edx);
-int  ff_cpu_cpuid_test(void);
-
-#endif /* AVUTIL_X86_CPU_H */
diff --git a/deps/libav/libavutil/x86/cpuid.asm b/deps/libav/libavutil/x86/cpuid.asm
deleted file mode 100644
index e739ebe..0000000
--- a/deps/libav/libavutil/x86/cpuid.asm
+++ /dev/null
@@ -1,91 +0,0 @@
-;*****************************************************************************
-;* Copyright (C) 2005-2010 x264 project
-;*
-;* Authors: Loren Merritt <lorenm at u.washington.edu>
-;*          Jason Garrett-Glaser <darkshikari at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "x86util.asm"
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; void ff_cpu_cpuid(int index, int *eax, int *ebx, int *ecx, int *edx)
-;-----------------------------------------------------------------------------
-cglobal cpu_cpuid, 5,7
-    push rbx
-    push  r4
-    push  r3
-    push  r2
-    push  r1
-    mov  eax, r0d
-    xor  ecx, ecx
-    cpuid
-    pop   r4
-    mov [r4], eax
-    pop   r4
-    mov [r4], ebx
-    pop   r4
-    mov [r4], ecx
-    pop   r4
-    mov [r4], edx
-    pop  rbx
-    RET
-
-;-----------------------------------------------------------------------------
-; void ff_cpu_xgetbv(int op, int *eax, int *edx)
-;-----------------------------------------------------------------------------
-cglobal cpu_xgetbv, 3,7
-    push  r2
-    push  r1
-    mov  ecx, r0d
-    xgetbv
-    pop   r4
-    mov [r4], eax
-    pop   r4
-    mov [r4], edx
-    RET
-
-%if ARCH_X86_64 == 0
-;-----------------------------------------------------------------------------
-; int ff_cpu_cpuid_test(void)
-; return 0 if unsupported
-;-----------------------------------------------------------------------------
-cglobal cpu_cpuid_test
-    pushfd
-    push    ebx
-    push    ebp
-    push    esi
-    push    edi
-    pushfd
-    pop     eax
-    mov     ebx, eax
-    xor     eax, 0x200000
-    push    eax
-    popfd
-    pushfd
-    pop     eax
-    xor     eax, ebx
-    pop     edi
-    pop     esi
-    pop     ebp
-    pop     ebx
-    popfd
-    ret
-%endif
diff --git a/deps/libav/libavutil/x86/emms.asm b/deps/libav/libavutil/x86/emms.asm
deleted file mode 100644
index a6851ac..0000000
--- a/deps/libav/libavutil/x86/emms.asm
+++ /dev/null
@@ -1,30 +0,0 @@
-;*****************************************************************************
-;* Copyright (C) 2013 Martin Storsjo
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "x86util.asm"
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; void avpriv_emms_yasm(void)
-;-----------------------------------------------------------------------------
-cvisible emms_yasm, 0, 0
-    emms
-    RET
diff --git a/deps/libav/libavutil/x86/emms.h b/deps/libav/libavutil/x86/emms.h
deleted file mode 100644
index 2ed9e5d..0000000
--- a/deps/libav/libavutil/x86/emms.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_X86_EMMS_H
-#define AVUTIL_X86_EMMS_H
-
-#include "config.h"
-#include "libavutil/attributes.h"
-
-void avpriv_emms_yasm(void);
-
-#if HAVE_MMX_INLINE
-#   define emms_c emms_c
-/**
- * Empty mmx state.
- * this must be called between any dsp function and float/double code.
- * for example sin(); dsp->idct_put(); emms_c(); cos()
- */
-static av_always_inline void emms_c(void)
-{
-    __asm__ volatile ("emms" ::: "memory");
-}
-#elif HAVE_MMX && HAVE_MM_EMPTY
-#   include <mmintrin.h>
-#   define emms_c _mm_empty
-#elif HAVE_MMX_EXTERNAL
-#   define emms_c avpriv_emms_yasm
-#endif /* HAVE_MMX_INLINE */
-
-#endif /* AVUTIL_X86_EMMS_H */
diff --git a/deps/libav/libavutil/x86/float_dsp.asm b/deps/libav/libavutil/x86/float_dsp.asm
deleted file mode 100644
index 10330ff..0000000
--- a/deps/libav/libavutil/x86/float_dsp.asm
+++ /dev/null
@@ -1,280 +0,0 @@
-;*****************************************************************************
-;* x86-optimized Float DSP functions
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "x86util.asm"
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; void vector_fmul(float *dst, const float *src0, const float *src1, int len)
-;-----------------------------------------------------------------------------
-%macro VECTOR_FMUL 0
-cglobal vector_fmul, 4,4,2, dst, src0, src1, len
-    lea       lenq, [lend*4 - 2*mmsize]
-ALIGN 16
-.loop:
-    mova      m0,   [src0q + lenq]
-    mova      m1,   [src0q + lenq + mmsize]
-    mulps     m0, m0, [src1q + lenq]
-    mulps     m1, m1, [src1q + lenq + mmsize]
-    mova      [dstq + lenq], m0
-    mova      [dstq + lenq + mmsize], m1
-
-    sub       lenq, 2*mmsize
-    jge       .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-VECTOR_FMUL
-INIT_YMM avx
-VECTOR_FMUL
-
-;------------------------------------------------------------------------------
-; void ff_vector_fmac_scalar(float *dst, const float *src, float mul, int len)
-;------------------------------------------------------------------------------
-
-%macro VECTOR_FMAC_SCALAR 0
-%if UNIX64
-cglobal vector_fmac_scalar, 3,3,3, dst, src, len
-%else
-cglobal vector_fmac_scalar, 4,4,3, dst, src, mul, len
-%endif
-%if ARCH_X86_32
-    VBROADCASTSS m0, mulm
-%else
-%if WIN64
-    mova       xmm0, xmm2
-%endif
-    shufps     xmm0, xmm0, 0
-%if cpuflag(avx)
-    vinsertf128  m0, m0, xmm0, 1
-%endif
-%endif
-    lea    lenq, [lend*4-2*mmsize]
-.loop:
-    mulps    m1, m0, [srcq+lenq       ]
-    mulps    m2, m0, [srcq+lenq+mmsize]
-    addps    m1, m1, [dstq+lenq       ]
-    addps    m2, m2, [dstq+lenq+mmsize]
-    mova  [dstq+lenq       ], m1
-    mova  [dstq+lenq+mmsize], m2
-    sub    lenq, 2*mmsize
-    jge .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-VECTOR_FMAC_SCALAR
-INIT_YMM avx
-VECTOR_FMAC_SCALAR
-
-;------------------------------------------------------------------------------
-; void ff_vector_fmul_scalar(float *dst, const float *src, float mul, int len)
-;------------------------------------------------------------------------------
-
-%macro VECTOR_FMUL_SCALAR 0
-%if UNIX64
-cglobal vector_fmul_scalar, 3,3,2, dst, src, len
-%else
-cglobal vector_fmul_scalar, 4,4,3, dst, src, mul, len
-%endif
-%if ARCH_X86_32
-    movss    m0, mulm
-%elif WIN64
-    SWAP 0, 2
-%endif
-    shufps   m0, m0, 0
-    lea    lenq, [lend*4-mmsize]
-.loop:
-    mova     m1, [srcq+lenq]
-    mulps    m1, m0
-    mova  [dstq+lenq], m1
-    sub    lenq, mmsize
-    jge .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-VECTOR_FMUL_SCALAR
-
-;------------------------------------------------------------------------------
-; void ff_vector_dmul_scalar(double *dst, const double *src, double mul,
-;                            int len)
-;------------------------------------------------------------------------------
-
-%macro VECTOR_DMUL_SCALAR 0
-%if ARCH_X86_32
-cglobal vector_dmul_scalar, 3,4,3, dst, src, mul, len, lenaddr
-    mov          lenq, lenaddrm
-%elif UNIX64
-cglobal vector_dmul_scalar, 3,3,3, dst, src, len
-%else
-cglobal vector_dmul_scalar, 4,4,3, dst, src, mul, len
-%endif
-%if ARCH_X86_32
-    VBROADCASTSD   m0, mulm
-%else
-%if WIN64
-    movlhps      xmm2, xmm2
-%if cpuflag(avx)
-    vinsertf128  ymm2, ymm2, xmm2, 1
-%endif
-    SWAP 0, 2
-%else
-    movlhps      xmm0, xmm0
-%if cpuflag(avx)
-    vinsertf128  ymm0, ymm0, xmm0, 1
-%endif
-%endif
-%endif
-    lea          lenq, [lend*8-2*mmsize]
-.loop:
-    mulpd          m1, m0, [srcq+lenq       ]
-    mulpd          m2, m0, [srcq+lenq+mmsize]
-    mova   [dstq+lenq       ], m1
-    mova   [dstq+lenq+mmsize], m2
-    sub          lenq, 2*mmsize
-    jge .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse2
-VECTOR_DMUL_SCALAR
-%if HAVE_AVX_EXTERNAL
-INIT_YMM avx
-VECTOR_DMUL_SCALAR
-%endif
-
-;-----------------------------------------------------------------------------
-; vector_fmul_add(float *dst, const float *src0, const float *src1,
-;                 const float *src2, int len)
-;-----------------------------------------------------------------------------
-%macro VECTOR_FMUL_ADD 0
-cglobal vector_fmul_add, 5,5,2, dst, src0, src1, src2, len
-    lea       lenq, [lend*4 - 2*mmsize]
-ALIGN 16
-.loop:
-    mova    m0,   [src0q + lenq]
-    mova    m1,   [src0q + lenq + mmsize]
-    mulps   m0, m0, [src1q + lenq]
-    mulps   m1, m1, [src1q + lenq + mmsize]
-    addps   m0, m0, [src2q + lenq]
-    addps   m1, m1, [src2q + lenq + mmsize]
-    mova    [dstq + lenq], m0
-    mova    [dstq + lenq + mmsize], m1
-
-    sub     lenq,   2*mmsize
-    jge     .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-VECTOR_FMUL_ADD
-INIT_YMM avx
-VECTOR_FMUL_ADD
-
-;-----------------------------------------------------------------------------
-; void vector_fmul_reverse(float *dst, const float *src0, const float *src1,
-;                          int len)
-;-----------------------------------------------------------------------------
-%macro VECTOR_FMUL_REVERSE 0
-cglobal vector_fmul_reverse, 4,4,2, dst, src0, src1, len
-    lea       lenq, [lend*4 - 2*mmsize]
-ALIGN 16
-.loop:
-%if cpuflag(avx)
-    vmovaps     xmm0, [src1q + 16]
-    vinsertf128 m0, m0, [src1q], 1
-    vshufps     m0, m0, m0, q0123
-    vmovaps     xmm1, [src1q + mmsize + 16]
-    vinsertf128 m1, m1, [src1q + mmsize], 1
-    vshufps     m1, m1, m1, q0123
-%else
-    mova    m0, [src1q]
-    mova    m1, [src1q + mmsize]
-    shufps  m0, m0, q0123
-    shufps  m1, m1, q0123
-%endif
-    mulps   m0, m0, [src0q + lenq + mmsize]
-    mulps   m1, m1, [src0q + lenq]
-    mova    [dstq + lenq + mmsize], m0
-    mova    [dstq + lenq], m1
-    add     src1q, 2*mmsize
-    sub     lenq,  2*mmsize
-    jge     .loop
-    REP_RET
-%endmacro
-
-INIT_XMM sse
-VECTOR_FMUL_REVERSE
-INIT_YMM avx
-VECTOR_FMUL_REVERSE
-
-; float scalarproduct_float_sse(const float *v1, const float *v2, int len)
-INIT_XMM sse
-cglobal scalarproduct_float, 3,3,2, v1, v2, offset
-    neg   offsetq
-    shl   offsetq, 2
-    sub       v1q, offsetq
-    sub       v2q, offsetq
-    xorps    xmm0, xmm0
-.loop:
-    movaps   xmm1, [v1q+offsetq]
-    mulps    xmm1, [v2q+offsetq]
-    addps    xmm0, xmm1
-    add   offsetq, 16
-    js .loop
-    movhlps  xmm1, xmm0
-    addps    xmm0, xmm1
-    movss    xmm1, xmm0
-    shufps   xmm0, xmm0, 1
-    addss    xmm0, xmm1
-%if ARCH_X86_64 == 0
-    movss     r0m,  xmm0
-    fld dword r0m
-%endif
-    RET
-
-;-----------------------------------------------------------------------------
-; void ff_butterflies_float(float *src0, float *src1, int len);
-;-----------------------------------------------------------------------------
-INIT_XMM sse
-cglobal butterflies_float, 3,3,3, src0, src1, len
-%if ARCH_X86_64
-    movsxd    lenq, lend
-%endif
-    test      lenq, lenq
-    jz .end
-    shl       lenq, 2
-    lea      src0q, [src0q +   lenq]
-    lea      src1q, [src1q +   lenq]
-    neg       lenq
-.loop:
-    mova        m0, [src0q + lenq]
-    mova        m1, [src1q + lenq]
-    subps       m2, m0, m1
-    addps       m0, m0, m1
-    mova        [src1q + lenq], m2
-    mova        [src0q + lenq], m0
-    add       lenq, mmsize
-    jl .loop
-.end:
-    REP_RET
diff --git a/deps/libav/libavutil/x86/float_dsp_init.c b/deps/libav/libavutil/x86/float_dsp_init.c
deleted file mode 100644
index a04d91c..0000000
--- a/deps/libav/libavutil/x86/float_dsp_init.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/float_dsp.h"
-#include "cpu.h"
-#include "asm.h"
-
-void ff_vector_fmul_sse(float *dst, const float *src0, const float *src1,
-                        int len);
-void ff_vector_fmul_avx(float *dst, const float *src0, const float *src1,
-                        int len);
-
-void ff_vector_fmac_scalar_sse(float *dst, const float *src, float mul,
-                               int len);
-void ff_vector_fmac_scalar_avx(float *dst, const float *src, float mul,
-                               int len);
-
-void ff_vector_fmul_scalar_sse(float *dst, const float *src, float mul,
-                               int len);
-
-void ff_vector_dmul_scalar_sse2(double *dst, const double *src,
-                                double mul, int len);
-void ff_vector_dmul_scalar_avx(double *dst, const double *src,
-                               double mul, int len);
-
-void ff_vector_fmul_add_sse(float *dst, const float *src0, const float *src1,
-                            const float *src2, int len);
-void ff_vector_fmul_add_avx(float *dst, const float *src0, const float *src1,
-                            const float *src2, int len);
-
-void ff_vector_fmul_reverse_sse(float *dst, const float *src0,
-                                const float *src1, int len);
-void ff_vector_fmul_reverse_avx(float *dst, const float *src0,
-                                const float *src1, int len);
-
-float ff_scalarproduct_float_sse(const float *v1, const float *v2, int order);
-
-void ff_butterflies_float_sse(float *src0, float *src1, int len);
-
-#if HAVE_6REGS && HAVE_INLINE_ASM
-static void vector_fmul_window_3dnowext(float *dst, const float *src0,
-                                        const float *src1, const float *win,
-                                        int len)
-{
-    x86_reg i = -len * 4;
-    x86_reg j =  len * 4 - 8;
-    __asm__ volatile (
-        "1:                             \n"
-        "pswapd (%5, %1), %%mm1         \n"
-        "movq   (%5, %0), %%mm0         \n"
-        "pswapd (%4, %1), %%mm5         \n"
-        "movq   (%3, %0), %%mm4         \n"
-        "movq      %%mm0, %%mm2         \n"
-        "movq      %%mm1, %%mm3         \n"
-        "pfmul     %%mm4, %%mm2         \n" // src0[len + i] * win[len + i]
-        "pfmul     %%mm5, %%mm3         \n" // src1[j]       * win[len + j]
-        "pfmul     %%mm4, %%mm1         \n" // src0[len + i] * win[len + j]
-        "pfmul     %%mm5, %%mm0         \n" // src1[j]       * win[len + i]
-        "pfadd     %%mm3, %%mm2         \n"
-        "pfsub     %%mm0, %%mm1         \n"
-        "pswapd    %%mm2, %%mm2         \n"
-        "movq      %%mm1, (%2, %0)      \n"
-        "movq      %%mm2, (%2, %1)      \n"
-        "sub          $8, %1            \n"
-        "add          $8, %0            \n"
-        "jl           1b                \n"
-        "femms                          \n"
-        : "+r"(i), "+r"(j)
-        : "r"(dst + len), "r"(src0 + len), "r"(src1), "r"(win + len)
-    );
-}
-
-static void vector_fmul_window_sse(float *dst, const float *src0,
-                                   const float *src1, const float *win, int len)
-{
-    x86_reg i = -len * 4;
-    x86_reg j =  len * 4 - 16;
-    __asm__ volatile (
-        "1:                             \n"
-        "movaps      (%5, %1), %%xmm1   \n"
-        "movaps      (%5, %0), %%xmm0   \n"
-        "movaps      (%4, %1), %%xmm5   \n"
-        "movaps      (%3, %0), %%xmm4   \n"
-        "shufps $0x1b, %%xmm1, %%xmm1   \n"
-        "shufps $0x1b, %%xmm5, %%xmm5   \n"
-        "movaps        %%xmm0, %%xmm2   \n"
-        "movaps        %%xmm1, %%xmm3   \n"
-        "mulps         %%xmm4, %%xmm2   \n" // src0[len + i] * win[len + i]
-        "mulps         %%xmm5, %%xmm3   \n" // src1[j]       * win[len + j]
-        "mulps         %%xmm4, %%xmm1   \n" // src0[len + i] * win[len + j]
-        "mulps         %%xmm5, %%xmm0   \n" // src1[j]       * win[len + i]
-        "addps         %%xmm3, %%xmm2   \n"
-        "subps         %%xmm0, %%xmm1   \n"
-        "shufps $0x1b, %%xmm2, %%xmm2   \n"
-        "movaps        %%xmm1, (%2, %0) \n"
-        "movaps        %%xmm2, (%2, %1) \n"
-        "sub              $16, %1       \n"
-        "add              $16, %0       \n"
-        "jl                1b           \n"
-        : "+r"(i), "+r"(j)
-        : "r"(dst + len), "r"(src0 + len), "r"(src1), "r"(win + len)
-    );
-}
-#endif /* HAVE_6REGS && HAVE_INLINE_ASM */
-
-av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-#if HAVE_6REGS && HAVE_INLINE_ASM
-    if (INLINE_AMD3DNOWEXT(cpu_flags)) {
-        fdsp->vector_fmul_window  = vector_fmul_window_3dnowext;
-    }
-    if (INLINE_SSE(cpu_flags)) {
-        fdsp->vector_fmul_window = vector_fmul_window_sse;
-    }
-#endif
-    if (EXTERNAL_SSE(cpu_flags)) {
-        fdsp->vector_fmul = ff_vector_fmul_sse;
-        fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_sse;
-        fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_sse;
-        fdsp->vector_fmul_add    = ff_vector_fmul_add_sse;
-        fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_sse;
-        fdsp->scalarproduct_float = ff_scalarproduct_float_sse;
-        fdsp->butterflies_float   = ff_butterflies_float_sse;
-    }
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_sse2;
-    }
-    if (EXTERNAL_AVX(cpu_flags)) {
-        fdsp->vector_fmul = ff_vector_fmul_avx;
-        fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_avx;
-        fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_avx;
-        fdsp->vector_fmul_add    = ff_vector_fmul_add_avx;
-        fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_avx;
-    }
-}
diff --git a/deps/libav/libavutil/x86/intreadwrite.h b/deps/libav/libavutil/x86/intreadwrite.h
deleted file mode 100644
index 635096e..0000000
--- a/deps/libav/libavutil/x86/intreadwrite.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2010 Alexander Strange <astrange at ithinksw.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_X86_INTREADWRITE_H
-#define AVUTIL_X86_INTREADWRITE_H
-
-#include <stdint.h>
-#include "config.h"
-#include "libavutil/attributes.h"
-
-#if HAVE_MMX
-
-#if !HAVE_FAST_64BIT && defined(__MMX__)
-
-#define AV_COPY64 AV_COPY64
-static av_always_inline void AV_COPY64(void *d, const void *s)
-{
-    __asm__("movq   %1, %%mm0  \n\t"
-            "movq   %%mm0, %0  \n\t"
-            : "=m"(*(uint64_t*)d)
-            : "m" (*(const uint64_t*)s)
-            : "mm0");
-}
-
-#define AV_SWAP64 AV_SWAP64
-static av_always_inline void AV_SWAP64(void *a, void *b)
-{
-    __asm__("movq   %1, %%mm0  \n\t"
-            "movq   %0, %%mm1  \n\t"
-            "movq   %%mm0, %0  \n\t"
-            "movq   %%mm1, %1  \n\t"
-            : "+m"(*(uint64_t*)a), "+m"(*(uint64_t*)b)
-            ::"mm0", "mm1");
-}
-
-#define AV_ZERO64 AV_ZERO64
-static av_always_inline void AV_ZERO64(void *d)
-{
-    __asm__("pxor %%mm0, %%mm0  \n\t"
-            "movq %%mm0, %0     \n\t"
-            : "=m"(*(uint64_t*)d)
-            :: "mm0");
-}
-
-#endif /* !HAVE_FAST_64BIT && defined(__MMX__) */
-
-#ifdef __SSE__
-
-#define AV_COPY128 AV_COPY128
-static av_always_inline void AV_COPY128(void *d, const void *s)
-{
-    struct v {uint64_t v[2];};
-
-    __asm__("movaps   %1, %%xmm0  \n\t"
-            "movaps   %%xmm0, %0  \n\t"
-            : "=m"(*(struct v*)d)
-            : "m" (*(const struct v*)s)
-            : "xmm0");
-}
-
-#endif /* __SSE__ */
-
-#ifdef __SSE2__
-
-#define AV_ZERO128 AV_ZERO128
-static av_always_inline void AV_ZERO128(void *d)
-{
-    struct v {uint64_t v[2];};
-
-    __asm__("pxor %%xmm0, %%xmm0  \n\t"
-            "movdqa   %%xmm0, %0  \n\t"
-            : "=m"(*(struct v*)d)
-            :: "xmm0");
-}
-
-#endif /* __SSE2__ */
-
-#endif /* HAVE_MMX */
-
-#endif /* AVUTIL_X86_INTREADWRITE_H */
diff --git a/deps/libav/libavutil/x86/lls.asm b/deps/libav/libavutil/x86/lls.asm
deleted file mode 100644
index eab85ed..0000000
--- a/deps/libav/libavutil/x86/lls.asm
+++ /dev/null
@@ -1,234 +0,0 @@
-;******************************************************************************
-;* linear least squares model
-;*
-;* Copyright (c) 2013 Loren Merritt
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "x86util.asm"
-
-SECTION .text
-
-%define MAX_VARS 32
-%define MAX_VARS_ALIGN (MAX_VARS+4)
-%define COVAR_STRIDE MAX_VARS_ALIGN*8
-%define COVAR(x,y) [covarq + (x)*8 + (y)*COVAR_STRIDE]
-
-struc LLSModel
-    .covariance:  resq MAX_VARS_ALIGN*MAX_VARS_ALIGN
-    .coeff:       resq MAX_VARS*MAX_VARS
-    .variance:    resq MAX_VARS
-    .indep_count: resd 1
-endstruc
-
-%macro ADDPD_MEM 2
-%if cpuflag(avx)
-    vaddpd %2, %2, %1
-%else
-    addpd  %2, %1
-%endif
-    mova   %1, %2
-%endmacro
-
-INIT_XMM sse2
-%define movdqa movaps
-cglobal update_lls, 2,5,8, ctx, var, i, j, covar2
-    %define covarq ctxq
-    mov     id, [ctxq + LLSModel.indep_count]
-    lea   varq, [varq + iq*8]
-    neg     iq
-    mov covar2q, covarq
-.loopi:
-    ; Compute all 3 pairwise products of a 2x2 block that lies on the diagonal
-    mova    m1, [varq + iq*8]
-    mova    m3, [varq + iq*8 + 16]
-    pshufd  m4, m1, q1010
-    pshufd  m5, m1, q3232
-    pshufd  m6, m3, q1010
-    pshufd  m7, m3, q3232
-    mulpd   m0, m1, m4
-    mulpd   m1, m1, m5
-    lea covarq, [covar2q + 16]
-    ADDPD_MEM COVAR(-2,0), m0
-    ADDPD_MEM COVAR(-2,1), m1
-    lea     jq, [iq + 2]
-    cmp     jd, -2
-    jg .skip4x4
-.loop4x4:
-    ; Compute all 16 pairwise products of a 4x4 block
-    mulpd   m0, m4, m3
-    mulpd   m1, m5, m3
-    mulpd   m2, m6, m3
-    mulpd   m3, m3, m7
-    ADDPD_MEM COVAR(0,0), m0
-    ADDPD_MEM COVAR(0,1), m1
-    ADDPD_MEM COVAR(0,2), m2
-    ADDPD_MEM COVAR(0,3), m3
-    mova    m3, [varq + jq*8 + 16]
-    mulpd   m0, m4, m3
-    mulpd   m1, m5, m3
-    mulpd   m2, m6, m3
-    mulpd   m3, m3, m7
-    ADDPD_MEM COVAR(2,0), m0
-    ADDPD_MEM COVAR(2,1), m1
-    ADDPD_MEM COVAR(2,2), m2
-    ADDPD_MEM COVAR(2,3), m3
-    mova    m3, [varq + jq*8 + 32]
-    add covarq, 32
-    add     jq, 4
-    cmp     jd, -2
-    jle .loop4x4
-.skip4x4:
-    test    jd, jd
-    jg .skip2x4
-    mulpd   m4, m3
-    mulpd   m5, m3
-    mulpd   m6, m3
-    mulpd   m7, m3
-    ADDPD_MEM COVAR(0,0), m4
-    ADDPD_MEM COVAR(0,1), m5
-    ADDPD_MEM COVAR(0,2), m6
-    ADDPD_MEM COVAR(0,3), m7
-.skip2x4:
-    add     iq, 4
-    add covar2q, 4*COVAR_STRIDE+32
-    cmp     id, -2
-    jle .loopi
-    test    id, id
-    jg .ret
-    mov     jq, iq
-    %define covarq covar2q
-.loop2x1:
-    movsd   m0, [varq + iq*8]
-    movlhps m0, m0
-    mulpd   m0, [varq + jq*8]
-    ADDPD_MEM COVAR(0,0), m0
-    inc     iq
-    add covarq, COVAR_STRIDE
-    test    id, id
-    jle .loop2x1
-.ret:
-    REP_RET
-
-INIT_YMM avx
-cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2
-    %define covarq ctxq
-    mov  countd, [ctxq + LLSModel.indep_count]
-    lea count2d, [countq-2]
-    xor     id, id
-.loopi:
-    ; Compute all 10 pairwise products of a 4x4 block that lies on the diagonal
-    mova    ymm1, [varq + iq*8]
-    vbroadcastsd ymm4, [varq + iq*8]
-    vbroadcastsd ymm5, [varq + iq*8 + 8]
-    vbroadcastsd ymm6, [varq + iq*8 + 16]
-    vbroadcastsd ymm7, [varq + iq*8 + 24]
-    vextractf128 xmm3, ymm1, 1
-    vmulpd  ymm0, ymm1, ymm4
-    vmulpd  ymm1, ymm1, ymm5
-    vmulpd  xmm2, xmm3, xmm6
-    vmulpd  xmm3, xmm3, xmm7
-    ADDPD_MEM COVAR(iq  ,0), ymm0
-    ADDPD_MEM COVAR(iq  ,1), ymm1
-    ADDPD_MEM COVAR(iq+2,2), xmm2
-    ADDPD_MEM COVAR(iq+2,3), xmm3
-    lea     jd, [iq + 4]
-    cmp     jd, count2d
-    jg .skip4x4
-.loop4x4:
-    ; Compute all 16 pairwise products of a 4x4 block
-    mova    ymm3, [varq + jq*8]
-    vmulpd  ymm0, ymm3, ymm4
-    vmulpd  ymm1, ymm3, ymm5
-    vmulpd  ymm2, ymm3, ymm6
-    vmulpd  ymm3, ymm3, ymm7
-    ADDPD_MEM COVAR(jq,0), ymm0
-    ADDPD_MEM COVAR(jq,1), ymm1
-    ADDPD_MEM COVAR(jq,2), ymm2
-    ADDPD_MEM COVAR(jq,3), ymm3
-    add     jd, 4
-    cmp     jd, count2d
-    jle .loop4x4
-.skip4x4:
-    cmp     jd, countd
-    jg .skip2x4
-    mova    xmm3, [varq + jq*8]
-    vmulpd  xmm0, xmm3, xmm4
-    vmulpd  xmm1, xmm3, xmm5
-    vmulpd  xmm2, xmm3, xmm6
-    vmulpd  xmm3, xmm3, xmm7
-    ADDPD_MEM COVAR(jq,0), xmm0
-    ADDPD_MEM COVAR(jq,1), xmm1
-    ADDPD_MEM COVAR(jq,2), xmm2
-    ADDPD_MEM COVAR(jq,3), xmm3
-.skip2x4:
-    add     id, 4
-    add covarq, 4*COVAR_STRIDE
-    cmp     id, count2d
-    jle .loopi
-    cmp     id, countd
-    jg .ret
-    mov     jd, id
-.loop2x1:
-    vmovddup xmm0, [varq + iq*8]
-    vmulpd   xmm0, [varq + jq*8]
-    ADDPD_MEM COVAR(jq,0), xmm0
-    inc     id
-    add covarq, COVAR_STRIDE
-    cmp     id, countd
-    jle .loop2x1
-.ret:
-    REP_RET
-
-
-INIT_XMM sse2
-cglobal evaluate_lls, 3,4,2, ctx, var, order, i
-    ; This function is often called on the same buffer as update_lls, but with
-    ; an offset. They can't both be aligned.
-    ; Load halves rather than movu to avoid store-forwarding stalls, since the
-    ; input was initialized immediately prior to this function using scalar math.
-    %define coefsq ctxq
-    mov     id, orderd
-    imul    orderd, MAX_VARS
-    lea     coefsq, [ctxq + LLSModel.coeff + orderq*8]
-    movsd   m0, [varq]
-    movhpd  m0, [varq + 8]
-    mulpd   m0, [coefsq]
-    lea coefsq, [coefsq + iq*8]
-    lea   varq, [varq + iq*8]
-    neg     iq
-    add     iq, 2
-.loop:
-    movsd   m1, [varq + iq*8]
-    movhpd  m1, [varq + iq*8 + 8]
-    mulpd   m1, [coefsq + iq*8]
-    addpd   m0, m1
-    add     iq, 2
-    jl .loop
-    jg .skip1
-    movsd   m1, [varq + iq*8]
-    mulsd   m1, [coefsq + iq*8]
-    addpd   m0, m1
-.skip1:
-    movhlps m1, m0
-    addsd   m0, m1
-%if ARCH_X86_32
-    movsd  r0m, m0
-    fld   qword r0m
-%endif
-    RET
diff --git a/deps/libav/libavutil/x86/lls_init.c b/deps/libav/libavutil/x86/lls_init.c
deleted file mode 100644
index 888bc54..0000000
--- a/deps/libav/libavutil/x86/lls_init.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * linear least squares model
- *
- * Copyright (c) 2013 Loren Merritt
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/lls.h"
-#include "libavutil/x86/cpu.h"
-
-void ff_update_lls_sse2(LLSModel *m, double *var);
-void ff_update_lls_avx(LLSModel *m, double *var);
-double ff_evaluate_lls_sse2(LLSModel *m, double *var, int order);
-
-av_cold void ff_init_lls_x86(LLSModel *m)
-{
-    int cpu_flags = av_get_cpu_flags();
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        m->update_lls = ff_update_lls_sse2;
-        if (m->indep_count >= 4)
-            m->evaluate_lls = ff_evaluate_lls_sse2;
-    }
-    if (EXTERNAL_AVX(cpu_flags)) {
-        m->update_lls = ff_update_lls_avx;
-    }
-}
diff --git a/deps/libav/libavutil/x86/timer.h b/deps/libav/libavutil/x86/timer.h
deleted file mode 100644
index cdd67dd..0000000
--- a/deps/libav/libavutil/x86/timer.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_X86_TIMER_H
-#define AVUTIL_X86_TIMER_H
-
-#include <stdint.h>
-
-#if HAVE_INLINE_ASM
-
-#define AV_READ_TIME read_time
-
-static inline uint64_t read_time(void)
-{
-    uint32_t a, d;
-    __asm__ volatile("rdtsc" : "=a" (a), "=d" (d));
-    return ((uint64_t)d << 32) + a;
-}
-
-#elif HAVE_RDTSC
-
-#include <intrin.h>
-#define AV_READ_TIME __rdtsc
-
-#endif /* HAVE_INLINE_ASM */
-
-#endif /* AVUTIL_X86_TIMER_H */
diff --git a/deps/libav/libavutil/x86/w64xmmtest.h b/deps/libav/libavutil/x86/w64xmmtest.h
deleted file mode 100644
index b4ce7d3..0000000
--- a/deps/libav/libavutil/x86/w64xmmtest.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * check XMM registers for clobbers on Win64
- * Copyright (c) 2008 Ramiro Polla <ramiro.polla at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include "libavutil/bswap.h"
-
-#define storexmmregs(mem)               \
-    __asm__ volatile(                   \
-        "movups %%xmm6 , 0x00(%0)\n\t"  \
-        "movups %%xmm7 , 0x10(%0)\n\t"  \
-        "movups %%xmm8 , 0x20(%0)\n\t"  \
-        "movups %%xmm9 , 0x30(%0)\n\t"  \
-        "movups %%xmm10, 0x40(%0)\n\t"  \
-        "movups %%xmm11, 0x50(%0)\n\t"  \
-        "movups %%xmm12, 0x60(%0)\n\t"  \
-        "movups %%xmm13, 0x70(%0)\n\t"  \
-        "movups %%xmm14, 0x80(%0)\n\t"  \
-        "movups %%xmm15, 0x90(%0)\n\t"  \
-        :: "r"(mem) : "memory")
-
-#define testxmmclobbers(func, ctx, ...)                         \
-    uint64_t xmm[2][10][2];                                     \
-    int ret;                                                    \
-    storexmmregs(xmm[0]);                                       \
-    ret = __real_ ## func(ctx, __VA_ARGS__);                    \
-    storexmmregs(xmm[1]);                                       \
-    if (memcmp(xmm[0], xmm[1], sizeof(xmm[0]))) {               \
-        int i;                                                  \
-        av_log(ctx, AV_LOG_ERROR,                               \
-               "XMM REGS CLOBBERED IN %s!\n", #func);           \
-        for (i = 0; i < 10; i ++)                               \
-            if (xmm[0][i][0] != xmm[1][i][0] ||                 \
-                xmm[0][i][1] != xmm[1][i][1]) {                 \
-                av_log(ctx, AV_LOG_ERROR,                       \
-                       "xmm%-2d = %016"PRIx64"%016"PRIx64"\n",  \
-                       6 + i, av_bswap64(xmm[0][i][0]),         \
-                       av_bswap64(xmm[0][i][1]));               \
-                av_log(ctx, AV_LOG_ERROR,                       \
-                         "     -> %016"PRIx64"%016"PRIx64"\n",  \
-                       av_bswap64(xmm[1][i][0]),                \
-                       av_bswap64(xmm[1][i][1]));               \
-            }                                                   \
-        abort();                                                \
-    }                                                           \
-    return ret
-
-#define wrap(func)      \
-int __real_ ## func;    \
-int __wrap_ ## func;    \
-int __wrap_ ## func
diff --git a/deps/libav/libavutil/x86/x86inc.asm b/deps/libav/libavutil/x86/x86inc.asm
deleted file mode 100644
index a765b0a..0000000
--- a/deps/libav/libavutil/x86/x86inc.asm
+++ /dev/null
@@ -1,1472 +0,0 @@
-;*****************************************************************************
-;* x86inc.asm: x264asm abstraction layer
-;*****************************************************************************
-;* Copyright (C) 2005-2013 x264 project
-;*
-;* Authors: Loren Merritt <lorenm at u.washington.edu>
-;*          Anton Mitrofanov <BugMaster at narod.ru>
-;*          Jason Garrett-Glaser <darkshikari at gmail.com>
-;*          Henrik Gramner <henrik at gramner.com>
-;*
-;* Permission to use, copy, modify, and/or distribute this software for any
-;* purpose with or without fee is hereby granted, provided that the above
-;* copyright notice and this permission notice appear in all copies.
-;*
-;* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-;*****************************************************************************
-
-; This is a header file for the x264ASM assembly language, which uses
-; NASM/YASM syntax combined with a large number of macros to provide easy
-; abstraction between different calling conventions (x86_32, win64, linux64).
-; It also has various other useful features to simplify writing the kind of
-; DSP functions that are most often used in x264.
-
-; Unlike the rest of x264, this file is available under an ISC license, as it
-; has significant usefulness outside of x264 and we want it to be available
-; to the largest audience possible.  Of course, if you modify it for your own
-; purposes to add a new feature, we strongly encourage contributing a patch
-; as this feature might be useful for others as well.  Send patches or ideas
-; to x264-devel at videolan.org .
-
-%ifndef private_prefix
-    %define private_prefix x264
-%endif
-
-%ifndef public_prefix
-    %define public_prefix private_prefix
-%endif
-
-%define WIN64  0
-%define UNIX64 0
-%if ARCH_X86_64
-    %ifidn __OUTPUT_FORMAT__,win32
-        %define WIN64  1
-    %elifidn __OUTPUT_FORMAT__,win64
-        %define WIN64  1
-    %elifidn __OUTPUT_FORMAT__,x64
-        %define WIN64  1
-    %else
-        %define UNIX64 1
-    %endif
-%endif
-
-%ifdef PREFIX
-    %define mangle(x) _ %+ x
-%else
-    %define mangle(x) x
-%endif
-
-; aout does not support align=
-; NOTE: This section is out of sync with x264, in order to
-; keep supporting OS/2.
-%macro SECTION_RODATA 0-1 16
-    %ifidn __OUTPUT_FORMAT__,aout
-        section .text
-    %else
-        SECTION .rodata align=%1
-    %endif
-%endmacro
-
-%macro SECTION_TEXT 0-1 16
-    %ifidn __OUTPUT_FORMAT__,aout
-        SECTION .text
-    %else
-        SECTION .text align=%1
-    %endif
-%endmacro
-
-%if WIN64
-    %define PIC
-%elif ARCH_X86_64 == 0
-; x86_32 doesn't require PIC.
-; Some distros prefer shared objects to be PIC, but nothing breaks if
-; the code contains a few textrels, so we'll skip that complexity.
-    %undef PIC
-%endif
-%ifdef PIC
-    default rel
-%endif
-
-%macro CPUNOP 1
-    %if HAVE_CPUNOP
-        CPU %1
-    %endif
-%endmacro
-
-; Always use long nops (reduces 0x90 spam in disassembly on x86_32)
-CPUNOP amdnop
-
-; Macros to eliminate most code duplication between x86_32 and x86_64:
-; Currently this works only for leaf functions which load all their arguments
-; into registers at the start, and make no other use of the stack. Luckily that
-; covers most of x264's asm.
-
-; PROLOGUE:
-; %1 = number of arguments. loads them from stack if needed.
-; %2 = number of registers used. pushes callee-saved regs if needed.
-; %3 = number of xmm registers used. pushes callee-saved xmm regs if needed.
-; %4 = (optional) stack size to be allocated. If not aligned (x86-32 ICC 10.x,
-;      MSVC or YMM), the stack will be manually aligned (to 16 or 32 bytes),
-;      and an extra register will be allocated to hold the original stack
-;      pointer (to not invalidate r0m etc.). To prevent the use of an extra
-;      register as stack pointer, request a negative stack size.
-; %4+/%5+ = list of names to define to registers
-; PROLOGUE can also be invoked by adding the same options to cglobal
-
-; e.g.
-; cglobal foo, 2,3,0, dst, src, tmp
-; declares a function (foo), taking two args (dst and src) and one local variable (tmp)
-
-; TODO Some functions can use some args directly from the stack. If they're the
-; last args then you can just not declare them, but if they're in the middle
-; we need more flexible macro.
-
-; RET:
-; Pops anything that was pushed by PROLOGUE, and returns.
-
-; REP_RET:
-; Use this instead of RET if it's a branch target.
-
-; registers:
-; rN and rNq are the native-size register holding function argument N
-; rNd, rNw, rNb are dword, word, and byte size
-; rNh is the high 8 bits of the word size
-; rNm is the original location of arg N (a register or on the stack), dword
-; rNmp is native size
-
-%macro DECLARE_REG 2-3
-    %define r%1q %2
-    %define r%1d %2d
-    %define r%1w %2w
-    %define r%1b %2b
-    %define r%1h %2h
-    %define %2q %2
-    %if %0 == 2
-        %define r%1m  %2d
-        %define r%1mp %2
-    %elif ARCH_X86_64 ; memory
-        %define r%1m [rstk + stack_offset + %3]
-        %define r%1mp qword r %+ %1 %+ m
-    %else
-        %define r%1m [rstk + stack_offset + %3]
-        %define r%1mp dword r %+ %1 %+ m
-    %endif
-    %define r%1  %2
-%endmacro
-
-%macro DECLARE_REG_SIZE 3
-    %define r%1q r%1
-    %define e%1q r%1
-    %define r%1d e%1
-    %define e%1d e%1
-    %define r%1w %1
-    %define e%1w %1
-    %define r%1h %3
-    %define e%1h %3
-    %define r%1b %2
-    %define e%1b %2
-%if ARCH_X86_64 == 0
-    %define r%1  e%1
-%endif
-%endmacro
-
-DECLARE_REG_SIZE ax, al, ah
-DECLARE_REG_SIZE bx, bl, bh
-DECLARE_REG_SIZE cx, cl, ch
-DECLARE_REG_SIZE dx, dl, dh
-DECLARE_REG_SIZE si, sil, null
-DECLARE_REG_SIZE di, dil, null
-DECLARE_REG_SIZE bp, bpl, null
-
-; t# defines for when per-arch register allocation is more complex than just function arguments
-
-%macro DECLARE_REG_TMP 1-*
-    %assign %%i 0
-    %rep %0
-        CAT_XDEFINE t, %%i, r%1
-        %assign %%i %%i+1
-        %rotate 1
-    %endrep
-%endmacro
-
-%macro DECLARE_REG_TMP_SIZE 0-*
-    %rep %0
-        %define t%1q t%1 %+ q
-        %define t%1d t%1 %+ d
-        %define t%1w t%1 %+ w
-        %define t%1h t%1 %+ h
-        %define t%1b t%1 %+ b
-        %rotate 1
-    %endrep
-%endmacro
-
-DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
-
-%if ARCH_X86_64
-    %define gprsize 8
-%else
-    %define gprsize 4
-%endif
-
-%macro PUSH 1
-    push %1
-    %ifidn rstk, rsp
-        %assign stack_offset stack_offset+gprsize
-    %endif
-%endmacro
-
-%macro POP 1
-    pop %1
-    %ifidn rstk, rsp
-        %assign stack_offset stack_offset-gprsize
-    %endif
-%endmacro
-
-%macro PUSH_IF_USED 1-*
-    %rep %0
-        %if %1 < regs_used
-            PUSH r%1
-        %endif
-        %rotate 1
-    %endrep
-%endmacro
-
-%macro POP_IF_USED 1-*
-    %rep %0
-        %if %1 < regs_used
-            pop r%1
-        %endif
-        %rotate 1
-    %endrep
-%endmacro
-
-%macro LOAD_IF_USED 1-*
-    %rep %0
-        %if %1 < num_args
-            mov r%1, r %+ %1 %+ mp
-        %endif
-        %rotate 1
-    %endrep
-%endmacro
-
-%macro SUB 2
-    sub %1, %2
-    %ifidn %1, rstk
-        %assign stack_offset stack_offset+(%2)
-    %endif
-%endmacro
-
-%macro ADD 2
-    add %1, %2
-    %ifidn %1, rstk
-        %assign stack_offset stack_offset-(%2)
-    %endif
-%endmacro
-
-%macro movifnidn 2
-    %ifnidn %1, %2
-        mov %1, %2
-    %endif
-%endmacro
-
-%macro movsxdifnidn 2
-    %ifnidn %1, %2
-        movsxd %1, %2
-    %endif
-%endmacro
-
-%macro ASSERT 1
-    %if (%1) == 0
-        %error assert failed
-    %endif
-%endmacro
-
-%macro DEFINE_ARGS 0-*
-    %ifdef n_arg_names
-        %assign %%i 0
-        %rep n_arg_names
-            CAT_UNDEF arg_name %+ %%i, q
-            CAT_UNDEF arg_name %+ %%i, d
-            CAT_UNDEF arg_name %+ %%i, w
-            CAT_UNDEF arg_name %+ %%i, h
-            CAT_UNDEF arg_name %+ %%i, b
-            CAT_UNDEF arg_name %+ %%i, m
-            CAT_UNDEF arg_name %+ %%i, mp
-            CAT_UNDEF arg_name, %%i
-            %assign %%i %%i+1
-        %endrep
-    %endif
-
-    %xdefine %%stack_offset stack_offset
-    %undef stack_offset ; so that the current value of stack_offset doesn't get baked in by xdefine
-    %assign %%i 0
-    %rep %0
-        %xdefine %1q r %+ %%i %+ q
-        %xdefine %1d r %+ %%i %+ d
-        %xdefine %1w r %+ %%i %+ w
-        %xdefine %1h r %+ %%i %+ h
-        %xdefine %1b r %+ %%i %+ b
-        %xdefine %1m r %+ %%i %+ m
-        %xdefine %1mp r %+ %%i %+ mp
-        CAT_XDEFINE arg_name, %%i, %1
-        %assign %%i %%i+1
-        %rotate 1
-    %endrep
-    %xdefine stack_offset %%stack_offset
-    %assign n_arg_names %0
-%endmacro
-
-%macro ALLOC_STACK 1-2 0 ; stack_size, n_xmm_regs (for win64 only)
-    %ifnum %1
-        %if %1 != 0
-            %assign %%stack_alignment ((mmsize + 15) & ~15)
-            %assign stack_size %1
-            %if stack_size < 0
-                %assign stack_size -stack_size
-            %endif
-            %assign stack_size_padded stack_size
-            %if WIN64
-                %assign stack_size_padded stack_size_padded + 32 ; reserve 32 bytes for shadow space
-                %if mmsize != 8
-                    %assign xmm_regs_used %2
-                    %if xmm_regs_used > 8
-                        %assign stack_size_padded stack_size_padded + (xmm_regs_used-8)*16
-                    %endif
-                %endif
-            %endif
-            %if mmsize <= 16 && HAVE_ALIGNED_STACK
-                %assign stack_size_padded stack_size_padded + %%stack_alignment - gprsize - (stack_offset & (%%stack_alignment - 1))
-                SUB rsp, stack_size_padded
-            %else
-                %assign %%reg_num (regs_used - 1)
-                %xdefine rstk r %+ %%reg_num
-                ; align stack, and save original stack location directly above
-                ; it, i.e. in [rsp+stack_size_padded], so we can restore the
-                ; stack in a single instruction (i.e. mov rsp, rstk or mov
-                ; rsp, [rsp+stack_size_padded])
-                mov  rstk, rsp
-                %if %1 < 0 ; need to store rsp on stack
-                    sub  rsp, gprsize+stack_size_padded
-                    and  rsp, ~(%%stack_alignment-1)
-                    %xdefine rstkm [rsp+stack_size_padded]
-                    mov rstkm, rstk
-                %else ; can keep rsp in rstk during whole function
-                    sub  rsp, stack_size_padded
-                    and  rsp, ~(%%stack_alignment-1)
-                    %xdefine rstkm rstk
-                %endif
-            %endif
-            WIN64_PUSH_XMM
-        %endif
-    %endif
-%endmacro
-
-%macro SETUP_STACK_POINTER 1
-    %ifnum %1
-        %if %1 != 0 && (HAVE_ALIGNED_STACK == 0 || mmsize == 32)
-            %if %1 > 0
-                %assign regs_used (regs_used + 1)
-            %elif ARCH_X86_64 && regs_used == num_args && num_args <= 4 + UNIX64 * 2
-                %warning "Stack pointer will overwrite register argument"
-            %endif
-        %endif
-    %endif
-%endmacro
-
-%macro DEFINE_ARGS_INTERNAL 3+
-    %ifnum %2
-        DEFINE_ARGS %3
-    %elif %1 == 4
-        DEFINE_ARGS %2
-    %elif %1 > 4
-        DEFINE_ARGS %2, %3
-    %endif
-%endmacro
-
-%if WIN64 ; Windows x64 ;=================================================
-
-DECLARE_REG 0,  rcx
-DECLARE_REG 1,  rdx
-DECLARE_REG 2,  R8
-DECLARE_REG 3,  R9
-DECLARE_REG 4,  R10, 40
-DECLARE_REG 5,  R11, 48
-DECLARE_REG 6,  rax, 56
-DECLARE_REG 7,  rdi, 64
-DECLARE_REG 8,  rsi, 72
-DECLARE_REG 9,  rbx, 80
-DECLARE_REG 10, rbp, 88
-DECLARE_REG 11, R12, 96
-DECLARE_REG 12, R13, 104
-DECLARE_REG 13, R14, 112
-DECLARE_REG 14, R15, 120
-
-%macro PROLOGUE 2-5+ 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
-    %assign num_args %1
-    %assign regs_used %2
-    ASSERT regs_used >= num_args
-    SETUP_STACK_POINTER %4
-    ASSERT regs_used <= 15
-    PUSH_IF_USED 7, 8, 9, 10, 11, 12, 13, 14
-    ALLOC_STACK %4, %3
-    %if mmsize != 8 && stack_size == 0
-        WIN64_SPILL_XMM %3
-    %endif
-    LOAD_IF_USED 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
-    DEFINE_ARGS_INTERNAL %0, %4, %5
-%endmacro
-
-%macro WIN64_PUSH_XMM 0
-    ; Use the shadow space to store XMM6 and XMM7, the rest needs stack space allocated.
-    %if xmm_regs_used > 6
-        movaps [rstk + stack_offset +  8], xmm6
-    %endif
-    %if xmm_regs_used > 7
-        movaps [rstk + stack_offset + 24], xmm7
-    %endif
-    %if xmm_regs_used > 8
-        %assign %%i 8
-        %rep xmm_regs_used-8
-            movaps [rsp + (%%i-8)*16 + stack_size + 32], xmm %+ %%i
-            %assign %%i %%i+1
-        %endrep
-    %endif
-%endmacro
-
-%macro WIN64_SPILL_XMM 1
-    %assign xmm_regs_used %1
-    ASSERT xmm_regs_used <= 16
-    %if xmm_regs_used > 8
-        %assign stack_size_padded (xmm_regs_used-8)*16 + (~stack_offset&8) + 32
-        SUB rsp, stack_size_padded
-    %endif
-    WIN64_PUSH_XMM
-%endmacro
-
-%macro WIN64_RESTORE_XMM_INTERNAL 1
-    %assign %%pad_size 0
-    %if xmm_regs_used > 8
-        %assign %%i xmm_regs_used
-        %rep xmm_regs_used-8
-            %assign %%i %%i-1
-            movaps xmm %+ %%i, [%1 + (%%i-8)*16 + stack_size + 32]
-        %endrep
-    %endif
-    %if stack_size_padded > 0
-        %if stack_size > 0 && (mmsize == 32 || HAVE_ALIGNED_STACK == 0)
-            mov rsp, rstkm
-        %else
-            add %1, stack_size_padded
-            %assign %%pad_size stack_size_padded
-        %endif
-    %endif
-    %if xmm_regs_used > 7
-        movaps xmm7, [%1 + stack_offset - %%pad_size + 24]
-    %endif
-    %if xmm_regs_used > 6
-        movaps xmm6, [%1 + stack_offset - %%pad_size +  8]
-    %endif
-%endmacro
-
-%macro WIN64_RESTORE_XMM 1
-    WIN64_RESTORE_XMM_INTERNAL %1
-    %assign stack_offset (stack_offset-stack_size_padded)
-    %assign xmm_regs_used 0
-%endmacro
-
-%define has_epilogue regs_used > 7 || xmm_regs_used > 6 || mmsize == 32 || stack_size > 0
-
-%macro RET 0
-    WIN64_RESTORE_XMM_INTERNAL rsp
-    POP_IF_USED 14, 13, 12, 11, 10, 9, 8, 7
-%if mmsize == 32
-    vzeroupper
-%endif
-    AUTO_REP_RET
-%endmacro
-
-%elif ARCH_X86_64 ; *nix x64 ;=============================================
-
-DECLARE_REG 0,  rdi
-DECLARE_REG 1,  rsi
-DECLARE_REG 2,  rdx
-DECLARE_REG 3,  rcx
-DECLARE_REG 4,  R8
-DECLARE_REG 5,  R9
-DECLARE_REG 6,  rax, 8
-DECLARE_REG 7,  R10, 16
-DECLARE_REG 8,  R11, 24
-DECLARE_REG 9,  rbx, 32
-DECLARE_REG 10, rbp, 40
-DECLARE_REG 11, R12, 48
-DECLARE_REG 12, R13, 56
-DECLARE_REG 13, R14, 64
-DECLARE_REG 14, R15, 72
-
-%macro PROLOGUE 2-5+ ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
-    %assign num_args %1
-    %assign regs_used %2
-    ASSERT regs_used >= num_args
-    SETUP_STACK_POINTER %4
-    ASSERT regs_used <= 15
-    PUSH_IF_USED 9, 10, 11, 12, 13, 14
-    ALLOC_STACK %4
-    LOAD_IF_USED 6, 7, 8, 9, 10, 11, 12, 13, 14
-    DEFINE_ARGS_INTERNAL %0, %4, %5
-%endmacro
-
-%define has_epilogue regs_used > 9 || mmsize == 32 || stack_size > 0
-
-%macro RET 0
-%if stack_size_padded > 0
-%if mmsize == 32 || HAVE_ALIGNED_STACK == 0
-    mov rsp, rstkm
-%else
-    add rsp, stack_size_padded
-%endif
-%endif
-    POP_IF_USED 14, 13, 12, 11, 10, 9
-%if mmsize == 32
-    vzeroupper
-%endif
-    AUTO_REP_RET
-%endmacro
-
-%else ; X86_32 ;==============================================================
-
-DECLARE_REG 0, eax, 4
-DECLARE_REG 1, ecx, 8
-DECLARE_REG 2, edx, 12
-DECLARE_REG 3, ebx, 16
-DECLARE_REG 4, esi, 20
-DECLARE_REG 5, edi, 24
-DECLARE_REG 6, ebp, 28
-%define rsp esp
-
-%macro DECLARE_ARG 1-*
-    %rep %0
-        %define r%1m [rstk + stack_offset + 4*%1 + 4]
-        %define r%1mp dword r%1m
-        %rotate 1
-    %endrep
-%endmacro
-
-DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
-
-%macro PROLOGUE 2-5+ ; #args, #regs, #xmm_regs, [stack_size,] arg_names...
-    %assign num_args %1
-    %assign regs_used %2
-    ASSERT regs_used >= num_args
-    %if num_args > 7
-        %assign num_args 7
-    %endif
-    %if regs_used > 7
-        %assign regs_used 7
-    %endif
-    SETUP_STACK_POINTER %4
-    ASSERT regs_used <= 7
-    PUSH_IF_USED 3, 4, 5, 6
-    ALLOC_STACK %4
-    LOAD_IF_USED 0, 1, 2, 3, 4, 5, 6
-    DEFINE_ARGS_INTERNAL %0, %4, %5
-%endmacro
-
-%define has_epilogue regs_used > 3 || mmsize == 32 || stack_size > 0
-
-%macro RET 0
-%if stack_size_padded > 0
-%if mmsize == 32 || HAVE_ALIGNED_STACK == 0
-    mov rsp, rstkm
-%else
-    add rsp, stack_size_padded
-%endif
-%endif
-    POP_IF_USED 6, 5, 4, 3
-%if mmsize == 32
-    vzeroupper
-%endif
-    AUTO_REP_RET
-%endmacro
-
-%endif ;======================================================================
-
-%if WIN64 == 0
-%macro WIN64_SPILL_XMM 1
-%endmacro
-%macro WIN64_RESTORE_XMM 1
-%endmacro
-%macro WIN64_PUSH_XMM 0
-%endmacro
-%endif
-
-; On AMD cpus <=K10, an ordinary ret is slow if it immediately follows either
-; a branch or a branch target. So switch to a 2-byte form of ret in that case.
-; We can automatically detect "follows a branch", but not a branch target.
-; (SSSE3 is a sufficient condition to know that your cpu doesn't have this problem.)
-%macro REP_RET 0
-    %if has_epilogue
-        RET
-    %else
-        rep ret
-    %endif
-%endmacro
-
-%define last_branch_adr $$
-%macro AUTO_REP_RET 0
-    %ifndef cpuflags
-        times ((last_branch_adr-$)>>31)+1 rep ; times 1 iff $ != last_branch_adr.
-    %elif notcpuflag(ssse3)
-        times ((last_branch_adr-$)>>31)+1 rep
-    %endif
-    ret
-%endmacro
-
-%macro BRANCH_INSTR 0-*
-    %rep %0
-        %macro %1 1-2 %1
-            %2 %1
-            %%branch_instr:
-            %xdefine last_branch_adr %%branch_instr
-        %endmacro
-        %rotate 1
-    %endrep
-%endmacro
-
-BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, jna, jnae, jb, jbe, jnb, jnbe, jc, jnc, js, jns, jo, jno, jp, jnp
-
-%macro TAIL_CALL 2 ; callee, is_nonadjacent
-    %if has_epilogue
-        call %1
-        RET
-    %elif %2
-        jmp %1
-    %endif
-%endmacro
-
-;=============================================================================
-; arch-independent part
-;=============================================================================
-
-%assign function_align 16
-
-; Begin a function.
-; Applies any symbol mangling needed for C linkage, and sets up a define such that
-; subsequent uses of the function name automatically refer to the mangled version.
-; Appends cpuflags to the function name if cpuflags has been specified.
-; The "" empty default parameter is a workaround for nasm, which fails if SUFFIX
-; is empty and we call cglobal_internal with just %1 %+ SUFFIX (without %2).
-%macro cglobal 1-2+ "" ; name, [PROLOGUE args]
-    cglobal_internal 1, %1 %+ SUFFIX, %2
-%endmacro
-%macro cvisible 1-2+ "" ; name, [PROLOGUE args]
-    cglobal_internal 0, %1 %+ SUFFIX, %2
-%endmacro
-%macro cglobal_internal 2-3+
-    %if %1
-        %xdefine %%FUNCTION_PREFIX private_prefix
-        %xdefine %%VISIBILITY hidden
-    %else
-        %xdefine %%FUNCTION_PREFIX public_prefix
-        %xdefine %%VISIBILITY
-    %endif
-    %ifndef cglobaled_%2
-        %xdefine %2 mangle(%%FUNCTION_PREFIX %+ _ %+ %2)
-        %xdefine %2.skip_prologue %2 %+ .skip_prologue
-        CAT_XDEFINE cglobaled_, %2, 1
-    %endif
-    %xdefine current_function %2
-    %ifidn __OUTPUT_FORMAT__,elf
-        global %2:function %%VISIBILITY
-    %else
-        global %2
-    %endif
-    align function_align
-    %2:
-    RESET_MM_PERMUTATION        ; needed for x86-64, also makes disassembly somewhat nicer
-    %xdefine rstk rsp           ; copy of the original stack pointer, used when greater alignment than the known stack alignment is required
-    %assign stack_offset 0      ; stack pointer offset relative to the return address
-    %assign stack_size 0        ; amount of stack space that can be freely used inside a function
-    %assign stack_size_padded 0 ; total amount of allocated stack space, including space for callee-saved xmm registers on WIN64 and alignment padding
-    %assign xmm_regs_used 0     ; number of XMM registers requested, used for dealing with callee-saved registers on WIN64
-    %ifnidn %3, ""
-        PROLOGUE %3
-    %endif
-%endmacro
-
-%macro cextern 1
-    %xdefine %1 mangle(private_prefix %+ _ %+ %1)
-    CAT_XDEFINE cglobaled_, %1, 1
-    extern %1
-%endmacro
-
-; like cextern, but without the prefix
-%macro cextern_naked 1
-    %xdefine %1 mangle(%1)
-    CAT_XDEFINE cglobaled_, %1, 1
-    extern %1
-%endmacro
-
-%macro const 1-2+
-    %xdefine %1 mangle(private_prefix %+ _ %+ %1)
-    %ifidn __OUTPUT_FORMAT__,elf
-        global %1:data hidden
-    %else
-        global %1
-    %endif
-    %1: %2
-%endmacro
-
-; This is needed for ELF, otherwise the GNU linker assumes the stack is
-; executable by default.
-%ifidn __OUTPUT_FORMAT__,elf
-SECTION .note.GNU-stack noalloc noexec nowrite progbits
-%endif
-
-; cpuflags
-
-%assign cpuflags_mmx      (1<<0)
-%assign cpuflags_mmx2     (1<<1) | cpuflags_mmx
-%assign cpuflags_3dnow    (1<<2) | cpuflags_mmx
-%assign cpuflags_3dnowext (1<<3) | cpuflags_3dnow
-%assign cpuflags_sse      (1<<4) | cpuflags_mmx2
-%assign cpuflags_sse2     (1<<5) | cpuflags_sse
-%assign cpuflags_sse2slow (1<<6) | cpuflags_sse2
-%assign cpuflags_sse3     (1<<7) | cpuflags_sse2
-%assign cpuflags_ssse3    (1<<8) | cpuflags_sse3
-%assign cpuflags_sse4     (1<<9) | cpuflags_ssse3
-%assign cpuflags_sse42    (1<<10)| cpuflags_sse4
-%assign cpuflags_avx      (1<<11)| cpuflags_sse42
-%assign cpuflags_xop      (1<<12)| cpuflags_avx
-%assign cpuflags_fma4     (1<<13)| cpuflags_avx
-%assign cpuflags_avx2     (1<<14)| cpuflags_avx
-%assign cpuflags_fma3     (1<<15)| cpuflags_avx
-
-%assign cpuflags_cache32  (1<<16)
-%assign cpuflags_cache64  (1<<17)
-%assign cpuflags_slowctz  (1<<18)
-%assign cpuflags_lzcnt    (1<<19)
-%assign cpuflags_aligned  (1<<20) ; not a cpu feature, but a function variant
-%assign cpuflags_atom     (1<<21)
-%assign cpuflags_bmi1     (1<<22)|cpuflags_lzcnt
-%assign cpuflags_bmi2     (1<<23)|cpuflags_bmi1
-
-%define    cpuflag(x) ((cpuflags & (cpuflags_ %+ x)) == (cpuflags_ %+ x))
-%define notcpuflag(x) ((cpuflags & (cpuflags_ %+ x)) != (cpuflags_ %+ x))
-
-; Takes up to 2 cpuflags from the above list.
-; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the specified cpu.
-; You shouldn't need to invoke this macro directly, it's a subroutine for INIT_MMX &co.
-%macro INIT_CPUFLAGS 0-2
-    CPUNOP amdnop
-    %if %0 >= 1
-        %xdefine cpuname %1
-        %assign cpuflags cpuflags_%1
-        %if %0 >= 2
-            %xdefine cpuname %1_%2
-            %assign cpuflags cpuflags | cpuflags_%2
-        %endif
-        %xdefine SUFFIX _ %+ cpuname
-        %if cpuflag(avx)
-            %assign avx_enabled 1
-        %endif
-        %if (mmsize == 16 && notcpuflag(sse2)) || (mmsize == 32 && notcpuflag(avx2))
-            %define mova movaps
-            %define movu movups
-            %define movnta movntps
-        %endif
-        %if cpuflag(aligned)
-            %define movu mova
-        %elifidn %1, sse3
-            %define movu lddqu
-        %endif
-        %if notcpuflag(sse2)
-            CPUNOP basicnop
-        %endif
-    %else
-        %xdefine SUFFIX
-        %undef cpuname
-        %undef cpuflags
-    %endif
-%endmacro
-
-; Merge mmx and sse*
-; m# is a simd regsiter of the currently selected size
-; xm# is the corresponding xmmreg (if selcted xmm or ymm size), or mmreg (if selected mmx)
-; ym# is the corresponding ymmreg (if selcted xmm or ymm size), or mmreg (if selected mmx)
-; (All 3 remain in sync through SWAP.)
-
-%macro CAT_XDEFINE 3
-    %xdefine %1%2 %3
-%endmacro
-
-%macro CAT_UNDEF 2
-    %undef %1%2
-%endmacro
-
-%macro INIT_MMX 0-1+
-    %assign avx_enabled 0
-    %define RESET_MM_PERMUTATION INIT_MMX %1
-    %define mmsize 8
-    %define num_mmregs 8
-    %define mova movq
-    %define movu movq
-    %define movh movd
-    %define movnta movntq
-    %assign %%i 0
-    %rep 8
-    CAT_XDEFINE m, %%i, mm %+ %%i
-    CAT_XDEFINE nmm, %%i, %%i
-    %assign %%i %%i+1
-    %endrep
-    %rep 8
-    CAT_UNDEF m, %%i
-    CAT_UNDEF nmm, %%i
-    %assign %%i %%i+1
-    %endrep
-    INIT_CPUFLAGS %1
-%endmacro
-
-%macro INIT_XMM 0-1+
-    %assign avx_enabled 0
-    %define RESET_MM_PERMUTATION INIT_XMM %1
-    %define mmsize 16
-    %define num_mmregs 8
-    %if ARCH_X86_64
-    %define num_mmregs 16
-    %endif
-    %define mova movdqa
-    %define movu movdqu
-    %define movh movq
-    %define movnta movntdq
-    %assign %%i 0
-    %rep num_mmregs
-    CAT_XDEFINE m, %%i, xmm %+ %%i
-    CAT_XDEFINE nxmm, %%i, %%i
-    %assign %%i %%i+1
-    %endrep
-    INIT_CPUFLAGS %1
-%endmacro
-
-%macro INIT_YMM 0-1+
-    %assign avx_enabled 1
-    %define RESET_MM_PERMUTATION INIT_YMM %1
-    %define mmsize 32
-    %define num_mmregs 8
-    %if ARCH_X86_64
-    %define num_mmregs 16
-    %endif
-    %define mova movdqa
-    %define movu movdqu
-    %undef movh
-    %define movnta movntdq
-    %assign %%i 0
-    %rep num_mmregs
-    CAT_XDEFINE m, %%i, ymm %+ %%i
-    CAT_XDEFINE nymm, %%i, %%i
-    %assign %%i %%i+1
-    %endrep
-    INIT_CPUFLAGS %1
-%endmacro
-
-INIT_XMM
-
-%macro DECLARE_MMCAST 1
-    %define  mmmm%1   mm%1
-    %define  mmxmm%1  mm%1
-    %define  mmymm%1  mm%1
-    %define xmmmm%1   mm%1
-    %define xmmxmm%1 xmm%1
-    %define xmmymm%1 xmm%1
-    %define ymmmm%1   mm%1
-    %define ymmxmm%1 ymm%1
-    %define ymmymm%1 ymm%1
-    %define xm%1 xmm %+ m%1
-    %define ym%1 ymm %+ m%1
-%endmacro
-
-%assign i 0
-%rep 16
-    DECLARE_MMCAST i
-%assign i i+1
-%endrep
-
-; I often want to use macros that permute their arguments. e.g. there's no
-; efficient way to implement butterfly or transpose or dct without swapping some
-; arguments.
-;
-; I would like to not have to manually keep track of the permutations:
-; If I insert a permutation in the middle of a function, it should automatically
-; change everything that follows. For more complex macros I may also have multiple
-; implementations, e.g. the SSE2 and SSSE3 versions may have different permutations.
-;
-; Hence these macros. Insert a PERMUTE or some SWAPs at the end of a macro that
-; permutes its arguments. It's equivalent to exchanging the contents of the
-; registers, except that this way you exchange the register names instead, so it
-; doesn't cost any cycles.
-
-%macro PERMUTE 2-* ; takes a list of pairs to swap
-%rep %0/2
-    %xdefine %%tmp%2 m%2
-    %rotate 2
-%endrep
-%rep %0/2
-    %xdefine m%1 %%tmp%2
-    CAT_XDEFINE n, m%1, %1
-    %rotate 2
-%endrep
-%endmacro
-
-%macro SWAP 2+ ; swaps a single chain (sometimes more concise than pairs)
-%ifnum %1 ; SWAP 0, 1, ...
-    SWAP_INTERNAL_NUM %1, %2
-%else ; SWAP m0, m1, ...
-    SWAP_INTERNAL_NAME %1, %2
-%endif
-%endmacro
-
-%macro SWAP_INTERNAL_NUM 2-*
-    %rep %0-1
-        %xdefine %%tmp m%1
-        %xdefine m%1 m%2
-        %xdefine m%2 %%tmp
-        CAT_XDEFINE n, m%1, %1
-        CAT_XDEFINE n, m%2, %2
-    %rotate 1
-    %endrep
-%endmacro
-
-%macro SWAP_INTERNAL_NAME 2-*
-    %xdefine %%args n %+ %1
-    %rep %0-1
-        %xdefine %%args %%args, n %+ %2
-    %rotate 1
-    %endrep
-    SWAP_INTERNAL_NUM %%args
-%endmacro
-
-; If SAVE_MM_PERMUTATION is placed at the end of a function, then any later
-; calls to that function will automatically load the permutation, so values can
-; be returned in mmregs.
-%macro SAVE_MM_PERMUTATION 0-1
-    %if %0
-        %xdefine %%f %1_m
-    %else
-        %xdefine %%f current_function %+ _m
-    %endif
-    %assign %%i 0
-    %rep num_mmregs
-        CAT_XDEFINE %%f, %%i, m %+ %%i
-    %assign %%i %%i+1
-    %endrep
-%endmacro
-
-%macro LOAD_MM_PERMUTATION 1 ; name to load from
-    %ifdef %1_m0
-        %assign %%i 0
-        %rep num_mmregs
-            CAT_XDEFINE m, %%i, %1_m %+ %%i
-            CAT_XDEFINE n, m %+ %%i, %%i
-        %assign %%i %%i+1
-        %endrep
-    %endif
-%endmacro
-
-; Append cpuflags to the callee's name iff the appended name is known and the plain name isn't
-%macro call 1
-    call_internal %1 %+ SUFFIX, %1
-%endmacro
-%macro call_internal 2
-    %xdefine %%i %2
-    %ifndef cglobaled_%2
-        %ifdef cglobaled_%1
-            %xdefine %%i %1
-        %endif
-    %endif
-    call %%i
-    LOAD_MM_PERMUTATION %%i
-%endmacro
-
-; Substitutions that reduce instruction size but are functionally equivalent
-%macro add 2
-    %ifnum %2
-        %if %2==128
-            sub %1, -128
-        %else
-            add %1, %2
-        %endif
-    %else
-        add %1, %2
-    %endif
-%endmacro
-
-%macro sub 2
-    %ifnum %2
-        %if %2==128
-            add %1, -128
-        %else
-            sub %1, %2
-        %endif
-    %else
-        sub %1, %2
-    %endif
-%endmacro
-
-;=============================================================================
-; AVX abstraction layer
-;=============================================================================
-
-%assign i 0
-%rep 16
-    %if i < 8
-        CAT_XDEFINE sizeofmm, i, 8
-    %endif
-    CAT_XDEFINE sizeofxmm, i, 16
-    CAT_XDEFINE sizeofymm, i, 32
-%assign i i+1
-%endrep
-%undef i
-
-%macro CHECK_AVX_INSTR_EMU 3-*
-    %xdefine %%opcode %1
-    %xdefine %%dst %2
-    %rep %0-2
-        %ifidn %%dst, %3
-            %error non-avx emulation of ``%%opcode'' is not supported
-        %endif
-        %rotate 1
-    %endrep
-%endmacro
-
-;%1 == instruction
-;%2 == 1 if float, 0 if int
-;%3 == 1 if non-destructive or 4-operand (xmm, xmm, xmm, imm), 0 otherwise
-;%4 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not
-;%5+: operands
-%macro RUN_AVX_INSTR 5-8+
-    %ifnum sizeof%6
-        %assign __sizeofreg sizeof%6
-    %elifnum sizeof%5
-        %assign __sizeofreg sizeof%5
-    %else
-        %assign __sizeofreg mmsize
-    %endif
-    %assign __emulate_avx 0
-    %if avx_enabled && __sizeofreg >= 16
-        %xdefine __instr v%1
-    %else
-        %xdefine __instr %1
-        %if %0 >= 7+%3
-            %assign __emulate_avx 1
-        %endif
-    %endif
-
-    %if __emulate_avx
-        %xdefine __src1 %6
-        %xdefine __src2 %7
-        %ifnidn %5, %6
-            %if %0 >= 8
-                CHECK_AVX_INSTR_EMU {%1 %5, %6, %7, %8}, %5, %7, %8
-            %else
-                CHECK_AVX_INSTR_EMU {%1 %5, %6, %7}, %5, %7
-            %endif
-            %if %4 && %3 == 0
-                %ifnid %7
-                    ; 3-operand AVX instructions with a memory arg can only have it in src2,
-                    ; whereas SSE emulation prefers to have it in src1 (i.e. the mov).
-                    ; So, if the instruction is commutative with a memory arg, swap them.
-                    %xdefine __src1 %7
-                    %xdefine __src2 %6
-                %endif
-            %endif
-            %if __sizeofreg == 8
-                MOVQ %5, __src1
-            %elif %2
-                MOVAPS %5, __src1
-            %else
-                MOVDQA %5, __src1
-            %endif
-        %endif
-        %if %0 >= 8
-            %1 %5, __src2, %8
-        %else
-            %1 %5, __src2
-        %endif
-    %elif %0 >= 8
-        __instr %5, %6, %7, %8
-    %elif %0 == 7
-        __instr %5, %6, %7
-    %elif %0 == 6
-        __instr %5, %6
-    %else
-        __instr %5
-    %endif
-%endmacro
-
-;%1 == instruction
-;%2 == 1 if float, 0 if int
-;%3 == 1 if non-destructive or 4-operand (xmm, xmm, xmm, imm), 0 otherwise
-;%4 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not
-%macro AVX_INSTR 1-4 0, 1, 0
-    %macro %1 1-9 fnord, fnord, fnord, fnord, %1, %2, %3, %4
-        %ifidn %2, fnord
-            RUN_AVX_INSTR %6, %7, %8, %9, %1
-        %elifidn %3, fnord
-            RUN_AVX_INSTR %6, %7, %8, %9, %1, %2
-        %elifidn %4, fnord
-            RUN_AVX_INSTR %6, %7, %8, %9, %1, %2, %3
-        %elifidn %5, fnord
-            RUN_AVX_INSTR %6, %7, %8, %9, %1, %2, %3, %4
-        %else
-            RUN_AVX_INSTR %6, %7, %8, %9, %1, %2, %3, %4, %5
-        %endif
-    %endmacro
-%endmacro
-
-; Instructions with both VEX and non-VEX encodings
-; Non-destructive instructions are written without parameters
-AVX_INSTR addpd, 1, 0, 1
-AVX_INSTR addps, 1, 0, 1
-AVX_INSTR addsd, 1, 0, 1
-AVX_INSTR addss, 1, 0, 1
-AVX_INSTR addsubpd, 1, 0, 0
-AVX_INSTR addsubps, 1, 0, 0
-AVX_INSTR aesdec, 0, 0, 0
-AVX_INSTR aesdeclast, 0, 0, 0
-AVX_INSTR aesenc, 0, 0, 0
-AVX_INSTR aesenclast, 0, 0, 0
-AVX_INSTR aesimc
-AVX_INSTR aeskeygenassist
-AVX_INSTR andnpd, 1, 0, 0
-AVX_INSTR andnps, 1, 0, 0
-AVX_INSTR andpd, 1, 0, 1
-AVX_INSTR andps, 1, 0, 1
-AVX_INSTR blendpd, 1, 0, 0
-AVX_INSTR blendps, 1, 0, 0
-AVX_INSTR blendvpd, 1, 0, 0
-AVX_INSTR blendvps, 1, 0, 0
-AVX_INSTR cmppd, 1, 1, 0
-AVX_INSTR cmpps, 1, 1, 0
-AVX_INSTR cmpsd, 1, 1, 0
-AVX_INSTR cmpss, 1, 1, 0
-AVX_INSTR comisd
-AVX_INSTR comiss
-AVX_INSTR cvtdq2pd
-AVX_INSTR cvtdq2ps
-AVX_INSTR cvtpd2dq
-AVX_INSTR cvtpd2ps
-AVX_INSTR cvtps2dq
-AVX_INSTR cvtps2pd
-AVX_INSTR cvtsd2si
-AVX_INSTR cvtsd2ss
-AVX_INSTR cvtsi2sd
-AVX_INSTR cvtsi2ss
-AVX_INSTR cvtss2sd
-AVX_INSTR cvtss2si
-AVX_INSTR cvttpd2dq
-AVX_INSTR cvttps2dq
-AVX_INSTR cvttsd2si
-AVX_INSTR cvttss2si
-AVX_INSTR divpd, 1, 0, 0
-AVX_INSTR divps, 1, 0, 0
-AVX_INSTR divsd, 1, 0, 0
-AVX_INSTR divss, 1, 0, 0
-AVX_INSTR dppd, 1, 1, 0
-AVX_INSTR dpps, 1, 1, 0
-AVX_INSTR extractps
-AVX_INSTR haddpd, 1, 0, 0
-AVX_INSTR haddps, 1, 0, 0
-AVX_INSTR hsubpd, 1, 0, 0
-AVX_INSTR hsubps, 1, 0, 0
-AVX_INSTR insertps, 1, 1, 0
-AVX_INSTR lddqu
-AVX_INSTR ldmxcsr
-AVX_INSTR maskmovdqu
-AVX_INSTR maxpd, 1, 0, 1
-AVX_INSTR maxps, 1, 0, 1
-AVX_INSTR maxsd, 1, 0, 1
-AVX_INSTR maxss, 1, 0, 1
-AVX_INSTR minpd, 1, 0, 1
-AVX_INSTR minps, 1, 0, 1
-AVX_INSTR minsd, 1, 0, 1
-AVX_INSTR minss, 1, 0, 1
-AVX_INSTR movapd
-AVX_INSTR movaps
-AVX_INSTR movd
-AVX_INSTR movddup
-AVX_INSTR movdqa
-AVX_INSTR movdqu
-AVX_INSTR movhlps, 1, 0, 0
-AVX_INSTR movhpd, 1, 0, 0
-AVX_INSTR movhps, 1, 0, 0
-AVX_INSTR movlhps, 1, 0, 0
-AVX_INSTR movlpd, 1, 0, 0
-AVX_INSTR movlps, 1, 0, 0
-AVX_INSTR movmskpd
-AVX_INSTR movmskps
-AVX_INSTR movntdq
-AVX_INSTR movntdqa
-AVX_INSTR movntpd
-AVX_INSTR movntps
-AVX_INSTR movq
-AVX_INSTR movsd, 1, 0, 0
-AVX_INSTR movshdup
-AVX_INSTR movsldup
-AVX_INSTR movss, 1, 0, 0
-AVX_INSTR movupd
-AVX_INSTR movups
-AVX_INSTR mpsadbw, 0, 1, 0
-AVX_INSTR mulpd, 1, 0, 1
-AVX_INSTR mulps, 1, 0, 1
-AVX_INSTR mulsd, 1, 0, 1
-AVX_INSTR mulss, 1, 0, 1
-AVX_INSTR orpd, 1, 0, 1
-AVX_INSTR orps, 1, 0, 1
-AVX_INSTR pabsb
-AVX_INSTR pabsd
-AVX_INSTR pabsw
-AVX_INSTR packsswb, 0, 0, 0
-AVX_INSTR packssdw, 0, 0, 0
-AVX_INSTR packuswb, 0, 0, 0
-AVX_INSTR packusdw, 0, 0, 0
-AVX_INSTR paddb, 0, 0, 1
-AVX_INSTR paddw, 0, 0, 1
-AVX_INSTR paddd, 0, 0, 1
-AVX_INSTR paddq, 0, 0, 1
-AVX_INSTR paddsb, 0, 0, 1
-AVX_INSTR paddsw, 0, 0, 1
-AVX_INSTR paddusb, 0, 0, 1
-AVX_INSTR paddusw, 0, 0, 1
-AVX_INSTR palignr, 0, 1, 0
-AVX_INSTR pand, 0, 0, 1
-AVX_INSTR pandn, 0, 0, 0
-AVX_INSTR pavgb, 0, 0, 1
-AVX_INSTR pavgw, 0, 0, 1
-AVX_INSTR pblendvb, 0, 0, 0
-AVX_INSTR pblendw, 0, 1, 0
-AVX_INSTR pclmulqdq, 0, 1, 0
-AVX_INSTR pcmpestri
-AVX_INSTR pcmpestrm
-AVX_INSTR pcmpistri
-AVX_INSTR pcmpistrm
-AVX_INSTR pcmpeqb, 0, 0, 1
-AVX_INSTR pcmpeqw, 0, 0, 1
-AVX_INSTR pcmpeqd, 0, 0, 1
-AVX_INSTR pcmpeqq, 0, 0, 1
-AVX_INSTR pcmpgtb, 0, 0, 0
-AVX_INSTR pcmpgtw, 0, 0, 0
-AVX_INSTR pcmpgtd, 0, 0, 0
-AVX_INSTR pcmpgtq, 0, 0, 0
-AVX_INSTR pextrb
-AVX_INSTR pextrd
-AVX_INSTR pextrq
-AVX_INSTR pextrw
-AVX_INSTR phaddw, 0, 0, 0
-AVX_INSTR phaddd, 0, 0, 0
-AVX_INSTR phaddsw, 0, 0, 0
-AVX_INSTR phminposuw
-AVX_INSTR phsubw, 0, 0, 0
-AVX_INSTR phsubd, 0, 0, 0
-AVX_INSTR phsubsw, 0, 0, 0
-AVX_INSTR pinsrb, 0, 1, 0
-AVX_INSTR pinsrd, 0, 1, 0
-AVX_INSTR pinsrq, 0, 1, 0
-AVX_INSTR pinsrw, 0, 1, 0
-AVX_INSTR pmaddwd, 0, 0, 1
-AVX_INSTR pmaddubsw, 0, 0, 0
-AVX_INSTR pmaxsb, 0, 0, 1
-AVX_INSTR pmaxsw, 0, 0, 1
-AVX_INSTR pmaxsd, 0, 0, 1
-AVX_INSTR pmaxub, 0, 0, 1
-AVX_INSTR pmaxuw, 0, 0, 1
-AVX_INSTR pmaxud, 0, 0, 1
-AVX_INSTR pminsb, 0, 0, 1
-AVX_INSTR pminsw, 0, 0, 1
-AVX_INSTR pminsd, 0, 0, 1
-AVX_INSTR pminub, 0, 0, 1
-AVX_INSTR pminuw, 0, 0, 1
-AVX_INSTR pminud, 0, 0, 1
-AVX_INSTR pmovmskb
-AVX_INSTR pmovsxbw
-AVX_INSTR pmovsxbd
-AVX_INSTR pmovsxbq
-AVX_INSTR pmovsxwd
-AVX_INSTR pmovsxwq
-AVX_INSTR pmovsxdq
-AVX_INSTR pmovzxbw
-AVX_INSTR pmovzxbd
-AVX_INSTR pmovzxbq
-AVX_INSTR pmovzxwd
-AVX_INSTR pmovzxwq
-AVX_INSTR pmovzxdq
-AVX_INSTR pmuldq, 0, 0, 1
-AVX_INSTR pmulhrsw, 0, 0, 1
-AVX_INSTR pmulhuw, 0, 0, 1
-AVX_INSTR pmulhw, 0, 0, 1
-AVX_INSTR pmullw, 0, 0, 1
-AVX_INSTR pmulld, 0, 0, 1
-AVX_INSTR pmuludq, 0, 0, 1
-AVX_INSTR por, 0, 0, 1
-AVX_INSTR psadbw, 0, 0, 1
-AVX_INSTR pshufb, 0, 0, 0
-AVX_INSTR pshufd
-AVX_INSTR pshufhw
-AVX_INSTR pshuflw
-AVX_INSTR psignb, 0, 0, 0
-AVX_INSTR psignw, 0, 0, 0
-AVX_INSTR psignd, 0, 0, 0
-AVX_INSTR psllw, 0, 0, 0
-AVX_INSTR pslld, 0, 0, 0
-AVX_INSTR psllq, 0, 0, 0
-AVX_INSTR pslldq, 0, 0, 0
-AVX_INSTR psraw, 0, 0, 0
-AVX_INSTR psrad, 0, 0, 0
-AVX_INSTR psrlw, 0, 0, 0
-AVX_INSTR psrld, 0, 0, 0
-AVX_INSTR psrlq, 0, 0, 0
-AVX_INSTR psrldq, 0, 0, 0
-AVX_INSTR psubb, 0, 0, 0
-AVX_INSTR psubw, 0, 0, 0
-AVX_INSTR psubd, 0, 0, 0
-AVX_INSTR psubq, 0, 0, 0
-AVX_INSTR psubsb, 0, 0, 0
-AVX_INSTR psubsw, 0, 0, 0
-AVX_INSTR psubusb, 0, 0, 0
-AVX_INSTR psubusw, 0, 0, 0
-AVX_INSTR ptest
-AVX_INSTR punpckhbw, 0, 0, 0
-AVX_INSTR punpckhwd, 0, 0, 0
-AVX_INSTR punpckhdq, 0, 0, 0
-AVX_INSTR punpckhqdq, 0, 0, 0
-AVX_INSTR punpcklbw, 0, 0, 0
-AVX_INSTR punpcklwd, 0, 0, 0
-AVX_INSTR punpckldq, 0, 0, 0
-AVX_INSTR punpcklqdq, 0, 0, 0
-AVX_INSTR pxor, 0, 0, 1
-AVX_INSTR rcpps, 1, 0, 0
-AVX_INSTR rcpss, 1, 0, 0
-AVX_INSTR roundpd
-AVX_INSTR roundps
-AVX_INSTR roundsd
-AVX_INSTR roundss
-AVX_INSTR rsqrtps, 1, 0, 0
-AVX_INSTR rsqrtss, 1, 0, 0
-AVX_INSTR shufpd, 1, 1, 0
-AVX_INSTR shufps, 1, 1, 0
-AVX_INSTR sqrtpd, 1, 0, 0
-AVX_INSTR sqrtps, 1, 0, 0
-AVX_INSTR sqrtsd, 1, 0, 0
-AVX_INSTR sqrtss, 1, 0, 0
-AVX_INSTR stmxcsr
-AVX_INSTR subpd, 1, 0, 0
-AVX_INSTR subps, 1, 0, 0
-AVX_INSTR subsd, 1, 0, 0
-AVX_INSTR subss, 1, 0, 0
-AVX_INSTR ucomisd
-AVX_INSTR ucomiss
-AVX_INSTR unpckhpd, 1, 0, 0
-AVX_INSTR unpckhps, 1, 0, 0
-AVX_INSTR unpcklpd, 1, 0, 0
-AVX_INSTR unpcklps, 1, 0, 0
-AVX_INSTR xorpd, 1, 0, 1
-AVX_INSTR xorps, 1, 0, 1
-
-; 3DNow instructions, for sharing code between AVX, SSE and 3DN
-AVX_INSTR pfadd, 1, 0, 1
-AVX_INSTR pfsub, 1, 0, 0
-AVX_INSTR pfmul, 1, 0, 1
-
-; base-4 constants for shuffles
-%assign i 0
-%rep 256
-    %assign j ((i>>6)&3)*1000 + ((i>>4)&3)*100 + ((i>>2)&3)*10 + (i&3)
-    %if j < 10
-        CAT_XDEFINE q000, j, i
-    %elif j < 100
-        CAT_XDEFINE q00, j, i
-    %elif j < 1000
-        CAT_XDEFINE q0, j, i
-    %else
-        CAT_XDEFINE q, j, i
-    %endif
-%assign i i+1
-%endrep
-%undef i
-%undef j
-
-%macro FMA_INSTR 3
-    %macro %1 4-7 %1, %2, %3
-        %if cpuflag(xop)
-            v%5 %1, %2, %3, %4
-        %else
-            %6 %1, %2, %3
-            %7 %1, %4
-        %endif
-    %endmacro
-%endmacro
-
-FMA_INSTR  pmacsdd,  pmulld, paddd
-FMA_INSTR  pmacsww,  pmullw, paddw
-FMA_INSTR pmadcswd, pmaddwd, paddd
-
-; tzcnt is equivalent to "rep bsf" and is backwards-compatible with bsf.
-; This lets us use tzcnt without bumping the yasm version requirement yet.
-%define tzcnt rep bsf
-
-; convert FMA4 to FMA3 if possible
-%macro FMA4_INSTR 4
-    %macro %1 4-8 %1, %2, %3, %4
-        %if cpuflag(fma4)
-            v%5 %1, %2, %3, %4
-        %elifidn %1, %2
-            v%6 %1, %4, %3 ; %1 = %1 * %3 + %4
-        %elifidn %1, %3
-            v%7 %1, %2, %4 ; %1 = %2 * %1 + %4
-        %elifidn %1, %4
-            v%8 %1, %2, %3 ; %1 = %2 * %3 + %1
-        %else
-            %error fma3 emulation of ``%5 %1, %2, %3, %4'' is not supported
-        %endif
-    %endmacro
-%endmacro
-
-FMA4_INSTR fmaddpd, fmadd132pd, fmadd213pd, fmadd231pd
-FMA4_INSTR fmaddps, fmadd132ps, fmadd213ps, fmadd231ps
-FMA4_INSTR fmaddsd, fmadd132sd, fmadd213sd, fmadd231sd
-FMA4_INSTR fmaddss, fmadd132ss, fmadd213ss, fmadd231ss
-
-FMA4_INSTR fmaddsubpd, fmaddsub132pd, fmaddsub213pd, fmaddsub231pd
-FMA4_INSTR fmaddsubps, fmaddsub132ps, fmaddsub213ps, fmaddsub231ps
-FMA4_INSTR fmsubaddpd, fmsubadd132pd, fmsubadd213pd, fmsubadd231pd
-FMA4_INSTR fmsubaddps, fmsubadd132ps, fmsubadd213ps, fmsubadd231ps
-
-FMA4_INSTR fmsubpd, fmsub132pd, fmsub213pd, fmsub231pd
-FMA4_INSTR fmsubps, fmsub132ps, fmsub213ps, fmsub231ps
-FMA4_INSTR fmsubsd, fmsub132sd, fmsub213sd, fmsub231sd
-FMA4_INSTR fmsubss, fmsub132ss, fmsub213ss, fmsub231ss
-
-FMA4_INSTR fnmaddpd, fnmadd132pd, fnmadd213pd, fnmadd231pd
-FMA4_INSTR fnmaddps, fnmadd132ps, fnmadd213ps, fnmadd231ps
-FMA4_INSTR fnmaddsd, fnmadd132sd, fnmadd213sd, fnmadd231sd
-FMA4_INSTR fnmaddss, fnmadd132ss, fnmadd213ss, fnmadd231ss
-
-FMA4_INSTR fnmsubpd, fnmsub132pd, fnmsub213pd, fnmsub231pd
-FMA4_INSTR fnmsubps, fnmsub132ps, fnmsub213ps, fnmsub231ps
-FMA4_INSTR fnmsubsd, fnmsub132sd, fnmsub213sd, fnmsub231sd
-FMA4_INSTR fnmsubss, fnmsub132ss, fnmsub213ss, fnmsub231ss
-
-; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug
-%if ARCH_X86_64 == 0
-%macro vpbroadcastq 2
-%if sizeof%1 == 16
-    movddup %1, %2
-%else
-    vbroadcastsd %1, %2
-%endif
-%endmacro
-%endif
diff --git a/deps/libav/libavutil/x86/x86util.asm b/deps/libav/libavutil/x86/x86util.asm
deleted file mode 100644
index 11779cf..0000000
--- a/deps/libav/libavutil/x86/x86util.asm
+++ /dev/null
@@ -1,680 +0,0 @@
-;*****************************************************************************
-;* x86util.asm
-;*****************************************************************************
-;* Copyright (C) 2008-2010 x264 project
-;*
-;* Authors: Loren Merritt <lorenm at u.washington.edu>
-;*          Holger Lubitz <holger at lubitz.org>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%define private_prefix ff
-%define public_prefix  avpriv
-%define cpuflags_mmxext cpuflags_mmx2
-
-%include "libavutil/x86/x86inc.asm"
-
-%macro SBUTTERFLY 4
-%if avx_enabled == 0
-    mova      m%4, m%2
-    punpckl%1 m%2, m%3
-    punpckh%1 m%4, m%3
-%else
-    punpckh%1 m%4, m%2, m%3
-    punpckl%1 m%2, m%3
-%endif
-    SWAP %3, %4
-%endmacro
-
-%macro SBUTTERFLY2 4
-    punpckl%1 m%4, m%2, m%3
-    punpckh%1 m%2, m%2, m%3
-    SWAP %2, %4, %3
-%endmacro
-
-%macro SBUTTERFLYPS 3
-    unpcklps m%3, m%1, m%2
-    unpckhps m%1, m%1, m%2
-    SWAP %1, %3, %2
-%endmacro
-
-%macro TRANSPOSE4x4B 5
-    SBUTTERFLY bw, %1, %2, %5
-    SBUTTERFLY bw, %3, %4, %5
-    SBUTTERFLY wd, %1, %3, %5
-    SBUTTERFLY wd, %2, %4, %5
-    SWAP %2, %3
-%endmacro
-
-%macro TRANSPOSE4x4W 5
-    SBUTTERFLY wd, %1, %2, %5
-    SBUTTERFLY wd, %3, %4, %5
-    SBUTTERFLY dq, %1, %3, %5
-    SBUTTERFLY dq, %2, %4, %5
-    SWAP %2, %3
-%endmacro
-
-%macro TRANSPOSE2x4x4W 5
-    SBUTTERFLY wd,  %1, %2, %5
-    SBUTTERFLY wd,  %3, %4, %5
-    SBUTTERFLY dq,  %1, %3, %5
-    SBUTTERFLY dq,  %2, %4, %5
-    SBUTTERFLY qdq, %1, %2, %5
-    SBUTTERFLY qdq, %3, %4, %5
-%endmacro
-
-%macro TRANSPOSE4x4D 5
-    SBUTTERFLY dq,  %1, %2, %5
-    SBUTTERFLY dq,  %3, %4, %5
-    SBUTTERFLY qdq, %1, %3, %5
-    SBUTTERFLY qdq, %2, %4, %5
-    SWAP %2, %3
-%endmacro
-
-; identical behavior to TRANSPOSE4x4D, but using SSE1 float ops
-%macro TRANSPOSE4x4PS 5
-    SBUTTERFLYPS %1, %2, %5
-    SBUTTERFLYPS %3, %4, %5
-    movlhps m%5, m%1, m%3
-    movhlps m%3, m%1
-    SWAP %5, %1
-    movlhps m%5, m%2, m%4
-    movhlps m%4, m%2
-    SWAP %5, %2, %3
-%endmacro
-
-%macro TRANSPOSE8x8W 9-11
-%if ARCH_X86_64
-    SBUTTERFLY wd,  %1, %2, %9
-    SBUTTERFLY wd,  %3, %4, %9
-    SBUTTERFLY wd,  %5, %6, %9
-    SBUTTERFLY wd,  %7, %8, %9
-    SBUTTERFLY dq,  %1, %3, %9
-    SBUTTERFLY dq,  %2, %4, %9
-    SBUTTERFLY dq,  %5, %7, %9
-    SBUTTERFLY dq,  %6, %8, %9
-    SBUTTERFLY qdq, %1, %5, %9
-    SBUTTERFLY qdq, %2, %6, %9
-    SBUTTERFLY qdq, %3, %7, %9
-    SBUTTERFLY qdq, %4, %8, %9
-    SWAP %2, %5
-    SWAP %4, %7
-%else
-; in:  m0..m7, unless %11 in which case m6 is in %9
-; out: m0..m7, unless %11 in which case m4 is in %10
-; spills into %9 and %10
-%if %0<11
-    movdqa %9, m%7
-%endif
-    SBUTTERFLY wd,  %1, %2, %7
-    movdqa %10, m%2
-    movdqa m%7, %9
-    SBUTTERFLY wd,  %3, %4, %2
-    SBUTTERFLY wd,  %5, %6, %2
-    SBUTTERFLY wd,  %7, %8, %2
-    SBUTTERFLY dq,  %1, %3, %2
-    movdqa %9, m%3
-    movdqa m%2, %10
-    SBUTTERFLY dq,  %2, %4, %3
-    SBUTTERFLY dq,  %5, %7, %3
-    SBUTTERFLY dq,  %6, %8, %3
-    SBUTTERFLY qdq, %1, %5, %3
-    SBUTTERFLY qdq, %2, %6, %3
-    movdqa %10, m%2
-    movdqa m%3, %9
-    SBUTTERFLY qdq, %3, %7, %2
-    SBUTTERFLY qdq, %4, %8, %2
-    SWAP %2, %5
-    SWAP %4, %7
-%if %0<11
-    movdqa m%5, %10
-%endif
-%endif
-%endmacro
-
-; PABSW macro assumes %1 != %2, while ABS1/2 macros work in-place
-%macro PABSW 2
-%if cpuflag(ssse3)
-    pabsw      %1, %2
-%elif cpuflag(mmxext)
-    pxor    %1, %1
-    psubw   %1, %2
-    pmaxsw  %1, %2
-%else
-    pxor       %1, %1
-    pcmpgtw    %1, %2
-    pxor       %2, %1
-    psubw      %2, %1
-    SWAP       %1, %2
-%endif
-%endmacro
-
-%macro PSIGNW_MMX 2
-    pxor       %1, %2
-    psubw      %1, %2
-%endmacro
-
-%macro PSIGNW_SSSE3 2
-    psignw     %1, %2
-%endmacro
-
-%macro ABS1 2
-%if cpuflag(ssse3)
-    pabsw   %1, %1
-%elif cpuflag(mmxext) ; a, tmp
-    pxor    %2, %2
-    psubw   %2, %1
-    pmaxsw  %1, %2
-%else ; a, tmp
-    pxor       %2, %2
-    pcmpgtw    %2, %1
-    pxor       %1, %2
-    psubw      %1, %2
-%endif
-%endmacro
-
-%macro ABS2 4
-%if cpuflag(ssse3)
-    pabsw   %1, %1
-    pabsw   %2, %2
-%elif cpuflag(mmxext) ; a, b, tmp0, tmp1
-    pxor    %3, %3
-    pxor    %4, %4
-    psubw   %3, %1
-    psubw   %4, %2
-    pmaxsw  %1, %3
-    pmaxsw  %2, %4
-%else ; a, b, tmp0, tmp1
-    pxor       %3, %3
-    pxor       %4, %4
-    pcmpgtw    %3, %1
-    pcmpgtw    %4, %2
-    pxor       %1, %3
-    pxor       %2, %4
-    psubw      %1, %3
-    psubw      %2, %4
-%endif
-%endmacro
-
-%macro ABSB 2 ; source mmreg, temp mmreg (unused for ssse3)
-%if cpuflag(ssse3)
-    pabsb   %1, %1
-%else
-    pxor    %2, %2
-    psubb   %2, %1
-    pminub  %1, %2
-%endif
-%endmacro
-
-%macro ABSB2 4 ; src1, src2, tmp1, tmp2 (tmp1/2 unused for SSSE3)
-%if cpuflag(ssse3)
-    pabsb   %1, %1
-    pabsb   %2, %2
-%else
-    pxor    %3, %3
-    pxor    %4, %4
-    psubb   %3, %1
-    psubb   %4, %2
-    pminub  %1, %3
-    pminub  %2, %4
-%endif
-%endmacro
-
-%macro ABSD2_MMX 4
-    pxor    %3, %3
-    pxor    %4, %4
-    pcmpgtd %3, %1
-    pcmpgtd %4, %2
-    pxor    %1, %3
-    pxor    %2, %4
-    psubd   %1, %3
-    psubd   %2, %4
-%endmacro
-
-%macro ABS4 6
-    ABS2 %1, %2, %5, %6
-    ABS2 %3, %4, %5, %6
-%endmacro
-
-%macro SPLATB_LOAD 3
-%if cpuflag(ssse3)
-    movd      %1, [%2-3]
-    pshufb    %1, %3
-%else
-    movd      %1, [%2-3] ;to avoid crossing a cacheline
-    punpcklbw %1, %1
-    SPLATW    %1, %1, 3
-%endif
-%endmacro
-
-%macro SPLATB_REG 3
-%if cpuflag(ssse3)
-    movd      %1, %2d
-    pshufb    %1, %3
-%else
-    movd      %1, %2d
-    punpcklbw %1, %1
-    SPLATW    %1, %1, 0
-%endif
-%endmacro
-
-%macro PALIGNR 4-5
-%if cpuflag(ssse3)
-%if %0==5
-    palignr %1, %2, %3, %4
-%else
-    palignr %1, %2, %3
-%endif
-%elif cpuflag(mmx) ; [dst,] src1, src2, imm, tmp
-    %define %%dst %1
-%if %0==5
-%ifnidn %1, %2
-    mova    %%dst, %2
-%endif
-    %rotate 1
-%endif
-%ifnidn %4, %2
-    mova    %4, %2
-%endif
-%if mmsize==8
-    psllq   %%dst, (8-%3)*8
-    psrlq   %4, %3*8
-%else
-    pslldq  %%dst, 16-%3
-    psrldq  %4, %3
-%endif
-    por     %%dst, %4
-%endif
-%endmacro
-
-%macro PAVGB 2
-%if cpuflag(mmxext)
-    pavgb   %1, %2
-%elif cpuflag(3dnow)
-    pavgusb %1, %2
-%endif
-%endmacro
-
-%macro PSHUFLW 1+
-    %if mmsize == 8
-        pshufw %1
-    %else
-        pshuflw %1
-    %endif
-%endmacro
-
-%macro PSWAPD 2
-%if cpuflag(mmxext)
-    pshufw    %1, %2, q1032
-%elif cpuflag(3dnowext)
-    pswapd    %1, %2
-%elif cpuflag(3dnow)
-    movq      %1, %2
-    psrlq     %1, 32
-    punpckldq %1, %2
-%endif
-%endmacro
-
-%macro DEINTB 5 ; mask, reg1, mask, reg2, optional src to fill masks from
-%ifnum %5
-    pand   m%3, m%5, m%4 ; src .. y6 .. y4
-    pand   m%1, m%5, m%2 ; dst .. y6 .. y4
-%else
-    mova   m%1, %5
-    pand   m%3, m%1, m%4 ; src .. y6 .. y4
-    pand   m%1, m%1, m%2 ; dst .. y6 .. y4
-%endif
-    psrlw  m%2, 8        ; dst .. y7 .. y5
-    psrlw  m%4, 8        ; src .. y7 .. y5
-%endmacro
-
-%macro SUMSUB_BA 3-4
-%if %0==3
-    padd%1  m%2, m%3
-    padd%1  m%3, m%3
-    psub%1  m%3, m%2
-%else
-%if avx_enabled == 0
-    mova    m%4, m%2
-    padd%1  m%2, m%3
-    psub%1  m%3, m%4
-%else
-    padd%1  m%4, m%2, m%3
-    psub%1  m%3, m%2
-    SWAP    %2, %4
-%endif
-%endif
-%endmacro
-
-%macro SUMSUB_BADC 5-6
-%if %0==6
-    SUMSUB_BA %1, %2, %3, %6
-    SUMSUB_BA %1, %4, %5, %6
-%else
-    padd%1  m%2, m%3
-    padd%1  m%4, m%5
-    padd%1  m%3, m%3
-    padd%1  m%5, m%5
-    psub%1  m%3, m%2
-    psub%1  m%5, m%4
-%endif
-%endmacro
-
-%macro SUMSUB2_AB 4
-%ifnum %3
-    psub%1  m%4, m%2, m%3
-    psub%1  m%4, m%3
-    padd%1  m%2, m%2
-    padd%1  m%2, m%3
-%else
-    mova    m%4, m%2
-    padd%1  m%2, m%2
-    padd%1  m%2, %3
-    psub%1  m%4, %3
-    psub%1  m%4, %3
-%endif
-%endmacro
-
-%macro SUMSUB2_BA 4
-%if avx_enabled == 0
-    mova    m%4, m%2
-    padd%1  m%2, m%3
-    padd%1  m%2, m%3
-    psub%1  m%3, m%4
-    psub%1  m%3, m%4
-%else
-    padd%1  m%4, m%2, m%3
-    padd%1  m%4, m%3
-    psub%1  m%3, m%2
-    psub%1  m%3, m%2
-    SWAP     %2,  %4
-%endif
-%endmacro
-
-%macro SUMSUBD2_AB 5
-%ifnum %4
-    psra%1  m%5, m%2, 1  ; %3: %3>>1
-    psra%1  m%4, m%3, 1  ; %2: %2>>1
-    padd%1  m%4, m%2     ; %3: %3>>1+%2
-    psub%1  m%5, m%3     ; %2: %2>>1-%3
-    SWAP     %2, %5
-    SWAP     %3, %4
-%else
-    mova    %5, m%2
-    mova    %4, m%3
-    psra%1  m%3, 1  ; %3: %3>>1
-    psra%1  m%2, 1  ; %2: %2>>1
-    padd%1  m%3, %5 ; %3: %3>>1+%2
-    psub%1  m%2, %4 ; %2: %2>>1-%3
-%endif
-%endmacro
-
-%macro DCT4_1D 5
-%ifnum %5
-    SUMSUB_BADC w, %4, %1, %3, %2, %5
-    SUMSUB_BA   w, %3, %4, %5
-    SUMSUB2_AB  w, %1, %2, %5
-    SWAP %1, %3, %4, %5, %2
-%else
-    SUMSUB_BADC w, %4, %1, %3, %2
-    SUMSUB_BA   w, %3, %4
-    mova     [%5], m%2
-    SUMSUB2_AB  w, %1, [%5], %2
-    SWAP %1, %3, %4, %2
-%endif
-%endmacro
-
-%macro IDCT4_1D 6-7
-%ifnum %6
-    SUMSUBD2_AB %1, %3, %5, %7, %6
-    ; %3: %3>>1-%5 %5: %3+%5>>1
-    SUMSUB_BA   %1, %4, %2, %7
-    ; %4: %2+%4 %2: %2-%4
-    SUMSUB_BADC %1, %5, %4, %3, %2, %7
-    ; %5: %2+%4 + (%3+%5>>1)
-    ; %4: %2+%4 - (%3+%5>>1)
-    ; %3: %2-%4 + (%3>>1-%5)
-    ; %2: %2-%4 - (%3>>1-%5)
-%else
-%ifidn %1, w
-    SUMSUBD2_AB %1, %3, %5, [%6], [%6+16]
-%else
-    SUMSUBD2_AB %1, %3, %5, [%6], [%6+32]
-%endif
-    SUMSUB_BA   %1, %4, %2
-    SUMSUB_BADC %1, %5, %4, %3, %2
-%endif
-    SWAP %2, %5, %4
-    ; %2: %2+%4 + (%3+%5>>1) row0
-    ; %3: %2-%4 + (%3>>1-%5) row1
-    ; %4: %2-%4 - (%3>>1-%5) row2
-    ; %5: %2+%4 - (%3+%5>>1) row3
-%endmacro
-
-
-%macro LOAD_DIFF 5
-%ifidn %3, none
-    movh       %1, %4
-    movh       %2, %5
-    punpcklbw  %1, %2
-    punpcklbw  %2, %2
-    psubw      %1, %2
-%else
-    movh       %1, %4
-    punpcklbw  %1, %3
-    movh       %2, %5
-    punpcklbw  %2, %3
-    psubw      %1, %2
-%endif
-%endmacro
-
-%macro STORE_DCT 6
-    movq   [%5+%6+ 0], m%1
-    movq   [%5+%6+ 8], m%2
-    movq   [%5+%6+16], m%3
-    movq   [%5+%6+24], m%4
-    movhps [%5+%6+32], m%1
-    movhps [%5+%6+40], m%2
-    movhps [%5+%6+48], m%3
-    movhps [%5+%6+56], m%4
-%endmacro
-
-%macro LOAD_DIFF_8x4P 7-10 r0,r2,0 ; 4x dest, 2x temp, 2x pointer, increment?
-    LOAD_DIFF m%1, m%5, m%7, [%8],      [%9]
-    LOAD_DIFF m%2, m%6, m%7, [%8+r1],   [%9+r3]
-    LOAD_DIFF m%3, m%5, m%7, [%8+2*r1], [%9+2*r3]
-    LOAD_DIFF m%4, m%6, m%7, [%8+r4],   [%9+r5]
-%if %10
-    lea %8, [%8+4*r1]
-    lea %9, [%9+4*r3]
-%endif
-%endmacro
-
-%macro DIFFx2 6-7
-    movh       %3, %5
-    punpcklbw  %3, %4
-    psraw      %1, 6
-    paddsw     %1, %3
-    movh       %3, %6
-    punpcklbw  %3, %4
-    psraw      %2, 6
-    paddsw     %2, %3
-    packuswb   %2, %1
-%endmacro
-
-%macro STORE_DIFF 4
-    movh       %2, %4
-    punpcklbw  %2, %3
-    psraw      %1, 6
-    paddsw     %1, %2
-    packuswb   %1, %1
-    movh       %4, %1
-%endmacro
-
-%macro STORE_DIFFx2 8 ; add1, add2, reg1, reg2, zero, shift, source, stride
-    movh       %3, [%7]
-    movh       %4, [%7+%8]
-    psraw      %1, %6
-    psraw      %2, %6
-    punpcklbw  %3, %5
-    punpcklbw  %4, %5
-    paddw      %3, %1
-    paddw      %4, %2
-    packuswb   %3, %5
-    packuswb   %4, %5
-    movh     [%7], %3
-    movh  [%7+%8], %4
-%endmacro
-
-%macro PMINUB 3 ; dst, src, ignored
-%if cpuflag(mmxext)
-    pminub   %1, %2
-%else ; dst, src, tmp
-    mova     %3, %1
-    psubusb  %3, %2
-    psubb    %1, %3
-%endif
-%endmacro
-
-%macro SPLATW 2-3 0
-%if mmsize == 16
-    pshuflw    %1, %2, (%3)*0x55
-    punpcklqdq %1, %1
-%elif cpuflag(mmxext)
-    pshufw     %1, %2, (%3)*0x55
-%else
-    %ifnidn %1, %2
-        mova       %1, %2
-    %endif
-    %if %3 & 2
-        punpckhwd  %1, %1
-    %else
-        punpcklwd  %1, %1
-    %endif
-    %if %3 & 1
-        punpckhwd  %1, %1
-    %else
-        punpcklwd  %1, %1
-    %endif
-%endif
-%endmacro
-
-%macro SPLATD 1
-%if mmsize == 8
-    punpckldq  %1, %1
-%elif cpuflag(sse2)
-    pshufd  %1, %1, 0
-%elif cpuflag(sse)
-    shufps  %1, %1, 0
-%endif
-%endmacro
-
-%macro CLIPW 3 ;(dst, min, max)
-    pmaxsw %1, %2
-    pminsw %1, %3
-%endmacro
-
-%macro PMINSD_MMX 3 ; dst, src, tmp
-    mova      %3, %2
-    pcmpgtd   %3, %1
-    pxor      %1, %2
-    pand      %1, %3
-    pxor      %1, %2
-%endmacro
-
-%macro PMAXSD_MMX 3 ; dst, src, tmp
-    mova      %3, %1
-    pcmpgtd   %3, %2
-    pand      %1, %3
-    pandn     %3, %2
-    por       %1, %3
-%endmacro
-
-%macro CLIPD_MMX 3-4 ; src/dst, min, max, tmp
-    PMINSD_MMX %1, %3, %4
-    PMAXSD_MMX %1, %2, %4
-%endmacro
-
-%macro CLIPD_SSE2 3-4 ; src/dst, min (float), max (float), unused
-    cvtdq2ps  %1, %1
-    minps     %1, %3
-    maxps     %1, %2
-    cvtps2dq  %1, %1
-%endmacro
-
-%macro CLIPD_SSE41 3-4 ;  src/dst, min, max, unused
-    pminsd  %1, %3
-    pmaxsd  %1, %2
-%endmacro
-
-%macro VBROADCASTSS 2 ; dst xmm/ymm, src m32
-%if cpuflag(avx)
-    vbroadcastss %1, %2
-%else ; sse
-    movss        %1, %2
-    shufps       %1, %1, 0
-%endif
-%endmacro
-
-%macro VBROADCASTSD 2 ; dst xmm/ymm, src m64
-%if cpuflag(avx) && mmsize == 32
-    vbroadcastsd %1, %2
-%elif cpuflag(sse3)
-    movddup      %1, %2
-%else ; sse2
-    movsd        %1, %2
-    movlhps      %1, %1
-%endif
-%endmacro
-
-%macro SHUFFLE_MASK_W 8
-    %rep 8
-        %if %1>=0x80
-            db %1, %1
-        %else
-            db %1*2
-            db %1*2+1
-        %endif
-        %rotate 1
-    %endrep
-%endmacro
-
-%macro PMOVSXWD 2; dst, src
-%if cpuflag(sse4)
-    pmovsxwd     %1, %2
-%else
-    %ifnidn %1, %2
-    mova         %1, %2
-    %endif
-    punpcklwd    %1, %1
-    psrad        %1, 16
-%endif
-%endmacro
-
-; Wrapper for non-FMA version of fmaddps
-%macro FMULADD_PS 5
-    %if cpuflag(fma3) || cpuflag(fma4)
-        fmaddps %1, %2, %3, %4
-    %elifidn %1, %4
-        mulps   %5, %2, %3
-        addps   %1, %4, %5
-    %else
-        mulps   %1, %2, %3
-        addps   %1, %4
-    %endif
-%endmacro
diff --git a/deps/libav/libavutil/xtea.c b/deps/libav/libavutil/xtea.c
deleted file mode 100644
index d1efebf..0000000
--- a/deps/libav/libavutil/xtea.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * A 32-bit implementation of the XTEA algorithm
- * Copyright (c) 2012 Samuel Pitoiset
- *
- * loosely based on the implementation of David Wheeler and Roger Needham
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avutil.h"
-#include "common.h"
-#include "intreadwrite.h"
-#include "xtea.h"
-
-void av_xtea_init(AVXTEA *ctx, const uint8_t key[16])
-{
-    int i;
-
-    for (i = 0; i < 4; i++)
-        ctx->key[i] = AV_RB32(key + (i << 2));
-}
-
-static void xtea_crypt_ecb(AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
-                           int decrypt, uint8_t *iv)
-{
-    uint32_t v0, v1;
-    int i;
-
-    v0 = AV_RB32(src);
-    v1 = AV_RB32(src + 4);
-
-    if (decrypt) {
-        uint32_t delta = 0x9E3779B9, sum = delta * 32;
-
-        for (i = 0; i < 32; i++) {
-            v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + ctx->key[(sum >> 11) & 3]);
-            sum -= delta;
-            v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + ctx->key[sum & 3]);
-        }
-        if (iv) {
-            v0 ^= AV_RB32(iv);
-            v1 ^= AV_RB32(iv + 4);
-            memcpy(iv, src, 8);
-        }
-    } else {
-        uint32_t sum = 0, delta = 0x9E3779B9;
-
-        for (i = 0; i < 32; i++) {
-            v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + ctx->key[sum & 3]);
-            sum += delta;
-            v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + ctx->key[(sum >> 11) & 3]);
-        }
-    }
-
-    AV_WB32(dst, v0);
-    AV_WB32(dst + 4, v1);
-}
-
-void av_xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
-                   uint8_t *iv, int decrypt)
-{
-    int i;
-
-    if (decrypt) {
-        while (count--) {
-            xtea_crypt_ecb(ctx, dst, src, decrypt, iv);
-
-            src   += 8;
-            dst   += 8;
-        }
-    } else {
-        while (count--) {
-            if (iv) {
-                for (i = 0; i < 8; i++)
-                    dst[i] = src[i] ^ iv[i];
-                xtea_crypt_ecb(ctx, dst, dst, decrypt, NULL);
-                memcpy(iv, dst, 8);
-            } else {
-                xtea_crypt_ecb(ctx, dst, src, decrypt, NULL);
-            }
-            src   += 8;
-            dst   += 8;
-        }
-    }
-}
-
-#ifdef TEST
-#include <stdio.h>
-
-#define XTEA_NUM_TESTS 6
-
-static const uint8_t xtea_test_key[XTEA_NUM_TESTS][16] = {
-    { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-      0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
-    { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-      0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
-    { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-      0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
-    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
-};
-
-static const uint8_t xtea_test_pt[XTEA_NUM_TESTS][8] = {
-    { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 },
-    { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 },
-    { 0x5a, 0x5b, 0x6e, 0x27, 0x89, 0x48, 0xd7, 0x7f },
-    { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 },
-    { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 },
-    { 0x70, 0xe1, 0x22, 0x5d, 0x6e, 0x4e, 0x76, 0x55 }
-};
-
-static const uint8_t xtea_test_ct[XTEA_NUM_TESTS][8] = {
-    { 0x49, 0x7d, 0xf3, 0xd0, 0x72, 0x61, 0x2c, 0xb5 },
-    { 0xe7, 0x8f, 0x2d, 0x13, 0x74, 0x43, 0x41, 0xd8 },
-    { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 },
-    { 0xa0, 0x39, 0x05, 0x89, 0xf8, 0xb8, 0xef, 0xa5 },
-    { 0xed, 0x23, 0x37, 0x5a, 0x82, 0x1a, 0x8c, 0x2d },
-    { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 }
-};
-
-static void test_xtea(AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
-                      const uint8_t *ref, int len, uint8_t *iv, int dir,
-                      const char *test)
-{
-    av_xtea_crypt(ctx, dst, src, len, iv, dir);
-    if (memcmp(dst, ref, 8*len)) {
-        int i;
-        printf("%s failed\ngot      ", test);
-        for (i = 0; i < 8*len; i++)
-            printf("%02x ", dst[i]);
-        printf("\nexpected ");
-        for (i = 0; i < 8*len; i++)
-            printf("%02x ", ref[i]);
-        printf("\n");
-        exit(1);
-    }
-}
-
-int main(void)
-{
-    AVXTEA ctx;
-    uint8_t buf[8], iv[8];
-    int i;
-    const uint8_t src[32] = "HelloWorldHelloWorldHelloWorld";
-    uint8_t ct[32];
-    uint8_t pl[32];
-
-    for (i = 0; i < XTEA_NUM_TESTS; i++) {
-        av_xtea_init(&ctx, xtea_test_key[i]);
-
-        test_xtea(&ctx, buf, xtea_test_pt[i], xtea_test_ct[i], 1, NULL, 0, "encryption");
-        test_xtea(&ctx, buf, xtea_test_ct[i], xtea_test_pt[i], 1, NULL, 1, "decryption");
-
-        /* encrypt */
-        memcpy(iv, "HALLO123", 8);
-        av_xtea_crypt(&ctx, ct, src, 4, iv, 0);
-
-        /* decrypt into pl */
-        memcpy(iv, "HALLO123", 8);
-        test_xtea(&ctx, pl, ct, src, 4, iv, 1, "CBC decryption");
-
-        memcpy(iv, "HALLO123", 8);
-        test_xtea(&ctx, ct, ct, src, 4, iv, 1, "CBC inplace decryption");
-    }
-    printf("Test encryption/decryption success.\n");
-
-    return 0;
-}
-
-#endif
diff --git a/deps/libav/libavutil/xtea.h b/deps/libav/libavutil/xtea.h
deleted file mode 100644
index 7d2b07b..0000000
--- a/deps/libav/libavutil/xtea.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * A 32-bit implementation of the XTEA algorithm
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_XTEA_H
-#define AVUTIL_XTEA_H
-
-#include <stdint.h>
-
-/**
- * @defgroup lavu_xtea XTEA
- * @ingroup lavu_crypto
- * @{
- */
-
-typedef struct AVXTEA {
-    uint32_t key[16];
-} AVXTEA;
-
-/**
- * Initialize an AVXTEA context.
- *
- * @param ctx an AVXTEA context
- * @param key a key of 16 bytes used for encryption/decryption
- */
-void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
-
-/**
- * Encrypt or decrypt a buffer using a previously initialized context.
- *
- * @param ctx an AVXTEA context
- * @param dst destination array, can be equal to src
- * @param src source array, can be equal to dst
- * @param count number of 8 byte blocks
- * @param iv initialization vector for CBC mode, if NULL then ECB will be used
- * @param decrypt 0 for encryption, 1 for decryption
- */
-void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
-                   int count, uint8_t *iv, int decrypt);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_XTEA_H */
diff --git a/deps/libav/library.mak b/deps/libav/library.mak
deleted file mode 100644
index af33206..0000000
--- a/deps/libav/library.mak
+++ /dev/null
@@ -1,106 +0,0 @@
-include $(SRC_PATH)/common.mak
-
-LIBVERSION := $(lib$(NAME)_VERSION)
-LIBMAJOR   := $(lib$(NAME)_VERSION_MAJOR)
-LIBMINOR   := $(lib$(NAME)_VERSION_MINOR)
-INCINSTDIR := $(INCDIR)/lib$(NAME)
-
-INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)
-
-all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
-all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
-
-$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
-	$(COMPILE_C)
-
-$(SUBDIR)%-test.o: $(SUBDIR)%.c
-	$(COMPILE_C)
-
-$(SUBDIR)%-test.i: $(SUBDIR)%-test.c
-	$(CC) $(CCFLAGS) $(CC_E) $<
-
-$(SUBDIR)%-test.i: $(SUBDIR)%.c
-	$(CC) $(CCFLAGS) $(CC_E) $<
-
-$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
-	$(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
-	$(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
-	-$(STRIP) $(STRIPFLAGS) $@
-
-LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
-$(LIBOBJS) $(LIBOBJS:.o=.i):   CPPFLAGS += -DHAVE_AV_CONFIG_H
-$(TESTOBJS) $(TESTOBJS:.o=.i): CPPFLAGS += -DTEST
-
-$(SUBDIR)$(LIBNAME): $(OBJS)
-	$(RM) $@
-	$(AR) $(ARFLAGS) $(AR_O) $^
-	$(RANLIB) $@
-
-install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
-
-install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
-install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
-
-define RULES
-$(TOOLS):     THISLIB = $(FULLNAME:%=$(LD_LIB))
-$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
-
-$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
-	$$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
-
-$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
-	$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
-
-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS)
-	$(SLIB_CREATE_DEF_CMD)
-	$$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
-	$(SLIB_EXTRA_CMD)
-
-clean::
-	$(RM) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
-	    $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%)
-
-distclean:: clean
-	$(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%)
-
-install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
-	$(Q)mkdir -p "$(SHLIBDIR)"
-	$$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
-	$(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);)
-	$(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
-	$(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
-	$(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
-
-install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
-	$(Q)mkdir -p "$(LIBDIR)"
-	$$(INSTALL) -m 644 $$< "$(LIBDIR)"
-	$(LIB_INSTALL_EXTRA_CMD)
-
-install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
-	$(Q)mkdir -p "$(INCINSTDIR)"
-	$$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
-
-install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(NAME).pc
-	$(Q)mkdir -p "$(LIBDIR)/pkgconfig"
-	$$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
-
-uninstall-libs::
-	-$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
-	       "$(SHLIBDIR)/$(SLIBNAME)"            \
-	       "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
-	-$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)"%)
-	-$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)"%)
-	-$(RM) "$(LIBDIR)/$(LIBNAME)"
-
-uninstall-headers::
-	$(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
-	$(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
-	-rmdir "$(INCINSTDIR)"
-endef
-
-$(eval $(RULES))
-
-$(TOOLS):     $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
-$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME)
-
-testprogs: $(TESTPROGS)
diff --git a/deps/libav/libswscale/Makefile b/deps/libav/libswscale/Makefile
deleted file mode 100644
index 0799b45..0000000
--- a/deps/libav/libswscale/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-NAME = swscale
-FFLIBS = avutil
-
-HEADERS = swscale.h                                                     \
-          version.h                                                     \
-
-OBJS = input.o                                          \
-       options.o                                        \
-       output.o                                         \
-       rgb2rgb.o                                        \
-       swscale.o                                        \
-       swscale_unscaled.o                               \
-       utils.o                                          \
-       yuv2rgb.o                                        \
-
-TESTPROGS = colorspace                                                  \
-            swscale                                                     \
diff --git a/deps/libav/libswscale/bfin/Makefile b/deps/libav/libswscale/bfin/Makefile
deleted file mode 100644
index 5f34550..0000000
--- a/deps/libav/libswscale/bfin/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-OBJS +=  bfin/internal_bfin.o                                           \
-         bfin/swscale_bfin.o                                            \
-         bfin/yuv2rgb_bfin.o                                            \
diff --git a/deps/libav/libswscale/bfin/internal_bfin.S b/deps/libav/libswscale/bfin/internal_bfin.S
deleted file mode 100644
index b007f07..0000000
--- a/deps/libav/libswscale/bfin/internal_bfin.S
+++ /dev/null
@@ -1,613 +0,0 @@
-/*
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *                    April 20, 2007
- *
- * Blackfin video color space converter operations
- * convert I420 YV12 to RGB in various formats
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-/*
-YUV420 to RGB565 conversion. This routine takes a YUV 420 planar macroblock
-and converts it to RGB565. R:5 bits, G:6 bits, B:5 bits.. packed into shorts.
-
-
-The following calculation is used for the conversion:
-
-  r = clipz((y - oy) * cy  + crv * (v - 128))
-  g = clipz((y - oy) * cy  + cgv * (v - 128) + cgu * (u - 128))
-  b = clipz((y - oy) * cy  + cbu * (u - 128))
-
-y, u, v are prescaled by a factor of 4 i.e. left-shifted to gain precision.
-
-
-New factorization to eliminate the truncation error which was
-occurring due to the byteop3p.
-
-
-1) Use the bytop16m to subtract quad bytes we use this in U8 this
- then so the offsets need to be renormalized to 8bits.
-
-2) Scale operands up by a factor of 4 not 8 because Blackfin
-   multiplies include a shift.
-
-3) Compute into the accumulators cy * yx0, cy * yx1.
-
-4) Compute each of the linear equations:
-     r = clipz((y - oy) * cy  + crv * (v - 128))
-
-     g = clipz((y - oy) * cy  + cgv * (v - 128) + cgu * (u - 128))
-
-     b = clipz((y - oy) * cy  + cbu * (u - 128))
-
-   Reuse of the accumulators requires that we actually multiply
-   twice once with addition and the second time with a subtraction.
-
-   Because of this we need to compute the equations in the order R B
-   then G saving the writes for B in the case of 24/32 bit color
-   formats.
-
-   API: yuv2rgb_kind (uint8_t *Y, uint8_t *U, uint8_t *V, int *out,
-                      int dW, uint32_t *coeffs);
-
-       A          B
-       ---        ---
-       i2 = cb    i3 = cr
-       i1 = coeff i0 = y
-
-Where coeffs have the following layout in memory.
-
-uint32_t oy, oc, zero, cy, crv, rmask, cbu, bmask, cgu, cgv;
-
-coeffs is a pointer to oy.
-
-The {rgb} masks are only utilized by the 565 packing algorithm. Note the data
-replication is used to simplify the internal algorithms for the dual Mac
-architecture of BlackFin.
-
-All routines are exported with _ff_bfin_ as a symbol prefix.
-
-Rough performance gain compared against -O3:
-
-2779809/1484290 187.28%
-
-which translates to ~33c/pel to ~57c/pel for the reference vs 17.5
-c/pel for the optimized implementations. Not sure why there is such a
-huge variation on the reference codes on Blackfin I guess it must have
-to do with the memory system.
-*/
-
-#define mL3 .text
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define mL1 .l1.text
-#else
-#define mL1 mL3
-#endif
-#define MEM mL1
-
-#define DEFUN(fname,where,interface) \
-        .section where;              \
-        .global _ff_bfin_ ## fname;  \
-        .type _ff_bfin_ ## fname, STT_FUNC; \
-        .align 8;                    \
-        _ff_bfin_ ## fname
-
-#define DEFUN_END(fname) \
-        .size _ff_bfin_ ## fname, . - _ff_bfin_ ## fname
-
-
-.text
-
-#define COEFF_LEN        11*4
-#define COEFF_REL_CY_OFF 4*4
-
-#define ARG_OUT   20
-#define ARG_W     24
-#define ARG_COEFF 28
-
-DEFUN(yuv2rgb565_line,MEM,
-   (uint8_t *Y, uint8_t *U, uint8_t *V, int *out, int dW, uint32_t *coeffs)):
-        link 0;
-        [--sp] = (r7:4);
-        p1 = [fp+ARG_OUT];
-        r3 = [fp+ARG_W];
-
-        i0 = r0;
-        i2 = r1;
-        i3 = r2;
-
-        r0 = [fp+ARG_COEFF];
-        i1 = r0;
-        b1 = i1;
-        l1 = COEFF_LEN;
-        m0 = COEFF_REL_CY_OFF;
-        p0 = r3;
-
-        r0   = [i0++];         // 2Y
-        r1.l = w[i2++];        // 2u
-        r1.h = w[i3++];        // 2v
-        p0 = p0>>2;
-
-        lsetup (.L0565, .L1565) lc0 = p0;
-
-        /*
-           uint32_t oy,oc,zero,cy,crv,rmask,cbu,bmask,cgu,cgv
-           r0 -- used to load 4ys
-           r1 -- used to load 2us,2vs
-           r4 -- y3,y2
-           r5 -- y1,y0
-           r6 -- u1,u0
-           r7 -- v1,v0
-        */
-                                                              r2=[i1++]; // oy
-.L0565:
-        /*
-        rrrrrrrr gggggggg bbbbbbbb
-         5432109876543210
-                    bbbbb >>3
-              gggggggg    <<3
-         rrrrrrrr         <<8
-         rrrrrggggggbbbbb
-        */
-        (r4,r5) = byteop16m (r1:0, r3:2)                   || r3=[i1++]; // oc
-        (r7,r6) = byteop16m (r1:0, r3:2) (r);
-        r5 = r5 << 2 (v);                                                // y1,y0
-        r4 = r4 << 2 (v);                                                // y3,y2
-        r6 = r6 << 2 (v)                                   || r0=[i1++]; // u1,u0, r0=zero
-        r7 = r7 << 2 (v)                                   || r1=[i1++]; // v1,v0  r1=cy
-        /* Y' = y*cy */
-        a1 = r1.h*r5.h, a0 = r1.l*r5.l                     || r1=[i1++]; // crv
-
-        /* R = Y+ crv*(Cr-128) */
-        r2.h = (a1 += r1.h*r7.l), r2.l = (a0 += r1.l*r7.l);
-                a1 -= r1.h*r7.l,          a0 -= r1.l*r7.l  || r5=[i1++]; // rmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cbu
-        r2 = r2 >> 3 (v);
-        r3 = r2 & r5;
-
-        /* B = Y+ cbu*(Cb-128) */
-        r2.h = (a1 += r1.h*r6.l), r2.l = (a0 += r1.l*r6.l);
-                a1 -= r1.h*r6.l,          a0 -= r1.l*r6.l  || r5=[i1++]; // bmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cgu
-        r2 = r2 << 8 (v);
-        r2 = r2 & r5;
-        r3 = r3 | r2;
-
-        /* G = Y+ cgu*(Cb-128)+cgv*(Cr-128) */
-                a1 += r1.h*r6.l,          a0 += r1.l*r6.l  || r1=[i1++]; // cgv
-        r2.h = (a1 += r1.h*r7.l), r2.l = (a0 += r1.l*r7.l);
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r5=[i1++m0]; // gmask
-        r2 = r2 << 3 (v);
-        r2 = r2 & r5;
-        r3 = r3 | r2;
-        [p1++]=r3                                          || r1=[i1++]; // cy
-
-        /* Y' = y*cy */
-
-        a1 = r1.h*r4.h, a0 = r1.l*r4.l                     || r1=[i1++]; // crv
-
-        /* R = Y+ crv*(Cr-128) */
-        r2.h = (a1 += r1.h*r7.h), r2.l = (a0 += r1.l*r7.h);
-                a1 -= r1.h*r7.h,          a0 -= r1.l*r7.h  || r5=[i1++]; // rmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cbu
-        r2 = r2 >> 3 (v);
-        r3 = r2 & r5;
-
-        /* B = Y+ cbu*(Cb-128) */
-        r2.h = (a1 += r1.h*r6.h), r2.l = (a0 += r1.l*r6.h);
-                a1 -= r1.h*r6.h,          a0 -= r1.l*r6.h  || r5=[i1++]; // bmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cgu
-        r2 = r2 << 8 (v);
-        r2 = r2 & r5;
-        r3 = r3 | r2;
-
-        /* G = Y+ cgu*(Cb-128)+cgv*(Cr-128) */
-                a1 += r1.h*r6.h,          a0 += r1.l*r6.h  || r1=[i1++]; // cgv
-        r2.h = (a1 += r1.h*r7.h), r2.l = (a0 += r1.l*r7.h) || r5=[i1++]; // gmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r0   =  [i0++];        // 2Y
-        r2 = r2 << 3 (v)                                   || r1.l = w[i2++];        // 2u
-        r2 = r2 & r5;
-        r3 = r3 | r2;
-        [p1++]=r3                                          || r1.h = w[i3++];        // 2v
-.L1565:                                                       r2=[i1++]; // oy
-
-        l1 = 0;
-
-        (r7:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(yuv2rgb565_line)
-
-DEFUN(yuv2rgb555_line,MEM,
-   (uint8_t *Y, uint8_t *U, uint8_t *V, int *out, int dW, uint32_t *coeffs)):
-        link 0;
-        [--sp] = (r7:4);
-        p1 = [fp+ARG_OUT];
-        r3 = [fp+ARG_W];
-
-        i0 = r0;
-        i2 = r1;
-        i3 = r2;
-
-        r0 = [fp+ARG_COEFF];
-        i1 = r0;
-        b1 = i1;
-        l1 = COEFF_LEN;
-        m0 = COEFF_REL_CY_OFF;
-        p0 = r3;
-
-        r0   = [i0++];         // 2Y
-        r1.l = w[i2++];        // 2u
-        r1.h = w[i3++];        // 2v
-        p0 = p0>>2;
-
-        lsetup (.L0555, .L1555) lc0 = p0;
-
-        /*
-           uint32_t oy,oc,zero,cy,crv,rmask,cbu,bmask,cgu,cgv
-           r0 -- used to load 4ys
-           r1 -- used to load 2us,2vs
-           r4 -- y3,y2
-           r5 -- y1,y0
-           r6 -- u1,u0
-           r7 -- v1,v0
-        */
-                                                              r2=[i1++]; // oy
-.L0555:
-        /*
-        rrrrrrrr gggggggg bbbbbbbb
-         5432109876543210
-                    bbbbb >>3
-               gggggggg   <<2
-          rrrrrrrr        <<7
-         xrrrrrgggggbbbbb
-        */
-
-        (r4,r5) = byteop16m (r1:0, r3:2)                   || r3=[i1++]; // oc
-        (r7,r6) = byteop16m (r1:0, r3:2) (r);
-        r5 = r5 << 2 (v);                                                // y1,y0
-        r4 = r4 << 2 (v);                                                // y3,y2
-        r6 = r6 << 2 (v)                                   || r0=[i1++]; // u1,u0, r0=zero
-        r7 = r7 << 2 (v)                                   || r1=[i1++]; // v1,v0  r1=cy
-        /* Y' = y*cy */
-        a1 = r1.h*r5.h, a0 = r1.l*r5.l                     || r1=[i1++]; // crv
-
-        /* R = Y+ crv*(Cr-128) */
-        r2.h = (a1 += r1.h*r7.l), r2.l = (a0 += r1.l*r7.l);
-                a1 -= r1.h*r7.l,          a0 -= r1.l*r7.l  || r5=[i1++]; // rmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cbu
-        r2 = r2 >> 3 (v);
-        r3 = r2 & r5;
-
-        /* B = Y+ cbu*(Cb-128) */
-        r2.h = (a1 += r1.h*r6.l), r2.l = (a0 += r1.l*r6.l);
-                a1 -= r1.h*r6.l,          a0 -= r1.l*r6.l  || r5=[i1++]; // bmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cgu
-        r2 = r2 << 7 (v);
-        r2 = r2 & r5;
-        r3 = r3 | r2;
-
-        /* G = Y+ cgu*(Cb-128)+cgv*(Cr-128) */
-                a1 += r1.h*r6.l,          a0 += r1.l*r6.l  || r1=[i1++]; // cgv
-        r2.h = (a1 += r1.h*r7.l), r2.l = (a0 += r1.l*r7.l);
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r5=[i1++m0]; // gmask
-        r2 = r2 << 2 (v);
-        r2 = r2 & r5;
-        r3 = r3 | r2;
-        [p1++]=r3                                          || r1=[i1++]; // cy
-
-        /* Y' = y*cy */
-
-        a1 = r1.h*r4.h, a0 = r1.l*r4.l                     || r1=[i1++]; // crv
-
-        /* R = Y+ crv*(Cr-128) */
-        r2.h = (a1 += r1.h*r7.h), r2.l = (a0 += r1.l*r7.h);
-                a1 -= r1.h*r7.h,          a0 -= r1.l*r7.h  || r5=[i1++]; // rmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cbu
-        r2 = r2 >> 3 (v);
-        r3 = r2 & r5;
-
-        /* B = Y+ cbu*(Cb-128) */
-        r2.h = (a1 += r1.h*r6.h), r2.l = (a0 += r1.l*r6.h);
-                a1 -= r1.h*r6.h,          a0 -= r1.l*r6.h  || r5=[i1++]; // bmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cgu
-        r2 = r2 << 7 (v);
-        r2 = r2 & r5;
-        r3 = r3 | r2;
-
-        /* G = Y+ cgu*(Cb-128)+cgv*(Cr-128) */
-                a1 += r1.h*r6.h,          a0 += r1.l*r6.h  || r1=[i1++]; // cgv
-        r2.h = (a1 += r1.h*r7.h), r2.l = (a0 += r1.l*r7.h) || r5=[i1++]; // gmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r0=[i0++];     // 4Y
-        r2 = r2 << 2 (v)                                   || r1.l=w[i2++];  // 2u
-        r2 = r2 & r5;
-        r3 = r3 | r2;
-        [p1++]=r3                                          || r1.h=w[i3++]; // 2v
-
-.L1555:                                                       r2=[i1++]; // oy
-
-        l1 = 0;
-
-        (r7:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(yuv2rgb555_line)
-
-DEFUN(yuv2rgb24_line,MEM,
-   (uint8_t *Y, uint8_t *U, uint8_t *V, int *out, int dW, uint32_t *coeffs)):
-        link 0;
-        [--sp] = (r7:4);
-        p1 = [fp+ARG_OUT];
-        r3 = [fp+ARG_W];
-        p2 = p1;
-        p2 += 3;
-
-        i0 = r0;
-        i2 = r1;
-        i3 = r2;
-
-        r0 = [fp+ARG_COEFF]; // coeff buffer
-        i1 = r0;
-        b1 = i1;
-        l1 = COEFF_LEN;
-        m0 = COEFF_REL_CY_OFF;
-        p0 = r3;
-
-        r0   = [i0++];         // 2Y
-        r1.l = w[i2++];        // 2u
-        r1.h = w[i3++];        // 2v
-        p0 = p0>>2;
-
-        lsetup (.L0888, .L1888) lc0 = p0;
-
-        /*
-           uint32_t oy,oc,zero,cy,crv,rmask,cbu,bmask,cgu,cgv
-           r0 -- used to load 4ys
-           r1 -- used to load 2us,2vs
-           r4 -- y3,y2
-           r5 -- y1,y0
-           r6 -- u1,u0
-           r7 -- v1,v0
-        */
-                                                              r2=[i1++]; // oy
-.L0888:
-        (r4,r5) = byteop16m (r1:0, r3:2)                   || r3=[i1++]; // oc
-        (r7,r6) = byteop16m (r1:0, r3:2) (r);
-        r5 = r5 << 2 (v);               // y1,y0
-        r4 = r4 << 2 (v);               // y3,y2
-        r6 = r6 << 2 (v) || r0=[i1++];  // u1,u0, r0=zero
-        r7 = r7 << 2 (v) || r1=[i1++];  // v1,v0  r1=cy
-
-        /* Y' = y*cy */
-        a1 = r1.h*r5.h, a0 = r1.l*r5.l                     || r1=[i1++]; // crv
-
-        /* R = Y+ crv*(Cr-128) */
-        r2.h = (a1 += r1.h*r7.l), r2.l = (a0 += r1.l*r7.l);
-                a1 -= r1.h*r7.l,          a0 -= r1.l*r7.l  || r5=[i1++]; // rmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cbu
-        r2=r2>>16 || B[p1++]=r2;
-                     B[p2++]=r2;
-
-        /* B = Y+ cbu*(Cb-128) */
-        r2.h = (a1 += r1.h*r6.l), r2.l = (a0 += r1.l*r6.l);
-                a1 -= r1.h*r6.l,          a0 -= r1.l*r6.l  || r5=[i1++]; // bmask
-        r3 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cgu
-
-        /* G = Y+ cgu*(Cb-128)+cgv*(Cr-128) */
-                a1 += r1.h*r6.l,          a0 += r1.l*r6.l  || r1=[i1++]; // cgv
-        r2.h = (a1 += r1.h*r7.l), r2.l = (a0 += r1.l*r7.l);
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r5=[i1++m0]; // gmask, oy,cy,zero
-
-        r2=r2>>16 || B[p1++]=r2;
-                     B[p2++]=r2;
-
-        r3=r3>>16 || B[p1++]=r3;
-                     B[p2++]=r3                            || r1=[i1++]; // cy
-
-        p1+=3;
-        p2+=3;
-        /* Y' = y*cy */
-        a1 = r1.h*r4.h, a0 = r1.l*r4.l                     || r1=[i1++]; // crv
-
-        /* R = Y+ crv*(Cr-128) */
-        r2.h = (a1 += r1.h*r7.h), r2.l = (a0 += r1.l*r7.h);
-                a1 -= r1.h*r7.h,          a0 -= r1.l*r7.h  || r5=[i1++]; // rmask
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cbu
-        r2=r2>>16 || B[p1++]=r2;
-        B[p2++]=r2;
-
-        /* B = Y+ cbu*(Cb-128) */
-        r2.h = (a1 += r1.h*r6.h), r2.l = (a0 += r1.l*r6.h);
-                a1 -= r1.h*r6.h,          a0 -= r1.l*r6.h  || r5=[i1++]; // bmask
-        r3 = byteop3p(r3:2, r1:0)(LO)                      || r1=[i1++]; // cgu
-
-        /* G = Y+ cgu*(Cb-128)+cgv*(Cr-128) */
-                a1 += r1.h*r6.h,          a0 += r1.l*r6.h  || r1=[i1++]; // cgv
-        r2.h = (a1 += r1.h*r7.h), r2.l = (a0 += r1.l*r7.h);
-        r2 = byteop3p(r3:2, r1:0)(LO)                      || r5=[i1++]; // gmask
-        r2=r2>>16 || B[p1++]=r2 || r0 = [i0++];    // 4y
-                     B[p2++]=r2 || r1.l = w[i2++]; // 2u
-        r3=r3>>16 || B[p1++]=r3 || r1.h = w[i3++]; // 2v
-                     B[p2++]=r3 || r2=[i1++];      // oy
-
-        p1+=3;
-.L1888: p2+=3;
-
-        l1 = 0;
-
-        (r7:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(yuv2rgb24_line)
-
-
-
-#define ARG_vdst        20
-#define ARG_width       24
-#define ARG_height      28
-#define ARG_lumStride   32
-#define ARG_chromStride 36
-#define ARG_srcStride   40
-
-DEFUN(uyvytoyv12, mL3,  (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                         int width, int height,
-                         int lumStride, int chromStride, int srcStride)):
-        link 0;
-        [--sp] = (r7:4,p5:4);
-
-        p0 = r1;       // Y top even
-
-        i2 = r2; // *u
-        r2 = [fp + ARG_vdst];
-        i3 = r2; // *v
-
-        r1 = [fp + ARG_srcStride];
-        r2 = r0 + r1;
-        i0 = r0;  // uyvy_T even
-        i1 = r2;  // uyvy_B odd
-
-        p2 = [fp + ARG_lumStride];
-        p1 = p0 + p2;  // Y bot odd
-
-        p5 = [fp + ARG_width];
-        p4 = [fp + ARG_height];
-        r0 = p5;
-        p4 = p4 >> 1;
-        p5 = p5 >> 2;
-
-        r2 = r0 << 1;
-        r1 = r1 << 1;
-        r1 = r1 - r2;  // srcStride + (srcStride - 2*width)
-        r1 += -8;  // i0,i1 is pre read need to correct
-        m0 = r1;
-
-        r2 = [fp + ARG_chromStride];
-        r0 = r0 >> 1;
-        r2 = r2 - r0;
-        m1 = r2;
-
-        /*   I0,I1 - src input line pointers
-         *   p0,p1 - luma output line pointers
-         *   I2    - dstU
-         *   I3    - dstV
-         */
-
-        lsetup (0f, 1f) lc1 = p4;   // H/2
-0:        r0 = [i0++] || r2 = [i1++];
-          r1 = [i0++] || r3 = [i1++];
-          r4 = byteop1p(r1:0, r3:2);
-          r5 = byteop1p(r1:0, r3:2) (r);
-          lsetup (2f, 3f) lc0 = p5; // W/4
-2:          r0 = r0 >> 8(v);
-            r1 = r1 >> 8(v);
-            r2 = r2 >> 8(v);
-            r3 = r3 >> 8(v);
-            r0 = bytepack(r0, r1);
-            r2 = bytepack(r2, r3)         ||  [p0++] = r0;    // yyyy
-            r6 = pack(r5.l, r4.l)         ||  [p1++] = r2;    // yyyy
-            r7 = pack(r5.h, r4.h)         ||  r0 = [i0++] || r2 = [i1++];
-            r6 = bytepack(r6, r7)         ||  r1 = [i0++] || r3 = [i1++];
-            r4 = byteop1p(r1:0, r3:2)     ||  w[i2++] = r6.l; // uu
-3:          r5 = byteop1p(r1:0, r3:2) (r) ||  w[i3++] = r6.h; // vv
-
-          i0 += m0;
-          i1 += m0;
-          i2 += m1;
-          i3 += m1;
-          p0 = p0 + p2;
-1:        p1 = p1 + p2;
-
-        (r7:4,p5:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(uyvytoyv12)
-
-DEFUN(yuyvtoyv12, mL3,  (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                         int width, int height,
-                         int lumStride, int chromStride, int srcStride)):
-        link 0;
-        [--sp] = (r7:4,p5:4);
-
-        p0 = r1;       // Y top even
-
-        i2 = r2; // *u
-        r2 = [fp + ARG_vdst];
-        i3 = r2; // *v
-
-        r1 = [fp + ARG_srcStride];
-        r2 = r0 + r1;
-
-        i0 = r0;  // uyvy_T even
-        i1 = r2;  // uyvy_B odd
-
-        p2 = [fp + ARG_lumStride];
-        p1 = p0 + p2;  // Y bot odd
-
-        p5 = [fp + ARG_width];
-        p4 = [fp + ARG_height];
-        r0 = p5;
-        p4 = p4 >> 1;
-        p5 = p5 >> 2;
-
-        r2 = r0 << 1;
-        r1 = r1 << 1;
-        r1 = r1 - r2;  // srcStride + (srcStride - 2*width)
-        r1 += -8;  // i0,i1 is pre read need to correct
-        m0 = r1;
-
-        r2 = [fp + ARG_chromStride];
-        r0 = r0 >> 1;
-        r2 = r2 - r0;
-        m1 = r2;
-
-        /*   I0,I1 - src input line pointers
-         *   p0,p1 - luma output line pointers
-         *   I2    - dstU
-         *   I3    - dstV
-         */
-
-        lsetup (0f, 1f) lc1 = p4;   // H/2
-0:        r0 = [i0++] || r2 = [i1++];
-          r1 = [i0++] || r3 = [i1++];
-          r4 = bytepack(r0, r1);
-          r5 = bytepack(r2, r3);
-          lsetup (2f, 3f) lc0 = p5; // W/4
-2:          r0 = r0 >> 8(v) || [p0++] = r4;  // yyyy-even
-            r1 = r1 >> 8(v) || [p1++] = r5;  // yyyy-odd
-            r2 = r2 >> 8(v);
-            r3 = r3 >> 8(v);
-            r4 = byteop1p(r1:0, r3:2);
-            r5 = byteop1p(r1:0, r3:2) (r);
-            r6 = pack(r5.l, r4.l);
-            r7 = pack(r5.h, r4.h)         ||  r0 = [i0++] || r2 = [i1++];
-            r6 = bytepack(r6, r7)         ||  r1 = [i0++] || r3 = [i1++];
-            r4 = bytepack(r0, r1)         ||  w[i2++] = r6.l; // uu
-3:          r5 = bytepack(r2, r3)         ||  w[i3++] = r6.h; // vv
-
-          i0 += m0;
-          i1 += m0;
-          i2 += m1;
-          i3 += m1;
-          p0 = p0 + p2;
-1:        p1 = p1 + p2;
-
-        (r7:4,p5:4) = [sp++];
-        unlink;
-        rts;
-DEFUN_END(yuyvtoyv12)
diff --git a/deps/libav/libswscale/bfin/swscale_bfin.c b/deps/libav/libswscale/bfin/swscale_bfin.c
deleted file mode 100644
index 43c23b4..0000000
--- a/deps/libav/libswscale/bfin/swscale_bfin.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * Blackfin software video scaler operations
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libswscale/swscale_internal.h"
-
-#if defined (__FDPIC__) && CONFIG_SRAM
-#define L1CODE __attribute__((l1_text))
-#else
-#define L1CODE
-#endif
-
-int ff_bfin_uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
-                       uint8_t *vdst, int width, int height,
-                       int lumStride, int chromStride, int srcStride) L1CODE;
-
-int ff_bfin_yuyvtoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
-                       uint8_t *vdst, int width, int height,
-                       int lumStride, int chromStride, int srcStride) L1CODE;
-
-static int uyvytoyv12_unscaled(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dst[], int dstStride[])
-{
-    uint8_t *dsty = dst[0] + dstStride[0] * srcSliceY;
-    uint8_t *dstu = dst[1] + dstStride[1] * srcSliceY / 2;
-    uint8_t *dstv = dst[2] + dstStride[2] * srcSliceY / 2;
-    const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
-    int w = dstStride[0];
-
-    ff_bfin_uyvytoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
-                       dstStride[0], dstStride[1], srcStride[0]);
-
-    return srcSliceH;
-}
-
-static int yuyvtoyv12_unscaled(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dst[], int dstStride[])
-{
-    uint8_t *dsty = dst[0] + dstStride[0] * srcSliceY;
-    uint8_t *dstu = dst[1] + dstStride[1] * srcSliceY / 2;
-    uint8_t *dstv = dst[2] + dstStride[2] * srcSliceY / 2;
-    const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
-    int w = dstStride[0];
-
-    ff_bfin_yuyvtoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
-                       dstStride[0], dstStride[1], srcStride[0]);
-
-    return srcSliceH;
-}
-
-av_cold void ff_get_unscaled_swscale_bfin(SwsContext *c)
-{
-    if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_UYVY422) {
-        av_log(NULL, AV_LOG_VERBOSE,
-               "selecting Blackfin optimized uyvytoyv12_unscaled\n");
-        c->swscale = uyvytoyv12_unscaled;
-    }
-    if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_YUYV422) {
-        av_log(NULL, AV_LOG_VERBOSE,
-               "selecting Blackfin optimized yuyvtoyv12_unscaled\n");
-        c->swscale = yuyvtoyv12_unscaled;
-    }
-}
diff --git a/deps/libav/libswscale/bfin/yuv2rgb_bfin.c b/deps/libav/libswscale/bfin/yuv2rgb_bfin.c
deleted file mode 100644
index 603a33a..0000000
--- a/deps/libav/libswscale/bfin/yuv2rgb_bfin.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2007 Marc Hoffman <marc.hoffman at analog.com>
- *
- * Blackfin video color space converter operations
- * convert I420 YV12 to RGB in various formats
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libswscale/swscale_internal.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define L1CODE __attribute__((l1_text))
-#else
-#define L1CODE
-#endif
-
-void ff_bfin_yuv2rgb555_line(const uint8_t *Y, const uint8_t *U,
-                             const uint8_t *V, uint8_t *out,
-                             int w, uint32_t *coeffs) L1CODE;
-
-void ff_bfin_yuv2rgb565_line(const uint8_t *Y, const uint8_t *U,
-                             const uint8_t *V, uint8_t *out,
-                             int w, uint32_t *coeffs) L1CODE;
-
-void ff_bfin_yuv2rgb24_line(const uint8_t *Y, const uint8_t *U,
-                            const uint8_t *V, uint8_t *out,
-                            int w, uint32_t *coeffs) L1CODE;
-
-typedef void (*ltransform)(const uint8_t *Y, const uint8_t *U, const uint8_t *V,
-                           uint8_t *out, int w, uint32_t *coeffs);
-
-static void bfin_prepare_coefficients(SwsContext *c, int rgb, int masks)
-{
-    int oy;
-    oy = c->yOffset & 0xffff;
-    oy = oy >> 3;      // keep everything U8.0 for offset calculation
-
-    c->oc = 128 * 0x01010101U;
-    c->oy = oy * 0x01010101U;
-
-    /* copy 64bit vector coeffs down to 32bit vector coeffs */
-    c->cy   = c->yCoeff;
-    c->zero = 0;
-
-    if (rgb) {
-        c->crv = c->vrCoeff;
-        c->cbu = c->ubCoeff;
-        c->cgu = c->ugCoeff;
-        c->cgv = c->vgCoeff;
-    } else {
-        c->crv = c->ubCoeff;
-        c->cbu = c->vrCoeff;
-        c->cgu = c->vgCoeff;
-        c->cgv = c->ugCoeff;
-    }
-
-    if (masks == 555) {
-        c->rmask = 0x001f * 0x00010001U;
-        c->gmask = 0x03e0 * 0x00010001U;
-        c->bmask = 0x7c00 * 0x00010001U;
-    } else if (masks == 565) {
-        c->rmask = 0x001f * 0x00010001U;
-        c->gmask = 0x07e0 * 0x00010001U;
-        c->bmask = 0xf800 * 0x00010001U;
-    }
-}
-
-static int core_yuv420_rgb(SwsContext *c, const uint8_t **in, int *instrides,
-                           int srcSliceY, int srcSliceH, uint8_t **oplanes,
-                           int *outstrides, ltransform lcscf,
-                           int rgb, int masks)
-{
-    const uint8_t *py, *pu, *pv;
-    uint8_t *op;
-    int w  = instrides[0];
-    int h2 = srcSliceH >> 1;
-    int i;
-
-    bfin_prepare_coefficients(c, rgb, masks);
-
-    py = in[0];
-    pu = in[1 + (1 ^ rgb)];
-    pv = in[1 + (0 ^ rgb)];
-
-    op = oplanes[0] + srcSliceY * outstrides[0];
-
-    for (i = 0; i < h2; i++) {
-        lcscf(py, pu, pv, op, w, &c->oy);
-
-        py += instrides[0];
-        op += outstrides[0];
-
-        lcscf(py, pu, pv, op, w, &c->oy);
-
-        py += instrides[0];
-        pu += instrides[1];
-        pv += instrides[2];
-        op += outstrides[0];
-    }
-
-    return srcSliceH;
-}
-
-static int bfin_yuv420_rgb555(SwsContext *c, const uint8_t **in, int *instrides,
-                              int srcSliceY, int srcSliceH,
-                              uint8_t **oplanes, int *outstrides)
-{
-    return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
-                           outstrides, ff_bfin_yuv2rgb555_line, 1, 555);
-}
-
-static int bfin_yuv420_bgr555(SwsContext *c, const uint8_t **in, int *instrides,
-                              int srcSliceY, int srcSliceH,
-                              uint8_t **oplanes, int *outstrides)
-{
-    return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
-                           outstrides, ff_bfin_yuv2rgb555_line, 0, 555);
-}
-
-static int bfin_yuv420_rgb24(SwsContext *c, const uint8_t **in, int *instrides,
-                             int srcSliceY, int srcSliceH,
-                             uint8_t **oplanes, int *outstrides)
-{
-    return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
-                           outstrides, ff_bfin_yuv2rgb24_line, 1, 888);
-}
-
-static int bfin_yuv420_bgr24(SwsContext *c, const uint8_t **in, int *instrides,
-                             int srcSliceY, int srcSliceH,
-                             uint8_t **oplanes, int *outstrides)
-{
-    return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
-                           outstrides, ff_bfin_yuv2rgb24_line, 0, 888);
-}
-
-static int bfin_yuv420_rgb565(SwsContext *c, const uint8_t **in, int *instrides,
-                              int srcSliceY, int srcSliceH,
-                              uint8_t **oplanes, int *outstrides)
-{
-    return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
-                           outstrides, ff_bfin_yuv2rgb565_line, 1, 565);
-}
-
-static int bfin_yuv420_bgr565(SwsContext *c, const uint8_t **in, int *instrides,
-                              int srcSliceY, int srcSliceH,
-                              uint8_t **oplanes, int *outstrides)
-{
-    return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
-                           outstrides, ff_bfin_yuv2rgb565_line, 0, 565);
-}
-
-av_cold SwsFunc ff_yuv2rgb_init_bfin(SwsContext *c)
-{
-    SwsFunc f;
-
-    switch (c->dstFormat) {
-    case AV_PIX_FMT_RGB555:
-        f = bfin_yuv420_rgb555;
-        break;
-    case AV_PIX_FMT_BGR555:
-        f = bfin_yuv420_bgr555;
-        break;
-    case AV_PIX_FMT_RGB565:
-        f = bfin_yuv420_rgb565;
-        break;
-    case AV_PIX_FMT_BGR565:
-        f = bfin_yuv420_bgr565;
-        break;
-    case AV_PIX_FMT_RGB24:
-        f = bfin_yuv420_rgb24;
-        break;
-    case AV_PIX_FMT_BGR24:
-        f = bfin_yuv420_bgr24;
-        break;
-    default:
-        return 0;
-    }
-
-    av_log(c, AV_LOG_INFO, "BlackFin accelerated color space converter %s\n",
-           sws_format_name(c->dstFormat));
-
-    return f;
-}
diff --git a/deps/libav/libswscale/colorspace-test.c b/deps/libav/libswscale/colorspace-test.c
deleted file mode 100644
index fbf595d..0000000
--- a/deps/libav/libswscale/colorspace-test.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2002 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <string.h>              /* for memset() */
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "swscale.h"
-#include "rgb2rgb.h"
-#include "libavutil/mem.h"
-
-#define SIZE    1000
-#define srcByte 0x55
-#define dstByte 0xBB
-
-#define FUNC(s, d, n) { s, d, #n, n }
-
-int main(void)
-{
-    int i, funcNum;
-    uint8_t *srcBuffer = av_malloc(SIZE);
-    uint8_t *dstBuffer = av_malloc(SIZE);
-    int failedNum      = 0;
-    int passedNum      = 0;
-
-    if (!srcBuffer || !dstBuffer)
-        return -1;
-
-    av_log(NULL, AV_LOG_INFO, "memory corruption test ...\n");
-    sws_rgb2rgb_init();
-
-    for (funcNum = 0; ; funcNum++) {
-        struct func_info_s {
-            int src_bpp;
-            int dst_bpp;
-            const char *name;
-            void (*func)(const uint8_t *src, uint8_t *dst, int src_size);
-        } func_info[] = {
-            FUNC(2, 2, rgb15to16),
-            FUNC(2, 3, rgb15to24),
-            FUNC(2, 4, rgb15to32),
-            FUNC(2, 3, rgb16to24),
-            FUNC(2, 4, rgb16to32),
-            FUNC(3, 2, rgb24to15),
-            FUNC(3, 2, rgb24to16),
-            FUNC(3, 4, rgb24to32),
-            FUNC(4, 2, rgb32to15),
-            FUNC(4, 2, rgb32to16),
-            FUNC(4, 3, rgb32to24),
-            FUNC(2, 2, rgb16to15),
-            FUNC(2, 2, rgb15tobgr15),
-            FUNC(2, 2, rgb15tobgr16),
-            FUNC(2, 3, rgb15tobgr24),
-            FUNC(2, 4, rgb15tobgr32),
-            FUNC(2, 2, rgb16tobgr15),
-            FUNC(2, 2, rgb16tobgr16),
-            FUNC(2, 3, rgb16tobgr24),
-            FUNC(2, 4, rgb16tobgr32),
-            FUNC(3, 2, rgb24tobgr15),
-            FUNC(3, 2, rgb24tobgr16),
-            FUNC(3, 3, rgb24tobgr24),
-            FUNC(3, 4, rgb24tobgr32),
-            FUNC(4, 2, rgb32tobgr15),
-            FUNC(4, 2, rgb32tobgr16),
-            FUNC(4, 3, rgb32tobgr24),
-            FUNC(4, 4, shuffle_bytes_2103), /* rgb32tobgr32 */
-            FUNC(0, 0, NULL)
-        };
-        int width;
-        int failed = 0;
-        int srcBpp = 0;
-        int dstBpp = 0;
-
-        if (!func_info[funcNum].func)
-            break;
-
-        av_log(NULL, AV_LOG_INFO, ".");
-        memset(srcBuffer, srcByte, SIZE);
-
-        for (width = 63; width > 0; width--) {
-            int dstOffset;
-            for (dstOffset = 128; dstOffset < 196; dstOffset += 4) {
-                int srcOffset;
-                memset(dstBuffer, dstByte, SIZE);
-
-                for (srcOffset = 128; srcOffset < 196; srcOffset += 4) {
-                    uint8_t *src     = srcBuffer + srcOffset;
-                    uint8_t *dst     = dstBuffer + dstOffset;
-                    const char *name = NULL;
-
-                    // don't fill the screen with shit ...
-                    if (failed)
-                        break;
-
-                    srcBpp = func_info[funcNum].src_bpp;
-                    dstBpp = func_info[funcNum].dst_bpp;
-                    name   = func_info[funcNum].name;
-
-                    func_info[funcNum].func(src, dst, width * srcBpp);
-
-                    if (!srcBpp)
-                        break;
-
-                    for (i = 0; i < SIZE; i++) {
-                        if (srcBuffer[i] != srcByte) {
-                            av_log(NULL, AV_LOG_INFO,
-                                   "src damaged at %d w:%d src:%d dst:%d %s\n",
-                                   i, width, srcOffset, dstOffset, name);
-                            failed = 1;
-                            break;
-                        }
-                    }
-                    for (i = 0; i < dstOffset; i++) {
-                        if (dstBuffer[i] != dstByte) {
-                            av_log(NULL, AV_LOG_INFO,
-                                   "dst damaged at %d w:%d src:%d dst:%d %s\n",
-                                   i, width, srcOffset, dstOffset, name);
-                            failed = 1;
-                            break;
-                        }
-                    }
-                    for (i = dstOffset + width * dstBpp; i < SIZE; i++) {
-                        if (dstBuffer[i] != dstByte) {
-                            av_log(NULL, AV_LOG_INFO,
-                                   "dst damaged at %d w:%d src:%d dst:%d %s\n",
-                                   i, width, srcOffset, dstOffset, name);
-                            failed = 1;
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-        if (failed)
-            failedNum++;
-        else if (srcBpp)
-            passedNum++;
-    }
-
-    av_log(NULL, AV_LOG_INFO,
-           "\n%d converters passed, %d converters randomly overwrote memory\n",
-           passedNum, failedNum);
-    return failedNum;
-}
diff --git a/deps/libav/libswscale/input.c b/deps/libav/libswscale/input.c
deleted file mode 100644
index 2e8d43f..0000000
--- a/deps/libav/libswscale/input.c
+++ /dev/null
@@ -1,1078 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <assert.h>
-#include <math.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "libavutil/avutil.h"
-#include "libavutil/bswap.h"
-#include "libavutil/cpu.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/pixdesc.h"
-#include "config.h"
-#include "rgb2rgb.h"
-#include "swscale.h"
-#include "swscale_internal.h"
-
-#define RGB2YUV_SHIFT 15
-#define BY  ((int)(0.114 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define BV (-(int)(0.081 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define BU  ((int)(0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define GY  ((int)(0.587 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define GV (-(int)(0.419 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define GU (-(int)(0.331 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define RY  ((int)(0.299 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define RV  ((int)(0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define RU (-(int)(0.169 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-
-#define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos))
-
-#define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? b_r : r_b)
-#define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? r_b : b_r)
-
-static av_always_inline void rgb48ToY_c_template(uint16_t *dst,
-                                                 const uint16_t *src, int width,
-                                                 enum AVPixelFormat origin)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        unsigned int r_b = input_pixel(&src[i * 3 + 0]);
-        unsigned int g   = input_pixel(&src[i * 3 + 1]);
-        unsigned int b_r = input_pixel(&src[i * 3 + 2]);
-
-        dst[i] = (RY * r + GY * g + BY * b + (0x2001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-    }
-}
-
-static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU,
-                                                  uint16_t *dstV,
-                                                  const uint16_t *src1,
-                                                  const uint16_t *src2,
-                                                  int width,
-                                                  enum AVPixelFormat origin)
-{
-    int i;
-    assert(src1 == src2);
-    for (i = 0; i < width; i++) {
-        int r_b = input_pixel(&src1[i * 3 + 0]);
-        int g   = input_pixel(&src1[i * 3 + 1]);
-        int b_r = input_pixel(&src1[i * 3 + 2]);
-
-        dstU[i] = (RU * r + GU * g + BU * b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-        dstV[i] = (RV * r + GV * g + BV * b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-    }
-}
-
-static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU,
-                                                       uint16_t *dstV,
-                                                       const uint16_t *src1,
-                                                       const uint16_t *src2,
-                                                       int width,
-                                                       enum AVPixelFormat origin)
-{
-    int i;
-    assert(src1 == src2);
-    for (i = 0; i < width; i++) {
-        int r_b = (input_pixel(&src1[6 * i + 0]) +
-                   input_pixel(&src1[6 * i + 3]) + 1) >> 1;
-        int g   = (input_pixel(&src1[6 * i + 1]) +
-                   input_pixel(&src1[6 * i + 4]) + 1) >> 1;
-        int b_r = (input_pixel(&src1[6 * i + 2]) +
-                   input_pixel(&src1[6 * i + 5]) + 1) >> 1;
-
-        dstU[i] = (RU * r + GU * g + BU * b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-        dstV[i] = (RV * r + GV * g + BV * b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-    }
-}
-
-#undef r
-#undef b
-#undef input_pixel
-
-#define rgb48funcs(pattern, BE_LE, origin)                              \
-static void pattern ## 48 ## BE_LE ## ToY_c(uint8_t *_dst,              \
-                                            const uint8_t *_src,        \
-                                            int width,                  \
-                                            uint32_t *unused)           \
-{                                                                       \
-    const uint16_t *src = (const uint16_t *)_src;                       \
-    uint16_t *dst       = (uint16_t *)_dst;                             \
-    rgb48ToY_c_template(dst, src, width, origin);                       \
-}                                                                       \
-                                                                        \
-static void pattern ## 48 ## BE_LE ## ToUV_c(uint8_t *_dstU,            \
-                                             uint8_t *_dstV,            \
-                                             const uint8_t *_src1,      \
-                                             const uint8_t *_src2,      \
-                                             int width,                 \
-                                             uint32_t *unused)          \
-{                                                                       \
-    const uint16_t *src1 = (const uint16_t *)_src1,                     \
-                   *src2 = (const uint16_t *)_src2;                     \
-    uint16_t *dstU = (uint16_t *)_dstU,                                 \
-             *dstV = (uint16_t *)_dstV;                                 \
-    rgb48ToUV_c_template(dstU, dstV, src1, src2, width, origin);        \
-}                                                                       \
-                                                                        \
-static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU,       \
-                                                  uint8_t *_dstV,       \
-                                                  const uint8_t *_src1, \
-                                                  const uint8_t *_src2, \
-                                                  int width,            \
-                                                  uint32_t *unused)     \
-{                                                                       \
-    const uint16_t *src1 = (const uint16_t *)_src1,                     \
-                   *src2 = (const uint16_t *)_src2;                     \
-    uint16_t *dstU = (uint16_t *)_dstU,                                 \
-             *dstV = (uint16_t *)_dstV;                                 \
-    rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin);   \
-}
-
-rgb48funcs(rgb, LE, AV_PIX_FMT_RGB48LE)
-rgb48funcs(rgb, BE, AV_PIX_FMT_RGB48BE)
-rgb48funcs(bgr, LE, AV_PIX_FMT_BGR48LE)
-rgb48funcs(bgr, BE, AV_PIX_FMT_BGR48BE)
-
-#define input_pixel(i) ((origin == AV_PIX_FMT_RGBA ||                      \
-                         origin == AV_PIX_FMT_BGRA ||                      \
-                         origin == AV_PIX_FMT_ARGB ||                      \
-                         origin == AV_PIX_FMT_ABGR)                        \
-                        ? AV_RN32A(&src[(i) * 4])                       \
-                        : (isBE(origin) ? AV_RB16(&src[(i) * 2])        \
-                                        : AV_RL16(&src[(i) * 2])))
-
-static av_always_inline void rgb16_32ToY_c_template(uint8_t *dst,
-                                                    const uint8_t *src,
-                                                    int width,
-                                                    enum AVPixelFormat origin,
-                                                    int shr, int shg,
-                                                    int shb, int shp,
-                                                    int maskr, int maskg,
-                                                    int maskb, int rsh,
-                                                    int gsh, int bsh, int S)
-{
-    const int ry       = RY << rsh, gy = GY << gsh, by = BY << bsh;
-    const unsigned rnd = 33u << (S - 1);
-    int i;
-
-    for (i = 0; i < width; i++) {
-        int px = input_pixel(i) >> shp;
-        int b  = (px & maskb) >> shb;
-        int g  = (px & maskg) >> shg;
-        int r  = (px & maskr) >> shr;
-
-        dst[i] = (ry * r + gy * g + by * b + rnd) >> S;
-    }
-}
-
-static av_always_inline void rgb16_32ToUV_c_template(uint8_t *dstU,
-                                                     uint8_t *dstV,
-                                                     const uint8_t *src,
-                                                     int width,
-                                                     enum AVPixelFormat origin,
-                                                     int shr, int shg,
-                                                     int shb, int shp,
-                                                     int maskr, int maskg,
-                                                     int maskb, int rsh,
-                                                     int gsh, int bsh, int S)
-{
-    const int ru       = RU << rsh, gu = GU << gsh, bu = BU << bsh,
-              rv       = RV << rsh, gv = GV << gsh, bv = BV << bsh;
-    const unsigned rnd = 257u << (S - 1);
-    int i;
-
-    for (i = 0; i < width; i++) {
-        int px = input_pixel(i) >> shp;
-        int b  = (px & maskb)   >> shb;
-        int g  = (px & maskg)   >> shg;
-        int r  = (px & maskr)   >> shr;
-
-        dstU[i] = (ru * r + gu * g + bu * b + rnd) >> S;
-        dstV[i] = (rv * r + gv * g + bv * b + rnd) >> S;
-    }
-}
-
-static av_always_inline void rgb16_32ToUV_half_c_template(uint8_t *dstU,
-                                                          uint8_t *dstV,
-                                                          const uint8_t *src,
-                                                          int width,
-                                                          enum AVPixelFormat origin,
-                                                          int shr, int shg,
-                                                          int shb, int shp,
-                                                          int maskr, int maskg,
-                                                          int maskb, int rsh,
-                                                          int gsh, int bsh, int S)
-{
-    const int ru       = RU << rsh, gu = GU << gsh, bu = BU << bsh,
-              rv       = RV << rsh, gv = GV << gsh, bv = BV << bsh,
-              maskgx   = ~(maskr | maskb);
-    const unsigned rnd = 257u << S;
-    int i;
-
-    maskr |= maskr << 1;
-    maskb |= maskb << 1;
-    maskg |= maskg << 1;
-    for (i = 0; i < width; i++) {
-        int px0 = input_pixel(2 * i + 0) >> shp;
-        int px1 = input_pixel(2 * i + 1) >> shp;
-        int b, r, g = (px0 & maskgx) + (px1 & maskgx);
-        int rb = px0 + px1 - g;
-
-        b = (rb & maskb) >> shb;
-        if (shp ||
-            origin == AV_PIX_FMT_BGR565LE || origin == AV_PIX_FMT_BGR565BE ||
-            origin == AV_PIX_FMT_RGB565LE || origin == AV_PIX_FMT_RGB565BE) {
-            g >>= shg;
-        } else {
-            g = (g & maskg) >> shg;
-        }
-        r = (rb & maskr) >> shr;
-
-        dstU[i] = (ru * r + gu * g + bu * b + rnd) >> (S + 1);
-        dstV[i] = (rv * r + gv * g + bv * b + rnd) >> (S + 1);
-    }
-}
-
-#undef input_pixel
-
-#define rgb16_32_wrapper(fmt, name, shr, shg, shb, shp, maskr,          \
-                         maskg, maskb, rsh, gsh, bsh, S)                \
-static void name ## ToY_c(uint8_t *dst, const uint8_t *src,             \
-                          int width, uint32_t *unused)                  \
-{                                                                       \
-    rgb16_32ToY_c_template(dst, src, width, fmt, shr, shg, shb, shp,    \
-                           maskr, maskg, maskb, rsh, gsh, bsh, S);      \
-}                                                                       \
-                                                                        \
-static void name ## ToUV_c(uint8_t *dstU, uint8_t *dstV,                \
-                           const uint8_t *src, const uint8_t *dummy,    \
-                           int width, uint32_t *unused)                 \
-{                                                                       \
-    rgb16_32ToUV_c_template(dstU, dstV, src, width, fmt,                \
-                            shr, shg, shb, shp,                         \
-                            maskr, maskg, maskb, rsh, gsh, bsh, S);     \
-}                                                                       \
-                                                                        \
-static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV,           \
-                                const uint8_t *src,                     \
-                                const uint8_t *dummy,                   \
-                                int width, uint32_t *unused)            \
-{                                                                       \
-    rgb16_32ToUV_half_c_template(dstU, dstV, src, width, fmt,           \
-                                 shr, shg, shb, shp,                    \
-                                 maskr, maskg, maskb,                   \
-                                 rsh, gsh, bsh, S);                     \
-}
-
-rgb16_32_wrapper(AV_PIX_FMT_BGR32,    bgr32,  16, 0,  0, 0, 0xFF0000, 0xFF00,   0x00FF,  8, 0,  8, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(AV_PIX_FMT_BGR32_1,  bgr321, 16, 0,  0, 8, 0xFF0000, 0xFF00,   0x00FF,  8, 0,  8, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(AV_PIX_FMT_RGB32,    rgb32,   0, 0, 16, 0,   0x00FF, 0xFF00, 0xFF0000,  8, 0,  8, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(AV_PIX_FMT_RGB32_1,  rgb321,  0, 0, 16, 8,   0x00FF, 0xFF00, 0xFF0000,  8, 0,  8, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(AV_PIX_FMT_BGR565LE, bgr16le, 0, 0,  0, 0,   0x001F, 0x07E0,   0xF800, 11, 5,  0, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(AV_PIX_FMT_BGR555LE, bgr15le, 0, 0,  0, 0,   0x001F, 0x03E0,   0x7C00, 10, 5,  0, RGB2YUV_SHIFT + 7)
-rgb16_32_wrapper(AV_PIX_FMT_BGR444LE, bgr12le, 0, 0,  0, 0,   0x000F, 0x00F0,   0x0F00,  8, 4,  0, RGB2YUV_SHIFT + 4)
-rgb16_32_wrapper(AV_PIX_FMT_RGB565LE, rgb16le, 0, 0,  0, 0,   0xF800, 0x07E0,   0x001F,  0, 5, 11, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(AV_PIX_FMT_RGB555LE, rgb15le, 0, 0,  0, 0,   0x7C00, 0x03E0,   0x001F,  0, 5, 10, RGB2YUV_SHIFT + 7)
-rgb16_32_wrapper(AV_PIX_FMT_RGB444LE, rgb12le, 0, 0,  0, 0,   0x0F00, 0x00F0,   0x000F,  0, 4,  8, RGB2YUV_SHIFT + 4)
-rgb16_32_wrapper(AV_PIX_FMT_BGR565BE, bgr16be, 0, 0,  0, 0,   0x001F, 0x07E0,   0xF800, 11, 5,  0, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(AV_PIX_FMT_BGR555BE, bgr15be, 0, 0,  0, 0,   0x001F, 0x03E0,   0x7C00, 10, 5,  0, RGB2YUV_SHIFT + 7)
-rgb16_32_wrapper(AV_PIX_FMT_BGR444BE, bgr12be, 0, 0,  0, 0,   0x000F, 0x00F0,   0x0F00,  8, 4,  0, RGB2YUV_SHIFT + 4)
-rgb16_32_wrapper(AV_PIX_FMT_RGB565BE, rgb16be, 0, 0,  0, 0,   0xF800, 0x07E0,   0x001F,  0, 5, 11, RGB2YUV_SHIFT + 8)
-rgb16_32_wrapper(AV_PIX_FMT_RGB555BE, rgb15be, 0, 0,  0, 0,   0x7C00, 0x03E0,   0x001F,  0, 5, 10, RGB2YUV_SHIFT + 7)
-rgb16_32_wrapper(AV_PIX_FMT_RGB444BE, rgb12be, 0, 0,  0, 0,   0x0F00, 0x00F0,   0x000F,  0, 4,  8, RGB2YUV_SHIFT + 4)
-
-static void abgrToA_c(uint8_t *dst, const uint8_t *src, int width,
-                      uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++)
-        dst[i] = src[4 * i];
-}
-
-static void rgbaToA_c(uint8_t *dst, const uint8_t *src, int width,
-                      uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++)
-        dst[i] = src[4 * i + 3];
-}
-
-static void palToY_c(uint8_t *dst, const uint8_t *src, int width, uint32_t *pal)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        int d = src[i];
-
-        dst[i] = pal[d] & 0xFF;
-    }
-}
-
-static void palToUV_c(uint8_t *dstU, uint8_t *dstV,
-                      const uint8_t *src1, const uint8_t *src2,
-                      int width, uint32_t *pal)
-{
-    int i;
-    assert(src1 == src2);
-    for (i = 0; i < width; i++) {
-        int p = pal[src1[i]];
-
-        dstU[i] = p >> 8;
-        dstV[i] = p >> 16;
-    }
-}
-
-static void monowhite2Y_c(uint8_t *dst, const uint8_t *src,
-                          int width, uint32_t *unused)
-{
-    int i, j;
-    width = (width + 7) >> 3;
-    for (i = 0; i < width; i++) {
-        int d = ~src[i];
-        for (j = 0; j < 8; j++)
-            dst[8 * i + j] = ((d >> (7 - j)) & 1) * 255;
-    }
-}
-
-static void monoblack2Y_c(uint8_t *dst, const uint8_t *src,
-                          int width, uint32_t *unused)
-{
-    int i, j;
-    width = (width + 7) >> 3;
-    for (i = 0; i < width; i++) {
-        int d = src[i];
-        for (j = 0; j < 8; j++)
-            dst[8 * i + j] = ((d >> (7 - j)) & 1) * 255;
-    }
-}
-
-static void yuy2ToY_c(uint8_t *dst, const uint8_t *src, int width,
-                      uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++)
-        dst[i] = src[2 * i];
-}
-
-static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1,
-                       const uint8_t *src2, int width, uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        dstU[i] = src1[4 * i + 1];
-        dstV[i] = src1[4 * i + 3];
-    }
-    assert(src1 == src2);
-}
-
-static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, int width,
-                       uint32_t *unused)
-{
-    int i;
-    const uint16_t *src = (const uint16_t *)_src;
-    uint16_t *dst       = (uint16_t *)_dst;
-    for (i = 0; i < width; i++)
-        dst[i] = av_bswap16(src[i]);
-}
-
-static void bswap16UV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *_src1,
-                        const uint8_t *_src2, int width, uint32_t *unused)
-{
-    int i;
-    const uint16_t *src1 = (const uint16_t *)_src1,
-    *src2                = (const uint16_t *)_src2;
-    uint16_t *dstU       = (uint16_t *)_dstU, *dstV = (uint16_t *)_dstV;
-    for (i = 0; i < width; i++) {
-        dstU[i] = av_bswap16(src1[i]);
-        dstV[i] = av_bswap16(src2[i]);
-    }
-}
-
-/* This is almost identical to the previous, end exists only because
- * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */
-static void uyvyToY_c(uint8_t *dst, const uint8_t *src, int width,
-                      uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++)
-        dst[i] = src[2 * i + 1];
-}
-
-static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1,
-                       const uint8_t *src2, int width, uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        dstU[i] = src1[4 * i + 0];
-        dstV[i] = src1[4 * i + 2];
-    }
-    assert(src1 == src2);
-}
-
-static av_always_inline void nvXXtoUV_c(uint8_t *dst1, uint8_t *dst2,
-                                        const uint8_t *src, int width)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        dst1[i] = src[2 * i + 0];
-        dst2[i] = src[2 * i + 1];
-    }
-}
-
-static void nv12ToUV_c(uint8_t *dstU, uint8_t *dstV,
-                       const uint8_t *src1, const uint8_t *src2,
-                       int width, uint32_t *unused)
-{
-    nvXXtoUV_c(dstU, dstV, src1, width);
-}
-
-static void nv21ToUV_c(uint8_t *dstU, uint8_t *dstV,
-                       const uint8_t *src1, const uint8_t *src2,
-                       int width, uint32_t *unused)
-{
-    nvXXtoUV_c(dstV, dstU, src1, width);
-}
-
-#define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos))
-
-static void bgr24ToY_c(uint8_t *dst, const uint8_t *src,
-                       int width, uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        int b = src[i * 3 + 0];
-        int g = src[i * 3 + 1];
-        int r = src[i * 3 + 2];
-
-        dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
-    }
-}
-
-static void bgr24ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1,
-                        const uint8_t *src2, int width, uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        int b = src1[3 * i + 0];
-        int g = src1[3 * i + 1];
-        int r = src1[3 * i + 2];
-
-        dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-        dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-    }
-    assert(src1 == src2);
-}
-
-static void bgr24ToUV_half_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1,
-                             const uint8_t *src2, int width, uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        int b = src1[6 * i + 0] + src1[6 * i + 3];
-        int g = src1[6 * i + 1] + src1[6 * i + 4];
-        int r = src1[6 * i + 2] + src1[6 * i + 5];
-
-        dstU[i] = (RU * r + GU * g + BU * b + (257 << RGB2YUV_SHIFT)) >> (RGB2YUV_SHIFT + 1);
-        dstV[i] = (RV * r + GV * g + BV * b + (257 << RGB2YUV_SHIFT)) >> (RGB2YUV_SHIFT + 1);
-    }
-    assert(src1 == src2);
-}
-
-static void rgb24ToY_c(uint8_t *dst, const uint8_t *src, int width,
-                       uint32_t *unused)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        int r = src[i * 3 + 0];
-        int g = src[i * 3 + 1];
-        int b = src[i * 3 + 2];
-
-        dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
-    }
-}
-
-static void rgb24ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1,
-                        const uint8_t *src2, int width, uint32_t *unused)
-{
-    int i;
-    assert(src1 == src2);
-    for (i = 0; i < width; i++) {
-        int r = src1[3 * i + 0];
-        int g = src1[3 * i + 1];
-        int b = src1[3 * i + 2];
-
-        dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-        dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-    }
-}
-
-static void rgb24ToUV_half_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1,
-                             const uint8_t *src2, int width, uint32_t *unused)
-{
-    int i;
-    assert(src1 == src2);
-    for (i = 0; i < width; i++) {
-        int r = src1[6 * i + 0] + src1[6 * i + 3];
-        int g = src1[6 * i + 1] + src1[6 * i + 4];
-        int b = src1[6 * i + 2] + src1[6 * i + 5];
-
-        dstU[i] = (RU * r + GU * g + BU * b + (257 << RGB2YUV_SHIFT)) >> (RGB2YUV_SHIFT + 1);
-        dstV[i] = (RV * r + GV * g + BV * b + (257 << RGB2YUV_SHIFT)) >> (RGB2YUV_SHIFT + 1);
-    }
-}
-
-static void planar_rgb_to_y(uint8_t *dst, const uint8_t *src[4], int width)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        int g = src[0][i];
-        int b = src[1][i];
-        int r = src[2][i];
-
-        dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
-    }
-}
-
-static void planar_rgb_to_uv(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], int width)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        int g = src[0][i];
-        int b = src[1][i];
-        int r = src[2][i];
-
-        dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-        dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
-    }
-}
-
-#define rdpx(src) \
-    is_be ? AV_RB16(src) : AV_RL16(src)
-static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_src[4],
-                                               int width, int bpc, int is_be)
-{
-    int i;
-    const uint16_t **src = (const uint16_t **)_src;
-    uint16_t *dst        = (uint16_t *)_dst;
-    for (i = 0; i < width; i++) {
-        int g = rdpx(src[0] + i);
-        int b = rdpx(src[1] + i);
-        int r = rdpx(src[2] + i);
-
-        dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT + bpc - 9))) >> RGB2YUV_SHIFT);
-    }
-}
-
-static void planar_rgb9le_to_y(uint8_t *dst, const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_y(dst, src, w, 9, 0);
-}
-
-static void planar_rgb9be_to_y(uint8_t *dst, const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_y(dst, src, w, 9, 1);
-}
-
-static void planar_rgb10le_to_y(uint8_t *dst, const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_y(dst, src, w, 10, 0);
-}
-
-static void planar_rgb10be_to_y(uint8_t *dst, const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_y(dst, src, w, 10, 1);
-}
-
-static void planar_rgb16le_to_y(uint8_t *dst, const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_y(dst, src, w, 16, 0);
-}
-
-static void planar_rgb16be_to_y(uint8_t *dst, const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_y(dst, src, w, 16, 1);
-}
-
-static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV,
-                                                const uint8_t *_src[4], int width,
-                                                int bpc, int is_be)
-{
-    int i;
-    const uint16_t **src = (const uint16_t **)_src;
-    uint16_t *dstU       = (uint16_t *)_dstU;
-    uint16_t *dstV       = (uint16_t *)_dstV;
-    for (i = 0; i < width; i++) {
-        int g = rdpx(src[0] + i);
-        int b = rdpx(src[1] + i);
-        int r = rdpx(src[2] + i);
-
-        dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> RGB2YUV_SHIFT;
-        dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> RGB2YUV_SHIFT;
-    }
-}
-#undef rdpx
-
-static void planar_rgb9le_to_uv(uint8_t *dstU, uint8_t *dstV,
-                                const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_uv(dstU, dstV, src, w, 9, 0);
-}
-
-static void planar_rgb9be_to_uv(uint8_t *dstU, uint8_t *dstV,
-                                const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_uv(dstU, dstV, src, w, 9, 1);
-}
-
-static void planar_rgb10le_to_uv(uint8_t *dstU, uint8_t *dstV,
-                                 const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_uv(dstU, dstV, src, w, 10, 0);
-}
-
-static void planar_rgb10be_to_uv(uint8_t *dstU, uint8_t *dstV,
-                                 const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_uv(dstU, dstV, src, w, 10, 1);
-}
-
-static void planar_rgb16le_to_uv(uint8_t *dstU, uint8_t *dstV,
-                                 const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_uv(dstU, dstV, src, w, 16, 0);
-}
-
-static void planar_rgb16be_to_uv(uint8_t *dstU, uint8_t *dstV,
-                                 const uint8_t *src[4], int w)
-{
-    planar_rgb16_to_uv(dstU, dstV, src, w, 16, 1);
-}
-
-av_cold void ff_sws_init_input_funcs(SwsContext *c)
-{
-    enum AVPixelFormat srcFormat = c->srcFormat;
-
-    c->chrToYV12 = NULL;
-    switch (srcFormat) {
-    case AV_PIX_FMT_YUYV422:
-        c->chrToYV12 = yuy2ToUV_c;
-        break;
-    case AV_PIX_FMT_UYVY422:
-        c->chrToYV12 = uyvyToUV_c;
-        break;
-    case AV_PIX_FMT_NV12:
-        c->chrToYV12 = nv12ToUV_c;
-        break;
-    case AV_PIX_FMT_NV21:
-        c->chrToYV12 = nv21ToUV_c;
-        break;
-    case AV_PIX_FMT_RGB8:
-    case AV_PIX_FMT_BGR8:
-    case AV_PIX_FMT_PAL8:
-    case AV_PIX_FMT_BGR4_BYTE:
-    case AV_PIX_FMT_RGB4_BYTE:
-        c->chrToYV12 = palToUV_c;
-        break;
-    case AV_PIX_FMT_GBRP9LE:
-        c->readChrPlanar = planar_rgb9le_to_uv;
-        break;
-    case AV_PIX_FMT_GBRP10LE:
-        c->readChrPlanar = planar_rgb10le_to_uv;
-        break;
-    case AV_PIX_FMT_GBRP16LE:
-        c->readChrPlanar = planar_rgb16le_to_uv;
-        break;
-    case AV_PIX_FMT_GBRP9BE:
-        c->readChrPlanar = planar_rgb9be_to_uv;
-        break;
-    case AV_PIX_FMT_GBRP10BE:
-        c->readChrPlanar = planar_rgb10be_to_uv;
-        break;
-    case AV_PIX_FMT_GBRP16BE:
-        c->readChrPlanar = planar_rgb16be_to_uv;
-        break;
-    case AV_PIX_FMT_GBRP:
-        c->readChrPlanar = planar_rgb_to_uv;
-        break;
-#if HAVE_BIGENDIAN
-    case AV_PIX_FMT_YUV444P9LE:
-    case AV_PIX_FMT_YUV422P9LE:
-    case AV_PIX_FMT_YUV420P9LE:
-    case AV_PIX_FMT_YUV422P10LE:
-    case AV_PIX_FMT_YUV444P10LE:
-    case AV_PIX_FMT_YUV420P10LE:
-    case AV_PIX_FMT_YUV420P16LE:
-    case AV_PIX_FMT_YUV422P16LE:
-    case AV_PIX_FMT_YUV444P16LE:
-    case AV_PIX_FMT_YUVA444P9LE:
-    case AV_PIX_FMT_YUVA422P9LE:
-    case AV_PIX_FMT_YUVA420P9LE:
-    case AV_PIX_FMT_YUVA422P10LE:
-    case AV_PIX_FMT_YUVA444P10LE:
-    case AV_PIX_FMT_YUVA420P10LE:
-    case AV_PIX_FMT_YUVA420P16LE:
-    case AV_PIX_FMT_YUVA422P16LE:
-    case AV_PIX_FMT_YUVA444P16LE:
-        c->chrToYV12 = bswap16UV_c;
-        break;
-#else
-    case AV_PIX_FMT_YUV444P9BE:
-    case AV_PIX_FMT_YUV422P9BE:
-    case AV_PIX_FMT_YUV420P9BE:
-    case AV_PIX_FMT_YUV444P10BE:
-    case AV_PIX_FMT_YUV422P10BE:
-    case AV_PIX_FMT_YUV420P10BE:
-    case AV_PIX_FMT_YUV420P16BE:
-    case AV_PIX_FMT_YUV422P16BE:
-    case AV_PIX_FMT_YUV444P16BE:
-    case AV_PIX_FMT_YUVA444P9BE:
-    case AV_PIX_FMT_YUVA422P9BE:
-    case AV_PIX_FMT_YUVA420P9BE:
-    case AV_PIX_FMT_YUVA422P10BE:
-    case AV_PIX_FMT_YUVA444P10BE:
-    case AV_PIX_FMT_YUVA420P10BE:
-    case AV_PIX_FMT_YUVA420P16BE:
-    case AV_PIX_FMT_YUVA422P16BE:
-    case AV_PIX_FMT_YUVA444P16BE:
-        c->chrToYV12 = bswap16UV_c;
-        break;
-#endif
-    }
-    if (c->chrSrcHSubSample) {
-        switch (srcFormat) {
-        case AV_PIX_FMT_RGB48BE:
-            c->chrToYV12 = rgb48BEToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB48LE:
-            c->chrToYV12 = rgb48LEToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR48BE:
-            c->chrToYV12 = bgr48BEToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR48LE:
-            c->chrToYV12 = bgr48LEToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB32:
-            c->chrToYV12 = bgr32ToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB32_1:
-            c->chrToYV12 = bgr321ToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR24:
-            c->chrToYV12 = bgr24ToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR565LE:
-            c->chrToYV12 = bgr16leToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR565BE:
-            c->chrToYV12 = bgr16beToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR555LE:
-            c->chrToYV12 = bgr15leToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR555BE:
-            c->chrToYV12 = bgr15beToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR444LE:
-            c->chrToYV12 = bgr12leToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR444BE:
-            c->chrToYV12 = bgr12beToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR32:
-            c->chrToYV12 = rgb32ToUV_half_c;
-            break;
-        case AV_PIX_FMT_BGR32_1:
-            c->chrToYV12 = rgb321ToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB24:
-            c->chrToYV12 = rgb24ToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB565LE:
-            c->chrToYV12 = rgb16leToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB565BE:
-            c->chrToYV12 = rgb16beToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB555LE:
-            c->chrToYV12 = rgb15leToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB555BE:
-            c->chrToYV12 = rgb15beToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB444LE:
-            c->chrToYV12 = rgb12leToUV_half_c;
-            break;
-        case AV_PIX_FMT_RGB444BE:
-            c->chrToYV12 = rgb12beToUV_half_c;
-            break;
-        }
-    } else {
-        switch (srcFormat) {
-        case AV_PIX_FMT_RGB48BE:
-            c->chrToYV12 = rgb48BEToUV_c;
-            break;
-        case AV_PIX_FMT_RGB48LE:
-            c->chrToYV12 = rgb48LEToUV_c;
-            break;
-        case AV_PIX_FMT_BGR48BE:
-            c->chrToYV12 = bgr48BEToUV_c;
-            break;
-        case AV_PIX_FMT_BGR48LE:
-            c->chrToYV12 = bgr48LEToUV_c;
-            break;
-        case AV_PIX_FMT_RGB32:
-            c->chrToYV12 = bgr32ToUV_c;
-            break;
-        case AV_PIX_FMT_RGB32_1:
-            c->chrToYV12 = bgr321ToUV_c;
-            break;
-        case AV_PIX_FMT_BGR24:
-            c->chrToYV12 = bgr24ToUV_c;
-            break;
-        case AV_PIX_FMT_BGR565LE:
-            c->chrToYV12 = bgr16leToUV_c;
-            break;
-        case AV_PIX_FMT_BGR565BE:
-            c->chrToYV12 = bgr16beToUV_c;
-            break;
-        case AV_PIX_FMT_BGR555LE:
-            c->chrToYV12 = bgr15leToUV_c;
-            break;
-        case AV_PIX_FMT_BGR555BE:
-            c->chrToYV12 = bgr15beToUV_c;
-            break;
-        case AV_PIX_FMT_BGR444LE:
-            c->chrToYV12 = bgr12leToUV_c;
-            break;
-        case AV_PIX_FMT_BGR444BE:
-            c->chrToYV12 = bgr12beToUV_c;
-            break;
-        case AV_PIX_FMT_BGR32:
-            c->chrToYV12 = rgb32ToUV_c;
-            break;
-        case AV_PIX_FMT_BGR32_1:
-            c->chrToYV12 = rgb321ToUV_c;
-            break;
-        case AV_PIX_FMT_RGB24:
-            c->chrToYV12 = rgb24ToUV_c;
-            break;
-        case AV_PIX_FMT_RGB565LE:
-            c->chrToYV12 = rgb16leToUV_c;
-            break;
-        case AV_PIX_FMT_RGB565BE:
-            c->chrToYV12 = rgb16beToUV_c;
-            break;
-        case AV_PIX_FMT_RGB555LE:
-            c->chrToYV12 = rgb15leToUV_c;
-            break;
-        case AV_PIX_FMT_RGB555BE:
-            c->chrToYV12 = rgb15beToUV_c;
-            break;
-        case AV_PIX_FMT_RGB444LE:
-            c->chrToYV12 = rgb12leToUV_c;
-            break;
-        case AV_PIX_FMT_RGB444BE:
-            c->chrToYV12 = rgb12beToUV_c;
-            break;
-        }
-    }
-
-    c->lumToYV12 = NULL;
-    c->alpToYV12 = NULL;
-    switch (srcFormat) {
-    case AV_PIX_FMT_GBRP9LE:
-        c->readLumPlanar = planar_rgb9le_to_y;
-        break;
-    case AV_PIX_FMT_GBRP10LE:
-        c->readLumPlanar = planar_rgb10le_to_y;
-        break;
-    case AV_PIX_FMT_GBRP16LE:
-        c->readLumPlanar = planar_rgb16le_to_y;
-        break;
-    case AV_PIX_FMT_GBRP9BE:
-        c->readLumPlanar = planar_rgb9be_to_y;
-        break;
-    case AV_PIX_FMT_GBRP10BE:
-        c->readLumPlanar = planar_rgb10be_to_y;
-        break;
-    case AV_PIX_FMT_GBRP16BE:
-        c->readLumPlanar = planar_rgb16be_to_y;
-        break;
-    case AV_PIX_FMT_GBRP:
-        c->readLumPlanar = planar_rgb_to_y;
-        break;
-#if HAVE_BIGENDIAN
-    case AV_PIX_FMT_YUV444P9LE:
-    case AV_PIX_FMT_YUV422P9LE:
-    case AV_PIX_FMT_YUV420P9LE:
-    case AV_PIX_FMT_YUV444P10LE:
-    case AV_PIX_FMT_YUV422P10LE:
-    case AV_PIX_FMT_YUV420P10LE:
-    case AV_PIX_FMT_YUV420P16LE:
-    case AV_PIX_FMT_YUV422P16LE:
-    case AV_PIX_FMT_YUV444P16LE:
-    case AV_PIX_FMT_GRAY16LE:
-        c->lumToYV12 = bswap16Y_c;
-        break;
-    case AV_PIX_FMT_YUVA444P9LE:
-    case AV_PIX_FMT_YUVA422P9LE:
-    case AV_PIX_FMT_YUVA420P9LE:
-    case AV_PIX_FMT_YUVA444P10LE:
-    case AV_PIX_FMT_YUVA422P10LE:
-    case AV_PIX_FMT_YUVA420P10LE:
-    case AV_PIX_FMT_YUVA420P16LE:
-    case AV_PIX_FMT_YUVA422P16LE:
-    case AV_PIX_FMT_YUVA444P16LE:
-        c->lumToYV12 = bswap16Y_c;
-        c->alpToYV12 = bswap16Y_c;
-        break;
-#else
-    case AV_PIX_FMT_YUV444P9BE:
-    case AV_PIX_FMT_YUV422P9BE:
-    case AV_PIX_FMT_YUV420P9BE:
-    case AV_PIX_FMT_YUV444P10BE:
-    case AV_PIX_FMT_YUV422P10BE:
-    case AV_PIX_FMT_YUV420P10BE:
-    case AV_PIX_FMT_YUV420P16BE:
-    case AV_PIX_FMT_YUV422P16BE:
-    case AV_PIX_FMT_YUV444P16BE:
-    case AV_PIX_FMT_GRAY16BE:
-        c->lumToYV12 = bswap16Y_c;
-        break;
-    case AV_PIX_FMT_YUVA444P9BE:
-    case AV_PIX_FMT_YUVA422P9BE:
-    case AV_PIX_FMT_YUVA420P9BE:
-    case AV_PIX_FMT_YUVA444P10BE:
-    case AV_PIX_FMT_YUVA422P10BE:
-    case AV_PIX_FMT_YUVA420P10BE:
-    case AV_PIX_FMT_YUVA420P16BE:
-    case AV_PIX_FMT_YUVA422P16BE:
-    case AV_PIX_FMT_YUVA444P16BE:
-        c->lumToYV12 = bswap16Y_c;
-        c->alpToYV12 = bswap16Y_c;
-        break;
-#endif
-    case AV_PIX_FMT_YUYV422:
-    case AV_PIX_FMT_Y400A:
-        c->lumToYV12 = yuy2ToY_c;
-        break;
-    case AV_PIX_FMT_UYVY422:
-        c->lumToYV12 = uyvyToY_c;
-        break;
-    case AV_PIX_FMT_BGR24:
-        c->lumToYV12 = bgr24ToY_c;
-        break;
-    case AV_PIX_FMT_BGR565LE:
-        c->lumToYV12 = bgr16leToY_c;
-        break;
-    case AV_PIX_FMT_BGR565BE:
-        c->lumToYV12 = bgr16beToY_c;
-        break;
-    case AV_PIX_FMT_BGR555LE:
-        c->lumToYV12 = bgr15leToY_c;
-        break;
-    case AV_PIX_FMT_BGR555BE:
-        c->lumToYV12 = bgr15beToY_c;
-        break;
-    case AV_PIX_FMT_BGR444LE:
-        c->lumToYV12 = bgr12leToY_c;
-        break;
-    case AV_PIX_FMT_BGR444BE:
-        c->lumToYV12 = bgr12beToY_c;
-        break;
-    case AV_PIX_FMT_RGB24:
-        c->lumToYV12 = rgb24ToY_c;
-        break;
-    case AV_PIX_FMT_RGB565LE:
-        c->lumToYV12 = rgb16leToY_c;
-        break;
-    case AV_PIX_FMT_RGB565BE:
-        c->lumToYV12 = rgb16beToY_c;
-        break;
-    case AV_PIX_FMT_RGB555LE:
-        c->lumToYV12 = rgb15leToY_c;
-        break;
-    case AV_PIX_FMT_RGB555BE:
-        c->lumToYV12 = rgb15beToY_c;
-        break;
-    case AV_PIX_FMT_RGB444LE:
-        c->lumToYV12 = rgb12leToY_c;
-        break;
-    case AV_PIX_FMT_RGB444BE:
-        c->lumToYV12 = rgb12beToY_c;
-        break;
-    case AV_PIX_FMT_RGB8:
-    case AV_PIX_FMT_BGR8:
-    case AV_PIX_FMT_PAL8:
-    case AV_PIX_FMT_BGR4_BYTE:
-    case AV_PIX_FMT_RGB4_BYTE:
-        c->lumToYV12 = palToY_c;
-        break;
-    case AV_PIX_FMT_MONOBLACK:
-        c->lumToYV12 = monoblack2Y_c;
-        break;
-    case AV_PIX_FMT_MONOWHITE:
-        c->lumToYV12 = monowhite2Y_c;
-        break;
-    case AV_PIX_FMT_RGB32:
-        c->lumToYV12 = bgr32ToY_c;
-        break;
-    case AV_PIX_FMT_RGB32_1:
-        c->lumToYV12 = bgr321ToY_c;
-        break;
-    case AV_PIX_FMT_BGR32:
-        c->lumToYV12 = rgb32ToY_c;
-        break;
-    case AV_PIX_FMT_BGR32_1:
-        c->lumToYV12 = rgb321ToY_c;
-        break;
-    case AV_PIX_FMT_RGB48BE:
-        c->lumToYV12 = rgb48BEToY_c;
-        break;
-    case AV_PIX_FMT_RGB48LE:
-        c->lumToYV12 = rgb48LEToY_c;
-        break;
-    case AV_PIX_FMT_BGR48BE:
-        c->lumToYV12 = bgr48BEToY_c;
-        break;
-    case AV_PIX_FMT_BGR48LE:
-        c->lumToYV12 = bgr48LEToY_c;
-        break;
-    }
-    if (c->alpPixBuf) {
-        switch (srcFormat) {
-        case AV_PIX_FMT_BGRA:
-        case AV_PIX_FMT_RGBA:
-            c->alpToYV12 = rgbaToA_c;
-            break;
-        case AV_PIX_FMT_ABGR:
-        case AV_PIX_FMT_ARGB:
-            c->alpToYV12 = abgrToA_c;
-            break;
-        case AV_PIX_FMT_Y400A:
-            c->alpToYV12 = uyvyToY_c;
-            break;
-        }
-    }
-}
diff --git a/deps/libav/libswscale/libswscale.v b/deps/libav/libswscale/libswscale.v
deleted file mode 100644
index 8b9a96a..0000000
--- a/deps/libav/libswscale/libswscale.v
+++ /dev/null
@@ -1,4 +0,0 @@
-LIBSWSCALE_$MAJOR {
-        global: swscale_*; sws_*;
-        local: *;
-};
diff --git a/deps/libav/libswscale/options.c b/deps/libav/libswscale/options.c
deleted file mode 100644
index e7765d6..0000000
--- a/deps/libav/libswscale/options.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/avutil.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixfmt.h"
-#include "swscale.h"
-#include "swscale_internal.h"
-
-static const char *sws_context_to_name(void *ptr)
-{
-    return "swscaler";
-}
-
-#define OFFSET(x) offsetof(SwsContext, x)
-#define DEFAULT 0
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-
-static const AVOption swscale_options[] = {
-    { "sws_flags",       "scaler flags",                  OFFSET(flags),     AV_OPT_TYPE_FLAGS,  { .i64 = DEFAULT            }, 0,       UINT_MAX,       VE, "sws_flags" },
-    { "fast_bilinear",   "fast bilinear",                 0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_FAST_BILINEAR  }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "bilinear",        "bilinear",                      0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_BILINEAR       }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "bicubic",         "bicubic",                       0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_BICUBIC        }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "experimental",    "experimental",                  0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_X              }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "neighbor",        "nearest neighbor",              0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_POINT          }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "area",            "averaging area",                0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_AREA           }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "bicublin",        "luma bicubic, chroma bilinear", 0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_BICUBLIN       }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "gauss",           "gaussian",                      0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_GAUSS          }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "sinc",            "sinc",                          0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_SINC           }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "lanczos",         "lanczos",                       0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_LANCZOS        }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "spline",          "natural bicubic spline",        0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_SPLINE         }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "print_info",      "print info",                    0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_PRINT_INFO     }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "accurate_rnd",    "accurate rounding",             0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_ACCURATE_RND   }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "full_chroma_int", "full chroma interpolation",     0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_FULL_CHR_H_INT }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "full_chroma_inp", "full chroma input",             0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_FULL_CHR_H_INP }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-    { "bitexact",        "",                              0,                 AV_OPT_TYPE_CONST,  { .i64  = SWS_BITEXACT       }, INT_MIN, INT_MAX,        VE, "sws_flags" },
-
-    { "srcw",            "source width",                  OFFSET(srcW),      AV_OPT_TYPE_INT,    { .i64 = 16                 }, 1,       INT_MAX,        VE },
-    { "srch",            "source height",                 OFFSET(srcH),      AV_OPT_TYPE_INT,    { .i64 = 16                 }, 1,       INT_MAX,        VE },
-    { "dstw",            "destination width",             OFFSET(dstW),      AV_OPT_TYPE_INT,    { .i64 = 16                 }, 1,       INT_MAX,        VE },
-    { "dsth",            "destination height",            OFFSET(dstH),      AV_OPT_TYPE_INT,    { .i64 = 16                 }, 1,       INT_MAX,        VE },
-    { "src_format",      "source format",                 OFFSET(srcFormat), AV_OPT_TYPE_INT,    { .i64 = DEFAULT            }, 0,       AV_PIX_FMT_NB - 1, VE },
-    { "dst_format",      "destination format",            OFFSET(dstFormat), AV_OPT_TYPE_INT,    { .i64 = DEFAULT            }, 0,       AV_PIX_FMT_NB - 1, VE },
-    { "src_range",       "source range",                  OFFSET(srcRange),  AV_OPT_TYPE_INT,    { .i64 = DEFAULT            }, 0,       1,              VE },
-    { "dst_range",       "destination range",             OFFSET(dstRange),  AV_OPT_TYPE_INT,    { .i64 = DEFAULT            }, 0,       1,              VE },
-    { "param0",          "scaler param 0",                OFFSET(param[0]),  AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT  }, INT_MIN, INT_MAX,        VE },
-    { "param1",          "scaler param 1",                OFFSET(param[1]),  AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT  }, INT_MIN, INT_MAX,        VE },
-
-    { NULL }
-};
-
-const AVClass sws_context_class = { "SWScaler", sws_context_to_name, swscale_options };
-
-const AVClass *sws_get_class(void)
-{
-    return &sws_context_class;
-}
diff --git a/deps/libav/libswscale/output.c b/deps/libav/libswscale/output.c
deleted file mode 100644
index e1d01b0..0000000
--- a/deps/libav/libswscale/output.c
+++ /dev/null
@@ -1,1585 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <assert.h>
-#include <math.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/avutil.h"
-#include "libavutil/bswap.h"
-#include "libavutil/cpu.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/pixdesc.h"
-#include "config.h"
-#include "rgb2rgb.h"
-#include "swscale.h"
-#include "swscale_internal.h"
-
-DECLARE_ALIGNED(8, static const uint8_t, dither_2x2_4)[2][8]={
-{  1,   3,   1,   3,   1,   3,   1,   3, },
-{  2,   0,   2,   0,   2,   0,   2,   0, },
-};
-
-DECLARE_ALIGNED(8, static const uint8_t, dither_2x2_8)[2][8]={
-{  6,   2,   6,   2,   6,   2,   6,   2, },
-{  0,   4,   0,   4,   0,   4,   0,   4, },
-};
-
-DECLARE_ALIGNED(8, const uint8_t, ff_dither_4x4_16)[4][8] = {
-{  8,   4,  11,   7,   8,   4,  11,   7, },
-{  2,  14,   1,  13,   2,  14,   1,  13, },
-{ 10,   6,   9,   5,  10,   6,   9,   5, },
-{  0,  12,   3,  15,   0,  12,   3,  15, },
-};
-
-DECLARE_ALIGNED(8, const uint8_t, ff_dither_8x8_32)[8][8] = {
-{ 17,   9,  23,  15,  16,   8,  22,  14, },
-{  5,  29,   3,  27,   4,  28,   2,  26, },
-{ 21,  13,  19,  11,  20,  12,  18,  10, },
-{  0,  24,   6,  30,   1,  25,   7,  31, },
-{ 16,   8,  22,  14,  17,   9,  23,  15, },
-{  4,  28,   2,  26,   5,  29,   3,  27, },
-{ 20,  12,  18,  10,  21,  13,  19,  11, },
-{  1,  25,   7,  31,   0,  24,   6,  30, },
-};
-
-DECLARE_ALIGNED(8, const uint8_t, ff_dither_8x8_73)[8][8] = {
-{  0,  55,  14,  68,   3,  58,  17,  72, },
-{ 37,  18,  50,  32,  40,  22,  54,  35, },
-{  9,  64,   5,  59,  13,  67,   8,  63, },
-{ 46,  27,  41,  23,  49,  31,  44,  26, },
-{  2,  57,  16,  71,   1,  56,  15,  70, },
-{ 39,  21,  52,  34,  38,  19,  51,  33, },
-{ 11,  66,   7,  62,  10,  65,   6,  60, },
-{ 48,  30,  43,  25,  47,  29,  42,  24, },
-};
-
-#if 1
-DECLARE_ALIGNED(8, const uint8_t, ff_dither_8x8_220)[8][8] = {
-{117,  62, 158, 103, 113,  58, 155, 100, },
-{ 34, 199,  21, 186,  31, 196,  17, 182, },
-{144,  89, 131,  76, 141,  86, 127,  72, },
-{  0, 165,  41, 206,  10, 175,  52, 217, },
-{110,  55, 151,  96, 120,  65, 162, 107, },
-{ 28, 193,  14, 179,  38, 203,  24, 189, },
-{138,  83, 124,  69, 148,  93, 134,  79, },
-{  7, 172,  48, 213,   3, 168,  45, 210, },
-};
-#elif 1
-// tries to correct a gamma of 1.5
-DECLARE_ALIGNED(8, const uint8_t, ff_dither_8x8_220)[8][8] = {
-{  0, 143,  18, 200,   2, 156,  25, 215, },
-{ 78,  28, 125,  64,  89,  36, 138,  74, },
-{ 10, 180,   3, 161,  16, 195,   8, 175, },
-{109,  51,  93,  38, 121,  60, 105,  47, },
-{  1, 152,  23, 210,   0, 147,  20, 205, },
-{ 85,  33, 134,  71,  81,  30, 130,  67, },
-{ 14, 190,   6, 171,  12, 185,   5, 166, },
-{117,  57, 101,  44, 113,  54,  97,  41, },
-};
-#elif 1
-// tries to correct a gamma of 2.0
-DECLARE_ALIGNED(8, const uint8_t, ff_dither_8x8_220)[8][8] = {
-{  0, 124,   8, 193,   0, 140,  12, 213, },
-{ 55,  14, 104,  42,  66,  19, 119,  52, },
-{  3, 168,   1, 145,   6, 187,   3, 162, },
-{ 86,  31,  70,  21,  99,  39,  82,  28, },
-{  0, 134,  11, 206,   0, 129,   9, 200, },
-{ 62,  17, 114,  48,  58,  16, 109,  45, },
-{  5, 181,   2, 157,   4, 175,   1, 151, },
-{ 95,  36,  78,  26,  90,  34,  74,  24, },
-};
-#else
-// tries to correct a gamma of 2.5
-DECLARE_ALIGNED(8, const uint8_t, ff_dither_8x8_220)[8][8] = {
-{  0, 107,   3, 187,   0, 125,   6, 212, },
-{ 39,   7,  86,  28,  49,  11, 102,  36, },
-{  1, 158,   0, 131,   3, 180,   1, 151, },
-{ 68,  19,  52,  12,  81,  25,  64,  17, },
-{  0, 119,   5, 203,   0, 113,   4, 195, },
-{ 45,   9,  96,  33,  42,   8,  91,  30, },
-{  2, 172,   1, 144,   2, 165,   0, 137, },
-{ 77,  23,  60,  15,  72,  21,  56,  14, },
-};
-#endif
-
-#define output_pixel(pos, val, bias, signedness) \
-    if (big_endian) { \
-        AV_WB16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \
-    } else { \
-        AV_WL16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \
-    }
-
-static av_always_inline void
-yuv2plane1_16_c_template(const int32_t *src, uint16_t *dest, int dstW,
-                         int big_endian, int output_bits)
-{
-    int i;
-    int shift = 19 - output_bits;
-
-    for (i = 0; i < dstW; i++) {
-        int val = src[i] + (1 << (shift - 1));
-        output_pixel(&dest[i], val, 0, uint);
-    }
-}
-
-static av_always_inline void
-yuv2planeX_16_c_template(const int16_t *filter, int filterSize,
-                         const int32_t **src, uint16_t *dest, int dstW,
-                         int big_endian, int output_bits)
-{
-    int i;
-    int shift = 15 + 16 - output_bits;
-
-    for (i = 0; i < dstW; i++) {
-        int val = 1 << (30-output_bits);
-        int j;
-
-        /* range of val is [0,0x7FFFFFFF], so 31 bits, but with lanczos/spline
-         * filters (or anything with negative coeffs, the range can be slightly
-         * wider in both directions. To account for this overflow, we subtract
-         * a constant so it always fits in the signed range (assuming a
-         * reasonable filterSize), and re-add that at the end. */
-        val -= 0x40000000;
-        for (j = 0; j < filterSize; j++)
-            val += src[j][i] * filter[j];
-
-        output_pixel(&dest[i], val, 0x8000, int);
-    }
-}
-
-#undef output_pixel
-
-#define output_pixel(pos, val) \
-    if (big_endian) { \
-        AV_WB16(pos, av_clip_uintp2(val >> shift, output_bits)); \
-    } else { \
-        AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits)); \
-    }
-
-static av_always_inline void
-yuv2plane1_10_c_template(const int16_t *src, uint16_t *dest, int dstW,
-                         int big_endian, int output_bits)
-{
-    int i;
-    int shift = 15 - output_bits;
-
-    for (i = 0; i < dstW; i++) {
-        int val = src[i] + (1 << (shift - 1));
-        output_pixel(&dest[i], val);
-    }
-}
-
-static av_always_inline void
-yuv2planeX_10_c_template(const int16_t *filter, int filterSize,
-                         const int16_t **src, uint16_t *dest, int dstW,
-                         int big_endian, int output_bits)
-{
-    int i;
-    int shift = 11 + 16 - output_bits;
-
-    for (i = 0; i < dstW; i++) {
-        int val = 1 << (26-output_bits);
-        int j;
-
-        for (j = 0; j < filterSize; j++)
-            val += src[j][i] * filter[j];
-
-        output_pixel(&dest[i], val);
-    }
-}
-
-#undef output_pixel
-
-#define yuv2NBPS(bits, BE_LE, is_be, template_size, typeX_t) \
-static void yuv2plane1_ ## bits ## BE_LE ## _c(const int16_t *src, \
-                              uint8_t *dest, int dstW, \
-                              const uint8_t *dither, int offset)\
-{ \
-    yuv2plane1_ ## template_size ## _c_template((const typeX_t *) src, \
-                         (uint16_t *) dest, dstW, is_be, bits); \
-}\
-static void yuv2planeX_ ## bits ## BE_LE ## _c(const int16_t *filter, int filterSize, \
-                              const int16_t **src, uint8_t *dest, int dstW, \
-                              const uint8_t *dither, int offset)\
-{ \
-    yuv2planeX_## template_size ## _c_template(filter, \
-                         filterSize, (const typeX_t **) src, \
-                         (uint16_t *) dest, dstW, is_be, bits); \
-}
-yuv2NBPS( 9, BE, 1, 10, int16_t)
-yuv2NBPS( 9, LE, 0, 10, int16_t)
-yuv2NBPS(10, BE, 1, 10, int16_t)
-yuv2NBPS(10, LE, 0, 10, int16_t)
-yuv2NBPS(16, BE, 1, 16, int32_t)
-yuv2NBPS(16, LE, 0, 16, int32_t)
-
-static void yuv2planeX_8_c(const int16_t *filter, int filterSize,
-                           const int16_t **src, uint8_t *dest, int dstW,
-                           const uint8_t *dither, int offset)
-{
-    int i;
-    for (i=0; i<dstW; i++) {
-        int val = dither[(i + offset) & 7] << 12;
-        int j;
-        for (j=0; j<filterSize; j++)
-            val += src[j][i] * filter[j];
-
-        dest[i]= av_clip_uint8(val>>19);
-    }
-}
-
-static void yuv2plane1_8_c(const int16_t *src, uint8_t *dest, int dstW,
-                           const uint8_t *dither, int offset)
-{
-    int i;
-    for (i=0; i<dstW; i++) {
-        int val = (src[i] + dither[(i + offset) & 7]) >> 7;
-        dest[i]= av_clip_uint8(val);
-    }
-}
-
-static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterSize,
-                        const int16_t **chrUSrc, const int16_t **chrVSrc,
-                        uint8_t *dest, int chrDstW)
-{
-    enum AVPixelFormat dstFormat = c->dstFormat;
-    const uint8_t *chrDither = c->chrDither8;
-    int i;
-
-    if (dstFormat == AV_PIX_FMT_NV12)
-        for (i=0; i<chrDstW; i++) {
-            int u = chrDither[i & 7] << 12;
-            int v = chrDither[(i + 3) & 7] << 12;
-            int j;
-            for (j=0; j<chrFilterSize; j++) {
-                u += chrUSrc[j][i] * chrFilter[j];
-                v += chrVSrc[j][i] * chrFilter[j];
-            }
-
-            dest[2*i]= av_clip_uint8(u>>19);
-            dest[2*i+1]= av_clip_uint8(v>>19);
-        }
-    else
-        for (i=0; i<chrDstW; i++) {
-            int u = chrDither[i & 7] << 12;
-            int v = chrDither[(i + 3) & 7] << 12;
-            int j;
-            for (j=0; j<chrFilterSize; j++) {
-                u += chrUSrc[j][i] * chrFilter[j];
-                v += chrVSrc[j][i] * chrFilter[j];
-            }
-
-            dest[2*i]= av_clip_uint8(v>>19);
-            dest[2*i+1]= av_clip_uint8(u>>19);
-        }
-}
-
-#define accumulate_bit(acc, val) \
-    acc <<= 1; \
-    acc |= (val) >= (128 + 110)
-#define output_pixel(pos, acc) \
-    if (target == AV_PIX_FMT_MONOBLACK) { \
-        pos = acc; \
-    } else { \
-        pos = ~acc; \
-    }
-
-static av_always_inline void
-yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,
-                      const int16_t **lumSrc, int lumFilterSize,
-                      const int16_t *chrFilter, const int16_t **chrUSrc,
-                      const int16_t **chrVSrc, int chrFilterSize,
-                      const int16_t **alpSrc, uint8_t *dest, int dstW,
-                      int y, enum AVPixelFormat target)
-{
-    const uint8_t * const d128 = ff_dither_8x8_220[y&7];
-    int i;
-    unsigned acc = 0;
-
-    for (i = 0; i < dstW; i += 2) {
-        int j;
-        int Y1 = 1 << 18;
-        int Y2 = 1 << 18;
-
-        for (j = 0; j < lumFilterSize; j++) {
-            Y1 += lumSrc[j][i]   * lumFilter[j];
-            Y2 += lumSrc[j][i+1] * lumFilter[j];
-        }
-        Y1 >>= 19;
-        Y2 >>= 19;
-        if ((Y1 | Y2) & 0x100) {
-            Y1 = av_clip_uint8(Y1);
-            Y2 = av_clip_uint8(Y2);
-        }
-        accumulate_bit(acc, Y1 + d128[(i + 0) & 7]);
-        accumulate_bit(acc, Y2 + d128[(i + 1) & 7]);
-        if ((i & 7) == 6) {
-            output_pixel(*dest++, acc);
-        }
-    }
-
-    if (i & 6) {
-        output_pixel(*dest, acc);
-    }
-}
-
-static av_always_inline void
-yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2],
-                      const int16_t *ubuf[2], const int16_t *vbuf[2],
-                      const int16_t *abuf[2], uint8_t *dest, int dstW,
-                      int yalpha, int uvalpha, int y,
-                      enum AVPixelFormat target)
-{
-    const int16_t *buf0  = buf[0],  *buf1  = buf[1];
-    const uint8_t * const d128 = ff_dither_8x8_220[y & 7];
-    int  yalpha1 = 4096 - yalpha;
-    int i;
-
-    for (i = 0; i < dstW; i += 8) {
-        int Y, acc = 0;
-
-        Y = (buf0[i + 0] * yalpha1 + buf1[i + 0] * yalpha) >> 19;
-        accumulate_bit(acc, Y + d128[0]);
-        Y = (buf0[i + 1] * yalpha1 + buf1[i + 1] * yalpha) >> 19;
-        accumulate_bit(acc, Y + d128[1]);
-        Y = (buf0[i + 2] * yalpha1 + buf1[i + 2] * yalpha) >> 19;
-        accumulate_bit(acc, Y + d128[2]);
-        Y = (buf0[i + 3] * yalpha1 + buf1[i + 3] * yalpha) >> 19;
-        accumulate_bit(acc, Y + d128[3]);
-        Y = (buf0[i + 4] * yalpha1 + buf1[i + 4] * yalpha) >> 19;
-        accumulate_bit(acc, Y + d128[4]);
-        Y = (buf0[i + 5] * yalpha1 + buf1[i + 5] * yalpha) >> 19;
-        accumulate_bit(acc, Y + d128[5]);
-        Y = (buf0[i + 6] * yalpha1 + buf1[i + 6] * yalpha) >> 19;
-        accumulate_bit(acc, Y + d128[6]);
-        Y = (buf0[i + 7] * yalpha1 + buf1[i + 7] * yalpha) >> 19;
-        accumulate_bit(acc, Y + d128[7]);
-
-        output_pixel(*dest++, acc);
-    }
-}
-
-static av_always_inline void
-yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0,
-                      const int16_t *ubuf[2], const int16_t *vbuf[2],
-                      const int16_t *abuf0, uint8_t *dest, int dstW,
-                      int uvalpha, int y, enum AVPixelFormat target)
-{
-    const uint8_t * const d128 = ff_dither_8x8_220[y & 7];
-    int i;
-
-    for (i = 0; i < dstW; i += 8) {
-        int acc = 0;
-
-        accumulate_bit(acc, (buf0[i + 0] >> 7) + d128[0]);
-        accumulate_bit(acc, (buf0[i + 1] >> 7) + d128[1]);
-        accumulate_bit(acc, (buf0[i + 2] >> 7) + d128[2]);
-        accumulate_bit(acc, (buf0[i + 3] >> 7) + d128[3]);
-        accumulate_bit(acc, (buf0[i + 4] >> 7) + d128[4]);
-        accumulate_bit(acc, (buf0[i + 5] >> 7) + d128[5]);
-        accumulate_bit(acc, (buf0[i + 6] >> 7) + d128[6]);
-        accumulate_bit(acc, (buf0[i + 7] >> 7) + d128[7]);
-
-        output_pixel(*dest++, acc);
-    }
-}
-
-#undef output_pixel
-#undef accumulate_bit
-
-#define YUV2PACKEDWRAPPER(name, base, ext, fmt) \
-static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \
-                                const int16_t **lumSrc, int lumFilterSize, \
-                                const int16_t *chrFilter, const int16_t **chrUSrc, \
-                                const int16_t **chrVSrc, int chrFilterSize, \
-                                const int16_t **alpSrc, uint8_t *dest, int dstW, \
-                                int y) \
-{ \
-    name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
-                                  chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
-                                  alpSrc, dest, dstW, y, fmt); \
-} \
- \
-static void name ## ext ## _2_c(SwsContext *c, const int16_t *buf[2], \
-                                const int16_t *ubuf[2], const int16_t *vbuf[2], \
-                                const int16_t *abuf[2], uint8_t *dest, int dstW, \
-                                int yalpha, int uvalpha, int y) \
-{ \
-    name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \
-                                  dest, dstW, yalpha, uvalpha, y, fmt); \
-} \
- \
-static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \
-                                const int16_t *ubuf[2], const int16_t *vbuf[2], \
-                                const int16_t *abuf0, uint8_t *dest, int dstW, \
-                                int uvalpha, int y) \
-{ \
-    name ## base ## _1_c_template(c, buf0, ubuf, vbuf, \
-                                  abuf0, dest, dstW, uvalpha, \
-                                  y, fmt); \
-}
-
-YUV2PACKEDWRAPPER(yuv2mono,, white, AV_PIX_FMT_MONOWHITE)
-YUV2PACKEDWRAPPER(yuv2mono,, black, AV_PIX_FMT_MONOBLACK)
-
-#define output_pixels(pos, Y1, U, Y2, V) \
-    if (target == AV_PIX_FMT_YUYV422) { \
-        dest[pos + 0] = Y1; \
-        dest[pos + 1] = U;  \
-        dest[pos + 2] = Y2; \
-        dest[pos + 3] = V;  \
-    } else { \
-        dest[pos + 0] = U;  \
-        dest[pos + 1] = Y1; \
-        dest[pos + 2] = V;  \
-        dest[pos + 3] = Y2; \
-    }
-
-static av_always_inline void
-yuv2422_X_c_template(SwsContext *c, const int16_t *lumFilter,
-                     const int16_t **lumSrc, int lumFilterSize,
-                     const int16_t *chrFilter, const int16_t **chrUSrc,
-                     const int16_t **chrVSrc, int chrFilterSize,
-                     const int16_t **alpSrc, uint8_t *dest, int dstW,
-                     int y, enum AVPixelFormat target)
-{
-    int i;
-
-    for (i = 0; i < ((dstW + 1) >> 1); i++) {
-        int j;
-        int Y1 = 1 << 18;
-        int Y2 = 1 << 18;
-        int U  = 1 << 18;
-        int V  = 1 << 18;
-
-        for (j = 0; j < lumFilterSize; j++) {
-            Y1 += lumSrc[j][i * 2]     * lumFilter[j];
-            Y2 += lumSrc[j][i * 2 + 1] * lumFilter[j];
-        }
-        for (j = 0; j < chrFilterSize; j++) {
-            U += chrUSrc[j][i] * chrFilter[j];
-            V += chrVSrc[j][i] * chrFilter[j];
-        }
-        Y1 >>= 19;
-        Y2 >>= 19;
-        U  >>= 19;
-        V  >>= 19;
-        if ((Y1 | Y2 | U | V) & 0x100) {
-            Y1 = av_clip_uint8(Y1);
-            Y2 = av_clip_uint8(Y2);
-            U  = av_clip_uint8(U);
-            V  = av_clip_uint8(V);
-        }
-        output_pixels(4*i, Y1, U, Y2, V);
-    }
-}
-
-static av_always_inline void
-yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2],
-                     const int16_t *ubuf[2], const int16_t *vbuf[2],
-                     const int16_t *abuf[2], uint8_t *dest, int dstW,
-                     int yalpha, int uvalpha, int y,
-                     enum AVPixelFormat target)
-{
-    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
-                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
-                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];
-    int  yalpha1 = 4096 - yalpha;
-    int uvalpha1 = 4096 - uvalpha;
-    int i;
-
-    for (i = 0; i < ((dstW + 1) >> 1); i++) {
-        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;
-        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;
-        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha) >> 19;
-        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha) >> 19;
-
-        Y1 = av_clip_uint8(Y1);
-        Y2 = av_clip_uint8(Y2);
-        U  = av_clip_uint8(U);
-        V  = av_clip_uint8(V);
-
-        output_pixels(i * 4, Y1, U, Y2, V);
-    }
-}
-
-static av_always_inline void
-yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
-                     const int16_t *ubuf[2], const int16_t *vbuf[2],
-                     const int16_t *abuf0, uint8_t *dest, int dstW,
-                     int uvalpha, int y, enum AVPixelFormat target)
-{
-    const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
-    int i;
-
-    if (uvalpha < 2048) {
-        for (i = 0; i < ((dstW + 1) >> 1); i++) {
-            int Y1 = buf0[i * 2]     >> 7;
-            int Y2 = buf0[i * 2 + 1] >> 7;
-            int U  = ubuf0[i]        >> 7;
-            int V  = vbuf0[i]        >> 7;
-
-            Y1 = av_clip_uint8(Y1);
-            Y2 = av_clip_uint8(Y2);
-            U  = av_clip_uint8(U);
-            V  = av_clip_uint8(V);
-
-            output_pixels(i * 4, Y1, U, Y2, V);
-        }
-    } else {
-        const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
-        for (i = 0; i < ((dstW + 1) >> 1); i++) {
-            int Y1 =  buf0[i * 2]          >> 7;
-            int Y2 =  buf0[i * 2 + 1]      >> 7;
-            int U  = (ubuf0[i] + ubuf1[i]) >> 8;
-            int V  = (vbuf0[i] + vbuf1[i]) >> 8;
-
-            Y1 = av_clip_uint8(Y1);
-            Y2 = av_clip_uint8(Y2);
-            U  = av_clip_uint8(U);
-            V  = av_clip_uint8(V);
-
-            output_pixels(i * 4, Y1, U, Y2, V);
-        }
-    }
-}
-
-#undef output_pixels
-
-YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, AV_PIX_FMT_YUYV422)
-YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, AV_PIX_FMT_UYVY422)
-
-#define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? R : B)
-#define B_R ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? B : R)
-#define output_pixel(pos, val) \
-    if (isBE(target)) { \
-        AV_WB16(pos, val); \
-    } else { \
-        AV_WL16(pos, val); \
-    }
-
-static av_always_inline void
-yuv2rgb48_X_c_template(SwsContext *c, const int16_t *lumFilter,
-                       const int32_t **lumSrc, int lumFilterSize,
-                       const int16_t *chrFilter, const int32_t **chrUSrc,
-                       const int32_t **chrVSrc, int chrFilterSize,
-                       const int32_t **alpSrc, uint16_t *dest, int dstW,
-                       int y, enum AVPixelFormat target)
-{
-    int i;
-
-    for (i = 0; i < ((dstW + 1) >> 1); i++) {
-        int j;
-        int Y1 = -0x40000000;
-        int Y2 = -0x40000000;
-        int U  = -128 << 23; // 19
-        int V  = -128 << 23;
-        int R, G, B;
-
-        for (j = 0; j < lumFilterSize; j++) {
-            Y1 += lumSrc[j][i * 2]     * lumFilter[j];
-            Y2 += lumSrc[j][i * 2 + 1] * lumFilter[j];
-        }
-        for (j = 0; j < chrFilterSize; j++) {
-            U += chrUSrc[j][i] * chrFilter[j];
-            V += chrVSrc[j][i] * chrFilter[j];
-        }
-
-        // 8bit: 12+15=27; 16-bit: 12+19=31
-        Y1 >>= 14; // 10
-        Y1 += 0x10000;
-        Y2 >>= 14;
-        Y2 += 0x10000;
-        U  >>= 14;
-        V  >>= 14;
-
-        // 8bit: 27 -> 17bit, 16bit: 31 - 14 = 17bit
-        Y1 -= c->yuv2rgb_y_offset;
-        Y2 -= c->yuv2rgb_y_offset;
-        Y1 *= c->yuv2rgb_y_coeff;
-        Y2 *= c->yuv2rgb_y_coeff;
-        Y1 += 1 << 13; // 21
-        Y2 += 1 << 13;
-        // 8bit: 17 + 13bit = 30bit, 16bit: 17 + 13bit = 30bit
-
-        R = V * c->yuv2rgb_v2r_coeff;
-        G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
-        B =                            U * c->yuv2rgb_u2b_coeff;
-
-        // 8bit: 30 - 22 = 8bit, 16bit: 30bit - 14 = 16bit
-        output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
-        output_pixel(&dest[1], av_clip_uintp2(  G + Y1, 30) >> 14);
-        output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
-        output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);
-        output_pixel(&dest[4], av_clip_uintp2(  G + Y2, 30) >> 14);
-        output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);
-        dest += 6;
-    }
-}
-
-static av_always_inline void
-yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2],
-                       const int32_t *ubuf[2], const int32_t *vbuf[2],
-                       const int32_t *abuf[2], uint16_t *dest, int dstW,
-                       int yalpha, int uvalpha, int y,
-                       enum AVPixelFormat target)
-{
-    const int32_t *buf0  = buf[0],  *buf1  = buf[1],
-                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
-                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];
-    int  yalpha1 = 4096 - yalpha;
-    int uvalpha1 = 4096 - uvalpha;
-    int i;
-
-    for (i = 0; i < ((dstW + 1) >> 1); i++) {
-        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha) >> 14;
-        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha) >> 14;
-        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha + (-128 << 23)) >> 14;
-        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha + (-128 << 23)) >> 14;
-        int R, G, B;
-
-        Y1 -= c->yuv2rgb_y_offset;
-        Y2 -= c->yuv2rgb_y_offset;
-        Y1 *= c->yuv2rgb_y_coeff;
-        Y2 *= c->yuv2rgb_y_coeff;
-        Y1 += 1 << 13;
-        Y2 += 1 << 13;
-
-        R = V * c->yuv2rgb_v2r_coeff;
-        G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
-        B =                            U * c->yuv2rgb_u2b_coeff;
-
-        output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
-        output_pixel(&dest[1], av_clip_uintp2(  G + Y1, 30) >> 14);
-        output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
-        output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);
-        output_pixel(&dest[4], av_clip_uintp2(  G + Y2, 30) >> 14);
-        output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);
-        dest += 6;
-    }
-}
-
-static av_always_inline void
-yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0,
-                       const int32_t *ubuf[2], const int32_t *vbuf[2],
-                       const int32_t *abuf0, uint16_t *dest, int dstW,
-                       int uvalpha, int y, enum AVPixelFormat target)
-{
-    const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
-    int i;
-
-    if (uvalpha < 2048) {
-        for (i = 0; i < ((dstW + 1) >> 1); i++) {
-            int Y1 = (buf0[i * 2]    ) >> 2;
-            int Y2 = (buf0[i * 2 + 1]) >> 2;
-            int U  = (ubuf0[i] + (-128 << 11)) >> 2;
-            int V  = (vbuf0[i] + (-128 << 11)) >> 2;
-            int R, G, B;
-
-            Y1 -= c->yuv2rgb_y_offset;
-            Y2 -= c->yuv2rgb_y_offset;
-            Y1 *= c->yuv2rgb_y_coeff;
-            Y2 *= c->yuv2rgb_y_coeff;
-            Y1 += 1 << 13;
-            Y2 += 1 << 13;
-
-            R = V * c->yuv2rgb_v2r_coeff;
-            G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
-            B =                            U * c->yuv2rgb_u2b_coeff;
-
-            output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
-            output_pixel(&dest[1], av_clip_uintp2(  G + Y1, 30) >> 14);
-            output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
-            output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);
-            output_pixel(&dest[4], av_clip_uintp2(  G + Y2, 30) >> 14);
-            output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);
-            dest += 6;
-        }
-    } else {
-        const int32_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
-        for (i = 0; i < ((dstW + 1) >> 1); i++) {
-            int Y1 = (buf0[i * 2]    ) >> 2;
-            int Y2 = (buf0[i * 2 + 1]) >> 2;
-            int U  = (ubuf0[i] + ubuf1[i] + (-128 << 12)) >> 3;
-            int V  = (vbuf0[i] + vbuf1[i] + (-128 << 12)) >> 3;
-            int R, G, B;
-
-            Y1 -= c->yuv2rgb_y_offset;
-            Y2 -= c->yuv2rgb_y_offset;
-            Y1 *= c->yuv2rgb_y_coeff;
-            Y2 *= c->yuv2rgb_y_coeff;
-            Y1 += 1 << 13;
-            Y2 += 1 << 13;
-
-            R = V * c->yuv2rgb_v2r_coeff;
-            G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
-            B =                            U * c->yuv2rgb_u2b_coeff;
-
-            output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
-            output_pixel(&dest[1], av_clip_uintp2(  G + Y1, 30) >> 14);
-            output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
-            output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);
-            output_pixel(&dest[4], av_clip_uintp2(  G + Y2, 30) >> 14);
-            output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);
-            dest += 6;
-        }
-    }
-}
-
-#undef output_pixel
-#undef r_b
-#undef b_r
-
-#define YUV2PACKED16WRAPPER(name, base, ext, fmt) \
-static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \
-                        const int16_t **_lumSrc, int lumFilterSize, \
-                        const int16_t *chrFilter, const int16_t **_chrUSrc, \
-                        const int16_t **_chrVSrc, int chrFilterSize, \
-                        const int16_t **_alpSrc, uint8_t *_dest, int dstW, \
-                        int y) \
-{ \
-    const int32_t **lumSrc  = (const int32_t **) _lumSrc, \
-                  **chrUSrc = (const int32_t **) _chrUSrc, \
-                  **chrVSrc = (const int32_t **) _chrVSrc, \
-                  **alpSrc  = (const int32_t **) _alpSrc; \
-    uint16_t *dest = (uint16_t *) _dest; \
-    name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
-                          chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
-                          alpSrc, dest, dstW, y, fmt); \
-} \
- \
-static void name ## ext ## _2_c(SwsContext *c, const int16_t *_buf[2], \
-                        const int16_t *_ubuf[2], const int16_t *_vbuf[2], \
-                        const int16_t *_abuf[2], uint8_t *_dest, int dstW, \
-                        int yalpha, int uvalpha, int y) \
-{ \
-    const int32_t **buf  = (const int32_t **) _buf, \
-                  **ubuf = (const int32_t **) _ubuf, \
-                  **vbuf = (const int32_t **) _vbuf, \
-                  **abuf = (const int32_t **) _abuf; \
-    uint16_t *dest = (uint16_t *) _dest; \
-    name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \
-                          dest, dstW, yalpha, uvalpha, y, fmt); \
-} \
- \
-static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \
-                        const int16_t *_ubuf[2], const int16_t *_vbuf[2], \
-                        const int16_t *_abuf0, uint8_t *_dest, int dstW, \
-                        int uvalpha, int y) \
-{ \
-    const int32_t *buf0  = (const int32_t *)  _buf0, \
-                 **ubuf  = (const int32_t **) _ubuf, \
-                 **vbuf  = (const int32_t **) _vbuf, \
-                  *abuf0 = (const int32_t *)  _abuf0; \
-    uint16_t *dest = (uint16_t *) _dest; \
-    name ## base ## _1_c_template(c, buf0, ubuf, vbuf, abuf0, dest, \
-                                  dstW, uvalpha, y, fmt); \
-}
-
-YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, AV_PIX_FMT_RGB48BE)
-YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, AV_PIX_FMT_RGB48LE)
-YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, AV_PIX_FMT_BGR48BE)
-YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, AV_PIX_FMT_BGR48LE)
-
-/*
- * Write out 2 RGB pixels in the target pixel format. This function takes a
- * R/G/B LUT as generated by ff_yuv2rgb_c_init_tables(), which takes care of
- * things like endianness conversion and shifting. The caller takes care of
- * setting the correct offset in these tables from the chroma (U/V) values.
- * This function then uses the luminance (Y1/Y2) values to write out the
- * correct RGB values into the destination buffer.
- */
-static av_always_inline void
-yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned Y2,
-              unsigned A1, unsigned A2,
-              const void *_r, const void *_g, const void *_b, int y,
-              enum AVPixelFormat target, int hasAlpha)
-{
-    if (target == AV_PIX_FMT_ARGB || target == AV_PIX_FMT_RGBA ||
-        target == AV_PIX_FMT_ABGR || target == AV_PIX_FMT_BGRA) {
-        uint32_t *dest = (uint32_t *) _dest;
-        const uint32_t *r = (const uint32_t *) _r;
-        const uint32_t *g = (const uint32_t *) _g;
-        const uint32_t *b = (const uint32_t *) _b;
-
-#if CONFIG_SMALL
-        int sh = hasAlpha ? ((target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24) : 0;
-
-        dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (hasAlpha ? A1 << sh : 0);
-        dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (hasAlpha ? A2 << sh : 0);
-#else
-        if (hasAlpha) {
-            int sh = (target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24;
-
-            dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (A1 << sh);
-            dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (A2 << sh);
-        } else {
-            dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1];
-            dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2];
-        }
-#endif
-    } else if (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) {
-        uint8_t *dest = (uint8_t *) _dest;
-        const uint8_t *r = (const uint8_t *) _r;
-        const uint8_t *g = (const uint8_t *) _g;
-        const uint8_t *b = (const uint8_t *) _b;
-
-#define r_b ((target == AV_PIX_FMT_RGB24) ? r : b)
-#define b_r ((target == AV_PIX_FMT_RGB24) ? b : r)
-        dest[i * 6 + 0] = r_b[Y1];
-        dest[i * 6 + 1] =   g[Y1];
-        dest[i * 6 + 2] = b_r[Y1];
-        dest[i * 6 + 3] = r_b[Y2];
-        dest[i * 6 + 4] =   g[Y2];
-        dest[i * 6 + 5] = b_r[Y2];
-#undef r_b
-#undef b_r
-    } else if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565 ||
-               target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555 ||
-               target == AV_PIX_FMT_RGB444 || target == AV_PIX_FMT_BGR444) {
-        uint16_t *dest = (uint16_t *) _dest;
-        const uint16_t *r = (const uint16_t *) _r;
-        const uint16_t *g = (const uint16_t *) _g;
-        const uint16_t *b = (const uint16_t *) _b;
-        int dr1, dg1, db1, dr2, dg2, db2;
-
-        if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565) {
-            dr1 = dither_2x2_8[ y & 1     ][0];
-            dg1 = dither_2x2_4[ y & 1     ][0];
-            db1 = dither_2x2_8[(y & 1) ^ 1][0];
-            dr2 = dither_2x2_8[ y & 1     ][1];
-            dg2 = dither_2x2_4[ y & 1     ][1];
-            db2 = dither_2x2_8[(y & 1) ^ 1][1];
-        } else if (target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555) {
-            dr1 = dither_2x2_8[ y & 1     ][0];
-            dg1 = dither_2x2_8[ y & 1     ][1];
-            db1 = dither_2x2_8[(y & 1) ^ 1][0];
-            dr2 = dither_2x2_8[ y & 1     ][1];
-            dg2 = dither_2x2_8[ y & 1     ][0];
-            db2 = dither_2x2_8[(y & 1) ^ 1][1];
-        } else {
-            dr1 = ff_dither_4x4_16[ y & 3     ][0];
-            dg1 = ff_dither_4x4_16[ y & 3     ][1];
-            db1 = ff_dither_4x4_16[(y & 3) ^ 3][0];
-            dr2 = ff_dither_4x4_16[ y & 3     ][1];
-            dg2 = ff_dither_4x4_16[ y & 3     ][0];
-            db2 = ff_dither_4x4_16[(y & 3) ^ 3][1];
-        }
-
-        dest[i * 2 + 0] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1];
-        dest[i * 2 + 1] = r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2];
-    } else /* 8/4-bit */ {
-        uint8_t *dest = (uint8_t *) _dest;
-        const uint8_t *r = (const uint8_t *) _r;
-        const uint8_t *g = (const uint8_t *) _g;
-        const uint8_t *b = (const uint8_t *) _b;
-        int dr1, dg1, db1, dr2, dg2, db2;
-
-        if (target == AV_PIX_FMT_RGB8 || target == AV_PIX_FMT_BGR8) {
-            const uint8_t * const d64 = ff_dither_8x8_73[y & 7];
-            const uint8_t * const d32 = ff_dither_8x8_32[y & 7];
-            dr1 = dg1 = d32[(i * 2 + 0) & 7];
-            db1 =       d64[(i * 2 + 0) & 7];
-            dr2 = dg2 = d32[(i * 2 + 1) & 7];
-            db2 =       d64[(i * 2 + 1) & 7];
-        } else {
-            const uint8_t * const d64  = ff_dither_8x8_73 [y & 7];
-            const uint8_t * const d128 = ff_dither_8x8_220[y & 7];
-            dr1 = db1 = d128[(i * 2 + 0) & 7];
-            dg1 =        d64[(i * 2 + 0) & 7];
-            dr2 = db2 = d128[(i * 2 + 1) & 7];
-            dg2 =        d64[(i * 2 + 1) & 7];
-        }
-
-        if (target == AV_PIX_FMT_RGB4 || target == AV_PIX_FMT_BGR4) {
-            dest[i] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1] +
-                    ((r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]) << 4);
-        } else {
-            dest[i * 2 + 0] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1];
-            dest[i * 2 + 1] = r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2];
-        }
-    }
-}
-
-static av_always_inline void
-yuv2rgb_X_c_template(SwsContext *c, const int16_t *lumFilter,
-                     const int16_t **lumSrc, int lumFilterSize,
-                     const int16_t *chrFilter, const int16_t **chrUSrc,
-                     const int16_t **chrVSrc, int chrFilterSize,
-                     const int16_t **alpSrc, uint8_t *dest, int dstW,
-                     int y, enum AVPixelFormat target, int hasAlpha)
-{
-    int i;
-
-    for (i = 0; i < ((dstW + 1) >> 1); i++) {
-        int j, A1, A2;
-        int Y1 = 1 << 18;
-        int Y2 = 1 << 18;
-        int U  = 1 << 18;
-        int V  = 1 << 18;
-        const void *r, *g, *b;
-
-        for (j = 0; j < lumFilterSize; j++) {
-            Y1 += lumSrc[j][i * 2]     * lumFilter[j];
-            Y2 += lumSrc[j][i * 2 + 1] * lumFilter[j];
-        }
-        for (j = 0; j < chrFilterSize; j++) {
-            U += chrUSrc[j][i] * chrFilter[j];
-            V += chrVSrc[j][i] * chrFilter[j];
-        }
-        Y1 >>= 19;
-        Y2 >>= 19;
-        U  >>= 19;
-        V  >>= 19;
-        if ((Y1 | Y2 | U | V) & 0x100) {
-            Y1 = av_clip_uint8(Y1);
-            Y2 = av_clip_uint8(Y2);
-            U  = av_clip_uint8(U);
-            V  = av_clip_uint8(V);
-        }
-        if (hasAlpha) {
-            A1 = 1 << 18;
-            A2 = 1 << 18;
-            for (j = 0; j < lumFilterSize; j++) {
-                A1 += alpSrc[j][i * 2    ] * lumFilter[j];
-                A2 += alpSrc[j][i * 2 + 1] * lumFilter[j];
-            }
-            A1 >>= 19;
-            A2 >>= 19;
-            if ((A1 | A2) & 0x100) {
-                A1 = av_clip_uint8(A1);
-                A2 = av_clip_uint8(A2);
-            }
-        }
-
-        /* FIXME fix tables so that clipping is not needed and then use _NOCLIP*/
-        r =  c->table_rV[V];
-        g = (c->table_gU[U] + c->table_gV[V]);
-        b =  c->table_bU[U];
-
-        yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
-                      r, g, b, y, target, hasAlpha);
-    }
-}
-
-static av_always_inline void
-yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2],
-                     const int16_t *ubuf[2], const int16_t *vbuf[2],
-                     const int16_t *abuf[2], uint8_t *dest, int dstW,
-                     int yalpha, int uvalpha, int y,
-                     enum AVPixelFormat target, int hasAlpha)
-{
-    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
-                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
-                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
-                  *abuf0 = hasAlpha ? abuf[0] : NULL,
-                  *abuf1 = hasAlpha ? abuf[1] : NULL;
-    int  yalpha1 = 4096 - yalpha;
-    int uvalpha1 = 4096 - uvalpha;
-    int i;
-
-    for (i = 0; i < ((dstW + 1) >> 1); i++) {
-        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;
-        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;
-        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha) >> 19;
-        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha) >> 19;
-        int A1, A2;
-        const void *r, *g, *b;
-
-        Y1 = av_clip_uint8(Y1);
-        Y2 = av_clip_uint8(Y2);
-        U  = av_clip_uint8(U);
-        V  = av_clip_uint8(V);
-
-        r =  c->table_rV[V];
-        g = (c->table_gU[U] + c->table_gV[V]);
-        b =  c->table_bU[U];
-
-        if (hasAlpha) {
-            A1 = (abuf0[i * 2    ] * yalpha1 + abuf1[i * 2    ] * yalpha) >> 19;
-            A2 = (abuf0[i * 2 + 1] * yalpha1 + abuf1[i * 2 + 1] * yalpha) >> 19;
-            A1 = av_clip_uint8(A1);
-            A2 = av_clip_uint8(A2);
-        }
-
-        yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
-                      r, g, b, y, target, hasAlpha);
-    }
-}
-
-static av_always_inline void
-yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
-                     const int16_t *ubuf[2], const int16_t *vbuf[2],
-                     const int16_t *abuf0, uint8_t *dest, int dstW,
-                     int uvalpha, int y, enum AVPixelFormat target,
-                     int hasAlpha)
-{
-    const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
-    int i;
-
-    if (uvalpha < 2048) {
-        for (i = 0; i < ((dstW + 1) >> 1); i++) {
-            int Y1 = buf0[i * 2]     >> 7;
-            int Y2 = buf0[i * 2 + 1] >> 7;
-            int U  = ubuf0[i]        >> 7;
-            int V  = vbuf0[i]        >> 7;
-            int A1, A2;
-            const void *r, *g, *b;
-
-            Y1 = av_clip_uint8(Y1);
-            Y2 = av_clip_uint8(Y2);
-            U  = av_clip_uint8(U);
-            V  = av_clip_uint8(V);
-
-            r =  c->table_rV[V];
-            g = (c->table_gU[U] + c->table_gV[V]);
-            b =  c->table_bU[U];
-
-            if (hasAlpha) {
-                A1 = abuf0[i * 2    ] >> 7;
-                A2 = abuf0[i * 2 + 1] >> 7;
-                A1 = av_clip_uint8(A1);
-                A2 = av_clip_uint8(A2);
-            }
-
-            yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
-                          r, g, b, y, target, hasAlpha);
-        }
-    } else {
-        const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
-        for (i = 0; i < ((dstW + 1) >> 1); i++) {
-            int Y1 =  buf0[i * 2]          >> 7;
-            int Y2 =  buf0[i * 2 + 1]      >> 7;
-            int U  = (ubuf0[i] + ubuf1[i]) >> 8;
-            int V  = (vbuf0[i] + vbuf1[i]) >> 8;
-            int A1, A2;
-            const void *r, *g, *b;
-
-            Y1 = av_clip_uint8(Y1);
-            Y2 = av_clip_uint8(Y2);
-            U  = av_clip_uint8(U);
-            V  = av_clip_uint8(V);
-
-            r =  c->table_rV[V];
-            g = (c->table_gU[U] + c->table_gV[V]);
-            b =  c->table_bU[U];
-
-            if (hasAlpha) {
-                A1 = abuf0[i * 2    ] >> 7;
-                A2 = abuf0[i * 2 + 1] >> 7;
-                A1 = av_clip_uint8(A1);
-                A2 = av_clip_uint8(A2);
-            }
-
-            yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
-                          r, g, b, y, target, hasAlpha);
-        }
-    }
-}
-
-#define YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha) \
-static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \
-                                const int16_t **lumSrc, int lumFilterSize, \
-                                const int16_t *chrFilter, const int16_t **chrUSrc, \
-                                const int16_t **chrVSrc, int chrFilterSize, \
-                                const int16_t **alpSrc, uint8_t *dest, int dstW, \
-                                int y) \
-{ \
-    name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \
-                                  chrFilter, chrUSrc, chrVSrc, chrFilterSize, \
-                                  alpSrc, dest, dstW, y, fmt, hasAlpha); \
-}
-#define YUV2RGBWRAPPER(name, base, ext, fmt, hasAlpha) \
-YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha) \
-static void name ## ext ## _2_c(SwsContext *c, const int16_t *buf[2], \
-                                const int16_t *ubuf[2], const int16_t *vbuf[2], \
-                                const int16_t *abuf[2], uint8_t *dest, int dstW, \
-                                int yalpha, int uvalpha, int y) \
-{ \
-    name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \
-                                  dest, dstW, yalpha, uvalpha, y, fmt, hasAlpha); \
-} \
- \
-static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \
-                                const int16_t *ubuf[2], const int16_t *vbuf[2], \
-                                const int16_t *abuf0, uint8_t *dest, int dstW, \
-                                int uvalpha, int y) \
-{ \
-    name ## base ## _1_c_template(c, buf0, ubuf, vbuf, abuf0, dest, \
-                                  dstW, uvalpha, y, fmt, hasAlpha); \
-}
-
-#if CONFIG_SMALL
-YUV2RGBWRAPPER(yuv2rgb,,  32_1,  AV_PIX_FMT_RGB32_1,   CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-YUV2RGBWRAPPER(yuv2rgb,,  32,    AV_PIX_FMT_RGB32,     CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-#else
-#if CONFIG_SWSCALE_ALPHA
-YUV2RGBWRAPPER(yuv2rgb,, a32_1,  AV_PIX_FMT_RGB32_1,   1)
-YUV2RGBWRAPPER(yuv2rgb,, a32,    AV_PIX_FMT_RGB32,     1)
-#endif
-YUV2RGBWRAPPER(yuv2rgb,, x32_1,  AV_PIX_FMT_RGB32_1,   0)
-YUV2RGBWRAPPER(yuv2rgb,, x32,    AV_PIX_FMT_RGB32,     0)
-#endif
-YUV2RGBWRAPPER(yuv2, rgb, rgb24, AV_PIX_FMT_RGB24,   0)
-YUV2RGBWRAPPER(yuv2, rgb, bgr24, AV_PIX_FMT_BGR24,   0)
-YUV2RGBWRAPPER(yuv2rgb,,  16,    AV_PIX_FMT_RGB565,    0)
-YUV2RGBWRAPPER(yuv2rgb,,  15,    AV_PIX_FMT_RGB555,    0)
-YUV2RGBWRAPPER(yuv2rgb,,  12,    AV_PIX_FMT_RGB444,    0)
-YUV2RGBWRAPPER(yuv2rgb,,   8,    AV_PIX_FMT_RGB8,      0)
-YUV2RGBWRAPPER(yuv2rgb,,   4,    AV_PIX_FMT_RGB4,      0)
-YUV2RGBWRAPPER(yuv2rgb,,   4b,   AV_PIX_FMT_RGB4_BYTE, 0)
-
-static av_always_inline void
-yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
-                          const int16_t **lumSrc, int lumFilterSize,
-                          const int16_t *chrFilter, const int16_t **chrUSrc,
-                          const int16_t **chrVSrc, int chrFilterSize,
-                          const int16_t **alpSrc, uint8_t *dest,
-                          int dstW, int y, enum AVPixelFormat target, int hasAlpha)
-{
-    int i;
-    int step = (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) ? 3 : 4;
-
-    for (i = 0; i < dstW; i++) {
-        int j;
-        int Y = 0;
-        int U = -128 << 19;
-        int V = -128 << 19;
-        int R, G, B, A;
-
-        for (j = 0; j < lumFilterSize; j++) {
-            Y += lumSrc[j][i] * lumFilter[j];
-        }
-        for (j = 0; j < chrFilterSize; j++) {
-            U += chrUSrc[j][i] * chrFilter[j];
-            V += chrVSrc[j][i] * chrFilter[j];
-        }
-        Y >>= 10;
-        U >>= 10;
-        V >>= 10;
-        if (hasAlpha) {
-            A = 1 << 21;
-            for (j = 0; j < lumFilterSize; j++) {
-                A += alpSrc[j][i] * lumFilter[j];
-            }
-            A >>= 19;
-            if (A & 0x100)
-                A = av_clip_uint8(A);
-        }
-        Y -= c->yuv2rgb_y_offset;
-        Y *= c->yuv2rgb_y_coeff;
-        Y += 1 << 21;
-        R = Y + V*c->yuv2rgb_v2r_coeff;
-        G = Y + V*c->yuv2rgb_v2g_coeff + U*c->yuv2rgb_u2g_coeff;
-        B = Y +                          U*c->yuv2rgb_u2b_coeff;
-        if ((R | G | B) & 0xC0000000) {
-            R = av_clip_uintp2(R, 30);
-            G = av_clip_uintp2(G, 30);
-            B = av_clip_uintp2(B, 30);
-        }
-
-        switch(target) {
-        case AV_PIX_FMT_ARGB:
-            dest[0] = hasAlpha ? A : 255;
-            dest[1] = R >> 22;
-            dest[2] = G >> 22;
-            dest[3] = B >> 22;
-            break;
-        case AV_PIX_FMT_RGB24:
-            dest[0] = R >> 22;
-            dest[1] = G >> 22;
-            dest[2] = B >> 22;
-            break;
-        case AV_PIX_FMT_RGBA:
-            dest[0] = R >> 22;
-            dest[1] = G >> 22;
-            dest[2] = B >> 22;
-            dest[3] = hasAlpha ? A : 255;
-            break;
-        case AV_PIX_FMT_ABGR:
-            dest[0] = hasAlpha ? A : 255;
-            dest[1] = B >> 22;
-            dest[2] = G >> 22;
-            dest[3] = R >> 22;
-            dest += 4;
-            break;
-        case AV_PIX_FMT_BGR24:
-            dest[0] = B >> 22;
-            dest[1] = G >> 22;
-            dest[2] = R >> 22;
-            break;
-        case AV_PIX_FMT_BGRA:
-            dest[0] = B >> 22;
-            dest[1] = G >> 22;
-            dest[2] = R >> 22;
-            dest[3] = hasAlpha ? A : 255;
-            break;
-        }
-        dest += step;
-    }
-}
-
-#if CONFIG_SMALL
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-#else
-#if CONFIG_SWSCALE_ALPHA
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA,  1)
-YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR,  1)
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA,  1)
-YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB,  1)
-#endif
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, AV_PIX_FMT_BGRA,  0)
-YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, AV_PIX_FMT_ABGR,  0)
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, AV_PIX_FMT_RGBA,  0)
-YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, AV_PIX_FMT_ARGB,  0)
-#endif
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full,  AV_PIX_FMT_BGR24, 0)
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full,  AV_PIX_FMT_RGB24, 0)
-
-static void
-yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
-                  const int16_t **lumSrc, int lumFilterSize,
-                  const int16_t *chrFilter, const int16_t **chrUSrc,
-                  const int16_t **chrVSrc, int chrFilterSize,
-                  const int16_t **alpSrc, uint8_t **dest,
-                  int dstW, int y)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->dstFormat);
-    int i;
-    int hasAlpha = 0;
-    uint16_t **dest16 = (uint16_t**)dest;
-    int SH = 22 + 7 - desc->comp[0].depth_minus1;
-
-    for (i = 0; i < dstW; i++) {
-        int j;
-        int Y = 1 << 9;
-        int U = (1 << 9) - (128 << 19);
-        int V = (1 << 9) - (128 << 19);
-        int R, G, B, A;
-
-        for (j = 0; j < lumFilterSize; j++)
-            Y += lumSrc[j][i] * lumFilter[j];
-
-        for (j = 0; j < chrFilterSize; j++) {
-            U += chrUSrc[j][i] * chrFilter[j];
-            V += chrVSrc[j][i] * chrFilter[j];
-        }
-
-        Y >>= 10;
-        U >>= 10;
-        V >>= 10;
-
-        if (hasAlpha) {
-            A = 1 << 18;
-
-            for (j = 0; j < lumFilterSize; j++)
-                A += alpSrc[j][i] * lumFilter[j];
-
-            A >>= 19;
-
-            if (A & 0x100)
-                A = av_clip_uint8(A);
-        }
-
-        Y -= c->yuv2rgb_y_offset;
-        Y *= c->yuv2rgb_y_coeff;
-        Y += 1 << 21;
-        R = Y + V * c->yuv2rgb_v2r_coeff;
-        G = Y + V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
-        B = Y +                            U * c->yuv2rgb_u2b_coeff;
-
-        if ((R | G | B) & 0xC0000000) {
-            R = av_clip_uintp2(R, 30);
-            G = av_clip_uintp2(G, 30);
-            B = av_clip_uintp2(B, 30);
-        }
-
-        if (SH != 22) {
-            dest16[0][i] = G >> SH;
-            dest16[1][i] = B >> SH;
-            dest16[2][i] = R >> SH;
-        } else {
-            dest[0][i] = G >> 22;
-            dest[1][i] = B >> 22;
-            dest[2][i] = R >> 22;
-        }
-    }
-    if (SH != 22 && (!isBE(c->dstFormat)) != (!HAVE_BIGENDIAN)) {
-        for (i = 0; i < dstW; i++) {
-            dest16[0][i] = av_bswap16(dest16[0][i]);
-            dest16[1][i] = av_bswap16(dest16[1][i]);
-            dest16[2][i] = av_bswap16(dest16[2][i]);
-        }
-    }
-}
-
-av_cold void ff_sws_init_output_funcs(SwsContext *c,
-                                      yuv2planar1_fn *yuv2plane1,
-                                      yuv2planarX_fn *yuv2planeX,
-                                      yuv2interleavedX_fn *yuv2nv12cX,
-                                      yuv2packed1_fn *yuv2packed1,
-                                      yuv2packed2_fn *yuv2packed2,
-                                      yuv2packedX_fn *yuv2packedX,
-                                      yuv2anyX_fn *yuv2anyX)
-{
-    enum AVPixelFormat dstFormat = c->dstFormat;
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
-
-    if (is16BPS(dstFormat)) {
-        *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c  : yuv2planeX_16LE_c;
-        *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c  : yuv2plane1_16LE_c;
-    } else if (is9_OR_10BPS(dstFormat)) {
-        if (desc->comp[0].depth_minus1 == 8) {
-            *yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c  : yuv2planeX_9LE_c;
-            *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_9BE_c  : yuv2plane1_9LE_c;
-        } else {
-            *yuv2planeX = isBE(dstFormat) ? yuv2planeX_10BE_c  : yuv2planeX_10LE_c;
-            *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_10BE_c  : yuv2plane1_10LE_c;
-        }
-    } else {
-        *yuv2plane1 = yuv2plane1_8_c;
-        *yuv2planeX = yuv2planeX_8_c;
-        if (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)
-            *yuv2nv12cX = yuv2nv12cX_c;
-    }
-
-    if(c->flags & SWS_FULL_CHR_H_INT) {
-        switch (dstFormat) {
-            case AV_PIX_FMT_RGBA:
-#if CONFIG_SMALL
-                *yuv2packedX = yuv2rgba32_full_X_c;
-#else
-#if CONFIG_SWSCALE_ALPHA
-                if (c->alpPixBuf) {
-                    *yuv2packedX = yuv2rgba32_full_X_c;
-                } else
-#endif /* CONFIG_SWSCALE_ALPHA */
-                {
-                    *yuv2packedX = yuv2rgbx32_full_X_c;
-                }
-#endif /* !CONFIG_SMALL */
-                break;
-            case AV_PIX_FMT_ARGB:
-#if CONFIG_SMALL
-                *yuv2packedX = yuv2argb32_full_X_c;
-#else
-#if CONFIG_SWSCALE_ALPHA
-                if (c->alpPixBuf) {
-                    *yuv2packedX = yuv2argb32_full_X_c;
-                } else
-#endif /* CONFIG_SWSCALE_ALPHA */
-                {
-                    *yuv2packedX = yuv2xrgb32_full_X_c;
-                }
-#endif /* !CONFIG_SMALL */
-                break;
-            case AV_PIX_FMT_BGRA:
-#if CONFIG_SMALL
-                *yuv2packedX = yuv2bgra32_full_X_c;
-#else
-#if CONFIG_SWSCALE_ALPHA
-                if (c->alpPixBuf) {
-                    *yuv2packedX = yuv2bgra32_full_X_c;
-                } else
-#endif /* CONFIG_SWSCALE_ALPHA */
-                {
-                    *yuv2packedX = yuv2bgrx32_full_X_c;
-                }
-#endif /* !CONFIG_SMALL */
-                break;
-            case AV_PIX_FMT_ABGR:
-#if CONFIG_SMALL
-                *yuv2packedX = yuv2abgr32_full_X_c;
-#else
-#if CONFIG_SWSCALE_ALPHA
-                if (c->alpPixBuf) {
-                    *yuv2packedX = yuv2abgr32_full_X_c;
-                } else
-#endif /* CONFIG_SWSCALE_ALPHA */
-                {
-                    *yuv2packedX = yuv2xbgr32_full_X_c;
-                }
-#endif /* !CONFIG_SMALL */
-                break;
-            case AV_PIX_FMT_RGB24:
-            *yuv2packedX = yuv2rgb24_full_X_c;
-            break;
-        case AV_PIX_FMT_BGR24:
-            *yuv2packedX = yuv2bgr24_full_X_c;
-            break;
-        case AV_PIX_FMT_GBRP:
-        case AV_PIX_FMT_GBRP9BE:
-        case AV_PIX_FMT_GBRP9LE:
-        case AV_PIX_FMT_GBRP10BE:
-        case AV_PIX_FMT_GBRP10LE:
-        case AV_PIX_FMT_GBRP16BE:
-        case AV_PIX_FMT_GBRP16LE:
-            *yuv2anyX = yuv2gbrp_full_X_c;
-            break;
-        }
-    } else {
-        switch (dstFormat) {
-        case AV_PIX_FMT_RGB48LE:
-            *yuv2packed1 = yuv2rgb48le_1_c;
-            *yuv2packed2 = yuv2rgb48le_2_c;
-            *yuv2packedX = yuv2rgb48le_X_c;
-            break;
-        case AV_PIX_FMT_RGB48BE:
-            *yuv2packed1 = yuv2rgb48be_1_c;
-            *yuv2packed2 = yuv2rgb48be_2_c;
-            *yuv2packedX = yuv2rgb48be_X_c;
-            break;
-        case AV_PIX_FMT_BGR48LE:
-            *yuv2packed1 = yuv2bgr48le_1_c;
-            *yuv2packed2 = yuv2bgr48le_2_c;
-            *yuv2packedX = yuv2bgr48le_X_c;
-            break;
-        case AV_PIX_FMT_BGR48BE:
-            *yuv2packed1 = yuv2bgr48be_1_c;
-            *yuv2packed2 = yuv2bgr48be_2_c;
-            *yuv2packedX = yuv2bgr48be_X_c;
-            break;
-        case AV_PIX_FMT_RGB32:
-        case AV_PIX_FMT_BGR32:
-#if CONFIG_SMALL
-            *yuv2packed1 = yuv2rgb32_1_c;
-            *yuv2packed2 = yuv2rgb32_2_c;
-            *yuv2packedX = yuv2rgb32_X_c;
-#else
-#if CONFIG_SWSCALE_ALPHA
-                if (c->alpPixBuf) {
-                    *yuv2packed1 = yuv2rgba32_1_c;
-                    *yuv2packed2 = yuv2rgba32_2_c;
-                    *yuv2packedX = yuv2rgba32_X_c;
-                } else
-#endif /* CONFIG_SWSCALE_ALPHA */
-                {
-                    *yuv2packed1 = yuv2rgbx32_1_c;
-                    *yuv2packed2 = yuv2rgbx32_2_c;
-                    *yuv2packedX = yuv2rgbx32_X_c;
-                }
-#endif /* !CONFIG_SMALL */
-            break;
-        case AV_PIX_FMT_RGB32_1:
-        case AV_PIX_FMT_BGR32_1:
-#if CONFIG_SMALL
-                *yuv2packed1 = yuv2rgb32_1_1_c;
-                *yuv2packed2 = yuv2rgb32_1_2_c;
-                *yuv2packedX = yuv2rgb32_1_X_c;
-#else
-#if CONFIG_SWSCALE_ALPHA
-                if (c->alpPixBuf) {
-                    *yuv2packed1 = yuv2rgba32_1_1_c;
-                    *yuv2packed2 = yuv2rgba32_1_2_c;
-                    *yuv2packedX = yuv2rgba32_1_X_c;
-                } else
-#endif /* CONFIG_SWSCALE_ALPHA */
-                {
-                    *yuv2packed1 = yuv2rgbx32_1_1_c;
-                    *yuv2packed2 = yuv2rgbx32_1_2_c;
-                    *yuv2packedX = yuv2rgbx32_1_X_c;
-                }
-#endif /* !CONFIG_SMALL */
-                break;
-        case AV_PIX_FMT_RGB24:
-            *yuv2packed1 = yuv2rgb24_1_c;
-            *yuv2packed2 = yuv2rgb24_2_c;
-            *yuv2packedX = yuv2rgb24_X_c;
-            break;
-        case AV_PIX_FMT_BGR24:
-            *yuv2packed1 = yuv2bgr24_1_c;
-            *yuv2packed2 = yuv2bgr24_2_c;
-            *yuv2packedX = yuv2bgr24_X_c;
-            break;
-        case AV_PIX_FMT_RGB565LE:
-        case AV_PIX_FMT_RGB565BE:
-        case AV_PIX_FMT_BGR565LE:
-        case AV_PIX_FMT_BGR565BE:
-            *yuv2packed1 = yuv2rgb16_1_c;
-            *yuv2packed2 = yuv2rgb16_2_c;
-            *yuv2packedX = yuv2rgb16_X_c;
-            break;
-        case AV_PIX_FMT_RGB555LE:
-        case AV_PIX_FMT_RGB555BE:
-        case AV_PIX_FMT_BGR555LE:
-        case AV_PIX_FMT_BGR555BE:
-            *yuv2packed1 = yuv2rgb15_1_c;
-            *yuv2packed2 = yuv2rgb15_2_c;
-            *yuv2packedX = yuv2rgb15_X_c;
-            break;
-        case AV_PIX_FMT_RGB444LE:
-        case AV_PIX_FMT_RGB444BE:
-        case AV_PIX_FMT_BGR444LE:
-        case AV_PIX_FMT_BGR444BE:
-            *yuv2packed1 = yuv2rgb12_1_c;
-            *yuv2packed2 = yuv2rgb12_2_c;
-            *yuv2packedX = yuv2rgb12_X_c;
-            break;
-        case AV_PIX_FMT_RGB8:
-        case AV_PIX_FMT_BGR8:
-            *yuv2packed1 = yuv2rgb8_1_c;
-            *yuv2packed2 = yuv2rgb8_2_c;
-            *yuv2packedX = yuv2rgb8_X_c;
-            break;
-        case AV_PIX_FMT_RGB4:
-        case AV_PIX_FMT_BGR4:
-            *yuv2packed1 = yuv2rgb4_1_c;
-            *yuv2packed2 = yuv2rgb4_2_c;
-            *yuv2packedX = yuv2rgb4_X_c;
-            break;
-        case AV_PIX_FMT_RGB4_BYTE:
-        case AV_PIX_FMT_BGR4_BYTE:
-            *yuv2packed1 = yuv2rgb4b_1_c;
-            *yuv2packed2 = yuv2rgb4b_2_c;
-            *yuv2packedX = yuv2rgb4b_X_c;
-            break;
-        }
-    }
-    switch (dstFormat) {
-    case AV_PIX_FMT_MONOWHITE:
-        *yuv2packed1 = yuv2monowhite_1_c;
-        *yuv2packed2 = yuv2monowhite_2_c;
-        *yuv2packedX = yuv2monowhite_X_c;
-        break;
-    case AV_PIX_FMT_MONOBLACK:
-        *yuv2packed1 = yuv2monoblack_1_c;
-        *yuv2packed2 = yuv2monoblack_2_c;
-        *yuv2packedX = yuv2monoblack_X_c;
-        break;
-    case AV_PIX_FMT_YUYV422:
-        *yuv2packed1 = yuv2yuyv422_1_c;
-        *yuv2packed2 = yuv2yuyv422_2_c;
-        *yuv2packedX = yuv2yuyv422_X_c;
-        break;
-    case AV_PIX_FMT_UYVY422:
-        *yuv2packed1 = yuv2uyvy422_1_c;
-        *yuv2packed2 = yuv2uyvy422_2_c;
-        *yuv2packedX = yuv2uyvy422_X_c;
-        break;
-    }
-}
diff --git a/deps/libav/libswscale/ppc/Makefile b/deps/libav/libswscale/ppc/Makefile
deleted file mode 100644
index d1b596e..0000000
--- a/deps/libav/libswscale/ppc/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-OBJS += ppc/swscale_altivec.o                                           \
-        ppc/yuv2rgb_altivec.o                                           \
-        ppc/yuv2yuv_altivec.o                                           \
diff --git a/deps/libav/libswscale/ppc/swscale_altivec.c b/deps/libav/libswscale/ppc/swscale_altivec.c
deleted file mode 100644
index 7e00488..0000000
--- a/deps/libav/libswscale/ppc/swscale_altivec.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * AltiVec-enhanced yuv2yuvX
- *
- * Copyright (C) 2004 Romain Dolbeau <romain at dolbeau.org>
- * based on the equivalent C code in swscale.c
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-
-#include "config.h"
-#include "libswscale/swscale.h"
-#include "libswscale/swscale_internal.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "yuv2rgb_altivec.h"
-
-#if HAVE_ALTIVEC
-#define vzero vec_splat_s32(0)
-
-#define yuv2planeX_8(d1, d2, l1, src, x, perm, filter) do {     \
-        vector signed short l2  = vec_ld(((x) << 1) + 16, src); \
-        vector signed short ls  = vec_perm(l1, l2, perm);       \
-        vector signed int   i1  = vec_mule(filter, ls);         \
-        vector signed int   i2  = vec_mulo(filter, ls);         \
-        vector signed int   vf1 = vec_mergeh(i1, i2);           \
-        vector signed int   vf2 = vec_mergel(i1, i2);           \
-        d1 = vec_add(d1, vf1);                                  \
-        d2 = vec_add(d2, vf2);                                  \
-        l1 = l2;                                                \
-    } while (0)
-
-static void yuv2planeX_16_altivec(const int16_t *filter, int filterSize,
-                                  const int16_t **src, uint8_t *dest,
-                                  const uint8_t *dither, int offset, int x)
-{
-    register int i, j;
-    DECLARE_ALIGNED(16, int, val)[16];
-    vector signed int vo1, vo2, vo3, vo4;
-    vector unsigned short vs1, vs2;
-    vector unsigned char vf;
-    vector unsigned int altivec_vectorShiftInt19 =
-        vec_add(vec_splat_u32(10), vec_splat_u32(9));
-
-    for (i = 0; i < 16; i++)
-        val[i] = dither[(x + i + offset) & 7] << 12;
-
-    vo1 = vec_ld(0,  val);
-    vo2 = vec_ld(16, val);
-    vo3 = vec_ld(32, val);
-    vo4 = vec_ld(48, val);
-
-    for (j = 0; j < filterSize; j++) {
-        vector signed short l1, vLumFilter = vec_ld(j << 1, filter);
-        vector unsigned char perm, perm0 = vec_lvsl(j << 1, filter);
-        vLumFilter = vec_perm(vLumFilter, vLumFilter, perm0);
-        vLumFilter = vec_splat(vLumFilter, 0); // lumFilter[j] is loaded 8 times in vLumFilter
-
-        perm = vec_lvsl(x << 1, src[j]);
-        l1   = vec_ld(x << 1, src[j]);
-
-        yuv2planeX_8(vo1, vo2, l1, src[j], x,     perm, vLumFilter);
-        yuv2planeX_8(vo3, vo4, l1, src[j], x + 8, perm, vLumFilter);
-    }
-
-    vo1 = vec_sra(vo1, altivec_vectorShiftInt19);
-    vo2 = vec_sra(vo2, altivec_vectorShiftInt19);
-    vo3 = vec_sra(vo3, altivec_vectorShiftInt19);
-    vo4 = vec_sra(vo4, altivec_vectorShiftInt19);
-    vs1 = vec_packsu(vo1, vo2);
-    vs2 = vec_packsu(vo3, vo4);
-    vf  = vec_packsu(vs1, vs2);
-    vec_st(vf, 0, dest);
-}
-
-static inline void yuv2planeX_u(const int16_t *filter, int filterSize,
-                                const int16_t **src, uint8_t *dest, int dstW,
-                                const uint8_t *dither, int offset, int x)
-{
-    int i, j;
-
-    for (i = x; i < dstW; i++) {
-        int t = dither[(i + offset) & 7] << 12;
-        for (j = 0; j < filterSize; j++)
-            t += src[j][i] * filter[j];
-        dest[i] = av_clip_uint8(t >> 19);
-    }
-}
-
-static void yuv2planeX_altivec(const int16_t *filter, int filterSize,
-                               const int16_t **src, uint8_t *dest, int dstW,
-                               const uint8_t *dither, int offset)
-{
-    int dst_u = -(uintptr_t)dest & 15;
-    int i;
-
-    yuv2planeX_u(filter, filterSize, src, dest, dst_u, dither, offset, 0);
-
-    for (i = dst_u; i < dstW - 15; i += 16)
-        yuv2planeX_16_altivec(filter, filterSize, src, dest + i, dither,
-                              offset, i);
-
-    yuv2planeX_u(filter, filterSize, src, dest, dstW, dither, offset, i);
-}
-
-static void hScale_altivec_real(SwsContext *c, int16_t *dst, int dstW,
-                                const uint8_t *src, const int16_t *filter,
-                                const int32_t *filterPos, int filterSize)
-{
-    register int i;
-    DECLARE_ALIGNED(16, int, tempo)[4];
-
-    if (filterSize % 4) {
-        for (i = 0; i < dstW; i++) {
-            register int j;
-            register int srcPos = filterPos[i];
-            register int val    = 0;
-            for (j = 0; j < filterSize; j++)
-                val += ((int)src[srcPos + j]) * filter[filterSize * i + j];
-            dst[i] = FFMIN(val >> 7, (1 << 15) - 1);
-        }
-    } else
-        switch (filterSize) {
-        case 4:
-            for (i = 0; i < dstW; i++) {
-                register int srcPos = filterPos[i];
-
-                vector unsigned char src_v0 = vec_ld(srcPos, src);
-                vector unsigned char src_v1, src_vF;
-                vector signed short src_v, filter_v;
-                vector signed int val_vEven, val_s;
-                if ((((uintptr_t)src + srcPos) % 16) > 12) {
-                    src_v1 = vec_ld(srcPos + 16, src);
-                }
-                src_vF = vec_perm(src_v0, src_v1, vec_lvsl(srcPos, src));
-
-                src_v = // vec_unpackh sign-extends...
-                        (vector signed short)(vec_mergeh((vector unsigned char)vzero, src_vF));
-                // now put our elements in the even slots
-                src_v = vec_mergeh(src_v, (vector signed short)vzero);
-
-                filter_v = vec_ld(i << 3, filter);
-                // The 3 above is 2 (filterSize == 4) + 1 (sizeof(short) == 2).
-
-                // The neat trick: We only care for half the elements,
-                // high or low depending on (i<<3)%16 (it's 0 or 8 here),
-                // and we're going to use vec_mule, so we choose
-                // carefully how to "unpack" the elements into the even slots.
-                if ((i << 3) % 16)
-                    filter_v = vec_mergel(filter_v, (vector signed short)vzero);
-                else
-                    filter_v = vec_mergeh(filter_v, (vector signed short)vzero);
-
-                val_vEven = vec_mule(src_v, filter_v);
-                val_s     = vec_sums(val_vEven, vzero);
-                vec_st(val_s, 0, tempo);
-                dst[i] = FFMIN(tempo[3] >> 7, (1 << 15) - 1);
-            }
-        break;
-
-        case 8:
-            for (i = 0; i < dstW; i++) {
-                register int srcPos = filterPos[i];
-
-                vector unsigned char src_v0 = vec_ld(srcPos, src);
-                vector unsigned char src_v1, src_vF;
-                vector signed short src_v, filter_v;
-                vector signed int val_v, val_s;
-                if ((((uintptr_t)src + srcPos) % 16) > 8) {
-                    src_v1 = vec_ld(srcPos + 16, src);
-                }
-                src_vF = vec_perm(src_v0, src_v1, vec_lvsl(srcPos, src));
-
-                src_v = // vec_unpackh sign-extends...
-                        (vector signed short)(vec_mergeh((vector unsigned char)vzero, src_vF));
-                filter_v = vec_ld(i << 4, filter);
-                // the 4 above is 3 (filterSize == 8) + 1 (sizeof(short) == 2)
-
-                val_v = vec_msums(src_v, filter_v, (vector signed int)vzero);
-                val_s = vec_sums(val_v, vzero);
-                vec_st(val_s, 0, tempo);
-                dst[i] = FFMIN(tempo[3] >> 7, (1 << 15) - 1);
-            }
-        break;
-
-        case 16:
-            for (i = 0; i < dstW; i++) {
-                register int srcPos = filterPos[i];
-
-                vector unsigned char src_v0 = vec_ld(srcPos, src);
-                vector unsigned char src_v1 = vec_ld(srcPos + 16, src);
-                vector unsigned char src_vF = vec_perm(src_v0, src_v1, vec_lvsl(srcPos, src));
-
-                vector signed short src_vA = // vec_unpackh sign-extends...
-                                             (vector signed short)(vec_mergeh((vector unsigned char)vzero, src_vF));
-                vector signed short src_vB = // vec_unpackh sign-extends...
-                                             (vector signed short)(vec_mergel((vector unsigned char)vzero, src_vF));
-
-                vector signed short filter_v0 = vec_ld(i << 5, filter);
-                vector signed short filter_v1 = vec_ld((i << 5) + 16, filter);
-                // the 5 above are 4 (filterSize == 16) + 1 (sizeof(short) == 2)
-
-                vector signed int val_acc = vec_msums(src_vA, filter_v0, (vector signed int)vzero);
-                vector signed int val_v   = vec_msums(src_vB, filter_v1, val_acc);
-
-                vector signed int val_s = vec_sums(val_v, vzero);
-
-                vec_st(val_s, 0, tempo);
-                dst[i] = FFMIN(tempo[3] >> 7, (1 << 15) - 1);
-            }
-        break;
-
-        default:
-            for (i = 0; i < dstW; i++) {
-                register int j;
-                register int srcPos = filterPos[i];
-
-                vector signed int val_s, val_v = (vector signed int)vzero;
-                vector signed short filter_v0R = vec_ld(i * 2 * filterSize, filter);
-                vector unsigned char permF     = vec_lvsl((i * 2 * filterSize), filter);
-
-                vector unsigned char src_v0 = vec_ld(srcPos, src);
-                vector unsigned char permS  = vec_lvsl(srcPos, src);
-
-                for (j = 0; j < filterSize - 15; j += 16) {
-                    vector unsigned char src_v1 = vec_ld(srcPos + j + 16, src);
-                    vector unsigned char src_vF = vec_perm(src_v0, src_v1, permS);
-
-                    vector signed short src_vA = // vec_unpackh sign-extends...
-                                                 (vector signed short)(vec_mergeh((vector unsigned char)vzero, src_vF));
-                    vector signed short src_vB = // vec_unpackh sign-extends...
-                                                 (vector signed short)(vec_mergel((vector unsigned char)vzero, src_vF));
-
-                    vector signed short filter_v1R = vec_ld((i * 2 * filterSize) + (j * 2) + 16, filter);
-                    vector signed short filter_v2R = vec_ld((i * 2 * filterSize) + (j * 2) + 32, filter);
-                    vector signed short filter_v0  = vec_perm(filter_v0R, filter_v1R, permF);
-                    vector signed short filter_v1  = vec_perm(filter_v1R, filter_v2R, permF);
-
-                    vector signed int val_acc = vec_msums(src_vA, filter_v0, val_v);
-                    val_v = vec_msums(src_vB, filter_v1, val_acc);
-
-                    filter_v0R = filter_v2R;
-                    src_v0     = src_v1;
-                }
-
-                if (j < filterSize - 7) {
-                    // loading src_v0 is useless, it's already done above
-                    // vector unsigned char src_v0 = vec_ld(srcPos + j, src);
-                    vector unsigned char src_v1, src_vF;
-                    vector signed short src_v, filter_v1R, filter_v;
-                    if ((((uintptr_t)src + srcPos) % 16) > 8) {
-                        src_v1 = vec_ld(srcPos + j + 16, src);
-                    }
-                    src_vF = vec_perm(src_v0, src_v1, permS);
-
-                    src_v = // vec_unpackh sign-extends...
-                            (vector signed short)(vec_mergeh((vector unsigned char)vzero, src_vF));
-                    // loading filter_v0R is useless, it's already done above
-                    // vector signed short filter_v0R = vec_ld((i * 2 * filterSize) + j, filter);
-                    filter_v1R = vec_ld((i * 2 * filterSize) + (j * 2) + 16, filter);
-                    filter_v   = vec_perm(filter_v0R, filter_v1R, permF);
-
-                    val_v = vec_msums(src_v, filter_v, val_v);
-                }
-
-                val_s = vec_sums(val_v, vzero);
-
-                vec_st(val_s, 0, tempo);
-                dst[i] = FFMIN(tempo[3] >> 7, (1 << 15) - 1);
-            }
-        }
-}
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_sws_init_swscale_ppc(SwsContext *c)
-{
-#if HAVE_ALTIVEC
-    enum AVPixelFormat dstFormat = c->dstFormat;
-
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    if (c->srcBpc == 8 && c->dstBpc <= 10) {
-        c->hyScale = c->hcScale = hScale_altivec_real;
-    }
-    if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
-        dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
-        !c->alpPixBuf) {
-        c->yuv2planeX = yuv2planeX_altivec;
-    }
-
-    /* The following list of supported dstFormat values should
-     * match what's found in the body of ff_yuv2packedX_altivec() */
-    if (!(c->flags & (SWS_BITEXACT | SWS_FULL_CHR_H_INT)) && !c->alpPixBuf) {
-        switch (c->dstFormat) {
-        case AV_PIX_FMT_ABGR:
-            c->yuv2packedX = ff_yuv2abgr_X_altivec;
-            break;
-        case AV_PIX_FMT_BGRA:
-            c->yuv2packedX = ff_yuv2bgra_X_altivec;
-            break;
-        case AV_PIX_FMT_ARGB:
-            c->yuv2packedX = ff_yuv2argb_X_altivec;
-            break;
-        case AV_PIX_FMT_RGBA:
-            c->yuv2packedX = ff_yuv2rgba_X_altivec;
-            break;
-        case AV_PIX_FMT_BGR24:
-            c->yuv2packedX = ff_yuv2bgr24_X_altivec;
-            break;
-        case AV_PIX_FMT_RGB24:
-            c->yuv2packedX = ff_yuv2rgb24_X_altivec;
-            break;
-        }
-    }
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libswscale/ppc/yuv2rgb_altivec.c b/deps/libav/libswscale/ppc/yuv2rgb_altivec.c
deleted file mode 100644
index 74b0f18..0000000
--- a/deps/libav/libswscale/ppc/yuv2rgb_altivec.c
+++ /dev/null
@@ -1,872 +0,0 @@
-/*
- * AltiVec acceleration for colorspace conversion
- *
- * copyright (C) 2004 Marc Hoffman <marc.hoffman at analog.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Convert I420 YV12 to RGB in various formats,
- * it rejects images that are not in 420 formats,
- * it rejects images that don't have widths of multiples of 16,
- * it rejects images that don't have heights of multiples of 2.
- * Reject defers to C simulation code.
- *
- * Lots of optimizations to be done here.
- *
- * 1. Need to fix saturation code. I just couldn't get it to fly with packs
- * and adds, so we currently use max/min to clip.
- *
- * 2. The inefficient use of chroma loading needs a bit of brushing up.
- *
- * 3. Analysis of pipeline stalls needs to be done. Use shark to identify
- * pipeline stalls.
- *
- *
- * MODIFIED to calculate coeffs from currently selected color space.
- * MODIFIED core to be a macro where you specify the output format.
- * ADDED UYVY conversion which is never called due to some thing in swscale.
- * CORRECTED algorithim selection to be strict on input formats.
- * ADDED runtime detection of AltiVec.
- *
- * ADDED altivec_yuv2packedX vertical scl + RGB converter
- *
- * March 27,2004
- * PERFORMANCE ANALYSIS
- *
- * The C version uses 25% of the processor or ~250Mips for D1 video rawvideo
- * used as test.
- * The AltiVec version uses 10% of the processor or ~100Mips for D1 video
- * same sequence.
- *
- * 720 * 480 * 30  ~10MPS
- *
- * so we have roughly 10 clocks per pixel. This is too high, something has
- * to be wrong.
- *
- * OPTIMIZED clip codes to utilize vec_max and vec_packs removing the
- * need for vec_min.
- *
- * OPTIMIZED DST OUTPUT cache/DMA controls. We are pretty much guaranteed to
- * have the input video frame, it was just decompressed so it probably resides
- * in L1 caches. However, we are creating the output video stream. This needs
- * to use the DSTST instruction to optimize for the cache. We couple this with
- * the fact that we are not going to be visiting the input buffer again so we
- * mark it Least Recently Used. This shaves 25% of the processor cycles off.
- *
- * Now memcpy is the largest mips consumer in the system, probably due
- * to the inefficient X11 stuff.
- *
- * GL libraries seem to be very slow on this machine 1.33Ghz PB running
- * Jaguar, this is not the case for my 1Ghz PB.  I thought it might be
- * a versioning issue, however I have libGL.1.2.dylib for both
- * machines. (We need to figure this out now.)
- *
- * GL2 libraries work now with patch for RGB32.
- *
- * NOTE: quartz vo driver ARGB32_to_RGB24 consumes 30% of the processor.
- *
- * Integrated luma prescaling adjustment for saturation/contrast/brightness
- * adjustment.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <assert.h>
-
-#include "config.h"
-#include "libswscale/rgb2rgb.h"
-#include "libswscale/swscale.h"
-#include "libswscale/swscale_internal.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "yuv2rgb_altivec.h"
-
-#if HAVE_ALTIVEC
-
-#undef PROFILE_THE_BEAST
-#undef INC_SCALING
-
-typedef unsigned char ubyte;
-typedef signed char   sbyte;
-
-/* RGB interleaver, 16 planar pels 8-bit samples per channel in
- * homogeneous vector registers x0,x1,x2 are interleaved with the
- * following technique:
- *
- *    o0 = vec_mergeh(x0, x1);
- *    o1 = vec_perm(o0, x2, perm_rgb_0);
- *    o2 = vec_perm(o0, x2, perm_rgb_1);
- *    o3 = vec_mergel(x0, x1);
- *    o4 = vec_perm(o3, o2, perm_rgb_2);
- *    o5 = vec_perm(o3, o2, perm_rgb_3);
- *
- * perm_rgb_0:   o0(RG).h v1(B) --> o1*
- *            0   1  2   3   4
- *           rgbr|gbrg|brgb|rgbr
- *           0010 0100 1001 0010
- *           0102 3145 2673 894A
- *
- * perm_rgb_1:   o0(RG).h v1(B) --> o2
- *            0   1  2   3   4
- *           gbrg|brgb|bbbb|bbbb
- *           0100 1001 1111 1111
- *           B5CD 6EF7 89AB CDEF
- *
- * perm_rgb_2:   o3(RG).l o2(rgbB.l) --> o4*
- *            0   1  2   3   4
- *           gbrg|brgb|rgbr|gbrg
- *           1111 1111 0010 0100
- *           89AB CDEF 0182 3945
- *
- * perm_rgb_2:   o3(RG).l o2(rgbB.l) ---> o5*
- *            0   1  2   3   4
- *           brgb|rgbr|gbrg|brgb
- *           1001 0010 0100 1001
- *           a67b 89cA BdCD eEFf
- *
- */
-static const vector unsigned char
-    perm_rgb_0 = { 0x00, 0x01, 0x10, 0x02, 0x03, 0x11, 0x04, 0x05,
-                   0x12, 0x06, 0x07, 0x13, 0x08, 0x09, 0x14, 0x0a },
-    perm_rgb_1 = { 0x0b, 0x15, 0x0c, 0x0d, 0x16, 0x0e, 0x0f, 0x17,
-                   0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
-    perm_rgb_2 = { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
-                   0x00, 0x01, 0x18, 0x02, 0x03, 0x19, 0x04, 0x05 },
-    perm_rgb_3 = { 0x1a, 0x06, 0x07, 0x1b, 0x08, 0x09, 0x1c, 0x0a,
-                   0x0b, 0x1d, 0x0c, 0x0d, 0x1e, 0x0e, 0x0f, 0x1f };
-
-#define vec_merge3(x2, x1, x0, y0, y1, y2)     \
-    do {                                       \
-        __typeof__(x0) o0, o2, o3;             \
-        o0 = vec_mergeh(x0, x1);               \
-        y0 = vec_perm(o0, x2, perm_rgb_0);     \
-        o2 = vec_perm(o0, x2, perm_rgb_1);     \
-        o3 = vec_mergel(x0, x1);               \
-        y1 = vec_perm(o3, o2, perm_rgb_2);     \
-        y2 = vec_perm(o3, o2, perm_rgb_3);     \
-    } while (0)
-
-#define vec_mstbgr24(x0, x1, x2, ptr)          \
-    do {                                       \
-        __typeof__(x0) _0, _1, _2;             \
-        vec_merge3(x0, x1, x2, _0, _1, _2);    \
-        vec_st(_0, 0, ptr++);                  \
-        vec_st(_1, 0, ptr++);                  \
-        vec_st(_2, 0, ptr++);                  \
-    } while (0)
-
-#define vec_mstrgb24(x0, x1, x2, ptr)          \
-    do {                                       \
-        __typeof__(x0) _0, _1, _2;             \
-        vec_merge3(x2, x1, x0, _0, _1, _2);    \
-        vec_st(_0, 0, ptr++);                  \
-        vec_st(_1, 0, ptr++);                  \
-        vec_st(_2, 0, ptr++);                  \
-    } while (0)
-
-/* pack the pixels in rgb0 format
- * msb R
- * lsb 0
- */
-#define vec_mstrgb32(T, x0, x1, x2, x3, ptr)                            \
-    do {                                                                \
-        T _0, _1, _2, _3;                                               \
-        _0 = vec_mergeh(x0, x1);                                        \
-        _1 = vec_mergeh(x2, x3);                                        \
-        _2 = (T) vec_mergeh((vector unsigned short) _0,                 \
-                            (vector unsigned short) _1);                \
-        _3 = (T) vec_mergel((vector unsigned short) _0,                 \
-                            (vector unsigned short) _1);                \
-        vec_st(_2, 0 * 16, (T *) ptr);                                  \
-        vec_st(_3, 1 * 16, (T *) ptr);                                  \
-        _0 = vec_mergel(x0, x1);                                        \
-        _1 = vec_mergel(x2, x3);                                        \
-        _2 = (T) vec_mergeh((vector unsigned short) _0,                 \
-                            (vector unsigned short) _1);                \
-        _3 = (T) vec_mergel((vector unsigned short) _0,                 \
-                            (vector unsigned short) _1);                \
-        vec_st(_2, 2 * 16, (T *) ptr);                                  \
-        vec_st(_3, 3 * 16, (T *) ptr);                                  \
-        ptr += 4;                                                       \
-    } while (0)
-
-/*
- * 1     0       1.4021   | | Y |
- * 1    -0.3441 -0.7142   |x| Cb|
- * 1     1.7718  0        | | Cr|
- *
- *
- * Y:      [-128 127]
- * Cb/Cr : [-128 127]
- *
- * typical YUV conversion works on Y: 0-255 this version has been
- * optimized for JPEG decoding.
- */
-
-#define vec_unh(x)                                                      \
-    (vector signed short)                                               \
-        vec_perm(x, (__typeof__(x)) { 0 },                              \
-                 ((vector unsigned char) {                              \
-                     0x10, 0x00, 0x10, 0x01, 0x10, 0x02, 0x10, 0x03,    \
-                     0x10, 0x04, 0x10, 0x05, 0x10, 0x06, 0x10, 0x07 }))
-
-#define vec_unl(x)                                                      \
-    (vector signed short)                                               \
-        vec_perm(x, (__typeof__(x)) { 0 },                              \
-                 ((vector unsigned char) {                              \
-                     0x10, 0x08, 0x10, 0x09, 0x10, 0x0A, 0x10, 0x0B,    \
-                     0x10, 0x0C, 0x10, 0x0D, 0x10, 0x0E, 0x10, 0x0F }))
-
-#define vec_clip_s16(x)                                                 \
-    vec_max(vec_min(x, ((vector signed short) {                         \
-                    235, 235, 235, 235, 235, 235, 235, 235 })),         \
-            ((vector signed short) { 16, 16, 16, 16, 16, 16, 16, 16 }))
-
-#define vec_packclp(x, y)                                               \
-    (vector unsigned char)                                              \
-        vec_packs((vector unsigned short)                               \
-                      vec_max(x, ((vector signed short) { 0 })),        \
-                  (vector unsigned short)                               \
-                      vec_max(y, ((vector signed short) { 0 })))
-
-static inline void cvtyuvtoRGB(SwsContext *c, vector signed short Y,
-                               vector signed short U, vector signed short V,
-                               vector signed short *R, vector signed short *G,
-                               vector signed short *B)
-{
-    vector signed short vx, ux, uvx;
-
-    Y = vec_mradds(Y, c->CY, c->OY);
-    U = vec_sub(U, (vector signed short)
-                       vec_splat((vector signed short) { 128 }, 0));
-    V = vec_sub(V, (vector signed short)
-                       vec_splat((vector signed short) { 128 }, 0));
-
-    // ux  = (CBU * (u << c->CSHIFT) + 0x4000) >> 15;
-    ux = vec_sl(U, c->CSHIFT);
-    *B = vec_mradds(ux, c->CBU, Y);
-
-    // vx  = (CRV * (v << c->CSHIFT) + 0x4000) >> 15;
-    vx = vec_sl(V, c->CSHIFT);
-    *R = vec_mradds(vx, c->CRV, Y);
-
-    // uvx = ((CGU * u) + (CGV * v)) >> 15;
-    uvx = vec_mradds(U, c->CGU, Y);
-    *G  = vec_mradds(V, c->CGV, uvx);
-}
-
-/*
- * ------------------------------------------------------------------------------
- * CS converters
- * ------------------------------------------------------------------------------
- */
-
-#define DEFCSP420_CVT(name, out_pixels)                                       \
-static int altivec_ ## name(SwsContext *c, const unsigned char **in,          \
-                            int *instrides, int srcSliceY, int srcSliceH,     \
-                            unsigned char **oplanes, int *outstrides)         \
-{                                                                             \
-    int w = c->srcW;                                                          \
-    int h = srcSliceH;                                                        \
-    int i, j;                                                                 \
-    int instrides_scl[3];                                                     \
-    vector unsigned char y0, y1;                                              \
-                                                                              \
-    vector signed char u, v;                                                  \
-                                                                              \
-    vector signed short Y0, Y1, Y2, Y3;                                       \
-    vector signed short U, V;                                                 \
-    vector signed short vx, ux, uvx;                                          \
-    vector signed short vx0, ux0, uvx0;                                       \
-    vector signed short vx1, ux1, uvx1;                                       \
-    vector signed short R0, G0, B0;                                           \
-    vector signed short R1, G1, B1;                                           \
-    vector unsigned char R, G, B;                                             \
-                                                                              \
-    const vector unsigned char *y1ivP, *y2ivP, *uivP, *vivP;                  \
-    vector unsigned char align_perm;                                          \
-                                                                              \
-    vector signed short lCY       = c->CY;                                    \
-    vector signed short lOY       = c->OY;                                    \
-    vector signed short lCRV      = c->CRV;                                   \
-    vector signed short lCBU      = c->CBU;                                   \
-    vector signed short lCGU      = c->CGU;                                   \
-    vector signed short lCGV      = c->CGV;                                   \
-    vector unsigned short lCSHIFT = c->CSHIFT;                                \
-                                                                              \
-    const ubyte *y1i = in[0];                                                 \
-    const ubyte *y2i = in[0] + instrides[0];                                  \
-    const ubyte *ui  = in[1];                                                 \
-    const ubyte *vi  = in[2];                                                 \
-                                                                              \
-    vector unsigned char *oute =                                              \
-        (vector unsigned char *)                                              \
-            (oplanes[0] + srcSliceY * outstrides[0]);                         \
-    vector unsigned char *outo =                                              \
-        (vector unsigned char *)                                              \
-            (oplanes[0] + srcSliceY * outstrides[0] + outstrides[0]);         \
-                                                                              \
-    /* loop moves y{1, 2}i by w */                                            \
-    instrides_scl[0] = instrides[0] * 2 - w;                                  \
-    /* loop moves ui by w / 2 */                                              \
-    instrides_scl[1] = instrides[1] - w / 2;                                  \
-    /* loop moves vi by w / 2 */                                              \
-    instrides_scl[2] = instrides[2] - w / 2;                                  \
-                                                                              \
-    for (i = 0; i < h / 2; i++) {                                             \
-        vec_dstst(outo, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 0);       \
-        vec_dstst(oute, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 1);       \
-                                                                              \
-        for (j = 0; j < w / 16; j++) {                                        \
-            y1ivP = (const vector unsigned char *) y1i;                       \
-            y2ivP = (const vector unsigned char *) y2i;                       \
-            uivP  = (const vector unsigned char *) ui;                        \
-            vivP  = (const vector unsigned char *) vi;                        \
-                                                                              \
-            align_perm = vec_lvsl(0, y1i);                                    \
-            y0 = (vector unsigned char)                                       \
-                     vec_perm(y1ivP[0], y1ivP[1], align_perm);                \
-                                                                              \
-            align_perm = vec_lvsl(0, y2i);                                    \
-            y1 = (vector unsigned char)                                       \
-                     vec_perm(y2ivP[0], y2ivP[1], align_perm);                \
-                                                                              \
-            align_perm = vec_lvsl(0, ui);                                     \
-            u = (vector signed char)                                          \
-                    vec_perm(uivP[0], uivP[1], align_perm);                   \
-                                                                              \
-            align_perm = vec_lvsl(0, vi);                                     \
-            v = (vector signed char)                                          \
-                    vec_perm(vivP[0], vivP[1], align_perm);                   \
-                                                                              \
-            u = (vector signed char)                                          \
-                    vec_sub(u,                                                \
-                            (vector signed char)                              \
-                                vec_splat((vector signed char) { 128 }, 0));  \
-            v = (vector signed char)                                          \
-                    vec_sub(v,                                                \
-                            (vector signed char)                              \
-                                vec_splat((vector signed char) { 128 }, 0));  \
-                                                                              \
-            U = vec_unpackh(u);                                               \
-            V = vec_unpackh(v);                                               \
-                                                                              \
-            Y0 = vec_unh(y0);                                                 \
-            Y1 = vec_unl(y0);                                                 \
-            Y2 = vec_unh(y1);                                                 \
-            Y3 = vec_unl(y1);                                                 \
-                                                                              \
-            Y0 = vec_mradds(Y0, lCY, lOY);                                    \
-            Y1 = vec_mradds(Y1, lCY, lOY);                                    \
-            Y2 = vec_mradds(Y2, lCY, lOY);                                    \
-            Y3 = vec_mradds(Y3, lCY, lOY);                                    \
-                                                                              \
-            /* ux  = (CBU * (u << CSHIFT) + 0x4000) >> 15 */                  \
-            ux  = vec_sl(U, lCSHIFT);                                         \
-            ux  = vec_mradds(ux, lCBU, (vector signed short) { 0 });          \
-            ux0 = vec_mergeh(ux, ux);                                         \
-            ux1 = vec_mergel(ux, ux);                                         \
-                                                                              \
-            /* vx  = (CRV * (v << CSHIFT) + 0x4000) >> 15; */                 \
-            vx  = vec_sl(V, lCSHIFT);                                         \
-            vx  = vec_mradds(vx, lCRV, (vector signed short) { 0 });          \
-            vx0 = vec_mergeh(vx, vx);                                         \
-            vx1 = vec_mergel(vx, vx);                                         \
-                                                                              \
-            /* uvx = ((CGU * u) + (CGV * v)) >> 15 */                         \
-            uvx  = vec_mradds(U, lCGU, (vector signed short) { 0 });          \
-            uvx  = vec_mradds(V, lCGV, uvx);                                  \
-            uvx0 = vec_mergeh(uvx, uvx);                                      \
-            uvx1 = vec_mergel(uvx, uvx);                                      \
-                                                                              \
-            R0 = vec_add(Y0, vx0);                                            \
-            G0 = vec_add(Y0, uvx0);                                           \
-            B0 = vec_add(Y0, ux0);                                            \
-            R1 = vec_add(Y1, vx1);                                            \
-            G1 = vec_add(Y1, uvx1);                                           \
-            B1 = vec_add(Y1, ux1);                                            \
-                                                                              \
-            R = vec_packclp(R0, R1);                                          \
-            G = vec_packclp(G0, G1);                                          \
-            B = vec_packclp(B0, B1);                                          \
-                                                                              \
-            out_pixels(R, G, B, oute);                                        \
-                                                                              \
-            R0 = vec_add(Y2, vx0);                                            \
-            G0 = vec_add(Y2, uvx0);                                           \
-            B0 = vec_add(Y2, ux0);                                            \
-            R1 = vec_add(Y3, vx1);                                            \
-            G1 = vec_add(Y3, uvx1);                                           \
-            B1 = vec_add(Y3, ux1);                                            \
-            R  = vec_packclp(R0, R1);                                         \
-            G  = vec_packclp(G0, G1);                                         \
-            B  = vec_packclp(B0, B1);                                         \
-                                                                              \
-                                                                              \
-            out_pixels(R, G, B, outo);                                        \
-                                                                              \
-            y1i += 16;                                                        \
-            y2i += 16;                                                        \
-            ui  += 8;                                                         \
-            vi  += 8;                                                         \
-        }                                                                     \
-                                                                              \
-        outo += (outstrides[0]) >> 4;                                         \
-        oute += (outstrides[0]) >> 4;                                         \
-                                                                              \
-        ui  += instrides_scl[1];                                              \
-        vi  += instrides_scl[2];                                              \
-        y1i += instrides_scl[0];                                              \
-        y2i += instrides_scl[0];                                              \
-    }                                                                         \
-    return srcSliceH;                                                         \
-}
-
-#define out_abgr(a, b, c, ptr)                                          \
-    vec_mstrgb32(__typeof__(a), ((__typeof__(a)) { 255 }), c, b, a, ptr)
-#define out_bgra(a, b, c, ptr)                                          \
-    vec_mstrgb32(__typeof__(a), c, b, a, ((__typeof__(a)) { 255 }), ptr)
-#define out_rgba(a, b, c, ptr)                                          \
-    vec_mstrgb32(__typeof__(a), a, b, c, ((__typeof__(a)) { 255 }), ptr)
-#define out_argb(a, b, c, ptr)                                          \
-    vec_mstrgb32(__typeof__(a), ((__typeof__(a)) { 255 }), a, b, c, ptr)
-#define out_rgb24(a, b, c, ptr) vec_mstrgb24(a, b, c, ptr)
-#define out_bgr24(a, b, c, ptr) vec_mstbgr24(a, b, c, ptr)
-
-DEFCSP420_CVT(yuv2_abgr,  out_abgr)
-DEFCSP420_CVT(yuv2_bgra,  out_bgra)
-DEFCSP420_CVT(yuv2_rgba,  out_rgba)
-DEFCSP420_CVT(yuv2_argb,  out_argb)
-DEFCSP420_CVT(yuv2_rgb24, out_rgb24)
-DEFCSP420_CVT(yuv2_bgr24, out_bgr24)
-
-// uyvy|uyvy|uyvy|uyvy
-// 0123 4567 89ab cdef
-static const vector unsigned char
-    demux_u = { 0x10, 0x00, 0x10, 0x00,
-                0x10, 0x04, 0x10, 0x04,
-                0x10, 0x08, 0x10, 0x08,
-                0x10, 0x0c, 0x10, 0x0c },
-    demux_v = { 0x10, 0x02, 0x10, 0x02,
-                0x10, 0x06, 0x10, 0x06,
-                0x10, 0x0A, 0x10, 0x0A,
-                0x10, 0x0E, 0x10, 0x0E },
-    demux_y = { 0x10, 0x01, 0x10, 0x03,
-                0x10, 0x05, 0x10, 0x07,
-                0x10, 0x09, 0x10, 0x0B,
-                0x10, 0x0D, 0x10, 0x0F };
-
-/*
- * this is so I can play live CCIR raw video
- */
-static int altivec_uyvy_rgb32(SwsContext *c, const unsigned char **in,
-                              int *instrides, int srcSliceY, int srcSliceH,
-                              unsigned char **oplanes, int *outstrides)
-{
-    int w = c->srcW;
-    int h = srcSliceH;
-    int i, j;
-    vector unsigned char uyvy;
-    vector signed short Y, U, V;
-    vector signed short R0, G0, B0, R1, G1, B1;
-    vector unsigned char R, G, B;
-    vector unsigned char *out;
-    const ubyte *img;
-
-    img = in[0];
-    out = (vector unsigned char *) (oplanes[0] + srcSliceY * outstrides[0]);
-
-    for (i = 0; i < h; i++)
-        for (j = 0; j < w / 16; j++) {
-            uyvy = vec_ld(0, img);
-
-            U = (vector signed short)
-                    vec_perm(uyvy, (vector unsigned char) { 0 }, demux_u);
-            V = (vector signed short)
-                    vec_perm(uyvy, (vector unsigned char) { 0 }, demux_v);
-            Y = (vector signed short)
-                    vec_perm(uyvy, (vector unsigned char) { 0 }, demux_y);
-
-            cvtyuvtoRGB(c, Y, U, V, &R0, &G0, &B0);
-
-            uyvy = vec_ld(16, img);
-
-            U = (vector signed short)
-                    vec_perm(uyvy, (vector unsigned char) { 0 }, demux_u);
-            V = (vector signed short)
-                    vec_perm(uyvy, (vector unsigned char) { 0 }, demux_v);
-            Y = (vector signed short)
-                    vec_perm(uyvy, (vector unsigned char) { 0 }, demux_y);
-
-            cvtyuvtoRGB(c, Y, U, V, &R1, &G1, &B1);
-
-            R = vec_packclp(R0, R1);
-            G = vec_packclp(G0, G1);
-            B = vec_packclp(B0, B1);
-
-            // vec_mstbgr24 (R,G,B, out);
-            out_rgba(R, G, B, out);
-
-            img += 32;
-        }
-    return srcSliceH;
-}
-
-#endif /* HAVE_ALTIVEC */
-
-/* Ok currently the acceleration routine only supports
- * inputs of widths a multiple of 16
- * and heights a multiple 2
- *
- * So we just fall back to the C codes for this.
- */
-av_cold SwsFunc ff_yuv2rgb_init_ppc(SwsContext *c)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return NULL;
-
-    /*
-     * and this seems not to matter too much I tried a bunch of
-     * videos with abnormal widths and MPlayer crashes elsewhere.
-     * mplayer -vo x11 -rawvideo on:w=350:h=240 raw-350x240.eyuv
-     * boom with X11 bad match.
-     *
-     */
-    if ((c->srcW & 0xf) != 0)
-        return NULL;
-
-    switch (c->srcFormat) {
-    case AV_PIX_FMT_YUV410P:
-    case AV_PIX_FMT_YUV420P:
-    /*case IMGFMT_CLPL:        ??? */
-    case AV_PIX_FMT_GRAY8:
-    case AV_PIX_FMT_NV12:
-    case AV_PIX_FMT_NV21:
-        if ((c->srcH & 0x1) != 0)
-            return NULL;
-
-        switch (c->dstFormat) {
-        case AV_PIX_FMT_RGB24:
-            av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGB24\n");
-            return altivec_yuv2_rgb24;
-        case AV_PIX_FMT_BGR24:
-            av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGR24\n");
-            return altivec_yuv2_bgr24;
-        case AV_PIX_FMT_ARGB:
-            av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ARGB\n");
-            return altivec_yuv2_argb;
-        case AV_PIX_FMT_ABGR:
-            av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ABGR\n");
-            return altivec_yuv2_abgr;
-        case AV_PIX_FMT_RGBA:
-            av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGBA\n");
-            return altivec_yuv2_rgba;
-        case AV_PIX_FMT_BGRA:
-            av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGRA\n");
-            return altivec_yuv2_bgra;
-        default: return NULL;
-        }
-        break;
-
-    case AV_PIX_FMT_UYVY422:
-        switch (c->dstFormat) {
-        case AV_PIX_FMT_BGR32:
-            av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space UYVY -> RGB32\n");
-            return altivec_uyvy_rgb32;
-        default: return NULL;
-        }
-        break;
-    }
-#endif /* HAVE_ALTIVEC */
-
-    return NULL;
-}
-
-av_cold void ff_yuv2rgb_init_tables_ppc(SwsContext *c,
-                                        const int inv_table[4],
-                                        int brightness,
-                                        int contrast,
-                                        int saturation)
-{
-#if HAVE_ALTIVEC
-    union {
-        DECLARE_ALIGNED(16, signed short, tmp)[8];
-        vector signed short vec;
-    } buf;
-
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    buf.tmp[0] = ((0xffffLL) * contrast >> 8) >> 9;                               // cy
-    buf.tmp[1] = -256 * brightness;                                               // oy
-    buf.tmp[2] =   (inv_table[0] >> 3) * (contrast >> 16) * (saturation >> 16);   // crv
-    buf.tmp[3] =   (inv_table[1] >> 3) * (contrast >> 16) * (saturation >> 16);   // cbu
-    buf.tmp[4] = -((inv_table[2] >> 1) * (contrast >> 16) * (saturation >> 16));  // cgu
-    buf.tmp[5] = -((inv_table[3] >> 1) * (contrast >> 16) * (saturation >> 16));  // cgv
-
-    c->CSHIFT = (vector unsigned short) vec_splat_u16(2);
-    c->CY     = vec_splat((vector signed short) buf.vec, 0);
-    c->OY     = vec_splat((vector signed short) buf.vec, 1);
-    c->CRV    = vec_splat((vector signed short) buf.vec, 2);
-    c->CBU    = vec_splat((vector signed short) buf.vec, 3);
-    c->CGU    = vec_splat((vector signed short) buf.vec, 4);
-    c->CGV    = vec_splat((vector signed short) buf.vec, 5);
-    return;
-#endif /* HAVE_ALTIVEC */
-}
-
-#if HAVE_ALTIVEC
-
-static av_always_inline void yuv2packedX_altivec(SwsContext *c,
-                                                 const int16_t *lumFilter,
-                                                 const int16_t **lumSrc,
-                                                 int lumFilterSize,
-                                                 const int16_t *chrFilter,
-                                                 const int16_t **chrUSrc,
-                                                 const int16_t **chrVSrc,
-                                                 int chrFilterSize,
-                                                 const int16_t **alpSrc,
-                                                 uint8_t *dest,
-                                                 int dstW, int dstY,
-                                                 enum AVPixelFormat target)
-{
-    int i, j;
-    vector signed short X, X0, X1, Y0, U0, V0, Y1, U1, V1, U, V;
-    vector signed short R0, G0, B0, R1, G1, B1;
-
-    vector unsigned char R, G, B;
-    vector unsigned char *out, *nout;
-
-    vector signed short RND   = vec_splat_s16(1 << 3);
-    vector unsigned short SCL = vec_splat_u16(4);
-    DECLARE_ALIGNED(16, unsigned int, scratch)[16];
-
-    vector signed short *YCoeffs, *CCoeffs;
-
-    YCoeffs = c->vYCoeffsBank + dstY * lumFilterSize;
-    CCoeffs = c->vCCoeffsBank + dstY * chrFilterSize;
-
-    out = (vector unsigned char *) dest;
-
-    for (i = 0; i < dstW; i += 16) {
-        Y0 = RND;
-        Y1 = RND;
-        /* extract 16 coeffs from lumSrc */
-        for (j = 0; j < lumFilterSize; j++) {
-            X0 = vec_ld(0, &lumSrc[j][i]);
-            X1 = vec_ld(16, &lumSrc[j][i]);
-            Y0 = vec_mradds(X0, YCoeffs[j], Y0);
-            Y1 = vec_mradds(X1, YCoeffs[j], Y1);
-        }
-
-        U = RND;
-        V = RND;
-        /* extract 8 coeffs from U,V */
-        for (j = 0; j < chrFilterSize; j++) {
-            X = vec_ld(0, &chrUSrc[j][i / 2]);
-            U = vec_mradds(X, CCoeffs[j], U);
-            X = vec_ld(0, &chrVSrc[j][i / 2]);
-            V = vec_mradds(X, CCoeffs[j], V);
-        }
-
-        /* scale and clip signals */
-        Y0 = vec_sra(Y0, SCL);
-        Y1 = vec_sra(Y1, SCL);
-        U  = vec_sra(U, SCL);
-        V  = vec_sra(V, SCL);
-
-        Y0 = vec_clip_s16(Y0);
-        Y1 = vec_clip_s16(Y1);
-        U  = vec_clip_s16(U);
-        V  = vec_clip_s16(V);
-
-        /* now we have
-         * Y0 = y0 y1 y2 y3 y4 y5 y6 y7    Y1 = y8 y9 y10 y11 y12 y13 y14 y15
-         * U  = u0 u1 u2 u3 u4 u5 u6 u7    V  = v0 v1 v2 v3 v4 v5 v6 v7
-         *
-         * Y0 = y0 y1 y2 y3 y4 y5 y6 y7    Y1 = y8 y9 y10 y11 y12 y13 y14 y15
-         * U0 = u0 u0 u1 u1 u2 u2 u3 u3    U1 = u4 u4 u5 u5 u6 u6 u7 u7
-         * V0 = v0 v0 v1 v1 v2 v2 v3 v3    V1 = v4 v4 v5 v5 v6 v6 v7 v7
-         */
-
-        U0 = vec_mergeh(U, U);
-        V0 = vec_mergeh(V, V);
-
-        U1 = vec_mergel(U, U);
-        V1 = vec_mergel(V, V);
-
-        cvtyuvtoRGB(c, Y0, U0, V0, &R0, &G0, &B0);
-        cvtyuvtoRGB(c, Y1, U1, V1, &R1, &G1, &B1);
-
-        R = vec_packclp(R0, R1);
-        G = vec_packclp(G0, G1);
-        B = vec_packclp(B0, B1);
-
-        switch (target) {
-        case AV_PIX_FMT_ABGR:
-            out_abgr(R, G, B, out);
-            break;
-        case AV_PIX_FMT_BGRA:
-            out_bgra(R, G, B, out);
-            break;
-        case AV_PIX_FMT_RGBA:
-            out_rgba(R, G, B, out);
-            break;
-        case AV_PIX_FMT_ARGB:
-            out_argb(R, G, B, out);
-            break;
-        case AV_PIX_FMT_RGB24:
-            out_rgb24(R, G, B, out);
-            break;
-        case AV_PIX_FMT_BGR24:
-            out_bgr24(R, G, B, out);
-            break;
-        default:
-        {
-            /* If this is reached, the caller should have called yuv2packedXinC
-             * instead. */
-            static int printed_error_message;
-            if (!printed_error_message) {
-                av_log(c, AV_LOG_ERROR,
-                       "altivec_yuv2packedX doesn't support %s output\n",
-                       sws_format_name(c->dstFormat));
-                printed_error_message = 1;
-            }
-            return;
-        }
-        }
-    }
-
-    if (i < dstW) {
-        i -= 16;
-
-        Y0 = RND;
-        Y1 = RND;
-        /* extract 16 coeffs from lumSrc */
-        for (j = 0; j < lumFilterSize; j++) {
-            X0 = vec_ld(0, &lumSrc[j][i]);
-            X1 = vec_ld(16, &lumSrc[j][i]);
-            Y0 = vec_mradds(X0, YCoeffs[j], Y0);
-            Y1 = vec_mradds(X1, YCoeffs[j], Y1);
-        }
-
-        U = RND;
-        V = RND;
-        /* extract 8 coeffs from U,V */
-        for (j = 0; j < chrFilterSize; j++) {
-            X = vec_ld(0, &chrUSrc[j][i / 2]);
-            U = vec_mradds(X, CCoeffs[j], U);
-            X = vec_ld(0, &chrVSrc[j][i / 2]);
-            V = vec_mradds(X, CCoeffs[j], V);
-        }
-
-        /* scale and clip signals */
-        Y0 = vec_sra(Y0, SCL);
-        Y1 = vec_sra(Y1, SCL);
-        U  = vec_sra(U, SCL);
-        V  = vec_sra(V, SCL);
-
-        Y0 = vec_clip_s16(Y0);
-        Y1 = vec_clip_s16(Y1);
-        U  = vec_clip_s16(U);
-        V  = vec_clip_s16(V);
-
-        /* now we have
-         * Y0 = y0 y1 y2 y3 y4 y5 y6 y7    Y1 = y8 y9 y10 y11 y12 y13 y14 y15
-         * U  = u0 u1 u2 u3 u4 u5 u6 u7    V  = v0 v1 v2 v3 v4 v5 v6 v7
-         *
-         * Y0 = y0 y1 y2 y3 y4 y5 y6 y7    Y1 = y8 y9 y10 y11 y12 y13 y14 y15
-         * U0 = u0 u0 u1 u1 u2 u2 u3 u3    U1 = u4 u4 u5 u5 u6 u6 u7 u7
-         * V0 = v0 v0 v1 v1 v2 v2 v3 v3    V1 = v4 v4 v5 v5 v6 v6 v7 v7
-         */
-
-        U0 = vec_mergeh(U, U);
-        V0 = vec_mergeh(V, V);
-
-        U1 = vec_mergel(U, U);
-        V1 = vec_mergel(V, V);
-
-        cvtyuvtoRGB(c, Y0, U0, V0, &R0, &G0, &B0);
-        cvtyuvtoRGB(c, Y1, U1, V1, &R1, &G1, &B1);
-
-        R = vec_packclp(R0, R1);
-        G = vec_packclp(G0, G1);
-        B = vec_packclp(B0, B1);
-
-        nout = (vector unsigned char *) scratch;
-        switch (target) {
-        case AV_PIX_FMT_ABGR:
-            out_abgr(R, G, B, nout);
-            break;
-        case AV_PIX_FMT_BGRA:
-            out_bgra(R, G, B, nout);
-            break;
-        case AV_PIX_FMT_RGBA:
-            out_rgba(R, G, B, nout);
-            break;
-        case AV_PIX_FMT_ARGB:
-            out_argb(R, G, B, nout);
-            break;
-        case AV_PIX_FMT_RGB24:
-            out_rgb24(R, G, B, nout);
-            break;
-        case AV_PIX_FMT_BGR24:
-            out_bgr24(R, G, B, nout);
-            break;
-        default:
-            /* Unreachable, I think. */
-            av_log(c, AV_LOG_ERROR,
-                   "altivec_yuv2packedX doesn't support %s output\n",
-                   sws_format_name(c->dstFormat));
-            return;
-        }
-
-        memcpy(&((uint32_t *) dest)[i], scratch, (dstW - i) / 4);
-    }
-}
-
-#define YUV2PACKEDX_WRAPPER(suffix, pixfmt)                             \
-void ff_yuv2 ## suffix ## _X_altivec(SwsContext *c,                     \
-                                     const int16_t *lumFilter,          \
-                                     const int16_t **lumSrc,            \
-                                     int lumFilterSize,                 \
-                                     const int16_t *chrFilter,          \
-                                     const int16_t **chrUSrc,           \
-                                     const int16_t **chrVSrc,           \
-                                     int chrFilterSize,                 \
-                                     const int16_t **alpSrc,            \
-                                     uint8_t *dest, int dstW, int dstY) \
-{                                                                       \
-    yuv2packedX_altivec(c, lumFilter, lumSrc, lumFilterSize,            \
-                        chrFilter, chrUSrc, chrVSrc,                    \
-                        chrFilterSize, alpSrc,                          \
-                        dest, dstW, dstY, pixfmt);                      \
-}
-
-YUV2PACKEDX_WRAPPER(abgr,  AV_PIX_FMT_ABGR);
-YUV2PACKEDX_WRAPPER(bgra,  AV_PIX_FMT_BGRA);
-YUV2PACKEDX_WRAPPER(argb,  AV_PIX_FMT_ARGB);
-YUV2PACKEDX_WRAPPER(rgba,  AV_PIX_FMT_RGBA);
-YUV2PACKEDX_WRAPPER(rgb24, AV_PIX_FMT_RGB24);
-YUV2PACKEDX_WRAPPER(bgr24, AV_PIX_FMT_BGR24);
-
-#endif /* HAVE_ALTIVEC */
diff --git a/deps/libav/libswscale/ppc/yuv2rgb_altivec.h b/deps/libav/libswscale/ppc/yuv2rgb_altivec.h
deleted file mode 100644
index 2c5e7ed..0000000
--- a/deps/libav/libswscale/ppc/yuv2rgb_altivec.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * AltiVec-enhanced yuv2yuvX
- *
- * Copyright (C) 2004 Romain Dolbeau <romain at dolbeau.org>
- * based on the equivalent C code in swscale.c
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWSCALE_PPC_YUV2RGB_ALTIVEC_H
-#define SWSCALE_PPC_YUV2RGB_ALTIVEC_H
-
-#include <stdint.h>
-
-#include "libswscale/swscale_internal.h"
-
-#define YUV2PACKEDX_HEADER(suffix)                                  \
-    void ff_yuv2 ## suffix ## _X_altivec(SwsContext *c,             \
-                                         const int16_t *lumFilter,  \
-                                         const int16_t **lumSrc,    \
-                                         int lumFilterSize,         \
-                                         const int16_t *chrFilter,  \
-                                         const int16_t **chrUSrc,   \
-                                         const int16_t **chrVSrc,   \
-                                         int chrFilterSize,         \
-                                         const int16_t **alpSrc,    \
-                                         uint8_t *dest,             \
-                                         int dstW, int dstY);
-
-YUV2PACKEDX_HEADER(abgr);
-YUV2PACKEDX_HEADER(bgra);
-YUV2PACKEDX_HEADER(argb);
-YUV2PACKEDX_HEADER(rgba);
-YUV2PACKEDX_HEADER(rgb24);
-YUV2PACKEDX_HEADER(bgr24);
-
-#endif /* SWSCALE_PPC_YUV2RGB_ALTIVEC_H */
diff --git a/deps/libav/libswscale/ppc/yuv2yuv_altivec.c b/deps/libav/libswscale/ppc/yuv2yuv_altivec.c
deleted file mode 100644
index 08545b3..0000000
--- a/deps/libav/libswscale/ppc/yuv2yuv_altivec.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * AltiVec-enhanced yuv-to-yuv conversion routines.
- *
- * Copyright (C) 2004 Romain Dolbeau <romain at dolbeau.org>
- * based on the equivalent C code in swscale.c
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libswscale/swscale.h"
-#include "libswscale/swscale_internal.h"
-
-#if HAVE_ALTIVEC
-
-static int yv12toyuy2_unscaled_altivec(SwsContext *c, const uint8_t *src[],
-                                       int srcStride[], int srcSliceY,
-                                       int srcSliceH, uint8_t *dstParam[],
-                                       int dstStride_a[])
-{
-    uint8_t *dst = dstParam[0] + dstStride_a[0] * srcSliceY;
-    // yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH,
-    //            srcStride[0], srcStride[1], dstStride[0]);
-    const uint8_t *ysrc   = src[0];
-    const uint8_t *usrc   = src[1];
-    const uint8_t *vsrc   = src[2];
-    const int width       = c->srcW;
-    const int height      = srcSliceH;
-    const int lumStride   = srcStride[0];
-    const int chromStride = srcStride[1];
-    const int dstStride   = dstStride_a[0];
-    const vector unsigned char yperm = vec_lvsl(0, ysrc);
-    const int vertLumPerChroma       = 2;
-    register unsigned int y;
-
-    /* This code assumes:
-     *
-     * 1) dst is 16 bytes-aligned
-     * 2) dstStride is a multiple of 16
-     * 3) width is a multiple of 16
-     * 4) lum & chrom stride are multiples of 8
-     */
-
-    for (y = 0; y < height; y++) {
-        int i;
-        for (i = 0; i < width - 31; i += 32) {
-            const unsigned int j          = i >> 1;
-            vector unsigned char v_yA     = vec_ld(i, ysrc);
-            vector unsigned char v_yB     = vec_ld(i + 16, ysrc);
-            vector unsigned char v_yC     = vec_ld(i + 32, ysrc);
-            vector unsigned char v_y1     = vec_perm(v_yA, v_yB, yperm);
-            vector unsigned char v_y2     = vec_perm(v_yB, v_yC, yperm);
-            vector unsigned char v_uA     = vec_ld(j, usrc);
-            vector unsigned char v_uB     = vec_ld(j + 16, usrc);
-            vector unsigned char v_u      = vec_perm(v_uA, v_uB, vec_lvsl(j, usrc));
-            vector unsigned char v_vA     = vec_ld(j, vsrc);
-            vector unsigned char v_vB     = vec_ld(j + 16, vsrc);
-            vector unsigned char v_v      = vec_perm(v_vA, v_vB, vec_lvsl(j, vsrc));
-            vector unsigned char v_uv_a   = vec_mergeh(v_u, v_v);
-            vector unsigned char v_uv_b   = vec_mergel(v_u, v_v);
-            vector unsigned char v_yuy2_0 = vec_mergeh(v_y1, v_uv_a);
-            vector unsigned char v_yuy2_1 = vec_mergel(v_y1, v_uv_a);
-            vector unsigned char v_yuy2_2 = vec_mergeh(v_y2, v_uv_b);
-            vector unsigned char v_yuy2_3 = vec_mergel(v_y2, v_uv_b);
-            vec_st(v_yuy2_0, (i << 1), dst);
-            vec_st(v_yuy2_1, (i << 1) + 16, dst);
-            vec_st(v_yuy2_2, (i << 1) + 32, dst);
-            vec_st(v_yuy2_3, (i << 1) + 48, dst);
-        }
-        if (i < width) {
-            const unsigned int j          = i >> 1;
-            vector unsigned char v_y1     = vec_ld(i, ysrc);
-            vector unsigned char v_u      = vec_ld(j, usrc);
-            vector unsigned char v_v      = vec_ld(j, vsrc);
-            vector unsigned char v_uv_a   = vec_mergeh(v_u, v_v);
-            vector unsigned char v_yuy2_0 = vec_mergeh(v_y1, v_uv_a);
-            vector unsigned char v_yuy2_1 = vec_mergel(v_y1, v_uv_a);
-            vec_st(v_yuy2_0, (i << 1), dst);
-            vec_st(v_yuy2_1, (i << 1) + 16, dst);
-        }
-        if ((y & (vertLumPerChroma - 1)) == vertLumPerChroma - 1) {
-            usrc += chromStride;
-            vsrc += chromStride;
-        }
-        ysrc += lumStride;
-        dst  += dstStride;
-    }
-
-    return srcSliceH;
-}
-
-static int yv12touyvy_unscaled_altivec(SwsContext *c, const uint8_t *src[],
-                                       int srcStride[], int srcSliceY,
-                                       int srcSliceH, uint8_t *dstParam[],
-                                       int dstStride_a[])
-{
-    uint8_t *dst = dstParam[0] + dstStride_a[0] * srcSliceY;
-    // yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH,
-    //            srcStride[0], srcStride[1], dstStride[0]);
-    const uint8_t *ysrc              = src[0];
-    const uint8_t *usrc              = src[1];
-    const uint8_t *vsrc              = src[2];
-    const int width                  = c->srcW;
-    const int height                 = srcSliceH;
-    const int lumStride              = srcStride[0];
-    const int chromStride            = srcStride[1];
-    const int dstStride              = dstStride_a[0];
-    const int vertLumPerChroma       = 2;
-    const vector unsigned char yperm = vec_lvsl(0, ysrc);
-    register unsigned int y;
-
-    /* This code assumes:
-     *
-     * 1) dst is 16 bytes-aligned
-     * 2) dstStride is a multiple of 16
-     * 3) width is a multiple of 16
-     * 4) lum & chrom stride are multiples of 8
-     */
-
-    for (y = 0; y < height; y++) {
-        int i;
-        for (i = 0; i < width - 31; i += 32) {
-            const unsigned int j          = i >> 1;
-            vector unsigned char v_yA     = vec_ld(i, ysrc);
-            vector unsigned char v_yB     = vec_ld(i + 16, ysrc);
-            vector unsigned char v_yC     = vec_ld(i + 32, ysrc);
-            vector unsigned char v_y1     = vec_perm(v_yA, v_yB, yperm);
-            vector unsigned char v_y2     = vec_perm(v_yB, v_yC, yperm);
-            vector unsigned char v_uA     = vec_ld(j, usrc);
-            vector unsigned char v_uB     = vec_ld(j + 16, usrc);
-            vector unsigned char v_u      = vec_perm(v_uA, v_uB, vec_lvsl(j, usrc));
-            vector unsigned char v_vA     = vec_ld(j, vsrc);
-            vector unsigned char v_vB     = vec_ld(j + 16, vsrc);
-            vector unsigned char v_v      = vec_perm(v_vA, v_vB, vec_lvsl(j, vsrc));
-            vector unsigned char v_uv_a   = vec_mergeh(v_u, v_v);
-            vector unsigned char v_uv_b   = vec_mergel(v_u, v_v);
-            vector unsigned char v_uyvy_0 = vec_mergeh(v_uv_a, v_y1);
-            vector unsigned char v_uyvy_1 = vec_mergel(v_uv_a, v_y1);
-            vector unsigned char v_uyvy_2 = vec_mergeh(v_uv_b, v_y2);
-            vector unsigned char v_uyvy_3 = vec_mergel(v_uv_b, v_y2);
-            vec_st(v_uyvy_0, (i << 1), dst);
-            vec_st(v_uyvy_1, (i << 1) + 16, dst);
-            vec_st(v_uyvy_2, (i << 1) + 32, dst);
-            vec_st(v_uyvy_3, (i << 1) + 48, dst);
-        }
-        if (i < width) {
-            const unsigned int j          = i >> 1;
-            vector unsigned char v_y1     = vec_ld(i, ysrc);
-            vector unsigned char v_u      = vec_ld(j, usrc);
-            vector unsigned char v_v      = vec_ld(j, vsrc);
-            vector unsigned char v_uv_a   = vec_mergeh(v_u, v_v);
-            vector unsigned char v_uyvy_0 = vec_mergeh(v_uv_a, v_y1);
-            vector unsigned char v_uyvy_1 = vec_mergel(v_uv_a, v_y1);
-            vec_st(v_uyvy_0, (i << 1), dst);
-            vec_st(v_uyvy_1, (i << 1) + 16, dst);
-        }
-        if ((y & (vertLumPerChroma - 1)) == vertLumPerChroma - 1) {
-            usrc += chromStride;
-            vsrc += chromStride;
-        }
-        ysrc += lumStride;
-        dst  += dstStride;
-    }
-    return srcSliceH;
-}
-
-#endif /* HAVE_ALTIVEC */
-
-av_cold void ff_get_unscaled_swscale_ppc(SwsContext *c)
-{
-#if HAVE_ALTIVEC
-    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
-        return;
-
-    if (!(c->srcW & 15) && !(c->flags & SWS_BITEXACT) &&
-        c->srcFormat == AV_PIX_FMT_YUV420P) {
-        enum AVPixelFormat dstFormat = c->dstFormat;
-
-        // unscaled YV12 -> packed YUV, we want speed
-        if (dstFormat == AV_PIX_FMT_YUYV422)
-            c->swscale = yv12toyuy2_unscaled_altivec;
-        else if (dstFormat == AV_PIX_FMT_UYVY422)
-            c->swscale = yv12touyvy_unscaled_altivec;
-    }
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/deps/libav/libswscale/rgb2rgb.c b/deps/libav/libswscale/rgb2rgb.c
deleted file mode 100644
index 3fb3921..0000000
--- a/deps/libav/libswscale/rgb2rgb.c
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * software RGB to RGB converter
- * pluralize by software PAL8 to RGB converter
- *              software YUV to YUV converter
- *              software YUV to RGB converter
- * Written by Nick Kurshev.
- * palette & YUV & runtime CPU stuff by Michael (michaelni at gmx.at)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-
-#include "libavutil/attributes.h"
-#include "libavutil/bswap.h"
-#include "config.h"
-#include "rgb2rgb.h"
-#include "swscale.h"
-#include "swscale_internal.h"
-
-void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
-
-void (*rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size);
-
-void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size);
-
-void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc,
-                   const uint8_t *vsrc, uint8_t *dst,
-                   int width, int height,
-                   int lumStride, int chromStride, int dstStride);
-void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc,
-                   const uint8_t *vsrc, uint8_t *dst,
-                   int width, int height,
-                   int lumStride, int chromStride, int dstStride);
-void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc,
-                      const uint8_t *vsrc, uint8_t *dst,
-                      int width, int height,
-                      int lumStride, int chromStride, int dstStride);
-void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc,
-                      const uint8_t *vsrc, uint8_t *dst,
-                      int width, int height,
-                      int lumStride, int chromStride, int dstStride);
-void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst,
-                   uint8_t *udst, uint8_t *vdst,
-                   int width, int height,
-                   int lumStride, int chromStride, int srcStride);
-void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst,
-                    uint8_t *udst, uint8_t *vdst,
-                    int width, int height,
-                    int lumStride, int chromStride, int srcStride);
-void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height,
-                 int srcStride, int dstStride);
-void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
-                        int width, int height, int src1Stride,
-                        int src2Stride, int dstStride);
-void (*deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
-                          int width, int height, int srcStride,
-                          int dst1Stride, int dst2Stride);
-void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
-                    uint8_t *dst1, uint8_t *dst2,
-                    int width, int height,
-                    int srcStride1, int srcStride2,
-                    int dstStride1, int dstStride2);
-void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2,
-                     const uint8_t *src3, uint8_t *dst,
-                     int width, int height,
-                     int srcStride1, int srcStride2,
-                     int srcStride3, int dstStride);
-void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                     const uint8_t *src, int width, int height,
-                     int lumStride, int chromStride, int srcStride);
-void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                     const uint8_t *src, int width, int height,
-                     int lumStride, int chromStride, int srcStride);
-void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                     const uint8_t *src, int width, int height,
-                     int lumStride, int chromStride, int srcStride);
-void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                     const uint8_t *src, int width, int height,
-                     int lumStride, int chromStride, int srcStride);
-
-#define RGB2YUV_SHIFT 8
-#define BY ((int)( 0.098 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define BV ((int)(-0.071 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define BU ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define GY ((int)( 0.504 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define GV ((int)(-0.368 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define GU ((int)(-0.291 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define RY ((int)( 0.257 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define RV ((int)( 0.439 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define RU ((int)(-0.148 * (1 << RGB2YUV_SHIFT) + 0.5))
-
-//plain C versions
-#include "rgb2rgb_template.c"
-
-/*
- * RGB15->RGB16 original by Strepto/Astral
- * ported to gcc & bugfixed : A'rpi
- * MMXEXT, 3DNOW optimization by Nick Kurshev
- * 32-bit C version, and and&add trick by Michael Niedermayer
- */
-
-av_cold void sws_rgb2rgb_init(void)
-{
-    rgb2rgb_init_c();
-    if (ARCH_X86)
-        rgb2rgb_init_x86();
-}
-
-void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    int i, num_pixels = src_size >> 2;
-
-    for (i = 0; i < num_pixels; i++) {
-#if HAVE_BIGENDIAN
-        /* RGB32 (= A,B,G,R) -> BGR24 (= B,G,R) */
-        dst[3 * i + 0] = src[4 * i + 1];
-        dst[3 * i + 1] = src[4 * i + 2];
-        dst[3 * i + 2] = src[4 * i + 3];
-#else
-        dst[3 * i + 0] = src[4 * i + 2];
-        dst[3 * i + 1] = src[4 * i + 1];
-        dst[3 * i + 2] = src[4 * i + 0];
-#endif
-    }
-}
-
-void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    int i;
-
-    for (i = 0; 3 * i < src_size; i++) {
-#if HAVE_BIGENDIAN
-        /* RGB24 (= R, G, B) -> BGR32 (= A, R, G, B) */
-        dst[4 * i + 0] = 255;
-        dst[4 * i + 1] = src[3 * i + 0];
-        dst[4 * i + 2] = src[3 * i + 1];
-        dst[4 * i + 3] = src[3 * i + 2];
-#else
-        dst[4 * i + 0] = src[3 * i + 2];
-        dst[4 * i + 1] = src[3 * i + 1];
-        dst[4 * i + 2] = src[3 * i + 0];
-        dst[4 * i + 3] = 255;
-#endif
-    }
-}
-
-void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint8_t *d          = dst;
-    const uint16_t *s   = (const uint16_t *)src;
-    const uint16_t *end = s + src_size / 2;
-
-    while (s < end) {
-        register uint16_t bgr = *s++;
-#if HAVE_BIGENDIAN
-        *d++ = 255;
-        *d++ = (bgr & 0x1F)   << 3;
-        *d++ = (bgr & 0x7E0)  >> 3;
-        *d++ = (bgr & 0xF800) >> 8;
-#else
-        *d++ = (bgr & 0xF800) >> 8;
-        *d++ = (bgr & 0x7E0)  >> 3;
-        *d++ = (bgr & 0x1F)   << 3;
-        *d++ = 255;
-#endif
-    }
-}
-
-void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint16_t rgb, r, g, b;
-    uint16_t *d         = (uint16_t *)dst;
-    const uint16_t *s   = (const uint16_t *)src;
-    const uint16_t *end = s + src_size / 2;
-
-    while (s < end) {
-        rgb  = *s++;
-        r    = rgb & 0xF00;
-        g    = rgb & 0x0F0;
-        b    = rgb & 0x00F;
-        r    = (r << 3) | ((r & 0x800) >> 1);
-        g    = (g << 2) | ((g & 0x080) >> 2);
-        b    = (b << 1) | ( b          >> 3);
-        *d++ = r | g | b;
-    }
-}
-
-void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint8_t *d          = dst;
-    const uint16_t *s   = (const uint16_t *)src;
-    const uint16_t *end = s + src_size / 2;
-
-    while (s < end) {
-        register uint16_t bgr = *s++;
-        *d++ = (bgr & 0xF800) >> 8;
-        *d++ = (bgr & 0x7E0)  >> 3;
-        *d++ = (bgr & 0x1F)   << 3;
-    }
-}
-
-void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    int i, num_pixels = src_size >> 1;
-
-    for (i = 0; i < num_pixels; i++) {
-        unsigned rgb         = ((const uint16_t *)src)[i];
-        ((uint16_t *)dst)[i] = (rgb >> 11) | (rgb & 0x7E0) | (rgb << 11);
-    }
-}
-
-void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    int i, num_pixels = src_size >> 1;
-
-    for (i = 0; i < num_pixels; i++) {
-        unsigned rgb         = ((const uint16_t *)src)[i];
-        ((uint16_t *)dst)[i] = (rgb >> 11) | ((rgb & 0x7C0) >> 1) | ((rgb & 0x1F) << 10);
-    }
-}
-
-void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint8_t *d          = dst;
-    const uint16_t *s   = (const uint16_t *)src;
-    const uint16_t *end = s + src_size / 2;
-
-    while (s < end) {
-        register uint16_t bgr = *s++;
-#if HAVE_BIGENDIAN
-        *d++ = 255;
-        *d++ = (bgr & 0x1F)   << 3;
-        *d++ = (bgr & 0x3E0)  >> 2;
-        *d++ = (bgr & 0x7C00) >> 7;
-#else
-        *d++ = (bgr & 0x7C00) >> 7;
-        *d++ = (bgr & 0x3E0)  >> 2;
-        *d++ = (bgr & 0x1F)   << 3;
-        *d++ = 255;
-#endif
-    }
-}
-
-void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint8_t *d          = dst;
-    const uint16_t *s   = (const uint16_t *)src;
-    const uint16_t *end = s + src_size / 2;
-
-    while (s < end) {
-        register uint16_t bgr = *s++;
-        *d++ = (bgr & 0x7C00) >> 7;
-        *d++ = (bgr & 0x3E0)  >> 2;
-        *d++ = (bgr & 0x1F)   << 3;
-    }
-}
-
-void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    int i, num_pixels = src_size >> 1;
-
-    for (i = 0; i < num_pixels; i++) {
-        unsigned rgb         = ((const uint16_t *)src)[i];
-        ((uint16_t *)dst)[i] = ((rgb & 0x7C00) >> 10) | ((rgb & 0x3E0) << 1) | (rgb << 11);
-    }
-}
-
-void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    int i, num_pixels = src_size >> 1;
-
-    for (i = 0; i < num_pixels; i++) {
-        unsigned rgb         = ((const uint16_t *)src)[i];
-        unsigned br          = rgb & 0x7C1F;
-        ((uint16_t *)dst)[i] = (br >> 10) | (rgb & 0x3E0) | (br << 10);
-    }
-}
-
-void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint16_t *d = (uint16_t *)dst;
-    uint16_t *s = (uint16_t *)src;
-    int i, num_pixels = src_size >> 1;
-
-    for (i = 0; i < num_pixels; i++) {
-        unsigned rgb = s[i];
-        d[i]         = (rgb << 8 | rgb & 0xF0 | rgb >> 8) & 0xFFF;
-    }
-}
-
-void bgr8torgb8(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    int i, num_pixels = src_size;
-
-    for (i = 0; i < num_pixels; i++) {
-        register uint8_t rgb = src[i];
-        unsigned r           = (rgb & 0x07);
-        unsigned g           = (rgb & 0x38) >> 3;
-        unsigned b           = (rgb & 0xC0) >> 6;
-        dst[i]               = ((b << 1) & 0x07) | ((g & 0x07) << 3) | ((r & 0x03) << 6);
-    }
-}
-
-#define DEFINE_SHUFFLE_BYTES(a, b, c, d)                                \
-void shuffle_bytes_ ## a ## b ## c ## d(const uint8_t *src,             \
-                                        uint8_t *dst, int src_size)     \
-{                                                                       \
-    int i;                                                              \
-                                                                        \
-    for (i = 0; i < src_size; i += 4) {                                 \
-        dst[i + 0] = src[i + a];                                        \
-        dst[i + 1] = src[i + b];                                        \
-        dst[i + 2] = src[i + c];                                        \
-        dst[i + 3] = src[i + d];                                        \
-    }                                                                   \
-}
-
-DEFINE_SHUFFLE_BYTES(0, 3, 2, 1)
-DEFINE_SHUFFLE_BYTES(1, 2, 3, 0)
-DEFINE_SHUFFLE_BYTES(3, 0, 1, 2)
-DEFINE_SHUFFLE_BYTES(3, 2, 1, 0)
diff --git a/deps/libav/libswscale/rgb2rgb.h b/deps/libav/libswscale/rgb2rgb.h
deleted file mode 100644
index f47b04e..0000000
--- a/deps/libav/libswscale/rgb2rgb.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *  software RGB to RGB converter
- *  pluralize by Software PAL8 to RGB converter
- *               Software YUV to YUV converter
- *               Software YUV to RGB converter
- *  Written by Nick Kurshev.
- *  YUV & runtime CPU stuff by Michael (michaelni at gmx.at)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWSCALE_RGB2RGB_H
-#define SWSCALE_RGB2RGB_H
-
-#include <inttypes.h>
-
-#include "libavutil/avutil.h"
-#include "swscale.h"
-
-/* A full collection of RGB to RGB(BGR) converters */
-extern void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void    (*rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void    (*rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void    (*rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void    (*rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void    (*rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void    (*rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void    (*rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void    (*rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
-extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size);
-
-extern void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size);
-
-void    rgb24to32(const uint8_t *src, uint8_t *dst, int src_size);
-void    rgb32to24(const uint8_t *src, uint8_t *dst, int src_size);
-void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size);
-void    rgb16to24(const uint8_t *src, uint8_t *dst, int src_size);
-void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size);
-void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size);
-void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size);
-void    rgb15to24(const uint8_t *src, uint8_t *dst, int src_size);
-void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size);
-void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size);
-void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size);
-void    rgb12to15(const uint8_t *src, uint8_t *dst, int src_size);
-void   bgr8torgb8(const uint8_t *src, uint8_t *dst, int src_size);
-
-void shuffle_bytes_0321(const uint8_t *src, uint8_t *dst, int src_size);
-void shuffle_bytes_1230(const uint8_t *src, uint8_t *dst, int src_size);
-void shuffle_bytes_3012(const uint8_t *src, uint8_t *dst, int src_size);
-void shuffle_bytes_3210(const uint8_t *src, uint8_t *dst, int src_size);
-
-void rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
-                   uint8_t *vdst, int width, int height, int lumStride,
-                   int chromStride, int srcStride);
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- */
-extern void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                          int width, int height,
-                          int lumStride, int chromStride, int dstStride);
-
-/**
- * Width should be a multiple of 16.
- */
-extern void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                             int width, int height,
-                             int lumStride, int chromStride, int dstStride);
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- */
-extern void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                          int width, int height,
-                          int lumStride, int chromStride, int srcStride);
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- */
-extern void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                          int width, int height,
-                          int lumStride, int chromStride, int dstStride);
-
-/**
- * Width should be a multiple of 16.
- */
-extern void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                             int width, int height,
-                             int lumStride, int chromStride, int dstStride);
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 2.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- * Chrominance data is only taken from every second line, others are ignored.
- * FIXME: Write high quality version.
- */
-extern void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                           int width, int height,
-                           int lumStride, int chromStride, int srcStride);
-extern void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height,
-                        int srcStride, int dstStride);
-
-extern void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
-                               int width, int height, int src1Stride,
-                               int src2Stride, int dstStride);
-
-extern void (*deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
-                                 int width, int height, int srcStride,
-                                 int dst1Stride, int dst2Stride);
-
-extern void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
-                           uint8_t *dst1, uint8_t *dst2,
-                           int width, int height,
-                           int srcStride1, int srcStride2,
-                           int dstStride1, int dstStride2);
-
-extern void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
-                            uint8_t *dst,
-                            int width, int height,
-                            int srcStride1, int srcStride2,
-                            int srcStride3, int dstStride);
-
-extern void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
-                            int width, int height,
-                            int lumStride, int chromStride, int srcStride);
-extern void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
-                            int width, int height,
-                            int lumStride, int chromStride, int srcStride);
-extern void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
-                            int width, int height,
-                            int lumStride, int chromStride, int srcStride);
-extern void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
-                            int width, int height,
-                            int lumStride, int chromStride, int srcStride);
-
-void sws_rgb2rgb_init(void);
-
-void rgb2rgb_init_x86(void);
-
-#endif /* SWSCALE_RGB2RGB_H */
diff --git a/deps/libav/libswscale/rgb2rgb_template.c b/deps/libav/libswscale/rgb2rgb_template.c
deleted file mode 100644
index 65ea5dd..0000000
--- a/deps/libav/libswscale/rgb2rgb_template.c
+++ /dev/null
@@ -1,966 +0,0 @@
-/*
- * software RGB to RGB converter
- * pluralize by software PAL8 to RGB converter
- *              software YUV to YUV converter
- *              software YUV to RGB converter
- * Written by Nick Kurshev.
- * palette & YUV & runtime CPU stuff by Michael (michaelni at gmx.at)
- * lot of big-endian byte order fixes by Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-
-#include "libavutil/attributes.h"
-
-static inline void rgb24tobgr32_c(const uint8_t *src, uint8_t *dst,
-                                  int src_size)
-{
-    uint8_t *dest      = dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-#if HAVE_BIGENDIAN
-        /* RGB24 (= R, G, B) -> RGB32 (= A, B, G, R) */
-        *dest++  = 255;
-        *dest++  = s[2];
-        *dest++  = s[1];
-        *dest++  = s[0];
-        s       += 3;
-#else
-        *dest++  = *s++;
-        *dest++  = *s++;
-        *dest++  = *s++;
-        *dest++  = 255;
-#endif
-    }
-}
-
-static inline void rgb32tobgr24_c(const uint8_t *src, uint8_t *dst,
-                                  int src_size)
-{
-    uint8_t *dest      = dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-#if HAVE_BIGENDIAN
-        /* RGB32 (= A, B, G, R) -> RGB24 (= R, G, B) */
-        s++;
-        dest[2]  = *s++;
-        dest[1]  = *s++;
-        dest[0]  = *s++;
-        dest    += 3;
-#else
-        *dest++  = *s++;
-        *dest++  = *s++;
-        *dest++  = *s++;
-        s++;
-#endif
-    }
-}
-
-/*
- * original by Strepto/Astral
- * ported to gcc & bugfixed: A'rpi
- * MMXEXT, 3DNOW optimization by Nick Kurshev
- * 32-bit C version, and and&add trick by Michael Niedermayer
- */
-static inline void rgb15to16_c(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    register uint8_t *d         = dst;
-    register const uint8_t *s   = src;
-    register const uint8_t *end = s + src_size;
-    const uint8_t *mm_end       = end - 3;
-
-    while (s < mm_end) {
-        register unsigned x = *((const uint32_t *)s);
-        *((uint32_t *)d)    = (x & 0x7FFF7FFF) + (x & 0x7FE07FE0);
-        d += 4;
-        s += 4;
-    }
-    if (s < end) {
-        register unsigned short x = *((const uint16_t *)s);
-        *((uint16_t *)d)          = (x & 0x7FFF) + (x & 0x7FE0);
-    }
-}
-
-static inline void rgb16to15_c(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    register uint8_t *d         = dst;
-    register const uint8_t *s   = src;
-    register const uint8_t *end = s + src_size;
-    const uint8_t *mm_end       = end - 3;
-
-    while (s < mm_end) {
-        register uint32_t x  = *((const uint32_t *)s);
-        *((uint32_t *)d)     = ((x >> 1) & 0x7FE07FE0) | (x & 0x001F001F);
-        s                   += 4;
-        d                   += 4;
-    }
-    if (s < end) {
-        register uint16_t x = *((const uint16_t *)s);
-        *((uint16_t *)d)    = ((x >> 1) & 0x7FE0) | (x & 0x001F);
-    }
-}
-
-static inline void rgb32to16_c(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint16_t *d        = (uint16_t *)dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-        register int rgb  = *(const uint32_t *)s;
-        s                += 4;
-        *d++              = ((rgb & 0xFF)     >> 3) +
-                            ((rgb & 0xFC00)   >> 5) +
-                            ((rgb & 0xF80000) >> 8);
-    }
-}
-
-static inline void rgb32tobgr16_c(const uint8_t *src, uint8_t *dst,
-                                  int src_size)
-{
-    uint16_t *d        = (uint16_t *)dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-        register int rgb  = *(const uint32_t *)s;
-        s                += 4;
-        *d++              = ((rgb & 0xF8)     << 8) +
-                            ((rgb & 0xFC00)   >> 5) +
-                            ((rgb & 0xF80000) >> 19);
-    }
-}
-
-static inline void rgb32to15_c(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint16_t *d        = (uint16_t *)dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-        register int rgb  = *(const uint32_t *)s;
-        s                += 4;
-        *d++              = ((rgb & 0xFF)     >> 3) +
-                            ((rgb & 0xF800)   >> 6) +
-                            ((rgb & 0xF80000) >> 9);
-    }
-}
-
-static inline void rgb32tobgr15_c(const uint8_t *src, uint8_t *dst,
-                                  int src_size)
-{
-    uint16_t *d        = (uint16_t *)dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-        register int rgb  = *(const uint32_t *)s;
-        s                += 4;
-        *d++              = ((rgb & 0xF8)     <<  7) +
-                            ((rgb & 0xF800)   >>  6) +
-                            ((rgb & 0xF80000) >> 19);
-    }
-}
-
-static inline void rgb24tobgr16_c(const uint8_t *src, uint8_t *dst,
-                                  int src_size)
-{
-    uint16_t *d        = (uint16_t *)dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-        const int b = *s++;
-        const int g = *s++;
-        const int r = *s++;
-        *d++        = (b >> 3) | ((g & 0xFC) << 3) | ((r & 0xF8) << 8);
-    }
-}
-
-static inline void rgb24to16_c(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint16_t *d        = (uint16_t *)dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-        const int r = *s++;
-        const int g = *s++;
-        const int b = *s++;
-        *d++        = (b >> 3) | ((g & 0xFC) << 3) | ((r & 0xF8) << 8);
-    }
-}
-
-static inline void rgb24tobgr15_c(const uint8_t *src, uint8_t *dst,
-                                  int src_size)
-{
-    uint16_t *d        = (uint16_t *)dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-        const int b = *s++;
-        const int g = *s++;
-        const int r = *s++;
-        *d++        = (b >> 3) | ((g & 0xF8) << 2) | ((r & 0xF8) << 7);
-    }
-}
-
-static inline void rgb24to15_c(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint16_t *d        = (uint16_t *)dst;
-    const uint8_t *s   = src;
-    const uint8_t *end = s + src_size;
-
-    while (s < end) {
-        const int r = *s++;
-        const int g = *s++;
-        const int b = *s++;
-        *d++        = (b >> 3) | ((g & 0xF8) << 2) | ((r & 0xF8) << 7);
-    }
-}
-
-/*
- * I use less accurate approximation here by simply left-shifting the input
- * value and filling the low order bits with zeroes. This method improves PNG
- * compression but this scheme cannot reproduce white exactly, since it does
- * not generate an all-ones maximum value; the net effect is to darken the
- * image slightly.
- *
- * The better method should be "left bit replication":
- *
- *  4 3 2 1 0
- *  ---------
- *  1 1 0 1 1
- *
- *  7 6 5 4 3  2 1 0
- *  ----------------
- *  1 1 0 1 1  1 1 0
- *  |=======|  |===|
- *      |      leftmost bits repeated to fill open bits
- *      |
- *  original bits
- */
-static inline void rgb15tobgr24_c(const uint8_t *src, uint8_t *dst,
-                                  int src_size)
-{
-    uint8_t *d          = dst;
-    const uint16_t *s   = (const uint16_t *)src;
-    const uint16_t *end = s + src_size / 2;
-
-    while (s < end) {
-        register uint16_t bgr = *s++;
-        *d++ = (bgr & 0x1F)   << 3;
-        *d++ = (bgr & 0x3E0)  >> 2;
-        *d++ = (bgr & 0x7C00) >> 7;
-    }
-}
-
-static inline void rgb16tobgr24_c(const uint8_t *src, uint8_t *dst,
-                                  int src_size)
-{
-    uint8_t *d          = (uint8_t *)dst;
-    const uint16_t *s   = (const uint16_t *)src;
-    const uint16_t *end = s + src_size / 2;
-
-    while (s < end) {
-        register uint16_t bgr = *s++;
-        *d++ = (bgr & 0x1F)   << 3;
-        *d++ = (bgr & 0x7E0)  >> 3;
-        *d++ = (bgr & 0xF800) >> 8;
-    }
-}
-
-static inline void rgb15to32_c(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint8_t *d          = dst;
-    const uint16_t *s   = (const uint16_t *)src;
-    const uint16_t *end = s + src_size / 2;
-
-    while (s < end) {
-        register uint16_t bgr = *s++;
-#if HAVE_BIGENDIAN
-        *d++ = 255;
-        *d++ = (bgr & 0x7C00) >> 7;
-        *d++ = (bgr & 0x3E0)  >> 2;
-        *d++ = (bgr & 0x1F)   << 3;
-#else
-        *d++ = (bgr & 0x1F)   << 3;
-        *d++ = (bgr & 0x3E0)  >> 2;
-        *d++ = (bgr & 0x7C00) >> 7;
-        *d++ = 255;
-#endif
-    }
-}
-
-static inline void rgb16to32_c(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint8_t *d          = dst;
-    const uint16_t *s   = (const uint16_t *)src;
-    const uint16_t *end = s + src_size / 2;
-
-    while (s < end) {
-        register uint16_t bgr = *s++;
-#if HAVE_BIGENDIAN
-        *d++ = 255;
-        *d++ = (bgr & 0xF800) >> 8;
-        *d++ = (bgr & 0x7E0)  >> 3;
-        *d++ = (bgr & 0x1F)   << 3;
-#else
-        *d++ = (bgr & 0x1F)   << 3;
-        *d++ = (bgr & 0x7E0)  >> 3;
-        *d++ = (bgr & 0xF800) >> 8;
-        *d++ = 255;
-#endif
-    }
-}
-
-static inline void shuffle_bytes_2103_c(const uint8_t *src, uint8_t *dst,
-                                        int src_size)
-{
-    int idx          = 15  - src_size;
-    const uint8_t *s = src - idx;
-    uint8_t *d       = dst - idx;
-
-    for (; idx < 15; idx += 4) {
-        register int v        = *(const uint32_t *)&s[idx], g = v & 0xff00ff00;
-        v                    &= 0xff00ff;
-        *(uint32_t *)&d[idx]  = (v >> 16) + g + (v << 16);
-    }
-}
-
-static inline void rgb24tobgr24_c(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    unsigned i;
-
-    for (i = 0; i < src_size; i += 3) {
-        register uint8_t x = src[i + 2];
-        dst[i + 1]         = src[i + 1];
-        dst[i + 2]         = src[i + 0];
-        dst[i + 0]         = x;
-    }
-}
-
-static inline void yuvPlanartoyuy2_c(const uint8_t *ysrc, const uint8_t *usrc,
-                                     const uint8_t *vsrc, uint8_t *dst,
-                                     int width, int height,
-                                     int lumStride, int chromStride,
-                                     int dstStride, int vertLumPerChroma)
-{
-    int y, i;
-    const int chromWidth = width >> 1;
-
-    for (y = 0; y < height; y++) {
-#if HAVE_FAST_64BIT
-        uint64_t *ldst = (uint64_t *)dst;
-        const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
-        for (i = 0; i < chromWidth; i += 2) {
-            uint64_t k = yc[0] + (uc[0] << 8) +
-                         (yc[1] << 16) + (vc[0] << 24);
-            uint64_t l = yc[2] + (uc[1] << 8) +
-                         (yc[3] << 16) + (vc[1] << 24);
-            *ldst++ = k + (l << 32);
-            yc     += 4;
-            uc     += 2;
-            vc     += 2;
-        }
-
-#else
-        int *idst = (int32_t *)dst;
-        const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
-
-        for (i = 0; i < chromWidth; i++) {
-#if HAVE_BIGENDIAN
-            *idst++ = (yc[0] << 24) + (uc[0] << 16) +
-                      (yc[1] <<  8) + (vc[0] <<  0);
-#else
-            *idst++ = yc[0] + (uc[0] << 8) +
-                      (yc[1] << 16) + (vc[0] << 24);
-#endif
-            yc += 2;
-            uc++;
-            vc++;
-        }
-#endif
-        if ((y & (vertLumPerChroma - 1)) == vertLumPerChroma - 1) {
-            usrc += chromStride;
-            vsrc += chromStride;
-        }
-        ysrc += lumStride;
-        dst  += dstStride;
-    }
-}
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- */
-static inline void yv12toyuy2_c(const uint8_t *ysrc, const uint8_t *usrc,
-                                const uint8_t *vsrc, uint8_t *dst,
-                                int width, int height, int lumStride,
-                                int chromStride, int dstStride)
-{
-    //FIXME interpolate chroma
-    yuvPlanartoyuy2_c(ysrc, usrc, vsrc, dst, width, height, lumStride,
-                      chromStride, dstStride, 2);
-}
-
-static inline void yuvPlanartouyvy_c(const uint8_t *ysrc, const uint8_t *usrc,
-                                     const uint8_t *vsrc, uint8_t *dst,
-                                     int width, int height,
-                                     int lumStride, int chromStride,
-                                     int dstStride, int vertLumPerChroma)
-{
-    int y, i;
-    const int chromWidth = width >> 1;
-
-    for (y = 0; y < height; y++) {
-#if HAVE_FAST_64BIT
-        uint64_t *ldst = (uint64_t *)dst;
-        const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
-        for (i = 0; i < chromWidth; i += 2) {
-            uint64_t k = uc[0] + (yc[0] << 8) +
-                         (vc[0] << 16) + (yc[1] << 24);
-            uint64_t l = uc[1] + (yc[2] << 8) +
-                         (vc[1] << 16) + (yc[3] << 24);
-            *ldst++ = k + (l << 32);
-            yc     += 4;
-            uc     += 2;
-            vc     += 2;
-        }
-
-#else
-        int *idst = (int32_t *)dst;
-        const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
-
-        for (i = 0; i < chromWidth; i++) {
-#if HAVE_BIGENDIAN
-            *idst++ = (uc[0] << 24) + (yc[0] << 16) +
-                      (vc[0] <<  8) + (yc[1] <<  0);
-#else
-            *idst++ = uc[0] + (yc[0] << 8) +
-                      (vc[0] << 16) + (yc[1] << 24);
-#endif
-            yc += 2;
-            uc++;
-            vc++;
-        }
-#endif
-        if ((y & (vertLumPerChroma - 1)) == vertLumPerChroma - 1) {
-            usrc += chromStride;
-            vsrc += chromStride;
-        }
-        ysrc += lumStride;
-        dst  += dstStride;
-    }
-}
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16
- * (If this is a problem for anyone then tell me, and I will fix it.)
- */
-static inline void yv12touyvy_c(const uint8_t *ysrc, const uint8_t *usrc,
-                                const uint8_t *vsrc, uint8_t *dst,
-                                int width, int height, int lumStride,
-                                int chromStride, int dstStride)
-{
-    //FIXME interpolate chroma
-    yuvPlanartouyvy_c(ysrc, usrc, vsrc, dst, width, height, lumStride,
-                      chromStride, dstStride, 2);
-}
-
-/**
- * Width should be a multiple of 16.
- */
-static inline void yuv422ptouyvy_c(const uint8_t *ysrc, const uint8_t *usrc,
-                                   const uint8_t *vsrc, uint8_t *dst,
-                                   int width, int height, int lumStride,
-                                   int chromStride, int dstStride)
-{
-    yuvPlanartouyvy_c(ysrc, usrc, vsrc, dst, width, height, lumStride,
-                      chromStride, dstStride, 1);
-}
-
-/**
- * Width should be a multiple of 16.
- */
-static inline void yuv422ptoyuy2_c(const uint8_t *ysrc, const uint8_t *usrc,
-                                   const uint8_t *vsrc, uint8_t *dst,
-                                   int width, int height, int lumStride,
-                                   int chromStride, int dstStride)
-{
-    yuvPlanartoyuy2_c(ysrc, usrc, vsrc, dst, width, height, lumStride,
-                      chromStride, dstStride, 1);
-}
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- */
-static inline void yuy2toyv12_c(const uint8_t *src, uint8_t *ydst,
-                                uint8_t *udst, uint8_t *vdst,
-                                int width, int height, int lumStride,
-                                int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth = width >> 1;
-
-    for (y = 0; y < height; y += 2) {
-        int i;
-        for (i = 0; i < chromWidth; i++) {
-            ydst[2 * i + 0] = src[4 * i + 0];
-            udst[i]         = src[4 * i + 1];
-            ydst[2 * i + 1] = src[4 * i + 2];
-            vdst[i]         = src[4 * i + 3];
-        }
-        ydst += lumStride;
-        src  += srcStride;
-
-        for (i = 0; i < chromWidth; i++) {
-            ydst[2 * i + 0] = src[4 * i + 0];
-            ydst[2 * i + 1] = src[4 * i + 2];
-        }
-        udst += chromStride;
-        vdst += chromStride;
-        ydst += lumStride;
-        src  += srcStride;
-    }
-}
-
-static inline void planar2x_c(const uint8_t *src, uint8_t *dst, int srcWidth,
-                              int srcHeight, int srcStride, int dstStride)
-{
-    int x, y;
-
-    dst[0] = src[0];
-
-    // first line
-    for (x = 0; x < srcWidth - 1; x++) {
-        dst[2 * x + 1] = (3 * src[x] + src[x + 1]) >> 2;
-        dst[2 * x + 2] = (src[x] + 3 * src[x + 1]) >> 2;
-    }
-    dst[2 * srcWidth - 1] = src[srcWidth - 1];
-
-    dst += dstStride;
-
-    for (y = 1; y < srcHeight; y++) {
-        const int mmxSize = 1;
-
-        dst[0]         = (src[0] * 3 + src[srcStride]) >> 2;
-        dst[dstStride] = (src[0] + 3 * src[srcStride]) >> 2;
-
-        for (x = mmxSize - 1; x < srcWidth - 1; x++) {
-            dst[2 * x + 1]             = (src[x + 0] * 3 + src[x + srcStride + 1]) >> 2;
-            dst[2 * x + dstStride + 2] = (src[x + 0] + 3 * src[x + srcStride + 1]) >> 2;
-            dst[2 * x + dstStride + 1] = (src[x + 1] + 3 * src[x + srcStride])     >> 2;
-            dst[2 * x + 2]             = (src[x + 1] * 3 + src[x + srcStride])     >> 2;
-        }
-        dst[srcWidth * 2 - 1]             = (src[srcWidth - 1] * 3 + src[srcWidth - 1 + srcStride]) >> 2;
-        dst[srcWidth * 2 - 1 + dstStride] = (src[srcWidth - 1] + 3 * src[srcWidth - 1 + srcStride]) >> 2;
-
-        dst += dstStride * 2;
-        src += srcStride;
-    }
-
-    // last line
-    dst[0] = src[0];
-
-    for (x = 0; x < srcWidth - 1; x++) {
-        dst[2 * x + 1] = (src[x] * 3 + src[x + 1]) >> 2;
-        dst[2 * x + 2] = (src[x] + 3 * src[x + 1]) >> 2;
-    }
-    dst[2 * srcWidth - 1] = src[srcWidth - 1];
-}
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- * Chrominance data is only taken from every second line, others are ignored.
- * FIXME: Write HQ version.
- */
-static inline void uyvytoyv12_c(const uint8_t *src, uint8_t *ydst,
-                                uint8_t *udst, uint8_t *vdst,
-                                int width, int height, int lumStride,
-                                int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth = width >> 1;
-
-    for (y = 0; y < height; y += 2) {
-        int i;
-        for (i = 0; i < chromWidth; i++) {
-            udst[i]         = src[4 * i + 0];
-            ydst[2 * i + 0] = src[4 * i + 1];
-            vdst[i]         = src[4 * i + 2];
-            ydst[2 * i + 1] = src[4 * i + 3];
-        }
-        ydst += lumStride;
-        src  += srcStride;
-
-        for (i = 0; i < chromWidth; i++) {
-            ydst[2 * i + 0] = src[4 * i + 1];
-            ydst[2 * i + 1] = src[4 * i + 3];
-        }
-        udst += chromStride;
-        vdst += chromStride;
-        ydst += lumStride;
-        src  += srcStride;
-    }
-}
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 2.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- * Chrominance data is only taken from every second line,
- * others are ignored in the C version.
- * FIXME: Write HQ version.
- */
-void rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
-                   uint8_t *vdst, int width, int height, int lumStride,
-                   int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth = width >> 1;
-
-    for (y = 0; y < height; y += 2) {
-        int i;
-        for (i = 0; i < chromWidth; i++) {
-            unsigned int b = src[6 * i + 0];
-            unsigned int g = src[6 * i + 1];
-            unsigned int r = src[6 * i + 2];
-
-            unsigned int Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) +  16;
-            unsigned int V = ((RV * r + GV * g + BV * b) >> RGB2YUV_SHIFT) + 128;
-            unsigned int U = ((RU * r + GU * g + BU * b) >> RGB2YUV_SHIFT) + 128;
-
-            udst[i]     = U;
-            vdst[i]     = V;
-            ydst[2 * i] = Y;
-
-            b = src[6 * i + 3];
-            g = src[6 * i + 4];
-            r = src[6 * i + 5];
-
-            Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;
-            ydst[2 * i + 1] = Y;
-        }
-        ydst += lumStride;
-        src  += srcStride;
-
-        for (i = 0; i < chromWidth; i++) {
-            unsigned int b = src[6 * i + 0];
-            unsigned int g = src[6 * i + 1];
-            unsigned int r = src[6 * i + 2];
-
-            unsigned int Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;
-
-            ydst[2 * i] = Y;
-
-            b = src[6 * i + 3];
-            g = src[6 * i + 4];
-            r = src[6 * i + 5];
-
-            Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;
-            ydst[2 * i + 1] = Y;
-        }
-        udst += chromStride;
-        vdst += chromStride;
-        ydst += lumStride;
-        src  += srcStride;
-    }
-}
-
-static void interleaveBytes_c(const uint8_t *src1, const uint8_t *src2,
-                              uint8_t *dest, int width, int height,
-                              int src1Stride, int src2Stride, int dstStride)
-{
-    int h;
-
-    for (h = 0; h < height; h++) {
-        int w;
-        for (w = 0; w < width; w++) {
-            dest[2 * w + 0] = src1[w];
-            dest[2 * w + 1] = src2[w];
-        }
-        dest += dstStride;
-        src1 += src1Stride;
-        src2 += src2Stride;
-    }
-}
-
-static void deinterleaveBytes_c(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
-                                int width, int height, int srcStride,
-                                int dst1Stride, int dst2Stride)
-{
-    int h;
-
-    for (h = 0; h < height; h++) {
-        int w;
-        for (w = 0; w < width; w++) {
-            dst1[w] = src[2 * w + 0];
-            dst2[w] = src[2 * w + 1];
-        }
-        src  += srcStride;
-        dst1 += dst1Stride;
-        dst2 += dst2Stride;
-    }
-}
-
-static inline void vu9_to_vu12_c(const uint8_t *src1, const uint8_t *src2,
-                                 uint8_t *dst1, uint8_t *dst2,
-                                 int width, int height,
-                                 int srcStride1, int srcStride2,
-                                 int dstStride1, int dstStride2)
-{
-    int x, y;
-    int w = width  / 2;
-    int h = height / 2;
-
-    for (y = 0; y < h; y++) {
-        const uint8_t *s1 = src1 + srcStride1 * (y >> 1);
-        uint8_t *d        = dst1 + dstStride1 *  y;
-        for (x = 0; x < w; x++)
-            d[2 * x] = d[2 * x + 1] = s1[x];
-    }
-    for (y = 0; y < h; y++) {
-        const uint8_t *s2 = src2 + srcStride2 * (y >> 1);
-        uint8_t *d        = dst2 + dstStride2 *  y;
-        for (x = 0; x < w; x++)
-            d[2 * x] = d[2 * x + 1] = s2[x];
-    }
-}
-
-static inline void yvu9_to_yuy2_c(const uint8_t *src1, const uint8_t *src2,
-                                  const uint8_t *src3, uint8_t *dst,
-                                  int width, int height,
-                                  int srcStride1, int srcStride2,
-                                  int srcStride3, int dstStride)
-{
-    int x, y;
-    int w = width / 2;
-    int h = height;
-
-    for (y = 0; y < h; y++) {
-        const uint8_t *yp = src1 + srcStride1 *  y;
-        const uint8_t *up = src2 + srcStride2 * (y >> 2);
-        const uint8_t *vp = src3 + srcStride3 * (y >> 2);
-        uint8_t *d        = dst  + dstStride  *  y;
-        for (x = 0; x < w; x++) {
-            const int x2 = x << 2;
-            d[8 * x + 0] = yp[x2];
-            d[8 * x + 1] = up[x];
-            d[8 * x + 2] = yp[x2 + 1];
-            d[8 * x + 3] = vp[x];
-            d[8 * x + 4] = yp[x2 + 2];
-            d[8 * x + 5] = up[x];
-            d[8 * x + 6] = yp[x2 + 3];
-            d[8 * x + 7] = vp[x];
-        }
-    }
-}
-
-static void extract_even_c(const uint8_t *src, uint8_t *dst, int count)
-{
-    dst   +=  count;
-    src   +=  count * 2;
-    count  = -count;
-    while (count < 0) {
-        dst[count] = src[2 * count];
-        count++;
-    }
-}
-
-static void extract_even2_c(const uint8_t *src, uint8_t *dst0, uint8_t *dst1,
-                            int count)
-{
-    dst0  +=  count;
-    dst1  +=  count;
-    src   +=  count * 4;
-    count  = -count;
-    while (count < 0) {
-        dst0[count] = src[4 * count + 0];
-        dst1[count] = src[4 * count + 2];
-        count++;
-    }
-}
-
-static void extract_even2avg_c(const uint8_t *src0, const uint8_t *src1,
-                               uint8_t *dst0, uint8_t *dst1, int count)
-{
-    dst0  +=  count;
-    dst1  +=  count;
-    src0  +=  count * 4;
-    src1  +=  count * 4;
-    count  = -count;
-    while (count < 0) {
-        dst0[count] = (src0[4 * count + 0] + src1[4 * count + 0]) >> 1;
-        dst1[count] = (src0[4 * count + 2] + src1[4 * count + 2]) >> 1;
-        count++;
-    }
-}
-
-static void extract_odd2_c(const uint8_t *src, uint8_t *dst0, uint8_t *dst1,
-                           int count)
-{
-    dst0  +=  count;
-    dst1  +=  count;
-    src   +=  count * 4;
-    count  = -count;
-    src++;
-    while (count < 0) {
-        dst0[count] = src[4 * count + 0];
-        dst1[count] = src[4 * count + 2];
-        count++;
-    }
-}
-
-static void extract_odd2avg_c(const uint8_t *src0, const uint8_t *src1,
-                              uint8_t *dst0, uint8_t *dst1, int count)
-{
-    dst0  +=  count;
-    dst1  +=  count;
-    src0  +=  count * 4;
-    src1  +=  count * 4;
-    count  = -count;
-    src0++;
-    src1++;
-    while (count < 0) {
-        dst0[count] = (src0[4 * count + 0] + src1[4 * count + 0]) >> 1;
-        dst1[count] = (src0[4 * count + 2] + src1[4 * count + 2]) >> 1;
-        count++;
-    }
-}
-
-static void yuyvtoyuv420_c(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                           const uint8_t *src, int width, int height,
-                           int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth = -((-width) >> 1);
-
-    for (y = 0; y < height; y++) {
-        extract_even_c(src, ydst, width);
-        if (y & 1) {
-            extract_odd2avg_c(src - srcStride, src, udst, vdst, chromWidth);
-            udst += chromStride;
-            vdst += chromStride;
-        }
-
-        src  += srcStride;
-        ydst += lumStride;
-    }
-}
-
-static void yuyvtoyuv422_c(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                           const uint8_t *src, int width, int height,
-                           int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth = -((-width) >> 1);
-
-    for (y = 0; y < height; y++) {
-        extract_even_c(src, ydst, width);
-        extract_odd2_c(src, udst, vdst, chromWidth);
-
-        src  += srcStride;
-        ydst += lumStride;
-        udst += chromStride;
-        vdst += chromStride;
-    }
-}
-
-static void uyvytoyuv420_c(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                           const uint8_t *src, int width, int height,
-                           int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth = -((-width) >> 1);
-
-    for (y = 0; y < height; y++) {
-        extract_even_c(src + 1, ydst, width);
-        if (y & 1) {
-            extract_even2avg_c(src - srcStride, src, udst, vdst, chromWidth);
-            udst += chromStride;
-            vdst += chromStride;
-        }
-
-        src  += srcStride;
-        ydst += lumStride;
-    }
-}
-
-static void uyvytoyuv422_c(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                           const uint8_t *src, int width, int height,
-                           int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth = -((-width) >> 1);
-
-    for (y = 0; y < height; y++) {
-        extract_even_c(src + 1, ydst, width);
-        extract_even2_c(src, udst, vdst, chromWidth);
-
-        src  += srcStride;
-        ydst += lumStride;
-        udst += chromStride;
-        vdst += chromStride;
-    }
-}
-
-static av_cold void rgb2rgb_init_c(void)
-{
-    rgb15to16          = rgb15to16_c;
-    rgb15tobgr24       = rgb15tobgr24_c;
-    rgb15to32          = rgb15to32_c;
-    rgb16tobgr24       = rgb16tobgr24_c;
-    rgb16to32          = rgb16to32_c;
-    rgb16to15          = rgb16to15_c;
-    rgb24tobgr16       = rgb24tobgr16_c;
-    rgb24tobgr15       = rgb24tobgr15_c;
-    rgb24tobgr32       = rgb24tobgr32_c;
-    rgb32to16          = rgb32to16_c;
-    rgb32to15          = rgb32to15_c;
-    rgb32tobgr24       = rgb32tobgr24_c;
-    rgb24to15          = rgb24to15_c;
-    rgb24to16          = rgb24to16_c;
-    rgb24tobgr24       = rgb24tobgr24_c;
-    shuffle_bytes_2103 = shuffle_bytes_2103_c;
-    rgb32tobgr16       = rgb32tobgr16_c;
-    rgb32tobgr15       = rgb32tobgr15_c;
-    yv12toyuy2         = yv12toyuy2_c;
-    yv12touyvy         = yv12touyvy_c;
-    yuv422ptoyuy2      = yuv422ptoyuy2_c;
-    yuv422ptouyvy      = yuv422ptouyvy_c;
-    yuy2toyv12         = yuy2toyv12_c;
-    planar2x           = planar2x_c;
-    rgb24toyv12        = rgb24toyv12_c;
-    interleaveBytes    = interleaveBytes_c;
-    deinterleaveBytes  = deinterleaveBytes_c;
-    vu9_to_vu12        = vu9_to_vu12_c;
-    yvu9_to_yuy2       = yvu9_to_yuy2_c;
-
-    uyvytoyuv420       = uyvytoyuv420_c;
-    uyvytoyuv422       = uyvytoyuv422_c;
-    yuyvtoyuv420       = yuyvtoyuv420_c;
-    yuyvtoyuv422       = yuyvtoyuv422_c;
-}
diff --git a/deps/libav/libswscale/sparc/Makefile b/deps/libav/libswscale/sparc/Makefile
deleted file mode 100644
index 2351ba4..0000000
--- a/deps/libav/libswscale/sparc/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-VIS-OBJS += sparc/yuv2rgb_vis.o                                         \
diff --git a/deps/libav/libswscale/sparc/yuv2rgb_vis.c b/deps/libav/libswscale/sparc/yuv2rgb_vis.c
deleted file mode 100644
index cd8a8b0..0000000
--- a/deps/libav/libswscale/sparc/yuv2rgb_vis.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * VIS optimized software YUV to RGB converter
- * Copyright (c) 2007 Denes Balatoni <dbalatoni at programozo.hu>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-#include <stdlib.h>
-
-#include "libavutil/attributes.h"
-#include "libswscale/swscale.h"
-#include "libswscale/swscale_internal.h"
-
-#define YUV2RGB_INIT                               \
-    "wr %%g0, 0x10, %%gsr \n\t"                    \
-    "ldd [%5],      %%f32 \n\t"                    \
-    "ldd [%5 +  8], %%f34 \n\t"                    \
-    "ldd [%5 + 16], %%f36 \n\t"                    \
-    "ldd [%5 + 24], %%f38 \n\t"                    \
-    "ldd [%5 + 32], %%f40 \n\t"                    \
-    "ldd [%5 + 40], %%f42 \n\t"                    \
-    "ldd [%5 + 48], %%f44 \n\t"                    \
-    "ldd [%5 + 56], %%f46 \n\t"                    \
-    "ldd [%5 + 64], %%f48 \n\t"                    \
-    "ldd [%5 + 72], %%f50 \n\t"
-
-#define YUV2RGB_KERNEL                             \
-    /* ^^^^ f0=Y f3=u f5=v */                      \
-    "fmul8x16 %%f3,  %%f48,  %%f6 \n\t"            \
-    "fmul8x16 %%f19, %%f48, %%f22 \n\t"            \
-    "fmul8x16 %%f5,  %%f44,  %%f8 \n\t"            \
-    "fmul8x16 %%f21, %%f44, %%f24 \n\t"            \
-    "fmul8x16 %%f0,  %%f42,  %%f0 \n\t"            \
-    "fmul8x16 %%f16, %%f42, %%f16 \n\t"            \
-    "fmul8x16 %%f3,  %%f50,  %%f2 \n\t"            \
-    "fmul8x16 %%f19, %%f50, %%f18 \n\t"            \
-    "fmul8x16 %%f5,  %%f46,  %%f4 \n\t"            \
-    "fmul8x16 %%f21, %%f46, %%f20 \n\t"            \
-                                                   \
-    "fpsub16 %%f6,  %%f34,  %%f6 \n\t" /* 1 */     \
-    "fpsub16 %%f22, %%f34, %%f22 \n\t" /* 1 */     \
-    "fpsub16 %%f8,  %%f38,  %%f8 \n\t" /* 3 */     \
-    "fpsub16 %%f24, %%f38, %%f24 \n\t" /* 3 */     \
-    "fpsub16 %%f0,  %%f32,  %%f0 \n\t" /* 0 */     \
-    "fpsub16 %%f16, %%f32, %%f16 \n\t" /* 0 */     \
-    "fpsub16 %%f2,  %%f36,  %%f2 \n\t" /* 2 */     \
-    "fpsub16 %%f18, %%f36, %%f18 \n\t" /* 2 */     \
-    "fpsub16 %%f4,  %%f40,  %%f4 \n\t" /* 4 */     \
-    "fpsub16 %%f20, %%f40, %%f20 \n\t" /* 4 */     \
-                                                   \
-    "fpadd16 %%f0,  %%f8,  %%f8  \n\t" /* Gt */    \
-    "fpadd16 %%f16, %%f24, %%f24 \n\t" /* Gt */    \
-    "fpadd16 %%f0,  %%f4,  %%f4  \n\t" /* R */     \
-    "fpadd16 %%f16, %%f20, %%f20 \n\t" /* R */     \
-    "fpadd16 %%f0,  %%f6,  %%f6  \n\t" /* B */     \
-    "fpadd16 %%f16, %%f22, %%f22 \n\t" /* B */     \
-    "fpadd16 %%f8,  %%f2,  %%f2  \n\t" /* G */     \
-    "fpadd16 %%f24, %%f18, %%f18 \n\t" /* G */     \
-                                                   \
-    "fpack16 %%f4,  %%f4  \n\t"                    \
-    "fpack16 %%f20, %%f20 \n\t"                    \
-    "fpack16 %%f6,  %%f6  \n\t"                    \
-    "fpack16 %%f22, %%f22 \n\t"                    \
-    "fpack16 %%f2,  %%f2  \n\t"                    \
-    "fpack16 %%f18, %%f18 \n\t"
-
-// FIXME: must be changed to set alpha to 255 instead of 0
-static int vis_420P_ARGB32(SwsContext *c, uint8_t *src[], int srcStride[],
-                           int srcSliceY, int srcSliceH,
-                           uint8_t *dst[], int dstStride[])
-{
-    int y, out1, out2, out3, out4, out5, out6;
-
-    for (y = 0; y < srcSliceH; ++y)
-        __asm__ volatile (
-            YUV2RGB_INIT
-            "wr %%g0, 0xd2, %%asi        \n\t"  /* ASI_FL16_P */
-            "1:                          \n\t"
-            "ldda [%1]     %%asi, %%f2   \n\t"
-            "ldda [%1 + 2] %%asi, %%f18  \n\t"
-            "ldda [%2]     %%asi, %%f4   \n\t"
-            "ldda [%2 + 2] %%asi, %%f20  \n\t"
-            "ld [%0], %%f0               \n\t"
-            "ld [%0+4], %%f16            \n\t"
-            "fpmerge %%f3,  %%f3,  %%f2  \n\t"
-            "fpmerge %%f19, %%f19, %%f18 \n\t"
-            "fpmerge %%f5,  %%f5,  %%f4  \n\t"
-            "fpmerge %%f21, %%f21, %%f20 \n\t"
-            YUV2RGB_KERNEL
-            "fzero %%f0                  \n\t"
-            "fpmerge %%f4,  %%f6,  %%f8  \n\t"  // r, b, t1
-            "fpmerge %%f20, %%f22, %%f24 \n\t"  // r, b, t1
-            "fpmerge %%f0,  %%f2,  %%f10 \n\t"  // 0, g, t2
-            "fpmerge %%f0,  %%f18, %%f26 \n\t"  // 0, g, t2
-            "fpmerge %%f10, %%f8,  %%f4  \n\t"  // t2, t1, msb
-            "fpmerge %%f26, %%f24, %%f20 \n\t"  // t2, t1, msb
-            "fpmerge %%f11, %%f9,  %%f6  \n\t"  // t2, t1, lsb
-            "fpmerge %%f27, %%f25, %%f22 \n\t"  // t2, t1, lsb
-            "std %%f4,  [%3]             \n\t"
-            "std %%f20, [%3 + 16]        \n\t"
-            "std %%f6,  [%3 +  8]        \n\t"
-            "std %%f22, [%3 + 24]        \n\t"
-
-            "add %0, 8, %0   \n\t"
-            "add %1, 4, %1   \n\t"
-            "add %2, 4, %2   \n\t"
-            "subcc %4, 8, %4 \n\t"
-            "bne 1b          \n\t"
-            "add %3, 32, %3  \n\t"              // delay slot
-            : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6)
-            : "0" (src[0] + (y + srcSliceY) * srcStride[0]), "1" (src[1] + ((y + srcSliceY) >> 1) * srcStride[1]),
-            "2" (src[2] + ((y + srcSliceY) >> 1) * srcStride[2]), "3" (dst[0] + (y + srcSliceY) * dstStride[0]),
-            "4" (c->dstW),
-            "5" (c->sparc_coeffs)
-            );
-
-    return srcSliceH;
-}
-
-// FIXME: must be changed to set alpha to 255 instead of 0
-static int vis_422P_ARGB32(SwsContext *c, uint8_t *src[], int srcStride[],
-                           int srcSliceY, int srcSliceH,
-                           uint8_t *dst[], int dstStride[])
-{
-    int y, out1, out2, out3, out4, out5, out6;
-
-    for (y = 0; y < srcSliceH; ++y)
-        __asm__ volatile (
-            YUV2RGB_INIT
-            "wr %%g0, 0xd2, %%asi        \n\t" /* ASI_FL16_P */
-            "1:                          \n\t"
-            "ldda [%1]     %%asi, %%f2   \n\t"
-            "ldda [%1 + 2] %%asi, %%f18  \n\t"
-            "ldda [%2]     %%asi, %%f4   \n\t"
-            "ldda [%2 + 2] %%asi, %%f20  \n\t"
-            "ld [%0],     %%f0           \n\t"
-            "ld [%0 + 4], %%f16          \n\t"
-            "fpmerge %%f3,  %%f3,  %%f2  \n\t"
-            "fpmerge %%f19, %%f19, %%f18 \n\t"
-            "fpmerge %%f5,  %%f5,  %%f4  \n\t"
-            "fpmerge %%f21, %%f21, %%f20 \n\t"
-            YUV2RGB_KERNEL
-            "fzero %%f0 \n\t"
-            "fpmerge %%f4,  %%f6,  %%f8  \n\t"  // r,b,t1
-            "fpmerge %%f20, %%f22, %%f24 \n\t"  // r,b,t1
-            "fpmerge %%f0,  %%f2,  %%f10 \n\t"  // 0,g,t2
-            "fpmerge %%f0,  %%f18, %%f26 \n\t"  // 0,g,t2
-            "fpmerge %%f10, %%f8,  %%f4  \n\t"  // t2,t1,msb
-            "fpmerge %%f26, %%f24, %%f20 \n\t"  // t2,t1,msb
-            "fpmerge %%f11, %%f9,  %%f6  \n\t"  // t2,t1,lsb
-            "fpmerge %%f27, %%f25, %%f22 \n\t"  // t2,t1,lsb
-            "std %%f4,  [%3]             \n\t"
-            "std %%f20, [%3 + 16]        \n\t"
-            "std %%f6,  [%3 + 8]         \n\t"
-            "std %%f22, [%3 + 24]        \n\t"
-
-            "add %0, 8, %0   \n\t"
-            "add %1, 4, %1   \n\t"
-            "add %2, 4, %2   \n\t"
-            "subcc %4, 8, %4 \n\t"
-            "bne 1b          \n\t"
-            "add %3, 32, %3  \n\t" //delay slot
-            : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6)
-            : "0" (src[0] + (y + srcSliceY) * srcStride[0]), "1" (src[1] + (y + srcSliceY) * srcStride[1]),
-            "2" (src[2] + (y + srcSliceY) * srcStride[2]), "3" (dst[0] + (y + srcSliceY) * dstStride[0]),
-            "4" (c->dstW),
-            "5" (c->sparc_coeffs)
-            );
-
-    return srcSliceH;
-}
-
-av_cold SwsFunc ff_yuv2rgb_init_vis(SwsContext *c)
-{
-    c->sparc_coeffs[5] = c->yCoeff;
-    c->sparc_coeffs[6] = c->vgCoeff;
-    c->sparc_coeffs[7] = c->vrCoeff;
-    c->sparc_coeffs[8] = c->ubCoeff;
-    c->sparc_coeffs[9] = c->ugCoeff;
-
-    c->sparc_coeffs[0] = (((int16_t)c->yOffset * (int16_t)c->yCoeff  >> 11) & 0xffff) * 0x0001000100010001ULL;
-    c->sparc_coeffs[1] = (((int16_t)c->uOffset * (int16_t)c->ubCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
-    c->sparc_coeffs[2] = (((int16_t)c->uOffset * (int16_t)c->ugCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
-    c->sparc_coeffs[3] = (((int16_t)c->vOffset * (int16_t)c->vgCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
-    c->sparc_coeffs[4] = (((int16_t)c->vOffset * (int16_t)c->vrCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
-
-    if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV422P && (c->dstW & 7) == 0) {
-        av_log(c, AV_LOG_INFO,
-               "SPARC VIS accelerated YUV422P -> RGB32 (WARNING: alpha value is wrong)\n");
-        return vis_422P_ARGB32;
-    } else if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV420P && (c->dstW & 7) == 0) {
-        av_log(c, AV_LOG_INFO,
-               "SPARC VIS accelerated YUV420P -> RGB32 (WARNING: alpha value is wrong)\n");
-        return vis_420P_ARGB32;
-    }
-    return NULL;
-}
diff --git a/deps/libav/libswscale/swscale-test.c b/deps/libav/libswscale/swscale-test.c
deleted file mode 100644
index 12fa9ed..0000000
--- a/deps/libav/libswscale/swscale-test.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * Copyright (C) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <stdarg.h>
-
-#undef HAVE_AV_CONFIG_H
-#include "libavutil/imgutils.h"
-#include "libavutil/mem.h"
-#include "libavutil/avutil.h"
-#include "libavutil/crc.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/lfg.h"
-#include "swscale.h"
-
-/* HACK Duplicated from swscale_internal.h.
- * Should be removed when a cleaner pixel format system exists. */
-#define isGray(x)                      \
-    ((x) == AV_PIX_FMT_GRAY8       ||     \
-     (x) == AV_PIX_FMT_Y400A       ||     \
-     (x) == AV_PIX_FMT_GRAY16BE    ||     \
-     (x) == AV_PIX_FMT_GRAY16LE)
-#define hasChroma(x)                   \
-    (!(isGray(x)                ||     \
-       (x) == AV_PIX_FMT_MONOBLACK ||     \
-       (x) == AV_PIX_FMT_MONOWHITE))
-#define isALPHA(x)                     \
-    ((x) == AV_PIX_FMT_BGR32   ||         \
-     (x) == AV_PIX_FMT_BGR32_1 ||         \
-     (x) == AV_PIX_FMT_RGB32   ||         \
-     (x) == AV_PIX_FMT_RGB32_1 ||         \
-     (x) == AV_PIX_FMT_YUVA420P)
-
-static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1,
-                       int stride2, int w, int h)
-{
-    int x, y;
-    uint64_t ssd = 0;
-
-    for (y = 0; y < h; y++) {
-        for (x = 0; x < w; x++) {
-            int d = src1[x + y * stride1] - src2[x + y * stride2];
-            ssd += d * d;
-        }
-    }
-    return ssd;
-}
-
-struct Results {
-    uint64_t ssdY;
-    uint64_t ssdU;
-    uint64_t ssdV;
-    uint64_t ssdA;
-    uint32_t crc;
-};
-
-// test by ref -> src -> dst -> out & compare out against ref
-// ref & out are YV12
-static int doTest(uint8_t *ref[4], int refStride[4], int w, int h,
-                  enum AVPixelFormat srcFormat, enum AVPixelFormat dstFormat,
-                  int srcW, int srcH, int dstW, int dstH, int flags,
-                  struct Results *r)
-{
-    const AVPixFmtDescriptor *desc_yuva420p = av_pix_fmt_desc_get(AV_PIX_FMT_YUVA420P);
-    const AVPixFmtDescriptor *desc_src      = av_pix_fmt_desc_get(srcFormat);
-    const AVPixFmtDescriptor *desc_dst      = av_pix_fmt_desc_get(dstFormat);
-    static enum AVPixelFormat cur_srcFormat;
-    static int cur_srcW, cur_srcH;
-    static uint8_t *src[4];
-    static int srcStride[4];
-    uint8_t *dst[4] = { 0 };
-    uint8_t *out[4] = { 0 };
-    int dstStride[4];
-    int i;
-    uint64_t ssdY, ssdU = 0, ssdV = 0, ssdA = 0;
-    struct SwsContext *dstContext = NULL, *outContext = NULL;
-    uint32_t crc = 0;
-    int res      = 0;
-
-    if (cur_srcFormat != srcFormat || cur_srcW != srcW || cur_srcH != srcH) {
-        struct SwsContext *srcContext = NULL;
-        int p;
-
-        for (p = 0; p < 4; p++)
-            av_freep(&src[p]);
-
-        av_image_fill_linesizes(srcStride, srcFormat, srcW);
-        for (p = 0; p < 4; p++) {
-            if (srcStride[p])
-                src[p] = av_mallocz(srcStride[p] * srcH + 16);
-            if (srcStride[p] && !src[p]) {
-                perror("Malloc");
-                res = -1;
-                goto end;
-            }
-        }
-        srcContext = sws_getContext(w, h, AV_PIX_FMT_YUVA420P, srcW, srcH,
-                                    srcFormat, SWS_BILINEAR, NULL, NULL, NULL);
-        if (!srcContext) {
-            fprintf(stderr, "Failed to get %s ---> %s\n",
-                    desc_yuva420p->name,
-                    desc_src->name);
-            res = -1;
-            goto end;
-        }
-        sws_scale(srcContext, ref, refStride, 0, h, src, srcStride);
-        sws_freeContext(srcContext);
-
-        cur_srcFormat = srcFormat;
-        cur_srcW      = srcW;
-        cur_srcH      = srcH;
-    }
-
-    av_image_fill_linesizes(dstStride, dstFormat, dstW);
-    for (i = 0; i < 4; i++) {
-        /* Image buffers passed into libswscale can be allocated any way you
-         * prefer, as long as they're aligned enough for the architecture, and
-         * they're freed appropriately (such as using av_free for buffers
-         * allocated with av_malloc). */
-        /* An extra 16 bytes is being allocated because some scalers may write
-         * out of bounds. */
-        if (dstStride[i])
-            dst[i] = av_mallocz(dstStride[i] * dstH + 16);
-        if (dstStride[i] && !dst[i]) {
-            perror("Malloc");
-            res = -1;
-
-            goto end;
-        }
-    }
-
-    dstContext = sws_getContext(srcW, srcH, srcFormat, dstW, dstH, dstFormat,
-                                flags, NULL, NULL, NULL);
-    if (!dstContext) {
-        fprintf(stderr, "Failed to get %s ---> %s\n",
-                desc_src->name, desc_dst->name);
-        res = -1;
-        goto end;
-    }
-
-    printf(" %s %dx%d -> %s %3dx%3d flags=%2d",
-           desc_src->name, srcW, srcH,
-           desc_dst->name, dstW, dstH,
-           flags);
-    fflush(stdout);
-
-    sws_scale(dstContext, src, srcStride, 0, srcH, dst, dstStride);
-
-    for (i = 0; i < 4 && dstStride[i]; i++)
-        crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), crc, dst[i],
-                     dstStride[i] * dstH);
-
-    if (r && crc == r->crc) {
-        ssdY = r->ssdY;
-        ssdU = r->ssdU;
-        ssdV = r->ssdV;
-        ssdA = r->ssdA;
-    } else {
-        for (i = 0; i < 4; i++) {
-            if (refStride[i])
-                out[i] = av_mallocz(refStride[i] * h);
-            if (refStride[i] && !out[i]) {
-                perror("Malloc");
-                res = -1;
-                goto end;
-            }
-        }
-        outContext = sws_getContext(dstW, dstH, dstFormat, w, h,
-                                    AV_PIX_FMT_YUVA420P, SWS_BILINEAR,
-                                    NULL, NULL, NULL);
-        if (!outContext) {
-            fprintf(stderr, "Failed to get %s ---> %s\n",
-                    desc_dst->name,
-                    desc_yuva420p->name);
-            res = -1;
-            goto end;
-        }
-        sws_scale(outContext, dst, dstStride, 0, dstH, out, refStride);
-
-        ssdY = getSSD(ref[0], out[0], refStride[0], refStride[0], w, h);
-        if (hasChroma(srcFormat) && hasChroma(dstFormat)) {
-            //FIXME check that output is really gray
-            ssdU = getSSD(ref[1], out[1], refStride[1], refStride[1],
-                          (w + 1) >> 1, (h + 1) >> 1);
-            ssdV = getSSD(ref[2], out[2], refStride[2], refStride[2],
-                          (w + 1) >> 1, (h + 1) >> 1);
-        }
-        if (isALPHA(srcFormat) && isALPHA(dstFormat))
-            ssdA = getSSD(ref[3], out[3], refStride[3], refStride[3], w, h);
-
-        ssdY /= w * h;
-        ssdU /= w * h / 4;
-        ssdV /= w * h / 4;
-        ssdA /= w * h;
-
-        sws_freeContext(outContext);
-
-        for (i = 0; i < 4; i++)
-            if (refStride[i])
-                av_free(out[i]);
-    }
-
-    printf(" CRC=%08x SSD=%5"PRId64 ",%5"PRId64 ",%5"PRId64 ",%5"PRId64 "\n",
-           crc, ssdY, ssdU, ssdV, ssdA);
-
-end:
-    sws_freeContext(dstContext);
-
-    for (i = 0; i < 4; i++)
-        if (dstStride[i])
-            av_free(dst[i]);
-
-    return res;
-}
-
-static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h,
-                     enum AVPixelFormat srcFormat_in,
-                     enum AVPixelFormat dstFormat_in)
-{
-    const int flags[] = { SWS_FAST_BILINEAR, SWS_BILINEAR, SWS_BICUBIC,
-                          SWS_X, SWS_POINT, SWS_AREA, 0 };
-    const int srcW   = w;
-    const int srcH   = h;
-    const int dstW[] = { srcW - srcW / 3, srcW, srcW + srcW / 3, 0 };
-    const int dstH[] = { srcH - srcH / 3, srcH, srcH + srcH / 3, 0 };
-    enum AVPixelFormat srcFormat, dstFormat;
-    const AVPixFmtDescriptor *desc_src, *desc_dst;
-
-    for (srcFormat = srcFormat_in != AV_PIX_FMT_NONE ? srcFormat_in : 0;
-         srcFormat < AV_PIX_FMT_NB; srcFormat++) {
-        if (!sws_isSupportedInput(srcFormat) ||
-            !sws_isSupportedOutput(srcFormat))
-            continue;
-
-        desc_src = av_pix_fmt_desc_get(srcFormat);
-
-        for (dstFormat = dstFormat_in != AV_PIX_FMT_NONE ? dstFormat_in : 0;
-             dstFormat < AV_PIX_FMT_NB; dstFormat++) {
-            int i, j, k;
-            int res = 0;
-
-            if (!sws_isSupportedInput(dstFormat) ||
-                !sws_isSupportedOutput(dstFormat))
-                continue;
-
-            desc_dst = av_pix_fmt_desc_get(dstFormat);
-
-            printf("%s -> %s\n", desc_src->name, desc_dst->name);
-            fflush(stdout);
-
-            for (k = 0; flags[k] && !res; k++)
-                for (i = 0; dstW[i] && !res; i++)
-                    for (j = 0; dstH[j] && !res; j++)
-                        res = doTest(ref, refStride, w, h,
-                                     srcFormat, dstFormat,
-                                     srcW, srcH, dstW[i], dstH[j], flags[k],
-                                     NULL);
-            if (dstFormat_in != AV_PIX_FMT_NONE)
-                break;
-        }
-        if (srcFormat_in != AV_PIX_FMT_NONE)
-            break;
-    }
-}
-
-static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp,
-                    enum AVPixelFormat srcFormat_in,
-                    enum AVPixelFormat dstFormat_in)
-{
-    char buf[256];
-
-    while (fgets(buf, sizeof(buf), fp)) {
-        struct Results r;
-        enum AVPixelFormat srcFormat;
-        char srcStr[12];
-        int srcW, srcH;
-        enum AVPixelFormat dstFormat;
-        char dstStr[12];
-        int dstW, dstH;
-        int flags;
-        int ret;
-
-        ret = sscanf(buf,
-                     " %12s %dx%d -> %12s %dx%d flags=%d CRC=%x"
-                     " SSD=%"PRId64 ", %"PRId64 ", %"PRId64 ", %"PRId64 "\n",
-                     srcStr, &srcW, &srcH, dstStr, &dstW, &dstH,
-                     &flags, &r.crc, &r.ssdY, &r.ssdU, &r.ssdV, &r.ssdA);
-        if (ret != 12) {
-            srcStr[0] = dstStr[0] = 0;
-            ret       = sscanf(buf, "%12s -> %12s\n", srcStr, dstStr);
-        }
-
-        srcFormat = av_get_pix_fmt(srcStr);
-        dstFormat = av_get_pix_fmt(dstStr);
-
-        if (srcFormat == AV_PIX_FMT_NONE || dstFormat == AV_PIX_FMT_NONE) {
-            fprintf(stderr, "malformed input file\n");
-            return -1;
-        }
-        if ((srcFormat_in != AV_PIX_FMT_NONE && srcFormat_in != srcFormat) ||
-            (dstFormat_in != AV_PIX_FMT_NONE && dstFormat_in != dstFormat))
-            continue;
-        if (ret != 12) {
-            printf("%s", buf);
-            continue;
-        }
-
-        doTest(ref, refStride, w, h,
-               srcFormat, dstFormat,
-               srcW, srcH, dstW, dstH, flags,
-               &r);
-    }
-
-    return 0;
-}
-
-#define W 96
-#define H 96
-
-int main(int argc, char **argv)
-{
-    enum AVPixelFormat srcFormat = AV_PIX_FMT_NONE;
-    enum AVPixelFormat dstFormat = AV_PIX_FMT_NONE;
-    uint8_t *rgb_data   = av_malloc(W * H * 4);
-    uint8_t *rgb_src[4] = { rgb_data, NULL, NULL, NULL };
-    int rgb_stride[4]   = { 4 * W, 0, 0, 0 };
-    uint8_t *data       = av_malloc(4 * W * H);
-    uint8_t *src[4]     = { data, data + W * H, data + W * H * 2, data + W * H * 3 };
-    int stride[4]       = { W, W, W, W };
-    int x, y;
-    struct SwsContext *sws;
-    AVLFG rand;
-    int res = -1;
-    int i;
-
-    if (!rgb_data || !data)
-        return -1;
-
-    sws = sws_getContext(W / 12, H / 12, AV_PIX_FMT_RGB32, W, H,
-                         AV_PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL);
-
-    av_lfg_init(&rand, 1);
-
-    for (y = 0; y < H; y++)
-        for (x = 0; x < W * 4; x++)
-            rgb_data[ x + y * 4 * W] = av_lfg_get(&rand);
-    sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride);
-    sws_freeContext(sws);
-    av_free(rgb_data);
-
-    for (i = 1; i < argc; i += 2) {
-        if (argv[i][0] != '-' || i + 1 == argc)
-            goto bad_option;
-        if (!strcmp(argv[i], "-ref")) {
-            FILE *fp = fopen(argv[i + 1], "r");
-            if (!fp) {
-                fprintf(stderr, "could not open '%s'\n", argv[i + 1]);
-                goto error;
-            }
-            res = fileTest(src, stride, W, H, fp, srcFormat, dstFormat);
-            fclose(fp);
-            goto end;
-        } else if (!strcmp(argv[i], "-src")) {
-            srcFormat = av_get_pix_fmt(argv[i + 1]);
-            if (srcFormat == AV_PIX_FMT_NONE) {
-                fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]);
-                return -1;
-            }
-        } else if (!strcmp(argv[i], "-dst")) {
-            dstFormat = av_get_pix_fmt(argv[i + 1]);
-            if (dstFormat == AV_PIX_FMT_NONE) {
-                fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]);
-                return -1;
-            }
-        } else {
-bad_option:
-            fprintf(stderr, "bad option or argument missing (%s)\n", argv[i]);
-            goto error;
-        }
-    }
-
-    selfTest(src, stride, W, H, srcFormat, dstFormat);
-end:
-    res = 0;
-error:
-    av_free(data);
-
-    return res;
-}
diff --git a/deps/libav/libswscale/swscale.c b/deps/libav/libswscale/swscale.c
deleted file mode 100644
index 7756e1b..0000000
--- a/deps/libav/libswscale/swscale.c
+++ /dev/null
@@ -1,781 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <assert.h>
-#include <inttypes.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "libavutil/avutil.h"
-#include "libavutil/bswap.h"
-#include "libavutil/cpu.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/pixdesc.h"
-#include "config.h"
-#include "rgb2rgb.h"
-#include "swscale_internal.h"
-#include "swscale.h"
-
-DECLARE_ALIGNED(8, const uint8_t, ff_dither_8x8_128)[8][8] = {
-    {  36, 68,  60, 92,  34, 66,  58, 90, },
-    { 100,  4, 124, 28,  98,  2, 122, 26, },
-    {  52, 84,  44, 76,  50, 82,  42, 74, },
-    { 116, 20, 108, 12, 114, 18, 106, 10, },
-    {  32, 64,  56, 88,  38, 70,  62, 94, },
-    {  96,  0, 120, 24, 102,  6, 126, 30, },
-    {  48, 80,  40, 72,  54, 86,  46, 78, },
-    { 112, 16, 104,  8, 118, 22, 110, 14, },
-};
-
-DECLARE_ALIGNED(8, static const uint8_t, sws_pb_64)[8] = {
-    64, 64, 64, 64, 64, 64, 64, 64
-};
-
-static av_always_inline void fillPlane(uint8_t *plane, int stride, int width,
-                                       int height, int y, uint8_t val)
-{
-    int i;
-    uint8_t *ptr = plane + stride * y;
-    for (i = 0; i < height; i++) {
-        memset(ptr, val, width);
-        ptr += stride;
-    }
-}
-
-static void fill_plane9or10(uint8_t *plane, int stride, int width,
-                            int height, int y, uint8_t val,
-                            const int dst_depth, const int big_endian)
-{
-    int i, j;
-    uint16_t *dst = (uint16_t *) (plane + stride * y);
-#define FILL8TO9_OR_10(wfunc) \
-    for (i = 0; i < height; i++) { \
-        for (j = 0; j < width; j++) { \
-            wfunc(&dst[j], (val << (dst_depth - 8)) |  \
-                               (val >> (16 - dst_depth))); \
-        } \
-        dst += stride / 2; \
-    }
-    if (big_endian) {
-        FILL8TO9_OR_10(AV_WB16);
-    } else {
-        FILL8TO9_OR_10(AV_WL16);
-    }
-}
-
-
-static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW,
-                           const uint8_t *_src, const int16_t *filter,
-                           const int32_t *filterPos, int filterSize)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
-    int i;
-    int32_t *dst        = (int32_t *) _dst;
-    const uint16_t *src = (const uint16_t *) _src;
-    int bits            = desc->comp[0].depth_minus1;
-    int sh              = bits - 4;
-
-    for (i = 0; i < dstW; i++) {
-        int j;
-        int srcPos = filterPos[i];
-        int val    = 0;
-
-        for (j = 0; j < filterSize; j++) {
-            val += src[srcPos + j] * filter[filterSize * i + j];
-        }
-        // filter=14 bit, input=16 bit, output=30 bit, >> 11 makes 19 bit
-        dst[i] = FFMIN(val >> sh, (1 << 19) - 1);
-    }
-}
-
-static void hScale16To15_c(SwsContext *c, int16_t *dst, int dstW,
-                           const uint8_t *_src, const int16_t *filter,
-                           const int32_t *filterPos, int filterSize)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
-    int i;
-    const uint16_t *src = (const uint16_t *) _src;
-    int sh              = desc->comp[0].depth_minus1;
-
-    for (i = 0; i < dstW; i++) {
-        int j;
-        int srcPos = filterPos[i];
-        int val    = 0;
-
-        for (j = 0; j < filterSize; j++) {
-            val += src[srcPos + j] * filter[filterSize * i + j];
-        }
-        // filter=14 bit, input=16 bit, output=30 bit, >> 15 makes 15 bit
-        dst[i] = FFMIN(val >> sh, (1 << 15) - 1);
-    }
-}
-
-// bilinear / bicubic scaling
-static void hScale8To15_c(SwsContext *c, int16_t *dst, int dstW,
-                          const uint8_t *src, const int16_t *filter,
-                          const int32_t *filterPos, int filterSize)
-{
-    int i;
-    for (i = 0; i < dstW; i++) {
-        int j;
-        int srcPos = filterPos[i];
-        int val    = 0;
-        for (j = 0; j < filterSize; j++) {
-            val += ((int)src[srcPos + j]) * filter[filterSize * i + j];
-        }
-        dst[i] = FFMIN(val >> 7, (1 << 15) - 1); // the cubic equation does overflow ...
-    }
-}
-
-static void hScale8To19_c(SwsContext *c, int16_t *_dst, int dstW,
-                          const uint8_t *src, const int16_t *filter,
-                          const int32_t *filterPos, int filterSize)
-{
-    int i;
-    int32_t *dst = (int32_t *) _dst;
-    for (i = 0; i < dstW; i++) {
-        int j;
-        int srcPos = filterPos[i];
-        int val    = 0;
-        for (j = 0; j < filterSize; j++) {
-            val += ((int)src[srcPos + j]) * filter[filterSize * i + j];
-        }
-        dst[i] = FFMIN(val >> 3, (1 << 19) - 1); // the cubic equation does overflow ...
-    }
-}
-
-// FIXME all pal and rgb srcFormats could do this conversion as well
-// FIXME all scalers more complex than bilinear could do half of this transform
-static void chrRangeToJpeg_c(int16_t *dstU, int16_t *dstV, int width)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        dstU[i] = (FFMIN(dstU[i], 30775) * 4663 - 9289992) >> 12; // -264
-        dstV[i] = (FFMIN(dstV[i], 30775) * 4663 - 9289992) >> 12; // -264
-    }
-}
-
-static void chrRangeFromJpeg_c(int16_t *dstU, int16_t *dstV, int width)
-{
-    int i;
-    for (i = 0; i < width; i++) {
-        dstU[i] = (dstU[i] * 1799 + 4081085) >> 11; // 1469
-        dstV[i] = (dstV[i] * 1799 + 4081085) >> 11; // 1469
-    }
-}
-
-static void lumRangeToJpeg_c(int16_t *dst, int width)
-{
-    int i;
-    for (i = 0; i < width; i++)
-        dst[i] = (FFMIN(dst[i], 30189) * 19077 - 39057361) >> 14;
-}
-
-static void lumRangeFromJpeg_c(int16_t *dst, int width)
-{
-    int i;
-    for (i = 0; i < width; i++)
-        dst[i] = (dst[i] * 14071 + 33561947) >> 14;
-}
-
-static void chrRangeToJpeg16_c(int16_t *_dstU, int16_t *_dstV, int width)
-{
-    int i;
-    int32_t *dstU = (int32_t *) _dstU;
-    int32_t *dstV = (int32_t *) _dstV;
-    for (i = 0; i < width; i++) {
-        dstU[i] = (FFMIN(dstU[i], 30775 << 4) * 4663 - (9289992 << 4)) >> 12; // -264
-        dstV[i] = (FFMIN(dstV[i], 30775 << 4) * 4663 - (9289992 << 4)) >> 12; // -264
-    }
-}
-
-static void chrRangeFromJpeg16_c(int16_t *_dstU, int16_t *_dstV, int width)
-{
-    int i;
-    int32_t *dstU = (int32_t *) _dstU;
-    int32_t *dstV = (int32_t *) _dstV;
-    for (i = 0; i < width; i++) {
-        dstU[i] = (dstU[i] * 1799 + (4081085 << 4)) >> 11; // 1469
-        dstV[i] = (dstV[i] * 1799 + (4081085 << 4)) >> 11; // 1469
-    }
-}
-
-static void lumRangeToJpeg16_c(int16_t *_dst, int width)
-{
-    int i;
-    int32_t *dst = (int32_t *) _dst;
-    for (i = 0; i < width; i++)
-        dst[i] = (FFMIN(dst[i], 30189 << 4) * 4769 - (39057361 << 2)) >> 12;
-}
-
-static void lumRangeFromJpeg16_c(int16_t *_dst, int width)
-{
-    int i;
-    int32_t *dst = (int32_t *) _dst;
-    for (i = 0; i < width; i++)
-        dst[i] = (dst[i] * 14071 + (33561947 << 4)) >> 14;
-}
-
-static void hyscale_fast_c(SwsContext *c, int16_t *dst, int dstWidth,
-                           const uint8_t *src, int srcW, int xInc)
-{
-    int i;
-    unsigned int xpos = 0;
-    for (i = 0; i < dstWidth; i++) {
-        register unsigned int xx     = xpos >> 16;
-        register unsigned int xalpha = (xpos & 0xFFFF) >> 9;
-        dst[i] = (src[xx] << 7) + (src[xx + 1] - src[xx]) * xalpha;
-        xpos  += xInc;
-    }
-}
-
-// *** horizontal scale Y line to temp buffer
-static av_always_inline void hyscale(SwsContext *c, int16_t *dst, int dstWidth,
-                                     const uint8_t *src_in[4],
-                                     int srcW, int xInc,
-                                     const int16_t *hLumFilter,
-                                     const int32_t *hLumFilterPos,
-                                     int hLumFilterSize,
-                                     uint8_t *formatConvBuffer,
-                                     uint32_t *pal, int isAlpha)
-{
-    void (*toYV12)(uint8_t *, const uint8_t *, int, uint32_t *) =
-        isAlpha ? c->alpToYV12 : c->lumToYV12;
-    void (*convertRange)(int16_t *, int) = isAlpha ? NULL : c->lumConvertRange;
-    const uint8_t *src = src_in[isAlpha ? 3 : 0];
-
-    if (toYV12) {
-        toYV12(formatConvBuffer, src, srcW, pal);
-        src = formatConvBuffer;
-    } else if (c->readLumPlanar && !isAlpha) {
-        c->readLumPlanar(formatConvBuffer, src_in, srcW);
-        src = formatConvBuffer;
-    }
-
-    if (!c->hyscale_fast) {
-        c->hyScale(c, dst, dstWidth, src, hLumFilter,
-                   hLumFilterPos, hLumFilterSize);
-    } else { // fast bilinear upscale / crap downscale
-        c->hyscale_fast(c, dst, dstWidth, src, srcW, xInc);
-    }
-
-    if (convertRange)
-        convertRange(dst, dstWidth);
-}
-
-static void hcscale_fast_c(SwsContext *c, int16_t *dst1, int16_t *dst2,
-                           int dstWidth, const uint8_t *src1,
-                           const uint8_t *src2, int srcW, int xInc)
-{
-    int i;
-    unsigned int xpos = 0;
-    for (i = 0; i < dstWidth; i++) {
-        register unsigned int xx     = xpos >> 16;
-        register unsigned int xalpha = (xpos & 0xFFFF) >> 9;
-        dst1[i] = (src1[xx] * (xalpha ^ 127) + src1[xx + 1] * xalpha);
-        dst2[i] = (src2[xx] * (xalpha ^ 127) + src2[xx + 1] * xalpha);
-        xpos   += xInc;
-    }
-}
-
-static av_always_inline void hcscale(SwsContext *c, int16_t *dst1,
-                                     int16_t *dst2, int dstWidth,
-                                     const uint8_t *src_in[4],
-                                     int srcW, int xInc,
-                                     const int16_t *hChrFilter,
-                                     const int32_t *hChrFilterPos,
-                                     int hChrFilterSize,
-                                     uint8_t *formatConvBuffer, uint32_t *pal)
-{
-    const uint8_t *src1 = src_in[1], *src2 = src_in[2];
-    if (c->chrToYV12) {
-        uint8_t *buf2 = formatConvBuffer +
-                        FFALIGN(srcW * FFALIGN(c->srcBpc, 8) >> 3, 16);
-        c->chrToYV12(formatConvBuffer, buf2, src1, src2, srcW, pal);
-        src1 = formatConvBuffer;
-        src2 = buf2;
-    } else if (c->readChrPlanar) {
-        uint8_t *buf2 = formatConvBuffer +
-                        FFALIGN(srcW * FFALIGN(c->srcBpc, 8) >> 3, 16);
-        c->readChrPlanar(formatConvBuffer, buf2, src_in, srcW);
-        src1 = formatConvBuffer;
-        src2 = buf2;
-    }
-
-    if (!c->hcscale_fast) {
-        c->hcScale(c, dst1, dstWidth, src1, hChrFilter, hChrFilterPos, hChrFilterSize);
-        c->hcScale(c, dst2, dstWidth, src2, hChrFilter, hChrFilterPos, hChrFilterSize);
-    } else { // fast bilinear upscale / crap downscale
-        c->hcscale_fast(c, dst1, dst2, dstWidth, src1, src2, srcW, xInc);
-    }
-
-    if (c->chrConvertRange)
-        c->chrConvertRange(dst1, dst2, dstWidth);
-}
-
-#define DEBUG_SWSCALE_BUFFERS 0
-#define DEBUG_BUFFERS(...)                      \
-    if (DEBUG_SWSCALE_BUFFERS)                  \
-        av_log(c, AV_LOG_DEBUG, __VA_ARGS__)
-
-static int swscale(SwsContext *c, const uint8_t *src[],
-                   int srcStride[], int srcSliceY,
-                   int srcSliceH, uint8_t *dst[], int dstStride[])
-{
-    /* load a few things into local vars to make the code more readable?
-     * and faster */
-    const int srcW                   = c->srcW;
-    const int dstW                   = c->dstW;
-    const int dstH                   = c->dstH;
-    const int chrDstW                = c->chrDstW;
-    const int chrSrcW                = c->chrSrcW;
-    const int lumXInc                = c->lumXInc;
-    const int chrXInc                = c->chrXInc;
-    const enum AVPixelFormat dstFormat = c->dstFormat;
-    const int flags                  = c->flags;
-    int32_t *vLumFilterPos           = c->vLumFilterPos;
-    int32_t *vChrFilterPos           = c->vChrFilterPos;
-    int32_t *hLumFilterPos           = c->hLumFilterPos;
-    int32_t *hChrFilterPos           = c->hChrFilterPos;
-    int16_t *vLumFilter              = c->vLumFilter;
-    int16_t *vChrFilter              = c->vChrFilter;
-    int16_t *hLumFilter              = c->hLumFilter;
-    int16_t *hChrFilter              = c->hChrFilter;
-    int32_t *lumMmxFilter            = c->lumMmxFilter;
-    int32_t *chrMmxFilter            = c->chrMmxFilter;
-    const int vLumFilterSize         = c->vLumFilterSize;
-    const int vChrFilterSize         = c->vChrFilterSize;
-    const int hLumFilterSize         = c->hLumFilterSize;
-    const int hChrFilterSize         = c->hChrFilterSize;
-    int16_t **lumPixBuf              = c->lumPixBuf;
-    int16_t **chrUPixBuf             = c->chrUPixBuf;
-    int16_t **chrVPixBuf             = c->chrVPixBuf;
-    int16_t **alpPixBuf              = c->alpPixBuf;
-    const int vLumBufSize            = c->vLumBufSize;
-    const int vChrBufSize            = c->vChrBufSize;
-    uint8_t *formatConvBuffer        = c->formatConvBuffer;
-    uint32_t *pal                    = c->pal_yuv;
-    yuv2planar1_fn yuv2plane1        = c->yuv2plane1;
-    yuv2planarX_fn yuv2planeX        = c->yuv2planeX;
-    yuv2interleavedX_fn yuv2nv12cX   = c->yuv2nv12cX;
-    yuv2packed1_fn yuv2packed1       = c->yuv2packed1;
-    yuv2packed2_fn yuv2packed2       = c->yuv2packed2;
-    yuv2packedX_fn yuv2packedX       = c->yuv2packedX;
-    yuv2anyX_fn yuv2anyX             = c->yuv2anyX;
-    const int chrSrcSliceY           =     srcSliceY  >> c->chrSrcVSubSample;
-    const int chrSrcSliceH           = -((-srcSliceH) >> c->chrSrcVSubSample);
-    int should_dither                = is9_OR_10BPS(c->srcFormat) ||
-                                       is16BPS(c->srcFormat);
-    int lastDstY;
-
-    /* vars which will change and which we need to store back in the context */
-    int dstY         = c->dstY;
-    int lumBufIndex  = c->lumBufIndex;
-    int chrBufIndex  = c->chrBufIndex;
-    int lastInLumBuf = c->lastInLumBuf;
-    int lastInChrBuf = c->lastInChrBuf;
-
-    if (isPacked(c->srcFormat)) {
-        src[0] =
-        src[1] =
-        src[2] =
-        src[3] = src[0];
-        srcStride[0] =
-        srcStride[1] =
-        srcStride[2] =
-        srcStride[3] = srcStride[0];
-    }
-    srcStride[1] <<= c->vChrDrop;
-    srcStride[2] <<= c->vChrDrop;
-
-    DEBUG_BUFFERS("swscale() %p[%d] %p[%d] %p[%d] %p[%d] -> %p[%d] %p[%d] %p[%d] %p[%d]\n",
-                  src[0], srcStride[0], src[1], srcStride[1],
-                  src[2], srcStride[2], src[3], srcStride[3],
-                  dst[0], dstStride[0], dst[1], dstStride[1],
-                  dst[2], dstStride[2], dst[3], dstStride[3]);
-    DEBUG_BUFFERS("srcSliceY: %d srcSliceH: %d dstY: %d dstH: %d\n",
-                  srcSliceY, srcSliceH, dstY, dstH);
-    DEBUG_BUFFERS("vLumFilterSize: %d vLumBufSize: %d vChrFilterSize: %d vChrBufSize: %d\n",
-                  vLumFilterSize, vLumBufSize, vChrFilterSize, vChrBufSize);
-
-    if (dstStride[0] % 8 != 0 || dstStride[1] % 8 != 0 ||
-        dstStride[2] % 8 != 0 || dstStride[3] % 8 != 0) {
-        static int warnedAlready = 0; // FIXME maybe move this into the context
-        if (flags & SWS_PRINT_INFO && !warnedAlready) {
-            av_log(c, AV_LOG_WARNING,
-                   "Warning: dstStride is not aligned!\n"
-                   "         ->cannot do aligned memory accesses anymore\n");
-            warnedAlready = 1;
-        }
-    }
-
-    /* Note the user might start scaling the picture in the middle so this
-     * will not get executed. This is not really intended but works
-     * currently, so people might do it. */
-    if (srcSliceY == 0) {
-        lumBufIndex  = -1;
-        chrBufIndex  = -1;
-        dstY         = 0;
-        lastInLumBuf = -1;
-        lastInChrBuf = -1;
-    }
-
-    if (!should_dither) {
-        c->chrDither8 = c->lumDither8 = sws_pb_64;
-    }
-    lastDstY = dstY;
-
-    for (; dstY < dstH; dstY++) {
-        const int chrDstY = dstY >> c->chrDstVSubSample;
-        uint8_t *dest[4]  = {
-            dst[0] + dstStride[0] * dstY,
-            dst[1] + dstStride[1] * chrDstY,
-            dst[2] + dstStride[2] * chrDstY,
-            (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? dst[3] + dstStride[3] * dstY : NULL,
-        };
-
-        // First line needed as input
-        const int firstLumSrcY  = FFMAX(1 - vLumFilterSize, vLumFilterPos[dstY]);
-        const int firstLumSrcY2 = FFMAX(1 - vLumFilterSize, vLumFilterPos[FFMIN(dstY | ((1 << c->chrDstVSubSample) - 1), dstH - 1)]);
-        // First line needed as input
-        const int firstChrSrcY  = FFMAX(1 - vChrFilterSize, vChrFilterPos[chrDstY]);
-
-        // Last line needed as input
-        int lastLumSrcY  = FFMIN(c->srcH,    firstLumSrcY  + vLumFilterSize) - 1;
-        int lastLumSrcY2 = FFMIN(c->srcH,    firstLumSrcY2 + vLumFilterSize) - 1;
-        int lastChrSrcY  = FFMIN(c->chrSrcH, firstChrSrcY  + vChrFilterSize) - 1;
-        int enough_lines;
-
-        // handle holes (FAST_BILINEAR & weird filters)
-        if (firstLumSrcY > lastInLumBuf)
-            lastInLumBuf = firstLumSrcY - 1;
-        if (firstChrSrcY > lastInChrBuf)
-            lastInChrBuf = firstChrSrcY - 1;
-        assert(firstLumSrcY >= lastInLumBuf - vLumBufSize + 1);
-        assert(firstChrSrcY >= lastInChrBuf - vChrBufSize + 1);
-
-        DEBUG_BUFFERS("dstY: %d\n", dstY);
-        DEBUG_BUFFERS("\tfirstLumSrcY: %d lastLumSrcY: %d lastInLumBuf: %d\n",
-                      firstLumSrcY, lastLumSrcY, lastInLumBuf);
-        DEBUG_BUFFERS("\tfirstChrSrcY: %d lastChrSrcY: %d lastInChrBuf: %d\n",
-                      firstChrSrcY, lastChrSrcY, lastInChrBuf);
-
-        // Do we have enough lines in this slice to output the dstY line
-        enough_lines = lastLumSrcY2 < srcSliceY + srcSliceH &&
-                       lastChrSrcY < -((-srcSliceY - srcSliceH) >> c->chrSrcVSubSample);
-
-        if (!enough_lines) {
-            lastLumSrcY = srcSliceY + srcSliceH - 1;
-            lastChrSrcY = chrSrcSliceY + chrSrcSliceH - 1;
-            DEBUG_BUFFERS("buffering slice: lastLumSrcY %d lastChrSrcY %d\n",
-                          lastLumSrcY, lastChrSrcY);
-        }
-
-        // Do horizontal scaling
-        while (lastInLumBuf < lastLumSrcY) {
-            const uint8_t *src1[4] = {
-                src[0] + (lastInLumBuf + 1 - srcSliceY) * srcStride[0],
-                src[1] + (lastInLumBuf + 1 - srcSliceY) * srcStride[1],
-                src[2] + (lastInLumBuf + 1 - srcSliceY) * srcStride[2],
-                src[3] + (lastInLumBuf + 1 - srcSliceY) * srcStride[3],
-            };
-            lumBufIndex++;
-            assert(lumBufIndex < 2 * vLumBufSize);
-            assert(lastInLumBuf + 1 - srcSliceY < srcSliceH);
-            assert(lastInLumBuf + 1 - srcSliceY >= 0);
-            hyscale(c, lumPixBuf[lumBufIndex], dstW, src1, srcW, lumXInc,
-                    hLumFilter, hLumFilterPos, hLumFilterSize,
-                    formatConvBuffer, pal, 0);
-            if (CONFIG_SWSCALE_ALPHA && alpPixBuf)
-                hyscale(c, alpPixBuf[lumBufIndex], dstW, src1, srcW,
-                        lumXInc, hLumFilter, hLumFilterPos, hLumFilterSize,
-                        formatConvBuffer, pal, 1);
-            lastInLumBuf++;
-            DEBUG_BUFFERS("\t\tlumBufIndex %d: lastInLumBuf: %d\n",
-                          lumBufIndex, lastInLumBuf);
-        }
-        while (lastInChrBuf < lastChrSrcY) {
-            const uint8_t *src1[4] = {
-                src[0] + (lastInChrBuf + 1 - chrSrcSliceY) * srcStride[0],
-                src[1] + (lastInChrBuf + 1 - chrSrcSliceY) * srcStride[1],
-                src[2] + (lastInChrBuf + 1 - chrSrcSliceY) * srcStride[2],
-                src[3] + (lastInChrBuf + 1 - chrSrcSliceY) * srcStride[3],
-            };
-            chrBufIndex++;
-            assert(chrBufIndex < 2 * vChrBufSize);
-            assert(lastInChrBuf + 1 - chrSrcSliceY < (chrSrcSliceH));
-            assert(lastInChrBuf + 1 - chrSrcSliceY >= 0);
-            // FIXME replace parameters through context struct (some at least)
-
-            if (c->needs_hcscale)
-                hcscale(c, chrUPixBuf[chrBufIndex], chrVPixBuf[chrBufIndex],
-                        chrDstW, src1, chrSrcW, chrXInc,
-                        hChrFilter, hChrFilterPos, hChrFilterSize,
-                        formatConvBuffer, pal);
-            lastInChrBuf++;
-            DEBUG_BUFFERS("\t\tchrBufIndex %d: lastInChrBuf: %d\n",
-                          chrBufIndex, lastInChrBuf);
-        }
-        // wrap buf index around to stay inside the ring buffer
-        if (lumBufIndex >= vLumBufSize)
-            lumBufIndex -= vLumBufSize;
-        if (chrBufIndex >= vChrBufSize)
-            chrBufIndex -= vChrBufSize;
-        if (!enough_lines)
-            break;  // we can't output a dstY line so let's try with the next slice
-
-#if HAVE_MMX_INLINE
-        updateMMXDitherTables(c, dstY, lumBufIndex, chrBufIndex,
-                              lastInLumBuf, lastInChrBuf);
-#endif
-        if (should_dither) {
-            c->chrDither8 = ff_dither_8x8_128[chrDstY & 7];
-            c->lumDither8 = ff_dither_8x8_128[dstY    & 7];
-        }
-        if (dstY >= dstH - 2) {
-            /* hmm looks like we can't use MMX here without overwriting
-             * this array's tail */
-            ff_sws_init_output_funcs(c, &yuv2plane1, &yuv2planeX, &yuv2nv12cX,
-                                     &yuv2packed1, &yuv2packed2, &yuv2packedX, &yuv2anyX);
-        }
-
-        {
-            const int16_t **lumSrcPtr  = (const int16_t **)lumPixBuf  + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
-            const int16_t **chrUSrcPtr = (const int16_t **)chrUPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
-            const int16_t **chrVSrcPtr = (const int16_t **)chrVPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
-            const int16_t **alpSrcPtr  = (CONFIG_SWSCALE_ALPHA && alpPixBuf) ?
-                                         (const int16_t **)alpPixBuf  + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize : NULL;
-
-            if (firstLumSrcY < 0 || firstLumSrcY + vLumFilterSize > c->srcH) {
-                const int16_t **tmpY = (const int16_t **)lumPixBuf +
-                                       2 * vLumBufSize;
-                int neg = -firstLumSrcY, i;
-                int end = FFMIN(c->srcH - firstLumSrcY, vLumFilterSize);
-                for (i = 0; i < neg; i++)
-                    tmpY[i] = lumSrcPtr[neg];
-                for (; i < end; i++)
-                    tmpY[i] = lumSrcPtr[i];
-                for (; i < vLumFilterSize; i++)
-                    tmpY[i] = tmpY[i - 1];
-                lumSrcPtr = tmpY;
-
-                if (alpSrcPtr) {
-                    const int16_t **tmpA = (const int16_t **)alpPixBuf +
-                                           2 * vLumBufSize;
-                    for (i = 0; i < neg; i++)
-                        tmpA[i] = alpSrcPtr[neg];
-                    for (; i < end; i++)
-                        tmpA[i] = alpSrcPtr[i];
-                    for (; i < vLumFilterSize; i++)
-                        tmpA[i] = tmpA[i - 1];
-                    alpSrcPtr = tmpA;
-                }
-            }
-            if (firstChrSrcY < 0 ||
-                firstChrSrcY + vChrFilterSize > c->chrSrcH) {
-                const int16_t **tmpU = (const int16_t **)chrUPixBuf + 2 * vChrBufSize,
-                **tmpV               = (const int16_t **)chrVPixBuf + 2 * vChrBufSize;
-                int neg = -firstChrSrcY, i;
-                int end = FFMIN(c->chrSrcH - firstChrSrcY, vChrFilterSize);
-                for (i = 0; i < neg; i++) {
-                    tmpU[i] = chrUSrcPtr[neg];
-                    tmpV[i] = chrVSrcPtr[neg];
-                }
-                for (; i < end; i++) {
-                    tmpU[i] = chrUSrcPtr[i];
-                    tmpV[i] = chrVSrcPtr[i];
-                }
-                for (; i < vChrFilterSize; i++) {
-                    tmpU[i] = tmpU[i - 1];
-                    tmpV[i] = tmpV[i - 1];
-                }
-                chrUSrcPtr = tmpU;
-                chrVSrcPtr = tmpV;
-            }
-
-            if (isPlanarYUV(dstFormat) ||
-                (isGray(dstFormat) && !isALPHA(dstFormat))) { // YV12 like
-                const int chrSkipMask = (1 << c->chrDstVSubSample) - 1;
-
-                if (vLumFilterSize == 1) {
-                    yuv2plane1(lumSrcPtr[0], dest[0], dstW, c->lumDither8, 0);
-                } else {
-                    yuv2planeX(vLumFilter + dstY * vLumFilterSize,
-                               vLumFilterSize, lumSrcPtr, dest[0],
-                               dstW, c->lumDither8, 0);
-                }
-
-                if (!((dstY & chrSkipMask) || isGray(dstFormat))) {
-                    if (yuv2nv12cX) {
-                        yuv2nv12cX(c, vChrFilter + chrDstY * vChrFilterSize,
-                                   vChrFilterSize, chrUSrcPtr, chrVSrcPtr,
-                                   dest[1], chrDstW);
-                    } else if (vChrFilterSize == 1) {
-                        yuv2plane1(chrUSrcPtr[0], dest[1], chrDstW, c->chrDither8, 0);
-                        yuv2plane1(chrVSrcPtr[0], dest[2], chrDstW, c->chrDither8, 3);
-                    } else {
-                        yuv2planeX(vChrFilter + chrDstY * vChrFilterSize,
-                                   vChrFilterSize, chrUSrcPtr, dest[1],
-                                   chrDstW, c->chrDither8, 0);
-                        yuv2planeX(vChrFilter + chrDstY * vChrFilterSize,
-                                   vChrFilterSize, chrVSrcPtr, dest[2],
-                                   chrDstW, c->chrDither8, 3);
-                    }
-                }
-
-                if (CONFIG_SWSCALE_ALPHA && alpPixBuf) {
-                    if (vLumFilterSize == 1) {
-                        yuv2plane1(alpSrcPtr[0], dest[3], dstW,
-                                   c->lumDither8, 0);
-                    } else {
-                        yuv2planeX(vLumFilter + dstY * vLumFilterSize,
-                                   vLumFilterSize, alpSrcPtr, dest[3],
-                                   dstW, c->lumDither8, 0);
-                    }
-                }
-            } else if (yuv2packedX) {
-                if (c->yuv2packed1 && vLumFilterSize == 1 &&
-                    vChrFilterSize <= 2) { // unscaled RGB
-                    int chrAlpha = vChrFilterSize == 1 ? 0 : vChrFilter[2 * dstY + 1];
-                    yuv2packed1(c, *lumSrcPtr, chrUSrcPtr, chrVSrcPtr,
-                                alpPixBuf ? *alpSrcPtr : NULL,
-                                dest[0], dstW, chrAlpha, dstY);
-                } else if (c->yuv2packed2 && vLumFilterSize == 2 &&
-                           vChrFilterSize == 2) { // bilinear upscale RGB
-                    int lumAlpha = vLumFilter[2 * dstY + 1];
-                    int chrAlpha = vChrFilter[2 * dstY + 1];
-                    lumMmxFilter[2] =
-                    lumMmxFilter[3] = vLumFilter[2 * dstY]    * 0x10001;
-                    chrMmxFilter[2] =
-                    chrMmxFilter[3] = vChrFilter[2 * chrDstY] * 0x10001;
-                    yuv2packed2(c, lumSrcPtr, chrUSrcPtr, chrVSrcPtr,
-                                alpPixBuf ? alpSrcPtr : NULL,
-                                dest[0], dstW, lumAlpha, chrAlpha, dstY);
-                } else { // general RGB
-                    yuv2packedX(c, vLumFilter + dstY * vLumFilterSize,
-                                lumSrcPtr, vLumFilterSize,
-                                vChrFilter + dstY * vChrFilterSize,
-                                chrUSrcPtr, chrVSrcPtr, vChrFilterSize,
-                                alpSrcPtr, dest[0], dstW, dstY);
-                }
-            } else {
-                yuv2anyX(c, vLumFilter + dstY * vLumFilterSize,
-                         lumSrcPtr, vLumFilterSize,
-                         vChrFilter + dstY * vChrFilterSize,
-                         chrUSrcPtr, chrVSrcPtr, vChrFilterSize,
-                         alpSrcPtr, dest, dstW, dstY);
-            }
-        }
-    }
-
-    if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) {
-        int length = dstW;
-        int height = dstY - lastDstY;
-        if (is16BPS(c->dstFormat))
-            length *= 2;
-
-        if (is9_OR_10BPS(dstFormat)) {
-            const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
-            fill_plane9or10(dst[3], dstStride[3], length, height, lastDstY,
-                            255, desc->comp[3].depth_minus1 + 1,
-                            isBE(dstFormat));
-        } else
-            fillPlane(dst[3], dstStride[3], length, height, lastDstY, 255);
-    }
-
-#if HAVE_MMXEXT_INLINE
-    if (av_get_cpu_flags() & AV_CPU_FLAG_MMXEXT)
-        __asm__ volatile ("sfence" ::: "memory");
-#endif
-    emms_c();
-
-    /* store changed local vars back in the context */
-    c->dstY         = dstY;
-    c->lumBufIndex  = lumBufIndex;
-    c->chrBufIndex  = chrBufIndex;
-    c->lastInLumBuf = lastInLumBuf;
-    c->lastInChrBuf = lastInChrBuf;
-
-    return dstY - lastDstY;
-}
-
-static av_cold void sws_init_swscale(SwsContext *c)
-{
-    enum AVPixelFormat srcFormat = c->srcFormat;
-
-    ff_sws_init_output_funcs(c, &c->yuv2plane1, &c->yuv2planeX,
-                             &c->yuv2nv12cX, &c->yuv2packed1,
-                             &c->yuv2packed2, &c->yuv2packedX, &c->yuv2anyX);
-
-    ff_sws_init_input_funcs(c);
-
-    if (c->srcBpc == 8) {
-        if (c->dstBpc <= 10) {
-            c->hyScale = c->hcScale = hScale8To15_c;
-            if (c->flags & SWS_FAST_BILINEAR) {
-                c->hyscale_fast = hyscale_fast_c;
-                c->hcscale_fast = hcscale_fast_c;
-            }
-        } else {
-            c->hyScale = c->hcScale = hScale8To19_c;
-        }
-    } else {
-        c->hyScale = c->hcScale = c->dstBpc > 10 ? hScale16To19_c
-                                                 : hScale16To15_c;
-    }
-
-    if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
-        if (c->dstBpc <= 10) {
-            if (c->srcRange) {
-                c->lumConvertRange = lumRangeFromJpeg_c;
-                c->chrConvertRange = chrRangeFromJpeg_c;
-            } else {
-                c->lumConvertRange = lumRangeToJpeg_c;
-                c->chrConvertRange = chrRangeToJpeg_c;
-            }
-        } else {
-            if (c->srcRange) {
-                c->lumConvertRange = lumRangeFromJpeg16_c;
-                c->chrConvertRange = chrRangeFromJpeg16_c;
-            } else {
-                c->lumConvertRange = lumRangeToJpeg16_c;
-                c->chrConvertRange = chrRangeToJpeg16_c;
-            }
-        }
-    }
-
-    if (!(isGray(srcFormat) || isGray(c->dstFormat) ||
-          srcFormat == AV_PIX_FMT_MONOBLACK || srcFormat == AV_PIX_FMT_MONOWHITE))
-        c->needs_hcscale = 1;
-}
-
-SwsFunc ff_getSwsFunc(SwsContext *c)
-{
-    sws_init_swscale(c);
-
-    if (ARCH_PPC)
-        ff_sws_init_swscale_ppc(c);
-    if (ARCH_X86)
-        ff_sws_init_swscale_x86(c);
-
-    return swscale;
-}
diff --git a/deps/libav/libswscale/swscale.h b/deps/libav/libswscale/swscale.h
deleted file mode 100644
index 8fe27df..0000000
--- a/deps/libav/libswscale/swscale.h
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWSCALE_SWSCALE_H
-#define SWSCALE_SWSCALE_H
-
-/**
- * @file
- * @ingroup libsws
- * @brief
- *     external api for the swscale stuff
- */
-
-#include <stdint.h>
-
-#include "libavutil/avutil.h"
-#include "libavutil/log.h"
-#include "libavutil/pixfmt.h"
-#include "version.h"
-
-/**
- * @defgroup libsws Color conversion and scaling
- * @{
- *
- * Return the LIBSWSCALE_VERSION_INT constant.
- */
-unsigned swscale_version(void);
-
-/**
- * Return the libswscale build-time configuration.
- */
-const char *swscale_configuration(void);
-
-/**
- * Return the libswscale license.
- */
-const char *swscale_license(void);
-
-/* values for the flags, the stuff on the command line is different */
-#define SWS_FAST_BILINEAR     1
-#define SWS_BILINEAR          2
-#define SWS_BICUBIC           4
-#define SWS_X                 8
-#define SWS_POINT          0x10
-#define SWS_AREA           0x20
-#define SWS_BICUBLIN       0x40
-#define SWS_GAUSS          0x80
-#define SWS_SINC          0x100
-#define SWS_LANCZOS       0x200
-#define SWS_SPLINE        0x400
-
-#define SWS_SRC_V_CHR_DROP_MASK     0x30000
-#define SWS_SRC_V_CHR_DROP_SHIFT    16
-
-#define SWS_PARAM_DEFAULT           123456
-
-#define SWS_PRINT_INFO              0x1000
-
-//the following 3 flags are not completely implemented
-//internal chrominace subsampling info
-#define SWS_FULL_CHR_H_INT    0x2000
-//input subsampling info
-#define SWS_FULL_CHR_H_INP    0x4000
-#define SWS_DIRECT_BGR        0x8000
-#define SWS_ACCURATE_RND      0x40000
-#define SWS_BITEXACT          0x80000
-
-#if FF_API_SWS_CPU_CAPS
-/**
- * CPU caps are autodetected now, those flags
- * are only provided for API compatibility.
- */
-#define SWS_CPU_CAPS_MMX      0x80000000
-#define SWS_CPU_CAPS_MMXEXT   0x20000000
-#define SWS_CPU_CAPS_MMX2     0x20000000
-#define SWS_CPU_CAPS_3DNOW    0x40000000
-#define SWS_CPU_CAPS_ALTIVEC  0x10000000
-#define SWS_CPU_CAPS_BFIN     0x01000000
-#define SWS_CPU_CAPS_SSE2     0x02000000
-#endif
-
-#define SWS_MAX_REDUCE_CUTOFF 0.002
-
-#define SWS_CS_ITU709         1
-#define SWS_CS_FCC            4
-#define SWS_CS_ITU601         5
-#define SWS_CS_ITU624         5
-#define SWS_CS_SMPTE170M      5
-#define SWS_CS_SMPTE240M      7
-#define SWS_CS_DEFAULT        5
-
-/**
- * Return a pointer to yuv<->rgb coefficients for the given colorspace
- * suitable for sws_setColorspaceDetails().
- *
- * @param colorspace One of the SWS_CS_* macros. If invalid,
- * SWS_CS_DEFAULT is used.
- */
-const int *sws_getCoefficients(int colorspace);
-
-// when used for filters they must have an odd number of elements
-// coeffs cannot be shared between vectors
-typedef struct SwsVector {
-    double *coeff;              ///< pointer to the list of coefficients
-    int length;                 ///< number of coefficients in the vector
-} SwsVector;
-
-// vectors can be shared
-typedef struct SwsFilter {
-    SwsVector *lumH;
-    SwsVector *lumV;
-    SwsVector *chrH;
-    SwsVector *chrV;
-} SwsFilter;
-
-struct SwsContext;
-
-/**
- * Return a positive value if pix_fmt is a supported input format, 0
- * otherwise.
- */
-int sws_isSupportedInput(enum AVPixelFormat pix_fmt);
-
-/**
- * Return a positive value if pix_fmt is a supported output format, 0
- * otherwise.
- */
-int sws_isSupportedOutput(enum AVPixelFormat pix_fmt);
-
-/**
- * @param[in]  pix_fmt the pixel format
- * @return a positive value if an endianness conversion for pix_fmt is
- * supported, 0 otherwise.
- */
-int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt);
-
-/**
- * Allocate an empty SwsContext. This must be filled and passed to
- * sws_init_context(). For filling see AVOptions, options.c and
- * sws_setColorspaceDetails().
- */
-struct SwsContext *sws_alloc_context(void);
-
-/**
- * Initialize the swscaler context sws_context.
- *
- * @return zero or positive value on success, a negative value on
- * error
- */
-int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
-
-/**
- * Free the swscaler context swsContext.
- * If swsContext is NULL, then does nothing.
- */
-void sws_freeContext(struct SwsContext *swsContext);
-
-#if FF_API_SWS_GETCONTEXT
-/**
- * Allocate and return an SwsContext. You need it to perform
- * scaling/conversion operations using sws_scale().
- *
- * @param srcW the width of the source image
- * @param srcH the height of the source image
- * @param srcFormat the source image format
- * @param dstW the width of the destination image
- * @param dstH the height of the destination image
- * @param dstFormat the destination image format
- * @param flags specify which algorithm and options to use for rescaling
- * @return a pointer to an allocated context, or NULL in case of error
- * @note this function is to be removed after a saner alternative is
- *       written
- * @deprecated Use sws_getCachedContext() instead.
- */
-struct SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
-                                  int dstW, int dstH, enum AVPixelFormat dstFormat,
-                                  int flags, SwsFilter *srcFilter,
-                                  SwsFilter *dstFilter, const double *param);
-#endif
-
-/**
- * Scale the image slice in srcSlice and put the resulting scaled
- * slice in the image in dst. A slice is a sequence of consecutive
- * rows in an image.
- *
- * Slices have to be provided in sequential order, either in
- * top-bottom or bottom-top order. If slices are provided in
- * non-sequential order the behavior of the function is undefined.
- *
- * @param c         the scaling context previously created with
- *                  sws_getContext()
- * @param srcSlice  the array containing the pointers to the planes of
- *                  the source slice
- * @param srcStride the array containing the strides for each plane of
- *                  the source image
- * @param srcSliceY the position in the source image of the slice to
- *                  process, that is the number (counted starting from
- *                  zero) in the image of the first row of the slice
- * @param srcSliceH the height of the source slice, that is the number
- *                  of rows in the slice
- * @param dst       the array containing the pointers to the planes of
- *                  the destination image
- * @param dstStride the array containing the strides for each plane of
- *                  the destination image
- * @return          the height of the output slice
- */
-int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
-              const int srcStride[], int srcSliceY, int srcSliceH,
-              uint8_t *const dst[], const int dstStride[]);
-
-/**
- * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
- * @return -1 if not supported
- */
-int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
-                             int srcRange, const int table[4], int dstRange,
-                             int brightness, int contrast, int saturation);
-
-/**
- * @return -1 if not supported
- */
-int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
-                             int *srcRange, int **table, int *dstRange,
-                             int *brightness, int *contrast, int *saturation);
-
-/**
- * Allocate and return an uninitialized vector with length coefficients.
- */
-SwsVector *sws_allocVec(int length);
-
-/**
- * Return a normalized Gaussian curve used to filter stuff
- * quality = 3 is high quality, lower is lower quality.
- */
-SwsVector *sws_getGaussianVec(double variance, double quality);
-
-/**
- * Allocate and return a vector with length coefficients, all
- * with the same value c.
- */
-SwsVector *sws_getConstVec(double c, int length);
-
-/**
- * Allocate and return a vector with just one coefficient, with
- * value 1.0.
- */
-SwsVector *sws_getIdentityVec(void);
-
-/**
- * Scale all the coefficients of a by the scalar value.
- */
-void sws_scaleVec(SwsVector *a, double scalar);
-
-/**
- * Scale all the coefficients of a so that their sum equals height.
- */
-void sws_normalizeVec(SwsVector *a, double height);
-void sws_convVec(SwsVector *a, SwsVector *b);
-void sws_addVec(SwsVector *a, SwsVector *b);
-void sws_subVec(SwsVector *a, SwsVector *b);
-void sws_shiftVec(SwsVector *a, int shift);
-
-/**
- * Allocate and return a clone of the vector a, that is a vector
- * with the same coefficients as a.
- */
-SwsVector *sws_cloneVec(SwsVector *a);
-
-/**
- * Print with av_log() a textual representation of the vector a
- * if log_level <= av_log_level.
- */
-void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
-
-void sws_freeVec(SwsVector *a);
-
-SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
-                                float lumaSharpen, float chromaSharpen,
-                                float chromaHShift, float chromaVShift,
-                                int verbose);
-void sws_freeFilter(SwsFilter *filter);
-
-/**
- * Check if context can be reused, otherwise reallocate a new one.
- *
- * If context is NULL, just calls sws_getContext() to get a new
- * context. Otherwise, checks if the parameters are the ones already
- * saved in context. If that is the case, returns the current
- * context. Otherwise, frees context and gets a new context with
- * the new parameters.
- *
- * Be warned that srcFilter and dstFilter are not checked, they
- * are assumed to remain the same.
- */
-struct SwsContext *sws_getCachedContext(struct SwsContext *context,
-                                        int srcW, int srcH, enum AVPixelFormat srcFormat,
-                                        int dstW, int dstH, enum AVPixelFormat dstFormat,
-                                        int flags, SwsFilter *srcFilter,
-                                        SwsFilter *dstFilter, const double *param);
-
-/**
- * Convert an 8-bit paletted frame into a frame with a color depth of 32 bits.
- *
- * The output frame will have the same packed format as the palette.
- *
- * @param src        source frame buffer
- * @param dst        destination frame buffer
- * @param num_pixels number of pixels to convert
- * @param palette    array with [256] entries, which must match color arrangement (RGB or BGR) of src
- */
-void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
-
-/**
- * Convert an 8-bit paletted frame into a frame with a color depth of 24 bits.
- *
- * With the palette format "ABCD", the destination frame ends up with the format "ABC".
- *
- * @param src        source frame buffer
- * @param dst        destination frame buffer
- * @param num_pixels number of pixels to convert
- * @param palette    array with [256] entries, which must match color arrangement (RGB or BGR) of src
- */
-void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
-
-/**
- * Get the AVClass for swsContext. It can be used in combination with
- * AV_OPT_SEARCH_FAKE_OBJ for examining options.
- *
- * @see av_opt_find().
- */
-const AVClass *sws_get_class(void);
-
-/**
- * @}
- */
-
-#endif /* SWSCALE_SWSCALE_H */
diff --git a/deps/libav/libswscale/swscale_internal.h b/deps/libav/libswscale/swscale_internal.h
deleted file mode 100644
index 5737724..0000000
--- a/deps/libav/libswscale/swscale_internal.h
+++ /dev/null
@@ -1,758 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWSCALE_SWSCALE_INTERNAL_H
-#define SWSCALE_SWSCALE_INTERNAL_H
-
-#include "config.h"
-
-#if HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-
-#include "libavutil/avassert.h"
-#include "libavutil/avutil.h"
-#include "libavutil/common.h"
-#include "libavutil/log.h"
-#include "libavutil/pixfmt.h"
-#include "libavutil/pixdesc.h"
-
-#define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
-
-#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
-
-#define MAX_FILTER_SIZE 256
-
-#if HAVE_BIGENDIAN
-#define ALT32_CORR (-1)
-#else
-#define ALT32_CORR   1
-#endif
-
-#if ARCH_X86_64
-#   define APCK_PTR2  8
-#   define APCK_COEF 16
-#   define APCK_SIZE 24
-#else
-#   define APCK_PTR2  4
-#   define APCK_COEF  8
-#   define APCK_SIZE 16
-#endif
-
-struct SwsContext;
-
-typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t *src[],
-                       int srcStride[], int srcSliceY, int srcSliceH,
-                       uint8_t *dst[], int dstStride[]);
-
-/**
- * Write one line of horizontally scaled data to planar output
- * without any additional vertical scaling (or point-scaling).
- *
- * @param src     scaled source data, 15bit for 8-10bit output,
- *                19-bit for 16bit output (in int32_t)
- * @param dest    pointer to the output plane. For >8bit
- *                output, this is in uint16_t
- * @param dstW    width of destination in pixels
- * @param dither  ordered dither array of type int16_t and size 8
- * @param offset  Dither offset
- */
-typedef void (*yuv2planar1_fn)(const int16_t *src, uint8_t *dest, int dstW,
-                               const uint8_t *dither, int offset);
-
-/**
- * Write one line of horizontally scaled data to planar output
- * with multi-point vertical scaling between input pixels.
- *
- * @param filter        vertical luma/alpha scaling coefficients, 12bit [0,4096]
- * @param src           scaled luma (Y) or alpha (A) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param filterSize    number of vertical input lines to scale
- * @param dest          pointer to output plane. For >8bit
- *                      output, this is in uint16_t
- * @param dstW          width of destination pixels
- * @param offset        Dither offset
- */
-typedef void (*yuv2planarX_fn)(const int16_t *filter, int filterSize,
-                               const int16_t **src, uint8_t *dest, int dstW,
-                               const uint8_t *dither, int offset);
-
-/**
- * Write one line of horizontally scaled chroma to interleaved output
- * with multi-point vertical scaling between input pixels.
- *
- * @param c             SWS scaling context
- * @param chrFilter     vertical chroma scaling coefficients, 12bit [0,4096]
- * @param chrUSrc       scaled chroma (U) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param chrVSrc       scaled chroma (V) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param chrFilterSize number of vertical chroma input lines to scale
- * @param dest          pointer to the output plane. For >8bit
- *                      output, this is in uint16_t
- * @param dstW          width of chroma planes
- */
-typedef void (*yuv2interleavedX_fn)(struct SwsContext *c,
-                                    const int16_t *chrFilter,
-                                    int chrFilterSize,
-                                    const int16_t **chrUSrc,
-                                    const int16_t **chrVSrc,
-                                    uint8_t *dest, int dstW);
-
-/**
- * Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
- * output without any additional vertical scaling (or point-scaling). Note
- * that this function may do chroma scaling, see the "uvalpha" argument.
- *
- * @param c       SWS scaling context
- * @param lumSrc  scaled luma (Y) source data, 15bit for 8-10bit output,
- *                19-bit for 16bit output (in int32_t)
- * @param chrUSrc scaled chroma (U) source data, 15bit for 8-10bit output,
- *                19-bit for 16bit output (in int32_t)
- * @param chrVSrc scaled chroma (V) source data, 15bit for 8-10bit output,
- *                19-bit for 16bit output (in int32_t)
- * @param alpSrc  scaled alpha (A) source data, 15bit for 8-10bit output,
- *                19-bit for 16bit output (in int32_t)
- * @param dest    pointer to the output plane. For 16bit output, this is
- *                uint16_t
- * @param dstW    width of lumSrc and alpSrc in pixels, number of pixels
- *                to write into dest[]
- * @param uvalpha chroma scaling coefficient for the second line of chroma
- *                pixels, either 2048 or 0. If 0, one chroma input is used
- *                for 2 output pixels (or if the SWS_FLAG_FULL_CHR_INT flag
- *                is set, it generates 1 output pixel). If 2048, two chroma
- *                input pixels should be averaged for 2 output pixels (this
- *                only happens if SWS_FLAG_FULL_CHR_INT is not set)
- * @param y       vertical line number for this output. This does not need
- *                to be used to calculate the offset in the destination,
- *                but can be used to generate comfort noise using dithering
- *                for some output formats.
- */
-typedef void (*yuv2packed1_fn)(struct SwsContext *c, const int16_t *lumSrc,
-                               const int16_t *chrUSrc[2],
-                               const int16_t *chrVSrc[2],
-                               const int16_t *alpSrc, uint8_t *dest,
-                               int dstW, int uvalpha, int y);
-/**
- * Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
- * output by doing bilinear scaling between two input lines.
- *
- * @param c       SWS scaling context
- * @param lumSrc  scaled luma (Y) source data, 15bit for 8-10bit output,
- *                19-bit for 16bit output (in int32_t)
- * @param chrUSrc scaled chroma (U) source data, 15bit for 8-10bit output,
- *                19-bit for 16bit output (in int32_t)
- * @param chrVSrc scaled chroma (V) source data, 15bit for 8-10bit output,
- *                19-bit for 16bit output (in int32_t)
- * @param alpSrc  scaled alpha (A) source data, 15bit for 8-10bit output,
- *                19-bit for 16bit output (in int32_t)
- * @param dest    pointer to the output plane. For 16bit output, this is
- *                uint16_t
- * @param dstW    width of lumSrc and alpSrc in pixels, number of pixels
- *                to write into dest[]
- * @param yalpha  luma/alpha scaling coefficients for the second input line.
- *                The first line's coefficients can be calculated by using
- *                4096 - yalpha
- * @param uvalpha chroma scaling coefficient for the second input line. The
- *                first line's coefficients can be calculated by using
- *                4096 - uvalpha
- * @param y       vertical line number for this output. This does not need
- *                to be used to calculate the offset in the destination,
- *                but can be used to generate comfort noise using dithering
- *                for some output formats.
- */
-typedef void (*yuv2packed2_fn)(struct SwsContext *c, const int16_t *lumSrc[2],
-                               const int16_t *chrUSrc[2],
-                               const int16_t *chrVSrc[2],
-                               const int16_t *alpSrc[2],
-                               uint8_t *dest,
-                               int dstW, int yalpha, int uvalpha, int y);
-/**
- * Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB
- * output by doing multi-point vertical scaling between input pixels.
- *
- * @param c             SWS scaling context
- * @param lumFilter     vertical luma/alpha scaling coefficients, 12bit [0,4096]
- * @param lumSrc        scaled luma (Y) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param lumFilterSize number of vertical luma/alpha input lines to scale
- * @param chrFilter     vertical chroma scaling coefficients, 12bit [0,4096]
- * @param chrUSrc       scaled chroma (U) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param chrVSrc       scaled chroma (V) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param chrFilterSize number of vertical chroma input lines to scale
- * @param alpSrc        scaled alpha (A) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param dest          pointer to the output plane. For 16bit output, this is
- *                      uint16_t
- * @param dstW          width of lumSrc and alpSrc in pixels, number of pixels
- *                      to write into dest[]
- * @param y             vertical line number for this output. This does not need
- *                      to be used to calculate the offset in the destination,
- *                      but can be used to generate comfort noise using dithering
- *                      or some output formats.
- */
-typedef void (*yuv2packedX_fn)(struct SwsContext *c, const int16_t *lumFilter,
-                               const int16_t **lumSrc, int lumFilterSize,
-                               const int16_t *chrFilter,
-                               const int16_t **chrUSrc,
-                               const int16_t **chrVSrc, int chrFilterSize,
-                               const int16_t **alpSrc, uint8_t *dest,
-                               int dstW, int y);
-
-/**
- * Write one line of horizontally scaled Y/U/V/A to YUV/RGB
- * output by doing multi-point vertical scaling between input pixels.
- *
- * @param c             SWS scaling context
- * @param lumFilter     vertical luma/alpha scaling coefficients, 12bit [0,4096]
- * @param lumSrc        scaled luma (Y) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param lumFilterSize number of vertical luma/alpha input lines to scale
- * @param chrFilter     vertical chroma scaling coefficients, 12bit [0,4096]
- * @param chrUSrc       scaled chroma (U) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param chrVSrc       scaled chroma (V) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param chrFilterSize number of vertical chroma input lines to scale
- * @param alpSrc        scaled alpha (A) source data, 15bit for 8-10bit output,
- *                      19-bit for 16bit output (in int32_t)
- * @param dest          pointer to the output planes. For 16bit output, this is
- *                      uint16_t
- * @param dstW          width of lumSrc and alpSrc in pixels, number of pixels
- *                      to write into dest[]
- * @param y             vertical line number for this output. This does not need
- *                      to be used to calculate the offset in the destination,
- *                      but can be used to generate comfort noise using dithering
- *                      or some output formats.
- */
-typedef void (*yuv2anyX_fn)(struct SwsContext *c, const int16_t *lumFilter,
-                            const int16_t **lumSrc, int lumFilterSize,
-                            const int16_t *chrFilter,
-                            const int16_t **chrUSrc,
-                            const int16_t **chrVSrc, int chrFilterSize,
-                            const int16_t **alpSrc, uint8_t **dest,
-                            int dstW, int y);
-
-/* This struct should be aligned on at least a 32-byte boundary. */
-typedef struct SwsContext {
-    /**
-     * info on struct for av_log
-     */
-    const AVClass *av_class;
-
-    /**
-     * Note that src, dst, srcStride, dstStride will be copied in the
-     * sws_scale() wrapper so they can be freely modified here.
-     */
-    SwsFunc swscale;
-    int srcW;                     ///< Width  of source      luma/alpha planes.
-    int srcH;                     ///< Height of source      luma/alpha planes.
-    int dstH;                     ///< Height of destination luma/alpha planes.
-    int chrSrcW;                  ///< Width  of source      chroma     planes.
-    int chrSrcH;                  ///< Height of source      chroma     planes.
-    int chrDstW;                  ///< Width  of destination chroma     planes.
-    int chrDstH;                  ///< Height of destination chroma     planes.
-    int lumXInc, chrXInc;
-    int lumYInc, chrYInc;
-    enum AVPixelFormat dstFormat; ///< Destination pixel format.
-    enum AVPixelFormat srcFormat; ///< Source      pixel format.
-    int dstFormatBpp;             ///< Number of bits per pixel of the destination pixel format.
-    int srcFormatBpp;             ///< Number of bits per pixel of the source      pixel format.
-    int dstBpc, srcBpc;
-    int chrSrcHSubSample;         ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source      image.
-    int chrSrcVSubSample;         ///< Binary logarithm of vertical   subsampling factor between luma/alpha and chroma planes in source      image.
-    int chrDstHSubSample;         ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in destination image.
-    int chrDstVSubSample;         ///< Binary logarithm of vertical   subsampling factor between luma/alpha and chroma planes in destination image.
-    int vChrDrop;                 ///< Binary logarithm of extra vertical subsampling factor in source image chroma planes specified by user.
-    int sliceDir;                 ///< Direction that slices are fed to the scaler (1 = top-to-bottom, -1 = bottom-to-top).
-    double param[2];              ///< Input parameters for scaling algorithms that need them.
-
-    uint32_t pal_yuv[256];
-    uint32_t pal_rgb[256];
-
-    /**
-     * @name Scaled horizontal lines ring buffer.
-     * The horizontal scaler keeps just enough scaled lines in a ring buffer
-     * so they may be passed to the vertical scaler. The pointers to the
-     * allocated buffers for each line are duplicated in sequence in the ring
-     * buffer to simplify indexing and avoid wrapping around between lines
-     * inside the vertical scaler code. The wrapping is done before the
-     * vertical scaler is called.
-     */
-    //@{
-    int16_t **lumPixBuf;          ///< Ring buffer for scaled horizontal luma   plane lines to be fed to the vertical scaler.
-    int16_t **chrUPixBuf;         ///< Ring buffer for scaled horizontal chroma plane lines to be fed to the vertical scaler.
-    int16_t **chrVPixBuf;         ///< Ring buffer for scaled horizontal chroma plane lines to be fed to the vertical scaler.
-    int16_t **alpPixBuf;          ///< Ring buffer for scaled horizontal alpha  plane lines to be fed to the vertical scaler.
-    int vLumBufSize;              ///< Number of vertical luma/alpha lines allocated in the ring buffer.
-    int vChrBufSize;              ///< Number of vertical chroma     lines allocated in the ring buffer.
-    int lastInLumBuf;             ///< Last scaled horizontal luma/alpha line from source in the ring buffer.
-    int lastInChrBuf;             ///< Last scaled horizontal chroma     line from source in the ring buffer.
-    int lumBufIndex;              ///< Index in ring buffer of the last scaled horizontal luma/alpha line from source.
-    int chrBufIndex;              ///< Index in ring buffer of the last scaled horizontal chroma     line from source.
-    //@}
-
-    uint8_t *formatConvBuffer;
-
-    /**
-     * @name Horizontal and vertical filters.
-     * To better understand the following fields, here is a pseudo-code of
-     * their usage in filtering a horizontal line:
-     * @code
-     * for (i = 0; i < width; i++) {
-     *     dst[i] = 0;
-     *     for (j = 0; j < filterSize; j++)
-     *         dst[i] += src[ filterPos[i] + j ] * filter[ filterSize * i + j ];
-     *     dst[i] >>= FRAC_BITS; // The actual implementation is fixed-point.
-     * }
-     * @endcode
-     */
-    //@{
-    int16_t *hLumFilter;          ///< Array of horizontal filter coefficients for luma/alpha planes.
-    int16_t *hChrFilter;          ///< Array of horizontal filter coefficients for chroma     planes.
-    int16_t *vLumFilter;          ///< Array of vertical   filter coefficients for luma/alpha planes.
-    int16_t *vChrFilter;          ///< Array of vertical   filter coefficients for chroma     planes.
-    int32_t *hLumFilterPos;       ///< Array of horizontal filter starting positions for each dst[i] for luma/alpha planes.
-    int32_t *hChrFilterPos;       ///< Array of horizontal filter starting positions for each dst[i] for chroma     planes.
-    int32_t *vLumFilterPos;       ///< Array of vertical   filter starting positions for each dst[i] for luma/alpha planes.
-    int32_t *vChrFilterPos;       ///< Array of vertical   filter starting positions for each dst[i] for chroma     planes.
-    int hLumFilterSize;           ///< Horizontal filter size for luma/alpha pixels.
-    int hChrFilterSize;           ///< Horizontal filter size for chroma     pixels.
-    int vLumFilterSize;           ///< Vertical   filter size for luma/alpha pixels.
-    int vChrFilterSize;           ///< Vertical   filter size for chroma     pixels.
-    //@}
-
-    int lumMmxextFilterCodeSize;  ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes.
-    int chrMmxextFilterCodeSize;  ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.
-    uint8_t *lumMmxextFilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.
-    uint8_t *chrMmxextFilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
-
-    int canMMXEXTBeUsed;
-
-    int dstY;                     ///< Last destination vertical line output from last slice.
-    int flags;                    ///< Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc...
-    void *yuvTable;             // pointer to the yuv->rgb table start so it can be freed()
-    uint8_t *table_rV[256];
-    uint8_t *table_gU[256];
-    int table_gV[256];
-    uint8_t *table_bU[256];
-
-    //Colorspace stuff
-    int contrast, brightness, saturation;    // for sws_getColorspaceDetails
-    int srcColorspaceTable[4];
-    int dstColorspaceTable[4];
-    int srcRange;                 ///< 0 = MPG YUV range, 1 = JPG YUV range (source      image).
-    int dstRange;                 ///< 0 = MPG YUV range, 1 = JPG YUV range (destination image).
-    int yuv2rgb_y_offset;
-    int yuv2rgb_y_coeff;
-    int yuv2rgb_v2r_coeff;
-    int yuv2rgb_v2g_coeff;
-    int yuv2rgb_u2g_coeff;
-    int yuv2rgb_u2b_coeff;
-
-#define RED_DITHER            "0*8"
-#define GREEN_DITHER          "1*8"
-#define BLUE_DITHER           "2*8"
-#define Y_COEFF               "3*8"
-#define VR_COEFF              "4*8"
-#define UB_COEFF              "5*8"
-#define VG_COEFF              "6*8"
-#define UG_COEFF              "7*8"
-#define Y_OFFSET              "8*8"
-#define U_OFFSET              "9*8"
-#define V_OFFSET              "10*8"
-#define LUM_MMX_FILTER_OFFSET "11*8"
-#define CHR_MMX_FILTER_OFFSET "11*8+4*4*256"
-#define DSTW_OFFSET           "11*8+4*4*256*2" //do not change, it is hardcoded in the ASM
-#define ESP_OFFSET            "11*8+4*4*256*2+8"
-#define VROUNDER_OFFSET       "11*8+4*4*256*2+16"
-#define U_TEMP                "11*8+4*4*256*2+24"
-#define V_TEMP                "11*8+4*4*256*2+32"
-#define Y_TEMP                "11*8+4*4*256*2+40"
-#define ALP_MMX_FILTER_OFFSET "11*8+4*4*256*2+48"
-#define UV_OFF_PX             "11*8+4*4*256*3+48"
-#define UV_OFF_BYTE           "11*8+4*4*256*3+56"
-#define DITHER16              "11*8+4*4*256*3+64"
-#define DITHER32              "11*8+4*4*256*3+80"
-
-    DECLARE_ALIGNED(8, uint64_t, redDither);
-    DECLARE_ALIGNED(8, uint64_t, greenDither);
-    DECLARE_ALIGNED(8, uint64_t, blueDither);
-
-    DECLARE_ALIGNED(8, uint64_t, yCoeff);
-    DECLARE_ALIGNED(8, uint64_t, vrCoeff);
-    DECLARE_ALIGNED(8, uint64_t, ubCoeff);
-    DECLARE_ALIGNED(8, uint64_t, vgCoeff);
-    DECLARE_ALIGNED(8, uint64_t, ugCoeff);
-    DECLARE_ALIGNED(8, uint64_t, yOffset);
-    DECLARE_ALIGNED(8, uint64_t, uOffset);
-    DECLARE_ALIGNED(8, uint64_t, vOffset);
-    int32_t lumMmxFilter[4 * MAX_FILTER_SIZE];
-    int32_t chrMmxFilter[4 * MAX_FILTER_SIZE];
-    int dstW;                     ///< Width  of destination luma/alpha planes.
-    DECLARE_ALIGNED(8, uint64_t, esp);
-    DECLARE_ALIGNED(8, uint64_t, vRounder);
-    DECLARE_ALIGNED(8, uint64_t, u_temp);
-    DECLARE_ALIGNED(8, uint64_t, v_temp);
-    DECLARE_ALIGNED(8, uint64_t, y_temp);
-    int32_t alpMmxFilter[4 * MAX_FILTER_SIZE];
-    // alignment of these values is not necessary, but merely here
-    // to maintain the same offset across x8632 and x86-64. Once we
-    // use proper offset macros in the asm, they can be removed.
-    DECLARE_ALIGNED(8, ptrdiff_t, uv_off_px);   ///< offset (in pixels) between u and v planes
-    DECLARE_ALIGNED(8, ptrdiff_t, uv_off_byte); ///< offset (in bytes) between u and v planes
-    DECLARE_ALIGNED(8, uint16_t, dither16)[8];
-    DECLARE_ALIGNED(8, uint32_t, dither32)[8];
-
-    const uint8_t *chrDither8, *lumDither8;
-
-#if HAVE_ALTIVEC
-    vector signed short   CY;
-    vector signed short   CRV;
-    vector signed short   CBU;
-    vector signed short   CGU;
-    vector signed short   CGV;
-    vector signed short   OY;
-    vector unsigned short CSHIFT;
-    vector signed short  *vYCoeffsBank, *vCCoeffsBank;
-#endif
-
-#if ARCH_BFIN
-    DECLARE_ALIGNED(4, uint32_t, oy);
-    DECLARE_ALIGNED(4, uint32_t, oc);
-    DECLARE_ALIGNED(4, uint32_t, zero);
-    DECLARE_ALIGNED(4, uint32_t, cy);
-    DECLARE_ALIGNED(4, uint32_t, crv);
-    DECLARE_ALIGNED(4, uint32_t, rmask);
-    DECLARE_ALIGNED(4, uint32_t, cbu);
-    DECLARE_ALIGNED(4, uint32_t, bmask);
-    DECLARE_ALIGNED(4, uint32_t, cgu);
-    DECLARE_ALIGNED(4, uint32_t, cgv);
-    DECLARE_ALIGNED(4, uint32_t, gmask);
-#endif
-
-#if HAVE_VIS
-    DECLARE_ALIGNED(8, uint64_t, sparc_coeffs)[10];
-#endif
-
-    /* function pointers for swscale() */
-    yuv2planar1_fn yuv2plane1;
-    yuv2planarX_fn yuv2planeX;
-    yuv2interleavedX_fn yuv2nv12cX;
-    yuv2packed1_fn yuv2packed1;
-    yuv2packed2_fn yuv2packed2;
-    yuv2packedX_fn yuv2packedX;
-    yuv2anyX_fn yuv2anyX;
-
-    /// Unscaled conversion of luma plane to YV12 for horizontal scaler.
-    void (*lumToYV12)(uint8_t *dst, const uint8_t *src,
-                      int width, uint32_t *pal);
-    /// Unscaled conversion of alpha plane to YV12 for horizontal scaler.
-    void (*alpToYV12)(uint8_t *dst, const uint8_t *src,
-                      int width, uint32_t *pal);
-    /// Unscaled conversion of chroma planes to YV12 for horizontal scaler.
-    void (*chrToYV12)(uint8_t *dstU, uint8_t *dstV,
-                      const uint8_t *src1, const uint8_t *src2,
-                      int width, uint32_t *pal);
-
-    /**
-     * Functions to read planar input, such as planar RGB, and convert
-     * internally to Y/UV.
-     */
-    /** @{ */
-    void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width);
-    void (*readChrPlanar)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4],
-                          int width);
-    /** @} */
-
-    /**
-     * Scale one horizontal line of input data using a bilinear filter
-     * to produce one line of output data. Compared to SwsContext->hScale(),
-     * please take note of the following caveats when using these:
-     * - Scaling is done using only 7bit instead of 14bit coefficients.
-     * - You can use no more than 5 input pixels to produce 4 output
-     *   pixels. Therefore, this filter should not be used for downscaling
-     *   by more than ~20% in width (because that equals more than 5/4th
-     *   downscaling and thus more than 5 pixels input per 4 pixels output).
-     * - In general, bilinear filters create artifacts during downscaling
-     *   (even when <20%), because one output pixel will span more than one
-     *   input pixel, and thus some pixels will need edges of both neighbor
-     *   pixels to interpolate the output pixel. Since you can use at most
-     *   two input pixels per output pixel in bilinear scaling, this is
-     *   impossible and thus downscaling by any size will create artifacts.
-     * To enable this type of scaling, set SWS_FLAG_FAST_BILINEAR
-     * in SwsContext->flags.
-     */
-    /** @{ */
-    void (*hyscale_fast)(struct SwsContext *c,
-                         int16_t *dst, int dstWidth,
-                         const uint8_t *src, int srcW, int xInc);
-    void (*hcscale_fast)(struct SwsContext *c,
-                         int16_t *dst1, int16_t *dst2, int dstWidth,
-                         const uint8_t *src1, const uint8_t *src2,
-                         int srcW, int xInc);
-    /** @} */
-
-    /**
-     * Scale one horizontal line of input data using a filter over the input
-     * lines, to produce one (differently sized) line of output data.
-     *
-     * @param dst        pointer to destination buffer for horizontally scaled
-     *                   data. If the number of bits per component of one
-     *                   destination pixel (SwsContext->dstBpc) is <= 10, data
-     *                   will be 15bpc in 16bits (int16_t) width. Else (i.e.
-     *                   SwsContext->dstBpc == 16), data will be 19bpc in
-     *                   32bits (int32_t) width.
-     * @param dstW       width of destination image
-     * @param src        pointer to source data to be scaled. If the number of
-     *                   bits per component of a source pixel (SwsContext->srcBpc)
-     *                   is 8, this is 8bpc in 8bits (uint8_t) width. Else
-     *                   (i.e. SwsContext->dstBpc > 8), this is native depth
-     *                   in 16bits (uint16_t) width. In other words, for 9-bit
-     *                   YUV input, this is 9bpc, for 10-bit YUV input, this is
-     *                   10bpc, and for 16-bit RGB or YUV, this is 16bpc.
-     * @param filter     filter coefficients to be used per output pixel for
-     *                   scaling. This contains 14bpp filtering coefficients.
-     *                   Guaranteed to contain dstW * filterSize entries.
-     * @param filterPos  position of the first input pixel to be used for
-     *                   each output pixel during scaling. Guaranteed to
-     *                   contain dstW entries.
-     * @param filterSize the number of input coefficients to be used (and
-     *                   thus the number of input pixels to be used) for
-     *                   creating a single output pixel. Is aligned to 4
-     *                   (and input coefficients thus padded with zeroes)
-     *                   to simplify creating SIMD code.
-     */
-    /** @{ */
-    void (*hyScale)(struct SwsContext *c, int16_t *dst, int dstW,
-                    const uint8_t *src, const int16_t *filter,
-                    const int32_t *filterPos, int filterSize);
-    void (*hcScale)(struct SwsContext *c, int16_t *dst, int dstW,
-                    const uint8_t *src, const int16_t *filter,
-                    const int32_t *filterPos, int filterSize);
-    /** @} */
-
-    /// Color range conversion function for luma plane if needed.
-    void (*lumConvertRange)(int16_t *dst, int width);
-    /// Color range conversion function for chroma planes if needed.
-    void (*chrConvertRange)(int16_t *dst1, int16_t *dst2, int width);
-
-    int needs_hcscale; ///< Set if there are chroma planes to be converted.
-} SwsContext;
-//FIXME check init (where 0)
-
-SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c);
-int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
-                             int fullRange, int brightness,
-                             int contrast, int saturation);
-void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4],
-                                int brightness, int contrast, int saturation);
-
-void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex,
-                           int lastInLumBuf, int lastInChrBuf);
-
-SwsFunc ff_yuv2rgb_init_x86(SwsContext *c);
-SwsFunc ff_yuv2rgb_init_vis(SwsContext *c);
-SwsFunc ff_yuv2rgb_init_ppc(SwsContext *c);
-SwsFunc ff_yuv2rgb_init_bfin(SwsContext *c);
-
-const char *sws_format_name(enum AVPixelFormat format);
-
-static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return desc->comp[0].depth_minus1 == 15;
-}
-
-static av_always_inline int is9_OR_10BPS(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return desc->comp[0].depth_minus1 == 8 || desc->comp[0].depth_minus1 == 9;
-}
-
-static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return desc->flags & AV_PIX_FMT_FLAG_BE;
-}
-
-static av_always_inline int isYUV(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2;
-}
-
-static av_always_inline int isPlanarYUV(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return ((desc->flags & AV_PIX_FMT_FLAG_PLANAR) && isYUV(pix_fmt));
-}
-
-static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return (desc->flags & AV_PIX_FMT_FLAG_RGB);
-}
-
-#if 0 // FIXME
-#define isGray(x) \
-    (!(av_pix_fmt_descriptors[x].flags & AV_PIX_FMT_FLAG_PAL) && \
-     av_pix_fmt_descriptors[x].nb_components <= 2)
-#else
-#define isGray(x)                      \
-    ((x) == AV_PIX_FMT_GRAY8       ||  \
-     (x) == AV_PIX_FMT_Y400A       ||  \
-     (x) == AV_PIX_FMT_GRAY16BE    ||  \
-     (x) == AV_PIX_FMT_GRAY16LE)
-#endif
-
-#define isRGBinInt(x)                  \
-    ((x) == AV_PIX_FMT_RGB48BE     ||  \
-     (x) == AV_PIX_FMT_RGB48LE     ||  \
-     (x) == AV_PIX_FMT_RGB32       ||  \
-     (x) == AV_PIX_FMT_RGB32_1     ||  \
-     (x) == AV_PIX_FMT_RGB24       ||  \
-     (x) == AV_PIX_FMT_RGB565BE    ||  \
-     (x) == AV_PIX_FMT_RGB565LE    ||  \
-     (x) == AV_PIX_FMT_RGB555BE    ||  \
-     (x) == AV_PIX_FMT_RGB555LE    ||  \
-     (x) == AV_PIX_FMT_RGB444BE    ||  \
-     (x) == AV_PIX_FMT_RGB444LE    ||  \
-     (x) == AV_PIX_FMT_RGB8        ||  \
-     (x) == AV_PIX_FMT_RGB4        ||  \
-     (x) == AV_PIX_FMT_RGB4_BYTE   ||  \
-     (x) == AV_PIX_FMT_MONOBLACK   ||  \
-     (x) == AV_PIX_FMT_MONOWHITE)
-
-#define isBGRinInt(x)                  \
-    ((x) == AV_PIX_FMT_BGR48BE     ||  \
-     (x) == AV_PIX_FMT_BGR48LE     ||  \
-     (x) == AV_PIX_FMT_BGR32       ||  \
-     (x) == AV_PIX_FMT_BGR32_1     ||  \
-     (x) == AV_PIX_FMT_BGR24       ||  \
-     (x) == AV_PIX_FMT_BGR565BE    ||  \
-     (x) == AV_PIX_FMT_BGR565LE    ||  \
-     (x) == AV_PIX_FMT_BGR555BE    ||  \
-     (x) == AV_PIX_FMT_BGR555LE    ||  \
-     (x) == AV_PIX_FMT_BGR444BE    ||  \
-     (x) == AV_PIX_FMT_BGR444LE    ||  \
-     (x) == AV_PIX_FMT_BGR8        ||  \
-     (x) == AV_PIX_FMT_BGR4        ||  \
-     (x) == AV_PIX_FMT_BGR4_BYTE   ||  \
-     (x) == AV_PIX_FMT_MONOBLACK   ||  \
-     (x) == AV_PIX_FMT_MONOWHITE)
-
-#define isAnyRGB(x)                    \
-    (isRGBinInt(x)              ||     \
-     isBGRinInt(x))
-
-static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return desc->nb_components == 2 || desc->nb_components == 4;
-}
-
-static av_always_inline int isPacked(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return ((desc->nb_components >= 2 && !(desc->flags & AV_PIX_FMT_FLAG_PLANAR)) ||
-            pix_fmt == AV_PIX_FMT_PAL8);
-}
-
-static av_always_inline int isPlanar(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return (desc->nb_components >= 2 && (desc->flags & AV_PIX_FMT_FLAG_PLANAR));
-}
-
-static av_always_inline int isPackedRGB(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return ((desc->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) == AV_PIX_FMT_FLAG_RGB);
-}
-
-static av_always_inline int isPlanarRGB(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return ((desc->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) ==
-            (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB));
-}
-
-static av_always_inline int usePal(enum AVPixelFormat pix_fmt)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    av_assert0(desc);
-    return ((desc->flags & AV_PIX_FMT_FLAG_PAL) || (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) ||
-            pix_fmt == AV_PIX_FMT_Y400A);
-}
-
-extern const uint64_t ff_dither4[2];
-extern const uint64_t ff_dither8[2];
-
-extern const uint8_t ff_dither_4x4_16[4][8];
-extern const uint8_t ff_dither_8x8_32[8][8];
-extern const uint8_t ff_dither_8x8_73[8][8];
-extern const uint8_t ff_dither_8x8_128[8][8];
-extern const uint8_t ff_dither_8x8_220[8][8];
-
-extern const int32_t ff_yuv2rgb_coeffs[8][4];
-
-extern const AVClass sws_context_class;
-
-/**
- * Set c->swscale to an unscaled converter if one exists for the specific
- * source and destination formats, bit depths, flags, etc.
- */
-void ff_get_unscaled_swscale(SwsContext *c);
-void ff_get_unscaled_swscale_bfin(SwsContext *c);
-void ff_get_unscaled_swscale_ppc(SwsContext *c);
-
-/**
- * Return function pointer to fastest main scaler path function depending
- * on architecture and available optimizations.
- */
-SwsFunc ff_getSwsFunc(SwsContext *c);
-
-void ff_sws_init_input_funcs(SwsContext *c);
-void ff_sws_init_output_funcs(SwsContext *c,
-                              yuv2planar1_fn *yuv2plane1,
-                              yuv2planarX_fn *yuv2planeX,
-                              yuv2interleavedX_fn *yuv2nv12cX,
-                              yuv2packed1_fn *yuv2packed1,
-                              yuv2packed2_fn *yuv2packed2,
-                              yuv2packedX_fn *yuv2packedX,
-                              yuv2anyX_fn *yuv2anyX);
-void ff_sws_init_swscale_ppc(SwsContext *c);
-void ff_sws_init_swscale_x86(SwsContext *c);
-
-#endif /* SWSCALE_SWSCALE_INTERNAL_H */
diff --git a/deps/libav/libswscale/swscale_unscaled.c b/deps/libav/libswscale/swscale_unscaled.c
deleted file mode 100644
index 61f0d47..0000000
--- a/deps/libav/libswscale/swscale_unscaled.c
+++ /dev/null
@@ -1,1318 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-#include <string.h>
-#include <math.h>
-#include <stdio.h>
-#include "config.h"
-#include <assert.h>
-#include "swscale.h"
-#include "swscale_internal.h"
-#include "rgb2rgb.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/cpu.h"
-#include "libavutil/avutil.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/bswap.h"
-#include "libavutil/pixdesc.h"
-
-DECLARE_ALIGNED(8, static const uint8_t, dither_8x8_1)[8][8] = {
-    {   0,  1,  0,  1,  0,  1,  0,  1,},
-    {   1,  0,  1,  0,  1,  0,  1,  0,},
-    {   0,  1,  0,  1,  0,  1,  0,  1,},
-    {   1,  0,  1,  0,  1,  0,  1,  0,},
-    {   0,  1,  0,  1,  0,  1,  0,  1,},
-    {   1,  0,  1,  0,  1,  0,  1,  0,},
-    {   0,  1,  0,  1,  0,  1,  0,  1,},
-    {   1,  0,  1,  0,  1,  0,  1,  0,},
-};
-DECLARE_ALIGNED(8, static const uint8_t, dither_8x8_3)[8][8] = {
-    {   1,  2,  1,  2,  1,  2,  1,  2,},
-    {   3,  0,  3,  0,  3,  0,  3,  0,},
-    {   1,  2,  1,  2,  1,  2,  1,  2,},
-    {   3,  0,  3,  0,  3,  0,  3,  0,},
-    {   1,  2,  1,  2,  1,  2,  1,  2,},
-    {   3,  0,  3,  0,  3,  0,  3,  0,},
-    {   1,  2,  1,  2,  1,  2,  1,  2,},
-    {   3,  0,  3,  0,  3,  0,  3,  0,},
-};
-DECLARE_ALIGNED(8, static const uint8_t, dither_8x8_64)[8][8] = {
-    {  18, 34, 30, 46, 17, 33, 29, 45,},
-    {  50,  2, 62, 14, 49,  1, 61, 13,},
-    {  26, 42, 22, 38, 25, 41, 21, 37,},
-    {  58, 10, 54,  6, 57,  9, 53,  5,},
-    {  16, 32, 28, 44, 19, 35, 31, 47,},
-    {  48,  0, 60, 12, 51,  3, 63, 15,},
-    {  24, 40, 20, 36, 27, 43, 23, 39,},
-    {  56,  8, 52,  4, 59, 11, 55,  7,},
-};
-DECLARE_ALIGNED(8, static const uint8_t, dither_8x8_256)[8][8] = {
-    {  72, 136, 120, 184,  68, 132, 116, 180,},
-    { 200,   8, 248,  56, 196,   4, 244,  52,},
-    { 104, 168,  88, 152, 100, 164,  84, 148,},
-    { 232,  40, 216,  24, 228,  36, 212,  20,},
-    {  64, 128, 102, 176,  76, 140, 124, 188,},
-    { 192,   0, 240,  48, 204,  12, 252,  60,},
-    {  96, 160,  80, 144, 108, 172,  92, 156,},
-    { 224,  32, 208,  16, 236,  44, 220,  28,},
-};
-
-#define RGB2YUV_SHIFT 15
-#define BY ( (int) (0.114 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define BV (-(int) (0.081 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define BU ( (int) (0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define GY ( (int) (0.587 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define GV (-(int) (0.419 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define GU (-(int) (0.331 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define RY ( (int) (0.299 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define RV ( (int) (0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-#define RU (-(int) (0.169 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5))
-
-static void fillPlane(uint8_t *plane, int stride, int width, int height, int y,
-                      uint8_t val)
-{
-    int i;
-    uint8_t *ptr = plane + stride * y;
-    for (i = 0; i < height; i++) {
-        memset(ptr, val, width);
-        ptr += stride;
-    }
-}
-
-static void fill_plane9or10(uint8_t *plane, int stride, int width,
-                            int height, int y, uint8_t val,
-                            const int dst_depth, const int big_endian)
-{
-    int i, j;
-    uint16_t *dst = (uint16_t *) (plane + stride * y);
-#define FILL8TO9_OR_10(wfunc) \
-    for (i = 0; i < height; i++) { \
-        for (j = 0; j < width; j++) { \
-            wfunc(&dst[j], (val << (dst_depth - 8)) |  \
-                               (val >> (16 - dst_depth))); \
-        } \
-        dst += stride / 2; \
-    }
-    if (big_endian) {
-        FILL8TO9_OR_10(AV_WB16);
-    } else {
-        FILL8TO9_OR_10(AV_WL16);
-    }
-}
-
-static void copyPlane(const uint8_t *src, int srcStride,
-                      int srcSliceY, int srcSliceH, int width,
-                      uint8_t *dst, int dstStride)
-{
-    dst += dstStride * srcSliceY;
-    if (dstStride == srcStride && srcStride > 0) {
-        memcpy(dst, src, srcSliceH * dstStride);
-    } else {
-        int i;
-        for (i = 0; i < srcSliceH; i++) {
-            memcpy(dst, src, width);
-            src += srcStride;
-            dst += dstStride;
-        }
-    }
-}
-
-static int planarToNv12Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY,
-                               int srcSliceH, uint8_t *dstParam[],
-                               int dstStride[])
-{
-    uint8_t *dst = dstParam[1] + dstStride[1] * srcSliceY / 2;
-
-    copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
-              dstParam[0], dstStride[0]);
-
-    if (c->dstFormat == AV_PIX_FMT_NV12)
-        interleaveBytes(src[1], src[2], dst, c->srcW / 2, srcSliceH / 2,
-                        srcStride[1], srcStride[2], dstStride[1]);
-    else
-        interleaveBytes(src[2], src[1], dst, c->srcW / 2, srcSliceH / 2,
-                        srcStride[2], srcStride[1], dstStride[1]);
-
-    return srcSliceH;
-}
-
-static int nv12ToPlanarWrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY,
-                               int srcSliceH, uint8_t *dstParam[],
-                               int dstStride[])
-{
-    uint8_t *dst1 = dstParam[1] + dstStride[1] * srcSliceY / 2;
-    uint8_t *dst2 = dstParam[2] + dstStride[2] * srcSliceY / 2;
-
-    copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
-              dstParam[0], dstStride[0]);
-
-    if (c->srcFormat == AV_PIX_FMT_NV12)
-        deinterleaveBytes(src[1], dst1, dst2,c->srcW / 2, srcSliceH / 2,
-                          srcStride[1], dstStride[1], dstStride[2]);
-    else
-        deinterleaveBytes(src[1], dst2, dst1, c->srcW / 2, srcSliceH / 2,
-                          srcStride[1], dstStride[2], dstStride[1]);
-
-    return srcSliceH;
-}
-
-static int planarToYuy2Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
-{
-    uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY;
-
-    yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0],
-               srcStride[1], dstStride[0]);
-
-    return srcSliceH;
-}
-
-static int planarToUyvyWrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
-{
-    uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY;
-
-    yv12touyvy(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0],
-               srcStride[1], dstStride[0]);
-
-    return srcSliceH;
-}
-
-static int yuv422pToYuy2Wrapper(SwsContext *c, const uint8_t *src[],
-                                int srcStride[], int srcSliceY, int srcSliceH,
-                                uint8_t *dstParam[], int dstStride[])
-{
-    uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY;
-
-    yuv422ptoyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0],
-                  srcStride[1], dstStride[0]);
-
-    return srcSliceH;
-}
-
-static int yuv422pToUyvyWrapper(SwsContext *c, const uint8_t *src[],
-                                int srcStride[], int srcSliceY, int srcSliceH,
-                                uint8_t *dstParam[], int dstStride[])
-{
-    uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY;
-
-    yuv422ptouyvy(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0],
-                  srcStride[1], dstStride[0]);
-
-    return srcSliceH;
-}
-
-static int yuyvToYuv420Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
-{
-    uint8_t *ydst = dstParam[0] + dstStride[0] * srcSliceY;
-    uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY / 2;
-    uint8_t *vdst = dstParam[2] + dstStride[2] * srcSliceY / 2;
-
-    yuyvtoyuv420(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0],
-                 dstStride[1], srcStride[0]);
-
-    if (dstParam[3])
-        fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);
-
-    return srcSliceH;
-}
-
-static int yuyvToYuv422Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
-{
-    uint8_t *ydst = dstParam[0] + dstStride[0] * srcSliceY;
-    uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY;
-    uint8_t *vdst = dstParam[2] + dstStride[2] * srcSliceY;
-
-    yuyvtoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0],
-                 dstStride[1], srcStride[0]);
-
-    return srcSliceH;
-}
-
-static int uyvyToYuv420Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
-{
-    uint8_t *ydst = dstParam[0] + dstStride[0] * srcSliceY;
-    uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY / 2;
-    uint8_t *vdst = dstParam[2] + dstStride[2] * srcSliceY / 2;
-
-    uyvytoyuv420(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0],
-                 dstStride[1], srcStride[0]);
-
-    if (dstParam[3])
-        fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);
-
-    return srcSliceH;
-}
-
-static int uyvyToYuv422Wrapper(SwsContext *c, const uint8_t *src[],
-                               int srcStride[], int srcSliceY, int srcSliceH,
-                               uint8_t *dstParam[], int dstStride[])
-{
-    uint8_t *ydst = dstParam[0] + dstStride[0] * srcSliceY;
-    uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY;
-    uint8_t *vdst = dstParam[2] + dstStride[2] * srcSliceY;
-
-    uyvytoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0],
-                 dstStride[1], srcStride[0]);
-
-    return srcSliceH;
-}
-
-static void gray8aToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels,
-                             const uint8_t *palette)
-{
-    int i;
-    for (i = 0; i < num_pixels; i++)
-        ((uint32_t *) dst)[i] = ((const uint32_t *) palette)[src[i << 1]] | (src[(i << 1) + 1] << 24);
-}
-
-static void gray8aToPacked32_1(const uint8_t *src, uint8_t *dst, int num_pixels,
-                               const uint8_t *palette)
-{
-    int i;
-
-    for (i = 0; i < num_pixels; i++)
-        ((uint32_t *) dst)[i] = ((const uint32_t *) palette)[src[i << 1]] | src[(i << 1) + 1];
-}
-
-static void gray8aToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels,
-                             const uint8_t *palette)
-{
-    int i;
-
-    for (i = 0; i < num_pixels; i++) {
-        //FIXME slow?
-        dst[0] = palette[src[i << 1] * 4 + 0];
-        dst[1] = palette[src[i << 1] * 4 + 1];
-        dst[2] = palette[src[i << 1] * 4 + 2];
-        dst += 3;
-    }
-}
-
-static int packed_16bpc_bswap(SwsContext *c, const uint8_t *src[],
-                              int srcStride[], int srcSliceY, int srcSliceH,
-                              uint8_t *dst[], int dstStride[])
-{
-    int i, j;
-    int srcstr = srcStride[0] >> 1;
-    int dststr = dstStride[0] >> 1;
-    uint16_t       *dstPtr =       (uint16_t *) dst[0];
-    const uint16_t *srcPtr = (const uint16_t *) src[0];
-    int min_stride         = FFMIN(srcstr, dststr);
-
-    for (i = 0; i < srcSliceH; i++) {
-        for (j = 0; j < min_stride; j++) {
-            dstPtr[j] = av_bswap16(srcPtr[j]);
-        }
-        srcPtr += srcstr;
-        dstPtr += dststr;
-    }
-
-    return srcSliceH;
-}
-
-static int palToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
-                           int srcSliceY, int srcSliceH, uint8_t *dst[],
-                           int dstStride[])
-{
-    const enum AVPixelFormat srcFormat = c->srcFormat;
-    const enum AVPixelFormat dstFormat = c->dstFormat;
-    void (*conv)(const uint8_t *src, uint8_t *dst, int num_pixels,
-                 const uint8_t *palette) = NULL;
-    int i;
-    uint8_t *dstPtr = dst[0] + dstStride[0] * srcSliceY;
-    const uint8_t *srcPtr = src[0];
-
-    if (srcFormat == AV_PIX_FMT_Y400A) {
-        switch (dstFormat) {
-        case AV_PIX_FMT_RGB32  : conv = gray8aToPacked32; break;
-        case AV_PIX_FMT_BGR32  : conv = gray8aToPacked32; break;
-        case AV_PIX_FMT_BGR32_1: conv = gray8aToPacked32_1; break;
-        case AV_PIX_FMT_RGB32_1: conv = gray8aToPacked32_1; break;
-        case AV_PIX_FMT_RGB24  : conv = gray8aToPacked24; break;
-        case AV_PIX_FMT_BGR24  : conv = gray8aToPacked24; break;
-        }
-    } else if (usePal(srcFormat)) {
-        switch (dstFormat) {
-        case AV_PIX_FMT_RGB32  : conv = sws_convertPalette8ToPacked32; break;
-        case AV_PIX_FMT_BGR32  : conv = sws_convertPalette8ToPacked32; break;
-        case AV_PIX_FMT_BGR32_1: conv = sws_convertPalette8ToPacked32; break;
-        case AV_PIX_FMT_RGB32_1: conv = sws_convertPalette8ToPacked32; break;
-        case AV_PIX_FMT_RGB24  : conv = sws_convertPalette8ToPacked24; break;
-        case AV_PIX_FMT_BGR24  : conv = sws_convertPalette8ToPacked24; break;
-        }
-    }
-
-    if (!conv)
-        av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
-               sws_format_name(srcFormat), sws_format_name(dstFormat));
-    else {
-        for (i = 0; i < srcSliceH; i++) {
-            conv(srcPtr, dstPtr, c->srcW, (uint8_t *) c->pal_rgb);
-            srcPtr += srcStride[0];
-            dstPtr += dstStride[0];
-        }
-    }
-
-    return srcSliceH;
-}
-
-static void gbr24ptopacked24(const uint8_t *src[], int srcStride[],
-                             uint8_t *dst, int dstStride, int srcSliceH,
-                             int width)
-{
-    int x, h, i;
-    for (h = 0; h < srcSliceH; h++) {
-        uint8_t *dest = dst + dstStride * h;
-        for (x = 0; x < width; x++) {
-            *dest++ = src[0][x];
-            *dest++ = src[1][x];
-            *dest++ = src[2][x];
-        }
-
-        for (i = 0; i < 3; i++)
-            src[i] += srcStride[i];
-    }
-}
-
-static void gbr24ptopacked32(const uint8_t *src[], int srcStride[],
-                             uint8_t *dst, int dstStride, int srcSliceH,
-                             int alpha_first, int width)
-{
-    int x, h, i;
-    for (h = 0; h < srcSliceH; h++) {
-        uint8_t *dest = dst + dstStride * h;
-
-        if (alpha_first) {
-            for (x = 0; x < width; x++) {
-                *dest++ = 0xff;
-                *dest++ = src[0][x];
-                *dest++ = src[1][x];
-                *dest++ = src[2][x];
-            }
-        } else {
-            for (x = 0; x < width; x++) {
-                *dest++ = src[0][x];
-                *dest++ = src[1][x];
-                *dest++ = src[2][x];
-                *dest++ = 0xff;
-            }
-        }
-
-        for (i = 0; i < 3; i++)
-            src[i] += srcStride[i];
-    }
-}
-
-static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
-                                 int srcStride[], int srcSliceY, int srcSliceH,
-                                 uint8_t *dst[], int dstStride[])
-{
-    int alpha_first = 0;
-    const uint8_t *src102[] = { src[1], src[0], src[2] };
-    const uint8_t *src201[] = { src[2], src[0], src[1] };
-    int stride102[] = { srcStride[1], srcStride[0], srcStride[2] };
-    int stride201[] = { srcStride[2], srcStride[0], srcStride[1] };
-
-    if (c->srcFormat != AV_PIX_FMT_GBRP) {
-        av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",
-               av_get_pix_fmt_name(c->srcFormat),
-               av_get_pix_fmt_name(c->dstFormat));
-        return srcSliceH;
-    }
-
-    switch (c->dstFormat) {
-    case AV_PIX_FMT_BGR24:
-        gbr24ptopacked24(src102, stride102,
-                         dst[0] + srcSliceY * dstStride[0], dstStride[0],
-                         srcSliceH, c->srcW);
-        break;
-
-    case AV_PIX_FMT_RGB24:
-        gbr24ptopacked24(src201, stride201,
-                         dst[0] + srcSliceY * dstStride[0], dstStride[0],
-                         srcSliceH, c->srcW);
-        break;
-
-    case AV_PIX_FMT_ARGB:
-        alpha_first = 1;
-    case AV_PIX_FMT_RGBA:
-        gbr24ptopacked32(src201, stride201,
-                         dst[0] + srcSliceY * dstStride[0], dstStride[0],
-                         srcSliceH, alpha_first, c->srcW);
-        break;
-
-    case AV_PIX_FMT_ABGR:
-        alpha_first = 1;
-    case AV_PIX_FMT_BGRA:
-        gbr24ptopacked32(src102, stride102,
-                         dst[0] + srcSliceY * dstStride[0], dstStride[0],
-                         srcSliceH, alpha_first, c->srcW);
-        break;
-
-    default:
-        av_log(c, AV_LOG_ERROR,
-               "unsupported planar RGB conversion %s -> %s\n",
-               av_get_pix_fmt_name(c->srcFormat),
-               av_get_pix_fmt_name(c->dstFormat));
-    }
-
-    return srcSliceH;
-}
-
-static void packedtogbr24p(const uint8_t *src, int srcStride,
-                           uint8_t *dst[], int dstStride[], int srcSliceH,
-                           int alpha_first, int inc_size, int width)
-{
-    uint8_t *dest[3];
-    int x, h;
-
-    dest[0] = dst[0];
-    dest[1] = dst[1];
-    dest[2] = dst[2];
-
-    if (alpha_first)
-        src++;
-
-    for (h = 0; h < srcSliceH; h++) {
-        for (x = 0; x < width; x++) {
-            dest[0][x] = src[0];
-            dest[1][x] = src[1];
-            dest[2][x] = src[2];
-
-            src += inc_size;
-        }
-        src     += srcStride - width * inc_size;
-        dest[0] += dstStride[0];
-        dest[1] += dstStride[1];
-        dest[2] += dstStride[2];
-    }
-}
-
-static int rgbToPlanarRgbWrapper(SwsContext *c, const uint8_t *src[],
-                                 int srcStride[], int srcSliceY, int srcSliceH,
-                                 uint8_t *dst[], int dstStride[])
-{
-    int alpha_first = 0;
-    int stride102[] = { dstStride[1], dstStride[0], dstStride[2] };
-    int stride201[] = { dstStride[2], dstStride[0], dstStride[1] };
-    uint8_t *dst102[] = { dst[1] + srcSliceY * dstStride[1],
-                          dst[0] + srcSliceY * dstStride[0],
-                          dst[2] + srcSliceY * dstStride[2] };
-    uint8_t *dst201[] = { dst[2] + srcSliceY * dstStride[2],
-                          dst[0] + srcSliceY * dstStride[0],
-                          dst[1] + srcSliceY * dstStride[1] };
-
-    switch (c->srcFormat) {
-    case AV_PIX_FMT_RGB24:
-        packedtogbr24p((const uint8_t *) src[0], srcStride[0], dst201,
-                       stride201, srcSliceH, alpha_first, 3, c->srcW);
-        break;
-    case AV_PIX_FMT_BGR24:
-        packedtogbr24p((const uint8_t *) src[0], srcStride[0], dst102,
-                       stride102, srcSliceH, alpha_first, 3, c->srcW);
-        break;
-    case AV_PIX_FMT_ARGB:
-        alpha_first = 1;
-    case AV_PIX_FMT_RGBA:
-        packedtogbr24p((const uint8_t *) src[0], srcStride[0], dst201,
-                       stride201, srcSliceH, alpha_first, 4, c->srcW);
-        break;
-    case AV_PIX_FMT_ABGR:
-        alpha_first = 1;
-    case AV_PIX_FMT_BGRA:
-        packedtogbr24p((const uint8_t *) src[0], srcStride[0], dst102,
-                       stride102, srcSliceH, alpha_first, 4, c->srcW);
-        break;
-    default:
-        av_log(c, AV_LOG_ERROR,
-               "unsupported planar RGB conversion %s -> %s\n",
-               av_get_pix_fmt_name(c->srcFormat),
-               av_get_pix_fmt_name(c->dstFormat));
-    }
-
-    return srcSliceH;
-}
-
-#define isRGBA32(x) (            \
-           (x) == AV_PIX_FMT_ARGB   \
-        || (x) == AV_PIX_FMT_RGBA   \
-        || (x) == AV_PIX_FMT_BGRA   \
-        || (x) == AV_PIX_FMT_ABGR   \
-        )
-
-/* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */
-typedef void (* rgbConvFn) (const uint8_t *, uint8_t *, int);
-static rgbConvFn findRgbConvFn(SwsContext *c)
-{
-    const enum AVPixelFormat srcFormat = c->srcFormat;
-    const enum AVPixelFormat dstFormat = c->dstFormat;
-    const int srcId = c->srcFormatBpp;
-    const int dstId = c->dstFormatBpp;
-    rgbConvFn conv = NULL;
-    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
-    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);
-
-#define IS_NOT_NE(bpp, desc) \
-    (((bpp + 7) >> 3) == 2 && \
-     (!(desc->flags & AV_PIX_FMT_FLAG_BE) != !HAVE_BIGENDIAN))
-
-    /* if this is non-native rgb444/555/565, don't handle it here. */
-    if (IS_NOT_NE(srcId, desc_src) || IS_NOT_NE(dstId, desc_dst))
-        return NULL;
-
-#define CONV_IS(src, dst) (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst)
-
-    if (isRGBA32(srcFormat) && isRGBA32(dstFormat)) {
-        if (     CONV_IS(ABGR, RGBA)
-              || CONV_IS(ARGB, BGRA)
-              || CONV_IS(BGRA, ARGB)
-              || CONV_IS(RGBA, ABGR)) conv = shuffle_bytes_3210;
-        else if (CONV_IS(ABGR, ARGB)
-              || CONV_IS(ARGB, ABGR)) conv = shuffle_bytes_0321;
-        else if (CONV_IS(ABGR, BGRA)
-              || CONV_IS(ARGB, RGBA)) conv = shuffle_bytes_1230;
-        else if (CONV_IS(BGRA, RGBA)
-              || CONV_IS(RGBA, BGRA)) conv = shuffle_bytes_2103;
-        else if (CONV_IS(BGRA, ABGR)
-              || CONV_IS(RGBA, ARGB)) conv = shuffle_bytes_3012;
-    } else
-    /* BGR -> BGR */
-    if ((isBGRinInt(srcFormat) && isBGRinInt(dstFormat)) ||
-        (isRGBinInt(srcFormat) && isRGBinInt(dstFormat))) {
-        switch (srcId | (dstId << 16)) {
-        case 0x000F000C: conv = rgb12to15; break;
-        case 0x000F0010: conv = rgb16to15; break;
-        case 0x000F0018: conv = rgb24to15; break;
-        case 0x000F0020: conv = rgb32to15; break;
-        case 0x0010000F: conv = rgb15to16; break;
-        case 0x00100018: conv = rgb24to16; break;
-        case 0x00100020: conv = rgb32to16; break;
-        case 0x0018000F: conv = rgb15to24; break;
-        case 0x00180010: conv = rgb16to24; break;
-        case 0x00180020: conv = rgb32to24; break;
-        case 0x0020000F: conv = rgb15to32; break;
-        case 0x00200010: conv = rgb16to32; break;
-        case 0x00200018: conv = rgb24to32; break;
-        }
-    } else if ((isBGRinInt(srcFormat) && isRGBinInt(dstFormat)) ||
-               (isRGBinInt(srcFormat) && isBGRinInt(dstFormat))) {
-        switch (srcId | (dstId << 16)) {
-        case 0x000C000C: conv = rgb12tobgr12; break;
-        case 0x000F000F: conv = rgb15tobgr15; break;
-        case 0x000F0010: conv = rgb16tobgr15; break;
-        case 0x000F0018: conv = rgb24tobgr15; break;
-        case 0x000F0020: conv = rgb32tobgr15; break;
-        case 0x0010000F: conv = rgb15tobgr16; break;
-        case 0x00100010: conv = rgb16tobgr16; break;
-        case 0x00100018: conv = rgb24tobgr16; break;
-        case 0x00100020: conv = rgb32tobgr16; break;
-        case 0x0018000F: conv = rgb15tobgr24; break;
-        case 0x00180010: conv = rgb16tobgr24; break;
-        case 0x00180018: conv = rgb24tobgr24; break;
-        case 0x00180020: conv = rgb32tobgr24; break;
-        case 0x0020000F: conv = rgb15tobgr32; break;
-        case 0x00200010: conv = rgb16tobgr32; break;
-        case 0x00200018: conv = rgb24tobgr32; break;
-        }
-    }
-
-    return conv;
-}
-
-/* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */
-static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
-                           int srcSliceY, int srcSliceH, uint8_t *dst[],
-                           int dstStride[])
-
-{
-    const enum AVPixelFormat srcFormat = c->srcFormat;
-    const enum AVPixelFormat dstFormat = c->dstFormat;
-    const int srcBpp = (c->srcFormatBpp + 7) >> 3;
-    const int dstBpp = (c->dstFormatBpp + 7) >> 3;
-    rgbConvFn conv = findRgbConvFn(c);
-
-    if (!conv) {
-        av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
-               sws_format_name(srcFormat), sws_format_name(dstFormat));
-    } else {
-        const uint8_t *srcPtr = src[0];
-              uint8_t *dstPtr = dst[0];
-        if ((srcFormat == AV_PIX_FMT_RGB32_1 || srcFormat == AV_PIX_FMT_BGR32_1) &&
-            !isRGBA32(dstFormat))
-            srcPtr += ALT32_CORR;
-
-        if ((dstFormat == AV_PIX_FMT_RGB32_1 || dstFormat == AV_PIX_FMT_BGR32_1) &&
-            !isRGBA32(srcFormat))
-            dstPtr += ALT32_CORR;
-
-        if (dstStride[0] * srcBpp == srcStride[0] * dstBpp && srcStride[0] > 0 &&
-            !(srcStride[0] % srcBpp))
-            conv(srcPtr, dstPtr + dstStride[0] * srcSliceY,
-                 srcSliceH * srcStride[0]);
-        else {
-            int i;
-            dstPtr += dstStride[0] * srcSliceY;
-
-            for (i = 0; i < srcSliceH; i++) {
-                conv(srcPtr, dstPtr, c->srcW * srcBpp);
-                srcPtr += srcStride[0];
-                dstPtr += dstStride[0];
-            }
-        }
-    }
-    return srcSliceH;
-}
-
-static int bgr24ToYv12Wrapper(SwsContext *c, const uint8_t *src[],
-                              int srcStride[], int srcSliceY, int srcSliceH,
-                              uint8_t *dst[], int dstStride[])
-{
-    rgb24toyv12(
-        src[0],
-        dst[0] +  srcSliceY       * dstStride[0],
-        dst[1] + (srcSliceY >> 1) * dstStride[1],
-        dst[2] + (srcSliceY >> 1) * dstStride[2],
-        c->srcW, srcSliceH,
-        dstStride[0], dstStride[1], srcStride[0]);
-    if (dst[3])
-        fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);
-    return srcSliceH;
-}
-
-static int yvu9ToYv12Wrapper(SwsContext *c, const uint8_t *src[],
-                             int srcStride[], int srcSliceY, int srcSliceH,
-                             uint8_t *dst[], int dstStride[])
-{
-    copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
-              dst[0], dstStride[0]);
-
-    planar2x(src[1], dst[1] + dstStride[1] * (srcSliceY >> 1), c->chrSrcW,
-             srcSliceH >> 2, srcStride[1], dstStride[1]);
-    planar2x(src[2], dst[2] + dstStride[2] * (srcSliceY >> 1), c->chrSrcW,
-             srcSliceH >> 2, srcStride[2], dstStride[2]);
-    if (dst[3])
-        fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);
-    return srcSliceH;
-}
-
-/* unscaled copy like stuff (assumes nearly identical formats) */
-static int packedCopyWrapper(SwsContext *c, const uint8_t *src[],
-                             int srcStride[], int srcSliceY, int srcSliceH,
-                             uint8_t *dst[], int dstStride[])
-{
-    if (dstStride[0] == srcStride[0] && srcStride[0] > 0)
-        memcpy(dst[0] + dstStride[0] * srcSliceY, src[0], srcSliceH * dstStride[0]);
-    else {
-        int i;
-        const uint8_t *srcPtr = src[0];
-        uint8_t *dstPtr = dst[0] + dstStride[0] * srcSliceY;
-        int length = 0;
-
-        /* universal length finder */
-        while (length + c->srcW <= FFABS(dstStride[0]) &&
-               length + c->srcW <= FFABS(srcStride[0]))
-            length += c->srcW;
-        assert(length != 0);
-
-        for (i = 0; i < srcSliceH; i++) {
-            memcpy(dstPtr, srcPtr, length);
-            srcPtr += srcStride[0];
-            dstPtr += dstStride[0];
-        }
-    }
-    return srcSliceH;
-}
-
-#define clip9(x)  av_clip_uintp2(x,  9)
-#define clip10(x) av_clip_uintp2(x, 10)
-#define DITHER_COPY(dst, dstStride, wfunc, src, srcStride, rfunc, dithers, shift, clip) \
-    for (i = 0; i < height; i++) { \
-        const uint8_t *dither = dithers[i & 7]; \
-        for (j = 0; j < length - 7; j += 8) { \
-            wfunc(&dst[j + 0], clip((rfunc(&src[j + 0]) + dither[0]) >> shift)); \
-            wfunc(&dst[j + 1], clip((rfunc(&src[j + 1]) + dither[1]) >> shift)); \
-            wfunc(&dst[j + 2], clip((rfunc(&src[j + 2]) + dither[2]) >> shift)); \
-            wfunc(&dst[j + 3], clip((rfunc(&src[j + 3]) + dither[3]) >> shift)); \
-            wfunc(&dst[j + 4], clip((rfunc(&src[j + 4]) + dither[4]) >> shift)); \
-            wfunc(&dst[j + 5], clip((rfunc(&src[j + 5]) + dither[5]) >> shift)); \
-            wfunc(&dst[j + 6], clip((rfunc(&src[j + 6]) + dither[6]) >> shift)); \
-            wfunc(&dst[j + 7], clip((rfunc(&src[j + 7]) + dither[7]) >> shift)); \
-        } \
-        for (; j < length; j++) \
-            wfunc(&dst[j],     (rfunc(&src[j]) + dither[j & 7]) >> shift); \
-        dst += dstStride; \
-        src += srcStride; \
-    }
-
-static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
-                             int srcStride[], int srcSliceY, int srcSliceH,
-                             uint8_t *dst[], int dstStride[])
-{
-    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(c->srcFormat);
-    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(c->dstFormat);
-    int plane, i, j;
-    for (plane = 0; plane < 4; plane++) {
-        int length = (plane == 0 || plane == 3) ? c->srcW  : -((-c->srcW  ) >> c->chrDstHSubSample);
-        int y =      (plane == 0 || plane == 3) ? srcSliceY: -((-srcSliceY) >> c->chrDstVSubSample);
-        int height = (plane == 0 || plane == 3) ? srcSliceH: -((-srcSliceH) >> c->chrDstVSubSample);
-        const uint8_t *srcPtr = src[plane];
-        uint8_t *dstPtr = dst[plane] + dstStride[plane] * y;
-
-        if (!dst[plane])
-            continue;
-        // ignore palette for GRAY8
-        if (plane == 1 && !dst[2]) continue;
-        if (!src[plane] || (plane == 1 && !src[2])) {
-            int val = (plane == 3) ? 255 : 128;
-            if (is16BPS(c->dstFormat))
-                length *= 2;
-            if (is9_OR_10BPS(c->dstFormat)) {
-                fill_plane9or10(dst[plane], dstStride[plane],
-                                length, height, y, val,
-                                desc_dst->comp[plane].depth_minus1 + 1,
-                                isBE(c->dstFormat));
-            } else
-                fillPlane(dst[plane], dstStride[plane], length, height, y,
-                          val);
-        } else {
-            if (is9_OR_10BPS(c->srcFormat)) {
-                const int src_depth = desc_src->comp[plane].depth_minus1 + 1;
-                const int dst_depth = desc_dst->comp[plane].depth_minus1 + 1;
-                const uint16_t *srcPtr2 = (const uint16_t *) srcPtr;
-
-                if (is16BPS(c->dstFormat)) {
-                    uint16_t *dstPtr2 = (uint16_t *) dstPtr;
-#define COPY9_OR_10TO16(rfunc, wfunc) \
-                    for (i = 0; i < height; i++) { \
-                        for (j = 0; j < length; j++) { \
-                            int srcpx = rfunc(&srcPtr2[j]); \
-                            wfunc(&dstPtr2[j], (srcpx << (16 - src_depth)) | (srcpx >> (2 * src_depth - 16))); \
-                        } \
-                        dstPtr2 += dstStride[plane] / 2; \
-                        srcPtr2 += srcStride[plane] / 2; \
-                    }
-                    if (isBE(c->dstFormat)) {
-                        if (isBE(c->srcFormat)) {
-                            COPY9_OR_10TO16(AV_RB16, AV_WB16);
-                        } else {
-                            COPY9_OR_10TO16(AV_RL16, AV_WB16);
-                        }
-                    } else {
-                        if (isBE(c->srcFormat)) {
-                            COPY9_OR_10TO16(AV_RB16, AV_WL16);
-                        } else {
-                            COPY9_OR_10TO16(AV_RL16, AV_WL16);
-                        }
-                    }
-                } else if (is9_OR_10BPS(c->dstFormat)) {
-                    uint16_t *dstPtr2 = (uint16_t *) dstPtr;
-#define COPY9_OR_10TO9_OR_10(loop) \
-                    for (i = 0; i < height; i++) { \
-                        for (j = 0; j < length; j++) { \
-                            loop; \
-                        } \
-                        dstPtr2 += dstStride[plane] / 2; \
-                        srcPtr2 += srcStride[plane] / 2; \
-                    }
-#define COPY9_OR_10TO9_OR_10_2(rfunc, wfunc) \
-                    if (dst_depth > src_depth) { \
-                        COPY9_OR_10TO9_OR_10(int srcpx = rfunc(&srcPtr2[j]); \
-                            wfunc(&dstPtr2[j], (srcpx << 1) | (srcpx >> 9))); \
-                    } else if (dst_depth < src_depth) { \
-                        DITHER_COPY(dstPtr2, dstStride[plane] / 2, wfunc, \
-                                    srcPtr2, srcStride[plane] / 2, rfunc, \
-                                    dither_8x8_1, 1, clip9); \
-                    } else { \
-                        COPY9_OR_10TO9_OR_10(wfunc(&dstPtr2[j], rfunc(&srcPtr2[j]))); \
-                    }
-                    if (isBE(c->dstFormat)) {
-                        if (isBE(c->srcFormat)) {
-                            COPY9_OR_10TO9_OR_10_2(AV_RB16, AV_WB16);
-                        } else {
-                            COPY9_OR_10TO9_OR_10_2(AV_RL16, AV_WB16);
-                        }
-                    } else {
-                        if (isBE(c->srcFormat)) {
-                            COPY9_OR_10TO9_OR_10_2(AV_RB16, AV_WL16);
-                        } else {
-                            COPY9_OR_10TO9_OR_10_2(AV_RL16, AV_WL16);
-                        }
-                    }
-                } else {
-#define W8(a, b) { *(a) = (b); }
-#define COPY9_OR_10TO8(rfunc) \
-                    if (src_depth == 9) { \
-                        DITHER_COPY(dstPtr,  dstStride[plane],   W8, \
-                                    srcPtr2, srcStride[plane] / 2, rfunc, \
-                                    dither_8x8_1, 1, av_clip_uint8); \
-                    } else { \
-                        DITHER_COPY(dstPtr,  dstStride[plane],   W8, \
-                                    srcPtr2, srcStride[plane] / 2, rfunc, \
-                                    dither_8x8_3, 2, av_clip_uint8); \
-                    }
-                    if (isBE(c->srcFormat)) {
-                        COPY9_OR_10TO8(AV_RB16);
-                    } else {
-                        COPY9_OR_10TO8(AV_RL16);
-                    }
-                }
-            } else if (is9_OR_10BPS(c->dstFormat)) {
-                const int dst_depth = desc_dst->comp[plane].depth_minus1 + 1;
-                uint16_t *dstPtr2 = (uint16_t *) dstPtr;
-
-                if (is16BPS(c->srcFormat)) {
-                    const uint16_t *srcPtr2 = (const uint16_t *) srcPtr;
-#define COPY16TO9_OR_10(rfunc, wfunc) \
-                    if (dst_depth == 9) { \
-                        DITHER_COPY(dstPtr2, dstStride[plane] / 2, wfunc, \
-                                    srcPtr2, srcStride[plane] / 2, rfunc, \
-                                    ff_dither_8x8_128, 7, clip9); \
-                    } else { \
-                        DITHER_COPY(dstPtr2, dstStride[plane] / 2, wfunc, \
-                                    srcPtr2, srcStride[plane] / 2, rfunc, \
-                                    dither_8x8_64, 6, clip10); \
-                    }
-                    if (isBE(c->dstFormat)) {
-                        if (isBE(c->srcFormat)) {
-                            COPY16TO9_OR_10(AV_RB16, AV_WB16);
-                        } else {
-                            COPY16TO9_OR_10(AV_RL16, AV_WB16);
-                        }
-                    } else {
-                        if (isBE(c->srcFormat)) {
-                            COPY16TO9_OR_10(AV_RB16, AV_WL16);
-                        } else {
-                            COPY16TO9_OR_10(AV_RL16, AV_WL16);
-                        }
-                    }
-                } else /* 8bit */ {
-#define COPY8TO9_OR_10(wfunc) \
-                    for (i = 0; i < height; i++) { \
-                        for (j = 0; j < length; j++) { \
-                            const int srcpx = srcPtr[j]; \
-                            wfunc(&dstPtr2[j], (srcpx << (dst_depth - 8)) | (srcpx >> (16 - dst_depth))); \
-                        } \
-                        dstPtr2 += dstStride[plane] / 2; \
-                        srcPtr  += srcStride[plane]; \
-                    }
-                    if (isBE(c->dstFormat)) {
-                        COPY8TO9_OR_10(AV_WB16);
-                    } else {
-                        COPY8TO9_OR_10(AV_WL16);
-                    }
-                }
-            } else if (is16BPS(c->srcFormat) && !is16BPS(c->dstFormat)) {
-                const uint16_t *srcPtr2 = (const uint16_t *) srcPtr;
-#define COPY16TO8(rfunc) \
-                    DITHER_COPY(dstPtr,  dstStride[plane],   W8, \
-                                srcPtr2, srcStride[plane] / 2, rfunc, \
-                                dither_8x8_256, 8, av_clip_uint8);
-                if (isBE(c->srcFormat)) {
-                    COPY16TO8(AV_RB16);
-                } else {
-                    COPY16TO8(AV_RL16);
-                }
-            } else if (!is16BPS(c->srcFormat) && is16BPS(c->dstFormat)) {
-                for (i = 0; i < height; i++) {
-                    for (j = 0; j < length; j++) {
-                        dstPtr[ j << 1     ] = srcPtr[j];
-                        dstPtr[(j << 1) + 1] = srcPtr[j];
-                    }
-                    srcPtr += srcStride[plane];
-                    dstPtr += dstStride[plane];
-                }
-            } else if (is16BPS(c->srcFormat) && is16BPS(c->dstFormat) &&
-                      isBE(c->srcFormat) != isBE(c->dstFormat)) {
-
-                for (i = 0; i < height; i++) {
-                    for (j = 0; j < length; j++)
-                        ((uint16_t *) dstPtr)[j] = av_bswap16(((const uint16_t *) srcPtr)[j]);
-                    srcPtr += srcStride[plane];
-                    dstPtr += dstStride[plane];
-                }
-            } else if (dstStride[plane] == srcStride[plane] &&
-                       srcStride[plane] > 0 && srcStride[plane] == length) {
-                memcpy(dst[plane] + dstStride[plane] * y, src[plane],
-                       height * dstStride[plane]);
-            } else {
-                if (is16BPS(c->srcFormat) && is16BPS(c->dstFormat))
-                    length *= 2;
-                else if (!desc_src->comp[0].depth_minus1)
-                    length >>= 3; // monowhite/black
-                for (i = 0; i < height; i++) {
-                    memcpy(dstPtr, srcPtr, length);
-                    srcPtr += srcStride[plane];
-                    dstPtr += dstStride[plane];
-                }
-            }
-        }
-    }
-    return srcSliceH;
-}
-
-
-#define IS_DIFFERENT_ENDIANESS(src_fmt, dst_fmt, pix_fmt)          \
-    ((src_fmt == pix_fmt ## BE && dst_fmt == pix_fmt ## LE) ||     \
-     (src_fmt == pix_fmt ## LE && dst_fmt == pix_fmt ## BE))
-
-
-void ff_get_unscaled_swscale(SwsContext *c)
-{
-    const enum AVPixelFormat srcFormat = c->srcFormat;
-    const enum AVPixelFormat dstFormat = c->dstFormat;
-    const int flags = c->flags;
-    const int dstH = c->dstH;
-    int needsDither;
-
-    needsDither = isAnyRGB(dstFormat) &&
-            c->dstFormatBpp < 24 &&
-           (c->dstFormatBpp < c->srcFormatBpp || (!isAnyRGB(srcFormat)));
-
-    /* yv12_to_nv12 */
-    if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) &&
-        (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)) {
-        c->swscale = planarToNv12Wrapper;
-    }
-    /* nv12_to_yv12 */
-    if (dstFormat == AV_PIX_FMT_YUV420P &&
-        (srcFormat == AV_PIX_FMT_NV12 || srcFormat == AV_PIX_FMT_NV21)) {
-        c->swscale = nv12ToPlanarWrapper;
-    }
-    /* yuv2bgr */
-    if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUV422P ||
-         srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) &&
-        !(flags & SWS_ACCURATE_RND) && !(dstH & 1)) {
-        c->swscale = ff_yuv2rgb_get_func_ptr(c);
-    }
-
-    if (srcFormat == AV_PIX_FMT_YUV410P &&
-        (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
-        !(flags & SWS_BITEXACT)) {
-        c->swscale = yvu9ToYv12Wrapper;
-    }
-
-    /* bgr24toYV12 */
-    if (srcFormat == AV_PIX_FMT_BGR24 &&
-        (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
-        !(flags & SWS_ACCURATE_RND))
-        c->swscale = bgr24ToYv12Wrapper;
-
-    /* RGB/BGR -> RGB/BGR (no dither needed forms) */
-    if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c)
-        && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT))))
-        c->swscale = rgbToRgbWrapper;
-
-#define isByteRGB(f) (             \
-        f == AV_PIX_FMT_RGB32   || \
-        f == AV_PIX_FMT_RGB32_1 || \
-        f == AV_PIX_FMT_RGB24   || \
-        f == AV_PIX_FMT_BGR32   || \
-        f == AV_PIX_FMT_BGR32_1 || \
-        f == AV_PIX_FMT_BGR24)
-
-    if (srcFormat == AV_PIX_FMT_GBRP && isPlanar(srcFormat) && isByteRGB(dstFormat))
-        c->swscale = planarRgbToRgbWrapper;
-
-    if (av_pix_fmt_desc_get(srcFormat)->comp[0].depth_minus1 == 7 &&
-        isPackedRGB(srcFormat) && dstFormat == AV_PIX_FMT_GBRP)
-        c->swscale = rgbToPlanarRgbWrapper;
-
-    /* bswap 16 bits per pixel/component packed formats */
-    if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) ||
-        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR48)  ||
-        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR555) ||
-        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR565) ||
-        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GRAY16) ||
-        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB444) ||
-        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB48)  ||
-        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB555) ||
-        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB565) ||
-        IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_XYZ12))
-        c->swscale = packed_16bpc_bswap;
-
-    if ((usePal(srcFormat) && (
-        dstFormat == AV_PIX_FMT_RGB32   ||
-        dstFormat == AV_PIX_FMT_RGB32_1 ||
-        dstFormat == AV_PIX_FMT_RGB24   ||
-        dstFormat == AV_PIX_FMT_BGR32   ||
-        dstFormat == AV_PIX_FMT_BGR32_1 ||
-        dstFormat == AV_PIX_FMT_BGR24)))
-        c->swscale = palToRgbWrapper;
-
-    if (srcFormat == AV_PIX_FMT_YUV422P) {
-        if (dstFormat == AV_PIX_FMT_YUYV422)
-            c->swscale = yuv422pToYuy2Wrapper;
-        else if (dstFormat == AV_PIX_FMT_UYVY422)
-            c->swscale = yuv422pToUyvyWrapper;
-    }
-
-    /* LQ converters if -sws 0 or -sws 4*/
-    if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)) {
-        /* yv12_to_yuy2 */
-        if (srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) {
-            if (dstFormat == AV_PIX_FMT_YUYV422)
-                c->swscale = planarToYuy2Wrapper;
-            else if (dstFormat == AV_PIX_FMT_UYVY422)
-                c->swscale = planarToUyvyWrapper;
-        }
-    }
-    if (srcFormat == AV_PIX_FMT_YUYV422 &&
-       (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P))
-        c->swscale = yuyvToYuv420Wrapper;
-    if (srcFormat == AV_PIX_FMT_UYVY422 &&
-       (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P))
-        c->swscale = uyvyToYuv420Wrapper;
-    if (srcFormat == AV_PIX_FMT_YUYV422 && dstFormat == AV_PIX_FMT_YUV422P)
-        c->swscale = yuyvToYuv422Wrapper;
-    if (srcFormat == AV_PIX_FMT_UYVY422 && dstFormat == AV_PIX_FMT_YUV422P)
-        c->swscale = uyvyToYuv422Wrapper;
-
-    /* simple copy */
-    if ( srcFormat == dstFormat ||
-        (srcFormat == AV_PIX_FMT_YUVA420P && dstFormat == AV_PIX_FMT_YUV420P) ||
-        (srcFormat == AV_PIX_FMT_YUV420P && dstFormat == AV_PIX_FMT_YUVA420P) ||
-        (isPlanarYUV(srcFormat) && isGray(dstFormat)) ||
-        (isPlanarYUV(dstFormat) && isGray(srcFormat)) ||
-        (isGray(dstFormat) && isGray(srcFormat)) ||
-        (isPlanarYUV(srcFormat) && isPlanarYUV(dstFormat) &&
-         c->chrDstHSubSample == c->chrSrcHSubSample &&
-         c->chrDstVSubSample == c->chrSrcVSubSample &&
-         dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
-         srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21))
-    {
-        if (isPacked(c->srcFormat))
-            c->swscale = packedCopyWrapper;
-        else /* Planar YUV or gray */
-            c->swscale = planarCopyWrapper;
-    }
-
-    if (ARCH_BFIN)
-        ff_get_unscaled_swscale_bfin(c);
-    if (ARCH_PPC)
-        ff_get_unscaled_swscale_ppc(c);
-}
-
-static void reset_ptr(const uint8_t *src[], int format)
-{
-    if (!isALPHA(format))
-        src[3] = NULL;
-    if (!isPlanar(format)) {
-        src[3] = src[2] = NULL;
-
-        if (!usePal(format))
-            src[1] = NULL;
-    }
-}
-
-static int check_image_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt,
-                                const int linesizes[4])
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
-    int i;
-
-    for (i = 0; i < 4; i++) {
-        int plane = desc->comp[i].plane;
-        if (!data[plane] || !linesizes[plane])
-            return 0;
-    }
-
-    return 1;
-}
-
-/**
- * swscale wrapper, so we don't need to export the SwsContext.
- * Assumes planar YUV to be in YUV order instead of YVU.
- */
-int attribute_align_arg sws_scale(struct SwsContext *c,
-                                  const uint8_t * const srcSlice[],
-                                  const int srcStride[], int srcSliceY,
-                                  int srcSliceH, uint8_t *const dst[],
-                                  const int dstStride[])
-{
-    int i;
-    const uint8_t *src2[4] = { srcSlice[0], srcSlice[1], srcSlice[2], srcSlice[3] };
-    uint8_t *dst2[4] = { dst[0], dst[1], dst[2], dst[3] };
-
-    // do not mess up sliceDir if we have a "trailing" 0-size slice
-    if (srcSliceH == 0)
-        return 0;
-
-    if (!check_image_pointers(srcSlice, c->srcFormat, srcStride)) {
-        av_log(c, AV_LOG_ERROR, "bad src image pointers\n");
-        return 0;
-    }
-    if (!check_image_pointers(dst, c->dstFormat, dstStride)) {
-        av_log(c, AV_LOG_ERROR, "bad dst image pointers\n");
-        return 0;
-    }
-
-    if (c->sliceDir == 0 && srcSliceY != 0 && srcSliceY + srcSliceH != c->srcH) {
-        av_log(c, AV_LOG_ERROR, "Slices start in the middle!\n");
-        return 0;
-    }
-    if (c->sliceDir == 0) {
-        if (srcSliceY == 0) c->sliceDir = 1; else c->sliceDir = -1;
-    }
-
-    if (usePal(c->srcFormat)) {
-        for (i = 0; i < 256; i++) {
-            int p, r, g, b, y, u, v;
-            if (c->srcFormat == AV_PIX_FMT_PAL8) {
-                p = ((const uint32_t *)(srcSlice[1]))[i];
-                r = (p >> 16) & 0xFF;
-                g = (p >>  8) & 0xFF;
-                b =  p        & 0xFF;
-            } else if (c->srcFormat == AV_PIX_FMT_RGB8) {
-                r = ( i >> 5     ) * 36;
-                g = ((i >> 2) & 7) * 36;
-                b = ( i       & 3) * 85;
-            } else if (c->srcFormat == AV_PIX_FMT_BGR8) {
-                b = ( i >> 6     ) * 85;
-                g = ((i >> 3) & 7) * 36;
-                r = ( i       & 7) * 36;
-            } else if (c->srcFormat == AV_PIX_FMT_RGB4_BYTE) {
-                r = ( i >> 3     ) * 255;
-                g = ((i >> 1) & 3) * 85;
-                b = ( i       & 1) * 255;
-            } else if (c->srcFormat == AV_PIX_FMT_GRAY8 ||
-                      c->srcFormat == AV_PIX_FMT_Y400A) {
-                r = g = b = i;
-            } else {
-                assert(c->srcFormat == AV_PIX_FMT_BGR4_BYTE);
-                b = ( i >> 3     ) * 255;
-                g = ((i >> 1) & 3) * 85;
-                r = ( i       & 1) * 255;
-            }
-            y = av_clip_uint8((RY * r + GY * g + BY * b + ( 33 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
-            u = av_clip_uint8((RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
-            v = av_clip_uint8((RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
-            c->pal_yuv[i] = y + (u << 8) + (v << 16);
-
-            switch (c->dstFormat) {
-            case AV_PIX_FMT_BGR32:
-#if !HAVE_BIGENDIAN
-            case AV_PIX_FMT_RGB24:
-#endif
-                c->pal_rgb[i] =  r + (g << 8) + (b << 16);
-                break;
-            case AV_PIX_FMT_BGR32_1:
-#if HAVE_BIGENDIAN
-            case AV_PIX_FMT_BGR24:
-#endif
-                c->pal_rgb[i] = (r + (g << 8) + (b << 16)) << 8;
-                break;
-            case AV_PIX_FMT_RGB32_1:
-#if HAVE_BIGENDIAN
-            case AV_PIX_FMT_RGB24:
-#endif
-                c->pal_rgb[i] = (b + (g << 8) + (r << 16)) << 8;
-                break;
-            case AV_PIX_FMT_RGB32:
-#if !HAVE_BIGENDIAN
-            case AV_PIX_FMT_BGR24:
-#endif
-            default:
-                c->pal_rgb[i] =  b + (g << 8) + (r << 16);
-            }
-        }
-    }
-
-    // copy strides, so they can safely be modified
-    if (c->sliceDir == 1) {
-        // slices go from top to bottom
-        int srcStride2[4] = { srcStride[0], srcStride[1], srcStride[2],
-                              srcStride[3] };
-        int dstStride2[4] = { dstStride[0], dstStride[1], dstStride[2],
-                              dstStride[3] };
-
-        reset_ptr(src2, c->srcFormat);
-        reset_ptr((const uint8_t **) dst2, c->dstFormat);
-
-        /* reset slice direction at end of frame */
-        if (srcSliceY + srcSliceH == c->srcH)
-            c->sliceDir = 0;
-
-        return c->swscale(c, src2, srcStride2, srcSliceY, srcSliceH, dst2,
-                          dstStride2);
-    } else {
-        // slices go from bottom to top => we flip the image internally
-        int srcStride2[4] = { -srcStride[0], -srcStride[1], -srcStride[2],
-                              -srcStride[3] };
-        int dstStride2[4] = { -dstStride[0], -dstStride[1], -dstStride[2],
-                              -dstStride[3] };
-
-        src2[0] += (srcSliceH - 1) * srcStride[0];
-        if (!usePal(c->srcFormat))
-            src2[1] += ((srcSliceH >> c->chrSrcVSubSample) - 1) * srcStride[1];
-        src2[2] += ((srcSliceH >> c->chrSrcVSubSample) - 1) * srcStride[2];
-        src2[3] += (srcSliceH - 1) * srcStride[3];
-        dst2[0] += ( c->dstH                         - 1) * dstStride[0];
-        dst2[1] += ((c->dstH >> c->chrDstVSubSample) - 1) * dstStride[1];
-        dst2[2] += ((c->dstH >> c->chrDstVSubSample) - 1) * dstStride[2];
-        dst2[3] += ( c->dstH                         - 1) * dstStride[3];
-
-        reset_ptr(src2, c->srcFormat);
-        reset_ptr((const uint8_t **) dst2, c->dstFormat);
-
-        /* reset slice direction at end of frame */
-        if (!srcSliceY)
-            c->sliceDir = 0;
-
-        return c->swscale(c, src2, srcStride2, c->srcH-srcSliceY-srcSliceH,
-                          srcSliceH, dst2, dstStride2);
-    }
-}
-
-/* Convert the palette to the same packed 32-bit format as the palette */
-void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst,
-                                   int num_pixels, const uint8_t *palette)
-{
-    int i;
-
-    for (i = 0; i < num_pixels; i++)
-        ((uint32_t *) dst)[i] = ((const uint32_t *) palette)[src[i]];
-}
-
-/* Palette format: ABCD -> dst format: ABC */
-void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst,
-                                   int num_pixels, const uint8_t *palette)
-{
-    int i;
-
-    for (i = 0; i < num_pixels; i++) {
-        //FIXME slow?
-        dst[0] = palette[src[i] * 4 + 0];
-        dst[1] = palette[src[i] * 4 + 1];
-        dst[2] = palette[src[i] * 4 + 2];
-        dst += 3;
-    }
-}
diff --git a/deps/libav/libswscale/utils.c b/deps/libav/libswscale/utils.c
deleted file mode 100644
index ea5f368..0000000
--- a/deps/libav/libswscale/utils.c
+++ /dev/null
@@ -1,1777 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-
-#define _SVID_SOURCE // needed for MAP_ANONYMOUS
-#include <assert.h>
-#include <inttypes.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-#if HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-#endif
-#if HAVE_VIRTUALALLOC
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
-#include "libavutil/attributes.h"
-#include "libavutil/avutil.h"
-#include "libavutil/bswap.h"
-#include "libavutil/cpu.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-#include "libavutil/opt.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/ppc/cpu.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "rgb2rgb.h"
-#include "swscale.h"
-#include "swscale_internal.h"
-
-unsigned swscale_version(void)
-{
-    return LIBSWSCALE_VERSION_INT;
-}
-
-const char *swscale_configuration(void)
-{
-    return LIBAV_CONFIGURATION;
-}
-
-const char *swscale_license(void)
-{
-#define LICENSE_PREFIX "libswscale license: "
-    return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
-}
-
-#define RET 0xC3 // near return opcode for x86
-
-typedef struct FormatEntry {
-    uint8_t is_supported_in         :1;
-    uint8_t is_supported_out        :1;
-    uint8_t is_supported_endianness :1;
-} FormatEntry;
-
-static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
-    [AV_PIX_FMT_YUV420P]     = { 1, 1 },
-    [AV_PIX_FMT_YUYV422]     = { 1, 1 },
-    [AV_PIX_FMT_RGB24]       = { 1, 1 },
-    [AV_PIX_FMT_BGR24]       = { 1, 1 },
-    [AV_PIX_FMT_YUV422P]     = { 1, 1 },
-    [AV_PIX_FMT_YUV444P]     = { 1, 1 },
-    [AV_PIX_FMT_YUV410P]     = { 1, 1 },
-    [AV_PIX_FMT_YUV411P]     = { 1, 1 },
-    [AV_PIX_FMT_GRAY8]       = { 1, 1 },
-    [AV_PIX_FMT_MONOWHITE]   = { 1, 1 },
-    [AV_PIX_FMT_MONOBLACK]   = { 1, 1 },
-    [AV_PIX_FMT_PAL8]        = { 1, 0 },
-    [AV_PIX_FMT_YUVJ420P]    = { 1, 1 },
-    [AV_PIX_FMT_YUVJ422P]    = { 1, 1 },
-    [AV_PIX_FMT_YUVJ444P]    = { 1, 1 },
-    [AV_PIX_FMT_UYVY422]     = { 1, 1 },
-    [AV_PIX_FMT_UYYVYY411]   = { 0, 0 },
-    [AV_PIX_FMT_BGR8]        = { 1, 1 },
-    [AV_PIX_FMT_BGR4]        = { 0, 1 },
-    [AV_PIX_FMT_BGR4_BYTE]   = { 1, 1 },
-    [AV_PIX_FMT_RGB8]        = { 1, 1 },
-    [AV_PIX_FMT_RGB4]        = { 0, 1 },
-    [AV_PIX_FMT_RGB4_BYTE]   = { 1, 1 },
-    [AV_PIX_FMT_NV12]        = { 1, 1 },
-    [AV_PIX_FMT_NV21]        = { 1, 1 },
-    [AV_PIX_FMT_ARGB]        = { 1, 1 },
-    [AV_PIX_FMT_RGBA]        = { 1, 1 },
-    [AV_PIX_FMT_ABGR]        = { 1, 1 },
-    [AV_PIX_FMT_BGRA]        = { 1, 1 },
-    [AV_PIX_FMT_GRAY16BE]    = { 1, 1 },
-    [AV_PIX_FMT_GRAY16LE]    = { 1, 1 },
-    [AV_PIX_FMT_YUV440P]     = { 1, 1 },
-    [AV_PIX_FMT_YUVJ440P]    = { 1, 1 },
-    [AV_PIX_FMT_YUVA420P]    = { 1, 1 },
-    [AV_PIX_FMT_YUVA422P]    = { 1, 1 },
-    [AV_PIX_FMT_YUVA444P]    = { 1, 1 },
-    [AV_PIX_FMT_YUVA420P9BE] = { 1, 1 },
-    [AV_PIX_FMT_YUVA420P9LE] = { 1, 1 },
-    [AV_PIX_FMT_YUVA422P9BE] = { 1, 1 },
-    [AV_PIX_FMT_YUVA422P9LE] = { 1, 1 },
-    [AV_PIX_FMT_YUVA444P9BE] = { 1, 1 },
-    [AV_PIX_FMT_YUVA444P9LE] = { 1, 1 },
-    [AV_PIX_FMT_YUVA420P10BE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA420P10LE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA422P10BE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA422P10LE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA444P10BE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA444P10LE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA420P16BE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA420P16LE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA422P16BE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA422P16LE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA444P16BE]= { 1, 1 },
-    [AV_PIX_FMT_YUVA444P16LE]= { 1, 1 },
-    [AV_PIX_FMT_RGB48BE]     = { 1, 1 },
-    [AV_PIX_FMT_RGB48LE]     = { 1, 1 },
-    [AV_PIX_FMT_RGB565BE]    = { 1, 1 },
-    [AV_PIX_FMT_RGB565LE]    = { 1, 1 },
-    [AV_PIX_FMT_RGB555BE]    = { 1, 1 },
-    [AV_PIX_FMT_RGB555LE]    = { 1, 1 },
-    [AV_PIX_FMT_BGR565BE]    = { 1, 1 },
-    [AV_PIX_FMT_BGR565LE]    = { 1, 1 },
-    [AV_PIX_FMT_BGR555BE]    = { 1, 1 },
-    [AV_PIX_FMT_BGR555LE]    = { 1, 1 },
-    [AV_PIX_FMT_YUV420P16LE] = { 1, 1 },
-    [AV_PIX_FMT_YUV420P16BE] = { 1, 1 },
-    [AV_PIX_FMT_YUV422P16LE] = { 1, 1 },
-    [AV_PIX_FMT_YUV422P16BE] = { 1, 1 },
-    [AV_PIX_FMT_YUV444P16LE] = { 1, 1 },
-    [AV_PIX_FMT_YUV444P16BE] = { 1, 1 },
-    [AV_PIX_FMT_RGB444LE]    = { 1, 1 },
-    [AV_PIX_FMT_RGB444BE]    = { 1, 1 },
-    [AV_PIX_FMT_BGR444LE]    = { 1, 1 },
-    [AV_PIX_FMT_BGR444BE]    = { 1, 1 },
-    [AV_PIX_FMT_Y400A]       = { 1, 0 },
-    [AV_PIX_FMT_BGR48BE]     = { 1, 1 },
-    [AV_PIX_FMT_BGR48LE]     = { 1, 1 },
-    [AV_PIX_FMT_YUV420P9BE]  = { 1, 1 },
-    [AV_PIX_FMT_YUV420P9LE]  = { 1, 1 },
-    [AV_PIX_FMT_YUV420P10BE] = { 1, 1 },
-    [AV_PIX_FMT_YUV420P10LE] = { 1, 1 },
-    [AV_PIX_FMT_YUV422P9BE]  = { 1, 1 },
-    [AV_PIX_FMT_YUV422P9LE]  = { 1, 1 },
-    [AV_PIX_FMT_YUV422P10BE] = { 1, 1 },
-    [AV_PIX_FMT_YUV422P10LE] = { 1, 1 },
-    [AV_PIX_FMT_YUV444P9BE]  = { 1, 1 },
-    [AV_PIX_FMT_YUV444P9LE]  = { 1, 1 },
-    [AV_PIX_FMT_YUV444P10BE] = { 1, 1 },
-    [AV_PIX_FMT_YUV444P10LE] = { 1, 1 },
-    [AV_PIX_FMT_GBRP]        = { 1, 1 },
-    [AV_PIX_FMT_GBRP9LE]     = { 1, 1 },
-    [AV_PIX_FMT_GBRP9BE]     = { 1, 1 },
-    [AV_PIX_FMT_GBRP10LE]    = { 1, 1 },
-    [AV_PIX_FMT_GBRP10BE]    = { 1, 1 },
-    [AV_PIX_FMT_GBRP16LE]    = { 1, 0 },
-    [AV_PIX_FMT_GBRP16BE]    = { 1, 0 },
-    [AV_PIX_FMT_XYZ12BE]     = { 0, 0, 1 },
-    [AV_PIX_FMT_XYZ12LE]     = { 0, 0, 1 },
-};
-
-int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
-{
-    return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
-           format_entries[pix_fmt].is_supported_in : 0;
-}
-
-int sws_isSupportedOutput(enum AVPixelFormat pix_fmt)
-{
-    return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
-           format_entries[pix_fmt].is_supported_out : 0;
-}
-
-int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt)
-{
-    return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
-           format_entries[pix_fmt].is_supported_endianness : 0;
-}
-
-const char *sws_format_name(enum AVPixelFormat format)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
-    if (desc)
-        return desc->name;
-    else
-        return "Unknown format";
-}
-
-static double getSplineCoeff(double a, double b, double c, double d,
-                             double dist)
-{
-    if (dist <= 1.0)
-        return ((d * dist + c) * dist + b) * dist + a;
-    else
-        return getSplineCoeff(0.0,
-                               b + 2.0 * c + 3.0 * d,
-                               c + 3.0 * d,
-                              -b - 3.0 * c - 6.0 * d,
-                              dist - 1.0);
-}
-
-static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
-                              int *outFilterSize, int xInc, int srcW,
-                              int dstW, int filterAlign, int one,
-                              int flags, int cpu_flags,
-                              SwsVector *srcFilter, SwsVector *dstFilter,
-                              double param[2], int is_horizontal)
-{
-    int i;
-    int filterSize;
-    int filter2Size;
-    int minFilterSize;
-    int64_t *filter    = NULL;
-    int64_t *filter2   = NULL;
-    const int64_t fone = 1LL << 54;
-    int ret            = -1;
-
-    emms_c(); // FIXME should not be required but IS (even for non-MMX versions)
-
-    // NOTE: the +3 is for the MMX(+1) / SSE(+3) scaler which reads over the end
-    FF_ALLOC_OR_GOTO(NULL, *filterPos, (dstW + 3) * sizeof(**filterPos), fail);
-
-    if (FFABS(xInc - 0x10000) < 10) { // unscaled
-        int i;
-        filterSize = 1;
-        FF_ALLOCZ_OR_GOTO(NULL, filter,
-                          dstW * sizeof(*filter) * filterSize, fail);
-
-        for (i = 0; i < dstW; i++) {
-            filter[i * filterSize] = fone;
-            (*filterPos)[i]        = i;
-        }
-    } else if (flags & SWS_POINT) { // lame looking point sampling mode
-        int i;
-        int xDstInSrc;
-        filterSize = 1;
-        FF_ALLOC_OR_GOTO(NULL, filter,
-                         dstW * sizeof(*filter) * filterSize, fail);
-
-        xDstInSrc = xInc / 2 - 0x8000;
-        for (i = 0; i < dstW; i++) {
-            int xx = (xDstInSrc - ((filterSize - 1) << 15) + (1 << 15)) >> 16;
-
-            (*filterPos)[i] = xx;
-            filter[i]       = fone;
-            xDstInSrc      += xInc;
-        }
-    } else if ((xInc <= (1 << 16) && (flags & SWS_AREA)) ||
-               (flags & SWS_FAST_BILINEAR)) { // bilinear upscale
-        int i;
-        int xDstInSrc;
-        filterSize = 2;
-        FF_ALLOC_OR_GOTO(NULL, filter,
-                         dstW * sizeof(*filter) * filterSize, fail);
-
-        xDstInSrc = xInc / 2 - 0x8000;
-        for (i = 0; i < dstW; i++) {
-            int xx = (xDstInSrc - ((filterSize - 1) << 15) + (1 << 15)) >> 16;
-            int j;
-
-            (*filterPos)[i] = xx;
-            // bilinear upscale / linear interpolate / area averaging
-            for (j = 0; j < filterSize; j++) {
-                int64_t coeff = fone - FFABS((xx << 16) - xDstInSrc) *
-                                (fone >> 16);
-                if (coeff < 0)
-                    coeff = 0;
-                filter[i * filterSize + j] = coeff;
-                xx++;
-            }
-            xDstInSrc += xInc;
-        }
-    } else {
-        int64_t xDstInSrc;
-        int sizeFactor;
-
-        if (flags & SWS_BICUBIC)
-            sizeFactor = 4;
-        else if (flags & SWS_X)
-            sizeFactor = 8;
-        else if (flags & SWS_AREA)
-            sizeFactor = 1;     // downscale only, for upscale it is bilinear
-        else if (flags & SWS_GAUSS)
-            sizeFactor = 8;     // infinite ;)
-        else if (flags & SWS_LANCZOS)
-            sizeFactor = param[0] != SWS_PARAM_DEFAULT ? ceil(2 * param[0]) : 6;
-        else if (flags & SWS_SINC)
-            sizeFactor = 20;    // infinite ;)
-        else if (flags & SWS_SPLINE)
-            sizeFactor = 20;    // infinite ;)
-        else if (flags & SWS_BILINEAR)
-            sizeFactor = 2;
-        else {
-            sizeFactor = 0;     // GCC warning killer
-            assert(0);
-        }
-
-        if (xInc <= 1 << 16)
-            filterSize = 1 + sizeFactor;    // upscale
-        else
-            filterSize = 1 + (sizeFactor * srcW + dstW - 1) / dstW;
-
-        filterSize = FFMIN(filterSize, srcW - 2);
-        filterSize = FFMAX(filterSize, 1);
-
-        FF_ALLOC_OR_GOTO(NULL, filter,
-                         dstW * sizeof(*filter) * filterSize, fail);
-
-        xDstInSrc = xInc - 0x10000;
-        for (i = 0; i < dstW; i++) {
-            int xx = (xDstInSrc - ((int64_t)(filterSize - 2) << 16)) / (1 << 17);
-            int j;
-            (*filterPos)[i] = xx;
-            for (j = 0; j < filterSize; j++) {
-                int64_t d = (FFABS(((int64_t)xx << 17) - xDstInSrc)) << 13;
-                double floatd;
-                int64_t coeff;
-
-                if (xInc > 1 << 16)
-                    d = d * dstW / srcW;
-                floatd = d * (1.0 / (1 << 30));
-
-                if (flags & SWS_BICUBIC) {
-                    int64_t B = (param[0] != SWS_PARAM_DEFAULT ? param[0] :   0) * (1 << 24);
-                    int64_t C = (param[1] != SWS_PARAM_DEFAULT ? param[1] : 0.6) * (1 << 24);
-
-                    if (d >= 1LL << 31) {
-                        coeff = 0.0;
-                    } else {
-                        int64_t dd  = (d  * d) >> 30;
-                        int64_t ddd = (dd * d) >> 30;
-
-                        if (d < 1LL << 30)
-                            coeff =  (12 * (1 << 24) -  9 * B - 6 * C) * ddd +
-                                    (-18 * (1 << 24) + 12 * B + 6 * C) *  dd +
-                                      (6 * (1 << 24) -  2 * B)         * (1 << 30);
-                        else
-                            coeff =      (-B -  6 * C) * ddd +
-                                      (6 * B + 30 * C) * dd  +
-                                    (-12 * B - 48 * C) * d   +
-                                      (8 * B + 24 * C) * (1 << 30);
-                    }
-                    coeff *= fone >> (30 + 24);
-                }
-#if 0
-                else if (flags & SWS_X) {
-                    double p  = param ? param * 0.01 : 0.3;
-                    coeff     = d ? sin(d * M_PI) / (d * M_PI) : 1.0;
-                    coeff    *= pow(2.0, -p * d * d);
-                }
-#endif
-                else if (flags & SWS_X) {
-                    double A = param[0] != SWS_PARAM_DEFAULT ? param[0] : 1.0;
-                    double c;
-
-                    if (floatd < 1.0)
-                        c = cos(floatd * M_PI);
-                    else
-                        c = -1.0;
-                    if (c < 0.0)
-                        c = -pow(-c, A);
-                    else
-                        c = pow(c, A);
-                    coeff = (c * 0.5 + 0.5) * fone;
-                } else if (flags & SWS_AREA) {
-                    int64_t d2 = d - (1 << 29);
-                    if (d2 * xInc < -(1LL << (29 + 16)))
-                        coeff = 1.0 * (1LL << (30 + 16));
-                    else if (d2 * xInc < (1LL << (29 + 16)))
-                        coeff = -d2 * xInc + (1LL << (29 + 16));
-                    else
-                        coeff = 0.0;
-                    coeff *= fone >> (30 + 16);
-                } else if (flags & SWS_GAUSS) {
-                    double p = param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0;
-                    coeff = (pow(2.0, -p * floatd * floatd)) * fone;
-                } else if (flags & SWS_SINC) {
-                    coeff = (d ? sin(floatd * M_PI) / (floatd * M_PI) : 1.0) * fone;
-                } else if (flags & SWS_LANCZOS) {
-                    double p = param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0;
-                    coeff = (d ? sin(floatd * M_PI) * sin(floatd * M_PI / p) /
-                             (floatd * floatd * M_PI * M_PI / p) : 1.0) * fone;
-                    if (floatd > p)
-                        coeff = 0;
-                } else if (flags & SWS_BILINEAR) {
-                    coeff = (1 << 30) - d;
-                    if (coeff < 0)
-                        coeff = 0;
-                    coeff *= fone >> 30;
-                } else if (flags & SWS_SPLINE) {
-                    double p = -2.196152422706632;
-                    coeff = getSplineCoeff(1.0, 0.0, p, -p - 1.0, floatd) * fone;
-                } else {
-                    coeff = 0.0; // GCC warning killer
-                    assert(0);
-                }
-
-                filter[i * filterSize + j] = coeff;
-                xx++;
-            }
-            xDstInSrc += 2 * xInc;
-        }
-    }
-
-    /* apply src & dst Filter to filter -> filter2
-     * av_free(filter);
-     */
-    assert(filterSize > 0);
-    filter2Size = filterSize;
-    if (srcFilter)
-        filter2Size += srcFilter->length - 1;
-    if (dstFilter)
-        filter2Size += dstFilter->length - 1;
-    assert(filter2Size > 0);
-    FF_ALLOCZ_OR_GOTO(NULL, filter2, filter2Size * dstW * sizeof(*filter2), fail);
-
-    for (i = 0; i < dstW; i++) {
-        int j, k;
-
-        if (srcFilter) {
-            for (k = 0; k < srcFilter->length; k++) {
-                for (j = 0; j < filterSize; j++)
-                    filter2[i * filter2Size + k + j] +=
-                        srcFilter->coeff[k] * filter[i * filterSize + j];
-            }
-        } else {
-            for (j = 0; j < filterSize; j++)
-                filter2[i * filter2Size + j] = filter[i * filterSize + j];
-        }
-        // FIXME dstFilter
-
-        (*filterPos)[i] += (filterSize - 1) / 2 - (filter2Size - 1) / 2;
-    }
-    av_freep(&filter);
-
-    /* try to reduce the filter-size (step1 find size and shift left) */
-    // Assume it is near normalized (*0.5 or *2.0 is OK but * 0.001 is not).
-    minFilterSize = 0;
-    for (i = dstW - 1; i >= 0; i--) {
-        int min = filter2Size;
-        int j;
-        int64_t cutOff = 0.0;
-
-        /* get rid of near zero elements on the left by shifting left */
-        for (j = 0; j < filter2Size; j++) {
-            int k;
-            cutOff += FFABS(filter2[i * filter2Size]);
-
-            if (cutOff > SWS_MAX_REDUCE_CUTOFF * fone)
-                break;
-
-            /* preserve monotonicity because the core can't handle the
-             * filter otherwise */
-            if (i < dstW - 1 && (*filterPos)[i] >= (*filterPos)[i + 1])
-                break;
-
-            // move filter coefficients left
-            for (k = 1; k < filter2Size; k++)
-                filter2[i * filter2Size + k - 1] = filter2[i * filter2Size + k];
-            filter2[i * filter2Size + k - 1] = 0;
-            (*filterPos)[i]++;
-        }
-
-        cutOff = 0;
-        /* count near zeros on the right */
-        for (j = filter2Size - 1; j > 0; j--) {
-            cutOff += FFABS(filter2[i * filter2Size + j]);
-
-            if (cutOff > SWS_MAX_REDUCE_CUTOFF * fone)
-                break;
-            min--;
-        }
-
-        if (min > minFilterSize)
-            minFilterSize = min;
-    }
-
-    if (PPC_ALTIVEC(cpu_flags)) {
-        // we can handle the special case 4, so we don't want to go the full 8
-        if (minFilterSize < 5)
-            filterAlign = 4;
-
-        /* We really don't want to waste our time doing useless computation, so
-         * fall back on the scalar C code for very small filters.
-         * Vectorizing is worth it only if you have a decent-sized vector. */
-        if (minFilterSize < 3)
-            filterAlign = 1;
-    }
-
-    if (INLINE_MMX(cpu_flags)) {
-        // special case for unscaled vertical filtering
-        if (minFilterSize == 1 && filterAlign == 2)
-            filterAlign = 1;
-    }
-
-    assert(minFilterSize > 0);
-    filterSize = (minFilterSize + (filterAlign - 1)) & (~(filterAlign - 1));
-    assert(filterSize > 0);
-    filter = av_malloc(filterSize * dstW * sizeof(*filter));
-    if (filterSize >= MAX_FILTER_SIZE * 16 /
-                      ((flags & SWS_ACCURATE_RND) ? APCK_SIZE : 16) || !filter)
-        goto fail;
-    *outFilterSize = filterSize;
-
-    if (flags & SWS_PRINT_INFO)
-        av_log(NULL, AV_LOG_VERBOSE,
-               "SwScaler: reducing / aligning filtersize %d -> %d\n",
-               filter2Size, filterSize);
-    /* try to reduce the filter-size (step2 reduce it) */
-    for (i = 0; i < dstW; i++) {
-        int j;
-
-        for (j = 0; j < filterSize; j++) {
-            if (j >= filter2Size)
-                filter[i * filterSize + j] = 0;
-            else
-                filter[i * filterSize + j] = filter2[i * filter2Size + j];
-            if ((flags & SWS_BITEXACT) && j >= minFilterSize)
-                filter[i * filterSize + j] = 0;
-        }
-    }
-
-    // FIXME try to align filterPos if possible
-
-    // fix borders
-    if (is_horizontal) {
-        for (i = 0; i < dstW; i++) {
-            int j;
-            if ((*filterPos)[i] < 0) {
-                // move filter coefficients left to compensate for filterPos
-                for (j = 1; j < filterSize; j++) {
-                    int left = FFMAX(j + (*filterPos)[i], 0);
-                    filter[i * filterSize + left] += filter[i * filterSize + j];
-                    filter[i * filterSize + j]     = 0;
-                }
-                (*filterPos)[i] = 0;
-            }
-
-            if ((*filterPos)[i] + filterSize > srcW) {
-                int shift = (*filterPos)[i] + filterSize - srcW;
-                // move filter coefficients right to compensate for filterPos
-                for (j = filterSize - 2; j >= 0; j--) {
-                    int right = FFMIN(j + shift, filterSize - 1);
-                    filter[i * filterSize + right] += filter[i * filterSize + j];
-                    filter[i * filterSize + j]      = 0;
-                }
-                (*filterPos)[i] = srcW - filterSize;
-            }
-        }
-    }
-
-    // Note the +1 is for the MMX scaler which reads over the end
-    /* align at 16 for AltiVec (needed by hScale_altivec_real) */
-    FF_ALLOCZ_OR_GOTO(NULL, *outFilter,
-                      *outFilterSize * (dstW + 3) * sizeof(int16_t), fail);
-
-    /* normalize & store in outFilter */
-    for (i = 0; i < dstW; i++) {
-        int j;
-        int64_t error = 0;
-        int64_t sum   = 0;
-
-        for (j = 0; j < filterSize; j++) {
-            sum += filter[i * filterSize + j];
-        }
-        sum = (sum + one / 2) / one;
-        for (j = 0; j < *outFilterSize; j++) {
-            int64_t v = filter[i * filterSize + j] + error;
-            int intV  = ROUNDED_DIV(v, sum);
-            (*outFilter)[i * (*outFilterSize) + j] = intV;
-            error                                  = v - intV * sum;
-        }
-    }
-
-    (*filterPos)[dstW + 0] =
-    (*filterPos)[dstW + 1] =
-    (*filterPos)[dstW + 2] = (*filterPos)[dstW - 1]; /* the MMX/SSE scaler will
-                                                      * read over the end */
-    for (i = 0; i < *outFilterSize; i++) {
-        int k = (dstW - 1) * (*outFilterSize) + i;
-        (*outFilter)[k + 1 * (*outFilterSize)] =
-        (*outFilter)[k + 2 * (*outFilterSize)] =
-        (*outFilter)[k + 3 * (*outFilterSize)] = (*outFilter)[k];
-    }
-
-    ret = 0;
-
-fail:
-    av_free(filter);
-    av_free(filter2);
-    return ret;
-}
-
-#if HAVE_MMXEXT_INLINE
-static av_cold int init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode,
-                                       int16_t *filter, int32_t *filterPos,
-                                       int numSplits)
-{
-    uint8_t *fragmentA;
-    x86_reg imm8OfPShufW1A;
-    x86_reg imm8OfPShufW2A;
-    x86_reg fragmentLengthA;
-    uint8_t *fragmentB;
-    x86_reg imm8OfPShufW1B;
-    x86_reg imm8OfPShufW2B;
-    x86_reg fragmentLengthB;
-    int fragmentPos;
-
-    int xpos, i;
-
-    // create an optimized horizontal scaling routine
-    /* This scaler is made of runtime-generated MMXEXT code using specially tuned
-     * pshufw instructions. For every four output pixels, if four input pixels
-     * are enough for the fast bilinear scaling, then a chunk of fragmentB is
-     * used. If five input pixels are needed, then a chunk of fragmentA is used.
-     */
-
-    // code fragment
-
-    __asm__ volatile (
-        "jmp                         9f                 \n\t"
-        // Begin
-        "0:                                             \n\t"
-        "movq    (%%"REG_d", %%"REG_a"), %%mm3          \n\t"
-        "movd    (%%"REG_c", %%"REG_S"), %%mm0          \n\t"
-        "movd   1(%%"REG_c", %%"REG_S"), %%mm1          \n\t"
-        "punpcklbw                %%mm7, %%mm1          \n\t"
-        "punpcklbw                %%mm7, %%mm0          \n\t"
-        "pshufw                   $0xFF, %%mm1, %%mm1   \n\t"
-        "1:                                             \n\t"
-        "pshufw                   $0xFF, %%mm0, %%mm0   \n\t"
-        "2:                                             \n\t"
-        "psubw                    %%mm1, %%mm0          \n\t"
-        "movl   8(%%"REG_b", %%"REG_a"), %%esi          \n\t"
-        "pmullw                   %%mm3, %%mm0          \n\t"
-        "psllw                       $7, %%mm1          \n\t"
-        "paddw                    %%mm1, %%mm0          \n\t"
-
-        "movq                     %%mm0, (%%"REG_D", %%"REG_a") \n\t"
-
-        "add                         $8, %%"REG_a"      \n\t"
-        // End
-        "9:                                             \n\t"
-        // "int $3                                         \n\t"
-        "lea       " LOCAL_MANGLE(0b) ", %0             \n\t"
-        "lea       " LOCAL_MANGLE(1b) ", %1             \n\t"
-        "lea       " LOCAL_MANGLE(2b) ", %2             \n\t"
-        "dec                         %1                 \n\t"
-        "dec                         %2                 \n\t"
-        "sub                         %0, %1             \n\t"
-        "sub                         %0, %2             \n\t"
-        "lea       " LOCAL_MANGLE(9b) ", %3             \n\t"
-        "sub                         %0, %3             \n\t"
-
-
-        : "=r" (fragmentA), "=r" (imm8OfPShufW1A), "=r" (imm8OfPShufW2A),
-          "=r" (fragmentLengthA)
-        );
-
-    __asm__ volatile (
-        "jmp                         9f                 \n\t"
-        // Begin
-        "0:                                             \n\t"
-        "movq    (%%"REG_d", %%"REG_a"), %%mm3          \n\t"
-        "movd    (%%"REG_c", %%"REG_S"), %%mm0          \n\t"
-        "punpcklbw                %%mm7, %%mm0          \n\t"
-        "pshufw                   $0xFF, %%mm0, %%mm1   \n\t"
-        "1:                                             \n\t"
-        "pshufw                   $0xFF, %%mm0, %%mm0   \n\t"
-        "2:                                             \n\t"
-        "psubw                    %%mm1, %%mm0          \n\t"
-        "movl   8(%%"REG_b", %%"REG_a"), %%esi          \n\t"
-        "pmullw                   %%mm3, %%mm0          \n\t"
-        "psllw                       $7, %%mm1          \n\t"
-        "paddw                    %%mm1, %%mm0          \n\t"
-
-        "movq                     %%mm0, (%%"REG_D", %%"REG_a") \n\t"
-
-        "add                         $8, %%"REG_a"      \n\t"
-        // End
-        "9:                                             \n\t"
-        // "int                       $3                   \n\t"
-        "lea       " LOCAL_MANGLE(0b) ", %0             \n\t"
-        "lea       " LOCAL_MANGLE(1b) ", %1             \n\t"
-        "lea       " LOCAL_MANGLE(2b) ", %2             \n\t"
-        "dec                         %1                 \n\t"
-        "dec                         %2                 \n\t"
-        "sub                         %0, %1             \n\t"
-        "sub                         %0, %2             \n\t"
-        "lea       " LOCAL_MANGLE(9b) ", %3             \n\t"
-        "sub                         %0, %3             \n\t"
-
-
-        : "=r" (fragmentB), "=r" (imm8OfPShufW1B), "=r" (imm8OfPShufW2B),
-          "=r" (fragmentLengthB)
-        );
-
-    xpos        = 0; // lumXInc/2 - 0x8000; // difference between pixel centers
-    fragmentPos = 0;
-
-    for (i = 0; i < dstW / numSplits; i++) {
-        int xx = xpos >> 16;
-
-        if ((i & 3) == 0) {
-            int a                  = 0;
-            int b                  = ((xpos + xInc) >> 16) - xx;
-            int c                  = ((xpos + xInc * 2) >> 16) - xx;
-            int d                  = ((xpos + xInc * 3) >> 16) - xx;
-            int inc                = (d + 1 < 4);
-            uint8_t *fragment      = (d + 1 < 4) ? fragmentB : fragmentA;
-            x86_reg imm8OfPShufW1  = (d + 1 < 4) ? imm8OfPShufW1B : imm8OfPShufW1A;
-            x86_reg imm8OfPShufW2  = (d + 1 < 4) ? imm8OfPShufW2B : imm8OfPShufW2A;
-            x86_reg fragmentLength = (d + 1 < 4) ? fragmentLengthB : fragmentLengthA;
-            int maxShift           = 3 - (d + inc);
-            int shift              = 0;
-
-            if (filterCode) {
-                filter[i]        = ((xpos              & 0xFFFF) ^ 0xFFFF) >> 9;
-                filter[i + 1]    = (((xpos + xInc)     & 0xFFFF) ^ 0xFFFF) >> 9;
-                filter[i + 2]    = (((xpos + xInc * 2) & 0xFFFF) ^ 0xFFFF) >> 9;
-                filter[i + 3]    = (((xpos + xInc * 3) & 0xFFFF) ^ 0xFFFF) >> 9;
-                filterPos[i / 2] = xx;
-
-                memcpy(filterCode + fragmentPos, fragment, fragmentLength);
-
-                filterCode[fragmentPos + imm8OfPShufW1] =  (a + inc)       |
-                                                          ((b + inc) << 2) |
-                                                          ((c + inc) << 4) |
-                                                          ((d + inc) << 6);
-                filterCode[fragmentPos + imm8OfPShufW2] =  a | (b << 2) |
-                                                               (c << 4) |
-                                                               (d << 6);
-
-                if (i + 4 - inc >= dstW)
-                    shift = maxShift;               // avoid overread
-                else if ((filterPos[i / 2] & 3) <= maxShift)
-                    shift = filterPos[i / 2] & 3;   // align
-
-                if (shift && i >= shift) {
-                    filterCode[fragmentPos + imm8OfPShufW1] += 0x55 * shift;
-                    filterCode[fragmentPos + imm8OfPShufW2] += 0x55 * shift;
-                    filterPos[i / 2]                        -= shift;
-                }
-            }
-
-            fragmentPos += fragmentLength;
-
-            if (filterCode)
-                filterCode[fragmentPos] = RET;
-        }
-        xpos += xInc;
-    }
-    if (filterCode)
-        filterPos[((i / 2) + 1) & (~1)] = xpos >> 16;  // needed to jump to the next part
-
-    return fragmentPos + 1;
-}
-#endif /* HAVE_MMXEXT_INLINE */
-
-static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
-    *h = desc->log2_chroma_w;
-    *v = desc->log2_chroma_h;
-}
-
-int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
-                             int srcRange, const int table[4], int dstRange,
-                             int brightness, int contrast, int saturation)
-{
-    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(c->dstFormat);
-    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(c->srcFormat);
-    memcpy(c->srcColorspaceTable, inv_table, sizeof(int) * 4);
-    memcpy(c->dstColorspaceTable, table, sizeof(int) * 4);
-
-    c->brightness = brightness;
-    c->contrast   = contrast;
-    c->saturation = saturation;
-    c->srcRange   = srcRange;
-    c->dstRange   = dstRange;
-    if (isYUV(c->dstFormat) || isGray(c->dstFormat))
-        return -1;
-
-    c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
-    c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
-
-    ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness,
-                             contrast, saturation);
-    // FIXME factorize
-
-    if (ARCH_PPC)
-        ff_yuv2rgb_init_tables_ppc(c, inv_table, brightness,
-                                   contrast, saturation);
-    return 0;
-}
-
-int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
-                             int *srcRange, int **table, int *dstRange,
-                             int *brightness, int *contrast, int *saturation)
-{
-    if (isYUV(c->dstFormat) || isGray(c->dstFormat))
-        return -1;
-
-    *inv_table  = c->srcColorspaceTable;
-    *table      = c->dstColorspaceTable;
-    *srcRange   = c->srcRange;
-    *dstRange   = c->dstRange;
-    *brightness = c->brightness;
-    *contrast   = c->contrast;
-    *saturation = c->saturation;
-
-    return 0;
-}
-
-static int handle_jpeg(enum AVPixelFormat *format)
-{
-    switch (*format) {
-    case AV_PIX_FMT_YUVJ420P:
-        *format = AV_PIX_FMT_YUV420P;
-        return 1;
-    case AV_PIX_FMT_YUVJ422P:
-        *format = AV_PIX_FMT_YUV422P;
-        return 1;
-    case AV_PIX_FMT_YUVJ444P:
-        *format = AV_PIX_FMT_YUV444P;
-        return 1;
-    case AV_PIX_FMT_YUVJ440P:
-        *format = AV_PIX_FMT_YUV440P;
-        return 1;
-    default:
-        return 0;
-    }
-}
-
-SwsContext *sws_alloc_context(void)
-{
-    SwsContext *c = av_mallocz(sizeof(SwsContext));
-
-    if (c) {
-        c->av_class = &sws_context_class;
-        av_opt_set_defaults(c);
-    }
-
-    return c;
-}
-
-av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
-                             SwsFilter *dstFilter)
-{
-    int i;
-    int usesVFilter, usesHFilter;
-    int unscaled;
-    SwsFilter dummyFilter = { NULL, NULL, NULL, NULL };
-    int srcW              = c->srcW;
-    int srcH              = c->srcH;
-    int dstW              = c->dstW;
-    int dstH              = c->dstH;
-    int dst_stride        = FFALIGN(dstW * sizeof(int16_t) + 16, 16);
-    int dst_stride_px     = dst_stride >> 1;
-    int flags, cpu_flags;
-    enum AVPixelFormat srcFormat = c->srcFormat;
-    enum AVPixelFormat dstFormat = c->dstFormat;
-    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
-    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);
-
-    cpu_flags = av_get_cpu_flags();
-    flags     = c->flags;
-    emms_c();
-    if (!rgb15to16)
-        sws_rgb2rgb_init();
-
-    unscaled = (srcW == dstW && srcH == dstH);
-
-    if (!(unscaled && sws_isSupportedEndiannessConversion(srcFormat) &&
-          av_pix_fmt_swap_endianness(srcFormat) == dstFormat)) {
-    if (!sws_isSupportedInput(srcFormat)) {
-        av_log(c, AV_LOG_ERROR, "%s is not supported as input pixel format\n",
-               sws_format_name(srcFormat));
-        return AVERROR(EINVAL);
-    }
-    if (!sws_isSupportedOutput(dstFormat)) {
-        av_log(c, AV_LOG_ERROR, "%s is not supported as output pixel format\n",
-               sws_format_name(dstFormat));
-        return AVERROR(EINVAL);
-    }
-    }
-
-    i = flags & (SWS_POINT         |
-                 SWS_AREA          |
-                 SWS_BILINEAR      |
-                 SWS_FAST_BILINEAR |
-                 SWS_BICUBIC       |
-                 SWS_X             |
-                 SWS_GAUSS         |
-                 SWS_LANCZOS       |
-                 SWS_SINC          |
-                 SWS_SPLINE        |
-                 SWS_BICUBLIN);
-
-    /* provide a default scaler if not set by caller */
-    if (!i) {
-        if (dstW < srcW && dstH < srcH)
-            flags |= SWS_GAUSS;
-        else if (dstW > srcW && dstH > srcH)
-            flags |= SWS_SINC;
-        else
-            flags |= SWS_LANCZOS;
-        c->flags = flags;
-    } else if (i & (i - 1)) {
-        av_log(c, AV_LOG_ERROR,
-               "Exactly one scaler algorithm must be chosen\n");
-        return AVERROR(EINVAL);
-    }
-    /* sanity check */
-    if (srcW < 4 || srcH < 1 || dstW < 8 || dstH < 1) {
-        /* FIXME check if these are enough and try to lower them after
-         * fixing the relevant parts of the code */
-        av_log(c, AV_LOG_ERROR, "%dx%d -> %dx%d is invalid scaling dimension\n",
-               srcW, srcH, dstW, dstH);
-        return AVERROR(EINVAL);
-    }
-
-    if (!dstFilter)
-        dstFilter = &dummyFilter;
-    if (!srcFilter)
-        srcFilter = &dummyFilter;
-
-    c->lumXInc      = (((int64_t)srcW << 16) + (dstW >> 1)) / dstW;
-    c->lumYInc      = (((int64_t)srcH << 16) + (dstH >> 1)) / dstH;
-    c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
-    c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
-    c->vRounder     = 4 * 0x0001000100010001ULL;
-
-    usesVFilter = (srcFilter->lumV && srcFilter->lumV->length > 1) ||
-                  (srcFilter->chrV && srcFilter->chrV->length > 1) ||
-                  (dstFilter->lumV && dstFilter->lumV->length > 1) ||
-                  (dstFilter->chrV && dstFilter->chrV->length > 1);
-    usesHFilter = (srcFilter->lumH && srcFilter->lumH->length > 1) ||
-                  (srcFilter->chrH && srcFilter->chrH->length > 1) ||
-                  (dstFilter->lumH && dstFilter->lumH->length > 1) ||
-                  (dstFilter->chrH && dstFilter->chrH->length > 1);
-
-    getSubSampleFactors(&c->chrSrcHSubSample, &c->chrSrcVSubSample, srcFormat);
-    getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat);
-
-    if (isPlanarRGB(dstFormat)) {
-        if (!(flags & SWS_FULL_CHR_H_INT)) {
-            av_log(c, AV_LOG_DEBUG,
-                   "%s output is not supported with half chroma resolution, switching to full\n",
-                   av_get_pix_fmt_name(dstFormat));
-            flags   |= SWS_FULL_CHR_H_INT;
-            c->flags = flags;
-        }
-    }
-
-    /* reuse chroma for 2 pixels RGB/BGR unless user wants full
-     * chroma interpolation */
-    if (flags & SWS_FULL_CHR_H_INT &&
-        isAnyRGB(dstFormat)        &&
-        !isPlanarRGB(dstFormat)    &&
-        dstFormat != AV_PIX_FMT_RGBA  &&
-        dstFormat != AV_PIX_FMT_ARGB  &&
-        dstFormat != AV_PIX_FMT_BGRA  &&
-        dstFormat != AV_PIX_FMT_ABGR  &&
-        dstFormat != AV_PIX_FMT_RGB24 &&
-        dstFormat != AV_PIX_FMT_BGR24) {
-        av_log(c, AV_LOG_ERROR,
-               "full chroma interpolation for destination format '%s' not yet implemented\n",
-               sws_format_name(dstFormat));
-        flags   &= ~SWS_FULL_CHR_H_INT;
-        c->flags = flags;
-    }
-    if (isAnyRGB(dstFormat) && !(flags & SWS_FULL_CHR_H_INT))
-        c->chrDstHSubSample = 1;
-
-    // drop some chroma lines if the user wants it
-    c->vChrDrop          = (flags & SWS_SRC_V_CHR_DROP_MASK) >>
-                           SWS_SRC_V_CHR_DROP_SHIFT;
-    c->chrSrcVSubSample += c->vChrDrop;
-
-    /* drop every other pixel for chroma calculation unless user
-     * wants full chroma */
-    if (isAnyRGB(srcFormat) && !(flags & SWS_FULL_CHR_H_INP)   &&
-        srcFormat != AV_PIX_FMT_RGB8 && srcFormat != AV_PIX_FMT_BGR8 &&
-        srcFormat != AV_PIX_FMT_RGB4 && srcFormat != AV_PIX_FMT_BGR4 &&
-        srcFormat != AV_PIX_FMT_RGB4_BYTE && srcFormat != AV_PIX_FMT_BGR4_BYTE &&
-        srcFormat != AV_PIX_FMT_GBRP9BE   && srcFormat != AV_PIX_FMT_GBRP9LE  &&
-        srcFormat != AV_PIX_FMT_GBRP10BE  && srcFormat != AV_PIX_FMT_GBRP10LE &&
-        srcFormat != AV_PIX_FMT_GBRP16BE  && srcFormat != AV_PIX_FMT_GBRP16LE &&
-        ((dstW >> c->chrDstHSubSample) <= (srcW >> 1) ||
-         (flags & SWS_FAST_BILINEAR)))
-        c->chrSrcHSubSample = 1;
-
-    // Note the -((-x)>>y) is so that we always round toward +inf.
-    c->chrSrcW = -((-srcW) >> c->chrSrcHSubSample);
-    c->chrSrcH = -((-srcH) >> c->chrSrcVSubSample);
-    c->chrDstW = -((-dstW) >> c->chrDstHSubSample);
-    c->chrDstH = -((-dstH) >> c->chrDstVSubSample);
-
-    /* unscaled special cases */
-    if (unscaled && !usesHFilter && !usesVFilter &&
-        (c->srcRange == c->dstRange || isAnyRGB(dstFormat))) {
-        ff_get_unscaled_swscale(c);
-
-        if (c->swscale) {
-            if (flags & SWS_PRINT_INFO)
-                av_log(c, AV_LOG_INFO,
-                       "using unscaled %s -> %s special converter\n",
-                       sws_format_name(srcFormat), sws_format_name(dstFormat));
-            return 0;
-        }
-    }
-
-    c->srcBpc = 1 + desc_src->comp[0].depth_minus1;
-    if (c->srcBpc < 8)
-        c->srcBpc = 8;
-    c->dstBpc = 1 + desc_dst->comp[0].depth_minus1;
-    if (c->dstBpc < 8)
-        c->dstBpc = 8;
-    if (c->dstBpc == 16)
-        dst_stride <<= 1;
-    FF_ALLOC_OR_GOTO(c, c->formatConvBuffer,
-                     (FFALIGN(srcW, 16) * 2 * FFALIGN(c->srcBpc, 8) >> 3) + 16,
-                     fail);
-    if (INLINE_MMXEXT(cpu_flags) && c->srcBpc == 8 && c->dstBpc <= 10) {
-        c->canMMXEXTBeUsed = (dstW >= srcW && (dstW & 31) == 0 &&
-                              (srcW & 15) == 0) ? 1 : 0;
-        if (!c->canMMXEXTBeUsed && dstW >= srcW && (srcW & 15) == 0
-            && (flags & SWS_FAST_BILINEAR)) {
-            if (flags & SWS_PRINT_INFO)
-                av_log(c, AV_LOG_INFO,
-                       "output width is not a multiple of 32 -> no MMXEXT scaler\n");
-        }
-        if (usesHFilter)
-            c->canMMXEXTBeUsed = 0;
-    } else
-        c->canMMXEXTBeUsed = 0;
-
-    c->chrXInc = (((int64_t)c->chrSrcW << 16) + (c->chrDstW >> 1)) / c->chrDstW;
-    c->chrYInc = (((int64_t)c->chrSrcH << 16) + (c->chrDstH >> 1)) / c->chrDstH;
-
-    /* Match pixel 0 of the src to pixel 0 of dst and match pixel n-2 of src
-     * to pixel n-2 of dst, but only for the FAST_BILINEAR mode otherwise do
-     * correct scaling.
-     * n-2 is the last chrominance sample available.
-     * This is not perfect, but no one should notice the difference, the more
-     * correct variant would be like the vertical one, but that would require
-     * some special code for the first and last pixel */
-    if (flags & SWS_FAST_BILINEAR) {
-        if (c->canMMXEXTBeUsed) {
-            c->lumXInc += 20;
-            c->chrXInc += 20;
-        }
-        // we don't use the x86 asm scaler if MMX is available
-        else if (INLINE_MMX(cpu_flags)) {
-            c->lumXInc = ((int64_t)(srcW       - 2) << 16) / (dstW       - 2) - 20;
-            c->chrXInc = ((int64_t)(c->chrSrcW - 2) << 16) / (c->chrDstW - 2) - 20;
-        }
-    }
-
-#define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS)
-
-    /* precalculate horizontal scaler filter coefficients */
-    {
-#if HAVE_MMXEXT_INLINE
-// can't downscale !!!
-        if (c->canMMXEXTBeUsed && (flags & SWS_FAST_BILINEAR)) {
-            c->lumMmxextFilterCodeSize = init_hscaler_mmxext(dstW, c->lumXInc, NULL,
-                                                             NULL, NULL, 8);
-            c->chrMmxextFilterCodeSize = init_hscaler_mmxext(c->chrDstW, c->chrXInc,
-                                                             NULL, NULL, NULL, 4);
-
-#if USE_MMAP
-            c->lumMmxextFilterCode = mmap(NULL, c->lumMmxextFilterCodeSize,
-                                          PROT_READ | PROT_WRITE,
-                                          MAP_PRIVATE | MAP_ANONYMOUS,
-                                          -1, 0);
-            c->chrMmxextFilterCode = mmap(NULL, c->chrMmxextFilterCodeSize,
-                                          PROT_READ | PROT_WRITE,
-                                          MAP_PRIVATE | MAP_ANONYMOUS,
-                                          -1, 0);
-#elif HAVE_VIRTUALALLOC
-            c->lumMmxextFilterCode = VirtualAlloc(NULL,
-                                                  c->lumMmxextFilterCodeSize,
-                                                  MEM_COMMIT,
-                                                  PAGE_EXECUTE_READWRITE);
-            c->chrMmxextFilterCode = VirtualAlloc(NULL,
-                                                  c->chrMmxextFilterCodeSize,
-                                                  MEM_COMMIT,
-                                                  PAGE_EXECUTE_READWRITE);
-#else
-            c->lumMmxextFilterCode = av_malloc(c->lumMmxextFilterCodeSize);
-            c->chrMmxextFilterCode = av_malloc(c->chrMmxextFilterCodeSize);
-#endif
-
-            if (!c->lumMmxextFilterCode || !c->chrMmxextFilterCode)
-                return AVERROR(ENOMEM);
-            FF_ALLOCZ_OR_GOTO(c, c->hLumFilter,    (dstW           / 8 + 8) * sizeof(int16_t), fail);
-            FF_ALLOCZ_OR_GOTO(c, c->hChrFilter,    (c->chrDstW     / 4 + 8) * sizeof(int16_t), fail);
-            FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW       / 2 / 8 + 8) * sizeof(int32_t), fail);
-            FF_ALLOCZ_OR_GOTO(c, c->hChrFilterPos, (c->chrDstW / 2 / 4 + 8) * sizeof(int32_t), fail);
-
-            init_hscaler_mmxext(dstW, c->lumXInc, c->lumMmxextFilterCode,
-                                c->hLumFilter, c->hLumFilterPos, 8);
-            init_hscaler_mmxext(c->chrDstW, c->chrXInc, c->chrMmxextFilterCode,
-                                c->hChrFilter, c->hChrFilterPos, 4);
-
-#if USE_MMAP
-            mprotect(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ);
-            mprotect(c->chrMmxextFilterCode, c->chrMmxextFilterCodeSize, PROT_EXEC | PROT_READ);
-#endif
-        } else
-#endif /* HAVE_MMXEXT_INLINE */
-        {
-            const int filterAlign = X86_MMX(cpu_flags)     ? 4 :
-                                    PPC_ALTIVEC(cpu_flags) ? 8 : 1;
-
-            if (initFilter(&c->hLumFilter, &c->hLumFilterPos,
-                           &c->hLumFilterSize, c->lumXInc,
-                           srcW, dstW, filterAlign, 1 << 14,
-                           (flags & SWS_BICUBLIN) ? (flags | SWS_BICUBIC) : flags,
-                           cpu_flags, srcFilter->lumH, dstFilter->lumH,
-                           c->param, 1) < 0)
-                goto fail;
-            if (initFilter(&c->hChrFilter, &c->hChrFilterPos,
-                           &c->hChrFilterSize, c->chrXInc,
-                           c->chrSrcW, c->chrDstW, filterAlign, 1 << 14,
-                           (flags & SWS_BICUBLIN) ? (flags | SWS_BILINEAR) : flags,
-                           cpu_flags, srcFilter->chrH, dstFilter->chrH,
-                           c->param, 1) < 0)
-                goto fail;
-        }
-    } // initialize horizontal stuff
-
-    /* precalculate vertical scaler filter coefficients */
-    {
-        const int filterAlign = X86_MMX(cpu_flags)     ? 2 :
-                                PPC_ALTIVEC(cpu_flags) ? 8 : 1;
-
-        if (initFilter(&c->vLumFilter, &c->vLumFilterPos, &c->vLumFilterSize,
-                       c->lumYInc, srcH, dstH, filterAlign, (1 << 12),
-                       (flags & SWS_BICUBLIN) ? (flags | SWS_BICUBIC) : flags,
-                       cpu_flags, srcFilter->lumV, dstFilter->lumV,
-                       c->param, 0) < 0)
-            goto fail;
-        if (initFilter(&c->vChrFilter, &c->vChrFilterPos, &c->vChrFilterSize,
-                       c->chrYInc, c->chrSrcH, c->chrDstH,
-                       filterAlign, (1 << 12),
-                       (flags & SWS_BICUBLIN) ? (flags | SWS_BILINEAR) : flags,
-                       cpu_flags, srcFilter->chrV, dstFilter->chrV,
-                       c->param, 0) < 0)
-            goto fail;
-
-#if HAVE_ALTIVEC
-        FF_ALLOC_OR_GOTO(c, c->vYCoeffsBank, sizeof(vector signed short) * c->vLumFilterSize * c->dstH,    fail);
-        FF_ALLOC_OR_GOTO(c, c->vCCoeffsBank, sizeof(vector signed short) * c->vChrFilterSize * c->chrDstH, fail);
-
-        for (i = 0; i < c->vLumFilterSize * c->dstH; i++) {
-            int j;
-            short *p = (short *)&c->vYCoeffsBank[i];
-            for (j = 0; j < 8; j++)
-                p[j] = c->vLumFilter[i];
-        }
-
-        for (i = 0; i < c->vChrFilterSize * c->chrDstH; i++) {
-            int j;
-            short *p = (short *)&c->vCCoeffsBank[i];
-            for (j = 0; j < 8; j++)
-                p[j] = c->vChrFilter[i];
-        }
-#endif
-    }
-
-    // calculate buffer sizes so that they won't run out while handling these damn slices
-    c->vLumBufSize = c->vLumFilterSize;
-    c->vChrBufSize = c->vChrFilterSize;
-    for (i = 0; i < dstH; i++) {
-        int chrI      = (int64_t)i * c->chrDstH / dstH;
-        int nextSlice = FFMAX(c->vLumFilterPos[i] + c->vLumFilterSize - 1,
-                              ((c->vChrFilterPos[chrI] + c->vChrFilterSize - 1)
-                               << c->chrSrcVSubSample));
-
-        nextSlice >>= c->chrSrcVSubSample;
-        nextSlice <<= c->chrSrcVSubSample;
-        if (c->vLumFilterPos[i] + c->vLumBufSize < nextSlice)
-            c->vLumBufSize = nextSlice - c->vLumFilterPos[i];
-        if (c->vChrFilterPos[chrI] + c->vChrBufSize <
-            (nextSlice >> c->chrSrcVSubSample))
-            c->vChrBufSize = (nextSlice >> c->chrSrcVSubSample) -
-                             c->vChrFilterPos[chrI];
-    }
-
-    /* Allocate pixbufs (we use dynamic allocation because otherwise we would
-     * need to allocate several megabytes to handle all possible cases) */
-    FF_ALLOC_OR_GOTO(c, c->lumPixBuf,  c->vLumBufSize * 3 * sizeof(int16_t *), fail);
-    FF_ALLOC_OR_GOTO(c, c->chrUPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail);
-    FF_ALLOC_OR_GOTO(c, c->chrVPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail);
-    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat) && isALPHA(c->dstFormat))
-        FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf, c->vLumBufSize * 3 * sizeof(int16_t *), fail);
-    /* Note we need at least one pixel more at the end because of the MMX code
-     * (just in case someone wants to replace the 4000/8000). */
-    /* align at 16 bytes for AltiVec */
-    for (i = 0; i < c->vLumBufSize; i++) {
-        FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf[i + c->vLumBufSize],
-                          dst_stride + 16, fail);
-        c->lumPixBuf[i] = c->lumPixBuf[i + c->vLumBufSize];
-    }
-    // 64 / (c->dstBpc & ~7) is the same as 16 / sizeof(scaling_intermediate)
-    c->uv_off_px   = dst_stride_px + 64 / (c->dstBpc & ~7);
-    c->uv_off_byte = dst_stride + 16;
-    for (i = 0; i < c->vChrBufSize; i++) {
-        FF_ALLOC_OR_GOTO(c, c->chrUPixBuf[i + c->vChrBufSize],
-                         dst_stride * 2 + 32, fail);
-        c->chrUPixBuf[i] = c->chrUPixBuf[i + c->vChrBufSize];
-        c->chrVPixBuf[i] = c->chrVPixBuf[i + c->vChrBufSize]
-                         = c->chrUPixBuf[i] + (dst_stride >> 1) + 8;
-    }
-    if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
-        for (i = 0; i < c->vLumBufSize; i++) {
-            FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf[i + c->vLumBufSize],
-                              dst_stride + 16, fail);
-            c->alpPixBuf[i] = c->alpPixBuf[i + c->vLumBufSize];
-        }
-
-    // try to avoid drawing green stuff between the right end and the stride end
-    for (i = 0; i < c->vChrBufSize; i++)
-        memset(c->chrUPixBuf[i], 64, dst_stride * 2 + 1);
-
-    assert(c->chrDstH <= dstH);
-
-    if (flags & SWS_PRINT_INFO) {
-        if (flags & SWS_FAST_BILINEAR)
-            av_log(c, AV_LOG_INFO, "FAST_BILINEAR scaler, ");
-        else if (flags & SWS_BILINEAR)
-            av_log(c, AV_LOG_INFO, "BILINEAR scaler, ");
-        else if (flags & SWS_BICUBIC)
-            av_log(c, AV_LOG_INFO, "BICUBIC scaler, ");
-        else if (flags & SWS_X)
-            av_log(c, AV_LOG_INFO, "Experimental scaler, ");
-        else if (flags & SWS_POINT)
-            av_log(c, AV_LOG_INFO, "Nearest Neighbor / POINT scaler, ");
-        else if (flags & SWS_AREA)
-            av_log(c, AV_LOG_INFO, "Area Averaging scaler, ");
-        else if (flags & SWS_BICUBLIN)
-            av_log(c, AV_LOG_INFO, "luma BICUBIC / chroma BILINEAR scaler, ");
-        else if (flags & SWS_GAUSS)
-            av_log(c, AV_LOG_INFO, "Gaussian scaler, ");
-        else if (flags & SWS_SINC)
-            av_log(c, AV_LOG_INFO, "Sinc scaler, ");
-        else if (flags & SWS_LANCZOS)
-            av_log(c, AV_LOG_INFO, "Lanczos scaler, ");
-        else if (flags & SWS_SPLINE)
-            av_log(c, AV_LOG_INFO, "Bicubic spline scaler, ");
-        else
-            av_log(c, AV_LOG_INFO, "ehh flags invalid?! ");
-
-        av_log(c, AV_LOG_INFO, "from %s to %s%s ",
-               sws_format_name(srcFormat),
-#ifdef DITHER1XBPP
-               dstFormat == AV_PIX_FMT_BGR555   || dstFormat == AV_PIX_FMT_BGR565   ||
-               dstFormat == AV_PIX_FMT_RGB444BE || dstFormat == AV_PIX_FMT_RGB444LE ||
-               dstFormat == AV_PIX_FMT_BGR444BE || dstFormat == AV_PIX_FMT_BGR444LE ?
-                                                             "dithered " : "",
-#else
-               "",
-#endif
-               sws_format_name(dstFormat));
-
-        if (INLINE_MMXEXT(cpu_flags))
-            av_log(c, AV_LOG_INFO, "using MMXEXT\n");
-        else if (INLINE_AMD3DNOW(cpu_flags))
-            av_log(c, AV_LOG_INFO, "using 3DNOW\n");
-        else if (INLINE_MMX(cpu_flags))
-            av_log(c, AV_LOG_INFO, "using MMX\n");
-        else if (PPC_ALTIVEC(cpu_flags))
-            av_log(c, AV_LOG_INFO, "using AltiVec\n");
-        else
-            av_log(c, AV_LOG_INFO, "using C\n");
-
-        av_log(c, AV_LOG_VERBOSE, "%dx%d -> %dx%d\n", srcW, srcH, dstW, dstH);
-        av_log(c, AV_LOG_DEBUG,
-               "lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
-               c->srcW, c->srcH, c->dstW, c->dstH, c->lumXInc, c->lumYInc);
-        av_log(c, AV_LOG_DEBUG,
-               "chr srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
-               c->chrSrcW, c->chrSrcH, c->chrDstW, c->chrDstH,
-               c->chrXInc, c->chrYInc);
-    }
-
-    c->swscale = ff_getSwsFunc(c);
-    return 0;
-fail: // FIXME replace things by appropriate error codes
-    return -1;
-}
-
-#if FF_API_SWS_GETCONTEXT
-SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
-                           int dstW, int dstH, enum AVPixelFormat dstFormat,
-                           int flags, SwsFilter *srcFilter,
-                           SwsFilter *dstFilter, const double *param)
-{
-    SwsContext *c;
-
-    if (!(c = sws_alloc_context()))
-        return NULL;
-
-    c->flags     = flags;
-    c->srcW      = srcW;
-    c->srcH      = srcH;
-    c->dstW      = dstW;
-    c->dstH      = dstH;
-    c->srcRange  = handle_jpeg(&srcFormat);
-    c->dstRange  = handle_jpeg(&dstFormat);
-    c->srcFormat = srcFormat;
-    c->dstFormat = dstFormat;
-
-    if (param) {
-        c->param[0] = param[0];
-        c->param[1] = param[1];
-    }
-    sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], c->srcRange,
-                             ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/,
-                             c->dstRange, 0, 1 << 16, 1 << 16);
-
-    if (sws_init_context(c, srcFilter, dstFilter) < 0) {
-        sws_freeContext(c);
-        return NULL;
-    }
-
-    return c;
-}
-#endif
-
-SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
-                                float lumaSharpen, float chromaSharpen,
-                                float chromaHShift, float chromaVShift,
-                                int verbose)
-{
-    SwsFilter *filter = av_malloc(sizeof(SwsFilter));
-    if (!filter)
-        return NULL;
-
-    if (lumaGBlur != 0.0) {
-        filter->lumH = sws_getGaussianVec(lumaGBlur, 3.0);
-        filter->lumV = sws_getGaussianVec(lumaGBlur, 3.0);
-    } else {
-        filter->lumH = sws_getIdentityVec();
-        filter->lumV = sws_getIdentityVec();
-    }
-
-    if (chromaGBlur != 0.0) {
-        filter->chrH = sws_getGaussianVec(chromaGBlur, 3.0);
-        filter->chrV = sws_getGaussianVec(chromaGBlur, 3.0);
-    } else {
-        filter->chrH = sws_getIdentityVec();
-        filter->chrV = sws_getIdentityVec();
-    }
-
-    if (chromaSharpen != 0.0) {
-        SwsVector *id = sws_getIdentityVec();
-        sws_scaleVec(filter->chrH, -chromaSharpen);
-        sws_scaleVec(filter->chrV, -chromaSharpen);
-        sws_addVec(filter->chrH, id);
-        sws_addVec(filter->chrV, id);
-        sws_freeVec(id);
-    }
-
-    if (lumaSharpen != 0.0) {
-        SwsVector *id = sws_getIdentityVec();
-        sws_scaleVec(filter->lumH, -lumaSharpen);
-        sws_scaleVec(filter->lumV, -lumaSharpen);
-        sws_addVec(filter->lumH, id);
-        sws_addVec(filter->lumV, id);
-        sws_freeVec(id);
-    }
-
-    if (chromaHShift != 0.0)
-        sws_shiftVec(filter->chrH, (int)(chromaHShift + 0.5));
-
-    if (chromaVShift != 0.0)
-        sws_shiftVec(filter->chrV, (int)(chromaVShift + 0.5));
-
-    sws_normalizeVec(filter->chrH, 1.0);
-    sws_normalizeVec(filter->chrV, 1.0);
-    sws_normalizeVec(filter->lumH, 1.0);
-    sws_normalizeVec(filter->lumV, 1.0);
-
-    if (verbose)
-        sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG);
-    if (verbose)
-        sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG);
-
-    return filter;
-}
-
-SwsVector *sws_allocVec(int length)
-{
-    SwsVector *vec = av_malloc(sizeof(SwsVector));
-    if (!vec)
-        return NULL;
-    vec->length = length;
-    vec->coeff  = av_malloc(sizeof(double) * length);
-    if (!vec->coeff)
-        av_freep(&vec);
-    return vec;
-}
-
-SwsVector *sws_getGaussianVec(double variance, double quality)
-{
-    const int length = (int)(variance * quality + 0.5) | 1;
-    int i;
-    double middle  = (length - 1) * 0.5;
-    SwsVector *vec = sws_allocVec(length);
-
-    if (!vec)
-        return NULL;
-
-    for (i = 0; i < length; i++) {
-        double dist = i - middle;
-        vec->coeff[i] = exp(-dist * dist / (2 * variance * variance)) /
-                        sqrt(2 * variance * M_PI);
-    }
-
-    sws_normalizeVec(vec, 1.0);
-
-    return vec;
-}
-
-SwsVector *sws_getConstVec(double c, int length)
-{
-    int i;
-    SwsVector *vec = sws_allocVec(length);
-
-    if (!vec)
-        return NULL;
-
-    for (i = 0; i < length; i++)
-        vec->coeff[i] = c;
-
-    return vec;
-}
-
-SwsVector *sws_getIdentityVec(void)
-{
-    return sws_getConstVec(1.0, 1);
-}
-
-static double sws_dcVec(SwsVector *a)
-{
-    int i;
-    double sum = 0;
-
-    for (i = 0; i < a->length; i++)
-        sum += a->coeff[i];
-
-    return sum;
-}
-
-void sws_scaleVec(SwsVector *a, double scalar)
-{
-    int i;
-
-    for (i = 0; i < a->length; i++)
-        a->coeff[i] *= scalar;
-}
-
-void sws_normalizeVec(SwsVector *a, double height)
-{
-    sws_scaleVec(a, height / sws_dcVec(a));
-}
-
-static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b)
-{
-    int length = a->length + b->length - 1;
-    int i, j;
-    SwsVector *vec = sws_getConstVec(0.0, length);
-
-    if (!vec)
-        return NULL;
-
-    for (i = 0; i < a->length; i++) {
-        for (j = 0; j < b->length; j++) {
-            vec->coeff[i + j] += a->coeff[i] * b->coeff[j];
-        }
-    }
-
-    return vec;
-}
-
-static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b)
-{
-    int length = FFMAX(a->length, b->length);
-    int i;
-    SwsVector *vec = sws_getConstVec(0.0, length);
-
-    if (!vec)
-        return NULL;
-
-    for (i = 0; i < a->length; i++)
-        vec->coeff[i + (length - 1) / 2 - (a->length - 1) / 2] += a->coeff[i];
-    for (i = 0; i < b->length; i++)
-        vec->coeff[i + (length - 1) / 2 - (b->length - 1) / 2] += b->coeff[i];
-
-    return vec;
-}
-
-static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b)
-{
-    int length = FFMAX(a->length, b->length);
-    int i;
-    SwsVector *vec = sws_getConstVec(0.0, length);
-
-    if (!vec)
-        return NULL;
-
-    for (i = 0; i < a->length; i++)
-        vec->coeff[i + (length - 1) / 2 - (a->length - 1) / 2] += a->coeff[i];
-    for (i = 0; i < b->length; i++)
-        vec->coeff[i + (length - 1) / 2 - (b->length - 1) / 2] -= b->coeff[i];
-
-    return vec;
-}
-
-/* shift left / or right if "shift" is negative */
-static SwsVector *sws_getShiftedVec(SwsVector *a, int shift)
-{
-    int length = a->length + FFABS(shift) * 2;
-    int i;
-    SwsVector *vec = sws_getConstVec(0.0, length);
-
-    if (!vec)
-        return NULL;
-
-    for (i = 0; i < a->length; i++) {
-        vec->coeff[i + (length    - 1) / 2 -
-                       (a->length - 1) / 2 - shift] = a->coeff[i];
-    }
-
-    return vec;
-}
-
-void sws_shiftVec(SwsVector *a, int shift)
-{
-    SwsVector *shifted = sws_getShiftedVec(a, shift);
-    av_free(a->coeff);
-    a->coeff  = shifted->coeff;
-    a->length = shifted->length;
-    av_free(shifted);
-}
-
-void sws_addVec(SwsVector *a, SwsVector *b)
-{
-    SwsVector *sum = sws_sumVec(a, b);
-    av_free(a->coeff);
-    a->coeff  = sum->coeff;
-    a->length = sum->length;
-    av_free(sum);
-}
-
-void sws_subVec(SwsVector *a, SwsVector *b)
-{
-    SwsVector *diff = sws_diffVec(a, b);
-    av_free(a->coeff);
-    a->coeff  = diff->coeff;
-    a->length = diff->length;
-    av_free(diff);
-}
-
-void sws_convVec(SwsVector *a, SwsVector *b)
-{
-    SwsVector *conv = sws_getConvVec(a, b);
-    av_free(a->coeff);
-    a->coeff  = conv->coeff;
-    a->length = conv->length;
-    av_free(conv);
-}
-
-SwsVector *sws_cloneVec(SwsVector *a)
-{
-    int i;
-    SwsVector *vec = sws_allocVec(a->length);
-
-    if (!vec)
-        return NULL;
-
-    for (i = 0; i < a->length; i++)
-        vec->coeff[i] = a->coeff[i];
-
-    return vec;
-}
-
-void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level)
-{
-    int i;
-    double max = 0;
-    double min = 0;
-    double range;
-
-    for (i = 0; i < a->length; i++)
-        if (a->coeff[i] > max)
-            max = a->coeff[i];
-
-    for (i = 0; i < a->length; i++)
-        if (a->coeff[i] < min)
-            min = a->coeff[i];
-
-    range = max - min;
-
-    for (i = 0; i < a->length; i++) {
-        int x = (int)((a->coeff[i] - min) * 60.0 / range + 0.5);
-        av_log(log_ctx, log_level, "%1.3f ", a->coeff[i]);
-        for (; x > 0; x--)
-            av_log(log_ctx, log_level, " ");
-        av_log(log_ctx, log_level, "|\n");
-    }
-}
-
-void sws_freeVec(SwsVector *a)
-{
-    if (!a)
-        return;
-    av_freep(&a->coeff);
-    a->length = 0;
-    av_free(a);
-}
-
-void sws_freeFilter(SwsFilter *filter)
-{
-    if (!filter)
-        return;
-
-    if (filter->lumH)
-        sws_freeVec(filter->lumH);
-    if (filter->lumV)
-        sws_freeVec(filter->lumV);
-    if (filter->chrH)
-        sws_freeVec(filter->chrH);
-    if (filter->chrV)
-        sws_freeVec(filter->chrV);
-    av_free(filter);
-}
-
-void sws_freeContext(SwsContext *c)
-{
-    int i;
-    if (!c)
-        return;
-
-    if (c->lumPixBuf) {
-        for (i = 0; i < c->vLumBufSize; i++)
-            av_freep(&c->lumPixBuf[i]);
-        av_freep(&c->lumPixBuf);
-    }
-
-    if (c->chrUPixBuf) {
-        for (i = 0; i < c->vChrBufSize; i++)
-            av_freep(&c->chrUPixBuf[i]);
-        av_freep(&c->chrUPixBuf);
-        av_freep(&c->chrVPixBuf);
-    }
-
-    if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) {
-        for (i = 0; i < c->vLumBufSize; i++)
-            av_freep(&c->alpPixBuf[i]);
-        av_freep(&c->alpPixBuf);
-    }
-
-    av_freep(&c->vLumFilter);
-    av_freep(&c->vChrFilter);
-    av_freep(&c->hLumFilter);
-    av_freep(&c->hChrFilter);
-#if HAVE_ALTIVEC
-    av_freep(&c->vYCoeffsBank);
-    av_freep(&c->vCCoeffsBank);
-#endif
-
-    av_freep(&c->vLumFilterPos);
-    av_freep(&c->vChrFilterPos);
-    av_freep(&c->hLumFilterPos);
-    av_freep(&c->hChrFilterPos);
-
-#if HAVE_MMX_INLINE
-#if USE_MMAP
-    if (c->lumMmxextFilterCode)
-        munmap(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize);
-    if (c->chrMmxextFilterCode)
-        munmap(c->chrMmxextFilterCode, c->chrMmxextFilterCodeSize);
-#elif HAVE_VIRTUALALLOC
-    if (c->lumMmxextFilterCode)
-        VirtualFree(c->lumMmxextFilterCode, 0, MEM_RELEASE);
-    if (c->chrMmxextFilterCode)
-        VirtualFree(c->chrMmxextFilterCode, 0, MEM_RELEASE);
-#else
-    av_free(c->lumMmxextFilterCode);
-    av_free(c->chrMmxextFilterCode);
-#endif
-    c->lumMmxextFilterCode = NULL;
-    c->chrMmxextFilterCode = NULL;
-#endif /* HAVE_MMX_INLINE */
-
-    av_freep(&c->yuvTable);
-    av_free(c->formatConvBuffer);
-
-    av_free(c);
-}
-
-struct SwsContext *sws_getCachedContext(struct SwsContext *context, int srcW,
-                                        int srcH, enum AVPixelFormat srcFormat,
-                                        int dstW, int dstH,
-                                        enum AVPixelFormat dstFormat, int flags,
-                                        SwsFilter *srcFilter,
-                                        SwsFilter *dstFilter,
-                                        const double *param)
-{
-    static const double default_param[2] = { SWS_PARAM_DEFAULT,
-                                             SWS_PARAM_DEFAULT };
-
-    if (!param)
-        param = default_param;
-
-    if (context &&
-        (context->srcW      != srcW      ||
-         context->srcH      != srcH      ||
-         context->srcFormat != srcFormat ||
-         context->dstW      != dstW      ||
-         context->dstH      != dstH      ||
-         context->dstFormat != dstFormat ||
-         context->flags     != flags     ||
-         context->param[0]  != param[0]  ||
-         context->param[1]  != param[1])) {
-        sws_freeContext(context);
-        context = NULL;
-    }
-
-    if (!context) {
-        if (!(context = sws_alloc_context()))
-            return NULL;
-        context->srcW      = srcW;
-        context->srcH      = srcH;
-        context->srcRange  = handle_jpeg(&srcFormat);
-        context->srcFormat = srcFormat;
-        context->dstW      = dstW;
-        context->dstH      = dstH;
-        context->dstRange  = handle_jpeg(&dstFormat);
-        context->dstFormat = dstFormat;
-        context->flags     = flags;
-        context->param[0]  = param[0];
-        context->param[1]  = param[1];
-        sws_setColorspaceDetails(context, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT],
-                                 context->srcRange,
-                                 ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/,
-                                 context->dstRange, 0, 1 << 16, 1 << 16);
-        if (sws_init_context(context, srcFilter, dstFilter) < 0) {
-            sws_freeContext(context);
-            return NULL;
-        }
-    }
-    return context;
-}
diff --git a/deps/libav/libswscale/version.h b/deps/libav/libswscale/version.h
deleted file mode 100644
index 0f32c7a..0000000
--- a/deps/libav/libswscale/version.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWSCALE_VERSION_H
-#define SWSCALE_VERSION_H
-
-/**
- * @file
- * swscale version macros
- */
-
-#include "libavutil/version.h"
-
-#define LIBSWSCALE_VERSION_MAJOR 2
-#define LIBSWSCALE_VERSION_MINOR 1
-#define LIBSWSCALE_VERSION_MICRO 2
-
-#define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
-                                               LIBSWSCALE_VERSION_MINOR, \
-                                               LIBSWSCALE_VERSION_MICRO)
-#define LIBSWSCALE_VERSION      AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
-                                           LIBSWSCALE_VERSION_MINOR, \
-                                           LIBSWSCALE_VERSION_MICRO)
-#define LIBSWSCALE_BUILD        LIBSWSCALE_VERSION_INT
-
-#define LIBSWSCALE_IDENT        "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
-
-/**
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- */
-
-#ifndef FF_API_SWS_GETCONTEXT
-#define FF_API_SWS_GETCONTEXT  (LIBSWSCALE_VERSION_MAJOR < 3)
-#endif
-#ifndef FF_API_SWS_CPU_CAPS
-#define FF_API_SWS_CPU_CAPS    (LIBSWSCALE_VERSION_MAJOR < 3)
-#endif
-
-#endif /* SWSCALE_VERSION_H */
diff --git a/deps/libav/libswscale/x86/Makefile b/deps/libav/libswscale/x86/Makefile
deleted file mode 100644
index b94b14a..0000000
--- a/deps/libav/libswscale/x86/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-OBJS                            += x86/rgb2rgb.o                        \
-                                   x86/swscale.o                        \
-                                   x86/yuv2rgb.o                        \
-
-OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
-
-YASM-OBJS                       += x86/input.o                          \
-                                   x86/output.o                         \
-                                   x86/scale.o                          \
diff --git a/deps/libav/libswscale/x86/input.asm b/deps/libav/libswscale/x86/input.asm
deleted file mode 100644
index 6f5677e..0000000
--- a/deps/libav/libswscale/x86/input.asm
+++ /dev/null
@@ -1,668 +0,0 @@
-;******************************************************************************
-;* x86-optimized input routines; does shuffling of packed
-;* YUV formats into individual planes, and converts RGB
-;* into YUV planes also.
-;* Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-%define RY 0x20DE
-%define GY 0x4087
-%define BY 0x0C88
-%define RU 0xECFF
-%define GU 0xDAC8
-%define BU 0x3838
-%define RV 0x3838
-%define GV 0xD0E3
-%define BV 0xF6E4
-
-rgb_Yrnd:        times 4 dd 0x84000        ;  16.5 << 15
-rgb_UVrnd:       times 4 dd 0x404000       ; 128.5 << 15
-bgr_Ycoeff_12x4: times 2 dw BY, GY, 0, BY
-bgr_Ycoeff_3x56: times 2 dw RY, 0, GY, RY
-rgb_Ycoeff_12x4: times 2 dw RY, GY, 0, RY
-rgb_Ycoeff_3x56: times 2 dw BY, 0, GY, BY
-bgr_Ucoeff_12x4: times 2 dw BU, GU, 0, BU
-bgr_Ucoeff_3x56: times 2 dw RU, 0, GU, RU
-rgb_Ucoeff_12x4: times 2 dw RU, GU, 0, RU
-rgb_Ucoeff_3x56: times 2 dw BU, 0, GU, BU
-bgr_Vcoeff_12x4: times 2 dw BV, GV, 0, BV
-bgr_Vcoeff_3x56: times 2 dw RV, 0, GV, RV
-rgb_Vcoeff_12x4: times 2 dw RV, GV, 0, RV
-rgb_Vcoeff_3x56: times 2 dw BV, 0, GV, BV
-
-rgba_Ycoeff_rb:  times 4 dw RY, BY
-rgba_Ycoeff_br:  times 4 dw BY, RY
-rgba_Ycoeff_ga:  times 4 dw GY, 0
-rgba_Ycoeff_ag:  times 4 dw 0,  GY
-rgba_Ucoeff_rb:  times 4 dw RU, BU
-rgba_Ucoeff_br:  times 4 dw BU, RU
-rgba_Ucoeff_ga:  times 4 dw GU, 0
-rgba_Ucoeff_ag:  times 4 dw 0,  GU
-rgba_Vcoeff_rb:  times 4 dw RV, BV
-rgba_Vcoeff_br:  times 4 dw BV, RV
-rgba_Vcoeff_ga:  times 4 dw GV, 0
-rgba_Vcoeff_ag:  times 4 dw 0,  GV
-
-shuf_rgb_12x4:   db 0, 0x80, 1, 0x80,  2, 0x80,  3, 0x80, \
-                    6, 0x80, 7, 0x80,  8, 0x80,  9, 0x80
-shuf_rgb_3x56:   db 2, 0x80, 3, 0x80,  4, 0x80,  5, 0x80, \
-                    8, 0x80, 9, 0x80, 10, 0x80, 11, 0x80
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; RGB to Y/UV.
-;
-; void <fmt>ToY_<opt>(uint8_t *dst, const uint8_t *src, int w);
-; and
-; void <fmt>toUV_<opt>(uint8_t *dstU, uint8_t *dstV, const uint8_t *src,
-;                      const uint8_t *unused, int w);
-;-----------------------------------------------------------------------------
-
-; %1 = nr. of XMM registers
-; %2 = rgb or bgr
-%macro RGB24_TO_Y_FN 2-3
-cglobal %2 %+ 24ToY, 3, 3, %1, dst, src, w
-%if mmsize == 8
-    mova           m5, [%2_Ycoeff_12x4]
-    mova           m6, [%2_Ycoeff_3x56]
-%define coeff1 m5
-%define coeff2 m6
-%elif ARCH_X86_64
-    mova           m8, [%2_Ycoeff_12x4]
-    mova           m9, [%2_Ycoeff_3x56]
-%define coeff1 m8
-%define coeff2 m9
-%else ; x86-32 && mmsize == 16
-%define coeff1 [%2_Ycoeff_12x4]
-%define coeff2 [%2_Ycoeff_3x56]
-%endif ; x86-32/64 && mmsize == 8/16
-%if (ARCH_X86_64 || mmsize == 8) && %0 == 3
-    jmp mangle(private_prefix %+ _ %+ %3 %+ 24ToY %+ SUFFIX).body
-%else ; (ARCH_X86_64 && %0 == 3) || mmsize == 8
-.body:
-%if cpuflag(ssse3)
-    mova           m7, [shuf_rgb_12x4]
-%define shuf_rgb1 m7
-%if ARCH_X86_64
-    mova          m10, [shuf_rgb_3x56]
-%define shuf_rgb2 m10
-%else ; x86-32
-%define shuf_rgb2 [shuf_rgb_3x56]
-%endif ; x86-32/64
-%endif ; cpuflag(ssse3)
-%if ARCH_X86_64
-    movsxd         wq, wd
-%endif
-    add          dstq, wq
-    neg            wq
-%if notcpuflag(ssse3)
-    pxor           m7, m7
-%endif ; !cpuflag(ssse3)
-    mova           m4, [rgb_Yrnd]
-.loop:
-%if cpuflag(ssse3)
-    movu           m0, [srcq+0]           ; (byte) { Bx, Gx, Rx }[0-3]
-    movu           m2, [srcq+12]          ; (byte) { Bx, Gx, Rx }[4-7]
-    pshufb         m1, m0, shuf_rgb2      ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 }
-    pshufb         m0, shuf_rgb1          ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 }
-    pshufb         m3, m2, shuf_rgb2      ; (word) { R4, B5, G5, R5, R6, B7, G7, R7 }
-    pshufb         m2, shuf_rgb1          ; (word) { B4, G4, R4, B5, B6, G6, R6, B7 }
-%else ; !cpuflag(ssse3)
-    movd           m0, [srcq+0]           ; (byte) { B0, G0, R0, B1 }
-    movd           m1, [srcq+2]           ; (byte) { R0, B1, G1, R1 }
-    movd           m2, [srcq+6]           ; (byte) { B2, G2, R2, B3 }
-    movd           m3, [srcq+8]           ; (byte) { R2, B3, G3, R3 }
-%if mmsize == 16 ; i.e. sse2
-    punpckldq      m0, m2                 ; (byte) { B0, G0, R0, B1, B2, G2, R2, B3 }
-    punpckldq      m1, m3                 ; (byte) { R0, B1, G1, R1, R2, B3, G3, R3 }
-    movd           m2, [srcq+12]          ; (byte) { B4, G4, R4, B5 }
-    movd           m3, [srcq+14]          ; (byte) { R4, B5, G5, R5 }
-    movd           m5, [srcq+18]          ; (byte) { B6, G6, R6, B7 }
-    movd           m6, [srcq+20]          ; (byte) { R6, B7, G7, R7 }
-    punpckldq      m2, m5                 ; (byte) { B4, G4, R4, B5, B6, G6, R6, B7 }
-    punpckldq      m3, m6                 ; (byte) { R4, B5, G5, R5, R6, B7, G7, R7 }
-%endif ; mmsize == 16
-    punpcklbw      m0, m7                 ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 }
-    punpcklbw      m1, m7                 ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 }
-    punpcklbw      m2, m7                 ; (word) { B4, G4, R4, B5, B6, G6, R6, B7 }
-    punpcklbw      m3, m7                 ; (word) { R4, B5, G5, R5, R6, B7, G7, R7 }
-%endif ; cpuflag(ssse3)
-    add          srcq, 3 * mmsize / 2
-    pmaddwd        m0, coeff1             ; (dword) { B0*BY + G0*GY, B1*BY, B2*BY + G2*GY, B3*BY }
-    pmaddwd        m1, coeff2             ; (dword) { R0*RY, G1+GY + R1*RY, R2*RY, G3+GY + R3*RY }
-    pmaddwd        m2, coeff1             ; (dword) { B4*BY + G4*GY, B5*BY, B6*BY + G6*GY, B7*BY }
-    pmaddwd        m3, coeff2             ; (dword) { R4*RY, G5+GY + R5*RY, R6*RY, G7+GY + R7*RY }
-    paddd          m0, m1                 ; (dword) { Bx*BY + Gx*GY + Rx*RY }[0-3]
-    paddd          m2, m3                 ; (dword) { Bx*BY + Gx*GY + Rx*RY }[4-7]
-    paddd          m0, m4                 ; += rgb_Yrnd, i.e. (dword) { Y[0-3] }
-    paddd          m2, m4                 ; += rgb_Yrnd, i.e. (dword) { Y[4-7] }
-    psrad          m0, 15
-    psrad          m2, 15
-    packssdw       m0, m2                 ; (word) { Y[0-7] }
-    packuswb       m0, m0                 ; (byte) { Y[0-7] }
-    movh    [dstq+wq], m0
-    add            wq, mmsize / 2
-    jl .loop
-    REP_RET
-%endif ; (ARCH_X86_64 && %0 == 3) || mmsize == 8
-%endmacro
-
-; %1 = nr. of XMM registers
-; %2 = rgb or bgr
-%macro RGB24_TO_UV_FN 2-3
-cglobal %2 %+ 24ToUV, 3, 4, %1, dstU, dstV, src, w
-%if ARCH_X86_64
-    mova           m8, [%2_Ucoeff_12x4]
-    mova           m9, [%2_Ucoeff_3x56]
-    mova          m10, [%2_Vcoeff_12x4]
-    mova          m11, [%2_Vcoeff_3x56]
-%define coeffU1 m8
-%define coeffU2 m9
-%define coeffV1 m10
-%define coeffV2 m11
-%else ; x86-32
-%define coeffU1 [%2_Ucoeff_12x4]
-%define coeffU2 [%2_Ucoeff_3x56]
-%define coeffV1 [%2_Vcoeff_12x4]
-%define coeffV2 [%2_Vcoeff_3x56]
-%endif ; x86-32/64
-%if ARCH_X86_64 && %0 == 3
-    jmp mangle(private_prefix %+ _ %+ %3 %+ 24ToUV %+ SUFFIX).body
-%else ; ARCH_X86_64 && %0 == 3
-.body:
-%if cpuflag(ssse3)
-    mova           m7, [shuf_rgb_12x4]
-%define shuf_rgb1 m7
-%if ARCH_X86_64
-    mova          m12, [shuf_rgb_3x56]
-%define shuf_rgb2 m12
-%else ; x86-32
-%define shuf_rgb2 [shuf_rgb_3x56]
-%endif ; x86-32/64
-%endif ; cpuflag(ssse3)
-%if ARCH_X86_64
-    movsxd         wq, dword r4m
-%else ; x86-32
-    mov            wq, r4m
-%endif
-    add         dstUq, wq
-    add         dstVq, wq
-    neg            wq
-    mova           m6, [rgb_UVrnd]
-%if notcpuflag(ssse3)
-    pxor           m7, m7
-%endif
-.loop:
-%if cpuflag(ssse3)
-    movu           m0, [srcq+0]           ; (byte) { Bx, Gx, Rx }[0-3]
-    movu           m4, [srcq+12]          ; (byte) { Bx, Gx, Rx }[4-7]
-    pshufb         m1, m0, shuf_rgb2      ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 }
-    pshufb         m0, shuf_rgb1          ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 }
-%else ; !cpuflag(ssse3)
-    movd           m0, [srcq+0]           ; (byte) { B0, G0, R0, B1 }
-    movd           m1, [srcq+2]           ; (byte) { R0, B1, G1, R1 }
-    movd           m4, [srcq+6]           ; (byte) { B2, G2, R2, B3 }
-    movd           m5, [srcq+8]           ; (byte) { R2, B3, G3, R3 }
-%if mmsize == 16
-    punpckldq      m0, m4                 ; (byte) { B0, G0, R0, B1, B2, G2, R2, B3 }
-    punpckldq      m1, m5                 ; (byte) { R0, B1, G1, R1, R2, B3, G3, R3 }
-    movd           m4, [srcq+12]          ; (byte) { B4, G4, R4, B5 }
-    movd           m5, [srcq+14]          ; (byte) { R4, B5, G5, R5 }
-%endif ; mmsize == 16
-    punpcklbw      m0, m7                 ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 }
-    punpcklbw      m1, m7                 ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 }
-%endif ; cpuflag(ssse3)
-    pmaddwd        m2, m0, coeffV1        ; (dword) { B0*BV + G0*GV, B1*BV, B2*BV + G2*GV, B3*BV }
-    pmaddwd        m3, m1, coeffV2        ; (dword) { R0*BV, G1*GV + R1*BV, R2*BV, G3*GV + R3*BV }
-    pmaddwd        m0, coeffU1            ; (dword) { B0*BU + G0*GU, B1*BU, B2*BU + G2*GU, B3*BU }
-    pmaddwd        m1, coeffU2            ; (dword) { R0*BU, G1*GU + R1*BU, R2*BU, G3*GU + R3*BU }
-    paddd          m0, m1                 ; (dword) { Bx*BU + Gx*GU + Rx*RU }[0-3]
-    paddd          m2, m3                 ; (dword) { Bx*BV + Gx*GV + Rx*RV }[0-3]
-%if cpuflag(ssse3)
-    pshufb         m5, m4, shuf_rgb2      ; (word) { R4, B5, G5, R5, R6, B7, G7, R7 }
-    pshufb         m4, shuf_rgb1          ; (word) { B4, G4, R4, B5, B6, G6, R6, B7 }
-%else ; !cpuflag(ssse3)
-%if mmsize == 16
-    movd           m1, [srcq+18]          ; (byte) { B6, G6, R6, B7 }
-    movd           m3, [srcq+20]          ; (byte) { R6, B7, G7, R7 }
-    punpckldq      m4, m1                 ; (byte) { B4, G4, R4, B5, B6, G6, R6, B7 }
-    punpckldq      m5, m3                 ; (byte) { R4, B5, G5, R5, R6, B7, G7, R7 }
-%endif ; mmsize == 16 && !cpuflag(ssse3)
-    punpcklbw      m4, m7                 ; (word) { B4, G4, R4, B5, B6, G6, R6, B7 }
-    punpcklbw      m5, m7                 ; (word) { R4, B5, G5, R5, R6, B7, G7, R7 }
-%endif ; cpuflag(ssse3)
-    add          srcq, 3 * mmsize / 2
-    pmaddwd        m1, m4, coeffU1        ; (dword) { B4*BU + G4*GU, B5*BU, B6*BU + G6*GU, B7*BU }
-    pmaddwd        m3, m5, coeffU2        ; (dword) { R4*BU, G5*GU + R5*BU, R6*BU, G7*GU + R7*BU }
-    pmaddwd        m4, coeffV1            ; (dword) { B4*BV + G4*GV, B5*BV, B6*BV + G6*GV, B7*BV }
-    pmaddwd        m5, coeffV2            ; (dword) { R4*BV, G5*GV + R5*BV, R6*BV, G7*GV + R7*BV }
-    paddd          m1, m3                 ; (dword) { Bx*BU + Gx*GU + Rx*RU }[4-7]
-    paddd          m4, m5                 ; (dword) { Bx*BV + Gx*GV + Rx*RV }[4-7]
-    paddd          m0, m6                 ; += rgb_UVrnd, i.e. (dword) { U[0-3] }
-    paddd          m2, m6                 ; += rgb_UVrnd, i.e. (dword) { V[0-3] }
-    paddd          m1, m6                 ; += rgb_UVrnd, i.e. (dword) { U[4-7] }
-    paddd          m4, m6                 ; += rgb_UVrnd, i.e. (dword) { V[4-7] }
-    psrad          m0, 15
-    psrad          m2, 15
-    psrad          m1, 15
-    psrad          m4, 15
-    packssdw       m0, m1                 ; (word) { U[0-7] }
-    packssdw       m2, m4                 ; (word) { V[0-7] }
-%if mmsize == 8
-    packuswb       m0, m0                 ; (byte) { U[0-3] }
-    packuswb       m2, m2                 ; (byte) { V[0-3] }
-    movh   [dstUq+wq], m0
-    movh   [dstVq+wq], m2
-%else ; mmsize == 16
-    packuswb       m0, m2                 ; (byte) { U[0-7], V[0-7] }
-    movh   [dstUq+wq], m0
-    movhps [dstVq+wq], m0
-%endif ; mmsize == 8/16
-    add            wq, mmsize / 2
-    jl .loop
-    REP_RET
-%endif ; ARCH_X86_64 && %0 == 3
-%endmacro
-
-; %1 = nr. of XMM registers for rgb-to-Y func
-; %2 = nr. of XMM registers for rgb-to-UV func
-%macro RGB24_FUNCS 2
-RGB24_TO_Y_FN %1, rgb
-RGB24_TO_Y_FN %1, bgr, rgb
-RGB24_TO_UV_FN %2, rgb
-RGB24_TO_UV_FN %2, bgr, rgb
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-RGB24_FUNCS 0, 0
-%endif
-
-INIT_XMM sse2
-RGB24_FUNCS 10, 12
-
-INIT_XMM ssse3
-RGB24_FUNCS 11, 13
-
-INIT_XMM avx
-RGB24_FUNCS 11, 13
-
-; %1 = nr. of XMM registers
-; %2-5 = rgba, bgra, argb or abgr (in individual characters)
-%macro RGB32_TO_Y_FN 5-6
-cglobal %2%3%4%5 %+ ToY, 3, 3, %1, dst, src, w
-    mova           m5, [rgba_Ycoeff_%2%4]
-    mova           m6, [rgba_Ycoeff_%3%5]
-%if %0 == 6
-    jmp mangle(private_prefix %+ _ %+ %6 %+ ToY %+ SUFFIX).body
-%else ; %0 == 6
-.body:
-%if ARCH_X86_64
-    movsxd         wq, wd
-%endif
-    lea          srcq, [srcq+wq*4]
-    add          dstq, wq
-    neg            wq
-    mova           m4, [rgb_Yrnd]
-    pcmpeqb        m7, m7
-    psrlw          m7, 8                  ; (word) { 0x00ff } x4
-.loop:
-    ; FIXME check alignment and use mova
-    movu           m0, [srcq+wq*4+0]      ; (byte) { Bx, Gx, Rx, xx }[0-3]
-    movu           m2, [srcq+wq*4+mmsize] ; (byte) { Bx, Gx, Rx, xx }[4-7]
-    DEINTB          1,  0,  3,  2,  7     ; (word) { Gx, xx (m0/m2) or Bx, Rx (m1/m3) }[0-3]/[4-7]
-    pmaddwd        m1, m5                 ; (dword) { Bx*BY + Rx*RY }[0-3]
-    pmaddwd        m0, m6                 ; (dword) { Gx*GY }[0-3]
-    pmaddwd        m3, m5                 ; (dword) { Bx*BY + Rx*RY }[4-7]
-    pmaddwd        m2, m6                 ; (dword) { Gx*GY }[4-7]
-    paddd          m0, m4                 ; += rgb_Yrnd
-    paddd          m2, m4                 ; += rgb_Yrnd
-    paddd          m0, m1                 ; (dword) { Y[0-3] }
-    paddd          m2, m3                 ; (dword) { Y[4-7] }
-    psrad          m0, 15
-    psrad          m2, 15
-    packssdw       m0, m2                 ; (word) { Y[0-7] }
-    packuswb       m0, m0                 ; (byte) { Y[0-7] }
-    movh    [dstq+wq], m0
-    add            wq, mmsize / 2
-    jl .loop
-    REP_RET
-%endif ; %0 == 3
-%endmacro
-
-; %1 = nr. of XMM registers
-; %2-5 = rgba, bgra, argb or abgr (in individual characters)
-%macro RGB32_TO_UV_FN 5-6
-cglobal %2%3%4%5 %+ ToUV, 3, 4, %1, dstU, dstV, src, w
-%if ARCH_X86_64
-    mova           m8, [rgba_Ucoeff_%2%4]
-    mova           m9, [rgba_Ucoeff_%3%5]
-    mova          m10, [rgba_Vcoeff_%2%4]
-    mova          m11, [rgba_Vcoeff_%3%5]
-%define coeffU1 m8
-%define coeffU2 m9
-%define coeffV1 m10
-%define coeffV2 m11
-%else ; x86-32
-%define coeffU1 [rgba_Ucoeff_%2%4]
-%define coeffU2 [rgba_Ucoeff_%3%5]
-%define coeffV1 [rgba_Vcoeff_%2%4]
-%define coeffV2 [rgba_Vcoeff_%3%5]
-%endif ; x86-64/32
-%if ARCH_X86_64 && %0 == 6
-    jmp mangle(private_prefix %+ _ %+ %6 %+ ToUV %+ SUFFIX).body
-%else ; ARCH_X86_64 && %0 == 6
-.body:
-%if ARCH_X86_64
-    movsxd         wq, dword r4m
-%else ; x86-32
-    mov            wq, r4m
-%endif
-    add         dstUq, wq
-    add         dstVq, wq
-    lea          srcq, [srcq+wq*4]
-    neg            wq
-    pcmpeqb        m7, m7
-    psrlw          m7, 8                  ; (word) { 0x00ff } x4
-    mova           m6, [rgb_UVrnd]
-.loop:
-    ; FIXME check alignment and use mova
-    movu           m0, [srcq+wq*4+0]      ; (byte) { Bx, Gx, Rx, xx }[0-3]
-    movu           m4, [srcq+wq*4+mmsize] ; (byte) { Bx, Gx, Rx, xx }[4-7]
-    DEINTB          1,  0,  5,  4,  7     ; (word) { Gx, xx (m0/m4) or Bx, Rx (m1/m5) }[0-3]/[4-7]
-    pmaddwd        m3, m1, coeffV1        ; (dword) { Bx*BV + Rx*RV }[0-3]
-    pmaddwd        m2, m0, coeffV2        ; (dword) { Gx*GV }[0-3]
-    pmaddwd        m1, coeffU1            ; (dword) { Bx*BU + Rx*RU }[0-3]
-    pmaddwd        m0, coeffU2            ; (dword) { Gx*GU }[0-3]
-    paddd          m3, m6                 ; += rgb_UVrnd
-    paddd          m1, m6                 ; += rgb_UVrnd
-    paddd          m2, m3                 ; (dword) { V[0-3] }
-    paddd          m0, m1                 ; (dword) { U[0-3] }
-    pmaddwd        m3, m5, coeffV1        ; (dword) { Bx*BV + Rx*RV }[4-7]
-    pmaddwd        m1, m4, coeffV2        ; (dword) { Gx*GV }[4-7]
-    pmaddwd        m5, coeffU1            ; (dword) { Bx*BU + Rx*RU }[4-7]
-    pmaddwd        m4, coeffU2            ; (dword) { Gx*GU }[4-7]
-    paddd          m3, m6                 ; += rgb_UVrnd
-    paddd          m5, m6                 ; += rgb_UVrnd
-    psrad          m0, 15
-    paddd          m1, m3                 ; (dword) { V[4-7] }
-    paddd          m4, m5                 ; (dword) { U[4-7] }
-    psrad          m2, 15
-    psrad          m4, 15
-    psrad          m1, 15
-    packssdw       m0, m4                 ; (word) { U[0-7] }
-    packssdw       m2, m1                 ; (word) { V[0-7] }
-%if mmsize == 8
-    packuswb       m0, m0                 ; (byte) { U[0-7] }
-    packuswb       m2, m2                 ; (byte) { V[0-7] }
-    movh   [dstUq+wq], m0
-    movh   [dstVq+wq], m2
-%else ; mmsize == 16
-    packuswb       m0, m2                 ; (byte) { U[0-7], V[0-7] }
-    movh   [dstUq+wq], m0
-    movhps [dstVq+wq], m0
-%endif ; mmsize == 8/16
-    add            wq, mmsize / 2
-    jl .loop
-    REP_RET
-%endif ; ARCH_X86_64 && %0 == 3
-%endmacro
-
-; %1 = nr. of XMM registers for rgb-to-Y func
-; %2 = nr. of XMM registers for rgb-to-UV func
-%macro RGB32_FUNCS 2
-RGB32_TO_Y_FN %1, r, g, b, a
-RGB32_TO_Y_FN %1, b, g, r, a, rgba
-RGB32_TO_Y_FN %1, a, r, g, b, rgba
-RGB32_TO_Y_FN %1, a, b, g, r, rgba
-
-RGB32_TO_UV_FN %2, r, g, b, a
-RGB32_TO_UV_FN %2, b, g, r, a, rgba
-RGB32_TO_UV_FN %2, a, r, g, b, rgba
-RGB32_TO_UV_FN %2, a, b, g, r, rgba
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-RGB32_FUNCS 0, 0
-%endif
-
-INIT_XMM sse2
-RGB32_FUNCS 8, 12
-
-INIT_XMM avx
-RGB32_FUNCS 8, 12
-
-;-----------------------------------------------------------------------------
-; YUYV/UYVY/NV12/NV21 packed pixel shuffling.
-;
-; void <fmt>ToY_<opt>(uint8_t *dst, const uint8_t *src, int w);
-; and
-; void <fmt>toUV_<opt>(uint8_t *dstU, uint8_t *dstV, const uint8_t *src,
-;                      const uint8_t *unused, int w);
-;-----------------------------------------------------------------------------
-
-; %1 = a (aligned) or u (unaligned)
-; %2 = yuyv or uyvy
-%macro LOOP_YUYV_TO_Y 2
-.loop_%1:
-    mov%1          m0, [srcq+wq*2]        ; (byte) { Y0, U0, Y1, V0, ... }
-    mov%1          m1, [srcq+wq*2+mmsize] ; (byte) { Y8, U4, Y9, V4, ... }
-%ifidn %2, yuyv
-    pand           m0, m2                 ; (word) { Y0, Y1, ..., Y7 }
-    pand           m1, m2                 ; (word) { Y8, Y9, ..., Y15 }
-%else ; uyvy
-    psrlw          m0, 8                  ; (word) { Y0, Y1, ..., Y7 }
-    psrlw          m1, 8                  ; (word) { Y8, Y9, ..., Y15 }
-%endif ; yuyv/uyvy
-    packuswb       m0, m1                 ; (byte) { Y0, ..., Y15 }
-    mova    [dstq+wq], m0
-    add            wq, mmsize
-    jl .loop_%1
-    REP_RET
-%endmacro
-
-; %1 = nr. of XMM registers
-; %2 = yuyv or uyvy
-; %3 = if specified, it means that unaligned and aligned code in loop
-;      will be the same (i.e. YUYV+AVX), and thus we don't need to
-;      split the loop in an aligned and unaligned case
-%macro YUYV_TO_Y_FN 2-3
-cglobal %2ToY, 3, 3, %1, dst, src, w
-%if ARCH_X86_64
-    movsxd         wq, wd
-%endif
-    add          dstq, wq
-%if mmsize == 16
-    test         srcq, 15
-%endif
-    lea          srcq, [srcq+wq*2]
-%ifidn %2, yuyv
-    pcmpeqb        m2, m2                 ; (byte) { 0xff } x 16
-    psrlw          m2, 8                  ; (word) { 0x00ff } x 8
-%endif ; yuyv
-%if mmsize == 16
-    jnz .loop_u_start
-    neg            wq
-    LOOP_YUYV_TO_Y  a, %2
-.loop_u_start:
-    neg            wq
-    LOOP_YUYV_TO_Y  u, %2
-%else ; mmsize == 8
-    neg            wq
-    LOOP_YUYV_TO_Y  a, %2
-%endif ; mmsize == 8/16
-%endmacro
-
-; %1 = a (aligned) or u (unaligned)
-; %2 = yuyv or uyvy
-%macro LOOP_YUYV_TO_UV 2
-.loop_%1:
-%ifidn %2, yuyv
-    mov%1          m0, [srcq+wq*4]        ; (byte) { Y0, U0, Y1, V0, ... }
-    mov%1          m1, [srcq+wq*4+mmsize] ; (byte) { Y8, U4, Y9, V4, ... }
-    psrlw          m0, 8                  ; (word) { U0, V0, ..., U3, V3 }
-    psrlw          m1, 8                  ; (word) { U4, V4, ..., U7, V7 }
-%else ; uyvy
-%if cpuflag(avx)
-    vpand          m0, m2, [srcq+wq*4]        ; (word) { U0, V0, ..., U3, V3 }
-    vpand          m1, m2, [srcq+wq*4+mmsize] ; (word) { U4, V4, ..., U7, V7 }
-%else
-    mov%1          m0, [srcq+wq*4]        ; (byte) { Y0, U0, Y1, V0, ... }
-    mov%1          m1, [srcq+wq*4+mmsize] ; (byte) { Y8, U4, Y9, V4, ... }
-    pand           m0, m2                 ; (word) { U0, V0, ..., U3, V3 }
-    pand           m1, m2                 ; (word) { U4, V4, ..., U7, V7 }
-%endif
-%endif ; yuyv/uyvy
-    packuswb       m0, m1                 ; (byte) { U0, V0, ..., U7, V7 }
-    pand           m1, m0, m2             ; (word) { U0, U1, ..., U7 }
-    psrlw          m0, 8                  ; (word) { V0, V1, ..., V7 }
-%if mmsize == 16
-    packuswb       m1, m0                 ; (byte) { U0, ... U7, V1, ... V7 }
-    movh   [dstUq+wq], m1
-    movhps [dstVq+wq], m1
-%else ; mmsize == 8
-    packuswb       m1, m1                 ; (byte) { U0, ... U3 }
-    packuswb       m0, m0                 ; (byte) { V0, ... V3 }
-    movh   [dstUq+wq], m1
-    movh   [dstVq+wq], m0
-%endif ; mmsize == 8/16
-    add            wq, mmsize / 2
-    jl .loop_%1
-    REP_RET
-%endmacro
-
-; %1 = nr. of XMM registers
-; %2 = yuyv or uyvy
-; %3 = if specified, it means that unaligned and aligned code in loop
-;      will be the same (i.e. UYVY+AVX), and thus we don't need to
-;      split the loop in an aligned and unaligned case
-%macro YUYV_TO_UV_FN 2-3
-cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w
-%if ARCH_X86_64
-    movsxd         wq, dword r4m
-%else ; x86-32
-    mov            wq, r4m
-%endif
-    add         dstUq, wq
-    add         dstVq, wq
-%if mmsize == 16 && %0 == 2
-    test         srcq, 15
-%endif
-    lea          srcq, [srcq+wq*4]
-    pcmpeqb        m2, m2                 ; (byte) { 0xff } x 16
-    psrlw          m2, 8                  ; (word) { 0x00ff } x 8
-    ; NOTE: if uyvy+avx, u/a are identical
-%if mmsize == 16 && %0 == 2
-    jnz .loop_u_start
-    neg            wq
-    LOOP_YUYV_TO_UV a, %2
-.loop_u_start:
-    neg            wq
-    LOOP_YUYV_TO_UV u, %2
-%else ; mmsize == 8
-    neg            wq
-    LOOP_YUYV_TO_UV a, %2
-%endif ; mmsize == 8/16
-%endmacro
-
-; %1 = a (aligned) or u (unaligned)
-; %2 = nv12 or nv21
-%macro LOOP_NVXX_TO_UV 2
-.loop_%1:
-    mov%1          m0, [srcq+wq*2]        ; (byte) { U0, V0, U1, V1, ... }
-    mov%1          m1, [srcq+wq*2+mmsize] ; (byte) { U8, V8, U9, V9, ... }
-    pand           m2, m0, m4             ; (word) { U0, U1, ..., U7 }
-    pand           m3, m1, m4             ; (word) { U8, U9, ..., U15 }
-    psrlw          m0, 8                  ; (word) { V0, V1, ..., V7 }
-    psrlw          m1, 8                  ; (word) { V8, V9, ..., V15 }
-    packuswb       m2, m3                 ; (byte) { U0, ..., U15 }
-    packuswb       m0, m1                 ; (byte) { V0, ..., V15 }
-%ifidn %2, nv12
-    mova   [dstUq+wq], m2
-    mova   [dstVq+wq], m0
-%else ; nv21
-    mova   [dstVq+wq], m2
-    mova   [dstUq+wq], m0
-%endif ; nv12/21
-    add            wq, mmsize
-    jl .loop_%1
-    REP_RET
-%endmacro
-
-; %1 = nr. of XMM registers
-; %2 = nv12 or nv21
-%macro NVXX_TO_UV_FN 2
-cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w
-%if ARCH_X86_64
-    movsxd         wq, dword r4m
-%else ; x86-32
-    mov            wq, r4m
-%endif
-    add         dstUq, wq
-    add         dstVq, wq
-%if mmsize == 16
-    test         srcq, 15
-%endif
-    lea          srcq, [srcq+wq*2]
-    pcmpeqb        m4, m4                 ; (byte) { 0xff } x 16
-    psrlw          m4, 8                  ; (word) { 0x00ff } x 8
-%if mmsize == 16
-    jnz .loop_u_start
-    neg            wq
-    LOOP_NVXX_TO_UV a, %2
-.loop_u_start:
-    neg            wq
-    LOOP_NVXX_TO_UV u, %2
-%else ; mmsize == 8
-    neg            wq
-    LOOP_NVXX_TO_UV a, %2
-%endif ; mmsize == 8/16
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-YUYV_TO_Y_FN  0, yuyv
-YUYV_TO_Y_FN  0, uyvy
-YUYV_TO_UV_FN 0, yuyv
-YUYV_TO_UV_FN 0, uyvy
-NVXX_TO_UV_FN 0, nv12
-NVXX_TO_UV_FN 0, nv21
-%endif
-
-INIT_XMM sse2
-YUYV_TO_Y_FN  3, yuyv
-YUYV_TO_Y_FN  2, uyvy
-YUYV_TO_UV_FN 3, yuyv
-YUYV_TO_UV_FN 3, uyvy
-NVXX_TO_UV_FN 5, nv12
-NVXX_TO_UV_FN 5, nv21
-
-INIT_XMM avx
-; in theory, we could write a yuy2-to-y using vpand (i.e. AVX), but
-; that's not faster in practice
-YUYV_TO_UV_FN 3, yuyv
-YUYV_TO_UV_FN 3, uyvy, 1
-NVXX_TO_UV_FN 5, nv12
-NVXX_TO_UV_FN 5, nv21
diff --git a/deps/libav/libswscale/x86/output.asm b/deps/libav/libswscale/x86/output.asm
deleted file mode 100644
index e1ceded..0000000
--- a/deps/libav/libswscale/x86/output.asm
+++ /dev/null
@@ -1,409 +0,0 @@
-;******************************************************************************
-;* x86-optimized vertical line scaling functions
-;* Copyright (c) 2011 Ronald S. Bultje <rsbultje at gmail.com>
-;*                    Kieran Kunhya <kieran at kunhya.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-minshort:      times 8 dw 0x8000
-yuv2yuvX_16_start:  times 4 dd 0x4000 - 0x40000000
-yuv2yuvX_10_start:  times 4 dd 0x10000
-yuv2yuvX_9_start:   times 4 dd 0x20000
-yuv2yuvX_10_upper:  times 8 dw 0x3ff
-yuv2yuvX_9_upper:   times 8 dw 0x1ff
-pd_4:          times 4 dd 4
-pd_4min0x40000:times 4 dd 4 - (0x40000)
-pw_16:         times 8 dw 16
-pw_32:         times 8 dw 32
-pw_512:        times 8 dw 512
-pw_1024:       times 8 dw 1024
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; vertical line scaling
-;
-; void yuv2plane1_<output_size>_<opt>(const int16_t *src, uint8_t *dst, int dstW,
-;                                     const uint8_t *dither, int offset)
-; and
-; void yuv2planeX_<output_size>_<opt>(const int16_t *filter, int filterSize,
-;                                     const int16_t **src, uint8_t *dst, int dstW,
-;                                     const uint8_t *dither, int offset)
-;
-; Scale one or $filterSize lines of source data to generate one line of output
-; data. The input is 15-bit in int16_t if $output_size is [8,10] and 19-bit in
-; int32_t if $output_size is 16. $filter is 12-bits. $filterSize is a multiple
-; of 2. $offset is either 0 or 3. $dither holds 8 values.
-;-----------------------------------------------------------------------------
-
-%macro yuv2planeX_fn 3
-
-%if ARCH_X86_32
-%define cntr_reg fltsizeq
-%define movsx mov
-%else
-%define cntr_reg r7
-%define movsx movsxd
-%endif
-
-cglobal yuv2planeX_%1, %3, 8, %2, filter, fltsize, src, dst, w, dither, offset
-%if %1 == 8 || %1 == 9 || %1 == 10
-    pxor            m6,  m6
-%endif ; %1 == 8/9/10
-
-%if %1 == 8
-%if ARCH_X86_32
-%assign pad 0x2c - (stack_offset & 15)
-    SUB             rsp, pad
-%define m_dith m7
-%else ; x86-64
-%define m_dith m9
-%endif ; x86-32
-
-    ; create registers holding dither
-    movq        m_dith, [ditherq]        ; dither
-    test        offsetd, offsetd
-    jz              .no_rot
-%if mmsize == 16
-    punpcklqdq  m_dith,  m_dith
-%endif ; mmsize == 16
-    PALIGNR     m_dith,  m_dith,  3,  m0
-.no_rot:
-%if mmsize == 16
-    punpcklbw   m_dith,  m6
-%if ARCH_X86_64
-    punpcklwd       m8,  m_dith,  m6
-    pslld           m8,  12
-%else ; x86-32
-    punpcklwd       m5,  m_dith,  m6
-    pslld           m5,  12
-%endif ; x86-32/64
-    punpckhwd   m_dith,  m6
-    pslld       m_dith,  12
-%if ARCH_X86_32
-    mova      [rsp+ 0],  m5
-    mova      [rsp+16],  m_dith
-%endif
-%else ; mmsize == 8
-    punpcklbw       m5,  m_dith,  m6
-    punpckhbw   m_dith,  m6
-    punpcklwd       m4,  m5,  m6
-    punpckhwd       m5,  m6
-    punpcklwd       m3,  m_dith,  m6
-    punpckhwd   m_dith,  m6
-    pslld           m4,  12
-    pslld           m5,  12
-    pslld           m3,  12
-    pslld       m_dith,  12
-    mova      [rsp+ 0],  m4
-    mova      [rsp+ 8],  m5
-    mova      [rsp+16],  m3
-    mova      [rsp+24],  m_dith
-%endif ; mmsize == 8/16
-%endif ; %1 == 8
-
-    xor             r5,  r5
-
-.pixelloop:
-%assign %%i 0
-    ; the rep here is for the 8bit output mmx case, where dither covers
-    ; 8 pixels but we can only handle 2 pixels per register, and thus 4
-    ; pixels per iteration. In order to not have to keep track of where
-    ; we are w.r.t. dithering, we unroll the mmx/8bit loop x2.
-%if %1 == 8
-%assign %%repcnt 16/mmsize
-%else
-%assign %%repcnt 1
-%endif
-
-%rep %%repcnt
-
-%if %1 == 8
-%if ARCH_X86_32
-    mova            m2, [rsp+mmsize*(0+%%i)]
-    mova            m1, [rsp+mmsize*(1+%%i)]
-%else ; x86-64
-    mova            m2,  m8
-    mova            m1,  m_dith
-%endif ; x86-32/64
-%else ; %1 == 9/10/16
-    mova            m1, [yuv2yuvX_%1_start]
-    mova            m2,  m1
-%endif ; %1 == 8/9/10/16
-    movsx     cntr_reg,  fltsizem
-.filterloop_ %+ %%i:
-    ; input pixels
-    mov             r6, [srcq+gprsize*cntr_reg-2*gprsize]
-%if %1 == 16
-    mova            m3, [r6+r5*4]
-    mova            m5, [r6+r5*4+mmsize]
-%else ; %1 == 8/9/10
-    mova            m3, [r6+r5*2]
-%endif ; %1 == 8/9/10/16
-    mov             r6, [srcq+gprsize*cntr_reg-gprsize]
-%if %1 == 16
-    mova            m4, [r6+r5*4]
-    mova            m6, [r6+r5*4+mmsize]
-%else ; %1 == 8/9/10
-    mova            m4, [r6+r5*2]
-%endif ; %1 == 8/9/10/16
-
-    ; coefficients
-    movd            m0, [filterq+2*cntr_reg-4] ; coeff[0], coeff[1]
-%if %1 == 16
-    pshuflw         m7,  m0,  0          ; coeff[0]
-    pshuflw         m0,  m0,  0x55       ; coeff[1]
-    pmovsxwd        m7,  m7              ; word -> dword
-    pmovsxwd        m0,  m0              ; word -> dword
-
-    pmulld          m3,  m7
-    pmulld          m5,  m7
-    pmulld          m4,  m0
-    pmulld          m6,  m0
-
-    paddd           m2,  m3
-    paddd           m1,  m5
-    paddd           m2,  m4
-    paddd           m1,  m6
-%else ; %1 == 10/9/8
-    punpcklwd       m5,  m3,  m4
-    punpckhwd       m3,  m4
-    SPLATD          m0
-
-    pmaddwd         m5,  m0
-    pmaddwd         m3,  m0
-
-    paddd           m2,  m5
-    paddd           m1,  m3
-%endif ; %1 == 8/9/10/16
-
-    sub       cntr_reg,  2
-    jg .filterloop_ %+ %%i
-
-%if %1 == 16
-    psrad           m2,  31 - %1
-    psrad           m1,  31 - %1
-%else ; %1 == 10/9/8
-    psrad           m2,  27 - %1
-    psrad           m1,  27 - %1
-%endif ; %1 == 8/9/10/16
-
-%if %1 == 8
-    packssdw        m2,  m1
-    packuswb        m2,  m2
-    movh   [dstq+r5*1],  m2
-%else ; %1 == 9/10/16
-%if %1 == 16
-    packssdw        m2,  m1
-    paddw           m2, [minshort]
-%else ; %1 == 9/10
-%if cpuflag(sse4)
-    packusdw        m2,  m1
-%else ; mmxext/sse2
-    packssdw        m2,  m1
-    pmaxsw          m2,  m6
-%endif ; mmxext/sse2/sse4/avx
-    pminsw          m2, [yuv2yuvX_%1_upper]
-%endif ; %1 == 9/10/16
-    mova   [dstq+r5*2],  m2
-%endif ; %1 == 8/9/10/16
-
-    add             r5,  mmsize/2
-    sub             wd,  mmsize/2
-
-%assign %%i %%i+2
-%endrep
-    jg .pixelloop
-
-%if %1 == 8
-%if ARCH_X86_32
-    ADD             rsp, pad
-    RET
-%else ; x86-64
-    REP_RET
-%endif ; x86-32/64
-%else ; %1 == 9/10/16
-    REP_RET
-%endif ; %1 == 8/9/10/16
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmxext
-yuv2planeX_fn  8,  0, 7
-yuv2planeX_fn  9,  0, 5
-yuv2planeX_fn 10,  0, 5
-%endif
-
-INIT_XMM sse2
-yuv2planeX_fn  8, 10, 7
-yuv2planeX_fn  9,  7, 5
-yuv2planeX_fn 10,  7, 5
-
-INIT_XMM sse4
-yuv2planeX_fn  8, 10, 7
-yuv2planeX_fn  9,  7, 5
-yuv2planeX_fn 10,  7, 5
-yuv2planeX_fn 16,  8, 5
-
-INIT_XMM avx
-yuv2planeX_fn  8, 10, 7
-yuv2planeX_fn  9,  7, 5
-yuv2planeX_fn 10,  7, 5
-
-; %1=outout-bpc, %2=alignment (u/a)
-%macro yuv2plane1_mainloop 2
-.loop_%2:
-%if %1 == 8
-    paddsw          m0, m2, [srcq+wq*2+mmsize*0]
-    paddsw          m1, m3, [srcq+wq*2+mmsize*1]
-    psraw           m0, 7
-    psraw           m1, 7
-    packuswb        m0, m1
-    mov%2    [dstq+wq], m0
-%elif %1 == 16
-    paddd           m0, m4, [srcq+wq*4+mmsize*0]
-    paddd           m1, m4, [srcq+wq*4+mmsize*1]
-    paddd           m2, m4, [srcq+wq*4+mmsize*2]
-    paddd           m3, m4, [srcq+wq*4+mmsize*3]
-    psrad           m0, 3
-    psrad           m1, 3
-    psrad           m2, 3
-    psrad           m3, 3
-%if cpuflag(sse4) ; avx/sse4
-    packusdw        m0, m1
-    packusdw        m2, m3
-%else ; mmx/sse2
-    packssdw        m0, m1
-    packssdw        m2, m3
-    paddw           m0, m5
-    paddw           m2, m5
-%endif ; mmx/sse2/sse4/avx
-    mov%2    [dstq+wq*2+mmsize*0], m0
-    mov%2    [dstq+wq*2+mmsize*1], m2
-%else ; %1 == 9/10
-    paddsw          m0, m2, [srcq+wq*2+mmsize*0]
-    paddsw          m1, m2, [srcq+wq*2+mmsize*1]
-    psraw           m0, 15 - %1
-    psraw           m1, 15 - %1
-    pmaxsw          m0, m4
-    pmaxsw          m1, m4
-    pminsw          m0, m3
-    pminsw          m1, m3
-    mov%2    [dstq+wq*2+mmsize*0], m0
-    mov%2    [dstq+wq*2+mmsize*1], m1
-%endif
-    add             wq, mmsize
-    jl .loop_%2
-%endmacro
-
-%macro yuv2plane1_fn 3
-cglobal yuv2plane1_%1, %3, %3, %2, src, dst, w, dither, offset
-    movsxdifnidn    wq, wd
-    add             wq, mmsize - 1
-    and             wq, ~(mmsize - 1)
-%if %1 == 8
-    add           dstq, wq
-%else ; %1 != 8
-    lea           dstq, [dstq+wq*2]
-%endif ; %1 == 8
-%if %1 == 16
-    lea           srcq, [srcq+wq*4]
-%else ; %1 != 16
-    lea           srcq, [srcq+wq*2]
-%endif ; %1 == 16
-    neg             wq
-
-%if %1 == 8
-    pxor            m4, m4               ; zero
-
-    ; create registers holding dither
-    movq            m3, [ditherq]        ; dither
-    test       offsetd, offsetd
-    jz              .no_rot
-%if mmsize == 16
-    punpcklqdq      m3, m3
-%endif ; mmsize == 16
-    PALIGNR         m3, m3, 3, m2
-.no_rot:
-%if mmsize == 8
-    mova            m2, m3
-    punpckhbw       m3, m4               ; byte->word
-    punpcklbw       m2, m4               ; byte->word
-%else
-    punpcklbw       m3, m4
-    mova            m2, m3
-%endif
-%elif %1 == 9
-    pxor            m4, m4
-    mova            m3, [pw_512]
-    mova            m2, [pw_32]
-%elif %1 == 10
-    pxor            m4, m4
-    mova            m3, [pw_1024]
-    mova            m2, [pw_16]
-%else ; %1 == 16
-%if cpuflag(sse4) ; sse4/avx
-    mova            m4, [pd_4]
-%else ; mmx/sse2
-    mova            m4, [pd_4min0x40000]
-    mova            m5, [minshort]
-%endif ; mmx/sse2/sse4/avx
-%endif ; %1 == ..
-
-    ; actual pixel scaling
-%if mmsize == 8
-    yuv2plane1_mainloop %1, a
-%else ; mmsize == 16
-    test          dstq, 15
-    jnz .unaligned
-    yuv2plane1_mainloop %1, a
-    REP_RET
-.unaligned:
-    yuv2plane1_mainloop %1, u
-%endif ; mmsize == 8/16
-    REP_RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-yuv2plane1_fn  8, 0, 5
-yuv2plane1_fn 16, 0, 3
-
-INIT_MMX mmxext
-yuv2plane1_fn  9, 0, 3
-yuv2plane1_fn 10, 0, 3
-%endif
-
-INIT_XMM sse2
-yuv2plane1_fn  8, 5, 5
-yuv2plane1_fn  9, 5, 3
-yuv2plane1_fn 10, 5, 3
-yuv2plane1_fn 16, 6, 3
-
-INIT_XMM sse4
-yuv2plane1_fn 16, 5, 3
-
-INIT_XMM avx
-yuv2plane1_fn  8, 5, 5
-yuv2plane1_fn  9, 5, 3
-yuv2plane1_fn 10, 5, 3
-yuv2plane1_fn 16, 5, 3
diff --git a/deps/libav/libswscale/x86/rgb2rgb.c b/deps/libav/libswscale/x86/rgb2rgb.c
deleted file mode 100644
index 9cfe831..0000000
--- a/deps/libav/libswscale/x86/rgb2rgb.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * software RGB to RGB converter
- * pluralize by software PAL8 to RGB converter
- *              software YUV to YUV converter
- *              software YUV to RGB converter
- * Written by Nick Kurshev.
- * palette & YUV & runtime CPU stuff by Michael (michaelni at gmx.at)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdint.h>
-
-#include "config.h"
-#include "libavutil/attributes.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavutil/cpu.h"
-#include "libavutil/bswap.h"
-#include "libswscale/rgb2rgb.h"
-#include "libswscale/swscale.h"
-#include "libswscale/swscale_internal.h"
-
-#if HAVE_INLINE_ASM
-
-DECLARE_ASM_CONST(8, uint64_t, mmx_ff)       = 0x00000000000000FFULL;
-DECLARE_ASM_CONST(8, uint64_t, mmx_null)     = 0x0000000000000000ULL;
-DECLARE_ASM_CONST(8, uint64_t, mmx_one)      = 0xFFFFFFFFFFFFFFFFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32b)      = 0x000000FF000000FFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32g)      = 0x0000FF000000FF00ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32r)      = 0x00FF000000FF0000ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32a)      = 0xFF000000FF000000ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32)       = 0x00FFFFFF00FFFFFFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask3216br)   = 0x00F800F800F800F8ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask3216g)    = 0x0000FC000000FC00ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask3215g)    = 0x0000F8000000F800ULL;
-DECLARE_ASM_CONST(8, uint64_t, mul3216)      = 0x2000000420000004ULL;
-DECLARE_ASM_CONST(8, uint64_t, mul3215)      = 0x2000000820000008ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24b)      = 0x00FF0000FF0000FFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24g)      = 0xFF0000FF0000FF00ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24r)      = 0x0000FF0000FF0000ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24l)      = 0x0000000000FFFFFFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24h)      = 0x0000FFFFFF000000ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24hh)     = 0xffff000000000000ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24hhh)    = 0xffffffff00000000ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24hhhh)   = 0xffffffffffff0000ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask15b)      = 0x001F001F001F001FULL; /* 00000000 00011111  xxB */
-DECLARE_ASM_CONST(8, uint64_t, mask15rg)     = 0x7FE07FE07FE07FE0ULL; /* 01111111 11100000  RGx */
-DECLARE_ASM_CONST(8, uint64_t, mask15s)      = 0xFFE0FFE0FFE0FFE0ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask15g)      = 0x03E003E003E003E0ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask15r)      = 0x7C007C007C007C00ULL;
-#define mask16b mask15b
-DECLARE_ASM_CONST(8, uint64_t, mask16g)      = 0x07E007E007E007E0ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask16r)      = 0xF800F800F800F800ULL;
-DECLARE_ASM_CONST(8, uint64_t, red_16mask)   = 0x0000f8000000f800ULL;
-DECLARE_ASM_CONST(8, uint64_t, green_16mask) = 0x000007e0000007e0ULL;
-DECLARE_ASM_CONST(8, uint64_t, blue_16mask)  = 0x0000001f0000001fULL;
-DECLARE_ASM_CONST(8, uint64_t, red_15mask)   = 0x00007c0000007c00ULL;
-DECLARE_ASM_CONST(8, uint64_t, green_15mask) = 0x000003e0000003e0ULL;
-DECLARE_ASM_CONST(8, uint64_t, blue_15mask)  = 0x0000001f0000001fULL;
-
-#define RGB2YUV_SHIFT 8
-#define BY ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5))
-#define BV ((int)(-0.071*(1<<RGB2YUV_SHIFT)+0.5))
-#define BU ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))
-#define GY ((int)( 0.504*(1<<RGB2YUV_SHIFT)+0.5))
-#define GV ((int)(-0.368*(1<<RGB2YUV_SHIFT)+0.5))
-#define GU ((int)(-0.291*(1<<RGB2YUV_SHIFT)+0.5))
-#define RY ((int)( 0.257*(1<<RGB2YUV_SHIFT)+0.5))
-#define RV ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))
-#define RU ((int)(-0.148*(1<<RGB2YUV_SHIFT)+0.5))
-
-// Note: We have C, MMX, MMXEXT, 3DNOW versions, there is no 3DNOW + MMXEXT one.
-
-#define COMPILE_TEMPLATE_MMXEXT 0
-#define COMPILE_TEMPLATE_AMD3DNOW 0
-#define COMPILE_TEMPLATE_SSE2 0
-#define COMPILE_TEMPLATE_AVX 0
-
-//MMX versions
-#undef RENAME
-#define RENAME(a) a ## _mmx
-#include "rgb2rgb_template.c"
-
-// MMXEXT versions
-#undef RENAME
-#undef COMPILE_TEMPLATE_MMXEXT
-#define COMPILE_TEMPLATE_MMXEXT 1
-#define RENAME(a) a ## _mmxext
-#include "rgb2rgb_template.c"
-
-//SSE2 versions
-#undef RENAME
-#undef COMPILE_TEMPLATE_SSE2
-#define COMPILE_TEMPLATE_SSE2 1
-#define RENAME(a) a ## _sse2
-#include "rgb2rgb_template.c"
-
-//AVX versions
-#undef RENAME
-#undef COMPILE_TEMPLATE_AVX
-#define COMPILE_TEMPLATE_AVX 1
-#define RENAME(a) a ## _avx
-#include "rgb2rgb_template.c"
-
-//3DNOW versions
-#undef RENAME
-#undef COMPILE_TEMPLATE_MMXEXT
-#undef COMPILE_TEMPLATE_SSE2
-#undef COMPILE_TEMPLATE_AVX
-#undef COMPILE_TEMPLATE_AMD3DNOW
-#define COMPILE_TEMPLATE_MMXEXT 0
-#define COMPILE_TEMPLATE_SSE2 0
-#define COMPILE_TEMPLATE_AMD3DNOW 1
-#define RENAME(a) a ## _3dnow
-#include "rgb2rgb_template.c"
-
-/*
- RGB15->RGB16 original by Strepto/Astral
- ported to gcc & bugfixed : A'rpi
- MMXEXT, 3DNOW optimization by Nick Kurshev
- 32-bit C version, and and&add trick by Michael Niedermayer
-*/
-
-#endif /* HAVE_INLINE_ASM */
-
-av_cold void rgb2rgb_init_x86(void)
-{
-#if HAVE_INLINE_ASM
-    int cpu_flags = av_get_cpu_flags();
-
-    if (INLINE_MMX(cpu_flags))
-        rgb2rgb_init_mmx();
-    if (INLINE_AMD3DNOW(cpu_flags))
-        rgb2rgb_init_3dnow();
-    if (INLINE_MMXEXT(cpu_flags))
-        rgb2rgb_init_mmxext();
-    if (INLINE_SSE2(cpu_flags))
-        rgb2rgb_init_sse2();
-    if (INLINE_AVX(cpu_flags))
-        rgb2rgb_init_avx();
-#endif /* HAVE_INLINE_ASM */
-}
diff --git a/deps/libav/libswscale/x86/rgb2rgb_template.c b/deps/libav/libswscale/x86/rgb2rgb_template.c
deleted file mode 100644
index dc3c694..0000000
--- a/deps/libav/libswscale/x86/rgb2rgb_template.c
+++ /dev/null
@@ -1,2542 +0,0 @@
-/*
- * software RGB to RGB converter
- * pluralize by software PAL8 to RGB converter
- *              software YUV to YUV converter
- *              software YUV to RGB converter
- * Written by Nick Kurshev.
- * palette & YUV & runtime CPU stuff by Michael (michaelni at gmx.at)
- * lot of big-endian byte order fixes by Alex Beregszaszi
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stddef.h>
-
-#include "libavutil/attributes.h"
-
-#undef PREFETCH
-#undef MOVNTQ
-#undef EMMS
-#undef SFENCE
-#undef PAVGB
-
-#if COMPILE_TEMPLATE_AMD3DNOW
-#define PREFETCH  "prefetch"
-#define PAVGB     "pavgusb"
-#elif COMPILE_TEMPLATE_MMXEXT
-#define PREFETCH "prefetchnta"
-#define PAVGB     "pavgb"
-#else
-#define PREFETCH  " # nop"
-#endif
-
-#if COMPILE_TEMPLATE_AMD3DNOW
-/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
-#define EMMS     "femms"
-#else
-#define EMMS     "emms"
-#endif
-
-#if COMPILE_TEMPLATE_MMXEXT
-#define MOVNTQ "movntq"
-#define SFENCE "sfence"
-#else
-#define MOVNTQ "movq"
-#define SFENCE " # nop"
-#endif
-
-#if !COMPILE_TEMPLATE_SSE2
-
-#if !COMPILE_TEMPLATE_AMD3DNOW
-
-static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint8_t *dest = dst;
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*s):"memory");
-    mm_end = end - 23;
-    __asm__ volatile("movq        %0, %%mm7"::"m"(mask32a):"memory");
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movd        (%1), %%mm0    \n\t"
-            "punpckldq  3(%1), %%mm0    \n\t"
-            "movd       6(%1), %%mm1    \n\t"
-            "punpckldq  9(%1), %%mm1    \n\t"
-            "movd      12(%1), %%mm2    \n\t"
-            "punpckldq 15(%1), %%mm2    \n\t"
-            "movd      18(%1), %%mm3    \n\t"
-            "punpckldq 21(%1), %%mm3    \n\t"
-            "por        %%mm7, %%mm0    \n\t"
-            "por        %%mm7, %%mm1    \n\t"
-            "por        %%mm7, %%mm2    \n\t"
-            "por        %%mm7, %%mm3    \n\t"
-            MOVNTQ"     %%mm0,   (%0)   \n\t"
-            MOVNTQ"     %%mm1,  8(%0)   \n\t"
-            MOVNTQ"     %%mm2, 16(%0)   \n\t"
-            MOVNTQ"     %%mm3, 24(%0)"
-            :: "r"(dest), "r"(s)
-            :"memory");
-        dest += 32;
-        s += 24;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        *dest++ = *s++;
-        *dest++ = *s++;
-        *dest++ = *s++;
-        *dest++ = 255;
-    }
-}
-
-#define STORE_BGR24_MMX \
-            "psrlq         $8, %%mm2    \n\t" \
-            "psrlq         $8, %%mm3    \n\t" \
-            "psrlq         $8, %%mm6    \n\t" \
-            "psrlq         $8, %%mm7    \n\t" \
-            "pand "MANGLE(mask24l)", %%mm0\n\t" \
-            "pand "MANGLE(mask24l)", %%mm1\n\t" \
-            "pand "MANGLE(mask24l)", %%mm4\n\t" \
-            "pand "MANGLE(mask24l)", %%mm5\n\t" \
-            "pand "MANGLE(mask24h)", %%mm2\n\t" \
-            "pand "MANGLE(mask24h)", %%mm3\n\t" \
-            "pand "MANGLE(mask24h)", %%mm6\n\t" \
-            "pand "MANGLE(mask24h)", %%mm7\n\t" \
-            "por        %%mm2, %%mm0    \n\t" \
-            "por        %%mm3, %%mm1    \n\t" \
-            "por        %%mm6, %%mm4    \n\t" \
-            "por        %%mm7, %%mm5    \n\t" \
- \
-            "movq       %%mm1, %%mm2    \n\t" \
-            "movq       %%mm4, %%mm3    \n\t" \
-            "psllq        $48, %%mm2    \n\t" \
-            "psllq        $32, %%mm3    \n\t" \
-            "pand "MANGLE(mask24hh)", %%mm2\n\t" \
-            "pand "MANGLE(mask24hhh)", %%mm3\n\t" \
-            "por        %%mm2, %%mm0    \n\t" \
-            "psrlq        $16, %%mm1    \n\t" \
-            "psrlq        $32, %%mm4    \n\t" \
-            "psllq        $16, %%mm5    \n\t" \
-            "por        %%mm3, %%mm1    \n\t" \
-            "pand  "MANGLE(mask24hhhh)", %%mm5\n\t" \
-            "por        %%mm5, %%mm4    \n\t" \
- \
-            MOVNTQ"     %%mm0,   (%0)    \n\t" \
-            MOVNTQ"     %%mm1,  8(%0)    \n\t" \
-            MOVNTQ"     %%mm4, 16(%0)"
-
-
-static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    uint8_t *dest = dst;
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*s):"memory");
-    mm_end = end - 31;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movq        (%1), %%mm0    \n\t"
-            "movq       8(%1), %%mm1    \n\t"
-            "movq      16(%1), %%mm4    \n\t"
-            "movq      24(%1), %%mm5    \n\t"
-            "movq       %%mm0, %%mm2    \n\t"
-            "movq       %%mm1, %%mm3    \n\t"
-            "movq       %%mm4, %%mm6    \n\t"
-            "movq       %%mm5, %%mm7    \n\t"
-            STORE_BGR24_MMX
-            :: "r"(dest), "r"(s)
-            :"memory");
-        dest += 24;
-        s += 32;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        *dest++ = *s++;
-        *dest++ = *s++;
-        *dest++ = *s++;
-        s++;
-    }
-}
-
-/*
- original by Strepto/Astral
- ported to gcc & bugfixed: A'rpi
- MMXEXT, 3DNOW optimization by Nick Kurshev
- 32-bit C version, and and&add trick by Michael Niedermayer
-*/
-static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    register const uint8_t* s=src;
-    register uint8_t* d=dst;
-    register const uint8_t *end;
-    const uint8_t *mm_end;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*s));
-    __asm__ volatile("movq        %0, %%mm4"::"m"(mask15s));
-    mm_end = end - 15;
-    while (s<mm_end) {
-        __asm__ volatile(
-            PREFETCH" 32(%1)        \n\t"
-            "movq      (%1), %%mm0  \n\t"
-            "movq     8(%1), %%mm2  \n\t"
-            "movq     %%mm0, %%mm1  \n\t"
-            "movq     %%mm2, %%mm3  \n\t"
-            "pand     %%mm4, %%mm0  \n\t"
-            "pand     %%mm4, %%mm2  \n\t"
-            "paddw    %%mm1, %%mm0  \n\t"
-            "paddw    %%mm3, %%mm2  \n\t"
-            MOVNTQ"   %%mm0,  (%0)  \n\t"
-            MOVNTQ"   %%mm2, 8(%0)"
-            :: "r"(d), "r"(s)
-        );
-        d+=16;
-        s+=16;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    mm_end = end - 3;
-    while (s < mm_end) {
-        register unsigned x= *((const uint32_t *)s);
-        *((uint32_t *)d) = (x&0x7FFF7FFF) + (x&0x7FE07FE0);
-        d+=4;
-        s+=4;
-    }
-    if (s < end) {
-        register unsigned short x= *((const uint16_t *)s);
-        *((uint16_t *)d) = (x&0x7FFF) + (x&0x7FE0);
-    }
-}
-
-static inline void RENAME(rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    register const uint8_t* s=src;
-    register uint8_t* d=dst;
-    register const uint8_t *end;
-    const uint8_t *mm_end;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*s));
-    __asm__ volatile("movq        %0, %%mm7"::"m"(mask15rg));
-    __asm__ volatile("movq        %0, %%mm6"::"m"(mask15b));
-    mm_end = end - 15;
-    while (s<mm_end) {
-        __asm__ volatile(
-            PREFETCH" 32(%1)        \n\t"
-            "movq      (%1), %%mm0  \n\t"
-            "movq     8(%1), %%mm2  \n\t"
-            "movq     %%mm0, %%mm1  \n\t"
-            "movq     %%mm2, %%mm3  \n\t"
-            "psrlq       $1, %%mm0  \n\t"
-            "psrlq       $1, %%mm2  \n\t"
-            "pand     %%mm7, %%mm0  \n\t"
-            "pand     %%mm7, %%mm2  \n\t"
-            "pand     %%mm6, %%mm1  \n\t"
-            "pand     %%mm6, %%mm3  \n\t"
-            "por      %%mm1, %%mm0  \n\t"
-            "por      %%mm3, %%mm2  \n\t"
-            MOVNTQ"   %%mm0,  (%0)  \n\t"
-            MOVNTQ"   %%mm2, 8(%0)"
-            :: "r"(d), "r"(s)
-        );
-        d+=16;
-        s+=16;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    mm_end = end - 3;
-    while (s < mm_end) {
-        register uint32_t x= *((const uint32_t*)s);
-        *((uint32_t *)d) = ((x>>1)&0x7FE07FE0) | (x&0x001F001F);
-        s+=4;
-        d+=4;
-    }
-    if (s < end) {
-        register uint16_t x= *((const uint16_t*)s);
-        *((uint16_t *)d) = ((x>>1)&0x7FE0) | (x&0x001F);
-    }
-}
-
-static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    uint16_t *d = (uint16_t *)dst;
-    end = s + src_size;
-    mm_end = end - 15;
-    __asm__ volatile(
-        "movq           %3, %%mm5   \n\t"
-        "movq           %4, %%mm6   \n\t"
-        "movq           %5, %%mm7   \n\t"
-        "jmp 2f                     \n\t"
-        ".p2align        4          \n\t"
-        "1:                         \n\t"
-        PREFETCH"   32(%1)          \n\t"
-        "movd         (%1), %%mm0   \n\t"
-        "movd        4(%1), %%mm3   \n\t"
-        "punpckldq   8(%1), %%mm0   \n\t"
-        "punpckldq  12(%1), %%mm3   \n\t"
-        "movq        %%mm0, %%mm1   \n\t"
-        "movq        %%mm3, %%mm4   \n\t"
-        "pand        %%mm6, %%mm0   \n\t"
-        "pand        %%mm6, %%mm3   \n\t"
-        "pmaddwd     %%mm7, %%mm0   \n\t"
-        "pmaddwd     %%mm7, %%mm3   \n\t"
-        "pand        %%mm5, %%mm1   \n\t"
-        "pand        %%mm5, %%mm4   \n\t"
-        "por         %%mm1, %%mm0   \n\t"
-        "por         %%mm4, %%mm3   \n\t"
-        "psrld          $5, %%mm0   \n\t"
-        "pslld         $11, %%mm3   \n\t"
-        "por         %%mm3, %%mm0   \n\t"
-        MOVNTQ"      %%mm0, (%0)    \n\t"
-        "add           $16,  %1     \n\t"
-        "add            $8,  %0     \n\t"
-        "2:                         \n\t"
-        "cmp            %2,  %1     \n\t"
-        " jb            1b          \n\t"
-        : "+r" (d), "+r"(s)
-        : "r" (mm_end), "m" (mask3216g), "m" (mask3216br), "m" (mul3216)
-    );
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        register int rgb = *(const uint32_t*)s; s += 4;
-        *d++ = ((rgb&0xFF)>>3) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>8);
-    }
-}
-
-static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    uint16_t *d = (uint16_t *)dst;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*src):"memory");
-    __asm__ volatile(
-        "movq          %0, %%mm7    \n\t"
-        "movq          %1, %%mm6    \n\t"
-        ::"m"(red_16mask),"m"(green_16mask));
-    mm_end = end - 15;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movd        (%1), %%mm0    \n\t"
-            "movd       4(%1), %%mm3    \n\t"
-            "punpckldq  8(%1), %%mm0    \n\t"
-            "punpckldq 12(%1), %%mm3    \n\t"
-            "movq       %%mm0, %%mm1    \n\t"
-            "movq       %%mm0, %%mm2    \n\t"
-            "movq       %%mm3, %%mm4    \n\t"
-            "movq       %%mm3, %%mm5    \n\t"
-            "psllq         $8, %%mm0    \n\t"
-            "psllq         $8, %%mm3    \n\t"
-            "pand       %%mm7, %%mm0    \n\t"
-            "pand       %%mm7, %%mm3    \n\t"
-            "psrlq         $5, %%mm1    \n\t"
-            "psrlq         $5, %%mm4    \n\t"
-            "pand       %%mm6, %%mm1    \n\t"
-            "pand       %%mm6, %%mm4    \n\t"
-            "psrlq        $19, %%mm2    \n\t"
-            "psrlq        $19, %%mm5    \n\t"
-            "pand          %2, %%mm2    \n\t"
-            "pand          %2, %%mm5    \n\t"
-            "por        %%mm1, %%mm0    \n\t"
-            "por        %%mm4, %%mm3    \n\t"
-            "por        %%mm2, %%mm0    \n\t"
-            "por        %%mm5, %%mm3    \n\t"
-            "psllq        $16, %%mm3    \n\t"
-            "por        %%mm3, %%mm0    \n\t"
-            MOVNTQ"     %%mm0, (%0)     \n\t"
-            :: "r"(d),"r"(s),"m"(blue_16mask):"memory");
-        d += 4;
-        s += 16;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        register int rgb = *(const uint32_t*)s; s += 4;
-        *d++ = ((rgb&0xF8)<<8) + ((rgb&0xFC00)>>5) + ((rgb&0xF80000)>>19);
-    }
-}
-
-static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    uint16_t *d = (uint16_t *)dst;
-    end = s + src_size;
-    mm_end = end - 15;
-    __asm__ volatile(
-        "movq           %3, %%mm5   \n\t"
-        "movq           %4, %%mm6   \n\t"
-        "movq           %5, %%mm7   \n\t"
-        "jmp            2f          \n\t"
-        ".p2align        4          \n\t"
-        "1:                         \n\t"
-        PREFETCH"   32(%1)          \n\t"
-        "movd         (%1), %%mm0   \n\t"
-        "movd        4(%1), %%mm3   \n\t"
-        "punpckldq   8(%1), %%mm0   \n\t"
-        "punpckldq  12(%1), %%mm3   \n\t"
-        "movq        %%mm0, %%mm1   \n\t"
-        "movq        %%mm3, %%mm4   \n\t"
-        "pand        %%mm6, %%mm0   \n\t"
-        "pand        %%mm6, %%mm3   \n\t"
-        "pmaddwd     %%mm7, %%mm0   \n\t"
-        "pmaddwd     %%mm7, %%mm3   \n\t"
-        "pand        %%mm5, %%mm1   \n\t"
-        "pand        %%mm5, %%mm4   \n\t"
-        "por         %%mm1, %%mm0   \n\t"
-        "por         %%mm4, %%mm3   \n\t"
-        "psrld          $6, %%mm0   \n\t"
-        "pslld         $10, %%mm3   \n\t"
-        "por         %%mm3, %%mm0   \n\t"
-        MOVNTQ"      %%mm0, (%0)    \n\t"
-        "add           $16,  %1     \n\t"
-        "add            $8,  %0     \n\t"
-        "2:                         \n\t"
-        "cmp            %2,  %1     \n\t"
-        " jb            1b          \n\t"
-        : "+r" (d), "+r"(s)
-        : "r" (mm_end), "m" (mask3215g), "m" (mask3216br), "m" (mul3215)
-    );
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        register int rgb = *(const uint32_t*)s; s += 4;
-        *d++ = ((rgb&0xFF)>>3) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>9);
-    }
-}
-
-static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    uint16_t *d = (uint16_t *)dst;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*src):"memory");
-    __asm__ volatile(
-        "movq          %0, %%mm7    \n\t"
-        "movq          %1, %%mm6    \n\t"
-        ::"m"(red_15mask),"m"(green_15mask));
-    mm_end = end - 15;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movd        (%1), %%mm0    \n\t"
-            "movd       4(%1), %%mm3    \n\t"
-            "punpckldq  8(%1), %%mm0    \n\t"
-            "punpckldq 12(%1), %%mm3    \n\t"
-            "movq       %%mm0, %%mm1    \n\t"
-            "movq       %%mm0, %%mm2    \n\t"
-            "movq       %%mm3, %%mm4    \n\t"
-            "movq       %%mm3, %%mm5    \n\t"
-            "psllq         $7, %%mm0    \n\t"
-            "psllq         $7, %%mm3    \n\t"
-            "pand       %%mm7, %%mm0    \n\t"
-            "pand       %%mm7, %%mm3    \n\t"
-            "psrlq         $6, %%mm1    \n\t"
-            "psrlq         $6, %%mm4    \n\t"
-            "pand       %%mm6, %%mm1    \n\t"
-            "pand       %%mm6, %%mm4    \n\t"
-            "psrlq        $19, %%mm2    \n\t"
-            "psrlq        $19, %%mm5    \n\t"
-            "pand          %2, %%mm2    \n\t"
-            "pand          %2, %%mm5    \n\t"
-            "por        %%mm1, %%mm0    \n\t"
-            "por        %%mm4, %%mm3    \n\t"
-            "por        %%mm2, %%mm0    \n\t"
-            "por        %%mm5, %%mm3    \n\t"
-            "psllq        $16, %%mm3    \n\t"
-            "por        %%mm3, %%mm0    \n\t"
-            MOVNTQ"     %%mm0, (%0)     \n\t"
-            ::"r"(d),"r"(s),"m"(blue_15mask):"memory");
-        d += 4;
-        s += 16;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        register int rgb = *(const uint32_t*)s; s += 4;
-        *d++ = ((rgb&0xF8)<<7) + ((rgb&0xF800)>>6) + ((rgb&0xF80000)>>19);
-    }
-}
-
-static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    uint16_t *d = (uint16_t *)dst;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*src):"memory");
-    __asm__ volatile(
-        "movq         %0, %%mm7     \n\t"
-        "movq         %1, %%mm6     \n\t"
-        ::"m"(red_16mask),"m"(green_16mask));
-    mm_end = end - 11;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movd        (%1), %%mm0    \n\t"
-            "movd       3(%1), %%mm3    \n\t"
-            "punpckldq  6(%1), %%mm0    \n\t"
-            "punpckldq  9(%1), %%mm3    \n\t"
-            "movq       %%mm0, %%mm1    \n\t"
-            "movq       %%mm0, %%mm2    \n\t"
-            "movq       %%mm3, %%mm4    \n\t"
-            "movq       %%mm3, %%mm5    \n\t"
-            "psrlq         $3, %%mm0    \n\t"
-            "psrlq         $3, %%mm3    \n\t"
-            "pand          %2, %%mm0    \n\t"
-            "pand          %2, %%mm3    \n\t"
-            "psrlq         $5, %%mm1    \n\t"
-            "psrlq         $5, %%mm4    \n\t"
-            "pand       %%mm6, %%mm1    \n\t"
-            "pand       %%mm6, %%mm4    \n\t"
-            "psrlq         $8, %%mm2    \n\t"
-            "psrlq         $8, %%mm5    \n\t"
-            "pand       %%mm7, %%mm2    \n\t"
-            "pand       %%mm7, %%mm5    \n\t"
-            "por        %%mm1, %%mm0    \n\t"
-            "por        %%mm4, %%mm3    \n\t"
-            "por        %%mm2, %%mm0    \n\t"
-            "por        %%mm5, %%mm3    \n\t"
-            "psllq        $16, %%mm3    \n\t"
-            "por        %%mm3, %%mm0    \n\t"
-            MOVNTQ"     %%mm0, (%0)     \n\t"
-            ::"r"(d),"r"(s),"m"(blue_16mask):"memory");
-        d += 4;
-        s += 12;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        const int b = *s++;
-        const int g = *s++;
-        const int r = *s++;
-        *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8);
-    }
-}
-
-static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    uint16_t *d = (uint16_t *)dst;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*src):"memory");
-    __asm__ volatile(
-        "movq         %0, %%mm7     \n\t"
-        "movq         %1, %%mm6     \n\t"
-        ::"m"(red_16mask),"m"(green_16mask));
-    mm_end = end - 15;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movd        (%1), %%mm0    \n\t"
-            "movd       3(%1), %%mm3    \n\t"
-            "punpckldq  6(%1), %%mm0    \n\t"
-            "punpckldq  9(%1), %%mm3    \n\t"
-            "movq       %%mm0, %%mm1    \n\t"
-            "movq       %%mm0, %%mm2    \n\t"
-            "movq       %%mm3, %%mm4    \n\t"
-            "movq       %%mm3, %%mm5    \n\t"
-            "psllq         $8, %%mm0    \n\t"
-            "psllq         $8, %%mm3    \n\t"
-            "pand       %%mm7, %%mm0    \n\t"
-            "pand       %%mm7, %%mm3    \n\t"
-            "psrlq         $5, %%mm1    \n\t"
-            "psrlq         $5, %%mm4    \n\t"
-            "pand       %%mm6, %%mm1    \n\t"
-            "pand       %%mm6, %%mm4    \n\t"
-            "psrlq        $19, %%mm2    \n\t"
-            "psrlq        $19, %%mm5    \n\t"
-            "pand          %2, %%mm2    \n\t"
-            "pand          %2, %%mm5    \n\t"
-            "por        %%mm1, %%mm0    \n\t"
-            "por        %%mm4, %%mm3    \n\t"
-            "por        %%mm2, %%mm0    \n\t"
-            "por        %%mm5, %%mm3    \n\t"
-            "psllq        $16, %%mm3    \n\t"
-            "por        %%mm3, %%mm0    \n\t"
-            MOVNTQ"     %%mm0, (%0)     \n\t"
-            ::"r"(d),"r"(s),"m"(blue_16mask):"memory");
-        d += 4;
-        s += 12;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        const int r = *s++;
-        const int g = *s++;
-        const int b = *s++;
-        *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8);
-    }
-}
-
-static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    uint16_t *d = (uint16_t *)dst;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*src):"memory");
-    __asm__ volatile(
-        "movq          %0, %%mm7    \n\t"
-        "movq          %1, %%mm6    \n\t"
-        ::"m"(red_15mask),"m"(green_15mask));
-    mm_end = end - 11;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movd        (%1), %%mm0    \n\t"
-            "movd       3(%1), %%mm3    \n\t"
-            "punpckldq  6(%1), %%mm0    \n\t"
-            "punpckldq  9(%1), %%mm3    \n\t"
-            "movq       %%mm0, %%mm1    \n\t"
-            "movq       %%mm0, %%mm2    \n\t"
-            "movq       %%mm3, %%mm4    \n\t"
-            "movq       %%mm3, %%mm5    \n\t"
-            "psrlq         $3, %%mm0    \n\t"
-            "psrlq         $3, %%mm3    \n\t"
-            "pand          %2, %%mm0    \n\t"
-            "pand          %2, %%mm3    \n\t"
-            "psrlq         $6, %%mm1    \n\t"
-            "psrlq         $6, %%mm4    \n\t"
-            "pand       %%mm6, %%mm1    \n\t"
-            "pand       %%mm6, %%mm4    \n\t"
-            "psrlq         $9, %%mm2    \n\t"
-            "psrlq         $9, %%mm5    \n\t"
-            "pand       %%mm7, %%mm2    \n\t"
-            "pand       %%mm7, %%mm5    \n\t"
-            "por        %%mm1, %%mm0    \n\t"
-            "por        %%mm4, %%mm3    \n\t"
-            "por        %%mm2, %%mm0    \n\t"
-            "por        %%mm5, %%mm3    \n\t"
-            "psllq        $16, %%mm3    \n\t"
-            "por        %%mm3, %%mm0    \n\t"
-            MOVNTQ"     %%mm0, (%0)     \n\t"
-            ::"r"(d),"r"(s),"m"(blue_15mask):"memory");
-        d += 4;
-        s += 12;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        const int b = *s++;
-        const int g = *s++;
-        const int r = *s++;
-        *d++ = (b>>3) | ((g&0xF8)<<2) | ((r&0xF8)<<7);
-    }
-}
-
-static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint8_t *s = src;
-    const uint8_t *end;
-    const uint8_t *mm_end;
-    uint16_t *d = (uint16_t *)dst;
-    end = s + src_size;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*src):"memory");
-    __asm__ volatile(
-        "movq         %0, %%mm7     \n\t"
-        "movq         %1, %%mm6     \n\t"
-        ::"m"(red_15mask),"m"(green_15mask));
-    mm_end = end - 15;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH" 32(%1)            \n\t"
-            "movd       (%1), %%mm0     \n\t"
-            "movd      3(%1), %%mm3     \n\t"
-            "punpckldq 6(%1), %%mm0     \n\t"
-            "punpckldq 9(%1), %%mm3     \n\t"
-            "movq      %%mm0, %%mm1     \n\t"
-            "movq      %%mm0, %%mm2     \n\t"
-            "movq      %%mm3, %%mm4     \n\t"
-            "movq      %%mm3, %%mm5     \n\t"
-            "psllq        $7, %%mm0     \n\t"
-            "psllq        $7, %%mm3     \n\t"
-            "pand      %%mm7, %%mm0     \n\t"
-            "pand      %%mm7, %%mm3     \n\t"
-            "psrlq        $6, %%mm1     \n\t"
-            "psrlq        $6, %%mm4     \n\t"
-            "pand      %%mm6, %%mm1     \n\t"
-            "pand      %%mm6, %%mm4     \n\t"
-            "psrlq       $19, %%mm2     \n\t"
-            "psrlq       $19, %%mm5     \n\t"
-            "pand         %2, %%mm2     \n\t"
-            "pand         %2, %%mm5     \n\t"
-            "por       %%mm1, %%mm0     \n\t"
-            "por       %%mm4, %%mm3     \n\t"
-            "por       %%mm2, %%mm0     \n\t"
-            "por       %%mm5, %%mm3     \n\t"
-            "psllq       $16, %%mm3     \n\t"
-            "por       %%mm3, %%mm0     \n\t"
-            MOVNTQ"    %%mm0, (%0)      \n\t"
-            ::"r"(d),"r"(s),"m"(blue_15mask):"memory");
-        d += 4;
-        s += 12;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        const int r = *s++;
-        const int g = *s++;
-        const int b = *s++;
-        *d++ = (b>>3) | ((g&0xF8)<<2) | ((r&0xF8)<<7);
-    }
-}
-
-/*
-  I use less accurate approximation here by simply left-shifting the input
-  value and filling the low order bits with zeroes. This method improves PNG
-  compression but this scheme cannot reproduce white exactly, since it does
-  not generate an all-ones maximum value; the net effect is to darken the
-  image slightly.
-
-  The better method should be "left bit replication":
-
-   4 3 2 1 0
-   ---------
-   1 1 0 1 1
-
-   7 6 5 4 3  2 1 0
-   ----------------
-   1 1 0 1 1  1 1 0
-   |=======|  |===|
-       |      leftmost bits repeated to fill open bits
-       |
-   original bits
-*/
-static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint16_t *end;
-    const uint16_t *mm_end;
-    uint8_t *d = dst;
-    const uint16_t *s = (const uint16_t*)src;
-    end = s + src_size/2;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*s):"memory");
-    mm_end = end - 7;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movq        (%1), %%mm0    \n\t"
-            "movq        (%1), %%mm1    \n\t"
-            "movq        (%1), %%mm2    \n\t"
-            "pand          %2, %%mm0    \n\t"
-            "pand          %3, %%mm1    \n\t"
-            "pand          %4, %%mm2    \n\t"
-            "psllq         $3, %%mm0    \n\t"
-            "psrlq         $2, %%mm1    \n\t"
-            "psrlq         $7, %%mm2    \n\t"
-            "movq       %%mm0, %%mm3    \n\t"
-            "movq       %%mm1, %%mm4    \n\t"
-            "movq       %%mm2, %%mm5    \n\t"
-            "punpcklwd     %5, %%mm0    \n\t"
-            "punpcklwd     %5, %%mm1    \n\t"
-            "punpcklwd     %5, %%mm2    \n\t"
-            "punpckhwd     %5, %%mm3    \n\t"
-            "punpckhwd     %5, %%mm4    \n\t"
-            "punpckhwd     %5, %%mm5    \n\t"
-            "psllq         $8, %%mm1    \n\t"
-            "psllq        $16, %%mm2    \n\t"
-            "por        %%mm1, %%mm0    \n\t"
-            "por        %%mm2, %%mm0    \n\t"
-            "psllq         $8, %%mm4    \n\t"
-            "psllq        $16, %%mm5    \n\t"
-            "por        %%mm4, %%mm3    \n\t"
-            "por        %%mm5, %%mm3    \n\t"
-
-            "movq       %%mm0, %%mm6    \n\t"
-            "movq       %%mm3, %%mm7    \n\t"
-
-            "movq       8(%1), %%mm0    \n\t"
-            "movq       8(%1), %%mm1    \n\t"
-            "movq       8(%1), %%mm2    \n\t"
-            "pand          %2, %%mm0    \n\t"
-            "pand          %3, %%mm1    \n\t"
-            "pand          %4, %%mm2    \n\t"
-            "psllq         $3, %%mm0    \n\t"
-            "psrlq         $2, %%mm1    \n\t"
-            "psrlq         $7, %%mm2    \n\t"
-            "movq       %%mm0, %%mm3    \n\t"
-            "movq       %%mm1, %%mm4    \n\t"
-            "movq       %%mm2, %%mm5    \n\t"
-            "punpcklwd     %5, %%mm0    \n\t"
-            "punpcklwd     %5, %%mm1    \n\t"
-            "punpcklwd     %5, %%mm2    \n\t"
-            "punpckhwd     %5, %%mm3    \n\t"
-            "punpckhwd     %5, %%mm4    \n\t"
-            "punpckhwd     %5, %%mm5    \n\t"
-            "psllq         $8, %%mm1    \n\t"
-            "psllq        $16, %%mm2    \n\t"
-            "por        %%mm1, %%mm0    \n\t"
-            "por        %%mm2, %%mm0    \n\t"
-            "psllq         $8, %%mm4    \n\t"
-            "psllq        $16, %%mm5    \n\t"
-            "por        %%mm4, %%mm3    \n\t"
-            "por        %%mm5, %%mm3    \n\t"
-
-            :"=m"(*d)
-            :"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r), "m"(mmx_null)
-            :"memory");
-        /* borrowed 32 to 24 */
-        __asm__ volatile(
-            "movq       %%mm0, %%mm4    \n\t"
-            "movq       %%mm3, %%mm5    \n\t"
-            "movq       %%mm6, %%mm0    \n\t"
-            "movq       %%mm7, %%mm1    \n\t"
-
-            "movq       %%mm4, %%mm6    \n\t"
-            "movq       %%mm5, %%mm7    \n\t"
-            "movq       %%mm0, %%mm2    \n\t"
-            "movq       %%mm1, %%mm3    \n\t"
-
-            STORE_BGR24_MMX
-
-            :: "r"(d), "m"(*s)
-            :"memory");
-        d += 24;
-        s += 8;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        register uint16_t bgr;
-        bgr = *s++;
-        *d++ = (bgr&0x1F)<<3;
-        *d++ = (bgr&0x3E0)>>2;
-        *d++ = (bgr&0x7C00)>>7;
-    }
-}
-
-static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint16_t *end;
-    const uint16_t *mm_end;
-    uint8_t *d = (uint8_t *)dst;
-    const uint16_t *s = (const uint16_t *)src;
-    end = s + src_size/2;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*s):"memory");
-    mm_end = end - 7;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movq        (%1), %%mm0    \n\t"
-            "movq        (%1), %%mm1    \n\t"
-            "movq        (%1), %%mm2    \n\t"
-            "pand          %2, %%mm0    \n\t"
-            "pand          %3, %%mm1    \n\t"
-            "pand          %4, %%mm2    \n\t"
-            "psllq         $3, %%mm0    \n\t"
-            "psrlq         $3, %%mm1    \n\t"
-            "psrlq         $8, %%mm2    \n\t"
-            "movq       %%mm0, %%mm3    \n\t"
-            "movq       %%mm1, %%mm4    \n\t"
-            "movq       %%mm2, %%mm5    \n\t"
-            "punpcklwd     %5, %%mm0    \n\t"
-            "punpcklwd     %5, %%mm1    \n\t"
-            "punpcklwd     %5, %%mm2    \n\t"
-            "punpckhwd     %5, %%mm3    \n\t"
-            "punpckhwd     %5, %%mm4    \n\t"
-            "punpckhwd     %5, %%mm5    \n\t"
-            "psllq         $8, %%mm1    \n\t"
-            "psllq        $16, %%mm2    \n\t"
-            "por        %%mm1, %%mm0    \n\t"
-            "por        %%mm2, %%mm0    \n\t"
-            "psllq         $8, %%mm4    \n\t"
-            "psllq        $16, %%mm5    \n\t"
-            "por        %%mm4, %%mm3    \n\t"
-            "por        %%mm5, %%mm3    \n\t"
-
-            "movq       %%mm0, %%mm6    \n\t"
-            "movq       %%mm3, %%mm7    \n\t"
-
-            "movq       8(%1), %%mm0    \n\t"
-            "movq       8(%1), %%mm1    \n\t"
-            "movq       8(%1), %%mm2    \n\t"
-            "pand          %2, %%mm0    \n\t"
-            "pand          %3, %%mm1    \n\t"
-            "pand          %4, %%mm2    \n\t"
-            "psllq         $3, %%mm0    \n\t"
-            "psrlq         $3, %%mm1    \n\t"
-            "psrlq         $8, %%mm2    \n\t"
-            "movq       %%mm0, %%mm3    \n\t"
-            "movq       %%mm1, %%mm4    \n\t"
-            "movq       %%mm2, %%mm5    \n\t"
-            "punpcklwd     %5, %%mm0    \n\t"
-            "punpcklwd     %5, %%mm1    \n\t"
-            "punpcklwd     %5, %%mm2    \n\t"
-            "punpckhwd     %5, %%mm3    \n\t"
-            "punpckhwd     %5, %%mm4    \n\t"
-            "punpckhwd     %5, %%mm5    \n\t"
-            "psllq         $8, %%mm1    \n\t"
-            "psllq        $16, %%mm2    \n\t"
-            "por        %%mm1, %%mm0    \n\t"
-            "por        %%mm2, %%mm0    \n\t"
-            "psllq         $8, %%mm4    \n\t"
-            "psllq        $16, %%mm5    \n\t"
-            "por        %%mm4, %%mm3    \n\t"
-            "por        %%mm5, %%mm3    \n\t"
-            :"=m"(*d)
-            :"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null)
-            :"memory");
-        /* borrowed 32 to 24 */
-        __asm__ volatile(
-            "movq       %%mm0, %%mm4    \n\t"
-            "movq       %%mm3, %%mm5    \n\t"
-            "movq       %%mm6, %%mm0    \n\t"
-            "movq       %%mm7, %%mm1    \n\t"
-
-            "movq       %%mm4, %%mm6    \n\t"
-            "movq       %%mm5, %%mm7    \n\t"
-            "movq       %%mm0, %%mm2    \n\t"
-            "movq       %%mm1, %%mm3    \n\t"
-
-            STORE_BGR24_MMX
-
-            :: "r"(d), "m"(*s)
-            :"memory");
-        d += 24;
-        s += 8;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        register uint16_t bgr;
-        bgr = *s++;
-        *d++ = (bgr&0x1F)<<3;
-        *d++ = (bgr&0x7E0)>>3;
-        *d++ = (bgr&0xF800)>>8;
-    }
-}
-
-/*
- * mm0 = 00 B3 00 B2 00 B1 00 B0
- * mm1 = 00 G3 00 G2 00 G1 00 G0
- * mm2 = 00 R3 00 R2 00 R1 00 R0
- * mm6 = FF FF FF FF FF FF FF FF
- * mm7 = 00 00 00 00 00 00 00 00
- */
-#define PACK_RGB32 \
-    "packuswb   %%mm7, %%mm0    \n\t" /* 00 00 00 00 B3 B2 B1 B0 */ \
-    "packuswb   %%mm7, %%mm1    \n\t" /* 00 00 00 00 G3 G2 G1 G0 */ \
-    "packuswb   %%mm7, %%mm2    \n\t" /* 00 00 00 00 R3 R2 R1 R0 */ \
-    "punpcklbw  %%mm1, %%mm0    \n\t" /* G3 B3 G2 B2 G1 B1 G0 B0 */ \
-    "punpcklbw  %%mm6, %%mm2    \n\t" /* FF R3 FF R2 FF R1 FF R0 */ \
-    "movq       %%mm0, %%mm3    \n\t"                               \
-    "punpcklwd  %%mm2, %%mm0    \n\t" /* FF R1 G1 B1 FF R0 G0 B0 */ \
-    "punpckhwd  %%mm2, %%mm3    \n\t" /* FF R3 G3 B3 FF R2 G2 B2 */ \
-    MOVNTQ"     %%mm0,  (%0)    \n\t"                               \
-    MOVNTQ"     %%mm3, 8(%0)    \n\t"                               \
-
-static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint16_t *end;
-    const uint16_t *mm_end;
-    uint8_t *d = dst;
-    const uint16_t *s = (const uint16_t *)src;
-    end = s + src_size/2;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*s):"memory");
-    __asm__ volatile("pxor    %%mm7,%%mm7    \n\t":::"memory");
-    __asm__ volatile("pcmpeqd %%mm6,%%mm6    \n\t":::"memory");
-    mm_end = end - 3;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movq        (%1), %%mm0    \n\t"
-            "movq        (%1), %%mm1    \n\t"
-            "movq        (%1), %%mm2    \n\t"
-            "pand          %2, %%mm0    \n\t"
-            "pand          %3, %%mm1    \n\t"
-            "pand          %4, %%mm2    \n\t"
-            "psllq         $3, %%mm0    \n\t"
-            "psrlq         $2, %%mm1    \n\t"
-            "psrlq         $7, %%mm2    \n\t"
-            PACK_RGB32
-            ::"r"(d),"r"(s),"m"(mask15b),"m"(mask15g),"m"(mask15r)
-            :"memory");
-        d += 16;
-        s += 4;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        register uint16_t bgr;
-        bgr = *s++;
-        *d++ = (bgr&0x1F)<<3;
-        *d++ = (bgr&0x3E0)>>2;
-        *d++ = (bgr&0x7C00)>>7;
-        *d++ = 255;
-    }
-}
-
-static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    const uint16_t *end;
-    const uint16_t *mm_end;
-    uint8_t *d = dst;
-    const uint16_t *s = (const uint16_t*)src;
-    end = s + src_size/2;
-    __asm__ volatile(PREFETCH"    %0"::"m"(*s):"memory");
-    __asm__ volatile("pxor    %%mm7,%%mm7    \n\t":::"memory");
-    __asm__ volatile("pcmpeqd %%mm6,%%mm6    \n\t":::"memory");
-    mm_end = end - 3;
-    while (s < mm_end) {
-        __asm__ volatile(
-            PREFETCH"  32(%1)           \n\t"
-            "movq        (%1), %%mm0    \n\t"
-            "movq        (%1), %%mm1    \n\t"
-            "movq        (%1), %%mm2    \n\t"
-            "pand          %2, %%mm0    \n\t"
-            "pand          %3, %%mm1    \n\t"
-            "pand          %4, %%mm2    \n\t"
-            "psllq         $3, %%mm0    \n\t"
-            "psrlq         $3, %%mm1    \n\t"
-            "psrlq         $8, %%mm2    \n\t"
-            PACK_RGB32
-            ::"r"(d),"r"(s),"m"(mask16b),"m"(mask16g),"m"(mask16r)
-            :"memory");
-        d += 16;
-        s += 4;
-    }
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-    while (s < end) {
-        register uint16_t bgr;
-        bgr = *s++;
-        *d++ = (bgr&0x1F)<<3;
-        *d++ = (bgr&0x7E0)>>3;
-        *d++ = (bgr&0xF800)>>8;
-        *d++ = 255;
-    }
-}
-
-static inline void RENAME(shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    x86_reg idx = 15 - src_size;
-    const uint8_t *s = src-idx;
-    uint8_t *d = dst-idx;
-    __asm__ volatile(
-        "test          %0, %0           \n\t"
-        "jns           2f               \n\t"
-        PREFETCH"       (%1, %0)        \n\t"
-        "movq          %3, %%mm7        \n\t"
-        "pxor          %4, %%mm7        \n\t"
-        "movq       %%mm7, %%mm6        \n\t"
-        "pxor          %5, %%mm7        \n\t"
-        ".p2align       4               \n\t"
-        "1:                             \n\t"
-        PREFETCH"     32(%1, %0)        \n\t"
-        "movq           (%1, %0), %%mm0 \n\t"
-        "movq          8(%1, %0), %%mm1 \n\t"
-# if COMPILE_TEMPLATE_MMXEXT
-        "pshufw      $177, %%mm0, %%mm3 \n\t"
-        "pshufw      $177, %%mm1, %%mm5 \n\t"
-        "pand       %%mm7, %%mm0        \n\t"
-        "pand       %%mm6, %%mm3        \n\t"
-        "pand       %%mm7, %%mm1        \n\t"
-        "pand       %%mm6, %%mm5        \n\t"
-        "por        %%mm3, %%mm0        \n\t"
-        "por        %%mm5, %%mm1        \n\t"
-# else
-        "movq       %%mm0, %%mm2        \n\t"
-        "movq       %%mm1, %%mm4        \n\t"
-        "pand       %%mm7, %%mm0        \n\t"
-        "pand       %%mm6, %%mm2        \n\t"
-        "pand       %%mm7, %%mm1        \n\t"
-        "pand       %%mm6, %%mm4        \n\t"
-        "movq       %%mm2, %%mm3        \n\t"
-        "movq       %%mm4, %%mm5        \n\t"
-        "pslld        $16, %%mm2        \n\t"
-        "psrld        $16, %%mm3        \n\t"
-        "pslld        $16, %%mm4        \n\t"
-        "psrld        $16, %%mm5        \n\t"
-        "por        %%mm2, %%mm0        \n\t"
-        "por        %%mm4, %%mm1        \n\t"
-        "por        %%mm3, %%mm0        \n\t"
-        "por        %%mm5, %%mm1        \n\t"
-# endif
-        MOVNTQ"     %%mm0,  (%2, %0)    \n\t"
-        MOVNTQ"     %%mm1, 8(%2, %0)    \n\t"
-        "add          $16, %0           \n\t"
-        "js            1b               \n\t"
-        SFENCE"                         \n\t"
-        EMMS"                           \n\t"
-        "2:                             \n\t"
-        : "+&r"(idx)
-        : "r" (s), "r" (d), "m" (mask32b), "m" (mask32r), "m" (mmx_one)
-        : "memory");
-    for (; idx<15; idx+=4) {
-        register int v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00;
-        v &= 0xff00ff;
-        *(uint32_t *)&d[idx] = (v>>16) + g + (v<<16);
-    }
-}
-
-static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size)
-{
-    unsigned i;
-    x86_reg mmx_size= 23 - src_size;
-    __asm__ volatile (
-        "test             %%"REG_a", %%"REG_a"          \n\t"
-        "jns                     2f                     \n\t"
-        "movq     "MANGLE(mask24r)", %%mm5              \n\t"
-        "movq     "MANGLE(mask24g)", %%mm6              \n\t"
-        "movq     "MANGLE(mask24b)", %%mm7              \n\t"
-        ".p2align                 4                     \n\t"
-        "1:                                             \n\t"
-        PREFETCH" 32(%1, %%"REG_a")                     \n\t"
-        "movq       (%1, %%"REG_a"), %%mm0              \n\t" // BGR BGR BG
-        "movq       (%1, %%"REG_a"), %%mm1              \n\t" // BGR BGR BG
-        "movq      2(%1, %%"REG_a"), %%mm2              \n\t" // R BGR BGR B
-        "psllq                  $16, %%mm0              \n\t" // 00 BGR BGR
-        "pand                 %%mm5, %%mm0              \n\t"
-        "pand                 %%mm6, %%mm1              \n\t"
-        "pand                 %%mm7, %%mm2              \n\t"
-        "por                  %%mm0, %%mm1              \n\t"
-        "por                  %%mm2, %%mm1              \n\t"
-        "movq      6(%1, %%"REG_a"), %%mm0              \n\t" // BGR BGR BG
-        MOVNTQ"               %%mm1,   (%2, %%"REG_a")  \n\t" // RGB RGB RG
-        "movq      8(%1, %%"REG_a"), %%mm1              \n\t" // R BGR BGR B
-        "movq     10(%1, %%"REG_a"), %%mm2              \n\t" // GR BGR BGR
-        "pand                 %%mm7, %%mm0              \n\t"
-        "pand                 %%mm5, %%mm1              \n\t"
-        "pand                 %%mm6, %%mm2              \n\t"
-        "por                  %%mm0, %%mm1              \n\t"
-        "por                  %%mm2, %%mm1              \n\t"
-        "movq     14(%1, %%"REG_a"), %%mm0              \n\t" // R BGR BGR B
-        MOVNTQ"               %%mm1,  8(%2, %%"REG_a")  \n\t" // B RGB RGB R
-        "movq     16(%1, %%"REG_a"), %%mm1              \n\t" // GR BGR BGR
-        "movq     18(%1, %%"REG_a"), %%mm2              \n\t" // BGR BGR BG
-        "pand                 %%mm6, %%mm0              \n\t"
-        "pand                 %%mm7, %%mm1              \n\t"
-        "pand                 %%mm5, %%mm2              \n\t"
-        "por                  %%mm0, %%mm1              \n\t"
-        "por                  %%mm2, %%mm1              \n\t"
-        MOVNTQ"               %%mm1, 16(%2, %%"REG_a")  \n\t"
-        "add                    $24, %%"REG_a"          \n\t"
-        " js                     1b                     \n\t"
-        "2:                                             \n\t"
-        : "+a" (mmx_size)
-        : "r" (src-mmx_size), "r"(dst-mmx_size)
-    );
-
-    __asm__ volatile(SFENCE:::"memory");
-    __asm__ volatile(EMMS:::"memory");
-
-    if (mmx_size==23) return; //finished, was multiple of 8
-
-    src+= src_size;
-    dst+= src_size;
-    src_size= 23-mmx_size;
-    src-= src_size;
-    dst-= src_size;
-    for (i=0; i<src_size; i+=3) {
-        register uint8_t x;
-        x          = src[i + 2];
-        dst[i + 1] = src[i + 1];
-        dst[i + 2] = src[i + 0];
-        dst[i + 0] = x;
-    }
-}
-
-static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                                           int width, int height,
-                                           int lumStride, int chromStride, int dstStride, int vertLumPerChroma)
-{
-    int y;
-    const x86_reg chromWidth= width>>1;
-    for (y=0; y<height; y++) {
-        //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
-        __asm__ volatile(
-            "xor                 %%"REG_a", %%"REG_a"   \n\t"
-            ".p2align                    4              \n\t"
-            "1:                                         \n\t"
-            PREFETCH"    32(%1, %%"REG_a", 2)           \n\t"
-            PREFETCH"    32(%2, %%"REG_a")              \n\t"
-            PREFETCH"    32(%3, %%"REG_a")              \n\t"
-            "movq          (%2, %%"REG_a"), %%mm0       \n\t" // U(0)
-            "movq                    %%mm0, %%mm2       \n\t" // U(0)
-            "movq          (%3, %%"REG_a"), %%mm1       \n\t" // V(0)
-            "punpcklbw               %%mm1, %%mm0       \n\t" // UVUV UVUV(0)
-            "punpckhbw               %%mm1, %%mm2       \n\t" // UVUV UVUV(8)
-
-            "movq        (%1, %%"REG_a",2), %%mm3       \n\t" // Y(0)
-            "movq       8(%1, %%"REG_a",2), %%mm5       \n\t" // Y(8)
-            "movq                    %%mm3, %%mm4       \n\t" // Y(0)
-            "movq                    %%mm5, %%mm6       \n\t" // Y(8)
-            "punpcklbw               %%mm0, %%mm3       \n\t" // YUYV YUYV(0)
-            "punpckhbw               %%mm0, %%mm4       \n\t" // YUYV YUYV(4)
-            "punpcklbw               %%mm2, %%mm5       \n\t" // YUYV YUYV(8)
-            "punpckhbw               %%mm2, %%mm6       \n\t" // YUYV YUYV(12)
-
-            MOVNTQ"                  %%mm3,   (%0, %%"REG_a", 4)    \n\t"
-            MOVNTQ"                  %%mm4,  8(%0, %%"REG_a", 4)    \n\t"
-            MOVNTQ"                  %%mm5, 16(%0, %%"REG_a", 4)    \n\t"
-            MOVNTQ"                  %%mm6, 24(%0, %%"REG_a", 4)    \n\t"
-
-            "add                        $8, %%"REG_a"   \n\t"
-            "cmp                        %4, %%"REG_a"   \n\t"
-            " jb                        1b              \n\t"
-            ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (chromWidth)
-            : "%"REG_a
-        );
-        if ((y&(vertLumPerChroma-1)) == vertLumPerChroma-1) {
-            usrc += chromStride;
-            vsrc += chromStride;
-        }
-        ysrc += lumStride;
-        dst  += dstStride;
-    }
-    __asm__(EMMS"       \n\t"
-            SFENCE"     \n\t"
-            :::"memory");
-}
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- */
-static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                                      int width, int height,
-                                      int lumStride, int chromStride, int dstStride)
-{
-    //FIXME interpolate chroma
-    RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2);
-}
-
-static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                                           int width, int height,
-                                           int lumStride, int chromStride, int dstStride, int vertLumPerChroma)
-{
-    int y;
-    const x86_reg chromWidth= width>>1;
-    for (y=0; y<height; y++) {
-        //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
-        __asm__ volatile(
-            "xor                %%"REG_a", %%"REG_a"    \n\t"
-            ".p2align                   4               \n\t"
-            "1:                                         \n\t"
-            PREFETCH"   32(%1, %%"REG_a", 2)            \n\t"
-            PREFETCH"   32(%2, %%"REG_a")               \n\t"
-            PREFETCH"   32(%3, %%"REG_a")               \n\t"
-            "movq         (%2, %%"REG_a"), %%mm0        \n\t" // U(0)
-            "movq                   %%mm0, %%mm2        \n\t" // U(0)
-            "movq         (%3, %%"REG_a"), %%mm1        \n\t" // V(0)
-            "punpcklbw              %%mm1, %%mm0        \n\t" // UVUV UVUV(0)
-            "punpckhbw              %%mm1, %%mm2        \n\t" // UVUV UVUV(8)
-
-            "movq       (%1, %%"REG_a",2), %%mm3        \n\t" // Y(0)
-            "movq      8(%1, %%"REG_a",2), %%mm5        \n\t" // Y(8)
-            "movq                   %%mm0, %%mm4        \n\t" // Y(0)
-            "movq                   %%mm2, %%mm6        \n\t" // Y(8)
-            "punpcklbw              %%mm3, %%mm0        \n\t" // YUYV YUYV(0)
-            "punpckhbw              %%mm3, %%mm4        \n\t" // YUYV YUYV(4)
-            "punpcklbw              %%mm5, %%mm2        \n\t" // YUYV YUYV(8)
-            "punpckhbw              %%mm5, %%mm6        \n\t" // YUYV YUYV(12)
-
-            MOVNTQ"                 %%mm0,   (%0, %%"REG_a", 4)     \n\t"
-            MOVNTQ"                 %%mm4,  8(%0, %%"REG_a", 4)     \n\t"
-            MOVNTQ"                 %%mm2, 16(%0, %%"REG_a", 4)     \n\t"
-            MOVNTQ"                 %%mm6, 24(%0, %%"REG_a", 4)     \n\t"
-
-            "add                       $8, %%"REG_a"    \n\t"
-            "cmp                       %4, %%"REG_a"    \n\t"
-            " jb                       1b               \n\t"
-            ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (chromWidth)
-            : "%"REG_a
-        );
-        if ((y&(vertLumPerChroma-1)) == vertLumPerChroma-1) {
-            usrc += chromStride;
-            vsrc += chromStride;
-        }
-        ysrc += lumStride;
-        dst += dstStride;
-    }
-    __asm__(EMMS"       \n\t"
-            SFENCE"     \n\t"
-            :::"memory");
-}
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16
- * (If this is a problem for anyone then tell me, and I will fix it.)
- */
-static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                                      int width, int height,
-                                      int lumStride, int chromStride, int dstStride)
-{
-    //FIXME interpolate chroma
-    RENAME(yuvPlanartouyvy)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2);
-}
-
-/**
- * Width should be a multiple of 16.
- */
-static inline void RENAME(yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                                         int width, int height,
-                                         int lumStride, int chromStride, int dstStride)
-{
-    RENAME(yuvPlanartouyvy)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1);
-}
-
-/**
- * Width should be a multiple of 16.
- */
-static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
-                                         int width, int height,
-                                         int lumStride, int chromStride, int dstStride)
-{
-    RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1);
-}
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- */
-static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                                      int width, int height,
-                                      int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const x86_reg chromWidth= width>>1;
-    for (y=0; y<height; y+=2) {
-        __asm__ volatile(
-            "xor                 %%"REG_a", %%"REG_a"   \n\t"
-            "pcmpeqw                 %%mm7, %%mm7       \n\t"
-            "psrlw                      $8, %%mm7       \n\t" // FF,00,FF,00...
-            ".p2align                    4              \n\t"
-            "1:                \n\t"
-            PREFETCH" 64(%0, %%"REG_a", 4)              \n\t"
-            "movq       (%0, %%"REG_a", 4), %%mm0       \n\t" // YUYV YUYV(0)
-            "movq      8(%0, %%"REG_a", 4), %%mm1       \n\t" // YUYV YUYV(4)
-            "movq                    %%mm0, %%mm2       \n\t" // YUYV YUYV(0)
-            "movq                    %%mm1, %%mm3       \n\t" // YUYV YUYV(4)
-            "psrlw                      $8, %%mm0       \n\t" // U0V0 U0V0(0)
-            "psrlw                      $8, %%mm1       \n\t" // U0V0 U0V0(4)
-            "pand                    %%mm7, %%mm2       \n\t" // Y0Y0 Y0Y0(0)
-            "pand                    %%mm7, %%mm3       \n\t" // Y0Y0 Y0Y0(4)
-            "packuswb                %%mm1, %%mm0       \n\t" // UVUV UVUV(0)
-            "packuswb                %%mm3, %%mm2       \n\t" // YYYY YYYY(0)
-
-            MOVNTQ"                  %%mm2, (%1, %%"REG_a", 2)  \n\t"
-
-            "movq     16(%0, %%"REG_a", 4), %%mm1       \n\t" // YUYV YUYV(8)
-            "movq     24(%0, %%"REG_a", 4), %%mm2       \n\t" // YUYV YUYV(12)
-            "movq                    %%mm1, %%mm3       \n\t" // YUYV YUYV(8)
-            "movq                    %%mm2, %%mm4       \n\t" // YUYV YUYV(12)
-            "psrlw                      $8, %%mm1       \n\t" // U0V0 U0V0(8)
-            "psrlw                      $8, %%mm2       \n\t" // U0V0 U0V0(12)
-            "pand                    %%mm7, %%mm3       \n\t" // Y0Y0 Y0Y0(8)
-            "pand                    %%mm7, %%mm4       \n\t" // Y0Y0 Y0Y0(12)
-            "packuswb                %%mm2, %%mm1       \n\t" // UVUV UVUV(8)
-            "packuswb                %%mm4, %%mm3       \n\t" // YYYY YYYY(8)
-
-            MOVNTQ"                  %%mm3, 8(%1, %%"REG_a", 2) \n\t"
-
-            "movq                    %%mm0, %%mm2       \n\t" // UVUV UVUV(0)
-            "movq                    %%mm1, %%mm3       \n\t" // UVUV UVUV(8)
-            "psrlw                      $8, %%mm0       \n\t" // V0V0 V0V0(0)
-            "psrlw                      $8, %%mm1       \n\t" // V0V0 V0V0(8)
-            "pand                    %%mm7, %%mm2       \n\t" // U0U0 U0U0(0)
-            "pand                    %%mm7, %%mm3       \n\t" // U0U0 U0U0(8)
-            "packuswb                %%mm1, %%mm0       \n\t" // VVVV VVVV(0)
-            "packuswb                %%mm3, %%mm2       \n\t" // UUUU UUUU(0)
-
-            MOVNTQ"                  %%mm0, (%3, %%"REG_a")     \n\t"
-            MOVNTQ"                  %%mm2, (%2, %%"REG_a")     \n\t"
-
-            "add                        $8, %%"REG_a"   \n\t"
-            "cmp                        %4, %%"REG_a"   \n\t"
-            " jb                        1b              \n\t"
-            ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
-            : "memory", "%"REG_a
-        );
-
-        ydst += lumStride;
-        src  += srcStride;
-
-        __asm__ volatile(
-            "xor                 %%"REG_a", %%"REG_a"   \n\t"
-            ".p2align                    4              \n\t"
-            "1:                                         \n\t"
-            PREFETCH" 64(%0, %%"REG_a", 4)              \n\t"
-            "movq       (%0, %%"REG_a", 4), %%mm0       \n\t" // YUYV YUYV(0)
-            "movq      8(%0, %%"REG_a", 4), %%mm1       \n\t" // YUYV YUYV(4)
-            "movq     16(%0, %%"REG_a", 4), %%mm2       \n\t" // YUYV YUYV(8)
-            "movq     24(%0, %%"REG_a", 4), %%mm3       \n\t" // YUYV YUYV(12)
-            "pand                    %%mm7, %%mm0       \n\t" // Y0Y0 Y0Y0(0)
-            "pand                    %%mm7, %%mm1       \n\t" // Y0Y0 Y0Y0(4)
-            "pand                    %%mm7, %%mm2       \n\t" // Y0Y0 Y0Y0(8)
-            "pand                    %%mm7, %%mm3       \n\t" // Y0Y0 Y0Y0(12)
-            "packuswb                %%mm1, %%mm0       \n\t" // YYYY YYYY(0)
-            "packuswb                %%mm3, %%mm2       \n\t" // YYYY YYYY(8)
-
-            MOVNTQ"                  %%mm0,  (%1, %%"REG_a", 2) \n\t"
-            MOVNTQ"                  %%mm2, 8(%1, %%"REG_a", 2) \n\t"
-
-            "add                        $8, %%"REG_a"   \n\t"
-            "cmp                        %4, %%"REG_a"   \n\t"
-            " jb                        1b              \n\t"
-
-            ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
-            : "memory", "%"REG_a
-        );
-        udst += chromStride;
-        vdst += chromStride;
-        ydst += lumStride;
-        src  += srcStride;
-    }
-    __asm__ volatile(EMMS"       \n\t"
-                     SFENCE"     \n\t"
-                     :::"memory");
-}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
-
-#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW
-static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWidth, int srcHeight, int srcStride, int dstStride)
-{
-    int x,y;
-
-    dst[0]= src[0];
-
-    // first line
-    for (x=0; x<srcWidth-1; x++) {
-        dst[2*x+1]= (3*src[x] +   src[x+1])>>2;
-        dst[2*x+2]= (  src[x] + 3*src[x+1])>>2;
-    }
-    dst[2*srcWidth-1]= src[srcWidth-1];
-
-    dst+= dstStride;
-
-    for (y=1; y<srcHeight; y++) {
-        const x86_reg mmxSize= srcWidth&~15;
-        __asm__ volatile(
-            "mov           %4, %%"REG_a"            \n\t"
-            "movq        "MANGLE(mmx_ff)", %%mm0    \n\t"
-            "movq         (%0, %%"REG_a"), %%mm4    \n\t"
-            "movq                   %%mm4, %%mm2    \n\t"
-            "psllq                     $8, %%mm4    \n\t"
-            "pand                   %%mm0, %%mm2    \n\t"
-            "por                    %%mm2, %%mm4    \n\t"
-            "movq         (%1, %%"REG_a"), %%mm5    \n\t"
-            "movq                   %%mm5, %%mm3    \n\t"
-            "psllq                     $8, %%mm5    \n\t"
-            "pand                   %%mm0, %%mm3    \n\t"
-            "por                    %%mm3, %%mm5    \n\t"
-            "1:                                     \n\t"
-            "movq         (%0, %%"REG_a"), %%mm0    \n\t"
-            "movq         (%1, %%"REG_a"), %%mm1    \n\t"
-            "movq        1(%0, %%"REG_a"), %%mm2    \n\t"
-            "movq        1(%1, %%"REG_a"), %%mm3    \n\t"
-            PAVGB"                  %%mm0, %%mm5    \n\t"
-            PAVGB"                  %%mm0, %%mm3    \n\t"
-            PAVGB"                  %%mm0, %%mm5    \n\t"
-            PAVGB"                  %%mm0, %%mm3    \n\t"
-            PAVGB"                  %%mm1, %%mm4    \n\t"
-            PAVGB"                  %%mm1, %%mm2    \n\t"
-            PAVGB"                  %%mm1, %%mm4    \n\t"
-            PAVGB"                  %%mm1, %%mm2    \n\t"
-            "movq                   %%mm5, %%mm7    \n\t"
-            "movq                   %%mm4, %%mm6    \n\t"
-            "punpcklbw              %%mm3, %%mm5    \n\t"
-            "punpckhbw              %%mm3, %%mm7    \n\t"
-            "punpcklbw              %%mm2, %%mm4    \n\t"
-            "punpckhbw              %%mm2, %%mm6    \n\t"
-            MOVNTQ"                 %%mm5,  (%2, %%"REG_a", 2)  \n\t"
-            MOVNTQ"                 %%mm7, 8(%2, %%"REG_a", 2)  \n\t"
-            MOVNTQ"                 %%mm4,  (%3, %%"REG_a", 2)  \n\t"
-            MOVNTQ"                 %%mm6, 8(%3, %%"REG_a", 2)  \n\t"
-            "add                       $8, %%"REG_a"            \n\t"
-            "movq       -1(%0, %%"REG_a"), %%mm4    \n\t"
-            "movq       -1(%1, %%"REG_a"), %%mm5    \n\t"
-            " js                       1b                       \n\t"
-            :: "r" (src + mmxSize  ), "r" (src + srcStride + mmxSize  ),
-               "r" (dst + mmxSize*2), "r" (dst + dstStride + mmxSize*2),
-               "g" (-mmxSize)
-            : "%"REG_a
-        );
-
-        for (x=mmxSize-1; x<srcWidth-1; x++) {
-            dst[2*x          +1]= (3*src[x+0] +   src[x+srcStride+1])>>2;
-            dst[2*x+dstStride+2]= (  src[x+0] + 3*src[x+srcStride+1])>>2;
-            dst[2*x+dstStride+1]= (  src[x+1] + 3*src[x+srcStride  ])>>2;
-            dst[2*x          +2]= (3*src[x+1] +   src[x+srcStride  ])>>2;
-        }
-        dst[srcWidth*2 -1            ]= (3*src[srcWidth-1] +   src[srcWidth-1 + srcStride])>>2;
-        dst[srcWidth*2 -1 + dstStride]= (  src[srcWidth-1] + 3*src[srcWidth-1 + srcStride])>>2;
-
-        dst+=dstStride*2;
-        src+=srcStride;
-    }
-
-    // last line
-    dst[0]= src[0];
-
-    for (x=0; x<srcWidth-1; x++) {
-        dst[2*x+1]= (3*src[x] +   src[x+1])>>2;
-        dst[2*x+2]= (  src[x] + 3*src[x+1])>>2;
-    }
-    dst[2*srcWidth-1]= src[srcWidth-1];
-
-    __asm__ volatile(EMMS"       \n\t"
-                     SFENCE"     \n\t"
-                     :::"memory");
-}
-#endif /* COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW */
-
-#if !COMPILE_TEMPLATE_AMD3DNOW
-/**
- * Height should be a multiple of 2 and width should be a multiple of 16.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- * Chrominance data is only taken from every second line, others are ignored.
- * FIXME: Write HQ version.
- */
-static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                                      int width, int height,
-                                      int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const x86_reg chromWidth= width>>1;
-    for (y=0; y<height; y+=2) {
-        __asm__ volatile(
-            "xor                 %%"REG_a", %%"REG_a"   \n\t"
-            "pcmpeqw             %%mm7, %%mm7   \n\t"
-            "psrlw                  $8, %%mm7   \n\t" // FF,00,FF,00...
-            ".p2align                4          \n\t"
-            "1:                                 \n\t"
-            PREFETCH" 64(%0, %%"REG_a", 4)          \n\t"
-            "movq       (%0, %%"REG_a", 4), %%mm0   \n\t" // UYVY UYVY(0)
-            "movq      8(%0, %%"REG_a", 4), %%mm1   \n\t" // UYVY UYVY(4)
-            "movq                %%mm0, %%mm2   \n\t" // UYVY UYVY(0)
-            "movq                %%mm1, %%mm3   \n\t" // UYVY UYVY(4)
-            "pand                %%mm7, %%mm0   \n\t" // U0V0 U0V0(0)
-            "pand                %%mm7, %%mm1   \n\t" // U0V0 U0V0(4)
-            "psrlw                  $8, %%mm2   \n\t" // Y0Y0 Y0Y0(0)
-            "psrlw                  $8, %%mm3   \n\t" // Y0Y0 Y0Y0(4)
-            "packuswb            %%mm1, %%mm0   \n\t" // UVUV UVUV(0)
-            "packuswb            %%mm3, %%mm2   \n\t" // YYYY YYYY(0)
-
-            MOVNTQ"              %%mm2,  (%1, %%"REG_a", 2) \n\t"
-
-            "movq     16(%0, %%"REG_a", 4), %%mm1   \n\t" // UYVY UYVY(8)
-            "movq     24(%0, %%"REG_a", 4), %%mm2   \n\t" // UYVY UYVY(12)
-            "movq                %%mm1, %%mm3   \n\t" // UYVY UYVY(8)
-            "movq                %%mm2, %%mm4   \n\t" // UYVY UYVY(12)
-            "pand                %%mm7, %%mm1   \n\t" // U0V0 U0V0(8)
-            "pand                %%mm7, %%mm2   \n\t" // U0V0 U0V0(12)
-            "psrlw                  $8, %%mm3   \n\t" // Y0Y0 Y0Y0(8)
-            "psrlw                  $8, %%mm4   \n\t" // Y0Y0 Y0Y0(12)
-            "packuswb            %%mm2, %%mm1   \n\t" // UVUV UVUV(8)
-            "packuswb            %%mm4, %%mm3   \n\t" // YYYY YYYY(8)
-
-            MOVNTQ"              %%mm3, 8(%1, %%"REG_a", 2) \n\t"
-
-            "movq                %%mm0, %%mm2   \n\t" // UVUV UVUV(0)
-            "movq                %%mm1, %%mm3   \n\t" // UVUV UVUV(8)
-            "psrlw                  $8, %%mm0   \n\t" // V0V0 V0V0(0)
-            "psrlw                  $8, %%mm1   \n\t" // V0V0 V0V0(8)
-            "pand                %%mm7, %%mm2   \n\t" // U0U0 U0U0(0)
-            "pand                %%mm7, %%mm3   \n\t" // U0U0 U0U0(8)
-            "packuswb            %%mm1, %%mm0   \n\t" // VVVV VVVV(0)
-            "packuswb            %%mm3, %%mm2   \n\t" // UUUU UUUU(0)
-
-            MOVNTQ"              %%mm0, (%3, %%"REG_a") \n\t"
-            MOVNTQ"              %%mm2, (%2, %%"REG_a") \n\t"
-
-            "add                    $8, %%"REG_a"   \n\t"
-            "cmp                    %4, %%"REG_a"   \n\t"
-            " jb                    1b          \n\t"
-            ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
-            : "memory", "%"REG_a
-        );
-
-        ydst += lumStride;
-        src  += srcStride;
-
-        __asm__ volatile(
-            "xor                 %%"REG_a", %%"REG_a"   \n\t"
-            ".p2align                    4              \n\t"
-            "1:                                 \n\t"
-            PREFETCH" 64(%0, %%"REG_a", 4)          \n\t"
-            "movq       (%0, %%"REG_a", 4), %%mm0   \n\t" // YUYV YUYV(0)
-            "movq      8(%0, %%"REG_a", 4), %%mm1   \n\t" // YUYV YUYV(4)
-            "movq     16(%0, %%"REG_a", 4), %%mm2   \n\t" // YUYV YUYV(8)
-            "movq     24(%0, %%"REG_a", 4), %%mm3   \n\t" // YUYV YUYV(12)
-            "psrlw                  $8, %%mm0   \n\t" // Y0Y0 Y0Y0(0)
-            "psrlw                  $8, %%mm1   \n\t" // Y0Y0 Y0Y0(4)
-            "psrlw                  $8, %%mm2   \n\t" // Y0Y0 Y0Y0(8)
-            "psrlw                  $8, %%mm3   \n\t" // Y0Y0 Y0Y0(12)
-            "packuswb            %%mm1, %%mm0   \n\t" // YYYY YYYY(0)
-            "packuswb            %%mm3, %%mm2   \n\t" // YYYY YYYY(8)
-
-            MOVNTQ"              %%mm0,  (%1, %%"REG_a", 2) \n\t"
-            MOVNTQ"              %%mm2, 8(%1, %%"REG_a", 2) \n\t"
-
-            "add                    $8, %%"REG_a"   \n\t"
-            "cmp                    %4, %%"REG_a"   \n\t"
-            " jb                    1b          \n\t"
-
-            ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
-            : "memory", "%"REG_a
-        );
-        udst += chromStride;
-        vdst += chromStride;
-        ydst += lumStride;
-        src  += srcStride;
-    }
-    __asm__ volatile(EMMS"       \n\t"
-                     SFENCE"     \n\t"
-                     :::"memory");
-}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
-
-/**
- * Height should be a multiple of 2 and width should be a multiple of 2.
- * (If this is a problem for anyone then tell me, and I will fix it.)
- * Chrominance data is only taken from every second line,
- * others are ignored in the C version.
- * FIXME: Write HQ version.
- */
-static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
-                                       int width, int height,
-                                       int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const x86_reg chromWidth= width>>1;
-    for (y=0; y<height-2; y+=2) {
-        int i;
-        for (i=0; i<2; i++) {
-            __asm__ volatile(
-                "mov                        %2, %%"REG_a"   \n\t"
-                "movq  "MANGLE(ff_bgr2YCoeff)", %%mm6       \n\t"
-                "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
-                "pxor                    %%mm7, %%mm7       \n\t"
-                "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d"   \n\t"
-                ".p2align                    4              \n\t"
-                "1:                                         \n\t"
-                PREFETCH"    64(%0, %%"REG_d")              \n\t"
-                "movd          (%0, %%"REG_d"), %%mm0       \n\t"
-                "movd         3(%0, %%"REG_d"), %%mm1       \n\t"
-                "punpcklbw               %%mm7, %%mm0       \n\t"
-                "punpcklbw               %%mm7, %%mm1       \n\t"
-                "movd         6(%0, %%"REG_d"), %%mm2       \n\t"
-                "movd         9(%0, %%"REG_d"), %%mm3       \n\t"
-                "punpcklbw               %%mm7, %%mm2       \n\t"
-                "punpcklbw               %%mm7, %%mm3       \n\t"
-                "pmaddwd                 %%mm6, %%mm0       \n\t"
-                "pmaddwd                 %%mm6, %%mm1       \n\t"
-                "pmaddwd                 %%mm6, %%mm2       \n\t"
-                "pmaddwd                 %%mm6, %%mm3       \n\t"
-#ifndef FAST_BGR2YV12
-                "psrad                      $8, %%mm0       \n\t"
-                "psrad                      $8, %%mm1       \n\t"
-                "psrad                      $8, %%mm2       \n\t"
-                "psrad                      $8, %%mm3       \n\t"
-#endif
-                "packssdw                %%mm1, %%mm0       \n\t"
-                "packssdw                %%mm3, %%mm2       \n\t"
-                "pmaddwd                 %%mm5, %%mm0       \n\t"
-                "pmaddwd                 %%mm5, %%mm2       \n\t"
-                "packssdw                %%mm2, %%mm0       \n\t"
-                "psraw                      $7, %%mm0       \n\t"
-
-                "movd        12(%0, %%"REG_d"), %%mm4       \n\t"
-                "movd        15(%0, %%"REG_d"), %%mm1       \n\t"
-                "punpcklbw               %%mm7, %%mm4       \n\t"
-                "punpcklbw               %%mm7, %%mm1       \n\t"
-                "movd        18(%0, %%"REG_d"), %%mm2       \n\t"
-                "movd        21(%0, %%"REG_d"), %%mm3       \n\t"
-                "punpcklbw               %%mm7, %%mm2       \n\t"
-                "punpcklbw               %%mm7, %%mm3       \n\t"
-                "pmaddwd                 %%mm6, %%mm4       \n\t"
-                "pmaddwd                 %%mm6, %%mm1       \n\t"
-                "pmaddwd                 %%mm6, %%mm2       \n\t"
-                "pmaddwd                 %%mm6, %%mm3       \n\t"
-#ifndef FAST_BGR2YV12
-                "psrad                      $8, %%mm4       \n\t"
-                "psrad                      $8, %%mm1       \n\t"
-                "psrad                      $8, %%mm2       \n\t"
-                "psrad                      $8, %%mm3       \n\t"
-#endif
-                "packssdw                %%mm1, %%mm4       \n\t"
-                "packssdw                %%mm3, %%mm2       \n\t"
-                "pmaddwd                 %%mm5, %%mm4       \n\t"
-                "pmaddwd                 %%mm5, %%mm2       \n\t"
-                "add                       $24, %%"REG_d"   \n\t"
-                "packssdw                %%mm2, %%mm4       \n\t"
-                "psraw                      $7, %%mm4       \n\t"
-
-                "packuswb                %%mm4, %%mm0       \n\t"
-                "paddusb "MANGLE(ff_bgr2YOffset)", %%mm0    \n\t"
-
-                MOVNTQ"                  %%mm0, (%1, %%"REG_a") \n\t"
-                "add                        $8,      %%"REG_a"  \n\t"
-                " js                        1b                  \n\t"
-                : : "r" (src+width*3), "r" (ydst+width), "g" ((x86_reg)-width)
-                : "%"REG_a, "%"REG_d
-            );
-            ydst += lumStride;
-            src  += srcStride;
-        }
-        src -= srcStride*2;
-        __asm__ volatile(
-            "mov                        %4, %%"REG_a"   \n\t"
-            "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
-            "movq  "MANGLE(ff_bgr2UCoeff)", %%mm6       \n\t"
-            "pxor                    %%mm7, %%mm7       \n\t"
-            "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d"   \n\t"
-            "add                 %%"REG_d", %%"REG_d"   \n\t"
-            ".p2align                    4              \n\t"
-            "1:                                         \n\t"
-            PREFETCH"    64(%0, %%"REG_d")              \n\t"
-            PREFETCH"    64(%1, %%"REG_d")              \n\t"
-#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW
-            "movq          (%0, %%"REG_d"), %%mm0       \n\t"
-            "movq          (%1, %%"REG_d"), %%mm1       \n\t"
-            "movq         6(%0, %%"REG_d"), %%mm2       \n\t"
-            "movq         6(%1, %%"REG_d"), %%mm3       \n\t"
-            PAVGB"                   %%mm1, %%mm0       \n\t"
-            PAVGB"                   %%mm3, %%mm2       \n\t"
-            "movq                    %%mm0, %%mm1       \n\t"
-            "movq                    %%mm2, %%mm3       \n\t"
-            "psrlq                     $24, %%mm0       \n\t"
-            "psrlq                     $24, %%mm2       \n\t"
-            PAVGB"                   %%mm1, %%mm0       \n\t"
-            PAVGB"                   %%mm3, %%mm2       \n\t"
-            "punpcklbw               %%mm7, %%mm0       \n\t"
-            "punpcklbw               %%mm7, %%mm2       \n\t"
-#else
-            "movd          (%0, %%"REG_d"), %%mm0       \n\t"
-            "movd          (%1, %%"REG_d"), %%mm1       \n\t"
-            "movd         3(%0, %%"REG_d"), %%mm2       \n\t"
-            "movd         3(%1, %%"REG_d"), %%mm3       \n\t"
-            "punpcklbw               %%mm7, %%mm0       \n\t"
-            "punpcklbw               %%mm7, %%mm1       \n\t"
-            "punpcklbw               %%mm7, %%mm2       \n\t"
-            "punpcklbw               %%mm7, %%mm3       \n\t"
-            "paddw                   %%mm1, %%mm0       \n\t"
-            "paddw                   %%mm3, %%mm2       \n\t"
-            "paddw                   %%mm2, %%mm0       \n\t"
-            "movd         6(%0, %%"REG_d"), %%mm4       \n\t"
-            "movd         6(%1, %%"REG_d"), %%mm1       \n\t"
-            "movd         9(%0, %%"REG_d"), %%mm2       \n\t"
-            "movd         9(%1, %%"REG_d"), %%mm3       \n\t"
-            "punpcklbw               %%mm7, %%mm4       \n\t"
-            "punpcklbw               %%mm7, %%mm1       \n\t"
-            "punpcklbw               %%mm7, %%mm2       \n\t"
-            "punpcklbw               %%mm7, %%mm3       \n\t"
-            "paddw                   %%mm1, %%mm4       \n\t"
-            "paddw                   %%mm3, %%mm2       \n\t"
-            "paddw                   %%mm4, %%mm2       \n\t"
-            "psrlw                      $2, %%mm0       \n\t"
-            "psrlw                      $2, %%mm2       \n\t"
-#endif
-            "movq  "MANGLE(ff_bgr2VCoeff)", %%mm1       \n\t"
-            "movq  "MANGLE(ff_bgr2VCoeff)", %%mm3       \n\t"
-
-            "pmaddwd                 %%mm0, %%mm1       \n\t"
-            "pmaddwd                 %%mm2, %%mm3       \n\t"
-            "pmaddwd                 %%mm6, %%mm0       \n\t"
-            "pmaddwd                 %%mm6, %%mm2       \n\t"
-#ifndef FAST_BGR2YV12
-            "psrad                      $8, %%mm0       \n\t"
-            "psrad                      $8, %%mm1       \n\t"
-            "psrad                      $8, %%mm2       \n\t"
-            "psrad                      $8, %%mm3       \n\t"
-#endif
-            "packssdw                %%mm2, %%mm0       \n\t"
-            "packssdw                %%mm3, %%mm1       \n\t"
-            "pmaddwd                 %%mm5, %%mm0       \n\t"
-            "pmaddwd                 %%mm5, %%mm1       \n\t"
-            "packssdw                %%mm1, %%mm0       \n\t" // V1 V0 U1 U0
-            "psraw                      $7, %%mm0       \n\t"
-
-#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW
-            "movq        12(%0, %%"REG_d"), %%mm4       \n\t"
-            "movq        12(%1, %%"REG_d"), %%mm1       \n\t"
-            "movq        18(%0, %%"REG_d"), %%mm2       \n\t"
-            "movq        18(%1, %%"REG_d"), %%mm3       \n\t"
-            PAVGB"                   %%mm1, %%mm4       \n\t"
-            PAVGB"                   %%mm3, %%mm2       \n\t"
-            "movq                    %%mm4, %%mm1       \n\t"
-            "movq                    %%mm2, %%mm3       \n\t"
-            "psrlq                     $24, %%mm4       \n\t"
-            "psrlq                     $24, %%mm2       \n\t"
-            PAVGB"                   %%mm1, %%mm4       \n\t"
-            PAVGB"                   %%mm3, %%mm2       \n\t"
-            "punpcklbw               %%mm7, %%mm4       \n\t"
-            "punpcklbw               %%mm7, %%mm2       \n\t"
-#else
-            "movd        12(%0, %%"REG_d"), %%mm4       \n\t"
-            "movd        12(%1, %%"REG_d"), %%mm1       \n\t"
-            "movd        15(%0, %%"REG_d"), %%mm2       \n\t"
-            "movd        15(%1, %%"REG_d"), %%mm3       \n\t"
-            "punpcklbw               %%mm7, %%mm4       \n\t"
-            "punpcklbw               %%mm7, %%mm1       \n\t"
-            "punpcklbw               %%mm7, %%mm2       \n\t"
-            "punpcklbw               %%mm7, %%mm3       \n\t"
-            "paddw                   %%mm1, %%mm4       \n\t"
-            "paddw                   %%mm3, %%mm2       \n\t"
-            "paddw                   %%mm2, %%mm4       \n\t"
-            "movd        18(%0, %%"REG_d"), %%mm5       \n\t"
-            "movd        18(%1, %%"REG_d"), %%mm1       \n\t"
-            "movd        21(%0, %%"REG_d"), %%mm2       \n\t"
-            "movd        21(%1, %%"REG_d"), %%mm3       \n\t"
-            "punpcklbw               %%mm7, %%mm5       \n\t"
-            "punpcklbw               %%mm7, %%mm1       \n\t"
-            "punpcklbw               %%mm7, %%mm2       \n\t"
-            "punpcklbw               %%mm7, %%mm3       \n\t"
-            "paddw                   %%mm1, %%mm5       \n\t"
-            "paddw                   %%mm3, %%mm2       \n\t"
-            "paddw                   %%mm5, %%mm2       \n\t"
-            "movq       "MANGLE(ff_w1111)", %%mm5       \n\t"
-            "psrlw                      $2, %%mm4       \n\t"
-            "psrlw                      $2, %%mm2       \n\t"
-#endif
-            "movq  "MANGLE(ff_bgr2VCoeff)", %%mm1       \n\t"
-            "movq  "MANGLE(ff_bgr2VCoeff)", %%mm3       \n\t"
-
-            "pmaddwd                 %%mm4, %%mm1       \n\t"
-            "pmaddwd                 %%mm2, %%mm3       \n\t"
-            "pmaddwd                 %%mm6, %%mm4       \n\t"
-            "pmaddwd                 %%mm6, %%mm2       \n\t"
-#ifndef FAST_BGR2YV12
-            "psrad                      $8, %%mm4       \n\t"
-            "psrad                      $8, %%mm1       \n\t"
-            "psrad                      $8, %%mm2       \n\t"
-            "psrad                      $8, %%mm3       \n\t"
-#endif
-            "packssdw                %%mm2, %%mm4       \n\t"
-            "packssdw                %%mm3, %%mm1       \n\t"
-            "pmaddwd                 %%mm5, %%mm4       \n\t"
-            "pmaddwd                 %%mm5, %%mm1       \n\t"
-            "add                       $24, %%"REG_d"   \n\t"
-            "packssdw                %%mm1, %%mm4       \n\t" // V3 V2 U3 U2
-            "psraw                      $7, %%mm4       \n\t"
-
-            "movq                    %%mm0, %%mm1           \n\t"
-            "punpckldq               %%mm4, %%mm0           \n\t"
-            "punpckhdq               %%mm4, %%mm1           \n\t"
-            "packsswb                %%mm1, %%mm0           \n\t"
-            "paddb "MANGLE(ff_bgr2UVOffset)", %%mm0         \n\t"
-            "movd                    %%mm0, (%2, %%"REG_a") \n\t"
-            "punpckhdq               %%mm0, %%mm0           \n\t"
-            "movd                    %%mm0, (%3, %%"REG_a") \n\t"
-            "add                        $4, %%"REG_a"       \n\t"
-            " js                        1b                  \n\t"
-            : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth)
-            : "%"REG_a, "%"REG_d
-        );
-
-        udst += chromStride;
-        vdst += chromStride;
-        src  += srcStride*2;
-    }
-
-    __asm__ volatile(EMMS"       \n\t"
-                     SFENCE"     \n\t"
-                     :::"memory");
-
-     rgb24toyv12_c(src, ydst, udst, vdst, width, height-y, lumStride, chromStride, srcStride);
-}
-#endif /* !COMPILE_TEMPLATE_SSE2 */
-
-#if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
-static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest,
-                                    int width, int height, int src1Stride,
-                                    int src2Stride, int dstStride)
-{
-    int h;
-
-    for (h=0; h < height; h++) {
-        int w;
-
-#if COMPILE_TEMPLATE_SSE2
-        __asm__(
-            "xor              %%"REG_a", %%"REG_a"  \n\t"
-            "1:                                     \n\t"
-            PREFETCH" 64(%1, %%"REG_a")             \n\t"
-            PREFETCH" 64(%2, %%"REG_a")             \n\t"
-            "movdqa     (%1, %%"REG_a"), %%xmm0     \n\t"
-            "movdqa     (%1, %%"REG_a"), %%xmm1     \n\t"
-            "movdqa     (%2, %%"REG_a"), %%xmm2     \n\t"
-            "punpcklbw           %%xmm2, %%xmm0     \n\t"
-            "punpckhbw           %%xmm2, %%xmm1     \n\t"
-            "movntdq             %%xmm0,   (%0, %%"REG_a", 2)   \n\t"
-            "movntdq             %%xmm1, 16(%0, %%"REG_a", 2)   \n\t"
-            "add                    $16, %%"REG_a"  \n\t"
-            "cmp                     %3, %%"REG_a"  \n\t"
-            " jb                     1b             \n\t"
-            ::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15)
-            : "memory", "%"REG_a""
-        );
-#else
-        __asm__(
-            "xor %%"REG_a", %%"REG_a"               \n\t"
-            "1:                                     \n\t"
-            PREFETCH" 64(%1, %%"REG_a")             \n\t"
-            PREFETCH" 64(%2, %%"REG_a")             \n\t"
-            "movq       (%1, %%"REG_a"), %%mm0      \n\t"
-            "movq      8(%1, %%"REG_a"), %%mm2      \n\t"
-            "movq                 %%mm0, %%mm1      \n\t"
-            "movq                 %%mm2, %%mm3      \n\t"
-            "movq       (%2, %%"REG_a"), %%mm4      \n\t"
-            "movq      8(%2, %%"REG_a"), %%mm5      \n\t"
-            "punpcklbw            %%mm4, %%mm0      \n\t"
-            "punpckhbw            %%mm4, %%mm1      \n\t"
-            "punpcklbw            %%mm5, %%mm2      \n\t"
-            "punpckhbw            %%mm5, %%mm3      \n\t"
-            MOVNTQ"               %%mm0,   (%0, %%"REG_a", 2)   \n\t"
-            MOVNTQ"               %%mm1,  8(%0, %%"REG_a", 2)   \n\t"
-            MOVNTQ"               %%mm2, 16(%0, %%"REG_a", 2)   \n\t"
-            MOVNTQ"               %%mm3, 24(%0, %%"REG_a", 2)   \n\t"
-            "add                    $16, %%"REG_a"  \n\t"
-            "cmp                     %3, %%"REG_a"  \n\t"
-            " jb                     1b             \n\t"
-            ::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15)
-            : "memory", "%"REG_a
-        );
-#endif
-        for (w= (width&(~15)); w < width; w++) {
-            dest[2*w+0] = src1[w];
-            dest[2*w+1] = src2[w];
-        }
-        dest += dstStride;
-        src1 += src1Stride;
-        src2 += src2Stride;
-    }
-    __asm__(
-            EMMS"       \n\t"
-            SFENCE"     \n\t"
-            ::: "memory"
-            );
-}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
-
-#if !COMPILE_TEMPLATE_AMD3DNOW && (ARCH_X86_32 || COMPILE_TEMPLATE_SSE2) && COMPILE_TEMPLATE_MMXEXT == COMPILE_TEMPLATE_SSE2 && HAVE_YASM
-void RENAME(ff_nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
-                         const uint8_t *src, const uint8_t *unused, int w,
-                         uint32_t *unused2);
-static void RENAME(deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
-                                      int width, int height, int srcStride,
-                                      int dst1Stride, int dst2Stride)
-{
-    int h;
-
-    for (h = 0; h < height; h++) {
-        RENAME(ff_nv12ToUV)(dst1, dst2, src, NULL, width, NULL);
-        src  += srcStride;
-        dst1 += dst1Stride;
-        dst2 += dst2Stride;
-    }
-    __asm__(
-            EMMS"       \n\t"
-            SFENCE"     \n\t"
-            ::: "memory"
-            );
-}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
-
-#if !COMPILE_TEMPLATE_SSE2
-#if !COMPILE_TEMPLATE_AMD3DNOW
-static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
-                                       uint8_t *dst1, uint8_t *dst2,
-                                       int width, int height,
-                                       int srcStride1, int srcStride2,
-                                       int dstStride1, int dstStride2)
-{
-    x86_reg x, y;
-    int w,h;
-    w=width/2; h=height/2;
-    __asm__ volatile(
-        PREFETCH" %0    \n\t"
-        PREFETCH" %1    \n\t"
-        ::"m"(*(src1+srcStride1)),"m"(*(src2+srcStride2)):"memory");
-    for (y=0;y<h;y++) {
-        const uint8_t* s1=src1+srcStride1*(y>>1);
-        uint8_t* d=dst1+dstStride1*y;
-        x=0;
-        for (;x<w-31;x+=32) {
-            __asm__ volatile(
-                PREFETCH"   32(%1,%2)        \n\t"
-                "movq         (%1,%2), %%mm0 \n\t"
-                "movq        8(%1,%2), %%mm2 \n\t"
-                "movq       16(%1,%2), %%mm4 \n\t"
-                "movq       24(%1,%2), %%mm6 \n\t"
-                "movq      %%mm0, %%mm1 \n\t"
-                "movq      %%mm2, %%mm3 \n\t"
-                "movq      %%mm4, %%mm5 \n\t"
-                "movq      %%mm6, %%mm7 \n\t"
-                "punpcklbw %%mm0, %%mm0 \n\t"
-                "punpckhbw %%mm1, %%mm1 \n\t"
-                "punpcklbw %%mm2, %%mm2 \n\t"
-                "punpckhbw %%mm3, %%mm3 \n\t"
-                "punpcklbw %%mm4, %%mm4 \n\t"
-                "punpckhbw %%mm5, %%mm5 \n\t"
-                "punpcklbw %%mm6, %%mm6 \n\t"
-                "punpckhbw %%mm7, %%mm7 \n\t"
-                MOVNTQ"    %%mm0,   (%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm1,  8(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm2, 16(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm3, 24(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm4, 32(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm5, 40(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm6, 48(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm7, 56(%0,%2,2)"
-                :: "r"(d), "r"(s1), "r"(x)
-                :"memory");
-        }
-        for (;x<w;x++) d[2*x]=d[2*x+1]=s1[x];
-    }
-    for (y=0;y<h;y++) {
-        const uint8_t* s2=src2+srcStride2*(y>>1);
-        uint8_t* d=dst2+dstStride2*y;
-        x=0;
-        for (;x<w-31;x+=32) {
-            __asm__ volatile(
-                PREFETCH"   32(%1,%2)        \n\t"
-                "movq         (%1,%2), %%mm0 \n\t"
-                "movq        8(%1,%2), %%mm2 \n\t"
-                "movq       16(%1,%2), %%mm4 \n\t"
-                "movq       24(%1,%2), %%mm6 \n\t"
-                "movq      %%mm0, %%mm1 \n\t"
-                "movq      %%mm2, %%mm3 \n\t"
-                "movq      %%mm4, %%mm5 \n\t"
-                "movq      %%mm6, %%mm7 \n\t"
-                "punpcklbw %%mm0, %%mm0 \n\t"
-                "punpckhbw %%mm1, %%mm1 \n\t"
-                "punpcklbw %%mm2, %%mm2 \n\t"
-                "punpckhbw %%mm3, %%mm3 \n\t"
-                "punpcklbw %%mm4, %%mm4 \n\t"
-                "punpckhbw %%mm5, %%mm5 \n\t"
-                "punpcklbw %%mm6, %%mm6 \n\t"
-                "punpckhbw %%mm7, %%mm7 \n\t"
-                MOVNTQ"    %%mm0,   (%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm1,  8(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm2, 16(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm3, 24(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm4, 32(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm5, 40(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm6, 48(%0,%2,2)  \n\t"
-                MOVNTQ"    %%mm7, 56(%0,%2,2)"
-                :: "r"(d), "r"(s2), "r"(x)
-                :"memory");
-        }
-        for (;x<w;x++) d[2*x]=d[2*x+1]=s2[x];
-    }
-    __asm__(
-            EMMS"       \n\t"
-            SFENCE"     \n\t"
-            ::: "memory"
-        );
-}
-
-static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
-                                        uint8_t *dst,
-                                        int width, int height,
-                                        int srcStride1, int srcStride2,
-                                        int srcStride3, int dstStride)
-{
-    x86_reg x;
-    int y,w,h;
-    w=width/2; h=height;
-    for (y=0;y<h;y++) {
-        const uint8_t* yp=src1+srcStride1*y;
-        const uint8_t* up=src2+srcStride2*(y>>2);
-        const uint8_t* vp=src3+srcStride3*(y>>2);
-        uint8_t* d=dst+dstStride*y;
-        x=0;
-        for (;x<w-7;x+=8) {
-            __asm__ volatile(
-                PREFETCH"   32(%1, %0)          \n\t"
-                PREFETCH"   32(%2, %0)          \n\t"
-                PREFETCH"   32(%3, %0)          \n\t"
-                "movq      (%1, %0, 4), %%mm0   \n\t" /* Y0Y1Y2Y3Y4Y5Y6Y7 */
-                "movq         (%2, %0), %%mm1   \n\t" /* U0U1U2U3U4U5U6U7 */
-                "movq         (%3, %0), %%mm2   \n\t" /* V0V1V2V3V4V5V6V7 */
-                "movq            %%mm0, %%mm3   \n\t" /* Y0Y1Y2Y3Y4Y5Y6Y7 */
-                "movq            %%mm1, %%mm4   \n\t" /* U0U1U2U3U4U5U6U7 */
-                "movq            %%mm2, %%mm5   \n\t" /* V0V1V2V3V4V5V6V7 */
-                "punpcklbw       %%mm1, %%mm1   \n\t" /* U0U0 U1U1 U2U2 U3U3 */
-                "punpcklbw       %%mm2, %%mm2   \n\t" /* V0V0 V1V1 V2V2 V3V3 */
-                "punpckhbw       %%mm4, %%mm4   \n\t" /* U4U4 U5U5 U6U6 U7U7 */
-                "punpckhbw       %%mm5, %%mm5   \n\t" /* V4V4 V5V5 V6V6 V7V7 */
-
-                "movq            %%mm1, %%mm6   \n\t"
-                "punpcklbw       %%mm2, %%mm1   \n\t" /* U0V0 U0V0 U1V1 U1V1*/
-                "punpcklbw       %%mm1, %%mm0   \n\t" /* Y0U0 Y1V0 Y2U0 Y3V0*/
-                "punpckhbw       %%mm1, %%mm3   \n\t" /* Y4U1 Y5V1 Y6U1 Y7V1*/
-                MOVNTQ"          %%mm0,  (%4, %0, 8)    \n\t"
-                MOVNTQ"          %%mm3, 8(%4, %0, 8)    \n\t"
-
-                "punpckhbw       %%mm2, %%mm6   \n\t" /* U2V2 U2V2 U3V3 U3V3*/
-                "movq     8(%1, %0, 4), %%mm0   \n\t"
-                "movq            %%mm0, %%mm3   \n\t"
-                "punpcklbw       %%mm6, %%mm0   \n\t" /* Y U2 Y V2 Y U2 Y V2*/
-                "punpckhbw       %%mm6, %%mm3   \n\t" /* Y U3 Y V3 Y U3 Y V3*/
-                MOVNTQ"          %%mm0, 16(%4, %0, 8)   \n\t"
-                MOVNTQ"          %%mm3, 24(%4, %0, 8)   \n\t"
-
-                "movq            %%mm4, %%mm6   \n\t"
-                "movq    16(%1, %0, 4), %%mm0   \n\t"
-                "movq            %%mm0, %%mm3   \n\t"
-                "punpcklbw       %%mm5, %%mm4   \n\t"
-                "punpcklbw       %%mm4, %%mm0   \n\t" /* Y U4 Y V4 Y U4 Y V4*/
-                "punpckhbw       %%mm4, %%mm3   \n\t" /* Y U5 Y V5 Y U5 Y V5*/
-                MOVNTQ"          %%mm0, 32(%4, %0, 8)   \n\t"
-                MOVNTQ"          %%mm3, 40(%4, %0, 8)   \n\t"
-
-                "punpckhbw       %%mm5, %%mm6   \n\t"
-                "movq    24(%1, %0, 4), %%mm0   \n\t"
-                "movq            %%mm0, %%mm3   \n\t"
-                "punpcklbw       %%mm6, %%mm0   \n\t" /* Y U6 Y V6 Y U6 Y V6*/
-                "punpckhbw       %%mm6, %%mm3   \n\t" /* Y U7 Y V7 Y U7 Y V7*/
-                MOVNTQ"          %%mm0, 48(%4, %0, 8)   \n\t"
-                MOVNTQ"          %%mm3, 56(%4, %0, 8)   \n\t"
-
-                : "+r" (x)
-                : "r"(yp), "r" (up), "r"(vp), "r"(d)
-                :"memory");
-        }
-        for (; x<w; x++) {
-            const int x2 = x<<2;
-            d[8*x+0] = yp[x2];
-            d[8*x+1] = up[x];
-            d[8*x+2] = yp[x2+1];
-            d[8*x+3] = vp[x];
-            d[8*x+4] = yp[x2+2];
-            d[8*x+5] = up[x];
-            d[8*x+6] = yp[x2+3];
-            d[8*x+7] = vp[x];
-        }
-    }
-    __asm__(
-            EMMS"       \n\t"
-            SFENCE"     \n\t"
-            ::: "memory"
-        );
-}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
-
-static void RENAME(extract_even)(const uint8_t *src, uint8_t *dst, x86_reg count)
-{
-    dst +=   count;
-    src += 2*count;
-    count= - count;
-
-    if(count <= -16) {
-        count += 15;
-        __asm__ volatile(
-            "pcmpeqw       %%mm7, %%mm7        \n\t"
-            "psrlw            $8, %%mm7        \n\t"
-            "1:                                \n\t"
-            "movq -30(%1, %0, 2), %%mm0        \n\t"
-            "movq -22(%1, %0, 2), %%mm1        \n\t"
-            "movq -14(%1, %0, 2), %%mm2        \n\t"
-            "movq  -6(%1, %0, 2), %%mm3        \n\t"
-            "pand          %%mm7, %%mm0        \n\t"
-            "pand          %%mm7, %%mm1        \n\t"
-            "pand          %%mm7, %%mm2        \n\t"
-            "pand          %%mm7, %%mm3        \n\t"
-            "packuswb      %%mm1, %%mm0        \n\t"
-            "packuswb      %%mm3, %%mm2        \n\t"
-            MOVNTQ"        %%mm0,-15(%2, %0)   \n\t"
-            MOVNTQ"        %%mm2,- 7(%2, %0)   \n\t"
-            "add             $16, %0           \n\t"
-            " js 1b                            \n\t"
-            : "+r"(count)
-            : "r"(src), "r"(dst)
-        );
-        count -= 15;
-    }
-    while(count<0) {
-        dst[count]= src[2*count];
-        count++;
-    }
-}
-
-#if !COMPILE_TEMPLATE_AMD3DNOW
-static void RENAME(extract_even2)(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count)
-{
-    dst0+=   count;
-    dst1+=   count;
-    src += 4*count;
-    count= - count;
-    if(count <= -8) {
-        count += 7;
-        __asm__ volatile(
-            "pcmpeqw       %%mm7, %%mm7        \n\t"
-            "psrlw            $8, %%mm7        \n\t"
-            "1:                                \n\t"
-            "movq -28(%1, %0, 4), %%mm0        \n\t"
-            "movq -20(%1, %0, 4), %%mm1        \n\t"
-            "movq -12(%1, %0, 4), %%mm2        \n\t"
-            "movq  -4(%1, %0, 4), %%mm3        \n\t"
-            "pand          %%mm7, %%mm0        \n\t"
-            "pand          %%mm7, %%mm1        \n\t"
-            "pand          %%mm7, %%mm2        \n\t"
-            "pand          %%mm7, %%mm3        \n\t"
-            "packuswb      %%mm1, %%mm0        \n\t"
-            "packuswb      %%mm3, %%mm2        \n\t"
-            "movq          %%mm0, %%mm1        \n\t"
-            "movq          %%mm2, %%mm3        \n\t"
-            "psrlw            $8, %%mm0        \n\t"
-            "psrlw            $8, %%mm2        \n\t"
-            "pand          %%mm7, %%mm1        \n\t"
-            "pand          %%mm7, %%mm3        \n\t"
-            "packuswb      %%mm2, %%mm0        \n\t"
-            "packuswb      %%mm3, %%mm1        \n\t"
-            MOVNTQ"        %%mm0,- 7(%3, %0)   \n\t"
-            MOVNTQ"        %%mm1,- 7(%2, %0)   \n\t"
-            "add              $8, %0           \n\t"
-            " js 1b                            \n\t"
-            : "+r"(count)
-            : "r"(src), "r"(dst0), "r"(dst1)
-        );
-        count -= 7;
-    }
-    while(count<0) {
-        dst0[count]= src[4*count+0];
-        dst1[count]= src[4*count+2];
-        count++;
-    }
-}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
-
-static void RENAME(extract_even2avg)(const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count)
-{
-    dst0 +=   count;
-    dst1 +=   count;
-    src0 += 4*count;
-    src1 += 4*count;
-    count= - count;
-#ifdef PAVGB
-    if(count <= -8) {
-        count += 7;
-        __asm__ volatile(
-            "pcmpeqw        %%mm7, %%mm7        \n\t"
-            "psrlw             $8, %%mm7        \n\t"
-            "1:                                \n\t"
-            "movq  -28(%1, %0, 4), %%mm0        \n\t"
-            "movq  -20(%1, %0, 4), %%mm1        \n\t"
-            "movq  -12(%1, %0, 4), %%mm2        \n\t"
-            "movq   -4(%1, %0, 4), %%mm3        \n\t"
-            PAVGB" -28(%2, %0, 4), %%mm0        \n\t"
-            PAVGB" -20(%2, %0, 4), %%mm1        \n\t"
-            PAVGB" -12(%2, %0, 4), %%mm2        \n\t"
-            PAVGB" - 4(%2, %0, 4), %%mm3        \n\t"
-            "pand           %%mm7, %%mm0        \n\t"
-            "pand           %%mm7, %%mm1        \n\t"
-            "pand           %%mm7, %%mm2        \n\t"
-            "pand           %%mm7, %%mm3        \n\t"
-            "packuswb       %%mm1, %%mm0        \n\t"
-            "packuswb       %%mm3, %%mm2        \n\t"
-            "movq           %%mm0, %%mm1        \n\t"
-            "movq           %%mm2, %%mm3        \n\t"
-            "psrlw             $8, %%mm0        \n\t"
-            "psrlw             $8, %%mm2        \n\t"
-            "pand           %%mm7, %%mm1        \n\t"
-            "pand           %%mm7, %%mm3        \n\t"
-            "packuswb       %%mm2, %%mm0        \n\t"
-            "packuswb       %%mm3, %%mm1        \n\t"
-            MOVNTQ"         %%mm0,- 7(%4, %0)   \n\t"
-            MOVNTQ"         %%mm1,- 7(%3, %0)   \n\t"
-            "add               $8, %0           \n\t"
-            " js 1b                            \n\t"
-            : "+r"(count)
-            : "r"(src0), "r"(src1), "r"(dst0), "r"(dst1)
-        );
-        count -= 7;
-    }
-#endif
-    while(count<0) {
-        dst0[count]= (src0[4*count+0]+src1[4*count+0])>>1;
-        dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1;
-        count++;
-    }
-}
-
-#if !COMPILE_TEMPLATE_AMD3DNOW
-static void RENAME(extract_odd2)(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count)
-{
-    dst0+=   count;
-    dst1+=   count;
-    src += 4*count;
-    count= - count;
-    if(count <= -8) {
-        count += 7;
-        __asm__ volatile(
-            "pcmpeqw       %%mm7, %%mm7        \n\t"
-            "psrlw            $8, %%mm7        \n\t"
-            "1:                                \n\t"
-            "movq -28(%1, %0, 4), %%mm0        \n\t"
-            "movq -20(%1, %0, 4), %%mm1        \n\t"
-            "movq -12(%1, %0, 4), %%mm2        \n\t"
-            "movq  -4(%1, %0, 4), %%mm3        \n\t"
-            "psrlw            $8, %%mm0        \n\t"
-            "psrlw            $8, %%mm1        \n\t"
-            "psrlw            $8, %%mm2        \n\t"
-            "psrlw            $8, %%mm3        \n\t"
-            "packuswb      %%mm1, %%mm0        \n\t"
-            "packuswb      %%mm3, %%mm2        \n\t"
-            "movq          %%mm0, %%mm1        \n\t"
-            "movq          %%mm2, %%mm3        \n\t"
-            "psrlw            $8, %%mm0        \n\t"
-            "psrlw            $8, %%mm2        \n\t"
-            "pand          %%mm7, %%mm1        \n\t"
-            "pand          %%mm7, %%mm3        \n\t"
-            "packuswb      %%mm2, %%mm0        \n\t"
-            "packuswb      %%mm3, %%mm1        \n\t"
-            MOVNTQ"        %%mm0,- 7(%3, %0)   \n\t"
-            MOVNTQ"        %%mm1,- 7(%2, %0)   \n\t"
-            "add              $8, %0           \n\t"
-            " js 1b                            \n\t"
-            : "+r"(count)
-            : "r"(src), "r"(dst0), "r"(dst1)
-        );
-        count -= 7;
-    }
-    src++;
-    while(count<0) {
-        dst0[count]= src[4*count+0];
-        dst1[count]= src[4*count+2];
-        count++;
-    }
-}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
-
-static void RENAME(extract_odd2avg)(const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count)
-{
-    dst0 +=   count;
-    dst1 +=   count;
-    src0 += 4*count;
-    src1 += 4*count;
-    count= - count;
-#ifdef PAVGB
-    if(count <= -8) {
-        count += 7;
-        __asm__ volatile(
-            "pcmpeqw        %%mm7, %%mm7        \n\t"
-            "psrlw             $8, %%mm7        \n\t"
-            "1:                                \n\t"
-            "movq  -28(%1, %0, 4), %%mm0        \n\t"
-            "movq  -20(%1, %0, 4), %%mm1        \n\t"
-            "movq  -12(%1, %0, 4), %%mm2        \n\t"
-            "movq   -4(%1, %0, 4), %%mm3        \n\t"
-            PAVGB" -28(%2, %0, 4), %%mm0        \n\t"
-            PAVGB" -20(%2, %0, 4), %%mm1        \n\t"
-            PAVGB" -12(%2, %0, 4), %%mm2        \n\t"
-            PAVGB" - 4(%2, %0, 4), %%mm3        \n\t"
-            "psrlw             $8, %%mm0        \n\t"
-            "psrlw             $8, %%mm1        \n\t"
-            "psrlw             $8, %%mm2        \n\t"
-            "psrlw             $8, %%mm3        \n\t"
-            "packuswb       %%mm1, %%mm0        \n\t"
-            "packuswb       %%mm3, %%mm2        \n\t"
-            "movq           %%mm0, %%mm1        \n\t"
-            "movq           %%mm2, %%mm3        \n\t"
-            "psrlw             $8, %%mm0        \n\t"
-            "psrlw             $8, %%mm2        \n\t"
-            "pand           %%mm7, %%mm1        \n\t"
-            "pand           %%mm7, %%mm3        \n\t"
-            "packuswb       %%mm2, %%mm0        \n\t"
-            "packuswb       %%mm3, %%mm1        \n\t"
-            MOVNTQ"         %%mm0,- 7(%4, %0)   \n\t"
-            MOVNTQ"         %%mm1,- 7(%3, %0)   \n\t"
-            "add               $8, %0           \n\t"
-            " js 1b                            \n\t"
-            : "+r"(count)
-            : "r"(src0), "r"(src1), "r"(dst0), "r"(dst1)
-        );
-        count -= 7;
-    }
-#endif
-    src0++;
-    src1++;
-    while(count<0) {
-        dst0[count]= (src0[4*count+0]+src1[4*count+0])>>1;
-        dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1;
-        count++;
-    }
-}
-
-static void RENAME(yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
-                                 int width, int height,
-                                 int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth= -((-width)>>1);
-
-    for (y=0; y<height; y++) {
-        RENAME(extract_even)(src, ydst, width);
-        if(y&1) {
-            RENAME(extract_odd2avg)(src-srcStride, src, udst, vdst, chromWidth);
-            udst+= chromStride;
-            vdst+= chromStride;
-        }
-
-        src += srcStride;
-        ydst+= lumStride;
-    }
-    __asm__(
-            EMMS"       \n\t"
-            SFENCE"     \n\t"
-            ::: "memory"
-        );
-}
-
-#if !COMPILE_TEMPLATE_AMD3DNOW
-static void RENAME(yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
-                                 int width, int height,
-                                 int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth= -((-width)>>1);
-
-    for (y=0; y<height; y++) {
-        RENAME(extract_even)(src, ydst, width);
-        RENAME(extract_odd2)(src, udst, vdst, chromWidth);
-
-        src += srcStride;
-        ydst+= lumStride;
-        udst+= chromStride;
-        vdst+= chromStride;
-    }
-    __asm__(
-            EMMS"       \n\t"
-            SFENCE"     \n\t"
-            ::: "memory"
-        );
-}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
-
-static void RENAME(uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
-                                 int width, int height,
-                                 int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth= -((-width)>>1);
-
-    for (y=0; y<height; y++) {
-        RENAME(extract_even)(src+1, ydst, width);
-        if(y&1) {
-            RENAME(extract_even2avg)(src-srcStride, src, udst, vdst, chromWidth);
-            udst+= chromStride;
-            vdst+= chromStride;
-        }
-
-        src += srcStride;
-        ydst+= lumStride;
-    }
-    __asm__(
-            EMMS"       \n\t"
-            SFENCE"     \n\t"
-            ::: "memory"
-        );
-}
-
-#if !COMPILE_TEMPLATE_AMD3DNOW
-static void RENAME(uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
-                                 int width, int height,
-                                 int lumStride, int chromStride, int srcStride)
-{
-    int y;
-    const int chromWidth= -((-width)>>1);
-
-    for (y=0; y<height; y++) {
-        RENAME(extract_even)(src+1, ydst, width);
-        RENAME(extract_even2)(src, udst, vdst, chromWidth);
-
-        src += srcStride;
-        ydst+= lumStride;
-        udst+= chromStride;
-        vdst+= chromStride;
-    }
-    __asm__(
-            EMMS"       \n\t"
-            SFENCE"     \n\t"
-            ::: "memory"
-        );
-}
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
-#endif /* !COMPILE_TEMPLATE_SSE2 */
-
-static av_cold void RENAME(rgb2rgb_init)(void)
-{
-#if !COMPILE_TEMPLATE_SSE2
-#if !COMPILE_TEMPLATE_AMD3DNOW
-    rgb15to16          = RENAME(rgb15to16);
-    rgb15tobgr24       = RENAME(rgb15tobgr24);
-    rgb15to32          = RENAME(rgb15to32);
-    rgb16tobgr24       = RENAME(rgb16tobgr24);
-    rgb16to32          = RENAME(rgb16to32);
-    rgb16to15          = RENAME(rgb16to15);
-    rgb24tobgr16       = RENAME(rgb24tobgr16);
-    rgb24tobgr15       = RENAME(rgb24tobgr15);
-    rgb24tobgr32       = RENAME(rgb24tobgr32);
-    rgb32to16          = RENAME(rgb32to16);
-    rgb32to15          = RENAME(rgb32to15);
-    rgb32tobgr24       = RENAME(rgb32tobgr24);
-    rgb24to15          = RENAME(rgb24to15);
-    rgb24to16          = RENAME(rgb24to16);
-    rgb24tobgr24       = RENAME(rgb24tobgr24);
-    shuffle_bytes_2103 = RENAME(shuffle_bytes_2103);
-    rgb32tobgr16       = RENAME(rgb32tobgr16);
-    rgb32tobgr15       = RENAME(rgb32tobgr15);
-    yv12toyuy2         = RENAME(yv12toyuy2);
-    yv12touyvy         = RENAME(yv12touyvy);
-    yuv422ptoyuy2      = RENAME(yuv422ptoyuy2);
-    yuv422ptouyvy      = RENAME(yuv422ptouyvy);
-    yuy2toyv12         = RENAME(yuy2toyv12);
-    vu9_to_vu12        = RENAME(vu9_to_vu12);
-    yvu9_to_yuy2       = RENAME(yvu9_to_yuy2);
-    uyvytoyuv422       = RENAME(uyvytoyuv422);
-    yuyvtoyuv422       = RENAME(yuyvtoyuv422);
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
-
-#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW
-    planar2x           = RENAME(planar2x);
-#endif /* COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW */
-    rgb24toyv12        = RENAME(rgb24toyv12);
-
-    yuyvtoyuv420       = RENAME(yuyvtoyuv420);
-    uyvytoyuv420       = RENAME(uyvytoyuv420);
-#endif /* !COMPILE_TEMPLATE_SSE2 */
-
-#if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
-    interleaveBytes    = RENAME(interleaveBytes);
-#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
-#if !COMPILE_TEMPLATE_AMD3DNOW && (ARCH_X86_32 || COMPILE_TEMPLATE_SSE2) && COMPILE_TEMPLATE_MMXEXT == COMPILE_TEMPLATE_SSE2 && HAVE_YASM
-    deinterleaveBytes  = RENAME(deinterleaveBytes);
-#endif
-}
diff --git a/deps/libav/libswscale/x86/scale.asm b/deps/libav/libswscale/x86/scale.asm
deleted file mode 100644
index 440a27b..0000000
--- a/deps/libav/libswscale/x86/scale.asm
+++ /dev/null
@@ -1,427 +0,0 @@
-;******************************************************************************
-;* x86-optimized horizontal line scaling functions
-;* Copyright (c) 2011 Ronald S. Bultje <rsbultje at gmail.com>
-;*
-;* This file is part of Libav.
-;*
-;* Libav 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.
-;*
-;* Libav 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 Libav; if not, write to the Free Software
-;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-;******************************************************************************
-
-%include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-max_19bit_int: times 4 dd 0x7ffff
-max_19bit_flt: times 4 dd 524287.0
-minshort:      times 8 dw 0x8000
-unicoeff:      times 4 dd 0x20000000
-
-SECTION .text
-
-;-----------------------------------------------------------------------------
-; horizontal line scaling
-;
-; void hscale<source_width>to<intermediate_nbits>_<filterSize>_<opt>
-;                               (SwsContext *c, int{16,32}_t *dst,
-;                                int dstW, const uint{8,16}_t *src,
-;                                const int16_t *filter,
-;                                const int32_t *filterPos, int filterSize);
-;
-; Scale one horizontal line. Input is either 8-bits width or 16-bits width
-; ($source_width can be either 8, 9, 10 or 16, difference is whether we have to
-; downscale before multiplying). Filter is 14-bits. Output is either 15bits
-; (in int16_t) or 19bits (in int32_t), as given in $intermediate_nbits. Each
-; output pixel is generated from $filterSize input pixels, the position of
-; the first pixel is given in filterPos[nOutputPixel].
-;-----------------------------------------------------------------------------
-
-; SCALE_FUNC source_width, intermediate_nbits, filtersize, filtersuffix, n_args, n_xmm
-%macro SCALE_FUNC 6
-%ifnidn %3, X
-cglobal hscale%1to%2_%4, %5, 7, %6, pos0, dst, w, src, filter, fltpos, pos1
-%else
-cglobal hscale%1to%2_%4, %5, 10, %6, pos0, dst, w, srcmem, filter, fltpos, fltsize
-%endif
-%if ARCH_X86_64
-    movsxd        wq, wd
-%define mov32 movsxd
-%else ; x86-32
-%define mov32 mov
-%endif ; x86-64
-%if %2 == 19
-%if mmsize == 8 ; mmx
-    mova          m2, [max_19bit_int]
-%elif cpuflag(sse4)
-    mova          m2, [max_19bit_int]
-%else ; ssse3/sse2
-    mova          m2, [max_19bit_flt]
-%endif ; mmx/sse2/ssse3/sse4
-%endif ; %2 == 19
-%if %1 == 16
-    mova          m6, [minshort]
-    mova          m7, [unicoeff]
-%elif %1 == 8
-    pxor          m3, m3
-%endif ; %1 == 8/16
-
-%if %1 == 8
-%define movlh movd
-%define movbh movh
-%define srcmul 1
-%else ; %1 == 9-16
-%define movlh movq
-%define movbh movu
-%define srcmul 2
-%endif ; %1 == 8/9-16
-
-%ifnidn %3, X
-
-    ; setup loop
-%if %3 == 8
-    shl           wq, 1                         ; this allows *16 (i.e. now *8) in lea instructions for the 8-tap filter
-%define wshr 1
-%else ; %3 == 4
-%define wshr 0
-%endif ; %3 == 8
-    lea      filterq, [filterq+wq*8]
-%if %2 == 15
-    lea         dstq, [dstq+wq*(2>>wshr)]
-%else ; %2 == 19
-    lea         dstq, [dstq+wq*(4>>wshr)]
-%endif ; %2 == 15/19
-    lea      fltposq, [fltposq+wq*(4>>wshr)]
-    neg           wq
-
-.loop:
-%if %3 == 4 ; filterSize == 4 scaling
-    ; load 2x4 or 4x4 source pixels into m0/m1
-    mov32      pos0q, dword [fltposq+wq*4+ 0]   ; filterPos[0]
-    mov32      pos1q, dword [fltposq+wq*4+ 4]   ; filterPos[1]
-    movlh         m0, [srcq+pos0q*srcmul]       ; src[filterPos[0] + {0,1,2,3}]
-%if mmsize == 8
-    movlh         m1, [srcq+pos1q*srcmul]       ; src[filterPos[1] + {0,1,2,3}]
-%else ; mmsize == 16
-%if %1 > 8
-    movhps        m0, [srcq+pos1q*srcmul]       ; src[filterPos[1] + {0,1,2,3}]
-%else ; %1 == 8
-    movd          m4, [srcq+pos1q*srcmul]       ; src[filterPos[1] + {0,1,2,3}]
-%endif
-    mov32      pos0q, dword [fltposq+wq*4+ 8]   ; filterPos[2]
-    mov32      pos1q, dword [fltposq+wq*4+12]   ; filterPos[3]
-    movlh         m1, [srcq+pos0q*srcmul]       ; src[filterPos[2] + {0,1,2,3}]
-%if %1 > 8
-    movhps        m1, [srcq+pos1q*srcmul]       ; src[filterPos[3] + {0,1,2,3}]
-%else ; %1 == 8
-    movd          m5, [srcq+pos1q*srcmul]       ; src[filterPos[3] + {0,1,2,3}]
-    punpckldq     m0, m4
-    punpckldq     m1, m5
-%endif ; %1 == 8
-%endif ; mmsize == 8/16
-%if %1 == 8
-    punpcklbw     m0, m3                        ; byte -> word
-    punpcklbw     m1, m3                        ; byte -> word
-%endif ; %1 == 8
-
-    ; multiply with filter coefficients
-%if %1 == 16 ; pmaddwd needs signed adds, so this moves unsigned -> signed, we'll
-             ; add back 0x8000 * sum(coeffs) after the horizontal add
-    psubw         m0, m6
-    psubw         m1, m6
-%endif ; %1 == 16
-    pmaddwd       m0, [filterq+wq*8+mmsize*0]   ; *= filter[{0,1,..,6,7}]
-    pmaddwd       m1, [filterq+wq*8+mmsize*1]   ; *= filter[{8,9,..,14,15}]
-
-    ; add up horizontally (4 srcpix * 4 coefficients -> 1 dstpix)
-%if mmsize == 8 ; mmx
-    movq          m4, m0
-    punpckldq     m0, m1
-    punpckhdq     m4, m1
-    paddd         m0, m4
-%elif notcpuflag(ssse3) ; sse2
-    mova          m4, m0
-    shufps        m0, m1, 10001000b
-    shufps        m4, m1, 11011101b
-    paddd         m0, m4
-%else ; ssse3/sse4
-    phaddd        m0, m1                        ; filter[{ 0, 1, 2, 3}]*src[filterPos[0]+{0,1,2,3}],
-                                                ; filter[{ 4, 5, 6, 7}]*src[filterPos[1]+{0,1,2,3}],
-                                                ; filter[{ 8, 9,10,11}]*src[filterPos[2]+{0,1,2,3}],
-                                                ; filter[{12,13,14,15}]*src[filterPos[3]+{0,1,2,3}]
-%endif ; mmx/sse2/ssse3/sse4
-%else ; %3 == 8, i.e. filterSize == 8 scaling
-    ; load 2x8 or 4x8 source pixels into m0, m1, m4 and m5
-    mov32      pos0q, dword [fltposq+wq*2+0]    ; filterPos[0]
-    mov32      pos1q, dword [fltposq+wq*2+4]    ; filterPos[1]
-    movbh         m0, [srcq+ pos0q   *srcmul]   ; src[filterPos[0] + {0,1,2,3,4,5,6,7}]
-%if mmsize == 8
-    movbh         m1, [srcq+(pos0q+4)*srcmul]   ; src[filterPos[0] + {4,5,6,7}]
-    movbh         m4, [srcq+ pos1q   *srcmul]   ; src[filterPos[1] + {0,1,2,3}]
-    movbh         m5, [srcq+(pos1q+4)*srcmul]   ; src[filterPos[1] + {4,5,6,7}]
-%else ; mmsize == 16
-    movbh         m1, [srcq+ pos1q   *srcmul]   ; src[filterPos[1] + {0,1,2,3,4,5,6,7}]
-    mov32      pos0q, dword [fltposq+wq*2+8]    ; filterPos[2]
-    mov32      pos1q, dword [fltposq+wq*2+12]   ; filterPos[3]
-    movbh         m4, [srcq+ pos0q   *srcmul]   ; src[filterPos[2] + {0,1,2,3,4,5,6,7}]
-    movbh         m5, [srcq+ pos1q   *srcmul]   ; src[filterPos[3] + {0,1,2,3,4,5,6,7}]
-%endif ; mmsize == 8/16
-%if %1 == 8
-    punpcklbw     m0, m3                        ; byte -> word
-    punpcklbw     m1, m3                        ; byte -> word
-    punpcklbw     m4, m3                        ; byte -> word
-    punpcklbw     m5, m3                        ; byte -> word
-%endif ; %1 == 8
-
-    ; multiply
-%if %1 == 16 ; pmaddwd needs signed adds, so this moves unsigned -> signed, we'll
-             ; add back 0x8000 * sum(coeffs) after the horizontal add
-    psubw         m0, m6
-    psubw         m1, m6
-    psubw         m4, m6
-    psubw         m5, m6
-%endif ; %1 == 16
-    pmaddwd       m0, [filterq+wq*8+mmsize*0]   ; *= filter[{0,1,..,6,7}]
-    pmaddwd       m1, [filterq+wq*8+mmsize*1]   ; *= filter[{8,9,..,14,15}]
-    pmaddwd       m4, [filterq+wq*8+mmsize*2]   ; *= filter[{16,17,..,22,23}]
-    pmaddwd       m5, [filterq+wq*8+mmsize*3]   ; *= filter[{24,25,..,30,31}]
-
-    ; add up horizontally (8 srcpix * 8 coefficients -> 1 dstpix)
-%if mmsize == 8
-    paddd         m0, m1
-    paddd         m4, m5
-    movq          m1, m0
-    punpckldq     m0, m4
-    punpckhdq     m1, m4
-    paddd         m0, m1
-%elif notcpuflag(ssse3) ; sse2
-%if %1 == 8
-%define mex m6
-%else
-%define mex m3
-%endif
-    ; emulate horizontal add as transpose + vertical add
-    mova         mex, m0
-    punpckldq     m0, m1
-    punpckhdq    mex, m1
-    paddd         m0, mex
-    mova          m1, m4
-    punpckldq     m4, m5
-    punpckhdq     m1, m5
-    paddd         m4, m1
-    mova          m1, m0
-    punpcklqdq    m0, m4
-    punpckhqdq    m1, m4
-    paddd         m0, m1
-%else ; ssse3/sse4
-    ; FIXME if we rearrange the filter in pairs of 4, we can
-    ; load pixels likewise and use 2 x paddd + phaddd instead
-    ; of 3 x phaddd here, faster on older cpus
-    phaddd        m0, m1
-    phaddd        m4, m5
-    phaddd        m0, m4                        ; filter[{ 0, 1,..., 6, 7}]*src[filterPos[0]+{0,1,...,6,7}],
-                                                ; filter[{ 8, 9,...,14,15}]*src[filterPos[1]+{0,1,...,6,7}],
-                                                ; filter[{16,17,...,22,23}]*src[filterPos[2]+{0,1,...,6,7}],
-                                                ; filter[{24,25,...,30,31}]*src[filterPos[3]+{0,1,...,6,7}]
-%endif ; mmx/sse2/ssse3/sse4
-%endif ; %3 == 4/8
-
-%else ; %3 == X, i.e. any filterSize scaling
-
-%ifidn %4, X4
-%define dlt 4
-%else ; %4 == X || %4 == X8
-%define dlt 0
-%endif ; %4 ==/!= X4
-%if ARCH_X86_64
-%define srcq    r8
-%define pos1q   r7
-%define srcendq r9
-    movsxd  fltsizeq, fltsized                  ; filterSize
-    lea      srcendq, [srcmemq+(fltsizeq-dlt)*srcmul] ; &src[filterSize&~4]
-%else ; x86-32
-%define srcq    srcmemq
-%define pos1q   dstq
-%define srcendq r6m
-    lea        pos0q, [srcmemq+(fltsizeq-dlt)*srcmul] ; &src[filterSize&~4]
-    mov      srcendq, pos0q
-%endif ; x86-32/64
-    lea      fltposq, [fltposq+wq*4]
-%if %2 == 15
-    lea         dstq, [dstq+wq*2]
-%else ; %2 == 19
-    lea         dstq, [dstq+wq*4]
-%endif ; %2 == 15/19
-    movifnidn  dstmp, dstq
-    neg           wq
-
-.loop:
-    mov32      pos0q, dword [fltposq+wq*4+0]    ; filterPos[0]
-    mov32      pos1q, dword [fltposq+wq*4+4]    ; filterPos[1]
-    ; FIXME maybe do 4px/iteration on x86-64 (x86-32 wouldn't have enough regs)?
-    pxor          m4, m4
-    pxor          m5, m5
-    mov         srcq, srcmemmp
-
-.innerloop:
-    ; load 2x4 (mmx) or 2x8 (sse) source pixels into m0/m1 -> m4/m5
-    movbh         m0, [srcq+ pos0q     *srcmul] ; src[filterPos[0] + {0,1,2,3(,4,5,6,7)}]
-    movbh         m1, [srcq+(pos1q+dlt)*srcmul] ; src[filterPos[1] + {0,1,2,3(,4,5,6,7)}]
-%if %1 == 8
-    punpcklbw     m0, m3
-    punpcklbw     m1, m3
-%endif ; %1 == 8
-
-    ; multiply
-%if %1 == 16 ; pmaddwd needs signed adds, so this moves unsigned -> signed, we'll
-             ; add back 0x8000 * sum(coeffs) after the horizontal add
-    psubw         m0, m6
-    psubw         m1, m6
-%endif ; %1 == 16
-    pmaddwd       m0, [filterq]                 ; filter[{0,1,2,3(,4,5,6,7)}]
-    pmaddwd       m1, [filterq+(fltsizeq+dlt)*2]; filter[filtersize+{0,1,2,3(,4,5,6,7)}]
-    paddd         m4, m0
-    paddd         m5, m1
-    add      filterq, mmsize
-    add         srcq, srcmul*mmsize/2
-    cmp         srcq, srcendq                   ; while (src += 4) < &src[filterSize]
-    jl .innerloop
-
-%ifidn %4, X4
-    mov32      pos1q, dword [fltposq+wq*4+4]    ; filterPos[1]
-    movlh         m0, [srcq+ pos0q     *srcmul] ; split last 4 srcpx of dstpx[0]
-    sub        pos1q, fltsizeq                  ; and first 4 srcpx of dstpx[1]
-%if %1 > 8
-    movhps        m0, [srcq+(pos1q+dlt)*srcmul]
-%else ; %1 == 8
-    movd          m1, [srcq+(pos1q+dlt)*srcmul]
-    punpckldq     m0, m1
-%endif ; %1 == 8
-%if %1 == 8
-    punpcklbw     m0, m3
-%endif ; %1 == 8
-%if %1 == 16 ; pmaddwd needs signed adds, so this moves unsigned -> signed, we'll
-             ; add back 0x8000 * sum(coeffs) after the horizontal add
-    psubw         m0, m6
-%endif ; %1 == 16
-    pmaddwd       m0, [filterq]
-%endif ; %4 == X4
-
-    lea      filterq, [filterq+(fltsizeq+dlt)*2]
-
-%if mmsize == 8 ; mmx
-    movq          m0, m4
-    punpckldq     m4, m5
-    punpckhdq     m0, m5
-    paddd         m0, m4
-%else ; mmsize == 16
-%if notcpuflag(ssse3) ; sse2
-    mova          m1, m4
-    punpcklqdq    m4, m5
-    punpckhqdq    m1, m5
-    paddd         m4, m1
-%else ; ssse3/sse4
-    phaddd        m4, m5
-%endif ; sse2/ssse3/sse4
-%ifidn %4, X4
-    paddd         m4, m0
-%endif ; %3 == X4
-%if notcpuflag(ssse3) ; sse2
-    pshufd        m4, m4, 11011000b
-    movhlps       m0, m4
-    paddd         m0, m4
-%else ; ssse3/sse4
-    phaddd        m4, m4
-    SWAP           0, 4
-%endif ; sse2/ssse3/sse4
-%endif ; mmsize == 8/16
-%endif ; %3 ==/!= X
-
-%if %1 == 16 ; add 0x8000 * sum(coeffs), i.e. back from signed -> unsigned
-    paddd         m0, m7
-%endif ; %1 == 16
-
-    ; clip, store
-    psrad         m0, 14 + %1 - %2
-%ifidn %3, X
-    movifnidn   dstq, dstmp
-%endif ; %3 == X
-%if %2 == 15
-    packssdw      m0, m0
-%ifnidn %3, X
-    movh [dstq+wq*(2>>wshr)], m0
-%else ; %3 == X
-    movd [dstq+wq*2], m0
-%endif ; %3 ==/!= X
-%else ; %2 == 19
-%if mmsize == 8
-    PMINSD_MMX    m0, m2, m4
-%elif cpuflag(sse4)
-    pminsd        m0, m2
-%else ; sse2/ssse3
-    cvtdq2ps      m0, m0
-    minps         m0, m2
-    cvtps2dq      m0, m0
-%endif ; mmx/sse2/ssse3/sse4
-%ifnidn %3, X
-    mova [dstq+wq*(4>>wshr)], m0
-%else ; %3 == X
-    movq [dstq+wq*4], m0
-%endif ; %3 ==/!= X
-%endif ; %2 == 15/19
-%ifnidn %3, X
-    add           wq, (mmsize<<wshr)/4          ; both 8tap and 4tap really only do 4 pixels (or for mmx: 2 pixels)
-                                                ; per iteration. see "shl wq,1" above as for why we do this
-%else ; %3 == X
-    add           wq, 2
-%endif ; %3 ==/!= X
-    jl .loop
-    REP_RET
-%endmacro
-
-; SCALE_FUNCS source_width, intermediate_nbits, n_xmm
-%macro SCALE_FUNCS 3
-SCALE_FUNC %1, %2, 4, 4,  6, %3
-SCALE_FUNC %1, %2, 8, 8,  6, %3
-%if mmsize == 8
-SCALE_FUNC %1, %2, X, X,  7, %3
-%else
-SCALE_FUNC %1, %2, X, X4, 7, %3
-SCALE_FUNC %1, %2, X, X8, 7, %3
-%endif
-%endmacro
-
-; SCALE_FUNCS2 8_xmm_args, 9to10_xmm_args, 16_xmm_args
-%macro SCALE_FUNCS2 3
-%if notcpuflag(sse4)
-SCALE_FUNCS  8, 15, %1
-SCALE_FUNCS  9, 15, %2
-SCALE_FUNCS 10, 15, %2
-SCALE_FUNCS 16, 15, %3
-%endif ; !sse4
-SCALE_FUNCS  8, 19, %1
-SCALE_FUNCS  9, 19, %2
-SCALE_FUNCS 10, 19, %2
-SCALE_FUNCS 16, 19, %3
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-SCALE_FUNCS2 0, 0, 0
-%endif
-INIT_XMM sse2
-SCALE_FUNCS2 6, 7, 8
-INIT_XMM ssse3
-SCALE_FUNCS2 6, 6, 8
-INIT_XMM sse4
-SCALE_FUNCS2 6, 6, 8
diff --git a/deps/libav/libswscale/x86/swscale.c b/deps/libav/libswscale/x86/swscale.c
deleted file mode 100644
index a2bce48..0000000
--- a/deps/libav/libswscale/x86/swscale.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <inttypes.h>
-#include "config.h"
-#include "libswscale/swscale.h"
-#include "libswscale/swscale_internal.h"
-#include "libavutil/attributes.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavutil/cpu.h"
-#include "libavutil/pixdesc.h"
-
-#if HAVE_INLINE_ASM
-
-#define DITHER1XBPP
-
-DECLARE_ASM_CONST(8, uint64_t, bF8)=       0xF8F8F8F8F8F8F8F8LL;
-DECLARE_ASM_CONST(8, uint64_t, bFC)=       0xFCFCFCFCFCFCFCFCLL;
-DECLARE_ASM_CONST(8, uint64_t, w10)=       0x0010001000100010LL;
-DECLARE_ASM_CONST(8, uint64_t, w02)=       0x0002000200020002LL;
-
-const DECLARE_ALIGNED(8, uint64_t, ff_dither4)[2] = {
-    0x0103010301030103LL,
-    0x0200020002000200LL,};
-
-const DECLARE_ALIGNED(8, uint64_t, ff_dither8)[2] = {
-    0x0602060206020602LL,
-    0x0004000400040004LL,};
-
-DECLARE_ASM_CONST(8, uint64_t, b16Mask)=   0x001F001F001F001FLL;
-DECLARE_ASM_CONST(8, uint64_t, g16Mask)=   0x07E007E007E007E0LL;
-DECLARE_ASM_CONST(8, uint64_t, r16Mask)=   0xF800F800F800F800LL;
-DECLARE_ASM_CONST(8, uint64_t, b15Mask)=   0x001F001F001F001FLL;
-DECLARE_ASM_CONST(8, uint64_t, g15Mask)=   0x03E003E003E003E0LL;
-DECLARE_ASM_CONST(8, uint64_t, r15Mask)=   0x7C007C007C007C00LL;
-
-DECLARE_ALIGNED(8, const uint64_t, ff_M24A)         = 0x00FF0000FF0000FFLL;
-DECLARE_ALIGNED(8, const uint64_t, ff_M24B)         = 0xFF0000FF0000FF00LL;
-DECLARE_ALIGNED(8, const uint64_t, ff_M24C)         = 0x0000FF0000FF0000LL;
-
-#ifdef FAST_BGR2YV12
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YCoeff)   = 0x000000210041000DULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UCoeff)   = 0x0000FFEEFFDC0038ULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2VCoeff)   = 0x00000038FFD2FFF8ULL;
-#else
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YCoeff)   = 0x000020E540830C8BULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UCoeff)   = 0x0000ED0FDAC23831ULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2VCoeff)   = 0x00003831D0E6F6EAULL;
-#endif /* FAST_BGR2YV12 */
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YOffset)  = 0x1010101010101010ULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_w1111)        = 0x0001000100010001ULL;
-
-//MMX versions
-#if HAVE_MMX_INLINE
-#undef RENAME
-#define COMPILE_TEMPLATE_MMXEXT 0
-#define RENAME(a) a ## _mmx
-#include "swscale_template.c"
-#endif
-
-// MMXEXT versions
-#if HAVE_MMXEXT_INLINE
-#undef RENAME
-#undef COMPILE_TEMPLATE_MMXEXT
-#define COMPILE_TEMPLATE_MMXEXT 1
-#define RENAME(a) a ## _mmxext
-#include "swscale_template.c"
-#endif
-
-void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex,
-                           int lastInLumBuf, int lastInChrBuf)
-{
-    const int dstH= c->dstH;
-    const int flags= c->flags;
-    int16_t **lumPixBuf= c->lumPixBuf;
-    int16_t **chrUPixBuf= c->chrUPixBuf;
-    int16_t **alpPixBuf= c->alpPixBuf;
-    const int vLumBufSize= c->vLumBufSize;
-    const int vChrBufSize= c->vChrBufSize;
-    int32_t *vLumFilterPos= c->vLumFilterPos;
-    int32_t *vChrFilterPos= c->vChrFilterPos;
-    int16_t *vLumFilter= c->vLumFilter;
-    int16_t *vChrFilter= c->vChrFilter;
-    int32_t *lumMmxFilter= c->lumMmxFilter;
-    int32_t *chrMmxFilter= c->chrMmxFilter;
-    int32_t av_unused *alpMmxFilter= c->alpMmxFilter;
-    const int vLumFilterSize= c->vLumFilterSize;
-    const int vChrFilterSize= c->vChrFilterSize;
-    const int chrDstY= dstY>>c->chrDstVSubSample;
-    const int firstLumSrcY= vLumFilterPos[dstY]; //First line needed as input
-    const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input
-
-    c->blueDither= ff_dither8[dstY&1];
-    if (c->dstFormat == AV_PIX_FMT_RGB555 || c->dstFormat == AV_PIX_FMT_BGR555)
-        c->greenDither= ff_dither8[dstY&1];
-    else
-        c->greenDither= ff_dither4[dstY&1];
-    c->redDither= ff_dither8[(dstY+1)&1];
-    if (dstY < dstH - 2) {
-        const int16_t **lumSrcPtr= (const int16_t **) lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
-        const int16_t **chrUSrcPtr= (const int16_t **) chrUPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
-        const int16_t **alpSrcPtr= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? (const int16_t **) alpPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize : NULL;
-        int i;
-
-        if (firstLumSrcY < 0 || firstLumSrcY + vLumFilterSize > c->srcH) {
-            const int16_t **tmpY = (const int16_t **) lumPixBuf + 2 * vLumBufSize;
-            int neg = -firstLumSrcY, i, end = FFMIN(c->srcH - firstLumSrcY, vLumFilterSize);
-            for (i = 0; i < neg;            i++)
-                tmpY[i] = lumSrcPtr[neg];
-            for (     ; i < end;            i++)
-                tmpY[i] = lumSrcPtr[i];
-            for (     ; i < vLumFilterSize; i++)
-                tmpY[i] = tmpY[i-1];
-            lumSrcPtr = tmpY;
-
-            if (alpSrcPtr) {
-                const int16_t **tmpA = (const int16_t **) alpPixBuf + 2 * vLumBufSize;
-                for (i = 0; i < neg;            i++)
-                    tmpA[i] = alpSrcPtr[neg];
-                for (     ; i < end;            i++)
-                    tmpA[i] = alpSrcPtr[i];
-                for (     ; i < vLumFilterSize; i++)
-                    tmpA[i] = tmpA[i - 1];
-                alpSrcPtr = tmpA;
-            }
-        }
-        if (firstChrSrcY < 0 || firstChrSrcY + vChrFilterSize > c->chrSrcH) {
-            const int16_t **tmpU = (const int16_t **) chrUPixBuf + 2 * vChrBufSize;
-            int neg = -firstChrSrcY, i, end = FFMIN(c->chrSrcH - firstChrSrcY, vChrFilterSize);
-            for (i = 0; i < neg;            i++) {
-                tmpU[i] = chrUSrcPtr[neg];
-            }
-            for (     ; i < end;            i++) {
-                tmpU[i] = chrUSrcPtr[i];
-            }
-            for (     ; i < vChrFilterSize; i++) {
-                tmpU[i] = tmpU[i - 1];
-            }
-            chrUSrcPtr = tmpU;
-        }
-
-        if (flags & SWS_ACCURATE_RND) {
-            int s= APCK_SIZE / 8;
-            for (i=0; i<vLumFilterSize; i+=2) {
-                *(const void**)&lumMmxFilter[s*i              ]= lumSrcPtr[i  ];
-                *(const void**)&lumMmxFilter[s*i+APCK_PTR2/4  ]= lumSrcPtr[i+(vLumFilterSize>1)];
-                lumMmxFilter[s*i+APCK_COEF/4  ]=
-                lumMmxFilter[s*i+APCK_COEF/4+1]= vLumFilter[dstY*vLumFilterSize + i    ]
-                + (vLumFilterSize>1 ? vLumFilter[dstY*vLumFilterSize + i + 1]<<16 : 0);
-                if (CONFIG_SWSCALE_ALPHA && alpPixBuf) {
-                    *(const void**)&alpMmxFilter[s*i              ]= alpSrcPtr[i  ];
-                    *(const void**)&alpMmxFilter[s*i+APCK_PTR2/4  ]= alpSrcPtr[i+(vLumFilterSize>1)];
-                    alpMmxFilter[s*i+APCK_COEF/4  ]=
-                    alpMmxFilter[s*i+APCK_COEF/4+1]= lumMmxFilter[s*i+APCK_COEF/4  ];
-                }
-            }
-            for (i=0; i<vChrFilterSize; i+=2) {
-                *(const void**)&chrMmxFilter[s*i              ]= chrUSrcPtr[i  ];
-                *(const void**)&chrMmxFilter[s*i+APCK_PTR2/4  ]= chrUSrcPtr[i+(vChrFilterSize>1)];
-                chrMmxFilter[s*i+APCK_COEF/4  ]=
-                chrMmxFilter[s*i+APCK_COEF/4+1]= vChrFilter[chrDstY*vChrFilterSize + i    ]
-                + (vChrFilterSize>1 ? vChrFilter[chrDstY*vChrFilterSize + i + 1]<<16 : 0);
-            }
-        } else {
-            for (i=0; i<vLumFilterSize; i++) {
-                *(const void**)&lumMmxFilter[4*i+0]= lumSrcPtr[i];
-                lumMmxFilter[4*i+2]=
-                lumMmxFilter[4*i+3]=
-                ((uint16_t)vLumFilter[dstY*vLumFilterSize + i])*0x10001;
-                if (CONFIG_SWSCALE_ALPHA && alpPixBuf) {
-                    *(const void**)&alpMmxFilter[4*i+0]= alpSrcPtr[i];
-                    alpMmxFilter[4*i+2]=
-                    alpMmxFilter[4*i+3]= lumMmxFilter[4*i+2];
-                }
-            }
-            for (i=0; i<vChrFilterSize; i++) {
-                *(const void**)&chrMmxFilter[4*i+0]= chrUSrcPtr[i];
-                chrMmxFilter[4*i+2]=
-                chrMmxFilter[4*i+3]=
-                ((uint16_t)vChrFilter[chrDstY*vChrFilterSize + i])*0x10001;
-            }
-        }
-    }
-}
-
-#endif /* HAVE_INLINE_ASM */
-
-#define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \
-void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \
-                                                SwsContext *c, int16_t *data, \
-                                                int dstW, const uint8_t *src, \
-                                                const int16_t *filter, \
-                                                const int32_t *filterPos, int filterSize)
-
-#define SCALE_FUNCS(filter_n, opt) \
-    SCALE_FUNC(filter_n,  8, 15, opt); \
-    SCALE_FUNC(filter_n,  9, 15, opt); \
-    SCALE_FUNC(filter_n, 10, 15, opt); \
-    SCALE_FUNC(filter_n, 16, 15, opt); \
-    SCALE_FUNC(filter_n,  8, 19, opt); \
-    SCALE_FUNC(filter_n,  9, 19, opt); \
-    SCALE_FUNC(filter_n, 10, 19, opt); \
-    SCALE_FUNC(filter_n, 16, 19, opt)
-
-#define SCALE_FUNCS_MMX(opt) \
-    SCALE_FUNCS(4, opt); \
-    SCALE_FUNCS(8, opt); \
-    SCALE_FUNCS(X, opt)
-
-#define SCALE_FUNCS_SSE(opt) \
-    SCALE_FUNCS(4, opt); \
-    SCALE_FUNCS(8, opt); \
-    SCALE_FUNCS(X4, opt); \
-    SCALE_FUNCS(X8, opt)
-
-#if ARCH_X86_32
-SCALE_FUNCS_MMX(mmx);
-#endif
-SCALE_FUNCS_SSE(sse2);
-SCALE_FUNCS_SSE(ssse3);
-SCALE_FUNCS_SSE(sse4);
-
-#define VSCALEX_FUNC(size, opt) \
-void ff_yuv2planeX_ ## size ## _ ## opt(const int16_t *filter, int filterSize, \
-                                        const int16_t **src, uint8_t *dest, int dstW, \
-                                        const uint8_t *dither, int offset)
-#define VSCALEX_FUNCS(opt) \
-    VSCALEX_FUNC(8,  opt); \
-    VSCALEX_FUNC(9,  opt); \
-    VSCALEX_FUNC(10, opt)
-
-#if ARCH_X86_32
-VSCALEX_FUNCS(mmxext);
-#endif
-VSCALEX_FUNCS(sse2);
-VSCALEX_FUNCS(sse4);
-VSCALEX_FUNC(16, sse4);
-VSCALEX_FUNCS(avx);
-
-#define VSCALE_FUNC(size, opt) \
-void ff_yuv2plane1_ ## size ## _ ## opt(const int16_t *src, uint8_t *dst, int dstW, \
-                                        const uint8_t *dither, int offset)
-#define VSCALE_FUNCS(opt1, opt2) \
-    VSCALE_FUNC(8,  opt1); \
-    VSCALE_FUNC(9,  opt2); \
-    VSCALE_FUNC(10, opt2); \
-    VSCALE_FUNC(16, opt1)
-
-#if ARCH_X86_32
-VSCALE_FUNCS(mmx, mmxext);
-#endif
-VSCALE_FUNCS(sse2, sse2);
-VSCALE_FUNC(16, sse4);
-VSCALE_FUNCS(avx, avx);
-
-#define INPUT_Y_FUNC(fmt, opt) \
-void ff_ ## fmt ## ToY_  ## opt(uint8_t *dst, const uint8_t *src, \
-                                int w, uint32_t *unused)
-#define INPUT_UV_FUNC(fmt, opt) \
-void ff_ ## fmt ## ToUV_ ## opt(uint8_t *dstU, uint8_t *dstV, \
-                                const uint8_t *src, const uint8_t *unused1, \
-                                int w, uint32_t *unused2)
-#define INPUT_FUNC(fmt, opt) \
-    INPUT_Y_FUNC(fmt, opt); \
-    INPUT_UV_FUNC(fmt, opt)
-#define INPUT_FUNCS(opt) \
-    INPUT_FUNC(uyvy, opt); \
-    INPUT_FUNC(yuyv, opt); \
-    INPUT_UV_FUNC(nv12, opt); \
-    INPUT_UV_FUNC(nv21, opt); \
-    INPUT_FUNC(rgba, opt); \
-    INPUT_FUNC(bgra, opt); \
-    INPUT_FUNC(argb, opt); \
-    INPUT_FUNC(abgr, opt); \
-    INPUT_FUNC(rgb24, opt); \
-    INPUT_FUNC(bgr24, opt)
-
-#if ARCH_X86_32
-INPUT_FUNCS(mmx);
-#endif
-INPUT_FUNCS(sse2);
-INPUT_FUNCS(ssse3);
-INPUT_FUNCS(avx);
-
-av_cold void ff_sws_init_swscale_x86(SwsContext *c)
-{
-    int cpu_flags = av_get_cpu_flags();
-
-#if HAVE_MMX_INLINE
-    if (INLINE_MMX(cpu_flags))
-        sws_init_swscale_mmx(c);
-#endif
-#if HAVE_MMXEXT_INLINE
-    if (INLINE_MMXEXT(cpu_flags))
-        sws_init_swscale_mmxext(c);
-#endif
-
-#define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2) do { \
-    if (c->srcBpc == 8) { \
-        hscalefn = c->dstBpc <= 10 ? ff_hscale8to15_ ## filtersize ## _ ## opt2 : \
-                                     ff_hscale8to19_ ## filtersize ## _ ## opt1; \
-    } else if (c->srcBpc == 9) { \
-        hscalefn = c->dstBpc <= 10 ? ff_hscale9to15_ ## filtersize ## _ ## opt2 : \
-                                     ff_hscale9to19_ ## filtersize ## _ ## opt1; \
-    } else if (c->srcBpc == 10) { \
-        hscalefn = c->dstBpc <= 10 ? ff_hscale10to15_ ## filtersize ## _ ## opt2 : \
-                                     ff_hscale10to19_ ## filtersize ## _ ## opt1; \
-    } else /* c->srcBpc == 16 */ { \
-        hscalefn = c->dstBpc <= 10 ? ff_hscale16to15_ ## filtersize ## _ ## opt2 : \
-                                     ff_hscale16to19_ ## filtersize ## _ ## opt1; \
-    } \
-} while (0)
-#define ASSIGN_MMX_SCALE_FUNC(hscalefn, filtersize, opt1, opt2) \
-    switch (filtersize) { \
-    case 4:  ASSIGN_SCALE_FUNC2(hscalefn, 4, opt1, opt2); break; \
-    case 8:  ASSIGN_SCALE_FUNC2(hscalefn, 8, opt1, opt2); break; \
-    default: ASSIGN_SCALE_FUNC2(hscalefn, X, opt1, opt2); break; \
-    }
-#define ASSIGN_VSCALEX_FUNC(vscalefn, opt, do_16_case, condition_8bit) \
-switch(c->dstBpc){ \
-    case 16:                          do_16_case;                          break; \
-    case 10: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_10_ ## opt; break; \
-    case 9:  if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_9_  ## opt; break; \
-    default: if (condition_8bit)      vscalefn = ff_yuv2planeX_8_  ## opt; break; \
-    }
-#define ASSIGN_VSCALE_FUNC(vscalefn, opt1, opt2, opt2chk) \
-    switch(c->dstBpc){ \
-    case 16: if (!isBE(c->dstFormat))            vscalefn = ff_yuv2plane1_16_ ## opt1; break; \
-    case 10: if (!isBE(c->dstFormat) && opt2chk) vscalefn = ff_yuv2plane1_10_ ## opt2; break; \
-    case 9:  if (!isBE(c->dstFormat) && opt2chk) vscalefn = ff_yuv2plane1_9_  ## opt2;  break; \
-    default:                                     vscalefn = ff_yuv2plane1_8_  ## opt1;  break; \
-    }
-#define case_rgb(x, X, opt) \
-        case AV_PIX_FMT_ ## X: \
-            c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \
-            if (!c->chrSrcHSubSample) \
-                c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \
-            break
-#if ARCH_X86_32
-    if (EXTERNAL_MMX(cpu_flags)) {
-        ASSIGN_MMX_SCALE_FUNC(c->hyScale, c->hLumFilterSize, mmx, mmx);
-        ASSIGN_MMX_SCALE_FUNC(c->hcScale, c->hChrFilterSize, mmx, mmx);
-        ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmxext, cpu_flags & AV_CPU_FLAG_MMXEXT);
-
-        switch (c->srcFormat) {
-        case AV_PIX_FMT_Y400A:
-            c->lumToYV12 = ff_yuyvToY_mmx;
-            if (c->alpPixBuf)
-                c->alpToYV12 = ff_uyvyToY_mmx;
-            break;
-        case AV_PIX_FMT_YUYV422:
-            c->lumToYV12 = ff_yuyvToY_mmx;
-            c->chrToYV12 = ff_yuyvToUV_mmx;
-            break;
-        case AV_PIX_FMT_UYVY422:
-            c->lumToYV12 = ff_uyvyToY_mmx;
-            c->chrToYV12 = ff_uyvyToUV_mmx;
-            break;
-        case AV_PIX_FMT_NV12:
-            c->chrToYV12 = ff_nv12ToUV_mmx;
-            break;
-        case AV_PIX_FMT_NV21:
-            c->chrToYV12 = ff_nv21ToUV_mmx;
-            break;
-        case_rgb(rgb24, RGB24, mmx);
-        case_rgb(bgr24, BGR24, mmx);
-        case_rgb(bgra,  BGRA,  mmx);
-        case_rgb(rgba,  RGBA,  mmx);
-        case_rgb(abgr,  ABGR,  mmx);
-        case_rgb(argb,  ARGB,  mmx);
-        default:
-            break;
-        }
-    }
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        ASSIGN_VSCALEX_FUNC(c->yuv2planeX, mmxext, , 1);
-    }
-#endif /* ARCH_X86_32 */
-#define ASSIGN_SSE_SCALE_FUNC(hscalefn, filtersize, opt1, opt2) \
-    switch (filtersize) { \
-    case 4:  ASSIGN_SCALE_FUNC2(hscalefn, 4, opt1, opt2); break; \
-    case 8:  ASSIGN_SCALE_FUNC2(hscalefn, 8, opt1, opt2); break; \
-    default: if (filtersize & 4) ASSIGN_SCALE_FUNC2(hscalefn, X4, opt1, opt2); \
-             else                ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \
-             break; \
-    }
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2);
-        ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2);
-        ASSIGN_VSCALEX_FUNC(c->yuv2planeX, sse2, ,
-                            HAVE_ALIGNED_STACK || ARCH_X86_64);
-        ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2, sse2, 1);
-
-        switch (c->srcFormat) {
-        case AV_PIX_FMT_Y400A:
-            c->lumToYV12 = ff_yuyvToY_sse2;
-            if (c->alpPixBuf)
-                c->alpToYV12 = ff_uyvyToY_sse2;
-            break;
-        case AV_PIX_FMT_YUYV422:
-            c->lumToYV12 = ff_yuyvToY_sse2;
-            c->chrToYV12 = ff_yuyvToUV_sse2;
-            break;
-        case AV_PIX_FMT_UYVY422:
-            c->lumToYV12 = ff_uyvyToY_sse2;
-            c->chrToYV12 = ff_uyvyToUV_sse2;
-            break;
-        case AV_PIX_FMT_NV12:
-            c->chrToYV12 = ff_nv12ToUV_sse2;
-            break;
-        case AV_PIX_FMT_NV21:
-            c->chrToYV12 = ff_nv21ToUV_sse2;
-            break;
-        case_rgb(rgb24, RGB24, sse2);
-        case_rgb(bgr24, BGR24, sse2);
-        case_rgb(bgra,  BGRA,  sse2);
-        case_rgb(rgba,  RGBA,  sse2);
-        case_rgb(abgr,  ABGR,  sse2);
-        case_rgb(argb,  ARGB,  sse2);
-        default:
-            break;
-        }
-    }
-    if (EXTERNAL_SSSE3(cpu_flags)) {
-        ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, ssse3, ssse3);
-        ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, ssse3, ssse3);
-        switch (c->srcFormat) {
-        case_rgb(rgb24, RGB24, ssse3);
-        case_rgb(bgr24, BGR24, ssse3);
-        default:
-            break;
-        }
-    }
-    if (EXTERNAL_SSE4(cpu_flags)) {
-        /* Xto15 don't need special sse4 functions */
-        ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse4, ssse3);
-        ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse4, ssse3);
-        ASSIGN_VSCALEX_FUNC(c->yuv2planeX, sse4,
-                            if (!isBE(c->dstFormat)) c->yuv2planeX = ff_yuv2planeX_16_sse4,
-                            HAVE_ALIGNED_STACK || ARCH_X86_64);
-        if (c->dstBpc == 16 && !isBE(c->dstFormat))
-            c->yuv2plane1 = ff_yuv2plane1_16_sse4;
-    }
-
-    if (EXTERNAL_AVX(cpu_flags)) {
-        ASSIGN_VSCALEX_FUNC(c->yuv2planeX, avx, ,
-                            HAVE_ALIGNED_STACK || ARCH_X86_64);
-        ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx, avx, 1);
-
-        switch (c->srcFormat) {
-        case AV_PIX_FMT_YUYV422:
-            c->chrToYV12 = ff_yuyvToUV_avx;
-            break;
-        case AV_PIX_FMT_UYVY422:
-            c->chrToYV12 = ff_uyvyToUV_avx;
-            break;
-        case AV_PIX_FMT_NV12:
-            c->chrToYV12 = ff_nv12ToUV_avx;
-            break;
-        case AV_PIX_FMT_NV21:
-            c->chrToYV12 = ff_nv21ToUV_avx;
-            break;
-        case_rgb(rgb24, RGB24, avx);
-        case_rgb(bgr24, BGR24, avx);
-        case_rgb(bgra,  BGRA,  avx);
-        case_rgb(rgba,  RGBA,  avx);
-        case_rgb(abgr,  ABGR,  avx);
-        case_rgb(argb,  ARGB,  avx);
-        default:
-            break;
-        }
-    }
-}
diff --git a/deps/libav/libswscale/x86/swscale_template.c b/deps/libav/libswscale/x86/swscale_template.c
deleted file mode 100644
index 80a3ad9..0000000
--- a/deps/libav/libswscale/x86/swscale_template.c
+++ /dev/null
@@ -1,1631 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#undef REAL_MOVNTQ
-#undef MOVNTQ
-#undef PREFETCH
-
-#if COMPILE_TEMPLATE_MMXEXT
-#define PREFETCH "prefetchnta"
-#else
-#define PREFETCH  " # nop"
-#endif
-
-#if COMPILE_TEMPLATE_MMXEXT
-#define REAL_MOVNTQ(a,b) "movntq " #a ", " #b " \n\t"
-#else
-#define REAL_MOVNTQ(a,b) "movq " #a ", " #b " \n\t"
-#endif
-#define MOVNTQ(a,b)  REAL_MOVNTQ(a,b)
-
-#define YSCALEYUV2PACKEDX_UV \
-    __asm__ volatile(\
-        "xor                   %%"REG_a", %%"REG_a"     \n\t"\
-        ".p2align                      4                \n\t"\
-        "nop                                            \n\t"\
-        "1:                                             \n\t"\
-        "lea "CHR_MMX_FILTER_OFFSET"(%0), %%"REG_d"     \n\t"\
-        "mov                 (%%"REG_d"), %%"REG_S"     \n\t"\
-        "movq      "VROUNDER_OFFSET"(%0), %%mm3         \n\t"\
-        "movq                      %%mm3, %%mm4         \n\t"\
-        ".p2align                      4                \n\t"\
-        "2:                                             \n\t"\
-        "movq               8(%%"REG_d"), %%mm0         \n\t" /* filterCoeff */\
-        "movq     (%%"REG_S", %%"REG_a"), %%mm2         \n\t" /* UsrcData */\
-        "add                          %6, %%"REG_S"     \n\t" \
-        "movq     (%%"REG_S", %%"REG_a"), %%mm5         \n\t" /* VsrcData */\
-        "add                         $16, %%"REG_d"     \n\t"\
-        "mov                 (%%"REG_d"), %%"REG_S"     \n\t"\
-        "pmulhw                    %%mm0, %%mm2         \n\t"\
-        "pmulhw                    %%mm0, %%mm5         \n\t"\
-        "paddw                     %%mm2, %%mm3         \n\t"\
-        "paddw                     %%mm5, %%mm4         \n\t"\
-        "test                  %%"REG_S", %%"REG_S"     \n\t"\
-        " jnz                         2b                \n\t"\
-
-#define YSCALEYUV2PACKEDX_YA(offset,coeff,src1,src2,dst1,dst2) \
-    "lea                "offset"(%0), %%"REG_d"     \n\t"\
-    "mov                 (%%"REG_d"), %%"REG_S"     \n\t"\
-    "movq      "VROUNDER_OFFSET"(%0), "#dst1"       \n\t"\
-    "movq                    "#dst1", "#dst2"       \n\t"\
-    ".p2align                      4                \n\t"\
-    "2:                                             \n\t"\
-    "movq               8(%%"REG_d"), "#coeff"      \n\t" /* filterCoeff */\
-    "movq  (%%"REG_S", %%"REG_a", 2), "#src1"       \n\t" /* Y1srcData */\
-    "movq 8(%%"REG_S", %%"REG_a", 2), "#src2"       \n\t" /* Y2srcData */\
-    "add                         $16, %%"REG_d"            \n\t"\
-    "mov                 (%%"REG_d"), %%"REG_S"     \n\t"\
-    "pmulhw                 "#coeff", "#src1"       \n\t"\
-    "pmulhw                 "#coeff", "#src2"       \n\t"\
-    "paddw                   "#src1", "#dst1"       \n\t"\
-    "paddw                   "#src2", "#dst2"       \n\t"\
-    "test                  %%"REG_S", %%"REG_S"     \n\t"\
-    " jnz                         2b                \n\t"\
-
-#define YSCALEYUV2PACKEDX \
-    YSCALEYUV2PACKEDX_UV \
-    YSCALEYUV2PACKEDX_YA(LUM_MMX_FILTER_OFFSET,%%mm0,%%mm2,%%mm5,%%mm1,%%mm7) \
-
-#define YSCALEYUV2PACKEDX_END                     \
-        :: "r" (&c->redDither),                   \
-            "m" (dummy), "m" (dummy), "m" (dummy),\
-            "r" (dest), "m" (dstW_reg), "m"(uv_off) \
-        : "%"REG_a, "%"REG_d, "%"REG_S            \
-    );
-
-#define YSCALEYUV2PACKEDX_ACCURATE_UV \
-    __asm__ volatile(\
-        "xor %%"REG_a", %%"REG_a"                       \n\t"\
-        ".p2align                      4                \n\t"\
-        "nop                                            \n\t"\
-        "1:                                             \n\t"\
-        "lea "CHR_MMX_FILTER_OFFSET"(%0), %%"REG_d"     \n\t"\
-        "mov                 (%%"REG_d"), %%"REG_S"     \n\t"\
-        "pxor                      %%mm4, %%mm4         \n\t"\
-        "pxor                      %%mm5, %%mm5         \n\t"\
-        "pxor                      %%mm6, %%mm6         \n\t"\
-        "pxor                      %%mm7, %%mm7         \n\t"\
-        ".p2align                      4                \n\t"\
-        "2:                                             \n\t"\
-        "movq     (%%"REG_S", %%"REG_a"), %%mm0         \n\t" /* UsrcData */\
-        "add                          %6, %%"REG_S"      \n\t" \
-        "movq     (%%"REG_S", %%"REG_a"), %%mm2         \n\t" /* VsrcData */\
-        "mov "STR(APCK_PTR2)"(%%"REG_d"), %%"REG_S"     \n\t"\
-        "movq     (%%"REG_S", %%"REG_a"), %%mm1         \n\t" /* UsrcData */\
-        "movq                      %%mm0, %%mm3         \n\t"\
-        "punpcklwd                 %%mm1, %%mm0         \n\t"\
-        "punpckhwd                 %%mm1, %%mm3         \n\t"\
-        "movq "STR(APCK_COEF)"(%%"REG_d"),%%mm1         \n\t" /* filterCoeff */\
-        "pmaddwd                   %%mm1, %%mm0         \n\t"\
-        "pmaddwd                   %%mm1, %%mm3         \n\t"\
-        "paddd                     %%mm0, %%mm4         \n\t"\
-        "paddd                     %%mm3, %%mm5         \n\t"\
-        "add                          %6, %%"REG_S"      \n\t" \
-        "movq     (%%"REG_S", %%"REG_a"), %%mm3         \n\t" /* VsrcData */\
-        "mov "STR(APCK_SIZE)"(%%"REG_d"), %%"REG_S"     \n\t"\
-        "add           $"STR(APCK_SIZE)", %%"REG_d"     \n\t"\
-        "test                  %%"REG_S", %%"REG_S"     \n\t"\
-        "movq                      %%mm2, %%mm0         \n\t"\
-        "punpcklwd                 %%mm3, %%mm2         \n\t"\
-        "punpckhwd                 %%mm3, %%mm0         \n\t"\
-        "pmaddwd                   %%mm1, %%mm2         \n\t"\
-        "pmaddwd                   %%mm1, %%mm0         \n\t"\
-        "paddd                     %%mm2, %%mm6         \n\t"\
-        "paddd                     %%mm0, %%mm7         \n\t"\
-        " jnz                         2b                \n\t"\
-        "psrad                       $16, %%mm4         \n\t"\
-        "psrad                       $16, %%mm5         \n\t"\
-        "psrad                       $16, %%mm6         \n\t"\
-        "psrad                       $16, %%mm7         \n\t"\
-        "movq      "VROUNDER_OFFSET"(%0), %%mm0         \n\t"\
-        "packssdw                  %%mm5, %%mm4         \n\t"\
-        "packssdw                  %%mm7, %%mm6         \n\t"\
-        "paddw                     %%mm0, %%mm4         \n\t"\
-        "paddw                     %%mm0, %%mm6         \n\t"\
-        "movq                      %%mm4, "U_TEMP"(%0)  \n\t"\
-        "movq                      %%mm6, "V_TEMP"(%0)  \n\t"\
-
-#define YSCALEYUV2PACKEDX_ACCURATE_YA(offset) \
-    "lea                "offset"(%0), %%"REG_d"     \n\t"\
-    "mov                 (%%"REG_d"), %%"REG_S"     \n\t"\
-    "pxor                      %%mm1, %%mm1         \n\t"\
-    "pxor                      %%mm5, %%mm5         \n\t"\
-    "pxor                      %%mm7, %%mm7         \n\t"\
-    "pxor                      %%mm6, %%mm6         \n\t"\
-    ".p2align                      4                \n\t"\
-    "2:                                             \n\t"\
-    "movq  (%%"REG_S", %%"REG_a", 2), %%mm0         \n\t" /* Y1srcData */\
-    "movq 8(%%"REG_S", %%"REG_a", 2), %%mm2         \n\t" /* Y2srcData */\
-    "mov "STR(APCK_PTR2)"(%%"REG_d"), %%"REG_S"     \n\t"\
-    "movq  (%%"REG_S", %%"REG_a", 2), %%mm4         \n\t" /* Y1srcData */\
-    "movq                      %%mm0, %%mm3         \n\t"\
-    "punpcklwd                 %%mm4, %%mm0         \n\t"\
-    "punpckhwd                 %%mm4, %%mm3         \n\t"\
-    "movq "STR(APCK_COEF)"(%%"REG_d"), %%mm4         \n\t" /* filterCoeff */\
-    "pmaddwd                   %%mm4, %%mm0         \n\t"\
-    "pmaddwd                   %%mm4, %%mm3         \n\t"\
-    "paddd                     %%mm0, %%mm1         \n\t"\
-    "paddd                     %%mm3, %%mm5         \n\t"\
-    "movq 8(%%"REG_S", %%"REG_a", 2), %%mm3         \n\t" /* Y2srcData */\
-    "mov "STR(APCK_SIZE)"(%%"REG_d"), %%"REG_S"     \n\t"\
-    "add           $"STR(APCK_SIZE)", %%"REG_d"     \n\t"\
-    "test                  %%"REG_S", %%"REG_S"     \n\t"\
-    "movq                      %%mm2, %%mm0         \n\t"\
-    "punpcklwd                 %%mm3, %%mm2         \n\t"\
-    "punpckhwd                 %%mm3, %%mm0         \n\t"\
-    "pmaddwd                   %%mm4, %%mm2         \n\t"\
-    "pmaddwd                   %%mm4, %%mm0         \n\t"\
-    "paddd                     %%mm2, %%mm7         \n\t"\
-    "paddd                     %%mm0, %%mm6         \n\t"\
-    " jnz                         2b                \n\t"\
-    "psrad                       $16, %%mm1         \n\t"\
-    "psrad                       $16, %%mm5         \n\t"\
-    "psrad                       $16, %%mm7         \n\t"\
-    "psrad                       $16, %%mm6         \n\t"\
-    "movq      "VROUNDER_OFFSET"(%0), %%mm0         \n\t"\
-    "packssdw                  %%mm5, %%mm1         \n\t"\
-    "packssdw                  %%mm6, %%mm7         \n\t"\
-    "paddw                     %%mm0, %%mm1         \n\t"\
-    "paddw                     %%mm0, %%mm7         \n\t"\
-    "movq               "U_TEMP"(%0), %%mm3         \n\t"\
-    "movq               "V_TEMP"(%0), %%mm4         \n\t"\
-
-#define YSCALEYUV2PACKEDX_ACCURATE \
-    YSCALEYUV2PACKEDX_ACCURATE_UV \
-    YSCALEYUV2PACKEDX_ACCURATE_YA(LUM_MMX_FILTER_OFFSET)
-
-#define YSCALEYUV2RGBX \
-    "psubw  "U_OFFSET"(%0), %%mm3       \n\t" /* (U-128)8*/\
-    "psubw  "V_OFFSET"(%0), %%mm4       \n\t" /* (V-128)8*/\
-    "movq            %%mm3, %%mm2       \n\t" /* (U-128)8*/\
-    "movq            %%mm4, %%mm5       \n\t" /* (V-128)8*/\
-    "pmulhw "UG_COEFF"(%0), %%mm3       \n\t"\
-    "pmulhw "VG_COEFF"(%0), %%mm4       \n\t"\
-    /* mm2=(U-128)8, mm3=ug, mm4=vg mm5=(V-128)8 */\
-    "pmulhw "UB_COEFF"(%0), %%mm2       \n\t"\
-    "pmulhw "VR_COEFF"(%0), %%mm5       \n\t"\
-    "psubw  "Y_OFFSET"(%0), %%mm1       \n\t" /* 8(Y-16)*/\
-    "psubw  "Y_OFFSET"(%0), %%mm7       \n\t" /* 8(Y-16)*/\
-    "pmulhw  "Y_COEFF"(%0), %%mm1       \n\t"\
-    "pmulhw  "Y_COEFF"(%0), %%mm7       \n\t"\
-    /* mm1= Y1, mm2=ub, mm3=ug, mm4=vg mm5=vr, mm7=Y2 */\
-    "paddw           %%mm3, %%mm4       \n\t"\
-    "movq            %%mm2, %%mm0       \n\t"\
-    "movq            %%mm5, %%mm6       \n\t"\
-    "movq            %%mm4, %%mm3       \n\t"\
-    "punpcklwd       %%mm2, %%mm2       \n\t"\
-    "punpcklwd       %%mm5, %%mm5       \n\t"\
-    "punpcklwd       %%mm4, %%mm4       \n\t"\
-    "paddw           %%mm1, %%mm2       \n\t"\
-    "paddw           %%mm1, %%mm5       \n\t"\
-    "paddw           %%mm1, %%mm4       \n\t"\
-    "punpckhwd       %%mm0, %%mm0       \n\t"\
-    "punpckhwd       %%mm6, %%mm6       \n\t"\
-    "punpckhwd       %%mm3, %%mm3       \n\t"\
-    "paddw           %%mm7, %%mm0       \n\t"\
-    "paddw           %%mm7, %%mm6       \n\t"\
-    "paddw           %%mm7, %%mm3       \n\t"\
-    /* mm0=B1, mm2=B2, mm3=G2, mm4=G1, mm5=R1, mm6=R2 */\
-    "packuswb        %%mm0, %%mm2       \n\t"\
-    "packuswb        %%mm6, %%mm5       \n\t"\
-    "packuswb        %%mm3, %%mm4       \n\t"\
-
-#define REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) \
-    "movq       "#b", "#q2"     \n\t" /* B */\
-    "movq       "#r", "#t"      \n\t" /* R */\
-    "punpcklbw  "#g", "#b"      \n\t" /* GBGBGBGB 0 */\
-    "punpcklbw  "#a", "#r"      \n\t" /* ARARARAR 0 */\
-    "punpckhbw  "#g", "#q2"     \n\t" /* GBGBGBGB 2 */\
-    "punpckhbw  "#a", "#t"      \n\t" /* ARARARAR 2 */\
-    "movq       "#b", "#q0"     \n\t" /* GBGBGBGB 0 */\
-    "movq      "#q2", "#q3"     \n\t" /* GBGBGBGB 2 */\
-    "punpcklwd  "#r", "#q0"     \n\t" /* ARGBARGB 0 */\
-    "punpckhwd  "#r", "#b"      \n\t" /* ARGBARGB 1 */\
-    "punpcklwd  "#t", "#q2"     \n\t" /* ARGBARGB 2 */\
-    "punpckhwd  "#t", "#q3"     \n\t" /* ARGBARGB 3 */\
-\
-    MOVNTQ(   q0,   (dst, index, 4))\
-    MOVNTQ(    b,  8(dst, index, 4))\
-    MOVNTQ(   q2, 16(dst, index, 4))\
-    MOVNTQ(   q3, 24(dst, index, 4))\
-\
-    "add      $8, "#index"      \n\t"\
-    "cmp "#dstw", "#index"      \n\t"\
-    " jb      1b                \n\t"
-#define WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t)  REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t)
-
-static void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter,
-                                   const int16_t **lumSrc, int lumFilterSize,
-                                   const int16_t *chrFilter, const int16_t **chrUSrc,
-                                   const int16_t **chrVSrc,
-                                   int chrFilterSize, const int16_t **alpSrc,
-                                   uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) {
-        YSCALEYUV2PACKEDX_ACCURATE
-        YSCALEYUV2RGBX
-        "movq                      %%mm2, "U_TEMP"(%0)  \n\t"
-        "movq                      %%mm4, "V_TEMP"(%0)  \n\t"
-        "movq                      %%mm5, "Y_TEMP"(%0)  \n\t"
-        YSCALEYUV2PACKEDX_ACCURATE_YA(ALP_MMX_FILTER_OFFSET)
-        "movq               "Y_TEMP"(%0), %%mm5         \n\t"
-        "psraw                        $3, %%mm1         \n\t"
-        "psraw                        $3, %%mm7         \n\t"
-        "packuswb                  %%mm7, %%mm1         \n\t"
-        WRITEBGR32(%4, %5, %%REGa, %%mm3, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm2, %%mm6)
-        YSCALEYUV2PACKEDX_END
-    } else {
-        YSCALEYUV2PACKEDX_ACCURATE
-        YSCALEYUV2RGBX
-        "pcmpeqd %%mm7, %%mm7 \n\t"
-        WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
-        YSCALEYUV2PACKEDX_END
-    }
-}
-
-static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
-                                const int16_t **lumSrc, int lumFilterSize,
-                                const int16_t *chrFilter, const int16_t **chrUSrc,
-                                const int16_t **chrVSrc,
-                                int chrFilterSize, const int16_t **alpSrc,
-                                uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) {
-        YSCALEYUV2PACKEDX
-        YSCALEYUV2RGBX
-        YSCALEYUV2PACKEDX_YA(ALP_MMX_FILTER_OFFSET, %%mm0, %%mm3, %%mm6, %%mm1, %%mm7)
-        "psraw                        $3, %%mm1         \n\t"
-        "psraw                        $3, %%mm7         \n\t"
-        "packuswb                  %%mm7, %%mm1         \n\t"
-        WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
-        YSCALEYUV2PACKEDX_END
-    } else {
-        YSCALEYUV2PACKEDX
-        YSCALEYUV2RGBX
-        "pcmpeqd %%mm7, %%mm7 \n\t"
-        WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
-        YSCALEYUV2PACKEDX_END
-    }
-}
-
-#define REAL_WRITERGB16(dst, dstw, index) \
-    "pand "MANGLE(bF8)", %%mm2  \n\t" /* B */\
-    "pand "MANGLE(bFC)", %%mm4  \n\t" /* G */\
-    "pand "MANGLE(bF8)", %%mm5  \n\t" /* R */\
-    "psrlq           $3, %%mm2  \n\t"\
-\
-    "movq         %%mm2, %%mm1  \n\t"\
-    "movq         %%mm4, %%mm3  \n\t"\
-\
-    "punpcklbw    %%mm7, %%mm3  \n\t"\
-    "punpcklbw    %%mm5, %%mm2  \n\t"\
-    "punpckhbw    %%mm7, %%mm4  \n\t"\
-    "punpckhbw    %%mm5, %%mm1  \n\t"\
-\
-    "psllq           $3, %%mm3  \n\t"\
-    "psllq           $3, %%mm4  \n\t"\
-\
-    "por          %%mm3, %%mm2  \n\t"\
-    "por          %%mm4, %%mm1  \n\t"\
-\
-    MOVNTQ(%%mm2,  (dst, index, 2))\
-    MOVNTQ(%%mm1, 8(dst, index, 2))\
-\
-    "add             $8, "#index"   \n\t"\
-    "cmp        "#dstw", "#index"   \n\t"\
-    " jb             1b             \n\t"
-#define WRITERGB16(dst, dstw, index)  REAL_WRITERGB16(dst, dstw, index)
-
-static void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter,
-                                    const int16_t **lumSrc, int lumFilterSize,
-                                    const int16_t *chrFilter, const int16_t **chrUSrc,
-                                    const int16_t **chrVSrc,
-                                    int chrFilterSize, const int16_t **alpSrc,
-                                    uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    YSCALEYUV2PACKEDX_ACCURATE
-    YSCALEYUV2RGBX
-    "pxor %%mm7, %%mm7 \n\t"
-    /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-    "paddusb "BLUE_DITHER"(%0), %%mm2\n\t"
-    "paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
-    "paddusb "RED_DITHER"(%0), %%mm5\n\t"
-#endif
-    WRITERGB16(%4, %5, %%REGa)
-    YSCALEYUV2PACKEDX_END
-}
-
-static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
-                                 const int16_t **lumSrc, int lumFilterSize,
-                                 const int16_t *chrFilter, const int16_t **chrUSrc,
-                                 const int16_t **chrVSrc,
-                                 int chrFilterSize, const int16_t **alpSrc,
-                                 uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    YSCALEYUV2PACKEDX
-    YSCALEYUV2RGBX
-    "pxor %%mm7, %%mm7 \n\t"
-    /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-    "paddusb "BLUE_DITHER"(%0), %%mm2  \n\t"
-    "paddusb "GREEN_DITHER"(%0), %%mm4  \n\t"
-    "paddusb "RED_DITHER"(%0), %%mm5  \n\t"
-#endif
-    WRITERGB16(%4, %5, %%REGa)
-    YSCALEYUV2PACKEDX_END
-}
-
-#define REAL_WRITERGB15(dst, dstw, index) \
-    "pand "MANGLE(bF8)", %%mm2  \n\t" /* B */\
-    "pand "MANGLE(bF8)", %%mm4  \n\t" /* G */\
-    "pand "MANGLE(bF8)", %%mm5  \n\t" /* R */\
-    "psrlq           $3, %%mm2  \n\t"\
-    "psrlq           $1, %%mm5  \n\t"\
-\
-    "movq         %%mm2, %%mm1  \n\t"\
-    "movq         %%mm4, %%mm3  \n\t"\
-\
-    "punpcklbw    %%mm7, %%mm3  \n\t"\
-    "punpcklbw    %%mm5, %%mm2  \n\t"\
-    "punpckhbw    %%mm7, %%mm4  \n\t"\
-    "punpckhbw    %%mm5, %%mm1  \n\t"\
-\
-    "psllq           $2, %%mm3  \n\t"\
-    "psllq           $2, %%mm4  \n\t"\
-\
-    "por          %%mm3, %%mm2  \n\t"\
-    "por          %%mm4, %%mm1  \n\t"\
-\
-    MOVNTQ(%%mm2,  (dst, index, 2))\
-    MOVNTQ(%%mm1, 8(dst, index, 2))\
-\
-    "add             $8, "#index"   \n\t"\
-    "cmp        "#dstw", "#index"   \n\t"\
-    " jb             1b             \n\t"
-#define WRITERGB15(dst, dstw, index)  REAL_WRITERGB15(dst, dstw, index)
-
-static void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter,
-                                    const int16_t **lumSrc, int lumFilterSize,
-                                    const int16_t *chrFilter, const int16_t **chrUSrc,
-                                    const int16_t **chrVSrc,
-                                    int chrFilterSize, const int16_t **alpSrc,
-                                    uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    YSCALEYUV2PACKEDX_ACCURATE
-    YSCALEYUV2RGBX
-    "pxor %%mm7, %%mm7 \n\t"
-    /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-    "paddusb "BLUE_DITHER"(%0), %%mm2\n\t"
-    "paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
-    "paddusb "RED_DITHER"(%0), %%mm5\n\t"
-#endif
-    WRITERGB15(%4, %5, %%REGa)
-    YSCALEYUV2PACKEDX_END
-}
-
-static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
-                                 const int16_t **lumSrc, int lumFilterSize,
-                                 const int16_t *chrFilter, const int16_t **chrUSrc,
-                                 const int16_t **chrVSrc,
-                                 int chrFilterSize, const int16_t **alpSrc,
-                                 uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    YSCALEYUV2PACKEDX
-    YSCALEYUV2RGBX
-    "pxor %%mm7, %%mm7 \n\t"
-    /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-    "paddusb "BLUE_DITHER"(%0), %%mm2  \n\t"
-    "paddusb "GREEN_DITHER"(%0), %%mm4  \n\t"
-    "paddusb "RED_DITHER"(%0), %%mm5  \n\t"
-#endif
-    WRITERGB15(%4, %5, %%REGa)
-    YSCALEYUV2PACKEDX_END
-}
-
-#define WRITEBGR24MMX(dst, dstw, index) \
-    /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\
-    "movq      %%mm2, %%mm1     \n\t" /* B */\
-    "movq      %%mm5, %%mm6     \n\t" /* R */\
-    "punpcklbw %%mm4, %%mm2     \n\t" /* GBGBGBGB 0 */\
-    "punpcklbw %%mm7, %%mm5     \n\t" /* 0R0R0R0R 0 */\
-    "punpckhbw %%mm4, %%mm1     \n\t" /* GBGBGBGB 2 */\
-    "punpckhbw %%mm7, %%mm6     \n\t" /* 0R0R0R0R 2 */\
-    "movq      %%mm2, %%mm0     \n\t" /* GBGBGBGB 0 */\
-    "movq      %%mm1, %%mm3     \n\t" /* GBGBGBGB 2 */\
-    "punpcklwd %%mm5, %%mm0     \n\t" /* 0RGB0RGB 0 */\
-    "punpckhwd %%mm5, %%mm2     \n\t" /* 0RGB0RGB 1 */\
-    "punpcklwd %%mm6, %%mm1     \n\t" /* 0RGB0RGB 2 */\
-    "punpckhwd %%mm6, %%mm3     \n\t" /* 0RGB0RGB 3 */\
-\
-    "movq      %%mm0, %%mm4     \n\t" /* 0RGB0RGB 0 */\
-    "movq      %%mm2, %%mm6     \n\t" /* 0RGB0RGB 1 */\
-    "movq      %%mm1, %%mm5     \n\t" /* 0RGB0RGB 2 */\
-    "movq      %%mm3, %%mm7     \n\t" /* 0RGB0RGB 3 */\
-\
-    "psllq       $40, %%mm0     \n\t" /* RGB00000 0 */\
-    "psllq       $40, %%mm2     \n\t" /* RGB00000 1 */\
-    "psllq       $40, %%mm1     \n\t" /* RGB00000 2 */\
-    "psllq       $40, %%mm3     \n\t" /* RGB00000 3 */\
-\
-    "punpckhdq %%mm4, %%mm0     \n\t" /* 0RGBRGB0 0 */\
-    "punpckhdq %%mm6, %%mm2     \n\t" /* 0RGBRGB0 1 */\
-    "punpckhdq %%mm5, %%mm1     \n\t" /* 0RGBRGB0 2 */\
-    "punpckhdq %%mm7, %%mm3     \n\t" /* 0RGBRGB0 3 */\
-\
-    "psrlq        $8, %%mm0     \n\t" /* 00RGBRGB 0 */\
-    "movq      %%mm2, %%mm6     \n\t" /* 0RGBRGB0 1 */\
-    "psllq       $40, %%mm2     \n\t" /* GB000000 1 */\
-    "por       %%mm2, %%mm0     \n\t" /* GBRGBRGB 0 */\
-    MOVNTQ(%%mm0, (dst))\
-\
-    "psrlq       $24, %%mm6     \n\t" /* 0000RGBR 1 */\
-    "movq      %%mm1, %%mm5     \n\t" /* 0RGBRGB0 2 */\
-    "psllq       $24, %%mm1     \n\t" /* BRGB0000 2 */\
-    "por       %%mm1, %%mm6     \n\t" /* BRGBRGBR 1 */\
-    MOVNTQ(%%mm6, 8(dst))\
-\
-    "psrlq       $40, %%mm5     \n\t" /* 000000RG 2 */\
-    "psllq        $8, %%mm3     \n\t" /* RGBRGB00 3 */\
-    "por       %%mm3, %%mm5     \n\t" /* RGBRGBRG 2 */\
-    MOVNTQ(%%mm5, 16(dst))\
-\
-    "add         $24, "#dst"    \n\t"\
-\
-    "add          $8, "#index"  \n\t"\
-    "cmp     "#dstw", "#index"  \n\t"\
-    " jb          1b            \n\t"
-
-#define WRITEBGR24MMXEXT(dst, dstw, index) \
-    /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\
-    "movq "MANGLE(ff_M24A)", %%mm0 \n\t"\
-    "movq "MANGLE(ff_M24C)", %%mm7 \n\t"\
-    "pshufw $0x50, %%mm2, %%mm1 \n\t" /* B3 B2 B3 B2  B1 B0 B1 B0 */\
-    "pshufw $0x50, %%mm4, %%mm3 \n\t" /* G3 G2 G3 G2  G1 G0 G1 G0 */\
-    "pshufw $0x00, %%mm5, %%mm6 \n\t" /* R1 R0 R1 R0  R1 R0 R1 R0 */\
-\
-    "pand   %%mm0, %%mm1        \n\t" /*    B2        B1       B0 */\
-    "pand   %%mm0, %%mm3        \n\t" /*    G2        G1       G0 */\
-    "pand   %%mm7, %%mm6        \n\t" /*       R1        R0       */\
-\
-    "psllq     $8, %%mm3        \n\t" /* G2        G1       G0    */\
-    "por    %%mm1, %%mm6        \n\t"\
-    "por    %%mm3, %%mm6        \n\t"\
-    MOVNTQ(%%mm6, (dst))\
-\
-    "psrlq     $8, %%mm4        \n\t" /* 00 G7 G6 G5  G4 G3 G2 G1 */\
-    "pshufw $0xA5, %%mm2, %%mm1 \n\t" /* B5 B4 B5 B4  B3 B2 B3 B2 */\
-    "pshufw $0x55, %%mm4, %%mm3 \n\t" /* G4 G3 G4 G3  G4 G3 G4 G3 */\
-    "pshufw $0xA5, %%mm5, %%mm6 \n\t" /* R5 R4 R5 R4  R3 R2 R3 R2 */\
-\
-    "pand "MANGLE(ff_M24B)", %%mm1 \n\t" /* B5       B4        B3    */\
-    "pand   %%mm7, %%mm3        \n\t" /*       G4        G3       */\
-    "pand   %%mm0, %%mm6        \n\t" /*    R4        R3       R2 */\
-\
-    "por    %%mm1, %%mm3        \n\t" /* B5    G4 B4     G3 B3    */\
-    "por    %%mm3, %%mm6        \n\t"\
-    MOVNTQ(%%mm6, 8(dst))\
-\
-    "pshufw $0xFF, %%mm2, %%mm1 \n\t" /* B7 B6 B7 B6  B7 B6 B6 B7 */\
-    "pshufw $0xFA, %%mm4, %%mm3 \n\t" /* 00 G7 00 G7  G6 G5 G6 G5 */\
-    "pshufw $0xFA, %%mm5, %%mm6 \n\t" /* R7 R6 R7 R6  R5 R4 R5 R4 */\
-\
-    "pand   %%mm7, %%mm1        \n\t" /*       B7        B6       */\
-    "pand   %%mm0, %%mm3        \n\t" /*    G7        G6       G5 */\
-    "pand "MANGLE(ff_M24B)", %%mm6 \n\t" /* R7       R6        R5    */\
-\
-    "por    %%mm1, %%mm3        \n\t"\
-    "por    %%mm3, %%mm6        \n\t"\
-    MOVNTQ(%%mm6, 16(dst))\
-\
-    "add      $24, "#dst"       \n\t"\
-\
-    "add       $8, "#index"     \n\t"\
-    "cmp  "#dstw", "#index"     \n\t"\
-    " jb       1b               \n\t"
-
-#if COMPILE_TEMPLATE_MMXEXT
-#undef WRITEBGR24
-#define WRITEBGR24(dst, dstw, index)  WRITEBGR24MMXEXT(dst, dstw, index)
-#else
-#undef WRITEBGR24
-#define WRITEBGR24(dst, dstw, index)  WRITEBGR24MMX(dst, dstw, index)
-#endif
-
-static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
-                                   const int16_t **lumSrc, int lumFilterSize,
-                                   const int16_t *chrFilter, const int16_t **chrUSrc,
-                                   const int16_t **chrVSrc,
-                                   int chrFilterSize, const int16_t **alpSrc,
-                                   uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    YSCALEYUV2PACKEDX_ACCURATE
-    YSCALEYUV2RGBX
-    "pxor %%mm7, %%mm7 \n\t"
-    "lea (%%"REG_a", %%"REG_a", 2), %%"REG_c"\n\t" //FIXME optimize
-    "add %4, %%"REG_c"                        \n\t"
-    WRITEBGR24(%%REGc, %5, %%REGa)
-    :: "r" (&c->redDither),
-       "m" (dummy), "m" (dummy), "m" (dummy),
-       "r" (dest), "m" (dstW_reg), "m"(uv_off)
-    : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S
-    );
-}
-
-static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
-                                const int16_t **lumSrc, int lumFilterSize,
-                                const int16_t *chrFilter, const int16_t **chrUSrc,
-                                const int16_t **chrVSrc,
-                                int chrFilterSize, const int16_t **alpSrc,
-                                uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    YSCALEYUV2PACKEDX
-    YSCALEYUV2RGBX
-    "pxor                    %%mm7, %%mm7       \n\t"
-    "lea (%%"REG_a", %%"REG_a", 2), %%"REG_c"   \n\t" //FIXME optimize
-    "add                        %4, %%"REG_c"   \n\t"
-    WRITEBGR24(%%REGc, %5, %%REGa)
-    :: "r" (&c->redDither),
-       "m" (dummy), "m" (dummy), "m" (dummy),
-       "r" (dest),  "m" (dstW_reg), "m"(uv_off)
-    : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S
-    );
-}
-
-#define REAL_WRITEYUY2(dst, dstw, index) \
-    "packuswb  %%mm3, %%mm3     \n\t"\
-    "packuswb  %%mm4, %%mm4     \n\t"\
-    "packuswb  %%mm7, %%mm1     \n\t"\
-    "punpcklbw %%mm4, %%mm3     \n\t"\
-    "movq      %%mm1, %%mm7     \n\t"\
-    "punpcklbw %%mm3, %%mm1     \n\t"\
-    "punpckhbw %%mm3, %%mm7     \n\t"\
-\
-    MOVNTQ(%%mm1, (dst, index, 2))\
-    MOVNTQ(%%mm7, 8(dst, index, 2))\
-\
-    "add          $8, "#index"  \n\t"\
-    "cmp     "#dstw", "#index"  \n\t"\
-    " jb          1b            \n\t"
-#define WRITEYUY2(dst, dstw, index)  REAL_WRITEYUY2(dst, dstw, index)
-
-static void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter,
-                                     const int16_t **lumSrc, int lumFilterSize,
-                                     const int16_t *chrFilter, const int16_t **chrUSrc,
-                                     const int16_t **chrVSrc,
-                                     int chrFilterSize, const int16_t **alpSrc,
-                                     uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    YSCALEYUV2PACKEDX_ACCURATE
-    /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-    "psraw $3, %%mm3    \n\t"
-    "psraw $3, %%mm4    \n\t"
-    "psraw $3, %%mm1    \n\t"
-    "psraw $3, %%mm7    \n\t"
-    WRITEYUY2(%4, %5, %%REGa)
-    YSCALEYUV2PACKEDX_END
-}
-
-static void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
-                                  const int16_t **lumSrc, int lumFilterSize,
-                                  const int16_t *chrFilter, const int16_t **chrUSrc,
-                                  const int16_t **chrVSrc,
-                                  int chrFilterSize, const int16_t **alpSrc,
-                                  uint8_t *dest, int dstW, int dstY)
-{
-    x86_reg dummy=0;
-    x86_reg dstW_reg = dstW;
-    x86_reg uv_off = c->uv_off_byte;
-
-    YSCALEYUV2PACKEDX
-    /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-    "psraw $3, %%mm3    \n\t"
-    "psraw $3, %%mm4    \n\t"
-    "psraw $3, %%mm1    \n\t"
-    "psraw $3, %%mm7    \n\t"
-    WRITEYUY2(%4, %5, %%REGa)
-    YSCALEYUV2PACKEDX_END
-}
-
-#define REAL_YSCALEYUV2RGB_UV(index, c) \
-    "xor            "#index", "#index"  \n\t"\
-    ".p2align              4            \n\t"\
-    "1:                                 \n\t"\
-    "movq     (%2, "#index"), %%mm2     \n\t" /* uvbuf0[eax]*/\
-    "movq     (%3, "#index"), %%mm3     \n\t" /* uvbuf1[eax]*/\
-    "add "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "movq     (%2, "#index"), %%mm5     \n\t" /* uvbuf0[eax+2048]*/\
-    "movq     (%3, "#index"), %%mm4     \n\t" /* uvbuf1[eax+2048]*/\
-    "sub "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "psubw             %%mm3, %%mm2     \n\t" /* uvbuf0[eax] - uvbuf1[eax]*/\
-    "psubw             %%mm4, %%mm5     \n\t" /* uvbuf0[eax+2048] - uvbuf1[eax+2048]*/\
-    "movq "CHR_MMX_FILTER_OFFSET"+8("#c"), %%mm0    \n\t"\
-    "pmulhw            %%mm0, %%mm2     \n\t" /* (uvbuf0[eax] - uvbuf1[eax])uvalpha1>>16*/\
-    "pmulhw            %%mm0, %%mm5     \n\t" /* (uvbuf0[eax+2048] - uvbuf1[eax+2048])uvalpha1>>16*/\
-    "psraw                $4, %%mm3     \n\t" /* uvbuf0[eax] - uvbuf1[eax] >>4*/\
-    "psraw                $4, %%mm4     \n\t" /* uvbuf0[eax+2048] - uvbuf1[eax+2048] >>4*/\
-    "paddw             %%mm2, %%mm3     \n\t" /* uvbuf0[eax]uvalpha1 - uvbuf1[eax](1-uvalpha1)*/\
-    "paddw             %%mm5, %%mm4     \n\t" /* uvbuf0[eax+2048]uvalpha1 - uvbuf1[eax+2048](1-uvalpha1)*/\
-    "psubw  "U_OFFSET"("#c"), %%mm3     \n\t" /* (U-128)8*/\
-    "psubw  "V_OFFSET"("#c"), %%mm4     \n\t" /* (V-128)8*/\
-    "movq              %%mm3, %%mm2     \n\t" /* (U-128)8*/\
-    "movq              %%mm4, %%mm5     \n\t" /* (V-128)8*/\
-    "pmulhw "UG_COEFF"("#c"), %%mm3     \n\t"\
-    "pmulhw "VG_COEFF"("#c"), %%mm4     \n\t"\
-    /* mm2=(U-128)8, mm3=ug, mm4=vg mm5=(V-128)8 */\
-
-#define REAL_YSCALEYUV2RGB_YA(index, c, b1, b2) \
-    "movq  ("#b1", "#index", 2), %%mm0     \n\t" /*buf0[eax]*/\
-    "movq  ("#b2", "#index", 2), %%mm1     \n\t" /*buf1[eax]*/\
-    "movq 8("#b1", "#index", 2), %%mm6     \n\t" /*buf0[eax]*/\
-    "movq 8("#b2", "#index", 2), %%mm7     \n\t" /*buf1[eax]*/\
-    "psubw             %%mm1, %%mm0     \n\t" /* buf0[eax] - buf1[eax]*/\
-    "psubw             %%mm7, %%mm6     \n\t" /* buf0[eax] - buf1[eax]*/\
-    "pmulhw "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm0  \n\t" /* (buf0[eax] - buf1[eax])yalpha1>>16*/\
-    "pmulhw "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm6  \n\t" /* (buf0[eax] - buf1[eax])yalpha1>>16*/\
-    "psraw                $4, %%mm1     \n\t" /* buf0[eax] - buf1[eax] >>4*/\
-    "psraw                $4, %%mm7     \n\t" /* buf0[eax] - buf1[eax] >>4*/\
-    "paddw             %%mm0, %%mm1     \n\t" /* buf0[eax]yalpha1 + buf1[eax](1-yalpha1) >>16*/\
-    "paddw             %%mm6, %%mm7     \n\t" /* buf0[eax]yalpha1 + buf1[eax](1-yalpha1) >>16*/\
-
-#define REAL_YSCALEYUV2RGB_COEFF(c) \
-    "pmulhw "UB_COEFF"("#c"), %%mm2     \n\t"\
-    "pmulhw "VR_COEFF"("#c"), %%mm5     \n\t"\
-    "psubw  "Y_OFFSET"("#c"), %%mm1     \n\t" /* 8(Y-16)*/\
-    "psubw  "Y_OFFSET"("#c"), %%mm7     \n\t" /* 8(Y-16)*/\
-    "pmulhw  "Y_COEFF"("#c"), %%mm1     \n\t"\
-    "pmulhw  "Y_COEFF"("#c"), %%mm7     \n\t"\
-    /* mm1= Y1, mm2=ub, mm3=ug, mm4=vg mm5=vr, mm7=Y2 */\
-    "paddw             %%mm3, %%mm4     \n\t"\
-    "movq              %%mm2, %%mm0     \n\t"\
-    "movq              %%mm5, %%mm6     \n\t"\
-    "movq              %%mm4, %%mm3     \n\t"\
-    "punpcklwd         %%mm2, %%mm2     \n\t"\
-    "punpcklwd         %%mm5, %%mm5     \n\t"\
-    "punpcklwd         %%mm4, %%mm4     \n\t"\
-    "paddw             %%mm1, %%mm2     \n\t"\
-    "paddw             %%mm1, %%mm5     \n\t"\
-    "paddw             %%mm1, %%mm4     \n\t"\
-    "punpckhwd         %%mm0, %%mm0     \n\t"\
-    "punpckhwd         %%mm6, %%mm6     \n\t"\
-    "punpckhwd         %%mm3, %%mm3     \n\t"\
-    "paddw             %%mm7, %%mm0     \n\t"\
-    "paddw             %%mm7, %%mm6     \n\t"\
-    "paddw             %%mm7, %%mm3     \n\t"\
-    /* mm0=B1, mm2=B2, mm3=G2, mm4=G1, mm5=R1, mm6=R2 */\
-    "packuswb          %%mm0, %%mm2     \n\t"\
-    "packuswb          %%mm6, %%mm5     \n\t"\
-    "packuswb          %%mm3, %%mm4     \n\t"\
-
-#define YSCALEYUV2RGB_YA(index, c, b1, b2) REAL_YSCALEYUV2RGB_YA(index, c, b1, b2)
-
-#define YSCALEYUV2RGB(index, c) \
-    REAL_YSCALEYUV2RGB_UV(index, c) \
-    REAL_YSCALEYUV2RGB_YA(index, c, %0, %1) \
-    REAL_YSCALEYUV2RGB_COEFF(c)
-
-/**
- * vertical bilinear scale YV12 to RGB
- */
-static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
-                                const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                const int16_t *abuf[2], uint8_t *dest,
-                                int dstW, int yalpha, int uvalpha, int y)
-{
-    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
-                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
-
-    if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) {
-        const int16_t *abuf0 = abuf[0], *abuf1 = abuf[1];
-#if ARCH_X86_64
-        __asm__ volatile(
-            YSCALEYUV2RGB(%%r8, %5)
-            YSCALEYUV2RGB_YA(%%r8, %5, %6, %7)
-            "psraw                  $3, %%mm1       \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
-            "psraw                  $3, %%mm7       \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
-            "packuswb            %%mm7, %%mm1       \n\t"
-            WRITEBGR32(%4, 8280(%5), %%r8, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "r" (dest),
-               "a" (&c->redDither),
-               "r" (abuf0), "r" (abuf1)
-            : "%r8"
-        );
-#else
-        *(const uint16_t **)(&c->u_temp)=abuf0;
-        *(const uint16_t **)(&c->v_temp)=abuf1;
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2RGB(%%REGBP, %5)
-            "push                   %0              \n\t"
-            "push                   %1              \n\t"
-            "mov          "U_TEMP"(%5), %0          \n\t"
-            "mov          "V_TEMP"(%5), %1          \n\t"
-            YSCALEYUV2RGB_YA(%%REGBP, %5, %0, %1)
-            "psraw                  $3, %%mm1       \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
-            "psraw                  $3, %%mm7       \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
-            "packuswb            %%mm7, %%mm1       \n\t"
-            "pop                    %1              \n\t"
-            "pop                    %0              \n\t"
-            WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-#endif
-    } else {
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2RGB(%%REGBP, %5)
-            "pcmpeqd %%mm7, %%mm7                   \n\t"
-            WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-    }
-}
-
-static void RENAME(yuv2bgr24_2)(SwsContext *c, const int16_t *buf[2],
-                                const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                const int16_t *abuf[2], uint8_t *dest,
-                                int dstW, int yalpha, int uvalpha, int y)
-{
-    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
-                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
-
-    //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
-    __asm__ volatile(
-        "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-        "mov        %4, %%"REG_b"               \n\t"
-        "push %%"REG_BP"                        \n\t"
-        YSCALEYUV2RGB(%%REGBP, %5)
-        "pxor    %%mm7, %%mm7                   \n\t"
-        WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
-        "pop %%"REG_BP"                         \n\t"
-        "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-        :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-           "a" (&c->redDither)
-    );
-}
-
-static void RENAME(yuv2rgb555_2)(SwsContext *c, const int16_t *buf[2],
-                                 const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                 const int16_t *abuf[2], uint8_t *dest,
-                                 int dstW, int yalpha, int uvalpha, int y)
-{
-    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
-                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
-
-    //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
-    __asm__ volatile(
-        "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-        "mov        %4, %%"REG_b"               \n\t"
-        "push %%"REG_BP"                        \n\t"
-        YSCALEYUV2RGB(%%REGBP, %5)
-        "pxor    %%mm7, %%mm7                   \n\t"
-        /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-        "paddusb "BLUE_DITHER"(%5), %%mm2      \n\t"
-        "paddusb "GREEN_DITHER"(%5), %%mm4      \n\t"
-        "paddusb "RED_DITHER"(%5), %%mm5      \n\t"
-#endif
-        WRITERGB15(%%REGb, 8280(%5), %%REGBP)
-        "pop %%"REG_BP"                         \n\t"
-        "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-        :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-           "a" (&c->redDither)
-    );
-}
-
-static void RENAME(yuv2rgb565_2)(SwsContext *c, const int16_t *buf[2],
-                                 const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                 const int16_t *abuf[2], uint8_t *dest,
-                                 int dstW, int yalpha, int uvalpha, int y)
-{
-    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
-                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
-
-    //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
-    __asm__ volatile(
-        "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-        "mov        %4, %%"REG_b"               \n\t"
-        "push %%"REG_BP"                        \n\t"
-        YSCALEYUV2RGB(%%REGBP, %5)
-        "pxor    %%mm7, %%mm7                   \n\t"
-        /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-        "paddusb "BLUE_DITHER"(%5), %%mm2      \n\t"
-        "paddusb "GREEN_DITHER"(%5), %%mm4      \n\t"
-        "paddusb "RED_DITHER"(%5), %%mm5      \n\t"
-#endif
-        WRITERGB16(%%REGb, 8280(%5), %%REGBP)
-        "pop %%"REG_BP"                         \n\t"
-        "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-        :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-           "a" (&c->redDither)
-    );
-}
-
-#define REAL_YSCALEYUV2PACKED(index, c) \
-    "movq "CHR_MMX_FILTER_OFFSET"+8("#c"), %%mm0              \n\t"\
-    "movq "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm1              \n\t"\
-    "psraw                $3, %%mm0                           \n\t"\
-    "psraw                $3, %%mm1                           \n\t"\
-    "movq              %%mm0, "CHR_MMX_FILTER_OFFSET"+8("#c") \n\t"\
-    "movq              %%mm1, "LUM_MMX_FILTER_OFFSET"+8("#c") \n\t"\
-    "xor            "#index", "#index"                        \n\t"\
-    ".p2align              4            \n\t"\
-    "1:                                 \n\t"\
-    "movq     (%2, "#index"), %%mm2     \n\t" /* uvbuf0[eax]*/\
-    "movq     (%3, "#index"), %%mm3     \n\t" /* uvbuf1[eax]*/\
-    "add "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "movq     (%2, "#index"), %%mm5     \n\t" /* uvbuf0[eax+2048]*/\
-    "movq     (%3, "#index"), %%mm4     \n\t" /* uvbuf1[eax+2048]*/\
-    "sub "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "psubw             %%mm3, %%mm2     \n\t" /* uvbuf0[eax] - uvbuf1[eax]*/\
-    "psubw             %%mm4, %%mm5     \n\t" /* uvbuf0[eax+2048] - uvbuf1[eax+2048]*/\
-    "movq "CHR_MMX_FILTER_OFFSET"+8("#c"), %%mm0    \n\t"\
-    "pmulhw            %%mm0, %%mm2     \n\t" /* (uvbuf0[eax] - uvbuf1[eax])uvalpha1>>16*/\
-    "pmulhw            %%mm0, %%mm5     \n\t" /* (uvbuf0[eax+2048] - uvbuf1[eax+2048])uvalpha1>>16*/\
-    "psraw                $7, %%mm3     \n\t" /* uvbuf0[eax] - uvbuf1[eax] >>4*/\
-    "psraw                $7, %%mm4     \n\t" /* uvbuf0[eax+2048] - uvbuf1[eax+2048] >>4*/\
-    "paddw             %%mm2, %%mm3     \n\t" /* uvbuf0[eax]uvalpha1 - uvbuf1[eax](1-uvalpha1)*/\
-    "paddw             %%mm5, %%mm4     \n\t" /* uvbuf0[eax+2048]uvalpha1 - uvbuf1[eax+2048](1-uvalpha1)*/\
-    "movq  (%0, "#index", 2), %%mm0     \n\t" /*buf0[eax]*/\
-    "movq  (%1, "#index", 2), %%mm1     \n\t" /*buf1[eax]*/\
-    "movq 8(%0, "#index", 2), %%mm6     \n\t" /*buf0[eax]*/\
-    "movq 8(%1, "#index", 2), %%mm7     \n\t" /*buf1[eax]*/\
-    "psubw             %%mm1, %%mm0     \n\t" /* buf0[eax] - buf1[eax]*/\
-    "psubw             %%mm7, %%mm6     \n\t" /* buf0[eax] - buf1[eax]*/\
-    "pmulhw "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm0  \n\t" /* (buf0[eax] - buf1[eax])yalpha1>>16*/\
-    "pmulhw "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm6  \n\t" /* (buf0[eax] - buf1[eax])yalpha1>>16*/\
-    "psraw                $7, %%mm1     \n\t" /* buf0[eax] - buf1[eax] >>4*/\
-    "psraw                $7, %%mm7     \n\t" /* buf0[eax] - buf1[eax] >>4*/\
-    "paddw             %%mm0, %%mm1     \n\t" /* buf0[eax]yalpha1 + buf1[eax](1-yalpha1) >>16*/\
-    "paddw             %%mm6, %%mm7     \n\t" /* buf0[eax]yalpha1 + buf1[eax](1-yalpha1) >>16*/\
-
-#define YSCALEYUV2PACKED(index, c)  REAL_YSCALEYUV2PACKED(index, c)
-
-static void RENAME(yuv2yuyv422_2)(SwsContext *c, const int16_t *buf[2],
-                                  const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                  const int16_t *abuf[2], uint8_t *dest,
-                                  int dstW, int yalpha, int uvalpha, int y)
-{
-    const int16_t *buf0  = buf[0],  *buf1  = buf[1],
-                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
-
-    //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
-    __asm__ volatile(
-        "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-        "mov %4, %%"REG_b"                        \n\t"
-        "push %%"REG_BP"                        \n\t"
-        YSCALEYUV2PACKED(%%REGBP, %5)
-        WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
-        "pop %%"REG_BP"                         \n\t"
-        "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-        :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-           "a" (&c->redDither)
-    );
-}
-
-#define REAL_YSCALEYUV2RGB1(index, c) \
-    "xor            "#index", "#index"  \n\t"\
-    ".p2align              4            \n\t"\
-    "1:                                 \n\t"\
-    "movq     (%2, "#index"), %%mm3     \n\t" /* uvbuf0[eax]*/\
-    "add "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "movq     (%2, "#index"), %%mm4     \n\t" /* uvbuf0[eax+2048]*/\
-    "sub "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "psraw                $4, %%mm3     \n\t" /* uvbuf0[eax] - uvbuf1[eax] >>4*/\
-    "psraw                $4, %%mm4     \n\t" /* uvbuf0[eax+2048] - uvbuf1[eax+2048] >>4*/\
-    "psubw  "U_OFFSET"("#c"), %%mm3     \n\t" /* (U-128)8*/\
-    "psubw  "V_OFFSET"("#c"), %%mm4     \n\t" /* (V-128)8*/\
-    "movq              %%mm3, %%mm2     \n\t" /* (U-128)8*/\
-    "movq              %%mm4, %%mm5     \n\t" /* (V-128)8*/\
-    "pmulhw "UG_COEFF"("#c"), %%mm3     \n\t"\
-    "pmulhw "VG_COEFF"("#c"), %%mm4     \n\t"\
-    /* mm2=(U-128)8, mm3=ug, mm4=vg mm5=(V-128)8 */\
-    "movq  (%0, "#index", 2), %%mm1     \n\t" /*buf0[eax]*/\
-    "movq 8(%0, "#index", 2), %%mm7     \n\t" /*buf0[eax]*/\
-    "psraw                $4, %%mm1     \n\t" /* buf0[eax] - buf1[eax] >>4*/\
-    "psraw                $4, %%mm7     \n\t" /* buf0[eax] - buf1[eax] >>4*/\
-    "pmulhw "UB_COEFF"("#c"), %%mm2     \n\t"\
-    "pmulhw "VR_COEFF"("#c"), %%mm5     \n\t"\
-    "psubw  "Y_OFFSET"("#c"), %%mm1     \n\t" /* 8(Y-16)*/\
-    "psubw  "Y_OFFSET"("#c"), %%mm7     \n\t" /* 8(Y-16)*/\
-    "pmulhw  "Y_COEFF"("#c"), %%mm1     \n\t"\
-    "pmulhw  "Y_COEFF"("#c"), %%mm7     \n\t"\
-    /* mm1= Y1, mm2=ub, mm3=ug, mm4=vg mm5=vr, mm7=Y2 */\
-    "paddw             %%mm3, %%mm4     \n\t"\
-    "movq              %%mm2, %%mm0     \n\t"\
-    "movq              %%mm5, %%mm6     \n\t"\
-    "movq              %%mm4, %%mm3     \n\t"\
-    "punpcklwd         %%mm2, %%mm2     \n\t"\
-    "punpcklwd         %%mm5, %%mm5     \n\t"\
-    "punpcklwd         %%mm4, %%mm4     \n\t"\
-    "paddw             %%mm1, %%mm2     \n\t"\
-    "paddw             %%mm1, %%mm5     \n\t"\
-    "paddw             %%mm1, %%mm4     \n\t"\
-    "punpckhwd         %%mm0, %%mm0     \n\t"\
-    "punpckhwd         %%mm6, %%mm6     \n\t"\
-    "punpckhwd         %%mm3, %%mm3     \n\t"\
-    "paddw             %%mm7, %%mm0     \n\t"\
-    "paddw             %%mm7, %%mm6     \n\t"\
-    "paddw             %%mm7, %%mm3     \n\t"\
-    /* mm0=B1, mm2=B2, mm3=G2, mm4=G1, mm5=R1, mm6=R2 */\
-    "packuswb          %%mm0, %%mm2     \n\t"\
-    "packuswb          %%mm6, %%mm5     \n\t"\
-    "packuswb          %%mm3, %%mm4     \n\t"\
-
-#define YSCALEYUV2RGB1(index, c)  REAL_YSCALEYUV2RGB1(index, c)
-
-// do vertical chrominance interpolation
-#define REAL_YSCALEYUV2RGB1b(index, c) \
-    "xor            "#index", "#index"  \n\t"\
-    ".p2align              4            \n\t"\
-    "1:                                 \n\t"\
-    "movq     (%2, "#index"), %%mm2     \n\t" /* uvbuf0[eax]*/\
-    "movq     (%3, "#index"), %%mm3     \n\t" /* uvbuf1[eax]*/\
-    "add "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "movq     (%2, "#index"), %%mm5     \n\t" /* uvbuf0[eax+2048]*/\
-    "movq     (%3, "#index"), %%mm4     \n\t" /* uvbuf1[eax+2048]*/\
-    "sub "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "paddw             %%mm2, %%mm3     \n\t" /* uvbuf0[eax] + uvbuf1[eax]*/\
-    "paddw             %%mm5, %%mm4     \n\t" /* uvbuf0[eax+2048] + uvbuf1[eax+2048]*/\
-    "psrlw                $5, %%mm3     \n\t" /*FIXME might overflow*/\
-    "psrlw                $5, %%mm4     \n\t" /*FIXME might overflow*/\
-    "psubw  "U_OFFSET"("#c"), %%mm3     \n\t" /* (U-128)8*/\
-    "psubw  "V_OFFSET"("#c"), %%mm4     \n\t" /* (V-128)8*/\
-    "movq              %%mm3, %%mm2     \n\t" /* (U-128)8*/\
-    "movq              %%mm4, %%mm5     \n\t" /* (V-128)8*/\
-    "pmulhw "UG_COEFF"("#c"), %%mm3     \n\t"\
-    "pmulhw "VG_COEFF"("#c"), %%mm4     \n\t"\
-    /* mm2=(U-128)8, mm3=ug, mm4=vg mm5=(V-128)8 */\
-    "movq  (%0, "#index", 2), %%mm1     \n\t" /*buf0[eax]*/\
-    "movq 8(%0, "#index", 2), %%mm7     \n\t" /*buf0[eax]*/\
-    "psraw                $4, %%mm1     \n\t" /* buf0[eax] - buf1[eax] >>4*/\
-    "psraw                $4, %%mm7     \n\t" /* buf0[eax] - buf1[eax] >>4*/\
-    "pmulhw "UB_COEFF"("#c"), %%mm2     \n\t"\
-    "pmulhw "VR_COEFF"("#c"), %%mm5     \n\t"\
-    "psubw  "Y_OFFSET"("#c"), %%mm1     \n\t" /* 8(Y-16)*/\
-    "psubw  "Y_OFFSET"("#c"), %%mm7     \n\t" /* 8(Y-16)*/\
-    "pmulhw  "Y_COEFF"("#c"), %%mm1     \n\t"\
-    "pmulhw  "Y_COEFF"("#c"), %%mm7     \n\t"\
-    /* mm1= Y1, mm2=ub, mm3=ug, mm4=vg mm5=vr, mm7=Y2 */\
-    "paddw             %%mm3, %%mm4     \n\t"\
-    "movq              %%mm2, %%mm0     \n\t"\
-    "movq              %%mm5, %%mm6     \n\t"\
-    "movq              %%mm4, %%mm3     \n\t"\
-    "punpcklwd         %%mm2, %%mm2     \n\t"\
-    "punpcklwd         %%mm5, %%mm5     \n\t"\
-    "punpcklwd         %%mm4, %%mm4     \n\t"\
-    "paddw             %%mm1, %%mm2     \n\t"\
-    "paddw             %%mm1, %%mm5     \n\t"\
-    "paddw             %%mm1, %%mm4     \n\t"\
-    "punpckhwd         %%mm0, %%mm0     \n\t"\
-    "punpckhwd         %%mm6, %%mm6     \n\t"\
-    "punpckhwd         %%mm3, %%mm3     \n\t"\
-    "paddw             %%mm7, %%mm0     \n\t"\
-    "paddw             %%mm7, %%mm6     \n\t"\
-    "paddw             %%mm7, %%mm3     \n\t"\
-    /* mm0=B1, mm2=B2, mm3=G2, mm4=G1, mm5=R1, mm6=R2 */\
-    "packuswb          %%mm0, %%mm2     \n\t"\
-    "packuswb          %%mm6, %%mm5     \n\t"\
-    "packuswb          %%mm3, %%mm4     \n\t"\
-
-#define YSCALEYUV2RGB1b(index, c)  REAL_YSCALEYUV2RGB1b(index, c)
-
-#define REAL_YSCALEYUV2RGB1_ALPHA(index) \
-    "movq  (%1, "#index", 2), %%mm7     \n\t" /* abuf0[index  ]     */\
-    "movq 8(%1, "#index", 2), %%mm1     \n\t" /* abuf0[index+4]     */\
-    "psraw                $7, %%mm7     \n\t" /* abuf0[index  ] >>7 */\
-    "psraw                $7, %%mm1     \n\t" /* abuf0[index+4] >>7 */\
-    "packuswb          %%mm1, %%mm7     \n\t"
-#define YSCALEYUV2RGB1_ALPHA(index) REAL_YSCALEYUV2RGB1_ALPHA(index)
-
-/**
- * YV12 to RGB without scaling or interpolating
- */
-static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
-                                const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                const int16_t *abuf0, uint8_t *dest,
-                                int dstW, int uvalpha, int y)
-{
-    const int16_t *ubuf0 = ubuf[0];
-    const int16_t *buf1= buf0; //FIXME needed for RGB1/BGR1
-
-    if (uvalpha < 2048) { // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster
-        const int16_t *ubuf1 = ubuf[0];
-        if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) {
-            __asm__ volatile(
-                "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-                "mov        %4, %%"REG_b"               \n\t"
-                "push %%"REG_BP"                        \n\t"
-                YSCALEYUV2RGB1(%%REGBP, %5)
-                YSCALEYUV2RGB1_ALPHA(%%REGBP)
-                WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
-                "pop %%"REG_BP"                         \n\t"
-                "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-                :: "c" (buf0), "d" (abuf0), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-                   "a" (&c->redDither)
-            );
-        } else {
-            __asm__ volatile(
-                "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-                "mov        %4, %%"REG_b"               \n\t"
-                "push %%"REG_BP"                        \n\t"
-                YSCALEYUV2RGB1(%%REGBP, %5)
-                "pcmpeqd %%mm7, %%mm7                   \n\t"
-                WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
-                "pop %%"REG_BP"                         \n\t"
-                "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-                :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-                   "a" (&c->redDither)
-            );
-        }
-    } else {
-        const int16_t *ubuf1 = ubuf[1];
-        if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) {
-            __asm__ volatile(
-                "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-                "mov        %4, %%"REG_b"               \n\t"
-                "push %%"REG_BP"                        \n\t"
-                YSCALEYUV2RGB1b(%%REGBP, %5)
-                YSCALEYUV2RGB1_ALPHA(%%REGBP)
-                WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
-                "pop %%"REG_BP"                         \n\t"
-                "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-                :: "c" (buf0), "d" (abuf0), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-                   "a" (&c->redDither)
-            );
-        } else {
-            __asm__ volatile(
-                "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-                "mov        %4, %%"REG_b"               \n\t"
-                "push %%"REG_BP"                        \n\t"
-                YSCALEYUV2RGB1b(%%REGBP, %5)
-                "pcmpeqd %%mm7, %%mm7                   \n\t"
-                WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
-                "pop %%"REG_BP"                         \n\t"
-                "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-                :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-                   "a" (&c->redDither)
-            );
-        }
-    }
-}
-
-static void RENAME(yuv2bgr24_1)(SwsContext *c, const int16_t *buf0,
-                                const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                const int16_t *abuf0, uint8_t *dest,
-                                int dstW, int uvalpha, int y)
-{
-    const int16_t *ubuf0 = ubuf[0];
-    const int16_t *buf1= buf0; //FIXME needed for RGB1/BGR1
-
-    if (uvalpha < 2048) { // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster
-        const int16_t *ubuf1 = ubuf[0];
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2RGB1(%%REGBP, %5)
-            "pxor    %%mm7, %%mm7                   \n\t"
-            WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-    } else {
-        const int16_t *ubuf1 = ubuf[1];
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2RGB1b(%%REGBP, %5)
-            "pxor    %%mm7, %%mm7                   \n\t"
-            WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-    }
-}
-
-static void RENAME(yuv2rgb555_1)(SwsContext *c, const int16_t *buf0,
-                                 const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                 const int16_t *abuf0, uint8_t *dest,
-                                 int dstW, int uvalpha, int y)
-{
-    const int16_t *ubuf0 = ubuf[0];
-    const int16_t *buf1= buf0; //FIXME needed for RGB1/BGR1
-
-    if (uvalpha < 2048) { // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster
-        const int16_t *ubuf1 = ubuf[0];
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2RGB1(%%REGBP, %5)
-            "pxor    %%mm7, %%mm7                   \n\t"
-            /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-            "paddusb "BLUE_DITHER"(%5), %%mm2      \n\t"
-            "paddusb "GREEN_DITHER"(%5), %%mm4      \n\t"
-            "paddusb "RED_DITHER"(%5), %%mm5      \n\t"
-#endif
-            WRITERGB15(%%REGb, 8280(%5), %%REGBP)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-    } else {
-        const int16_t *ubuf1 = ubuf[1];
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2RGB1b(%%REGBP, %5)
-            "pxor    %%mm7, %%mm7                   \n\t"
-            /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-            "paddusb "BLUE_DITHER"(%5), %%mm2      \n\t"
-            "paddusb "GREEN_DITHER"(%5), %%mm4      \n\t"
-            "paddusb "RED_DITHER"(%5), %%mm5      \n\t"
-#endif
-            WRITERGB15(%%REGb, 8280(%5), %%REGBP)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-    }
-}
-
-static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0,
-                                 const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                 const int16_t *abuf0, uint8_t *dest,
-                                 int dstW, int uvalpha, int y)
-{
-    const int16_t *ubuf0 = ubuf[0];
-    const int16_t *buf1= buf0; //FIXME needed for RGB1/BGR1
-
-    if (uvalpha < 2048) { // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster
-        const int16_t *ubuf1 = ubuf[0];
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2RGB1(%%REGBP, %5)
-            "pxor    %%mm7, %%mm7                   \n\t"
-            /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-            "paddusb "BLUE_DITHER"(%5), %%mm2      \n\t"
-            "paddusb "GREEN_DITHER"(%5), %%mm4      \n\t"
-            "paddusb "RED_DITHER"(%5), %%mm5      \n\t"
-#endif
-            WRITERGB16(%%REGb, 8280(%5), %%REGBP)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-    } else {
-        const int16_t *ubuf1 = ubuf[1];
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2RGB1b(%%REGBP, %5)
-            "pxor    %%mm7, %%mm7                   \n\t"
-            /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
-#ifdef DITHER1XBPP
-            "paddusb "BLUE_DITHER"(%5), %%mm2      \n\t"
-            "paddusb "GREEN_DITHER"(%5), %%mm4      \n\t"
-            "paddusb "RED_DITHER"(%5), %%mm5      \n\t"
-#endif
-            WRITERGB16(%%REGb, 8280(%5), %%REGBP)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-    }
-}
-
-#define REAL_YSCALEYUV2PACKED1(index, c) \
-    "xor            "#index", "#index"  \n\t"\
-    ".p2align              4            \n\t"\
-    "1:                                 \n\t"\
-    "movq     (%2, "#index"), %%mm3     \n\t" /* uvbuf0[eax]*/\
-    "add "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "movq     (%2, "#index"), %%mm4     \n\t" /* uvbuf0[eax+2048]*/\
-    "sub "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "psraw                $7, %%mm3     \n\t" \
-    "psraw                $7, %%mm4     \n\t" \
-    "movq  (%0, "#index", 2), %%mm1     \n\t" /*buf0[eax]*/\
-    "movq 8(%0, "#index", 2), %%mm7     \n\t" /*buf0[eax]*/\
-    "psraw                $7, %%mm1     \n\t" \
-    "psraw                $7, %%mm7     \n\t" \
-
-#define YSCALEYUV2PACKED1(index, c)  REAL_YSCALEYUV2PACKED1(index, c)
-
-#define REAL_YSCALEYUV2PACKED1b(index, c) \
-    "xor "#index", "#index"             \n\t"\
-    ".p2align              4            \n\t"\
-    "1:                                 \n\t"\
-    "movq     (%2, "#index"), %%mm2     \n\t" /* uvbuf0[eax]*/\
-    "movq     (%3, "#index"), %%mm3     \n\t" /* uvbuf1[eax]*/\
-    "add "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "movq     (%2, "#index"), %%mm5     \n\t" /* uvbuf0[eax+2048]*/\
-    "movq     (%3, "#index"), %%mm4     \n\t" /* uvbuf1[eax+2048]*/\
-    "sub "UV_OFF_BYTE"("#c"), "#index"  \n\t" \
-    "paddw             %%mm2, %%mm3     \n\t" /* uvbuf0[eax] + uvbuf1[eax]*/\
-    "paddw             %%mm5, %%mm4     \n\t" /* uvbuf0[eax+2048] + uvbuf1[eax+2048]*/\
-    "psrlw                $8, %%mm3     \n\t" \
-    "psrlw                $8, %%mm4     \n\t" \
-    "movq  (%0, "#index", 2), %%mm1     \n\t" /*buf0[eax]*/\
-    "movq 8(%0, "#index", 2), %%mm7     \n\t" /*buf0[eax]*/\
-    "psraw                $7, %%mm1     \n\t" \
-    "psraw                $7, %%mm7     \n\t"
-#define YSCALEYUV2PACKED1b(index, c)  REAL_YSCALEYUV2PACKED1b(index, c)
-
-static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0,
-                                  const int16_t *ubuf[2], const int16_t *vbuf[2],
-                                  const int16_t *abuf0, uint8_t *dest,
-                                  int dstW, int uvalpha, int y)
-{
-    const int16_t *ubuf0 = ubuf[0];
-    const int16_t *buf1= buf0; //FIXME needed for RGB1/BGR1
-
-    if (uvalpha < 2048) { // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster
-        const int16_t *ubuf1 = ubuf[0];
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2PACKED1(%%REGBP, %5)
-            WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-    } else {
-        const int16_t *ubuf1 = ubuf[1];
-        __asm__ volatile(
-            "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"
-            "mov        %4, %%"REG_b"               \n\t"
-            "push %%"REG_BP"                        \n\t"
-            YSCALEYUV2PACKED1b(%%REGBP, %5)
-            WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
-            "pop %%"REG_BP"                         \n\t"
-            "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"
-            :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
-               "a" (&c->redDither)
-        );
-    }
-}
-
-#if COMPILE_TEMPLATE_MMXEXT
-static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
-                                 int dstWidth, const uint8_t *src,
-                                 int srcW, int xInc)
-{
-    int32_t *filterPos = c->hLumFilterPos;
-    int16_t *filter    = c->hLumFilter;
-    void    *mmxextFilterCode = c->lumMmxextFilterCode;
-    int i;
-#if defined(PIC)
-    uint64_t ebxsave;
-#endif
-#if ARCH_X86_64
-    uint64_t retsave;
-#endif
-
-    __asm__ volatile(
-#if defined(PIC)
-        "mov               %%"REG_b", %5        \n\t"
-#if ARCH_X86_64
-        "mov               -8(%%rsp), %%"REG_a" \n\t"
-        "mov               %%"REG_a", %6        \n\t"
-#endif
-#else
-#if ARCH_X86_64
-        "mov               -8(%%rsp), %%"REG_a" \n\t"
-        "mov               %%"REG_a", %5        \n\t"
-#endif
-#endif
-        "pxor                  %%mm7, %%mm7     \n\t"
-        "mov                      %0, %%"REG_c" \n\t"
-        "mov                      %1, %%"REG_D" \n\t"
-        "mov                      %2, %%"REG_d" \n\t"
-        "mov                      %3, %%"REG_b" \n\t"
-        "xor               %%"REG_a", %%"REG_a" \n\t" // i
-        PREFETCH"        (%%"REG_c")            \n\t"
-        PREFETCH"      32(%%"REG_c")            \n\t"
-        PREFETCH"      64(%%"REG_c")            \n\t"
-
-#if ARCH_X86_64
-#define CALL_MMXEXT_FILTER_CODE \
-        "movl            (%%"REG_b"), %%esi     \n\t"\
-        "call                    *%4            \n\t"\
-        "movl (%%"REG_b", %%"REG_a"), %%esi     \n\t"\
-        "add               %%"REG_S", %%"REG_c" \n\t"\
-        "add               %%"REG_a", %%"REG_D" \n\t"\
-        "xor               %%"REG_a", %%"REG_a" \n\t"\
-
-#else
-#define CALL_MMXEXT_FILTER_CODE \
-        "movl (%%"REG_b"), %%esi        \n\t"\
-        "call         *%4                       \n\t"\
-        "addl (%%"REG_b", %%"REG_a"), %%"REG_c" \n\t"\
-        "add               %%"REG_a", %%"REG_D" \n\t"\
-        "xor               %%"REG_a", %%"REG_a" \n\t"\
-
-#endif /* ARCH_X86_64 */
-
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-
-#if defined(PIC)
-        "mov                      %5, %%"REG_b" \n\t"
-#if ARCH_X86_64
-        "mov                      %6, %%"REG_a" \n\t"
-        "mov               %%"REG_a", -8(%%rsp) \n\t"
-#endif
-#else
-#if ARCH_X86_64
-        "mov                      %5, %%"REG_a" \n\t"
-        "mov               %%"REG_a", -8(%%rsp) \n\t"
-#endif
-#endif
-        :: "m" (src), "m" (dst), "m" (filter), "m" (filterPos),
-           "m" (mmxextFilterCode)
-#if defined(PIC)
-          ,"m" (ebxsave)
-#endif
-#if ARCH_X86_64
-          ,"m"(retsave)
-#endif
-        : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D
-#if !defined(PIC)
-         ,"%"REG_b
-#endif
-    );
-
-    for (i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--)
-        dst[i] = src[srcW-1]*128;
-}
-
-static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
-                                 int dstWidth, const uint8_t *src1,
-                                 const uint8_t *src2, int srcW, int xInc)
-{
-    int32_t *filterPos = c->hChrFilterPos;
-    int16_t *filter    = c->hChrFilter;
-    void    *mmxextFilterCode = c->chrMmxextFilterCode;
-    int i;
-#if defined(PIC)
-    DECLARE_ALIGNED(8, uint64_t, ebxsave);
-#endif
-#if ARCH_X86_64
-    DECLARE_ALIGNED(8, uint64_t, retsave);
-#endif
-
-    __asm__ volatile(
-#if defined(PIC)
-        "mov          %%"REG_b", %7         \n\t"
-#if ARCH_X86_64
-        "mov          -8(%%rsp), %%"REG_a"  \n\t"
-        "mov          %%"REG_a", %8         \n\t"
-#endif
-#else
-#if ARCH_X86_64
-        "mov          -8(%%rsp), %%"REG_a"  \n\t"
-        "mov          %%"REG_a", %7         \n\t"
-#endif
-#endif
-        "pxor             %%mm7, %%mm7      \n\t"
-        "mov                 %0, %%"REG_c"  \n\t"
-        "mov                 %1, %%"REG_D"  \n\t"
-        "mov                 %2, %%"REG_d"  \n\t"
-        "mov                 %3, %%"REG_b"  \n\t"
-        "xor          %%"REG_a", %%"REG_a"  \n\t" // i
-        PREFETCH"   (%%"REG_c")             \n\t"
-        PREFETCH" 32(%%"REG_c")             \n\t"
-        PREFETCH" 64(%%"REG_c")             \n\t"
-
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        "xor          %%"REG_a", %%"REG_a"  \n\t" // i
-        "mov                 %5, %%"REG_c"  \n\t" // src
-        "mov                 %6, %%"REG_D"  \n\t" // buf2
-        PREFETCH"   (%%"REG_c")             \n\t"
-        PREFETCH" 32(%%"REG_c")             \n\t"
-        PREFETCH" 64(%%"REG_c")             \n\t"
-
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-        CALL_MMXEXT_FILTER_CODE
-
-#if defined(PIC)
-        "mov %7, %%"REG_b"    \n\t"
-#if ARCH_X86_64
-        "mov                 %8, %%"REG_a"  \n\t"
-        "mov          %%"REG_a", -8(%%rsp)  \n\t"
-#endif
-#else
-#if ARCH_X86_64
-        "mov                 %7, %%"REG_a"  \n\t"
-        "mov          %%"REG_a", -8(%%rsp)  \n\t"
-#endif
-#endif
-        :: "m" (src1), "m" (dst1), "m" (filter), "m" (filterPos),
-           "m" (mmxextFilterCode), "m" (src2), "m"(dst2)
-#if defined(PIC)
-          ,"m" (ebxsave)
-#endif
-#if ARCH_X86_64
-          ,"m"(retsave)
-#endif
-        : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D
-#if !defined(PIC)
-         ,"%"REG_b
-#endif
-    );
-
-    for (i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--) {
-        dst1[i] = src1[srcW-1]*128;
-        dst2[i] = src2[srcW-1]*128;
-    }
-}
-#endif /* COMPILE_TEMPLATE_MMXEXT */
-
-static av_cold void RENAME(sws_init_swscale)(SwsContext *c)
-{
-    enum AVPixelFormat dstFormat = c->dstFormat;
-
-    if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
-        dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21) {
-        if (!(c->flags & SWS_BITEXACT)) {
-            if (c->flags & SWS_ACCURATE_RND) {
-                if (!(c->flags & SWS_FULL_CHR_H_INT)) {
-                    switch (c->dstFormat) {
-                    case AV_PIX_FMT_RGB32:   c->yuv2packedX = RENAME(yuv2rgb32_X_ar);   break;
-                    case AV_PIX_FMT_BGR24:   c->yuv2packedX = RENAME(yuv2bgr24_X_ar);   break;
-                    case AV_PIX_FMT_RGB555:  c->yuv2packedX = RENAME(yuv2rgb555_X_ar);  break;
-                    case AV_PIX_FMT_RGB565:  c->yuv2packedX = RENAME(yuv2rgb565_X_ar);  break;
-                    case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;
-                    default: break;
-                    }
-                }
-            } else {
-                if (!(c->flags & SWS_FULL_CHR_H_INT)) {
-                    switch (c->dstFormat) {
-                    case AV_PIX_FMT_RGB32:   c->yuv2packedX = RENAME(yuv2rgb32_X);   break;
-                    case AV_PIX_FMT_BGR24:   c->yuv2packedX = RENAME(yuv2bgr24_X);   break;
-                    case AV_PIX_FMT_RGB555:  c->yuv2packedX = RENAME(yuv2rgb555_X);  break;
-                    case AV_PIX_FMT_RGB565:  c->yuv2packedX = RENAME(yuv2rgb565_X);  break;
-                    case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;
-                    default: break;
-                    }
-                }
-            }
-        }
-        if (!(c->flags & SWS_FULL_CHR_H_INT)) {
-            switch (c->dstFormat) {
-            case AV_PIX_FMT_RGB32:
-                c->yuv2packed1 = RENAME(yuv2rgb32_1);
-                c->yuv2packed2 = RENAME(yuv2rgb32_2);
-                break;
-            case AV_PIX_FMT_BGR24:
-                c->yuv2packed1 = RENAME(yuv2bgr24_1);
-                c->yuv2packed2 = RENAME(yuv2bgr24_2);
-                break;
-            case AV_PIX_FMT_RGB555:
-                c->yuv2packed1 = RENAME(yuv2rgb555_1);
-                c->yuv2packed2 = RENAME(yuv2rgb555_2);
-                break;
-            case AV_PIX_FMT_RGB565:
-                c->yuv2packed1 = RENAME(yuv2rgb565_1);
-                c->yuv2packed2 = RENAME(yuv2rgb565_2);
-                break;
-            case AV_PIX_FMT_YUYV422:
-                c->yuv2packed1 = RENAME(yuv2yuyv422_1);
-                c->yuv2packed2 = RENAME(yuv2yuyv422_2);
-                break;
-            default:
-                break;
-            }
-        }
-    }
-
-    if (c->srcBpc == 8 && c->dstBpc <= 10) {
-    // Use the new MMX scaler if the MMXEXT one can't be used (it is faster than the x86 ASM one).
-#if COMPILE_TEMPLATE_MMXEXT
-    if (c->flags & SWS_FAST_BILINEAR && c->canMMXEXTBeUsed) {
-        c->hyscale_fast = RENAME(hyscale_fast);
-        c->hcscale_fast = RENAME(hcscale_fast);
-    } else {
-#endif /* COMPILE_TEMPLATE_MMXEXT */
-        c->hyscale_fast = NULL;
-        c->hcscale_fast = NULL;
-#if COMPILE_TEMPLATE_MMXEXT
-    }
-#endif /* COMPILE_TEMPLATE_MMXEXT */
-    }
-}
diff --git a/deps/libav/libswscale/x86/w64xmmtest.c b/deps/libav/libswscale/x86/w64xmmtest.c
deleted file mode 100644
index dd9a2a4..0000000
--- a/deps/libav/libswscale/x86/w64xmmtest.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * check XMM registers for clobbers on Win64
- * Copyright (c) 2012 Ronald S. Bultje <rsbultje at gmail.com>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/x86/w64xmmtest.h"
-#include "libswscale/swscale.h"
-
-wrap(sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
-               const int srcStride[], int srcSliceY, int srcSliceH,
-               uint8_t *const dst[], const int dstStride[]))
-{
-    testxmmclobbers(sws_scale, c, srcSlice, srcStride, srcSliceY,
-                    srcSliceH, dst, dstStride);
-}
diff --git a/deps/libav/libswscale/x86/yuv2rgb.c b/deps/libav/libswscale/x86/yuv2rgb.c
deleted file mode 100644
index bacc87f..0000000
--- a/deps/libav/libswscale/x86/yuv2rgb.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * software YUV to RGB converter
- *
- * Copyright (C) 2009 Konstantin Shishkov
- *
- * MMX/MMXEXT template stuff (needed for fast movntq support),
- * 1,4,8bpp support and context / deglobalize stuff
- * by Michael Niedermayer (michaelni at gmx.at)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include <assert.h>
-
-#include "config.h"
-#include "libswscale/rgb2rgb.h"
-#include "libswscale/swscale.h"
-#include "libswscale/swscale_internal.h"
-#include "libavutil/attributes.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include "libavutil/cpu.h"
-
-#if HAVE_INLINE_ASM
-
-#define DITHER1XBPP // only for MMX
-
-/* hope these constant values are cache line aligned */
-DECLARE_ASM_CONST(8, uint64_t, mmx_00ffw)   = 0x00ff00ff00ff00ffULL;
-DECLARE_ASM_CONST(8, uint64_t, mmx_redmask) = 0xf8f8f8f8f8f8f8f8ULL;
-DECLARE_ASM_CONST(8, uint64_t, mmx_grnmask) = 0xfcfcfcfcfcfcfcfcULL;
-DECLARE_ASM_CONST(8, uint64_t, pb_e0) = 0xe0e0e0e0e0e0e0e0ULL;
-DECLARE_ASM_CONST(8, uint64_t, pb_03) = 0x0303030303030303ULL;
-DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL;
-
-//MMX versions
-#if HAVE_MMX_INLINE
-#undef RENAME
-#undef COMPILE_TEMPLATE_MMXEXT
-#define COMPILE_TEMPLATE_MMXEXT 0
-#define RENAME(a) a ## _mmx
-#include "yuv2rgb_template.c"
-#endif /* HAVE_MMX_INLINE */
-
-// MMXEXT versions
-#if HAVE_MMXEXT_INLINE
-#undef RENAME
-#undef COMPILE_TEMPLATE_MMXEXT
-#define COMPILE_TEMPLATE_MMXEXT 1
-#define RENAME(a) a ## _mmxext
-#include "yuv2rgb_template.c"
-#endif /* HAVE_MMXEXT_INLINE */
-
-#endif /* HAVE_INLINE_ASM */
-
-av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c)
-{
-#if HAVE_MMX_INLINE
-    int cpu_flags = av_get_cpu_flags();
-
-    if (c->srcFormat != AV_PIX_FMT_YUV420P &&
-        c->srcFormat != AV_PIX_FMT_YUVA420P)
-        return NULL;
-
-#if HAVE_MMXEXT_INLINE
-    if (INLINE_MMXEXT(cpu_flags)) {
-        switch (c->dstFormat) {
-        case AV_PIX_FMT_RGB24:
-            return yuv420_rgb24_mmxext;
-        case AV_PIX_FMT_BGR24:
-            return yuv420_bgr24_mmxext;
-        }
-    }
-#endif
-
-    if (INLINE_MMX(cpu_flags)) {
-        switch (c->dstFormat) {
-            case AV_PIX_FMT_RGB32:
-                if (c->srcFormat == AV_PIX_FMT_YUVA420P) {
-#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
-                    return yuva420_rgb32_mmx;
-#endif
-                    break;
-                } else
-                    return yuv420_rgb32_mmx;
-            case AV_PIX_FMT_BGR32:
-                if (c->srcFormat == AV_PIX_FMT_YUVA420P) {
-#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
-                    return yuva420_bgr32_mmx;
-#endif
-                    break;
-                } else
-                    return yuv420_bgr32_mmx;
-            case AV_PIX_FMT_RGB24:
-                return yuv420_rgb24_mmx;
-            case AV_PIX_FMT_BGR24:
-                return yuv420_bgr24_mmx;
-            case AV_PIX_FMT_RGB565:
-                return yuv420_rgb16_mmx;
-            case AV_PIX_FMT_RGB555:
-                return yuv420_rgb15_mmx;
-        }
-    }
-#endif /* HAVE_MMX_INLINE */
-
-    return NULL;
-}
diff --git a/deps/libav/libswscale/x86/yuv2rgb_template.c b/deps/libav/libswscale/x86/yuv2rgb_template.c
deleted file mode 100644
index b028e93..0000000
--- a/deps/libav/libswscale/x86/yuv2rgb_template.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * software YUV to RGB converter
- *
- * Copyright (C) 2001-2007 Michael Niedermayer
- *           (c) 2010 Konstantin Shishkov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#undef MOVNTQ
-#undef EMMS
-#undef SFENCE
-
-#if COMPILE_TEMPLATE_MMXEXT
-#define MOVNTQ "movntq"
-#define SFENCE "sfence"
-#else
-#define MOVNTQ "movq"
-#define SFENCE " # nop"
-#endif
-
-#define REG_BLUE  "0"
-#define REG_RED   "1"
-#define REG_GREEN "2"
-#define REG_ALPHA "3"
-
-#define YUV2RGB_LOOP(depth)                                          \
-    h_size = (c->dstW + 7) & ~7;                                     \
-    if (h_size * depth > FFABS(dstStride[0]))                        \
-        h_size -= 8;                                                 \
-                                                                     \
-    if (c->srcFormat == AV_PIX_FMT_YUV422P) {                           \
-        srcStride[1] *= 2;                                           \
-        srcStride[2] *= 2;                                           \
-    }                                                                \
-                                                                     \
-    __asm__ volatile ("pxor %mm4, %mm4\n\t");                        \
-    for (y = 0; y < srcSliceH; y++) {                                \
-        uint8_t *image    = dst[0] + (y + srcSliceY) * dstStride[0]; \
-        const uint8_t *py = src[0] +               y * srcStride[0]; \
-        const uint8_t *pu = src[1] +        (y >> 1) * srcStride[1]; \
-        const uint8_t *pv = src[2] +        (y >> 1) * srcStride[2]; \
-        x86_reg index = -h_size / 2;                                 \
-
-#define YUV2RGB_INITIAL_LOAD          \
-    __asm__ volatile (                \
-        "movq (%5, %0, 2), %%mm6\n\t" \
-        "movd    (%2, %0), %%mm0\n\t" \
-        "movd    (%3, %0), %%mm1\n\t" \
-        "1: \n\t"                     \
-
-/* YUV2RGB core
- * Conversion is performed in usual way:
- * R = Y' * Ycoef + Vred * V'
- * G = Y' * Ycoef + Vgreen * V' + Ugreen * U'
- * B = Y' * Ycoef               + Ublue * U'
- *
- * where X' = X * 8 - Xoffset (multiplication is performed to increase
- * precision a bit).
- * Since it operates in YUV420 colorspace, Y component is additionally
- * split into Y1 and Y2 for even and odd pixels.
- *
- * Input:
- * mm0 - U (4 elems), mm1 - V (4 elems), mm6 - Y (8 elems), mm4 - zero register
- * Output:
- * mm1 - R, mm2 - G, mm0 - B
- */
-#define YUV2RGB                                  \
-    /* convert Y, U, V into Y1', Y2', U', V' */  \
-    "movq      %%mm6, %%mm7\n\t"                 \
-    "punpcklbw %%mm4, %%mm0\n\t"                 \
-    "punpcklbw %%mm4, %%mm1\n\t"                 \
-    "pand     "MANGLE(mmx_00ffw)", %%mm6\n\t"    \
-    "psrlw     $8,    %%mm7\n\t"                 \
-    "psllw     $3,    %%mm0\n\t"                 \
-    "psllw     $3,    %%mm1\n\t"                 \
-    "psllw     $3,    %%mm6\n\t"                 \
-    "psllw     $3,    %%mm7\n\t"                 \
-    "psubsw   "U_OFFSET"(%4), %%mm0\n\t"         \
-    "psubsw   "V_OFFSET"(%4), %%mm1\n\t"         \
-    "psubw    "Y_OFFSET"(%4), %%mm6\n\t"         \
-    "psubw    "Y_OFFSET"(%4), %%mm7\n\t"         \
-\
-     /* multiply by coefficients */              \
-    "movq      %%mm0, %%mm2\n\t"                 \
-    "movq      %%mm1, %%mm3\n\t"                 \
-    "pmulhw   "UG_COEFF"(%4), %%mm2\n\t"         \
-    "pmulhw   "VG_COEFF"(%4), %%mm3\n\t"         \
-    "pmulhw   "Y_COEFF" (%4), %%mm6\n\t"         \
-    "pmulhw   "Y_COEFF" (%4), %%mm7\n\t"         \
-    "pmulhw   "UB_COEFF"(%4), %%mm0\n\t"         \
-    "pmulhw   "VR_COEFF"(%4), %%mm1\n\t"         \
-    "paddsw    %%mm3, %%mm2\n\t"                 \
-    /* now: mm0 = UB, mm1 = VR, mm2 = CG */      \
-    /*      mm6 = Y1, mm7 = Y2 */                \
-\
-    /* produce RGB */                            \
-    "movq      %%mm7, %%mm3\n\t"                 \
-    "movq      %%mm7, %%mm5\n\t"                 \
-    "paddsw    %%mm0, %%mm3\n\t"                 \
-    "paddsw    %%mm1, %%mm5\n\t"                 \
-    "paddsw    %%mm2, %%mm7\n\t"                 \
-    "paddsw    %%mm6, %%mm0\n\t"                 \
-    "paddsw    %%mm6, %%mm1\n\t"                 \
-    "paddsw    %%mm6, %%mm2\n\t"                 \
-
-#define RGB_PACK_INTERLEAVE                  \
-    /* pack and interleave even/odd pixels */    \
-    "packuswb  %%mm1, %%mm0\n\t"                 \
-    "packuswb  %%mm5, %%mm3\n\t"                 \
-    "packuswb  %%mm2, %%mm2\n\t"                 \
-    "movq      %%mm0, %%mm1\n\n"                 \
-    "packuswb  %%mm7, %%mm7\n\t"                 \
-    "punpcklbw %%mm3, %%mm0\n\t"                 \
-    "punpckhbw %%mm3, %%mm1\n\t"                 \
-    "punpcklbw %%mm7, %%mm2\n\t"                 \
-
-#define YUV2RGB_ENDLOOP(depth)                   \
-    "movq 8 (%5, %0, 2), %%mm6\n\t"              \
-    "movd 4 (%3, %0),    %%mm1\n\t"              \
-    "movd 4 (%2, %0),    %%mm0\n\t"              \
-    "add $"AV_STRINGIFY(depth * 8)", %1\n\t"     \
-    "add  $4, %0\n\t"                            \
-    "js   1b\n\t"                                \
-
-#define YUV2RGB_OPERANDS                                          \
-        : "+r" (index), "+r" (image)                              \
-        : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), \
-          "r" (py - 2*index)                                      \
-        );                                                        \
-    }                                                             \
-
-#define YUV2RGB_OPERANDS_ALPHA                                    \
-        : "+r" (index), "+r" (image)                              \
-        : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), \
-          "r" (py - 2*index), "r" (pa - 2*index)                  \
-        );                                                        \
-    }                                                             \
-
-#define YUV2RGB_ENDFUNC                          \
-    __asm__ volatile (SFENCE"\n\t"               \
-                    "emms    \n\t");             \
-    return srcSliceH;                            \
-
-#define IF0(x)
-#define IF1(x) x
-
-#define RGB_PACK16(gmask, is15)                  \
-    "pand      "MANGLE(mmx_redmask)", %%mm0\n\t" \
-    "pand      "MANGLE(mmx_redmask)", %%mm1\n\t" \
-    "movq      %%mm2,     %%mm3\n\t"             \
-    "psllw   $"AV_STRINGIFY(3-is15)", %%mm2\n\t" \
-    "psrlw   $"AV_STRINGIFY(5+is15)", %%mm3\n\t" \
-    "psrlw     $3,        %%mm0\n\t"             \
-    IF##is15("psrlw  $1,  %%mm1\n\t")            \
-    "pand "MANGLE(pb_e0)", %%mm2\n\t"            \
-    "pand "MANGLE(gmask)", %%mm3\n\t"            \
-    "por       %%mm2,     %%mm0\n\t"             \
-    "por       %%mm3,     %%mm1\n\t"             \
-    "movq      %%mm0,     %%mm2\n\t"             \
-    "punpcklbw %%mm1,     %%mm0\n\t"             \
-    "punpckhbw %%mm1,     %%mm2\n\t"             \
-    MOVNTQ "   %%mm0,      (%1)\n\t"             \
-    MOVNTQ "   %%mm2,     8(%1)\n\t"             \
-
-#define DITHER_RGB                               \
-    "paddusb "BLUE_DITHER"(%4),  %%mm0\n\t"      \
-    "paddusb "GREEN_DITHER"(%4), %%mm2\n\t"      \
-    "paddusb "RED_DITHER"(%4),   %%mm1\n\t"      \
-
-#if !COMPILE_TEMPLATE_MMXEXT
-static inline int RENAME(yuv420_rgb15)(SwsContext *c, const uint8_t *src[],
-                                       int srcStride[],
-                                       int srcSliceY, int srcSliceH,
-                                       uint8_t *dst[], int dstStride[])
-{
-    int y, h_size;
-
-    YUV2RGB_LOOP(2)
-
-#ifdef DITHER1XBPP
-        c->blueDither  = ff_dither8[y       & 1];
-        c->greenDither = ff_dither8[y       & 1];
-        c->redDither   = ff_dither8[(y + 1) & 1];
-#endif
-
-        YUV2RGB_INITIAL_LOAD
-        YUV2RGB
-        RGB_PACK_INTERLEAVE
-#ifdef DITHER1XBPP
-        DITHER_RGB
-#endif
-        RGB_PACK16(pb_03, 1)
-
-    YUV2RGB_ENDLOOP(2)
-    YUV2RGB_OPERANDS
-    YUV2RGB_ENDFUNC
-}
-
-static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t *src[],
-                                       int srcStride[],
-                                       int srcSliceY, int srcSliceH,
-                                       uint8_t *dst[], int dstStride[])
-{
-    int y, h_size;
-
-    YUV2RGB_LOOP(2)
-
-#ifdef DITHER1XBPP
-        c->blueDither  = ff_dither8[y       & 1];
-        c->greenDither = ff_dither4[y       & 1];
-        c->redDither   = ff_dither8[(y + 1) & 1];
-#endif
-
-        YUV2RGB_INITIAL_LOAD
-        YUV2RGB
-        RGB_PACK_INTERLEAVE
-#ifdef DITHER1XBPP
-        DITHER_RGB
-#endif
-        RGB_PACK16(pb_07, 0)
-
-    YUV2RGB_ENDLOOP(2)
-    YUV2RGB_OPERANDS
-    YUV2RGB_ENDFUNC
-}
-#endif /* !COMPILE_TEMPLATE_MMXEXT */
-
-#define RGB_PACK24(blue, red)\
-    "packuswb  %%mm3,      %%mm0 \n" /* R0 R2 R4 R6 R1 R3 R5 R7 */\
-    "packuswb  %%mm5,      %%mm1 \n" /* B0 B2 B4 B6 B1 B3 B5 B7 */\
-    "packuswb  %%mm7,      %%mm2 \n" /* G0 G2 G4 G6 G1 G3 G5 G7 */\
-    "movq      %%mm"red",  %%mm3 \n"\
-    "movq      %%mm"blue", %%mm6 \n"\
-    "psrlq     $32,        %%mm"red" \n" /* R1 R3 R5 R7 */\
-    "punpcklbw %%mm2,      %%mm3 \n" /* R0 G0 R2 G2 R4 G4 R6 G6 */\
-    "punpcklbw %%mm"red",  %%mm6 \n" /* B0 R1 B2 R3 B4 R5 B6 R7 */\
-    "movq      %%mm3,      %%mm5 \n"\
-    "punpckhbw %%mm"blue", %%mm2 \n" /* G1 B1 G3 B3 G5 B5 G7 B7 */\
-    "punpcklwd %%mm6,      %%mm3 \n" /* R0 G0 B0 R1 R2 G2 B2 R3 */\
-    "punpckhwd %%mm6,      %%mm5 \n" /* R4 G4 B4 R5 R6 G6 B6 R7 */\
-    RGB_PACK24_B
-
-#if COMPILE_TEMPLATE_MMXEXT
-DECLARE_ASM_CONST(8, int16_t, mask1101[4]) = {-1,-1, 0,-1};
-DECLARE_ASM_CONST(8, int16_t, mask0010[4]) = { 0, 0,-1, 0};
-DECLARE_ASM_CONST(8, int16_t, mask0110[4]) = { 0,-1,-1, 0};
-DECLARE_ASM_CONST(8, int16_t, mask1001[4]) = {-1, 0, 0,-1};
-DECLARE_ASM_CONST(8, int16_t, mask0100[4]) = { 0,-1, 0, 0};
-#undef RGB_PACK24_B
-#define RGB_PACK24_B\
-    "pshufw    $0xc6,  %%mm2, %%mm1 \n"\
-    "pshufw    $0x84,  %%mm3, %%mm6 \n"\
-    "pshufw    $0x38,  %%mm5, %%mm7 \n"\
-    "pand "MANGLE(mask1101)", %%mm6 \n" /* R0 G0 B0 R1 -- -- R2 G2 */\
-    "movq      %%mm1,         %%mm0 \n"\
-    "pand "MANGLE(mask0110)", %%mm7 \n" /* -- -- R6 G6 B6 R7 -- -- */\
-    "movq      %%mm1,         %%mm2 \n"\
-    "pand "MANGLE(mask0100)", %%mm1 \n" /* -- -- G3 B3 -- -- -- -- */\
-    "psrlq       $48,         %%mm3 \n" /* B2 R3 -- -- -- -- -- -- */\
-    "pand "MANGLE(mask0010)", %%mm0 \n" /* -- -- -- -- G1 B1 -- -- */\
-    "psllq       $32,         %%mm5 \n" /* -- -- -- -- R4 G4 B4 R5 */\
-    "pand "MANGLE(mask1001)", %%mm2 \n" /* G5 B5 -- -- -- -- G7 B7 */\
-    "por       %%mm3,         %%mm1 \n"\
-    "por       %%mm6,         %%mm0 \n"\
-    "por       %%mm5,         %%mm1 \n"\
-    "por       %%mm7,         %%mm2 \n"\
-    MOVNTQ"    %%mm0,          (%1) \n"\
-    MOVNTQ"    %%mm1,         8(%1) \n"\
-    MOVNTQ"    %%mm2,        16(%1) \n"\
-
-#else
-#undef RGB_PACK24_B
-#define RGB_PACK24_B\
-    "movd      %%mm3,       (%1) \n" /* R0 G0 B0 R1 */\
-    "movd      %%mm2,      4(%1) \n" /* G1 B1 */\
-    "psrlq     $32,        %%mm3 \n"\
-    "psrlq     $16,        %%mm2 \n"\
-    "movd      %%mm3,      6(%1) \n" /* R2 G2 B2 R3 */\
-    "movd      %%mm2,     10(%1) \n" /* G3 B3 */\
-    "psrlq     $16,        %%mm2 \n"\
-    "movd      %%mm5,     12(%1) \n" /* R4 G4 B4 R5 */\
-    "movd      %%mm2,     16(%1) \n" /* G5 B5 */\
-    "psrlq     $32,        %%mm5 \n"\
-    "movd      %%mm2,     20(%1) \n" /* -- -- G7 B7 */\
-    "movd      %%mm5,     18(%1) \n" /* R6 G6 B6 R7 */\
-
-#endif
-
-static inline int RENAME(yuv420_rgb24)(SwsContext *c, const uint8_t *src[],
-                                       int srcStride[],
-                                       int srcSliceY, int srcSliceH,
-                                       uint8_t *dst[], int dstStride[])
-{
-    int y, h_size;
-
-    YUV2RGB_LOOP(3)
-
-        YUV2RGB_INITIAL_LOAD
-        YUV2RGB
-        RGB_PACK24(REG_BLUE, REG_RED)
-
-    YUV2RGB_ENDLOOP(3)
-    YUV2RGB_OPERANDS
-    YUV2RGB_ENDFUNC
-}
-
-static inline int RENAME(yuv420_bgr24)(SwsContext *c, const uint8_t *src[],
-                                       int srcStride[],
-                                       int srcSliceY, int srcSliceH,
-                                       uint8_t *dst[], int dstStride[])
-{
-    int y, h_size;
-
-    YUV2RGB_LOOP(3)
-
-        YUV2RGB_INITIAL_LOAD
-        YUV2RGB
-        RGB_PACK24(REG_RED, REG_BLUE)
-
-    YUV2RGB_ENDLOOP(3)
-    YUV2RGB_OPERANDS
-    YUV2RGB_ENDFUNC
-}
-
-
-#define SET_EMPTY_ALPHA                                                      \
-    "pcmpeqd   %%mm"REG_ALPHA", %%mm"REG_ALPHA"\n\t" /* set alpha to 0xFF */ \
-
-#define LOAD_ALPHA                                   \
-    "movq      (%6, %0, 2),     %%mm"REG_ALPHA"\n\t" \
-
-#define RGB_PACK32(red, green, blue, alpha)  \
-    "movq      %%mm"blue",  %%mm5\n\t"       \
-    "movq      %%mm"red",   %%mm6\n\t"       \
-    "punpckhbw %%mm"green", %%mm5\n\t"       \
-    "punpcklbw %%mm"green", %%mm"blue"\n\t"  \
-    "punpckhbw %%mm"alpha", %%mm6\n\t"       \
-    "punpcklbw %%mm"alpha", %%mm"red"\n\t"   \
-    "movq      %%mm"blue",  %%mm"green"\n\t" \
-    "movq      %%mm5,       %%mm"alpha"\n\t" \
-    "punpcklwd %%mm"red",   %%mm"blue"\n\t"  \
-    "punpckhwd %%mm"red",   %%mm"green"\n\t" \
-    "punpcklwd %%mm6,       %%mm5\n\t"       \
-    "punpckhwd %%mm6,       %%mm"alpha"\n\t" \
-    MOVNTQ "   %%mm"blue",   0(%1)\n\t"      \
-    MOVNTQ "   %%mm"green",  8(%1)\n\t"      \
-    MOVNTQ "   %%mm5,       16(%1)\n\t"      \
-    MOVNTQ "   %%mm"alpha", 24(%1)\n\t"      \
-
-#if !COMPILE_TEMPLATE_MMXEXT
-static inline int RENAME(yuv420_rgb32)(SwsContext *c, const uint8_t *src[],
-                                       int srcStride[],
-                                       int srcSliceY, int srcSliceH,
-                                       uint8_t *dst[], int dstStride[])
-{
-    int y, h_size;
-
-    YUV2RGB_LOOP(4)
-
-        YUV2RGB_INITIAL_LOAD
-        YUV2RGB
-        RGB_PACK_INTERLEAVE
-        SET_EMPTY_ALPHA
-        RGB_PACK32(REG_RED, REG_GREEN, REG_BLUE, REG_ALPHA)
-
-    YUV2RGB_ENDLOOP(4)
-    YUV2RGB_OPERANDS
-    YUV2RGB_ENDFUNC
-}
-
-#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
-static inline int RENAME(yuva420_rgb32)(SwsContext *c, const uint8_t *src[],
-                                        int srcStride[],
-                                        int srcSliceY, int srcSliceH,
-                                        uint8_t *dst[], int dstStride[])
-{
-    int y, h_size;
-
-    YUV2RGB_LOOP(4)
-
-        const uint8_t *pa = src[3] + y * srcStride[3];
-        YUV2RGB_INITIAL_LOAD
-        YUV2RGB
-        RGB_PACK_INTERLEAVE
-        LOAD_ALPHA
-        RGB_PACK32(REG_RED, REG_GREEN, REG_BLUE, REG_ALPHA)
-
-    YUV2RGB_ENDLOOP(4)
-    YUV2RGB_OPERANDS_ALPHA
-    YUV2RGB_ENDFUNC
-}
-#endif
-
-static inline int RENAME(yuv420_bgr32)(SwsContext *c, const uint8_t *src[],
-                                       int srcStride[],
-                                       int srcSliceY, int srcSliceH,
-                                       uint8_t *dst[], int dstStride[])
-{
-    int y, h_size;
-
-    YUV2RGB_LOOP(4)
-
-        YUV2RGB_INITIAL_LOAD
-        YUV2RGB
-        RGB_PACK_INTERLEAVE
-        SET_EMPTY_ALPHA
-        RGB_PACK32(REG_BLUE, REG_GREEN, REG_RED, REG_ALPHA)
-
-    YUV2RGB_ENDLOOP(4)
-    YUV2RGB_OPERANDS
-    YUV2RGB_ENDFUNC
-}
-
-#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
-static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t *src[],
-                                        int srcStride[],
-                                        int srcSliceY, int srcSliceH,
-                                        uint8_t *dst[], int dstStride[])
-{
-    int y, h_size;
-
-    YUV2RGB_LOOP(4)
-
-        const uint8_t *pa = src[3] + y * srcStride[3];
-        YUV2RGB_INITIAL_LOAD
-        YUV2RGB
-        RGB_PACK_INTERLEAVE
-        LOAD_ALPHA
-        RGB_PACK32(REG_BLUE, REG_GREEN, REG_RED, REG_ALPHA)
-
-    YUV2RGB_ENDLOOP(4)
-    YUV2RGB_OPERANDS_ALPHA
-    YUV2RGB_ENDFUNC
-}
-#endif
-
-#endif /* !COMPILE_TEMPLATE_MMXEXT */
diff --git a/deps/libav/libswscale/yuv2rgb.c b/deps/libav/libswscale/yuv2rgb.c
deleted file mode 100644
index f939bbe..0000000
--- a/deps/libav/libswscale/yuv2rgb.c
+++ /dev/null
@@ -1,885 +0,0 @@
-/*
- * software YUV to RGB converter
- *
- * Copyright (C) 2009 Konstantin Shishkov
- *
- * 1,4,8bpp support and context / deglobalize stuff
- * by Michael Niedermayer (michaelni at gmx.at)
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include <assert.h>
-
-#include "libavutil/cpu.h"
-#include "libavutil/bswap.h"
-#include "config.h"
-#include "rgb2rgb.h"
-#include "swscale.h"
-#include "swscale_internal.h"
-
-const int32_t ff_yuv2rgb_coeffs[8][4] = {
-    { 117504, 138453, 13954, 34903 }, /* no sequence_display_extension */
-    { 117504, 138453, 13954, 34903 }, /* ITU-R Rec. 709 (1990) */
-    { 104597, 132201, 25675, 53279 }, /* unspecified */
-    { 104597, 132201, 25675, 53279 }, /* reserved */
-    { 104448, 132798, 24759, 53109 }, /* FCC */
-    { 104597, 132201, 25675, 53279 }, /* ITU-R Rec. 624-4 System B, G */
-    { 104597, 132201, 25675, 53279 }, /* SMPTE 170M */
-    { 117579, 136230, 16907, 35559 }  /* SMPTE 240M (1987) */
-};
-
-const int *sws_getCoefficients(int colorspace)
-{
-    if (colorspace > 7 || colorspace < 0)
-        colorspace = SWS_CS_DEFAULT;
-    return ff_yuv2rgb_coeffs[colorspace];
-}
-
-#define LOADCHROMA(i)                               \
-    U = pu[i];                                      \
-    V = pv[i];                                      \
-    r = (void *)c->table_rV[V];                     \
-    g = (void *)(c->table_gU[U] + c->table_gV[V]);  \
-    b = (void *)c->table_bU[U];
-
-#define PUTRGB(dst, src, i)                         \
-    Y              = src[2 * i];                    \
-    dst[2 * i]     = r[Y] + g[Y] + b[Y];            \
-    Y              = src[2 * i + 1];                \
-    dst[2 * i + 1] = r[Y] + g[Y] + b[Y];
-
-#define PUTRGB24(dst, src, i)                       \
-    Y              = src[2 * i];                    \
-    dst[6 * i + 0] = r[Y];                          \
-    dst[6 * i + 1] = g[Y];                          \
-    dst[6 * i + 2] = b[Y];                          \
-    Y              = src[2 * i + 1];                \
-    dst[6 * i + 3] = r[Y];                          \
-    dst[6 * i + 4] = g[Y];                          \
-    dst[6 * i + 5] = b[Y];
-
-#define PUTBGR24(dst, src, i)                       \
-    Y              = src[2 * i];                    \
-    dst[6 * i + 0] = b[Y];                          \
-    dst[6 * i + 1] = g[Y];                          \
-    dst[6 * i + 2] = r[Y];                          \
-    Y              = src[2 * i + 1];                \
-    dst[6 * i + 3] = b[Y];                          \
-    dst[6 * i + 4] = g[Y];                          \
-    dst[6 * i + 5] = r[Y];
-
-#define PUTRGBA(dst, ysrc, asrc, i, s)                                  \
-    Y              = ysrc[2 * i];                                       \
-    dst[2 * i]     = r[Y] + g[Y] + b[Y] + (asrc[2 * i]     << s);       \
-    Y              = ysrc[2 * i + 1];                                   \
-    dst[2 * i + 1] = r[Y] + g[Y] + b[Y] + (asrc[2 * i + 1] << s);
-
-#define PUTRGB48(dst, src, i)                       \
-    Y                = src[ 2 * i];                 \
-    dst[12 * i +  0] = dst[12 * i +  1] = r[Y];     \
-    dst[12 * i +  2] = dst[12 * i +  3] = g[Y];     \
-    dst[12 * i +  4] = dst[12 * i +  5] = b[Y];     \
-    Y                = src[ 2 * i + 1];             \
-    dst[12 * i +  6] = dst[12 * i +  7] = r[Y];     \
-    dst[12 * i +  8] = dst[12 * i +  9] = g[Y];     \
-    dst[12 * i + 10] = dst[12 * i + 11] = b[Y];
-
-#define PUTBGR48(dst, src, i)                       \
-    Y                = src[2 * i];                  \
-    dst[12 * i +  0] = dst[12 * i +  1] = b[Y];     \
-    dst[12 * i +  2] = dst[12 * i +  3] = g[Y];     \
-    dst[12 * i +  4] = dst[12 * i +  5] = r[Y];     \
-    Y                = src[2  * i +  1];            \
-    dst[12 * i +  6] = dst[12 * i +  7] = b[Y];     \
-    dst[12 * i +  8] = dst[12 * i +  9] = g[Y];     \
-    dst[12 * i + 10] = dst[12 * i + 11] = r[Y];
-
-#define YUV2RGBFUNC(func_name, dst_type, alpha)                             \
-    static int func_name(SwsContext *c, const uint8_t *src[],               \
-                         int srcStride[], int srcSliceY, int srcSliceH,     \
-                         uint8_t *dst[], int dstStride[])                   \
-    {                                                                       \
-        int y;                                                              \
-                                                                            \
-        if (!alpha && c->srcFormat == AV_PIX_FMT_YUV422P) {                    \
-            srcStride[1] *= 2;                                              \
-            srcStride[2] *= 2;                                              \
-        }                                                                   \
-        for (y = 0; y < srcSliceH; y += 2) {                                \
-            dst_type *dst_1 =                                               \
-                (dst_type *)(dst[0] + (y + srcSliceY)     * dstStride[0]);  \
-            dst_type *dst_2 =                                               \
-                (dst_type *)(dst[0] + (y + srcSliceY + 1) * dstStride[0]);  \
-            dst_type av_unused *r, *g, *b;                                  \
-            const uint8_t *py_1 = src[0] +  y       * srcStride[0];         \
-            const uint8_t *py_2 = py_1   +            srcStride[0];         \
-            const uint8_t *pu   = src[1] + (y >> 1) * srcStride[1];         \
-            const uint8_t *pv   = src[2] + (y >> 1) * srcStride[2];         \
-            const uint8_t av_unused *pa_1, *pa_2;                           \
-            unsigned int h_size = c->dstW >> 3;                             \
-            if (alpha) {                                                    \
-                pa_1 = src[3] + y * srcStride[3];                           \
-                pa_2 = pa_1   +     srcStride[3];                           \
-            }                                                               \
-            while (h_size--) {                                              \
-                int av_unused U, V, Y;                                      \
-
-#define ENDYUV2RGBLINE(dst_delta, ss)               \
-    pu    += 4 >> ss;                               \
-    pv    += 4 >> ss;                               \
-    py_1  += 8 >> ss;                               \
-    py_2  += 8 >> ss;                               \
-    dst_1 += dst_delta >> ss;                       \
-    dst_2 += dst_delta >> ss;                       \
-    }                                               \
-    if (c->dstW & (4 >> ss)) {                      \
-        int av_unused Y, U, V;                      \
-
-#define ENDYUV2RGBFUNC()                            \
-            }                                       \
-        }                                           \
-        return srcSliceH;                           \
-    }
-
-#define CLOSEYUV2RGBFUNC(dst_delta)                 \
-    ENDYUV2RGBLINE(dst_delta, 0)                    \
-    ENDYUV2RGBFUNC()
-
-YUV2RGBFUNC(yuv2rgb_c_48, uint8_t, 0)
-    LOADCHROMA(0);
-    PUTRGB48(dst_1, py_1, 0);
-    PUTRGB48(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTRGB48(dst_2, py_2, 1);
-    PUTRGB48(dst_1, py_1, 1);
-
-    LOADCHROMA(2);
-    PUTRGB48(dst_1, py_1, 2);
-    PUTRGB48(dst_2, py_2, 2);
-
-    LOADCHROMA(3);
-    PUTRGB48(dst_2, py_2, 3);
-    PUTRGB48(dst_1, py_1, 3);
-ENDYUV2RGBLINE(48, 0)
-    LOADCHROMA(0);
-    PUTRGB48(dst_1, py_1, 0);
-    PUTRGB48(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTRGB48(dst_2, py_2, 1);
-    PUTRGB48(dst_1, py_1, 1);
-ENDYUV2RGBLINE(48, 1)
-    LOADCHROMA(0);
-    PUTRGB48(dst_1, py_1, 0);
-    PUTRGB48(dst_2, py_2, 0);
-ENDYUV2RGBFUNC()
-
-YUV2RGBFUNC(yuv2rgb_c_bgr48, uint8_t, 0)
-    LOADCHROMA(0);
-    PUTBGR48(dst_1, py_1, 0);
-    PUTBGR48(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTBGR48(dst_2, py_2, 1);
-    PUTBGR48(dst_1, py_1, 1);
-
-    LOADCHROMA(2);
-    PUTBGR48(dst_1, py_1, 2);
-    PUTBGR48(dst_2, py_2, 2);
-
-    LOADCHROMA(3);
-    PUTBGR48(dst_2, py_2, 3);
-    PUTBGR48(dst_1, py_1, 3);
-ENDYUV2RGBLINE(48, 0)
-    LOADCHROMA(0);
-    PUTBGR48(dst_1, py_1, 0);
-    PUTBGR48(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTBGR48(dst_2, py_2, 1);
-    PUTBGR48(dst_1, py_1, 1);
-ENDYUV2RGBLINE(48, 1)
-    LOADCHROMA(0);
-    PUTBGR48(dst_1, py_1, 0);
-    PUTBGR48(dst_2, py_2, 0);
-ENDYUV2RGBFUNC()
-
-YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0)
-    LOADCHROMA(0);
-    PUTRGB(dst_1, py_1, 0);
-    PUTRGB(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTRGB(dst_2, py_2, 1);
-    PUTRGB(dst_1, py_1, 1);
-
-    LOADCHROMA(2);
-    PUTRGB(dst_1, py_1, 2);
-    PUTRGB(dst_2, py_2, 2);
-
-    LOADCHROMA(3);
-    PUTRGB(dst_2, py_2, 3);
-    PUTRGB(dst_1, py_1, 3);
-ENDYUV2RGBLINE(8, 0)
-    LOADCHROMA(0);
-    PUTRGB(dst_1, py_1, 0);
-    PUTRGB(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTRGB(dst_2, py_2, 1);
-    PUTRGB(dst_1, py_1, 1);
-ENDYUV2RGBLINE(8, 1)
-    LOADCHROMA(0);
-    PUTRGB(dst_1, py_1, 0);
-    PUTRGB(dst_2, py_2, 0);
-ENDYUV2RGBFUNC()
-
-YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1)
-    LOADCHROMA(0);
-    PUTRGBA(dst_1, py_1, pa_1, 0, 24);
-    PUTRGBA(dst_2, py_2, pa_2, 0, 24);
-
-    LOADCHROMA(1);
-    PUTRGBA(dst_2, py_2, pa_2, 1, 24);
-    PUTRGBA(dst_1, py_1, pa_1, 1, 24);
-
-    LOADCHROMA(2);
-    PUTRGBA(dst_1, py_1, pa_1, 2, 24);
-    PUTRGBA(dst_2, py_2, pa_2, 2, 24);
-
-    LOADCHROMA(3);
-    PUTRGBA(dst_2, py_2, pa_2, 3, 24);
-    PUTRGBA(dst_1, py_1, pa_1, 3, 24);
-    pa_1 += 8;
-    pa_2 += 8;
-ENDYUV2RGBLINE(8, 0)
-    LOADCHROMA(0);
-    PUTRGBA(dst_1, py_1, pa_1, 0, 24);
-    PUTRGBA(dst_2, py_2, pa_2, 0, 24);
-
-    LOADCHROMA(1);
-    PUTRGBA(dst_2, py_2, pa_2, 1, 24);
-    PUTRGBA(dst_1, py_1, pa_1, 1, 24);
-    pa_1 += 4;
-    pa_2 += 4;
-ENDYUV2RGBLINE(8, 1)
-    LOADCHROMA(0);
-    PUTRGBA(dst_1, py_1, pa_1, 0, 24);
-    PUTRGBA(dst_2, py_2, pa_2, 0, 24);
-ENDYUV2RGBFUNC()
-
-YUV2RGBFUNC(yuva2argb_c, uint32_t, 1)
-    LOADCHROMA(0);
-    PUTRGBA(dst_1, py_1, pa_1, 0, 0);
-    PUTRGBA(dst_2, py_2, pa_2, 0, 0);
-
-    LOADCHROMA(1);
-    PUTRGBA(dst_2, py_2, pa_2, 1, 0);
-    PUTRGBA(dst_1, py_1, pa_1, 1, 0);
-
-    LOADCHROMA(2);
-    PUTRGBA(dst_1, py_1, pa_1, 2, 0);
-    PUTRGBA(dst_2, py_2, pa_2, 2, 0);
-
-    LOADCHROMA(3);
-    PUTRGBA(dst_2, py_2, pa_2, 3, 0);
-    PUTRGBA(dst_1, py_1, pa_1, 3, 0);
-    pa_1 += 8;
-    pa_2 += 8;
-ENDYUV2RGBLINE(8, 0)
-    LOADCHROMA(0);
-    PUTRGBA(dst_1, py_1, pa_1, 0, 0);
-    PUTRGBA(dst_2, py_2, pa_2, 0, 0);
-
-    LOADCHROMA(1);
-    PUTRGBA(dst_2, py_2, pa_2, 1, 0);
-    PUTRGBA(dst_1, py_1, pa_1, 1, 0);
-    pa_1 += 4;
-    pa_2 += 4;
-ENDYUV2RGBLINE(8, 1)
-    LOADCHROMA(0);
-    PUTRGBA(dst_1, py_1, pa_1, 0, 0);
-    PUTRGBA(dst_2, py_2, pa_2, 0, 0);
-ENDYUV2RGBFUNC()
-
-YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0)
-    LOADCHROMA(0);
-    PUTRGB24(dst_1, py_1, 0);
-    PUTRGB24(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTRGB24(dst_2, py_2, 1);
-    PUTRGB24(dst_1, py_1, 1);
-
-    LOADCHROMA(2);
-    PUTRGB24(dst_1, py_1, 2);
-    PUTRGB24(dst_2, py_2, 2);
-
-    LOADCHROMA(3);
-    PUTRGB24(dst_2, py_2, 3);
-    PUTRGB24(dst_1, py_1, 3);
-ENDYUV2RGBLINE(24, 0)
-    LOADCHROMA(0);
-    PUTRGB24(dst_1, py_1, 0);
-    PUTRGB24(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTRGB24(dst_2, py_2, 1);
-    PUTRGB24(dst_1, py_1, 1);
-ENDYUV2RGBLINE(24, 1)
-    LOADCHROMA(0);
-    PUTRGB24(dst_1, py_1, 0);
-    PUTRGB24(dst_2, py_2, 0);
-ENDYUV2RGBFUNC()
-
-// only trivial mods from yuv2rgb_c_24_rgb
-YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t, 0)
-    LOADCHROMA(0);
-    PUTBGR24(dst_1, py_1, 0);
-    PUTBGR24(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTBGR24(dst_2, py_2, 1);
-    PUTBGR24(dst_1, py_1, 1);
-
-    LOADCHROMA(2);
-    PUTBGR24(dst_1, py_1, 2);
-    PUTBGR24(dst_2, py_2, 2);
-
-    LOADCHROMA(3);
-    PUTBGR24(dst_2, py_2, 3);
-    PUTBGR24(dst_1, py_1, 3);
-ENDYUV2RGBLINE(24, 0)
-    LOADCHROMA(0);
-    PUTBGR24(dst_1, py_1, 0);
-    PUTBGR24(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTBGR24(dst_2, py_2, 1);
-    PUTBGR24(dst_1, py_1, 1);
-ENDYUV2RGBLINE(24, 1)
-    LOADCHROMA(0);
-    PUTBGR24(dst_1, py_1, 0);
-    PUTBGR24(dst_2, py_2, 0);
-ENDYUV2RGBFUNC()
-
-// This is exactly the same code as yuv2rgb_c_32 except for the types of
-// r, g, b, dst_1, dst_2
-YUV2RGBFUNC(yuv2rgb_c_16, uint16_t, 0)
-    LOADCHROMA(0);
-    PUTRGB(dst_1, py_1, 0);
-    PUTRGB(dst_2, py_2, 0);
-
-    LOADCHROMA(1);
-    PUTRGB(dst_2, py_2, 1);
-    PUTRGB(dst_1, py_1, 1);
-
-    LOADCHROMA(2);
-    PUTRGB(dst_1, py_1, 2);
-    PUTRGB(dst_2, py_2, 2);
-
-    LOADCHROMA(3);
-    PUTRGB(dst_2, py_2, 3);
-    PUTRGB(dst_1, py_1, 3);
-CLOSEYUV2RGBFUNC(8)
-
-// r, g, b, dst_1, dst_2
-YUV2RGBFUNC(yuv2rgb_c_12_ordered_dither, uint16_t, 0)
-    const uint8_t *d16 = ff_dither_4x4_16[y & 3];
-
-#define PUTRGB12(dst, src, i, o)                    \
-    Y              = src[2 * i];                    \
-    dst[2 * i]     = r[Y + d16[0 + o]] +            \
-                     g[Y + d16[0 + o]] +            \
-                     b[Y + d16[0 + o]];             \
-    Y              = src[2 * i + 1];                \
-    dst[2 * i + 1] = r[Y + d16[1 + o]] +            \
-                     g[Y + d16[1 + o]] +            \
-                     b[Y + d16[1 + o]];
-
-    LOADCHROMA(0);
-    PUTRGB12(dst_1, py_1, 0, 0);
-    PUTRGB12(dst_2, py_2, 0, 0 + 8);
-
-    LOADCHROMA(1);
-    PUTRGB12(dst_2, py_2, 1, 2 + 8);
-    PUTRGB12(dst_1, py_1, 1, 2);
-
-    LOADCHROMA(2);
-    PUTRGB12(dst_1, py_1, 2, 4);
-    PUTRGB12(dst_2, py_2, 2, 4 + 8);
-
-    LOADCHROMA(3);
-    PUTRGB12(dst_2, py_2, 3, 6 + 8);
-    PUTRGB12(dst_1, py_1, 3, 6);
-CLOSEYUV2RGBFUNC(8)
-
-// r, g, b, dst_1, dst_2
-YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0)
-    const uint8_t *d32 = ff_dither_8x8_32[y & 7];
-    const uint8_t *d64 = ff_dither_8x8_73[y & 7];
-
-#define PUTRGB8(dst, src, i, o)                     \
-    Y              = src[2 * i];                    \
-    dst[2 * i]     = r[Y + d32[0 + o]] +            \
-                     g[Y + d32[0 + o]] +            \
-                     b[Y + d64[0 + o]];             \
-    Y              = src[2 * i + 1];                \
-    dst[2 * i + 1] = r[Y + d32[1 + o]] +            \
-                     g[Y + d32[1 + o]] +            \
-                     b[Y + d64[1 + o]];
-
-    LOADCHROMA(0);
-    PUTRGB8(dst_1, py_1, 0, 0);
-    PUTRGB8(dst_2, py_2, 0, 0 + 8);
-
-    LOADCHROMA(1);
-    PUTRGB8(dst_2, py_2, 1, 2 + 8);
-    PUTRGB8(dst_1, py_1, 1, 2);
-
-    LOADCHROMA(2);
-    PUTRGB8(dst_1, py_1, 2, 4);
-    PUTRGB8(dst_2, py_2, 2, 4 + 8);
-
-    LOADCHROMA(3);
-    PUTRGB8(dst_2, py_2, 3, 6 + 8);
-    PUTRGB8(dst_1, py_1, 3, 6);
-CLOSEYUV2RGBFUNC(8)
-
-YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0)
-    const uint8_t * d64 = ff_dither_8x8_73[y & 7];
-    const uint8_t *d128 = ff_dither_8x8_220[y & 7];
-    int acc;
-
-#define PUTRGB4D(dst, src, i, o)                    \
-    Y      = src[2 * i];                            \
-    acc    = r[Y + d128[0 + o]] +                   \
-             g[Y +  d64[0 + o]] +                   \
-             b[Y + d128[0 + o]];                    \
-    Y      = src[2 * i + 1];                        \
-    acc   |= (r[Y + d128[1 + o]] +                  \
-              g[Y +  d64[1 + o]] +                  \
-              b[Y + d128[1 + o]]) << 4;             \
-    dst[i] = acc;
-
-    LOADCHROMA(0);
-    PUTRGB4D(dst_1, py_1, 0, 0);
-    PUTRGB4D(dst_2, py_2, 0, 0 + 8);
-
-    LOADCHROMA(1);
-    PUTRGB4D(dst_2, py_2, 1, 2 + 8);
-    PUTRGB4D(dst_1, py_1, 1, 2);
-
-    LOADCHROMA(2);
-    PUTRGB4D(dst_1, py_1, 2, 4);
-    PUTRGB4D(dst_2, py_2, 2, 4 + 8);
-
-    LOADCHROMA(3);
-    PUTRGB4D(dst_2, py_2, 3, 6 + 8);
-    PUTRGB4D(dst_1, py_1, 3, 6);
-CLOSEYUV2RGBFUNC(4)
-
-YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0)
-    const uint8_t *d64  = ff_dither_8x8_73[y & 7];
-    const uint8_t *d128 = ff_dither_8x8_220[y & 7];
-
-#define PUTRGB4DB(dst, src, i, o)                   \
-    Y              = src[2 * i];                    \
-    dst[2 * i]     = r[Y + d128[0 + o]] +           \
-                     g[Y +  d64[0 + o]] +           \
-                     b[Y + d128[0 + o]];            \
-    Y              = src[2 * i + 1];                \
-    dst[2 * i + 1] = r[Y + d128[1 + o]] +           \
-                     g[Y +  d64[1 + o]] +           \
-                     b[Y + d128[1 + o]];
-
-    LOADCHROMA(0);
-    PUTRGB4DB(dst_1, py_1, 0, 0);
-    PUTRGB4DB(dst_2, py_2, 0, 0 + 8);
-
-    LOADCHROMA(1);
-    PUTRGB4DB(dst_2, py_2, 1, 2 + 8);
-    PUTRGB4DB(dst_1, py_1, 1, 2);
-
-    LOADCHROMA(2);
-    PUTRGB4DB(dst_1, py_1, 2, 4);
-    PUTRGB4DB(dst_2, py_2, 2, 4 + 8);
-
-    LOADCHROMA(3);
-    PUTRGB4DB(dst_2, py_2, 3, 6 + 8);
-    PUTRGB4DB(dst_1, py_1, 3, 6);
-CLOSEYUV2RGBFUNC(8)
-
-YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t, 0)
-    const uint8_t *d128 = ff_dither_8x8_220[y & 7];
-    char out_1 = 0, out_2 = 0;
-    g = c->table_gU[128] + c->table_gV[128];
-
-#define PUTRGB1(out, src, i, o)                     \
-    Y    = src[2 * i];                              \
-    out += out + g[Y + d128[0 + o]];                \
-    Y    = src[2 * i + 1];                          \
-    out += out + g[Y + d128[1 + o]];
-
-    PUTRGB1(out_1, py_1, 0, 0);
-    PUTRGB1(out_2, py_2, 0, 0 + 8);
-
-    PUTRGB1(out_2, py_2, 1, 2 + 8);
-    PUTRGB1(out_1, py_1, 1, 2);
-
-    PUTRGB1(out_1, py_1, 2, 4);
-    PUTRGB1(out_2, py_2, 2, 4 + 8);
-
-    PUTRGB1(out_2, py_2, 3, 6 + 8);
-    PUTRGB1(out_1, py_1, 3, 6);
-
-    dst_1[0] = out_1;
-    dst_2[0] = out_2;
-CLOSEYUV2RGBFUNC(1)
-
-SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
-{
-    SwsFunc t = NULL;
-
-    if (ARCH_BFIN)
-        t = ff_yuv2rgb_init_bfin(c);
-    if (ARCH_PPC)
-        t = ff_yuv2rgb_init_ppc(c);
-    if (HAVE_VIS)
-        t = ff_yuv2rgb_init_vis(c);
-    if (ARCH_X86)
-        t = ff_yuv2rgb_init_x86(c);
-
-    if (t)
-        return t;
-
-    av_log(c, AV_LOG_WARNING,
-           "No accelerated colorspace conversion found from %s to %s.\n",
-           sws_format_name(c->srcFormat), sws_format_name(c->dstFormat));
-
-    switch (c->dstFormat) {
-    case AV_PIX_FMT_BGR48BE:
-    case AV_PIX_FMT_BGR48LE:
-        return yuv2rgb_c_bgr48;
-    case AV_PIX_FMT_RGB48BE:
-    case AV_PIX_FMT_RGB48LE:
-        return yuv2rgb_c_48;
-    case AV_PIX_FMT_ARGB:
-    case AV_PIX_FMT_ABGR:
-        if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P)
-            return yuva2argb_c;
-    case AV_PIX_FMT_RGBA:
-    case AV_PIX_FMT_BGRA:
-        if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P)
-            return yuva2rgba_c;
-        else
-            return yuv2rgb_c_32;
-    case AV_PIX_FMT_RGB24:
-        return yuv2rgb_c_24_rgb;
-    case AV_PIX_FMT_BGR24:
-        return yuv2rgb_c_24_bgr;
-    case AV_PIX_FMT_RGB565:
-    case AV_PIX_FMT_BGR565:
-    case AV_PIX_FMT_RGB555:
-    case AV_PIX_FMT_BGR555:
-        return yuv2rgb_c_16;
-    case AV_PIX_FMT_RGB444:
-    case AV_PIX_FMT_BGR444:
-        return yuv2rgb_c_12_ordered_dither;
-    case AV_PIX_FMT_RGB8:
-    case AV_PIX_FMT_BGR8:
-        return yuv2rgb_c_8_ordered_dither;
-    case AV_PIX_FMT_RGB4:
-    case AV_PIX_FMT_BGR4:
-        return yuv2rgb_c_4_ordered_dither;
-    case AV_PIX_FMT_RGB4_BYTE:
-    case AV_PIX_FMT_BGR4_BYTE:
-        return yuv2rgb_c_4b_ordered_dither;
-    case AV_PIX_FMT_MONOBLACK:
-        return yuv2rgb_c_1_ordered_dither;
-    default:
-        assert(0);
-    }
-    return NULL;
-}
-
-static void fill_table(uint8_t *table[256], const int elemsize,
-                       const int inc, void *y_tab)
-{
-    int i;
-    int64_t cb       = 0;
-    uint8_t *y_table = y_tab;
-
-    y_table -= elemsize * (inc >> 9);
-
-    for (i = 0; i < 256; i++) {
-        table[i] = y_table + elemsize * (cb >> 16);
-        cb      += inc;
-    }
-}
-
-static void fill_gv_table(int table[256], const int elemsize, const int inc)
-{
-    int i;
-    int64_t cb = 0;
-    int off    = -(inc >> 9);
-
-    for (i = 0; i < 256; i++) {
-        table[i] = elemsize * (off + (cb >> 16));
-        cb      += inc;
-    }
-}
-
-static uint16_t roundToInt16(int64_t f)
-{
-    int r = (f + (1 << 15)) >> 16;
-
-    if (r < -0x7FFF)
-        return 0x8000;
-    else if (r > 0x7FFF)
-        return 0x7FFF;
-    else
-        return r;
-}
-
-av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
-                                     int fullRange, int brightness,
-                                     int contrast, int saturation)
-{
-    const int isRgb = c->dstFormat == AV_PIX_FMT_RGB32     ||
-                      c->dstFormat == AV_PIX_FMT_RGB32_1   ||
-                      c->dstFormat == AV_PIX_FMT_BGR24     ||
-                      c->dstFormat == AV_PIX_FMT_RGB565BE  ||
-                      c->dstFormat == AV_PIX_FMT_RGB565LE  ||
-                      c->dstFormat == AV_PIX_FMT_RGB555BE  ||
-                      c->dstFormat == AV_PIX_FMT_RGB555LE  ||
-                      c->dstFormat == AV_PIX_FMT_RGB444BE  ||
-                      c->dstFormat == AV_PIX_FMT_RGB444LE  ||
-                      c->dstFormat == AV_PIX_FMT_RGB8      ||
-                      c->dstFormat == AV_PIX_FMT_RGB4      ||
-                      c->dstFormat == AV_PIX_FMT_RGB4_BYTE ||
-                      c->dstFormat == AV_PIX_FMT_MONOBLACK;
-    const int isNotNe = c->dstFormat == AV_PIX_FMT_NE(RGB565LE, RGB565BE) ||
-                        c->dstFormat == AV_PIX_FMT_NE(RGB555LE, RGB555BE) ||
-                        c->dstFormat == AV_PIX_FMT_NE(RGB444LE, RGB444BE) ||
-                        c->dstFormat == AV_PIX_FMT_NE(BGR565LE, BGR565BE) ||
-                        c->dstFormat == AV_PIX_FMT_NE(BGR555LE, BGR555BE) ||
-                        c->dstFormat == AV_PIX_FMT_NE(BGR444LE, BGR444BE);
-    const int bpp = c->dstFormatBpp;
-    uint8_t *y_table;
-    uint16_t *y_table16;
-    uint32_t *y_table32;
-    int i, base, rbase, gbase, bbase, abase, needAlpha;
-    const int yoffs = fullRange ? 384 : 326;
-
-    int64_t crv =  inv_table[0];
-    int64_t cbu =  inv_table[1];
-    int64_t cgu = -inv_table[2];
-    int64_t cgv = -inv_table[3];
-    int64_t cy  = 1 << 16;
-    int64_t oy  = 0;
-    int64_t yb  = 0;
-
-    if (!fullRange) {
-        cy = (cy * 255) / 219;
-        oy = 16 << 16;
-    } else {
-        crv = (crv * 224) / 255;
-        cbu = (cbu * 224) / 255;
-        cgu = (cgu * 224) / 255;
-        cgv = (cgv * 224) / 255;
-    }
-
-    cy   = (cy  * contrast)              >> 16;
-    crv  = (crv * contrast * saturation) >> 32;
-    cbu  = (cbu * contrast * saturation) >> 32;
-    cgu  = (cgu * contrast * saturation) >> 32;
-    cgv  = (cgv * contrast * saturation) >> 32;
-    oy  -= 256 * brightness;
-
-    c->uOffset = 0x0400040004000400LL;
-    c->vOffset = 0x0400040004000400LL;
-    c->yCoeff  = roundToInt16(cy  * 8192) * 0x0001000100010001ULL;
-    c->vrCoeff = roundToInt16(crv * 8192) * 0x0001000100010001ULL;
-    c->ubCoeff = roundToInt16(cbu * 8192) * 0x0001000100010001ULL;
-    c->vgCoeff = roundToInt16(cgv * 8192) * 0x0001000100010001ULL;
-    c->ugCoeff = roundToInt16(cgu * 8192) * 0x0001000100010001ULL;
-    c->yOffset = roundToInt16(oy  *    8) * 0x0001000100010001ULL;
-
-    c->yuv2rgb_y_coeff   = (int16_t)roundToInt16(cy  << 13);
-    c->yuv2rgb_y_offset  = (int16_t)roundToInt16(oy  <<  9);
-    c->yuv2rgb_v2r_coeff = (int16_t)roundToInt16(crv << 13);
-    c->yuv2rgb_v2g_coeff = (int16_t)roundToInt16(cgv << 13);
-    c->yuv2rgb_u2g_coeff = (int16_t)roundToInt16(cgu << 13);
-    c->yuv2rgb_u2b_coeff = (int16_t)roundToInt16(cbu << 13);
-
-    //scale coefficients by cy
-    crv = ((crv << 16) + 0x8000) / cy;
-    cbu = ((cbu << 16) + 0x8000) / cy;
-    cgu = ((cgu << 16) + 0x8000) / cy;
-    cgv = ((cgv << 16) + 0x8000) / cy;
-
-    av_free(c->yuvTable);
-
-    switch (bpp) {
-    case 1:
-        c->yuvTable = av_malloc(1024);
-        y_table     = c->yuvTable;
-        yb = -(384 << 16) - oy;
-        for (i = 0; i < 1024 - 110; i++) {
-            y_table[i + 110]  = av_clip_uint8((yb + 0x8000) >> 16) >> 7;
-            yb               += cy;
-        }
-        fill_table(c->table_gU, 1, cgu, y_table + yoffs);
-        fill_gv_table(c->table_gV, 1, cgv);
-        break;
-    case 4:
-    case 4 | 128:
-        rbase       = isRgb ? 3 : 0;
-        gbase       = 1;
-        bbase       = isRgb ? 0 : 3;
-        c->yuvTable = av_malloc(1024 * 3);
-        y_table     = c->yuvTable;
-        yb = -(384 << 16) - oy;
-        for (i = 0; i < 1024 - 110; i++) {
-            int yval                = av_clip_uint8((yb + 0x8000) >> 16);
-            y_table[i + 110]        = (yval >> 7)        << rbase;
-            y_table[i +  37 + 1024] = ((yval + 43) / 85) << gbase;
-            y_table[i + 110 + 2048] = (yval >> 7)        << bbase;
-            yb += cy;
-        }
-        fill_table(c->table_rV, 1, crv, y_table + yoffs);
-        fill_table(c->table_gU, 1, cgu, y_table + yoffs + 1024);
-        fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2048);
-        fill_gv_table(c->table_gV, 1, cgv);
-        break;
-    case 8:
-        rbase       = isRgb ? 5 : 0;
-        gbase       = isRgb ? 2 : 3;
-        bbase       = isRgb ? 0 : 6;
-        c->yuvTable = av_malloc(1024 * 3);
-        y_table     = c->yuvTable;
-        yb = -(384 << 16) - oy;
-        for (i = 0; i < 1024 - 38; i++) {
-            int yval               = av_clip_uint8((yb + 0x8000) >> 16);
-            y_table[i + 16]        = ((yval + 18) / 36) << rbase;
-            y_table[i + 16 + 1024] = ((yval + 18) / 36) << gbase;
-            y_table[i + 37 + 2048] = ((yval + 43) / 85) << bbase;
-            yb += cy;
-        }
-        fill_table(c->table_rV, 1, crv, y_table + yoffs);
-        fill_table(c->table_gU, 1, cgu, y_table + yoffs + 1024);
-        fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2048);
-        fill_gv_table(c->table_gV, 1, cgv);
-        break;
-    case 12:
-        rbase       = isRgb ? 8 : 0;
-        gbase       = 4;
-        bbase       = isRgb ? 0 : 8;
-        c->yuvTable = av_malloc(1024 * 3 * 2);
-        y_table16   = c->yuvTable;
-        yb = -(384 << 16) - oy;
-        for (i = 0; i < 1024; i++) {
-            uint8_t yval        = av_clip_uint8((yb + 0x8000) >> 16);
-            y_table16[i]        = (yval >> 4) << rbase;
-            y_table16[i + 1024] = (yval >> 4) << gbase;
-            y_table16[i + 2048] = (yval >> 4) << bbase;
-            yb += cy;
-        }
-        if (isNotNe)
-            for (i = 0; i < 1024 * 3; i++)
-                y_table16[i] = av_bswap16(y_table16[i]);
-        fill_table(c->table_rV, 2, crv, y_table16 + yoffs);
-        fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + 1024);
-        fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2048);
-        fill_gv_table(c->table_gV, 2, cgv);
-        break;
-    case 15:
-    case 16:
-        rbase       = isRgb ? bpp - 5 : 0;
-        gbase       = 5;
-        bbase       = isRgb ? 0 : (bpp - 5);
-        c->yuvTable = av_malloc(1024 * 3 * 2);
-        y_table16   = c->yuvTable;
-        yb = -(384 << 16) - oy;
-        for (i = 0; i < 1024; i++) {
-            uint8_t yval        = av_clip_uint8((yb + 0x8000) >> 16);
-            y_table16[i]        = (yval >> 3)          << rbase;
-            y_table16[i + 1024] = (yval >> (18 - bpp)) << gbase;
-            y_table16[i + 2048] = (yval >> 3)          << bbase;
-            yb += cy;
-        }
-        if (isNotNe)
-            for (i = 0; i < 1024 * 3; i++)
-                y_table16[i] = av_bswap16(y_table16[i]);
-        fill_table(c->table_rV, 2, crv, y_table16 + yoffs);
-        fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + 1024);
-        fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2048);
-        fill_gv_table(c->table_gV, 2, cgv);
-        break;
-    case 24:
-    case 48:
-        c->yuvTable = av_malloc(1024);
-        y_table     = c->yuvTable;
-        yb = -(384 << 16) - oy;
-        for (i = 0; i < 1024; i++) {
-            y_table[i]  = av_clip_uint8((yb + 0x8000) >> 16);
-            yb         += cy;
-        }
-        fill_table(c->table_rV, 1, crv, y_table + yoffs);
-        fill_table(c->table_gU, 1, cgu, y_table + yoffs);
-        fill_table(c->table_bU, 1, cbu, y_table + yoffs);
-        fill_gv_table(c->table_gV, 1, cgv);
-        break;
-    case 32:
-        base      = (c->dstFormat == AV_PIX_FMT_RGB32_1 ||
-                     c->dstFormat == AV_PIX_FMT_BGR32_1) ? 8 : 0;
-        rbase     = base + (isRgb ? 16 : 0);
-        gbase     = base + 8;
-        bbase     = base + (isRgb ? 0 : 16);
-        needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat);
-        if (!needAlpha)
-            abase = (base + 24) & 31;
-        c->yuvTable = av_malloc(1024 * 3 * 4);
-        y_table32   = c->yuvTable;
-        yb = -(384 << 16) - oy;
-        for (i = 0; i < 1024; i++) {
-            unsigned yval       = av_clip_uint8((yb + 0x8000) >> 16);
-            y_table32[i]        = (yval << rbase) +
-                                  (needAlpha ? 0 : (255u << abase));
-            y_table32[i + 1024] =  yval << gbase;
-            y_table32[i + 2048] =  yval << bbase;
-            yb += cy;
-        }
-        fill_table(c->table_rV, 4, crv, y_table32 + yoffs);
-        fill_table(c->table_gU, 4, cgu, y_table32 + yoffs + 1024);
-        fill_table(c->table_bU, 4, cbu, y_table32 + yoffs + 2048);
-        fill_gv_table(c->table_gV, 4, cgv);
-        break;
-    default:
-        c->yuvTable = NULL;
-        if(!isPlanar(c->dstFormat) || bpp <= 24)
-            av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp);
-        return -1;
-    }
-    return 0;
-}
diff --git a/deps/libav/presets/libvpx-1080p.avpreset b/deps/libav/presets/libvpx-1080p.avpreset
deleted file mode 100644
index 5c7da6f..0000000
--- a/deps/libav/presets/libvpx-1080p.avpreset
+++ /dev/null
@@ -1,17 +0,0 @@
-g=120
-lag-in-frames=16
-deadline=good
-cpu-used=0
-profile=1
-qmax=51
-qmin=11
-slices=4
-b=2M
-
-#ignored unless using -pass 2
-maxrate=24M
-minrate=100k
-auto-alt-ref=1
-arnr-maxframes=7
-arnr-strength=5
-arnr-type=centered
diff --git a/deps/libav/presets/libvpx-1080p50_60.avpreset b/deps/libav/presets/libvpx-1080p50_60.avpreset
deleted file mode 100644
index f85d3d6..0000000
--- a/deps/libav/presets/libvpx-1080p50_60.avpreset
+++ /dev/null
@@ -1,17 +0,0 @@
-g=120
-lag-in-frames=25
-deadline=good
-cpu-used=0
-profile=1
-qmax=51
-qmin=11
-slices=4
-b=2M
-
-#ignored unless using -pass 2
-maxrate=24M
-minrate=100k
-auto-alt-ref=1
-arnr-maxframes=7
-arnr-strength=5
-arnr-type=centered
diff --git a/deps/libav/presets/libvpx-360p.avpreset b/deps/libav/presets/libvpx-360p.avpreset
deleted file mode 100644
index 2cb9e38..0000000
--- a/deps/libav/presets/libvpx-360p.avpreset
+++ /dev/null
@@ -1,16 +0,0 @@
-g=120
-lag-in-frames=16
-deadline=good
-cpu-used=0
-profile=0
-qmax=63
-qmin=0
-b=768k
-
-#ignored unless using -pass 2
-maxrate=1.5M
-minrate=40k
-auto-alt-ref=1
-arnr-maxframes=7
-arnr-strength=5
-arnr-type=centered
diff --git a/deps/libav/presets/libvpx-720p.avpreset b/deps/libav/presets/libvpx-720p.avpreset
deleted file mode 100644
index 3c7e396..0000000
--- a/deps/libav/presets/libvpx-720p.avpreset
+++ /dev/null
@@ -1,17 +0,0 @@
-g=120
-lag-in-frames=16
-deadline=good
-cpu-used=0
-profile=0
-qmax=51
-qmin=11
-slices=4
-b=2M
-
-#ignored unless using -pass 2
-maxrate=24M
-minrate=100k
-auto-alt-ref=1
-arnr-maxframes=7
-arnr-strength=5
-arnr-type=centered
diff --git a/deps/libav/presets/libvpx-720p50_60.avpreset b/deps/libav/presets/libvpx-720p50_60.avpreset
deleted file mode 100644
index 6139300..0000000
--- a/deps/libav/presets/libvpx-720p50_60.avpreset
+++ /dev/null
@@ -1,17 +0,0 @@
-g=120
-lag-in-frames=25
-deadline=good
-cpu-used=0
-profile=0
-qmax=51
-qmin=11
-slices=4
-b=2M
-
-#ignored unless using -pass 2
-maxrate=24M
-minrate=100k
-auto-alt-ref=1
-arnr-maxframes=7
-arnr-strength=5
-arnr-type=centered
diff --git a/deps/libav/presets/libx264-baseline.avpreset b/deps/libav/presets/libx264-baseline.avpreset
deleted file mode 100644
index 0626e28..0000000
--- a/deps/libav/presets/libx264-baseline.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-profile=baseline
diff --git a/deps/libav/presets/libx264-fast.avpreset b/deps/libav/presets/libx264-fast.avpreset
deleted file mode 100644
index a8c526e..0000000
--- a/deps/libav/presets/libx264-fast.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=fast
diff --git a/deps/libav/presets/libx264-fast_firstpass.avpreset b/deps/libav/presets/libx264-fast_firstpass.avpreset
deleted file mode 100644
index d9cf5af..0000000
--- a/deps/libav/presets/libx264-fast_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=fast
-fastfirstpass=1
diff --git a/deps/libav/presets/libx264-faster.avpreset b/deps/libav/presets/libx264-faster.avpreset
deleted file mode 100644
index e311989..0000000
--- a/deps/libav/presets/libx264-faster.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=faster
diff --git a/deps/libav/presets/libx264-faster_firstpass.avpreset b/deps/libav/presets/libx264-faster_firstpass.avpreset
deleted file mode 100644
index 48a2d44..0000000
--- a/deps/libav/presets/libx264-faster_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=faster
-fastfirstpass=1
diff --git a/deps/libav/presets/libx264-ipod320.avpreset b/deps/libav/presets/libx264-ipod320.avpreset
deleted file mode 100644
index 6323191..0000000
--- a/deps/libav/presets/libx264-ipod320.avpreset
+++ /dev/null
@@ -1,4 +0,0 @@
-profile=baseline
-level=13
-maxrate=768000
-bufsize=3000000
diff --git a/deps/libav/presets/libx264-ipod640.avpreset b/deps/libav/presets/libx264-ipod640.avpreset
deleted file mode 100644
index c2c3e1a..0000000
--- a/deps/libav/presets/libx264-ipod640.avpreset
+++ /dev/null
@@ -1,4 +0,0 @@
-profile=baseline
-level=30
-maxrate=10000000
-bufsize=10000000
diff --git a/deps/libav/presets/libx264-lossless_fast.avpreset b/deps/libav/presets/libx264-lossless_fast.avpreset
deleted file mode 100644
index 1658d56..0000000
--- a/deps/libav/presets/libx264-lossless_fast.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=fast
-qp=0
diff --git a/deps/libav/presets/libx264-lossless_max.avpreset b/deps/libav/presets/libx264-lossless_max.avpreset
deleted file mode 100644
index c25ff32..0000000
--- a/deps/libav/presets/libx264-lossless_max.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=placebo
-qp=0
diff --git a/deps/libav/presets/libx264-lossless_medium.avpreset b/deps/libav/presets/libx264-lossless_medium.avpreset
deleted file mode 100644
index f7b1d81..0000000
--- a/deps/libav/presets/libx264-lossless_medium.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=medium
-qp=0
diff --git a/deps/libav/presets/libx264-lossless_slow.avpreset b/deps/libav/presets/libx264-lossless_slow.avpreset
deleted file mode 100644
index a15ff4c..0000000
--- a/deps/libav/presets/libx264-lossless_slow.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=slow
-qp=0
diff --git a/deps/libav/presets/libx264-lossless_slower.avpreset b/deps/libav/presets/libx264-lossless_slower.avpreset
deleted file mode 100644
index bd71f03..0000000
--- a/deps/libav/presets/libx264-lossless_slower.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=slower
-qp=0
diff --git a/deps/libav/presets/libx264-lossless_ultrafast.avpreset b/deps/libav/presets/libx264-lossless_ultrafast.avpreset
deleted file mode 100644
index 4d71eb7..0000000
--- a/deps/libav/presets/libx264-lossless_ultrafast.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=ultrafast
-qp=0
diff --git a/deps/libav/presets/libx264-main.avpreset b/deps/libav/presets/libx264-main.avpreset
deleted file mode 100644
index 336c69b..0000000
--- a/deps/libav/presets/libx264-main.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-profile=main
diff --git a/deps/libav/presets/libx264-medium.avpreset b/deps/libav/presets/libx264-medium.avpreset
deleted file mode 100644
index 261d584..0000000
--- a/deps/libav/presets/libx264-medium.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=medium
diff --git a/deps/libav/presets/libx264-medium_firstpass.avpreset b/deps/libav/presets/libx264-medium_firstpass.avpreset
deleted file mode 100644
index 06c8f9f..0000000
--- a/deps/libav/presets/libx264-medium_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=medium
-fastfirstpass=1
diff --git a/deps/libav/presets/libx264-placebo.avpreset b/deps/libav/presets/libx264-placebo.avpreset
deleted file mode 100644
index 93d721d..0000000
--- a/deps/libav/presets/libx264-placebo.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=placebo
diff --git a/deps/libav/presets/libx264-placebo_firstpass.avpreset b/deps/libav/presets/libx264-placebo_firstpass.avpreset
deleted file mode 100644
index c8099e5..0000000
--- a/deps/libav/presets/libx264-placebo_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=placebo
-fastfirstpass=1
diff --git a/deps/libav/presets/libx264-slow.avpreset b/deps/libav/presets/libx264-slow.avpreset
deleted file mode 100644
index 85778ec..0000000
--- a/deps/libav/presets/libx264-slow.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=slow
diff --git a/deps/libav/presets/libx264-slow_firstpass.avpreset b/deps/libav/presets/libx264-slow_firstpass.avpreset
deleted file mode 100644
index 9998bc9..0000000
--- a/deps/libav/presets/libx264-slow_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=slow
-fastfirstpass=1
diff --git a/deps/libav/presets/libx264-slower.avpreset b/deps/libav/presets/libx264-slower.avpreset
deleted file mode 100644
index 87d6989..0000000
--- a/deps/libav/presets/libx264-slower.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=slower
diff --git a/deps/libav/presets/libx264-slower_firstpass.avpreset b/deps/libav/presets/libx264-slower_firstpass.avpreset
deleted file mode 100644
index c798b82..0000000
--- a/deps/libav/presets/libx264-slower_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=slower
-fastfirstpass=1
diff --git a/deps/libav/presets/libx264-superfast.avpreset b/deps/libav/presets/libx264-superfast.avpreset
deleted file mode 100644
index 1c117ec..0000000
--- a/deps/libav/presets/libx264-superfast.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=superfast
diff --git a/deps/libav/presets/libx264-superfast_firstpass.avpreset b/deps/libav/presets/libx264-superfast_firstpass.avpreset
deleted file mode 100644
index fc70e09..0000000
--- a/deps/libav/presets/libx264-superfast_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=superfast
-fastfirstpass=1
diff --git a/deps/libav/presets/libx264-ultrafast.avpreset b/deps/libav/presets/libx264-ultrafast.avpreset
deleted file mode 100644
index 9103301..0000000
--- a/deps/libav/presets/libx264-ultrafast.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=ultrafast
diff --git a/deps/libav/presets/libx264-ultrafast_firstpass.avpreset b/deps/libav/presets/libx264-ultrafast_firstpass.avpreset
deleted file mode 100644
index e3aaa17..0000000
--- a/deps/libav/presets/libx264-ultrafast_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=ultrafast
-fastfirstpass=1
diff --git a/deps/libav/presets/libx264-veryfast.avpreset b/deps/libav/presets/libx264-veryfast.avpreset
deleted file mode 100644
index fa49629..0000000
--- a/deps/libav/presets/libx264-veryfast.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=veryfast
diff --git a/deps/libav/presets/libx264-veryfast_firstpass.avpreset b/deps/libav/presets/libx264-veryfast_firstpass.avpreset
deleted file mode 100644
index 4909030..0000000
--- a/deps/libav/presets/libx264-veryfast_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=veryfast
-fastfirstpass=1
diff --git a/deps/libav/presets/libx264-veryslow.avpreset b/deps/libav/presets/libx264-veryslow.avpreset
deleted file mode 100644
index 7e01c8f..0000000
--- a/deps/libav/presets/libx264-veryslow.avpreset
+++ /dev/null
@@ -1 +0,0 @@
-preset=veryslow
diff --git a/deps/libav/presets/libx264-veryslow_firstpass.avpreset b/deps/libav/presets/libx264-veryslow_firstpass.avpreset
deleted file mode 100644
index daf5a8f..0000000
--- a/deps/libav/presets/libx264-veryslow_firstpass.avpreset
+++ /dev/null
@@ -1,2 +0,0 @@
-preset=veryslow
-fastfirstpass=1
diff --git a/deps/libav/tests/Makefile b/deps/libav/tests/Makefile
deleted file mode 100644
index ae7e653..0000000
--- a/deps/libav/tests/Makefile
+++ /dev/null
@@ -1,171 +0,0 @@
-VREF = tests/vsynth1/00.pgm
-AREF = tests/data/asynth1.sw
-
-OBJDIRS += tests/data tests/vsynth1 tests/data/filtergraphs
-
-$(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
-	$(M)./$< 'tests/vsynth1/'
-
-$(AREF): tests/audiogen$(HOSTEXESUF) | tests/data
-	$(M)./$< $@
-
-tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data
-	$(M)./$< $@ $(subst -, ,$*)
-
-tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
-	$(M)$< $@
-
-tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
-	$(M)$< $(SRC_PATH)/tests/lena.pnm $@
-
-tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm: TAG = GEN
-
-tests/data/filtergraphs/%: TAG = COPY
-tests/data/filtergraphs/%: $(SRC_PATH)/tests/filtergraphs/% | tests/data/filtergraphs
-	$(M)cp $< $@
-
-# Check sanity of dependencies when running FATE tests.
-ifneq (,$(filter check fate%,$(filter-out fate-rsync,$(MAKECMDGOALS))))
-CHKCFG  = $(if $($(1))$(!$(1)),$($(1)), $(error No such config: $(1)))
-endif
-
-ALLYES  = $(strip $(call XYES, $(1)))
-XYES    = $(if $(strip $(1)),                                           \
-               $(if $(call CHKCFG,CONFIG_$(firstword $(1))),            \
-                    $(call XYES, $(wordlist 2, $(words $(1)), $(1)))),  \
-               yes)
-
-ENCDEC  = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
-                         $(firstword $(2))_MUXER   $(lastword $(2))_DEMUXER)
-
-ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
-                         $(firstword $(2))_ENCODER $(lastword $(2))_DECODER  \
-                         $(firstword $(3))_MUXER   $(lastword $(3))_DEMUXER)
-
-DEMDEC  = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER))
-ENCMUX  = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER)
-
-DEMMUX  = $(call ALLYES, $(1)_DEMUXER $(2)_MUXER)
-
-FILTERDEMDEC       = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER)
-FILTERDEMDECMUX    = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_MUXER)
-FILTERDEMDECENCMUX = $(call ALLYES, $(1:%=%_FILTER) $(2)_DEMUXER $(3)_DECODER $(4)_ENCODER $(5)_MUXER)
-
-PARSERDEMDEC       = $(call ALLYES, $(1)_PARSER $(2)_DEMUXER $(3)_DECODER)
-
-include $(SRC_PATH)/tests/fate/acodec.mak
-include $(SRC_PATH)/tests/fate/vcodec.mak
-include $(SRC_PATH)/tests/fate/avformat.mak
-include $(SRC_PATH)/tests/fate/seek.mak
-
-include $(SRC_PATH)/tests/fate/aac.mak
-include $(SRC_PATH)/tests/fate/ac3.mak
-include $(SRC_PATH)/tests/fate/adpcm.mak
-include $(SRC_PATH)/tests/fate/alac.mak
-include $(SRC_PATH)/tests/fate/als.mak
-include $(SRC_PATH)/tests/fate/amrnb.mak
-include $(SRC_PATH)/tests/fate/amrwb.mak
-include $(SRC_PATH)/tests/fate/atrac.mak
-include $(SRC_PATH)/tests/fate/audio.mak
-include $(SRC_PATH)/tests/fate/bmp.mak
-include $(SRC_PATH)/tests/fate/cdxl.mak
-include $(SRC_PATH)/tests/fate/cover-art.mak
-include $(SRC_PATH)/tests/fate/demux.mak
-include $(SRC_PATH)/tests/fate/dfa.mak
-include $(SRC_PATH)/tests/fate/dpcm.mak
-include $(SRC_PATH)/tests/fate/ea.mak
-include $(SRC_PATH)/tests/fate/filter-audio.mak
-include $(SRC_PATH)/tests/fate/filter-video.mak
-include $(SRC_PATH)/tests/fate/flac.mak
-include $(SRC_PATH)/tests/fate/fft.mak
-include $(SRC_PATH)/tests/fate/h264.mak
-include $(SRC_PATH)/tests/fate/hevc.mak
-include $(SRC_PATH)/tests/fate/image.mak
-include $(SRC_PATH)/tests/fate/indeo.mak
-include $(SRC_PATH)/tests/fate/libavcodec.mak
-include $(SRC_PATH)/tests/fate/libavdevice.mak
-include $(SRC_PATH)/tests/fate/libavformat.mak
-include $(SRC_PATH)/tests/fate/libavresample.mak
-include $(SRC_PATH)/tests/fate/libavutil.mak
-include $(SRC_PATH)/tests/fate/lossless-audio.mak
-include $(SRC_PATH)/tests/fate/lossless-video.mak
-include $(SRC_PATH)/tests/fate/microsoft.mak
-include $(SRC_PATH)/tests/fate/monkeysaudio.mak
-include $(SRC_PATH)/tests/fate/mp3.mak
-include $(SRC_PATH)/tests/fate/mpc.mak
-include $(SRC_PATH)/tests/fate/pcm.mak
-include $(SRC_PATH)/tests/fate/probe.mak
-include $(SRC_PATH)/tests/fate/prores.mak
-include $(SRC_PATH)/tests/fate/qt.mak
-include $(SRC_PATH)/tests/fate/qtrle.mak
-include $(SRC_PATH)/tests/fate/real.mak
-include $(SRC_PATH)/tests/fate/screen.mak
-include $(SRC_PATH)/tests/fate/utvideo.mak
-include $(SRC_PATH)/tests/fate/video.mak
-include $(SRC_PATH)/tests/fate/voice.mak
-include $(SRC_PATH)/tests/fate/vorbis.mak
-include $(SRC_PATH)/tests/fate/vpx.mak
-include $(SRC_PATH)/tests/fate/vqf.mak
-include $(SRC_PATH)/tests/fate/wavpack.mak
-include $(SRC_PATH)/tests/fate/wma.mak
-include $(SRC_PATH)/tests/fate/xvid.mak
-
-FATE_AVCONV += $(FATE_AVCONV-yes)
-FATE-$(CONFIG_AVCONV) += $(FATE_AVCONV)
-
-FATE_SAMPLES_AVCONV           += $(FATE_SAMPLES_AVCONV-yes)
-FATE_SAMPLES-$(CONFIG_AVCONV) += $(FATE_SAMPLES_AVCONV)
-FATE_SAMPLES += $(FATE_SAMPLES-yes)
-
-FATE += $(FATE-yes)
-
-$(FATE_AVCONV) $(FATE_SAMPLES_AVCONV): avconv$(EXESUF)
-
-ifdef SAMPLES
-FATE += $(FATE_SAMPLES)
-fate-rsync:
-	rsync -vaLW rsync://fate-suite.libav.org/fate-suite-10/ $(SAMPLES)
-else
-fate-rsync:
-	@echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
-$(FATE_SAMPLES):
-	@echo "$@ requires external samples and SAMPLES not specified"; false
-endif
-
-FATE_UTILS = base64 tiny_psnr
-
-fate: $(FATE)
-
-$(FATE): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
-	@echo "TEST    $(@:fate-%=%)"
-	$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)' '$(CPUFLAGS)' '$(CMP_SHIFT)' '$(CMP_TARGET)' '$(SIZE_TOLERANCE)' '$(CMP_UNIT)' '$(GEN)'
-
-fate-list:
-	@printf '%s\n' $(sort $(FATE))
-
-coverage.info: TAG = LCOV
-coverage.info:
-	$(M)lcov -q -d $(CURDIR) -b $(SRC_PATH) --capture | \
-	    sed "s,$(CURDIR)/\./,$(CURDIR)/," > $@
-	$(M)lcov -q --remove $@ "/usr/include*" -o $@
-
-lcov:  TAG = GENHTML
-lcov: coverage.info
-	$(M)genhtml -q -o $(CURDIR)/lcov $<
-
-lcov-reset: TAG = LCOV
-lcov-reset:
-	$(M)lcov -d $(CURDIR) --zerocounters
-	$(Q)$(RM) -f coverage.info
-
-clean:: testclean
-
-testclean:
-	$(RM) -r tests/vsynth1 tests/data
-	$(RM) $(CLEANSUFFIXES:%=tests/%)
-	$(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
-
--include $(wildcard tests/*.d)
-
-.PHONY: fate* lcov lcov-reset
-.INTERMEDIATE: coverage.info
diff --git a/deps/libav/tests/audiogen.c b/deps/libav/tests/audiogen.c
deleted file mode 100644
index ce6f785..0000000
--- a/deps/libav/tests/audiogen.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Generate a synthetic stereo sound.
- * NOTE: No floats are used to guarantee bitexact output.
- *
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#define MAX_CHANNELS 8
-
-static unsigned int myrnd(unsigned int *seed_ptr, int n)
-{
-    unsigned int seed, val;
-
-    seed = *seed_ptr;
-    seed = (seed * 314159) + 1;
-    if (n == 256) {
-        val = seed >> 24;
-    } else {
-        val = seed % n;
-    }
-    *seed_ptr = seed;
-    return val;
-}
-
-#define FRAC_BITS 16
-#define FRAC_ONE (1 << FRAC_BITS)
-
-#define COS_TABLE_BITS 7
-
-/* integer cosine */
-static const unsigned short cos_table[(1 << COS_TABLE_BITS) + 2] = {
-    0x8000, 0x7ffe, 0x7ff6, 0x7fea, 0x7fd9, 0x7fc2, 0x7fa7, 0x7f87,
-    0x7f62, 0x7f38, 0x7f0a, 0x7ed6, 0x7e9d, 0x7e60, 0x7e1e, 0x7dd6,
-    0x7d8a, 0x7d3a, 0x7ce4, 0x7c89, 0x7c2a, 0x7bc6, 0x7b5d, 0x7aef,
-    0x7a7d, 0x7a06, 0x798a, 0x790a, 0x7885, 0x77fb, 0x776c, 0x76d9,
-    0x7642, 0x75a6, 0x7505, 0x7460, 0x73b6, 0x7308, 0x7255, 0x719e,
-    0x70e3, 0x7023, 0x6f5f, 0x6e97, 0x6dca, 0x6cf9, 0x6c24, 0x6b4b,
-    0x6a6e, 0x698c, 0x68a7, 0x67bd, 0x66d0, 0x65de, 0x64e9, 0x63ef,
-    0x62f2, 0x61f1, 0x60ec, 0x5fe4, 0x5ed7, 0x5dc8, 0x5cb4, 0x5b9d,
-    0x5a82, 0x5964, 0x5843, 0x571e, 0x55f6, 0x54ca, 0x539b, 0x5269,
-    0x5134, 0x4ffb, 0x4ec0, 0x4d81, 0x4c40, 0x4afb, 0x49b4, 0x486a,
-    0x471d, 0x45cd, 0x447b, 0x4326, 0x41ce, 0x4074, 0x3f17, 0x3db8,
-    0x3c57, 0x3af3, 0x398d, 0x3825, 0x36ba, 0x354e, 0x33df, 0x326e,
-    0x30fc, 0x2f87, 0x2e11, 0x2c99, 0x2b1f, 0x29a4, 0x2827, 0x26a8,
-    0x2528, 0x23a7, 0x2224, 0x209f, 0x1f1a, 0x1d93, 0x1c0c, 0x1a83,
-    0x18f9, 0x176e, 0x15e2, 0x1455, 0x12c8, 0x113a, 0x0fab, 0x0e1c,
-    0x0c8c, 0x0afb, 0x096b, 0x07d9, 0x0648, 0x04b6, 0x0324, 0x0192,
-    0x0000, 0x0000,
-};
-
-#define CSHIFT (FRAC_BITS - COS_TABLE_BITS - 2)
-
-static int int_cos(int a)
-{
-    int neg, v, f;
-    const unsigned short *p;
-
-    a = a & (FRAC_ONE - 1); /* modulo 2 * pi */
-    if (a >= (FRAC_ONE / 2))
-        a = FRAC_ONE - a;
-    neg = 0;
-    if (a > (FRAC_ONE / 4)) {
-        neg = -1;
-        a   = (FRAC_ONE / 2) - a;
-    }
-    p = cos_table + (a >> CSHIFT);
-    /* linear interpolation */
-    f = a & ((1 << CSHIFT) - 1);
-    v = p[0] + (((p[1] - p[0]) * f + (1 << (CSHIFT - 1))) >> CSHIFT);
-    v = (v ^ neg) - neg;
-    v = v << (FRAC_BITS - 15);
-    return v;
-}
-
-FILE *outfile;
-
-static void put16(int16_t v)
-{
-    fputc( v       & 0xff, outfile);
-    fputc((v >> 8) & 0xff, outfile);
-}
-
-static void put32(uint32_t v)
-{
-    fputc( v        & 0xff, outfile);
-    fputc((v >>  8) & 0xff, outfile);
-    fputc((v >> 16) & 0xff, outfile);
-    fputc((v >> 24) & 0xff, outfile);
-}
-
-#define HEADER_SIZE      46
-#define FMT_SIZE         18
-#define SAMPLE_SIZE       2
-#define WFORMAT_PCM  0x0001
-
-static void put_wav_header(int sample_rate, int channels, int nb_samples)
-{
-    int block_align = SAMPLE_SIZE * channels;
-    int data_size   = block_align * nb_samples;
-
-    fputs("RIFF", outfile);
-    put32(HEADER_SIZE + data_size);
-    fputs("WAVEfmt ", outfile);
-    put32(FMT_SIZE);
-    put16(WFORMAT_PCM);
-    put16(channels);
-    put32(sample_rate);
-    put32(block_align * sample_rate);
-    put16(block_align);
-    put16(SAMPLE_SIZE * 8);
-    put16(0);
-    fputs("data", outfile);
-    put32(data_size);
-}
-
-int main(int argc, char **argv)
-{
-    int i, a, v, j, f, amp, ampa;
-    unsigned int seed = 1;
-    int tabf1[MAX_CHANNELS], tabf2[MAX_CHANNELS];
-    int taba[MAX_CHANNELS];
-    int sample_rate = 44100;
-    int nb_channels = 2;
-    char *ext;
-
-    if (argc < 2 || argc > 5) {
-        printf("usage: %s file [<sample rate> [<channels>] [<random seed>]]\n"
-               "generate a test raw 16 bit audio stream\n"
-               "If the file extension is .wav a WAVE header will be added.\n"
-               "default: 44100 Hz stereo\n", argv[0]);
-        exit(1);
-    }
-
-    if (argc > 2) {
-        sample_rate = atoi(argv[2]);
-        if (sample_rate <= 0) {
-            fprintf(stderr, "invalid sample rate: %d\n", sample_rate);
-            return 1;
-        }
-    }
-
-    if (argc > 3) {
-        nb_channels = atoi(argv[3]);
-        if (nb_channels < 1 || nb_channels > MAX_CHANNELS) {
-            fprintf(stderr, "invalid number of channels: %d\n", nb_channels);
-            return 1;
-        }
-    }
-
-    if (argc > 4)
-        seed = atoi(argv[4]);
-
-    outfile = fopen(argv[1], "wb");
-    if (!outfile) {
-        perror(argv[1]);
-        return 1;
-    }
-
-    if ((ext = strrchr(argv[1], '.')) != NULL && !strcmp(ext, ".wav"))
-        put_wav_header(sample_rate, nb_channels, 6 * sample_rate);
-
-    /* 1 second of single freq sine at 1000 Hz */
-    a = 0;
-    for (i = 0; i < 1 * sample_rate; i++) {
-        v = (int_cos(a) * 10000) >> FRAC_BITS;
-        for (j = 0; j < nb_channels; j++)
-            put16(v);
-        a += (1000 * FRAC_ONE) / sample_rate;
-    }
-
-    /* 1 second of varying frequency between 100 and 10000 Hz */
-    a = 0;
-    for (i = 0; i < 1 * sample_rate; i++) {
-        v = (int_cos(a) * 10000) >> FRAC_BITS;
-        for (j = 0; j < nb_channels; j++)
-            put16(v);
-        f  = 100 + (((10000 - 100) * i) / sample_rate);
-        a += (f * FRAC_ONE) / sample_rate;
-    }
-
-    /* 0.5 second of low amplitude white noise */
-    for (i = 0; i < sample_rate / 2; i++) {
-        v = myrnd(&seed, 20000) - 10000;
-        for (j = 0; j < nb_channels; j++)
-            put16(v);
-    }
-
-    /* 0.5 second of high amplitude white noise */
-    for (i = 0; i < sample_rate / 2; i++) {
-        v = myrnd(&seed, 65535) - 32768;
-        for (j = 0; j < nb_channels; j++)
-            put16(v);
-    }
-
-    /* 1 second of unrelated ramps for each channel */
-    for (j = 0; j < nb_channels; j++) {
-        taba[j]  = 0;
-        tabf1[j] = 100 + myrnd(&seed, 5000);
-        tabf2[j] = 100 + myrnd(&seed, 5000);
-    }
-    for (i = 0; i < 1 * sample_rate; i++) {
-        for (j = 0; j < nb_channels; j++) {
-            v = (int_cos(taba[j]) * 10000) >> FRAC_BITS;
-            put16(v);
-            f        = tabf1[j] + (((tabf2[j] - tabf1[j]) * i) / sample_rate);
-            taba[j] += (f * FRAC_ONE) / sample_rate;
-        }
-    }
-
-    /* 2 seconds of 500 Hz with varying volume */
-    a    = 0;
-    ampa = 0;
-    for (i = 0; i < 2 * sample_rate; i++) {
-        for (j = 0; j < nb_channels; j++) {
-            amp = ((FRAC_ONE + int_cos(ampa)) * 5000) >> FRAC_BITS;
-            if (j & 1)
-                amp = 10000 - amp;
-            v = (int_cos(a) * amp) >> FRAC_BITS;
-            put16(v);
-            a    += (500 * FRAC_ONE) / sample_rate;
-            ampa += (2 * FRAC_ONE) / sample_rate;
-        }
-    }
-
-    fclose(outfile);
-    return 0;
-}
diff --git a/deps/libav/tests/base64.c b/deps/libav/tests/base64.c
deleted file mode 100644
index 6462d9a..0000000
--- a/deps/libav/tests/base64.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Based on libavutil/base64.c
- */
-
-#include <stdio.h>
-
-int main(void)
-{
-    static const char b64[] =
-        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-    unsigned i_bits = 0;
-    int i_shift     = 0;
-    int out_len     = 0;
-    int in;
-
-#define putb64()                                        \
-    do {                                                \
-        putchar(b64[(i_bits << 6 >> i_shift) & 0x3f]);  \
-        out_len++;                                      \
-        i_shift -= 6;                                   \
-    } while (0)
-
-    while ((in = getchar()) != EOF) {
-        i_bits   = (i_bits << 8) + in;
-        i_shift += 8;
-        while (i_shift > 6)
-            putb64();
-    }
-    while (i_shift > 0)
-        putb64();
-    while (out_len++ & 3)
-        putchar('=');
-    putchar('\n');
-
-    return 0;
-}
diff --git a/deps/libav/tests/fate-run.sh b/deps/libav/tests/fate-run.sh
deleted file mode 100755
index b6c7384..0000000
--- a/deps/libav/tests/fate-run.sh
+++ /dev/null
@@ -1,230 +0,0 @@
-#! /bin/sh
-
-export LC_ALL=C
-
-base=$(dirname $0)
-. "${base}/md5.sh"
-
-base64=tests/base64
-
-test="${1#fate-}"
-samples=$2
-target_exec=$3
-target_path=$4
-command=$5
-cmp=${6:-diff}
-ref=${7:-"${base}/ref/fate/${test}"}
-fuzz=${8:-1}
-threads=${9:-1}
-thread_type=${10:-frame+slice}
-cpuflags=${11:-all}
-cmp_shift=${12:-0}
-cmp_target=${13:-0}
-size_tolerance=${14:-0}
-cmp_unit=${15:-2}
-gen=${16:-no}
-
-outdir="tests/data/fate"
-outfile="${outdir}/${test}"
-errfile="${outdir}/${test}.err"
-cmpfile="${outdir}/${test}.diff"
-repfile="${outdir}/${test}.rep"
-
-target_path(){
-    test ${1} = ${1#/} && p=${target_path}/
-    echo ${p}${1}
-}
-
-# $1=value1, $2=value2, $3=threshold
-# prints 0 if absolute difference between value1 and value2 is <= threshold
-compare(){
-    echo "scale=2; v = $1 - $2; if (v < 0) v = -v; if (v > $3) r = 1; r" | bc
-}
-
-do_tiny_psnr(){
-    psnr=$(tests/tiny_psnr "$1" "$2" $cmp_unit $cmp_shift 0)
-    val=$(expr "$psnr" : ".*$3: *\([0-9.]*\)")
-    size1=$(expr "$psnr" : '.*bytes: *\([0-9]*\)')
-    size2=$(expr "$psnr" : '.*bytes:[ 0-9]*/ *\([0-9]*\)')
-    val_cmp=$(compare $val $cmp_target $fuzz)
-    size_cmp=$(compare $size1 $size2 $size_tolerance)
-    if [ "$val_cmp" != 0 ] || [ "$size_cmp" != 0 ]; then
-        echo "$psnr"
-        return 1
-    fi
-}
-
-oneoff(){
-    do_tiny_psnr "$1" "$2" MAXDIFF
-}
-
-stddev(){
-    do_tiny_psnr "$1" "$2" stddev
-}
-
-oneline(){
-    printf '%s\n' "$1" | diff -u -b - "$2"
-}
-
-run(){
-    test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"$@" >&3
-    $target_exec $target_path/"$@"
-}
-
-probefmt(){
-    run avprobe -show_format_entry format_name -v 0 "$@"
-}
-
-avconv(){
-    dec_opts="-threads $threads -thread_type $thread_type"
-    avconv_args="-nostats -cpuflags $cpuflags"
-    for arg in $@; do
-        [ x${arg} = x-i ] && avconv_args="${avconv_args} ${dec_opts}"
-        avconv_args="${avconv_args} ${arg}"
-    done
-    run avconv ${avconv_args}
-}
-
-framecrc(){
-    avconv "$@" -f framecrc -
-}
-
-framemd5(){
-    avconv "$@" -f framemd5 -
-}
-
-crc(){
-    avconv "$@" -f crc -
-}
-
-md5(){
-    avconv "$@" md5:
-}
-
-pcm(){
-    avconv "$@" -vn -f s16le -
-}
-
-enc_dec_pcm(){
-    out_fmt=$1
-    dec_fmt=$2
-    pcm_fmt=$3
-    src_file=$(target_path $4)
-    shift 4
-    encfile="${outdir}/${test}.${out_fmt}"
-    cleanfiles=$encfile
-    encfile=$(target_path ${encfile})
-    avconv -i $src_file "$@" -f $out_fmt -y ${encfile} || return
-    avconv -f $out_fmt -i ${encfile} -c:a pcm_${pcm_fmt} -f ${dec_fmt} -
-}
-
-FLAGS="-flags +bitexact -sws_flags +accurate_rnd+bitexact"
-DEC_OPTS="-threads $threads -idct simple $FLAGS"
-ENC_OPTS="-threads 1        -idct simple -dct fastint"
-
-enc_dec(){
-    src_fmt=$1
-    srcfile=$2
-    enc_fmt=$3
-    enc_opt=$4
-    dec_fmt=$5
-    dec_opt=$6
-    encfile="${outdir}/${test}.${enc_fmt}"
-    decfile="${outdir}/${test}.out.${dec_fmt}"
-    cleanfiles="$cleanfiles $decfile"
-    test "$7" = -keep || cleanfiles="$cleanfiles $encfile"
-    tsrcfile=$(target_path $srcfile)
-    tencfile=$(target_path $encfile)
-    tdecfile=$(target_path $decfile)
-    avconv -f $src_fmt $DEC_OPTS -i $tsrcfile $ENC_OPTS $enc_opt $FLAGS \
-        -f $enc_fmt -y $tencfile || return
-    do_md5sum $encfile
-    echo $(wc -c $encfile)
-    avconv $DEC_OPTS -i $tencfile $ENC_OPTS $dec_opt $FLAGS \
-        -f $dec_fmt -y $tdecfile || return
-    do_md5sum $decfile
-    tests/tiny_psnr $srcfile $decfile $cmp_unit $cmp_shift
-}
-
-lavftest(){
-    t="${test#lavf-}"
-    ref=${base}/ref/lavf/$t
-    ${base}/lavf-regression.sh $t lavf tests/vsynth1 "$target_exec" "$target_path" "$threads" "$thread_type" "$cpuflags"
-}
-
-video_filter(){
-    filters=$1
-    shift
-    label=${test#filter-}
-    raw_src="${target_path}/tests/vsynth1/%02d.pgm"
-    printf '%-20s' $label
-    avconv $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src \
-        $FLAGS $ENC_OPTS -vf "$filters" -vcodec rawvideo $* -f nut md5:
-}
-
-pixdesc(){
-    pix_fmts="$(avconv -pix_fmts list 2>/dev/null | awk 'NR > 8 && /^IO/ { print $2 }' | sort)"
-    for pix_fmt in $pix_fmts; do
-        test=$pix_fmt
-        video_filter "format=$pix_fmt,pixdesctest" -pix_fmt $pix_fmt
-    done
-}
-
-pixfmts(){
-    filter=${test#filter-pixfmts-}
-    filter_args=$1
-
-    showfiltfmts="$target_exec $target_path/libavfilter/filtfmts-test"
-    exclude_fmts=${outfile}${filter}_exclude_fmts
-    out_fmts=${outfile}${filter}_out_fmts
-
-    # exclude pixel formats which are not supported as input
-    avconv -pix_fmts list 2>/dev/null | awk 'NR > 8 && /^\..\./ { print $2 }' | sort >$exclude_fmts
-    $showfiltfmts scale | awk -F '[ \r]' '/^OUTPUT/{ print $3 }' | sort | comm -23 - $exclude_fmts >$out_fmts
-
-    pix_fmts=$($showfiltfmts $filter | awk -F '[ \r]' '/^INPUT/{ print $3 }' | sort | comm -12 - $out_fmts)
-    for pix_fmt in $pix_fmts; do
-        test=$pix_fmt
-        video_filter "format=$pix_fmt,$filter=$filter_args" -pix_fmt $pix_fmt
-    done
-
-    rm $exclude_fmts $out_fmts
-}
-
-mkdir -p "$outdir"
-
-exec 3>&2
-eval $command >"$outfile" 2>$errfile
-err=$?
-
-if [ $err -gt 128 ]; then
-    sig=$(kill -l $err 2>/dev/null)
-    test "${sig}" = "${sig%[!A-Za-z]*}" || unset sig
-fi
-
-if test -e "$ref" || test $cmp = "oneline" ; then
-    case $cmp in
-        diff)   diff -u -b "$ref" "$outfile"            >$cmpfile ;;
-        oneoff) oneoff     "$ref" "$outfile"            >$cmpfile ;;
-        stddev) stddev     "$ref" "$outfile"            >$cmpfile ;;
-        oneline)oneline    "$ref" "$outfile"            >$cmpfile ;;
-        null)   cat               "$outfile"            >$cmpfile ;;
-    esac
-    cmperr=$?
-    test $err = 0 && err=$cmperr
-    test $err = 0 || cat $cmpfile
-else
-    echo "reference file '$ref' not found"
-    err=1
-fi
-
-echo "${test}:${sig:-$err}:$($base64 <$cmpfile):$($base64 <$errfile)" >$repfile
-
-if test $err != 0 && test $gen != "no" ; then
-    echo "GEN     $ref"
-    cp -f "$outfile" "$ref"
-    err=$?
-fi
-
-test $err = 0 && rm -f $outfile $errfile $cmpfile $cleanfiles
-exit $err
diff --git a/deps/libav/tests/fate.sh b/deps/libav/tests/fate.sh
deleted file mode 100755
index 6e0c0c6..0000000
--- a/deps/libav/tests/fate.sh
+++ /dev/null
@@ -1,116 +0,0 @@
-#! /bin/sh
-
-config=$1
-
-die(){
-    echo "$@"
-    exit 1
-}
-
-test -r "$config"  || die "usage: fate.sh <config>"
-
-workdir=$(cd $(dirname $config) && pwd)
-make=make
-tar='tar c'
-
-. "$config"
-
-test -n "$slot"    || die "slot not specified"
-test -n "$repo"    || die "repo not specified"
-test -d "$samples" || die "samples location not specified"
-
-lock(){
-    lock=$1/fate.lock
-    (set -C; exec >$lock) 2>/dev/null || return
-    trap 'rm $lock' EXIT
-}
-
-checkout(){
-    case "$repo" in
-        file:*|/*) src="${repo#file:}"      ;;
-        git:*)     git clone --quiet "$repo" "$src" ;;
-    esac
-}
-
-update()(
-    cd ${src} || return
-    case "$repo" in
-        git:*) git fetch --force; git reset --hard origin/master ;;
-    esac
-)
-
-configure()(
-    cd ${build} || return
-    ${src}/configure                                                    \
-        --prefix="${inst}"                                              \
-        --samples="${samples}"                                          \
-        --enable-gpl                                                    \
-        ${arch:+--arch=$arch}                                           \
-        ${cpu:+--cpu="$cpu"}                                            \
-        ${cross_prefix:+--cross-prefix="$cross_prefix"}                 \
-        ${as:+--as="$as"}                                               \
-        ${cc:+--cc="$cc"}                                               \
-        ${ld:+--ld="$ld"}                                               \
-        ${target_os:+--target-os="$target_os"}                          \
-        ${sysroot:+--sysroot="$sysroot"}                                \
-        ${target_exec:+--target-exec="$target_exec"}                    \
-        ${target_path:+--target-path="$target_path"}                    \
-        ${target_samples:+--target-samples="$target_samples"}           \
-        ${extra_cflags:+--extra-cflags="$extra_cflags"}                 \
-        ${extra_ldflags:+--extra-ldflags="$extra_ldflags"}              \
-        ${extra_libs:+--extra-libs="$extra_libs"}                       \
-        ${extra_conf}
-)
-
-compile()(
-    cd ${build} || return
-    ${make} ${makeopts} && ${make} install
-)
-
-fate()(
-    test "$build_only" = "yes" && return
-    cd ${build} || return
-    ${make} ${makeopts} -k fate
-)
-
-clean(){
-    rm -rf ${build} ${inst}
-}
-
-report(){
-    date=$(date -u +%Y%m%d%H%M%S)
-    echo "fate:0:${date}:${slot}:${version}:$1:$2:${comment}" >report
-    cat ${build}/config.fate ${build}/tests/data/fate/*.rep >>report
-    test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
-}
-
-fail(){
-    report "$@"
-    clean
-    exit
-}
-
-mkdir -p ${workdir} || die "Error creating ${workdir}"
-lock ${workdir}     || die "${workdir} locked"
-cd ${workdir}       || die "cd ${workdir} failed"
-
-src=${workdir}/src
-: ${build:=${workdir}/build}
-: ${inst:=${workdir}/install}
-
-test -d "$src" && update || checkout || die "Error fetching source"
-
-cd ${workdir}
-
-version=$(${src}/version.sh ${src})
-test "$version" = "$(cat version-$slot 2>/dev/null)" && exit 0
-echo ${version} >version-$slot
-
-rm -rf "${build}" *.log
-mkdir -p ${build}
-
-configure >configure.log 2>&1 || fail $? "error configuring"
-compile   >compile.log   2>&1 || fail $? "error compiling"
-fate      >test.log      2>&1 || fail $? "error testing"
-report 0 success
-clean
diff --git a/deps/libav/tests/fate/aac.mak b/deps/libav/tests/fate/aac.mak
deleted file mode 100644
index b3f07cb..0000000
--- a/deps/libav/tests/fate/aac.mak
+++ /dev/null
@@ -1,104 +0,0 @@
-FATE_AAC += fate-aac-al04_44
-fate-aac-al04_44: CMD = pcm -i $(TARGET_SAMPLES)/aac/al04_44.mp4
-fate-aac-al04_44: REF = $(SAMPLES)/aac/al04_44.s16
-
-FATE_AAC += fate-aac-al05_44
-fate-aac-al05_44: CMD = pcm -i $(TARGET_SAMPLES)/aac/al05_44.mp4
-fate-aac-al05_44: REF = $(SAMPLES)/aac/al05_44.s16
-
-FATE_AAC += fate-aac-al06_44
-fate-aac-al06_44: CMD = pcm -i $(TARGET_SAMPLES)/aac/al06_44.mp4
-fate-aac-al06_44: REF = $(SAMPLES)/aac/al06_44_reorder.s16
-
-FATE_AAC += fate-aac-al07_96
-fate-aac-al07_96: CMD = pcm -i $(TARGET_SAMPLES)/aac/al07_96.mp4
-fate-aac-al07_96: REF = $(SAMPLES)/aac/al07_96_reorder.s16
-
-FATE_AAC += fate-aac-al15_44
-fate-aac-al15_44: CMD = pcm -i $(TARGET_SAMPLES)/aac/al15_44.mp4
-fate-aac-al15_44: REF = $(SAMPLES)/aac/al15_44_reorder.s16
-
-FATE_AAC += fate-aac-al17_44
-fate-aac-al17_44: CMD = pcm -i $(TARGET_SAMPLES)/aac/al17_44.mp4
-fate-aac-al17_44: REF = $(SAMPLES)/aac/al17_44.s16
-
-FATE_AAC += fate-aac-al18_44
-fate-aac-al18_44: CMD = pcm -i $(TARGET_SAMPLES)/aac/al18_44.mp4
-fate-aac-al18_44: REF = $(SAMPLES)/aac/al18_44.s16
-
-FATE_AAC += fate-aac-am00_88
-fate-aac-am00_88: CMD = pcm -i $(TARGET_SAMPLES)/aac/am00_88.mp4
-fate-aac-am00_88: REF = $(SAMPLES)/aac/am00_88.s16
-
-FATE_AAC += fate-aac-am05_44
-fate-aac-am05_44: CMD = pcm -i $(TARGET_SAMPLES)/aac/am05_44.mp4
-fate-aac-am05_44: REF = $(SAMPLES)/aac/am05_44_reorder.s16
-
-FATE_AAC += fate-aac-al_sbr_hq_cm_48_2
-fate-aac-al_sbr_hq_cm_48_2: CMD = pcm -i $(TARGET_SAMPLES)/aac/al_sbr_cm_48_2.mp4
-fate-aac-al_sbr_hq_cm_48_2: REF = $(SAMPLES)/aac/al_sbr_hq_cm_48_2.s16
-
-FATE_AAC += fate-aac-al_sbr_hq_cm_48_5.1
-fate-aac-al_sbr_hq_cm_48_5.1: CMD = pcm -i $(TARGET_SAMPLES)/aac/al_sbr_cm_48_5.1.mp4
-fate-aac-al_sbr_hq_cm_48_5.1: REF = $(SAMPLES)/aac/al_sbr_hq_cm_48_5.1_reorder.s16
-
-FATE_AAC += fate-aac-al_sbr_hq_sr_48_2_fsaac48
-fate-aac-al_sbr_hq_sr_48_2_fsaac48: CMD = pcm -i $(TARGET_SAMPLES)/aac/al_sbr_sr_48_2_fsaac48.mp4
-fate-aac-al_sbr_hq_sr_48_2_fsaac48: REF = $(SAMPLES)/aac/al_sbr_hq_sr_48_2_fsaac48.s16
-
-FATE_AAC += fate-aac-al_sbr_ps_06_ur
-fate-aac-al_sbr_ps_06_ur: CMD = pcm -i $(TARGET_SAMPLES)/aac/al_sbr_ps_06_new.mp4
-fate-aac-al_sbr_ps_06_ur: REF = $(SAMPLES)/aac/al_sbr_ps_06_ur.s16
-
-FATE_AAC += fate-aac-ap05_48
-fate-aac-ap05_48: CMD = pcm -i $(TARGET_SAMPLES)/aac/ap05_48.mp4
-fate-aac-ap05_48: REF = $(SAMPLES)/aac/ap05_48.s16
-
-FATE_AAC += fate-aac-er_ad6000np_44_ep0
-fate-aac-er_ad6000np_44_ep0: CMD = pcm -i $(TARGET_SAMPLES)/aac/er_ad6000np_44_ep0.mp4
-fate-aac-er_ad6000np_44_ep0: REF = $(SAMPLES)/aac/er_ad6000np_44.s16
-
-FATE_AAC += fate-aac-er_eld1001np_44_ep0
-fate-aac-er_eld1001np_44_ep0: CMD = pcm -i $(TARGET_SAMPLES)/aac/er_eld1001np_44_ep0.mp4
-fate-aac-er_eld1001np_44_ep0: REF = $(SAMPLES)/aac/er_eld1001np_44.s16
-
-FATE_AAC += fate-aac-er_eld2000np_48_ep0
-fate-aac-er_eld2000np_48_ep0: CMD = pcm -i $(TARGET_SAMPLES)/aac/er_eld2000np_48_ep0.mp4
-fate-aac-er_eld2000np_48_ep0: REF = $(SAMPLES)/aac/er_eld2000np_48_ep0.s16
-
-
-fate-aac-ct%: CMD = pcm -i $(TARGET_SAMPLES)/aac/CT_DecoderCheck/$(@:fate-aac-ct-%=%)
-fate-aac-ct%: REF = $(SAMPLES)/aac/CT_DecoderCheck/aacPlusv2.wav
-
-FATE_AAC_CT_RAW = fate-aac-ct-sbr_i-ps_i.aac
-
-FATE_AAC_CT = sbr_bc-ps_i.3gp  \
-              sbr_bic-ps_i.3gp \
-              sbr_bc-ps_bc.mp4 \
-              sbr_bc-ps_i.mp4  \
-              sbr_i-ps_bic.mp4 \
-              sbr_i-ps_i.mp4
-
-FATE_AAC += $(FATE_AAC_CT:%=fate-aac-ct-%)
-
-FATE_AAC_LATM += fate-aac-latm_000000001180bc60
-fate-aac-latm_000000001180bc60: CMD = pcm -i $(TARGET_SAMPLES)/aac/latm_000000001180bc60.mpg
-fate-aac-latm_000000001180bc60: REF = $(SAMPLES)/aac/latm_000000001180bc60.s16
-
-FATE_AAC_LATM += fate-aac-latm_stereo_to_51
-fate-aac-latm_stereo_to_51: CMD = pcm -i $(TARGET_SAMPLES)/aac/latm_stereo_to_51.ts -channel_layout 5.1
-fate-aac-latm_stereo_to_51: REF = $(SAMPLES)/aac/latm_stereo_to_51_ref.s16
-
-FATE_AAC-$(call      DEMDEC, AAC,    AAC)      += $(FATE_AAC_CT_RAW)
-FATE_AAC-$(call      DEMDEC, MOV,    AAC)      += $(FATE_AAC)
-FATE_AAC_LATM-$(call DEMDEC, MPEGTS, AAC_LATM) += $(FATE_AAC_LATM)
-
-FATE_AAC_ALL = $(FATE_AAC-yes) $(FATE_AAC_LATM-yes)
-
-$(FATE_AAC_ALL): CMP  = oneoff
-$(FATE_AAC_ALL): FUZZ = 2
-
-FATE_SAMPLES_AVCONV += $(FATE_AAC_ALL)
-
-fate-aac: $(FATE_AAC_ALL)
-fate-aac-latm: $(FATE_AAC_LATM-yes)
diff --git a/deps/libav/tests/fate/ac3.mak b/deps/libav/tests/fate/ac3.mak
deleted file mode 100644
index 3841240..0000000
--- a/deps/libav/tests/fate/ac3.mak
+++ /dev/null
@@ -1,74 +0,0 @@
-FATE_AC3 += fate-ac3-2.0
-fate-ac3-2.0: CMD = pcm -i $(TARGET_SAMPLES)/ac3/monsters_inc_2.0_192_small.ac3
-fate-ac3-2.0: REF = $(SAMPLES)/ac3/monsters_inc_2.0_192_small_v2.pcm
-
-FATE_AC3 += fate-ac3-4.0
-fate-ac3-4.0: CMD = pcm -i $(TARGET_SAMPLES)/ac3/millers_crossing_4.0.ac3
-fate-ac3-4.0: REF = $(SAMPLES)/ac3/millers_crossing_4.0_v2.pcm
-
-FATE_AC3 += fate-ac3-4.0-downmix-mono
-fate-ac3-4.0-downmix-mono: CMD = pcm -request_channels 1 -i $(TARGET_SAMPLES)/ac3/millers_crossing_4.0.ac3
-fate-ac3-4.0-downmix-mono: REF = $(SAMPLES)/ac3/millers_crossing_4.0_mono_v2.pcm
-
-FATE_AC3 += fate-ac3-4.0-downmix-stereo
-fate-ac3-4.0-downmix-stereo: CMD = pcm -request_channels 2 -i $(TARGET_SAMPLES)/ac3/millers_crossing_4.0.ac3
-fate-ac3-4.0-downmix-stereo: REF = $(SAMPLES)/ac3/millers_crossing_4.0_stereo_v2.pcm
-
-FATE_AC3 += fate-ac3-5.1
-fate-ac3-5.1: CMD = pcm -i $(TARGET_SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3
-fate-ac3-5.1: REF = $(SAMPLES)/ac3/monsters_inc_5.1_448_small_v2.pcm
-
-FATE_AC3 += fate-ac3-5.1-downmix-mono
-fate-ac3-5.1-downmix-mono: CMD = pcm -request_channels 1 -i $(TARGET_SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3
-fate-ac3-5.1-downmix-mono: REF = $(SAMPLES)/ac3/monsters_inc_5.1_448_small_mono_v2.pcm
-
-FATE_AC3 += fate-ac3-5.1-downmix-stereo
-fate-ac3-5.1-downmix-stereo: CMD = pcm -request_channels 2 -i $(TARGET_SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3
-fate-ac3-5.1-downmix-stereo: REF = $(SAMPLES)/ac3/monsters_inc_5.1_448_small_stereo_v2.pcm
-
-FATE_EAC3 += fate-eac3-1
-fate-eac3-1: CMD = pcm -i $(TARGET_SAMPLES)/eac3/csi_miami_5.1_256_spx_small.eac3
-fate-eac3-1: REF = $(SAMPLES)/eac3/csi_miami_5.1_256_spx_small_v2.pcm
-
-FATE_EAC3 += fate-eac3-2
-fate-eac3-2: CMD = pcm -i $(TARGET_SAMPLES)/eac3/csi_miami_stereo_128_spx_small.eac3
-fate-eac3-2: REF = $(SAMPLES)/eac3/csi_miami_stereo_128_spx_small_v2.pcm
-
-FATE_EAC3 += fate-eac3-3
-fate-eac3-3: CMD = pcm -i $(TARGET_SAMPLES)/eac3/matrix2_commentary1_stereo_192_small.eac3
-fate-eac3-3: REF = $(SAMPLES)/eac3/matrix2_commentary1_stereo_192_small_v2.pcm
-
-FATE_EAC3 += fate-eac3-4
-fate-eac3-4: CMD = pcm -i $(TARGET_SAMPLES)/eac3/serenity_english_5.1_1536_small.eac3
-fate-eac3-4: REF = $(SAMPLES)/eac3/serenity_english_5.1_1536_small_v2.pcm
-
-$(FATE_AC3) $(FATE_EAC3): CMP = oneoff
-
-FATE_AC3-$(call  DEMDEC, AC3,  AC3)  += $(FATE_AC3)
-FATE_EAC3-$(call DEMDEC, EAC3, EAC3) += $(FATE_EAC3)
-
-FATE_AC3-$(call ENCDEC, AC3, AC3) += fate-ac3-encode
-fate-ac3-encode: CMD = enc_dec_pcm ac3 wav s16le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c:a ac3 -b:a 128k
-fate-ac3-encode: CMP_SHIFT = -1024
-fate-ac3-encode: CMP_TARGET = 404.53
-fate-ac3-encode: SIZE_TOLERANCE = 488
-
-FATE_EAC3-$(call ENCDEC, EAC3, EAC3) += fate-eac3-encode
-fate-eac3-encode: CMD = enc_dec_pcm eac3 wav s16le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c:a eac3 -b:a 128k
-fate-eac3-encode: CMP_SHIFT = -1024
-fate-eac3-encode: CMP_TARGET = 516.94
-fate-eac3-encode: SIZE_TOLERANCE = 488
-
-fate-ac3-encode fate-eac3-encode: CMP = stddev
-fate-ac3-encode fate-eac3-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
-
-FATE_AC3-$(call ENCMUX, AC3_FIXED, AC3) += fate-ac3-fixed-encode
-fate-ac3-fixed-encode: tests/data/asynth-44100-2.wav
-fate-ac3-fixed-encode: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
-fate-ac3-fixed-encode: CMD = md5 -i $(SRC) -c ac3_fixed -b 128k -f ac3 -flags bitexact
-fate-ac3-fixed-encode: CMP = oneline
-fate-ac3-fixed-encode: REF = a1d1fc116463b771abf5aef7ed37d7b1
-
-FATE_SAMPLES_AVCONV += $(FATE_AC3-yes) $(FATE_EAC3-yes)
-
-fate-ac3: $(FATE_AC3-yes) $(FATE_EAC3-yes)
diff --git a/deps/libav/tests/fate/acodec.mak b/deps/libav/tests/fate/acodec.mak
deleted file mode 100644
index 0eb6227..0000000
--- a/deps/libav/tests/fate/acodec.mak
+++ /dev/null
@@ -1,70 +0,0 @@
-fate-acodec-%: CODEC = $(@:fate-acodec-%=%)
-fate-acodec-%: SRC = tests/data/asynth-44100-2.wav
-fate-acodec-%: CMD = enc_dec wav $(SRC) $(FMT) "-b 128k -c $(CODEC)" wav "-c pcm_s16le" -keep
-fate-acodec-%: CMP_UNIT = 2
-fate-acodec-%: REF = $(SRC_PATH)/tests/ref/acodec/$(@:fate-acodec-%=%)
-
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_ALAW,  WAV) += alaw
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_MULAW, WAV) += mulaw
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_S8,    MOV) += s8
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_U8,    WAV) += u8
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_S16BE, MOV) += s16be
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_S16LE, WAV) += s16le
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_S24BE, MOV) += s24be
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_S24LE, WAV) += s24le
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_S32BE, MOV) += s32be
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_S32LE, WAV) += s32le
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_F32BE, AU)  += f32be
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_F32LE, WAV) += f32le
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_F64BE, AU)  += f64be
-FATE_ACODEC_PCM-$(call ENCDEC, PCM_F64LE, WAV) += f64le
-
-FATE_ACODEC_PCM := $(FATE_ACODEC_PCM-yes:%=fate-acodec-pcm-%)
-FATE_ACODEC += $(FATE_ACODEC_PCM)
-fate-acodec-pcm: $(FATE_ACODEC_PCM)
-
-fate-acodec-pcm-%: FMT = wav
-fate-acodec-pcm-%: CODEC = pcm_$(@:fate-acodec-pcm-%=%)
-
-fate-acodec-pcm-s8:   FMT = mov
-fate-acodec-pcm-s%be: FMT = mov
-fate-acodec-pcm-f%be: FMT = au
-
-FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_ADX,     ADX)  += adx
-FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_IMA_QT,  AIFF) += ima_qt
-FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_IMA_WAV, WAV)  += ima_wav
-FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_MS,      WAV)  += ms
-FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_SWF,     FLV)  += swf
-FATE_ACODEC_ADPCM-$(call ENCDEC, ADPCM_YAMAHA,  WAV)  += yamaha
-
-FATE_ACODEC_ADPCM := $(FATE_ACODEC_ADPCM-yes:%=fate-acodec-adpcm-%)
-FATE_ACODEC += $(FATE_ACODEC_ADPCM)
-fate-acodec-adpcm: $(FATE_ACODEC_ADPCM)
-
-fate-acodec-adpcm-%: CODEC = adpcm_$(@:fate-acodec-adpcm-%=%)
-
-fate-acodec-adpcm-adx:     FMT = adx
-fate-acodec-adpcm-ima_qt:  FMT = aiff
-fate-acodec-adpcm-ima_wav: FMT = wav
-fate-acodec-adpcm-ms:      FMT = wav
-fate-acodec-adpcm-swf:     FMT = flv
-fate-acodec-adpcm-yamaha:  FMT = wav
-
-FATE_ACODEC-$(call ENCDEC, MP2, MP2 MP3) += fate-acodec-mp2
-fate-acodec-mp2: FMT = mp2
-fate-acodec-mp2: CMP_SHIFT = -1924
-
-FATE_ACODEC-$(call ENCDEC, ALAC, MOV) += fate-acodec-alac
-fate-acodec-alac: FMT = mov
-fate-acodec-alac: CODEC = alac -compression_level 1
-
-FATE_ACODEC-$(call ENCDEC, FLAC, FLAC) += fate-acodec-flac
-fate-acodec-flac: FMT = flac
-fate-acodec-flac: CODEC = flac -compression_level 2
-
-FATE_ACODEC += $(FATE_ACODEC-yes)
-
-$(FATE_ACODEC): tests/data/asynth-44100-2.wav
-
-FATE_AVCONV += $(FATE_ACODEC)
-fate-acodec: $(FATE_ACODEC)
diff --git a/deps/libav/tests/fate/adpcm.mak b/deps/libav/tests/fate/adpcm.mak
deleted file mode 100644
index 55f2556..0000000
--- a/deps/libav/tests/fate/adpcm.mak
+++ /dev/null
@@ -1,74 +0,0 @@
-FATE_ADPCM-$(call DEMDEC, WAV, ADPCM_CT) += fate-adpcm-creative
-fate-adpcm-creative: CMD = md5 -i $(TARGET_SAMPLES)/creative/intro-partial.wav -f s16le
-
-FATE_ADPCM-$(call DEMDEC, VOC, ADPCM_SBPRO_2) += fate-adpcm-creative-8-2bit
-fate-adpcm-creative-8-2bit: CMD = md5 -i $(TARGET_SAMPLES)/creative/BBC_2BIT.VOC -f s16le
-
-FATE_ADPCM-$(call DEMDEC, VOC, ADPCM_SBPRO_3) += fate-adpcm-creative-8-2.6bit
-fate-adpcm-creative-8-2.6bit: CMD = md5 -i $(TARGET_SAMPLES)/creative/BBC_3BIT.VOC -f s16le
-
-FATE_ADPCM-$(call DEMDEC, VOC, ADPCM_SBPRO_4) += fate-adpcm-creative-8-4bit
-fate-adpcm-creative-8-4bit: CMD = md5 -i $(TARGET_SAMPLES)/creative/BBC_4BIT.VOC -f s16le
-
-FATE_ADPCM-$(call DEMDEC, EA, ADPCM_EA) += fate-adpcm-ea-1
-fate-adpcm-ea-1: CMD = framecrc -i $(TARGET_SAMPLES)/ea-wve/networkBackbone-partial.wve -frames:a 26 -vn
-
-FATE_ADPCM-$(call DEMDEC, EA, ADPCM_EA) += fate-adpcm-ea-2
-fate-adpcm-ea-2: CMD = framecrc -i $(TARGET_SAMPLES)/ea-dct/NFS2Esprit-partial.dct -vn
-
-FATE_ADPCM-$(call DEMDEC, XA, ADPCM_EA_MAXIS_XA) += fate-adpcm-ea-maxis-xa
-fate-adpcm-ea-maxis-xa: CMD = framecrc -i $(TARGET_SAMPLES)/maxis-xa/SC2KBUG.XA -frames:a 30
-
-FATE_ADPCM-$(call DEMDEC, EA, ADPCM_EA_R1) += fate-adpcm-ea-r1
-fate-adpcm-ea-r1: CMD = framecrc -i $(TARGET_SAMPLES)/ea-mad/NFS6LogoE.mad -vn
-
-FATE_ADPCM-$(call DEMDEC, EA, ADPCM_EA_R2) += fate-adpcm-ea-r2
-fate-adpcm-ea-r2: CMD = crc -i $(TARGET_SAMPLES)/ea-mpc/THX_logo.mpc -vn
-
-FATE_ADPCM-$(call DEMDEC, EA, ADPCM_EA_R3) += fate-adpcm-ea-r3
-fate-adpcm-ea-r3: CMD = crc -i $(TARGET_SAMPLES)/ea-vp6/THX_logo.vp6 -vn
-
-FATE_ADPCM-$(call DEMDEC, AVI, ADPCM_IMA_AMV) += fate-adpcm-ima-amv
-fate-adpcm-ima-amv: CMD = framecrc -i $(TARGET_SAMPLES)/amv/MTV_high_res_320x240_sample_Penguin_Joke_MTV_from_WMV.amv -t 10 -vn
-
-FATE_ADPCM-$(call DEMDEC, APC, ADPCM_IMA_APC) += fate-adpcm-ima-apc
-fate-adpcm-ima-apc: CMD = md5 -i $(TARGET_SAMPLES)/cryo-apc/cine007.APC -f s16le
-
-FATE_ADPCM-$(call DEMDEC, AVI, ADPCM_IMA_DK3) += fate-adpcm-ima-dk3
-fate-adpcm-ima-dk3: CMD = md5 -i $(TARGET_SAMPLES)/duck/sop-audio-only.avi -f s16le
-
-FATE_ADPCM-$(call DEMDEC, AVI, ADPCM_IMA_DK4) += fate-adpcm-ima-dk4
-fate-adpcm-ima-dk4: CMD = md5 -i $(TARGET_SAMPLES)/duck/salsa-audio-only.avi -f s16le
-
-FATE_ADPCM-$(call DEMDEC, EA, ADPCM_IMA_EA_EACS) += fate-adpcm-ima-ea-eacs
-fate-adpcm-ima-ea-eacs: CMD = framecrc -i $(TARGET_SAMPLES)/ea-tgv/INTRO8K-partial.TGV -vn
-
-FATE_ADPCM-$(call DEMDEC, EA, ADPCM_IMA_EA_SEAD) += fate-adpcm-ima-ea-sead
-fate-adpcm-ima-ea-sead: CMD = framecrc -i $(TARGET_SAMPLES)/ea-tgv/INTEL_S.TGV -vn
-
-FATE_ADPCM-$(call DEMDEC, ISS, ADPCM_IMA_ISS) += fate-adpcm-ima-iss
-fate-adpcm-ima-iss: CMD = md5 -i $(TARGET_SAMPLES)/funcom-iss/0004010100.iss -f s16le
-
-FATE_ADPCM-$(call DEMDEC, SMJPEG, ADPCM_IMA_SMJPEG) += fate-adpcm-ima-smjpeg
-fate-adpcm-ima-smjpeg: CMD = framecrc -i $(TARGET_SAMPLES)/smjpeg/scenwin.mjpg -vn
-
-FATE_ADPCM-$(call DEMDEC, MOV, ADPCM_IMA_WAV) += fate-adpcm-ima_wav-stereo
-fate-adpcm-ima_wav-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-16-L-ms11.mov -f s16le
-
-FATE_ADPCM-$(call DEMDEC, WSVQA, ADPCM_IMA_WS) += fate-adpcm-ima-ws
-fate-adpcm-ima-ws: CMD = framecrc -i $(TARGET_SAMPLES)/vqa/cc-demo1-partial.vqa -vn
-
-FATE_ADPCM-$(call DEMDEC, DXA, ADPCM_MS) += fate-adpcm-ms-mono
-fate-adpcm-ms-mono: CMD = framecrc -i $(TARGET_SAMPLES)/dxa/meetsquid.dxa -t 2 -vn
-
-FATE_ADPCM-$(call DEMDEC, MOV, ADPCM_MS) += fate-adpcm_ms-stereo
-fate-adpcm_ms-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-16-L-ms02.mov -f s16le
-
-FATE_ADPCM-$(call DEMDEC, THP, ADPCM_THP) += fate-adpcm-thp
-fate-adpcm-thp: CMD = framecrc -i $(TARGET_SAMPLES)/thp/pikmin2-opening1-partial.thp -vn
-
-FATE_ADPCM-$(call DEMDEC, STR, ADPCM_XA) += fate-adpcm-xa
-fate-adpcm-xa: CMD = framecrc -i $(TARGET_SAMPLES)/psx-str/abc000_cut.str -vn
-
-FATE_SAMPLES_AVCONV += $(FATE_ADPCM-yes)
-fate-adpcm: $(FATE_ADPCM-yes)
diff --git a/deps/libav/tests/fate/alac.mak b/deps/libav/tests/fate/alac.mak
deleted file mode 100644
index 5e29e90..0000000
--- a/deps/libav/tests/fate/alac.mak
+++ /dev/null
@@ -1,24 +0,0 @@
-FATE_ALAC += fate-alac-16-level-0                                       \
-             fate-alac-16-level-1                                       \
-             fate-alac-16-level-2                                       \
-             fate-alac-16-lpc-orders                                    \
-             fate-alac-24-level-0                                       \
-             fate-alac-24-level-1                                       \
-             fate-alac-24-level-2                                       \
-             fate-alac-24-lpc-orders                                    \
-
-fate-alac-16-level-%:    OPTS = -compression_level $(@:fate-alac-16-level-%=%)
-fate-alac-24-level-%:    OPTS = -compression_level $(@:fate-alac-24-level-%=%)
-fate-alac-%-lpc-orders:  OPTS = -min_prediction_order 1 -max_prediction_order 30
-
-fate-alac-16-%: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
-fate-alac-16-%: CMD = enc_dec_pcm mov wav s16le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c alac $(OPTS)
-
-fate-alac-24-%: REF = $(SAMPLES)/audio-reference/divertimenti_2ch_96kHz_s24.wav
-fate-alac-24-%: CMD = enc_dec_pcm mov wav s24le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c alac $(OPTS)
-
-fate-alac-%: CMP = oneoff
-fate-alac-%: FUZZ = 0
-
-FATE_SAMPLES_AVCONV-$(call ENCDEC, ALAC, MOV) += $(FATE_ALAC)
-fate-alac: $(FATE_ALAC)
diff --git a/deps/libav/tests/fate/als.mak b/deps/libav/tests/fate/als.mak
deleted file mode 100644
index ff2badf..0000000
--- a/deps/libav/tests/fate/als.mak
+++ /dev/null
@@ -1,11 +0,0 @@
-ALS_SUITE = 00 01 02 03 04 05
-
-define FATE_ALS_SUITE
-FATE_ALS += fate-mpeg4-als-conformance-$(1)
-fate-mpeg4-als-conformance-$(1): CMD = crc -i $(TARGET_SAMPLES)/lossless-audio/als_$(1)_2ch48k16b.mp4
-endef
-
-$(foreach N,$(ALS_SUITE),$(eval $(call FATE_ALS_SUITE,$(N))))
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, ALS) += $(FATE_ALS)
-fate-als: $(FATE_ALS)
diff --git a/deps/libav/tests/fate/amrnb.mak b/deps/libav/tests/fate/amrnb.mak
deleted file mode 100644
index c0feec2..0000000
--- a/deps/libav/tests/fate/amrnb.mak
+++ /dev/null
@@ -1,36 +0,0 @@
-FATE_AMRNB += fate-amrnb-4k75
-fate-amrnb-4k75: CMD = pcm -i $(TARGET_SAMPLES)/amrnb/4.75k.amr
-fate-amrnb-4k75: REF = $(SAMPLES)/amrnb/4.75k.pcm
-
-FATE_AMRNB += fate-amrnb-5k15
-fate-amrnb-5k15: CMD = pcm -i $(TARGET_SAMPLES)/amrnb/5.15k.amr
-fate-amrnb-5k15: REF = $(SAMPLES)/amrnb/5.15k.pcm
-
-FATE_AMRNB += fate-amrnb-5k9
-fate-amrnb-5k9: CMD = pcm -i $(TARGET_SAMPLES)/amrnb/5.9k.amr
-fate-amrnb-5k9: REF = $(SAMPLES)/amrnb/5.9k.pcm
-
-FATE_AMRNB += fate-amrnb-6k7
-fate-amrnb-6k7: CMD = pcm -i $(TARGET_SAMPLES)/amrnb/6.7k.amr
-fate-amrnb-6k7: REF = $(SAMPLES)/amrnb/6.7k.pcm
-
-FATE_AMRNB += fate-amrnb-7k4
-fate-amrnb-7k4: CMD = pcm -i $(TARGET_SAMPLES)/amrnb/7.4k.amr
-fate-amrnb-7k4: REF = $(SAMPLES)/amrnb/7.4k.pcm
-
-FATE_AMRNB += fate-amrnb-7k95
-fate-amrnb-7k95: CMD = pcm -i $(TARGET_SAMPLES)/amrnb/7.95k.amr
-fate-amrnb-7k95: REF = $(SAMPLES)/amrnb/7.95k.pcm
-
-FATE_AMRNB += fate-amrnb-10k2
-fate-amrnb-10k2: CMD = pcm -i $(TARGET_SAMPLES)/amrnb/10.2k.amr
-fate-amrnb-10k2: REF = $(SAMPLES)/amrnb/10.2k.pcm
-
-FATE_AMRNB += fate-amrnb-12k2
-fate-amrnb-12k2: CMD = pcm -i $(TARGET_SAMPLES)/amrnb/12.2k.amr
-fate-amrnb-12k2: REF = $(SAMPLES)/amrnb/12.2k.pcm
-
-$(FATE_AMRNB): CMP = stddev
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AMR, AMRNB) += $(FATE_AMRNB)
-fate-amrnb: $(FATE_AMRNB)
diff --git a/deps/libav/tests/fate/amrwb.mak b/deps/libav/tests/fate/amrwb.mak
deleted file mode 100644
index b93835d..0000000
--- a/deps/libav/tests/fate/amrwb.mak
+++ /dev/null
@@ -1,47 +0,0 @@
-FATE_AMRWB += fate-amrwb-6k60
-fate-amrwb-6k60: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/seed-6k60.awb
-fate-amrwb-6k60: REF = $(SAMPLES)/amrwb/seed-6k60.pcm
-
-FATE_AMRWB += fate-amrwb-8k85
-fate-amrwb-8k85: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/seed-8k85.awb
-fate-amrwb-8k85: REF = $(SAMPLES)/amrwb/seed-8k85.pcm
-
-FATE_AMRWB += fate-amrwb-12k65
-fate-amrwb-12k65: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/seed-12k65.awb
-fate-amrwb-12k65: REF = $(SAMPLES)/amrwb/seed-12k65.pcm
-
-FATE_AMRWB += fate-amrwb-14k25
-fate-amrwb-14k25: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/seed-14k25.awb
-fate-amrwb-14k25: REF = $(SAMPLES)/amrwb/seed-14k25.pcm
-fate-amrwb-14k25: FUZZ = 2.6
-
-FATE_AMRWB += fate-amrwb-15k85
-fate-amrwb-15k85: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/seed-15k85.awb
-fate-amrwb-15k85: REF = $(SAMPLES)/amrwb/seed-15k85.pcm
-
-FATE_AMRWB += fate-amrwb-18k25
-fate-amrwb-18k25: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/seed-18k25.awb
-fate-amrwb-18k25: REF = $(SAMPLES)/amrwb/seed-18k25.pcm
-
-FATE_AMRWB += fate-amrwb-19k85
-fate-amrwb-19k85: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/seed-19k85.awb
-fate-amrwb-19k85: REF = $(SAMPLES)/amrwb/seed-19k85.pcm
-
-FATE_AMRWB += fate-amrwb-23k05
-fate-amrwb-23k05: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/seed-23k05.awb
-fate-amrwb-23k05: REF = $(SAMPLES)/amrwb/seed-23k05.pcm
-fate-amrwb-23k05: FUZZ = 2
-
-FATE_AMRWB += fate-amrwb-23k85
-fate-amrwb-23k85: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/seed-23k85.awb
-fate-amrwb-23k85: REF = $(SAMPLES)/amrwb/seed-23k85.pcm
-fate-amrwb-23k85: FUZZ = 2
-
-FATE_AMRWB += fate-amrwb-23k85-2
-fate-amrwb-23k85-2: CMD = pcm -i $(TARGET_SAMPLES)/amrwb/deus-23k85.awb
-fate-amrwb-23k85-2: REF = $(SAMPLES)/amrwb/deus-23k85.pcm
-
-$(FATE_AMRWB): CMP = stddev
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AMR, AMRWB) += $(FATE_AMRWB)
-fate-amrwb: $(FATE_AMRWB)
diff --git a/deps/libav/tests/fate/atrac.mak b/deps/libav/tests/fate/atrac.mak
deleted file mode 100644
index 94dbe38..0000000
--- a/deps/libav/tests/fate/atrac.mak
+++ /dev/null
@@ -1,26 +0,0 @@
-FATE_ATRAC1-$(call DEMDEC, AEA, ATRAC1) += fate-atrac1
-fate-atrac1: CMD = pcm -i $(TARGET_SAMPLES)/atrac1/test_tones_small.aea
-fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm
-
-FATE_ATRAC3 += fate-atrac3-1
-fate-atrac3-1: CMD = pcm -i $(TARGET_SAMPLES)/atrac3/mc_sich_at3_066_small.wav
-fate-atrac3-1: REF = $(SAMPLES)/atrac3/mc_sich_at3_066_small.pcm
-
-FATE_ATRAC3 += fate-atrac3-2
-fate-atrac3-2: CMD = pcm -i $(TARGET_SAMPLES)/atrac3/mc_sich_at3_105_small.wav
-fate-atrac3-2: REF = $(SAMPLES)/atrac3/mc_sich_at3_105_small.pcm
-
-FATE_ATRAC3 += fate-atrac3-3
-fate-atrac3-3: CMD = pcm -i $(TARGET_SAMPLES)/atrac3/mc_sich_at3_132_small.wav
-fate-atrac3-3: REF = $(SAMPLES)/atrac3/mc_sich_at3_132_small.pcm
-
-FATE_ATRAC3-$(call DEMDEC, WAV, ATRAC3) += $(FATE_ATRAC3)
-
-FATE_ATRAC_ALL = $(FATE_ATRAC1-yes) $(FATE_ATRAC3-yes)
-
-$(FATE_ATRAC_ALL): CMP = oneoff
-
-FATE_SAMPLES_AVCONV += $(FATE_ATRAC_ALL)
-
-fate-atrac:  $(FATE_ATRAC_ALL)
-fate-atrac3: $(FATE_ATRAC3-yes)
diff --git a/deps/libav/tests/fate/audio.mak b/deps/libav/tests/fate/audio.mak
deleted file mode 100644
index a0e0caf..0000000
--- a/deps/libav/tests/fate/audio.mak
+++ /dev/null
@@ -1,44 +0,0 @@
-FATE_BINKAUDIO-$(call DEMDEC, BINK, BINKAUDIO_DCT) += fate-binkaudio-dct
-fate-binkaudio-dct: CMD = pcm -i $(TARGET_SAMPLES)/bink/binkaudio_dct.bik
-fate-binkaudio-dct: REF = $(SAMPLES)/bink/binkaudio_dct.pcm
-fate-binkaudio-dct: FUZZ = 2
-
-FATE_BINKAUDIO-$(call DEMDEC, BINK, BINKAUDIO_RDFT) += fate-binkaudio-rdft
-fate-binkaudio-rdft: CMD = pcm -i $(TARGET_SAMPLES)/bink/binkaudio_rdft.bik
-fate-binkaudio-rdft: REF = $(SAMPLES)/bink/binkaudio_rdft.pcm
-fate-binkaudio-rdft: FUZZ = 2
-
-$(FATE_BINKAUDIO-yes): CMP = oneoff
-
-FATE_SAMPLES_AVCONV += $(FATE_BINKAUDIO-yes)
-fate-binkaudio: $(FATE_BINKAUDIO-yes)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, BMV, BMV_AUDIO) += fate-bmv-audio
-fate-bmv-audio: CMD = framecrc -i $(TARGET_SAMPLES)/bmv/SURFING-partial.BMV -vn
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, DSICIN, DSICINAUDIO) += fate-delphine-cin-audio
-fate-delphine-cin-audio: CMD = framecrc -i $(TARGET_SAMPLES)/delphine-cin/LOGO-partial.CIN -vn
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MPEGTS, DCA) += fate-dts
-fate-dts: CMD = pcm -i $(TARGET_SAMPLES)/dts/dts.ts
-fate-dts: CMP = oneoff
-fate-dts: REF = $(SAMPLES)/dts/dts.pcm
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, IMC) += fate-imc
-fate-imc: CMD = pcm -i $(TARGET_SAMPLES)/imc/imc.avi
-fate-imc: CMP = oneoff
-fate-imc: REF = $(SAMPLES)/imc/imc.pcm
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, FLV, NELLYMOSER) += fate-nellymoser
-fate-nellymoser: CMD = pcm -i $(TARGET_SAMPLES)/nellymoser/nellymoser.flv
-fate-nellymoser: CMP = oneoff
-fate-nellymoser: REF = $(SAMPLES)/nellymoser/nellymoser.pcm
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, VMD, VMDAUDIO) += fate-sierra-vmd-audio
-fate-sierra-vmd-audio: CMD = framecrc -i $(TARGET_SAMPLES)/vmd/12.vmd -vn
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, SMACKER, SMACKAUD) += fate-smacker-audio
-fate-smacker-audio: CMD = framecrc -i $(TARGET_SAMPLES)/smacker/wetlogo.smk -vn
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, WSVQA, WS_SND1) += fate-ws_snd
-fate-ws_snd: CMD = md5 -i $(TARGET_SAMPLES)/vqa/ws_snd.vqa -f s16le
diff --git a/deps/libav/tests/fate/avformat.mak b/deps/libav/tests/fate/avformat.mak
deleted file mode 100644
index 7ef68ad..0000000
--- a/deps/libav/tests/fate/avformat.mak
+++ /dev/null
@@ -1,53 +0,0 @@
-FATE_LAVF-$(call ENCDEC,  PCM_S16BE,             AIFF)               += aiff
-FATE_LAVF-$(call ENCDEC,  PCM_ALAW,              PCM_ALAW)           += alaw
-FATE_LAVF-$(call ENCDEC2, MSMPEG4V3,  MP2,       ASF)                += asf
-FATE_LAVF-$(call ENCDEC,  PCM_S16BE,             AU)                 += au
-FATE_LAVF-$(call ENCDEC2, MPEG4,      MP2,       AVI)                += avi
-FATE_LAVF-$(call ENCDEC,  BMP,                   IMAGE2)             += bmp
-FATE_LAVF-$(call ENCDEC,  DPX,                   IMAGE2)             += dpx
-FATE_LAVF-$(call ENCDEC2, DVVIDEO,    PCM_S16LE, AVI)                += dv_fmt
-FATE_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,       FFM)                += ffm
-FATE_LAVF-$(call ENCDEC,  FLV,                   FLV)                += flv_fmt
-FATE_LAVF-$(call ENCDEC,  GIF,                   IMAGE2)             += gif
-FATE_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, GXF)                += gxf
-FATE_LAVF-$(call ENCDEC,  MJPEG,                 IMAGE2)             += jpg
-FATE_LAVF-$(call ENCDEC2, MPEG4,      MP2,       MATROSKA)           += mkv
-FATE_LAVF-$(call ENCDEC,  ADPCM_YAMAHA,          MMF)                += mmf
-FATE_LAVF-$(call ENCDEC2, MPEG4,      PCM_ALAW,  MOV)                += mov
-FATE_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,       MPEG1SYSTEM MPEGPS) += mpg
-FATE_LAVF-$(call ENCDEC,  PCM_MULAW,             PCM_MULAW)          += mulaw
-FATE_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF)                += mxf
-FATE_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF_D10 MXF)        += mxf_d10
-FATE_LAVF-$(call ENCDEC2, MPEG4,      MP2,       NUT)                += nut
-FATE_LAVF-$(call ENCDEC,  FLAC,                  OGG)                += ogg
-FATE_LAVF-$(call ENCDEC,  PAM,                   IMAGE2)             += pam
-FATE_LAVF-$(call ENCDEC,  PBM,                   IMAGE2PIPE)         += pbmpipe
-FATE_LAVF-$(call ENCDEC,  PCX,                   IMAGE2)             += pcx
-FATE_LAVF-$(call ENCDEC,  PGM,                   IMAGE2)             += pgm
-FATE_LAVF-$(call ENCDEC,  PGM,                   IMAGE2PIPE)         += pgmpipe
-FATE_LAVF-$(call ENCDEC,  PNG,                   IMAGE2)             += png
-FATE_LAVF-$(call ENCDEC,  PPM,                   IMAGE2)             += ppm
-FATE_LAVF-$(call ENCDEC,  PPM,                   IMAGE2PIPE)         += ppmpipe
-FATE_LAVF-$(call ENCMUX,  RV10 AC3_FIXED,        RM)                 += rm
-FATE_LAVF-$(call ENCDEC,  PCM_U8,                RSO)                += rso
-FATE_LAVF-$(call ENCDEC,  SGI,                   IMAGE2)             += sgi
-FATE_LAVF-$(call ENCDEC,  PCM_S16LE,             SOX)                += sox
-FATE_LAVF-$(call ENCDEC,  SUNRAST,               IMAGE2)             += sunrast
-FATE_LAVF-$(call ENCDEC,  FLV,                   SWF)                += swf
-FATE_LAVF-$(call ENCDEC,  TARGA,                 IMAGE2)             += tga
-FATE_LAVF-$(call ENCDEC,  TIFF,                  IMAGE2)             += tiff
-FATE_LAVF-$(call ENCDEC2, MPEG2VIDEO, MP2,       MPEGTS)             += ts
-FATE_LAVF-$(call ENCDEC,  PCM_U8,                VOC)                += voc
-FATE_LAVF-$(call ENCDEC,  PCM_S16LE,             VOC)                += voc_s16
-FATE_LAVF-$(call ENCDEC,  PCM_S16LE,             WAV)                += wav
-FATE_LAVF-$(call ENCDEC,  XWD,                   IMAGE2)             += xwd
-FATE_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER)                               += yuv4mpeg
-
-FATE_LAVF += $(FATE_LAVF-yes:%=fate-lavf-%)
-FATE_LAVF += fate-lavf-pixfmt
-
-$(FATE_LAVF): $(AREF) $(VREF)
-$(FATE_LAVF): CMD = lavftest
-
-FATE_AVCONV += $(FATE_LAVF)
-fate-lavf:     $(FATE_LAVF)
diff --git a/deps/libav/tests/fate/bmp.mak b/deps/libav/tests/fate/bmp.mak
deleted file mode 100644
index 923c70d..0000000
--- a/deps/libav/tests/fate/bmp.mak
+++ /dev/null
@@ -1,43 +0,0 @@
-FATE_BMP += fate-bmp-1bit
-fate-bmp-1bit: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test1.bmp -pix_fmt rgb24
-
-FATE_BMP += fate-bmp-4bit
-fate-bmp-4bit: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test4.bmp -pix_fmt rgb24
-
-FATE_BMP += fate-bmp-4bit-os2
-fate-bmp-4bit-os2: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test4os2v2.bmp -pix_fmt rgb24
-
-FATE_BMP += fate-bmp-8bit
-fate-bmp-8bit: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test8.bmp -pix_fmt rgb24
-
-FATE_BMP += fate-bmp-8bit-os2
-fate-bmp-8bit-os2: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test8os2.bmp -pix_fmt rgb24
-
-FATE_BMP += fate-bmp-15bit
-fate-bmp-15bit: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test16.bmp -pix_fmt rgb555le
-
-FATE_BMP += fate-bmp-15bit-mask
-fate-bmp-15bit-mask: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test16bf555.bmp -pix_fmt rgb555le
-
-FATE_BMP += fate-bmp-16bit-mask
-fate-bmp-16bit-mask: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test16bf565.bmp -pix_fmt rgb565le
-
-FATE_BMP += fate-bmp-24bit
-fate-bmp-24bit: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test24.bmp
-
-FATE_BMP += fate-bmp-32bit
-fate-bmp-32bit: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test32.bmp -pix_fmt bgr24
-
-FATE_BMP += fate-bmp-32bit-mask
-fate-bmp-32bit-mask: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/test32bf.bmp -pix_fmt bgr24
-
-FATE_BMP += fate-bmp-rle4
-fate-bmp-rle4: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/testcompress4.bmp -pix_fmt rgb24
-
-FATE_BMP += fate-bmp-rle8
-fate-bmp-rle8: CMD = framecrc -i $(TARGET_SAMPLES)/bmp/testcompress8.bmp -pix_fmt rgb24
-
-FATE_BMP-$(call DEMDEC, IMAGE2, BMP) += $(FATE_BMP)
-
-FATE_SAMPLES_AVCONV += $(FATE_BMP-yes)
-fate-bmp: $(FATE_BMP-yes)
diff --git a/deps/libav/tests/fate/cdxl.mak b/deps/libav/tests/fate/cdxl.mak
deleted file mode 100644
index 8144f96..0000000
--- a/deps/libav/tests/fate/cdxl.mak
+++ /dev/null
@@ -1,19 +0,0 @@
-FATE_CDXL += fate-cdxl-bitline-ham6
-fate-cdxl-bitline-ham6: CMD = framecrc -i $(TARGET_SAMPLES)/cdxl/bitline.cdxl -frames:v 10
-
-FATE_CDXL += fate-cdxl-ham6
-fate-cdxl-ham6: CMD = framecrc -i $(TARGET_SAMPLES)/cdxl/cat.cdxl -an -frames:v 16
-
-FATE_CDXL += fate-cdxl-ham8
-fate-cdxl-ham8: CMD = framecrc -i $(TARGET_SAMPLES)/cdxl/mirage.cdxl -an -frames:v 1
-
-FATE_CDXL += fate-cdxl-pal8
-fate-cdxl-pal8: CMD = framecrc -i $(TARGET_SAMPLES)/cdxl/maku.cdxl -pix_fmt rgb24 -frames:v 11
-
-FATE_CDXL += fate-cdxl-pal8-small
-fate-cdxl-pal8-small: CMD = framecrc -i $(TARGET_SAMPLES)/cdxl/fruit.cdxl -an -pix_fmt rgb24 -frames:v 46
-
-FATE_CDXL-$(call DEMDEC, CDXL, CDXL) += $(FATE_CDXL)
-
-FATE_SAMPLES_AVCONV += $(FATE_CDXL-yes)
-fate-cdxl: $(FATE_CDXL-yes)
diff --git a/deps/libav/tests/fate/cover-art.mak b/deps/libav/tests/fate/cover-art.mak
deleted file mode 100644
index 54dc0ba..0000000
--- a/deps/libav/tests/fate/cover-art.mak
+++ /dev/null
@@ -1,35 +0,0 @@
-FATE_COVER_ART += fate-cover-art-ape
-fate-cover-art-ape: CMD = md5 -i $(TARGET_SAMPLES)/cover_art/luckynight_cover.ape -an -c:v copy -f rawvideo
-fate-cover-art-ape: REF = 45333c983c45af54449dff10af144317
-
-FATE_COVER_ART += fate-cover-art-flac
-fate-cover-art-flac: CMD = md5 -i $(TARGET_SAMPLES)/cover_art/cover_art.flac -an -c:v copy -f rawvideo
-fate-cover-art-flac: REF = 0de1fc6200596fa32b8f7300a14c0261
-
-FATE_COVER_ART += fate-cover-art-m4a
-fate-cover-art-m4a: CMD = md5 -i $(TARGET_SAMPLES)/cover_art/Owner-iTunes_9.0.3.15.m4a -an -c:v copy -f rawvideo
-fate-cover-art-m4a: REF = 08ba70a3b594ff6345a93965e96a9d3e
-
-FATE_COVER_ART += fate-cover-art-ogg
-fate-cover-art-ogg: CMD = md5 -i $(TARGET_SAMPLES)/cover_art/ogg_vorbiscomment_cover.opus -an -c:v copy -f rawvideo
-fate-cover-art-ogg: REF = b796d33363dbfed1868523b5c751b7b1
-
-FATE_COVER_ART += fate-cover-art-wma
-fate-cover-art-wma: CMD = md5 -i $(TARGET_SAMPLES)/cover_art/Californication_cover.wma -an -c:v copy -f rawvideo
-fate-cover-art-wma: REF = 0808bd0e1b61542a16e1906812dd924b
-
-FATE_COVER_ART += fate-cover-art-wma-id3
-fate-cover-art-wma-id3: CMD = md5 -i $(TARGET_SAMPLES)/cover_art/wma_with_ID3_APIC_trimmed.wma -an -c:v copy -f rawvideo
-fate-cover-art-wma-id3: REF = e6a8dd03687d5178bc13fc7d3316696e
-
-FATE_COVER_ART += fate-cover-art-wma-metadatalib
-fate-cover-art-wma-metadatalib: CMD = md5 -i $(TARGET_SAMPLES)/cover_art/wma_with_metadata_library_object_tag_trimmed.wma -map 0:v -c:v copy -f rawvideo
-fate-cover-art-wma-metadatalib: REF = 32e8bd4fad546f63d881a0256f083aea
-
-FATE_COVER_ART += fate-cover-art-wv
-fate-cover-art-wv: CMD = md5 -i $(TARGET_SAMPLES)/cover_art/luckynight_cover.wv -an -c:v copy -f rawvideo
-fate-cover-art-wv: REF = 45333c983c45af54449dff10af144317
-
-$(FATE_COVER_ART): CMP = oneline
-FATE_SAMPLES_AVCONV += $(FATE_COVER_ART)
-fate-cover-art: $(FATE_COVER_ART)
diff --git a/deps/libav/tests/fate/demux.mak b/deps/libav/tests/fate/demux.mak
deleted file mode 100644
index 2446b90..0000000
--- a/deps/libav/tests/fate/demux.mak
+++ /dev/null
@@ -1,71 +0,0 @@
-FATE_SAMPLES_AVCONV-$(CONFIG_AAC_DEMUXER) += fate-adts-demux
-fate-adts-demux: CMD = crc -i $(TARGET_SAMPLES)/aac/ct_faac-adts.aac -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_AEA_DEMUXER) += fate-aea-demux
-fate-aea-demux: CMD = crc -i $(TARGET_SAMPLES)/aea/chirp.aea -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_BINK_DEMUXER) += fate-bink-demux
-fate-bink-demux: CMD = crc -i $(TARGET_SAMPLES)/bink/Snd0a7d9b58.dee -vn -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_CAF_DEMUXER) += fate-caf
-fate-caf: CMD = crc -i $(TARGET_SAMPLES)/caf/caf-pcm16.caf -c copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_CDXL_DEMUXER) += fate-cdxl-demux
-fate-cdxl-demux: CMD = framecrc -i $(TARGET_SAMPLES)/cdxl/mirage.cdxl -vcodec copy -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_DAUD_DEMUXER) += fate-d-cinema-demux
-fate-d-cinema-demux: CMD = framecrc -i $(TARGET_SAMPLES)/d-cinema/THX_Science_FLT_1920-partial.302 -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_IV8_DEMUXER) += fate-iv8-demux
-fate-iv8-demux: CMD = framecrc -i $(TARGET_SAMPLES)/iv8/zzz-partial.mpg -vcodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_LMLM4_DEMUXER) += fate-lmlm4-demux
-fate-lmlm4-demux: CMD = framecrc -i $(TARGET_SAMPLES)/lmlm4/LMLM4_CIFat30fps.divx -t 3 -acodec copy -vcodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_XA_DEMUXER) += fate-maxis-xa
-fate-maxis-xa: CMD = framecrc -i $(TARGET_SAMPLES)/maxis-xa/SC2KBUG.XA -frames:a 30 -c:a copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_MTV_DEMUXER) += fate-mtv
-fate-mtv: CMD = framecrc -i $(TARGET_SAMPLES)/mtv/comedian_auto-partial.mtv -c copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_MXF_DEMUXER) += fate-mxf-demux
-fate-mxf-demux: CMD = framecrc -i $(TARGET_SAMPLES)/mxf/C0023S01.mxf -acodec copy -vcodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_NC_DEMUXER) += fate-nc-demux
-fate-nc-demux: CMD = framecrc -i $(TARGET_SAMPLES)/nc-camera/nc-sample-partial -vcodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_NSV_DEMUXER) += fate-nsv-demux
-fate-nsv-demux: CMD = framecrc -i $(TARGET_SAMPLES)/nsv/witchblade-51kbps.nsv -t 6 -vcodec copy -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_OMA_DEMUXER) += fate-oma-demux
-fate-oma-demux: CMD = crc -i $(TARGET_SAMPLES)/oma/01-Untitled-partial.oma -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_STR_DEMUXER) += fate-psx-str-demux
-fate-psx-str-demux: CMD = framecrc -i $(TARGET_SAMPLES)/psx-str/descent-partial.str -c copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_PVA_DEMUXER) += fate-pva-demux
-fate-pva-demux: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/pva/PVA_test-partial.pva -t 0.6 -acodec copy -vn
-
-FATE_SAMPLES_AVCONV-$(CONFIG_QCP_DEMUXER) += fate-qcp-demux
-fate-qcp-demux: CMD = crc -i $(TARGET_SAMPLES)/qcp/0036580847.QCP -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_R3D_DEMUXER) += fate-redcode-demux
-fate-redcode-demux: CMD = framecrc -i $(TARGET_SAMPLES)/r3d/4MB-sample.r3d -vcodec copy -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_SIFF_DEMUXER) += fate-siff-demux
-fate-siff-demux: CMD = framecrc -i $(TARGET_SAMPLES)/SIFF/INTRO_B.VB -c copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_SMJPEG_DEMUXER) += fate-smjpeg-demux
-fate-smjpeg-demux: CMD = framecrc -i $(TARGET_SAMPLES)/smjpeg/scenwin.mjpg -c copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_WSAUD_DEMUXER) += fate-westwood-aud
-fate-westwood-aud: CMD = framecrc -i $(TARGET_SAMPLES)/westwood-aud/excellent.aud -c copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_WTV_DEMUXER) += fate-wtv-demux
-fate-wtv-demux: CMD = framecrc -i $(TARGET_SAMPLES)/wtv/law-and-order-partial.wtv -vcodec copy -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_XMV_DEMUXER) += fate-xmv-demux
-fate-xmv-demux: CMD = framecrc -i $(TARGET_SAMPLES)/xmv/logos1p.fmv -vcodec copy -acodec copy
-
-FATE_SAMPLES_AVCONV-$(CONFIG_XWMA_DEMUXER) += fate-xwma-demux
-fate-xwma-demux: CMD = crc -i $(TARGET_SAMPLES)/xwma/ergon.xwma -acodec copy
diff --git a/deps/libav/tests/fate/dfa.mak b/deps/libav/tests/fate/dfa.mak
deleted file mode 100644
index f4b6057..0000000
--- a/deps/libav/tests/fate/dfa.mak
+++ /dev/null
@@ -1,37 +0,0 @@
-FATE_DFA += fate-dfa1
-fate-dfa1: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0000.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa2
-fate-dfa2: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0001.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa3
-fate-dfa3: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0002.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa4
-fate-dfa4: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0003.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa5
-fate-dfa5: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0004.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa6
-fate-dfa6: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0005.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa7
-fate-dfa7: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0006.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa8
-fate-dfa8: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0007.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa9
-fate-dfa9: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0008.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa10
-fate-dfa10: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0009.dfa -pix_fmt rgb24
-
-FATE_DFA += fate-dfa11
-fate-dfa11: CMD = framecrc -i $(TARGET_SAMPLES)/chronomaster-dfa/0010.dfa -pix_fmt rgb24
-
-FATE_DFA-$(call DEMDEC, DFA, DFA) += $(FATE_DFA)
-
-FATE_SAMPLES_AVCONV += $(FATE_DFA-yes)
-fate-dfa: $(FATE_DFA-yes)
diff --git a/deps/libav/tests/fate/dpcm.mak b/deps/libav/tests/fate/dpcm.mak
deleted file mode 100644
index dd27246..0000000
--- a/deps/libav/tests/fate/dpcm.mak
+++ /dev/null
@@ -1,14 +0,0 @@
-FATE_DPCM-$(call DEMDEC, ROQ, ROQ_DPCM) += fate-dpcm-idroq
-fate-dpcm-idroq: CMD = framecrc -i $(TARGET_SAMPLES)/idroq/idlogo.roq -vn
-
-FATE_DPCM-$(call DEMDEC, IPMOVIE, INTERPLAY_DPCM) += fate-dpcm-interplay
-fate-dpcm-interplay: CMD = framecrc -i $(TARGET_SAMPLES)/interplay-mve/interplay-logo-2MB.mve -vn
-
-FATE_DPCM-$(call DEMDEC, SOL, SOL_DPCM) += fate-dpcm-sierra
-fate-dpcm-sierra: CMD = md5 -i $(TARGET_SAMPLES)/sol/lsl7sample.sol -f s16le
-
-FATE_DPCM-$(call DEMDEC, AVI, XAN_DPCM) += fate-dpcm-xan
-fate-dpcm-xan: CMD = md5 -i $(TARGET_SAMPLES)/wc4-xan/wc4_2.avi -vn -f s16le
-
-FATE_SAMPLES_AVCONV += $(FATE_DPCM-yes)
-fate-dpcm: $(FATE_DPCM-yes)
diff --git a/deps/libav/tests/fate/ea.mak b/deps/libav/tests/fate/ea.mak
deleted file mode 100644
index 2bffd47..0000000
--- a/deps/libav/tests/fate/ea.mak
+++ /dev/null
@@ -1,23 +0,0 @@
-FATE_SAMPLES_AVCONV-$(call DEMDEC, EA_CDATA, ADPCM_EA_XAS) += fate-ea-cdata
-fate-ea-cdata: CMD = md5 -i $(TARGET_SAMPLES)/ea-cdata/166b084d.46410f77.0009b440.24be960c.cdata -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, EA, EACMV) += fate-ea-cmv
-fate-ea-cmv: CMD = framecrc -i $(TARGET_SAMPLES)/ea-cmv/TITLE.CMV -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, EA, EAMAD) += fate-ea-mad
-fate-ea-mad: CMD = framecrc -i $(TARGET_SAMPLES)/ea-mad/NFS6LogoE.mad -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, EA, EATGQ) += fate-ea-tgq
-fate-ea-tgq: CMD = framecrc -i $(TARGET_SAMPLES)/ea-tgq/v27.tgq -an
-
-FATE_EA_TGV += fate-ea-tgv-1
-fate-ea-tgv-1: CMD = framecrc -i $(TARGET_SAMPLES)/ea-tgv/INTRO8K-partial.TGV -pix_fmt rgb24 -an
-
-FATE_EA_TGV += fate-ea-tgv-2
-fate-ea-tgv-2: CMD = framecrc -i $(TARGET_SAMPLES)/ea-tgv/INTEL_S.TGV -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, EA, EATGV) += $(FATE_EA_TGV)
-fate-ea-tgv: $(FATE_EA_TGV)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, EA, EATQI) += fate-ea-tqi
-fate-ea-tqi: CMD = framecrc -i $(TARGET_SAMPLES)/ea-wve/networkBackbone-partial.wve -frames:v 26 -an
diff --git a/deps/libav/tests/fate/fft.mak b/deps/libav/tests/fate/fft.mak
deleted file mode 100644
index 20d5638..0000000
--- a/deps/libav/tests/fate/fft.mak
+++ /dev/null
@@ -1,42 +0,0 @@
-define DEF_FFT
-FATE_FFT += fate-fft-$(1)   fate-ifft-$(1)   \
-            fate-mdct-$(1)  fate-imdct-$(1)  \
-            fate-rdft-$(1)  fate-irdft-$(1)  \
-            fate-dct1d-$(1) fate-idct1d-$(1)
-
-fate-fft-$(N):    ARGS = -n$(1)
-fate-ifft-$(N):   ARGS = -n$(1) -i
-fate-mdct-$(N):   ARGS = -n$(1) -m
-fate-imdct-$(N):  ARGS = -n$(1) -m -i
-fate-rdft-$(N):   ARGS = -n$(1) -r
-fate-irdft-$(N):  ARGS = -n$(1) -r -i
-fate-dct1d-$(N):  ARGS = -n$(1) -d
-fate-idct1d-$(N): ARGS = -n$(1) -d -i
-endef
-
-$(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT,$(N))))
-
-fate-fft-test: $(FATE_FFT)
-$(FATE_FFT): libavcodec/fft-test$(EXESUF)
-$(FATE_FFT): CMD = run libavcodec/fft-test $(CPUFLAGS:%=-c%) $(ARGS)
-$(FATE_FFT): REF = /dev/null
-
-define DEF_FFT_FIXED
-FATE_FFT_FIXED += fate-fft-fixed-$(1)   fate-ifft-fixed-$(1)  \
-                  fate-mdct-fixed-$(1) fate-imdct-fixed-$(1)
-
-fate-fft-fixed-$(1):   ARGS = -n$(1)
-fate-ifft-fixed-$(1):  ARGS = -n$(1) -i
-fate-mdct-fixed-$(1):  ARGS = -n$(1) -m
-fate-imdct-fixed-$(1): ARGS = -n$(1) -m -i
-endef
-
-$(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT_FIXED,$(N))))
-
-fate-fft-fixed-test: $(FATE_FFT_FIXED)
-$(FATE_FFT_FIXED): libavcodec/fft-fixed-test$(EXESUF)
-$(FATE_FFT_FIXED): CMD = run libavcodec/fft-fixed-test $(CPUFLAGS:%=-c%) $(ARGS)
-$(FATE_FFT_FIXED): REF = /dev/null
-
-FATE-$(call ALLYES, AVCODEC FFT) += $(FATE_FFT) $(FATE_FFT_FIXED)
-fate-fft: $(FATE_FFT) $(FATE_FFT_FIXED)
diff --git a/deps/libav/tests/fate/filter-audio.mak b/deps/libav/tests/fate/filter-audio.mak
deleted file mode 100644
index 9bf148c..0000000
--- a/deps/libav/tests/fate/filter-audio.mak
+++ /dev/null
@@ -1,75 +0,0 @@
-FATE_AMIX += fate-filter-amix-simple
-fate-filter-amix-simple: CMD = avconv -filter_complex amix -i $(SRC) -ss 3 -i $(SRC1) -f f32le -
-fate-filter-amix-simple: REF = $(SAMPLES)/filter/amix_simple.pcm
-
-FATE_AMIX += fate-filter-amix-first
-fate-filter-amix-first: CMD = avconv -filter_complex amix=duration=first -ss 4 -i $(SRC) -i $(SRC1) -f f32le -
-fate-filter-amix-first: REF = $(SAMPLES)/filter/amix_first.pcm
-
-FATE_AMIX += fate-filter-amix-transition
-fate-filter-amix-transition: tests/data/asynth-44100-2-3.wav
-fate-filter-amix-transition: SRC2 = $(TARGET_PATH)/tests/data/asynth-44100-2-3.wav
-fate-filter-amix-transition: CMD = avconv -filter_complex amix=inputs=3:dropout_transition=0.5 -i $(SRC) -ss 2 -i $(SRC1) -ss 4 -i $(SRC2) -f f32le -
-fate-filter-amix-transition: REF = $(SAMPLES)/filter/amix_transition.pcm
-
-FATE_AFILTER-$(call FILTERDEMDECENCMUX, AMIX, WAV, PCM_S16LE, PCM_F32LE, PCM_F32LE) += $(FATE_AMIX)
-$(FATE_AMIX): tests/data/asynth-44100-2.wav tests/data/asynth-44100-2-2.wav
-$(FATE_AMIX): SRC  = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
-$(FATE_AMIX): SRC1 = $(TARGET_PATH)/tests/data/asynth-44100-2-2.wav
-$(FATE_AMIX): CMP  = oneoff
-$(FATE_AMIX): CMP_UNIT = f32
-
-FATE_AFILTER-$(call FILTERDEMDECMUX, ASYNCTS, FLV, NELLYMOSER, PCM_S16LE) += fate-filter-asyncts
-fate-filter-asyncts: SRC = $(TARGET_SAMPLES)/nellymoser/nellymoser-discont.flv
-fate-filter-asyncts: CMD = pcm -analyzeduration 10000000 -i $(SRC) -af asyncts
-fate-filter-asyncts: CMP = oneoff
-fate-filter-asyncts: REF = $(SAMPLES)/nellymoser/nellymoser-discont.pcm
-
-FATE_ATRIM += fate-filter-atrim-duration
-fate-filter-atrim-duration: CMD = framecrc -i $(SRC) -af atrim=start=0.1:duration=0.01
-FATE_ATRIM += fate-filter-atrim-mixed
-fate-filter-atrim-mixed: CMD = framecrc -i $(SRC) -af atrim=start=0.05:start_sample=1025:end=0.1:end_sample=4411
-
-FATE_ATRIM += fate-filter-atrim-samples
-fate-filter-atrim-samples: CMD = framecrc -i $(SRC) -af atrim=start_sample=26:end_sample=80
-
-FATE_ATRIM += fate-filter-atrim-time
-fate-filter-atrim-time: CMD = framecrc -i $(SRC) -af atrim=0.1:0.2
-
-$(FATE_ATRIM): tests/data/asynth-44100-2.wav
-$(FATE_ATRIM): SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
-
-FATE_FILTER-$(call FILTERDEMDECENCMUX, ATRIM, WAV, PCM_S16LE, PCM_S16LE, WAV) += $(FATE_ATRIM)
-
-FATE_AFILTER-$(call FILTERDEMDECENCMUX, CHANNELMAP, WAV, PCM_S16LE, PCM_S16LE, WAV) += fate-filter-channelmap
-fate-filter-channelmap: tests/data/filtergraphs/channelmap
-fate-filter-channelmap: SRC = $(TARGET_PATH)/tests/data/asynth-44100-6.wav
-fate-filter-channelmap: tests/data/asynth-44100-6.wav
-fate-filter-channelmap: CMD = md5 -i $(SRC) -filter_complex_script $(TARGET_PATH)/tests/data/filtergraphs/channelmap -f wav -flags +bitexact
-fate-filter-channelmap: CMP = oneline
-fate-filter-channelmap: REF = 21f1977c4f9705e2057083f84764e685
-
-FATE_AFILTER-$(call FILTERDEMDECENCMUX, CHANNELSPLIT, WAV, PCM_S16LE, PCM_S16LE, PCM_S16LE) += fate-filter-channelsplit
-fate-filter-channelsplit: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
-fate-filter-channelsplit: tests/data/asynth-44100-2.wav
-fate-filter-channelsplit: CMD = md5 -i $(SRC) -filter_complex channelsplit -f s16le
-fate-filter-channelsplit: CMP = oneline
-fate-filter-channelsplit: REF = d92988d0fe2dd92236763f47b07ab597
-
-FATE_AFILTER-$(call FILTERDEMDECENCMUX, JOIN, WAV, PCM_S16LE, PCM_S16LE, PCM_S16LE) += fate-filter-join
-fate-filter-join: SRC1 = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
-fate-filter-join: SRC2 = $(TARGET_PATH)/tests/data/asynth-44100-3.wav
-fate-filter-join: tests/data/asynth-44100-2.wav tests/data/asynth-44100-3.wav
-fate-filter-join: CMD = md5 -i $(SRC1) -i $(SRC2) -filter_complex join=channel_layout=5 -f s16le
-fate-filter-join: CMP = oneline
-fate-filter-join: REF = 409e66fc5ece4ddea4aa16bc47026bb0
-
-FATE_AFILTER-$(call FILTERDEMDECENCMUX, VOLUME, WAV, PCM_S16LE, PCM_S16LE, PCM_S16LE) += fate-filter-volume
-fate-filter-volume: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
-fate-filter-volume: tests/data/asynth-44100-2.wav
-fate-filter-volume: CMD = md5 -i $(SRC) -af volume=precision=fixed:volume=0.5 -f s16le
-fate-filter-volume: CMP = oneline
-fate-filter-volume: REF = 4d6ba75ef3e32d305d066b9bc771d6f4
-
-FATE_SAMPLES_AVCONV += $(FATE_AFILTER-yes)
-fate-afilter: $(FATE_AFILTER-yes)
diff --git a/deps/libav/tests/fate/filter-video.mak b/deps/libav/tests/fate/filter-video.mak
deleted file mode 100644
index 8920701..0000000
--- a/deps/libav/tests/fate/filter-video.mak
+++ /dev/null
@@ -1,147 +0,0 @@
-FATE_FILTER-$(call FILTERDEMDEC, DELOGO, RM, RV30) += fate-filter-delogo
-fate-filter-delogo: CMD = framecrc -i $(TARGET_SAMPLES)/real/rv30.rm -vf delogo=show=0:x=290:y=25:w=26:h=16 -an
-
-FATE_YADIF += fate-filter-yadif-mode0
-fate-filter-yadif-mode0: CMD = framecrc -flags bitexact -idct simple -i $(TARGET_SAMPLES)/mpeg2/mpeg2_field_encoding.ts -vf yadif=0
-
-FATE_YADIF += fate-filter-yadif-mode1
-fate-filter-yadif-mode1: CMD = framecrc -flags bitexact -idct simple -i $(TARGET_SAMPLES)/mpeg2/mpeg2_field_encoding.ts -vf yadif=1
-
-FATE_FILTER-$(call FILTERDEMDEC, YADIF, MPEGTS, MPEG2VIDEO) += $(FATE_YADIF)
-
-FATE_SAMPLES_AVCONV += $(FATE_FILTER-yes)
-
-
-FATE_FILTER_VSYNTH-$(CONFIG_BOXBLUR_FILTER) += fate-filter-boxblur
-fate-filter-boxblur: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf boxblur=2:1
-
-FATE_FILTER_VSYNTH-$(CONFIG_DRAWBOX_FILTER) += fate-filter-drawbox
-fate-filter-drawbox: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf drawbox=10:20:200:60:red at 0.5
-
-FATE_FILTER_VSYNTH-$(CONFIG_FADE_FILTER) += fate-filter-fade
-fate-filter-fade: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf fade=in:0:25,fade=out:25:25
-
-FATE_FILTER_VSYNTH-$(call ALLYES, INTERLACE_FILTER FIELDORDER_FILTER) += fate-filter-fieldorder
-fate-filter-fieldorder: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf interlace=tff,fieldorder=bff -sws_flags +accurate_rnd+bitexact
-
-define FATE_FPFILTER_SUITE
-FATE_FILTER_VSYNTH-$(CONFIG_FRAMEPACK_FILTER) += fate-filter-framepack-$(1)
-fate-filter-framepack-$(1): CMD = framecrc -c:v pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -c:v pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -filter_complex framepack=$(1) -frames 15
-endef
-
-FPMODES = columns frameseq lines sbs tab
-$(foreach MODE,$(FPMODES),$(eval $(call FATE_FPFILTER_SUITE,$(MODE))))
-
-FATE_FILTER_VSYNTH-$(CONFIG_GRADFUN_FILTER) += fate-filter-gradfun
-fate-filter-gradfun: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf gradfun
-
-FATE_FILTER_VSYNTH-$(CONFIG_HQDN3D_FILTER) += fate-filter-hqdn3d
-fate-filter-hqdn3d: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf hqdn3d
-
-FATE_FILTER_VSYNTH-$(CONFIG_INTERLACE_FILTER) += fate-filter-interlace
-fate-filter-interlace: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf interlace
-
-FATE_FILTER_VSYNTH-$(CONFIG_NEGATE_FILTER) += fate-filter-negate
-fate-filter-negate: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf negate
-
-FATE_FILTER_VSYNTH-$(CONFIG_OVERLAY_FILTER) += fate-filter-overlay
-fate-filter-overlay: tests/data/filtergraphs/overlay
-fate-filter-overlay: CMD = framecrc -c:v pgmyuv -i $(SRC) -c:v pgmyuv -i $(SRC) -filter_complex_script $(TARGET_PATH)/tests/data/filtergraphs/overlay
-
-FATE_FILTER_VSYNTH-$(CONFIG_SELECT_FILTER) += fate-filter-select-alternate
-fate-filter-select-alternate: tests/data/filtergraphs/select-alternate
-fate-filter-select-alternate: CMD = framecrc -c:v pgmyuv -i $(SRC) -filter_script $(TARGET_PATH)/tests/data/filtergraphs/select-alternate
-
-FATE_FILTER_VSYNTH-$(call ALLYES, SETPTS_FILTER  SETTB_FILTER) += fate-filter-setpts
-fate-filter-setpts: tests/data/filtergraphs/setpts
-fate-filter-setpts: CMD = framecrc -c:v pgmyuv -i $(SRC) -filter_script $(TARGET_PATH)/tests/data/filtergraphs/setpts
-
-FATE_FILTER_VSYNTH-$(CONFIG_TRANSPOSE_FILTER) += fate-filter-transpose
-fate-filter-transpose: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf transpose
-
-FATE_TRIM += fate-filter-trim-duration
-fate-filter-trim-duration: CMD = framecrc -i $(SRC) -vf trim=start=0.4:duration=0.05
-
-FATE_TRIM += fate-filter-trim-frame
-fate-filter-trim-frame: CMD = framecrc -i $(SRC) -vf trim=start_frame=3:end_frame=10
-
-FATE_TRIM += fate-filter-trim-mixed
-fate-filter-trim-mixed: CMD = framecrc -i $(SRC) -vf trim=start=0.2:end=0.4:start_frame=1:end_frame=3
-
-FATE_TRIM += fate-filter-trim-time
-fate-filter-trim-time: CMD = framecrc -i $(SRC) -vf trim=0:0.09
-
-FATE_FILTER_VSYNTH-$(CONFIG_TRIM_FILTER) += $(FATE_TRIM)
-
-FATE_FILTER_VSYNTH-$(CONFIG_UNSHARP_FILTER) += fate-filter-unsharp
-fate-filter-unsharp: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf unsharp
-
-
-FATE_FILTER_VSYNTH-$(CONFIG_CROP_FILTER) += fate-filter-crop
-fate-filter-crop: CMD = video_filter "crop=iw-100:ih-100:100:100"
-
-FATE_FILTER_VSYNTH-$(call ALLYES, CROP_FILTER SCALE_FILTER) += fate-filter-crop_scale
-fate-filter-crop_scale: CMD = video_filter "crop=iw-100:ih-100:100:100,scale=w=400:h=-1"
-
-FATE_FILTER_VSYNTH-$(call ALLYES, CROP_FILTER SCALE_FILTER VFLIP_FILTER) += fate-filter-crop_scale_vflip
-fate-filter-crop_scale_vflip: CMD = video_filter "null,null,crop=iw-200:ih-200:200:200,crop=iw-20:ih-20:20:20,scale=w=200:h=200,scale=w=250:h=250,vflip,vflip,null,scale=w=200:h=200,crop=iw-100:ih-100:100:100,vflip,scale=w=200:h=200,null,vflip,crop=iw-100:ih-100:100:100,null"
-
-FATE_FILTER_VSYNTH-$(call ALLYES, CROP_FILTER VFLIP_FILTER) += fate-filter-crop_vflip
-fate-filter-crop_vflip: CMD = video_filter "crop=iw-100:ih-100:100:100,vflip"
-
-FATE_FILTER_VSYNTH-$(CONFIG_NULL_FILTER) += fate-filter-null
-fate-filter-null: CMD = video_filter "null"
-
-FATE_FILTER_VSYNTH-$(CONFIG_SCALE_FILTER) += fate-filter-scale200
-fate-filter-scale200: CMD = video_filter "scale=w=200:h=200"
-
-FATE_FILTER_VSYNTH-$(CONFIG_SCALE_FILTER) += fate-filter-scale500
-fate-filter-scale500: CMD = video_filter "scale=w=500:h=500"
-
-FATE_FILTER_VSYNTH-$(CONFIG_VFLIP_FILTER) += fate-filter-vflip
-fate-filter-vflip: CMD = video_filter "vflip"
-
-FATE_FILTER_VSYNTH-$(call ALLYES, CROP_FILTER VFLIP_FILTER) += fate-filter-vflip_crop
-fate-filter-vflip_crop: CMD = video_filter "vflip,crop=iw-100:ih-100:100:100"
-
-FATE_FILTER_VSYNTH-$(CONFIG_VFLIP_FILTER) += fate-filter-vflip_vflip
-fate-filter-vflip_vflip: CMD = video_filter "vflip,vflip"
-
-
-FATE_FILTER_VSYNTH-$(CONFIG_FORMAT_FILTER) += fate-filter-pixdesc
-fate-filter-pixdesc: CMD = pixdesc
-
-
-FATE_FILTER_PIXFMTS += fate-filter-pixfmts-copy
-fate-filter-pixfmts-copy:  CMD = pixfmts
-
-FATE_FILTER_PIXFMTS += fate-filter-pixfmts-crop
-fate-filter-pixfmts-crop:  CMD = pixfmts "100:100:100:100"
-
-FATE_FILTER_PIXFMTS += fate-filter-pixfmts-hflip
-fate-filter-pixfmts-hflip: CMD = pixfmts
-
-FATE_FILTER_PIXFMTS += fate-filter-pixfmts-null
-fate-filter-pixfmts-null:  CMD = pixfmts
-
-FATE_FILTER_PIXFMTS += fate-filter-pixfmts-pad
-fate-filter-pixfmts-pad:   CMD = pixfmts "500:400:20:20"
-
-FATE_FILTER_PIXFMTS += fate-filter-pixfmts-scale
-fate-filter-pixfmts-scale: CMD = pixfmts "200:100"
-
-FATE_FILTER_PIXFMTS += fate-filter-pixfmts-vflip
-fate-filter-pixfmts-vflip: CMD = pixfmts
-
-$(FATE_FILTER_PIXFMTS): libavfilter/filtfmts-test$(EXESUF)
-FATE_FILTER_VSYNTH-$(CONFIG_FORMAT_FILTER) += $(FATE_FILTER_PIXFMTS)
-
-
-$(FATE_FILTER_VSYNTH-yes): $(VREF)
-$(FATE_FILTER_VSYNTH-yes): SRC = $(TARGET_PATH)/tests/vsynth1/%02d.pgm
-
-FATE_AVCONV-$(call DEMDEC, IMAGE2, PGMYUV) += $(FATE_FILTER_VSYNTH-yes)
-
-fate-vfilter: $(FATE_FILTER-yes) $(FATE_FILTER_VSYNTH-yes)
-
-fate-filter: fate-afilter fate-vfilter
diff --git a/deps/libav/tests/fate/flac.mak b/deps/libav/tests/fate/flac.mak
deleted file mode 100644
index e28f45f..0000000
--- a/deps/libav/tests/fate/flac.mak
+++ /dev/null
@@ -1,26 +0,0 @@
-FATE_FLAC += fate-flac-16-chmode-indep                                  \
-             fate-flac-16-chmode-left_side                              \
-             fate-flac-16-chmode-mid_side                               \
-             fate-flac-16-chmode-right_side                             \
-             fate-flac-16-fixed                                         \
-             fate-flac-16-lpc-cholesky                                  \
-             fate-flac-16-lpc-levinson                                  \
-             fate-flac-24-comp-8                                        \
-
-fate-flac-16-chmode-%: OPTS = -ch_mode $(@:fate-flac-16-chmode-%=%)
-fate-flac-16-fixed:    OPTS = -lpc_type fixed
-fate-flac-16-lpc-%:    OPTS = -lpc_type $(@:fate-flac-16-lpc-%=%)
-
-fate-flac-16-%: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
-fate-flac-16-%: CMD = enc_dec_pcm flac wav s16le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c flac $(OPTS)
-
-fate-flac-24-comp-%: OPTS = -compression_level $(@:fate-flac-24-comp-%=%)
-
-fate-flac-24-%: REF = $(SAMPLES)/audio-reference/divertimenti_2ch_96kHz_s24.wav
-fate-flac-24-%: CMD = enc_dec_pcm flac wav s24le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c flac $(OPTS)
-
-fate-flac-%: CMP = oneoff
-fate-flac-%: FUZZ = 0
-
-FATE_SAMPLES_AVCONV += $(FATE_FLAC)
-fate-flac: $(FATE_FLAC)
diff --git a/deps/libav/tests/fate/h264.mak b/deps/libav/tests/fate/h264.mak
deleted file mode 100644
index 13bbd11..0000000
--- a/deps/libav/tests/fate/h264.mak
+++ /dev/null
@@ -1,373 +0,0 @@
-FATE_H264 = aud_mw_e                                                    \
-            ba1_ft_c                                                    \
-            ba1_sony_d                                                  \
-            ba2_sony_f                                                  \
-            ba3_sva_c                                                   \
-            ba_mw_d                                                     \
-            bamq1_jvc_c                                                 \
-            bamq2_jvc_c                                                 \
-            banm_mw_d                                                   \
-            basqp1_sony_c                                               \
-            caba1_sony_d                                                \
-            caba1_sva_b                                                 \
-            caba2_sony_e                                                \
-            caba2_sva_b                                                 \
-            caba3_sony_c                                                \
-            caba3_sva_b                                                 \
-            caba3_toshiba_e                                             \
-            cabac_mot_fld0_full                                         \
-            cabac_mot_frm0_full                                         \
-            cabac_mot_mbaff0_full                                       \
-            cabac_mot_picaff0_full                                      \
-            cabaci3_sony_b                                              \
-            cabast3_sony_e                                              \
-            cabastbr3_sony_b                                            \
-            cabref3_sand_d                                              \
-            cacqp3_sony_d                                               \
-            cafi1_sva_c                                                 \
-            cama1_sony_c                                                \
-            cama1_toshiba_b                                             \
-            cama1_vtc_c                                                 \
-            cama2_vtc_b                                                 \
-            cama3_sand_e                                                \
-            cama3_vtc_b                                                 \
-            camaci3_sony_c                                              \
-            camanl1_toshiba_b                                           \
-            camanl2_toshiba_b                                           \
-            camanl3_sand_e                                              \
-            camasl3_sony_b                                              \
-            camp_mot_mbaff_l30                                          \
-            camp_mot_mbaff_l31                                          \
-            canl1_sony_e                                                \
-            canl1_sva_b                                                 \
-            canl1_toshiba_g                                             \
-            canl2_sony_e                                                \
-            canl2_sva_b                                                 \
-            canl3_sony_c                                                \
-            canl3_sva_b                                                 \
-            canl4_sva_b                                                 \
-            canlma2_sony_c                                              \
-            canlma3_sony_c                                              \
-            capa1_toshiba_b                                             \
-            capama3_sand_f                                              \
-            capcm1_sand_e                                               \
-            capcmnl1_sand_e                                             \
-            capm3_sony_d                                                \
-            caqp1_sony_b                                                \
-            cavlc_mot_fld0_full_b                                       \
-            cavlc_mot_frm0_full_b                                       \
-            cavlc_mot_mbaff0_full_b                                     \
-            cavlc_mot_picaff0_full_b                                    \
-            cawp1_toshiba_e                                             \
-            cawp5_toshiba_e                                             \
-            ci1_ft_b                                                    \
-            ci_mw_d                                                     \
-            cvbs3_sony_c                                                \
-            cvcanlma2_sony_c                                            \
-            cvfc1_sony_c                                                \
-            cvfi1_sony_d                                                \
-            cvfi1_sva_c                                                 \
-            cvfi2_sony_h                                                \
-            cvfi2_sva_c                                                 \
-            cvma1_sony_d                                                \
-            cvma1_toshiba_b                                             \
-            cvmanl1_toshiba_b                                           \
-            cvmanl2_toshiba_b                                           \
-            cvmapaqp3_sony_e                                            \
-            cvmaqp2_sony_g                                              \
-            cvmaqp3_sony_d                                              \
-            cvmp_mot_fld_l30_b                                          \
-            cvmp_mot_frm_l31_b                                          \
-            cvnlfi1_sony_c                                              \
-            cvnlfi2_sony_h                                              \
-            cvpa1_toshiba_b                                             \
-            cvpcmnl1_sva_c                                              \
-            cvpcmnl2_sva_c                                              \
-            cvwp1_toshiba_e                                             \
-            cvwp2_toshiba_e                                             \
-            cvwp3_toshiba_e                                             \
-            cvwp5_toshiba_e                                             \
-            fi1_sony_e                                                  \
-            frext-alphaconformanceg                                     \
-            frext-bcrm_freh10                                           \
-            frext-brcm_freh11                                           \
-            frext-brcm_freh3                                            \
-            frext-brcm_freh4                                            \
-            frext-brcm_freh5                                            \
-            frext-brcm_freh8                                            \
-            frext-brcm_freh9                                            \
-            frext-freh12_b                                              \
-            frext-freh1_b                                               \
-            frext-freh2_b                                               \
-            frext-freh6                                                 \
-            frext-freh7_b                                               \
-            frext-frext01_jvc_d                                         \
-            frext-frext02_jvc_c                                         \
-            frext-frext1_panasonic_c                                    \
-            frext-frext2_panasonic_b                                    \
-            frext-frext3_panasonic_d                                    \
-            frext-frext4_panasonic_a                                    \
-            frext-frext_mmco4_sony_b                                    \
-            frext-hcaff1_hhi_b                                          \
-            frext-hcafr1_hhi_c                                          \
-            frext-hcafr2_hhi_a                                          \
-            frext-hcafr3_hhi_a                                          \
-            frext-hcafr4_hhi_a                                          \
-            frext-hcamff1_hhi_b                                         \
-            frext-hpca_brcm_c                                           \
-            frext-hpcadq_brcm_b                                         \
-            frext-hpcafl_bcrm_c                                         \
-            frext-hpcaflnl_bcrm_c                                       \
-            frext-hpcalq_brcm_b                                         \
-            frext-hpcamapalq_bcrm_b                                     \
-            frext-hpcamolq_brcm_b                                       \
-            frext-hpcanl_brcm_c                                         \
-            frext-hpcaq2lq_brcm_b                                       \
-            frext-hpcv_brcm_a                                           \
-            frext-hpcvfl_bcrm_a                                         \
-            frext-hpcvflnl_bcrm_a                                       \
-            frext-hpcvmolq_brcm_b                                       \
-            frext-hpcvnl_brcm_a                                         \
-            frext-pph10i1_panasonic_a                                   \
-            frext-pph10i2_panasonic_a                                   \
-            frext-pph10i3_panasonic_a                                   \
-            frext-pph10i4_panasonic_a                                   \
-            frext-pph10i5_panasonic_a                                   \
-            frext-pph10i6_panasonic_a                                   \
-            frext-pph10i7_panasonic_a                                   \
-            hcbp2_hhi_a                                                 \
-            hcmp1_hhi_a                                                 \
-            ls_sva_d                                                    \
-            midr_mw_d                                                   \
-            mps_mw_a                                                    \
-            mr1_bt_a                                                    \
-            mr1_mw_a                                                    \
-            mr2_mw_a                                                    \
-            mr2_tandberg_e                                              \
-            mr3_tandberg_b                                              \
-            mr4_tandberg_c                                              \
-            mr5_tandberg_c                                              \
-            mr6_bt_b                                                    \
-            mr7_bt_b                                                    \
-            mr8_bt_b                                                    \
-            mr9_bt_b                                                    \
-            mv1_brcm_d                                                  \
-            nl1_sony_d                                                  \
-            nl2_sony_h                                                  \
-            nl3_sva_e                                                   \
-            nlmq1_jvc_c                                                 \
-            nlmq2_jvc_c                                                 \
-            nrf_mw_e                                                    \
-            sharp_mp_field_1_b                                          \
-            sharp_mp_field_2_b                                          \
-            sharp_mp_field_3_b                                          \
-            sharp_mp_paff_1r2                                           \
-            sharp_mp_paff_2r                                            \
-            sl1_sva_b                                                   \
-            sva_ba1_b                                                   \
-            sva_ba2_d                                                   \
-            sva_base_b                                                  \
-            sva_cl1_e                                                   \
-            sva_fm1_e                                                   \
-            sva_nl1_b                                                   \
-            sva_nl2_e                                                   \
-
-FATE_H264_REINIT_TESTS := large_420_8-to-small_420_8                    \
-                          small_420_8-to-large_444_10                   \
-                          small_420_9-to-small_420_8                    \
-                          small_422_9-to-small_420_9                    \
-
-FATE_H264  := $(FATE_H264:%=fate-h264-conformance-%)                    \
-              $(FATE_H264_REINIT_TESTS:%=fate-h264-reinit-%)            \
-              fate-h264-extreme-plane-pred                              \
-              fate-h264-lossless                                        \
-
-FATE_H264-$(call DEMDEC, H264, H264) += $(FATE_H264)
-FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-crop-to-container
-FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-interlace-crop
-FATE_H264-$(call ALLYES, MOV_DEMUXER H264_MP4TOANNEXB_BSF) += fate-h264-bsf-mp4toannexb
-
-FATE_SAMPLES_AVCONV += $(FATE_H264-yes)
-fate-h264: $(FATE_H264-yes)
-
-fate-h264-conformance-aud_mw_e:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/AUD_MW_E.264
-fate-h264-conformance-ba1_ft_c:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/BA1_FT_C.264
-fate-h264-conformance-ba1_sony_d:                 CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/BA1_Sony_D.jsv
-fate-h264-conformance-ba2_sony_f:                 CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/BA2_Sony_F.jsv
-fate-h264-conformance-ba3_sva_c:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/BA3_SVA_C.264
-fate-h264-conformance-ba_mw_d:                    CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/BA_MW_D.264
-fate-h264-conformance-bamq1_jvc_c:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/BAMQ1_JVC_C.264
-fate-h264-conformance-bamq2_jvc_c:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/BAMQ2_JVC_C.264
-fate-h264-conformance-banm_mw_d:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/BANM_MW_D.264
-fate-h264-conformance-basqp1_sony_c:              CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/BASQP1_Sony_C.jsv
-fate-h264-conformance-caba1_sony_d:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABA1_Sony_D.jsv
-fate-h264-conformance-caba1_sva_b:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABA1_SVA_B.264
-fate-h264-conformance-caba2_sony_e:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABA2_Sony_E.jsv
-fate-h264-conformance-caba2_sva_b:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABA2_SVA_B.264
-fate-h264-conformance-caba3_sony_c:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABA3_Sony_C.jsv
-fate-h264-conformance-caba3_sva_b:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABA3_SVA_B.264
-fate-h264-conformance-caba3_toshiba_e:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABA3_TOSHIBA_E.264
-fate-h264-conformance-cabac_mot_fld0_full:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/camp_mot_fld0_full.26l
-fate-h264-conformance-cabac_mot_frm0_full:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/camp_mot_frm0_full.26l
-fate-h264-conformance-cabac_mot_mbaff0_full:      CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/camp_mot_mbaff0_full.26l
-fate-h264-conformance-cabac_mot_picaff0_full:     CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/camp_mot_picaff0_full.26l
-fate-h264-conformance-cabaci3_sony_b:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABACI3_Sony_B.jsv
-fate-h264-conformance-cabast3_sony_e:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABAST3_Sony_E.jsv
-fate-h264-conformance-cabastbr3_sony_b:           CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABASTBR3_Sony_B.jsv
-fate-h264-conformance-cabref3_sand_d:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CABREF3_Sand_D.264
-fate-h264-conformance-cacqp3_sony_d:              CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CACQP3_Sony_D.jsv
-fate-h264-conformance-cafi1_sva_c:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAFI1_SVA_C.264
-fate-h264-conformance-cama1_sony_c:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMA1_Sony_C.jsv
-fate-h264-conformance-cama1_toshiba_b:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMA1_TOSHIBA_B.264
-fate-h264-conformance-cama1_vtc_c:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/cama1_vtc_c.avc
-fate-h264-conformance-cama2_vtc_b:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/cama2_vtc_b.avc
-fate-h264-conformance-cama3_sand_e:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMA3_Sand_E.264
-fate-h264-conformance-cama3_vtc_b:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/cama3_vtc_b.avc
-fate-h264-conformance-camaci3_sony_c:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMACI3_Sony_C.jsv
-fate-h264-conformance-camanl1_toshiba_b:          CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMANL1_TOSHIBA_B.264
-fate-h264-conformance-camanl2_toshiba_b:          CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMANL2_TOSHIBA_B.264
-fate-h264-conformance-camanl3_sand_e:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMANL3_Sand_E.264
-fate-h264-conformance-camasl3_sony_b:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMASL3_Sony_B.jsv
-fate-h264-conformance-camp_mot_mbaff_l30:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMP_MOT_MBAFF_L30.26l
-fate-h264-conformance-camp_mot_mbaff_l31:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAMP_MOT_MBAFF_L31.26l
-fate-h264-conformance-canl1_sony_e:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANL1_Sony_E.jsv
-fate-h264-conformance-canl1_sva_b:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANL1_SVA_B.264
-fate-h264-conformance-canl1_toshiba_g:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANL1_TOSHIBA_G.264
-fate-h264-conformance-canl2_sony_e:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANL2_Sony_E.jsv
-fate-h264-conformance-canl2_sva_b:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANL2_SVA_B.264
-fate-h264-conformance-canl3_sony_c:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANL3_Sony_C.jsv
-fate-h264-conformance-canl3_sva_b:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANL3_SVA_B.264
-fate-h264-conformance-canl4_sva_b:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANL4_SVA_B.264
-fate-h264-conformance-canlma2_sony_c:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANLMA2_Sony_C.jsv
-fate-h264-conformance-canlma3_sony_c:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CANLMA3_Sony_C.jsv
-fate-h264-conformance-capa1_toshiba_b:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAPA1_TOSHIBA_B.264
-fate-h264-conformance-capama3_sand_f:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAPAMA3_Sand_F.264
-fate-h264-conformance-capcm1_sand_e:              CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAPCM1_Sand_E.264
-fate-h264-conformance-capcmnl1_sand_e:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAPCMNL1_Sand_E.264
-fate-h264-conformance-capm3_sony_d:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAPM3_Sony_D.jsv
-fate-h264-conformance-caqp1_sony_b:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAQP1_Sony_B.jsv
-fate-h264-conformance-cavlc_mot_fld0_full_b:      CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/cvmp_mot_fld0_full_B.26l
-fate-h264-conformance-cavlc_mot_frm0_full_b:      CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/cvmp_mot_frm0_full_B.26l
-fate-h264-conformance-cavlc_mot_mbaff0_full_b:    CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/cvmp_mot_mbaff0_full_B.26l
-fate-h264-conformance-cavlc_mot_picaff0_full_b:   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/cvmp_mot_picaff0_full_B.26l
-fate-h264-conformance-cawp1_toshiba_e:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAWP1_TOSHIBA_E.264
-fate-h264-conformance-cawp5_toshiba_e:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CAWP5_TOSHIBA_E.264
-fate-h264-conformance-ci1_ft_b:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CI1_FT_B.264
-fate-h264-conformance-ci_mw_d:                    CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CI_MW_D.264
-fate-h264-conformance-cvbs3_sony_c:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVBS3_Sony_C.jsv
-fate-h264-conformance-cvcanlma2_sony_c:           CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVCANLMA2_Sony_C.jsv
-fate-h264-conformance-cvfc1_sony_c:               CMD = framecrc -flags unaligned -i $(TARGET_SAMPLES)/h264-conformance/CVFC1_Sony_C.jsv
-fate-h264-conformance-cvfi1_sony_d:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVFI1_Sony_D.jsv
-fate-h264-conformance-cvfi1_sva_c:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVFI1_SVA_C.264
-fate-h264-conformance-cvfi2_sony_h:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVFI2_Sony_H.jsv
-fate-h264-conformance-cvfi2_sva_c:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVFI2_SVA_C.264
-fate-h264-conformance-cvma1_sony_d:               CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVMA1_Sony_D.jsv
-fate-h264-conformance-cvma1_toshiba_b:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVMA1_TOSHIBA_B.264
-fate-h264-conformance-cvmanl1_toshiba_b:          CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVMANL1_TOSHIBA_B.264
-fate-h264-conformance-cvmanl2_toshiba_b:          CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVMANL2_TOSHIBA_B.264
-fate-h264-conformance-cvmapaqp3_sony_e:           CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVMAPAQP3_Sony_E.jsv
-fate-h264-conformance-cvmaqp2_sony_g:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVMAQP2_Sony_G.jsv
-fate-h264-conformance-cvmaqp3_sony_d:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVMAQP3_Sony_D.jsv
-fate-h264-conformance-cvmp_mot_fld_l30_b:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVMP_MOT_FLD_L30_B.26l
-fate-h264-conformance-cvmp_mot_frm_l31_b:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVMP_MOT_FRM_L31_B.26l
-fate-h264-conformance-cvnlfi1_sony_c:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVNLFI1_Sony_C.jsv
-fate-h264-conformance-cvnlfi2_sony_h:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVNLFI2_Sony_H.jsv
-fate-h264-conformance-cvpa1_toshiba_b:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVPA1_TOSHIBA_B.264
-fate-h264-conformance-cvpcmnl1_sva_c:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVPCMNL1_SVA_C.264
-fate-h264-conformance-cvpcmnl2_sva_c:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVPCMNL2_SVA_C.264
-fate-h264-conformance-cvwp1_toshiba_e:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVWP1_TOSHIBA_E.264
-fate-h264-conformance-cvwp2_toshiba_e:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVWP2_TOSHIBA_E.264
-fate-h264-conformance-cvwp3_toshiba_e:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVWP3_TOSHIBA_E.264
-fate-h264-conformance-cvwp5_toshiba_e:            CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/CVWP5_TOSHIBA_E.264
-fate-h264-conformance-fi1_sony_e:                 CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FI1_Sony_E.jsv
-fate-h264-conformance-frext-alphaconformanceg:    CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/test8b43.264
-fate-h264-conformance-frext-bcrm_freh10:          CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/freh10.264 -vsync 0
-fate-h264-conformance-frext-brcm_freh11:          CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/freh11.264 -vsync 0
-fate-h264-conformance-frext-brcm_freh3:           CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/freh3.264
-fate-h264-conformance-frext-brcm_freh4:           CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/freh4.264 -vsync 0
-fate-h264-conformance-frext-brcm_freh5:           CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/freh5.264
-fate-h264-conformance-frext-brcm_freh8:           CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/freh8.264
-fate-h264-conformance-frext-brcm_freh9:           CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/freh9.264
-fate-h264-conformance-frext-freh12_b:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/Freh12_B.264
-fate-h264-conformance-frext-freh1_b:              CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/Freh1_B.264
-fate-h264-conformance-frext-freh2_b:              CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/Freh2_B.264
-fate-h264-conformance-frext-freh6:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/freh6.264 -vsync 0
-fate-h264-conformance-frext-freh7_b:              CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/Freh7_B.264 -vsync 0
-fate-h264-conformance-frext-frext01_jvc_d:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/FREXT01_JVC_D.264
-fate-h264-conformance-frext-frext02_jvc_c:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/FREXT02_JVC_C.264
-fate-h264-conformance-frext-frext1_panasonic_c:   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/FRExt1_Panasonic.avc
-fate-h264-conformance-frext-frext2_panasonic_b:   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/FRExt2_Panasonic.avc -vsync 0
-fate-h264-conformance-frext-frext3_panasonic_d:   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/FRExt3_Panasonic.avc
-fate-h264-conformance-frext-frext4_panasonic_a:   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/FRExt4_Panasonic.avc
-fate-h264-conformance-frext-frext_mmco4_sony_b:   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/FRExt_MMCO4_Sony_B.264
-fate-h264-conformance-frext-hcaff1_hhi_b:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HCAFF1_HHI.264
-fate-h264-conformance-frext-hcafr1_hhi_c:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HCAFR1_HHI.264
-fate-h264-conformance-frext-hcafr2_hhi_a:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HCAFR2_HHI.264
-fate-h264-conformance-frext-hcafr3_hhi_a:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HCAFR3_HHI.264
-fate-h264-conformance-frext-hcafr4_hhi_a:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HCAFR4_HHI.264
-fate-h264-conformance-frext-hcamff1_hhi_b:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HCAMFF1_HHI.264
-fate-h264-conformance-frext-hpca_brcm_c:          CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCA_BRCM_C.264
-fate-h264-conformance-frext-hpcadq_brcm_b:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCADQ_BRCM_B.264
-fate-h264-conformance-frext-hpcafl_bcrm_c:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCAFL_BRCM_C.264 -vsync 0
-fate-h264-conformance-frext-hpcaflnl_bcrm_c:      CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCAFLNL_BRCM_C.264 -vsync 0
-fate-h264-conformance-frext-hpcalq_brcm_b:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCALQ_BRCM_B.264
-fate-h264-conformance-frext-hpcamapalq_bcrm_b:    CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCAMAPALQ_BRCM_B.264 -vsync 0
-fate-h264-conformance-frext-hpcamolq_brcm_b:      CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCAMOLQ_BRCM_B.264
-fate-h264-conformance-frext-hpcanl_brcm_c:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCANL_BRCM_C.264
-fate-h264-conformance-frext-hpcaq2lq_brcm_b:      CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCAQ2LQ_BRCM_B.264
-fate-h264-conformance-frext-hpcv_brcm_a:          CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCV_BRCM_A.264
-fate-h264-conformance-frext-hpcvfl_bcrm_a:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCVFL_BRCM_A.264 -vsync 0
-fate-h264-conformance-frext-hpcvflnl_bcrm_a:      CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCVFLNL_BRCM_A.264 -vsync 0
-fate-h264-conformance-frext-hpcvmolq_brcm_b:      CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCVMOLQ_BRCM_B.264
-fate-h264-conformance-frext-hpcvnl_brcm_a:        CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/HPCVNL_BRCM_A.264
-fate-h264-conformance-frext-pph10i1_panasonic_a:  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/PPH10I1_Panasonic_A.264 -pix_fmt yuv420p10le
-fate-h264-conformance-frext-pph10i2_panasonic_a:  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/PPH10I2_Panasonic_A.264 -pix_fmt yuv420p10le
-fate-h264-conformance-frext-pph10i3_panasonic_a:  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/PPH10I3_Panasonic_A.264 -pix_fmt yuv420p10le
-fate-h264-conformance-frext-pph10i4_panasonic_a:  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/PPH10I4_Panasonic_A.264 -pix_fmt yuv420p10le
-fate-h264-conformance-frext-pph10i5_panasonic_a:  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/PPH10I5_Panasonic_A.264 -pix_fmt yuv420p10le
-fate-h264-conformance-frext-pph10i6_panasonic_a:  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/PPH10I6_Panasonic_A.264 -pix_fmt yuv420p10le
-fate-h264-conformance-frext-pph10i7_panasonic_a:  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/FRext/PPH10I7_Panasonic_A.264 -pix_fmt yuv420p10le
-fate-h264-conformance-hcbp2_hhi_a:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/HCBP2_HHI_A.264
-fate-h264-conformance-hcmp1_hhi_a:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/HCMP1_HHI_A.264
-fate-h264-conformance-ls_sva_d:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/LS_SVA_D.264
-fate-h264-conformance-midr_mw_d:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MIDR_MW_D.264
-fate-h264-conformance-mps_mw_a:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MPS_MW_A.264
-fate-h264-conformance-mr1_bt_a:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MR1_BT_A.h264
-fate-h264-conformance-mr1_mw_a:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MR1_MW_A.264
-fate-h264-conformance-mr2_mw_a:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MR2_MW_A.264
-fate-h264-conformance-mr2_tandberg_e:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MR2_TANDBERG_E.264
-fate-h264-conformance-mr3_tandberg_b:             CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MR3_TANDBERG_B.264
-fate-h264-conformance-mr4_tandberg_c:             CMD = framecrc -strict 1 -i $(TARGET_SAMPLES)/h264-conformance/MR4_TANDBERG_C.264
-fate-h264-conformance-mr5_tandberg_c:             CMD = framecrc -strict 1 -i $(TARGET_SAMPLES)/h264-conformance/MR5_TANDBERG_C.264
-fate-h264-conformance-mr6_bt_b:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MR6_BT_B.h264
-fate-h264-conformance-mr7_bt_b:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MR7_BT_B.h264
-fate-h264-conformance-mr8_bt_b:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MR8_BT_B.h264
-fate-h264-conformance-mr9_bt_b:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/MR9_BT_B.h264
-fate-h264-conformance-mv1_brcm_d:                 CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/src19td.IBP.264
-fate-h264-conformance-nl1_sony_d:                 CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/NL1_Sony_D.jsv
-fate-h264-conformance-nl2_sony_h:                 CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/NL2_Sony_H.jsv
-fate-h264-conformance-nl3_sva_e:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/NL3_SVA_E.264
-fate-h264-conformance-nlmq1_jvc_c:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/NLMQ1_JVC_C.264
-fate-h264-conformance-nlmq2_jvc_c:                CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/NLMQ2_JVC_C.264
-fate-h264-conformance-nrf_mw_e:                   CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/NRF_MW_E.264
-fate-h264-conformance-sharp_mp_field_1_b:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/Sharp_MP_Field_1_B.jvt
-fate-h264-conformance-sharp_mp_field_2_b:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/Sharp_MP_Field_2_B.jvt
-fate-h264-conformance-sharp_mp_field_3_b:         CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/Sharp_MP_Field_3_B.jvt
-fate-h264-conformance-sharp_mp_paff_1r2:          CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/Sharp_MP_PAFF_1r2.jvt
-fate-h264-conformance-sharp_mp_paff_2r:           CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/Sharp_MP_PAFF_2.jvt
-fate-h264-conformance-sl1_sva_b:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SL1_SVA_B.264
-fate-h264-conformance-sva_ba1_b:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_BA1_B.264
-fate-h264-conformance-sva_ba2_d:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_BA2_D.264
-fate-h264-conformance-sva_base_b:                 CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_Base_B.264
-fate-h264-conformance-sva_cl1_e:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_CL1_E.264
-fate-h264-conformance-sva_fm1_e:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_FM1_E.264
-fate-h264-conformance-sva_nl1_b:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_NL1_B.264
-fate-h264-conformance-sva_nl2_e:                  CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_NL2_E.264
-
-fate-h264-bsf-mp4toannexb:                        CMD = md5 -i $(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vcodec copy -bsf h264_mp4toannexb -f h264
-fate-h264-crop-to-container:                      CMD = framemd5 -i $(TARGET_SAMPLES)/h264/crop-to-container-dims-canon.mov
-fate-h264-extreme-plane-pred:                     CMD = framemd5 -i $(TARGET_SAMPLES)/h264/extreme-plane-pred.h264
-fate-h264-interlace-crop:                         CMD = framecrc -i $(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vframes 3
-fate-h264-lossless:                               CMD = framecrc -i $(TARGET_SAMPLES)/h264/lossless.h264
-
-fate-h264-reinit-%:                               CMD = framecrc -i $(TARGET_SAMPLES)/h264/$(@:fate-h264-%=%).h264 -vf format=yuv444p10le,scale=w=352:h=288
diff --git a/deps/libav/tests/fate/hevc.mak b/deps/libav/tests/fate/hevc.mak
deleted file mode 100644
index 9afe717..0000000
--- a/deps/libav/tests/fate/hevc.mak
+++ /dev/null
@@ -1,162 +0,0 @@
-HEVC_SAMPLES =                  \
-    AMP_A_Samsung_4             \
-    AMP_B_Samsung_4             \
-    AMVP_C_Samsung_4            \
-    AMP_D_Hisilicon             \
-    AMP_E_Hisilicon             \
-    AMP_F_Hisilicon_3           \
-    AMVP_A_MTK_4                \
-    AMVP_B_MTK_4                \
-    CAINIT_A_SHARP_4            \
-    CAINIT_B_SHARP_4            \
-    CAINIT_C_SHARP_3            \
-    CAINIT_D_SHARP_3            \
-    CAINIT_E_SHARP_3            \
-    CAINIT_F_SHARP_3            \
-    CAINIT_G_SHARP_3            \
-    CAINIT_H_SHARP_3            \
-    CIP_A_Panasonic_3           \
-    cip_B_NEC_3                 \
-    CIP_C_Panasonic_2           \
-    DBLK_A_SONY_3               \
-    DBLK_B_SONY_3               \
-    DBLK_C_SONY_3               \
-    DBLK_D_VIXS_1               \
-    DBLK_D_VIXS_2               \
-    DBLK_E_VIXS_1               \
-    DBLK_E_VIXS_2               \
-    DBLK_F_VIXS_1               \
-    DBLK_F_VIXS_2               \
-    DBLK_G_VIXS_1               \
-    DBLK_G_VIXS_2               \
-    DELTAQP_B_SONY_3            \
-    DELTAQP_C_SONY_3            \
-    DSLICE_A_HHI_5              \
-    DSLICE_B_HHI_5              \
-    DSLICE_C_HHI_5              \
-    ENTP_A_LG_2                 \
-    ENTP_B_LG_2                 \
-    ENTP_C_LG_3                 \
-    EXT_A_ericsson_4            \
-    ipcm_A_NEC_3                \
-    ipcm_B_NEC_3                \
-    ipcm_C_NEC_3                \
-    ipcm_D_NEC_3                \
-    ipcm_E_NEC_2                \
-    IPRED_A_docomo_2            \
-    IPRED_B_Nokia_3             \
-    IPRED_C_Mitsubishi_2        \
-    LS_A_Orange_2               \
-    LS_B_ORANGE_4               \
-    LTRPSPS_A_Qualcomm_1        \
-    MAXBINS_A_TI_4              \
-    MAXBINS_B_TI_4              \
-    MAXBINS_C_TI_4              \
-    MERGE_A_TI_3                \
-    MERGE_B_TI_3                \
-    MERGE_C_TI_3                \
-    MERGE_D_TI_3                \
-    MERGE_E_TI_3                \
-    MERGE_F_MTK_4               \
-    MERGE_G_HHI_4               \
-    MVCLIP_A_qualcomm_3         \
-    MVDL1ZERO_A_docomo_3        \
-    MVEDGE_A_qualcomm_3         \
-    NUT_A_ericsson_5            \
-    PICSIZE_A_Bossen_1          \
-    PICSIZE_B_Bossen_1          \
-    PICSIZE_C_Bossen_1          \
-    PICSIZE_D_Bossen_1          \
-    PMERGE_A_TI_3               \
-    PMERGE_B_TI_3               \
-    PMERGE_C_TI_3               \
-    PMERGE_D_TI_3               \
-    PMERGE_E_TI_3               \
-    POC_A_Bossen_3              \
-    PPS_A_qualcomm_7            \
-    RAP_A_docomo_4              \
-    PS_A_VIDYO_3                \
-    PS_B_VIDYO_3                \
-    RAP_B_Bossen_1              \
-    RPLM_A_qualcomm_4           \
-    RPLM_B_qualcomm_4           \
-    RPS_A_docomo_4              \
-    RPS_B_qualcomm_5            \
-    RPS_C_ericsson_5            \
-    RPS_D_ericsson_6            \
-    RPS_E_qualcomm_5            \
-    RPS_F_docomo_1              \
-    RQT_A_HHI_4                 \
-    RQT_B_HHI_4                 \
-    RQT_C_HHI_4                 \
-    RQT_D_HHI_4                 \
-    RQT_E_HHI_4                 \
-    RQT_F_HHI_4                 \
-    RQT_G_HHI_4                 \
-    SAO_A_MediaTek_4            \
-    SAO_B_MediaTek_5            \
-    SAO_C_Samsung_4             \
-    SAO_D_Samsung_4             \
-    SAO_E_Canon_4               \
-    SAO_F_Canon_3               \
-    SAO_G_Canon_3               \
-    SDH_A_Orange_3              \
-    SLICES_A_Rovi_3             \
-    SLIST_A_Sony_4              \
-    SLIST_B_Sony_8              \
-    SLIST_C_Sony_3              \
-    SLIST_D_Sony_9              \
-    SLPPLP_A_VIDYO_1            \
-    STRUCT_A_Samsung_5          \
-    STRUCT_B_Samsung_4          \
-    TILES_A_Cisco_2             \
-    TILES_B_Cisco_1             \
-    TMVP_A_MS_3                 \
-    TSCL_A_VIDYO_5              \
-    TSCL_B_VIDYO_4              \
-    TSKIP_A_MS_3                \
-    TUSIZE_A_Samsung_1          \
-    VPSID_A_VIDYO_1             \
-    WP_A_Toshiba_3              \
-    WP_B_Toshiba_3              \
-    WPP_A_ericsson_MAIN_2       \
-    WPP_B_ericsson_MAIN_2       \
-    WPP_C_ericsson_MAIN_2       \
-    WPP_D_ericsson_MAIN_2       \
-    WPP_E_ericsson_MAIN_2       \
-    WPP_F_ericsson_MAIN_2       \
-
-HEVC_SAMPLES_10BIT =            \
-    DBLK_A_MAIN10_VIXS_2        \
-    WP_A_MAIN10_Toshiba_3       \
-    WP_MAIN10_B_Toshiba_3       \
-    WPP_A_ericsson_MAIN10_2     \
-    WPP_B_ericsson_MAIN10_2     \
-    WPP_C_ericsson_MAIN10_2     \
-    WPP_D_ericsson_MAIN10_2     \
-    WPP_E_ericsson_MAIN10_2     \
-    WPP_F_ericsson_MAIN10_2     \
-
-# do not pass:
-# DELTAQP_A_BRCM_4.bit -- TODO uses CRC instead of MD5
-# HRD_A_Fujitsu_2.bin -- TODO uses hash 2 ("checksum")
-# TSUNEQBD_A_MAIN10_Technicolor_2.bit (segfault)
-
-define FATE_HEVC_TEST
-FATE_HEVC += fate-hevc-conformance-$(1)
-fate-hevc-conformance-$(1): CMD = framecrc -vsync 0 -i $(TARGET_SAMPLES)/hevc-conformance/$(1).bit
-endef
-
-define FATE_HEVC_TEST_10BIT
-FATE_HEVC += fate-hevc-conformance-$(1)
-fate-hevc-conformance-$(1): CMD = framecrc -vsync 0 -i $(TARGET_SAMPLES)/hevc-conformance/$(1).bit -pix_fmt yuv420p10le
-endef
-
-$(foreach N,$(HEVC_SAMPLES),$(eval $(call FATE_HEVC_TEST,$(N))))
-$(foreach N,$(HEVC_SAMPLES_10BIT),$(eval $(call FATE_HEVC_TEST_10BIT,$(N))))
-
-FATE_HEVC-$(call DEMDEC, HEVC, HEVC) += $(FATE_HEVC)
-
-FATE_SAMPLES_AVCONV += $(FATE_HEVC-yes)
-
-fate-hevc: $(FATE_HEVC-yes)
diff --git a/deps/libav/tests/fate/image.mak b/deps/libav/tests/fate/image.mak
deleted file mode 100644
index 1357cbd..0000000
--- a/deps/libav/tests/fate/image.mak
+++ /dev/null
@@ -1,80 +0,0 @@
-FATE_SAMPLES_AVCONV-$(call DEMDEC, IMAGE2, DPX) += fate-dpx
-fate-dpx: CMD = framecrc -i $(TARGET_SAMPLES)/dpx/lighthouse_rgb48.dpx
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, IMAGE2, PICTOR) += fate-pictor
-fate-pictor: CMD = framecrc -i $(TARGET_SAMPLES)/pictor/MFISH.PIC -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call PARSERDEMDEC, PNG, IMAGE2PIPE, PNG) += fate-pngparser
-fate-pngparser: CMD = framecrc -f image2pipe -i $(TARGET_SAMPLES)/png1/libav_4x_concat.png -pix_fmt rgba
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, IMAGE2, PTX) += fate-ptx
-fate-ptx: CMD = framecrc -i $(TARGET_SAMPLES)/ptx/_113kw_pic.ptx -pix_fmt rgb24
-
-FATE_SUNRASTER += fate-sunraster-1bit-raw
-fate-sunraster-1bit-raw: CMD = framecrc -i $(TARGET_SAMPLES)/sunraster/lena-1bit-raw.sun
-
-FATE_SUNRASTER += fate-sunraster-1bit-rle
-fate-sunraster-1bit-rle: CMD = framecrc -i $(TARGET_SAMPLES)/sunraster/lena-1bit-rle.sun
-
-FATE_SUNRASTER += fate-sunraster-8bit-raw
-fate-sunraster-8bit-raw: CMD = framecrc -i $(TARGET_SAMPLES)/sunraster/lena-8bit-raw.sun -pix_fmt rgb24
-
-FATE_SUNRASTER += fate-sunraster-8bit_gray-raw
-fate-sunraster-8bit_gray-raw: CMD = framecrc -i $(TARGET_SAMPLES)/sunraster/gray.ras
-
-FATE_SUNRASTER += fate-sunraster-8bit-rle
-fate-sunraster-8bit-rle: CMD = framecrc -i $(TARGET_SAMPLES)/sunraster/lena-8bit-rle.sun -pix_fmt rgb24
-
-FATE_SUNRASTER += fate-sunraster-24bit-raw
-fate-sunraster-24bit-raw: CMD = framecrc -i $(TARGET_SAMPLES)/sunraster/lena-24bit-raw.sun
-
-FATE_SUNRASTER += fate-sunraster-24bit-rle
-fate-sunraster-24bit-rle: CMD = framecrc -i $(TARGET_SAMPLES)/sunraster/lena-24bit-rle.sun
-
-FATE_SUNRASTER-$(call DEMDEC, IMAGE2, SUNRAST) += $(FATE_SUNRASTER)
-
-FATE_SAMPLES_AVCONV += $(FATE_SUNRASTER-yes)
-fate-sunraster: $(FATE_SUNRASTER-yes)
-
-FATE_TARGA = CBW8       \
-             CCM8       \
-             CTC16      \
-             CTC24      \
-             CTC32      \
-             UBW8       \
-             UCM8       \
-             UTC16      \
-             UTC24      \
-             UTC32
-
-FATE_TARGA := $(FATE_TARGA:%=fate-targa-conformance-%)  \
-              fate-targa-top-to-bottom
-
-FATE_TARGA-$(call DEMDEC, IMAGE2, TARGA) += $(FATE_TARGA)
-
-FATE_SAMPLES_AVCONV += $(FATE_TARGA-yes)
-fate-targa: $(FATE_TARGA-yes)
-
-fate-targa-conformance-CBW8:  CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/CBW8.TGA
-fate-targa-conformance-CCM8:  CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/CCM8.TGA  -pix_fmt rgba
-fate-targa-conformance-CTC16: CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/CTC16.TGA -pix_fmt rgb555le
-fate-targa-conformance-CTC24: CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/CTC24.TGA
-fate-targa-conformance-CTC32: CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/CTC32.TGA -pix_fmt bgra
-fate-targa-conformance-UBW8:  CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/UBW8.TGA
-fate-targa-conformance-UCM8:  CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/UCM8.TGA  -pix_fmt rgba
-fate-targa-conformance-UTC16: CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/UTC16.TGA -pix_fmt rgb555le
-fate-targa-conformance-UTC24: CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/UTC24.TGA
-fate-targa-conformance-UTC32: CMD = framecrc -i $(TARGET_SAMPLES)/targa-conformance/UTC32.TGA -pix_fmt bgra
-
-fate-targa-top-to-bottom: CMD = framecrc -i $(TARGET_SAMPLES)/targa/lena-top-to-bottom.tga
-
-FATE_TIFF += fate-tiff-fax-g3
-fate-tiff-fax-g3: CMD = framecrc -i $(TARGET_SAMPLES)/CCITT_fax/G31D.TIF
-
-FATE_TIFF += fate-tiff-fax-g3s
-fate-tiff-fax-g3s: CMD = framecrc -i $(TARGET_SAMPLES)/CCITT_fax/G31DS.TIF
-
-FATE_TIFF-$(call DEMDEC, IMAGE2, TIFF) += $(FATE_TIFF)
-
-FATE_SAMPLES_AVCONV += $(FATE_TIFF-yes)
-fate-tiff: $(FATE_TIFF-yes)
diff --git a/deps/libav/tests/fate/indeo.mak b/deps/libav/tests/fate/indeo.mak
deleted file mode 100644
index e725a6b..0000000
--- a/deps/libav/tests/fate/indeo.mak
+++ /dev/null
@@ -1,17 +0,0 @@
-FATE_INDEO-$(call DEMDEC, AVI, INDEO2) += fate-indeo2
-fate-indeo2: CMD = framecrc -i $(TARGET_SAMPLES)/rt21/VPAR0026.AVI
-
-FATE_INDEO-$(call DEMDEC, MOV, INDEO3) += fate-indeo3
-fate-indeo3: CMD = framecrc -i $(TARGET_SAMPLES)/iv32/cubes.mov
-
-FATE_INDEO-$(call DEMDEC, AVI, INDEO3) += fate-indeo3-2
-fate-indeo3-2: CMD = framecrc -i $(TARGET_SAMPLES)/iv32/OPENINGH.avi
-
-FATE_INDEO-$(call DEMDEC, AVI, INDEO4) += fate-indeo4
-fate-indeo4: CMD = framecrc -i $(TARGET_SAMPLES)/iv41/indeo41-partial.avi -an
-
-FATE_INDEO-$(call DEMDEC, AVI, INDEO5) += fate-indeo5
-fate-indeo5: CMD = framecrc -i $(TARGET_SAMPLES)/iv50/Educ_Movie_DeadlyForce.avi -an
-
-FATE_SAMPLES_AVCONV += $(FATE_INDEO-yes)
-fate-indeo: $(FATE_INDEO-yes)
diff --git a/deps/libav/tests/fate/libavcodec.mak b/deps/libav/tests/fate/libavcodec.mak
deleted file mode 100644
index 6e81f57..0000000
--- a/deps/libav/tests/fate/libavcodec.mak
+++ /dev/null
@@ -1,23 +0,0 @@
-FATE_LIBAVCODEC-$(CONFIG_GOLOMB) += fate-golomb
-fate-golomb: libavcodec/golomb-test$(EXESUF)
-fate-golomb: CMD = run libavcodec/golomb-test
-fate-golomb: REF = /dev/null
-
-FATE_LIBAVCODEC-yes += fate-idct8x8
-fate-idct8x8: libavcodec/dct-test$(EXESUF)
-fate-idct8x8: CMD = run libavcodec/dct-test -i
-fate-idct8x8: CMP = null
-fate-idct8x8: REF = /dev/null
-
-FATE_LIBAVCODEC-yes += fate-iirfilter
-fate-iirfilter: libavcodec/iirfilter-test$(EXESUF)
-fate-iirfilter: CMD = run libavcodec/iirfilter-test
-
-FATE_LIBAVCODEC-$(CONFIG_RANGECODER) += fate-rangecoder
-fate-rangecoder: libavcodec/rangecoder-test$(EXESUF)
-fate-rangecoder: CMD = run libavcodec/rangecoder-test
-fate-rangecoder: CMP = null
-fate-rangecoder: REF = /dev/null
-
-FATE-$(CONFIG_AVCODEC) += $(FATE_LIBAVCODEC-yes)
-fate-libavcodec: $(FATE_LIBAVCODEC-yes)
diff --git a/deps/libav/tests/fate/libavdevice.mak b/deps/libav/tests/fate/libavdevice.mak
deleted file mode 100644
index cb6af51..0000000
--- a/deps/libav/tests/fate/libavdevice.mak
+++ /dev/null
@@ -1,6 +0,0 @@
-FATE_LIBAVDEVICE-yes += fate-timefilter
-fate-timefilter: libavdevice/timefilter-test$(EXESUF)
-fate-timefilter: CMD = run libavdevice/timefilter-test
-
-FATE-$(CONFIG_AVDEVICE) += $(FATE_LIBAVDEVICE-yes)
-fate-libavdevice: $(FATE_LIBAVDEVICE-yes)
diff --git a/deps/libav/tests/fate/libavformat.mak b/deps/libav/tests/fate/libavformat.mak
deleted file mode 100644
index d532adc..0000000
--- a/deps/libav/tests/fate/libavformat.mak
+++ /dev/null
@@ -1,14 +0,0 @@
-FATE_LIBAVFORMAT-$(CONFIG_NETWORK) += fate-noproxy
-fate-noproxy: libavformat/noproxy-test$(EXESUF)
-fate-noproxy: CMD = run libavformat/noproxy-test
-
-FATE_LIBAVFORMAT-yes += fate-srtp
-fate-srtp: libavformat/srtp-test$(EXESUF)
-fate-srtp: CMD = run libavformat/srtp-test
-
-FATE_LIBAVFORMAT-yes += fate-url
-fate-url: libavformat/url-test$(EXESUF)
-fate-url: CMD = run libavformat/url-test
-
-FATE-$(CONFIG_AVFORMAT) += $(FATE_LIBAVFORMAT-yes)
-fate-libavformat: $(FATE_LIBAVFORMAT)
diff --git a/deps/libav/tests/fate/libavresample.mak b/deps/libav/tests/fate/libavresample.mak
deleted file mode 100644
index 543a499..0000000
--- a/deps/libav/tests/fate/libavresample.mak
+++ /dev/null
@@ -1,54 +0,0 @@
-CROSS_TEST = $(foreach I,$(1),                                        \
-                 $(foreach J,$(1),                                    \
-                     $(if $(filter-out $(I),$(J)),                    \
-                         $(eval $(call $(2),$(I),$(J),$(3),$(4),$(5))),    \
-                     )))
-
-MIX_CHANNELS = 1 2 3 4 5 6 7 8
-
-define MIX
-FATE_LAVR_MIX += fate-lavr-mix-$(3)-$(1)-$(2)
-fate-lavr-mix-$(3)-$(1)-$(2): tests/data/asynth-44100-$(1).wav
-fate-lavr-mix-$(3)-$(1)-$(2): CMD = avconv -i $(TARGET_PATH)/tests/data/asynth-44100-$(1).wav -ac $(2) -mix_coeff_type $(3) -internal_sample_fmt $(4) -f s16le -af atrim=end_sample=1024 -
-fate-lavr-mix-$(3)-$(1)-$(2): CMP = oneoff
-fate-lavr-mix-$(3)-$(1)-$(2): REF = $(SAMPLES)/lavr/lavr-mix-$(3)-$(1)-$(2)
-endef
-
-$(call CROSS_TEST,$(MIX_CHANNELS),MIX,q8,s16p)
-$(call CROSS_TEST,$(MIX_CHANNELS),MIX,q15,s16p)
-$(call CROSS_TEST,$(MIX_CHANNELS),MIX,flt,fltp)
-
-# test output zeroing with skipped corresponding input
-FATE_LAVR_MIX-$(call FILTERDEMDECENCMUX, CHANNELMAP RESAMPLE, WAV, PCM_S16LE, PCM_S16LE, WAV) += fate-lavr-mix-output-zero
-fate-lavr-mix-output-zero: tests/data/filtergraphs/lavr_mix_output_zero tests/data/asynth-44100-4.wav
-fate-lavr-mix-output-zero: CMP = oneoff
-fate-lavr-mix-output-zero: CMD = avconv -i $(TARGET_PATH)/tests/data/asynth-44100-4.wav -filter_script $(TARGET_PATH)/tests/data/filtergraphs/lavr_mix_output_zero -f s16le -
-fate-lavr-mix-output-zero: REF = $(SAMPLES)/lavr/lavr-mix-output-zero
-
-FATE_LAVR_MIX-$(call FILTERDEMDECENCMUX, RESAMPLE, WAV, PCM_S16LE, PCM_S16LE, WAV) += $(FATE_LAVR_MIX)
-fate-lavr-mix: $(FATE_LAVR_MIX-yes)
-FATE_LAVR += $(FATE_LAVR_MIX-yes)
-
-SAMPLERATES = 2626 8000 44100 48000 96000
-
-define RESAMPLE
-FATE_LAVR_RESAMPLE += fate-lavr-resample-$(3)-$(1)-$(2)
-fate-lavr-resample-$(3)-$(1)-$(2): tests/data/asynth-$(1)-1.wav
-fate-lavr-resample-$(3)-$(1)-$(2): CMD = avconv -i $(TARGET_PATH)/tests/data/asynth-$(1)-1.wav -ar $(2) -internal_sample_fmt $(3) -f $(4) -af atrim=end_sample=10240 -
-fate-lavr-resample-$(3)-$(1)-$(2): CMP = oneoff
-fate-lavr-resample-$(3)-$(1)-$(2): CMP_UNIT = $(5)
-fate-lavr-resample-$(3)-$(1)-$(2): FUZZ = 6
-fate-lavr-resample-$(3)-$(1)-$(2): REF = $(SAMPLES)/lavr/lavr-resample-$(3)-$(1)-$(2)
-endef
-
-$(call CROSS_TEST,$(SAMPLERATES),RESAMPLE,s16p,s16le,s16)
-$(call CROSS_TEST,$(SAMPLERATES),RESAMPLE,s32p,s32le,s16)
-$(call CROSS_TEST,$(SAMPLERATES),RESAMPLE,fltp,f32le,f32)
-$(call CROSS_TEST,$(SAMPLERATES),RESAMPLE,dblp,f64le,f64)
-
-FATE_LAVR_RESAMPLE-$(call FILTERDEMDECENCMUX, RESAMPLE, WAV, PCM_S16LE, PCM_S16LE, WAV) += $(FATE_LAVR_RESAMPLE)
-fate-lavr-resample: $(FATE_LAVR_RESAMPLE-yes)
-FATE_LAVR += $(FATE_LAVR_RESAMPLE-yes)
-
-FATE_SAMPLES_AVCONV += $(FATE_LAVR)
-fate-lavr: $(FATE_LAVR)
diff --git a/deps/libav/tests/fate/libavutil.mak b/deps/libav/tests/fate/libavutil.mak
deleted file mode 100644
index 6f24496..0000000
--- a/deps/libav/tests/fate/libavutil.mak
+++ /dev/null
@@ -1,71 +0,0 @@
-FATE_LIBAVUTIL += fate-adler32
-fate-adler32: libavutil/adler32-test$(EXESUF)
-fate-adler32: CMD = run libavutil/adler32-test
-fate-adler32: REF = /dev/null
-
-FATE_LIBAVUTIL += fate-aes
-fate-aes: libavutil/aes-test$(EXESUF)
-fate-aes: CMD = run libavutil/aes-test
-fate-aes: REF = /dev/null
-
-FATE_LIBAVUTIL += fate-atomic
-fate-atomic: libavutil/atomic-test$(EXESUF)
-fate-atomic: CMD = run libavutil/atomic-test
-fate-atomic: REF = /dev/null
-
-FATE_LIBAVUTIL += fate-avstring
-fate-avstring: libavutil/avstring-test$(EXESUF)
-fate-avstring: CMD = run libavutil/avstring-test
-
-FATE_LIBAVUTIL += fate-base64
-fate-base64: libavutil/base64-test$(EXESUF)
-fate-base64: CMD = run libavutil/base64-test
-
-FATE_LIBAVUTIL += fate-blowfish
-fate-blowfish: libavutil/blowfish-test$(EXESUF)
-fate-blowfish: CMD = run libavutil/blowfish-test
-
-FATE_LIBAVUTIL += fate-crc
-fate-crc: libavutil/crc-test$(EXESUF)
-fate-crc: CMD = run libavutil/crc-test
-
-FATE_LIBAVUTIL += fate-des
-fate-des: libavutil/des-test$(EXESUF)
-fate-des: CMD = run libavutil/des-test
-fate-des: REF = /dev/null
-
-FATE_LIBAVUTIL += fate-eval
-fate-eval: libavutil/eval-test$(EXESUF)
-fate-eval: CMD = run libavutil/eval-test
-
-FATE_LIBAVUTIL += fate-fifo
-fate-fifo: libavutil/fifo-test$(EXESUF)
-fate-fifo: CMD = run libavutil/fifo-test
-
-FATE_LIBAVUTIL += fate-hmac
-fate-hmac: libavutil/hmac-test$(EXESUF)
-fate-hmac: CMD = run libavutil/hmac-test
-
-FATE_LIBAVUTIL += fate-md5
-fate-md5: libavutil/md5-test$(EXESUF)
-fate-md5: CMD = run libavutil/md5-test
-
-FATE_LIBAVUTIL += fate-parseutils
-fate-parseutils: libavutil/parseutils-test$(EXESUF)
-fate-parseutils: CMD = run libavutil/parseutils-test
-
-FATE_LIBAVUTIL += fate-sha
-fate-sha: libavutil/sha-test$(EXESUF)
-fate-sha: CMD = run libavutil/sha-test
-
-FATE_LIBAVUTIL += fate-tree
-fate-tree: libavutil/tree-test$(EXESUF)
-fate-tree: CMD = run libavutil/tree-test
-fate-tree: REF = /dev/null
-
-FATE_LIBAVUTIL += fate-xtea
-fate-xtea: libavutil/xtea-test$(EXESUF)
-fate-xtea: CMD = run libavutil/xtea-test
-
-FATE-$(CONFIG_AVUTIL) += $(FATE_LIBAVUTIL)
-fate-libavutil: $(FATE_LIBAVUTIL)
diff --git a/deps/libav/tests/fate/lossless-audio.mak b/deps/libav/tests/fate/lossless-audio.mak
deleted file mode 100644
index 3638f17..0000000
--- a/deps/libav/tests/fate/lossless-audio.mak
+++ /dev/null
@@ -1,22 +0,0 @@
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, ALAC) += fate-lossless-alac
-fate-lossless-alac: CMD = md5 -i $(TARGET_SAMPLES)/lossless-audio/inside.m4a -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MLP, MLP) += fate-lossless-meridianaudio
-fate-lossless-meridianaudio: CMD = md5 -i $(TARGET_SAMPLES)/lossless-audio/luckynight-partial.mlp -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RM, RALF) += fate-ralf
-fate-ralf: CMD = md5 -i $(TARGET_SAMPLES)/lossless-audio/luckynight-partial.rmvb -vn -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, SHORTEN, SHORTEN) += fate-lossless-shorten
-fate-lossless-shorten: CMD = md5 -i $(TARGET_SAMPLES)/lossless-audio/luckynight-partial.shn -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, TAK, TAK) += fate-lossless-tak
-fate-lossless-tak: CMD = md5 -i $(TARGET_SAMPLES)/lossless-audio/luckynight-partial.tak -f s16le
-fate-lossless-tak: CMP = oneline
-fate-lossless-tak: REF = a28d4e5f2192057f7d4bece870f40bd0
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, TTA, TTA) += fate-lossless-tta
-fate-lossless-tta: CMD = crc -i $(TARGET_SAMPLES)/lossless-audio/inside.tta
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, WMALOSSLESS) += fate-lossless-wma
-fate-lossless-wma: CMD = md5 -i $(TARGET_SAMPLES)/lossless-audio/luckynight-partial.wma -f s16le
diff --git a/deps/libav/tests/fate/lossless-video.mak b/deps/libav/tests/fate/lossless-video.mak
deleted file mode 100644
index bf1a971..0000000
--- a/deps/libav/tests/fate/lossless-video.mak
+++ /dev/null
@@ -1,50 +0,0 @@
-FATE_CLLC += fate-cllc-argb
-fate-cllc-argb: CMD = framecrc -i $(TARGET_SAMPLES)/cllc/sample-cllc-argb.avi
-
-FATE_CLLC += fate-cllc-rgb
-fate-cllc-rgb: CMD = framecrc -i $(TARGET_SAMPLES)/cllc/sample-cllc-rgb.avi
-
-FATE_CLLC += fate-cllc-yuy2-noblock
-fate-cllc-yuy2-noblock: CMD = framecrc -i $(TARGET_SAMPLES)/cllc/sample-cllc-yuy2-noblock.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, CLLC) += $(FATE_CLLC)
-fate-cllc: $(FATE_CLLC)
-
-FATE_LAGARITH += fate-lagarith-rgb24
-fate-lagarith-rgb24: CMD = framecrc -i $(TARGET_SAMPLES)/lagarith/lag-rgb24.avi
-
-FATE_LAGARITH += fate-lagarith-rgb32
-fate-lagarith-rgb32: CMD = framecrc -i $(TARGET_SAMPLES)/lagarith/lag-rgb32.avi -pix_fmt bgra
-
-FATE_LAGARITH += fate-lagarith-yuy2
-fate-lagarith-yuy2: CMD = framecrc -i $(TARGET_SAMPLES)/lagarith/lag-yuy2.avi
-
-FATE_LAGARITH += fate-lagarith-yv12
-fate-lagarith-yv12: CMD = framecrc -i $(TARGET_SAMPLES)/lagarith/lag-yv12.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, LAGARITH) += $(FATE_LAGARITH)
-fate-lagarith: $(FATE_LAGARITH)
-
-FATE_LOCO += fate-loco-rgb
-fate-loco-rgb: CMD = framecrc -i $(TARGET_SAMPLES)/loco/pig-loco-rgb.avi
-
-FATE_LOCO += fate-loco-yuy2
-fate-loco-yuy2: CMD = framecrc -i $(TARGET_SAMPLES)/loco/pig-loco-0.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, LOCO) += $(FATE_LOCO)
-fate-loco: $(FATE_LOCO)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, MSRLE) += fate-msrle-8bit
-fate-msrle-8bit: CMD = framecrc -i $(TARGET_SAMPLES)/msrle/Search-RLE.avi -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, MSZH) += fate-mszh
-fate-mszh: CMD = framecrc -i $(TARGET_SAMPLES)/lcl/mszh-1frame.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, VBLE) += fate-vble
-fate-vble: CMD = framecrc -i $(TARGET_SAMPLES)/vble/flowers-partial-2MB.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, ZEROCODEC) += fate-zerocodec
-fate-zerocodec: CMD = framecrc -i $(TARGET_SAMPLES)/zerocodec/sample-zeco.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, ZLIB) += fate-zlib
-fate-zlib: CMD = framecrc -i $(TARGET_SAMPLES)/lcl/zlib-1frame.avi
diff --git a/deps/libav/tests/fate/microsoft.mak b/deps/libav/tests/fate/microsoft.mak
deleted file mode 100644
index ea41c42..0000000
--- a/deps/libav/tests/fate/microsoft.mak
+++ /dev/null
@@ -1,60 +0,0 @@
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, MSMPEG4V1) += fate-msmpeg4v1
-fate-msmpeg4v1: CMD = framecrc -flags +bitexact -idct simple -i $(TARGET_SAMPLES)/msmpeg4v1/mpg4.avi -an
-
-FATE_MSS2 += fate-mss2-pal
-fate-mss2-pal: CMD = framecrc -i $(TARGET_SAMPLES)/mss2/rlepal.wmv
-
-FATE_MSS2 += fate-mss2-pals
-fate-mss2-pals: CMD = framecrc -i $(TARGET_SAMPLES)/mss2/rlepals.wmv
-
-FATE_MSS2 += fate-mss2-rgb555
-fate-mss2-rgb555: CMD = framecrc -i $(TARGET_SAMPLES)/mss2/rle555.wmv -pix_fmt rgb555le
-
-FATE_MSS2 += fate-mss2-rgb555s
-fate-mss2-rgb555s: CMD = framecrc -i $(TARGET_SAMPLES)/mss2/rle555s.wmv -pix_fmt rgb555le
-
-FATE_MSS2 += fate-mss2-wmv
-fate-mss2-wmv: CMD = framecrc -i $(TARGET_SAMPLES)/mss2/msscreencodec.wmv -an -frames 100
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, MSS2) += $(FATE_MSS2)
-fate-mss2: $(FATE_MSS2)
-
-FATE_MSVIDEO1 += fate-msvideo1-8bit
-fate-msvideo1-8bit: CMD = framecrc -i $(TARGET_SAMPLES)/cram/skating.avi -t 1 -pix_fmt rgb24
-
-FATE_MSVIDEO1 += fate-msvideo1-16bit
-fate-msvideo1-16bit: CMD = framecrc -i $(TARGET_SAMPLES)/cram/clock-cram16.avi -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, MSVIDEO1) += $(FATE_MSVIDEO1)
-fate-msvideo1: $(FATE_MSVIDEO1)
-
-FATE_WMV8_DRM += fate-wmv8-drm
-# discard last packet to avoid fails due to overread of VC-1 decoder
-fate-wmv8-drm: CMD = framecrc -cryptokey 137381538c84c068111902a59c5cf6c340247c39 -i $(TARGET_SAMPLES)/wmv8/wmv_drm.wmv -an -frames:v 129
-
-FATE_WMV8_DRM += fate-wmv8-drm-nodec
-fate-wmv8-drm-nodec: CMD = framecrc -cryptokey 137381538c84c068111902a59c5cf6c340247c39 -i $(TARGET_SAMPLES)/wmv8/wmv_drm.wmv -acodec copy -vcodec copy
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, ASF, WMV3) += $(FATE_WMV8_DRM)
-fate-wmv8_drm: $(FATE_WMV8_DRM)
-
-FATE_VC1-$(CONFIG_VC1_DEMUXER) += fate-vc1_sa00040
-fate-vc1_sa00040: CMD = framecrc -i $(TARGET_SAMPLES)/vc1/SA00040.vc1
-
-FATE_VC1-$(CONFIG_VC1_DEMUXER) += fate-vc1_sa00050
-fate-vc1_sa00050: CMD = framecrc -i $(TARGET_SAMPLES)/vc1/SA00050.vc1
-
-FATE_VC1-$(CONFIG_VC1_DEMUXER) += fate-vc1_sa10091
-fate-vc1_sa10091: CMD = framecrc -i $(TARGET_SAMPLES)/vc1/SA10091.vc1
-
-FATE_VC1-$(CONFIG_VC1_DEMUXER) += fate-vc1_sa10143
-fate-vc1_sa10143: CMD = framecrc -i $(TARGET_SAMPLES)/vc1/SA10143.vc1
-
-FATE_VC1-$(CONFIG_VC1_DEMUXER) += fate-vc1_sa20021
-fate-vc1_sa20021: CMD = framecrc -i $(TARGET_SAMPLES)/vc1/SA20021.vc1
-
-FATE_VC1-$(CONFIG_MOV_DEMUXER) += fate-vc1-ism
-fate-vc1-ism: CMD = framecrc -i $(TARGET_SAMPLES)/isom/vc1-wmapro.ism -an
-
-FATE_SAMPLES_AVCONV-$(CONFIG_VC1_DECODER) += $(FATE_VC1-yes)
-fate-vc1: $(FATE_VC1-yes)
diff --git a/deps/libav/tests/fate/monkeysaudio.mak b/deps/libav/tests/fate/monkeysaudio.mak
deleted file mode 100644
index 9ce872a..0000000
--- a/deps/libav/tests/fate/monkeysaudio.mak
+++ /dev/null
@@ -1,20 +0,0 @@
-APE_VERSIONS = 380 388 389b1 391b1 392b2 394b1
-
-define FATE_APE_SUITE
-FATE_APE += fate-lossless-monkeysaudio-$(1)-normal
-fate-lossless-monkeysaudio-$(1)-normal: CMD = crc -i $(TARGET_SAMPLES)/lossless-audio/luckynight-mac$(1)-c2000.ape -af atrim=end_sample=73728
-fate-lossless-monkeysaudio-$(1)-normal: REF = CRC=0x5d08c17e
-fate-lossless-monkeysaudio-$(1)-normal: CMP = oneline
-FATE_APE += fate-lossless-monkeysaudio-$(1)-extrahigh
-fate-lossless-monkeysaudio-$(1)-extrahigh: CMD = crc -i $(TARGET_SAMPLES)/lossless-audio/luckynight-mac$(1)-c4000.ape -af atrim=end_sample=73728
-fate-lossless-monkeysaudio-$(1)-extrahigh: REF = CRC=0x5d08c17e
-fate-lossless-monkeysaudio-$(1)-extrahigh: CMP = oneline
-endef
-
-$(foreach N,$(APE_VERSIONS),$(eval $(call FATE_APE_SUITE,$(N))))
-
-FATE_APE += fate-lossless-monkeysaudio-399
-fate-lossless-monkeysaudio-399: CMD = md5 -i $(TARGET_SAMPLES)/lossless-audio/luckynight-partial.ape -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, APE, APE) += $(FATE_APE)
-fate-lossless-monkeysaudio: $(FATE_APE)
diff --git a/deps/libav/tests/fate/mp3.mak b/deps/libav/tests/fate/mp3.mak
deleted file mode 100644
index fe6a0e1..0000000
--- a/deps/libav/tests/fate/mp3.mak
+++ /dev/null
@@ -1,39 +0,0 @@
-FATE_MP3 += fate-mp3-float-conf-compl
-fate-mp3-float-conf-compl: CMD = pcm -acodec mp3float -i $(TARGET_SAMPLES)/mp3-conformance/compl.bit
-fate-mp3-float-conf-compl: REF = $(SAMPLES)/mp3-conformance/compl.pcm
-
-FATE_MP3 += fate-mp3-float-conf-he_32khz
-fate-mp3-float-conf-he_32khz: CMD = pcm -acodec mp3float -i $(TARGET_SAMPLES)/mp3-conformance/he_32khz.bit -fs 343296
-fate-mp3-float-conf-he_32khz: REF = $(SAMPLES)/mp3-conformance/he_32khz.pcm
-
-FATE_MP3 += fate-mp3-float-conf-he_44khz
-fate-mp3-float-conf-he_44khz: CMD = pcm -acodec mp3float -i $(TARGET_SAMPLES)/mp3-conformance/he_44khz.bit -fs 942336
-fate-mp3-float-conf-he_44khz: REF = $(SAMPLES)/mp3-conformance/he_44khz.pcm
-
-FATE_MP3 += fate-mp3-float-conf-he_48khz
-fate-mp3-float-conf-he_48khz: CMD = pcm -acodec mp3float -i $(TARGET_SAMPLES)/mp3-conformance/he_48khz.bit -fs 343296
-fate-mp3-float-conf-he_48khz: REF = $(SAMPLES)/mp3-conformance/he_48khz.pcm
-
-FATE_MP3 += fate-mp3-float-conf-hecommon
-fate-mp3-float-conf-hecommon: CMD = pcm -acodec mp3float -i $(TARGET_SAMPLES)/mp3-conformance/hecommon.bit -fs 133632
-fate-mp3-float-conf-hecommon: REF = $(SAMPLES)/mp3-conformance/hecommon.pcm
-
-FATE_MP3 += fate-mp3-float-conf-si
-fate-mp3-float-conf-si: CMD = pcm -acodec mp3float -i $(TARGET_SAMPLES)/mp3-conformance/si.bit -fs 269568
-fate-mp3-float-conf-si: REF = $(SAMPLES)/mp3-conformance/si.pcm
-
-FATE_MP3 += fate-mp3-float-conf-si_block
-fate-mp3-float-conf-si_block: CMD = pcm -acodec mp3float -i $(TARGET_SAMPLES)/mp3-conformance/si_block.bit -fs 145152
-fate-mp3-float-conf-si_block: REF = $(SAMPLES)/mp3-conformance/si_block.pcm
-
-FATE_MP3 += fate-mp3-float-extra_overread
-fate-mp3-float-extra_overread: CMD = pcm -c:a mp3float -i $(TARGET_SAMPLES)/mpegaudio/extra_overread.mp3
-fate-mp3-float-extra_overread: REF = $(SAMPLES)/mpegaudio/extra_overread.pcm
-
-$(FATE_MP3): CMP = stddev
-$(FATE_MP3): FUZZ = 0.07
-
-FATE_MP3-$(call DEMDEC, MP3, MP3FLOAT) += $(FATE_MP3)
-
-FATE_SAMPLES_AVCONV += $(FATE_MP3-yes)
-fate-mp3: $(FATE_MP3-yes)
diff --git a/deps/libav/tests/fate/mpc.mak b/deps/libav/tests/fate/mpc.mak
deleted file mode 100644
index 4a01273..0000000
--- a/deps/libav/tests/fate/mpc.mak
+++ /dev/null
@@ -1,13 +0,0 @@
-FATE_MPC-$(CONFIG_MPC_DEMUXER) += fate-mpc7-demux
-fate-mpc7-demux: CMD = crc -i $(TARGET_SAMPLES)/musepack/inside-mp7.mpc -acodec copy
-
-FATE_MPC-$(CONFIG_MPC8_DEMUXER) += fate-mpc8-demux
-fate-mpc8-demux: CMD = crc -i $(TARGET_SAMPLES)/musepack/inside-mp8.mpc -acodec copy
-
-FATE_MPC-$(call DEMDEC, MPC, MPC7) += fate-musepack7
-fate-musepack7: CMD = pcm -i $(TARGET_SAMPLES)/musepack/inside-mp7.mpc
-fate-musepack7: CMP = oneoff
-fate-musepack7: REF = $(SAMPLES)/musepack/inside-mp7.pcm
-
-FATE_SAMPLES_AVCONV += $(FATE_MPC-yes)
-fate-mpc: $(FATE_MPC-yes)
diff --git a/deps/libav/tests/fate/pcm.mak b/deps/libav/tests/fate/pcm.mak
deleted file mode 100644
index 116b50f..0000000
--- a/deps/libav/tests/fate/pcm.mak
+++ /dev/null
@@ -1,32 +0,0 @@
-FATE_SAMPLES_PCM += fate-iff-pcm
-fate-iff-pcm: CMD = md5 -i $(TARGET_SAMPLES)/iff/Bells -f s16le
-
-FATE_SAMPLES_PCM += fate-pcm_dvd
-fate-pcm_dvd: CMD = framecrc -i $(TARGET_SAMPLES)/pcm-dvd/coolitnow-partial.vob -vn
-
-FATE_SAMPLES_PCM += fate-pcm-planar
-fate-pcm-planar: CMD = framecrc -i $(TARGET_SAMPLES)/ea-mad/xeasport.mad -vn
-
-FATE_SAMPLES_PCM += fate-pcm_s16be-stereo
-fate-pcm_s16be-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-16-B-twos.mov -f s16le
-
-FATE_SAMPLES_PCM += fate-pcm_s16le-stereo
-fate-pcm_s16le-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-16-L-sowt.mov -f s16le
-
-FATE_SAMPLES_PCM += fate-pcm_u8-mono
-fate-pcm_u8-mono: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-1-8-raw.mov -f s16le
-
-FATE_SAMPLES_PCM += fate-pcm_u8-stereo
-fate-pcm_u8-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-8-raw.mov -f s16le
-
-FATE_SAMPLES_PCM += fate-w64
-fate-w64: CMD = crc -i $(TARGET_SAMPLES)/w64/w64-pcm16.w64
-
-FATE_PCM += fate-dcinema-encode
-fate-dcinema-encode: tests/data/asynth-96000-6.wav
-fate-dcinema-encode: SRC = tests/data/asynth-96000-6.wav
-fate-dcinema-encode: CMD = enc_dec_pcm daud md5 s16le $(SRC) -c:a pcm_s24daud
-
-FATE_AVCONV += $(FATE_PCM)
-FATE_SAMPLES_AVCONV += $(FATE_SAMPLES_PCM)
-fate-pcm: $(FATE_PCM) $(FATE_SAMPLES_PCM)
diff --git a/deps/libav/tests/fate/probe.mak b/deps/libav/tests/fate/probe.mak
deleted file mode 100644
index 376dfdd..0000000
--- a/deps/libav/tests/fate/probe.mak
+++ /dev/null
@@ -1,18 +0,0 @@
-FATE_PROBE_FORMAT += fate-probe-format-roundup997
-fate-probe-format-roundup997:  REF = mpeg
-
-FATE_PROBE_FORMAT += fate-probe-format-roundup1383
-fate-probe-format-roundup1383: REF = mp3
-
-FATE_PROBE_FORMAT += fate-probe-format-roundup1414
-fate-probe-format-roundup1414: REF = mpeg
-
-FATE_PROBE_FORMAT += fate-probe-format-roundup2015
-fate-probe-format-roundup2015: REF = dv
-
-FATE_SAMPLES-$(CONFIG_AVPROBE) += $(FATE_PROBE_FORMAT)
-fate-probe-format: $(FATE_PROBE_FORMAT)
-
-$(FATE_PROBE_FORMAT): avprobe$(EXESUF)
-$(FATE_PROBE_FORMAT): CMP = oneline
-fate-probe-format-%: CMD = probefmt $(TARGET_SAMPLES)/probe-format/$(@:fate-probe-format-%=%)
diff --git a/deps/libav/tests/fate/prores.mak b/deps/libav/tests/fate/prores.mak
deleted file mode 100644
index 8d4b6ac..0000000
--- a/deps/libav/tests/fate/prores.mak
+++ /dev/null
@@ -1,14 +0,0 @@
-FATE_PRORES = fate-prores-422                                           \
-              fate-prores-422_hq                                        \
-              fate-prores-422_lt                                        \
-              fate-prores-422_proxy                                     \
-              fate-prores-alpha                                         \
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PRORES) += $(FATE_PRORES)
-fate-prores: $(FATE_PRORES)
-
-fate-prores-422:       CMD = framecrc -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422.mov -pix_fmt yuv422p10le
-fate-prores-422_hq:    CMD = framecrc -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_HQ.mov -pix_fmt yuv422p10le
-fate-prores-422_lt:    CMD = framecrc -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov -pix_fmt yuv422p10le
-fate-prores-422_proxy: CMD = framecrc -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -pix_fmt yuv422p10le
-fate-prores-alpha:     CMD = framecrc -i $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt yuva444p10le
diff --git a/deps/libav/tests/fate/qt.mak b/deps/libav/tests/fate/qt.mak
deleted file mode 100644
index ac95d64..0000000
--- a/deps/libav/tests/fate/qt.mak
+++ /dev/null
@@ -1,50 +0,0 @@
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, EIGHTBPS) += fate-8bps
-fate-8bps: CMD = framecrc -i $(TARGET_SAMPLES)/8bps/full9iron-partial.mov -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, QDM2) += fate-qdm2
-fate-qdm2: CMD = pcm -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-16-B-QDM2.mov
-fate-qdm2: CMP = oneoff
-fate-qdm2: REF = $(SAMPLES)/qt-surge-suite/surge-2-16-B-QDM2.pcm
-fate-qdm2: FUZZ = 2
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PCM_ALAW) += fate-qt-alaw-mono
-fate-qt-alaw-mono: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-1-16-B-alaw.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PCM_ALAW) += fate-qt-alaw-stereo
-fate-qt-alaw-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-16-B-alaw.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, ADPCM_IMA_QT) += fate-qt-ima4-mono
-fate-qt-ima4-mono: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-1-16-B-ima4.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, ADPCM_IMA_QT) += fate-qt-ima4-stereo
-fate-qt-ima4-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-16-B-ima4.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, MACE3) += fate-qt-mac3-mono
-fate-qt-mac3-mono: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-1-8-MAC3.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, MACE3) += fate-qt-mac3-stereo
-fate-qt-mac3-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-8-MAC3.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, MACE6) += fate-qt-mac6-mono
-fate-qt-mac6-mono: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-1-8-MAC6.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, MACE6) += fate-qt-mac6-stereo
-fate-qt-mac6-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-8-MAC6.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PCM_MULAW) += fate-qt-ulaw-mono
-fate-qt-ulaw-mono: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-1-16-B-ulaw.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PCM_MULAW) += fate-qt-ulaw-stereo
-fate-qt-ulaw-stereo: CMD = md5 -i $(TARGET_SAMPLES)/qt-surge-suite/surge-2-16-B-ulaw.mov -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, QDRAW) += fate-quickdraw
-fate-quickdraw: CMD = framecrc -i $(TARGET_SAMPLES)/quickdraw/Airplane.mov -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, RPZA) += fate-rpza
-fate-rpza: CMD = framecrc -i $(TARGET_SAMPLES)/rpza/rpza2.mov -t 2 -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, SVQ1) += fate-svq1
-fate-svq1: CMD = framecrc -i $(TARGET_SAMPLES)/svq1/marymary-shackles.mov -an -t 10
-
-FATE_SAMPLES_AVCONV-$(call ALLYES, MOV_DEMUXER SVQ3_DECODER ZLIB) += fate-svq3
-fate-svq3: CMD = framecrc -i $(TARGET_SAMPLES)/svq3/Vertical400kbit.sorenson3.mov -t 6 -an
diff --git a/deps/libav/tests/fate/qtrle.mak b/deps/libav/tests/fate/qtrle.mak
deleted file mode 100644
index 774a816..0000000
--- a/deps/libav/tests/fate/qtrle.mak
+++ /dev/null
@@ -1,23 +0,0 @@
-FATE_QTRLE += fate-qtrle-1bit
-fate-qtrle-1bit: CMD = framecrc -i $(TARGET_SAMPLES)/qtrle/Animation-Monochrome.mov -an
-
-FATE_QTRLE += fate-qtrle-2bit
-fate-qtrle-2bit: CMD = framecrc -i $(TARGET_SAMPLES)/qtrle/Animation-4Greys.mov -pix_fmt rgb24 -an
-
-FATE_QTRLE += fate-qtrle-4bit
-fate-qtrle-4bit: CMD = framecrc -i $(TARGET_SAMPLES)/qtrle/Animation-16Greys.mov -pix_fmt rgb24 -an
-
-FATE_QTRLE += fate-qtrle-8bit
-fate-qtrle-8bit: CMD = framecrc -i $(TARGET_SAMPLES)/qtrle/criticalpath-credits.mov -pix_fmt rgb24 -an
-
-FATE_QTRLE += fate-qtrle-16bit
-fate-qtrle-16bit: CMD = framecrc -i $(TARGET_SAMPLES)/qtrle/mr-cork-rle.mov -pix_fmt rgb24
-
-FATE_QTRLE += fate-qtrle-24bit
-fate-qtrle-24bit: CMD = framecrc -i $(TARGET_SAMPLES)/qtrle/aletrek-rle.mov
-
-FATE_QTRLE += fate-qtrle-32bit
-fate-qtrle-32bit: CMD = framecrc -i $(TARGET_SAMPLES)/qtrle/ultra_demo_720_480_32bpp_rle.mov -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, QTRLE) += $(FATE_QTRLE)
-fate-qtrle: $(FATE_QTRLE)
diff --git a/deps/libav/tests/fate/real.mak b/deps/libav/tests/fate/real.mak
deleted file mode 100644
index 8481f28..0000000
--- a/deps/libav/tests/fate/real.mak
+++ /dev/null
@@ -1,40 +0,0 @@
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RM, RA_144) += fate-ra-144
-fate-ra-144: CMD = md5 -i $(TARGET_SAMPLES)/real/ra3_in_rm_file.rm -f s16le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RM, RA_288) += fate-ra-288
-fate-ra-288: CMD = pcm -i $(TARGET_SAMPLES)/real/ra_288.rm
-fate-ra-288: CMP = oneoff
-fate-ra-288: REF = $(SAMPLES)/real/ra_288.pcm
-fate-ra-288: FUZZ = 2
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RM, COOK) += fate-ra-cook
-fate-ra-cook: CMD = pcm -i $(TARGET_SAMPLES)/real/ra_cook.rm
-fate-ra-cook: CMP = oneoff
-fate-ra-cook: REF = $(SAMPLES)/real/ra_cook.pcm
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RM, RV30) += fate-rv30
-fate-rv30: CMD = framecrc -flags +bitexact -idct simple -i $(TARGET_SAMPLES)/real/rv30.rm -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RM, RV40) += fate-rv40
-fate-rv40: CMD = framecrc -i $(TARGET_SAMPLES)/real/spygames-2MB.rmvb -t 10 -an -vsync 0
-
-FATE_SIPR += fate-sipr-5k0
-fate-sipr-5k0: CMD = pcm -i $(TARGET_SAMPLES)/sipr/sipr_5k0.rm
-fate-sipr-5k0: REF = $(SAMPLES)/sipr/sipr_5k0.pcm
-
-FATE_SIPR += fate-sipr-6k5
-fate-sipr-6k5: CMD = pcm -i $(TARGET_SAMPLES)/sipr/sipr_6k5.rm
-fate-sipr-6k5: REF = $(SAMPLES)/sipr/sipr_6k5.pcm
-
-FATE_SIPR += fate-sipr-8k5
-fate-sipr-8k5: CMD = pcm -i $(TARGET_SAMPLES)/sipr/sipr_8k5.rm
-fate-sipr-8k5: REF = $(SAMPLES)/sipr/sipr_8k5.pcm
-
-FATE_SIPR += fate-sipr-16k
-fate-sipr-16k: CMD = pcm -i $(TARGET_SAMPLES)/sipr/sipr_16k.rm
-fate-sipr-16k: REF = $(SAMPLES)/sipr/sipr_16k.pcm
-
-$(FATE_SIPR): CMP = oneoff
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RM, SIPR) += $(FATE_SIPR)
-fate-sipr: $(FATE_SIPR)
diff --git a/deps/libav/tests/fate/screen.mak b/deps/libav/tests/fate/screen.mak
deleted file mode 100644
index 5c30ed7..0000000
--- a/deps/libav/tests/fate/screen.mak
+++ /dev/null
@@ -1,63 +0,0 @@
-# FIXME dropped frames in this test because of coarse timebase
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, CSCD) += fate-cscd
-fate-cscd: CMD = framecrc -i $(TARGET_SAMPLES)/CSCD/sample_video.avi -an -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, DXTORY) += fate-dxtory
-fate-dxtory: CMD = framecrc -i $(TARGET_SAMPLES)/dxtory/dxtory_mic.avi
-
-FATE_FRAPS += fate-fraps-v0
-fate-fraps-v0: CMD = framecrc -i $(TARGET_SAMPLES)/fraps/Griffin_Ragdoll01-partial.avi
-
-FATE_FRAPS += fate-fraps-v1
-fate-fraps-v1: CMD = framecrc -i $(TARGET_SAMPLES)/fraps/sample-v1.avi -an
-
-FATE_FRAPS += fate-fraps-v2
-fate-fraps-v2: CMD = framecrc -i $(TARGET_SAMPLES)/fraps/test3-nosound-partial.avi
-
-FATE_FRAPS += fate-fraps-v3
-fate-fraps-v3: CMD = framecrc -i $(TARGET_SAMPLES)/fraps/psclient-partial.avi -pix_fmt rgb24
-
-FATE_FRAPS += fate-fraps-v4
-fate-fraps-v4: CMD = framecrc -i $(TARGET_SAMPLES)/fraps/WoW_2006-11-03_14-58-17-19-nosound-partial.avi
-
-FATE_FRAPS += fate-fraps-v5
-fate-fraps-v5: CMD = framecrc -i $(TARGET_SAMPLES)/fraps/fraps-v5-bouncing-balls-partial.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, FRAPS) += $(FATE_FRAPS)
-fate-fraps: $(FATE_FRAPS)
-
-FATE_TSCC += fate-tscc-15bit
-fate-tscc-15bit: CMD = framecrc -i $(TARGET_SAMPLES)/tscc/oneminute.avi -t 15 -pix_fmt rgb24
-
-FATE_TSCC += fate-tscc-32bit
-fate-tscc-32bit: CMD = framecrc -i $(TARGET_SAMPLES)/tscc/2004-12-17-uebung9-partial.avi -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TSCC) += $(FATE_TSCC)
-fate-tscc: $(FATE_TSCC)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TSCC2) += fate-tscc2
-fate-tscc2: CMD = framecrc -i $(TARGET_SAMPLES)/tscc/tsc2_16bpp.avi
-
-FATE_VMNC += fate-vmnc-16bit
-fate-vmnc-16bit: CMD = framecrc -i $(TARGET_SAMPLES)/VMnc/test.avi -pix_fmt rgb24
-
-FATE_VMNC += fate-vmnc-32bit
-fate-vmnc-32bit: CMD = framecrc -i $(TARGET_SAMPLES)/VMnc/VS2k5DebugDemo-01-partial.avi -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, VMNC) += $(FATE_VMNC)
-fate-vmnc: $(FATE_VMNC)
-
-FATE_ZMBV += fate-zmbv-8bit
-fate-zmbv-8bit: CMD = framecrc -i $(TARGET_SAMPLES)/zmbv/wc2_001-partial.avi -an -pix_fmt rgb24
-
-FATE_ZMBV += fate-zmbv-15bit
-fate-zmbv-15bit: CMD = framecrc -i $(TARGET_SAMPLES)/zmbv/zmbv_15bit.avi -pix_fmt rgb24 -t 25
-
-FATE_ZMBV += fate-zmbv-16bit
-fate-zmbv-16bit: CMD = framecrc -i $(TARGET_SAMPLES)/zmbv/zmbv_16bit.avi -pix_fmt rgb24 -t 25
-
-FATE_ZMBV += fate-zmbv-32bit
-fate-zmbv-32bit: CMD = framecrc -i $(TARGET_SAMPLES)/zmbv/zmbv_32bit.avi -pix_fmt rgb24 -t 25
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, ZMBV) += $(FATE_ZMBV)
-fate-zmbv: $(FATE_ZMBV)
diff --git a/deps/libav/tests/fate/seek.mak b/deps/libav/tests/fate/seek.mak
deleted file mode 100644
index a423711..0000000
--- a/deps/libav/tests/fate/seek.mak
+++ /dev/null
@@ -1,229 +0,0 @@
-# files from fate-acodec
-
-FATE_SEEK_ACODEC-$(call ENCDEC, ADPCM_IMA_QT,  AIFF)    += adpcm-ima_qt
-FATE_SEEK_ACODEC-$(call ENCDEC, ADPCM_IMA_WAV, WAV)     += adpcm-ima_wav
-FATE_SEEK_ACODEC-$(call ENCDEC, ADPCM_MS,      WAV)     += adpcm-ms
-FATE_SEEK_ACODEC-$(call ENCDEC, ADPCM_SWF,     FLV)     += adpcm-swf
-FATE_SEEK_ACODEC-$(call ENCDEC, ADPCM_YAMAHA,  WAV)     += adpcm-yamaha
-FATE_SEEK_ACODEC-$(call ENCDEC, ALAC,          MOV)     += alac
-FATE_SEEK_ACODEC-$(call ENCDEC, FLAC,          FLAC)    += flac
-FATE_SEEK_ACODEC-$(call ENCDEC, MP2,           MP2 MP3) += mp2
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_ALAW,      WAV)     += pcm-alaw
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_MULAW,     WAV)     += pcm-mulaw
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_S8,        MOV)     += pcm-s8
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_U8,        WAV)     += pcm-u8
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_S16BE,     MOV)     += pcm-s16be
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_S16LE,     WAV)     += pcm-s16le
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_S24BE,     MOV)     += pcm-s24be
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_S24LE,     WAV)     += pcm-s24le
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_S32BE,     MOV)     += pcm-s32be
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_S32LE,     WAV)     += pcm-s32le
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_F32BE,     AU)      += pcm-f32be
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_F32LE,     WAV)     += pcm-f32le
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_F64BE,     AU)      += pcm-f64be
-FATE_SEEK_ACODEC-$(call ENCDEC, PCM_F64LE,     WAV)     += pcm-f64le
-
-fate-seek-acodec-adpcm-ima_qt:  SRC = fate/acodec-adpcm-ima_qt.aiff
-fate-seek-acodec-adpcm-ima_wav: SRC = fate/acodec-adpcm-ima_wav.wav
-fate-seek-acodec-adpcm-ms:      SRC = fate/acodec-adpcm-ms.wav
-fate-seek-acodec-adpcm-swf:     SRC = fate/acodec-adpcm-swf.flv
-fate-seek-acodec-adpcm-yamaha:  SRC = fate/acodec-adpcm-yamaha.wav
-fate-seek-acodec-alac:          SRC = fate/acodec-alac.mov
-fate-seek-acodec-flac:          SRC = fate/acodec-flac.flac
-fate-seek-acodec-mp2:           SRC = fate/acodec-mp2.mp2
-fate-seek-acodec-pcm-alaw:      SRC = fate/acodec-pcm-alaw.wav
-fate-seek-acodec-pcm-f32be:     SRC = fate/acodec-pcm-f32be.au
-fate-seek-acodec-pcm-f32le:     SRC = fate/acodec-pcm-f32le.wav
-fate-seek-acodec-pcm-f64be:     SRC = fate/acodec-pcm-f64be.au
-fate-seek-acodec-pcm-f64le:     SRC = fate/acodec-pcm-f64le.wav
-fate-seek-acodec-pcm-mulaw:     SRC = fate/acodec-pcm-mulaw.wav
-fate-seek-acodec-pcm-s16be:     SRC = fate/acodec-pcm-s16be.mov
-fate-seek-acodec-pcm-s16le:     SRC = fate/acodec-pcm-s16le.wav
-fate-seek-acodec-pcm-s24be:     SRC = fate/acodec-pcm-s24be.mov
-fate-seek-acodec-pcm-s24le:     SRC = fate/acodec-pcm-s24le.wav
-fate-seek-acodec-pcm-s32be:     SRC = fate/acodec-pcm-s32be.mov
-fate-seek-acodec-pcm-s32le:     SRC = fate/acodec-pcm-s32le.wav
-fate-seek-acodec-pcm-s8:        SRC = fate/acodec-pcm-s8.mov
-fate-seek-acodec-pcm-u8:        SRC = fate/acodec-pcm-u8.wav
-
-FATE_SEEK += $(FATE_SEEK_ACODEC-yes:%=fate-seek-acodec-%)
-
-# files from fate-vsynth2
-
-FATE_SEEK_VSYNTH2-$(call ENCDEC, ASV1,          AVI)     += asv1
-FATE_SEEK_VSYNTH2-$(call ENCDEC, ASV2,          AVI)     += asv2
-FATE_SEEK_VSYNTH2-$(call ENCDEC, DNXHD,         DNXHD)   += dnxhd-720p
-FATE_SEEK_VSYNTH2-$(call ENCDEC, DNXHD,         DNXHD)   += dnxhd-720p-rd
-FATE_SEEK_VSYNTH2-$(call ENCDEC, DNXHD,         MOV)     += dnxhd-1080i
-FATE_SEEK_VSYNTH2-$(call ENCDEC, DVVIDEO,       DV)      += dv
-FATE_SEEK_VSYNTH2-$(call ENCDEC, DVVIDEO,       DV)      += dv-411
-FATE_SEEK_VSYNTH2-$(call ENCDEC, DVVIDEO,       DV)      += dv-50
-FATE_SEEK_VSYNTH2-$(call ENCDEC, FFV1,          AVI)     += ffv1
-FATE_SEEK_VSYNTH2-$(call ENCDEC, FLASHSV,       FLV)     += flashsv
-FATE_SEEK_VSYNTH2-$(call ENCDEC, FLV,           FLV)     += flv
-FATE_SEEK_VSYNTH2-$(call ENCDEC, H261,          AVI)     += h261
-FATE_SEEK_VSYNTH2-$(call ENCDEC, H263,          AVI)     += h263
-FATE_SEEK_VSYNTH2-$(call ENCDEC, H263,          AVI)     += h263p
-FATE_SEEK_VSYNTH2-$(call ENCDEC, HUFFYUV,       AVI)     += huffyuv
-FATE_SEEK_VSYNTH2-$(call ENCDEC, JPEGLS,        AVI)     += jpegls
-FATE_SEEK_VSYNTH2-$(call ENCDEC, LJPEG MJPEG,   AVI)     += ljpeg
-FATE_SEEK_VSYNTH2-$(call ENCDEC, MJPEG,         AVI)     += mjpeg
-
-FATE_SEEK_VSYNTH2-$(call ENCDEC, MPEG1VIDEO, MPEG1VIDEO MPEGVIDEO) +=          \
-                                                    mpeg1                      \
-                                                    mpeg1b
-
-FATE_SEEK_VSYNTH2-$(call ENCDEC, MPEG2VIDEO, MPEG2VIDEO MPEGVIDEO) +=          \
-                                                    mpeg2-422                  \
-                                                    mpeg2-idct-int             \
-                                                    mpeg2-ilace                \
-                                                    mpeg2-ivlc-qprd            \
-                                                    mpeg2-thread               \
-                                                    mpeg2-thread-ivlc
-
-FATE_SEEK_VSYNTH2-$(call ENCDEC, MPEG4,         MP4 MOV) += mpeg4
-FATE_SEEK_VSYNTH2-$(call ENCDEC, MPEG4, AVI)             += $(FATE_MPEG4_AVI)
-FATE_SEEK_VSYNTH2-$(call ENCDEC, MSMPEG4V3,     AVI)     += msmpeg4
-FATE_SEEK_VSYNTH2-$(call ENCDEC, MSMPEG4V2,     AVI)     += msmpeg4v2
-FATE_SEEK_VSYNTH2-$(call ENCDEC, RAWVIDEO,      AVI)     += rgb
-FATE_SEEK_VSYNTH2-$(call ENCDEC, ROQ,           ROQ)     += roqvideo
-FATE_SEEK_VSYNTH2-$(call ENCDEC, RV10,          RM)      += rv10
-FATE_SEEK_VSYNTH2-$(call ENCDEC, RV20,          RM)      += rv20
-FATE_SEEK_VSYNTH2-$(call ENCDEC, SVQ1,          MOV)     += svq1
-FATE_SEEK_VSYNTH2-$(call ENCDEC, WMV1,          AVI)     += wmv1
-FATE_SEEK_VSYNTH2-$(call ENCDEC, WMV2,          AVI)     += wmv2
-FATE_SEEK_VSYNTH2-$(call ENCDEC, RAWVIDEO,      AVI)     += yuv
-
-fate-seek-vsynth2-asv1:              SRC = fate/vsynth2-asv1.avi
-fate-seek-vsynth2-asv2:              SRC = fate/vsynth2-asv2.avi
-fate-seek-vsynth2-dnxhd-1080i:       SRC = fate/vsynth2-dnxhd-1080i.mov
-fate-seek-vsynth2-dnxhd-720p:        SRC = fate/vsynth2-dnxhd-720p.dnxhd
-fate-seek-vsynth2-dnxhd-720p-rd:     SRC = fate/vsynth2-dnxhd-720p.dnxhd
-fate-seek-vsynth2-dv:                SRC = fate/vsynth2-dv.dv
-fate-seek-vsynth2-dv-411:            SRC = fate/vsynth2-dv-411.dv
-fate-seek-vsynth2-dv-50:             SRC = fate/vsynth2-dv-50.dv
-fate-seek-vsynth2-ffv1:              SRC = fate/vsynth2-ffv1.avi
-fate-seek-vsynth2-flashsv:           SRC = fate/vsynth2-flashsv.flv
-fate-seek-vsynth2-flv:               SRC = fate/vsynth2-flv.flv
-fate-seek-vsynth2-h261:              SRC = fate/vsynth2-h261.avi
-fate-seek-vsynth2-h263:              SRC = fate/vsynth2-h263.avi
-fate-seek-vsynth2-h263p:             SRC = fate/vsynth2-h263p.avi
-fate-seek-vsynth2-huffyuv:           SRC = fate/vsynth2-huffyuv.avi
-fate-seek-vsynth2-jpegls:            SRC = fate/vsynth2-jpegls.avi
-fate-seek-vsynth2-ljpeg:             SRC = fate/vsynth2-ljpeg.avi
-fate-seek-vsynth2-mjpeg:             SRC = fate/vsynth2-mjpeg.avi
-fate-seek-vsynth2-mpeg1:             SRC = fate/vsynth2-mpeg1.mpeg1video
-fate-seek-vsynth2-mpeg1b:            SRC = fate/vsynth2-mpeg1b.mpeg1video
-fate-seek-vsynth2-mpeg2-422:         SRC = fate/vsynth2-mpeg2-422.mpeg2video
-fate-seek-vsynth2-mpeg2-idct-int:    SRC = fate/vsynth2-mpeg2-idct-int.mpeg2video
-fate-seek-vsynth2-mpeg2-ilace:       SRC = fate/vsynth2-mpeg2-ilace.mpeg2video
-fate-seek-vsynth2-mpeg2-ivlc-qprd:   SRC = fate/vsynth2-mpeg2-ivlc-qprd.mpeg2video
-fate-seek-vsynth2-mpeg2-thread:      SRC = fate/vsynth2-mpeg2-thread.mpeg2video
-fate-seek-vsynth2-mpeg2-thread-ivlc: SRC = fate/vsynth2-mpeg2-thread-ivlc.mpeg2video
-fate-seek-vsynth2-mpeg4:             SRC = fate/vsynth2-mpeg4.mp4
-fate-seek-vsynth2-mpeg4-adap:        SRC = fate/vsynth2-mpeg4-adap.avi
-fate-seek-vsynth2-mpeg4-adv:         SRC = fate/vsynth2-mpeg4-adv.avi
-fate-seek-vsynth2-mpeg4-error:       SRC = fate/vsynth2-mpeg4-error.avi
-fate-seek-vsynth2-mpeg4-nr:          SRC = fate/vsynth2-mpeg4-nr.avi
-fate-seek-vsynth2-mpeg4-qpel:        SRC = fate/vsynth2-mpeg4-qpel.avi
-fate-seek-vsynth2-mpeg4-qprd:        SRC = fate/vsynth2-mpeg4-qprd.avi
-fate-seek-vsynth2-mpeg4-rc:          SRC = fate/vsynth2-mpeg4-rc.avi
-fate-seek-vsynth2-mpeg4-thread:      SRC = fate/vsynth2-mpeg4-thread.avi
-fate-seek-vsynth2-msmpeg4:           SRC = fate/vsynth2-msmpeg4.avi
-fate-seek-vsynth2-msmpeg4v2:         SRC = fate/vsynth2-msmpeg4v2.avi
-fate-seek-vsynth2-rgb:               SRC = fate/vsynth2-rgb.avi
-fate-seek-vsynth2-roqvideo:          SRC = fate/vsynth2-roqvideo.roq
-fate-seek-vsynth2-rv10:              SRC = fate/vsynth2-rv10.rm
-fate-seek-vsynth2-rv20:              SRC = fate/vsynth2-rv20.rm
-fate-seek-vsynth2-svq1:              SRC = fate/vsynth2-svq1.mov
-fate-seek-vsynth2-wmv1:              SRC = fate/vsynth2-wmv1.avi
-fate-seek-vsynth2-wmv2:              SRC = fate/vsynth2-wmv2.avi
-fate-seek-vsynth2-yuv:               SRC = fate/vsynth2-yuv.avi
-
-FATE_SEEK += $(FATE_SEEK_VSYNTH2-yes:%=fate-seek-vsynth2-%)
-
-# files from fate-lavf
-
-FATE_SEEK_LAVF-$(call ENCDEC,  PCM_S16BE,             AIFF)        += aiff
-FATE_SEEK_LAVF-$(call ENCDEC,  PCM_ALAW,              PCM_ALAW)    += alaw
-FATE_SEEK_LAVF-$(call ENCDEC2, MSMPEG4V3,  MP2,       ASF)         += asf
-FATE_SEEK_LAVF-$(call ENCDEC,  PCM_S16BE,             AU)          += au
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG4,      MP2,       AVI)         += avi
-FATE_SEEK_LAVF-$(call ENCDEC,  BMP,                   IMAGE2)      += bmp
-FATE_SEEK_LAVF-$(call ENCDEC2, DVVIDEO,    PCM_S16LE, AVI)         += dv_fmt
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,       FFM)         += ffm
-FATE_SEEK_LAVF-$(call ENCDEC,  FLV,                   FLV)         += flv_fmt
-FATE_SEEK_LAVF-$(call ENCDEC,  GIF,                   IMAGE2)      += gif
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, GXF)         += gxf
-FATE_SEEK_LAVF-$(call ENCDEC,  MJPEG,                 IMAGE2)      += jpg
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG4,      MP2,       MATROSKA)    += mkv
-FATE_SEEK_LAVF-$(call ENCDEC,  ADPCM_YAMAHA,          MMF)         += mmf
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG4,      PCM_ALAW,  MOV)         += mov
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,       MPEG1SYSTEM MPEGPS) += mpg
-FATE_SEEK_LAVF-$(call ENCDEC,  PCM_MULAW,             PCM_MULAW)   += mulaw
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF)         += mxf
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF_D10 MXF) += mxf_d10
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG4,      MP2,       NUT)         += nut
-FATE_SEEK_LAVF-$(call ENCDEC,  FLAC,                  OGG)         += ogg
-FATE_SEEK_LAVF-$(call ENCDEC,  PBM,                   IMAGE2PIPE)  += pbmpipe
-FATE_SEEK_LAVF-$(call ENCDEC,  PCX,                   IMAGE2)      += pcx
-FATE_SEEK_LAVF-$(call ENCDEC,  PGM,                   IMAGE2)      += pgm
-FATE_SEEK_LAVF-$(call ENCDEC,  PGM,                   IMAGE2PIPE)  += pgmpipe
-FATE_SEEK_LAVF-$(call ENCDEC,  PPM,                   IMAGE2)      += ppm
-FATE_SEEK_LAVF-$(call ENCDEC,  PPM,                   IMAGE2PIPE)  += ppmpipe
-FATE_SEEK_LAVF-$(call ENCMUX,  RV10 AC3_FIXED,        RM)          += rm
-FATE_SEEK_LAVF-$(call ENCDEC,  SGI,                   IMAGE2)      += sgi
-FATE_SEEK_LAVF-$(call ENCDEC,  FLV,                   SWF)         += swf
-FATE_SEEK_LAVF-$(call ENCDEC,  TARGA,                 IMAGE2)      += tga
-FATE_SEEK_LAVF-$(call ENCDEC,  TIFF,                  IMAGE2)      += tiff
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG2VIDEO, MP2,       MPEGTS)      += ts
-FATE_SEEK_LAVF-$(call ENCDEC,  PCM_U8,                VOC)         += voc
-FATE_SEEK_LAVF-$(call ENCDEC,  PCM_S16LE,             WAV)         += wav
-FATE_SEEK_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER)                        += yuv4mpeg
-
-fate-seek-lavf-aiff:     SRC = lavf/lavf.aif
-fate-seek-lavf-alaw:     SRC = lavf/lavf.al
-fate-seek-lavf-asf:      SRC = lavf/lavf.asf
-fate-seek-lavf-au:       SRC = lavf/lavf.au
-fate-seek-lavf-avi:      SRC = lavf/lavf.avi
-fate-seek-lavf-bmp:      SRC = images/bmp/%02d.bmp
-fate-seek-lavf-dv_fmt:   SRC = lavf/lavf.dv
-fate-seek-lavf-ffm:      SRC = lavf/lavf.ffm
-fate-seek-lavf-flv_fmt:  SRC = lavf/lavf.flv
-fate-seek-lavf-gif:      SRC = lavf/lavf.gif
-fate-seek-lavf-gxf:      SRC = lavf/lavf.gxf
-fate-seek-lavf-jpg:      SRC = images/jpg/%02d.jpg
-fate-seek-lavf-mkv:      SRC = lavf/lavf.mkv
-fate-seek-lavf-mmf:      SRC = lavf/lavf.mmf
-fate-seek-lavf-mov:      SRC = lavf/lavf.mov
-fate-seek-lavf-mpg:      SRC = lavf/lavf.mpg
-fate-seek-lavf-mulaw:    SRC = lavf/lavf.ul
-fate-seek-lavf-mxf:      SRC = lavf/lavf.mxf
-fate-seek-lavf-mxf_d10:  SRC = lavf/lavf.mxf_d10
-fate-seek-lavf-nut:      SRC = lavf/lavf.nut
-fate-seek-lavf-ogg:      SRC = lavf/lavf.ogg
-fate-seek-lavf-pbmpipe:  SRC = lavf/pbmpipe.pbm
-fate-seek-lavf-pcx:      SRC = images/pcx/%02d.pcx
-fate-seek-lavf-pgm:      SRC = images/pgm/%02d.pgm
-fate-seek-lavf-pgmpipe:  SRC = lavf/pgmpipe.pgm
-fate-seek-lavf-ppm:      SRC = images/ppm/%02d.ppm
-fate-seek-lavf-ppmpipe:  SRC = lavf/ppmpipe.ppm
-fate-seek-lavf-rm:       SRC = lavf/lavf.rm
-fate-seek-lavf-sgi:      SRC = images/sgi/%02d.sgi
-fate-seek-lavf-swf:      SRC = lavf/lavf.swf
-fate-seek-lavf-tga:      SRC = images/tga/%02d.tga
-fate-seek-lavf-tiff:     SRC = images/tiff/%02d.tiff
-fate-seek-lavf-ts:       SRC = lavf/lavf.ts
-fate-seek-lavf-voc:      SRC = lavf/lavf.voc
-fate-seek-lavf-wav:      SRC = lavf/lavf.wav
-fate-seek-lavf-yuv4mpeg: SRC = lavf/lavf.y4m
-
-FATE_SEEK += $(FATE_SEEK_LAVF-yes:%=fate-seek-lavf-%)
-
-$(FATE_SEEK): libavformat/seek-test$(EXESUF)
-$(FATE_SEEK): CMD = run libavformat/seek-test$(EXESUF) $(TARGET_PATH)/tests/data/$(SRC)
-$(FATE_SEEK): fate-seek-%: fate-%
-fate-seek-%: REF = $(SRC_PATH)/tests/ref/seek/$(@:fate-seek-%=%)
-
-FATE_AVCONV += $(FATE_SEEK)
-fate-seek:     $(FATE_SEEK)
diff --git a/deps/libav/tests/fate/utvideo.mak b/deps/libav/tests/fate/utvideo.mak
deleted file mode 100644
index e1ef7ec..0000000
--- a/deps/libav/tests/fate/utvideo.mak
+++ /dev/null
@@ -1,72 +0,0 @@
-FATE_UTVIDEO += fate-utvideo_rgb_left
-fate-utvideo_rgb_left: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_rgb_left.avi
-
-FATE_UTVIDEO += fate-utvideo_rgb_median
-fate-utvideo_rgb_median: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_rgb_median.avi
-
-FATE_UTVIDEO += fate-utvideo_rgba_left
-fate-utvideo_rgba_left: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_rgba_left.avi
-
-FATE_UTVIDEO += fate-utvideo_rgba_median
-fate-utvideo_rgba_median: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_rgba_median.avi
-
-FATE_UTVIDEO += fate-utvideo_rgba_single_symbol
-fate-utvideo_rgba_single_symbol: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_rgba_single_symbol.avi
-
-FATE_UTVIDEO += fate-utvideo_yuv420_left
-fate-utvideo_yuv420_left: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_yuv420_left.avi
-
-FATE_UTVIDEO += fate-utvideo_yuv420_median
-fate-utvideo_yuv420_median: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_yuv420_median.avi
-
-FATE_UTVIDEO += fate-utvideo_yuv422_left
-fate-utvideo_yuv422_left: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_yuv422_left.avi
-
-FATE_UTVIDEO += fate-utvideo_yuv422_median
-fate-utvideo_yuv422_median: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_yuv422_median.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, UTVIDEO) += $(FATE_UTVIDEO)
-fate-utvideo: $(FATE_UTVIDEO)
-
-fate-utvideoenc%: CMD = framemd5 -f image2 -vcodec pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -vcodec utvideo -slices 1 -f avi -sws_flags +accurate_rnd+bitexact ${OPTS}
-
-FATE_UTVIDEOENC += fate-utvideoenc_rgba_left
-fate-utvideoenc_rgba_left: OPTS = -pix_fmt rgba -pred left
-
-FATE_UTVIDEOENC += fate-utvideoenc_rgba_median
-fate-utvideoenc_rgba_median: OPTS = -pix_fmt rgba -pred median
-
-FATE_UTVIDEOENC += fate-utvideoenc_rgba_none
-fate-utvideoenc_rgba_none: OPTS = -pix_fmt rgba -pred 3
-
-FATE_UTVIDEOENC += fate-utvideoenc_rgb_left
-fate-utvideoenc_rgb_left: OPTS = -pix_fmt rgb24 -pred left
-
-FATE_UTVIDEOENC += fate-utvideoenc_rgb_median
-fate-utvideoenc_rgb_median: OPTS = -pix_fmt rgb24 -pred median
-
-FATE_UTVIDEOENC += fate-utvideoenc_rgb_none
-fate-utvideoenc_rgb_none: OPTS = -pix_fmt rgb24 -pred 3
-
-FATE_UTVIDEOENC += fate-utvideoenc_yuv420_left
-fate-utvideoenc_yuv420_left: OPTS = -pix_fmt yuv420p -pred left
-
-FATE_UTVIDEOENC += fate-utvideoenc_yuv420_median
-fate-utvideoenc_yuv420_median: OPTS = -pix_fmt yuv420p -pred median
-
-FATE_UTVIDEOENC += fate-utvideoenc_yuv420_none
-fate-utvideoenc_yuv420_none: OPTS = -pix_fmt yuv420p -pred 3
-
-FATE_UTVIDEOENC += fate-utvideoenc_yuv422_left
-fate-utvideoenc_yuv422_left: OPTS = -pix_fmt yuv422p -pred left
-
-FATE_UTVIDEOENC += fate-utvideoenc_yuv422_median
-fate-utvideoenc_yuv422_median: OPTS = -pix_fmt yuv422p -pred median
-
-FATE_UTVIDEOENC += fate-utvideoenc_yuv422_none
-fate-utvideoenc_yuv422_none: OPTS = -pix_fmt yuv422p -pred 3
-
-$(FATE_UTVIDEOENC): $(VREF)
-
-FATE_AVCONV-$(call ENCMUX, UTVIDEO, AVI) += $(FATE_UTVIDEOENC)
-fate-utvideoenc: $(FATE_UTVIDEOENC)
diff --git a/deps/libav/tests/fate/vcodec.mak b/deps/libav/tests/fate/vcodec.mak
deleted file mode 100644
index ed9fa2e..0000000
--- a/deps/libav/tests/fate/vcodec.mak
+++ /dev/null
@@ -1,237 +0,0 @@
-fate-vsynth1-%: SRC = tests/data/vsynth1.yuv
-fate-vsynth2-%: SRC = tests/data/vsynth2.yuv
-fate-vsynth%: CODEC = $(word 3, $(subst -, ,$(@)))
-fate-vsynth%: FMT = avi
-fate-vsynth%: CMD = enc_dec "rawvideo -s 352x288 -pix_fmt yuv420p" $(SRC) $(FMT) "-c $(CODEC) $(ENCOPTS)" rawvideo "-s 352x288 -pix_fmt yuv420p $(DECOPTS)" -keep
-fate-vsynth%: CMP_UNIT = 1
-fate-vsynth%: REF = $(SRC_PATH)/tests/ref/vsynth/$(@:fate-%=%)
-
-FATE_VCODEC-$(call ENCDEC, ASV1, AVI)   += asv1
-fate-vsynth%-asv1:               ENCOPTS = -qscale 10
-
-FATE_VCODEC-$(call ENCDEC, ASV2, AVI)   += asv2
-fate-vsynth%-asv2:               ENCOPTS = -qscale 10
-
-FATE_VCODEC-$(call ENCDEC, CLJR, AVI)   += cljr
-
-FATE_VCODEC-$(call ENCDEC, DNXHD, DNXHD) += dnxhd-720p                  \
-                                            dnxhd-720p-rd               \
-                                            dnxhd-720p-10bit
-
-fate-vsynth%-dnxhd-720p:         ENCOPTS = -s hd720 -b 90M              \
-                                           -pix_fmt yuv422p -frames 5
-fate-vsynth%-dnxhd-720p:         FMT     = dnxhd
-
-fate-vsynth%-dnxhd-720p-rd:      ENCOPTS = -s hd720 -b 90M -threads 4 -mbd rd \
-                                           -pix_fmt yuv422p -frames 5
-fate-vsynth%-dnxhd-720p-rd:      FMT     = dnxhd
-
-fate-vsynth%-dnxhd-720p-10bit:   ENCOPTS = -s hd720 -b 90M              \
-                                           -pix_fmt yuv422p10 -frames 5
-fate-vsynth%-dnxhd-720p-10bit:   FMT     = dnxhd
-
-FATE_VCODEC-$(call ENCDEC, DNXHD, MOV)  += dnxhd-1080i
-fate-vsynth%-dnxhd-1080i:        ENCOPTS = -s hd1080 -b 120M -flags +ildct \
-                                           -pix_fmt yuv422p -frames 5
-fate-vsynth%-dnxhd-1080i:        FMT     = mov
-
-FATE_VCODEC-$(call ENCDEC, DVVIDEO, DV) += dv dv-411 dv-50
-fate-vsynth%-dv:                 CODEC   = dvvideo
-fate-vsynth%-dv:                 ENCOPTS = -dct int -s pal
-fate-vsynth%-dv:                 FMT     = dv
-
-fate-vsynth%-dv-411:             CODEC   = dvvideo
-fate-vsynth%-dv-411:             ENCOPTS = -dct int -s pal -pix_fmt yuv411p \
-                                           -sws_flags area
-fate-vsynth%-dv-411:             DECOPTS = -sws_flags area
-fate-vsynth%-dv-411:             FMT     = dv
-
-fate-vsynth%-dv-50:              CODEC   = dvvideo
-fate-vsynth%-dv-50:              ENCOPTS = -dct int -s pal -pix_fmt yuv422p \
-                                           -sws_flags neighbor
-fate-vsynth%-dv-50:              DECOPTS = -sws_flags neighbor
-fate-vsynth%-dv-50:              FMT     = dv
-
-FATE_VCODEC-$(call ENCDEC, FFV1, AVI)   += ffv1
-fate-vsynth%-ffv1:               ENCOPTS = -slices 4 -strict -2
-
-FATE_VCODEC-$(call ENCDEC, FFVHUFF, AVI) += ffvhuff
-
-FATE_VCODEC-$(call ENCDEC, FLASHSV, FLV) += flashsv
-fate-vsynth%-flashsv:            ENCOPTS = -sws_flags neighbor+full_chroma_int
-fate-vsynth%-flashsv:            DECOPTS = -sws_flags area
-fate-vsynth%-flashsv:            FMT     = flv
-
-FATE_VCODEC-$(call ENCDEC, FLV, FLV)    += flv
-fate-vsynth%-flv:                ENCOPTS = -qscale 10
-fate-vsynth%-flv:                FMT     = flv
-
-FATE_VCODEC-$(call ENCDEC, H261, AVI)   += h261
-fate-vsynth%-h261:               ENCOPTS = -qscale 11
-
-FATE_VCODEC-$(call ENCDEC, H263, AVI)   += h263 h263-obmc h263p
-fate-vsynth%-h263:               ENCOPTS = -qscale 10
-fate-vsynth%-h263-obmc:          ENCOPTS = -qscale 10 -obmc 1
-fate-vsynth%-h263p:              ENCOPTS = -qscale 2 -flags +aic -umv 1 -aiv 1 -ps 300
-
-FATE_VCODEC-$(call ENCDEC, HUFFYUV, AVI) += huffyuv
-fate-vsynth%-huffyuv:            ENCOPTS = -pix_fmt yuv422p -sws_flags neighbor
-fate-vsynth%-huffyuv:            DECOPTS = -strict -2 -sws_flags neighbor
-
-FATE_VCODEC-$(call ENCDEC, JPEGLS, AVI) += jpegls
-fate-vsynth%-jpegls:             ENCOPTS = -sws_flags neighbor+full_chroma_int
-fate-vsynth%-jpegls:             DECOPTS = -sws_flags area
-
-FATE_VCODEC-$(call ENCDEC, LJPEG MJPEG, AVI) += ljpeg
-fate-vsynth%-ljpeg:              ENCOPTS = -strict -1
-
-FATE_VCODEC-$(call ENCDEC, MJPEG, AVI)  += mjpeg
-fate-vsynth%-mjpeg:              ENCOPTS = -qscale 9 -pix_fmt yuvj420p
-
-FATE_VCODEC-$(call ENCDEC, MPEG1VIDEO, MPEG1VIDEO MPEGVIDEO) += mpeg1 mpeg1b
-fate-vsynth%-mpeg1:              FMT     = mpeg1video
-fate-vsynth%-mpeg1:              CODEC   = mpeg1video
-fate-vsynth%-mpeg1:              ENCOPTS = -qscale 10
-
-fate-vsynth%-mpeg1b:             CODEC   = mpeg1video
-fate-vsynth%-mpeg1b:             ENCOPTS = -qscale 8 -bf 3 -ps 200
-fate-vsynth%-mpeg1b:             FMT     = mpeg1video
-
-FATE_MPEG2 = mpeg2                                                      \
-             mpeg2-422                                                  \
-             mpeg2-idct-int                                             \
-             mpeg2-ilace                                                \
-             mpeg2-ivlc-qprd                                            \
-             mpeg2-thread                                               \
-             mpeg2-thread-ivlc
-
-FATE_VCODEC-$(call ENCDEC, MPEG2VIDEO, MPEG2VIDEO MPEGVIDEO) += $(FATE_MPEG2)
-
-$(FATE_MPEG2:%=fate-vsynth\%-%): FMT    = mpeg2video
-$(FATE_MPEG2:%=fate-vsynth\%-%): CODEC  = mpeg2video
-
-fate-vsynth%-mpeg2:              ENCOPTS = -qscale 10
-fate-vsynth%-mpeg2-422:          ENCOPTS = -b:v 1000k                   \
-                                           -bf 2                        \
-                                           -trellis 1                   \
-                                           -flags +mv0+ildct+ilme       \
-                                           -mpv_flags +qp_rd            \
-                                           -intra_vlc 1                 \
-                                           -mbd rd                      \
-                                           -pix_fmt yuv422p
-fate-vsynth%-mpeg2-idct-int:     ENCOPTS = -qscale 10 -idct int -dct int
-fate-vsynth%-mpeg2-ilace:        ENCOPTS = -qscale 10 -flags +ildct+ilme
-fate-vsynth%-mpeg2-ivlc-qprd:    ENCOPTS = -b:v 500k                    \
-                                           -bf 2                        \
-                                           -trellis 1                   \
-                                           -flags +mv0                  \
-                                           -mpv_flags +qp_rd            \
-                                           -intra_vlc 1                 \
-                                           -cmp 2 -subcmp 2             \
-                                           -mbd rd
-fate-vsynth%-mpeg2-thread:       ENCOPTS = -qscale 10 -bf 2 -flags +ildct+ilme \
-                                           -threads 2 -slices 2
-fate-vsynth%-mpeg2-thread-ivlc:  ENCOPTS = -qscale 10 -bf 2 -flags +ildct+ilme \
-                                           -intra_vlc 1 -threads 2 -slices 2
-
-FATE_MPEG4_MP4 = mpeg4
-FATE_MPEG4_AVI = mpeg4-rc                                               \
-                 mpeg4-adv                                              \
-                 mpeg4-qprd                                             \
-                 mpeg4-adap                                             \
-                 mpeg4-qpel                                             \
-                 mpeg4-thread                                           \
-                 mpeg4-error                                            \
-                 mpeg4-nr
-
-FATE_VCODEC-$(call ENCDEC, MPEG4, MP4 MOV) += $(FATE_MPEG4_MP4)
-FATE_VCODEC-$(call ENCDEC, MPEG4, AVI)     += $(FATE_MPEG4_AVI)
-
-fate-vsynth%-mpeg4:              ENCOPTS = -qscale 10 -flags +mv4 -mbd bits
-fate-vsynth%-mpeg4:              FMT     = mp4
-
-fate-vsynth%-mpeg4-adap:         ENCOPTS = -b 550k -bf 2 -flags +mv4+mv0 \
-                                           -trellis 1 -cmp 1 -subcmp 2   \
-                                           -mbd rd -scplx_mask 0.3
-
-fate-vsynth%-mpeg4-adv:          ENCOPTS = -qscale 9 -flags +mv4+aic       \
-                                           -data_partitioning 1 -trellis 1 \
-                                           -mbd bits -ps 200
-
-fate-vsynth%-mpeg4-error:        ENCOPTS = -qscale 7 -flags +mv4+aic    \
-                                           -data_partitioning 1 -mbd rd \
-                                           -ps 250 -error 10
-
-fate-vsynth%-mpeg4-nr:           ENCOPTS = -qscale 8 -flags +mv4 -mbd rd -nr 200
-
-fate-vsynth%-mpeg4-qpel:         ENCOPTS = -qscale 7 -flags +mv4+qpel -mbd 2 \
-                                           -bf 2 -cmp 1 -subcmp 2
-
-fate-vsynth%-mpeg4-qprd:         ENCOPTS = -b 450k -bf 2 -trellis 1          \
-                                           -flags +mv4+mv0 -mpv_flags +qp_rd \
-                                           -cmp 2 -subcmp 2 -mbd rd
-
-fate-vsynth%-mpeg4-rc:           ENCOPTS = -b 400k -bf 2
-
-fate-vsynth%-mpeg4-thread:       ENCOPTS = -b 500k -flags +mv4+aic         \
-                                           -data_partitioning 1 -trellis 1 \
-                                           -mbd bits -ps 200 -bf 2         \
-                                           -threads 2 -slices 2
-
-FATE_VCODEC-$(call ENCDEC, MSMPEG4V3, AVI) += msmpeg4
-fate-vsynth%-msmpeg4:            ENCOPTS = -qscale 10
-
-FATE_VCODEC-$(call ENCDEC, MSMPEG4V2, AVI) += msmpeg4v2
-fate-vsynth%-msmpeg4v2:          ENCOPTS = -qscale 10
-
-FATE_VCODEC-$(call ENCDEC, PRORES, MOV) += prores
-fate-vsynth%-prores:             ENCOPTS = -profile hq
-fate-vsynth%-prores:             FMT     = mov
-
-FATE_VCODEC-$(call ENCDEC, QTRLE, MOV)  += qtrle
-fate-vsynth%-qtrle:              FMT     = mov
-
-FATE_VCODEC-$(call ENCDEC, RAWVIDEO, AVI) += rgb
-fate-vsynth%-rgb:                CODEC   = rawvideo
-fate-vsynth%-rgb:                ENCOPTS = -pix_fmt bgr24
-
-FATE_VCODEC-$(call ENCDEC, ROQ, ROQ)    += roqvideo
-fate-vsynth%-roqvideo:           CODEC   = roqvideo
-fate-vsynth%-roqvideo:           ENCOPTS = -frames 5
-fate-vsynth%-roqvideo:           FMT     = roq
-
-FATE_VCODEC-$(call ENCDEC, RV10, RM)    += rv10
-fate-vsynth%-rv10:               ENCOPTS = -qscale 10
-fate-vsynth%-rv10:               FMT     = rm
-
-FATE_VCODEC-$(call ENCDEC, RV20, RM)    += rv20
-fate-vsynth%-rv20:               ENCOPTS = -qscale 10
-fate-vsynth%-rv20:               FMT     = rm
-
-FATE_VCODEC-$(call ENCDEC, SVQ1, MOV)   += svq1
-fate-vsynth%-svq1:               ENCOPTS = -qscale 3 -pix_fmt yuv410p
-fate-vsynth%-svq1:               FMT     = mov
-
-FATE_VCODEC-$(call ENCDEC, V210, AVI)   += v210
-
-FATE_VCODEC-$(call ENCDEC, WMV1, AVI)   += wmv1
-fate-vsynth%-wmv1:               ENCOPTS = -qscale 10
-
-FATE_VCODEC-$(call ENCDEC, WMV2, AVI)   += wmv2
-fate-vsynth%-wmv2:               ENCOPTS = -qscale 10
-
-FATE_VCODEC-$(call ENCDEC, RAWVIDEO, AVI) += yuv
-fate-vsynth%-yuv:                CODEC = rawvideo
-
-FATE_VCODEC += $(FATE_VCODEC-yes)
-FATE_VSYNTH1 = $(FATE_VCODEC:%=fate-vsynth1-%)
-FATE_VSYNTH2 = $(FATE_VCODEC:%=fate-vsynth2-%)
-
-$(FATE_VSYNTH1): tests/data/vsynth1.yuv
-$(FATE_VSYNTH2): tests/data/vsynth2.yuv
-
-FATE_AVCONV += $(FATE_VSYNTH1) $(FATE_VSYNTH2)
-
-fate-vsynth1: $(FATE_VSYNTH1)
-fate-vsynth2: $(FATE_VSYNTH2)
-fate-vcodec:  fate-vsynth1 fate-vsynth2
diff --git a/deps/libav/tests/fate/video.mak b/deps/libav/tests/fate/video.mak
deleted file mode 100644
index 34b385a..0000000
--- a/deps/libav/tests/fate/video.mak
+++ /dev/null
@@ -1,277 +0,0 @@
-FATE_4XM += fate-4xm-1
-fate-4xm-1: CMD = framecrc -i $(TARGET_SAMPLES)/4xm/version1.4xm -pix_fmt rgb24 -an
-
-FATE_4XM += fate-4xm-2
-fate-4xm-2: CMD = framecrc -i $(TARGET_SAMPLES)/4xm/version2.4xm -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, FOURXM, FOURXM) += $(FATE_4XM)
-fate-4xm: $(FATE_4XM)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, AASC) += fate-aasc
-fate-aasc: CMD = framecrc -i $(TARGET_SAMPLES)/aasc/AASC-1.5MB.AVI -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MM, MMVIDEO) += fate-alg-mm
-fate-alg-mm: CMD = framecrc -i $(TARGET_SAMPLES)/alg-mm/ibmlogo.mm -an -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, AMV) += fate-amv
-fate-amv: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/amv/MTV_high_res_320x240_sample_Penguin_Joke_MTV_from_WMV.amv -t 10 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, TTY, ANSI) += fate-ansi
-fate-ansi: CMD = framecrc -chars_per_frame 44100 -i $(TARGET_SAMPLES)/ansi/TRE-IOM5.ANS -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RPL, ESCAPE124) += fate-armovie-escape124
-fate-armovie-escape124: CMD = framecrc -i $(TARGET_SAMPLES)/rpl/ESCAPE.RPL -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RPL, ESCAPE130) += fate-armovie-escape130
-fate-armovie-escape130: CMD = framecrc -i $(TARGET_SAMPLES)/rpl/landing.rpl -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, AURA) += fate-auravision-v1
-fate-auravision-v1: CMD = framecrc -i $(TARGET_SAMPLES)/auravision/SOUVIDEO.AVI -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, AURA2) += fate-auravision-v2
-fate-auravision-v2: CMD = framecrc -i $(TARGET_SAMPLES)/auravision/salma-hayek-in-ugly-betty-partial-avi -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, BETHSOFTVID, BETHSOFTVID) += fate-bethsoft-vid
-fate-bethsoft-vid: CMD = framecrc -i $(TARGET_SAMPLES)/bethsoft-vid/ANIM0001.VID -t 5 -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, BFI, BFI) += fate-bfi
-fate-bfi: CMD = framecrc -i $(TARGET_SAMPLES)/bfi/2287.bfi -pix_fmt rgb24
-
-FATE_BINK_VIDEO += fate-bink-video-b
-fate-bink-video-b: CMD = framecrc -i $(TARGET_SAMPLES)/bink/RISE.BIK -frames 30
-
-FATE_BINK_VIDEO += fate-bink-video-f
-fate-bink-video-f: CMD = framecrc -i $(TARGET_SAMPLES)/bink/hol2br.bik
-
-FATE_BINK_VIDEO += fate-bink-video-i
-fate-bink-video-i: CMD = framecrc -i $(TARGET_SAMPLES)/bink/RazOnBull.bik -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, BINK, BINK) += $(FATE_BINK_VIDEO)
-fate-bink-video: $(FATE_BINK_VIDEO)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, BMV, BMV_VIDEO) += fate-bmv-video
-fate-bmv-video: CMD = framecrc -i $(TARGET_SAMPLES)/bmv/SURFING-partial.BMV -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MPEGPS, CAVS) += fate-cavs
-fate-cavs: CMD = framecrc -i $(TARGET_SAMPLES)/cavs/cavs.mpg -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, CDG, CDGRAPHICS) += fate-cdgraphics
-fate-cdgraphics: CMD = framecrc -i $(TARGET_SAMPLES)/cdgraphics/BrotherJohn.cdg -pix_fmt rgb24 -t 1
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, CLJR) += fate-cljr
-fate-cljr: CMD = framecrc -i $(TARGET_SAMPLES)/cljr/testcljr-partial.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, PNG) += fate-corepng
-fate-corepng: CMD = framecrc -i $(TARGET_SAMPLES)/png1/corepng-partial.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVS, AVS) += fate-creatureshock-avs
-fate-creatureshock-avs: CMD = framecrc -i $(TARGET_SAMPLES)/creatureshock-avs/OUTATIME.AVS -pix_fmt rgb24
-
-FATE_CVID-$(CONFIG_MOV_DEMUXER) += fate-cvid-palette
-fate-cvid-palette: CMD = framecrc -i $(TARGET_SAMPLES)/cvid/catfight-cvid-pal8-partial.mov -pix_fmt rgb24 -an
-
-FATE_CVID-$(CONFIG_AVI_DEMUXER) += fate-cvid-partial
-fate-cvid-partial: CMD = framecrc -i $(TARGET_SAMPLES)/cvid/laracroft-cinepak-partial.avi -an
-
-FATE_CVID-$(CONFIG_AVI_DEMUXER) += fate-cvid-grayscale
-fate-cvid-grayscale: CMD = framecrc -i $(TARGET_SAMPLES)/cvid/pcitva15.avi -an
-
-FATE_SAMPLES_AVCONV-$(CONFIG_CINEPAK_DECODER) += $(FATE_CVID-yes)
-fate-cvid: $(FATE_CVID-yes)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, C93, C93) += fate-cyberia-c93
-fate-cyberia-c93: CMD = framecrc -i $(TARGET_SAMPLES)/cyberia-c93/intro1.c93 -t 3 -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, CYUV) += fate-cyuv
-fate-cyuv: CMD = framecrc -i $(TARGET_SAMPLES)/cyuv/cyuv.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, DSICIN, DSICINVIDEO) += fate-delphine-cin-video
-fate-delphine-cin-video: CMD = framecrc -i $(TARGET_SAMPLES)/delphine-cin/LOGO-partial.CIN -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, ANM, ANM) += fate-deluxepaint-anm
-fate-deluxepaint-anm: CMD = framecrc -i $(TARGET_SAMPLES)/deluxepaint-anm/INTRO1.ANM -pix_fmt rgb24
-
-FATE_TRUEMOTION1 += fate-truemotion1-15
-fate-truemotion1-15: CMD = framecrc -i $(TARGET_SAMPLES)/duck/phant2-940.duk -pix_fmt rgb24 -an
-
-FATE_TRUEMOTION1 += fate-truemotion1-24
-fate-truemotion1-24: CMD = framecrc -i $(TARGET_SAMPLES)/duck/sonic3dblast_intro-partial.avi -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TRUEMOTION1) += $(FATE_TRUEMOTION1)
-fate-truemotion1: $(FATE_TRUEMOTION1)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TRUEMOTION2) += fate-truemotion2
-fate-truemotion2: CMD = framecrc -i $(TARGET_SAMPLES)/duck/tm20.avi
-
-FATE_DXA += fate-dxa-feeble
-fate-dxa-feeble: CMD = framecrc -i $(TARGET_SAMPLES)/dxa/meetsquid.dxa -t 2 -pix_fmt rgb24 -an
-
-FATE_DXA += fate-dxa-scummvm
-fate-dxa-scummvm: CMD = framecrc -i $(TARGET_SAMPLES)/dxa/scummvm.dxa -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, DXA, DXA) += $(FATE_DXA)
-fate-dxa: $(FATE_DXA)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, SEGAFILM, CINEPAK) += fate-film-cvid
-fate-film-cvid: CMD = framecrc -i $(TARGET_SAMPLES)/film/logo-capcom.cpk -an
-
-FATE_FLIC += fate-flic-af11-palette-change
-fate-flic-af11-palette-change: CMD = framecrc -i $(TARGET_SAMPLES)/fli/fli-engines.fli -t 3.3 -pix_fmt rgb24
-
-FATE_FLIC += fate-flic-af12
-fate-flic-af12: CMD = framecrc -i $(TARGET_SAMPLES)/fli/jj00c2.fli -pix_fmt rgb24
-
-FATE_FLIC += fate-flic-magiccarpet
-fate-flic-magiccarpet: CMD = framecrc -i $(TARGET_SAMPLES)/fli/intel.dat -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, FLIC, FLIC) += $(FATE_FLIC)
-fate-flic: $(FATE_FLIC)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, FRWU) += fate-frwu
-fate-frwu: CMD = framecrc -i $(TARGET_SAMPLES)/frwu/frwu.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, IDCIN, IDCIN) += fate-id-cin-video
-fate-id-cin-video: CMD = framecrc -i $(TARGET_SAMPLES)/idcin/idlog-2MB.cin -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call ENCDEC, ROQ PGMYUV, ROQ IMAGE2) += fate-idroq-video-encode
-fate-idroq-video-encode: CMD = md5 -f image2 -vcodec pgmyuv -i $(TARGET_SAMPLES)/ffmpeg-synthetic/vsynth1/%02d.pgm -sws_flags +bitexact -vf pad=512:512:80:112 -f roq -t 0.2
-
-FATE_IFF-$(CONFIG_IFF_BYTERUN1_DECODER) += fate-iff-byterun1
-fate-iff-byterun1: CMD = framecrc -i $(TARGET_SAMPLES)/iff/ASH.LBM -pix_fmt rgb24
-
-FATE_IFF-$(CONFIG_EIGHTSVX_FIB_DECODER) += fate-iff-fibonacci
-fate-iff-fibonacci: CMD = md5 -i $(TARGET_SAMPLES)/iff/dasboot-in-compressed -f s16le
-
-FATE_IFF-$(CONFIG_IFF_ILBM_DECODER) += fate-iff-ilbm
-fate-iff-ilbm: CMD = framecrc -i $(TARGET_SAMPLES)/iff/lms-matriks.ilbm -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(CONFIG_IFF_DEMUXER)  += $(FATE_IFF-yes)
-fate-iff: $(FATE_IFF-yes)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, IPMOVIE, INTERPLAY_VIDEO) += fate-interplay-mve-8bit
-fate-interplay-mve-8bit: CMD = framecrc -i $(TARGET_SAMPLES)/interplay-mve/interplay-logo-2MB.mve -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, IPMOVIE, INTERPLAY_VIDEO) += fate-interplay-mve-16bit
-fate-interplay-mve-16bit: CMD = framecrc -i $(TARGET_SAMPLES)/interplay-mve/descent3-level5-16bit-partial.mve -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MXF, JPEG2000) += fate-jpeg2000-dcinema
-fate-jpeg2000-dcinema: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/jpeg2000/chiens_dcinema2K.mxf -pix_fmt xyz12le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, JV, JV) += fate-jv
-fate-jv: CMD = framecrc -i $(TARGET_SAMPLES)/jv/intro.jv -an -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, KGV1) += fate-kgv1
-fate-kgv1: CMD = framecrc -i $(TARGET_SAMPLES)/kega/kgv1.avi -pix_fmt rgb555le -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, KMVC) += fate-kmvc
-fate-kmvc: CMD = framecrc -i $(TARGET_SAMPLES)/KMVC/LOGO1.AVI -an -t 3 -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, EA, MDEC) += fate-mdec
-fate-mdec: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/ea-dct/NFS2Esprit-partial.dct -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, STR, MDEC) += fate-mdec-v3
-fate-mdec-v3: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/psx-str/abc000_cut.str -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MSNWC_TCP, MIMIC) += fate-mimic
-fate-mimic: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/mimic/mimic2-womanloveffmpeg.cam
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, MJPEGB) += fate-mjpegb
-fate-mjpegb: CMD = framecrc -idct simple -flags +bitexact -i $(TARGET_SAMPLES)/mjpegb/mjpegb_part.mov -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MVI, MOTIONPIXELS) += fate-motionpixels
-fate-motionpixels: CMD = framecrc -i $(TARGET_SAMPLES)/motion-pixels/INTRO-partial.MVI -an -pix_fmt rgb24 -vframes 111
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MPEGTS, MPEG2VIDEO) += fate-mpeg2-field-enc
-fate-mpeg2-field-enc: CMD = framecrc -flags +bitexact -idct simple -i $(TARGET_SAMPLES)/mpeg2/mpeg2_field_encoding.ts -an -vframes 30
-
-# FIXME dropped frames in this test because of coarse timebase
-FATE_NUV += fate-nuv-rtjpeg
-fate-nuv-rtjpeg: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/nuv/Today.nuv -an
-
-FATE_NUV += fate-nuv-rtjpeg-fh
-fate-nuv-rtjpeg-fh: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/nuv/rtjpeg_frameheader.nuv -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, NUV, NUV) += $(FATE_NUV)
-fate-nuv: $(FATE_NUV)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, QPEG) += fate-qpeg
-fate-qpeg: CMD = framecrc -i $(TARGET_SAMPLES)/qpeg/Clock.avi -an -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, R210) += fate-r210
-fate-r210: CMD = framecrc -i $(TARGET_SAMPLES)/r210/r210.avi -pix_fmt rgb48le
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, RL2, RL2) += fate-rl2
-fate-rl2: CMD = framecrc -i $(TARGET_SAMPLES)/rl2/Z4915300.RL2 -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, ROQ, ROQ) += fate-roqvideo
-fate-roqvideo: CMD = framecrc -i $(TARGET_SAMPLES)/idroq/idlogo.roq -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, VMD, VMDVIDEO) += fate-sierra-vmd-video
-fate-sierra-vmd-video: CMD = framecrc -i $(TARGET_SAMPLES)/vmd/12.vmd -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, SMACKER, SMACKER) += fate-smacker-video
-fate-smacker-video: CMD = framecrc -i $(TARGET_SAMPLES)/smacker/wetlogo.smk -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, SMC) += fate-smc
-fate-smc: CMD = framecrc -i $(TARGET_SAMPLES)/smc/cass_schi.qt -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, SP5X) += fate-sp5x
-fate-sp5x: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/sp5x/sp5x_problem.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, SRT, SRT) += fate-sub-srt
-fate-sub-srt: CMD = md5 -i $(TARGET_SAMPLES)/sub/SubRip_capability_tester.srt -f ass
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, THP, THP) += fate-thp
-fate-thp: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/thp/pikmin2-opening1-partial.thp -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, TIERTEXSEQ, TIERTEXSEQVIDEO) += fate-tiertex-seq
-fate-tiertex-seq: CMD = framecrc -i $(TARGET_SAMPLES)/tiertex-seq/Gameover.seq -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, TMV, TMV) += fate-tmv
-fate-tmv: CMD = framecrc -i $(TARGET_SAMPLES)/tmv/pop-partial.tmv -pix_fmt rgb24
-
-FATE_TXD += fate-txd-16bpp
-fate-txd-16bpp: CMD = framecrc -i $(TARGET_SAMPLES)/txd/misc.txd -pix_fmt bgra -an
-
-FATE_TXD += fate-txd-pal8
-fate-txd-pal8: CMD = framecrc -i $(TARGET_SAMPLES)/txd/outro.txd -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, TXD, TXD) += $(FATE_TXD)
-fate-txd: $(FATE_TXD)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, ULTI) += fate-ulti
-fate-ulti: CMD = framecrc -i $(TARGET_SAMPLES)/ulti/hit12w.avi -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, V210) += fate-v210
-fate-v210: CMD = framecrc -i $(TARGET_SAMPLES)/v210/v210_720p-partial.avi -pix_fmt yuv422p16be -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, V410) += fate-v410dec
-fate-v410dec: CMD = framecrc -i $(TARGET_SAMPLES)/v410/lenav410.mov -pix_fmt yuv444p10le
-
-FATE_SAMPLES_AVCONV-$(call ENCDEC, V410 PGMYUV, AVI IMAGE2) += fate-v410enc
-fate-v410enc: $(VREF)
-fate-v410enc: CMD = md5 -f image2 -vcodec pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -flags +bitexact -vcodec v410 -f avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, SIFF, VB) += fate-vb
-fate-vb: CMD = framecrc -i $(TARGET_SAMPLES)/SIFF/INTRO_B.VB -t 3 -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, VCR1) += fate-vcr1
-fate-vcr1: CMD = framecrc -i $(TARGET_SAMPLES)/vcr1/VCR1test.avi -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, XL) += fate-videoxl
-fate-videoxl: CMD = framecrc -i $(TARGET_SAMPLES)/vixl/pig-vixl.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, WSVQA, VQA) += fate-vqa-cc
-fate-vqa-cc: CMD = framecrc -i $(TARGET_SAMPLES)/vqa/cc-demo1-partial.vqa -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, WC3, XAN_WC3) += fate-wc3movie-xan
-fate-wc3movie-xan: CMD = framecrc -i $(TARGET_SAMPLES)/wc3movie/SC_32-part.MVE -pix_fmt rgb24
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, WNV1) += fate-wnv1
-fate-wnv1: CMD = framecrc -i $(TARGET_SAMPLES)/wnv1/wnv1-codec.avi -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, YOP, YOP) += fate-yop
-fate-yop: CMD = framecrc -i $(TARGET_SAMPLES)/yop/test1.yop -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, XAN_WC4) += fate-xxan-wc4
-fate-xxan-wc4: CMD = framecrc -i $(TARGET_SAMPLES)/wc4-xan/wc4trailer-partial.avi -an
diff --git a/deps/libav/tests/fate/voice.mak b/deps/libav/tests/fate/voice.mak
deleted file mode 100644
index 975936c..0000000
--- a/deps/libav/tests/fate/voice.mak
+++ /dev/null
@@ -1,74 +0,0 @@
-FATE_G722 += fate-g722dec-1
-fate-g722dec-1: CMD = framecrc -i $(TARGET_SAMPLES)/g722/conf-adminmenu-162.g722
-
-FATE_G722 += fate-g722-encode
-fate-g722-encode: tests/data/asynth-16000-1.wav
-fate-g722-encode: SRC = tests/data/asynth-16000-1.wav
-fate-g722-encode: CMD = enc_dec_pcm wav md5 s16le $(SRC) -c:a g722
-
-FATE_SAMPLES_AVCONV += $(FATE_G722)
-fate-g722: $(FATE_G722)
-
-FATE_G723_1 += fate-g723_1-dec-1
-fate-g723_1-dec-1: CMD = framecrc -postfilter 0 -i $(TARGET_SAMPLES)/g723_1/ineqd53.tco
-
-FATE_G723_1 += fate-g723_1-dec-2
-fate-g723_1-dec-2: CMD = framecrc -postfilter 0 -i $(TARGET_SAMPLES)/g723_1/overd53.tco
-
-FATE_G723_1 += fate-g723_1-dec-3
-fate-g723_1-dec-3: CMD = framecrc -postfilter 1 -i $(TARGET_SAMPLES)/g723_1/overd63p.tco
-
-FATE_G723_1 += fate-g723_1-dec-4
-fate-g723_1-dec-4: CMD = framecrc -postfilter 0 -i $(TARGET_SAMPLES)/g723_1/pathd53.tco
-
-FATE_G723_1 += fate-g723_1-dec-5
-fate-g723_1-dec-5: CMD = framecrc -postfilter 1 -i $(TARGET_SAMPLES)/g723_1/pathd63p.tco
-
-FATE_G723_1 += fate-g723_1-dec-6
-fate-g723_1-dec-6: CMD = framecrc -postfilter 1 -i $(TARGET_SAMPLES)/g723_1/tamed63p.tco
-
-FATE_G723_1 += fate-g723_1-dec-7
-fate-g723_1-dec-7: CMD = framecrc -postfilter 1 -i $(TARGET_SAMPLES)/g723_1/dtx63b.tco
-
-FATE_G723_1 += fate-g723_1-dec-8
-fate-g723_1-dec-8: CMD = framecrc -postfilter 1 -i $(TARGET_SAMPLES)/g723_1/dtx63e.tco
-
-FATE_SAMPLES_AVCONV += $(FATE_G723_1)
-fate-g723_1: $(FATE_G723_1)
-
-FATE_G726 += fate-g726-encode-2bit
-fate-g726-encode-2bit: CMD = enc_dec_pcm wav md5 s16le $(SRC) -c:a g726 -b:a 16k
-
-FATE_G726 += fate-g726-encode-3bit
-fate-g726-encode-3bit: CMD = enc_dec_pcm wav md5 s16le $(SRC) -c:a g726 -b:a 24k
-
-FATE_G726 += fate-g726-encode-4bit
-fate-g726-encode-4bit: CMD = enc_dec_pcm wav md5 s16le $(SRC) -c:a g726 -b:a 32k
-
-FATE_G726 += fate-g726-encode-5bit
-fate-g726-encode-5bit: CMD = enc_dec_pcm wav md5 s16le $(SRC) -c:a g726 -b:a 40k
-
-$(FATE_G726): tests/data/asynth-8000-1.wav
-$(FATE_G726): SRC = tests/data/asynth-8000-1.wav
-
-FATE_SAMPLES_AVCONV += $(FATE_G726)
-fate-g726: $(FATE_G726)
-
-FATE_GSM += fate-gsm-ms
-fate-gsm-ms: CMD = framecrc -i $(TARGET_SAMPLES)/gsm/ciao.wav
-
-FATE_GSM += fate-gsm-toast
-fate-gsm-toast: CMD = framecrc -i $(TARGET_SAMPLES)/gsm/sample-gsm-8000.mov -t 10
-
-FATE_SAMPLES_AVCONV += $(FATE_GSM)
-fate-gsm: $(FATE_GSM)
-
-FATE_SAMPLES_AVCONV += fate-qcelp
-fate-qcelp: CMD = pcm -i $(TARGET_SAMPLES)/qcp/0036580847.QCP
-fate-qcelp: CMP = oneoff
-fate-qcelp: REF = $(SAMPLES)/qcp/0036580847.pcm
-
-FATE_SAMPLES_AVCONV += fate-truespeech
-fate-truespeech: CMD = pcm -i $(TARGET_SAMPLES)/truespeech/a6.wav
-fate-truespeech: CMP = oneoff
-fate-truespeech: REF = $(SAMPLES)/truespeech/a6.pcm
diff --git a/deps/libav/tests/fate/vorbis.mak b/deps/libav/tests/fate/vorbis.mak
deleted file mode 100644
index 4b72373..0000000
--- a/deps/libav/tests/fate/vorbis.mak
+++ /dev/null
@@ -1,85 +0,0 @@
-FATE_VORBIS += fate-vorbis-1
-fate-vorbis-1: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/1.0.1-test_small.ogg
-fate-vorbis-1: REF = $(SAMPLES)/vorbis/1.0.1-test_small.pcm
-
-FATE_VORBIS += fate-vorbis-2
-fate-vorbis-2: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/1.0-test_small.ogg
-fate-vorbis-2: REF = $(SAMPLES)/vorbis/1.0-test_small.pcm
-
-FATE_VORBIS += fate-vorbis-3
-fate-vorbis-3: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/beta3-test_small.ogg
-fate-vorbis-3: REF = $(SAMPLES)/vorbis/beta3-test_small.pcm
-
-FATE_VORBIS += fate-vorbis-4
-fate-vorbis-4: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/beta4-test_small.ogg
-fate-vorbis-4: REF = $(SAMPLES)/vorbis/beta4-test_small.pcm
-
-FATE_VORBIS += fate-vorbis-5
-fate-vorbis-5: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/chain-test1_small.ogg
-fate-vorbis-5: REF = $(SAMPLES)/vorbis/chain-test1_small.pcm
-
-FATE_VORBIS += fate-vorbis-6
-fate-vorbis-6: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/chain-test2_small.ogg
-fate-vorbis-6: REF = $(SAMPLES)/vorbis/chain-test2_small.pcm
-
-FATE_VORBIS += fate-vorbis-7
-fate-vorbis-7: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/highrate-test_small.ogg
-fate-vorbis-7: REF = $(SAMPLES)/vorbis/highrate-test_small.pcm
-
-FATE_VORBIS += fate-vorbis-8
-fate-vorbis-8: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/lsp-test2_small.ogg
-fate-vorbis-8: REF = $(SAMPLES)/vorbis/lsp-test2_small.pcm
-
-FATE_VORBIS += fate-vorbis-9
-fate-vorbis-9: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/lsp-test3_small.ogg
-fate-vorbis-9: REF = $(SAMPLES)/vorbis/lsp-test3_small.pcm
-
-FATE_VORBIS += fate-vorbis-10
-fate-vorbis-10: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/lsp-test4_small.ogg
-fate-vorbis-10: REF = $(SAMPLES)/vorbis/lsp-test4_small.pcm
-
-FATE_VORBIS += fate-vorbis-11
-fate-vorbis-11: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/lsp-test_small.ogg
-fate-vorbis-11: REF = $(SAMPLES)/vorbis/lsp-test_small.pcm
-
-FATE_VORBIS += fate-vorbis-12
-fate-vorbis-12: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/mono_small.ogg
-fate-vorbis-12: REF = $(SAMPLES)/vorbis/mono_small.pcm
-
-FATE_VORBIS += fate-vorbis-13
-fate-vorbis-13: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/moog_small.ogg
-fate-vorbis-13: REF = $(SAMPLES)/vorbis/moog_small.pcm
-fate-vorbis-13: FUZZ = 2
-
-FATE_VORBIS += fate-vorbis-14
-fate-vorbis-14: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/rc1-test_small.ogg
-fate-vorbis-14: REF = $(SAMPLES)/vorbis/rc1-test_small.pcm
-
-FATE_VORBIS += fate-vorbis-15
-fate-vorbis-15: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/rc2-test2_small.ogg
-fate-vorbis-15: REF = $(SAMPLES)/vorbis/rc2-test2_small.pcm
-
-FATE_VORBIS += fate-vorbis-16
-fate-vorbis-16: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/rc2-test_small.ogg
-fate-vorbis-16: REF = $(SAMPLES)/vorbis/rc2-test_small.pcm
-
-FATE_VORBIS += fate-vorbis-17
-fate-vorbis-17: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/rc3-test_small.ogg
-fate-vorbis-17: REF = $(SAMPLES)/vorbis/rc3-test_small.pcm
-
-FATE_VORBIS += fate-vorbis-18
-fate-vorbis-18: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/sleepzor_small.ogg
-fate-vorbis-18: REF = $(SAMPLES)/vorbis/sleepzor_small.pcm
-fate-vorbis-18: FUZZ = 2
-
-FATE_VORBIS += fate-vorbis-19
-fate-vorbis-19: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/test-short2_small.ogg
-fate-vorbis-19: REF = $(SAMPLES)/vorbis/test-short2_small.pcm
-
-FATE_VORBIS += fate-vorbis-20
-fate-vorbis-20: CMD = pcm -i $(TARGET_SAMPLES)/vorbis/6.ogg
-fate-vorbis-20: REF = $(SAMPLES)/vorbis/6.pcm
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, OGG, VORBIS) += $(FATE_VORBIS)
-fate-vorbis: $(FATE_VORBIS)
-$(FATE_VORBIS): CMP = oneoff
diff --git a/deps/libav/tests/fate/vpx.mak b/deps/libav/tests/fate/vpx.mak
deleted file mode 100644
index f9e99ee..0000000
--- a/deps/libav/tests/fate/vpx.mak
+++ /dev/null
@@ -1,85 +0,0 @@
-FATE_VP3-$(call DEMDEC, MATROSKA, THEORA) += fate-theora-coeff-level64
-fate-theora-coeff-level64: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/vp3/coeff_level64.mkv
-
-FATE_VP3-$(call DEMDEC, AVI, VP3) += fate-vp31
-fate-vp31: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/vp3/vp31.avi
-
-FATE_SAMPLES_AVCONV += $(FATE_VP3-yes)
-fate-vp3: $(FATE_VP3-yes)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, VP5) += fate-vp5
-fate-vp5: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/vp5/potter512-400-partial.avi -an
-
-FATE_VP6-$(call DEMDEC, EA, VP6) += fate-vp60
-fate-vp60: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/ea-vp6/g36.vp6
-
-FATE_VP6-$(call DEMDEC, EA, VP6) += fate-vp61
-fate-vp61: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/ea-vp6/MovieSkirmishGondor.vp6 -t 4
-
-FATE_VP6-$(call DEMDEC, FLV, VP6A) += fate-vp6a
-fate-vp6a: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/flash-vp6/300x180-Scr-f8-056alpha.flv
-
-FATE_VP6-$(call DEMDEC, FLV, VP6F) += fate-vp6f
-fate-vp6f: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/flash-vp6/clip1024.flv
-
-FATE_SAMPLES_AVCONV += $(FATE_VP6-yes)
-fate-vp6: $(FATE_VP6-yes)
-
-VP8_SUITE = 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017
-
-define FATE_VP8_SUITE
-FATE_VP8-$(CONFIG_IVF_DEMUXER) += fate-vp8-test-vector$(2)-$(1)
-fate-vp8-test-vector$(2)-$(1): CMD = framemd5 $(3) -i $(TARGET_SAMPLES)/vp8-test-vectors-r1/vp80-00-comprehensive-$(1).ivf
-fate-vp8-test-vector$(2)-$(1): REF = $(SRC_PATH)/tests/ref/fate/vp8-test-vector-$(1)
-endef
-
-define FATE_VP8_FULL
-$(foreach N,$(VP8_SUITE),$(eval $(call FATE_VP8_SUITE,$(N),$(1),$(2))))
-
-# FIXME this file contains two frames with identical timestamps,
-# so avconv drops one of them
-FATE_VP8-$(CONFIG_IVF_DEMUXER) += fate-vp8-sign-bias$(1)
-fate-vp8-sign-bias$(1): CMD = framemd5 $(2) -i $(TARGET_SAMPLES)/vp8/sintel-signbias.ivf
-fate-vp8-sign-bias$(1): REF = $(SRC_PATH)/tests/ref/fate/vp8-sign-bias
-
-FATE_VP8-$(CONFIG_MATROSKA_DEMUXER) += fate-vp8-size-change$(1)
-fate-vp8-size-change$(1): CMD = framemd5 $(2) -i $(TARGET_SAMPLES)/vp8/frame_size_change.webm -frames:v 30
-fate-vp8-size-change$(1): REF = $(SRC_PATH)/tests/ref/fate/vp8-size-change
-endef
-
-$(call FATE_VP8_FULL)
-
-FATE_SAMPLES_AVCONV-$(CONFIG_VP8_DECODER) += $(FATE_VP8-yes)
-fate-vp8: $(FATE_VP8-yes)
-
-define FATE_VP9_SUITE
-FATE_VP9-$(CONFIG_MATROSKA_DEMUXER) += fate-vp9$(2)-$(1)
-fate-vp9$(2)-$(1): CMD = framemd5 $(3) -i $(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-$(1).webm
-fate-vp9$(2)-$(1): REF = $(SRC_PATH)/tests/ref/fate/vp9-$(1)
-endef
-
-VP9_Q = 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 \
-        16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 \
-        32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 \
-        48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
-VP9_SHARP = 1 2 3 4 5 6 7
-VP9_SIZE_A = 08 10 16 18 32 34 64 66
-VP9_SIZE_B = 196 198 200 202 208 210 224 226
-
-define FATE_VP9_FULL
-$(foreach Q,$(VP9_Q),$(eval $(call FATE_VP9_SUITE,00-quantizer-$(Q),$(1),$(2))))
-$(foreach SHARP,$(VP9_SHARP),$(eval $(call FATE_VP9_SUITE,01-sharpness-$(SHARP),$(1),$(2))))
-$(foreach W,$(VP9_SIZE_A),$(eval $(foreach H,$(VP9_SIZE_A),$(eval $(call FATE_VP9_SUITE,02-size-$(W)x$(H),$(1),$(2))))))
-$(foreach W,$(VP9_SIZE_B),$(eval $(foreach H,$(VP9_SIZE_B),$(eval $(call FATE_VP9_SUITE,03-size-$(W)x$(H),$(1),$(2))))))
-$(eval $(call FATE_VP9_SUITE,03-deltaq,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,2pass-akiyo,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,parallelmode-akiyo,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,segmentation-aq-akiyo,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,segmentation-sf-akiyo,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,tiling-pedestrian,$(1),$(2)))
-endef
-
-$(eval $(call FATE_VP9_FULL))
-
-FATE_SAMPLES_AVCONV-$(CONFIG_VP9_DECODER) += $(FATE_VP9-yes)
-fate-vp9: $(FATE_VP9-yes)
diff --git a/deps/libav/tests/fate/vqf.mak b/deps/libav/tests/fate/vqf.mak
deleted file mode 100644
index 355bab0..0000000
--- a/deps/libav/tests/fate/vqf.mak
+++ /dev/null
@@ -1,7 +0,0 @@
-FATE_SAMPLES_AVCONV-$(call DEMDEC, VQF, TWINVQ) += fate-twinvq
-fate-twinvq: CMD = pcm -i $(TARGET_SAMPLES)/vqf/achterba.vqf
-fate-twinvq: CMP = oneoff
-fate-twinvq: REF = $(SAMPLES)/vqf/achterba.pcm
-
-FATE_SAMPLES_AVCONV-$(CONFIG_VQF_DEMUXER) += fate-vqf-demux
-fate-vqf-demux: CMD = md5 -i $(TARGET_SAMPLES)/vqf/achterba.vqf -acodec copy -f framecrc
diff --git a/deps/libav/tests/fate/wavpack.mak b/deps/libav/tests/fate/wavpack.mak
deleted file mode 100644
index 912c64a..0000000
--- a/deps/libav/tests/fate/wavpack.mak
+++ /dev/null
@@ -1,102 +0,0 @@
-# lossless
-
-FATE_WAVPACK += fate-wavpack-lossless-8bit
-fate-wavpack-lossless-8bit: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossless/8bit-partial.wv -f s8
-
-FATE_WAVPACK += fate-wavpack-lossless-12bit
-fate-wavpack-lossless-12bit: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossless/12bit-partial.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-lossless-16bit
-fate-wavpack-lossless-16bit: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossless/16bit-partial.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-lossless-24bit
-fate-wavpack-lossless-24bit: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossless/24bit-partial.wv -f s24le
-
-FATE_WAVPACK += fate-wavpack-lossless-32bit
-fate-wavpack-lossless-32bit: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossless/32bit_int-partial.wv -f s32le
-
-FATE_WAVPACK += fate-wavpack-lossless-float
-fate-wavpack-lossless-float: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossless/32bit_float-partial.wv -f f32le
-
-# lossy
-
-FATE_WAVPACK += fate-wavpack-lossy-8bit
-fate-wavpack-lossy-8bit: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossy/4.0_8-bit.wv -f s8
-
-FATE_WAVPACK += fate-wavpack-lossy-16bit
-fate-wavpack-lossy-16bit: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossy/4.0_16-bit.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-lossy-24bit
-fate-wavpack-lossy-24bit: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossy/4.0_24-bit.wv -f s24le
-
-FATE_WAVPACK += fate-wavpack-lossy-32bit
-fate-wavpack-lossy-32bit: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossy/4.0_32-bit_int.wv -f s32le
-
-FATE_WAVPACK += fate-wavpack-lossy-float
-fate-wavpack-lossy-float: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/lossy/2.0_32-bit_float.wv -f f32le
-
-# channel configurations
-
-FATE_WAVPACK += fate-wavpack-channels-monofloat
-fate-wavpack-channels-monofloat: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/mono_float-partial.wv -f f32le
-
-FATE_WAVPACK += fate-wavpack-channels-monoint
-fate-wavpack-channels-monoint: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/mono_16bit_int.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-channels-4.0
-fate-wavpack-channels-4.0: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/edward_4.0_16bit-partial.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-channels-5.1
-fate-wavpack-channels-5.1: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/panslab_sample_5.1_16bit-partial.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-channels-6.1
-fate-wavpack-channels-6.1: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/eva_2.22_6.1_16bit-partial.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-channels-7.1
-fate-wavpack-channels-7.1: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/panslab_sample_7.1_16bit-partial.wv -f s16le
-
-# speed modes
-
-FATE_WAVPACK += fate-wavpack-speed-default
-fate-wavpack-speed-default: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/speed_modes/default-partial.wv  -f s16le
-
-FATE_WAVPACK += fate-wavpack-speed-fast
-fate-wavpack-speed-fast: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/speed_modes/fast-partial.wv  -f s16le
-
-FATE_WAVPACK += fate-wavpack-speed-high
-fate-wavpack-speed-high: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/speed_modes/high-partial.wv  -f s16le
-
-FATE_WAVPACK += fate-wavpack-speed-vhigh
-fate-wavpack-speed-vhigh: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/speed_modes/vhigh-partial.wv  -f s16le
-
-# special cases
-
-FATE_WAVPACK += fate-wavpack-clipping
-fate-wavpack-clipping: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/special/clipping.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-cuesheet
-fate-wavpack-cuesheet: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/special/cue_sheet.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-falsestereo
-fate-wavpack-falsestereo: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/special/false_stereo.wv -f s16le
-
-FATE_WAVPACK += fate-wavpack-zerolsbs
-fate-wavpack-zerolsbs: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/special/zero_lsbs.wv -f s16le
-
-FATE_WAVPACK-$(call DEMDEC, WV, WAVPACK) += $(FATE_WAVPACK)
-
-FATE_WAVPACK-$(call DEMDEC, MATROSKA, WAVPACK) += fate-wavpack-matroskamode
-fate-wavpack-matroskamode: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/special/matroska_mode.mka -f s16le
-
-FATE_WAVPACK-$(call DEMMUX, WV, MATROSKA) += fate-wavpack-matroska_mux-mono
-fate-wavpack-matroska_mux-mono: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/mono_16bit_int.wv -c copy -flags +bitexact -f matroska
-fate-wavpack-matroska_mux-mono: CMP = oneline
-fate-wavpack-matroska_mux-mono: REF = 6bd769b3f0e9d7fa6261c3b73a53eb7d
-
-FATE_WAVPACK-$(call DEMMUX, WV, MATROSKA) += fate-wavpack-matroska_mux-61
-fate-wavpack-matroska_mux-61: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/eva_2.22_6.1_16bit-partial.wv -c copy -flags +bitexact -f matroska
-fate-wavpack-matroska_mux-61: CMP = oneline
-fate-wavpack-matroska_mux-61: REF = 2d2f1e7f81a8b1983fcffc7f24de8a11
-
-FATE_SAMPLES_AVCONV += $(FATE_WAVPACK-yes)
-fate-wavpack: $(FATE_WAVPACK-yes)
diff --git a/deps/libav/tests/fate/wma.mak b/deps/libav/tests/fate/wma.mak
deleted file mode 100644
index 1b8c5f9..0000000
--- a/deps/libav/tests/fate/wma.mak
+++ /dev/null
@@ -1,54 +0,0 @@
-FATE_WMAPRO-$(call DEMDEC, ASF, WMAPRO) += fate-wmapro-2ch
-fate-wmapro-2ch: CMD = pcm -i $(TARGET_SAMPLES)/wmapro/Beethovens_9th-1_small.wma
-fate-wmapro-2ch: REF = $(SAMPLES)/wmapro/Beethovens_9th-1_small.pcm
-
-FATE_WMAPRO-$(call DEMDEC, ASF, WMAPRO) += fate-wmapro-5.1
-fate-wmapro-5.1: CMD = pcm -i $(TARGET_SAMPLES)/wmapro/latin_192_mulitchannel_cut.wma
-fate-wmapro-5.1: REF = $(SAMPLES)/wmapro/latin_192_mulitchannel_cut.pcm
-
-FATE_WMAPRO-$(call DEMDEC, MOV, WMAPRO) += fate-wmapro-ism
-fate-wmapro-ism: CMD = pcm -i $(TARGET_SAMPLES)/isom/vc1-wmapro.ism -vn
-fate-wmapro-ism: REF = $(SAMPLES)/isom/vc1-wmapro.pcm
-
-$(FATE_WMAPRO-yes): CMP = oneoff
-
-FATE_SAMPLES_AVCONV += $(FATE_WMAPRO-yes)
-fate-wmapro: $(FATE_WMAPRO-yes)
-
-FATE_WMAVOICE-$(call DEMDEC, ASF, WMAVOICE) += fate-wmavoice-7k
-fate-wmavoice-7k: CMD = pcm -i $(TARGET_SAMPLES)/wmavoice/streaming_CBR-7K.wma
-fate-wmavoice-7k: REF = $(SAMPLES)/wmavoice/streaming_CBR-7K.pcm
-fate-wmavoice-7k: FUZZ = 3
-
-FATE_WMAVOICE-$(call DEMDEC, ASF, WMAVOICE) += fate-wmavoice-11k
-fate-wmavoice-11k: CMD = pcm -i $(TARGET_SAMPLES)/wmavoice/streaming_CBR-11K.wma
-fate-wmavoice-11k: REF = $(SAMPLES)/wmavoice/streaming_CBR-11K.pcm
-fate-wmavoice-11k: FUZZ = 3
-
-FATE_WMAVOICE-$(call DEMDEC, ASF, WMAVOICE) += fate-wmavoice-19k
-fate-wmavoice-19k: CMD = pcm -i $(TARGET_SAMPLES)/wmavoice/streaming_CBR-19K.wma
-fate-wmavoice-19k: REF = $(SAMPLES)/wmavoice/streaming_CBR-19K.pcm
-fate-wmavoice-19k: FUZZ = 3
-
-$(FATE_WMAVOICE-yes): CMP = stddev
-
-FATE_SAMPLES_AVCONV += $(FATE_WMAVOICE-yes)
-fate-wmavoice: $(FATE_WMAVOICE-yes)
-
-FATE_WMA_ENCODE-$(call ENCDEC, WMAV1, ASF) += fate-wmav1-encode
-fate-wmav1-encode: CMD = enc_dec_pcm asf wav s16le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c:a wmav1 -b:a 128k
-fate-wmav1-encode: CMP_SHIFT = -8192
-fate-wmav1-encode: CMP_TARGET = 291.06
-fate-wmav1-encode: SIZE_TOLERANCE = 4632
-
-FATE_WMA_ENCODE-$(call ENCDEC, WMAV2, ASF) += fate-wmav2-encode
-fate-wmav2-encode: CMD = enc_dec_pcm asf wav s16le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c:a wmav2 -b:a 128k
-fate-wmav2-encode: CMP_SHIFT = -8192
-fate-wmav2-encode: CMP_TARGET = 258.32
-fate-wmav2-encode: SIZE_TOLERANCE = 4632
-
-$(FATE_WMA_ENCODE-yes): CMP = stddev
-$(FATE_WMA_ENCODE-yes): REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav
-
-FATE_SAMPLES_AVCONV += $(FATE_WMA_ENCODE-yes)
-fate-wma-encode: $(FATE_WMA_ENCODE-yes)
diff --git a/deps/libav/tests/fate/xvid.mak b/deps/libav/tests/fate/xvid.mak
deleted file mode 100644
index 68f01b5..0000000
--- a/deps/libav/tests/fate/xvid.mak
+++ /dev/null
@@ -1,9 +0,0 @@
-fate-xvid-custom-matrix: CMD = framemd5 -flags +bitexact -idct simple  -i $(TARGET_SAMPLES)/mpeg4/xvid_vlc_trac7411.h263
-fate-xvid-idctmmx:       CMD = framemd5 -flags +bitexact -cpuflags all -i $(TARGET_SAMPLES)/mpeg4/xvid_vlc_trac7411.h263
-
-FATE_XVID-$(call DEMDEC, M4V, MPEG4) += fate-xvid-custom-matrix
-FATE_XVID-$(filter $(HAVE_MMX_INLINE), $(call DEMDEC, M4V, MPEG4)) += fate-xvid-idctmmx
-
-FATE_SAMPLES_AVCONV += $(FATE_XVID-yes)
-
-fate-xvid: $(FATE_XVID-yes)
diff --git a/deps/libav/tests/filtergraphs/channelmap b/deps/libav/tests/filtergraphs/channelmap
deleted file mode 100644
index e2b6143..0000000
--- a/deps/libav/tests/filtergraphs/channelmap
+++ /dev/null
@@ -1 +0,0 @@
-channelmap=map=1|2|0|5|3|4:channel_layout=5.1
diff --git a/deps/libav/tests/filtergraphs/lavr_mix_output_zero b/deps/libav/tests/filtergraphs/lavr_mix_output_zero
deleted file mode 100644
index b745f17..0000000
--- a/deps/libav/tests/filtergraphs/lavr_mix_output_zero
+++ /dev/null
@@ -1 +0,0 @@
-atrim=end_sample=1024,channelmap=channel_layout=FL|FR|LFE|BC,aformat=channel_layouts=3.0
diff --git a/deps/libav/tests/filtergraphs/overlay b/deps/libav/tests/filtergraphs/overlay
deleted file mode 100644
index d646463..0000000
--- a/deps/libav/tests/filtergraphs/overlay
+++ /dev/null
@@ -1,2 +0,0 @@
-[1:v] scale=50:50 [over];
-[0:v][over] overlay=20:20
diff --git a/deps/libav/tests/filtergraphs/select-alternate b/deps/libav/tests/filtergraphs/select-alternate
deleted file mode 100644
index 1302e42..0000000
--- a/deps/libav/tests/filtergraphs/select-alternate
+++ /dev/null
@@ -1 +0,0 @@
-select=not(mod(n\,2))
diff --git a/deps/libav/tests/filtergraphs/setpts b/deps/libav/tests/filtergraphs/setpts
deleted file mode 100644
index 79037d1..0000000
--- a/deps/libav/tests/filtergraphs/setpts
+++ /dev/null
@@ -1,2 +0,0 @@
-settb=1/1000,
-setpts=1/(35*TB) * (N + 0.05 * sin(N*2*PI/25))
diff --git a/deps/libav/tests/lavf-regression.sh b/deps/libav/tests/lavf-regression.sh
deleted file mode 100755
index 3083719..0000000
--- a/deps/libav/tests/lavf-regression.sh
+++ /dev/null
@@ -1,255 +0,0 @@
-#!/bin/sh
-#
-# automatic regression test for libavformat
-#
-#
-#set -x
-
-set -e
-
-. $(dirname $0)/regression-funcs.sh
-
-eval do_$test=y
-
-do_lavf()
-{
-    file=${outfile}lavf.$1
-    do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $DEC_OPTS -ar 44100 -f s16le $2 -i $pcm_src $ENC_OPTS -b:a 64k -t 1 -qscale:v 10 $3
-    do_avconv_crc $file $DEC_OPTS -i $target_path/$file $4
-}
-
-do_streamed_images()
-{
-    file=${outfile}${1}pipe.$1
-    do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe $ENC_OPTS -t 1 -qscale 10
-    do_avconv_crc $file $DEC_OPTS -f image2pipe -i $target_path/$file
-}
-
-do_image_formats()
-{
-    outfile="$datadir/images/$1/"
-    mkdir -p "$outfile"
-    file=${outfile}%02d.$1
-    run_avconv $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $2 $ENC_OPTS $3 -frames 12 -y -qscale 10 $target_path/$file
-    do_md5sum ${outfile}02.$1
-    do_avconv_crc $file $DEC_OPTS $3 -i $target_path/$file
-    echo $(wc -c ${outfile}02.$1)
-}
-
-do_audio_only()
-{
-    file=${outfile}lavf.$1
-    do_avconv $file $DEC_OPTS $2 -ar 44100 -f s16le -i $pcm_src $ENC_OPTS -t 1 -qscale 10 $3
-    do_avconv_crc $file $DEC_OPTS $4 -i $target_path/$file
-}
-
-if [ -n "$do_avi" ] ; then
-do_lavf avi "" "-acodec mp2"
-fi
-
-if [ -n "$do_asf" ] ; then
-do_lavf asf "" "-acodec mp2" "-r 25"
-fi
-
-if [ -n "$do_rm" ] ; then
-file=${outfile}lavf.rm
-do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $DEC_OPTS -ar 44100 -f s16le -i $pcm_src $ENC_OPTS -t 1 -qscale 10 -acodec ac3_fixed -b:a 64k
-# broken
-#do_avconv_crc $file -i $target_path/$file
-fi
-
-if [ -n "$do_mpg" ] ; then
-do_lavf mpg
-fi
-
-if [ -n "$do_mxf" ] ; then
-do_lavf mxf "-ar 48000" "-bf 2 -timecode_frame_start 264363"
-fi
-
-if [ -n "$do_mxf_d10" ]; then
-do_lavf mxf_d10 "-ar 48000 -ac 2" "-r 25 -vf scale=720:576,pad=720:608:0:32 -vcodec mpeg2video -g 0 -flags +ildct+low_delay -dc 10 -non_linear_quant 1 -intra_vlc 1 -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10"
-fi
-
-if [ -n "$do_ts" ] ; then
-do_lavf ts "" "-mpegts_transport_stream_id 42"
-fi
-
-if [ -n "$do_swf" ] ; then
-do_lavf swf "" "-an"
-fi
-
-if [ -n "$do_ffm" ] ; then
-do_lavf ffm
-fi
-
-if [ -n "$do_flv_fmt" ] ; then
-do_lavf flv "" "-an"
-fi
-
-if [ -n "$do_mov" ] ; then
-do_lavf mov "" "-acodec pcm_alaw -c:v mpeg4"
-fi
-
-if [ -n "$do_dv_fmt" ] ; then
-do_lavf dv "-ar 48000 -channel_layout stereo" "-r 25 -s pal"
-fi
-
-if [ -n "$do_gxf" ] ; then
-do_lavf gxf "-ar 48000" "-r 25 -s pal -ac 1"
-fi
-
-if [ -n "$do_nut" ] ; then
-do_lavf nut "" "-acodec mp2"
-fi
-
-if [ -n "$do_mkv" ] ; then
-do_lavf mkv "" "-c:a mp2 -c:v mpeg4"
-fi
-
-
-# streamed images
-# mjpeg
-#file=${outfile}lavf.mjpeg
-#do_avconv $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
-#do_avconv_crc $file -i $target_path/$file
-
-if [ -n "$do_pbmpipe" ] ; then
-do_streamed_images pbm
-fi
-
-if [ -n "$do_pgmpipe" ] ; then
-do_streamed_images pgm
-fi
-
-if [ -n "$do_ppmpipe" ] ; then
-do_streamed_images ppm
-fi
-
-if [ -n "$do_gif" ] ; then
-file=${outfile}lavf.gif
-do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24
-do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
-fi
-
-if [ -n "$do_yuv4mpeg" ] ; then
-file=${outfile}lavf.y4m
-do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10
-#do_avconv_crc $file -i $target_path/$file
-fi
-
-# image formats
-
-if [ -n "$do_pgm" ] ; then
-do_image_formats pgm
-fi
-
-if [ -n "$do_ppm" ] ; then
-do_image_formats ppm
-fi
-
-if [ -n "$do_png" ] ; then
-do_image_formats png
-fi
-
-if [ -n "$do_bmp" ] ; then
-do_image_formats bmp
-fi
-
-if [ -n "$do_tga" ] ; then
-do_image_formats tga
-fi
-
-if [ -n "$do_tiff" ] ; then
-do_image_formats tiff "-pix_fmt rgb24"
-fi
-
-if [ -n "$do_sgi" ] ; then
-do_image_formats sgi
-fi
-
-if [ -n "$do_jpg" ] ; then
-do_image_formats jpg "-pix_fmt yuvj420p" "-f image2"
-fi
-
-if [ -n "$do_pam" ] ; then
-do_image_formats pam
-fi
-
-if [ -n "$do_pcx" ] ; then
-do_image_formats pcx
-fi
-
-if [ -n "$do_xwd" ] ; then
-do_image_formats xwd
-fi
-
-if [ -n "$do_dpx" ] ; then
-do_image_formats dpx
-fi
-
-if [ -n "$do_sunrast" ] ; then
-do_image_formats sun
-fi
-
-# audio only
-
-if [ -n "$do_wav" ] ; then
-do_audio_only wav
-fi
-
-if [ -n "$do_alaw" ] ; then
-do_audio_only al "" "" "-ar 44100"
-fi
-
-if [ -n "$do_mulaw" ] ; then
-do_audio_only ul "" "" "-ar 44100"
-fi
-
-if [ -n "$do_au" ] ; then
-do_audio_only au
-fi
-
-if [ -n "$do_mmf" ] ; then
-do_audio_only mmf
-fi
-
-if [ -n "$do_aiff" ] ; then
-do_audio_only aif
-fi
-
-if [ -n "$do_voc" ] ; then
-do_audio_only voc
-fi
-
-if [ -n "$do_voc_s16" ] ; then
-do_audio_only s16.voc "-ac 2" "-acodec pcm_s16le"
-fi
-
-if [ -n "$do_ogg" ] ; then
-do_audio_only ogg "" "-c:a flac"
-fi
-
-if [ -n "$do_rso" ] ; then
-do_audio_only rso
-fi
-
-if [ -n "$do_sox" ] ; then
-do_audio_only sox
-fi
-
-# pix_fmt conversions
-
-if [ -n "$do_pixfmt" ] ; then
-outfile="$datadir/pixfmt/"
-mkdir -p "$outfile"
-conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
-             yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
-             monob yuv440p yuvj440p"
-for pix_fmt in $conversions ; do
-    file=${outfile}${pix_fmt}.yuv
-    run_avconv $DEC_OPTS -r 1 -f image2 -vcodec pgmyuv -i $raw_src \
-               $ENC_OPTS -f rawvideo -t 1 -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
-    do_avconv $file $DEC_OPTS -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
-                    $ENC_OPTS -f rawvideo -s 352x288 -pix_fmt yuv444p
-done
-fi
diff --git a/deps/libav/tests/lena.pnm b/deps/libav/tests/lena.pnm
deleted file mode 100644
index 700508c..0000000
--- a/deps/libav/tests/lena.pnm
+++ /dev/null
@@ -1,109 +0,0 @@
-P6
-# CREATOR: The GIMP's PNM Filter Version 1.0
-256 256
-255
-â‰}߈‚â†väˆ|âŠ{â†|à†rÞ„uÝ„nÞŠvß‚kÞ„jÜ„pà€gÝ‚tށsà‚jà„râŠvæŠrèŽrè’wì—zè—yî•vê”xévè†tàwfØvvÊZa´P_¨@Tœ>\œ=Y¤EX¦GXªJZ®IZ²J\²NW±JV¯LV°OZ²LX²LX´NX²LV²NZ°NZ®JS´JT´OV¸SY¼TZÂXZÂTXÂZYÄ^ZÄ[\Ê`\Ê^\Ë\ZÌf_Îb^ÎebÌabËbbËkhÍffÎd`Ìb]Îb`Ê`^Êg_Ëd^Ëd`Ëa^ÎhaÎhjÑb^ÐebÐfaÐgfÒebÔe`ÒddÒfbÒgdÎheÎf`Ïd^ÐffÐjfÌfeÎfbÎjfÐgbÓidÑibÐicÎhjÒheÊghÊknÎhlÌffËe_ÇddÌf^Îe]ÍcbÊcbÈjhÍibÍdaÎddÎdbÒb\Ðe`ÑhbÒf`Ðg`ÐjdÑd\ÏfdÎ``ÎjjÒplÍgcÌd_ÈbbÒe`Êd`ÎfgÌb^Çb`Îe`È`eÎieÈbcÈc^Êb`ÌcbÈccÎabËadÈbbÇbdÈ^^ÉbcÄbaÀ\`Â[dÀZ`»Za´X_°T[±PX¨HV¶LP¾V\È`]ÑlbÔqlÖzlÙtÜ„pÞˆnÞŠrÚŽvÝ‚nÜzgÜ~jÚ€jÜlÞ€nÜ€rÞ‚rÝ€pÞ†xÞ‚n߀hÞ€jÜ~j߀eÞ€lÞfà}fÝ‚jށhÜ€eÞ„hÜ„m܆nÝ‚jÞ†q݈qÝ„pÜ‚hØ„nä”nï¹…ôȐøΖøОúÔ£üÔœúÔŸôȐ⪀Ärj§M\¥HX¨PZ®OZµX\¹Z\¶Za¼^`ºac¼X\¼^^¾ZZ½^b»dhº[cº\aÃZ[À[^ÃZZÃZ^¾^^Ã]`Â_^Á`cÄ`bÀ^_Å^]¼V\Á`cÂ`bÄbhÁ``Æ[[ÂbbÄa`¿[]¼V\¼V\ºVZ¾\bÚ{væ’€è”zÒrdâ‰}߈‚â†väˆ|âŠ{â†|à†rÞ„uÝ„nÞŠvß‚kÞ„jÜ„pà€gÝ‚tށsà‚jà„râŠvæŠrèŽrè’wì—zè—yî•vê”xévè†tàwfØvvÊZa´P_¨@Tœ>\œ=Y¤EX¦GXªJZ®IZ²J\²NW±JV¯LV°OZ²LX²LX´NX²LV²NZ°NZ®JS´JT´OV¸SY¼TZÂXZÂTXÂZYÄ^ZÄ[\Ê`\Ê^\Ë\ZÌf_Îb^ÎebÌabËbbËkhÍffÎd`Ìb]Îb`Ê`^Êg_Ëd^Ëd`Ëa^ÎhaÎhjÑb^ÐebÐfaÐgfÒebÔe`ÒddÒfbÒgdÎheÎf`Ïd^ÐffÐjfÌfeÎfbÎjfÐgbÓidÑibÐicÎhjÒheÊghÊknÎhlÌffËe_ÇddÌf^Îe]ÍcbÊcbÈjhÍibÍdaÎddÎdbÒb\Ðe`ÑhbÒf`Ðg`ÐjdÑd\ÏfdÎ``ÎjjÒplÍgcÌd_ÈbbÒe`Êd`ÎfgÌb^Çb`Îe`È`eÎieÈbcÈc^Êb`ÌcbÈccÎabËadÈbbÇbdÈ^^ÉbcÄbaÀ\`Â[dÀZ`»Za´X_°T[±PX¨HV¶LP¾V\È`]ÑlbÔqlÖzlÙtÜ„pÞˆnÞŠrÚŽvÝ‚nÜzgÜ~jÚ€jÜlÞ€nÜ€rÞ‚rÝ€pÞ†xÞ‚n߀hÞ€jÜ~j߀eÞ€lÞfà}fÝ‚jށhÜ€eÞ„hÜ„m܆nÝ‚jÞ†q݈qÝ„pÜ‚hØ„nä”nï¹…ôȐøΖøОúÔ£üÔœúÔŸôȐ⪀Ärj§M\¥HX¨PZ®OZµX\¹Z\¶Za¼^`ºac¼X\¼^^¾ZZ½^b»dhº[cº\aÃZ[À[^ÃZZÃZ^¾^^Ã]`Â_^Á`cÄ`bÀ^_Å^]¼V\Á`cÂ`bÄbhÁ``Æ[[ÂbbÄa`¿[]¼V\¼V\ºVZ¾\bÚ{væ’€è”zÒrdâŠ|à†yâ†vä†xâˆvâ„vàƒnà‚oß„m߆p߀hàhÞ„oà€gÝ€tÞ‚nß‚lށnáˆtæ‹qçrè“yë—zë—yî–vì”vêuç„oßwh×omÈX_´O^§AW>Yž<V¤BV¦FZªFY®JZ°JZ²KV±JT®JT°LX³IS²JV³LW±JT²LX²LW¯JR³KU²PW¸QX¼U[ÂWYÃVZÂZXÄ\ZÆ\]Ê][Ê^^Ë[[Êa^Ïc^ÎdbËddËa^ÌheËccÎfbÍc^Ía`Ëa`ÊfcÌd`Íb`Ìb_ÏieÎgjÐd_ÐgdÐhdÒidÓfaÔeaÓfbÒfbÒfbÏidÐd`Ïc_ÐecÐgbÎdbÏfcÐhbÐgaÒhaÑfbÏhdÎhfÒgaËgjÍhiÍjjËebÌb`ÉbaÌe^Ðd]ÎcaÌb`ÈfdÍjaÊb_ÌddÍc_Ña\ÍfbÐfaÐfaÏf^ÐgbÐe^Ðd`Îb_ÌhhÒjiÎhdÌdaÇbaÐd_Ìc_ÌccÍd_Éa`ÍdaÉacËhiÈ^`Èa^ÉccÊdeÉa`ÎbcËceÈ`bÇbdÈ``Ë`aÄ`aÁ\_Â[bÀ\`ºY`µW^³TZ°OY¨JVµJP½TXÇ_^ÏjbÔpl×ylÙ}rÝ‚rÞ‡uߊrÛŠs݃mÜ|jÝhÜ~kÜmÜ}kÜ~oÞ‚pÜ€mÝ‚pÞƒoà€h߀hÝjÞ~fÞ~lÞ€hß~iÞ€hÞ„i܁dÞƒhÞ‚i܆o܃jÝ„qÞ†nÞ„p܁iفlâ‘oôŏ÷ΘùÐœúÔ¡üԝúÖžö˔求Êzm¨NX¥HXªLV®Q\³X]¸Y\¹Y\½\^½``¼Z]»]]¾\[¼^b¼`eº]a¸[`¿[\¿Y\ÃZYÄ\]¿_`Ä^]Ä^^À_aÄa`Á`_Ä^\½WZÂ_aÁ^aÅbdÄ_`Ç]ZÂbbÄ`^À\\¾U\¾V\¼Z\À_bØtlÞ…vÚ}l¶WZâ†xà†qâ†vä‚nâ‡vâ†tâ€eà}lànà€ià€há~gÞ‚kà€fß|jÞ‚kß„nÞ€gä„næŒrévì’tì–|ì–xí–yì’sënæ„gÞxiÔfbÈZ\µL[¨<UŸ7S›;T¢<S§>T¬@T°KZ°LY°FS±FQ²EP±IV®FR°GS±JV²HOµFN²IT°GO³KV¶LRºOR¼VXÀTXÄWYÆ\\È_ZÊ\VÉ^ZÊZUÌZXÍ_\Ðb\Îa[ÌecÏ`\Îb_ËcbÐa^Ë`aÏbbÑf`Ðd_Íc]Ìc`Ïb]Òc`Ïb\Òc\ÐfgÐfdÑfbÒf`Òb^ÕebÔe`Ód^Ôa[Ñf^Òb^ÐabÎcdÎc_Ñc^ÑfcÎfdÎdaÏedÎfdÐc^Ïb`ÌdhËknÌdfËmjÊbbÍgbÊb`Îd`Î`ZËc`ËjfÌieËbbÊe`Í^XÎd\Îd^ÎgdÓd^Îh`Íb`Ðe`Ïa]ÐfbÐd^ÐffÍedÐd`Îa\Ë_\Ç`cÌ`^ÉfhÌ^]Ëb`Éa`Êa_Ê_^ÅbeÎa\ÎabËcaÌbaÌabÉ`^ÊbdÌ_\È^^Æ^`Æ[]ÁZ^¼\f¼W^¹T[¶RZ²LT«KX¬EPºUXÄ\^Èe`ÓlgÔvnØ{nہrÛ†pÞˆt߈tÞ„mÞ‚oÞ~gÞ}gÜoÜ|gÞ€nÜ€nÜiÝ‚nß‚là€fßi߁fßeÞ~cà€ià‚hÝ€j߀fÞ}dÞeÞ‚gÝ‚iÜ‚lÝ„mÜ„rÞ‚kÝ‚jÚiہhè¢xñ¾Š÷ʐøКúÒ›ûÔžüÖžûÒ•òÉߞs¸d_£HX¦JW«P]²V]¸V[¼[]½TWº[^»Z]½ZZ¼`^ÀZ^¾`a¿\^º^bº_d½]^¾^\Âa[Á__Æ_[À`_Á^]Ã]\Â\^Å\ZÀ^^¿[`Ä^^Æ``Ç]bÇ\[ÄbdÇ`\Ä_`Á[\Å[]Å`cÅb`¹VZœET~,KfEà‚ià…páƒrâ‚nâ…tâƒrà„kã€lâ€kà„nà‚jâiށnß~mÝ~hà‚lÞ~iâƒjå‰mçŽré“rì“wì”sì–rî•ní‘pêŒlå€dÞtfÔjaÉWZ¸NX¨=Rž:Q¢8N¤:O¦@R­DT®DR²DPµHSµFP²DN³LW¯GR²KR²HR²GO²HN²HR°JT³LU³PY´OX»QY»VZÃUWÅZ]ÃYWÅ]]Ê^YÈ^]Ê]XÈa^Ì]]Í`^Ê_[Ðd]Ìc_Ìb`Íb^Íd_Íd`Îa^Îb]Îb^Ìd^Íb\Ðb^Îf_ÐbaÏc`ÏfaÐgbÒfaÓh^ÒhaÓd^Ñb_ÒgbÏhaÒdbÎb`ÐkhÑedÏdaÐfbÐdbÍa`ÑefÏcaÐd`ÏbfÌ`_Ë`bÒdbÎb^ËgfÌbaË`\Í^\Í`]ÉfbÌgdËhcÎedÎ^VÎ_[Ìb\Ëe_ÎdcÐb^Óa]Ðc`Ðb[Ïb_Òb\ÎcaÐd^ÐfbÌecÏ`\Ða^Êb`Í`\ËbbÊ]]Ëb]Ë`^Ì`]Ê\\È^`Í^^É]^ÈbaÎa_Ê_\Ì`[Ëb`Ç[[É^]Ç]]È_^Æ\^¼Y_¼Ya¹TX¸PX·QS³LU¬HT±JU¼SYÂ]^ÎffÑql×xpÚ{nÜ‚qÞ„tߊuß…rß‚nÝ‚pÞ€jÝ~jÞƒká„lß‚iàjÞ„m߁iàjá„kàƒgâ‚e߁jßg߀jà‚jß}eށjß‚jÞƒjÜ‚l܁l݁nہm܁l܁kځhÚ~mÞ‰n쮀õÂŒöÌ™øКûÓžúÓ›üÔ™øÍ’ë·~Єl¬U[¨LY¬NU¯S\¸SZ¹XZºZ]¼\^¼Z_»Z\º]^¾[^¼]a¾\aÀ\]¾X[ÀZ`Á\^Â^^Â`^Ä[XÄ_^ÁZ\Ã_[Ã\_Ä^ZÆ]\Ä]^Ä`\Æ`cÆ``Å`]Ã`_Æa]ÈbbÆbdÉ_^Ä_\°NTŒ/Id@\B\Aàƒlà†nä‚iázká…oâƒká‚lâƒkä‚nàná„kâiß~hàhâ‚làbà‚hâ„jæŠjèŽnê’oë“qì–sì•oî”nìhèŽmå}eÞo^Õf]É\[µKT¨;OŸ8Q8P¥<P©@S¬BR®@P°HS´CN³GQ´FP±GT±IO´IR´DM±GP³IQ°DO°JR´KS¶OV¸OS½QT»VZÀW[Â[_Ä]`Æ\^È[VÊ^ZÎ[WÌb\Ï^ZËb_Í_ZÌa^Î`\Ïa^Í_ZÊfdÐd^Ïd`Ðe_Î`]Ïc\ÎaZÐ`]Ðe]Ð`[ÐdbÒfbÐfbÓb^Ôb[ÒdaÓd`ÒebÔd^ÐcaÐ_\ÑbbÐfbÓb^Òd`Ôd_Ñ`]Îc^ÐfaÎbbÑc\Ïc`ËcbÐa^ÐfdÍdbÎb`Ìb`ÍcbÏ`\Îa^Ìa^Ï`^ÈfcÏb^ÌcZÌc]ÍbaÎb\ÍdaÏcaÐhdÏc]Íd`Ïa]Îa_Î`_Î`[Ïb_Íd_Ðd_Ìc^ÌbbÑaZÌ`]Ì`]Êa^ÊbfÌb]Í``Èa_Ì_^ÊaaÊ^]Ì`dÌd`Ì`_Ìa]Èa`ÈbaÈ`]Ä^_À\`¼V\¿YbºTZ·U`´NV²NX¯LY®HV±NX¾X^ÈegÐjfÖsoÚzrÜ~tß„vàˆuà†rá„o߁lÞ‚pßj߁läƒiá†lá„mâ†oájâƒlá„jáƒl߁j߀ià‚jà€hà†jàkà~fà€g߁lÚ}a݁nÚlÚƒlÚhÛ€fÚ‚gÚ|iØkä—tð¹„öÆ’ùΘúÐœûÔšþÖœûÓ˜õÆŒä¤uÀlc¬JR¬IU«LU²RX³SZ¼VXÀ\]½ZZºY^»^a¾ZZ¾]^½Y\º\]¼Y_½ZZ½XZ¾\\¿\\Ã^^½]b¿]^Ä^\Ä\\Á^\Æ\\Â^^Ä^_È^\Í_\É\\Æ^`ÈdcÎfbËhbÃ_]®HO…,Fe@\@ZAZBäƒnâ‚pâ‚kâƒná„nâƒjâ€hâƒlâ‚jà‚qâ…lâkà€j߀iájáhãƒjä‹qèŒnè’rç”pé“tê’të“kínêŽhç‹hâ~gÝp\Ôh]ÉVT²JRª?Qœ7N :O¢=O¨<N¬BR°DQ±IV±GR³LX±KV°MV±NV³FN°DO±IP²CL±FO±DOµJR¸RVºNW¾RRÁWVÃVZÁVYÄZ^ÄX[È\ZË\YÍ\XÌ]YÐ]VÎ[XÍ^XÑb`Ì``Ðb_Îd_ÐebÑd`Òc`Îb^ÏbaÎb`Ía\Ñc\Îd`Ï`\ÏbcÏgcÐb\Ôb^Ód^ÓgdÔg]Öc^Ôb\Ðb\ÐfcÑddÐd`Óc`Ób]Ô_]Ñd_Î`aÐdcÎ`cÒc_Òb_ÑeaÒe`ÑdaÎdcÐd`Îb^Ï`^Îb_Ð_\Íb^ÏcaÍc`Òc`Ì_[Î`ZÎebÐb]ÐhdÒhdÒhaÑddÏfbÎb`ÎebÏb^Îb]Îd`Íb_Îb^ÐfbÌdfÎa\Èb`Î_ZÍcaÌb`ÉbaË^]Ìb`Ì__Ëc`Æ^\È]^Ì`^Ê`_É_^Ë`^ÌddÈ__Ã]bÅ\`À\`ÀZ^¹V`µPZ´PX±SZ²PZ®IT©HW·S\Â_hÏkiÔqnÚvlÛ}tàmá‡vâˆsâ‡sà„má„mß…lÞ‚oã†ná‡lâˆmåˆoä‰kä†pâ„pâ…jã‚fà‚là‚jà…gà‚ká‚fÞ€hàhÞ~dÜ‚jÜ€jÜ~jÜ‚oÜ€fÚ€jÚ‚mØ|hÖ~kÜ„lê©|óÀ‹øÊ’ùЛûÔžüÕœüÖžúјð»ˆÖr´WY¨LX¨M[¯T\±TZºTX¼X]¼Y_¼X\¼\_½\]ÂZZ¾\^¾[]ÀZ\ÁX[¼^c½[[¿^aÀ[ZÃ]\ÂZYÄ\]Ã\\Â\\Ã[\Æa^Ê`[Ç\[Æ`aÇ^`È^^ÌhcÏgcÇ]Y²OV†,Gb$HY@X=Z@\>ä„pâ„nâ‚jã‚eß„nâƒhâ‚lâjã‚mâ‚jâ€gá€jà€gÞ€jáiâ„iåˆpåŽpçqè“rç“vé“rê’nênêŽmæŒoç„fä~hÝr^×bVÊX\¶NW¦>Rœ<Qž<R£<M§?O­FT±CN³FSµIRµJU±KT²JU´JR³HO²CP°IP²KP±BK°DM´JQ¶MV¹OV¾PQ¾TWÁTZÆVUÄ[aÅ^\Ê^\É\YÉ]YÍb[Ì^XÎ^YÌb^Î^ZÍ^\Îb]Îd`Ìc`Ða^Ðd\Ïb^Ða`Ða^Ï_\Óc\Îd`Ðc]Ñc_Ðb^Òb^ÒaZÓheÖb`Ôc]Òb`Ñb[ÐcbÒd`ÑdbÒfeÖc^Ò`\Ñ``ÏfdÏdeÒfdÐcbÐecÒa`Ïc_ÏddÏdaÐc`Ñc\Îd_Ðb^Òb\Îc`Ïd]ÍdaÌb`Ïc`Ï_ZÎc]Îe_Ïb[Ðd^ÓhaÓd_ÒgfÎddÏb]ÐgdÏb]Î`^ÎddÎd`Îb_ÎaaÌcbÎc`ÉbcÍa^Í`\Ê`\Ë_]Ì`^Ê_`Î`bÊbcÊ`aÌ`_Îb^Ìa`Ë``Ìe_ËadÈ^cÄ^bÆ^`Â\aÁX^¼WY¶R]·T]±Vc±N[­KY«JX²NZ¼VaÊehÖpkØvrÜ|qÝsÞ…tâŠpâˆráŠvãˆnàˆtá…rä‡täˆnåŠpæ‰påŒoè‡jã…ká„kâƒgá€lâ‚hà‚hàhâ~fâ‚fá‚fà‚hÝ~hÜ|jÜ|hÙ€kÙ€pÜ€lÚ€oØ‚pØ~jØyhä“qñ¶€øčú͘úÒœüÕŸü֝üÕŸ÷Ê“ç°€È{i¬MX­MY­MU´NW¶OUºZ[¸T\·VZ¼\^½Y[¾ZYÂ`]À[[¿YX½\]¾Z\À\`¿\b¿Z^Ã\\Á]`Ã^]Ä_`Æ_^Â]^Æ^^Å^^Å`ZÊcdÍdcÌecÎk`ÄZ\¨EQ&Ea?\HZBZ<\B\Bã‚pà‚máƒmágâƒlä‚gâ‚oâ‚hâ€gã‚kâ‚jãjà~fÞ~mâ€jãŠtæŠnætè’påqç‘pêpêlêŽmêŽnç‰mæ„gà|gÝo\Ôf\ÈWY¶HR¦<LŸ7L 6J¢=O¨:J­FR²GQ°@L·KR´HO´HRµMV±HT²GT°FQ´JT²DM´DN±DKµEN·MP¼NQÀQUÁRSÅTSÇXVÈZ[Æ\bÇ]ZË\YË]ZÎ^ZÏ`\Ï_\Í_[ÌeaÌ`\Ða[Ðd\Îb^Óa[Òb^Òc^Ñb^ÎfaÒa^Ð`ZÐc_Óc`Òf_ÐfdÑd^Òc^ÑgeÒfbÔe`ÓkhÒegÒfcÔa]Òd^Ôf\ÔefÑd^Õa_Ò``ÒfcÐecÑcbÌa_ÐedÑgdÑffÐhdÒecÒb^ÒffÑebÑ`\Í_\Ï`ZÎf]Ñd_Ïc`ÌbaÌ`]Ðb]Ðc^Óf]ÒifÒfcÕjfÓe^ÐcaÐd`Îb\ÎebÎc^Ðc`Òa_Ðd\Íc`Î_\Ì`\ÏbaÎ`[Ì`_Ê`]Î^ZÌ[^Î_^Ì_^ÎbbÎaaÉbcÎ``ËbdÎ`^ÎbcËb`Æ_`À`bÃY\ÃZ]¾TX¿QV¹T[¶Zc´MX²OWªJ\®HW¹S^Á^hÐooÖvpØwpÜ}qÜ„wà…pá‰tâŽsâŠsâ†tã†lå†påŠpäŒuã‰lãŠqä‰qä†mâ„nâ…oâŠnâ†jáƒnà‚láfâgá}bàhÞ„rÝ|eÚjÚ|lÛ€mÚ}lØ~mÚ~hØ}i×{iÞ~hé¥{ô¿ˆúÊ‘úÑžûÓœüÖ¢üÖ ûÒœóÃŽážvºb`¦JX­LV¬NZ¶PWºX\»TZ¼V[½Z_ÀY\¾[[Ä[ZÀZ[¾[]À_\½[\¿_a¾]_¿^^ÂabÂ_bÂ\\ÀceÅa^Ê`[Éb^Ìb`Îb\Ðd`ÒhbÏfeÃ\[¦@Ly!B^>W>X<ZBY>[9_@âlà‚là„sâhâ„jâiä„hä†kä†kâ†mâiàƒpà€màlá…pä‰påråoænè‘qæ‘pèŽpèsç‰jèŽuèˆoä‚dâ{jÝreÖjeÆ^a¶Q\¦@Sœ8MŸ9L¤?P©@M®DM²CN±BN¶FP´GR´LT±IW´FP³HT°JT´FO±DN¯JS±DL¶KS¹NR»QW¼UZÁSWÀY_ÅXXÂY\ÈWZÆ^[Ê\\ÊYVÌ`]Í`\Ï^`Ð`[Ða_Ñ^\Ða\Òd\ÎdbÐc_Ðc]ÏfdÒd`ÑfcÐa^Ïb_ÎdaÒa]Ñb`Òc`Ô`[ÑaaÑdbÒfbÔd_Òd_Òf`Òc_Ôb^Òb^ÒdaÔc\Òb\ÓcaÒ^[ÐbcÓjiÒdbÔb^ÐdbÑcbÑabÎaaÎdbÑdaÓgeÏa`ÎdfÌbeÎ`bÌfbÌgbÍf`Ì_]Í_^Ðb]Ðd]ÐgaÑgfÐigÒjfÐgdÑdcÐfbÎdaÌfcÐd`Ðb_ÎgfÓfbÌ`^Ìa^Î\[Ía`ÎcdÌcbÎdeÍ_ZÌ`^Ì^bÍ_`Ì`\ÎbbÐcaÍadÌabÊ\ZÏ__ÊaaÃ^dÀbgÂ^d¿Z`¾VZ¾TY»S\¶P[³NX³NX®HV­FX³Q^¼[gËfgÓol×xqÛ~uÜ‚uâ…tã‰râŒxãˆväŠwãŠoã†oäŠqã‹räŽuæˆmåŒmå‹qã…jã„má…jã†oä†ná‚pâ‚hàkà€dá‚j݁lÝ~lÜ~jÚlÝ}jÙ€pØlÙnØ~iØzeØxf߉jð°øÅŠúΕûÓ ûÔžüÖŸý֝øÌ“íµ„Ð…l«NXªISªM\°NVµTZ·V^ºTZ¼X_¾Z\Ä\ZÀ_`¾\`Ä_[À``¾\]À]`¼^`¾bbÀ]^Â__Â^^Äb^ÆbdÌ^]Ìb`ÐfbÐg^ÒgdÒiaÄZ[¤>Lu$CZ<V@YBZC^D\?\>`;â‚jà‚oâ‚nâláƒlæ‚jâ…mä„kä…lãƒlà~nâ‚nànà‚ná†oãŒqætæ‘oèŒpæ‘ränæoåpåŠkæ‰lç‰oç‚dä|fÞqbÕhbÈ^^´V\¤BRž=O9N¥=J¨>J®BPµFP²FO³OWµIRµFN´KQ°HP°IQ®CO°DL±KP°EL³EK³FR·OX¼OV¼RU¿QPÄUUÃVVÆWVÆZYË\YÈZWÌ\VÈ\\Ì\XÍ_^Ìa[Í`^Ïa`Ña[ÎcbÌ`_Ð_]ÎefÐ_[Ðc`Ñb`ÎdaÒb`ÍdcÐbZÏabÑc`Ñd\Ða`Ña]Òc`Ôd`Ôc^Ð`ZÑaZÔc`Ò`_ÐbaÒbaÒd_ÐcbÐaaÑeeÔc`Ò`]Ò`]Ô_\ÒecÓfgÎbbÏa`ÎacÏbbÎb`ÌjfÌbbÎe`Îc`ÌcaÍbbÎ^\Í`ZÌb`Îa]ÌcaÑedÒghÐkmÑooÑefÎdeÎb^ÏfdÐb_Ìb`ÍbaÑfcÌ`ZÌa`Ì]_Ðb[Ì_`Ë`]Î``Ð`\Ê\]ÌZ[Ê``Ë`^Î^\Ï`^Ì``Í_^Ì_\Ï_^Ê^ZÊ^`Â\`À]h¿\dÀelÂV\ºPX¶T\³LZ²JX°NY®FT´OY¸V^ÌecÑok×ztÜzn܁sß„pàŠvâŒyäŠvåvä‰pä†oá‰täŠxä‰rãnäˆrä‰pâˆoäƒlà„nâ‚pâ„oâ„râ€fá‚sà‚jÞƒpÝ}kÜ~nÜ~lÛjÜ€jځoÙlØ}oÚ|kØ}lÚ{kÙyeæœtó»‡øÉ’úÏšúÓ ûÖ üؤüÓ˜õÆŒä¦w»jbªLT°R[®NU¸T[µPW¹X^»X\»X\¾Z\¼\`À`aÀZ^½[]¼\_¼`e¼Z^¿^`¾aeÂhjÄabÈabÊb_ÊfeÍedÑhgÒigÒlfÆ\]£?Nx#D[AR@ZFXFX@\CZB]?aAâƒqà‚lâ~iâ‚lâ„mä‚iäƒnä„mã†râƒlâƒnà„màjâ€iã„mæŠtç‘nå“tçtä‹nåŽlæpäŒpäŠlå†jä‰ræ‚hâ{hÚwhÖheÉ`d´OZ¥@Rœ8N;N¥?O«AK°AL±DN°GP²QX³DM´FO²DN²EL²HN²GN±HN±EL±IP²GN¶HPµLQ¹PT½NQ¿UU¿SVÄZYÂWXÅWVÉZXÌZVÎ\WÈ\\Ë`\Ð_]Î`[Îc^Ñb[Ð`YÎc_Î`\ÎccÎc_Ðc`Î`\Î`bÍb[Ð`^Íb`Ò`ZÒc_ÐdbÐb]Îb]Òc]ÒdbÓa^ÑcfÐ`]Òc]Ñ`[Îb_Ï^ZÔc^Ñ_ZÑb^ÒecÐ^^Ób^Òd`Ò\XÒ_[Ðb`Ñ^]Í]]Î`\Ïb^Ìa^Ð``Ð\[Ïb^Ðc]Íb^Ì``Ëc`Í^\Ì`\Î_YÍbbÑfdÑbbÏedÏfdÎffÍbbÐc`ËbcÍa`Îb`ËdbÐb`Ðb]Ìe`ËaaÌa_Î`[ÌddÌ[YÊ\_Ë]\Ë\]Í^ZÌ`^Ì^ZÌ`ZÍ\]Ð^\ÎZ\Ï\ZÏa_Ê`\Ë]]Â\`Â[`À[b¿Y]¾X`¾RV¶QZ°PZ²S\¯JW«JZ®O[¶P[Æ`dÐjiÖxpÚzvÜ€xÝ„tàˆyâ‰vãŠwãŠxä‡näŠrã‡máˆpá‡sátä‡näˆkâŠoá‰qàƒgà€mâ‚jâ‚jâ€hàmÝhÝlÝ~jÛ€lÜ|kÛ€jÚ}jÛ~lÛ|iØ{kØ~k×~lØveÔvfÜ„jì¬|õÉøÌ’ùÒ›ûÔžüÕžû×¢úҗf֌i³TW¬JS°PU´PZ´RV¹V[»Y\ºVX¼V\¾UXÀ\\À_]¾[^¾\]ÀWZ¾\`ÀZ\ÁadÂbcÃfiÆdhÇddÌedÎgdÒhiÓldÊ\[ >OnA_IV@XEZA\ LZ?]>\>b<c@â‚hßlànâƒtä†qä…jå…mä„lã‡mãlàƒrâ„oà‚qâ†päŠsçtçvæsæ’oårã‹qåŠsä‹rá„kåˆlæ‡læ„jã}dÞtcÖh\ÊZZ¸LT¦@Nž6I5H¥>Mª<I°=J¯BN¯JR¶JR´HP²HR³CO±JR³JP±FL´FK°EL²EM´HN¸LP¹MP¸PU¾LR¾QSÃWXÅZYÆZWÈWUÈZXÈYTÌ`\Ë_\Ï_[Ð`^ÍZVÌ^\Ìc]Ïc_Ò`[Îc_Ð^_Ð_ZÐb^Òb_Ì]^Î``Ð`^Î`^Ñ_\Ñ`YÎb`Ò`ZÐ^YÓd_ÔfdÖe`Ô_\Òa\Ó`YÒ`ZÐ``Ð`\Òb`ÐfhÑgfÓdaÒa_Òa\Ó^\Õ^WÒ_ZÑ]XÒZVÐ^[Ï^[ÐZWÒ]WÍ]^Ì\^Î^]Î]YÎ^ZÍ`ZÌ^[Î^ZÌ`]Ð\WÌ][ÐaaÍ`_Ïb`ÍdiÎdbÒcbÒb`ÎcaÍbaÑc_ÏcbÐd_Ï_\Î`\Î^\Î\ZÎ^ZÎb^Î`XÍ\[Í_\Í\YÌ\[Ì^^Ê_\Î_\Î^[Î\ZÌ[\Í\XÎ``Î`_É\[Æ\aÂ^dÂZbÂ_fÀV]ºQ\µNW²N[°NW®JV®L\±T`·YhÆafÎjlÔtrÛ{tÜ~xß…yà‰|â‹vâ‹xâ‰xãŒtäŽuâ†pá†ràˆrâ‰nâ‡lâˆnáˆkâˆoã…i߁jàlà„jájá‚i߁oà‚lÞ~hÜlÞ~mÚ€kÛ}kÜ}jÛlÚ}lÙ|jØ|i×zmÖxkÖydã–qòº†øÇ’úКúÔžûÖ¢ûØ¡ü֝÷ÊŽç°~Çw`¨JU­KS°OX±TW¶X^¼]]¿ZYÁ\]½Z]Á\ZÄ^ZÀ[]À\Y¿Z]¿ZZ½Y\¼]cÄbfÃ]_ÅcbÉdfÐdhÒifÒjgÈ\_¤<Nr#Gf4XWDV>W=X<Z=X:`;_?f?f@â€fß‚pâ‚oäjä„næ…mæ…iäƒiä…mâ†râ‚nâ„má„nåŠpærètérç‘sçræoå‰iä‡pâˆnàˆqä‡jæˆpæ‡nã~gàt^Ùg[ÉTQ´FL¨7FŸ8Lš0Gž6I¨<L¯BM°DN°HN¶EN´GPµHQ²LV°JT°IT°DN¯FP²FQ´DL¶GN¸KO¸LP¹JN¼QW¿STÁX\ÆYXÄUUÈZ\ÊZVÇ^\ÌXYÈabÍ^[Îb_Í^\Ë]aÌ^YÏ^_Ð`ZÍbcÍ^aÏ^ZÎ`^Ð``Î`eÏbcÑb_ÎcbÐaaÐc_Ñ`\Ò^XÏ\ZÐaZÏ_`Ó`_Ó`]Ôb^Ò^ZÑ]ZÑ`\ÒdbÑcdÐdlÕhfÒgfÒebÒ`aÕ^ZÒXXÑYVÑ[WÎZZÏZZÎZWÎ]WÎ\XÎ`\Ì`bÐ^[Í`[Ì\_Ê\ZÍ_\Ê`]É^]Ê^[ÈbaÌZXÎ`bÌ]^ÌbbÏfeÏcdÐcbÐaaÏdbÒddÎcbÌfcÌ_ZÌ_]Í^ZÌ^\Ì^[Ì__Ì^`Ê][ËabË^_Î]WË_`Î`^Ë^]Î`XÍ\\Î]ZÎb`Í^_É^]È^`Ä]^ÀY`Ã\_Ã^a¾^dÀR\¶MX¸NW´LS±JQ±JY¶P^¹WbÃ[fÑfjÖolÖutÜ€xà†xâ…{â‡zâŠuâ‰uáŠwäˆtâ‡sá†mà†qá‡pâ…mà†lá‡hãˆhâ‡kÞƒlâƒlß„ná‚jâƒkÞ„mßjÞ€lÜ~lÝmہmÜlÞhØ€mÛ|jÙ}mÚ~kÖwhÖzlÕvhÜ€dê«zö‹ù͘úÒ™ûÕŸúØ¥üÛ üÔ™ò‰ڜw´\Z¬JP²NT³RW´V[¶ST¾ac¼^cÀ`aÄY^Â]^Â^^¿Z]¿\\¿V\Àab½^cÃ\\Á_bÆbbÎd`ÒheÐhhÊ^X¢=MsAYA\FYDS:U7Z<\8_=c9h=j>c9äƒpã„oä„mã„jä„hæ„nå…lå„hå…oã†oä…jã†rãˆuçŽoètç”rç”tä‘ræpåŒsã‡hã‡kâ„oà†qåŠhæŠnç†låcàsZØgZÊXR·JN§<Kž6Hœ3H£;I¨CN®?M¯DO²HS±DNµHP³IR²HN²LV²FN¬KV°FN±HP°EP´HM·KT¸KO¸KR½SVÀSRÂTWÆXUÄZ\ÆYXÈYXÈ\[É]ZÊ`ZÊ`ZÌ^WÌ]ZÍ]ZÌa\Ì^[Î_[Î_[Î\]Ìb]ÍabÎa_Ña`ÌchÎ]]ÎbbÐbaÐacÑabÒc]ÎacÐ`]Ð`]ÒddÕ^^Ô`aÒ\]Ð^^Ï__Ô^ZÔ^^ÑedÓfeÒhhÒgaÒadÑ[\ÎZXÑ\ZÍ[XÊZWËVUÎWRÍZZÎVWÎ]\ÌbdÎ^[ÍZYÈ\`Ë\XÌZ[ÊYYÌ^\Ì^^Ì\ZÎa^Ða_Ìb`Ì^^ÎbdÐ`^ÎbeÌbfÐb^ÐdcÏhfÐbbÍb^Ê\\Ð_]Ê^\Ì_bÍa^Ê`aË`aÌ^[Î\ZÍ_]Ì\XÉ]\Ì\ZÏ]\ÍZ]ÈZ]Îa`Ì^aÎ_\Ë]\Æ\_Ä^bÃU]ÄX^¾V^ÀYb¸OW¹QX¸NVµLU²LX¶Pa½XcÆaiÎfjÔprØwtÚ~wÞƒyß„và†xãˆ{âŠtâŠxâˆtà‰vá‡tá‡o߇tâ‰oà‚mâˆjä†kâ…jã†jâ„iàmâƒmâ‚qá‚nâ€lÞƒrß‚oÝ‚sÜ„rÞ€nÜ~lÜ~nÚ~hÚ~qÙ{h×xkØxi×xdÖvgâlô¸€øÇ‘úÑ›úÔŸúÖ üؤüØ¢øДɁl°IN¬MU²OU´TY½UW¼VX½ZZ¾[^¾^]Â\ZÀ[]¾]]ÂZZ¾[`½]]Á^aÆb`Ä^^ÉfdÌfdÏjdÂZ_¢9Kt>W=V:ZCXA[BW;^?^<b=d=g@a>f'Lä„jã…qä„pâ…må†mç„kåˆpä‡iä‡qä†näˆqåŒnåvèrçwé“rè’tèrçŽrçŠlä†jâ†nà‚rá†tçˆkèŠnèŠmè€fÞs^ØgXÊXU¶KP¦=KŸ:Nž4K¦<Kª@M¯BR°BL²FR¶LV²LVµNV±DN±LU²GM°EP²FO²IR±DP²IQ¶IR·JO¸KQ½NR¾TUÅTVÇWVÂ\_Æ[ZÊ[XÆ\ZÉ\ZËZVÌ_[Ì\YÍ`^Ì_]Ë`_Ì`\Î`^Ì]ZÎ^^Ì\\Ï`\Î_aÍ``ËbfÍadÏ``Î_cÓd_Ð_^Ñb]Òc`Ð`\Î``ÏcbÓ^`Òa^Ð`]Ò`_Ð_^Î^^ÏbfÑebÐdeÒa`ÑbbÒdcÎ`cÎ_\ÎYVÌZZËUUÍXVÌZVÊYWÌ\[ÌZ\Î\ZÍ`]Ì^^Ì]`Î\\Î\XÈ]^È[\Î\[Ê]\Ñ[XÏcaÌdgÌacÎ`^Íb`ÌbdÌefÍfhÌa`ÌdhÎ^[Ëa`Ç]`ÌbbË\[É\_Ìb^Ë``Ë_^Ìb^Î]\ÎZXÊ^aÌ_^Ê[ZË^^Î]`Í\`ËbaÐ^\Ï``Ë`aÊbdÇX]ÀT_ÁV^ÀV\¼V`¿TYºLWºNX´NZ°KZ´Oaº[jÆclÎilÓkjÕwxÛ|tÞ€và„xá‚tâ†sâ‹xá‡wâ†tß…và‚qá‡và„oãˆpã†iâ†gä„hâ„mä„jáƒlà€eánàqá„rá€há~kÞƒp݃rÞ„pß‚nÞ‚lÝ~lÜ€oÚzlÛjÚyjÖwgÖxjÔtf×|gì¥xöÀ‰úÊ”ûÒœùÕ¡úÙ§üÙ¤üמ÷Ë’ã§v¹d]®JP²OT´PXºUV¹VV¾XX¾V[Á^`À]`¾Y\¿ZZ¿\^À^]¿`bÅ[]Å``ÈcdËgbÍgcÄZV¢=Ks<X9W@[@\@\BZ=]?^>b=e<e<b:bAcEä‚gä„pä„näiå…lä…hä†jä‡lå‡pä‰væ†pçŒrèsé”té”ré”rè’ræ‘tèpæŠeä‡fâ‡lâ…pã…iæˆoèˆièˆjåcâv^ÜhVÌ[VºHN§<JŸ9J¡9K¦?Q¥?P¬AN°BN²DN³GQ´HS´KT²KT°NV²FO´CL°CL²EP®ENµHO·GP¶JSºNU½PVÂPQÂTUÆUVÆYZÄZ]É\\ÆVVÊ[[É\\Ë_\Í^ZÎb]ÊZ]Ð`\Î^\Ía`Ê_aÌ^ZÊ]`Ð]ZÎ`aÌ`^Î`aÑ`^Ð`aÔ``Ò`_ÐaaÐb]ÑbbÒb]ÓbcÏ_`Ï_^ÐaeÓehÑ`^Ñ^]Ò_\Ñ``Ò``ÒcdÏbbÓddÑ\ZÔ\YÓ`_Ð[XÎXVÍZXÉZVÈXYÈVWÌ[XÈVDÌ[YÍ]ZÉ]^ÊZ[Ì^[Í\\Ì\XÌZZÉ\YÆ\YÊ[^Ë_]ÍabÌ_`ÎbeÌ`aÌ]`ËabÍheÎbeÍcbÎ_`Í__Ê^]Í__Ë^^ÌaJÎabÍ^`É^^Ëa_Ï^\ÎZXÌ`\É`cÊ\`Í]\Ì[^Ì^]Í[]Í`]Ê``Ç]`É^_É[_ÆW_ÅX_ÄT`¼RX¸QH¶L]¸N[´HX¶JX¶LY¼Y]Ç^bÏelÒjjÔqnÙwsÝ|rÞ€rÞƒvá†xá†wâ‡tâ‰vß„wÞ†t߆s߆sá‰rá‰mà…râ‡oá…là„Vâ„oà‚pâƒkà„qãƒoà€jß„nÞ‚p߆nà‚n߃TÞƒrÞ€m݁nÛoÛ~qÙ~oØ|nØvmÕrOÒqe܃iï®löÄdùÎúÓ‚úØ—úÚžüÛ¡üÖ õƘښ³\~«Nw®Ni´PZ¼VV½WU¼UZ¿XZ¾[YÀ_[Á^[¿^\ÀaaÂ^^Â_`Èd`ÇgeÍg]Â[]¨CUw#R[NXNTG_DZ2]B\:`Hb?eBe;b<`<d@d >ä‡sâ…lá…nâƒkä…mä‰läŠnæˆpå‡räŠtåŒrèŽqè’uêré’qèrêoèpèkå‡jä†mã†mâ„lã†lèˆiæ‹lè†gä~eàr[ØfVÉVP´HM¨>Kš6L;M¥;K¨BP®BR°@M´IR´GP´HP²HQ²JQ¯FM²FN°IS²EK°CM²BM´CMµEO¸LTºOW½OUÂRRÄSVÄSUÆXXÉWTË[ZÈZVÈ]YÆ\\Ê[ZÌ\YÍ`]Ð__Í^]Ð][Ò`]Ï_]Í_XÏ`^ÐZZÑ]\ÎYZÎ^`Óa_ÎceÕb^Ò^`Ñ^\ÒZXÒ``ÎbdÏ`bÎa`Ñ`^Î^eÐ`eÐ``Ð^^Ð`_Ð^]Ð`aÕcgÓdaÒ``Ñ^`Î][Ñ[XÏZYÏWUÍXYÉ[\ÈXZÆX[ÊXVÊX[ËZ[È\^Ê^^Ìb`ÈXVÄ[ZÉWWÌYWÉYXÈ]\Ê[XÎ_^ÌabÊafË_aÍefÌbcËbfÍejËgfÊfjÌaaÎ^\ËbdÍ`_Ì`aËbaÏa_Ë\`Ð][Î^^É]\Í]ZË]`Î]\Ì]\Ê\XÍ[]Î`]Í]]Î^]Ê_`Æ`dË]^Æ[_ÉW^ÅW^ÁRY¿T^µP[·P[¹RZ´JX¹LYºQ^½VaÈYcÏbfÕhkÕqnÙwqÝ}tÜ}t߁uà‚tÞ†vá…tâˆuÞ„vá„qà†oß„ná†kà†mà„náƒnáƒnà‚iá†mÝ…pà€ná„pà„pá†l߁oàn߃mÞ€pàƒmà‚r߁pÜ~oÚpÝ~pÜ~pØxjØzjÕtcÔtcÖveçžsô¿ŠúË—ùÒ úרúÚ«ûÛ¦ýÚ¥úΘ賆ÂvfªLU«JS±NX¶PW»QTºVY¿VX¾\]À^^ÄZX¿[\Â^aÄdhÇbbÍdbÏhgÅ]\¤?Pu>Z9W;V=Z=Z@a"LaBfFdCf;iAd<b@d@f>e<ä„wä†mä„oãˆlâ‹väŽrå‰nä‰næ‹yæpæsè’tè’oêrépê‘péjèŽnçŠfç†jäiâ…mâ†nã†kå†jç‡lè†læ|eÞp[ÙdTÌ[R¶HP¤<Hš5Hž4I¢9Hª@P®@O±CN¯DQ´FN°DO®FL°FN­HP®HN°EQ®EQ°CO²JU²IS·FP·LTºNTºQX¼PU¿X[ÂRVÇY[ÆVTÄVXÇXXÈ^YÅZ\ÉVXË^XÌ_`Î^YÎ][Ï\ZÎcdÎ_\Ñ\WÐ\ZÏYYÌ^^ÉX\Í^\Ð\\Î``Ñ\]Ð[ZÔ`_Ñ\VÐ^\Ì\_Ê^bÎ`_Ð_aÐckÏgkÒbdÑ`^Ò`]Ð^^Ò\\Ñ_^Ò`^Ò^]Ï]^ÍZ\Ñ\ZÑ[[ÍZXÎ[WÎ[WËYVÇYZÉ^`ËXTÊ_aÊ]XÌ]XÌ]VÆXTÈXUÂ\XÃXZÉVWÈ]ZÈZZÊ]]Ì`bÌ`cÎabÌ`aÍdcÌaeËfjÌccÊejÌabÍ``Ê]`Ê^`Í^^Ï`_Ï`^Ë`^Í]^Ì^`Ì][ÐZXÌZXËZZÐ^_Ï_aÐ[XÎ][Í\ZÐ\\Ê]_Î_cËXZÉWZËY]ÄV\ÃQZÂY`¼T]¹T\ºPV¸JT´JZ¶M[¾UcÆ[fÌblÓklÔmpÔtrÙzqÛ~uÞ€uß‚tÜ€t߃sá„tà„tÞ†rށmÞ…oá„là‡rá†lß‚p߃oàoá‡q߃lÞ€oá…ráƒnâ‚làƒoàkàƒoß‚jÞ€pÞp߃qß~lÚ{pÛ{nÜ{oØzlÙ{kÖviÕtfÖrc݁fî­~øÆŽùИùÖ¤úئùÚ©üÛ«üÖ£öōܞy·^Y¨DO¯FQ´OT¸RX½SX½TYÀZ\À^^Â]_ÂbbÂ_cÌecÊfdÏfeÀVWœ:Js?X:W>V<Y>YC^D`FdDdCe>d@d?^>d=cAa<^;äˆvãˆnäˆoã‡gä‡råˆjå‡qåŠpæŒsæuê‘rêrèŽoêséoéŠjèŒfè‹kè‰eæ‡nâ„kä„jã‰rä‡oçˆlç‰næ„gä}gÝq]Öi]ÊXQ¶FK£6Fž0C›3G 8J§?N©BN°CP²DJµGM±KT°CK¯GN°FN°DL®GP°HN¯HQ²GP®BNµEPµKR¸NS¼QTÀSUÂSUÃSXÅZ\ÄVXÄVXÃVYÅW]Ç^^È]YÈ\]É\\Ë_ZÈ[WË]\Ï_]Ê^^Î\YÈ\ZÌVVÌ]]É`cÎ`^Ð^_Ï`_ÑabÑ^^ÐabÐ^ZËZYÍ`^Î`bÌ_aÑ^]Ò`cÐ`bÒ_aÏ`cÐ`^Ï\\Ó^\ÐbcÏ\[Ò]]Ô\[ÒZ[Ò[YÏZZÌZZÍ\]ÈYZÌTTÌ\^ÊXYËVVÊXXÊ[XËZZÇTSÉVTÉTXÆVVÅTWÂZ[ÅY[È\^Ê\ZÊ\\Ì`bË]`Ë_dÈbhÊbeÎehÎacËabÐ``Ë^^Ê^^Ì^_Ë^`Ï^aÑ``Ï`^ÏZ\Î^aÌ`_Í\ZÊ]_Ë^\Ê[^ÌZ\Ð]XÍ_`Î[XÏ[\Î]\Ì]bÌY^ÉZcÇV\ÄUXÀV_¼Wa¿Wd¸U`¹NVµJX¶HY¹KY¾R`Å]fÌchÒhk×pnÔwsØzsÚzqÜ~oÝ€uÜ€uÝ„tà„vß…xÞ†sß‚o܆tàƒjà‚oáƒhàƒpà‚pß‚láƒmá‚oà~jà~kâ‚jã†rá„oà„là€oÞƒsà€nßnÞ~mÞ~lÚzkÛzjÜzlÙyiÚwf×ufÖqbÕpaÕrbæ–pô¼„øË”úÔžùÙªúÚªüÛ¬üÜ©ûÒ™ñ¾ƒÎƒhªJR¦DO¯OX³PV·PT»RYÀUZºW`¾Y[À_dÃacÈdfÌhe¾W[>Nn@Y<X@U>Y?V=\Cb"Od'Pe#Kj%Ld$GdDb>d@b>_?^<`CåŠwâŠpåŠnä†päˆjæ‹päˆqæŒvètè’uè“véoèpé‰oèˆièŒkçŒfçˆkçˆjæ†lä†næ†må‡qçˆjéˆhè‰lç‚gä}fàp[ÖbVÈUP¸AJ¦:I™0Fœ2G£<N¦:K«BP±HR²JT²FP±AP³BL´EP°EP®DN¯EQ²EO°DN¯EN°GPµEMºFN¼NT¾PTÂQSÄVWÁX\ÃVVÅZ\ÄYXÆ\YÁ\^ÄWZÉ][ÉVTÆYZÎ]ZÍ]YÈ]^È\`È^`Ì[ZËZZÎZWÍZ^ÏYZÍ[]Ñ^`Ð\ZÔ^`Ñ^^Ñ_aÒ^ZÐ\ZÐbaÎ`bÐ^]Îa_Ð\]Ð`dÐ\^Ða`Ñ^\Ð\`Ñ^aÔ^^Ñ^aÒ\^Ó^bÐ\\Ð\\Ð^^Ð[[Í]aÊ\[ÌXYÎ[WÏZUÌYTÈTPÇTTÆWVÈWSÆWYÅYUÆVVÉVQÃXZÄVVÈXXÉWWË^\É``Ê]aËabÊefÍafÌbdÊbfÌ_^Ë]`Í_eÎ^]ÌZ[È^cË^`Î_`Í_^Î^`Î][ÌYXÎ^`Î_`Ì^^Ë^bË^ZÎ]XÌ\ZÍ][Ò^^Î]\Ê\^È[`ÈY_ÇUZÂTZ½R[¿S\¾S\¼R\¼PZ»OZ¹L\»NYÄT_ÆZdÎbdÐflÕopÕrnÙwsÚwoÚ|tÝvÝ€u܁xÞ‚vÝ‚tÞ†sß…sÞ‚oà…káƒlß‚oá€iÞ‚tà€ià‚làjà}iß~i߀lá‚pá…nâ‚rál߀jàlÞ~mÜ}nÝ~jÛzjÛziÛ{iÚvjÚubØtbÖtbÕp_Ön_Üdî­y÷ÈŽùÑ—øÖ¥ùÚªûÛ©ûÞªüפøȍå©z¾f[§EP®LR¯OX·MS¸QYºRZ¶T\¼Z_À\`ÅddÊd_Ã\\¥?Lt?Z=V=X@X>\>Z@^@d@fAdAa>b<`@`<a:_>_9Z>\>å†mäˆpå‰oæˆpä†käˆpäˆpçsé’yè”réxçˆjç‡lç†hèƒfè†cç„få‚eç‡jèˆnå‡räƒhæ‡oæ†oè†jçˆkç†låzfÜp\ØgXÇYU´EM¤7Kœ1H4I£:N¥<O«DT®DO²EP²DJ±HS¶HO±HS¯GO´LR°AL±JP®DO¯DM²IO¶FJ¹IP¼MR¼NQ¼RXÄUXÈXTÇYWÆTTÆTTÅZ_Æ\[Æ\[Ì]ZÌYXÉXXÌZYÎZZÌ\bÎ`_ÉYZÍZZÍ\\ÐYXÒ_^Ñ^bÎ`aÑ^bÐ^bÒ][Î\_Ñ\YÐ\bÎZYÒ`^Ó[ZÐ`]Ñ_`Ð^^Ð_bÒ`^Ò``Ò]^Ñ^]Ð__Ñ``Ð]\Ï\^Ò^^ÐZZÑ\ZÔcaÒ^\ÓZXÐ[WÐZXÏ[UÊWVÌZVÌXTÃXVÈURÆXUÄUVÄWTÃSRÅXRÂTR¾XWÆVUÈVWÉ\[Ç\]Ë^_Ê\`Í_bË_dÈadÎbeÍ^aÍ\^É\aË_`Ë^_Ê`eÌZ\Î`gÍbdÍehÎ[^Î\_ÏbfÍ^bÌ][Ê_bÍ\XÐ\YÎZZÏ]YÐ^]Ë_aÉYZÄY[ÈZ\ÈXZÄRWÂX]¾RV½S]ºQ\¸R]¶NY¶KX¸MZ¿R]ÄXdÎ\`ÑjjÒlj×qnÖtrØxpÙypÜzpÛ~sÜ€wÞ~pÜ„w߃tà…tßjß‚lá€jànàƒnÝ€rÞ‚lÜ€qß~gá€kà‚lß~lâ€nà~jâ‚nâ€qßmà~lÞ|jÞzfÛwfÛxkØvfÚtgØvjÙtbØsbÔqdÖq^×o\Ös_ä“oòº‡ùÌ”ùÕ¢øئúÚ¬úÛ§üܧüÔ›ð¾…ÑŠl®MRªGP®LU±MV±OV´RY¸SYºZ]À]bÉheÁYY¤>Hw"A^>V<V=X>Y>]A_BaHg"If&KdCb@_DaD`B]?^<^:]>\;ä‰pä…käŠläˆlãˆläˆrä‹qè’uê–ué’vèŠmæ„hæ€eæ‚gæ€hæ‚bå€eä‚iç†gè‹dç‡må‡hã…nä†læŠnçˆlè…nå|fÞub×bWÉVS±DM£=L˜/E3F£=M§=N®AM­CP°DQ´EN´EO±GR²EQ²BN²HR²HO°FL®FP±FO²FPµHPºLR»IR¾PTÁU\ÅRVÆVVÆVXÈVXÆXYË\ZÈ^[ÈZYÊ\YÊ][Ì[ZÎ\XÌ\YÊ^`ËZYË\[ÎZ[Ê\^Î^\Ï^bÑ]]Ð`bÑblÐ[^Ò^^Î\_Ë[]ÍZXÎ_bÐc`Ô^^Ð`_Ó^_ÑbcÒ\_ÒabÑ[ZÓ^`ÐZ_Ò[YÐbbÑbbÒZZÒ^ZÐXYÏZYÒ[\Ò_\Î[\ÎZ^ÎX[ËZ^ÈXcÆdqÄhrȇÇuzņ‘Ày~Àv~¾jp¾kr¼[`½X^ÁWVÅWVÆXWÉ[XÃXZÈWZÇ^^Ç\_ÇZ_Ë[_ÈX\Í^aÍ^^É^`Ï^`Ì^cÍ]`Ð^aÌaeÎbcÍ`dÎ\\Ñ]]Ï]^Í\`Ì`cÎb^Ñ[UÐ^ZÌ]ZÎ]`Î]^Ç\^ÊZ^É]\ÈY_ÃS\¾T^½Q\»R\¸VaºPX¶JT·JZºLY¼P\ÅT`Ê^cÐhgÔlkÕnfÖvqÙtiØwpÚzrÚ}sÚ|vÝ|nÝ€uÞ‚tÞ‚rÞƒq߁oÞ€l߀mà€m܁qÞlß‚pßjá€jâ‚kâ€iâià~hàoáià}hßzlÝzgÜzjÚwjÕuj×qdØwhØqeÚrcØtbÖrcØsbØp_ÖrdÜ{dì©xöÅŒùΘùÖ¤úÚ¨úÚ©ûܪýÙ£÷̐æ­}ÀhZ¨FR­JT°KS²PX¸U\¹RZ¼^bÁb`¼X\£@Nv@[>X?W=X@X>\A_AdCa FeFg"IgFaEa@dAb>^9^<`;_>]<æ‹xä‰qåŠså†nä…låŠtçŒnê’uìréˆhæ†hå€hä|cæ}cäz_ãz[ç|bä€cçˆlèŠjçŒpç‰lä†qå‹uèˆlé‰pêƒbå~lát_Ùj^È\[²GS¥;K™3Jœ2H <R¦=N­>O®CL²FQµFN³HSµKT´LU°GN²FR²GQ²FM¯EN°FP³HN¹GN¸PW¹NU¾RY¾QYÄUTÌXUÅWXÈZYËVXËZXÉZVËYUÍ[ZÊ[YË\ZÐ]\Í[\Ì\`Ì^cË[\ÑZXÎ]aÏ^]Òa\Ð\\Ñ[^Ð`bÒ^bÔ`bÒ]]ÎZ]Ð\]Ï\^ÒljÒ_aÐ``ÒbbÒdmÏ]`Ô\`Ð]_ÒYYÑ_`Ñ[[Ó^\ÒhfÍ_eÒY\Ï\`ÌZ\ÎbnÈ_fÍz‚ÈpuÅuÂs{¿x…Å„‰ÊžÏ”‰Î šÔœ•Î¡¡Ðš’Ѩ£Ô¤”ͤ¢É œÀ€†Áu}¾[]ÁVYÂRTÅTTÂVVÁVZÆXZÈ\aÌZZÌZ_ÍZ]Í\^ÎY]Ê_bË]aÏbfÎbfÎ`hÎacÍ_dÍ_cÉY_Í[]Ë]aË\\ÑZZÐYZÌ__Î\^Í[ZÌZ]ÌY_ÇYYÅV\ÂT_ÀR[¼Q\½S[ºR^¼LV¹KT¸HT¹NY¸UaÆU_Ì`eÒgdÕklÔqnÖsmÕup×toÚulÙxrÚ{uÛzrہxÝ€tÞ€o݃r߁lÞ‚pÞ~jÞ~mÜnÝ}oÞ€lÞ€náiâgâ€lâ€ià|hà~ià|iß|hÞyhÞvfÚxfÚvhØwlØvdØvjØrc×tg×udÕpaÕvdÖsdÕqaØqbãpó¶ŠøÈ’ùÓœúצúÛªûܪýÛ©üÔœóĈזt°RW­W_®OX³SZ¹U]¼Y^¼_a¼VV˜8Jq B\:V?ZBZAY<Z@]@^BbDgGh"Fe#IcDfAcE`=]<]>]=\<^?\<æŠuäˆnå‰kæˆlä…nèŠmè’yê”sê–pé‰læ‚eå}eäw]âw^âu\ßxdâw]âjèŠnæ‰hæˆnå‡mä†pä†réŒrçŠpé„hæ}dàs_Üe\Í]Z¶HO¦<Mœ6Lœ2J 9K¨<L¬=O°@L°BQ²FR²FUµFQ±JX®FP³EM´HO´FM³CN²DL´FL¿FL¹PS¿PVÀNQÂLPÄQVÈUSÇYYÇVWÇYXÊYZÌ\[ÌZYÊ^[Ì[VÌ\YÏ^ZÌ]^Ì^^Ð\^Î^]ÐZZÒ\\Ñ^\Ó\\Ð^`ÑcdÒ\aÏ]^Ð^_Ï[_Ð^`Ó]_Ï^^Ë]_Ð]\ÐabÐb`Ò`bÒ\^Ò^\Ò^]Õ_[ÒX[ÒZZÐ]^Î\bÐirÍivÇr€Æq}Æ~‰Â}ŠÃ}‚¾|ˆÀ~ŠÈ‰ŒÊ––Í’ˆÏ”Ï¥Î¡›Î£›ÎŸœÓ­Ñ¥˜Ö´¦Ù¨˜Ö°§Ú³¢Ó¤šÊ§¥È˜™Àv|¿`h¿WZ¾UX¾VY¿X^ÄV]Ê\_ÈZ`ÈZZÊ\^È]_Ê`dÉehÈdlÉagÌdiÌcdÌ`bÌ\^ÏaeÏZXÍ^^Ð]^Ï[^Î`_É[^Í\^Î^`ÌZ\ÇY^ÉUVÃX^ÁV\ÁNV¼OZ½NZ¼P[¶LX·IV·LX¸P]ÂX`Ì\cÐed×kjÖqjØsnÖqmÕtlÖxpØtl×{xÛzrÜ~pÜ~vÞ€pށpށqàqÜ{mÞ~nÞ~ná~kà}mÞjà€lâjägâ€gß{eá|hßzjÞ}fÝzhÝxdØwfÙtfÖvj×tdØvh×rb×paÙr`ÖscÖrbÖsdÕobÖubÚxeë¡wöÀŒø͘úÔ¤úبûÚ¨üÜ©ýÚ§üÏ—ì´Êxa¯NU«KT¶UZ¹U\Â_\¼TVŸ@Nq@X
:V<V>X:W>Z:`@`Ae!Ga@f$Id$Jb"Gd"FbE^>[:Z:\;a<^;`<`=æˆqæˆræ…nä†näˆtçŽqì”sì”uë‘qè†häbãt]ßt\Þp^ßn\ßqcáv`ä‚jç‹oèŽmå‹næ‰lçˆqæˆqèŠlè‹nê„iæhÞscÜgXÎZV´FL£:G™2Hœ6F£9I¨:G«>N¯?L°BR·FP²ER±IQ²DN¯DM¯EN³GP´HP¶HO´EN¸FK¾JO¾MNÁNVÁOTÂQVÇTVÈY]ÈWVÊXZÊVRÌWTÌ\YÌZTÎ`_ÍZTÌ\XÍ\YÊ[ZÊ_\Ì\ZÎ[\Ð\[ÑegÐ`bÑ_`Ò__Ò^`Ô^bÔ^^ÔacÒ\\Ò]aÑY^Î]`Ð^]Ò_`Ôa\Óf_Ô]\Ô\\Ó^\Ô\YÑZXÏZ\Ì[fÌivÄw†Ç{„É‚ˆÇ}€Æƒ‡Çƒ†ÀƒÂŠÂ‹Ê“Ò —͐ŒÌ˜”͘‘Ïž˜Õ¦šÔ­¨Ñ¨›Í£žÒ¦›Ò©ŸÐ§–Ѧ”Ò£˜Ö¯¢Û¶§Ú´£Ø³£Ï¥žÄ”—¼pz¼]f»U[¼NWÄWYÇUXÈZ[ÆY[ÆX^È^bÌ`dÈdjËahÌ_eÐ^bÎ`cÌ\_Ï^^ÍZ^ÎZYÎ\_Í\ZÏ\[Ñ[^Ë\^ÎXYËVWÅT_ÆVZÅS[¾W`½SX¾MW¼OZ¼MWµLY°J\·KV¸P\ÄV\Í_fÒfaÓmlÔrlÙtjØsjÖsj×umÕuqÙvlÜzmÚzrÜ{nÞ€sÜnÞ€q߀nÜ~nà€l߀p߀màkÞ|hà~oâ|gâ~gá€iàzfß|hàzhÝvfÞubÜwgÚudØrd×qg×sb×pfÖpfÖpaØpb×p^ÖpfÖn^Ön_×pbÖveß„nð°‚øÆ‘úКøÖ§úÚªüÜ­üàªþئøÉŽâ¡v¾c[²PXºX\¿]]ºXXœ=Lq>[;S:U<Y=Z<Z>Z?^?bDcCcBfCdBdEbA`EZ>X9Z:^8a8]7_=^;æ‡tæ„læ‡kçˆræŠmëpì’pê’lêŠmçhäx`àr\ÝlWÜiZÜm]ÝkYàw^ä‚gèŠlèŒhæoæ‡på‰lèŠoéŽsé‰iê†hå|dár\ÚfWÏWR¸EM¦8Gš2E˜3F 6K§<L©8L²BO°DN³GT´FQ±FL±IR­DR²KO³DM¶CLµGQ´GP·JP¾HN¼HPÁMTÃPRÅRVÉTSËVVÍXWÍZVÆUVÊWTÍZXÐZXÒ]YÐ]ZÏ\VÐYVÌYUÎZZÎ\]Î^\Ð_^Ò_\Ð]]Ô`]ÒZZÑ`aÖ__Ô^^Õ_\Ò`_Ð^aÐ]^Ñ^^Ï\[Ð]^Ò[ZÓ^XÓ]YÑ\`ÒZ\Ð[]Ð[aÌfrÆt‚Ãv€Æ~‚Æ}€Ê†ŠÃz‚¾s|Â|‚ÄzÃ|ƒÊŠŽÒ–ŽÎ™Ì›‘Θ’Ν—Ï£ ÔªÕ§›Ô§˜Ð¥œÑ¬žÍš‘ʝ”ÌŸ–ЪŸÕ¨”Ó©šÖ³¢×­œÝº©Þ¸¥Ø³¢Ð¥˜Â„ŠºdoºPWÀRXÂSZÃY_ÆX^È[^É\aÈ`dÉ\aÌ[`Ï]`Ð^`Ê\eÊ]cË]`É[]Î^_ÌW[ÎYYËZ^Î^^ÇX`ÆT[ÄVaÉUWÂSX¾T`ÀRX¾OX¸P^·QZ´JX²IV»IV¼MZ¿X`ÎbcÔgeÖnjØoiØxuØsnÕtqÕroØupÚwoÚwrÚxqÛ|wÜzsÝ‚rÞ}qÞ~nÞqß{lÞ{gÞ|là~jß{lß{ià|hÞzhá|hÞxjÝzfÞsdÝweÝscÜreÚtdØpeÖn`ØqeÖo`Öod×ocØp^ÔrdÔsc×scØn\ÕpcÔqdÖudç–qô»†úË’ùÓ¢úاûܬûß®þà®þÖžó֍rºYZ¾YZ½XY£GQuA\<R=U
>X>V>X=[>Z>`@dDfDbCb>d@`>`@\@\@[>^<`9b:\8Z9]8è„hæˆoç†iêŒsèrìoì’rêŽnè‡håeàsXÞlYÛ`RÚ^RÚeZÛl]äu^ä…gèŠjê‹iç‹mèŠnè‰pé‰lìkèŠpê†eæ€jãrZÜjZÎVP¶FL¤6F—.Cš6I£5J§:K¨<L°?J¬AP±CPµFN²AM±BP¯FL±FN¯FP³EM¹IQ³CL¶EPºJN¼MT¿RZÄVZÃRUÊTWÌVTÌSUÍWVÉZXÌYYÍYXÐZ]Ð[\Ð\YÎ^ZÑZWÎZXÎZ[Ò^ZÏbaÑa`Ð`]Ñ\\Ñ\\Ñ\bÒ]\Ö^`ÔYYÔ\\ÑXYÓ^ZÏUVÑ\\Ð^^Ð^]Ñ^\Ô\\ÐY]Î[cÊanÉ_pÀfxÆy‚È}†¾qÀz„ƆɄŠÀz„½u~¾tyÇ‚…Æ‚ƒÈ‚„ÌŒŒÐ“ŠÉŒ†Ì””ИŒÐœ™Ô¢•Ð£Ñ®¦Ð¦ Î¤ŸÎ¡šÌ¢Ð ’У™Ô° Ò¦“Ó¬ŸÖ±Ú³¤Ù°¤Ý¼ªß· à¸¢Òª¢Á|‚ºU^¿PVÃUZÂUZÈRWÅ\_Æ\bÈ^hÌZbÍ^dÌ\bËbjÊ[^Ë\cÈZ\Í^bÌ[aÆY`ÊZ\ÊW[ÉY`ÉSYÅX]ÅTYÀR^¿PX½R]ºO[¹QXºPX³JX¯IY·P\»NZÂZ`Ï``ÒhfÙlgÚshÛshÚtk×rlØsnØsnÚvnÜvnÙxtÚzsÛ~xÜ~uÞ~sÞq߀nà|lÛylÞ{nß}mÛ{lÜzfÜvfÝvfÝzfÞvdàxcÞubÜtcÜrbÜp`ÜvhÚsd×ndÖnbÙod×lbØn`ÖocÔse×od×pd×o`ÖnbÔrcÓkbØv`íªzøÄŒúИùبûÛ«ûܯþà¯þÞ¬ýҘÉuf¼\Z§DOz"D\@T?T>XAXD\D`@`DbCcFdEd Eb@b>d@^>W?X>\FbHb=`:_?^9\9`<é„mæ…lçˆpêŒqë“pí–qì‘lêŠhè€eäxZÜmUØcSÖXOÔ[RÕ`YÛo`â{bæƒfê‹léjèŽkê‹nç‹lêuëpëŒpé‡læ‚iâubÚfXÍZTµBI 6J–-F–.D¡4E£5Hª;H°?K¬>M®@L¯AM±DO²@L²DL²FO±ER°BN´FP´IRµIQ¸FO¼IS½MTÂTZÅOQÈTVÊSRËUVÈWVËYVÎUTÎ\\ÌXZÒ\]ÐWWÎZXÑYUÏ[YÎZYÍ`^ÎYZÒ[ZÒZZÒ^^ÑZ\Ï_`Ò]\Ò`cÏ\^Ó\[ÑXZÐYXÐXZÎ]]Ï^`ÊbnÍeoÍpÌpyÅjw¾`k¶dvÃtxË€Äv~¾zƒÅx~Å|~Év{ÇzxÆzzÅ‚ŠÈ‚Æx~Ç‚‡É…Ȇ…Ɛ–ʇƒÎ’ŒÍ“Ì•‘Ó Ò¤ŸÔ¨ Ñ¢™Ò¦–Ï¢šÒ©™ÕžÒª¡Ô¯š×§–Ó« ÚµžÝ´¤Ø´¥Ûº®âÀªá»¦Þ¶¦Ìžœ¹jr¼PYÀPU¾T\ÀX`Æ]gÉ[bÆ`iÉ`hÇ^fÌ\bÈZ_ÉZbÌ\`Ï\^ÈY`ÈZ^ÌVZÊX^ÆXZÆUXÂS[ÂRW¾NV½QZ½R\¼NU»R]¸JS´O[³HV·Q^»NVÆY_Ð^_Ôji×poÚndÚshÜvmÙukÙriØtmÙuoÛwoÚyqÙwqØ}xÙ{vÜ|uÝ|mÞ|qÞ}iÛylÝvjÞzgÜxhÜweÜvcÜubÝxcÛwfÜt`ÜthÛraÜrbÚtcÜp`ÙpeÙqcØk`ÖndØm`ÚkXØpbÖo]ÙpbÚp`Øo^Øo^ÖpbÕl^Ôl`á‰fó¶„úÌ•ùÖ®üÚ®ûܬýß®ÿà­ÿÝ©üÌ“ážy²MR~#CX<W@S>U=W;Z?Z@_CdBgCe?cEcAb@cAaBZ@Z?`F`B`B]:\>Z9Z;_<`:æˆoçŠmèpìoí–zì“mê‹mèƒlæzbàrXÚdTÐVKÍSOÎRN×dZÝvhâ~lä†gèŒlìŒléŽiêŽlè‹léŠlêŒnéŠné„hè}`ãvdÜh[ÌVPµCL¡4F—*B”/Fœ2EŸAX¨>M®@O©>M­>L°AN°BK°FS±@I¯CM²DL±?L³@JµJS´JPºFO¹JR¼OT¿NSÄQRÃTWÆTTÇTTÌVTÉXXÉX\ÊVWÊZ\ËZXÅZ\ÌXUÊW\ÇXTÍ]XÌ]^Ì\YÑ^\Î^^ÐZ\Ñ\_Ñ]^Ò]^Ò[ZÑZZÒX]ÍU]ÌalÉZkÍkxÎ~ŒÍ~ˆË~„¾rz¾fm¸Xe¼Ydºix¼hrÄnsÀpxÄrvÄx|ÅrwÈqwÅvzÈ‚ƒÊ}€É„‚Éxzȁ‚ʆ†ÈŒÇˆŠÊ”ŽÎ˜–Ì™‘Ï”‘Í–Ò¤—ÒœÏ—ŽÑ¨œÖ§”ÏœÒ¬œÙ¨–Ó«¢Ú¸§Ø®žÖ²¦Üº¦Ý¶Ü¶¢Ü¼®Þ¼­à¼¦à¹¥Öµ¨¾~ˆ·T_¹NV¿V_½[dÃV_ÄY`Å^eÉ\dÇV\ÇV[ÆXcÉ[`ÉY^ÇX]ÍZ\ÌX\ÇW\ÃTZÀRX¿R\ÅQWÁNW¾MXÀOUºLV¶MYµGT²FT²IW¸MZ½OVÅR\Î]`ÓfdÖmlØrkÜvnÚulØulØtjØsmÚsmÝtpÙvpØzw×wuÙxsÝ|pÞ}rÝ}nß|nÞzhÝugÝwfÛtbÝxhÜxfÚsbÜr_ÜveÜteÞudÛucÚqdÛp^ÙrfÚpcØpbØpeØn`ØpfÖl\Ùm`Øl^Öl`ÚoaØo^Ùo`ÕsbÔmaÔl\Ùq\ìŸsùĐúÏŸûתûÜ­ýÞ±ÿß®ÿà¬ÿÚ ñ¼ˆ©HP\>RAV@U?XAZAZ?X>bAeDf>d@bBd@eBdD_C^D[@^>aD`>]=\A]?\:_:b9æ‡rèŠmë’xì”ní•vípê†jæ€fãzfÞiZÐXPÆJJ¾EJÇOLØ`XÞrbã|dæ†iêmê‘pêŒkìŽoèŠmémëˆkíŒjê†jèƒgät[Þk\Ð[PµDM¡6H–3G“.G˜5M;N 7J¦=L¨CSªFP­GT¬AL¬AK±AJ®DM­AL²DK±EM´FQ³IS³HR¸KSÁJUÀMSÂLQÆTZÅSTÇUUÆRUÆXZÈZ\ÌUTÉW[ËTXÎWUÌ\_ÎYWÊZZÌVUÍ\[Î[^ÏZXÒ]`ÐZ[Ò]^Ð^\Î[^ÐUXÒX\ÑTZÕelß›ŠÐy€Ñ„Ê}|Ãv{¾ow¾biÀbiÂ\c¾\i¹_n¸dlÀlwÀlvÀnsºfm¿kp¾jrËzxÇqwÅutȁ„È|{Ê…ˆË€~È„…ˆ‚Í“”Ґ…Ï’’ÍžšÑ›Ê”ŽÌ˜—Ò¢‘Ô¤—Ò«¡Õ£‘Óž×´¥Ü®—Ö¬™Ø¸¨Ü±–Ü°ŸÚ·¨ßº¢âº¡Ý´¦Û»°ßÀ«ä¾¦ÝºªÇµguµR_¸Xc¼PXÂS[ÂR\ÀWZÂX_ÉYZÂV^ÅX^ÆX^ÇV\ÆV]ÆX^ÆX]ÄV]ÂT[ÂPTÁPXÂPVÀQWºNX´L\·LW³KU²DR°EQ´KX¼OXÉRWÎ`hÖedØpiÚriÜtnÜvnÚul×tiÙrjÚqjÚwjÜwmÛvnØsmÚvrÜ}qÜ|rÞzkÞ|nß~rÞzlÜtdÚqcÛtdÜqeÚpbÜrbÝr`ÜueÝtcÚvgÜqbÜr`ÜpbÙqeÙpb×pgÙo`Øl`ØpaÚp_Ûn_Øo_×pfÙrcÛo`Ørd×o_Õm^Õk^à}dò±‚ûÅ‘úÒ üبýÝ°þá³ÿä³ÿÞ£ò¾€‘.CM	8P>R=W?V@\@Z=\>dBhCc@bBbBdE`=]?Z=\B_@g#I_@^BW<^B`?_6d=f:çŠrèrë“pí˜vì’qêŠjç‚håx`ßp]Õ^OÄKM°@J´@JÈUPÖdXÞugä~fæ†dêtìlëŽmêŽjêmêŠlìŒmê‹oë†iè~hãvaÝf[ÎXS¶FO 6J”,D0F™2J›8LŸ6H£:L§=L¬=N©@Nª@Nª?K­AN¬AM¬BI²FM²CL°CL³FO¶EL¸JQ¹LV¼NXÁPVÄQVÄTVÄPRÅTYÆWYÃZ^ÆXZÅTSÍXXÊVUÌZZÏXVÉYZÎZVÐXXÎ[\Ñ[YÐZYÐZ\ÐXZÐXXÎY\ÐXXÎw‚Ïb`Í`dÇaeÈmqÆllÀgj½cj»^jÀbh½\g¼[j¼\h´`r¿gnÁnzÂlp¾nvºfr¹erÂhpÅw¼htÅrxÆy|Ê~}ʈˆÈ„ÅˆŠÌŽŠÐ–ÍŽ†ÍŽ‡Ð˜É“Í ›Ðœ—Ц Ö¬Ñ–Ò²¤×²£Õ¬œÖ± Û¯”Ö¥–ײ¢Ý¸žÚ®™×±¥Ü¼­Þ¹£Ý¸ªÞ¼°àÁ±âÁªÞº¥Õ°¨½‚ˆ¯Xf¶NZ»NXÀPXÀV]ÄT\ÃSZÄT[Å[`ÆV]ÇW[ÆUXÇU_ÆWYÂV[ÀUZ¿TZÃOW¾MS¾PZ¶KW³JY´LW²FS²GU²@J·KW¾KUÇT^Ö^`ÖhfÜlbÜqhÞwjßvnÛtmÚthÙslÚsjÜtnØwrÚvoÚwrÚunÛvnÛ{uÝxkàylÞ}oß}qÜwhÚuiÛrbÚn`ÚnbÝraÝsbÜsbÛvfÚtcÜqaÛsgÚp`ÚrbÚufÚpeÙpcØodÙpbØpbØo^Úp_ØsbÚqaØthØqfÙl_×oaÕpfØsfè–sø¼ŠýОüتþÞ°þâ¶ÿâ¬ýԐÑ|_Z8P>Q=T>W>Z?\@_?bBfBeDdAdCeA`<[<Y>Z>`@d!Db?]<\=X;\9`;b:hAf=éŽmê”ví›sî—rëvê„då€dãw^ÚiXÌQK¶BF¤3C²9EÈRNÕbVÝsbä€fç‡hìŽnêŽhêmèŽléjëŒníŒnìŠmêŠnè}hãv\ÝfZÏWO¶CIž4G+BŽ-C–2F›0E¢4G¤:I¦?N¦?L¦@O¨=J¬CN¬AK¯DJ®CM­BL¯FS±FT·FN´HSµHN¸MV»FK»OVÁRYÇQRÄTWÄS[ÃVYÉSRÈUVÇRUÊZ[ÊWZÇ[]ÈZ\ËXWÊW[Í^_ËZ\ÑZZÎWYÎ[^ÏWUÐXYÎV\Ög_ìšrÊNMÀV[¾_d¿\d¼_c»`e¼X]»]g¼\e¹\f¾`n½^cºbl¾ms¼nvÁlp»ip¸doºhpÄptÀsxÂprÄpwÆtwÆ|~Â~…Át|Ë…†Ë„~Î’‹É…‚ĉŠÌ–’͍ŒÓ§—Ó›ŒÐš–Õ¦˜Ù®ŸÙ± Ö²¥Ú°œÖ¥–Ô¯£Ú²˜Û²ŸÛµ¦Ú¶Þ°–Ú­¢Ú¸®à»¦àº¨Ü¸¬Ú»±Ü¾«â¾ªÛ·¢Ã–™´cm²LX³NX¸NW½NX¾T\ÁYd¼T]ÅU\ÄSXÃTYÅS[ÇSXÂTZ¾S]ÀTY¾Q\½NVÀOV»MX´P_·GT´LX±FS®FT¶FR¼LZÁS\Ï_aÖffÚnhÜtiàvjÞyoÜujÝtgÛsjÛsjÜqiØtnØrjØtnØsnÚupÙtnÚunÞ|kÞ|qÞyiÜxoÚpdÚpbØnaÚndÞo`Ûo^ÜpbÞqaÜvfÞp`ÜoaÙqdÚscÛrdÚpeÚo`Øk`ÛpbÙn^Øl_ØpaÚueÙrfÚse×tjÚrdÖpcÒqe×n`Üykï¤|ýÊ•þצÿß²ÿà­þÕ•ê¥p‚)AL:Q>Q9U=X>YB^@dCgGfCcBdBhBb@[:Y<X<]@a@c@`BY=Y:\:]:c<g>c9\8ì’pë™xîœrî”mì‹kéƒiåxbßq`Õ`W¿JI¢:J–+B¯>FÇQOÖe\àtaæ~eèŒkéŽnìkêŽlëjçqè‰jì‰kêŠnê…hçzbãrYÞf[ÐVN¸FNœ2E-FŽ)C“.G™4HŸ8M¢>N¥;L«:Gª>L¨@K¯>K¬@M­CO«BQ¬EP®DO®EN²HT´BN¸GM·FR¸DNºNTÀNVÁPSÃQUÀRXÂVVÃQTÅPSÅTXÊ`cÊZ[ÈXXÌ\[ÉZ[ËZ^ÎZYÏVVÑZXÌZZÌZ[ÌXXÌQWÏXZåœ}Îo\ :T¶NY¼\cÀZbº`i¼X[À^e¸X`º`jº[eº\e¸Wb¾biÂjpÁflÃko¼eg¹fp¼jr¾lvÀnuÁkoÆs{Ànw¾x€ÄrtÅz‚Ɔ„ŃƒÄƒˆÈŒˆË‰‰Ò¥˜Ôž”Л•Î£šÔ¤™Ô¦šÖ°£Ø®šÕ£–Ø´¢Ú´£Ù¨”ر¤Û¸¤Þ®—תžØµ¤à¹ Ý¶£Üº­Þ¿°Þ¼¦à»­Ú»¬Ú¼®Úº¨Ýº¡Ô®¡¸t{­N[¯FT´IV´OZ¸U`ºPW¿NS¾RY¼RXÃR[ÁTZÂRXÀT\¾PYÁLV¼OY¸JU¹LY´LZ³KX¸HQ®FR°AQ³FVºNZÅW^Ñ_aÙjfÝmgÞtlâwlàxnàylÞxlÞtfØuqÙrmÖspØtlØqlØrm×pmÖpi×upÙunÞxpÞ{kÞ{nÚrbØphÚlbØn`ÝnaÜneÜp`ÞsdÞtbÛteÚpdØoaÚrfÚodØqaØpeÚo`ÚpbØohÙoaÚqeÙsgÙteÙp`ÚtdÙugÖrf×ufÖteØshâƒmù¾ˆÿÒžÿÛ¥ÿÒ–ï«xŸBHT=N>Q>T@T@V<\Bb?gCf Fd@f EgAhC`BX>Y=]?cBbA^@X:Z?[>`;d>k?d>T2I2ì“rî–wî•wìré…jæ}fâtdÚdVÊTR«<F—*B–*B¨;IÅRMÔbZÝo\ä|`èŒlêŒkì’jëqêŠlêjèŠmìŠlêŠlêƒiè|bâmYÝcUÏUQ¶CK4D)BŽ)B˜2F›6H :K =L¤@N¬<L©BPªCR«@N¬AO©DO«BP«DP¯GT°CL®DP´FN´HPµKT½LS»NU¾PUÁPSÄNP¿OUÅRTÄRRÄVZÄTVÆWYÇV[ÄVZËUWËZYÎZ^ÌVYÉ]_ÐZXÎZZÐZXÐXXÏ\\ÐXVâuXÂRT²IZ½PX¿V_ÄVYÃ^c»V`½Xb¾_iÁei½[h·Yd¸\dºdp¼dnÃilÀkr¸fq·fq½go¾jsÂouÆrvÁjnÄknÅpuÅxvÃx}ÄvyÆ€|ˆ‡Ì‰†Ð’†Ð“‹Ò¤ Ó¢Ó ›Õ¤˜Ö¤Ô¦šÔ¬ Ø¬˜ØªØ¯ Ø°šÞ°ŸÙª¢Ü¹§à´ŸÜ¯œÜ´§ß¸¡áº¢Þ¸¬Û¼²ß²ݼ¬Ú¶¦Ú½³Ü¾µâÁ¬Û¾¨Á–š¬Wc±DT´MX±JU¶GP¹JS·LW½QX¾OWÀQZ¾PXÀOXÂOU¼N[ºLU¶OZ´O]²HX¶JW´JV±HR­ET´GU¹NZÄP[Ò`eØjdßpiÞvnâzqâ{mÞzmßxqÞwlÚtjÙtnØrjÖro×mhÔtmÖnkÔokÔmfÚnhÛrlÝ{mÞzpÝsdÛtjÛpeÙndÜo`Þr`ÞraàsdÞugÜteÛpdÛr`ÛpfÜoaÜqaÛpd×nbØqhÚpgÙpdÚrjÛqhÝtfÚnbÛseÜtdÚukÚugÝxlÛxnßxjó¢~ÿÈ’ÿÌŒï§q£HNY?Q;T>V@U>V<[=\=dAa>d@cBfBgA`AZ@\A]@`BdA_AV=Z@[>\=bBi"Cg!DW9F3D3î•~î”pî“oìŒkç„hçx^ßlYÒZT¸FNš.>*C–0F¬?LÈRNÒc\Þp\ãyaç‰gìŽlì’jêrê‰nêŒiìqìŒné‹mæƒkæ{`álXÜfXÍVQ³EK›/D(CŽ(B“2J›8L¢4G¢;R¢@RªFW«HVªGY­HX©BP­GR¬COªAQ­EP¬DR¬IU³DR´KV·JT¸IT¼NRÁRXÄTY½JPÁMQÃSVÁSXÂUXÂUZÅVZÇUYÆUVÊUZËX[ÊXXÌ\[Ì[\ÐYXÎWZÑZ\ÒXYÏZVÐpg»NR»MU½RZ½KVÂV]ÂW_¿V]½V_½Za¾Z^¿_h¾\e¼\g¼\eÀdmÅlpÃnqÀks¾en¾ku¾jsÄovÆorÄirÃacºktÀt{¼krºjtÈ{Êyż…Њ…Í’ŠÓ—‰ÔšÓ¤—Ø¢ŽÑšÒ­ Ø¥‘Ï –Ó©£Û¯˜Ö£”Ô¦žØ¸«Þ¶£Ü±ŸÛ¸©ßº¥ß±žÛµªÞ¾¯á¾¥àº§Ý»¬ÛÀ²Ý¾¦Þ»ªÜ¼®ßúâóáÁ©Ë¡šªYg¦CUªBP¬HS¯HQ²JS¶JR¼MT¼PWÀRX»NX»PY¹NX¸NZ¶MV³K^´IVµJU³LX¯IY®AN²FTºJXÅR\ÑZ]Ùihßnfßwnâzräznãzjâynß|qÜyrÜwnÚrlØmiÔjlÕlkÔjhÓklÒgd×lhØoiÛwkÝylÝvhÝthÜpbÜpbÞp_ÞreÞofÜsfÞt`ÝtiÜpaÛo`ÙpiÚqbØpfÚpdØoeÛsiÜrcÛrgÜteÚpeßsdÝtgÛtjÜtjÜwiÚujÞznß}pà{nî’uù´}æŽi›<FX<W?WBW>V=X<Z>]>`<d<`@d@cCd?a@Y@ZBcFeDg@bB^EX<]A\@d>n(Jp,ObAI
-3?0R9î”zï”tïlì…eèfâr\×cWÄTS¨;H”.D(Aš3E°BJÃQSÕbXßp[ä|hé‡jênì’pë’têŽtêŽrê‹në‰lê†gé„jç{bàoZÙg\ÎTP²BI™-BŒ,BŒ(@”1E6JŸ:K¢>P¨?O©DV©DU§AR¨L^§DT®CNª>M­BN°@M¬EQ¬?N°EO²GR´KU·LXºKR¼PX¾NXÂTZ¾TZÀRUÃQYÂTWÆRTÈXYÆUXÄTTÍUVÊWWÌTXÌZZÐXXÑYXÍUVÎV[ÏSW×ppÕdWºMU»Q[ÂSVÀVX¾RW¼PW¶MVºSaÁU\¸Vb¿^dÁ\gÃbiÁ^bÀ`iÃjmÀ^a¾gn¿mpÁjrÆljÌmoÈnmÀeo¼enÁrzÈnrÉ|yÇrpÈ{€È~|Àw͍†Î†‚ΖÓ˜ŠÐ‘ˆÔ£•Õ™ŽÓœÖ­¡Ø°Úª–Õ¨ ×´¦ß¸ŸÜ±¢Ú¶¨Ý¹¦Üµ¢Ûµ©ß»ªà¸¢à¹©Ü»®Ý¿®ß»¥Úº©Ù¹®ÚÀ´ÝÀ²àÁ³à·áõãÄ­Î¥š«bož>MŸBN¤>J¬BN®DNµIR³LW¸R[¹KR¹PW¸LX´JX°HW¶JV³L^¹PVµIU²ET±BR¯FV¸IXÁS\Ð^e×jjÞqnàvhã}nã|kã|mä~pàylßzoÞtlÚsjÙmfÔhdÑfdÍfiÎcfÐb_ÒbaÔieØpiÜxpÞymÞviÞrbÞobßp`ÞpeÝqeÞtgÞuiÞsdÞq_ÜpeÞpdÚp`ÛoeÝobÙrfÝqfÛshÛrcÛsgÜrdÞvfÞqbÜvhßxjÞyiÝxjÞwjãnålç„lÖo\’2C_AU?ZBVAV=Z@[?a?`=b@f>e>f@f;b>[<U;^Bg$JdC`>ZEV@Z>bEbCq)Ls.QfBT;D6K;E]ï•xî’rì‰nèƒlæxdÜl^ÏVS·DH1B“-D–*Bœ4F®BOÄVXÕdYÝn\æ€hè‰hìlî‘nèqìsêsê‹mî‹oêŠiè„iæxaâr\ÛbWÊVU°CK›,BŽ*D*@—2Gž6H¡:M¤@P¦=M¨BTªAO«DR¬GS¬CQ®GSªBR°DQ¬BQ«BO®DP±ER·HR´HR¶MV¸KT¼QY¾PWÂPVÂPZÁNTÀPUÂSWÆVUÌVZÈTVÇUVÊVUÈX[ËX\ÈZZÏXYÐYVÎWWÍW[Õf`é§~ÇPQ½MX¼SWÂPS¼OU¹MV¶KW»PW¼S]¾V]¼Y[¾ahÄfk¾[a¼`gÆhe¿_d¼]bÂgjÇlpÄjlÄopÆnp»jwÃkoÆuxÁmsÉppÄlsÂwzÃqxÀ{…˃„Åz|ȍ‡Ê‡É–‘ϐŠÎŽŒÐŸš×¬™Ø ”Ö¨¡×°ŸÜ¨—Ú­¢Û³¤Ý¹¡Ý´£Û²§Üºªß¶¢Ýµ¨Þ¼±âÁ¯à·¢Þ¼¨Ü¼®Ûº¤Þ»©ß¼«Ü¾²Ü¾±Þ¶¢Ú´¨Ý¾µßƺҲ´¬~Œ©t¢Sbž<K¤@O«DQ´GR´O[·KV¸OX·JS¶JU²JX·HS³ETµJZ´DU¬DU¬BT¬CX¸KWÁN^Ñ^d×npßwsáznä|lå|lå‚sç€rã~oÞxpàwjÜxn×ohÕebÏbdÉ\`Å]dÈZ[Î\`Òbg×njÝrkÞzkÞvlßseÞpeÞn`ßrcâucâudàxjßwbÞl_ÜnbÜpbÜn^ÚodÜqfÛpfÜseÜtdÚshÜreÜtjÝzoÝtdÞvhÞxhàweàxjâzlã€pè€hØkb™7J`@X>V=V<Y=V:V9Y?aAg Ch!Cf?d<`=_:Z=X:^>dAgBdF\GZAYD]BfDh$Gr+Ng"EV:J5O;„:SËurîvìŒpê‡læ~fäq\Ù`TÃLN¦5G˜9M•2J“,D˜4H®CNÇUSÔdXÝq]æ{bèŠhëiìoìjì‘pënéŠrë‰kë‡iê„fæ|cát`ÚbUÉVR±@I›,DŽ*D*D˜1Fœ4F 3I¦@R§?L«GY¨@M¬>P¬@R¬@MªDR«CR­CO­DO®ER¯DO°FNµHPµJQ´LT³OTºMT¿NSÄSRÄT\ÀQTÁQVÃRVÆZ[ÄUVÆSVÄXZÈSXÊX\ÍVXËSVËWXÒ\\ÌYXÐTZßwpÜmUÁNUÂQP¾NSºIP¸JS·IP¸P]¿QV¾X`¾Y]¾T\Â]a¾X_¾ciÉbeÂ\aÀ_cÂflÂlnÂei¼hrÆchÌnnÍquÅpqÈprÃjl¿lxÃsz¾ekÇxzÌzÈ||Í~zÇ€|Í‘ˆË‚~Ëš’Ô¤”Ô™’Õ¦Ù­–تŸÚ©ŸÙ³ªÜ²œÚ¨Ú±¢Û¸¤á´œÛ°žÜ·¬ß¸§àºªÞ¸«Ý»°à¼§Þ¸¢Ö¶§Ø»¬Ú¸¥Ó¬¢Ñ°¯Ò½¼ØÅÇàÎÈæÔÍëÙÐæÛÐà×Ëξ¸«`hœ5H¦;M¬DQ±MZ¸IR±KW³LW³HP®DT±HTµGU±IV°FX«FXªBY³EV¸K\ÀS^ÒbdÖnmßsmá{på~nä€månæ€nâ~sá{nà|sÝxlØodÓd`Ì\_ÂV^¿PZÀTXÅT\Î`_ÖedÚpiÝulàxkßufßpdàrdßsgàrbâxgßvjßtdÞn^ÞneÝpcÝp`ÛpdÜpcÝrlÞrgÝrdÝqfÞreÞukÜqeÜrhÝuiàwiáxjâ{häoæoÞwh¸KPk@XAU@V?W=W<V:\>bDc?fBc@h@f<d:\>Y=^AeCe DfG]BXC\A\@`Dh!Fr2Sh$HS;J<N<y0Nºioà‰{êŒvê‡mèiäwdÜj\ÌVR´?G™.D˜3G›6I™1E/F¬AMÈTSÕbZßqbæ|cé…hëŽnìsì’pîpí‘uìnìŠhê†jè…dæ~dár]ÚfYÊTP°ENœ2F(D/F–2FŸ:L 5J¥?M§FT«H[¬BQ«@O«EQ«FQªBQ¬DT¬AP®FT°CO°DO°GR´GU·IPºNY»PX½TYÀU]ÁTWÂNTÀPRÂPV¿UXÀQXÊXYÈTUÆV]ÈV\ÉYZÎVZÊVXÌVXÒXXÒVXÒ\Väx^ÅUWÀSS¼LR¸JT·FO·LX¸KS»U_ÁW]¼X]½SX¼U\»PXÃbfÂZ\Âdl¾XbÀbgÅhm¾dlÃdh¿afÂgmËlnÁilÄnsÆln¾jrÉrpÂrxÂsxÇz|ÌzzÍywÍ€Ì|zË‹ˆÎ–Ò”ŽÒ—“׬–Ý©šØ¦›Ø´©Ý¶ Ü¬›×§œÛ·¢Ü±Û¨šÛ·§Üºªá·¦Ú®¤Ü¿³à¼¦Þ³¡Ú·©Ú·¨Ö­žÒ­©Ò¸¼ÚľäÎÃèÎÂêÐÃìÓÅìÓÇïÖÆòÝÏòàÑòàÉÒ´­ŸDV›4LŸ8J¨ER®FT®LV°HP®EP®CQ±CO°FU±GV¬FX¨FX©>T²GX³K\¼O`Ð_cØlhÞukâwlå{næ€pä~lç€pä|nãzkæ{lß|rÛriÕgbÌX^ÃPX´DN³JV¹IVÄTZÐ]^ØkjÛoiàwnàxnÞtißr`ÝrhàrcârdàteàsdÝpfÝn`ÝrhÞpcÜreÜpdÜodÞqfÝqeÝpdàobßtgßrbßvlàwkàwlãznâ~qæ€nä|gÂVVz'HXCU@X>X@V8[AX<`@`>d@h@c=c<`8[:Z<]<d?jEb?_HVDX@^D^Bf$Kq.Py7Yf FO9Q@m'N¡YiÓ~täxë…fè†næycßn`Ô^W¿MO :K™.A˜2G˜3Hœ5Gž3H¬FRÉWTÖd^àtdå|fé‡gë‹iìlê‘nìŽnìpëŽmìŒjèŠmæ„læ|bàq]ÚaVÍRL°@K›5F*DŠ&B”2H4J¤8M¤<L§?Sª>Nª?P¬@O«?N­FR¬ER«@N®ER¯FR®DQ¯CO³ET³JPµLV¸MVºLSºNU¾QXÁRW¼PVÄPUÄV[ÄX\È[\ÊX_ÊVWÇ\bÊVZÆ\ZÈX^ÈTTËTWÐZ\ÐZ]ÔgbÐ[VÄQR¼KR¼HPºMXµKT¹NW½O[ÀT]À^^ºRX¼RX¼X_Æ]cÃ^dÃ\c½\d¿]bÂ^b¿em¼dl¼cjÀ[bÀjlÅdoÂlrÆhlÊqoÅjiÁisÃhlÂrv΂ÈllË|xÏ€}ËŠŠÎŒ‡É~‚ÓŸØ¡Ö ”Ú°¢Þ²šÜ©žØ¦œÛ¶¨Û«šØ§œÙ²¨Ý¸¤Þ°žÝ´¤Û¸¬à¹¦Þ² Ù¯žÙ±£Øª›Ó°²Ô¿½àËÂåÏÃæÌÄè̾èÔÆæÎÅèÎÀçÑÆêÓÄîÖÆïÞÒôáÎïÚ¾»|’1Hš4K¡>M©CR¬GT®DQ®HV®CT¬FT¬FW­BS¬DT¥DV¤@V­DXµN\¾Q^Ï`cØgbÞsláwiå}nä~lä}kæ€kä}nå|nâ}qà|oÞrfÚg`ÌZY¼JP¬?J¤;M§;M³IXÅU^Óca×kmÞtpâxlàujàsdÝoaàpbào`àtcârdßpbÝpdÞncßqdÞodÞqhÞuiÝqgÜtiÜreÝrdÞrfàsbásháwháthâzlå€næzkÐ_Z.JZ>VET=X?X<\>^>`>c?f Da>e@f>b@]AX=Z=cBjBhC\AVAXBX=^B`Go-R|:[t5XdHW=o)K XhÅxzÛƒuä’wéˆvèhâtcÛdVÊQP­@K™.Fš0Hš4H™4Gš0Hž5H®CNÄTUÖd\àq`å|bê…fìŒkì’kênìqì‘rêjêtè‡pèƒkæz`Þm[ØaZÌOP³>Kœ0F+C+Fš2F 6I¤;L¨>Rª>L¬<O®GT­DT«DP­DP©CP«BP¬BN¬AO®DT®HQ²HS²ITµJRºNT¸OZÀOTÀNV¾RTÀRVÀPTÃRVÅSUÄXYÉVXÆTXÄZ`ÍWZÈWXÈTYÎYXÌXWÐ[\Ò\]Ñ]VÈQT»IN»LQ»NTºLU½NU¼T_¼U`ÀZbÀWa½RY¼[cÂ]`ÀX^¿[fÀ[^½Z`¾Z`¾_d¸T]Àcf¿`dÀhnÂckÆru¾bkÂlqÃbdÄnrÉhkÄlpÊrqÇprÉopÇimÐ~zÉzw͈„Ô•ˆÔ…Ó˜ŽÚ«—Ü® Ö¢œØ±žß³œÚª ×¬¢Þ¹«Þ­šÖ§žÚµ¨Ýº¢Û®™Ö§›Ò ˜Ò¨¡Ò´´ØÀ¼äÌÂçÏÂèÏÄæɸåÌÀæÌ¿æ̺çÐÂçʼèͼéÒÃêÐÃîÙÉïÞÐðÞÈØĸ¤^l0Iš7J¢>N¨FS«BQ¬ES°ES­DP¦BS¨FVªDS¨BV£=U§BV´KZ»P\Î`dØjhÝrlâuhäzjåmä{iæ~lå|mâznä|oàzrÜskØljÏ_`¾NW¢8J•1H–2J¡6MºJXÊ[_ÒhiÜnjÝtkàvpßseÝrfàobâreàufár`ÝpbÛoaÝofÜrjÝpbÝndÞpfßqhÞvjÜrgÜshßshßsiâulâviãviåtæ€pÛmc¢<O`@T>T?U8Z8Z8[;b>c>d@d@d@f=b>`@W<Y<b<i>i?`BU?ZBYB\AcFi(Or-Ts0Tn+P`?p&J›SdÀprÒ~wÙ‡vß‹uè|dãybßm^ÑZQ·EO 5J”.Dœ4K4I5H6J¢8H±DOÆTTÒbVßq_å|dè„fënì‘lì’lì‘pìŽnênëŒoéˆmédåz_àn[Ø`TÈMQ®MLž5J+E,F˜2HŸ6H¥8J¦?N§@N¬?QªBP¯@N¬BO¬CT¬@P®L[®HW«DR®FS®AN³HU²BO¶JRºNV¸OWÂQT¾TX¿QTÃQXÁRZÃVYÄSVÆX[ÊTXÊWVÆW]ÌVVÊZ[ÊVYÌ]XÌYYÏ[\ÖaXÉPRºHP¸MT¹IQ½KRºLT¼OTÂX`¿V`¾V`¹T`À]bÂ\cÀVZ¿Zb¿Zc¾]b·T^¿^]ºXb¼al¾`gÄfgÁgnÊjmÈlnÌroÈipÊvvÄcfÂprÇklÃqvÇrsÄjnËz|ÎvwÍ€Ò‹†Ï†…Õ™×›Ž×œŽÜ¯£ß®˜Ü©šÚ¬¡Þµ¦àº¥Ý°¤Ù²¦Ú´œÜ¦Ô¤–ÎœšÏ¤¨Ñ²¶ÞÄ¿åÌÀæÎÂèʹæÌÀå˽äɾäÉ¿äÍÂäɼæ̺æÍÀäÅ»æʵéÐÃéÓÈîÛÐïÛÍðßÄд­—BT”2F˜7LŸ<M¨>P¦>MªDR­@O¬@Q©DV©@Q¨AU¨?R­>T³KZ¿PYÍ]d×efÝnjàxläpä€mâ|kä{mãznã~pä|páxpÝqjÙleÍ_\¼NW™:J„%C€"AŒ(D¨@RÃTZÎceÕhiÛrlÞvjàujàtkàn`ârfàveàtiÞrgÛpdßqdÞrhÞn`ÝndÝrfàthàobÜpdÞqfÞsjàtjäxiâvmåylénßvi¹LPmCU=U9T
:V7[:]@b?d@f@fBc>f@c@`<X>W=_@d>iBbAZ=W@\?^B`Bg"Mq1Wv6[l)Pg%Jz1R˜Nc»mrÎxÏ}tÖ~uÕ†yèvaâr^ØaRÃLL¤7G›.Bœ6L¢5H¡:Lž9Jž1D¢;N®BLÅTVÔdXßo[ä{hçˆnëŽhîpìlìrëŽrëŒnêŽnêŠmè‚däzbàn[×bUÉTR°FMŸ6J‘-E2L˜3G:L¤8L¤:L¦<N©@Q®@M®CP®BN«BP¯FQ®JX°DQ°BQªAR®DQ²DN²HT¶JRµKR¼LS¾NUÀQTÁPQÆPOÅPUÇRTÃRVÄVZËVWÊUUÊVVËVWÊZ^ÌYXÌ\[ÌZ\Ð]YÇW\ºLT¸FP¶HR¸HNºPZ½RV¾T^¿X`¸MX½XaÂ`hÂY_¼X_¾[bÀZaºU\ºZa¼U]¸V^½^fÄbfÅghÄkoÄbbÆntÎttÆhnÌolËlnÇooÈilÄrvÉzyÇosÌwuÉkqÏ€|Ö†€Ò€€ÔŒƒÔ‘‹Ö˜‘Û£–ݪ™Øš”Ù®›Ýª“ܨšÚ¯ Þ·¢Ú­žÏŽ‡Ï–”Π¥Õ¸¹áÉÄäÌÃêÓÈèË»æÈ»åîäƵäɺå˾å̽ãǺäÈ»äƹè̺æÏÂâƹèʶéÓÇëÔÆîÛÎìÚÌêØ¿º”—”:N”-Fœ2F¡;L¢>O¥CU£@T§AS¦F[¢@R£?T¦:O©@T´IXÁPXÏ[_ÖfcÝokàznä~pä~mázmä|kä|lâ}oâ|qÞzsßqkÚlfÑbdºQWž7M~=q@x=ž4I·LWÊX\ÒfhØlmÞumàvmÞvgßriàocÞofáreßsiÜndÜmdßtlÝoeÞphÜpgàrhàpfÞnbÞodàpfäneæpfäxoê~lè|mÈc`†%@[:R9U8X
6Y
:Z:^=eBgCgChCdBgCaBY@T
;\Bd?hBa>\@Y@\B_Cf1Vh2Zm'Rr6Zp1Xn*Rx2T™Lc·lsÉ|xЁwÌzuÍzsÖ}râq^ÜfVÊTP°>Jœ2Iš2Eœ7K 8I¢8G¡4C2Dž7K®EOÃTVÖe[Ýscä{bæ†péŒnìŽlëoìŽqëŒlêqêqèŠkèeãy_Ýo\ÖbXÈRO°CMž5I‘,F’(C–2Gž3G¥:O¤;N§@P«;Q¬>M¬?R°FT«FR¯FS°HU­FU¯EO­CT°DO®ES¶KS¹KT¸LT¸KS»OVÁPVÀSUÄRUÁT[ÄQWÅVXÅW\ÈVVÌVXÊXXÍXXÈYYÈXXÍ\^Ò`\ÉRR»OXºJQ»JO¶LXºHP¼PUºS]ºNV½PXºU^ÆZ\ÁY_¹UZºQXÂ`g¼TX¼V`¶U_ºU`ÀW\ÃcgÅ^bÆgjÂ^gÂlpÊkmÊorËjiÇdjÌqsÊfjËnpÐtxÆmrÏrrËtvÎzÑwtÎ}wÒ†Ñ~|ד†Ø”†Õ“Ø£˜Þ©–Ù¡˜Ö¡”Ú³£Û¦ŽÒ•ŠÏ”’Ê•—Õ´´áÀ·æÍÄéÍÂèÌÁêʸåȼãƺà¼áÅ´åʼãžãÈ»âÈ¿âÄ·âɼåǺèɹæμâƺå˹åÍÂêÐÃìßÒíÚÈäÓ»¸ˆ‹2G“0H›0FŸ9N <P£BS¢?T¢AT£@S BV¤>RªAS·GTÂPZÎZ\ØgdÜqnáznä~qå|lå~mç~kä{là|pâxnÜytßvkÚljÌaf¾V[ @R‚"Dh=p>Š$@¦;LÀQXÊ\aÖhgÜpiàuoàzoátjßpfàpfápdÞthÛqgÜogßpbÞqfÞpgÞqiÞrdàshÝn_àreàqfäqfæuiç{qé}jÜl_5FbAT8V?Y>Z;Z<`@dBjBgDdBfAf@`@\AU@Y>h Dj"Bd?\=X?YB^Aa#Je&Oh)Sl-Vt8az/Z~3Y–Pi³iuÈzx́~ЂzÈwsÇrqËulàfRÔ^N¼FJ¡7G˜2Hœ6HŸ8J¢6G¡:GŸ7E 6HŸ4E­EMÃQRÔ`ZÜq_äybèfêŠrëŽoënìŽnêpêŒlìŠnèŒlèƒbäycànZ×`UÊPL´DNž2G‘(B,E˜4Jœ;N¢<P¤?P¨ATª>Pª@S¬DV®GU©CN®HV±FPªDN­ER«CP­CR²HQ´IRºJP·JR¹LT»PUÀPSÀSUÂTXÃPTÄTXÇWVÈZ`ÈZZÉXZÈQTÌZ\ÈWZÉXYÐ^YÉXU¼JQ¶NX¸GN¼KQ¸OXµKWºQ[¾RY¶MZ¾[`Å\aÀRW»X_¸T_¼Z[¼W\²QZµQ^½Z`À^dÁ[\ÄdjÄc`¼X_ÇfjÆkoÇvsÆgfÂnpÍtrËlmÏrnÏqqÌuxÎvtÏrsÒ|xÏzzÌ|}Ìyvρ|ÔŒ‰Ó†ˆÑ‰Ù¤–ܪ™ÚÙ¥–Û¬š×¡•Ì„~ƍ”Ϧ¯Ý¹±èȺæȼê˶åËÀãĵßļâ¼âȾäʸÞÀ¶æÈ´äÊÁâÈ¿ãǽáǺãµäȸàżãǹåÎÆãÐÇäÒÌèÔËíÝÑîßÔíØÂÜƹ¡[kŽ/E“1I—6Fš8Mœ7M>NCU¡?R¢@R <P¦?R®FU¼Q]Î]_×ddÛnláxoå~tå€tä€sæoå|jã{mãznà|sßxqÜolÓefÂV_¦AP„%Bd8^9y:˜1G³FSÃR[Ñ__ÚkhÞumÞuláwkàrcßpdàrfÞpeÜqfÛmcÞpgÞnhÞrjÜnfÞqnàrgÞpfÞuhàvpãwnçxnç~rÞscµBNk@VAb8\`0S^IZ<\=eCfAgAe@gBfBcB^@X@X>b@jBfB]AY>[@\?`=d$Lh%Nm+Vt4_u0\‚:`–Kh­fwÅvxÍ|zЁxÓƒwÂqn¾nl΂zØZNÈQN¬=H›1I›6I¡8L ?Nž8J¢:M5G9JŸ6G«>LÇTSÕ^XÞr`ã{gæ„hèŠrêŒpëoì’têŒnêŠlìŒnêŠgè…dåz`àlZÖ^SÈRR°@Hž6IŽ,G+F•8L›8L£<N¨?Q¨AQªAP©;N¬?L«DO¨@P­AM¯DQ«@P­@N¬BN®FS³HS´HN¶FQ¸IQ¸QY½PT¿PVÀSVÃRUÄRUÇTTÈUWÇUVÊTWÇ[\ÆVXÈWXÉYYÌZ^Î[S»MR¸JQºJO¹KR½MWÀRZ¼QZ¼PZ¼NX¾W_ÃW\¾V^½W`½V\¾U\·V^µN\¬M\µTb¿]eÆbcÂehÂaf¾ekÂhmÄhmËwtÌmnÌsrÌvrÆptÐwsËnpÎxxÔvuÏwvÐtkÈruÊsrÎqsÎvvÏ{vӁÖ’†ÛžŒÙ™‹Ú¡”Ü©—Õ–ŒÏŠƒÈƒ„Çž¦Ü¾¸âĸãĹæÀ±çŴ俵â´ÞÆÁäÌÃæÐÄäȺâĺâIJ῰åïáĹâ¶àÁ·ßÄ»ßÆÂâÏÇäÎÄéÒÂèÐÊéÓÄêÔÈìÜÒïàÔìÜÒìÛÀͳ­—ASŠ-CŽ1G“0F˜6J–9L™8Mš;Pž;P¡<P¥@S®GXÃQ]Î]_×ihÞqlázmç~mæ€qä|lå}oå|lã}mã|qà|vàskÚppÑglÂZc¨BT‚$Ab9W;fB†,H¢DUµKVÈX`ÕgbÝojàtláwpàthÞpgàsjÞpgÝndÞqfÞocßncàrjÝohàrcàrjàqeâpdâulæukê}pærÍZV€ @Y@V@V;Z>Y;\>a<c>h>hAd>gBfA_>Z>X?a?n Bm$E]=Z@]D^D_@^Ab"Gh*Xl.Yv7b:_”Jg«at¼t|ÊywË~{ЁxÎ|xÀon΀wÔ‹ÌRP³DHŸ2F›2Fš7H¤>N¢>L£:I¢8H:Hž2Dž4H®AMÃQQÔc^Ýq\âxbæ€fåŠfëŒnì’sêqêŽsêuínêˆlçƒjä|dÜn`Õ`TÇOMµ@HŸ3GŽ+FŒ1J4O˜<P¢BR©AR§BP¯FS«AUªBN®BN¬AS¯DM®DSªCR±FR­CO®BQ³JT²HN·GN¸JP»MP¾QYÂPT¾RYÂUWÄRQÆTSÄUXÁTYÆVXÆV^ÈZ`ÎZ[ÍZZË]_¿TX¼TT¶KR·HQ¾NSÁSZºPZ·LW¼T`½R_¾W^»T^¼V]ÂTV¶JT´S\°HY³P\¹Ta¼Zc¼V_ÊehÂblÁfnÆabÇghÌlhËijÌrqÍgjÈtwÎvsÒrsÑwrÒ{zÎzvÍnlÀhoÎwtÈlmÍyyÓyvÏ{z׏„אˆÖ’‡Ú©šÖ”„ÑŽ€Å€}½ŠÐ¤¨âÁ²åǼæƶåȹâ÷ửâĸáÆ¿æ˼æÌÁæŵãǽâÀ²ÞÁ¶Ý»²Ú¶¬Þ¼®àƾàùäʽèÒÆéÔÄçÎÂèɹåÌÀäɼå̾èÒÃêÔÅîÝÍîÚÆïÚÁ¸…†“@M†0F…,D3G3H˜7Kš8Lž7Kž6O¦?O¬HXÃRXÑ^[ØifÞphâxnå}pæ~pã}lä~täziâ~sâ€vá|rÞvnÚphÒb`ÀVZ¥<J‡%B_
6P8`@v$F˜<U®GWÄV^Ñc`ÚjgÞpkávlávmàujàpeÞphÞldÞqfÞlbÞpißphßndÞqhàpjàqhâseåthèxiê|mÛmb£7F^;R:R:W?X<]@bAh@fAg@g?j!De@`:X<R9^;fBpBfBV<[@^>aC_AaBfLi&Tr5b~8b•Pn¨bwÀv}É~|ȁÌzwÎ|sÂqrÊ{qÔ‹|ؐ{¹CK¤9I™3Fš5N 6G¢:L¡:K¤;K¦9Lž6Fœ1DŸ8J¯=IÃPTÔbYÝnZâw`æƒièˆjéŒvêpësêuêŒrê‹nê‹uè‚lã~iÞn^Ôe`ÆRR²LT 2F)E4I–5K;O¤<M¨BQ¦?M«DP¬ET¨?O®AP¯AM¬@L®CQ®DP°BN¬HQ­FN²FS¯FM¶ER¸JRºPT¾OTÂQRÆX]ÂUWÀRTÃSVÉQVÆVXÈVXÈVZÈW\ÆZaÍbaÆYZ¼X_¼Q\¶PZ½U]¸IU¼RZ½NZºNX¼R\¾S\ÁX\¾U^¾SU¼OZ¹RV¶Xd¶V\¸Zg¿X\¼\iÂ`b¿\dÅklÁ_f¿hlÈeaÅotÊlhÄbdÊrsÎolÌtrÓtnÒyvÓzvÉloÄrxÊssÊosÌrrÐtwÏyyÖ‚{Ò€ƒÔ”ˆÚžŒÕ‘€ÈxzÀt|•ŸÙ¬£âøã¶ä´âµã÷ã¸àûäôæɻིåıßÀ¸à¸«Ý¼³Þ¼²áÈÀݸáúçʹäĸä°åƱâÁ²à²ÝÅÀßƺàÊÂàÉ¿âÎÀäÐÆåÐÅèÔÈîÚÈÜÎŶŸª™`tŽ>O‰,B‹.BŽ0B™2Fž:G›4K¤:N®DQ¿RZÏ]^Øhbßoiâxkå}så~mä}qå~räylâ{pã~ràynßwnÞphÓdaÄY_¥<K†">c9UBWFg Gˆ3M¢BTºIUÊ\\ÖbbÚmhßtnâtnáufârbßnbÜndÝmbÜmfÞmeÝoiÞrlßqjãrhásjäxjèylêzläti¾NPq>Z?Q
-9V8W;W=`BfDjEj"DfAe@dBb;^<Z<[?iBnBiA[=X=aE`BbDd Fj*Qf&Qg"Nu3]IjªdtºryÊ{|Ë~{Î{ÂxvÂutÊ~uЈyÖŽ}×’¨;Lš2F›6J›6J¡7H¤;K¢>P¤:G¢;N 9L 4Hž4G°DPÁOSÔ^UÚmZâyhæ‚féˆhë‹mêŽpéŒréŽtéŒrëˆlé†lç„käydÜj[Ö^VÄTS²DL7K*CŽ+B”+Eœ9L¡;Q¥@P©?R«BR©CRªBQ­DUª@O¬CNª@O¬BO°DO±AO³FPµFR±JO´JQµJS¹MU¾OZÅRVÄTYÀSUÃSVÄNQÆT[ÇVWÍXXÊV]ÊWYÌ_aÔe^ÂQV½NT¼LVÀQW¾TZ¼PV¸OWºLT¸RX½QW¾T[¸V^ÃT\ºOV¼Yc¾Xc½\d¾X`¼WdºZbÀYaÆeiÆfhÁbhÃjnÅ`fÀlrÎtrÇkoÌtrÌfmÂnsÒurÊjjÑvmÎnnÇsrÍnlÉinÎrrÐpmÎ|zÐxtÎvwӍƒÙ–‰ÔŠ|Ãpp·o~Ì¥¨ß²¢à»±å¹¦âÄ·àÀ¹ß¹«ãƺæɼåȾ᾵⺬ßĻܾ»Û´¬Ú¿¼à¸¦ßøæʺãŶིྶ޼±ÜÁºÞúàúà¸äÊ»ãÌÄäËÂåÎÂãÎÀæÎÀæÎÄèÒÅìÖÉðÚËîÞËÖÎÀ¬„“…4F‡-F‰)A’0F•3H–3H£:L®BOÁOZÐ\^ÖicÝolÞwkäpå~pã|lætä~lâ|nãzrß}vßztÜqlÔdaÃVX¥>M‡&Af:X=X@`<p82Hª?LÀTZÏ[]ÖgeÞoiâvlãtgâseàqdÞqdÞmcÜmfÞkaßnfßphàriárjátkæxlêzlèxhÑ^Z‰*FZ;S:T
;V
;W:\@gAl"HjDhAhBg>f?]<Z:W>d>qCjC`@W@[BbB`CcD`Ie"Jh$Rl(Sƒ;_¦[n¾rzÅzzÊ{z΀|΀vÁvxÅ|zÓŒ}Õ”€Õ}דš:N—4H7J <J¢8J£9J¢7H¢8J¤<Nž8NŸ5GŸ6H¬?MÂPOÐ^XÛpbâu`ç„jè†nëŒpèŽjéŒvèzèŒsìŒtèŠrè…mäzbÞpaÕbYÉRSµBMž5F’+C,D—0C7H¢9J¦=N¨@Q¨@R¬GS­CP«BN©DP¯EO­@M¬FP®AO°HV®IQ°DP²HN¹HO¸MS¼JS½MSÀPWÀTVÁRUÁSVÆV\ÆTVÆTZÇX[ÈTUÉW\×i`Í_\¼HT¼IR¼HR¼KTÁTZÂPT¸N\¸NU·NX¼NV¼QZ¼TZÁV\ºNX¿Xb¿W\ÄXZ¹XbÀX\»_hÃdmÆbcÁfnÆba¾`jÉnuÉfkÍorÐppÉfkÊnpÐpoÊt{ÏrpÍptÌllÌnmÀirÇlkÄlsÈrtÌoqÊxyÐ~{ÓŒˆÐ€{ÄimŒױ§á½®Ýµ¬â´ Ûº¶ß¶¨äƶ࿴弧æĵå´àÀ¶Üº´à¼¯â¹ݼ´ãǶܶ¬Ý¼²Ý»±à¿­ßÄÀàļàļãŹæÈ»äƼâǼâȾäʾäËÄäʽäÍÂåÌÂçÍÂçÒÆèÔÈêÕÉñÚÈòÞÈàÖıŒ•¢FP$@‹)D/F”2Gž6K®BO¾MTÎX\×hdÞrkàznã~på~pã|nå~sã{mäykâ~sâu߃ÜlgÒdfÁRX¨@L‹'Dj<Z>U:W
9f9~;™4J²FVÈV]Óa`Úgeàthâtgàteârfán_ÝlbÛlbÞqgàpgàndáqiãtläulçxmê{kÝj`¦8Ib5T8T
8T9Y<\<^<h@i@jDl HgBfBfA\?V;`?kDlA`>^?\D\=fFbCc I`Lb!Nm$R{9^Ri¼nxÆwxÆy|Èxv΁yÈzxÄxzщ~א~Ö“€Ö‘€Ø‘~˜<Nš7Kž9L£<I¤<K¤:K¢<M£=K :L¡9Jœ6K 9L¬ANÁNMÐb\Úpbâvdæ‚jèˆpêrèŽxèŽté‘zéwêŒrèˆsèƒiäzdÜo`Õ_XÇTV´FN <O‘*DŽ(B–0FŸ2F£:K¦=M§<K®BP©@N®@N¬BS¬CQ­FR¬BO«DP­FQ±EO­@I±FR´EJ¸JN»LRÀLQÀNSÂTVÂTWÀVXÂWXÈTVÂVXÂUXÅUXÆWZÎd^ÔcYÁRU¸LT·PW²EQ·LW¿OTÃRW¼OXºRXºNV¾QU¶R\¼NW¸PY»TZ»U`¼RZÁWZ¿Yb½^fÈfgËhlÈgjÃ^dÅlsÍpoÌmpÐwwÐsrÈhqÏzwÏjlÌnnÌonÈkrÏpoÈfhÆlpÊhjÂbmÌrsÌprÌtnÇnnÀkqÄrp¿nxÉ’‘ܱ¨âº©â½®ß¼¬Ú¶²ã¼£Û½´à² á¸§Üº°ß·©Þ¹¬Þ»´Þ¼°ÞÀ¶äÁ®ß¼µßµ«Ü¾ºàÄ´âÈÁß¼±æÄ®åÌÃåǸáȾäÆ»ãȾäʼãÊÁâȼäʺãÊÀäÌ»è̽åÅ°çϾèÏÀçÏÀêμíÔÃðàÊâÖ³}†}%A"=ˆ'@.Cœ6L¨?O½MVÌ`aÕfdÜocàxsä€rã}sä|oæ~pâzpâ|räzrå€pÞxrÞldÔb_ÀRWª@LŒ'Dl:^=W:W4`;m:Ž)C¨<LºGSÌ`aØdcÞohàuiâtgàtfÝqeÜm`ÜlaÞkbàndßriâtjátkäyné|räsd¾PTr;Z>T:V<V<Z>`Af@j Bh@i@h=fBeDa<[@_AgAjBf H\>\>c"Gb@cBaD`I]Hb Nv3\˜Vn´lxÅyÇwxÃw|ÊzwÆxxÁxzÎ…~Ӑ}Ö”‚Ö”€×’ÕŽ}š4Jœ8H¡:L£<M£<N¤<K¢<K¡?JŸ<Jž;Pž6J >P¬BNÁUYÕaZÜo`âuaç‚næ†oè‰pèŽréŒuêŒvêŠrèŠpé‡oè‚jæzeÞpbØbXÅRT¯BM <R’*DŽ,H–/Fš8K <M¤?N¥?L¦AM¨>Q«>M®FU®IV´BL¯@M®BP¬BO®EM­DQ²DQ³EL·IPºLS·JQ½NV¿PVÂRXÂTWÄVZÆXYÁVY½RXÄPUÅ\_ÝŠuÊSTºHM±BP°EP®EP¶EPºNRÂRX¾V[¿RX¹KT¿SU¾OX¾TX¾U^»PV¹R\¼X_¸Vb¾X`Ã`_ÆhkÈadÁfrÈrrÎijÏuvÒwuÎnoÇrvÌljÌnpÏvwÌqyÅntÎurÉflÉmrÇlrÈlmÉhhÆmrËrlÆkn¼em½js¿|ˆÑš”ܦ–ᶡඦ࿴࿰ྰ߯¢ß¸¥Ü¸²Û±¦Þ¶£Ü¸°Ú´²àº®àº­Þ´§Ý¶²àÀµâžçƷᾶèƱäɾ߽¹èƲäÈÁåÊ¿ãȾãƺâȼåʾáøãŸãÊ»ä̾ãʾâȼæξæÒÈäÏÄåÑÃæÎÁê×ÊðؼÜξ›Vjv:~"@Œ)A˜4H§>K»NVÎZYÓd`Ûngàyoãzlä~på|oäzmæ}päzrã|oã~uãwnÞnkÒdcÄTZªBNŒ-Hj<\8[9X6X5b
5v6+E°>JÆWZÒ][ÚfcÞnfàriàteÞndÝk_Ük`ÜjbßjaàtjárhãtlæznèygÑc\Œ(F^;V<V;\=Z>^<d=i>i>h@f@eBh"DcA^@[?dAh Fc<\;V:^?`Bc?h$IZB]H\Mp(T”NjµlxÇ{|Ê|ÆxvÃxyÂquÀsvÇ~xÒŠÖ”Ö”‚Õ“‚Õ’Ô~›6Kœ4J¡:K¢>P¢<L£;Kž>N¢@N¤=K :Lž:N ;L¬GSÀQWÒc\ÛlZávbä‚må†nè‹pæŠpæˆrèŠtéŽsè†hçŠrç„jå{fßp_×f`ÄRS°DOœ6L‘,G,F–/Fš5K¤:N¥<Nª>K¨<O«?L¬?L­CR¬FU®CPªDT¬@L¬@M¬BN®DO±FN´FN¶HPºKR»MT½PW¿MVÁPVÀV[ÂQVÄQU¿QUÀNVÂNWÞ„pèmÆNR´AMµDP·IU´DO·JQºNZ½MR½QY¾PT¼MT¼OU»QX¼QVºMW¶P\¹PZ¼W`Ä[^¿^hÄZ\Ã\fÄmuÌjmÇ`jËsrÒssÍsuÌrnÆ\`ÄnsÎqnÐptÌyzÏnqÐqsÊrrÂenÂioÀ^hºbnÅllº`j¾blºdrÍ•’Û²§Ú¨™Ú¢˜Þ­œá»°æ¼¤à¼¯Þ´¤Þº©Ý±¥ß¸¦Ø´²Ù°¨àº¦Ü³§Ú¦šÚ²ªÚ·²âÀ±âļåÄ·äĺáƼἴçÆ·ãÉÁÞÀ»æƲâõãÇ¿áÄ·ãʼå;ãȺæȸåʼãÊ»äɼàÈÂáƸçÒÅçÐÅèÑÃèÕÆéÚÒéÒÄîظɮ¨~*D~ ?‡#B”/D¤;H¹HRÌ[ZÔd]Üofàvlå{næ}nä}lä~oä~tä{rá}rá|wàvpÜomÓbdÄXY¨FRŠ,En=]<^<]>Z7[
7f5~>›2F²DNËUSÖ`ZÚh`ÜobÞviÜraÞk^Ýj\Ük`àlbßreärhåwpæzmÜma¥>Ib:X>X<X=Z<X>`;iAj>hAgBi!EhAdC`@Z?^>gBfD`CY>^@dAfB`>_AVA_Kj%R…?a¬cwÇy}΁}È{|Ãrt»nv¿psÉ€ÒŒ}ҏ€Ô’Õ‘~Õ”‚Ö“~Ö‘ <Jž8I¡:L£?L¢;L£>L¢9J 7I¢:JŸ9Jž7L 4F«CPÂSXÑ`WÜnbâzeå‚mä‡pç‹oêŽoèŠsè‹qè‰té‹tçŠræˆoå|iÝpcÔcbÆRS³EP<SŒ,I,G•3Jš5J¡8K£<L¢<LªAN¨DR«BO¬BP­CR«CN®FP¬CP®AO°BN®EM²DP¸FMµGO¶KR¹NSÀSYÃQTÄSX½RXÀPNÂTVÂORºPVÀTZê©„æƒbÂEL±=JºDN·KT³HV´NZºRZµLT»R[ºLVÁOT¾NWÀPXºMX¾T^¼U]ÄX^ÂV`Ã`fÆ^d¼YcÈbbÌ]cËjqÌjpÑotÒztÍgh¿ajÂlrÏleÅioÔurÌjsÍorÍloÃchÃmn¾`j¾`fÁ`bº`j´\f¿t~ӝ–Ý ‹â¸§Ý¬¢Þ®žß°¤å´›à²¤ß¶ŸÜ±¦ß¶¨Þº«Ù­¬Þ¸ŸÛ²¨Ú¨›×°®Ù´¯à½±à¿µà½¶ä³âÄ»äĹäƺáÇÀãÀ±åÎÁàÃÀ⽫áÉÃåɹáƽäȺäʼáǺáÈÀâȽßÄ·àĸÞĺÞĶàÊÂäÏÂæÔÈçÑÅéÚÎìÚÏëÞÊãÑ¿£ft˜;J„ BŽ*Bž8HµFOÊUVÔbZÝnfàvjä|lä~oã|mä€qä~qãztä~tàznßxoÜlgÓcdÇTV«CR+Er>^;\>^9\7[
-6^4m5‡"=Ÿ8F»IOÊVUÒ`XÕj`ÚqbÛpbÚj[Üj\Üh[ßn`ÞqdâtjåwlàvkÃRTt=V<V9U<Y=[=`Ed<j?f>h<gBfAf@cCZ>^BcBiDcBZA^DaCjBiF`@X@R=`Iƒ<d§`wÄy€Ð€€Ì}|ÈxzÁrqºnsÇ~|͆}ÔŒ{ՐÔ|ÖŽ|ԏ~Ô“‚Ö‘}Ÿ>P¡<J¡:H¤<J¡<M 8L ;L¢>M¡<Jž6Hœ7Kœ7K§APÀOTÒaZÜpeâweå‚lç†néŠnæŒqèŽoêoéˆpéˆsé‹xçˆuä|iÞrdÔe`ÈVT²EQœ5MŽ,HŒ-K–1J˜7Mž4F¥;L¥<Lª?MªAO«AL¬BO¬FSªDS®FT°FS¬DQ®DO­DV²FR´LX¸NV¹NU¼KR¾PTÂMU½OVÀSX¼T\ºPX¸JU´K\Îmdô»ŠÚuY¸BK¯BL·EO´HU¯KW¶KV·JV¼LT¼NXºKU½PU¾RW¾PWÅZ\ÂZ^ÄVZÄY_ÃZ^ÀZbÅdeÇ^d¿alÇhlÍopÒppÓwnÈbcÃhpÆjiÈilÃhsÎtmÎjoÎqrÐmjÅflÆehÂahÄde¹Q`®Pd³ViÁ„ŽÖžšÝ™†Ü¯¤â°›àÀµà°¢á³¢Ü¦šÞ®—ܯ§ß¹£Ü¹¬Þ´¢Ý¯œÕ šÚ¶¬Ü¸µá»ªß¾·Ü¶¯à½­ãÀ³ß»°ãÁ±áżáżãÆ´ßÀ»ä°ãÊÁÞÁ»äIJáŽáŸßżâĵàµàÀ¹ÞµÜÊÄÝÇÀáÊÀàǺåÌ»äÎÆæÒÆçÓÈèÔÄëÜÒîßÏëáÊÑĺžXft=Š'Cš2H¯HRÈZ^Ôd`Úmfßugãzlä|näzmä~rå}nâ~wä|rá|tÞxpÜniÔb`ÄSZ©DT.Jr?b>`<_:`:\5\5]5l5‡$> :G³HNÂVXÌvyҐ“ÖŸ Ö£¤ÐŠÙi`ÛndÜ„}ãzjäwfÐcZŽ'D[=YAW;[@Z;`Bb@h?j$Ig?f=iEhDdB_C^Bd>fDeE\?\BbBhBi!Cb>X=P9T@r*S›Ut¿t|Ñ}~Î}~Äx{Ápw¿prÈzuшÓŒ}ÕŒÖ‘|ԏ‚ÔŽ|ÔŽ€ÕŽ|ÕŒ|¢<L¢@P ;L¢:H <Nž>O¢=J =Ož:Mž:Lš0Fœ4G§>P¿MPÒd_Üpdáxcähç‡nëŠmêŒrê‹oé‹séŠsêŠoéŠvçŠtä}iÞr`Ôc\ÇSV²FTš4N.JŽ+G”2Lœ6L¡7K¦>N¨>N¨:L©>K¬<J¬BP¬AO±FR°IV«BQ­DQ®ET¯GX²MZ²LY¶GQºLS¸PW½KRÁQZÂRVÀRV½LR¼LT¹IX¹Q]誊õ¯Íb`°?R²IU®HY²FSµFV¹GOºNWºHU¼PWºNTÀPTÂOR¾PUÅSVÄV]ÅYaÂR[¿[bÌaaÆ^gÄblÉioÊinÒsqÐhgÄfnÊklÌihÄhrÉnkÍlhÆlvÍruÍpuÅmrÈbg¶^lÂce²P`ªOd´`p̘”ݦ™Ü¨Ûª á¯•â¯£ã·œÞ±¨Þ¦œÛ¯¡Û¨œß¶žÝ°¤Þ¬™Ô ™Ó££Ü´¨à¾´ä¿²Þ¸²á¾®Þ¾¶Û·°à¶¦ß¿¸ÞÀ¸äĶãǾâÇ»âöÝÀ¸âƹâÆ»àÄ»åƶàƺÞÁ¶Øµ¯ÚÀ·ßĽàƼäÌ»äÎÁàÊÃâǸàɾâÍÄåÎÁäÐÅåÐÇêÖÆéÜÓîàÐîßÄË°¬}"B~ C’0IªFTÈXXÐccÚldßxoäyhâxläyjâ}pà|qã{qä~tã}sà~wÜplÓ``ÄX[¨FUˆ+FpD`;]>a:_:[7\6X5Z
-0g7+D¤UkÉ ¤àÀ¶æÏÄëÔÄîÒºàÄ´Ô žÜ¯²ã÷┌Ömd¢8Hb?V>U<Z>ZC]@^>fBh@g@gBdBg!Fi"Jf I^DcCf@b@^>ZAaDhEgAd?`=Y@T@h"LIj·n|Ì~|ÐzÈvvÄpt¼pxÄvvÌ„~ÔŒ„ÔŒyÕŽ~ÔŽ„ÓŒ}ÖŠzÔŠzÔŠ~ÖŒ{ž<NžAQ 9Kž:JŸ:Kœ8Mœ5G 9Jœ4Gœ4F3D3G§>M½OTÓ_ZÚnaàygæjç†oè‹nèŽsèˆpç‹sèˆoéˆqè‰tèˆräzcßpdØe`Æ\\²KVž8L,I-H˜0Hš2E¡:J¢<M¨<K§;K§>L°@L«BN¬CP¨@P«BP©BQ©>NªEV¯GX°N\³IT¸KS¸IP¸LS½JR¾OW¼NT¿NTÀLP¼KT¶FVÈ_^úÅ‘ïžwÏYW®>R²GT³HV±ER´GR¸HRºMX¹NXÀPX¾PX¾LSºJUµGV¹NZÄX^¾T_Å[_È\aÄ_cÍfaÊafËhlËfhÄejÉnnÍvsÐpoÉlkÎjeÇdkÅlpÏljÑqnÆ`c·P[º`j¿\b´Ve¯Pc¼u„Ô‘ÛŽÝ«¢Þ²¦àµ¢ß¤–⬔ڣœß«•Ý³©Ý³©Ü¹­Ù¡–וŒÖ—Ø¯¨ß² ßµ¬â·¦âº°à¾²Þº¶â»¬ßÁºÛ¸±â¼®âÁ¸ã¼¯ãƸà»ß¼ÞÀ¸ßÄ¿àÀ´à·޼´Ü½·ÞƹÝÇÁà¶áõáǼàÈ¿ãÈ»âÏÃàÊÂà²âÌ¿âÌÅå̾åÒÆæÓÇêÝÐìàÑïßÆäÓ»CZy>‘2H­AQÄWXÔf`ÝndÝvpâyjâyjá{jä|nã|qä|mä}näxmá|tÞokÔcaÂZ_ªBPŠ0Jp?a<Z<_=\8Z:T
-2O4N8\Bœj~ؾºèÐÁîØÃìѹâÀªÞ»¯ÞºåÍÂíÑÂîÕÂæÖÀď–lBVARAVAX?\F[>cBi!DfAgBe?hBeDf$HbB^@fDdE^?_?^Ad@h Eb@\<V:\Fk$P‹Af²gzÈz~Ï~zÎzxÆvxÀpvÃxz΂Ò‰€Õ‚Ԑ~ÔŽ}ÓŠ~ÔŒ|ÓŠ~ҍyÒ‰zÖ‹{˜8J™<Lž:Jœ<Lž:Kœ;Lž9JŸ<J =Mœ9I›2Fš4F£>LºMPÏ\TØnháwhå€jçˆpéŒtèrçŠqé‹uç‹vç‰wç‰ré†mäzeào]×dXÈSS²CQ™9Nˆ$B‰(F–.G˜2H 7JŸ6K 8I¦;M§<L¨>Oª<M¨?O¦AM¤@R§>L¨DW©BS«DR¯HR°DP´HR¶GT¸LT¸LT½NU¼LT¼OTºJP¶BP°BXÛ“€ûÈ’é‹cÀPV¯>P²HX´ER´BRµJT¸JV¼LVÁRVÈTX»KVÁNVÀPX»MX¼R\¿X\ÂS\¿P_ÉaeÊajÈclÍhhÐnrÎknËgiÊdkÑssÌjiÇZ^ÃfnÎjhÐopÎkfÄ[^°Ub´\f»W]²Sc±\nÆz‚Ù›Ú¡–Ø™–୕㺪ᰜۨšÚš‹ØŽØ¢˜Þ±£Þ¸«Üª˜ÒžŸ×¨ Ü´¬à­™Ü²ªß²¢Ýº°à¸ªà»°âÀ³Þµ­á¼©ß½´àº®à¼«Ý¼´Þº¯â÷àļܽµÞ¼°Ù¹²Ø¼·àǽáǾãóæÊÀßȽ޽´áøàȼàÉÀâʾáÍÃÞÈÂáÊ¿äÍÂáËÄäÎÂåÐÄçÓÈìÞÔìÜÎêÛÀ²ˆx@Œ*C¥?NÂRVÑcaÚlißwnâzmâ{lå~lå~nã~lä~nä~qá|rà{sÝpnÑcb¾VZ¬ITŒ/Jn>\?\<\<W8U8P
6L?XEŸ|ÝɼíÔÂìÒºæÀ¨Û²¥×¼¸àÊÃåÎÆìÖÈìØÏíÙÌîÓ¹Üijj,LLARDTBVB\C]AfAi"EfDbBh&Lg F`BbBbBcDfDdE_B]?`Dj"Fl(JaAW<P<^B~5Z¦_xÅxÏ€Ï~yÆv|ÂtzÃtv΂€Ò‰~Ô‘‚Ô•€Õ‹}ÕŒ~ԍ}ÔŒ~Ó‰~Ò‰{Ô‰{ÔŠ{œCV›:Kœ:L;L8I6I¢6G 9H¤8Fž6H2Dœ4H¦:I½JOÒ`XÙh`âxfælæˆné‹téŠnê‹nè‹pæ‰xé‰mætè‡näzdàp`Öe\ÃTV®CRš/H†&BŽ)E“/H–3Jœ2Jž8J¢;L¦<O§<N¬AN§@N¨>L¨@L¨?N¦<Lª@P¬CO«DN¯HV±GV²HW´IR´HS·HQ¼NX¸KR»NR»FN°CV¸NYñ¼—ù¸~ã}eÄRV²BT¯@P´BO¸HR¸HU½KT¶M[½LQ½RXÂPTÀPYÆRVÀS\ÀU[ÂX^½YdÂZ\Æ]eËdcÌegÊ`dÏnmÐghÇclÇmkÉ\`Â]dÈjkÎljÐolÍhe¾[cµ]e¹X\­GXªI^¹j|ÏŒ‹Ø‘‹Ø–Þ¬ŸÞ¬žß¡Œà±£ÚœÙ¡”ؤšÖ ™Ú¤’Ù¢‘ט×¤¡Ý³¥ß²§ß®™Û®¦Ü¨˜Þ³¥ß¹¬àº°Þ¶¨à¸ªÝ»²Þ³ªâ¾¬Ú¸³Ü¸®à»°Ü¾¶Þ¼´ßº¬Ö´¯Øº¶Ý¾¹àÁ¸ãƺâȺáÄ»ä´âʾàǽÞÀ»áÄ´àȾßÊÃáȽâËÂàËÃßÈ¿ãÊ»áÌÄä;äÐÄêÖÊìßÒêßÊμ·…4N‡(C 9L¾OTÐ`\ÚjaÝtmßxlá|nå|læ~nå{jã{oåqâ|rß{rÛqjÔdb½RV§BNˆ(Dm=\;W9X8R4M8J<f4Y°™¨à̽íÙÄèÈ°Û®˜Ö·±àÉÂåÑÈìÚÎïÞÐòßÎõâÑôäÕðàÐèݐi‚HBNBSAYBXAbBg"Hi@c?dAi Ff EbCbDaBb?f@a@[BaBbBh@dCaAV@V>p#NœQm¼t€Ï€„Ï}}ÊwyÇtwÄtxÈ~€Óˆ~Ր„Ö‘Ô’ÕŒ}э€ÒŠ~Ô‹~ÓŠzÓˆ{ÔŒ|Ô‰xœ6I™:OŸ8Iž:L =M¤=L¢<L£>N¦=J ;Mž9KŸ1Fª<L½PTÎ`Z×j_àubäjè†méŒtêpëŒrêŠqêŠsê‰rèŠrç„læ|fÜqbÒ_XÇVU°BJ—.J‡&DŒ&E+E’0Gš4I :L¢:M¨=L¨BP­?J®@L®?M®BNª@RªAN¬CR¬@P­AP±FT°GS¶FR¸HRµJR¿KR¿NU»PUºJP¸KU²?UÈf^ûΚô©vænÊXY°DT®BR±HU²FV¸LU¾NV¶FS¶PWÂSZÄLPÂR\ÀQXÄWY¼SaÄ[_ÂR\ÄaiË`bÉ^dÎhiÎa]Æ\bÄhlÈc^¶O]¹`lÏmiÎiiÐkhÊbcÂZ_Æhg¿S\²L\®M^ÂnwØ“‡Ù›–Ûž•Þ¤ã¯œÜ—ˆØ‰ÜžØ¢Öž˜Ø¤Ù«œÖ’‰Ñ“‘ל—Þ®›Ü¬¢à°žÙª Ý°žÜ´©Ú®¤ß¸¬à¸ªÜ´©Ý¼µà¸¬Üº±Ý²«ßº¬Ú´°Ü·¬Ú²£Ù°«×´²Ý¿¸âÅ¿âÁ¹à¹â¸ãÆ»âźßÀ¸á¾¯âǵßƻݼ²àÄ´àǼÞÈÀáȺßȼßƼÝúߟàÇ¿âËÄäÓÌêÜÒëÞÐáת‚‹‚&Cš4G½NQÒ^XØnhÚ|qßznâ~lä|hãnãpã~lä|mâ}qÞ|rÛskÑc_¾RT¤CMŠ,Eg:V:R9O8I9K?{Mm¬²æÏ¿ë־⼥ћ‘Òº¹åÏÂëÕÈìÙÉïÜÊïÛÊïÙÉòÚÌôßÍøæÒóæÌŬ­LFNDP@U@Y?^?bBfDgCiBh>`@^>^>b@c@bAX>[AcBh DfAfD[@ZAj$ODeµj|̃ӀyÍ||ÅuzÂvxÈ||І€Õ‹~ԍÖŽ€ÕŽÓŠ€ÕŽ|Ô‹‚ÒŒ€Ò‹~ÒŒ|Òˆ{Ò‰{Ÿ:Lœ:KŸ;K ;J£;G¢<L£<K¨>Q©?L¤8G ;K¡5F§?JÀOPÑ\XÚiXáveäfèˆréŠpêŽuêtéŽrépéŠqèˆpç„mæ~gÝpcØbYÊQQ­=I—2E‡&D‡'C(B’,Cš3G¡;L¦AL¦:Jª@M®@M«BP­BM­DR­BP°@M²@L®CQ¯@M°EO±HP´IS¹DN¼FNÀLPÀOS¾NU¹NW´GS´BXÓˆ|úÍ—ö©xáuaÄKR¯ER®?Q«BTµDP¶LVºDOµJVÀRVÆX`¼KTÀPUÂNZ½V\¿TZ·P`½`iË]bÎffÐhgÄXZ»VbÄda½PZªN]ÀdhÒigÒkiËghÉccÄadÄ]Y½QU´MZ¹P`È{}ØŽ‹ÙˆÞ¦–ݦœÞ¢–Ý›Ø‘…Õ‹†×ˆ×š”Û´¨Û¡”Ô•’צ Ü¥—Û©œÜš‹Ù¨“ܪžÜ³¤Û¶®Þ­›Û·®ß³£Þ¸ªÚ­ªáµ¦Þº¸Þº¯Þ¹®Û²«Ü²¡Ö¬¦×®¥Ý¼·äÁ¶á¾¸äÁ³áÀ¶àÁ¶âÄ»âĻᾱàÀ´ÜÀ¶Þ»¯àÀ¯Û¾´Þ¾°ßǼâȾÞļÞĽàÈÀÝÈÂÜÈÂáÎÅáÉÂâËÁçÕÍéÞÕèÜËÖǼšQf˜.F¹HJÏ\X×jfÜnlà…zâ~uå~qç€jæ€oå~nä{nâzoßxnÜohÍcc½UY¤=K|=]5N8I4I<RF“j†Ò¼èÐÀé̲֩•Ì•“ÚþåÒÄìÖÇíÕÅëÔÁìÓÃëÓÄëÒÅîØÈïÙËôàÎöèÌØÌÁ`(LLEOAV@^C`CcBeChCgDa?dA[@cAf@bC\>Z@\@dBf>fC_DZBdL„8\¬cxÆw€Ð€~Î~~ÇwzÁqvÆ{|І€ÔŠ€Ö‹€ÖŽ~Ö‹~Ս~Ս~ÓŒ~Ó‰zÓŠ~ÓŠ~Ò‰{ÔŠ|Óˆz >Rž:M¢=L <L¦:G¦<N¨;IªAN¨=N¦:H¢7H¤4E¬<J¸MSÎZUÚj_ávcåfèˆlëŽqêrìnéŽvêrërêŠpé„iå|fÞqaÕbXÆPO¯@L—.EŒ0HŠ-DŽ.E‘*B›5L:L¨>M¨@P¯BO°DOªBP®@J°DN°?J²BN²@M±DN®@N³DNµEP´GP·JS¸HO¿KQÀPU¼U[¸V_¶FQ´GXüÆŒñŸzÜo]¾HT¬=P¨BS¯FV³GS²FRºHO½LUÀOSÀVY¹FN¹LWÃ[`ÀJR¼VbÊ^_ËccÍfkÇaaÁXc¾`jÂY_¸Pc¸\gÅcgÐhkÏhbÊ`^À\fÆc`¾RT´PW³LX®I`È‚Û•ˆÜœ‘Úš–ߧ˜ÞŸ’Ø”ŽÚŠØ“ŽÔ’’Õ—–Ú¦”֏…Õ’ŽÚ¦›á¯œÜ«ŸÛ¤’ל“Ùš”ßµ¨Þ²¬ß¹«Ø°«Ý¬˜Û°¤Ü¬£Ý¶¬Û¬«â¶¡Ú»³Þ´¤Ø¦¢×«¨Þ½µÞº´äº¨á½³á¿±Þ»´à¹§á¼°ä¶à¹޼µàÁ´à·޿´Ü¾¶Ü÷ÜÀ¼àźáÈ¿áÊÁßƾßÌÄáÌÁàËÅâ˾áÈÀàÉÁåÐÇçÕÍèÙÌåÙÄÀ¢¦˜6L²CNÍ[VØiaÛtjàtã€ränçƒmæoæ‚oä~oá€rÞzpØlfÎc^¹NRœ<Jv:W
6H
6C<[(N¦‰ ÚƼéÒ¿äÄ­ÐœŠÆ›¡×¼éÓÅí×ÅìÒÁêпç;çÏÁéÓÃêÍ¿èÆ·ëÐÄòÛÈ÷æÑãÔÀxC`JDRCYA]B_@a@c>e@b@cA`<`<d<^:W:V=`Da@iGiDcC`I\Dv&PŸRnÂtÒƒ†ÑyÊzxÇvzÆwvÌ‚ÕŠÔŠ}ÕŒ€Ö‹y׆{ÖŒ{Ô‹|ÕŒzÓ‹}ÔŠ€Ô‰xÒ‹{ÓŠyÖ‡x =P¢:N¢>L¤;K¥=L¨<L©?K¨>Iª>L©?K¦=L¤6Hª@L¼KRÎ]YÜiXãv`åfèŠlê’sêqêŽrê‘uërìŽnêsè‚jæ{dÜqdÖbYÄTT®EM—0F‹'@)B‘,D•0FŸ5H¢;N¤>N¬@L¬CP¯@M¬@M®CL²EN³BL±DM²BL°DJµDK²EP³EL·HP¼KTºOWÁLPÁNR¼NT¹Q]µHY¹OXô¾™ú¼…óžkÙoc¹AMª:L«@M¯FS®DS´JT¹JU¾PX¼PU´@L¬@P¿W[»MZ¿X^Ì\_ÊafÈ^`Ìb`À[bÀZ_¿OY¸VeÂ^fÑjmÍrpË^`ÂTZÃ`aÎfbÂU[¸PX¸LX´ViÎ~‚ÚŒƒÜš•ÞŸÜ§œÚ˜ˆØ…ÖŽ†×Õ–”Ü£šÚ–ŠÔ’Ú¥ŸÜ§Þž‘ܤ—ܦ’ئ›Ø£žÚ®¨à§•Þ¼´Ü®¡Þ¹«Ø®©Üª¢Ý§ Ú®£ß·¦Ù©©Ú¢–Ö£¤Û²ªâ¿¶ã¿µãÀµà¹²â¹¨Þ¼¶á½°Û´®Ý®£â»ªâøà´޾µà¶àúÝļÜÄ»ßÅ»ßÆÀãËÀàǼàÅ»ßƶÞŸÜüÞÅ¿ÝÇÁßÉ¿àÉÂâÍÆäÐÅèØÅÝμªev®BKÊYUÔhaÚulà|lã€mä~jç€oæ€jæ~læ€hß}oÞtcÖojÆZZ¶HJ—:Gg6J8F>o>a¶Ÿ¬ãÐÄìÒ¼Þº£Ê…Ê¢¨ÜÈÂéÓÆìÕÃëÓÀèϽçË»å̾è̾åɸáŶáƽèÑÇïØÊöäÌçÛÅ„McKDP@ZAZB^Ab@b?fBbB`<`=`;b<\>V9]Ab?c>iAbB]EYCgHŽ@d¶j}Ђ„Ô‚~ÏzzËxxÆx{Ë~|ш׌‚ÖŠ|؇zÖˆyÔ‡|ÔŠ{ÕŠ}ÕˆzÓ‰~Ò†|Ô‰xÑŠ~ÒŠz׊y¤<J¤=L¥?N¨AN¦=LªAV¨BO¨?L¬@P¨?K¬BO¨=M¬@MÀQPÓ^VÝfYáu`ä‚hèˆkêpê’qêqê“xêrëqéŒnéˆiåmàt`Öe\ÃSS®EN˜4K*B.G‘-F›1F 8J¥:L£>N®>Mª>N®@O¯CO®CR²EM´AL²@L³@J²DP´ISµHS¸GP¹IO¼JQ¹JR¿MSÀOUÀPTµFR²@RÅ[YüÐœø¹†î•qà|aµHT¬:M­GT±DR´HW¸MW¸GS´HR¨>Q®GUÂNUÁU\ÄY`ÄX`Ê\_Í]`ÀT]Ä^fÃY`µN`»ZkÉ_cÈ`gÏhgÈdfÂ]gÈbfÏjdÂ`dºRWµGTºYeÔ‹‚ÞŠ…Ú‹†àžŠÜœÙ”ˆÖ“ŒÖŠ‚Ò„†Ù›’Û£˜×Œ†Ø—˜Ý¦žß§œÞªžÛ¡”Û›ŽÙŸ—ݪœß²ªß°œÚª¤Þ§˜×±¬Û©œÝ´­Û®¤Û´¨Ú¦žÚ ˜ÙÕ­¨Þ¸ªÝ³¬á¸¨â¾µà½´âÀ·à´¯à¶¦á¿´á¾®Üº´Ý²ªá¾®à¶ß¸߽°à¿µá³àÊÃàľ࿰޿±Ú¹«Ø¾·ÛľÜƼÝǾàŸÞÉÀàȾßÉÁàÊÂáÍÅäÒÉâÖÈ̶¶±htÇXXÖcXÝtfàyhã}hå~iæ‚læhä€jå~lâxeÛscÔhbÁRQªBIŒ-D]:]#JŽfÊ¸¸èÓÃèÌ´Û´¡È––ΰ´ßÈÁéÒÂêоêоèλèλäǹݻ­âŸáÄ·ãȺéÎÂêÔÈïÚÌõãÈèÜÄ‚K`JDR@\C\D`GdDdC`8\:\9]:d@`;[@]A_>eBfBd>Y<U>[F|*Rª\tÌ|‚Ñ„ˆÒ|Êz~Èt|Ê~шÔŒ‚׉׉|ÖŒ~Ö‡|Ô‹|Óˆ~Ò‹ÒˆyÔŠ~ч|Ô‡xÔ‡}ÓŠ~Ö‰y¨>M¨@N¦>Lª@K§BO«@J­DN®AK¯@L¬?K«>Kª=J­@L¼NRÑZXÚncát`å€jæŠnêŽnê’xêqê‘wépëlèlèˆpè‚gâveÙfYÆSW±FO4G0F’+E—0Fš4J¢8I¡>O§?L¬BO¯DN°AL­DP±BP±AL´CN´DN´BL±@L´EMºIPºFPºHM¹MS»MRÀMPÀPR¾MP¸JR³BUÑrhüΞøº‰ê’gÑ`V¼KS°@N²GR°@L´JT²GS²EN¤8Q­JXÀTb¾VZÄNYÆY\ÌabËTXÄZbÉ\]ÁR^»_jÀ^dÄR]Ä\fÎhgËdlÊrtÐnnÌghÆ`aºKR­DT¼ajÑxyÛ…wÜ›Û’ŠÚŽ‚ÚˆzÔŠ†Ô‰„ؘ’ÖžžØ‡zÔ‡ƒØ–à«œÝ¦à¤•Þ£œÙ£œÕž™ÛªœÜªœß² Û¨£Þ¬œØ«¤Ú¤—دªÝ¦›Û²¦Ú£˜Ö˜‘ÒšžÚ¤ŸÞ¸¨Þ­¢ß±žÝ¶«ä»¬â¾¶â¼°Þ»°Üµ°à´¨ß¼²à¼¬Þ¼²Ý¶°â¿«â÷ÝÁµÜ¼¬Ý³¢Þº©Ö§˜Õ¶´Ú¾´Ûº´à´àÄ»áĹßÆ»ÝÁ·àȼÞžàÈ»ßÉÂÞÈÁäÎÄãÒÏåÒÆÒÀ¾Éˆ‘ÖbYÞp\âzdå{bæ|aç€gæ~dä€já}fßwbÚugÒaW»PP 5D~&F†Ig¶œ§ÜÊÁêÒ¿â¾£Ôª™Î¢ØÀ½äÍÂìÔÃéÐÀè̽ç˼äÊ»äƶßÁ¶ÝºáÄ·áĶäË¿êÐÂì×ÊòÚÊõßÇåÙÁ€D]HBPB[C]EbHf"EfEa<_;`:`8]6Z8\=`>gBf<c<^:O9M
-:fL–DcÃu‚Ò‚‚Ò€~Îx|Êw|ÈyxцÔŒØŽ|֌։|Ö‰~ÕˆxÓŠ|Óˆ|ÒŠÒ‹ÓˆzІÓ„yс|Òˆ|Ô†|©@N§DO¬BL«>K¯@L°EP¯AL°?I°?G«<K®>Iª9G¯BJÂJOÒ`[ÜjXáufä€gçˆpêxëŒpêŽréxë’qëwípêŒtècâxhØh[ÆRRµCN¡3F’+E•.E™.D5G¤=K¦?L¨?N®CN¬CP´?J¶GN´EP³BMµDP·JO¶EO³AJ³DM¶HPºKS¾KR¹LR¾LRÀRTÃOT¾PV·FR³>Wà‘yûʐ÷½ˆâz`Ñ\T»IV«=L¨>L®@P¯DO²CR®@R·KWÀO]ÈVZÁMRÅ[^ÀOR¿TYÇa]ÆR[´HXÁZaÈW`ÅZeÄ_gÎ`bÍgnÌceÄZbÆ]`Ç`_¸HT¨<R¸eq؉|ØŒ„×€|ߌzÜœŠÔ}€Óxvҁ}ÕššÚ “Ô„}ÒˆŠØ˜Ü•ÞšŒÞ¬›Ü¡œÜœ’Ü­ Ý®¦ÙŸ“Ú ™Ü¦œÞ°¤Û¨£Ú¦–ש¤Ü£šÚ°¥Ö˜’Ò”“Óšžß¦–ß´§Ü¶ªÜ®£Ü§ Þ¬›ß¶¬àµ¤Þº¯à¼´à»²Ýº²ßº¯Ýº³à¼¯Þ¾¸Ý·¬á¹âÅ·Û¹­Ñ–Ë“Ô´´ß·Ý¶ÝÀ·Ý¿¹àÅ»ÝÁ¶ÝúݼÝÁ¶ÝļÞļÞøÜþÞÆÂáÏÊãÏÊçÔÆÞÎÂԍŒÝjVâw^äydä{aå{eå}fã|eâydÝvbÕm^Ë[S°JUœD^¬y‰Ò¼»éÔÂæĮ۶¢Ò¨ Ïª¦Û¾æÑÄèÏÂèξæɹæɶæȹâĸÞĸ޿´à¶âĶäȼèÏÂêÒÆìÔËòÛÎôÞÅâÕ¿u9RLBTDZB\DbCgBe F_=d>`<b:`>]<bEcCjBhAc=T8H8S@„5]³fxÏ{~ӁƒÎ}€Ëv|Èw{΁Պƒ×‹~ØŒ€Ö‹~ÕˆÖ‡xÔ‡zÔ‡}Óˆ{Ó‡{Ô…xÔˆ{ÒŠzÔ†zφ{ІyÔ‡zªBPªAK®BP®DM®BL­BN­EP¬EOªBL°@L«<G¬>J°@HÄHKÒ\TÜjZáxiä€hæ‡tèrêqêsê‘tênísí‘pìŠlê€iâvdÕhcÆVT´CJ£2F‘*B”0E˜0Gœ5I 5F¤>Oª=K®@L­BN±BO³BL±BN¶CMµHR²HN´CN±AL³AH¶DM¸OV¹JM¾LP½OP¿LMÂPR¾QT¸ET¶CVꬖüÊ”ô²~Þq[ÊSO¹OT¬@M§=K©>O¬EN±GT¿LQÂNZ½IQ¾KVÂPV¹AJ±LY½][¿NW·IYÅ^bÎ\fÆXeÉ_dÎ]dÈ_cÈ[^¼R]»Y`Ä`^´MZ©F]¾fqÓ|wØ‚zÜŒ†ÙŽ€ÒvtÔyoÓƒƒÑxyэˆÖ’Í|ƒÔŽÞ ˜Üž–Ú˜‘ݘ“Üš’ܨÚ«§Ü¤˜Ý²¦Ø ˜Ø•ÚŸ’Ø£ Ú¬žØ¤¤Û§›Ú¦œ×“ŠÏ×¢žÛª¢Û¦šÜ¤“Ý´¥Û²«Ú°¦Ø§¢Þ²¢Ý´®à´§Þº¬ß»²Ý²«á¾°Þùܼ²à¼®ÞÀ¸àÀ´Þ·§Ôž”Ë’–Ò©¦Ý¶§Þ¼°ßÀ³ÝÁ»Þ¹ßƺÜÀºÞºàùÞúÝÀµÚ¾³Ø¼¶ÜÀ¶ÜľÞÆÀàÌÄâÏÊçÒÁÞ¸Ü}nãv^äfädå|`ãyfâybßxbÚo[Òe]Ä^d¸sƒÎ¬°äÏÀèӻརմ¦×³¤Õ´²ÝÈÁåÐÂç;çͽæʹâŶàÄ´äÆ»ßÀµßÁ³á¸âÅ·äÇ»åȽæÎÄíÓÇìÖËñÙÍòÛÃÞͼf$DOET<ZB\@_?bB` Gd!He@b>_>^;^?eBb>h>f>_<P	4L
-:lL¤TrÄu~Ò„†Ò‚…Í|€ÈvÌ€€Ô‡|׋‚Ö‹ÖŒ|Ô‹‚Ô‡xÖŠ~Óˆ}І{Ó…|Òˆ}Ó†zÔ…|ц|Ô„zÒ„|Ð…{Ð…~«FRªDP©CM¬DM®FP±@J°BL­CN°BL®>G­@Q®;I´ALÅNOÖ\TÜk\ávdä€gè†lê‹rèŽrêpë”wê’mìŽtìnìŒkè‚jâydØi`ÊVTºIK 2F’)A”,E˜/C6J¢4H¥<Lª@N±EP­FR¯DR²DO²DO³EL²?L±HP´CK°?H¯@H¸BL¹HN¸GLºJP¸NT¾LO»PVºIQ°@Q±AQó¿“ýÉŒðžrÚfUÅSVÂRU¯ES¦<P±DQ°FUºHR»IP½HT²BP½LR¶BO³KUÄVYÁTZ¾V_ÆX^ÇT`ÈXbÎ]_ËbdÌafÊYZ»U^¿^c¿VZµNZ®M]ÄivØ|uڍ„×…Ù†|×…€ÓurÎpwÏusÖš”ÊzwÆlvÕŒ‚ݘàœ‘Ü›–Üœ“ß –Ú¦žØœ–Ü£ÖŸžÜ™Ú¦–Ø¡ŸÙš”Ú¨™Ú¡ŸÝ°¢Ø¦ Ó†ÍŒ’؝’Þ²£Ü®¤ÛªŸÚ£šÜª Ý³¤Û´¤Û¬¤Þ¬¡ß¶§Ü²«ß°¢Þ·ªÜ°ªß¸­àÀ¸àºÞÀºàÀ²Þ¸ªÎŽˆÎ”‘ر¦Ú¹ªÙµ®Ù¸³Ü¾´ÞÁ·ß¾¶ÞÁ¸ßÁ´àºß·ÜÀ·ÝÀºÛ¿·Ø¾ºÚ¹°Û¾´ÚÁ»ÝùÞÈÂáÉÀäζܡšãu`æ~`å{bã{câu\ßyfÜveÖmdÒ„Ô¬®ßɽëÒ½æÁ¥Û² Ø´¤Öª ×»¶àÉÀçпæͼå˺äɹãķ߸ãŸáÁ´ÝÁµá÷âÄ·âĸäÊ¿æÎÂèÑÈêÒÇíÕÌðÙËðܾӸ¨QDNCVF^E^C^B`B^@b@c@^7^9Z<[<b@f=e>`>Z<O
-9]BŽ9`ºfvЀÓƒ‚Ñ}|Éz}É|~ЃÖŒ€ØŽ~Ö‰|ÔŽ‚ÔŒyÕˆ}ׇ|Õˆ|Óˆ|Ô†zÑ‹|Ó‡~Òƒ|Ó†{Ò„zÑ…yÔ„yÒ„xªBTªCN°FQ°EO®CN­BO«CM¬AL°DO¬@N¯@N®BK¶GLËOLØ]SÞmXâwbâ{hæƒcèpéŽoì‘tì–sì”rí’vì“rí“tègâxgØf[ÈWT·FLž0D“.D˜-D›0Fš6H¤<L¥<K§>L°@M«AL±AN³FP²EM²EN¯@L³EL°DM°AN´@JµDK²DN¸HM½HLºJO¾MP¹KO³GQ®<R·LUö̦ù½ŒçŠfÖg^Ñb[ÀV[µFS®IU®AR´FRµIU¸>J®GX³AN¬<MºOSÄOSÀU`ÃTV»HU¾Q[Î^`Ë]fÍagÉXZ½KX¸TaÃZ^ÂS]¸T`´L\ÁkpÔpk×}Ü…xÙŠ€ÔspÐwvÔyxÓ…„΁|ÄgfËy|Öˆ‡ÚŠ…Ý”…ݘÚš”Ü¢œÜ¢šÛŸ×˜‘Ô”•Ø”ˆÖš–Ø™˜Þ±¢Û®®Úž–Ú¥’Û“ˆÔ’‘Ò™›Ü§”Ú¥ Üž“ܬÜ®¥Û¥žÛ©–Ú£›ÛžÝ²¡Û­¤Û œÝ§—Þ´¬Ü´°Ý¶²Ü¶°áÀ·â·áÀ¸Ù«¡Ò›”Ѧ¤Ö¬¤Ú´¨Ø²©Ý¹¬Û¼´Ü¾´Þ¼°Ü¼°Ü¼´Û¹­ß¿¸Ü½²Þ¾¶Ü¾·Ý¾·Û¾º×½·Ø¶­Ù¼¶Ö¼¹Ø¾¹ÝÈÂâʹ߾³ãxbå|bæ}dãxZßu_ÜpaÛvqØž¢àúêѾæǮܱ–ض¦Ú´£Ô­¨ÚÃÀâÌ¿çξä˼ãȹâǶàõ߶à¶ßÀ²àĹàøâĸãÄ·âÊ¿æͽèÐÆêÐÃìÔÇìØÌðØÉðÚ¼À˜’KFPATA^F]B`B\=]@dAc>_<\=\>\:b>g=e>`@]>hA€.U¬YtÊz~ҁÒ€€Ï{{ÌwxÎ}Ö‡׋€ØŒ~ÖŠÕˆ~ÕŠ~Ôˆ|ÕˆwÔˆ~Ò…zÒˆ}Óˆ|ЇzЈ}Ò†zÒ…yσ{Ô…yÒ„x«CR¬FO¬BN¯?H®BL¯@L¬CP¬BL¬FT¬<J®BI±?G¼HJËNLÙ_Vßl^äxlá~lêˆfêpêlë“sî”rî–tí”tí”qípè†iãzgÛj\ÊXT´FL 3D•+@’*B™0Dœ9K¤?L¤9L¨@Q¬BOªDN­AN³EK°DN´@J²DO²EM²DP°BK²AI²EM´DM¸HNºIN»IN·GNºIO¯FRª<TÆb]üÒ ø¿‚àƒpÞr`Ð]VÈYY¶FR¶GR³HV³JZ°BP³DQ°?P©@R¶NX±>Q¼NV¼IR®@T¸R^ÆX^ÂT`ÆY^ÆRZºJX¼W`Æ\a¾S_ºR`ºUeÌsv×yrÕwvÚ{oØv×|sÏuuÐvvԁ‚Òˆ€ÀdiÈy~Õ‰ˆÚ…ٍŒÕ€Ú˜‹Û¦¡Ú •×˜Ö’Ø“Ž×”Ô’•ÙŽÜªœÛ¦ ß°œÙ¦£×‰…Òƒ„Ö™•Ü¬¡Ü¡’۝’Ù¡›Úš’୘ܪ§Ü ”Û¤™Ø¤šØš’ݦ“ج¨Øž˜Û¦–߸®àº­ß´§ßª–ß°œØ¦ Ð˜•Ö¬¢Û³¨Þ¸©Ú² Ú²£Ø­œ×¯¦Û¸®Úµ¬ØºµÚ¼µÚ»¶Ý¶¨Ý¸°Û¶¬Ú´ªÛ¼´Ø¾¸Ø¼µÕµ³Ö²¤Õº²Ô´¯Ø¹±Û»Ýź݄yâz]âzbãxfÝxk؏ŽÜ²®âʼæͶᶜٳžÚµ¢ÙªœØ·´áʼæξæʸåǺáŹà´ßÁ¶ÞÀ¶àÀ´áÁ´àĹâĸâƺâ¶âƺäÈ»çÌ¿èοêÏÂîÕÈîØÌðÚÅïܼ§v|KCRJX"I^H^E`AbAa@b>\:\<Y9Z<`?d?fBfFeEmJ~$M›HhÁn|Ñ|€Ñ€Ñz|Ïy|ÎzxÒ„Ö‰~׋֍ÖŒ€ÖŠ|Ö†Ôˆ}Õ†zÕŒzÔ‡{Õ‰yÓ†~Ò„{ц~І€Ò†}Ñ„zÐ…zÒ€z¬EN­BP¯BN³@J®@L¬@N«BO®BP±FO­@I®>I°@K»GJËNKÖ_WÞlZâ{hä„nè‹qëŒsì“mì–vî–rë”tî–}î–xì”vé‡jä{gÛiZÍXP²BL 2G’.F”.D—3I›;O¤<M¤<L«<K¯EO®@K¬@L¯DM¯BO±CN°CL²AL°;J±BI¯CN²FN²EK·JQ¼HO¹KO¶HN·FK®AO©7QÖ‚rüÑŸõ´~êkÝq\Ó_WÈ][´DN¸HP´HT²GU¹KX¼LW°HY¶ET´DU·LS¾PV´JYÀRYÈRXÉ[_ÃX_»O\¾Q\Ä^cÈ]dÅ\bÂU^¸PcÌsv×€€Ôwt×€{×stÕslÒrtÑvqҍˆÈoj¿bkËx~Ø‚ƒÙ†~Ùˆ†ÚˆÙ”‘Ö’ŽÙ™‰ÖœšÚ—Œ×—ŽÖ‘’Ù’‹Ù •×¢¤×Ž†Üª™ÛšŽÖ’‰Í€ˆÖ–ŽÛ¦™Û —Øœ—× šÙ›”Ù¤šÛŸšÞ¡Ø§¤Ú˜”Û­¢Ø£ ×˜’Ú©šÚ¯ªÚªžÜ´¥ÜŸ’Ö™ÑŒÖŸ›Ø¢œÚ¬£Ý´£Ø©–Ö¦Õ¤œÕ¬¨Ô®­Ö³ªØº²Øµ±Úº°Ý¾¸Ý»´Ø²°Ú®¥Úµ¬Ø´®Ù³¯×¸°×·´Ôµ²Ò¬¡Ô³­Ð²­Ó´®×¹²Ü²ۧ¦àqbßxd݆„Û°®à°èɴả޷¡à¼¨á´¤Ü±©ÚÁºå̾èͽåƺâƸá´ÜÁ¶ÞÀµß·ßµàµß·âÅ·äƸâĸâĶãĸáÄ·äȹæÌÁèÐÅî×ÊîÙÍñÙÄìÚ¾‰RdOJRGXF^E`FbE`AaBb<Z<W
7^;`B`=eCc?dFp"Lz(P’8\±\tÎy‚Ò||ÒxyÎv{Ðx|Ï€~Ôˆ‚֍„׈~׈€ÕŠ~Ô‹‚Ս~Ôˆ|Ôˆ{Ô†}Öˆ|Ö‰~ÒˆzІ|ц|уwÓ…xσ|Єzу{­BP¬FO¯BN³@J­CN¬DP®CN°AK¯EL±AI²@I²>J½CGÊPMÖ]VÝm]äzfå…lê‹nëŽmë’rï’pî–sì—wî•uî—~ï’rê‹pâ{fÜn^ÎUQµFL 6D‘+D“.C–3F?O¥@P¤8E©<K®@L¬DO«EP°BM¯@K±AJ±@L°BK±<I®@M­FR®BM²FN´FOºFOµFL¸GNµCJ¨;N¨:Oæœ~þΗ÷µémß~cÓh\Ê\X¾PU´BM²ES¬DS´IQ¶IX¸GRµFW¼R\µ@Q¹P\ÀLW¼ITÄY[ÄV\ºKX¿TbÈZbË_fÌ]bÀOX´K]ËjrÖxtÕxvÔ}~Ù‚zÖqoÏhhÒttÒ„ˆÎpg¿aiÍt~Ù~uÚŠ„ׄƒØ‚ƒØ“‹Ú™‹ÓƒƒÎ…ØŽ‚Ø”’Ø—Ú ”Ø™—Ø—Ý¦•Ô›–Ó„wÓˆш†Ù¤“Ü –ÚšŒÚ ŒÙ£ Ú£™Ü¤šÚš”ÜžŽÚžÜšˆÙ¨ Ú–Û¨—ר©Ù¨¢Þ³ªÜ®¥Ý³¥Ô›•Ò™˜ØªŸÜ®£Û¬¥Û³§×¬¤ÏŸ Ö¤šÚ´­ÙµªÛº²Ø²®Ü½¶Ù¸²Ú¶¯ß¸§Ú¶«Ø¬£×ª¢Ù°¨Ù´¬Ù³°Ö¯¤Ö´°Ò±­Ð­«Ó®¦Ò¶´Ó¯ªÔ°±Ö·«Û¾ºÜ’Ûš˜à¿°èϹäªڪ‘Ú³žß±ß³ªãÀ·åǺæɸæɺäƸâŸàÄ·ÞÀ·ß¶àÀ³ß¸àÁ¶áùâƼãǼãŹáĸâ¶߿±ÞÁµæÊ¿æÍÂéÏÄîÖÌïÚÌòÜÄäÖ¿v6QKDVH\D`BbD^@`FbG^?]=X:^=c?c<dBdGjJt%Pƒ1W£PnÄrÓ}Ó|Íy}Êv}Í~|Є‚֊Ռ؋€×‰~ÓŠ€ÔŠ‚ÕˆÒ‡{Ôˆ~Ò…|ÒŠ}Ô†|Ô„xÐ…}Ñ…zÒ†xÒ‡xЂyц~Є{¯@N¬AL­CR³DN¯FP®AK«<I«CL®DP°?H±?J¶BHºHLÌQLÕ`UÜl\ä|dç‚fè‹nì‘qì•tî–oïští™vï—wî–zî’xê‡gäzdÞk\ÌWP¸HM¡4E‘,A+A–.Dœ5F¥6H§;H©?K®:H­AM®AN°FL°@J°BN²>I°?K¯>L¯DN®>L²AK³BL²DN¸FLµJP¸FL²BK©9O®<Pï¼™üΕö«vì˜jàxjÙhbÎZV¿LQ³HQ²ERºNS¶LSµFR­BR¶JVÀHQ½NXÅP[ÁT`¾S\ÇS\¿OYÁT\ÌY_Ì_jÈY[¿MW¶K^ÈktÖz|ÔrsÖ|zØ~xÔvqÒpnÐqnÑvrÊnjÀafÍpyÖ}xÔ{}Öxx؍‡Ø–“׊„Ò…ƒ×…Ôˆ‹Ô‹‹ÚŒˆÚ¢›Û¨¢Û¨œÖ”—Ø‘ˆØ–ŒÏ{Ô––Ú¢˜Üœ’Ý¡‘Øœ—Ö•’ÛœŠÚ¨žÜ¡”Ú›’Ø¡—ÜœŒÖ•–Üž‹Ù¨×œ˜Þ±£Üº³à²£Ü§™Ö¢Ø¥¡Ù§žØ¤›Ú¦›Ü«™Û´ªØ´­Ø³ªÖ¬©Ú°£Ø¶ªÚ·®Øµ®×²©Ú¸¯Ú±©Ú¦œØ¯¤Õª¨Øª§×­¨Ø°¬Ö°§Ôª¨Ô°§Ó­¤Ð«¨Î£ŸÒ¯«Ð¬¬Ô®©Ó±«Û¸¨Ý¹«ãÄ°çƭ⸡ڵ¢Ü¹¦Ü·ªÛ»²âöæɹçƶäÄ´ãÄ·âĶàÁµàÁ³ÞÀ´Þ¾®ß½²àÀ·àÀ¶ãŸáÆ»äŹäµâĹ޼¬Ýº­àöæ̽èËÀêÌÀî×ÊïÙÉòÝÁÛŲ\AL@V@Y<]?^>`Ad#EdD]@Y;Z8`>d>a?dIk$Pq$P1\–Imºf{Ñ{}Ö~~Òx{ÌwzÎy|Ï„‚Ò‰„ÖŒ}ØŒ~؍~׊‚ÖŠÖŠÖŠ‚Ò‡‚Ó†~Óˆ€Ó†|ÔŠ|Ò†zцyÔ†xÒ†|Ò…{̆}ÒˆzÒ†}­FUªAM«BP­BN¬DPª:L«@M­BN­DP²AI³DK³BL·HMÅQRÐ^TÛl^äyaæ…gêŽlì’rî–mî•xî›vð˜rñ˜mî—rî’rìˆiä{gÜkZËRO·IOŸ5G“,B+@—0B4D¦8Fª=L«:H®=J¬<L®@M¬GQ­CR±@M®>J¬BL®@L­AM¯CM±@I²@L´DM¹IO¶DN¶BH²AL«8N¸FRöÍ©üǏó®xêŸ|ãx_ÞzcÏ\WÌ]XÀLUÅVR·KT´DPµFV°CR»JVÀKP¾JRÂPVÍRQÆOTÈX_ÇbdÉV_Ì]dÊ``¾P_²F[ÂhrÔuw×|wÔwwÔsqÒnnÒpnÔxvÒ|rÂad½_jÌpsÕxtÓuvÔ|Ô€ƒÓyÖ”ŒÎ|{Õ}yÖ…‚֍ŠÙ’×˜Ø‘Úž‘Ü¥˜Øž“Ôƒ‚Ò€ÖŽ‹à›‰Üª›Ü ”Ø“‹Üœ“Ûž“Ú˜–Ú—‹Û¤–Úœ”Ü –Ø›‘Ö˜’×”Ú—Û¨Ü¦¤Ý¨›Ø¤ŸØ¥žÚ¨Ü©žÜª—Ü«œÜ­žÖ¤œÖ¦ŸÚ±©Ù²ªÚ¸²Ô¯©Ú²¥Ø¶¬Ù³¬Ø²®ÜªžÚ«œØ¨¦×›”Ô¤Ö«¤Ö¯«Õ°«Ô¤™Ò®ªÓªŸÔ­¥Î¤žÊš™ÈœšÎªªÒª¢×µ«à±俨߰’Þ­Þ½ªàºªÞ¸°áöåÊ»é̼æÈ·â³⽫àÀ¶à³ÞÁ¶ßÀ´à¿°ß¿±ß¾°à·à÷âƸáøâÅ·äƸຮ۱£Ü¸®áúæɽæÊ¿êξïÖËñØÂïظ›L>O=X>[<_@]:cAb>[>\;Y<`Ab=f=gDdFbEn%RŠ:c¬[vÊt}Ö~Ò}|ÐwzÌvzÑ~~Ò‡Õ‰€ØŽ×€ÕŒÖŠÕŠÖˆ~Ô†Óˆ€Ó†Ô‡}Ó‰€Ô†{ш€Ñ‡|Ò†€Ñ†~Ò†}Ò…{Ò‡{Ó…z°FW«AOª>N¬CPªDQ°AN¬>Hª@M¬>J¬=I¯@L³?G·ENÂQNÍ\VÙn`äxcæ‚hèŽsí”sî–mï™sî›sî–yï–rî™zï‘qê‰näydÜhZÎUR¶INŸ3E“'@’)C˜.Ež6F¢8H¥=LªAL°?I²@M°=J¯AK«@M°>K¯AL¯BN®@M­>I°@J´CL³BJ·EM¾IN´FN·BH®FR¨6NºLQøУþʼnô¨qñ¡nä|cÞqcØj^Ò`ZË\UÌVTÂNQ¼RX¸GR´HXºGR¸GV¼MU¼KV®>N¼QWÊTWÂTZÄ\cÈY\¼Va¶N[Ã`nÒqsÖvrÔz|ÕytÍlpËhlÒwwÔ‹„Ã_aÄhoÒuvÕÒzyÒzyÔ~|ÕŠˆÆsuÌpnÕ†}Òz~ØŒƒÙœÚžœÜš’ם“ԍ‰Ö†{Ö‡„Ô…ˆÚŸ™Ü¡”ڏˆÝ˜„ÜœŽÜ–ŽÜ™ŽÞœÜ¦˜Ú›”ڐ†Ü¢—Ûž˜Úœ‘ØŸ—Ö–’Øœ™Ú”Ú¢—Õ œÙŸ˜Þ®¡Û°¨Ùª¢Ø£Ø¦šÖ¨¤×ž™×¦œÙ®¦Ø®¦Û¸°Õ´°Ô®¨Ú°¤Ø²¬Ø© Øª¤Õ¡£×œ’Ô  Ôœ™Õ¨£Ö­©Ö­©Ô©¨Ð¡•Ï ¢Ñ¢™É–—ʐÇ™›Ô±¥ßòäêݬ–×¥˜Ó¦žÛº¬à¼°Ý¼²âŹæʼè̸æǸäIJ۸¬Ü¼²àÀµÞ¿µàÀ±ßÁ¶ß»°Þ¾´à¿³âø߸âÅ»ãĹåƸäÀ±Ù¨ž× “ܲ¥ß¾²äƼçȽêʽîÑÄîÔÀéÕº–^fKCR;Z=[<]=^Db>dD\BX=Y=]<c<hAfB]<Z?u)TžMj¿o}Ó|Ö}{Ðy|ÐuxÌy|Ò€~ÕŠ‚Ö‹ƒ×ŽÖŒ}ÔŠ€Ö‹€Õ‰|׋‚֌Ԇ€Õ‡ÔŠ‚Óˆ‚ÕŠ€Ô‡|Ò‡ÔŠ}Ò†}Ó…~Ò‰~ÔŠzÔ†{§AQª=Kª@NªDPªDQ¬CP«?M©AL¬@M¯AJ­?J¬=H²CLÀMLÐ\RÛn\âwaå…eêŒnëpî˜qî•rî˜uî”rð—wï–vî’oê‰räv`ÝjZÌ[U·JM 4H”,C“+C™.FŸ3F¦;G¨?Iª@K®<K°AL´>J¯BN­?L°BJ²BN®@K­?L°CK°?J³@K²FN¶DN³CM´HN´DJ®BM¨7N¿TXùÔ­û¿…ô¬wéštÞs\Þzc×h_ÖjbÈQSÌjbÆTSÂMN¶CN¼HP¶CP½P[¸FR°HZ¶J\ÁSXÃYdÀT\ÄPTºP`´L`Âck×rxÓjlÖwyÕzuÎlqÒnpÌvwÑ€w¾Y^ºZfÐprÙ|tÖ|yØyvÔ‚~Ô†€ÒztÊgkÐprÒprÔ‡‚ՍØÜ¥ Ù™˜Ø”ˆÖ‹†ÎptÖŠ†Ý¤—Þ —Þ ”ÜšŠÕŠÛŒ{ÞŸ‘Üœ”ÜšÞ¢•Ý§šÙ›–Û–’Ü ‘Úž•×›˜Ø™’׏„טŽÚ—•Ü›ŽÙ§žÝ¦šÛ¦˜Û£™ÚžÖ¨¡Ü¬¢Ùª¦×Ÿ›Ú¨–Ø®¨Ùµ­Ú¶­×²¬×¨¢Ù¢™Ù¦¢Ø©¤Ö®ªÓ¢£Ô›”Ó£ Ö˜•Ö«£Õ©¦Õ¨£Ï–Ì ŸÉŠ…Å‘”Í¢ Ý¿³ä®޳œÕž’Õ£˜Þ¹®Þº®à¾²àĹãǸçǶåƸãƶã²ܺ±Ü¼³ÞÀ´àÀ¶àÁ´Þ¿´ß¿´à¾´ßÀ³á÷àúáƼä÷åƶäƹץ˜Ò–ŒÒ•ŽÛ¥”Úµ«æƺäĶæƸîÑÁíѺáÉ´o,HQ@T<X:Z:\<`Ba>c$L_&LV;`>a;eDhDcDY@ZA„3\®cyÏ|~ÔƒÑz|Ìv|Ïz|Ѓ‚ÑŠ‚ÖŒ€×Š|ÖŒƒ×~Ö‰€×‹ƒÖŒ×‹~ÖŒ€ÕŠ‚Ô‡}Óˆ‚ÔŠ~Ô‹xÓ‰Ô‰|Ó‰|Ôˆ}Ò†}ÔŠzÕŒ{Ô†z¬<J¬DQªFT«?M«=Jª@M®?N¬@M¬@L­DP©?Lª@L³DLÄQPÏ\TÜn[âw_è…gìjî’nì—rî–uí™rí–uî–ví˜{ì‘tê‡kåzaÜl^ËXW´JS 7J˜,D’.G˜4J <O£:H¦=K¨:I®=J°CM²BL±DN±@J¬>G°BN°CJ®>I°DJ²>H°?L´FO¶DJ³GNµIO´DN¯@I¨7PÅ\Tù׫ü€ô¨zí•jâ•zÜoØpeÝr`ÓaX×]VÑZS»HN»HQ´JV¶DO³ET¶IYÂRXºGVÀ[bË\Y¹GR«AWµHXÈlsÔxuÖhjÔtpÖurÑkjÓsuÑrpЀr²T_»\hÐnlÖyvÔtrÓzvՁ€Õ|ЄÏopÍktÒxzÔ~ƒÑxyØŒzц‹Õ‡~Ùœ”Ò‚€Ñ}‚ÔŠŒÛ™’ßšÝ¡Úœ”Û”ˆÛ”ŠÕÝ‚ÝžÚž˜Üœ’Þœß¢“Ú˜”ØŒˆÖ‚€Ö”ˆÙ£–Ö•ÖˆÜ–‰Û ”ÚœŽÜ ”ҐÖœ×¥ Ù¢˜ÜªžÚ¯¨Ø­¤ÚŸ–Ú« Ú±¬Ø¯¦×«¡×¥ ØŸš× žØ¦¢Ø¤¡Ù­¨×§¤Ö˜ŽÔ¡¢Õ˜ŒÔ¦žÔŸ˜ÌŽÆŽÇ––Û»°æĮṞ֪—׫žÙ¶ªÜ³«ßº±àÁ´æƶæƵäöä±ã±àÀ®Þ½±Ý¼±Þ¾±ÞÀ¶ÞÀ¶ß¿´ß½³ßÀµàÀ·à´ãĸáźâĹäƹãŶܰžÔ”ÑŠ‚ÓŒˆØ›ŽÝ¸©à¶¢Þ°Ÿä¼®íʼêήƕŒT<P>U@Z@]>`@_?^;]AZ?\>_;`9_=`C_H_Hn!LœJjÀn}Ô€Õ~}Ïy|Îv|΁҈„ÔŒ„ÖŒ~֏‚֏€Ù€Ö‹‚Öˆ׊‚ÔŒ…Ô‹Õ†yÔˆ|Ô‡|Ó‰|Ôˆ~Óˆ{Ò‡|Õ‡{ÓŒ{Òˆ{Óˆ}Ô†}Ô†z¬@L¨AJ¨AJ¨BQª>NªANª>L¬@M¬=I¯@K¬>I¬?H´GPÄNOÐ`XÞo`ãzbæ…nëlî–oì—uí–ví˜zí˜xì“tì–vî‘xê‡iä|jÞjZÎXW°FP 2H”.F”*E˜3IŸ9H¥>N«?L¨?L®@L°?M¬HS®BN¯BO­@L²?K°BJ®@J®AN±>H°CN¯BL´DM³AJµEK¶BI±AM£5Q½VTùÔ®ù¶~ô¦uî™lî‰géŠhàwaàr^ÞmXØj]ÌZ[ÁQTÆPO»IP¨2F¬BS¼MSµDP¿UZÇXYÄRXµHT°FXÆdjÕtsÔspÒmnÒfdÎnvÑmnÔ€tÆrr²P^»XfÐrpÕvuÙ{xÖz|ÑzwÓ‚|ÏvxÕ|{ÒryÒ|×…‡ÔŠ‚ÌrxÌnsÖ’ˆÎƒŠÑtpÎ}„Ú‘Œßž–Ýž’Û“ŽÙ‹ÚˆÚšŽÙ•ŒÛ”Ž×’‹ØŠ†Ü–ˆÚ –Ù–Ú‹€ØŽ‰×”ŽÖ‰ÓŠÚ€Ø˜ŽØœ•Ø˜ÕÒˆÐ“šÕ ™Ö™Øœ”ؤšØŸ™Û®£Ü®¦Úª¦Ö¡ž×§š×§Ÿ×¡šØ¢˜ÖžžÕ–“Ù§¤×¨¦Ö§¨Ø¥›Ò–šÔš‘ЉˆÐš–Ì’”È“’Ôªžä®æÀ¤Ú§Ù¬œÛ·¨Ý´¦Ýº¯à¸âĶä°å²âÀ²à¼®Þ¸¦Üº«Ý¹ªÜ½³Ý½°à¼°áÀ´ß¿µÞÀµÞ½²áõâ¸áÀ¶âŸãÆ»âȾä²âÀ±Õ›ŒÒ‹„͈ˆÐ‹‹Ö¤—Ø£–΀zØž–ḭêÄ®æϸ‹LWQ@T@]"J]C`A`@aB`A^@W=\8`<^9Z<^Cn&Vz0\Œ:_²cyÐy|Ó}ÒzxÏwzÏy|ЂƒÒˆ~Ö‹„׋ØŒ‚ØŒ‚ÕŠ׋|ØŠÔˆԏ†Ô‰}Ô‡~ÓŒ€Ñˆ}ÓŒ~ш~ÒŠ{Ôˆ|ӌҌӆ|Ó‡tÒ‰€Õ†x¬@JªBNª>JªES¥<K§@O¦BN©@J©@Jª>K¬?L±BL³BN¿NSÏa\Ýoaä€lç†hëlí•rë”uí“vì™pë•sí’vì•yìŽléˆkæz`Þk\Ì[V±GOœ6J’0F’.D˜.FŸ6H§>P¨>Oª>P®ER®DPª@Nª@N°BL°@L°@K®AL°@K¯@K°@L°EO°BJµBL´HP²@K²BL«?M¢7V¾`WúÔ¬úµpò®{ìfæ‰må€dÜ|jßpYØogÛdZØg]Ò\VÆNS±@NªBR¯<L¬:M»NTÃRV¾OW¿MV³GXÄjnÒjnÖnjÔnmÔnlÌdjÏjpÐwwÊzu¶R`¸VfÏjlÖpnÖyvÙxt×€{ÎwuËrrÍr{ÒttÕ„Ô…†ÎrrÌx}ÍzÑtÕ~zÕ~xÏvÚˆzÜ”à˜Þ›‘Ü•ŒØŽØ‰ÜŒ‡Û˜Ü”ŒÛ™’Ø–Ž×†„܏€Ùœ‹Ø•Ù‹ƒÛ”‰Ù‹Ø•‰Ò–‘ØŽ†ÕˆÑ‚‚Ì…ˆÓÙ––Øž–Øž“Ùœ–؝’Úš˜Ø˜Ú¯§Ù«¦Ô¥ Óž›ÕŸ˜Ö¢œÖž™Õœ™Ò–˜Ô”’×£ŸØ¬¢Ô žÏ™™Ê…~ʈÉ‹ŠÕ¢”ݺ¨ã½¢Ü¨ŽØª—Û²ŸÛ´¥Ü¹°Þ¾³âÇ·çÅ´ãÁ°á¾°á½¬Þ»ªÛµ¬Úµ«Ú´ªÛ¸°Ü»°Üº°àÀ´Þ¿³àÀµàÀ³Þ¿²à·âÀµâĹâùäȼãƸäǺؤ”Ћ„̓Ñ’ŽØ¤—ؤ’ÀjhÆz€Ùž—೤ææֵ¥^=TDR8\C_"J` D`?b<_:Z:Z;b9d>\;\Bb Oy.Zˆ8d¦XrÈt€Ö|{Ó|}ÐvzÌvyÍ€‚Òˆ…Ò‹„Ô‹€×Œ€ÔŒ€ÖŠ€Ö„}Ö‹×ŠƒÖ‹‚ÖŠÓ‰ÒŠ€Òˆ{Ò‰‚ÒˆÒˆÒŠÔ‰|Ò‰€ÒŒ|Ô‡|Ò†yÔˆ}Ôˆ¬@L¨@K§;J¦>H£>L¨:L¥<I¥@J§>L§>Iª?L°@N°BOÅQRÓbZÜrbä{cè†fëŽpì’rë”uê“wì”té”sì“rê”vìoì†jæzcÝl\ÎXR±HPŸ8H”)D/H˜.Fž5J¥<K¦;Lª@N«?L«DQ®BN°@K¬@L¯BN¬>J®BM®AJ¬>H­@I±AH´DH´AJ³EN³AI°@Iª>MŸ4PÆl\úÌœõ±|ó¥lì–qëŽgç†héeÞobÛj\ØpfÛm_ÍXU¾FN³FS®@M¥8N²HQ¼LS»HP·EO²@TÇmrÔtqÒmjÎioÓifÐegÏlnÐppÊqo´P\¸ZjÈjnÓllÔllÖxt×€}ÐtsÐsrËloÑtrԁÎvpË~Ìx~ÖŠˆÖ…‚Õ{yÍjpÔ}{Û–Ö‚‰Ùˆ€Ü‰Ú‰‰ÝŠ‡Ü˜‘Û–˜ÙŒŠÚ’†Ø–ŒÜ’‡Ø“ŠØ‹…Ö†‡Ø‚|ß ’Ø”’ÙŒ†Ý‘‚Ù—ÕƒÊ~‚Ï‹ˆÑ•”Ô“Ö™’Ö•‘Ø””ÛŸ”Üž×•”Ø—’Ô“”Ø¡–Û¬£Ø£œ×ž˜Ö“‘Ô™‘՝ÔžšÓ‘ÓšœÔ•–Õ££Òš˜ÅŽÅƒÎ”’Ù±¥åÀ«ÞªÖ¥–Ù­ŸÚª Þ²¨ÞÀ¶âȼæÄ´æòãÀ°äÀ­Ý¹­Ü¯¤Ú¸­Ýº­Ü¶ªÚµ¬Ýº°à»²Þ¾²àÁµàÁ¶áÁµßµàÀ¸âøâÀ¶ãȾäȽäǺäǵ⽭̇ˈˆÑŽ‰Ø£”Ø¥ÀkjÀnqÓ‹ŒÛ œß´¦èÑ´©v}P<P<U:X:]@d(K`$C^<[9X7^=h>c<\>_Fl#R~1\žIj¼o}Óz|Ô{Ôz{ÎvzËz}Є€×‰‚ÔŒƒÕŽÕŒ„ҏ€ÐŽ‚Ö‡~ÔŒ€Õ‡}ÓˆÒŠ|ÔŠ~ҌՋ҆~ІÔˆzÒ‡yÒˆ}ӍÒ‹}ÔŠyІ{ÏŠ~Ò‡~«<G¬JT§=J¨@N¦>J¨BK©@L¨=J©>I©>L©@J­?L´DPÃSXÓ`[ßn^æ|dè†ièŽlërì–vë–rë–yë–tì–ví•xì’qêˆmæ|dßr`ÎYT¶FN 6H”*D“,F™0H¡8L¥>M¨=L¨BO©BP®BQ­AN¯@K­BN«;G¬>L®AJ¬@M®AN¯AJ°BJ±FQ°@I°AK¬@Jª?H¥8Kž2NÎziúΞú®jð xîškçŠoæ‚_Ýrfæ{^Ùm`ÜfYÖpfÑ[R¼JO¸GT­CT¶JU½JPºLWºET®EYÆdlÖrqÑpqÔkjÏjiÊY`ÍinÏtuÁaa±ZhºXeÆ`iÓqqÔwuÑqrÒrpÓtoÎrtÐnqÔvqÉryÈqjÂgrÐ|xØ„…ׂ~ց‚ÎosÏ{ƒÔzzÜŠÙ‘ŠÒ‡ŒÓ{ׂz؇ŒÜŒƒÝ£”Û’Ø†ƒÙŠ„؆€ØŠ‚Ù‘†ÚŠÖŽ‹Û†€Ý˜†Ù–Òvq́ы‡Ò›–Ӎ‹ÖŠˆÖ”Ž×ŒƒÛ–ŽÖ—Ú”ŒÚœšÚ”ŒÙŒŠØš”Ø”Û˜×›•Õ–˜ÖœšÓ’•Ø˜ÔœžÎ’Ò”ËŒ‘ΐˆÎÈ”بžã¼¦â±‘ÚšˆÕžÜ¯™Ü°¢Þ¾²áÁ²æȸæŲå¯ßÀ¯Üº¬Ü¶ªÙ¹«Ü¸¬Üº¬Û¸¬Ü·«Üº®Ý¼±à¾´ßÀ´â³ßµ߿¶à¸àĸßøÞļâȼæÉ»æ˺äɸ՘‰Ë†ƒÒ’ŒÚ¢–× ŽÂpnÀw}ʆˆØ™”ÜŸšã¶¤æÒ¼‚BTN<R<X;[<]AaA^A\=W<[<`@e@`<\AcLv.ZŠ7a¯_wË{~Ö„ÔyyÍvyÎx{Í€|Ó‰‚ÔŠÒ‹€ÖŽƒÔŠƒÕ‹†ÕŽ€Ôˆ~Óˆ€ÒˆÒ‰„ÒŠ€Ó‹Ћ„Ó‹}Ò‰}Òˆ~ш~Òˆ|Ñ…}ÒŠ~ÔˆxÒ†€Ðˆ€ÐŠ{Ô‰|¨>Kª@M¨?L¦=J¥>L¨>L¨>K§<I¦<J©>L®<Hª@Q³DPÆPRÒd\ân\æ|fç†jèlì”që–vì–tì“yí”rï”oî”tí”pêˆjäzcÞn`Ì]Y±GSŸ;P”-H“/I™2J¡7J¤:L¨=LªAN­@N¯>M®@K®@L®@K°<H°BN°@I®@M°BL³FN°DK²BK²@J°DK¬BK©<G¥8K¢1MÜ’súÄ‹óªzó©në™tëœmÜtjæˆdÚvoÜl\Î`\ÚpcÏ]YÊQUÂRW·MVµCR¸HQ¶BPºHWËilÔtvÔppÓnnÒhiÊfjÉehÌmkÂgj³O^ÃajÉcnÓtuÔsrÖpmÔ~}ÐkkÐjmÐppÐytÈhmÅimÉrvÒ~~ÑyzÓ~zÒpoÎhoÔ}~Ú‰…׏ŒØ€Úƒ~؆„Ó†ŠÔ€„Ú…~ÕŒŽÚŠÙ†Ï‚ˆÒ†”Õˆ‹ØŒÚŒ‡Ý’…ܘÙŽ„ҁxÍyzÄw€Ôƒ×œ˜ÙŽ‚Ú’‡Ø”Ø™Ö×‡„Û˜‘Ù”–Üœ‘Ù“’Ø““؍ˆÖ•‘Ö‹ÔˆˆÖ‘ŒÖœ˜Ó—˜Ò‹Ô•ŽÒ“‘Ê€„ÉŠŽÇ‚ˆÔ”Žá´¢ä¶ŸÞ¤‹Ø ŽÜ©“Þ­Ÿà¹©äÀ­åÄ°çª㿪ཨ๤۸ªÜ·¬Ú´¨Ú¹°Ü¸®Þº®Ü»°ß»­ß½¯ß¿µàÀ´à¸á¹áÁ¶à·âÄ·á·âÄ»âǼäÊÀçʼæʺඤ̆ƒÌ†…Ôž–ØžŽÇwrÇ‚ԏŒÕ–‘ÒŠŠÜ£œçֹ̳§V@P@T?Z@\<^?_@^=^&MU<[<aAcB]@^Gj#Sy+Z NoÀo~Ò‚„Õ~}ÐxzÌx}ÑyzЂÓ‡ƒÕ‰Ö~׌|ÔŒ‚Ô‰~Ôˆ~Óˆ}Ò†zÓ†{Ó†~Òˆ€Ó‹{Ó‰€Ò‡|Òˆ~Òˆ{Ї{ÒŒ|Ò‰{Ó‰|Ї|Óˆ}ІyÒ‡zÓ‡z¦BUªBM¨DS©=L¦8F©=J¨?J©@L¥<Mª>K«<I²BN¼JRÌUTÚaXánYä|dç‡kénì”pé”sê–ní“xì”tì˜rí’tí’uëˆnæzgÞqbÐ[V´JR¢4H’,CŽ.Fš1EŸ:K¤:L¨<Kª@O°AN«BL¬@O¬?M¬AM²@L¬AL­@J­<H«?L¬@G±@K¯@G°<I°BL®BL«:F¥5Fž/Lâž…ø¾…ø¶zñ¤{ô¯pëoéjÞv`éˆfÜtbßq\Ûj^Ûj\ÍUUÐZT¼LS¶JR°?O®DWÈegÊ`jÕjiÑlqÎfhÌglÊjpÎtt¿X^°TfÀUfÆ^dÒtpÕtrÔssÖuvÖwvÎnlÑmoÍvrÀ`gÁbnÌkqÔzyÕ~xЁ„ÏpsÊgoÑ||Ù€؇€Ú„Ûˆ†Ô{~Ôx|ÚŒ‚Ø‘–Ñ~ƒÔ~ЁÎv‡ÀsÄƒ™Ôˆ‘ØŽ”Ø“ƒÜƒØˆÐ€Å~‰ÑŽ×Ž‡×Š†Û‘„Ö’Ö‡†ÛŒ„Ø“ŽÚ’ŽØŽØŠˆØ”Œ×Š‰×“ÙŽŽÖ”˜Ô†ˆÕŽˆÑŽ’Ò‹ÒŠÒ”ÐˆŠÐ‹ŒËŒŽÅ‹ÌÚ¬œâ¸¢à®‘ÙŸÚ¡ˆÛ¨—Þ·¬ãÀ­ã¼©ã¼¦á¸Ÿá·žß²™Ù¬™Ø¬žÚ¶¦Ü´¨Û¶¬Þ»®ß»­Þ¼®Þ»­Ý¼¯ßÁ³à´âøâ÷âĸá¸à·á÷âĺâǺäË¿åʽæ̺ãŶ΍ƒÈ……Ò–Ò˜ŽÇuyʇŠÔ—Ó‰~ÉvwÌ€†á´¥îÙ½¨tvLBO?V@XD^A^?_>]EU:^$KaBeBdB^E_Jk+X†8b³dtÏ}Ò€€Ò}|ÍuxÊvyЀщ„Ó‰‚ÔŒƒÕŒÕ‹€ÔˆÑŠ€Ò†~Ó„|Óˆ‚Ôˆ~Ôˆ|Ò‹„Ò‰}шÒ‡}Ò‹}Љ|ц}ÑŠyω|Ò†|ч|щ~χ}Ò‰Óˆx¨=K¦?J¨BR®BP­AN¬<J¨@N¨?M«@L¬@H³@M´@J¾GPÉTTÖbZàpaåzeæ…léŽpì“oì–uì—rì˜xë™xì˜pì˜tínëˆpæ|fÞshÐ]\¶NT¤:N“)B‘.C˜-C6J :K¥>L§>L©<M­BL­=L®=J¬@N¯9G®?J°@L²AJ®BN¬AN®?H°>I°BN±AM«>I©:D£2Gž0Iì°†ûÅŽö¸…ö¹yíœzð©|èpæ“pâ‚jä~_ÜdTáycÙo]Òf^ÅLN¼HP´<L©<NÈgf×mkÑhjÇXaÐjhÈfrËdjÍrrÂ_b´WeÀZfÄ]lÓtuÐlqÒllÓutÖzvÐhiÐuwÌipº[g½]lÌhqÓz}Ô€|ÐssÒ{uÈdmØyz׈ˆØˆ„ց„ځ|ׄ‰Ö|Ð~ÐwŠÓ‹šÎ‰¢ÅŒ«¼…œ²ž¨v–¨j†¬by¯gx«Uh¹^aˆˆÔŠŠ×Š„ÚŽŠÛˆØŒ„ؐØˆ„Ø‘ˆÖˆ‡Ô†…ۏ†Û–ŽØˆ×…Ö”“ÕŠˆ×’×ÔÒ„ŒÔ‘ŠÑ’—Í{Î‹ŽÊ„ŒÅˆÊ…ˆÖ¤™Þ³›ä¶ŸÛ˜†Ù “Þ²žÞ¬¤ß¸¤çñå¬ỨܴœÛ± Ø­žÔ­ŸÕ°£Ù±¨Üµ¨Þ¸¬ÝºªÜº­Þ»¬Þ½°à¾³ßÀ´à÷àĸãøâĹâøá¸ß¸áŹáÅ»ãɽæÊÀåÌ¿çк֪¡Æ‚‚Ñ–Ñ’†ÇzzÎŒ‡Íˆw¾ed²Ud¿mvٝ˜éÌ·åÒ½t0HJ<R@WAZA`FaB`D`"LZEc!Hi,PgDc@aH`Gt&X›JjÆqyÕ€~Ö~|Ñy~ÎwyÎ|yÓ…Òˆ~ÕŠ€×ˆ~Õ‰|Õˆ~Ó‰|Ó‡|Ôˆ}Ô†|ш{Ô…zÓ†|Óˆ~ÔŠ~Ô‰}Ó‡~Ò†{ш}чyÒˆzЊ{Ò‰~Òˆ}ÒŠÒˆ|Ó†|Ò…x¬>Kª@M¨@N¬BP¨AP©AM¦>P¨>J¯@J­BMµDL¸HRÄHNÏTTÚ`Xàm^åzcèˆiëŒrì”tì˜tì•vî–rì—vî“tì•pìmîˆlæ|fßqcÎa]°DKŸ5E‘*C'?–.Fœ4H ;L¤>O¨AQª<P«BO­BN«>M©>L¨<K«BO®BK®>J¬>J®CL°@I®@K¯>H°@H¬<H§:FŸ.Ež-J髏úÆ’ü¾‚ò«xõ½†î”kí›pèŠiæißq\Ü~kánVâmÞhVÍb\¾DK¬3JÂSVÏbhÖjiÐhkÈenÄ[fÉjuÌom½\e³VfÁcjÄZfÓutÕqmÑkjÐllÒqrÒjgÎnrÉgi¿[lÅipÇfsËjrÔ€{Ð|ƒÎrpÀ_kÐkr×yxÛ‚€Ù„Ú‡…ÓyÈs~³^~´d}¯i‡®h„¸rŠÅx‡Æ‚ŽÈ|ˆ°b~½zÃxz±v†•U|+VÍ~€ÚŽ‚׈„ÛŠ€ÚŒ…Ö†ƒÖ†Ò…‡Ó‹–ÛŠŒØŒÖˆ‰Ú‹ÖŽÔ„‚Ø…~Ò‰‹Ð„ŒÐ‹ŠÓ‹’ÔŒŒÏ„ˆÑŒÈ‚ŒÈyy˃ÌŠ‹Þ¬–羦ߠ‡ÙŒØžÛ­¥á¹§à¸­åº¢èÀ«á¼©Ü³ Ù²¤Ù³¤Ùµ¦Û²¢Úµ©Ü¸¬Ûº°Þ»°Ýº°Ü½­Þ¿²ß¾°àÀ´âÁ¶á¶âöâºâ¶ãĹáżàùãƹâƼæ˽æ˾æ̾åƸɈ„Ì“’Ћ€Æ€Æ|r³TS¢MXš>W°XfÅ{„ⶬîؼ̬žT?K<P:X@ZDaDcD^A\DZ>bBl)LcDbFcNj!Q…2\²`vÏ}Ö‚~ÑxxÐyzÍz|Ђ~Óˆ~Ó‹ØŒ~׊ÔŠ~Ôˆ€Õ‰~ÓˆÔ†{Ô†}Ò†|Ð…~ш€Ôˆ~Ô…{ч~Ó†{Ò‡yшzÓ†uш}ЉzχzЈ~Ð…|φ~цzÎ…}¬DQª>N¬BO¨@N¨<J¬@KªEP©AM®AL±@M·HL¸FPÂHNÌSUØbXào\åzaç†lêŽnì–rí”sì—rí˜tì–xî”pí—nî’pîŒmå~gÞo^Ï[S´DL¢6H‘'A(C•0F™4J¢7K¡<M¨DR«BP©=L¬?K¯<Gª;J®<HªBM®>J®?L°AM±<J±=J°CL´@G¯BL®<H§8Eœ/Gš+KꬂúÌ™÷¹…÷ÀŠò¡wðª~êŠhè˜lè€\åjä‚[à|mèzVÝzkÕZQ¶ES¸HVÇ]dÌ`aÇ^hË`fÌbfÇ`hÌqrÄag­N_¾\gÄ\fÏopØvrÔstÑkjÒnsÐloÑspÆfg¶VgÊdkËjmÍsyÌntÑmoÎwrÈ\jÓ{ÔzÖvyØ{yÓw}¿dvžDfŸP{¤\§Wv Ji—Eh”Ab¡Nm»gvÈm|¨QsÈ|…Ëx…ЄŠ·wƒ”Nzª^lËyÎÕŠŠÚŠ†Ø‡ÖŒ‹½u€²uŠÂzÍz€Î~„ØŽÖˆŽØŒÌyŒ¶i§ZxŒ7XÅ‚Ð†Ì‡’Æv{Ɓ‹Är}Ò–à´¢ä°–Ý ŠÖ—ŠÚ©¢Þ¶®á¹¬ä½­æ¾ªäº§ã¼©Ý¶¦Û±£Ú´¤Ú¸§Û·¬Ú·«Ú¸ªÛº°Ü¼±Ü¿µà¾³ÞÀ±à´߾³à³â·á¸âƸâĺàÄ·ãŸâÄ·âùäǺäȽçÍÀèÏÁæʺנ–ΐŒÎˆ€È‚v²ZW”:G”1IAT¢H^Áv†Ö¢£ìϾíÚ»—_bM
-8J
-6Q
-7Y;\?_<\@\<\?]@f@lB_@`I`Mr&TšLjÂny×|×|ÐvyÌv~Ï}ЄÓ‰‚ÔŒÖ‰€Ø‹Ö‰|ÖŠ~Õ‰|Ò†|Ò†zш|Ò‡|Ô…|ц}Ôˆ|Ò†|ц|ц}Ò‡{Є}ч~Ð…yÑŠ}Ј€Ð‰|Є}Ð…zÐ…uÍ…{¨BQªDR®?L¬CR¨>N«BP¨AS«AN¯BP¯BP¸CL½DNÃHPÊSV×d[àq^å{_è…fìoì”së”sì˜rì—sì–sî˜tî˜nï‘sîŒnäƒpßpaÓ]T¶HL6D‘+@Œ$?–+@œ9K£8L¥=JªBN®AL­?L«BP¬AK­DN±?I¬>J°DJ®@K°?K±<H¯CN²AG±>J°:Dª>J©<F0Dœ,I檈øɝüÆŒøªyö”ïšlæ˜tè‡`äŽnæ~WÞvhèƒ^à{dê{XÐ_`ÆPUÊZ_ÄU^Ç[aÉ^bÅ^iÊ]dÊns¼]`¬N]¼XdÀ\hÏjlÔptÒklÓpqÐhkÐehÐtr¾Z^¼XcÊhnÆamÊksÍrrÐ~‚ÇclÃ`lÐsvÕz~×€ƒÖ~…Ðq|·To”Cmª\{Ä~ŽÆn~ÅizºXp±[r§PnœKnˆ6^“>d–Oză”Ù’“ۏÔŒ¼wŒ›_”T‰’S…ŸZ~©Wx¶`sшÚˆÓ†ŒÇŽ˜°z’žV~»pˆ¹kˆÆxŠ¸Œ±—^¢pw5pf O°mÊ†’ÂvŠÌxØ¤–㳚঎؏€Ø–‰Û¦žâ¶¡æÆ´æ²æÀªâ¸¥à¶¢àº¨Ü¹ªÜ¹ªÚ¶¬Û¸¨Ú·©Ù¹«Ú»±Üº¬Ü½µàÁµàÀµßÁ¶áÀ´à·áÁ·âøãĹâŸâ¶áĺâĸâĺãÄ·åȺæÊÁèοêоܮÒ•‰Ì‡|¸h`œ;H‹3J–<Mœ<O¨L^¹anÖ›šçÆ»ñÖ¸Ùº¢f:M:P8T9[:a@^<]?Y?\;c>f>h D_G^Kh N€3\®_vÉz‚Ó}|Ô}zÎx|ÐwyÑ‚~Ó‹„ҍ‚Óˆ}Ô‰ÕŠ€Òˆ~ÕŒ|Ô‡|Ò‡Ôˆш‚ш€Ñ‡€Ñ†~ш~ц|Ї}Ñ„zЈ|цzшzЇ~Ï…yΆ}І}Є|Í‚zΈ|΃zªDN¨BP«>MªDQ©DQ©@O¨?M¬BM±BP­>N¶AJ»CHÆJPÑTQÜdXäpZæ{bé†kìlí–vë–uï–qîpí—vî–ní—vï’pí‹lè€fáp^Ó\R¶HNŸ4D'>,E•0D˜0Dž8H¢<J©>LªAQ©@O¬=M±@L®AN±>K°AK³BK±=KµBP²@J²@L¶@F²=H´>F«<F¨4?ž-C+Iå{ùÒ¢ö¶ˆøÃŽöªzòµ…ðžfç›uéƒ^Ûvdä}XÚpfè…bàp[ÜhYÊTWÀQYÂ\aÂT\¿P\Æ\fÈflÃ`d¬M`¶]h¼XdÎmr×rlÒniÒjhÎefÎnpËfj¼[b¸XdÄbjÊdiÈhnËjqÍnrÎmkÁ`lÎnrÔutÑzÓw~Ó{~Áh€«Rvºn‰Èo|Ín~¾]s¶Yu°Tq¢Ll›Ff—Df‹?ks&\N|À‰¤Ö” ÙŒ˜Ø–»l’¤hš¦lš f™œiš™e™†J8^–Jh®a{°b·p‰¡Vv“Lq‹Cjl$Nw6]h$WŠFd„FpQIw4VÅ…•Ìˆ‘Û¦ã®›×Ž€Ô‰€×’ŽÙ§ Ü¶«á± ä¼¦ã¾¬â¼«Þ¶¦Ý¸¬à¼¬Üº®Úº®Üº¬Úº­Ø¶ªÚ¹°Ü»°Ü½°ÞÀ´ßÀµàÀ´ßÀ¶áÁ´á´á³á´ãǼãÆ·ãÁµâøãÅ·âøäźçÇ»éοæÇ°Þ©Î‚Ànc©QRŽ2E“:M—?NžBS¤BVµ\kцŠâ¶¬îѸéÔ¹LOO:N
9X?\=_>\;`<]9Y9Y:c?iCbA[B\In%R˜LjÁp~Ó}~Ñ~|Ðx{Ív|Ì|Ó†‚Ô‹‚֏ÔŒ‚Õ‹Ôˆ€ÕŒ~Õ‰~ÔŒÔŠ|Ô†|Ñ…|Óˆч~Ј‚Ñ…|ц~І~Ј~Є{ЄxЃ|φ€Î…|Ï„{Ά}Ð…z̓xЈxρw®@N«DP®BMªBQ¨@N¨JV§@P¬CR®FS°GP¶FL¾HOÈOQÔYVÝf\âq^æ~fè…hìkí•tìšví–qî˜vî—tî—vî˜uï“tîŠféião[Ñ\V³HQž7J*E$?–,Cœ2F¡6H§=K¥>Mª<Jª?M¬>I¯FQ²FM°=M°?L®FS°>J²@J±AM±?I²?K¸?E²@F¬<G§9D /Cœ,Páš~÷ƘúÌšù°võ¾‘ù¯uòžhå‹nátOÑaVáw[Ül`ë”bÖbT¹KX»KVÀSZÁ^bÀT`ÄcfÂ_a§FX²RbÁXeÊhmÓplÔllÐhkÎjlÍlmÊfj¼V`¼[fÈflÌ`fÊflËjoÈfkÃflÅ^hÍltÒz}ÐjnÒtwÓz‚Áaw¬PrÂx‡Íz…Çlz¹\w›Fl›KnœMm‹<\0Sy(Ps&Qo"\Iz©¦Ìƒ–шš¼~§¢n¡¤r  \Š”R|V}@vr;tx=y†Wu9il.dn2`t0`n(Uq+W^NUHXLQAUDJH]"Q¾‡”㸪ܞ‘Ï‚{Õ‹‚Ô˜œÜ´¤ã¿¬ç¿¬ä¹¦ã¼­â¼ªÞ¶ªÛµ©Ý¹ªà½®Þ½­Û·©Ü¸ªÙ¸¬Ù·©Û¹®Ý½®ßº¯ßÀ´àÀ³ÞÀ·àÁ´áÀ³àÀ´âÀ²ãÅ·ãƹâĶäŹâŽãƽäĺåÈ»æư߯–ϐw¼po¬NQ˜;G“6G”7Hœ8Gœ<N¥FZ°TfÈ‚Šà®¥êƲêÓ·¾‚T:L
9T:X<_B_=]<^BX8[8`8c>h@^?TD^Hƒ<a­_rÏy|Ò€Îx~Ëv|Ëvwу‚ÖŠÔŽ„Ô‹‚ÔŠ€×ŽƒÕ‰~ÓŒ‚ÕŠ|ÖŒ€Ó‡~Ò‡~Ò…|Ò†Òˆ€Òˆ}Ò‡Ò…~І~Ñ„zІ}ЇzІzÌ…~Є|ЈxÏ…|·{Î…{Ð…zÒ‚v°BQ¬BNªET®FPªEQ©BN¨DNªAN®BP´FPÀFJÄFNËKNÔTOÝh\äsYè~dé†iì“lí˜qî–qí—qíšwí–xñ—tì˜uï’rìkæ~gâp`Õ^VµLN4FŽ.FŒ&A•.F™1E 7K¨?L¤>K«@M©?N«BN°BP°BL°?J®BO±FP°=H°=J²?L°?J³BJ¸<F³=G®?H±:C¦3Eœ*KÕy]øÕ¬û¹€ø¿‹÷°xô¼—ø³nî›qìˆXÔlVÛeSËSPâ€`ÝhRºNY´JU¹LX¾R[Å\`Æ\`À[_¦BU®Nb½YgÈfqÒqnÎhjÐhhÏfeÒkjÊmn¸ZgÂdnÊ`dÀhqÈdnÎllÌkpÄcm¾ZbÌjsÐptÕutÐnuÊlyÁ^q§Rp´i„Ên}Ìq~¯\|˜Ah Nu¨UqœBe–Bg¤Pq P{ˆ;t„C†Ž^–œb“²lŽ©l•¤x¤h–P~v0gh*bd$Xh'et8tŽd–€N~b Xp6kk+b^LZEYER?SGSGK>JH\"Všn‹Ö®£Ù–ŠÉ}€Ï’•Ø°±ß¼²ä¾­å½¨ã»ªâ¸¦á½­Þ¸§Þ¸¬ß¸©Þ¼©á¼ªÝ¹©ÜºªÚ´¦Ø¶ªÙ»°Üº­Þ»®ßÀ°ß¾²áÀ²àÀ²à´ྰྮ⽭åǺåƸäŹæƽæÆ»åǺãÁ¬Úª’Çvd®XTžDM—>L™@O˜9J™:G›9H¢@P BW±Xd̃‰Ý§è·¤î̳ßìv/BY$IR=X=[Aa?a@\@\?V@a@h@g@aAX@O@bJ–IfÀoxÏ~Íz}ËvwÊsxÐ|{Óˆ„ÔŒ…ÔŽ‚ÓŽ…ӍƒÓŒ‚Ô‹€ÔŠ~ÔŠÓŒÒ‹~ÔŠ‚ÑŠÐ‡‚цω‚ҁ|̃|Ï…Î†€Ï†~Ї~·}͆}Í„{Ì„|Î…{І|φ|Ò†zÒƒvª?P¬EP¬EQ®HQ­FP¬AO©DP©AP²DN³@KºHOÅIOÉJNÒVRÛf\àr^é~`êŠfì“pì“píšrï–rî•tï˜vî”tîšuî“qíŠlæ‚lârcÖ^R¹KQž0F&B‹)A”1Fš4Hž8N¢=N¥@P¦>L«CR¯AM¬>J®<J°BN°AP²BM²=J°BK³@L°@K´CMµAH²DK­>G­=E¥5Cž,IÀZNöΟúÉ–üµzô¾˜ü¾~ô³Œò¢jæ„eÛeVÊPLÑbTÒ^QÍc^¾UW¹T`»R]¸NZ¿U]Ädg«FR®Rc¹Q^Â_kÔjnÏhmÐhmÏfjÌhkÊfh¸U`Â^dÍdjÊflÎjqÂeoÊdkÉjqÆ`hÄdpÓnrÒrrÒlvÒntÆdt£Io±ZvËo|Ìn|´`€˜Rv®ZyÀhz²Qh¦Jx´fŠ¶j’¡^Žƒ8m|1i~Bt„D}‚>pšh—^…€9qv6kr4ke#Xh"`‡R†…X„k,Xi+bj,hm0dr5hWKRCN?K
-:RQONNQŒ`‘µ†ŒÛª“ÏŠ}¿xÐ—Þ¼µäðæıåÀªä»ªà»®Þµ¦Þº¦Ü¶¨Þ¶©ß·§Þ¹¨Ü¹¬ß»«Ý¹¨Ù¶§Ú¸ªÛ¹©Ü¼¯Üº¯Þ¾±ß¾²Þ¾²âÀ°à½´àÁ´ß¸©â¿±çÉ»åÄ·æǸçɼྤЕ{¯\VœEN™;J;I–<NCS˜<Lœ>Kž<M¢DR®Ta¸dqΉŠá©œæµ¢êÀ¥á¼ž“PTR;UBV:]@b@dC`=]B\DZ@^<hAf?\>SDQBr*S¨XnËwzÑ{xÍx{Èw~Ëx~ÒƒÔ‡Ö‘ˆÔ‹ÒŒ€ÔŽ„Ô‹~ÖŠƒÓŒƒÕŒ~ÔŒƒÒ‰ÒˆÓ‰~ÑŠ†Ï‰…χÐ†~Î…Í…€Ï…~΃~Ї~Ά{Ï…}ψ{І}Ï…|΂xÏ‚xÎ…xÑ„y¬CP®DN®ER¯HP°FN±BK¬BL¬=J®AM¶JR½HNÄFKÌLLÕWOÝcTàr`ç|`çŠnì•lì–rì”tí”tí—vî˜qð–pî—sî•sîŠlè€iãp^Ô`X¯GN 4F.D(B–2G›3F¡<J¦>L¥DQ­>J­?M«DK°BJ¯BJ®?I°DM²AL±@M­@K°BP¶?I²BK°<G±?L­<F­;E¨4Bž,F«9Kô˨ûÇøÅ“ü¾€÷·‹ýº{ð¦ví‘aÑ]WÌQR¿INÌqlÓk`ÄdlÄS[Ä[c¸S_»Z`°NX®MZ¾S_Æ[dÔlkÒkpÒhiÐgqÌhkÈdf¸Ze¼WaÆ\`ÉdnÎilÌjqËkqÄelÁXcÆ`kÒlmÒqtÏjoÑhoÉm{ªIl²a|ÂizÆewÀ[r¢Px¨Vy¿a¯V}¨W†œO€œXxƒ=h}7il"Vt*\u-\t+eƒFyXŒ†N†ŠTŽ~<y{2p€B‚ŠV‹y<ir2hyAxm.cb$Uk>fn1h\!MVDM>C9B
-:HD{Dlͤ›Ü ŠÈurÃv|Íš¤Ý¬œâ¼¬æ½¤â¾­áº«â»¬ßºªß¹¨Ý·©Üº©Ý¸¦Ý¶©ß»«à»©Ý¸¨Ý¹­Ú¸ªØ·©Ü¹«Ü¶«Üº¯ß¾¯Ýº°Ü¼±àÀ´à÷ãŵã°æƹéʺèÊ·äéƋr£MNšBO“9L˜9L™9J–7Jœ<L AOœ=M¤BR¥I^®XjÄ|Ù‹æ¦–캜꿠¸s`s):V9V;V9Z>bAb@c@_=^?[>_Dd=j?eCX@PBXEŒ?dºj|Ð}Ï|{ÍxzÉv|΀~Ó‰‚׎„Ø‘„ÖŽ€×Ž€Ó‹†ÔŒÔ…Ô‹ÔŒ‚Ô‹‚ÒŒΊÑŠ€Ñ‡ƒÑ‡~Έ„ψÑˆ‚Ј€Ï‡‚΄~Ѓ{Ї}І|χ~΄{Î…~Ï…|΄|΄{уz°BR­DS°FR°GR®FQ®DP¬?K«>I®@M·FP¼DNÄFLÈMPÔXTÜeYàp`å~gèˆgì“lì–tê˜sì–pî•qî™qð–rí–víoìŒnèƒgãoWÐ_ZµGN 3F)CŒ,B—0H›/Dª:G«<K¨=M«<H®@N°BM¬@M®BN¬=J°DP´BM°AN°>I¯DR´>J²@J²=H®>G®<Hª:B¤:E ,E¤/Gíµ€ùÌ¢üÁöÀ”ü¼ö½’ò¥ræ‚dÚn[ÆKWÈY`݉zÒlnÚ{fÆW`Ê^_ÀY[¬N`§DT·UeÀZdÎgfÏfjÔnmÐjpËlpÃfl¶Yc¿\iÈ^bÈbhÌdhÇhpÇhpÆdjÄ_dÆ^fÎjmÐmrÕjnÐjtÄ[l­Ji®[yÂhyÄhxÈfx´T|N|®fŽ¤_˜T‚Ksv-Zk%RgNf RePhSlTx2m‹NŒ†O†’r£„EyR†Hz–iš~;nZ‹ŠX„]Lg(d\Vo at mwDyNCJ;OJD
BMJŠ_|É¡™Ø–€º\d¾jvÓ¨¤á¼¨à°žà°šß°šÝµ¢Ü¸«à»­Ý¹¬Ü¶¦ß·¥Ý¶£Û²£Ýµ¤Û´¨Û¸¬Ý¸¦Ü¶ªÛ·¥Ø·¨Ø¹«Úº­Úº¯Ü»¯Ü¼±ÞÀ´â¾°â¸äÀ¯äÀ³æǶæƲܴ›³ji˜DT˜>NžBRš=N›>Oš9L—9I >M¥HW¬Vg±^o¿oyÒ†…àç°¤ë¾£èħ°tmZ7V>W<\<\>_BcAa>`=^<]AX8b>f=j AbEXDUJl&S¢SnÅt~Ó}xÐ|zÇu|Êy~Є„ÓŽ„׏ˆÖ‚ÕŽØŽ€ÓŽ‚Ò‡ƒÔ‹‚ÓŒ„ÔŒ‚Ò‹ƒÒŒ‚ÑŠ‚ÒŒ„҈ъ‡Î‡Òˆ‚ІƒÐ†€Ð…|Ï„}Ά}І~Ï„xÊ…~̆~Î…|Í„|χ€Ì…~Î…~³JT°IR°GQ³FN®HQ®BN¯>J­AK¯?L´DN¼FLÂHNÈJJÒWQÚdTás`äzbç†iètì•nî”rì”rì–rìšsï”tî—oî“rìŒlè‚gâp^ÖaX´FM¢6F1F,E–,Fš4E¢9J©=H§;K«=J¬>M°?I®@J®>J®BJ°@L¯DP°AL­;H°@H´BN±BI²;F¯<F¬<H°@H¦=Iœ6F™/MڐvúÉœøº‹û„ö¸‡üÆ~ñ§|ê…X×^XÔ`XÛwgØmjÖ|uÐ^^ÐspÄ^f²GV¬HXµM^¿T`ÍdhÐddÎlpÐhoÐhjÆfu¹P^¼]lÉ`mÆZ^ÊgnÍenÆhnÄgqÅ_hÅZfÒnrÓkmÐjlÓluÊap§Ffª\€»dzÃfyÌjwÄa~¦P|’KzˆHtu1^s.`~3ly0hv.`lQdLh"TjSt,dŒT’ˆJ{•pŸ‚Bs|>uj"T:lˆAv†O†’Xx0ev<{v=xXRlAer at tF>C
-<@@d,fn„Ö®—Ô†v´[fµfuÔ¢žâ¹ å¹œß®˜Ûª›Ù¬ Ø­ Ú¶¬Ý¸¨ÜµªÛ³¥Üµ¤Þ·¦Ù«œ×±¤Û·¨Ü¶§Ù´¨Û¶¨Ø³¨Ù»«Ú¸«Úº°Ü¼¶Û»°Ü»°ß¾±Ü¿¶Þ¿²à½²áÀ¯Ô«–º€x®p€§cxž@V >L¤APœ:L˜<Lš<M ATªMb¹hsÊvwÙ‡Þ‰|㙇訔鴖è¨͝‡g<VA]>[<_>`>eEd?fA^:^<X:]<dFj Cj'F`(PXL\N„;a·duÍz|Ò|xÍ|zÇtxЁ|ҍ„Õ”†×’†Õ’†Ó„֏Ô†ÔŒ~ÔŽ„ÑŒ…ÒŒ‚Ӎ€ÏŒÑŠÑ‹€ÏˆÐ‰€ÎŠ…Љ‚͇ÏŠ€Ñˆ}Έ‚щ|ц{φy͇~ψ€Î†}Ά̓~͆‚Í€x²HX²IVµKX³DP¯GW®<K¯BN°BN²BJ²AR¸BJ¼FPÃIMÒYUÜbUàr^æzcç†nêrë”uê™vê—té–rì”rì˜pë•sî“pìŒnè‚gãr]Ô]T¶HN 8JŒ*DŒ(B“-D™4H¢<N¤<Nª>K«=I©AL©?J¬BJ¯>I­@K±DP°BM®BL®AJ­@L®DL°?N²<I²@H®AL°BH¨<G¤4Dš'G¿_NøЬûĆõ¸ú»ö²…õ®rä†jâ~\Ö\SÌdkÖwuÚvgÔ€{Ðe_Â[g¦DU³PcºO_È_dÒjnÏfgÍbfÍloÆbf¾YbºZfÆ`iÈ]fÆ^hÊckÌjnÅdk¿ZgÃUaÎnsÑuxÍhnÎkmÐbjÅ`t™7`¾i€Èj|Éhx¾TnžDo†7lp(^n&Zz3l…F}~;qq0^e MaHbJcNm Z‹L‚™b–X‹‰R€s2b]D`Sj(X‡Tt5h|6jIƒx=m^"RM
EiDnb)ZB?<<YN©yˆÙ¡Ð~m·^n½v‚ר ã°–䶠߬“Ù¤”צ›Ö©ŸØ±¤ÛµªÛ³§Û³¢Ýµ§Ý´ŸÚ®ŸÚ²¡Û³¢Û²£Ü´©Ü´¨Ûµ§Ú¸«Ú·¬Ú¸¬Ù¹­Úº²Ý¼°Ý¼²à½²âÁ¶à¯ذ˜µ|u˜NhRm«vŠ®k|¬Vg¤BP¨BS¡>T£J^´ao¾ksЂ|܉|ß‹zå”旁柎ꬔçÀ¤Ã“|m#>T
<Z?^?^?`=fCeCiAb?^;[;Y=]8f?j"GbD`(T\%Tk(TŸRnÈt|Ò}{Ð}{Èz|Éx}Ò…€Õ„Ö“†Ø‚ԐƒÔŽ„֍ƒÔ†ÔŽƒÔ‹‚ÔŽ‚ÕŒ€ÒŒ€Ñ|ӌЌ„ÎŒˆÐŒ‡Ð‹„Ή‚Ά€Î‡‚Òˆ~Ï…|Ï…|Ð…~Έ}̆χ{ІzΆ~́{Ì‚zÎ|±LZ´FPµJV°HU¯EP²FP³GS±BQ±BL±BN¸BI¼ELÆLNÒVQØf]àtaå|cç…dêŽpê”sê”mê”uì“së”oî”sì•qî’píŠlèeãs\ÕbX¸LSœ8IŽ,DŽ+F•0Cš2H 6D§:G¦<K§=J¨=L®?L¯?L®@M­<J®AK­@K°BK«@J¯CO®@K±FM¶>F¶BK®BK°BI¬>G¢:E›-E¨8Kñ‘ùƘú½€ó¯ˆø½ƒñ¬|ò¤mß}cÊmjÇ\ZÚ€uÓheÞyeÂhn¯HY®EVÀVbÆ_kÍnrÐfhÑhnÎjkÉen°O`´WhÄ\hÇboÄ^hÌ]eÉ`fÇfnÃ`h¼ZiÍ_hÒjqÐgjÒkmÒjlÏirÆhz>dÀh€Èfv©Mo‹>lv,`fRg!XŠJ‚‰Lzl'SdL_LbL\DfQ]L„;užj›œ]ˆ’Z~v2`]FX
F`N‡[Fyl,eI|€LzXFJEHB|WŒqAƒHHg/Y®~†Üž‡Érl¼foɆŒÝ³®â·¢ãµžÞ¯œØ©›Ö¦ŸØ©œÙ±¥Ù±¦Ú±¡Ú°¢Ù²¢Ù±¢Ú±ŸÙ¯žÚ®šÙ¯ Ø³¢Ü´©Û¸©Ú²£Û¶©Ø¶¬Üº¬Üº®Üº¬à¾°ßÀ³Þ½¬Þº¢¿ŠzŽFX‚B_”Xv˜Vv«uŠ²xŠ»ly´`o¾hoÉmjÒzà‹zâtæ‘wå“vá|æz蛄馒ìÀ¤Æ‘~g6T>X<^<^=_<fCdAc@h@d?\C[<W8`7j@l!Bg!HZH^I€3Z²duÎx{Ï|xÎ{|ÊsuÏzxԍ€×“„Ö‘€Ö“‚֏‚Ó“…ד€Ô’…֐ƒÔŽ…Ӑ„ҏˆÓ€ÒŒ‚ÑŒƒÐŠ‚·‚ÓŠƒÐŒÍ†‚φ€Í†ƒÑˆ|̇€Ìˆ€Î†~͈€Ï‰~Ј€Î‡‚Ά}̃΂{Ê‚|¶LX²GS±FU¯DQ°JU°DT²ER¯@L±BM°AM·CKÀAIÉKNÐTP×b\Þq`ä}hæ„lëŽqì’ré–së–qê”tì˜pì’sî•pî”rìŒrçhâr`Ô`X¶JP8I*C)D‘.F™2H 4H¦<J¨<I¨@P¬?M­<K²AL®CM°BM±@K­BL¯AM®AK¬BN®>I¬<H®=J²@H²BL³DL¬BJ¥;H/Eœ,JސlùÌ¡ö»Žûº}ò®‚ú¼ƒî vçœxà„iÌqp×i[Ú€sÍ\XÄ\^³LUºPbÆTaÔhkÒihÐilÐceÂ`j¸LY´L]Â]iÄ_jÉcgÉcmÊfj½ZhÅ]e¼Yd²UoÈnÈiuÊdrÑelÔhoÕr~Ên|§Fi»`v®Sl{0Zj$WdTw2i‹M|v6_^FXEZDdN`F\D`N\L‘Wˆ–W‡›Pt{2]^HdPbR‰W‘\Šo*`y;tz at q]IJ>RNI?€[f3g|<k½‡Ú–€Élh¶_jÌŠß²¨ä¼«á¶¡Þ®™Ø°£×¨šÔ¦ Õª Ø° Ø¬¡Ø¬›Ø«Ô©›Ø± Ú¬›ÙªŸÚ°£Ú±¢Ú°£Þ´£Ý´¢Ûµ¥Ü¶¦Ú¸®Ü¹¬Ý½³Þ¾´ãÀ®Ü¾¦ÀŽv‚>H|<\‰Hk†=`•Uq”Nk¦j†´xÐ€„ÝŠ€åˆuæŠrèxæŽwæxå|蕂Ⓜ蚋쪔îĤԣŒj!<P;W;[;`>cAf Cj Db?dAe>_:aA]=a>d;j?a9W<VFdL—PmÀpzÑ|zÌzxÉ{€ÉsxÑ€|Õ’Ù’„ՐƒÖ’†Ö”ƒ×”Ö”†Õ’€ÔŽ‚ՍƒÖŽ€ÓŒ„ӍˆÏ‚Ñ‹‚ÑŽ„ÑŠ€ÐŠ…ЉÐˆ‚ψ€Í…Ή~·‚Í…|χχ~ÌŠ|͇~Î…z͈˃z΂|ˁ{µLX°MX±IT°FS°FQ²HU²HT­AM°CP³EK¸BI¾FKÁKMÐTQØ`Xâp\æzdéˆgìŽjì˜tì–pë•së”sê–rì–vî–nï”níŒpébáp\×`V¸LPž8F)DŽ)D•/Fœ7I¢6J¦:N¦?N§=L©?M©=K®@L®BN®BL±DN°BJ®DP®BM®@J¯AL¬AK°=I°CL²BL²CN±CM§<H¢3Gœ.MÊq[÷Ò°úÀ€ö´ŠúÁ‰ô®~ú¼‡ê˜p߇|å™t×rhâŽsÇ^]«AL¶P_Ã`gËdkÑknÎfmÔljÈen°JV«F\ÀWdÉ[cÈ`hÅ_jÆ[kÇ`iÃ_l¼Vd¼Wb»ly´dpœMhB_ªF]ÉasÖpxÊjv¤Dd’Bbv*Uh0^g$Zx8h„Ami"Pb$R[IWAh#Ph"OU
:]FaPz;qšlšx.Z~4_dH\Gh X‰W‘”g“‡D|@{R‰TEO>i4vF	@QJ„XŒƒKoÆ‹†ÚsÂdf¼hqÌ’–Þ­–廤⼨ܮ™ÙªœÖ¦›Ö¤žÔ©¤Ö®¤Ø­¢×«šÕ¨šÒ§žÔªšÔ§šÖ¨š×­œÖ¬¢Ù¯¤Ú±¤Þ¶©Þ¸§Ü´§Þ¶¨Üº­Ý»°ß¼ªá¼¢Ì¤ŠŒIG‚<YaI};X l‡”Sx—Tp˜Rvaz²|Ó‡†à„æŠwåxçtç‘vçvå{阃衏ðÄ Ó£Šv(=R;V<V
8Z8b?b>d<jCdBdAfE`:^;]:^<e?g@^EVB^Os*T¬]qÎ{~ÑzxÌwzÉxzÎ{yÓŠ€×’Ø’„Õ”Ö’€Ô‚Ö”ƒÕ“„֐‚ԐÕ‚ÕŽ‚Ґ†Ó‚Њ€Ð‹‚ЊÐ‰Ó‹Ð‹‚ЊÐˆ‚ÍŠÏˆΆ€ÌˆÎ‰‚̇Í†̆€É„Î…~΄|Í„́z²JW´JR´IR²IR²FQ³FP®EQ®EP³DK³EL³AJ¼BIÁILÐVTÚbWáo_æybç†lênë–pê–tì–ví–xì–rï•qî”pî”pìˆlégâr_ÖbYºNR 8IŽ(@+F’-Fœ7L¢;L¢<M¤?O¨=Jª=Qª>J¯@K¯@L«?K¯BM¬@K¬>K¬=I¬>J®BM¬AL±@G¶CH³DL·EK°FP«@I§9Ež/I´FKîÁ’öÆŸüǍö²ùÄ‹ò¢tã‡p袄ærߌuØmUÄ^\¬ATÂZcÊ\cÎ`fÐinÐkmÎce¿Xb°Rbº_lÄ[dÊ^gÈafÀZh¸ZhÁblÂ\g¾U`ÎhoÕlpÖjlÍhp¸[sJl<c¦Eb¸VkšFeq(Tg%Xl-`{;ky0bm*[f"Xb ReLj%Su/^X<R;\Fp)`†IvˆH{cGiMdOcP€FˆP€y4m]–Š^Šf&ZMGnF|nC{:>b6lª|¢Ë™”Ïzm¼_f¼cnÑ””߸­à²¢äº¥ß¹©Ö® Ö¦œÑ¤ Ø¨œØªžÔª¢Ù¬œÖ©šÖªšÔ¦—Ô§™Ó¨›ÒžÓ¨ž×±¥×´¦Û´¦Ý²¢Û±¤Ü³¡Ý¸ªÝº¬Þ¹£Ù¸ ¶‚jf;fD‘Mfˆ?jy,R­wƒ¢k†˜Tp¡d™Rr±t‡Ì†’Ú‰†âˆ}è’{è”|ê“vê—|ꚁ漣ð¿œÙ©Šv)BR9V?Y;^=^<a?f>c?e?c?c?d?`<[7_>`=g>d@]E^IdKA`¸juÍy}ÌyyÊtxËvzÒ‚|֐„Ø’€×’…Ø•€Ö“„Ô‘€Ö”×•ƒÕ‘Ô‘ÕŽ‚ՐÓƒÔ‘ÓŽÓŽ‚ÎŒ„ÒŒƒÒŠÑ‰ƒÎ†„̈€Î‰€ÏŠω~Έ|ψ€Ìˆ‚Ά̆Ê„€Íˆ‚Í„{Í…|É‚´FP°JR³GS±IT°HU²DQ®DP¯BN´BO²AL°DMµFG¾FIÍOO×]Qân\æzcê‡hê’në•rëšqì’sí–zë“qî”uî–rî•uìŽsç‚nâr`Öe^¾KPž6H&BŠ$@’,F˜0HŸ:M¢8H¤;J¦>Lª?N¬;H¬=I­>Lª>L¯CL®CL­=L­>J¬>H¯@K¬>K°>K´EL¹EK¼FN¶DH±DN­>H¢9LŸ6NÎv[÷زùúÍ—õ´|ê âˆlì~å „äkÀ_]¨8H¶NYÏddÉdlÄ[fÌ`bÊfm½R_­CV»boÅ`kÄ]fÉbfÀVbºYf¼UfÅ[f¾WeÊckÑflÖnqÕlsÇjt¦Hf-N˜Fb‰6_x,X{:ft8kn+^y3i„?|p1el*^f S^Lm'VŠNƒ^CQ
-<R>bR~>vx;bx4b^DbGbJh$R‰N~t*b€Cy‡No1gP
Go>x‹xªQLEHiÆ“ŸÊ{s®ZeºftИšá¸¦ç½§ä¸¥á³¡Ý´¥Ø¯¢Ôª¢Ó¦™Ô© Ö©œÓ¥›Ö«žÔ©›Ñ¥•Ò¡–Ò£šÓ¤˜Ñ¦œÐ¤˜Ö¯¡Ø´©Ø´«Ü¹­Ú¶§ß³¢à¶¥Ü¶Ÿ×©’´fY€.ElEf?FbžWn8a’Ld­}“š[x£m‚ž\{¦gz¾‚’Ð{àˆ{è“yê“xì˜yìž„í¢ˆò²”ê½–»rXo&:U6S5X7]:a:a=f?d@d@hDf Dc Ba?_@\=`8b=e;b?Z@_Jp(QŸPl¼pzÊwxÉx|ÆpvÌyzÖˆ}Ø”Ø”×•ƒÕ‘€×—‚֐‚Ö‘‚ב€Ö“…Õ’„ՐƒÓÔ‚ҐƒÑƒÔŠÑŒÐ‰ƒÑŠÐ‹ÎŠÍ‰†ÒŠƒÏŠ€Ð‰~ІÌŠƒÎˆ~Έ€Ì‡|Ë„‚͈ˁ}Ì„{Ë‚~»NZ¶KT³KU³KZ³IU³HR®IT®BN±AL®AL­EN´AI¼DJÌPQÕ]VÞm[æzbéŠmëpí–që”vì’wí•sì˜uï•xî˜mî”uìˆhè‚jäp_ÚbY¿MNž4FŒ(CŠ&C‘/H›5H 6I¤:L¤>L¥>M«;I¬?K®<L®>H®<K¯<I¬:G°@HµBK®<H°?J°AJ±@J·FN·DK¸ELºIJ²FN²DJª>F¢3H¯BM춄úÔ¯ú„öƓ짆à„mè˜zìŸxä~Íe_®BTÇ^aÐgjÌdkËbhÆ^fÃ[d´N\¶TgÈ\eÊ^fÄ`lÀ\lÂYh½WjÂ[jÂZmÌ\lÓltÍclÈ]fÀUe¬Nd”@bt'Vm"Pv"S{4dq6dm(Z?q|;ko0`e&Xb PTD\IŒR…<iS<S@UAl(Y‹Hzq1_cFX@cHs'Xs)Vv,^aLm-]‚P‚ZNSKŽ«€bŽGEj0lµˆ¡ª^r«\t¿lzÕ£ â´¨æº§ãº©à·¦Ý´¤Ú³¦×²¦Ö«ŸÔ¬ ÖªžÓ¨£Ñ«£Õ¬ŸÒ£›Ô£”Ñœ’У˜Ô¨žÔ©œÐ¦š×¯¢ÙµªØ·©Úµ©Ý´£Ü²¤Ý­žÚ¦œÕ“Œ±YfŽ2OŒ8Vˆ<^}.OJd–SlŠDlš_rªvŽœ\s¤iƒ˜Rq»|‰Ë€ˆÞ‚zæŽzë’|ë—‚î Šòºšç´ŠžTN\6W:V<T
-6Y:`9b;b<h<i Eg!Gh"Ci$Dc@`<^<\8_9e<e>aC\Fi"N‚4Xª^oÀrvÁnuÁpv¿ltÐ~|׏‚Ö“„Ø•†Ù”Õ”‚×”€×”ƒÔ•ƒÔ‘‚ԍ€ÔƒÔ‘‚Õ’„ӏ„ӏÔ€ÔŒÓЋ„Ò‹€ÏŠ€Ò‰€Ð‹ƒÎ‡„΋€ÏŠ~Έ~Έ€Í‰€Î‡ƒÌ…΃xÌ…€ËƒzÌ‚|΄}²HS´JT´JW±NX²MVµIR±GR­ES­@L¯AI²>H±>H¸CIÉPNÕ^SÝm^å{dè…lëpì•vê˜tí”yï–qì˜uíšuì—sï”qí‰lçiâubÖ`X¾JMž4G+D(B”0H—5G 0F¤8J¦<J¥<Mª>M¬AP®AO­@K°@L®>J°=I°>J°?N®<I²>I®@L°AL¶EO·FM¸HOµHL¶HN´CK¯DJ¨;H 2JÄaPöÆ”øÐ¥úÆŽó®€ç¦‰ç˜{쨂è¥{Ãg`¼cfÎ`aËagÈdlÌdoÃZg´Rb²TfÄ\fÌbgÍflÇalÃ`o¿Zq¾\r»UlÀ]xÎjxÍar¶Sp­Ss®Tr°Xr¨KlžHn‘<fˆ9gp&Xk$Y}6j‚Aoe%RYITBSC\Sz3l˜f‘t2\R:S
?YDo+]ŠIxr0^]?`BjLdDgNaNYIt?k~IOIX UŽ~®l6fˆKz–i˜Ro Oh§iŒÕ«ªå¸žä»¦â·¨Þ¶¨Ý¸¬Ú°¢×¯¥Õ¬¡Ó«žÐ§›Ñ¤šÕª¡Õ«žÔ­ Ñ¤˜Î˜ŽÎš“Ó§šÖ«¢Ó¨žÑ«¡Ô±¨×²§Õ°¦Ø²¦ØªÚ¥žå°§ê±¨è¢›Ø‚¬BUŒ-OŽ9P•Pt„<^ŒDb‹GeŠCgªt„¡f€ b}›Lm°l„ˌ݁è•‚í ˆð­”ñº’ᣁ‰8CX<W;Z;Y=[
5_;c;i>f=c=jBfAk Dg=\<Z<Z<^=]:f>dD_Gj$Qt(S’Hd´hr¼ox¹ls¸jtÁptц‚Ø–‚×—…Ù’Ú”Õ’‚Ö’„Ԑ~Ԑ‚֏‚ÓŽ€ÕŽÖƒÖ€Ô‘„Ր†ÖŽ€ÔÓ€ÒÒŒ…ÑŒ†ÑŽ†ÐŒ…Ћ‚ÑŠ‚ÐŒ~ЉЉ€ÎŠ~̈~ˈˆ‚Ά|Ì„}È~Ë‚|´N\´MR³LV´KU±EO±FR®HR°EO²CL®CP¯>H°>H·@EÇLLÔ\SÞjZãzhè…jëŽtìtì—xì–zî˜xî™vï˜vì—rî“rîoéhâs`ÖbXÀMQœ3HŒ)Cˆ(B.F™/Bœ5H¡:J£<M¦8I«BO©>OªBN®?L«?I®>L°BN°AN±?M®>J¯>N±BL¶DO¸DL·GL¸JP¹FL¹HL·FM±DN«?I£8L 5Rß•lúÒ¦øÄ’ò²ƒö·„彩ð®~Ú}o´=FÙybË^[ÆVZÈaiÆbp¾[g·ViÀXeÃ_hÈdq¿]w¿n‡»gŒ¼_ˆ·a‘¶V†°\†¼^Æb~Èa}Æ^oÃUg¡B[•=X›<b4^~.^t.d‚:nŠIt|@mb QUFQCSC_O‚<q˜h’dGQ<YCaMn*\v.Zq.[bHcFr$QbEbHaOUGzFz{;zTLuI†Œl£›`Žº”œlœ„6[®b~»‘¦â± äµ¢á¶¥Þµ¥Þ·§Û´ªÙ¬ Ö¬¡ÔªœÒ¤šÑ¨žÔ¨˜Ô¨›Öª Ô¥˜Ïž’Π™Ð¡œÑ«£Ô¯¦Ô¬¡Ñ«¢Õ±©Ô®¤Õª Û§žâ¦¢ç®ªé°ªé³¨æ«Ÿà‘ŠÉ]e¥>Pˆ2]‚4Tžb€–Rt“Lr–Sw `v¬z¥f~¤d‚¯k€Ç€ŒÜ‰‹î¤ò¶–ð¶‹Èv]€*>Z:X?X:X;^<a:e>i@h?f<d:gBe>h>f@^=]=`?^8b>e>dD`Hi$O4XŸWjºpu¼ns¯fr¯dpÄv|ÒŽ‚ו„Ø–†×—„Ö•‚Ó’„Ԑ‚ÔŽ„Õ‘~Ô‘€ÔŽƒÖƒØ‚×’Õ‘‚ÕŽÓ‘‚ÓŽ„ÐŒÐƒÐ‚ÏŠ‚ЈƒÐ‹Ï„ÑŽƒÐŒ~Јщ€Ì‰„ÍŠ‚Ë…Ì‰€Î†~Ë…}ˇ€Î„~µKV´JT´LV²KW°FR²HT°EQ­CN®?N¯DM¬>G®<Jµ?FÃILÑ\UÜk\ät`èˆoì’pì•wë–tî–zí–yî•rîštðœtð”sïlè€hâtb×`T¿JR 6H*F‰(B’,D˜0D›4FŸ7J¤=L¨:L¨CR¨@N§?O¬>K¬<L¬?M°@L®<J®BK³CO®BO¬CO±EO¶EO·FL¼INÀHP¾LRºJP³JP²FJ¨8EŸ4N¼ONóÈž÷¾•ô·ˆó´‚ó°‚ñ¶ŠÍf`ÇghÙoaÆU[ÂPWÁ\d¾WaµNb½`lÇ`qÊ`jÈev¹]v¼^qºXl²Rl´^|²e†³^†¥U‚ŸQ{¦_ˆªR~ Bl~1]r%V‰6f{,[ˆ:j†:hŽDu‰H|p,\aN\KZFTFbOˆN€ŽU\CVCeH~Ev^A`HcHgRm!V€9m„>z€>z€>}p%c†XŽw8sk)lƒR‰†P¡_ƒ©l•˜]Ÿ`†Ê¦ËžªÞ°œâ°œÜ®¢Ý¯ Û´§Õ°¤Ø¬žÔ©žÓ§›Ò¦žÓ§žÑ¥žÔ§˜Ò¢•Ò •Ò¢–Ò¢šÔŸ•Ò¬¥Õ¬¤Õ¬¢Ñª¥Õ¬§Úª¥æ®¤éª ê¯¨ë´ªë¹®ê¹¬æ®¢â “×qr¼HUœ:N7^ˆ<T¢l„“Kf†?`€:Z¬pƒ©rˆ«pŠ®jƒÆ|Þ•’꧉ߑq§JIi9];Z>Y>Z>]<[8f>j>f>j!Fh@eAf@f>k?b<\;Z:b=`:f<f?^Ec"Lo)U?^­dp¸qr´iq®dn´kxÊ€}Ô“ŒÖ–ˆØ˜„Ö˜‡Ô”„Ԑ֐€Ô’Ô’‚Ô’„ԐƒÖ‘ƒÖ’‚ÔŽÕŽƒÓŽÔÒŽ€ÐŽƒÐ‚ÑŒ„Ѝ‚ÒŒ‚ҍƒÑ‹‚Ћ€ÏˆÏŠ‚Έ€Ê‹~ˈ€Ìˆ‚Ë…}̈Ì„zÌ„ź|¶LR´LX´NW´KS¯FT´CP¶FL±GP°DP¬@Kª>M«;E°:H¿JMÐ]YÝl[âzgç‡nêŒoë–xê˜tî”ví—vëšxï—vð˜wð–pðŽmè€hâvb×f[»LN 5FŒ&AŒ$?’+F—2Ež4F¡8H£9I¦;Lª>L©=J«?N¬@L¬<J®>J¯?I­BL­@M°>K°?L®@K¶EP¸EPºHQÀJRºLPºPT¼JP¶KO¸EK­BJ¤8K¤6Qè©„öز÷Á˜ôµ„ô´€ò»ŽÖxhÛu^Ì\[ÅY`¾S_½V]°IY°L_½YeÆajÄcqÂ^n¶Oe´Rb°I`Â]rÍbrÏ`pË\sÊbvÂj~§Xq’Fop%Yp%V|/dr&X„0aƒ0`‚9gŒFt|;km.Zd"PdLXJVGj$X|7j€Ani"Tf Rn(Sp2^[?^>aB^@` EaCi"Lf$N^FbJ|Auj)Zn,dyAt}A€†L‡¤z¨š^ŒÄš£ÆœÒ¢ Ûª–ܦ”ؤ˜Ö¬ŸØ°¢Ô¬ Ô¤šÑ”ÒžŽÒŸ˜Ñ¥Òž’Ñž“Ó¡“Ò¤šÓ¢šÒ¢™Ñ¡šÑ¤Ï¥ Ò¦¢Úª¤ä²¬è±ªê°¦ê±¨ì´©ë´­ï¶¯ï¼¯í¶¨ë°¡ãŒ„Ô^b²;J’7Ox-Xn,Hœa€„:[~8b€Aa®vŒªq‰¯p‰¾}ŽÖŠ‰Ðqn¶XX€)F[
:Z
=X;ZAY>]>a>f9g=h>j@h>j@i Bj@h A^9Z9[;`=b=g>bA^Cf Ly/VšOg¶jq¸ow°fs®hsºmtΈ€Ö–†Ö™…Ô”„Õ—„Ô•†Ô”ƒÕƒÔ”†Ó‘€Ô€Ô“Ö’֐‚ԏ~ÓŽ€Ó‚Ó’ƒÒƒÒƒÒŽ„ҍ„ѐ€ÓŽ€ÐƒÏŒ„Ί~Ћ‚Ћ|щ‚ω͈}΋€Í„~Ά{Ì„zʁ}É…‚µHT¶MVµLV³GS³FR´HP±DP°CL¯BP¬@K¨>J§<H®;E»JMÎ[XÚjZà{hå‚fèrê’uë—vìšqê—xì–yïšwî˜zð•sîqé‚kârbØcWÂOQ¢6FŒ&A‡%A‘+C•1D–2F :L¡6H¨?L­=L¯?K­>L«>N¬?L¬>L®:H¬>J­@N¯@K°@M²BL²BPºDM»HP½GN¾JR¾PV¼MVºJQ·HO²BI¥;N¤5Pá—zúÑ™úÒ¤öÀŒöº†ö´‹æ›rÐibÂXbÆ^dÂ^jµJ^¬DX¶Rh¿`pÈ^kÁ]l¹Wj·Sj¸QeÆfnÑfnÑboÄ[q®FgªH`Ìgs¾\sžDjw*So,Zo*]dPi!Un!Vz1d…Ap~7gq*\g!VZFXO`Pp-bl$Zx4k‚?v>rh#NZB]@^<]=^>_C_C\>Z=T=R@l-ar*ZˆFtz;nm/nzK„”]‹™l–±~¾Š‘Ô¡˜Ú¥œÖž•Õ¥žÕ¨žÕ«žÒ¢—Ξ”Λ”Í–’Ò¦žÑ —Ï ™Ò¢›Ô£›Ó¡•Ò ™Ï¢šÏ¤—Ìš“Ϥ¡á°¨ê¶©í·¬ë°¨ê²©ì°ªíµ«ìµ¬ì´ªî¶­ï¶©î´žèœŽÝnj¿FO£6K-LkOr0JNo‹@ct'R f}¬nˆ´xŽ¼}É€„Âhm´QSŠ(BY<X9X>V;Z=^<gAh@h>jAl DjCg@jBe?a=^:Z8Z6`<l<f>_@`Hp'S‰=_«dr»qt·lp­an±doÁtw͈‚Ö”„וƒÔ”ƒÕ˜„Õ”‚Ö“Õ’ƒÑ˜ƒÑ‚Ô’€Ò‘‚Ô’‚Ô“…Ó’€Õ€ÔŽ„Ԑ€Ô‚Ґ„ÒŽƒÓƒÓŽƒÔ€ÒŽ€Ð‹ƒÑŠ~Ј}ЉÐŠ‚ψÐˆ|·~͆|ω{Ì‚{ʃ΄z¶IV²JR´HU´HO±HW´FP®FR°BN°BK®BMª=I¦7F¨;J¸IMÎXSÚj[ávcæ€héŽoì’uë–wí’tî”wê—xîšví˜xî˜tðnèmãtcÙbXÂNM4GŒ(BŠ&@”0G“,Dœ1F£<N¢:N¨:K­BO°AL­AM¬BP®BO­BPª@P¯?M°AMª>K¯@O¶CK²DN·HP´DN¼MTÁQS¼NT¼KQ¸LO¼KJ´DL£:N¦2Nß–€ùÓ®üΖøÈšø¼Žôµzä†`ÆX\ÄZ]ÄZcÆ\d¸Td´RkÄ\g¿\e½Ta¶Tj·RgÉ`pÐlpØhjÒafË\hÆ\m«He¡Og²Sc£?Z•5X.Wt,dh#PcL[K^Ln+Z{4gx.dq(^y4hp)\d!U^Jw4m^Ot8pT†ŒM~k$UW:[=^BZ>]>^B^HZ@T<SATBx6hœQx Liˆ:gx9}Žo¦£~œ¸“£Ì™“×›ŒØ£›Ö¤œÖ¦ Ö¯¤×­¡Ò¦œÐ–Ò™Í—”ÏŸ–Ñ¡šÒ£œÓ¦œÔ¦šÑ–Ïš‘Ò£šÍ¡›Ë—˜Ô Ÿç­¨ì°¥ìµ«îº¯ë´¨ì¶­ìµ©ì¹®îµ®ì¶¬î¸¨ðº¦ï±¢ìžàvrÈMU°<JŒ.Kl!HTCu4RŽGe|.]ˆA`©pŒ³p‡¾‚’Ë…ŠÊps²NVv>`>T;X
:X:]=b<hAlCi@h<lEl An&Gl$Hf@`<^=Y;[7\7e;b<ZDcLv*S˜Nhµgtºpt²jq²bk¸ktÈ~}Љ‚Ó’Õ”„Ö–‚Ö”„Ö“‚Õ•‚Ô–…Ô‘‚ӐƒÔ‘ÓÔ‘€Õ„Ô’Õ“}Ӑ„ÒŽ‚ҏ‚Ó‘ƒÒ‰€ÒŒ†ÑŒ‡ÔŽ…э…Ñ‹ƒÐŽ}ЈЊ~Ñ‹~ÑŠ~Ћ~ωΈ}Ά|Ά|̆~Ì‚~²L\²HR°HW´HT°FS°JS±HP®>I±@I®?K©:E¥7F¦<N¸LQÌZVÛh]âvbã‚qèŒjì•xë˜vì–vì™xîšzï˜xî˜yï˜xíoèläudØf^ÀPP¡4H(FŠ%E’-H–4I7M¢>N¢8K§BQ«>N¬@P¬?N®DR­EP®AN¬AN®?M²?L¬<L¯<K¯@NµAN¸FRºHO¿LTÃMU¿MT½PV¼MP¼FK²DM¬=M©3Nà’zûÔ¢ýÌ›ûПúÈŽñ¨sÊRNºFPÀX_Ä^i¸Vf»VfÃ\fÆ\d¶We¬E^¸NbÉanÔjqÔejÒdjÒcgÄap¸QdŸ;X’1L•7P|Ht"M‡Btq-[^EXBUBWFaKz7lu,\q/a{:f>qa QXHu3d^Kd$YŠRŠ™g”|:kV<\@]>^BZ@V9XBS<M7P@l'U”Np®_tŽ/R˜Bg˜_š¬ˆ¬·{Õ¦Û¨˜Ú£–ب›Øª¢Ù°§Ù±¤ÖªŸÒ£˜Î˜ŽÍ‹Í˜”Κ’Òœ—Ó¦ Ó§žÑ ”ʏŠÊ’‰Í›–ј–á¤šê®¤ì¶§ìµ§ìº¯í¾¯ì¶«ë¶ªë´¨ì·¯ì·°ð»°î¶¨î¶«ï± ëž‘å‡|ÒX\´9G’,Ir C^AZ>ŠHb€4Z~5\§l„¯nˆ»u…΃Êtw¬HRl@\>X<\<Z>^=d;d;j Af@k!Ej>iAl#DiBd>_<`A[9\:b<g>_>ZAbJ‚=`©aq¼rv¼pv³kp¯fn¸tvȇ€ÑŒ€Ó€Ó‘‚Ö”€Ö“€Ö’Õ}Ô“‚Ó‘Õ“|Ӎ€Ò|֐~ԐÔ‘ԏ~Ö“ƒÔ’€Ô~ӏ€Ô€ÓŽ‚А†Ð‚Ñ‹Ò†ÒŠƒÒŠ€ÑŽ‚Ò‹‚Òˆ}ЊÑˆ}χ€Í‡Ì‚zÍzË€}¯KV²LV±ES±KX°JV´JS¯GQ­FS¬BL«BN¨;F£;G¨8H¶EMË[[Øhbãu`ç‚mèŒtê’vê“wê˜vì—wíšvï—vî˜xð–qîŒnè€låtfÙ`V¾MQ¤2F*D*E'B™4Hž7N£=P¦<MªAQ®BN®>N®AN°CQ®@N¯@O°CR¯@K±?M´AL³@M³BL¶FP·FQ¸HP¿MRÄRVÀSV¾PY½NS½LO¶JR¯<Mª4NߌrûÒ¨üТýÊŠ÷Ì›á}Z¶EN¹CMÂVZ¾V_ºT`¾YeÆ\d»\m²K^´NdÆ\kÒflÐdmÎelÐdhÁTfÂWdº^oƒ*Jd:mD\Bn.Yy4]dDWAZCWCYHYJx7f~>jl$Yv2b‚Bs^ NVJu4icRUKv=w’b“šil'Z^G[@Y?Y=V;P:N	6L?h!M¨c|¥ZtšKo›?b¼€šµˆ¤ª‚¤¾Š£Ø¬¡Ù§–Û§›Ø¬šÚ²§Ú³¨×°£Ô¨šÐ—’Ê’ŠÍŽ‡Ì”Ì™”ÏŸšÓ«£Ò¤žË——LjˆÏ’“Þ›ç£™è©œê®¡ì´¬ì¶¨î¸¨ï¼¯ï¹¬ì¹­íµ«í·¬ð¸«ð¼®ï½¯ò»­ï¸¨í¨œçŠ‚ÒZZ¸;Jž2JtA]>YBn!F†9\y.W›\r¶x‘»‚•Ê‚‰Çy‚.IeA^E]B^>]>_;e;j?l?k!DlEj Gp,Mm#Hl&Hc@^<]9_:`;f:c;Y<[Hk!L“Id¶jrÃvu·qs°fp¹kpÅ|}͆Ì…€Ð†|ҐÕ”€Ö”„Ö“‚Õ“€Ö•„Ö”‚Ó’Ò‘€ÐŽÒŽ€ÓŽ€Ô‚ҏƒÔ‚Ԑ֐€Ô’ÒŽÒ‚ÐŒ„Ô‹‚ÒŽ‚ÒŠ„ЉЊ‚ÑŠ‚щ€ÐŠ‚ÑŒ€Ñˆ~·€Ò†zЇw΄~Ê€®HX±JV°KU¯LZ®JV®EP­FT®CP®AN­AK§?H¤;Hª:H¸JOËZZÙi^áwfæiè‹vê“|ì”tì—wì˜yí˜{î–yí”wî•yíŒpè„nâtcÙe[¾OP¡;I-H&@”*B—1E›5F¤@V¥<N«>N¬@N®CP°AQ°BR²DP°CR­@R°@L­>L°BN°BP±EQµHUºFN¹JR½JSÁLS¿NTÀNWÂNP¾JR»KN´@M¬8TÒr]úÖ³þÑ™ûÍ”ø¹‚ÉXN´DN¹FMºKS¼RX»P[»S^¾Te·J[ºRaÌ]cÌ\iÉZgÂOYËelÊVc¼Rf¾\n¶\n<^V@Z@hJ}=llI]@ZB[>X>\HXFd$R~9jx.ho%Xz9fr.bWIq:gh VQ
B\RyCv¢wª‹Iƒ…Bx‚ExdQN
-8N:I
-8H
?^F¬lzÐ}z FfœJkÄ‚–ٝÀ…“škšºŽ¦Û°£Ö£–Ùª›Ù´§Ü¶«Þ¸¤Ø¨žÒ›’Ï”Ê‘ŽÎ‰Ì“’НšÒ¨ ÔªžÒž”я†ÛŽˆæ•è˜ê¦ê¨é°¢ì¶§ì²¢ì¶¨ð½®í»®îºªïº«ð¼°ñ¾±ò¿³ñ¿³ñÀ±ñ½®î°œê”ŠÙmj»ALŸ7JzBT=ZC^<…:Xx)TGf¼„˜Â‘ϐ”Áuy&Fa@[>X@]:^>`?d:j<k>i@jAn%Fl"Dm#DkB^8^;]:]8b7d?_=\DbJ|2T£\m¼uvÀut·nq¶jpÁzyÉ‚|ʆzɁzÈ‚x͆ÎŠҐ~Õ‘ƒÔ•Õ•„Ô”„Ô”ƒÓ’„Ґ€Ò’}ӏÒŽÕŽ€ÔŒ‚Ô’Ö’‚Õ’„ԏ„ԍÑƒÒ‹~Ò‹ÏŠÐ‰‚Ò‹~э~΋€Ð‰~Ï‹~Έ€Íˆ€Ðˆz΄xЄ{Ì~z®DQ®HV²IU°FR®HR¬DO®DR°BN¯EN«ERª@K¨7F¨=HºIPÍ[X×i]àxhã‚pèxì’tì™wë–ví”sí›xî—xî˜wï”wívè‚jâ{nÚc\¼PY <M*EŽ">—/E˜1F5G¢<O¦:Kª>O®?N«BN²BN²AK²@N´EO°BP®@O°BO°AO²BPµEN¶EP·EMºKQ¹IRÀLTÂSXÇTXÃMP¾LR¿JQ¸DL±>RÀOTöÈœþÑžüÔœè›s¼FM¸KRºKQ²KWµLV»U\¶R[ºVd¹XgÉ`iÌ\aÍaiÊbg©BX¶Rg¸Od¶Pc®G_£C\‚7V[A^D7b„@i]>X<X<aE`?_EZFYHf"L|9np)Zo*Zn,\d"Vs<ml'[^O^Xk._ž~¨o)VbDd FZ?O:G6G:X@§n|Ôx¾Td²Tkƈ–ܦšÚŽ‡ÎŒœm›ª‚¦Ð«¬Õ£¡ØœÝ¶«Ú¯ŸÜ¬ŸÒ¢›Ð˜–Ì’“É‘‘ɐÊ—”ЧžÖ®¡Ò™ŠÕ„€àˆ„å’‹è–æŸ•ê¨›ì­¤ì±¥ì¶¨ì´©í¹ªï¾²í½±îºªð¼°ð¿±òÀ²ôǹòǺôÅ´ôĶð¶£î á{xÆKP¬8IŠ&A^
:T?[Bu%H0^‚2Y»”‡–Жœ¼q}x D_<`>Y:b@_=b<e@f@i@h?j CiDp'Fo&Je=\:\8]7]8d9e>\=ZEj!PB\²iuÂxv¾qp·jq»ptÇ‚€Î‡~Ë…~Ê‚yʁyÌ„{ǃ}͆€Ï‰~ÑŠ€Ò‚Ô’ÐŽ€Ò€Ó€Õ|ÖŽ~Ӎ€ÒŽ€ÓŽ~Ԑ~Ԑ€Õ“€Ó€ÔŒ„э‚ÑŒ€ÑŒƒÎŒ†ÑˆÐ‰Њ„ÑŠ~Ћ~ÒŒ{ψ~ψzЇ}Єy΃|Ìy®EP®HT°FT°IU®HT²GS°FQ®EQ«@K©DP©@N¨:I¤<NµJRÊ[\Ùj]áwbäƒmé‹sêtì–vì–wí–{ì˜zî›vì—yï™qî‘pæ„hãveÚf`ÃRV¢:OŽ,H‹(B’.H˜.DŸ4G¢?M¤=L¨>N­BO¬DQ®CO®CP³DR²DR²AM°EN°DP¯CR²BU¶DNµCOµ?M¹GRÄmuÂRUÁPUÄRUÀNTÆPRÄLQºIM²>O¶>Q쬁þÖ«üӜށj»PZ½LPÂSX¿S[¹OZ¼PX²FU´L`ÐhjÌbdÆXdÆT^¸T_’7Wƒ0QŒ9\‰0T}$L‚/Q‚3VkJ_G†Do{1^X<V=X>k!P_Aj"N\A\E\Bl)Ts/`h"Qg#Wm(^{<nj$Yf,^]Vc$V˜u›s.`V>S
8M8K	5E5O>šZiÖŽxÀSa»SgΉ“߬žÛ”ˆÚ†ÕŽŒ©v™¥„©¸›«Ä–£Ôœ›Û´©Ô¤™Õ¨¢Ò›—Ñ›šÐœ•Ì–“Í••Ïœ˜Õ¦˜ÒŠÖ{zãˆäŽ„æ˜Šèè¦›ê¨œì²¦ì²¥î»°ì¶§ì¼¯ï¼¬î¼¯í¼¬ð»­ð¾±óöõôóÆ·ôdzõÇ´ò¾«ï¬šæ…{ÏV[´<H˜*Ai9P;X<hAz.Rt&T©fzÆŠ—Øœ™¿z†v"HbCh@_?h>n?j"EeAfCh?hDl Do)Jl%Dl @b>^9]>_<c>g=c@W>\Fr(PVh¼u{Æzt¼np´dpÂ{v̈ÐŽΆʆ€Èƒ|Í„~Æ‚~Ɂ~È‚€Ì„€Î…~χ΋‚ÑŽ}ÐŒ€ÐŒ|Ԑ~ҏÓŒ€ÓŽ€Ó~Ó’‚Ґ…Ó’†ÒŒ‚ЍÐ‚ÔŒ‚яƒÑˆЋ€Ñ‰€Ðˆ~щ|Òˆ|Ї{Ñ…{І|Ï‚|΂|Í|µBQ°IT°IT±CN°HT°GS°DN®DL­DN«ANª>L§<I¦=JµHNÌXVÛjaávdä†qæ‹sê•tì–uì—wì˜tì™~í›vì˜zï—vð’nè‚nãvf×d\ÀPW¤<N-F*D’+B˜0F¢0E¡9I¢<Lª?Q«CQ¯FT²DR±ET±IX²DS±GR´AN±@R®CP°@N°@Lµ?P¶HXÈvpÞ„hÄJO¿MTÃSXÆOPÆONÀLP¾JM·FS²DZÔu^üܶûÓ Ùn[ÃOR½NVÃXYÄW\¸Q^°@R´L`ÊgiÎahÈ]gÎgp·Ul™Fh—Bb€2Y€5SŠ2Rh<u!Ez!F[D`FŽT„l$MVAU@^Jr*VaIgKYB_DfL\FbKi&UaQdSCw„C|‚J~aR]PVv„L}R;N
9L
-6I<M>NgÒ‰yÂaj³QeЃ’Ý¢–ÜšŽØ”‹Ø‘‰Ó”•­{˜³¤Ì¦¡¿— Ò©¨×¶¬×³¨Ö¦ŸÐ—”И˜Òœ–Îœ˜Ò“Л”Ó…|Ùyzá‰†ä‡æ’‡å˜‘èŸ•ê¬žê¦šî²£í²¡î·©î¶§î»¬ðº®í¼®î»®ð¿°ñÄ´óĸóõóǺõÅ´öɸôÀ¬ñ°žê“ŠÙbd¾AJž,Dr?V@T:]
:jE}+\ŠC`À„–Ò•˜ÃƒŠ†7Y`HdDZ>`Af>h=fBi BkEl"Jl"Fp(In'HiAaAZ<\8b<d?iAbAU@XCy2V¨cqÄxvÄspºlp¼otÈ‚~ÔŽ€ÒŽΉ~Ì„}Ê„{É„~ʁ|ʁ}È€~ɁzÈ‚~È€|Ê‚}Ë…|Ì„~ÎŒ|Ò‹}ÐŒ€ÓŒÒŒ‚ÐŽ‚ҍ}ÑŽÐŽƒÑ‚Џ…ЋƒÐŒ‚Љ€ÑƒÐˆ~χ€Ò‰|Ò†zΈ{φÑ†}Ò†‚Ά~̓Î€|²HP´MR±IS¯LS®FS¯EP®EP«FQªBO§EQª>J¥:I©;H¶JPÌYVÙj`âtfäƒkèŽsê•vê–zì–xí™zí˜yí˜uì™uí–wí’pæ„kàtbØd]·QX¤?S,IŠ*F–.F™2F£6H¨<N¨AQ­DV®BR²CS°GS°IW´JTµDQ°FS²DN°@N°BN°@Q°BR¶@OÆZYÕo\ÂPTÄNRÄSXÀOTÄQWÆNQÂSXÃRX¼LQ·JW¾T`ñº‡ù×®Ù~nÄMPÄQSÃQVÅQS¾T`¸MZÆ]dÈX^Ë_cË^kÖetÑco¾R_³J`£Fb‘8ZkG^BbCX?V?eI‹P~dCU<ZCt0\j MbKdKYB`IhMYC^Fk&VaLbRt3f’R†—b’v2nbVl5\‘g”VCF4D
-9J?ˆE^ЊvÎgk½XgÎ}ˆÝ¨›Ý™ŠÝ¨žØœ•Ö’‘Ô™°š¹Œ¢ÕÑ —Ö¬¥Û¶«Ù¶«Ó¢šÐ˜’К–Ðœ’ΗŽÐ‘Õ}zÞzwâ~yæ‹„æˆæ’‹æœ•é¦šê°¢ê®£ì¯¢í´­îº¬îº©î¸¬ï¾°ï½°î¼®ð¾¯òŵòŹôÆ·õŸõɸöÇ·ôÀ±ô¶¦íœŽÞmmÆDLŸ.D:Z;M6V:aA€4`z-SÃŒ Ð“”Ä‚„‘@[bH`B^&M^@f@g@hBjCj#Eg Dm#Hq*Jn$Eh>c>Z9]:`:f;j=[=WAaFŒCa¸lqÅyvÀtx»hjÄzxω€Ò•€ÏÎŒÍ‰z̈~̆É…}ɆȃÈ…€È€zȁzɁ|ʆ€È‚|É„Ë„}Ë„yË„|ψÐŒ€ÑŒ{ÒŽÒ€Ð„Ѝ‚я†Ð€ÏŠƒÒ‰ÍŠ„ψ|Љ{ψ~ІzÏ…|Ï…~Ï…z΂yЁÎ|t¶FR³HT±IS¯FR®EQ°>N°BL®BNªBL¨AP¦:H¤9K©BN¹HMÌXQØh[àtbäjèŒvë”vê”uìšvíšyìšvî—vìšwî›wîræ‚nâu`Öh^»TZ¢>TŒ1PŽ-L˜3O˜4NŸ7O¦?R¨AT²ET±CR°CQ³CP²FP²AQ²DP±BN²BN²@N±@L²DPµDN¸HQÃPSÁPWÂNV¿RYÄPWÈTVÅRVÅUZÂQVÄRTÃRV¼KT¶GZÜ|bùÜ®æ›ÇTSÃST¾OS¹FQÄV\Ñ\\Ê\aÅ_hÆV_ÍhrÊ^pÄU^®DX¨B]€!IkD`Ij$PeGP<VAZA…JtcHZDaJcH\Bj&S^C]FeHaLZFh#TdNVDj%U‚>x‚?zw3c„F€~:€‚C~¢Ž°r2^D6E;{5UÇ€xÌi`»WjÅsÞ«á–‡à¢”Þ¨—Ù¦¡Ù¡šÖ¥¢±† ²ˆ Ï“ŒÔš’Û°¦Þ¾µÚ¸ªÒš–ј“ÑšÌŒÎ‹Ø|zß{zâƒä†‚æ†å“‰æ’ˆèœ“ê¥™ë¬ í°¦î²¨ì²§íµ¨ï¹¨ï»­ð¾®ðÀ¯ð¾¬ñ½­ñòòŸôƵôƺöȶõȹõÅ´ôºªî£–âyqÅHP§4Fˆ!@`:J8S
;YAz0Wu&T‰šÐ“•Â€ˆ™AXl H`F^DbDl FeAhBl$Hl En#Fq$Iq(Hl%DfA]<^=]=b:d<b>V>YDt*TŸ\pÀvwÆxu½pr¿knÈ}}ҏÖ”€Ô”‚ӏ€ÐŒÎŠ}͈zÌ„|ǃ|ȃ|Æ‚|È‚}Å~}Â|Æ€|Æ‚{ƃyƁzÃ~{Ã|yÆ‚}È‚}Ê„|ω€ÎŒƒÐ„ÎŒ„ÎŒÎ‰‚Έ‚ψ|Ί~Έ}φ|φ}Í„|χ~΄|Ë‚{Ð~wÒ€yÑ}t´HR²JS±HS²HR®DP­>N¯AO¯EP©?J¦=K¦<J¦:J¨<HµHNÆXYÖdYàtcâiéwê‘zê–xì˜zìœyëœvì™yë˜uî—zî‘tæƒqâug×f^»RY¢<Q0M/N–4Pš<PŸ>P¤?P¦<OªAS­AN«FR¯DS°CR±DOµDN°DR±CO´DO²EQ³CQ´FT¹EPÂMRÂ\eÂMQ½NVÂQVÈXXÆTWÊSVÆTWÉRRÆR[ÄPQÂKTÉV\ñ½ˆì¬ÎXTÆXWÂNN¿GRÎdbÍ\aÈ\cÐdhÌctÉZdÅ\hª<R¡>R…(IdMaNq/`€<lU<P:RAWFw6ez8lr)Tj"TZDf$Pg"R\C`IfLaG`Hr0]dNU
C^F‡K‰o._u-`n*^VH^F™|›m+`B:n&LÀvsÎqn»UbÀevס”ß—„ß—Œß£ŽÞ±¦Ü®£Ø¥¢Õ§¤°ƒ ®|’Í“˜Óž–ܵ­Ý¼²Ó¦›Ð”ÏŽÎ“ŽÑ‘ŒÛ{zá€}á~ãŠ†æˆæ”‰ç•è”ŽéœŽë¦ëªœì³¦î´¤ìµ©í¶ªî¹­îºªð¿°ï¾°ïÀ°òÁ±ò´òĶôÅ·ôȶõȹöɺöȶôÁ«ï¬žä€{ÏTX´<J–$?j:P;Q<UAfE|,Z°j~Ж˜Æ…Ž¢Ldp#JZA[@dBlCh DeEf!Fj$FiCq#Fq(Fj!DfC_>^<c=d@e>aAX@`EŒC_´l{È{zÂut¹nr¿qsË„{Ñ”„Õ”ƒÒ’~Ò“ƒÑ’Ï’‚ϐÍŠ}ɉÇ‰~Ȇ|ʈ{Ç…€È„~È„|Å„}Ã}€zÃ~}À~€}ÀzÂ|zÈ~{Æ„€Ê„~Ɇʇ„ÍŠ‚ΊƒÎ„~Ά}ʃ|ˆ{Í…{͆zÌ…z̈Ðƒzуzс{Ð}z¯EQ±IT±FQ¯FR«ES®CR°AL®CQª=J§<L¦;H¨6F¦3H´FKÆZ[Üf[àvfå‚lèŽvë”|êšwê™vìšxêœ|íšwí™zî–oìŽoæ„nàtgÕic½OT¤<PŽ+L.J”.L›<R :O¤>Q§>P«@R¬BP°ES²BO±ES³CO¶FO´FT±FT±FR²FQ´BP´EP·GQºIRÌ^\ÃMTÃUZÄPVËUXÉUXËUYÇWZÅYZÇTZÅPUÆQWÈT\à}`í¡vÐZRÅTX¼ERÐ_cÔb`ÔfkË`nÍbrÍhyÀex¶M_™6Qm@bI`Ra!P‚Jzw6gV?T?ZDWDbH…Hrk NVD]Fz<ifL_DbEbIZEk*Zl&Sk$VZF`Jl.\YEz6j`JL	=N
- at wQpŠRŽbF³nrÒvl¾U_ÃenÓ—›ÛŒ|ݐ‡ÞŒÜ¢’ß²¤Ú­¤Ø°§Ï¨£®†œ¤l€ÍŸž×­¦Ü·­Öª Îš–ÍŒ†ÊŠŠ×†ß|zâ€ä†…á†…äŽç“‘æ–é˜ŒèšŽèšŽê¢”ê¦ší²¢ì±¤î±¦ï¶©îºªí¸©ðÁ®ð¾°ð¿¯ò¾­ñ´òŵóƸóĶô˽ö˼öË»öIJð³¤æ‰‚×ac·<K /DvBXBRAT<aD…5c—NcÒ——Ó––žK^n@\>`@bBhDgDh&Hj$IhBg!Dk#DmCg@c@^?]<`<g?d>X;XBiH™NhÀtwÇ{tÄtrºnpÂ{{΍‚Ö–€Ô–‚Ð’€Ò’Ñ’‚ÒŽ|А‚ÌŽ~̏ƒÎ„ËŒ…̉€Ë‡ˇ€Ì†|ˇ~ɇ~Ç‚{Ä{¼€}Á~~¾x¾‚zÀ~¾~Á}~~Ç€~É~zÌ‚|Í„{̓|̆€Ì‚|Ë…{Í‚z͆Ï…{ЂwЂwÑ€wÐ}t²CP®GR±FP­BP«EP®DR«BN¬>M­BK¨@L¥<J¨6D¤:H·HPÊYTÚj^àvfæ|oèŒwë”|ê—uì™xë›sì™|î›tî˜wí–ríuå…pázmØg_ºOT¢8LŽ/I*J–0Jœ8P :P§@Q¥>O©ET®DR±CO°BR³FS±ER²JS´ES´BS²DR³DQ¶BR¸FR¹IU½IRÀQ[ÀSX¿QWÆNPÇPTÆRRÆPQÃQSÄSQÃORÆRSÊ\YÐc_È[MÔq]ÃMPÄTTÊUYÖa_ÔkuÓftÂi‰µc‰±_¨Sp’8ZpE`Gr.cXBS?xExh"SVBj-aZA^HU=bFz2d`J{:kz2^\B[=bG]FWAv8hbEx4d^GYEVEf YIz`OH	8F<XHU…¨c€Õ‚m¾Yc¾Zg΍’Þ’zÝŒ€ÚŠÛ‘ƒÜ¦”ܲ¥Ø¬¦Ù°§Ô¬§À”ž¦k†ÊŸ¤Ú´§×¬ Ð™”ˍÍ……Øzà€‚à€„ãƒ„â‡„âŠˆæ’Žè•æ“è˜Œê™‘èž•ë –ê¦˜ì®¢í²¥íµªï¶ªð»ªë¸®ï¸©ï¼«ï½­ð¾­ñÁ²òôôƶòÆ·öɸöȸöÊ»öDzðº©ê–‹Ûji¾DO§:Iƒ'FZCTAS<Z@‚<bŽ>\ΕœÖ˜˜œFZm!Ep$I]>cCh"Gi Al"Cl"Dn&Jl%Hk)Ii"Eb>`?`@b@e@f@`<V=aLƒ>_¨dwÂxrÅtoÄop½pwÈ}yÐ’‚Ô”€Ò‘ÒÒ‚ѐƒÏ’‚ÐŽΏ€Ð–€Ó”Ñ~А‚А‚ÎŽ€ÌŒƒÎ†{ˈ}ʉ|Å„}¾€€¾}~¾}y¼{ă}¾}|À~~½{~À|~Á|ÁztÇ|xÊxË~yÊ…‚ʁzÊ…|Ά|ψ{Ï„|ЂxÏ€xÑ€v²CM²GT°BO°IU®FN¬DO¬EN®=I­@J©DR¨=N¦7G¥;K³EOÉYYØh\Þvjãpèxê—{ê˜|ì™zë›xëš{îžsívï˜uíqè„jäudØf\ºNP¤;L“,G,H—0H—4Kž6K¥=R£ARªFV¬BR±ET¬CS°HU²FT³HV¶GRµFQ³BP³BR·FS¶IRºGR¼KR¿NTÈRXÊRTÂSVÂPV¼PYÀNS¹LR·LV¶KTÀPTÔn\ÂVHž8H±MPÁTV¿FLÔcbÑYdÐdz¾eŽ«_Œ®g‡­^|›Ib†.RZBl2`o)\M
@L<€R†m(Z`Mj,[T>aHXBVFi SƒJ~…FphI[>W9fMZB\AFxS@f Or/ddPaT[Ge‘h&TG5F6M=†De¸o{¸T`¸Taʍ“ÜžˆÚ†|ÛŠ×ŠÔŽŠÖ›’Û°¤Ø±¬×­¦Ø®¤Î£¤º†’Ч¤Ô¨¡Ò”‘Д’ч„Ý~€á†…âŒŒâ††á…†â‹äŒŠç’è–è–Žé˜’êšŽê ”êœ”ì£˜ë­ í¯ î´©î·ªðµ¤ì´§î¶£í·¨î»¬ð¼®ïÀ°ð¾®ó´óŵõƶöȼöȸóÁ´ð¼ªî¥–ßtpÂHQ­9H&D^?P
9R>Z@|.U‰2UÉ‹”×›˜§Ziw&LgF_>aDjBfDhFh"Gn(Ip(Hn%Fh F]>]:b?b<e?e>\?XDdN’Ni²kyÀxwÀqp½nrÆsp΃{Ô‘Ö‘~Ô’ƒÓŽÒŽ€ÒŽ€ÎŽÎ€Î~Ï‘€Ò”‚Ó“‚Ò‘„Ó“…Ò”„ύ~Ί|·͉~ȆÂ„€Á€|Àz¿‚yÁƒ}Á~|¾}}¼~z¾}~Àzy¿y{Àyz¿zxÀ}zÃ|zÆ}zÊ„̇~Ɂ{ˁ|Ёx́xÏ€y°DR°HQ¯EO³EN¬CS®@P­CL«=J¬?L©BN¨>L¤6F¤:I²DMÈYYÚibÝzqâ†qæxè”|é”zë™|ëœxìšzí›~ìš{í—uî’rè„màtbÚb[ÀKN¥;M’.KŽ(E–.G›6MŸ5N¤<R¨?Q­BPªFT®FV®@P°FU±CQ´ERµEQ³DO´GS´DQ¸DQ´HR¸KR¾LQ¿KPÆQRÊQPËTUÌVWËSTÌWXÊRSÌVTÌSWÐ\XÊwtž9R¶V^΄oҏ„ÃLWËVdÂ^ƒ°`³mŽ²]t¾T`Æ]b¨F[wL^R…S„d RI
- at NB‚WŠz9ldQV@\O]En)^o$\ˆM}=fs*ZbEU:X?hPVD`A|@nT
C_N…JƒfTZGo>nk0TR>RGH<t2V¶rx K\FaÉ€‡Û¡’ÛŒ€Ú‡Ø“„Ö‰ÓŒ‡ÓœÜ²§Ø´«Õ¬¢×±ªÓ§£Î¢Òª£Ð —Ï”ŠÔ„~Ü~‚á††ãŠŠãŒŠäŠŽâ‹ŠäŒææ”Žêœ“è™’ê˜’éœê›‘ë˜ëž–ì¨šî«ší°¤í·¦î¶©ë´¥î³£î·¨îº®ð¼ªî½¬ð¿²òÁ²óijôƶõȺ÷ǸöÆ´ô¯ð©•ázvÈKQ¬8IŽ$Ca<S
:S>XCt*O€.VÀ|ŠÙžœ¯dv~,Pk&JeFi$Kp*Nh"Fm&Ji!Fl'Jn(Ik&Hf@]@_BbBa>e@a<Y@ZEr+SŸ[p¾uwÂtvºmn¸hnÆ{vщ~Ԑzԏ~Õ’€Ñ’€Ò‘„ÐŽ‚ϐƒÐŽ|Б|ҏ€Ó“‚Ó•„Ó–„Ó“„Ò–ŠÐ”†Ð„ÏŒ€ÎŒ~ʈ}Ç„~}À„}Ä€x‚~À~|¿|v¼}¼z|¼||¾{{½{|Â{~½xyÀ{{Á{yÄ}}È~zÇ€~Í~yÐv΂|Ì„}®?N±HQ°BK®AL©CS¯@L®CK°?J¬<I¬@L©<L¥8J¢:N²FRÊVYØlfÞwmãlçzé“xë–vì—xìšzí›xìœ{îœzï›xí’ræ„iáwdÚfYÁNO¢:K‘0LŒ)H•-H™3J :L£=P§?R¬ER­BR®BP­EU°IX°EV²DT°BP°DN´FR±BN·@N²HPºHPÃLQÂOUÄNSÄTTÆORÊTUÌTSÊUTÈWXËUSÍZbÒ[Vâ–rÀ\NÍZOàjRíœhÐff»Wuª^Œµg…Æbs¾TaÈ\d»Udz"G\Lk,f…XˆZ@KBSFX†ƒJ~V?R:[DZHr,\†Ft‚<gt0\g"JZ>V>Z@dL[Ig(Mp2[S>\F†U‡`LY>|FvWF]VRLaE¶rxÅ_a¥;S¿w€Ý«šÜ‘~ݘˆÜ Ø™ŽÔ†ÔŠƒÖ˜Û±¥×³ªÖ±©Ø²¬Òª¨Ó© Ñ¤˜Å|kÀTZÍ`iÔqwÛxyß~€á†‰â‹â‰ææ••ç™’Ꙓ꜔ꞔ뜏ꛑ뜐좔죕쮞봤ﳡﶦ︦ð¼ªñ¾«ó¾«ñÀ°ôŲöȸôƸõÁ²ó¿«ð¬—â‚|ÆNVž,F}Bc9U:R:V?kGw"P¶xˆÙ£ ºq{…+N{,LdHn,Nm*Ne Ef Hk$Eo%Ho*GjCb>^>bBa@d?f!E^?TBe K†@d«bsÂrwÁrsºlqºnsÈ€|ÒŒ€Ò~Ó‘€ÒÒ‘ҏ~Ò‘€Ð~Ѝ€ÎБzÑ’€Ò’‚Ó’Ó˜†Ò•†Ò‘‚Ò‘ÏŽÏŠÌ‹~ËŒ}Ȉ~Æ|ƒÀ„yÀ}½~¿}{¾||¿~|¾{}Áy{¾{|Â{{¾y}ºwy¼z|Á{~ÂyxÆwrÉ|wÊ{xÌ}v±GR¯CO¯FR¯DO«@M«BN®@L®@M±>L¬AM©=J¨;I¤8H¯EPÊUTÖjfÞqfäƒoæŒxç”|ê˜yì™|ìš|ìœzî›zî›vì—vìqè†qâvdÚdY¿NR¤:L’.L‹*H–0K›6PŸ8N <O¤@S«BQ°FR±FR°FT°DR¬>R°ER²CP¯DP®BQ³BNµGT¸HQºJRÀLSÂQTÇPPÇTWÉTRÈSZËUTÊSWÈR\Õ†‡ã®‰Ö„dÀbPb:n6t:(=¼Zn²j•³d„ÇcmÅV]»LUÂRVž9TdJm.lu;g|KxL
-=NHb"XŒcv8iP	:Y@`Dk"Pp&OdDaDeJZ;V
;X@]A^DaHf'N_GTBh.`‚Oƒ^Kg&Zw7id$YQCQ>¢\hÍ}n¨DY¸]lÝ°¢àš„Ý“‚Ü¢Üª—Ô—‰Ð„~ҁÕ›—Û³«Ú¶²Ü¹´Ü´¬×³¡ÌŸ„¦PJ•*>¢:PµJ^ºQ`Å_lÍhsÐjp×ruÝ€âŒå“’è—’ëœ•ë •ë’ê™‘éšŽë˜Œëšì¡‘î¢–ìªžî´£î¶¦ë´¢î°¡í®¢ì´¦ï¶¤ïº¥ð»¨ðºªñ¾©ôðôôôðò¾­ð³—ꛉÚvqºDL…@p=a<W7T;T?lFw'W¤f{Û¦Á|…Š2Rp Dk Im&Jf"Jh)Pi$Jl*Ns1Rr0Ph!@d?]=a@`@e?fCY@XFk"Q•Nk¹ntÀtu¿ps·hpÀrrÌ…|ÔŽ{ӏ‚ҍ~ÓŠ}ÑŽ~ÑŽÑ‹}ÑŽ}ÏŽxÎŽ~Ћ|Џ}А€Ñ‚Ð’‚Ð’€Ò“ƒÐ‘‚΋Í‰ÍŠ{ÌŠ~ʈ€ÉŠƆ}Ä…Ã†~¾ƒ}À|¿€ƒÄ€~Á€À€~À}~¾{z¼yy¹z|º{¿{|ºy{¿xxÀuuÁuxÃvv¯@P²CN®BN®BP­DP­CQ±AN°BN°DN¬@M¬<J¥;I¦<J²DLÉXVØf_Þwoæ‚nèsê‘yí™xîš‚ìœ{îœ|ïš|îœxí–sì”pæ…láxfÙdXÀQS¤:MŽ0L‹-K”2M˜6OŸ3J :M£?R«AR¬@R°FU²GV­HU±HU°ES°DT°DQ®CT´FUµCN¶FN¹HRÀJQÂORÆSVÈSTÆSXÉVXÉVVËT[ÎY_õ¾›Þ‰i¦<A|;Q
9Q
<S
Ar&Q¼x”Р°×§©ÍVZ¶BQ«FT4LkEeR~?s{N‚g%UOFPKu7n–ršn0^Q	6`EZ<_DaF`G`Hf"OYAX?bJZD\Ah$Vt._k#VbOp.jy<ldRl0`XEL>H9…D[Í}q¯LZ¯N^Ôœ“ࠆߖƒÝ¡ß®–Þ´ ÒŽ†Î…€ÎŠˆØ¨§Ü³ªÜº²Þº±Ú¸§Ê€¬HP¨BW«K^°KZ¯EW©@NªBV›6I¦?U³K_ÃVfÒmrÛ‚ƒãŠèš“ê¢˜ëœ”ëšêš‘ìš’ê•Šëš‰ì£’ì¨—î° í²Ÿê²£ëªœí­ë°žî²£íµ£ð»ªòºªð¾©ô®ôÀ¬ð»¦î®˜ã’Övn¾RX3Jx@j:a8X6S;V
?iD{.^’Jeݪ¦Æ€…žLedIhCv,Qj$Ii"HiEm'Hr-Jm%De=_>]>b?dCb@fGXBZFx/W Wq¾ptÁvx¹pv¸gpÆz{Њ|Ր~Ս|э}ÓŒ|Њ}ЋxÒŒ~э{Ï‹z΋|ÎŒ{ÏŒzÌŠ~ÐŽ~Ґϐ‚ÑŽ~Ñ’Ò‘~ÍŠzˆzʇ~ÍŒ|̉{ÊŠ~ljlj{LJ~Â…~ă€Â††Ä€À‚‡¿~|¸z}¼{|½zy¾x{¼wz»w|ºx¸x|¶sz»rr¯BO®FR­ET®BR®EP®CQ°ES°@L®BL®AOª<L¢=N¢6J²BLÈWZÙj_Þyjå‚oè‹të’xì˜xï™~íìœxïxíœ~ðš~îsç‡mã|gÙh[¾NS¢6K-KŒ+L’0M—6Nž4M¥BT§<O«@R­ES°HV°DR«BS±CQ°IT²GT²DPµEOµCL´ANµGP¸FQ¼KRÁUWÃPUÇQVÊRWÈW]É[_ÈZ`Ñccð¤~Ò†r’6KtBe>T=gE Lk¾™ì•uâ‹fÂRX•+Hˆ-Mƒ+NhSj*c{Bm‡^‘RCQJb#^€D~pq6`M7W?R<g"Um3]b*R\Fl/Yc LV>dGX=V@XAr,\†H€dKt<vd(Ti%[f)_OAJ@n*LÂyp¾`d¤G[ÌŒ’ÞœƒÜ™„Þ¢Þª˜àº¦Û®œÐ‡Ï…‚Ò•™Ú®¨Ù´®Úº°Ú¶¤ÌƒxÈ[bÎdjØtyØrv×rwÌhsÂ]j´Q^œ<S‡">‚$@†$>š4H±FXÍjoÝ‚æ–‹ê˜é™Šé•é™Žç–‰ê—Œì›ìª›í¯žî²¢ê²£í¨œì«Ÿë­ î¯žî² òº¡ñ¸¤ð¸¢ð¸Ÿê­”ߏ€Ìrm¸X]®JX£<LŽ(D~=w:d
4[8T<TBdEr$U„=ZÚ¥¢Ì‰‹«YkgH`Bj"Fu(Ho*Kj#Eo(Il#FeB` EaE]?_?e<g"CeA\C^C„:\¬dsÄts¾px¸kq¶lú|ԍ~Ù’~֐xÓ‰|ÓŒ{Њ~Њ|ÑŠ~Ћ}ÒˆyÐŒz͈}Ή€ÎŠ~ÎŒ}Ë‹‚̍€ÎŽ‚ÐŽÍ̈}Ɇ}ɇ|ʇ~ÊŠzʈ|Ȉ~ȆzɉÆ‡‚ÇŠ…ņ„Ĉ„‚„ă¾}}¼|}½{|¾{z¸~¸wz»w|µrx²py¶pt¶GQ¯HV²DS°DQ±HP®DO®CN¬EQ²DO®@Jª>J¦<M¥9J°ANÉTT×g^àujãlèyì–xë™vî•vî›}î™{í}ïœ~î™ví‘xè„mâvcÛi\ÂRT¡9L-H0O–1N™8Pž9N¤:J¬=Pª@P¬DR²JV²ER±EQ°AN®@N¯@N®BP²@N´EP²ALµEN¼IR½IP½MSÁRV¿QVÉRTÈTYÊ`cÑnhØibÙlbß„m³XRvB`:N;RF˜LoÆovÆ\a£:I¤CV€ GŒ8T*SgTz?w|BugOVL\PyB|:{xMp|GtM	;QAXKr8cl%U\"Kh6_m.Xt0^Z@`BS
8T;Q
-:VBt6f|>s~Q‰U<y9t[HJ?TBªclҁx°KZćஙܑ~ݝŒà¨›ß·¦Þ¼«Ò›ŒË€ÐŒÓ¦¢×¶®Û¼±Ö²¡ÉqhÊT\ÔfjÛsuà{xÝuzÛpnâ‚€à~€ØlpÇXcµJY6L“-E†$>‚ ;Ž)A«CUÒprãŠ€æ‘†ç‘‡é‡è’Šé˜ëœŽí§•î­î® í®Ÿì©œíª í´¢î°¡í¬›ð²í¦ä˜Ðvg¶UT¥EN”4KŠ1M˜8S¦FX¨BVª?L¡1Dt:f;W=U>^?p%S~<Xؤ¦Î…Š´eto&KeIaBu1Rs-Kt&Gs+Ln$Cd?Y;`?^>_?d@h"GdD^DfL’Fb´p|Ãtv¸lu·hrÁtt΄|֏|׎|ÖŽ|Ô‹~Ô‹|ÑŠ|щ|Њ€Ï‹|ЊzΊ|ψvψ|̈~΋~ÌŒ~ÍŒ‚ÎŒ€Î|΍}͈|ÌŠ€Ëˆyˆ~Ɉ|ˉ}Ȉ|Ê‹zȈ‚ʈ~ËŠƒÊ‹…lj†Å‡„Ä„ƒ¿‚€À‚‚»|€¼|~¼{·x|ºu}³ry³tz³nt²BM­BR°GP¯CS¬JV±KV­FQ®FP±BL¯@JªAP£5H¡8J°BMÈTWØbYàwhã{méˆsì”yî›xî”sî›|ì™xï›|ðœzðœzî”xç…läxeØh\ÁQR¢:N‘,I1N˜1Mš8NŸ:P¤BQ¨>Q¬AR°JX±GS²BQ²DQ²BP³CO¯AP­:I°BO²?I´GR³DM¶DM¹JRºGN¿JPÀOUÂO[ÐfiÚ{vátÜojÝneÚ}j§VemE‚:Vp0SJB’Pv¿cqÂbo›1QŒ6RŒ7Ty"IhMp-b„M„t7p]R\Uv at w„Mƒ^Qh3Z”hšV@TDV@p)XcHSBWGn1`ˆKxk#OV8T6X8X:Z?_"Qm7VˆY‡YDh*UL7G6†>V΄vÊb`¿lxÜ« Þ—Ü—†Ü¤’ݲ ß¾­Ù³£ÐŒ„·†ÔŸœÚµ®Ü½®Ö¬”¾^YÄRWÐ\cÏ]`×kk×ijÑjqºH\×vtãƒ|ÝuuÍZbÎaa³?P®?P¦8J›2H•/Iš2KµGYÔhnãŠ„æŠ†çŒ†ê†éˆì–‹ì£˜í©œí°Ÿî°¡í«¢î©Ÿí¬ží¨™ë¢’ê¡Ö{t¹TV 8Mž=T¦Jb¦I\±UiºVcÍdjÂLN¸CJ¢4Bv=o=Y;T?[<t&V}/RÖžË‡Œ°ar}.OdBbCu2PgDo"Jr(Kp(IeB\@`A`=dAfAfDdFdIp#PRn¾rx¿ts¶kp¹jnÇ}{ÔŠ|Ս{֏~Ô‹~Ô‹|ÕŒ|Ò‰|ш~ÓˆzЊzЊ{ψ~ІzΉ{·{φxΊ|ÏŠ~ЋÐŒ{ÏŠ{ΉxΈẅxȇ}ʆyˉ~ˇ{Ê‹zËŠ€Çˆ‚ȉ€ÉŠ†È†…ȇ„Ç„‚Ã…„Ä„}¾‚…»€º~~¸x~¸uy²r{²qz°nz®AO­FT¯FT°FT°JV®FV®HR®BK°CM¬>G§:J¤6E¢4C¯CMÉVXØg\àv`ã€pêŠtì–xìšzï˜}ï˜wìšyïšwðzñ~í”tæ‡oâ|iØl`ÂTY§;L‘,H‹)G•2Kœ4J 8M¥>P¨AS°DS°DR±DQ®BQ²ER±AN³EO²BO²>K´FP²AK²AJ²CN¸DK¾JN¹GQ¸KU½LUÇTZÚxnށuÞ€yÞzpßvlæ…lØ …¯nqÅ|~¿lz–Fd¦bƒ¾U`Ôjf¢=Rp(Il"D[Kk$_{7o`™x0hp&fp0h‡X†n1fK@ZH‹[ƒe%TVEYD}=n\BP=RCh(VŒR}t-[T:U6Z
5`>\:V:Z?` Fr4fN
-8J:f!BÂ~y¾[`¶ZfÚ¦ Ý ‰Ü–‚Þ¡ß²žâºªà¾­Ù¦šÒ“ŒÓ–”Ú®¤ÝÀ­Îžˆ­JL¸BHÂJN¾FPºHM¾OPÁPNµKQ†<¬CKÔthÂP[¬=L¯BRµDYÂXi¸DT¼LZ¸AT¸EV¼DVÏ[bÞtvà~‚æz剃牂둉죗ð²¢ï³¦ï¯ î«Ÿî®¡ì¥™æ“‡Ø~|ÂZd´Wf²N`¶U]¶R\ 8IŸ9G²HN±AI™0B–/CŽ(Bz =y'HZAU>[Cw,Xv,PÑšœÎŠŽ°_jB[a<b@r/Ph Dm(Hp)Gl"Bb?]>b?d>b@f?a@_Af J‚3YªbvÁsw¼ru¹gm¼kmÌ€zÔ‹|ԍ|ÕŠ~Õ‰~Ôˆ{Ô†yÓŠzÒ†|ÒˆzшxÒˆv·χxЇxχ{ΉzΈ|ÏŒxÐŒ}ÑŒzÏŠwΉẅÿ|̆wˆ{ˆzʆ~Æ„~Ȉ€ÈŠ~ÌŒ€Í‹ÉŠ…ÉŒ‰Å†‚Ä‚~ƃ€Ä†Â…ƒ¿¸}~¸vzµu}³u~°oy°@T¬FR­ER®HW¯FR¯DS®BM¬AM®DNª<I¤<I 3G¢2D°?LÈXUØe`áugå€kèŒrí–xîœuîœxð™tð›zïœuîœvìš{ìvçˆvã~gÚndÅQU§<K’,EŽ(H–0G›3H 3I£@P¦?S­AN­BR²BR´EQ²BL±?K²BL°BK³@J´?H®;I³?J´BL³@K¶ET²N_¶Zt¾o{ÎpuÛtjÜ€rÞ‚xÞ€xÞ|pæhî–pãŠgá}à‰€¿Wa‡/Mƒ$D} @`A^2[]#Qh)f~;t^‘}>sdT|7vv3j‰[ˆg&XG>RCs<bv:lY@ZH€BrZ>R=R?[L{AkˆP~YBV<Y=\8a:]<Y<S:V<XLL
-5¢YcÏxr®JXАâ©ŒÚ–…Þ›ˆà©˜âº¨äÁ³Ýº®ÖªžÖœ•Ú© Þ¾­É‘}œ7B¤6E§7B 3B¤;H‰$=†"=„#:~6o5z6”/:w9m6w;š4G¾Va²AVÐ\eËU\ÍQ\ÌR^ÑYaÙfmÞtwâ|æ‚~ç}ꏈﰢñ¯œïµ¥ð²¤î®¡ï¬žë§–߆‚Ñno½`h·X\›5B…(=z8r7r:}>{@~"@‹'?‡ =ƒ,Dk8\;R:\B|1Yw&NÒ—˜Ë–¬Xh•G]hCaBt3Ol"Gp(Ll"Ef?a<`?`=`>`>d@^?U=eJ’Ib¸pw¿wzºquµhoÀvvÎ…zÕŽ~ՍzÕŒ~ÕŠzÒŠyÒ…zЇ}ц{ÓŠzÓ‰vÓ‡wІyЄyЄyЇ|Ј|ЈzΊzЉwΊzΊxІzˆyÎ…vÌ…zʆẍ}ÊŠ{dž€Ì‰|ȉɈ€Í‰È‰‚Ȇ„Å‚€Â€}Â~|ÀÁ€¾~º}¾z€¸v~¶w{±r~®@N«HR°DN¬DQ¯AP®DQ­@M¬DN®>H§AO¤8E¡8G›0E°>IÌVT×f^Þuhä|jéŒrê”wì™tïwîœvîŸyïœxí|í˜zì’tè†nâxdÚhZÆRS¦;J3L*D–*Bš2F 3I§9J¢=K±@O´DN²BL·DMµBJ´AJ´BL´<G°>L²?H²BL®<H²;G®=P´QdÂ{ŒÊŽÔ‹zÔqjÜwfàzhàrß|sâ{mâpÙxk·N^ÀT`Ãmu”<^^:T<K	;QHk8kt8s|:|ŠR‡–jšp&ak$]„G‰x4hŒ`d#VNDWDr4fq2a^MXB‚N~X?S
;P;RH`RŽ_…M„`MS:X9b:_8V
5P
6G>L9w3Qˇ€¾Yc¿lvÞ³¦Ý—‚ݝ‹Þ£’â³£ãÀ±ß¾®Û²§Ú® Ûª™ß¼¦Ã…o+<”*B’&<ˆ <r:v:o:o:l:j8j8l<h8f<a5]
-3k7€;»UbÔjuÔ\fÖ[aÕXaÕ]dÙhpÝnpâvuä}zæ‚}ìŒ‡í “ð®¡ð²¥ð¶¬ñº©ð·¥ì®™ä–†Êkf;H'Br<m7p8l8k8j8l=n?p<v?$Ay"A`6]=Q<X<2ZsIГ’Ó˜š¬^n–F[z/NbAq,Nn(Jn#Gl%Df@`:`>c@^@d>fCYBR
<bGžTi¿txÂtq¹mp¿klÇzuЈ|ÔŠ|ÔŒxÒŠ}Ò‹|Ó‰vÓ‡vЈzІ{Ñ‚vшwÓˆxч|Ò†xÒˆvχ{Їyω}ΉxЊ|ЋyЋxÎ…x̆vË…{ˈ|Ê„{ʇzɆ}Ç…{Ȇ~LJ€É†‚ʈ„ƈƒÇ…€Ã…€¾€À€¾|{¼z»}€»|€·z~¶wzµuz±s|¨>N¬DNªBN§>O¥DQ¨@Q«<K¨<M§<J¤=Kž4E™0F˜0G©8FÄOPÖdZÞtfäkèrì’uíšyðšvïžyìžxð|î›|ð™xìŽuèƒiäwdÚnaÃRR¤<L/J‹&A“-Dš2Hœ6E¤6H¢4F«@N¬>L²HQ¶BM´@H²>J®>J°@L­>K®@L®;I¬5Hª4N¯F^Å‚–ØšöLjáz^×l_Þvfàvfá{pâ~rá|rÙzwÀfr“B\lF‡<X€.PR<G	@RMzG‚ŽXŽz3kz:pb—t1_€B€t1i~@~|By“oc"UMCUCu3fXAq/h[I‰W†[@TAR:O
-;RDj,Z_ŽZŽm,_P
-5Y
5`9\;J9F<U=³opÅnf¹VdÚ© à ƒß”€Ü †Þ¨™á´¨â¶ݺªÝ²©Þ³¢Ý¶ŸÆwŽ*=† =†<w6n:n<k:l=i:g5c9d=k&KŠCY„9Rm?Z7Y9_
6ƒ>¾KXÓfkÕ`eÔZbÖ\dÛdiÝklàrxãxuåë†í¢˜ð°Ÿó»­ó¼¯ó¿­ðº¥á ‹»[Z†(BjDd@eCk>~(F|(Do=h<j=oAl Bp>z<l8d8_7U:Y?v)SqFÌŠŽÕ˜ž­[n”H`v,Lo#Lp*Ln&Jl$DkAb<[<`=c<b?eAbCZATBr$Jª^lÄy{ÀspºntÅstΆ~ÕŽÔŒ|ÓŒxÒˆyÒˆzÒ†yÏ‚yчxЄzÏ„zÏ„vц{уvчyÒ‰y΄yÒƒzІyψzЇ|·|ψsÎ…{̇xÉ…y̆{̈zÊ„zȆ~È„~Ƀ|Ȇ†È…€È…€Ä„~Á~Á~}Á|¾||½~|¼{~½z|ºy}¶x{¸x}µv{´s{¨>L§=L¨AN¦<J¥>J¨@N¦:H¦;K¦:HŸ8Iœ6D•,B’+E¤5H½PTÕbWàrcä~féŽsì˜wí›xîštîšrîžvï›~îœtîšvìnè„häxbÙe\ÅRT§8JŽ(CŒ&C—(B2F¡6J¤:J¦:J¨?J«=J°>H±BN¯<I¯<I°>L­;H¯>Jª9G¥8G¦0H¡.NÏ„~í¸šòµˆøºtÒZQÙnbÞraàveâlälÈadÁox°^o‚-Mz-Sm@X@JDLEU‹^l'X^I†YŒd)SXOx<pBwz5vŠ_Ž”l”XJJ<XFn0`TFd$Ti&W‰^ˆf!KXE[>T:T=TCm4_V†Gty:pgOZ6U
-5J;H
-:H]Í‚z«HWÎŒŽã²™Ý–‚à›ˆÜ¢“Þª–ྰàÀ´ß»®Þ³§Ü¼¦È{Ž*@”)B‡!>u7g9f;i7k:h:i;]=hCtJŽFf¿– Á–§ Xpt$E[
7Z6a:*GÊXXÕbdÔYbÙZ\ÜbjÞejánoâuwç}zꊄð²©õÀ­õµôŭ篖®PVj=aD\C^Lp!K2dœWv®k~—?Vk<^
5f8m>p?n>c7h:a=V;^@{.WpFȆŠÙ¡ž­`rŽAYt'Jo Hv.Ps-Km"Eg@a<^<`>b<b=cC^>[E_Gˆ;Y¹jsËxvÄvu¾orÈ{{Ί|ÕŽyÔˆzÒŒ{Љ}Ò†xÒ‡zÒ„wÏ„yЃvÏ‚zцyЂyÏ„vЃuщЃzσyЈzЊ|Ά|΄|ΆzÏ…zÎ…yÍ„tΈ~Ά|Ì„|É…{Ç…|‚|рĄÆ…€~À~Á||½||»z|ºy|´u}¶u{¹vz¸w|²t|µt|²qx§>M©EP¨BQ¦<L¨;J¦?O£:M¥:J¡:Hž5F˜0D“1E”)B£5DÀMNÖe[Þsbä€iéŽví™sî›{ï™xïxîœ|ïœ|ð|ïšvëtæ„lâvcÚfZÆSP§:HŽ*D‘(D˜,F¡4H¦5J¤<N¬>K­AN¯?K°?K²?M³=H°CL°<J°BK«;I¬8F¨5D¦3J¢0Oáv誘õ¹…à€hÌ^\×lcÞteâzfähØrk¢C_Êjpº]l|+Ox$KO
>RIXNp>pˆVzk#VVF{Izs9aJ
BNHv6lŽ_—‡F}‰YƒDpVHP>WG`FT>XHWF{Onx<h\D\AW:\>[AZ?bBW>b)Ls7abHT
-:K=a@Áxw¼]`³\n೥ܘ€ÞšÞ¦“Û¤—Ù¯§ãĸ࿳໧àÀ©Èš‚˜7E4D”*B|9g8a7k?†2IvAs"BpDT	8d@0W…8TÖ®¯á¼ÀѨ®²~ƒ+Ns=˜;Z‘(GÀOTÐXbÎR[ÔV[Ü`gÝejànrßplå~{銃ð–ô¹ª÷Ǻö̵ðèÂoc|AbB`CZF\Jx*NªxŸŸ[sȏ¡¶fv‰*Id9b7j8n9jAd;d;_<T6`@~-TgDÇ‚…Øž™°^t–BY‚8]q(My4Rp%Ho&EfBa;`<`;d @bB^>\@WBl"OPfÁryÊztÂtt¿pqË{ÓŠ|Ô‹zÕ‰|ÓˆzÓ‰zшyщw΂wЇzÒ…|уtÏ„zЂtЃxÏ…zΆ~ЄwЄwΆ~Ï‚x΄yІuΆ|ˆ~͆vÍ„vÌ„xˆ|Í„{ɃzÅ‚}Ɓ|Ä‚}Æ…€Â‚€»}€»|y¼zy¼yx¸vzµtz´w{µpv²t|¯t|®q{¬s|«px¬DNªBN©AO¥?P¦?L¨@O¦=N¥;K¢6Kœ4E™2E’,B‘'@¡8IÄPQÖf^Þr`ã‚kéŽrî›rîžxížxí™yîžvðŸxî wéšä„nâxbÚdZÆRP¥:L‘(C“)Aœ0E 2E¨;J©BP«>L°@K²BJ°BL¬@M­>L­BN²EL¯BK®?L­9H¨9D£4G!F¶[]ࡔݦ{Þ¨”ׂÖvpÝtlâxjàxiÐkmº[hÜ{hœ8Rc@dALE^TFzDr\FXGo2hp0Yd"XPKYRx:n”d™|;s†[ˆ~>o^KUBV@U>V=ZCSEk1S‹Y‡e"M`DT9X>Z=^E\=U7YAVFR@^Rr(g–NfËvm¬EWÖ¤ã¬’Ü–…Ý¢ŒÝ¬™Ù¯¤à¾²â·àÀ±âÀªÕ¬”¢FN¬AM 6F‰"?s;g8k:#B¡IY‹1P|/N‹>`lEt(HCeo(PÒ®½ä¿Ä潾ܰ°¿n~•&H¸LU¶@T¹@IÊRXÆLVÌT^×ZcÚdkÞghájpç{v쏊ð§›õ½®úлôвۘ†¢>K‚(HgDz0NbCdCx+OŽ?d™TrÔ›¥Ë|…¢9Jv>a8g<g6i<b;b:bDX@d@~3\gDÀ„ŽÖœ¶n’4N‹Dfs*L;Wl"Fj!Dc>b:`>a>a;`=Z>Y@]I}0Rª^pÆvvÈttÁssÂstÏ„zԌ҉~Ó‰xÒ‡{Ôˆ|Ô‰yΆ€Í„|Í‚xÒ‚vÑ‚vσxÐ…vσyЀvÒ‚sÑ‚yЄyÏ‚vÍ‚w΂xÏ„|Ï€vÎ…{Ì„zÌ„wË„~Ì„zÈ€{ƁzÁ~Á~|ā|Â{À~~¼}€¼z|¼y}¶z~¶v|±s{²ov²rx¯oxªovªlxªo{°vz°ANªAQªGT©=L¨CP«>J¦?M¡<K 8K›;K˜2B•,D&?¢4F¾OQÕbXßrcãnêŽtî˜vì›|ìžzíž|í yð¤ð {ïœ|ì”vè†rãu^ÙfYÈTR©>K–+B”*C›1G 2Fª>K®AN®AK¶DL¶CK³BLµFN±DN³GN°EP²@L±FP®@Lª<GŽ(BiB—MRÆ•›Š2O«^Tê°’ç­œâŠ|à€qÛzk´Q\‹,D‰/E^BP=RGWP~Gz‡HtfQSCm2ip-a`Pt8nZNaYzEz’^˜|9t•v |=mXCSBZD[BZCW<PAcL’dŽp(U[?Y?X:Z;`D\8X5W9R7L@L>j(N¤^{™@Z¸l€Ú¥˜Ò‡‚É€ƒÍ’“צ¢Üº®á¶ÝÀ´Ü¼©×±š°Z^°GWÂR^³HV¤8L•2H{<l6‘&F¨HS«Xlz'J‚6V‹;V‡7WwJšbŽÜÇÏçÇÆêÅ¿éÀ·Û”®AZ¨6IÉR\¸:HÄHTÄJXÉP_ÓT`Ö^`Üdmßqt惀쒋ðªžöóøθîŬÊpn£<P§Rj|&KE`Ž=]‰6RŽA^{$N°r•Ú–Òzƒ«AN~ <h3`3b2f8^:`9^9W=fB~3ZcFÀ|…×¢œÀx‚„2QGbz.Q„@\hDm$F`>\8a<bAeBc?^@ZBbEŒ?[´joÃxvÅtp¾npÃyzÍ„|ÏŒЉ|ÓŠzщ|Ї~ÒŠy΃zЄxÍ„v΄vÏ„uË‚wÏ€uÌ‚|уvÑ„zÒ„yІzσxÌ„vψzÏ„zЃtЂvÌ„xÍ€yÊ€vÃ~xʁ{Æ„|Ã~{Â|Ã~zÀ~{¾zz½{}»vxºx~¸uv´ps®nv°os®jrªmv¯py²z~»‚„ÆŒƒ¯FQ©CP©BQª@JªBN«@P¥BR¢8JŸ=Mœ8G”0B‘*BŒ%@ž4F¼MRÔb[Þsdãmèrì—xîžvïyîœwñ¢zðzí—xç‰oãv`ØdZÈSQ­?J–2H˜+Eš4F¢6Iª:J°@K°BL¸DL»FL³DK¸EK³JW³?M¸FSºJQ»YU—1B}9q:^?l@ƍ¬c{˜šç©”úÉ¢õҾꮎ°TTbGR>TCSAOBXKx<n~:hi Pe"\cWq0fi*bd!Up/am+gs0nˆ\”b™‚=y™zš€H~RDVA_H[Bd#MXBSA^D}BghF\=bEZ<X:a>^<W9P6Q<PHVFœZnªUb˜H`Àš¦ÆŠƒÍ”’Ô ’Ü°¢à»­ßÀ³Þ¼±Ü¼©Ø²š²\_µN\ÂT\Í_dÈ\hÇYdºQX <Ov8=®EZ¹V^¡Rl}.RrHy*Xš^ŒË±ÅçÁÄíÁÀ첦áˆ~Í_kÂBTÐWVÆKVÈKSÎV`ËNZÑTcØ^fÙgnàpp傀씌ð¶©ö̾÷Һ輪½S`´M^Àlv¦Wyƒ4RB\‹B`€.X›Y…Π±Ü”Òq~ª;L€=m5j6j4h6\7^7Z;Y?o)Jz2ZeJ¹u„Ù š¾{ˆ€0T‡@b‚6Uƒ<ZhCfA`<bBb@`>i$Fc=\:Z>dC—Nd¼ryÅytÂut¾tyÊvÑŠyÒŒ|ÑŠ{ЈxÒ†yІ{Έ|Ì‚wÏ…vÌ€xÎ…z̓vÍ„{΄|΃wρyЄw΀yÐ…xÐ…x΁x̓zÏ‚yÏ„xÏ‚vÌ‚w΄uÈ€zÅ}xÄ€zÆxÃ}yÁ€¾{{À~z¾x|¹sw¹t|´tx´r|±mt®oz­lt°rw²y}À„{ÈŠ‚Д…Øž‡®@N¬FQªCP­BNª@LªBN§@N¢9J¢;J›:K–2F‘*CŠ$@ž6F»LSÔ`Yàubã~nèŒrî–yížvïŸzð xðŸ{òŸ~ðž~î•zè‡oâxfÚdZÊRP²>M›0Gš1H 4I¥8I¯>JµCL²EM¶GN¶JP½HO»IP»HNµEL±?Fž3<„)<l<2[z$P‡<_§_|И”Ë‚šç”ˆî¸£ùïÑôݯ´r`h!Lm0jM>R@M?TJs4nŠK„|;tq5nh(aZKl0jv7ny<s|:r€Dys/hŠb•ˆU’s0h–tžˆX_L_K[BV=cFZ<X;_=f#H]DbEfFY=\:\<`>Q8N:J	8RL„D\Âwx¢BVÀ†Ú¨šÕ‚zÜŸÚ¨•Þ·¬ß¼²Ü¿´Û»¨Ôª’¶ZV¾R_ÉVaËR\ÐVdÔhmÖjoÑcj¼Tf6R—2N³@TÀQgÂez´a¨Z„³u’Χ¯á¸ºå¿½îļ析ÜmpÞsoÓ\gÌNWÒ_cÎPVÍNXÒU[Ó[dÖ[dÙ_hÝinä~똒ò¾´÷ÔÅõһ⮞¼P\¬<Pµ\hÂp‚¦`•Hv•M~¦lœÊ¢¶Ø «×’˜Îgp¦:L€>m9n;n6o=c>Y<`C_Br,Lu+RdL­cvÚ£Ÿ¿„‹‡8\†>`‚>^€;Vl&G`>`>_>];^=k>f>\>Z?n(M£Zf¾uxÂssÀqrÂtt˃ÒŽ~ЉzщzÒ‡wЇzцv΄|Î…w΄vË‚wЂx΂wÍ„zΐƒÌ…|ʃsÏ…x̃|Ï…x·{·wÊ…z̓y΃z΁xÊ‚zÌ‚sÉ€wÅ{Ç€xÆ|wÂ|y¼yy¼yzºxw¼wvºyx¶qv±qx²nv®lw¯tz»~{Ň|ʏ€Ô–ƒØž„Û¢ˆà«‹¯DQ«EP®FPªAN¨BN©BN©@M¤8L¤8K:J•6G)@&A 2GÁPQÕcYàsbä€lêŒsë–uíœ|î uî¢yï¤|ð ñ ~ì—vê‰qã{jÚg[ÊWT°@N4I™5J¢3D¨8I­<J³AMºEN¿HP¾LT¼IRÀJR¿MP³]bp8^7b;tHžSl²k‹ÇØ~„䔊߫­áŸ’óɤʔk|<CXKYKH€SMVQh)l„P’šo¥ŒZ†{ApP>OCPDuB_L‚Byw6mr2lt8x‹j˜’g¦k(dœƒ°b|>rh"Ke$VR=[>T
-4V
8]A^@^Ag GdB`A^=^#C\>R6J7K<e C¼ru´MX²]qÞ·¯Ûš‰Ú•ˆÜ¥—Ü°¡Þ¿´ÞÁ¶Û¾ªÑª”¬OQ½LVÊX^ÍZdÏ`eÒ[bÙkmÚrxØnsÕhlÅ^k·HX¯B[²D^ËSdÐdnÑt€Ø€‰Û‹‡Üœ›ã¤¡é¤Ÿæžœàž¥Ú…–Úq€Ð_rÒ_hÖ_bÔV\ÎQ\ÏQZÖZbÔ]eÙXbÞovå~€ìš•ò¹­øÕÇóÒÄડÅj|´Nm°LoÄXpÌs‡ÃtÉz”щ×‘žÑ†Îpr¾HP‘*@n4{#@{">t<r?d?[Bc"K`Fw2Ks*RcK©dzÜž—Đ˜—Gb†;[ŒHcs$Fm"JcDZ:^AZ8b;h>b>Z8dC†8V®gtÀxwÀsuºnrÆ{ẍÐŒ‚χ|ΆyÒŠx͆x̓tÎ…yÌ„v̓xÆ~z̃z΃vΆ|ÏŒ‚ΓˆÌƒzÑ…w΂xЄzΆzˆ{́ỹwÌ€vÌ€vÉ€wÊ~tÅ~yÃ|vÄyvÂ|x¿zx¼yz¸t{ºvy¼xxµst¶qx²nt´tx¼}}ƍ{ГÖ˜Û¤ˆÝ§‰àª„䮇粌°JV®IQ®DR­DR­IT¬FN¨>K¢9H 8Jœ1F˜0D”-D$>2D¿MPÔb\àsbä‚mèŽtê–wî™zðž{ï yñ¡€ñ¢|ò¢ñ {ðšwê‹pä{hÜk\ÈUR¯@M2F›1F£7H¬<I±>I´FP¶GQ»NR¾LR½OY¿KSË^P«XY\8\
8ƒ*P¡JfÆ…ŒÍ‚ˆÃwŒÏyˆÌr‚ΊÛ¥¡¬ifb CY RTNVP{G|‡PŽˆPŠˆW„}Erl/Y|Gx_MJ@MC[N„X’UJ|H}v6pl,kv8x‡Y‹v«…G‰¡‡¯‡R~~Bwn1ar9hSAY@S:U<Y=]@^?a@]=`<`A[?Y9O
-4J
-8N
-6—O]Érl¨>UË•–ଛړ„ÛŸŽÝ®Þ¹¬àöݿ«Ò®š¯LN·DNÊP\Ï_iÒ^hÔdmÕcnÙjqÜnuÝosÙpvÖkqÊ\hÊcrÎ[fºGXÆRd²>QÅ[lÒgpÈfiÊnlÄdkÒ~ˆØ‘œÛ—£Ü›œÞˆØnqÒW`ÒV_ÎVbÒZhÖXbØ\dÚ\fÜkqãzzé—’ð¶¯öÕÊôÖÊæ°ªÞ˜ÖŽÎ€ŒÌp~ÖvÍdpÈ]gÌnrÆpr¬JTŸ4F“&>€<t<—8JŠ-Av<t@eB\=e"HdEv0Mq#J^K¤\uØ•‘Ì“—žVn}3TD`u,Jp$F\>\>`?\<e<l#G`BbBy<X˜LcµjtÀux¾mnÁopÇ|wÑŠ{ЊχxшzчzΆ{Í‚yÍ„z΃xÊ€xāz΂zÍ‚zΆzÏŒ„Ê’‹È„{̓ỹ}Í„zÌ…{̇zφz̃uÌ‚zÊ~tÄ}xÇ~uÇ|s¾wv½utÁyv¿xv¹tx¸pw´uz¶uy³tzµrw¹{|ȆwÓ“~מÜ¥„⨆⬅䯈它氆贉´CP®DP°HW®HU«BN¬DQ¥<N¢9I¤4Gœ4F–.B’(@$?œ0B½HLÕc\às_äqèŽoê˜xì›}ï}î¢|ï¦|ò¨|ó£~ñ¥}ð—yêtå~mÜhYÌXT±BL™/Fœ0F¡6F©>K°DL´DN»EKÀLR»KVÁKOÂFPÊXJ´hciA+K¶bvÊlyڍˆÌnƒ²j†®jŒ®cÀ~}ŸS`j&Vn-`e QZF\RaRf–^–n,d`\„V}IyRFRDTJ]I‚R‰`$ZwCtJTSn2nˆY]“‘[–™sŸDˆVŠŽrŸZCR<\AW?ZBX;\<_@^>[9_C`>V5T4J
-5H	<p)IÂwv¹JSµXcÚ®¢×‚Úœ‹Û¨—೥ྰÝÁ¯Õ²š¨IN¯<LÅJXÐZdÔblÕdtÚnrÙhpØnsÛpzÛptÛnvÚqzÙqvÚquÓcmÄTbÌZfµF^È`nËjvÀcyºYl¸\xÉ|‡ÒxÜ‚„ÞƒƒÚvxÒfsÌVdÐT`Ñ\jÔ`mÖX^ÖYfØXeÚjrãvyꏍﰪ÷ÓÈôØÊ涰ޑ‘Þ~×tvØlnÑjm½Uh³Rj´Tl²Qa˜8X‰*H†&E—6N™3G4F”)?x7v:e:]7eBdD7Tp)O`P¤VrÖ””Ðœœ«d{~/TŽH`x+Ig>`@^>_?Z9h@hA]?dB„8S©]m¾tx¾rr¾mqÁvwË„|эÔŒ{ω~ΆyÏ…{ІyÏ„t΄{ʆ{΃xÆ„€ÈxÍsÍ‚wË„yË‚yÌ‚vÍ…zÈ€zË€x˃vÌ…|Ë‚{Ê‚zÊ€yÈ~xÂ{vÅ|tÄzvÀxr¼xzºts¹rs·sx´tt²q{¸rwºz}Ɉ~Ï’€Öž~Ü¥„ુ⬇泆沆糈汆汌籈³DR¯HR®GP®CN¤CQ©BP¢;Lž9L1Eš5G•0D)BŠ%>˜+@¼JNÓaXÞrdä€léŽpë•{ìœ|ðŸxï xñ¤|ñ¤ñ¤ó¤€ñš|ëŽxå|hßjZÎWP²CJœ.Dœ.E¡2D¥9F°>K´CM¸FL¼KQÀPS¿JPÀFP¾JWÊypªap´pÊr†¾d‰»tÂŠŒª^k‡8Xp,Sy4^…Gmv2^_JW>PAWLONh5g—{©•l­‰X˜šs§‡KŽ~KŒd"W^ TO
FxCsg'bn2e†Xj,lh6l‚Nˆ„Pˆ–l¥™n©”k¢•|£d*NP>\H^JV<]AaBZ:`B`@]>_D^>X8N
-6D4S>¬foÉqk®FTË‚†Ö™„Ú•ŠÚ£•Ú¨Ý»°àò׶§NM¢0B¿ANÊPYÔ\dÔbmÙguÜrzÜoxÚs|ßtzßx~ÛquÜlpÜppÝwwÚkrÖjqÚhkÑ_jÓcnÔjrÓkxÌjxÔx„Ø~†Ü‹Ú|‡ÚvØz‚Ôw}ÎYhÓVfÖ`j×bkÖ\dÖZcØVcÚ_nãx€êŠí²¬ôÏÅöÙËé¾´Þœ›ÚˆˆØ}€ÖoxÓdpÐ^jÏcpÈ\iÊ^i¾Qa¤>K¢4K¥>L©@J¢=I˜/?|8y8_
6`8c<fBy-Ln(P_LžVrÕŽŒÖ¤£³m€€2V‡?\r$F^<d@\9[:\8q(Dd<Y<a>‹>[²jtÁrs½mn¸hpÇyu΋|эÒ‰zω|Í„yφz̓zÏ„zË€x̓ẃxÈ…ÊƒyË„|Ì„xÌ€sÌ‚xÌ‚vÈ‚|É„vÊ‚{É‚|É‚vȃzÉ€uÇxÇxÀzvÂ~x¾yy»vu¼xy¸vw·ss¶tw¹ptµpy¾~}ÎŽ~Öš€Ü¦‚஄氄洂贅鵇泆贇賅氄粂®CQ©GTªDP¨CT¤@O¢>Ož9Iš5Iš2E–6F‘.C‹%A„:™.C¼FJÓ^WÜqfâ€rçwì–zí~îyï¢xñ¢|ô¢‚ñ¥€óžzñœ}ìnä~jÝm^ÏZS´AJž,D™,B 4H¦<H®=H²CJºFL¾HM¿HLÀGLÀFN¼DTÔ`U΀‡×w€Þ‘ڍÉpyªRm‚4^l3_j+X}8d„@dj'TRDRB^#YZJYN^Wn6h›}®šv°”hžŽhšS€d!Q\NMFh+[u6nf&aO…ŒS”{E}p4ir3k‹X’‹W…›{¬„R}|>tm-]h#RX<\<[<]>\:\;cB\?\;X<P6P
<I	:}8OÍ~r¾RW¿\bÛª›Ø”†Üž‹Û¬ Ü¶ªáıÛÀ¨¦TNž/G¸:JÅJVÏS[Ò[gØfoÛoyÞu|àz}ßz}Þwxáz}à{~ß|~ÞyzÞttÚnrÜrxÜouÜlpÚoxÛq{Üz~Ý}†à‚‹àˆà‰ŽÞ…Ý†Þ‰ŽÖovÒ_iÖ_l×dnÙdmØ\gØWeØXdÛZhâr|荐óɼô×Ìëĺતޛœß‰ŠÞ€„ÙszÙlsÙhnÒ^gÏ[cÇV^ºHT¹FT¯HTµIO­BL 2@~8{ =_9b<f>hFs*Fn$N`PšRkÔŽŽÕ¡¤¶p„2T}2Rp$DeBg@`F[@_;o(A`;V;c@–I_ºpuÁqrºnp¼lmÉ~{щ~шxЊz·~Ë‚zχ~Їy˃|Ë€xÌ€z˃y̆zÌ‚w΀vˁzʁyǁxÊ‚vÉ‚yɁxÌ‚xɃ|È„|È~zÇ{xÉ~uÇ{tÂyvÀxv¾zt½z|¾ttºrs¶rt²mx¸tz‚‚Ó—„Û¦„ᮈ䲅趈귃뵆궆洆泉貇賅籄鲇°DRªBP¦@N§<J =M8Iœ6F–4Fš2E’0CŒ)A„;w8%<µEKÒ`ZÜqdã~nçŠtê’vìšxí yð¢yð¢~ñ¤ñ¤‚ò¤„ñšyêŒpä~fÞmZÐZP²>Gœ.Dš/B¢6G¦8Fª<H´BL·DL¾HMÂJNÁGLÂGM¾ISÁNZÕkg׋ˆÏyƒºXo¯Xo–Iik'Tf"R}:iŠJxp/\^NNETKq8pdTn-fq2n‚I„„NvGxuCr‚Pk/^XDTBPDb Vp1fh&d^"YˆZ’a£ƒPŽ‹U“‚I…yDv…W„j0[M~`F`BZ@X>X;Y9[;Z<aB[BZCWDP>J
@Z@¶opÉe^°FSÌ~†Þ¡Þ¥”Ü«ßµªâóÞÅ®­hX“&>°:GÀHRÈLVÐTYÔbl×blÚlsàv|àz|à|€Þ}ƒâ„ˆä…ˆå„‚ㄈ⁅ßy„Þ|€ÞŠß|€Þƒˆá‡ˆàŠâŽã‘”áŒŽâ–á†ŠàŽÝ„‡×ktÕ]kØckÛjrÜchÚXb×ZhÙYbÛYjáqx劌訪ñÉÂôØÌëĺ⮧⤡ߎß„†Ü‚Ûx|ÚqwÕ`lÓ^fÏ^hÎVZÅPZ¼R^¾PY´JS¤8G„<|=c9h:f>p"Dv,Jn&N\M–NiӍ’ק¨´w„„7]~6Sr(Jb>f=Z<Y7c;f:Z9ZAl C¢We½tvÀqs¼nt¼qrÊ€zÏŠ~ÑŠ{φ~Έ{Љ{Í‚zÌ„xÌ‚zÍ‚xÊ‚yË„{ʃ{̓vÌ‚zʃxÌ„yʁyÉ€wÊ‚xÈ‚{ÉzƁyÄ‚}ÆxÆ|xÄ|tÄ{xÀxtÂyv¾wx¸yz·rv´nr³mpµqtƈ„Öœ‚᫊消鸈까빂븄鶄궂鵂貅貄賁贆賃ªDT©=K¦9J£8Jž<N›6L™2F–-G–1F”/CŠ&<†;€:Ž$>®AKÑ_ZÝqdâ}hçŒvè•|뜀îŸ|ð¢ƒð¢|ò£€ò£~ð¤ð›wêŽsä}fàkZÎYP¯@Iž4Eœ*A¤2D¨9G²=G´@K¹HN½LT¼LP¼KP¿KT¾JX¾Vf¾]w¸^z¨Op®Ri¡Efy-bz?{ˆKQr1_\H_NUJ^MzBzq+f„J‰Ž[–a~@u\Wq5i‡R…f#TI
?ND^Tb[w at q|Aw\ \W V•r¥†²Œan,dt at zyAx—Œºn9_QBX@_B\>]AZ?Y:Z@\D^HZHUGNFPEŒEVÎzk²ETµXfÖœ•Þ Þ¬Ÿß²¢â¾¬àÊ°´o‚!>§.Bº?LÆMSÍQ\ÓV^Ö^dÖfsÛiràuxâw{á~‚ä…懇厌懆勉甊䔑⌋䊈⌊㌌䖓◓㔏㑐⌌䒏⊊ፈÞ||ØjrÙflÜopÛkpÙchÙ\dØ[aÚZfÚYgßov厎騪òÇ»óÖÌíÊÀ䱧ᥝߘ—Þ‰ŠÜ€Ü|€ÚxyÖjsÖdlÔ^hÒY`ÊRbÃRa½L[´HU¦<M†:x>g:h>h>s#Dx&DkEXF’FdÑŽ—Þ¤ Á‚Ž„3Yv/Jp"Fb<g>X<Y9f:b:X8[:|+M­`h½qr½nl¹nsÄww͈~΋Ï†|Ј{ÒˆzÎ…{Í„z̃x΂vÌ‚zȁ{Ë‚{Æ€y̆xÈ„}˃yÉ‚xÇ~uȁxÌ‚yÈ€xÈ~xÄ~vÀ|Ã}yÇ}|Ä{wÀyvÁ{u¾zv»xt¶ss´pr°ovµrtÆŒØ ‚⫇赊꼌컈빇붃鴃굁곂沅贆贂粅괇¦<N¤;K¢:M 8Jœ5Lš4H–5I”.F”.F‘.EŠ"<„;:+C°?GÒ^XÜl`ã|kç‹tê’xìš|ïž~ðžyð |ó¥xò¢~ð¢‚ð˜vêŒpçeÝm\ÎZT±CK0D—-A 1A¦:H®<F²@L·DL¼HMºKT¾JR¼NZÀN_ÀVm¬P|¤L}¼n˜¾w  d¤žw´¨ˆ¸¡v¢„Jye$Ud S_QcXn*_ŠTŒv2jeœŒXŒŒSˆz7wt5r“g™{@pN>J@QFZKe&_ƒJ„•dšz@{l2nl4jwDvŽd Hb¡š¹Žfƒf$Rh&Mh!G`D^B^@]AX=X;ZDWFXHRDNGeD¾xsÃ_Z²JZË‹‘ÜŸŽà¨•ß´¢à¸ªßÁªÄš‡w=&B¬5E¿FRÈLSÑV]ÒW`ÔZbØhsÜgqßprâx~ä}}åæ…„æ‘Žæ‡†æ‰è”Œè˜‘ä”äæŽŒåæ”Žç”ã‘ŽæŽ“ä”“â“âŽŽàƒÞyvÚltÛhoÜntÙfnÚ`bÙYdÖ\fÚY`ÙU^Þfr倅訨ðÁ»óÖËðÍÄæ±ªà¤šàž™ßÜƒ†ÝzzÝtxÚknØdhØbhÒ]fÒW_ÈVcÆS[ºNU¨<L‰#=t<b=h<p Br>z-HoCWFŒ?`ÒŽ”Ü¥œÇˆŽˆ<]r&Fm A[6jB[A\:d=_<[<c@’?X·fk¾vt¾npºntÈ|xЊ„ЍvЊzφ|ψx΄x΃~Ë€vÌ€y˃{Ê„{É‚~ȃzʃzÊ‚zʁxÌ€xÇ€wȃyË~sÈ€{Æ~vÆ~xÃ|w¾|wÂxxÄyuÀyv¼uq¼us¶tr¶st±puµtvÆ‹|Ùž‚ã®‡éµ‰ì¼‰ì¾Šî¼Œí»‡ë¸†ê¶궂괁豄簀鲅鴂絆赌¢:I¢=L¡DQ:L™7J˜6L–5J’3F.C,C…#<:{>Ž(?­>JÐYVÙncâ€oèoì•|ëœzîwïžð ò£zñ¡xò ~ñ™uìŒoæ€iÜlZÊTP¯@Hž0C™,B¡3E¢;J¬;G³>F²>KºCT¿HX¼Qq¾\Œ¹n »x«°}´º‰ºÃ‰­»’¯žy˜Œ^~ƒVvz?ki)Yd!Rf%Tl-`e Ux;n„M„u6n‹_‘‹W€A{ŒX”’b„Fu[HL?R@O:ZJUN_T{Dt‡NŒ‰X’Œ\˜€MŒ~>x˜|¥œ°ˆ\‡n.Xš\}™Hc‹9Pƒ3TR<WB_BY;WAX@VDRCLBNF”RbÐ}p­EW¸XcØ¥£ÜŸ’ß´¢Ü´¨âĮҵ›t/B{:˜(B°:IÁKXÉO[ÐS\ÔYaÖ[b×alÜipßouãy~äxwåƒç„†çŽˆè‘Œç„è–ê™“ç”‹èœ–ê™”æ—’ç”‘åå‘‘è™•æ™“æ—âŒà€€àxyÝruÛkqÞnuÚksÚcj×ZeÚ`iÚU]ÚV`ßbkä}‚袠ïÀ¼ôÕÌðÐÅé¸­à¡˜àš‘á˜ŽÞ‡†ÛxyÞptØjqÚfiÖen×_lÔXdÏXbÌU\ÂQR«DOˆ#BvAb?f@nBt!B~-Hh?U
-Bˆ:WÒŠÜž—È‹Ž’Fan!?e9V2o#CV8_<h<_;\=f? Pa¼qwÂrsºnnÂnn̆|ÒŒ|Ћ}Јz͇{ˈ~̃|ΆyÍ„zÌ…€Î„Ê‚xÇ‚}̇zɃ}Ì‚zʆzǃ{Æ‚xāxÀ|€|Ä|wÄ~|Ä}zÀ|yÀywÂwr¼vw½wsºrt¸rw´rv´rxƈÖœã­Šè¶‡í¼‹ð¾Œî½†ð¼‹î¹ˆë¸…췅괁곂鲄糅궈괅趉鸌ž7Lœ:MBU™7I•4H˜0H”0E”/F,D'?†$>}<w8Œ'>²HRÐ\XÚpbßjçŠoê”|ê›xîyðŸ|ð zò¢|ò¢€ò |ðš{ê‰næ~iÜkZÌYU°@Lš,Cœ*@ 1B 7Gª7H³?N°Dc¸Nt¿h’È„œÊzŽÅšºpŽÁpŽÈu´p‚|:V^!Sb'Zv=ph)X` Rh&Yi&Zh$Wm&Z~G€€B|x;sˆ^—z at zfŸ™nž„Ith*VWGYHT?P?XASEUKd*Yr3ot8l’_“˜kž•k•l6\NARJx2V´u€±huœPc„4UWFYE[>X?VBWDSBSFNF_ J¾}z½ba°P`Ç|†Ü¨“ட߷¨áÁ¬ÜǬ„GL]8<š.B¶<HÉMUÍOTÒT^ÕX^Ø[bÙdnÛilàptâwtâvxä~€ç„„挄蓊锎蕑ꞕ痐葎霕皔蝖曒痑阒皓敌䏊⅃àxyÝsvÝv|ÞpuÜlrÜdoÜ^eÛ^fÜY^Û[dÜbnãw|皘ï¼ôÔÉðÎÆë»°á¡šà’Œá‹‰à‰†ß‚‚áutÜirÚbhÙ_n×ZiÕ\iÒ\hÌTZÄRY­?O‚DuBa>l Bt$Ds"C€0Hd>YG|-RЊÛœšÌˆ¢\sm"AcCY8k>\;b<d<\8^;x)G¬[d¿vuÂqp¾mnÄvtц{Ѝ~Ћ~ψ}ΈyÊ„|̆y͈zÊ‚zʁ~È‚zÈ‚~Ê„zÇ€{È€{ɈȃyʁuÄ|xÆ~xÄ~xÁ}wÀ~xÆ~{À|xÄzuÁzxºvw»tt¹sv·pp´qvµptÂ{Öš~à¬‚èµˆê¹ˆî¼‹î¼„í»‰íº†í¹„ì¹†ì·ƒé¶ƒê´‡è³èµ„ë·Šê·Žé¸è»“™6K˜5N˜:P–6L“0G”,D•6N-F*C‰&?„'D{=x<‹'C­CMÍ\ZÙthß~lçrì•xëš}îœ{ïŸyðœzð zð¦€ð¢~ð–zêŒqä€iÜn`ËXQª>Hœ/C˜,Až0B¤6G«9L¶ET·atÂhtÇ\bÄQ^ÁXkµdˆ¬aŠ°eLx†6hk$\m)a|:nv7hg#Ug'Yb Rf']j)b|?xu<ru7p‹Z—ŒX”–u«–l–’f‘aQXG]J\DZCWBYCVBUFYNl/Xx?v_Jh-H„CWT<D>[D‹<\¶ot·nu P_v*N\DTAY>Y@V@V@SBNDRIŽM`ÌzpµT]¸\dӝŸÞ¢â´¢àº¤â̲¥zhO9g9‚<¢:J»DLÆQVÐUXÒV\ÔY`×^`Û_gÜfnàpxâorâyvä~~胂挈鏊蔌ꖍ꜔ꜘ隒階雔蘐皏盏꜒薌玆懄ã€|â~|ßuxÞqsÞnsÞlrÜglÚ^aØ^dÙ[dØXbÛ`iãwæ™™ïÀ¶ôÒÊïÔÊëÀ´ä¢™Þ“ŠÞŒ‡ß‡„á‚‚ßwyÛkrÚepÚ`kÙZhÖZjÒZdÍX[ÄRW¬@M|?v@^Ao?nCu'Fƒ3Nd?VDy*NΆŒÔ”™Ì„„´sl=`8Z
4`6^7e:b<Y7[=…5Q¶djÄsrÂsqÀnpÈzvЊÒŽЉ~Љ}ψ}͇}̇~ψzÌ„zȃ|Ë„ˆ~ɁzÈ‚|Ë‚zÊ‚xȁzɁvÆ€|ÄxÃ}xÃ}wwÀ|{ÀzyÀ}z¾||¾xt·tv¶tx®nt²qu½xvÔ”âª€ç³…ë¸†í¹ƒíº‡îº„ì»…î¼…ì¹ì»ˆì¸긁굀綇跍뺐꽖êÀ–êÁœ–4J”3I’0H’0H0FŽ)C”.E‘/G‹*F†(D‚"=x;t?‡ @¯@HÎ^XÜndâ~mæŽpê–yîœ|î›zîž}ðŸ{ð¥~î }ðž|ï˜}êŒræzdßl_ËTS°DIž/D–*@š6G¥5H«=J±GV´MY¹HU¼MV¾N\ÃVeÂd|©Po•Fh>mˆH|‚>uƒAt~?rr1]s)ZiN_Vp-g‚H…WŒ_ \r6n—k¦™v¢‘bk)Xi1]n1f\I_HZ@Y@XDXCXB[HXIWEr.Rv:ncCˆ6IX<H<T<–E\´ep¼qwžRf”Lf^AUAT=T>R;XCN=J@j&JÀ}|¾ef¹TdÉ€ˆâ²¥á°Ÿß°œà¿§Â¡ŒX<Z<p<„!@¦8IÀGRÉRXÐR[ÒW^ÔV]ÕWZÚ_eÝikÞksãtsâyzãzyä~}凂针閎阉윓ꛓꞙꡚ蜒蚒界蚋ꕏ甈率åˆâ„}àywàtvàtvßttÞpqÜjnÚbgÙ`dÚVaØ^bÜ`gãwzçí¾¶ôÖÎñØÎëø⠚ޒ‹Þˆˆß††ß„€ßxyÜqvÚkqÜ`lÚ^m×ZfÖ\aÑY[ÆMR¦8Iu?tA[=p?hBv$@Š9Nc@YAt IȁˆÖ”˜Àox¼…Œp?\:W7^:n"Be<`8]<d:–EV¾mmÈynÅtpÀpqÍ„{ÑŽ~Ӑ~ÍŠxψxÌ„ẇzˈÌˆzÊ„zË€xÊ‚~É‚zÉ€zÉ€zÊyËzÇ~yŁ|€|Ç€xÈ|xÄ}xÅ|yÀ~¾||Àzv¼z|ºuv¶rq³puµlr¹rt̍€Þ¤€è±ƒë¸†î¸ƒí¸~ì¹„í¸„ì¹‚íº„ìºƒì·„ë¹†ê¹†è·ŠêºŠê»ì¿–ëÀ–ìœꠔ2J0I1J‘.HŽ.FŽ,D*D‰*Bˆ+D†)B~#@x Aw@ˆ#@²?HÍ\XÙmdã{kæpè’vêš}îœyì ~î |ïŸ~ðŸ|ò€ï—}éŠpæxfßl^ËZU¯@Jš0F”.Dž4F¢8K¨@P¬@N°LW·KV¹LU¿N]ÆS]Ä_nž=`Š<jx4my6o…I‚ˆMˆy0`“Lz}1bdVr-h‡N„†^Žc*\\^zCš~±†Q†‚VŠd*cl8go2\`JV?Z@[A^J^FZE]FZFX@d&HZD_@ˆ8Mb:F9T?“CY±bq¸eu´€‚R^\BQ7P<R;O6U>K;K	8˜M]Étj·P]º\fÚ°®â°˜â¶§Ý´ ÖÀ§r9FM>Z@l>Š'B©<J¿KRÊNVÏRYÔXbØ[`×\cÙ`iÜ_cÞfkáqpârrârrä{y元鍆菅ꔎ옐霖윔ꡒ顕薍瓊疌蓊蔅戀äƒ|â}zàxvßqràoqßtsÜlmÛfjÚ`cÖY]ØY`Ù_gÛblàpwå’’í¸®óÐËñÖÊìȽ࢘ސŠàŒ‹ß‰‡ß~ÞyxÛrtÜkrÝ`pÚ`qÖ[dÔ]bÏZ\ÀJPž2Fx@n@]<oAdBz#D‹9N`:X	<sFÆ€ŠÖ“—ÂqzÊŒ†z&HZ8^=\:r&Dc:`<^6o>£PZÀnjÅspÂqnÇxvЈ{Ґ€ÓŒ{Έzχu˃y·{Ì…|Ì…yˆ~Í‚zÊ€xÈv́xÈ‚xƁzÄ~|Æ~zȁwÁ}yÇ€vÆ~uÂ}zÄzvÅ~w¾{{¼x{¼xx¼ut·rq±mp²hnÅ€yØœ{æ¯츄ðºƒí·„í·‚î¶„ì¹€íº‚ì¹„ì¹†í¹‰êºŠë»‹ì¿”ëÀ’íÅœìÄžéÅ ëÄ¢’2J2JŒ,F‹*CŠ(B‹*Eˆ'D†(C„'E„$@}>w?u:ˆ%C¯:DÏ\WÙojà~låˆxë”{ê–vì›{êŸ{ë›xïœ|îœ|ïšxð•zê‰oç~hàk\Í\X²AJš,A”.D›2DŸ8L¤9J¬ET²FRºFP¾GNÂMSÄMV¿P`Ž*Z‚=|™dœ˜n¤‘av/cŒ<l¡Rz4iz4jX„P}^(UVP][j.g‰j™a¢€Lzx?xc'Pe'U]HUDZ@dJ\E]FZ@ZFZEZEZ F^IX@y,Bj=J
-;t FœDY¬^pžJlȉÀwv‚7TL6N<L
;L
-5N:K9fBÀxj»^^·TbÆw}ß´¥à³¤â¼¬ÜȲžpmODSCdCo?ˆ#?ª:H¾GPÌTWÍRXÑSZØ\dÚ`fÚ^dÜafßioãnrânpâtuäzxå{vè€x艂ꌃ쓊Ꚑ꜒ꚓ顏阐镎藊璈捂åˆ|æ„uá{wßmpÝmpÜhlÞppÛhkÛfeØ]cÔUTÔ\aÙ\cÚdmÞt{䉌쭨óÎÆñ×ÍîËÀᣚޑ†àˆÞ„‚Þ‚Ýz~ÚrwÛmqÚdmØ^jØZgÓZbÌV]½LT‘+EzBa=a=i;d>{"B‰8Nb8Z
-=jEÄ‚†ÙœšÄv}̍…Š?ZT:X
-6Z:t*Dd>]>b@€*F²adÅtkÆtnÂppʈ„Õ™ŒÓ“‚ÓŒyωzΈ|χy·zˉ|̃xÊ„}ˁxÌ‚xÇ‚yÇ€wÅ~zÉ}|Å|zÃ{Ä€}Á|vÄ}wÂ~vÀyuÁ|xÀyw¼zw¼xuºtw¶op¶np´ko»tuÔ‘{⪂괂ﺂì¹î·‚ìº€ì¹ƒìºƒì¹‡í¼‰ëÀìÁ‘íÄ™ìÅœîÆœìÆ›êÆžêÅ¢Š-G‹,H‡.L‡,G†/Hˆ.H‡.I†(G~%D€&Cx>t:q:Š">¯:FÍ[[Ùroà|lå†té‘xê”|ì›xìšyë˜xí›|îœzíœxí•ué‹wç|dàlZÎZS¬?M˜*B’,I›3J¢>T©Hi¨?N°CN´FO¹JQÁJSÁK`°M{’J¥‡¶ŸyšX|w1f;ošU…ˆGzs-_]“‚Nzc%Y^&\e&^d&bXWqBt’v¨|Cv†UŽ\Pf'RgO]J`Dj$MYBXAY@V=ZBWC\#F€PvX;^5o =R>\=—CZ¢Zvš>a®PQÖ—Šºxyx2QO>H8J9N7Y=DPËre¶JR¾ZaÖ¤¤à±£å¾®äʶƫ”XBJ:UBlCr:‰#D¤8I»FRËNUÐUXÔX^×Y^Ú]cÜ_aÞgkághânpâtvåtwåzxäzv䀀戂猄ꐍꗏ閎Ꙏ뚌ꗒ萈ꒆꐃ猄æ‡{ä|âxtàsqÝknÚgnÝhjÜijÙbdÙZYÔVa×VYØ\cÚ`làruよꜝñÈÁòØÎðÍÀᥠލƒàˆƒÞ†ƒÛ||ÞuxÜzÚmtØfpØ_lÕ^iÒZ]ÈV\·DNŠ&Bp>X=e@i<iCx)Bˆ8L]8V
-?a>»x€Øš˜Æw‚Ë„‚ Vl^ER9V:n$@eD[@h>“8N¼ihÂsjÃqnÀopÍ„~Õš†Ô•‚ÒˆxÒˆ{Їz͇y͆}Ì„y̆xÍ‚xˆ}Ê€tÉyÉ€|Ä~{Å~zÆxÄ{Ä}zÃ|wÁ{tÁyvÂ|xÅ{xÂ|x½{y¼xx¸sp¶pt´mp´oṗxÞ¢é°†í¸ƒï»ƒïº‚ﶁî¸îµ}íµì¸…í¸ƒìºˆì¼ìÀ‘ëÄ—ìÆ›ìÇžìƝîÆžíÅžìÄžêߍ-Hˆ/J†-L†,J‡*H‡.L†1O„'G~(H|'Hv Bo>l=„ =­>KÍYVÚpjá~mç†oé”têš|ìšyê˜{é—zì›|ìœxðxïnê…næxdàm]ÐYP«?L–,B'C–.L¦Jb¶iŠ¬@S®>N·GT¸F\ºTyÀq µ‡¨¦w’ƒLfn*XdUƒ>s¨qššT†s2dg˜€JqZOZQzH…l,fq0p_ a‚Yššz°‰P‡”qh(Z`!Nd"Pb"RcGl(QXBWDT<T>YET
>^"Hr5LhCkAn<`@vKHc­r‚¸`dŽ)G°QUÒŒv¼|}`?J;P:R
=^;¶ji½a_´LXÃnt⿵㾳æIJàʳCJI9M<^>{%Ds='B¤5F¹AOÆJSÌPVÔX^Ø[`Ù[`Ý_`Übdàjnágoârtäxzåxxä~~æ}{悀狄쎅ꘊ딍떎ꕌ閌鎉钉錆芁å†zä|táxtßkiÚbhÙcgØbeØhjØ`dÕX^ÕX[ÕT[ØY^Ûckàjsည霝ñļóÖÊñÒÄ㪧݇‚à†‚Ý„‚Ü~ÝsxÜszÛhrÛfmÖ`hÕ^hÑ\dÈTZ®@N‚ AdBX@h@jDnA|*DŠ:NY6T:a
<´lvÖ’‘Èt}Ã~«^nj"FP:\<k>`BXBj< P`ÂohÆtlÃrnÅxpЍ~ԍzӐ{ÒŠwЉxÏŠuÏ…{Ì…zʈzÌ„xÊ‚}Ɂ{Ê€vÊ€wÈ€wÄ€|Ä}tÆ}vÃ|xÅ~zÃ{vÁ{uÀ|ÀzvÀxwÀ|w¼wyºuu¹tu´no°opÀ{sÖ–u䬂췂ﺀï¹}︁î¶}í¸î¶î·í¸‚캃뽎íÀ”îÄ–íÇ›îÊ¥íÊ£íÈ îƝìÚêÄžë Ž5Jˆ-Jˆ.Jˆ.Lˆ0L„0L,J€+J|'G{$Ev@l;l8„&D°CKÌZXØnhß|läˆrèŽyꖁì˜yê˜xé–zìŸîž|ðžwïqêˆnåyfÞk]ÎVV®@M–(B‘*G“'H«Pb°h‹ =X¬:Z¶Qx¿u£Å§»y¹l€Œ:bTBaUw2m¢e•º ŽEvˆ\yBj]SXVZ$]…^˜l<qi,th4n˜†»”qŸ‘\™„Z€€E|_JeOf.Vc Lj"NX@Q;O<O<SBX?r$C9Qˆ.Cˆ1Kf=€.Q4]œW~͐Í†–7Rw"F½`\̃j{(LF4J
-9H<~8NÆxo¶U^´VaÔššæÀ¯æųâȱ¯ƒnO:N:N
-;c@‚*Fs;‹<¦2E·@LÂJRËNVÒT\×]`×[`Ú`dÛ`dàcfàlnânoässäxxã~~å|惂ç‚}鈁玊ꔋꋄ蒉ꔊ鑇蒉鍂舀æ‡|â€yàxrÝhfÙabØbhØbfÙ`cØ^`Ö\`ÔRVÕRXÕX\Ù\fÜcoà‚‰éœ ð·óÓÉòÖÉè·´Þ‹ƒßŒ‰ß€}à{~ársÜpyÙjrØbjÖ`hÖ_hÒX\ÆSU¤5JxBZ=VAfDt$DmA€)A;R^8T>_Bª_lÑ“’Às~Æ„‡°gxn(HK
-7b>e@^=X>w*J­YaÄujÇrkÄpoÈ|uяzÔŽzÔŽxÕŽ}ÒˆvÒŠyψz̈wΆz̆|΄{Ë„zÈ‚|Ç€}Æ‚|Æ~yÆxÄ~xÀ~|Ä}xÃzu¿zwÂ}wÀxu¿vu¾zw»uw»vx´su¶knºpr΋uà§{è¶íº‚ð»€îºð·|ï¶zî·~î·|ì·z뼃íîÆ–îÇœïË îÌ¡îË¢ìÉ ìƘë–éšê0JŒ1L‰/K†0N†5P…/N„1P‚(Hz"Fy#FsBl<h:€$B¬9FÌZZØofàziæ‡tê’yë–|ê˜zê–yë–yì™vîœ|ïœsî‘pèˆoçyeÜn^ÍXS­9H•)?‘*C”&F©>QÀwŠ«P³TwƆ¢ÅrŠ®Sx®d±f{&XbTz,e a¤l–ŠBjŒS‚z>ie#Z`"`\ Zt@€{H„ežq6u|T’‘qª‡Y•o¬u>l˜r¦d#Pd$Rd)P`Ff NV=P8M8H7V>jH=N«Zg:K‚&@b@7[’Hw¸qƒâ£˜ß¥‘®WdYD’7F¬jpkBC4@4S:²ii¾ib²Xd¾dhݯ¨åÁ°ãƮģŽZ4K
-6P8N
-6i!A†0Hx:Œ!;¡1D¹DNÇFNÌOYÒX_ÖZbØ]`Û[cÜ]`àdjàdjàlqârxæwzå|~æ{vç~憃æ}熀掇捈萄ꎂ萈莄舁è†å‚wä{tßvvÜihÚdd×^dØ_dÙadÔ[cÕY]ÓTZÒSZÔVZ×X`Üjmá~„蘒ﴮòÑÆôÛÎìźۂ{ß„Ý|ÝzzÞttÚpvÚmtØbo×]jÖ^fÐZ\¾HR›/Iq@T@Y@`Av"Cs'Gƒ-G<L]6P	:^@£Ndя‘‚ŽÈ…ˆ´pwm%HH3`:]=[<Z:Š5P¸fhÇvoÈqlÂpnÍ„{ÔŒ{ÒŒxÒŽxшwчvÎ…xÏ„vÏ…x·yΆxÊ‚xÈ„zʃ{È‚xÆ‚zÄzÄ€zÁ€}āzÄ~x¿}yÁ|vÂ|v¿yv½vs»vt¹ww¸qr±pq¶lpÇ|tÚ˜|æ°~ì¸‚í¼ƒð¹‚î¸|í¶î¶}í¶„í¸íº…ì¿Žî—îƘîÈ™ðÊ îË¢îË îÌ¢ìÇŸíÆ¡êÃœêÝìàŽ1J‹1JŠ2J„-H„.L‚+K‚+H€(Fz&Dz @s=l;c7<ª<HÌ]ZØlbà~læ‰ré“ê”|ì—}ë˜|ë–wí˜vîœzî›xï”sêŠnèzfÝl\ÍWO¬<G’+@’(B’'Bš1L¹R_Æx„ºk‹´Z€§Lt§Rz¶_}°Zw‰/ep \Aj¨hŠOp9k€Kzv<l|T`!Yn4sIˆv at vŠhžj(eƒaœ‡^š‰\’žˆº{<q‘ršf#PYCZDb!Kc HX>S8T>O:n FfP|*E©QY >PwB2`Fi¬^r³FUØžáªš½nr^<s:…8JO5D2D6v*CÄugºTXºXcË„äÁ´æÆ°Õ¾©p1BJ:R
9O
-9P=j<’9Rz:$> .B¶?KÈHLÊNVÔ\`ÖT\×Z_Ú\bÛbdÞdißdmàjmärväpqãzzävwå}ç…|æ€}æ|èƒ~æ†|挄艁猄刀芁抁å‚|âyvßpoÚhf×b`Ö^cÖ]dÖ]`Õ[bÔV\ÐSYÒRXÔTZÖXcÛflày~挍쪨óÒÉöÞÒðÍÀÛ‰†Þ‡„Ú~|Ü{zÞsrÜrwÜhpØen×_kÔ\aËTW³FP-I^AV@`G_<v#Ev$Dƒ.E‡6K`
3R5]@™DZÑŠ‹Ì‹’É~€¶v{s+KI6b@T:[?c@˜EV¿nlÈtmÈpjÄtpÑ„yÕŽzÒŒxҍwÒŠ{цtÐ{pφt·vΆtÌ„yË…{Ê‚wÌ„yÉ…{ɁzÄ~xÆ€xÄ‚}ÀxÆ|xÃ~zÂ|vÂyv½wuºvu¾zx½tt¶st²nrºrrÒŠxá§~ê´}ðºƒîºð¸‚î·î¸~칆켈îÓïÈ™ïɝìʝîÊœîËžîÉ¢îË ìÈ¡ìÈ¡íÆžëÄŸíÆ¥’0J2L4Jˆ,Lƒ0N‚(H„+H,J|'Dt=m;i9c9~7«9EËXZÙlaâ}måˆxç‘zé”yí™}íšxíœ}îšyîœyñšwï•sé‰lè~bßm[ÐTK­;H–*@“(@“+B˜1F¢?N®E\µPj®Y‡¥c“§c–¶gŽ¹d„‡6fdR|9p’T…>qF€>x~F„c!Yt:xzB‚r3pŠh¢O‚p4t~Z—zC€fš¢·x4prJrg*\N<RAV@`E]?X>U?TA`El4d€>b6R‘8S†*Q²w~¶a`µSX+GŒ9B­h_’JW^:W4dDN5K9R8 S[Æl^ºWb¿clÞµ®èÆ®ÞĤ][K7P<S9S
-:R9n(F–AT€;Œ(@§2C³<IÂGLÌPUÐSZÔZ`Ú]`Ü\aÜ_dÞahàeiàjnälqãqvâutäwwäwuäzwæ~yå~{å|{僁戁犁æ…å…€è†~ä€{â|uàrrÜmnØddÒZ\ÑY]ÔVZ×^bØdjÖU^ÖT\ÓV[ÑNV×ZbÚclàx}抌좞òÐÆöàÔñÏ¿Þ’ŠÝ‚~ÚÞy|ÞxyÚqyÙgoÖfnÔ^gÓ]cÃUZ§>L~AT<SB_>cCw(Gx'D„+Aƒ/Dd:Q4Y
;“9T̆‡ÍÈ||¼xx€8UV;\>R9Z<v&I¢S\ÃtoÉtlÆqmÊvlÒŠ~ҍzÒŠuЋxЇz͈x΂sÎ…t˃t΄vÌ‚ẋ|Ljzʆ€Ç‚wÇ€xÇ‚vāxÆ‚xzÆ|tÂ~y¾}xÂ}x¾{v¼usºzvºss¸mo´mrÅ~vÛŸ|氄ñ¼ïºð¸|ï¶î¶~ï¸ƒì¸„í¾ŒíÐîÆœðÊžîÌžîʝîÈ›îÉžíÈœìÈ¢ìÉ¡íɤìɦíÆ£íÇ¡’2OŽ2K‹0IŒ0JŠ.J‡0J‡0I‚.K| Bw@r<g:`5y8¨8DÊXSÙj\à{måˆxêzꕁí˜zí›|í™î›zðŸyò~ð•wëkç~bânZÐVP°@K”,D&B’,Eœ2G¤;T©Hj¶\|´Tt§Ot¸`}·f¦Xr'Yt*^‚@q}4j|:nŽWŽ‚Ho0et:u|D}n.rn2iq¢c%[e'_~X˜p3s‹gš£‘·€>~d0T‚P†N?SA[FU>^FdF\ET?Y
=e"F7as&H…/TŸG\Æwt¾HOž3Fy H‹Oi†C_aEP5W;]@F2Z<ŒBU»d_¶QV»ZaÍ‚„äÀ¨Òš~¼†{Y9J5K5V
8U8T9s*EšJ^:”%<£/B²;HÀENÊOSÌRZÔW]×[\Ú]`Û`bÜdfÝ^fàekâlqäqvãsråxyãxxâxväxzã{z偀æ‚|僂艂æ„~戅èƒ}â€zàxtÞssÛpn×`bÐRYÍNVØY`Ù`fÜdfÙ]`ØX_ÔW\ÓTZÖ^cÛdlàrw犐ꞙòËÄöáÖòÓ¾Þ—’ÜvrÜvuÞxxÞzzÛnpÖhnÖbjÒ[cÎZ^»T\›:Nd>Q>UB`A]@v"C}*Eƒ.G~(>j<U4\
<…-NÁ|†Î•Æ|€Å€˜Qf\<T:L:U9…2M³_bËxmÌwkÆsmÊ{vҐ|ҍzÑŠ|ψzΆx̆{ΆxÌ‚tË„tÌ‚yÌ~tʁtÊ‚{É‚{Ê‚uɁyÆ‚yÂ~ƁxŁvÅxÈ}rÂ}xÁzvÂxw¿vs½us¸pq¸mq·suЍx⩁뷂ñ¼„ñº‚ð¹~ðº€î¸|ðÃŽðÆ—ðË ðʝïʝïÊ™îƘíƘìÈœìÈ¢ìÉ¢ìÊ¢ìÉ¢íÉ¥ìȨ“4I1JŽ2K.L‰0HŠ/Jˆ,E‚&B~=w;t:f6`
-2{7¨6BÊWTÙi]à}oèŠpê‘xë–yîš~ì˜~îšzîšyð~ñ |ò•víŒtæ~fßl[ÐWR¯AJ*AŒ"?–-L¥@^²\„¾d†¶Tm³G^ªMmµRq¹Ri™<ht%]-b†Asv,fƒI}–fšz7js6nt6ln-nc"a„]‘†XˆURh-nŽl¤q1s…_™žˆ¬ŽUŽ^ NŒf•WDQAZLb!Sl/X_CT9J	7^Bn&I~7a—O_™Slœ<TÆnYÈ„s¯dlBX‡=Po'FV:N7X>K
-;Q>œh¼u|·fm¦P\ŸPfÀ|wʈ|À‹Œ°xn%JS
8O6Z8W6W@u*BK]%<&=ž0C­:FÄKQÊORÑTZÔY]ÖYZÙX\Ú_bÞ`eággáhnánqämnáoqåxsãxväuuåzvã{zæ}~å~xä‚~ç|æ„~æ„~惀â|{àvsÞmlØmlÑSYÈFRÐQYÚ_eÜgiÜelÝgmÜhnØ`g×X]ÖY_ÙblÞlp芊ôÈ»ùáÓóÓ¿ß•ØtsÜuqÞvwÞtw×lr×djÔ^fÑ]cÈW^³N]…&CY@V@Z?aB\A{%B.H€+E€+Bf;T3[;r>»v~Í“•Ê…‡Ì„}¤\mg=R;K
9X<•GZ¼ikÏ{qËzpÊtlÏ€tҍzщw͈zÎ…xÍ…{Í…tÌ‚vʁvȁx̆wÊ€sɁũwÊ‚wÈ‚{ȇ|Æ‚xÄ‚~Ç€vǁwÄzÁ~vÀ…~Ã|v¾wv½vr¼rq³ll¶npÄzwÙ˜z鲂ò¾‚ðº€ð¸ð¸|ð¹€î¸‚(ïÀŽðÄ•ðȝîÊšîÊ îÈ™îÈ–îÅ”ìÆ›ìÇžìÈ êÈ¥ì̧ëʨêÈ¥ìȨ”6N’9O’2L1H‹0H‹.F‡,F†(@‚%@};v;f8`4|9¦<HÍXVÚjaázmæ‹vê’|ë–~ì˜|ë›}횀ï{îž|òzñ–tìŒpædàmZÐVR²<J“,K”-V¦Fq»f‹Áe{´KZ°EZ¶IV®Pq¸Sr¹Pk‹8hz,`i'T†Ay‚;y”b“ŽZ‰z2hx;nh,^o3pZ Ut¥t;nPQe*bŽp£x8€vH{ ®“b–\Q|Y€j'^[Ll+[g%PX<^<l$IN
-4U=iH…6Nªj_ KMf=q%K’@T¥Sin"DT:P3K
-2R4T9D:‚LfΔ‹Ø‡Ï‰Ä†‚·w„¸~ˆÌ§šÒœ…žKP[
-4O5R9\7T
7U<u.H Na’0CŒ!< 2E¶>HÃJSÌPWÑX^ÕSZÖ]bÚY^Ü\bÞ`càacàhlâlnâmpàmpãppäwvãwtäxuä€|ä~{ä€zä€yæz允ã‚å‚~â~|ÞvoÞrwØpoÐV]ÉDMÔR[ÜchÞjkÞejßjjÞkjÞjmØZ\ÔQXØWXßlo熀ó¿°÷Ô»òζۏ‡ÚtqÜwuÛuxÝnrØipØdiÓ\eÑY`ÆX]¤BPfDR<T>X<_?a?u$A{)G~+D~&Be:Z6^=f?´mxÒ”“Í…ŠÇ}~¨bln$CS:H8Z<ŸPbÄrkÓyhÏyhÇsoÒ‡zÒŒxÎŒ}Έ}ψzψ|ΆwÌ‚vË‚yÊ‚uÈ‚wʁvÊ‚sǁxÈ€xÅ~yÆuă€Å~zÇ€vÆ‚xÄ~vÃ|tÂ|uÀ|xÀzyºss»sq´kq¼otΈxߢ|춁ð»„ò»~ð»‚ð¹zð¸…﹂jïÑðÈ—ðÉžïÈšîÉ›íÈšîÆšìÆ™ëÈšìǝíÊ¢ëÊ¥ëɧìË¥êʦëƧ–=N’4K1H7L‹0F‹3H‡*B‡(A‚$?€ ;z ?k7e6†"@©?JÍZVØj_àzlæŠré‘zê–zë–zꘀë–{ï™zîž|òŸyð—xìyämÞj[ÏZY´FX¢?a§Ol«Pj®HW¦?R©>P°AS¶DX°Tu¼Xt­Pv†6gq&Zf&[ŠC|‹N†Ž\ŒŒM}8ll-cXNh(f~T‘Œen.eXXUTˆb˜€C‡p3qœ¤¢°`ZvPsŽb‘SD`EZBY@g=‚4PN
-9L<WAl-TcFX8R<^FCf—Rh0LV8N8N5X:G8D3®„ŠÐ”’ØšŒ×•Úœà¤˜ß¨“Ö Š¦[al:P
-6P
-4T6_5Y=X
-:x.JœL\’.D’#:¨4C¸<DÆKRÊOVÓWVÖY^ØZ_ÚW_Ü[dÞ^hàbfáklâflânrâkpärtävvãuwäuvâtwäz{ä~xã{}ä|æ~å‚|ä€zá~{ßvrÝrtÚmlÑT_ËFP×W`ÞccÝa^Ù^WÔVN×abÚ`]×\bÓP[ØOTÜagävs옍︨ô®콬րvÚuuÜuuÜruÜprØmtÓirÒ_aÊ[[»QX‚&FX?V@RAXE`Ff@v@‚/Hv"?&Ab5b;\:Z
>¦_pГ”Î’“Ãxz¨dpt$FU<H
9gA¨W`ÊzpÐ|fÍunÈztÓ‹~э|΋|͈}̆vÍ„z̆xË„xÊ€vʆuÌ„zȃzÈ‚xdžyÆ„zÄ„~Æ€yÂvÈ„xÈwÆ€wÃ~wÁ~xÂ|w¾wx¼wv¾tp¸pr´mr¿tqÖ•€äª„î·|ð¼‡ñºð¸~ð¶~ð¶ðº‚ð¾ˆïÐïÄ”ðƘïÆ™íÈœîÇ îÆœìÉŸìÈŸëÈŸìȤëȤë̪ë˧ë˦êɨëȧ’2J’5L’/G‘0J/HŽ,CŽ-Eˆ*B„"?~!?{?t<n8Ž&A°ENÏ\]Úoià{læŠuéxê’|ë˜{ê˜~ì˜}îš~ðž~óœ~ò˜xìŽpç|dÞnbÐ\_´Jbž<\*L“,Hš3K¤9J«=P°DU¶DV´Mj¸UxŸPwˆ5a„*`v,b‡D}„D|›l”˜V†}6hi(`J
-Ej6l Š¶†Hj)]l/qVVW…N~>Š—v ² Âv3uh5]ž~§ZGXGZDu-Tj"@€4NN4M;N<Z@g#Od![^M h‚¨w–c;P
-6Q8R<V9M7E<\DȤ–Ö¡˜Ý¯Û¦›Þ®¤Ú¬œËž”UVb9S4Q1T
-4X5b=Z
8[;t+EœK]”5Nœ)>®8D´=HÅJLÊPQÓSTÖRT×WYÚZ\ÛZXÝ^aàfhàdhâfjâlpâlnæwsäqråvxäxuâ{xãyuäz|ä}zä€~ä€{ä‚zä€{â‚€àysàsrÛljÓblÐPYÜ^^ßbXÏWQˆ6t6š%9½>BÄCEÐRRÖTW×VZÞbdèŠ‡î¬¡ï»­à˜‰Ú}zÛvxÜuvÜttÜnrÙhoÕ^hÒ\`ÆZ^¦APe?T?WBT@ZGcFi>}%C…0Dt>(De8f8\
:X
-<œVpÓŒŒÎ’”Ânqµnvz0MS>VB|,J¸dgÌ~oÒ|nÌyjÊvÓŒ|Ò‹|Ήz͇|̇|̈{Ì„yȁwÈ‚xÈ‚{Ì€vÌ€vÉ‚xÈ€zÈ‚xÆ}wÄ{zÃ~z‚|Ç~tÂ|tÂzrÃ{sÂ}t»yx¾yx¼rpµpt²kpÈ}tÜ™~鯁ñ·ñ¼ò»~ð¹~ﻀñ¹ð½…ððÆ•ïǘðÇ—îÅ™ìÆžîÇœìÈžíË ìÊ¡ìʤì̤ì̧ê˧ëÍ©ë˦ìÉ¥êÈ©“0J’0I‘/G-G.F‘.G’1GŠ)B†#>€"?€$>y:{;—/DºNVÒbaÝtlà~tæˆvévé–€ê˜|ì˜zíš~î™yï|ò}ï”{ìqç~hÞn`Ð]d¶FT—.G%A•.E5E¢:J«>M´BM¸DS¶Md§Qy˜?h…1\•6gz0d„Bx†H{±p‰”Iwv1hVHLM\’•m”l&`j2f|@‚Z'\vH}„Q~B’j ªš¶ŒOŒ`%S›„¬\KTDW?y5Nt$Du(Da?L
-7J8L
<T@n-^z1j¬wŒ®dldDV<YB^@R9E
-;F9ˆRiˏ„×–‹à¯˜ß®Ÿá·©Ú¶¨¨hnV2R
-4T4S5V7]:c:_;Z
-9w*H¢Wdš9P¤+=°=JºAHÅFLÎMNÎSVÖRUØVXÛZ]Ü[`Ü\`àbdàdhájnápsãopåpoâxvävtåtvâuyäwwä~{ä€|æ€|ä{å€yä€}ã‚€àytâvqÞspÛflÓQZÖWZÜ\ZÉQV¨7P™.K°BT¶CR°7J¯6DÈHKÑRWÛ\\ávtè¢˜è¬ŸàŠÞ‰ƒÜuwÜsvÚpuÙknÖinÒcjÒ`bÃVZ…(H\BVCYCTC`C`@mA‚(B‚(Du'A‚)Af8f7d:T;@ZЍ†Ï”’µgnºz€€2NQ:o F“;PÂniÐ}oÔykËvg΁vÔ‰|Њ{ΈzË…yÉ„wÊ„|É‚yË‚vÈ‚zÆ€zÊ€xÈ€xÉ„|ǁ}È€vÆ€zÈwÃ~vÂ}xÆ{sÃ{tÆ}vÄsÀ{wÁxt¾xw¸ru¸pr¸psÑ„wá¢}í³|ñº‚ð¼ò»}ñ»ïº„ñ¼†ð¿ŽïÆ”ñǘïÇœïÉ›îǝìÈ¢îȤíʤìË¢íͧí̦í̦į̀ìͨíͪìˤëÈ£ìÉ¥/F‘5K’.F“-F’,D“.D‘*BŒ'A†&A†(B„&A‚$>‡#@¡7IÀSZÐhhÜyoá€rç‹uè‘zꕁë˜|ê”zì™ïœ}ðž€òñ˜{ìŽuèkák[Ò[Wµ@Hš.F’&B—2Iž9K¦<M¯BL³DPºJZ¸Mn°X~Ÿ>fŽ=fŠ3c{6g€>pw1g…Cnv1bj'`M
Jq@{™w „P„i$`uF||G\ZxJ}‹`™yG|aœ›~¡Ÿv­l,dœ†¢j*YF
-8K8^>aAYg®e`f>LAH<J>O@†T‘b€jFR
:f Hf@j Ha Fl%F‚6Z©^d¿qtЄzØŽ€ß™„ߦŒ½yr)BP
-8W	:Z<Y=]<_5c:[:\B|.J£Zh¡:Oœ*=´?JÂCHÌNQÎKPÔTY×UYÙTXÙZ\Û[`Ü]_àbhàbjâiiâmpâpráooãtsâuráooäxxãw{äzxä{xåzwæ€|äƒ|ãyäƒ~á}váusÞvtÝpsÔ]gÓRZÙUZØYZÚ[\Ø[^Ø^dÛ\[ÐPWÃKWÃFQÌR`ÖYhÜ|ˆæ©¢äŸ‘␄ބ}Û{|ÛtyØnrÙipÓfpÔ^fË`d®FUiBZBYDWEQBbEbBo B…,Dƒ.Hv&B‚,Be5i8h<S=|-Nʈ‰Ò”‘¹px¾~~ˆ@WT?n#E§OZÊwmÑ|iÑ|iÊ{tÏ„zÒŒ|΋|Ίy͇v͆wʃwÌ‚wÍ‚xÌ‚tÈ‚}È‚zÆ…}È„|ÈwÂzÄ€xÈ€xÄzÄ~uÃvÀ|vÅ}rÁytÂytÀyt¼vt¸tt¶mq½tpÖŽwå¥{î·|ñ»ð»€ñºƒñº‚ðº‚ñ¿ŠñÐòÉ—òǝïÉœïÉœîÉ£ìÊ îÉŸîÈží̧ïΨî̧î̦į̂íÌ£îʤíÈ£ëȤìÈ©”,E4G,D”0D+B(AŽ+FŠ*E…!;‚"?†)Cˆ)C/Gª<OÃW^ÒlnÝwqâ‚tçŠvèŽxé’zé’{ê”{ì–zî˜|ïò¡‚òœyëvè}gÞqeÐ^V¶EMš.IŽ&A–0F8J¤:Fª@P±BQºI^º[x¸Sjœ@d2YjNv/_„Bwt1bw4`d"RNGh,d˜l™†N{l*_y=wu:rq4mj(ltFx‹`•t5w‡^œ^Žª’¼„Hƒ–xš‚K}G9K;hG^>¼ijÜ‹t˜HVX6?	9E	@WNŽ^„€@h\LH
:€<\‡:\ PižOf¥Yp±q€§NR³[^½\`¶fnÏ­ªÈ°¥f$<P8P9Z<d.Qj>^e&J`6b6[6^Hw-Jª`m£EY.@²:GÂHPÌJOÎPSÔRXÕVZØV[ÚYUÙ^eÞZ\ß_eÞbgßdjãlnánoâmnátràptâqsávuättä}~âuxå{xå€}å€|å€~ä€|äyâyvàxvàtpÝlnØfjÙ`k×UYÞX[àYZÝ^^Þ``×QXÔQ^ÔfxÕ…—ܝ¨å«¤æ¬žæ™Žâ‹…܁€Ý{{Úuy×nvÕhpÒbkÑcfÄX\ˆ/L\@XCZEVEVE`CdDnFŒ9L„2N|(B€*Df8k9`7V
->qHŃˆÒ˜¼ls¿{~”G]^Dl$B·`fÑxiÒ{pÓwhÊ{oÒŠzÒ‹zΊzцtφzΆzÌ„{ɃwɃwˁvÈ€yË€vÆ‚zÆ‚{ȁzÉ€yƁyÅvÀ||ÁxÂ{¿|sÁys¾{wÀzt¾|x»tq¸po¹nnÂztÚ”{讀ï¸~òºï»}ñº€ñ»‚ð¾‡ñÐñÄ–ñÊ›òÉŸðȝðÈžîÉ íÈŸîÈœîÊ îΣðͦíÍ©íË£íÍ£íÌ îÈ¡ìÉ¥ëÈ¥ìË­‘,FŒ3HŽ.D’,BŽ&>‘0C”.D*E‡#B‚&B†)B+B”5MªBRÅ\aÔopÜ|tà„yä‹vè’zèwê’xê’vë–zîš~ðšzð {ðš{ëvçfÞp`Ò[T¸BJ™1F“'A–1Fž5I¢:I«?M¯?P¸K]ºRfÄQcªRyjNRDj$X?sv4bn']`U\ Vf–„Ho` O`Uu:os2pn4m{G„|Qˆ†V|Bl¢B€œ~§”[”™y¤”i”RCN9fD^B­ZfØŒnÄ|f]:@
-:E
9uJql#Gr&Et*Sz3V”D[¢Ph¬Zr¼€ŽË¡™¶mbªNR¦DU°ZeÅ‹‘äв›[ZN>R?S:^:c@g$DbDf;b:Z9Z<{2K«ao BQž-C³:FÅHNËMQÐPVÒTW×TU×VZÙYXØZbÚXZÝ^dß`dàadâhjäklânoàmmàosâqrãtvärqåz|ãzxæ|{âzzã€zæ€y䂁å}xä}}á~|ÞzxßtvànpÝlqÚajÛ`lÜagÞkmß{xÚtyØoz㊌벩踭赥嫟旑⌇Ü{|ÜyxÙtx×pvÔhnÏejÍ_b²LXdBXDX>ZFVETCdGh Hp$F’?N.E4J€%@n9t$@^:\>hA¼v}Ó™ºjt¸u}‘CYlE€.IÂllÎ{oÐykÓ|pÌ€pÑŒxЉz·x͈z͈|Ë„źw̃wË„yÈ‚zÆ‚{Ê€vÄ€{|Æ‚xƃzÅyÈ~vÄ€vÅ€uÁ|vÁ~yÃ~wÀzx¾xt¿vr·sr´rqµpmÈ}rÞ›zë²€òº€ñ¸}ðº„ò»~ñ¼†ñÁòÅ”ðÇ›ñÊœðÈšîÇœîÉ¢îÈŸìÈ›ïÉŸîÊ¡ïÌ¢îˤí̦ì̤íÏ¥ìÊ¥ìÊ£ìʧêˬìÌ®‘.H4KŽ.HŠ.E4K”0F‘0HŽ+A†)Bƒ&E‚$?Œ,F˜;R¬HZÆ^eÕrrß~vá„xæ‹zè{æ‘të“xë–{ì˜zð—~ï~òœ~ñš|îtè‚jápeÔ`Z·DO–1H,F”1IŸ5G¢:K¨<K±AQ´CV»MfÌh€Åqˆy$WUHe&U~=up&Zo,jh#bŠf›^‚f'VSL[Tt2lq1oh1j~K„‡a—„QˆŠZ‰ašr3vŠf‘œn¤™y¢œzžu8kUEgHfD‘D\¼hrªAJmFLC_,S`$LNGw0T›\v¡Um¥\{¯f€À†•Õ¦ŸÄ€žDV¢LZ°\r¼v‚ܼ¬¼•€ZEVG[HZH`AbFg$EhAfBd>\A^Dz1O¨`q¡GZŸ0F°>KÀHQÊLVÎTXÔT[ÖUX×XZÙSVÚYZÛ]bÞ`bÞbhàfiàhlâlmâljàloàpsàlpâosäwuäyzä{zä}|å€僂æ€~ã€}ã€|ã}zá|áyvàvvÞvtÝqtßklÝimßnpâ|z服䞙à}}ç‹ê´¤é¶ªè³¦ä®¡æšŽà†Ü}|Úuz×ptÕkpÑblÌblÄ^e9SZH[IXBXET@WIaFr&Jo E˜FSz&A…:O{$@o<x(B`<\<\
>¬ivÔ™¸kr¸u~>S(K˜ATÄrmÒzlÒxeÒwi΄qÒŒxшv͆y̆|̇z̈zË‚wÌ„zÍ„ýxÈ€uÈzÉwÄ€xÆ€zŁ|ÅxÅ|wÈ}uÆ|xÆ€v¾|yÀ|v¿|uÀzt»xyµpn¶pp¹pnΆvâž|í±~òº~òºð¹~ñº~ð¼ˆðòÆ”ðÊ›ñʝñÊœîÊ ðÆ›ïÆšíÉžîÊžðÊžîÌžïͤí̤íÍ¥îÌ¥ì̦î̦ìͪíήîͲŽ3AŒ0Fˆ(@Œ*C.E‘.D‹*F)?†&@~;~=‹)?˜@T²JXÇ`iÓqsÞ{tá„våŠxèxé‘vê”xì”vî˜|ðœ}ðŸ‚ó ðšuêvékßs`Ñ`Z¶FN˜0D*D/H™8N¤>O¨@P­DV¶J`Æe„ÑyµWpz,`]Pj&]~Bzo*d€B‚Ž\’•lj.Z]RTOZSl,`q3hf+ep9pQ‰y?tŠXŠe˜{DŠ}S~œw«‡Y‰œ{¢ŽYŠn-ap*Yƒ5aƒ:]›F]’;\n'Sl(Pj&LG>TL{;d¶t„¶n†½~Í”™Ò¢˜Ò«žžHPDRš9W¼hlÓ¬¢Ë¯—l.EVDZF_!N`"JbHd$Jh%Iq'Hj"HfA`B\Gw0O¢Zl¢M`¤8L´@N¾ITÊPXÎW^ÔV\ÔW_×[^Ø\^Ú]`Û]`Þahágkàglâikâhgâfißlnßkrânrâsväyxäyzãzzãz|ä{zã~z倀ä€{ã~~ázxàyvß{zÝxxßurÞutÝppÞpoâ|wèˆê²¤ç´¨âŽç˜ê´¦è·®è´¦ç±¦ä—Žà…Üv~ÛqwÚsw×jvÔgkÌfl¸U`fBYEWHVGYHXFYFk*Kt&Mt%D˜@Pw&Bƒ1F{"Cp >u#DgD\?ZD VeÒ˜Œ¼w~¾x~‹>UŒ8R­W^ÊvlÒ|jÏuhÌ|nЂtÒŒ|φzΉ~͇zˇzʃvÊ‚yÆ‚{Ê‚zÌ‚vāvÈ‚xÈ€zÈ‚zƁzÄ{wÄ~yÆ~xÆ€yÄ{ÄxÂ~vÀ~u¾wrÀvq½xs¶rsµnm»qpÒŠwä¤wïµ€ò»}ñ¹|ð¹‚ñ½‚ñÁŒïÆ’òÊ›ñÊœñËšðÈšïȘðÆ—ðǘîÈ›ðÉœïÊ ïÊžîË¢ì̤îΨî̧ìϨį́íαëÍ­îÌ®Š*Bˆ.BŠ&@Š+BŒ(BŽ'@Ž+CŒ*B„!={8=‰(B–8O°N^ÉdlÔrvÝ~tâ†{æŠyè‘|ê’yê”tì“}í•wðš~ð ~òž{ð˜zì‘rèjßq^Ï]W·DL˜3H*B”0Fš2F¤6J¬<P°<R¿ZtÐv‘·Zw P|{/_h&Yo)av2j„H›oœ†Ptl)Ta(UWFYRZNp0en0bm0ck.ft<un/f…V‹€R…}Iq6p“lœ„P„¢„¯˜cŽw4ju2c“KxŒ@m†<`„7Z]>Z@g HMCp*X³ŽÄ‰’Æ„ŒÍ•–С¢Õ°§º€w™=Mž?Pž@XµjnÔ»£v9 at U9Y=[>]>b:d<c:h=w(Bn%Bb?`8\?mB¡Yj¢N`¨:N±@IÃIOÈKTÑTVÕSVÖYYØXYÚX[ÚWYÛ]`Ý_^ÞefßegàkkàlnàhmÞfißikãgjállårrävvãvwäxxâxxàvsäzyãyzâ~yà{zÝutÞxwÝwuÜtsÞttÞupßywâ€|皎캯柘痍츮뻮긨賡㓈߂€Ùx}×ouÚsvØgrÔflÊaf’7NYCZHXHWAXCUBXDq(Ho#I|,F“:N{$?…1G~"Bx >w;d6V8X<‘AYÌ’‰À‚‡»v|Œ;QžNaµ]^ÐxgÕ{hÒr\Î~qщwÑŠwχx̆yʇyÌ„|˃yÈ‚{È‚xÇ‚zÈ€zÇ‚xÇvÄ€xÃ~yÂ|tÂ|yÂ|tÀ}Â~xÂ~uÂ|xÀv¾|tÀxs¾zv¾xq¹sp¶onÀtn֐wè¦{î¸~ñº€ñ»|ð»€ñ¿‰ñĐðÈšòÊ™òÌŸñÉ™ñÈšðɘïÇ›ðÈ—îÉ›ðËŸîÊœîÊœî̦į̀îάîͨìΨîͪîίîÍ®íÍ°Š,Dˆ,CŒ&@*B†)@ˆ(@Ž+@ˆ$>†;€=>‹'B—=Q®N\ÉbjÒptÝ|vá†xæŒvëwé”xê’uë’xì˜|îšyñ ò ð›zì’tæ„làr\Ñ`Y¸FJ˜1EŒ&?*?œ4G£5I¨<R¸PjÊy“·Xr²Ui¥Rtq Rp"Zr,d‚;vŸl“YƒVAZFkBf[Na"X\Np/id(Wv1lh(\w:vp.i|Bn‹a—g*at:|ˆb‘—fœŸ€ª™iŽƒ@vm$O©nˆŒ=Zh Gm@Z;O6p E‡5VPk¼zÆ€ˆÉˆ‘Ò šØ¸«Ò®˜¤IK§IRœ;P¥P\ɤœ’]TO>U;Z=j>]<a9f6c7i;}-Fo?_;f<Y
-8o ?œQežK^¥GY®<JÀFLÈKQÏPUÔRVØVZÙXZÚ_^Ù\\ÜWZàacádeàccâhmâeeãhlàhkàloáiißlnâljãqqâtrâtuâvvâsuäytáy{ä€zàzvÜurÞstÜxvÚ{zÝwyÞzuá||刄飖îŶêÀ´æ§¢æ™ì»¬ì¿³ê¶¦ç­Ÿã•‹Þƒ‚ÖrwØrx×pvÔioÐhn¸ZdiCWBYD\EZC]CU@_Fu)Gp%I…/F’7J&A‚/E|=}'@o7f8Y6V
>ˆ=Zʇ~½}ƒ¹mtŽ>T¨Vf½c^ÔveÔ{gÔvaÏ~lЉxцwΆv̈zʇ|È„~É‚xʁuǁxÉ€vÆzÄ~zÇ€wŃyā|ÄxÂztÂ|vÂvÁxtÃ~wÂ}x¿}zÁ~v¾zpÀxq½wl¹rq¶lnÂsmØ’vè­xð¸zòºòº~ò¼„òÂŒñÈ–ðÌžòËœòÊ›ñÉ›ðÇ—ðɝðÉœðÊžîɝðËžîÈžíÊ í˦ìÍ­íΪìͨí̪îΪí̪ì̱îΰ‰+B‡(Bˆ(@‡(Bˆ%?†!<‰%<…&@‚"@}"A€$?Œ.F’4J«JYÃ]hÏpqÛ|và‚xæ‹séŽxç“wê•vì–tìš}ì˜~ïœyñžzòœzísè…kàtdÒ\T»CH™.FŒ%>”.Dš4J£0MªB^ÀmŒ¶\v°JbÀap¢NznUr"Z…>y“Uˆ—l”x;kTGbRd,Wp5li+_c(Wm.f]L}Brn,[h.bo.kq/d‹^c#`n3q‰]Žœl›b”bœdšŠFeÊŠt8aFV7p#Dz+T<ZžMb¡I`¬dxƒŒÌ˜Ó¬¤Ö¹©°b^DQš:O BW¼ˆŒ®lVAR<`>e?n?fC`:l;c8n @~,Cz(Ed<c:\<j>˜L_HZ¦Qe¢1E¹GTÆJPÎPVÕTZÙV[Ú[`ÜYYÚ\aÜZ^à^`ßehàagâfjällãdhàfiàkkácdàjhâhjâikáppâssàstáqqârqàtqâ|xàrpÝxvÝrvÝvuÛxxÛ~}Þ~yâ‚~䎈馜ðǺì´槝攐쯥íÀ¶ê¸¬ç®›ä”ŒÛz|×ntØqvÔkwÑktÊek›?XYDYBXCZDXAZAYEbFs&Lj$IŠ4IŽ4J€*E‚/Fr8y%Bq=e=Z9S
?ˆ@]Æ€zĈŠ´js’=VµcjÉj_ÓueÓwbÏzn΁wΉxÌ„xΊ|ʇ|Ì‚yʇ|Ì…x̆uÉxÉ€vÉ„~Æ~xÆ€|āzÅ€zÄ}xÂ~yÆ}vÂ~yÃ}vÁ€wÂ~yÄ}vÂxnÂzp»tp³pr´ml´moÃwmÚ—xë®vñ¹‚ò»}ò»ñ¿‰òÆ‘òÈ”ñÌœóÊ—òÊ™òÉ™ñÈ›ðÊœðÊ¡ðÊžîÈœðʝíÉœìÊ£ì̪ìЭíÏ­ïͬį̂îͪíίìÍ­îα†*D„&C…&A…$B†$@‡%?„%?%A€>z <ƒ&>Œ+E‘7L¥G\À\jÎmtÙ|yàƒyæŠzèvé“{ë“uê—}í™zîœ}ìž„ñ }òžyî“pé„làtcÕ^S¸GI”,A#>’-D™1M¥;V¼g½h«H^¸FV¿dr›Hvk V5o„<p‡N€‹\†j'X^M`Qa#Vp2ff(\l2jh+^h.bt8fx7gd*Zh-bj.b}Ju{C|[V`$^Œ\Œžx«Ž[›t°x‘²\\R0U@X
?|1O®at¦`zœLf Pe¶p~ÈŽ˜ÎœœÖ»¬¾„tœDQœ:LŸ@WµkoÄ ŠX8N:R;o#@€*GdAb=]8n9f>n<{-F~,Fp?c:\7h:›O`›DS¤Lbž0Dµ<FÄJRÏJNÔVYÙTWØX[ÚZXÛ[_Û]`ß`_àdeàdháhlâlkãgfãiiàehàdeàfhàflßjnàioàkiÞosàppÞqrÞmnÞtsÞnlÜprÝqrÜrsÛttÞzzÞ||ႀ捎騛íÁ±ìÇÁ毳騫îĽîÀ®ì¸¨è°£ä–“ÙtyÖjqÖjuÒjvÓkqÂ`jlEU@Y>XDb&JYFXDXAe"En$Gx)H…1IŠ2L€%?.Fs >v"?v!<b9Y
9U
->~7U¾wzËŠŒ·kn—E_¶`gËmaÑsbÑwdÌ}qΆrΊyΆvІu͈xΈzÌ‚v̆xÉ€yÇsÆwÇwÀ{Æ~zÅ‚}Å~zÆ~yÈ€xÅ}xÄ}xÁ~|À}xÂ|yÄ|uÄ{pÀxtºup»rm²or³ljÆzpÞ˜vê°xñº€óº‚ô½‰òÄ‘óÈ”óËšòËšóËšñÉšðʘñʘðËžðËžðÊœîɘîÈšìÊžíΧíΩíЭíΫîÏ­íΫîήîέîϯîΰƒ,B| @{ >€ <#?‚)D…'B$D‚!B~ >„#Aˆ&@‘5M¦DWÂ]lÏntÚ~z߃xåŒ{è‘xè”yê–|ì—|îšî{î¡~ñ¢|ðœ{ì–vè‚iàs`Ó^VºJO”*DŽ%B’(G™/O´ZsÀn†¥CZ²ASºHV¹]t”>mp&Yr*_]H‰YŠ„Hy_Lc"T_Nn5fc&X_&Xn9rh,b{Fxw:p~@st5kh.do6kp7m|Ftz@~YWh,d”l’”c—–r¢„¤p0[@@IB}0V¶`rËsË–£¿•ª¸–È•£Û³¤Ø¸¨Ë‹œ>H¥JU CW²^gƤŸx?KPDO@R?„3F•:Pd@a@Z8l>e=l=x(E‡8Nr"@b6`<h:”G]™>P¢L^œ5J²8FÁEPÌJPÕOSÖVZÚY\ÜZZÚ][Ü[[ß\_ÞggâcaÞfjáffáhjáheÞekÞcdÞehàihÞlnÝlhÝefÜjlÜnlÞhjÚglÜonÛroÚprÝkrÝoqÜzzàxá…zä‚zæƒtå„t꓁虇쳘뛎苋ꈈ暏⒐ÒfnÏ_lÑdsÔlsÐjq¡DYZHVAV>[Ea&LXBZA_BbAu)Hz)H†4KŠ8P~&Bˆ0F€-Fx">€(>e7T
-5X>n)L»w|Г’²dj£Pc¼ieÎqaÔu_Òx`Ëzh΄sÏŠwЈv͈{̇zÌ…yÊ‚wÌ„zÊ„{Æ‚yÇ}xÆ€wƃzÈ…wÄ€}Ä€wÆ€xÄ€zÂysÆ}vÂ}xÅ}yÃ|uÂzsÃypÀwr¼wq»tr´nk³kpÈ{lÞœxì­|ðºò¾óŠòÅ’òÊœòΞòËœóÌ™òÉšñɘñËžðË ðÌ ðËžíÊ¡ïÊŸí˦ìͦîͬíÒ°îЭïϯíάïͪîϬîΪîά€(Ex?x>{:~"@‚#=‚&C‚$A‚$B~=„ ?‹,C’2I¦FWÃ`lÐpqÚ~{à‰xä‹zè’}ê•{ê–}ì•~ë˜zî›~ð¢ð €ñ{ì”wé…hàueÕZRºCK•-E‰&H‘*L¥B\Âs‰¨Ic§:M¯>S¸J]¼l„?ifO[L_#W‰Z„“a’d"Mb$T^ Qf*[f$XZSd+cg(dq;k‰T’€Au†J~z>wu<rp4li*aˆZ‡w;q]Sh0c|B~d™˜s›‘h—TTMA§Td¥Bd¬^~И¦â¾´ß¾¾ç°⼩Ҥ’ FI¦JRœ8P«OXÈ“¢qfO
9Q=S:V;„+B˜AJ^:b:Y6n<m:p>-D|,Fx"?`@b:l<–J^8IœIU•/D©3B¼?KÉKQÓTTØT[ÛZXÝ\ZÚ^[ÛYVÞ^\à^^Þ`_àbdáeeâjmàjnàfeàfgßffâjiÝccÚ`^Ú\ZÚ[ZÚ_\ÚdfÚgcÙopÚifÚomÜkgÜolÞjbßhfÞefÜ`aÜ^eÜ[bãjpâhpävxæz}ãoxãeuãhrÞtuÐjh¿L[Æ[fÒkvÒotÆenrCYFWCXA^D\D^D]FcBdDy-Jo(F‚0J‰6J„,B‰4L'Bv>}(Bg9T5Y<hFºv̐¬Za®ZhÆkbÒudÖzfÔvcÍznφ{ΊyφyΉyˇzË„wʁvȁxȁzÄ}vÈ€tÄ|yÄ€xÇ„xÃ~|ÄyÄ‚z€xÀ}|Â}z¾~~¿||ÃzqÄzrÂxq¾wt¼to¹rq´lm²hkÊ~qßšzí±€ðº‚ñÁŠóÅ‘ñÈ™òÌŸòÌŸñËœñÊœñÈšðÊšó˝ðÊ ñÌ¡ðÌ îÊ¢ï̦îÍ£ìÏ«îΫíЬîЭîЮíЯîάîЭíÏ­ïÏ«s?r>v=t<v<z=&A‚$A~ :}<‚ <Š*A’4H¢DVÁ_jÓqsÚ€yß‹|åzꔀê˜}門뜀ïš}ðž~ð €ñž€ðž~ì’qèƒjàraÔ[Q¶DK)F‰!E›6X¹i„±Xq 6Oª8O±H^ÂbzÃsŠ‰4a^L[Ir4lb!M|Gsl)[b&Xa&Vj-]f*[^!TTT`!^s at v’k£‚E|‹Qƒ†Ny?rp4kh+hl1d‹\Žz;|j5m~PŒL€Žg †N‚‹V—_˜Öˆ¬k–¡hÌ¢ªÞ¶´êɾèűִ¤©ST©LT¤CR¢DY»{}Ħ˜Z<P?R;\=V<l8ˆ4F_;]9a:f;j<v%Ax%C|(A…+E^6^:g:šRd3H˜D[’,C¡1Fº<HÆGLÏNPÖRYÚ\\Û^_ÚXVÚXYÝYXÝ[Yß`]ß^_àcbâhlâloâliájiâldßrgØ[T·9@®6>ÀGHÊSMÑYSÕ]Z×`YÕ\YÔ[VÕWXÕQQÒOOÓPOÑPMÐKMÐLNÎHRÝRVßWXßf`ÙbaÀ>D´3@ÆDMÂNSµ>L¸FUÍadÙrtÏov¦J\]CVDXA[@dDXB\BZ>fAf@‚3JlBˆ2Fƒ,D€*@8K{%>k8z&@p=U5\8cD°hv͍Œ¬Yj¹jsËodÔzg×xaÔ|iÊvnφxΈvΉv̈zÊ‚uÌ„zË…xÇ‚xÈ‚vǃzÇ€wÃ~zƃv€{Ä‚|€yÆ‚vÂzÄ{¾}wÀ~yÀ|uÃ|rÄ{rÃ|uÀzu½usµrq±kn´hhÍ‚uá tï°|ò½…ôÅŽóÈ•òÌŸò΢òËŸñÌ ò̝ðÌ¢ðÌžñÊ›ðÈšðÌ ðÊžïË¡îͤïͨíЬîЪìЮîÑ°îЯîÏ­îÏ®îϯîЭîÒ­pAp>s>vAv"?}#A‚&@€=}>=†%AŽ.F”:S¨K\ÂblÒvwÛ~|à†yåŽxê˜~ëš|ëœ}íœ~ðž~ï {îŸðœuì“vè„mào_ÑZR´DM”-K&O¹m‹½g~¡:T£0Lª:TÃe~ÑyŠ¿l‚ƒ0`bQo)\|<iVE\HbPg*Zb(Xl1cm-`d&[YZ]^wJ—{¦‘a“ŠTŒ‚J€ŒVŒ}@xs=va'`o6j^‘gšNƒf)^xM{n3jy0]µj‚³pˆ¯^uÉŠŠÜ²ºÞ»½ê˼ÞÁ®´xxœ=L«KT¢AX³clе¨…JPP
=ZB^@cAT8c<.>kA]
5d9b8h:r @q ?|+Dˆ3Jc3Z6f8”H\ƒ(F•ER‘3H–*@´<FÂFMÌRRÓQRÔ][Ù_[ÙZWØ[[ÚXTÚ\^Ý^_âd`àgeãfhájiâlläojânhßneÑTR±:N®;K¨.>¥*=®0<³6>¼:@Á:BÄ@HÉHLÂ>F»;D·8C¬4A°/=¸4BÄ?HÕGO×LRÖRXÈER·?T²6TºDXÇWfÆQ^É\bÖlpÖuxÇinv$FW@UDY>`BeCZ>Z@bBfAt*Gz*Jm CŠ8L€*B‚0E‹6Hz">e
5€0Az)D[8]@^D£ZlʍŒ´htÄvzÐoaÔ|hØxbÖ|jÌ}qЊẏyÍ’€Ì†vÊ…wË…uʆwÊ„wʃvȃ{ÇxÄ€{Å€u‚|¿{À}xÄ~yÁwÃ~zÀ}w¾{xÃ|sÀ~yÃ|uÅ{s¼xu¸tpµnm®jl¸khÒ„qã¦xï³|ò¾ŠôƐôËœñΤóÍ òÍ ñÌœñÌžòËœðÊ›ñÉ›ïÊœðË¡ïÌ îÌ¢ð̦ïͧíάíάíÏ­îÒ¯îÓ­íЮïЮïÑ°ïЮïάl@l?p>q?v?|>€&A~!A~=€ B„$@8O•:U¯L]Ä`jÑvvÜ~uâˆxåyì˜~ë™zì›~îœ{ññ¢zð¢|ïœ{ìqæ‚lÞnbÏ[Z³BU˜/T°\€Är†£BW.J£2L²LhÎrŒÈm„¯_z~,\bKu2ch#O[HR?d&Rh-Zc,Wl5ff$Yj0bh*j^ bwH€˜v¦–k„L…€H…†K‡‡O„ŒT€Dv;y…L}Ÿ|ž„I~e'\j3n]"\ƒ>n·h{ÎmkÚb`Þbf伶ìØÑæ̾Ӭ›¢LR¦ESœ8Q´\hΩŸª~oSAXA`<b<^9T;`6s$>s >]=b<j<k=o ?n@v(Cƒ5Jj=a=d<’G\„*E‘=O6K“.C°6D¼@IÊNSÒRRÔUSÕ\Y×VTÙUUØXVÙ\]Ü]bàbeÞdbàadàejáspâppâqmànhÙ\^ÔV]ÖW^ÏR[ÈFVÅ>LÄ<LÊ@OÐDOÒLWÕN\ÔNXÐO]ÐP^ÌK_ÊN\ÌObÒLbÚUmß`vÚe|ÞjƒÚb}ÕVrÒ]nÔjqÒfhÙilÜrqÔnn¤DRZDVBRC\@aB^DU@W@f?gA|.HpBr?Œ6Jƒ0I‚+DŒ8Hz"Ah;{.F€1K[9\<\BšLaЈ„¹muÍ~|Ôq_Õ~rØxaÑ~mÍ}rщxЉxЈw·xÊ„wË…yÊ„zÈ…|ʃxÈ‚yȆ{€zÄ€v‚Â~yÁzÁƒ~‚|ÁyÀ{¾|xÄ}tÂ~vÂ}xÁ|u¼vs¸uq´on°kn¹nlÕ‹pæ§~ñ¸‚ôÄŽôʘôÍžòΡòΠñÌ ñÍŸòÌžñʝðÌ ðÊœðÌ ñÍ£ðΤîÍ¡ðΦî̦îÏ©ïÏ®îЬïÑ«ðÒ°îЫðϬðЬïϬðάh@kAp?q>v>y?} =|>|=z"B†,EŽ>U•AZ­QeÂeoÓsrÞ}sâˆxævé™zê›~í›}ìœ}îž{ð¢|ð£ð¡ïšzêqælÝqgÍVb³C`µgˆÇ|Œ¦B\“,Eš.L¨<X¿bÈqŠ¶Yv§Rp‚7bj(Wj&Rs/^^K^MXA]NVJn7ig%]d(Ws8xY^uQ„¦–¼˜g™n0jzE€Lˆ~KŠ…P‚‰P‚‚Gw‚Hxn2a{Do~D~l:vL„¥`ŽÜ}{ån[Ýa_ÓVaÛŽƒïÚËÛ¼«´pq GT¨FX²WeГŒÉ¦’`$FQE^DdAd@Z>U=`:p"Br <^9a;j?r"Ao!BpBr"@€2Hm?^@e>‹CYz)FŠ6JŠ6L’1H§7I¶@JÇMQÏOOÎSUÔYUÕTRÖTWÖXXÖZ\ØZZÞ_aÜabÞffÞghßpoàsnàqnáonánnÞfdÞZZÚVWÛVXßU[ÞRbàNWáKVäSZäZiã_pæZpèm…åw”æ{šå„œè„¡ë“¬ì µë¤±ìž«èwÞ_{ÚbvÒrsÚtvÜnnÖpoÂ__mAV?XCVBb@fB[AXAZAgAh Dy%CjBw&C‹:L-E†.G5K}(Gh>z*@„6O_=_<\B’B[ÊŒŠÀw|Ð}yÕs`ׁqØwdÒnÌ€rÑ‹tʉyˈwÌ„wʃwʆ{ʇzÉ„wɆzʃxÌ„{ŁxÀwÁyÁ~vÂ~vÀ€x€vÀwÀ|xÁzÄ~vÁzyÂ~vÂzv¾vr¹vu³no°gi»mf׋vçª~ò¼‰óÅ’ôΞóΞñУòΠòÌŸðÌ ñÍ ðΡðÍ ðËžïΠíÍ£ïΧîÏ©îЪîÑ©íЮðЭîѯîЬïϬíΪîΪðΩïϨñͤj>iBp@r@u@z!A#B"@z={?‰*F8L™@V«K\ÁalÐsqÞ}vá…væ‹tê˜~ëšzìzìž{î¡yð¤î¢}îœvèzäƒzÚpwÉWrÂh‡Æ|Œ¢EZŽ)D—,Eš0N®KhÊuµVtµOh¦JlŠ9fm)\f"P‰S‰k(U_ LN>XKSHvBzp*^b!S~J‡V\xX‡®œ¼“e’d+cd(d{I€†W’Š]•D€z<p|Cq[%_i-\VŒ‚PŒ’fž¥h•Õy‰äocÚb\ËP`ÎyâÌ„x¤FQ¬NVÁgiÚš€Ö®˜„FPSGZM]EbAb@Z<X;\8g:n6k=^8c<p >k:t!Bt">~+Ht@]<g?„:O|$A8Kˆ6I‡&@˜.A¬:HÀIMÉLPÌKRÐTVÐPRÔRVÓWZÔXYÖZ`ÚY[Ü\`Ü`aÜglánláppánnänlåtláhhÞ``Û\_ÙVUÜWZÞTWàVZàLWâNZæP\åZmçetêy„錎휘뚘ðŸ˜ï©¦ï°«í žænÜ`wÕhwÕvyÜxwØllÈjl5JX@WAT@ZDd>g?X<V:_;j=l=f<j@~-D‘@Sƒ(@‹0DŽ/Lv=o:~)A‰<Ob>`<]D>\ːŒÆ†Ð|uÔxbׁr×xdÑ€r̃sÌŠzÌŠz̉{ΊwÆ…yɉ|Ê…xÌ„wÌ…vʆ{È„xƃxÅ„wÃzăwÄ€vƒxÂyÄ~x½}zzÄvÁ|vÂ~v½zwºzv¶qn²oq­fn¾ojØŽtë®|ôÀõËšõΞôУñΝòΞòΠðÌœòΞñÍ¡ðΤðÍ¥ïΧðϧðÎ¥ïÏ­ñШîЬïѬðЫîШîÏ©ïϦîΤðͤðͤðÍŸñÊœhCkAl>r<s>y>z<| =w<w>‡/J“:Oš@U¬HXÁ^hÒrpÞ}t߇xäŒwé“{êšzì}ì }ì{ï¡zî¢ðŸ}î˜|鐀␔Í|¡ÁlÃpˆ B[Š$B‹$B‘+Kœ:[¹`ÄxŽ¬If±Ib–Dkw,V|2ks2`šzžp*WT<S@UI^%X‚N‡m+^f!YwFzf"ff”¬š¼•f–n1p] Zv=vt=w|Mfž„P‰z?wn6hg-b€@rJ‚žx¬ªp˜É|˜âkiÔU`ÊhsÔ¯²Ï°¦˜?P°W`Æjfä˜{Ø•~]TVCXJXB_DbDcB_<Z<^7^:k<k<_=`:j>p@r At#B},Dx(D`<c={+Cz"@Ž8Nˆ6L"?3J®<H»BKÄHKÉMPÎQUÊPVÎPRÐVXÐTYÖTYØYXØ\bÙY\ÚadÚlhàjjâmiätpäplánfßhfÝbdØY[×W\ØRUÚVZßU^âYaæR\çP\ê\nìjxên|îu‚í|…ìxƒîn€ípì{ŒçxŠÜ`vØk{ÖrvÜxyÜttÒnp¹W\d>U=V<V@Y>h?d<Y;W8`8g8w(Ba:h=€,A–BV„,F‘8JŠ5Jz$Bw$Bx$@‹@Rg:_>\FŠ>^É‹ŠÉ„‡ÏzwØ~hÖ†yØzaÑ€rˁrÍŠvÌ‹w΋xÌŠxÊŠzÌŒzʈyȇzÊ…xÈ„wȆxɈyÄ‚wÄ{ăzÆ…yÄ€xÂ|wÀ~tÁ~yzÂ|wÁzwÂ~v¾ztºvt¹rn²kl­hk½mlÛ’x첄õďõÌšöÒ¤ôПòУòÎœóΠñË¢òΠò΢ñ΢ñШðЦðϨñϦðЦñѬðѨðШðϦïϤïËŸðËžîÍ¡ïÉšðÉ™îɘñÈ—m Dg?l>n>v:x9v9v:s:w<†,G“8L™?S¨DTÁ\cÒppÜ~vã†væxè•yé™}ì }íž}í |î¢}î¢|ï£†ìšˆç‘ŠåŒ‰à”Înx°NW'D…>Ž$F”/Q¬RtɁ˜µRl­C`°OiŒ=dfOl&Z„U~”fŠf KZFZHRJd/`L…g"WA‚l8mt6u˜ƒ²¡„¬]Œ‘bž` \q9nzF…_%_xNw•j¥‡TŠŠSŠ~LŠŠZ–†Pˆ§‚°Ä„¢¼w–×t…ÉJ]Ձå˸´pw®SaÐtkå‘r躓¬ihZHYKZG[F`Ed!Fg CbBZ>^<aBe@f>f@b@f>t)BlAn"By*Fw(Ec>cC}6Q„.JŒ9Kƒ0Hz!=‡*D 6I³BL»HRÂKOÇLPÉMMÊMRÐQTÏTVÓZZÖXYÔ_dØZaØ_fÛfgÞhiÞjhàloâpmâmlàieÜcbÛ`fÛ^[ØWVÖTWÕVZÚXZàYZâVYäT`è^pébxêbyëk‚êiìdzébzçcxâ`vØfzÔt|ÛvtÙ|xÒlnÈfhŽ4KXBXBVCSAZCdA^@`>]>h>f8r"Ad<k<‰.B’9T~&DŒ8M‰1J(C}'Ds>ŽDWe<b=^F‡>_ʈŠÎ‰‡Õ~tØ~n؆x×{fÍ‚tˆỷzÊŠw͉xˈxÈ…xȆxʉ{Ɇy̆wÊ…xɇxÆ„zĆxāzÄ‚wĆ{āz€xÀ}y{¾|½~y¿~{Á|tÂ}uºvt²rr°nn¬dn¼njÜ’w÷Ê”öРöÒ£öѤóРóÏŸóΠñÍ òΠòШòÑ©òШïÒ¬ñЩñÑ©ðÒ¯ñÓ¬ñѨðΡðÌžîÌŸîÊ›îÈ™îÈ”ïÇ”ðÆ’îÆ–ðÇ”e>d:j:m9l:s<v:q:r=x;‹/F˜8K˜EZ¥@PÁZ`ÒnlÜypàƒrä‰sè’{ì~ë |î¡|ð¡{ï }ð¤€í›‚葃â‚|ÚtqËY[¬@J(@ˆ"E(M;\Âz“¿g¥Da°H^®Xx„:`cR`O•t˜’]€X?XDZMSOwF|xDwXPv:qv8xv<r§šÆ–hš{D}”zªEˆ|D€‹c–n3ne+duFo˜n¨ŒN‚’x­™pš‘T˜eŽÎªÁ€Çp“ÄJaÍ~ƒÖ¼»»iqÏwvärí¸—À{fn,NVL]"LXI[G^Gg"IdDb*L\D_FbEcH_Be!DhDe!Dj Du&En#Cw,Fz+Hh Ed>v-H‚0L3F2Hy"@…,D˜-A¬;H¸BJ»DLÂDIÇLOÈOTÊRYÌTUÏX\ÓXXÖabÖadÚbdÜddÜfkÚfjÞhlàijâkfàmjÜddÜbdÜ^_Ú_`ØYZÖ[`ÔXYØQTØQWÜQZáXZáZcá]hådvä]gã\jáWfÜVbØdsØuvÙxwÛsrÖttÌjj¦DMx#DT<XCVBX?_Cb?`Ah@`Bh=j@p"@e=m:ˆ4F‹8M'FŒ8H‡/E…0Gy >x:’FVi;d@`G‚;_Ȇ„ÏŽ‰Ð}m×€p؆tÔjÍ„sʉvËŠvÈ‹z̈u͉xȇzɆzˉ|Ë‹ÿwÈ…yÇ…zÇ„wÅ„xÄ…{ÃxÀƒzÄ‚v¿z½€x¾~x¼~yº|x¼yw¼vs¾zrµtt²qm°lm¨co¾liÝ•{õÊ”õÒ¦öÓ¨öÒ¢òÑ¢óΞòФòÏ¡òТñϦñÒ¬ôÓ«ñÓ®ñÒªòÒ¨ðѧñТðΠðÊ™ïȘîÈ–ïÆ”îÆ—ìÅ–îÇ—íÈ–îÆ–îÆšf&Lc<f<g<j:r=p;n;o>w;Ž3FžAM˜8L£=NÀV]ÒjfÚvoށtä‡uè•xëœ}í¢~ìŸ}îŸð}ï¢|ð¡~é’|ä€oÜqfÍ[T®@K’)D"H†$N©TnÄ€—¥Fi¨C\°Lb Nil"NcUo&Y~™‹TyQ
=^HSHRKP‚j1^XP\!Vx=‚~F±¯Îœv§o1n|R„–q¨ˆVŽ’lœw=tg,bb$czP€–€³“r£ŒMv§oŽ|?k­xœ²_~¶z¥ÁUoŏœÞ½܂pì—x쥏ئ{v*KXNXJ\H\ L` LdDhAj!Ca@Z?`Bg!B`?_@`Bq!Cp$DhBt(Bn"@t(Bx&Ek?a@o$C3P|,C‡6Ls >|(DŒ'@¡1A°<F¸GO¾DN¾BFÂKSÇLQÉRVÍQXÏTXÕ[\Ø\]Ø\`ÚdfÚaeÚflÝfkÞjoßkmßgiÞimÜdfÜ`eÛ`_Û\\Ü^aÖZWÕXZÎTXÐQTÑMSÒNRÓQTÒOZÑLTÐP\ÒT`ÔhsÝ~Úz|ÜptÚrqÏqm¶MP…)AiBVBT>R<W>^?]>hBeDn"Cc<i;h;j;n<”DS‹2JŠ0H‹5H‡3D….Cw=x"@<Jq:d?`F€8[ÉҐŽÑ{lفrØ‚vÒ}mʃwʉxÊŠxȈuȈẅzɆ|ʈ}ʇ|ɆẍzɇzɆzÌŠxɈzÄ…yÁƒ}À…|ƒyÀ„zÂxÁy¼}z½}v¼{xº|y¼xqµvt±on«ik§agºjiÙ–xö͝öÔ¨öÔ«öÒ¤ôУòУòТñТòЦòÒ¨òÔ¯ôÔ­ñÔ®òÓ«òЦðͤñÌœíɘîÈ–îÈ•íÈ—îÇ–îÈœíÉšîÈžîÊŸïË¡ðÊž`?b>f>k@h;h8j8f6k;z"@”<OžBPš>O¦>N¾V^ÐhbÚrnÜ|râƒté’|ëœìž{ì {ðž{ð¡{ñ¢~ð¤{ðš{èwå„pàqdÍ[Y±BL*E‚DŒ'P®Xrºu’ @^ªF`£Rj{7]\L^Ty2ct”€=bXAXFOJ\'X€I~g&X\TNPa&df²¨Èž€ª‚Gˆg5n™‚´b›‘nŸG‚q<zr6w~Z™mœ™x¥–cš–Ms}7j˜f”–Mx©d¾QgÔ©ªÛ­¬Úzræ›å®~ƒ8GVFVG[J\F[C^BeCj Al BdAW?]<k@]@bAa!GfCm BqBj@l @o?s#@l?dAjB|-Kv$C†:Rt#Cv#B‹,Ež,@¤6D±<Eº@F¹CH¾GL¿ELÈNSÌOTÐUXÔXZÖ\^Ø\_Ø_fØaiÚhmÝfjÜjlÝllÜhlÚgnÙbhÛdiÚ`dÙ^dÙ`dØ\cØbf×dgÖ^cÏ[bÌW`ÎZfÑ^jÔbgØirÛu|ß{zÝ|}Úp{ØhrÖpnÄlm€ >…*Cc@V>UBT?Z>aBcDdCl+Im$Cd @e>j>i>k>•GW3K‹.IŒ8HŽ<P€)Ex<z%BŽ<Ls=o"EgHz4WăˆÕ—ŽÓ}nÚ…zÕ€pÎ{n̆vʈxÌŠ{ËŒyȇ|ÌŒ|ɇzˉ~ˈ{Ȉ̈~ʈ{ÊŠ~ÌŠ{È‹LJ~ņzÀ†€Âƒ{À‚{¾z¾€w»~x½~wº{x»zv¼ztµro°onªhj£_e³hhÜ•vð¾÷ÏžõÖ«öÔ¨öÒ¤óТóÒ£óÑ¢òÑ£óѨòÓ¬òÓ¬ôÓ­óÓªóЧñΤïÌ›ðÊœíÉ–îɘïÊ›îËœïËžðÌ îË¡ðË¢ðÍ£ðÍ£òË¥bD`=f>h>f=i<h9f<j:„,FŸL\§GR¢FR­J\ÂX[ÐedÖqjÜznâ…tè’vêš|ìœ{î~ížzð|ð €ð¢‚îš~ê’xæ„pàtbÒ_X´CL)D‚EŒ#N®Xt¶p”¤<Z¥Bc:`y2Zi(WcUt4]b†h L\HUFGC`-\y at p^Kf)\WUR[˜¬«—½–{«™p¢t<„f“š{°–p ‰TŽ‚SŒlžLtBvl Ÿj–Dlh-b–mœ˜e˜—`–§V„Ö ¢Û¸½î¦ñ¿¡QTVIWJXEZF[BZD^Ah!FgAl Be BZB_Ah"EbDgD^DbDf"Fk BlDl Bp!@t"Br'Ch@d=x%CpB€3Jt'Cl?‚,B“+Až5C¥6D®<G¸CI»EN¾IOÆJTËRWÏU]Õ[cÕY^Ö\aØajÙ`cÚdjÛikÛflÛfkÞfnÚfiÙgiÚcjÚejÙglÙbjÙefÞmnÞqpÞrpßtyÝx|ßx|ãvxâw{ãzyá|Û|Þx|ÙhvÙqsÑol«JUc8€,E^DXAR>UBX@`B`BhBg Bj#D`?f;d8g=j<˜DTŽ4J1HŽ7FŒ7L‚)Az"<{">Ž:Fw%Dk8fGt,N„†Ô“ŠÖ~oØŠyÔ|oÌ|nË‹yÉ…xÍŠxÊ‹|ʉwʈ|ƇzȆzÉŠzɈ{ʈÊ„ż|ȇ}Ƈ|Ć|ÁƒÁ…zÁ‚|À‚|½€|¼x¼~{¹|v¸}zºzv¸xw´sq®kl¨gj¥bi²gjÛ—vðÀŽöÒ¡õÖªöÖªöÖ¥ôÒ£ôÑ£óѤòÔªôÔ¬òÒªôÓ¨ôÒ©ñФñÏ¢ðÌ ðËžîËœîÌ¡ðÌ¡ñÌ ïËžðÍ¡ðË¢ðͦðÍ£òΣòÌ£òÌ¡bBb@d<e<c;e:d6a:i<Ž5F©ITªLU¨FR²JWÅ[`ÎhfÖpkÝvkã‚tévë˜}ìœyìœ~ìž|î~ïž‚ð ~îš}èzå‡rÞtcÐ`Z¹CH’+G… DŠ$K¤Ff´hŽ«HgHmŒCf5\l&U~8gu3X}Ck^H\EPHLEh4ay=nWKi*[] ZY!_Žlª“¶‘q§ƒO‚—m¢|M€¡’½–q¢ˆWŠaŠ[Šh1guFƒ‡b”¨n–§Dbo&WŽbQw¡g”·e~྾ïÊ¿ö¾“Ât_m#HSETEYF\I\B\A]@hBlChBg@U>\@h Da=c@c@\@aChAm"Cl@p @t#Aq$@h<`<n <r?t$Ax+DhAv$@ˆ&@Ž%;¢4C§6D²AH¹DL¿FLÄIPÈKTÍU[ÕZ[ØVWÕ]aØbf×cfØikÚdkÚfjÛgmÜimÚimÚjpÞjmÜhpÜpqÜnrÜpsàvwà{} 煇猆戄æzå|å~{à‚ß|zÜu}ØrwØspÈnhy=a<„.FXCR=UAZBXB^B^Bm'Fh@o&G`<k>a9d@n>›LX5Jˆ-DŒ7JŽ7EŠ/C€(A„.D6F|'Bf<pLp"JăƒØš‹×†sØŽ~ÐxfÉqÌŠxËŠvÊŒzÊŒzÉŽyËŠ|Ĉ~Ć€ÆŠ€Ä†ȇ{Å„zǃzƇ}ć€Æˆ|¿„{Á…Á‚zÀ…€¾€y¾|»z¹||·|z¶xxµwt°qr¨jp¦inŸbl¬dj۝~ñÑöТõÖ¬õתöרôÔ¥ôÓ¤ôÒ¦óÓªôѤòÐ¥óСôУñЧñΤðÍ¡ïÌ£ð΢ðϦðÏ¥ò΢ñÌ¡òÍŸòÌ ðÌžòË òËœòÊœóɝb<^>^=d>c@c>a>b@rC˜;KªFP§HT©FS´JSÅ^eÑdbÖqhÛwjä„pê’xë˜|ì›îì›zîœ|ðž}ðž‚î—{ìwåqàsbÒ^V¸DO˜1Jˆ"Dˆ&L”;Z¨\€¬Qt¡Nl†3`v.\s-]ŒKt€>ev8b`JVELDNHr:fx;lQH`Pf"^Z[}W€œy£‚ZŽ€TŽŠ_–‰Srœ}°Œ\ŒŒ^’€N‡v;wp:tsBuœpœÀPv¾Eh k–r:d’Y„¤JiÓ–„êȱÀŠjh$G\IUGZI[J`!J^ H]G`De?l Dm Dd?W@`Aj"@_@f<l@^>\<`;j Bi>n<t!>t&Ai=b;l>v$Dn ?{,Bh=q;†+@€:!8˜0>¦<G®<D´CO¾FNÅJPÌNSÓWZÕ\_Õ]e×`b×cfØhfÚfnØgnÚglÛkkÚmpÛnpßoqßtwá|}ây{Þvxãvv䃃拉猆蒋鑎劂æƒ~â~}ß‚€Ý|~Üu~ØuvÔyq®RZ\7b:v#BVBVBVBVDVDbEi$Il"Bt,JfAf:j<a>gAo? S_‘7LŠ0F‘>QŠ1F…-G&@‡.F8N{(Ep>mKp H„†ÖšÖ‡zڐÌuiʆxʆyʐyÌ‹|ÉŒzÉŠ~ÉŒ€ÄŠȈ~ÇŠÃ…Æ„dž~Â…}ņ}ÄŠÆˆ|‚yÁƒ|Ä|¾‚º~z¸€¸}v¸{w¸|y´zx´wv±rr©lp¤ek£`l®imÞ¢ðÄ•öÓ§õ׬õÕ§öÖ¦ôÔ£ôУôТôТôÐ¥ò΢ò΢ôΠò΢ñΤòΤñϤò΢òΣòϧñÌ¥ñÊŸñÊšòʝñɘòÈœòÈ›ñÆ–ôÆš^:`;b:a<c@b@`>`Ft>•6H¨JT¬JS¦DR´LVÉ^_Ñd`×neÝ|tâ…qèvêœ{êšyꚀëžzížyîœ}ðžƒîœzêŽxæ„oÞraÐ[U·CJ—.F†BŽ*Hš7R¡LhHl¢Ji‡8fw/Zu5a€;aˆGmr2\`"OXJNFMFu at mx6gPIZNf"Vj)j~Pv˜qœQuB}„YŽŽdž‰]–•t¢’h¡’m Œ_˜†Tn9vl6n¡y¡°R~ÒLd±p˜r7bKx™Pv¶u†Ð¹¶t:RXJf FUDZB[E\A\CZC_;i$Eo'Fn<`AX<bAn"@`?b?l=c>]<`<f=n>l=n;r ?lAf<g<t"?o@s"=k=m>‡.A€";r6ƒ7ž-=¡2>®:B¶@HºBIÅJNÌRVÔVWØ`d×`cØacÖbfÙfjÛfkÚinÜorÚmtÜnpßtxàxxä䅄၂âƒæ„„叉蔌葉玅萌准䊈߈†Þ}~Üv|Ú||Ïun‹/IX>kAw$CTAUAXDTBbHb!Dm$FhAo%Ca;q$Bo!@b:l;x A O\“8P‹3I’@V:M€'C€'?ˆ.DŒ3Hv$B~&GkEr$LÂ…‰Ô•Öˆt؏‚ÊtiÆ‚tLJxÍ‘|ÌŒxÉŽzȆ|ÊŒ~Ň|ȉ€Å‡|Ć{È„{Ć~Ń}Ȉ|Çzˆ~Ã…{‡}¾†|½‚~»€|·||¶}z·|vµ{y³xx´uv®tt©lp¤hpž`j²prଋòËžöÖ§öجöת÷Ö¦õÒ¢ôÑ¢óСòΡòϤòΠòÏ£ôЦòÒ¨óШóФòÏ£òΞòÍ ñËœòÊžðË òÉœñÈœðÈžñÈœóÇœñÆœóÔ_:]>]>`>_>]@]A\@t @—;L¦IQ­JR¨GT°GRÆ\^ÑhdØneÞxoã‡xé{꜂êžvì›|ìžwîî›|ïž}îšxëtè…qÞs_Ï\T´CL”+G‚B,H–4Q¢Nf–GhKiw&Rj)So*]h#R\ƒm0YZLa OUIOHr<ft2fQF]"T\Ts2r„M€dŽ‚XŠ`#Xb&`i3eˆa–h¨™{­—t°j‘fšQ’p8yžz¡£b–ÁHjÆ€žˆBfn5a•Ut£X`Ǭ¤i)Pw:U_LUIZH\H^G[D^H`@p-Lp$DnBb?X9d?m"B]?\<f>f@Y>`=`?f;k<p>k?r<j=h@q!Al>t%?t"Ah9€-Dƒ,Ao6p4€6&:ž0>¦<C²=B¼BHÇMPÍUZÔZ[ÓYdÖ^cÖbhÙdjØejÚlqÝsxÜsxÜqvàzyá}€ã†ƒåŽŒäŽŒæ‰ˆæ†ç‹ˆèˆæŠˆäˆ‡èŽäŽçŽ‹Þˆ„ÜxÜvxÖ}xÅgfj9W?v'BgBSBZFZEUF^F`Fn'Fk#@m @^<s*Ee<e>jAy$FŸVb•?P2L’DWŠ6G„(B…0G….Cˆ*Bv$@….JbBlI‰Œ×™Ö†~Ö‹€ÉykÈ„~ʇxËŽ~ÊŒ|ÈŒzÇŠzÆ…ă~ƆĆ~Ä|„À„}Àƒ~Ä|Æ{Ɔ{Áƒ{„zÁ{¿‚}¼|x¸}z¶{z¶zy´{x³vt³ss®qp©np hjŸ_m¹wv紏òÌŸöצõÙ®öק÷Ô¢ôÏšóÎœóΠòΟóϤòΦòÒ¦ôѧóѤôÒ¥ôÏ¢òΠò˝òÉ™ðÉšñǘñÇšñÆ™ñÇœðǘòÅžòÆšòÄ–ñÀ‘^=^<aBb@\<[<`B`Dt#D‘5H›<K BQ£CP¶HPÉ\[Òh`×leÞ|lã†qè“yì™ë›vëœwëšzîžyîžxï¡~ï›|ëpè†nár^Ò^X´EL’+D†"CŠ,J“7R G]¢Pp€0Vk"Nh#Rb!Tb&R—kŒj*XY!N`#OWLTNk4^t2cRJ^!RWQj,i^Š”j˜…X‹f&^Z S] \l5p„Z–u¨–s§†Z•”s¦’s«„X˜”h•ªnœºf“Âx–¯G`Fv…I`…@[l1Lh)Nz6QTLWI]Gl$F^D[D[F`Dq#Dr"Dr"CaBZ?dBq&D^>_E`>n>_;^<d=`>k @m?n>l:k?k@p$Bl<s"?t(Ch>z(Bƒ,Ar<d7g5u3†";š.<©0<°8DÁEJÊOTÎT\ÐZbÓ^aÒaiØcjÙfnÜhnÝmpÚrvØstßvzâyyä~}捍䒍厊匊萋把半犈葑瘏唎ކ„Ùv}ØzzÑzx´JQa?\>v%D^FWK^!JVJXJ_ J^Gn$Cr(Ef:`=j!<e<b>l=x#AžT_•=R5O’GZˆ2G…*D‹9H†0Fˆ.Hv&@‡/Kp"HjHƉٜ’؈|֏†ÈxoÆ€wɉxÊ‹xÊ‹ÉŒ~ÈŠ{Ljz‚zÁ‚~Ć}Ɓ¿‡Á‡À…€¿ƒ}¾†~¿„Â…{Á…|½„}º‚€¶{º|z¶|{µzxµxx³zy¯vtªqq§nq¢ckŸcn½€x긎ôСöÚ©õÛ°öÖ¥÷ÒžóΙôÍ™ôΛòΝóФòТôÑ¥ôÒ¨ñѦóѧôΟò̘òÊ™òÆ–ñÅ–òÈ–ðÅ•ðÄ’òÓñÔôÁŒð¼‘í¶ˆêª‚^B\>`D`C[B\AY@[>mA‚.E˜:L¡BPªGRºPXÌabÔiaÙngß|nå†tç“xè™zêœ|뚀ìzížzîž|î |î›|ì’té†nâr`Ð^X²@K‘*F€ D‡(H’4N G^¤PbcG^GbLYRe.Z•_~€<dVJd$Pi)XVJo2`l*]RGZNSOTU]’œt¤’st2hZPl*jl8p{I„ˆYŽ‹d™’j£—z®–x­†Z“Œ_š›c–´tŸ´~“Lv–Dk‡Ia’N`^%No+N[#JX!KUE\FaD\EYBXDa@r @t@u$B^@V>eAx(C_@`B`Ai$FaA[@d@]:b>k Bn!Bh<l!>d=lAn#Ep =t'Df@r#?~+D„+Bh<a:a5s5‚9’(>¡0A²>HÂJLÈRVÌSZÎTZÐ\aÕ`i×bf×cmÛkkÜrtÛqvÜvtÞv|àvy䂂≄扈捍撍璑揋匈玊䎋⋇݀…Ørz×yvÆmlª@IY;[<s#HZHW"M^$LX$OX L]J_!Jo%At.Id;f?e>i@i<l@„,E¡Wb“>LŽ/G”CT„.Fƒ)@Ž6J‰/D0Gx"@ˆ3LjFgHȆ„Ö–ŠØ‡w׏„Æ|tŁyÄ„uĆzÈŠyŇ|ň}Â…€Â‚}Á‡Ä„€Å…~†ƒÀ‡½…~ƒ|†~À…¾„|¿‚z¸~}»~y·|z´||²yw³xw¶xv±xt­rv¨nq§jk bl£dkÉŠzóÒ¢öÛ­õÛ®öÕ¦÷ОôÍ›ô̘ôÏœòОôСôÒ£ôÒ¨ôÒ©ñЦôΡó˝òÉšñÆ™òÆ“òÇ™óÔðÃ’ï¾Ží¹ˆìµ„ê«|äœz؇eÃgOa?\?]=\=[<Y=Z<\Bf@y$B“5FžDPªHTºTZËcdÒd^Úqià{ræ†tè’zê˜ë—xë–{ëœ|î›|ð~ð›~î’tç†ràuaÐ^Y¬ALˆ)Ex D{&GŽ3N¦[t€3Ub F\DWIj)[v>j€<]4^YKd&Sl(Vd"Rp.\h,ZSHUKUQJPR‚ ƒ²’sš‡P…_Vs9ro5q{D|‡WŽ€K†Žf Ša”œ†¶˜‚¶˜}°Ž^– s¢¸‚¦¾Ž¨x4cyAfŽMeŠIdZ"LRKT"LTJZJ\J\H\JYHd Jr&Hw+H~,HcAWBc>v(D]@^Dd CgBe D[@b@bA`?f?l!@j Bn%Ck%Dh>nBn!Co#DgBo"D‚.F†+By"Aj<e9f9n:|:Œ,Bœ.@«8@­<I²@KÀJMÅV\ÇU]È\fÉ\hÓbiÕgkÜjkÜprÝrxßvzâ}€à|~åˆ‰æŒˆæŒ‰è’Œä‡„ã†‚ä†‚à…„ß„„Ûz|Ör{ÐsrÆgd©@NZD\Ej$LY%OZ$N[&PW$O\$L_"L_ Is+Hr*HbDm'Ga@fBgChA„.JžQ]’?S‘;NARŠ5I†0F;NŒ8M3H~,HŠ8NmJl#LĈŒØ’…Ø‚xÒˆ}Äxp¼tp¸ur»|tÂ}sÀzÃ~wÃx‚{†‚¿~À†‚À„€Â„~Á„|Á€¿‚|„|Àƒ~¼|½€|µ}~¸}zµzw°yz´zx²uv³vw®ux¨no¦hlŸcl¤foÔ˜zïÃ’öÓ¢öÚ©öجõÕ¤÷ПôÍœôÍšôРóНôÏŸõÑžôѤöТôΞôÍžôÉœñÈšòÆ—ôÅ•óÃ’ò¿”ﻋꯆäœpÙ†cÄfP¢FF€- at h;X<[@ZB^@^?X=W;YC`?p@Ž1FŸDP¦FR²IRÇ\_ÑfbÙukàvãŠxéxè˜|ê–{è˜~ꘀízî|îž{ï˜zì‘rè„pßq^Î[T®AK„&DiEƒ/T¬f„¦^„ˆ9a“V~WHNIp-ZŒJro,Tv0Xf"Mg%Se&Tk(Sl,Wc$RTFTHYRKRlDt¢Œ»˜w£^g(\n4er6pf*d€Dx`‘hž{F‡^ˆ™{«„TŽ’nª›t¨¯¸¾‡ª›gŸ£x¦¤iˆ¨n„h1VLHNFSFXJZF\H^F\DmB{&B.Fz&DX=X=g!Bx,E_A]A_>hAjA^@_=c>[<a?f>h@o"An BjCq(Fs&Er(FiDl D~+G‚+Dˆ,E|!>u>q>n:x<{7";† :„":‹&<–0@¡;I¨@KªMX¶TbÀZaË\cÏdjÕjnÔnwÚwzÞxyÞtzá~|㇆䉆劄ჂÞ{zßzxÞ|xÜ|zÕpuÐppÊkhÉ^S—0BX@ZB_FXJ\"MZLX$N`#Na!L]Jn,Jl!DcCiBbBa<gBo$H„.J O_“CZ’>R=S‹8M„/FŽ=P‘:N7I&@‹6Lo Kt)Oȏ×‚Öˆ~΂x¹roµhf°ff¸lk¼rl»vn»uwÀzw¾z¾|{¼~¾„‚À„~„ˆƒÂ„~À…~¿‚~¾‚}½€|¾€y¶¶~~¸||´}|°yx°ux¯vw­su§nq¡dp `k­ouÞ¨ƒñÇ—õÔ¤÷Ù©öÖ¦öÓ£öÏžôÌ™õÎœõΝôΝôÏŸöΞôΠõËŸõÌ›ôȘõÈšòÇ“òÂ’ð¼Šî´ˆëªâštÒ~h³ULˆ0?i8^<X@U>Y@[>`A]>Z<X:X>V>];q B†-DšBPœAO¤ANÁTVÑe_Úpc߀rã†rè’yé–|è˜~é—|ì˜xìš|ëœzðŸ„ð˜~êŒtã„lÚn_ÈTP¤<Iz H†7`ºšÓ°°¥Lm Ut±t‡UEOGc M~8`q0YfJl'Ph#Qa Np/Z]H\LWFSHWLMPa4e Œ¹~©Ÿ­ƒJ†€L‚z?ub$`p6m”h˜’w¢J„q;o…c–}S“o¢Ÿƒ³®’¶¢y¤ q¢­†¦·™·±«•fŠX)SQNRKUKXJ[JZG[Il E‡2L0Ix)EZAT>e<{-D_?`A\A_?hA^?`?d>]>c=dBf@n!Aq%Bo"Cp$Dr%Ds%Bo!Bh=p!@‚&A”6G‹-D~"=z@~#?Š/J.MŽ6O”5OŸ>[§H^®H`¯Lc²Kb³Qc¾UlÄ\lÌXhÑ_jÖdtÔdzÚuÜu~Ý|…ßz‚á‡â‹âŠŠà‚Šà~†à}‰Ý|ƒÖp|ÈhrÆipËlb½VUˆ4KYF\F[L\#NY'OY(SY La%M^"L^Go,Nj$Ff Dd@a@_@d=r$D€,HœN`“BV‘<P‘CR‰<R„4Lˆ4L8L6H}&DŠ0Kw*Px*PÌŽ‹×Ž{؉Èyr¯ff®`b«Z\¬\`´c`µjn´nn»ml·tu¼rr¶tx¸wx»~z¾~~¿|zÂ~z½‚¿…‚¼‚¸€‚¼€|º€}·|x´zz±yz¯uw®tvªuvªlp¤jqžcj `l¹xt䲋òʘõÖ§÷×£öÒ¢öÏœöÌ›ôÌšôΝõÍšô͝ôÌ›õÌœôÊ™öÊšõÉ›ôÇ’ó’æ¨~Þ’nÎvZªMJ€-Bc;Z<T7U:Y;^>^@`=`A^>X>V<X9T<Z;q;‡-A—=G˜;Ož9J¼IRÎa\Ùqeß~oä‡yæxè–|ëš{é–véšwë™wêš}î™zî—{ê‹päjÚlbÃRP¢7S˜Agتܾ¬–JT|$XšRmŸc~TGMCUG~>gv4]aKj$Pj(Rf#Pm*S\H`JTFSETHNOb0`™|¨–n¢¥ˆ¨—jœt8dy9kf&b`!]~Hs—w›zC|n6t‹o¥o®t>x˜{§§Œµ ~¥‰Tˆq2[“Nm§†®‘´“ah0YNBM@RDVBZGZDlCŠ0H…4Hu(GT<R=h Cu$B^B_@]?^Be@c?\?b>c?_=e@`?g?m$Cj#Ei?o!Al!Am Ag=j<€'=‰,A‘-B0E˜1H¤?NµLZ·OZ¾Q`Æ\gÌajÒbkÐenÒptÐpvÏjmÌinÊlnÎpzÒnr×uyØuz܇܃Þ‰‚Þ„}ß„~Þ‰‚ߏ„ޏ‹à“Šá•Žß”ˆÛ”Ž×•–ÕšžØœÃ–£av{A_e.MW#HY'PZ(NZ#NY$L[!H^"N^Gl#Dh"Fe D`>^BaA`=t%D|*F›LZ–HYŽ8M“FVŠ:T…2L‰8N‘:N0I}(B‚,H{+S~5WЖ‘ׇtÕˆÁmh¦X[¬bb¦RX¨V^¯ZX¯`f³ae°bb®fi¶on±hl²nt¶st¶tuµwx¹vu¾~xÁ|¾‚~»‚€º~yº}z¸}|´yx°x|®xv­svªqp¨mp hp`i¡_kƉ{꼏õϝöÕ§øÕžöÏ™öË’öÌ–ó̘ð˘ôÌœóÊšöÊšõÊ–ôÈ”öÇ‘õÇ“óÁŽí¸ç¬†á~Ñ…o¶ZQ‹/@e;X;T:O:R<`<n<p>eCf DfBfA\=W=T:R<X;o<‚)=3CŒ0D’1E¶OTËdcØobÞ|sã…wæ“|è—|ê˜}ê˜|ê˜|ê–xé˜|î™}î™zèŽrã{eÖh`½Qb±UxР¯â¿¢GLˆNmr%TžftŒLaX KT MPD|<d{8an*Vi&Tl&Tt2`_H^Iq1]VIXIXJVQu>s™v¨’fŸ’hŸ€¬„N„u8fj.d[Ob%XwFswAƒZ˜žŽ·“qšv>|R‹žˆ³¨’ºšw£x at xb"Tu6`´”¨¾¢»¦ƒ¨f1aGCNFSFUE`Dn@.HŠ8Ks @T>T=o*Fy(B^@]@`>^>cCh?\>a>b>\<aAb>d Dg An"Bj<u&?j>f<f8c8t$=†,D’3D“6I¦AO¶KX»O^ÄZfÊ]`Ð`dÐ_fÓ``ÔcfÔlhÔihÓheÑjkÍljÔpn×jk×mrÜtwÜzwÝ}yہ|Þ|{Ü{zÚ€€Û€xÚ‚~Û‚|Ý„‚݈à“‰ä›‘槜貝鸣ᷥЭ¤²˜‡\{j9]R#IW$MUJY$M[E^EfBf BaAX@XCi!F`?s(F{(G—KY”G\‰7O‘FX:S…2LŒ5J;P’8L‡-F†,Hy&N‡:WÓ•Õ€jÖ†}¸ff¨QX´\\­Y\¨O\ªSW¨U]¯Z_®Z^­^c¬_hª[c¬bi©bg®fk¯jn®ln²ps·ss¸zzºzwºwv¶yz´z{´z{°xz±y}®ts¨or¥jq¢gnœaj¤dlÔ—ïÀ”öПøÔ¢÷ÒžõÊ”öÈ’öÊ—ôÊ•ò˘ôÎœòÊ›ôÉ™òÈ”ôÈ”õÄ”òÂí¼Žç®Šß›|ÒŠu´e_Š8Hf:W>S@P:Z>e8w"=ƒ.F€*Di>i"Dl$Fd!Ed@^?Z>U:V
8l=z!=†/A…/F/E¯KQÌcb×lbÜ{må…vèzè–{ê–ê•~é˜|ê—|욁ì~î—{èŠrâzjÕklÊj€Û«®Ü°Œ’BH}0Ru&Pc K[xj*PL?MDNFw8^„Bhp,VdNl)Rn)R` M`Q~Dmd!Q] M[LXPp4j“k™•m Z’šxœœ~©|Fv^&UNK]#]‚WfŸ“x§Ÿ´€PwD|RˆŒe’ž¦”T|”iŠƒFzd P–_vÓ µ–«¢‚¬a0`MKSFVFbEs#Gƒ-GŽ:KmBXDXBt.Hx-I]C]CbF]B_@fB`@_=`>_>_@bBbBjBo#CkAl?r#Ce?d;f@m>‰-C”2GŸ:JµFSÀQXÊV^Ð`fÐ_dÐ^gÌY^Ë_cÏ`aÐbcÒfeÑedÌglÏihÓjoØmpØpqÛvuÜvtÚzyÙ|zÛwwÙyvØvtÙut×xtÙzwہÛˆ‚ß”‡âŸŒâ¨–çµ¡è·¥ìº¤í½¦ì¾¨à¼¬À¢¥“k†n?aX,QW(PYH^HeEc E^BVBXB^DdEv.N‚1L—GU–Ja†2KŠ;PŒAZ†3M„0L:OŽ6N‹1H/Mw,U‹>[×™”Ö€n΀y¸bc©Zb°]e¶cd¬Zb¬V\ªYa¬R]®\bªX`¬V`ªYc¬Z`£Yd¨\b¦\g§ah©di¯hl­jp¯mp±pr¯pw°tv±uy¬sv°ux¬rs©or¤ktžfrœ`m¨dnØž€òÄ“öÏšöҝø͘ôƐöÈ‘÷ǐòÇ–ôËœôÊšôÉšöÉ™õÈ—ôÃŽóÀî»”굌⦋ה|¿rj—DLoB\BS:W;a>k @})DŒ1GŠ4H‡/Hx,Hu*Jp(Hm%IhCfA`CV@W@f>{#?‚)A‚%=ˆ,B¦BLÄWXÔf^Üthå‚sæŽxè”}ê”|è–zè’|ê•|ê–}í™wì‘wè‰tâ~vÚ~Šß­¬Ó’u4Hx$H‡8[f"T|<_¯xˆVDLELCLDn*VˆDjv*TdLg&Ri'S^NeT|Ej~<he"S\M[Nf&`q>n‘j˜šr£†S…“m——w¨p7w`*fq9tƒP†˜w¤¡’¸k’h1jwJzF‚|FŠf”—p¤~Dn}@lt8v„Ii¬ˆ ¢jƒ¨Œ ¡‚¬T"MODVFf Es)P,H‘:LhEWCXDj%Fy/NfH\Fb D\CZ?cCh"G`B`>bCbDfD`@eAm#Fm&FjBl Ce@i Af<m>‰2G–7K¢:K·J\ÂT^Ê[`Ð]`Í_dÎZaÌ[`Ê]cË`gÎfjÒbcÏejÐhlÓknÖilÖgmÙnsÜqqÛvtÛvwØsrÚrtÔqqÔtuÖqxØrtØvuÝ{ÞŒ‡â™‹âŸŒãª˜æ´žçº¤èº£é¼¤ê¾¨íÀ¬î«⿭Ȫ¨œu‰sDg[,NV!G]G[H` HUCTCZCdFp(GŒ>W•IW˜Ob†5Pˆ=Sˆ<U/L†2I’=NŽ4N„+G…8Wx,V”H^Øž”×iËvr´be²bfºmoºhf·jj²[_°ag¯[^°Y]¬V\©U`¨T^¨T^¥P]¢T`ŸS^ V`¡W^¥T\¦^f¨^e§^g¤bm¨bi¬hm¨joªlo¨kp¤ip£fmžfnœ^j§dqÚ ~òÂŽöΘöКöʏõŐôčõÈ‘ôÉ—õËœôÈ™óÊ›öʘôɘðÀŽí¸‹ê°‡ä¨†Ý–Èzj LTr=]9Z:_>gCr B+C0G’8MŽ5J†3I™NdBZ‚5L{,Ft%Dj>f>_@a?q>}$>{$>t<~"<–4F¾NRÐ`XÚtjãƒtèŽwé–zè”xê’{ê“|ê•wì“xí›yí“|玅䌎贞ٌr£EP€#Dx$I~0^t+V´‡šWaMBJ>J@K
->\ H€;dy.YW@d%N_H^J`P~GkNys*[l)Zf%Sb$YUQm8fœx¦’a˜|Axm˜fŸ”o«˜t²˜w­¤”¶š†¨l3du>}s<x†Z€Jˆ~N‚”q—‹Vm.kh›£rž¸”¯£f‰w6]«šªh”RKTBcGnB~(EŠ0HaBRCUCr,H~1J`B\@bD[A\>^>i DaA_@bB_Ad=aB`>l"?l#Bk Cp@hChAf>k:*C’8N¨=K¾LVÂP[ËYZËX^Î\_ÐZ]ËZ^ÊZbÎZ_Ð^cÑbhÓdkÑjlÖhn×ijØklÚknÛpnÙrsÚqpÖkjÖrpÕllÖpp×rrØroÛ{xÞ€zà’„á–‰â¢ã¬•æ´žæ¹£é»¢ê¾¦ë¾¤ë¾¥êÀ¨ì¿¨ïÀ¨è¿ªÏ²©¤|u@\Z BR?Z>O:N>P;`=p!D‰=U‰8LšPb‚/J‡:T†8O‚/Kƒ.K’=P4K~&E~3Pr#JžQbÙšÔ~lÈtmµfi´lkÀqmºljÂql½ni¸ed¶fd³bh±^c°\`«U`¦Vb£PY£P[¥OW¢OWœLWšL[¡Q[¢Ua£X\ [hžX`œX` [b \d \i\e]j—Xc˜Uf§agÛ¡„òÀöË–öÌ’öÅŠôËóďöÇ–ôɘôÊšôÊ›òÉ™õÊšóÈ›ðÀ’봊䧄ړv¾fX–=Fq<Z7[5f=n>t"B€*E‹1G”8H’7L‘5J”?N¢kz cv›RdCW†5M}.Gv$Dj@jAz"@x:t<n6p8‰(@­BKÌWRÚoeâ‚pèxè“zè“yê–ë’tê”x薀ꗈꡞ갢朄à€lÆ[Z¤APˆ'I€,R˜Ko§rŠ¯nsi$ILBRBO?NBXCg$S:bn)Ux;fM:SB^Lr0[’R{|6fs1dj%Pr>lKENLˆd…qœ`Œs8ja)UtAiƒM|‘l’Ÿ®uFqo7vxF~‚P†x?x‰b—ˆ^–†YŠ[†P‰”f˜²ŒŸÅ–¢•Tn|7hvB^ª”¤o8cVAgBmB€)DŠ5K`@RBVCx-C‚1L_?^BbA\>\@Z<jCf>`>a@]?^?a?dGl$Hp&Ci Bs BkBj?g>f:~(DŒ5J¢<K¼MVÄY`ÁX_ÆV\ÏZ]ÎZ]Ì\^Í\aÏ[dÌ[fÐ`jÔjlÑhhÔfkÖgjØglÜjmÙlsØln×jr×moÙklÔnsÖpmØpoÚtqÚ|wÞ„}ᒃ☌䧐殛貜縢鸡꼤꽢꾨ìÀ§íÀ«î¾¦ïÁªñĪîĭ̲¨ wf5TQ<L8K<M6`:n@‡1Jˆ:O˜P`€(F‡;Pˆ8Qƒ1J‚,H9H‡*D€*Dz%Er$N¦XgÙ’Ò}pÈtrºlnºsn¾trºqnÁrlÄvrºke½jh¶hh³eh³dk®^e«Xb©Xb¦S^¢MW¢KUžJT IZœJU˜DTJVšOY•KX•LY–N^šLX U_žX^—R]GXŽDYžUbØ•yﻆöɐöÉ’öňõ‹öŏõȘóǘõÈ›ôɘôɘöÈ•óƖミ嬈ږt¹f\„,A`<^<c>m>z&Ax&B~(D†*B‘8J”4G‘4J“9L–<N¦q€¦q€§k{ _n“I]Œ=P‚4Lv'Dv$B„,Fy<s9j8n9…&?¨>GÉTTÚncâ~næŒ{ê’zê’~ì”}ê˜zë–z蔂砏ð§Œìš|æˆtÛtgÌ^YªBTŠ,PMwª`lЩ£w(DT?M>L>L=O=VARFr-WŒPw‚ItG7L=[Nm&W“`ˆ†Drw2ew8exCrJ@JC^"TbŒx§•g›|JzCvv:pƒW‘p™^#Z€UŒƒVL††T‹ƒLŠg˜fŸŠ^’‹Y•a–f}°’­„Cj~:ct/e|Dež|Ÿe"MiChB€'D…/I`?T?U=y+C~-Ca>`@a@Z@\BY>iBg Bd@_B[A\?bBh BfAm$Dl"B{0Ip!Bl@g=b<q!>‰0F¤?JµHPÀPUÃRXÌXYÌY]ÊY\ÊV\Ì\dÐ[`Ñ_eÏ]dÐhkÑfgÚddØdiÙhjÚjlÙlnØinØouÖkn×km×om×rnØvvÛxuށ}àˆ~ß•ˆâ Šä«æ¯—ç²–æ´œè·šé¶œê»í¼¥ë¾¦í¿¦îÁ¨í¿¨ð¬òëóƯéȱÀ©ªWvR#CH<J<[<q&D€-IŠ<O–Ob},L†7L3L}.I~(D5H‚,Eƒ,Hy)Kr$O¬^kØŽƒÒzqÃvxÀvzÀzu½xt¾vpÀunÁzt¼rl¼qr·ooºlo¸jj´hn³fi°bkªYa¨Vc§U_£P\ LYHT›FT˜DR–JVHUAV‘HXšJW§W[§XZžRU?Q„0J–DVÑ‹töÈ’öÈŽöÄŒõÃŽôÇ”õËœôÊšôǘôÈ–òÆ”ò•걈ޗ|ÀufŠ5D]6`;pA€*D~,Bƒ+F€,E…0G3F“8I‘7J–8J•8L“7L©|„§u„¨t‡¦r} bpTf’AZˆ7N‚1Lˆ4K~(Dr=f>h;€(D¦>HÉTRÚncâ‚qç‹tè{é’wê’zì”yì”|ë|ìš~í•zë’rè…rßtbÊ\]¨C[˜Dd³gˆ»w}ÆŠ‚W?RCNAQAQ?TDR?WNi(V‡QuƒHpE9H<PFh%Tp–‡Fsv2b†R}w at iTIOETHo4b[ƒa‡›v¨ˆTŽRˆ˜|¤„Th.mc-e‡b’ˆ[”ˆ[ŠY“v at nœ‡¶‘j¢’hšw¡£b‚¢iz¨ˆªu-X^JŽR„ vƒWbCgD‚(Ax(D^@R;Q;|5Ix-GbC`Cd!E[?\CW>f!IdDj'Ib!F`B]B`BgBdCi Eq%H|,Hz(Fo BjBc@r B‡4KŸDV²HR»NW¿NUÅQZÇY_ÌX\Î[_Î]dÓ`dÐ^`Æ_hÎaf×fgÚehÚkhÙjjÜnkÙjlØlmØmnÖjj×mnÙrrØppÛvtÝ}yÞ„yà‚á—‡ã‰ä§Žå®•å°–æ²šç¯–ç²–è·ê¸Ÿê¹›ì½¤ï¾£ð¿¦ðÀ¥òÁ¦ñƬôȲòɮ׿®œ~”\-PJ:V<n"Br@†:K—NZx$F‚0J4N{*F~*D1G„(D‚0Ju Ep#M¶lw֍Ðyq¿pnÀ|zÀ~zÁ~|¿xuÀzwÅyr¾wvºsr¸su¶rtºqr·noºmn´jl¯fk¯ah®^e¨Zb§Wb¡P\ŸL[˜FZ”JXBR?S“FV¤T^´ca±`XªWZ“CQ0L’>PӍsð½ŒöÈ’õÈŽöÆŒôƐöÊ™õÌ ôÉšôǘõÈ–òŕç¦zÜ’jÀhYŽ8Gg<b;s$B‚,F‹4J†2J…/H†6JŠ4L”7I”<L˜<K”6H”>P”9M¨zˆ¨v‡¨}‰¦y‡¦s¥hvŸWj—L\Ž@U@N…3F{#@d8e4€(@¤>HÈRR×ncâ‚qæ‹{èzç’yê’xë”wì”{ë–zë•|ì—{êŽwè„lÞrfÆZ^¹dºuŒ¯^u¿zzŒH]RFP?QBR<N>Q?ODv;r•U”Y†DsSIGDXU‰UˆŸvšu0`y7hHra%PXKQHi,`‡N|u2cd"XzJyŽ^–yŸ~Kpd(]k2iq6xh2fŒfšf–_“ˆH„”o¤Œ¸”hœ›tšœY‚”Lb™oyœ|¦ZN^ MŽLp¬†žm,UeD|&EnCYBS?W@‚1G~.Gd?cF_BbD^BXC\CfFh&Gh,L_A^C^BcAhDi"Do"E|,H‰4Jn"DfBbAo Bˆ6J•BU®HUÀRXÄQXÆRXÆVZÍY\Î\bÏ[`Ð^dÃZaÊahÕdhØhkÜikÚnpÚlnÜlnØkmØhhÙjnØde×mrÙstØttÜxvށyÞ‡~à’„áš‹ã ‹ä¦’ä«”ç²šæ°•æ®™è±™è¸œé¶ éµœë»¤ì¾¤ï¾¤ð£ò©ðĬòÆ®òÈ°ò˳åʱ°š¤m:ZQAfBeBx1M‘K\u(J}2N4Ny(F„0GŽ9L'D,GlDs%MÀ{€Ö†zÎwjÀqtÊ~yÈtÄ|wÁ~|Á~uÁzvÀxt»vu¼uvºtvºtw¹sv»rv¹or´jm°go®bj¬elª_f¨Ze¢R_¢T]›Tb”HV‘@TŸOY®XZ¾k`¿eYµSN”DR‚+I›FTÚ–wñ½ŠöÊ–öÊ•öÈ•õÉ”öΞ÷ΞöÌ›öÉšôÈ•ðđ窀؄e´UQ|$>_7a:u$Bˆ0EŽ6LŒ0F‰1I‹3H:O–;Lœ?Pš@N˜AM’7I•2G–7N¦x†¥t„¨}Šª‚’¬„ªy‡¦lw \l™K[–EUŠ7H}&@f8e9z=§<HÉVUØplá€tçŒ}ê{ë”xê•zè”zì–xì˜zî™~ï”zêŽqä€lÝmdÈ_eÒ‡–Ü¥¢šC]¨^tv.RPBPBQ?R>L9N8H
-<VF‡Ip›d’p¢šb W’›lžiŒ|8`r.fn,^k.Zs:rPLf+c’a‹€Ald!Th(`ƒ^hr;bn5l^$[h2ft?up;uq at ra–”jŸ–eš£…²ž~«š­–ršžvœm'RaLˆg{ˆ`ŽMLm/a¡m{˜l_Ew"Fj!KXJUFTF6O|.JfFfHaHbE^BWD] He Hh$If$Ha"GaD^Ba>r%Fi%Hx%Gw$A‹5Hy%Df?hDmA‹9Lš?S­LYÂRTÃRZÊTYÈT[Ï[aÐ\aÍ[`ÆZ\ÆajÔad×diÛikÚnqÙpoÜmmÚlm×nmÚddÙfk×fgØoqÛrmÜvlÝxÞƒyàŠ~à‚á”ƒâ˜‰ä£‘ä¨’å®“å«–æ®æ²˜è²–é²–é´—ë¸›í» ï¾¤ïÀ¦ñÀ¤ñħòƬñÆ®óÈ°ôʶìÌ®½¦¦t@^\>WAl$D‹BTp"Ft(Dy,Ht"B~(A‹4J(C„(DfAr#JÄ…†ÖnÊunÀuŏxȁzÆ}vÂ~xÄ~zÄ}vÀ|w¾xy¾yz¼wxºxwºux¸qu¸tv¹op´op³kp±in®cfª_h¨`i¤Zb WešSa™GW¢OV·\YÈjTÄk\µXP›BN‘2N¶^Zà£~òÄ‘öʘö̘÷˘õÌ›öΙøÎœô˘öÈ•ôƕᅬݛr´\Wz$>\@Z9t!B;K”:H‘7F‹0FŒ0GŽ1H–;M?O CRŸDQš>L‘8K”2D˜8N¢n‚¤v†¨‹¬ˆ“°Š’®„¬|‡§m|¢`h›P^;K‚(@j=^
7w @¤=IÈYV×njâ‚tè‘zê–}ëšyê–{ê–|ê•uë˜víœ{í˜vêŽnä€nÛkjÔ{ˆéƸԕ„=]‘@Z1Yd"RTBP>V>P7T?P@VCk)Ta!Jc%J|;`VvLlu1\n.[v8hc!Vb([k0fx@|”fŽŽTu^HTHo2b”y¢m-X^"Vf.ba$[]"\r>r€N†r<t€R†Œb’—n¢žx¤šw©šz¨Ÿ€­£«ƒDuHJvB_¶¢°|H{\Jƒ?f·›ªl(OlD`CRBRBRDz0G~,IhDfA`Cd H^FSD^Dh Cl)Jj&F`EbD^E`Dt&Hl!Fz&H},H˜:K’6FiAe=h>Œ8P–9N²P[ÃPSÆQWÍWZÍ^`ÐZ\ËZ^ÄTXÊZbÔgk×ik×gkÛdfÛikÙnlÙllÚlnÚlmØffÙhlØjmÚljÜtnÞzv߁{à…{àŠ€áŽ€á‘†ã–†â ‹ä¢å©’å¨“æª’è°“æ®‘è²”ç´šê¸œìºžì¸ð¿ ñÀ¢ðħóÄ«òÈ°óɱõʳô̵îδŭ¦DdT?j Dˆ:NjBo!?t%Bn C.Dˆ/H+By#D_?t#FÌ„„ցuÇvq½toʃxÆxÆ‚xÂ}yÂ~xÂ|v¾{tÀzy¿|x»z|¼|z¹vvºsu¶su·su¶rr²ln°ko¯gm­ho§clªal¤`k¢_kŸR`¥X\ºbVÆkXÈjUµXQ¤DQ <PÎxeè³…ôÆ–öΝöÎœöÍœöÍžôΝ÷ÏŸöÊšóÄŽòÁé±Î‚jœBP^=Z<p!D9Mœ>L–>N–8L“8K2I•9NŸDQ¤FR¨JUžCPš?N“:L’6Hž@O l~¢t‡©~Œ¬„”­Ž™®‰•¯ˆ“«|‰§nz¢`j”HV.Fl @\8y#B¤<HÄTW×nfãƒuçyé™|ì˜yêš|ê—}ë˜zì˜yíyî–zèŽrå~lÞnnæ“”öо¸nzTr;\`FdJ_J[EbJXCWF\Ei$Rv8_XGLEh'Rw5_n(Rk&Sb!N^Kf$Ss4gzDozChx;]e#PNBUP‹]‹™{¤XR\$Vd(\n6me)dd*c}L€‚PˆxA{zD|‹[v¦œv¦˜r ¥“¼ž‚šŸ{¢SQSJ´†º£½m*X‡F{žvPwh@Z@Q?TDSFv-Lw,HeDhB]E`E`GXG^GcDl(Ir(H^B`A`E]Gv.Jr*Hv Aˆ1K£?I©BKt#C`;_;†0H’4H¶S^ÄQVÉPWÎVXÏa]ÇU]ºO]ÆW_ÖadØfkØmlÙhjØdgÚflÚjkØihÛmjÚjhÙklÜjmØouÜqrÝwsÝ}xá€xà…~àŠ€â‹â‚ã•…ãœŒäžŒä£Žæ£æ§’ç¬æ¬—é¯”è²’êµ˜ì¶—ì·žð¼¢ñ¾¢ð¤óèóÅ®óÆ®ôÊ´ô˶õιñϲĪ¥s;ZeE€4Ll#Fm"Fm#Fu'G…6M‡2H-Iy*J\G|.QÔŽ‡Õ|mÄxr»wxÇ€yÅ‚zƃÀ}z¿~|À}z½|w¿‚}¾zx¿}z¾yw»wx¼x|¹ww·tx¼vy¹ss±nr±lr°orªjt©jp¦hr¤ai¢\e«_Z¹gZÂhVÄjS¹[O«NR²NTٍqﺉöÈ•öΛöΘ÷Í™öΛöΛø͝ôÈ”ðŠ북á¡s¿n^ƒ*C\;k@ˆ0H›;L˜=L—?Q—:J”7M˜6JCS¨JR«LR«HRžAM˜<N–=P˜<P£FXœl€h|£r„¬‚¬‹–¬Ž˜®Œ–ª‚¬x‚©tz XaŒ<Ls ?a7z#@¢7FÆVX×ohâƒrçŽvéš|íœ~êšuì˜|ì—xìšyí{ì•vèŒpänßqs蜒îʬXr¼o}±xŽJ
:S@P8\Bf Hh"KfJh$Nn(Sx3Xf#QPDr/Vx6\j#L^Hf$Qh(Tf&S`!JXDVCVI`!PRNXRV~ŽgŠm2jPH`(`p:kn6lj0jk7j‡ZŽK~xAuK›pœŸ«œs¢œ ŽbŒšwšˆVŒm-n–VrÌš”¡r”€Et@V°Œ¥c JXHTFVJWL|4Qv.Ok!Hh#Lc Jb$L^$KZ L^!Jd%Km(Lt.M_"Ib"M`$Nc!J€5Sy/Ls"J‰6R©FW­HU…0MbF]B~-J’9P¸ZfÈW\ÈT[ÊSZÅW^¶N\ÃW]ÔfmØafØceÚjnØfjØgmÚimÛmlÛnmÛhiÙhjÛifÛlhÛroÞvqÝxtÞ~váƒ{áŠ|߈|Ꮐᑂ┆⑃㜇垇䤍䠊夋毎讐鮏鴗쳕췘ð½ ðÀ¤òĦòƪñÇ°ôɶóɵóλõѺîг¿ž p-Nl!<n=c>l;p!@-Dx"D„/H},LYE†4NÖ”‡ÒufÄwrÂwrÆ~xÅ‚{Æ‚s€xÀ€x¿}v½xrÀ~zÂzs¿zx¿{x¼y{½vv»wxºuw¸vv¹sv´rx±nr°mp¯lpªitªjq¥dl¥cj¬``µdYÃjVÇiUÄdP¶TPÂ_SáŸyð‘õÌ›öΙõКøÍœøΚøÎœøΝóÈ’í¼‡æªxÕ‰e¯XSwAf@~(Dš>Pž=Lš<NžAQœ@Qš;K<N«LV¯TW°V]¨JVDR–=N•4J›@O¢AQ‰JdSjŸl~¦yˆª‚’°Š–°’°Œ˜´Š•°‚‡¥fm@Rr >b8| ; @LÅWZØneá€rè‘xê›zïš~íšìœ{ì{ìšzî }ìšyêpè„nàphÞ€zᵪ˜Ah˜HT¤fjJ=M>S@T;ZA[CX?^Ao2Xl%Ko+R]D]BZ!LXDZKw:h}>lf(P_ IS@PBQCp5^^"NPFZ SuBoˆV…b&[VLh*`d)\p6nk/ltBtŒ^–€F‚z<t—n›¡~«œt™s¡`”“j” x¡ŠMz–Y‰“Rl¦„žr8l]J¸£­v4ZRESHQERC€5Nt(Ij%Fl&HaA^@]DUDaBb"Hj#Fx,K^HbDa@`@s#Bz*Ew$F’6N´MR¹LPš8Hh;^<|(F‘6K´YdËXYÊPV¿M[¸T]É`cÖ^aØadØbiÚhkÝhiÙhiØlkÛjfÜijÜojÜhgÙnlÚllÛllÛqlßvrÞytá}râƒxâ‰}à‡zà‹€áŒ}㐂㖆✊㚄䝊䝉妎棌馐觋ꮑ쵕븚ð¼ ð¿ óèòìòÆ®ôɳôʶôͺõνôÒ¼îÒ²²ˆ•c?j;^5e:t;‚-Dt!B}%@r"D\C”@RÖ“„ÑrdÂtpÄ|tÆ‚{È„uāxÀ€x¾~xÀ}u½ztÀ{wÀxt¾zvÀ{v¾xt½zx¼xx¹wz¹txµqt²rx·qs°nt±ot¨jr§mt©flªgl®fd½h^Är\ÇlSÅcO¿[RÐw_ꯂóŐöОöÎœöϝøÏš÷Ðœ÷ÐœøÍ™ðÅ“éµ…à›tÉrXžDPx Dz(H9N CRœ>Q™8Lž>Nœ=Oš?R§HT´PY´TY°MT¢HTœCR˜=Nœ@Q¥GU¤JYm*L~:\—\rŸp…¦}Œ­Š˜¶™¢¶˜˜¼–˜µ…‰©pu—P^u!@`9v=£;GÆVXÚsjä„qè{ìœzîœ}ìœ~ëš}ëš{îž~ï¢|î˜yétékârhÚ‡Ê~‚¢Xx{/Qf AL=Q>V@Q;T>]@UA^Dr3\\@e#HeHTCUBQC\K…JxˆK}d!Mk-W\KKCQFr<_v8gLDNKf1c‡T‚GvYQ^$Tl2jo3fh,fn5s|Q‚ˆYy>v–k˜¡¨šn—˜pž|¯˜n›¦†ªŠEodƒq%Ux|ª…ª\O¾”“še‚L<N<OCR=€3Fr%Dn@p"Ad@`A^@TCb@aCq&Ht.K_D_=Z>\;r#@{*Dz$E™>P¾QUÂSV§EPr<b<r"D“9M²PbÊTVºER¾O[Ìbf×fdÖ^_×\\ÚfhÚhfÛhgÛilØheÙljÛghÚhiÜikÚghÛmpÜqpÜnlßtnÞxqÞzqâ~rá‡{â‡zâ…}àŠ~ã~ã‘äš†â‡âš„ãœˆæžŽä§ç¦‹æ§Žè¬’ì´–ë¶˜í¸›ï¼›ï¾žñÁ§òĦòŬôÈ°ôȲôÍ·õмõÑÀõÔ¾çͶ—dwi@Z8a8n8{'@n>r%Ch=[A¢J[ד†Îq`ÂvmÇ~vÅ€vÀtÅrÁ~uÀ€uÂ~w¿|uÃ}zÂxt¾xvÁ|v¼xz¼||¼wv¼yy¾ut·tt²rvµqt´rv¯mq«luªjt¬il®in´hfÄmZÌsXÌqUÆhSÄ`SØ„f﹄óÉ™÷Ñ öКöÎœ÷К÷Θ÷Í›õÊšðĎ讀ւd¸XPŽ1J{(HŠ4MœAN¡CQ™:Mž=NŸ@NžBU¢FV¬PX²QY¯RX«LS£DTž@Oœ:P¡AQ HX¥KYZ<n'KˆKfšf|¤wˆ­Ž˜·œ¢»šž½š˜´‹¬xzž\dz.G]
:t>Ÿ9HÆXYÜphäƒrèyìž~ðœîš|ëœ~ìž|î {ïž|홀ëwæ€jàvtâwÍš¥ª_p‚2Tk"LO>O=R>R>T;\AUCu<bh%LUD\#J^A^GTBSHf%UŒS~…EyXBx=dj$QOBNCd)RTWOPH_(Zz>tt;f}Cy_"Zh-bw:ps6ni4ih2f‚[‘€D|“i–ŽZƒ[Šb’Ÿ‚²x§² ¾¬yžª[r[Ie*J¿¨¯:p°€„º›L>N8M:Q>{,Bn$Fm Ar%Ff?eB_@V@aCcCl$Fo$Ea"HbH]@Z:q#>x(B|$Bª@LÃUXÄRT°EJ|!:`:q$B’6G§L_¾GTÁMZÒ[aÚcbØcdÖ^aÖ^`ÛcfØefÛfmÚliÙkkÚlkÛgcÛkkÞhfÛjmÝnlÜllÝrnÞpnÞxrÞzsàzràuáˆxâ†yà‰|áŒ|äŽä“‚ãš„ãšˆãž‡æ¤ŠæŸŠè¥Žç®Žè¬Žê±–ê²“í¶™í¸–îº ñÀ¤ñÀ¨òìôÆ°òǵó̶õ̺ôÑ¿öÔÂô׺պ²†<TX;_:m9u=h:r @iAaB´\eÖˆzÌl^¾wpÄxpÆ€vÄ~tÄ€vƁtÂ~qÃ|u¾|rÄ€uÁ~w½|vÀ{u¾{x¾{v½xwºxz¸xzºvy´rtµxy®ru®ns®kt¬ip®os®gj·jcÈpXÍpSÌrVÈpSÇjWà”mò½‡öÎœøÔ¤öÑžöΞöÐœöΙ÷ИõȒâ¢zÉnX =K†,K‡/M”<N DS™>Rœ?R EV¡BR¦FW®OZ¶U\´W\­LVž@Pž@Pœ@R BT¥L\£J^ L\P8\?z9[Zqžs…²”š·˜ ½ž¡¿œ·Ž®{ fm€1I[6n<˜7LÉXXÚvlå„té’|ëš~î|îŸ}îž|훀íž|î {íšzésè„fâsgât`Üž¥Wy‡@`v8]K;M<UBR<VAXAZEƒFl\DUFSDZ*Q]F\EVIm(X—aŒ…FuUBl2Vi#NQ7O
@RD‚Jnt4iQJUK}J~h$Yw at l~Bf$^~L}~Gxq:t`(an<qI€h™|@t”_Ž˜k›d”{©´ž¹¬«LtN@HC‚Q`–^Ž£tÉ¬´M=J8H6R
:x(An&Dk@z)Dd=d>\>V>]A_Gt3Ts+J`B`Be(L^9p>t<†$@²DNÅTVÈUTµJK‚%>`7j=‰0J£H[ÃTZÎUUÖY[ÙacØedÕadÖchÚ]`ÙdhÜegÜfiÚljÜlfÛmlÜlhÝmhÛjjÚllÜmkÝmlßvtÞxsÞ|uà}và‚và„}à‡zà‰~âŠyãŽ~â”ƒã”ƒã˜„ä™ˆäŸ‰ä¢‹ç¦åªŒè«ê±•ê²–ì¶–î¹Ÿí¼ ò¾¤ñÀ¦ðªòÆ°ñůòʶö͸õϼöÔÃõØÃïÖ¶½‘”\<X:d:r1Kb6q!?]>b@¾kkÌ‚vÆmbÁwqÄ}tÄ‚{Ä€tÄ}tÄ}uÃ}vÂ|r¾uÀvÀ{t½xrÀ|x½wt½xu¼yyºvu½vv¹ux¸tu¶uy³qs²ps®lt¯no¯ls°ge¹eaÅlZÍoXÎvXÐv[Ðw[ä¤uòÁŽõЛøÓ¡õÎœøÏ›øНö͘öË•õÈ“ì¼~Û”r´TNŽ.D‹.H”6L›=N@Q”:N FT£FU¥DS­JU¶TYµRZ®JTBPš<Ož>NžBR¨GU¨JW¦M`ŸJ_N	5V8fGBašk‚®Žœ¹ž£¾¢£Á¢¡º”–±†ˆ£ot6P[4d7“2FÄV[Úulå‚rè’yì›ìš~욀ì›|í |ì €íž{î™yítè†jàxfÔdb·Y\Ä“ ‘JYw0MG<R?VCSAXAZDo3[l)LWATAXFYJVBXB\Im)Y–g‹…K{PCg,Vp*RV?S@L
@`LƒAns.fQDwDug#Zd*[†M€z>yw at s†Q‰…W‰Lˆj2lq=r‰\‘z>v™oœs£‰Xz¬°›¸§ˆ£ŒRz_"UDCd&U£z®¨yˆØÃÂY@MEF?P<w*Cv&Cp>~/I`>b=_=Z=bB^Cq(Gx/L\BcF_C^:n?s=•2H¸LUÁRUÇSR±DJ"<^8d@Ž4N¨K^ÊPTÐRT×][Úbb×^\ÖaeØahÛcgÚb`ÛdbÝgcÛjeÛmkÛigÜkhÞlhÝmiÚmlÜprÞrlÞrqàvnàuqáyqà}ràuàˆ{à†zàŽ€âŽâ}㒄☄⛆䟌堊觏䤎欐糘鲑뵘츙ð¾¤ñªòìòůñÅ°ñ˸ó˸ôͺ÷ÒÀöÖÄõ×»äÊ´ˆE]X>b8j9a7n<W
-8f;ÅrpЀuÃk_ÄvpɃyȁtÆ~sÇ€sÃ}sÅ}rÃzo¿zpÃt¼zt¼wu½wv¼xvºwvºxv·uw»vuºvw¸ss¶tt´sv®os®ps®jm°gl±ed²a]Ãi\Ñ}fÚˆbÞ–là t곈òÄŽöРöÒžöÐœøÑžøÐœöÌ–öÊ•õƉé²|Ð}^¦DL‹/J•6Jœ;L >P˜9N™@T¦GR¦KZ®OW²RW²SX¬FR BP˜:N›8L =L£JY©IW¦J\ H\œLeJ5K	4^Bx6Y˜mƒ®Œ—ºŸ¤¼ £ÀŸž¼–š¶ˆŠ¤ov8NU
-4\3,@Ã[XØrdâƒrè}ëš{íŸyìŸxê™{ì™xîžð ~ñ{í’vë‡käxfÕdZ·P\Ì“z2R^CLAVDT@R<[!N^!Jj&O]EU?WBZGVBT>TA[Go,W›m”~BrQCf'Pz8^^EN
9M
<QF_K„Dq|;qt?qn.dZOq2dz at yw<w‚R‡Š\ŒŒ^Š~Ji0fzDyt:te’£y¨Ÿ‚µœušª‘ª’d…bCh)VRFr&Z³Ž°¾‘¡ÖÄÂ` GI?G>P9€0Et!>w!>ƒ2GaAb@\BXA^D^ Gr)Ep"E\A_?_A_:l<p<š:H´CJ¾INÀRS³AHŒ)?`>i=–:P­FRÊTWÐRT×\YØ``ÖXXØ^`ÚfeÚcbØ__Ý`^ßgfÛdfÛlkÜlfÜmjÝlhÜlfÝlhÞtsÞuqàyvÝxtÞunàztàuß~tâ„xà†yá‰{àŠ␁㔅㗆♇䜊䢎壐复媒讔箘괕캠캜ᄂð¿©ðîòƱñÈ´òȵô˸ôνöÒ¿õÔÂõÖ¾óطÕ™[8\9f8^3a7R
-<t>ÎzqÒˆÁmgÄxmʃrÈ‚wÅ~rÈ|pÄ}pÆrÀ|qÀ{sÃ~s¾|x¼yw¼zw¾xwºyx¼us¶st·svºxu¶st´ss³ru«np«jn«hk°hg²_a¸hfÌxhÜŠqäžuê«xì´òÁŽõÉ—÷ÐœöÒ øÒšøЛøΖøÌ–ôÆŒñ¿†ážlÄgP›:H—5Lž9N¢BPž@R8O¦BQªHU­KW²QX·TW´NV§DNž=O”8K›;M¡?N§JX¨KY¢LašJbL`L6M<[Dq-T–ay®‹–¼Ÿ£¾£§À££Àž˜·Œ¦rtt(BP4\9.@ÇWTÜtfâ„nçvꞀí¢zìŸzì{ìœ|í zðŸðš€í•têŠiæ{fÕc[ªKd¢Ub¨s‡TAM@YFUAR=ZCf(N_D^AYAYDUBUGYESCUK|<j ¢w;hQA]C|=^\CM:R?[LVJd&Vz>i‚Ftv:nYJr5mf-\Hƒ}FxŠ\Œ‚R‚~J}r9pvC{s6q…T…¦‡®¨´£~­¨Œ©¢„¨^KRCz8meR­†¦È¨¶Ìµ¸T:I;B;N
<.DnBw&BŽAT\?c>[@[>`@b@q&Ai!B[A]@c#FfBp@~(D¤AN¾NN½JL¶>G²DH–0Ag7o;—<N¬HTËTXÑVYÚ]\×`]×XZ×[^ÚbdÚecÚedÝgdÜhdÜfdÛjkÛibÛigÝldÛlhÜnkÝsrÞvqàsmßphÞxràwqÞzqáuà€xÞ„wàˆ|áˆ{áŒ⒃䘊䘇䜉䟍垉䩒橐氖毕貕꺠컟ðªïÄ®òƱñDzòÍ·ò˹ò̺ôÐÁöÔÃôÖÄöØÀäʵ„<UY
8`9W
-4_4K4?Ñ€tÖ†s¿lhÇ|rÊ„rƃtƁrÉ€vÅ}sÄtÂzvÄ~uÂ}w¾}u¾xs¿xv¼vrºwtºro¹rr¹rs¸st±tx´pt²ru®lo¬fj¬hk²b^ºb`ÍshÞŽtê¢zí³„ð¸†ñ½ŠóŐ÷Ì™÷ÒžøÓŸøÒœ÷ÑœùΘõÈ•ôƍë³~׊a³ML›:Kœ=L¢>M¦BPž=P¡AN­GU¬IR²MT´SX´OTªJQœCT–=N˜>Nž?O§EO¨LW¥JWžF]™K`NbH
-6R@XBl(RŽYtª‡“º› Â£¤Â¤£½œ˜·ŽŸipo+HN
:]9“2DÄWWÚteà‚së‘xì|ð¡€ì |ìŸ{îŸ}î¡zð ‚îŸvì–uë‹kå|hØha¸e~¬_p«hjPHWLZHRDUE`&N`"IXE_EXBX@VCZH[BRKXRW„¤¢x8cNAQ>}8\j(NN9bKaMUA`(P\K[Eb%SVIu;mf&\{H}‚E~ƒR„~J|xE|n4kwB{r:uˆVŠ£|¤¥Š²w¡£‚¡¨ŽŸx>qK?_J^P¦~™Æ³½¶•ŸJ?K=KDTA‰8Jv&Fu$C’CU_EgA\D^HaAcDt(FfEY<Z<_>i;r=1H°FL»HK­?HºHN¾PS›0 at f:l>š>O¨CRÊPVÕ[[ØaaØ_[Ù]^×\`ÛcdÜhbÚgdÞhdÞidÛfbÜf`ÜhaÜjdÜkeÜmgÛolÜliÝpnÞtnÝplÞsoßyrà~sà‚tà€x߃xá„zà†{᐀⏀▇▂❌⚎㡐嫓媓媒殕籖궛뻠ᆭðÁ«ñíòÇ°ðŲñ̺òʸðÌ»óϽõÒÂõÔÆøÖÁò×·¼…ŠZ
-4\	4S.\
-3O6ˆ.EÐ{lׄrÁqnÅ~vÈ‚sÈ‚tÆ„uÆ„uÄ|rÅ~pÈ€tÂ~rÃ{tÂ|r¾|x¾|r»utºyv¸ts¶ts¶tt¸tr²tr°np²nj¬lm®gi°ffµd^ÆofÜŽqé§òµ‡ô¼‡õ½‡öÁ’øÈ“ùÐœøÓ¢ùÒŸøÒžøÑ›ùÍ–öÈŒñ½‚ä¢oÊjR§@Jž8M >M¡?LŸ<M AM©ER­LV°LU¶RVºUV²LU¦DN™>P™;M>P¢DT¨GR¨M[¡HVšCZ›NbœPdI2L
-5V@j,WŽVo«‚¶”žÀ ¥Ä£¢¼œœ°Š‡ kpt-HL5[
-4’+@ÃXUØr_å„qê“uìž|ížzêžzëž}îœ{í¡xï¤}ñ €í–yêˆlåyhÛg^Ø”“¯epz?]NEa GR?Q@a#Od%QZDX:`BU>T>[F\DUBRIa%Zšsžœu˜v2XL>O=l+Mm(OR<i)Qf#KUDb.XWLO?ZO\Ph.[r4jj8j‚N†R‚‹^’|L~s?um4rg2nˆZ‘¢~¥žy©^‘¬Ž²Ÿt–_†YGNFZNŸwŽ¿°»†VhREI
-;I<]>Ž:Hr Bz'C†5I`<j D^A`<a@e>p*Hf(K[B\<b:n?u:–:H­>F²@J¼GPÈZZÅST6Fg<o;™BU¬HVÊRTØ]^Ø`_×\\Ú]\Ú``ÜhdÜfdÜdbàhdÝheÛhdÛb^ÜfaÛhbÝibÚieÝjgÜmjÜtpßqkÝroÞtlÞxrß{qà}tà~wà‚zà‚wâ‹}àŽˆâá“à—„㗅㜌塋䢐䨖殗宗泖鵜깢Eð¾ªï«òÅ®ðIJðɸñ̹ð̼ñͼòÐÀóÓÂ÷ÖÃöØ»àÀ®u @X:P2X	4N8”?OÏzgÑ|lÄysÅsŃuŁrÄpƃxÄqÄ€pÄ~pÅ~pÀyoÀxt¹|x¼xt»xv¸tr³no¶pq·roµqs¯ru¯np®lqªhj¬ef®ef¹baÔ€q殃ò¾öÅ•ôÄ“ö¾‹÷ÂŽöȐøÒŸöÕ¤÷Ò øÒžúÑ›úÍ”öÅŠì±sÚ‹a¼VN¡<N¢<J >K£;IŸ:K§DN®JW°MV´RV¹UX¸UW«HS?N—@Sœ:MœAR¥JS¨IR¦JXžH\šI_žSgšQeI1K3O
-7bJŠRmª‚³¼ž¤Á¢¡¾Ÿœ±ˆŸmqv0JQ2^7Ž)>ÁTTÚrbå„lé‘vëœ{ì¢xíž|ì {êžxí ï£|ðŸzî—tìŠhæzcÝf]ØŽˆ¤^jn9ZN?bJTC]Gh)O^DWAV@Z?XBT<_IM
9L@NIyJ‡žp–œjŽu.ZNCQBYDa$LT>r4\cJYJZJ[$PTCXKWHZLt3ji0bw=v„Q„c’~H{l6ik4n`%f‡Sƒª³—nš•j›¦²’m”ž|¤“_’j)hd TªŒ¬««v;`’s¡J=H<b@Œ7It$F|,H~*DaAg>c=d?b>bBg?bG^$J_De>t"@"<™5GÀFNÄNQÊWZÌWVÇSR 8He
8w"BŸ?N´JUÌOPØ]\Ø`dÚ`cÛaaÛ`]ÜgdÝdeÜc`ÝhdÝedÝfeßd_ÜeeÛebÞfcÚfdÞlfÛsqÛrjÝrmÜtnÝrjÝwoÞ{rß|tÝ}vß‚xáƒwá‡}âŠ{ãàŽ‚à“†â˜‡âœˆåžŒä Žä¤Žæ­•å­˜æ±—ê·žê¸ î»¦îÀ­ðÄ®òűðɲðÈ·ñȶîͼð;òÑÁôÐÁöÕÄ÷Ö¾îÕµ¥fpP6N5U3P5§LXÒwdÐvnÈ{qÄpÆ‚uÇ€tātÁxÄtÁ~tÄpÄ|p¿|vÀ|qºtq½zr¼wr¸tn¶tr¸qn´rp±or­ln­kp®moªln°kl°`bÃjbáž}ñ¾’÷ÌœøÏ ÷ÌšöÄ“öÄ‹õÉ”øНöÔ ùÔžùÒŸ÷Ϙ÷ʍò½€çŸjÏsX¬JI¡<I¢>J¡=L >M¡?O®DN°GPºSV¹TW¼TX·TZ¥ESš=P˜:N>N ER©NX¦MX L[šJ`šHZ™Mb•H^G0I	2L6^D„Jl¦{Š³‘¼ ¢Å£¤ÂŸœ¸Œ¤rvx1KP0\6†&?¾VWÛr\å†pì”vìž{ï {ëž}ì {ìž~î¤xï¦zòšwî’qì‰dçyaÛh\Î}u’HdR>PAdH\Id"N]BZAV:W<X?W@ZBXAJ=JD`*`œz§›f‡—f„q0XL>NAR=` H\Dr-S^AbJS=ZJVCa"QWHTHl,\b)Wj4ju at o˜pšˆZˆ^ R^![a&e…X‹¤ˆ®žz©¦„©¨­B|€Ll¢~¥I~™k¤¶¤Â¡w« |¥À±»\GK?d>„,Dk?x(Cr"Dj Bg@j"Di@`?c>h@b@^DdGhAu?’0E±GTÊRSÌXZÍY\ÎZWÆTR¢:Hg9~,G›<L³LTÐRTÖ`]Ø`_Ø`bÛhfÙdaØgiÞe_Üfdàe`Þd`ÛcbÜhfÛhfÜf`Ûf_Üh`ÛnhÜomÜpjÜqmÞphÝtnÞslàymÞ{tà}uÝ€vàƒ{à‹}áˆ{áŠàŽ€áŽ€ä™…âž‰ãœˆâ¢Žä¥‘æ­‘æ¬—å±–êµœé¶ í¼¥î«ðªðűðÉ´ðȵñʶðͼòͽñÎÀóοõÓÃø×Ãôض̜”T
-2D-M2R	3´Y\ÎreÐ{jÄzpÆŠ|ȁsÆ‚uÄ~vÂ~tÁ~tÁztÁtÄ{u¾{q¿yu½vq¾wo¹xtºxr¹sp¶qn´rt´qr®kn®jm­mu«ik¬ei´aeÊp`ê°ˆòÉœøÒ¥øÔ¦ùОøÈ•öÈ”÷Ì™úÒœøÕ¦ùÔ¢ùÓœøЖöÆŠí²tߊ`Â\O«BIªAJ¦;F :H 8H¥<L¬EP´KS·PU¼QSºRW­JTŸCS›<O˜9O AO¦JV¥KZ¨O]žJ^›Lb™Mb˜PcŽDZG	4I3N7[B‚@b¢t‡´”¾¡£Å¤¢ÁŸš¶¥tx9MT	2[3Œ"<ÀVXÜoYä†të’uî ~î¡{ìŸzì|î¢~î¡{ï¤zð xî˜qìŠhå|eÚh^ÊrlF_VF\Je"Lf$N`HR
:YBS;[<X>XAYBO@MEd&XŽ_’Z‚‚Fg…IlbINAM?QD[Fj)Pp,TU9b HO8O=VEh*T`"PP>k/^d&V]&\`$[‹d’g”g(df.htE‡‹c– z¦Ÿ{¦§‰²®’³ z¦ˆDq¦r—x5h¦ˆ²®•±lˆ’qz†_jQ@V>n"@}(Da?r!Bm!As'DeBf!Bl!Bd@h"Dd<c=`?f@z&F(F¡:HÄTRËSXÏZZÍZ\ÎWVÅTV›-Dk;†6LŸ@O¶LVÑTV×WR×][Ú]`ÜdcÚhdÛgaÝefÝicÞfbÞf`Üd^Þd\ÜecÜgbÜhdÜidÝhdÞljÜlhÞnjÜrkÝrpÞxtÞvoÞzsà€xà‚{á…zàƒxÞ‹}àˆߎ€â„ã˜‡ãœä—‰ä¡ä¦äªå­˜æ¯šç´œç¶¡ë¹¥î¾ªí¾¬ðƳïIJðǵðȶð̼ñ̽ðÎÀñÏÃöÑÀ÷ÔÄöÙºãÄ°r)EE9H4X
6¼_[ÍndÎwkÃxsÌŠ{Ä}pÆ‚y€sÃrÂzpÃ|pÃ{sÁ}u¼xtÁzr¾wp¼zs¼vp¹xs´ql²on¶sn´pn­mo¬kn­gh«de¯bd¶^_Ñ}iôÍ øÖ¨øÔ¦ùΚùÊ”öÌ™÷ΛøÓŸ÷Ô¤ùÔžùÑšø̏õ¿‚è nÖvU¼NI­DL°?F¤=H¡:H 7F§AN«DO´NV¶TWºTU²MT¦BP @R›>Nœ>R¡FQ¥NZ¥L\¡L\šMa˜Pf˜K_“J\‡:RH.J4M
-:\CDc t„´’›Á¢¤Æ¨¤Â¡œµ‘¥xy‡BTU4\
-4†#;¾QRÜp_älë”vî›yíž{íŸ|îœ~îŸ|î¡xð ~ì˜nëŠjå}iÙjfÃbbŒCdbOh%Rj&RZEXGS>X>X@Z<[>Y@VDRH^L’d‹|Fj^LƒNz~Bdg.XTEPCSF\!Kv4]k&LR8`GR<Q:[De(P`#RK
-=a)Rl.`a [j:p‡cœŒZŽŠ[’~L†TŽ‘f–¡x¢¢|¡¤z‚Knœw ¤z¦¨²²Ž´Ç®¶¡}[BG9K6f&Kk"@y(Bs @]@u"Bj>n$Bb?f Bf?a?l$Ad@b@bAoA€(B-F­DKÎWSÒZXÒ[ZÌXZÌTTÀLO&>g:‹<P >M¸KTÓXVÖXVØ\]Ú`_Úb[ÚebÜgdÞj`ßf^àgdÞh^ÜgcÜf_ÚheÚjgÝjdÝjhÜhcÝnlÞphßpjÝrlÜpjÜvpÜxnÞvmà~rà~uàwß…à„|á‰~⌁⌀⑄㚌䝋㡌㤐妑䮘沚浘踣뺦뽩íÀ®ïƱîÄ´ïÆ´ðÇ·ïʺðÉ»ï̼ñÏÀôοõÒÂöÕ¿ïвšYhA1H5a:ÀlgÎl]ËzjÄytÈŠ|ÄrÂ|rÂ~rÀ~vÀ~sÀ~t¿|tÀ{r¸xu»xvºxt»yrºzv¹us·wr²rs±rr²qq¯mm¬jm¬fg®fe²`a»b`ÖŒrñ¾ŒõΞ÷Õ¦ùÒžöÍ’öÈ“÷É‘øÏž÷Ô¢÷Ô¥øѝøΗöÇ‹ï²záŽ_ÌiT¹NP´IM°HO­BN¦@J¨?Jª@K°GP»RR½XT´MR®IU¢CR=N<O CS§KZ¦O]¤N\žL_˜IZ–DZ”E[ˆ<Qˆ=XF0J6H5[A|Ddžvˆ°˜¼Ÿ¢Â¥¥ÀŸž¶¦yy‰JY]8\3…$?¸PTÜqdæ„pê“vìŸxìœ{ìœzëžxêžsèwëxîwè‘vä‡rà~rÖplºZm”Lsl'Xg%Ne"PTAS?T>Y@W<X=Z>WGZLi*Zn2[j.PQHYJ”b†~<bn2XVBTARB`!Lw7[h#JT@XAU@P@YDf&Rf(WLA_(QAq_OTIf/`n4f‰]Ž”kž•s©–jœrŸ¦‡¨—i|6p‚Kršm›v¢²‘´º•«¦€¨†YŒ^&Z`'IBXX<x,BjBdBz&DfAn$Dk"Dk$BeCd<o"B`=c<e<}!@‡)@–4G¹GMÍXSÑ\ZÏZXÎXZÍ[[ÂPN…!<h8;N¢@QºKSÓZXØ_`Ú`\ÚbbÚ^\ÚdgÜgfÞfaßlfàkfßebÜdcßf`ÜfcÛe`ÜffÜhcÜieÝidÜjfÞjbÛliÚpmÞupÜumÝtlß|tß~và‚z߁y߆~áˆ~àŒ€â‘„á”„ä•ˆä›Šâžä å¦”ä­˜æ±Ÿç²šç¶žêº¥ëº¨ëÀ¬îIJî²îÅ´ðƶðʹñ˽ð̺ñÍÀòϽôÑÃöÓ¾ô׵ǐG0D5g9ÃigÐn^ÊwkÅ|vÈ„wƃv¾|vÀ~tÄ~p¾~t¾{p¼{s¾xm¼yv¾znºwp½zs¹xt·xr¶tq´st²st±pp¬ovªjl®lo¯fe´c`¾jhÛ’wñÀ÷Ðœ÷Ò øÍ“öÆŒ÷ÆŠö˘øПúÕ¦øÔ¢ùҝøÍ’óÁê¢nØy[ÄaT¼RR·KL³EJ®GOªAIªCL«BM°HP»PQ¼RU¶QU­IR¢DRœ>Ož@P BR¥JX¥LZ¡L]žJ^–JZ•CV‘@Tˆ9R„5RH3F0L4W?w at b tˆ¯š¼¡Â¤¢¾  ¸”§z|Uac:^2„ =·NPÛodæ‚në’ví›|뜀痂æ˜~ä˜|ß”}â—‚åšä’{à…uÝ|rÒki¸fy§kk(UXFYJTCVDW@X>W@`HZFWHm3\€Fp]EUFTGbM…Ai~<d~>bVCWHTDc*Pd"Kf(QXCU>VFTC]Jj1ZXFZQi+V}Bpe%VTFUJZXm:njœœ®špž”d“Ÿ~¦–l—ŒU~}>hs:_zQp’s•’b°ŽŸ¾˜«£x¡ªv “Rz>nŽGfo&Hf Cj Bk F}0L‚9Pm>e@hAi>d;`<f<†(AŒ)@Ÿ5DÀIKÌZXÏZ[ÐYYÐW\ÏZX¾NR?j<•<N¨GTÃRRÖWR×[WÙb^Ùb]Ú_\ÚefÚjiàidßojájbÝhdÞe`ÞjcÛbYÜ`]Üb]ÜfbÝg`ÜjbÛlfÞndÜpgÛmhÞqjÞulßvrÞypÞ}uàxàƒxÞˆ~à†yÞ†zâŠ~áŽâ•„à”‡á–Žâ¢Œäª’ä«“å³˜æ²˜ç³Ÿêº¤ê½«êÀ­í³î²îųðƸðÉ·ð̺ò˺òÏ¿ò;óÏÃöÒÀöÔ¸Û¸©`<D6w:Æh^Îs`ÇzpÂ|sÆ„vĉ{¿|t½ztÁ|pÀ|t¼yo¿yr»zpºzt¸vt½xn¼wr¹wp¸zs¶ur´ts³ut¯lqªoq¬kp®gg°fe¹c_Æmcà–zòÐöН÷Óœ÷Ê–õčöč÷Ê”ùÑ›ùÔ¦øÔ ùИöƈð¶yâŒ^ÎhUÂZTÄXTºLN²GOª=G¬AI§CMªIT¬FL¶PV·QR±PT¨DOž>Nœ;K>NŸHV¨MY¡I[¢Pc™EZ”JZ’BZŒ<T‰>Y…6RF/D2J:U>v9^šj}²—Àž¡Ã¤¤À¡º•¬~~U]]7[0‚#<·JNÚl]çƒlí’wîœ{ï~êœ|æ›~曀㚁堆蜀è“qè†nâygÕlmÆr„®bl&Rd&MRBVBX?W@X>T<`B]DXBe*Ma#GUA]HZKYH‚Bk}?dv2W^HRD_#Lc&OWC`$J^EYHZEZHZGd*S^R^P|Bk}@qYJTHFBQNi5nf˜£„¬“f•™r§˜qš˜pœ†Fl†JuM
-7O:i0Kp1XX:h#A†?QŒG[†Rp o“¦lž\Œ¢sŸ˜_‰”Y{†>Vj@n @c>c;k>a;e>o>†(B™4I¨@NÇOQÐ\ZÏWYÒ[\Ò]bÒXV¶HM%FtA›?P«HTÆTZ×[V×]^Úc`Úd`Ûa`ÛabÜfeÞicÞljàjeÝhbÝidßgcÛdaÛc_Üb\Úc]ßf_ÞjeÛheÞohÝneÜmfÞnjßwrÞzsàymÞ~yà~và}xß„y߇{߆~âŒ€â’‚â”‡ãˆà˜ˆá¡ã¨Žä©”å­˜æ°šæ³ é¸¦è»¨ê¼«ìÀ¯íòî±ðÄ´ðƶñÊ·ð˼ñνðÍ¿ñÐÀõÑ¿öÒºè̯‡=WF:*DÇh]ÌtgÄ|sÀ{sÄ€rÄŠ|Ä~sÀ~v¾|r»{x½~t¿}tºws½xo¸wr½xs½xr»yr»zr·xt²sr¶ts®mn¬jnªgh­ge´hdºgdËnbå¡|õÄ“öϘøÑš÷ÈŽöÉöčöÊ“øÒžøÕ¦úÒ¢ùÎ’ôˆé¥jÙyYÇ]TÄTPÅXV¹KN²JP¯BL¬CM§?K±DN³JNµPS²NR¬DL >Oš<K9HžBQ¢KY¤N\ L^šFY˜DX˜F[‘<SŠ>WD[‰AXJ	4H2G6R>n1U–dx°Ž•»šžÃ¥¥Ä¢Ÿ¿œ™®„„ŒS`c8\9‚"@¹NQÛk]æ…kê’yìš{ï›yìžyìž{럀ì|í¡|îœzë•tèŒkäzfÕwuÆm~˜Fjd"ObFXG[DW@] FX>ZA^BY>U@YBVD] Jc#LXEXFw7\r5^j)PbFYGg*S[HUC`$Gc"H[BY>S@Q@d&R^ RXH†Ott8fL<e,eLE\ Zo4s‡Z‡–lœ}Jvœ‚ª…P‡bŠœlœY~r0cN=`=|FmP>W<x1DI8N;w/Ir/Jl%Kžcf–[o‘JaOsy/Qk Bd=f!FhA^=f=}'C.Ež6E´CLÎUTÏXZÐZ^Ð`bÎ_cÑ\^­;ItB~(Ež@R¯ESÎX\Øa`Ù]\Ûb\ØdfÚcbÚgfÜjfÞigÞkdßggßgbÞd`ÞjfÜfcÚbZÛc^Ûc]Üe`ÚgbÛgfÝkeÜohÛplÝohßsnÞtnÝzrÜzvÞzwà‚yà„vß‚xß„yáˆ{à€à“‚ã‘…á™Šà Šâ¢Œã¤äª˜ç²›æ´¢è¶ èº¨é»«ì¿¯í³î¶ðĶðÆ´ñȹðɼï̾ñÍ¿ò̾óпõлñÒ®´pzF5‘8JÉi\ÍvbÃ|r¾|rÃqÆ‚s„xÀ|pÀ~rÂ{u½|u»zt¹xnºwrºzo¸xr¼xo»yt¸xt¶wt¶vrµur³rqªloªnm®lm²ki¼hbÌn`䤂ôÁ‹÷͘øҝöȏöÁ†öÄŽöÊ—øÖ£úÖ¤ùÑ™øÈŽñ¹|ä•bÔlUÆVSÀPRÀVX¸KP°HN¯HM£=HªCM±GL¶HJ¶KN­FP¥BL8I˜8Fœ9J¤FS¦LZ¤N^žO_–>T”CX”FY=RŽAYŽA[B]I5H2I
-8R?f%L’_uªˆ“¹šžÂ¤£Ã¤Ÿ»œ”«…†Ubf<_4‚%BºLPØl`ãnë’wì˜zîž|íìžvì |ì¡zí¢}íŸxë–qç‹oâzbÓoqÀsƒ—EhbH[A[@d"LZ=V@W=X>\HZCUBYH^"Le(PZFTFc Nq2Yj.Uc!KYD^"L\FXGXGg+Nh-TX@S;N=T>g%SOD\NƒPvr9kMJX$Pv@k,dt at zƒLhš‡[”dŽl …Q‹˜n›žtš–f“\E];„TvR7g>b;H?]@w,HfCYDp1Ja"Ht$GŒ?Mœ]fo&Hh>b;`<_>o@†*A–5F¢<J¼IMÍVXÌXYÎ\`Ð^aÐ`bÎ^[ <In?Ž4M¥FU´MUÔ``Ùb]Ú`[ÚbcÛcbÜggÜggÛlhßhdÞgbÞhdßlhÞjdÝifÜcaÛdbÜdaÜd`ÜfdÛkeÛieÛlhÛigÜlißmjÝrkÜupÜtqÝxsß|tÞ„{Þ„{Ý„z݇{Þ‹}à~á‘„â“áš†à™ˆâžˆä¦’å¬“ç²•ä³ç¶Ÿè¸¦èºªê¾®ìÀ³ïÆ·ïÅ´îÆ·ïȶðɺð̽ñÌ»ñÌ¿ò̼õоóҲРšM	6š>LÇbWÍxgÄ|uÁ€vÄ‚w‚sÁƒ{¼zwÂ|t¿zvÂ~tÀzsºxo»xrºzrºwq¹ytºwu¹xt·xu´vr²rr°oo­no­kl±lm¸lgÀeXÌobà˜sò¹„öÈ’ø͐÷ÇŠöÀ…øÉ÷Ì—ùÔ¢ûÔ ùÏ•õĈî²x܆bÐ\NÅWVÀTQ¼RS¸OU¶HN¬DN¢>J¦:G¬EP®EM°IP¤?L—6Jš8L˜<J¢CP©HU¨OZ¢M`›J^–BV˜I_”DW@XAXF^“H`P9L9L;T>f$K[sª„‘µ’˜À ¤À¢œ¶š”¬†ƒ”Ydf<^:…'F¶LQØk`ãhê’tëšsëžzë yìŸyìž|ì xíŸzî yì™tê‹sàxeÖy|Äv†¦KkgHbEZAdHU=WBS@V@^HUAVFd$Pq/Vg)PVCXKXGj*Wd(Lf(Ng&M^ LR?UDTD]Hu<aUAQ=RB]Fa"NMBl2gt:jk5^s>yTPs at q|Bu?kL|}JvŒg”‰`”„XŠ}Iz‡Zœt¦€¢„Hy[>‡Y|T9d=P<Q>p&Bp<e%H[>u)Dh@m ?a?|- at r&D^@^;[9b:z$AŒ2Cœ6F¯BNÂJOÍVVÐ[ZÐ\^ÎbdÏ_]ÄTV”/DjB“:L¨LZ¼RXÖ_^Ø`aØ`^ÛggÜhfÞhfÝheÝfdÞleßlfàlhàngßmdÞhfÛfcÛdZÛfdÚc^ÛgdÝhbÜjbÝh_ÜmbÜndÝpfÞpmÜsnÝvrÞxoß}uÞ~wÞ€xà‚yÞ‡Þ‹àŽ}áâ‘‚à“€ßš‡âžŠä¦Žä¨‘孒䵝财跥黪켭꾭î´îòíŵðÆ´ïȺïÊ¿òͼòÍ¿ðÌÀôξóжßÀ¬o E BLÉfZÌxiÆxÀ€vÂ…|¿‚yÀ€t¾}wÀ|pÀ|t½|vÂ~vºzr½{t½{v»xt»zv¼zx¸xqµwu²tr³sq®nm«mp°pp¶rn»leÄl]Êl`Ú†dê¨xñ¾ƒöÀ‚ö¿„õ¿€öÃŒøΚúÖ¤úÔžöΕóˆë¨mÚ|XÊWSÂTRÂQT½NR´JN³LV§DM @M¤>J¬DL®JP <H•2E‘.Bš9M¡IW©KX¦L^ GXžJ\•BV”BZ—F\”E[•C\@Y‘Ea“H_L
-4L
-5K8Q>b L‹Ul§Œµ”˜¾£ ½¡¹˜•¬‡†–_jm$Cd<„#B¶HNØj^âiéŽuê˜xìŸyëžxìœzìž{êž|ìŸzíœyì—rè‰gàtfÛ€}Ðz„´`ufEo&PV>`FQ>R>P
;VG]HUIu7b…@ek'L^CTBTDZIh*Sb#Md$Kb#G[F^JZFVJSGd)O`PO<UA^I^$TPF~Huj+``&V}Myn2jQFyT„NyM‡zH‰‹lœ–u¢ˆb“u<nd&]{Fq˜j }§}8bKp\ CdHL<T?r$@j @`;`;o$Dr(Dg>^>d>i#C_?]<^8j:€$=‘3G¤8H»HNÀJRÉW]ÍVVÍ^_Î^`Î]\¹NS#CnD™:N©IVÄUWÖ`]Øc`ÚbaÞjgÜkhÞifÜjiÝgißkeÝjgákfßkgÞhbÞiiÚecÜfbÜgfÙedÛfbÝkeÞg\Þf`ÝibÜlbÞlgÞtoÞtlÞupÛuoàwqà€tßtà‚uÞƒzà‰~ߍ‚à~⏀ߐ‚à–†â›†â¥ä¦ä­”æ°šæ¶¢æµ¢æ¼ªê½¬é½­ìÁ®î³îÆ´ïŲðȸîɼñ̼ïʾð̾ò̽òϺìÌ®žVjªGOÍj]ÊzfÀ|t¾xmÀ„x¾z¼|x¼~t¿}w¿~t¼}y¾zuÀ€s¾~w¼|u¼|t½{u»zvºyt¶zv³vu³vt²rr®np´rl¶nm¿peÉo`Ëm\ÐsZ܇`è¤nê­rí®vî¶xõÍøϝúÖ¢ùÒš÷Ê‹ôÀ‚è i×rUÆTR¾PR¿LO»LO´FO®DK¦<I¢<J¥AN«HPªAJ˜6HŠ&@1FŸBR§LYªLY£HUŸJX™BTŽ@S“BV–BW”BX”D[‘Ha‘JaŽCXR<R>N:M9[F„Jf¥}ˆ´”š½¡¤À¢ž¼š—®……šdlx0Jj>ˆ)DµFN×i_ã|dëuìš}ízìœzí~é|êŸ{ì }îž|ì”qê‰káxhØvvÚ‡„±WmkFˆ>d\BZAL>NBN@_Im&R~=ey:]c!CX>TAPDTGb(Tk(Qf*S^FYFVHh&R_$LZ#PRJZ$It8hRBbLXG`(\e.\m2[b%Wd$Zs:b‚R‚LLII‡pœœ–ÈŠb’—|±‡d’ˆ^ˆL~i.gd+dŒdž’f”˜n “_šzFp˜}¤N<[Dn AeD\Dh Bj Ap"B`>b@`>c>_>Z8a:p >‹1B–5D¨;E¿LPÅPTÊVXÌ[^Ð\ZÏZXÊVW®DNnC~,JBTªLXÌ\^Ø^]ØffÚgfßhfÞkiÞjgÝhfÝmiÞqpßifág`ßgbÞf^ßgaßf^ÜhdÜc`ÛibÚfaÙe`Þe]Ýf\ÝjdÞldÞnhÝpjÞupÞvpÞ{ußzsÞ}rÞ|tà‚xàƒx݆zàˆ|à‹~ጀ⒁ᘄ☄➊㢎䬒䫖洠泠纩黨輮ëÀ±ïóîÄ·ðĵðʸðɼò˺ð̽ðË»òÌ¿ñλðΰ̌‘¸LNÐpcÊxf¹tj¬he¸rp¼wn¼wr¼zu¾{u¾~z¾w‚tÀ~x¼zº|x¼|t½|w»{vº|v´yw´wt´us°op±sqºrm¼tpÄthÈtfÌr\Ît_Ît\ÖZÞŽbà“fê­zöÆŽ÷ÑšùØ¢úЗ÷ÉŠò»}è—`ÒiVÆRP¾MN¸KQ´EM¯DM§>Lž9L£ALªHT¦@N>M’1GŠ.H”9N¤GTªT\¨LXŸHVžGY”?SŽ;T‘AS”F[”H\”BZ”H[H^†8OR:M
7M9J
-9WB~Ddžuƒ°’˜ºŸ¾¢ž¼›–®‰‰žnu~:Pn?†&C²FLÖi\â€hé{ë˜tîœíšzê›}éžzéž{ìž~îžxì”pçˆnßxfÖprÜŽ‚²Zrs&MŒBb^JXCO?OD^ Nw8^{;^h$K[HSBSBTARDVHj-Zd Om-X^I\I`$Nk)Tm,Uc)RWIPCk,W`$N\HQJd*V‚R‚^GUD]Mc$R‚Zm4fOMS IoBdq?oˆbŽˆh–‹e“p8d\R]TxK|g£©Œµ¡v­¤Ž±ŒfN:^@k@^=T<n?c=d=]8b<`=[8]=_:f:z >Ž,D¢>H¶FPÄORÉTVÎVWÌ^^ÎYXÌY\ÄTZ—3Gh?Œ4J¤BQ½U\Ô]\ØadÙedÚfeÛgiÝnjÞmhÞjkßleàqmâmhàldÞhaÝjfÞieÞh_ÚhdÜc^ÙfdÚd\ÞdaÝf_Üd[ÝmeÜpjÞlkÞpkÝslÞsiÜwnÞxlÝ|sß}tà}s߁uÞ„{Þ„vß‹|߉zߐ‚ß–‚àœˆáž‰â¨ã©ä¬”è°ç´¤è¸¦é»¨è¼®ê¾±î±îÅ·ðƸðɺðÌ¿ñʼð̼ïʼò̼ñÌ¿òϸ䶫ÂWXÒw^Åxa°e`¢Z[©cf«ff®ij´nj¹pk¸snÀxs¿~t¾~wÀy¿€w¹}wºxº~uº~v¸|y´{u·zt´tr¶ztÀsnÅxoÈxnÎykÏvfÐt\Éq^ÊiRÎsZÙ„dë®xøȐúÖ¢ûןûÒ“øƉð³qâŠ\ÎaRÁPPºNPµJO°>H¦BP¡9LŸ<N§BP©@L¢=L•4GŒ,D6J?R¨LX¨PX¥HZšCV”AV>RŽ>V@T•EX“F]’DY“Nb‰@R0JN:M
6L
-5NAR@zA`žx†°š¸œœµš·™–¬ˆ†žlr€;Pn>†&>µBJÖfYâ{bè‹të–vìšzë›vêœwêžwì{ìŸxíœ~ë–xèsâ{jÓfeÚ†z´ats'K‰?`b I[CUBUC\C`E_CWEWEXEV@ZHTF\ Jd"Nk+Xj+P_ LYIh,Ue#P_Ic"Ld!La!Ij*N]APCLDk6]}Fq\FPEYNl0c‡`ŽBzi/bUKWKVKWNtHr–}¡„X„[K\Rn0lrBs˜o—¶¥¼¨˜§_$JY<d<j?V>X;r!>e!C`>]<b<]8Z9`;e8j:ƒ(A‘.C§>J¿LPÂOTÊPRÍXXÎ^`ËYYÍXVºIM}@lD˜=R¨EQËZZØ_XÜdbÚbbÛghÞhgÜgfÞjfßkhàidápkàsnálfàhhÞhdâkbßldßlaÜhbÛfcÜdaÞgcÞkbÝfaÜlhÛmfÜllÜphÜsoÞwqÞwmÞxpÝysÞ{oß|r߁uÝ‚wÝ…{݇~ߊ|àƒâ“€à›„áˆâ¢‰â¦ã¨ä°œæ´ å¸¤è¸¦è½ªê¿­îÀ±îĶðȸðȺðȼðÉ»ð̽ð;ñ̾ð̾òϺïÊ·ÒspÓv^¾iX¢OR–DQŸTZOU¡Y^¢\_ªfj®gf´nl¶qt»xu¾zv½|s¾{»z»€x¸|y¸}z¶|tµyu¸vs¼wpÄ|uÉ~ŕoÐ}hÐwfÐt^ÊtdÅk\ËviÖ†kì·„øÌ–úÙ£ûÖžûϐöÆì¦gÜ|ZÉ[NÄNL¹MP²HN«DP¤<Lž7L¤@NªFR£AO•1F1F1G˜<M CT¨LZ£IX H\™FV“A[<R‘@W”CZ–H[’DXŽDYCW„9Nv'?P:N6J5L;TA‚Fd¡x‡­•¶˜š¸œ£º™—®ˆŠns€<Ps#@†&@±BJÕdXß{iè‹pê–vì›zêxìœzëžxìyíŸ{îœyë•tìŠnå|bÔd_Ðtr®_vx,N5Xl%PZCS@R=X@]B[CZDVDT?TD[JXEk,X_Jl)S[L\!P`'Pz>ag*PRCYE\@c#I]AS@OAP?wBjb J`IUJXNx at ui˜Žg—i0^o6jZHX HLFSO‚`z•mœ[P\"RJ~€Gxr4^˜wŽˆVuO
9a=j>e>R7]8h<a:^8^;]5X8Y8e9g;o>‰*?˜6D±FKÂKNÅPTÊRRÊUXÌ\^ËY[ÉXX£9LiIx&F<L¼PVÓ`\Øa[ÚgcØfaÚigÜgfÝiiÝifÞhdßmhàniáncàpjájdàjbâlbàldàkbßjdÞe\Üg`ÜhbÜg^ÝldÝhaÛoiÞojÝojÞqjßxmÜvrßvjßypß{qà~uÝ|qÞ‚wà‡zàˆ}àŒzá}ß”á˜„ᘇ➇⤎䪒殚岝涡踦輬êÀ®ìÁ±ì´ïÅ·ðȼîÈ»òʼñÊ»ðͼñ̼ñ˽óϾóÑ´Ý—ÊlX§LN”@J†4H˜HS‘;F–DI˜KRžOT¤Y]©`d«ef®jh²ll·vv³trºyv·xs¶xt¶zx·~z¸|wºzrÁvmÆ{o΄tÒ„jÔ}gÑx_ÐvYËq[Éo\Ðt]ݐmñ¾ŽøΚúØ¢üÕ™û̉ó¼|ç˜^ÖmTÅRL½KMµEN¨>Hœ:Jš6I<J©BL¦CN—8MŒ,BŠ-F–9MŸFX¤L]¢JY CT›DT–CW:P’@W–EW›Lb˜J]‘DVF\†:R},Em>N5L2M
-8M:WB|<]šk|®Œ–¼ ¡Å¦¢Á¢µ– qt€:Or$@ˆ(@´?GÒe\ß|fçŠrê˜zê–xìœzêœxìœ{ëž~ì¡zï yì–wëŠmè~bÖf]Èbd¤Vn~4V„>^p(PT>N?SA]Fa"IYDYGXCTBTC]Ja&Qe&Lb&Pj(SVIWLd,Ur5Xl+PVDT@S<ZF[CTAR@XDr9bTA^ Kj+^\Tj+`Œd•’g’‘h–\"Ki)TZNJ>VLf1To<Z_#WYM†V†[††G~Œ\y}BbU
7g9l@^9U>b<^8^9^@^6T4X6]7i=u&C~(C‘,@¦>HºNOÂORÇSSÈSTÊZXÌ]]ÎZT¾PO‡&@c>ˆ/I¢ANÊZ\×fdÚd`Úb[ÙcdÚfdÜhfÞkfÞkfÞnjàlfánlßmjÞpnàlhàjfàjcßngßgdàhbÝd\ÛhfÜhbÜcbÚgbÛicÚjbÝkfÜrkÞrhÜulÞxpßumà{pß|qß~rÞ|tÞxÞˆx݉|ߊzâ|ß’~à•‡à•„á˜‚ã¡ˆâ§Žä°—ä¯œæ²¢ç¶¢å¸¦é¾¯ìÁ´íŵðÆ·ðÈ·ïɼð;ð˽ñÎÁòÎÀñÎÂôÏ¿ôԺ亩·ZV‘6FŒ2D€'?Ž6C„,=‹8EŽ7G“DN˜DR›FPžOUŸR\¤^_§ad§bf¯jj°nn®pq°pr³ut¸ywº~{Ä‚w΂oчtщkÎz`ÈtXÇiQÈiTËnWÔ~bå¥zôŐúÒœüØ¡ûÒ’øÆ‚í²râŠXÏbSÀQM³FJ¤=I–1G“0F–5J¢>L¨DMž>KŽ.F‡(BŽ2H•:N¤N[¤IXœDTšDV™FZ”CT>X•BWšN`œOb•EZŽEZ‰>T€6Mt%@j @L4L7J	2L
-6Y@o,P•f}¸˜œÂ¤¤Â§¥Á¥¡¸—–¦z|‹G[n!?~ ?®>GÓaUÞveä‡nç”sè—vèœ~êšyìž|êž}ì |ð |î˜uìkçcÛk^Æ`eŸPn€4Z„;^{3[N>N@ZAj%LZ@WAT@RDVGXHj(Qj*RVDd+Tb&PUKWJg(Oh&Jr.V]EXCXAT>R8]DQ>ZFYBWHa,ii0a…X–„NŽƒN„˜pžŸ†©m;p[Lj0\l0hVCe#L`!N\Jd%U‰b•r/Z‰Jt—b‹d CX;b<f8R
:Z<c>Y<Y:Z7Y8U4Z6b:l;+DŠ,B˜6G´FNÄQQÇRPÇRSÈPTÌVTÉVSÇVT¤9Dd;r$G’:N®ITÔ`ZÖa^Øb\ÙebØffÚfdÜhgÞnlàmhÞohànjátiÝkgàgeàjeàndándàlbÞlgàiaÞe^ÜdYÜhbÛd\Üf`Üh_ÜlcÛieÞpdÝpfÞrhÞrgßvpÞypÞynÞ|sށvށuÞ„v߆x߉váŽzà’á”‚à–‚àš†âœŠâ¤Žå¯˜ä®—ä²æ³¢æ·©é¾¬ëÁ±ëĵïŶíƸïʹñ̼ðʼò˼óÌ»ñÐÁôпöÓ¼ëʶ±UZ…,D4F…0J‹:L€)B‚+B„,@‹0@Š8J9F“@M“CN–DP˜MU˜JZœR\Ÿ[`Ÿ^d¤`j¨gj¯rs¹tpÄ|t͈vҐzÓŒp΁jÃv]¼eXÂjYÈlW؈eöË•üÕ¡ý× ûΏó¿~éžbÚuVÈYR´FL¥:F˜4EŽ,C2G˜8H¤BP¤@L—6H…&@Œ0F™>N¡HV£NcBT—BV˜CW”CY“AV’BX”D\›PbšOc”F]EY‚8Pz-Fl<n;L3H2H
-6L
8Q=h#O–j|µ”˜À žÄª¤Ä¦¡»›‘¨~~”Wcn<&@­=FÑ`WÞviå†pé“wê˜xê˜xêž{ëž|ì›zïž{ïžvî—xìŒnç~aÞodÃX^¤Uu†6[ƒ<^|6ZP>O>`FdAV@V@VBUCTFZHo0V\HSHl,V^MQJXNk,Vj(Mj)OaF`DY?R@WF\B_G\FSF_'LnErFDpBlˆZŒ|E|‘h¡‘jŽ¡Ž¸x>ua&Vf(Sj(br2az8fv2fEl „šZBf#Br4KbB`=d9]6R5b@]:W8Z>\=W;W9]5i @q;ˆ0C‘1D£<H¾MNÆRRÊXUÆTRÈSUÉTTÇVT¸LPx;Z=„0NžCQÀVXÖ`]Ùd`Ú_ZÜhbÛa_ÙcdÜf_ÜjgÞjhàlfàleáoiàlfâgbÞjcàofájbßf_ßjeßgbÞe^Þh`Þg]Úe\Üf[ÜfaÜg[ÜleÜofÞmgßofÞrjßrjßvlÝvjß{lÞ|tÞ€tà‚uÞ†xà‡yàŒà‘€á”€ß˜†ä—†â˜†ä¢Žä¬’㬘属洢湪辯꾮ì´íĸíƺîÈ»ðʺïÊ¿ð;óÌÀñÏÂôÐÁöÒ»ñÒ¸¸rwˆ/G’;HŒ8H’>N‹2IŒ5J†3I†2H†6J„/E‰1D†5D†2E‡4D‰:HŠ>K‹COETIX–P]\f«fjºrlÆ~pЊpÓŠlÎ|bÍ‚hч]Ё`Í|_ۍjðº†øЛüÖ¤üÔ˜úÈ…í°và…XÐdN¸JK£<G–1D*A‹,B’4FžANŸ>M›9H.C‡,E”:N¡IY¤J] K]˜BT–AX•FV“@T’?S–GVšLbšRg–I`“H^ŠAW}0Lt*Cg=l:O:J7G	6F1L
9g"Ošl|´’À ¢Æ§ È§¢½œ—ªˆ…œblu">€&@¨>HÏ]WÜvdãˆpæ’tè—zêšvêœ{ìŸzêš|í¢|ð¡{íš{ëŒpè‚cÙk^¨?P¦b}‹:`ŠBcx3ZK
<Q>bFX;RAV@R?RB\Km.Vi'OTFUGo0U\KRGXHi(Ri(On,Sc!Lh(ObFP=U@[D\D`K\JZCZHFARHxF{v:vˆ[‹ašššŸ©Š_–] Rn5h…K€”^‡•[ƒj%Do#>U?X<X=f?h#CcBV6X;`;X:X9X9Y8W8Z=`8o;w <3Eš4DµDJÃRUÆVUÈWVÈRWÈYXÈTTÂPMŽ*@Y:e=”;LªO\Í^ZÛbZÚd`Úd]Úb`ÚdbÞegÝegÝjfÝlfàjdàieápiàjdÞhhÞjhßniànhàjbÞjaáhdßf`Ýg\ÜhaÚdZÛaXÛfaÚd\ÝkdÜmcÜkcÞrhÞmdßqgÝwkÞwlßynßzmÞ|n߁t݆zÞ†wß‹zàŽyâ’à”ᔁ◄㠊㨐㪖实岤温軫꾯êÁ²ìÅ·ìĸîȺðɸïÊ»ð˼ñË¿òÌ¿õÑÀõмôԴЖ”†,FŽ9J–>M–BN˜DS“>N’6I6HŒ:L…0F„*A€,Av&By(Ax+Dz)Ay,Cv.Fx.Fz.FŠAP”NV©``¼l^Ær^Î|fÔŒgÝœpÝ–f؃^Õ„câ¢uôÃŽúҝý֝üЕöÀxèšdØuWÀSJ¦:B.B‚;};Œ'?–2Fš8F•2G3FŒ.H3IžFV¤N\¢JX“<P•>T”BV–EW’>T“>T˜DWLb˜Nd‘D[‘F[‡?V~2Hm!>k=k@W9R7P
-4R5R
:f"K—hv²’™ÂžŸÇª¤Èª¤¾˜±‡žjtv&?|$>¦<HÎ_UÜwlä‰pæ’wé—vëyë›yêž{êœ{ì¢}ð¡íš|ì’oæ„jÌ[WŒ1N¥bxŒ>`„:[t-WN?\G\AS=V>S=R@YGv6`b!G` LTCTFr4]\LSH[Ln+Tf"Km-Tf'Qf'QaG[ET=d LVA^"K^!HVDN@OFXMQFzJ†€L†’gš‘q¨•ošŸ‚¨‹SŒg‰IxƒBpSu€Ft`FO<V;Z?e=h@\9S8\=]9T7U6X6V5Z8X:d9r @‚'=š;D©=G»GJÄRQÇPLÉTPÇSRÆUSÆUN¦5<a6Z:,F¢CRÂV[ØbXÛb\Ûg]Üg`Ýb^ÚfdÜhdÜijÞigßjeßieàhfàkeàjbàljáofâneÞniÞjdàk_âf^áicÞjbÝgcÜf^ÝdZÛhbÚibÞj`Ük`ÜhbÜqlÝrlÞphÝslÞxpßwlÞyjà{oà~sށvÞ„vÞ†zߌ|â~à“„à“…âœ‡âŸŽã¤Žä«—ä®˜ä¯æ¶£è¾«ê¼­é¿°ìŵìôìÇ»îƹîÊ»ïÌ¿òʾñÌÁôÐÁõÏÂõԹ⺭“6M9JšBM˜GTœFSšDN™BQ˜BO–:J8J8J….D-Ew%An Am=h;d6`7c8j <w,B?JŸOR´VTÒ„nä®|çµ|áªp׉dÚŽdê­zøƐúÒ˜ýÔ–úˈð¸qãŽ`ÊaP«?E”/D}"@v>| <‘2J”6I’2F‹,D0H’:OšDS¤Qc¤P_›FY“AT’=S’=S’?V’@T“@TšHZ›Lb—Ob”I^DW„7Rs$?n ?i:h;`<^;b;hAhCp(Lšft²’–¿¡¢È«ªÉ¬¤Ä£·˜”Ÿkpy+E}'A¦@KÎ`[Ûwhãˆsæ’xè™xèzéxèœzéžxì¥}ï£zïš~î’pæ„fÀWY’9T¨i~…6Xp&LeKL>\ IT@R=XBS@[Hf$Lh&KXEb$OYDUDe*P[IQD_$Lo0Tc"Je%Mb#Kc"L\De$Jb"HXBP>R@^$Ib"KVG[HUENBUNxG|ˆV™}¢›„¹‰[šv‘\‰…Fz}Axp0^ŠSxt5bT;R:^<e?]8Z<X@aFXFU<]:T7T6Z8Z6h9{&@‹-BŸ;I´DHÁKOÇPRÆPQÈUSÉTRÈVO¶AFt6V
:k?–;N¶RXÓ^YÖ`YÙd_Ûg_ÚgaÝd`ÛfbÛhfÞhhÝkcÞhbÞhdßfbßjiÞjeßnlàkhàqkáicànhànfàj_ßk`ßi]ÝgcÜgbÞg^Ûd]Ûh`Ýj]Üh\Üg]ÜkdÜngÞocÜukÜ{nÞyoÞ{n߀pà€rÞ€rà„rÞ‡yÞˆ|à|á}à”âšƒâ ãŸŠâ¦‘âª“ä­šå³¤ç¹§è»¦ê¾®ìÁ²ëöìĸíƺîȸï̾ð˾ðÌÀòÏÃõоõзîͲª]h6H–DQ›IS¡NY¢LTžKTGSšAM•?O•<L‹4G‡,D(Cu'Bo@d<^<X9X:U7]<k ?:Q»ldá¦}î½„íº€æ®rÝ”cÝ’jïµ€øɐüЕüЍøÆ‚ìªfØzS²KH•/@†(@s<} B…(A0D’5HŠ2F†*DŽ6L›AQžHZ¤Sb P^™FV“>P“>R8PŒ=R’>T•BXœJZœPh•LbH[ˆ<Ry2Il"=p <h8g:i8~,C.B~,Dy(F|4Q˜]p³ŠŒÄ¤¡È¬§Ë°ªÈ«¢º›’žin~4I(D¨BLÍ\SÜviã„qæ“xê˜xéŸvêžvæšvèž|î£vð¢zîœzípã„h´MZ™@W¶t„=^j$KbJR>dHR?TEYDf$OdFWAYCWCc#LW>SEZHh&TTBh(Ti+Qc%Mc"Nc Ic"Lb"NZD]ER=SAN
<R<l-P_EXAe&QVEXCRJp<oŽ`”£Ž±˜³‘qž“lœu8p†Nˆ˜`ˆ¡n‹~:fP<T;e>a<S7W7Y4X7U7U8T6P6X8Y9d=}$@‡*@•3Dª@J¼HKÈNNÆONÊSRËPNËXT¼LL:W;]<ˆ0H®JRÎ\ZÖ_VÖ`^Ûf_Ûf_ÛgbÝe`ÛhcÛeeÝfaÜhdÞifÝhcÝgeÞllßleàrlßlhâpjànháldàjaáifàj^àjdÝgaÜe]ßh_Üd]ÜhaÛngÛg`ÝjbÜjbÚnhÞjcÞpeÛujÝthÜxlß|nà|pށvàƒqÞ‚x߆vÞŠzߏ|ᓀ㜄䞌⟊⨔⫖宝䴤湤繫輪êÁ°ëõìÆ·íǺìƺïʺð̽ð̽òÎÀôξôкòбĈ‰Ž9J”BQšKT R\¢NV£OU¢MVžKU˜GW–@P>P8J‡2F~1Ht <h@`<Z?R:L5N:Y?<RÕŒp컇ôĆïÄ‚æ¤dÛ„[à™pô¾†úÍ’ýÒ’ý̈ô¼zã•^À[M˜5C€!?u@vA…&BŒ/F5FŽ2H‚&D„(G”:QžH\¦Rb¢N^—FY‘=SŒ8R‹8QŠ<Tˆ5LAW˜H]ŸSfžSh—MbDY…8Pu(Es'Bj<f=n;Š6IŽ>NŽ:Lˆ6N†9RˆB]—^r­„ˆÂŸœË®¤Ï²¤ÊªŸº™•¤rv…@R-C¨@IÌ\PÚteã‡ræ”uìœzèxéŸwêš|èž|ì¦yï§~í™vê”pß|b¹L]¡D[·p‚’Ffj"LZBWB]DVF^Jq2Zh%IY@VBT?XDa!I[IUHYFd$N^Il,V^ Kb'Mj(Sd&Pf(Nd LVBUESBS?YBR=T:f"P[Bv6`c JVBPDMFq9f”nž“q ›²˜|±†Rˆ‹Xˆ„>q—Rh›_ŠR?W?c?W:X<V:V7S8V7U9S;V>\8^:p<Œ0DŽ.Dž<I¶FJÄQRÆTSÇPRÆWXÈVN¿OO(;a7W9u>¤@NÉVUÔ`^Ö]S×e`Üe_Úc[Úc^Ýf_ÚmhÝgeÜjhÞhcÞjgàhaßjdàjfáicâohálfàplàngàojàldápfÞmdßh]Ýg_ÝiaÞi`ÜhbÜh`ÝicÜi^ÝjbÝj`Ýi^ÚkdÜpfÜrhÞtjÞrfßxjà€n݁s߃vÝ€xÞƒyàˆzàŒ|á‘~◃㘁䚉䤑㤎䫘峢赦繩缮辭ëÀ´ëõìźíɽîǹîɼðË¿ñÎÀóÌ¿ôÏ¿õÓ¶Ú®¤”=M’>O˜JTŸJS¤P]¥PX¥RX¡PXLVœFS”FV>PŒ=P8O~.Fq"Ai D^8X<N=I
:Q;š<Là›nóÀ‰÷ȃóÂzÞ—[܆^çªxô†üËŒü΋ùÄ€é¨nÎoP’0>€!:q>p>z#@…*DŒ/FŠ0D„,Hƒ+IŽ6O™DV¦N_¦Vf˜JZŒ:Q‰6N‡9R‰8OŠ8OŠ8M’>U›NbŸXmžVk•J`ˆ@W‚8Q|2Jx,Gp%Dj>l!A’BR‘DV‘?PŽ?QE\‘I`dw¬„Œ¾ž›Ê¬¤Ì°¨È¬žºŸª|yŽIW„4I¥COÌ\VÚvdâ†rå’uêšxèŸ|êž{ëœwéŸyð¦|ò§}ìžuê“rÜzf¸U_ Lb®ezCct,TQ>SAXBd#J`Ca DYBW@XBZA[DXB\DWE[G]H`%Li)OZFh+Um,Xi*Te&Lf$MR@UDR@P>ZG^GL>b"Gn+Uh*Rd K\KVHXLf,^p:eŒa“ ~¤«—³—t¦|D~€G{’j•Ž_X?^@[<V8V7V9U<T9U5R5Q	1Y6^6h6(>.A“.@¨>G¾LMÅRPÅTSÉRPÈWQÂOK%;[7Z=v%D9JÂPQÐ]VÖ^UØ^ZÙg_Úd[ÙdbÜd`ÞhaÝlaÝleÞidÜg`ÞhaßkháhcàieÝhgàpjàleÞlhßmgànhàmfàngÞj`àh_àjaÞnfÝh^Ýf^Þe\ÜiaÜi\ÜmbÜjaÚg_ÜkcÛpkÛpjßugÜsiÞxlÞ|pÝ~oÞ‚t߀tà‚zÞˆzàŠxâ“€à•ƒâ“‚â™…äžŠã¥Žå®šæ°žæ´¤çºªçºªç¾°ê³êĶìƵëÅ·ìÈ»îȽï˾ñ̾òÌ¿óϾöѶèDZ£LX8N•CRœOW¢T\¢PX§RW¤PV MUFR™GV=NAR‰9Pƒ2J|1Kq&Ah"@]<T;O<X?<JÞ’iðº|øÄ~ð¾xâ›fã˜jì²zõÁƒùÆ…öÀ~í­qÑzV¢:Cv9t<l>y#B‚&@‹0F„&?'?‚)BŒ3MœCT¡Na¥Sa›L\>Tˆ:N†6N„1Jˆ5NŠ8N@V—G^ Ui¡]pœNd‘K_Œ@Vƒ6Q€5Pz)Fn#?k!@s'DŒ:PBP?PCX”K`—Vj¡n~®ŠŒ½Ÿ¡Åª¦É°«Ê®¢Â¢•ª‚€’Ta†0D«DNÊXQÛtcã†qç”xëœyêž|ì¡zëžzêž|ï¥~ð§ví pè—nÚzc¦L^¦Nh¬`s†@`u*SXB[GX=XCX?ZB[DX?VAX?]Ja%L` HXFWEV@XAZDYGi-Tm.X^!JZIf&Od)STBVBRDVBh&Na#NP=e$Lj,Ud&P\Mb"Rm/^b$Np0\j.\m8]ŠZ‚—xš’f˜Šaf3O[A\@_AYAT<Y@T;V<V8O4N5X7`@d8t =†+@”4Gž4C¸HJÁMOÉ[WÆTTÈQP½KEŠ#7T3T
-4p >š9I¼JPÏ\WÒ\YÖ]ZØ_[×b\Úf]ÚfeÝb[ßhbÜhhÚjfÞhfÝjaÞheÝlgàjcàheÞhfßngßnfàlißkfàlcàohàpiàh]àkaàmfÞhbÞg^ÞedÛd]ÝjdÜiaÝmdÜndÙkdÜibÜmcÛsfßrgÞrgßziÜ|pÝ{nÞ|qß‚tÞ†yÞŠ|ÞŠzà~à‹xß’€ã˜…✌⨐䧕䫚沢洣湧迭龴ê¶ìĹìÆ»íǺðÇ»ð˾ò̾òǶó˼öϼðβºtxŠ3D“BP›JTŸR\¤SY¨RW¥SZ¢OUŸKU˜DS–GU”CR8L‹9M…5Jx,Bt'Bf>`:^@jE˜:LÖ‚bí²zõÀ„ó¿î¶yí±xð¶uö¼~ò¸zê¥iÔ{Tž@Cx;j<g<o<|$B‚*Aˆ,D$Aƒ(CŠ1J”<P KY¤Pb›JW’AX†4N€0J‚2L…2K†2KŒ8R”FZMd XmžXr”OgG^‡;T…:T‚8Os*Go"Bk$Ar)Fˆ;RŽ@V“DW—K^—Sgž_p¦v„®‹Ž¼¢£Ã¬¦É¯§Ê¬£Ä£–­„ƒ–Zd‡3F¨CLËZOÙrbá‰zç’téšyêzêŸzìŸvë¢|î§yñ¤zïxì–mÚn—7O®\qªYl„@`d FR>_GT?YDYDX@ZD[@ZCX@ZCb%JbIWGZGYEUCTDc%Pd%Le'QVJVHp4\|>fVBZHVFL@g&Q|@j`LTDf%Js5f\LXLs>gu;raQw at svAp€Oq<l’fŽž„©v at gZ?\<[>U>T>\@T;V8U=N=R
7[:`5n9†,@ˆ,@—3B®BJ¶FOÅQPÈWRÇOK¶DHv9S
-7W<v#@Ÿ6F·FLÊVVÒYTÒZZÕ^XØa\×^YÚf_Úf_Ýd[ßjhÝgdÞlbßh`ÜhaÛebÜmfÞgfßhbÞgdßlgàqhàohàkdÞkfÞolàpkßmfálcàlgßneßiaàg_ÛfbÜlfÛibÜngÜjbÛohÝj`ÜleÝrfÝrjÜrjÜtfÞvjÞxpß|nßrÞ‚wá‰xàŠ~àà‰{àŽã—ƒäŠâ ˆâ£ä¨–ä± å³¥æµ¦ç»«è¾²ê²ëÄ·ìÄ·íɹîʾîʾð̾ðȹò̾õιóдա–’7G<H”BPœKT¢QV§V[¤TXŸPWŸNX™EM™HT–ET?RŽ?R†7J~1H}2Kv,Et"?v$C{'C“6LÐweê²€ôˆôÊõ†òº{î®jê¤jä’_ÎsY¤JM‚)Dl<g>k>u"A€)B*A"?~$B‰3K—?QJY¢L]žL`“BXŒ>R‚6L2L…/H„6L‰6O’@Y˜Lb Uj \qšPg’E`ŒH\†=U€4Nx.Jm$Cp"Dt0Lu.Kx-JŠ>P–L\œXhœ\m dv§t€¯†‹À¡¡Æ¨¤Ç«¥Å§ž¾ ˜­„€—\dˆ6G¢FPÉZWØsgà‡tår蚀êxéžzêŸzí¤~î§ð¦víœzë”sß‚i–6R°bv¥Un†;_ZBQB`HRAXGW@\FXAaJbJVB]Df$J_FS@VDTFUF`'Su5bj/Zj1]TD^!Ox>d|Ad[FSAZHKAf(Y~Ei|>g^L]LzBmZH`&\a0X}Jyf'`v>o—l˜”ld&Pp1]p at X‚Jud?Z@U?T>W;\<X:R9P7O4V8b@c<z)HŒ0F4I¯CH·FK¶GIÀOJ´FFŠ&7]6N7`6‰-B¨>HµHNÅONÍXUÐZXÔ^Z×^XÙ`\Ùa[Ûe`Úh^Ûd^áj`Üj`ÞibÝh_ÝjcßjcÞhbÞieÞjdÞkgßldâniâkbâjbÞlgÞngáohßoeàlbàldàkdàmdÞhaÛjjÞk_ÚifÝndÚh^Üh`ÜfZÚl`ÜpfÝphÜreÜujÞwjÝvhÝ~qÞrÞ~uÞˆzàŠxà‹|à}à’‚â”‚á’„àœ†âžã¦–ã­šä±£ä²§åº§æ¼®è¿²ë´ëƸíƺïÇ»îʼï̼ïÊ»ðËÀõμôж侬žCRŠ:K“CRšJUžKQ£PX£PT¡PX¢LVšHV•FQ—MX”DT”FSŠ;P„8O…8J2J‚3J†6IŠ3N£GUÏ|lè´‚öÇ”øÌ–÷È’ò¸zæ iÙ|TÂbQ¢BJ‚*Du"@n;n@v&E‚.F„,B)B|"B†/F‘8OšFX Qb¢O_˜MZŽ?U„2M2M€.J…2L†4MŒ>VšNbŸTh£[nœRh–MeŽBZŒHZ‡=R~4Mt*Hr&Et,Gq*Jm Ak">„?W’J[Znœ^oœ^oœj{«„¼ ¿¥¥Å©¨Ä§ ½Ÿ”¬„€˜^iŒ<L£GPÇXRØrdà…oå–xèšyèšzêž|ëŸ{ì zî¦zî§{îyì“o߃hž:T£Wl YpˆBfR>N?YCTB`"N]Cd&NT?f&N_IWC^Db%Hg'NWEQ=SCTFb'P}8duAnk6`SJe&UvAf~Djr4\N@R@VG] I|Cnk,Sj,V_#Te+MwAu[ Jj+\`!Rw:nl0i‰T~¥‡©€Mzv4jTAwAhn'OU>Q;S<Y=\?S8P
4Q:M3U
4^3n:ˆ1A–1?£=E²AH¯BGœ6@„6b6R:Z:x$B 9GµBL»JPÆQQÉSUÎ\WÓXRÔ]VØ`ZØaXØc^ÜdZÙfaÙf]Üg`ÚicÝf\ÞhdÞljànaÝleÞießifàjfâldàngßnfánbßtlàngàrjßpkàmhámfßofàofÝndÜlhÝliÜj`ßmcÞj`Üi_Ýk_Üi^ÜmeÞndÜqgÞwiÝuiÜvmÞylÞ|tÞoà‡{Þ‡zߊzá‹~â’â‘â’‡à›ŒâŠâ¢—ãª˜ã® â²¢æ¶§æ¹¬è¾²êÀ³ê¶ìŶîȾîʾïËÀî˽ï;óÏÀôϸêʯ¬^i‰7F’AO–HQšMYžMUNVŸNS¡T[›JU™IQ™JV’GZ–HV>P‹<Qˆ;TŒAR@P”=P–8K­KTÓ€pé°„÷È•ùÌ‘õÂ…è¤pÑyS±PK‘4D(@|">r<t@{&B|*C‚.E€&B'A‡,H’=RœGZ Q`ŸNa˜J]EW‡5L|-Iy*H~,G„5PŠ<Q“BZœPb¢Zl£ZkœNf–QdŽG]ŽFZ€6Ly1Jl @t%Fz0Kv1Ml$Bb<€4LŒG]—Vf–Vi‘Si”^t¢y…µ–š¿¤¡Äª¤Åª ¼ š¬‚˜Zf>L¦GRÅVP×rdá„mã“wèšzëž|êŸ|í }ì¡€ï¤ï£|ëžxî’kàˆn >X˜If˜Tny2TN@N>XCTD]"KX@b!JZBk'O`FT@XG]Fq2\b&OSAXFVDl.Yv0^yLuv7cTHb$Tu at j‚Lt~Aj`LRA]JV@€Fli)TQ>WJ]%Oh‘b%Vd&Y^Rq:it9u|Ax¡¡ŽaŽq5d\Ih.Vj.YR<N8WA[<T9R9R8Z=U:\5j4)?Ž1<”1?‰,=|<h6V@W9`:$@œ0A­@IµBG½KNÆSTËWXÎTTÐYYÒ\VÐecÖ`\Ö_\Öa\Ûh]Ùe^Ûd\Üg_Ûh`Üb^Þf`àleßkbÞheÝidàgcÞpiámdâlbàngápcàqdßtjàtfßrjáqißrjàphándÞmbßleÜljÛjdÞjbÞiaÜj^ÝlbÝi`Ýj]ÝpfÝpdÝugÝvhÛxlÞxlÝ~qÜ€uށtÞ…x߈|áˆ|á’┃◈⚈⛌⣐㦖䫚㲤䵧幭缰辯êĹëŸíÇ»ìË¿îËÂðʽïË¿òÎÂñνïί‡„†3E:G“HR•JT›LWšLTœPVŸNU™NW™HTšOZ”K]—MX“ETŽCVEV•FX˜HV™CQ—>Q«HUÒxf樄ñ¿Œð¿ˆèª{ց^¨HJŽ4Gˆ4K~.F|(Fw!A€,Dƒ.E‡2H„.D‚*D….H”:QžK^¤Tc¤WjšN\‘CU†:L€2Hx(Fu(Gz&B‡4M‘BW—F\¢Vh YlŸVgšQg“MaŽH]„>Vy.Gl"Bq&Bz,Hx-Ht,Gh!BZ6o'C~9PˆDZ‰F[ŠKe“\t u„°“–À¤¢Ç«¦Èª¡¿¢™°ˆ„Ÿdn>I¢ENÅXQØp`ß‚nã’wêœvìœì |î£|í£xï¦zî§vëì”lä‰m±P`Œ7XD`n(OQ@TAU>YE] I[H_GT>m+Vf"JZBZHX@v<gTBVCYFVDj*Sn)TvLoq3\KAd&Vz:hŒZŽ„Lu€@n[JWFQGh,Q„KtK>THc&ZsHa`•b#QY Td(_uBx‰W––dŽ«—´‘_Œ\E^Fd+SS;P8U9Y>T=ZAX8[8^8f3i8i8e8^>S7W9[>j!D‚,Fœ;OªBPµDN¼HLÀNSÉTUÍUTÎ]^ÎXTÐXXÒZVÒ^ZÖ_YÖa\Ö^ZÚcaÚgaÙfeÜhaÛebÜjfàg^ÞjaÞjcÜfbÛfdÝkhßmfßlhÞldÞngàpdÞpjÞtràphásfàtlàsmÞnhßlhÝnfÝphßodÚjeÜhbÝldÞpfÞnbÜnfÛlbÞodÛphÜrgÞtfÜxlÝynÝzrÞ~sàuÞ„w߇{á†}ፀⓃᖆ➊❉⡓⤔䬘䮜䳦䵥漯龰éÀ´ëÄ·ìȾìļîËÀíÊÀî̾ñÎÀò̹òήܮ¢9GŒ;HŽ@O’FO•JU˜LVšOXŸSZžR\›LW™R\›PZ–MZ’FZ“JY™M^ P\¤P`¤NX¢GU¨GTÈc\ۏuâpÞšnÌyZ§JJŒ8N‰8Nˆ:K†0Iƒ,D†0Fˆ/DŒ2Jˆ/F„*E…/J‘8P™FZŸRa¢[jMY“AQ‰9L‚2J~5Pz(Ct'F|-FŽ;O™M`Qf¥^m Zož\n˜Pg•NcŒFZ€7Mr(Dp&Fr,Fw*Ft(Fj!CgAW:f >p*H€<T‡D[‰HdVpžo°•¼¤ŸÄ¨£Æ¨ Á ˜±Š‡ kr–FS¦FRÄVRÙnaß‚mäŽvê™xìœzí ~ð¤zî¢~ñ¦ð¨~ïŸzî•sæŠn¼\fv'K}6\]BUDSBR>U>X?YE\J^Jk'Pg K\I\H\F|GsVEVDZHWId!Nd#PzNxk*XMG`$S‚E€Œ_ŠY†ŒT€j'TV"QTL^LŠUz`(VLHSEb$W‹a‚t7fn2f_!Ut>pb”^™šr‘¤z ‚Ft`L`&NR<P:V9S:T8\>]?\8^5[2U5T6^<d:t(B†(@“/Bž6C¬9D¯<JºGNÂPTÊTVÎVZÎ^[ÐZWÑ\\Ñ_^Ò`_Ò]YÓ^ZÔ\V×`XÔb]Ød[ÖdbØ`ZÚjcÙgbÜf\àj`Þh`Þf]ÞfaÝjbÞiaÞifÞjeàidßlcàsißmgánfàqjßrlárißsoßojßnfÞnbàneÞmbÝodÜhbÜjcÝj_àp`ÞnbÜm`ÞndÛogÝrgÜtkÝvjÝzqß{nÜsà„wÞ†|߆~àˆxáŒ€â‘€à”…âž†â Žá¡‘â§—äªšâ¬œã²¢ä´¦æº¨è¼¬èÀ²éôíŶíɾí˾îÊ¿íÌÀðÎÀñξñз嬜HX†7HŠ<LŽ@N’IV•KX–MRRXŸR^žS\ V^›Q\˜K\–P]˜R^ Ra¨W]¬V\ªRZªLU®LV¼VWËl`Êp^ÀeZ¨JS’:LŠ4K‡2F‹.E4H’4G”:K‘4FŽ1B,Dƒ,G‰8N•DYL^žQbžT`“ET‰<J€,C{(Bx(Ft!@v(F†4PšK] RežYj¤]n¤^pžZn•MeNd†?X|0Hr)Dr(Cn"@r#@q$BhB_;Y@e>j @u1L€;T‚A\ˆJg›gx¬Š¸œÃ¦ Â¦Ÿ½ š³‰„¢lqšRW£KTÁXS×kZá€læ’xê™zꝀí ~î¡|î¡€ñ¢ñ§은ëtç‰rÆddr!Ev5ZT@XFRCV@\)M\ATAZDb"Lh*Tb!L` Pd"O`K}Mub LVBYFZKd*Wn,Y~Nvc MOCZL|@v‡Tƒ_ŠZ†j0]PGKBt<rƒHiŠ[…L@G<j+`k.Z‹X„g*Xn.nd(X“i™Ž_‡yDt}KqZ‚zAm\EOBSDWJV IYHW:S3U4X4a3m:v"=…$9‘);›4@§4@«;E®;G»HQÀLRÆTTÊWXÏWSÎTUÑVUÐWVÓZYÒ^WÓ\UÓ^ZÒ\\Ö^VÔ_XÖ[T×c]Øe^Ø`ZÜc[ÚfcÝh^Üe_Üf`Þe]ÜgbßlgßkdàlfájeálcàmfàmfÝqlßrlàtpàtjátlÞnjßnhÞtmÞndÝsißnbÞrfÜldÞkbÜpfàlaÝodÞl`ÞncÚqhÜngÝshÝyhÞ{nÞxlÝ|qßuàƒu߃wà„xà‚â‹~áà˜ˆãŽâ¢ã§’䫘䮛䰝䳣嶨庫迲鿲ì¶ìÄ·î˽î̾íÊ¿î̽ðÌÀòθì̯´muƒ4E†9JŠBPŒDR“KY•KQšNZ¡U^¡TZ W_œXfšP_šRažTa¥[f«^a¯ZZ²VW±SX´RX²OT´TV²TZ¦NW›CR’:O’=O“<N”:LšBRš<K—:I–6GŒ-A†*C‰.I“<R™H\œPb˜R_DVˆ=Qƒ0F.D},Cu$Bs#D|0K’ATŸQ` Vl Vh£`r¡^qœXo•UiŽIc„9T{0Is(Ep"Bm"An$Ck @c<aC^ Ad"Ae?m(Hz6T~=[‚Ab•by«†»Ÿ Æª¡Æ¬¥Ã¤š²‘‡¦stžW_¤LY¿WV×jZà€kåuê™zí}졀ñ¤€ñ¤~ì}é’tã‰p»[_t"Iu1W[H^HVFV>[F\FR=YAb Kk*Te%Qb%Qb"N_Mn:Zq5fTDQBVHc M{BdzCkXFPGSGv<h„Pˆ|Ht”j’zBrPCFCb%WˆNx•jŒn-YC<MFr2ey@\ƒL}^$Nh,fS‚ŒX‡’c˜j4j†S|~Di]"KP?P<V"BT8P4R4W6`7k=t;…'@’/B›8H¢6E©CL¶HL¸FIÂMNÆPPÈTXÉVYÌVWÎWUÏXVÐZYÐZXÒZZÓ][Ôb\Ô`YÐ\WÖ^UÖYSÖ^ZØ^\Ød\Úd\ÚhaÜd^ÞfZÜc\Üb_ÝfbÛohÞofàj`ài`âldànfßibÞkhÜliÞqjßrlÞqjàpfÞrnÝnfàsjàpiÝqgßpdÞvjÞndßneÜocßl^ÞleÝldßrlÛohÝqdÞthÜviÝviÞvlßznàqÞƒsÞtÞ‡y߉~à€à‘ƒá’†á›‰àœŠá£â¥‘ãªšã°œã°¢ä´¤ç¸©æ¹®è¿°ë·êÅ·îÊ»îʼìʼî˼ï̾ðκïαɔŽƒ4K‚3H‡@OŒBS‘JT’KV˜OZžS]ŸV^ \bžWcœV`¡Xa§[f«^b°\]µVV²TX¶TW¼TW´NS¬LUªJR¢FSœAQ™>Qš@R¡HV£FR¦HTŸ>O–:M5I‹2G‹6J7P—BVœPe™J^H[ˆ8L„6N‚6Mƒ2H{*Fw,Fv&Fˆ;T˜J^¢Xl¢Zm¥bw£fxœYj–Tf‘Nb‡CZ|/Kv+Fo$Ck @l"Do"?gAb <bA\@f%Dh*Li%Cn,Mt3T{:Z’]t¯ˆ‘Á¦¤Ð´¬Ô¸®Î´¬Á¤–®} \e¥JSÀYX×l^â‚kæ’vìšyí ~ì î£~ð¨ò¦í¡|ç•tÐ|a”<PlIp.Ta.PY#MSAWDZ@ZDV@_"MaHh'R] J` Ne$Nb$T\ I}FxZGQARF]NyDjt4aQBQFQJv:k‹Y–g'X“j’’f’\MNERL„Hz•g‡„HmVF><XF‚Bpaˆh(\SJo8jˆV‰’a„T€p7cg+Ka"KM;R>U?T:W=]9h9l3t58•*: 5B©:F²BH¾OLÄNNÄOKÄPOÆNNÈTSÊXVÎYWÐZXÒ^\ÒZXÔ^\Ô][Õ^UÖ\VÕ\WÓ_W×]WÖ[YÖ`XÚgbÚb\Úd`ÞhhÜfZÞd^ÜdaÝf]Þf_Üjeßibàgbàh`àkeànfßjhÞnfßleßmhárißpjáskápiàpiàsjÞtlàpkßqlßwqÞrfÞpfßodÞreÞriÜncßphÛtlÝvkßvhÜxhÞvjÞ|rÝzpß}sÞ€rà‚uÞ…zߊ{âŒ⎀ᑄ╆♊ᢐ㠒⣔⫝̸ᮛⰣ乨巪绮èÁ´ê¶íȸìÊ»ëÉ»ìǹî̽ð̸ñͱװ¡Œ3H€0D†=L‹CS’IT•MWšQZU]žY`Xb [d£]e§^hª_d¬]a¸`^»XV·TU¸VVºQT´NR¬IT¬KT¨HT¥FP¤DR¦GU¯NR°NX¯IR£BO—:LŽ2HŒ3J8O˜@TšF\•JZˆ7N„6L~2G}+B‚0C‚.C}2L|.H2K‘@TžN`¦\l£`l¨ap£`s˜Tf–TeŒFZ‚6Ox+El Bj @n>f>e:d:b8f6^=b BdBbAj(Jj)Nn-S”Yp´Ž“ж°ÜµßóÝÀ®Ö¹¦»•Ž£_f§T[ÀZXØn\á„lçríœ{îž|îŸ~ð¤‚ñ§ô§€ðŸâŒpªS^z,QdDh%N^C_JV@\ I[DUBVE_Hc%Pf%N\Jb Md$Mf(TXIoAao3cP@VH]K‹aŒ|@mTLUNTLzApŒ^“hY‚R}šwž}GxZ"PPEqGoŠVz„Oyr/^H?J>v0`zC_”h•VNPEr3e}Ju‘bl.dR>b$MP?T;ZAV@\>c8k8q0€!6”0?¥9A²?IºCG½NOÅMJÊPKÊRPÇNKÉQPÊSRÎWUÐ[VÐZUÑZYÓ\XÕ^XÖ_WÒZTÔa\×\SÖ^TÙaX×^XÖ^ZÚd\Ø`YÚf_Úc[Üe\ÜdZÜh`ÞfZÞg`Üi`Þiaßg]àf\ámdàj`àlcßlfÞmdàqkáphàpiàniàrqßrkàulÞqlÞskàqhßulßrhàrlßrdàncÞriÝpfÞwlÝrfÝthàvhàxgßxjßwkÝzpÞznÞpÞ…vÞ…zߌ{àŒ~ã‘€á“ƒá–†àá ”â¤à¦âªšâ­žà® äµ¦æº¯ç½¯è¿±èÁ³ëÄ·ëƺêɺëȽêǼì̼ñ͵âîšKZ|.G…;K‡BVŽDOšQYœR\žRYžXbVb [f¤`fªaf¬af´`^·YZºUU¹VU¸VV¸UX·QT´QV°JT«JR©DT¬FRµQV¼TV¸QU®HR£@Nš:N“6N˜=R•DV˜I`–I\ŒAZ†:L~,Dz*A|,D~.G~)>~6N4NŽ;NœPd¥\h§aq§s¤^nžZo–PeŒEY†?Uy1Hn)Gh$Ah @i>h"@f>f;f<v:Z>d"@bA_@h"Eg%Jo.W”av½•—Û¾¯áóâijß°޾¤Î©“­po§RZÁZVØjZà‚næpìšxìŸ{ïœ~ð¢€î¢€ð¤ð¤~ìž|â“y¼lpOlx'Pc KVCbFf&NZAZDQBYB`#PbHfKb"Ld"Nj(Qi-UZL\&IzGvL@TGb'T˜uz8bVEWOVH~EtŽbo'_w8hŸ}¢•j”b#LOBRFy at h‡T€_"J`#SI
@j'Ou/^ˆXs€FxOBq0dn1cŠ[‰yJum6po4\T=P:V
7S6_6l6s2‚!7—0;¤7>°<@¹EG¾GGÀMHÃPNÊQJÊTLÈTNËRNÉSMÐWSÒXSÒ]UÐZVÒXPÓ^YÕZRÒXVÖ^XÕ^ZÕ`YÚcZØ`Y×^YÚ^XØaZÛaTÝd[ÜaXÝhaÜh`Þh`Þf]ÝdaÝh`ÞfZÞjgàhcáießkdàjaÞhgáogßqjàleápnárkàrsãtiàtkàpjàtfÞxoápjàvpßsjßreÞxqÞvlßtnÞtiÝtkÞznÞxjàylà|qß~kÞzpß}mà„và„táŠxâ|à‘‚à—…à“…á™‹à â¤“á¡Žá©œâ¬œá®Ÿä´¦æ¼¬æº¬é¾²èÀ´ëõêĶêÈ»ëÈ»ëʽìͺñ͹êʱ¯ox{.J„8H‰>JŒGUŒGPŒHT˜T]˜Tb›T`ŸZb¨bi­bf°ae´``¸ZYº[Y¼VQ¼TT¹UV¸RT·OU¸JP³LT²NV¸VYÁWXÀVV¶RY­LT¦AR@Q—=T™DZ˜F\—H^’K_„>Vƒ6J~.C}-F‚.I}0F}/H0I‹=SœM^£Wd«bn«du¨bpž\p˜VjŽJ`ŠBU4Lr)Fh#Cd>h">k%Cf:h;i<r >Œ2HY<`=`@`>d&GcHk*P˜bz̤œÛ½±ß³ãijàòݼ§Ó°’»ƒw¨PWÀ\\Õm`á€järìœvìœxìxï¡|îž{î£~ñ£|îŸ~é‘sÈnn³do‚3VcJYE\D`DXD_KPA_"Jb-Sf&PfMd Pi"Nn)Um+Tf"RTFzJpb PVLg-W˜r—s2^[JVJ\NˆQ|e•eR}4q„Uv ¦s4dPBSJh*WŠ\‚g,ac&Pe"TZA€:dn.T†NucTi)[p,`„T€G€†V„_‹ZDL6N	2X1c3u4ƒ#;’.<¥5=¬9?·DI¹HJÀGGÃNKÂJJÊPNÊTOÌSPÍVQËRPÐVOÑZUÔ`YÒ\UÐ\XÐ]VÔYRÑ[VÖ]V×a^Ø`XÚ_XÚb\Ø`[Ú^RØ_YÜ_VÜd\ÛaZÞd[Ýf^Ýf_Üb[Ûg_Þmfáj^Þhdàh`àkdàg^àlbàlhßplànjàniásnàoeàqiâulßriâtkàthàqkávjàwmÞthâujßxmßsjàslÞtfÞtgÞwlÞzlâyná~sà|sà{pßzoáƒzâ‡{á‹yâà‘€ß‘à’ᚆ⠊ឈ࢒䨖⭜௝䲡䶨亭羰çÀ´êĶêÄ·êȺìȺìʼìÊ»ñ˹îαʓ’}/J{4Lˆ>LHR’R[–MY—P\”NZ›Vc¡\b«^c¯ad²]`¶\^º][À[WÂXV¼UV¼UVºOQ¸OU½RS¼QS¿WYÈ[VÊ_XÂXWºOQ¬GR ?Pœ@U›DXœNb”F]ˆBZˆ@Y‚<Xˆ;Qƒ8Rƒ4J‚;P€-G†2H‹:P˜H\§Vh­cq¬hs¬fv¤cp›Uf•RiˆD]€;Rt*Fh @c;`6f9i<j)Fl<}+Fˆ0C™8IZ>[=b?`@d"EaEj'P˜\rΦœÚ¼¯ÜÀ°àñßÁ®Þ»¦Õ²˜Áˆ~¥R\¾ZXÖnbà‚kåŽuìœvìžwê xí¢|î {ï£|ñ¥€íšxß“xºYbžNbv-QbF^DWAX>ZAc JUH^H`#LdLk%Rh"Nr*Vz6\z5]r2\[Jd$Ms0`\OsDnŒ\‚q,XcJ[Nj"W„Fq`TB~?ut0dšz˜–d‘[KRIk/b_„‹X†XJe&Pf&Tr0T}<gf*Oh+XVGn/`~@k€I}s9q”fŠ^‰^!KT4\4o3€7&9œ+;¨6>¯9B¸FHºDEÁGFÆPQÈPNÌOLÊWTÍUQÎUPÌWTÐXQÐXOÒ_WÒ]VÐZWÐ\XÔ^TÓ`[×`UØbXÖ]ZÙ`XÙb\ØbYÜ\TÛ^TÚh_Üd[ÝjdÝf`ÞeXÝc]Ý`XÜf`ÞjhÞjbÝgeÞmkÞkfßgdàicàngánjâpdârgâtjárgàsjàkiàrfásháqjßrhârfázpàwnâxiátgÞxlávhÞrfßuhÞxoÝzjà{lâ~lá}oà€rà~rà„wã…và‹}áŒ~à‹|ÝŠá’‚á–‡àžŽàšŠá£’ã©—ã¬á®ã²žæµ¨å¹§ç¼±è¾±êÁ´ë·éÆ·ìƸíʽíʺðʺïͲڲ¦‹:N4I„<KŠ?IBN”FO’NZ”O[šR\ž[b¨\`®^a´[\¸^^ÄaXÃa^Ã\VÀTRÀTS¿SPÁYWÇXTËUTÐ`WÐ`XÌ_XÃVS¸KR£GTž?Oš@V™DT–E\Š<X‚<V6Pƒ9OŠ<U„:P†:P†5K„2GŒ<Q˜H]£Xj¬bl¯mx¬kx«htž\m—Uh‹EZ€<Tt)Ei<f!A^8a>e>g=p&By(CŒ5HŸ?J¢<KU<\<^>^:c D^Fc&O‰OmË¢šÚ»²Þ¾²ÞÀ³Ý¿²Ú¸¦Ò®—À‡y§NXÀ\XØn_ß„nåtìšwëž{적î |좀ñ¤}íŸvÞ‘w¤JWŠA^j"Gf$NdHR@P<_Bh%LP?g*V[Hh)Rn(Rg#Pp-Vs*Tx5Zx6b\JbMp0fj.^o’†HpbLg!T` QiR†Lub‹P@w8fv3fu<h“jŠ€FzXMf'U˜p—‹XzXDRCTDl(Q<^s0\f(SWIWFaL~Kym,b}?g—f…X|j$Ki<‚$<–->œ4B¢1?©7@®?F½GHÁHIÆMJÊQNÊSRÊPPÎTTÎXSÏXSÐWUÑ\SÓZRÐZXÑZXÐ^[Ò]TÖ]TÓ]TÕ^X×_TØ\UØ\XØaZ×`ZÛ^XÚ^VÛcXÜa\Üe[àe[Þi`Þf_à^WÞdZÝc[Þd\Þhhàh_àhdÞlfàjcÞnhàrgárfâpfßphßrjßrjÞkfàrlâsjàtoßsmârgáwlàxlàuhàtlàvhßyoßymàtgßxjÜ{pàwkßyoá€rá€tá€pá‚sâ…yáˆ|áŽ€àŽ„àŽá~ß“†á˜ŠàšŒàžŒâ¤•âª•â¯Ÿä± å´¦å¸¨å¸¬ç¿°ê¿°êÁ´éĶíƼíÈÀìÇ»ïʼðηæÄ®¥Vl„>Z‡?PˆDS‘HNŽ@JBM”JV™W`œW_¦Y`«X[´^_Âe_Ìg\É`VÆ[VÅ\WÆZTÆXTÄZWÎb[Ñh[ÖkXÑdYË]UÀTR±IR¡>NžBQ—>O’:P‡7Q{4Q4R‚6SŒBY>XŠ@Tˆ:Q†:P…4M”DUžK^©Zk²gp¯n|¬ktªguœ]kŽH^:Qv/Hg >a<_6`:`8c;j?u+F†4Jš@R¬FRªANR9^>`=\=` C[>`H†HfÄ™ŽÚ¼®Þ¾±Ü¾°Ü¾®Øº¦Ñ¬·zq¡S^Â`\Øl\á„mæŒnë–x을ì¢zì¢|ð¤‚잀á–{¢JWFdh&Nj%LY>Q>P:d"Gi*PH8g(RV@r0Yr2[k"Mq*Vm&Nt-Xx4^f%ObS|@t|;h ˆ«r4Y`Fq.`VBd R‚Gm^ˆTHi(Tt4`p+d|Fk˜nœs2l\!N x|EhN=YFSJZDo*Xy:`e-Se"PTD_L}Lso.a`F‚Lzz7NR€z8’/D—1A›2>¨:D¨8@²@DºDF¾HKÃJJÆLNÈQRÏSRËWTÌVQÎXQÑZPÐXQÒZTÑbZÑa[ÐZWÒ]TÕ\TÔ\VÔ]WÖ\T×`\×b^Ùb\Öd]Û`TÛ^XÜ^Wß`YÞe^ÞibÞe_Üe]ß`XÞc\Ýd\ßb^ÞfdâhfàhdÞnháihàhbàojândârlÞnfÞpfÞnnâmcàrkárhàqhßrjàrhàvjàxiáypàwlßvhßxlÞxqáyißxlÞ{oÞztà{pà„rà„tà‚xâ€tà„tàˆ~áŒ‚à†ßŒ„ߐ€à”ˆá”Šâ˜Œàœâ¦”᪘ᬘ峢䳤䷤䶨溰辰èÀ´ê´ìŹìÇÀîļðÊ»ð˵êÈ·Ân‚žR€’IhˆEZŽDRŽBPHT“HRšPWœRZœPY°bf½f^Çj]Ñh\Ïc\Ì`VÈ\XÎ]TÊ[TÈ`\Ðj^×l[ØkZÑfZÊXP¸RS¨BK˜<J˜<L6Lƒ/H1Lx2P|2P‰>ZŽ@]AXŽBZ†<V‡6QŒ<R—DV¤P_¬cn²fp®mvªjx¥dr–Vg†D[v+Fh#@f"D_<Z2_7`:k>v,N~8P–BV¨GT²DN·HQ
\ No newline at end of file
diff --git a/deps/libav/tests/md5.sh b/deps/libav/tests/md5.sh
deleted file mode 100644
index 0b382b1..0000000
--- a/deps/libav/tests/md5.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-# try to find an md5 program
-
-if [ X"$(echo | md5sum -b 2> /dev/null)" != X ]; then
-    do_md5sum() { md5sum -b $1; }
-elif [ X"$(echo | command md5 2> /dev/null)" != X ]; then
-    do_md5sum() { command md5 $1 | sed 's#MD5 (\(.*\)) = \(.*\)#\2 *\1#'; }
-elif [ -x /sbin/md5 ]; then
-    do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
-elif openssl version >/dev/null 2>&1; then
-    do_md5sum() { openssl md5 $1 | sed 's/MD5(\(.*\))= \(.*\)/\2 *\1/'; }
-else
-    do_md5sum() { echo No md5sum program found; }
-fi
diff --git a/deps/libav/tests/ref/acodec/adpcm-adx b/deps/libav/tests/ref/acodec/adpcm-adx
deleted file mode 100644
index 2bc49ab..0000000
--- a/deps/libav/tests/ref/acodec/adpcm-adx
+++ /dev/null
@@ -1,4 +0,0 @@
-0a30509d9296b857e134b762b76dbc31 *tests/data/fate/acodec-adpcm-adx.adx
-297720 tests/data/fate/acodec-adpcm-adx.adx
-2dbc601ed5259f4d74dc48ccd8da7eaf *tests/data/fate/acodec-adpcm-adx.out.wav
-stddev: 6989.46 PSNR: 19.44 MAXDIFF:65398 bytes:  1058400/  1058432
diff --git a/deps/libav/tests/ref/acodec/adpcm-ima_qt b/deps/libav/tests/ref/acodec/adpcm-ima_qt
deleted file mode 100644
index 8001527..0000000
--- a/deps/libav/tests/ref/acodec/adpcm-ima_qt
+++ /dev/null
@@ -1,4 +0,0 @@
-23cbae1182e150ebf28e0abfb9cba127 *tests/data/fate/acodec-adpcm-ima_qt.aiff
-281252 tests/data/fate/acodec-adpcm-ima_qt.aiff
-b0fafd002c38fb70acaddfda1a31ed61 *tests/data/fate/acodec-adpcm-ima_qt.out.wav
-stddev:  904.76 PSNR: 37.20 MAXDIFF:34029 bytes:  1058400/  1058560
diff --git a/deps/libav/tests/ref/acodec/adpcm-ima_wav b/deps/libav/tests/ref/acodec/adpcm-ima_wav
deleted file mode 100644
index 6d83fd5..0000000
--- a/deps/libav/tests/ref/acodec/adpcm-ima_wav
+++ /dev/null
@@ -1,4 +0,0 @@
-56b75c3a6dacedcf2ce7b0586aa33594 *tests/data/fate/acodec-adpcm-ima_wav.wav
-267324 tests/data/fate/acodec-adpcm-ima_wav.wav
-ddddfa47302da540abf19224202bef57 *tests/data/fate/acodec-adpcm-ima_wav.out.wav
-stddev:  903.51 PSNR: 37.21 MAXDIFF:34026 bytes:  1058400/  1061748
diff --git a/deps/libav/tests/ref/acodec/adpcm-ms b/deps/libav/tests/ref/acodec/adpcm-ms
deleted file mode 100644
index eb8515d..0000000
--- a/deps/libav/tests/ref/acodec/adpcm-ms
+++ /dev/null
@@ -1,4 +0,0 @@
-a407b87daeef5b25dfb6c5b3f519e9c1 *tests/data/fate/acodec-adpcm-ms.wav
-268378 tests/data/fate/acodec-adpcm-ms.wav
-22863fb278c4e0ebe9c34cb15db5dd6b *tests/data/fate/acodec-adpcm-ms.out.wav
-stddev: 1050.01 PSNR: 35.91 MAXDIFF:29806 bytes:  1058400/  1060576
diff --git a/deps/libav/tests/ref/acodec/adpcm-swf b/deps/libav/tests/ref/acodec/adpcm-swf
deleted file mode 100644
index fddb771..0000000
--- a/deps/libav/tests/ref/acodec/adpcm-swf
+++ /dev/null
@@ -1,4 +0,0 @@
-42d4639866ed4d692eaf126228a4fa2a *tests/data/fate/acodec-adpcm-swf.flv
-269166 tests/data/fate/acodec-adpcm-swf.flv
-f7df69d3fe708303820f2a9d00140a5b *tests/data/fate/acodec-adpcm-swf.out.wav
-stddev:  933.58 PSNR: 36.93 MAXDIFF:51119 bytes:  1058400/  1064960
diff --git a/deps/libav/tests/ref/acodec/adpcm-yamaha b/deps/libav/tests/ref/acodec/adpcm-yamaha
deleted file mode 100644
index da60f44..0000000
--- a/deps/libav/tests/ref/acodec/adpcm-yamaha
+++ /dev/null
@@ -1,4 +0,0 @@
-e9c14f701d25947317db9367b9dc772d *tests/data/fate/acodec-adpcm-yamaha.wav
-265274 tests/data/fate/acodec-adpcm-yamaha.wav
-1488b5974fa040a65f0d407fc0224c6a *tests/data/fate/acodec-adpcm-yamaha.out.wav
-stddev: 1247.60 PSNR: 34.41 MAXDIFF:39895 bytes:  1058400/  1060864
diff --git a/deps/libav/tests/ref/acodec/alac b/deps/libav/tests/ref/acodec/alac
deleted file mode 100644
index dde0e36..0000000
--- a/deps/libav/tests/ref/acodec/alac
+++ /dev/null
@@ -1,4 +0,0 @@
-98cfcf6cf139844ca27d16f1fc64f62c *tests/data/fate/acodec-alac.mov
-389258 tests/data/fate/acodec-alac.mov
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-alac.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/flac b/deps/libav/tests/ref/acodec/flac
deleted file mode 100644
index 3ef32c2..0000000
--- a/deps/libav/tests/ref/acodec/flac
+++ /dev/null
@@ -1,4 +0,0 @@
-f582b59cc68adfcb3342dcfd7e020b71 *tests/data/fate/acodec-flac.flac
-361581 tests/data/fate/acodec-flac.flac
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-flac.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/mp2 b/deps/libav/tests/ref/acodec/mp2
deleted file mode 100644
index 42381b4..0000000
--- a/deps/libav/tests/ref/acodec/mp2
+++ /dev/null
@@ -1,4 +0,0 @@
-f6eb0a205350bbd7fb1028a01c7ae8aa *tests/data/fate/acodec-mp2.mp2
-96130 tests/data/fate/acodec-mp2.mp2
-5a669ca7321adc6ab66a3eade4035909 *tests/data/fate/acodec-mp2.out.wav
-stddev: 4384.33 PSNR: 23.49 MAXDIFF:52631 bytes:  1058400/  1057916
diff --git a/deps/libav/tests/ref/acodec/pcm-alaw b/deps/libav/tests/ref/acodec/pcm-alaw
deleted file mode 100644
index 28ce960..0000000
--- a/deps/libav/tests/ref/acodec/pcm-alaw
+++ /dev/null
@@ -1,4 +0,0 @@
-a2dd6a934ec6d5ec901a211652e85227 *tests/data/fate/acodec-pcm-alaw.wav
-529258 tests/data/fate/acodec-pcm-alaw.wav
-f323f7551ffad91de8613f44dcb198b6 *tests/data/fate/acodec-pcm-alaw.out.wav
-stddev:  101.67 PSNR: 56.19 MAXDIFF:  515 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-f32be b/deps/libav/tests/ref/acodec/pcm-f32be
deleted file mode 100644
index 5b0f498..0000000
--- a/deps/libav/tests/ref/acodec/pcm-f32be
+++ /dev/null
@@ -1,4 +0,0 @@
-118ff3dc83c62ce9ce669eef57e55bb2 *tests/data/fate/acodec-pcm-f32be.au
-2116824 tests/data/fate/acodec-pcm-f32be.au
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-f32be.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-f32le b/deps/libav/tests/ref/acodec/pcm-f32le
deleted file mode 100644
index 681f083..0000000
--- a/deps/libav/tests/ref/acodec/pcm-f32le
+++ /dev/null
@@ -1,4 +0,0 @@
-653d82a64b7bd96ac193e105e9f92d4c *tests/data/fate/acodec-pcm-f32le.wav
-2116880 tests/data/fate/acodec-pcm-f32le.wav
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-f32le.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-f64be b/deps/libav/tests/ref/acodec/pcm-f64be
deleted file mode 100644
index dd882d3..0000000
--- a/deps/libav/tests/ref/acodec/pcm-f64be
+++ /dev/null
@@ -1,4 +0,0 @@
-8112296b1ed94f72f20d04b1a54850a7 *tests/data/fate/acodec-pcm-f64be.au
-4233624 tests/data/fate/acodec-pcm-f64be.au
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-f64be.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-f64le b/deps/libav/tests/ref/acodec/pcm-f64le
deleted file mode 100644
index c6cb027..0000000
--- a/deps/libav/tests/ref/acodec/pcm-f64le
+++ /dev/null
@@ -1,4 +0,0 @@
-48b4cd378f47a50dc902aa03cc8280ed *tests/data/fate/acodec-pcm-f64le.wav
-4233680 tests/data/fate/acodec-pcm-f64le.wav
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-f64le.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-mulaw b/deps/libav/tests/ref/acodec/pcm-mulaw
deleted file mode 100644
index bd2a1e8..0000000
--- a/deps/libav/tests/ref/acodec/pcm-mulaw
+++ /dev/null
@@ -1,4 +0,0 @@
-fd10ee54bd298fc29fd6fc70baa71414 *tests/data/fate/acodec-pcm-mulaw.wav
-529258 tests/data/fate/acodec-pcm-mulaw.wav
-7ae8c3fc804bd574006fd547fe28980c *tests/data/fate/acodec-pcm-mulaw.out.wav
-stddev:  103.38 PSNR: 56.04 MAXDIFF:  644 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-s16be b/deps/libav/tests/ref/acodec/pcm-s16be
deleted file mode 100644
index 61e5664..0000000
--- a/deps/libav/tests/ref/acodec/pcm-s16be
+++ /dev/null
@@ -1,4 +0,0 @@
-b650d16f5ac191c41d5fa3657cf4c1ac *tests/data/fate/acodec-pcm-s16be.mov
-1060097 tests/data/fate/acodec-pcm-s16be.mov
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s16be.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-s16le b/deps/libav/tests/ref/acodec/pcm-s16le
deleted file mode 100644
index 51366ad..0000000
--- a/deps/libav/tests/ref/acodec/pcm-s16le
+++ /dev/null
@@ -1,4 +0,0 @@
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s16le.wav
-1058446 tests/data/fate/acodec-pcm-s16le.wav
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s16le.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-s24be b/deps/libav/tests/ref/acodec/pcm-s24be
deleted file mode 100644
index f673040..0000000
--- a/deps/libav/tests/ref/acodec/pcm-s24be
+++ /dev/null
@@ -1,4 +0,0 @@
-0bd99d1273fb1fb78055cf97f3efe299 *tests/data/fate/acodec-pcm-s24be.mov
-1589297 tests/data/fate/acodec-pcm-s24be.mov
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s24be.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-s24le b/deps/libav/tests/ref/acodec/pcm-s24le
deleted file mode 100644
index a7e77e2..0000000
--- a/deps/libav/tests/ref/acodec/pcm-s24le
+++ /dev/null
@@ -1,4 +0,0 @@
-18ea73985dbdf59e23f5aba66145e6fe *tests/data/fate/acodec-pcm-s24le.wav
-1587668 tests/data/fate/acodec-pcm-s24le.wav
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s24le.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-s32be b/deps/libav/tests/ref/acodec/pcm-s32be
deleted file mode 100644
index 1b6dec9..0000000
--- a/deps/libav/tests/ref/acodec/pcm-s32be
+++ /dev/null
@@ -1,4 +0,0 @@
-7ebffb0bd01c02b9953ee5b1e2f47910 *tests/data/fate/acodec-pcm-s32be.mov
-2118497 tests/data/fate/acodec-pcm-s32be.mov
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s32be.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-s32le b/deps/libav/tests/ref/acodec/pcm-s32le
deleted file mode 100644
index 1c3e412..0000000
--- a/deps/libav/tests/ref/acodec/pcm-s32le
+++ /dev/null
@@ -1,4 +0,0 @@
-8d8849fa5c5d91b9cb74f5c74e937faf *tests/data/fate/acodec-pcm-s32le.wav
-2116868 tests/data/fate/acodec-pcm-s32le.wav
-64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s32le.out.wav
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-s8 b/deps/libav/tests/ref/acodec/pcm-s8
deleted file mode 100644
index c947729..0000000
--- a/deps/libav/tests/ref/acodec/pcm-s8
+++ /dev/null
@@ -1,4 +0,0 @@
-3b52f563e8e99aa26253eff154980a93 *tests/data/fate/acodec-pcm-s8.mov
-530897 tests/data/fate/acodec-pcm-s8.mov
-651d4eb8d98dfcdda96ae6c43d8f156b *tests/data/fate/acodec-pcm-s8.out.wav
-stddev:  147.89 PSNR: 52.93 MAXDIFF:  255 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/acodec/pcm-u8 b/deps/libav/tests/ref/acodec/pcm-u8
deleted file mode 100644
index 80e70ea..0000000
--- a/deps/libav/tests/ref/acodec/pcm-u8
+++ /dev/null
@@ -1,4 +0,0 @@
-70fecbae732f81143a560c7315eda49a *tests/data/fate/acodec-pcm-u8.wav
-529246 tests/data/fate/acodec-pcm-u8.wav
-651d4eb8d98dfcdda96ae6c43d8f156b *tests/data/fate/acodec-pcm-u8.out.wav
-stddev:  147.89 PSNR: 52.93 MAXDIFF:  255 bytes:  1058400/  1058400
diff --git a/deps/libav/tests/ref/fate/4xm-1 b/deps/libav/tests/ref/fate/4xm-1
deleted file mode 100644
index d38a47a..0000000
--- a/deps/libav/tests/ref/fate/4xm-1
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,   921600, 0xd08f97c7
-0,          1,          1,        1,   921600, 0xc433a85b
-0,          2,          2,        1,   921600, 0x7ffeee42
-0,          3,          3,        1,   921600, 0xc0ad9f52
-0,          4,          4,        1,   921600, 0xb0235112
-0,          5,          5,        1,   921600, 0xcbdd9805
-0,          6,          6,        1,   921600, 0x5468bdb9
-0,          7,          7,        1,   921600, 0x2f0c63fd
-0,          8,          8,        1,   921600, 0xf1de04f0
-0,          9,          9,        1,   921600, 0x95709ce2
-0,         10,         10,        1,   921600, 0x69037c4a
-0,         11,         11,        1,   921600, 0x513f8a98
-0,         12,         12,        1,   921600, 0x55b82fa1
-0,         13,         13,        1,   921600, 0x5c8ace28
-0,         14,         14,        1,   921600, 0xb019770a
diff --git a/deps/libav/tests/ref/fate/4xm-2 b/deps/libav/tests/ref/fate/4xm-2
deleted file mode 100644
index 35b0797..0000000
--- a/deps/libav/tests/ref/fate/4xm-2
+++ /dev/null
@@ -1,175 +0,0 @@
-#tb 0: 1/6
-0,          0,          0,        1,    80640, 0x00000000
-0,          1,          1,        1,    80640, 0x3a942680
-0,          2,          2,        1,    80640, 0x3a942680
-0,          3,          3,        1,    80640, 0x3a942680
-0,          4,          4,        1,    80640, 0x3a942680
-0,          5,          5,        1,    80640, 0x3a942680
-0,          6,          6,        1,    80640, 0x3a942680
-0,          7,          7,        1,    80640, 0x1956ebfc
-0,          8,          8,        1,    80640, 0x61686290
-0,          9,          9,        1,    80640, 0x7e2c2753
-0,         10,         10,        1,    80640, 0x63e5e14f
-0,         11,         11,        1,    80640, 0xa775947a
-0,         12,         12,        1,    80640, 0x4b91b93d
-0,         13,         13,        1,    80640, 0x83345f32
-0,         14,         14,        1,    80640, 0x5d3a3374
-0,         15,         15,        1,    80640, 0x164808c5
-0,         16,         16,        1,    80640, 0xfd0189af
-0,         17,         17,        1,    80640, 0x062f9389
-0,         18,         18,        1,    80640, 0xe4dcaff8
-0,         19,         19,        1,    80640, 0xb2d9ec51
-0,         20,         20,        1,    80640, 0x3b4d5331
-0,         21,         21,        1,    80640, 0xfcbd8da1
-0,         22,         22,        1,    80640, 0xa0732142
-0,         23,         23,        1,    80640, 0x6438df5f
-0,         24,         24,        1,    80640, 0x614302fa
-0,         25,         25,        1,    80640, 0x53edf986
-0,         26,         26,        1,    80640, 0x6dfe13f0
-0,         27,         27,        1,    80640, 0x0b2194c3
-0,         28,         28,        1,    80640, 0xe0436945
-0,         29,         29,        1,    80640, 0x8d8ba77f
-0,         30,         30,        1,    80640, 0x9c723388
-0,         31,         31,        1,    80640, 0x336bd2a2
-0,         32,         32,        1,    80640, 0x5905fd0b
-0,         33,         33,        1,    80640, 0x2ca368bb
-0,         34,         34,        1,    80640, 0x38c1e5ec
-0,         35,         35,        1,    80640, 0xe439a194
-0,         36,         36,        1,    80640, 0xe7a19a64
-0,         37,         37,        1,    80640, 0xbe7f9094
-0,         38,         38,        1,    80640, 0x0b2cbec9
-0,         39,         39,        1,    80640, 0x8050bf7d
-0,         40,         40,        1,    80640, 0x4e9d4e78
-0,         41,         41,        1,    80640, 0xaa7bb85d
-0,         42,         42,        1,    80640, 0x6e42b1a6
-0,         43,         43,        1,    80640, 0x27043fe0
-0,         44,         44,        1,    80640, 0xe04bd5e6
-0,         45,         45,        1,    80640, 0xd60762d6
-0,         46,         46,        1,    80640, 0x2729df8f
-0,         47,         47,        1,    80640, 0x1b62c4f7
-0,         48,         48,        1,    80640, 0xe6b5d2f7
-0,         49,         49,        1,    80640, 0xf5885096
-0,         50,         50,        1,    80640, 0xe7625cf6
-0,         51,         51,        1,    80640, 0xed804de6
-0,         52,         52,        1,    80640, 0x3f92728e
-0,         53,         53,        1,    80640, 0x353e4b0d
-0,         54,         54,        1,    80640, 0x70b0228c
-0,         55,         55,        1,    80640, 0x851bd554
-0,         56,         56,        1,    80640, 0x594f22eb
-0,         57,         57,        1,    80640, 0xa2267c0b
-0,         58,         58,        1,    80640, 0xdc0fbafb
-0,         59,         59,        1,    80640, 0xd596b763
-0,         60,         60,        1,    80640, 0x3b9c4b1b
-0,         61,         61,        1,    80640, 0x218ac4b4
-0,         62,         62,        1,    80640, 0x4af393a4
-0,         63,         63,        1,    80640, 0x66c098c5
-0,         64,         64,        1,    80640, 0x7cc91e86
-0,         65,         65,        1,    80640, 0xba282a2e
-0,         66,         66,        1,    80640, 0x50932be6
-0,         67,         67,        1,    80640, 0x6531386e
-0,         68,         68,        1,    80640, 0x2616235f
-0,         69,         69,        1,    80640, 0x27aad18a
-0,         70,         70,        1,    80640, 0x67491df3
-0,         71,         71,        1,    80640, 0x167028f1
-0,         72,         72,        1,    80640, 0xa4229420
-0,         73,         73,        1,    80640, 0x77eaed07
-0,         74,         74,        1,    80640, 0xbdf7d8e8
-0,         75,         75,        1,    80640, 0xc2ac8545
-0,         76,         76,        1,    80640, 0xf3fe64ec
-0,         77,         77,        1,    80640, 0x66451d43
-0,         78,         78,        1,    80640, 0x1af2f05e
-0,         79,         79,        1,    80640, 0x2a63c2c4
-0,         80,         80,        1,    80640, 0xe4e07a0f
-0,         81,         81,        1,    80640, 0x598e8b11
-0,         82,         82,        1,    80640, 0xb2ebb868
-0,         83,         83,        1,    80640, 0xa4b6bb8a
-0,         84,         84,        1,    80640, 0x5037e910
-0,         85,         85,        1,    80640, 0x0c55f6c0
-0,         86,         86,        1,    80640, 0x3f4704f7
-0,         87,         87,        1,    80640, 0xa6a8e810
-0,         88,         88,        1,    80640, 0xedbfcfb0
-0,         89,         89,        1,    80640, 0xe568caa0
-0,         90,         90,        1,    80640, 0xdf21cc20
-0,         91,         91,        1,    80640, 0xb66cd4a8
-0,         92,         92,        1,    80640, 0xcd26c9c8
-0,         93,         93,        1,    80640, 0x5fe8d598
-0,         94,         94,        1,    80640, 0xed0dc9c8
-0,         95,         95,        1,    80640, 0x8313d288
-0,         96,         96,        1,    80640, 0x9ccdd4a0
-0,         97,         97,        1,    80640, 0x66ffe970
-0,         98,         98,        1,    80640, 0xf68ad1c8
-0,         99,         99,        1,    80640, 0xd570f658
-0,        100,        100,        1,    80640, 0x8c39d998
-0,        101,        101,        1,    80640, 0xe18fe5e0
-0,        102,        102,        1,    80640, 0xbbe7e340
-0,        103,        103,        1,    80640, 0x9a90d470
-0,        104,        104,        1,    80640, 0xd2bbced0
-0,        105,        105,        1,    80640, 0xbbf9dce0
-0,        106,        106,        1,    80640, 0x4ff7c888
-0,        107,        107,        1,    80640, 0xc2e7e1f0
-0,        108,        108,        1,    80640, 0x2104e3b0
-0,        109,        109,        1,    80640, 0xaef5e8f0
-0,        110,        110,        1,    80640, 0xc477e890
-0,        111,        111,        1,    80640, 0xb12df778
-0,        112,        112,        1,    80640, 0xd2115720
-0,        113,        113,        1,    80640, 0x620b6538
-0,        114,        114,        1,    80640, 0x894a8db8
-0,        115,        115,        1,    80640, 0x8da3bcb0
-0,        116,        116,        1,    80640, 0x96be8930
-0,        117,        117,        1,    80640, 0xe69dc1f0
-0,        118,        118,        1,    80640, 0x42b8d4e0
-0,        119,        119,        1,    80640, 0x0a8da4f0
-0,        120,        120,        1,    80640, 0x245fd3d8
-0,        121,        121,        1,    80640, 0x3fd1e858
-0,        122,        122,        1,    80640, 0xe2c299f0
-0,        123,        123,        1,    80640, 0xda1cddd0
-0,        124,        124,        1,    80640, 0xf126e498
-0,        125,        125,        1,    80640, 0xc85ab920
-0,        126,        126,        1,    80640, 0x52f39de8
-0,        127,        127,        1,    80640, 0xd0daac60
-0,        128,        128,        1,    80640, 0xef323347
-0,        129,        129,        1,    80640, 0xcc063317
-0,        130,        130,        1,    80640, 0xb6f53057
-0,        131,        131,        1,    80640, 0x5fe53b07
-0,        132,        132,        1,    80640, 0x63183d7f
-0,        133,        133,        1,    80640, 0x91a44bbf
-0,        134,        134,        1,    80640, 0xa433480f
-0,        135,        135,        1,    80640, 0xe90652ef
-0,        136,        136,        1,    80640, 0xe96e35bf
-0,        137,        137,        1,    80640, 0x84ff2ccf
-0,        138,        138,        1,    80640, 0x930f2b07
-0,        139,        139,        1,    80640, 0x5a1228d7
-0,        140,        140,        1,    80640, 0x29f226ef
-0,        141,        141,        1,    80640, 0xd35136df
-0,        142,        142,        1,    80640, 0x0e2d407f
-0,        143,        143,        1,    80640, 0x34a93267
-0,        144,        144,        1,    80640, 0x7ae82af7
-0,        145,        145,        1,    80640, 0xb20c2477
-0,        146,        146,        1,    80640, 0xa104218f
-0,        147,        147,        1,    80640, 0xcb1121e7
-0,        148,        148,        1,    80640, 0xaca04751
-0,        149,        149,        1,    80640, 0x3a51c704
-0,        150,        150,        1,    80640, 0xfa632e3d
-0,        151,        151,        1,    80640, 0x61c9407c
-0,        152,        152,        1,    80640, 0xe9a08dd9
-0,        153,        153,        1,    80640, 0xebf3c623
-0,        154,        154,        1,    80640, 0x00000000
-0,        155,        155,        1,    80640, 0x0f412500
-0,        156,        156,        1,    80640, 0x0f412500
-0,        157,        157,        1,    80640, 0x0f412500
-0,        158,        158,        1,    80640, 0xb6634270
-0,        159,        159,        1,    80640, 0x9e43a4a0
-0,        160,        160,        1,    80640, 0x136ab60b
-0,        161,        161,        1,    80640, 0x6ce3254e
-0,        162,        162,        1,    80640, 0xf4340d15
-0,        163,        163,        1,    80640, 0x73861114
-0,        164,        164,        1,    80640, 0x36b300d3
-0,        165,        165,        1,    80640, 0x2ddde523
-0,        166,        166,        1,    80640, 0xfdd79c02
-0,        167,        167,        1,    80640, 0xe6cc4fe9
-0,        168,        168,        1,    80640, 0x5b13e2b9
-0,        169,        169,        1,    80640, 0x0d588e70
-0,        170,        170,        1,    80640, 0xc6e4023f
-0,        171,        171,        1,    80640, 0xf54c496f
-0,        172,        172,        1,    80640, 0xa315a5cf
-0,        173,        173,        1,    80640, 0x2d2ac9c7
diff --git a/deps/libav/tests/ref/fate/8bps b/deps/libav/tests/ref/fate/8bps
deleted file mode 100644
index 869d38c..0000000
--- a/deps/libav/tests/ref/fate/8bps
+++ /dev/null
@@ -1,37 +0,0 @@
-#tb 0: 1/125
-#tb 1: 1/22050
-0,          0,          0,        1,   259200, 0x7e91df07
-1,          0,          0,     1024,     2048, 0x3d042426
-1,       1024,       1024,     1024,     2048, 0x5bcae456
-0,         10,         10,        1,   259200, 0x7e91df07
-1,       2048,       2048,     1024,     2048, 0xb6043655
-1,       3072,       3072,     1024,     2048, 0x6fdaffad
-0,         20,         20,        1,   259200, 0xc468c119
-1,       4096,       4096,     1024,     2048, 0xf86700cb
-1,       5120,       5120,     1024,     2048, 0x045e46c1
-0,         30,         30,        1,   259200, 0x0e058930
-1,       6144,       6144,     1024,     2048, 0x000df0e5
-0,         40,         40,        1,   259200, 0xa0261310
-1,       7168,       7168,     1024,     2048, 0x8f5f12fb
-1,       8192,       8192,     1024,     2048, 0xd516f6b0
-0,         50,         50,        1,   259200, 0x78ca9aba
-1,       9216,       9216,     1024,     2048, 0xa1fe2bd3
-1,      10240,      10240,     1024,     2048, 0x3647087a
-0,         60,         60,        1,   259200, 0x4971f7b3
-1,      11264,      11264,     1024,     2048, 0xd2ee584e
-1,      12288,      12288,     1024,     2048, 0xf132088c
-0,         70,         70,        1,   259200, 0x7dc2cff7
-1,      13312,      13312,     1024,     2048, 0x1efc0eb1
-0,         80,         80,        1,   259200, 0x8cbc53d5
-1,      14336,      14336,     1024,     2048, 0xeb73f402
-1,      15360,      15360,     1024,     2048, 0x75cb3d20
-0,         90,         90,        1,   259200, 0xcccd77e3
-1,      16384,      16384,     1024,     2048, 0x85a501b6
-1,      17408,      17408,     1024,     2048, 0xa4eb312d
-0,        100,        100,        1,   259200, 0x6b3e0fb3
-1,      18432,      18432,     1024,     2048, 0xf0aaf8c7
-0,        110,        110,        1,   259200, 0x281dd175
-1,      19456,      19456,     1024,     2048, 0x65371cda
-1,      20480,      20480,     1024,     2048, 0x25512cd6
-1,      21504,      21504,     1024,     2048, 0xc81410e3
-1,      22528,      22528,      257,      514, 0x57d77b94
diff --git a/deps/libav/tests/ref/fate/aasc b/deps/libav/tests/ref/fate/aasc
deleted file mode 100644
index 57d59a9..0000000
--- a/deps/libav/tests/ref/fate/aasc
+++ /dev/null
@@ -1,24 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   168000, 0x00000000
-0,          1,          1,        1,   168000, 0x00000000
-0,          2,          2,        1,   168000, 0x00000000
-0,          3,          3,        1,   168000, 0x00000000
-0,          4,          4,        1,   168000, 0x00000000
-0,          5,          5,        1,   168000, 0x00000000
-0,          6,          6,        1,   168000, 0x00000000
-0,          7,          7,        1,   168000, 0x00000000
-0,          8,          8,        1,   168000, 0x00000000
-0,          9,          9,        1,   168000, 0x00000000
-0,         10,         10,        1,   168000, 0x00000000
-0,         11,         11,        1,   168000, 0x00000000
-0,         12,         12,        1,   168000, 0xa6298d46
-0,         13,         13,        1,   168000, 0x5d89d96c
-0,         14,         14,        1,   168000, 0x16d994da
-0,         15,         15,        1,   168000, 0xa8c6079b
-0,         16,         16,        1,   168000, 0xdd1decac
-0,         17,         17,        1,   168000, 0x6a96003c
-0,         18,         18,        1,   168000, 0xef7f1ff4
-0,         19,         19,        1,   168000, 0x90dc0126
-0,         20,         20,        1,   168000, 0x7a2b1006
-0,         21,         21,        1,   168000, 0xc7ca1345
-0,         22,         22,        1,   168000, 0x8841c413
diff --git a/deps/libav/tests/ref/fate/adpcm-creative b/deps/libav/tests/ref/fate/adpcm-creative
deleted file mode 100644
index 039ca3a..0000000
--- a/deps/libav/tests/ref/fate/adpcm-creative
+++ /dev/null
@@ -1 +0,0 @@
-66004779a5e51ca659b21a4197e019e6
diff --git a/deps/libav/tests/ref/fate/adpcm-creative-8-2.6bit b/deps/libav/tests/ref/fate/adpcm-creative-8-2.6bit
deleted file mode 100644
index 8357604..0000000
--- a/deps/libav/tests/ref/fate/adpcm-creative-8-2.6bit
+++ /dev/null
@@ -1 +0,0 @@
-dee4417597abc2db70a175d6809870e7
diff --git a/deps/libav/tests/ref/fate/adpcm-creative-8-2bit b/deps/libav/tests/ref/fate/adpcm-creative-8-2bit
deleted file mode 100644
index 4166846..0000000
--- a/deps/libav/tests/ref/fate/adpcm-creative-8-2bit
+++ /dev/null
@@ -1 +0,0 @@
-832846066fbce28821b7f0717c4d3a90
diff --git a/deps/libav/tests/ref/fate/adpcm-creative-8-4bit b/deps/libav/tests/ref/fate/adpcm-creative-8-4bit
deleted file mode 100644
index 2d579aa..0000000
--- a/deps/libav/tests/ref/fate/adpcm-creative-8-4bit
+++ /dev/null
@@ -1 +0,0 @@
-1813d196cef83f7030bb150399b2903e
diff --git a/deps/libav/tests/ref/fate/adpcm-ea-1 b/deps/libav/tests/ref/fate/adpcm-ea-1
deleted file mode 100644
index f5a33df..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ea-1
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,     1484,     5936, 0x00000000
-0,       1484,       1484,     1456,     5824, 0x00000000
-0,       2940,       2940,     1484,     5936, 0x00000000
-0,       4424,       4424,     1456,     5824, 0x00000000
-0,       5880,       5880,     1484,     5936, 0x00000000
-0,       7364,       7364,     1456,     5824, 0x00000000
-0,       8820,       8820,     1484,     5936, 0x00000000
-0,      10304,      10304,     1456,     5824, 0x0f06f5bb
-0,      11760,      11760,     1484,     5936, 0xb0dbfc46
-0,      13244,      13244,     1456,     5824, 0x9daa9f9c
-0,      14700,      14700,     1484,     5936, 0x61400d2f
-0,      16184,      16184,     1456,     5824, 0x34a5b0e3
-0,      17640,      17640,     1484,     5936, 0x6e546f72
-0,      19124,      19124,     1456,     5824, 0x4f093b35
-0,      20580,      20580,     1484,     5936, 0x95b5b599
-0,      22064,      22064,     1456,     5824, 0x75e15e60
-0,      23520,      23520,     1484,     5936, 0xd1077d39
-0,      25004,      25004,     1456,     5824, 0x956e21ca
-0,      26460,      26460,     1484,     5936, 0x33bac234
-0,      27944,      27944,     1456,     5824, 0x5df37824
-0,      29400,      29400,     1484,     5936, 0xc174af24
-0,      30884,      30884,     1456,     5824, 0xe5dc2159
-0,      32340,      32340,     1484,     5936, 0x63ffc8b1
-0,      33824,      33824,     1456,     5824, 0xefe4c365
-0,      35280,      35280,     1484,     5936, 0x2174304d
diff --git a/deps/libav/tests/ref/fate/adpcm-ea-2 b/deps/libav/tests/ref/fate/adpcm-ea-2
deleted file mode 100644
index f58d9a0..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ea-2
+++ /dev/null
@@ -1,134 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,     1484,     5936, 0xea261a29
-0,       1484,       1484,     1456,     5824, 0x253df061
-0,       2940,       2940,     1484,     5936, 0x603a5bd7
-0,       4424,       4424,     1456,     5824, 0x9d283f59
-0,       5880,       5880,     1484,     5936, 0x49323497
-0,       7364,       7364,     1456,     5824, 0x7c299939
-0,       8820,       8820,     1484,     5936, 0x9f918e9a
-0,      10304,      10304,     1456,     5824, 0x1226b534
-0,      11760,      11760,     1484,     5936, 0xdd159326
-0,      13244,      13244,     1456,     5824, 0x361ad10f
-0,      14700,      14700,     1484,     5936, 0x6ccac9e3
-0,      16184,      16184,     1456,     5824, 0x1861efef
-0,      17640,      17640,     1484,     5936, 0x5f718eb9
-0,      19124,      19124,     1456,     5824, 0xd4ca72ba
-0,      20580,      20580,     1484,     5936, 0xbf2b27e6
-0,      22064,      22064,     1456,     5824, 0xcb6f024e
-0,      23520,      23520,     1484,     5936, 0x7dfb7e05
-0,      25004,      25004,     1456,     5824, 0x80e16f13
-0,      26460,      26460,     1484,     5936, 0x0fb59227
-0,      27944,      27944,     1456,     5824, 0x4d6f1fdb
-0,      29400,      29400,     1484,     5936, 0x505a5103
-0,      30884,      30884,     1456,     5824, 0x47ef4c13
-0,      32340,      32340,     1484,     5936, 0xbe4795fb
-0,      33824,      33824,     1456,     5824, 0xb82cc4ff
-0,      35280,      35280,     1484,     5936, 0xf7c6ab8d
-0,      36764,      36764,     1456,     5824, 0x1442f5e0
-0,      38220,      38220,     1484,     5936, 0x64659389
-0,      39704,      39704,     1456,     5824, 0xdd81725c
-0,      41160,      41160,     1484,     5936, 0x7f7c604f
-0,      42644,      42644,     1456,     5824, 0xafc77beb
-0,      44100,      44100,     1484,     5936, 0x24f88e4d
-0,      45584,      45584,     1456,     5824, 0xa31956ca
-0,      47040,      47040,     1484,     5936, 0x958e02b9
-0,      48524,      48524,     1456,     5824, 0xcfc79890
-0,      49980,      49980,     1484,     5936, 0xc7e788ae
-0,      51464,      51464,     1456,     5824, 0x4b6b1acc
-0,      52920,      52920,     1484,     5936, 0xa74496dc
-0,      54404,      54404,     1456,     5824, 0x719e6171
-0,      55860,      55860,     1484,     5936, 0x9346222d
-0,      57344,      57344,     1456,     5824, 0x9e2a876e
-0,      58800,      58800,     1484,     5936, 0xeca6ea64
-0,      60284,      60284,     1456,     5824, 0x07d8174f
-0,      61740,      61740,     1484,     5936, 0x2df5aa6b
-0,      63224,      63224,     1456,     5824, 0x314e7034
-0,      64680,      64680,     1484,     5936, 0x5a328768
-0,      66164,      66164,     1456,     5824, 0x32b92446
-0,      67620,      67620,     1484,     5936, 0x20ecbc9b
-0,      69104,      69104,     1456,     5824, 0x76019c14
-0,      70560,      70560,     1484,     5936, 0x8c3ef8a6
-0,      72044,      72044,     1456,     5824, 0xcdaab50b
-0,      73500,      73500,     1484,     5936, 0xb2f87f4f
-0,      74984,      74984,     1456,     5824, 0x70c26379
-0,      76440,      76440,     1484,     5936, 0x5691ecfd
-0,      77924,      77924,     1456,     5824, 0x61e208fe
-0,      79380,      79380,     1484,     5936, 0x87d1a5e0
-0,      80864,      80864,     1456,     5824, 0x02054cfd
-0,      82320,      82320,     1484,     5936, 0x22ff1c4b
-0,      83804,      83804,     1456,     5824, 0xc6d87fef
-0,      85260,      85260,     1484,     5936, 0x9028bb3b
-0,      86744,      86744,     1456,     5824, 0xbadde406
-0,      88200,      88200,     1484,     5936, 0x6e88ddf1
-0,      89684,      89684,     1456,     5824, 0x5bb8be6e
-0,      91140,      91140,     1484,     5936, 0xe1f8d7fc
-0,      92624,      92624,     1456,     5824, 0xc824e388
-0,      94080,      94080,     1484,     5936, 0x654371a9
-0,      95564,      95564,     1456,     5824, 0xae6ee9ec
-0,      97020,      97020,     1484,     5936, 0x9aa4550d
-0,      98504,      98504,     1456,     5824, 0xdce210ac
-0,      99960,      99960,     1484,     5936, 0xb12641c8
-0,     101444,     101444,     1456,     5824, 0x277e014b
-0,     102900,     102900,     1484,     5936, 0xb0d262de
-0,     104384,     104384,     1456,     5824, 0xf94d6f49
-0,     105840,     105840,     1484,     5936, 0x3d7848cb
-0,     107324,     107324,     1456,     5824, 0xe67fc08e
-0,     108780,     108780,     1484,     5936, 0x0475e0d6
-0,     110264,     110264,     1456,     5824, 0x8a9a4a2e
-0,     111720,     111720,     1484,     5936, 0x82576204
-0,     113204,     113204,     1456,     5824, 0x3017b648
-0,     114660,     114660,     1484,     5936, 0xca4c3e04
-0,     116144,     116144,     1456,     5824, 0x340077d1
-0,     117600,     117600,     1484,     5936, 0x805bea6e
-0,     119084,     119084,     1456,     5824, 0x2cf6c87b
-0,     120540,     120540,     1484,     5936, 0x3635bc5f
-0,     122024,     122024,     1456,     5824, 0x0d7a81c7
-0,     123480,     123480,     1484,     5936, 0x26179764
-0,     124964,     124964,     1456,     5824, 0xa0b2454f
-0,     126420,     126420,     1484,     5936, 0x91d24608
-0,     127904,     127904,     1456,     5824, 0x6509b3e1
-0,     129360,     129360,     1484,     5936, 0xa0e3c9fc
-0,     130844,     130844,     1456,     5824, 0x18682a2f
-0,     132300,     132300,     1484,     5936, 0x89cea4ff
-0,     133784,     133784,     1456,     5824, 0x7dd22b85
-0,     135240,     135240,     1484,     5936, 0x8b2eeb8d
-0,     136724,     136724,     1456,     5824, 0x0c21af82
-0,     138180,     138180,     1484,     5936, 0x9c5a748d
-0,     139664,     139664,     1456,     5824, 0x1dc72c5c
-0,     141120,     141120,     1484,     5936, 0xe6129383
-0,     142604,     142604,     1456,     5824, 0x0a44312a
-0,     144060,     144060,     1484,     5936, 0x7ed30640
-0,     145544,     145544,     1456,     5824, 0xede15f25
-0,     147000,     147000,     1484,     5936, 0x0096d0f3
-0,     148484,     148484,     1456,     5824, 0x13764b4b
-0,     149940,     149940,     1484,     5936, 0xd4608756
-0,     151424,     151424,     1456,     5824, 0x254b5f2a
-0,     152880,     152880,     1484,     5936, 0x7705b830
-0,     154364,     154364,     1456,     5824, 0x64a63d78
-0,     155820,     155820,     1484,     5936, 0xc02d81a6
-0,     157304,     157304,     1456,     5824, 0xd239e55e
-0,     158760,     158760,     1484,     5936, 0x8018cd3a
-0,     160244,     160244,     1456,     5824, 0xf86b8a98
-0,     161700,     161700,     1484,     5936, 0x2a0078bc
-0,     163184,     163184,     1456,     5824, 0x058d4e1b
-0,     164640,     164640,     1484,     5936, 0xbc718309
-0,     166124,     166124,     1456,     5824, 0xaf6c29e5
-0,     167580,     167580,     1484,     5936, 0x80df004d
-0,     169064,     169064,     1456,     5824, 0xeca5aa57
-0,     170520,     170520,     1484,     5936, 0xb793a8f8
-0,     172004,     172004,     1456,     5824, 0x70fa6aff
-0,     173460,     173460,     1484,     5936, 0xda8d4cc6
-0,     174944,     174944,     1456,     5824, 0xa70088eb
-0,     176400,     176400,     1484,     5936, 0x1c0b0aab
-0,     177884,     177884,     1456,     5824, 0x234d2436
-0,     179340,     179340,     1484,     5936, 0xf79d731e
-0,     180824,     180824,     1456,     5824, 0x5a4e454a
-0,     182280,     182280,     1484,     5936, 0xccf6d042
-0,     183764,     183764,     1456,     5824, 0x4e524d14
-0,     185220,     185220,     1484,     5936, 0xf8f2fcc3
-0,     186704,     186704,     1456,     5824, 0x08f12491
-0,     188160,     188160,     1484,     5936, 0x506e0a42
-0,     189644,     189644,     1456,     5824, 0x7cf05049
-0,     191100,     191100,     1484,     5936, 0xdeb9d295
-0,     192584,     192584,     1456,     5824, 0x758ef642
-0,     194040,     194040,     1484,     5936, 0x91903980
diff --git a/deps/libav/tests/ref/fate/adpcm-ea-maxis-xa b/deps/libav/tests/ref/fate/adpcm-ea-maxis-xa
deleted file mode 100644
index 5d6b5c0..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ea-maxis-xa
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,       28,      112, 0x291d1be4
-0,         28,         28,       28,      112, 0xf08d33cc
-0,         56,         56,       28,      112, 0x5b1521de
-0,         84,         84,       28,      112, 0x57d209f6
-0,        112,        112,       28,      112, 0x00000000
-0,        140,        140,       28,      112, 0xa15e03fc
-0,        168,        168,       28,      112, 0x73a80bf4
-0,        196,        196,       28,      112, 0x916e03fc
-0,        224,        224,       28,      112, 0xd92603fc
-0,        252,        252,       28,      112, 0x097523dc
-0,        280,        280,       28,      112, 0xf7be45ba
-0,        308,        308,       28,      112, 0x0fed4db2
-0,        336,        336,       28,      112, 0x9fb41be4
-0,        364,        364,       28,      112, 0x819a0ff0
-0,        392,        392,       28,      112, 0xfe7f3fc0
-0,        420,        420,       28,      112, 0x281e1de2
-0,        448,        448,       28,      112, 0xa76605fa
-0,        476,        476,       28,      112, 0x00000000
-0,        504,        504,       28,      112, 0xb84705fa
-0,        532,        532,       28,      112, 0xdb5c0ff0
-0,        560,        560,       28,      112, 0xbc4305fa
-0,        588,        588,       28,      112, 0x7c8305fa
-0,        616,        616,       28,      112, 0x54ff21de
-0,        644,        644,       28,      112, 0xc6c535ca
-0,        672,        672,       28,      112, 0xa4123dc2
-0,        700,        700,       28,      112, 0x196523dc
-0,        728,        728,       28,      112, 0x80ef25da
-0,        756,        756,       28,      112, 0xdf742bd4
-0,        784,        784,       28,      112, 0xd78a21de
-0,        812,        812,       28,      112, 0x191f0df2
diff --git a/deps/libav/tests/ref/fate/adpcm-ea-r1 b/deps/libav/tests/ref/fate/adpcm-ea-r1
deleted file mode 100644
index 74d15c6..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ea-r1
+++ /dev/null
@@ -1,96 +0,0 @@
-#tb 0: 1/48000
-0,          0,          0,     1624,     6496, 0x00000000
-0,       1624,       1624,     1596,     6384, 0x00000000
-0,       3220,       3220,     1596,     6384, 0x00000000
-0,       4816,       4816,     1596,     6384, 0x00000000
-0,       6412,       6412,     1596,     6384, 0x00000000
-0,       8008,       8008,     1624,     6496, 0xe2034d04
-0,       9632,       9632,     1596,     6384, 0x089c9157
-0,      11228,      11228,     1596,     6384, 0xeed5743c
-0,      12824,      12824,     1596,     6384, 0x71de6b34
-0,      14420,      14420,     1596,     6384, 0xc0d67710
-0,      16016,      16016,     1624,     6496, 0x35786490
-0,      17640,      17640,     1596,     6384, 0xdf1c99a2
-0,      19236,      19236,     1596,     6384, 0xca9591ad
-0,      20832,      20832,     1596,     6384, 0x6f0d9c3d
-0,      22428,      22428,     1596,     6384, 0xfacbbaee
-0,      24024,      24024,     1624,     6496, 0x927fb136
-0,      25648,      25648,     1596,     6384, 0x9d4f2572
-0,      27244,      27244,     1596,     6384, 0x2a3c6d08
-0,      28840,      28840,     1596,     6384, 0x4282b1e0
-0,      30436,      30436,     1596,     6384, 0xc4a77b9f
-0,      32032,      32032,     1624,     6496, 0x2af6a14f
-0,      33656,      33656,     1596,     6384, 0x4d734169
-0,      35252,      35252,     1596,     6384, 0xb91b5865
-0,      36848,      36848,     1596,     6384, 0x9dce2417
-0,      38444,      38444,     1596,     6384, 0xb7c4e1ce
-0,      40040,      40040,     1624,     6496, 0xef0dc07a
-0,      41664,      41664,     1596,     6384, 0x4ad21d10
-0,      43260,      43260,     1596,     6384, 0xcfe14682
-0,      44856,      44856,     1596,     6384, 0x07be48eb
-0,      46452,      46452,     1596,     6384, 0x09de3498
-0,      48048,      48048,     1624,     6496, 0xab2e9686
-0,      49672,      49672,     1596,     6384, 0x3aba3ccc
-0,      51268,      51268,     1596,     6384, 0x0a905ec3
-0,      52864,      52864,     1596,     6384, 0x76a93ce4
-0,      54460,      54460,     1596,     6384, 0xa99063a4
-0,      56056,      56056,     1624,     6496, 0xc16bb88d
-0,      57680,      57680,     1596,     6384, 0x650379bf
-0,      59276,      59276,     1596,     6384, 0x4e0749fe
-0,      60872,      60872,     1596,     6384, 0x778e8d12
-0,      62468,      62468,     1596,     6384, 0x9fa8c494
-0,      64064,      64064,     1624,     6496, 0x61d5bead
-0,      65688,      65688,     1596,     6384, 0x4da9bc3c
-0,      67284,      67284,     1596,     6384, 0xa72b6f93
-0,      68880,      68880,     1596,     6384, 0x811f5f77
-0,      70476,      70476,     1596,     6384, 0x83ea5e3d
-0,      72072,      72072,     1624,     6496, 0x78bab460
-0,      73696,      73696,     1596,     6384, 0xc9a07432
-0,      75292,      75292,     1596,     6384, 0x4b4f2a34
-0,      76888,      76888,     1596,     6384, 0x4d707a53
-0,      78484,      78484,     1596,     6384, 0x703efb60
-0,      80080,      80080,     1624,     6496, 0x319a77bb
-0,      81704,      81704,     1596,     6384, 0xbdfd82ec
-0,      83300,      83300,     1596,     6384, 0x413c3503
-0,      84896,      84896,     1596,     6384, 0xe6e666b3
-0,      86492,      86492,     1596,     6384, 0xa09c7342
-0,      88088,      88088,     1624,     6496, 0x60cba846
-0,      89712,      89712,     1596,     6384, 0x0ba34308
-0,      91308,      91308,     1596,     6384, 0xdc3a65f0
-0,      92904,      92904,     1596,     6384, 0x1ebf9dc4
-0,      94500,      94500,     1596,     6384, 0xbbcb1449
-0,      96096,      96096,     1624,     6496, 0x926574eb
-0,      97720,      97720,     1596,     6384, 0xb4da92f1
-0,      99316,      99316,     1596,     6384, 0xdbbd21e0
-0,     100912,     100912,     1596,     6384, 0x08510eff
-0,     102508,     102508,     1596,     6384, 0x9534b7ca
-0,     104104,     104104,     1624,     6496, 0x50a5ed30
-0,     105728,     105728,     1596,     6384, 0xf5ac2f7c
-0,     107324,     107324,     1596,     6384, 0x4fe1fa55
-0,     108920,     108920,     1596,     6384, 0xd61c4c05
-0,     110516,     110516,     1596,     6384, 0x56d11b45
-0,     112112,     112112,     1624,     6496, 0x3906084b
-0,     113736,     113736,     1596,     6384, 0x1ef31fed
-0,     115332,     115332,     1596,     6384, 0x58ed82f5
-0,     116928,     116928,     1596,     6384, 0xb31ccd1f
-0,     118524,     118524,     1596,     6384, 0xfb648285
-0,     120120,     120120,     1624,     6496, 0xfae2950b
-0,     121744,     121744,     1596,     6384, 0xe28c8357
-0,     123340,     123340,     1596,     6384, 0xda718e60
-0,     124936,     124936,     1596,     6384, 0x27516999
-0,     126532,     126532,     1596,     6384, 0x0ba07921
-0,     128128,     128128,     1624,     6496, 0xcfbecfab
-0,     129752,     129752,     1596,     6384, 0xae4cedcd
-0,     131348,     131348,     1596,     6384, 0x917b4707
-0,     132944,     132944,     1596,     6384, 0x8671b28e
-0,     134540,     134540,     1596,     6384, 0x9a1238fa
-0,     136136,     136136,     1624,     6496, 0x23b8f8ca
-0,     137760,     137760,     1596,     6384, 0x3903bcd6
-0,     139356,     139356,     1596,     6384, 0x0532b267
-0,     140952,     140952,     1596,     6384, 0xde931220
-0,     142548,     142548,     1596,     6384, 0x4ed70a80
-0,     144144,     144144,     1624,     6496, 0x4a52d5a1
-0,     145768,     145768,     1596,     6384, 0xc1be5760
-0,     147364,     147364,     1596,     6384, 0x790d69ba
-0,     148960,     148960,     1596,     6384, 0x9d73e6cf
-0,     150556,     150556,     1568,     6272, 0xbc0fc725
diff --git a/deps/libav/tests/ref/fate/adpcm-ea-r2 b/deps/libav/tests/ref/fate/adpcm-ea-r2
deleted file mode 100644
index 4bca11f..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ea-r2
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0xa1158634
diff --git a/deps/libav/tests/ref/fate/adpcm-ea-r3 b/deps/libav/tests/ref/fate/adpcm-ea-r3
deleted file mode 100644
index 920a4d0..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ea-r3
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x9ea2507f
diff --git a/deps/libav/tests/ref/fate/adpcm-ima-amv b/deps/libav/tests/ref/fate/adpcm-ima-amv
deleted file mode 100644
index 6c2fa32..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima-amv
+++ /dev/null
@@ -1,161 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,     1378,     2756, 0x0af35034
-0,       1378,       1378,     1378,     2756, 0x8462443f
-0,       2756,       2756,     1378,     2756, 0x9f493ba6
-0,       4134,       4134,     1378,     2756, 0x634e5f06
-0,       5513,       5513,     1380,     2760, 0x51f35cd4
-0,       6891,       6891,     1378,     2756, 0x011c51e5
-0,       8269,       8269,     1378,     2756, 0x8c2c198c
-0,       9647,       9647,     1378,     2756, 0x2b4a3397
-0,      11025,      11025,     1378,     2756, 0x63794f22
-0,      12403,      12403,     1378,     2756, 0xfc363898
-0,      13781,      13781,     1378,     2756, 0x0da5486e
-0,      15159,      15159,     1378,     2756, 0xbae17a5f
-0,      16538,      16538,     1380,     2760, 0xba266e1b
-0,      17916,      17916,     1378,     2756, 0xdfb61002
-0,      19294,      19294,     1378,     2756, 0x15d029da
-0,      20672,      20672,     1378,     2756, 0x7bc82012
-0,      22050,      22050,     1378,     2756, 0x002e6999
-0,      23428,      23428,     1378,     2756, 0x96346ba6
-0,      24806,      24806,     1378,     2756, 0x3d54543b
-0,      26184,      26184,     1380,     2760, 0x601786e1
-0,      27563,      27563,     1378,     2756, 0xf22a5793
-0,      28941,      28941,     1378,     2756, 0x21f54d49
-0,      30319,      30319,     1378,     2756, 0x0c6d4399
-0,      31697,      31697,     1378,     2756, 0x17282f8e
-0,      33075,      33075,     1378,     2756, 0xeb698f75
-0,      34453,      34453,     1378,     2756, 0x935e1de2
-0,      35831,      35831,     1380,     2760, 0xb6fb4293
-0,      37209,      37209,     1378,     2756, 0x485053dc
-0,      38588,      38588,     1378,     2756, 0x24c35027
-0,      39966,      39966,     1378,     2756, 0x09f323ee
-0,      41344,      41344,     1378,     2756, 0xbc7d58d5
-0,      42722,      42722,     1378,     2756, 0xaefd487c
-0,      44100,      44100,     1378,     2756, 0xaca16cc0
-0,      45478,      45478,     1380,     2760, 0x98a76091
-0,      46856,      46856,     1378,     2756, 0x5d357141
-0,      48234,      48234,     1378,     2756, 0x65ea2657
-0,      49613,      49613,     1378,     2756, 0xb5e1334a
-0,      50991,      50991,     1378,     2756, 0x32cd5d91
-0,      52369,      52369,     1378,     2756, 0xdc23722b
-0,      53747,      53747,     1378,     2756, 0x2ba34684
-0,      55125,      55125,     1378,     2756, 0xf9755ba8
-0,      56503,      56503,     1380,     2760, 0x24221ddb
-0,      57881,      57881,     1378,     2756, 0xef843aa4
-0,      59259,      59259,     1378,     2756, 0x420442fe
-0,      60638,      60638,     1378,     2756, 0x5a0933cb
-0,      62016,      62016,     1378,     2756, 0xef5f6d61
-0,      63394,      63394,     1378,     2756, 0xe57e6dc0
-0,      64772,      64772,     1378,     2756, 0xc0f0495a
-0,      66150,      66150,     1380,     2760, 0x2c3b55df
-0,      67528,      67528,     1378,     2756, 0x39c2586c
-0,      68906,      68906,     1378,     2756, 0x7ffc46e5
-0,      70284,      70284,     1378,     2756, 0xa2766664
-0,      71663,      71663,     1378,     2756, 0xacb50c6c
-0,      73041,      73041,     1378,     2756, 0x7f659084
-0,      74419,      74419,     1378,     2756, 0xc72e6a12
-0,      75797,      75797,     1380,     2760, 0xdb6944df
-0,      77175,      77175,     1378,     2756, 0x954f45c1
-0,      78553,      78553,     1378,     2756, 0xa9484240
-0,      79931,      79931,     1378,     2756, 0x1d595349
-0,      81309,      81309,     1378,     2756, 0xcf2a565e
-0,      82688,      82688,     1378,     2756, 0x391028d5
-0,      84066,      84066,     1378,     2756, 0x348db7ad
-0,      85444,      85444,     1380,     2760, 0xb69b5e3a
-0,      86822,      86822,     1378,     2756, 0xe3635fbe
-0,      88200,      88200,     1378,     2756, 0xdcad3654
-0,      89578,      89578,     1378,     2756, 0x5c17abef
-0,      90956,      90956,     1378,     2756, 0xb3235184
-0,      92334,      92334,     1378,     2756, 0xdabb64a6
-0,      93713,      93713,     1378,     2756, 0xa95dc58d
-0,      95091,      95091,     1380,     2760, 0x8e7ac9eb
-0,      96469,      96469,     1378,     2756, 0x492b658e
-0,      97847,      97847,     1378,     2756, 0x377483ab
-0,      99225,      99225,     1378,     2756, 0x2c250279
-0,     100603,     100603,     1378,     2756, 0x704dbdb3
-0,     101981,     101981,     1378,     2756, 0x800d7da2
-0,     103359,     103359,     1378,     2756, 0x872aa32e
-0,     104738,     104738,     1378,     2756, 0x2d4837fe
-0,     106116,     106116,     1380,     2760, 0xc89ea57e
-0,     107494,     107494,     1378,     2756, 0x6447d7ef
-0,     108872,     108872,     1378,     2756, 0x144f59cc
-0,     110250,     110250,     1378,     2756, 0xc667154e
-0,     111628,     111628,     1378,     2756, 0xf0de66ae
-0,     113006,     113006,     1378,     2756, 0xeabf3c32
-0,     114384,     114384,     1378,     2756, 0xe98e81d1
-0,     115763,     115763,     1380,     2760, 0x56aa5889
-0,     117141,     117141,     1378,     2756, 0x4fd34c0e
-0,     118519,     118519,     1378,     2756, 0x67cf6912
-0,     119897,     119897,     1378,     2756, 0xfa944def
-0,     121275,     121275,     1378,     2756, 0xc12f23b2
-0,     122653,     122653,     1378,     2756, 0x5ea325a2
-0,     124031,     124031,     1378,     2756, 0x2b245824
-0,     125409,     125409,     1380,     2760, 0x90ac533e
-0,     126788,     126788,     1378,     2756, 0xcca34d26
-0,     128166,     128166,     1378,     2756, 0xb5f820d0
-0,     129544,     129544,     1378,     2756, 0x27f24335
-0,     130922,     130922,     1378,     2756, 0x4a9e87b7
-0,     132300,     132300,     1378,     2756, 0xbd076129
-0,     133678,     133678,     1378,     2756, 0x2e0e3f2e
-0,     135056,     135056,     1380,     2760, 0xdf534478
-0,     136434,     136434,     1378,     2756, 0xca000a2e
-0,     137813,     137813,     1378,     2756, 0x87472df3
-0,     139191,     139191,     1378,     2756, 0x16733810
-0,     140569,     140569,     1378,     2756, 0xfa0734b4
-0,     141947,     141947,     1378,     2756, 0x5eff3fc4
-0,     143325,     143325,     1378,     2756, 0xf35346bd
-0,     144703,     144703,     1378,     2756, 0xac6411c5
-0,     146081,     146081,     1380,     2760, 0x478c3c56
-0,     147459,     147459,     1378,     2756, 0xebd30bdd
-0,     148838,     148838,     1378,     2756, 0xaef95a31
-0,     150216,     150216,     1378,     2756, 0x8aad29d1
-0,     151594,     151594,     1378,     2756, 0x626863f0
-0,     152972,     152972,     1378,     2756, 0x68c05707
-0,     154350,     154350,     1378,     2756, 0x437c5e8d
-0,     155728,     155728,     1380,     2760, 0x8eca4bdb
-0,     157106,     157106,     1378,     2756, 0x62bd4162
-0,     158484,     158484,     1378,     2756, 0x9f744aa4
-0,     159863,     159863,     1378,     2756, 0x0f3f6409
-0,     161241,     161241,     1378,     2756, 0x3fee827a
-0,     162619,     162619,     1378,     2756, 0x48a0ac19
-0,     163997,     163997,     1378,     2756, 0x8e4ce0d0
-0,     165375,     165375,     1380,     2760, 0xcda82236
-0,     166753,     166753,     1378,     2756, 0x0e523255
-0,     168131,     168131,     1378,     2756, 0x84103d30
-0,     169509,     169509,     1378,     2756, 0x13941cde
-0,     170888,     170888,     1378,     2756, 0x9fc834c5
-0,     172266,     172266,     1378,     2756, 0xc0217a77
-0,     173644,     173644,     1378,     2756, 0x3f643659
-0,     175022,     175022,     1380,     2760, 0x9dbd6002
-0,     176400,     176400,     1378,     2756, 0x94f046fb
-0,     177778,     177778,     1378,     2756, 0xab01fb12
-0,     179156,     179156,     1378,     2756, 0x04cffe5c
-0,     180534,     180534,     1378,     2756, 0xef661c5e
-0,     181913,     181913,     1378,     2756, 0x094c5fc5
-0,     183291,     183291,     1378,     2756, 0xe0c1486a
-0,     184669,     184669,     1380,     2760, 0x8c3535b7
-0,     186047,     186047,     1378,     2756, 0x594934aa
-0,     187425,     187425,     1378,     2756, 0x74007238
-0,     188803,     188803,     1378,     2756, 0x61f1394d
-0,     190181,     190181,     1378,     2756, 0x72584f07
-0,     191559,     191559,     1378,     2756, 0xced9acf9
-0,     192938,     192938,     1378,     2756, 0x7d2e3ea1
-0,     194316,     194316,     1378,     2756, 0x56c06897
-0,     195694,     195694,     1380,     2760, 0x19983bbf
-0,     197072,     197072,     1378,     2756, 0x4f884f27
-0,     198450,     198450,     1378,     2756, 0x81ab2f63
-0,     199828,     199828,     1378,     2756, 0x448e681d
-0,     201206,     201206,     1378,     2756, 0x0ba9826e
-0,     202584,     202584,     1378,     2756, 0x049f36fa
-0,     203963,     203963,     1378,     2756, 0x096a2b62
-0,     205341,     205341,     1380,     2760, 0x579e2035
-0,     206719,     206719,     1378,     2756, 0xd13e30e1
-0,     208097,     208097,     1378,     2756, 0x30b6412b
-0,     209475,     209475,     1378,     2756, 0xbb1c3268
-0,     210853,     210853,     1378,     2756, 0xbc175b6a
-0,     212231,     212231,     1378,     2756, 0xf8d160e2
-0,     213609,     213609,     1378,     2756, 0xc1048154
-0,     214988,     214988,     1380,     2760, 0xb83548f4
-0,     216366,     216366,     1378,     2756, 0x22647962
-0,     217744,     217744,     1378,     2756, 0x14ca54d3
-0,     219122,     219122,     1378,     2756, 0x58754b3a
diff --git a/deps/libav/tests/ref/fate/adpcm-ima-apc b/deps/libav/tests/ref/fate/adpcm-ima-apc
deleted file mode 100644
index 16e1dd6..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima-apc
+++ /dev/null
@@ -1 +0,0 @@
-6dcee91d3364f389f804da7a25934b36
diff --git a/deps/libav/tests/ref/fate/adpcm-ima-dk3 b/deps/libav/tests/ref/fate/adpcm-ima-dk3
deleted file mode 100644
index 08c0fd1..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima-dk3
+++ /dev/null
@@ -1 +0,0 @@
-62fbe4db4a49cb044f57f92cce9993c5
diff --git a/deps/libav/tests/ref/fate/adpcm-ima-dk4 b/deps/libav/tests/ref/fate/adpcm-ima-dk4
deleted file mode 100644
index d47ef20..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima-dk4
+++ /dev/null
@@ -1 +0,0 @@
-5234b53dde4961dd715a2524d6a8eb75
diff --git a/deps/libav/tests/ref/fate/adpcm-ima-ea-eacs b/deps/libav/tests/ref/fate/adpcm-ima-ea-eacs
deleted file mode 100644
index 9887296..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima-ea-eacs
+++ /dev/null
@@ -1,48 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,     1468,     5872, 0x00000000
-0,       1468,       1468,     1468,     5872, 0x00000000
-0,       2936,       2936,     1468,     5872, 0x00000000
-0,       4404,       4404,     1468,     5872, 0x00000000
-0,       5872,       5872,     1468,     5872, 0x00000000
-0,       7340,       7340,     1468,     5872, 0x00000000
-0,       8808,       8808,     1468,     5872, 0x00000000
-0,      10276,      10276,     1468,     5872, 0x00000000
-0,      11744,      11744,     1468,     5872, 0x00000000
-0,      13212,      13212,     1468,     5872, 0x00000000
-0,      14680,      14680,     1468,     5872, 0x00000000
-0,      16148,      16148,     1468,     5872, 0x00000000
-0,      17616,      17616,     1468,     5872, 0x00000000
-0,      19084,      19084,     1468,     5872, 0x00000000
-0,      20552,      20552,     1468,     5872, 0x00000000
-0,      22020,      22020,     1468,     5872, 0xc6f64777
-0,      23488,      23488,     1468,     5872, 0x7c9e60e8
-0,      24956,      24956,     1468,     5872, 0x46525c54
-0,      26424,      26424,     1468,     5872, 0x842796bb
-0,      27892,      27892,     1468,     5872, 0xb1f6cbd5
-0,      29360,      29360,     1468,     5872, 0x0261a74b
-0,      30828,      30828,     1468,     5872, 0x8218b1f9
-0,      32296,      32296,     1468,     5872, 0xd7a2cae6
-0,      33764,      33764,     1468,     5872, 0x69d34562
-0,      35232,      35232,     1468,     5872, 0x9303ec65
-0,      36700,      36700,     1468,     5872, 0xd5d963a1
-0,      38168,      38168,     1468,     5872, 0x0557e06f
-0,      39636,      39636,     1468,     5872, 0x1eb48b41
-0,      41104,      41104,     1468,     5872, 0x70f5ca3f
-0,      42572,      42572,     1468,     5872, 0xd39e5c5e
-0,      44040,      44040,     1468,     5872, 0x29c59140
-0,      45508,      45508,     1468,     5872, 0x7d95e643
-0,      46976,      46976,     1468,     5872, 0x45353fd8
-0,      48444,      48444,     1468,     5872, 0xad7b1b27
-0,      49912,      49912,     1468,     5872, 0x1f0377b3
-0,      51380,      51380,     1468,     5872, 0x6074541e
-0,      52848,      52848,     1468,     5872, 0xa4f5e892
-0,      54316,      54316,     1468,     5872, 0x084bc696
-0,      55784,      55784,     1468,     5872, 0x67fdafce
-0,      57252,      57252,     1468,     5872, 0x8dfd249d
-0,      58720,      58720,     1468,     5872, 0x514184ee
-0,      60188,      60188,     1468,     5872, 0xc0090b0d
-0,      61656,      61656,     1468,     5872, 0xc1171cc8
-0,      63124,      63124,     1468,     5872, 0x7d7dd07e
-0,      64592,      64592,     1468,     5872, 0xe6aa619c
-0,      66060,      66060,     1468,     5872, 0xd5aac0df
-0,      67528,      67528,     1468,     5872, 0x3b68b390
diff --git a/deps/libav/tests/ref/fate/adpcm-ima-ea-sead b/deps/libav/tests/ref/fate/adpcm-ima-ea-sead
deleted file mode 100644
index 17c1087..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima-ea-sead
+++ /dev/null
@@ -1,50 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,      736,     2944, 0x00000000
-0,        736,        736,     1472,     5888, 0x5ae3c2a4
-0,       2208,       2208,     1472,     5888, 0x158fbcb4
-0,       3680,       3680,     1472,     5888, 0x3fc85d35
-0,       5152,       5152,     1472,     5888, 0x4667ec2b
-0,       6624,       6624,     1472,     5888, 0x82744494
-0,       8096,       8096,     1472,     5888, 0x3b0cb86f
-0,       9568,       9568,     1472,     5888, 0x29493fbb
-0,      11040,      11040,     1472,     5888, 0xaa2d8595
-0,      12512,      12512,     1472,     5888, 0x2e563de6
-0,      13984,      13984,     1472,     5888, 0x225cca99
-0,      15456,      15456,     1472,     5888, 0x2b577599
-0,      16928,      16928,     1472,     5888, 0x3d967f32
-0,      18400,      18400,     1472,     5888, 0x16639a84
-0,      19872,      19872,     1472,     5888, 0x90549ba0
-0,      21344,      21344,     1472,     5888, 0xf46e6644
-0,      22816,      22816,     1472,     5888, 0x39a073ec
-0,      24288,      24288,     1472,     5888, 0xb1d7a93a
-0,      25760,      25760,     1472,     5888, 0x25e9795b
-0,      27232,      27232,     1472,     5888, 0xbbc07644
-0,      28704,      28704,     1472,     5888, 0x323f6a1b
-0,      30176,      30176,     1472,     5888, 0x7cae130b
-0,      31648,      31648,     1472,     5888, 0xd23bf9c6
-0,      33120,      33120,     1472,     5888, 0x5f73ef35
-0,      34592,      34592,     1472,     5888, 0xc66026be
-0,      36064,      36064,     1472,     5888, 0xc8fdb539
-0,      37536,      37536,     1472,     5888, 0x94c6bfbd
-0,      39008,      39008,     1472,     5888, 0xb77e1b83
-0,      40480,      40480,     1472,     5888, 0x6c6d6693
-0,      41952,      41952,     1472,     5888, 0xd9f064d4
-0,      43424,      43424,     1472,     5888, 0x85dd990d
-0,      44896,      44896,     1472,     5888, 0x385e021b
-0,      46368,      46368,     1472,     5888, 0xac09fd02
-0,      47840,      47840,     1472,     5888, 0xc6dcdff2
-0,      49312,      49312,     1472,     5888, 0x86a6944d
-0,      50784,      50784,     1472,     5888, 0x8587b964
-0,      52256,      52256,     1472,     5888, 0x2b0355ff
-0,      53728,      53728,     1472,     5888, 0xe4148a85
-0,      55200,      55200,     1472,     5888, 0xdf02ed4f
-0,      56672,      56672,     1472,     5888, 0x87a54b15
-0,      58144,      58144,     1472,     5888, 0x3ad2be45
-0,      59616,      59616,     1472,     5888, 0x3a49c2c3
-0,      61088,      61088,     1472,     5888, 0xc2b66404
-0,      62560,      62560,     1472,     5888, 0xac3e234a
-0,      64032,      64032,     1472,     5888, 0x5dcf523b
-0,      65504,      65504,     1472,     5888, 0x2034b5d6
-0,      66976,      66976,     1472,     5888, 0x96882832
-0,      68448,      68448,     1472,     5888, 0x2be3d534
-0,      69920,      69920,     1472,     5888, 0xa841a49d
diff --git a/deps/libav/tests/ref/fate/adpcm-ima-iss b/deps/libav/tests/ref/fate/adpcm-ima-iss
deleted file mode 100644
index 341ef24..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima-iss
+++ /dev/null
@@ -1 +0,0 @@
-816ca37c22e42f488fd787e3155e59ff
diff --git a/deps/libav/tests/ref/fate/adpcm-ima-smjpeg b/deps/libav/tests/ref/fate/adpcm-ima-smjpeg
deleted file mode 100644
index 45cb97b..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima-smjpeg
+++ /dev/null
@@ -1,351 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,      512,     1024, 0x00000000
-0,        507,        507,      512,     1024, 0x00000000
-0,       1014,       1014,      512,     1024, 0xd89a448e
-0,       1521,       1521,      512,     1024, 0x695b369c
-0,       2029,       2029,      512,     1024, 0xc8ba5707
-0,       2558,       2558,      512,     1024, 0xdf241fc6
-0,       3065,       3065,      512,     1024, 0x61cf4166
-0,       3572,       3572,      512,     1024, 0x97cbc386
-0,       4079,       4079,      512,     1024, 0x44899d04
-0,       4586,       4586,      512,     1024, 0xa7cbaa62
-0,       5116,       5116,      512,     1024, 0xa7aea60c
-0,       5623,       5623,      512,     1024, 0xd7b18a89
-0,       6130,       6130,      512,     1024, 0x268e81f6
-0,       6637,       6637,      512,     1024, 0x9cf83a2f
-0,       7166,       7166,      512,     1024, 0x5559b508
-0,       7673,       7673,      512,     1024, 0xe1b9e71c
-0,       8181,       8181,      512,     1024, 0xdcee733e
-0,       8688,       8688,      512,     1024, 0xe5918f60
-0,       9195,       9195,      512,     1024, 0x29dbd209
-0,       9724,       9724,      512,     1024, 0x9bcbcf16
-0,      10231,      10231,      512,     1024, 0x86f5f458
-0,      10738,      10738,      512,     1024, 0xabcbda86
-0,      11246,      11246,      512,     1024, 0xc51f77b9
-0,      11775,      11775,      512,     1024, 0xf6b3a504
-0,      12282,      12282,      512,     1024, 0x1af3e40e
-0,      12789,      12789,      512,     1024, 0x3866b03b
-0,      13296,      13296,      512,     1024, 0xbc005403
-0,      13803,      13803,      512,     1024, 0xe9dfcc51
-0,      14333,      14333,      512,     1024, 0x83c837cb
-0,      14840,      14840,      512,     1024, 0xfa649580
-0,      15347,      15347,      512,     1024, 0x519452ea
-0,      15854,      15854,      512,     1024, 0xd4978774
-0,      16383,      16383,      512,     1024, 0xe2a3b1cd
-0,      16890,      16890,      512,     1024, 0x9a9472ad
-0,      17397,      17397,      512,     1024, 0xa12d4060
-0,      17905,      17905,      512,     1024, 0x31fb0646
-0,      18412,      18412,      512,     1024, 0xfc44343f
-0,      18941,      18941,      512,     1024, 0x0847751a
-0,      19448,      19448,      512,     1024, 0x227968a2
-0,      19955,      19955,      512,     1024, 0x7cce9f1c
-0,      20462,      20462,      512,     1024, 0xb8356713
-0,      20992,      20992,      512,     1024, 0xb29f6e6f
-0,      21499,      21499,      512,     1024, 0x9e1430ab
-0,      22006,      22006,      512,     1024, 0x26d85423
-0,      22513,      22513,      512,     1024, 0x6496547d
-0,      23020,      23020,      512,     1024, 0x316b1a86
-0,      23549,      23549,      512,     1024, 0x3cd83afc
-0,      24057,      24057,      512,     1024, 0x993ff633
-0,      24564,      24564,      512,     1024, 0x0708d1a2
-0,      25071,      25071,      512,     1024, 0xd7230db9
-0,      25578,      25578,      512,     1024, 0xbb0779ca
-0,      26107,      26107,      512,     1024, 0xc6094e1b
-0,      26614,      26614,      512,     1024, 0x15a8b039
-0,      27122,      27122,      512,     1024, 0xd6dbe88c
-0,      27629,      27629,      512,     1024, 0x7e8d1140
-0,      28158,      28158,      512,     1024, 0xef88e525
-0,      28665,      28665,      512,     1024, 0x44e21149
-0,      29172,      29172,      512,     1024, 0x65b0f5f4
-0,      29679,      29679,      512,     1024, 0xb955f687
-0,      30186,      30186,      512,     1024, 0xc85fba9c
-0,      30716,      30716,      512,     1024, 0xf59655ad
-0,      31223,      31223,      512,     1024, 0x6de80bf1
-0,      31730,      31730,      512,     1024, 0x2dcf6e41
-0,      32237,      32237,      512,     1024, 0xd0ddcf8a
-0,      32766,      32766,      512,     1024, 0x00135c2d
-0,      33273,      33273,      512,     1024, 0x697f8efd
-0,      33781,      33781,      512,     1024, 0x7a9bada5
-0,      34288,      34288,      512,     1024, 0x0d22783c
-0,      34795,      34795,      512,     1024, 0x7726d07d
-0,      35324,      35324,      512,     1024, 0xa2f14f67
-0,      35831,      35831,      512,     1024, 0x7f51060d
-0,      36338,      36338,      512,     1024, 0xc4ec6aea
-0,      36846,      36846,      512,     1024, 0x9bb37ca4
-0,      37375,      37375,      512,     1024, 0x9b085577
-0,      37882,      37882,      512,     1024, 0x8812f8af
-0,      38389,      38389,      512,     1024, 0x788f5221
-0,      38896,      38896,      512,     1024, 0x3a2ce642
-0,      39403,      39403,      512,     1024, 0x72415692
-0,      39933,      39933,      512,     1024, 0xe3dcc105
-0,      40440,      40440,      512,     1024, 0xb26c0599
-0,      40947,      40947,      512,     1024, 0x5c9e55eb
-0,      41454,      41454,      512,     1024, 0x8fe88707
-0,      41983,      41983,      512,     1024, 0xc5d7beb6
-0,      42490,      42490,      512,     1024, 0xe1d3a3b4
-0,      42998,      42998,      512,     1024, 0x012da0c6
-0,      43505,      43505,      512,     1024, 0x8d010922
-0,      44012,      44012,      512,     1024, 0x3366eb0d
-0,      44541,      44541,      512,     1024, 0xc9381a27
-0,      45048,      45048,      512,     1024, 0x0774f685
-0,      45555,      45555,      512,     1024, 0xc5cae0a5
-0,      46062,      46062,      512,     1024, 0xa6f4737c
-0,      46592,      46592,      512,     1024, 0x8fb6d0d1
-0,      47099,      47099,      512,     1024, 0x05f579c2
-0,      47606,      47606,      512,     1024, 0x56905d99
-0,      48113,      48113,      512,     1024, 0x002ee18d
-0,      48620,      48620,      512,     1024, 0xeb37ef51
-0,      49149,      49149,      512,     1024, 0x38025635
-0,      49657,      49657,      512,     1024, 0x4fe643c8
-0,      50164,      50164,      512,     1024, 0x11d66ab1
-0,      50671,      50671,      512,     1024, 0xcc3051e9
-0,      51178,      51178,      512,     1024, 0xcd93e854
-0,      51707,      51707,      512,     1024, 0x38f1196d
-0,      52214,      52214,      512,     1024, 0x657a15fc
-0,      52722,      52722,      512,     1024, 0x669ce2a9
-0,      53229,      53229,      512,     1024, 0x95862dda
-0,      53758,      53758,      512,     1024, 0x1726a7b2
-0,      54265,      54265,      512,     1024, 0xd6ece2a1
-0,      54772,      54772,      512,     1024, 0x33ab9553
-0,      55279,      55279,      512,     1024, 0xd50c73a6
-0,      55787,      55787,      512,     1024, 0xfe25b63a
-0,      56316,      56316,      512,     1024, 0x7e2959e3
-0,      56823,      56823,      512,     1024, 0xa4c07b34
-0,      57330,      57330,      512,     1024, 0xd6d8f15c
-0,      57837,      57837,      512,     1024, 0x1eccddd7
-0,      58366,      58366,      512,     1024, 0x2b69f9cb
-0,      58874,      58874,      512,     1024, 0x667b775f
-0,      59381,      59381,      512,     1024, 0xad3b84e9
-0,      59888,      59888,      512,     1024, 0x4f29fc67
-0,      60395,      60395,      512,     1024, 0x8d611ab7
-0,      60924,      60924,      512,     1024, 0x278966ea
-0,      61431,      61431,      512,     1024, 0xaf33812b
-0,      61938,      61938,      512,     1024, 0xa55f4265
-0,      62446,      62446,      512,     1024, 0x023cb51c
-0,      62975,      62975,      512,     1024, 0x1d1f1005
-0,      63482,      63482,      512,     1024, 0x874cccf7
-0,      63989,      63989,      512,     1024, 0xda705428
-0,      64496,      64496,      512,     1024, 0x48d9b440
-0,      65003,      65003,      512,     1024, 0xa14e0712
-0,      65533,      65533,      512,     1024, 0x7efbad1f
-0,      66040,      66040,      512,     1024, 0xdb82c17f
-0,      66547,      66547,      512,     1024, 0xcbe87613
-0,      67054,      67054,      512,     1024, 0x3a63df1d
-0,      67583,      67583,      512,     1024, 0xd5636bba
-0,      68090,      68090,      512,     1024, 0x9397af23
-0,      68598,      68598,      512,     1024, 0x32a07c98
-0,      69105,      69105,      512,     1024, 0x202ca667
-0,      69612,      69612,      512,     1024, 0xdf969011
-0,      70141,      70141,      512,     1024, 0xc434d238
-0,      70648,      70648,      512,     1024, 0xe9ad7562
-0,      71155,      71155,      512,     1024, 0xb51b6b50
-0,      71663,      71663,      512,     1024, 0xe70aecd3
-0,      72192,      72192,      512,     1024, 0x03c816b2
-0,      72699,      72699,      512,     1024, 0x869fdf25
-0,      73206,      73206,      512,     1024, 0xd40a0a62
-0,      73713,      73713,      512,     1024, 0x5af7dd35
-0,      74220,      74220,      512,     1024, 0x891ffc72
-0,      74750,      74750,      512,     1024, 0x1ff68a08
-0,      75257,      75257,      512,     1024, 0x5a7517a9
-0,      75764,      75764,      512,     1024, 0x0f959f74
-0,      76271,      76271,      512,     1024, 0xe92a12a2
-0,      76778,      76778,      512,     1024, 0x38000e55
-0,      77307,      77307,      512,     1024, 0x39fbdd70
-0,      77814,      77814,      512,     1024, 0xca3d9184
-0,      78322,      78322,      512,     1024, 0x66c8995b
-0,      78829,      78829,      512,     1024, 0xac25acea
-0,      79358,      79358,      512,     1024, 0x3cd1046c
-0,      79865,      79865,      512,     1024, 0x6a1df31c
-0,      80372,      80372,      512,     1024, 0x21ca10a1
-0,      80879,      80879,      512,     1024, 0x1aeccedc
-0,      81387,      81387,      512,     1024, 0xddea1335
-0,      81916,      81916,      512,     1024, 0x19f5ca9f
-0,      82423,      82423,      512,     1024, 0x88e95e43
-0,      82930,      82930,      512,     1024, 0x726284fe
-0,      83437,      83437,      512,     1024, 0x6b85b40e
-0,      83966,      83966,      512,     1024, 0x111fee2a
-0,      84474,      84474,      512,     1024, 0x3656b588
-0,      84981,      84981,      512,     1024, 0xa5a2b552
-0,      85488,      85488,      512,     1024, 0x38fb2467
-0,      85995,      85995,      512,     1024, 0xaa919ccc
-0,      86524,      86524,      512,     1024, 0x15993dbc
-0,      87031,      87031,      512,     1024, 0xbe01a7b9
-0,      87539,      87539,      512,     1024, 0xefe93c09
-0,      88046,      88046,      512,     1024, 0x1bb566e5
-0,      88575,      88575,      512,     1024, 0x15ce6237
-0,      89082,      89082,      512,     1024, 0xa8552e66
-0,      89589,      89589,      512,     1024, 0x9d80187e
-0,      90096,      90096,      512,     1024, 0x5df3fc30
-0,      90603,      90603,      512,     1024, 0x1a312aa5
-0,      91133,      91133,      512,     1024, 0x6bb8e302
-0,      91640,      91640,      512,     1024, 0xbd9684bb
-0,      92147,      92147,      512,     1024, 0x78b0b166
-0,      92654,      92654,      512,     1024, 0xd9af5eae
-0,      93183,      93183,      512,     1024, 0xdb90fe82
-0,      93690,      93690,      512,     1024, 0x327614e9
-0,      94198,      94198,      512,     1024, 0x1f19b7fe
-0,      94705,      94705,      512,     1024, 0x46c53f96
-0,      95212,      95212,      512,     1024, 0x921b2189
-0,      95741,      95741,      512,     1024, 0xa8fbc85a
-0,      96248,      96248,      512,     1024, 0xabfdaaae
-0,      96755,      96755,      512,     1024, 0x6acc7387
-0,      97263,      97263,      512,     1024, 0x0d9c27b5
-0,      97792,      97792,      512,     1024, 0xba4dd809
-0,      98299,      98299,      512,     1024, 0x2a2ad521
-0,      98806,      98806,      512,     1024, 0x892de38a
-0,      99313,      99313,      512,     1024, 0xdc97a2eb
-0,      99820,      99820,      512,     1024, 0x4f614ca4
-0,     100350,     100350,      512,     1024, 0x9c8a77ea
-0,     100857,     100857,      512,     1024, 0x2d30e646
-0,     101364,     101364,      512,     1024, 0x74e800a7
-0,     101871,     101871,      512,     1024, 0x1e01fb02
-0,     102378,     102378,      512,     1024, 0x4ed2c1d8
-0,     102907,     102907,      512,     1024, 0xf2fdbe63
-0,     103415,     103415,      512,     1024, 0x8d6f63a1
-0,     103922,     103922,      512,     1024, 0xded468d9
-0,     104429,     104429,      512,     1024, 0xccad839e
-0,     104958,     104958,      512,     1024, 0xdde7c082
-0,     105465,     105465,      512,     1024, 0x548613c5
-0,     105972,     105972,      512,     1024, 0x383909bd
-0,     106479,     106479,      512,     1024, 0xfd37627b
-0,     106987,     106987,      512,     1024, 0x6d95a481
-0,     107516,     107516,      512,     1024, 0x56aa87fa
-0,     108023,     108023,      512,     1024, 0x7b67258c
-0,     108530,     108530,      512,     1024, 0x7dd99a92
-0,     109037,     109037,      512,     1024, 0x4a66d102
-0,     109566,     109566,      512,     1024, 0x7b3fce51
-0,     110074,     110074,      512,     1024, 0xbbd968aa
-0,     110581,     110581,      512,     1024, 0x8283ec36
-0,     111088,     111088,      512,     1024, 0x3c96493d
-0,     111595,     111595,      512,     1024, 0xfa4f8cf8
-0,     112124,     112124,      512,     1024, 0xe2cf872d
-0,     112631,     112631,      512,     1024, 0x0a9e7aa6
-0,     113139,     113139,      512,     1024, 0x6e7a0550
-0,     113646,     113646,      512,     1024, 0x3acfea2f
-0,     114175,     114175,      512,     1024, 0x7111d0fa
-0,     114682,     114682,      512,     1024, 0xe9a1eca9
-0,     115189,     115189,      512,     1024, 0x24da6c46
-0,     115696,     115696,      512,     1024, 0x117cff37
-0,     116204,     116204,      512,     1024, 0x0f27cab6
-0,     116733,     116733,      512,     1024, 0x69b6b4e6
-0,     117240,     117240,      512,     1024, 0x1e6cc841
-0,     117747,     117747,      512,     1024, 0xb01e2365
-0,     118254,     118254,      512,     1024, 0x14e200d3
-0,     118783,     118783,      512,     1024, 0xd1184c98
-0,     119291,     119291,      512,     1024, 0xef9140e9
-0,     119798,     119798,      512,     1024, 0x4cbb645e
-0,     120305,     120305,      512,     1024, 0xe7fe2f06
-0,     120812,     120812,      512,     1024, 0xf8c45028
-0,     121341,     121341,      512,     1024, 0x561358f4
-0,     121848,     121848,      512,     1024, 0xd0129b77
-0,     122355,     122355,      512,     1024, 0xcc636e88
-0,     122863,     122863,      512,     1024, 0xe9406321
-0,     123392,     123392,      512,     1024, 0x9f16a041
-0,     123899,     123899,      512,     1024, 0x468bf409
-0,     124406,     124406,      512,     1024, 0x3df70f7b
-0,     124913,     124913,      512,     1024, 0xa880b11b
-0,     125420,     125420,      512,     1024, 0x3286c489
-0,     125950,     125950,      512,     1024, 0x39fe9ebc
-0,     126457,     126457,      512,     1024, 0xc533d83b
-0,     126964,     126964,      512,     1024, 0x153b195d
-0,     127471,     127471,      512,     1024, 0xd84786a1
-0,     127978,     127978,      512,     1024, 0xdc295aaa
-0,     128507,     128507,      512,     1024, 0xfb764d8c
-0,     129015,     129015,      512,     1024, 0xeebc9db9
-0,     129522,     129522,      512,     1024, 0x7ba9403e
-0,     130029,     130029,      512,     1024, 0x4e5571ec
-0,     130558,     130558,      512,     1024, 0xd965fad4
-0,     131065,     131065,      512,     1024, 0x87e259f2
-0,     131572,     131572,      512,     1024, 0xae7e533b
-0,     132080,     132080,      512,     1024, 0x313cf4d6
-0,     132587,     132587,      512,     1024, 0xe1844c90
-0,     133116,     133116,      512,     1024, 0xbb057b44
-0,     133623,     133623,      512,     1024, 0xa5099687
-0,     134130,     134130,      512,     1024, 0xbff10707
-0,     134637,     134637,      512,     1024, 0x37c4ffc0
-0,     135167,     135167,      512,     1024, 0xf9fb6caa
-0,     135674,     135674,      512,     1024, 0x3b6a3a1f
-0,     136181,     136181,      512,     1024, 0x83431edb
-0,     136688,     136688,      512,     1024, 0x1eb713cf
-0,     137195,     137195,      512,     1024, 0xd7b07a6d
-0,     137724,     137724,      512,     1024, 0x81ae3391
-0,     138231,     138231,      512,     1024, 0xf150130a
-0,     138739,     138739,      512,     1024, 0x09678eaa
-0,     139246,     139246,      512,     1024, 0xb94e06f1
-0,     139775,     139775,      512,     1024, 0x67b1dbc9
-0,     140282,     140282,      512,     1024, 0xd6edc235
-0,     140789,     140789,      512,     1024, 0x34e4c499
-0,     141296,     141296,      512,     1024, 0xeefd89c0
-0,     141804,     141804,      512,     1024, 0x38afdaf1
-0,     142333,     142333,      512,     1024, 0x29a60d76
-0,     142840,     142840,      512,     1024, 0xe28a4372
-0,     143347,     143347,      512,     1024, 0x7089454d
-0,     143854,     143854,      512,     1024, 0x0c01bb7b
-0,     144383,     144383,      512,     1024, 0xbd776a72
-0,     144891,     144891,      512,     1024, 0x86776fd0
-0,     145398,     145398,      512,     1024, 0xb37c88f7
-0,     145905,     145905,      512,     1024, 0x5f90aaf8
-0,     146412,     146412,      512,     1024, 0x203d4222
-0,     146941,     146941,      512,     1024, 0x382692a6
-0,     147448,     147448,      512,     1024, 0xf37c95fd
-0,     147956,     147956,      512,     1024, 0x6c0b8877
-0,     148463,     148463,      512,     1024, 0x2e54a8b6
-0,     148992,     148992,      512,     1024, 0x7f266488
-0,     149499,     149499,      512,     1024, 0xfbf20f9a
-0,     150006,     150006,      512,     1024, 0xf2985cc0
-0,     150513,     150513,      512,     1024, 0xc7075340
-0,     151020,     151020,      512,     1024, 0xe4585695
-0,     151550,     151550,      512,     1024, 0xbdffa380
-0,     152057,     152057,      512,     1024, 0x2422a8a9
-0,     152564,     152564,      512,     1024, 0x59cbd75f
-0,     153071,     153071,      512,     1024, 0x04ad1a8c
-0,     153578,     153578,      512,     1024, 0x33c09191
-0,     154107,     154107,      512,     1024, 0x55efa6fd
-0,     154615,     154615,      512,     1024, 0xf73d0e5d
-0,     155122,     155122,      512,     1024, 0x6141ebae
-0,     155629,     155629,      512,     1024, 0x7db17a68
-0,     156158,     156158,      512,     1024, 0xa6c690b6
-0,     156665,     156665,      512,     1024, 0xa6fd6725
-0,     157172,     157172,      512,     1024, 0x50a90b9b
-0,     157680,     157680,      512,     1024, 0xef990dc8
-0,     158187,     158187,      512,     1024, 0x75adf6b5
-0,     158716,     158716,      512,     1024, 0x61eac43e
-0,     159223,     159223,      512,     1024, 0x67797a19
-0,     159730,     159730,      512,     1024, 0xf325277a
-0,     160237,     160237,      512,     1024, 0x18bf254a
-0,     160767,     160767,      512,     1024, 0x2ce6bee3
-0,     161274,     161274,      512,     1024, 0x8d320860
-0,     161781,     161781,      512,     1024, 0xc979b6e8
-0,     162288,     162288,      512,     1024, 0xdb644b41
-0,     162795,     162795,      512,     1024, 0xe1b368ba
-0,     163324,     163324,      512,     1024, 0xacc53d15
-0,     163832,     163832,      512,     1024, 0x42ea8c18
-0,     164339,     164339,      512,     1024, 0xe52c99a4
-0,     164846,     164846,      512,     1024, 0xd7db54a6
-0,     165375,     165375,      512,     1024, 0x7f27a7e3
-0,     165882,     165882,      512,     1024, 0xf7ffeaa9
-0,     166389,     166389,      512,     1024, 0x792b6088
-0,     166896,     166896,      512,     1024, 0x61d99724
-0,     167404,     167404,      512,     1024, 0x5213720e
-0,     167933,     167933,      512,     1024, 0xac09dd30
-0,     168440,     168440,      512,     1024, 0x960bf6bb
-0,     168947,     168947,      512,     1024, 0xc90168e1
-0,     169454,     169454,      512,     1024, 0x43b45768
-0,     169983,     169983,      512,     1024, 0x935d60a1
-0,     170491,     170491,      512,     1024, 0x9a342ef2
-0,     170998,     170998,      512,     1024, 0xc894709f
-0,     171505,     171505,      512,     1024, 0x59b43b07
-0,     172012,     172012,      512,     1024, 0x36a1a98d
-0,     172541,     172541,      512,     1024, 0x9e1a121c
-0,     173048,     173048,      512,     1024, 0x02208b78
-0,     173556,     173556,      512,     1024, 0xd1d7b274
-0,     174063,     174063,      512,     1024, 0xdacd5096
-0,     174592,     174592,      512,     1024, 0x51b71ead
-0,     175099,     175099,      512,     1024, 0xd009a7ca
-0,     175606,     175606,      512,     1024, 0xb6d5a938
-0,     176113,     176113,      512,     1024, 0xf3d45e47
-0,     176621,     176621,      512,     1024, 0xea8e04fc
-0,     177150,     177150,      512,     1024, 0x0b928bd8
-0,     177657,     177657,      512,     1024, 0x0f02caec
-0,     178164,     178164,      512,     1024, 0xe2b137a8
-0,     178671,     178671,      512,     1024, 0xd5f94892
diff --git a/deps/libav/tests/ref/fate/adpcm-ima-ws b/deps/libav/tests/ref/fate/adpcm-ima-ws
deleted file mode 100644
index 61e0def..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima-ws
+++ /dev/null
@@ -1,41 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,    11024,    22048, 0x0665d7f4
-0,      11024,      11024,     1470,     2940, 0x0f3c64cb
-0,      12494,      12494,     1470,     2940, 0xc90b9e78
-0,      13964,      13964,     1470,     2940, 0x146246a3
-0,      15434,      15434,     1470,     2940, 0xd22c714e
-0,      16904,      16904,     1470,     2940, 0xd86b681e
-0,      18374,      18374,     1470,     2940, 0x12ec8186
-0,      19844,      19844,     1470,     2940, 0x69aa85b6
-0,      21314,      21314,     1470,     2940, 0xb24d33b0
-0,      22784,      22784,     1470,     2940, 0x3f7b0f0d
-0,      24254,      24254,     1470,     2940, 0x64f10f7e
-0,      25724,      25724,     1470,     2940, 0xd6ea379a
-0,      27194,      27194,     1470,     2940, 0x7c38e830
-0,      28664,      28664,     1470,     2940, 0xc28ff132
-0,      30134,      30134,     1470,     2940, 0xe7b11629
-0,      31604,      31604,     1470,     2940, 0xeb86fdcb
-0,      33074,      33074,     1470,     2940, 0x5508f586
-0,      34544,      34544,     1470,     2940, 0xf4fa1f1b
-0,      36014,      36014,     1470,     2940, 0x9e5ff976
-0,      37484,      37484,     1470,     2940, 0xcfc4e08f
-0,      38954,      38954,     1470,     2940, 0x74bde7ed
-0,      40424,      40424,     1470,     2940, 0x3e4ae245
-0,      41894,      41894,     1470,     2940, 0x4c6a8e56
-0,      43364,      43364,     1470,     2940, 0xa09d86ab
-0,      44834,      44834,     1470,     2940, 0xc8531912
-0,      46304,      46304,     1470,     2940, 0xa5f266aa
-0,      47774,      47774,     1470,     2940, 0x587a4187
-0,      49244,      49244,     1470,     2940, 0x14752d45
-0,      50714,      50714,     1470,     2940, 0x558cde10
-0,      52184,      52184,     1470,     2940, 0x735fee38
-0,      53654,      53654,     1470,     2940, 0xac8bb6c8
-0,      55124,      55124,     1470,     2940, 0xa503c73b
-0,      56594,      56594,     1470,     2940, 0x7cd588a3
-0,      58064,      58064,     1470,     2940, 0xa6974b04
-0,      59534,      59534,     1470,     2940, 0xbf448241
-0,      61004,      61004,     1470,     2940, 0x2a5c2759
-0,      62474,      62474,     1470,     2940, 0xd0de5ce0
-0,      63944,      63944,     1470,     2940, 0xc0486649
-0,      65414,      65414,     1470,     2940, 0x48b040af
-0,      66884,      66884,     1470,     2940, 0x82a338a9
diff --git a/deps/libav/tests/ref/fate/adpcm-ima_wav-stereo b/deps/libav/tests/ref/fate/adpcm-ima_wav-stereo
deleted file mode 100644
index cb6a481..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ima_wav-stereo
+++ /dev/null
@@ -1 +0,0 @@
-1ee96f1efc09251a732621049dc5b66e
diff --git a/deps/libav/tests/ref/fate/adpcm-ms-mono b/deps/libav/tests/ref/fate/adpcm-ms-mono
deleted file mode 100644
index c456708..0000000
--- a/deps/libav/tests/ref/fate/adpcm-ms-mono
+++ /dev/null
@@ -1,46 +0,0 @@
-#tb 0: 1/11025
-0,          0,          0,      500,     1000, 0x64cd9403
-0,        500,        500,      500,     1000, 0xa4ef8a9d
-0,       1000,       1000,      500,     1000, 0x75c19868
-0,       1500,       1500,      500,     1000, 0x93db6f79
-0,       2000,       2000,      500,     1000, 0x6835625d
-0,       2500,       2500,      500,     1000, 0xb3affa8f
-0,       3000,       3000,      500,     1000, 0x159fdcc8
-0,       3500,       3500,      500,     1000, 0x79f9f7f1
-0,       4000,       4000,      500,     1000, 0xd7d1131e
-0,       4500,       4500,      500,     1000, 0x52a6f797
-0,       5000,       5000,      500,     1000, 0x748202ca
-0,       5500,       5500,      500,     1000, 0x0ef92449
-0,       6000,       6000,      500,     1000, 0x6a3760ab
-0,       6500,       6500,      500,     1000, 0xce5c5abf
-0,       7000,       7000,      500,     1000, 0x23396792
-0,       7500,       7500,      500,     1000, 0xa5276238
-0,       8000,       8000,      500,     1000, 0x288adf1b
-0,       8500,       8500,      500,     1000, 0xe7de6fb2
-0,       9000,       9000,      500,     1000, 0x2c2c707f
-0,       9500,       9500,      500,     1000, 0xd66d6daf
-0,      10000,      10000,      500,     1000, 0xbcea7d64
-0,      10500,      10500,      500,     1000, 0x766feea5
-0,      11000,      11000,      500,     1000, 0xd2e1d63a
-0,      11500,      11500,      500,     1000, 0x2f7ef4ed
-0,      12000,      12000,      500,     1000, 0xb655cba4
-0,      12500,      12500,      500,     1000, 0x4507d37b
-0,      13000,      13000,      500,     1000, 0x0c57f794
-0,      13500,      13500,      500,     1000, 0x0ecbe5cc
-0,      14000,      14000,      500,     1000, 0x9bf6e345
-0,      14500,      14500,      500,     1000, 0xc461443c
-0,      15000,      15000,      500,     1000, 0xad9657bf
-0,      15500,      15500,      500,     1000, 0x466fe91c
-0,      16000,      16000,      500,     1000, 0x9ee377fe
-0,      16500,      16500,      500,     1000, 0x09956428
-0,      17000,      17000,      500,     1000, 0x9b285f0a
-0,      17500,      17500,      500,     1000, 0x0a3e61a6
-0,      18000,      18000,      500,     1000, 0xacc25d6b
-0,      18500,      18500,      500,     1000, 0x377be319
-0,      19000,      19000,      500,     1000, 0xe4890504
-0,      19500,      19500,      500,     1000, 0xe90a6497
-0,      20000,      20000,      500,     1000, 0xd00fe950
-0,      20500,      20500,      500,     1000, 0xf195eb44
-0,      21000,      21000,      500,     1000, 0xa491f3ef
-0,      21500,      21500,      500,     1000, 0x2c036e18
-0,      22000,      22000,       50,      100, 0x0bd81f05
diff --git a/deps/libav/tests/ref/fate/adpcm-thp b/deps/libav/tests/ref/fate/adpcm-thp
deleted file mode 100644
index 72aff61..0000000
--- a/deps/libav/tests/ref/fate/adpcm-thp
+++ /dev/null
@@ -1,72 +0,0 @@
-#tb 0: 1/32000
-0,          0,          0,     1078,     4312, 0x469714f6
-0,       1078,       1078,     1064,     4256, 0xe03dd882
-0,       2142,       2142,     1078,     4312, 0x46b901f7
-0,       3220,       3220,     1064,     4256, 0x8d4a54e4
-0,       4284,       4284,     1064,     4256, 0xfd616b67
-0,       5348,       5348,     1078,     4312, 0xefe62302
-0,       6426,       6426,     1064,     4256, 0xab11684e
-0,       7490,       7490,     1064,     4256, 0xb4b3feb8
-0,       8554,       8554,     1078,     4312, 0x71db6461
-0,       9632,       9632,     1064,     4256, 0x090e5efa
-0,      10696,      10696,     1064,     4256, 0x36f49c28
-0,      11760,      11760,     1078,     4312, 0x0fe3d262
-0,      12838,      12838,     1064,     4256, 0x199ce269
-0,      13902,      13902,     1064,     4256, 0x98342d05
-0,      14966,      14966,     1078,     4312, 0xb6fb7ebe
-0,      16044,      16044,     1064,     4256, 0x033dd562
-0,      17108,      17108,     1064,     4256, 0xc2cc17e0
-0,      18172,      18172,     1078,     4312, 0x4bb3ff50
-0,      19250,      19250,     1064,     4256, 0x6f2671ef
-0,      20314,      20314,     1064,     4256, 0x5a337bf4
-0,      21378,      21378,     1078,     4312, 0xa71f6967
-0,      22456,      22456,     1064,     4256, 0x48084aa9
-0,      23520,      23520,     1064,     4256, 0x3cce4218
-0,      24584,      24584,     1078,     4312, 0xcbb8f73d
-0,      25662,      25662,     1064,     4256, 0x36825021
-0,      26726,      26726,     1064,     4256, 0xeae036c6
-0,      27790,      27790,     1078,     4312, 0x0d650ac6
-0,      28868,      28868,     1064,     4256, 0xfba4f58c
-0,      29932,      29932,     1064,     4256, 0x54311f9b
-0,      30996,      30996,     1078,     4312, 0x286386b3
-0,      32074,      32074,     1064,     4256, 0x871896de
-0,      33138,      33138,     1064,     4256, 0x9ef9f970
-0,      34202,      34202,     1078,     4312, 0xf9ae97f1
-0,      35280,      35280,     1064,     4256, 0x0ad0d765
-0,      36344,      36344,     1064,     4256, 0x8e6aa9b5
-0,      37408,      37408,     1078,     4312, 0x8362787b
-0,      38486,      38486,     1064,     4256, 0x9b6a5d9c
-0,      39550,      39550,     1064,     4256, 0xfb715d8f
-0,      40614,      40614,     1078,     4312, 0x02bd8075
-0,      41692,      41692,     1064,     4256, 0x428eb932
-0,      42756,      42756,     1064,     4256, 0x17ea8c94
-0,      43820,      43820,     1078,     4312, 0xb3e761d7
-0,      44898,      44898,     1064,     4256, 0x0919755a
-0,      45962,      45962,     1064,     4256, 0x5e520edd
-0,      47026,      47026,     1078,     4312, 0x69aa070e
-0,      48104,      48104,     1064,     4256, 0xf8192f7d
-0,      49168,      49168,     1064,     4256, 0xaad4475c
-0,      50232,      50232,     1078,     4312, 0x0cabcfcb
-0,      51310,      51310,     1064,     4256, 0x952f0f96
-0,      52374,      52374,     1064,     4256, 0x1b805a0c
-0,      53438,      53438,     1078,     4312, 0x93043d2a
-0,      54516,      54516,     1064,     4256, 0x38b99e44
-0,      55580,      55580,     1064,     4256, 0x60cc52ff
-0,      56644,      56644,     1078,     4312, 0x6a875849
-0,      57722,      57722,     1064,     4256, 0xd08d6d0e
-0,      58786,      58786,     1064,     4256, 0x36bfe48e
-0,      59850,      59850,     1078,     4312, 0x795c6134
-0,      60928,      60928,     1064,     4256, 0x4fd79583
-0,      61992,      61992,     1064,     4256, 0x65e2ab9f
-0,      63056,      63056,     1078,     4312, 0xedeede4a
-0,      64134,      64134,     1064,     4256, 0x097e0d09
-0,      65198,      65198,     1064,     4256, 0x58afa133
-0,      66262,      66262,     1078,     4312, 0x442525b5
-0,      67340,      67340,     1064,     4256, 0x6645c591
-0,      68404,      68404,     1064,     4256, 0xb0dd948a
-0,      69468,      69468,     1078,     4312, 0x12684e69
-0,      70546,      70546,     1064,     4256, 0xb45098e3
-0,      71610,      71610,     1064,     4256, 0xb6d3c61c
-0,      72674,      72674,     1078,     4312, 0xb46b5b22
-0,      73752,      73752,     1064,     4256, 0x9a556830
-0,      74816,      74816,     1064,     4256, 0x67ca2b35
diff --git a/deps/libav/tests/ref/fate/adpcm-xa b/deps/libav/tests/ref/fate/adpcm-xa
deleted file mode 100644
index 04be2b9..0000000
--- a/deps/libav/tests/ref/fate/adpcm-xa
+++ /dev/null
@@ -1,38 +0,0 @@
-#tb 0: 1/37800
-0,          0,          0,     2016,     8064, 0xa307ed8c
-0,       2016,       2016,     2016,     8064, 0xd2551927
-0,       4032,       4032,     2016,     8064, 0x3264a799
-0,       6048,       6048,     2016,     8064, 0x75da1393
-0,       8064,       8064,     2016,     8064, 0x68665f59
-0,      10080,      10080,     2016,     8064, 0xaf266a18
-0,      12096,      12096,     2016,     8064, 0x4d4b69fd
-0,      14112,      14112,     2016,     8064, 0x129d7e17
-0,      16128,      16128,     2016,     8064, 0x78c56725
-0,      18144,      18144,     2016,     8064, 0x59902cf1
-0,      20160,      20160,     2016,     8064, 0x6e699c87
-0,      22176,      22176,     2016,     8064, 0xc30692d7
-0,      24192,      24192,     2016,     8064, 0x29c043e5
-0,      26208,      26208,     2016,     8064, 0x61907704
-0,      28224,      28224,     2016,     8064, 0xf9210630
-0,      30240,      30240,     2016,     8064, 0xc0bdda08
-0,      32256,      32256,     2016,     8064, 0x6171b96d
-0,      34272,      34272,     2016,     8064, 0x082947cf
-0,      36288,      36288,     2016,     8064, 0xf7bbf1ce
-0,      38304,      38304,     2016,     8064, 0xe50e4436
-0,      40320,      40320,     2016,     8064, 0x2a860844
-0,      42336,      42336,     2016,     8064, 0xedcb502c
-0,      44352,      44352,     2016,     8064, 0x448e3c7f
-0,      46368,      46368,     2016,     8064, 0xf782f366
-0,      48384,      48384,     2016,     8064, 0xf57f66a5
-0,      50400,      50400,     2016,     8064, 0xdcc36939
-0,      52416,      52416,     2016,     8064, 0x34959d99
-0,      54432,      54432,     2016,     8064, 0xa5c20433
-0,      56448,      56448,     2016,     8064, 0xf1364e9b
-0,      58464,      58464,     2016,     8064, 0x232fe9c7
-0,      60480,      60480,     2016,     8064, 0xdc068d5a
-0,      62496,      62496,     2016,     8064, 0x4962e812
-0,      64512,      64512,     2016,     8064, 0x36a6709b
-0,      66528,      66528,     2016,     8064, 0xa2837bd8
-0,      68544,      68544,     2016,     8064, 0x68612ddb
-0,      70560,      70560,     2016,     8064, 0x8d76d1cb
-0,      72576,      72576,     2016,     8064, 0x7707cfc7
diff --git a/deps/libav/tests/ref/fate/adpcm_ms-stereo b/deps/libav/tests/ref/fate/adpcm_ms-stereo
deleted file mode 100644
index 6b131c1..0000000
--- a/deps/libav/tests/ref/fate/adpcm_ms-stereo
+++ /dev/null
@@ -1 +0,0 @@
-3b7554e9a186c30adfd2a86bae950f4a
diff --git a/deps/libav/tests/ref/fate/adts-demux b/deps/libav/tests/ref/fate/adts-demux
deleted file mode 100644
index 744ae64..0000000
--- a/deps/libav/tests/ref/fate/adts-demux
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0xbda37454
diff --git a/deps/libav/tests/ref/fate/aea-demux b/deps/libav/tests/ref/fate/aea-demux
deleted file mode 100644
index 18ec8b8..0000000
--- a/deps/libav/tests/ref/fate/aea-demux
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0xc1312082
diff --git a/deps/libav/tests/ref/fate/alg-mm b/deps/libav/tests/ref/fate/alg-mm
deleted file mode 100644
index 5d97de9..0000000
--- a/deps/libav/tests/ref/fate/alg-mm
+++ /dev/null
@@ -1,32 +0,0 @@
-#tb 0: 1/10
-0,          0,          0,        1,   122880, 0x4ed8123f
-0,          1,          1,        1,   122880, 0xc4c35304
-0,          2,          2,        1,   122880, 0xbd3015fd
-0,          3,          3,        1,   122880, 0xece5dbab
-0,          4,          4,        1,   122880, 0x13249f3f
-0,          5,          5,        1,   122880, 0x58f75895
-0,          6,          6,        1,   122880, 0xe6570f7d
-0,          7,          7,        1,   122880, 0xcce88145
-0,          8,          8,        1,   122880, 0x796f633c
-0,          9,          9,        1,   122880, 0x182c3cd3
-0,         10,         10,        1,   122880, 0x04b2513b
-0,         11,         11,        1,   122880, 0x6b7e2e42
-0,         12,         12,        1,   122880, 0x2fa47070
-0,         13,         13,        1,   122880, 0x7142919e
-0,         14,         14,        1,   122880, 0x8995337e
-0,         15,         15,        1,   122880, 0x5146ca20
-0,         16,         16,        1,   122880, 0x9aadb491
-0,         17,         17,        1,   122880, 0x2d5b0032
-0,         18,         18,        1,   122880, 0x5c7c8314
-0,         19,         19,        1,   122880, 0x2ba8253c
-0,         20,         20,        1,   122880, 0xd19d504b
-0,         21,         21,        1,   122880, 0x4ff15fd1
-0,         22,         22,        1,   122880, 0x76039f9f
-0,         23,         23,        1,   122880, 0xcce84d35
-0,         24,         24,        1,   122880, 0x68c5797c
-0,         25,         25,        1,   122880, 0xf1da4293
-0,         26,         26,        1,   122880, 0xf5f537f3
-0,         27,         27,        1,   122880, 0x8d3ffa94
-0,         28,         28,        1,   122880, 0x3ca9b69c
-0,         29,         29,        1,   122880, 0x21187f6c
-0,         30,         30,        1,   122880, 0xe5136e34
diff --git a/deps/libav/tests/ref/fate/amv b/deps/libav/tests/ref/fate/amv
deleted file mode 100644
index 407f077..0000000
--- a/deps/libav/tests/ref/fate/amv
+++ /dev/null
@@ -1,161 +0,0 @@
-#tb 0: 1/16
-0,          0,          0,        1,    28800, 0x026058a9
-0,          1,          1,        1,    28800, 0x5dc728de
-0,          2,          2,        1,    28800, 0x83e19a2c
-0,          3,          3,        1,    28800, 0xb029f94a
-0,          4,          4,        1,    28800, 0x735a6b15
-0,          5,          5,        1,    28800, 0xf7e9dc8b
-0,          6,          6,        1,    28800, 0xa108b0cf
-0,          7,          7,        1,    28800, 0x3d11c138
-0,          8,          8,        1,    28800, 0xed23afda
-0,          9,          9,        1,    28800, 0x713bb2dc
-0,         10,         10,        1,    28800, 0x551ad51e
-0,         11,         11,        1,    28800, 0x49dfcf2d
-0,         12,         12,        1,    28800, 0x6399d5b3
-0,         13,         13,        1,    28800, 0x520ad812
-0,         14,         14,        1,    28800, 0xc46ad9da
-0,         15,         15,        1,    28800, 0xe79edb9e
-0,         16,         16,        1,    28800, 0xdb1acb30
-0,         17,         17,        1,    28800, 0x050fb669
-0,         18,         18,        1,    28800, 0x096ca687
-0,         19,         19,        1,    28800, 0x0054a6bd
-0,         20,         20,        1,    28800, 0x6d7daad2
-0,         21,         21,        1,    28800, 0x9c10a9dc
-0,         22,         22,        1,    28800, 0x89b1a623
-0,         23,         23,        1,    28800, 0xa0a19c3f
-0,         24,         24,        1,    28800, 0x26c898ad
-0,         25,         25,        1,    28800, 0x6f639dae
-0,         26,         26,        1,    28800, 0xa173a9b5
-0,         27,         27,        1,    28800, 0xa309aa08
-0,         28,         28,        1,    28800, 0x2059b6c4
-0,         29,         29,        1,    28800, 0x5ae8c761
-0,         30,         30,        1,    28800, 0xb780c9c5
-0,         31,         31,        1,    28800, 0xf58ac8fe
-0,         32,         32,        1,    28800, 0x9bb307e7
-0,         33,         33,        1,    28800, 0xd32c3e81
-0,         34,         34,        1,    28800, 0x4edd51d2
-0,         35,         35,        1,    28800, 0x5a88684d
-0,         36,         36,        1,    28800, 0x5bd97f0e
-0,         37,         37,        1,    28800, 0x36d67843
-0,         38,         38,        1,    28800, 0x0e18781d
-0,         39,         39,        1,    28800, 0xa3168807
-0,         40,         40,        1,    28800, 0xa7c575b8
-0,         41,         41,        1,    28800, 0x86367c37
-0,         42,         42,        1,    28800, 0xb0f79180
-0,         43,         43,        1,    28800, 0x61da8c0f
-0,         44,         44,        1,    28800, 0x9b11948a
-0,         45,         45,        1,    28800, 0xc53d9b44
-0,         46,         46,        1,    28800, 0xdc699185
-0,         47,         47,        1,    28800, 0x7b4f92b5
-0,         48,         48,        1,    28800, 0x40469065
-0,         49,         49,        1,    28800, 0x737ea07e
-0,         50,         50,        1,    28800, 0x0db49c8b
-0,         51,         51,        1,    28800, 0x39249f10
-0,         52,         52,        1,    28800, 0xc182ab99
-0,         53,         53,        1,    28800, 0xd8f7a7c9
-0,         54,         54,        1,    28800, 0x46789caa
-0,         55,         55,        1,    28800, 0x4759a374
-0,         56,         56,        1,    28800, 0xe621b16a
-0,         57,         57,        1,    28800, 0xcf47a999
-0,         58,         58,        1,    28800, 0x801dacd4
-0,         59,         59,        1,    28800, 0xe580af51
-0,         60,         60,        1,    28800, 0x03d7a887
-0,         61,         61,        1,    28800, 0xa67ea51d
-0,         62,         62,        1,    28800, 0x9fee0ec8
-0,         63,         63,        1,    28800, 0x7f602a5e
-0,         64,         64,        1,    28800, 0x100d432a
-0,         65,         65,        1,    28800, 0x42164dfb
-0,         66,         66,        1,    28800, 0x86c05196
-0,         67,         67,        1,    28800, 0xfc225938
-0,         68,         68,        1,    28800, 0x81085e87
-0,         69,         69,        1,    28800, 0xaa8f5d0a
-0,         70,         70,        1,    28800, 0x605a5f9f
-0,         71,         71,        1,    28800, 0x68dc64b2
-0,         72,         72,        1,    28800, 0xd08e710b
-0,         73,         73,        1,    28800, 0xf8567939
-0,         74,         74,        1,    28800, 0x8dad7a4f
-0,         75,         75,        1,    28800, 0x1a19813c
-0,         76,         76,        1,    28800, 0x8a157f0e
-0,         77,         77,        1,    28800, 0xa4fa7b9d
-0,         78,         78,        1,    28800, 0x093b7b36
-0,         79,         79,        1,    28800, 0xa925755b
-0,         80,         80,        1,    28800, 0xa5968138
-0,         81,         81,        1,    28800, 0xe00877ac
-0,         82,         82,        1,    28800, 0xd736183e
-0,         83,         83,        1,    28800, 0x356f2068
-0,         84,         84,        1,    28800, 0xf9a50f22
-0,         85,         85,        1,    28800, 0x92df2ae8
-0,         86,         86,        1,    28800, 0x67a43dc8
-0,         87,         87,        1,    28800, 0xf8ce2ead
-0,         88,         88,        1,    28800, 0xf42f37ee
-0,         89,         89,        1,    28800, 0x03611f37
-0,         90,         90,        1,    28800, 0xddda2327
-0,         91,         91,        1,    28800, 0xdf073d85
-0,         92,         92,        1,    28800, 0xa8331fee
-0,         93,         93,        1,    28800, 0x59d3490a
-0,         94,         94,        1,    28800, 0xa8335be6
-0,         95,         95,        1,    28800, 0xd5483b43
-0,         96,         96,        1,    28800, 0x23422dc9
-0,         97,         97,        1,    28800, 0xc04e4689
-0,         98,         98,        1,    28800, 0xd4d96372
-0,         99,         99,        1,    28800, 0x9c814e96
-0,        100,        100,        1,    28800, 0x7c4b5d3b
-0,        101,        101,        1,    28800, 0x6bf66c04
-0,        102,        102,        1,    28800, 0x6e8d4bb6
-0,        103,        103,        1,    28800, 0xad964d00
-0,        104,        104,        1,    28800, 0x1ff36bd1
-0,        105,        105,        1,    28800, 0xa4664c76
-0,        106,        106,        1,    28800, 0x50626d82
-0,        107,        107,        1,    28800, 0x81906c5c
-0,        108,        108,        1,    28800, 0x5060543f
-0,        109,        109,        1,    28800, 0x231c5a86
-0,        110,        110,        1,    28800, 0x79775d48
-0,        111,        111,        1,    28800, 0xbb893571
-0,        112,        112,        1,    28800, 0x794c49ed
-0,        113,        113,        1,    28800, 0x70464bac
-0,        114,        114,        1,    28800, 0xe79549ce
-0,        115,        115,        1,    28800, 0xa6565555
-0,        116,        116,        1,    28800, 0x2ef1ad6d
-0,        117,        117,        1,    28800, 0xdd22b9aa
-0,        118,        118,        1,    28800, 0x26ebaa97
-0,        119,        119,        1,    28800, 0x32bd979e
-0,        120,        120,        1,    28800, 0x4c167c9a
-0,        121,        121,        1,    28800, 0xfdf76051
-0,        122,        122,        1,    28800, 0x966938a8
-0,        123,        123,        1,    28800, 0xcea3fbde
-0,        124,        124,        1,    28800, 0x29a0c213
-0,        125,        125,        1,    28800, 0x5633a1c2
-0,        126,        126,        1,    28800, 0xdc0b9af8
-0,        127,        127,        1,    28800, 0x92138848
-0,        128,        128,        1,    28800, 0xd7308da5
-0,        129,        129,        1,    28800, 0x0c8f9b3f
-0,        130,        130,        1,    28800, 0xd059b5d1
-0,        131,        131,        1,    28800, 0xba6ed9cd
-0,        132,        132,        1,    28800, 0x896c1064
-0,        133,        133,        1,    28800, 0x986e2fc9
-0,        134,        134,        1,    28800, 0xcba94e4b
-0,        135,        135,        1,    28800, 0xf3e778ed
-0,        136,        136,        1,    28800, 0xc6cd7d48
-0,        137,        137,        1,    28800, 0xd9bd84d8
-0,        138,        138,        1,    28800, 0x391197b4
-0,        139,        139,        1,    28800, 0xf361a1d9
-0,        140,        140,        1,    28800, 0x9a1ea54e
-0,        141,        141,        1,    28800, 0x551aab57
-0,        142,        142,        1,    28800, 0x3af8577d
-0,        143,        143,        1,    28800, 0x10f76ed0
-0,        144,        144,        1,    28800, 0x026a7fde
-0,        145,        145,        1,    28800, 0x3e0e8db8
-0,        146,        146,        1,    28800, 0x22998d2d
-0,        147,        147,        1,    28800, 0x05978b12
-0,        148,        148,        1,    28800, 0x38b88294
-0,        149,        149,        1,    28800, 0x2ef677d6
-0,        150,        150,        1,    28800, 0x0b9a8894
-0,        151,        151,        1,    28800, 0x2dcb6718
-0,        152,        152,        1,    28800, 0xa31b6679
-0,        153,        153,        1,    28800, 0x262d6a50
-0,        154,        154,        1,    28800, 0xff3d6d0d
-0,        155,        155,        1,    28800, 0x159d7045
-0,        156,        156,        1,    28800, 0xf0df7800
-0,        157,        157,        1,    28800, 0xbe825ea5
-0,        158,        158,        1,    28800, 0x80e25d5a
-0,        159,        159,        1,    28800, 0x8cbe263f
diff --git a/deps/libav/tests/ref/fate/ansi b/deps/libav/tests/ref/fate/ansi
deleted file mode 100644
index 78e853f..0000000
--- a/deps/libav/tests/ref/fate/ansi
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   768000, 0x772dd3d0
-0,          1,          1,        1,   768000, 0xd7dab1d1
-0,          2,          2,        1,   768000, 0x0e56f2d3
-0,          3,          3,        1,   768000, 0x11c1fb8e
-0,          4,          4,        1,   768000, 0x72d12da9
-0,          5,          5,        1,   768000, 0x39c7a70d
-0,          6,          6,        1,   768000, 0x94bd32a4
-0,          7,          7,        1,   768000, 0x06dd5ba1
-0,          8,          8,        1,   768000, 0x9616ec95
-0,          9,          9,        1,   768000, 0x6df5b9e2
-0,         10,         10,        1,   768000, 0x7be7f60a
-0,         11,         11,        1,   768000, 0x2abc8623
-0,         12,         12,        1,   768000, 0x5678bfff
-0,         13,         13,        1,   768000, 0x24a03042
-0,         14,         14,        1,   768000, 0xfb011b23
-0,         15,         15,        1,   768000, 0x925ff5e9
-0,         16,         16,        1,   768000, 0x890e2a56
diff --git a/deps/libav/tests/ref/fate/armovie-escape124 b/deps/libav/tests/ref/fate/armovie-escape124
deleted file mode 100644
index c686327..0000000
--- a/deps/libav/tests/ref/fate/armovie-escape124
+++ /dev/null
@@ -1,106 +0,0 @@
-#tb 0: 1/25
-#tb 1: 1/44100
-0,          0,          0,        1,   230400, 0x5288d70f
-1,          0,          0,    44100,   176400, 0xdd61578c
-0,          1,          1,        1,   230400, 0x2d3c1066
-0,          2,          2,        1,   230400, 0x89eb5b4a
-0,          3,          3,        1,   230400, 0x24c2d2e7
-0,          4,          4,        1,   230400, 0x9271cb38
-0,          5,          5,        1,   230400, 0xc74a5009
-0,          6,          6,        1,   230400, 0x61d70705
-0,          7,          7,        1,   230400, 0x6bb2c252
-0,          8,          8,        1,   230400, 0x6b3ac910
-0,          9,          9,        1,   230400, 0x44071f28
-0,         10,         10,        1,   230400, 0x8abd00fe
-0,         11,         11,        1,   230400, 0xcbe3395d
-0,         12,         12,        1,   230400, 0x603e7b7a
-0,         13,         13,        1,   230400, 0x2ca8865b
-0,         14,         14,        1,   230400, 0x11b4c665
-0,         15,         15,        1,   230400, 0x3f19787c
-0,         16,         16,        1,   230400, 0x651d24b6
-0,         17,         17,        1,   230400, 0x325d05af
-0,         18,         18,        1,   230400, 0x4f89d8a8
-0,         19,         19,        1,   230400, 0xb07647f0
-0,         20,         20,        1,   230400, 0x71141237
-0,         21,         21,        1,   230400, 0xa848a2d2
-0,         22,         22,        1,   230400, 0x3fbe4b58
-0,         23,         23,        1,   230400, 0xa1e235a0
-0,         24,         24,        1,   230400, 0x9bcf607a
-0,         25,         25,        1,   230400, 0x3302e9eb
-1,      44100,      44100,    44100,   176400, 0x0b9e6d67
-0,         26,         26,        1,   230400, 0xd731ba90
-0,         27,         27,        1,   230400, 0x821eedcf
-0,         28,         28,        1,   230400, 0xd068a93d
-0,         29,         29,        1,   230400, 0x2811d46e
-0,         30,         30,        1,   230400, 0xd9740446
-0,         31,         31,        1,   230400, 0x1bce0df6
-0,         32,         32,        1,   230400, 0x44bc60ad
-0,         33,         33,        1,   230400, 0xf56f6200
-0,         34,         34,        1,   230400, 0x874a2264
-0,         35,         35,        1,   230400, 0xaa155c0e
-0,         36,         36,        1,   230400, 0x595392d4
-0,         37,         37,        1,   230400, 0x58dc57de
-0,         38,         38,        1,   230400, 0x1c06733e
-0,         39,         39,        1,   230400, 0x6807b1db
-0,         40,         40,        1,   230400, 0x3fedff87
-0,         41,         41,        1,   230400, 0x3e38cc13
-0,         42,         42,        1,   230400, 0x6685ec35
-0,         43,         43,        1,   230400, 0x6c0742fd
-0,         44,         44,        1,   230400, 0x8108f83c
-0,         45,         45,        1,   230400, 0xc0e217c8
-0,         46,         46,        1,   230400, 0xb22ca65d
-0,         47,         47,        1,   230400, 0xd54cec93
-0,         48,         48,        1,   230400, 0xd9d61de3
-0,         49,         49,        1,   230400, 0x7e0f9675
-0,         50,         50,        1,   230400, 0x9869f5b7
-1,      88200,      88200,    44100,   176400, 0x2793fad7
-0,         51,         51,        1,   230400, 0x22f33400
-0,         52,         52,        1,   230400, 0x31b999bd
-0,         53,         53,        1,   230400, 0x36c23878
-0,         54,         54,        1,   230400, 0x06093a30
-0,         55,         55,        1,   230400, 0x213f1718
-0,         56,         56,        1,   230400, 0x83683006
-0,         57,         57,        1,   230400, 0x0bfcec36
-0,         58,         58,        1,   230400, 0x01b77825
-0,         59,         59,        1,   230400, 0x650a5ea2
-0,         60,         60,        1,   230400, 0xd8b2c559
-0,         61,         61,        1,   230400, 0xb012eb10
-0,         62,         62,        1,   230400, 0x135d53a4
-0,         63,         63,        1,   230400, 0x98dd0712
-0,         64,         64,        1,   230400, 0x75240ac0
-0,         65,         65,        1,   230400, 0xa16769d5
-0,         66,         66,        1,   230400, 0x3e08cda3
-0,         67,         67,        1,   230400, 0xcd20d561
-0,         68,         68,        1,   230400, 0x3531577d
-0,         69,         69,        1,   230400, 0x65ff4c82
-0,         70,         70,        1,   230400, 0x8fd4a580
-0,         71,         71,        1,   230400, 0x3cf7af4c
-0,         72,         72,        1,   230400, 0xda7a9202
-0,         73,         73,        1,   230400, 0x4bebc138
-0,         74,         74,        1,   230400, 0x5517e685
-0,         75,         75,        1,   230400, 0x95f6c7a3
-1,     132300,     132300,    44100,   176400, 0xe2649a4a
-0,         76,         76,        1,   230400, 0x9849ebf9
-0,         77,         77,        1,   230400, 0xd77e1c7d
-0,         78,         78,        1,   230400, 0x4dc6c923
-0,         79,         79,        1,   230400, 0x7ce817c8
-0,         80,         80,        1,   230400, 0xafb4acde
-0,         81,         81,        1,   230400, 0xd0030b2c
-0,         82,         82,        1,   230400, 0xb3acb77c
-0,         83,         83,        1,   230400, 0x4d32b61c
-0,         84,         84,        1,   230400, 0x2436a915
-0,         85,         85,        1,   230400, 0xa6fd831f
-0,         86,         86,        1,   230400, 0x6c6edfca
-0,         87,         87,        1,   230400, 0x4b30d72e
-0,         88,         88,        1,   230400, 0x59f46a8a
-0,         89,         89,        1,   230400, 0xa2d0435f
-0,         90,         90,        1,   230400, 0x463872c4
-0,         91,         91,        1,   230400, 0x1d7e870a
-0,         92,         92,        1,   230400, 0x74f4e530
-0,         93,         93,        1,   230400, 0xbc61053d
-0,         94,         94,        1,   230400, 0x5fb238dc
-0,         95,         95,        1,   230400, 0x14a29d83
-0,         96,         96,        1,   230400, 0x3fd1d09b
-0,         97,         97,        1,   230400, 0x098afc13
-0,         98,         98,        1,   230400, 0x9bd12a62
-0,         99,         99,        1,   230400, 0x7bf71419
diff --git a/deps/libav/tests/ref/fate/armovie-escape130 b/deps/libav/tests/ref/fate/armovie-escape130
deleted file mode 100644
index ee4ec26..0000000
--- a/deps/libav/tests/ref/fate/armovie-escape130
+++ /dev/null
@@ -1,360 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,    76800, 0x860502ee
-0,          1,          1,        1,    76800, 0x055da755
-0,          2,          2,        1,    76800, 0x67969220
-0,          3,          3,        1,    76800, 0xbb28885c
-0,          4,          4,        1,    76800, 0x4000a5dd
-0,          5,          5,        1,    76800, 0xfe1f6b04
-0,          6,          6,        1,    76800, 0x334cbe5d
-0,          7,          7,        1,    76800, 0x87d15088
-0,          8,          8,        1,    76800, 0x70248ad3
-0,          9,          9,        1,    76800, 0x29bcaea0
-0,         10,         10,        1,    76800, 0xee81d3e2
-0,         11,         11,        1,    76800, 0x5bdd3cbc
-0,         12,         12,        1,    76800, 0xd7a5e42e
-0,         13,         13,        1,    76800, 0xbb354f7c
-0,         14,         14,        1,    76800, 0x4c86e881
-0,         15,         15,        1,    76800, 0xc6acb7f4
-0,         16,         16,        1,    76800, 0x7701ca9c
-0,         17,         17,        1,    76800, 0x5555d472
-0,         18,         18,        1,    76800, 0xa8fbc2d6
-0,         19,         19,        1,    76800, 0x558ab4f2
-0,         20,         20,        1,    76800, 0x9eb5ab72
-0,         21,         21,        1,    76800, 0x4711a894
-0,         22,         22,        1,    76800, 0xd649c04c
-0,         23,         23,        1,    76800, 0x26b9d6cc
-0,         24,         24,        1,    76800, 0x6217e494
-0,         25,         25,        1,    76800, 0x85d7e232
-0,         26,         26,        1,    76800, 0x4059ddb0
-0,         27,         27,        1,    76800, 0x3581cae2
-0,         28,         28,        1,    76800, 0x1885c99e
-0,         29,         29,        1,    76800, 0xc87dcd66
-0,         30,         30,        1,    76800, 0x8645e084
-0,         31,         31,        1,    76800, 0xe17ed6b4
-0,         32,         32,        1,    76800, 0x2709c7b6
-0,         33,         33,        1,    76800, 0xded3ab34
-0,         34,         34,        1,    76800, 0x3e69a364
-0,         35,         35,        1,    76800, 0x90c7ae7e
-0,         36,         36,        1,    76800, 0x7dffba9a
-0,         37,         37,        1,    76800, 0x1311ce7a
-0,         38,         38,        1,    76800, 0x6663e5ce
-0,         39,         39,        1,    76800, 0x597d0173
-0,         40,         40,        1,    76800, 0x936b1ab3
-0,         41,         41,        1,    76800, 0x860f2157
-0,         42,         42,        1,    76800, 0x69cd2ffd
-0,         43,         43,        1,    76800, 0xd0a24429
-0,         44,         44,        1,    76800, 0x6fbd49b3
-0,         45,         45,        1,    76800, 0x6e866211
-0,         46,         46,        1,    76800, 0x8ed9615d
-0,         47,         47,        1,    76800, 0x5ef45ab1
-0,         48,         48,        1,    76800, 0x72174a5d
-0,         49,         49,        1,    76800, 0x9e1346e1
-0,         50,         50,        1,    76800, 0xbe2046ef
-0,         51,         51,        1,    76800, 0x6417511d
-0,         52,         52,        1,    76800, 0xdc7d59d7
-0,         53,         53,        1,    76800, 0xea8f5569
-0,         54,         54,        1,    76800, 0x77b45d67
-0,         55,         55,        1,    76800, 0x949566bf
-0,         56,         56,        1,    76800, 0x644c6e39
-0,         57,         57,        1,    76800, 0xe8e47155
-0,         58,         58,        1,    76800, 0x84eb80d3
-0,         59,         59,        1,    76800, 0x6ade8f99
-0,         60,         60,        1,    76800, 0x1359adf5
-0,         61,         61,        1,    76800, 0x3b8ab849
-0,         62,         62,        1,    76800, 0xb761c9af
-0,         63,         63,        1,    76800, 0x89f0ccf5
-0,         64,         64,        1,    76800, 0xf50dc989
-0,         65,         65,        1,    76800, 0xc9e8c37f
-0,         66,         66,        1,    76800, 0x91b1c6fb
-0,         67,         67,        1,    76800, 0x30accc59
-0,         68,         68,        1,    76800, 0x4dbbd735
-0,         69,         69,        1,    76800, 0x06ece049
-0,         70,         70,        1,    76800, 0x9112ebef
-0,         71,         71,        1,    76800, 0x4b9af209
-0,         72,         72,        1,    76800, 0x1063f2d5
-0,         73,         73,        1,    76800, 0xc00ef0eb
-0,         74,         74,        1,    76800, 0xfc76efa1
-0,         75,         75,        1,    76800, 0xd85cff3b
-0,         76,         76,        1,    76800, 0x2dc9fc19
-0,         77,         77,        1,    76800, 0xe5610674
-0,         78,         78,        1,    76800, 0xdfa5fdb5
-0,         79,         79,        1,    76800, 0xb7eef1d9
-0,         80,         80,        1,    76800, 0x3743ed2b
-0,         81,         81,        1,    76800, 0xaaf6a11d
-0,         82,         82,        1,    76800, 0xbd3dba25
-0,         83,         83,        1,    76800, 0x0d5a84c2
-0,         84,         84,        1,    76800, 0x04d3cede
-0,         85,         85,        1,    76800, 0xd0ed078b
-0,         86,         86,        1,    76800, 0x712c4257
-0,         87,         87,        1,    76800, 0x0866f074
-0,         88,         88,        1,    76800, 0x7bcbd610
-0,         89,         89,        1,    76800, 0xcfb16193
-0,         90,         90,        1,    76800, 0x08b2bf53
-0,         91,         91,        1,    76800, 0x8a89d293
-0,         92,         92,        1,    76800, 0xdceb169e
-0,         93,         93,        1,    76800, 0x91b53522
-0,         94,         94,        1,    76800, 0xc6f36e86
-0,         95,         95,        1,    76800, 0x64849fae
-0,         96,         96,        1,    76800, 0x7f060705
-0,         97,         97,        1,    76800, 0x100c7c79
-0,         98,         98,        1,    76800, 0xe6d3df05
-0,         99,         99,        1,    76800, 0x3947f65d
-0,        100,        100,        1,    76800, 0xfe52d0e1
-0,        101,        101,        1,    76800, 0x5a81b935
-0,        102,        102,        1,    76800, 0x3dabcb31
-0,        103,        103,        1,    76800, 0x0ae6dea9
-0,        104,        104,        1,    76800, 0x214c2dec
-0,        105,        105,        1,    76800, 0xeb526560
-0,        106,        106,        1,    76800, 0xbb618418
-0,        107,        107,        1,    76800, 0x61d9cbd0
-0,        108,        108,        1,    76800, 0x9d2660bb
-0,        109,        109,        1,    76800, 0xf4f5dc33
-0,        110,        110,        1,    76800, 0xe2551ec2
-0,        111,        111,        1,    76800, 0x5f971e3a
-0,        112,        112,        1,    76800, 0xa96c0cea
-0,        113,        113,        1,    76800, 0xd904cdeb
-0,        114,        114,        1,    76800, 0x0443a227
-0,        115,        115,        1,    76800, 0xf3e92457
-0,        116,        116,        1,    76800, 0x2df4d5b0
-0,        117,        117,        1,    76800, 0x72d4b018
-0,        118,        118,        1,    76800, 0x260ac3dc
-0,        119,        119,        1,    76800, 0x30160163
-0,        120,        120,        1,    76800, 0x76c7656f
-0,        121,        121,        1,    76800, 0xdc42bb23
-0,        122,        122,        1,    76800, 0xdbab366a
-0,        123,        123,        1,    76800, 0xf998ae66
-0,        124,        124,        1,    76800, 0x3b6afb62
-0,        125,        125,        1,    76800, 0x3fb3f76e
-0,        126,        126,        1,    76800, 0xc4f4d89a
-0,        127,        127,        1,    76800, 0xf448aa5a
-0,        128,        128,        1,    76800, 0xf9fed3c2
-0,        129,        129,        1,    76800, 0x8e4526bd
-0,        130,        130,        1,    76800, 0xa4be7a39
-0,        131,        131,        1,    76800, 0x07d376b9
-0,        132,        132,        1,    76800, 0x47993f51
-0,        133,        133,        1,    76800, 0x2f5816ad
-0,        134,        134,        1,    76800, 0x0f78187d
-0,        135,        135,        1,    76800, 0x5129e47e
-0,        136,        136,        1,    76800, 0x1050b9e2
-0,        137,        137,        1,    76800, 0x5ba278d2
-0,        138,        138,        1,    76800, 0xc5f5278e
-0,        139,        139,        1,    76800, 0xe406e093
-0,        140,        140,        1,    76800, 0x1b03c34f
-0,        141,        141,        1,    76800, 0xaad8b463
-0,        142,        142,        1,    76800, 0x4f90ad0d
-0,        143,        143,        1,    76800, 0x83a1b8b3
-0,        144,        144,        1,    76800, 0x682ccba1
-0,        145,        145,        1,    76800, 0xf44f0d22
-0,        146,        146,        1,    76800, 0x19c02d14
-0,        147,        147,        1,    76800, 0x01148baa
-0,        148,        148,        1,    76800, 0xff45dfbe
-0,        149,        149,        1,    76800, 0x05f8db6e
-0,        150,        150,        1,    76800, 0x9a129a6e
-0,        151,        151,        1,    76800, 0x93f8749e
-0,        152,        152,        1,    76800, 0x7dd1f89b
-0,        153,        153,        1,    76800, 0x3c81b16f
-0,        154,        154,        1,    76800, 0xefc3e567
-0,        155,        155,        1,    76800, 0x9fe26222
-0,        156,        156,        1,    76800, 0x85018ef4
-0,        157,        157,        1,    76800, 0x0aa984a4
-0,        158,        158,        1,    76800, 0xea45538e
-0,        159,        159,        1,    76800, 0x8e112454
-0,        160,        160,        1,    76800, 0xab76bf13
-0,        161,        161,        1,    76800, 0x9c1e32a1
-0,        162,        162,        1,    76800, 0xedb88ef8
-0,        163,        163,        1,    76800, 0x5371d475
-0,        164,        164,        1,    76800, 0x631a36eb
-0,        165,        165,        1,    76800, 0x6d4403ef
-0,        166,        166,        1,    76800, 0xdd67190b
-0,        167,        167,        1,    76800, 0x41b054a5
-0,        168,        168,        1,    76800, 0x53f55a99
-0,        169,        169,        1,    76800, 0x93182147
-0,        170,        170,        1,    76800, 0xcce0dd8c
-0,        171,        171,        1,    76800, 0x51f68932
-0,        172,        172,        1,    76800, 0x3d5e2f4a
-0,        173,        173,        1,    76800, 0x8baed3b3
-0,        174,        174,        1,    76800, 0xdc66509b
-0,        175,        175,        1,    76800, 0x1b81fb6c
-0,        176,        176,        1,    76800, 0x63e1f954
-0,        177,        177,        1,    76800, 0x75fd36a1
-0,        178,        178,        1,    76800, 0x68f1a18f
-0,        179,        179,        1,    76800, 0x8b0a1c76
-0,        180,        180,        1,    76800, 0x6d7b9810
-0,        181,        181,        1,    76800, 0x5dcdee4a
-0,        182,        182,        1,    76800, 0xf97c2187
-0,        183,        183,        1,    76800, 0x3e575d0d
-0,        184,        184,        1,    76800, 0x4fc6a723
-0,        185,        185,        1,    76800, 0xf5dcde6d
-0,        186,        186,        1,    76800, 0xc42204d2
-0,        187,        187,        1,    76800, 0x12cff747
-0,        188,        188,        1,    76800, 0xa11ae405
-0,        189,        189,        1,    76800, 0x7cd8d07f
-0,        190,        190,        1,    76800, 0xa100a8fb
-0,        191,        191,        1,    76800, 0x7e9e945b
-0,        192,        192,        1,    76800, 0x2ead8009
-0,        193,        193,        1,    76800, 0x755a7399
-0,        194,        194,        1,    76800, 0x25324c65
-0,        195,        195,        1,    76800, 0xe12ad1a4
-0,        196,        196,        1,    76800, 0x02366ec8
-0,        197,        197,        1,    76800, 0x1e8f0d5a
-0,        198,        198,        1,    76800, 0x0235d45b
-0,        199,        199,        1,    76800, 0x26d2b581
-0,        200,        200,        1,    76800, 0x304f1ccb
-0,        201,        201,        1,    76800, 0x4e1625ff
-0,        202,        202,        1,    76800, 0xfecc1f5b
-0,        203,        203,        1,    76800, 0x499714ff
-0,        204,        204,        1,    76800, 0xff240d1b
-0,        205,        205,        1,    76800, 0xc257ebf8
-0,        206,        206,        1,    76800, 0xf752cdfc
-0,        207,        207,        1,    76800, 0xb031b7cc
-0,        208,        208,        1,    76800, 0xb3f29c84
-0,        209,        209,        1,    76800, 0x77f66fd4
-0,        210,        210,        1,    76800, 0x9ef247ec
-0,        211,        211,        1,    76800, 0xdc32180c
-0,        212,        212,        1,    76800, 0x41bed8e5
-0,        213,        213,        1,    76800, 0x931b8b05
-0,        214,        214,        1,    76800, 0xe45b36f9
-0,        215,        215,        1,    76800, 0xc71bd626
-0,        216,        216,        1,    76800, 0x5b637aca
-0,        217,        217,        1,    76800, 0x3e8d1752
-0,        218,        218,        1,    76800, 0x5f9ca28b
-0,        219,        219,        1,    76800, 0x56d937bf
-0,        220,        220,        1,    76800, 0xe811c010
-0,        221,        221,        1,    76800, 0xca414fe8
-0,        222,        222,        1,    76800, 0x774ef141
-0,        223,        223,        1,    76800, 0xa44282f9
-0,        224,        224,        1,    76800, 0x30690641
-0,        225,        225,        1,    76800, 0xa833ad96
-0,        226,        226,        1,    76800, 0xe18d4932
-0,        227,        227,        1,    76800, 0xf934c0af
-0,        228,        228,        1,    76800, 0xdbc361b7
-0,        229,        229,        1,    76800, 0x7e0d0077
-0,        230,        230,        1,    76800, 0x2d3faaa4
-0,        231,        231,        1,    76800, 0xfa1a7708
-0,        232,        232,        1,    76800, 0xb60870a0
-0,        233,        233,        1,    76800, 0x5f5f7682
-0,        234,        234,        1,    76800, 0x47dc7564
-0,        235,        235,        1,    76800, 0x48f984c8
-0,        236,        236,        1,    76800, 0x7b0892a8
-0,        237,        237,        1,    76800, 0x56a0c014
-0,        238,        238,        1,    76800, 0x5dd1d854
-0,        239,        239,        1,    76800, 0xdfb0f698
-0,        240,        240,        1,    76800, 0xda051775
-0,        241,        241,        1,    76800, 0xa19c3eb1
-0,        242,        242,        1,    76800, 0xda74780d
-0,        243,        243,        1,    76800, 0x5dd28f7f
-0,        244,        244,        1,    76800, 0xf23fa74b
-0,        245,        245,        1,    76800, 0x4014c817
-0,        246,        246,        1,    76800, 0x0954ead7
-0,        247,        247,        1,    76800, 0xa8e319fe
-0,        248,        248,        1,    76800, 0x722e3f2c
-0,        249,        249,        1,    76800, 0xbee3702c
-0,        250,        250,        1,    76800, 0x19599172
-0,        251,        251,        1,    76800, 0x61c18ef0
-0,        252,        252,        1,    76800, 0xfb13780e
-0,        253,        253,        1,    76800, 0xd86e6b80
-0,        254,        254,        1,    76800, 0xf5cc6abc
-0,        255,        255,        1,    76800, 0x5fe86912
-0,        256,        256,        1,    76800, 0xba3d6efe
-0,        257,        257,        1,    76800, 0x23927f3e
-0,        258,        258,        1,    76800, 0x6947b124
-0,        259,        259,        1,    76800, 0x80e9f682
-0,        260,        260,        1,    76800, 0x6a393a9b
-0,        261,        261,        1,    76800, 0x5aff928b
-0,        262,        262,        1,    76800, 0xd81dfbab
-0,        263,        263,        1,    76800, 0x950166ca
-0,        264,        264,        1,    76800, 0xc7e6c6f0
-0,        265,        265,        1,    76800, 0x9aa328a1
-0,        266,        266,        1,    76800, 0x17de849b
-0,        267,        267,        1,    76800, 0xc4f7d9e3
-0,        268,        268,        1,    76800, 0x3f372bee
-0,        269,        269,        1,    76800, 0xaffc6e06
-0,        270,        270,        1,    76800, 0x94b8875c
-0,        271,        271,        1,    76800, 0xb713a42a
-0,        272,        272,        1,    76800, 0x8a89c232
-0,        273,        273,        1,    76800, 0xde65db42
-0,        274,        274,        1,    76800, 0x2c7dfaac
-0,        275,        275,        1,    76800, 0xa9202a71
-0,        276,        276,        1,    76800, 0x78715817
-0,        277,        277,        1,    76800, 0x3c0d8bb9
-0,        278,        278,        1,    76800, 0xa4cdbb61
-0,        279,        279,        1,    76800, 0xb9abd6ad
-0,        280,        280,        1,    76800, 0xecef0146
-0,        281,        281,        1,    76800, 0x82f22350
-0,        282,        282,        1,    76800, 0x17f442f2
-0,        283,        283,        1,    76800, 0xa6ea59e4
-0,        284,        284,        1,    76800, 0x62e452e6
-0,        285,        285,        1,    76800, 0xce2c454e
-0,        286,        286,        1,    76800, 0x27a821b4
-0,        287,        287,        1,    76800, 0x899f0f98
-0,        288,        288,        1,    76800, 0xe25dffb7
-0,        289,        289,        1,    76800, 0xa288ff17
-0,        290,        290,        1,    76800, 0x678500b0
-0,        291,        291,        1,    76800, 0xfe9c1216
-0,        292,        292,        1,    76800, 0x56da27a0
-0,        293,        293,        1,    76800, 0x62f239be
-0,        294,        294,        1,    76800, 0xa0a74b90
-0,        295,        295,        1,    76800, 0xc2f969a0
-0,        296,        296,        1,    76800, 0xe1ca7ad4
-0,        297,        297,        1,    76800, 0xf7938a7e
-0,        298,        298,        1,    76800, 0x3a339640
-0,        299,        299,        1,    76800, 0x44b79e0c
-0,        300,        300,        1,    76800, 0xd6e78ee6
-0,        301,        301,        1,    76800, 0xeecd91b6
-0,        302,        302,        1,    76800, 0x3ea99774
-0,        303,        303,        1,    76800, 0xd399967e
-0,        304,        304,        1,    76800, 0xc1e38de6
-0,        305,        305,        1,    76800, 0xd8ec7958
-0,        306,        306,        1,    76800, 0xe9e26992
-0,        307,        307,        1,    76800, 0xb6ee580a
-0,        308,        308,        1,    76800, 0xd56852f4
-0,        309,        309,        1,    76800, 0x997f4b9c
-0,        310,        310,        1,    76800, 0xc62841a6
-0,        311,        311,        1,    76800, 0x58063cee
-0,        312,        312,        1,    76800, 0xbaaf3e16
-0,        313,        313,        1,    76800, 0xac043a50
-0,        314,        314,        1,    76800, 0xa6c73a14
-0,        315,        315,        1,    76800, 0x1d614480
-0,        316,        316,        1,    76800, 0xc4e63b4c
-0,        317,        317,        1,    76800, 0x9d393b06
-0,        318,        318,        1,    76800, 0x9a902ef4
-0,        319,        319,        1,    76800, 0x6f872c74
-0,        320,        320,        1,    76800, 0x288a2f92
-0,        321,        321,        1,    76800, 0xb4832d76
-0,        322,        322,        1,    76800, 0x99e21c30
-0,        323,        323,        1,    76800, 0x287f0c90
-0,        324,        324,        1,    76800, 0xfd8bfe3f
-0,        325,        325,        1,    76800, 0x0a62f1d3
-0,        326,        326,        1,    76800, 0x2928eb4d
-0,        327,        327,        1,    76800, 0x2acfe487
-0,        328,        328,        1,    76800, 0x2b2ce339
-0,        329,        329,        1,    76800, 0x25d2e4c5
-0,        330,        330,        1,    76800, 0x0c14dd95
-0,        331,        331,        1,    76800, 0xfe8fdf29
-0,        332,        332,        1,    76800, 0x3afedd29
-0,        333,        333,        1,    76800, 0x3c85dd05
-0,        334,        334,        1,    76800, 0x9981db4d
-0,        335,        335,        1,    76800, 0xc4f9d501
-0,        336,        336,        1,    76800, 0xccd4d2d5
-0,        337,        337,        1,    76800, 0x229fdc41
-0,        338,        338,        1,    76800, 0x305de4ad
-0,        339,        339,        1,    76800, 0xb40eaef6
-0,        340,        340,        1,    76800, 0xb14f0431
-0,        341,        341,        1,    76800, 0x346b9280
-0,        342,        342,        1,    76800, 0x9198b4c0
-0,        343,        343,        1,    76800, 0xba1fde8f
-0,        344,        344,        1,    76800, 0x45260fa2
-0,        345,        345,        1,    76800, 0x69dd33cb
-0,        346,        346,        1,    76800, 0x6e10c599
-0,        347,        347,        1,    76800, 0x9dd33a40
-0,        348,        348,        1,    76800, 0x9dc7eb47
-0,        349,        349,        1,    76800, 0x8776f7df
-0,        350,        350,        1,    76800, 0xfd674e91
-0,        351,        351,        1,    76800, 0xcd69d151
-0,        352,        352,        1,    76800, 0xa8f69f9e
-0,        353,        353,        1,    76800, 0xf83587a2
-0,        354,        354,        1,    76800, 0xcb656e2a
-0,        355,        355,        1,    76800, 0x8c5e6b82
-0,        356,        356,        1,    76800, 0x880d5f56
-0,        357,        357,        1,    76800, 0x93405cce
-0,        358,        358,        1,    76800, 0x51345c1e
diff --git a/deps/libav/tests/ref/fate/auravision-v1 b/deps/libav/tests/ref/fate/auravision-v1
deleted file mode 100644
index 456f399..0000000
--- a/deps/libav/tests/ref/fate/auravision-v1
+++ /dev/null
@@ -1,25 +0,0 @@
-#tb 0: 33339/500000
-0,          0,          0,        1,    28800, 0x4a4efbbc
-0,          1,          1,        1,    28800, 0xc6c7e26a
-0,          2,          2,        1,    28800, 0x6cd40913
-0,          3,          3,        1,    28800, 0xa7b40fe9
-0,          4,          4,        1,    28800, 0x5e77fcc6
-0,          5,          5,        1,    28800, 0x9b3ef3f0
-0,          6,          6,        1,    28800, 0xe7031845
-0,          7,          7,        1,    28800, 0x2c15458d
-0,          8,          8,        1,    28800, 0xbc3d4abf
-0,          9,          9,        1,    28800, 0xf8755ac7
-0,         10,         10,        1,    28800, 0x64d0405b
-0,         11,         11,        1,    28800, 0x1e0c341d
-0,         12,         12,        1,    28800, 0x05ca3c2b
-0,         13,         13,        1,    28800, 0x28cb307f
-0,         14,         14,        1,    28800, 0x3a9855af
-0,         15,         15,        1,    28800, 0x92b63321
-0,         16,         16,        1,    28800, 0x85585151
-0,         17,         17,        1,    28800, 0x1ff01bf9
-0,         18,         18,        1,    28800, 0x4bab200f
-0,         19,         19,        1,    28800, 0xcf732ad7
-0,         20,         20,        1,    28800, 0xced00cff
-0,         21,         21,        1,    28800, 0xa69046fd
-0,         22,         22,        1,    28800, 0x5aa341c3
-0,         23,         23,        1,    28800, 0x87ef6219
diff --git a/deps/libav/tests/ref/fate/auravision-v2 b/deps/libav/tests/ref/fate/auravision-v2
deleted file mode 100644
index f1e8e3a..0000000
--- a/deps/libav/tests/ref/fate/auravision-v2
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 33333/1000000
-0,          0,          0,        1,   115200, 0x2f247f66
-0,          1,          1,        1,   115200, 0xf492929e
diff --git a/deps/libav/tests/ref/fate/avstring b/deps/libav/tests/ref/fate/avstring
deleted file mode 100644
index bc231e8..0000000
--- a/deps/libav/tests/ref/fate/avstring
+++ /dev/null
@@ -1,27 +0,0 @@
-Testing av_get_token()
-|''| -> || + ||
-|| -> || + ||
-|:| -> || + |:|
-|\| -> |\| + ||
-|'| -> || + ||
-|    ''    :| -> || + |:|
-|    ''  ''  :| -> |  | + |:|
-|foo   '' :| -> |foo   | + |:|
-|'foo'| -> |foo| + ||
-|foo     | -> |foo| + ||
-|  '  foo  '  | -> |  foo  | + ||
-|foo\| -> |foo\| + ||
-|foo':  blah:blah| -> |foo:  blah:blah| + ||
-|foo\:  blah:blah| -> |foo:  blah| + |:blah|
-|foo'| -> |foo| + ||
-|'foo :  '  :blahblah| -> |foo :  | + |:blahblah|
-|\ :blah| -> | | + |:blah|
-|     foo| -> |foo| + ||
-|      foo       | -> |foo| + ||
-|      foo     \ | -> |foo      | + ||
-|foo ':blah| -> |foo :blah| + ||
-| foo   bar    :   blahblah| -> |foo   bar| + |:   blahblah|
-|\f\o\o| -> |foo| + ||
-|'foo : \ \  '   : blahblah| -> |foo : \ \  | + |: blahblah|
-|'\fo\o:': blahblah| -> |\fo\o:| + |: blahblah|
-|\'fo\o\:':  foo  '  :blahblah| -> |'foo::  foo  | + |:blahblah|
diff --git a/deps/libav/tests/ref/fate/base64 b/deps/libav/tests/ref/fate/base64
deleted file mode 100644
index 24fa9ad..0000000
--- a/deps/libav/tests/ref/fate/base64
+++ /dev/null
@@ -1,9 +0,0 @@
-Encoding/decoding tests
-Passed!
-Passed!
-Passed!
-Passed!
-Passed!
-Passed!
-Passed!
-Passed!
diff --git a/deps/libav/tests/ref/fate/bethsoft-vid b/deps/libav/tests/ref/fate/bethsoft-vid
deleted file mode 100644
index 535888b..0000000
--- a/deps/libav/tests/ref/fate/bethsoft-vid
+++ /dev/null
@@ -1,143 +0,0 @@
-#tb 0: 185/11111
-#tb 1: 1/11111
-0,          0,          0,        1,   192000, 0x00000000
-1,          0,          0,      740,     1480, 0x00000000
-0,          4,          4,        1,   192000, 0x01a6cf45
-1,        740,        740,      740,     1480, 0x20a92bd4
-0,          8,          8,        1,   192000, 0xd07d57e9
-1,       1480,       1480,      925,     1850, 0xa9e48a74
-0,         13,         13,        1,   192000, 0x3cb1dff5
-1,       2405,       2405,      740,     1480, 0x23ecd018
-0,         17,         17,        1,   192000, 0xd1aaa8fb
-1,       3145,       3145,      740,     1480, 0x206bb915
-0,         21,         21,        1,   192000, 0x75f526cd
-1,       3885,       3885,      925,     1850, 0xb0e10e75
-0,         26,         26,        1,   192000, 0x0f673577
-1,       4810,       4810,      740,     1480, 0x8d9baedd
-0,         30,         30,        1,   192000, 0x897b6781
-1,       5550,       5550,      740,     1480, 0xb802aae1
-0,         34,         34,        1,   192000, 0x81e6b7f7
-1,       6290,       6290,      740,     1480, 0xecd7b5cc
-0,         38,         38,        1,   192000, 0x1f45ce61
-1,       7030,       7030,      925,     1850, 0x16861355
-0,         43,         43,        1,   192000, 0x5a0772a6
-1,       7955,       7955,      740,     1480, 0xa51690bd
-0,         47,         47,        1,   192000, 0xf78732b3
-1,       8695,       8695,      740,     1480, 0xdd0b90d1
-0,         51,         51,        1,   192000, 0x8427f9e5
-1,       9435,       9435,      925,     1850, 0x3ce6e333
-0,         56,         56,        1,   192000, 0x40473f11
-1,      10360,      10360,      740,     1480, 0xf8ce8ea3
-0,         60,         60,        1,   192000, 0x173ceebe
-1,      11100,      11100,      740,     1480, 0xda4597af
-0,         64,         64,        1,   192000, 0x136b9516
-1,      11840,      11840,      740,     1480, 0x918f7cb3
-0,         68,         68,        1,   192000, 0x138d11ae
-1,      12580,      12580,      925,     1850, 0xca6edb15
-0,         73,         73,        1,   192000, 0x063dbff3
-1,      13505,      13505,      740,     1480, 0xba279597
-0,         77,         77,        1,   192000, 0x5280852f
-1,      14245,      14245,      740,     1480, 0xc5a38a9e
-0,         81,         81,        1,   192000, 0x99943a8f
-1,      14985,      14985,      925,     1850, 0x8147eef5
-0,         86,         86,        1,   192000, 0x0330a728
-1,      15910,      15910,      740,     1480, 0xce2c7cb5
-0,         90,         90,        1,   192000, 0x5d35467d
-1,      16650,      16650,      740,     1480, 0x4282819f
-0,         94,         94,        1,   192000, 0xfd436343
-1,      17390,      17390,      740,     1480, 0xbdbb8da6
-0,         98,         98,        1,   192000, 0xc323fcfe
-1,      18130,      18130,      925,     1850, 0xdbbeea10
-0,        103,        103,        1,   192000, 0x2a1530a0
-1,      19055,      19055,      740,     1480, 0xbe6a77c2
-0,        107,        107,        1,   192000, 0xbd43bb60
-1,      19795,      19795,      740,     1480, 0xa85c75b2
-0,        111,        111,        1,   192000, 0xa47f5eab
-1,      20535,      20535,      925,     1850, 0xa45bde21
-0,        116,        116,        1,   192000, 0xff17f5f7
-1,      21460,      21460,      740,     1480, 0x84aa7895
-0,        120,        120,        1,   192000, 0xb4140b55
-1,      22200,      22200,      740,     1480, 0x147f7d9f
-0,        124,        124,        1,   192000, 0xb8782cc4
-1,      22940,      22940,      740,     1480, 0xc8e77b85
-0,        128,        128,        1,   192000, 0x92975b8b
-1,      23680,      23680,      925,     1850, 0x10d4d81b
-0,        133,        133,        1,   192000, 0xf42a64d6
-1,      24605,      24605,      740,     1480, 0xb4ae8bb1
-0,        137,        137,        1,   192000, 0x2cc7077d
-1,      25345,      25345,      740,     1480, 0x3ef782a5
-0,        141,        141,        1,   192000, 0x00080cc8
-1,      26085,      26085,      925,     1850, 0xdeebda14
-0,        146,        146,        1,   192000, 0x584b48f3
-1,      27010,      27010,      740,     1480, 0x4c7e7bbb
-0,        150,        150,        1,   192000, 0xd68f57da
-1,      27750,      27750,      740,     1480, 0x0e0e9198
-0,        154,        154,        1,   192000, 0x60158422
-1,      28490,      28490,      740,     1480, 0x5c1f819f
-0,        158,        158,        1,   192000, 0xd7fb89e6
-1,      29230,      29230,      925,     1850, 0x0e4cf6ff
-0,        163,        163,        1,   192000, 0x97f1c76a
-1,      30155,      30155,      740,     1480, 0x374388a7
-0,        167,        167,        1,   192000, 0x46c4bb9e
-1,      30895,      30895,      740,     1480, 0xed729389
-0,        171,        171,        1,   192000, 0xd32f9b66
-1,      31635,      31635,      925,     1850, 0xe0f1e43f
-0,        176,        176,        1,   192000, 0x74f43886
-1,      32560,      32560,      740,     1480, 0x3b27839a
-0,        180,        180,        1,   192000, 0x3c4e47df
-1,      33300,      33300,      740,     1480, 0xe6287e94
-0,        184,        184,        1,   192000, 0xb5ac0a58
-1,      34040,      34040,      740,     1480, 0x7e0d84b5
-0,        188,        188,        1,   192000, 0xcc572b31
-1,      34780,      34780,      925,     1850, 0xf08bebf7
-0,        193,        193,        1,   192000, 0xb1739d26
-1,      35705,      35705,      740,     1480, 0x94cf73a0
-0,        197,        197,        1,   192000, 0x73da5473
-1,      36445,      36445,      740,     1480, 0xfef384ae
-0,        201,        201,        1,   192000, 0x5f79f5bc
-1,      37185,      37185,      925,     1850, 0x3b93e0f7
-0,        206,        206,        1,   192000, 0x0affc0a0
-1,      38110,      38110,      740,     1480, 0x28d27bae
-0,        210,        210,        1,   192000, 0x2b4d5c1c
-1,      38850,      38850,      740,     1480, 0x94d57da5
-0,        214,        214,        1,   192000, 0x309b41bc
-1,      39590,      39590,      740,     1480, 0xc9327db5
-0,        218,        218,        1,   192000, 0xd42b6424
-1,      40330,      40330,      925,     1850, 0xe781f604
-0,        223,        223,        1,   192000, 0x4795c948
-1,      41255,      41255,      740,     1480, 0x752f8c5b
-0,        227,        227,        1,   192000, 0xbc1a3a8b
-1,      41995,      41995,      740,     1480, 0x30068032
-0,        231,        231,        1,   192000, 0x16529c5b
-1,      42735,      42735,      925,     1850, 0x7895023e
-0,        236,        236,        1,   192000, 0x6b1b31ba
-1,      43660,      43660,      740,     1480, 0xa1e0a6e1
-0,        240,        240,        1,   192000, 0x569182ce
-1,      44400,      44400,      740,     1480, 0x6af4b500
-0,        244,        244,        1,   192000, 0xe6ea9866
-1,      45140,      45140,      740,     1480, 0xc26ea4c7
-0,        248,        248,        1,   192000, 0x102c6076
-1,      45880,      45880,      925,     1850, 0x16a72419
-0,        253,        253,        1,   192000, 0xb29f527a
-1,      46805,      46805,      740,     1480, 0x1794aacc
-0,        257,        257,        1,   192000, 0x040b4eee
-1,      47545,      47545,      740,     1480, 0x2ecad8d0
-0,        261,        261,        1,   192000, 0x92574f4a
-1,      48285,      48285,      925,     1850, 0x2e645e07
-0,        266,        266,        1,   192000, 0x1e8acdce
-1,      49210,      49210,      740,     1480, 0x1c54dfe7
-0,        270,        270,        1,   192000, 0x1becf516
-1,      49950,      49950,      740,     1480, 0xbd35feec
-0,        274,        274,        1,   192000, 0xb62e9776
-1,      50690,      50690,      740,     1480, 0x419403d6
-0,        278,        278,        1,   192000, 0xed37a08e
-1,      51430,      51430,      925,     1850, 0x78699d2a
-0,        283,        283,        1,   192000, 0xc0719912
-1,      52355,      52355,      740,     1480, 0x74ec68e0
-0,        287,        287,        1,   192000, 0x24cf7a7e
-1,      53095,      53095,      740,     1480, 0x76af64d9
-0,        291,        291,        1,   192000, 0x0307f62f
-1,      53835,      53835,      925,     1850, 0x5a303d1a
-0,        296,        296,        1,   192000, 0x79b7417b
-1,      54760,      54760,      537,     1074, 0x142ce7ba
-1,      55297,      55297,      258,      516, 0x98885b26
diff --git a/deps/libav/tests/ref/fate/bfi b/deps/libav/tests/ref/fate/bfi
deleted file mode 100644
index 0d3d8f2..0000000
--- a/deps/libav/tests/ref/fate/bfi
+++ /dev/null
@@ -1,116 +0,0 @@
-#tb 0: 1/9
-#tb 1: 1/11025
-0,          0,          0,        1,   134400, 0xc218b00c
-1,          0,          0,     8884,    17768, 0x07df135c
-0,          1,          1,        1,   134400, 0x114daf7c
-0,          2,          2,        1,   134400, 0xe14db24c
-0,          3,          3,        1,   134400, 0x88c71df7
-0,          4,          4,        1,   134400, 0xc98c09fc
-0,          5,          5,        1,   134400, 0xf7c2e7a9
-0,          6,          6,        1,   134400, 0xf54f304f
-0,          7,          7,        1,   134400, 0x67370fdd
-1,       8884,       8884,     1110,     2220, 0x44953646
-0,          8,          8,        1,   134400, 0xe70f43cd
-1,       9994,       9994,     1110,     2220, 0x256b3329
-0,          9,          9,        1,   134400, 0xad74c06f
-1,      11104,      11104,     1111,     2222, 0x344d20c6
-1,      12215,      12215,     1110,     2220, 0xd8ee20db
-0,         10,         10,        1,   134400, 0xef42fdf2
-1,      13325,      13325,     1111,     2222, 0x46d70aa2
-0,         11,         11,        1,   134400, 0xa14cc4b8
-1,      14436,      14436,     1110,     2220, 0xbe0a2213
-0,         12,         12,        1,   134400, 0xc6e57381
-1,      15546,      15546,     1111,     2222, 0x4ee0fd07
-0,         13,         13,        1,   134400, 0x74b4804b
-1,      16657,      16657,     1110,     2220, 0x709dfe87
-0,         14,         14,        1,   134400, 0xe0863d6f
-1,      17767,      17767,     1111,     2222, 0xbb382521
-0,         15,         15,        1,   134400, 0x90b6d03c
-1,      18878,      18878,     1110,     2220, 0x6dba1d2d
-0,         16,         16,        1,   134400, 0x3d0409fd
-1,      19988,      19988,     1111,     2222, 0xbc4cdd6d
-0,         17,         17,        1,   134400, 0xc02e09a4
-1,      21099,      21099,     1110,     2220, 0x54340d2c
-0,         18,         18,        1,   134400, 0xa3515997
-1,      22209,      22209,     1110,     2220, 0x8925d335
-0,         19,         19,        1,   134400, 0xc0fda122
-1,      23319,      23319,     1111,     2222, 0xa39bd15f
-1,      24430,      24430,     1110,     2220, 0x6875f632
-0,         20,         20,        1,   134400, 0x5380d707
-1,      25540,      25540,     1111,     2222, 0xda46be57
-0,         21,         21,        1,   134400, 0xcc19c085
-1,      26651,      26651,     1110,     2220, 0xd591eb44
-0,         22,         22,        1,   134400, 0x8041e977
-1,      27761,      27761,     1111,     2222, 0x33afd17f
-0,         23,         23,        1,   134400, 0xb96b2bea
-1,      28872,      28872,     1110,     2220, 0xd97be03b
-0,         24,         24,        1,   134400, 0xcc977ca7
-1,      29982,      29982,     1111,     2222, 0x3b71e82e
-0,         25,         25,        1,   134400, 0xe37abb34
-1,      31093,      31093,     1110,     2220, 0x95fbec2b
-0,         26,         26,        1,   134400, 0xce488baa
-1,      32203,      32203,     1110,     2220, 0xae3a1c1e
-0,         27,         27,        1,   134400, 0xa0734e8a
-1,      33313,      33313,     1111,     2222, 0x46cd0973
-0,         28,         28,        1,   134400, 0x6b5ce0b0
-1,      34424,      34424,     1110,     2220, 0x7b28f3f6
-0,         29,         29,        1,   134400, 0xf207f938
-1,      35534,      35534,     1111,     2222, 0xa2a5bc47
-1,      36645,      36645,     1110,     2220, 0x4727df63
-0,         30,         30,        1,   134400, 0xe10060f8
-1,      37755,      37755,     1111,     2222, 0xdf53f4e2
-0,         31,         31,        1,   134400, 0xaebe6b37
-1,      38866,      38866,     1110,     2220, 0x469c1e8f
-0,         32,         32,        1,   134400, 0x08ea5c75
-1,      39976,      39976,     1111,     2222, 0x3c541799
-0,         33,         33,        1,   134400, 0x05c6b514
-1,      41087,      41087,     1110,     2220, 0xc8d21fee
-0,         34,         34,        1,   134400, 0x68cb3703
-1,      42197,      42197,     1111,     2222, 0x5f52126f
-0,         35,         35,        1,   134400, 0x48867fd0
-1,      43308,      43308,     1110,     2220, 0x06a9ff18
-0,         36,         36,        1,   134400, 0xc53eda30
-1,      44418,      44418,     1110,     2220, 0x84f9aa2b
-0,         37,         37,        1,   134400, 0x0c1b198d
-1,      45528,      45528,     1111,     2222, 0xe0518c83
-0,         38,         38,        1,   134400, 0xc8ac5bc8
-1,      46639,      46639,     1110,     2220, 0xc85ee26c
-1,      47749,      47749,     1111,     2222, 0xda23fd2d
-0,         39,         39,        1,   134400, 0x9e35240d
-1,      48860,      48860,     1110,     2220, 0x7ee2e818
-0,         40,         40,        1,   134400, 0x885d142f
-1,      49970,      49970,     1111,     2222, 0x45eb0465
-0,         41,         41,        1,   134400, 0x207cb4ac
-1,      51081,      51081,     1110,     2220, 0xf3e90549
-0,         42,         42,        1,   134400, 0x0abe748b
-1,      52191,      52191,     1111,     2222, 0x17aacf3d
-0,         43,         43,        1,   134400, 0xf13e991b
-1,      53302,      53302,     1110,     2220, 0x6cb7e325
-0,         44,         44,        1,   134400, 0x2544248d
-1,      54412,      54412,     1110,     2220, 0x20164553
-0,         45,         45,        1,   134400, 0x5444bb22
-1,      55522,      55522,     1111,     2222, 0x00000000
-0,         46,         46,        1,   134400, 0xc5a8f55a
-1,      56633,      56633,     1110,     2220, 0x00000000
-0,         47,         47,        1,   134400, 0xe6006820
-1,      57743,      57743,     1111,     2222, 0x00000000
-0,         48,         48,        1,   134400, 0x2a34239d
-1,      58854,      58854,     1110,     2220, 0x00000000
-1,      59964,      59964,     1111,     2222, 0x00000000
-0,         49,         49,        1,   134400, 0x26deac5b
-1,      61075,      61075,     1110,     2220, 0x00000000
-0,         50,         50,        1,   134400, 0x82c2c0a9
-1,      62185,      62185,     1111,     2222, 0x00000000
-0,         51,         51,        1,   134400, 0xcdd8daba
-1,      63296,      63296,     1225,     2450, 0x00000000
-0,         52,         52,        1,   134400, 0x5a1a2105
-1,      64521,      64521,     1225,     2450, 0x00000000
-0,         53,         53,        1,   134400, 0x2ad43604
-1,      65746,      65746,     1225,     2450, 0x00000000
-0,         54,         54,        1,   134400, 0xa9b58f35
-1,      66971,      66971,     1225,     2450, 0x00000000
-0,         55,         55,        1,   134400, 0x0e37a7a8
-1,      68196,      68196,     1225,     2450, 0x00000000
-0,         56,         56,        1,   134400, 0xd288eef7
-1,      69421,      69421,     1225,     2450, 0x00000000
-1,      70646,      70646,     1225,     2450, 0x00000000
diff --git a/deps/libav/tests/ref/fate/bink-demux b/deps/libav/tests/ref/fate/bink-demux
deleted file mode 100644
index b721f0d..0000000
--- a/deps/libav/tests/ref/fate/bink-demux
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x839f34e6
diff --git a/deps/libav/tests/ref/fate/bink-video-b b/deps/libav/tests/ref/fate/bink-video-b
deleted file mode 100644
index c772eda..0000000
--- a/deps/libav/tests/ref/fate/bink-video-b
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,    34800, 0x4fd0a8e4
-0,          1,          1,        1,    34800, 0xd381a7b7
-0,          2,          2,        1,    34800, 0x688ca315
-0,          3,          3,        1,    34800, 0xaae39c3f
-0,          4,          4,        1,    34800, 0xdcb19759
-0,          5,          5,        1,    34800, 0xd458970a
-0,          6,          6,        1,    34800, 0x99269865
-0,          7,          7,        1,    34800, 0x6d459bbc
-0,          8,          8,        1,    34800, 0x6c759cd2
-0,          9,          9,        1,    34800, 0x47459ad5
-0,         10,         10,        1,    34800, 0xe6e897b9
-0,         11,         11,        1,    34800, 0x63599374
-0,         12,         12,        1,    34800, 0x666191e2
-0,         13,         13,        1,    34800, 0x4ca8933e
-0,         14,         14,        1,    34800, 0xbea594f4
-0,         15,         15,        1,    34800, 0xa5609473
-0,         16,         16,        1,    34800, 0xe5d79234
-0,         17,         17,        1,    34800, 0xf7738e58
-0,         18,         18,        1,    34800, 0x9d0c8b24
-0,         19,         19,        1,    34800, 0x0b2d8a66
-0,         20,         20,        1,    34800, 0xf4698b72
-0,         21,         21,        1,    34800, 0xdf808d44
-0,         22,         22,        1,    34800, 0xae6b895e
-0,         23,         23,        1,    34800, 0xa67b8144
-0,         24,         24,        1,    34800, 0xc54d79c4
-0,         25,         25,        1,    34800, 0x75ca72e2
-0,         26,         26,        1,    34800, 0xc6a56f65
-0,         27,         27,        1,    34800, 0x406e740d
-0,         28,         28,        1,    34800, 0xd29478de
-0,         29,         29,        1,    34800, 0x22cf7dc2
diff --git a/deps/libav/tests/ref/fate/bink-video-f b/deps/libav/tests/ref/fate/bink-video-f
deleted file mode 100644
index 40bc5a9..0000000
--- a/deps/libav/tests/ref/fate/bink-video-f
+++ /dev/null
@@ -1,21 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,   460800, 0xb06f7841
-0,          1,          1,        1,   460800, 0x7ed06412
-0,          2,          2,        1,   460800, 0xe82b5c3d
-0,          3,          3,        1,   460800, 0x67284940
-0,          4,          4,        1,   460800, 0x17e2c544
-0,          5,          5,        1,   460800, 0x5dc65d36
-0,          6,          6,        1,   460800, 0x7de63f90
-0,          7,          7,        1,   460800, 0x15c8cf7d
-0,          8,          8,        1,   460800, 0xbffe4047
-0,          9,          9,        1,   460800, 0xcabcc150
-0,         10,         10,        1,   460800, 0xe8a17ebe
-0,         11,         11,        1,   460800, 0x27e94c03
-0,         12,         12,        1,   460800, 0x71c0f48e
-0,         13,         13,        1,   460800, 0x5fc8f783
-0,         14,         14,        1,   460800, 0xd23d336a
-0,         15,         15,        1,   460800, 0xadcfa9e0
-0,         16,         16,        1,   460800, 0x24222144
-0,         17,         17,        1,   460800, 0x88f28b2b
-0,         18,         18,        1,   460800, 0x52e13544
-0,         19,         19,        1,   460800, 0x7e724731
diff --git a/deps/libav/tests/ref/fate/bink-video-i b/deps/libav/tests/ref/fate/bink-video-i
deleted file mode 100644
index 32c5e10..0000000
--- a/deps/libav/tests/ref/fate/bink-video-i
+++ /dev/null
@@ -1,32 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   460800, 0xaef133d9
-0,          1,          1,        1,   460800, 0x2da1248b
-0,          2,          2,        1,   460800, 0x3d7945b4
-0,          3,          3,        1,   460800, 0x44554f62
-0,          4,          4,        1,   460800, 0x1bc0007e
-0,          5,          5,        1,   460800, 0xe9b5c4fa
-0,          6,          6,        1,   460800, 0x41b17af0
-0,          7,          7,        1,   460800, 0x88f5d31c
-0,          8,          8,        1,   460800, 0xdedb6e2d
-0,          9,          9,        1,   460800, 0xd36f0a5e
-0,         10,         10,        1,   460800, 0xb564921c
-0,         11,         11,        1,   460800, 0xd72b1208
-0,         12,         12,        1,   460800, 0x5c87760e
-0,         13,         13,        1,   460800, 0xecb75843
-0,         14,         14,        1,   460800, 0x58deee70
-0,         15,         15,        1,   460800, 0x64b5ae3e
-0,         16,         16,        1,   460800, 0x9269e9e6
-0,         17,         17,        1,   460800, 0x47064d62
-0,         18,         18,        1,   460800, 0x88858604
-0,         19,         19,        1,   460800, 0x129d8834
-0,         20,         20,        1,   460800, 0x046ecae5
-0,         21,         21,        1,   460800, 0x6c74c134
-0,         22,         22,        1,   460800, 0x37d56c01
-0,         23,         23,        1,   460800, 0x4c0a4f15
-0,         24,         24,        1,   460800, 0xe28ef96b
-0,         25,         25,        1,   460800, 0x66c72383
-0,         26,         26,        1,   460800, 0x9487175b
-0,         27,         27,        1,   460800, 0x71034965
-0,         28,         28,        1,   460800, 0x0f99ca96
-0,         29,         29,        1,   460800, 0x8a8c79b2
-0,         30,         30,        1,   460800, 0x34d4926e
diff --git a/deps/libav/tests/ref/fate/blowfish b/deps/libav/tests/ref/fate/blowfish
deleted file mode 100644
index fed0b4d..0000000
--- a/deps/libav/tests/ref/fate/blowfish
+++ /dev/null
@@ -1 +0,0 @@
-Test encryption/decryption success.
diff --git a/deps/libav/tests/ref/fate/bmp-15bit b/deps/libav/tests/ref/fate/bmp-15bit
deleted file mode 100644
index a0f3bbf..0000000
--- a/deps/libav/tests/ref/fate/bmp-15bit
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    16256, 0xdbcf881d
diff --git a/deps/libav/tests/ref/fate/bmp-15bit-mask b/deps/libav/tests/ref/fate/bmp-15bit-mask
deleted file mode 100644
index a0f3bbf..0000000
--- a/deps/libav/tests/ref/fate/bmp-15bit-mask
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    16256, 0xdbcf881d
diff --git a/deps/libav/tests/ref/fate/bmp-16bit-mask b/deps/libav/tests/ref/fate/bmp-16bit-mask
deleted file mode 100644
index afa5ab4..0000000
--- a/deps/libav/tests/ref/fate/bmp-16bit-mask
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    16256, 0x44675948
diff --git a/deps/libav/tests/ref/fate/bmp-1bit b/deps/libav/tests/ref/fate/bmp-1bit
deleted file mode 100644
index 1c825b1..0000000
--- a/deps/libav/tests/ref/fate/bmp-1bit
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    24384, 0x4c968301
diff --git a/deps/libav/tests/ref/fate/bmp-24bit b/deps/libav/tests/ref/fate/bmp-24bit
deleted file mode 100644
index 8f1a615..0000000
--- a/deps/libav/tests/ref/fate/bmp-24bit
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    24384, 0x325dd8d9
diff --git a/deps/libav/tests/ref/fate/bmp-32bit b/deps/libav/tests/ref/fate/bmp-32bit
deleted file mode 100644
index 8f1a615..0000000
--- a/deps/libav/tests/ref/fate/bmp-32bit
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    24384, 0x325dd8d9
diff --git a/deps/libav/tests/ref/fate/bmp-32bit-mask b/deps/libav/tests/ref/fate/bmp-32bit-mask
deleted file mode 100644
index 8f1a615..0000000
--- a/deps/libav/tests/ref/fate/bmp-32bit-mask
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    24384, 0x325dd8d9
diff --git a/deps/libav/tests/ref/fate/bmp-4bit b/deps/libav/tests/ref/fate/bmp-4bit
deleted file mode 100644
index c0eedf1..0000000
--- a/deps/libav/tests/ref/fate/bmp-4bit
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    24384, 0x322d81f4
diff --git a/deps/libav/tests/ref/fate/bmp-4bit-os2 b/deps/libav/tests/ref/fate/bmp-4bit-os2
deleted file mode 100644
index 8a5f658..0000000
--- a/deps/libav/tests/ref/fate/bmp-4bit-os2
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    19800, 0x563b599a
diff --git a/deps/libav/tests/ref/fate/bmp-8bit b/deps/libav/tests/ref/fate/bmp-8bit
deleted file mode 100644
index 887113c..0000000
--- a/deps/libav/tests/ref/fate/bmp-8bit
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    24384, 0xa7aa6b9b
diff --git a/deps/libav/tests/ref/fate/bmp-8bit-os2 b/deps/libav/tests/ref/fate/bmp-8bit-os2
deleted file mode 100644
index 887113c..0000000
--- a/deps/libav/tests/ref/fate/bmp-8bit-os2
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    24384, 0xa7aa6b9b
diff --git a/deps/libav/tests/ref/fate/bmp-rle4 b/deps/libav/tests/ref/fate/bmp-rle4
deleted file mode 100644
index c0eedf1..0000000
--- a/deps/libav/tests/ref/fate/bmp-rle4
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    24384, 0x322d81f4
diff --git a/deps/libav/tests/ref/fate/bmp-rle8 b/deps/libav/tests/ref/fate/bmp-rle8
deleted file mode 100644
index 887113c..0000000
--- a/deps/libav/tests/ref/fate/bmp-rle8
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    24384, 0xa7aa6b9b
diff --git a/deps/libav/tests/ref/fate/bmv-audio b/deps/libav/tests/ref/fate/bmv-audio
deleted file mode 100644
index 746bb0c..0000000
--- a/deps/libav/tests/ref/fate/bmv-audio
+++ /dev/null
@@ -1,22 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,     1856,     7424, 0x18540b36
-0,       1856,       1856,     1824,     7296, 0x5acd2484
-0,       3680,       3680,     1856,     7424, 0xa1bc5c5a
-0,       5536,       5536,     1824,     7296, 0x71a02ad1
-0,       7360,       7360,     1856,     7424, 0x09cc32f2
-0,       9216,       9216,     1824,     7296, 0xa3451726
-0,      11040,      11040,     1824,     7296, 0x1eb40a18
-0,      12864,      12864,     1856,     7424, 0xc55a2acf
-0,      14720,      14720,     1824,     7296, 0x5b9fad3f
-0,      16544,      16544,     1856,     7424, 0xea651ae7
-0,      18400,      18400,     1824,     7296, 0x2bd5ddb6
-0,      20224,      20224,     1856,     7424, 0xde4243b4
-0,      22080,      22080,     1824,     7296, 0x358806d3
-0,      23904,      23904,     1824,     7296, 0x511a144e
-0,      25728,      25728,     1856,     7424, 0x887a3e84
-0,      27584,      27584,     1824,     7296, 0xfeae2a0c
-0,      29408,      29408,     1856,     7424, 0xa4ea5d22
-0,      31264,      31264,     1824,     7296, 0xb3adf7fa
-0,      33088,      33088,     1856,     7424, 0xce995dcc
-0,      34944,      34944,     1824,     7296, 0x5b4cf574
-0,      36768,      36768,     1824,     7296, 0x8a70eaf0
diff --git a/deps/libav/tests/ref/fate/bmv-video b/deps/libav/tests/ref/fate/bmv-video
deleted file mode 100644
index f19cd45..0000000
--- a/deps/libav/tests/ref/fate/bmv-video
+++ /dev/null
@@ -1,22 +0,0 @@
-#tb 0: 1/12
-0,          0,          0,        1,   823680, 0xddb8a306
-0,          1,          1,        1,   823680, 0xa95375c8
-0,          2,          2,        1,   823680, 0xa95375c8
-0,          3,          3,        1,   823680, 0xb6f78afe
-0,          4,          4,        1,   823680, 0xb6f78afe
-0,          5,          5,        1,   823680, 0x45b9c8f0
-0,          6,          6,        1,   823680, 0x45b9c8f0
-0,          7,          7,        1,   823680, 0x7653d8e9
-0,          8,          8,        1,   823680, 0x7653d8e9
-0,          9,          9,        1,   823680, 0xf1e2fd73
-0,         10,         10,        1,   823680, 0xf1e2fd73
-0,         11,         11,        1,   823680, 0x6d2deab3
-0,         12,         12,        1,   823680, 0x6d2deab3
-0,         13,         13,        1,   823680, 0x37fd33ce
-0,         14,         14,        1,   823680, 0x37fd33ce
-0,         15,         15,        1,   823680, 0x0a8e0ab9
-0,         16,         16,        1,   823680, 0x0a8e0ab9
-0,         17,         17,        1,   823680, 0x991bb2b0
-0,         18,         18,        1,   823680, 0x991bb2b0
-0,         19,         19,        1,   823680, 0xb8397c8c
-0,         20,         20,        1,   823680, 0xb8397c8c
diff --git a/deps/libav/tests/ref/fate/caf b/deps/libav/tests/ref/fate/caf
deleted file mode 100644
index 00de78c..0000000
--- a/deps/libav/tests/ref/fate/caf
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0xd0d7195c
diff --git a/deps/libav/tests/ref/fate/cavs b/deps/libav/tests/ref/fate/cavs
deleted file mode 100644
index c96468a..0000000
--- a/deps/libav/tests/ref/fate/cavs
+++ /dev/null
@@ -1,171 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,        0,   622080, 0x76183b91
-0,       3624,       3624,        0,   622080, 0x2ca5e808
-0,       7248,       7248,        0,   622080, 0xc503eda4
-0,      10872,      10872,        0,   622080, 0xa0dbf06c
-0,      14496,      14496,        0,   622080, 0xf4363cfa
-0,      18120,      18120,        0,   622080, 0xaa7dd9b8
-0,      21744,      21744,        0,   622080, 0x3ab6223b
-0,      25368,      25368,        0,   622080, 0xe402644b
-0,      28992,      28992,        0,   622080, 0xd0da3ade
-0,      32616,      32616,        0,   622080, 0x0aff6151
-0,      36240,      36240,        0,   622080, 0x02aea3d5
-0,      39864,      39864,        0,   622080, 0x5d8eeccd
-0,      43488,      43488,        0,   622080, 0x54384735
-0,      47112,      47112,        0,   622080, 0x890d71c2
-0,      50736,      50736,        0,   622080, 0xc60ae25b
-0,      54360,      54360,        0,   622080, 0xe589e774
-0,      57984,      57984,        0,   622080, 0x03471e74
-0,      61608,      61608,        0,   622080, 0x4e22302c
-0,      65232,      65232,        0,   622080, 0x00333583
-0,      68856,      68856,        0,   622080, 0xd6eae7d9
-0,      72480,      72480,        0,   622080, 0x72fe94f7
-0,      76104,      76104,        0,   622080, 0x3ebbad1e
-0,      79728,      79728,        0,   622080, 0x2fb1de4b
-0,      83352,      83352,        0,   622080, 0x3bfea6d2
-0,      86976,      86976,        0,   622080, 0x0fb551b2
-0,      90600,      90600,        0,   622080, 0xb203284f
-0,      94224,      94224,        0,   622080, 0xb3baac30
-0,      97200,      97200,        0,   622080, 0x15f2c1c7
-0,     100824,     100824,        0,   622080, 0xb2b530ce
-0,     104448,     104448,        0,   622080, 0xbbaaf241
-0,     108072,     108072,        0,   622080, 0x01bc9dfc
-0,     111696,     111696,        0,   622080, 0x8a449a42
-0,     115320,     115320,        0,   622080, 0xdc63d73f
-0,     118944,     118944,        0,   622080, 0xf06bc231
-0,     122568,     122568,        0,   622080, 0x19e04295
-0,     126192,     126192,        0,   622080, 0x1e7d1acd
-0,     129816,     129816,        0,   622080, 0x43878b48
-0,     133440,     133440,        0,   622080, 0xcd94b702
-0,     137064,     137064,        0,   622080, 0xd2706cf1
-0,     140688,     140688,        0,   622080, 0x47d636f3
-0,     144312,     144312,        0,   622080, 0x4a516acc
-0,     147936,     147936,        0,   622080, 0x52b7d89a
-0,     151560,     151560,        0,   622080, 0xc9ba03be
-0,     155184,     155184,        0,   622080, 0x6d17785e
-0,     158808,     158808,        0,   622080, 0x8264871b
-0,     162432,     162432,        0,   622080, 0xd59c84c0
-0,     166056,     166056,        0,   622080, 0x2b86d6cd
-0,     169680,     169680,        0,   622080, 0x9c5a5f51
-0,     173304,     173304,        0,   622080, 0x221f79ca
-0,     176928,     176928,        0,   622080, 0x98edb3ec
-0,     180552,     180552,        0,   622080, 0x9a31262c
-0,     184176,     184176,        0,   622080, 0x18f48378
-0,     187800,     187800,        0,   622080, 0x957c3d9c
-0,     191424,     191424,        0,   622080, 0x9cc6866e
-0,     195048,     195048,        0,   622080, 0x45613726
-0,     198672,     198672,        0,   622080, 0x7a6c5e65
-0,     202296,     202296,        0,   622080, 0x976d7a11
-0,     205200,     205200,        0,   622080, 0x192aea08
-0,     208824,     208824,        0,   622080, 0x8d4fc823
-0,     212448,     212448,        0,   622080, 0x1f9c55d7
-0,     216072,     216072,        0,   622080, 0xd4336d41
-0,     219696,     219696,        0,   622080, 0x7aa650cd
-0,     223320,     223320,        0,   622080, 0x8efaaeb1
-0,     226944,     226944,        0,   622080, 0x3d8c3053
-0,     230568,     230568,        0,   622080, 0x1e2b64b0
-0,     234192,     234192,        0,   622080, 0x0436b1a7
-0,     237816,     237816,        0,   622080, 0xc5120072
-0,     241440,     241440,        0,   622080, 0x0203b245
-0,     245064,     245064,        0,   622080, 0x9815582b
-0,     248688,     248688,        0,   622080, 0x3c60c359
-0,     252312,     252312,        0,   622080, 0x1a26b948
-0,     255936,     255936,        0,   622080, 0x56079812
-0,     259560,     259560,        0,   622080, 0x7b192a55
-0,     263184,     263184,        0,   622080, 0x335632ab
-0,     266808,     266808,        0,   622080, 0xd0c12eb8
-0,     270432,     270432,        0,   622080, 0x93bf46cb
-0,     274056,     274056,        0,   622080, 0xce67ce24
-0,     277680,     277680,        0,   622080, 0xff95bb26
-0,     281304,     281304,        0,   622080, 0x5e750705
-0,     284928,     284928,        0,   622080, 0x45a35725
-0,     288552,     288552,        0,   622080, 0xd8e93c39
-0,     292176,     292176,        0,   622080, 0xa9f8db50
-0,     295800,     295800,        0,   622080, 0xf90a862e
-0,     299424,     299424,        0,   622080, 0x5e5a4216
-0,     303048,     303048,        0,   622080, 0xaaf45ed6
-0,     306672,     306672,        0,   622080, 0x1933cda5
-0,     310296,     310296,        0,   622080, 0x7ff68d91
-0,     313200,     313200,        0,   622080, 0x10038fe9
-0,     316824,     316824,        0,   622080, 0x9b3425a6
-0,     320448,     320448,        0,   622080, 0x8d2a141d
-0,     324072,     324072,        0,   622080, 0x698a333e
-0,     327696,     327696,        0,   622080, 0x334685d1
-0,     331320,     331320,        0,   622080, 0x40317d40
-0,     334944,     334944,        0,   622080, 0xd3c6f519
-0,     338568,     338568,        0,   622080, 0xfc2210c2
-0,     342192,     342192,        0,   622080, 0x3761df34
-0,     345816,     345816,        0,   622080, 0xef25462a
-0,     349440,     349440,        0,   622080, 0x0fd38121
-0,     353064,     353064,        0,   622080, 0x184856a6
-0,     356688,     356688,        0,   622080, 0xc57c9f12
-0,     360312,     360312,        0,   622080, 0x39874291
-0,     363936,     363936,        0,   622080, 0x7c13cec4
-0,     367560,     367560,        0,   622080, 0xc4192a76
-0,     371184,     371184,        0,   622080, 0x2af404e3
-0,     374808,     374808,        0,   622080, 0x1ee18f41
-0,     378432,     378432,        0,   622080, 0xfb4d9ee5
-0,     382056,     382056,        0,   622080, 0x50aae4ff
-0,     385680,     385680,        0,   622080, 0x030f91fe
-0,     389304,     389304,        0,   622080, 0x3a3ee08c
-0,     392928,     392928,        0,   622080, 0x50121423
-0,     396552,     396552,        0,   622080, 0xda39e2d6
-0,     400176,     400176,        0,   622080, 0x9e13ccd6
-0,     403800,     403800,        0,   622080, 0xb72a22a7
-0,     407424,     407424,        0,   622080, 0xb76904d5
-0,     411048,     411048,        0,   622080, 0xcffa04a8
-0,     414672,     414672,        0,   622080, 0x2984bf3f
-0,     418296,     418296,        0,   622080, 0x274b5778
-0,     421200,     421200,        0,   622080, 0xf059413a
-0,     424824,     424824,        0,   622080, 0x969fae57
-0,     428448,     428448,        0,   622080, 0x75c29097
-0,     432072,     432072,        0,   622080, 0x2bf3b07d
-0,     435696,     435696,        0,   622080, 0x9f43271d
-0,     439320,     439320,        0,   622080, 0x67bf23f3
-0,     442944,     442944,        0,   622080, 0xa8edcf33
-0,     446568,     446568,        0,   622080, 0x17a0789e
-0,     450192,     450192,        0,   622080, 0x14b67cc7
-0,     453816,     453816,        0,   622080, 0x779215cd
-0,     457440,     457440,        0,   622080, 0x8b460a21
-0,     461064,     461064,        0,   622080, 0x0502ad7d
-0,     464688,     464688,        0,   622080, 0x6860678f
-0,     468312,     468312,        0,   622080, 0xe180469e
-0,     471936,     471936,        0,   622080, 0x9a992835
-0,     475560,     475560,        0,   622080, 0x2efafa33
-0,     479184,     479184,        0,   622080, 0xe24e59b2
-0,     482808,     482808,        0,   622080, 0xfb774d53
-0,     486432,     486432,        0,   622080, 0x3de4ea81
-0,     490056,     490056,        0,   622080, 0xaf9aa1d6
-0,     493680,     493680,        0,   622080, 0xa0e3722f
-0,     497304,     497304,        0,   622080, 0x81684492
-0,     500928,     500928,        0,   622080, 0xa4e971fb
-0,     504552,     504552,        0,   622080, 0x4a1903c8
-0,     508176,     508176,        0,   622080, 0x26304e4a
-0,     511800,     511800,        0,   622080, 0x867983a4
-0,     515424,     515424,        0,   622080, 0x2e7e4d13
-0,     519048,     519048,        0,   622080, 0x736f4682
-0,     522672,     522672,        0,   622080, 0x426a95fa
-0,     526296,     526296,        0,   622080, 0x2bc8850c
-0,     529200,     529200,        0,   622080, 0x047e77ab
-0,     532824,     532824,        0,   622080, 0x414ab77f
-0,     536448,     536448,        0,   622080, 0x42681090
-0,     540072,     540072,        0,   622080, 0x80744ccb
-0,     543696,     543696,        0,   622080, 0x50e2ecc0
-0,     547320,     547320,        0,   622080, 0x5c9fe70e
-0,     550944,     550944,        0,   622080, 0x016461ee
-0,     554568,     554568,        0,   622080, 0xd42f019a
-0,     558192,     558192,        0,   622080, 0x8171bf41
-0,     561816,     561816,        0,   622080, 0xf4d8ef7e
-0,     565440,     565440,        0,   622080, 0xf2d513c8
-0,     569064,     569064,        0,   622080, 0xb5b07704
-0,     572688,     572688,        0,   622080, 0x2168a07a
-0,     576312,     576312,        0,   622080, 0x840418f9
-0,     579936,     579936,        0,   622080, 0xd36f1b7c
-0,     583560,     583560,        0,   622080, 0x52532604
-0,     587184,     587184,        0,   622080, 0x0856d6eb
-0,     590808,     590808,        0,   622080, 0x21748734
-0,     594432,     594432,        0,   622080, 0xbd315c05
-0,     598056,     598056,        0,   622080, 0x1cea8103
-0,     601680,     601680,        0,   622080, 0x71f6e3cb
-0,     605304,     605304,        0,   622080, 0xb12d7aa7
-0,     608928,     608928,        0,   622080, 0x549b2acb
diff --git a/deps/libav/tests/ref/fate/cdgraphics b/deps/libav/tests/ref/fate/cdgraphics
deleted file mode 100644
index dccb2b5..0000000
--- a/deps/libav/tests/ref/fate/cdgraphics
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/300
-0,          0,          0,        1,   194400, 0x46ad80da
-0,          1,          1,        1,   194400, 0x46ad80da
-0,          2,          2,        1,   194400, 0x9392c3b9
-0,          3,          3,        1,   194400, 0x9392c3b9
-0,          4,          4,        1,   194400, 0x9392c3b9
-0,          5,          5,        1,   194400, 0x9392c3b9
-0,          6,          6,        1,   194400, 0x9392c3b9
-0,          7,          7,        1,   194400, 0x9392c3b9
-0,          8,          8,        1,   194400, 0x9392c3b9
-0,          9,          9,        1,   194400, 0x9392c3b9
-0,         10,         10,        1,   194400, 0x9392c3b9
-0,         11,         11,        1,   194400, 0x9392c3b9
-0,         12,         12,        1,   194400, 0x9392c3b9
-0,         13,         13,        1,   194400, 0x9392c3b9
-0,         14,         14,        1,   194400, 0x9392c3b9
-0,         15,         15,        1,   194400, 0x9392c3b9
-0,         16,         16,        1,   194400, 0x46ad80da
-0,         17,         17,        1,   194400, 0x46ad80da
-0,         18,         18,        1,   194400, 0x46ad80da
-0,         19,         19,        1,   194400, 0x46ad80da
-0,         20,         20,        1,   194400, 0x46ad80da
-0,         21,         21,        1,   194400, 0x46ad80da
-0,         22,         22,        1,   194400, 0x46ad80da
-0,         23,         23,        1,   194400, 0x46ad80da
-0,         24,         24,        1,   194400, 0x46ad80da
-0,         25,         25,        1,   194400, 0x46ad80da
-0,         26,         26,        1,   194400, 0x46ad80da
-0,         27,         27,        1,   194400, 0x46ad80da
-0,         28,         28,        1,   194400, 0x46ad80da
-0,         29,         29,        1,   194400, 0x46ad80da
-0,         30,         30,        1,   194400, 0x46ad80da
-0,         31,         31,        1,   194400, 0x46ad80da
-0,         32,         32,        1,   194400, 0x9392c3b9
-0,         33,         33,        1,   194400, 0x9ff8cbb1
-0,         34,         34,        1,   194400, 0xd015dba1
-0,         35,         35,        1,   194400, 0x6a39f18b
-0,         36,         36,        1,   194400, 0x7b8cf983
-0,         37,         37,        1,   194400, 0x07a20f7c
-0,         38,         38,        1,   194400, 0xa63e2962
-0,         39,         39,        1,   194400, 0x2dd54447
-0,         40,         40,        1,   194400, 0x90735e2d
-0,         41,         41,        1,   194400, 0x90d98506
-0,         42,         42,        1,   194400, 0xe5b08ffb
-0,         43,         43,        1,   194400, 0x7a0d95f5
-0,         44,         44,        1,   194400, 0xff6bacde
-0,         45,         45,        1,   194400, 0xd998c2c8
-0,         46,         46,        1,   194400, 0x3d1ddfab
-0,         47,         47,        1,   194400, 0x817de4a6
-0,         48,         48,        1,   194400, 0xfa3ef694
-0,         49,         49,        1,   194400, 0x0b5bfb8f
-0,         50,         50,        1,   194400, 0x00f62376
-0,         51,         51,        1,   194400, 0x2f6b2d6c
-0,         52,         52,        1,   194400, 0x40cb4752
-0,         53,         53,        1,   194400, 0xd8456435
-0,         54,         54,        1,   194400, 0x459f6a2f
-0,         55,         55,        1,   194400, 0x9b678910
-0,         56,         56,        1,   194400, 0x8791a1f7
-0,         57,         57,        1,   194400, 0xdb4ac5d3
-0,         58,         58,        1,   194400, 0xb223c8d0
-0,         59,         59,        1,   194400, 0x4a9ce7b1
-0,         60,         60,        1,   194400, 0x187eeaae
-0,         61,         61,        1,   194400, 0xc712f8a0
-0,         62,         62,        1,   194400, 0x549c00a7
-0,         63,         63,        1,   194400, 0x4d991295
-0,         64,         64,        1,   194400, 0xc41b2681
-0,         65,         65,        1,   194400, 0xed5a3077
-0,         66,         66,        1,   194400, 0x85ad4463
-0,         67,         67,        1,   194400, 0xb98f4760
-0,         68,         68,        1,   194400, 0x87ef5e49
-0,         69,         69,        1,   194400, 0x830a6146
-0,         70,         70,        1,   194400, 0xe33a792e
-0,         71,         71,        1,   194400, 0x83517a2d
-0,         72,         72,        1,   194400, 0xa97e9314
-0,         73,         73,        1,   194400, 0x39059611
-0,         74,         74,        1,   194400, 0xbf4eb9ed
-0,         75,         75,        1,   194400, 0xe5afc4e2
-0,         76,         76,        1,   194400, 0x35d4cdd9
-0,         77,         77,        1,   194400, 0xb376e1c5
-0,         78,         78,        1,   194400, 0x6128e3c3
-0,         79,         79,        1,   194400, 0x30b7f7af
-0,         80,         80,        1,   194400, 0xf1effaac
-0,         81,         81,        1,   194400, 0x483914a1
-0,         82,         82,        1,   194400, 0xbd48199c
-0,         83,         83,        1,   194400, 0x382f2d88
-0,         84,         84,        1,   194400, 0x5a573085
-0,         85,         85,        1,   194400, 0x89733580
-0,         86,         86,        1,   194400, 0xd1325a5b
-0,         87,         87,        1,   194400, 0x655b6253
-0,         88,         88,        1,   194400, 0x55146352
-0,         89,         89,        1,   194400, 0xda527c39
-0,         90,         90,        1,   194400, 0xb0cd7e37
-0,         91,         91,        1,   194400, 0x25e7991c
-0,         92,         92,        1,   194400, 0x5c22a411
-0,         93,         93,        1,   194400, 0x1e2abdf7
-0,         94,         94,        1,   194400, 0x8308bff5
-0,         95,         95,        1,   194400, 0xfdbfd6de
-0,         96,         96,        1,   194400, 0xd4d4d9db
-0,         97,         97,        1,   194400, 0xa449fbb9
-0,         98,         98,        1,   194400, 0x3dcafdb7
-0,         99,         99,        1,   194400, 0x6f1f01c2
-0,        100,        100,        1,   194400, 0xf54a1da6
-0,        101,        101,        1,   194400, 0x88d11fa4
-0,        102,        102,        1,   194400, 0x59642d96
-0,        103,        103,        1,   194400, 0x8ba44182
-0,        104,        104,        1,   194400, 0x88f56360
-0,        105,        105,        1,   194400, 0xfb246d56
-0,        106,        106,        1,   194400, 0xad128043
-0,        107,        107,        1,   194400, 0x3a4f8a39
-0,        108,        108,        1,   194400, 0x563d9d26
-0,        109,        109,        1,   194400, 0x6ff8a320
-0,        110,        110,        1,   194400, 0xcdb9b70c
-0,        111,        111,        1,   194400, 0x99c2bd06
-0,        112,        112,        1,   194400, 0x4b47cef4
-0,        113,        113,        1,   194400, 0x10b9dce6
-0,        114,        114,        1,   194400, 0xdd39f1d1
-0,        115,        115,        1,   194400, 0xbcf104cd
-0,        116,        116,        1,   194400, 0x85ec17ba
-0,        117,        117,        1,   194400, 0x069219b8
-0,        118,        118,        1,   194400, 0x84dd3899
-0,        119,        119,        1,   194400, 0xacca4190
-0,        120,        120,        1,   194400, 0xcf5b5d74
-0,        121,        121,        1,   194400, 0x4b8c626f
-0,        122,        122,        1,   194400, 0xf0817958
-0,        123,        123,        1,   194400, 0xc0887e53
-0,        124,        124,        1,   194400, 0x42e6854c
-0,        125,        125,        1,   194400, 0x036c9140
-0,        126,        126,        1,   194400, 0x0f21a62b
-0,        127,        127,        1,   194400, 0xcdaeaa27
-0,        128,        128,        1,   194400, 0xe425bc15
-0,        129,        129,        1,   194400, 0x8e18c20f
-0,        130,        130,        1,   194400, 0x767cd5fb
-0,        131,        131,        1,   194400, 0x554ae6ea
-0,        132,        132,        1,   194400, 0xeac1f9d7
-0,        133,        133,        1,   194400, 0x0b32fed2
-0,        134,        134,        1,   194400, 0xe30c19c6
-0,        135,        135,        1,   194400, 0x6a8a23bc
-0,        136,        136,        1,   194400, 0x26bf36a9
-0,        137,        137,        1,   194400, 0x1e4f3fa0
-0,        138,        138,        1,   194400, 0x231f5986
-0,        139,        139,        1,   194400, 0xf557756a
-0,        140,        140,        1,   194400, 0x6bce805f
-0,        141,        141,        1,   194400, 0xcd80924d
-0,        142,        142,        1,   194400, 0x65dc9f40
-0,        143,        143,        1,   194400, 0x2ab7af30
-0,        144,        144,        1,   194400, 0xd43cb728
-0,        145,        145,        1,   194400, 0x05d9c916
-0,        146,        146,        1,   194400, 0x43cad10e
-0,        147,        147,        1,   194400, 0x06b5e0fe
-0,        148,        148,        1,   194400, 0xa142f0ee
-0,        149,        149,        1,   194400, 0xed7f03ea
-0,        150,        150,        1,   194400, 0xf26019d4
-0,        151,        151,        1,   194400, 0x3b7f29c4
-0,        152,        152,        1,   194400, 0x30282ebf
-0,        153,        153,        1,   194400, 0xaeff4aa3
-0,        154,        154,        1,   194400, 0x1d355697
-0,        155,        155,        1,   194400, 0x2ead6f7e
-0,        156,        156,        1,   194400, 0xf1b67776
-0,        157,        157,        1,   194400, 0x93b38b62
-0,        158,        158,        1,   194400, 0x9469905d
-0,        159,        159,        1,   194400, 0x27bf9756
-0,        160,        160,        1,   194400, 0xd016a548
-0,        161,        161,        1,   194400, 0x6889b835
-0,        162,        162,        1,   194400, 0x6a05be2f
-0,        163,        163,        1,   194400, 0xe0a1ce1f
-0,        164,        164,        1,   194400, 0x8fdbd617
-0,        165,        165,        1,   194400, 0xd68fe805
-0,        166,        166,        1,   194400, 0x0d1dfbf1
-0,        167,        167,        1,   194400, 0x0fe70bf0
-0,        168,        168,        1,   194400, 0x0a8f13e8
-0,        169,        169,        1,   194400, 0x0ca42bd0
-0,        170,        170,        1,   194400, 0x6f3838c3
-0,        171,        171,        1,   194400, 0x045448b3
-0,        172,        172,        1,   194400, 0x764349b2
-0,        173,        173,        1,   194400, 0xed1651aa
-0,        174,        174,        1,   194400, 0xbb376398
-0,        175,        175,        1,   194400, 0xd0d5718a
-0,        176,        176,        1,   194400, 0xcd977e7d
-0,        177,        177,        1,   194400, 0x8cb39665
-0,        178,        178,        1,   194400, 0xb935b04b
-0,        179,        179,        1,   194400, 0x0292be3d
-0,        180,        180,        1,   194400, 0x4f21c833
-0,        181,        181,        1,   194400, 0xa5c7d823
-0,        182,        182,        1,   194400, 0xfb8ee01b
-0,        183,        183,        1,   194400, 0xea53ee0d
-0,        184,        184,        1,   194400, 0x803efcfe
-0,        185,        185,        1,   194400, 0x2c0e0aff
-0,        186,        186,        1,   194400, 0x3df318f1
-0,        187,        187,        1,   194400, 0xc4cb26e3
-0,        188,        188,        1,   194400, 0x92a033d6
-0,        189,        189,        1,   194400, 0x1b2048c1
-0,        190,        190,        1,   194400, 0x236858b1
-0,        191,        191,        1,   194400, 0x482f6d9c
-0,        192,        192,        1,   194400, 0x9ee97891
-0,        193,        193,        1,   194400, 0xe0dc8683
-0,        194,        194,        1,   194400, 0x461b9079
-0,        195,        195,        1,   194400, 0xd346a960
-0,        196,        196,        1,   194400, 0xa384b554
-0,        197,        197,        1,   194400, 0x3246cf3a
-0,        198,        198,        1,   194400, 0xa53fe722
-0,        199,        199,        1,   194400, 0xe620fd0c
-0,        200,        200,        1,   194400, 0xd6370414
-0,        201,        201,        1,   194400, 0xf57f1404
-0,        202,        202,        1,   194400, 0x8c6420f7
-0,        203,        203,        1,   194400, 0xd4be3add
-0,        204,        204,        1,   194400, 0xa8dc4ec9
-0,        205,        205,        1,   194400, 0xda1563b4
-0,        206,        206,        1,   194400, 0xd51873a4
-0,        207,        207,        1,   194400, 0x68588196
-0,        208,        208,        1,   194400, 0x40d18e89
-0,        209,        209,        1,   194400, 0x1b75a275
-0,        210,        210,        1,   194400, 0xedd1a572
-0,        211,        211,        1,   194400, 0x55daad6a
-0,        212,        212,        1,   194400, 0xcb93b067
-0,        213,        213,        1,   194400, 0x5888ba5d
-0,        214,        214,        1,   194400, 0x2c11c84f
-0,        215,        215,        1,   194400, 0x0fbae334
-0,        216,        216,        1,   194400, 0x773fed2a
-0,        217,        217,        1,   194400, 0x2f87fc1b
-0,        218,        218,        1,   194400, 0xe8120521
-0,        219,        219,        1,   194400, 0x64ac0f17
-0,        220,        220,        1,   194400, 0xba531c0a
-0,        221,        221,        1,   194400, 0xf49433f2
-0,        222,        222,        1,   194400, 0x79e234f1
-0,        223,        223,        1,   194400, 0x043937ee
-0,        224,        224,        1,   194400, 0x9e6141e4
-0,        225,        225,        1,   194400, 0x34204fd6
-0,        226,        226,        1,   194400, 0xa1dd60c5
-0,        227,        227,        1,   194400, 0x12b36eb7
-0,        228,        228,        1,   194400, 0x68987aab
-0,        229,        229,        1,   194400, 0x3207889d
-0,        230,        230,        1,   194400, 0x3bb59194
-0,        231,        231,        1,   194400, 0x0a119f86
-0,        232,        232,        1,   194400, 0x472bab7a
-0,        233,        233,        1,   194400, 0x7364c85d
-0,        234,        234,        1,   194400, 0xa812d84d
-0,        235,        235,        1,   194400, 0xf384f530
-0,        236,        236,        1,   194400, 0x1546052f
-0,        237,        237,        1,   194400, 0xeb611a1a
-0,        238,        238,        1,   194400, 0xc39d250f
-0,        239,        239,        1,   194400, 0x7bd73301
-0,        240,        240,        1,   194400, 0x10f73cf7
-0,        241,        241,        1,   194400, 0x95dc55de
-0,        242,        242,        1,   194400, 0x392e61d2
-0,        243,        243,        1,   194400, 0x113c7bb8
-0,        244,        244,        1,   194400, 0x17128fa4
-0,        245,        245,        1,   194400, 0xf95e9b98
-0,        246,        246,        1,   194400, 0xdc47aa89
-0,        247,        247,        1,   194400, 0xea5dc073
-0,        248,        248,        1,   194400, 0x8dfadc57
-0,        249,        249,        1,   194400, 0xe5c3e84b
-0,        250,        250,        1,   194400, 0x8952f43f
-0,        251,        251,        1,   194400, 0xec9e0240
-0,        252,        252,        1,   194400, 0x8f460c36
-0,        253,        253,        1,   194400, 0xd43e182a
-0,        254,        254,        1,   194400, 0xb00b2919
-0,        255,        255,        1,   194400, 0xc9f6350d
-0,        256,        256,        1,   194400, 0x87ca44fd
-0,        257,        257,        1,   194400, 0xa6a250f1
-0,        258,        258,        1,   194400, 0x34fa60e1
-0,        259,        259,        1,   194400, 0xe1a372cf
-0,        260,        260,        1,   194400, 0xc80785bc
-0,        261,        261,        1,   194400, 0x43e297aa
-0,        262,        262,        1,   194400, 0x7e8ea49d
-0,        263,        263,        1,   194400, 0xd009b091
-0,        264,        264,        1,   194400, 0x9126bc85
-0,        265,        265,        1,   194400, 0x175ad36e
-0,        266,        266,        1,   194400, 0xf9dae160
-0,        267,        267,        1,   194400, 0x1b98f948
-0,        268,        268,        1,   194400, 0xa6c5133d
-0,        269,        269,        1,   194400, 0xf5d42729
-0,        270,        270,        1,   194400, 0x8cfe311f
-0,        271,        271,        1,   194400, 0x18733e12
-0,        272,        272,        1,   194400, 0x24ac50ff
-0,        273,        273,        1,   194400, 0x0d1c64eb
-0,        274,        274,        1,   194400, 0xde947cd3
-0,        275,        275,        1,   194400, 0x08268dc2
-0,        276,        276,        1,   194400, 0xfec69fb0
-0,        277,        277,        1,   194400, 0xba83aba4
-0,        278,        278,        1,   194400, 0xfbe2bc93
-0,        279,        279,        1,   194400, 0xe22fcc83
-0,        280,        280,        1,   194400, 0x050fcf80
-0,        281,        281,        1,   194400, 0xee1ed778
-0,        282,        282,        1,   194400, 0xb44cda75
-0,        283,        283,        1,   194400, 0xa29fe46b
-0,        284,        284,        1,   194400, 0xa99bf55a
-0,        285,        285,        1,   194400, 0x4f840d51
-0,        286,        286,        1,   194400, 0x58941945
-0,        287,        287,        1,   194400, 0x62cb2638
-0,        288,        288,        1,   194400, 0x22ee312d
-0,        289,        289,        1,   194400, 0xea8f3925
-0,        290,        290,        1,   194400, 0xed294c12
-0,        291,        291,        1,   194400, 0xafa75e00
-0,        292,        292,        1,   194400, 0x19d45ffe
-0,        293,        293,        1,   194400, 0x7fcf61fc
-0,        294,        294,        1,   194400, 0x2c126df0
-0,        295,        295,        1,   194400, 0x331379e4
-0,        296,        296,        1,   194400, 0x99fe8cd1
-0,        297,        297,        1,   194400, 0xa5ec98c5
-0,        298,        298,        1,   194400, 0xac68a6b7
-0,        299,        299,        1,   194400, 0x28e6b2ab
diff --git a/deps/libav/tests/ref/fate/cdxl-bitline-ham6 b/deps/libav/tests/ref/fate/cdxl-bitline-ham6
deleted file mode 100644
index e4071a9..0000000
--- a/deps/libav/tests/ref/fate/cdxl-bitline-ham6
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/11025
-0,          0,          0,        0,    63180, 0xcda82c16
-0,        220,        220,        0,    63180, 0xa6097bf9
-0,        440,        440,        0,    63180, 0x4c2fb091
-0,        660,        660,        0,    63180, 0xc597db00
-0,        880,        880,        0,    63180, 0xfa581ccd
-0,       1100,       1100,        0,    63180, 0x3e51498f
-0,       1320,       1320,        0,    63180, 0xe3495396
-0,       1540,       1540,        0,    63180, 0x425f5f02
-0,       1760,       1760,        0,    63180, 0x6077465f
-0,       1980,       1980,        0,    63180, 0x923ba29c
diff --git a/deps/libav/tests/ref/fate/cdxl-demux b/deps/libav/tests/ref/fate/cdxl-demux
deleted file mode 100644
index 7e4c4c8..0000000
--- a/deps/libav/tests/ref/fate/cdxl-demux
+++ /dev/null
@@ -1,21 +0,0 @@
-#tb 0: 1/11025
-#tb 1: 1/11025
-0,          0,          0,     1884,    22688, 0xc954a244
-1,          0,          0,     1884,     1884, 0x06925e3e
-0,       1884,       1884,     1884,    22688, 0x3ee4a304
-1,       1884,       1884,     1884,     1884, 0x1957ab65
-0,       3768,       3768,     1884,    22688, 0x9777a305
-1,       3768,       3768,     1884,     1884, 0x7fcd6e47
-0,       5652,       5652,     1884,    22688, 0xf00aa306
-1,       5652,       5652,     1884,     1884, 0xc974878e
-0,       7536,       7536,     1884,    22688, 0x48aca307
-1,       7536,       7536,     1884,     1884, 0xecb5c4c8
-0,       9420,       9420,     1884,    22688, 0xa13fa308
-1,       9420,       9420,     1884,     1884, 0x87adce5f
-0,      11304,      11304,     1884,    22688, 0xf9d2a309
-1,      11304,      11304,     1884,     1884, 0x3cf097e4
-0,      13188,      13188,     1884,    22688, 0x5274a30a
-1,      13188,      13188,     1884,     1884, 0xcc218105
-0,      15072,      15072,     1884,    22688, 0xab07a30b
-1,      15072,      15072,     1884,     1884, 0xf685762f
-0,      16956,      16956,     1884,    17896, 0x1a696b6e
diff --git a/deps/libav/tests/ref/fate/cdxl-ham6 b/deps/libav/tests/ref/fate/cdxl-ham6
deleted file mode 100644
index 25886b2..0000000
--- a/deps/libav/tests/ref/fate/cdxl-ham6
+++ /dev/null
@@ -1,17 +0,0 @@
-#tb 0: 1/11025
-0,          0,          0,        0,    57600, 0x87887a7b
-0,       1092,       1092,        0,    57600, 0x10c301d2
-0,       2184,       2184,        0,    57600, 0xd1a6f910
-0,       3276,       3276,        0,    57600, 0x20242bb9
-0,       4368,       4368,        0,    57600, 0xae33cb7f
-0,       5460,       5460,        0,    57600, 0x501b82c8
-0,       6552,       6552,        0,    57600, 0x84199043
-0,       7644,       7644,        0,    57600, 0x946a6dbb
-0,       8736,       8736,        0,    57600, 0xeacea671
-0,       9828,       9828,        0,    57600, 0x77b8723f
-0,      10920,      10920,        0,    57600, 0x371cdb09
-0,      12012,      12012,        0,    57600, 0xa16ef5ee
-0,      13104,      13104,        0,    57600, 0xcb6abd9e
-0,      14196,      14196,        0,    57600, 0xb73e800f
-0,      15288,      15288,        0,    57600, 0x368bd93e
-0,      16380,      16380,        0,    57600, 0xcde72dc5
diff --git a/deps/libav/tests/ref/fate/cdxl-ham8 b/deps/libav/tests/ref/fate/cdxl-ham8
deleted file mode 100644
index 356ad1b..0000000
--- a/deps/libav/tests/ref/fate/cdxl-ham8
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/11025
-0,          0,          0,        0,    67584, 0xce0cade5
diff --git a/deps/libav/tests/ref/fate/cdxl-pal8 b/deps/libav/tests/ref/fate/cdxl-pal8
deleted file mode 100644
index f5c319a..0000000
--- a/deps/libav/tests/ref/fate/cdxl-pal8
+++ /dev/null
@@ -1,12 +0,0 @@
-#tb 0: 1/11025
-0,          0,          0,        0,    67584, 0x5eae629b
-0,        220,        220,        0,    67584, 0x32591227
-0,        440,        440,        0,    67584, 0x4e4424c7
-0,        660,        660,        0,    67584, 0x70db0134
-0,        880,        880,        0,    67584, 0x3550ed0b
-0,       1100,       1100,        0,    67584, 0x86fe3eef
-0,       1320,       1320,        0,    67584, 0x3414bb33
-0,       1540,       1540,        0,    67584, 0x667bfb91
-0,       1760,       1760,        0,    67584, 0x6e1a4ccb
-0,       1980,       1980,        0,    67584, 0xf723f9ae
-0,       2200,       2200,        0,    67584, 0x88481d5d
diff --git a/deps/libav/tests/ref/fate/cdxl-pal8-small b/deps/libav/tests/ref/fate/cdxl-pal8-small
deleted file mode 100644
index d285e9a..0000000
--- a/deps/libav/tests/ref/fate/cdxl-pal8-small
+++ /dev/null
@@ -1,47 +0,0 @@
-#tb 0: 1/11025
-0,          0,          0,        0,    30720, 0x0d552cfd
-0,        368,        368,        0,    30720, 0x3cf93291
-0,        736,        736,        0,    30720, 0xe45b2868
-0,       1104,       1104,        0,    30720, 0xb5df289b
-0,       1472,       1472,        0,    30720, 0x2562259e
-0,       1840,       1840,        0,    30720, 0xbf171878
-0,       2208,       2208,        0,    30720, 0x695b1d73
-0,       2576,       2576,        0,    30720, 0x89ef1614
-0,       2944,       2944,        0,    30720, 0xe12a1dd9
-0,       3312,       3312,        0,    30720, 0x49622ffa
-0,       3680,       3680,        0,    30720, 0xd6832703
-0,       4048,       4048,        0,    30720, 0xec1d0cb7
-0,       4416,       4416,        0,    30720, 0x8bee0525
-0,       4784,       4784,        0,    30720, 0x1e0cf0c4
-0,       5152,       5152,        0,    30720, 0xf83fd9db
-0,       5520,       5520,        0,    30720, 0xffb0d6ab
-0,       5888,       5888,        0,    30720, 0xe37fe239
-0,       6256,       6256,        0,    30720, 0x74b0f856
-0,       6624,       6624,        0,    30720, 0x9c88d3e1
-0,       6992,       6992,        0,    30720, 0x714db368
-0,       7360,       7360,        0,    30720, 0x6c8e8860
-0,       7728,       7728,        0,    30720, 0x804968e6
-0,       8096,       8096,        0,    30720, 0x7ac56ae4
-0,       8464,       8464,        0,    30720, 0xffd85cbf
-0,       8832,       8832,        0,    30720, 0x1f8455f9
-0,       9200,       9200,        0,    30720, 0x3ae65296
-0,       9568,       9568,        0,    30720, 0x9e544ecd
-0,       9936,       9936,        0,    30720, 0x35678e5a
-0,      10304,      10304,        0,    30720, 0x04bae866
-0,      10672,      10672,        0,    30720, 0xb126ed94
-0,      11040,      11040,        0,    30720, 0x1720efc5
-0,      11408,      11408,        0,    30720, 0x4c1b01c2
-0,      11776,      11776,        0,    30720, 0xd0a1e866
-0,      12144,      12144,        0,    30720, 0x0d330789
-0,      12512,      12512,        0,    30720, 0xf5ac08bb
-0,      12880,      12880,        0,    30720, 0x9abe0d83
-0,      13248,      13248,        0,    30720, 0xa44c02f4
-0,      13616,      13616,        0,    30720, 0xdc4cc688
-0,      13984,      13984,        0,    30720, 0x22eef3c1
-0,      14352,      14352,        0,    30720, 0xcfbc0d1d
-0,      14720,      14720,        0,    30720, 0x7104ea31
-0,      15088,      15088,        0,    30720, 0x80daecfb
-0,      15456,      15456,        0,    30720, 0xe1bab995
-0,      15824,      15824,        0,    30720, 0x43f4b896
-0,      16192,      16192,        0,    30720, 0xa0d2bf5c
-0,      16560,      16560,        0,    30720, 0x3556a114
diff --git a/deps/libav/tests/ref/fate/cljr b/deps/libav/tests/ref/fate/cljr
deleted file mode 100644
index f73c8c0..0000000
--- a/deps/libav/tests/ref/fate/cljr
+++ /dev/null
@@ -1,37 +0,0 @@
-#tb 0: 3521/100000
-0,          0,          0,        1,    64800, 0x44a1c47c
-0,          1,          1,        1,    64800, 0x649cc3a4
-0,          2,          2,        1,    64800, 0xcab1b88c
-0,          3,          3,        1,    64800, 0xf56cb788
-0,          4,          4,        1,    64800, 0x5336b618
-0,          5,          5,        1,    64800, 0x2704b438
-0,          6,          6,        1,    64800, 0x04c7b8e4
-0,          7,          7,        1,    64800, 0x3185b288
-0,          8,          8,        1,    64800, 0xa537c410
-0,          9,          9,        1,    64800, 0x6495c0f8
-0,         10,         10,        1,    64800, 0x06a1ca14
-0,         11,         11,        1,    64800, 0x69cdd2a0
-0,         12,         12,        1,    64800, 0x4ad2d828
-0,         13,         13,        1,    64800, 0x9604dea4
-0,         14,         14,        1,    64800, 0x1c00e430
-0,         15,         15,        1,    64800, 0x9afeefe0
-0,         16,         16,        1,    64800, 0xc13fdd78
-0,         17,         17,        1,    64800, 0x8438da7c
-0,         18,         18,        1,    64800, 0xa0ead278
-0,         19,         19,        1,    64800, 0xbeced2d8
-0,         20,         20,        1,    64800, 0x85bbd7dc
-0,         21,         21,        1,    64800, 0xbe59ce34
-0,         22,         22,        1,    64800, 0xd76ecccc
-0,         23,         23,        1,    64800, 0xe182b474
-0,         24,         24,        1,    64800, 0x916cc394
-0,         25,         25,        1,    64800, 0x7efebd14
-0,         26,         26,        1,    64800, 0x8d28c9f0
-0,         27,         27,        1,    64800, 0x00a1c960
-0,         28,         28,        1,    64800, 0xc164c400
-0,         29,         29,        1,    64800, 0xfd4dc544
-0,         30,         30,        1,    64800, 0x01bfbe38
-0,         31,         31,        1,    64800, 0xff11b5d0
-0,         32,         32,        1,    64800, 0x4876bb20
-0,         33,         33,        1,    64800, 0x756ecb04
-0,         34,         34,        1,    64800, 0x3b8cd540
-0,         35,         35,        1,    64800, 0x063ed444
diff --git a/deps/libav/tests/ref/fate/cllc-argb b/deps/libav/tests/ref/fate/cllc-argb
deleted file mode 100644
index 0283863..0000000
--- a/deps/libav/tests/ref/fate/cllc-argb
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1001/24000
-0,          0,          0,        1,  3686400, 0xb37a6e69
-0,          1,          1,        1,  3686400, 0x66a45032
-0,          2,          2,        1,  3686400, 0xdf0c861f
-0,          3,          3,        1,  3686400, 0xa4a68cdb
diff --git a/deps/libav/tests/ref/fate/cllc-rgb b/deps/libav/tests/ref/fate/cllc-rgb
deleted file mode 100644
index 06d54da..0000000
--- a/deps/libav/tests/ref/fate/cllc-rgb
+++ /dev/null
@@ -1,15 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,   921600, 0x82e44cb9
-0,          1,          1,        1,   921600, 0x6ecc8a6c
-0,          2,          2,        1,   921600, 0x0dc31839
-0,          3,          3,        1,   921600, 0x8ed6fb3c
-0,          4,          4,        1,   921600, 0x72d759fd
-0,          5,          5,        1,   921600, 0x3941e84d
-0,          6,          6,        1,   921600, 0x9e63f5cd
-0,          7,          7,        1,   921600, 0xbce4f1cc
-0,          8,          8,        1,   921600, 0xb531bd5d
-0,          9,          9,        1,   921600, 0xab28aada
-0,         10,         10,        1,   921600, 0x49f21d52
-0,         11,         11,        1,   921600, 0x4d7488fa
-0,         12,         12,        1,   921600, 0x16b9c9c9
-0,         13,         13,        1,   921600, 0xa0a4f77f
diff --git a/deps/libav/tests/ref/fate/cllc-yuy2-noblock b/deps/libav/tests/ref/fate/cllc-yuy2-noblock
deleted file mode 100644
index 2cb9e78..0000000
--- a/deps/libav/tests/ref/fate/cllc-yuy2-noblock
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,   614400, 0x088c51de
-0,          1,          1,        1,   614400, 0x93fff662
-0,          2,          2,        1,   614400, 0x90ba6c28
-0,          3,          3,        1,   614400, 0x55b7ae46
-0,          4,          4,        1,   614400, 0xef4fc678
-0,          5,          5,        1,   614400, 0xc838a54c
-0,          6,          6,        1,   614400, 0xb6016823
-0,          7,          7,        1,   614400, 0x7fd65ea7
-0,          8,          8,        1,   614400, 0xca9c35b9
-0,          9,          9,        1,   614400, 0x33f902ee
-0,         10,         10,        1,   614400, 0x53f2ea7a
-0,         11,         11,        1,   614400, 0x3ecae1c7
-0,         12,         12,        1,   614400, 0x2d8fd7cc
-0,         13,         13,        1,   614400, 0xd9dfc2ef
-0,         14,         14,        1,   614400, 0xaf95cef0
diff --git a/deps/libav/tests/ref/fate/corepng b/deps/libav/tests/ref/fate/corepng
deleted file mode 100644
index e200714..0000000
--- a/deps/libav/tests/ref/fate/corepng
+++ /dev/null
@@ -1,39 +0,0 @@
-#tb 0: 1/15
-#tb 1: 1/11025
-0,          0,          0,        1,   230400, 0x03e25ead
-1,          0,          0,     5513,    11026, 0x27ad637c
-0,          1,          1,        1,   230400, 0x0a520ffd
-0,          2,          2,        1,   230400, 0x0b11a671
-0,          3,          3,        1,   230400, 0x7d3fce32
-0,          4,          4,        1,   230400, 0x1edb18cc
-0,          5,          5,        1,   230400, 0x1d470493
-0,          6,          6,        1,   230400, 0xe53ba01d
-0,          7,          7,        1,   230400, 0xc4df13c2
-1,       5513,       5513,      735,     1470, 0x4af4b7a3
-0,          8,          8,        1,   230400, 0x5febe6c9
-1,       6248,       6248,      735,     1470, 0x2601fc3b
-0,          9,          9,        1,   230400, 0xb0de2ed9
-1,       6983,       6983,      735,     1470, 0xd94ec488
-0,         10,         10,        1,   230400, 0x4991ee21
-1,       7718,       7718,      735,     1470, 0x5ffb6bdd
-0,         11,         11,        1,   230400, 0x6b367a75
-1,       8453,       8453,      735,     1470, 0xc5fece50
-0,         12,         12,        1,   230400, 0x1d406b55
-1,       9188,       9188,      735,     1470, 0xf4988a98
-0,         13,         13,        1,   230400, 0x2bbbf1d3
-1,       9923,       9923,      735,     1470, 0xa839620f
-0,         14,         14,        1,   230400, 0x2a5ee265
-1,      10658,      10658,      735,     1470, 0x800a77ff
-0,         15,         15,        1,   230400, 0x0ae9de8d
-1,      11393,      11393,      735,     1470, 0x8fc8a729
-0,         16,         16,        1,   230400, 0x567eabf8
-1,      12128,      12128,      735,     1470, 0x78708001
-0,         17,         17,        1,   230400, 0x00260e67
-1,      12863,      12863,      735,     1470, 0xb601958b
-1,      13598,      13598,      735,     1470, 0xb054d1d3
-1,      14333,      14333,      735,     1470, 0xce18bb41
-1,      15068,      15068,      735,     1470, 0x43d182f9
-1,      15803,      15803,      735,     1470, 0xe9448449
-1,      16538,      16538,      735,     1470, 0x175ea4b3
-1,      17273,      17273,      735,     1470, 0xf96b0e6a
-1,      18008,      18008,      735,     1470, 0x12cc42fb
diff --git a/deps/libav/tests/ref/fate/crc b/deps/libav/tests/ref/fate/crc
deleted file mode 100644
index 1c24aea..0000000
--- a/deps/libav/tests/ref/fate/crc
+++ /dev/null
@@ -1,4 +0,0 @@
-crc EDB88320 = 3D5CDD04
-crc 04C11DB7 = E0BAF5C0
-crc 00008005 = BB1F
-crc 00000007 = E3
diff --git a/deps/libav/tests/ref/fate/creatureshock-avs b/deps/libav/tests/ref/fate/creatureshock-avs
deleted file mode 100644
index 979baf6..0000000
--- a/deps/libav/tests/ref/fate/creatureshock-avs
+++ /dev/null
@@ -1,94 +0,0 @@
-#tb 0: 1/90000
-#tb 1: 1/22222
-0,          0,          0,        0,   188892, 0xcb5be3dd
-1,          0,          0,     8186,    16372, 0xfaaab59d
-0,       6000,       6000,        0,   188892, 0x0f313ebc
-0,      12000,      12000,        0,   188892, 0xc0da25cc
-0,      18000,      18000,        0,   188892, 0xad6e1d44
-0,      24000,      24000,        0,   188892, 0xb1103b40
-0,      30000,      30000,        0,   188892, 0xae033450
-1,       8186,       8186,     2014,     4028, 0xc2daed72
-0,      36000,      36000,        0,   188892, 0xb31f03b4
-1,      10200,      10200,     2743,     5486, 0xf7fd794d
-0,      42000,      42000,        0,   188892, 0xacb2d3f9
-0,      48000,      48000,        0,   188892, 0x7d77ecbd
-1,      12943,      12943,     2895,     5790, 0xfd5a369f
-0,      54000,      54000,        0,   188892, 0x7faa2f6c
-0,      60000,      60000,        0,   188892, 0x28f4fdf1
-1,      15838,      15838,      534,     1068, 0x0b602cd0
-0,      66000,      66000,        0,   188892, 0x4b53f3b9
-1,      16372,      16372,     2454,     4908, 0xfe870aad
-0,      72000,      72000,        0,   188892, 0x1f09bb29
-1,      18826,      18826,     3031,     6062, 0x8a4d6e0f
-0,      78000,      78000,        0,   188892, 0x3afcc11d
-0,      84000,      84000,        0,   188892, 0x6b918e49
-1,      21857,      21857,     2701,     5402, 0x71fd352f
-0,      90000,      90000,        0,   188892, 0x9630a04d
-0,      96000,      96000,        0,   188892, 0x9381b4c1
-1,      24558,      24558,      272,      544, 0xeb766d34
-1,      24830,      24830,     2953,     5906, 0x47ac7e08
-0,     102000,     102000,        0,   188892, 0xa7dea7e5
-0,     108000,     108000,        0,   188892, 0xd277c41d
-1,      27783,      27783,     2958,     5916, 0x0d26eb56
-0,     114000,     114000,        0,   188892, 0xafa2a6c9
-0,     120000,     120000,        0,   188892, 0x13a38839
-1,      30741,      30741,     2003,     4006, 0x9941c71a
-0,     126000,     126000,        0,   188892, 0xcd5e5a6d
-0,     132000,     132000,        0,   188892, 0xe7da71e9
-1,      32744,      32744,     1050,     2100, 0xc9a2ee36
-1,      33794,      33794,     2947,     5894, 0xd2ba4eaa
-0,     138000,     138000,        0,   188892, 0x06928add
-0,     144000,     144000,        0,   188892, 0x4a108eb9
-1,      36741,      36741,     3045,     6090, 0xf43e73d0
-0,     150000,     150000,        0,   188892, 0xea2598f5
-0,     156000,     156000,        0,   188892, 0x17ed6839
-1,      39786,      39786,     1144,     2288, 0x5a8b7aa0
-0,     162000,     162000,        0,   188892, 0x9de6ab65
-1,      40930,      40930,     1925,     3850, 0x7f66eb2c
-0,     168000,     168000,        0,   188892, 0xb4ee326f
-1,      42855,      42855,     2898,     5796, 0xc5cf3ee8
-0,     174000,     174000,        0,   188892, 0x3f85095b
-0,     180000,     180000,        0,   188892, 0xaab7e331
-1,      45753,      45753,     3021,     6042, 0xed80136d
-0,     186000,     186000,        0,   188892, 0xc2a079e1
-0,     192000,     192000,        0,   188892, 0x612080c2
-1,      48774,      48774,      342,      684, 0xc42bd137
-0,     198000,     198000,        0,   188892, 0xa7232d47
-1,      49116,      49116,     2718,     5436, 0xb7f8a6fd
-0,     204000,     204000,        0,   188892, 0xc053297d
-1,      51834,      51834,     3049,     6098, 0xee6354a2
-0,     210000,     210000,        0,   188892, 0x1ecc3bfe
-0,     216000,     216000,        0,   188892, 0xcc4ac803
-0,     222000,     222000,        0,   188892, 0x4b90047b
-1,      54883,      54883,     2419,     4838, 0x129e61d0
-0,     228000,     228000,        0,   188892, 0xd863b643
-1,      57302,      57302,      537,     1074, 0x9da90634
-0,     234000,     234000,        0,   188892, 0x93a25fb1
-1,      57839,      57839,     3042,     6084, 0x8ffed952
-0,     240000,     240000,        0,   188892, 0xf969e131
-0,     246000,     246000,        0,   188892, 0x73bd2469
-1,      60881,      60881,     3019,     6038, 0xa07b4276
-0,     252000,     252000,        0,   188892, 0x265a9ce2
-0,     258000,     258000,        0,   188892, 0xd59ccd39
-1,      63900,      63900,     1588,     3176, 0xebef63c1
-0,     264000,     264000,        0,   188892, 0xe50fc068
-1,      65488,      65488,     1397,     2794, 0xbe1000db
-0,     270000,     270000,        0,   188892, 0x83113a86
-1,      66885,      66885,     3010,     6020, 0xd8e34961
-0,     276000,     276000,        0,   188892, 0xa0203504
-0,     282000,     282000,        0,   188892, 0x9e2d518c
-1,      69895,      69895,     3010,     6020, 0xc07cf461
-0,     288000,     288000,        0,   188892, 0x5f610e66
-0,     294000,     294000,        0,   188892, 0x9b77f900
-1,      72905,      72905,      769,     1538, 0xc975ae02
-1,      73674,      73674,     2115,     4230, 0x0827111b
-0,     300000,     300000,        0,   188892, 0xaaf279c2
-0,     306000,     306000,        0,   188892, 0x4ac97cc2
-1,      75789,      75789,     3042,     6084, 0x2cf0a407
-0,     312000,     312000,        0,   188892, 0xddd91642
-0,     318000,     318000,        0,   188892, 0x4f32dcd1
-1,      78831,      78831,     2914,     5828, 0x12750279
-0,     324000,     324000,        0,   188892, 0xdc126b42
-0,     330000,     330000,        0,   188892, 0x00000000
-1,      81745,      81745,      115,      230, 0xc9c03f3b
-1,      81860,      81860,      384,      768, 0x6137a04d
diff --git a/deps/libav/tests/ref/fate/cscd b/deps/libav/tests/ref/fate/cscd
deleted file mode 100644
index 74fe94e..0000000
--- a/deps/libav/tests/ref/fate/cscd
+++ /dev/null
@@ -1,209 +0,0 @@
-#tb 0: 1/200
-0,          0,          0,        1,   270000, 0xf90015d8
-0,          9,          9,        1,   270000, 0xf90015d8
-0,         15,         15,        1,   270000, 0xf90015d8
-0,         22,         22,        1,   270000, 0xf90015d8
-0,         28,         28,        1,   270000, 0xf90015d8
-0,         34,         34,        1,   270000, 0xf90015d8
-0,         40,         40,        1,   270000, 0xf90015d8
-0,         47,         47,        1,   270000, 0xf90015d8
-0,         53,         53,        1,   270000, 0xf90015d8
-0,         59,         59,        1,   270000, 0xf90015d8
-0,         65,         65,        1,   270000, 0xf90015d8
-0,         72,         72,        1,   270000, 0xf90015d8
-0,         78,         78,        1,   270000, 0xf90015d8
-0,         84,         84,        1,   270000, 0xf90015d8
-0,         93,         93,        1,   270000, 0xf90015d8
-0,        100,        100,        1,   270000, 0xf90015d8
-0,        106,        106,        1,   270000, 0xf90015d8
-0,        112,        112,        1,   270000, 0xf90015d8
-0,        118,        118,        1,   270000, 0xf90015d8
-0,        125,        125,        1,   270000, 0xf90015d8
-0,        131,        131,        1,   270000, 0xf90015d8
-0,        137,        137,        1,   270000, 0xf90015d8
-0,        143,        143,        1,   270000, 0xf90015d8
-0,        150,        150,        1,   270000, 0xf90015d8
-0,        156,        156,        1,   270000, 0xf90015d8
-0,        162,        162,        1,   270000, 0xf90015d8
-0,        168,        168,        1,   270000, 0xf90015d8
-0,        175,        175,        1,   270000, 0xf90015d8
-0,        181,        181,        1,   270000, 0xf90015d8
-0,        187,        187,        1,   270000, 0xf90015d8
-0,        193,        193,        1,   270000, 0xf90015d8
-0,        200,        200,        1,   270000, 0xf90015d8
-0,        206,        206,        1,   270000, 0xf90015d8
-0,        212,        212,        1,   270000, 0xf90015d8
-0,        218,        218,        1,   270000, 0xf90015d8
-0,        225,        225,        1,   270000, 0xf90015d8
-0,        231,        231,        1,   270000, 0xf90015d8
-0,        237,        237,        1,   270000, 0xf90015d8
-0,        243,        243,        1,   270000, 0xf90015d8
-0,        253,        253,        1,   270000, 0x1f9c15d8
-0,        262,        262,        1,   270000, 0x436f15d8
-0,        268,        268,        1,   270000, 0xe90115d8
-0,        275,        275,        1,   270000, 0xe90115d8
-0,        281,        281,        1,   270000, 0x8ea215d8
-0,        290,        290,        1,   270000, 0x424015d8
-0,        300,        300,        1,   270000, 0x0ce315d8
-0,        309,        309,        1,   270000, 0x14bc15d8
-0,        318,        318,        1,   270000, 0x2a9215d8
-0,        328,        328,        1,   270000, 0x233f15d8
-0,        337,        337,        1,   270000, 0x764b15d8
-0,        347,        347,        1,   270000, 0xf76115d8
-0,        356,        356,        1,   270000, 0xbbe015d8
-0,        365,        365,        1,   270000, 0x95af15d8
-0,        375,        375,        1,   270000, 0x324815d8
-0,        384,        384,        1,   270000, 0x311915d8
-0,        393,        393,        1,   270000, 0x090ef191
-0,        403,        403,        1,   270000, 0xd88974dc
-0,        412,        412,        1,   270000, 0xfa7f58df
-0,        422,        422,        1,   270000, 0x78f849c3
-0,        431,        431,        1,   270000, 0xae174892
-0,        440,        440,        1,   270000, 0x9d4e2332
-0,        450,        450,        1,   270000, 0x874b09b4
-0,        459,        459,        1,   270000, 0x4069fed6
-0,        465,        465,        1,   270000, 0x4069fed6
-0,        472,        472,        1,   270000, 0x4069fed6
-0,        478,        478,        1,   270000, 0x4069fed6
-0,        484,        484,        1,   270000, 0x4069fed6
-0,        490,        490,        1,   270000, 0x4069fed6
-0,        500,        500,        1,   270000, 0x4069fed6
-0,        506,        506,        1,   270000, 0x4069fed6
-0,        512,        512,        1,   270000, 0x4069fed6
-0,        518,        518,        1,   270000, 0x4069fed6
-0,        525,        525,        1,   270000, 0x4069fed6
-0,        553,        553,        1,   270000, 0x773db046
-0,        559,        559,        1,   270000, 0x773db046
-0,        565,        565,        1,   270000, 0x773db046
-0,        572,        572,        1,   270000, 0x773db046
-0,        578,        578,        1,   270000, 0x773db046
-0,        584,        584,        1,   270000, 0x773db046
-0,        590,        590,        1,   270000, 0x773db046
-0,        597,        597,        1,   270000, 0x773db046
-0,        603,        603,        1,   270000, 0x773db046
-0,        609,        609,        1,   270000, 0x773db046
-0,        615,        615,        1,   270000, 0x773db046
-0,        622,        622,        1,   270000, 0x773db046
-0,        628,        628,        1,   270000, 0x773db046
-0,        634,        634,        1,   270000, 0x773db046
-0,        640,        640,        1,   270000, 0x773db046
-0,        647,        647,        1,   270000, 0x773db046
-0,        653,        653,        1,   270000, 0x773db046
-0,        662,        662,        1,   270000, 0x17b9aec9
-0,        672,        672,        1,   270000, 0x622fad4c
-0,        681,        681,        1,   270000, 0xdaea3aef
-0,        687,        687,        1,   270000, 0x61bb10e3
-0,        693,        693,        1,   270000, 0xfc37ee0c
-0,        703,        703,        1,   270000, 0x50dbd01e
-0,        712,        712,        1,   270000, 0xcd66c27c
-0,        722,        722,        1,   270000, 0xd13f1e4f
-0,        731,        731,        1,   270000, 0xa4a2dbf5
-0,        740,        740,        1,   270000, 0xf302c9ab
-0,        750,        750,        1,   270000, 0x4479f7fe
-0,        759,        759,        1,   270000, 0x1afe92c8
-0,        768,        768,        1,   270000, 0x3007f4c3
-0,        778,        778,        1,   270000, 0x5834c096
-0,        784,        784,        1,   270000, 0x40109126
-0,        790,        790,        1,   270000, 0x0a7b8882
-0,        800,        800,        1,   270000, 0x15b8635d
-0,        806,        806,        1,   270000, 0xeaa5598e
-0,        812,        812,        1,   270000, 0x0b7b5489
-0,        818,        818,        1,   270000, 0x0b7b5489
-0,        825,        825,        1,   270000, 0x0b7b5489
-0,        831,        831,        1,   270000, 0x0b7b5489
-0,        837,        837,        1,   270000, 0x8f0e6eaa
-0,        847,        847,        1,   270000, 0xc46fc0f2
-0,        856,        856,        1,   270000, 0xadd7e605
-0,        865,        865,        1,   270000, 0x9d23a056
-0,        875,        875,        1,   270000, 0x365afa63
-0,        884,        884,        1,   270000, 0x6ac3bda2
-0,        893,        893,        1,   270000, 0x14f5daf2
-0,        903,        903,        1,   270000, 0x4b3afb6a
-0,        909,        909,        1,   270000, 0x1a3302e3
-0,        915,        915,        1,   270000, 0x1a3302e3
-0,        922,        922,        1,   270000, 0x1a3302e3
-0,        928,        928,        1,   270000, 0x1a3302e3
-0,        934,        934,        1,   270000, 0xc15526e2
-0,        943,        943,        1,   270000, 0x3dd73006
-0,        953,        953,        1,   270000, 0x60abb5bc
-0,        962,        962,        1,   270000, 0xb960c27c
-0,        968,        968,        1,   270000, 0x8fa4c01c
-0,        975,        975,        1,   270000, 0x8fa4c01c
-0,        981,        981,        1,   270000, 0x8fa4c01c
-0,        987,        987,        1,   270000, 0xb20dcc38
-0,        997,        997,        1,   270000, 0x03c6ad3c
-0,       1006,       1006,        1,   270000, 0xe550b194
-0,       1012,       1012,        1,   270000, 0xe550b194
-0,       1018,       1018,        1,   270000, 0xe550b194
-0,       1025,       1025,        1,   270000, 0xe550b194
-0,       1031,       1031,        1,   270000, 0xe550b194
-0,       1037,       1037,        1,   270000, 0xe550b194
-0,       1043,       1043,        1,   270000, 0xe550b194
-0,       1050,       1050,        1,   270000, 0xe550b194
-0,       1056,       1056,        1,   270000, 0xe550b194
-0,       1062,       1062,        1,   270000, 0xe550b194
-0,       1068,       1068,        1,   270000, 0xe550b194
-0,       1075,       1075,        1,   270000, 0xe550b194
-0,       1081,       1081,        1,   270000, 0xe550b194
-0,       1087,       1087,        1,   270000, 0xe550b194
-0,       1093,       1093,        1,   270000, 0x4550a014
-0,       1103,       1103,        1,   270000, 0xaf639da8
-0,       1112,       1112,        1,   270000, 0xe4229da8
-0,       1118,       1118,        1,   270000, 0x315d9da8
-0,       1125,       1125,        1,   270000, 0x7e899da8
-0,       1134,       1134,        1,   270000, 0x99b9a8a0
-0,       1143,       1143,        1,   270000, 0x4588ac2a
-0,       1153,       1153,        1,   270000, 0x1e79ae6e
-0,       1162,       1162,        1,   270000, 0xa003cb14
-0,       1172,       1172,        1,   270000, 0x03ef1bb8
-0,       1181,       1181,        1,   270000, 0x3b3f30fc
-0,       1190,       1190,        1,   270000, 0x4dad3525
-0,       1200,       1200,        1,   270000, 0x5b600c12
-0,       1209,       1209,        1,   270000, 0x75a1fab3
-0,       1218,       1218,        1,   270000, 0xc9f7d9ad
-0,       1228,       1228,        1,   270000, 0x9eaec58d
-0,       1237,       1237,        1,   270000, 0xb91bc3e8
-0,       1247,       1247,        1,   270000, 0x77bdbbfb
-0,       1253,       1253,        1,   270000, 0x77bdbbfb
-0,       1259,       1259,        1,   270000, 0x77bdbbfb
-0,       1265,       1265,        1,   270000, 0x77bdbbfb
-0,       1272,       1272,        1,   270000, 0x77bdbbfb
-0,       1278,       1278,        1,   270000, 0x77bdbbfb
-0,       1287,       1287,        1,   270000, 0x3d54eac2
-0,       1293,       1293,        1,   270000, 0x3d54eac2
-0,       1300,       1300,        1,   270000, 0x3d54eac2
-0,       1306,       1306,        1,   270000, 0x3d54eac2
-0,       1315,       1315,        1,   270000, 0x3d54eac2
-0,       1322,       1322,        1,   270000, 0x3d54eac2
-0,       1328,       1328,        1,   270000, 0x3d54eac2
-0,       1334,       1334,        1,   270000, 0x3d54eac2
-0,       1340,       1340,        1,   270000, 0x3d54eac2
-0,       1347,       1347,        1,   270000, 0x3d54eac2
-0,       1353,       1353,        1,   270000, 0x3d54eac2
-0,       1359,       1359,        1,   270000, 0x3d54eac2
-0,       1365,       1365,        1,   270000, 0x3d54eac2
-0,       1372,       1372,        1,   270000, 0x3d54eac2
-0,       1378,       1378,        1,   270000, 0x3d54eac2
-0,       1384,       1384,        1,   270000, 0x3d54eac2
-0,       1390,       1390,        1,   270000, 0x3d54eac2
-0,       1397,       1397,        1,   270000, 0x3d54eac2
-0,       1403,       1403,        1,   270000, 0x3d54eac2
-0,       1412,       1412,        1,   270000, 0x5f3609ba
-0,       1422,       1422,        1,   270000, 0x80921b0c
-0,       1428,       1428,        1,   270000, 0x80921b0c
-0,       1434,       1434,        1,   270000, 0x80921b0c
-0,       1440,       1440,        1,   270000, 0x80921b0c
-0,       1447,       1447,        1,   270000, 0x80921b0c
-0,       1453,       1453,        1,   270000, 0x80921b0c
-0,       1459,       1459,        1,   270000, 0x80921b0c
-0,       1465,       1465,        1,   270000, 0x80921b0c
-0,       1472,       1472,        1,   270000, 0x80921b0c
-0,       1478,       1478,        1,   270000, 0x80921b0c
-0,       1484,       1484,        1,   270000, 0x80921b0c
-0,       1490,       1490,        1,   270000, 0x80921b0c
-0,       1497,       1497,        1,   270000, 0x80921b0c
-0,       1503,       1503,        1,   270000, 0x80921b0c
-0,       1509,       1509,        1,   270000, 0x80921b0c
-0,       1515,       1515,        1,   270000, 0x80921b0c
-0,       1525,       1525,        1,   270000, 0xf0e626a8
-0,       1531,       1531,        1,   270000, 0xf0e626a8
diff --git a/deps/libav/tests/ref/fate/cvid-grayscale b/deps/libav/tests/ref/fate/cvid-grayscale
deleted file mode 100644
index 87ca600..0000000
--- a/deps/libav/tests/ref/fate/cvid-grayscale
+++ /dev/null
@@ -1,153 +0,0 @@
-#tb 0: 99561/500000
-0,          0,          0,        1,    11300, 0x46c78923
-0,          1,          1,        1,    11300, 0x3f2a1175
-0,          2,          2,        1,    11300, 0x722de221
-0,          3,          3,        1,    11300, 0x01746b88
-0,          4,          4,        1,    11300, 0x549587a7
-0,          5,          5,        1,    11300, 0x843ab943
-0,          6,          6,        1,    11300, 0x62fdee48
-0,          7,          7,        1,    11300, 0x74a62867
-0,          8,          8,        1,    11300, 0x35a20e2f
-0,          9,          9,        1,    11300, 0x4e9ef54d
-0,         10,         10,        1,    11300, 0xec7201f5
-0,         11,         11,        1,    11300, 0x363bfe27
-0,         12,         12,        1,    11300, 0x2aaab418
-0,         13,         13,        1,    11300, 0x6a48ab3f
-0,         14,         14,        1,    11300, 0x3fecea34
-0,         15,         15,        1,    11300, 0xa371f55e
-0,         16,         16,        1,    11300, 0xa86b147c
-0,         17,         17,        1,    11300, 0x49e9206e
-0,         18,         18,        1,    11300, 0x6c9a2155
-0,         19,         19,        1,    11300, 0x2c8a4798
-0,         20,         20,        1,    11300, 0x3485676c
-0,         21,         21,        1,    11300, 0xb0b293f2
-0,         22,         22,        1,    11300, 0xe4a9b068
-0,         23,         23,        1,    11300, 0xd68d0556
-0,         24,         24,        1,    11300, 0xc28e5193
-0,         25,         25,        1,    11300, 0xf6948483
-0,         26,         26,        1,    11300, 0xf21fbf57
-0,         27,         27,        1,    11300, 0x8345eb44
-0,         28,         28,        1,    11300, 0x8124f045
-0,         29,         29,        1,    11300, 0x18e31f10
-0,         30,         30,        1,    11300, 0xdb1943fc
-0,         31,         31,        1,    11300, 0x8701699f
-0,         32,         32,        1,    11300, 0xd7b18550
-0,         33,         33,        1,    11300, 0xa56faccc
-0,         34,         34,        1,    11300, 0xf8bcc17c
-0,         35,         35,        1,    11300, 0x446acab9
-0,         36,         36,        1,    11300, 0x755fd295
-0,         37,         37,        1,    11300, 0x92e3d100
-0,         38,         38,        1,    11300, 0x54895bb3
-0,         39,         39,        1,    11300, 0xd18bffda
-0,         40,         40,        1,    11300, 0x480dbe4f
-0,         41,         41,        1,    11300, 0x49ea9dbe
-0,         42,         42,        1,    11300, 0x00d3a003
-0,         43,         43,        1,    11300, 0xda7bbfb2
-0,         44,         44,        1,    11300, 0x9700d9c2
-0,         45,         45,        1,    11300, 0xa0a9e490
-0,         46,         46,        1,    11300, 0x00eb0979
-0,         47,         47,        1,    11300, 0x32b04630
-0,         48,         48,        1,    11300, 0xdfb73e51
-0,         49,         49,        1,    11300, 0x3d8e4f96
-0,         50,         50,        1,    11300, 0x2ca83271
-0,         51,         51,        1,    11300, 0xb5b123c0
-0,         52,         52,        1,    11300, 0x8a570e58
-0,         53,         53,        1,    11300, 0xc6c805bc
-0,         54,         54,        1,    11300, 0x27caf7a5
-0,         55,         55,        1,    11300, 0x5319ecb0
-0,         56,         56,        1,    11300, 0x5471e3fd
-0,         57,         57,        1,    11300, 0x6d68a6f4
-0,         58,         58,        1,    11300, 0x872b7194
-0,         59,         59,        1,    11300, 0x007c36bd
-0,         60,         60,        1,    11300, 0x2714f1b5
-0,         61,         61,        1,    11300, 0x6c8eb50f
-0,         62,         62,        1,    11300, 0xf5d57be8
-0,         63,         63,        1,    11300, 0x981f412b
-0,         64,         64,        1,    11300, 0x1a9804a1
-0,         65,         65,        1,    11300, 0xf0c1d24a
-0,         66,         66,        1,    11300, 0xa70a9d9b
-0,         67,         67,        1,    11300, 0x8c466876
-0,         68,         68,        1,    11300, 0xcf2e32df
-0,         69,         69,        1,    11300, 0xcb8cfebf
-0,         70,         70,        1,    11300, 0xb961ca99
-0,         71,         71,        1,    11300, 0x666d9619
-0,         72,         72,        1,    11300, 0x84bf5b55
-0,         73,         73,        1,    11300, 0xbfa22ccc
-0,         74,         74,        1,    11300, 0xcde41849
-0,         75,         75,        1,    11300, 0x71372dcd
-0,         76,         76,        1,    11300, 0x13402cfd
-0,         77,         77,        1,    11300, 0xdebdd321
-0,         78,         78,        1,    11300, 0xdda66de1
-0,         79,         79,        1,    11300, 0x7f4bb682
-0,         80,         80,        1,    11300, 0xf67fd528
-0,         81,         81,        1,    11300, 0xe739ff8c
-0,         82,         82,        1,    11300, 0x2e131774
-0,         83,         83,        1,    11300, 0xfa942811
-0,         84,         84,        1,    11300, 0x0cd93ac2
-0,         85,         85,        1,    11300, 0xd0445e0e
-0,         86,         86,        1,    11300, 0x3f3497c7
-0,         87,         87,        1,    11300, 0x11b5bd2c
-0,         88,         88,        1,    11300, 0xccd5e62a
-0,         89,         89,        1,    11300, 0xa9d4fcb5
-0,         90,         90,        1,    11300, 0x34aa1a03
-0,         91,         91,        1,    11300, 0x1ce6299e
-0,         92,         92,        1,    11300, 0x661c2745
-0,         93,         93,        1,    11300, 0x27d8a8b3
-0,         94,         94,        1,    11300, 0x9eb07467
-0,         95,         95,        1,    11300, 0x128374d2
-0,         96,         96,        1,    11300, 0x05c36ff5
-0,         97,         97,        1,    11300, 0x8a136bde
-0,         98,         98,        1,    11300, 0x15c47c99
-0,         99,         99,        1,    11300, 0xcc4a93f4
-0,        100,        100,        1,    11300, 0x19529b2b
-0,        101,        101,        1,    11300, 0x9943c076
-0,        102,        102,        1,    11300, 0xf898e583
-0,        103,        103,        1,    11300, 0x40f71f94
-0,        104,        104,        1,    11300, 0x5b604afb
-0,        105,        105,        1,    11300, 0x8c176af4
-0,        106,        106,        1,    11300, 0x0f1a6216
-0,        107,        107,        1,    11300, 0x38bbd13d
-0,        108,        108,        1,    11300, 0x90c8d1fc
-0,        109,        109,        1,    11300, 0x253000d7
-0,        110,        110,        1,    11300, 0xb94b03b1
-0,        111,        111,        1,    11300, 0xbc872268
-0,        112,        112,        1,    11300, 0xe77adb8c
-0,        113,        113,        1,    11300, 0xa38936b7
-0,        114,        114,        1,    11300, 0xd6153632
-0,        115,        115,        1,    11300, 0x1ae633cc
-0,        116,        116,        1,    11300, 0xb90c286e
-0,        117,        117,        1,    11300, 0xbc7e333d
-0,        118,        118,        1,    11300, 0x1b5421f8
-0,        119,        119,        1,    11300, 0xdde6506d
-0,        120,        120,        1,    11300, 0xd3eb757e
-0,        121,        121,        1,    11300, 0x5ad1929c
-0,        122,        122,        1,    11300, 0x4f6aa47d
-0,        123,        123,        1,    11300, 0xab3caf55
-0,        124,        124,        1,    11300, 0x5ff9b39a
-0,        125,        125,        1,    11300, 0x1454e12e
-0,        126,        126,        1,    11300, 0xf18216e8
-0,        127,        127,        1,    11300, 0x62144880
-0,        128,        128,        1,    11300, 0x54284241
-0,        129,        129,        1,    11300, 0x8e8c7228
-0,        130,        130,        1,    11300, 0xb498d06e
-0,        131,        131,        1,    11300, 0x7b1e6be1
-0,        132,        132,        1,    11300, 0x5e5ea1f4
-0,        133,        133,        1,    11300, 0x41eda28e
-0,        134,        134,        1,    11300, 0x7ba6aa92
-0,        135,        135,        1,    11300, 0xa8a8b1c7
-0,        136,        136,        1,    11300, 0x0d30bd08
-0,        137,        137,        1,    11300, 0xc610bf16
-0,        138,        138,        1,    11300, 0xed57c075
-0,        139,        139,        1,    11300, 0xb86dbfea
-0,        140,        140,        1,    11300, 0x0970c03d
-0,        141,        141,        1,    11300, 0x743ac2ac
-0,        142,        142,        1,    11300, 0x0a44c816
-0,        143,        143,        1,    11300, 0xe32acd6b
-0,        144,        144,        1,    11300, 0x209bcdab
-0,        145,        145,        1,    11300, 0x3cd0d105
-0,        146,        146,        1,    11300, 0xc0bcd330
-0,        147,        147,        1,    11300, 0x4785d6dc
-0,        148,        148,        1,    11300, 0xe85f9c90
-0,        149,        149,        1,    11300, 0xd4a72850
-0,        150,        150,        1,    11300, 0x04766e41
-0,        151,        151,        1,    11300, 0x04766e41
diff --git a/deps/libav/tests/ref/fate/cvid-palette b/deps/libav/tests/ref/fate/cvid-palette
deleted file mode 100644
index 5fcbc51..0000000
--- a/deps/libav/tests/ref/fate/cvid-palette
+++ /dev/null
@@ -1,57 +0,0 @@
-#tb 0: 1/14985
-0,          0,          0,        0,    57600, 0x1f5c89b7
-0,       1000,       1000,        0,    57600, 0xd2055aaf
-0,       2000,       2000,        0,    57600, 0x22336052
-0,       3000,       3000,        0,    57600, 0xf7135e2a
-0,       4000,       4000,        0,    57600, 0xd9de126a
-0,       5000,       5000,        0,    57600, 0xe5a9e1de
-0,       6000,       6000,        0,    57600, 0x253f1702
-0,       7000,       7000,        0,    57600, 0xcb8679c9
-0,       8000,       8000,        0,    57600, 0x96cb5fa8
-0,       9000,       9000,        0,    57600, 0xbe03528a
-0,      10000,      10000,        0,    57600, 0x120a097d
-0,      11000,      11000,        0,    57600, 0xaf562041
-0,      12000,      12000,        0,    57600, 0x15b2d8c9
-0,      13000,      13000,        0,    57600, 0x95f60e58
-0,      14000,      14000,        0,    57600, 0x5ace5a6b
-0,      15000,      15000,        0,    57600, 0x2f80b8e3
-0,      16000,      16000,        0,    57600, 0x5c49c915
-0,      17000,      17000,        0,    57600, 0xb91efe60
-0,      18000,      18000,        0,    57600, 0xa80d29e8
-0,      19000,      19000,        0,    57600, 0x6e72d03a
-0,      20000,      20000,        0,    57600, 0x4f716a9e
-0,      21000,      21000,        0,    57600, 0x3a43b9c9
-0,      22000,      22000,        0,    57600, 0x65002db3
-0,      23000,      23000,        0,    57600, 0x70edc765
-0,      24000,      24000,        0,    57600, 0x9dc54abd
-0,      25000,      25000,        0,    57600, 0xd17bda86
-0,      26000,      26000,        0,    57600, 0xc5d2d458
-0,      27000,      27000,        0,    57600, 0x32313c79
-0,      28000,      28000,        0,    57600, 0x2e537e8d
-0,      29000,      29000,        0,    57600, 0xe77d5d9e
-0,      30000,      30000,        0,    57600, 0x9cc2599a
-0,      31000,      31000,        0,    57600, 0x8a9be76e
-0,      32000,      32000,        0,    57600, 0x47447eef
-0,      33000,      33000,        0,    57600, 0xbf5f84fa
-0,      34000,      34000,        0,    57600, 0xacd49c07
-0,      35000,      35000,        0,    57600, 0xdc628975
-0,      36000,      36000,        0,    57600, 0x97d7964e
-0,      37000,      37000,        0,    57600, 0xd0a19b6b
-0,      38000,      38000,        0,    57600, 0x5ea3d78c
-0,      39000,      39000,        0,    57600, 0x39b59be0
-0,      40000,      40000,        0,    57600, 0x6501a2d2
-0,      41000,      41000,        0,    57600, 0x0ee7e36d
-0,      42000,      42000,        0,    57600, 0x354ddd1d
-0,      43000,      43000,        0,    57600, 0x9b8f22d3
-0,      44000,      44000,        0,    57600, 0x0aadfb8c
-0,      45000,      45000,        0,    57600, 0x322e2785
-0,      46000,      46000,        0,    57600, 0x78a6467e
-0,      47000,      47000,        0,    57600, 0x1757f3b1
-0,      48000,      48000,        0,    57600, 0xe874ceb7
-0,      49000,      49000,        0,    57600, 0xc40f9e4d
-0,      50000,      50000,        0,    57600, 0x89f6a735
-0,      51000,      51000,        0,    57600, 0xe3635393
-0,      52000,      52000,        0,    57600, 0xdae585c7
-0,      53000,      53000,        0,    57600, 0xf99baa60
-0,      54000,      54000,        0,    57600, 0x28a8b1ee
-0,      55000,      55000,        0,    57600, 0xcd5587f8
diff --git a/deps/libav/tests/ref/fate/cvid-partial b/deps/libav/tests/ref/fate/cvid-partial
deleted file mode 100644
index 71596b4..0000000
--- a/deps/libav/tests/ref/fate/cvid-partial
+++ /dev/null
@@ -1,79 +0,0 @@
-#tb 0: 1/12
-0,          0,          0,        1,   112400, 0x829180d8
-0,          1,          1,        1,   112400, 0xdbebac5b
-0,          2,          2,        1,   112400, 0xc5adc0f7
-0,          3,          3,        1,   112400, 0xbe1fc030
-0,          4,          4,        1,   112400, 0xe08ab460
-0,          5,          5,        1,   112400, 0xfde0dbc5
-0,          6,          6,        1,   112400, 0xed9242b0
-0,          7,          7,        1,   112400, 0x1ae3933a
-0,          8,          8,        1,   112400, 0xc82d2f5b
-0,          9,          9,        1,   112400, 0xbae9ddfc
-0,         10,         10,        1,   112400, 0xa350a1f7
-0,         11,         11,        1,   112400, 0x3cf78029
-0,         12,         12,        1,   112400, 0xaa0b82bf
-0,         13,         13,        1,   112400, 0x71aa4794
-0,         14,         14,        1,   112400, 0x2fe57373
-0,         15,         15,        1,   112400, 0x429c6f82
-0,         16,         16,        1,   112400, 0xfb2d917d
-0,         17,         17,        1,   112400, 0xcc84cb9a
-0,         18,         18,        1,   112400, 0xc68f0613
-0,         19,         19,        1,   112400, 0x05f30e6a
-0,         20,         20,        1,   112400, 0x5c5d853d
-0,         21,         21,        1,   112400, 0x01e0aff2
-0,         22,         22,        1,   112400, 0xc3b2cf4a
-0,         23,         23,        1,   112400, 0xc0a3cf19
-0,         24,         24,        1,   112400, 0xc743abda
-0,         25,         25,        1,   112400, 0x54bd17a2
-0,         26,         26,        1,   112400, 0x616ef28d
-0,         27,         27,        1,   112400, 0x04b51f59
-0,         28,         28,        1,   112400, 0x857511a2
-0,         29,         29,        1,   112400, 0x25c62440
-0,         30,         30,        1,   112400, 0x8c78198d
-0,         31,         31,        1,   112400, 0xc046c912
-0,         32,         32,        1,   112400, 0x0d828630
-0,         33,         33,        1,   112400, 0x48999b80
-0,         34,         34,        1,   112400, 0x9a869e77
-0,         35,         35,        1,   112400, 0x16d893df
-0,         36,         36,        1,   112400, 0xf6b86132
-0,         37,         37,        1,   112400, 0xfa564ea4
-0,         38,         38,        1,   112400, 0xdd473f69
-0,         39,         39,        1,   112400, 0xf89625a6
-0,         40,         40,        1,   112400, 0x823a58aa
-0,         41,         41,        1,   112400, 0x25e0fe43
-0,         42,         42,        1,   112400, 0x41034522
-0,         43,         43,        1,   112400, 0xb8da4f00
-0,         44,         44,        1,   112400, 0x9f684fce
-0,         45,         45,        1,   112400, 0xf7188710
-0,         46,         46,        1,   112400, 0x428fbfc6
-0,         47,         47,        1,   112400, 0x535bace0
-0,         48,         48,        1,   112400, 0x23216059
-0,         49,         49,        1,   112400, 0x9b8bbfa6
-0,         50,         50,        1,   112400, 0x932be522
-0,         51,         51,        1,   112400, 0xdbd31409
-0,         52,         52,        1,   112400, 0x0a69bf18
-0,         53,         53,        1,   112400, 0xa15ef128
-0,         54,         54,        1,   112400, 0x49a1fa92
-0,         55,         55,        1,   112400, 0xadeeaf62
-0,         56,         56,        1,   112400, 0xc1ce636e
-0,         57,         57,        1,   112400, 0x5ca544eb
-0,         58,         58,        1,   112400, 0x07230a36
-0,         59,         59,        1,   112400, 0x12ae2b53
-0,         60,         60,        1,   112400, 0x62453ef6
-0,         61,         61,        1,   112400, 0xe0588a98
-0,         62,         62,        1,   112400, 0xacd3927a
-0,         63,         63,        1,   112400, 0x5d3c6b01
-0,         64,         64,        1,   112400, 0xda671808
-0,         65,         65,        1,   112400, 0x61d0b492
-0,         66,         66,        1,   112400, 0x068b1293
-0,         67,         67,        1,   112400, 0x75b99287
-0,         68,         68,        1,   112400, 0xe657e7d6
-0,         69,         69,        1,   112400, 0x17873df6
-0,         70,         70,        1,   112400, 0xa8db5e31
-0,         71,         71,        1,   112400, 0x4f633b8e
-0,         72,         72,        1,   112400, 0x22266252
-0,         73,         73,        1,   112400, 0x308a6282
-0,         74,         74,        1,   112400, 0xfdb356ce
-0,         75,         75,        1,   112400, 0xe4394f1f
-0,         76,         76,        1,   112400, 0x8ca8649f
-0,         77,         77,        1,   112400, 0x804d44eb
diff --git a/deps/libav/tests/ref/fate/cyberia-c93 b/deps/libav/tests/ref/fate/cyberia-c93
deleted file mode 100644
index f02435c..0000000
--- a/deps/libav/tests/ref/fate/cyberia-c93
+++ /dev/null
@@ -1,44 +0,0 @@
-#tb 0: 2/25
-#tb 1: 1/16129
-0,          0,          0,        1,   184320, 0x8433f0f8
-1,          0,          0,    14184,    28368, 0xaacc96a5
-0,          1,          1,        1,   184320, 0xd0d480f7
-0,          2,          2,        1,   184320, 0xaec85413
-0,          3,          3,        1,   184320, 0x29d134dc
-0,          4,          4,        1,   184320, 0xeac07175
-0,          5,          5,        1,   184320, 0x21426b49
-0,          6,          6,        1,   184320, 0xe500a37d
-0,          7,          7,        1,   184320, 0x1d9cae21
-0,          8,          8,        1,   184320, 0xda65309d
-0,          9,          9,        1,   184320, 0xb64c331d
-0,         10,         10,        1,   184320, 0xcb832741
-1,      14184,      14184,    14184,    28368, 0x6d1099bd
-0,         11,         11,        1,   184320, 0xe573b565
-0,         12,         12,        1,   184320, 0xa40c92d1
-0,         13,         13,        1,   184320, 0x6d04ea3f
-0,         14,         14,        1,   184320, 0xc438ae56
-0,         15,         15,        1,   184320, 0xc6405523
-0,         16,         16,        1,   184320, 0xaefef0b3
-0,         17,         17,        1,   184320, 0x3e4526c6
-0,         18,         18,        1,   184320, 0x2b164323
-0,         19,         19,        1,   184320, 0x89b22193
-0,         20,         20,        1,   184320, 0x3b73611b
-0,         21,         21,        1,   184320, 0x42b33583
-1,      28368,      28368,    14184,    28368, 0x93033ae1
-0,         22,         22,        1,   184320, 0x43e79dff
-0,         23,         23,        1,   184320, 0xe389a377
-0,         24,         24,        1,   184320, 0x09cb65f0
-0,         25,         25,        1,   184320, 0x64b27755
-0,         26,         26,        1,   184320, 0xdd25d6c6
-0,         27,         27,        1,   184320, 0x082a80c9
-0,         28,         28,        1,   184320, 0x41a8d7f4
-0,         29,         29,        1,   184320, 0x6227d8d4
-0,         30,         30,        1,   184320, 0x54975910
-0,         31,         31,        1,   184320, 0xf4857db9
-0,         32,         32,        1,   184320, 0x82d18161
-1,      42552,      42552,     5835,    11670, 0x04aa0b1e
-0,         33,         33,        1,   184320, 0x06d93bd0
-0,         34,         34,        1,   184320, 0xa4304c00
-0,         35,         35,        1,   184320, 0x5f77d9cd
-0,         36,         36,        1,   184320, 0x95cb84e9
-0,         37,         37,        1,   184320, 0x7c979475
diff --git a/deps/libav/tests/ref/fate/cyuv b/deps/libav/tests/ref/fate/cyuv
deleted file mode 100644
index 37bdd2f..0000000
--- a/deps/libav/tests/ref/fate/cyuv
+++ /dev/null
@@ -1,151 +0,0 @@
-#tb 0: 33333/1000000
-0,          0,          0,        1,    38016, 0x501e6abe
-0,          1,          1,        1,    38016, 0x84976f13
-0,          2,          2,        1,    38016, 0x8c487acb
-0,          3,          3,        1,    38016, 0x70998800
-0,          4,          4,        1,    38016, 0x51ac9416
-0,          5,          5,        1,    38016, 0xd1da94b7
-0,          6,          6,        1,    38016, 0x52d691e8
-0,          7,          7,        1,    38016, 0x3ca3907a
-0,          8,          8,        1,    38016, 0x5f62929f
-0,          9,          9,        1,    38016, 0x81ec98ac
-0,         10,         10,        1,    38016, 0x72499f12
-0,         11,         11,        1,    38016, 0x7598a716
-0,         12,         12,        1,    38016, 0x38ada96f
-0,         13,         13,        1,    38016, 0x78c8a727
-0,         14,         14,        1,    38016, 0xe2d79d2d
-0,         15,         15,        1,    38016, 0x84a2925a
-0,         16,         16,        1,    38016, 0x131b8d70
-0,         17,         17,        1,    38016, 0x32a78242
-0,         18,         18,        1,    38016, 0x29f583e5
-0,         19,         19,        1,    38016, 0x4a7f7305
-0,         20,         20,        1,    38016, 0x80885f56
-0,         21,         21,        1,    38016, 0xa73c4f61
-0,         22,         22,        1,    38016, 0xe54d422b
-0,         23,         23,        1,    38016, 0xa8c03188
-0,         24,         24,        1,    38016, 0xa02a294e
-0,         25,         25,        1,    38016, 0xc84e2366
-0,         26,         26,        1,    38016, 0xe21112ca
-0,         27,         27,        1,    38016, 0x3e450594
-0,         28,         28,        1,    38016, 0x2499017c
-0,         29,         29,        1,    38016, 0xecb1effa
-0,         30,         30,        1,    38016, 0xa0f8eb28
-0,         31,         31,        1,    38016, 0xa396e800
-0,         32,         32,        1,    38016, 0xae1be010
-0,         33,         33,        1,    38016, 0x4b41dff5
-0,         34,         34,        1,    38016, 0x9172e319
-0,         35,         35,        1,    38016, 0xb82ee262
-0,         36,         36,        1,    38016, 0x151de59f
-0,         37,         37,        1,    38016, 0x799deabd
-0,         38,         38,        1,    38016, 0x008dee95
-0,         39,         39,        1,    38016, 0x5ad502ce
-0,         40,         40,        1,    38016, 0xdeb321f1
-0,         41,         41,        1,    38016, 0x82734a09
-0,         42,         42,        1,    38016, 0x1ccb6ddd
-0,         43,         43,        1,    38016, 0x266584f0
-0,         44,         44,        1,    38016, 0x46349e73
-0,         45,         45,        1,    38016, 0x0b8cac83
-0,         46,         46,        1,    38016, 0x7bcd9f49
-0,         47,         47,        1,    38016, 0x4f5d7521
-0,         48,         48,        1,    38016, 0x7709250c
-0,         49,         49,        1,    38016, 0xf8eef5ad
-0,         50,         50,        1,    38016, 0x2c5d28e3
-0,         51,         51,        1,    38016, 0xdb116d69
-0,         52,         52,        1,    38016, 0xb66c39d6
-0,         53,         53,        1,    38016, 0xacecc966
-0,         54,         54,        1,    38016, 0xaffd76af
-0,         55,         55,        1,    38016, 0xd2b05d04
-0,         56,         56,        1,    38016, 0x4d18582a
-0,         57,         57,        1,    38016, 0x23635ca7
-0,         58,         58,        1,    38016, 0x7ccc58f1
-0,         59,         59,        1,    38016, 0xce9a4cc6
-0,         60,         60,        1,    38016, 0xbeb259d3
-0,         61,         61,        1,    38016, 0x0b28714c
-0,         62,         62,        1,    38016, 0x642a8fdd
-0,         63,         63,        1,    38016, 0x937bb589
-0,         64,         64,        1,    38016, 0x1a48c407
-0,         65,         65,        1,    38016, 0x8b44cd79
-0,         66,         66,        1,    38016, 0xf35cde31
-0,         67,         67,        1,    38016, 0xfc05fad9
-0,         68,         68,        1,    38016, 0x44102111
-0,         69,         69,        1,    38016, 0x832f5041
-0,         70,         70,        1,    38016, 0x41177c71
-0,         71,         71,        1,    38016, 0x723b88b5
-0,         72,         72,        1,    38016, 0x05548f81
-0,         73,         73,        1,    38016, 0xd9dd7995
-0,         74,         74,        1,    38016, 0xed0d6226
-0,         75,         75,        1,    38016, 0x458b5ce2
-0,         76,         76,        1,    38016, 0xc7ef69af
-0,         77,         77,        1,    38016, 0x936a7022
-0,         78,         78,        1,    38016, 0x7a446c3d
-0,         79,         79,        1,    38016, 0x9b2b73ee
-0,         80,         80,        1,    38016, 0xa47779cd
-0,         81,         81,        1,    38016, 0x7be47981
-0,         82,         82,        1,    38016, 0x5d1778ac
-0,         83,         83,        1,    38016, 0xf1f578fc
-0,         84,         84,        1,    38016, 0x865b7edf
-0,         85,         85,        1,    38016, 0x0a208252
-0,         86,         86,        1,    38016, 0x22f07570
-0,         87,         87,        1,    38016, 0x93036cef
-0,         88,         88,        1,    38016, 0xa04b6120
-0,         89,         89,        1,    38016, 0x80b249fe
-0,         90,         90,        1,    38016, 0x5fe5317e
-0,         91,         91,        1,    38016, 0x75bd0770
-0,         92,         92,        1,    38016, 0x0607da6e
-0,         93,         93,        1,    38016, 0x11cbb3a7
-0,         94,         94,        1,    38016, 0xbb8b9335
-0,         95,         95,        1,    38016, 0xa2bc75d9
-0,         96,         96,        1,    38016, 0x58c160dd
-0,         97,         97,        1,    38016, 0x742b55dc
-0,         98,         98,        1,    38016, 0x62b24540
-0,         99,         99,        1,    38016, 0x14f4381b
-0,        100,        100,        1,    38016, 0x6494334d
-0,        101,        101,        1,    38016, 0xb3772676
-0,        102,        102,        1,    38016, 0x0c312715
-0,        103,        103,        1,    38016, 0x8b401fc9
-0,        104,        104,        1,    38016, 0xa851125a
-0,        105,        105,        1,    38016, 0x3171092b
-0,        106,        106,        1,    38016, 0x5c3603aa
-0,        107,        107,        1,    38016, 0xab56fc95
-0,        108,        108,        1,    38016, 0x5c76fcb5
-0,        109,        109,        1,    38016, 0xbf13f3b4
-0,        110,        110,        1,    38016, 0xbdb5ed1b
-0,        111,        111,        1,    38016, 0xb511ea7c
-0,        112,        112,        1,    38016, 0xec84df90
-0,        113,        113,        1,    38016, 0x69aed672
-0,        114,        114,        1,    38016, 0x72a6d334
-0,        115,        115,        1,    38016, 0x7ec5c6a7
-0,        116,        116,        1,    38016, 0x837abc3e
-0,        117,        117,        1,    38016, 0x5ef7be01
-0,        118,        118,        1,    38016, 0x173bb950
-0,        119,        119,        1,    38016, 0xf572ab31
-0,        120,        120,        1,    38016, 0xe704a2d9
-0,        121,        121,        1,    38016, 0x26359bb5
-0,        122,        122,        1,    38016, 0x00868e2d
-0,        123,        123,        1,    38016, 0x72ef879e
-0,        124,        124,        1,    38016, 0x510b7b07
-0,        125,        125,        1,    38016, 0x947876ff
-0,        126,        126,        1,    38016, 0x934073a7
-0,        127,        127,        1,    38016, 0xf7c36a15
-0,        128,        128,        1,    38016, 0xbcc86424
-0,        129,        129,        1,    38016, 0x55b65fb0
-0,        130,        130,        1,    38016, 0x6c4b5c4e
-0,        131,        131,        1,    38016, 0xb315557a
-0,        132,        132,        1,    38016, 0x154f503e
-0,        133,        133,        1,    38016, 0x7abd44da
-0,        134,        134,        1,    38016, 0x291940c6
-0,        135,        135,        1,    38016, 0xc2264202
-0,        136,        136,        1,    38016, 0xbd703e12
-0,        137,        137,        1,    38016, 0x39193a9c
-0,        138,        138,        1,    38016, 0x086637de
-0,        139,        139,        1,    38016, 0x494c3be2
-0,        140,        140,        1,    38016, 0x2d523e06
-0,        141,        141,        1,    38016, 0x3843448a
-0,        142,        142,        1,    38016, 0x307f4bd3
-0,        143,        143,        1,    38016, 0xee074e3f
-0,        144,        144,        1,    38016, 0x760d534a
-0,        145,        145,        1,    38016, 0xbfa251cc
-0,        146,        146,        1,    38016, 0x49094e22
-0,        147,        147,        1,    38016, 0xda6a4f16
-0,        148,        148,        1,    38016, 0xa3304fd5
-0,        149,        149,        1,    38016, 0x99995068
diff --git a/deps/libav/tests/ref/fate/d-cinema-demux b/deps/libav/tests/ref/fate/d-cinema-demux
deleted file mode 100644
index f663040..0000000
--- a/deps/libav/tests/ref/fate/d-cinema-demux
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,     1875,    36000, 0xd592781d
-0,       1875,       1875,     1875,    36000, 0xd592781d
-0,       3750,       3750,     1875,    36000, 0xd592781d
-0,       5625,       5625,     1200,    23056, 0xde81f0d6
diff --git a/deps/libav/tests/ref/fate/dcinema-encode b/deps/libav/tests/ref/fate/dcinema-encode
deleted file mode 100644
index 8aeb215..0000000
--- a/deps/libav/tests/ref/fate/dcinema-encode
+++ /dev/null
@@ -1 +0,0 @@
-MD5=2d7c6897c315493647db159f4bfd6edc
diff --git a/deps/libav/tests/ref/fate/delphine-cin-audio b/deps/libav/tests/ref/fate/delphine-cin-audio
deleted file mode 100644
index 1a94a6b..0000000
--- a/deps/libav/tests/ref/fate/delphine-cin-audio
+++ /dev/null
@@ -1,92 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,    88224,   176448, 0x541ddc55
-0,      88224,      88224,     1838,     3676, 0xaf455081
-0,      90062,      90062,     1838,     3676, 0x27ef4e91
-0,      91900,      91900,     1838,     3676, 0xd1d986a3
-0,      93738,      93738,     1838,     3676, 0xaaa2b589
-0,      95576,      95576,     1838,     3676, 0x6e794ff9
-0,      97414,      97414,     1838,     3676, 0x266351f1
-0,      99252,      99252,     1838,     3676, 0xdeae50b2
-0,     101090,     101090,     1838,     3676, 0x90f1f96a
-0,     102928,     102928,     1838,     3676, 0xea07adf9
-0,     104766,     104766,     1838,     3676, 0xb80a8925
-0,     106604,     106604,     1838,     3676, 0xc392a1da
-0,     108442,     108442,     1838,     3676, 0xa076bdda
-0,     110280,     110280,     1838,     3676, 0x8f40b4cc
-0,     112118,     112118,     1838,     3676, 0x4227fe30
-0,     113956,     113956,     1838,     3676, 0x82b31ec8
-0,     115794,     115794,     1838,     3676, 0x3ba04042
-0,     117632,     117632,     1838,     3676, 0x6fe7440a
-0,     119470,     119470,     1838,     3676, 0x23e33177
-0,     121308,     121308,     1838,     3676, 0x1f14242c
-0,     123146,     123146,     1838,     3676, 0x72931fb0
-0,     124984,     124984,     1838,     3676, 0x2b1351c2
-0,     126822,     126822,     1838,     3676, 0x6aee7070
-0,     128660,     128660,     1838,     3676, 0x237658fa
-0,     130498,     130498,     1838,     3676, 0xac001143
-0,     132336,     132336,     1838,     3676, 0x1921ee21
-0,     134174,     134174,     1838,     3676, 0x80186091
-0,     136012,     136012,     1838,     3676, 0xb7f37ede
-0,     137850,     137850,     1838,     3676, 0x355227ef
-0,     139688,     139688,     1838,     3676, 0xb0411f35
-0,     141526,     141526,     1838,     3676, 0xe7c4fe0e
-0,     143364,     143364,     1838,     3676, 0x0425984d
-0,     145202,     145202,     1838,     3676, 0xfd59dea1
-0,     147040,     147040,     1838,     3676, 0xa53d5aab
-0,     148878,     148878,     1838,     3676, 0x8bc403c2
-0,     150716,     150716,     1838,     3676, 0x7dd638c2
-0,     152554,     152554,     1838,     3676, 0x284913eb
-0,     154392,     154392,     1838,     3676, 0xec17e83c
-0,     156230,     156230,     1838,     3676, 0x40543463
-0,     158068,     158068,     1838,     3676, 0x92d81bf8
-0,     159906,     159906,     1838,     3676, 0x44ef161d
-0,     161744,     161744,     1838,     3676, 0x499df3d5
-0,     163582,     163582,     1838,     3676, 0xf98f4d75
-0,     165420,     165420,     1838,     3676, 0x8ffe2681
-0,     167258,     167258,     1838,     3676, 0x84093bfd
-0,     169096,     169096,     1838,     3676, 0x5f9c2e32
-0,     170934,     170934,     1838,     3676, 0x8f93c29b
-0,     172772,     172772,     1838,     3676, 0xf0ada687
-0,     174610,     174610,     1838,     3676, 0x30019db2
-0,     176448,     176448,     1838,     3676, 0x06ebace3
-0,     178286,     178286,     1838,     3676, 0xc293d944
-0,     180124,     180124,     1838,     3676, 0x789ff65e
-0,     181962,     181962,     1838,     3676, 0xa2ae13c1
-0,     183800,     183800,     1838,     3676, 0xb64f1cd9
-0,     185638,     185638,     1838,     3676, 0x18f4e36a
-0,     187476,     187476,     1838,     3676, 0xe9ccd0f0
-0,     189314,     189314,     1838,     3676, 0xc215b4ab
-0,     191152,     191152,     1838,     3676, 0x45b5c410
-0,     192990,     192990,     1838,     3676, 0xf84a9939
-0,     194828,     194828,     1838,     3676, 0xc8aff71e
-0,     196666,     196666,     1838,     3676, 0x76cc3afc
-0,     198504,     198504,     1838,     3676, 0x524e1dd6
-0,     200342,     200342,     1838,     3676, 0x115a3f10
-0,     202180,     202180,     1838,     3676, 0xd2bb51d1
-0,     204018,     204018,     1838,     3676, 0xe1dbfca5
-0,     205856,     205856,     1838,     3676, 0xc428f070
-0,     207694,     207694,     1838,     3676, 0x6aa4dddf
-0,     209532,     209532,     1838,     3676, 0xa0428f08
-0,     211370,     211370,     1838,     3676, 0x8fd7e256
-0,     213208,     213208,     1838,     3676, 0x41cb1787
-0,     215046,     215046,     1838,     3676, 0xe348568e
-0,     216884,     216884,     1838,     3676, 0x79091a0c
-0,     218722,     218722,     1838,     3676, 0x592f6f2e
-0,     220560,     220560,     1838,     3676, 0xa151448f
-0,     222398,     222398,     1838,     3676, 0xb3402e7a
-0,     224236,     224236,     1838,     3676, 0x74112e27
-0,     226074,     226074,     1838,     3676, 0xba090659
-0,     227912,     227912,     1838,     3676, 0xa0451f81
-0,     229750,     229750,     1838,     3676, 0x09c7393a
-0,     231588,     231588,     1838,     3676, 0xceb4e340
-0,     233426,     233426,     1838,     3676, 0x0440291a
-0,     235264,     235264,     1838,     3676, 0xb7b930c4
-0,     237102,     237102,     1838,     3676, 0x1a2afa4a
-0,     238940,     238940,     1838,     3676, 0x414fee56
-0,     240778,     240778,     1838,     3676, 0x5e26bc97
-0,     242616,     242616,     1838,     3676, 0x780e0481
-0,     244454,     244454,     1838,     3676, 0xb6dfb9c5
-0,     246292,     246292,     1838,     3676, 0x447b36ca
-0,     248130,     248130,     1838,     3676, 0x601c3067
-0,     249968,     249968,     1838,     3676, 0x199f2f8d
-0,     251806,     251806,     1838,     3676, 0x98645b08
diff --git a/deps/libav/tests/ref/fate/delphine-cin-video b/deps/libav/tests/ref/fate/delphine-cin-video
deleted file mode 100644
index feaea26..0000000
--- a/deps/libav/tests/ref/fate/delphine-cin-video
+++ /dev/null
@@ -1,93 +0,0 @@
-#tb 0: 1/12
-0,          0,          0,        1,   153600, 0x00000000
-0,          1,          1,        1,   153600, 0x9c77862c
-0,          2,          2,        1,   153600, 0xd487c33c
-0,          3,          3,        1,   153600, 0x5c00c01c
-0,          4,          4,        1,   153600, 0x5496c2a2
-0,          5,          5,        1,   153600, 0x858ac5c0
-0,          6,          6,        1,   153600, 0xe32fc7d9
-0,          7,          7,        1,   153600, 0xabffc965
-0,          8,          8,        1,   153600, 0x4171c8e7
-0,          9,          9,        1,   153600, 0xaec4ca90
-0,         10,         10,        1,   153600, 0x3cb4cb5d
-0,         11,         11,        1,   153600, 0x3aedcdc0
-0,         12,         12,        1,   153600, 0x0fa4cf55
-0,         13,         13,        1,   153600, 0x66a1d146
-0,         14,         14,        1,   153600, 0x3828d3ad
-0,         15,         15,        1,   153600, 0x73ccd7a4
-0,         16,         16,        1,   153600, 0xb815d983
-0,         17,         17,        1,   153600, 0x11a5a54f
-0,         18,         18,        1,   153600, 0x337d8bff
-0,         19,         19,        1,   153600, 0x0a1c8e5c
-0,         20,         20,        1,   153600, 0x09648a57
-0,         21,         21,        1,   153600, 0xf7398ba4
-0,         22,         22,        1,   153600, 0x836d8aaf
-0,         23,         23,        1,   153600, 0x4ee385bf
-0,         24,         24,        1,   153600, 0xacf2c4d6
-0,         25,         25,        1,   153600, 0x0610f426
-0,         26,         26,        1,   153600, 0xb798e4a1
-0,         27,         27,        1,   153600, 0xdaabe17e
-0,         28,         28,        1,   153600, 0x7b82def5
-0,         29,         29,        1,   153600, 0x56afe483
-0,         30,         30,        1,   153600, 0x4640acef
-0,         31,         31,        1,   153600, 0x4415f46c
-0,         32,         32,        1,   153600, 0x258d01d0
-0,         33,         33,        1,   153600, 0x18a55ba1
-0,         34,         34,        1,   153600, 0x165a7173
-0,         35,         35,        1,   153600, 0xfa8a438b
-0,         36,         36,        1,   153600, 0x57083a34
-0,         37,         37,        1,   153600, 0xb39923cd
-0,         38,         38,        1,   153600, 0x3e32fd70
-0,         39,         39,        1,   153600, 0xa7e9eb7f
-0,         40,         40,        1,   153600, 0x8c20ed88
-0,         41,         41,        1,   153600, 0x8c9bed27
-0,         42,         42,        1,   153600, 0xc79af188
-0,         43,         43,        1,   153600, 0x3bda00c8
-0,         44,         44,        1,   153600, 0x03f837a7
-0,         45,         45,        1,   153600, 0x550b83e3
-0,         46,         46,        1,   153600, 0xc0bc6080
-0,         47,         47,        1,   153600, 0xb8d968ed
-0,         48,         48,        1,   153600, 0x893e2348
-0,         49,         49,        1,   153600, 0x6cd01834
-0,         50,         50,        1,   153600, 0x9e6926c5
-0,         51,         51,        1,   153600, 0x4b57a4ea
-0,         52,         52,        1,   153600, 0xaab2cfcd
-0,         53,         53,        1,   153600, 0xffbb334d
-0,         54,         54,        1,   153600, 0x4b37e5a9
-0,         55,         55,        1,   153600, 0x3486dee0
-0,         56,         56,        1,   153600, 0xa7185454
-0,         57,         57,        1,   153600, 0xec29b8c2
-0,         58,         58,        1,   153600, 0x01e562ba
-0,         59,         59,        1,   153600, 0xe695cda3
-0,         60,         60,        1,   153600, 0xf6b59dac
-0,         61,         61,        1,   153600, 0xb308206b
-0,         62,         62,        1,   153600, 0xcc6ede4a
-0,         63,         63,        1,   153600, 0xd9f8071c
-0,         64,         64,        1,   153600, 0xfb434821
-0,         65,         65,        1,   153600, 0x84c97077
-0,         66,         66,        1,   153600, 0x82dc5217
-0,         67,         67,        1,   153600, 0xdbfd0ba8
-0,         68,         68,        1,   153600, 0x3d71058e
-0,         69,         69,        1,   153600, 0x3027b928
-0,         70,         70,        1,   153600, 0x792ae3bd
-0,         71,         71,        1,   153600, 0x36db00a7
-0,         72,         72,        1,   153600, 0x4484e720
-0,         73,         73,        1,   153600, 0xfaa76cdc
-0,         74,         74,        1,   153600, 0x9f1e4c7e
-0,         75,         75,        1,   153600, 0x4b545d88
-0,         76,         76,        1,   153600, 0xa11cfd15
-0,         77,         77,        1,   153600, 0x9f5d49c4
-0,         78,         78,        1,   153600, 0x7a496740
-0,         79,         79,        1,   153600, 0x98477803
-0,         80,         80,        1,   153600, 0xa5fc20f8
-0,         81,         81,        1,   153600, 0x344ff96e
-0,         82,         82,        1,   153600, 0x20c91746
-0,         83,         83,        1,   153600, 0x7c59b379
-0,         84,         84,        1,   153600, 0x38e3b86d
-0,         85,         85,        1,   153600, 0xff25a440
-0,         86,         86,        1,   153600, 0xa1f66533
-0,         87,         87,        1,   153600, 0xe136260a
-0,         88,         88,        1,   153600, 0x048ccf56
-0,         89,         89,        1,   153600, 0x65f68a24
-0,         90,         90,        1,   153600, 0xf32b385a
-0,         91,         91,        1,   153600, 0x3e930a8f
diff --git a/deps/libav/tests/ref/fate/deluxepaint-anm b/deps/libav/tests/ref/fate/deluxepaint-anm
deleted file mode 100644
index e69b95e..0000000
--- a/deps/libav/tests/ref/fate/deluxepaint-anm
+++ /dev/null
@@ -1,124 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   192000, 0x82a79641
-0,          1,          1,        1,   192000, 0x43079971
-0,          2,          2,        1,   192000, 0x6311f1e5
-0,          3,          3,        1,   192000, 0x9e1ef4dc
-0,          4,          4,        1,   192000, 0x6f81049b
-0,          5,          5,        1,   192000, 0xe696fb12
-0,          6,          6,        1,   192000, 0x1ef4d160
-0,          7,          7,        1,   192000, 0x2f1bf0d4
-0,          8,          8,        1,   192000, 0xcfed92da
-0,          9,          9,        1,   192000, 0xbd409978
-0,         10,         10,        1,   192000, 0x50f76f07
-0,         11,         11,        1,   192000, 0xc8d52062
-0,         12,         12,        1,   192000, 0x75061d0e
-0,         13,         13,        1,   192000, 0x01b2a711
-0,         14,         14,        1,   192000, 0x541ca739
-0,         15,         15,        1,   192000, 0xe931ad85
-0,         16,         16,        1,   192000, 0xb7e4d4a5
-0,         17,         17,        1,   192000, 0xfc20d475
-0,         18,         18,        1,   192000, 0x7a5eefe5
-0,         19,         19,        1,   192000, 0x95a3ef97
-0,         20,         20,        1,   192000, 0x021d7f69
-0,         21,         21,        1,   192000, 0x108e7ed9
-0,         22,         22,        1,   192000, 0x021d7f69
-0,         23,         23,        1,   192000, 0x681817d8
-0,         24,         24,        1,   192000, 0x653e19d2
-0,         25,         25,        1,   192000, 0x56d9b14a
-0,         26,         26,        1,   192000, 0x82240846
-0,         27,         27,        1,   192000, 0xa2e90840
-0,         28,         28,        1,   192000, 0x8e031416
-0,         29,         29,        1,   192000, 0xe23813a6
-0,         30,         30,        1,   192000, 0xb2451aa1
-0,         31,         31,        1,   192000, 0x92eec7d2
-0,         32,         32,        1,   192000, 0x6400c80e
-0,         33,         33,        1,   192000, 0x24f01fce
-0,         34,         34,        1,   192000, 0x7c1b201c
-0,         35,         35,        1,   192000, 0xe2c878a1
-0,         36,         36,        1,   192000, 0xf6006739
-0,         37,         37,        1,   192000, 0x726b6677
-0,         38,         38,        1,   192000, 0xca61a01d
-0,         39,         39,        1,   192000, 0x87e49f69
-0,         40,         40,        1,   192000, 0x57120bd4
-0,         41,         41,        1,   192000, 0x50171c4b
-0,         42,         42,        1,   192000, 0x8ace1c49
-0,         43,         43,        1,   192000, 0x83082a8c
-0,         44,         44,        1,   192000, 0x6e092b58
-0,         45,         45,        1,   192000, 0x207a9af4
-0,         46,         46,        1,   192000, 0xedf193f0
-0,         47,         47,        1,   192000, 0x531793f0
-0,         48,         48,        1,   192000, 0x24e2a406
-0,         49,         49,        1,   192000, 0x6c34a1e5
-0,         50,         50,        1,   192000, 0x8e7acdae
-0,         51,         51,        1,   192000, 0x1f941805
-0,         52,         52,        1,   192000, 0x0c391218
-0,         53,         53,        1,   192000, 0xf25aa1fd
-0,         54,         54,        1,   192000, 0xcb2aa40e
-0,         55,         55,        1,   192000, 0x69701e49
-0,         56,         56,        1,   192000, 0x0dd719d3
-0,         57,         57,        1,   192000, 0x5ef71955
-0,         58,         58,        1,   192000, 0xac2063ca
-0,         59,         59,        1,   192000, 0xce7d601c
-0,         60,         60,        1,   192000, 0x43003946
-0,         61,         61,        1,   192000, 0xa72a38ee
-0,         62,         62,        1,   192000, 0x98023933
-0,         63,         63,        1,   192000, 0xa72a38ee
-0,         64,         64,        1,   192000, 0x98023933
-0,         65,         65,        1,   192000, 0xa72a38ee
-0,         66,         66,        1,   192000, 0x98023933
-0,         67,         67,        1,   192000, 0xa72a38ee
-0,         68,         68,        1,   192000, 0xdd7f371d
-0,         69,         69,        1,   192000, 0xeed134c6
-0,        103,        103,        1,   192000, 0x362931f5
-0,        104,        104,        1,   192000, 0xfb41331d
-0,        105,        105,        1,   192000, 0x087433f8
-0,        106,        106,        1,   192000, 0xf36b34a6
-0,        107,        107,        1,   192000, 0x652a33cd
-0,        108,        108,        1,   192000, 0x652a33cd
-0,        109,        109,        1,   192000, 0xe50c336a
-0,        110,        110,        1,   192000, 0x652a33cd
-0,        111,        111,        1,   192000, 0xeed134c6
-0,        112,        112,        1,   192000, 0x652a33cd
-0,        113,        113,        1,   192000, 0x5d7633e5
-0,        114,        114,        1,   192000, 0x845233b5
-0,        115,        115,        1,   192000, 0x9d1c349b
-0,        116,        116,        1,   192000, 0x25843317
-0,        117,        117,        1,   192000, 0xc84b375c
-0,        118,        118,        1,   192000, 0xaf2b3410
-0,        119,        119,        1,   192000, 0xaf2b3410
-0,        120,        120,        1,   192000, 0x26d23594
-0,        121,        121,        1,   192000, 0xaf2b3410
-0,        122,        122,        1,   192000, 0x26d23594
-0,        123,        123,        1,   192000, 0xaf2b3410
-0,        124,        124,        1,   192000, 0x72c4dfb9
-0,        125,        125,        1,   192000, 0x3c72e390
-0,        126,        126,        1,   192000, 0xb4466634
-0,        127,        127,        1,   192000, 0x84f064f5
-0,        128,        128,        1,   192000, 0xad43f3f5
-0,        129,        129,        1,   192000, 0xa8644d57
-0,        130,        130,        1,   192000, 0xfac35238
-0,        131,        131,        1,   192000, 0xe9374d1e
-0,        132,        132,        1,   192000, 0x0bd14cfa
-0,        133,        133,        1,   192000, 0x7e51a437
-0,        134,        134,        1,   192000, 0x92678dfa
-0,        135,        135,        1,   192000, 0x43338d41
-0,        136,        136,        1,   192000, 0x00000000
-0,        137,        137,        1,   192000, 0x00000000
-0,        138,        138,        1,   192000, 0x00000000
-0,        139,        139,        1,   192000, 0x00000000
-0,        140,        140,        1,   192000, 0x00000000
-0,        141,        141,        1,   192000, 0x00000000
-0,        142,        142,        1,   192000, 0x00000000
-0,        143,        143,        1,   192000, 0x00000000
-0,        144,        144,        1,   192000, 0x00000000
-0,        145,        145,        1,   192000, 0x00000000
-0,        146,        146,        1,   192000, 0x00000000
-0,        147,        147,        1,   192000, 0x00000000
-0,        148,        148,        1,   192000, 0x00000000
-0,        149,        149,        1,   192000, 0x00000000
-0,        150,        150,        1,   192000, 0x00000000
-0,        151,        151,        1,   192000, 0x00000000
-0,        152,        152,        1,   192000, 0x00000000
-0,        153,        153,        1,   192000, 0x00000000
-0,        154,        154,        1,   192000, 0x00000000
-0,        155,        155,        1,   192000, 0x82a79641
diff --git a/deps/libav/tests/ref/fate/dfa1 b/deps/libav/tests/ref/fate/dfa1
deleted file mode 100644
index 92a7cce..0000000
--- a/deps/libav/tests/ref/fate/dfa1
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 16/125
-0,          0,          0,        1,   921600, 0x2e2b3ca4
-0,          1,          1,        1,   921600, 0x0ff7a368
-0,          2,          2,        1,   921600, 0xf5f0dc50
-0,          3,          3,        1,   921600, 0x56cb0c9d
-0,          4,          4,        1,   921600, 0xb253228f
-0,          5,          5,        1,   921600, 0xefd3419e
-0,          6,          6,        1,   921600, 0x708c0ce7
-0,          7,          7,        1,   921600, 0x0b3a7f6d
-0,          8,          8,        1,   921600, 0x72db4eac
-0,          9,          9,        1,   921600, 0x94328111
-0,         10,         10,        1,   921600, 0x95f7b2f0
-0,         11,         11,        1,   921600, 0xdc3c9655
-0,         12,         12,        1,   921600, 0xfe03dec6
-0,         13,         13,        1,   921600, 0x2551dffb
-0,         14,         14,        1,   921600, 0xe8b37d9e
-0,         15,         15,        1,   921600, 0xad93508b
-0,         16,         16,        1,   921600, 0x5a1c4890
-0,         17,         17,        1,   921600, 0x6f972fb4
-0,         18,         18,        1,   921600, 0xa1d5ff95
-0,         19,         19,        1,   921600, 0x7bc5d07c
-0,         20,         20,        1,   921600, 0xc0311e4e
-0,         21,         21,        1,   921600, 0x5b02cc48
-0,         22,         22,        1,   921600, 0x8db4d5fa
-0,         23,         23,        1,   921600, 0x31aae769
-0,         24,         24,        1,   921600, 0xab62b9a7
diff --git a/deps/libav/tests/ref/fate/dfa10 b/deps/libav/tests/ref/fate/dfa10
deleted file mode 100644
index a140e5c..0000000
--- a/deps/libav/tests/ref/fate/dfa10
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 71/1000
-0,          0,          0,        1,   192000, 0xbabcbd55
-0,          1,          1,        1,   192000, 0xf00a5683
-0,          2,          2,        1,   192000, 0xcce90589
-0,          3,          3,        1,   192000, 0x8545631f
-0,          4,          4,        1,   192000, 0xd3ab654c
-0,          5,          5,        1,   192000, 0x5e0dda12
-0,          6,          6,        1,   192000, 0x7e94b053
-0,          7,          7,        1,   192000, 0x8027e68b
diff --git a/deps/libav/tests/ref/fate/dfa11 b/deps/libav/tests/ref/fate/dfa11
deleted file mode 100644
index 3990d24..0000000
--- a/deps/libav/tests/ref/fate/dfa11
+++ /dev/null
@@ -1,10 +0,0 @@
-#tb 0: 71/1000
-0,          0,          0,        1,   192000, 0x8b8bd8de
-0,          1,          1,        1,   192000, 0xdac26ec2
-0,          2,          2,        1,   192000, 0x0fc01c28
-0,          3,          3,        1,   192000, 0x1251eef7
-0,          4,          4,        1,   192000, 0x89eced0e
-0,          5,          5,        1,   192000, 0x4943d821
-0,          6,          6,        1,   192000, 0x49258ec9
-0,          7,          7,        1,   192000, 0x9afd5881
-0,          8,          8,        1,   192000, 0xb322b901
diff --git a/deps/libav/tests/ref/fate/dfa2 b/deps/libav/tests/ref/fate/dfa2
deleted file mode 100644
index a050c97..0000000
--- a/deps/libav/tests/ref/fate/dfa2
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 71/1000
-0,          0,          0,        1,   921600, 0x713f2da1
-0,          1,          1,        1,   921600, 0x9e772ec9
-0,          2,          2,        1,   921600, 0x9420310f
-0,          3,          3,        1,   921600, 0xd68f294f
-0,          4,          4,        1,   921600, 0xe25a1bcf
-0,          5,          5,        1,   921600, 0x32f903ec
-0,          6,          6,        1,   921600, 0xdb290b1c
-0,          7,          7,        1,   921600, 0x0b0d1b0f
-0,          8,          8,        1,   921600, 0x58430921
-0,          9,          9,        1,   921600, 0xe65dd39e
-0,         10,         10,        1,   921600, 0x146b3068
-0,         11,         11,        1,   921600, 0x6e1e7f78
-0,         12,         12,        1,   921600, 0x0166e01c
-0,         13,         13,        1,   921600, 0x83b86b56
-0,         14,         14,        1,   921600, 0xd52a1697
-0,         15,         15,        1,   921600, 0x5b38adc8
-0,         16,         16,        1,   921600, 0x457f6cea
diff --git a/deps/libav/tests/ref/fate/dfa3 b/deps/libav/tests/ref/fate/dfa3
deleted file mode 100644
index 8c91faa..0000000
--- a/deps/libav/tests/ref/fate/dfa3
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/10
-0,          0,          0,        1,   192000, 0x10380cf0
-0,          1,          1,        1,   192000, 0x1d74af4c
-0,          2,          2,        1,   192000, 0xd665492d
-0,          3,          3,        1,   192000, 0xbf544565
-0,          4,          4,        1,   192000, 0xf8a33b00
-0,          5,          5,        1,   192000, 0x7d08bbad
-0,          6,          6,        1,   192000, 0x10685a90
-0,          7,          7,        1,   192000, 0x0a1a9ef6
-0,          8,          8,        1,   192000, 0x3e967980
-0,          9,          9,        1,   192000, 0x9849f751
diff --git a/deps/libav/tests/ref/fate/dfa4 b/deps/libav/tests/ref/fate/dfa4
deleted file mode 100644
index 67b5722..0000000
--- a/deps/libav/tests/ref/fate/dfa4
+++ /dev/null
@@ -1,14 +0,0 @@
-#tb 0: 71/500
-0,          1,          1,        1,   921600, 0xe6309638
-0,          2,          2,        1,   921600, 0xa99a7665
-0,          3,          3,        1,   921600, 0x172ccfbb
-0,          4,          4,        1,   921600, 0xcf676571
-0,          5,          5,        1,   921600, 0x6a5077f2
-0,          6,          6,        1,   921600, 0x6a5077f2
-0,          7,          7,        1,   921600, 0x6a5077f2
-0,          8,          8,        1,   921600, 0x6a5077f2
-0,          9,          9,        1,   921600, 0x6a5077f2
-0,         10,         10,        1,   921600, 0x6a5077f2
-0,         11,         11,        1,   921600, 0xb83db404
-0,         12,         12,        1,   921600, 0x997ceb90
-0,         13,         13,        1,   921600, 0xd707157c
diff --git a/deps/libav/tests/ref/fate/dfa5 b/deps/libav/tests/ref/fate/dfa5
deleted file mode 100644
index b9f7727..0000000
--- a/deps/libav/tests/ref/fate/dfa5
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/10
-0,          0,          0,        1,   192000, 0xc0941c10
-0,          1,          1,        1,   192000, 0xe2fe3ae5
-0,          2,          2,        1,   192000, 0x4a352d98
-0,          3,          3,        1,   192000, 0x7b78e0bb
-0,          4,          4,        1,   192000, 0x855c6675
-0,          5,          5,        1,   192000, 0xf443dad6
-0,          6,          6,        1,   192000, 0xe7e2a2e1
-0,          7,          7,        1,   192000, 0xa9009c58
-0,          8,          8,        1,   192000, 0x551855ab
-0,          9,          9,        1,   192000, 0x253908c7
-0,         10,         10,        1,   192000, 0x616213c4
-0,         11,         11,        1,   192000, 0xa381c3b1
-0,         12,         12,        1,   192000, 0xa2d64152
-0,         13,         13,        1,   192000, 0x34ed0f72
-0,         14,         14,        1,   192000, 0x05be63b4
diff --git a/deps/libav/tests/ref/fate/dfa6 b/deps/libav/tests/ref/fate/dfa6
deleted file mode 100644
index 92ed259..0000000
--- a/deps/libav/tests/ref/fate/dfa6
+++ /dev/null
@@ -1,13 +0,0 @@
-#tb 0: 71/1000
-0,          0,          0,        1,   192000, 0x69f6a5f6
-0,          1,          1,        1,   192000, 0xc741d0a6
-0,          2,          2,        1,   192000, 0xba31e7a4
-0,          3,          3,        1,   192000, 0x7dc45080
-0,          4,          4,        1,   192000, 0x1c91dad5
-0,          5,          5,        1,   192000, 0x564b69b1
-0,          6,          6,        1,   192000, 0xdd9d9ae8
-0,          7,          7,        1,   192000, 0x605c05e1
-0,          8,          8,        1,   192000, 0xa5341ddb
-0,          9,          9,        1,   192000, 0x1ebff8ba
-0,         10,         10,        1,   192000, 0x240df237
-0,         11,         11,        1,   192000, 0xac641867
diff --git a/deps/libav/tests/ref/fate/dfa7 b/deps/libav/tests/ref/fate/dfa7
deleted file mode 100644
index 7dd40f2..0000000
--- a/deps/libav/tests/ref/fate/dfa7
+++ /dev/null
@@ -1,13 +0,0 @@
-#tb 0: 71/1000
-0,          0,          0,        1,     7866, 0xa0056fdb
-0,          1,          1,        1,     7866, 0xed906c7a
-0,          2,          2,        1,     7866, 0x1c6e6f7d
-0,          3,          3,        1,     7866, 0xa2c460f7
-0,          4,          4,        1,     7866, 0xcf2166d4
-0,          5,          5,        1,     7866, 0xea545432
-0,          6,          6,        1,     7866, 0x604a5a9e
-0,          7,          7,        1,     7866, 0xbbc95c89
-0,          8,          8,        1,     7866, 0x80b16b5b
-0,          9,          9,        1,     7866, 0x9a1660ae
-0,         10,         10,        1,     7866, 0x6f886b10
-0,         11,         11,        1,     7866, 0xad8b5c99
diff --git a/deps/libav/tests/ref/fate/dfa8 b/deps/libav/tests/ref/fate/dfa8
deleted file mode 100644
index 39dde05..0000000
--- a/deps/libav/tests/ref/fate/dfa8
+++ /dev/null
@@ -1,37 +0,0 @@
-#tb 0: 71/1000
-0,          0,          0,        1,   134724, 0x2ab217de
-0,          1,          1,        1,   134724, 0xbf240f9a
-0,          2,          2,        1,   134724, 0x020a6010
-0,          3,          3,        1,   134724, 0x9a5f9374
-0,          4,          4,        1,   134724, 0x1e93a7e9
-0,          5,          5,        1,   134724, 0x9e4a4c55
-0,          6,          6,        1,   134724, 0x8f9d1bab
-0,          7,          7,        1,   134724, 0xb26ac45b
-0,          8,          8,        1,   134724, 0xc08706d2
-0,          9,          9,        1,   134724, 0x0806b031
-0,         10,         10,        1,   134724, 0x234dbb33
-0,         11,         11,        1,   134724, 0xe4cbfb2f
-0,         12,         12,        1,   134724, 0xf603f3fd
-0,         13,         13,        1,   134724, 0x205669d1
-0,         14,         14,        1,   134724, 0x7ddbb5e3
-0,         15,         15,        1,   134724, 0x8dfbb45a
-0,         16,         16,        1,   134724, 0x9632f681
-0,         17,         17,        1,   134724, 0x259e462c
-0,         18,         18,        1,   134724, 0x14f2bac1
-0,         19,         19,        1,   134724, 0xac3de7ed
-0,         20,         20,        1,   134724, 0x6b8af396
-0,         21,         21,        1,   134724, 0xd1e4bc1c
-0,         22,         22,        1,   134724, 0x716d1c73
-0,         23,         23,        1,   134724, 0x610956c8
-0,         24,         24,        1,   134724, 0x89ff8e86
-0,         25,         25,        1,   134724, 0xc3ea6b6f
-0,         26,         26,        1,   134724, 0x886688ef
-0,         27,         27,        1,   134724, 0xe60fc8c1
-0,         28,         28,        1,   134724, 0x22bd3131
-0,         29,         29,        1,   134724, 0xb1d74561
-0,         30,         30,        1,   134724, 0x61b069bc
-0,         31,         31,        1,   134724, 0x50b665c1
-0,         32,         32,        1,   134724, 0x027e5144
-0,         33,         33,        1,   134724, 0xfe0c31b4
-0,         34,         34,        1,   134724, 0x1e7a1f2d
-0,         35,         35,        1,   134724, 0x48bff03d
diff --git a/deps/libav/tests/ref/fate/dfa9 b/deps/libav/tests/ref/fate/dfa9
deleted file mode 100644
index cf24e3e..0000000
--- a/deps/libav/tests/ref/fate/dfa9
+++ /dev/null
@@ -1,7 +0,0 @@
-#tb 0: 71/1000
-0,          0,          0,        1,   228150, 0x188c6d9b
-0,          1,          1,        1,   228150, 0x658dbf2f
-0,          2,          2,        1,   228150, 0xc09a4b2e
-0,          3,          3,        1,   228150, 0x8777bc7d
-0,          4,          4,        1,   228150, 0xa388f0ce
-0,          5,          5,        1,   228150, 0x4e06666e
diff --git a/deps/libav/tests/ref/fate/dpcm-idroq b/deps/libav/tests/ref/fate/dpcm-idroq
deleted file mode 100644
index 85e8efb..0000000
--- a/deps/libav/tests/ref/fate/dpcm-idroq
+++ /dev/null
@@ -1,168 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,     7456,    29824, 0x77e265b7
-0,       7456,       7456,      736,     2944, 0x8dcdf50b
-0,       8192,       8192,      736,     2944, 0xb135cd2a
-0,       8928,       8928,      736,     2944, 0x54a6e73f
-0,       9664,       9664,      736,     2944, 0x050ccd4e
-0,      10400,      10400,      736,     2944, 0x6b68db44
-0,      11136,      11136,      736,     2944, 0x55d1f308
-0,      11872,      11872,      736,     2944, 0x7e92f50b
-0,      12608,      12608,      736,     2944, 0xe9e91eed
-0,      13344,      13344,      736,     2944, 0x80af2ce0
-0,      14080,      14080,      736,     2944, 0xc67ffb07
-0,      14816,      14816,      736,     2944, 0x7aaded27
-0,      15552,      15552,      736,     2944, 0x14a024fd
-0,      16288,      16288,      736,     2944, 0x26e8df1f
-0,      17024,      17024,      736,     2944, 0x2688df44
-0,      17760,      17760,      736,     2944, 0x4b9cdd33
-0,      18496,      18496,      736,     2944, 0x10c2f11c
-0,      19232,      19232,      736,     2944, 0xc4e3ad6d
-0,      19968,      19968,      736,     2944, 0xbeb1a78e
-0,      20704,      20704,      736,     2944, 0x283d4e7f
-0,      21440,      21440,      736,     2944, 0x4acf65e0
-0,      22176,      22176,      736,     2944, 0x0ca29b8c
-0,      22912,      22912,      736,     2944, 0x003fae34
-0,      23648,      23648,      736,     2944, 0x2acfec7e
-0,      24384,      24384,      736,     2944, 0xea6fc6fe
-0,      25120,      25120,      736,     2944, 0xf5daec2f
-0,      25856,      25856,      736,     2944, 0x8d33ed7a
-0,      26592,      26592,      736,     2944, 0xc328f984
-0,      27328,      27328,      736,     2944, 0x6e0b58d3
-0,      28064,      28064,      736,     2944, 0xe282dc3f
-0,      28800,      28800,      736,     2944, 0xbf9bf3e6
-0,      29536,      29536,      736,     2944, 0xd7b7d7e3
-0,      30272,      30272,      736,     2944, 0x4e87b6ab
-0,      31008,      31008,      736,     2944, 0x7b8ce8d6
-0,      31744,      31744,      736,     2944, 0xd42991a5
-0,      32480,      32480,      736,     2944, 0x452c98ca
-0,      33216,      33216,      736,     2944, 0x6d27832d
-0,      33952,      33952,      736,     2944, 0xa558720e
-0,      34688,      34688,      736,     2944, 0x0a31bec0
-0,      35424,      35424,      736,     2944, 0x28431384
-0,      36160,      36160,      736,     2944, 0xd5e9fb3d
-0,      36896,      36896,      736,     2944, 0x34f0e9f8
-0,      37632,      37632,      736,     2944, 0x979432df
-0,      38368,      38368,      736,     2944, 0xb00acd4d
-0,      39104,      39104,      736,     2944, 0x726bffd6
-0,      39840,      39840,      736,     2944, 0xa1f39a6d
-0,      40576,      40576,      736,     2944, 0xf6a8e30e
-0,      41312,      41312,      736,     2944, 0x608e9e06
-0,      42048,      42048,      736,     2944, 0x4ec58bc3
-0,      42784,      42784,      736,     2944, 0x6d5c8458
-0,      43520,      43520,      736,     2944, 0x76a0abbd
-0,      44256,      44256,      736,     2944, 0xf830e8a6
-0,      44992,      44992,      736,     2944, 0x1bdd7bec
-0,      45728,      45728,      736,     2944, 0x3c1bd187
-0,      46464,      46464,      736,     2944, 0xf52cf697
-0,      47200,      47200,      736,     2944, 0x8f65b773
-0,      47936,      47936,      736,     2944, 0xf8b5b598
-0,      48672,      48672,      736,     2944, 0xcd87d5ed
-0,      49408,      49408,      736,     2944, 0x672ac02a
-0,      50144,      50144,      736,     2944, 0x1d5d13ed
-0,      50880,      50880,      736,     2944, 0xe298e3d4
-0,      51616,      51616,      736,     2944, 0x3d2e9c32
-0,      52352,      52352,      736,     2944, 0xf3a39259
-0,      53088,      53088,      736,     2944, 0x930ae8f8
-0,      53824,      53824,      736,     2944, 0x8562aff7
-0,      54560,      54560,      736,     2944, 0x9cd6c6a7
-0,      55296,      55296,      736,     2944, 0x2709dc5c
-0,      56032,      56032,      736,     2944, 0xcbe31816
-0,      56768,      56768,      736,     2944, 0xd7876ec4
-0,      57504,      57504,      736,     2944, 0xc2468b6a
-0,      58240,      58240,      736,     2944, 0x76043e84
-0,      58976,      58976,      736,     2944, 0xd2c35bf0
-0,      59712,      59712,      736,     2944, 0x63de6061
-0,      60448,      60448,      736,     2944, 0xd8f6ed1d
-0,      61184,      61184,      736,     2944, 0xe034928a
-0,      61920,      61920,      736,     2944, 0xa044da74
-0,      62656,      62656,      736,     2944, 0xee410dba
-0,      63392,      63392,      736,     2944, 0x8e020c7c
-0,      64128,      64128,      736,     2944, 0x73057ddb
-0,      64864,      64864,      736,     2944, 0xdee5cc18
-0,      65600,      65600,      736,     2944, 0xf4d31dec
-0,      66336,      66336,      736,     2944, 0xe8131e1c
-0,      67072,      67072,      736,     2944, 0x8ae69c95
-0,      67808,      67808,      736,     2944, 0x791c0bf4
-0,      68544,      68544,      736,     2944, 0xd45a10db
-0,      69280,      69280,      736,     2944, 0x3a72b010
-0,      70016,      70016,      736,     2944, 0x6a4a0411
-0,      70752,      70752,      736,     2944, 0xd77ab7f5
-0,      71488,      71488,      736,     2944, 0xe3bf4fe5
-0,      72224,      72224,      736,     2944, 0x12db1be8
-0,      72960,      72960,      736,     2944, 0x345210b0
-0,      73696,      73696,      736,     2944, 0xcfc1f892
-0,      74432,      74432,      736,     2944, 0x5b0a80bb
-0,      75168,      75168,      736,     2944, 0x31ab1168
-0,      75904,      75904,      736,     2944, 0xd4a4bb0a
-0,      76640,      76640,      736,     2944, 0x8e211c8f
-0,      77376,      77376,      736,     2944, 0xcf464d50
-0,      78112,      78112,      736,     2944, 0xe74ff3d6
-0,      78848,      78848,      736,     2944, 0x6274635f
-0,      79584,      79584,      736,     2944, 0xc34c9f64
-0,      80320,      80320,      736,     2944, 0xbb997537
-0,      81056,      81056,      736,     2944, 0x3600da72
-0,      81792,      81792,      736,     2944, 0x343e15f4
-0,      82528,      82528,      736,     2944, 0x17bc58a8
-0,      83264,      83264,      736,     2944, 0x3dcbd3ff
-0,      84000,      84000,      736,     2944, 0x1d422371
-0,      84736,      84736,      736,     2944, 0xe2b83d9d
-0,      85472,      85472,      736,     2944, 0x65388409
-0,      86208,      86208,      736,     2944, 0xafbca269
-0,      86944,      86944,      736,     2944, 0x2d00c0fb
-0,      87680,      87680,      736,     2944, 0xbac9c503
-0,      88416,      88416,      736,     2944, 0x9990768d
-0,      89152,      89152,      736,     2944, 0x8ba978be
-0,      89888,      89888,      736,     2944, 0x5a44a2f5
-0,      90624,      90624,      736,     2944, 0xa4b6f3b8
-0,      91360,      91360,      736,     2944, 0x631b6b9f
-0,      92096,      92096,      736,     2944, 0x4c840923
-0,      92832,      92832,      736,     2944, 0x7c105df3
-0,      93568,      93568,      736,     2944, 0x01bcb213
-0,      94304,      94304,      736,     2944, 0x95cffbf7
-0,      95040,      95040,      736,     2944, 0x170a9c3a
-0,      95776,      95776,      736,     2944, 0x59e09d61
-0,      96512,      96512,      736,     2944, 0x3ea0f205
-0,      97248,      97248,      736,     2944, 0xd9ea1a3a
-0,      97984,      97984,      736,     2944, 0xaf32d704
-0,      98720,      98720,      736,     2944, 0x2d473392
-0,      99456,      99456,      736,     2944, 0x2a8ec544
-0,     100192,     100192,      736,     2944, 0x883c8838
-0,     100928,     100928,      736,     2944, 0xfaf4d789
-0,     101664,     101664,      736,     2944, 0xcb315b65
-0,     102400,     102400,      736,     2944, 0x980c93b0
-0,     103136,     103136,      736,     2944, 0x0819583b
-0,     103872,     103872,      736,     2944, 0xf126e5b5
-0,     104608,     104608,      736,     2944, 0x88836255
-0,     105344,     105344,      736,     2944, 0xc8ae8ca8
-0,     106080,     106080,      736,     2944, 0xf0750551
-0,     106816,     106816,      736,     2944, 0x3dfe13a3
-0,     107552,     107552,      736,     2944, 0xf2aa957b
-0,     108288,     108288,      736,     2944, 0xa77b79a3
-0,     109024,     109024,      736,     2944, 0xb1038284
-0,     109760,     109760,      736,     2944, 0xf96be3ba
-0,     110496,     110496,      736,     2944, 0x1ae6e293
-0,     111232,     111232,      736,     2944, 0x2059d020
-0,     111968,     111968,      736,     2944, 0x7e6c9996
-0,     112704,     112704,      736,     2944, 0x3108b540
-0,     113440,     113440,      736,     2944, 0x75133155
-0,     114176,     114176,      736,     2944, 0x59a19226
-0,     114912,     114912,      736,     2944, 0x3140c138
-0,     115648,     115648,      736,     2944, 0x7570d3be
-0,     116384,     116384,      736,     2944, 0x54fd4ff6
-0,     117120,     117120,      736,     2944, 0x23bcf6dc
-0,     117856,     117856,      736,     2944, 0x2d26489b
-0,     118592,     118592,      736,     2944, 0x4b37bf13
-0,     119328,     119328,      736,     2944, 0x12812ec9
-0,     120064,     120064,      736,     2944, 0xc4a609dd
-0,     120800,     120800,      736,     2944, 0x5a8c5b20
-0,     121536,     121536,      736,     2944, 0xd05d110f
-0,     122272,     122272,      736,     2944, 0xceea6f1f
-0,     123008,     123008,      736,     2944, 0x4033b0a5
-0,     123744,     123744,      736,     2944, 0x101895ce
-0,     124480,     124480,      736,     2944, 0xd6c6809f
-0,     125216,     125216,      736,     2944, 0x197bda7e
-0,     125952,     125952,      736,     2944, 0x96fb3e4b
-0,     126688,     126688,      736,     2944, 0x12a6e3de
-0,     127424,     127424,      736,     2944, 0xfb80e466
-0,     128160,     128160,      736,     2944, 0xedb8c2fc
-0,     128896,     128896,      254,     1016, 0x30e56ca5
diff --git a/deps/libav/tests/ref/fate/dpcm-interplay b/deps/libav/tests/ref/fate/dpcm-interplay
deleted file mode 100644
index bda8a8f..0000000
--- a/deps/libav/tests/ref/fate/dpcm-interplay
+++ /dev/null
@@ -1,125 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,     1462,     5848, 0xea04292b
-0,       1462,       1462,     1472,     5888, 0x0e59e942
-0,       2934,       2934,     1472,     5888, 0x56d480f6
-0,       4406,       4406,     1472,     5888, 0xcb560b22
-0,       5878,       5878,     1472,     5888, 0xca26865b
-0,       7350,       7350,     1472,     5888, 0xa434392f
-0,       8822,       8822,     1472,     5888, 0xa0615fe4
-0,      10294,      10294,     1472,     5888, 0x85b241cd
-0,      11766,      11766,     1472,     5888, 0x2c417a43
-0,      13238,      13238,     1472,     5888, 0x2d5ed665
-0,      14710,      14710,     1472,     5888, 0x37267a2d
-0,      16182,      16182,     1472,     5888, 0x1f803c67
-0,      17654,      17654,     1472,     5888, 0xfb7940ef
-0,      19126,      19126,     1472,     5888, 0x1a5371e8
-0,      20598,      20598,     1472,     5888, 0x37e29b21
-0,      22070,      22070,     1462,     5848, 0x70065769
-0,      23532,      23532,     1472,     5888, 0xaf624f3d
-0,      25004,      25004,     1472,     5888, 0x8f5e5b57
-0,      26476,      26476,     1472,     5888, 0x93545968
-0,      27948,      27948,     1472,     5888, 0x915f268f
-0,      29420,      29420,     1472,     5888, 0x9cd48ac4
-0,      30892,      30892,     1472,     5888, 0x812c8e13
-0,      32364,      32364,     1472,     5888, 0xe794a2a7
-0,      33836,      33836,     1472,     5888, 0x4a056e4b
-0,      35308,      35308,     1472,     5888, 0xa3589992
-0,      36780,      36780,     1472,     5888, 0x19ea7ec5
-0,      38252,      38252,     1472,     5888, 0x422d5097
-0,      39724,      39724,     1472,     5888, 0xc9fd963f
-0,      41196,      41196,     1472,     5888, 0xc556a5ea
-0,      42668,      42668,     1472,     5888, 0x51557e0f
-0,      44140,      44140,     1462,     5848, 0x4903ad21
-0,      45602,      45602,     1472,     5888, 0xb1c85e85
-0,      47074,      47074,     1472,     5888, 0x68963d65
-0,      48546,      48546,     1472,     5888, 0x62a3124e
-0,      50018,      50018,     1472,     5888, 0x4ff1878f
-0,      51490,      51490,     1472,     5888, 0x8b09ac18
-0,      52962,      52962,     1472,     5888, 0x67d85338
-0,      54434,      54434,     1472,     5888, 0x82eca0a6
-0,      55906,      55906,     1472,     5888, 0x81a17eb8
-0,      57378,      57378,     1472,     5888, 0x7108478c
-0,      58850,      58850,     1472,     5888, 0xbfc18b09
-0,      60322,      60322,     1472,     5888, 0xad93711f
-0,      61794,      61794,     1472,     5888, 0xf8d25e39
-0,      63266,      63266,     1472,     5888, 0x41edd04e
-0,      64738,      64738,     1472,     5888, 0xa6557ee2
-0,      66210,      66210,     1462,     5848, 0xc14d5456
-0,      67672,      67672,     1472,     5888, 0x20a7821f
-0,      69144,      69144,     1472,     5888, 0x9f1a8f9d
-0,      70616,      70616,     1472,     5888, 0x2f3c6cc8
-0,      72088,      72088,     1472,     5888, 0x757c894a
-0,      73560,      73560,     1472,     5888, 0x483e98bb
-0,      75032,      75032,     1472,     5888, 0x84289c75
-0,      76504,      76504,     1472,     5888, 0xf79d5a91
-0,      77976,      77976,     1472,     5888, 0x395b5228
-0,      79448,      79448,     1472,     5888, 0x9c937a14
-0,      80920,      80920,     1472,     5888, 0x40c169cf
-0,      82392,      82392,     1472,     5888, 0x3e7f99b0
-0,      83864,      83864,     1472,     5888, 0xd4de993e
-0,      85336,      85336,     1472,     5888, 0xae856b09
-0,      86808,      86808,     1472,     5888, 0xa2369c95
-0,      88280,      88280,     1462,     5848, 0x992d516b
-0,      89742,      89742,     1472,     5888, 0xcd785ba9
-0,      91214,      91214,     1472,     5888, 0x55ea3bce
-0,      92686,      92686,     1472,     5888, 0xf06d4bbf
-0,      94158,      94158,     1472,     5888, 0x2a9d4c1a
-0,      95630,      95630,     1472,     5888, 0xd5e348a3
-0,      97102,      97102,     1472,     5888, 0x6431a24c
-0,      98574,      98574,     1472,     5888, 0x41f9908c
-0,     100046,     100046,     1472,     5888, 0x0ed99656
-0,     101518,     101518,     1472,     5888, 0x635a6392
-0,     102990,     102990,     1472,     5888, 0x690c750c
-0,     104462,     104462,     1472,     5888, 0xf9d97b23
-0,     105934,     105934,     1472,     5888, 0x75e1606b
-0,     107406,     107406,     1472,     5888, 0x1bcb43b0
-0,     108878,     108878,     1472,     5888, 0x48c295cb
-0,     110350,     110350,     1462,     5848, 0xe47f7b5d
-0,     111812,     111812,     1472,     5888, 0x20be7f3e
-0,     113284,     113284,     1472,     5888, 0x8c2428c4
-0,     114756,     114756,     1472,     5888, 0x851379af
-0,     116228,     116228,     1472,     5888, 0x5916647d
-0,     117700,     117700,     1472,     5888, 0xef9c6281
-0,     119172,     119172,     1472,     5888, 0x49660d32
-0,     120644,     120644,     1472,     5888, 0x62cf36a1
-0,     122116,     122116,     1472,     5888, 0x56dff39c
-0,     123588,     123588,     1472,     5888, 0x4e6b5b02
-0,     125060,     125060,     1472,     5888, 0xb8697067
-0,     126532,     126532,     1472,     5888, 0xcb4e2706
-0,     128004,     128004,     1472,     5888, 0x6eaa9669
-0,     129476,     129476,     1472,     5888, 0xfd9d7dba
-0,     130948,     130948,     1472,     5888, 0xfe137923
-0,     132420,     132420,     1462,     5848, 0x1931296f
-0,     133882,     133882,     1472,     5888, 0xa09a7c03
-0,     135354,     135354,     1472,     5888, 0xded9802d
-0,     136826,     136826,     1472,     5888, 0x9f6723b7
-0,     138298,     138298,     1472,     5888, 0x3ad02476
-0,     139770,     139770,     1472,     5888, 0xa1647e32
-0,     141242,     141242,     1472,     5888, 0x728672da
-0,     142714,     142714,     1472,     5888, 0x9c098090
-0,     144186,     144186,     1472,     5888, 0x32a65ea3
-0,     145658,     145658,     1472,     5888, 0xdde141d5
-0,     147130,     147130,     1472,     5888, 0x816c5fb4
-0,     148602,     148602,     1472,     5888, 0x75e17581
-0,     150074,     150074,     1472,     5888, 0x59035469
-0,     151546,     151546,     1472,     5888, 0x20d340cd
-0,     153018,     153018,     1472,     5888, 0xa89a8790
-0,     154490,     154490,     1462,     5848, 0x12b74c34
-0,     155952,     155952,     1472,     5888, 0xcd3b3bef
-0,     157424,     157424,     1472,     5888, 0xe5c44bf3
-0,     158896,     158896,     1472,     5888, 0xb82c4fa4
-0,     160368,     160368,     1472,     5888, 0x05b2443a
-0,     161840,     161840,     1472,     5888, 0x78028172
-0,     163312,     163312,     1472,     5888, 0xdfcac19a
-0,     164784,     164784,     1472,     5888, 0x0761a0b9
-0,     166256,     166256,     1472,     5888, 0x77d88607
-0,     167728,     167728,     1472,     5888, 0xdd7f4d77
-0,     169200,     169200,     1472,     5888, 0x366bf58a
-0,     170672,     170672,     1472,     5888, 0x9a3d59b5
-0,     172144,     172144,     1472,     5888, 0x16cb777f
-0,     173616,     173616,     1472,     5888, 0x1d4afe64
-0,     175088,     175088,     1472,     5888, 0xc0fe1e73
-0,     176560,     176560,     1462,     5848, 0xcceb69c8
-0,     178022,     178022,     1472,     5888, 0x89449643
-0,     179494,     179494,     1472,     5888, 0x5fe595b7
-0,     180966,     180966,     1472,     5888, 0x400a8c77
diff --git a/deps/libav/tests/ref/fate/dpcm-sierra b/deps/libav/tests/ref/fate/dpcm-sierra
deleted file mode 100644
index 16f226e..0000000
--- a/deps/libav/tests/ref/fate/dpcm-sierra
+++ /dev/null
@@ -1 +0,0 @@
-a99402e1f1a0f137608898251b3f309b
diff --git a/deps/libav/tests/ref/fate/dpcm-xan b/deps/libav/tests/ref/fate/dpcm-xan
deleted file mode 100644
index cb56677..0000000
--- a/deps/libav/tests/ref/fate/dpcm-xan
+++ /dev/null
@@ -1 +0,0 @@
-b6da857766896ab10bb900004f915053
diff --git a/deps/libav/tests/ref/fate/dpx b/deps/libav/tests/ref/fate/dpx
deleted file mode 100644
index fdb85ca..0000000
--- a/deps/libav/tests/ref/fate/dpx
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  2359296, 0x30d4d24f
diff --git a/deps/libav/tests/ref/fate/dxa-feeble b/deps/libav/tests/ref/fate/dxa-feeble
deleted file mode 100644
index 74b43dc..0000000
--- a/deps/libav/tests/ref/fate/dxa-feeble
+++ /dev/null
@@ -1,21 +0,0 @@
-#tb 0: 1/10
-0,          0,          0,        1,   921600, 0x0d03844f
-0,          1,          1,        1,   921600, 0x0d03844f
-0,          2,          2,        1,   921600, 0x649cdcea
-0,          3,          3,        1,   921600, 0x649cdcea
-0,          4,          4,        1,   921600, 0x9c7f22e8
-0,          5,          5,        1,   921600, 0x9c7f22e8
-0,          6,          6,        1,   921600, 0x3451514a
-0,          7,          7,        1,   921600, 0x3451514a
-0,          8,          8,        1,   921600, 0x8f19f600
-0,          9,          9,        1,   921600, 0x8f19f600
-0,         10,         10,        1,   921600, 0x07e7445b
-0,         11,         11,        1,   921600, 0x07e7445b
-0,         12,         12,        1,   921600, 0x873d1227
-0,         13,         13,        1,   921600, 0x873d1227
-0,         14,         14,        1,   921600, 0xbef62d86
-0,         15,         15,        1,   921600, 0xbef62d86
-0,         16,         16,        1,   921600, 0xcf84fee4
-0,         17,         17,        1,   921600, 0xcf84fee4
-0,         18,         18,        1,   921600, 0x5639e670
-0,         19,         19,        1,   921600, 0x5639e670
diff --git a/deps/libav/tests/ref/fate/dxa-scummvm b/deps/libav/tests/ref/fate/dxa-scummvm
deleted file mode 100644
index 308a896..0000000
--- a/deps/libav/tests/ref/fate/dxa-scummvm
+++ /dev/null
@@ -1,13 +0,0 @@
-#tb 0: 8333/100000
-0,          0,          0,        1,   384000, 0xef37f34b
-0,          1,          1,        1,   384000, 0xef37f34b
-0,          2,          2,        1,   384000, 0xfca3cd8b
-0,          3,          3,        1,   384000, 0xfca3cd8b
-0,          4,          4,        1,   384000, 0x6dd34bb7
-0,          5,          5,        1,   384000, 0x6dd34bb7
-0,          6,          6,        1,   384000, 0xfd518717
-0,          7,          7,        1,   384000, 0xfd518717
-0,          8,          8,        1,   384000, 0x82db5c7b
-0,          9,          9,        1,   384000, 0x82db5c7b
-0,         10,         10,        1,   384000, 0xe280a5a6
-0,         11,         11,        1,   384000, 0xe280a5a6
diff --git a/deps/libav/tests/ref/fate/dxtory b/deps/libav/tests/ref/fate/dxtory
deleted file mode 100644
index 7d3ecbd..0000000
--- a/deps/libav/tests/ref/fate/dxtory
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-#tb 1: 1/48000
-0,          0,          0,        1,  1382400, 0x44373645
diff --git a/deps/libav/tests/ref/fate/ea-cdata b/deps/libav/tests/ref/fate/ea-cdata
deleted file mode 100644
index cbfc1f5..0000000
--- a/deps/libav/tests/ref/fate/ea-cdata
+++ /dev/null
@@ -1 +0,0 @@
-db441b7f9c8767ee675002763cd3ae46
diff --git a/deps/libav/tests/ref/fate/ea-cmv b/deps/libav/tests/ref/fate/ea-cmv
deleted file mode 100644
index 18f2b3a..0000000
--- a/deps/libav/tests/ref/fate/ea-cmv
+++ /dev/null
@@ -1,195 +0,0 @@
-#tb 0: 1/10
-0,          1,          1,        1,   120000, 0x34ac91d2
-0,          2,          2,        1,   120000, 0x17150729
-0,          3,          3,        1,   120000, 0xc3f510bb
-0,          4,          4,        1,   120000, 0xb3b14a3b
-0,          5,          5,        1,   120000, 0x26a7f3d1
-0,          6,          6,        1,   120000, 0xd161af6f
-0,          7,          7,        1,   120000, 0x459fc92d
-0,          8,          8,        1,   120000, 0x05c3fa94
-0,          9,          9,        1,   120000, 0x6630cd8c
-0,         10,         10,        1,   120000, 0x60cd39d4
-0,         11,         11,        1,   120000, 0xc8854d1c
-0,         12,         12,        1,   120000, 0xe55e8e6d
-0,         13,         13,        1,   120000, 0xbeab201f
-0,         14,         14,        1,   120000, 0x70744b0b
-0,         15,         15,        1,   120000, 0x80dea5d0
-0,         16,         16,        1,   120000, 0x769bfa1c
-0,         17,         17,        1,   120000, 0x04e25bbe
-0,         18,         18,        1,   120000, 0x48abc5a5
-0,         19,         19,        1,   120000, 0xda5c4e2a
-0,         20,         20,        1,   120000, 0x8de96d38
-0,         21,         21,        1,   120000, 0xe96418b0
-0,         22,         22,        1,   120000, 0x1c2f272b
-0,         23,         23,        1,   120000, 0x4b755804
-0,         24,         24,        1,   120000, 0xc92f96fd
-0,         25,         25,        1,   120000, 0x69e90ebb
-0,         26,         26,        1,   120000, 0x78d4bd1a
-0,         27,         27,        1,   120000, 0xaf2edf55
-0,         28,         28,        1,   120000, 0x94161c78
-0,         29,         29,        1,   120000, 0x1109094d
-0,         30,         30,        1,   120000, 0xc61b0392
-0,         31,         31,        1,   120000, 0xc157d003
-0,         32,         32,        1,   120000, 0xf2747e7b
-0,         33,         33,        1,   120000, 0xa36299c2
-0,         34,         34,        1,   120000, 0x49bc788c
-0,         35,         35,        1,   120000, 0x3bee336e
-0,         36,         36,        1,   120000, 0xa316b9d1
-0,         37,         37,        1,   120000, 0x5cc32e9c
-0,         38,         38,        1,   120000, 0x9f7eca16
-0,         39,         39,        1,   120000, 0x958e2988
-0,         40,         40,        1,   120000, 0xebcba2f1
-0,         41,         41,        1,   120000, 0x281f1e60
-0,         42,         42,        1,   120000, 0x82256c4d
-0,         43,         43,        1,   120000, 0xddc8be56
-0,         44,         44,        1,   120000, 0x64ff2ed0
-0,         45,         45,        1,   120000, 0x3e63ab02
-0,         46,         46,        1,   120000, 0x43f78b37
-0,         47,         47,        1,   120000, 0xb7cc62d4
-0,         48,         48,        1,   120000, 0x694f1764
-0,         49,         49,        1,   120000, 0x2264c483
-0,         51,         51,        1,   120000, 0xb6680b4a
-0,         52,         52,        1,   120000, 0x2a92626a
-0,         53,         53,        1,   120000, 0x8da02509
-0,         54,         54,        1,   120000, 0xa976c382
-0,         55,         55,        1,   120000, 0x749e822b
-0,         56,         56,        1,   120000, 0xe9e7fc8c
-0,         57,         57,        1,   120000, 0xfdc05a0c
-0,         58,         58,        1,   120000, 0x7d5a856d
-0,         59,         59,        1,   120000, 0xcc344937
-0,         60,         60,        1,   120000, 0x9d90bc67
-0,         61,         61,        1,   120000, 0x3f527712
-0,         62,         62,        1,   120000, 0xf0f57f97
-0,         63,         63,        1,   120000, 0xc29535cd
-0,         64,         64,        1,   120000, 0x9a64598b
-0,         65,         65,        1,   120000, 0x0d1ddf7c
-0,         66,         66,        1,   120000, 0xb580ec24
-0,         67,         67,        1,   120000, 0xf0db5bbc
-0,         68,         68,        1,   120000, 0x6b980b61
-0,         69,         69,        1,   120000, 0xc29f30b5
-0,         70,         70,        1,   120000, 0xaf2c4bcd
-0,         71,         71,        1,   120000, 0x1e725645
-0,         72,         72,        1,   120000, 0x295c4c96
-0,         73,         73,        1,   120000, 0x7ea121a2
-0,         74,         74,        1,   120000, 0xdb9e9cec
-0,         75,         75,        1,   120000, 0x1da47c80
-0,         76,         76,        1,   120000, 0x9d0c1345
-0,         77,         77,        1,   120000, 0x88058527
-0,         78,         78,        1,   120000, 0x46766aed
-0,         79,         79,        1,   120000, 0xba520bd3
-0,         80,         80,        1,   120000, 0x7fb6373c
-0,         81,         81,        1,   120000, 0x05a86f4d
-0,         82,         82,        1,   120000, 0x7fb47cbd
-0,         83,         83,        1,   120000, 0x6814d8ca
-0,         84,         84,        1,   120000, 0x9c13acb8
-0,         85,         85,        1,   120000, 0xad0edbfe
-0,         86,         86,        1,   120000, 0x352fde81
-0,         87,         87,        1,   120000, 0xa654b386
-0,         88,         88,        1,   120000, 0xd3b3dc72
-0,         89,         89,        1,   120000, 0x01572668
-0,         90,         90,        1,   120000, 0x30189e03
-0,         91,         91,        1,   120000, 0x26126d30
-0,         92,         92,        1,   120000, 0x4f376c7d
-0,         93,         93,        1,   120000, 0xd3667bcf
-0,         94,         94,        1,   120000, 0x0b46b3d5
-0,         95,         95,        1,   120000, 0x893415ef
-0,         96,         96,        1,   120000, 0x99a78749
-0,         97,         97,        1,   120000, 0x6da0d8e9
-0,         98,         98,        1,   120000, 0x22d8ceb6
-0,         99,         99,        1,   120000, 0x67ef9be8
-0,        100,        100,        1,   120000, 0xb696fb53
-0,        101,        101,        1,   120000, 0x70339dab
-0,        102,        102,        1,   120000, 0xc1876efa
-0,        103,        103,        1,   120000, 0x80e78c92
-0,        104,        104,        1,   120000, 0x18d2f2ac
-0,        105,        105,        1,   120000, 0x28be9ae4
-0,        106,        106,        1,   120000, 0xc3c2c190
-0,        107,        107,        1,   120000, 0xd6a859d8
-0,        108,        108,        1,   120000, 0x40b9046d
-0,        109,        109,        1,   120000, 0x7f8d5999
-0,        110,        110,        1,   120000, 0x89724027
-0,        111,        111,        1,   120000, 0x4c15c988
-0,        112,        112,        1,   120000, 0x812ebe08
-0,        113,        113,        1,   120000, 0x273ef8e2
-0,        114,        114,        1,   120000, 0xe029de06
-0,        115,        115,        1,   120000, 0x5846127c
-0,        116,        116,        1,   120000, 0x6c5df8e3
-0,        117,        117,        1,   120000, 0x7424919f
-0,        118,        118,        1,   120000, 0xa8313015
-0,        119,        119,        1,   120000, 0x28878ab4
-0,        120,        120,        1,   120000, 0x126d0746
-0,        121,        121,        1,   120000, 0xee3f7138
-0,        122,        122,        1,   120000, 0xd4b2e0a1
-0,        123,        123,        1,   120000, 0x8d60bfff
-0,        124,        124,        1,   120000, 0x701c23d0
-0,        125,        125,        1,   120000, 0x1cbb5654
-0,        126,        126,        1,   120000, 0x0f5853e9
-0,        127,        127,        1,   120000, 0x2a5c3339
-0,        128,        128,        1,   120000, 0x86b00350
-0,        129,        129,        1,   120000, 0xe8cc6931
-0,        130,        130,        1,   120000, 0xf1cad983
-0,        131,        131,        1,   120000, 0xabcd8704
-0,        132,        132,        1,   120000, 0x89592f94
-0,        133,        133,        1,   120000, 0x100486d9
-0,        134,        134,        1,   120000, 0x60ef9e2d
-0,        135,        135,        1,   120000, 0x2485176a
-0,        136,        136,        1,   120000, 0x6b8c360d
-0,        137,        137,        1,   120000, 0xe2e1bf4f
-0,        138,        138,        1,   120000, 0xe17b65c3
-0,        139,        139,        1,   120000, 0x2a42821a
-0,        140,        140,        1,   120000, 0xbe9ddba7
-0,        141,        141,        1,   120000, 0x19f937fe
-0,        142,        142,        1,   120000, 0xb7e0c600
-0,        143,        143,        1,   120000, 0xfbf8c5f6
-0,        144,        144,        1,   120000, 0x93b62f93
-0,        145,        145,        1,   120000, 0xb6ddec93
-0,        146,        146,        1,   120000, 0xa04d031b
-0,        147,        147,        1,   120000, 0x61c986c0
-0,        148,        148,        1,   120000, 0x3516e54a
-0,        149,        149,        1,   120000, 0x3489eb2c
-0,        150,        150,        1,   120000, 0xb75a4827
-0,        151,        151,        1,   120000, 0x76031a80
-0,        152,        152,        1,   120000, 0x867c3969
-0,        153,        153,        1,   120000, 0x9b63a093
-0,        154,        154,        1,   120000, 0xcb253d8a
-0,        155,        155,        1,   120000, 0x354ba3b2
-0,        156,        156,        1,   120000, 0x4d5ead8c
-0,        157,        157,        1,   120000, 0x7b7029ae
-0,        158,        158,        1,   120000, 0x4765ab9d
-0,        159,        159,        1,   120000, 0x747cdee9
-0,        160,        160,        1,   120000, 0x20989b08
-0,        161,        161,        1,   120000, 0x3a957085
-0,        162,        162,        1,   120000, 0xdd49e8ad
-0,        163,        163,        1,   120000, 0x00e89719
-0,        164,        164,        1,   120000, 0x2822aa76
-0,        165,        165,        1,   120000, 0x492388f3
-0,        166,        166,        1,   120000, 0x4dffa6ee
-0,        167,        167,        1,   120000, 0xc382bb83
-0,        168,        168,        1,   120000, 0xb59aaa74
-0,        169,        169,        1,   120000, 0x7c7885d3
-0,        170,        170,        1,   120000, 0xc05ee219
-0,        171,        171,        1,   120000, 0xc3df6b73
-0,        172,        172,        1,   120000, 0x8ae31170
-0,        173,        173,        1,   120000, 0xb979fdce
-0,        174,        174,        1,   120000, 0xb8f9e407
-0,        175,        175,        1,   120000, 0x56675b80
-0,        176,        176,        1,   120000, 0x1aad1ce2
-0,        177,        177,        1,   120000, 0xa050a52b
-0,        178,        178,        1,   120000, 0x49f8c32f
-0,        179,        179,        1,   120000, 0x8e7f4d2c
-0,        180,        180,        1,   120000, 0x5c07f751
-0,        181,        181,        1,   120000, 0x67fa5523
-0,        182,        182,        1,   120000, 0xf38b933a
-0,        183,        183,        1,   120000, 0xb113e202
-0,        184,        184,        1,   120000, 0xb8d99ff4
-0,        185,        185,        1,   120000, 0x15ab6cc6
-0,        186,        186,        1,   120000, 0xd64a51c9
-0,        187,        187,        1,   120000, 0x2088b53c
-0,        188,        188,        1,   120000, 0xdd78d40a
-0,        189,        189,        1,   120000, 0x2fb58848
-0,        190,        190,        1,   120000, 0xf775d36a
-0,        191,        191,        1,   120000, 0xa03987e9
-0,        192,        192,        1,   120000, 0x457322ad
-0,        193,        193,        1,   120000, 0x0f6c3d1c
-0,        194,        194,        1,   120000, 0xbdf2f1a5
-0,        195,        195,        1,   120000, 0x5828ee1d
diff --git a/deps/libav/tests/ref/fate/ea-mad b/deps/libav/tests/ref/fate/ea-mad
deleted file mode 100644
index ce1df4a..0000000
--- a/deps/libav/tests/ref/fate/ea-mad
+++ /dev/null
@@ -1,97 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,        0,   535680, 0x889c32cf
-0,       2970,       2970,        0,   535680, 0x0b1ef044
-0,       5940,       5940,        0,   535680, 0xa7d0818b
-0,       8910,       8910,        0,   535680, 0xf392e4e1
-0,      11880,      11880,        0,   535680, 0x08480c69
-0,      14850,      14850,        0,   535680, 0x2b8af1ed
-0,      17820,      17820,        0,   535680, 0x0d58e062
-0,      20790,      20790,        0,   535680, 0xd140ced0
-0,      23760,      23760,        0,   535680, 0xbd0e6652
-0,      26730,      26730,        0,   535680, 0xdc2f2a6b
-0,      29700,      29700,        0,   535680, 0x97c31a38
-0,      32670,      32670,        0,   535680, 0x1a2bdf38
-0,      35640,      35640,        0,   535680, 0xb3af3ac4
-0,      38610,      38610,        0,   535680, 0x07a52577
-0,      41580,      41580,        0,   535680, 0x78407368
-0,      44550,      44550,        0,   535680, 0xd2a9efc3
-0,      47520,      47520,        0,   535680, 0x36df2f29
-0,      50490,      50490,        0,   535680, 0x9821d8f7
-0,      53460,      53460,        0,   535680, 0xf64321aa
-0,      56430,      56430,        0,   535680, 0x53e4d9aa
-0,      59400,      59400,        0,   535680, 0xdbd6f853
-0,      62370,      62370,        0,   535680, 0x5d40cf8b
-0,      65340,      65340,        0,   535680, 0xe624af9d
-0,      68310,      68310,        0,   535680, 0xd9dbb4cd
-0,      71280,      71280,        0,   535680, 0xf14e72ec
-0,      74250,      74250,        0,   535680, 0xb35c18f6
-0,      77220,      77220,        0,   535680, 0xc96d7757
-0,      80190,      80190,        0,   535680, 0xdfb937df
-0,      83160,      83160,        0,   535680, 0x40cd71d7
-0,      86130,      86130,        0,   535680, 0x15e176d6
-0,      89100,      89100,        0,   535680, 0x7f891b24
-0,      92070,      92070,        0,   535680, 0xb87a8c32
-0,      95040,      95040,        0,   535680, 0x0c01541f
-0,      98010,      98010,        0,   535680, 0x9eee99b3
-0,     100980,     100980,        0,   535680, 0xd65eb689
-0,     103950,     103950,        0,   535680, 0x6e733cfa
-0,     106920,     106920,        0,   535680, 0xac536670
-0,     109890,     109890,        0,   535680, 0x002275b8
-0,     112860,     112860,        0,   535680, 0x6a5385cb
-0,     115830,     115830,        0,   535680, 0xd129ade3
-0,     118800,     118800,        0,   535680, 0x32cab5d7
-0,     121770,     121770,        0,   535680, 0x08be1c8f
-0,     124740,     124740,        0,   535680, 0x59e1fba0
-0,     127710,     127710,        0,   535680, 0x138aee3a
-0,     130680,     130680,        0,   535680, 0x4cfbcd5e
-0,     133650,     133650,        0,   535680, 0xf6cf0fb4
-0,     136620,     136620,        0,   535680, 0xb13a06de
-0,     139590,     139590,        0,   535680, 0x59176f00
-0,     142560,     142560,        0,   535680, 0xf84b4ca3
-0,     145530,     145530,        0,   535680, 0x7fd09f73
-0,     148500,     148500,        0,   535680, 0x3be383b8
-0,     151470,     151470,        0,   535680, 0xa7118e51
-0,     154440,     154440,        0,   535680, 0xbd83120c
-0,     157410,     157410,        0,   535680, 0x3bc9d256
-0,     160380,     160380,        0,   535680, 0xb6c87f87
-0,     163350,     163350,        0,   535680, 0xe80d110a
-0,     166320,     166320,        0,   535680, 0xb3a83362
-0,     169290,     169290,        0,   535680, 0xfb39eb52
-0,     172260,     172260,        0,   535680, 0xbf6e1220
-0,     175230,     175230,        0,   535680, 0x9ecdfbae
-0,     178200,     178200,        0,   535680, 0x069a65f5
-0,     181170,     181170,        0,   535680, 0x206e372c
-0,     184140,     184140,        0,   535680, 0x58c83dd4
-0,     187110,     187110,        0,   535680, 0xc3562b03
-0,     190080,     190080,        0,   535680, 0xd1ed85a0
-0,     193050,     193050,        0,   535680, 0xb6205f4b
-0,     196020,     196020,        0,   535680, 0xaedf8bfa
-0,     198990,     198990,        0,   535680, 0xa48d5dea
-0,     201960,     201960,        0,   535680, 0xff82e7c1
-0,     204930,     204930,        0,   535680, 0xc9560222
-0,     207900,     207900,        0,   535680, 0x0fafa549
-0,     210870,     210870,        0,   535680, 0x8d556ccb
-0,     213840,     213840,        0,   535680, 0x802aac1f
-0,     216810,     216810,        0,   535680, 0x7d0fa168
-0,     219780,     219780,        0,   535680, 0x1a9255c9
-0,     222750,     222750,        0,   535680, 0xb4ec7e35
-0,     225720,     225720,        0,   535680, 0x48fac072
-0,     228690,     228690,        0,   535680, 0x1e260135
-0,     231660,     231660,        0,   535680, 0xce4d5079
-0,     234630,     234630,        0,   535680, 0x13e5e4ed
-0,     237600,     237600,        0,   535680, 0x592305ec
-0,     240570,     240570,        0,   535680, 0x9e227508
-0,     243540,     243540,        0,   535680, 0x1d37e5ea
-0,     246510,     246510,        0,   535680, 0x7eae7692
-0,     249480,     249480,        0,   535680, 0xf452e4b9
-0,     252450,     252450,        0,   535680, 0x1460e7e9
-0,     255420,     255420,        0,   535680, 0xc6d8a638
-0,     258390,     258390,        0,   535680, 0x854f5fb0
-0,     261360,     261360,        0,   535680, 0x854f5fb0
-0,     264330,     264330,        0,   535680, 0x70a02d87
-0,     267300,     267300,        0,   535680, 0x9a4ad464
-0,     270270,     270270,        0,   535680, 0x9a4ad464
-0,     273240,     273240,        0,   535680, 0x9a4ad464
-0,     276210,     276210,        0,   535680, 0x9a4ad464
-0,     279180,     279180,        0,   535680, 0x9a4ad464
-0,     282150,     282150,        0,   535680, 0x9a4ad464
diff --git a/deps/libav/tests/ref/fate/ea-tgq b/deps/libav/tests/ref/fate/ea-tgq
deleted file mode 100644
index edb04fa..0000000
--- a/deps/libav/tests/ref/fate/ea-tgq
+++ /dev/null
@@ -1,279 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,        0,    34944, 0xe33671a4
-0,       6000,       6000,        0,    34944, 0xe33671a4
-0,      12000,      12000,        0,    34944, 0xe33671a4
-0,      18000,      18000,        0,    34944, 0xe33671a4
-0,      24000,      24000,        0,    34944, 0xe33671a4
-0,      30000,      30000,        0,    34944, 0xe33671a4
-0,      36000,      36000,        0,    34944, 0xe33671a4
-0,      42000,      42000,        0,    34944, 0xe33671a4
-0,      48000,      48000,        0,    34944, 0xe33671a4
-0,      54000,      54000,        0,    34944, 0xe33671a4
-0,      60000,      60000,        0,    34944, 0xe33671a4
-0,      66000,      66000,        0,    34944, 0xe33671a4
-0,      72000,      72000,        0,    34944, 0xe33671a4
-0,      78000,      78000,        0,    34944, 0xe33671a4
-0,      84000,      84000,        0,    34944, 0xe33671a4
-0,      90000,      90000,        0,    34944, 0x63196b41
-0,      96000,      96000,        0,    34944, 0x308d6f10
-0,     102000,     102000,        0,    34944, 0x86026ced
-0,     108000,     108000,        0,    34944, 0xaa6a6bc9
-0,     114000,     114000,        0,    34944, 0x58276ee3
-0,     120000,     120000,        0,    34944, 0x402d70c2
-0,     126000,     126000,        0,    34944, 0x948d74bf
-0,     132000,     132000,        0,    34944, 0x3d31759c
-0,     138000,     138000,        0,    34944, 0x638c734e
-0,     144000,     144000,        0,    34944, 0xe218768a
-0,     150000,     150000,        0,    34944, 0xed6678ff
-0,     156000,     156000,        0,    34944, 0x381b7dda
-0,     162000,     162000,        0,    34944, 0x216680e7
-0,     168000,     168000,        0,    34944, 0xaca5810f
-0,     174000,     174000,        0,    34944, 0xf70b81eb
-0,     180000,     180000,        0,    34944, 0x3675858b
-0,     186000,     186000,        0,    34944, 0xa51188c3
-0,     192000,     192000,        0,    34944, 0x3a848bf1
-0,     198000,     198000,        0,    34944, 0x67608d4d
-0,     204000,     204000,        0,    34944, 0xafe49165
-0,     210000,     210000,        0,    34944, 0x7e8a94a7
-0,     216000,     216000,        0,    34944, 0x3b889432
-0,     222000,     222000,        0,    34944, 0x97e89623
-0,     228000,     228000,        0,    34944, 0x07819793
-0,     234000,     234000,        0,    34944, 0xdac39b87
-0,     240000,     240000,        0,    34944, 0x4d8c9d93
-0,     246000,     246000,        0,    34944, 0xcf009fa7
-0,     252000,     252000,        0,    34944, 0x2f109f6e
-0,     258000,     258000,        0,    34944, 0xcedda4eb
-0,     264000,     264000,        0,    34944, 0xfe89a6df
-0,     270000,     270000,        0,    34944, 0x195ea7a9
-0,     276000,     276000,        0,    34944, 0x9287ab92
-0,     282000,     282000,        0,    34944, 0x6d21af54
-0,     288000,     288000,        0,    34944, 0xd627b28b
-0,     294000,     294000,        0,    34944, 0x3ad5b6fd
-0,     300000,     300000,        0,    34944, 0x5101b64d
-0,     306000,     306000,        0,    34944, 0xb968b8ca
-0,     312000,     312000,        0,    34944, 0xa105b74a
-0,     318000,     318000,        0,    34944, 0xc056bdd6
-0,     324000,     324000,        0,    34944, 0xec7fc1d9
-0,     330000,     330000,        0,    34944, 0x92c3c3e0
-0,     336000,     336000,        0,    34944, 0x9bffc45c
-0,     342000,     342000,        0,    34944, 0x5aabca4b
-0,     348000,     348000,        0,    34944, 0xcbdacb26
-0,     354000,     354000,        0,    34944, 0xed6cce3f
-0,     360000,     360000,        0,    34944, 0xcc61cfb8
-0,     366000,     366000,        0,    34944, 0x7a97d427
-0,     372000,     372000,        0,    34944, 0x7cdbd5ec
-0,     378000,     378000,        0,    34944, 0x5851d9c4
-0,     384000,     384000,        0,    34944, 0x69d5dd1d
-0,     390000,     390000,        0,    34944, 0xdf30dcf4
-0,     396000,     396000,        0,    34944, 0x2359e084
-0,     402000,     402000,        0,    34944, 0xe0bae491
-0,     408000,     408000,        0,    34944, 0xa716e4fd
-0,     414000,     414000,        0,    34944, 0xe48aeaf4
-0,     420000,     420000,        0,    34944, 0x0a0deb21
-0,     426000,     426000,        0,    34944, 0xe8a56e12
-0,     432000,     432000,        0,    34944, 0x0d72c98e
-0,     438000,     438000,        0,    34944, 0x71a7bb9d
-0,     444000,     444000,        0,    34944, 0xc0c8c108
-0,     450000,     450000,        0,    34944, 0x1d1fc3ba
-0,     456000,     456000,        0,    34944, 0xebcfc67f
-0,     462000,     462000,        0,    34944, 0x2921cb5b
-0,     468000,     468000,        0,    34944, 0x793ed099
-0,     474000,     474000,        0,    34944, 0xefebd9e8
-0,     480000,     480000,        0,    34944, 0x163c2330
-0,     486000,     486000,        0,    34944, 0x35155672
-0,     492000,     492000,        0,    34944, 0x05474e2e
-0,     498000,     498000,        0,    34944, 0x9433542f
-0,     504000,     504000,        0,    34944, 0x777d5a13
-0,     510000,     510000,        0,    34944, 0x87526776
-0,     516000,     516000,        0,    34944, 0x4c3c72c1
-0,     522000,     522000,        0,    34944, 0x70407b87
-0,     528000,     528000,        0,    34944, 0x2358861d
-0,     534000,     534000,        0,    34944, 0xec61923f
-0,     540000,     540000,        0,    34944, 0x0bb2a0d4
-0,     546000,     546000,        0,    34944, 0x6b6d8624
-0,     552000,     552000,        0,    34944, 0x624761ec
-0,     558000,     558000,        0,    34944, 0xff23b926
-0,     564000,     564000,        0,    34944, 0x07fc7ca5
-0,     570000,     570000,        0,    34944, 0xa8d3ffda
-0,     576000,     576000,        0,    34944, 0xa2d31265
-0,     582000,     582000,        0,    34944, 0x5e58225e
-0,     588000,     588000,        0,    34944, 0x284b2fb0
-0,     594000,     594000,        0,    34944, 0x205b3cb1
-0,     600000,     600000,        0,    34944, 0x3fa64a09
-0,     606000,     606000,        0,    34944, 0xa5de5097
-0,     612000,     612000,        0,    34944, 0x00686cea
-0,     618000,     618000,        0,    34944, 0x465a8282
-0,     624000,     624000,        0,    34944, 0x4ceb8189
-0,     630000,     630000,        0,    34944, 0x14698509
-0,     636000,     636000,        0,    34944, 0x232c830d
-0,     642000,     642000,        0,    34944, 0x0739807c
-0,     648000,     648000,        0,    34944, 0x83b0861e
-0,     654000,     654000,        0,    34944, 0xbdc094b1
-0,     660000,     660000,        0,    34944, 0xc4c0a605
-0,     666000,     666000,        0,    34944, 0x8376b059
-0,     672000,     672000,        0,    34944, 0x2035b939
-0,     678000,     678000,        0,    34944, 0xb6bfc812
-0,     684000,     684000,        0,    34944, 0xc5d4d5c4
-0,     690000,     690000,        0,    34944, 0x492c954e
-0,     696000,     696000,        0,    34944, 0xd23f0dcc
-0,     702000,     702000,        0,    34944, 0x22d7ff6c
-0,     708000,     708000,        0,    34944, 0xd08b4168
-0,     714000,     714000,        0,    34944, 0xa82e4062
-0,     720000,     720000,        0,    34944, 0xcc4f2f31
-0,     726000,     726000,        0,    34944, 0x964b0307
-0,     732000,     732000,        0,    34944, 0xe8130606
-0,     738000,     738000,        0,    34944, 0x5fb744bf
-0,     744000,     744000,        0,    34944, 0x1546a88b
-0,     750000,     750000,        0,    34944, 0xe6e4d94d
-0,     756000,     756000,        0,    34944, 0x8d1ea97e
-0,     762000,     762000,        0,    34944, 0x3bb1fb55
-0,     768000,     768000,        0,    34944, 0x3c37e9cc
-0,     774000,     774000,        0,    34944, 0xe2d22521
-0,     780000,     780000,        0,    34944, 0x7c0ec8cc
-0,     786000,     786000,        0,    34944, 0x7c2dc956
-0,     792000,     792000,        0,    34944, 0x7fe3c263
-0,     798000,     798000,        0,    34944, 0x9a65b813
-0,     804000,     804000,        0,    34944, 0x7ea7cb14
-0,     810000,     810000,        0,    34944, 0x31ded64e
-0,     816000,     816000,        0,    34944, 0x50f30ad1
-0,     822000,     822000,        0,    34944, 0x12eac45c
-0,     828000,     828000,        0,    34944, 0x984b6335
-0,     834000,     834000,        0,    34944, 0x3b9b02f0
-0,     840000,     840000,        0,    34944, 0x4629d2a4
-0,     846000,     846000,        0,    34944, 0x38687e89
-0,     852000,     852000,        0,    34944, 0xb76620fe
-0,     858000,     858000,        0,    34944, 0x66347155
-0,     864000,     864000,        0,    34944, 0x6e6bc297
-0,     870000,     870000,        0,    34944, 0x452a653a
-0,     876000,     876000,        0,    34944, 0x8c8a0683
-0,     882000,     882000,        0,    34944, 0xaf5d7c2d
-0,     888000,     888000,        0,    34944, 0x3064a7e1
-0,     894000,     894000,        0,    34944, 0xc0657fc4
-0,     900000,     900000,        0,    34944, 0x1f129266
-0,     906000,     906000,        0,    34944, 0x35adedfb
-0,     912000,     912000,        0,    34944, 0x40a3db0d
-0,     918000,     918000,        0,    34944, 0x87bebb37
-0,     924000,     924000,        0,    34944, 0x04d7ffed
-0,     930000,     930000,        0,    34944, 0x9bde3180
-0,     936000,     936000,        0,    34944, 0xc35c25bd
-0,     942000,     942000,        0,    34944, 0x820bf4bb
-0,     948000,     948000,        0,    34944, 0x876163ef
-0,     954000,     954000,        0,    34944, 0x3ab6dac0
-0,     960000,     960000,        0,    34944, 0x69a9ef73
-0,     966000,     966000,        0,    34944, 0x0df3813c
-0,     972000,     972000,        0,    34944, 0x1bba0947
-0,     978000,     978000,        0,    34944, 0x0b7883d4
-0,     984000,     984000,        0,    34944, 0xa9972f7e
-0,     990000,     990000,        0,    34944, 0x603d08fe
-0,     996000,     996000,        0,    34944, 0x05f4f111
-0,    1002000,    1002000,        0,    34944, 0xb24fdb42
-0,    1008000,    1008000,        0,    34944, 0xfe2ad344
-0,    1014000,    1014000,        0,    34944, 0xda4bcb8f
-0,    1020000,    1020000,        0,    34944, 0xd28aca6b
-0,    1026000,    1026000,        0,    34944, 0x9486c260
-0,    1032000,    1032000,        0,    34944, 0xad9fc04d
-0,    1038000,    1038000,        0,    34944, 0x9333c0ca
-0,    1044000,    1044000,        0,    34944, 0x96e9c226
-0,    1050000,    1050000,        0,    34944, 0x3e89bd6f
-0,    1056000,    1056000,        0,    34944, 0x7a2dbd32
-0,    1062000,    1062000,        0,    34944, 0xe578ba53
-0,    1068000,    1068000,        0,    34944, 0xb77ebab1
-0,    1074000,    1074000,        0,    34944, 0xd8bfbcb1
-0,    1080000,    1080000,        0,    34944, 0x15d9bc97
-0,    1086000,    1086000,        0,    34944, 0x09c3b9f0
-0,    1092000,    1092000,        0,    34944, 0xd8c8b944
-0,    1098000,    1098000,        0,    34944, 0x2c2fb996
-0,    1104000,    1104000,        0,    34944, 0xd7a8b7e7
-0,    1110000,    1110000,        0,    34944, 0xce34b843
-0,    1116000,    1116000,        0,    34944, 0xba69e9fd
-0,    1122000,    1122000,        0,    34944, 0x1b3f1adc
-0,    1128000,    1128000,        0,    34944, 0x48f515aa
-0,    1134000,    1134000,        0,    34944, 0x864e12bb
-0,    1140000,    1140000,        0,    34944, 0xca571996
-0,    1146000,    1146000,        0,    34944, 0x1d5a1af0
-0,    1152000,    1152000,        0,    34944, 0x3d1e171f
-0,    1158000,    1158000,        0,    34944, 0xb57417ca
-0,    1164000,    1164000,        0,    34944, 0x6e6d1e9d
-0,    1170000,    1170000,        0,    34944, 0xc9971899
-0,    1176000,    1176000,        0,    34944, 0xe0b112c8
-0,    1182000,    1182000,        0,    34944, 0x121b0cd9
-0,    1188000,    1188000,        0,    34944, 0x418e0eff
-0,    1194000,    1194000,        0,    34944, 0x9e1b07d8
-0,    1200000,    1200000,        0,    34944, 0x5590064a
-0,    1206000,    1206000,        0,    34944, 0x7a170b14
-0,    1212000,    1212000,        0,    34944, 0xf25709f0
-0,    1218000,    1218000,        0,    34944, 0x94fa099a
-0,    1224000,    1224000,        0,    34944, 0x081e06ae
-0,    1230000,    1230000,        0,    34944, 0xcfc40417
-0,    1236000,    1236000,        0,    34944, 0xed33096f
-0,    1242000,    1242000,        0,    34944, 0xd73a07e2
-0,    1248000,    1248000,        0,    34944, 0xc512077d
-0,    1254000,    1254000,        0,    34944, 0x27d7021d
-0,    1260000,    1260000,        0,    34944, 0xab59fd20
-0,    1266000,    1266000,        0,    34944, 0xcc2400b7
-0,    1272000,    1272000,        0,    34944, 0xcb3bfb99
-0,    1278000,    1278000,        0,    34944, 0x0974fb1a
-0,    1284000,    1284000,        0,    34944, 0xef79f8ba
-0,    1290000,    1290000,        0,    34944, 0xf932f3a2
-0,    1296000,    1296000,        0,    34944, 0xa32df1bc
-0,    1302000,    1302000,        0,    34944, 0xdbe0f532
-0,    1308000,    1308000,        0,    34944, 0x234cf142
-0,    1314000,    1314000,        0,    34944, 0xe68befd0
-0,    1320000,    1320000,        0,    34944, 0xe4e7ee45
-0,    1326000,    1326000,        0,    34944, 0x0283eff1
-0,    1332000,    1332000,        0,    34944, 0xc8d3f6db
-0,    1338000,    1338000,        0,    34944, 0x0aa6ee88
-0,    1344000,    1344000,        0,    34944, 0xcc3de527
-0,    1350000,    1350000,        0,    34944, 0x9db0ebef
-0,    1356000,    1356000,        0,    34944, 0xa207e9db
-0,    1362000,    1362000,        0,    34944, 0x35b3e74a
-0,    1368000,    1368000,        0,    34944, 0x1988e848
-0,    1374000,    1374000,        0,    34944, 0x727de73c
-0,    1380000,    1380000,        0,    34944, 0x05d5e709
-0,    1386000,    1386000,        0,    34944, 0x3214e4b2
-0,    1392000,    1392000,        0,    34944, 0xed85e0a9
-0,    1398000,    1398000,        0,    34944, 0xf6c9e100
-0,    1404000,    1404000,        0,    34944, 0x57a8dbaf
-0,    1410000,    1410000,        0,    34944, 0xc75fdf41
-0,    1416000,    1416000,        0,    34944, 0x736fde24
-0,    1422000,    1422000,        0,    34944, 0x8d4bde80
-0,    1428000,    1428000,        0,    34944, 0x3220dc86
-0,    1434000,    1434000,        0,    34944, 0xe498da85
-0,    1440000,    1440000,        0,    34944, 0x0655daed
-0,    1446000,    1446000,        0,    34944, 0xb22ad874
-0,    1452000,    1452000,        0,    34944, 0x8198d411
-0,    1458000,    1458000,        0,    34944, 0xd0d2d557
-0,    1464000,    1464000,        0,    34944, 0xd740d1ff
-0,    1470000,    1470000,        0,    34944, 0x2783d00e
-0,    1476000,    1476000,        0,    34944, 0x7abdcd6b
-0,    1482000,    1482000,        0,    34944, 0x2e47d1eb
-0,    1488000,    1488000,        0,    34944, 0xfe1bcf60
-0,    1494000,    1494000,        0,    34944, 0xf0f0d5bb
-0,    1500000,    1500000,        0,    34944, 0x9af7d581
-0,    1506000,    1506000,        0,    34944, 0xb325ca3d
-0,    1512000,    1512000,        0,    34944, 0xd88abfbd
-0,    1518000,    1518000,        0,    34944, 0xf2bab746
-0,    1524000,    1524000,        0,    34944, 0xac44a7dd
-0,    1530000,    1530000,        0,    34944, 0x609e9ea3
-0,    1536000,    1536000,        0,    34944, 0xa39993b9
-0,    1542000,    1542000,        0,    34944, 0x9c948911
-0,    1548000,    1548000,        0,    34944, 0x72f8822d
-0,    1554000,    1554000,        0,    34944, 0x7f3f7a8c
-0,    1560000,    1560000,        0,    34944, 0x7ab475f9
-0,    1566000,    1566000,        0,    34944, 0x536f73aa
-0,    1572000,    1572000,        0,    34944, 0x86cb71e5
-0,    1578000,    1578000,        0,    34944, 0x17157186
-0,    1584000,    1584000,        0,    34944, 0xe33671a4
-0,    1590000,    1590000,        0,    34944, 0xe33671a4
-0,    1596000,    1596000,        0,    34944, 0xe33671a4
-0,    1602000,    1602000,        0,    34944, 0xe33671a4
-0,    1608000,    1608000,        0,    34944, 0xe33671a4
-0,    1614000,    1614000,        0,    34944, 0xe33671a4
-0,    1620000,    1620000,        0,    34944, 0xe33671a4
-0,    1626000,    1626000,        0,    34944, 0xe33671a4
-0,    1632000,    1632000,        0,    34944, 0xe33671a4
-0,    1638000,    1638000,        0,    34944, 0xe33671a4
-0,    1644000,    1644000,        0,    34944, 0xe33671a4
-0,    1650000,    1650000,        0,    34944, 0xe33671a4
-0,    1656000,    1656000,        0,    34944, 0xe33671a4
-0,    1662000,    1662000,        0,    34944, 0xe33671a4
diff --git a/deps/libav/tests/ref/fate/ea-tgv-1 b/deps/libav/tests/ref/fate/ea-tgv-1
deleted file mode 100644
index fc92181..0000000
--- a/deps/libav/tests/ref/fate/ea-tgv-1
+++ /dev/null
@@ -1,48 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,   230400, 0xfbf2581e
-0,          1,          1,        1,   230400, 0xfbf2581e
-0,          2,          2,        1,   230400, 0xfbf2581e
-0,          3,          3,        1,   230400, 0xfbf2581e
-0,          4,          4,        1,   230400, 0xfbf2581e
-0,          5,          5,        1,   230400, 0xfbf2581e
-0,          6,          6,        1,   230400, 0xfbf2581e
-0,          7,          7,        1,   230400, 0xfbf2581e
-0,          8,          8,        1,   230400, 0xfbf2581e
-0,          9,          9,        1,   230400, 0xfbf2581e
-0,         10,         10,        1,   230400, 0xfbf2581e
-0,         11,         11,        1,   230400, 0xfbf2581e
-0,         12,         12,        1,   230400, 0xfbf2581e
-0,         13,         13,        1,   230400, 0xfbf2581e
-0,         14,         14,        1,   230400, 0xfbf2581e
-0,         15,         15,        1,   230400, 0xf5a0a21d
-0,         16,         16,        1,   230400, 0x909cc039
-0,         17,         17,        1,   230400, 0x14d899dd
-0,         18,         18,        1,   230400, 0x0d246edf
-0,         19,         19,        1,   230400, 0x5345fe0d
-0,         20,         20,        1,   230400, 0x5abdff9a
-0,         21,         21,        1,   230400, 0x1730d973
-0,         22,         22,        1,   230400, 0xec881be9
-0,         23,         23,        1,   230400, 0xf4216895
-0,         24,         24,        1,   230400, 0x529d7a52
-0,         25,         25,        1,   230400, 0x93b4c7b9
-0,         26,         26,        1,   230400, 0xedc65bcd
-0,         27,         27,        1,   230400, 0xf0fb54ae
-0,         28,         28,        1,   230400, 0x27864ce9
-0,         29,         29,        1,   230400, 0xcd05012d
-0,         30,         30,        1,   230400, 0x019b6d84
-0,         31,         31,        1,   230400, 0xcc05d416
-0,         32,         32,        1,   230400, 0xb04c0248
-0,         33,         33,        1,   230400, 0x6806eb92
-0,         34,         34,        1,   230400, 0x60e9c001
-0,         35,         35,        1,   230400, 0x9b040261
-0,         36,         36,        1,   230400, 0x6961fb90
-0,         37,         37,        1,   230400, 0xbf67ad24
-0,         38,         38,        1,   230400, 0x2270f328
-0,         39,         39,        1,   230400, 0xd0c345f6
-0,         40,         40,        1,   230400, 0xfd159212
-0,         41,         41,        1,   230400, 0x085578ff
-0,         42,         42,        1,   230400, 0xcca8afa6
-0,         43,         43,        1,   230400, 0x901ec91c
-0,         44,         44,        1,   230400, 0xf1cb99f3
-0,         45,         45,        1,   230400, 0x86d98f0c
-0,         46,         46,        1,   230400, 0x52970700
diff --git a/deps/libav/tests/ref/fate/ea-tgv-2 b/deps/libav/tests/ref/fate/ea-tgv-2
deleted file mode 100644
index 5e9de02..0000000
--- a/deps/libav/tests/ref/fate/ea-tgv-2
+++ /dev/null
@@ -1,39 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,   192000, 0xdfc2f225
-0,          1,          1,        1,   192000, 0x059b57bd
-0,          2,          2,        1,   192000, 0x766cb086
-0,          3,          3,        1,   192000, 0x459e3bac
-0,          4,          4,        1,   192000, 0x5293e622
-0,          5,          5,        1,   192000, 0x898b03f4
-0,          6,          6,        1,   192000, 0xb184a627
-0,          7,          7,        1,   192000, 0xa3fc650a
-0,          8,          8,        1,   192000, 0xea448589
-0,          9,          9,        1,   192000, 0x700e2b76
-0,         10,         10,        1,   192000, 0xa1a1d66d
-0,         11,         11,        1,   192000, 0xd63bc8a1
-0,         12,         12,        1,   192000, 0x5f08c023
-0,         13,         13,        1,   192000, 0x8b75ec3b
-0,         14,         14,        1,   192000, 0x62728ce4
-0,         15,         15,        1,   192000, 0xaa007941
-0,         16,         16,        1,   192000, 0x55dc5b3b
-0,         17,         17,        1,   192000, 0x72d836c2
-0,         18,         18,        1,   192000, 0x1f2de2fc
-0,         19,         19,        1,   192000, 0xb295dfdb
-0,         20,         20,        1,   192000, 0xe5c5f634
-0,         21,         21,        1,   192000, 0x455a0464
-0,         22,         22,        1,   192000, 0x3bf2340d
-0,         23,         23,        1,   192000, 0xe368f0fc
-0,         24,         24,        1,   192000, 0xfa7549c0
-0,         25,         25,        1,   192000, 0x4dd76f3d
-0,         26,         26,        1,   192000, 0x50a49f6c
-0,         27,         27,        1,   192000, 0xb6072f65
-0,         28,         28,        1,   192000, 0x093ce1a8
-0,         29,         29,        1,   192000, 0x55afe3db
-0,         30,         30,        1,   192000, 0x81c3bfab
-0,         31,         31,        1,   192000, 0x583ebd3d
-0,         32,         32,        1,   192000, 0x2504f003
-0,         33,         33,        1,   192000, 0x44ade2af
-0,         34,         34,        1,   192000, 0x77cbcfd8
-0,         35,         35,        1,   192000, 0xac7ddfa1
-0,         36,         36,        1,   192000, 0x79f7cfe8
-0,         37,         37,        1,   192000, 0xdf2898fd
diff --git a/deps/libav/tests/ref/fate/ea-tqi b/deps/libav/tests/ref/fate/ea-tqi
deleted file mode 100644
index ba0073b..0000000
--- a/deps/libav/tests/ref/fate/ea-tqi
+++ /dev/null
@@ -1,27 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,        0,   115200, 0x375ec573
-0,       6000,       6000,        0,   115200, 0x375ec573
-0,      12000,      12000,        0,   115200, 0x375ec573
-0,      18000,      18000,        0,   115200, 0x375ec573
-0,      24000,      24000,        0,   115200, 0x375ec573
-0,      30000,      30000,        0,   115200, 0x375ec573
-0,      36000,      36000,        0,   115200, 0x375ec573
-0,      42000,      42000,        0,   115200, 0x375ec573
-0,      48000,      48000,        0,   115200, 0x0b4d31bf
-0,      54000,      54000,        0,   115200, 0xdd724598
-0,      60000,      60000,        0,   115200, 0xc3077e75
-0,      66000,      66000,        0,   115200, 0xbf70778a
-0,      72000,      72000,        0,   115200, 0x117eb766
-0,      78000,      78000,        0,   115200, 0x4617fbad
-0,      84000,      84000,        0,   115200, 0x5f5b02d2
-0,      90000,      90000,        0,   115200, 0x2a9c5325
-0,      96000,      96000,        0,   115200, 0x14a89e2a
-0,     102000,     102000,        0,   115200, 0xe69aa994
-0,     108000,     108000,        0,   115200, 0xfbacf589
-0,     114000,     114000,        0,   115200, 0x1d714c6e
-0,     120000,     120000,        0,   115200, 0x6eff66cb
-0,     126000,     126000,        0,   115200, 0xee21c1cb
-0,     132000,     132000,        0,   115200, 0xce714ada
-0,     138000,     138000,        0,   115200, 0xf89d56c3
-0,     144000,     144000,        0,   115200, 0x65fd5e60
-0,     150000,     150000,        0,   115200, 0x0c256424
diff --git a/deps/libav/tests/ref/fate/eval b/deps/libav/tests/ref/fate/eval
deleted file mode 100644
index b01e5a5..0000000
--- a/deps/libav/tests/ref/fate/eval
+++ /dev/null
@@ -1,194 +0,0 @@
-Evaluating ''
-'' -> nan
-
-Evaluating '1;2'
-'1;2' -> 2.000000
-
-Evaluating '-20'
-'-20' -> -20.000000
-
-Evaluating '-PI'
-'-PI' -> -3.141593
-
-Evaluating '+PI'
-'+PI' -> 3.141593
-
-Evaluating '1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)'
-'1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)' -> 12.700000
-
-Evaluating '80G/80Gi'
-'80G/80Gi' -> 0.931323
-
-Evaluating '1k'
-'1k' -> 1000.000000
-
-Evaluating '1Gi'
-'1Gi' -> 1073741824.000000
-
-Evaluating '1gi'
-'1gi' -> nan
-
-Evaluating '1GiFoo'
-'1GiFoo' -> nan
-
-Evaluating '1k+1k'
-'1k+1k' -> 2000.000000
-
-Evaluating '1Gi*3foo'
-'1Gi*3foo' -> nan
-
-Evaluating 'foo'
-'foo' -> nan
-
-Evaluating 'foo('
-'foo(' -> nan
-
-Evaluating 'foo()'
-'foo()' -> nan
-
-Evaluating 'foo)'
-'foo)' -> nan
-
-Evaluating 'sin'
-'sin' -> nan
-
-Evaluating 'sin('
-'sin(' -> nan
-
-Evaluating 'sin()'
-'sin()' -> nan
-
-Evaluating 'sin)'
-'sin)' -> nan
-
-Evaluating 'sin 10'
-'sin 10' -> nan
-
-Evaluating 'sin(1,2,3)'
-'sin(1,2,3)' -> nan
-
-Evaluating 'sin(1 )'
-'sin(1 )' -> 0.841471
-
-Evaluating '1'
-'1' -> 1.000000
-
-Evaluating '1foo'
-'1foo' -> nan
-
-Evaluating 'bar + PI + E + 100f*2 + foo'
-'bar + PI + E + 100f*2 + foo' -> nan
-
-Evaluating '13k + 12f - foo(1, 2)'
-'13k + 12f - foo(1, 2)' -> nan
-
-Evaluating '1gi'
-'1gi' -> nan
-
-Evaluating '1Gi'
-'1Gi' -> 1073741824.000000
-
-Evaluating 'st(0, 123)'
-'st(0, 123)' -> 123.000000
-
-Evaluating 'st(1, 123); ld(1)'
-'st(1, 123); ld(1)' -> 123.000000
-
-Evaluating 'lte(0, 1)'
-'lte(0, 1)' -> 1.000000
-
-Evaluating 'lte(1, 1)'
-'lte(1, 1)' -> 1.000000
-
-Evaluating 'lte(1, 0)'
-'lte(1, 0)' -> 0.000000
-
-Evaluating 'lt(0, 1)'
-'lt(0, 1)' -> 1.000000
-
-Evaluating 'lt(1, 1)'
-'lt(1, 1)' -> 0.000000
-
-Evaluating 'gt(1, 0)'
-'gt(1, 0)' -> 1.000000
-
-Evaluating 'gt(2, 7)'
-'gt(2, 7)' -> 0.000000
-
-Evaluating 'gte(122, 122)'
-'gte(122, 122)' -> 1.000000
-
-Evaluating 'st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)'
-'st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)' -> 5050.000000
-
-Evaluating 'st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)'
-'st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)' -> 233.000000
-
-Evaluating 'while(0, 10)'
-'while(0, 10)' -> nan
-
-Evaluating 'st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))'
-'st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))' -> 101.000000
-
-Evaluating 'isnan(1)'
-'isnan(1)' -> 0.000000
-
-Evaluating 'isnan(NAN)'
-'isnan(NAN)' -> 1.000000
-
-Evaluating 'isnan(INF)'
-'isnan(INF)' -> 0.000000
-
-Evaluating 'isinf(1)'
-'isinf(1)' -> 0.000000
-
-Evaluating 'isinf(NAN)'
-'isinf(NAN)' -> 0.000000
-
-Evaluating 'isinf(INF)'
-'isinf(INF)' -> 1.000000
-
-Evaluating 'floor(NAN)'
-'floor(NAN)' -> nan
-
-Evaluating 'floor(123.123)'
-'floor(123.123)' -> 123.000000
-
-Evaluating 'floor(-123.123)'
-'floor(-123.123)' -> -124.000000
-
-Evaluating 'trunc(123.123)'
-'trunc(123.123)' -> 123.000000
-
-Evaluating 'trunc(-123.123)'
-'trunc(-123.123)' -> -123.000000
-
-Evaluating 'ceil(123.123)'
-'ceil(123.123)' -> 124.000000
-
-Evaluating 'ceil(-123.123)'
-'ceil(-123.123)' -> -123.000000
-
-Evaluating 'sqrt(1764)'
-'sqrt(1764)' -> 42.000000
-
-Evaluating 'isnan(sqrt(-1))'
-'isnan(sqrt(-1))' -> 1.000000
-
-Evaluating 'not(1)'
-'not(1)' -> 0.000000
-
-Evaluating 'not(NAN)'
-'not(NAN)' -> 0.000000
-
-Evaluating 'not(0)'
-'not(0)' -> 1.000000
-
-Evaluating '6.0206dB'
-'6.0206dB' -> 2.000000
-
-Evaluating '-3.0103dB'
-'-3.0103dB' -> 0.707107
-
-12.700000 == 12.7
-0.931323 == 0.931322575
diff --git a/deps/libav/tests/ref/fate/fifo b/deps/libav/tests/ref/fate/fifo
deleted file mode 100644
index 18a5691..0000000
--- a/deps/libav/tests/ref/fate/fifo
+++ /dev/null
@@ -1,27 +0,0 @@
--12: 1
--11: 2
--10: 3
--9: 4
--8: 5
--7: 6
--6: 7
--5: 8
--4: 9
--3: 10
--2: 11
--1: 12
-0: 0
-1: 1
-2: 2
-3: 3
-4: 4
-5: 5
-6: 6
-7: 7
-8: 8
-9: 9
-10: 10
-11: 11
-12: 12
-
-0 1 2 3 4 5 6 7 8 9 10 11 12
diff --git a/deps/libav/tests/ref/fate/film-cvid b/deps/libav/tests/ref/fate/film-cvid
deleted file mode 100644
index 12b1f1c..0000000
--- a/deps/libav/tests/ref/fate/film-cvid
+++ /dev/null
@@ -1,111 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   107520, 0xa6c9fdd2
-0,          2,          2,        1,   107520, 0x61eb28c1
-0,          4,          4,        1,   107520, 0x45e20af7
-0,          6,          6,        1,   107520, 0x366970fc
-0,          8,          8,        1,   107520, 0xa392bcb3
-0,         10,         10,        1,   107520, 0xcf7bac98
-0,         12,         12,        1,   107520, 0x222eba53
-0,         14,         14,        1,   107520, 0x74e255a1
-0,         16,         16,        1,   107520, 0xc19eec6f
-0,         18,         18,        1,   107520, 0xa3880681
-0,         20,         20,        1,   107520, 0x957878db
-0,         22,         22,        1,   107520, 0x18340692
-0,         24,         24,        1,   107520, 0x9970f24d
-0,         26,         26,        1,   107520, 0xf08618aa
-0,         28,         28,        1,   107520, 0xee7324f0
-0,         30,         30,        1,   107520, 0xe15025b3
-0,         32,         32,        1,   107520, 0x8afa312e
-0,         34,         34,        1,   107520, 0x717a7d0f
-0,         36,         36,        1,   107520, 0x355c6e23
-0,         38,         38,        1,   107520, 0x7015a50f
-0,         40,         40,        1,   107520, 0xcdfc1a16
-0,         42,         42,        1,   107520, 0x38d929e7
-0,         44,         44,        1,   107520, 0x52913423
-0,         46,         46,        1,   107520, 0xe2c91c10
-0,         48,         48,        1,   107520, 0x85516e9c
-0,         50,         50,        1,   107520, 0xd1626030
-0,         52,         52,        1,   107520, 0xea7b16de
-0,         54,         54,        1,   107520, 0xa33eaa0d
-0,         56,         56,        1,   107520, 0x8e3be6a6
-0,         58,         58,        1,   107520, 0x14147bd6
-0,         60,         60,        1,   107520, 0x07d54bec
-0,         62,         62,        1,   107520, 0xe287a0a7
-0,         64,         64,        1,   107520, 0xc023a14d
-0,         66,         66,        1,   107520, 0x2437085d
-0,         68,         68,        1,   107520, 0x63823918
-0,         70,         70,        1,   107520, 0xbc17e198
-0,         72,         72,        1,   107520, 0x9d99bc81
-0,         74,         74,        1,   107520, 0x7e4ec71e
-0,         76,         76,        1,   107520, 0x55b98376
-0,         78,         78,        1,   107520, 0x356d8e9e
-0,         80,         80,        1,   107520, 0xf77e8a61
-0,         82,         82,        1,   107520, 0x5ae7c8c7
-0,         84,         84,        1,   107520, 0x8acf9322
-0,         86,         86,        1,   107520, 0x40a9177e
-0,         88,         88,        1,   107520, 0x3e0e4d8d
-0,         90,         90,        1,   107520, 0xd268865b
-0,         92,         92,        1,   107520, 0x89a4efeb
-0,         94,         94,        1,   107520, 0x70ca2478
-0,         96,         96,        1,   107520, 0xcc9ec981
-0,         98,         98,        1,   107520, 0xf0648459
-0,        100,        100,        1,   107520, 0x7e4a4cca
-0,        102,        102,        1,   107520, 0xb315dc65
-0,        104,        104,        1,   107520, 0x2aecc7b4
-0,        106,        106,        1,   107520, 0x81742f51
-0,        108,        108,        1,   107520, 0x3a1d7571
-0,        110,        110,        1,   107520, 0x3a1d7571
-0,        112,        112,        1,   107520, 0x3a1d7571
-0,        114,        114,        1,   107520, 0x3a1d7571
-0,        116,        116,        1,   107520, 0x3a1d7571
-0,        118,        118,        1,   107520, 0x3a1d7571
-0,        120,        120,        1,   107520, 0x3a1d7571
-0,        122,        122,        1,   107520, 0xe974733e
-0,        124,        124,        1,   107520, 0x999c6fbf
-0,        126,        126,        1,   107520, 0x26b56b6e
-0,        128,        128,        1,   107520, 0xc9f9647b
-0,        130,        130,        1,   107520, 0x6d025d00
-0,        132,        132,        1,   107520, 0xf9c056c1
-0,        134,        134,        1,   107520, 0xa5cc4d0b
-0,        136,        136,        1,   107520, 0x1a4c4236
-0,        138,        138,        1,   107520, 0xa9d538b6
-0,        140,        140,        1,   107520, 0x14682d00
-0,        142,        142,        1,   107520, 0x6236204f
-0,        144,        144,        1,   107520, 0x303e14aa
-0,        146,        146,        1,   107520, 0x943b0837
-0,        148,        148,        1,   107520, 0xfce5fd07
-0,        150,        150,        1,   107520, 0xd993f193
-0,        152,        152,        1,   107520, 0x4d48e7b4
-0,        154,        154,        1,   107520, 0x61ccdf83
-0,        156,        156,        1,   107520, 0xfb4fd608
-0,        158,        158,        1,   107520, 0x5efdcdb3
-0,        160,        160,        1,   107520, 0xb03ec886
-0,        162,        162,        1,   107520, 0xf464c343
-0,        164,        164,        1,   107520, 0xf464c343
-0,        166,        166,        1,   107520, 0xf464c343
-0,        168,        168,        1,   107520, 0xf464c343
-0,        170,        170,        1,   107520, 0xf464c343
-0,        172,        172,        1,   107520, 0xf464c343
-0,        174,        174,        1,   107520, 0xf464c343
-0,        176,        176,        1,   107520, 0xf464c343
-0,        178,        178,        1,   107520, 0xf464c343
-0,        180,        180,        1,   107520, 0xf464c343
-0,        182,        182,        1,   107520, 0xf464c343
-0,        184,        184,        1,   107520, 0xf2b2c712
-0,        186,        186,        1,   107520, 0xf2b2c712
-0,        188,        188,        1,   107520, 0xf2b2c712
-0,        190,        190,        1,   107520, 0xf2b2c712
-0,        192,        192,        1,   107520, 0xb95e6bc8
-0,        194,        194,        1,   107520, 0x33feee37
-0,        196,        196,        1,   107520, 0x36ee3cd5
-0,        198,        198,        1,   107520, 0x59096471
-0,        200,        200,        1,   107520, 0x53b470c6
-0,        202,        202,        1,   107520, 0xdb7c64ff
-0,        204,        204,        1,   107520, 0xe5a1596a
-0,        206,        206,        1,   107520, 0x8c8942eb
-0,        208,        208,        1,   107520, 0x5ecc379e
-0,        210,        210,        1,   107520, 0xea09432a
-0,        212,        212,        1,   107520, 0xe01e6b73
-0,        214,        214,        1,   107520, 0x1d13bba8
-0,        216,        216,        1,   107520, 0x3a993a6c
-0,        218,        218,        1,   107520, 0x2ede041a
diff --git a/deps/libav/tests/ref/fate/filter-atrim-duration b/deps/libav/tests/ref/fate/filter-atrim-duration
deleted file mode 100644
index a51dff7..0000000
--- a/deps/libav/tests/ref/fate/filter-atrim-duration
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/44100
-0,       4410,       4410,      441,     1764, 0x61e374f7
diff --git a/deps/libav/tests/ref/fate/filter-atrim-mixed b/deps/libav/tests/ref/fate/filter-atrim-mixed
deleted file mode 100644
index ae3281a..0000000
--- a/deps/libav/tests/ref/fate/filter-atrim-mixed
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1/44100
-0,       1025,       1025,     1023,     4092, 0x78560a4c
-0,       2048,       2048,     1024,     4096, 0xc477fa99
-0,       3072,       3072,     1024,     4096, 0x3bc0f14f
-0,       4096,       4096,      315,     1260, 0xe4b26b50
diff --git a/deps/libav/tests/ref/fate/filter-atrim-samples b/deps/libav/tests/ref/fate/filter-atrim-samples
deleted file mode 100644
index 3461666..0000000
--- a/deps/libav/tests/ref/fate/filter-atrim-samples
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/44100
-0,         26,         26,       54,      216, 0x6b376c6c
diff --git a/deps/libav/tests/ref/fate/filter-atrim-time b/deps/libav/tests/ref/fate/filter-atrim-time
deleted file mode 100644
index a368210..0000000
--- a/deps/libav/tests/ref/fate/filter-atrim-time
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1/44100
-0,       4410,       4410,      710,     2840, 0x658982a3
-0,       5120,       5120,     1024,     4096, 0xfd6a0070
-0,       6144,       6144,     1024,     4096, 0x0b01f4cf
-0,       7168,       7168,     1024,     4096, 0x6716fd93
-0,       8192,       8192,      628,     2512, 0xda5ddff8
diff --git a/deps/libav/tests/ref/fate/filter-boxblur b/deps/libav/tests/ref/fate/filter-boxblur
deleted file mode 100644
index acb2beb..0000000
--- a/deps/libav/tests/ref/fate/filter-boxblur
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x113489f8
-0,          1,          1,        1,   152064, 0x650a64ca
-0,          2,          2,        1,   152064, 0x29ecf6b1
-0,          3,          3,        1,   152064, 0x5cb98169
-0,          4,          4,        1,   152064, 0x4f46b6d7
-0,          5,          5,        1,   152064, 0x793ba919
-0,          6,          6,        1,   152064, 0x6caf7c14
-0,          7,          7,        1,   152064, 0xca638b2e
-0,          8,          8,        1,   152064, 0xf6df803d
-0,          9,          9,        1,   152064, 0x907b386f
-0,         10,         10,        1,   152064, 0xbb8d47f9
-0,         11,         11,        1,   152064, 0x17befd28
-0,         12,         12,        1,   152064, 0xf29eae1e
-0,         13,         13,        1,   152064, 0xb08ba1e6
-0,         14,         14,        1,   152064, 0x39948df7
-0,         15,         15,        1,   152064, 0x841d0e7e
-0,         16,         16,        1,   152064, 0x21d64dd6
-0,         17,         17,        1,   152064, 0x18af38e9
-0,         18,         18,        1,   152064, 0x1f946a26
-0,         19,         19,        1,   152064, 0x0d9cdc4e
-0,         20,         20,        1,   152064, 0xaf2af54d
-0,         21,         21,        1,   152064, 0x09e724e1
-0,         22,         22,        1,   152064, 0xff7d1e4b
-0,         23,         23,        1,   152064, 0xd49d68ad
-0,         24,         24,        1,   152064, 0x7ea4f96b
-0,         25,         25,        1,   152064, 0xd2f698b9
-0,         26,         26,        1,   152064, 0xc2a696ac
-0,         27,         27,        1,   152064, 0x1e8ed7b4
-0,         28,         28,        1,   152064, 0x980ba498
-0,         29,         29,        1,   152064, 0x47c364f2
-0,         30,         30,        1,   152064, 0x1a196ada
-0,         31,         31,        1,   152064, 0x4847c564
-0,         32,         32,        1,   152064, 0xa959fc15
-0,         33,         33,        1,   152064, 0x7d1a79d3
-0,         34,         34,        1,   152064, 0xae7e438d
-0,         35,         35,        1,   152064, 0xc32794b4
-0,         36,         36,        1,   152064, 0x6ef43744
-0,         37,         37,        1,   152064, 0xa06a01d0
-0,         38,         38,        1,   152064, 0xc94b5847
-0,         39,         39,        1,   152064, 0xb7514f04
-0,         40,         40,        1,   152064, 0xf0c959e8
-0,         41,         41,        1,   152064, 0xe6439e5e
-0,         42,         42,        1,   152064, 0xd347bf8d
-0,         43,         43,        1,   152064, 0x40822107
-0,         44,         44,        1,   152064, 0xe0ad044a
-0,         45,         45,        1,   152064, 0x05f77e73
-0,         46,         46,        1,   152064, 0xbeaa536d
-0,         47,         47,        1,   152064, 0xb0edc576
-0,         48,         48,        1,   152064, 0x35fcb4fa
-0,         49,         49,        1,   152064, 0x8d9ad8fa
diff --git a/deps/libav/tests/ref/fate/filter-crop b/deps/libav/tests/ref/fate/filter-crop
deleted file mode 100644
index 32041c2..0000000
--- a/deps/libav/tests/ref/fate/filter-crop
+++ /dev/null
@@ -1 +0,0 @@
-crop                3d163f156eaddf41d2be20736f973539
diff --git a/deps/libav/tests/ref/fate/filter-crop_scale b/deps/libav/tests/ref/fate/filter-crop_scale
deleted file mode 100644
index 82e5394..0000000
--- a/deps/libav/tests/ref/fate/filter-crop_scale
+++ /dev/null
@@ -1 +0,0 @@
-crop_scale          0a3d45d58b805b8c47416b9239535f94
diff --git a/deps/libav/tests/ref/fate/filter-crop_scale_vflip b/deps/libav/tests/ref/fate/filter-crop_scale_vflip
deleted file mode 100644
index 29574f7..0000000
--- a/deps/libav/tests/ref/fate/filter-crop_scale_vflip
+++ /dev/null
@@ -1 +0,0 @@
-crop_scale_vflip    3e2c7694d37733ca52e1723d5262af36
diff --git a/deps/libav/tests/ref/fate/filter-crop_vflip b/deps/libav/tests/ref/fate/filter-crop_vflip
deleted file mode 100644
index a3f8200..0000000
--- a/deps/libav/tests/ref/fate/filter-crop_vflip
+++ /dev/null
@@ -1 +0,0 @@
-crop_vflip          628542e17b6900ee79b1429183ae01b0
diff --git a/deps/libav/tests/ref/fate/filter-delogo b/deps/libav/tests/ref/fate/filter-delogo
deleted file mode 100644
index 1a1f497..0000000
--- a/deps/libav/tests/ref/fate/filter-delogo
+++ /dev/null
@@ -1,110 +0,0 @@
-#tb 0: 1/1000
-0,          1,          1,        0,   126720, 0x689de87e
-0,         33,         33,        0,   126720, 0x3db9e91c
-0,         66,         66,        0,   126720, 0x3db9e91c
-0,        100,        100,        0,   126720, 0x3db9e91c
-0,        133,        133,        0,   126720, 0xfa6ae95e
-0,        166,        166,        0,   126720, 0x5bcbf0e6
-0,        200,        200,        0,   126720, 0x94a0f126
-0,        233,        233,        0,   126720, 0x0250f106
-0,        266,        266,        0,   126720, 0xcf6ab4bc
-0,        300,        300,        0,   126720, 0x429eb57c
-0,        333,        333,        0,   126720, 0x3bf0b5bc
-0,        367,        367,        0,   126720, 0xcaedb591
-0,        400,        400,        0,   126720, 0xa492b5ec
-0,        433,        433,        0,   126720, 0x2431b85c
-0,        467,        467,        0,   126720, 0x8283b8dc
-0,        500,        500,        0,   126720, 0xd71bb871
-0,        533,        533,        0,   126720, 0x698eb5cc
-0,        567,        567,        0,   126720, 0x4719aa98
-0,        600,        600,        0,   126720, 0x9ca1962c
-0,        633,        633,        0,   126720, 0x18cda460
-0,        667,        667,        0,   126720, 0xc230b716
-0,        700,        700,        0,   126720, 0x8451a4e2
-0,        734,        734,        0,   126720, 0x59e9a7ea
-0,        767,        767,        0,   126720, 0xc77ca73d
-0,        800,        800,        0,   126720, 0x725fb976
-0,        834,        834,        0,   126720, 0xb30da3b3
-0,        867,        867,        0,   126720, 0x7af2ea86
-0,        900,        900,        0,   126720, 0x40d4b4eb
-0,        934,        934,        0,   126720, 0x49d00307
-0,        967,        967,        0,   126720, 0x0654849c
-0,       1000,       1000,        0,   126720, 0xe46d0107
-0,       1034,       1034,        0,   126720, 0xa483b963
-0,       1067,       1067,        0,   126720, 0xd0e903f0
-0,       1101,       1101,        0,   126720, 0x964ed592
-0,       1134,       1134,        0,   126720, 0x23fbdb3c
-0,       1167,       1167,        0,   126720, 0x59fdace5
-0,       1201,       1201,        0,   126720, 0xb1e37954
-0,       1234,       1234,        0,   126720, 0x8ed9c554
-0,       1267,       1267,        0,   126720, 0xe3c4b39f
-0,       1301,       1301,        0,   126720, 0xfd17e0ce
-0,       1334,       1334,        0,   126720, 0xf26e1dcc
-0,       1368,       1368,        0,   126720, 0x13cc783c
-0,       1401,       1401,        0,   126720, 0x47ad47a1
-0,       1434,       1434,        0,   126720, 0x427c8b0d
-0,       1468,       1468,        0,   126720, 0x59d99901
-0,       1501,       1501,        0,   126720, 0xc40707da
-0,       1534,       1534,        0,   126720, 0xcd060dce
-0,       1568,       1568,        0,   126720, 0xed4024f6
-0,       1601,       1601,        0,   126720, 0x7decd2b4
-0,       1634,       1634,        0,   126720, 0xd1d2e730
-0,       1668,       1668,        0,   126720, 0x77cee457
-0,       1701,       1701,        0,   126720, 0xe78d02c0
-0,       1735,       1735,        0,   126720, 0xad0beb29
-0,       1768,       1768,        0,   126720, 0xc414eea2
-0,       1801,       1801,        0,   126720, 0x6a15f17d
-0,       1835,       1835,        0,   126720, 0x516027f6
-0,       1868,       1868,        0,   126720, 0x4eda9dce
-0,       1901,       1901,        0,   126720, 0x7d9bdba3
-0,       1935,       1935,        0,   126720, 0x7aa3d5c0
-0,       1968,       1968,        0,   126720, 0x7c7a04f9
-0,       2001,       2001,        0,   126720, 0x3e8fb6cc
-0,       2035,       2035,        0,   126720, 0xd5474916
-0,       2068,       2068,        0,   126720, 0xf3f62bab
-0,       2102,       2102,        0,   126720, 0x2f054987
-0,       2135,       2135,        0,   126720, 0x974c2e81
-0,       2168,       2168,        0,   126720, 0xe7e28a97
-0,       2202,       2202,        0,   126720, 0x45e38b41
-0,       2235,       2235,        0,   126720, 0x169c7f19
-0,       2268,       2268,        0,   126720, 0x91d90ee8
-0,       2302,       2302,        0,   126720, 0xdd653e24
-0,       2335,       2335,        0,   126720, 0x0da598c4
-0,       2369,       2369,        0,   126720, 0x687e62cc
-0,       2402,       2402,        0,   126720, 0x7631232d
-0,       2435,       2435,        0,   126720, 0xbd1ea826
-0,       2469,       2469,        0,   126720, 0xb55f7f4b
-0,       2502,       2502,        0,   126720, 0x923f3fc9
-0,       2535,       2535,        0,   126720, 0x15515301
-0,       2569,       2569,        0,   126720, 0x9ee066e5
-0,       2602,       2602,        0,   126720, 0x7c21664b
-0,       2635,       2635,        0,   126720, 0x36849100
-0,       2669,       2669,        0,   126720, 0x08b1f61a
-0,       2702,       2702,        0,   126720, 0x5bfca6e2
-0,       2736,       2736,        0,   126720, 0x929f60e3
-0,       2769,       2769,        0,   126720, 0xa2b55c29
-0,       2802,       2802,        0,   126720, 0x68bd3ff3
-0,       2836,       2836,        0,   126720, 0x30db5b29
-0,       2869,       2869,        0,   126720, 0x00578f9b
-0,       2902,       2902,        0,   126720, 0x18368642
-0,       2936,       2936,        0,   126720, 0xbcb83a80
-0,       2969,       2969,        0,   126720, 0x90f36b72
-0,       3002,       3002,        0,   126720, 0x85e46522
-0,       3036,       3036,        0,   126720, 0x2429660a
-0,       3069,       3069,        0,   126720, 0xf283dfe2
-0,       3103,       3103,        0,   126720, 0x896b27dc
-0,       3136,       3136,        0,   126720, 0x5af4f961
-0,       3169,       3169,        0,   126720, 0x31897085
-0,       3203,       3203,        0,   126720, 0x441ce33e
-0,       3236,       3236,        0,   126720, 0x903f8009
-0,       3269,       3269,        0,   126720, 0xbdf33dba
-0,       3303,       3303,        0,   126720, 0x8a364f36
-0,       3336,       3336,        0,   126720, 0xda5513f6
-0,       3370,       3370,        0,   126720, 0xd60012b3
-0,       3403,       3403,        0,   126720, 0x67bce7be
-0,       3436,       3436,        0,   126720, 0x697e6174
-0,       3470,       3470,        0,   126720, 0xbe3e3e90
-0,       3503,       3503,        0,   126720, 0xf3e4bba6
-0,       3536,       3536,        0,   126720, 0x8124a679
-0,       3570,       3570,        0,   126720, 0x58d1acde
-0,       3603,       3603,        0,   126720, 0xd8a15ba3
diff --git a/deps/libav/tests/ref/fate/filter-drawbox b/deps/libav/tests/ref/fate/filter-drawbox
deleted file mode 100644
index 869b9f3..0000000
--- a/deps/libav/tests/ref/fate/filter-drawbox
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x7eee5ca3
-0,          1,          1,        1,   152064, 0x61125759
-0,          2,          2,        1,   152064, 0x2a64f47f
-0,          3,          3,        1,   152064, 0xc1089594
-0,          4,          4,        1,   152064, 0xd9e18830
-0,          5,          5,        1,   152064, 0xeb135e03
-0,          6,          6,        1,   152064, 0x6a5b40d7
-0,          7,          7,        1,   152064, 0x0a356a16
-0,          8,          8,        1,   152064, 0xfc1d7858
-0,          9,          9,        1,   152064, 0xa04bfeb8
-0,         10,         10,        1,   152064, 0x2d952ef0
-0,         11,         11,        1,   152064, 0x7f360233
-0,         12,         12,        1,   152064, 0xdd2bd142
-0,         13,         13,        1,   152064, 0xd231ad4a
-0,         14,         14,        1,   152064, 0x0543400e
-0,         15,         15,        1,   152064, 0x8252be2b
-0,         16,         16,        1,   152064, 0xd9f702be
-0,         17,         17,        1,   152064, 0xed5cf787
-0,         18,         18,        1,   152064, 0xf9472f8e
-0,         19,         19,        1,   152064, 0x89e4a60b
-0,         20,         20,        1,   152064, 0x1f12c1f5
-0,         21,         21,        1,   152064, 0x76eaf390
-0,         22,         22,        1,   152064, 0x60b5eba3
-0,         23,         23,        1,   152064, 0xf09e348c
-0,         24,         24,        1,   152064, 0x1afabf8a
-0,         25,         25,        1,   152064, 0xd16c558e
-0,         26,         26,        1,   152064, 0x78634796
-0,         27,         27,        1,   152064, 0xcd13b1e3
-0,         28,         28,        1,   152064, 0x59c2c6e5
-0,         29,         29,        1,   152064, 0x265e6beb
-0,         30,         30,        1,   152064, 0x82c656af
-0,         31,         31,        1,   152064, 0x919e923c
-0,         32,         32,        1,   152064, 0xc428fc15
-0,         33,         33,        1,   152064, 0x488760cd
-0,         34,         34,        1,   152064, 0x0a080c93
-0,         35,         35,        1,   152064, 0xaab649e6
-0,         36,         36,        1,   152064, 0x9b34edaa
-0,         37,         37,        1,   152064, 0x44e12816
-0,         38,         38,        1,   152064, 0x03777927
-0,         39,         39,        1,   152064, 0x6644573e
-0,         40,         40,        1,   152064, 0x18574df7
-0,         41,         41,        1,   152064, 0x5dce82f6
-0,         42,         42,        1,   152064, 0xb8be9205
-0,         43,         43,        1,   152064, 0xb927eacb
-0,         44,         44,        1,   152064, 0x303ec874
-0,         45,         45,        1,   152064, 0x05eb3c6f
-0,         46,         46,        1,   152064, 0x74a614d6
-0,         47,         47,        1,   152064, 0x6d078969
-0,         48,         48,        1,   152064, 0xe57a7ae0
-0,         49,         49,        1,   152064, 0xd6fca9ec
diff --git a/deps/libav/tests/ref/fate/filter-fade b/deps/libav/tests/ref/fate/filter-fade
deleted file mode 100644
index 131b614..0000000
--- a/deps/libav/tests/ref/fate/filter-fade
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xeb8105cd
-0,          1,          1,        1,   152064, 0x0bc0a27d
-0,          2,          2,        1,   152064, 0x9dcd3a04
-0,          3,          3,        1,   152064, 0xecd9e8ec
-0,          4,          4,        1,   152064, 0xdcc09bca
-0,          5,          5,        1,   152064, 0xbf1537ad
-0,          6,          6,        1,   152064, 0xf32214db
-0,          7,          7,        1,   152064, 0x9584ce5e
-0,          8,          8,        1,   152064, 0xbaa930e7
-0,          9,          9,        1,   152064, 0xce411a6c
-0,         10,         10,        1,   152064, 0xdbc2c004
-0,         11,         11,        1,   152064, 0x635a55df
-0,         12,         12,        1,   152064, 0x49d5807f
-0,         13,         13,        1,   152064, 0xd18734a6
-0,         14,         14,        1,   152064, 0xf9d3581f
-0,         15,         15,        1,   152064, 0x423dbdf7
-0,         16,         16,        1,   152064, 0x0c52a4a2
-0,         17,         17,        1,   152064, 0xf7a6a90e
-0,         18,         18,        1,   152064, 0x472441c2
-0,         19,         19,        1,   152064, 0x9470c09a
-0,         20,         20,        1,   152064, 0xce7da1a3
-0,         21,         21,        1,   152064, 0xdb01a0c9
-0,         22,         22,        1,   152064, 0x052e74cb
-0,         23,         23,        1,   152064, 0xab0eab85
-0,         24,         24,        1,   152064, 0x069c1d15
-0,         25,         25,        1,   152064, 0x95579936
-0,         26,         26,        1,   152064, 0x292dc6d4
-0,         27,         27,        1,   152064, 0x951d382d
-0,         28,         28,        1,   152064, 0x9ce23e7d
-0,         29,         29,        1,   152064, 0x5ceb17dd
-0,         30,         30,        1,   152064, 0xe0835003
-0,         31,         31,        1,   152064, 0x7b8a03ba
-0,         32,         32,        1,   152064, 0x1531b18c
-0,         33,         33,        1,   152064, 0xa4a2ee9a
-0,         34,         34,        1,   152064, 0xa5b0e442
-0,         35,         35,        1,   152064, 0x47e0554d
-0,         36,         36,        1,   152064, 0x9443792e
-0,         37,         37,        1,   152064, 0x1a3316ce
-0,         38,         38,        1,   152064, 0xbe8088d7
-0,         39,         39,        1,   152064, 0xd3013824
-0,         40,         40,        1,   152064, 0x342f2f5d
-0,         41,         41,        1,   152064, 0x638a816f
-0,         42,         42,        1,   152064, 0x0cf11a0f
-0,         43,         43,        1,   152064, 0xc4d87159
-0,         44,         44,        1,   152064, 0xa5c36b72
-0,         45,         45,        1,   152064, 0x17a9970d
-0,         46,         46,        1,   152064, 0x5479e51c
-0,         47,         47,        1,   152064, 0x2ae4382a
-0,         48,         48,        1,   152064, 0xab7097a6
-0,         49,         49,        1,   152064, 0xbc97d4bb
diff --git a/deps/libav/tests/ref/fate/filter-fieldorder b/deps/libav/tests/ref/fate/filter-fieldorder
deleted file mode 100644
index 6bb647a..0000000
--- a/deps/libav/tests/ref/fate/filter-fieldorder
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 2/25
-0,          0,          0,        1,   202752, 0x789424b6
-0,          1,          1,        1,   202752, 0x7a1f47a9
-0,          2,          2,        1,   202752, 0xa55a9aba
-0,          3,          3,        1,   202752, 0x71aa394c
-0,          4,          4,        1,   202752, 0xa5d9d0a7
-0,          5,          5,        1,   202752, 0x192d92ff
-0,          6,          6,        1,   202752, 0xa66d9bdd
-0,          7,          7,        1,   202752, 0x29a256bf
-0,          8,          8,        1,   202752, 0x75910eed
-0,          9,          9,        1,   202752, 0x99de19d7
-0,         10,         10,        1,   202752, 0x3a5a16e4
-0,         11,         11,        1,   202752, 0x262ce461
-0,         12,         12,        1,   202752, 0x08da338f
-0,         13,         13,        1,   202752, 0xfb515dbe
-0,         14,         14,        1,   202752, 0x984a8697
-0,         15,         15,        1,   202752, 0xbbd58420
-0,         16,         16,        1,   202752, 0xdd7e560b
-0,         17,         17,        1,   202752, 0x49b94d23
-0,         18,         18,        1,   202752, 0xb679bec7
-0,         19,         19,        1,   202752, 0xe6cffad0
-0,         20,         20,        1,   202752, 0x29a65535
-0,         21,         21,        1,   202752, 0x32851117
-0,         22,         22,        1,   202752, 0x35feb7d1
-0,         23,         23,        1,   202752, 0x96ad33b0
-0,         24,         24,        1,   202752, 0x7ec60b7d
diff --git a/deps/libav/tests/ref/fate/filter-framepack-columns b/deps/libav/tests/ref/fate/filter-framepack-columns
deleted file mode 100644
index f387632..0000000
--- a/deps/libav/tests/ref/fate/filter-framepack-columns
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   304128, 0x8cde13ed
-0,          1,          1,        1,   304128, 0xc97fcaa2
-0,          2,          2,        1,   304128, 0x8139eca3
-0,          3,          3,        1,   304128, 0x295c016f
-0,          4,          4,        1,   304128, 0x813a6cb3
-0,          5,          5,        1,   304128, 0x0e1b51db
-0,          6,          6,        1,   304128, 0x0c46f846
-0,          7,          7,        1,   304128, 0xdf281767
-0,          8,          8,        1,   304128, 0xfc37005b
-0,          9,          9,        1,   304128, 0x0be5722a
-0,         10,         10,        1,   304128, 0xc1618ec0
-0,         11,         11,        1,   304128, 0xc6f0f9b9
-0,         12,         12,        1,   304128, 0x6f015ad1
-0,         13,         13,        1,   304128, 0xf17e4455
-0,         14,         14,        1,   304128, 0xbcb31bc9
diff --git a/deps/libav/tests/ref/fate/filter-framepack-frameseq b/deps/libav/tests/ref/fate/filter-framepack-frameseq
deleted file mode 100644
index 83c08a0..0000000
--- a/deps/libav/tests/ref/fate/filter-framepack-frameseq
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/50
-0,          0,          0,        1,   152064, 0x05b789ef
-0,          1,          1,        1,   152064, 0x05b789ef
-0,          2,          2,        1,   152064, 0x4bb46551
-0,          3,          3,        1,   152064, 0x4bb46551
-0,          4,          4,        1,   152064, 0x9dddf64a
-0,          5,          5,        1,   152064, 0x9dddf64a
-0,          6,          6,        1,   152064, 0x2a8380b0
-0,          7,          7,        1,   152064, 0x2a8380b0
-0,          8,          8,        1,   152064, 0x4de3b652
-0,          9,          9,        1,   152064, 0x4de3b652
-0,         10,         10,        1,   152064, 0xedb5a8e6
-0,         11,         11,        1,   152064, 0xedb5a8e6
-0,         12,         12,        1,   152064, 0xe20f7c23
-0,         13,         13,        1,   152064, 0xe20f7c23
-0,         14,         14,        1,   152064, 0x5ab58bac
diff --git a/deps/libav/tests/ref/fate/filter-framepack-lines b/deps/libav/tests/ref/fate/filter-framepack-lines
deleted file mode 100644
index d714462..0000000
--- a/deps/libav/tests/ref/fate/filter-framepack-lines
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   304128, 0x901a13ed
-0,          1,          1,        1,   304128, 0x793ccaa2
-0,          2,          2,        1,   304128, 0x9eafeca3
-0,          3,          3,        1,   304128, 0x18f0016f
-0,          4,          4,        1,   304128, 0xc90f6cb3
-0,          5,          5,        1,   304128, 0x82d751db
-0,          6,          6,        1,   304128, 0x7cd2f846
-0,          7,          7,        1,   304128, 0xb3801767
-0,          8,          8,        1,   304128, 0x3372005b
-0,          9,          9,        1,   304128, 0x822a722a
-0,         10,         10,        1,   304128, 0x05908ec0
-0,         11,         11,        1,   304128, 0xabbbf9b9
-0,         12,         12,        1,   304128, 0x1b345ad1
-0,         13,         13,        1,   304128, 0x6ccd4455
-0,         14,         14,        1,   304128, 0xad541bc9
diff --git a/deps/libav/tests/ref/fate/filter-framepack-sbs b/deps/libav/tests/ref/fate/filter-framepack-sbs
deleted file mode 100644
index d714462..0000000
--- a/deps/libav/tests/ref/fate/filter-framepack-sbs
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   304128, 0x901a13ed
-0,          1,          1,        1,   304128, 0x793ccaa2
-0,          2,          2,        1,   304128, 0x9eafeca3
-0,          3,          3,        1,   304128, 0x18f0016f
-0,          4,          4,        1,   304128, 0xc90f6cb3
-0,          5,          5,        1,   304128, 0x82d751db
-0,          6,          6,        1,   304128, 0x7cd2f846
-0,          7,          7,        1,   304128, 0xb3801767
-0,          8,          8,        1,   304128, 0x3372005b
-0,          9,          9,        1,   304128, 0x822a722a
-0,         10,         10,        1,   304128, 0x05908ec0
-0,         11,         11,        1,   304128, 0xabbbf9b9
-0,         12,         12,        1,   304128, 0x1b345ad1
-0,         13,         13,        1,   304128, 0x6ccd4455
-0,         14,         14,        1,   304128, 0xad541bc9
diff --git a/deps/libav/tests/ref/fate/filter-framepack-tab b/deps/libav/tests/ref/fate/filter-framepack-tab
deleted file mode 100644
index 0346f06..0000000
--- a/deps/libav/tests/ref/fate/filter-framepack-tab
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   304128, 0x0b6b13ed
-0,          1,          1,        1,   304128, 0x406bcaa2
-0,          2,          2,        1,   304128, 0xb0deeca3
-0,          3,          3,        1,   304128, 0x5781016f
-0,          4,          4,        1,   304128, 0xff6c6cb3
-0,          5,          5,        1,   304128, 0x197151db
-0,          6,          6,        1,   304128, 0xca1cf846
-0,          7,          7,        1,   304128, 0x396e1767
-0,          8,          8,        1,   304128, 0x0215005b
-0,          9,          9,        1,   304128, 0xd9ae722a
-0,         10,         10,        1,   304128, 0xd0f98ec0
-0,         11,         11,        1,   304128, 0x1d0ef9b9
-0,         12,         12,        1,   304128, 0xef005ad1
-0,         13,         13,        1,   304128, 0x00564455
-0,         14,         14,        1,   304128, 0xe3eb1bc9
diff --git a/deps/libav/tests/ref/fate/filter-gradfun b/deps/libav/tests/ref/fate/filter-gradfun
deleted file mode 100644
index 794fae9..0000000
--- a/deps/libav/tests/ref/fate/filter-gradfun
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xaebf898f
-0,          1,          1,        1,   152064, 0x217b6560
-0,          2,          2,        1,   152064, 0x0269f62d
-0,          3,          3,        1,   152064, 0x12168087
-0,          4,          4,        1,   152064, 0x42f9b5fb
-0,          5,          5,        1,   152064, 0xa653a8b3
-0,          6,          6,        1,   152064, 0x2e317bc3
-0,          7,          7,        1,   152064, 0xf3c28b63
-0,          8,          8,        1,   152064, 0x12e57fce
-0,          9,          9,        1,   152064, 0xeac238dd
-0,         10,         10,        1,   152064, 0x8fe74772
-0,         11,         11,        1,   152064, 0x982afc9c
-0,         12,         12,        1,   152064, 0xd82ead51
-0,         13,         13,        1,   152064, 0xf83ca211
-0,         14,         14,        1,   152064, 0xc01f8de2
-0,         15,         15,        1,   152064, 0x7ec60ec6
-0,         16,         16,        1,   152064, 0x1beb4dd3
-0,         17,         17,        1,   152064, 0x5a513899
-0,         18,         18,        1,   152064, 0x8c766a7b
-0,         19,         19,        1,   152064, 0x8bcddbb0
-0,         20,         20,        1,   152064, 0x01f6f558
-0,         21,         21,        1,   152064, 0xac7e240f
-0,         22,         22,        1,   152064, 0xe8811d38
-0,         23,         23,        1,   152064, 0x4ea268c9
-0,         24,         24,        1,   152064, 0xadc5f950
-0,         25,         25,        1,   152064, 0xdbf498fb
-0,         26,         26,        1,   152064, 0x1b999678
-0,         27,         27,        1,   152064, 0x085dd810
-0,         28,         28,        1,   152064, 0x4665a44f
-0,         29,         29,        1,   152064, 0x674764cf
-0,         30,         30,        1,   152064, 0x65e96a72
-0,         31,         31,        1,   152064, 0x44e0c539
-0,         32,         32,        1,   152064, 0xb124fc9e
-0,         33,         33,        1,   152064, 0x5cff79e3
-0,         34,         34,        1,   152064, 0x7dd94359
-0,         35,         35,        1,   152064, 0x3ec294b6
-0,         36,         36,        1,   152064, 0x675d3767
-0,         37,         37,        1,   152064, 0x9efa01cb
-0,         38,         38,        1,   152064, 0x321058d2
-0,         39,         39,        1,   152064, 0xe0d04e9c
-0,         40,         40,        1,   152064, 0xa4dd58d4
-0,         41,         41,        1,   152064, 0x4cc19dc5
-0,         42,         42,        1,   152064, 0x30a1bf77
-0,         43,         43,        1,   152064, 0x2c9d20f2
-0,         44,         44,        1,   152064, 0x55cb0447
-0,         45,         45,        1,   152064, 0x4daa7e4f
-0,         46,         46,        1,   152064, 0x2a4f53c7
-0,         47,         47,        1,   152064, 0x9fb8c583
-0,         48,         48,        1,   152064, 0x072eb401
-0,         49,         49,        1,   152064, 0xa203d8b7
diff --git a/deps/libav/tests/ref/fate/filter-hqdn3d b/deps/libav/tests/ref/fate/filter-hqdn3d
deleted file mode 100644
index 6f121c3..0000000
--- a/deps/libav/tests/ref/fate/filter-hqdn3d
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x0c09883a
-0,          1,          1,        1,   152064, 0xfc2748a0
-0,          2,          2,        1,   152064, 0xb746eea8
-0,          3,          3,        1,   152064, 0xf14192d7
-0,          4,          4,        1,   152064, 0xae26db7f
-0,          5,          5,        1,   152064, 0xe1a7da48
-0,          6,          6,        1,   152064, 0x5196b387
-0,          7,          7,        1,   152064, 0x20eac7ff
-0,          8,          8,        1,   152064, 0x4896c7f5
-0,          9,          9,        1,   152064, 0x97ba6468
-0,         10,         10,        1,   152064, 0x29b19884
-0,         11,         11,        1,   152064, 0x591e4e14
-0,         12,         12,        1,   152064, 0xb692fc98
-0,         13,         13,        1,   152064, 0x3457ed57
-0,         14,         14,        1,   152064, 0xbb10d71d
-0,         15,         15,        1,   152064, 0x47f45b57
-0,         16,         16,        1,   152064, 0xddbd8bc6
-0,         17,         17,        1,   152064, 0x1ef36e02
-0,         18,         18,        1,   152064, 0x55a363d2
-0,         19,         19,        1,   152064, 0x11c1c2f4
-0,         20,         20,        1,   152064, 0x553bdc2b
-0,         21,         21,        1,   152064, 0x2101d886
-0,         22,         22,        1,   152064, 0xe8f77998
-0,         23,         23,        1,   152064, 0x39bac7ff
-0,         24,         24,        1,   152064, 0x09a4172e
-0,         25,         25,        1,   152064, 0x6121f57f
-0,         26,         26,        1,   152064, 0x60e7525c
-0,         27,         27,        1,   152064, 0xd7895259
-0,         28,         28,        1,   152064, 0x12b2153b
-0,         29,         29,        1,   152064, 0x6119a22e
-0,         30,         30,        1,   152064, 0xf1969bd5
-0,         31,         31,        1,   152064, 0x7b03fc83
-0,         32,         32,        1,   152064, 0x17383667
-0,         33,         33,        1,   152064, 0x332bbfba
-0,         34,         34,        1,   152064, 0x253998a8
-0,         35,         35,        1,   152064, 0x2614c984
-0,         36,         36,        1,   152064, 0x50c86e8d
-0,         37,         37,        1,   152064, 0x9ff23b55
-0,         38,         38,        1,   152064, 0xc4589665
-0,         39,         39,        1,   152064, 0x5e7d86c7
-0,         40,         40,        1,   152064, 0xdda07f2f
-0,         41,         41,        1,   152064, 0xa1dacf4a
-0,         42,         42,        1,   152064, 0x3c83fb32
-0,         43,         43,        1,   152064, 0xa43da916
-0,         44,         44,        1,   152064, 0x0e767b80
-0,         45,         45,        1,   152064, 0xa18c5f82
-0,         46,         46,        1,   152064, 0xdb21c249
-0,         47,         47,        1,   152064, 0xb126341e
-0,         48,         48,        1,   152064, 0xc14742be
-0,         49,         49,        1,   152064, 0x582f631d
diff --git a/deps/libav/tests/ref/fate/filter-interlace b/deps/libav/tests/ref/fate/filter-interlace
deleted file mode 100644
index 4659942..0000000
--- a/deps/libav/tests/ref/fate/filter-interlace
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 2/25
-0,          0,          0,        1,   152064, 0x6077db38
-0,          1,          1,        1,   152064, 0x3d4f1b15
-0,          2,          2,        1,   152064, 0x447594f6
-0,          3,          3,        1,   152064, 0xb6258a38
-0,          4,          4,        1,   152064, 0x296abb09
-0,          5,          5,        1,   152064, 0x0fad069d
-0,          6,          6,        1,   152064, 0x92c78c0d
-0,          7,          7,        1,   152064, 0x645531fd
-0,          8,          8,        1,   152064, 0xe7652880
-0,          9,          9,        1,   152064, 0x496e1151
-0,         10,         10,        1,   152064, 0x7f7cfb06
-0,         11,         11,        1,   152064, 0x45e9affe
-0,         12,         12,        1,   152064, 0xaedb2d3a
-0,         13,         13,        1,   152064, 0x03fd9ae6
-0,         14,         14,        1,   152064, 0x2084e84d
-0,         15,         15,        1,   152064, 0xcf05faf6
-0,         16,         16,        1,   152064, 0x84c746c2
-0,         17,         17,        1,   152064, 0x898a6321
-0,         18,         18,        1,   152064, 0xe12b7fe9
-0,         19,         19,        1,   152064, 0x12feb756
-0,         20,         20,        1,   152064, 0xd813601a
-0,         21,         21,        1,   152064, 0xc0f3d385
-0,         22,         22,        1,   152064, 0xfca3a63f
-0,         23,         23,        1,   152064, 0xa0796f44
-0,         24,         24,        1,   152064, 0x1d26af11
diff --git a/deps/libav/tests/ref/fate/filter-negate b/deps/libav/tests/ref/fate/filter-negate
deleted file mode 100644
index 1d2ea73..0000000
--- a/deps/libav/tests/ref/fate/filter-negate
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xef20e1ec
-0,          1,          1,        1,   152064, 0x899606ec
-0,          2,          2,        1,   152064, 0xaea175d2
-0,          3,          3,        1,   152064, 0x5201eb55
-0,          4,          4,        1,   152064, 0xf02bb525
-0,          5,          5,        1,   152064, 0x99fdc305
-0,          6,          6,        1,   152064, 0x3a8fefe7
-0,          7,          7,        1,   152064, 0x005edfbf
-0,          8,          8,        1,   152064, 0xe37aea50
-0,          9,          9,        1,   152064, 0xa5ad32f9
-0,         10,         10,        1,   152064, 0xb1e52485
-0,         11,         11,        1,   152064, 0x55b06e56
-0,         12,         12,        1,   152064, 0xdfb7be97
-0,         13,         13,        1,   152064, 0x191bca13
-0,         14,         14,        1,   152064, 0xa554dd3c
-0,         15,         15,        1,   152064, 0x36075b77
-0,         16,         16,        1,   152064, 0xbf6b1cbd
-0,         17,         17,        1,   152064, 0xf33432b6
-0,         18,         18,        1,   152064, 0x5d7100c3
-0,         19,         19,        1,   152064, 0x376f8f0c
-0,         20,         20,        1,   152064, 0x07ca75fa
-0,         21,         21,        1,   152064, 0xe3984704
-0,         22,         22,        1,   152064, 0xa8fb4e4c
-0,         23,         23,        1,   152064, 0xe8e102d8
-0,         24,         24,        1,   152064, 0xcc6771c9
-0,         25,         25,        1,   152064, 0xf646d238
-0,         26,         26,        1,   152064, 0xa52cd41e
-0,         27,         27,        1,   152064, 0x536d92c2
-0,         28,         28,        1,   152064, 0x7058c6a1
-0,         29,         29,        1,   152064, 0xcc6c05d0
-0,         30,         30,        1,   152064, 0x1fc2ffb8
-0,         31,         31,        1,   152064, 0x041ea59c
-0,         32,         32,        1,   152064, 0xfc006e07
-0,         33,         33,        1,   152064, 0x0246efe1
-0,         34,         34,        1,   152064, 0x079428e5
-0,         35,         35,        1,   152064, 0x64d9d773
-0,         36,         36,        1,   152064, 0x914d3454
-0,         37,         37,        1,   152064, 0xef69686e
-0,         38,         38,        1,   152064, 0x3c91129f
-0,         39,         39,        1,   152064, 0x2a611ca7
-0,         40,         40,        1,   152064, 0xaf56124f
-0,         41,         41,        1,   152064, 0xce48cd45
-0,         42,         42,        1,   152064, 0x75feac29
-0,         43,         43,        1,   152064, 0xfd2b4b5b
-0,         44,         44,        1,   152064, 0x8d2f675c
-0,         45,         45,        1,   152064, 0x1573ed3b
-0,         46,         46,        1,   152064, 0xb0fc17ca
-0,         47,         47,        1,   152064, 0x53e5a654
-0,         48,         48,        1,   152064, 0xe0cbb786
-0,         49,         49,        1,   152064, 0xcaa092fe
diff --git a/deps/libav/tests/ref/fate/filter-null b/deps/libav/tests/ref/fate/filter-null
deleted file mode 100644
index 3c3b7b7..0000000
--- a/deps/libav/tests/ref/fate/filter-null
+++ /dev/null
@@ -1 +0,0 @@
-null                eba2f135a08829387e2f698ff72a2939
diff --git a/deps/libav/tests/ref/fate/filter-overlay b/deps/libav/tests/ref/fate/filter-overlay
deleted file mode 100644
index d988a2e..0000000
--- a/deps/libav/tests/ref/fate/filter-overlay
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf6f773b6
-0,          1,          1,        1,   152064, 0x8e67618e
-0,          2,          2,        1,   152064, 0xc8eff2ef
-0,          3,          3,        1,   152064, 0xcf39936c
-0,          4,          4,        1,   152064, 0xaf18c4d1
-0,          5,          5,        1,   152064, 0x7e69911e
-0,          6,          6,        1,   152064, 0x1b70214f
-0,          7,          7,        1,   152064, 0xc8032176
-0,          8,          8,        1,   152064, 0xefb42ecc
-0,          9,          9,        1,   152064, 0xfb210e4b
-0,         10,         10,        1,   152064, 0x2ee24b11
-0,         11,         11,        1,   152064, 0x0dac02a5
-0,         12,         12,        1,   152064, 0x9a5ce483
-0,         13,         13,        1,   152064, 0x6bb7c758
-0,         14,         14,        1,   152064, 0xcbb545e5
-0,         15,         15,        1,   152064, 0x81c1b339
-0,         16,         16,        1,   152064, 0xfa38d624
-0,         17,         17,        1,   152064, 0x56c5e63e
-0,         18,         18,        1,   152064, 0x419d194d
-0,         19,         19,        1,   152064, 0xed1a92b8
-0,         20,         20,        1,   152064, 0xd2c0aa39
-0,         21,         21,        1,   152064, 0x6214ddd5
-0,         22,         22,        1,   152064, 0xa978e19f
-0,         23,         23,        1,   152064, 0x676422a2
-0,         24,         24,        1,   152064, 0x5213dd62
-0,         25,         25,        1,   152064, 0x13c1a404
-0,         26,         26,        1,   152064, 0xa543a1a2
-0,         27,         27,        1,   152064, 0x8d0d0bed
-0,         28,         28,        1,   152064, 0x000304cf
-0,         29,         29,        1,   152064, 0x7f75b0ab
-0,         30,         30,        1,   152064, 0x68d07ce6
-0,         31,         31,        1,   152064, 0xb88c9852
-0,         32,         32,        1,   152064, 0x4be5ae13
-0,         33,         33,        1,   152064, 0x85b3f7b1
-0,         34,         34,        1,   152064, 0x9facb7d5
-0,         35,         35,        1,   152064, 0x9f11617e
-0,         36,         36,        1,   152064, 0x43393f46
-0,         37,         37,        1,   152064, 0xd45c3b92
-0,         38,         38,        1,   152064, 0x53de7e1b
-0,         39,         39,        1,   152064, 0xd1c685a7
-0,         40,         40,        1,   152064, 0x21e1778f
-0,         41,         41,        1,   152064, 0xe2b1abe1
-0,         42,         42,        1,   152064, 0x8623b5aa
-0,         43,         43,        1,   152064, 0xfc700aa3
-0,         44,         44,        1,   152064, 0x30a2d120
-0,         45,         45,        1,   152064, 0xa35e4d15
-0,         46,         46,        1,   152064, 0xa3fb11c5
-0,         47,         47,        1,   152064, 0x034f8fb7
-0,         48,         48,        1,   152064, 0x921c7d85
-0,         49,         49,        1,   152064, 0x7a94b9bf
diff --git a/deps/libav/tests/ref/fate/filter-pixdesc b/deps/libav/tests/ref/fate/filter-pixdesc
deleted file mode 100644
index 23452ae..0000000
--- a/deps/libav/tests/ref/fate/filter-pixdesc
+++ /dev/null
@@ -1,89 +0,0 @@
-abgr                037bf9df6a765520ad6d490066bf4b89
-argb                c442a8261c2265a07212ef0f72e35f5a
-bgr24               0d0cb38ab3fa0b2ec0865c14f78b217b
-bgr444be            d9ea9307d21b162225b8b2c524cf9477
-bgr444le            88035350e9da3a8f67387890b956f0bc
-bgr48be             00624e6c7ec7ab19897ba2f0a3257fe8
-bgr48le             d02c235ebba7167881ca2d576497ff84
-bgr4_byte           50d23cc82d9dcef2fd12adb81fb9b806
-bgr555be            49f01b1f1f0c84fd9e776dd34cc3c280
-bgr555le            378d6ac4223651a1adcbf94a3d0d807b
-bgr565be            257cf78afa35dc31e9696f139c916715
-bgr565le            1dfdd03995c287e3c754b164bf26a355
-bgr8                24bd566170343d06fec6fccfff5abc54
-bgra                76a18a5151242fa137133f604cd624d2
-gbrp                76204621e200a3cc633012f6720c7005
-gbrp10be            2ca4a4a589a7dc461ff186913c7a69e5
-gbrp10le            46176f1fcc6e67f9862115fe373f73d3
-gbrp9be             981c2c1b0ef1791824b4c7518331bc2e
-gbrp9le             25fb915ed11d07d631e0e7b78d54bebf
-gray                db08f7f0751900347e6b8649e4164d21
-gray16be            7becf34ae825a3df3969bf4c6bfeb5e2
-gray16le            10bd87059b5c189f3caef2837f4f2b5c
-monob               668ebe8b8103b9046b251b2fa8a1d88f
-monow               9251497f3b0634f1165d12d5a289d943
-nv12                e0af357888584d36eec5aa0f673793ef
-nv21                9a3297f3b34baa038b1f37cb202b512f
-rgb24               b41eba9651e1b5fe386289b506188105
-rgb444be            9e89db334568c6b2e3d5d0540f4ba960
-rgb444le            0a68cb6de8bf530aa30c5c1205c25155
-rgb48be             cc139ec1dd9451f0e049c0cb3a0c8aa2
-rgb48le             86c5608904f75360d492dbc5c9589969
-rgb4_byte           c93ba89b74c504e7f5ae9d9ab1546c73
-rgb555be            912a62c5e53bfcbac2a0340e10973cf2
-rgb555le            a937a0fc764fb57dc1b3af87cba0273c
-rgb565be            9cadf742e05ddc23a3b5b270f89aad3c
-rgb565le            d39aa298bb525e9be8860351c6f62dab
-rgb8                4a9d8e4f2f154e83a7e1735be6300700
-rgba                93a5b3712e6eb8c5b9a09ffc7b9fbc12
-uyvy422             adcf64516a19fce44df77082bdb16291
-yuv410p             2d9225153c83ee1132397d619d94d1b3
-yuv411p             8b298af3e43348ca1b11eb8a3252ac6c
-yuv420p             eba2f135a08829387e2f698ff72a2939
-yuv420p10be         299fe1d785a3d3dd5e70778700d7fb06
-yuv420p10le         8aee004e765a5383be0954f5e916b72f
-yuv420p16be         16c009a235cd52b74791a895423152a3
-yuv420p16le         2d59c4f1d0314a5a957a7cfc4b6fabcc
-yuv420p9be          ce880fa07830e5297c22acf6e20555ce
-yuv420p9le          16543fda8f87d94a6cf857d2e8d4461a
-yuv422p             c9bba4529821d796a6ab09f6a5fd355a
-yuv422p10be         11af7dfafe8bc025c7e3bd82b830fe8a
-yuv422p10le         ec04efb76efa79bf0d02b21572371a56
-yuv422p16be         5499502e1c29534a158a1fe60e889f60
-yuv422p16le         e3d61fde6978591596bc36b914386623
-yuv422p9be          29b71579946940a8c00fa844c9dff507
-yuv422p9le          062b7f9cbb972bf36b5bdb1a7623701a
-yuv440p             5a064afe2b453bb52cdb3f176b1aa1cf
-yuv444p             0a98447b78fd476aa39686da6a74fa2e
-yuv444p10be         71be185a2fb7a353eb024df9bc63212d
-yuv444p10le         c1c6b30a12065c7901c0a267e4861a0f
-yuv444p16be         1c6ea2c2f5e539006112ceec3d4e7d90
-yuv444p16le         20f86bc2f68d2b3f1f2b48b97b2189f4
-yuv444p9be          6ab31f4c12b533ce318ecdff83cdd054
-yuv444p9le          f0606604a5c08becab6ba500124c4b7c
-yuva420p            a29884f3f3dfe1e00b961bc17bef3d47
-yuva420p10be        145366ff1632de3e300d947f49844284
-yuva420p10le        d797038552d7f698e4d1db4dfa18ceb0
-yuva420p16be        25a335f66a0670911ced818aa42fb670
-yuva420p16le        97bf252e6c030f0f0412d3826c2ea259
-yuva420p9be         06b764d85bd3c22e9b7ca4babed84d4f
-yuva420p9le         1f01cdd4fc46f98d4c11b2947307a0e3
-yuva422p            92b6815f465297284cdb843711682cee
-yuva422p10be        fb240ff9ac49b45b1b3d40df2c89e39d
-yuva422p10le        f767ede9ba1d427faadc963cf41d2412
-yuva422p16be        ef442b11b26e5e61f3c958fa309576dd
-yuva422p16le        5789009759d7a44dacc6da2194e402b1
-yuva422p9be         e0d2f45f7f5541eee988137c7ebb3495
-yuva422p9le         a4ec81f328efd3856dec430fb27f2f56
-yuva444p            c523716e4900cfe515eaab1d7124fdd9
-yuva444p10be        f5791a75fdb86da0c243511ef9ab8fbd
-yuva444p10le        578e88dfbe4ab07f280fcc7554f3a5c4
-yuva444p16be        ee7b9dd854e36b165d5b7cffb646ba6c
-yuva444p16le        ec93b2907923d5655e9fb085479260ef
-yuva444p9be         03414257d78e72c28d03e3c247319b7c
-yuva444p9le         e421d753257e36a79c2c0ec1607ac9e6
-yuvj420p            32eec78ba51857b16ce9b813a49b7189
-yuvj422p            0dfa0ed434f73be51428758c69e082cb
-yuvj440p            657501a28004e27a592757a7509f5189
-yuvj444p            98d3d054f2ec09a75eeed5d328dc75b7
-yuyv422             f2569f2b5069a0ee0cecae33de0455e3
diff --git a/deps/libav/tests/ref/fate/filter-pixfmts-copy b/deps/libav/tests/ref/fate/filter-pixfmts-copy
deleted file mode 100644
index 23452ae..0000000
--- a/deps/libav/tests/ref/fate/filter-pixfmts-copy
+++ /dev/null
@@ -1,89 +0,0 @@
-abgr                037bf9df6a765520ad6d490066bf4b89
-argb                c442a8261c2265a07212ef0f72e35f5a
-bgr24               0d0cb38ab3fa0b2ec0865c14f78b217b
-bgr444be            d9ea9307d21b162225b8b2c524cf9477
-bgr444le            88035350e9da3a8f67387890b956f0bc
-bgr48be             00624e6c7ec7ab19897ba2f0a3257fe8
-bgr48le             d02c235ebba7167881ca2d576497ff84
-bgr4_byte           50d23cc82d9dcef2fd12adb81fb9b806
-bgr555be            49f01b1f1f0c84fd9e776dd34cc3c280
-bgr555le            378d6ac4223651a1adcbf94a3d0d807b
-bgr565be            257cf78afa35dc31e9696f139c916715
-bgr565le            1dfdd03995c287e3c754b164bf26a355
-bgr8                24bd566170343d06fec6fccfff5abc54
-bgra                76a18a5151242fa137133f604cd624d2
-gbrp                76204621e200a3cc633012f6720c7005
-gbrp10be            2ca4a4a589a7dc461ff186913c7a69e5
-gbrp10le            46176f1fcc6e67f9862115fe373f73d3
-gbrp9be             981c2c1b0ef1791824b4c7518331bc2e
-gbrp9le             25fb915ed11d07d631e0e7b78d54bebf
-gray                db08f7f0751900347e6b8649e4164d21
-gray16be            7becf34ae825a3df3969bf4c6bfeb5e2
-gray16le            10bd87059b5c189f3caef2837f4f2b5c
-monob               668ebe8b8103b9046b251b2fa8a1d88f
-monow               9251497f3b0634f1165d12d5a289d943
-nv12                e0af357888584d36eec5aa0f673793ef
-nv21                9a3297f3b34baa038b1f37cb202b512f
-rgb24               b41eba9651e1b5fe386289b506188105
-rgb444be            9e89db334568c6b2e3d5d0540f4ba960
-rgb444le            0a68cb6de8bf530aa30c5c1205c25155
-rgb48be             cc139ec1dd9451f0e049c0cb3a0c8aa2
-rgb48le             86c5608904f75360d492dbc5c9589969
-rgb4_byte           c93ba89b74c504e7f5ae9d9ab1546c73
-rgb555be            912a62c5e53bfcbac2a0340e10973cf2
-rgb555le            a937a0fc764fb57dc1b3af87cba0273c
-rgb565be            9cadf742e05ddc23a3b5b270f89aad3c
-rgb565le            d39aa298bb525e9be8860351c6f62dab
-rgb8                4a9d8e4f2f154e83a7e1735be6300700
-rgba                93a5b3712e6eb8c5b9a09ffc7b9fbc12
-uyvy422             adcf64516a19fce44df77082bdb16291
-yuv410p             2d9225153c83ee1132397d619d94d1b3
-yuv411p             8b298af3e43348ca1b11eb8a3252ac6c
-yuv420p             eba2f135a08829387e2f698ff72a2939
-yuv420p10be         299fe1d785a3d3dd5e70778700d7fb06
-yuv420p10le         8aee004e765a5383be0954f5e916b72f
-yuv420p16be         16c009a235cd52b74791a895423152a3
-yuv420p16le         2d59c4f1d0314a5a957a7cfc4b6fabcc
-yuv420p9be          ce880fa07830e5297c22acf6e20555ce
-yuv420p9le          16543fda8f87d94a6cf857d2e8d4461a
-yuv422p             c9bba4529821d796a6ab09f6a5fd355a
-yuv422p10be         11af7dfafe8bc025c7e3bd82b830fe8a
-yuv422p10le         ec04efb76efa79bf0d02b21572371a56
-yuv422p16be         5499502e1c29534a158a1fe60e889f60
-yuv422p16le         e3d61fde6978591596bc36b914386623
-yuv422p9be          29b71579946940a8c00fa844c9dff507
-yuv422p9le          062b7f9cbb972bf36b5bdb1a7623701a
-yuv440p             5a064afe2b453bb52cdb3f176b1aa1cf
-yuv444p             0a98447b78fd476aa39686da6a74fa2e
-yuv444p10be         71be185a2fb7a353eb024df9bc63212d
-yuv444p10le         c1c6b30a12065c7901c0a267e4861a0f
-yuv444p16be         1c6ea2c2f5e539006112ceec3d4e7d90
-yuv444p16le         20f86bc2f68d2b3f1f2b48b97b2189f4
-yuv444p9be          6ab31f4c12b533ce318ecdff83cdd054
-yuv444p9le          f0606604a5c08becab6ba500124c4b7c
-yuva420p            a29884f3f3dfe1e00b961bc17bef3d47
-yuva420p10be        145366ff1632de3e300d947f49844284
-yuva420p10le        d797038552d7f698e4d1db4dfa18ceb0
-yuva420p16be        25a335f66a0670911ced818aa42fb670
-yuva420p16le        97bf252e6c030f0f0412d3826c2ea259
-yuva420p9be         06b764d85bd3c22e9b7ca4babed84d4f
-yuva420p9le         1f01cdd4fc46f98d4c11b2947307a0e3
-yuva422p            92b6815f465297284cdb843711682cee
-yuva422p10be        fb240ff9ac49b45b1b3d40df2c89e39d
-yuva422p10le        f767ede9ba1d427faadc963cf41d2412
-yuva422p16be        ef442b11b26e5e61f3c958fa309576dd
-yuva422p16le        5789009759d7a44dacc6da2194e402b1
-yuva422p9be         e0d2f45f7f5541eee988137c7ebb3495
-yuva422p9le         a4ec81f328efd3856dec430fb27f2f56
-yuva444p            c523716e4900cfe515eaab1d7124fdd9
-yuva444p10be        f5791a75fdb86da0c243511ef9ab8fbd
-yuva444p10le        578e88dfbe4ab07f280fcc7554f3a5c4
-yuva444p16be        ee7b9dd854e36b165d5b7cffb646ba6c
-yuva444p16le        ec93b2907923d5655e9fb085479260ef
-yuva444p9be         03414257d78e72c28d03e3c247319b7c
-yuva444p9le         e421d753257e36a79c2c0ec1607ac9e6
-yuvj420p            32eec78ba51857b16ce9b813a49b7189
-yuvj422p            0dfa0ed434f73be51428758c69e082cb
-yuvj440p            657501a28004e27a592757a7509f5189
-yuvj444p            98d3d054f2ec09a75eeed5d328dc75b7
-yuyv422             f2569f2b5069a0ee0cecae33de0455e3
diff --git a/deps/libav/tests/ref/fate/filter-pixfmts-crop b/deps/libav/tests/ref/fate/filter-pixfmts-crop
deleted file mode 100644
index cbbcf90..0000000
--- a/deps/libav/tests/ref/fate/filter-pixfmts-crop
+++ /dev/null
@@ -1,42 +0,0 @@
-abgr                cd761690872843d1b7ab0c695393c751
-argb                2ec6ef18769bcd651c2e8904d5a3ee67
-bgr24               3450fd00cf1493d1ded75544d82ba3ec
-bgr48be             18ca4002732f278cc9f525215c2fca41
-bgr48le             395a4c187c4e95217d089bd3df9f3654
-bgr4_byte           2f6ac3cdd4676ab4e2982bdf0664945b
-bgr555be            d3a7c273604723adeb7e5f5dd1c4272b
-bgr555le            d22442fc13b464f9ba455b08df4e981f
-bgr565be            fadceef4a64ad6873fcb43ddee0deb3c
-bgr565le            891664e5a54ae5968901347da92bc5e9
-bgr8                4b7159e05765bd4703180072d86423c8
-bgra                395c9f706fccda721471acaa5c96c16c
-gray                8c4850e66562a587a292dc728a65ea4a
-gray16be            daa5a6b98fb4a280c57c57bff1a2ab5a
-gray16le            84f5ea7259073edcb893113b42213c8e
-rgb24               3b90ed64b687d3dc186c6ef521dc71a8
-rgb48be             e6fd353c0eb9bea889423954414bea35
-rgb48le             68a1723da11ce08b502d42e204376503
-rgb4_byte           6958029f73c6cdfed4f71020d816f027
-rgb555be            41a7d1836837bc90f2cae19a9c9df3b3
-rgb555le            eeb78f8ce6186fba55c941469e60ba67
-rgb565be            b2d1cb525f3a0cfe27753c0d479b2fa9
-rgb565le            6a49700680be9a0d434411825a769556
-rgb8                88b0398c265d1ed7a837dc084fa0917c
-rgba                fd00b24c7597268c32759a84a1de2de4
-yuv410p             a9f2eaa747bf988b7bebe4f442b9c67a
-yuv411p             3334d3aef8dba238658090ac172375d1
-yuv420p             bfea0188ddd4889787c403caae119cc7
-yuv420p16be         8365eff38b8c329aeb95fc605fa229bb
-yuv420p16le         5e8dd38d973d5854abe1ad4efad20cc1
-yuv422p             f2f930a91fe00d4252c4720b5ecd8961
-yuv422p16be         167e4338811a7d272925a4c6417d60da
-yuv422p16le         3359395d5875d581fa1e975013d30114
-yuv440p             2472417d980e395ad6843cbb8b633b29
-yuv444p             1f151980486848c96bc5585ced99003e
-yuv444p16be         1ce8fcd4712d525af983e6179d6a4f9e
-yuv444p16le         5f1441e18345aadb3f881dac99c6c08a
-yuva420p            7536753dfbc7932560fb50c921369a0e
-yuvj420p            21f891093006d42d7683b0e1d773a657
-yuvj422p            9a43d474c407590ad8f213880586b45e
-yuvj440p            977351350450ebdbf7a9d20020c6b5a5
-yuvj444p            4a50ba26859dad91dcf7000de0d0efa1
diff --git a/deps/libav/tests/ref/fate/filter-pixfmts-hflip b/deps/libav/tests/ref/fate/filter-pixfmts-hflip
deleted file mode 100644
index 3741713..0000000
--- a/deps/libav/tests/ref/fate/filter-pixfmts-hflip
+++ /dev/null
@@ -1,42 +0,0 @@
-abgr                49468c6c9ceee5d52b08b1270a909323
-argb                50ba9f16c6475530602f2983278b82d0
-bgr24               cc53d2011d097972db0d22756c3699e3
-bgr48be             815192d3757c66de97b0d51818acbe0f
-bgr48le             8e4184ac6eae251b4bace51dba7d790c
-bgr4_byte           aac987e7d1a6a96477cfc0b48a4285de
-bgr555be            bc07265898440116772200390d70c092
-bgr555le            ccee08679bac84a1f960c6c9070c5538
-bgr565be            e088789ce46224b87c6e46610ef19add
-bgr565le            3703466e19e1b52e03a34fd244a8e8e4
-bgr8                50b505a889f0428242305acb642da107
-bgra                01ca21e7e6a8d1281b4553bde8e8a404
-gray                03efcb4ab52a24c0af0e03cfd26c9377
-gray16be            9bcbca979601ddc4869f846f08f3d1dd
-gray16le            c1b8965adcc7f847ee343149ff507073
-rgb24               754f1722fc738590cc407ac65749bfe8
-rgb48be             d690412ca5fada031b5da47b87096248
-rgb48le             c901feb564232f5d0bc0eabd66dae3e7
-rgb4_byte           c8a3f995fcf3e0919239ea2c413ddc29
-rgb555be            045ce8607d3910586f4d97481dda8632
-rgb555le            8778ee0cf58ce9ad1d99a1eca9f95e87
-rgb565be            c8022a1b2470e72f124e4389fad4c372
-rgb565le            2cb690eb3fcb72da3771ad6a48931158
-rgb8                9e462b811b9b6173397b9cfc1f6b2f17
-rgba                d3d0dc1ecef3ed72f26a2986d0efc204
-yuv410p             acb543ebbbf63eefe533e6faffc006da
-yuv411p             c626cf6d191139b4ca7efc0155f957f1
-yuv420p             2d5c80f9ba2ddd85b2aeda3564cc7d64
-yuv420p16be         758b0c1e2113b15e7afde48da4e4d024
-yuv420p16le         480ccd951dcb806bc875d307e02e50a0
-yuv422p             6e728f4eb9eae287c224f396d84be6ea
-yuv422p16be         a05d43cd62b790087bd37083174557de
-yuv422p16le         6954abebcbc62d81068d58d0c62bdd5b
-yuv440p             a99e2b57ed601f39852715c9d675d0d3
-yuv444p             947e47f7bb5fdccc659d19b7df2b6fc3
-yuv444p16be         58c012e5ab73b066ef3c2b6411a395f1
-yuv444p16le         32c12794e184042a59738ab2de608c8d
-yuva420p            d83ec0c01498189f179ec574918185f1
-yuvj420p            df3aaaec3bb157c3bde5f0365af30f4f
-yuvj422p            d113871528d510a192797af59df9c05c
-yuvj440p            07f5ff12ced85aba1b5cf51692fff4bb
-yuvj444p            8d95f6b4d4c9b4b0389d36df686bfa46
diff --git a/deps/libav/tests/ref/fate/filter-pixfmts-null b/deps/libav/tests/ref/fate/filter-pixfmts-null
deleted file mode 100644
index 23452ae..0000000
--- a/deps/libav/tests/ref/fate/filter-pixfmts-null
+++ /dev/null
@@ -1,89 +0,0 @@
-abgr                037bf9df6a765520ad6d490066bf4b89
-argb                c442a8261c2265a07212ef0f72e35f5a
-bgr24               0d0cb38ab3fa0b2ec0865c14f78b217b
-bgr444be            d9ea9307d21b162225b8b2c524cf9477
-bgr444le            88035350e9da3a8f67387890b956f0bc
-bgr48be             00624e6c7ec7ab19897ba2f0a3257fe8
-bgr48le             d02c235ebba7167881ca2d576497ff84
-bgr4_byte           50d23cc82d9dcef2fd12adb81fb9b806
-bgr555be            49f01b1f1f0c84fd9e776dd34cc3c280
-bgr555le            378d6ac4223651a1adcbf94a3d0d807b
-bgr565be            257cf78afa35dc31e9696f139c916715
-bgr565le            1dfdd03995c287e3c754b164bf26a355
-bgr8                24bd566170343d06fec6fccfff5abc54
-bgra                76a18a5151242fa137133f604cd624d2
-gbrp                76204621e200a3cc633012f6720c7005
-gbrp10be            2ca4a4a589a7dc461ff186913c7a69e5
-gbrp10le            46176f1fcc6e67f9862115fe373f73d3
-gbrp9be             981c2c1b0ef1791824b4c7518331bc2e
-gbrp9le             25fb915ed11d07d631e0e7b78d54bebf
-gray                db08f7f0751900347e6b8649e4164d21
-gray16be            7becf34ae825a3df3969bf4c6bfeb5e2
-gray16le            10bd87059b5c189f3caef2837f4f2b5c
-monob               668ebe8b8103b9046b251b2fa8a1d88f
-monow               9251497f3b0634f1165d12d5a289d943
-nv12                e0af357888584d36eec5aa0f673793ef
-nv21                9a3297f3b34baa038b1f37cb202b512f
-rgb24               b41eba9651e1b5fe386289b506188105
-rgb444be            9e89db334568c6b2e3d5d0540f4ba960
-rgb444le            0a68cb6de8bf530aa30c5c1205c25155
-rgb48be             cc139ec1dd9451f0e049c0cb3a0c8aa2
-rgb48le             86c5608904f75360d492dbc5c9589969
-rgb4_byte           c93ba89b74c504e7f5ae9d9ab1546c73
-rgb555be            912a62c5e53bfcbac2a0340e10973cf2
-rgb555le            a937a0fc764fb57dc1b3af87cba0273c
-rgb565be            9cadf742e05ddc23a3b5b270f89aad3c
-rgb565le            d39aa298bb525e9be8860351c6f62dab
-rgb8                4a9d8e4f2f154e83a7e1735be6300700
-rgba                93a5b3712e6eb8c5b9a09ffc7b9fbc12
-uyvy422             adcf64516a19fce44df77082bdb16291
-yuv410p             2d9225153c83ee1132397d619d94d1b3
-yuv411p             8b298af3e43348ca1b11eb8a3252ac6c
-yuv420p             eba2f135a08829387e2f698ff72a2939
-yuv420p10be         299fe1d785a3d3dd5e70778700d7fb06
-yuv420p10le         8aee004e765a5383be0954f5e916b72f
-yuv420p16be         16c009a235cd52b74791a895423152a3
-yuv420p16le         2d59c4f1d0314a5a957a7cfc4b6fabcc
-yuv420p9be          ce880fa07830e5297c22acf6e20555ce
-yuv420p9le          16543fda8f87d94a6cf857d2e8d4461a
-yuv422p             c9bba4529821d796a6ab09f6a5fd355a
-yuv422p10be         11af7dfafe8bc025c7e3bd82b830fe8a
-yuv422p10le         ec04efb76efa79bf0d02b21572371a56
-yuv422p16be         5499502e1c29534a158a1fe60e889f60
-yuv422p16le         e3d61fde6978591596bc36b914386623
-yuv422p9be          29b71579946940a8c00fa844c9dff507
-yuv422p9le          062b7f9cbb972bf36b5bdb1a7623701a
-yuv440p             5a064afe2b453bb52cdb3f176b1aa1cf
-yuv444p             0a98447b78fd476aa39686da6a74fa2e
-yuv444p10be         71be185a2fb7a353eb024df9bc63212d
-yuv444p10le         c1c6b30a12065c7901c0a267e4861a0f
-yuv444p16be         1c6ea2c2f5e539006112ceec3d4e7d90
-yuv444p16le         20f86bc2f68d2b3f1f2b48b97b2189f4
-yuv444p9be          6ab31f4c12b533ce318ecdff83cdd054
-yuv444p9le          f0606604a5c08becab6ba500124c4b7c
-yuva420p            a29884f3f3dfe1e00b961bc17bef3d47
-yuva420p10be        145366ff1632de3e300d947f49844284
-yuva420p10le        d797038552d7f698e4d1db4dfa18ceb0
-yuva420p16be        25a335f66a0670911ced818aa42fb670
-yuva420p16le        97bf252e6c030f0f0412d3826c2ea259
-yuva420p9be         06b764d85bd3c22e9b7ca4babed84d4f
-yuva420p9le         1f01cdd4fc46f98d4c11b2947307a0e3
-yuva422p            92b6815f465297284cdb843711682cee
-yuva422p10be        fb240ff9ac49b45b1b3d40df2c89e39d
-yuva422p10le        f767ede9ba1d427faadc963cf41d2412
-yuva422p16be        ef442b11b26e5e61f3c958fa309576dd
-yuva422p16le        5789009759d7a44dacc6da2194e402b1
-yuva422p9be         e0d2f45f7f5541eee988137c7ebb3495
-yuva422p9le         a4ec81f328efd3856dec430fb27f2f56
-yuva444p            c523716e4900cfe515eaab1d7124fdd9
-yuva444p10be        f5791a75fdb86da0c243511ef9ab8fbd
-yuva444p10le        578e88dfbe4ab07f280fcc7554f3a5c4
-yuva444p16be        ee7b9dd854e36b165d5b7cffb646ba6c
-yuva444p16le        ec93b2907923d5655e9fb085479260ef
-yuva444p9be         03414257d78e72c28d03e3c247319b7c
-yuva444p9le         e421d753257e36a79c2c0ec1607ac9e6
-yuvj420p            32eec78ba51857b16ce9b813a49b7189
-yuvj422p            0dfa0ed434f73be51428758c69e082cb
-yuvj440p            657501a28004e27a592757a7509f5189
-yuvj444p            98d3d054f2ec09a75eeed5d328dc75b7
-yuyv422             f2569f2b5069a0ee0cecae33de0455e3
diff --git a/deps/libav/tests/ref/fate/filter-pixfmts-pad b/deps/libav/tests/ref/fate/filter-pixfmts-pad
deleted file mode 100644
index 03db5a7..0000000
--- a/deps/libav/tests/ref/fate/filter-pixfmts-pad
+++ /dev/null
@@ -1,17 +0,0 @@
-abgr                e8e5e350c856c051d502cd435a2aa0bd
-argb                a98e0a1213824ee4566d4891468bb614
-bgr24               ac7417cea8d6e799a31a3c9a39b8f202
-bgra                6113a09a023cb2b08e9cad78eb1eb37a
-rgb24               65eed443acc66c4f02bab6df4ebed515
-rgba                74d4158ad0c626e9a7c6923b9ca73294
-yuv410p             a5210eb6a9b10c3269899b935df9a2d6
-yuv411p             a23380c9698e2d80c9fa8a8b6d4f6854
-yuv420p             f8733600369adaea28aa445dbdf2ed4c
-yuv422p             3e0d822c11c716e7636387b1bf27c5ff
-yuv440p             225dd7fbc8cceb24c26b765187d43a9e
-yuv444p             45484f0411d336ce94636da0395f4692
-yuva420p            919722724765dc3a716c38fa53b20580
-yuvj420p            4f20e2799966c21a9d9e0788b0956925
-yuvj422p            e4d84b0683f77a76f1c17d976eff127c
-yuvj440p            33511c43339aa32533ab832861c150c3
-yuvj444p            82f0badd9d0c062bbfa0d9d73d7240a3
diff --git a/deps/libav/tests/ref/fate/filter-pixfmts-scale b/deps/libav/tests/ref/fate/filter-pixfmts-scale
deleted file mode 100644
index 80816ec..0000000
--- a/deps/libav/tests/ref/fate/filter-pixfmts-scale
+++ /dev/null
@@ -1,89 +0,0 @@
-abgr                d894cb97f6c80eb21bdbe8a4eea62d86
-argb                54346f2b2eef10919e0f247241df3b24
-bgr24               570f8d6b51a838aed022ef67535f6bdc
-bgr444be            25fe04f73a3bad4140d1c4f96ca5b670
-bgr444le            2fde227e6cea6dca5decdd0b7c0866f7
-bgr48be             390d3058a12a99c2b153ed7922508bea
-bgr48le             39fe06feb4ec1d9730dccc04a0cfac4c
-bgr4_byte           ee1d35a7baf8e9016891929a2f565c0b
-bgr555be            de8901c1358834fddea060fcb3a67beb
-bgr555le            36b745067197f9ca8c1731cac51329c9
-bgr565be            922a2503767036ae9536f4f7823c04ee
-bgr565le            3a514a298c6161a071ddf9963c06509d
-bgr8                7f007fa6c153a16e808a9c51605a4016
-bgra                a5e7040f9a80cccd65e5acf2ca09ace5
-gbrp                205c50f8359cb4ba2827a7711dea2cc6
-gbrp10be            30b7f9d5ef5da474fb794743146236aa
-gbrp10le            2e9949a01fe4c38774728e34795165cc
-gbrp9be             6bac01a7f64a381521b2149fc46f4178
-gbrp9le             4b6cba7acf7886c13db122e590ec6b1f
-gray                d7786a7d9d99ac74230cc045cab5632c
-gray16be            b554d6c1cc8da23967445be4dd3e4a86
-gray16le            715a33aa1c19cb26b14f5cc000e7a3d1
-monob               88c4c050758e64d120f50c7eff694381
-monow               d31772ebaa877fc2a78565937f7f9673
-nv12                4676d59db43d657dc12841f6bc3ab452
-nv21                69c699510ff1fb777b118ebee1002f14
-rgb24               514692e28e8ff6860e415ce4fcf6eb8c
-rgb444be            12254053ae93373869fca18b2afcba31
-rgb444le            badbd68b59c87df6ae73248309637634
-rgb48be             8fac63787a711886030f8e056872b488
-rgb48le             ab92f2763a2eb264c3870cc758f97149
-rgb4_byte           d81ffd3add95842a618eec81024f0b5c
-rgb555be            4607309f9f217d51cbb53d13b84b4537
-rgb555le            a350ef1dc2c9688ed49e7ba018843795
-rgb565be            678ce231c4ea13629c1353b1df4ffbef
-rgb565le            6f4bb711238baa762d73305213f8d035
-rgb8                091d0170b354ef0e97312b95feb5483f
-rgba                a3d362f222098a00e63867f612018659
-uyvy422             314bd486277111a95d9369b944fa0400
-yuv410p             7df8f6d69b56a8dcb6c7ee908e5018b5
-yuv411p             1143e7c5cc28fe0922b051b17733bc4c
-yuv420p             fdad2d8df8985e3d17e73c71f713cb14
-yuv420p10be         27f28a6e09b1c04d0f755035a5db1f43
-yuv420p10le         a5a1692e026590ba2eddb46b9b827529
-yuv420p16be         d7270efce54eb59c7b01c14157a1b890
-yuv420p16le         e85abf00bad940a922b623c91c9026d7
-yuv420p9be          bb87fddca65d1742412c8d2b1caf96c6
-yuv420p9le          828eec50014a41258a5423c1fe56ac97
-yuv422p             918e37701ee7377d16a8a6c119c56a40
-yuv422p10be         315654908d50718e175aae018c484732
-yuv422p10le         91bbc78a9a56f659b55abc17722dcc09
-yuv422p16be         e7e34fe9264784763ab6cb406524c0f3
-yuv422p16le         c435b76b08204dda6908640fb5fd4621
-yuv422p9be          82494823944912f73cebc58ad2979bbd
-yuv422p9le          fc69c8a21f473916a4b4225636b97e06
-yuv440p             461503fdb9b90451020aa3b25ddf041c
-yuv444p             81b2eba962d12e8d64f003ac56f6faf2
-yuv444p10be         fb304d77c6d2e18df5938662a22176f0
-yuv444p10le         b17136913eb066dca6be6af645b9f7e8
-yuv444p16be         0da9bed80f5542682ab286f3261cf24c
-yuv444p16le         a0c5d3c7bf3f181db503cf8e450d1335
-yuv444p9be          9ac2643ce7f7e5c4e17c8c9fd8494d4a
-yuv444p9le          896a1cc9cccca1ba410dd53942d33cc4
-yuva420p            8673a9131fb47de69788863f93a50eb7
-yuva420p10be        d92a95061809f251175f5d5e3074930e
-yuva420p10le        bad90ba2d4c260e379a7aa6dc7760853
-yuva420p16be        a61d8ddb646e2d26020fc7ed2a48c1a9
-yuva420p16le        90ef774f86ad3177ec57eca8744b4e09
-yuva420p9be         f7655546446bfdc875243d7cdeb13b30
-yuva420p9le         ada2b719827059d70ebc57e2a3f9da92
-yuva422p            3c76ebeca0a7d3aa5f8e31ef80a86ffe
-yuva422p10be        01dd539e4a62762a3c97e965c76bb6f7
-yuva422p10le        76355d9d8fdcd085a24d48832b72e40b
-yuva422p16be        c21afa31ac18bd92e8e596b81552b52b
-yuva422p16le        0bc3720dba6076dcce3b74b1d3c6c4b7
-yuva422p9be         a60ac5b8026e9621724c033fbf79dbda
-yuva422p9le         c3eda8831e9b9c94a3eb487d33114103
-yuva444p            3268c6abe5e3cdbd16552a1eddced816
-yuva444p10be        856b37c1ee53459f46b9359d329ac9b5
-yuva444p10le        22790592361c007406d4ca9a9e0954a5
-yuva444p16be        ed5b07fe4d5b1137604568786777af1d
-yuva444p16le        3a3df23feb60d8832b566fd9765983d0
-yuva444p9be         4fc479c5b1044ad37b4e6fc6488b4f7f
-yuva444p9le         c41849b0134670d6f6253c337defbb04
-yuvj420p            30427bd6caf5bda93a173dbebe759e09
-yuvj422p            fc8288f64fd149573f73cf8da05d8e6d
-yuvj440p            508ac7a9ddeb6d1794a1100ba7a1664c
-yuvj444p            73aebe144085b22d1189caf6ca07e18c
-yuyv422             169e19ac91b257bd84ace0fdf56559ad
diff --git a/deps/libav/tests/ref/fate/filter-pixfmts-vflip b/deps/libav/tests/ref/fate/filter-pixfmts-vflip
deleted file mode 100644
index f0ad5eb..0000000
--- a/deps/libav/tests/ref/fate/filter-pixfmts-vflip
+++ /dev/null
@@ -1,89 +0,0 @@
-abgr                25e72e9dbd01ab00727c976d577f7be5
-argb                19869bf1a5ac0b6af4d8bbe2c104533c
-bgr24               89108a4ba00201f79b75b9305c42352d
-bgr444be            9ef12c42fb791948ca4423c452dc6b9a
-bgr444le            3650ecfc163abd1596c0cd29d130c4b0
-bgr48be             2f23931844f57641f3737348182d118c
-bgr48le             4242a026012b6c135a6aa138a6d67031
-bgr4_byte           407fcf564ed764c38e1d748f700ab921
-bgr555be            f739d2519f7e9d494359bf67a3821537
-bgr555le            bd7b3ec4d684dfad075d89a606cb8b74
-bgr565be            f19e9a4786395e1ddcd51399c98c9f6c
-bgr565le            fdb617533e1e7ff512ea5b6b6233e738
-bgr8                c60f93fd152c6903391d1fe9decd3547
-bgra                7f9b799fb48544e49ce93e91d7f9fca8
-gbrp                25c1bce192daefab910d51a56b52199e
-gbrp10be            6fe980f9ca94cbcdb9e01f4e906fdf19
-gbrp10le            f793a1d96d3524c6a17e53356c415c4e
-gbrp9be             e10dc3a2566b065260a45356ef08c1cd
-gbrp9le             f25105a33f18d6bcca3205c67ec106be
-gray                30d9014a9d43b5f37e7aa64be3a3ecfc
-gray16be            6b84b85d3326182fa1217e138249edc5
-gray16le            66bb8faa09dc149734aca3c768a6d4e1
-monob               d0cf8732677a5360b6160133043590d8
-monow               ff9869d067ecb94eb9d90c9750c31fea
-nv12                046f00f598ce14d9854a3534a5c99114
-nv21                01ea369dd2d0d3ed7451dc5c8d61497f
-rgb24               eaefabc168d0b14576bab45bc1e56e1e
-rgb444be            06722e03f8404e7d2226665ed2444a32
-rgb444le            185c9a5d9c2877484310d4196ef4cd6f
-rgb48be             62dd185862ed142283bd300eb6dbd216
-rgb48le             dcb76353268bc5862194d131762220da
-rgb4_byte           8c6ff02df0b06dd2d574836c3741b2a2
-rgb555be            40dc33cfb5cf56aac1c5a290ac486c36
-rgb555le            4f8eaad29a17e0f8e9d8ab743e76b999
-rgb565be            b57623ad9df74648339311a0edcebc7b
-rgb565le            73f247a3315dceaea3022ac7c197c5ef
-rgb8                13a8d89ef78d8127297d899005456ff0
-rgba                1fc6e920a42ec812aaa3b2aa02f37987
-uyvy422             ffbd36720c77398d9a0d03ce2625928f
-yuv410p             7bfb39d7afb49d6a6173e6b23ae321eb
-yuv411p             4a90048cc3a65fac150e53289700efe1
-yuv420p             2e6d6062e8cad37fb3ab2c433b55f382
-yuv420p10be         fb0772f5e2b9da20ff826e64c3893137
-yuv420p10le         e95879e14c4a6805f39643964baf41f7
-yuv420p16be         539076782902664a8acf381bf4f713e8
-yuv420p16le         0f609e588e5a258644ef85170d70e030
-yuv420p9be          be40ec975fb2873891643cbbbddbc3b0
-yuv420p9le          7e606310d3f5ff12badf911e8f333471
-yuv422p             d7f5cb44d9b0210d66d6a8762640ab34
-yuv422p10be         0be8378c3773e1c0b394315ef4994351
-yuv422p10le         6518094fe8de6bee95af21af1e5dc1e1
-yuv422p16be         9bd8f8c961822b586fa4cf992be54acc
-yuv422p16le         9c4a1239605c7952b736ac3130163f14
-yuv422p9be          7c6f1e140b3999ee7d923854e507752a
-yuv422p9le          51f10d79c07989060dd06e767e6d7d60
-yuv440p             876385e96165acf51271b20e5d85a416
-yuv444p             9c3c667d1613b72d15bc6d851c5eb8f7
-yuv444p10be         ee069cc6db48975eb029d72f889a7fe6
-yuv444p10le         645b3335248113cafe3c29edb1d7f3be
-yuv444p16be         de2dedfc6f12073ffead113f86e07ecf
-yuv444p16le         8e83323cf102d6c823a03ae8a7b7e033
-yuv444p9be          6ac92b7dc9ab2fc59bee99204886899a
-yuv444p9le          85aef13a654953d3455d89770b0d74bd
-yuva420p            c705d1cf061d8c6580ac690b55f92276
-yuva420p10be        baa5e3b0ff6d0ebbb0958560cd763c6e
-yuva420p10le        a36dc59ad55b406e5fee475236e9753c
-yuva420p16be        bf3b134eb70878df9afba61d03e930b8
-yuva420p16le        105d375154329a381aa58379a0a6ec46
-yuva420p9be         8273d591e055f48990c29dd905a6cdfd
-yuva420p9le         95ced0bb07e422d98db61a35cdb3fb8f
-yuva422p            6aed0ea657ed51cc047a4fbdd981aec8
-yuva422p10be        d69a3404984c5fd30c0fc548532bcb6b
-yuva422p10le        a40c8e6f50e12d94bf7484107ec98559
-yuva422p16be        39552c259ca242f2417e913ffc602fde
-yuva422p16le        16faa558a34291ca32f6d94dce211ee2
-yuva422p9be         a951eafb62c092c63f7566b6803f60df
-yuva422p9le         00b39cfca78666e057ee527f5e174a04
-yuva444p            da5d64f2b2bd2013c186456f595fad65
-yuva444p10be        00e74a9c0c7818a9bbd9fee95b961ee8
-yuva444p10le        cbe30f44b63cf7ed27fc2dde40315b5e
-yuva444p16be        7e9b799b057e1446dabbf0f738480cfb
-yuva444p16le        556d58b91a617fe4a83af99a4aea1c2e
-yuva444p9be         b5a31de4fac408eeecaf3aff11f40e55
-yuva444p9le         67467f1e1d9edbd59d3984ebbfe24be6
-yuvj420p            41fd02b204da0ab62452cd14b595e2e4
-yuvj422p            7f6ca9bc1812cde02036d7d29a7cce43
-yuvj440p            25711c3c0fd15ec19c59a10784fcfb96
-yuvj444p            e45dee2ac02276dfab92e8ebfbe52e00
-yuyv422             e944ff7316cd03c42c091717ce74f602
diff --git a/deps/libav/tests/ref/fate/filter-scale200 b/deps/libav/tests/ref/fate/filter-scale200
deleted file mode 100644
index 17103a2..0000000
--- a/deps/libav/tests/ref/fate/filter-scale200
+++ /dev/null
@@ -1 +0,0 @@
-scale200            aebdc1c3e08da2a925ba7212b1fadee0
diff --git a/deps/libav/tests/ref/fate/filter-scale500 b/deps/libav/tests/ref/fate/filter-scale500
deleted file mode 100644
index 93ba4f2..0000000
--- a/deps/libav/tests/ref/fate/filter-scale500
+++ /dev/null
@@ -1 +0,0 @@
-scale500            ef865c51156e55ce1ce38c8f90a709e6
diff --git a/deps/libav/tests/ref/fate/filter-select-alternate b/deps/libav/tests/ref/fate/filter-select-alternate
deleted file mode 100644
index 0776694..0000000
--- a/deps/libav/tests/ref/fate/filter-select-alternate
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x05b789ef
-0,          2,          2,        1,   152064, 0x9dddf64a
-0,          4,          4,        1,   152064, 0x4de3b652
-0,          6,          6,        1,   152064, 0xe20f7c23
-0,          8,          8,        1,   152064, 0x1f1b8026
-0,         10,         10,        1,   152064, 0x02344760
-0,         12,         12,        1,   152064, 0xc711ad61
-0,         14,         14,        1,   152064, 0x52a48ddd
-0,         16,         16,        1,   152064, 0x8e364e18
-0,         18,         18,        1,   152064, 0xf25f6acc
-0,         20,         20,        1,   152064, 0xfc7bf570
-0,         22,         22,        1,   152064, 0x445d1d59
-0,         24,         24,        1,   152064, 0xce09f9d6
-0,         26,         26,        1,   152064, 0x43d796b5
-0,         28,         28,        1,   152064, 0x76d2a455
-0,         30,         30,        1,   152064, 0x0f9d6aca
-0,         32,         32,        1,   152064, 0xd766fc8d
-0,         34,         34,        1,   152064, 0x7fea4378
-0,         36,         36,        1,   152064, 0x4c9737ab
-0,         38,         38,        1,   152064, 0x0b07594c
-0,         40,         40,        1,   152064, 0xd2735925
-0,         42,         42,        1,   152064, 0x20cebfa9
-0,         44,         44,        1,   152064, 0xfd500471
-0,         46,         46,        1,   152064, 0x09ef53ff
-0,         48,         48,        1,   152064, 0xbb87b483
diff --git a/deps/libav/tests/ref/fate/filter-setpts b/deps/libav/tests/ref/fate/filter-setpts
deleted file mode 100644
index 14aa613..0000000
--- a/deps/libav/tests/ref/fate/filter-setpts
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 0x05b789ef
-0,         28,         28,        0,   152064, 0x4bb46551
-0,         57,         57,        0,   152064, 0x9dddf64a
-0,         86,         86,        0,   152064, 0x2a8380b0
-0,        115,        115,        0,   152064, 0x4de3b652
-0,        144,        144,        0,   152064, 0xedb5a8e6
-0,        172,        172,        0,   152064, 0xe20f7c23
-0,        201,        201,        0,   152064, 0x5ab58bac
-0,        229,        229,        0,   152064, 0x1f1b8026
-0,        258,        258,        0,   152064, 0x91373915
-0,        286,        286,        0,   152064, 0x02344760
-0,        314,        314,        0,   152064, 0x30f5fcd5
-0,        343,        343,        0,   152064, 0xc711ad61
-0,        371,        371,        0,   152064, 0x24eca223
-0,        399,        399,        0,   152064, 0x52a48ddd
-0,        427,        427,        0,   152064, 0xa91c0f05
-0,        456,        456,        0,   152064, 0x8e364e18
-0,        484,        484,        0,   152064, 0xb15d38c8
-0,        512,        512,        0,   152064, 0xf25f6acc
-0,        541,        541,        0,   152064, 0xf34ddbff
-0,        570,        570,        0,   152064, 0xfc7bf570
-0,        598,        598,        0,   152064, 0x9dc72412
-0,        627,        627,        0,   152064, 0x445d1d59
-0,        656,        656,        0,   152064, 0x2f2768ef
-0,        685,        685,        0,   152064, 0xce09f9d6
-0,        714,        714,        0,   152064, 0x95579936
-0,        743,        743,        0,   152064, 0x43d796b5
-0,        772,        772,        0,   152064, 0xd780d887
-0,        800,        800,        0,   152064, 0x76d2a455
-0,        829,        829,        0,   152064, 0x6dc3650e
-0,        858,        858,        0,   152064, 0x0f9d6aca
-0,        887,        887,        0,   152064, 0xe295c51e
-0,        915,        915,        0,   152064, 0xd766fc8d
-0,        944,        944,        0,   152064, 0xe22f7a30
-0,        972,        972,        0,   152064, 0x7fea4378
-0,       1000,       1000,        0,   152064, 0xfa8d94fb
-0,       1029,       1029,        0,   152064, 0x4c9737ab
-0,       1057,       1057,        0,   152064, 0xa50d01f8
-0,       1085,       1085,        0,   152064, 0x0b07594c
-0,       1113,       1113,        0,   152064, 0x88734edd
-0,       1142,       1142,        0,   152064, 0xd2735925
-0,       1170,       1170,        0,   152064, 0xd4e49e08
-0,       1198,       1198,        0,   152064, 0x20cebfa9
-0,       1227,       1227,        0,   152064, 0x575c20ec
-0,       1255,       1255,        0,   152064, 0xfd500471
-0,       1284,       1284,        0,   152064, 0x61b47e73
-0,       1313,       1313,        0,   152064, 0x09ef53ff
-0,       1341,       1341,        0,   152064, 0x6e88c5c2
-0,       1370,       1370,        0,   152064, 0xbb87b483
-0,       1399,       1399,        0,   152064, 0x4bbad8ea
diff --git a/deps/libav/tests/ref/fate/filter-transpose b/deps/libav/tests/ref/fate/filter-transpose
deleted file mode 100644
index 0f23423..0000000
--- a/deps/libav/tests/ref/fate/filter-transpose
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xab5889ef
-0,          1,          1,        1,   152064, 0x898b6551
-0,          2,          2,        1,   152064, 0x231bf64a
-0,          3,          3,        1,   152064, 0x0b8c80b0
-0,          4,          4,        1,   152064, 0x8b3cb652
-0,          5,          5,        1,   152064, 0x0100a8e6
-0,          6,          6,        1,   152064, 0x55df7c23
-0,          7,          7,        1,   152064, 0x91bd8bac
-0,          8,          8,        1,   152064, 0xf5508026
-0,          9,          9,        1,   152064, 0xa7ec3915
-0,         10,         10,        1,   152064, 0x4e304760
-0,         11,         11,        1,   152064, 0x98ccfcd5
-0,         12,         12,        1,   152064, 0x00edad61
-0,         13,         13,        1,   152064, 0x01a0a223
-0,         14,         14,        1,   152064, 0x840e8ddd
-0,         15,         15,        1,   152064, 0x52280f05
-0,         16,         16,        1,   152064, 0x75064e18
-0,         17,         17,        1,   152064, 0xf41638c8
-0,         18,         18,        1,   152064, 0x258d6acc
-0,         19,         19,        1,   152064, 0x9d73dbff
-0,         20,         20,        1,   152064, 0x80e0f570
-0,         21,         21,        1,   152064, 0x3a912412
-0,         22,         22,        1,   152064, 0xaf241d59
-0,         23,         23,        1,   152064, 0xe73568ef
-0,         24,         24,        1,   152064, 0xc739f9d6
-0,         25,         25,        1,   152064, 0xc8c19936
-0,         26,         26,        1,   152064, 0x47dd96b5
-0,         27,         27,        1,   152064, 0x5329d887
-0,         28,         28,        1,   152064, 0x5b46a455
-0,         29,         29,        1,   152064, 0xfd8c650e
-0,         30,         30,        1,   152064, 0x85c86aca
-0,         31,         31,        1,   152064, 0x46a6c51e
-0,         32,         32,        1,   152064, 0x220dfc8d
-0,         33,         33,        1,   152064, 0xdbe27a30
-0,         34,         34,        1,   152064, 0xb8cc4378
-0,         35,         35,        1,   152064, 0xb6cf94fb
-0,         36,         36,        1,   152064, 0xeaa937ab
-0,         37,         37,        1,   152064, 0x335401f8
-0,         38,         38,        1,   152064, 0xdb3d594c
-0,         39,         39,        1,   152064, 0x211c4edd
-0,         40,         40,        1,   152064, 0xc3725925
-0,         41,         41,        1,   152064, 0x8f389e08
-0,         42,         42,        1,   152064, 0xc62cbfa9
-0,         43,         43,        1,   152064, 0x803820ec
-0,         44,         44,        1,   152064, 0x0d860471
-0,         45,         45,        1,   152064, 0xf6997e73
-0,         46,         46,        1,   152064, 0x6c2153ff
-0,         47,         47,        1,   152064, 0x1bb2c5c2
-0,         48,         48,        1,   152064, 0x39d1b483
-0,         49,         49,        1,   152064, 0x2b50d8ea
diff --git a/deps/libav/tests/ref/fate/filter-trim-duration b/deps/libav/tests/ref/fate/filter-trim-duration
deleted file mode 100644
index db74add..0000000
--- a/deps/libav/tests/ref/fate/filter-trim-duration
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,         10,         10,        1,   152064, 0xb45c4760
diff --git a/deps/libav/tests/ref/fate/filter-trim-frame b/deps/libav/tests/ref/fate/filter-trim-frame
deleted file mode 100644
index 1749afd..0000000
--- a/deps/libav/tests/ref/fate/filter-trim-frame
+++ /dev/null
@@ -1,8 +0,0 @@
-#tb 0: 1/25
-0,          3,          3,        1,   152064, 0xceb080b0
-0,          4,          4,        1,   152064, 0x473db652
-0,          5,          5,        1,   152064, 0x287da8e6
-0,          6,          6,        1,   152064, 0x68b47c23
-0,          7,          7,        1,   152064, 0xe9028bac
-0,          8,          8,        1,   152064, 0x28ff8026
-0,          9,          9,        1,   152064, 0x2d7c3915
diff --git a/deps/libav/tests/ref/fate/filter-trim-mixed b/deps/libav/tests/ref/fate/filter-trim-mixed
deleted file mode 100644
index 5e003f6..0000000
--- a/deps/libav/tests/ref/fate/filter-trim-mixed
+++ /dev/null
@@ -1,10 +0,0 @@
-#tb 0: 1/25
-0,          1,          1,        1,   152064, 0x7f5f6551
-0,          2,          2,        1,   152064, 0xc566f64a
-0,          3,          3,        1,   152064, 0xceb080b0
-0,          4,          4,        1,   152064, 0x473db652
-0,          5,          5,        1,   152064, 0x287da8e6
-0,          6,          6,        1,   152064, 0x68b47c23
-0,          7,          7,        1,   152064, 0xe9028bac
-0,          8,          8,        1,   152064, 0x28ff8026
-0,          9,          9,        1,   152064, 0x2d7c3915
diff --git a/deps/libav/tests/ref/fate/filter-trim-time b/deps/libav/tests/ref/fate/filter-trim-time
deleted file mode 100644
index 2f86025..0000000
--- a/deps/libav/tests/ref/fate/filter-trim-time
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x6e4f89ef
-0,          1,          1,        1,   152064, 0x7f5f6551
diff --git a/deps/libav/tests/ref/fate/filter-unsharp b/deps/libav/tests/ref/fate/filter-unsharp
deleted file mode 100644
index 5dcf40f..0000000
--- a/deps/libav/tests/ref/fate/filter-unsharp
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x19a94798
-0,          1,          1,        1,   152064, 0xc88b24f4
-0,          2,          2,        1,   152064, 0xd027b44b
-0,          3,          3,        1,   152064, 0xa9fb3e54
-0,          4,          4,        1,   152064, 0x2991747d
-0,          5,          5,        1,   152064, 0x1dc267fc
-0,          6,          6,        1,   152064, 0xe9063293
-0,          7,          7,        1,   152064, 0xc23e41a4
-0,          8,          8,        1,   152064, 0xaa433dc5
-0,          9,          9,        1,   152064, 0x22b0f0a3
-0,         10,         10,        1,   152064, 0x796d08d8
-0,         11,         11,        1,   152064, 0xa2babd6b
-0,         12,         12,        1,   152064, 0x531e6a62
-0,         13,         13,        1,   152064, 0xc8fa5b9d
-0,         14,         14,        1,   152064, 0x33e54ae8
-0,         15,         15,        1,   152064, 0x86dfd0b8
-0,         16,         16,        1,   152064, 0x101f1170
-0,         17,         17,        1,   152064, 0x230eef00
-0,         18,         18,        1,   152064, 0xa5ee1c5e
-0,         19,         19,        1,   152064, 0x241893c6
-0,         20,         20,        1,   152064, 0x86a0a883
-0,         21,         21,        1,   152064, 0x12b4d8f7
-0,         22,         22,        1,   152064, 0xb220d497
-0,         23,         23,        1,   152064, 0xbaea200e
-0,         24,         24,        1,   152064, 0x6d96b7f3
-0,         25,         25,        1,   152064, 0xc70d4ebb
-0,         26,         26,        1,   152064, 0x20df50af
-0,         27,         27,        1,   152064, 0xfce89174
-0,         28,         28,        1,   152064, 0x74be5c8e
-0,         29,         29,        1,   152064, 0x51f419a6
-0,         30,         30,        1,   152064, 0x790621e7
-0,         31,         31,        1,   152064, 0x37387da2
-0,         32,         32,        1,   152064, 0x8228baa4
-0,         33,         33,        1,   152064, 0xdd2a42b7
-0,         34,         34,        1,   152064, 0xa28bfc63
-0,         35,         35,        1,   152064, 0xe8284337
-0,         36,         36,        1,   152064, 0xb1dae9fe
-0,         37,         37,        1,   152064, 0x0378c0af
-0,         38,         38,        1,   152064, 0x79c514d4
-0,         39,         39,        1,   152064, 0x043e0347
-0,         40,         40,        1,   152064, 0x4d11131b
-0,         41,         41,        1,   152064, 0xb2a05924
-0,         42,         42,        1,   152064, 0xd0097464
-0,         43,         43,        1,   152064, 0x32dfd8c0
-0,         44,         44,        1,   152064, 0xd9ecbf03
-0,         45,         45,        1,   152064, 0x8dcc403f
-0,         46,         46,        1,   152064, 0x95e81af7
-0,         47,         47,        1,   152064, 0xb8018b25
-0,         48,         48,        1,   152064, 0xeecf7281
-0,         49,         49,        1,   152064, 0x23e49602
diff --git a/deps/libav/tests/ref/fate/filter-vflip b/deps/libav/tests/ref/fate/filter-vflip
deleted file mode 100644
index 66b8732..0000000
--- a/deps/libav/tests/ref/fate/filter-vflip
+++ /dev/null
@@ -1 +0,0 @@
-vflip               2e6d6062e8cad37fb3ab2c433b55f382
diff --git a/deps/libav/tests/ref/fate/filter-vflip_crop b/deps/libav/tests/ref/fate/filter-vflip_crop
deleted file mode 100644
index 6bb832f..0000000
--- a/deps/libav/tests/ref/fate/filter-vflip_crop
+++ /dev/null
@@ -1 +0,0 @@
-vflip_crop          72ee0d0dfc8af0cd94a466760313654d
diff --git a/deps/libav/tests/ref/fate/filter-vflip_vflip b/deps/libav/tests/ref/fate/filter-vflip_vflip
deleted file mode 100644
index b719745..0000000
--- a/deps/libav/tests/ref/fate/filter-vflip_vflip
+++ /dev/null
@@ -1 +0,0 @@
-vflip_vflip         eba2f135a08829387e2f698ff72a2939
diff --git a/deps/libav/tests/ref/fate/filter-yadif-mode0 b/deps/libav/tests/ref/fate/filter-yadif-mode0
deleted file mode 100644
index d2c14d3..0000000
--- a/deps/libav/tests/ref/fate/filter-yadif-mode0
+++ /dev/null
@@ -1,32 +0,0 @@
-#tb 0: 1/180000
-0,      64800,      64800,        0,   622080, 0x6331caee
-0,      72000,      72000,        0,   622080, 0xa459e690
-0,      79200,      79200,        0,   622080, 0x6429c648
-0,      86400,      86400,        0,   622080, 0xa49891ca
-0,      93600,      93600,        0,   622080, 0x2a887404
-0,     100800,     100800,        0,   622080, 0xe8d49705
-0,     108000,     108000,        0,   622080, 0x1b627835
-0,     115200,     115200,        0,   622080, 0x686858fd
-0,     122400,     122400,        0,   622080, 0x2675174f
-0,     129600,     129600,        0,   622080, 0x78470e7f
-0,     136800,     136800,        0,   622080, 0xffb366ec
-0,     144000,     144000,        0,   622080, 0xd575da72
-0,     151200,     151200,        0,   622080, 0x5fb297f7
-0,     158400,     158400,        0,   622080, 0xbac77ca0
-0,     165600,     165600,        0,   622080, 0x3276ed72
-0,     172800,     172800,        0,   622080, 0x264092b2
-0,     180000,     180000,        0,   622080, 0x20ba1094
-0,     187200,     187200,        0,   622080, 0x76cc3139
-0,     194400,     194400,        0,   622080, 0x469a4902
-0,     201600,     201600,        0,   622080, 0x0ed7b8f5
-0,     208800,     208800,        0,   622080, 0xdc51aeac
-0,     216000,     216000,        0,   622080, 0xee06aa36
-0,     223200,     223200,        0,   622080, 0x7372405f
-0,     230400,     230400,        0,   622080, 0x9e0ee776
-0,     237600,     237600,        0,   622080, 0x39e6d8c9
-0,     244800,     244800,        0,   622080, 0x51d9ac9a
-0,     252000,     252000,        0,   622080, 0x2b63441d
-0,     259200,     259200,        0,   622080, 0x58afbd5e
-0,     266400,     266400,        0,   622080, 0xb972f716
-0,     273600,     273600,        0,   622080, 0x6a6df129
-0,     280800,     280800,        0,   622080, 0x28b1373d
diff --git a/deps/libav/tests/ref/fate/filter-yadif-mode1 b/deps/libav/tests/ref/fate/filter-yadif-mode1
deleted file mode 100644
index ca5f290..0000000
--- a/deps/libav/tests/ref/fate/filter-yadif-mode1
+++ /dev/null
@@ -1,63 +0,0 @@
-#tb 0: 1/180000
-0,      64800,      64800,        0,   622080, 0x6331caee
-0,      68400,      68400,        0,   622080, 0x625da883
-0,      72000,      72000,        0,   622080, 0xa459e690
-0,      75600,      75600,        0,   622080, 0xce5d891e
-0,      79200,      79200,        0,   622080, 0x6429c648
-0,      82800,      82800,        0,   622080, 0x608cc0ba
-0,      86400,      86400,        0,   622080, 0xa49891ca
-0,      90000,      90000,        0,   622080, 0x9721987f
-0,      93600,      93600,        0,   622080, 0x2a887404
-0,      97200,      97200,        0,   622080, 0x60d71d47
-0,     100800,     100800,        0,   622080, 0xe8d49705
-0,     104400,     104400,        0,   622080, 0x821e13cb
-0,     108000,     108000,        0,   622080, 0x1b627835
-0,     111600,     111600,        0,   622080, 0x1806c5f4
-0,     115200,     115200,        0,   622080, 0x686858fd
-0,     118800,     118800,        0,   622080, 0xab865773
-0,     122400,     122400,        0,   622080, 0x2675174f
-0,     126000,     126000,        0,   622080, 0x43a61a14
-0,     129600,     129600,        0,   622080, 0x78470e7f
-0,     133200,     133200,        0,   622080, 0xeb877bc6
-0,     136800,     136800,        0,   622080, 0xffb366ec
-0,     140400,     140400,        0,   622080, 0xda0906e7
-0,     144000,     144000,        0,   622080, 0xd575da72
-0,     147600,     147600,        0,   622080, 0x23ae25a4
-0,     151200,     151200,        0,   622080, 0x5fb297f7
-0,     154800,     154800,        0,   622080, 0x99b32978
-0,     158400,     158400,        0,   622080, 0xbac77ca0
-0,     162000,     162000,        0,   622080, 0xc1cdcbf9
-0,     165600,     165600,        0,   622080, 0x3276ed72
-0,     169200,     169200,        0,   622080, 0x4061f5ab
-0,     172800,     172800,        0,   622080, 0x264092b2
-0,     176400,     176400,        0,   622080, 0xa4e2039e
-0,     180000,     180000,        0,   622080, 0x20ba1094
-0,     183600,     183600,        0,   622080, 0x984e906e
-0,     187200,     187200,        0,   622080, 0x76cc3139
-0,     190800,     190800,        0,   622080, 0xf70e2cf6
-0,     194400,     194400,        0,   622080, 0x469a4902
-0,     198000,     198000,        0,   622080, 0x235312e6
-0,     201600,     201600,        0,   622080, 0x0ed7b8f5
-0,     205200,     205200,        0,   622080, 0xd0269cc3
-0,     208800,     208800,        0,   622080, 0xdc51aeac
-0,     212400,     212400,        0,   622080, 0x1aa5f76e
-0,     216000,     216000,        0,   622080, 0xee06aa36
-0,     219600,     219600,        0,   622080, 0xa7103230
-0,     223200,     223200,        0,   622080, 0x7372405f
-0,     226800,     226800,        0,   622080, 0x8d7a44b5
-0,     230400,     230400,        0,   622080, 0x9e0ee776
-0,     234000,     234000,        0,   622080, 0xd41e8560
-0,     237600,     237600,        0,   622080, 0x39e6d8c9
-0,     241200,     241200,        0,   622080, 0x7a23d70c
-0,     244800,     244800,        0,   622080, 0x51d9ac9a
-0,     248400,     248400,        0,   622080, 0x8eacf7f2
-0,     252000,     252000,        0,   622080, 0x2b63441d
-0,     255600,     255600,        0,   622080, 0x9f71b742
-0,     259200,     259200,        0,   622080, 0x58afbd5e
-0,     262800,     262800,        0,   622080, 0x4d645292
-0,     266400,     266400,        0,   622080, 0xb972f716
-0,     270000,     270000,        0,   622080, 0xbb5d01a2
-0,     273600,     273600,        0,   622080, 0x6a6df129
-0,     277200,     277200,        0,   622080, 0x9e45371e
-0,     280800,     280800,        0,   622080, 0x28b1373d
-0,     284400,     284400,        0,   622080, 0xa1cdb1f2
diff --git a/deps/libav/tests/ref/fate/flic-af11-palette-change b/deps/libav/tests/ref/fate/flic-af11-palette-change
deleted file mode 100644
index 61e6c1d..0000000
--- a/deps/libav/tests/ref/fate/flic-af11-palette-change
+++ /dev/null
@@ -1,117 +0,0 @@
-#tb 0: 1/35
-0,          0,          0,        1,   192000, 0x64da83e8
-0,          1,          1,        1,   192000, 0xf59ccccc
-0,          2,          2,        1,   192000, 0xaaa06c5c
-0,          3,          3,        1,   192000, 0xa98f82c0
-0,          4,          4,        1,   192000, 0x164fbbdc
-0,          5,          5,        1,   192000, 0x0b3abc0c
-0,          6,          6,        1,   192000, 0x47661943
-0,          7,          7,        1,   192000, 0x30711074
-0,          8,          8,        1,   192000, 0x67684a84
-0,          9,          9,        1,   192000, 0x1d9afa70
-0,         10,         10,        1,   192000, 0x4fd28e78
-0,         11,         11,        1,   192000, 0x9bc5c8cc
-0,         12,         12,        1,   192000, 0xcf268b6c
-0,         13,         13,        1,   192000, 0xdfe65fd4
-0,         14,         14,        1,   192000, 0x47e75404
-0,         15,         15,        1,   192000, 0xb3b5b448
-0,         16,         16,        1,   192000, 0x826c94b4
-0,         17,         17,        1,   192000, 0x158e95f8
-0,         18,         18,        1,   192000, 0x576f031f
-0,         19,         19,        1,   192000, 0xea3399e8
-0,         20,         20,        1,   192000, 0x76b1e224
-0,         21,         21,        1,   192000, 0x290073db
-0,         22,         22,        1,   192000, 0x83741abf
-0,         23,         23,        1,   192000, 0x50f9c4ec
-0,         24,         24,        1,   192000, 0x6d8fdac0
-0,         25,         25,        1,   192000, 0xe26e2600
-0,         26,         26,        1,   192000, 0xbeb0e11c
-0,         27,         27,        1,   192000, 0x38282fd4
-0,         28,         28,        1,   192000, 0x13d0b790
-0,         29,         29,        1,   192000, 0x0cf8fca9
-0,         30,         30,        1,   192000, 0x64da83e8
-0,         31,         31,        1,   192000, 0xf59ccccc
-0,         32,         32,        1,   192000, 0xaaa06c5c
-0,         33,         33,        1,   192000, 0xa98f82c0
-0,         34,         34,        1,   192000, 0x164fbbdc
-0,         35,         35,        1,   192000, 0x0b3abc0c
-0,         36,         36,        1,   192000, 0x47661943
-0,         37,         37,        1,   192000, 0x30711074
-0,         38,         38,        1,   192000, 0x67684a84
-0,         39,         39,        1,   192000, 0x1d9afa70
-0,         40,         40,        1,   192000, 0x4fd28e78
-0,         41,         41,        1,   192000, 0x9bc5c8cc
-0,         42,         42,        1,   192000, 0xcf268b6c
-0,         43,         43,        1,   192000, 0xdfe65fd4
-0,         44,         44,        1,   192000, 0x47e75404
-0,         45,         45,        1,   192000, 0xb3b5b448
-0,         46,         46,        1,   192000, 0x826c94b4
-0,         47,         47,        1,   192000, 0x158e95f8
-0,         48,         48,        1,   192000, 0x576f031f
-0,         49,         49,        1,   192000, 0xea3399e8
-0,         50,         50,        1,   192000, 0x76b1e224
-0,         51,         51,        1,   192000, 0x290073db
-0,         52,         52,        1,   192000, 0x83741abf
-0,         53,         53,        1,   192000, 0x50f9c4ec
-0,         54,         54,        1,   192000, 0x6d8fdac0
-0,         55,         55,        1,   192000, 0xe26e2600
-0,         56,         56,        1,   192000, 0xbeb0e11c
-0,         57,         57,        1,   192000, 0x38282fd4
-0,         58,         58,        1,   192000, 0x13d0b790
-0,         59,         59,        1,   192000, 0x0cf8fca9
-0,         60,         60,        1,   192000, 0x64da83e8
-0,         61,         61,        1,   192000, 0xf59ccccc
-0,         62,         62,        1,   192000, 0xaaa06c5c
-0,         63,         63,        1,   192000, 0xa98f82c0
-0,         64,         64,        1,   192000, 0x164fbbdc
-0,         65,         65,        1,   192000, 0x0b3abc0c
-0,         66,         66,        1,   192000, 0x47661943
-0,         67,         67,        1,   192000, 0x30711074
-0,         68,         68,        1,   192000, 0x67684a84
-0,         69,         69,        1,   192000, 0x1d9afa70
-0,         70,         70,        1,   192000, 0x4fd28e78
-0,         71,         71,        1,   192000, 0x9bc5c8cc
-0,         72,         72,        1,   192000, 0xcf268b6c
-0,         73,         73,        1,   192000, 0xdfe65fd4
-0,         74,         74,        1,   192000, 0x47e75404
-0,         75,         75,        1,   192000, 0xb3b5b448
-0,         76,         76,        1,   192000, 0x826c94b4
-0,         77,         77,        1,   192000, 0x158e95f8
-0,         78,         78,        1,   192000, 0x576f031f
-0,         79,         79,        1,   192000, 0xea3399e8
-0,         80,         80,        1,   192000, 0x76b1e224
-0,         81,         81,        1,   192000, 0x290073db
-0,         82,         82,        1,   192000, 0x83741abf
-0,         83,         83,        1,   192000, 0x50f9c4ec
-0,         84,         84,        1,   192000, 0x6d8fdac0
-0,         85,         85,        1,   192000, 0xe26e2600
-0,         86,         86,        1,   192000, 0xbeb0e11c
-0,         87,         87,        1,   192000, 0x38282fd4
-0,         88,         88,        1,   192000, 0x13d0b790
-0,         89,         89,        1,   192000, 0x0cf8fca9
-0,         90,         90,        1,   192000, 0xfcb10883
-0,         91,         91,        1,   192000, 0xfcb10883
-0,         92,         92,        1,   192000, 0xd0ba80c4
-0,         93,         93,        1,   192000, 0xd0ba80c4
-0,         94,         94,        1,   192000, 0x690520d9
-0,         95,         95,        1,   192000, 0x690520d9
-0,         96,         96,        1,   192000, 0x5b621c3f
-0,         97,         97,        1,   192000, 0x5b621c3f
-0,         98,         98,        1,   192000, 0x689e231f
-0,         99,         99,        1,   192000, 0x689e231f
-0,        100,        100,        1,   192000, 0x20653ff2
-0,        101,        101,        1,   192000, 0x20653ff2
-0,        102,        102,        1,   192000, 0xc18b3231
-0,        103,        103,        1,   192000, 0xc18b3231
-0,        104,        104,        1,   192000, 0x6d87ec3d
-0,        105,        105,        1,   192000, 0x6d87ec3d
-0,        106,        106,        1,   192000, 0x1c5b53d6
-0,        107,        107,        1,   192000, 0x1c5b53d6
-0,        108,        108,        1,   192000, 0x152fdf12
-0,        109,        109,        1,   192000, 0xde187291
-0,        110,        110,        1,   192000, 0x167617a5
-0,        111,        111,        1,   192000, 0x5067b8de
-0,        112,        112,        1,   192000, 0xd02ae54e
-0,        113,        113,        1,   192000, 0x0d6e9402
-0,        114,        114,        1,   192000, 0xa8e98616
-0,        115,        115,        1,   192000, 0x04762d1a
diff --git a/deps/libav/tests/ref/fate/flic-af12 b/deps/libav/tests/ref/fate/flic-af12
deleted file mode 100644
index 227f26a..0000000
--- a/deps/libav/tests/ref/fate/flic-af12
+++ /dev/null
@@ -1,28 +0,0 @@
-#tb 0: 9/125
-0,          0,          0,        1,   921600, 0x50a87396
-0,          1,          1,        1,   921600, 0xa6e65d9e
-0,          2,          2,        1,   921600, 0x05956f62
-0,          3,          3,        1,   921600, 0xffd6a5d7
-0,          4,          4,        1,   921600, 0xaab0a179
-0,          5,          5,        1,   921600, 0x289db2db
-0,          6,          6,        1,   921600, 0x3d3840cf
-0,          7,          7,        1,   921600, 0xec0a4142
-0,          8,          8,        1,   921600, 0x713a9f65
-0,          9,          9,        1,   921600, 0x28a8f0cd
-0,         10,         10,        1,   921600, 0x0fd95ba9
-0,         11,         11,        1,   921600, 0xa744bdfd
-0,         12,         12,        1,   921600, 0x3cdea2a5
-0,         13,         13,        1,   921600, 0xe7d671e4
-0,         14,         14,        1,   921600, 0x75824cdf
-0,         15,         15,        1,   921600, 0x82067d95
-0,         16,         16,        1,   921600, 0xee143a4c
-0,         17,         17,        1,   921600, 0xa53d3f2b
-0,         18,         18,        1,   921600, 0xb491c0c5
-0,         19,         19,        1,   921600, 0x6aaaef07
-0,         20,         20,        1,   921600, 0xad23cca8
-0,         21,         21,        1,   921600, 0xdce91bd8
-0,         22,         22,        1,   921600, 0x1a1499bc
-0,         23,         23,        1,   921600, 0x4cbe505a
-0,         24,         24,        1,   921600, 0x24006f65
-0,         25,         25,        1,   921600, 0x0711906e
-0,         26,         26,        1,   921600, 0x50a87396
diff --git a/deps/libav/tests/ref/fate/flic-magiccarpet b/deps/libav/tests/ref/fate/flic-magiccarpet
deleted file mode 100644
index f0faf1d..0000000
--- a/deps/libav/tests/ref/fate/flic-magiccarpet
+++ /dev/null
@@ -1,43 +0,0 @@
-#tb 0: 1/14
-0,          0,          0,        1,   192000, 0x00000000
-0,          1,          1,        1,   192000, 0x9c057d9c
-0,          2,          2,        1,   192000, 0xab1aacaf
-0,          3,          3,        1,   192000, 0x49a1dccd
-0,          4,          4,        1,   192000, 0xebb7e245
-0,          5,          5,        1,   192000, 0x6287759e
-0,          6,          6,        1,   192000, 0xbf007410
-0,          7,          7,        1,   192000, 0x6c72b247
-0,          8,          8,        1,   192000, 0x4c26a8c3
-0,          9,          9,        1,   192000, 0x99f06050
-0,         10,         10,        1,   192000, 0x663f2d23
-0,         11,         11,        1,   192000, 0x813c3a1f
-0,         12,         12,        1,   192000, 0x6d6cfbe7
-0,         13,         13,        1,   192000, 0x7b04163a
-0,         14,         14,        1,   192000, 0x6792e679
-0,         15,         15,        1,   192000, 0x939ac626
-0,         16,         16,        1,   192000, 0xc7a139c0
-0,         17,         17,        1,   192000, 0xcac7ef0c
-0,         18,         18,        1,   192000, 0xf4ec59e0
-0,         19,         19,        1,   192000, 0x56060f59
-0,         20,         20,        1,   192000, 0xf45ecb3b
-0,         21,         21,        1,   192000, 0xe7e634ff
-0,         22,         22,        1,   192000, 0x7ac04aa4
-0,         23,         23,        1,   192000, 0x4eaba5a1
-0,         24,         24,        1,   192000, 0x89b84e25
-0,         25,         25,        1,   192000, 0xc368ec1e
-0,         26,         26,        1,   192000, 0xeeafb59e
-0,         27,         27,        1,   192000, 0x0b630619
-0,         28,         28,        1,   192000, 0x59cb8954
-0,         29,         29,        1,   192000, 0x16b2875f
-0,         30,         30,        1,   192000, 0x524e32bd
-0,         31,         31,        1,   192000, 0x96000ba2
-0,         32,         32,        1,   192000, 0x18ec28af
-0,         33,         33,        1,   192000, 0x2609c56c
-0,         34,         34,        1,   192000, 0xff25bb5a
-0,         35,         35,        1,   192000, 0xb19a8819
-0,         36,         36,        1,   192000, 0xa5ff8727
-0,         37,         37,        1,   192000, 0xe83f6289
-0,         38,         38,        1,   192000, 0xc6cb4903
-0,         39,         39,        1,   192000, 0xa4d93eb5
-0,         40,         40,        1,   192000, 0xec84ef6c
-0,         41,         41,        1,   192000, 0x00000000
diff --git a/deps/libav/tests/ref/fate/fraps-v0 b/deps/libav/tests/ref/fate/fraps-v0
deleted file mode 100644
index 3cba831..0000000
--- a/deps/libav/tests/ref/fate/fraps-v0
+++ /dev/null
@@ -1,21 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   101088, 0x7bf448f8
-0,          1,          1,        1,   101088, 0x1ba749ec
-0,          2,          2,        1,   101088, 0x94eb4dc4
-0,          3,          3,        1,   101088, 0xd80b4f54
-0,          4,          4,        1,   101088, 0x6fd44fff
-0,          5,          5,        1,   101088, 0xf30e4f12
-0,          6,          6,        1,   101088, 0x67a04fef
-0,          7,          7,        1,   101088, 0xd92b4f8e
-0,          8,          8,        1,   101088, 0x92cd4cde
-0,          9,          9,        1,   101088, 0x93a34973
-0,         10,         10,        1,   101088, 0x79a646cb
-0,         11,         11,        1,   101088, 0x5d9c4227
-0,         12,         12,        1,   101088, 0x239941ff
-0,         13,         13,        1,   101088, 0x147e11de
-0,         14,         14,        1,   101088, 0x3943cbd5
-0,         15,         15,        1,   101088, 0x2ce1c01f
-0,         16,         16,        1,   101088, 0xe0b7ec06
-0,         17,         17,        1,   101088, 0xfe5b9baa
-0,         18,         18,        1,   101088, 0x9acb4d37
-0,         19,         19,        1,   101088, 0xbdbd9af5
diff --git a/deps/libav/tests/ref/fate/fraps-v1 b/deps/libav/tests/ref/fate/fraps-v1
deleted file mode 100644
index 29c7e37..0000000
--- a/deps/libav/tests/ref/fate/fraps-v1
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   230400, 0x23c29d17
diff --git a/deps/libav/tests/ref/fate/fraps-v2 b/deps/libav/tests/ref/fate/fraps-v2
deleted file mode 100644
index 1ebfb7c..0000000
--- a/deps/libav/tests/ref/fate/fraps-v2
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,  1179648, 0x99f80436
-0,          1,          1,        1,  1179648, 0x99f80436
-0,          2,          2,        1,  1179648, 0x99f80436
-0,          3,          3,        1,  1179648, 0x99f80436
-0,          4,          4,        1,  1179648, 0x99f80436
-0,          5,          5,        1,  1179648, 0xe8ae7a30
-0,          6,          6,        1,  1179648, 0xe8ae7a30
-0,          7,          7,        1,  1179648, 0xe8ae7a30
-0,          8,          8,        1,  1179648, 0xe8ae7a30
-0,          9,          9,        1,  1179648, 0xe8ae7a30
diff --git a/deps/libav/tests/ref/fate/fraps-v3 b/deps/libav/tests/ref/fate/fraps-v3
deleted file mode 100644
index ac8b701..0000000
--- a/deps/libav/tests/ref/fate/fraps-v3
+++ /dev/null
@@ -1,10 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   589824, 0x0b181bbf
-0,          1,          1,        1,   589824, 0xcd740f79
-0,          2,          2,        1,   589824, 0x16f8f90e
-0,          3,          3,        1,   589824, 0x1aaaceba
-0,          4,          4,        1,   589824, 0x1aaaceba
-0,          5,          5,        1,   589824, 0x902e8fe4
-0,          6,          6,        1,   589824, 0x019a4443
-0,          7,          7,        1,   589824, 0x019a4443
-0,          8,          8,        1,   589824, 0x04eff6c6
diff --git a/deps/libav/tests/ref/fate/fraps-v4 b/deps/libav/tests/ref/fate/fraps-v4
deleted file mode 100644
index 007916d..0000000
--- a/deps/libav/tests/ref/fate/fraps-v4
+++ /dev/null
@@ -1,8 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   491520, 0x68ff12c0
-0,          1,          1,        1,   491520, 0x22d36f0d
-0,          2,          2,        1,   491520, 0xce6f877d
-0,          3,          3,        1,   491520, 0x85d6744c
-0,          4,          4,        1,   491520, 0x1aa85794
-0,          5,          5,        1,   491520, 0x528d1274
-0,          6,          6,        1,   491520, 0x357ec61c
diff --git a/deps/libav/tests/ref/fate/fraps-v5 b/deps/libav/tests/ref/fate/fraps-v5
deleted file mode 100644
index 599683a..0000000
--- a/deps/libav/tests/ref/fate/fraps-v5
+++ /dev/null
@@ -1,59 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   145152, 0x8458d4cb
-0,          1,          1,        1,   145152, 0xa694d7c7
-0,          2,          2,        1,   145152, 0x2bd4bfc9
-0,          3,          3,        1,   145152, 0xe53b1616
-0,          4,          4,        1,   145152, 0x6a0a806a
-0,          5,          5,        1,   145152, 0x45f7b8e6
-0,          6,          6,        1,   145152, 0x4e14150e
-0,          7,          7,        1,   145152, 0xe1cd9b6f
-0,          8,          8,        1,   145152, 0x5b5802d7
-0,          9,          9,        1,   145152, 0xb03da5e7
-0,         10,         10,        1,   145152, 0x3436b06e
-0,         11,         11,        1,   145152, 0x4535e638
-0,         12,         12,        1,   145152, 0x72934af1
-0,         13,         13,        1,   145152, 0xb672d459
-0,         14,         14,        1,   145152, 0xab57491b
-0,         15,         15,        1,   145152, 0xdbac3480
-0,         16,         16,        1,   145152, 0x54215962
-0,         17,         17,        1,   145152, 0x451f456e
-0,         18,         18,        1,   145152, 0xa17655d1
-0,         19,         19,        1,   145152, 0xce95422c
-0,         20,         20,        1,   145152, 0xe0ee8e77
-0,         21,         21,        1,   145152, 0xdaabe277
-0,         22,         22,        1,   145152, 0xc21bb665
-0,         23,         23,        1,   145152, 0x1e74270e
-0,         24,         24,        1,   145152, 0xae7bac5f
-0,         25,         25,        1,   145152, 0xf62442ed
-0,         26,         26,        1,   145152, 0x5c8d8984
-0,         27,         27,        1,   145152, 0x97a69fe7
-0,         28,         28,        1,   145152, 0x1f244d19
-0,         29,         29,        1,   145152, 0x2758bc25
-0,         30,         30,        1,   145152, 0xf43ddb89
-0,         31,         31,        1,   145152, 0x086a524e
-0,         32,         32,        1,   145152, 0x8b464d4d
-0,         33,         33,        1,   145152, 0xb77b63d2
-0,         34,         34,        1,   145152, 0xfd842fa8
-0,         35,         35,        1,   145152, 0xa98b6dbe
-0,         36,         36,        1,   145152, 0xdedbab2c
-0,         37,         37,        1,   145152, 0x24e19172
-0,         38,         38,        1,   145152, 0x1ef456f6
-0,         39,         39,        1,   145152, 0xaceabdf0
-0,         40,         40,        1,   145152, 0xb54de3d9
-0,         41,         41,        1,   145152, 0x3af0df9b
-0,         42,         42,        1,   145152, 0xf89fbd9a
-0,         43,         43,        1,   145152, 0xc6a9673c
-0,         44,         44,        1,   145152, 0x6d5a929e
-0,         45,         45,        1,   145152, 0x879e7d9b
-0,         46,         46,        1,   145152, 0x233c14eb
-0,         47,         47,        1,   145152, 0x8246f081
-0,         48,         48,        1,   145152, 0x3366c4bf
-0,         49,         49,        1,   145152, 0x6b0203da
-0,         50,         50,        1,   145152, 0x48a00163
-0,         51,         51,        1,   145152, 0xe956ac2c
-0,         52,         52,        1,   145152, 0xa2511283
-0,         53,         53,        1,   145152, 0x7e03222d
-0,         54,         54,        1,   145152, 0xc31a7a40
-0,         55,         55,        1,   145152, 0x80448031
-0,         56,         56,        1,   145152, 0xe3b1fbf7
-0,         57,         57,        1,   145152, 0xa00395a4
diff --git a/deps/libav/tests/ref/fate/frwu b/deps/libav/tests/ref/fate/frwu
deleted file mode 100644
index 32eaa6f..0000000
--- a/deps/libav/tests/ref/fate/frwu
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,   153600, 0x050422c0
-0,          1,          1,        1,   153600, 0x0cf35359
-0,          2,          2,        1,   153600, 0x2ae95db0
-0,          3,          3,        1,   153600, 0x8c855b14
-0,          4,          4,        1,   153600, 0xc7a890b4
-0,          5,          5,        1,   153600, 0x755bed3b
-0,          6,          6,        1,   153600, 0x454a4e27
-0,          7,          7,        1,   153600, 0xdc3eaecb
-0,          8,          8,        1,   153600, 0x190f9a82
-0,          9,          9,        1,   153600, 0x4f67511f
diff --git a/deps/libav/tests/ref/fate/g722-encode b/deps/libav/tests/ref/fate/g722-encode
deleted file mode 100644
index c7198cf..0000000
--- a/deps/libav/tests/ref/fate/g722-encode
+++ /dev/null
@@ -1 +0,0 @@
-MD5=7106189574186051c0497b287e2e5f19
diff --git a/deps/libav/tests/ref/fate/g722dec-1 b/deps/libav/tests/ref/fate/g722dec-1
deleted file mode 100644
index e94c3e6..0000000
--- a/deps/libav/tests/ref/fate/g722dec-1
+++ /dev/null
@@ -1,168 +0,0 @@
-#tb 0: 1/16000
-0,          0,          0,     2048,     4096, 0x4f9228b3
-0,       2048,       2048,     2048,     4096, 0xfab58157
-0,       4096,       4096,     2048,     4096, 0x0b641c78
-0,       6144,       6144,     2048,     4096, 0x601c6803
-0,       8192,       8192,     2048,     4096, 0xb3e2f166
-0,      10240,      10240,     2048,     4096, 0x5681f206
-0,      12288,      12288,     2048,     4096, 0x1e69e71f
-0,      14336,      14336,     2048,     4096, 0x05628be3
-0,      16384,      16384,     2048,     4096, 0x109b1aef
-0,      18432,      18432,     2048,     4096, 0xd5435a9e
-0,      20480,      20480,     2048,     4096, 0xb38b5d28
-0,      22528,      22528,     2048,     4096, 0x64514c93
-0,      24576,      24576,     2048,     4096, 0x453350e7
-0,      26624,      26624,     2048,     4096, 0x6deccce6
-0,      28672,      28672,     2048,     4096, 0xd427ede1
-0,      30720,      30720,     2048,     4096, 0xdecb8c42
-0,      32768,      32768,     2048,     4096, 0x3841e4d2
-0,      34816,      34816,     2048,     4096, 0x858ac1b1
-0,      36864,      36864,     2048,     4096, 0x8e9dbfa0
-0,      38912,      38912,     2048,     4096, 0xcbc0766f
-0,      40960,      40960,     2048,     4096, 0x78d52555
-0,      43008,      43008,     2048,     4096, 0x600ac7d5
-0,      45056,      45056,     2048,     4096, 0xafadb7ee
-0,      47104,      47104,     2048,     4096, 0x8009d5a1
-0,      49152,      49152,     2048,     4096, 0xb07d475e
-0,      51200,      51200,     2048,     4096, 0xfcfecceb
-0,      53248,      53248,     2048,     4096, 0x38b5d85f
-0,      55296,      55296,     2048,     4096, 0xbd48072e
-0,      57344,      57344,     2048,     4096, 0xd04724d8
-0,      59392,      59392,     2048,     4096, 0x08425144
-0,      61440,      61440,     2048,     4096, 0x7b14483e
-0,      63488,      63488,     2048,     4096, 0x8858ef4c
-0,      65536,      65536,     2048,     4096, 0x1e3024c2
-0,      67584,      67584,     2048,     4096, 0xcd6bfe4f
-0,      69632,      69632,     2048,     4096, 0x8cde8d18
-0,      71680,      71680,     2048,     4096, 0xbbd856b8
-0,      73728,      73728,     2048,     4096, 0x988c9b7a
-0,      75776,      75776,     2048,     4096, 0x2a858e03
-0,      77824,      77824,     2048,     4096, 0x6dee1e4a
-0,      79872,      79872,     2048,     4096, 0x8cc38b41
-0,      81920,      81920,     2048,     4096, 0x48bd5cec
-0,      83968,      83968,     2048,     4096, 0xeb7f606b
-0,      86016,      86016,     2048,     4096, 0x75f5d28c
-0,      88064,      88064,     2048,     4096, 0x5bfeec4b
-0,      90112,      90112,     2048,     4096, 0xfc35c22a
-0,      92160,      92160,     2048,     4096, 0x3a95efba
-0,      94208,      94208,     2048,     4096, 0xefdbce9c
-0,      96256,      96256,     2048,     4096, 0x00594ada
-0,      98304,      98304,     2048,     4096, 0x20ffebfa
-0,     100352,     100352,     2048,     4096, 0x1b31370a
-0,     102400,     102400,     2048,     4096, 0x50766a56
-0,     104448,     104448,     2048,     4096, 0x0058315a
-0,     106496,     106496,     2048,     4096, 0x98090cbf
-0,     108544,     108544,     2048,     4096, 0x66ed2d40
-0,     110592,     110592,     2048,     4096, 0xdfd7c0a7
-0,     112640,     112640,     2048,     4096, 0x2adc57e1
-0,     114688,     114688,     2048,     4096, 0x838bbc82
-0,     116736,     116736,     2048,     4096, 0x2c55de1a
-0,     118784,     118784,     2048,     4096, 0xeae027f4
-0,     120832,     120832,     2048,     4096, 0x09fe00f6
-0,     122880,     122880,     2048,     4096, 0xa25d9970
-0,     124928,     124928,     2048,     4096, 0xedb11a20
-0,     126976,     126976,     2048,     4096, 0x9ce2e63e
-0,     129024,     129024,     2048,     4096, 0xeb699974
-0,     131072,     131072,     2048,     4096, 0xcc04a296
-0,     133120,     133120,     2048,     4096, 0xe90e9a12
-0,     135168,     135168,     2048,     4096, 0xae85c0f7
-0,     137216,     137216,     2048,     4096, 0x7ee877db
-0,     139264,     139264,     2048,     4096, 0x9ecf14ee
-0,     141312,     141312,     2048,     4096, 0xa821cecd
-0,     143360,     143360,     2048,     4096, 0x2714bb11
-0,     145408,     145408,     2048,     4096, 0x28f1c1e0
-0,     147456,     147456,     2048,     4096, 0xf81c4f60
-0,     149504,     149504,     2048,     4096, 0x1ae0e5a1
-0,     151552,     151552,     2048,     4096, 0xbdae9d9a
-0,     153600,     153600,     2048,     4096, 0x5202e560
-0,     155648,     155648,     2048,     4096, 0x82408396
-0,     157696,     157696,     2048,     4096, 0xc850ce0c
-0,     159744,     159744,     2048,     4096, 0x1d732d88
-0,     161792,     161792,     2048,     4096, 0xc5c01e33
-0,     163840,     163840,     2048,     4096, 0x84942d6c
-0,     165888,     165888,     2048,     4096, 0x7c27cd3a
-0,     167936,     167936,     2048,     4096, 0x22adc503
-0,     169984,     169984,     2048,     4096, 0xfbc3af31
-0,     172032,     172032,     2048,     4096, 0xe9652b18
-0,     174080,     174080,     2048,     4096, 0xae75987e
-0,     176128,     176128,     2048,     4096, 0x0f7ea428
-0,     178176,     178176,     2048,     4096, 0x92b89582
-0,     180224,     180224,     2048,     4096, 0xf393d910
-0,     182272,     182272,     2048,     4096, 0x6349b600
-0,     184320,     184320,     2048,     4096, 0x16918dbd
-0,     186368,     186368,     2048,     4096, 0x14ee15ad
-0,     188416,     188416,     2048,     4096, 0x26b510d3
-0,     190464,     190464,     2048,     4096, 0x97007bf8
-0,     192512,     192512,     2048,     4096, 0x3718c509
-0,     194560,     194560,     2048,     4096, 0x24a54ccd
-0,     196608,     196608,     2048,     4096, 0xc960df4e
-0,     198656,     198656,     2048,     4096, 0xc7cb6e6f
-0,     200704,     200704,     2048,     4096, 0x4c563ae5
-0,     202752,     202752,     2048,     4096, 0x0dd51432
-0,     204800,     204800,     2048,     4096, 0xdb4243c8
-0,     206848,     206848,     2048,     4096, 0x9bb6417f
-0,     208896,     208896,     2048,     4096, 0xec6a40a1
-0,     210944,     210944,     2048,     4096, 0x82d6c3b4
-0,     212992,     212992,     2048,     4096, 0xd181e2ec
-0,     215040,     215040,     2048,     4096, 0xba5d7b55
-0,     217088,     217088,     2048,     4096, 0x78fcb938
-0,     219136,     219136,     2048,     4096, 0x6691671c
-0,     221184,     221184,     2048,     4096, 0x44fadee7
-0,     223232,     223232,     2048,     4096, 0xa42720d5
-0,     225280,     225280,     2048,     4096, 0xc1165a91
-0,     227328,     227328,     2048,     4096, 0x86aa3e3f
-0,     229376,     229376,     2048,     4096, 0xab5ae57d
-0,     231424,     231424,     2048,     4096, 0x291a91f3
-0,     233472,     233472,     2048,     4096, 0xfdf0dcfc
-0,     235520,     235520,     2048,     4096, 0x1ef91f67
-0,     237568,     237568,     2048,     4096, 0xc899efee
-0,     239616,     239616,     2048,     4096, 0x5ade15ac
-0,     241664,     241664,     2048,     4096, 0x04516beb
-0,     243712,     243712,     2048,     4096, 0xbf5ebbb9
-0,     245760,     245760,     2048,     4096, 0x4a235122
-0,     247808,     247808,     2048,     4096, 0xd7a3f4a6
-0,     249856,     249856,     2048,     4096, 0x5f900f20
-0,     251904,     251904,     2048,     4096, 0xa90b4365
-0,     253952,     253952,     2048,     4096, 0x63149dc4
-0,     256000,     256000,     2048,     4096, 0xf12c1ee8
-0,     258048,     258048,     2048,     4096, 0x6d0fec8c
-0,     260096,     260096,     2048,     4096, 0x65e07850
-0,     262144,     262144,     2048,     4096, 0x16d951cc
-0,     264192,     264192,     2048,     4096, 0xd296d0c4
-0,     266240,     266240,     2048,     4096, 0x619b2a53
-0,     268288,     268288,     2048,     4096, 0x316972d5
-0,     270336,     270336,     2048,     4096, 0xcfd64e21
-0,     272384,     272384,     2048,     4096, 0xcbcb10c6
-0,     274432,     274432,     2048,     4096, 0x20aeff7c
-0,     276480,     276480,     2048,     4096, 0xd205dabd
-0,     278528,     278528,     2048,     4096, 0xac9d3001
-0,     280576,     280576,     2048,     4096, 0x6d53dfdd
-0,     282624,     282624,     2048,     4096, 0xbb9fe15c
-0,     284672,     284672,     2048,     4096, 0x1852b88b
-0,     286720,     286720,     2048,     4096, 0xb0acec01
-0,     288768,     288768,     2048,     4096, 0xb52a9342
-0,     290816,     290816,     2048,     4096, 0x7529faee
-0,     292864,     292864,     2048,     4096, 0x150ff449
-0,     294912,     294912,     2048,     4096, 0xa81d31d9
-0,     296960,     296960,     2048,     4096, 0xbcb8084a
-0,     299008,     299008,     2048,     4096, 0x07229514
-0,     301056,     301056,     2048,     4096, 0xa85cfd88
-0,     303104,     303104,     2048,     4096, 0x0aef9c27
-0,     305152,     305152,     2048,     4096, 0x8ec47b39
-0,     307200,     307200,     2048,     4096, 0x910b0560
-0,     309248,     309248,     2048,     4096, 0x99a8578e
-0,     311296,     311296,     2048,     4096, 0xb3df1d84
-0,     313344,     313344,     2048,     4096, 0x48e52559
-0,     315392,     315392,     2048,     4096, 0xb25c4800
-0,     317440,     317440,     2048,     4096, 0x913bc8ce
-0,     319488,     319488,     2048,     4096, 0xb736cc8c
-0,     321536,     321536,     2048,     4096, 0x13c66646
-0,     323584,     323584,     2048,     4096, 0x70a71221
-0,     325632,     325632,     2048,     4096, 0x3a50a08e
-0,     327680,     327680,     2048,     4096, 0xc0a037b0
-0,     329728,     329728,     2048,     4096, 0x9a789475
-0,     331776,     331776,     2048,     4096, 0xc890ca16
-0,     333824,     333824,     2048,     4096, 0xa0d34bed
-0,     335872,     335872,     2048,     4096, 0x1689fa60
-0,     337920,     337920,     2048,     4096, 0x5bac4c83
-0,     339968,     339968,      684,     1368, 0x904be5e5
diff --git a/deps/libav/tests/ref/fate/g723_1-dec-1 b/deps/libav/tests/ref/fate/g723_1-dec-1
deleted file mode 100644
index a3a7f67..0000000
--- a/deps/libav/tests/ref/fate/g723_1-dec-1
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      240,      480, 0x7f6f3970
-0,        240,        240,      240,      480, 0x1105a0d3
diff --git a/deps/libav/tests/ref/fate/g723_1-dec-2 b/deps/libav/tests/ref/fate/g723_1-dec-2
deleted file mode 100644
index e7fc9b2..0000000
--- a/deps/libav/tests/ref/fate/g723_1-dec-2
+++ /dev/null
@@ -1,27 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      240,      480, 0x5d9d9091
-0,        240,        240,      240,      480, 0x425095b7
-0,        480,        480,      240,      480, 0xe7b6a1a7
-0,        720,        720,      240,      480, 0x9397af19
-0,        960,        960,      240,      480, 0xe671adf7
-0,       1200,       1200,      240,      480, 0x77deb313
-0,       1440,       1440,      240,      480, 0x64abbb5f
-0,       1680,       1680,      240,      480, 0x000bc879
-0,       1920,       1920,      240,      480, 0x5a88c7aa
-0,       2160,       2160,      240,      480, 0xb041cbad
-0,       2400,       2400,      240,      480, 0x3257cd54
-0,       2640,       2640,      240,      480, 0xd6e7d4b3
-0,       2880,       2880,      240,      480, 0x0054d6b6
-0,       3120,       3120,      240,      480, 0x10bcd58e
-0,       3360,       3360,      240,      480, 0x702ed981
-0,       3600,       3600,      240,      480, 0x9870d4e3
-0,       3840,       3840,      240,      480, 0x9c12d6d1
-0,       4080,       4080,      240,      480, 0xc41be449
-0,       4320,       4320,      240,      480, 0xf4bddc5a
-0,       4560,       4560,      240,      480, 0x1c03e0d4
-0,       4800,       4800,      240,      480, 0xc287e4f8
-0,       5040,       5040,      240,      480, 0xf705ec20
-0,       5280,       5280,      240,      480, 0x7835f458
-0,       5520,       5520,      240,      480, 0xa8b3e632
-0,       5760,       5760,      240,      480, 0xd358df57
-0,       6000,       6000,      240,      480, 0x934dab80
diff --git a/deps/libav/tests/ref/fate/g723_1-dec-3 b/deps/libav/tests/ref/fate/g723_1-dec-3
deleted file mode 100644
index d1a2946..0000000
--- a/deps/libav/tests/ref/fate/g723_1-dec-3
+++ /dev/null
@@ -1,34 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      240,      480, 0xce908869
-0,        240,        240,      240,      480, 0xfa63588e
-0,        480,        480,      240,      480, 0x11ce850c
-0,        720,        720,      240,      480, 0x76c459cf
-0,        960,        960,      240,      480, 0x13ed8bf0
-0,       1200,       1200,      240,      480, 0x33d10b77
-0,       1440,       1440,      240,      480, 0xdf41e03c
-0,       1680,       1680,      240,      480, 0xa31aad71
-0,       1920,       1920,      240,      480, 0x83c2b48d
-0,       2160,       2160,      240,      480, 0xaf41ba01
-0,       2400,       2400,      240,      480, 0xeeecbadc
-0,       2640,       2640,      240,      480, 0xe253c7e1
-0,       2880,       2880,      240,      480, 0x672cbf0a
-0,       3120,       3120,      240,      480, 0x5f32aa27
-0,       3360,       3360,      240,      480, 0x0b3da147
-0,       3600,       3600,      240,      480, 0x4819e5bc
-0,       3840,       3840,      240,      480, 0x423dec60
-0,       4080,       4080,      240,      480, 0xafefe289
-0,       4320,       4320,      240,      480, 0x8dc5f136
-0,       4560,       4560,      240,      480, 0x549cee78
-0,       4800,       4800,      240,      480, 0xe589ebdc
-0,       5040,       5040,      240,      480, 0x786cef17
-0,       5280,       5280,      240,      480, 0xdafded31
-0,       5520,       5520,      240,      480, 0xe58bedf8
-0,       5760,       5760,      240,      480, 0x44daf26c
-0,       6000,       6000,      240,      480, 0x03fcf149
-0,       6240,       6240,      240,      480, 0x97a5f4ae
-0,       6480,       6480,      240,      480, 0x2114f4f6
-0,       6720,       6720,      240,      480, 0x9a44f234
-0,       6960,       6960,      240,      480, 0x5b47f339
-0,       7200,       7200,      240,      480, 0x9248edcb
-0,       7440,       7440,      240,      480, 0x47caf226
-0,       7680,       7680,      240,      480, 0x73d4ef48
diff --git a/deps/libav/tests/ref/fate/g723_1-dec-4 b/deps/libav/tests/ref/fate/g723_1-dec-4
deleted file mode 100644
index 792899d..0000000
--- a/deps/libav/tests/ref/fate/g723_1-dec-4
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      240,      480, 0xa697b314
-0,        240,        240,      240,      480, 0x43c5dc5a
-0,        480,        480,      240,      480, 0xd2438147
-0,        720,        720,      240,      480, 0x3b1ead64
diff --git a/deps/libav/tests/ref/fate/g723_1-dec-5 b/deps/libav/tests/ref/fate/g723_1-dec-5
deleted file mode 100644
index bdc2982..0000000
--- a/deps/libav/tests/ref/fate/g723_1-dec-5
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      240,      480, 0x4dce9773
-0,        240,        240,      240,      480, 0xe6367ab8
-0,        480,        480,      240,      480, 0xf36a589d
-0,        720,        720,      240,      480, 0xf94efd31
-0,        960,        960,      240,      480, 0x984e6d33
-0,       1200,       1200,      240,      480, 0x84eaa191
-0,       1440,       1440,      240,      480, 0xed6e0c10
-0,       1680,       1680,      240,      480, 0x3627e7a0
-0,       1920,       1920,      240,      480, 0x2421b42d
-0,       2160,       2160,      240,      480, 0x71e00d6f
-0,       2400,       2400,      240,      480, 0xd49cdb95
-0,       2640,       2640,      240,      480, 0xa167e890
-0,       2880,       2880,      240,      480, 0xbb3fd7c0
-0,       3120,       3120,      240,      480, 0xa3d5bc27
-0,       3360,       3360,      240,      480, 0x8107ca9c
-0,       3600,       3600,      240,      480, 0xcd4ce998
-0,       3840,       3840,      240,      480, 0x14e3ee73
-0,       4080,       4080,      240,      480, 0x5fc3eaf0
-0,       4320,       4320,      240,      480, 0xf166f33d
-0,       4560,       4560,      240,      480, 0xe8b3f701
-0,       4800,       4800,      240,      480, 0x50aaeafd
-0,       5040,       5040,      240,      480, 0xc7f2daec
-0,       5280,       5280,      240,      480, 0x3960e5d0
-0,       5520,       5520,      240,      480, 0xadc8ec32
-0,       5760,       5760,      240,      480, 0x8741e7b0
-0,       6000,       6000,      240,      480, 0x1a1bd910
-0,       6240,       6240,      240,      480, 0x76a4ef7f
-0,       6480,       6480,      240,      480, 0x19e6e5f5
-0,       6720,       6720,      240,      480, 0x6365e871
-0,       6960,       6960,      240,      480, 0xb2bee161
-0,       7200,       7200,      240,      480, 0x5098cba4
-0,       7440,       7440,      240,      480, 0x1009c4c5
-0,       7680,       7680,      240,      480, 0xbf20cfe3
-0,       7920,       7920,      240,      480, 0x91ddd028
-0,       8160,       8160,      240,      480, 0x4fedce37
-0,       8400,       8400,      240,      480, 0x43bcd4d8
-0,       8640,       8640,      240,      480, 0x41b3e782
-0,       8880,       8880,      240,      480, 0xa272f4a6
-0,       9120,       9120,      240,      480, 0x46b2f2cb
-0,       9360,       9360,      240,      480, 0xc47dee7d
-0,       9600,       9600,      240,      480, 0x699fe668
-0,       9840,       9840,      240,      480, 0x72b5daf8
-0,      10080,      10080,      240,      480, 0x0c0cf25e
-0,      10320,      10320,      240,      480, 0xdafff519
-0,      10560,      10560,      240,      480, 0xf1f2e42f
-0,      10800,      10800,      240,      480, 0xe04fe7f4
-0,      11040,      11040,      240,      480, 0x1157d789
-0,      11280,      11280,      240,      480, 0xe598ede6
-0,      11520,      11520,      240,      480, 0xbd06dc2f
-0,      11760,      11760,      240,      480, 0x2aa6d2d9
-0,      12000,      12000,      240,      480, 0xa61ff1a3
-0,      12240,      12240,      240,      480, 0x6f57eb35
-0,      12480,      12480,      240,      480, 0x68c1f4a9
-0,      12720,      12720,      240,      480, 0x5c0ae6f2
-0,      12960,      12960,      240,      480, 0xdffbef45
-0,      13200,      13200,      240,      480, 0xf0daf893
-0,      13440,      13440,      240,      480, 0x680cf0c4
-0,      13680,      13680,      240,      480, 0xbbc1d42f
-0,      13920,      13920,      240,      480, 0x9b66eddd
-0,      14160,      14160,      240,      480, 0xc18be7a3
-0,      14400,      14400,      240,      480, 0x1deae025
-0,      14640,      14640,      240,      480, 0x6c12e002
-0,      14880,      14880,      240,      480, 0x004bf27e
-0,      15120,      15120,      240,      480, 0xc97de444
-0,      15360,      15360,      240,      480, 0xc650de6b
-0,      15600,      15600,      240,      480, 0xe614ecd6
-0,      15840,      15840,      240,      480, 0x2c20d111
-0,      16080,      16080,      240,      480, 0x8562c091
-0,      16320,      16320,      240,      480, 0x4fcddd08
-0,      16560,      16560,      240,      480, 0xc1b2c3cb
-0,      16800,      16800,      240,      480, 0x5dcfdf24
-0,      17040,      17040,      240,      480, 0xf348d7be
-0,      17280,      17280,      240,      480, 0x31b3ead7
-0,      17520,      17520,      240,      480, 0xb30dee68
-0,      17760,      17760,      240,      480, 0x1f44e9ac
-0,      18000,      18000,      240,      480, 0x3cafe61e
-0,      18240,      18240,      240,      480, 0x5800ea95
-0,      18480,      18480,      240,      480, 0xeaeeec19
-0,      18720,      18720,      240,      480, 0x47f9eff3
-0,      18960,      18960,      240,      480, 0xdc10edf1
-0,      19200,      19200,      240,      480, 0x5b1bd3ff
-0,      19440,      19440,      240,      480, 0x039bea64
-0,      19680,      19680,      240,      480, 0xa93ac953
-0,      19920,      19920,      240,      480, 0x1b55f01c
-0,      20160,      20160,      240,      480, 0x32b7db90
-0,      20400,      20400,      240,      480, 0x2f8ce0a8
-0,      20640,      20640,      240,      480, 0x53f4f7d5
-0,      20880,      20880,      240,      480, 0x880ee517
-0,      21120,      21120,      240,      480, 0xe793f2fd
-0,      21360,      21360,      240,      480, 0x498beaf5
-0,      21600,      21600,      240,      480, 0x8c25f623
-0,      21840,      21840,      240,      480, 0xdc0df527
-0,      22080,      22080,      240,      480, 0x9d21e9b4
-0,      22320,      22320,      240,      480, 0x6d51d9e6
-0,      22560,      22560,      240,      480, 0xaf3ee6ba
-0,      22800,      22800,      240,      480, 0xbef0ea44
-0,      23040,      23040,      240,      480, 0x50c6e9ab
-0,      23280,      23280,      240,      480, 0x76a7d80c
-0,      23520,      23520,      240,      480, 0x8d68ef94
-0,      23760,      23760,      240,      480, 0x213ce600
diff --git a/deps/libav/tests/ref/fate/g723_1-dec-6 b/deps/libav/tests/ref/fate/g723_1-dec-6
deleted file mode 100644
index eb0e4fa..0000000
--- a/deps/libav/tests/ref/fate/g723_1-dec-6
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      240,      480, 0x4fa1aed9
-0,        240,        240,      240,      480, 0x6d7ef391
-0,        480,        480,      240,      480, 0xaecaf2c1
-0,        720,        720,      240,      480, 0xd3b2ed0a
-0,        960,        960,      240,      480, 0x33dceb4e
-0,       1200,       1200,      240,      480, 0xc10eeb64
-0,       1440,       1440,      240,      480, 0x7c0febff
-0,       1680,       1680,      240,      480, 0x0c09eecd
-0,       1920,       1920,      240,      480, 0xa5efdcf8
-0,       2160,       2160,      240,      480, 0xb643edd2
-0,       2400,       2400,      240,      480, 0x46bef26d
-0,       2640,       2640,      240,      480, 0x4310f101
-0,       2880,       2880,      240,      480, 0x3664ec16
-0,       3120,       3120,      240,      480, 0xcc17e5e8
-0,       3360,       3360,      240,      480, 0xff4cf35b
-0,       3600,       3600,      240,      480, 0xdf4cf2e5
-0,       3840,       3840,      240,      480, 0x093bf570
-0,       4080,       4080,      240,      480, 0xd950ec75
-0,       4320,       4320,      240,      480, 0xa469f2f8
-0,       4560,       4560,      240,      480, 0x3558ee9d
-0,       4800,       4800,      240,      480, 0x4102f252
-0,       5040,       5040,      240,      480, 0xf9dff318
-0,       5280,       5280,      240,      480, 0xd7cbef4d
-0,       5520,       5520,      240,      480, 0x76c4eed3
-0,       5760,       5760,      240,      480, 0xe3d6e9d1
-0,       6000,       6000,      240,      480, 0x63baf340
-0,       6240,       6240,      240,      480, 0xd2dff2ff
-0,       6480,       6480,      240,      480, 0x3355ebc4
-0,       6720,       6720,      240,      480, 0x7183ed76
-0,       6960,       6960,      240,      480, 0x9806eff7
-0,       7200,       7200,      240,      480, 0xc090ec04
-0,       7440,       7440,      240,      480, 0xe76ff174
-0,       7680,       7680,      240,      480, 0x2cdfe8f1
-0,       7920,       7920,      240,      480, 0xbb69ee8a
-0,       8160,       8160,      240,      480, 0x3e03f522
-0,       8400,       8400,      240,      480, 0xe7e6e659
-0,       8640,       8640,      240,      480, 0x4dbaf063
-0,       8880,       8880,      240,      480, 0xc9b9f381
-0,       9120,       9120,      240,      480, 0x3866edc9
-0,       9360,       9360,      240,      480, 0x7e0defca
-0,       9600,       9600,      240,      480, 0xa88bf700
-0,       9840,       9840,      240,      480, 0x65a7f029
-0,      10080,      10080,      240,      480, 0xaf8cf09d
-0,      10320,      10320,      240,      480, 0x679bee1e
-0,      10560,      10560,      240,      480, 0x8dc1e9a4
-0,      10800,      10800,      240,      480, 0xe3c2f0ac
-0,      11040,      11040,      240,      480, 0x35d0eb14
-0,      11280,      11280,      240,      480, 0xfeb3ed00
-0,      11520,      11520,      240,      480, 0x9da3ecb4
-0,      11760,      11760,      240,      480, 0xa0e3f3c2
-0,      12000,      12000,      240,      480, 0x05ffe9de
-0,      12240,      12240,      240,      480, 0xf7adef05
-0,      12480,      12480,      240,      480, 0x71bef669
-0,      12720,      12720,      240,      480, 0x4b9feca8
-0,      12960,      12960,      240,      480, 0x85e5ecd8
-0,      13200,      13200,      240,      480, 0xa4cbe90e
-0,      13440,      13440,      240,      480, 0xe689f958
-0,      13680,      13680,      240,      480, 0xa936f168
-0,      13920,      13920,      240,      480, 0x496ff059
-0,      14160,      14160,      240,      480, 0x0bb6eb82
-0,      14400,      14400,      240,      480, 0x7727ef53
-0,      14640,      14640,      240,      480, 0xede3eaab
-0,      14880,      14880,      240,      480, 0xe961ef58
-0,      15120,      15120,      240,      480, 0x454fef58
-0,      15360,      15360,      240,      480, 0x9305e76d
-0,      15600,      15600,      240,      480, 0xfe5ce6ed
-0,      15840,      15840,      240,      480, 0x84d1efdc
-0,      16080,      16080,      240,      480, 0x4b23ed7a
-0,      16320,      16320,      240,      480, 0x1380eb91
-0,      16560,      16560,      240,      480, 0xf705eca3
-0,      16800,      16800,      240,      480, 0x26f7e707
-0,      17040,      17040,      240,      480, 0x3fe3f27f
-0,      17280,      17280,      240,      480, 0xa030f177
-0,      17520,      17520,      240,      480, 0xaf72ed92
-0,      17760,      17760,      240,      480, 0x00b8f1e7
-0,      18000,      18000,      240,      480, 0x681fecca
-0,      18240,      18240,      240,      480, 0x3ca1ef63
-0,      18480,      18480,      240,      480, 0xd6fcedac
-0,      18720,      18720,      240,      480, 0x6928ed04
-0,      18960,      18960,      240,      480, 0x8bdeeebe
-0,      19200,      19200,      240,      480, 0x24b6f59d
-0,      19440,      19440,      240,      480, 0xd49deebf
-0,      19680,      19680,      240,      480, 0xe798f2c8
-0,      19920,      19920,      240,      480, 0x280fefb8
-0,      20160,      20160,      240,      480, 0xe0a8f40d
-0,      20400,      20400,      240,      480, 0x4d48f511
-0,      20640,      20640,      240,      480, 0x6bf3eef0
-0,      20880,      20880,      240,      480, 0x1573f1cd
-0,      21120,      21120,      240,      480, 0x6245e961
-0,      21360,      21360,      240,      480, 0xe05af091
-0,      21600,      21600,      240,      480, 0xfcc3e9e3
-0,      21840,      21840,      240,      480, 0x6d5febae
-0,      22080,      22080,      240,      480, 0x4a96ef58
-0,      22320,      22320,      240,      480, 0x1586f156
-0,      22560,      22560,      240,      480, 0x50b0e99e
-0,      22800,      22800,      240,      480, 0xf25dfa9b
-0,      23040,      23040,      240,      480, 0x49b5f932
-0,      23280,      23280,      240,      480, 0xe1ddef32
-0,      23520,      23520,      240,      480, 0x2307ed94
-0,      23760,      23760,      240,      480, 0x6a2beb17
diff --git a/deps/libav/tests/ref/fate/g723_1-dec-7 b/deps/libav/tests/ref/fate/g723_1-dec-7
deleted file mode 100644
index cc30187..0000000
--- a/deps/libav/tests/ref/fate/g723_1-dec-7
+++ /dev/null
@@ -1,12 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      240,      480, 0x35e4a1fd
-0,        240,        240,      240,      480, 0x2f7bdd60
-0,        480,        480,      240,      480, 0x0407e499
-0,        720,        720,      240,      480, 0x5f5ef209
-0,        960,        960,      240,      480, 0xe936e8d1
-0,       1200,       1200,      240,      480, 0x0896ddba
-0,       1440,       1440,      240,      480, 0xa885ea94
-0,       1680,       1680,      240,      480, 0x40bff3d0
-0,       1920,       1920,      240,      480, 0xe05ce4c3
-0,       2160,       2160,      240,      480, 0x80c4f790
-0,       2400,       2400,      240,      480, 0x65d5e8f9
diff --git a/deps/libav/tests/ref/fate/g723_1-dec-8 b/deps/libav/tests/ref/fate/g723_1-dec-8
deleted file mode 100644
index fc4d9f3..0000000
--- a/deps/libav/tests/ref/fate/g723_1-dec-8
+++ /dev/null
@@ -1,121 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      240,      480, 0x17930e0f
-0,        240,        240,      240,      480, 0x7c7f4247
-0,        480,        480,      240,      480, 0xbf3489e5
-0,        720,        720,      240,      480, 0x24319fc9
-0,        960,        960,      240,      480, 0xb327eec0
-0,       1200,       1200,      240,      480, 0xc2ddcbca
-0,       1440,       1440,      240,      480, 0xeebad740
-0,       1680,       1680,      240,      480, 0x77fcb933
-0,       1920,       1920,      240,      480, 0x9677c5b7
-0,       2160,       2160,      240,      480, 0xb49dcb9e
-0,       2400,       2400,      240,      480, 0x0e78d7e6
-0,       2640,       2640,      240,      480, 0xf752dc3e
-0,       2880,       2880,      240,      480, 0xc95af091
-0,       3120,       3120,      240,      480, 0xa25de399
-0,       3360,       3360,      240,      480, 0x34e7e0da
-0,       3600,       3600,      240,      480, 0x6c84e3f4
-0,       3840,       3840,      240,      480, 0x2c7dda20
-0,       4080,       4080,      240,      480, 0x00a5f112
-0,       4320,       4320,      240,      480, 0x943ddd89
-0,       4560,       4560,      240,      480, 0x4ad4ebac
-0,       4800,       4800,      240,      480, 0xa4ff0aa8
-0,       5040,       5040,      240,      480, 0xc0f805f2
-0,       5280,       5280,      240,      480, 0x859ce987
-0,       5520,       5520,      240,      480, 0x9ebcd0de
-0,       5760,       5760,      240,      480, 0x3de2db0b
-0,       6000,       6000,      240,      480, 0x0affea9c
-0,       6240,       6240,      240,      480, 0xcb1bf81e
-0,       6480,       6480,      240,      480, 0x8a72d71d
-0,       6720,       6720,      240,      480, 0x583cd5cd
-0,       6960,       6960,      240,      480, 0x4be7dc7b
-0,       7200,       7200,      240,      480, 0xb08108c0
-0,       7440,       7440,      240,      480, 0xd0b3ed59
-0,       7680,       7680,      240,      480, 0x7d33f822
-0,       7920,       7920,      240,      480, 0x199c0111
-0,       8160,       8160,      240,      480, 0x7d29f2a8
-0,       8400,       8400,      240,      480, 0x424dec5e
-0,       8640,       8640,      240,      480, 0x946cf258
-0,       8880,       8880,      240,      480, 0xd429da7a
-0,       9120,       9120,      240,      480, 0x0f11df46
-0,       9360,       9360,      240,      480, 0xf4dce502
-0,       9600,       9600,      240,      480, 0x01c1de78
-0,       9840,       9840,      240,      480, 0xd1d3da59
-0,      10080,      10080,      240,      480, 0x5822f3ec
-0,      10320,      10320,      240,      480, 0xadd5fe67
-0,      10560,      10560,      240,      480, 0xdcf5f2c3
-0,      10800,      10800,      240,      480, 0x5176e39b
-0,      11040,      11040,      240,      480, 0xf947e0b1
-0,      11280,      11280,      240,      480, 0x33b1eb36
-0,      11520,      11520,      240,      480, 0x57bce9bd
-0,      11760,      11760,      240,      480, 0x806eec1f
-0,      12000,      12000,      240,      480, 0x0a60f94a
-0,      12240,      12240,      240,      480, 0x9eddf27d
-0,      12480,      12480,      240,      480, 0x3d28ef2f
-0,      12720,      12720,      240,      480, 0x52f0e562
-0,      12960,      12960,      240,      480, 0xf2d6c8a0
-0,      13200,      13200,      240,      480, 0xfa0df4a1
-0,      13440,      13440,      240,      480, 0x9cccfda9
-0,      13680,      13680,      240,      480, 0xa7c1e528
-0,      13920,      13920,      240,      480, 0xe130e8f9
-0,      14160,      14160,      240,      480, 0x80f6eabe
-0,      14400,      14400,      240,      480, 0x9bbb027e
-0,      14640,      14640,      240,      480, 0x33cdea7f
-0,      14880,      14880,      240,      480, 0x84d8e761
-0,      15120,      15120,      240,      480, 0xb99ce457
-0,      15360,      15360,      240,      480, 0x5dc1e324
-0,      15600,      15600,      240,      480, 0xc914e6c3
-0,      15840,      15840,      240,      480, 0x8e77f5c2
-0,      16080,      16080,      240,      480, 0x3997034d
-0,      16320,      16320,      240,      480, 0x820cfd49
-0,      16560,      16560,      240,      480, 0x8ad5f24c
-0,      16800,      16800,      240,      480, 0xe21be71c
-0,      17040,      17040,      240,      480, 0x516ae8c8
-0,      17280,      17280,      240,      480, 0x595bdc3d
-0,      17520,      17520,      240,      480, 0x8a4bee79
-0,      17760,      17760,      240,      480, 0x307fed64
-0,      18000,      18000,      240,      480, 0xe71cf219
-0,      18240,      18240,      240,      480, 0xdb0be1a1
-0,      18480,      18480,      240,      480, 0x7947dfbd
-0,      18720,      18720,      240,      480, 0x5d90fbf0
-0,      18960,      18960,      240,      480, 0xa449fc55
-0,      19200,      19200,      240,      480, 0x45b2f979
-0,      19440,      19440,      240,      480, 0x2b2be378
-0,      19680,      19680,      240,      480, 0x2d2edf42
-0,      19920,      19920,      240,      480, 0x568ee04f
-0,      20160,      20160,      240,      480, 0x66f0debe
-0,      20400,      20400,      240,      480, 0xc943eab7
-0,      20640,      20640,      240,      480, 0xc9ade3c9
-0,      20880,      20880,      240,      480, 0x6971f92d
-0,      21120,      21120,      240,      480, 0x48d0ecbc
-0,      21360,      21360,      240,      480, 0xf641dc98
-0,      21600,      21600,      240,      480, 0xbb18e167
-0,      21840,      21840,      240,      480, 0x72ce0968
-0,      22080,      22080,      240,      480, 0x15bee6f6
-0,      22320,      22320,      240,      480, 0x93d5e91f
-0,      22560,      22560,      240,      480, 0x7aee010b
-0,      22800,      22800,      240,      480, 0x9e82dc87
-0,      23040,      23040,      240,      480, 0x4ee6f547
-0,      23280,      23280,      240,      480, 0x3072d102
-0,      23520,      23520,      240,      480, 0x74d4fb04
-0,      23760,      23760,      240,      480, 0xc670f958
-0,      24000,      24000,      240,      480, 0x3965c41f
-0,      24240,      24240,      240,      480, 0x6a2de869
-0,      24480,      24480,      240,      480, 0xa757f44b
-0,      24720,      24720,      240,      480, 0x94a5168c
-0,      24960,      24960,      240,      480, 0xef0f0c28
-0,      25200,      25200,      240,      480, 0x3770ebb3
-0,      25440,      25440,      240,      480, 0x4343de6f
-0,      25680,      25680,      240,      480, 0x3ec8d816
-0,      25920,      25920,      240,      480, 0x1661e3d3
-0,      26160,      26160,      240,      480, 0x077cd9fd
-0,      26400,      26400,      240,      480, 0xb5ece07e
-0,      26640,      26640,      240,      480, 0xf303e151
-0,      26880,      26880,      240,      480, 0x95e4d019
-0,      27120,      27120,      240,      480, 0x4bd0ddc0
-0,      27360,      27360,      240,      480, 0x6cebd341
-0,      27600,      27600,      240,      480, 0xea3fea9e
-0,      27840,      27840,      240,      480, 0x5ad30c3f
-0,      28080,      28080,      240,      480, 0x218c02a5
-0,      28320,      28320,      240,      480, 0x662decd0
-0,      28560,      28560,      240,      480, 0x6865e2f2
diff --git a/deps/libav/tests/ref/fate/g726-encode-2bit b/deps/libav/tests/ref/fate/g726-encode-2bit
deleted file mode 100644
index 26a1219..0000000
--- a/deps/libav/tests/ref/fate/g726-encode-2bit
+++ /dev/null
@@ -1 +0,0 @@
-MD5=215eaef5778a16e2bf4f3725a557f355
diff --git a/deps/libav/tests/ref/fate/g726-encode-3bit b/deps/libav/tests/ref/fate/g726-encode-3bit
deleted file mode 100644
index f9c6940..0000000
--- a/deps/libav/tests/ref/fate/g726-encode-3bit
+++ /dev/null
@@ -1 +0,0 @@
-MD5=0bebd949dfd5ac0ae3f2c3ceb2e3fac1
diff --git a/deps/libav/tests/ref/fate/g726-encode-4bit b/deps/libav/tests/ref/fate/g726-encode-4bit
deleted file mode 100644
index 6d03517..0000000
--- a/deps/libav/tests/ref/fate/g726-encode-4bit
+++ /dev/null
@@ -1 +0,0 @@
-MD5=a21cfea116ab2179eabe5d84b6bfc09a
diff --git a/deps/libav/tests/ref/fate/g726-encode-5bit b/deps/libav/tests/ref/fate/g726-encode-5bit
deleted file mode 100644
index 459ebb3..0000000
--- a/deps/libav/tests/ref/fate/g726-encode-5bit
+++ /dev/null
@@ -1 +0,0 @@
-MD5=9cad98cf5205bf76d6e9d1241e56141a
diff --git a/deps/libav/tests/ref/fate/gsm-ms b/deps/libav/tests/ref/fate/gsm-ms
deleted file mode 100644
index 6d15cb8..0000000
--- a/deps/libav/tests/ref/fate/gsm-ms
+++ /dev/null
@@ -1,90 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      320,      640, 0xf79c59ee
-0,        320,        320,      320,      640, 0x6e6248be
-0,        640,        640,      320,      640, 0x2a5b3aed
-0,        960,        960,      320,      640, 0xf7012e06
-0,       1280,       1280,      320,      640, 0x626645cd
-0,       1600,       1600,      320,      640, 0x9f482b66
-0,       1920,       1920,      320,      640, 0xea443886
-0,       2240,       2240,      320,      640, 0xa79b3dc0
-0,       2560,       2560,      320,      640, 0x0161263f
-0,       2880,       2880,      320,      640, 0x61b33154
-0,       3200,       3200,      320,      640, 0xf7fa388c
-0,       3520,       3520,      320,      640, 0xb63038e9
-0,       3840,       3840,      320,      640, 0x61b03506
-0,       4160,       4160,      320,      640, 0xed4e2eac
-0,       4480,       4480,      320,      640, 0x9b8127f1
-0,       4800,       4800,      320,      640, 0xe50627be
-0,       5120,       5120,      320,      640, 0x6b5038f9
-0,       5440,       5440,      320,      640, 0x8e794c10
-0,       5760,       5760,      320,      640, 0x426d2c93
-0,       6080,       6080,      320,      640, 0x9a373111
-0,       6400,       6400,      320,      640, 0x94132ccb
-0,       6720,       6720,      320,      640, 0x610b3788
-0,       7040,       7040,      320,      640, 0x27204206
-0,       7360,       7360,      320,      640, 0xbdf82268
-0,       7680,       7680,      320,      640, 0x2e653066
-0,       8000,       8000,      320,      640, 0xccfd2328
-0,       8320,       8320,      320,      640, 0xf2431e04
-0,       8640,       8640,      320,      640, 0x7b412094
-0,       8960,       8960,      320,      640, 0x5c2635fa
-0,       9280,       9280,      320,      640, 0xdcbd2c60
-0,       9600,       9600,      320,      640, 0x65173699
-0,       9920,       9920,      320,      640, 0xbcff19ed
-0,      10240,      10240,      320,      640, 0xf5b2206c
-0,      10560,      10560,      320,      640, 0x587e460c
-0,      10880,      10880,      320,      640, 0x2418382d
-0,      11200,      11200,      320,      640, 0xbfad2f9b
-0,      11520,      11520,      320,      640, 0x87d92d6c
-0,      11840,      11840,      320,      640, 0xdc582c69
-0,      12160,      12160,      320,      640, 0xcfe52ebf
-0,      12480,      12480,      320,      640, 0xe0032e70
-0,      12800,      12800,      320,      640, 0xf8a61b57
-0,      13120,      13120,      320,      640, 0xa9ef2ee5
-0,      13440,      13440,      320,      640, 0x7f513313
-0,      13760,      13760,      320,      640, 0x93731177
-0,      14080,      14080,      320,      640, 0xed2c2340
-0,      14400,      14400,      320,      640, 0x85b02913
-0,      14720,      14720,      320,      640, 0xa5a92f3e
-0,      15040,      15040,      320,      640, 0x72472490
-0,      15360,      15360,      320,      640, 0x856231fc
-0,      15680,      15680,      320,      640, 0xda2e3c22
-0,      16000,      16000,      320,      640, 0xcce84c36
-0,      16320,      16320,      320,      640, 0x39312c78
-0,      16640,      16640,      320,      640, 0xf1aa2365
-0,      16960,      16960,      320,      640, 0x1dba3f7e
-0,      17280,      17280,      320,      640, 0x21953579
-0,      17600,      17600,      320,      640, 0xbbd52c22
-0,      17920,      17920,      320,      640, 0x45c71537
-0,      18240,      18240,      320,      640, 0x26051cec
-0,      18560,      18560,      320,      640, 0x27ae223e
-0,      18880,      18880,      320,      640, 0x223c0bb8
-0,      19200,      19200,      320,      640, 0xc5b72796
-0,      19520,      19520,      320,      640, 0xe7fd294d
-0,      19840,      19840,      320,      640, 0x19042293
-0,      20160,      20160,      320,      640, 0xa6572c6b
-0,      20480,      20480,      320,      640, 0x58ac1d16
-0,      20800,      20800,      320,      640, 0xd0631bd6
-0,      21120,      21120,      320,      640, 0xe74f276c
-0,      21440,      21440,      320,      640, 0x87d0295f
-0,      21760,      21760,      320,      640, 0x054e3dc8
-0,      22080,      22080,      320,      640, 0x0ca51c2d
-0,      22400,      22400,      320,      640, 0x17a02616
-0,      22720,      22720,      320,      640, 0x56b2235d
-0,      23040,      23040,      320,      640, 0x1cd93302
-0,      23360,      23360,      320,      640, 0xe3672352
-0,      23680,      23680,      320,      640, 0xc99f2e45
-0,      24000,      24000,      320,      640, 0x36a43e9d
-0,      24320,      24320,      320,      640, 0xfcd73e87
-0,      24640,      24640,      320,      640, 0x813b2e20
-0,      24960,      24960,      320,      640, 0x8f7a4cac
-0,      25280,      25280,      320,      640, 0xcf3e4106
-0,      25600,      25600,      320,      640, 0x8a752b07
-0,      25920,      25920,      320,      640, 0xe5013dcd
-0,      26240,      26240,      320,      640, 0xda4a3d03
-0,      26560,      26560,      320,      640, 0x05ce2c64
-0,      26880,      26880,      320,      640, 0x1e0f42b5
-0,      27200,      27200,      320,      640, 0xe4bd326a
-0,      27520,      27520,      320,      640, 0x701c28de
-0,      27840,      27840,      320,      640, 0xd0b02f97
-0,      28160,      28160,      320,      640, 0x7950419b
diff --git a/deps/libav/tests/ref/fate/gsm-toast b/deps/libav/tests/ref/fate/gsm-toast
deleted file mode 100644
index 721e4e4..0000000
--- a/deps/libav/tests/ref/fate/gsm-toast
+++ /dev/null
@@ -1,501 +0,0 @@
-#tb 0: 1/8000
-0,          0,          0,      160,      320, 0x4c32ab06
-0,        160,        160,      160,      320, 0x2052a4e7
-0,        320,        320,      160,      320, 0xe9aeafca
-0,        480,        480,      160,      320, 0xde83b450
-0,        640,        640,      160,      320, 0x06a6a80e
-0,        800,        800,      160,      320, 0xf6aeb1e2
-0,        960,        960,      160,      320, 0x2623b40c
-0,       1120,       1120,      160,      320, 0x8ec69f25
-0,       1280,       1280,      160,      320, 0xddaaac88
-0,       1440,       1440,      160,      320, 0x9e60b713
-0,       1600,       1600,      160,      320, 0xb738ab30
-0,       1760,       1760,      160,      320, 0xdb4bbb92
-0,       1920,       1920,      160,      320, 0x0370ae8b
-0,       2080,       2080,      160,      320, 0xb611a3fb
-0,       2240,       2240,      160,      320, 0x07ee8e3b
-0,       2400,       2400,      160,      320, 0xdb1ec628
-0,       2560,       2560,      160,      320, 0xd5f1bda2
-0,       2720,       2720,      160,      320, 0xcabb9a9c
-0,       2880,       2880,      160,      320, 0x16c8ad61
-0,       3040,       3040,      160,      320, 0xf76fc25e
-0,       3200,       3200,      160,      320, 0x7118a10d
-0,       3360,       3360,      160,      320, 0x29f9a0db
-0,       3520,       3520,      160,      320, 0x41f2a4ef
-0,       3680,       3680,      160,      320, 0x36dfb231
-0,       3840,       3840,      160,      320, 0xc5399eda
-0,       4000,       4000,      160,      320, 0x17d4b9e0
-0,       4160,       4160,      160,      320, 0x2b5797ac
-0,       4320,       4320,      160,      320, 0x0128c5e7
-0,       4480,       4480,      160,      320, 0xf4f38037
-0,       4640,       4640,      160,      320, 0x77d6b5f2
-0,       4800,       4800,      160,      320, 0xd94a93e0
-0,       4960,       4960,      160,      320, 0x968daae3
-0,       5120,       5120,      160,      320, 0xda5ba0ec
-0,       5280,       5280,      160,      320, 0x316da1ec
-0,       5440,       5440,      160,      320, 0x3a35b2d2
-0,       5600,       5600,      160,      320, 0xca0b988f
-0,       5760,       5760,      160,      320, 0x1295b0b1
-0,       5920,       5920,      160,      320, 0xe121ae72
-0,       6080,       6080,      160,      320, 0x7da7ad43
-0,       6240,       6240,      160,      320, 0x96a49cfe
-0,       6400,       6400,      160,      320, 0x70c2b1de
-0,       6560,       6560,      160,      320, 0x668d88c0
-0,       6720,       6720,      160,      320, 0x5460b5a8
-0,       6880,       6880,      160,      320, 0x6ac78eab
-0,       7040,       7040,      160,      320, 0x0d8dab87
-0,       7200,       7200,      160,      320, 0xe2be94af
-0,       7360,       7360,      160,      320, 0x3487acdc
-0,       7520,       7520,      160,      320, 0x5048955a
-0,       7680,       7680,      160,      320, 0x2ef4ae0d
-0,       7840,       7840,      160,      320, 0xc765b773
-0,       8000,       8000,      160,      320, 0xad96a486
-0,       8160,       8160,      160,      320, 0xb9fdbf1f
-0,       8320,       8320,      160,      320, 0xf26c9ecf
-0,       8480,       8480,      160,      320, 0xbcadb535
-0,       8640,       8640,      160,      320, 0xa8c897bc
-0,       8800,       8800,      160,      320, 0xaa58b520
-0,       8960,       8960,      160,      320, 0xcb48a716
-0,       9120,       9120,      160,      320, 0x4d5da564
-0,       9280,       9280,      160,      320, 0x9809ae28
-0,       9440,       9440,      160,      320, 0x5baeb1e4
-0,       9600,       9600,      160,      320, 0x6a719b63
-0,       9760,       9760,      160,      320, 0xc27d92f0
-0,       9920,       9920,      160,      320, 0x0e9b9fe9
-0,      10080,      10080,      160,      320, 0xbf9d9bf7
-0,      10240,      10240,      160,      320, 0xf35aa64d
-0,      10400,      10400,      160,      320, 0x26449ce8
-0,      10560,      10560,      160,      320, 0x58f4a997
-0,      10720,      10720,      160,      320, 0x155da289
-0,      10880,      10880,      160,      320, 0x63b19a5c
-0,      11040,      11040,      160,      320, 0xe01aad38
-0,      11200,      11200,      160,      320, 0x4e0f9c43
-0,      11360,      11360,      160,      320, 0x9447a284
-0,      11520,      11520,      160,      320, 0xdb36a433
-0,      11680,      11680,      160,      320, 0x799a9b2c
-0,      11840,      11840,      160,      320, 0x1526a162
-0,      12000,      12000,      160,      320, 0x0a4ea140
-0,      12160,      12160,      160,      320, 0xb08f9ed7
-0,      12320,      12320,      160,      320, 0x221bab76
-0,      12480,      12480,      160,      320, 0x4befacf0
-0,      12640,      12640,      160,      320, 0xac489509
-0,      12800,      12800,      160,      320, 0x57a1a5b4
-0,      12960,      12960,      160,      320, 0x81e8ab97
-0,      13120,      13120,      160,      320, 0xc6ada4d6
-0,      13280,      13280,      160,      320, 0x12489975
-0,      13440,      13440,      160,      320, 0x1da59ba9
-0,      13600,      13600,      160,      320, 0xf225ac62
-0,      13760,      13760,      160,      320, 0x8c8e9eab
-0,      13920,      13920,      160,      320, 0x10599dec
-0,      14080,      14080,      160,      320, 0x06c39fa5
-0,      14240,      14240,      160,      320, 0xb0efa3c4
-0,      14400,      14400,      160,      320, 0x72caadab
-0,      14560,      14560,      160,      320, 0xe4619ff0
-0,      14720,      14720,      160,      320, 0x49bca017
-0,      14880,      14880,      160,      320, 0x413f9fbe
-0,      15040,      15040,      160,      320, 0x6eaed0ee
-0,      15200,      15200,      160,      320, 0x27e4b1eb
-0,      15360,      15360,      160,      320, 0x8c42a30f
-0,      15520,      15520,      160,      320, 0x0afaa0f4
-0,      15680,      15680,      160,      320, 0x0f74b76b
-0,      15840,      15840,      160,      320, 0xa9a2b9d5
-0,      16000,      16000,      160,      320, 0xde2a8712
-0,      16160,      16160,      160,      320, 0xcfc8b3a2
-0,      16320,      16320,      160,      320, 0x768cadce
-0,      16480,      16480,      160,      320, 0x3a8a97f1
-0,      16640,      16640,      160,      320, 0x502fa59b
-0,      16800,      16800,      160,      320, 0x4c3e9b0f
-0,      16960,      16960,      160,      320, 0x1cd2b111
-0,      17120,      17120,      160,      320, 0xa845a5a3
-0,      17280,      17280,      160,      320, 0xa6b8b982
-0,      17440,      17440,      160,      320, 0x4d5caab9
-0,      17600,      17600,      160,      320, 0x7993b604
-0,      17760,      17760,      160,      320, 0x8d19b37b
-0,      17920,      17920,      160,      320, 0xbe48adb6
-0,      18080,      18080,      160,      320, 0x7d68ab8e
-0,      18240,      18240,      160,      320, 0xbfffb0e2
-0,      18400,      18400,      160,      320, 0x90b5b7e3
-0,      18560,      18560,      160,      320, 0x9fa1b016
-0,      18720,      18720,      160,      320, 0x70abafc9
-0,      18880,      18880,      160,      320, 0x82cfad9c
-0,      19040,      19040,      160,      320, 0x05f6aa2c
-0,      19200,      19200,      160,      320, 0x511cbb5b
-0,      19360,      19360,      160,      320, 0xd27caaa6
-0,      19520,      19520,      160,      320, 0x781ca481
-0,      19680,      19680,      160,      320, 0x12e9ad1a
-0,      19840,      19840,      160,      320, 0xe46b989d
-0,      20000,      20000,      160,      320, 0x76dbb0a7
-0,      20160,      20160,      160,      320, 0x10eba486
-0,      20320,      20320,      160,      320, 0x2269a7c8
-0,      20480,      20480,      160,      320, 0x084a9c7e
-0,      20640,      20640,      160,      320, 0x84eda891
-0,      20800,      20800,      160,      320, 0x2ef9a639
-0,      20960,      20960,      160,      320, 0x8bb2a0dd
-0,      21120,      21120,      160,      320, 0x47e5a169
-0,      21280,      21280,      160,      320, 0x98faae42
-0,      21440,      21440,      160,      320, 0x81d2aba4
-0,      21600,      21600,      160,      320, 0x5af8bb33
-0,      21760,      21760,      160,      320, 0x331e8d9f
-0,      21920,      21920,      160,      320, 0xd9b0c09a
-0,      22080,      22080,      160,      320, 0xbaf9bfcf
-0,      22240,      22240,      160,      320, 0x54e89ab5
-0,      22400,      22400,      160,      320, 0x1d62c1d2
-0,      22560,      22560,      160,      320, 0xead6b436
-0,      22720,      22720,      160,      320, 0x465f98bc
-0,      22880,      22880,      160,      320, 0xe707a346
-0,      23040,      23040,      160,      320, 0xf66cb1c2
-0,      23200,      23200,      160,      320, 0xcfc89ae6
-0,      23360,      23360,      160,      320, 0x0b10b796
-0,      23520,      23520,      160,      320, 0xb29caf2c
-0,      23680,      23680,      160,      320, 0x0284a9d1
-0,      23840,      23840,      160,      320, 0xb966b5fc
-0,      24000,      24000,      160,      320, 0x2defa630
-0,      24160,      24160,      160,      320, 0xcdcd8ef3
-0,      24320,      24320,      160,      320, 0xa81bba2b
-0,      24480,      24480,      160,      320, 0x6bc0aeb1
-0,      24640,      24640,      160,      320, 0x38d8ac82
-0,      24800,      24800,      160,      320, 0xeb66a865
-0,      24960,      24960,      160,      320, 0x4fff9cd9
-0,      25120,      25120,      160,      320, 0x6819a19b
-0,      25280,      25280,      160,      320, 0xfd7c93ce
-0,      25440,      25440,      160,      320, 0xa7419f63
-0,      25600,      25600,      160,      320, 0x572caacb
-0,      25760,      25760,      160,      320, 0x918fb1de
-0,      25920,      25920,      160,      320, 0x0088a675
-0,      26080,      26080,      160,      320, 0x19229cf7
-0,      26240,      26240,      160,      320, 0x827ea812
-0,      26400,      26400,      160,      320, 0x6c258ef7
-0,      26560,      26560,      160,      320, 0x6a89b8fe
-0,      26720,      26720,      160,      320, 0x166c9ce0
-0,      26880,      26880,      160,      320, 0x68b39db7
-0,      27040,      27040,      160,      320, 0x3d5aa8ec
-0,      27200,      27200,      160,      320, 0x25e09ff3
-0,      27360,      27360,      160,      320, 0x759aa4ce
-0,      27520,      27520,      160,      320, 0xe5aab0ea
-0,      27680,      27680,      160,      320, 0xf0359e9a
-0,      27840,      27840,      160,      320, 0x51199fff
-0,      28000,      28000,      160,      320, 0xb04aa236
-0,      28160,      28160,      160,      320, 0xe09da0e3
-0,      28320,      28320,      160,      320, 0x144f98a9
-0,      28480,      28480,      160,      320, 0x0b4e9f8d
-0,      28640,      28640,      160,      320, 0xbb69a090
-0,      28800,      28800,      160,      320, 0xec6e9b5b
-0,      28960,      28960,      160,      320, 0x4f86a477
-0,      29120,      29120,      160,      320, 0x4a179d04
-0,      29280,      29280,      160,      320, 0x9682a375
-0,      29440,      29440,      160,      320, 0x3c6ba55e
-0,      29600,      29600,      160,      320, 0x50c0ab50
-0,      29760,      29760,      160,      320, 0xe58ea907
-0,      29920,      29920,      160,      320, 0xc5eaa021
-0,      30080,      30080,      160,      320, 0x38859f01
-0,      30240,      30240,      160,      320, 0x73f8a540
-0,      30400,      30400,      160,      320, 0x395da234
-0,      30560,      30560,      160,      320, 0x7f50b144
-0,      30720,      30720,      160,      320, 0x45568ceb
-0,      30880,      30880,      160,      320, 0xd0508dec
-0,      31040,      31040,      160,      320, 0x60aba7e4
-0,      31200,      31200,      160,      320, 0x4b24b15f
-0,      31360,      31360,      160,      320, 0xbfc9afd6
-0,      31520,      31520,      160,      320, 0xf0f2ad49
-0,      31680,      31680,      160,      320, 0xeea0a426
-0,      31840,      31840,      160,      320, 0xff07a7c9
-0,      32000,      32000,      160,      320, 0xce1fc788
-0,      32160,      32160,      160,      320, 0xc074ae9b
-0,      32320,      32320,      160,      320, 0x51649696
-0,      32480,      32480,      160,      320, 0x24399744
-0,      32640,      32640,      160,      320, 0xfb0eb920
-0,      32800,      32800,      160,      320, 0x3bf8af5c
-0,      32960,      32960,      160,      320, 0xeab69ee0
-0,      33120,      33120,      160,      320, 0x182696bb
-0,      33280,      33280,      160,      320, 0x36e6af72
-0,      33440,      33440,      160,      320, 0x48cc9ecc
-0,      33600,      33600,      160,      320, 0xfb3ca7b8
-0,      33760,      33760,      160,      320, 0xe01aa4b4
-0,      33920,      33920,      160,      320, 0x5c6dac8c
-0,      34080,      34080,      160,      320, 0x072fbd93
-0,      34240,      34240,      160,      320, 0xc8899ccc
-0,      34400,      34400,      160,      320, 0xdcc990ac
-0,      34560,      34560,      160,      320, 0x28e0a9d0
-0,      34720,      34720,      160,      320, 0x0cdbaa11
-0,      34880,      34880,      160,      320, 0x8f4ca093
-0,      35040,      35040,      160,      320, 0x7ee79ea9
-0,      35200,      35200,      160,      320, 0xa762b695
-0,      35360,      35360,      160,      320, 0x9af0b5da
-0,      35520,      35520,      160,      320, 0x1f2cb0e7
-0,      35680,      35680,      160,      320, 0x6029b8bb
-0,      35840,      35840,      160,      320, 0xf2f7acec
-0,      36000,      36000,      160,      320, 0xb3e5b5be
-0,      36160,      36160,      160,      320, 0x266ba8a6
-0,      36320,      36320,      160,      320, 0x4ff59296
-0,      36480,      36480,      160,      320, 0x11d1b9ac
-0,      36640,      36640,      160,      320, 0x749197f7
-0,      36800,      36800,      160,      320, 0x8192b517
-0,      36960,      36960,      160,      320, 0xde129dbe
-0,      37120,      37120,      160,      320, 0x85e4a096
-0,      37280,      37280,      160,      320, 0xdebf9182
-0,      37440,      37440,      160,      320, 0x7a4ba0bf
-0,      37600,      37600,      160,      320, 0x55fe9fcd
-0,      37760,      37760,      160,      320, 0xd242adec
-0,      37920,      37920,      160,      320, 0xeaf5b159
-0,      38080,      38080,      160,      320, 0xfcb1a571
-0,      38240,      38240,      160,      320, 0x62fabda0
-0,      38400,      38400,      160,      320, 0x45a9abcc
-0,      38560,      38560,      160,      320, 0x07af974b
-0,      38720,      38720,      160,      320, 0xc2a0b4fd
-0,      38880,      38880,      160,      320, 0xc30abccd
-0,      39040,      39040,      160,      320, 0xd33ca61c
-0,      39200,      39200,      160,      320, 0x3c33d11a
-0,      39360,      39360,      160,      320, 0x9c2ca0ac
-0,      39520,      39520,      160,      320, 0xa5d69777
-0,      39680,      39680,      160,      320, 0xb7d2c6b8
-0,      39840,      39840,      160,      320, 0x34bbaab9
-0,      40000,      40000,      160,      320, 0x3e7baccb
-0,      40160,      40160,      160,      320, 0x92c6b7e6
-0,      40320,      40320,      160,      320, 0xc810a18a
-0,      40480,      40480,      160,      320, 0x06a09f56
-0,      40640,      40640,      160,      320, 0x8804a504
-0,      40800,      40800,      160,      320, 0x783ba7d5
-0,      40960,      40960,      160,      320, 0x24dcada6
-0,      41120,      41120,      160,      320, 0x4af796be
-0,      41280,      41280,      160,      320, 0x1454b19c
-0,      41440,      41440,      160,      320, 0x0ad0a56e
-0,      41600,      41600,      160,      320, 0x8944a44e
-0,      41760,      41760,      160,      320, 0x31069ebd
-0,      41920,      41920,      160,      320, 0x19cb9812
-0,      42080,      42080,      160,      320, 0xac75abe2
-0,      42240,      42240,      160,      320, 0x0162a200
-0,      42400,      42400,      160,      320, 0xa2d7a4b2
-0,      42560,      42560,      160,      320, 0x078ca611
-0,      42720,      42720,      160,      320, 0x0ec39b40
-0,      42880,      42880,      160,      320, 0xe8f794b2
-0,      43040,      43040,      160,      320, 0xc2cfb258
-0,      43200,      43200,      160,      320, 0xe4759061
-0,      43360,      43360,      160,      320, 0xb1b6aea4
-0,      43520,      43520,      160,      320, 0x9bfb96df
-0,      43680,      43680,      160,      320, 0xcc61b5d3
-0,      43840,      43840,      160,      320, 0xd14e8df9
-0,      44000,      44000,      160,      320, 0xd9d5bbf5
-0,      44160,      44160,      160,      320, 0x4d9fa9b0
-0,      44320,      44320,      160,      320, 0xf606abfc
-0,      44480,      44480,      160,      320, 0x720baa19
-0,      44640,      44640,      160,      320, 0x7f7cac49
-0,      44800,      44800,      160,      320, 0xceab9b54
-0,      44960,      44960,      160,      320, 0x645fa70a
-0,      45120,      45120,      160,      320, 0xa081a40f
-0,      45280,      45280,      160,      320, 0x21d78f8c
-0,      45440,      45440,      160,      320, 0xedf3abc6
-0,      45600,      45600,      160,      320, 0x17679637
-0,      45760,      45760,      160,      320, 0x1cb1ae04
-0,      45920,      45920,      160,      320, 0x17cd9f62
-0,      46080,      46080,      160,      320, 0xf4bca3ab
-0,      46240,      46240,      160,      320, 0xb3bd9152
-0,      46400,      46400,      160,      320, 0x4e1e9825
-0,      46560,      46560,      160,      320, 0x037e9a56
-0,      46720,      46720,      160,      320, 0xd7589fcc
-0,      46880,      46880,      160,      320, 0x5f949e90
-0,      47040,      47040,      160,      320, 0xe133a495
-0,      47200,      47200,      160,      320, 0x7cb7a52c
-0,      47360,      47360,      160,      320, 0xb8b29d95
-0,      47520,      47520,      160,      320, 0x01bca472
-0,      47680,      47680,      160,      320, 0xbcc69895
-0,      47840,      47840,      160,      320, 0xabffa0ee
-0,      48000,      48000,      160,      320, 0xe6629eca
-0,      48160,      48160,      160,      320, 0x572da7cd
-0,      48320,      48320,      160,      320, 0x3017972d
-0,      48480,      48480,      160,      320, 0xac4e9c78
-0,      48640,      48640,      160,      320, 0x112f9c45
-0,      48800,      48800,      160,      320, 0x05e9a64d
-0,      48960,      48960,      160,      320, 0x8f7394d4
-0,      49120,      49120,      160,      320, 0xbaeea07e
-0,      49280,      49280,      160,      320, 0xd757c00e
-0,      49440,      49440,      160,      320, 0x8aa09783
-0,      49600,      49600,      160,      320, 0x31d4ae7a
-0,      49760,      49760,      160,      320, 0x221493e8
-0,      49920,      49920,      160,      320, 0x92f4a3a7
-0,      50080,      50080,      160,      320, 0xbd5bafd9
-0,      50240,      50240,      160,      320, 0x1895b760
-0,      50400,      50400,      160,      320, 0x7a4eacdd
-0,      50560,      50560,      160,      320, 0xc9f7a1c3
-0,      50720,      50720,      160,      320, 0xd750be06
-0,      50880,      50880,      160,      320, 0x641d9a6f
-0,      51040,      51040,      160,      320, 0x70d6b6ff
-0,      51200,      51200,      160,      320, 0x1fd3a546
-0,      51360,      51360,      160,      320, 0x72cfaabe
-0,      51520,      51520,      160,      320, 0x2e61b6ce
-0,      51680,      51680,      160,      320, 0x4813a091
-0,      51840,      51840,      160,      320, 0xbfe7bc0f
-0,      52000,      52000,      160,      320, 0x8c759c1f
-0,      52160,      52160,      160,      320, 0xf4c1c952
-0,      52320,      52320,      160,      320, 0x00fdaa79
-0,      52480,      52480,      160,      320, 0x2ffda252
-0,      52640,      52640,      160,      320, 0x841aa523
-0,      52800,      52800,      160,      320, 0x8c079e5e
-0,      52960,      52960,      160,      320, 0x96e9a83f
-0,      53120,      53120,      160,      320, 0x5926a639
-0,      53280,      53280,      160,      320, 0x02e1a07b
-0,      53440,      53440,      160,      320, 0x2972a999
-0,      53600,      53600,      160,      320, 0x30c89c62
-0,      53760,      53760,      160,      320, 0x83f5a263
-0,      53920,      53920,      160,      320, 0xa3909667
-0,      54080,      54080,      160,      320, 0xd5309fd4
-0,      54240,      54240,      160,      320, 0x3154a571
-0,      54400,      54400,      160,      320, 0x51039a5e
-0,      54560,      54560,      160,      320, 0xf167a344
-0,      54720,      54720,      160,      320, 0x8e709d7d
-0,      54880,      54880,      160,      320, 0x936fa0fd
-0,      55040,      55040,      160,      320, 0x024b9e3c
-0,      55200,      55200,      160,      320, 0x2ea1aa75
-0,      55360,      55360,      160,      320, 0x33f0a2bb
-0,      55520,      55520,      160,      320, 0xbf079d2d
-0,      55680,      55680,      160,      320, 0x847ba2c8
-0,      55840,      55840,      160,      320, 0x37e1a767
-0,      56000,      56000,      160,      320, 0xb607acbb
-0,      56160,      56160,      160,      320, 0x1288ac6d
-0,      56320,      56320,      160,      320, 0xf60e98b3
-0,      56480,      56480,      160,      320, 0xc6b5abdd
-0,      56640,      56640,      160,      320, 0x7feaa710
-0,      56800,      56800,      160,      320, 0x77329fcd
-0,      56960,      56960,      160,      320, 0x91a6a715
-0,      57120,      57120,      160,      320, 0xd0e99f24
-0,      57280,      57280,      160,      320, 0x07089f61
-0,      57440,      57440,      160,      320, 0x2bbda900
-0,      57600,      57600,      160,      320, 0xad3da0d5
-0,      57760,      57760,      160,      320, 0x997ba6d2
-0,      57920,      57920,      160,      320, 0xb15b9dcb
-0,      58080,      58080,      160,      320, 0x17cea82f
-0,      58240,      58240,      160,      320, 0xab51a73e
-0,      58400,      58400,      160,      320, 0x77a1abd6
-0,      58560,      58560,      160,      320, 0x0bddacad
-0,      58720,      58720,      160,      320, 0x43b3bdc4
-0,      58880,      58880,      160,      320, 0xefe0a9ba
-0,      59040,      59040,      160,      320, 0x8eb4bc2f
-0,      59200,      59200,      160,      320, 0x39cdc190
-0,      59360,      59360,      160,      320, 0x1ef3baff
-0,      59520,      59520,      160,      320, 0x1a6ab7e2
-0,      59680,      59680,      160,      320, 0x444ccc69
-0,      59840,      59840,      160,      320, 0x05ebb598
-0,      60000,      60000,      160,      320, 0x4ac5b0ad
-0,      60160,      60160,      160,      320, 0x0ee5ba52
-0,      60320,      60320,      160,      320, 0x501d9fa0
-0,      60480,      60480,      160,      320, 0x2038a9f4
-0,      60640,      60640,      160,      320, 0xa61cb8b3
-0,      60800,      60800,      160,      320, 0xdd009777
-0,      60960,      60960,      160,      320, 0x2a2db86d
-0,      61120,      61120,      160,      320, 0xe9bab3bc
-0,      61280,      61280,      160,      320, 0xf7f8a056
-0,      61440,      61440,      160,      320, 0x514caf14
-0,      61600,      61600,      160,      320, 0xa220b149
-0,      61760,      61760,      160,      320, 0xbf7ea183
-0,      61920,      61920,      160,      320, 0x1d8dc5c6
-0,      62080,      62080,      160,      320, 0x9182a8ea
-0,      62240,      62240,      160,      320, 0x31eba026
-0,      62400,      62400,      160,      320, 0xcfbcc3df
-0,      62560,      62560,      160,      320, 0x3d8cb7ae
-0,      62720,      62720,      160,      320, 0xbe39aec0
-0,      62880,      62880,      160,      320, 0xd236bf71
-0,      63040,      63040,      160,      320, 0x9377b0b2
-0,      63200,      63200,      160,      320, 0xb5e6b2df
-0,      63360,      63360,      160,      320, 0xa3b9bbce
-0,      63520,      63520,      160,      320, 0xa7bda251
-0,      63680,      63680,      160,      320, 0xbf9ab162
-0,      63840,      63840,      160,      320, 0x6928b9cb
-0,      64000,      64000,      160,      320, 0xf5cca209
-0,      64160,      64160,      160,      320, 0xfdf4afad
-0,      64320,      64320,      160,      320, 0xe7e7c216
-0,      64480,      64480,      160,      320, 0x0c5797c6
-0,      64640,      64640,      160,      320, 0x66c1a9ca
-0,      64800,      64800,      160,      320, 0x6b5ca48d
-0,      64960,      64960,      160,      320, 0xec04968a
-0,      65120,      65120,      160,      320, 0xaaada691
-0,      65280,      65280,      160,      320, 0x77c3a624
-0,      65440,      65440,      160,      320, 0xaed9a5d5
-0,      65600,      65600,      160,      320, 0x360fac41
-0,      65760,      65760,      160,      320, 0xa05ea727
-0,      65920,      65920,      160,      320, 0x9f7b9f83
-0,      66080,      66080,      160,      320, 0x474bc4c2
-0,      66240,      66240,      160,      320, 0xb6078d3b
-0,      66400,      66400,      160,      320, 0x8e15a8f9
-0,      66560,      66560,      160,      320, 0x7dc7d4a8
-0,      66720,      66720,      160,      320, 0x55ceab6b
-0,      66880,      66880,      160,      320, 0x982cc94f
-0,      67040,      67040,      160,      320, 0x6153948f
-0,      67200,      67200,      160,      320, 0x5338c621
-0,      67360,      67360,      160,      320, 0x2e2db6e8
-0,      67520,      67520,      160,      320, 0x28e3a9c3
-0,      67680,      67680,      160,      320, 0x74d7b435
-0,      67840,      67840,      160,      320, 0xcf17a10c
-0,      68000,      68000,      160,      320, 0xf1f9ac8c
-0,      68160,      68160,      160,      320, 0x35e0b480
-0,      68320,      68320,      160,      320, 0x5e60b3a4
-0,      68480,      68480,      160,      320, 0x20579b26
-0,      68640,      68640,      160,      320, 0x3e27b89b
-0,      68800,      68800,      160,      320, 0x02e4af94
-0,      68960,      68960,      160,      320, 0x6d6897f1
-0,      69120,      69120,      160,      320, 0x1582b267
-0,      69280,      69280,      160,      320, 0x33ba9eb3
-0,      69440,      69440,      160,      320, 0xb6acad7d
-0,      69600,      69600,      160,      320, 0x1969a6c2
-0,      69760,      69760,      160,      320, 0x363fa350
-0,      69920,      69920,      160,      320, 0xae50bf65
-0,      70080,      70080,      160,      320, 0x0877a50f
-0,      70240,      70240,      160,      320, 0x66e2a42f
-0,      70400,      70400,      160,      320, 0x0b0abcb3
-0,      70560,      70560,      160,      320, 0x23a9afaa
-0,      70720,      70720,      160,      320, 0xc3729b40
-0,      70880,      70880,      160,      320, 0xdd3fc7e2
-0,      71040,      71040,      160,      320, 0x7e0494af
-0,      71200,      71200,      160,      320, 0xcbd096fb
-0,      71360,      71360,      160,      320, 0x5d71b303
-0,      71520,      71520,      160,      320, 0xeedca04a
-0,      71680,      71680,      160,      320, 0x2836a47d
-0,      71840,      71840,      160,      320, 0x7237c2a0
-0,      72000,      72000,      160,      320, 0x7c009bc0
-0,      72160,      72160,      160,      320, 0xc9dcb366
-0,      72320,      72320,      160,      320, 0x4993aac8
-0,      72480,      72480,      160,      320, 0x05ec9954
-0,      72640,      72640,      160,      320, 0xa955bd5c
-0,      72800,      72800,      160,      320, 0x9018aea3
-0,      72960,      72960,      160,      320, 0x780cca52
-0,      73120,      73120,      160,      320, 0x9b8f95f6
-0,      73280,      73280,      160,      320, 0xcd7bb178
-0,      73440,      73440,      160,      320, 0xfec6b443
-0,      73600,      73600,      160,      320, 0xe214abb6
-0,      73760,      73760,      160,      320, 0xdcbebb38
-0,      73920,      73920,      160,      320, 0xe683a30d
-0,      74080,      74080,      160,      320, 0xe4cdb197
-0,      74240,      74240,      160,      320, 0xa426c432
-0,      74400,      74400,      160,      320, 0x761ba6cc
-0,      74560,      74560,      160,      320, 0xcc9aa6aa
-0,      74720,      74720,      160,      320, 0x742bd03d
-0,      74880,      74880,      160,      320, 0x61d9a511
-0,      75040,      75040,      160,      320, 0x3021a4dd
-0,      75200,      75200,      160,      320, 0x6970bbc0
-0,      75360,      75360,      160,      320, 0x76f5a037
-0,      75520,      75520,      160,      320, 0x758d91f2
-0,      75680,      75680,      160,      320, 0xe854a2f1
-0,      75840,      75840,      160,      320, 0xf994a6f8
-0,      76000,      76000,      160,      320, 0x31ebaf40
-0,      76160,      76160,      160,      320, 0x24699970
-0,      76320,      76320,      160,      320, 0x37dda53e
-0,      76480,      76480,      160,      320, 0xa857a752
-0,      76640,      76640,      160,      320, 0xc483ad1d
-0,      76800,      76800,      160,      320, 0x5966add9
-0,      76960,      76960,      160,      320, 0x4dbab89c
-0,      77120,      77120,      160,      320, 0x2f0bb0e6
-0,      77280,      77280,      160,      320, 0x913aaa88
-0,      77440,      77440,      160,      320, 0x245dc1c3
-0,      77600,      77600,      160,      320, 0xb085c5ad
-0,      77760,      77760,      160,      320, 0x9cf1b0fa
-0,      77920,      77920,      160,      320, 0x6887b543
-0,      78080,      78080,      160,      320, 0xcad69feb
-0,      78240,      78240,      160,      320, 0xc12a8ddb
-0,      78400,      78400,      160,      320, 0x01d1bc5a
-0,      78560,      78560,      160,      320, 0x3018b7e8
-0,      78720,      78720,      160,      320, 0x6431b0ef
-0,      78880,      78880,      160,      320, 0x3a53998e
-0,      79040,      79040,      160,      320, 0x1c80a6c6
-0,      79200,      79200,      160,      320, 0x6639adc5
-0,      79360,      79360,      160,      320, 0x92489f9a
-0,      79520,      79520,      160,      320, 0x8cafad00
-0,      79680,      79680,      160,      320, 0xca0392e1
-0,      79840,      79840,      160,      320, 0x30a9ae88
diff --git a/deps/libav/tests/ref/fate/h264-bsf-mp4toannexb b/deps/libav/tests/ref/fate/h264-bsf-mp4toannexb
deleted file mode 100644
index 2049f39..0000000
--- a/deps/libav/tests/ref/fate/h264-bsf-mp4toannexb
+++ /dev/null
@@ -1 +0,0 @@
-5f04c27cc6ee8625fe2405fb0f7da9a3
diff --git a/deps/libav/tests/ref/fate/h264-conformance-aud_mw_e b/deps/libav/tests/ref/fate/h264-conformance-aud_mw_e
deleted file mode 100644
index 83c6fae..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-aud_mw_e
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xa6d63b2e
-0,          1,          1,        1,    38016, 0x28bae101
-0,          2,          2,        1,    38016, 0x139f9b29
-0,          3,          3,        1,    38016, 0xa7b463e8
-0,          4,          4,        1,    38016, 0xdcdc5130
-0,          5,          5,        1,    38016, 0x3cf17039
-0,          6,          6,        1,    38016, 0xdeeb9ae9
-0,          7,          7,        1,    38016, 0xdc8da889
-0,          8,          8,        1,    38016, 0x7a32a81c
-0,          9,          9,        1,    38016, 0xaf15908b
-0,         10,         10,        1,    38016, 0x4c8b5461
-0,         11,         11,        1,    38016, 0x1d4826db
-0,         12,         12,        1,    38016, 0x5ca72731
-0,         13,         13,        1,    38016, 0xb09732e6
-0,         14,         14,        1,    38016, 0xa65252eb
-0,         15,         15,        1,    38016, 0x09fa7644
-0,         16,         16,        1,    38016, 0x5262af8f
-0,         17,         17,        1,    38016, 0x50d6c6ac
-0,         18,         18,        1,    38016, 0x6895c300
-0,         19,         19,        1,    38016, 0x2d58bf4f
-0,         20,         20,        1,    38016, 0x50dfc4c0
-0,         21,         21,        1,    38016, 0x12d2cb90
-0,         22,         22,        1,    38016, 0xe465c7d7
-0,         23,         23,        1,    38016, 0x47c5c615
-0,         24,         24,        1,    38016, 0x76fdc6e6
-0,         25,         25,        1,    38016, 0xefeec7ae
-0,         26,         26,        1,    38016, 0x2cebcdf7
-0,         27,         27,        1,    38016, 0x49abd265
-0,         28,         28,        1,    38016, 0x157bdfe4
-0,         29,         29,        1,    38016, 0x3635e5da
-0,         30,         30,        1,    38016, 0x6263aace
-0,         31,         31,        1,    38016, 0x7fff72f0
-0,         32,         32,        1,    38016, 0x83994b85
-0,         33,         33,        1,    38016, 0xa8c990a7
-0,         34,         34,        1,    38016, 0xce5204c4
-0,         35,         35,        1,    38016, 0xf1176131
-0,         36,         36,        1,    38016, 0x4252bdca
-0,         37,         37,        1,    38016, 0xd8f447c3
-0,         38,         38,        1,    38016, 0xc5e79075
-0,         39,         39,        1,    38016, 0x5291ca60
-0,         40,         40,        1,    38016, 0x5dffe889
-0,         41,         41,        1,    38016, 0x6dc4fad6
-0,         42,         42,        1,    38016, 0xbcc7f16a
-0,         43,         43,        1,    38016, 0xcd5c059a
-0,         44,         44,        1,    38016, 0x452314ad
-0,         45,         45,        1,    38016, 0x19d1fd99
-0,         46,         46,        1,    38016, 0x93f4ca3c
-0,         47,         47,        1,    38016, 0x23dd9d81
-0,         48,         48,        1,    38016, 0x4a4cabdb
-0,         49,         49,        1,    38016, 0x15a3d785
-0,         50,         50,        1,    38016, 0xaa34e055
-0,         51,         51,        1,    38016, 0x8a34b88d
-0,         52,         52,        1,    38016, 0x1955d649
-0,         53,         53,        1,    38016, 0xf6dc0782
-0,         54,         54,        1,    38016, 0x66cb360a
-0,         55,         55,        1,    38016, 0xf3615cfb
-0,         56,         56,        1,    38016, 0xca466b6d
-0,         57,         57,        1,    38016, 0xe0ad3523
-0,         58,         58,        1,    38016, 0x8181323e
-0,         59,         59,        1,    38016, 0x93324bab
-0,         60,         60,        1,    38016, 0xce2c38b6
-0,         61,         61,        1,    38016, 0xe50a20fc
-0,         62,         62,        1,    38016, 0x8a74ce30
-0,         63,         63,        1,    38016, 0x893ca7d8
-0,         64,         64,        1,    38016, 0x716fd810
-0,         65,         65,        1,    38016, 0x352aeb3c
-0,         66,         66,        1,    38016, 0xdf14e4d1
-0,         67,         67,        1,    38016, 0x7e87dd42
-0,         68,         68,        1,    38016, 0xe084c706
-0,         69,         69,        1,    38016, 0x4000ba1f
-0,         70,         70,        1,    38016, 0x10679f5a
-0,         71,         71,        1,    38016, 0x5cb686b2
-0,         72,         72,        1,    38016, 0x5dea8ffe
-0,         73,         73,        1,    38016, 0x8bd27fc8
-0,         74,         74,        1,    38016, 0x72912b15
-0,         75,         75,        1,    38016, 0xb86be965
-0,         76,         76,        1,    38016, 0x7a42da39
-0,         77,         77,        1,    38016, 0x9ddacae0
-0,         78,         78,        1,    38016, 0xb767ff5b
-0,         79,         79,        1,    38016, 0xa3c64887
-0,         80,         80,        1,    38016, 0xbc6981f2
-0,         81,         81,        1,    38016, 0xc2506c22
-0,         82,         82,        1,    38016, 0x6e785862
-0,         83,         83,        1,    38016, 0xfade2b2d
-0,         84,         84,        1,    38016, 0xada1d917
-0,         85,         85,        1,    38016, 0x459beba1
-0,         86,         86,        1,    38016, 0x8b491f3c
-0,         87,         87,        1,    38016, 0x917b0fab
-0,         88,         88,        1,    38016, 0x053fb1d2
-0,         89,         89,        1,    38016, 0x96e44e17
-0,         90,         90,        1,    38016, 0x4d34f7e0
-0,         91,         91,        1,    38016, 0x2265c386
-0,         92,         92,        1,    38016, 0xc45dd284
-0,         93,         93,        1,    38016, 0x0638fca3
-0,         94,         94,        1,    38016, 0xcd9c2bbc
-0,         95,         95,        1,    38016, 0x3220dea3
-0,         96,         96,        1,    38016, 0x72dfb576
-0,         97,         97,        1,    38016, 0xb804ee86
-0,         98,         98,        1,    38016, 0xbd516400
-0,         99,         99,        1,    38016, 0x737fa296
diff --git a/deps/libav/tests/ref/fate/h264-conformance-ba1_ft_c b/deps/libav/tests/ref/fate/h264-conformance-ba1_ft_c
deleted file mode 100644
index 9f6bc23..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-ba1_ft_c
+++ /dev/null
@@ -1,300 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xa6f9b2a8
-0,          1,          1,        1,   152064, 0x936a8ed6
-0,          2,          2,        1,   152064, 0xa9f47652
-0,          3,          3,        1,   152064, 0xf53ea804
-0,          4,          4,        1,   152064, 0xc951304d
-0,          5,          5,        1,   152064, 0x59b786b9
-0,          6,          6,        1,   152064, 0x01b3d9e9
-0,          7,          7,        1,   152064, 0x94db5883
-0,          8,          8,        1,   152064, 0xef01ce6c
-0,          9,          9,        1,   152064, 0x18401484
-0,         10,         10,        1,   152064, 0xf8773e58
-0,         11,         11,        1,   152064, 0x09d07ae7
-0,         12,         12,        1,   152064, 0xbbec5291
-0,         13,         13,        1,   152064, 0x1ddcbb1e
-0,         14,         14,        1,   152064, 0x51b257f2
-0,         15,         15,        1,   152064, 0x2e537d43
-0,         16,         16,        1,   152064, 0xc4d3c391
-0,         17,         17,        1,   152064, 0xe6d0ed1c
-0,         18,         18,        1,   152064, 0x99d81859
-0,         19,         19,        1,   152064, 0xba1c1693
-0,         20,         20,        1,   152064, 0x60a22321
-0,         21,         21,        1,   152064, 0xfe000aee
-0,         22,         22,        1,   152064, 0x3b056f2d
-0,         23,         23,        1,   152064, 0xf735caf9
-0,         24,         24,        1,   152064, 0x81b94a66
-0,         25,         25,        1,   152064, 0x28ad08af
-0,         26,         26,        1,   152064, 0x69b316f5
-0,         27,         27,        1,   152064, 0xa90e6480
-0,         28,         28,        1,   152064, 0x2600a97a
-0,         29,         29,        1,   152064, 0x28b1e894
-0,         30,         30,        1,   152064, 0x8caaeb3c
-0,         31,         31,        1,   152064, 0xeaa3cd5d
-0,         32,         32,        1,   152064, 0x2aeab842
-0,         33,         33,        1,   152064, 0x8781b8fe
-0,         34,         34,        1,   152064, 0xd5829de5
-0,         35,         35,        1,   152064, 0xd04489cd
-0,         36,         36,        1,   152064, 0xfe268158
-0,         37,         37,        1,   152064, 0x43917137
-0,         38,         38,        1,   152064, 0x99963053
-0,         39,         39,        1,   152064, 0xe085087d
-0,         40,         40,        1,   152064, 0x0344f8d3
-0,         41,         41,        1,   152064, 0xe353b02a
-0,         42,         42,        1,   152064, 0x3f84816d
-0,         43,         43,        1,   152064, 0x3c3a8145
-0,         44,         44,        1,   152064, 0x478caf10
-0,         45,         45,        1,   152064, 0xdc879176
-0,         46,         46,        1,   152064, 0x502f3b81
-0,         47,         47,        1,   152064, 0x49997d1a
-0,         48,         48,        1,   152064, 0x6375e30f
-0,         49,         49,        1,   152064, 0x2abd5994
-0,         50,         50,        1,   152064, 0xa32a06a0
-0,         51,         51,        1,   152064, 0x9a2aed47
-0,         52,         52,        1,   152064, 0x1963fa9d
-0,         53,         53,        1,   152064, 0xa429cc58
-0,         54,         54,        1,   152064, 0x8f08abca
-0,         55,         55,        1,   152064, 0xdabe3408
-0,         56,         56,        1,   152064, 0x5b94b0f1
-0,         57,         57,        1,   152064, 0xb2565ba5
-0,         58,         58,        1,   152064, 0x6eaf3500
-0,         59,         59,        1,   152064, 0x04d79374
-0,         60,         60,        1,   152064, 0x0a9281d7
-0,         61,         61,        1,   152064, 0x97bf672b
-0,         62,         62,        1,   152064, 0x996d0b1a
-0,         63,         63,        1,   152064, 0xb5c4d52d
-0,         64,         64,        1,   152064, 0x8ab3897b
-0,         65,         65,        1,   152064, 0xd3303ae0
-0,         66,         66,        1,   152064, 0x2c217280
-0,         67,         67,        1,   152064, 0xcc21c7ff
-0,         68,         68,        1,   152064, 0xf9ae50ea
-0,         69,         69,        1,   152064, 0xa8af67a2
-0,         70,         70,        1,   152064, 0xba2cbf40
-0,         71,         71,        1,   152064, 0x80364875
-0,         72,         72,        1,   152064, 0xe7028c24
-0,         73,         73,        1,   152064, 0x6730636d
-0,         74,         74,        1,   152064, 0xd5d9bf5f
-0,         75,         75,        1,   152064, 0x2ec4cf74
-0,         76,         76,        1,   152064, 0x47c0e7ec
-0,         77,         77,        1,   152064, 0x0e1741fb
-0,         78,         78,        1,   152064, 0x4b39d9b6
-0,         79,         79,        1,   152064, 0x30737f2e
-0,         80,         80,        1,   152064, 0xce133061
-0,         81,         81,        1,   152064, 0x3b7ce6b9
-0,         82,         82,        1,   152064, 0x5b11d100
-0,         83,         83,        1,   152064, 0x8bd801ca
-0,         84,         84,        1,   152064, 0x5d322cf6
-0,         85,         85,        1,   152064, 0xdd47a0a3
-0,         86,         86,        1,   152064, 0x0e3b3c60
-0,         87,         87,        1,   152064, 0x8b69ac27
-0,         88,         88,        1,   152064, 0xef66b267
-0,         89,         89,        1,   152064, 0x29140655
-0,         90,         90,        1,   152064, 0x25f6ae5c
-0,         91,         91,        1,   152064, 0xc1a48b89
-0,         92,         92,        1,   152064, 0xc3eee9e4
-0,         93,         93,        1,   152064, 0xec23534a
-0,         94,         94,        1,   152064, 0x9eed2a2e
-0,         95,         95,        1,   152064, 0x7e5de8e7
-0,         96,         96,        1,   152064, 0x8d824e10
-0,         97,         97,        1,   152064, 0x841ebdc5
-0,         98,         98,        1,   152064, 0x9bc03542
-0,         99,         99,        1,   152064, 0xd77d5b14
-0,        100,        100,        1,   152064, 0x2b4597ed
-0,        101,        101,        1,   152064, 0xf460a0c5
-0,        102,        102,        1,   152064, 0x01f58bf9
-0,        103,        103,        1,   152064, 0xa5cb8dd9
-0,        104,        104,        1,   152064, 0x12e49e6f
-0,        105,        105,        1,   152064, 0x6aaac311
-0,        106,        106,        1,   152064, 0x0ff1d37a
-0,        107,        107,        1,   152064, 0x0e5ca8ce
-0,        108,        108,        1,   152064, 0x997c3a1f
-0,        109,        109,        1,   152064, 0x83c1d64e
-0,        110,        110,        1,   152064, 0xed2379a3
-0,        111,        111,        1,   152064, 0xe6b83696
-0,        112,        112,        1,   152064, 0x1a7c1864
-0,        113,        113,        1,   152064, 0xb0bcf08e
-0,        114,        114,        1,   152064, 0x74deb96f
-0,        115,        115,        1,   152064, 0xe86a9396
-0,        116,        116,        1,   152064, 0xf78a916b
-0,        117,        117,        1,   152064, 0x8d35a888
-0,        118,        118,        1,   152064, 0xb01a956d
-0,        119,        119,        1,   152064, 0xc8d37b7d
-0,        120,        120,        1,   152064, 0x903251c9
-0,        121,        121,        1,   152064, 0x93b819ac
-0,        122,        122,        1,   152064, 0xb949f48f
-0,        123,        123,        1,   152064, 0x7dbfeaba
-0,        124,        124,        1,   152064, 0x951903ae
-0,        125,        125,        1,   152064, 0x05742b8e
-0,        126,        126,        1,   152064, 0xb270514a
-0,        127,        127,        1,   152064, 0xf729867a
-0,        128,        128,        1,   152064, 0x7e05f652
-0,        129,        129,        1,   152064, 0x32a99f23
-0,        130,        130,        1,   152064, 0x57e7394b
-0,        131,        131,        1,   152064, 0xc0ffc453
-0,        132,        132,        1,   152064, 0x7b1e79fa
-0,        133,        133,        1,   152064, 0x90ee1d52
-0,        134,        134,        1,   152064, 0xaed672a8
-0,        135,        135,        1,   152064, 0xa253ccc4
-0,        136,        136,        1,   152064, 0x2d0807f9
-0,        137,        137,        1,   152064, 0xdc7ec4cc
-0,        138,        138,        1,   152064, 0x3c624e2e
-0,        139,        139,        1,   152064, 0xfa4a91dd
-0,        140,        140,        1,   152064, 0xcaa83992
-0,        141,        141,        1,   152064, 0x81e5c52d
-0,        142,        142,        1,   152064, 0x46ab76f8
-0,        143,        143,        1,   152064, 0x4ab115d8
-0,        144,        144,        1,   152064, 0x65d8c9d7
-0,        145,        145,        1,   152064, 0xcb1e16b1
-0,        146,        146,        1,   152064, 0xb766c029
-0,        147,        147,        1,   152064, 0x2a49c7c0
-0,        148,        148,        1,   152064, 0x37f35440
-0,        149,        149,        1,   152064, 0x33b4940f
-0,        150,        150,        1,   152064, 0x6b22fb9a
-0,        151,        151,        1,   152064, 0x785e138a
-0,        152,        152,        1,   152064, 0xc7a1954a
-0,        153,        153,        1,   152064, 0x6f325026
-0,        154,        154,        1,   152064, 0x23d6bf8d
-0,        155,        155,        1,   152064, 0x8e6f5815
-0,        156,        156,        1,   152064, 0x434c4770
-0,        157,        157,        1,   152064, 0x22319908
-0,        158,        158,        1,   152064, 0xec368ac8
-0,        159,        159,        1,   152064, 0xc69d7306
-0,        160,        160,        1,   152064, 0xc10ab1c8
-0,        161,        161,        1,   152064, 0x2497f329
-0,        162,        162,        1,   152064, 0x95782b50
-0,        163,        163,        1,   152064, 0xe0481c57
-0,        164,        164,        1,   152064, 0xa656f1e6
-0,        165,        165,        1,   152064, 0x562da8a1
-0,        166,        166,        1,   152064, 0x21716296
-0,        167,        167,        1,   152064, 0xb1ffd9de
-0,        168,        168,        1,   152064, 0x49204932
-0,        169,        169,        1,   152064, 0x88e1ac93
-0,        170,        170,        1,   152064, 0x6abb5dfb
-0,        171,        171,        1,   152064, 0xacdede42
-0,        172,        172,        1,   152064, 0xca28f448
-0,        173,        173,        1,   152064, 0x6b7e5e84
-0,        174,        174,        1,   152064, 0x464d4b58
-0,        175,        175,        1,   152064, 0xd39620f1
-0,        176,        176,        1,   152064, 0x67336772
-0,        177,        177,        1,   152064, 0x6de386c2
-0,        178,        178,        1,   152064, 0x6d8fbc97
-0,        179,        179,        1,   152064, 0x09fbc88d
-0,        180,        180,        1,   152064, 0x08dfa188
-0,        181,        181,        1,   152064, 0xf3461401
-0,        182,        182,        1,   152064, 0xdd6d1ce5
-0,        183,        183,        1,   152064, 0x90182ee8
-0,        184,        184,        1,   152064, 0xcb7cf9a2
-0,        185,        185,        1,   152064, 0x237e59bd
-0,        186,        186,        1,   152064, 0xf2efa664
-0,        187,        187,        1,   152064, 0x6565d69b
-0,        188,        188,        1,   152064, 0x321ce6e5
-0,        189,        189,        1,   152064, 0xc7035cb7
-0,        190,        190,        1,   152064, 0xbfcf2ecc
-0,        191,        191,        1,   152064, 0x8a2eb353
-0,        192,        192,        1,   152064, 0x5224b608
-0,        193,        193,        1,   152064, 0xc0c51491
-0,        194,        194,        1,   152064, 0xdeadac32
-0,        195,        195,        1,   152064, 0x8ffd15fe
-0,        196,        196,        1,   152064, 0x6a7fda8c
-0,        197,        197,        1,   152064, 0x32ae6c5a
-0,        198,        198,        1,   152064, 0x9668d580
-0,        199,        199,        1,   152064, 0xb10325d6
-0,        200,        200,        1,   152064, 0x1cfa4e12
-0,        201,        201,        1,   152064, 0x87cb2dc6
-0,        202,        202,        1,   152064, 0x03636041
-0,        203,        203,        1,   152064, 0x266df3d6
-0,        204,        204,        1,   152064, 0x48cd5b1b
-0,        205,        205,        1,   152064, 0xf42e4dde
-0,        206,        206,        1,   152064, 0x63b21de2
-0,        207,        207,        1,   152064, 0xef377b16
-0,        208,        208,        1,   152064, 0x540a3c21
-0,        209,        209,        1,   152064, 0xbc7576a4
-0,        210,        210,        1,   152064, 0x38508049
-0,        211,        211,        1,   152064, 0x5c120e6f
-0,        212,        212,        1,   152064, 0x5f7dae8a
-0,        213,        213,        1,   152064, 0x84632e15
-0,        214,        214,        1,   152064, 0xe6200a58
-0,        215,        215,        1,   152064, 0xeef9c63d
-0,        216,        216,        1,   152064, 0xe5c60794
-0,        217,        217,        1,   152064, 0x387849c9
-0,        218,        218,        1,   152064, 0x165744e6
-0,        219,        219,        1,   152064, 0xdc9cce84
-0,        220,        220,        1,   152064, 0xea3604e0
-0,        221,        221,        1,   152064, 0xaf9f5a76
-0,        222,        222,        1,   152064, 0x05ee7254
-0,        223,        223,        1,   152064, 0x62ed20cf
-0,        224,        224,        1,   152064, 0x6e038a86
-0,        225,        225,        1,   152064, 0xc782f21c
-0,        226,        226,        1,   152064, 0x9d214e66
-0,        227,        227,        1,   152064, 0xd33ad489
-0,        228,        228,        1,   152064, 0x5b04dd7a
-0,        229,        229,        1,   152064, 0xaf9a865d
-0,        230,        230,        1,   152064, 0x9eb4912a
-0,        231,        231,        1,   152064, 0x677628d8
-0,        232,        232,        1,   152064, 0x0b15e1b6
-0,        233,        233,        1,   152064, 0xda66848a
-0,        234,        234,        1,   152064, 0xd29a27a8
-0,        235,        235,        1,   152064, 0x2d74c6a2
-0,        236,        236,        1,   152064, 0xafa69b91
-0,        237,        237,        1,   152064, 0xf065a24b
-0,        238,        238,        1,   152064, 0xe9d5fe63
-0,        239,        239,        1,   152064, 0xe0428668
-0,        240,        240,        1,   152064, 0x2cfe6235
-0,        241,        241,        1,   152064, 0x6506229d
-0,        242,        242,        1,   152064, 0xc8cddb6b
-0,        243,        243,        1,   152064, 0x1b827b12
-0,        244,        244,        1,   152064, 0x366af54b
-0,        245,        245,        1,   152064, 0x810b5998
-0,        246,        246,        1,   152064, 0x40d8d09e
-0,        247,        247,        1,   152064, 0xf5bd32c5
-0,        248,        248,        1,   152064, 0xb7af7607
-0,        249,        249,        1,   152064, 0x005ac53b
-0,        250,        250,        1,   152064, 0x1a28f754
-0,        251,        251,        1,   152064, 0x8e15108e
-0,        252,        252,        1,   152064, 0xb40515ec
-0,        253,        253,        1,   152064, 0x43a30620
-0,        254,        254,        1,   152064, 0x000beec8
-0,        255,        255,        1,   152064, 0x1f6e9253
-0,        256,        256,        1,   152064, 0x14695f50
-0,        257,        257,        1,   152064, 0x056359d6
-0,        258,        258,        1,   152064, 0xdc4360e5
-0,        259,        259,        1,   152064, 0x3716abb2
-0,        260,        260,        1,   152064, 0xee1cff6a
-0,        261,        261,        1,   152064, 0x7b251ba9
-0,        262,        262,        1,   152064, 0xe4f81d2e
-0,        263,        263,        1,   152064, 0x01411136
-0,        264,        264,        1,   152064, 0xcff2f30a
-0,        265,        265,        1,   152064, 0xc8bcd80d
-0,        266,        266,        1,   152064, 0x94e8a397
-0,        267,        267,        1,   152064, 0x6fd071c8
-0,        268,        268,        1,   152064, 0xb6145d60
-0,        269,        269,        1,   152064, 0x593f5f70
-0,        270,        270,        1,   152064, 0xb5133bb7
-0,        271,        271,        1,   152064, 0x40ad1ae8
-0,        272,        272,        1,   152064, 0xedfc0faa
-0,        273,        273,        1,   152064, 0xa2ab0578
-0,        274,        274,        1,   152064, 0x3038fb4f
-0,        275,        275,        1,   152064, 0xdf10fb53
-0,        276,        276,        1,   152064, 0x6b63ff01
-0,        277,        277,        1,   152064, 0xb34af6cd
-0,        278,        278,        1,   152064, 0xc7e9cfb0
-0,        279,        279,        1,   152064, 0x22ffb57c
-0,        280,        280,        1,   152064, 0xf429b3eb
-0,        281,        281,        1,   152064, 0x3861e0db
-0,        282,        282,        1,   152064, 0x166321b7
-0,        283,        283,        1,   152064, 0x3058744c
-0,        284,        284,        1,   152064, 0x6e1dc37a
-0,        285,        285,        1,   152064, 0xef2aee63
-0,        286,        286,        1,   152064, 0x1a9c3957
-0,        287,        287,        1,   152064, 0x93807ed4
-0,        288,        288,        1,   152064, 0x117fcbe1
-0,        289,        289,        1,   152064, 0x80502017
-0,        290,        290,        1,   152064, 0xba5a3dac
-0,        291,        291,        1,   152064, 0x157764f1
-0,        292,        292,        1,   152064, 0xc7577daf
-0,        293,        293,        1,   152064, 0xe9e8ae69
-0,        294,        294,        1,   152064, 0x04f9ddac
-0,        295,        295,        1,   152064, 0x90441226
-0,        296,        296,        1,   152064, 0xaa594ed2
-0,        297,        297,        1,   152064, 0x59258b49
-0,        298,        298,        1,   152064, 0x13ec85c6
diff --git a/deps/libav/tests/ref/fate/h264-conformance-ba1_sony_d b/deps/libav/tests/ref/fate/h264-conformance-ba1_sony_d
deleted file mode 100644
index b0145cd..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-ba1_sony_d
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb3883478
-0,          1,          1,        1,    38016, 0x99e1fe60
-0,          2,          2,        1,    38016, 0x65eace24
-0,          3,          3,        1,    38016, 0xb2b0a513
-0,          4,          4,        1,    38016, 0x8af47c64
-0,          5,          5,        1,    38016, 0xa56670c6
-0,          6,          6,        1,    38016, 0x11d45ac9
-0,          7,          7,        1,    38016, 0xcd4e4f18
-0,          8,          8,        1,    38016, 0x399934b2
-0,          9,          9,        1,    38016, 0xedd23f7b
-0,         10,         10,        1,    38016, 0x38c350b9
-0,         11,         11,        1,    38016, 0xdd937244
-0,         12,         12,        1,    38016, 0x39c67be6
-0,         13,         13,        1,    38016, 0xabb7a34d
-0,         14,         14,        1,    38016, 0x535d971f
-0,         15,         15,        1,    38016, 0xd41c9cf7
-0,         16,         16,        1,    38016, 0xfddda183
diff --git a/deps/libav/tests/ref/fate/h264-conformance-ba2_sony_f b/deps/libav/tests/ref/fate/h264-conformance-ba2_sony_f
deleted file mode 100644
index 13a6462..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-ba2_sony_f
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb3883478
-0,          1,          1,        1,    38016, 0x47b90d4b
-0,          2,          2,        1,    38016, 0x3e99dfcf
-0,          3,          3,        1,    38016, 0xeb18bb85
-0,          4,          4,        1,    38016, 0xcf1e9658
-0,          5,          5,        1,    38016, 0xf01b7bf1
-0,          6,          6,        1,    38016, 0x92e06ac5
-0,          7,          7,        1,    38016, 0x8ae35c1f
-0,          8,          8,        1,    38016, 0x4bda52c8
-0,          9,          9,        1,    38016, 0xbffe59e5
-0,         10,         10,        1,    38016, 0x56c96cad
-0,         11,         11,        1,    38016, 0x8a278da1
-0,         12,         12,        1,    38016, 0xce6f97d6
-0,         13,         13,        1,    38016, 0x69edad2e
-0,         14,         14,        1,    38016, 0x5134a67c
-0,         15,         15,        1,    38016, 0x1abfb2a1
-0,         16,         16,        1,    38016, 0x4a37b185
-0,         17,         17,        1,    38016, 0x5270a90e
-0,         18,         18,        1,    38016, 0xe28f9d5d
-0,         19,         19,        1,    38016, 0x3fcc87b0
-0,         20,         20,        1,    38016, 0x719e6605
-0,         21,         21,        1,    38016, 0x8b824ca3
-0,         22,         22,        1,    38016, 0x5f6a3544
-0,         23,         23,        1,    38016, 0x2ecd2ada
-0,         24,         24,        1,    38016, 0x5d4f3055
-0,         25,         25,        1,    38016, 0xc54441d3
-0,         26,         26,        1,    38016, 0x93f83f2c
-0,         27,         27,        1,    38016, 0xaa4d46a8
-0,         28,         28,        1,    38016, 0x7ca45c1f
-0,         29,         29,        1,    38016, 0x59de7854
-0,         30,         30,        1,    38016, 0xc8f98709
-0,         31,         31,        1,    38016, 0x9a199eeb
-0,         32,         32,        1,    38016, 0xfd82b785
-0,         33,         33,        1,    38016, 0x319fd17f
-0,         34,         34,        1,    38016, 0xc6ebd362
-0,         35,         35,        1,    38016, 0xbd60d5dc
-0,         36,         36,        1,    38016, 0x6e27d260
-0,         37,         37,        1,    38016, 0x96b7cf93
-0,         38,         38,        1,    38016, 0x6787cbcf
-0,         39,         39,        1,    38016, 0x48dacd76
-0,         40,         40,        1,    38016, 0xbef1d08e
-0,         41,         41,        1,    38016, 0xbb1bd9a4
-0,         42,         42,        1,    38016, 0xa420d63b
-0,         43,         43,        1,    38016, 0xfa26d0ab
-0,         44,         44,        1,    38016, 0xa349d2e0
-0,         45,         45,        1,    38016, 0x9946ce09
-0,         46,         46,        1,    38016, 0xb101cabe
-0,         47,         47,        1,    38016, 0x9e18c6b2
-0,         48,         48,        1,    38016, 0xe7cccbd9
-0,         49,         49,        1,    38016, 0x1067d145
-0,         50,         50,        1,    38016, 0xae13cd75
-0,         51,         51,        1,    38016, 0x8e06cce5
-0,         52,         52,        1,    38016, 0x0b3dcbf8
-0,         53,         53,        1,    38016, 0xc6cbcfbe
-0,         54,         54,        1,    38016, 0x1eced2f7
-0,         55,         55,        1,    38016, 0x5d72da04
-0,         56,         56,        1,    38016, 0x0643e191
-0,         57,         57,        1,    38016, 0x3cace7f7
-0,         58,         58,        1,    38016, 0x5e31f1f0
-0,         59,         59,        1,    38016, 0x04d1ef46
-0,         60,         60,        1,    38016, 0xffdbe794
-0,         61,         61,        1,    38016, 0x106ad275
-0,         62,         62,        1,    38016, 0x5c64a147
-0,         63,         63,        1,    38016, 0xb7676212
-0,         64,         64,        1,    38016, 0x86ea653e
-0,         65,         65,        1,    38016, 0xabb48937
-0,         66,         66,        1,    38016, 0x6b1cadc4
-0,         67,         67,        1,    38016, 0xa4eaf34b
-0,         68,         68,        1,    38016, 0x4174280f
-0,         69,         69,        1,    38016, 0xfe845818
-0,         70,         70,        1,    38016, 0xc64a838e
-0,         71,         71,        1,    38016, 0x5e24aaf0
-0,         72,         72,        1,    38016, 0x8bffd9d8
-0,         73,         73,        1,    38016, 0x00d912c9
-0,         74,         74,        1,    38016, 0x0dba50f0
-0,         75,         75,        1,    38016, 0x80958628
-0,         76,         76,        1,    38016, 0x4e81a356
-0,         77,         77,        1,    38016, 0x121dc289
-0,         78,         78,        1,    38016, 0x4885de6f
-0,         79,         79,        1,    38016, 0x5329e4f9
-0,         80,         80,        1,    38016, 0xa129ef6b
-0,         81,         81,        1,    38016, 0x3ea6fd46
-0,         82,         82,        1,    38016, 0x9a68fbb4
-0,         83,         83,        1,    38016, 0xea1dffdd
-0,         84,         84,        1,    38016, 0x7bf9f719
-0,         85,         85,        1,    38016, 0x9aa5ff2a
-0,         86,         86,        1,    38016, 0xf050fe90
-0,         87,         87,        1,    38016, 0xb6f50938
-0,         88,         88,        1,    38016, 0xbe900b57
-0,         89,         89,        1,    38016, 0x27b90a6b
-0,         90,         90,        1,    38016, 0xe87bf703
-0,         91,         91,        1,    38016, 0xaf0fdbe1
-0,         92,         92,        1,    38016, 0x3f2cc304
-0,         93,         93,        1,    38016, 0x0114b42f
-0,         94,         94,        1,    38016, 0x7f739915
-0,         95,         95,        1,    38016, 0xcc3da414
-0,         96,         96,        1,    38016, 0x57e2afe8
-0,         97,         97,        1,    38016, 0x59b6bdc5
-0,         98,         98,        1,    38016, 0xb3eacf6a
-0,         99,         99,        1,    38016, 0xa10ddcd8
-0,        100,        100,        1,    38016, 0xae05e697
-0,        101,        101,        1,    38016, 0x8cb9d81c
-0,        102,        102,        1,    38016, 0x5d5cc3b1
-0,        103,        103,        1,    38016, 0x8f89c0c0
-0,        104,        104,        1,    38016, 0x593cda26
-0,        105,        105,        1,    38016, 0xd5d1f2fc
-0,        106,        106,        1,    38016, 0x2586ff00
-0,        107,        107,        1,    38016, 0x1c2613f0
-0,        108,        108,        1,    38016, 0x236133bd
-0,        109,        109,        1,    38016, 0x92c5439b
-0,        110,        110,        1,    38016, 0xd1145724
-0,        111,        111,        1,    38016, 0xf2fa5c12
-0,        112,        112,        1,    38016, 0x810d5f50
-0,        113,        113,        1,    38016, 0x196f4470
-0,        114,        114,        1,    38016, 0xcba71d6b
-0,        115,        115,        1,    38016, 0x58ab17b0
-0,        116,        116,        1,    38016, 0x4a96278d
-0,        117,        117,        1,    38016, 0x4afe2f7d
-0,        118,        118,        1,    38016, 0xe1ca3d55
-0,        119,        119,        1,    38016, 0x4f6844ab
-0,        120,        120,        1,    38016, 0x7ad24bc5
-0,        121,        121,        1,    38016, 0x068c49f0
-0,        122,        122,        1,    38016, 0x23b92dae
-0,        123,        123,        1,    38016, 0x0e9a0793
-0,        124,        124,        1,    38016, 0xc1d2dd4a
-0,        125,        125,        1,    38016, 0x1b5cbc00
-0,        126,        126,        1,    38016, 0xa951b88d
-0,        127,        127,        1,    38016, 0x8b4ac1df
-0,        128,        128,        1,    38016, 0x91d3d98d
-0,        129,        129,        1,    38016, 0xa42aeb49
-0,        130,        130,        1,    38016, 0x21b5f1f6
-0,        131,        131,        1,    38016, 0xd632f07f
-0,        132,        132,        1,    38016, 0x6566ec26
-0,        133,        133,        1,    38016, 0x03f4ee70
-0,        134,        134,        1,    38016, 0x62b6e999
-0,        135,        135,        1,    38016, 0xfd1de6fb
-0,        136,        136,        1,    38016, 0xb07bdc79
-0,        137,        137,        1,    38016, 0xace9d441
-0,        138,        138,        1,    38016, 0x7d98c788
-0,        139,        139,        1,    38016, 0x3c7dbae4
-0,        140,        140,        1,    38016, 0x6e85b20f
-0,        141,        141,        1,    38016, 0x86a5a6bc
-0,        142,        142,        1,    38016, 0xacbe93ca
-0,        143,        143,        1,    38016, 0x8e438bde
-0,        144,        144,        1,    38016, 0x88b4963d
-0,        145,        145,        1,    38016, 0x86119504
-0,        146,        146,        1,    38016, 0x0ccc8932
-0,        147,        147,        1,    38016, 0x69a45f01
-0,        148,        148,        1,    38016, 0x8f173148
-0,        149,        149,        1,    38016, 0x1e320daf
-0,        150,        150,        1,    38016, 0x3957e834
-0,        151,        151,        1,    38016, 0x57c1dcee
-0,        152,        152,        1,    38016, 0x2a9edf52
-0,        153,        153,        1,    38016, 0x116ed4bc
-0,        154,        154,        1,    38016, 0x81cfc686
-0,        155,        155,        1,    38016, 0x6685db47
-0,        156,        156,        1,    38016, 0xab79fd2f
-0,        157,        157,        1,    38016, 0x65201bdd
-0,        158,        158,        1,    38016, 0x06e64eb6
-0,        159,        159,        1,    38016, 0xbcb77ac0
-0,        160,        160,        1,    38016, 0x65679028
-0,        161,        161,        1,    38016, 0xf33e837e
-0,        162,        162,        1,    38016, 0xa77d7b6c
-0,        163,        163,        1,    38016, 0x0e7b64f6
-0,        164,        164,        1,    38016, 0x2d1f597c
-0,        165,        165,        1,    38016, 0x1b6748a1
-0,        166,        166,        1,    38016, 0x12a91f4f
-0,        167,        167,        1,    38016, 0xc09df3ee
-0,        168,        168,        1,    38016, 0x1b9dcd6f
-0,        169,        169,        1,    38016, 0xf3c2bce4
-0,        170,        170,        1,    38016, 0xfe05d34b
-0,        171,        171,        1,    38016, 0x421deb25
-0,        172,        172,        1,    38016, 0x0f8d0725
-0,        173,        173,        1,    38016, 0xa03d0a3d
-0,        174,        174,        1,    38016, 0xe00cf88f
-0,        175,        175,        1,    38016, 0xa55abfdf
-0,        176,        176,        1,    38016, 0x11618891
-0,        177,        177,        1,    38016, 0x45835caf
-0,        178,        178,        1,    38016, 0x7be63a3b
-0,        179,        179,        1,    38016, 0x1ebb2104
-0,        180,        180,        1,    38016, 0x055b0b26
-0,        181,        181,        1,    38016, 0x076ef47e
-0,        182,        182,        1,    38016, 0xa828e6e1
-0,        183,        183,        1,    38016, 0x0de5eb60
-0,        184,        184,        1,    38016, 0x5238f229
-0,        185,        185,        1,    38016, 0x332cff7c
-0,        186,        186,        1,    38016, 0x74072063
-0,        187,        187,        1,    38016, 0x1e623ceb
-0,        188,        188,        1,    38016, 0xad2448c9
-0,        189,        189,        1,    38016, 0x32065043
-0,        190,        190,        1,    38016, 0x2e7ff976
-0,        191,        191,        1,    38016, 0xf1a8c805
-0,        192,        192,        1,    38016, 0x3f64d1cc
-0,        193,        193,        1,    38016, 0xc855efbd
-0,        194,        194,        1,    38016, 0x152b0fed
-0,        195,        195,        1,    38016, 0x43335881
-0,        196,        196,        1,    38016, 0xec5c7979
-0,        197,        197,        1,    38016, 0x150e9488
-0,        198,        198,        1,    38016, 0x1a63b67a
-0,        199,        199,        1,    38016, 0x24a4cca6
-0,        200,        200,        1,    38016, 0x3838dba2
-0,        201,        201,        1,    38016, 0xef1bec71
-0,        202,        202,        1,    38016, 0x0478f12a
-0,        203,        203,        1,    38016, 0x478fee17
-0,        204,        204,        1,    38016, 0x1d09f0ac
-0,        205,        205,        1,    38016, 0x3daef591
-0,        206,        206,        1,    38016, 0xf7f3033c
-0,        207,        207,        1,    38016, 0xfb09faa0
-0,        208,        208,        1,    38016, 0xd87de6c9
-0,        209,        209,        1,    38016, 0xbd99d6bc
-0,        210,        210,        1,    38016, 0x87d8bd7d
-0,        211,        211,        1,    38016, 0xf244b18a
-0,        212,        212,        1,    38016, 0x3a34a2da
-0,        213,        213,        1,    38016, 0x25739701
-0,        214,        214,        1,    38016, 0x346b8b9a
-0,        215,        215,        1,    38016, 0xc67379ec
-0,        216,        216,        1,    38016, 0xbd30780d
-0,        217,        217,        1,    38016, 0xc5197c2b
-0,        218,        218,        1,    38016, 0xd5ce73e8
-0,        219,        219,        1,    38016, 0x63ce72d1
-0,        220,        220,        1,    38016, 0x140d688d
-0,        221,        221,        1,    38016, 0x027158aa
-0,        222,        222,        1,    38016, 0x90884ce3
-0,        223,        223,        1,    38016, 0x4faa38c5
-0,        224,        224,        1,    38016, 0x78693f54
-0,        225,        225,        1,    38016, 0xe1fa41c1
-0,        226,        226,        1,    38016, 0x9b524771
-0,        227,        227,        1,    38016, 0xbb3056c8
-0,        228,        228,        1,    38016, 0xa93b67df
-0,        229,        229,        1,    38016, 0xe661909f
-0,        230,        230,        1,    38016, 0x55a0af6d
-0,        231,        231,        1,    38016, 0xa5f6d0a8
-0,        232,        232,        1,    38016, 0xa44300f8
-0,        233,        233,        1,    38016, 0xc7cc265e
-0,        234,        234,        1,    38016, 0xe7384598
-0,        235,        235,        1,    38016, 0x77e4589a
-0,        236,        236,        1,    38016, 0x073c7054
-0,        237,        237,        1,    38016, 0xe50e6ea8
-0,        238,        238,        1,    38016, 0xcedf518f
-0,        239,        239,        1,    38016, 0x8674266b
-0,        240,        240,        1,    38016, 0x360e0517
-0,        241,        241,        1,    38016, 0x19acdb3a
-0,        242,        242,        1,    38016, 0xd029d91b
-0,        243,        243,        1,    38016, 0x3101277f
-0,        244,        244,        1,    38016, 0x3a919153
-0,        245,        245,        1,    38016, 0x0646ffaf
-0,        246,        246,        1,    38016, 0xffdd13a5
-0,        247,        247,        1,    38016, 0x13e2e641
-0,        248,        248,        1,    38016, 0xc6f6a13b
-0,        249,        249,        1,    38016, 0x984f2ecd
-0,        250,        250,        1,    38016, 0xafaec63a
-0,        251,        251,        1,    38016, 0x9025817a
-0,        252,        252,        1,    38016, 0x20d574d7
-0,        253,        253,        1,    38016, 0x72eacc49
-0,        254,        254,        1,    38016, 0x6297335a
-0,        255,        255,        1,    38016, 0xc69adba1
-0,        256,        256,        1,    38016, 0x7852d515
-0,        257,        257,        1,    38016, 0x0e846003
-0,        258,        258,        1,    38016, 0xeb294c5e
-0,        259,        259,        1,    38016, 0x0913448f
-0,        260,        260,        1,    38016, 0xea2c4fc1
-0,        261,        261,        1,    38016, 0xb8165b3f
-0,        262,        262,        1,    38016, 0x5f596c9d
-0,        263,        263,        1,    38016, 0x3a1370d1
-0,        264,        264,        1,    38016, 0x25dd6a9a
-0,        265,        265,        1,    38016, 0x70075f7a
-0,        266,        266,        1,    38016, 0xaf6749f0
-0,        267,        267,        1,    38016, 0xd5c22d02
-0,        268,        268,        1,    38016, 0xf6e80af2
-0,        269,        269,        1,    38016, 0x42d1dcf7
-0,        270,        270,        1,    38016, 0x232cb536
-0,        271,        271,        1,    38016, 0x7c848ebf
-0,        272,        272,        1,    38016, 0x4c756c28
-0,        273,        273,        1,    38016, 0x720e1f07
-0,        274,        274,        1,    38016, 0x2385ccb2
-0,        275,        275,        1,    38016, 0xcd97bf76
-0,        276,        276,        1,    38016, 0xebcad10b
-0,        277,        277,        1,    38016, 0xbed8ceeb
-0,        278,        278,        1,    38016, 0x660ffaf8
-0,        279,        279,        1,    38016, 0x6a1662a9
-0,        280,        280,        1,    38016, 0x71f20775
-0,        281,        281,        1,    38016, 0x597ecf26
-0,        282,        282,        1,    38016, 0x7a81a050
-0,        283,        283,        1,    38016, 0x05f6676a
-0,        284,        284,        1,    38016, 0xd0065042
-0,        285,        285,        1,    38016, 0x17ca9cd9
-0,        286,        286,        1,    38016, 0x76956633
-0,        287,        287,        1,    38016, 0x9211a2b0
-0,        288,        288,        1,    38016, 0xc134b304
-0,        289,        289,        1,    38016, 0xdaca9260
-0,        290,        290,        1,    38016, 0x10252d19
-0,        291,        291,        1,    38016, 0xf52a44af
-0,        292,        292,        1,    38016, 0x4053d2d1
-0,        293,        293,        1,    38016, 0x165e0bed
-0,        294,        294,        1,    38016, 0x577352d0
-0,        295,        295,        1,    38016, 0xf9564a09
-0,        296,        296,        1,    38016, 0x78a8295f
-0,        297,        297,        1,    38016, 0xb2d7182a
-0,        298,        298,        1,    38016, 0x9a0c2487
-0,        299,        299,        1,    38016, 0x1b044efa
diff --git a/deps/libav/tests/ref/fate/h264-conformance-ba3_sva_c b/deps/libav/tests/ref/fate/h264-conformance-ba3_sva_c
deleted file mode 100644
index cb775db..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-ba3_sva_c
+++ /dev/null
@@ -1,34 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xbf5f1df5
-0,          1,          1,        1,    38016, 0x8de61f39
-0,          2,          2,        1,    38016, 0xaeec0a18
-0,          3,          3,        1,    38016, 0x386c2599
-0,          4,          4,        1,    38016, 0x8fcf2df0
-0,          5,          5,        1,    38016, 0x34fe57ec
-0,          6,          6,        1,    38016, 0x7e6c5e1a
-0,          7,          7,        1,    38016, 0x8f319659
-0,          8,          8,        1,    38016, 0x1e1291e2
-0,          9,          9,        1,    38016, 0x97e9bf55
-0,         10,         10,        1,    38016, 0x35bcad1a
-0,         11,         11,        1,    38016, 0xea39d354
-0,         12,         12,        1,    38016, 0xca7db081
-0,         13,         13,        1,    38016, 0x2c069b6c
-0,         14,         14,        1,    38016, 0x32f86a99
-0,         15,         15,        1,    38016, 0xb4019668
-0,         16,         16,        1,    38016, 0x04038324
-0,         17,         17,        1,    38016, 0xe4f0b032
-0,         18,         18,        1,    38016, 0xe6119a63
-0,         19,         19,        1,    38016, 0xdf17b9fa
-0,         20,         20,        1,    38016, 0xe199a348
-0,         21,         21,        1,    38016, 0x6704b749
-0,         22,         22,        1,    38016, 0x33fc7592
-0,         23,         23,        1,    38016, 0xc0c371b2
-0,         24,         24,        1,    38016, 0x017628aa
-0,         25,         25,        1,    38016, 0xa46b3ab5
-0,         26,         26,        1,    38016, 0x216f1fdb
-0,         27,         27,        1,    38016, 0x28c54669
-0,         28,         28,        1,    38016, 0x070c4ac1
-0,         29,         29,        1,    38016, 0x4d4c6765
-0,         30,         30,        1,    38016, 0xb496626c
-0,         31,         31,        1,    38016, 0x9f767057
-0,         32,         32,        1,    38016, 0xe2bc4de1
diff --git a/deps/libav/tests/ref/fate/h264-conformance-ba_mw_d b/deps/libav/tests/ref/fate/h264-conformance-ba_mw_d
deleted file mode 100644
index 18a6717..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-ba_mw_d
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x3ae838ee
-0,          1,          1,        1,    38016, 0x9ed7e141
-0,          2,          2,        1,    38016, 0x393097f9
-0,          3,          3,        1,    38016, 0x8fb56676
-0,          4,          4,        1,    38016, 0x39d64fd2
-0,          5,          5,        1,    38016, 0x7fad729a
-0,          6,          6,        1,    38016, 0x7e25955f
-0,          7,          7,        1,    38016, 0xc4d9a359
-0,          8,          8,        1,    38016, 0x30afaca4
-0,          9,          9,        1,    38016, 0x9ee195ea
-0,         10,         10,        1,    38016, 0x09f65805
-0,         11,         11,        1,    38016, 0x58d126ab
-0,         12,         12,        1,    38016, 0x4f29282c
-0,         13,         13,        1,    38016, 0x8af235a1
-0,         14,         14,        1,    38016, 0x6dfe525a
-0,         15,         15,        1,    38016, 0xd51c793f
-0,         16,         16,        1,    38016, 0x4e90abba
-0,         17,         17,        1,    38016, 0xe706c5b7
-0,         18,         18,        1,    38016, 0x35fab7ef
-0,         19,         19,        1,    38016, 0xed78b8fc
-0,         20,         20,        1,    38016, 0x2907bb4e
-0,         21,         21,        1,    38016, 0x1749bb47
-0,         22,         22,        1,    38016, 0x284ec688
-0,         23,         23,        1,    38016, 0x534abc24
-0,         24,         24,        1,    38016, 0xcd01bd13
-0,         25,         25,        1,    38016, 0xe97bbd51
-0,         26,         26,        1,    38016, 0xac1cb9e9
-0,         27,         27,        1,    38016, 0xd861c0a3
-0,         28,         28,        1,    38016, 0xf0f1ced4
-0,         29,         29,        1,    38016, 0xa9e8d2bf
-0,         30,         30,        1,    38016, 0x4c6aa7c5
-0,         31,         31,        1,    38016, 0xe2eb6bde
-0,         32,         32,        1,    38016, 0x92eb44a1
-0,         33,         33,        1,    38016, 0x376b8919
-0,         34,         34,        1,    38016, 0x291bfdd9
-0,         35,         35,        1,    38016, 0xed0c60a0
-0,         36,         36,        1,    38016, 0xf505b70d
-0,         37,         37,        1,    38016, 0x26b33a9b
-0,         38,         38,        1,    38016, 0xc9269664
-0,         39,         39,        1,    38016, 0xe21dc61e
-0,         40,         40,        1,    38016, 0xe88fe653
-0,         41,         41,        1,    38016, 0xd4cff39c
-0,         42,         42,        1,    38016, 0x02bdecdf
-0,         43,         43,        1,    38016, 0xec48fc13
-0,         44,         44,        1,    38016, 0x363f071c
-0,         45,         45,        1,    38016, 0x7fcbf2fd
-0,         46,         46,        1,    38016, 0xc3d1c265
-0,         47,         47,        1,    38016, 0x818a94e9
-0,         48,         48,        1,    38016, 0x30b5a52f
-0,         49,         49,        1,    38016, 0x7a1acd17
-0,         50,         50,        1,    38016, 0xb5a6dc91
-0,         51,         51,        1,    38016, 0x7d39b673
-0,         52,         52,        1,    38016, 0x341ad3f9
-0,         53,         53,        1,    38016, 0x264cff5f
-0,         54,         54,        1,    38016, 0x613a445b
-0,         55,         55,        1,    38016, 0x42a55cd6
-0,         56,         56,        1,    38016, 0xe84f6a39
-0,         57,         57,        1,    38016, 0xd8e93151
-0,         58,         58,        1,    38016, 0xc7333ac4
-0,         59,         59,        1,    38016, 0xa08a4b2c
-0,         60,         60,        1,    38016, 0xeb8a3531
-0,         61,         61,        1,    38016, 0x88bf1883
-0,         62,         62,        1,    38016, 0x0043c104
-0,         63,         63,        1,    38016, 0xa9d6a35d
-0,         64,         64,        1,    38016, 0x01dec5af
-0,         65,         65,        1,    38016, 0x673cdf0e
-0,         66,         66,        1,    38016, 0xc8d0ce67
-0,         67,         67,        1,    38016, 0xcac2d0bd
-0,         68,         68,        1,    38016, 0x8575c7b9
-0,         69,         69,        1,    38016, 0x71c1b4f4
-0,         70,         70,        1,    38016, 0x2affa1d4
-0,         71,         71,        1,    38016, 0xae947cfd
-0,         72,         72,        1,    38016, 0x48b2821d
-0,         73,         73,        1,    38016, 0x1c5d77f4
-0,         74,         74,        1,    38016, 0x3625233b
-0,         75,         75,        1,    38016, 0xcfc8e3ff
-0,         76,         76,        1,    38016, 0x6d04cfa5
-0,         77,         77,        1,    38016, 0x2c4ec463
-0,         78,         78,        1,    38016, 0x72b1ea07
-0,         79,         79,        1,    38016, 0x448d3996
-0,         80,         80,        1,    38016, 0x89256b87
-0,         81,         81,        1,    38016, 0x69af5fea
-0,         82,         82,        1,    38016, 0x908f46b0
-0,         83,         83,        1,    38016, 0x56e11a8b
-0,         84,         84,        1,    38016, 0x7fd4c5f5
-0,         85,         85,        1,    38016, 0x560bd701
-0,         86,         86,        1,    38016, 0x71570820
-0,         87,         87,        1,    38016, 0x11b20b14
-0,         88,         88,        1,    38016, 0xa3fd9f19
-0,         89,         89,        1,    38016, 0x4a564d33
-0,         90,         90,        1,    38016, 0x1722db32
-0,         91,         91,        1,    38016, 0xf853a971
-0,         92,         92,        1,    38016, 0xb136bf89
-0,         93,         93,        1,    38016, 0xb686e8c3
-0,         94,         94,        1,    38016, 0x8afc1a4c
-0,         95,         95,        1,    38016, 0xa24adb65
-0,         96,         96,        1,    38016, 0xd951ae27
-0,         97,         97,        1,    38016, 0xa731f04e
-0,         98,         98,        1,    38016, 0xabd65795
-0,         99,         99,        1,    38016, 0x46bc95e1
diff --git a/deps/libav/tests/ref/fate/h264-conformance-bamq1_jvc_c b/deps/libav/tests/ref/fate/h264-conformance-bamq1_jvc_c
deleted file mode 100644
index 4a3066c..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-bamq1_jvc_c
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x6951213f
-0,          1,          1,        1,    38016, 0x82ddf39d
-0,          2,          2,        1,    38016, 0x3f81c6b1
-0,          3,          3,        1,    38016, 0x55149f23
-0,          4,          4,        1,    38016, 0x366a74e1
-0,          5,          5,        1,    38016, 0xe6f465cf
-0,          6,          6,        1,    38016, 0x14fd4999
-0,          7,          7,        1,    38016, 0x49273f0f
-0,          8,          8,        1,    38016, 0xa20a2ebe
-0,          9,          9,        1,    38016, 0x701b32a4
-0,         10,         10,        1,    38016, 0x8a394066
-0,         11,         11,        1,    38016, 0xe9b766a6
-0,         12,         12,        1,    38016, 0x4e7f766d
-0,         13,         13,        1,    38016, 0x2c159585
-0,         14,         14,        1,    38016, 0x31b38c2b
-0,         15,         15,        1,    38016, 0xde58937f
-0,         16,         16,        1,    38016, 0xf69e94f9
-0,         17,         17,        1,    38016, 0x849e8a08
-0,         18,         18,        1,    38016, 0xe53f79e9
-0,         19,         19,        1,    38016, 0xf2ce6103
-0,         20,         20,        1,    38016, 0xe98d3c96
-0,         21,         21,        1,    38016, 0xea8c17c5
-0,         22,         22,        1,    38016, 0xea0a01d8
-0,         23,         23,        1,    38016, 0x6a45fd53
-0,         24,         24,        1,    38016, 0xaad9fd47
-0,         25,         25,        1,    38016, 0xabc603b7
-0,         26,         26,        1,    38016, 0x89410350
-0,         27,         27,        1,    38016, 0x1fac129b
-0,         28,         28,        1,    38016, 0x1af529ee
-0,         29,         29,        1,    38016, 0x384141b6
diff --git a/deps/libav/tests/ref/fate/h264-conformance-bamq2_jvc_c b/deps/libav/tests/ref/fate/h264-conformance-bamq2_jvc_c
deleted file mode 100644
index 3308f77..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-bamq2_jvc_c
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x6951213f
-0,          1,          1,        1,    38016, 0xd1bbf830
-0,          2,          2,        1,    38016, 0x79dcc8cb
-0,          3,          3,        1,    38016, 0xa426a50e
-0,          4,          4,        1,    38016, 0x002275d6
-0,          5,          5,        1,    38016, 0xab9a666e
-0,          6,          6,        1,    38016, 0x9bd54be9
-0,          7,          7,        1,    38016, 0x09003ed1
-0,          8,          8,        1,    38016, 0x75e0340a
-0,          9,          9,        1,    38016, 0x65ae3b23
-0,         10,         10,        1,    38016, 0x4c1049a8
-0,         11,         11,        1,    38016, 0x6e336a25
-0,         12,         12,        1,    38016, 0x4d3579ee
-0,         13,         13,        1,    38016, 0x81f89545
-0,         14,         14,        1,    38016, 0xc9358e56
-0,         15,         15,        1,    38016, 0x3fa69885
-0,         16,         16,        1,    38016, 0x1ea49bea
-0,         17,         17,        1,    38016, 0xce939241
-0,         18,         18,        1,    38016, 0xbc278236
-0,         19,         19,        1,    38016, 0xf11868d2
-0,         20,         20,        1,    38016, 0xe4124537
-0,         21,         21,        1,    38016, 0xd5831e16
-0,         22,         22,        1,    38016, 0x9f5608e8
-0,         23,         23,        1,    38016, 0x30ad0448
-0,         24,         24,        1,    38016, 0x06a00523
-0,         25,         25,        1,    38016, 0x25e50e24
-0,         26,         26,        1,    38016, 0x2c220a92
-0,         27,         27,        1,    38016, 0xd4b7185e
-0,         28,         28,        1,    38016, 0x80f92d07
-0,         29,         29,        1,    38016, 0x285a4586
diff --git a/deps/libav/tests/ref/fate/h264-conformance-banm_mw_d b/deps/libav/tests/ref/fate/h264-conformance-banm_mw_d
deleted file mode 100644
index 6108ca3..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-banm_mw_d
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x3ae838ee
-0,          1,          1,        1,    38016, 0x9ed7e141
-0,          2,          2,        1,    38016, 0xaf9d9753
-0,          3,          3,        1,    38016, 0x8a6f6906
-0,          4,          4,        1,    38016, 0xcfe85810
-0,          5,          5,        1,    38016, 0x00ed737f
-0,          6,          6,        1,    38016, 0x93509e20
-0,          7,          7,        1,    38016, 0xa02ba402
-0,          8,          8,        1,    38016, 0xce09afd9
-0,          9,          9,        1,    38016, 0xc7a49dcf
-0,         10,         10,        1,    38016, 0x0da163c6
-0,         11,         11,        1,    38016, 0xb3be2fcf
-0,         12,         12,        1,    38016, 0x0d564479
-0,         13,         13,        1,    38016, 0x5c554f55
-0,         14,         14,        1,    38016, 0x05d06d25
-0,         15,         15,        1,    38016, 0x352687bc
-0,         16,         16,        1,    38016, 0x9e13b74d
-0,         17,         17,        1,    38016, 0x1c3dd2af
-0,         18,         18,        1,    38016, 0x3c1ad091
-0,         19,         19,        1,    38016, 0x0461cad8
-0,         20,         20,        1,    38016, 0xa002cc91
-0,         21,         21,        1,    38016, 0x9c06d06e
-0,         22,         22,        1,    38016, 0xfad0cee0
-0,         23,         23,        1,    38016, 0x5cbbd4a5
-0,         24,         24,        1,    38016, 0x9a99d463
-0,         25,         25,        1,    38016, 0xa115d051
-0,         26,         26,        1,    38016, 0x5b63cc22
-0,         27,         27,        1,    38016, 0x53b3cfd2
-0,         28,         28,        1,    38016, 0x7b22db61
-0,         29,         29,        1,    38016, 0x4f28e319
-0,         30,         30,        1,    38016, 0x4c6aa7c5
-0,         31,         31,        1,    38016, 0xe2eb6bde
-0,         32,         32,        1,    38016, 0xdfc84927
-0,         33,         33,        1,    38016, 0xa0098eab
-0,         34,         34,        1,    38016, 0x607a00e2
-0,         35,         35,        1,    38016, 0x58da68d0
-0,         36,         36,        1,    38016, 0x1290c8c6
-0,         37,         37,        1,    38016, 0x40615120
-0,         38,         38,        1,    38016, 0x070e9d9c
-0,         39,         39,        1,    38016, 0x5295d213
-0,         40,         40,        1,    38016, 0xaaa0f00a
-0,         41,         41,        1,    38016, 0x0ef7f99d
-0,         42,         42,        1,    38016, 0x018cf596
-0,         43,         43,        1,    38016, 0xb9010555
-0,         44,         44,        1,    38016, 0x54b10d05
-0,         45,         45,        1,    38016, 0xa06ff53b
-0,         46,         46,        1,    38016, 0x9a2ec1aa
-0,         47,         47,        1,    38016, 0x75999938
-0,         48,         48,        1,    38016, 0xda6ba315
-0,         49,         49,        1,    38016, 0xaa38cc4e
-0,         50,         50,        1,    38016, 0x87f6e751
-0,         51,         51,        1,    38016, 0x2318c2b9
-0,         52,         52,        1,    38016, 0xdebfd9c8
-0,         53,         53,        1,    38016, 0xdc9a115f
-0,         54,         54,        1,    38016, 0x6d1e495d
-0,         55,         55,        1,    38016, 0x53d46db4
-0,         56,         56,        1,    38016, 0x53287856
-0,         57,         57,        1,    38016, 0x0ce93af7
-0,         58,         58,        1,    38016, 0x44974b42
-0,         59,         59,        1,    38016, 0x65a16170
-0,         60,         60,        1,    38016, 0xeb8a3531
-0,         61,         61,        1,    38016, 0x65da180b
-0,         62,         62,        1,    38016, 0x6eb1cd77
-0,         63,         63,        1,    38016, 0xc890b0c1
-0,         64,         64,        1,    38016, 0x359ad301
-0,         65,         65,        1,    38016, 0x4be2e140
-0,         66,         66,        1,    38016, 0x5094da18
-0,         67,         67,        1,    38016, 0x9ef9d904
-0,         68,         68,        1,    38016, 0x0ad8cbb4
-0,         69,         69,        1,    38016, 0xd68cb3db
-0,         70,         70,        1,    38016, 0x7fcd9d3c
-0,         71,         71,        1,    38016, 0x017385aa
-0,         72,         72,        1,    38016, 0xa2328d96
-0,         73,         73,        1,    38016, 0x18858630
-0,         74,         74,        1,    38016, 0x795228e0
-0,         75,         75,        1,    38016, 0xb70ce750
-0,         76,         76,        1,    38016, 0x55d9da49
-0,         77,         77,        1,    38016, 0x7714cc94
-0,         78,         78,        1,    38016, 0xec39f711
-0,         79,         79,        1,    38016, 0x561e4366
-0,         80,         80,        1,    38016, 0xd91c83e0
-0,         81,         81,        1,    38016, 0x8b3379e2
-0,         82,         82,        1,    38016, 0xdee36b36
-0,         83,         83,        1,    38016, 0x1b4940fd
-0,         84,         84,        1,    38016, 0x9b13e7b2
-0,         85,         85,        1,    38016, 0xb0b2f2eb
-0,         86,         86,        1,    38016, 0x0e7c2373
-0,         87,         87,        1,    38016, 0x87401fb0
-0,         88,         88,        1,    38016, 0xc4bdb8be
-0,         89,         89,        1,    38016, 0xbbfc4f40
-0,         90,         90,        1,    38016, 0x1722db32
-0,         91,         91,        1,    38016, 0xf7e8a749
-0,         92,         92,        1,    38016, 0x8c66b366
-0,         93,         93,        1,    38016, 0x9823f33e
-0,         94,         94,        1,    38016, 0x5013240a
-0,         95,         95,        1,    38016, 0xf174d83a
-0,         96,         96,        1,    38016, 0xe49cae19
-0,         97,         97,        1,    38016, 0xadc2f8f7
-0,         98,         98,        1,    38016, 0x667961b0
-0,         99,         99,        1,    38016, 0xcb6d9bcd
diff --git a/deps/libav/tests/ref/fate/h264-conformance-basqp1_sony_c b/deps/libav/tests/ref/fate/h264-conformance-basqp1_sony_c
deleted file mode 100644
index a5038e4..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-basqp1_sony_c
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xe2d73230
-0,          1,          1,        1,    38016, 0xda4dfc8e
-0,          2,          2,        1,    38016, 0x7334cb99
-0,          3,          3,        1,    38016, 0xd8feab7d
diff --git a/deps/libav/tests/ref/fate/h264-conformance-caba1_sony_d b/deps/libav/tests/ref/fate/h264-conformance-caba1_sony_d
deleted file mode 100644
index 3579820..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-caba1_sony_d
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb3883478
-0,          1,          1,        1,    38016, 0x99e1fe60
-0,          2,          2,        1,    38016, 0x65eace24
-0,          3,          3,        1,    38016, 0xb2b0a513
-0,          4,          4,        1,    38016, 0x8af47c64
-0,          5,          5,        1,    38016, 0xa56670c6
-0,          6,          6,        1,    38016, 0x11d45ac9
-0,          7,          7,        1,    38016, 0xcd4e4f18
-0,          8,          8,        1,    38016, 0x399934b2
-0,          9,          9,        1,    38016, 0xedd23f7b
-0,         10,         10,        1,    38016, 0x38c350b9
-0,         11,         11,        1,    38016, 0xdd937244
-0,         12,         12,        1,    38016, 0x39c67be6
-0,         13,         13,        1,    38016, 0xabb7a34d
-0,         14,         14,        1,    38016, 0x535d971f
-0,         15,         15,        1,    38016, 0xd41c9cf7
-0,         16,         16,        1,    38016, 0xfddda183
-0,         17,         17,        1,    38016, 0x7b659dc5
-0,         18,         18,        1,    38016, 0x06978b0c
-0,         19,         19,        1,    38016, 0x62596b00
-0,         20,         20,        1,    38016, 0x5e504719
-0,         21,         21,        1,    38016, 0x55252349
-0,         22,         22,        1,    38016, 0xdbdd0d9e
-0,         23,         23,        1,    38016, 0x550a0918
-0,         24,         24,        1,    38016, 0xb890feeb
-0,         25,         25,        1,    38016, 0x8aa01221
-0,         26,         26,        1,    38016, 0xfcc01085
-0,         27,         27,        1,    38016, 0x78f11d7d
-0,         28,         28,        1,    38016, 0xfcd33487
-0,         29,         29,        1,    38016, 0x9b444cfc
-0,         30,         30,        1,    38016, 0xed9563d3
-0,         31,         31,        1,    38016, 0x07e17628
-0,         32,         32,        1,    38016, 0x9bb792fd
-0,         33,         33,        1,    38016, 0xa6aea73d
-0,         34,         34,        1,    38016, 0x4b90b778
-0,         35,         35,        1,    38016, 0x6df2b998
-0,         36,         36,        1,    38016, 0x799eb2db
-0,         37,         37,        1,    38016, 0x48dab272
-0,         38,         38,        1,    38016, 0x9877b4eb
-0,         39,         39,        1,    38016, 0x901ab58e
-0,         40,         40,        1,    38016, 0x32c2beb1
-0,         41,         41,        1,    38016, 0xe542b56e
-0,         42,         42,        1,    38016, 0x1edf9ff4
-0,         43,         43,        1,    38016, 0xf103942c
-0,         44,         44,        1,    38016, 0x097a8dc7
-0,         45,         45,        1,    38016, 0xe3728780
-0,         46,         46,        1,    38016, 0xce9a9026
-0,         47,         47,        1,    38016, 0x78ba841b
-0,         48,         48,        1,    38016, 0x5fc687ab
-0,         49,         49,        1,    38016, 0x03a49472
diff --git a/deps/libav/tests/ref/fate/h264-conformance-caba1_sva_b b/deps/libav/tests/ref/fate/h264-conformance-caba1_sva_b
deleted file mode 100644
index 8b255bc..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-caba1_sva_b
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xee831fe4
-0,          1,          1,        1,    38016, 0x1098ff23
-0,          2,          2,        1,    38016, 0x8fc3e078
-0,          3,          3,        1,    38016, 0x86530991
-0,          4,          4,        1,    38016, 0xdc8e279e
-0,          5,          5,        1,    38016, 0x54ea3234
-0,          6,          6,        1,    38016, 0x79014662
-0,          7,          7,        1,    38016, 0x5d0a5a88
-0,          8,          8,        1,    38016, 0xf712805d
-0,          9,          9,        1,    38016, 0x0a09937e
-0,         10,         10,        1,    38016, 0xfa62a1d7
-0,         11,         11,        1,    38016, 0x67c6a41b
-0,         12,         12,        1,    38016, 0x6452ab94
-0,         13,         13,        1,    38016, 0xdb269049
-0,         14,         14,        1,    38016, 0xc7ab8864
-0,         15,         15,        1,    38016, 0xbb828f4a
-0,         16,         16,        1,    38016, 0x4fb3a61a
diff --git a/deps/libav/tests/ref/fate/h264-conformance-caba2_sony_e b/deps/libav/tests/ref/fate/h264-conformance-caba2_sony_e
deleted file mode 100644
index c30083c..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-caba2_sony_e
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb3883478
-0,          1,          1,        1,    38016, 0x23a30e47
-0,          2,          2,        1,    38016, 0xa0b7df0f
-0,          3,          3,        1,    38016, 0x5cd9beed
-0,          4,          4,        1,    38016, 0x13b09699
-0,          5,          5,        1,    38016, 0x66697d65
-0,          6,          6,        1,    38016, 0xf0486d0d
-0,          7,          7,        1,    38016, 0xaf94644e
-0,          8,          8,        1,    38016, 0x43c45981
-0,          9,          9,        1,    38016, 0x8f655e70
-0,         10,         10,        1,    38016, 0x3d747a52
-0,         11,         11,        1,    38016, 0x906e95f9
-0,         12,         12,        1,    38016, 0xdd3ea1a0
-0,         13,         13,        1,    38016, 0x216eb0ee
-0,         14,         14,        1,    38016, 0x06cbabfe
-0,         15,         15,        1,    38016, 0xd41c9cf7
-0,         16,         16,        1,    38016, 0x6d2fa58e
-0,         17,         17,        1,    38016, 0x0adca6fc
-0,         18,         18,        1,    38016, 0x51c49ad9
-0,         19,         19,        1,    38016, 0x83e57a42
-0,         20,         20,        1,    38016, 0xe47b5dad
-0,         21,         21,        1,    38016, 0x5e123c13
-0,         22,         22,        1,    38016, 0xad682f93
-0,         23,         23,        1,    38016, 0x77b02d2c
-0,         24,         24,        1,    38016, 0x976d316e
-0,         25,         25,        1,    38016, 0x3d923c72
-0,         26,         26,        1,    38016, 0xf073398d
-0,         27,         27,        1,    38016, 0x6dc547b4
-0,         28,         28,        1,    38016, 0xfa9859b3
-0,         29,         29,        1,    38016, 0xfc3f77b9
-0,         30,         30,        1,    38016, 0xed9563d3
-0,         31,         31,        1,    38016, 0xc040929e
-0,         32,         32,        1,    38016, 0x5562af3c
-0,         33,         33,        1,    38016, 0xa56abc78
-0,         34,         34,        1,    38016, 0x702ec702
-0,         35,         35,        1,    38016, 0x8ee7c909
-0,         36,         36,        1,    38016, 0x9065c44f
-0,         37,         37,        1,    38016, 0x11e3c40b
-0,         38,         38,        1,    38016, 0x20fbc27a
-0,         39,         39,        1,    38016, 0xaeecc582
-0,         40,         40,        1,    38016, 0x3b32ca4f
-0,         41,         41,        1,    38016, 0x5464ce6c
-0,         42,         42,        1,    38016, 0x41d4cd66
-0,         43,         43,        1,    38016, 0x8a69c6ef
-0,         44,         44,        1,    38016, 0x2c63c59e
-0,         45,         45,        1,    38016, 0xe3728780
-0,         46,         46,        1,    38016, 0xc60c9ca3
-0,         47,         47,        1,    38016, 0x8299a65a
-0,         48,         48,        1,    38016, 0x67d4b3d5
-0,         49,         49,        1,    38016, 0xd650bd19
-0,         50,         50,        1,    38016, 0xe8c9b285
-0,         51,         51,        1,    38016, 0x9a3dba0c
-0,         52,         52,        1,    38016, 0xb3f4bfc3
-0,         53,         53,        1,    38016, 0xe3edbe71
-0,         54,         54,        1,    38016, 0xea7fc14f
-0,         55,         55,        1,    38016, 0x4560cb94
-0,         56,         56,        1,    38016, 0x3b48ce1b
-0,         57,         57,        1,    38016, 0xc668d24c
-0,         58,         58,        1,    38016, 0x8bdcd514
-0,         59,         59,        1,    38016, 0xd0f8d380
-0,         60,         60,        1,    38016, 0x98a59a5a
-0,         61,         61,        1,    38016, 0x086d9c52
-0,         62,         62,        1,    38016, 0x50417af3
-0,         63,         63,        1,    38016, 0xe8ae428b
-0,         64,         64,        1,    38016, 0xb5663f68
-0,         65,         65,        1,    38016, 0x452e6045
-0,         66,         66,        1,    38016, 0x0412991e
-0,         67,         67,        1,    38016, 0xa791d0c8
-0,         68,         68,        1,    38016, 0x952c13e8
-0,         69,         69,        1,    38016, 0x9356462c
-0,         70,         70,        1,    38016, 0x34026bf3
-0,         71,         71,        1,    38016, 0x3a109e70
-0,         72,         72,        1,    38016, 0xc28dccb1
-0,         73,         73,        1,    38016, 0x445f08e7
-0,         74,         74,        1,    38016, 0x1e0c4781
-0,         75,         75,        1,    38016, 0x4c0b3afa
-0,         76,         76,        1,    38016, 0x90147b21
-0,         77,         77,        1,    38016, 0xe6fb9ee6
-0,         78,         78,        1,    38016, 0x3bbac15a
-0,         79,         79,        1,    38016, 0x113ecc97
-0,         80,         80,        1,    38016, 0xa271e248
-0,         81,         81,        1,    38016, 0xbc97f36a
-0,         82,         82,        1,    38016, 0x2a5af366
-0,         83,         83,        1,    38016, 0xc171ec49
-0,         84,         84,        1,    38016, 0x2393e85e
-0,         85,         85,        1,    38016, 0xbf59eeb0
-0,         86,         86,        1,    38016, 0xcec2f989
-0,         87,         87,        1,    38016, 0x3cb8fcb3
-0,         88,         88,        1,    38016, 0x28150278
-0,         89,         89,        1,    38016, 0x27f70026
-0,         90,         90,        1,    38016, 0x8fa69f07
-0,         91,         91,        1,    38016, 0x198b9a79
-0,         92,         92,        1,    38016, 0x40928d52
-0,         93,         93,        1,    38016, 0x1504834e
-0,         94,         94,        1,    38016, 0xb53677ab
-0,         95,         95,        1,    38016, 0x2e2c783d
-0,         96,         96,        1,    38016, 0x5fd38e3a
-0,         97,         97,        1,    38016, 0x697e9cd3
-0,         98,         98,        1,    38016, 0x0b18ad4b
-0,         99,         99,        1,    38016, 0x6ad7b78f
-0,        100,        100,        1,    38016, 0x6af3c654
-0,        101,        101,        1,    38016, 0x5aabb804
-0,        102,        102,        1,    38016, 0x9b5aa6e5
-0,        103,        103,        1,    38016, 0x2993a311
-0,        104,        104,        1,    38016, 0x1382b8e5
-0,        105,        105,        1,    38016, 0xf294a253
-0,        106,        106,        1,    38016, 0xafa5c2a5
-0,        107,        107,        1,    38016, 0x621ce2b5
-0,        108,        108,        1,    38016, 0x676c0440
-0,        109,        109,        1,    38016, 0xa7c31e07
-0,        110,        110,        1,    38016, 0x29612ba2
-0,        111,        111,        1,    38016, 0xb38c3920
-0,        112,        112,        1,    38016, 0xfcce3ee5
-0,        113,        113,        1,    38016, 0x3ee81fac
-0,        114,        114,        1,    38016, 0x635cfdb0
-0,        115,        115,        1,    38016, 0x222afa63
-0,        116,        116,        1,    38016, 0x230c09cb
-0,        117,        117,        1,    38016, 0x2b491802
-0,        118,        118,        1,    38016, 0x9cac2164
-0,        119,        119,        1,    38016, 0xa0532de8
-0,        120,        120,        1,    38016, 0x32e93592
-0,        121,        121,        1,    38016, 0x724033a9
-0,        122,        122,        1,    38016, 0x74411884
-0,        123,        123,        1,    38016, 0xae14efcf
-0,        124,        124,        1,    38016, 0x0188cdc7
-0,        125,        125,        1,    38016, 0x5708b5c1
-0,        126,        126,        1,    38016, 0x54aba6da
-0,        127,        127,        1,    38016, 0x7364b397
-0,        128,        128,        1,    38016, 0xf676c547
-0,        129,        129,        1,    38016, 0x6926db3a
-0,        130,        130,        1,    38016, 0xccdbe5be
-0,        131,        131,        1,    38016, 0x8fc8e490
-0,        132,        132,        1,    38016, 0x5d7fdd35
-0,        133,        133,        1,    38016, 0x0e27e010
-0,        134,        134,        1,    38016, 0x8120dd43
-0,        135,        135,        1,    38016, 0x1612a173
-0,        136,        136,        1,    38016, 0x3f1cb4b7
-0,        137,        137,        1,    38016, 0xd1c7b0a6
-0,        138,        138,        1,    38016, 0x472baad5
-0,        139,        139,        1,    38016, 0xfe37a1f3
-0,        140,        140,        1,    38016, 0x42a391ba
-0,        141,        141,        1,    38016, 0xdb618cac
-0,        142,        142,        1,    38016, 0x7af879bf
-0,        143,        143,        1,    38016, 0xe6f27644
-0,        144,        144,        1,    38016, 0x550a7f0c
-0,        145,        145,        1,    38016, 0x7d297eaa
-0,        146,        146,        1,    38016, 0xaeb57623
-0,        147,        147,        1,    38016, 0x6d5e4995
-0,        148,        148,        1,    38016, 0x57df1be0
-0,        149,        149,        1,    38016, 0x7617f825
-0,        150,        150,        1,    38016, 0xf731aef2
-0,        151,        151,        1,    38016, 0x489aae6c
-0,        152,        152,        1,    38016, 0x2d80b7a4
-0,        153,        153,        1,    38016, 0xe4b6ac4e
-0,        154,        154,        1,    38016, 0xd243a374
-0,        155,        155,        1,    38016, 0x5cf9b85b
-0,        156,        156,        1,    38016, 0xe824d798
-0,        157,        157,        1,    38016, 0x8a46f630
-0,        158,        158,        1,    38016, 0x4a03337f
-0,        159,        159,        1,    38016, 0xefe25cf7
-0,        160,        160,        1,    38016, 0xed876efa
-0,        161,        161,        1,    38016, 0xdf1b6b65
-0,        162,        162,        1,    38016, 0xd3225d8c
-0,        163,        163,        1,    38016, 0x0cf04d8d
-0,        164,        164,        1,    38016, 0x0fdc3bb3
-0,        165,        165,        1,    38016, 0xc31bf5da
-0,        166,        166,        1,    38016, 0x09e0ec79
-0,        167,        167,        1,    38016, 0x6521c8fb
-0,        168,        168,        1,    38016, 0x6f67a94c
-0,        169,        169,        1,    38016, 0xa0a49f38
-0,        170,        170,        1,    38016, 0x759fb6f2
-0,        171,        171,        1,    38016, 0xea41ddf8
-0,        172,        172,        1,    38016, 0xe559f0a6
-0,        173,        173,        1,    38016, 0x1dcbec38
-0,        174,        174,        1,    38016, 0xfb62dc6a
-0,        175,        175,        1,    38016, 0x3d0fac24
-0,        176,        176,        1,    38016, 0x87c373a1
-0,        177,        177,        1,    38016, 0x97a84562
-0,        178,        178,        1,    38016, 0xe4361c2e
-0,        179,        179,        1,    38016, 0x21170c47
-0,        180,        180,        1,    38016, 0x0769ec52
-0,        181,        181,        1,    38016, 0xac1ad44d
-0,        182,        182,        1,    38016, 0xdf87cb3e
-0,        183,        183,        1,    38016, 0x95c0d66f
-0,        184,        184,        1,    38016, 0xba33da6f
-0,        185,        185,        1,    38016, 0x71b2e866
-0,        186,        186,        1,    38016, 0x64540dd1
-0,        187,        187,        1,    38016, 0x79cb2d92
-0,        188,        188,        1,    38016, 0xfe8e394b
-0,        189,        189,        1,    38016, 0x648f443f
-0,        190,        190,        1,    38016, 0x491eee56
-0,        191,        191,        1,    38016, 0x6195b91b
-0,        192,        192,        1,    38016, 0x3935c2b0
-0,        193,        193,        1,    38016, 0x2408e296
-0,        194,        194,        1,    38016, 0xe17106b5
-0,        195,        195,        1,    38016, 0xd8d01ad1
-0,        196,        196,        1,    38016, 0x85d15104
-0,        197,        197,        1,    38016, 0xacc16731
-0,        198,        198,        1,    38016, 0xb6a990b7
-0,        199,        199,        1,    38016, 0x8153a9cd
-0,        200,        200,        1,    38016, 0xef5ab92a
-0,        201,        201,        1,    38016, 0x392acfab
-0,        202,        202,        1,    38016, 0x7031d48e
-0,        203,        203,        1,    38016, 0x5d3ed39f
-0,        204,        204,        1,    38016, 0x004fd516
-0,        205,        205,        1,    38016, 0x8de7dc94
-0,        206,        206,        1,    38016, 0x7e21db4a
-0,        207,        207,        1,    38016, 0x518dd829
-0,        208,        208,        1,    38016, 0xf780cf45
-0,        209,        209,        1,    38016, 0x0a49bd6f
-0,        210,        210,        1,    38016, 0xadb65d17
-0,        211,        211,        1,    38016, 0xbe79629d
-0,        212,        212,        1,    38016, 0x2daa65c8
-0,        213,        213,        1,    38016, 0x0b4a6737
-0,        214,        214,        1,    38016, 0x8e705885
-0,        215,        215,        1,    38016, 0x6d2a4af2
-0,        216,        216,        1,    38016, 0x89fe4b54
-0,        217,        217,        1,    38016, 0x90cb4dde
-0,        218,        218,        1,    38016, 0x2d9e4f4e
-0,        219,        219,        1,    38016, 0x5fcd4a7b
-0,        220,        220,        1,    38016, 0xdb4143e7
-0,        221,        221,        1,    38016, 0xd9343662
-0,        222,        222,        1,    38016, 0xdf4a2af2
-0,        223,        223,        1,    38016, 0xbe8f1fd2
-0,        224,        224,        1,    38016, 0x4658200f
-0,        225,        225,        1,    38016, 0x92b51315
-0,        226,        226,        1,    38016, 0x441f1576
-0,        227,        227,        1,    38016, 0x970b29b4
-0,        228,        228,        1,    38016, 0x93ac40f2
-0,        229,        229,        1,    38016, 0xa0ac6b06
-0,        230,        230,        1,    38016, 0xdd5b8f01
-0,        231,        231,        1,    38016, 0xa921b3d5
-0,        232,        232,        1,    38016, 0xdd6fdf01
-0,        233,        233,        1,    38016, 0x1c6c0306
-0,        234,        234,        1,    38016, 0xcea2235d
-0,        235,        235,        1,    38016, 0x43853758
-0,        236,        236,        1,    38016, 0xa0234e29
-0,        237,        237,        1,    38016, 0x94c85022
-0,        238,        238,        1,    38016, 0xaf4e33ab
-0,        239,        239,        1,    38016, 0x07f90e0c
-0,        240,        240,        1,    38016, 0x99cee4bd
-0,        241,        241,        1,    38016, 0xb7cdcf79
-0,        242,        242,        1,    38016, 0x5923c14c
-0,        243,        243,        1,    38016, 0x771f15d4
-0,        244,        244,        1,    38016, 0x20f08043
-0,        245,        245,        1,    38016, 0xb7bfeab2
-0,        246,        246,        1,    38016, 0x53440996
-0,        247,        247,        1,    38016, 0x6452d384
-0,        248,        248,        1,    38016, 0xabcb975e
-0,        249,        249,        1,    38016, 0x146123b9
-0,        250,        250,        1,    38016, 0xbeddbfff
-0,        251,        251,        1,    38016, 0xa0c97c47
-0,        252,        252,        1,    38016, 0x1dca7308
-0,        253,        253,        1,    38016, 0x16c5c832
-0,        254,        254,        1,    38016, 0xcab326b9
-0,        255,        255,        1,    38016, 0xe952c9bd
-0,        256,        256,        1,    38016, 0x216ec182
-0,        257,        257,        1,    38016, 0xb21a5074
-0,        258,        258,        1,    38016, 0xcbe73c15
-0,        259,        259,        1,    38016, 0xb5e532de
-0,        260,        260,        1,    38016, 0x3a693aa5
-0,        261,        261,        1,    38016, 0x157f4a20
-0,        262,        262,        1,    38016, 0x9f9a5868
-0,        263,        263,        1,    38016, 0x50f65ea1
-0,        264,        264,        1,    38016, 0xe1735d4f
-0,        265,        265,        1,    38016, 0x15284ec7
-0,        266,        266,        1,    38016, 0x32433d94
-0,        267,        267,        1,    38016, 0x768f2092
-0,        268,        268,        1,    38016, 0x6b01f5ad
-0,        269,        269,        1,    38016, 0xadcbce27
-0,        270,        270,        1,    38016, 0x6faca613
-0,        271,        271,        1,    38016, 0xd9327d40
-0,        272,        272,        1,    38016, 0xbc1060ef
-0,        273,        273,        1,    38016, 0xbe071251
-0,        274,        274,        1,    38016, 0x47abbfaa
-0,        275,        275,        1,    38016, 0x4851af88
-0,        276,        276,        1,    38016, 0xff53c772
-0,        277,        277,        1,    38016, 0xa1dcbef5
-0,        278,        278,        1,    38016, 0x106df309
-0,        279,        279,        1,    38016, 0x92e65f13
-0,        280,        280,        1,    38016, 0x7e8ffdb9
-0,        281,        281,        1,    38016, 0x0ba4d317
-0,        282,        282,        1,    38016, 0xe038a2a2
-0,        283,        283,        1,    38016, 0xc479675b
-0,        284,        284,        1,    38016, 0xadbc4d18
-0,        285,        285,        1,    38016, 0x2d41a44b
-0,        286,        286,        1,    38016, 0x3240617d
-0,        287,        287,        1,    38016, 0xa60f9b98
-0,        288,        288,        1,    38016, 0x3aeea379
-0,        289,        289,        1,    38016, 0x45a0936c
-0,        290,        290,        1,    38016, 0xf0c42d2f
-0,        291,        291,        1,    38016, 0x930343ee
-0,        292,        292,        1,    38016, 0xe074d631
-0,        293,        293,        1,    38016, 0xc6f20ab5
-0,        294,        294,        1,    38016, 0x3f5a4ef7
-0,        295,        295,        1,    38016, 0x94d44b16
-0,        296,        296,        1,    38016, 0xa52427da
-0,        297,        297,        1,    38016, 0x2f2116a1
-0,        298,        298,        1,    38016, 0x566c2541
-0,        299,        299,        1,    38016, 0x0b894c8b
diff --git a/deps/libav/tests/ref/fate/h264-conformance-caba2_sva_b b/deps/libav/tests/ref/fate/h264-conformance-caba2_sva_b
deleted file mode 100644
index ca89226..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-caba2_sva_b
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xee831fe4
-0,          1,          1,        1,    38016, 0xd9130e19
-0,          2,          2,        1,    38016, 0x8ad70cae
-0,          3,          3,        1,    38016, 0x98f11d0e
-0,          4,          4,        1,    38016, 0x311d46ea
-0,          5,          5,        1,    38016, 0xe2f15cc5
-0,          6,          6,        1,    38016, 0xb4c174c6
-0,          7,          7,        1,    38016, 0x22708406
-0,          8,          8,        1,    38016, 0x7116a2d2
-0,          9,          9,        1,    38016, 0x7937b29b
-0,         10,         10,        1,    38016, 0xfa62a1d7
-0,         11,         11,        1,    38016, 0x2066b1c6
-0,         12,         12,        1,    38016, 0x18ecaa40
-0,         13,         13,        1,    38016, 0xe5dc8d99
-0,         14,         14,        1,    38016, 0x77046f4a
-0,         15,         15,        1,    38016, 0x1c50704f
-0,         16,         16,        1,    38016, 0x87f1879d
diff --git a/deps/libav/tests/ref/fate/h264-conformance-caba3_sony_c b/deps/libav/tests/ref/fate/h264-conformance-caba3_sony_c
deleted file mode 100644
index c7aee37..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-caba3_sony_c
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb3883478
-0,          1,          1,        1,    38016, 0xb6261cdd
-0,          2,          2,        1,    38016, 0x42ecede9
-0,          3,          3,        1,    38016, 0xfcd6aec1
-0,          4,          4,        1,    38016, 0xb3ffa014
-0,          5,          5,        1,    38016, 0xc65383e3
-0,          6,          6,        1,    38016, 0xa8494fb1
-0,          7,          7,        1,    38016, 0x7fb14e0f
-0,          8,          8,        1,    38016, 0x7dd3462a
-0,          9,          9,        1,    38016, 0x4bd43dda
-0,         10,         10,        1,    38016, 0x717e736f
-0,         11,         11,        1,    38016, 0x2a9b8e47
-0,         12,         12,        1,    38016, 0x1bc272be
-0,         13,         13,        1,    38016, 0x0127afb5
-0,         14,         14,        1,    38016, 0xfd7aacda
-0,         15,         15,        1,    38016, 0xd41c9cf7
-0,         16,         16,        1,    38016, 0xd205b1ee
-0,         17,         17,        1,    38016, 0x967ca895
-0,         18,         18,        1,    38016, 0x25978063
-0,         19,         19,        1,    38016, 0x632081b3
-0,         20,         20,        1,    38016, 0x8ccf5f0b
-0,         21,         21,        1,    38016, 0x21cc2141
-0,         22,         22,        1,    38016, 0x477d2543
-0,         23,         23,        1,    38016, 0xff971bb8
-0,         24,         24,        1,    38016, 0x0dc21005
-0,         25,         25,        1,    38016, 0xc69c2d90
-0,         26,         26,        1,    38016, 0xd7922b5d
-0,         27,         27,        1,    38016, 0x59a3278f
-0,         28,         28,        1,    38016, 0x83c55d4d
-0,         29,         29,        1,    38016, 0xaac96f23
-0,         30,         30,        1,    38016, 0xed9563d3
-0,         31,         31,        1,    38016, 0xf86b9ef4
-0,         32,         32,        1,    38016, 0xe616b81c
-0,         33,         33,        1,    38016, 0xde60a57b
-0,         34,         34,        1,    38016, 0x5fe8d130
-0,         35,         35,        1,    38016, 0x11decaca
-0,         36,         36,        1,    38016, 0x526fa8e2
-0,         37,         37,        1,    38016, 0xc5e7ccfb
-0,         38,         38,        1,    38016, 0x10e1c588
-0,         39,         39,        1,    38016, 0x78aeb05b
-0,         40,         40,        1,    38016, 0xff85c717
-0,         41,         41,        1,    38016, 0x3f02c1b2
-0,         42,         42,        1,    38016, 0xf45eb015
-0,         43,         43,        1,    38016, 0x0211b84d
-0,         44,         44,        1,    38016, 0x3864ba1f
-0,         45,         45,        1,    38016, 0xe3728780
-0,         46,         46,        1,    38016, 0x575da8b5
-0,         47,         47,        1,    38016, 0xc841ad98
-0,         48,         48,        1,    38016, 0xe69ea78f
-0,         49,         49,        1,    38016, 0x45cabf16
-0,         50,         50,        1,    38016, 0x0e00b8eb
-0,         51,         51,        1,    38016, 0xa774a808
-0,         52,         52,        1,    38016, 0xfb1bbc2b
-0,         53,         53,        1,    38016, 0xcfb4b41d
-0,         54,         54,        1,    38016, 0x66abaff8
-0,         55,         55,        1,    38016, 0xc39ac9a9
-0,         56,         56,        1,    38016, 0xbec0cc9a
-0,         57,         57,        1,    38016, 0xf393c7fc
-0,         58,         58,        1,    38016, 0xedb5d4ef
-0,         59,         59,        1,    38016, 0x4b0fd4fe
-0,         60,         60,        1,    38016, 0x98a59a5a
-0,         61,         61,        1,    38016, 0x0a69a4f3
-0,         62,         62,        1,    38016, 0x72bc89ce
-0,         63,         63,        1,    38016, 0xfe8538b6
-0,         64,         64,        1,    38016, 0xc8a158a3
-0,         65,         65,        1,    38016, 0x1cb57fcd
-0,         66,         66,        1,    38016, 0x76c29215
-0,         67,         67,        1,    38016, 0xdb36ec21
-0,         68,         68,        1,    38016, 0xc2e22427
-0,         69,         69,        1,    38016, 0xafb433cd
-0,         70,         70,        1,    38016, 0x4d736e28
-0,         71,         71,        1,    38016, 0xc6ab9949
-0,         72,         72,        1,    38016, 0xaa9bb9e6
-0,         73,         73,        1,    38016, 0x0d41f894
-0,         74,         74,        1,    38016, 0x603332b0
-0,         75,         75,        1,    38016, 0x4c0b3afa
-0,         76,         76,        1,    38016, 0x8fd3845e
-0,         77,         77,        1,    38016, 0x8cf09ae3
-0,         78,         78,        1,    38016, 0x1e02adfb
-0,         79,         79,        1,    38016, 0x3c9ac38e
-0,         80,         80,        1,    38016, 0xb5fdd2d9
-0,         81,         81,        1,    38016, 0x82c5dd7f
-0,         82,         82,        1,    38016, 0x4b6ee80a
-0,         83,         83,        1,    38016, 0xaeaee46f
-0,         84,         84,        1,    38016, 0x390ed382
-0,         85,         85,        1,    38016, 0xedbfde44
-0,         86,         86,        1,    38016, 0xabf6eba0
-0,         87,         87,        1,    38016, 0x5bf5efd0
-0,         88,         88,        1,    38016, 0x9a88ebe3
-0,         89,         89,        1,    38016, 0x2af7ec3b
-0,         90,         90,        1,    38016, 0x8fa69f07
-0,         91,         91,        1,    38016, 0xff8fb3b5
-0,         92,         92,        1,    38016, 0xd06fa3c1
-0,         93,         93,        1,    38016, 0xe5a97d39
-0,         94,         94,        1,    38016, 0x961e7c6f
-0,         95,         95,        1,    38016, 0x18b278af
-0,         96,         96,        1,    38016, 0x9a0d73d2
-0,         97,         97,        1,    38016, 0x378f9d74
-0,         98,         98,        1,    38016, 0x42e5a7a3
-0,         99,         99,        1,    38016, 0x4595a78e
-0,        100,        100,        1,    38016, 0x6c09c035
-0,        101,        101,        1,    38016, 0xec58ab98
-0,        102,        102,        1,    38016, 0x1b4b8d2b
-0,        103,        103,        1,    38016, 0xf5199117
-0,        104,        104,        1,    38016, 0xcd31af4d
-0,        105,        105,        1,    38016, 0xf294a253
-0,        106,        106,        1,    38016, 0x360dde6b
-0,        107,        107,        1,    38016, 0x101cf70c
-0,        108,        108,        1,    38016, 0x4b34ff17
-0,        109,        109,        1,    38016, 0x520639c0
-0,        110,        110,        1,    38016, 0x901840a9
-0,        111,        111,        1,    38016, 0x4cb03284
-0,        112,        112,        1,    38016, 0x6929470c
-0,        113,        113,        1,    38016, 0x21282bdf
-0,        114,        114,        1,    38016, 0xee8df0ec
-0,        115,        115,        1,    38016, 0x24970e16
-0,        116,        116,        1,    38016, 0x280118e3
-0,        117,        117,        1,    38016, 0x00a10b64
-0,        118,        118,        1,    38016, 0xb0673f83
-0,        119,        119,        1,    38016, 0x838644de
-0,        120,        120,        1,    38016, 0x32e93592
-0,        121,        121,        1,    38016, 0xedfc477a
-0,        122,        122,        1,    38016, 0x41062501
-0,        123,        123,        1,    38016, 0xf218ebf2
-0,        124,        124,        1,    38016, 0x3430dc73
-0,        125,        125,        1,    38016, 0xb2fab8f0
-0,        126,        126,        1,    38016, 0x11b19bab
-0,        127,        127,        1,    38016, 0x8e30b8e7
-0,        128,        128,        1,    38016, 0xc8b9c646
-0,        129,        129,        1,    38016, 0xc902d559
-0,        130,        130,        1,    38016, 0x3a24ec30
-0,        131,        131,        1,    38016, 0x744de424
-0,        132,        132,        1,    38016, 0xc40cd059
-0,        133,        133,        1,    38016, 0xd98dd9ec
-0,        134,        134,        1,    38016, 0x9719d698
-0,        135,        135,        1,    38016, 0x1612a173
-0,        136,        136,        1,    38016, 0xc044b9f1
-0,        137,        137,        1,    38016, 0xc433af2f
-0,        138,        138,        1,    38016, 0x559891e3
-0,        139,        139,        1,    38016, 0x969e9a33
-0,        140,        140,        1,    38016, 0x8a6a8e77
-0,        141,        141,        1,    38016, 0x9d7b76bf
-0,        142,        142,        1,    38016, 0x3725711a
-0,        143,        143,        1,    38016, 0x5b316bd0
-0,        144,        144,        1,    38016, 0x4c616abd
-0,        145,        145,        1,    38016, 0x43637e2b
-0,        146,        146,        1,    38016, 0xd9e36c4c
-0,        147,        147,        1,    38016, 0x823d3596
-0,        148,        148,        1,    38016, 0x57361a59
-0,        149,        149,        1,    38016, 0x4a91f007
-0,        150,        150,        1,    38016, 0xf731aef2
-0,        151,        151,        1,    38016, 0x8ed2c618
-0,        152,        152,        1,    38016, 0x6f1cc918
-0,        153,        153,        1,    38016, 0x2a8ba336
-0,        154,        154,        1,    38016, 0x8159b595
-0,        155,        155,        1,    38016, 0x07cfced9
-0,        156,        156,        1,    38016, 0x8804c878
-0,        157,        157,        1,    38016, 0x624e0656
-0,        158,        158,        1,    38016, 0x8628302b
-0,        159,        159,        1,    38016, 0xd155461e
-0,        160,        160,        1,    38016, 0x3c1c647c
-0,        161,        161,        1,    38016, 0x8a485727
-0,        162,        162,        1,    38016, 0x144934f7
-0,        163,        163,        1,    38016, 0x43183494
-0,        164,        164,        1,    38016, 0x20fd2ef2
-0,        165,        165,        1,    38016, 0xc31bf5da
-0,        166,        166,        1,    38016, 0x4c70f0f2
-0,        167,        167,        1,    38016, 0xba1bcbcc
-0,        168,        168,        1,    38016, 0x11039c6c
-0,        169,        169,        1,    38016, 0x67c59b61
-0,        170,        170,        1,    38016, 0xdc0aa2ba
-0,        171,        171,        1,    38016, 0x1e2dbec9
-0,        172,        172,        1,    38016, 0xacacdc6c
-0,        173,        173,        1,    38016, 0x2049defe
-0,        174,        174,        1,    38016, 0x7488cc3e
-0,        175,        175,        1,    38016, 0x14bca829
-0,        176,        176,        1,    38016, 0xc19c76ee
-0,        177,        177,        1,    38016, 0xeca33612
-0,        178,        178,        1,    38016, 0x93b027a5
-0,        179,        179,        1,    38016, 0x82ae1e62
-0,        180,        180,        1,    38016, 0x0769ec52
-0,        181,        181,        1,    38016, 0x7cdee8dd
-0,        182,        182,        1,    38016, 0x7d22d43d
-0,        183,        183,        1,    38016, 0x65d8cd49
-0,        184,        184,        1,    38016, 0xa7d2ede4
-0,        185,        185,        1,    38016, 0x6bd2ffa1
-0,        186,        186,        1,    38016, 0xb4db0734
-0,        187,        187,        1,    38016, 0x69cb35ac
-0,        188,        188,        1,    38016, 0x05e52e88
-0,        189,        189,        1,    38016, 0x4dc92a43
-0,        190,        190,        1,    38016, 0x8ca0e858
-0,        191,        191,        1,    38016, 0x74fbae53
-0,        192,        192,        1,    38016, 0x19f0aa17
-0,        193,        193,        1,    38016, 0x04c9dc83
-0,        194,        194,        1,    38016, 0x0a8ff4b9
-0,        195,        195,        1,    38016, 0xd8d01ad1
-0,        196,        196,        1,    38016, 0xa41b5100
-0,        197,        197,        1,    38016, 0xfaf96547
-0,        198,        198,        1,    38016, 0xadab8265
-0,        199,        199,        1,    38016, 0x6e12a9c3
-0,        200,        200,        1,    38016, 0x1de7b7d1
-0,        201,        201,        1,    38016, 0x2279bc4a
-0,        202,        202,        1,    38016, 0x4f62ca0f
-0,        203,        203,        1,    38016, 0xfaf2cc43
-0,        204,        204,        1,    38016, 0xbf68c7df
-0,        205,        205,        1,    38016, 0xb927d1ea
-0,        206,        206,        1,    38016, 0x8b93d7c6
-0,        207,        207,        1,    38016, 0x13f3d7d6
-0,        208,        208,        1,    38016, 0x9ee4cc7b
-0,        209,        209,        1,    38016, 0x16deb1a0
-0,        210,        210,        1,    38016, 0xadb65d17
-0,        211,        211,        1,    38016, 0x0b9e7542
-0,        212,        212,        1,    38016, 0x05777490
-0,        213,        213,        1,    38016, 0x6805549f
-0,        214,        214,        1,    38016, 0xe3246225
-0,        215,        215,        1,    38016, 0x4003551b
-0,        216,        216,        1,    38016, 0x1e083a01
-0,        217,        217,        1,    38016, 0x756e4f22
-0,        218,        218,        1,    38016, 0xf2f24967
-0,        219,        219,        1,    38016, 0x680d37f2
-0,        220,        220,        1,    38016, 0x85b34185
-0,        221,        221,        1,    38016, 0xefa32eeb
-0,        222,        222,        1,    38016, 0xca791448
-0,        223,        223,        1,    38016, 0x7c6b2b13
-0,        224,        224,        1,    38016, 0x0d8232a6
-0,        225,        225,        1,    38016, 0x92b51315
-0,        226,        226,        1,    38016, 0xcfde349c
-0,        227,        227,        1,    38016, 0xdc1a488b
-0,        228,        228,        1,    38016, 0xdcf94106
-0,        229,        229,        1,    38016, 0xc205829b
-0,        230,        230,        1,    38016, 0x0aff9da3
-0,        231,        231,        1,    38016, 0x3295b04e
-0,        232,        232,        1,    38016, 0xc42dfaab
-0,        233,        233,        1,    38016, 0x799e14a2
-0,        234,        234,        1,    38016, 0xf658150c
-0,        235,        235,        1,    38016, 0x4c8751fe
-0,        236,        236,        1,    38016, 0xe57d58ed
-0,        237,        237,        1,    38016, 0x28f83c49
-0,        238,        238,        1,    38016, 0x9760453c
-0,        239,        239,        1,    38016, 0x1d550fcf
-0,        240,        240,        1,    38016, 0x99cee4bd
-0,        241,        241,        1,    38016, 0x743ad122
-0,        242,        242,        1,    38016, 0xb533ab7c
-0,        243,        243,        1,    38016, 0x5ca5fc65
-0,        244,        244,        1,    38016, 0x491c7076
-0,        245,        245,        1,    38016, 0x8a96d9e5
-0,        246,        246,        1,    38016, 0x23c3f207
-0,        247,        247,        1,    38016, 0x3181d62d
-0,        248,        248,        1,    38016, 0xc72e9636
-0,        249,        249,        1,    38016, 0xe0c31ae9
-0,        250,        250,        1,    38016, 0x2f91c0ce
-0,        251,        251,        1,    38016, 0x17937763
-0,        252,        252,        1,    38016, 0x61986c20
-0,        253,        253,        1,    38016, 0x6adeca83
-0,        254,        254,        1,    38016, 0x894a376b
-0,        255,        255,        1,    38016, 0xe952c9bd
-0,        256,        256,        1,    38016, 0x0418d8e9
-0,        257,        257,        1,    38016, 0x30de606e
-0,        258,        258,        1,    38016, 0xd15e3116
-0,        259,        259,        1,    38016, 0xee0446ac
-0,        260,        260,        1,    38016, 0x34ee44f7
-0,        261,        261,        1,    38016, 0x825745d4
-0,        262,        262,        1,    38016, 0xb8046176
-0,        263,        263,        1,    38016, 0xa812588a
-0,        264,        264,        1,    38016, 0xed754b26
-0,        265,        265,        1,    38016, 0xa39c51cd
-0,        266,        266,        1,    38016, 0x315b38d5
-0,        267,        267,        1,    38016, 0x12550e05
-0,        268,        268,        1,    38016, 0xbda6fd9a
-0,        269,        269,        1,    38016, 0xd10bd86c
-0,        270,        270,        1,    38016, 0x6faca613
-0,        271,        271,        1,    38016, 0x6268848a
-0,        272,        272,        1,    38016, 0x2b8367e6
-0,        273,        273,        1,    38016, 0xdb6806fd
-0,        274,        274,        1,    38016, 0x4f58d418
-0,        275,        275,        1,    38016, 0x59beb628
-0,        276,        276,        1,    38016, 0x8017aae2
-0,        277,        277,        1,    38016, 0xb26ad1b3
-0,        278,        278,        1,    38016, 0xa058f3a3
-0,        279,        279,        1,    38016, 0x4fee4ac2
-0,        280,        280,        1,    38016, 0x5dd20ae9
-0,        281,        281,        1,    38016, 0x6365dbda
-0,        282,        282,        1,    38016, 0x25b47f80
-0,        283,        283,        1,    38016, 0x468b8ecb
-0,        284,        284,        1,    38016, 0x0b0760f9
-0,        285,        285,        1,    38016, 0x2d41a44b
-0,        286,        286,        1,    38016, 0x4bb47357
-0,        287,        287,        1,    38016, 0x2c0ca74c
-0,        288,        288,        1,    38016, 0x6484a271
-0,        289,        289,        1,    38016, 0xa55871df
-0,        290,        290,        1,    38016, 0xa617ecd8
-0,        291,        291,        1,    38016, 0xf7231cc5
-0,        292,        292,        1,    38016, 0x15dba20b
-0,        293,        293,        1,    38016, 0x56a7d8c7
-0,        294,        294,        1,    38016, 0x5e78382b
-0,        295,        295,        1,    38016, 0x8edf243b
-0,        296,        296,        1,    38016, 0x571effaf
-0,        297,        297,        1,    38016, 0x274302d2
-0,        298,        298,        1,    38016, 0xc950203d
-0,        299,        299,        1,    38016, 0x4a744324
diff --git a/deps/libav/tests/ref/fate/h264-conformance-caba3_sva_b b/deps/libav/tests/ref/fate/h264-conformance-caba3_sva_b
deleted file mode 100644
index 7bdb3f8..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-caba3_sva_b
+++ /dev/null
@@ -1,34 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x0e091175
-0,          1,          1,        1,    38016, 0xe8f81506
-0,          2,          2,        1,    38016, 0xf706f5cd
-0,          3,          3,        1,    38016, 0x9aeb21b1
-0,          4,          4,        1,    38016, 0xdc533379
-0,          5,          5,        1,    38016, 0xd26d534b
-0,          6,          6,        1,    38016, 0xdcb25dc5
-0,          7,          7,        1,    38016, 0x1b258cc2
-0,          8,          8,        1,    38016, 0xdfb58ff8
-0,          9,          9,        1,    38016, 0x143abf85
-0,         10,         10,        1,    38016, 0xace399ea
-0,         11,         11,        1,    38016, 0x1ad6bb8e
-0,         12,         12,        1,    38016, 0xf01d9b78
-0,         13,         13,        1,    38016, 0x5a0c99ed
-0,         14,         14,        1,    38016, 0x9d4e684c
-0,         15,         15,        1,    38016, 0xca3d811f
-0,         16,         16,        1,    38016, 0x388c7bc4
-0,         17,         17,        1,    38016, 0x36329ae0
-0,         18,         18,        1,    38016, 0x7ca686ac
-0,         19,         19,        1,    38016, 0x9d7ababf
-0,         20,         20,        1,    38016, 0x563eaf2a
-0,         21,         21,        1,    38016, 0xce22a4be
-0,         22,         22,        1,    38016, 0xb7cb719a
-0,         23,         23,        1,    38016, 0x7b706edf
-0,         24,         24,        1,    38016, 0x009a30b5
-0,         25,         25,        1,    38016, 0xf1fe3fbc
-0,         26,         26,        1,    38016, 0x7f732436
-0,         27,         27,        1,    38016, 0x055147ec
-0,         28,         28,        1,    38016, 0x1670494c
-0,         29,         29,        1,    38016, 0xfede7bab
-0,         30,         30,        1,    38016, 0xa3b660d8
-0,         31,         31,        1,    38016, 0x33db7209
-0,         32,         32,        1,    38016, 0xb7b25559
diff --git a/deps/libav/tests/ref/fate/h264-conformance-caba3_toshiba_e b/deps/libav/tests/ref/fate/h264-conformance-caba3_toshiba_e
deleted file mode 100644
index b31efe1..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-caba3_toshiba_e
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x72723ce4
-0,          1,          1,        1,    38016, 0x347219d7
-0,          2,          2,        1,    38016, 0x813ff182
-0,          3,          3,        1,    38016, 0x4e69d41a
-0,          4,          4,        1,    38016, 0x5e56acb6
-0,          5,          5,        1,    38016, 0xe72197e5
-0,          6,          6,        1,    38016, 0xd035807a
-0,          7,          7,        1,    38016, 0x9ee57559
-0,          8,          8,        1,    38016, 0xd0f56f28
-0,          9,          9,        1,    38016, 0xa5097788
-0,         10,         10,        1,    38016, 0xf108978d
-0,         11,         11,        1,    38016, 0xf76cb475
-0,         12,         12,        1,    38016, 0x0184cc3a
-0,         13,         13,        1,    38016, 0xa4b5dc15
-0,         14,         14,        1,    38016, 0x209cdc42
-0,         15,         15,        1,    38016, 0xd9e69a8c
-0,         16,         16,        1,    38016, 0xa2c3a9ba
-0,         17,         17,        1,    38016, 0xdf84a52e
-0,         18,         18,        1,    38016, 0xfe48a7f0
-0,         19,         19,        1,    38016, 0xb0279a19
-0,         20,         20,        1,    38016, 0xf3b48652
-0,         21,         21,        1,    38016, 0xc12b61b5
-0,         22,         22,        1,    38016, 0x13065a22
-0,         23,         23,        1,    38016, 0x804853d4
-0,         24,         24,        1,    38016, 0x40935736
-0,         25,         25,        1,    38016, 0x1a135ecb
-0,         26,         26,        1,    38016, 0x125f6116
-0,         27,         27,        1,    38016, 0x53286da3
-0,         28,         28,        1,    38016, 0xd49287ac
-0,         29,         29,        1,    38016, 0xc70a9c2c
-0,         30,         30,        1,    38016, 0x0c0c6998
-0,         31,         31,        1,    38016, 0xf37d9141
-0,         32,         32,        1,    38016, 0xd36eafa2
-0,         33,         33,        1,    38016, 0x0d1fc298
-0,         34,         34,        1,    38016, 0xf84ad5d9
-0,         35,         35,        1,    38016, 0xc1e8d93d
-0,         36,         36,        1,    38016, 0xe190dabd
-0,         37,         37,        1,    38016, 0x9542db28
-0,         38,         38,        1,    38016, 0xa67edc7f
-0,         39,         39,        1,    38016, 0x65efdfa7
-0,         40,         40,        1,    38016, 0x7039e6c6
-0,         41,         41,        1,    38016, 0x8307ee87
-0,         42,         42,        1,    38016, 0x1f83ec00
-0,         43,         43,        1,    38016, 0x9e33ea6e
-0,         44,         44,        1,    38016, 0xb53ef238
-0,         45,         45,        1,    38016, 0x6d04930c
-0,         46,         46,        1,    38016, 0xed90a50e
-0,         47,         47,        1,    38016, 0xd98cb4a6
-0,         48,         48,        1,    38016, 0xa7f5bd5e
-0,         49,         49,        1,    38016, 0x4df9ca95
-0,         50,         50,        1,    38016, 0xc8e7cb40
-0,         51,         51,        1,    38016, 0x93d9d23c
-0,         52,         52,        1,    38016, 0xc07fd34f
-0,         53,         53,        1,    38016, 0xf7c5d645
-0,         54,         54,        1,    38016, 0x3c1ddf53
-0,         55,         55,        1,    38016, 0x0bafe394
-0,         56,         56,        1,    38016, 0x9179ec6f
-0,         57,         57,        1,    38016, 0x3483efc3
-0,         58,         58,        1,    38016, 0xf7ccf70d
-0,         59,         59,        1,    38016, 0x289ef13b
-0,         60,         60,        1,    38016, 0xb00c99dc
-0,         61,         61,        1,    38016, 0x59409b34
-0,         62,         62,        1,    38016, 0x3fc079a2
-0,         63,         63,        1,    38016, 0x90ad49d9
-0,         64,         64,        1,    38016, 0x8e7751e2
-0,         65,         65,        1,    38016, 0xed20743d
-0,         66,         66,        1,    38016, 0x66a1a470
-0,         67,         67,        1,    38016, 0x7a77e252
-0,         68,         68,        1,    38016, 0x6bb427fe
-0,         69,         69,        1,    38016, 0x87126360
-0,         70,         70,        1,    38016, 0x330789d0
-0,         71,         71,        1,    38016, 0xc298b987
-0,         72,         72,        1,    38016, 0x4959f143
-0,         73,         73,        1,    38016, 0xa66e3082
-0,         74,         74,        1,    38016, 0xb9f67824
-0,         75,         75,        1,    38016, 0x27fe46a2
-0,         76,         76,        1,    38016, 0xc50c87ed
-0,         77,         77,        1,    38016, 0x9523a9f6
-0,         78,         78,        1,    38016, 0xbe28d1d7
-0,         79,         79,        1,    38016, 0x3c0ee964
-0,         80,         80,        1,    38016, 0x65c7f36c
-0,         81,         81,        1,    38016, 0xe5030946
-0,         82,         82,        1,    38016, 0x4bbb11fa
-0,         83,         83,        1,    38016, 0xeaf209ed
-0,         84,         84,        1,    38016, 0x96c80987
-0,         85,         85,        1,    38016, 0x69820c58
-0,         86,         86,        1,    38016, 0x5f951aa7
-0,         87,         87,        1,    38016, 0xfe6122d9
-0,         88,         88,        1,    38016, 0xa202301a
-0,         89,         89,        1,    38016, 0xdd2628fb
-0,         90,         90,        1,    38016, 0xe081a5ff
-0,         91,         91,        1,    38016, 0x5b858e9e
-0,         92,         92,        1,    38016, 0x7a368229
-0,         93,         93,        1,    38016, 0x3791829a
-0,         94,         94,        1,    38016, 0x9c68723d
-0,         95,         95,        1,    38016, 0xef26778e
-0,         96,         96,        1,    38016, 0x39a491cf
-0,         97,         97,        1,    38016, 0x776ea867
-0,         98,         98,        1,    38016, 0xda9ac03b
-0,         99,         99,        1,    38016, 0x653bc9a3
-0,        100,        100,        1,    38016, 0x79e1da19
-0,        101,        101,        1,    38016, 0x3b98c6eb
-0,        102,        102,        1,    38016, 0x42cdb846
-0,        103,        103,        1,    38016, 0x7872ada1
-0,        104,        104,        1,    38016, 0xb2f6d2ef
-0,        105,        105,        1,    38016, 0x9468b16a
-0,        106,        106,        1,    38016, 0xe793c91a
-0,        107,        107,        1,    38016, 0x80bde366
-0,        108,        108,        1,    38016, 0xa7250446
-0,        109,        109,        1,    38016, 0x7039280b
-0,        110,        110,        1,    38016, 0x1665350c
-0,        111,        111,        1,    38016, 0xb5c93f1f
-0,        112,        112,        1,    38016, 0xf77a4c44
-0,        113,        113,        1,    38016, 0x3a093143
-0,        114,        114,        1,    38016, 0x1d6b1005
-0,        115,        115,        1,    38016, 0xe1a10c01
-0,        116,        116,        1,    38016, 0x2d4d1d54
-0,        117,        117,        1,    38016, 0x902f2b14
-0,        118,        118,        1,    38016, 0xb26e3e73
-0,        119,        119,        1,    38016, 0xed7a469e
-0,        120,        120,        1,    38016, 0xbc663d2a
-0,        121,        121,        1,    38016, 0x60a5488e
-0,        122,        122,        1,    38016, 0x451b31ca
-0,        123,        123,        1,    38016, 0x54311166
-0,        124,        124,        1,    38016, 0x57d9f31e
-0,        125,        125,        1,    38016, 0x567dd693
-0,        126,        126,        1,    38016, 0x0e58d88c
-0,        127,        127,        1,    38016, 0xa555e124
-0,        128,        128,        1,    38016, 0x94e2f835
-0,        129,        129,        1,    38016, 0xe49e0ec0
-0,        130,        130,        1,    38016, 0x585d188e
-0,        131,        131,        1,    38016, 0x696e1a0d
-0,        132,        132,        1,    38016, 0xac9014b1
-0,        133,        133,        1,    38016, 0x915413c6
-0,        134,        134,        1,    38016, 0x5fa30be7
-0,        135,        135,        1,    38016, 0x8fbfb69c
-0,        136,        136,        1,    38016, 0xcaeabfab
-0,        137,        137,        1,    38016, 0xe494bf5c
-0,        138,        138,        1,    38016, 0xae03be55
-0,        139,        139,        1,    38016, 0xb734b4d3
-0,        140,        140,        1,    38016, 0xdc6fb56f
-0,        141,        141,        1,    38016, 0xfea0a853
-0,        142,        142,        1,    38016, 0xb4919381
-0,        143,        143,        1,    38016, 0x13a792fe
-0,        144,        144,        1,    38016, 0xc8829fd8
-0,        145,        145,        1,    38016, 0x2113a62b
-0,        146,        146,        1,    38016, 0x171f98d2
-0,        147,        147,        1,    38016, 0x1a6d6d17
-0,        148,        148,        1,    38016, 0xd4ab41c3
-0,        149,        149,        1,    38016, 0xd2df1c80
-0,        150,        150,        1,    38016, 0x14cdbb35
-0,        151,        151,        1,    38016, 0x2b74b829
-0,        152,        152,        1,    38016, 0x6433bd55
-0,        153,        153,        1,    38016, 0xd11dbc28
-0,        154,        154,        1,    38016, 0x4981ad33
-0,        155,        155,        1,    38016, 0xc38bbbad
-0,        156,        156,        1,    38016, 0x048de367
-0,        157,        157,        1,    38016, 0x6c9a0c5a
-0,        158,        158,        1,    38016, 0x384c4255
-0,        159,        159,        1,    38016, 0x3e9873ba
-0,        160,        160,        1,    38016, 0xe4988671
-0,        161,        161,        1,    38016, 0x05b4843c
-0,        162,        162,        1,    38016, 0xed0a7e13
-0,        163,        163,        1,    38016, 0x750c6f90
-0,        164,        164,        1,    38016, 0x9d296035
-0,        165,        165,        1,    38016, 0xbaa006bd
-0,        166,        166,        1,    38016, 0x8289f8ae
-0,        167,        167,        1,    38016, 0x3f3de147
-0,        168,        168,        1,    38016, 0xc5debc49
-0,        169,        169,        1,    38016, 0x1fe9bbfc
-0,        170,        170,        1,    38016, 0x006cd4a9
-0,        171,        171,        1,    38016, 0xe551f2b3
-0,        172,        172,        1,    38016, 0xb370140e
-0,        173,        173,        1,    38016, 0xc9441c24
-0,        174,        174,        1,    38016, 0x7f5c01c5
-0,        175,        175,        1,    38016, 0x352ad9f6
-0,        176,        176,        1,    38016, 0xe0909a17
-0,        177,        177,        1,    38016, 0x49bf5ea8
-0,        178,        178,        1,    38016, 0x7f1d387b
-0,        179,        179,        1,    38016, 0x30812233
-0,        180,        180,        1,    38016, 0xb0bdf16f
-0,        181,        181,        1,    38016, 0x5372d0e9
-0,        182,        182,        1,    38016, 0xbf1bc91c
-0,        183,        183,        1,    38016, 0xaef5d647
-0,        184,        184,        1,    38016, 0xf007e86c
-0,        185,        185,        1,    38016, 0x683bf72b
-0,        186,        186,        1,    38016, 0xbb722114
-0,        187,        187,        1,    38016, 0xc5864b63
-0,        188,        188,        1,    38016, 0xfefd5cf4
-0,        189,        189,        1,    38016, 0xa0f263d5
-0,        190,        190,        1,    38016, 0x18401a02
-0,        191,        191,        1,    38016, 0x55cdd97b
-0,        192,        192,        1,    38016, 0x5a4ee22d
-0,        193,        193,        1,    38016, 0xa60706b3
-0,        194,        194,        1,    38016, 0x644422bb
-0,        195,        195,        1,    38016, 0xc22421c9
-0,        196,        196,        1,    38016, 0x1d6b54e4
-0,        197,        197,        1,    38016, 0xc7627820
-0,        198,        198,        1,    38016, 0x0a6ea609
-0,        199,        199,        1,    38016, 0x4315c087
-0,        200,        200,        1,    38016, 0x3164d978
-0,        201,        201,        1,    38016, 0x08e3e7eb
-0,        202,        202,        1,    38016, 0x4f04eaed
-0,        203,        203,        1,    38016, 0x9f83eb5a
-0,        204,        204,        1,    38016, 0xfbbcf0b2
-0,        205,        205,        1,    38016, 0xee1efb8a
-0,        206,        206,        1,    38016, 0x87710ba0
-0,        207,        207,        1,    38016, 0xb96b05c1
-0,        208,        208,        1,    38016, 0xd5a4fc50
-0,        209,        209,        1,    38016, 0xad85ea19
-0,        210,        210,        1,    38016, 0x5f606058
-0,        211,        211,        1,    38016, 0xdaf55ad0
-0,        212,        212,        1,    38016, 0xee8564d6
-0,        213,        213,        1,    38016, 0xa1846cad
-0,        214,        214,        1,    38016, 0xcd316a62
-0,        215,        215,        1,    38016, 0xdcf5638f
-0,        216,        216,        1,    38016, 0xc5e36d1d
-0,        217,        217,        1,    38016, 0x958369a6
-0,        218,        218,        1,    38016, 0x05826bf0
-0,        219,        219,        1,    38016, 0x22146914
-0,        220,        220,        1,    38016, 0xf5086111
-0,        221,        221,        1,    38016, 0x88f35468
-0,        222,        222,        1,    38016, 0x3ae94126
-0,        223,        223,        1,    38016, 0xf4473aa8
-0,        224,        224,        1,    38016, 0x430c3da2
-0,        225,        225,        1,    38016, 0xaf95113e
-0,        226,        226,        1,    38016, 0xa8a216d6
-0,        227,        227,        1,    38016, 0xad2f328c
-0,        228,        228,        1,    38016, 0xea724415
-0,        229,        229,        1,    38016, 0x34016af4
-0,        230,        230,        1,    38016, 0x4829a4cb
-0,        231,        231,        1,    38016, 0x4b24bc67
-0,        232,        232,        1,    38016, 0xb523f023
-0,        233,        233,        1,    38016, 0x5c6d2305
-0,        234,        234,        1,    38016, 0x39e63adc
-0,        235,        235,        1,    38016, 0xf7c64a7c
-0,        236,        236,        1,    38016, 0xd601680a
-0,        237,        237,        1,    38016, 0xbbad6a12
-0,        238,        238,        1,    38016, 0xddc1500f
-0,        239,        239,        1,    38016, 0x1f1726e6
-0,        240,        240,        1,    38016, 0x48aee68f
-0,        241,        241,        1,    38016, 0xc1fbd4f0
-0,        242,        242,        1,    38016, 0x4a89dc83
-0,        243,        243,        1,    38016, 0xa7cd2b02
-0,        244,        244,        1,    38016, 0xf52aa0b8
-0,        245,        245,        1,    38016, 0x1f260626
-0,        246,        246,        1,    38016, 0x80561eac
-0,        247,        247,        1,    38016, 0x6687f8ef
-0,        248,        248,        1,    38016, 0x986ab08f
-0,        249,        249,        1,    38016, 0xb4923773
-0,        250,        250,        1,    38016, 0x5cc2d603
-0,        251,        251,        1,    38016, 0x9e8d93db
-0,        252,        252,        1,    38016, 0x33fd8981
-0,        253,        253,        1,    38016, 0xaf45e630
-0,        254,        254,        1,    38016, 0x1227448e
-0,        255,        255,        1,    38016, 0x424cccf0
-0,        256,        256,        1,    38016, 0x03b0cb3e
-0,        257,        257,        1,    38016, 0x7aad547d
-0,        258,        258,        1,    38016, 0xbf8544b2
-0,        259,        259,        1,    38016, 0x54a843ca
-0,        260,        260,        1,    38016, 0x759d4dd0
-0,        261,        261,        1,    38016, 0x000162da
-0,        262,        262,        1,    38016, 0x87ec74b0
-0,        263,        263,        1,    38016, 0xefee8259
-0,        264,        264,        1,    38016, 0x7b547eea
-0,        265,        265,        1,    38016, 0xcae96b73
-0,        266,        266,        1,    38016, 0x730f59c3
-0,        267,        267,        1,    38016, 0x7d9b3e82
-0,        268,        268,        1,    38016, 0x3bb11ef0
-0,        269,        269,        1,    38016, 0x7581fa6b
-0,        270,        270,        1,    38016, 0xe594a982
-0,        271,        271,        1,    38016, 0xde3888d6
-0,        272,        272,        1,    38016, 0x0e096d6b
-0,        273,        273,        1,    38016, 0x297c20dc
-0,        274,        274,        1,    38016, 0x51f7ce7f
-0,        275,        275,        1,    38016, 0x23d2c247
-0,        276,        276,        1,    38016, 0x0bdcd0d0
-0,        277,        277,        1,    38016, 0x63cfd4f3
-0,        278,        278,        1,    38016, 0x6d4b01f8
-0,        279,        279,        1,    38016, 0xa50d72f0
-0,        280,        280,        1,    38016, 0xccad0d72
-0,        281,        281,        1,    38016, 0x10c9e33e
-0,        282,        282,        1,    38016, 0xba6daf97
-0,        283,        283,        1,    38016, 0xd65074e0
-0,        284,        284,        1,    38016, 0xd36954aa
-0,        285,        285,        1,    38016, 0xd9a2a642
-0,        286,        286,        1,    38016, 0xce755f9f
-0,        287,        287,        1,    38016, 0x81d29c44
-0,        288,        288,        1,    38016, 0x23b0aef5
-0,        289,        289,        1,    38016, 0xb0ef9efa
-0,        290,        290,        1,    38016, 0xf20d4a7a
-0,        291,        291,        1,    38016, 0xa0c86899
-0,        292,        292,        1,    38016, 0x1ae4f865
-0,        293,        293,        1,    38016, 0x3a5731c8
-0,        294,        294,        1,    38016, 0x75f17ec5
-0,        295,        295,        1,    38016, 0x8f447aa9
-0,        296,        296,        1,    38016, 0x71615441
-0,        297,        297,        1,    38016, 0x90c13e26
-0,        298,        298,        1,    38016, 0x08d04aaf
-0,        299,        299,        1,    38016, 0x14fd7b04
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_fld0_full b/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_fld0_full
deleted file mode 100644
index b131cda..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_fld0_full
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xbf168f4e
-0,          1,          1,        1,   518400, 0xeda5e54f
-0,          2,          2,        1,   518400, 0xef496d43
-0,          3,          3,        1,   518400, 0x6b68dad5
-0,          4,          4,        1,   518400, 0x9a40a7de
-0,          5,          5,        1,   518400, 0x0c21c018
-0,          6,          6,        1,   518400, 0x4ac5a846
-0,          7,          7,        1,   518400, 0x3a1aa817
-0,          8,          8,        1,   518400, 0xcc4eb434
-0,          9,          9,        1,   518400, 0x4368a3c2
-0,         10,         10,        1,   518400, 0xb923682f
-0,         11,         11,        1,   518400, 0xd95460a8
-0,         12,         12,        1,   518400, 0x8e8518aa
-0,         13,         13,        1,   518400, 0x292a1a80
-0,         14,         14,        1,   518400, 0xbada388e
-0,         15,         15,        1,   518400, 0xa67f63c9
-0,         16,         16,        1,   518400, 0x9fc77e21
-0,         17,         17,        1,   518400, 0xe99dc2ac
-0,         18,         18,        1,   518400, 0x17d7d080
-0,         19,         19,        1,   518400, 0x41760c0b
-0,         20,         20,        1,   518400, 0x3c70f34d
-0,         21,         21,        1,   518400, 0x0d640285
-0,         22,         22,        1,   518400, 0x448893e8
-0,         23,         23,        1,   518400, 0x08194490
-0,         24,         24,        1,   518400, 0xcf227031
-0,         25,         25,        1,   518400, 0x8d94587d
-0,         26,         26,        1,   518400, 0x696fca01
-0,         27,         27,        1,   518400, 0xe0ab234b
-0,         28,         28,        1,   518400, 0x0620153b
-0,         29,         29,        1,   518400, 0xb78c146c
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_frm0_full b/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_frm0_full
deleted file mode 100644
index 58949e2..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_frm0_full
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x40c7e2d9
-0,          1,          1,        1,   518400, 0xb16701a5
-0,          2,          2,        1,   518400, 0x12c2f5b1
-0,          3,          3,        1,   518400, 0x9832aecc
-0,          4,          4,        1,   518400, 0x2b8bcdec
-0,          5,          5,        1,   518400, 0x04448f3a
-0,          6,          6,        1,   518400, 0xc7ac82d8
-0,          7,          7,        1,   518400, 0xe746bb8a
-0,          8,          8,        1,   518400, 0xc7ac92d3
-0,          9,          9,        1,   518400, 0x38d89443
-0,         10,         10,        1,   518400, 0xcb9fbe74
-0,         11,         11,        1,   518400, 0x5543867d
-0,         12,         12,        1,   518400, 0xaf1b147f
-0,         13,         13,        1,   518400, 0xe5f07e40
-0,         14,         14,        1,   518400, 0x66dc6734
-0,         15,         15,        1,   518400, 0x0f9491be
-0,         16,         16,        1,   518400, 0xbcdaacac
-0,         17,         17,        1,   518400, 0xf4480ae7
-0,         18,         18,        1,   518400, 0xa5cef4d5
-0,         19,         19,        1,   518400, 0x9e4e4320
-0,         20,         20,        1,   518400, 0x620c3212
-0,         21,         21,        1,   518400, 0x4350df1d
-0,         22,         22,        1,   518400, 0x6360ef84
-0,         23,         23,        1,   518400, 0xc1866d03
-0,         24,         24,        1,   518400, 0x38eb3b5b
-0,         25,         25,        1,   518400, 0x00166df1
-0,         26,         26,        1,   518400, 0x841ea87c
-0,         27,         27,        1,   518400, 0x8b40f836
-0,         28,         28,        1,   518400, 0x3b380ddf
-0,         29,         29,        1,   518400, 0x275adf46
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_mbaff0_full b/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_mbaff0_full
deleted file mode 100644
index 1e9313e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_mbaff0_full
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x8336b7db
-0,          1,          1,        1,   518400, 0x9818c309
-0,          2,          2,        1,   518400, 0x5417b6f9
-0,          3,          3,        1,   518400, 0x8f0a5de4
-0,          4,          4,        1,   518400, 0xa4ce43f3
-0,          5,          5,        1,   518400, 0xfe748339
-0,          6,          6,        1,   518400, 0xeab93a93
-0,          7,          7,        1,   518400, 0x095176e4
-0,          8,          8,        1,   518400, 0x99a45050
-0,          9,          9,        1,   518400, 0xad3766e8
-0,         10,         10,        1,   518400, 0xea133c1b
-0,         11,         11,        1,   518400, 0xdcb2188b
-0,         12,         12,        1,   518400, 0xec08c8ce
-0,         13,         13,        1,   518400, 0xf38cd4f2
-0,         14,         14,        1,   518400, 0x06177f80
-0,         15,         15,        1,   518400, 0x2c68b642
-0,         16,         16,        1,   518400, 0x7d290881
-0,         17,         17,        1,   518400, 0x26c939d8
-0,         18,         18,        1,   518400, 0xa0391a6e
-0,         19,         19,        1,   518400, 0x3b9f02c1
-0,         20,         20,        1,   518400, 0x335a0ff9
-0,         21,         21,        1,   518400, 0x0deafb41
-0,         22,         22,        1,   518400, 0xbf00bfe4
-0,         23,         23,        1,   518400, 0xc9145210
-0,         24,         24,        1,   518400, 0xb6e16a54
-0,         25,         25,        1,   518400, 0xc31664da
-0,         26,         26,        1,   518400, 0xfd3be55d
-0,         27,         27,        1,   518400, 0xf33b134c
-0,         28,         28,        1,   518400, 0xc6977304
-0,         29,         29,        1,   518400, 0xa605bdb6
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_picaff0_full b/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_picaff0_full
deleted file mode 100644
index 484025e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cabac_mot_picaff0_full
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xd8b58a23
-0,          1,          1,        1,   518400, 0xe53b4aba
-0,          2,          2,        1,   518400, 0x6cbca47a
-0,          3,          3,        1,   518400, 0xceb51253
-0,          4,          4,        1,   518400, 0x60cb3cdd
-0,          5,          5,        1,   518400, 0x7b633553
-0,          6,          6,        1,   518400, 0x10c012c9
-0,          7,          7,        1,   518400, 0xa340ee20
-0,          8,          8,        1,   518400, 0x574c22c2
-0,          9,          9,        1,   518400, 0xbcdb1bf7
-0,         10,         10,        1,   518400, 0x57811e9a
-0,         11,         11,        1,   518400, 0xdd4af748
-0,         12,         12,        1,   518400, 0xb931a637
-0,         13,         13,        1,   518400, 0xcef6ce95
-0,         14,         14,        1,   518400, 0xd28c7085
-0,         15,         15,        1,   518400, 0xae9daf53
-0,         16,         16,        1,   518400, 0xca29d819
-0,         17,         17,        1,   518400, 0x3c4bd7eb
-0,         18,         18,        1,   518400, 0x912ee227
-0,         19,         19,        1,   518400, 0xb67d0e27
-0,         20,         20,        1,   518400, 0x8cf7309d
-0,         21,         21,        1,   518400, 0x358ad344
-0,         22,         22,        1,   518400, 0x4462c642
-0,         23,         23,        1,   518400, 0x3bb43428
-0,         24,         24,        1,   518400, 0x12d6f8ca
-0,         25,         25,        1,   518400, 0x003f13aa
-0,         26,         26,        1,   518400, 0x6cd8c432
-0,         27,         27,        1,   518400, 0xee5ff01b
-0,         28,         28,        1,   518400, 0xba0616ee
-0,         29,         29,        1,   518400, 0x37fa7891
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cabaci3_sony_b b/deps/libav/tests/ref/fate/h264-conformance-cabaci3_sony_b
deleted file mode 100644
index 9dc4884..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cabaci3_sony_b
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x705f2f41
-0,          1,          1,        1,    38016, 0xa76d1766
-0,          2,          2,        1,    38016, 0xf367e6f4
-0,          3,          3,        1,    38016, 0xdce8a69a
-0,          4,          4,        1,    38016, 0xda9d986e
-0,          5,          5,        1,    38016, 0x50117ea5
-0,          6,          6,        1,    38016, 0x07a848eb
-0,          7,          7,        1,    38016, 0x28ab4f59
-0,          8,          8,        1,    38016, 0xf6913e4c
-0,          9,          9,        1,    38016, 0x3daa3500
-0,         10,         10,        1,    38016, 0xe9f67703
-0,         11,         11,        1,    38016, 0x9a5289e6
-0,         12,         12,        1,    38016, 0x9efd705f
-0,         13,         13,        1,    38016, 0x1193b01d
-0,         14,         14,        1,    38016, 0x30a5acd7
-0,         15,         15,        1,    38016, 0x7e3da07d
-0,         16,         16,        1,    38016, 0x0f85afc6
-0,         17,         17,        1,    38016, 0x8b7ba455
-0,         18,         18,        1,    38016, 0xac327dfb
-0,         19,         19,        1,    38016, 0x3eee7fdb
-0,         20,         20,        1,    38016, 0x37fa626b
-0,         21,         21,        1,    38016, 0x2c4f2501
-0,         22,         22,        1,    38016, 0xa25a239a
-0,         23,         23,        1,    38016, 0xe69b2327
-0,         24,         24,        1,    38016, 0x6bd6164e
-0,         25,         25,        1,    38016, 0xae9c2daa
-0,         26,         26,        1,    38016, 0xe115331d
-0,         27,         27,        1,    38016, 0xde8f2833
-0,         28,         28,        1,    38016, 0xd0b45915
-0,         29,         29,        1,    38016, 0x3ab16824
-0,         30,         30,        1,    38016, 0x4df45e8d
-0,         31,         31,        1,    38016, 0x48569b82
-0,         32,         32,        1,    38016, 0x75c5b1ee
-0,         33,         33,        1,    38016, 0x64e5a3ba
-0,         34,         34,        1,    38016, 0x3190d133
-0,         35,         35,        1,    38016, 0x4825ce86
-0,         36,         36,        1,    38016, 0x8f85ab8e
-0,         37,         37,        1,    38016, 0x3fb1cbc5
-0,         38,         38,        1,    38016, 0x2b2cbe7d
-0,         39,         39,        1,    38016, 0xa905a6a6
-0,         40,         40,        1,    38016, 0x6365c188
-0,         41,         41,        1,    38016, 0xff23c08d
-0,         42,         42,        1,    38016, 0x73edada6
-0,         43,         43,        1,    38016, 0x6be0b8a9
-0,         44,         44,        1,    38016, 0x604bb6c9
-0,         45,         45,        1,    38016, 0x62468a3b
-0,         46,         46,        1,    38016, 0x994aad7a
-0,         47,         47,        1,    38016, 0xfee1b59e
-0,         48,         48,        1,    38016, 0xf722aa78
-0,         49,         49,        1,    38016, 0x0ddfbf68
-0,         50,         50,        1,    38016, 0x510ab7b1
-0,         51,         51,        1,    38016, 0x156ca919
-0,         52,         52,        1,    38016, 0xb176b488
-0,         53,         53,        1,    38016, 0xd70cb8f8
-0,         54,         54,        1,    38016, 0x3844b2d2
-0,         55,         55,        1,    38016, 0x0ed8c6ee
-0,         56,         56,        1,    38016, 0x0c6ac5ff
-0,         57,         57,        1,    38016, 0x1284c442
-0,         58,         58,        1,    38016, 0x0486d06c
-0,         59,         59,        1,    38016, 0x0d42d1c1
-0,         60,         60,        1,    38016, 0xd24297f3
-0,         61,         61,        1,    38016, 0xe05cab59
-0,         62,         62,        1,    38016, 0x12f1921f
-0,         63,         63,        1,    38016, 0x0dc6403e
-0,         64,         64,        1,    38016, 0x277f593c
-0,         65,         65,        1,    38016, 0xfb7c81f8
-0,         66,         66,        1,    38016, 0xb31b90b0
-0,         67,         67,        1,    38016, 0x8be3e8ae
-0,         68,         68,        1,    38016, 0x9aaa1ff1
-0,         69,         69,        1,    38016, 0x4e6832b9
-0,         70,         70,        1,    38016, 0x93fd6a5e
-0,         71,         71,        1,    38016, 0xd9438f08
-0,         72,         72,        1,    38016, 0x5e41b067
-0,         73,         73,        1,    38016, 0xee80f32a
-0,         74,         74,        1,    38016, 0x75632fe3
-0,         75,         75,        1,    38016, 0xc0a93ec1
-0,         76,         76,        1,    38016, 0x4e3e80c4
-0,         77,         77,        1,    38016, 0x9e5398d6
-0,         78,         78,        1,    38016, 0xd20aac32
-0,         79,         79,        1,    38016, 0xacf5c5da
-0,         80,         80,        1,    38016, 0xbe6bca1a
-0,         81,         81,        1,    38016, 0x098bdac2
-0,         82,         82,        1,    38016, 0xe706e491
-0,         83,         83,        1,    38016, 0xcda7d8ee
-0,         84,         84,        1,    38016, 0xb1d4d3f4
-0,         85,         85,        1,    38016, 0x3e20d6cd
-0,         86,         86,        1,    38016, 0xf368e66a
-0,         87,         87,        1,    38016, 0xbfbee5b1
-0,         88,         88,        1,    38016, 0xb580ec3d
-0,         89,         89,        1,    38016, 0xce8dec65
-0,         90,         90,        1,    38016, 0xb6fda1c2
-0,         91,         91,        1,    38016, 0xb2d5ad04
-0,         92,         92,        1,    38016, 0x28959c5a
-0,         93,         93,        1,    38016, 0x7b1d7c65
-0,         94,         94,        1,    38016, 0x357e79cd
-0,         95,         95,        1,    38016, 0x08f57396
-0,         96,         96,        1,    38016, 0xe59973b8
-0,         97,         97,        1,    38016, 0x288a9c28
-0,         98,         98,        1,    38016, 0x09a4a82f
-0,         99,         99,        1,    38016, 0x61b5a518
-0,        100,        100,        1,    38016, 0xddbfb88d
-0,        101,        101,        1,    38016, 0x14b5a41e
-0,        102,        102,        1,    38016, 0x56588add
-0,        103,        103,        1,    38016, 0x7e3890c1
-0,        104,        104,        1,    38016, 0xbb1eb4df
-0,        105,        105,        1,    38016, 0x3b34a7d8
-0,        106,        106,        1,    38016, 0xe15ddc56
-0,        107,        107,        1,    38016, 0x9ed7ff21
-0,        108,        108,        1,    38016, 0x03200458
-0,        109,        109,        1,    38016, 0x74493572
-0,        110,        110,        1,    38016, 0x73d14274
-0,        111,        111,        1,    38016, 0x02933587
-0,        112,        112,        1,    38016, 0x5ea74e05
-0,        113,        113,        1,    38016, 0xd73d303e
-0,        114,        114,        1,    38016, 0x0a17f1ea
-0,        115,        115,        1,    38016, 0x915f0dcd
-0,        116,        116,        1,    38016, 0xca041a88
-0,        117,        117,        1,    38016, 0xc6a303b2
-0,        118,        118,        1,    38016, 0x2c903df2
-0,        119,        119,        1,    38016, 0x2dd04691
-0,        120,        120,        1,    38016, 0xfe783551
-0,        121,        121,        1,    38016, 0x900c419c
-0,        122,        122,        1,    38016, 0x01b92a15
-0,        123,        123,        1,    38016, 0xcce4e851
-0,        124,        124,        1,    38016, 0x0167d6f6
-0,        125,        125,        1,    38016, 0x023eb3fa
-0,        126,        126,        1,    38016, 0xafc29caa
-0,        127,        127,        1,    38016, 0xf205b88c
-0,        128,        128,        1,    38016, 0x5518cc46
-0,        129,        129,        1,    38016, 0x64cdd1d5
-0,        130,        130,        1,    38016, 0x8e9eecb4
-0,        131,        131,        1,    38016, 0xd1e0e2f8
-0,        132,        132,        1,    38016, 0xb849cf3c
-0,        133,        133,        1,    38016, 0xb5e4d916
-0,        134,        134,        1,    38016, 0xc6c5da7e
-0,        135,        135,        1,    38016, 0xcbcda68d
-0,        136,        136,        1,    38016, 0x21d7bd73
-0,        137,        137,        1,    38016, 0x6737b4b9
-0,        138,        138,        1,    38016, 0x379f9a5f
-0,        139,        139,        1,    38016, 0xa13da6cc
-0,        140,        140,        1,    38016, 0x06fc941a
-0,        141,        141,        1,    38016, 0x78c57e95
-0,        142,        142,        1,    38016, 0x2f6674d4
-0,        143,        143,        1,    38016, 0x37776db9
-0,        144,        144,        1,    38016, 0x257268db
-0,        145,        145,        1,    38016, 0x1dbe7e72
-0,        146,        146,        1,    38016, 0x2cb96bb0
-0,        147,        147,        1,    38016, 0x46a840f2
-0,        148,        148,        1,    38016, 0x95951fd6
-0,        149,        149,        1,    38016, 0x627ef7b2
-0,        150,        150,        1,    38016, 0xa5b0b2d3
-0,        151,        151,        1,    38016, 0x69fdcae9
-0,        152,        152,        1,    38016, 0x0c25c873
-0,        153,        153,        1,    38016, 0x3533a2cc
-0,        154,        154,        1,    38016, 0x3a74b6c2
-0,        155,        155,        1,    38016, 0x9d1dcbc1
-0,        156,        156,        1,    38016, 0xce33cf86
-0,        157,        157,        1,    38016, 0xf34201f5
-0,        158,        158,        1,    38016, 0xab5f2e2b
-0,        159,        159,        1,    38016, 0xf062405d
-0,        160,        160,        1,    38016, 0xe7f85f7c
-0,        161,        161,        1,    38016, 0x684f4ee4
-0,        162,        162,        1,    38016, 0x41b83014
-0,        163,        163,        1,    38016, 0x70142f5f
-0,        164,        164,        1,    38016, 0x3cb229b1
-0,        165,        165,        1,    38016, 0x6bd1f24c
-0,        166,        166,        1,    38016, 0x9366ec77
-0,        167,        167,        1,    38016, 0x6af0c1ec
-0,        168,        168,        1,    38016, 0xb11a9005
-0,        169,        169,        1,    38016, 0x83e390b7
-0,        170,        170,        1,    38016, 0x97679ab5
-0,        171,        171,        1,    38016, 0xabe3b114
-0,        172,        172,        1,    38016, 0x2efed19f
-0,        173,        173,        1,    38016, 0x18eddb2e
-0,        174,        174,        1,    38016, 0x0a37c6fb
-0,        175,        175,        1,    38016, 0xddb0a2fe
-0,        176,        176,        1,    38016, 0xf8627091
-0,        177,        177,        1,    38016, 0x97123074
-0,        178,        178,        1,    38016, 0x33af3174
-0,        179,        179,        1,    38016, 0x5caa22fe
-0,        180,        180,        1,    38016, 0xa203eccf
-0,        181,        181,        1,    38016, 0x506eee0c
-0,        182,        182,        1,    38016, 0x2066d541
-0,        183,        183,        1,    38016, 0xe08acab1
-0,        184,        184,        1,    38016, 0x6740ecc4
-0,        185,        185,        1,    38016, 0x954dfd6d
-0,        186,        186,        1,    38016, 0xbd7ffef8
-0,        187,        187,        1,    38016, 0x629f2cca
-0,        188,        188,        1,    38016, 0xebd92f12
-0,        189,        189,        1,    38016, 0xe5bd297f
-0,        190,        190,        1,    38016, 0xcb2be670
-0,        191,        191,        1,    38016, 0x51d7b529
-0,        192,        192,        1,    38016, 0x95d7ab30
-0,        193,        193,        1,    38016, 0x18e3df99
-0,        194,        194,        1,    38016, 0xae3af726
-0,        195,        195,        1,    38016, 0x9b831ee3
-0,        196,        196,        1,    38016, 0x3c614e45
-0,        197,        197,        1,    38016, 0x3c0a600c
-0,        198,        198,        1,    38016, 0xdade838b
-0,        199,        199,        1,    38016, 0xbbe3a0a7
-0,        200,        200,        1,    38016, 0xd4d5b780
-0,        201,        201,        1,    38016, 0xceebb4b7
-0,        202,        202,        1,    38016, 0x1a8ccbb3
-0,        203,        203,        1,    38016, 0x95dccfab
-0,        204,        204,        1,    38016, 0xea9bc737
-0,        205,        205,        1,    38016, 0xa0f6d561
-0,        206,        206,        1,    38016, 0x7877d698
-0,        207,        207,        1,    38016, 0xd6aad54c
-0,        208,        208,        1,    38016, 0xca62c8b7
-0,        209,        209,        1,    38016, 0xebc9ae1c
-0,        210,        210,        1,    38016, 0x46c96194
-0,        211,        211,        1,    38016, 0x61197fc4
-0,        212,        212,        1,    38016, 0x9ae97570
-0,        213,        213,        1,    38016, 0x7cd254da
-0,        214,        214,        1,    38016, 0xe4816953
-0,        215,        215,        1,    38016, 0x68685b2c
-0,        216,        216,        1,    38016, 0x08d93f79
-0,        217,        217,        1,    38016, 0xb4cc526b
-0,        218,        218,        1,    38016, 0xc0d253d9
-0,        219,        219,        1,    38016, 0x95b83d64
-0,        220,        220,        1,    38016, 0xadf7454f
-0,        221,        221,        1,    38016, 0xaa1d339b
-0,        222,        222,        1,    38016, 0xae0417f8
-0,        223,        223,        1,    38016, 0x09d2294d
-0,        224,        224,        1,    38016, 0xbd892e9d
-0,        225,        225,        1,    38016, 0xbccd0f97
-0,        226,        226,        1,    38016, 0x03c13bd3
-0,        227,        227,        1,    38016, 0x09d045d7
-0,        228,        228,        1,    38016, 0xaa484278
-0,        229,        229,        1,    38016, 0x054b8639
-0,        230,        230,        1,    38016, 0x45e29e62
-0,        231,        231,        1,    38016, 0x38bbb067
-0,        232,        232,        1,    38016, 0x9f5cfc30
-0,        233,        233,        1,    38016, 0x38551b76
-0,        234,        234,        1,    38016, 0x3e1b18ee
-0,        235,        235,        1,    38016, 0x7baf4e34
-0,        236,        236,        1,    38016, 0xff6458d1
-0,        237,        237,        1,    38016, 0xb7963c49
-0,        238,        238,        1,    38016, 0xdaee3f6a
-0,        239,        239,        1,    38016, 0xc88e09c9
-0,        240,        240,        1,    38016, 0x88a7de38
-0,        241,        241,        1,    38016, 0x9e81cb62
-0,        242,        242,        1,    38016, 0x84d0aca7
-0,        243,        243,        1,    38016, 0x3312f41e
-0,        244,        244,        1,    38016, 0x550065dc
-0,        245,        245,        1,    38016, 0x7e88d07e
-0,        246,        246,        1,    38016, 0x9370ed4f
-0,        247,        247,        1,    38016, 0xd9c9d592
-0,        248,        248,        1,    38016, 0xec7589ce
-0,        249,        249,        1,    38016, 0xeca71251
-0,        250,        250,        1,    38016, 0xf183b951
-0,        251,        251,        1,    38016, 0x9a1b740a
-0,        252,        252,        1,    38016, 0x97ea5ffc
-0,        253,        253,        1,    38016, 0x058dc572
-0,        254,        254,        1,    38016, 0xae44345a
-0,        255,        255,        1,    38016, 0xef22c82e
-0,        256,        256,        1,    38016, 0x8364d583
-0,        257,        257,        1,    38016, 0x2f725dfa
-0,        258,        258,        1,    38016, 0x5eda3160
-0,        259,        259,        1,    38016, 0x4a464613
-0,        260,        260,        1,    38016, 0x447f444d
-0,        261,        261,        1,    38016, 0x076b3dd8
-0,        262,        262,        1,    38016, 0x690f58de
-0,        263,        263,        1,    38016, 0xf4635e91
-0,        264,        264,        1,    38016, 0xd5db44e7
-0,        265,        265,        1,    38016, 0xced25176
-0,        266,        266,        1,    38016, 0x227a2f9a
-0,        267,        267,        1,    38016, 0x72100520
-0,        268,        268,        1,    38016, 0x6549f9b4
-0,        269,        269,        1,    38016, 0x3f77cef4
-0,        270,        270,        1,    38016, 0x3d1ba72f
-0,        271,        271,        1,    38016, 0xa1dd85d2
-0,        272,        272,        1,    38016, 0x9a35655e
-0,        273,        273,        1,    38016, 0xdc900dc6
-0,        274,        274,        1,    38016, 0xca05d5cb
-0,        275,        275,        1,    38016, 0xeff0be86
-0,        276,        276,        1,    38016, 0xdcceb22e
-0,        277,        277,        1,    38016, 0x5952d133
-0,        278,        278,        1,    38016, 0x3ab3facb
-0,        279,        279,        1,    38016, 0xdb8d4de4
-0,        280,        280,        1,    38016, 0x0afc170d
-0,        281,        281,        1,    38016, 0xd14ddc59
-0,        282,        282,        1,    38016, 0xbabf89eb
-0,        283,        283,        1,    38016, 0x09d38f7b
-0,        284,        284,        1,    38016, 0xe4805dba
-0,        285,        285,        1,    38016, 0x4d919dcf
-0,        286,        286,        1,    38016, 0x3e8c60be
-0,        287,        287,        1,    38016, 0x6c1fa94b
-0,        288,        288,        1,    38016, 0x6b68a320
-0,        289,        289,        1,    38016, 0x9de774f6
-0,        290,        290,        1,    38016, 0x38d0ecc6
-0,        291,        291,        1,    38016, 0x0623207f
-0,        292,        292,        1,    38016, 0x36429915
-0,        293,        293,        1,    38016, 0x659fdd42
-0,        294,        294,        1,    38016, 0x59c93475
-0,        295,        295,        1,    38016, 0xecd1200d
-0,        296,        296,        1,    38016, 0x3b2af9c2
-0,        297,        297,        1,    38016, 0xd00600da
-0,        298,        298,        1,    38016, 0xb0bc21ee
-0,        299,        299,        1,    38016, 0xc11f3ec2
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cabast3_sony_e b/deps/libav/tests/ref/fate/h264-conformance-cabast3_sony_e
deleted file mode 100644
index 00519ef..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cabast3_sony_e
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x96ebb3a2
-0,          1,          1,        1,   152064, 0x5184d912
-0,          2,          2,        1,   152064, 0xfa0c9abe
-0,          3,          3,        1,   152064, 0x6dd81860
-0,          4,          4,        1,   152064, 0xc5202966
-0,          5,          5,        1,   152064, 0xa7dfdf71
-0,          6,          6,        1,   152064, 0xffa5609f
-0,          7,          7,        1,   152064, 0x352e7ce5
-0,          8,          8,        1,   152064, 0xc9e52c2a
-0,          9,          9,        1,   152064, 0x12dfd28d
-0,         10,         10,        1,   152064, 0x962af5fe
-0,         11,         11,        1,   152064, 0xa8459cb1
-0,         12,         12,        1,   152064, 0xc0771945
-0,         13,         13,        1,   152064, 0xfcbc351d
-0,         14,         14,        1,   152064, 0xd925dfa3
-0,         15,         15,        1,   152064, 0x7c627c21
-0,         16,         16,        1,   152064, 0x617d8d96
-0,         17,         17,        1,   152064, 0x91816b34
-0,         18,         18,        1,   152064, 0xece0eaf8
-0,         19,         19,        1,   152064, 0x7b1408ef
-0,         20,         20,        1,   152064, 0x7430c4d2
-0,         21,         21,        1,   152064, 0xdb5844fa
-0,         22,         22,        1,   152064, 0xcc874ff7
-0,         23,         23,        1,   152064, 0x97630fb8
-0,         24,         24,        1,   152064, 0x16ae9c92
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cabastbr3_sony_b b/deps/libav/tests/ref/fate/h264-conformance-cabastbr3_sony_b
deleted file mode 100644
index 765f53f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cabastbr3_sony_b
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x96ebb3a2
-0,          1,          1,        1,   152064, 0x5184d912
-0,          2,          2,        1,   152064, 0xb7b5ba68
-0,          3,          3,        1,   152064, 0x6dd81860
-0,          4,          4,        1,   152064, 0xcffe2ff0
-0,          5,          5,        1,   152064, 0x27740140
-0,          6,          6,        1,   152064, 0xffa5609f
-0,          7,          7,        1,   152064, 0x05e9a6c6
-0,          8,          8,        1,   152064, 0xa5ea5692
-0,          9,          9,        1,   152064, 0x78a9dd79
-0,         10,         10,        1,   152064, 0x2bf218b3
-0,         11,         11,        1,   152064, 0x4591cadc
-0,         12,         12,        1,   152064, 0x075428a8
-0,         13,         13,        1,   152064, 0xbbda56d8
-0,         14,         14,        1,   152064, 0xc8fa1a28
-0,         15,         15,        1,   152064, 0x7c627c21
-0,         16,         16,        1,   152064, 0x9043ba42
-0,         17,         17,        1,   152064, 0xb426940d
-0,         18,         18,        1,   152064, 0x51d4058b
-0,         19,         19,        1,   152064, 0xb7513536
-0,         20,         20,        1,   152064, 0xe906ffab
-0,         21,         21,        1,   152064, 0x3d075443
-0,         22,         22,        1,   152064, 0x85c37afd
-0,         23,         23,        1,   152064, 0x2ac74040
-0,         24,         24,        1,   152064, 0x3a08aa90
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cabref3_sand_d b/deps/libav/tests/ref/fate/h264-conformance-cabref3_sand_d
deleted file mode 100644
index 9e555f6..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cabref3_sand_d
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x2061bbd0
-0,          1,          1,        1,   152064, 0x41adb750
-0,          2,          2,        1,   152064, 0x6e889e90
-0,          3,          3,        1,   152064, 0xbb5e60f5
-0,          4,          4,        1,   152064, 0x5a32eca7
-0,          5,          5,        1,   152064, 0x5cb05e88
-0,          6,          6,        1,   152064, 0x2fff3e6c
-0,          7,          7,        1,   152064, 0xd917c85e
-0,          8,          8,        1,   152064, 0x6eac446f
-0,          9,          9,        1,   152064, 0x238b24b0
-0,         10,         10,        1,   152064, 0x3f3bd44c
-0,         11,         11,        1,   152064, 0x73982bc5
-0,         12,         12,        1,   152064, 0xf6188a82
-0,         13,         13,        1,   152064, 0x818c5b41
-0,         14,         14,        1,   152064, 0x000d1012
-0,         15,         15,        1,   152064, 0xc4a8750e
-0,         16,         16,        1,   152064, 0x1689bb77
-0,         17,         17,        1,   152064, 0x8f52f338
-0,         18,         18,        1,   152064, 0xbf5ee06b
-0,         19,         19,        1,   152064, 0x89508ad7
-0,         20,         20,        1,   152064, 0x2b1986a6
-0,         21,         21,        1,   152064, 0xe6fd6b0e
-0,         22,         22,        1,   152064, 0x883e2e4e
-0,         23,         23,        1,   152064, 0xd133db07
-0,         24,         24,        1,   152064, 0x39b3bb22
-0,         25,         25,        1,   152064, 0x8447410a
-0,         26,         26,        1,   152064, 0x9c66c6e5
-0,         27,         27,        1,   152064, 0x514de9cc
-0,         28,         28,        1,   152064, 0x08d9f1da
-0,         29,         29,        1,   152064, 0x8f10f536
-0,         30,         30,        1,   152064, 0x57d4b27b
-0,         31,         31,        1,   152064, 0x46f56d3c
-0,         32,         32,        1,   152064, 0x5d260230
-0,         33,         33,        1,   152064, 0x4a72aeac
-0,         34,         34,        1,   152064, 0x5cfe187f
-0,         35,         35,        1,   152064, 0x08e55cb2
-0,         36,         36,        1,   152064, 0x4727f34f
-0,         37,         37,        1,   152064, 0xd6a26f1c
-0,         38,         38,        1,   152064, 0xcc1fcf9c
-0,         39,         39,        1,   152064, 0x3681b775
-0,         40,         40,        1,   152064, 0xf580c7d9
-0,         41,         41,        1,   152064, 0xaa6747fb
-0,         42,         42,        1,   152064, 0x2e22f9f9
-0,         43,         43,        1,   152064, 0xb3ee6d81
-0,         44,         44,        1,   152064, 0x930b0145
-0,         45,         45,        1,   152064, 0xae36af99
-0,         46,         46,        1,   152064, 0xeb58fd26
-0,         47,         47,        1,   152064, 0xb9004da3
-0,         48,         48,        1,   152064, 0x2b25e444
-0,         49,         49,        1,   152064, 0xb36927de
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cacqp3_sony_d b/deps/libav/tests/ref/fate/h264-conformance-cacqp3_sony_d
deleted file mode 100644
index c368529..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cacqp3_sony_d
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x295a375c
-0,          1,          1,        1,    38016, 0xd0da1f37
-0,          2,          2,        1,    38016, 0x0e5ed514
-0,          3,          3,        1,    38016, 0x477dcbe7
-0,          4,          4,        1,    38016, 0x2e0980f3
-0,          5,          5,        1,    38016, 0xf6d0888f
-0,          6,          6,        1,    38016, 0x884f4bf2
-0,          7,          7,        1,    38016, 0x75135ea9
-0,          8,          8,        1,    38016, 0xc85031bd
-0,          9,          9,        1,    38016, 0x4dde6353
-0,         10,         10,        1,    38016, 0x8c8f4f2a
-0,         11,         11,        1,    38016, 0xbdae892b
-0,         12,         12,        1,    38016, 0x4898783a
-0,         13,         13,        1,    38016, 0xb4cc9d6b
-0,         14,         14,        1,    38016, 0xd24f8797
-0,         15,         15,        1,    38016, 0x74c4a0df
-0,         16,         16,        1,    38016, 0x43e58a83
-0,         17,         17,        1,    38016, 0x05bba901
-0,         18,         18,        1,    38016, 0xe2d57f63
-0,         19,         19,        1,    38016, 0xdb398611
-0,         20,         20,        1,    38016, 0x7f143de2
-0,         21,         21,        1,    38016, 0xff39406f
-0,         22,         22,        1,    38016, 0xfed61162
-0,         23,         23,        1,    38016, 0xb9e62a1e
-0,         24,         24,        1,    38016, 0x65f316d1
-0,         25,         25,        1,    38016, 0xda782b9c
-0,         26,         26,        1,    38016, 0xb64b202c
-0,         27,         27,        1,    38016, 0xb2b141ea
-0,         28,         28,        1,    38016, 0xdb6b421b
-0,         29,         29,        1,    38016, 0xf3287342
-0,         30,         30,        1,    38016, 0xfbb35b92
-0,         31,         31,        1,    38016, 0x8c77a0de
-0,         32,         32,        1,    38016, 0x326c9cb4
-0,         33,         33,        1,    38016, 0x7e73cc0c
-0,         34,         34,        1,    38016, 0xb948b8e9
-0,         35,         35,        1,    38016, 0x6f7adb29
-0,         36,         36,        1,    38016, 0xb629b8c5
-0,         37,         37,        1,    38016, 0xf798ccd4
-0,         38,         38,        1,    38016, 0xde5bb331
-0,         39,         39,        1,    38016, 0xbca4d8dc
-0,         40,         40,        1,    38016, 0x9369ba10
-0,         41,         41,        1,    38016, 0x581ed965
-0,         42,         42,        1,    38016, 0xce7bbd59
-0,         43,         43,        1,    38016, 0x95d9ce3d
-0,         44,         44,        1,    38016, 0x6154bd98
-0,         45,         45,        1,    38016, 0xa279c487
-0,         46,         46,        1,    38016, 0x8169b5a6
-0,         47,         47,        1,    38016, 0x709dc334
-0,         48,         48,        1,    38016, 0x82aabea1
-0,         49,         49,        1,    38016, 0x6923c4c3
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cafi1_sva_c b/deps/libav/tests/ref/fate/h264-conformance-cafi1_sva_c
deleted file mode 100644
index 180adf1..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cafi1_sva_c
+++ /dev/null
@@ -1,34 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x47bd73fa
-0,          1,          1,        1,   518400, 0xfe3ea7cc
-0,          2,          2,        1,   518400, 0x9bc549ae
-0,          3,          3,        1,   518400, 0x7bb7f0a1
-0,          4,          4,        1,   518400, 0x328903d4
-0,          5,          5,        1,   518400, 0x96ab366b
-0,          6,          6,        1,   518400, 0xa923eed3
-0,          7,          7,        1,   518400, 0x162b08f6
-0,          8,          8,        1,   518400, 0xe711bd8b
-0,          9,          9,        1,   518400, 0x55e2d4ed
-0,         10,         10,        1,   518400, 0x7dd3107b
-0,         11,         11,        1,   518400, 0x0ed20bcf
-0,         12,         12,        1,   518400, 0x352f5743
-0,         13,         13,        1,   518400, 0x0a3aeb5e
-0,         14,         14,        1,   518400, 0xc458eda3
-0,         15,         15,        1,   518400, 0xe8d5fec5
-0,         16,         16,        1,   518400, 0x18fc6c37
-0,         17,         17,        1,   518400, 0x448add76
-0,         18,         18,        1,   518400, 0x8741ead7
-0,         19,         19,        1,   518400, 0x7008a751
-0,         20,         20,        1,   518400, 0x4ca0633d
-0,         21,         21,        1,   518400, 0x021ab800
-0,         22,         22,        1,   518400, 0xfb91ba57
-0,         23,         23,        1,   518400, 0x90e71dd0
-0,         24,         24,        1,   518400, 0xac859de5
-0,         25,         25,        1,   518400, 0xce9790bd
-0,         26,         26,        1,   518400, 0x010ade8b
-0,         27,         27,        1,   518400, 0xd0b3a399
-0,         28,         28,        1,   518400, 0x6cafcff3
-0,         29,         29,        1,   518400, 0xc32284c0
-0,         30,         30,        1,   518400, 0x1af8f73e
-0,         31,         31,        1,   518400, 0x3babd71e
-0,         32,         32,        1,   518400, 0xd77cb86b
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cama1_sony_c b/deps/libav/tests/ref/fate/h264-conformance-cama1_sony_c
deleted file mode 100644
index 6685216..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cama1_sony_c
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x75701511
-0,          1,          1,        1,   518400, 0xa7eeaa16
-0,          2,          2,        1,   518400, 0xe0f32e35
-0,          3,          3,        1,   518400, 0x7a1dadd9
-0,          4,          4,        1,   518400, 0x4a1672a6
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cama1_toshiba_b b/deps/libav/tests/ref/fate/h264-conformance-cama1_toshiba_b
deleted file mode 100644
index ab2da4a..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cama1_toshiba_b
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x9a9ce366
-0,          1,          1,        1,   152064, 0xf4639828
-0,          2,          2,        1,   152064, 0x625024a3
-0,          3,          3,        1,   152064, 0x80dc2f9d
-0,          4,          4,        1,   152064, 0xb2c4feea
-0,          5,          5,        1,   152064, 0x4ec6ad64
-0,          6,          6,        1,   152064, 0x1957bec3
-0,          7,          7,        1,   152064, 0xb682799d
-0,          8,          8,        1,   152064, 0x34cd2053
-0,          9,          9,        1,   152064, 0x81490b4c
-0,         10,         10,        1,   152064, 0x242dc943
-0,         11,         11,        1,   152064, 0x3e126734
-0,         12,         12,        1,   152064, 0x8e474ff8
-0,         13,         13,        1,   152064, 0x239d2fbd
-0,         14,         14,        1,   152064, 0x0ca3e16f
-0,         15,         15,        1,   152064, 0x6161d7c2
-0,         16,         16,        1,   152064, 0xca7ad1af
-0,         17,         17,        1,   152064, 0xf8ef9026
-0,         18,         18,        1,   152064, 0x01f2f4c1
-0,         19,         19,        1,   152064, 0x510b19ec
-0,         20,         20,        1,   152064, 0xe489028b
-0,         21,         21,        1,   152064, 0x7a693c1e
-0,         22,         22,        1,   152064, 0x276b23fe
-0,         23,         23,        1,   152064, 0x0e9ced3a
-0,         24,         24,        1,   152064, 0x658228f7
-0,         25,         25,        1,   152064, 0x6a271bc3
-0,         26,         26,        1,   152064, 0x431ecd8b
-0,         27,         27,        1,   152064, 0x23a5ed14
-0,         28,         28,        1,   152064, 0x76fbe121
-0,         29,         29,        1,   152064, 0x471f919d
-0,         30,         30,        1,   152064, 0x16bfabbc
-0,         31,         31,        1,   152064, 0x0762993f
-0,         32,         32,        1,   152064, 0x5a2b0b0e
-0,         33,         33,        1,   152064, 0x81415ef7
-0,         34,         34,        1,   152064, 0xb96e4164
-0,         35,         35,        1,   152064, 0xf77aee83
-0,         36,         36,        1,   152064, 0x6af81633
-0,         37,         37,        1,   152064, 0xed78e5b5
-0,         38,         38,        1,   152064, 0x67e38e2c
-0,         39,         39,        1,   152064, 0x0417ae01
-0,         40,         40,        1,   152064, 0x3887b312
-0,         41,         41,        1,   152064, 0x3a4b70fb
-0,         42,         42,        1,   152064, 0xcaae9e7f
-0,         43,         43,        1,   152064, 0xaf9597be
-0,         44,         44,        1,   152064, 0x9bae63d3
-0,         45,         45,        1,   152064, 0x0e80825f
-0,         46,         46,        1,   152064, 0x915661fd
-0,         47,         47,        1,   152064, 0x67d3dc94
-0,         48,         48,        1,   152064, 0x3dcf240c
-0,         49,         49,        1,   152064, 0x127ff832
-0,         50,         50,        1,   152064, 0xc8969981
-0,         51,         51,        1,   152064, 0x57179c77
-0,         52,         52,        1,   152064, 0x9f88656c
-0,         53,         53,        1,   152064, 0xc28ff5d3
-0,         54,         54,        1,   152064, 0xf100fad9
-0,         55,         55,        1,   152064, 0xb570ce12
-0,         56,         56,        1,   152064, 0xe8f28955
-0,         57,         57,        1,   152064, 0x1f0a9549
-0,         58,         58,        1,   152064, 0x22b17e9b
-0,         59,         59,        1,   152064, 0x7cf1400e
-0,         60,         60,        1,   152064, 0xafd273b7
-0,         61,         61,        1,   152064, 0xeb9b712e
-0,         62,         62,        1,   152064, 0x0f81de24
-0,         63,         63,        1,   152064, 0x8f4e1953
-0,         64,         64,        1,   152064, 0x682e2170
-0,         65,         65,        1,   152064, 0xc32ad1b2
-0,         66,         66,        1,   152064, 0x53a81d79
-0,         67,         67,        1,   152064, 0x54002596
-0,         68,         68,        1,   152064, 0x4b5fdbd9
-0,         69,         69,        1,   152064, 0x96613368
-0,         70,         70,        1,   152064, 0xd6ac0171
-0,         71,         71,        1,   152064, 0xf1c1b7b7
-0,         72,         72,        1,   152064, 0xc730d82f
-0,         73,         73,        1,   152064, 0x0415d934
-0,         74,         74,        1,   152064, 0x5338915e
-0,         75,         75,        1,   152064, 0x8e9dda6d
-0,         76,         76,        1,   152064, 0xe3a8b0a0
-0,         77,         77,        1,   152064, 0x5fa36e44
-0,         78,         78,        1,   152064, 0x0e63dc72
-0,         79,         79,        1,   152064, 0xd0dad71f
-0,         80,         80,        1,   152064, 0x0c4aac94
-0,         81,         81,        1,   152064, 0x60d50e8d
-0,         82,         82,        1,   152064, 0x96872d7c
-0,         83,         83,        1,   152064, 0x4fcefc33
-0,         84,         84,        1,   152064, 0x6b8157c9
-0,         85,         85,        1,   152064, 0xa40d527d
-0,         86,         86,        1,   152064, 0x9884480a
-0,         87,         87,        1,   152064, 0xff5d9754
-0,         88,         88,        1,   152064, 0x4a26a74d
-0,         89,         89,        1,   152064, 0x81059e82
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cama1_vtc_c b/deps/libav/tests/ref/fate/h264-conformance-cama1_vtc_c
deleted file mode 100644
index eeb66b0..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cama1_vtc_c
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x41c2ce17
-0,          1,          1,        1,   518400, 0x39f217da
-0,          2,          2,        1,   518400, 0x5a108db9
-0,          3,          3,        1,   518400, 0x20cb214c
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cama2_vtc_b b/deps/libav/tests/ref/fate/h264-conformance-cama2_vtc_b
deleted file mode 100644
index 0dfe6a9..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cama2_vtc_b
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   622080, 0x004bb93f
-0,          1,          1,        1,   622080, 0xe70e193c
-0,          2,          2,        1,   622080, 0xd394cf17
-0,          3,          3,        1,   622080, 0x9e4cc924
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cama3_sand_e b/deps/libav/tests/ref/fate/h264-conformance-cama3_sand_e
deleted file mode 100644
index f89bc40..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cama3_sand_e
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf772f152
-0,          1,          1,        1,   152064, 0x7c501772
-0,          2,          2,        1,   152064, 0x98ed0a07
-0,          3,          3,        1,   152064, 0x8f9289ae
-0,          4,          4,        1,   152064, 0x4047c5e6
-0,          5,          5,        1,   152064, 0xf1f11922
-0,          6,          6,        1,   152064, 0xef8d8130
-0,          7,          7,        1,   152064, 0x6cef489d
-0,          8,          8,        1,   152064, 0x3743a97f
-0,          9,          9,        1,   152064, 0x9d6b9846
-0,         10,         10,        1,   152064, 0x332e05a7
-0,         11,         11,        1,   152064, 0x7dad10af
-0,         12,         12,        1,   152064, 0x835c99de
-0,         13,         13,        1,   152064, 0x2ba3f9bb
-0,         14,         14,        1,   152064, 0xf8ab5286
-0,         15,         15,        1,   152064, 0x76624cca
-0,         16,         16,        1,   152064, 0x8ebf6342
-0,         17,         17,        1,   152064, 0x8756f87b
-0,         18,         18,        1,   152064, 0xf005bc2f
-0,         19,         19,        1,   152064, 0x9b1ae18e
-0,         20,         20,        1,   152064, 0x3e1154aa
-0,         21,         21,        1,   152064, 0x851e28d6
-0,         22,         22,        1,   152064, 0x940a2518
-0,         23,         23,        1,   152064, 0x861be99c
-0,         24,         24,        1,   152064, 0x21a788a7
-0,         25,         25,        1,   152064, 0x53e216eb
-0,         26,         26,        1,   152064, 0x053cb9ec
-0,         27,         27,        1,   152064, 0x3bb5cfc6
-0,         28,         28,        1,   152064, 0x92b250c3
-0,         29,         29,        1,   152064, 0xacc20f1c
-0,         30,         30,        1,   152064, 0xb01256d3
-0,         31,         31,        1,   152064, 0x6db62cf2
-0,         32,         32,        1,   152064, 0x7fa3074d
-0,         33,         33,        1,   152064, 0x63385103
-0,         34,         34,        1,   152064, 0x83ba02b6
-0,         35,         35,        1,   152064, 0x3731edbb
-0,         36,         36,        1,   152064, 0xb73d5b99
-0,         37,         37,        1,   152064, 0xd2e743e2
-0,         38,         38,        1,   152064, 0x4bcd5bf2
-0,         39,         39,        1,   152064, 0x45ef7b97
-0,         40,         40,        1,   152064, 0x757952c6
-0,         41,         41,        1,   152064, 0xed73e3db
-0,         42,         42,        1,   152064, 0x8cf41b15
-0,         43,         43,        1,   152064, 0x86e2b02d
-0,         44,         44,        1,   152064, 0xf8d16c87
-0,         45,         45,        1,   152064, 0x6720db65
-0,         46,         46,        1,   152064, 0x67a5a150
-0,         47,         47,        1,   152064, 0x1849fa2a
-0,         48,         48,        1,   152064, 0xb0156742
-0,         49,         49,        1,   152064, 0xde75b1fd
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cama3_vtc_b b/deps/libav/tests/ref/fate/h264-conformance-cama3_vtc_b
deleted file mode 100644
index 46821c1..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cama3_vtc_b
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   622080, 0xf3f0bf86
-0,          1,          1,        1,   622080, 0x6aaf3d42
-0,          2,          2,        1,   622080, 0xe53bcd5d
-0,          3,          3,        1,   622080, 0x8dabca9d
diff --git a/deps/libav/tests/ref/fate/h264-conformance-camaci3_sony_c b/deps/libav/tests/ref/fate/h264-conformance-camaci3_sony_c
deleted file mode 100644
index 5896460..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-camaci3_sony_c
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    36864, 0x9b5dcf28
-0,          1,          1,        1,    36864, 0xb13d4fee
-0,          2,          2,        1,    36864, 0x11c512ac
-0,          3,          3,        1,    36864, 0xc013b0e3
-0,          4,          4,        1,    36864, 0x25002dae
-0,          5,          5,        1,    36864, 0xefd0055a
-0,          6,          6,        1,    36864, 0x6be2d3b2
-0,          7,          7,        1,    36864, 0xa8a0d525
-0,          8,          8,        1,    36864, 0x1bf942e8
-0,          9,          9,        1,    36864, 0x5c08c94f
-0,         10,         10,        1,    36864, 0x5555e762
-0,         11,         11,        1,    36864, 0xcc1429c7
-0,         12,         12,        1,    36864, 0xa3cc1535
-0,         13,         13,        1,    36864, 0x14dc2b75
-0,         14,         14,        1,    36864, 0x6b965ce9
-0,         15,         15,        1,    36864, 0x7424d19b
-0,         16,         16,        1,    36864, 0xcada6a7f
diff --git a/deps/libav/tests/ref/fate/h264-conformance-camanl1_toshiba_b b/deps/libav/tests/ref/fate/h264-conformance-camanl1_toshiba_b
deleted file mode 100644
index 2c3c557..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-camanl1_toshiba_b
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xb1edd842
-0,          1,          1,        1,   152064, 0x551f8f45
-0,          2,          2,        1,   152064, 0xb4931cb2
-0,          3,          3,        1,   152064, 0x78882b27
-0,          4,          4,        1,   152064, 0x3afef36d
-0,          5,          5,        1,   152064, 0x85afad0a
-0,          6,          6,        1,   152064, 0x3a8bab81
-0,          7,          7,        1,   152064, 0x2a437174
-0,          8,          8,        1,   152064, 0x22421437
-0,          9,          9,        1,   152064, 0x39c5f125
-0,         10,         10,        1,   152064, 0x256eaad2
-0,         11,         11,        1,   152064, 0x668a5d31
-0,         12,         12,        1,   152064, 0x412a4aa7
-0,         13,         13,        1,   152064, 0x3f091baf
-0,         14,         14,        1,   152064, 0xbf16d262
-0,         15,         15,        1,   152064, 0x2fc4ce67
-0,         16,         16,        1,   152064, 0x119cde3e
-0,         17,         17,        1,   152064, 0xb40b8632
-0,         18,         18,        1,   152064, 0x4be4f192
-0,         19,         19,        1,   152064, 0x906c1237
-0,         20,         20,        1,   152064, 0x95380024
-0,         21,         21,        1,   152064, 0x6a833025
-0,         22,         22,        1,   152064, 0x681d1c4f
-0,         23,         23,        1,   152064, 0x08c8dea4
-0,         24,         24,        1,   152064, 0xc69226f0
-0,         25,         25,        1,   152064, 0x86631102
-0,         26,         26,        1,   152064, 0x7f40c77a
-0,         27,         27,        1,   152064, 0xc746ddd4
-0,         28,         28,        1,   152064, 0x5f2bd3cb
-0,         29,         29,        1,   152064, 0x643c8316
-0,         30,         30,        1,   152064, 0x5b7fa380
-0,         31,         31,        1,   152064, 0x82438cf7
-0,         32,         32,        1,   152064, 0xdee0f7e7
-0,         33,         33,        1,   152064, 0xc50d41f1
-0,         34,         34,        1,   152064, 0xf3453631
-0,         35,         35,        1,   152064, 0x90bce66b
-0,         36,         36,        1,   152064, 0x045b03f7
-0,         37,         37,        1,   152064, 0xf64bd756
-0,         38,         38,        1,   152064, 0xff997ef2
-0,         39,         39,        1,   152064, 0x3613a0a5
-0,         40,         40,        1,   152064, 0xe6a7a8d6
-0,         41,         41,        1,   152064, 0xb0906c42
-0,         42,         42,        1,   152064, 0x4dfc912b
-0,         43,         43,        1,   152064, 0x81e3991c
-0,         44,         44,        1,   152064, 0x4efc61fb
-0,         45,         45,        1,   152064, 0xed478395
-0,         46,         46,        1,   152064, 0x4cb25ab6
-0,         47,         47,        1,   152064, 0x28e7d51f
-0,         48,         48,        1,   152064, 0x8bcc1a8d
-0,         49,         49,        1,   152064, 0x2fe1f240
-0,         50,         50,        1,   152064, 0xb4978ef8
-0,         51,         51,        1,   152064, 0xe3929556
-0,         52,         52,        1,   152064, 0xd370632a
-0,         53,         53,        1,   152064, 0xba86ffb2
-0,         54,         54,        1,   152064, 0x444bf18c
-0,         55,         55,        1,   152064, 0xab40bd14
-0,         56,         56,        1,   152064, 0xfd488a5d
-0,         57,         57,        1,   152064, 0xe1f09568
-0,         58,         58,        1,   152064, 0x09ee7a7e
-0,         59,         59,        1,   152064, 0x9360397c
-0,         60,         60,        1,   152064, 0xdbd467e9
-0,         61,         61,        1,   152064, 0x99726777
-0,         62,         62,        1,   152064, 0x009fd46c
-0,         63,         63,        1,   152064, 0xcf770fdb
-0,         64,         64,        1,   152064, 0x2a890fd9
-0,         65,         65,        1,   152064, 0x7f40de4b
-0,         66,         66,        1,   152064, 0x04191304
-0,         67,         67,        1,   152064, 0x15722022
-0,         68,         68,        1,   152064, 0x59f4ea93
-0,         69,         69,        1,   152064, 0x28ba373f
-0,         70,         70,        1,   152064, 0xf9e400b8
-0,         71,         71,        1,   152064, 0x85c4bd98
-0,         72,         72,        1,   152064, 0x6917d2a5
-0,         73,         73,        1,   152064, 0x61cae234
-0,         74,         74,        1,   152064, 0x752a9a2d
-0,         75,         75,        1,   152064, 0x1ee2d9bd
-0,         76,         76,        1,   152064, 0xdce9ab8e
-0,         77,         77,        1,   152064, 0x51225fd0
-0,         78,         78,        1,   152064, 0x10e8cb60
-0,         79,         79,        1,   152064, 0x8d07cd25
-0,         80,         80,        1,   152064, 0xb18ba61b
-0,         81,         81,        1,   152064, 0xb0f10280
-0,         82,         82,        1,   152064, 0x76a71f13
-0,         83,         83,        1,   152064, 0x3004f5a1
-0,         84,         84,        1,   152064, 0x9aba5724
-0,         85,         85,        1,   152064, 0x5db85385
-0,         86,         86,        1,   152064, 0xbe9d3f5b
-0,         87,         87,        1,   152064, 0xa71e85bb
-0,         88,         88,        1,   152064, 0xdcf59cd7
-0,         89,         89,        1,   152064, 0x5e319459
diff --git a/deps/libav/tests/ref/fate/h264-conformance-camanl2_toshiba_b b/deps/libav/tests/ref/fate/h264-conformance-camanl2_toshiba_b
deleted file mode 100644
index 066c57f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-camanl2_toshiba_b
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xb1edd842
-0,          1,          1,        1,   152064, 0x551f8f45
-0,          2,          2,        1,   152064, 0xb4931cb2
-0,          3,          3,        1,   152064, 0x5f352e98
-0,          4,          4,        1,   152064, 0xeba5fe28
-0,          5,          5,        1,   152064, 0x85afad0a
-0,          6,          6,        1,   152064, 0x1120b6a4
-0,          7,          7,        1,   152064, 0x67506e16
-0,          8,          8,        1,   152064, 0x22421437
-0,          9,          9,        1,   152064, 0x929becd6
-0,         10,         10,        1,   152064, 0x6ffcb4b0
-0,         11,         11,        1,   152064, 0x668a5d31
-0,         12,         12,        1,   152064, 0x1b034ebb
-0,         13,         13,        1,   152064, 0x7e2d213c
-0,         14,         14,        1,   152064, 0xbf16d262
-0,         15,         15,        1,   152064, 0xdeaecab3
-0,         16,         16,        1,   152064, 0xd220d704
-0,         17,         17,        1,   152064, 0xb40b8632
-0,         18,         18,        1,   152064, 0xbdf0ef57
-0,         19,         19,        1,   152064, 0x7e2e10df
-0,         20,         20,        1,   152064, 0x95380024
-0,         21,         21,        1,   152064, 0xdb80256d
-0,         22,         22,        1,   152064, 0xa4561c61
-0,         23,         23,        1,   152064, 0x08c8dea4
-0,         24,         24,        1,   152064, 0x7bb917d6
-0,         25,         25,        1,   152064, 0x796f0e2b
-0,         26,         26,        1,   152064, 0x7f40c77a
-0,         27,         27,        1,   152064, 0xda32de2e
-0,         28,         28,        1,   152064, 0x00ffc15a
-0,         29,         29,        1,   152064, 0x643c8316
-0,         30,         30,        1,   152064, 0xb7588f7f
-0,         31,         31,        1,   152064, 0xa4e07c02
-0,         32,         32,        1,   152064, 0xdee0f7e7
-0,         33,         33,        1,   152064, 0x2c3245ee
-0,         34,         34,        1,   152064, 0x6565355b
-0,         35,         35,        1,   152064, 0x90bce66b
-0,         36,         36,        1,   152064, 0x0abffe08
-0,         37,         37,        1,   152064, 0x119ccc3e
-0,         38,         38,        1,   152064, 0xff997ef2
-0,         39,         39,        1,   152064, 0xba4b9820
-0,         40,         40,        1,   152064, 0xb6dfa596
-0,         41,         41,        1,   152064, 0xb0906c42
-0,         42,         42,        1,   152064, 0xf3c29133
-0,         43,         43,        1,   152064, 0x08cd8e2b
-0,         44,         44,        1,   152064, 0x4efc61fb
-0,         45,         45,        1,   152064, 0x5b7c6e48
-0,         46,         46,        1,   152064, 0xd28a47c2
-0,         47,         47,        1,   152064, 0x28e7d51f
-0,         48,         48,        1,   152064, 0x3a5619b1
-0,         49,         49,        1,   152064, 0xa517e7f2
-0,         50,         50,        1,   152064, 0xb4978ef8
-0,         51,         51,        1,   152064, 0x25929175
-0,         52,         52,        1,   152064, 0x20f05834
-0,         53,         53,        1,   152064, 0xba86ffb2
-0,         54,         54,        1,   152064, 0xa265f06f
-0,         55,         55,        1,   152064, 0x97bbbfb7
-0,         56,         56,        1,   152064, 0xfd488a5d
-0,         57,         57,        1,   152064, 0x1b0989da
-0,         58,         58,        1,   152064, 0xfd1878ce
-0,         59,         59,        1,   152064, 0x9360397c
-0,         60,         60,        1,   152064, 0x0d8151a7
-0,         61,         61,        1,   152064, 0xe7a05bb8
-0,         62,         62,        1,   152064, 0x009fd46c
-0,         63,         63,        1,   152064, 0x8751123f
-0,         64,         64,        1,   152064, 0x8252101a
-0,         65,         65,        1,   152064, 0x7f40de4b
-0,         66,         66,        1,   152064, 0x4ea317fe
-0,         67,         67,        1,   152064, 0x519224d9
-0,         68,         68,        1,   152064, 0x59f4ea93
-0,         69,         69,        1,   152064, 0xc93c1dba
-0,         70,         70,        1,   152064, 0xe3c9fb61
-0,         71,         71,        1,   152064, 0x85c4bd98
-0,         72,         72,        1,   152064, 0xcebacfd3
-0,         73,         73,        1,   152064, 0x7327da99
-0,         74,         74,        1,   152064, 0x752a9a2d
-0,         75,         75,        1,   152064, 0x5ea6c8d2
-0,         76,         76,        1,   152064, 0x66fd8c6f
-0,         77,         77,        1,   152064, 0x51225fd0
-0,         78,         78,        1,   152064, 0x58b9be96
-0,         79,         79,        1,   152064, 0xa5abcdb7
-0,         80,         80,        1,   152064, 0xb18ba61b
-0,         81,         81,        1,   152064, 0xc7d20190
-0,         82,         82,        1,   152064, 0xb6da14aa
-0,         83,         83,        1,   152064, 0x3004f5a1
-0,         84,         84,        1,   152064, 0x129354e2
-0,         85,         85,        1,   152064, 0xffa148d5
-0,         86,         86,        1,   152064, 0xbe9d3f5b
-0,         87,         87,        1,   152064, 0x1c7f8976
-0,         88,         88,        1,   152064, 0xa107a54d
-0,         89,         89,        1,   152064, 0x5e319459
diff --git a/deps/libav/tests/ref/fate/h264-conformance-camanl3_sand_e b/deps/libav/tests/ref/fate/h264-conformance-camanl3_sand_e
deleted file mode 100644
index a76170c..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-camanl3_sand_e
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x6c1ff6a7
-0,          1,          1,        1,   152064, 0x17f1ff3a
-0,          2,          2,        1,   152064, 0xf7ddcda8
-0,          3,          3,        1,   152064, 0xdcb64a37
-0,          4,          4,        1,   152064, 0x4d2ad1db
-0,          5,          5,        1,   152064, 0x2e49028a
-0,          6,          6,        1,   152064, 0xcebb0f39
-0,          7,          7,        1,   152064, 0xac74e574
-0,          8,          8,        1,   152064, 0x8cd667e5
-0,          9,          9,        1,   152064, 0xda511cf6
-0,         10,         10,        1,   152064, 0x795c45c1
-0,         11,         11,        1,   152064, 0x6034397c
-0,         12,         12,        1,   152064, 0xafb4b03d
-0,         13,         13,        1,   152064, 0xd73b1785
-0,         14,         14,        1,   152064, 0xd873a98f
-0,         15,         15,        1,   152064, 0x07ac191e
-0,         16,         16,        1,   152064, 0x14fa5413
-0,         17,         17,        1,   152064, 0xe6d1667e
-0,         18,         18,        1,   152064, 0x1cc2a92e
-0,         19,         19,        1,   152064, 0x4a878e35
-0,         20,         20,        1,   152064, 0x4adfa52c
-0,         21,         21,        1,   152064, 0x8dbb370b
-0,         22,         22,        1,   152064, 0x4d66a69a
-0,         23,         23,        1,   152064, 0x2dcb66da
-0,         24,         24,        1,   152064, 0x74591150
-0,         25,         25,        1,   152064, 0x259eb13f
-0,         26,         26,        1,   152064, 0xe5c96dd3
-0,         27,         27,        1,   152064, 0x0fb52fe3
-0,         28,         28,        1,   152064, 0x47c506a0
-0,         29,         29,        1,   152064, 0xcc09ca7a
-0,         30,         30,        1,   152064, 0xc3430f03
-0,         31,         31,        1,   152064, 0x702b1a73
-0,         32,         32,        1,   152064, 0x4f385186
-0,         33,         33,        1,   152064, 0x07a34aa5
-0,         34,         34,        1,   152064, 0x698310b0
-0,         35,         35,        1,   152064, 0x5fa469bc
-0,         36,         36,        1,   152064, 0xb6ab39ef
-0,         37,         37,        1,   152064, 0xbb6dc59d
-0,         38,         38,        1,   152064, 0xe5fa7503
-0,         39,         39,        1,   152064, 0xd367512a
-0,         40,         40,        1,   152064, 0x215c0ca7
-0,         41,         41,        1,   152064, 0x6bea4847
-0,         42,         42,        1,   152064, 0xba03f875
-0,         43,         43,        1,   152064, 0x3ac282cd
-0,         44,         44,        1,   152064, 0x23aee807
-0,         45,         45,        1,   152064, 0x4274c84c
-0,         46,         46,        1,   152064, 0xdfdacf4b
-0,         47,         47,        1,   152064, 0xb2de9e6e
-0,         48,         48,        1,   152064, 0x456b684e
-0,         49,         49,        1,   152064, 0xa6297c83
diff --git a/deps/libav/tests/ref/fate/h264-conformance-camasl3_sony_b b/deps/libav/tests/ref/fate/h264-conformance-camasl3_sony_b
deleted file mode 100644
index 0cb41e1..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-camasl3_sony_b
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    36864, 0xfe2ad849
-0,          1,          1,        1,    36864, 0x37954ba1
-0,          2,          2,        1,    36864, 0xaf0e0877
-0,          3,          3,        1,    36864, 0xf28cadd1
-0,          4,          4,        1,    36864, 0xe182365a
-0,          5,          5,        1,    36864, 0xdcdc03b7
-0,          6,          6,        1,    36864, 0x2eded02f
-0,          7,          7,        1,    36864, 0xa706ca87
-0,          8,          8,        1,    36864, 0x446f4c83
-0,          9,          9,        1,    36864, 0x766acab3
-0,         10,         10,        1,    36864, 0x651feaed
-0,         11,         11,        1,    36864, 0x834a2a75
-0,         12,         12,        1,    36864, 0xb1811822
-0,         13,         13,        1,    36864, 0xd8e12e21
-0,         14,         14,        1,    36864, 0x6b445b13
-0,         15,         15,        1,    36864, 0xa4ded223
-0,         16,         16,        1,    36864, 0xbd1161b5
diff --git a/deps/libav/tests/ref/fate/h264-conformance-camp_mot_mbaff_l30 b/deps/libav/tests/ref/fate/h264-conformance-camp_mot_mbaff_l30
deleted file mode 100644
index c4f2782..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-camp_mot_mbaff_l30
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x672279df
-0,          1,          1,        1,   518400, 0xb248a762
-0,          2,          2,        1,   518400, 0x4399de88
-0,          3,          3,        1,   518400, 0x14200d2d
-0,          4,          4,        1,   518400, 0x14a704cf
-0,          5,          5,        1,   518400, 0xcaac5431
-0,          6,          6,        1,   518400, 0x69d77cee
-0,          7,          7,        1,   518400, 0x420d5f92
-0,          8,          8,        1,   518400, 0x083a357d
-0,          9,          9,        1,   518400, 0x01777426
-0,         10,         10,        1,   518400, 0x474640e9
-0,         11,         11,        1,   518400, 0x3d690eab
-0,         12,         12,        1,   518400, 0x58074830
-0,         13,         13,        1,   518400, 0x3e3f0fcc
-0,         14,         14,        1,   518400, 0x8c72de01
-0,         15,         15,        1,   518400, 0xbf0a4f6f
-0,         16,         16,        1,   518400, 0xbdea010d
-0,         17,         17,        1,   518400, 0x54bdc458
-0,         18,         18,        1,   518400, 0xdcd00ed0
-0,         19,         19,        1,   518400, 0x64ba9ba9
-0,         20,         20,        1,   518400, 0x5c0c6790
-0,         21,         21,        1,   518400, 0x178674ed
-0,         22,         22,        1,   518400, 0x9ebec8d3
-0,         23,         23,        1,   518400, 0x375c5426
-0,         24,         24,        1,   518400, 0x19987af8
-0,         25,         25,        1,   518400, 0x347ec12c
-0,         26,         26,        1,   518400, 0x96856c36
-0,         27,         27,        1,   518400, 0xb81264a6
-0,         28,         28,        1,   518400, 0xde0a08d6
-0,         29,         29,        1,   518400, 0x19cb10be
diff --git a/deps/libav/tests/ref/fate/h264-conformance-camp_mot_mbaff_l31 b/deps/libav/tests/ref/fate/h264-conformance-camp_mot_mbaff_l31
deleted file mode 100644
index 1bee037..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-camp_mot_mbaff_l31
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x077637bf
-0,          1,          1,        1,   518400, 0xbd096d55
-0,          2,          2,        1,   518400, 0x58b58820
-0,          3,          3,        1,   518400, 0xdf24aced
-0,          4,          4,        1,   518400, 0x2354c6a2
-0,          5,          5,        1,   518400, 0xedaaffdf
-0,          6,          6,        1,   518400, 0x28a8f027
-0,          7,          7,        1,   518400, 0x05dee3d2
-0,          8,          8,        1,   518400, 0x2ae9dbe4
-0,          9,          9,        1,   518400, 0x361fec4a
-0,         10,         10,        1,   518400, 0xd9c7b07d
-0,         11,         11,        1,   518400, 0xa9d69c9f
-0,         12,         12,        1,   518400, 0x7f44c08c
-0,         13,         13,        1,   518400, 0xbfed83b4
-0,         14,         14,        1,   518400, 0x65a5588c
-0,         15,         15,        1,   518400, 0xf4859855
-0,         16,         16,        1,   518400, 0xcba96df9
-0,         17,         17,        1,   518400, 0x8ae11dfd
-0,         18,         18,        1,   518400, 0xf0e36904
-0,         19,         19,        1,   518400, 0x45cf1cb3
-0,         20,         20,        1,   518400, 0xffefde04
-0,         21,         21,        1,   518400, 0xc2a8edef
-0,         22,         22,        1,   518400, 0x72b15456
-0,         23,         23,        1,   518400, 0x67b8dd35
-0,         24,         24,        1,   518400, 0x8b91f38e
-0,         25,         25,        1,   518400, 0xe7055df1
-0,         26,         26,        1,   518400, 0x5c32200d
-0,         27,         27,        1,   518400, 0xfbb709dc
-0,         28,         28,        1,   518400, 0x5c45b17f
-0,         29,         29,        1,   518400, 0x3a25903f
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canl1_sony_e b/deps/libav/tests/ref/fate/h264-conformance-canl1_sony_e
deleted file mode 100644
index d90e957..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canl1_sony_e
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xc805351d
-0,          1,          1,        1,    38016, 0x3809fec3
-0,          2,          2,        1,    38016, 0xf698ce3c
-0,          3,          3,        1,    38016, 0x7e3da603
-0,          4,          4,        1,    38016, 0x68b07d81
-0,          5,          5,        1,    38016, 0xd91f717a
-0,          6,          6,        1,    38016, 0x48885dd6
-0,          7,          7,        1,    38016, 0x27e64e8e
-0,          8,          8,        1,    38016, 0x955835ce
-0,          9,          9,        1,    38016, 0xf19940a0
-0,         10,         10,        1,    38016, 0x9a1c51e4
-0,         11,         11,        1,    38016, 0xf59373af
-0,         12,         12,        1,    38016, 0x5d6c7d06
-0,         13,         13,        1,    38016, 0x32fca533
-0,         14,         14,        1,    38016, 0x37e69987
-0,         15,         15,        1,    38016, 0x96929e05
-0,         16,         16,        1,    38016, 0xee37a1f9
-0,         17,         17,        1,    38016, 0xc6279d8f
-0,         18,         18,        1,    38016, 0x33d28b0a
-0,         19,         19,        1,    38016, 0x42946b72
-0,         20,         20,        1,    38016, 0x51e947bf
-0,         21,         21,        1,    38016, 0xb10b2399
-0,         22,         22,        1,    38016, 0x250c0fe4
-0,         23,         23,        1,    38016, 0x81e20b18
-0,         24,         24,        1,    38016, 0xb93f00db
-0,         25,         25,        1,    38016, 0x4f9d13d8
-0,         26,         26,        1,    38016, 0x7d9c1184
-0,         27,         27,        1,    38016, 0xd3271d2c
-0,         28,         28,        1,    38016, 0x9b253539
-0,         29,         29,        1,    38016, 0xc4fd4d89
-0,         30,         30,        1,    38016, 0x006f63cc
-0,         31,         31,        1,    38016, 0xa7d976b4
-0,         32,         32,        1,    38016, 0x30de94d6
-0,         33,         33,        1,    38016, 0x2cb7a745
-0,         34,         34,        1,    38016, 0xa7a2b854
-0,         35,         35,        1,    38016, 0x1ca1ba1a
-0,         36,         36,        1,    38016, 0x13b2b430
-0,         37,         37,        1,    38016, 0x82bbb2de
-0,         38,         38,        1,    38016, 0x5fa0b4f9
-0,         39,         39,        1,    38016, 0xedefb64d
-0,         40,         40,        1,    38016, 0x5ccdbf33
-0,         41,         41,        1,    38016, 0x4fd0b4bb
-0,         42,         42,        1,    38016, 0x195fa008
-0,         43,         43,        1,    38016, 0xda1494e0
-0,         44,         44,        1,    38016, 0x98ac8fa6
-0,         45,         45,        1,    38016, 0xd1548835
-0,         46,         46,        1,    38016, 0x35c790ee
-0,         47,         47,        1,    38016, 0xecda84f1
-0,         48,         48,        1,    38016, 0x9d9f8710
-0,         49,         49,        1,    38016, 0x72d89581
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canl1_sva_b b/deps/libav/tests/ref/fate/h264-conformance-canl1_sva_b
deleted file mode 100644
index 0436f43..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canl1_sva_b
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x0bd22424
-0,          1,          1,        1,    38016, 0x4eb601f0
-0,          2,          2,        1,    38016, 0xe16de459
-0,          3,          3,        1,    38016, 0xde2e0c37
-0,          4,          4,        1,    38016, 0x14a0286b
-0,          5,          5,        1,    38016, 0x37bc35b5
-0,          6,          6,        1,    38016, 0xcfa24923
-0,          7,          7,        1,    38016, 0xac755ba0
-0,          8,          8,        1,    38016, 0x27d1822a
-0,          9,          9,        1,    38016, 0xa8039548
-0,         10,         10,        1,    38016, 0x400ea1fb
-0,         11,         11,        1,    38016, 0x7d2ca44a
-0,         12,         12,        1,    38016, 0xd42dae4f
-0,         13,         13,        1,    38016, 0x39ce9599
-0,         14,         14,        1,    38016, 0x37498aa1
-0,         15,         15,        1,    38016, 0x8558911f
-0,         16,         16,        1,    38016, 0x06a8a9ad
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canl1_toshiba_g b/deps/libav/tests/ref/fate/h264-conformance-canl1_toshiba_g
deleted file mode 100644
index ced4c92..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canl1_toshiba_g
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x58892149
-0,          1,          1,        1,    38016, 0xda2ded74
-0,          2,          2,        1,    38016, 0x2661cdb0
-0,          3,          3,        1,    38016, 0xb581a73a
-0,          4,          4,        1,    38016, 0xa04a7e93
-0,          5,          5,        1,    38016, 0x149e7861
-0,          6,          6,        1,    38016, 0x53725080
-0,          7,          7,        1,    38016, 0x341a4d3f
-0,          8,          8,        1,    38016, 0x2ecc41ac
-0,          9,          9,        1,    38016, 0x99b85127
-0,         10,         10,        1,    38016, 0x7bdc50bc
-0,         11,         11,        1,    38016, 0xd3d58663
-0,         12,         12,        1,    38016, 0x717485e9
-0,         13,         13,        1,    38016, 0x2ac29c85
-0,         14,         14,        1,    38016, 0x36daa429
-0,         15,         15,        1,    38016, 0x8bb7a48e
-0,         16,         16,        1,    38016, 0xb38aab11
-0,         17,         17,        1,    38016, 0xacd89c4c
-0,         18,         18,        1,    38016, 0x676b71e1
-0,         19,         19,        1,    38016, 0xa2e7731e
-0,         20,         20,        1,    38016, 0x4a2f5766
-0,         21,         21,        1,    38016, 0x04ef1873
-0,         22,         22,        1,    38016, 0x52ac0171
-0,         23,         23,        1,    38016, 0xdd0a027a
-0,         24,         24,        1,    38016, 0x700810c6
-0,         25,         25,        1,    38016, 0x417f0cd3
-0,         26,         26,        1,    38016, 0xf8ef0da9
-0,         27,         27,        1,    38016, 0xfce62a5a
-0,         28,         28,        1,    38016, 0x03592b0a
-0,         29,         29,        1,    38016, 0x9b7b5373
-0,         30,         30,        1,    38016, 0xab015505
-0,         31,         31,        1,    38016, 0xf3387ae1
-0,         32,         32,        1,    38016, 0x1d09a5b6
-0,         33,         33,        1,    38016, 0x9159a5e2
-0,         34,         34,        1,    38016, 0x8887c177
-0,         35,         35,        1,    38016, 0x914dbacd
-0,         36,         36,        1,    38016, 0xaa97c0f6
-0,         37,         37,        1,    38016, 0x0837b14a
-0,         38,         38,        1,    38016, 0x0198be16
-0,         39,         39,        1,    38016, 0xc14bc9c6
-0,         40,         40,        1,    38016, 0xdb58c2a7
-0,         41,         41,        1,    38016, 0xa751ae90
-0,         42,         42,        1,    38016, 0x5813a64d
-0,         43,         43,        1,    38016, 0x73959f9b
-0,         44,         44,        1,    38016, 0xb0de8994
-0,         45,         45,        1,    38016, 0x79ea9214
-0,         46,         46,        1,    38016, 0x0b388957
-0,         47,         47,        1,    38016, 0x31aa91c9
-0,         48,         48,        1,    38016, 0xadcf88ec
-0,         49,         49,        1,    38016, 0x5bc99b68
-0,         50,         50,        1,    38016, 0x535e7c2e
-0,         51,         51,        1,    38016, 0xbfef8e0a
-0,         52,         52,        1,    38016, 0xc56285aa
-0,         53,         53,        1,    38016, 0x76758edc
-0,         54,         54,        1,    38016, 0xd8c3a20b
-0,         55,         55,        1,    38016, 0xd2aa918b
-0,         56,         56,        1,    38016, 0xfe1ea23b
-0,         57,         57,        1,    38016, 0x3533a68d
-0,         58,         58,        1,    38016, 0xd8679427
-0,         59,         59,        1,    38016, 0x76be9c98
-0,         60,         60,        1,    38016, 0xc37a9a7a
-0,         61,         61,        1,    38016, 0x1ebe9463
-0,         62,         62,        1,    38016, 0xab4c63d2
-0,         63,         63,        1,    38016, 0x761b3c50
-0,         64,         64,        1,    38016, 0xb57c4bb7
-0,         65,         65,        1,    38016, 0x86117755
-0,         66,         66,        1,    38016, 0xd89dacf3
-0,         67,         67,        1,    38016, 0x8940eee9
-0,         68,         68,        1,    38016, 0x2f7c3abf
-0,         69,         69,        1,    38016, 0x98366678
-0,         70,         70,        1,    38016, 0x14348147
-0,         71,         71,        1,    38016, 0x4e3ba8f8
-0,         72,         72,        1,    38016, 0xc167c205
-0,         73,         73,        1,    38016, 0x0581e211
-0,         74,         74,        1,    38016, 0x62cd0ea6
-0,         75,         75,        1,    38016, 0x753b3a2b
-0,         76,         76,        1,    38016, 0x25ce507a
-0,         77,         77,        1,    38016, 0x726f64af
-0,         78,         78,        1,    38016, 0xa13c7c58
-0,         79,         79,        1,    38016, 0xa27b7584
-0,         80,         80,        1,    38016, 0x45b47c12
-0,         81,         81,        1,    38016, 0x0f6a9456
-0,         82,         82,        1,    38016, 0x30ae9e92
-0,         83,         83,        1,    38016, 0xf59fa16d
-0,         84,         84,        1,    38016, 0x16d292d7
-0,         85,         85,        1,    38016, 0x828791cc
-0,         86,         86,        1,    38016, 0x71769267
-0,         87,         87,        1,    38016, 0xf297a0e0
-0,         88,         88,        1,    38016, 0x33a4a00a
-0,         89,         89,        1,    38016, 0xda96c5b8
-0,         90,         90,        1,    38016, 0x742daf25
-0,         91,         91,        1,    38016, 0x603f8bba
-0,         92,         92,        1,    38016, 0x89d18e70
-0,         93,         93,        1,    38016, 0x8c2b8c29
-0,         94,         94,        1,    38016, 0x9ccf6983
-0,         95,         95,        1,    38016, 0x8ddd5a29
-0,         96,         96,        1,    38016, 0x5679718d
-0,         97,         97,        1,    38016, 0x28aa80b3
-0,         98,         98,        1,    38016, 0x3b08780e
-0,         99,         99,        1,    38016, 0x9e408cbc
-0,        100,        100,        1,    38016, 0xe7c18e94
-0,        101,        101,        1,    38016, 0xaba57f22
-0,        102,        102,        1,    38016, 0xd8826dc5
-0,        103,        103,        1,    38016, 0x2ed2710e
-0,        104,        104,        1,    38016, 0x59748443
-0,        105,        105,        1,    38016, 0x5076b247
-0,        106,        106,        1,    38016, 0xf6ae9bcd
-0,        107,        107,        1,    38016, 0x4d83d68f
-0,        108,        108,        1,    38016, 0x118ff589
-0,        109,        109,        1,    38016, 0x65b3f2c0
-0,        110,        110,        1,    38016, 0x8f341576
-0,        111,        111,        1,    38016, 0xbeac1816
-0,        112,        112,        1,    38016, 0x19073cf9
-0,        113,        113,        1,    38016, 0xcfdb2e55
-0,        114,        114,        1,    38016, 0x99fd08f8
-0,        115,        115,        1,    38016, 0x025c0249
-0,        116,        116,        1,    38016, 0x4d311afc
-0,        117,        117,        1,    38016, 0xef532038
-0,        118,        118,        1,    38016, 0x7c353d9a
-0,        119,        119,        1,    38016, 0x9fed4678
-0,        120,        120,        1,    38016, 0x67062dad
-0,        121,        121,        1,    38016, 0x1e5b2069
-0,        122,        122,        1,    38016, 0x8b25fd3f
-0,        123,        123,        1,    38016, 0x06a9e566
-0,        124,        124,        1,    38016, 0x263badf5
-0,        125,        125,        1,    38016, 0x35a99a45
-0,        126,        126,        1,    38016, 0x930a8491
-0,        127,        127,        1,    38016, 0xf9d49dfd
-0,        128,        128,        1,    38016, 0xbc8cb0a6
-0,        129,        129,        1,    38016, 0x8f10d1a9
-0,        130,        130,        1,    38016, 0xb6dbc51b
-0,        131,        131,        1,    38016, 0x2f1bc747
-0,        132,        132,        1,    38016, 0xecdac1ac
-0,        133,        133,        1,    38016, 0x6391bdcc
-0,        134,        134,        1,    38016, 0x7e5eb209
-0,        135,        135,        1,    38016, 0x8f5ea1e8
-0,        136,        136,        1,    38016, 0x969195a9
-0,        137,        137,        1,    38016, 0x18579903
-0,        138,        138,        1,    38016, 0x4cfe8893
-0,        139,        139,        1,    38016, 0x68c57143
-0,        140,        140,        1,    38016, 0x297f6420
-0,        141,        141,        1,    38016, 0x36b1669c
-0,        142,        142,        1,    38016, 0x3d78362e
-0,        143,        143,        1,    38016, 0xaba14c36
-0,        144,        144,        1,    38016, 0xe6914a59
-0,        145,        145,        1,    38016, 0x3733481a
-0,        146,        146,        1,    38016, 0xb6df4c6d
-0,        147,        147,        1,    38016, 0x20631838
-0,        148,        148,        1,    38016, 0x014df835
-0,        149,        149,        1,    38016, 0xcb36db94
-0,        150,        150,        1,    38016, 0x4cb8b44a
-0,        151,        151,        1,    38016, 0xa49da6e5
-0,        152,        152,        1,    38016, 0x8dbfb72d
-0,        153,        153,        1,    38016, 0x3ba5b7d5
-0,        154,        154,        1,    38016, 0xc8ebad2d
-0,        155,        155,        1,    38016, 0x36fad594
-0,        156,        156,        1,    38016, 0x6302f0f2
-0,        157,        157,        1,    38016, 0xc799139e
-0,        158,        158,        1,    38016, 0x947947d0
-0,        159,        159,        1,    38016, 0x39756224
-0,        160,        160,        1,    38016, 0x1d995e51
-0,        161,        161,        1,    38016, 0x56274435
-0,        162,        162,        1,    38016, 0x3cfc2b1d
-0,        163,        163,        1,    38016, 0x5a4a178f
-0,        164,        164,        1,    38016, 0xca212af1
-0,        165,        165,        1,    38016, 0x885af884
-0,        166,        166,        1,    38016, 0x3241c9c1
-0,        167,        167,        1,    38016, 0x4ef997a4
-0,        168,        168,        1,    38016, 0x5ecb8030
-0,        169,        169,        1,    38016, 0x2eb76daa
-0,        170,        170,        1,    38016, 0x485780ba
-0,        171,        171,        1,    38016, 0xf5f88241
-0,        172,        172,        1,    38016, 0x563f97d0
-0,        173,        173,        1,    38016, 0x4a01a6c4
-0,        174,        174,        1,    38016, 0xd7ea8457
-0,        175,        175,        1,    38016, 0x08ae6916
-0,        176,        176,        1,    38016, 0x4c933e75
-0,        177,        177,        1,    38016, 0x49541e4a
-0,        178,        178,        1,    38016, 0xd14e028a
-0,        179,        179,        1,    38016, 0xabd5f4e6
-0,        180,        180,        1,    38016, 0xfe3bdd0f
-0,        181,        181,        1,    38016, 0xbb30cef4
-0,        182,        182,        1,    38016, 0xd724d0e3
-0,        183,        183,        1,    38016, 0x7537d6bf
-0,        184,        184,        1,    38016, 0x3da3e67a
-0,        185,        185,        1,    38016, 0xf02606eb
-0,        186,        186,        1,    38016, 0x2dde399b
-0,        187,        187,        1,    38016, 0xafe94c86
-0,        188,        188,        1,    38016, 0x923d6081
-0,        189,        189,        1,    38016, 0x9c733e4e
-0,        190,        190,        1,    38016, 0x2b16d821
-0,        191,        191,        1,    38016, 0x1edf9cd1
-0,        192,        192,        1,    38016, 0xa9c3b601
-0,        193,        193,        1,    38016, 0x9adeb02b
-0,        194,        194,        1,    38016, 0xf5eaddc3
-0,        195,        195,        1,    38016, 0xac871bea
-0,        196,        196,        1,    38016, 0x060429f4
-0,        197,        197,        1,    38016, 0xf80b421d
-0,        198,        198,        1,    38016, 0x7dcd6c50
-0,        199,        199,        1,    38016, 0x46e46798
-0,        200,        200,        1,    38016, 0xdbee759f
-0,        201,        201,        1,    38016, 0xbbe78774
-0,        202,        202,        1,    38016, 0xb85990ed
-0,        203,        203,        1,    38016, 0xda0e8530
-0,        204,        204,        1,    38016, 0x5eaf8508
-0,        205,        205,        1,    38016, 0x5c2c83fa
-0,        206,        206,        1,    38016, 0x6dfe9322
-0,        207,        207,        1,    38016, 0xa3059a60
-0,        208,        208,        1,    38016, 0x357c8237
-0,        209,        209,        1,    38016, 0xccae6b20
-0,        210,        210,        1,    38016, 0x25fe57c1
-0,        211,        211,        1,    38016, 0xfa65376b
-0,        212,        212,        1,    38016, 0xd9b12ef8
-0,        213,        213,        1,    38016, 0x3ab73fa0
-0,        214,        214,        1,    38016, 0xcb6a2f96
-0,        215,        215,        1,    38016, 0x8a973915
-0,        216,        216,        1,    38016, 0x71ac1dd2
-0,        217,        217,        1,    38016, 0x71802085
-0,        218,        218,        1,    38016, 0x4de728d9
-0,        219,        219,        1,    38016, 0xdf3a1de7
-0,        220,        220,        1,    38016, 0x36270e93
-0,        221,        221,        1,    38016, 0x90d4fe93
-0,        222,        222,        1,    38016, 0x3477fb4e
-0,        223,        223,        1,    38016, 0xd410fa81
-0,        224,        224,        1,    38016, 0xfc230675
-0,        225,        225,        1,    38016, 0xbda40c03
-0,        226,        226,        1,    38016, 0x7a47fc07
-0,        227,        227,        1,    38016, 0x53fe2a37
-0,        228,        228,        1,    38016, 0x342d3bec
-0,        229,        229,        1,    38016, 0xf13163a3
-0,        230,        230,        1,    38016, 0x03f087da
-0,        231,        231,        1,    38016, 0xbc03c466
-0,        232,        232,        1,    38016, 0x6318d676
-0,        233,        233,        1,    38016, 0xbc2f0b68
-0,        234,        234,        1,    38016, 0xcb57354b
-0,        235,        235,        1,    38016, 0x7e9a5b48
-0,        236,        236,        1,    38016, 0x9dca693a
-0,        237,        237,        1,    38016, 0xd0776497
-0,        238,        238,        1,    38016, 0x05a24093
-0,        239,        239,        1,    38016, 0x69b21063
-0,        240,        240,        1,    38016, 0x15f3ed8b
-0,        241,        241,        1,    38016, 0x2417bc52
-0,        242,        242,        1,    38016, 0xabc2a564
-0,        243,        243,        1,    38016, 0x67f2dd90
-0,        244,        244,        1,    38016, 0xa5fe4b6e
-0,        245,        245,        1,    38016, 0x7801add2
-0,        246,        246,        1,    38016, 0xf4abc321
-0,        247,        247,        1,    38016, 0x1d06a837
-0,        248,        248,        1,    38016, 0x2e0d6fc2
-0,        249,        249,        1,    38016, 0xc4f30535
-0,        250,        250,        1,    38016, 0x67d09a80
-0,        251,        251,        1,    38016, 0xca505a1e
-0,        252,        252,        1,    38016, 0x2e2e56c8
-0,        253,        253,        1,    38016, 0x689ea3e2
-0,        254,        254,        1,    38016, 0x9989165a
-0,        255,        255,        1,    38016, 0xd8e2c30e
-0,        256,        256,        1,    38016, 0x2a98bf3f
-0,        257,        257,        1,    38016, 0x44664d3e
-0,        258,        258,        1,    38016, 0x53a939de
-0,        259,        259,        1,    38016, 0x4c153702
-0,        260,        260,        1,    38016, 0x03c73e88
-0,        261,        261,        1,    38016, 0x7cd649d4
-0,        262,        262,        1,    38016, 0x7d7c5687
-0,        263,        263,        1,    38016, 0x8f3c53a6
-0,        264,        264,        1,    38016, 0x24634dd1
-0,        265,        265,        1,    38016, 0x5d00442c
-0,        266,        266,        1,    38016, 0xdcc72906
-0,        267,        267,        1,    38016, 0x5def12f3
-0,        268,        268,        1,    38016, 0x95e6e8be
-0,        269,        269,        1,    38016, 0x2675c694
-0,        270,        270,        1,    38016, 0x906aa24e
-0,        271,        271,        1,    38016, 0x09468fe4
-0,        272,        272,        1,    38016, 0xaec9736d
-0,        273,        273,        1,    38016, 0xa5812142
-0,        274,        274,        1,    38016, 0x9986d55f
-0,        275,        275,        1,    38016, 0x9f7fc399
-0,        276,        276,        1,    38016, 0xc345d526
-0,        277,        277,        1,    38016, 0x3ae3b9bd
-0,        278,        278,        1,    38016, 0xb103ec45
-0,        279,        279,        1,    38016, 0x3ff462c2
-0,        280,        280,        1,    38016, 0x5c07ed68
-0,        281,        281,        1,    38016, 0xccbad189
-0,        282,        282,        1,    38016, 0x6f3f9a18
-0,        283,        283,        1,    38016, 0x26406fa1
-0,        284,        284,        1,    38016, 0x06cf5f62
-0,        285,        285,        1,    38016, 0x3eb29bd1
-0,        286,        286,        1,    38016, 0x12ab807e
-0,        287,        287,        1,    38016, 0x7621bf0d
-0,        288,        288,        1,    38016, 0x88eabc0c
-0,        289,        289,        1,    38016, 0x21386662
-0,        290,        290,        1,    38016, 0x5839e3e4
-0,        291,        291,        1,    38016, 0xd196ee7c
-0,        292,        292,        1,    38016, 0x84dc8477
-0,        293,        293,        1,    38016, 0xbf2dcc7a
-0,        294,        294,        1,    38016, 0x29e3fe96
-0,        295,        295,        1,    38016, 0xf115ffc3
-0,        296,        296,        1,    38016, 0x7585d699
-0,        297,        297,        1,    38016, 0x7a7dcb8a
-0,        298,        298,        1,    38016, 0x03cfdb04
-0,        299,        299,        1,    38016, 0xd56e028c
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canl2_sony_e b/deps/libav/tests/ref/fate/h264-conformance-canl2_sony_e
deleted file mode 100644
index 9a3b48f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canl2_sony_e
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xc805351d
-0,          1,          1,        1,    38016, 0x3017107e
-0,          2,          2,        1,    38016, 0xe172e2d2
-0,          3,          3,        1,    38016, 0x7fefbb5b
-0,          4,          4,        1,    38016, 0x331097e6
-0,          5,          5,        1,    38016, 0x47de825a
-0,          6,          6,        1,    38016, 0x0bf36d87
-0,          7,          7,        1,    38016, 0x03ae60c5
-0,          8,          8,        1,    38016, 0x986b5930
-0,          9,          9,        1,    38016, 0x398b6450
-0,         10,         10,        1,    38016, 0x8e1b77e7
-0,         11,         11,        1,    38016, 0xefb198a6
-0,         12,         12,        1,    38016, 0x395aa9ee
-0,         13,         13,        1,    38016, 0x1918b963
-0,         14,         14,        1,    38016, 0xe6cab421
-0,         15,         15,        1,    38016, 0x96929e05
-0,         16,         16,        1,    38016, 0xf076abc7
-0,         17,         17,        1,    38016, 0xd0f4ab70
-0,         18,         18,        1,    38016, 0x7a39a75c
-0,         19,         19,        1,    38016, 0xb04f8bad
-0,         20,         20,        1,    38016, 0xe4996ff5
-0,         21,         21,        1,    38016, 0x096e549a
-0,         22,         22,        1,    38016, 0x36d73f1a
-0,         23,         23,        1,    38016, 0x25f53bbf
-0,         24,         24,        1,    38016, 0x7ebd3f9f
-0,         25,         25,        1,    38016, 0x464c4b4c
-0,         26,         26,        1,    38016, 0x2d794a40
-0,         27,         27,        1,    38016, 0x1599532d
-0,         28,         28,        1,    38016, 0xf8326999
-0,         29,         29,        1,    38016, 0x858e789b
-0,         30,         30,        1,    38016, 0x006f63cc
-0,         31,         31,        1,    38016, 0x488a9614
-0,         32,         32,        1,    38016, 0x950fb7cc
-0,         33,         33,        1,    38016, 0x6deac9dd
-0,         34,         34,        1,    38016, 0x0a82d725
-0,         35,         35,        1,    38016, 0x2702d5fe
-0,         36,         36,        1,    38016, 0xf7ead782
-0,         37,         37,        1,    38016, 0x560fd1f1
-0,         38,         38,        1,    38016, 0xa3cdd31a
-0,         39,         39,        1,    38016, 0xa19ed45c
-0,         40,         40,        1,    38016, 0x8d85d757
-0,         41,         41,        1,    38016, 0x7fa6e1b5
-0,         42,         42,        1,    38016, 0x8a31db0e
-0,         43,         43,        1,    38016, 0x9dead6ff
-0,         44,         44,        1,    38016, 0x8a8adf44
-0,         45,         45,        1,    38016, 0xd1548835
-0,         46,         46,        1,    38016, 0xf696a62c
-0,         47,         47,        1,    38016, 0x5edbb219
-0,         48,         48,        1,    38016, 0x0d9db749
-0,         49,         49,        1,    38016, 0xc109c379
-0,         50,         50,        1,    38016, 0xe814c2b1
-0,         51,         51,        1,    38016, 0x4a8dc84b
-0,         52,         52,        1,    38016, 0x6bcac28c
-0,         53,         53,        1,    38016, 0xa37ec8da
-0,         54,         54,        1,    38016, 0x3202d5e9
-0,         55,         55,        1,    38016, 0x3d65ddb6
-0,         56,         56,        1,    38016, 0x165de082
-0,         57,         57,        1,    38016, 0x5702e231
-0,         58,         58,        1,    38016, 0x034fe8f4
-0,         59,         59,        1,    38016, 0x96f0ea58
-0,         60,         60,        1,    38016, 0x65539ad7
-0,         61,         61,        1,    38016, 0xdf98a7cf
-0,         62,         62,        1,    38016, 0xda007de0
-0,         63,         63,        1,    38016, 0xdf43520e
-0,         64,         64,        1,    38016, 0xc5d553d2
-0,         65,         65,        1,    38016, 0xc3327450
-0,         66,         66,        1,    38016, 0x81c4a2e0
-0,         67,         67,        1,    38016, 0x7c56e2d1
-0,         68,         68,        1,    38016, 0x813f20a4
-0,         69,         69,        1,    38016, 0xe48257ad
-0,         70,         70,        1,    38016, 0x261b812f
-0,         71,         71,        1,    38016, 0x8836ae43
-0,         72,         72,        1,    38016, 0x4c52e30f
-0,         73,         73,        1,    38016, 0x0614245f
-0,         74,         74,        1,    38016, 0xbf275e2e
-0,         75,         75,        1,    38016, 0x2f0f3e49
-0,         76,         76,        1,    38016, 0xfaf57eb1
-0,         77,         77,        1,    38016, 0xd1b49f95
-0,         78,         78,        1,    38016, 0x10f4c2f6
-0,         79,         79,        1,    38016, 0x2322d359
-0,         80,         80,        1,    38016, 0x994de596
-0,         81,         81,        1,    38016, 0x2a0df115
-0,         82,         82,        1,    38016, 0xfcb7f1ec
-0,         83,         83,        1,    38016, 0xcbc2ee10
-0,         84,         84,        1,    38016, 0x49f5ee5c
-0,         85,         85,        1,    38016, 0x4eb9f286
-0,         86,         86,        1,    38016, 0xe5d80039
-0,         87,         87,        1,    38016, 0xfa57fa81
-0,         88,         88,        1,    38016, 0x2bea01f7
-0,         89,         89,        1,    38016, 0x4e7c07a0
-0,         90,         90,        1,    38016, 0x43b6a0f7
-0,         91,         91,        1,    38016, 0x996e93cc
-0,         92,         92,        1,    38016, 0x8e5c8a40
-0,         93,         93,        1,    38016, 0x15cc7fe7
-0,         94,         94,        1,    38016, 0x7f0a6c35
-0,         95,         95,        1,    38016, 0x031677a4
-0,         96,         96,        1,    38016, 0x14dd8b6d
-0,         97,         97,        1,    38016, 0x143ca592
-0,         98,         98,        1,    38016, 0x8e56b262
-0,         99,         99,        1,    38016, 0x01c7c2b9
-0,        100,        100,        1,    38016, 0xc117cbfa
-0,        101,        101,        1,    38016, 0x609bbe4b
-0,        102,        102,        1,    38016, 0x9a9fad05
-0,        103,        103,        1,    38016, 0xba959d79
-0,        104,        104,        1,    38016, 0x8773c00e
-0,        105,        105,        1,    38016, 0xea22a35b
-0,        106,        106,        1,    38016, 0x4b76c5fa
-0,        107,        107,        1,    38016, 0x5088e610
-0,        108,        108,        1,    38016, 0xb6db1234
-0,        109,        109,        1,    38016, 0xef631cf7
-0,        110,        110,        1,    38016, 0x7d993030
-0,        111,        111,        1,    38016, 0xa9b24013
-0,        112,        112,        1,    38016, 0xc3a14055
-0,        113,        113,        1,    38016, 0x5e7e2b4c
-0,        114,        114,        1,    38016, 0xae3505e0
-0,        115,        115,        1,    38016, 0x48880369
-0,        116,        116,        1,    38016, 0x844e1316
-0,        117,        117,        1,    38016, 0x1d501951
-0,        118,        118,        1,    38016, 0x36ae2e34
-0,        119,        119,        1,    38016, 0xe48b385f
-0,        120,        120,        1,    38016, 0xd88d3691
-0,        121,        121,        1,    38016, 0xf38f3ad4
-0,        122,        122,        1,    38016, 0x2a0e256e
-0,        123,        123,        1,    38016, 0x0c25fbbd
-0,        124,        124,        1,    38016, 0x13dbd8fc
-0,        125,        125,        1,    38016, 0x8c4dc0b1
-0,        126,        126,        1,    38016, 0x054bb5d5
-0,        127,        127,        1,    38016, 0x19f8c259
-0,        128,        128,        1,    38016, 0x4037d8fd
-0,        129,        129,        1,    38016, 0x13f4ecda
-0,        130,        130,        1,    38016, 0xde8af5a1
-0,        131,        131,        1,    38016, 0x5997f541
-0,        132,        132,        1,    38016, 0x876bebfe
-0,        133,        133,        1,    38016, 0x7322ef36
-0,        134,        134,        1,    38016, 0xe6a7ecc3
-0,        135,        135,        1,    38016, 0x20e5a1eb
-0,        136,        136,        1,    38016, 0xd1e5b985
-0,        137,        137,        1,    38016, 0xe83cb437
-0,        138,        138,        1,    38016, 0x8928a6f2
-0,        139,        139,        1,    38016, 0xc6b1a7f4
-0,        140,        140,        1,    38016, 0xcaf79531
-0,        141,        141,        1,    38016, 0x3ded956e
-0,        142,        142,        1,    38016, 0x494b82c5
-0,        143,        143,        1,    38016, 0x86cb794a
-0,        144,        144,        1,    38016, 0x548687e6
-0,        145,        145,        1,    38016, 0x8f478a9f
-0,        146,        146,        1,    38016, 0x32a97cbb
-0,        147,        147,        1,    38016, 0x587b56cf
-0,        148,        148,        1,    38016, 0x933428a9
-0,        149,        149,        1,    38016, 0xcb610212
-0,        150,        150,        1,    38016, 0x0d27b12d
-0,        151,        151,        1,    38016, 0xf5a9b7e0
-0,        152,        152,        1,    38016, 0x5287bdb7
-0,        153,        153,        1,    38016, 0xa4e9b762
-0,        154,        154,        1,    38016, 0x289da6d8
-0,        155,        155,        1,    38016, 0x1969bb3e
-0,        156,        156,        1,    38016, 0x29cbe019
-0,        157,        157,        1,    38016, 0xe01403c6
-0,        158,        158,        1,    38016, 0xce003f90
-0,        159,        159,        1,    38016, 0x455d67e1
-0,        160,        160,        1,    38016, 0xb57f7724
-0,        161,        161,        1,    38016, 0x7fce73b9
-0,        162,        162,        1,    38016, 0x7f136bbe
-0,        163,        163,        1,    38016, 0xf096599f
-0,        164,        164,        1,    38016, 0xe6df4c3a
-0,        165,        165,        1,    38016, 0x98d2f70e
-0,        166,        166,        1,    38016, 0xb500f2d7
-0,        167,        167,        1,    38016, 0x95d3ce30
-0,        168,        168,        1,    38016, 0x02a9ae41
-0,        169,        169,        1,    38016, 0xb146a958
-0,        170,        170,        1,    38016, 0x86a0bf3d
-0,        171,        171,        1,    38016, 0x0c58d90a
-0,        172,        172,        1,    38016, 0x27aef37f
-0,        173,        173,        1,    38016, 0x3933fc3e
-0,        174,        174,        1,    38016, 0x9ce9dc1c
-0,        175,        175,        1,    38016, 0x3161ac45
-0,        176,        176,        1,    38016, 0x4e8174cd
-0,        177,        177,        1,    38016, 0xd8904d4b
-0,        178,        178,        1,    38016, 0x933c2a55
-0,        179,        179,        1,    38016, 0x85371555
-0,        180,        180,        1,    38016, 0x3bb3ecd3
-0,        181,        181,        1,    38016, 0x6b6ad873
-0,        182,        182,        1,    38016, 0xa04dcf64
-0,        183,        183,        1,    38016, 0x7869dc82
-0,        184,        184,        1,    38016, 0x1c11e371
-0,        185,        185,        1,    38016, 0x91eef557
-0,        186,        186,        1,    38016, 0x27a30e42
-0,        187,        187,        1,    38016, 0xcba73491
-0,        188,        188,        1,    38016, 0xdffc402e
-0,        189,        189,        1,    38016, 0x49b543c6
-0,        190,        190,        1,    38016, 0xe3f7f438
-0,        191,        191,        1,    38016, 0xed3ec663
-0,        192,        192,        1,    38016, 0x174ad199
-0,        193,        193,        1,    38016, 0x5330eef8
-0,        194,        194,        1,    38016, 0x19d9074b
-0,        195,        195,        1,    38016, 0x25961ad1
-0,        196,        196,        1,    38016, 0x63024e80
-0,        197,        197,        1,    38016, 0x25de6e2e
-0,        198,        198,        1,    38016, 0x4cc594e8
-0,        199,        199,        1,    38016, 0x8b25afcf
-0,        200,        200,        1,    38016, 0x7b29bfcf
-0,        201,        201,        1,    38016, 0x93abce16
-0,        202,        202,        1,    38016, 0xc7f1d8fb
-0,        203,        203,        1,    38016, 0x277ed79e
-0,        204,        204,        1,    38016, 0x30dbdfe4
-0,        205,        205,        1,    38016, 0xbd8be711
-0,        206,        206,        1,    38016, 0xf072ea62
-0,        207,        207,        1,    38016, 0xbfd0e5a5
-0,        208,        208,        1,    38016, 0xedffdb3d
-0,        209,        209,        1,    38016, 0x5238cb59
-0,        210,        210,        1,    38016, 0x39305ec1
-0,        211,        211,        1,    38016, 0x07816d20
-0,        212,        212,        1,    38016, 0x61416e5b
-0,        213,        213,        1,    38016, 0xc39d6ae2
-0,        214,        214,        1,    38016, 0x1de95fe1
-0,        215,        215,        1,    38016, 0x0530552f
-0,        216,        216,        1,    38016, 0xa48f5b19
-0,        217,        217,        1,    38016, 0x11305e31
-0,        218,        218,        1,    38016, 0x9ae25bda
-0,        219,        219,        1,    38016, 0xf16e5b67
-0,        220,        220,        1,    38016, 0x9a375284
-0,        221,        221,        1,    38016, 0x5a744019
-0,        222,        222,        1,    38016, 0x811631e5
-0,        223,        223,        1,    38016, 0x178a20e6
-0,        224,        224,        1,    38016, 0xcab02bf2
-0,        225,        225,        1,    38016, 0x6fca13cb
-0,        226,        226,        1,    38016, 0xa1a71ba8
-0,        227,        227,        1,    38016, 0x95f52de5
-0,        228,        228,        1,    38016, 0xd2744451
-0,        229,        229,        1,    38016, 0x717f6ef6
-0,        230,        230,        1,    38016, 0x1f9e8ca9
-0,        231,        231,        1,    38016, 0xc931b115
-0,        232,        232,        1,    38016, 0xa4c1db05
-0,        233,        233,        1,    38016, 0x92e80cc1
-0,        234,        234,        1,    38016, 0x5ac5276c
-0,        235,        235,        1,    38016, 0x624340ca
-0,        236,        236,        1,    38016, 0x774a5a7c
-0,        237,        237,        1,    38016, 0x1da55863
-0,        238,        238,        1,    38016, 0x1bbc3b98
-0,        239,        239,        1,    38016, 0x953b1479
-0,        240,        240,        1,    38016, 0x8b11e5a8
-0,        241,        241,        1,    38016, 0xf749d359
-0,        242,        242,        1,    38016, 0xb54fcb8a
-0,        243,        243,        1,    38016, 0xb64b1951
-0,        244,        244,        1,    38016, 0x99778550
-0,        245,        245,        1,    38016, 0x5e70e9e2
-0,        246,        246,        1,    38016, 0x22550b80
-0,        247,        247,        1,    38016, 0xfe3ddcde
-0,        248,        248,        1,    38016, 0x1e28989e
-0,        249,        249,        1,    38016, 0x25b926a4
-0,        250,        250,        1,    38016, 0xf2c3c536
-0,        251,        251,        1,    38016, 0x534a8643
-0,        252,        252,        1,    38016, 0xf44b7f07
-0,        253,        253,        1,    38016, 0x2873c895
-0,        254,        254,        1,    38016, 0x67a7388d
-0,        255,        255,        1,    38016, 0x0e5eca3b
-0,        256,        256,        1,    38016, 0xc50dc747
-0,        257,        257,        1,    38016, 0x6a3a4f1e
-0,        258,        258,        1,    38016, 0x77d83b5f
-0,        259,        259,        1,    38016, 0x91213d43
-0,        260,        260,        1,    38016, 0x28344889
-0,        261,        261,        1,    38016, 0xd1155a3f
-0,        262,        262,        1,    38016, 0x5c7a65c5
-0,        263,        263,        1,    38016, 0x3d4e7104
-0,        264,        264,        1,    38016, 0x91d96a37
-0,        265,        265,        1,    38016, 0xbc7f63f3
-0,        266,        266,        1,    38016, 0x79275184
-0,        267,        267,        1,    38016, 0xa6b43348
-0,        268,        268,        1,    38016, 0x9e1d105a
-0,        269,        269,        1,    38016, 0x14bce053
-0,        270,        270,        1,    38016, 0x0ce3a7ca
-0,        271,        271,        1,    38016, 0x4b5980fe
-0,        272,        272,        1,    38016, 0x32745e1c
-0,        273,        273,        1,    38016, 0x85b91358
-0,        274,        274,        1,    38016, 0x9e26c66c
-0,        275,        275,        1,    38016, 0x9735b157
-0,        276,        276,        1,    38016, 0xfeaac3d1
-0,        277,        277,        1,    38016, 0x8c95ca9f
-0,        278,        278,        1,    38016, 0x1336fa92
-0,        279,        279,        1,    38016, 0x37bb65f8
-0,        280,        280,        1,    38016, 0x830c078a
-0,        281,        281,        1,    38016, 0x088dd912
-0,        282,        282,        1,    38016, 0x8ef1a5a0
-0,        283,        283,        1,    38016, 0x9a1e642d
-0,        284,        284,        1,    38016, 0xa165517e
-0,        285,        285,        1,    38016, 0x0a34a67f
-0,        286,        286,        1,    38016, 0xaf0a662a
-0,        287,        287,        1,    38016, 0x3a5fa553
-0,        288,        288,        1,    38016, 0xda92b1f8
-0,        289,        289,        1,    38016, 0xac2997f4
-0,        290,        290,        1,    38016, 0x5df32cfc
-0,        291,        291,        1,    38016, 0x5cea491d
-0,        292,        292,        1,    38016, 0xeafbd139
-0,        293,        293,        1,    38016, 0x9ced0e69
-0,        294,        294,        1,    38016, 0x89514e3f
-0,        295,        295,        1,    38016, 0x3f0b4842
-0,        296,        296,        1,    38016, 0xc9902325
-0,        297,        297,        1,    38016, 0xdb3e1585
-0,        298,        298,        1,    38016, 0x3cf31e95
-0,        299,        299,        1,    38016, 0x60f14679
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canl2_sva_b b/deps/libav/tests/ref/fate/h264-conformance-canl2_sva_b
deleted file mode 100644
index 0436f43..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canl2_sva_b
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x0bd22424
-0,          1,          1,        1,    38016, 0x4eb601f0
-0,          2,          2,        1,    38016, 0xe16de459
-0,          3,          3,        1,    38016, 0xde2e0c37
-0,          4,          4,        1,    38016, 0x14a0286b
-0,          5,          5,        1,    38016, 0x37bc35b5
-0,          6,          6,        1,    38016, 0xcfa24923
-0,          7,          7,        1,    38016, 0xac755ba0
-0,          8,          8,        1,    38016, 0x27d1822a
-0,          9,          9,        1,    38016, 0xa8039548
-0,         10,         10,        1,    38016, 0x400ea1fb
-0,         11,         11,        1,    38016, 0x7d2ca44a
-0,         12,         12,        1,    38016, 0xd42dae4f
-0,         13,         13,        1,    38016, 0x39ce9599
-0,         14,         14,        1,    38016, 0x37498aa1
-0,         15,         15,        1,    38016, 0x8558911f
-0,         16,         16,        1,    38016, 0x06a8a9ad
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canl3_sony_c b/deps/libav/tests/ref/fate/h264-conformance-canl3_sony_c
deleted file mode 100644
index 2e726cf..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canl3_sony_c
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xc805351d
-0,          1,          1,        1,    38016, 0xa0b41fef
-0,          2,          2,        1,    38016, 0x965cf070
-0,          3,          3,        1,    38016, 0x4552af45
-0,          4,          4,        1,    38016, 0x8429a576
-0,          5,          5,        1,    38016, 0xf6df8fc0
-0,          6,          6,        1,    38016, 0x5d85554c
-0,          7,          7,        1,    38016, 0x9c9d5b96
-0,          8,          8,        1,    38016, 0xbc4a4b71
-0,          9,          9,        1,    38016, 0xae4d3fc8
-0,         10,         10,        1,    38016, 0xf4da7f25
-0,         11,         11,        1,    38016, 0xf7d89a46
-0,         12,         12,        1,    38016, 0x204977fd
-0,         13,         13,        1,    38016, 0xa505b626
-0,         14,         14,        1,    38016, 0xc7b8b3f8
-0,         15,         15,        1,    38016, 0x96929e05
-0,         16,         16,        1,    38016, 0xfcfab8cc
-0,         17,         17,        1,    38016, 0x750caf2d
-0,         18,         18,        1,    38016, 0xa2c682ca
-0,         19,         19,        1,    38016, 0x3dcd8f07
-0,         20,         20,        1,    38016, 0x48fb69b3
-0,         21,         21,        1,    38016, 0x128e3310
-0,         22,         22,        1,    38016, 0x03803338
-0,         23,         23,        1,    38016, 0x11362bda
-0,         24,         24,        1,    38016, 0xc672229a
-0,         25,         25,        1,    38016, 0x68e540d0
-0,         26,         26,        1,    38016, 0x9d3a3deb
-0,         27,         27,        1,    38016, 0x53b233af
-0,         28,         28,        1,    38016, 0x3c6767eb
-0,         29,         29,        1,    38016, 0x2a8d75f2
-0,         30,         30,        1,    38016, 0x006f63cc
-0,         31,         31,        1,    38016, 0x3652a79e
-0,         32,         32,        1,    38016, 0x42f8c0fa
-0,         33,         33,        1,    38016, 0x052eb292
-0,         34,         34,        1,    38016, 0xbe7de0e7
-0,         35,         35,        1,    38016, 0xf9f9d46f
-0,         36,         36,        1,    38016, 0xb6d9b200
-0,         37,         37,        1,    38016, 0xc3bcd2d2
-0,         38,         38,        1,    38016, 0x23b5c8c2
-0,         39,         39,        1,    38016, 0x67caaf99
-0,         40,         40,        1,    38016, 0xb365cd31
-0,         41,         41,        1,    38016, 0x7cabc68f
-0,         42,         42,        1,    38016, 0xca8bb87a
-0,         43,         43,        1,    38016, 0x66a4be22
-0,         44,         44,        1,    38016, 0x2d10c1b0
-0,         45,         45,        1,    38016, 0xd1548835
-0,         46,         46,        1,    38016, 0x8b15b359
-0,         47,         47,        1,    38016, 0x2337b654
-0,         48,         48,        1,    38016, 0x56cfac2b
-0,         49,         49,        1,    38016, 0x7ad4c642
-0,         50,         50,        1,    38016, 0x6666c353
-0,         51,         51,        1,    38016, 0x053fb0f2
-0,         52,         52,        1,    38016, 0x2547c115
-0,         53,         53,        1,    38016, 0xf202c045
-0,         54,         54,        1,    38016, 0x94a8b95f
-0,         55,         55,        1,    38016, 0x439ccb13
-0,         56,         56,        1,    38016, 0xdfe4d54f
-0,         57,         57,        1,    38016, 0x2a0aceae
-0,         58,         58,        1,    38016, 0x1293dbd5
-0,         59,         59,        1,    38016, 0x9a62d994
-0,         60,         60,        1,    38016, 0x65539ad7
-0,         61,         61,        1,    38016, 0xc415ad58
-0,         62,         62,        1,    38016, 0x47bb9417
-0,         63,         63,        1,    38016, 0x92b745ea
-0,         64,         64,        1,    38016, 0x8fe8646e
-0,         65,         65,        1,    38016, 0x2b94857a
-0,         66,         66,        1,    38016, 0x12ac9aa4
-0,         67,         67,        1,    38016, 0x856bf0ea
-0,         68,         68,        1,    38016, 0xdbb32674
-0,         69,         69,        1,    38016, 0x96b53747
-0,         70,         70,        1,    38016, 0x875a7548
-0,         71,         71,        1,    38016, 0xdba4985c
-0,         72,         72,        1,    38016, 0x47cbb86c
-0,         73,         73,        1,    38016, 0x32dcfb99
-0,         74,         74,        1,    38016, 0x18b53b26
-0,         75,         75,        1,    38016, 0x2f0f3e49
-0,         76,         76,        1,    38016, 0x27b1880d
-0,         77,         77,        1,    38016, 0xbcc19dac
-0,         78,         78,        1,    38016, 0x7b6caeb1
-0,         79,         79,        1,    38016, 0xf3eece06
-0,         80,         80,        1,    38016, 0x7d93d4c9
-0,         81,         81,        1,    38016, 0xe6b8d923
-0,         82,         82,        1,    38016, 0xf47ce844
-0,         83,         83,        1,    38016, 0x74fce21c
-0,         84,         84,        1,    38016, 0x8e87d8cd
-0,         85,         85,        1,    38016, 0x9675d3ce
-0,         86,         86,        1,    38016, 0xd797ec75
-0,         87,         87,        1,    38016, 0x70aeeef1
-0,         88,         88,        1,    38016, 0x47baef32
-0,         89,         89,        1,    38016, 0x5054ec56
-0,         90,         90,        1,    38016, 0x43b6a0f7
-0,         91,         91,        1,    38016, 0x95dfb688
-0,         92,         92,        1,    38016, 0xc878a574
-0,         93,         93,        1,    38016, 0xeb928019
-0,         94,         94,        1,    38016, 0x304b7fec
-0,         95,         95,        1,    38016, 0x02cd7ea4
-0,         96,         96,        1,    38016, 0x505f7a7a
-0,         97,         97,        1,    38016, 0x09f59eaf
-0,         98,         98,        1,    38016, 0x513faaf7
-0,         99,         99,        1,    38016, 0xbd0daaa8
-0,        100,        100,        1,    38016, 0x8012be0f
-0,        101,        101,        1,    38016, 0xb663aa15
-0,        102,        102,        1,    38016, 0xd138981a
-0,        103,        103,        1,    38016, 0xc16b98a2
-0,        104,        104,        1,    38016, 0xf43eb8f8
-0,        105,        105,        1,    38016, 0xea22a35b
-0,        106,        106,        1,    38016, 0x9a0be0bb
-0,        107,        107,        1,    38016, 0x2a77ff9d
-0,        108,        108,        1,    38016, 0x2e350431
-0,        109,        109,        1,    38016, 0x9d0335ba
-0,        110,        110,        1,    38016, 0x62f23f21
-0,        111,        111,        1,    38016, 0x3e973351
-0,        112,        112,        1,    38016, 0x9d8f4ac5
-0,        113,        113,        1,    38016, 0x91e132ba
-0,        114,        114,        1,    38016, 0xfd04f69a
-0,        115,        115,        1,    38016, 0x481a1778
-0,        116,        116,        1,    38016, 0x27fa1dc4
-0,        117,        117,        1,    38016, 0x23ae0a6a
-0,        118,        118,        1,    38016, 0xc3ec426a
-0,        119,        119,        1,    38016, 0xc2a54ac1
-0,        120,        120,        1,    38016, 0xd88d3691
-0,        121,        121,        1,    38016, 0x46014ba7
-0,        122,        122,        1,    38016, 0xbf902815
-0,        123,        123,        1,    38016, 0x2af5ee16
-0,        124,        124,        1,    38016, 0xd183dc64
-0,        125,        125,        1,    38016, 0xf0c5bdd8
-0,        126,        126,        1,    38016, 0xb21aa102
-0,        127,        127,        1,    38016, 0xb35bbec2
-0,        128,        128,        1,    38016, 0x7efad1ce
-0,        129,        129,        1,    38016, 0x04e3d71d
-0,        130,        130,        1,    38016, 0x901ff71b
-0,        131,        131,        1,    38016, 0xc6c6e640
-0,        132,        132,        1,    38016, 0xd292d5d3
-0,        133,        133,        1,    38016, 0x2ce4e3fe
-0,        134,        134,        1,    38016, 0xe7fedf8a
-0,        135,        135,        1,    38016, 0x20e5a1eb
-0,        136,        136,        1,    38016, 0xbc39be76
-0,        137,        137,        1,    38016, 0xf749b4dd
-0,        138,        138,        1,    38016, 0xbc3f97a4
-0,        139,        139,        1,    38016, 0xa058a244
-0,        140,        140,        1,    38016, 0x77eb961b
-0,        141,        141,        1,    38016, 0xa92e7f25
-0,        142,        142,        1,    38016, 0xc75e796f
-0,        143,        143,        1,    38016, 0x114c79bd
-0,        144,        144,        1,    38016, 0x3fb96da3
-0,        145,        145,        1,    38016, 0x1c6f87b8
-0,        146,        146,        1,    38016, 0x25567ae4
-0,        147,        147,        1,    38016, 0xf5dd42b2
-0,        148,        148,        1,    38016, 0xe6172d0c
-0,        149,        149,        1,    38016, 0xcec0fd48
-0,        150,        150,        1,    38016, 0x0d27b12d
-0,        151,        151,        1,    38016, 0x3ec7cd24
-0,        152,        152,        1,    38016, 0xb2dccabe
-0,        153,        153,        1,    38016, 0xa977a844
-0,        154,        154,        1,    38016, 0x4b3bbfed
-0,        155,        155,        1,    38016, 0xed6dd876
-0,        156,        156,        1,    38016, 0x751bd34e
-0,        157,        157,        1,    38016, 0x80160cf9
-0,        158,        158,        1,    38016, 0xfbf53be8
-0,        159,        159,        1,    38016, 0x726e4f3b
-0,        160,        160,        1,    38016, 0x8ebb730c
-0,        161,        161,        1,    38016, 0x2c0c5fe6
-0,        162,        162,        1,    38016, 0x450940c0
-0,        163,        163,        1,    38016, 0xeed63ff8
-0,        164,        164,        1,    38016, 0x6f233d75
-0,        165,        165,        1,    38016, 0x98d2f70e
-0,        166,        166,        1,    38016, 0x8d38f2e8
-0,        167,        167,        1,    38016, 0x905dcbc9
-0,        168,        168,        1,    38016, 0x68c3a0f7
-0,        169,        169,        1,    38016, 0x4bb8a40c
-0,        170,        170,        1,    38016, 0x3650b08e
-0,        171,        171,        1,    38016, 0x3c3bbfd7
-0,        172,        172,        1,    38016, 0xcbc9da56
-0,        173,        173,        1,    38016, 0x576de6cd
-0,        174,        174,        1,    38016, 0x95f5c8c1
-0,        175,        175,        1,    38016, 0xbbcaacc8
-0,        176,        176,        1,    38016, 0x1b547ba4
-0,        177,        177,        1,    38016, 0x8f5238b2
-0,        178,        178,        1,    38016, 0x4c0f35c4
-0,        179,        179,        1,    38016, 0x894f278d
-0,        180,        180,        1,    38016, 0x3bb3ecd3
-0,        181,        181,        1,    38016, 0x177bf317
-0,        182,        182,        1,    38016, 0xdb1fdada
-0,        183,        183,        1,    38016, 0xec27cc28
-0,        184,        184,        1,    38016, 0x6a12eec7
-0,        185,        185,        1,    38016, 0x0168ff3f
-0,        186,        186,        1,    38016, 0x3fa206ba
-0,        187,        187,        1,    38016, 0x47cc30b5
-0,        188,        188,        1,    38016, 0xb2d02ddd
-0,        189,        189,        1,    38016, 0x306626bb
-0,        190,        190,        1,    38016, 0xfb06eb5b
-0,        191,        191,        1,    38016, 0x5881b60e
-0,        192,        192,        1,    38016, 0xd58caaf8
-0,        193,        193,        1,    38016, 0x840bdd0c
-0,        194,        194,        1,    38016, 0xb71efac1
-0,        195,        195,        1,    38016, 0x25961ad1
-0,        196,        196,        1,    38016, 0xbec156eb
-0,        197,        197,        1,    38016, 0xe2d1695c
-0,        198,        198,        1,    38016, 0x3fbe83d4
-0,        199,        199,        1,    38016, 0x10d8afe2
-0,        200,        200,        1,    38016, 0xa61fb9aa
-0,        201,        201,        1,    38016, 0x0c20be29
-0,        202,        202,        1,    38016, 0xc273cdd4
-0,        203,        203,        1,    38016, 0xfb21cfa0
-0,        204,        204,        1,    38016, 0xb1ccc643
-0,        205,        205,        1,    38016, 0x30f5d7a2
-0,        206,        206,        1,    38016, 0xe742da0f
-0,        207,        207,        1,    38016, 0x0a08d6a3
-0,        208,        208,        1,    38016, 0x85c4cf6c
-0,        209,        209,        1,    38016, 0xc117b8f4
-0,        210,        210,        1,    38016, 0x39305ec1
-0,        211,        211,        1,    38016, 0xf2867b2d
-0,        212,        212,        1,    38016, 0x81147a22
-0,        213,        213,        1,    38016, 0x308b59c3
-0,        214,        214,        1,    38016, 0xfd076bbd
-0,        215,        215,        1,    38016, 0x11bf57f5
-0,        216,        216,        1,    38016, 0x8c103fb7
-0,        217,        217,        1,    38016, 0x4f5e5a48
-0,        218,        218,        1,    38016, 0xa0fd54dc
-0,        219,        219,        1,    38016, 0x69d7429b
-0,        220,        220,        1,    38016, 0x93154a7c
-0,        221,        221,        1,    38016, 0xc72e3995
-0,        222,        222,        1,    38016, 0x86541ae0
-0,        223,        223,        1,    38016, 0xa9c93120
-0,        224,        224,        1,    38016, 0x602d368a
-0,        225,        225,        1,    38016, 0x6fca13cb
-0,        226,        226,        1,    38016, 0x314f3702
-0,        227,        227,        1,    38016, 0x4d1647bd
-0,        228,        228,        1,    38016, 0x73673c96
-0,        229,        229,        1,    38016, 0x62897c6f
-0,        230,        230,        1,    38016, 0x918e9a7d
-0,        231,        231,        1,    38016, 0x9fb9ad4f
-0,        232,        232,        1,    38016, 0xc4c30339
-0,        233,        233,        1,    38016, 0x137017df
-0,        234,        234,        1,    38016, 0xa98a1b61
-0,        235,        235,        1,    38016, 0xf74c4b4f
-0,        236,        236,        1,    38016, 0x3eac5cb1
-0,        237,        237,        1,    38016, 0x5d403e50
-0,        238,        238,        1,    38016, 0xa33a4eb6
-0,        239,        239,        1,    38016, 0x3f0a13fb
-0,        240,        240,        1,    38016, 0x8b11e5a8
-0,        241,        241,        1,    38016, 0x536bca4b
-0,        242,        242,        1,    38016, 0xe1daa789
-0,        243,        243,        1,    38016, 0xab37f6d1
-0,        244,        244,        1,    38016, 0xbefe6f58
-0,        245,        245,        1,    38016, 0xa5fdd2ff
-0,        246,        246,        1,    38016, 0x6065ec01
-0,        247,        247,        1,    38016, 0x939dd93a
-0,        248,        248,        1,    38016, 0x3a7593d5
-0,        249,        249,        1,    38016, 0x30fe19fe
-0,        250,        250,        1,    38016, 0xb507c21c
-0,        251,        251,        1,    38016, 0xf47f73ac
-0,        252,        252,        1,    38016, 0xe9fc669a
-0,        253,        253,        1,    38016, 0x2b85d19a
-0,        254,        254,        1,    38016, 0x57033999
-0,        255,        255,        1,    38016, 0x0e5eca3b
-0,        256,        256,        1,    38016, 0x6a7bda2c
-0,        257,        257,        1,    38016, 0x3517638d
-0,        258,        258,        1,    38016, 0x1f5432e3
-0,        259,        259,        1,    38016, 0x584d4c96
-0,        260,        260,        1,    38016, 0x92474c0c
-0,        261,        261,        1,    38016, 0x8c5e44a5
-0,        262,        262,        1,    38016, 0x07dd64d4
-0,        263,        263,        1,    38016, 0x828d632b
-0,        264,        264,        1,    38016, 0x142254b6
-0,        265,        265,        1,    38016, 0x8f9b60a4
-0,        266,        266,        1,    38016, 0x44f745dd
-0,        267,        267,        1,    38016, 0xc3321666
-0,        268,        268,        1,    38016, 0x95520396
-0,        269,        269,        1,    38016, 0x3eb3de27
-0,        270,        270,        1,    38016, 0x0ce3a7ca
-0,        271,        271,        1,    38016, 0x58258838
-0,        272,        272,        1,    38016, 0x5725627a
-0,        273,        273,        1,    38016, 0x901907ab
-0,        274,        274,        1,    38016, 0xf965da2f
-0,        275,        275,        1,    38016, 0xf542bae9
-0,        276,        276,        1,    38016, 0x3dc4b3c3
-0,        277,        277,        1,    38016, 0x8a1dd1e9
-0,        278,        278,        1,    38016, 0x4f6ef803
-0,        279,        279,        1,    38016, 0xde384800
-0,        280,        280,        1,    38016, 0x7251116f
-0,        281,        281,        1,    38016, 0x89f9e1ca
-0,        282,        282,        1,    38016, 0xc9818624
-0,        283,        283,        1,    38016, 0x30e391a6
-0,        284,        284,        1,    38016, 0x7aab6887
-0,        285,        285,        1,    38016, 0x0a34a67f
-0,        286,        286,        1,    38016, 0xe1258086
-0,        287,        287,        1,    38016, 0x5b16a887
-0,        288,        288,        1,    38016, 0x3297a135
-0,        289,        289,        1,    38016, 0x45a77236
-0,        290,        290,        1,    38016, 0xa414013a
-0,        291,        291,        1,    38016, 0xfab52c7e
-0,        292,        292,        1,    38016, 0x9074aca1
-0,        293,        293,        1,    38016, 0x843ad8a6
-0,        294,        294,        1,    38016, 0xccc63573
-0,        295,        295,        1,    38016, 0x3ba52a5f
-0,        296,        296,        1,    38016, 0x2f7b0236
-0,        297,        297,        1,    38016, 0x0ad407ec
-0,        298,        298,        1,    38016, 0x42082369
-0,        299,        299,        1,    38016, 0x5a9d3f63
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canl3_sva_b b/deps/libav/tests/ref/fate/h264-conformance-canl3_sva_b
deleted file mode 100644
index dd56a43..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canl3_sva_b
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x0bd22424
-0,          1,          1,        1,    38016, 0xc45d1947
-0,          2,          2,        1,    38016, 0x9d3d1218
-0,          3,          3,        1,    38016, 0x79b71e03
-0,          4,          4,        1,    38016, 0xd11e4a14
-0,          5,          5,        1,    38016, 0x44c66b22
-0,          6,          6,        1,    38016, 0xb9cc7acf
-0,          7,          7,        1,    38016, 0x8ccd92a1
-0,          8,          8,        1,    38016, 0x4a76aec4
-0,          9,          9,        1,    38016, 0x6e2fc27e
-0,         10,         10,        1,    38016, 0x400ea1fb
-0,         11,         11,        1,    38016, 0xd1e2b7c4
-0,         12,         12,        1,    38016, 0xb45eb08d
-0,         13,         13,        1,    38016, 0x15079991
-0,         14,         14,        1,    38016, 0x0fc97188
-0,         15,         15,        1,    38016, 0xf9fc81af
-0,         16,         16,        1,    38016, 0x020f992d
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canl4_sva_b b/deps/libav/tests/ref/fate/h264-conformance-canl4_sva_b
deleted file mode 100644
index a9a2dd3..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canl4_sva_b
+++ /dev/null
@@ -1,34 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x5d9514e3
-0,          1,          1,        1,    38016, 0xf5e8155c
-0,          2,          2,        1,    38016, 0xc0a5f88b
-0,          3,          3,        1,    38016, 0x421d2610
-0,          4,          4,        1,    38016, 0x971838af
-0,          5,          5,        1,    38016, 0xbd645dfc
-0,          6,          6,        1,    38016, 0xaab5626a
-0,          7,          7,        1,    38016, 0xc8fc9b6b
-0,          8,          8,        1,    38016, 0x8be593f4
-0,          9,          9,        1,    38016, 0x6560c0f4
-0,         10,         10,        1,    38016, 0x29009b56
-0,         11,         11,        1,    38016, 0x20b4bd2a
-0,         12,         12,        1,    38016, 0xe8a7a51e
-0,         13,         13,        1,    38016, 0x8c5e906a
-0,         14,         14,        1,    38016, 0x15496f1e
-0,         15,         15,        1,    38016, 0xdc788399
-0,         16,         16,        1,    38016, 0x2b1e89b2
-0,         17,         17,        1,    38016, 0xe9fda9bd
-0,         18,         18,        1,    38016, 0x7c319f69
-0,         19,         19,        1,    38016, 0x2921cbc4
-0,         20,         20,        1,    38016, 0xb4fab1e2
-0,         21,         21,        1,    38016, 0x6af6ba57
-0,         22,         22,        1,    38016, 0xb36e7df5
-0,         23,         23,        1,    38016, 0x57517aec
-0,         24,         24,        1,    38016, 0x9f5f331a
-0,         25,         25,        1,    38016, 0xafde3f8a
-0,         26,         26,        1,    38016, 0x97f32b54
-0,         27,         27,        1,    38016, 0x0c194bf7
-0,         28,         28,        1,    38016, 0x58a054c2
-0,         29,         29,        1,    38016, 0x6a637e5f
-0,         30,         30,        1,    38016, 0x8b2d63d0
-0,         31,         31,        1,    38016, 0x521772c5
-0,         32,         32,        1,    38016, 0xae555677
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canlma2_sony_c b/deps/libav/tests/ref/fate/h264-conformance-canlma2_sony_c
deleted file mode 100644
index b6a759a..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canlma2_sony_c
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xfbca00c6
-0,          1,          1,        1,   518400, 0x82b80adf
-0,          2,          2,        1,   518400, 0x87ecdf4a
-0,          3,          3,        1,   518400, 0xf6ca8cbe
-0,          4,          4,        1,   518400, 0x8e9bb8a0
-0,          5,          5,        1,   518400, 0x6512caa2
-0,          6,          6,        1,   518400, 0xc015e43e
-0,          7,          7,        1,   518400, 0x5f504a5c
-0,          8,          8,        1,   518400, 0x4c7458a4
-0,          9,          9,        1,   518400, 0x630f4004
-0,         10,         10,        1,   518400, 0x889af20e
-0,         11,         11,        1,   518400, 0x4437a5a4
-0,         12,         12,        1,   518400, 0x1e19a254
-0,         13,         13,        1,   518400, 0xb7ef1763
-0,         14,         14,        1,   518400, 0xc966c95a
-0,         15,         15,        1,   518400, 0x0c9074d6
-0,         16,         16,        1,   518400, 0x24c906c9
diff --git a/deps/libav/tests/ref/fate/h264-conformance-canlma3_sony_c b/deps/libav/tests/ref/fate/h264-conformance-canlma3_sony_c
deleted file mode 100644
index 87ce786..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-canlma3_sony_c
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xfbca00c6
-0,          1,          1,        1,   518400, 0x82b80adf
-0,          2,          2,        1,   518400, 0x4874c24c
-0,          3,          3,        1,   518400, 0xdb19528a
-0,          4,          4,        1,   518400, 0x27888656
-0,          5,          5,        1,   518400, 0x5e7aa98f
-0,          6,          6,        1,   518400, 0xb43ecd8b
-0,          7,          7,        1,   518400, 0xef772cbd
-0,          8,          8,        1,   518400, 0x4f1e1d7e
-0,          9,          9,        1,   518400, 0x0e9fe921
-0,         10,         10,        1,   518400, 0xe4dab3d2
-0,         11,         11,        1,   518400, 0x9279587b
-0,         12,         12,        1,   518400, 0xa8248296
-0,         13,         13,        1,   518400, 0x7be6c0d6
-0,         14,         14,        1,   518400, 0x85ea92b1
-0,         15,         15,        1,   518400, 0x0c9074d6
-0,         16,         16,        1,   518400, 0x5c95bf41
diff --git a/deps/libav/tests/ref/fate/h264-conformance-capa1_toshiba_b b/deps/libav/tests/ref/fate/h264-conformance-capa1_toshiba_b
deleted file mode 100644
index a0336f8..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-capa1_toshiba_b
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x4040d2fc
-0,          1,          1,        1,   152064, 0x0d8f9897
-0,          2,          2,        1,   152064, 0xc23321cd
-0,          3,          3,        1,   152064, 0x3c9225eb
-0,          4,          4,        1,   152064, 0x8927006f
-0,          5,          5,        1,   152064, 0xf706a302
-0,          6,          6,        1,   152064, 0x8219c106
-0,          7,          7,        1,   152064, 0x06c990ea
-0,          8,          8,        1,   152064, 0x3a0f1135
-0,          9,          9,        1,   152064, 0x4cff21d3
-0,         10,         10,        1,   152064, 0x6be0e050
-0,         11,         11,        1,   152064, 0x718b6c7b
-0,         12,         12,        1,   152064, 0x24b38713
-0,         13,         13,        1,   152064, 0x500553fb
-0,         14,         14,        1,   152064, 0x531ae610
-0,         15,         15,        1,   152064, 0x46f4ff1b
-0,         16,         16,        1,   152064, 0xe5abe5ff
-0,         17,         17,        1,   152064, 0x97daa351
-0,         18,         18,        1,   152064, 0xfbef0a8f
-0,         19,         19,        1,   152064, 0xbe76134f
-0,         20,         20,        1,   152064, 0xa4bf10ea
-0,         21,         21,        1,   152064, 0xb2fb32af
-0,         22,         22,        1,   152064, 0xd33027a5
-0,         23,         23,        1,   152064, 0x78e20c2b
-0,         24,         24,        1,   152064, 0xefda2d6f
-0,         25,         25,        1,   152064, 0xb99126f0
-0,         26,         26,        1,   152064, 0x89d7e465
-0,         27,         27,        1,   152064, 0x6150ff97
-0,         28,         28,        1,   152064, 0xde03d937
-0,         29,         29,        1,   152064, 0xd90ca874
-0,         30,         30,        1,   152064, 0xb120b294
-0,         31,         31,        1,   152064, 0x644eade4
-0,         32,         32,        1,   152064, 0xd1bb004f
-0,         33,         33,        1,   152064, 0x99806a8b
-0,         34,         34,        1,   152064, 0x8c6b635f
-0,         35,         35,        1,   152064, 0xa269fa8b
-0,         36,         36,        1,   152064, 0xc11c0e64
-0,         37,         37,        1,   152064, 0xac13f5eb
-0,         38,         38,        1,   152064, 0x895799cf
-0,         39,         39,        1,   152064, 0x95a9bea1
-0,         40,         40,        1,   152064, 0xe998dfba
-0,         41,         41,        1,   152064, 0xc72d8460
-0,         42,         42,        1,   152064, 0xd1cb9b9a
-0,         43,         43,        1,   152064, 0xb49aadd3
-0,         44,         44,        1,   152064, 0x8bc38547
-0,         45,         45,        1,   152064, 0x3485984b
-0,         46,         46,        1,   152064, 0xdf305c0a
-0,         47,         47,        1,   152064, 0x6a1ec990
-0,         48,         48,        1,   152064, 0x595e0de4
-0,         49,         49,        1,   152064, 0xe1baf7c4
-0,         50,         50,        1,   152064, 0xf08b9b47
-0,         51,         51,        1,   152064, 0x6532ba6f
-0,         52,         52,        1,   152064, 0x3de67da6
-0,         53,         53,        1,   152064, 0x439ffd04
-0,         54,         54,        1,   152064, 0x6e6c1e97
-0,         55,         55,        1,   152064, 0x8e5aee7a
-0,         56,         56,        1,   152064, 0xd634999a
-0,         57,         57,        1,   152064, 0xadfa9e8b
-0,         58,         58,        1,   152064, 0x1b9090f5
-0,         59,         59,        1,   152064, 0x29094dfc
-0,         60,         60,        1,   152064, 0x56748851
-0,         61,         61,        1,   152064, 0x2316719d
-0,         62,         62,        1,   152064, 0x2ee0060b
-0,         63,         63,        1,   152064, 0x3edb36d4
-0,         64,         64,        1,   152064, 0x9ef437a3
-0,         65,         65,        1,   152064, 0x8d9af72e
-0,         66,         66,        1,   152064, 0xab86389c
-0,         67,         67,        1,   152064, 0xd3b34576
-0,         68,         68,        1,   152064, 0x9e5b04f4
-0,         69,         69,        1,   152064, 0x6a164c17
-0,         70,         70,        1,   152064, 0xcecf20ab
-0,         71,         71,        1,   152064, 0x07c8e273
-0,         72,         72,        1,   152064, 0x9b46fe6a
-0,         73,         73,        1,   152064, 0xc1e8002b
-0,         74,         74,        1,   152064, 0xdebdbe53
-0,         75,         75,        1,   152064, 0x0d2dfd99
-0,         76,         76,        1,   152064, 0xe8ae925f
-0,         77,         77,        1,   152064, 0xe1fe6272
-0,         78,         78,        1,   152064, 0xbb74d5e6
-0,         79,         79,        1,   152064, 0xc7b5d949
-0,         80,         80,        1,   152064, 0x9b15b020
-0,         81,         81,        1,   152064, 0xc8201f44
-0,         82,         82,        1,   152064, 0x30d03303
-0,         83,         83,        1,   152064, 0x9f66fbc2
-0,         84,         84,        1,   152064, 0x482b71ec
-0,         85,         85,        1,   152064, 0x1c9e50bf
-0,         86,         86,        1,   152064, 0x89f247e4
-0,         87,         87,        1,   152064, 0xaa5f9141
-0,         88,         88,        1,   152064, 0xb816aa8c
-0,         89,         89,        1,   152064, 0x3112a619
diff --git a/deps/libav/tests/ref/fate/h264-conformance-capama3_sand_f b/deps/libav/tests/ref/fate/h264-conformance-capama3_sand_f
deleted file mode 100644
index b621b81..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-capama3_sand_f
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf772f152
-0,          1,          1,        1,   152064, 0xc416d300
-0,          2,          2,        1,   152064, 0xc2275c94
-0,          3,          3,        1,   152064, 0x1bd35645
-0,          4,          4,        1,   152064, 0x60327bf5
-0,          5,          5,        1,   152064, 0x7f5541bd
-0,          6,          6,        1,   152064, 0x52e5ebad
-0,          7,          7,        1,   152064, 0xb8e5c1f3
-0,          8,          8,        1,   152064, 0x2b4e3653
-0,          9,          9,        1,   152064, 0x9a8f8499
-0,         10,         10,        1,   152064, 0x32d4e9fb
-0,         11,         11,        1,   152064, 0x0bc73d7a
-0,         12,         12,        1,   152064, 0xb58a8b87
-0,         13,         13,        1,   152064, 0xddbc5468
-0,         14,         14,        1,   152064, 0xcfa30b64
-0,         15,         15,        1,   152064, 0xad411f36
-0,         16,         16,        1,   152064, 0x2f8c4d9b
-0,         17,         17,        1,   152064, 0xc8523359
-0,         18,         18,        1,   152064, 0x86be9861
-0,         19,         19,        1,   152064, 0x7518d731
-0,         20,         20,        1,   152064, 0x425fbfab
-0,         21,         21,        1,   152064, 0x4f00250d
-0,         22,         22,        1,   152064, 0x12b40617
-0,         23,         23,        1,   152064, 0x65ff925d
-0,         24,         24,        1,   152064, 0xc76a94c9
-0,         25,         25,        1,   152064, 0x640170d5
-0,         26,         26,        1,   152064, 0xd338a090
-0,         27,         27,        1,   152064, 0xce715174
-0,         28,         28,        1,   152064, 0x7bded195
-0,         29,         29,        1,   152064, 0x09e7d3b9
-0,         30,         30,        1,   152064, 0x651e1518
-0,         31,         31,        1,   152064, 0x03cadc5f
-0,         32,         32,        1,   152064, 0x08906919
-0,         33,         33,        1,   152064, 0x3303ebe0
-0,         34,         34,        1,   152064, 0xa28676c5
-0,         35,         35,        1,   152064, 0x3900ecaf
-0,         36,         36,        1,   152064, 0xeb795a05
-0,         37,         37,        1,   152064, 0x870034df
-0,         38,         38,        1,   152064, 0x69b0527a
-0,         39,         39,        1,   152064, 0xb2b314f9
-0,         40,         40,        1,   152064, 0x1a44ea1a
-0,         41,         41,        1,   152064, 0xe6eaec87
-0,         42,         42,        1,   152064, 0xd9ad818e
-0,         43,         43,        1,   152064, 0x9c7ff76e
-0,         44,         44,        1,   152064, 0x74c45abb
-0,         45,         45,        1,   152064, 0x2f4fa5c6
-0,         46,         46,        1,   152064, 0x19620702
-0,         47,         47,        1,   152064, 0xfc9601f3
-0,         48,         48,        1,   152064, 0x33e0d8e7
-0,         49,         49,        1,   152064, 0xdf7f2a80
diff --git a/deps/libav/tests/ref/fate/h264-conformance-capcm1_sand_e b/deps/libav/tests/ref/fate/h264-conformance-capcm1_sand_e
deleted file mode 100644
index 392e8b4..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-capcm1_sand_e
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x9989b588
-0,          1,          1,        1,   152064, 0x7cbf85d4
-0,          2,          2,        1,   152064, 0x72615cf1
-0,          3,          3,        1,   152064, 0xcf98053c
-0,          4,          4,        1,   152064, 0x42daddb0
-0,          5,          5,        1,   152064, 0x460ca616
-0,          6,          6,        1,   152064, 0x54cc5ab1
-0,          7,          7,        1,   152064, 0xd146396e
-0,          8,          8,        1,   152064, 0xefbbffc3
-0,          9,          9,        1,   152064, 0x41ecd870
-0,         10,         10,        1,   152064, 0x57bba322
-0,         11,         11,        1,   152064, 0x7e7270f8
-0,         12,         12,        1,   152064, 0x1f5d1f0e
-0,         13,         13,        1,   152064, 0x5478eb60
-0,         14,         14,        1,   152064, 0xd9abb62a
-0,         15,         15,        1,   152064, 0x97997f6d
-0,         16,         16,        1,   152064, 0xfc405569
-0,         17,         17,        1,   152064, 0x4e49329b
-0,         18,         18,        1,   152064, 0x6b98f9c6
-0,         19,         19,        1,   152064, 0xa872cf59
-0,         20,         20,        1,   152064, 0x478a897d
-0,         21,         21,        1,   152064, 0xf6744e5d
-0,         22,         22,        1,   152064, 0x7ddf110d
-0,         23,         23,        1,   152064, 0xe6bde4be
-0,         24,         24,        1,   152064, 0x5c3ba029
-0,         25,         25,        1,   152064, 0x07759146
-0,         26,         26,        1,   152064, 0x4beb510f
-0,         27,         27,        1,   152064, 0x5b063ad9
-0,         28,         28,        1,   152064, 0xc2930366
-0,         29,         29,        1,   152064, 0x5435e658
diff --git a/deps/libav/tests/ref/fate/h264-conformance-capcmnl1_sand_e b/deps/libav/tests/ref/fate/h264-conformance-capcmnl1_sand_e
deleted file mode 100644
index baee0ae..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-capcmnl1_sand_e
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf973b384
-0,          1,          1,        1,   152064, 0x84418532
-0,          2,          2,        1,   152064, 0x63165bc0
-0,          3,          3,        1,   152064, 0x54b5049d
-0,          4,          4,        1,   152064, 0xde66dbbc
-0,          5,          5,        1,   152064, 0x8001a4f5
-0,          6,          6,        1,   152064, 0x6b5259b7
-0,          7,          7,        1,   152064, 0xd15137a1
-0,          8,          8,        1,   152064, 0x1d19fdb9
-0,          9,          9,        1,   152064, 0x3533d5a1
-0,         10,         10,        1,   152064, 0xf82ba039
-0,         11,         11,        1,   152064, 0x04366ee9
-0,         12,         12,        1,   152064, 0xf7ac1dfb
-0,         13,         13,        1,   152064, 0x6d0aebd7
-0,         14,         14,        1,   152064, 0x4f2bb62d
-0,         15,         15,        1,   152064, 0x6a7a7d50
-0,         16,         16,        1,   152064, 0xc9c95422
-0,         17,         17,        1,   152064, 0x35a13150
-0,         18,         18,        1,   152064, 0xb576f7e4
-0,         19,         19,        1,   152064, 0x5ad3cde5
-0,         20,         20,        1,   152064, 0xbcb18908
-0,         21,         21,        1,   152064, 0xa2a24ca7
-0,         22,         22,        1,   152064, 0x95700ea5
-0,         23,         23,        1,   152064, 0xfdb5e316
-0,         24,         24,        1,   152064, 0x56e3a003
-0,         25,         25,        1,   152064, 0x09ae905c
-0,         26,         26,        1,   152064, 0xa1175024
-0,         27,         27,        1,   152064, 0x8b82395e
-0,         28,         28,        1,   152064, 0x032202da
-0,         29,         29,        1,   152064, 0xae15e5e7
diff --git a/deps/libav/tests/ref/fate/h264-conformance-capm3_sony_d b/deps/libav/tests/ref/fate/h264-conformance-capm3_sony_d
deleted file mode 100644
index ab2b280..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-capm3_sony_d
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xa3b72d2f
-0,          1,          1,        1,    38016, 0x77d918ae
-0,          2,          2,        1,    38016, 0x181ad684
-0,          3,          3,        1,    38016, 0x0dafa49c
-0,          4,          4,        1,    38016, 0x8250a733
-0,          5,          5,        1,    38016, 0x5d4f79b5
-0,          6,          6,        1,    38016, 0x59664665
-0,          7,          7,        1,    38016, 0xdce3491c
-0,          8,          8,        1,    38016, 0xaffc395f
-0,          9,          9,        1,    38016, 0xfb09320d
-0,         10,         10,        1,    38016, 0x9b776724
-0,         11,         11,        1,    38016, 0x30497da7
-0,         12,         12,        1,    38016, 0xffd16ea0
-0,         13,         13,        1,    38016, 0x5b7da1b5
-0,         14,         14,        1,    38016, 0x764a9cc4
-0,         15,         15,        1,    38016, 0xc4c79c41
-0,         16,         16,        1,    38016, 0x883299dd
-0,         17,         17,        1,    38016, 0xd5f39350
-0,         18,         18,        1,    38016, 0x892f6808
-0,         19,         19,        1,    38016, 0x5b0572d7
-0,         20,         20,        1,    38016, 0x53c84a0c
-0,         21,         21,        1,    38016, 0xe6ff14e2
-0,         22,         22,        1,    38016, 0xd66d1924
-0,         23,         23,        1,    38016, 0x7bec105f
-0,         24,         24,        1,    38016, 0x405ffc8d
-0,         25,         25,        1,    38016, 0xfccc2019
-0,         26,         26,        1,    38016, 0x639f25a2
-0,         27,         27,        1,    38016, 0xf89e179b
-0,         28,         28,        1,    38016, 0x3e49456e
-0,         29,         29,        1,    38016, 0x8d7d5d8e
-0,         30,         30,        1,    38016, 0x89d15f1e
-0,         31,         31,        1,    38016, 0x413d8c6a
-0,         32,         32,        1,    38016, 0xf1a0a555
-0,         33,         33,        1,    38016, 0x61249a1f
-0,         34,         34,        1,    38016, 0xbd91c000
-0,         35,         35,        1,    38016, 0x3209c225
-0,         36,         36,        1,    38016, 0xfebca72f
-0,         37,         37,        1,    38016, 0x839abdfd
-0,         38,         38,        1,    38016, 0xa47cbc00
-0,         39,         39,        1,    38016, 0x4537a269
-0,         40,         40,        1,    38016, 0xbf19c0b2
-0,         41,         41,        1,    38016, 0x7487c290
-0,         42,         42,        1,    38016, 0xfbf8ab0c
-0,         43,         43,        1,    38016, 0xce2ab41e
-0,         44,         44,        1,    38016, 0xb505acf2
-0,         45,         45,        1,    38016, 0x758489bc
-0,         46,         46,        1,    38016, 0x7eae9aca
-0,         47,         47,        1,    38016, 0x67b59692
-0,         48,         48,        1,    38016, 0x074d9354
-0,         49,         49,        1,    38016, 0xb6f6ae8a
-0,         50,         50,        1,    38016, 0xe3b9a825
-0,         51,         51,        1,    38016, 0x5f4e9cb2
-0,         52,         52,        1,    38016, 0x88b3abcd
-0,         53,         53,        1,    38016, 0x0cd7acdb
-0,         54,         54,        1,    38016, 0xa731a3e4
-0,         55,         55,        1,    38016, 0x9414c055
-0,         56,         56,        1,    38016, 0x6cfec34a
-0,         57,         57,        1,    38016, 0x6c89bce0
-0,         58,         58,        1,    38016, 0xdabdc781
-0,         59,         59,        1,    38016, 0x1afcc587
-0,         60,         60,        1,    38016, 0xb4e79851
-0,         61,         61,        1,    38016, 0x383ca78a
-0,         62,         62,        1,    38016, 0x461f83fb
-0,         63,         63,        1,    38016, 0x55f039e3
-0,         64,         64,        1,    38016, 0xb6ec5d3f
-0,         65,         65,        1,    38016, 0x645888af
-0,         66,         66,        1,    38016, 0x37bc9e52
-0,         67,         67,        1,    38016, 0x12a4f603
-0,         68,         68,        1,    38016, 0x63e92df7
-0,         69,         69,        1,    38016, 0x1a0246e3
-0,         70,         70,        1,    38016, 0x1a6282fe
-0,         71,         71,        1,    38016, 0x4e99a785
-0,         72,         72,        1,    38016, 0xdaefbf23
-0,         73,         73,        1,    38016, 0x9e8f00f1
-0,         74,         74,        1,    38016, 0x85ea26c5
-0,         75,         75,        1,    38016, 0x495e2ddb
-0,         76,         76,        1,    38016, 0xab6278a4
-0,         77,         77,        1,    38016, 0x48a78708
-0,         78,         78,        1,    38016, 0x6fe99535
-0,         79,         79,        1,    38016, 0xc3d9b8eb
-0,         80,         80,        1,    38016, 0x4491c577
-0,         81,         81,        1,    38016, 0x4d42cc30
-0,         82,         82,        1,    38016, 0x3469d8bd
-0,         83,         83,        1,    38016, 0x563dd0ad
-0,         84,         84,        1,    38016, 0x681dbdef
-0,         85,         85,        1,    38016, 0x5da9d2a7
-0,         86,         86,        1,    38016, 0x75abdf2e
-0,         87,         87,        1,    38016, 0x9bf0d13a
-0,         88,         88,        1,    38016, 0x3c24dd7c
-0,         89,         89,        1,    38016, 0x5132df96
-0,         90,         90,        1,    38016, 0x01bd9d86
-0,         91,         91,        1,    38016, 0x2b97bdfe
-0,         92,         92,        1,    38016, 0xa7fdb2f1
-0,         93,         93,        1,    38016, 0xcf908cfd
-0,         94,         94,        1,    38016, 0xd18e7e52
-0,         95,         95,        1,    38016, 0x6a1d78d3
-0,         96,         96,        1,    38016, 0xd9cc83af
-0,         97,         97,        1,    38016, 0xf6329ca1
-0,         98,         98,        1,    38016, 0x1976aaeb
-0,         99,         99,        1,    38016, 0xa3e8a3ce
-0,        100,        100,        1,    38016, 0x73a2bd65
-0,        101,        101,        1,    38016, 0xfd00a552
-0,        102,        102,        1,    38016, 0x2df18642
-0,        103,        103,        1,    38016, 0x85ad82fb
-0,        104,        104,        1,    38016, 0x0456a864
-0,        105,        105,        1,    38016, 0x0d6da3b6
-0,        106,        106,        1,    38016, 0xabf0de94
-0,        107,        107,        1,    38016, 0x68aef77e
-0,        108,        108,        1,    38016, 0xd6aefd84
-0,        109,        109,        1,    38016, 0x01953184
-0,        110,        110,        1,    38016, 0xff324067
-0,        111,        111,        1,    38016, 0x49aa300f
-0,        112,        112,        1,    38016, 0xc146456b
-0,        113,        113,        1,    38016, 0xfe5c2980
-0,        114,        114,        1,    38016, 0x8f4df7eb
-0,        115,        115,        1,    38016, 0x137c1373
-0,        116,        116,        1,    38016, 0xfb9d1006
-0,        117,        117,        1,    38016, 0x7f5409f9
-0,        118,        118,        1,    38016, 0xa6ff29fc
-0,        119,        119,        1,    38016, 0xc63e3807
-0,        120,        120,        1,    38016, 0xd77c313a
-0,        121,        121,        1,    38016, 0xdd3832dd
-0,        122,        122,        1,    38016, 0xe70d140c
-0,        123,        123,        1,    38016, 0xa559d731
-0,        124,        124,        1,    38016, 0x3593d345
-0,        125,        125,        1,    38016, 0x7497ad8a
-0,        126,        126,        1,    38016, 0x9906919f
-0,        127,        127,        1,    38016, 0x18bfb034
-0,        128,        128,        1,    38016, 0xa4fbbd76
-0,        129,        129,        1,    38016, 0xbd6cc31c
-0,        130,        130,        1,    38016, 0x6ddde005
-0,        131,        131,        1,    38016, 0x0072dd5f
-0,        132,        132,        1,    38016, 0x62c5c5c0
-0,        133,        133,        1,    38016, 0x1093cf81
-0,        134,        134,        1,    38016, 0x46dbc9ff
-0,        135,        135,        1,    38016, 0x0269a169
-0,        136,        136,        1,    38016, 0xc96daa27
-0,        137,        137,        1,    38016, 0xa0319cf4
-0,        138,        138,        1,    38016, 0x1cae87fd
-0,        139,        139,        1,    38016, 0xf1a0977f
-0,        140,        140,        1,    38016, 0xc4d48a56
-0,        141,        141,        1,    38016, 0xd3b1704c
-0,        142,        142,        1,    38016, 0xd5e46a6c
-0,        143,        143,        1,    38016, 0xb73e68fb
-0,        144,        144,        1,    38016, 0xc0585fcf
-0,        145,        145,        1,    38016, 0x1b3978fe
-0,        146,        146,        1,    38016, 0xdda66c02
-0,        147,        147,        1,    38016, 0x581033d6
-0,        148,        148,        1,    38016, 0x0737185f
-0,        149,        149,        1,    38016, 0xa0c9f494
-0,        150,        150,        1,    38016, 0x916eae22
-0,        151,        151,        1,    38016, 0xfdf7d6cd
-0,        152,        152,        1,    38016, 0x6978ce4c
-0,        153,        153,        1,    38016, 0x6783b016
-0,        154,        154,        1,    38016, 0x528ac304
-0,        155,        155,        1,    38016, 0x245de0ae
-0,        156,        156,        1,    38016, 0x1dade956
-0,        157,        157,        1,    38016, 0xa8f316da
-0,        158,        158,        1,    38016, 0x95f04ca6
-0,        159,        159,        1,    38016, 0x76615822
-0,        160,        160,        1,    38016, 0x21de6ff4
-0,        161,        161,        1,    38016, 0x12be5e8b
-0,        162,        162,        1,    38016, 0x47ea3cbd
-0,        163,        163,        1,    38016, 0x113631b5
-0,        164,        164,        1,    38016, 0x546b2789
-0,        165,        165,        1,    38016, 0x0505f2bb
-0,        166,        166,        1,    38016, 0x90eee299
-0,        167,        167,        1,    38016, 0x305cb341
-0,        168,        168,        1,    38016, 0x5921841b
-0,        169,        169,        1,    38016, 0x1449922d
-0,        170,        170,        1,    38016, 0xca8f9f0a
-0,        171,        171,        1,    38016, 0x0daeab19
-0,        172,        172,        1,    38016, 0xde20dc27
-0,        173,        173,        1,    38016, 0xb6ffd92c
-0,        174,        174,        1,    38016, 0xedb1bc49
-0,        175,        175,        1,    38016, 0x4ccf9ff5
-0,        176,        176,        1,    38016, 0xfb636cd5
-0,        177,        177,        1,    38016, 0x9c562c3d
-0,        178,        178,        1,    38016, 0x0b021c95
-0,        179,        179,        1,    38016, 0x8da50f21
-0,        180,        180,        1,    38016, 0xa043ec8c
-0,        181,        181,        1,    38016, 0x0143f4f2
-0,        182,        182,        1,    38016, 0x77bece5b
-0,        183,        183,        1,    38016, 0x147ccc68
-0,        184,        184,        1,    38016, 0xa90cf948
-0,        185,        185,        1,    38016, 0x8764066e
-0,        186,        186,        1,    38016, 0x26c61821
-0,        187,        187,        1,    38016, 0x39dd3be4
-0,        188,        188,        1,    38016, 0xe2203c69
-0,        189,        189,        1,    38016, 0x00e73014
-0,        190,        190,        1,    38016, 0x0024f9eb
-0,        191,        191,        1,    38016, 0x3a0da880
-0,        192,        192,        1,    38016, 0x0336a353
-0,        193,        193,        1,    38016, 0x721ed897
-0,        194,        194,        1,    38016, 0x1c51f53f
-0,        195,        195,        1,    38016, 0xeec91a00
-0,        196,        196,        1,    38016, 0x73074864
-0,        197,        197,        1,    38016, 0x672e5ff8
-0,        198,        198,        1,    38016, 0xe7ea7aba
-0,        199,        199,        1,    38016, 0x11899f08
-0,        200,        200,        1,    38016, 0xa98daf03
-0,        201,        201,        1,    38016, 0x4553af5c
-0,        202,        202,        1,    38016, 0x4892c5d5
-0,        203,        203,        1,    38016, 0x0ddbc2eb
-0,        204,        204,        1,    38016, 0x0ce5b867
-0,        205,        205,        1,    38016, 0xb0e6ce2c
-0,        206,        206,        1,    38016, 0x8a2bd4da
-0,        207,        207,        1,    38016, 0xf9f4cbec
-0,        208,        208,        1,    38016, 0x77aeba8f
-0,        209,        209,        1,    38016, 0xc1839e46
-0,        210,        210,        1,    38016, 0x34845d3a
-0,        211,        211,        1,    38016, 0xc3227ad7
-0,        212,        212,        1,    38016, 0x2dad7051
-0,        213,        213,        1,    38016, 0x7145565a
-0,        214,        214,        1,    38016, 0x1e056ef1
-0,        215,        215,        1,    38016, 0x9baa5195
-0,        216,        216,        1,    38016, 0xacb53a1a
-0,        217,        217,        1,    38016, 0x825d4fb7
-0,        218,        218,        1,    38016, 0x63194b14
-0,        219,        219,        1,    38016, 0xcb16360e
-0,        220,        220,        1,    38016, 0x35104320
-0,        221,        221,        1,    38016, 0x7e4c33dc
-0,        222,        222,        1,    38016, 0x84811693
-0,        223,        223,        1,    38016, 0x242b1811
-0,        224,        224,        1,    38016, 0xb4af2667
-0,        225,        225,        1,    38016, 0x77a20da2
-0,        226,        226,        1,    38016, 0x8e4f36a8
-0,        227,        227,        1,    38016, 0xe72435cb
-0,        228,        228,        1,    38016, 0xf38a381b
-0,        229,        229,        1,    38016, 0xb2b876d6
-0,        230,        230,        1,    38016, 0x1c359b35
-0,        231,        231,        1,    38016, 0x4fb8b180
-0,        232,        232,        1,    38016, 0x90fdf94b
-0,        233,        233,        1,    38016, 0xb8680c40
-0,        234,        234,        1,    38016, 0x99331edd
-0,        235,        235,        1,    38016, 0xd8e3433d
-0,        236,        236,        1,    38016, 0x6d4d5aa2
-0,        237,        237,        1,    38016, 0x4c3545c4
-0,        238,        238,        1,    38016, 0x25b8376f
-0,        239,        239,        1,    38016, 0xc4fe09df
-0,        240,        240,        1,    38016, 0x6a9fe4f8
-0,        241,        241,        1,    38016, 0x8fd2c2f3
-0,        242,        242,        1,    38016, 0x78199f41
-0,        243,        243,        1,    38016, 0x27b6e9f0
-0,        244,        244,        1,    38016, 0xd8316400
-0,        245,        245,        1,    38016, 0x0a70cd14
-0,        246,        246,        1,    38016, 0x2075e91c
-0,        247,        247,        1,    38016, 0xcd3cd7cb
-0,        248,        248,        1,    38016, 0x4edc8cf5
-0,        249,        249,        1,    38016, 0xf02e0bc7
-0,        250,        250,        1,    38016, 0xcdd1b487
-0,        251,        251,        1,    38016, 0xea5f6c8f
-0,        252,        252,        1,    38016, 0x6b635e22
-0,        253,        253,        1,    38016, 0xd548c435
-0,        254,        254,        1,    38016, 0x455826ee
-0,        255,        255,        1,    38016, 0x120ac7ed
-0,        256,        256,        1,    38016, 0xf86adc5a
-0,        257,        257,        1,    38016, 0x8dbd5c4e
-0,        258,        258,        1,    38016, 0xe4c62dae
-0,        259,        259,        1,    38016, 0x0a2a3be7
-0,        260,        260,        1,    38016, 0xf8a243d7
-0,        261,        261,        1,    38016, 0x898a3afb
-0,        262,        262,        1,    38016, 0x39e661bb
-0,        263,        263,        1,    38016, 0xe4e65f22
-0,        264,        264,        1,    38016, 0x014846ff
-0,        265,        265,        1,    38016, 0xf392509c
-0,        266,        266,        1,    38016, 0x34623207
-0,        267,        267,        1,    38016, 0xac4a09ed
-0,        268,        268,        1,    38016, 0x9d18eb07
-0,        269,        269,        1,    38016, 0x4594c90e
-0,        270,        270,        1,    38016, 0x624f9b6b
-0,        271,        271,        1,    38016, 0x8adc89d3
-0,        272,        272,        1,    38016, 0xf4dd64f6
-0,        273,        273,        1,    38016, 0x4c121386
-0,        274,        274,        1,    38016, 0xfb5ddc7e
-0,        275,        275,        1,    38016, 0x837fc31e
-0,        276,        276,        1,    38016, 0xa4f4bd31
-0,        277,        277,        1,    38016, 0x0445def7
-0,        278,        278,        1,    38016, 0xbac0fe62
-0,        279,        279,        1,    38016, 0x050b5778
-0,        280,        280,        1,    38016, 0x3d0723e5
-0,        281,        281,        1,    38016, 0x9967eae7
-0,        282,        282,        1,    38016, 0xf4be9ec7
-0,        283,        283,        1,    38016, 0x870377d2
-0,        284,        284,        1,    38016, 0x5c9d648a
-0,        285,        285,        1,    38016, 0x2d41a44b
-0,        286,        286,        1,    38016, 0xa50e7c6f
-0,        287,        287,        1,    38016, 0x2bd1b477
-0,        288,        288,        1,    38016, 0xd123ae8d
-0,        289,        289,        1,    38016, 0xf2fc7a6b
-0,        290,        290,        1,    38016, 0xaa3ee416
-0,        291,        291,        1,    38016, 0x5f8801d6
-0,        292,        292,        1,    38016, 0xbee7924a
-0,        293,        293,        1,    38016, 0x6e47c3e1
-0,        294,        294,        1,    38016, 0xf34f1223
-0,        295,        295,        1,    38016, 0x7a610876
-0,        296,        296,        1,    38016, 0x15e9e47f
-0,        297,        297,        1,    38016, 0x557ddcf1
-0,        298,        298,        1,    38016, 0xf0cd02e2
-0,        299,        299,        1,    38016, 0xe98f1deb
diff --git a/deps/libav/tests/ref/fate/h264-conformance-caqp1_sony_b b/deps/libav/tests/ref/fate/h264-conformance-caqp1_sony_b
deleted file mode 100644
index beca1c5..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-caqp1_sony_b
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x25f92b0e
-0,          1,          1,        1,    38016, 0x2ecbe752
-0,          2,          2,        1,    38016, 0x3432e744
-0,          3,          3,        1,    38016, 0x7970aa2e
-0,          4,          4,        1,    38016, 0x250787bf
-0,          5,          5,        1,    38016, 0xd58e5e56
-0,          6,          6,        1,    38016, 0xf4b8580f
-0,          7,          7,        1,    38016, 0x9acb4096
-0,          8,          8,        1,    38016, 0xeed0476f
-0,          9,          9,        1,    38016, 0xe33846ef
-0,         10,         10,        1,    38016, 0x02da4e76
-0,         11,         11,        1,    38016, 0xd3e572f8
-0,         12,         12,        1,    38016, 0x5fd27f8a
-0,         13,         13,        1,    38016, 0xfa169823
-0,         14,         14,        1,    38016, 0xcc6b8d76
-0,         15,         15,        1,    38016, 0xcc4da11f
-0,         16,         16,        1,    38016, 0x32259b9d
-0,         17,         17,        1,    38016, 0xf1e39b70
-0,         18,         18,        1,    38016, 0xb49d7480
-0,         19,         19,        1,    38016, 0x3dc158e9
-0,         20,         20,        1,    38016, 0x4ce134db
-0,         21,         21,        1,    38016, 0x4fb30b43
-0,         22,         22,        1,    38016, 0xda49fe5f
-0,         23,         23,        1,    38016, 0x7fda0d68
-0,         24,         24,        1,    38016, 0x3a8b25e3
-0,         25,         25,        1,    38016, 0x3df11d4e
-0,         26,         26,        1,    38016, 0x26e11107
-0,         27,         27,        1,    38016, 0xdc3b03a7
-0,         28,         28,        1,    38016, 0x72b2434d
-0,         29,         29,        1,    38016, 0x2a013e27
-0,         30,         30,        1,    38016, 0xf95a4c2e
-0,         31,         31,        1,    38016, 0x1e7b6656
-0,         32,         32,        1,    38016, 0x776a81c8
-0,         33,         33,        1,    38016, 0x162cb0bf
-0,         34,         34,        1,    38016, 0x7ff4aaf5
-0,         35,         35,        1,    38016, 0x7150b50b
-0,         36,         36,        1,    38016, 0xf7d0b889
-0,         37,         37,        1,    38016, 0xbe09b5c2
-0,         38,         38,        1,    38016, 0xf6f7d29c
-0,         39,         39,        1,    38016, 0x4356b996
-0,         40,         40,        1,    38016, 0xb056c4b4
-0,         41,         41,        1,    38016, 0x38e9c6e6
-0,         42,         42,        1,    38016, 0x9c64ab45
-0,         43,         43,        1,    38016, 0x31189eef
-0,         44,         44,        1,    38016, 0x1ee3a3b1
-0,         45,         45,        1,    38016, 0x8bed7c95
-0,         46,         46,        1,    38016, 0x30357cee
-0,         47,         47,        1,    38016, 0x5d828428
-0,         48,         48,        1,    38016, 0xc06388b3
-0,         49,         49,        1,    38016, 0x2af597b4
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_fld0_full_b b/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_fld0_full_b
deleted file mode 100644
index f80c3be..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_fld0_full_b
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x99d0df36
-0,          1,          1,        1,   518400, 0xa8601c1a
-0,          2,          2,        1,   518400, 0x4a17d235
-0,          3,          3,        1,   518400, 0x75f23abf
-0,          4,          4,        1,   518400, 0x746aad53
-0,          5,          5,        1,   518400, 0xb0b8913e
-0,          6,          6,        1,   518400, 0x60a27f57
-0,          7,          7,        1,   518400, 0xfa227f3e
-0,          8,          8,        1,   518400, 0x7a1e57c2
-0,          9,          9,        1,   518400, 0xcbbaa84f
-0,         10,         10,        1,   518400, 0xf9c1bd13
-0,         11,         11,        1,   518400, 0x9e80caaf
-0,         12,         12,        1,   518400, 0x14cc6928
-0,         13,         13,        1,   518400, 0xca0353ef
-0,         14,         14,        1,   518400, 0xcad65e5f
-0,         15,         15,        1,   518400, 0xd5bc47b3
-0,         16,         16,        1,   518400, 0xa9893d36
-0,         17,         17,        1,   518400, 0x69bd9085
-0,         18,         18,        1,   518400, 0xff33c476
-0,         19,         19,        1,   518400, 0x9538adf7
-0,         20,         20,        1,   518400, 0xd4ff3b62
-0,         21,         21,        1,   518400, 0x021a11fd
-0,         22,         22,        1,   518400, 0x293e6f9f
-0,         23,         23,        1,   518400, 0x5d38e4c3
-0,         24,         24,        1,   518400, 0xd1f4ad49
-0,         25,         25,        1,   518400, 0xf13dd946
-0,         26,         26,        1,   518400, 0x0359e9ff
-0,         27,         27,        1,   518400, 0xb61098ad
-0,         28,         28,        1,   518400, 0xa855b11c
-0,         29,         29,        1,   518400, 0x7fcf9343
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_frm0_full_b b/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_frm0_full_b
deleted file mode 100644
index edee4bf..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_frm0_full_b
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x21baedbf
-0,          1,          1,        1,   518400, 0x6003273c
-0,          2,          2,        1,   518400, 0x935d45d7
-0,          3,          3,        1,   518400, 0x00485000
-0,          4,          4,        1,   518400, 0x31b191ff
-0,          5,          5,        1,   518400, 0xe334135a
-0,          6,          6,        1,   518400, 0xc4d7bf2c
-0,          7,          7,        1,   518400, 0x7106ac82
-0,          8,          8,        1,   518400, 0xeb277b07
-0,          9,          9,        1,   518400, 0xaf1ee80f
-0,         10,         10,        1,   518400, 0x8c7d1bad
-0,         11,         11,        1,   518400, 0x0e24ae6c
-0,         12,         12,        1,   518400, 0x89c216b4
-0,         13,         13,        1,   518400, 0x991fbcb1
-0,         14,         14,        1,   518400, 0x87411486
-0,         15,         15,        1,   518400, 0x0151b48f
-0,         16,         16,        1,   518400, 0x3f4d5a91
-0,         17,         17,        1,   518400, 0x48ea911b
-0,         18,         18,        1,   518400, 0x6bec19a0
-0,         19,         19,        1,   518400, 0x10233bf6
-0,         20,         20,        1,   518400, 0x2a36ae4d
-0,         21,         21,        1,   518400, 0xd8d3224b
-0,         22,         22,        1,   518400, 0xf5c5f81f
-0,         23,         23,        1,   518400, 0x30054561
-0,         24,         24,        1,   518400, 0x67ea1c9f
-0,         25,         25,        1,   518400, 0xbbda3984
-0,         26,         26,        1,   518400, 0x9af40c71
-0,         27,         27,        1,   518400, 0xb0cf0d12
-0,         28,         28,        1,   518400, 0x569b9866
-0,         29,         29,        1,   518400, 0xffd72ee5
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_mbaff0_full_b b/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_mbaff0_full_b
deleted file mode 100644
index 7d3ae3e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_mbaff0_full_b
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x4cecc821
-0,          1,          1,        1,   518400, 0xee49ea81
-0,          2,          2,        1,   518400, 0x78b0d65f
-0,          3,          3,        1,   518400, 0x7fa72010
-0,          4,          4,        1,   518400, 0xbc7fecdb
-0,          5,          5,        1,   518400, 0xe54cf951
-0,          6,          6,        1,   518400, 0x1e2795e0
-0,          7,          7,        1,   518400, 0x7db968b9
-0,          8,          8,        1,   518400, 0xcecb446b
-0,          9,          9,        1,   518400, 0x4f813fc5
-0,         10,         10,        1,   518400, 0xd0816131
-0,         11,         11,        1,   518400, 0x6cf66cb7
-0,         12,         12,        1,   518400, 0xac9913a1
-0,         13,         13,        1,   518400, 0x0a2dd6ae
-0,         14,         14,        1,   518400, 0x5de1acef
-0,         15,         15,        1,   518400, 0x5ac7741e
-0,         16,         16,        1,   518400, 0x4d2726de
-0,         17,         17,        1,   518400, 0x6b9b2677
-0,         18,         18,        1,   518400, 0x99b70e82
-0,         19,         19,        1,   518400, 0x6a01ed56
-0,         20,         20,        1,   518400, 0xa6976f95
-0,         21,         21,        1,   518400, 0x645f6562
-0,         22,         22,        1,   518400, 0xf750796b
-0,         23,         23,        1,   518400, 0xe381ee9c
-0,         24,         24,        1,   518400, 0xb7d45f84
-0,         25,         25,        1,   518400, 0x7c9d79df
-0,         26,         26,        1,   518400, 0x8a306a11
-0,         27,         27,        1,   518400, 0x766fcf15
-0,         28,         28,        1,   518400, 0x45c3cbdd
-0,         29,         29,        1,   518400, 0x6a22610e
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_picaff0_full_b b/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_picaff0_full_b
deleted file mode 100644
index ed5e02e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cavlc_mot_picaff0_full_b
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xf6b83a0e
-0,          1,          1,        1,   518400, 0xc5e8b8ee
-0,          2,          2,        1,   518400, 0xb3bc6e43
-0,          3,          3,        1,   518400, 0x5b08dc73
-0,          4,          4,        1,   518400, 0x4a7f7690
-0,          5,          5,        1,   518400, 0x8a9f4275
-0,          6,          6,        1,   518400, 0xc7cb92fd
-0,          7,          7,        1,   518400, 0xc721e231
-0,          8,          8,        1,   518400, 0xfb31371b
-0,          9,          9,        1,   518400, 0xac57f5d9
-0,         10,         10,        1,   518400, 0x92b7debc
-0,         11,         11,        1,   518400, 0xfe3e533e
-0,         12,         12,        1,   518400, 0x1b3a7a72
-0,         13,         13,        1,   518400, 0x98df2d81
-0,         14,         14,        1,   518400, 0xe0ce9c52
-0,         15,         15,        1,   518400, 0x6a31166d
-0,         16,         16,        1,   518400, 0x64ffd4d2
-0,         17,         17,        1,   518400, 0x3ec062ef
-0,         18,         18,        1,   518400, 0x3480fae1
-0,         19,         19,        1,   518400, 0xa87ae4b7
-0,         20,         20,        1,   518400, 0xd301319f
-0,         21,         21,        1,   518400, 0xa9284989
-0,         22,         22,        1,   518400, 0x3de73b50
-0,         23,         23,        1,   518400, 0x30a79f84
-0,         24,         24,        1,   518400, 0x7d5152d4
-0,         25,         25,        1,   518400, 0x25514095
-0,         26,         26,        1,   518400, 0x1749a05f
-0,         27,         27,        1,   518400, 0x598139a7
-0,         28,         28,        1,   518400, 0x3cece862
-0,         29,         29,        1,   518400, 0xe1c27efe
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cawp1_toshiba_e b/deps/libav/tests/ref/fate/h264-conformance-cawp1_toshiba_e
deleted file mode 100644
index e5a6944..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cawp1_toshiba_e
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xabf9ae05
-0,          1,          1,        1,   152064, 0x20418b16
-0,          2,          2,        1,   152064, 0xc26760ae
-0,          3,          3,        1,   152064, 0x7ed0c861
-0,          4,          4,        1,   152064, 0x1a13d207
-0,          5,          5,        1,   152064, 0x700bdb09
-0,          6,          6,        1,   152064, 0x7fa6476e
-0,          7,          7,        1,   152064, 0x951158c6
-0,          8,          8,        1,   152064, 0x263a2dfc
-0,          9,          9,        1,   152064, 0xa25c5371
-0,         10,         10,        1,   152064, 0xd67bd5c5
-0,         11,         11,        1,   152064, 0x73e6d7c0
-0,         12,         12,        1,   152064, 0x509967e4
-0,         13,         13,        1,   152064, 0x27574b8f
-0,         14,         14,        1,   152064, 0xa701d36f
-0,         15,         15,        1,   152064, 0x3d457728
-0,         16,         16,        1,   152064, 0xe9977098
-0,         17,         17,        1,   152064, 0x33b3542b
-0,         18,         18,        1,   152064, 0x5635d3fa
-0,         19,         19,        1,   152064, 0x51dbc0bd
-0,         20,         20,        1,   152064, 0xa2287df1
-0,         21,         21,        1,   152064, 0x24533377
-0,         22,         22,        1,   152064, 0xfd05e083
-0,         23,         23,        1,   152064, 0xfadce02d
-0,         24,         24,        1,   152064, 0xf67cc1da
-0,         25,         25,        1,   152064, 0x4e7bc654
-0,         26,         26,        1,   152064, 0x5b686f11
-0,         27,         27,        1,   152064, 0xb8e33dc8
-0,         28,         28,        1,   152064, 0x0ff224ca
-0,         29,         29,        1,   152064, 0xcd98c152
-0,         30,         30,        1,   152064, 0x4fdfb595
-0,         31,         31,        1,   152064, 0xb1b7f4fc
-0,         32,         32,        1,   152064, 0x666ccd6a
-0,         33,         33,        1,   152064, 0x80e9c1a3
-0,         34,         34,        1,   152064, 0x304b9be3
-0,         35,         35,        1,   152064, 0x9741fb13
-0,         36,         36,        1,   152064, 0x5e016501
-0,         37,         37,        1,   152064, 0x50dd4139
-0,         38,         38,        1,   152064, 0x9a4ef972
-0,         39,         39,        1,   152064, 0x03b7da4e
-0,         40,         40,        1,   152064, 0x17fd7d8a
-0,         41,         41,        1,   152064, 0xc0137bb0
-0,         42,         42,        1,   152064, 0xaf167d40
-0,         43,         43,        1,   152064, 0xde191051
-0,         44,         44,        1,   152064, 0x1cdcee05
-0,         45,         45,        1,   152064, 0xa8d1b139
-0,         46,         46,        1,   152064, 0xade6bf62
-0,         47,         47,        1,   152064, 0x4515a552
-0,         48,         48,        1,   152064, 0xb05036fe
-0,         49,         49,        1,   152064, 0xfa500b17
-0,         50,         50,        1,   152064, 0x512dec06
-0,         51,         51,        1,   152064, 0x0e77ff69
-0,         52,         52,        1,   152064, 0x06f7b2cd
-0,         53,         53,        1,   152064, 0x9bc99b67
-0,         54,         54,        1,   152064, 0x6b68301b
-0,         55,         55,        1,   152064, 0xe31321ba
-0,         56,         56,        1,   152064, 0x9ad0192e
-0,         57,         57,        1,   152064, 0xcc14d7c8
-0,         58,         58,        1,   152064, 0xf6ab91ec
-0,         59,         59,        1,   152064, 0xf76afbce
-0,         60,         60,        1,   152064, 0xb7d7f1dc
-0,         61,         61,        1,   152064, 0xca95e688
-0,         62,         62,        1,   152064, 0xc36bb8ac
-0,         63,         63,        1,   152064, 0xc1c06a2e
-0,         64,         64,        1,   152064, 0xf2a08f2a
-0,         65,         65,        1,   152064, 0xb81013d2
-0,         66,         66,        1,   152064, 0xf30cee41
-0,         67,         67,        1,   152064, 0xad85c0d6
-0,         68,         68,        1,   152064, 0x087b7807
-0,         69,         69,        1,   152064, 0x178c39f0
-0,         70,         70,        1,   152064, 0x6e0e3e66
-0,         71,         71,        1,   152064, 0x9a020bcf
-0,         72,         72,        1,   152064, 0xc33d4749
-0,         73,         73,        1,   152064, 0x6370dbad
-0,         74,         74,        1,   152064, 0x928cbe47
-0,         75,         75,        1,   152064, 0xb8b036cc
-0,         76,         76,        1,   152064, 0x79d92c37
-0,         77,         77,        1,   152064, 0xc4cf0d8f
-0,         78,         78,        1,   152064, 0xfe706c76
-0,         79,         79,        1,   152064, 0x6a37de81
-0,         80,         80,        1,   152064, 0x659eb2c1
-0,         81,         81,        1,   152064, 0x0630855f
-0,         82,         82,        1,   152064, 0xfa964f67
-0,         83,         83,        1,   152064, 0xc5a1ff95
-0,         84,         84,        1,   152064, 0xa131b89f
-0,         85,         85,        1,   152064, 0x73007c16
-0,         86,         86,        1,   152064, 0x4d237a3b
-0,         87,         87,        1,   152064, 0xe68f44be
-0,         88,         88,        1,   152064, 0x065f0be3
-0,         89,         89,        1,   152064, 0x39cab454
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cawp5_toshiba_e b/deps/libav/tests/ref/fate/h264-conformance-cawp5_toshiba_e
deleted file mode 100644
index 5b48f8f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cawp5_toshiba_e
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xabf9ae05
-0,          1,          1,        1,   152064, 0x20418b16
-0,          2,          2,        1,   152064, 0x20f72775
-0,          3,          3,        1,   152064, 0x57c07111
-0,          4,          4,        1,   152064, 0x1b49267f
-0,          5,          5,        1,   152064, 0x024cd238
-0,          6,          6,        1,   152064, 0x044d1ae0
-0,          7,          7,        1,   152064, 0xbfec1b59
-0,          8,          8,        1,   152064, 0x1a91f935
-0,          9,          9,        1,   152064, 0x9ee184dc
-0,         10,         10,        1,   152064, 0x65047dbe
-0,         11,         11,        1,   152064, 0xd1632fb5
-0,         12,         12,        1,   152064, 0x56f64c3e
-0,         13,         13,        1,   152064, 0xe6122f37
-0,         14,         14,        1,   152064, 0x0575e670
-0,         15,         15,        1,   152064, 0x3d457728
-0,         16,         16,        1,   152064, 0x6b508105
-0,         17,         17,        1,   152064, 0xcaaf5ea7
-0,         18,         18,        1,   152064, 0x9f4e4501
-0,         19,         19,        1,   152064, 0x1c661a73
-0,         20,         20,        1,   152064, 0x2fd9d1c8
-0,         21,         21,        1,   152064, 0x4ac99ab1
-0,         22,         22,        1,   152064, 0xf2d36809
-0,         23,         23,        1,   152064, 0xa8e32ffb
-0,         24,         24,        1,   152064, 0xd4da2fd2
-0,         25,         25,        1,   152064, 0xac3adde0
-0,         26,         26,        1,   152064, 0xf014ed0f
-0,         27,         27,        1,   152064, 0xca2e7d28
-0,         28,         28,        1,   152064, 0x3a875e51
-0,         29,         29,        1,   152064, 0xc03e4bda
-0,         30,         30,        1,   152064, 0x4fdfb595
-0,         31,         31,        1,   152064, 0x9243f098
-0,         32,         32,        1,   152064, 0x9361bae6
-0,         33,         33,        1,   152064, 0x7a1dadee
-0,         34,         34,        1,   152064, 0x72a59e15
-0,         35,         35,        1,   152064, 0xb5b47170
-0,         36,         36,        1,   152064, 0x5eb16651
-0,         37,         37,        1,   152064, 0xe7894af7
-0,         38,         38,        1,   152064, 0x2683bb0b
-0,         39,         39,        1,   152064, 0x90b4c8c5
-0,         40,         40,        1,   152064, 0xf800c5b5
-0,         41,         41,        1,   152064, 0xc2f5a895
-0,         42,         42,        1,   152064, 0x213c65d4
-0,         43,         43,        1,   152064, 0x01c65a19
-0,         44,         44,        1,   152064, 0xd9f1b04b
-0,         45,         45,        1,   152064, 0xa8d1b139
-0,         46,         46,        1,   152064, 0x2d0cb0cd
-0,         47,         47,        1,   152064, 0x5b0783fe
-0,         48,         48,        1,   152064, 0x29e628ec
-0,         49,         49,        1,   152064, 0x1b8527e5
-0,         50,         50,        1,   152064, 0x4b46d179
-0,         51,         51,        1,   152064, 0x6184c708
-0,         52,         52,        1,   152064, 0x697bb8e2
-0,         53,         53,        1,   152064, 0x5fd3a772
-0,         54,         54,        1,   152064, 0x91456c86
-0,         55,         55,        1,   152064, 0x376c4dae
-0,         56,         56,        1,   152064, 0x00ba2b3f
-0,         57,         57,        1,   152064, 0xf6f0f553
-0,         58,         58,        1,   152064, 0xc0020855
-0,         59,         59,        1,   152064, 0xec3d13d2
-0,         60,         60,        1,   152064, 0xb7d7f1dc
-0,         61,         61,        1,   152064, 0xf9dae37b
-0,         62,         62,        1,   152064, 0x50d9cc93
-0,         63,         63,        1,   152064, 0xba1eb592
-0,         64,         64,        1,   152064, 0x67616557
-0,         65,         65,        1,   152064, 0x09804760
-0,         66,         66,        1,   152064, 0xc2ffba00
-0,         67,         67,        1,   152064, 0xb71fcf46
-0,         68,         68,        1,   152064, 0x6cd975af
-0,         69,         69,        1,   152064, 0x19189167
-0,         70,         70,        1,   152064, 0xbca8fe71
-0,         71,         71,        1,   152064, 0xb0b3f607
-0,         72,         72,        1,   152064, 0x7614d73a
-0,         73,         73,        1,   152064, 0x7de9d87d
-0,         74,         74,        1,   152064, 0x81f58cf2
-0,         75,         75,        1,   152064, 0xb8b036cc
-0,         76,         76,        1,   152064, 0x26d1e2e4
-0,         77,         77,        1,   152064, 0xb41a1e6c
-0,         78,         78,        1,   152064, 0x4f9be4a9
-0,         79,         79,        1,   152064, 0xe95ad5d3
-0,         80,         80,        1,   152064, 0xdffc9335
-0,         81,         81,        1,   152064, 0x01d658c0
-0,         82,         82,        1,   152064, 0x631b4b75
-0,         83,         83,        1,   152064, 0x80ae282f
-0,         84,         84,        1,   152064, 0xb34bf688
-0,         85,         85,        1,   152064, 0xd0cc7d65
-0,         86,         86,        1,   152064, 0x86aa4590
-0,         87,         87,        1,   152064, 0xcb515a57
-0,         88,         88,        1,   152064, 0x68650834
-0,         89,         89,        1,   152064, 0x444ee2a4
diff --git a/deps/libav/tests/ref/fate/h264-conformance-ci1_ft_b b/deps/libav/tests/ref/fate/h264-conformance-ci1_ft_b
deleted file mode 100644
index 08e40f4..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-ci1_ft_b
+++ /dev/null
@@ -1,292 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xb291a678
-0,          1,          1,        1,   152064, 0x913c5a5d
-0,          2,          2,        1,   152064, 0x9558a372
-0,          3,          3,        1,   152064, 0x5e521e9b
-0,          4,          4,        1,   152064, 0xbc2c7bd7
-0,          5,          5,        1,   152064, 0x8867cc80
-0,          6,          6,        1,   152064, 0xae394b0b
-0,          7,          7,        1,   152064, 0x15d9c120
-0,          8,          8,        1,   152064, 0xffe01d0f
-0,          9,          9,        1,   152064, 0xf90a1d50
-0,         10,         10,        1,   152064, 0x7b9b6a02
-0,         11,         11,        1,   152064, 0x687f5afa
-0,         12,         12,        1,   152064, 0x6bf7b8a2
-0,         13,         13,        1,   152064, 0x45cb58e9
-0,         14,         14,        1,   152064, 0xc4246ef0
-0,         15,         15,        1,   152064, 0xa19dbe0a
-0,         16,         16,        1,   152064, 0xe297eaa9
-0,         17,         17,        1,   152064, 0x8f4300bc
-0,         18,         18,        1,   152064, 0x9a541a18
-0,         19,         19,        1,   152064, 0xf3b51480
-0,         20,         20,        1,   152064, 0x5a191303
-0,         21,         21,        1,   152064, 0x2e887f27
-0,         22,         22,        1,   152064, 0xf050d46d
-0,         23,         23,        1,   152064, 0xc31c6716
-0,         24,         24,        1,   152064, 0x37761725
-0,         25,         25,        1,   152064, 0x81141cf6
-0,         26,         26,        1,   152064, 0x181f7e61
-0,         27,         27,        1,   152064, 0x9fc2b668
-0,         28,         28,        1,   152064, 0x3716f5da
-0,         29,         29,        1,   152064, 0x3b28f0c9
-0,         30,         30,        1,   152064, 0xe33bd972
-0,         31,         31,        1,   152064, 0x948ccdaa
-0,         32,         32,        1,   152064, 0x21fdc6c2
-0,         33,         33,        1,   152064, 0x3874b6fc
-0,         34,         34,        1,   152064, 0x07b7a748
-0,         35,         35,        1,   152064, 0x7aee8b8d
-0,         36,         36,        1,   152064, 0x013d7552
-0,         37,         37,        1,   152064, 0x9631487e
-0,         38,         38,        1,   152064, 0xd9a109d6
-0,         39,         39,        1,   152064, 0x7b450b1b
-0,         40,         40,        1,   152064, 0x25f0cb06
-0,         41,         41,        1,   152064, 0x6542aa9c
-0,         42,         42,        1,   152064, 0x40ba9bd7
-0,         43,         43,        1,   152064, 0x2dc7d564
-0,         44,         44,        1,   152064, 0x4534a83f
-0,         45,         45,        1,   152064, 0x671551a3
-0,         46,         46,        1,   152064, 0xc69a9a28
-0,         47,         47,        1,   152064, 0x899be59a
-0,         48,         48,        1,   152064, 0x1adb6455
-0,         49,         49,        1,   152064, 0x5d34066b
-0,         50,         50,        1,   152064, 0x17f4dcec
-0,         51,         51,        1,   152064, 0xcc9fd4b1
-0,         52,         52,        1,   152064, 0x329aaeb5
-0,         53,         53,        1,   152064, 0x4532a3f0
-0,         54,         54,        1,   152064, 0xb0440be3
-0,         55,         55,        1,   152064, 0x9055a9e2
-0,         56,         56,        1,   152064, 0x1f5b4730
-0,         57,         57,        1,   152064, 0x55fc2ba8
-0,         58,         58,        1,   152064, 0x6adc911a
-0,         59,         59,        1,   152064, 0x4968851f
-0,         60,         60,        1,   152064, 0x31a86628
-0,         61,         61,        1,   152064, 0x7223240a
-0,         62,         62,        1,   152064, 0xb982e88e
-0,         63,         63,        1,   152064, 0xba45b5ea
-0,         64,         64,        1,   152064, 0x72f55121
-0,         65,         65,        1,   152064, 0x36c59af9
-0,         66,         66,        1,   152064, 0x6fc51449
-0,         67,         67,        1,   152064, 0xbd9d99b7
-0,         68,         68,        1,   152064, 0x0bd3a6e7
-0,         69,         69,        1,   152064, 0x5a5d0203
-0,         70,         70,        1,   152064, 0x44a26951
-0,         71,         71,        1,   152064, 0xfe9fcff5
-0,         72,         72,        1,   152064, 0xce25a939
-0,         73,         73,        1,   152064, 0xdf7c1b79
-0,         74,         74,        1,   152064, 0xe82a1c4c
-0,         75,         75,        1,   152064, 0x946b20d7
-0,         76,         76,        1,   152064, 0x5d4887d2
-0,         77,         77,        1,   152064, 0xadfe1034
-0,         78,         78,        1,   152064, 0x6d20b119
-0,         79,         79,        1,   152064, 0x8e414e12
-0,         80,         80,        1,   152064, 0x06effdf9
-0,         81,         81,        1,   152064, 0x3073e4f5
-0,         82,         82,        1,   152064, 0xa0ef2291
-0,         83,         83,        1,   152064, 0x3feb2cf6
-0,         84,         84,        1,   152064, 0x3e77b0c8
-0,         85,         85,        1,   152064, 0xdbce3b7a
-0,         86,         86,        1,   152064, 0x15e0b088
-0,         87,         87,        1,   152064, 0xb05bb465
-0,         88,         88,        1,   152064, 0x63423915
-0,         89,         89,        1,   152064, 0x290210f4
-0,         90,         90,        1,   152064, 0x4d14cc43
-0,         91,         91,        1,   152064, 0x4a5509fe
-0,         92,         92,        1,   152064, 0x110c6420
-0,         93,         93,        1,   152064, 0xbe614dfb
-0,         94,         94,        1,   152064, 0xa6311469
-0,         95,         95,        1,   152064, 0x198b6b73
-0,         96,         96,        1,   152064, 0xe96fe872
-0,         97,         97,        1,   152064, 0x7a7a6937
-0,         98,         98,        1,   152064, 0xfe2b868d
-0,         99,         99,        1,   152064, 0x9e0bbb2b
-0,        100,        100,        1,   152064, 0x53dbdf39
-0,        101,        101,        1,   152064, 0xee90ba8e
-0,        102,        102,        1,   152064, 0x38bcb94d
-0,        103,        103,        1,   152064, 0x16a6d9bb
-0,        104,        104,        1,   152064, 0x450ae454
-0,        105,        105,        1,   152064, 0x7d98fcf4
-0,        106,        106,        1,   152064, 0xc54ed4cf
-0,        107,        107,        1,   152064, 0x560d74ac
-0,        108,        108,        1,   152064, 0xb203fc98
-0,        109,        109,        1,   152064, 0xb085b576
-0,        110,        110,        1,   152064, 0x05e16f79
-0,        111,        111,        1,   152064, 0x90cd4c73
-0,        112,        112,        1,   152064, 0x4dd42a7f
-0,        113,        113,        1,   152064, 0x26b9e35c
-0,        114,        114,        1,   152064, 0x70cbb417
-0,        115,        115,        1,   152064, 0x0a1bc4a9
-0,        116,        116,        1,   152064, 0xe08fdbc9
-0,        117,        117,        1,   152064, 0x8768cd49
-0,        118,        118,        1,   152064, 0x80a4b575
-0,        119,        119,        1,   152064, 0x68478ea6
-0,        120,        120,        1,   152064, 0x8f8c589d
-0,        121,        121,        1,   152064, 0x8ee4345c
-0,        122,        122,        1,   152064, 0x93911901
-0,        123,        123,        1,   152064, 0x38fb4298
-0,        124,        124,        1,   152064, 0x8bee60e7
-0,        125,        125,        1,   152064, 0x3f906dbd
-0,        126,        126,        1,   152064, 0x9de2a984
-0,        127,        127,        1,   152064, 0x64c804e0
-0,        128,        128,        1,   152064, 0x4757c864
-0,        129,        129,        1,   152064, 0xe6f43905
-0,        130,        130,        1,   152064, 0x8ad2e577
-0,        131,        131,        1,   152064, 0x1b06977e
-0,        132,        132,        1,   152064, 0xe92a2dfa
-0,        133,        133,        1,   152064, 0x97b993fa
-0,        134,        134,        1,   152064, 0x1602de2d
-0,        135,        135,        1,   152064, 0x6dda24f1
-0,        136,        136,        1,   152064, 0x5552ec9d
-0,        137,        137,        1,   152064, 0xcce058e8
-0,        138,        138,        1,   152064, 0x4359bccd
-0,        139,        139,        1,   152064, 0xe41d77d0
-0,        140,        140,        1,   152064, 0x05730d21
-0,        141,        141,        1,   152064, 0xa963bf92
-0,        142,        142,        1,   152064, 0x3f4d8e29
-0,        143,        143,        1,   152064, 0x385d2403
-0,        144,        144,        1,   152064, 0xd8e279d6
-0,        145,        145,        1,   152064, 0xcfcb3713
-0,        146,        146,        1,   152064, 0xd68d57d4
-0,        147,        147,        1,   152064, 0xdaecd2d6
-0,        148,        148,        1,   152064, 0x7c1805cf
-0,        149,        149,        1,   152064, 0x19969137
-0,        150,        150,        1,   152064, 0x15007e0c
-0,        151,        151,        1,   152064, 0xf4f5011a
-0,        152,        152,        1,   152064, 0x792793e3
-0,        153,        153,        1,   152064, 0x1c4126f9
-0,        154,        154,        1,   152064, 0xfaeb9465
-0,        155,        155,        1,   152064, 0x3366c5c6
-0,        156,        156,        1,   152064, 0x8efa29ed
-0,        157,        157,        1,   152064, 0x2b36d937
-0,        158,        158,        1,   152064, 0x4cfc993f
-0,        159,        159,        1,   152064, 0x0809f8f8
-0,        160,        160,        1,   152064, 0x5be26710
-0,        161,        161,        1,   152064, 0x6d757860
-0,        162,        162,        1,   152064, 0xf4e8706d
-0,        163,        163,        1,   152064, 0xec42387d
-0,        164,        164,        1,   152064, 0x828f02e1
-0,        165,        165,        1,   152064, 0x45a0954c
-0,        166,        166,        1,   152064, 0xbcca1065
-0,        167,        167,        1,   152064, 0xd5946707
-0,        168,        168,        1,   152064, 0x6887cbcb
-0,        169,        169,        1,   152064, 0x63fc7423
-0,        170,        170,        1,   152064, 0x3339ebc2
-0,        171,        171,        1,   152064, 0x6419e277
-0,        172,        172,        1,   152064, 0xe9cd70aa
-0,        173,        173,        1,   152064, 0x23903b35
-0,        174,        174,        1,   152064, 0xd83d028a
-0,        175,        175,        1,   152064, 0x79e21536
-0,        176,        176,        1,   152064, 0x81cc6027
-0,        177,        177,        1,   152064, 0x56334e89
-0,        178,        178,        1,   152064, 0xe32e532e
-0,        179,        179,        1,   152064, 0x528832b4
-0,        180,        180,        1,   152064, 0x348da007
-0,        181,        181,        1,   152064, 0x5104b2e8
-0,        182,        182,        1,   152064, 0x7b0d1f8f
-0,        183,        183,        1,   152064, 0x6750c77c
-0,        184,        184,        1,   152064, 0x3a8f2faa
-0,        185,        185,        1,   152064, 0x8a24a116
-0,        186,        186,        1,   152064, 0x82d00d82
-0,        187,        187,        1,   152064, 0xc6f5b11a
-0,        188,        188,        1,   152064, 0x2b352039
-0,        189,        189,        1,   152064, 0x7c067e22
-0,        190,        190,        1,   152064, 0xc975d80d
-0,        191,        191,        1,   152064, 0xa49978ed
-0,        192,        192,        1,   152064, 0x441f703e
-0,        193,        193,        1,   152064, 0x5cb150c5
-0,        194,        194,        1,   152064, 0xeeda6c8e
-0,        195,        195,        1,   152064, 0xe9e0ce47
-0,        196,        196,        1,   152064, 0xba55acbd
-0,        197,        197,        1,   152064, 0xae8250e5
-0,        198,        198,        1,   152064, 0xf438f2e8
-0,        199,        199,        1,   152064, 0xe6263d10
-0,        200,        200,        1,   152064, 0x8d13277a
-0,        201,        201,        1,   152064, 0x4bfb4aab
-0,        202,        202,        1,   152064, 0x1c0a78ea
-0,        203,        203,        1,   152064, 0xa0651778
-0,        204,        204,        1,   152064, 0xa309ca66
-0,        205,        205,        1,   152064, 0x294c750b
-0,        206,        206,        1,   152064, 0xd55d6881
-0,        207,        207,        1,   152064, 0x8d002b72
-0,        208,        208,        1,   152064, 0xe0ae5976
-0,        209,        209,        1,   152064, 0xc6f28961
-0,        210,        210,        1,   152064, 0x6fb5899d
-0,        211,        211,        1,   152064, 0x046f3445
-0,        212,        212,        1,   152064, 0x9b2d5779
-0,        213,        213,        1,   152064, 0xeb9db946
-0,        214,        214,        1,   152064, 0x190bdc3b
-0,        215,        215,        1,   152064, 0xb9ae5c7b
-0,        216,        216,        1,   152064, 0xca07ad32
-0,        217,        217,        1,   152064, 0x8d1fee22
-0,        218,        218,        1,   152064, 0x446470dd
-0,        219,        219,        1,   152064, 0x8802cf93
-0,        220,        220,        1,   152064, 0x8bbaeb30
-0,        221,        221,        1,   152064, 0xfe4e7fdf
-0,        222,        222,        1,   152064, 0xc6379dc7
-0,        223,        223,        1,   152064, 0xaa53198b
-0,        224,        224,        1,   152064, 0x88d6d37c
-0,        225,        225,        1,   152064, 0xd1b89370
-0,        226,        226,        1,   152064, 0xdab349f4
-0,        227,        227,        1,   152064, 0x4702c238
-0,        228,        228,        1,   152064, 0xfaa893bb
-0,        229,        229,        1,   152064, 0x515b940e
-0,        230,        230,        1,   152064, 0x4d86d838
-0,        231,        231,        1,   152064, 0xe3815641
-0,        232,        232,        1,   152064, 0x0e501c17
-0,        233,        233,        1,   152064, 0x449df073
-0,        234,        234,        1,   152064, 0xc06daa27
-0,        235,        235,        1,   152064, 0x72f5394c
-0,        236,        236,        1,   152064, 0x18be9f70
-0,        237,        237,        1,   152064, 0xc508213a
-0,        238,        238,        1,   152064, 0xa616a322
-0,        239,        239,        1,   152064, 0x1a5d09e5
-0,        240,        240,        1,   152064, 0xf6e78051
-0,        241,        241,        1,   152064, 0x8945ad83
-0,        242,        242,        1,   152064, 0xa06fd95d
-0,        243,        243,        1,   152064, 0x7d86f015
-0,        244,        244,        1,   152064, 0x768af87c
-0,        245,        245,        1,   152064, 0xffa2e8d9
-0,        246,        246,        1,   152064, 0x2ac0d2df
-0,        247,        247,        1,   152064, 0x40c27662
-0,        248,        248,        1,   152064, 0xfcc7580a
-0,        249,        249,        1,   152064, 0xcdbd51f0
-0,        250,        250,        1,   152064, 0xe0d754ec
-0,        251,        251,        1,   152064, 0xbfb59395
-0,        252,        252,        1,   152064, 0x26f6db71
-0,        253,        253,        1,   152064, 0x1d85f144
-0,        254,        254,        1,   152064, 0xfacbfbd9
-0,        255,        255,        1,   152064, 0x55bdf6b8
-0,        256,        256,        1,   152064, 0x9c89e3f8
-0,        257,        257,        1,   152064, 0x6e90c4bd
-0,        258,        258,        1,   152064, 0x3b19a944
-0,        259,        259,        1,   152064, 0xcb527670
-0,        260,        260,        1,   152064, 0xc0ec5c7b
-0,        261,        261,        1,   152064, 0x7f5f4814
-0,        262,        262,        1,   152064, 0xb0983900
-0,        263,        263,        1,   152064, 0xc57534a6
-0,        264,        264,        1,   152064, 0xd37b30b9
-0,        265,        265,        1,   152064, 0x61fe2e9f
-0,        266,        266,        1,   152064, 0x613d2e8a
-0,        267,        267,        1,   152064, 0x9bc5224b
-0,        268,        268,        1,   152064, 0x246122c2
-0,        269,        269,        1,   152064, 0x28811a8f
-0,        270,        270,        1,   152064, 0x609cfcbf
-0,        271,        271,        1,   152064, 0x9c5aee70
-0,        272,        272,        1,   152064, 0x06d7e997
-0,        273,        273,        1,   152064, 0xcb3e1e4a
-0,        274,        274,        1,   152064, 0x65e36256
-0,        275,        275,        1,   152064, 0x571eb628
-0,        276,        276,        1,   152064, 0x9e940be8
-0,        277,        277,        1,   152064, 0x425a374b
-0,        278,        278,        1,   152064, 0xbeed72a2
-0,        279,        279,        1,   152064, 0x295bb61d
-0,        280,        280,        1,   152064, 0xfe2df639
-0,        281,        281,        1,   152064, 0xbd4f441a
-0,        282,        282,        1,   152064, 0x61ce59bc
-0,        283,        283,        1,   152064, 0xd5eb825f
-0,        284,        284,        1,   152064, 0xc03cb656
-0,        285,        285,        1,   152064, 0xfc10c1f6
-0,        286,        286,        1,   152064, 0xb93908dc
-0,        287,        287,        1,   152064, 0xbc2d3209
-0,        288,        288,        1,   152064, 0xcc267ab3
-0,        289,        289,        1,   152064, 0x32629fa0
-0,        290,        290,        1,   152064, 0x5d5bb942
diff --git a/deps/libav/tests/ref/fate/h264-conformance-ci_mw_d b/deps/libav/tests/ref/fate/h264-conformance-ci_mw_d
deleted file mode 100644
index 7b5a7dc..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-ci_mw_d
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x3ae838ee
-0,          1,          1,        1,    38016, 0x8523e136
-0,          2,          2,        1,    38016, 0xcffc99dd
-0,          3,          3,        1,    38016, 0xd42c63b0
-0,          4,          4,        1,    38016, 0x6ba94f84
-0,          5,          5,        1,    38016, 0xa5c56dd3
-0,          6,          6,        1,    38016, 0x6f6a929e
-0,          7,          7,        1,    38016, 0x84f89b27
-0,          8,          8,        1,    38016, 0x35bd9f0f
-0,          9,          9,        1,    38016, 0x69058ed2
-0,         10,         10,        1,    38016, 0x44c05088
-0,         11,         11,        1,    38016, 0xed9725f0
-0,         12,         12,        1,    38016, 0x37b92a40
-0,         13,         13,        1,    38016, 0xbeed3c7c
-0,         14,         14,        1,    38016, 0x833a5669
-0,         15,         15,        1,    38016, 0xf37b78b1
-0,         16,         16,        1,    38016, 0x84e2aff4
-0,         17,         17,        1,    38016, 0x8c69c59c
-0,         18,         18,        1,    38016, 0x40fdbe25
-0,         19,         19,        1,    38016, 0x1c7cba40
-0,         20,         20,        1,    38016, 0x052abe29
-0,         21,         21,        1,    38016, 0x398ec317
-0,         22,         22,        1,    38016, 0xa157bb47
-0,         23,         23,        1,    38016, 0x6acfc1a0
-0,         24,         24,        1,    38016, 0xfa77bdba
-0,         25,         25,        1,    38016, 0x2254bb0d
-0,         26,         26,        1,    38016, 0xefdfbdb3
-0,         27,         27,        1,    38016, 0x80eec1f4
-0,         28,         28,        1,    38016, 0x48b6c903
-0,         29,         29,        1,    38016, 0x277dd23b
-0,         30,         30,        1,    38016, 0x4c6aa7c5
-0,         31,         31,        1,    38016, 0x223f6bb7
-0,         32,         32,        1,    38016, 0xdbee4420
-0,         33,         33,        1,    38016, 0x5f888bdc
-0,         34,         34,        1,    38016, 0xe5aef9b8
-0,         35,         35,        1,    38016, 0x6a68596e
-0,         36,         36,        1,    38016, 0x47feb0d4
-0,         37,         37,        1,    38016, 0x46d13363
-0,         38,         38,        1,    38016, 0x31758ae0
-0,         39,         39,        1,    38016, 0xa9b3c513
-0,         40,         40,        1,    38016, 0x041ce805
-0,         41,         41,        1,    38016, 0xd3aef1e9
-0,         42,         42,        1,    38016, 0x8c51ecf8
-0,         43,         43,        1,    38016, 0x60a5f20d
-0,         44,         44,        1,    38016, 0xf3c80bfb
-0,         45,         45,        1,    38016, 0xcec4f6af
-0,         46,         46,        1,    38016, 0x70a1c28c
-0,         47,         47,        1,    38016, 0x1c579938
-0,         48,         48,        1,    38016, 0x07a8a63d
-0,         49,         49,        1,    38016, 0xd16ccd4e
-0,         50,         50,        1,    38016, 0xceb5e478
-0,         51,         51,        1,    38016, 0x81c0bf00
-0,         52,         52,        1,    38016, 0x4867d846
-0,         53,         53,        1,    38016, 0xd8650fd3
-0,         54,         54,        1,    38016, 0x1d8f375c
-0,         55,         55,        1,    38016, 0x5ce65ef5
-0,         56,         56,        1,    38016, 0xbc766bf0
-0,         57,         57,        1,    38016, 0x73cd27ee
-0,         58,         58,        1,    38016, 0xd1433004
-0,         59,         59,        1,    38016, 0xc5bc4798
-0,         60,         60,        1,    38016, 0xeb8a3531
-0,         61,         61,        1,    38016, 0xd4b014b8
-0,         62,         62,        1,    38016, 0xaaa2c77e
-0,         63,         63,        1,    38016, 0xa0a5a94e
-0,         64,         64,        1,    38016, 0x74edcf2e
-0,         65,         65,        1,    38016, 0x2925e32a
-0,         66,         66,        1,    38016, 0x5400da3a
-0,         67,         67,        1,    38016, 0xc50eda9b
-0,         68,         68,        1,    38016, 0xfd4acbe7
-0,         69,         69,        1,    38016, 0xa75eb6ee
-0,         70,         70,        1,    38016, 0xc0dca463
-0,         71,         71,        1,    38016, 0xfd1b83b7
-0,         72,         72,        1,    38016, 0x5b378f02
-0,         73,         73,        1,    38016, 0x608983d5
-0,         74,         74,        1,    38016, 0x6f6f2cda
-0,         75,         75,        1,    38016, 0x9367e1b2
-0,         76,         76,        1,    38016, 0x12d7d677
-0,         77,         77,        1,    38016, 0xd02cc0c5
-0,         78,         78,        1,    38016, 0xbe2fed59
-0,         79,         79,        1,    38016, 0x66c1402d
-0,         80,         80,        1,    38016, 0x150e75cf
-0,         81,         81,        1,    38016, 0x83c959ea
-0,         82,         82,        1,    38016, 0xa9c048f4
-0,         83,         83,        1,    38016, 0xffa9237f
-0,         84,         84,        1,    38016, 0x0ab0d668
-0,         85,         85,        1,    38016, 0xae4de2a4
-0,         86,         86,        1,    38016, 0xfc4322e8
-0,         87,         87,        1,    38016, 0x21f026dd
-0,         88,         88,        1,    38016, 0x7582b6a6
-0,         89,         89,        1,    38016, 0x4ddc5306
-0,         90,         90,        1,    38016, 0x1722db32
-0,         91,         91,        1,    38016, 0x33a0ace6
-0,         92,         92,        1,    38016, 0xe96ebd07
-0,         93,         93,        1,    38016, 0xdff2e5ef
-0,         94,         94,        1,    38016, 0xbf941880
-0,         95,         95,        1,    38016, 0x12ffcea4
-0,         96,         96,        1,    38016, 0x1ef6aaef
-0,         97,         97,        1,    38016, 0x2b01f811
-0,         98,         98,        1,    38016, 0x422b5992
-0,         99,         99,        1,    38016, 0x68ba9d2d
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvbs3_sony_c b/deps/libav/tests/ref/fate/h264-conformance-cvbs3_sony_c
deleted file mode 100644
index ad7485a..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvbs3_sony_c
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb3883478
-0,          1,          1,        1,    38016, 0xddf01d9d
-0,          2,          2,        1,    38016, 0xb177ece2
-0,          3,          3,        1,    38016, 0xfcd6aec1
-0,          4,          4,        1,    38016, 0x5cb5a017
-0,          5,          5,        1,    38016, 0xeb3884e7
-0,          6,          6,        1,    38016, 0xa8494fb1
-0,          7,          7,        1,    38016, 0xe0084edb
-0,          8,          8,        1,    38016, 0x605845e7
-0,          9,          9,        1,    38016, 0xe2103e96
-0,         10,         10,        1,    38016, 0x3b057699
-0,         11,         11,        1,    38016, 0x130b9413
-0,         12,         12,        1,    38016, 0x1af773f6
-0,         13,         13,        1,    38016, 0x1a77b1f3
-0,         14,         14,        1,    38016, 0xbb5bac34
-0,         15,         15,        1,    38016, 0xd41c9cf7
-0,         16,         16,        1,    38016, 0x6df3ac7f
-0,         17,         17,        1,    38016, 0xba44a850
-0,         18,         18,        1,    38016, 0xe8887fc4
-0,         19,         19,        1,    38016, 0xa50387fa
-0,         20,         20,        1,    38016, 0x164c6317
-0,         21,         21,        1,    38016, 0xb9c52925
-0,         22,         22,        1,    38016, 0xfbcc2f11
-0,         23,         23,        1,    38016, 0x5c0f258c
-0,         24,         24,        1,    38016, 0x0d61186e
-0,         25,         25,        1,    38016, 0xec173b07
-0,         26,         26,        1,    38016, 0x322c353a
-0,         27,         27,        1,    38016, 0x30f72be0
-0,         28,         28,        1,    38016, 0xb0aa5d52
-0,         29,         29,        1,    38016, 0x915a70e2
-0,         30,         30,        1,    38016, 0xed9563d3
-0,         31,         31,        1,    38016, 0x2122a450
-0,         32,         32,        1,    38016, 0xc8a6ba0a
-0,         33,         33,        1,    38016, 0x7fbaad08
-0,         34,         34,        1,    38016, 0xef19d83b
-0,         35,         35,        1,    38016, 0x4fb1d339
-0,         36,         36,        1,    38016, 0xe73eb1a3
-0,         37,         37,        1,    38016, 0xfd23d6f0
-0,         38,         38,        1,    38016, 0xfc21ca53
-0,         39,         39,        1,    38016, 0xa6c7b2c9
-0,         40,         40,        1,    38016, 0x4fb3c8e0
-0,         41,         41,        1,    38016, 0xdb7acc62
-0,         42,         42,        1,    38016, 0x281db765
-0,         43,         43,        1,    38016, 0x2e11b6e9
-0,         44,         44,        1,    38016, 0x8237b906
-0,         45,         45,        1,    38016, 0xe3728780
-0,         46,         46,        1,    38016, 0x2932a82c
-0,         47,         47,        1,    38016, 0x8a0ab2ca
-0,         48,         48,        1,    38016, 0xdb38a893
-0,         49,         49,        1,    38016, 0xd64cbfc3
-0,         50,         50,        1,    38016, 0x8a53b992
-0,         51,         51,        1,    38016, 0xef29abc9
-0,         52,         52,        1,    38016, 0x6d64baf6
-0,         53,         53,        1,    38016, 0xc402bf13
-0,         54,         54,        1,    38016, 0x00c7b709
-0,         55,         55,        1,    38016, 0x55ddcb84
-0,         56,         56,        1,    38016, 0x22cac705
-0,         57,         57,        1,    38016, 0xfa1bc59d
-0,         58,         58,        1,    38016, 0x82a1d3d0
-0,         59,         59,        1,    38016, 0x7db8d411
-0,         60,         60,        1,    38016, 0x98a59a5a
-0,         61,         61,        1,    38016, 0x02bda814
-0,         62,         62,        1,    38016, 0xc4a288d9
-0,         63,         63,        1,    38016, 0x799a3804
-0,         64,         64,        1,    38016, 0x11474f82
-0,         65,         65,        1,    38016, 0x0b807846
-0,         66,         66,        1,    38016, 0x2a118c7e
-0,         67,         67,        1,    38016, 0xa076e441
-0,         68,         68,        1,    38016, 0x9b2c1c2b
-0,         69,         69,        1,    38016, 0xf1433098
-0,         70,         70,        1,    38016, 0xbf68697b
-0,         71,         71,        1,    38016, 0x0c2c94de
-0,         72,         72,        1,    38016, 0x5fdcb88b
-0,         73,         73,        1,    38016, 0x543dfb09
-0,         74,         74,        1,    38016, 0x4c602fc8
-0,         75,         75,        1,    38016, 0x4c0b3afa
-0,         76,         76,        1,    38016, 0x97dd846b
-0,         77,         77,        1,    38016, 0xb5cb97f7
-0,         78,         78,        1,    38016, 0x42dba91c
-0,         79,         79,        1,    38016, 0x827cc117
-0,         80,         80,        1,    38016, 0xd589cd88
-0,         81,         81,        1,    38016, 0x15bfdd09
-0,         82,         82,        1,    38016, 0x77cbe929
-0,         83,         83,        1,    38016, 0x499edfb2
-0,         84,         84,        1,    38016, 0x3bd5d22c
-0,         85,         85,        1,    38016, 0xed0ed545
-0,         86,         86,        1,    38016, 0x1751e754
-0,         87,         87,        1,    38016, 0x042feed4
-0,         88,         88,        1,    38016, 0x24dde6b3
-0,         89,         89,        1,    38016, 0x8aa2ed66
-0,         90,         90,        1,    38016, 0x8fa69f07
-0,         91,         91,        1,    38016, 0xe018ad28
-0,         92,         92,        1,    38016, 0x0b31992e
-0,         93,         93,        1,    38016, 0xf8aa6dbc
-0,         94,         94,        1,    38016, 0x0eb36da4
-0,         95,         95,        1,    38016, 0x392b6658
-0,         96,         96,        1,    38016, 0xb8056967
-0,         97,         97,        1,    38016, 0x16899181
-0,         98,         98,        1,    38016, 0x44b9a1b2
-0,         99,         99,        1,    38016, 0x20ee9b98
-0,        100,        100,        1,    38016, 0x42cdad98
-0,        101,        101,        1,    38016, 0xd438a3d6
-0,        102,        102,        1,    38016, 0x551e8751
-0,        103,        103,        1,    38016, 0x68428f39
-0,        104,        104,        1,    38016, 0x7449b249
-0,        105,        105,        1,    38016, 0xf294a253
-0,        106,        106,        1,    38016, 0x8628d899
-0,        107,        107,        1,    38016, 0xba05f633
-0,        108,        108,        1,    38016, 0x329bfacb
-0,        109,        109,        1,    38016, 0xaa5c33dd
-0,        110,        110,        1,    38016, 0x2b9437d9
-0,        111,        111,        1,    38016, 0x8bd8273b
-0,        112,        112,        1,    38016, 0xc6d541fb
-0,        113,        113,        1,    38016, 0xb42c1e45
-0,        114,        114,        1,    38016, 0xdd39e610
-0,        115,        115,        1,    38016, 0xae56fe66
-0,        116,        116,        1,    38016, 0x812a16e4
-0,        117,        117,        1,    38016, 0x47fdff0f
-0,        118,        118,        1,    38016, 0xfbb33b56
-0,        119,        119,        1,    38016, 0x792a486f
-0,        120,        120,        1,    38016, 0x32e93592
-0,        121,        121,        1,    38016, 0xbd2142ca
-0,        122,        122,        1,    38016, 0x2d412532
-0,        123,        123,        1,    38016, 0x5ee8e957
-0,        124,        124,        1,    38016, 0x57c3de13
-0,        125,        125,        1,    38016, 0xad94b6f1
-0,        126,        126,        1,    38016, 0x8cda97a1
-0,        127,        127,        1,    38016, 0x3563b54e
-0,        128,        128,        1,    38016, 0x1d2bc4fb
-0,        129,        129,        1,    38016, 0xada2cf01
-0,        130,        130,        1,    38016, 0x8dabed0a
-0,        131,        131,        1,    38016, 0x441ae3c0
-0,        132,        132,        1,    38016, 0x5514cc85
-0,        133,        133,        1,    38016, 0xd20cddad
-0,        134,        134,        1,    38016, 0x5286d569
-0,        135,        135,        1,    38016, 0x1612a173
-0,        136,        136,        1,    38016, 0x5946be84
-0,        137,        137,        1,    38016, 0x1925b1fe
-0,        138,        138,        1,    38016, 0xf34f93eb
-0,        139,        139,        1,    38016, 0xac3d9add
-0,        140,        140,        1,    38016, 0x12d18ba6
-0,        141,        141,        1,    38016, 0xcc7f7e5a
-0,        142,        142,        1,    38016, 0x449270ec
-0,        143,        143,        1,    38016, 0x04416f83
-0,        144,        144,        1,    38016, 0x50d36abf
-0,        145,        145,        1,    38016, 0x8605799f
-0,        146,        146,        1,    38016, 0xe6ec6cfd
-0,        147,        147,        1,    38016, 0x1f2d3baf
-0,        148,        148,        1,    38016, 0x9f3e1a4c
-0,        149,        149,        1,    38016, 0x5c3ef4c8
-0,        150,        150,        1,    38016, 0xf731aef2
-0,        151,        151,        1,    38016, 0x90b4c921
-0,        152,        152,        1,    38016, 0xa12dc74f
-0,        153,        153,        1,    38016, 0x1fe2a278
-0,        154,        154,        1,    38016, 0xa6b0b432
-0,        155,        155,        1,    38016, 0xf9e9cb79
-0,        156,        156,        1,    38016, 0xef58d10e
-0,        157,        157,        1,    38016, 0x957805c0
-0,        158,        158,        1,    38016, 0x76e03b1f
-0,        159,        159,        1,    38016, 0xcb2a4905
-0,        160,        160,        1,    38016, 0xb863646d
-0,        161,        161,        1,    38016, 0x3e5f57fe
-0,        162,        162,        1,    38016, 0xbe7d3d77
-0,        163,        163,        1,    38016, 0x4f3c3ce5
-0,        164,        164,        1,    38016, 0x806033d0
-0,        165,        165,        1,    38016, 0xc31bf5da
-0,        166,        166,        1,    38016, 0x6f8ef69e
-0,        167,        167,        1,    38016, 0x010ac670
-0,        168,        168,        1,    38016, 0x374e9bdd
-0,        169,        169,        1,    38016, 0xd8499c26
-0,        170,        170,        1,    38016, 0x5901a512
-0,        171,        171,        1,    38016, 0x31b2bcdf
-0,        172,        172,        1,    38016, 0x972cdda0
-0,        173,        173,        1,    38016, 0x10c8ded1
-0,        174,        174,        1,    38016, 0xc6e3c839
-0,        175,        175,        1,    38016, 0xf661aa12
-0,        176,        176,        1,    38016, 0x6ca379d0
-0,        177,        177,        1,    38016, 0xc5a53d41
-0,        178,        178,        1,    38016, 0x317d353c
-0,        179,        179,        1,    38016, 0xb9962522
-0,        180,        180,        1,    38016, 0x0769ec52
-0,        181,        181,        1,    38016, 0x4463ea8b
-0,        182,        182,        1,    38016, 0xdd7dd585
-0,        183,        183,        1,    38016, 0x6039ca99
-0,        184,        184,        1,    38016, 0x87beeba1
-0,        185,        185,        1,    38016, 0x2503fd5d
-0,        186,        186,        1,    38016, 0xde950c40
-0,        187,        187,        1,    38016, 0xd6f5332f
-0,        188,        188,        1,    38016, 0xa95b3137
-0,        189,        189,        1,    38016, 0x37c026b4
-0,        190,        190,        1,    38016, 0x93f9e3e3
-0,        191,        191,        1,    38016, 0x5826b471
-0,        192,        192,        1,    38016, 0xef81ac84
-0,        193,        193,        1,    38016, 0x6361dfa0
-0,        194,        194,        1,    38016, 0x9774f041
-0,        195,        195,        1,    38016, 0xd8d01ad1
-0,        196,        196,        1,    38016, 0x456252f3
-0,        197,        197,        1,    38016, 0x448c6119
-0,        198,        198,        1,    38016, 0x12157fca
-0,        199,        199,        1,    38016, 0x145ca727
-0,        200,        200,        1,    38016, 0x17a5b174
-0,        201,        201,        1,    38016, 0xc0c0bb0c
-0,        202,        202,        1,    38016, 0x9afbc5e8
-0,        203,        203,        1,    38016, 0xc8c7cc3a
-0,        204,        204,        1,    38016, 0x489dc5dd
-0,        205,        205,        1,    38016, 0x6da6c7c8
-0,        206,        206,        1,    38016, 0x6408d491
-0,        207,        207,        1,    38016, 0x0820d9ce
-0,        208,        208,        1,    38016, 0xebcfc8d6
-0,        209,        209,        1,    38016, 0xf462b2a2
-0,        210,        210,        1,    38016, 0xadb65d17
-0,        211,        211,        1,    38016, 0xecde79e9
-0,        212,        212,        1,    38016, 0x81786ed0
-0,        213,        213,        1,    38016, 0x3cfc51f8
-0,        214,        214,        1,    38016, 0x307560ba
-0,        215,        215,        1,    38016, 0xc4f95361
-0,        216,        216,        1,    38016, 0xe2fe384b
-0,        217,        217,        1,    38016, 0x95de4e60
-0,        218,        218,        1,    38016, 0x1b6147f9
-0,        219,        219,        1,    38016, 0xe1bc385b
-0,        220,        220,        1,    38016, 0x14cc446a
-0,        221,        221,        1,    38016, 0x5fcb313f
-0,        222,        222,        1,    38016, 0xf33f1721
-0,        223,        223,        1,    38016, 0x49fc2fbb
-0,        224,        224,        1,    38016, 0x33ad3314
-0,        225,        225,        1,    38016, 0x92b51315
-0,        226,        226,        1,    38016, 0x7e4d3139
-0,        227,        227,        1,    38016, 0xb99e432b
-0,        228,        228,        1,    38016, 0x52cb3c30
-0,        229,        229,        1,    38016, 0xe5e48199
-0,        230,        230,        1,    38016, 0x59419769
-0,        231,        231,        1,    38016, 0x3e90b130
-0,        232,        232,        1,    38016, 0x85fbfbd6
-0,        233,        233,        1,    38016, 0xba8912ac
-0,        234,        234,        1,    38016, 0x3fc3128c
-0,        235,        235,        1,    38016, 0x61db4d37
-0,        236,        236,        1,    38016, 0x3c405a46
-0,        237,        237,        1,    38016, 0x9c113b43
-0,        238,        238,        1,    38016, 0x739c43f4
-0,        239,        239,        1,    38016, 0xffab0fe6
-0,        240,        240,        1,    38016, 0x99cee4bd
-0,        241,        241,        1,    38016, 0xd76dcff5
-0,        242,        242,        1,    38016, 0xe8ccb16c
-0,        243,        243,        1,    38016, 0x43d8ff1f
-0,        244,        244,        1,    38016, 0xffde708b
-0,        245,        245,        1,    38016, 0xe5cfd3d4
-0,        246,        246,        1,    38016, 0x0b67ef9f
-0,        247,        247,        1,    38016, 0xd54cd697
-0,        248,        248,        1,    38016, 0x5879926e
-0,        249,        249,        1,    38016, 0x9cb01428
-0,        250,        250,        1,    38016, 0x09b0c0b7
-0,        251,        251,        1,    38016, 0xbbef721e
-0,        252,        252,        1,    38016, 0xcebd66ea
-0,        253,        253,        1,    38016, 0x7492c956
-0,        254,        254,        1,    38016, 0xeaa5317b
-0,        255,        255,        1,    38016, 0xe952c9bd
-0,        256,        256,        1,    38016, 0xb4cfd878
-0,        257,        257,        1,    38016, 0xa8675f14
-0,        258,        258,        1,    38016, 0x24653121
-0,        259,        259,        1,    38016, 0xeec9425e
-0,        260,        260,        1,    38016, 0x14413e58
-0,        261,        261,        1,    38016, 0xc8e13f0a
-0,        262,        262,        1,    38016, 0x09045f0f
-0,        263,        263,        1,    38016, 0xa021583e
-0,        264,        264,        1,    38016, 0x26384591
-0,        265,        265,        1,    38016, 0x157b55d2
-0,        266,        266,        1,    38016, 0x22973c65
-0,        267,        267,        1,    38016, 0x2fe30f64
-0,        268,        268,        1,    38016, 0xf640fab4
-0,        269,        269,        1,    38016, 0x2b82d807
-0,        270,        270,        1,    38016, 0x6faca613
-0,        271,        271,        1,    38016, 0x8a5b89c3
-0,        272,        272,        1,    38016, 0xb7d76316
-0,        273,        273,        1,    38016, 0x3e3a0a82
-0,        274,        274,        1,    38016, 0x7d93d78b
-0,        275,        275,        1,    38016, 0xa3bcc050
-0,        276,        276,        1,    38016, 0x41d4b2ba
-0,        277,        277,        1,    38016, 0x7a08d518
-0,        278,        278,        1,    38016, 0xd6b0f72b
-0,        279,        279,        1,    38016, 0x9c794c7b
-0,        280,        280,        1,    38016, 0xc2680d18
-0,        281,        281,        1,    38016, 0x9fa6db96
-0,        282,        282,        1,    38016, 0xd90c83c3
-0,        283,        283,        1,    38016, 0xf1278cf5
-0,        284,        284,        1,    38016, 0xf2ce5e19
-0,        285,        285,        1,    38016, 0x2d41a44b
-0,        286,        286,        1,    38016, 0xade2715b
-0,        287,        287,        1,    38016, 0xd21da6fe
-0,        288,        288,        1,    38016, 0x37c89e7f
-0,        289,        289,        1,    38016, 0x6bad76e8
-0,        290,        290,        1,    38016, 0xfefce893
-0,        291,        291,        1,    38016, 0xcd301b29
-0,        292,        292,        1,    38016, 0x0e80a08d
-0,        293,        293,        1,    38016, 0x88f3d605
-0,        294,        294,        1,    38016, 0x80273791
-0,        295,        295,        1,    38016, 0x36472009
-0,        296,        296,        1,    38016, 0xe8b6fc54
-0,        297,        297,        1,    38016, 0x5d9bfd2d
-0,        298,        298,        1,    38016, 0x61df1820
-0,        299,        299,        1,    38016, 0x8db23b5c
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvcanlma2_sony_c b/deps/libav/tests/ref/fate/h264-conformance-cvcanlma2_sony_c
deleted file mode 100644
index b6a759a..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvcanlma2_sony_c
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xfbca00c6
-0,          1,          1,        1,   518400, 0x82b80adf
-0,          2,          2,        1,   518400, 0x87ecdf4a
-0,          3,          3,        1,   518400, 0xf6ca8cbe
-0,          4,          4,        1,   518400, 0x8e9bb8a0
-0,          5,          5,        1,   518400, 0x6512caa2
-0,          6,          6,        1,   518400, 0xc015e43e
-0,          7,          7,        1,   518400, 0x5f504a5c
-0,          8,          8,        1,   518400, 0x4c7458a4
-0,          9,          9,        1,   518400, 0x630f4004
-0,         10,         10,        1,   518400, 0x889af20e
-0,         11,         11,        1,   518400, 0x4437a5a4
-0,         12,         12,        1,   518400, 0x1e19a254
-0,         13,         13,        1,   518400, 0xb7ef1763
-0,         14,         14,        1,   518400, 0xc966c95a
-0,         15,         15,        1,   518400, 0x0c9074d6
-0,         16,         16,        1,   518400, 0x24c906c9
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvfc1_sony_c b/deps/libav/tests/ref/fate/h264-conformance-cvfc1_sony_c
deleted file mode 100644
index 1abe67f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvfc1_sony_c
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    75600, 0x6f6a8c48
-0,          1,          1,        1,    75600, 0x4b7ac558
-0,          2,          2,        1,    75600, 0x907feda3
-0,          3,          3,        1,    75600, 0x7b2b17d2
-0,          4,          4,        1,    75600, 0x46d038e7
-0,          5,          5,        1,    75600, 0x90d463b3
-0,          6,          6,        1,    75600, 0xc00d7ec1
-0,          7,          7,        1,    75600, 0x10f69a60
-0,          8,          8,        1,    75600, 0x676aad50
-0,          9,          9,        1,    75600, 0x0a3fd3e0
-0,         10,         10,        1,    75600, 0xaee8fc87
-0,         11,         11,        1,    75600, 0xc9f41fbb
-0,         12,         12,        1,    75600, 0x183743dd
-0,         13,         13,        1,    75600, 0xf0385aa2
-0,         14,         14,        1,    75600, 0xad63782e
-0,         15,         15,        1,    75600, 0x9ed08c01
-0,         16,         16,        1,    75600, 0x79aba20e
-0,         17,         17,        1,    75600, 0x53d6c34c
-0,         18,         18,        1,    75600, 0x4cead515
-0,         19,         19,        1,    75600, 0xc701e3c8
-0,         20,         20,        1,    75600, 0xb278e37d
-0,         21,         21,        1,    75600, 0x02e6f95e
-0,         22,         22,        1,    75600, 0x5cdffef4
-0,         23,         23,        1,    75600, 0x6e0a1089
-0,         24,         24,        1,    75600, 0x23a919b5
-0,         25,         25,        1,    75600, 0x31f5391c
-0,         26,         26,        1,    75600, 0xaa2c3445
-0,         27,         27,        1,    75600, 0x42204340
-0,         28,         28,        1,    75600, 0x55924031
-0,         29,         29,        1,    75600, 0x6bc94d1b
-0,         30,         30,        1,    75600, 0x3e1a1e21
-0,         31,         31,        1,    75600, 0xaf4816fc
-0,         32,         32,        1,    75600, 0x322c1d18
-0,         33,         33,        1,    75600, 0xf59c1746
-0,         34,         34,        1,    75600, 0x875cfc24
-0,         35,         35,        1,    75600, 0x8657f65b
-0,         36,         36,        1,    75600, 0x7e78f95f
-0,         37,         37,        1,    75600, 0x7639e983
-0,         38,         38,        1,    75600, 0xcdaac5fa
-0,         39,         39,        1,    75600, 0x2b7ac473
-0,         40,         40,        1,    75600, 0x028cb98f
-0,         41,         41,        1,    75600, 0x023abda4
-0,         42,         42,        1,    75600, 0x9733ad92
-0,         43,         43,        1,    75600, 0xfb4f8cfe
-0,         44,         44,        1,    75600, 0xfef071b6
-0,         45,         45,        1,    75600, 0xf7513219
-0,         46,         46,        1,    75600, 0x9d6e3c98
-0,         47,         47,        1,    75600, 0xd5501ac7
-0,         48,         48,        1,    75600, 0xa00201f1
-0,         49,         49,        1,    75600, 0xee84e8c6
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvfi1_sony_d b/deps/libav/tests/ref/fate/h264-conformance-cvfi1_sony_d
deleted file mode 100644
index 195c7d6..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvfi1_sony_d
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xd9444d71
-0,          1,          1,        1,   518400, 0x5d8928cd
-0,          2,          2,        1,   518400, 0xea5bc08b
-0,          3,          3,        1,   518400, 0xb4465d31
-0,          4,          4,        1,   518400, 0x983b5dbb
-0,          5,          5,        1,   518400, 0x54936746
-0,          6,          6,        1,   518400, 0x7ae38b02
-0,          7,          7,        1,   518400, 0xc2a0dd83
-0,          8,          8,        1,   518400, 0x61cac7a6
-0,          9,          9,        1,   518400, 0xb0038443
-0,         10,         10,        1,   518400, 0x16514296
-0,         11,         11,        1,   518400, 0xa68dd470
-0,         12,         12,        1,   518400, 0x2572f868
-0,         13,         13,        1,   518400, 0x770a3239
-0,         14,         14,        1,   518400, 0xdd04f6d2
-0,         15,         15,        1,   518400, 0xa5e5d01e
-0,         16,         16,        1,   518400, 0x5fe25c86
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvfi1_sva_c b/deps/libav/tests/ref/fate/h264-conformance-cvfi1_sva_c
deleted file mode 100644
index c19bc0d..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvfi1_sva_c
+++ /dev/null
@@ -1,8 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x8f022263
-0,          1,          1,        1,   518400, 0x02692654
-0,          2,          2,        1,   518400, 0x55eff579
-0,          3,          3,        1,   518400, 0x6c1bdf1d
-0,          4,          4,        1,   518400, 0xbbedf5e4
-0,          5,          5,        1,   518400, 0xb90d740d
-0,          6,          6,        1,   518400, 0x81300adb
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvfi2_sony_h b/deps/libav/tests/ref/fate/h264-conformance-cvfi2_sony_h
deleted file mode 100644
index 0914e22..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvfi2_sony_h
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xd9444d71
-0,          1,          1,        1,   518400, 0x491faf75
-0,          2,          2,        1,   518400, 0xf8b4d15c
-0,          3,          3,        1,   518400, 0x99d9f60c
-0,          4,          4,        1,   518400, 0x46c17a6d
-0,          5,          5,        1,   518400, 0x30b9447d
-0,          6,          6,        1,   518400, 0x135d0c76
-0,          7,          7,        1,   518400, 0x1b831a3c
-0,          8,          8,        1,   518400, 0x5910def8
-0,          9,          9,        1,   518400, 0x8db90147
-0,         10,         10,        1,   518400, 0x6a2b79c7
-0,         11,         11,        1,   518400, 0xc8d302e5
-0,         12,         12,        1,   518400, 0x515bb024
-0,         13,         13,        1,   518400, 0xedf7836c
-0,         14,         14,        1,   518400, 0x7e247b9d
-0,         15,         15,        1,   518400, 0x10c9bb10
-0,         16,         16,        1,   518400, 0xe38e2807
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvfi2_sva_c b/deps/libav/tests/ref/fate/h264-conformance-cvfi2_sva_c
deleted file mode 100644
index 7c3162a..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvfi2_sva_c
+++ /dev/null
@@ -1,14 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x4073cc0b
-0,          1,          1,        1,   518400, 0x5f599a48
-0,          2,          2,        1,   518400, 0xc6fe555a
-0,          3,          3,        1,   518400, 0xe63ac345
-0,          4,          4,        1,   518400, 0x9b4f0c5c
-0,          5,          5,        1,   518400, 0x98aaba2d
-0,          6,          6,        1,   518400, 0xd629bd09
-0,          7,          7,        1,   518400, 0xe9796c37
-0,          8,          8,        1,   518400, 0xba54d16e
-0,          9,          9,        1,   518400, 0xe396c3eb
-0,         10,         10,        1,   518400, 0x63ee4b81
-0,         11,         11,        1,   518400, 0x68ac6986
-0,         12,         12,        1,   518400, 0xe0d53000
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvma1_sony_d b/deps/libav/tests/ref/fate/h264-conformance-cvma1_sony_d
deleted file mode 100644
index 6685216..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvma1_sony_d
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x75701511
-0,          1,          1,        1,   518400, 0xa7eeaa16
-0,          2,          2,        1,   518400, 0xe0f32e35
-0,          3,          3,        1,   518400, 0x7a1dadd9
-0,          4,          4,        1,   518400, 0x4a1672a6
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvma1_toshiba_b b/deps/libav/tests/ref/fate/h264-conformance-cvma1_toshiba_b
deleted file mode 100644
index ab2da4a..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvma1_toshiba_b
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x9a9ce366
-0,          1,          1,        1,   152064, 0xf4639828
-0,          2,          2,        1,   152064, 0x625024a3
-0,          3,          3,        1,   152064, 0x80dc2f9d
-0,          4,          4,        1,   152064, 0xb2c4feea
-0,          5,          5,        1,   152064, 0x4ec6ad64
-0,          6,          6,        1,   152064, 0x1957bec3
-0,          7,          7,        1,   152064, 0xb682799d
-0,          8,          8,        1,   152064, 0x34cd2053
-0,          9,          9,        1,   152064, 0x81490b4c
-0,         10,         10,        1,   152064, 0x242dc943
-0,         11,         11,        1,   152064, 0x3e126734
-0,         12,         12,        1,   152064, 0x8e474ff8
-0,         13,         13,        1,   152064, 0x239d2fbd
-0,         14,         14,        1,   152064, 0x0ca3e16f
-0,         15,         15,        1,   152064, 0x6161d7c2
-0,         16,         16,        1,   152064, 0xca7ad1af
-0,         17,         17,        1,   152064, 0xf8ef9026
-0,         18,         18,        1,   152064, 0x01f2f4c1
-0,         19,         19,        1,   152064, 0x510b19ec
-0,         20,         20,        1,   152064, 0xe489028b
-0,         21,         21,        1,   152064, 0x7a693c1e
-0,         22,         22,        1,   152064, 0x276b23fe
-0,         23,         23,        1,   152064, 0x0e9ced3a
-0,         24,         24,        1,   152064, 0x658228f7
-0,         25,         25,        1,   152064, 0x6a271bc3
-0,         26,         26,        1,   152064, 0x431ecd8b
-0,         27,         27,        1,   152064, 0x23a5ed14
-0,         28,         28,        1,   152064, 0x76fbe121
-0,         29,         29,        1,   152064, 0x471f919d
-0,         30,         30,        1,   152064, 0x16bfabbc
-0,         31,         31,        1,   152064, 0x0762993f
-0,         32,         32,        1,   152064, 0x5a2b0b0e
-0,         33,         33,        1,   152064, 0x81415ef7
-0,         34,         34,        1,   152064, 0xb96e4164
-0,         35,         35,        1,   152064, 0xf77aee83
-0,         36,         36,        1,   152064, 0x6af81633
-0,         37,         37,        1,   152064, 0xed78e5b5
-0,         38,         38,        1,   152064, 0x67e38e2c
-0,         39,         39,        1,   152064, 0x0417ae01
-0,         40,         40,        1,   152064, 0x3887b312
-0,         41,         41,        1,   152064, 0x3a4b70fb
-0,         42,         42,        1,   152064, 0xcaae9e7f
-0,         43,         43,        1,   152064, 0xaf9597be
-0,         44,         44,        1,   152064, 0x9bae63d3
-0,         45,         45,        1,   152064, 0x0e80825f
-0,         46,         46,        1,   152064, 0x915661fd
-0,         47,         47,        1,   152064, 0x67d3dc94
-0,         48,         48,        1,   152064, 0x3dcf240c
-0,         49,         49,        1,   152064, 0x127ff832
-0,         50,         50,        1,   152064, 0xc8969981
-0,         51,         51,        1,   152064, 0x57179c77
-0,         52,         52,        1,   152064, 0x9f88656c
-0,         53,         53,        1,   152064, 0xc28ff5d3
-0,         54,         54,        1,   152064, 0xf100fad9
-0,         55,         55,        1,   152064, 0xb570ce12
-0,         56,         56,        1,   152064, 0xe8f28955
-0,         57,         57,        1,   152064, 0x1f0a9549
-0,         58,         58,        1,   152064, 0x22b17e9b
-0,         59,         59,        1,   152064, 0x7cf1400e
-0,         60,         60,        1,   152064, 0xafd273b7
-0,         61,         61,        1,   152064, 0xeb9b712e
-0,         62,         62,        1,   152064, 0x0f81de24
-0,         63,         63,        1,   152064, 0x8f4e1953
-0,         64,         64,        1,   152064, 0x682e2170
-0,         65,         65,        1,   152064, 0xc32ad1b2
-0,         66,         66,        1,   152064, 0x53a81d79
-0,         67,         67,        1,   152064, 0x54002596
-0,         68,         68,        1,   152064, 0x4b5fdbd9
-0,         69,         69,        1,   152064, 0x96613368
-0,         70,         70,        1,   152064, 0xd6ac0171
-0,         71,         71,        1,   152064, 0xf1c1b7b7
-0,         72,         72,        1,   152064, 0xc730d82f
-0,         73,         73,        1,   152064, 0x0415d934
-0,         74,         74,        1,   152064, 0x5338915e
-0,         75,         75,        1,   152064, 0x8e9dda6d
-0,         76,         76,        1,   152064, 0xe3a8b0a0
-0,         77,         77,        1,   152064, 0x5fa36e44
-0,         78,         78,        1,   152064, 0x0e63dc72
-0,         79,         79,        1,   152064, 0xd0dad71f
-0,         80,         80,        1,   152064, 0x0c4aac94
-0,         81,         81,        1,   152064, 0x60d50e8d
-0,         82,         82,        1,   152064, 0x96872d7c
-0,         83,         83,        1,   152064, 0x4fcefc33
-0,         84,         84,        1,   152064, 0x6b8157c9
-0,         85,         85,        1,   152064, 0xa40d527d
-0,         86,         86,        1,   152064, 0x9884480a
-0,         87,         87,        1,   152064, 0xff5d9754
-0,         88,         88,        1,   152064, 0x4a26a74d
-0,         89,         89,        1,   152064, 0x81059e82
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvmanl1_toshiba_b b/deps/libav/tests/ref/fate/h264-conformance-cvmanl1_toshiba_b
deleted file mode 100644
index 2c3c557..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvmanl1_toshiba_b
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xb1edd842
-0,          1,          1,        1,   152064, 0x551f8f45
-0,          2,          2,        1,   152064, 0xb4931cb2
-0,          3,          3,        1,   152064, 0x78882b27
-0,          4,          4,        1,   152064, 0x3afef36d
-0,          5,          5,        1,   152064, 0x85afad0a
-0,          6,          6,        1,   152064, 0x3a8bab81
-0,          7,          7,        1,   152064, 0x2a437174
-0,          8,          8,        1,   152064, 0x22421437
-0,          9,          9,        1,   152064, 0x39c5f125
-0,         10,         10,        1,   152064, 0x256eaad2
-0,         11,         11,        1,   152064, 0x668a5d31
-0,         12,         12,        1,   152064, 0x412a4aa7
-0,         13,         13,        1,   152064, 0x3f091baf
-0,         14,         14,        1,   152064, 0xbf16d262
-0,         15,         15,        1,   152064, 0x2fc4ce67
-0,         16,         16,        1,   152064, 0x119cde3e
-0,         17,         17,        1,   152064, 0xb40b8632
-0,         18,         18,        1,   152064, 0x4be4f192
-0,         19,         19,        1,   152064, 0x906c1237
-0,         20,         20,        1,   152064, 0x95380024
-0,         21,         21,        1,   152064, 0x6a833025
-0,         22,         22,        1,   152064, 0x681d1c4f
-0,         23,         23,        1,   152064, 0x08c8dea4
-0,         24,         24,        1,   152064, 0xc69226f0
-0,         25,         25,        1,   152064, 0x86631102
-0,         26,         26,        1,   152064, 0x7f40c77a
-0,         27,         27,        1,   152064, 0xc746ddd4
-0,         28,         28,        1,   152064, 0x5f2bd3cb
-0,         29,         29,        1,   152064, 0x643c8316
-0,         30,         30,        1,   152064, 0x5b7fa380
-0,         31,         31,        1,   152064, 0x82438cf7
-0,         32,         32,        1,   152064, 0xdee0f7e7
-0,         33,         33,        1,   152064, 0xc50d41f1
-0,         34,         34,        1,   152064, 0xf3453631
-0,         35,         35,        1,   152064, 0x90bce66b
-0,         36,         36,        1,   152064, 0x045b03f7
-0,         37,         37,        1,   152064, 0xf64bd756
-0,         38,         38,        1,   152064, 0xff997ef2
-0,         39,         39,        1,   152064, 0x3613a0a5
-0,         40,         40,        1,   152064, 0xe6a7a8d6
-0,         41,         41,        1,   152064, 0xb0906c42
-0,         42,         42,        1,   152064, 0x4dfc912b
-0,         43,         43,        1,   152064, 0x81e3991c
-0,         44,         44,        1,   152064, 0x4efc61fb
-0,         45,         45,        1,   152064, 0xed478395
-0,         46,         46,        1,   152064, 0x4cb25ab6
-0,         47,         47,        1,   152064, 0x28e7d51f
-0,         48,         48,        1,   152064, 0x8bcc1a8d
-0,         49,         49,        1,   152064, 0x2fe1f240
-0,         50,         50,        1,   152064, 0xb4978ef8
-0,         51,         51,        1,   152064, 0xe3929556
-0,         52,         52,        1,   152064, 0xd370632a
-0,         53,         53,        1,   152064, 0xba86ffb2
-0,         54,         54,        1,   152064, 0x444bf18c
-0,         55,         55,        1,   152064, 0xab40bd14
-0,         56,         56,        1,   152064, 0xfd488a5d
-0,         57,         57,        1,   152064, 0xe1f09568
-0,         58,         58,        1,   152064, 0x09ee7a7e
-0,         59,         59,        1,   152064, 0x9360397c
-0,         60,         60,        1,   152064, 0xdbd467e9
-0,         61,         61,        1,   152064, 0x99726777
-0,         62,         62,        1,   152064, 0x009fd46c
-0,         63,         63,        1,   152064, 0xcf770fdb
-0,         64,         64,        1,   152064, 0x2a890fd9
-0,         65,         65,        1,   152064, 0x7f40de4b
-0,         66,         66,        1,   152064, 0x04191304
-0,         67,         67,        1,   152064, 0x15722022
-0,         68,         68,        1,   152064, 0x59f4ea93
-0,         69,         69,        1,   152064, 0x28ba373f
-0,         70,         70,        1,   152064, 0xf9e400b8
-0,         71,         71,        1,   152064, 0x85c4bd98
-0,         72,         72,        1,   152064, 0x6917d2a5
-0,         73,         73,        1,   152064, 0x61cae234
-0,         74,         74,        1,   152064, 0x752a9a2d
-0,         75,         75,        1,   152064, 0x1ee2d9bd
-0,         76,         76,        1,   152064, 0xdce9ab8e
-0,         77,         77,        1,   152064, 0x51225fd0
-0,         78,         78,        1,   152064, 0x10e8cb60
-0,         79,         79,        1,   152064, 0x8d07cd25
-0,         80,         80,        1,   152064, 0xb18ba61b
-0,         81,         81,        1,   152064, 0xb0f10280
-0,         82,         82,        1,   152064, 0x76a71f13
-0,         83,         83,        1,   152064, 0x3004f5a1
-0,         84,         84,        1,   152064, 0x9aba5724
-0,         85,         85,        1,   152064, 0x5db85385
-0,         86,         86,        1,   152064, 0xbe9d3f5b
-0,         87,         87,        1,   152064, 0xa71e85bb
-0,         88,         88,        1,   152064, 0xdcf59cd7
-0,         89,         89,        1,   152064, 0x5e319459
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvmanl2_toshiba_b b/deps/libav/tests/ref/fate/h264-conformance-cvmanl2_toshiba_b
deleted file mode 100644
index 066c57f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvmanl2_toshiba_b
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xb1edd842
-0,          1,          1,        1,   152064, 0x551f8f45
-0,          2,          2,        1,   152064, 0xb4931cb2
-0,          3,          3,        1,   152064, 0x5f352e98
-0,          4,          4,        1,   152064, 0xeba5fe28
-0,          5,          5,        1,   152064, 0x85afad0a
-0,          6,          6,        1,   152064, 0x1120b6a4
-0,          7,          7,        1,   152064, 0x67506e16
-0,          8,          8,        1,   152064, 0x22421437
-0,          9,          9,        1,   152064, 0x929becd6
-0,         10,         10,        1,   152064, 0x6ffcb4b0
-0,         11,         11,        1,   152064, 0x668a5d31
-0,         12,         12,        1,   152064, 0x1b034ebb
-0,         13,         13,        1,   152064, 0x7e2d213c
-0,         14,         14,        1,   152064, 0xbf16d262
-0,         15,         15,        1,   152064, 0xdeaecab3
-0,         16,         16,        1,   152064, 0xd220d704
-0,         17,         17,        1,   152064, 0xb40b8632
-0,         18,         18,        1,   152064, 0xbdf0ef57
-0,         19,         19,        1,   152064, 0x7e2e10df
-0,         20,         20,        1,   152064, 0x95380024
-0,         21,         21,        1,   152064, 0xdb80256d
-0,         22,         22,        1,   152064, 0xa4561c61
-0,         23,         23,        1,   152064, 0x08c8dea4
-0,         24,         24,        1,   152064, 0x7bb917d6
-0,         25,         25,        1,   152064, 0x796f0e2b
-0,         26,         26,        1,   152064, 0x7f40c77a
-0,         27,         27,        1,   152064, 0xda32de2e
-0,         28,         28,        1,   152064, 0x00ffc15a
-0,         29,         29,        1,   152064, 0x643c8316
-0,         30,         30,        1,   152064, 0xb7588f7f
-0,         31,         31,        1,   152064, 0xa4e07c02
-0,         32,         32,        1,   152064, 0xdee0f7e7
-0,         33,         33,        1,   152064, 0x2c3245ee
-0,         34,         34,        1,   152064, 0x6565355b
-0,         35,         35,        1,   152064, 0x90bce66b
-0,         36,         36,        1,   152064, 0x0abffe08
-0,         37,         37,        1,   152064, 0x119ccc3e
-0,         38,         38,        1,   152064, 0xff997ef2
-0,         39,         39,        1,   152064, 0xba4b9820
-0,         40,         40,        1,   152064, 0xb6dfa596
-0,         41,         41,        1,   152064, 0xb0906c42
-0,         42,         42,        1,   152064, 0xf3c29133
-0,         43,         43,        1,   152064, 0x08cd8e2b
-0,         44,         44,        1,   152064, 0x4efc61fb
-0,         45,         45,        1,   152064, 0x5b7c6e48
-0,         46,         46,        1,   152064, 0xd28a47c2
-0,         47,         47,        1,   152064, 0x28e7d51f
-0,         48,         48,        1,   152064, 0x3a5619b1
-0,         49,         49,        1,   152064, 0xa517e7f2
-0,         50,         50,        1,   152064, 0xb4978ef8
-0,         51,         51,        1,   152064, 0x25929175
-0,         52,         52,        1,   152064, 0x20f05834
-0,         53,         53,        1,   152064, 0xba86ffb2
-0,         54,         54,        1,   152064, 0xa265f06f
-0,         55,         55,        1,   152064, 0x97bbbfb7
-0,         56,         56,        1,   152064, 0xfd488a5d
-0,         57,         57,        1,   152064, 0x1b0989da
-0,         58,         58,        1,   152064, 0xfd1878ce
-0,         59,         59,        1,   152064, 0x9360397c
-0,         60,         60,        1,   152064, 0x0d8151a7
-0,         61,         61,        1,   152064, 0xe7a05bb8
-0,         62,         62,        1,   152064, 0x009fd46c
-0,         63,         63,        1,   152064, 0x8751123f
-0,         64,         64,        1,   152064, 0x8252101a
-0,         65,         65,        1,   152064, 0x7f40de4b
-0,         66,         66,        1,   152064, 0x4ea317fe
-0,         67,         67,        1,   152064, 0x519224d9
-0,         68,         68,        1,   152064, 0x59f4ea93
-0,         69,         69,        1,   152064, 0xc93c1dba
-0,         70,         70,        1,   152064, 0xe3c9fb61
-0,         71,         71,        1,   152064, 0x85c4bd98
-0,         72,         72,        1,   152064, 0xcebacfd3
-0,         73,         73,        1,   152064, 0x7327da99
-0,         74,         74,        1,   152064, 0x752a9a2d
-0,         75,         75,        1,   152064, 0x5ea6c8d2
-0,         76,         76,        1,   152064, 0x66fd8c6f
-0,         77,         77,        1,   152064, 0x51225fd0
-0,         78,         78,        1,   152064, 0x58b9be96
-0,         79,         79,        1,   152064, 0xa5abcdb7
-0,         80,         80,        1,   152064, 0xb18ba61b
-0,         81,         81,        1,   152064, 0xc7d20190
-0,         82,         82,        1,   152064, 0xb6da14aa
-0,         83,         83,        1,   152064, 0x3004f5a1
-0,         84,         84,        1,   152064, 0x129354e2
-0,         85,         85,        1,   152064, 0xffa148d5
-0,         86,         86,        1,   152064, 0xbe9d3f5b
-0,         87,         87,        1,   152064, 0x1c7f8976
-0,         88,         88,        1,   152064, 0xa107a54d
-0,         89,         89,        1,   152064, 0x5e319459
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvmapaqp3_sony_e b/deps/libav/tests/ref/fate/h264-conformance-cvmapaqp3_sony_e
deleted file mode 100644
index 094fc98..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvmapaqp3_sony_e
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x80dffda2
-0,          1,          1,        1,   518400, 0x9450183b
-0,          2,          2,        1,   518400, 0x85d429a7
-0,          3,          3,        1,   518400, 0xe1f3b686
-0,          4,          4,        1,   518400, 0x2180c761
-0,          5,          5,        1,   518400, 0x30269c7c
-0,          6,          6,        1,   518400, 0xe9aa575a
-0,          7,          7,        1,   518400, 0x7b815a0a
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvmaqp2_sony_g b/deps/libav/tests/ref/fate/h264-conformance-cvmaqp2_sony_g
deleted file mode 100644
index 886ea4c..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvmaqp2_sony_g
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    36864, 0xdee3d4e3
-0,          1,          1,        1,    36864, 0xaa1a67ca
-0,          2,          2,        1,    36864, 0xe00e0dec
-0,          3,          3,        1,    36864, 0x31f0b63f
-0,          4,          4,        1,    36864, 0xd0cc34d9
-0,          5,          5,        1,    36864, 0x3e76eba5
-0,          6,          6,        1,    36864, 0x0e7dcc9c
-0,          7,          7,        1,    36864, 0xd71bc457
-0,          8,          8,        1,    36864, 0x11c81ebe
-0,          9,          9,        1,    36864, 0x1d4ca6d7
-0,         10,         10,        1,    36864, 0xb191d155
-0,         11,         11,        1,    36864, 0x435a188c
-0,         12,         12,        1,    36864, 0x99d7227c
-0,         13,         13,        1,    36864, 0x700637fc
-0,         14,         14,        1,    36864, 0x351f7dd3
-0,         15,         15,        1,    36864, 0x1658c18b
-0,         16,         16,        1,    36864, 0x60034b90
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvmaqp3_sony_d b/deps/libav/tests/ref/fate/h264-conformance-cvmaqp3_sony_d
deleted file mode 100644
index 7c3d96d..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvmaqp3_sony_d
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    36864, 0xdee3d4e3
-0,          1,          1,        1,    36864, 0xabec8d44
-0,          2,          2,        1,    36864, 0x95d029fe
-0,          3,          3,        1,    36864, 0x4daeb4b9
-0,          4,          4,        1,    36864, 0x320a6301
-0,          5,          5,        1,    36864, 0x6b881d0c
-0,          6,          6,        1,    36864, 0xfe6eda15
-0,          7,          7,        1,    36864, 0xda72d0b2
-0,          8,          8,        1,    36864, 0x3232651b
-0,          9,          9,        1,    36864, 0x9f20cbf1
-0,         10,         10,        1,    36864, 0x5dfbd085
-0,         11,         11,        1,    36864, 0x2bb62dd1
-0,         12,         12,        1,    36864, 0xf8ed11cf
-0,         13,         13,        1,    36864, 0x1ed62476
-0,         14,         14,        1,    36864, 0x65b18976
-0,         15,         15,        1,    36864, 0x1658c18b
-0,         16,         16,        1,    36864, 0x76073a08
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvmp_mot_fld_l30_b b/deps/libav/tests/ref/fate/h264-conformance-cvmp_mot_fld_l30_b
deleted file mode 100644
index 57fa2f7..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvmp_mot_fld_l30_b
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xe9c7643e
-0,          1,          1,        1,   518400, 0xba7456ec
-0,          2,          2,        1,   518400, 0xdeb96749
-0,          3,          3,        1,   518400, 0xa101a986
-0,          4,          4,        1,   518400, 0x3db7baa5
-0,          5,          5,        1,   518400, 0xf3dfcec7
-0,          6,          6,        1,   518400, 0x79b4f537
-0,          7,          7,        1,   518400, 0x9e64fe68
-0,          8,          8,        1,   518400, 0x0e810b53
-0,          9,          9,        1,   518400, 0x20baf3b8
-0,         10,         10,        1,   518400, 0x0a49d341
-0,         11,         11,        1,   518400, 0xa8304ab5
-0,         12,         12,        1,   518400, 0x2600e98f
-0,         13,         13,        1,   518400, 0x9253e3e8
-0,         14,         14,        1,   518400, 0xd6e12783
-0,         15,         15,        1,   518400, 0x6894fc79
-0,         16,         16,        1,   518400, 0xfb60d3e3
-0,         17,         17,        1,   518400, 0x523602be
-0,         18,         18,        1,   518400, 0x4979f409
-0,         19,         19,        1,   518400, 0x50d4e2ab
-0,         20,         20,        1,   518400, 0xa8c2140a
-0,         21,         21,        1,   518400, 0x45c0bc15
-0,         22,         22,        1,   518400, 0xaef78cab
-0,         23,         23,        1,   518400, 0xec539d02
-0,         24,         24,        1,   518400, 0x602585ea
-0,         25,         25,        1,   518400, 0xda263463
-0,         26,         26,        1,   518400, 0xa03d8922
-0,         27,         27,        1,   518400, 0x43ea1c1d
-0,         28,         28,        1,   518400, 0xb1e055a6
-0,         29,         29,        1,   518400, 0x6fff9398
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvmp_mot_frm_l31_b b/deps/libav/tests/ref/fate/h264-conformance-cvmp_mot_frm_l31_b
deleted file mode 100644
index bc7e81e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvmp_mot_frm_l31_b
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x7b2475e3
-0,          1,          1,        1,   518400, 0xda786a87
-0,          2,          2,        1,   518400, 0xb1dd8108
-0,          3,          3,        1,   518400, 0x760ed65d
-0,          4,          4,        1,   518400, 0x8632d20c
-0,          5,          5,        1,   518400, 0xdd81e625
-0,          6,          6,        1,   518400, 0x853f1c41
-0,          7,          7,        1,   518400, 0x20191585
-0,          8,          8,        1,   518400, 0x0367e357
-0,          9,          9,        1,   518400, 0x60521167
-0,         10,         10,        1,   518400, 0xa887d4cc
-0,         11,         11,        1,   518400, 0x9a450f9e
-0,         12,         12,        1,   518400, 0xe9620841
-0,         13,         13,        1,   518400, 0xb482fb0e
-0,         14,         14,        1,   518400, 0x7b79f670
-0,         15,         15,        1,   518400, 0x9d37f1d1
-0,         16,         16,        1,   518400, 0xe358d323
-0,         17,         17,        1,   518400, 0x62ade59c
-0,         18,         18,        1,   518400, 0xdd78da66
-0,         19,         19,        1,   518400, 0xd97b867b
-0,         20,         20,        1,   518400, 0x8a90cf8c
-0,         21,         21,        1,   518400, 0x9d386610
-0,         22,         22,        1,   518400, 0x2c590f46
-0,         23,         23,        1,   518400, 0x92662861
-0,         24,         24,        1,   518400, 0x6979f563
-0,         25,         25,        1,   518400, 0xdd0fa1b2
-0,         26,         26,        1,   518400, 0xccbf1c1c
-0,         27,         27,        1,   518400, 0x7e358112
-0,         28,         28,        1,   518400, 0xb7c0d89d
-0,         29,         29,        1,   518400, 0xc6b03973
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvnlfi1_sony_c b/deps/libav/tests/ref/fate/h264-conformance-cvnlfi1_sony_c
deleted file mode 100644
index aa3c220..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvnlfi1_sony_c
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x0fbb4e71
-0,          1,          1,        1,   518400, 0x4b816734
-0,          2,          2,        1,   518400, 0x0c350f19
-0,          3,          3,        1,   518400, 0xda049cb6
-0,          4,          4,        1,   518400, 0x1f3e7bb9
-0,          5,          5,        1,   518400, 0x995cbe66
-0,          6,          6,        1,   518400, 0x07f7e65c
-0,          7,          7,        1,   518400, 0xfcb7487f
-0,          8,          8,        1,   518400, 0xb080f48a
-0,          9,          9,        1,   518400, 0x3ef5b7e4
-0,         10,         10,        1,   518400, 0xa1518e1c
-0,         11,         11,        1,   518400, 0xb36f1cc9
-0,         12,         12,        1,   518400, 0x86ea48af
-0,         13,         13,        1,   518400, 0xe42373b7
-0,         14,         14,        1,   518400, 0xa8435828
-0,         15,         15,        1,   518400, 0xc942ea0e
-0,         16,         16,        1,   518400, 0xcc597514
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvnlfi2_sony_h b/deps/libav/tests/ref/fate/h264-conformance-cvnlfi2_sony_h
deleted file mode 100644
index fe2e4d1..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvnlfi2_sony_h
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x0fbb4e71
-0,          1,          1,        1,   518400, 0xc46bec04
-0,          2,          2,        1,   518400, 0xc50ffc1d
-0,          3,          3,        1,   518400, 0x684b07b7
-0,          4,          4,        1,   518400, 0xde799af0
-0,          5,          5,        1,   518400, 0xed497b27
-0,          6,          6,        1,   518400, 0x3e9d1e3a
-0,          7,          7,        1,   518400, 0x154d3c5c
-0,          8,          8,        1,   518400, 0x5257e37c
-0,          9,          9,        1,   518400, 0x6e15139a
-0,         10,         10,        1,   518400, 0x5dc39c59
-0,         11,         11,        1,   518400, 0xe1803100
-0,         12,         12,        1,   518400, 0xb4d4d535
-0,         13,         13,        1,   518400, 0x7a97a25d
-0,         14,         14,        1,   518400, 0xf86b8923
-0,         15,         15,        1,   518400, 0x3355be98
-0,         16,         16,        1,   518400, 0x8f555830
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvpa1_toshiba_b b/deps/libav/tests/ref/fate/h264-conformance-cvpa1_toshiba_b
deleted file mode 100644
index fd0911b..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvpa1_toshiba_b
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x128cd77a
-0,          1,          1,        1,   152064, 0x565b9fc1
-0,          2,          2,        1,   152064, 0xbe322679
-0,          3,          3,        1,   152064, 0x0ea4238f
-0,          4,          4,        1,   152064, 0x1e08fb3c
-0,          5,          5,        1,   152064, 0x6da3a93c
-0,          6,          6,        1,   152064, 0x75e5b181
-0,          7,          7,        1,   152064, 0xa0b39334
-0,          8,          8,        1,   152064, 0xa0d10d6d
-0,          9,          9,        1,   152064, 0x33842bcb
-0,         10,         10,        1,   152064, 0x9a74e1e4
-0,         11,         11,        1,   152064, 0xc2037244
-0,         12,         12,        1,   152064, 0x364b8ae4
-0,         13,         13,        1,   152064, 0x18c04971
-0,         14,         14,        1,   152064, 0x7234ecb5
-0,         15,         15,        1,   152064, 0x3719f8bc
-0,         16,         16,        1,   152064, 0x1285ead1
-0,         17,         17,        1,   152064, 0xd3bfab18
-0,         18,         18,        1,   152064, 0x898111e2
-0,         19,         19,        1,   152064, 0x681c15fc
-0,         20,         20,        1,   152064, 0x8e501572
-0,         21,         21,        1,   152064, 0xd7c838be
-0,         22,         22,        1,   152064, 0xede424b2
-0,         23,         23,        1,   152064, 0xcfc20240
-0,         24,         24,        1,   152064, 0x13992e86
-0,         25,         25,        1,   152064, 0x56fb251a
-0,         26,         26,        1,   152064, 0xee9be320
-0,         27,         27,        1,   152064, 0xea650153
-0,         28,         28,        1,   152064, 0x2cb6dabe
-0,         29,         29,        1,   152064, 0xf44fa4b5
-0,         30,         30,        1,   152064, 0xdac2adff
-0,         31,         31,        1,   152064, 0x9e15a1dc
-0,         32,         32,        1,   152064, 0x28d00970
-0,         33,         33,        1,   152064, 0xe4277347
-0,         34,         34,        1,   152064, 0xebd25ad1
-0,         35,         35,        1,   152064, 0x029402da
-0,         36,         36,        1,   152064, 0x1a2311ef
-0,         37,         37,        1,   152064, 0xb86bf96a
-0,         38,         38,        1,   152064, 0x67d7a5b0
-0,         39,         39,        1,   152064, 0x573abc2d
-0,         40,         40,        1,   152064, 0xbe97dec0
-0,         41,         41,        1,   152064, 0x592b91a4
-0,         42,         42,        1,   152064, 0x9adda65e
-0,         43,         43,        1,   152064, 0x0354b2cb
-0,         44,         44,        1,   152064, 0x91e27ff9
-0,         45,         45,        1,   152064, 0x389f8625
-0,         46,         46,        1,   152064, 0x90175850
-0,         47,         47,        1,   152064, 0x2d36c427
-0,         48,         48,        1,   152064, 0xc0dd14ab
-0,         49,         49,        1,   152064, 0xd49bf131
-0,         50,         50,        1,   152064, 0x0d4a9b92
-0,         51,         51,        1,   152064, 0xae9bb2f1
-0,         52,         52,        1,   152064, 0x36847ade
-0,         53,         53,        1,   152064, 0x74810382
-0,         54,         54,        1,   152064, 0xc56d1d9f
-0,         55,         55,        1,   152064, 0xcfefe3ae
-0,         56,         56,        1,   152064, 0xeaa39353
-0,         57,         57,        1,   152064, 0x14289aef
-0,         58,         58,        1,   152064, 0x74ba8f3b
-0,         59,         59,        1,   152064, 0xdcaa518d
-0,         60,         60,        1,   152064, 0x6e4881c2
-0,         61,         61,        1,   152064, 0xa4db767d
-0,         62,         62,        1,   152064, 0x239b0b19
-0,         63,         63,        1,   152064, 0x5d054236
-0,         64,         64,        1,   152064, 0x6f392d7c
-0,         65,         65,        1,   152064, 0x5c2af146
-0,         66,         66,        1,   152064, 0x26b439af
-0,         67,         67,        1,   152064, 0xba7043ab
-0,         68,         68,        1,   152064, 0x0816000c
-0,         69,         69,        1,   152064, 0x3a713c05
-0,         70,         70,        1,   152064, 0xb3111f6d
-0,         71,         71,        1,   152064, 0xdbf8dae2
-0,         72,         72,        1,   152064, 0x09ddf22e
-0,         73,         73,        1,   152064, 0x8871fa7e
-0,         74,         74,        1,   152064, 0x9f5db7a1
-0,         75,         75,        1,   152064, 0xcc38f225
-0,         76,         76,        1,   152064, 0xa1d18df9
-0,         77,         77,        1,   152064, 0x9b1c5d6a
-0,         78,         78,        1,   152064, 0x9f2bc696
-0,         79,         79,        1,   152064, 0xc39bd11a
-0,         80,         80,        1,   152064, 0x4ceca7d0
-0,         81,         81,        1,   152064, 0x63a60f1d
-0,         82,         82,        1,   152064, 0x4cd31f28
-0,         83,         83,        1,   152064, 0x9c9af5d1
-0,         84,         84,        1,   152064, 0x6def65fc
-0,         85,         85,        1,   152064, 0x1011466d
-0,         86,         86,        1,   152064, 0xfeca406d
-0,         87,         87,        1,   152064, 0xd1ca8a1e
-0,         88,         88,        1,   152064, 0x30caa195
-0,         89,         89,        1,   152064, 0x31a09a48
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvpcmnl1_sva_c b/deps/libav/tests/ref/fate/h264-conformance-cvpcmnl1_sva_c
deleted file mode 100644
index 95c9903..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvpcmnl1_sva_c
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x19b8407d
-0,          1,          1,        1,   152064, 0xab8bede6
-0,          2,          2,        1,   152064, 0xf59acd09
-0,          3,          3,        1,   152064, 0xc905853b
-0,          4,          4,        1,   152064, 0x1c3d32f8
-0,          5,          5,        1,   152064, 0x26a91508
-0,          6,          6,        1,   152064, 0x9443e44a
-0,          7,          7,        1,   152064, 0x0d158c55
-0,          8,          8,        1,   152064, 0x4b207062
-0,          9,          9,        1,   152064, 0x31d8543f
-0,         10,         10,        1,   152064, 0x43520337
-0,         11,         11,        1,   152064, 0x4676dd14
-0,         12,         12,        1,   152064, 0x8b4291d4
-0,         13,         13,        1,   152064, 0xb35e4950
-0,         14,         14,        1,   152064, 0xd7164390
-0,         15,         15,        1,   152064, 0x7cce0af7
-0,         16,         16,        1,   152064, 0x4f67ca7d
-0,         17,         17,        1,   152064, 0xd517af08
-0,         18,         18,        1,   152064, 0x519b8322
-0,         19,         19,        1,   152064, 0xa87d2987
-0,         20,         20,        1,   152064, 0xfe8cfd89
-0,         21,         21,        1,   152064, 0x3b40b919
-0,         22,         22,        1,   152064, 0x83398526
-0,         23,         23,        1,   152064, 0x309b6168
-0,         24,         24,        1,   152064, 0xa8351c37
-0,         25,         25,        1,   152064, 0x7977f8fd
-0,         26,         26,        1,   152064, 0x5b24e5a7
-0,         27,         27,        1,   152064, 0x0ad0a48e
-0,         28,         28,        1,   152064, 0xd93a7d3e
-0,         29,         29,        1,   152064, 0xae0f6631
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvpcmnl2_sva_c b/deps/libav/tests/ref/fate/h264-conformance-cvpcmnl2_sva_c
deleted file mode 100644
index 4f92eab..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvpcmnl2_sva_c
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0xccbe6bf8
-0,          1,          1,        1,  1382400, 0x49c0cfd7
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvwp1_toshiba_e b/deps/libav/tests/ref/fate/h264-conformance-cvwp1_toshiba_e
deleted file mode 100644
index b184c84..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvwp1_toshiba_e
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xabf9ae05
-0,          1,          1,        1,   152064, 0x20418b16
-0,          2,          2,        1,   152064, 0xe941572f
-0,          3,          3,        1,   152064, 0xcf63e20e
-0,          4,          4,        1,   152064, 0x57dedcde
-0,          5,          5,        1,   152064, 0x4de7bf34
-0,          6,          6,        1,   152064, 0xc8014983
-0,          7,          7,        1,   152064, 0x5ab946fc
-0,          8,          8,        1,   152064, 0x2ca02582
-0,          9,          9,        1,   152064, 0x9c95435d
-0,         10,         10,        1,   152064, 0x8371b963
-0,         11,         11,        1,   152064, 0xa0f1af67
-0,         12,         12,        1,   152064, 0xf1155345
-0,         13,         13,        1,   152064, 0x66a71c79
-0,         14,         14,        1,   152064, 0x509db08a
-0,         15,         15,        1,   152064, 0x3d457728
-0,         16,         16,        1,   152064, 0x66035e2b
-0,         17,         17,        1,   152064, 0xa4113115
-0,         18,         18,        1,   152064, 0x3d35d3c0
-0,         19,         19,        1,   152064, 0x5117d324
-0,         20,         20,        1,   152064, 0x7b0c7660
-0,         21,         21,        1,   152064, 0x0eacf9ba
-0,         22,         22,        1,   152064, 0x358d0486
-0,         23,         23,        1,   152064, 0xc2dbeadc
-0,         24,         24,        1,   152064, 0x61b2c275
-0,         25,         25,        1,   152064, 0xbb3697d2
-0,         26,         26,        1,   152064, 0x44e58e8a
-0,         27,         27,        1,   152064, 0x21f6464f
-0,         28,         28,        1,   152064, 0xdb3416f2
-0,         29,         29,        1,   152064, 0x8201d928
-0,         30,         30,        1,   152064, 0x4fdfb595
-0,         31,         31,        1,   152064, 0x28cff0a5
-0,         32,         32,        1,   152064, 0x5d77cab2
-0,         33,         33,        1,   152064, 0x2218b509
-0,         34,         34,        1,   152064, 0xaf40790a
-0,         35,         35,        1,   152064, 0xaed42b3b
-0,         36,         36,        1,   152064, 0x866d2462
-0,         37,         37,        1,   152064, 0x23a7111a
-0,         38,         38,        1,   152064, 0xceefc9d0
-0,         39,         39,        1,   152064, 0x88dba819
-0,         40,         40,        1,   152064, 0x19b350f3
-0,         41,         41,        1,   152064, 0x85a857e5
-0,         42,         42,        1,   152064, 0x02ca7c6f
-0,         43,         43,        1,   152064, 0xe2de12d0
-0,         44,         44,        1,   152064, 0x84a36173
-0,         45,         45,        1,   152064, 0xa8d1b139
-0,         46,         46,        1,   152064, 0x6b72ab43
-0,         47,         47,        1,   152064, 0x5fba909e
-0,         48,         48,        1,   152064, 0x43ab27f2
-0,         49,         49,        1,   152064, 0x414cdd60
-0,         50,         50,        1,   152064, 0x080fde7b
-0,         51,         51,        1,   152064, 0xb1b7e4db
-0,         52,         52,        1,   152064, 0xf17db2da
-0,         53,         53,        1,   152064, 0x248b88e9
-0,         54,         54,        1,   152064, 0x6b68301b
-0,         55,         55,        1,   152064, 0xc581100d
-0,         56,         56,        1,   152064, 0x8e9cf443
-0,         57,         57,        1,   152064, 0x3c4ec87a
-0,         58,         58,        1,   152064, 0x6e417a1f
-0,         59,         59,        1,   152064, 0x02c7ecc4
-0,         60,         60,        1,   152064, 0xb7d7f1dc
-0,         61,         61,        1,   152064, 0xc44cf3fa
-0,         62,         62,        1,   152064, 0x0f8db331
-0,         63,         63,        1,   152064, 0x71fe651b
-0,         64,         64,        1,   152064, 0xdd0b9b70
-0,         65,         65,        1,   152064, 0x4f6114c3
-0,         66,         66,        1,   152064, 0x5a64e819
-0,         67,         67,        1,   152064, 0x20bce1a1
-0,         68,         68,        1,   152064, 0x6b196d49
-0,         69,         69,        1,   152064, 0x7c1535a6
-0,         70,         70,        1,   152064, 0x9b5225a4
-0,         71,         71,        1,   152064, 0x72c5f185
-0,         72,         72,        1,   152064, 0x3da4f50d
-0,         73,         73,        1,   152064, 0xd7f7af48
-0,         74,         74,        1,   152064, 0x0e1a8f2e
-0,         75,         75,        1,   152064, 0xb8b036cc
-0,         76,         76,        1,   152064, 0x003a2b62
-0,         77,         77,        1,   152064, 0x7777f6bd
-0,         78,         78,        1,   152064, 0x91003021
-0,         79,         79,        1,   152064, 0xb2e1af8c
-0,         80,         80,        1,   152064, 0xae6676bc
-0,         81,         81,        1,   152064, 0x72f55c98
-0,         82,         82,        1,   152064, 0x9dfb52bc
-0,         83,         83,        1,   152064, 0x4b6b0db4
-0,         84,         84,        1,   152064, 0xba8bab86
-0,         85,         85,        1,   152064, 0x775a8da0
-0,         86,         86,        1,   152064, 0x96a35194
-0,         87,         87,        1,   152064, 0x17732a58
-0,         88,         88,        1,   152064, 0x45eef560
-0,         89,         89,        1,   152064, 0x95c79208
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvwp2_toshiba_e b/deps/libav/tests/ref/fate/h264-conformance-cvwp2_toshiba_e
deleted file mode 100644
index 627f4b8..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvwp2_toshiba_e
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf503fb79
-0,          1,          1,        1,   152064, 0xeaa4ba5d
-0,          2,          2,        1,   152064, 0x50865a33
-0,          3,          3,        1,   152064, 0x34125f86
-0,          4,          4,        1,   152064, 0xc5a8bb68
-0,          5,          5,        1,   152064, 0xe6e9b376
-0,          6,          6,        1,   152064, 0x4e41d48e
-0,          7,          7,        1,   152064, 0xea73cc5d
-0,          8,          8,        1,   152064, 0xc0c60ac0
-0,          9,          9,        1,   152064, 0xd7110670
-0,         10,         10,        1,   152064, 0x00465d0d
-0,         11,         11,        1,   152064, 0xa37a726b
-0,         12,         12,        1,   152064, 0x5dd13b2a
-0,         13,         13,        1,   152064, 0x08471f31
-0,         14,         14,        1,   152064, 0x2bb2b055
-0,         15,         15,        1,   152064, 0xd06d7f1c
-0,         16,         16,        1,   152064, 0x91fde84a
-0,         17,         17,        1,   152064, 0xdbb52d2b
-0,         18,         18,        1,   152064, 0x505c08b4
-0,         19,         19,        1,   152064, 0xd8aeef9f
-0,         20,         20,        1,   152064, 0x4e3f8721
-0,         21,         21,        1,   152064, 0xce534aee
-0,         22,         22,        1,   152064, 0x51f80737
-0,         23,         23,        1,   152064, 0x8fa0e443
-0,         24,         24,        1,   152064, 0xe8c9db17
-0,         25,         25,        1,   152064, 0xc84bcee6
-0,         26,         26,        1,   152064, 0xa7916158
-0,         27,         27,        1,   152064, 0x16149c36
-0,         28,         28,        1,   152064, 0xe55213fd
-0,         29,         29,        1,   152064, 0xa701e59d
-0,         30,         30,        1,   152064, 0xad65e200
-0,         31,         31,        1,   152064, 0x4606dc82
-0,         32,         32,        1,   152064, 0x582f9f64
-0,         33,         33,        1,   152064, 0xc630662a
-0,         34,         34,        1,   152064, 0xe54bacf5
-0,         35,         35,        1,   152064, 0x230e387f
-0,         36,         36,        1,   152064, 0x1a9c746c
-0,         37,         37,        1,   152064, 0xfa002d7c
-0,         38,         38,        1,   152064, 0xe617c4a9
-0,         39,         39,        1,   152064, 0xd3a4df19
-0,         40,         40,        1,   152064, 0x25b9ca8c
-0,         41,         41,        1,   152064, 0x0c505f7c
-0,         42,         42,        1,   152064, 0x43f84f88
-0,         43,         43,        1,   152064, 0x859fb3af
-0,         44,         44,        1,   152064, 0x9680fc13
-0,         45,         45,        1,   152064, 0x3fe6ecb6
-0,         46,         46,        1,   152064, 0xf4c05a9c
-0,         47,         47,        1,   152064, 0x16ba3b13
-0,         48,         48,        1,   152064, 0x72f33fb9
-0,         49,         49,        1,   152064, 0x3076e567
-0,         50,         50,        1,   152064, 0x4e69b604
-0,         51,         51,        1,   152064, 0x9c37a98b
-0,         52,         52,        1,   152064, 0x0d5756c7
-0,         53,         53,        1,   152064, 0xa4a46a81
-0,         54,         54,        1,   152064, 0xadfc89d7
-0,         55,         55,        1,   152064, 0x35693493
-0,         56,         56,        1,   152064, 0xe3baedbf
-0,         57,         57,        1,   152064, 0x78cfb405
-0,         58,         58,        1,   152064, 0xd85c7074
-0,         59,         59,        1,   152064, 0x14ab350e
-0,         60,         60,        1,   152064, 0xaf55433e
-0,         61,         61,        1,   152064, 0x75a8e79f
-0,         62,         62,        1,   152064, 0x2fb599f6
-0,         63,         63,        1,   152064, 0xbe30bdfe
-0,         64,         64,        1,   152064, 0x8b07a5ce
-0,         65,         65,        1,   152064, 0x99b32730
-0,         66,         66,        1,   152064, 0x9265182d
-0,         67,         67,        1,   152064, 0x91e789fd
-0,         68,         68,        1,   152064, 0x1c1e6d16
-0,         69,         69,        1,   152064, 0xfa06bdaa
-0,         70,         70,        1,   152064, 0x7177041f
-0,         71,         71,        1,   152064, 0xd902f99d
-0,         72,         72,        1,   152064, 0x29bdc134
-0,         73,         73,        1,   152064, 0xd713ab76
-0,         74,         74,        1,   152064, 0x60e4788e
-0,         75,         75,        1,   152064, 0xb18c7789
-0,         76,         76,        1,   152064, 0x0b7829a5
-0,         77,         77,        1,   152064, 0xf676d780
-0,         78,         78,        1,   152064, 0xa88a3a57
-0,         79,         79,        1,   152064, 0x825cf289
-0,         80,         80,        1,   152064, 0x78928201
-0,         81,         81,        1,   152064, 0x013a589c
-0,         82,         82,        1,   152064, 0x9269fa64
-0,         83,         83,        1,   152064, 0x6db5f5fa
-0,         84,         84,        1,   152064, 0x49ad9d6a
-0,         85,         85,        1,   152064, 0x1b7c290f
-0,         86,         86,        1,   152064, 0x99716ad1
-0,         87,         87,        1,   152064, 0x371527c2
-0,         88,         88,        1,   152064, 0x9f351841
-0,         89,         89,        1,   152064, 0x884bb432
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvwp3_toshiba_e b/deps/libav/tests/ref/fate/h264-conformance-cvwp3_toshiba_e
deleted file mode 100644
index ca3b7b8..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvwp3_toshiba_e
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x3b3ffd31
-0,          1,          1,        1,   152064, 0x14e0b899
-0,          2,          2,        1,   152064, 0x50865a33
-0,          3,          3,        1,   152064, 0x12e749e5
-0,          4,          4,        1,   152064, 0xe5921130
-0,          5,          5,        1,   152064, 0x2ca3b10d
-0,          6,          6,        1,   152064, 0xa9a39f04
-0,          7,          7,        1,   152064, 0x2c78761a
-0,          8,          8,        1,   152064, 0x70890ad7
-0,          9,          9,        1,   152064, 0x4fc30132
-0,         10,         10,        1,   152064, 0x10e4d2c9
-0,         11,         11,        1,   152064, 0xa3326b50
-0,         12,         12,        1,   152064, 0x8e054bf1
-0,         13,         13,        1,   152064, 0x5bd91687
-0,         14,         14,        1,   152064, 0x70bab119
-0,         15,         15,        1,   152064, 0x9a1ab472
-0,         16,         16,        1,   152064, 0x490776a0
-0,         17,         17,        1,   152064, 0xdbb52d2b
-0,         18,         18,        1,   152064, 0x142714b9
-0,         19,         19,        1,   152064, 0xa051ee6f
-0,         20,         20,        1,   152064, 0xafa97fdf
-0,         21,         21,        1,   152064, 0x1ae67347
-0,         22,         22,        1,   152064, 0xc4f42ed6
-0,         23,         23,        1,   152064, 0x4445dc60
-0,         24,         24,        1,   152064, 0xaef4d04b
-0,         25,         25,        1,   152064, 0x6a51be82
-0,         26,         26,        1,   152064, 0x48356190
-0,         27,         27,        1,   152064, 0xc09b5f5d
-0,         28,         28,        1,   152064, 0x933d3379
-0,         29,         29,        1,   152064, 0xfb57e471
-0,         30,         30,        1,   152064, 0xb5b2f45c
-0,         31,         31,        1,   152064, 0xce36e45e
-0,         32,         32,        1,   152064, 0x582f9f64
-0,         33,         33,        1,   152064, 0x2f45b1fd
-0,         34,         34,        1,   152064, 0x90708fa0
-0,         35,         35,        1,   152064, 0xee483b8f
-0,         36,         36,        1,   152064, 0xd2163e6c
-0,         37,         37,        1,   152064, 0x39492dfe
-0,         38,         38,        1,   152064, 0xf89cc57f
-0,         39,         39,        1,   152064, 0xbfc3c411
-0,         40,         40,        1,   152064, 0x919eb007
-0,         41,         41,        1,   152064, 0x2c526309
-0,         42,         42,        1,   152064, 0x39f067a2
-0,         43,         43,        1,   152064, 0xb7653abb
-0,         44,         44,        1,   152064, 0xe26a035c
-0,         45,         45,        1,   152064, 0xcef1eb3b
-0,         46,         46,        1,   152064, 0xb8b3c55f
-0,         47,         47,        1,   152064, 0x16ba3b13
-0,         48,         48,        1,   152064, 0x153a3117
-0,         49,         49,        1,   152064, 0x90a21859
-0,         50,         50,        1,   152064, 0x9231b756
-0,         51,         51,        1,   152064, 0x65fcbcb9
-0,         52,         52,        1,   152064, 0x447eaf44
-0,         53,         53,        1,   152064, 0xa26b6a8e
-0,         54,         54,        1,   152064, 0x100464f8
-0,         55,         55,        1,   152064, 0x479648ec
-0,         56,         56,        1,   152064, 0x6742f51f
-0,         57,         57,        1,   152064, 0x14e9d906
-0,         58,         58,        1,   152064, 0xa058ab87
-0,         59,         59,        1,   152064, 0x8d093874
-0,         60,         60,        1,   152064, 0xef7f2965
-0,         61,         61,        1,   152064, 0x200d02bd
-0,         62,         62,        1,   152064, 0x2fb599f6
-0,         63,         63,        1,   152064, 0xf65fb6e4
-0,         64,         64,        1,   152064, 0x489a9152
-0,         65,         65,        1,   152064, 0xbe8a2fc2
-0,         66,         66,        1,   152064, 0xea04097e
-0,         67,         67,        1,   152064, 0xaf0cd627
-0,         68,         68,        1,   152064, 0xc0a26b27
-0,         69,         69,        1,   152064, 0x985f67e7
-0,         70,         70,        1,   152064, 0x7d1b4c4c
-0,         71,         71,        1,   152064, 0x9908f838
-0,         72,         72,        1,   152064, 0xb8fef131
-0,         73,         73,        1,   152064, 0xb1feaf6c
-0,         74,         74,        1,   152064, 0x37b16bda
-0,         75,         75,        1,   152064, 0x242471aa
-0,         76,         76,        1,   152064, 0xf18c3839
-0,         77,         77,        1,   152064, 0xf676d780
-0,         78,         78,        1,   152064, 0x17bd0f76
-0,         79,         79,        1,   152064, 0x3703e7a6
-0,         80,         80,        1,   152064, 0x69ba8a8a
-0,         81,         81,        1,   152064, 0x205281b3
-0,         82,         82,        1,   152064, 0x54bf51e1
-0,         83,         83,        1,   152064, 0xf6daf8ed
-0,         84,         84,        1,   152064, 0x8728e805
-0,         85,         85,        1,   152064, 0xe98cd2b0
-0,         86,         86,        1,   152064, 0x7ef76e26
-0,         87,         87,        1,   152064, 0x0fbf5230
-0,         88,         88,        1,   152064, 0x9e4d104b
-0,         89,         89,        1,   152064, 0xd562b815
diff --git a/deps/libav/tests/ref/fate/h264-conformance-cvwp5_toshiba_e b/deps/libav/tests/ref/fate/h264-conformance-cvwp5_toshiba_e
deleted file mode 100644
index 5b48f8f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-cvwp5_toshiba_e
+++ /dev/null
@@ -1,91 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xabf9ae05
-0,          1,          1,        1,   152064, 0x20418b16
-0,          2,          2,        1,   152064, 0x20f72775
-0,          3,          3,        1,   152064, 0x57c07111
-0,          4,          4,        1,   152064, 0x1b49267f
-0,          5,          5,        1,   152064, 0x024cd238
-0,          6,          6,        1,   152064, 0x044d1ae0
-0,          7,          7,        1,   152064, 0xbfec1b59
-0,          8,          8,        1,   152064, 0x1a91f935
-0,          9,          9,        1,   152064, 0x9ee184dc
-0,         10,         10,        1,   152064, 0x65047dbe
-0,         11,         11,        1,   152064, 0xd1632fb5
-0,         12,         12,        1,   152064, 0x56f64c3e
-0,         13,         13,        1,   152064, 0xe6122f37
-0,         14,         14,        1,   152064, 0x0575e670
-0,         15,         15,        1,   152064, 0x3d457728
-0,         16,         16,        1,   152064, 0x6b508105
-0,         17,         17,        1,   152064, 0xcaaf5ea7
-0,         18,         18,        1,   152064, 0x9f4e4501
-0,         19,         19,        1,   152064, 0x1c661a73
-0,         20,         20,        1,   152064, 0x2fd9d1c8
-0,         21,         21,        1,   152064, 0x4ac99ab1
-0,         22,         22,        1,   152064, 0xf2d36809
-0,         23,         23,        1,   152064, 0xa8e32ffb
-0,         24,         24,        1,   152064, 0xd4da2fd2
-0,         25,         25,        1,   152064, 0xac3adde0
-0,         26,         26,        1,   152064, 0xf014ed0f
-0,         27,         27,        1,   152064, 0xca2e7d28
-0,         28,         28,        1,   152064, 0x3a875e51
-0,         29,         29,        1,   152064, 0xc03e4bda
-0,         30,         30,        1,   152064, 0x4fdfb595
-0,         31,         31,        1,   152064, 0x9243f098
-0,         32,         32,        1,   152064, 0x9361bae6
-0,         33,         33,        1,   152064, 0x7a1dadee
-0,         34,         34,        1,   152064, 0x72a59e15
-0,         35,         35,        1,   152064, 0xb5b47170
-0,         36,         36,        1,   152064, 0x5eb16651
-0,         37,         37,        1,   152064, 0xe7894af7
-0,         38,         38,        1,   152064, 0x2683bb0b
-0,         39,         39,        1,   152064, 0x90b4c8c5
-0,         40,         40,        1,   152064, 0xf800c5b5
-0,         41,         41,        1,   152064, 0xc2f5a895
-0,         42,         42,        1,   152064, 0x213c65d4
-0,         43,         43,        1,   152064, 0x01c65a19
-0,         44,         44,        1,   152064, 0xd9f1b04b
-0,         45,         45,        1,   152064, 0xa8d1b139
-0,         46,         46,        1,   152064, 0x2d0cb0cd
-0,         47,         47,        1,   152064, 0x5b0783fe
-0,         48,         48,        1,   152064, 0x29e628ec
-0,         49,         49,        1,   152064, 0x1b8527e5
-0,         50,         50,        1,   152064, 0x4b46d179
-0,         51,         51,        1,   152064, 0x6184c708
-0,         52,         52,        1,   152064, 0x697bb8e2
-0,         53,         53,        1,   152064, 0x5fd3a772
-0,         54,         54,        1,   152064, 0x91456c86
-0,         55,         55,        1,   152064, 0x376c4dae
-0,         56,         56,        1,   152064, 0x00ba2b3f
-0,         57,         57,        1,   152064, 0xf6f0f553
-0,         58,         58,        1,   152064, 0xc0020855
-0,         59,         59,        1,   152064, 0xec3d13d2
-0,         60,         60,        1,   152064, 0xb7d7f1dc
-0,         61,         61,        1,   152064, 0xf9dae37b
-0,         62,         62,        1,   152064, 0x50d9cc93
-0,         63,         63,        1,   152064, 0xba1eb592
-0,         64,         64,        1,   152064, 0x67616557
-0,         65,         65,        1,   152064, 0x09804760
-0,         66,         66,        1,   152064, 0xc2ffba00
-0,         67,         67,        1,   152064, 0xb71fcf46
-0,         68,         68,        1,   152064, 0x6cd975af
-0,         69,         69,        1,   152064, 0x19189167
-0,         70,         70,        1,   152064, 0xbca8fe71
-0,         71,         71,        1,   152064, 0xb0b3f607
-0,         72,         72,        1,   152064, 0x7614d73a
-0,         73,         73,        1,   152064, 0x7de9d87d
-0,         74,         74,        1,   152064, 0x81f58cf2
-0,         75,         75,        1,   152064, 0xb8b036cc
-0,         76,         76,        1,   152064, 0x26d1e2e4
-0,         77,         77,        1,   152064, 0xb41a1e6c
-0,         78,         78,        1,   152064, 0x4f9be4a9
-0,         79,         79,        1,   152064, 0xe95ad5d3
-0,         80,         80,        1,   152064, 0xdffc9335
-0,         81,         81,        1,   152064, 0x01d658c0
-0,         82,         82,        1,   152064, 0x631b4b75
-0,         83,         83,        1,   152064, 0x80ae282f
-0,         84,         84,        1,   152064, 0xb34bf688
-0,         85,         85,        1,   152064, 0xd0cc7d65
-0,         86,         86,        1,   152064, 0x86aa4590
-0,         87,         87,        1,   152064, 0xcb515a57
-0,         88,         88,        1,   152064, 0x68650834
-0,         89,         89,        1,   152064, 0x444ee2a4
diff --git a/deps/libav/tests/ref/fate/h264-conformance-fi1_sony_e b/deps/libav/tests/ref/fate/h264-conformance-fi1_sony_e
deleted file mode 100644
index 6b5e0db..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-fi1_sony_e
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    36864, 0x3d54d3e3
-0,          1,          1,        1,    36864, 0xa9573ef0
-0,          2,          2,        1,    36864, 0x0ea5f263
-0,          3,          3,        1,    36864, 0x5a849fb9
-0,          4,          4,        1,    36864, 0x7ddb1eff
-0,          5,          5,        1,    36864, 0x5e73e3b7
-0,          6,          6,        1,    36864, 0x7d50d329
-0,          7,          7,        1,    36864, 0xf2c2cd27
-0,          8,          8,        1,    36864, 0xdf4f4628
-0,          9,          9,        1,    36864, 0xddd6d5be
-0,         10,         10,        1,    36864, 0xb530e1aa
-0,         11,         11,        1,    36864, 0xeca42470
-0,         12,         12,        1,    36864, 0xa5701caf
-0,         13,         13,        1,    36864, 0x6f5d28fc
-0,         14,         14,        1,    36864, 0xd4ab4ab2
-0,         15,         15,        1,    36864, 0xf2dfcc22
-0,         16,         16,        1,    36864, 0xcaa87e79
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-alphaconformanceg b/deps/libav/tests/ref/fate/h264-conformance-frext-alphaconformanceg
deleted file mode 100644
index dee1c42..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-alphaconformanceg
+++ /dev/null
@@ -1,44 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   783360, 0xbc458a9a
-0,          1,          1,        1,   783360, 0xc2b4a765
-0,          2,          2,        1,   783360, 0x40a8ca87
-0,          3,          3,        1,   783360, 0xdd0cbc2c
-0,          4,          4,        1,   783360, 0xecf8e434
-0,          5,          5,        1,   783360, 0xcc87e3d4
-0,          6,          6,        1,   783360, 0x386e1a34
-0,          7,          7,        1,   783360, 0x6ac4a62e
-0,          8,          8,        1,   783360, 0xf23d89bb
-0,          9,          9,        1,   783360, 0x52f7b94c
-0,         10,         10,        1,   783360, 0x2b4ea2c2
-0,         11,         11,        1,   783360, 0x0a43839c
-0,         12,         12,        1,   783360, 0xad4b81ea
-0,         13,         13,        1,   783360, 0xcb4fe0d4
-0,         14,         14,        1,   783360, 0x6c3ca755
-0,         15,         15,        1,   783360, 0x17d37f49
-0,         16,         16,        1,   783360, 0x8fdfebec
-0,         17,         17,        1,   783360, 0x1a177b49
-0,         18,         18,        1,   783360, 0x72d230ad
-0,         19,         19,        1,   783360, 0x62147d69
-0,         20,         20,        1,   783360, 0xeed9b62c
-0,         21,         21,        1,   783360, 0x7fc45b23
-0,         22,         22,        1,   783360, 0x5dc60681
-0,         23,         23,        1,   783360, 0x2d91c001
-0,         24,         24,        1,   783360, 0x259ab608
-0,         25,         25,        1,   783360, 0x29112b29
-0,         26,         26,        1,   783360, 0x7e4d497e
-0,         27,         27,        1,   783360, 0x616e5507
-0,         28,         28,        1,   783360, 0x299473c9
-0,         29,         29,        1,   783360, 0x4d63d722
-0,         30,         30,        1,   783360, 0xa89e4bc6
-0,         31,         31,        1,   783360, 0xbdef585a
-0,         32,         32,        1,   783360, 0x5b12c72c
-0,         33,         33,        1,   783360, 0x5a884bd8
-0,         34,         34,        1,   783360, 0x97728ade
-0,         35,         35,        1,   783360, 0x27dd8999
-0,         36,         36,        1,   783360, 0x94104d66
-0,         37,         37,        1,   783360, 0xf30244f1
-0,         38,         38,        1,   783360, 0xfc98c63e
-0,         39,         39,        1,   783360, 0x8b27de2e
-0,         40,         40,        1,   783360, 0xfc6bbbf2
-0,         41,         41,        1,   783360, 0x4527b6a3
-0,         42,         42,        1,   783360, 0x4070daf0
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-bcrm_freh10 b/deps/libav/tests/ref/fate/h264-conformance-frext-bcrm_freh10
deleted file mode 100644
index 272a4aa..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-bcrm_freh10
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xbdc2b880
-0,          1,          1,        1,   152064, 0x4ebf93fe
-0,          2,          2,        1,   152064, 0xe30d6871
-0,          3,          3,        1,   152064, 0x04f46b9b
-0,          4,          4,        1,   152064, 0xd7dd219a
-0,          5,          5,        1,   152064, 0x02fc6511
-0,          6,          6,        1,   152064, 0x98868faa
-0,          7,          7,        1,   152064, 0x54b94f92
-0,          8,          8,        1,   152064, 0xe3b6be4b
-0,          9,          9,        1,   152064, 0xf148cf10
-0,         10,         10,        1,   152064, 0xda3239b8
-0,         11,         11,        1,   152064, 0x6c5d7331
-0,         12,         12,        1,   152064, 0x825f1fea
-0,         13,         13,        1,   152064, 0x47791056
-0,         14,         14,        1,   152064, 0xc08e8a58
-0,         15,         15,        1,   152064, 0x020299f3
-0,         16,         16,        1,   152064, 0x0dfd4457
-0,         17,         17,        1,   152064, 0xcf005e68
-0,         18,         18,        1,   152064, 0x1f9e2c32
-0,         19,         19,        1,   152064, 0xa8359324
-0,         20,         20,        1,   152064, 0x4b03752d
-0,         21,         21,        1,   152064, 0xd6281621
-0,         22,         22,        1,   152064, 0xc97ac928
-0,         23,         23,        1,   152064, 0xded90dcd
-0,         24,         24,        1,   152064, 0xd6883255
-0,         25,         25,        1,   152064, 0x6edb4d4f
-0,         26,         26,        1,   152064, 0xd6f93a80
-0,         27,         27,        1,   152064, 0x163d6153
-0,         28,         28,        1,   152064, 0x04b90c06
-0,         29,         29,        1,   152064, 0xee8730c1
-0,         30,         30,        1,   152064, 0xd5f5c669
-0,         31,         31,        1,   152064, 0xcc600b1f
-0,         32,         32,        1,   152064, 0x15ddde03
-0,         33,         33,        1,   152064, 0xd0388dd0
-0,         34,         34,        1,   152064, 0xa292ab7d
-0,         35,         35,        1,   152064, 0xacf584e9
-0,         36,         36,        1,   152064, 0xcef42714
-0,         37,         37,        1,   152064, 0xeb162f35
-0,         38,         38,        1,   152064, 0x0a07de7b
-0,         39,         39,        1,   152064, 0x7ae76c81
-0,         40,         40,        1,   152064, 0x139c8fda
-0,         41,         41,        1,   152064, 0x43724411
-0,         42,         42,        1,   152064, 0x07b2ddea
-0,         43,         43,        1,   152064, 0x831a1cc7
-0,         44,         44,        1,   152064, 0x092f5073
-0,         45,         45,        1,   152064, 0xe5b6d380
-0,         46,         46,        1,   152064, 0xdd30d69e
-0,         47,         47,        1,   152064, 0x887020b2
-0,         48,         48,        1,   152064, 0x84436510
-0,         49,         49,        1,   152064, 0x49f63606
-0,         50,         50,        1,   152064, 0x6b96e959
-0,         51,         51,        1,   152064, 0xc6247cc7
-0,         52,         52,        1,   152064, 0x7a67c532
-0,         53,         53,        1,   152064, 0x93f4c476
-0,         54,         54,        1,   152064, 0x3c119654
-0,         55,         55,        1,   152064, 0xa45f7c72
-0,         56,         56,        1,   152064, 0x2ac50cb0
-0,         57,         57,        1,   152064, 0x9bf16d06
-0,         58,         58,        1,   152064, 0xfa0750d9
-0,         59,         59,        1,   152064, 0x02197630
-0,         60,         60,        1,   152064, 0x6d44f9b5
-0,         61,         61,        1,   152064, 0x86b211f5
-0,         62,         62,        1,   152064, 0xf4fda5d0
-0,         63,         63,        1,   152064, 0x36f840a7
-0,         64,         64,        1,   152064, 0x42412992
-0,         65,         65,        1,   152064, 0xd0c9ba37
-0,         66,         66,        1,   152064, 0xc40eba62
-0,         67,         67,        1,   152064, 0x2d093b53
-0,         68,         68,        1,   152064, 0xee39c69c
-0,         69,         69,        1,   152064, 0xcbbf8968
-0,         70,         70,        1,   152064, 0xfddc1704
-0,         71,         71,        1,   152064, 0x8dc47c61
-0,         72,         72,        1,   152064, 0xf15580bf
-0,         73,         73,        1,   152064, 0x9c71a8b0
-0,         74,         74,        1,   152064, 0x19b90b9f
-0,         75,         75,        1,   152064, 0xb65ae287
-0,         76,         76,        1,   152064, 0xf265693d
-0,         77,         77,        1,   152064, 0x721714a1
-0,         78,         78,        1,   152064, 0x383e8ac5
-0,         79,         79,        1,   152064, 0x02558677
-0,         80,         80,        1,   152064, 0xdaab3cdf
-0,         81,         81,        1,   152064, 0xc939a2f6
-0,         82,         82,        1,   152064, 0x977afa7f
-0,         83,         83,        1,   152064, 0xe5e65f35
-0,         84,         84,        1,   152064, 0x247546fa
-0,         85,         85,        1,   152064, 0x49ff2094
-0,         86,         86,        1,   152064, 0x9fd58cda
-0,         87,         87,        1,   152064, 0x3e31b6e3
-0,         88,         88,        1,   152064, 0x75c6d796
-0,         89,         89,        1,   152064, 0x4ab3e7bb
-0,         90,         90,        1,   152064, 0x393935ea
-0,         91,         91,        1,   152064, 0xc8e62905
-0,         92,         92,        1,   152064, 0xbb149e61
-0,         93,         93,        1,   152064, 0x2553c4c5
-0,         94,         94,        1,   152064, 0x7f82a8b4
-0,         95,         95,        1,   152064, 0x26ef31e6
-0,         96,         96,        1,   152064, 0xf029744a
-0,         97,         97,        1,   152064, 0x0a6f191a
-0,         98,         98,        1,   152064, 0x55808643
-0,         99,         99,        1,   152064, 0x27576172
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh11 b/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh11
deleted file mode 100644
index 3183c4d..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh11
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x9744ac59
-0,          1,          1,        1,   152064, 0x3eba88bf
-0,          2,          2,        1,   152064, 0xd4105c5a
-0,          3,          3,        1,   152064, 0x452966a3
-0,          4,          4,        1,   152064, 0x30071add
-0,          5,          5,        1,   152064, 0x0eb75245
-0,          6,          6,        1,   152064, 0x4daa80fa
-0,          7,          7,        1,   152064, 0xf53a43a1
-0,          8,          8,        1,   152064, 0xa55ab43d
-0,          9,          9,        1,   152064, 0x915ec82e
-0,         10,         10,        1,   152064, 0xadce2f9a
-0,         11,         11,        1,   152064, 0xf7a25715
-0,         12,         12,        1,   152064, 0x90c91c7d
-0,         13,         13,        1,   152064, 0x4f0df4ef
-0,         14,         14,        1,   152064, 0xf6e0783c
-0,         15,         15,        1,   152064, 0x417c8ca8
-0,         16,         16,        1,   152064, 0xd33d29d8
-0,         17,         17,        1,   152064, 0xc9723fa3
-0,         18,         18,        1,   152064, 0x3e4f22f4
-0,         19,         19,        1,   152064, 0xd5aa7bd8
-0,         20,         20,        1,   152064, 0x2a425b54
-0,         21,         21,        1,   152064, 0x2d400788
-0,         22,         22,        1,   152064, 0x12fab3a4
-0,         23,         23,        1,   152064, 0x5544f881
-0,         24,         24,        1,   152064, 0xd0612cc5
-0,         25,         25,        1,   152064, 0x157b3654
-0,         26,         26,        1,   152064, 0x04b61fe0
-0,         27,         27,        1,   152064, 0x897d600a
-0,         28,         28,        1,   152064, 0x0d94fa29
-0,         29,         29,        1,   152064, 0xc0fe249d
-0,         30,         30,        1,   152064, 0x65abc1d6
-0,         31,         31,        1,   152064, 0x2bd5f09d
-0,         32,         32,        1,   152064, 0xd3eebd28
-0,         33,         33,        1,   152064, 0x93458649
-0,         34,         34,        1,   152064, 0x55e793a6
-0,         35,         35,        1,   152064, 0x9fc378ce
-0,         36,         36,        1,   152064, 0x24c32731
-0,         37,         37,        1,   152064, 0x3c321c50
-0,         38,         38,        1,   152064, 0xcef3ca8b
-0,         39,         39,        1,   152064, 0x97116676
-0,         40,         40,        1,   152064, 0x73ae78f6
-0,         41,         41,        1,   152064, 0xdeec219e
-0,         42,         42,        1,   152064, 0xc061d584
-0,         43,         43,        1,   152064, 0xcf47f6c9
-0,         44,         44,        1,   152064, 0x280d3a2d
-0,         45,         45,        1,   152064, 0xb660c846
-0,         46,         46,        1,   152064, 0xe167c588
-0,         47,         47,        1,   152064, 0x08f808de
-0,         48,         48,        1,   152064, 0x9de65c0b
-0,         49,         49,        1,   152064, 0xc52a1937
-0,         50,         50,        1,   152064, 0xf5a4d86f
-0,         51,         51,        1,   152064, 0xbef86d37
-0,         52,         52,        1,   152064, 0xa227b21b
-0,         53,         53,        1,   152064, 0x0601ad35
-0,         54,         54,        1,   152064, 0x15198730
-0,         55,         55,        1,   152064, 0x9af764c6
-0,         56,         56,        1,   152064, 0x1a95e99a
-0,         57,         57,        1,   152064, 0x6bef5aa8
-0,         58,         58,        1,   152064, 0x92f03267
-0,         59,         59,        1,   152064, 0x0a3d56cb
-0,         60,         60,        1,   152064, 0xd9c9f62e
-0,         61,         61,        1,   152064, 0xcd81ea16
-0,         62,         62,        1,   152064, 0x8ed789c0
-0,         63,         63,        1,   152064, 0x5a5e356f
-0,         64,         64,        1,   152064, 0x2f260ebf
-0,         65,         65,        1,   152064, 0xa0379c89
-0,         66,         66,        1,   152064, 0x100cb40c
-0,         67,         67,        1,   152064, 0xaad2220a
-0,         68,         68,        1,   152064, 0xec82aa8d
-0,         69,         69,        1,   152064, 0x91088303
-0,         70,         70,        1,   152064, 0x0cce0e9e
-0,         71,         71,        1,   152064, 0xf3bc716a
-0,         72,         72,        1,   152064, 0x989879c5
-0,         73,         73,        1,   152064, 0x491297a0
-0,         74,         74,        1,   152064, 0xdc16f30d
-0,         75,         75,        1,   152064, 0xb9bfdd57
-0,         76,         76,        1,   152064, 0x5fba59c2
-0,         77,         77,        1,   152064, 0x89c40529
-0,         78,         78,        1,   152064, 0x1b3e7b54
-0,         79,         79,        1,   152064, 0x5d0d7903
-0,         80,         80,        1,   152064, 0x2e3434e1
-0,         81,         81,        1,   152064, 0x1f47a276
-0,         82,         82,        1,   152064, 0xa22de2b1
-0,         83,         83,        1,   152064, 0x77344844
-0,         84,         84,        1,   152064, 0x6a6b3fce
-0,         85,         85,        1,   152064, 0x82660651
-0,         86,         86,        1,   152064, 0x51e67cc9
-0,         87,         87,        1,   152064, 0xb790ae51
-0,         88,         88,        1,   152064, 0x906bc6b6
-0,         89,         89,        1,   152064, 0x55c5dc21
-0,         90,         90,        1,   152064, 0xb51f3004
-0,         91,         91,        1,   152064, 0x68500a25
-0,         92,         92,        1,   152064, 0x5dbc812e
-0,         93,         93,        1,   152064, 0x895eb6ed
-0,         94,         94,        1,   152064, 0x2f5594fc
-0,         95,         95,        1,   152064, 0x04a222a9
-0,         96,         96,        1,   152064, 0x90036f6a
-0,         97,         97,        1,   152064, 0x8b8b064c
-0,         98,         98,        1,   152064, 0xd47c7334
-0,         99,         99,        1,   152064, 0x13f06213
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh3 b/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh3
deleted file mode 100644
index 9a40148..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh3
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x9f9caf3c
-0,          1,          1,        1,   152064, 0x4e8e9dc4
-0,          2,          2,        1,   152064, 0x7eab62be
-0,          3,          3,        1,   152064, 0x79de6e48
-0,          4,          4,        1,   152064, 0x6bb843f3
-0,          5,          5,        1,   152064, 0xd0e96c36
-0,          6,          6,        1,   152064, 0x061a9036
-0,          7,          7,        1,   152064, 0x342c42ea
-0,          8,          8,        1,   152064, 0x9835cfc3
-0,          9,          9,        1,   152064, 0x129ed3dd
-0,         10,         10,        1,   152064, 0x81413cf7
-0,         11,         11,        1,   152064, 0xcd16539e
-0,         12,         12,        1,   152064, 0x927728cd
-0,         13,         13,        1,   152064, 0x5ebd1126
-0,         14,         14,        1,   152064, 0x9ad29eb3
-0,         15,         15,        1,   152064, 0x0ae5a447
-0,         16,         16,        1,   152064, 0xaf275266
-0,         17,         17,        1,   152064, 0x98f96209
-0,         18,         18,        1,   152064, 0x5fcf241f
-0,         19,         19,        1,   152064, 0x17507ee5
-0,         20,         20,        1,   152064, 0xb4ad5f2d
-0,         21,         21,        1,   152064, 0x02fff6da
-0,         22,         22,        1,   152064, 0x8726c662
-0,         23,         23,        1,   152064, 0x8ca707d5
-0,         24,         24,        1,   152064, 0xe41f3946
-0,         25,         25,        1,   152064, 0xc7b34d1e
-0,         26,         26,        1,   152064, 0x25146571
-0,         27,         27,        1,   152064, 0xeb4868f4
-0,         28,         28,        1,   152064, 0xd0fe149d
-0,         29,         29,        1,   152064, 0x31043d0a
-0,         30,         30,        1,   152064, 0xdaf2ba1c
-0,         31,         31,        1,   152064, 0xb474076c
-0,         32,         32,        1,   152064, 0x0cf7f1a2
-0,         33,         33,        1,   152064, 0x2e427793
-0,         34,         34,        1,   152064, 0x08d9a655
-0,         35,         35,        1,   152064, 0x79bc8fc9
-0,         36,         36,        1,   152064, 0xb9871e5c
-0,         37,         37,        1,   152064, 0xca1246df
-0,         38,         38,        1,   152064, 0x08c8d524
-0,         39,         39,        1,   152064, 0xb9be5ecb
-0,         40,         40,        1,   152064, 0x807f87f0
-0,         41,         41,        1,   152064, 0x72eb3ab2
-0,         42,         42,        1,   152064, 0xf463d15f
-0,         43,         43,        1,   152064, 0x857d0471
-0,         44,         44,        1,   152064, 0x5dda5ede
-0,         45,         45,        1,   152064, 0xec33b550
-0,         46,         46,        1,   152064, 0x2217b9bb
-0,         47,         47,        1,   152064, 0x060b0fa4
-0,         48,         48,        1,   152064, 0x5a785b49
-0,         49,         49,        1,   152064, 0x6969268b
-0,         50,         50,        1,   152064, 0xe145d3a4
-0,         51,         51,        1,   152064, 0xb7256e99
-0,         52,         52,        1,   152064, 0x5bbebf16
-0,         53,         53,        1,   152064, 0x9234b31e
-0,         54,         54,        1,   152064, 0x9f0f8c7e
-0,         55,         55,        1,   152064, 0x15e271c4
-0,         56,         56,        1,   152064, 0xe8110297
-0,         57,         57,        1,   152064, 0x1a4364f3
-0,         58,         58,        1,   152064, 0xb7b336f8
-0,         59,         59,        1,   152064, 0x31657acb
-0,         60,         60,        1,   152064, 0xd8e1de00
-0,         61,         61,        1,   152064, 0x9a57117a
-0,         62,         62,        1,   152064, 0xfb828be8
-0,         63,         63,        1,   152064, 0x30bf2ab7
-0,         64,         64,        1,   152064, 0xaf840b27
-0,         65,         65,        1,   152064, 0x900cbcd4
-0,         66,         66,        1,   152064, 0x6439acfc
-0,         67,         67,        1,   152064, 0x716036fd
-0,         68,         68,        1,   152064, 0xc3d9baa8
-0,         69,         69,        1,   152064, 0x455f7d1f
-0,         70,         70,        1,   152064, 0x84c10d78
-0,         71,         71,        1,   152064, 0x2cd76642
-0,         72,         72,        1,   152064, 0x5c746b3a
-0,         73,         73,        1,   152064, 0x92e39e7d
-0,         74,         74,        1,   152064, 0xae610df8
-0,         75,         75,        1,   152064, 0xc8bac3fa
-0,         76,         76,        1,   152064, 0x04be8a35
-0,         77,         77,        1,   152064, 0xaaf91b17
-0,         78,         78,        1,   152064, 0x5afa8764
-0,         79,         79,        1,   152064, 0x31828a12
-0,         80,         80,        1,   152064, 0xf1bd3da9
-0,         81,         81,        1,   152064, 0xbbb2aaef
-0,         82,         82,        1,   152064, 0xcf69efa1
-0,         83,         83,        1,   152064, 0x54e85e1b
-0,         84,         84,        1,   152064, 0x89ff3a1a
-0,         85,         85,        1,   152064, 0x86c80511
-0,         86,         86,        1,   152064, 0x41c886f2
-0,         87,         87,        1,   152064, 0x9f2ebd74
-0,         88,         88,        1,   152064, 0x74d3d0e0
-0,         89,         89,        1,   152064, 0xc79501cc
-0,         90,         90,        1,   152064, 0x123e23e2
-0,         91,         91,        1,   152064, 0xb6122ea0
-0,         92,         92,        1,   152064, 0x551f95df
-0,         93,         93,        1,   152064, 0x0652ac2d
-0,         94,         94,        1,   152064, 0x6483a8ad
-0,         95,         95,        1,   152064, 0x7f632ae2
-0,         96,         96,        1,   152064, 0xae74622f
-0,         97,         97,        1,   152064, 0xdd411339
-0,         98,         98,        1,   152064, 0xff0e7f69
-0,         99,         99,        1,   152064, 0x8b3a5933
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh4 b/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh4
deleted file mode 100644
index ad3a3ec..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh4
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x9744ac59
-0,          1,          1,        1,   152064, 0xe1c69d97
-0,          2,          2,        1,   152064, 0x9ae85f93
-0,          3,          3,        1,   152064, 0x452966a3
-0,          4,          4,        1,   152064, 0xe8192823
-0,          5,          5,        1,   152064, 0x58b764eb
-0,          6,          6,        1,   152064, 0x51b686b1
-0,          7,          7,        1,   152064, 0x4bca5822
-0,          8,          8,        1,   152064, 0x29abc41c
-0,          9,          9,        1,   152064, 0x850ec94f
-0,         10,         10,        1,   152064, 0xac2c34f8
-0,         11,         11,        1,   152064, 0x080c6e67
-0,         12,         12,        1,   152064, 0x5e4e14d2
-0,         13,         13,        1,   152064, 0x978b054c
-0,         14,         14,        1,   152064, 0x861d8c3c
-0,         15,         15,        1,   152064, 0xe0818918
-0,         16,         16,        1,   152064, 0x8b834511
-0,         17,         17,        1,   152064, 0x223f567c
-0,         18,         18,        1,   152064, 0x6d61298d
-0,         19,         19,        1,   152064, 0xfe30826e
-0,         20,         20,        1,   152064, 0x4bad4f98
-0,         21,         21,        1,   152064, 0x69d5fdca
-0,         22,         22,        1,   152064, 0xe45bba1b
-0,         23,         23,        1,   152064, 0xa6d81298
-0,         24,         24,        1,   152064, 0x7f3f2c91
-0,         25,         25,        1,   152064, 0x658754b9
-0,         26,         26,        1,   152064, 0x2c6d3eba
-0,         27,         27,        1,   152064, 0x4500600c
-0,         28,         28,        1,   152064, 0xa745f74b
-0,         29,         29,        1,   152064, 0x2bf21fca
-0,         30,         30,        1,   152064, 0x08b8bdb3
-0,         31,         31,        1,   152064, 0x5a9d0a8b
-0,         32,         32,        1,   152064, 0x3a57d523
-0,         33,         33,        1,   152064, 0x3606826e
-0,         34,         34,        1,   152064, 0x3b91a8fb
-0,         35,         35,        1,   152064, 0x37c28959
-0,         36,         36,        1,   152064, 0xb51d1e75
-0,         37,         37,        1,   152064, 0x13be3f58
-0,         38,         38,        1,   152064, 0x0ed0e7cf
-0,         39,         39,        1,   152064, 0x298560d4
-0,         40,         40,        1,   152064, 0x62b68373
-0,         41,         41,        1,   152064, 0xf8bb4520
-0,         42,         42,        1,   152064, 0x90dfd6af
-0,         43,         43,        1,   152064, 0xf4770d20
-0,         44,         44,        1,   152064, 0x0d9549a0
-0,         45,         45,        1,   152064, 0x004eccb1
-0,         46,         46,        1,   152064, 0x3146d46b
-0,         47,         47,        1,   152064, 0x078d1808
-0,         48,         48,        1,   152064, 0x5d8d60cd
-0,         49,         49,        1,   152064, 0x8ff52dd8
-0,         50,         50,        1,   152064, 0x5aa3ccf7
-0,         51,         51,        1,   152064, 0x5bec6c39
-0,         52,         52,        1,   152064, 0xd44cae9d
-0,         53,         53,        1,   152064, 0xa1b0a151
-0,         54,         54,        1,   152064, 0xe3be7bb2
-0,         55,         55,        1,   152064, 0x50096775
-0,         56,         56,        1,   152064, 0xdffff851
-0,         57,         57,        1,   152064, 0x1d7250eb
-0,         58,         58,        1,   152064, 0x69663ca7
-0,         59,         59,        1,   152064, 0x62f77fc7
-0,         60,         60,        1,   152064, 0xbab8f471
-0,         61,         61,        1,   152064, 0x6af31785
-0,         62,         62,        1,   152064, 0xcbb2a9aa
-0,         63,         63,        1,   152064, 0xc57c32b9
-0,         64,         64,        1,   152064, 0xecbe2ce0
-0,         65,         65,        1,   152064, 0x2fbebf81
-0,         66,         66,        1,   152064, 0xa168af68
-0,         67,         67,        1,   152064, 0x1e5631ac
-0,         68,         68,        1,   152064, 0xe69fc927
-0,         69,         69,        1,   152064, 0x8e5c81d8
-0,         70,         70,        1,   152064, 0x42402010
-0,         71,         71,        1,   152064, 0xd7267482
-0,         72,         72,        1,   152064, 0x64b280df
-0,         73,         73,        1,   152064, 0xc4cbafcc
-0,         74,         74,        1,   152064, 0xcf2f1e8b
-0,         75,         75,        1,   152064, 0x4d6fdb3f
-0,         76,         76,        1,   152064, 0xf22d6fed
-0,         77,         77,        1,   152064, 0x625b167c
-0,         78,         78,        1,   152064, 0x41348089
-0,         79,         79,        1,   152064, 0x6db2779b
-0,         80,         80,        1,   152064, 0xe87030a8
-0,         81,         81,        1,   152064, 0x91b29cdd
-0,         82,         82,        1,   152064, 0xe824f242
-0,         83,         83,        1,   152064, 0xac995380
-0,         84,         84,        1,   152064, 0x7efe361b
-0,         85,         85,        1,   152064, 0xe10c0c26
-0,         86,         86,        1,   152064, 0x93108260
-0,         87,         87,        1,   152064, 0xbf4caed7
-0,         88,         88,        1,   152064, 0xb6a4d826
-0,         89,         89,        1,   152064, 0x78beea4e
-0,         90,         90,        1,   152064, 0xdf612df9
-0,         91,         91,        1,   152064, 0xa9ef2830
-0,         92,         92,        1,   152064, 0x06448895
-0,         93,         93,        1,   152064, 0x332eb6d5
-0,         94,         94,        1,   152064, 0x935ba2c5
-0,         95,         95,        1,   152064, 0x62a22656
-0,         96,         96,        1,   152064, 0x06a670a7
-0,         97,         97,        1,   152064, 0xf60b1af0
-0,         98,         98,        1,   152064, 0x85177c10
-0,         99,         99,        1,   152064, 0x5e4e5c4b
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh5 b/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh5
deleted file mode 100644
index 9057c82..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh5
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xd816ae9a
-0,          1,          1,        1,   152064, 0x970e9c33
-0,          2,          2,        1,   152064, 0xbdd14635
-0,          3,          3,        1,   152064, 0x103f667c
-0,          4,          4,        1,   152064, 0x752b1ebb
-0,          5,          5,        1,   152064, 0x1e9d59d4
-0,          6,          6,        1,   152064, 0x4b9d89b6
-0,          7,          7,        1,   152064, 0x16c1362e
-0,          8,          8,        1,   152064, 0x3ea9a977
-0,          9,          9,        1,   152064, 0x24e3c7fe
-0,         10,         10,        1,   152064, 0xe64132fa
-0,         11,         11,        1,   152064, 0xb2074e31
-0,         12,         12,        1,   152064, 0x87e61824
-0,         13,         13,        1,   152064, 0xf3e7f2d3
-0,         14,         14,        1,   152064, 0x36856b98
-0,         15,         15,        1,   152064, 0xe2be97dd
-0,         16,         16,        1,   152064, 0xb99a3a3d
-0,         17,         17,        1,   152064, 0xf4d04afa
-0,         18,         18,        1,   152064, 0x20a92205
-0,         19,         19,        1,   152064, 0x5f6272ca
-0,         20,         20,        1,   152064, 0xe1f45d11
-0,         21,         21,        1,   152064, 0x7ff113ee
-0,         22,         22,        1,   152064, 0x47e8befb
-0,         23,         23,        1,   152064, 0x562c03c6
-0,         24,         24,        1,   152064, 0x197a311c
-0,         25,         25,        1,   152064, 0x30017402
-0,         26,         26,        1,   152064, 0x27e6384e
-0,         27,         27,        1,   152064, 0x456f6152
-0,         28,         28,        1,   152064, 0x368810d1
-0,         29,         29,        1,   152064, 0x7be61b5f
-0,         30,         30,        1,   152064, 0x5fa9aaef
-0,         31,         31,        1,   152064, 0x957de9da
-0,         32,         32,        1,   152064, 0x47c6bc4f
-0,         33,         33,        1,   152064, 0xb2247b98
-0,         34,         34,        1,   152064, 0xd045a416
-0,         35,         35,        1,   152064, 0xa0b16da9
-0,         36,         36,        1,   152064, 0xe9bd1d8f
-0,         37,         37,        1,   152064, 0xe7881f4d
-0,         38,         38,        1,   152064, 0x85e2d4a9
-0,         39,         39,        1,   152064, 0x00a967cd
-0,         40,         40,        1,   152064, 0x02507278
-0,         41,         41,        1,   152064, 0xc511370e
-0,         42,         42,        1,   152064, 0x7963cf0b
-0,         43,         43,        1,   152064, 0xf99ef0fd
-0,         44,         44,        1,   152064, 0x00813540
-0,         45,         45,        1,   152064, 0xa9aeaf2b
-0,         46,         46,        1,   152064, 0x559eb849
-0,         47,         47,        1,   152064, 0x315605c1
-0,         48,         48,        1,   152064, 0xe2594b7c
-0,         49,         49,        1,   152064, 0x844ef85c
-0,         50,         50,        1,   152064, 0x5012c785
-0,         51,         51,        1,   152064, 0x239f600d
-0,         52,         52,        1,   152064, 0x80a2a156
-0,         53,         53,        1,   152064, 0xec239895
-0,         54,         54,        1,   152064, 0xd7387dbe
-0,         55,         55,        1,   152064, 0xe8aa6125
-0,         56,         56,        1,   152064, 0x4742d997
-0,         57,         57,        1,   152064, 0x88515422
-0,         58,         58,        1,   152064, 0x3dd02167
-0,         59,         59,        1,   152064, 0xe36855d1
-0,         60,         60,        1,   152064, 0x202edeb9
-0,         61,         61,        1,   152064, 0xf5a5eed3
-0,         62,         62,        1,   152064, 0xd3bc6e68
-0,         63,         63,        1,   152064, 0xba902a0a
-0,         64,         64,        1,   152064, 0x4db4f721
-0,         65,         65,        1,   152064, 0x293c90bd
-0,         66,         66,        1,   152064, 0xa651a49f
-0,         67,         67,        1,   152064, 0x5c1a2a7d
-0,         68,         68,        1,   152064, 0xa67986de
-0,         69,         69,        1,   152064, 0xe5fe7d26
-0,         70,         70,        1,   152064, 0xde191b31
-0,         71,         71,        1,   152064, 0x5e303cb1
-0,         72,         72,        1,   152064, 0x657f6d5d
-0,         73,         73,        1,   152064, 0x5c44adaa
-0,         74,         74,        1,   152064, 0x8c3c0422
-0,         75,         75,        1,   152064, 0x161cb54f
-0,         76,         76,        1,   152064, 0xc96355c8
-0,         77,         77,        1,   152064, 0xeb02fdec
-0,         78,         78,        1,   152064, 0xd18a7989
-0,         79,         79,        1,   152064, 0xc7d671bf
-0,         80,         80,        1,   152064, 0x2e1637cc
-0,         81,         81,        1,   152064, 0xd0d5958a
-0,         82,         82,        1,   152064, 0x2f9dd79c
-0,         83,         83,        1,   152064, 0xa96b4dd1
-0,         84,         84,        1,   152064, 0x7bfc2eb9
-0,         85,         85,        1,   152064, 0xc3c91809
-0,         86,         86,        1,   152064, 0x9e167aa3
-0,         87,         87,        1,   152064, 0xb47e9f6e
-0,         88,         88,        1,   152064, 0x70e6c184
-0,         89,         89,        1,   152064, 0x0d92e4e7
-0,         90,         90,        1,   152064, 0xf4891b11
-0,         91,         91,        1,   152064, 0x93f912c7
-0,         92,         92,        1,   152064, 0xa3bc52c5
-0,         93,         93,        1,   152064, 0xc6fca440
-0,         94,         94,        1,   152064, 0x045aa5d4
-0,         95,         95,        1,   152064, 0x15ba1dd0
-0,         96,         96,        1,   152064, 0x59f45a8b
-0,         97,         97,        1,   152064, 0x9dc20832
-0,         98,         98,        1,   152064, 0x36316eb4
-0,         99,         99,        1,   152064, 0x28ba54f4
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh8 b/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh8
deleted file mode 100644
index 4cc7f0e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh8
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xdcc4ac76
-0,          1,          1,        1,   152064, 0xfde6871a
-0,          2,          2,        1,   152064, 0xe8a351b5
-0,          3,          3,        1,   152064, 0x0e586608
-0,          4,          4,        1,   152064, 0xbe3c2adc
-0,          5,          5,        1,   152064, 0x244a5b3c
-0,          6,          6,        1,   152064, 0x7cad919e
-0,          7,          7,        1,   152064, 0x24c452c0
-0,          8,          8,        1,   152064, 0x089dc7f0
-0,          9,          9,        1,   152064, 0x6ee5d1dd
-0,         10,         10,        1,   152064, 0x177430f0
-0,         11,         11,        1,   152064, 0xf2af65f6
-0,         12,         12,        1,   152064, 0x4c4626a7
-0,         13,         13,        1,   152064, 0x897af1da
-0,         14,         14,        1,   152064, 0xf16199b1
-0,         15,         15,        1,   152064, 0x2979a469
-0,         16,         16,        1,   152064, 0x5ce345a0
-0,         17,         17,        1,   152064, 0x1a044ff3
-0,         18,         18,        1,   152064, 0x9075241f
-0,         19,         19,        1,   152064, 0xd1457558
-0,         20,         20,        1,   152064, 0xdfe3669f
-0,         21,         21,        1,   152064, 0x4961fc7a
-0,         22,         22,        1,   152064, 0xb84daee5
-0,         23,         23,        1,   152064, 0xc4efe5c3
-0,         24,         24,        1,   152064, 0x35f73410
-0,         25,         25,        1,   152064, 0xf99a2c73
-0,         26,         26,        1,   152064, 0xe5c12391
-0,         27,         27,        1,   152064, 0xc2056236
-0,         28,         28,        1,   152064, 0xce2bff90
-0,         29,         29,        1,   152064, 0x01d92bb1
-0,         30,         30,        1,   152064, 0xc55eb558
-0,         31,         31,        1,   152064, 0xf02ef0ff
-0,         32,         32,        1,   152064, 0x069dd1c6
-0,         33,         33,        1,   152064, 0x49718229
-0,         34,         34,        1,   152064, 0x0e9ea401
-0,         35,         35,        1,   152064, 0x307e7f8b
-0,         36,         36,        1,   152064, 0xf5071e31
-0,         37,         37,        1,   152064, 0xac2c2ad0
-0,         38,         38,        1,   152064, 0x5586d665
-0,         39,         39,        1,   152064, 0xa62a6a2b
-0,         40,         40,        1,   152064, 0xff167d1b
-0,         41,         41,        1,   152064, 0x02d225c2
-0,         42,         42,        1,   152064, 0x868ccb0b
-0,         43,         43,        1,   152064, 0x36edfa29
-0,         44,         44,        1,   152064, 0xb6244864
-0,         45,         45,        1,   152064, 0xd891b5dc
-0,         46,         46,        1,   152064, 0x9246b763
-0,         47,         47,        1,   152064, 0xea240b61
-0,         48,         48,        1,   152064, 0x2d985877
-0,         49,         49,        1,   152064, 0xe6b92603
-0,         50,         50,        1,   152064, 0x102ac84f
-0,         51,         51,        1,   152064, 0xddaf709b
-0,         52,         52,        1,   152064, 0x48dfb25e
-0,         53,         53,        1,   152064, 0xf2acadbb
-0,         54,         54,        1,   152064, 0x647685f5
-0,         55,         55,        1,   152064, 0x893874c9
-0,         56,         56,        1,   152064, 0xdfd7ed77
-0,         57,         57,        1,   152064, 0x97b36277
-0,         58,         58,        1,   152064, 0x59f33282
-0,         59,         59,        1,   152064, 0xba5c6a0e
-0,         60,         60,        1,   152064, 0x7856ddf0
-0,         61,         61,        1,   152064, 0x74e5f095
-0,         62,         62,        1,   152064, 0x76167a60
-0,         63,         63,        1,   152064, 0xa6cf2255
-0,         64,         64,        1,   152064, 0x9f8b1446
-0,         65,         65,        1,   152064, 0xa775aa79
-0,         66,         66,        1,   152064, 0x5662a698
-0,         67,         67,        1,   152064, 0xe6321e5b
-0,         68,         68,        1,   152064, 0xdaea9a83
-0,         69,         69,        1,   152064, 0xd89d835f
-0,         70,         70,        1,   152064, 0x0b1503e2
-0,         71,         71,        1,   152064, 0x7fef6395
-0,         72,         72,        1,   152064, 0xc27273f2
-0,         73,         73,        1,   152064, 0xff9288fd
-0,         74,         74,        1,   152064, 0xb76aee35
-0,         75,         75,        1,   152064, 0xbd0dc4b2
-0,         76,         76,        1,   152064, 0x3085598e
-0,         77,         77,        1,   152064, 0x22e408f6
-0,         78,         78,        1,   152064, 0xc054866d
-0,         79,         79,        1,   152064, 0x881377f8
-0,         80,         80,        1,   152064, 0x0dd7311e
-0,         81,         81,        1,   152064, 0x627ea688
-0,         82,         82,        1,   152064, 0x95bbe693
-0,         83,         83,        1,   152064, 0x806c480f
-0,         84,         84,        1,   152064, 0x6feb3d47
-0,         85,         85,        1,   152064, 0x639f0a72
-0,         86,         86,        1,   152064, 0x4922909d
-0,         87,         87,        1,   152064, 0x44bbc195
-0,         88,         88,        1,   152064, 0xf119ca8f
-0,         89,         89,        1,   152064, 0x6f46e9c8
-0,         90,         90,        1,   152064, 0xd68e222a
-0,         91,         91,        1,   152064, 0xedc716eb
-0,         92,         92,        1,   152064, 0x090a7702
-0,         93,         93,        1,   152064, 0xc94eac7a
-0,         94,         94,        1,   152064, 0x629d8823
-0,         95,         95,        1,   152064, 0x30a51f8c
-0,         96,         96,        1,   152064, 0x4265666b
-0,         97,         97,        1,   152064, 0x766dfd25
-0,         98,         98,        1,   152064, 0x7dc37c52
-0,         99,         99,        1,   152064, 0x07c65fbe
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh9 b/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh9
deleted file mode 100644
index 44d5d1a..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-brcm_freh9
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x9f9caf3c
-0,          1,          1,        1,   152064, 0x68f285b1
-0,          2,          2,        1,   152064, 0x28bd4987
-0,          3,          3,        1,   152064, 0x79de6e48
-0,          4,          4,        1,   152064, 0x48301bf9
-0,          5,          5,        1,   152064, 0x2c9e516c
-0,          6,          6,        1,   152064, 0xf774946a
-0,          7,          7,        1,   152064, 0x36534317
-0,          8,          8,        1,   152064, 0x98b7bd86
-0,          9,          9,        1,   152064, 0x2aa3d50b
-0,         10,         10,        1,   152064, 0xc4343429
-0,         11,         11,        1,   152064, 0x276c5f04
-0,         12,         12,        1,   152064, 0x042d2916
-0,         13,         13,        1,   152064, 0x777ee739
-0,         14,         14,        1,   152064, 0x1ce186d8
-0,         15,         15,        1,   152064, 0x0ae5a447
-0,         16,         16,        1,   152064, 0x179435a8
-0,         17,         17,        1,   152064, 0x96d743b8
-0,         18,         18,        1,   152064, 0x7dcc26b7
-0,         19,         19,        1,   152064, 0x72c860c8
-0,         20,         20,        1,   152064, 0x12a95052
-0,         21,         21,        1,   152064, 0x1ed00304
-0,         22,         22,        1,   152064, 0xf9f698be
-0,         23,         23,        1,   152064, 0x768ef04d
-0,         24,         24,        1,   152064, 0x873833ee
-0,         25,         25,        1,   152064, 0x1b4a1e1e
-0,         26,         26,        1,   152064, 0x67462224
-0,         27,         27,        1,   152064, 0x0206612a
-0,         28,         28,        1,   152064, 0xd203f197
-0,         29,         29,        1,   152064, 0x5dc020b0
-0,         30,         30,        1,   152064, 0xdaf2ba1c
-0,         31,         31,        1,   152064, 0xad54e4b2
-0,         32,         32,        1,   152064, 0x4273c281
-0,         33,         33,        1,   152064, 0x0655817d
-0,         34,         34,        1,   152064, 0xdea79e1c
-0,         35,         35,        1,   152064, 0x60ae6d1e
-0,         36,         36,        1,   152064, 0x45401d1b
-0,         37,         37,        1,   152064, 0xc6b12160
-0,         38,         38,        1,   152064, 0x163fbde9
-0,         39,         39,        1,   152064, 0x91636a0c
-0,         40,         40,        1,   152064, 0x442173a4
-0,         41,         41,        1,   152064, 0x0f941379
-0,         42,         42,        1,   152064, 0x0649caad
-0,         43,         43,        1,   152064, 0x1238eaa4
-0,         44,         44,        1,   152064, 0x86013d55
-0,         45,         45,        1,   152064, 0xec33b550
-0,         46,         46,        1,   152064, 0x4cc7b33d
-0,         47,         47,        1,   152064, 0x4c93f8ab
-0,         48,         48,        1,   152064, 0x0cf15a34
-0,         49,         49,        1,   152064, 0x04b71770
-0,         50,         50,        1,   152064, 0xf860cea8
-0,         51,         51,        1,   152064, 0x77fb76a3
-0,         52,         52,        1,   152064, 0xa494b27c
-0,         53,         53,        1,   152064, 0xf7a0b0b2
-0,         54,         54,        1,   152064, 0x4cae843b
-0,         55,         55,        1,   152064, 0x590e6403
-0,         56,         56,        1,   152064, 0xe439e63e
-0,         57,         57,        1,   152064, 0xbeca5f92
-0,         58,         58,        1,   152064, 0x31d9164f
-0,         59,         59,        1,   152064, 0xedab54a9
-0,         60,         60,        1,   152064, 0xd8e1de00
-0,         61,         61,        1,   152064, 0xd04fe391
-0,         62,         62,        1,   152064, 0xef6568b3
-0,         63,         63,        1,   152064, 0x859a2811
-0,         64,         64,        1,   152064, 0x9d5ffe6f
-0,         65,         65,        1,   152064, 0x5a679908
-0,         66,         66,        1,   152064, 0xc264a830
-0,         67,         67,        1,   152064, 0xbfdf08c0
-0,         68,         68,        1,   152064, 0x4fd68cb7
-0,         69,         69,        1,   152064, 0x0a7b86f3
-0,         70,         70,        1,   152064, 0xe4fe043b
-0,         71,         71,        1,   152064, 0x8b186a22
-0,         72,         72,        1,   152064, 0xf715765a
-0,         73,         73,        1,   152064, 0xfd7b77e5
-0,         74,         74,        1,   152064, 0x9e3fdd06
-0,         75,         75,        1,   152064, 0xc8bac3fa
-0,         76,         76,        1,   152064, 0x4e83449f
-0,         77,         77,        1,   152064, 0xe5fefcff
-0,         78,         78,        1,   152064, 0x89d77b09
-0,         79,         79,        1,   152064, 0x77fd6f7e
-0,         80,         80,        1,   152064, 0xa7ec356c
-0,         81,         81,        1,   152064, 0x2000aa87
-0,         82,         82,        1,   152064, 0xa9a1e267
-0,         83,         83,        1,   152064, 0xf67c3fcc
-0,         84,         84,        1,   152064, 0x10143acc
-0,         85,         85,        1,   152064, 0xa5fa0476
-0,         86,         86,        1,   152064, 0x2e8d8966
-0,         87,         87,        1,   152064, 0x74ccbbde
-0,         88,         88,        1,   152064, 0xf903b2cf
-0,         89,         89,        1,   152064, 0x66a8d7ab
-0,         90,         90,        1,   152064, 0x123e23e2
-0,         91,         91,        1,   152064, 0x8bd70865
-0,         92,         92,        1,   152064, 0x2b017249
-0,         93,         93,        1,   152064, 0x17f1aba6
-0,         94,         94,        1,   152064, 0x38368449
-0,         95,         95,        1,   152064, 0x72ee1b69
-0,         96,         96,        1,   152064, 0x0f1c6a1d
-0,         97,         97,        1,   152064, 0xbeea0040
-0,         98,         98,        1,   152064, 0x4a9e73b9
-0,         99,         99,        1,   152064, 0x51a46120
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-freh12_b b/deps/libav/tests/ref/fate/h264-conformance-frext-freh12_b
deleted file mode 100644
index 9455cc2..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-freh12_b
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x9f9caf3c
-0,          1,          1,        1,   152064, 0x0ff688a6
-0,          2,          2,        1,   152064, 0x247d4215
-0,          3,          3,        1,   152064, 0x6d075b1b
-0,          4,          4,        1,   152064, 0x23893f77
-0,          5,          5,        1,   152064, 0x46db7dfc
-0,          6,          6,        1,   152064, 0x6438c4b9
-0,          7,          7,        1,   152064, 0x1f468257
-0,          8,          8,        1,   152064, 0xd534ff36
-0,          9,          9,        1,   152064, 0xb230f7b8
-0,         10,         10,        1,   152064, 0xd8f66983
-0,         11,         11,        1,   152064, 0x2068b7a9
-0,         12,         12,        1,   152064, 0xd5748d8c
-0,         13,         13,        1,   152064, 0x1d701770
-0,         14,         14,        1,   152064, 0xe505c973
-0,         15,         15,        1,   152064, 0x0ae5a447
-0,         16,         16,        1,   152064, 0x3cf356bc
-0,         17,         17,        1,   152064, 0x7d735625
-0,         18,         18,        1,   152064, 0x3ce6438f
-0,         19,         19,        1,   152064, 0xef3d947c
-0,         20,         20,        1,   152064, 0xa35872be
-0,         21,         21,        1,   152064, 0xcb9d1a37
-0,         22,         22,        1,   152064, 0x9ad4cda1
-0,         23,         23,        1,   152064, 0xc8d00a24
-0,         24,         24,        1,   152064, 0xadab390b
-0,         25,         25,        1,   152064, 0x530837a5
-0,         26,         26,        1,   152064, 0xfda73274
-0,         27,         27,        1,   152064, 0x7a297022
-0,         28,         28,        1,   152064, 0x0d5f16a1
-0,         29,         29,        1,   152064, 0xb0453e15
-0,         30,         30,        1,   152064, 0xdaf2ba1c
-0,         31,         31,        1,   152064, 0x55e5f451
-0,         32,         32,        1,   152064, 0x723ecbce
-0,         33,         33,        1,   152064, 0xb8376dfa
-0,         34,         34,        1,   152064, 0xf53d97b7
-0,         35,         35,        1,   152064, 0x1e2065cb
-0,         36,         36,        1,   152064, 0x79ab0d75
-0,         37,         37,        1,   152064, 0xc5da27ed
-0,         38,         38,        1,   152064, 0x37c9d744
-0,         39,         39,        1,   152064, 0xa8ab8bc3
-0,         40,         40,        1,   152064, 0xab16a630
-0,         41,         41,        1,   152064, 0xbbd76705
-0,         42,         42,        1,   152064, 0xe67b2032
-0,         43,         43,        1,   152064, 0xe1e02979
-0,         44,         44,        1,   152064, 0xe79260b2
-0,         45,         45,        1,   152064, 0xec33b550
-0,         46,         46,        1,   152064, 0x679cca25
-0,         47,         47,        1,   152064, 0x464b0935
-0,         48,         48,        1,   152064, 0xa4c36a2a
-0,         49,         49,        1,   152064, 0xe9593764
-0,         50,         50,        1,   152064, 0x10f9ff42
-0,         51,         51,        1,   152064, 0x6518a6fa
-0,         52,         52,        1,   152064, 0xd161e4f3
-0,         53,         53,        1,   152064, 0xc9d9be11
-0,         54,         54,        1,   152064, 0x0db78ff6
-0,         55,         55,        1,   152064, 0xd47d7e0f
-0,         56,         56,        1,   152064, 0xdf34e3a3
-0,         57,         57,        1,   152064, 0x13b68bd6
-0,         58,         58,        1,   152064, 0x90e845bd
-0,         59,         59,        1,   152064, 0xb434883a
-0,         60,         60,        1,   152064, 0xd8e1de00
-0,         61,         61,        1,   152064, 0xc9a3df1f
-0,         62,         62,        1,   152064, 0x01476f54
-0,         63,         63,        1,   152064, 0xd52824a4
-0,         64,         64,        1,   152064, 0x63d43662
-0,         65,         65,        1,   152064, 0x40a90d0f
-0,         66,         66,        1,   152064, 0x332b22eb
-0,         67,         67,        1,   152064, 0x1c267e8c
-0,         68,         68,        1,   152064, 0x9be230d3
-0,         69,         69,        1,   152064, 0x0ca308e8
-0,         70,         70,        1,   152064, 0xfb5c5fdd
-0,         71,         71,        1,   152064, 0x0d386358
-0,         72,         72,        1,   152064, 0x3c7148b3
-0,         73,         73,        1,   152064, 0xc2c07dab
-0,         74,         74,        1,   152064, 0x76bbf8eb
-0,         75,         75,        1,   152064, 0xc8bac3fa
-0,         76,         76,        1,   152064, 0x35ef5e12
-0,         77,         77,        1,   152064, 0x5d1fea8d
-0,         78,         78,        1,   152064, 0xafbb54ef
-0,         79,         79,        1,   152064, 0xf5d3396e
-0,         80,         80,        1,   152064, 0xc4f4f8eb
-0,         81,         81,        1,   152064, 0x60a17fa1
-0,         82,         82,        1,   152064, 0x8804cdf9
-0,         83,         83,        1,   152064, 0x3227412f
-0,         84,         84,        1,   152064, 0x130e5026
-0,         85,         85,        1,   152064, 0xcb17344e
-0,         86,         86,        1,   152064, 0x4f0dde70
-0,         87,         87,        1,   152064, 0x57422405
-0,         88,         88,        1,   152064, 0x48070e40
-0,         89,         89,        1,   152064, 0x5c2f134d
-0,         90,         90,        1,   152064, 0x123e23e2
-0,         91,         91,        1,   152064, 0x393c1185
-0,         92,         92,        1,   152064, 0x59919a69
-0,         93,         93,        1,   152064, 0xc1dad5c4
-0,         94,         94,        1,   152064, 0x49b8c9a9
-0,         95,         95,        1,   152064, 0x8dab7b1c
-0,         96,         96,        1,   152064, 0x3a63c0c0
-0,         97,         97,        1,   152064, 0x224860bc
-0,         98,         98,        1,   152064, 0xdc40c9b2
-0,         99,         99,        1,   152064, 0xd3a0b8a1
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-freh1_b b/deps/libav/tests/ref/fate/h264-conformance-frext-freh1_b
deleted file mode 100644
index c5c0b25..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-freh1_b
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x42a3d9ce
-0,          1,          1,        1,   152064, 0xa95cc2ed
-0,          2,          2,        1,   152064, 0xc48f8fdc
-0,          3,          3,        1,   152064, 0x1584b7e8
-0,          4,          4,        1,   152064, 0xd6f34b7e
-0,          5,          5,        1,   152064, 0xbb196ee4
-0,          6,          6,        1,   152064, 0xdfe79cbd
-0,          7,          7,        1,   152064, 0x023799b7
-0,          8,          8,        1,   152064, 0x156b1932
-0,          9,          9,        1,   152064, 0x6dd14765
-0,         10,         10,        1,   152064, 0xd2bd86b9
-0,         11,         11,        1,   152064, 0xee62c71d
-0,         12,         12,        1,   152064, 0x60667d48
-0,         13,         13,        1,   152064, 0x09df084c
-0,         14,         14,        1,   152064, 0xc1a0b8d7
-0,         15,         15,        1,   152064, 0x55adc538
-0,         16,         16,        1,   152064, 0xf6d28a14
-0,         17,         17,        1,   152064, 0x1adab322
-0,         18,         18,        1,   152064, 0xa6c796aa
-0,         19,         19,        1,   152064, 0x60d8dc6a
-0,         20,         20,        1,   152064, 0x20f9c609
-0,         21,         21,        1,   152064, 0x299f4059
-0,         22,         22,        1,   152064, 0x93eb0fea
-0,         23,         23,        1,   152064, 0x76e7547e
-0,         24,         24,        1,   152064, 0xc4b76f90
-0,         25,         25,        1,   152064, 0x4b7a85ea
-0,         26,         26,        1,   152064, 0x2e138df4
-0,         27,         27,        1,   152064, 0x7df1a421
-0,         28,         28,        1,   152064, 0x0e9a1a3e
-0,         29,         29,        1,   152064, 0x56124293
-0,         30,         30,        1,   152064, 0x1faee8f7
-0,         31,         31,        1,   152064, 0x7f551572
-0,         32,         32,        1,   152064, 0x8974cbf0
-0,         33,         33,        1,   152064, 0x1c5dc5e9
-0,         34,         34,        1,   152064, 0x2498eb5b
-0,         35,         35,        1,   152064, 0x861ed634
-0,         36,         36,        1,   152064, 0x0e62a433
-0,         37,         37,        1,   152064, 0xf3648cc0
-0,         38,         38,        1,   152064, 0x69bc344b
-0,         39,         39,        1,   152064, 0x797eaafe
-0,         40,         40,        1,   152064, 0x722fbff8
-0,         41,         41,        1,   152064, 0xa8895582
-0,         42,         42,        1,   152064, 0xde1bcffb
-0,         43,         43,        1,   152064, 0xf558ed3f
-0,         44,         44,        1,   152064, 0xa5173e0e
-0,         45,         45,        1,   152064, 0x6872d018
-0,         46,         46,        1,   152064, 0x6af6c55d
-0,         47,         47,        1,   152064, 0x7c6b1f26
-0,         48,         48,        1,   152064, 0xa8086db3
-0,         49,         49,        1,   152064, 0x70b762e1
-0,         50,         50,        1,   152064, 0x85b7eb76
-0,         51,         51,        1,   152064, 0x3a4393f1
-0,         52,         52,        1,   152064, 0xdabdda42
-0,         53,         53,        1,   152064, 0xbb84b84c
-0,         54,         54,        1,   152064, 0xabe880d8
-0,         55,         55,        1,   152064, 0xe7303cc5
-0,         56,         56,        1,   152064, 0xecdcc142
-0,         57,         57,        1,   152064, 0x591118db
-0,         58,         58,        1,   152064, 0x37a715c6
-0,         59,         59,        1,   152064, 0x9106221e
-0,         60,         60,        1,   152064, 0xb1821a2e
-0,         61,         61,        1,   152064, 0x3adeccdb
-0,         62,         62,        1,   152064, 0xd4ac64a8
-0,         63,         63,        1,   152064, 0x8f34134f
-0,         64,         64,        1,   152064, 0x1f3cf03d
-0,         65,         65,        1,   152064, 0x7b5da3b0
-0,         66,         66,        1,   152064, 0x23f69e68
-0,         67,         67,        1,   152064, 0x67e62093
-0,         68,         68,        1,   152064, 0xf226d12e
-0,         69,         69,        1,   152064, 0x2eb08a1f
-0,         70,         70,        1,   152064, 0x5bb70c54
-0,         71,         71,        1,   152064, 0x2edb3578
-0,         72,         72,        1,   152064, 0x9d0c1b30
-0,         73,         73,        1,   152064, 0xd8266732
-0,         74,         74,        1,   152064, 0xad67cd45
-0,         75,         75,        1,   152064, 0x7a11d3cc
-0,         76,         76,        1,   152064, 0xac534ec1
-0,         77,         77,        1,   152064, 0x7ff6ba17
-0,         78,         78,        1,   152064, 0xf9741b77
-0,         79,         79,        1,   152064, 0x318d25fa
-0,         80,         80,        1,   152064, 0xff4ae686
-0,         81,         81,        1,   152064, 0x26a05ae2
-0,         82,         82,        1,   152064, 0x95619a34
-0,         83,         83,        1,   152064, 0xec2b1136
-0,         84,         84,        1,   152064, 0xf93ebeca
-0,         85,         85,        1,   152064, 0xd8237aaa
-0,         86,         86,        1,   152064, 0x1c362a05
-0,         87,         87,        1,   152064, 0x6fc74faa
-0,         88,         88,        1,   152064, 0x875e5b67
-0,         89,         89,        1,   152064, 0xc04093be
-0,         90,         90,        1,   152064, 0x4c2340a1
-0,         91,         91,        1,   152064, 0x7af99e63
-0,         92,         92,        1,   152064, 0xf5b89a4e
-0,         93,         93,        1,   152064, 0xb7759e48
-0,         94,         94,        1,   152064, 0x61a15c06
-0,         95,         95,        1,   152064, 0x91a5ae4c
-0,         96,         96,        1,   152064, 0x6aedf226
-0,         97,         97,        1,   152064, 0x870dbf36
-0,         98,         98,        1,   152064, 0x814d04a3
-0,         99,         99,        1,   152064, 0xd5a30892
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-freh2_b b/deps/libav/tests/ref/fate/h264-conformance-frext-freh2_b
deleted file mode 100644
index ff12025..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-freh2_b
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x1668b41a
-0,          1,          1,        1,   152064, 0x953ca7fb
-0,          2,          2,        1,   152064, 0x3e38bc6e
-0,          3,          3,        1,   152064, 0x18dff6cc
-0,          4,          4,        1,   152064, 0x03105f7a
-0,          5,          5,        1,   152064, 0x6fe79efb
-0,          6,          6,        1,   152064, 0xbd4ccb6f
-0,          7,          7,        1,   152064, 0xaf398a10
-0,          8,          8,        1,   152064, 0x4f281075
-0,          9,          9,        1,   152064, 0x88f63791
-0,         10,         10,        1,   152064, 0x7500b606
-0,         11,         11,        1,   152064, 0xebebd6e6
-0,         12,         12,        1,   152064, 0x3ed7c35e
-0,         13,         13,        1,   152064, 0xc95826d6
-0,         14,         14,        1,   152064, 0x0989ab63
-0,         15,         15,        1,   152064, 0xddd5d22b
-0,         16,         16,        1,   152064, 0x11683b8a
-0,         17,         17,        1,   152064, 0x5ce36d50
-0,         18,         18,        1,   152064, 0xa5185ccf
-0,         19,         19,        1,   152064, 0xf47583b5
-0,         20,         20,        1,   152064, 0xac6e82b6
-0,         21,         21,        1,   152064, 0xf8dc25c0
-0,         22,         22,        1,   152064, 0x5a6aba8e
-0,         23,         23,        1,   152064, 0x43790f6d
-0,         24,         24,        1,   152064, 0x787c4377
-0,         25,         25,        1,   152064, 0xe6833159
-0,         26,         26,        1,   152064, 0xe5c21131
-0,         27,         27,        1,   152064, 0x16ae69bb
-0,         28,         28,        1,   152064, 0x754fcc9e
-0,         29,         29,        1,   152064, 0x71aaf1e1
-0,         30,         30,        1,   152064, 0xce9de9ee
-0,         31,         31,        1,   152064, 0x05e6d832
-0,         32,         32,        1,   152064, 0x5773b413
-0,         33,         33,        1,   152064, 0xe518881c
-0,         34,         34,        1,   152064, 0xe248bce9
-0,         35,         35,        1,   152064, 0x421e8c0d
-0,         36,         36,        1,   152064, 0x30135143
-0,         37,         37,        1,   152064, 0xf02347f4
-0,         38,         38,        1,   152064, 0x3fa71a0e
-0,         39,         39,        1,   152064, 0x2c14d955
-0,         40,         40,        1,   152064, 0x18b2d558
-0,         41,         41,        1,   152064, 0x54cb7fa2
-0,         42,         42,        1,   152064, 0x90ae2332
-0,         43,         43,        1,   152064, 0x7957129a
-0,         44,         44,        1,   152064, 0x6c9b463e
-0,         45,         45,        1,   152064, 0x8c44e126
-0,         46,         46,        1,   152064, 0xde3ba475
-0,         47,         47,        1,   152064, 0x9823e3ed
-0,         48,         48,        1,   152064, 0x3ce03b21
-0,         49,         49,        1,   152064, 0x930007a2
-0,         50,         50,        1,   152064, 0x6f94bf67
-0,         51,         51,        1,   152064, 0x3e113ce9
-0,         52,         52,        1,   152064, 0xa31c8828
-0,         53,         53,        1,   152064, 0xe65260e0
-0,         54,         54,        1,   152064, 0x4c612620
-0,         55,         55,        1,   152064, 0xdc41f17f
-0,         56,         56,        1,   152064, 0x6d3f6a84
-0,         57,         57,        1,   152064, 0xfb55e9e9
-0,         58,         58,        1,   152064, 0x21e2c8b5
-0,         59,         59,        1,   152064, 0x2d0939a9
-0,         60,         60,        1,   152064, 0xe1f422d2
-0,         61,         61,        1,   152064, 0xab0ad4a3
-0,         62,         62,        1,   152064, 0x948f46df
-0,         63,         63,        1,   152064, 0x61f50c16
-0,         64,         64,        1,   152064, 0x7f5edb05
-0,         65,         65,        1,   152064, 0x8d8c4782
-0,         66,         66,        1,   152064, 0xe8644529
-0,         67,         67,        1,   152064, 0x1e7ce779
-0,         68,         68,        1,   152064, 0x22f355a9
-0,         69,         69,        1,   152064, 0x4dd736d4
-0,         70,         70,        1,   152064, 0x3d968c63
-0,         71,         71,        1,   152064, 0xa629c711
-0,         72,         72,        1,   152064, 0xae87c4c6
-0,         73,         73,        1,   152064, 0xcd482dd2
-0,         74,         74,        1,   152064, 0x6bbbbd25
-0,         75,         75,        1,   152064, 0x4f0ad3d2
-0,         76,         76,        1,   152064, 0x66052e88
-0,         77,         77,        1,   152064, 0xa09dff03
-0,         78,         78,        1,   152064, 0xb3837263
-0,         79,         79,        1,   152064, 0x3c91fdde
-0,         80,         80,        1,   152064, 0x4d9309a9
-0,         81,         81,        1,   152064, 0x6b624164
-0,         82,         82,        1,   152064, 0xaa425ecb
-0,         83,         83,        1,   152064, 0x37aec7c9
-0,         84,         84,        1,   152064, 0xf4b3d359
-0,         85,         85,        1,   152064, 0x85d3af2b
-0,         86,         86,        1,   152064, 0xe5c1f190
-0,         87,         87,        1,   152064, 0x8cb00e09
-0,         88,         88,        1,   152064, 0x59406ebc
-0,         89,         89,        1,   152064, 0xd7ac351f
-0,         90,         90,        1,   152064, 0x998238b6
-0,         91,         91,        1,   152064, 0x8e89d064
-0,         92,         92,        1,   152064, 0x644223c5
-0,         93,         93,        1,   152064, 0x90ad366f
-0,         94,         94,        1,   152064, 0x40a12122
-0,         95,         95,        1,   152064, 0x3045024c
-0,         96,         96,        1,   152064, 0x58673cfb
-0,         97,         97,        1,   152064, 0x567cf1fe
-0,         98,         98,        1,   152064, 0x2d236e41
-0,         99,         99,        1,   152064, 0xc493577d
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-freh6 b/deps/libav/tests/ref/fate/h264-conformance-frext-freh6
deleted file mode 100644
index c769038..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-freh6
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x3b21d6cd
-0,          1,          1,        1,   152064, 0xc32088c6
-0,          2,          2,        1,   152064, 0x65a64cee
-0,          3,          3,        1,   152064, 0x0bd45a5b
-0,          4,          4,        1,   152064, 0xb2210d4d
-0,          5,          5,        1,   152064, 0xf5b15527
-0,          6,          6,        1,   152064, 0x806572ad
-0,          7,          7,        1,   152064, 0x6ecb1fc8
-0,          8,          8,        1,   152064, 0xc25e96d5
-0,          9,          9,        1,   152064, 0x5593b825
-0,         10,         10,        1,   152064, 0xf3be1cff
-0,         11,         11,        1,   152064, 0xa9155072
-0,         12,         12,        1,   152064, 0xd5552e26
-0,         13,         13,        1,   152064, 0x7bf0dbee
-0,         14,         14,        1,   152064, 0x998b4911
-0,         15,         15,        1,   152064, 0xcc71bbe0
-0,         16,         16,        1,   152064, 0x602415b8
-0,         17,         17,        1,   152064, 0xcfff37cf
-0,         18,         18,        1,   152064, 0x7cf824a8
-0,         19,         19,        1,   152064, 0x34816ee5
-0,         20,         20,        1,   152064, 0x1480540c
-0,         21,         21,        1,   152064, 0xc2351aaf
-0,         22,         22,        1,   152064, 0x3b8eac9f
-0,         23,         23,        1,   152064, 0x92a8faf8
-0,         24,         24,        1,   152064, 0x7b6121c8
-0,         25,         25,        1,   152064, 0xe73a3bac
-0,         26,         26,        1,   152064, 0xcd6e1e36
-0,         27,         27,        1,   152064, 0xb24660b1
-0,         28,         28,        1,   152064, 0xa290ec25
-0,         29,         29,        1,   152064, 0x308915ff
-0,         30,         30,        1,   152064, 0x1e8dd4db
-0,         31,         31,        1,   152064, 0x1372f2e0
-0,         32,         32,        1,   152064, 0xa07cc1d0
-0,         33,         33,        1,   152064, 0x34bb872c
-0,         34,         34,        1,   152064, 0x59e6a565
-0,         35,         35,        1,   152064, 0x9a097932
-0,         36,         36,        1,   152064, 0x938f2e20
-0,         37,         37,        1,   152064, 0x59a8157d
-0,         38,         38,        1,   152064, 0x5cacd404
-0,         39,         39,        1,   152064, 0xdad068f5
-0,         40,         40,        1,   152064, 0x7ba67d47
-0,         41,         41,        1,   152064, 0xc2a11e2d
-0,         42,         42,        1,   152064, 0xd37fdef7
-0,         43,         43,        1,   152064, 0x19a3f80a
-0,         44,         44,        1,   152064, 0x7ec7426a
-0,         45,         45,        1,   152064, 0x8ffedb61
-0,         46,         46,        1,   152064, 0x82aebdd0
-0,         47,         47,        1,   152064, 0xdfc920cc
-0,         48,         48,        1,   152064, 0x2a467698
-0,         49,         49,        1,   152064, 0xd08a37d5
-0,         50,         50,        1,   152064, 0xe606e66a
-0,         51,         51,        1,   152064, 0x0e7b8bd8
-0,         52,         52,        1,   152064, 0xf983c732
-0,         53,         53,        1,   152064, 0x9b82c2e7
-0,         54,         54,        1,   152064, 0xa990a47e
-0,         55,         55,        1,   152064, 0x2d5679f1
-0,         56,         56,        1,   152064, 0x7f1c0201
-0,         57,         57,        1,   152064, 0xc38b709d
-0,         58,         58,        1,   152064, 0x040246d8
-0,         59,         59,        1,   152064, 0xbc856021
-0,         60,         60,        1,   152064, 0x81e01a78
-0,         61,         61,        1,   152064, 0xaff1e7f1
-0,         62,         62,        1,   152064, 0x1fee7715
-0,         63,         63,        1,   152064, 0x65053711
-0,         64,         64,        1,   152064, 0x238a0118
-0,         65,         65,        1,   152064, 0x563491b4
-0,         66,         66,        1,   152064, 0x5974a6cc
-0,         67,         67,        1,   152064, 0xd8682c35
-0,         68,         68,        1,   152064, 0x85c49e96
-0,         69,         69,        1,   152064, 0x29486faa
-0,         70,         70,        1,   152064, 0x1a4f0579
-0,         71,         71,        1,   152064, 0x6ab86c2f
-0,         72,         72,        1,   152064, 0x36a36d2b
-0,         73,         73,        1,   152064, 0x3bd77543
-0,         74,         74,        1,   152064, 0x8fbddc41
-0,         75,         75,        1,   152064, 0xccc6e0a5
-0,         76,         76,        1,   152064, 0x00a9539e
-0,         77,         77,        1,   152064, 0x07ba0714
-0,         78,         78,        1,   152064, 0xbab2735d
-0,         79,         79,        1,   152064, 0x79cb5ba0
-0,         80,         80,        1,   152064, 0xdbcc1c92
-0,         81,         81,        1,   152064, 0xffec952c
-0,         82,         82,        1,   152064, 0xc31ac68e
-0,         83,         83,        1,   152064, 0x24293eb9
-0,         84,         84,        1,   152064, 0x7b9b2cb4
-0,         85,         85,        1,   152064, 0x9dd4fe95
-0,         86,         86,        1,   152064, 0xb62e8baf
-0,         87,         87,        1,   152064, 0x9fefc174
-0,         88,         88,        1,   152064, 0xe027c24e
-0,         89,         89,        1,   152064, 0xe38adc70
-0,         90,         90,        1,   152064, 0xc7bf536f
-0,         91,         91,        1,   152064, 0x4448f330
-0,         92,         92,        1,   152064, 0x4dad5339
-0,         93,         93,        1,   152064, 0x48fbab15
-0,         94,         94,        1,   152064, 0xe6c97b2c
-0,         95,         95,        1,   152064, 0x3c3829ee
-0,         96,         96,        1,   152064, 0x927772c0
-0,         97,         97,        1,   152064, 0xbb0f0ef4
-0,         98,         98,        1,   152064, 0xe65780a7
-0,         99,         99,        1,   152064, 0xaf8f6d72
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-freh7_b b/deps/libav/tests/ref/fate/h264-conformance-frext-freh7_b
deleted file mode 100644
index 519c346..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-freh7_b
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x89f2e8d5
-0,          1,          1,        1,   152064, 0x35b99397
-0,          2,          2,        1,   152064, 0x6ef46744
-0,          3,          3,        1,   152064, 0xec4d6c1c
-0,          4,          4,        1,   152064, 0xad6e0c70
-0,          5,          5,        1,   152064, 0x2db534b3
-0,          6,          6,        1,   152064, 0xcbd25ddd
-0,          7,          7,        1,   152064, 0xd90708b4
-0,          8,          8,        1,   152064, 0xc2aa52df
-0,          9,          9,        1,   152064, 0xbcfc84dc
-0,         10,         10,        1,   152064, 0xa5a6d269
-0,         11,         11,        1,   152064, 0x27220ce9
-0,         12,         12,        1,   152064, 0xf075ee6d
-0,         13,         13,        1,   152064, 0x9fd3c2ac
-0,         14,         14,        1,   152064, 0xcba24c2d
-0,         15,         15,        1,   152064, 0x41cd9441
-0,         16,         16,        1,   152064, 0x0126efa3
-0,         17,         17,        1,   152064, 0xf62112af
-0,         18,         18,        1,   152064, 0x35aff50f
-0,         19,         19,        1,   152064, 0xcb0b276f
-0,         20,         20,        1,   152064, 0xc7ef0214
-0,         21,         21,        1,   152064, 0x7f78d387
-0,         22,         22,        1,   152064, 0x266c673d
-0,         23,         23,        1,   152064, 0x1d39c073
-0,         24,         24,        1,   152064, 0x6a3ae455
-0,         25,         25,        1,   152064, 0xe4ce0230
-0,         26,         26,        1,   152064, 0x7f95e87b
-0,         27,         27,        1,   152064, 0x7c552236
-0,         28,         28,        1,   152064, 0x24c799b9
-0,         29,         29,        1,   152064, 0x5042d974
-0,         30,         30,        1,   152064, 0xe934a5b8
-0,         31,         31,        1,   152064, 0x6d59c884
-0,         32,         32,        1,   152064, 0xd00f7fdb
-0,         33,         33,        1,   152064, 0x62ac3ebd
-0,         34,         34,        1,   152064, 0xb40a6c25
-0,         35,         35,        1,   152064, 0x8706188c
-0,         36,         36,        1,   152064, 0x7682e339
-0,         37,         37,        1,   152064, 0x1061d943
-0,         38,         38,        1,   152064, 0x50fa684a
-0,         39,         39,        1,   152064, 0xab4b1975
-0,         40,         40,        1,   152064, 0x2d043acb
-0,         41,         41,        1,   152064, 0xe3c2ec0a
-0,         42,         42,        1,   152064, 0xb9bc99dc
-0,         43,         43,        1,   152064, 0x051fb857
-0,         44,         44,        1,   152064, 0x71d1fe52
-0,         45,         45,        1,   152064, 0x4230c694
-0,         46,         46,        1,   152064, 0xb412a137
-0,         47,         47,        1,   152064, 0x2f50f90d
-0,         48,         48,        1,   152064, 0x68a1466f
-0,         49,         49,        1,   152064, 0x77e3f47b
-0,         50,         50,        1,   152064, 0x4d08de2b
-0,         51,         51,        1,   152064, 0x1fc663be
-0,         52,         52,        1,   152064, 0x2c8ba712
-0,         53,         53,        1,   152064, 0xd50d85b9
-0,         54,         54,        1,   152064, 0xe8483437
-0,         55,         55,        1,   152064, 0x4e331e4c
-0,         56,         56,        1,   152064, 0x0f64a7a0
-0,         57,         57,        1,   152064, 0x797b0b8c
-0,         58,         58,        1,   152064, 0x1b91e6d8
-0,         59,         59,        1,   152064, 0xf3a1f3b6
-0,         60,         60,        1,   152064, 0x2b94bd52
-0,         61,         61,        1,   152064, 0x1f30962e
-0,         62,         62,        1,   152064, 0x853321cf
-0,         63,         63,        1,   152064, 0x8266c0ac
-0,         64,         64,        1,   152064, 0x25498be0
-0,         65,         65,        1,   152064, 0x0f653af9
-0,         66,         66,        1,   152064, 0x0a025f7e
-0,         67,         67,        1,   152064, 0x1cfbae04
-0,         68,         68,        1,   152064, 0x3a874757
-0,         69,         69,        1,   152064, 0x2c67006e
-0,         70,         70,        1,   152064, 0x1d409bce
-0,         71,         71,        1,   152064, 0xfe43121f
-0,         72,         72,        1,   152064, 0x43411830
-0,         73,         73,        1,   152064, 0x536d26ca
-0,         74,         74,        1,   152064, 0x9eb873ea
-0,         75,         75,        1,   152064, 0x093f93ec
-0,         76,         76,        1,   152064, 0xdf6f0381
-0,         77,         77,        1,   152064, 0xa9f4b5e5
-0,         78,         78,        1,   152064, 0x08f71ef8
-0,         79,         79,        1,   152064, 0x7a68f820
-0,         80,         80,        1,   152064, 0xae0c73e7
-0,         81,         81,        1,   152064, 0x886ae6c7
-0,         82,         82,        1,   152064, 0x9357f433
-0,         83,         83,        1,   152064, 0xcc335068
-0,         84,         84,        1,   152064, 0x2ea108ab
-0,         85,         85,        1,   152064, 0x06d7dcb0
-0,         86,         86,        1,   152064, 0x81dc81bc
-0,         87,         87,        1,   152064, 0xfb32b626
-0,         88,         88,        1,   152064, 0x2787d1c7
-0,         89,         89,        1,   152064, 0x69e51118
-0,         90,         90,        1,   152064, 0xba15d94d
-0,         91,         91,        1,   152064, 0xc41c09cf
-0,         92,         92,        1,   152064, 0x7e50e12f
-0,         93,         93,        1,   152064, 0x0763ddbe
-0,         94,         94,        1,   152064, 0x8a09bb88
-0,         95,         95,        1,   152064, 0x530752b7
-0,         96,         96,        1,   152064, 0x9b159923
-0,         97,         97,        1,   152064, 0xcbb83ed3
-0,         98,         98,        1,   152064, 0xdeb5ac0e
-0,         99,         99,        1,   152064, 0x189299d4
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-frext01_jvc_d b/deps/libav/tests/ref/fate/h264-conformance-frext-frext01_jvc_d
deleted file mode 100644
index b82151e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-frext01_jvc_d
+++ /dev/null
@@ -1,17 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x31bc935e
-0,          1,          1,        1,   152064, 0x501ea92a
-0,          2,          2,        1,   152064, 0x8b2f6ead
-0,          3,          3,        1,   152064, 0xa86277e3
-0,          4,          4,        1,   152064, 0xe5936250
-0,          5,          5,        1,   152064, 0x497794cb
-0,          6,          6,        1,   152064, 0xcb34c39a
-0,          7,          7,        1,   152064, 0xa739994d
-0,          8,          8,        1,   152064, 0x01e804b7
-0,          9,          9,        1,   152064, 0xfcf00627
-0,         10,         10,        1,   152064, 0xcd747bda
-0,         11,         11,        1,   152064, 0x1d979394
-0,         12,         12,        1,   152064, 0xd5d52a6a
-0,         13,         13,        1,   152064, 0xd7fb147b
-0,         14,         14,        1,   152064, 0x5d7cb44a
-0,         15,         15,        1,   152064, 0x9b87803b
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-frext02_jvc_c b/deps/libav/tests/ref/fate/h264-conformance-frext-frext02_jvc_c
deleted file mode 100644
index b82151e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-frext02_jvc_c
+++ /dev/null
@@ -1,17 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x31bc935e
-0,          1,          1,        1,   152064, 0x501ea92a
-0,          2,          2,        1,   152064, 0x8b2f6ead
-0,          3,          3,        1,   152064, 0xa86277e3
-0,          4,          4,        1,   152064, 0xe5936250
-0,          5,          5,        1,   152064, 0x497794cb
-0,          6,          6,        1,   152064, 0xcb34c39a
-0,          7,          7,        1,   152064, 0xa739994d
-0,          8,          8,        1,   152064, 0x01e804b7
-0,          9,          9,        1,   152064, 0xfcf00627
-0,         10,         10,        1,   152064, 0xcd747bda
-0,         11,         11,        1,   152064, 0x1d979394
-0,         12,         12,        1,   152064, 0xd5d52a6a
-0,         13,         13,        1,   152064, 0xd7fb147b
-0,         14,         14,        1,   152064, 0x5d7cb44a
-0,         15,         15,        1,   152064, 0x9b87803b
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-frext1_panasonic_c b/deps/libav/tests/ref/fate/h264-conformance-frext-frext1_panasonic_c
deleted file mode 100644
index 81748f7..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-frext1_panasonic_c
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf9c30518
-0,          1,          1,        1,   152064, 0x509dd18f
-0,          2,          2,        1,   152064, 0x7f5c8f07
-0,          3,          3,        1,   152064, 0x8ce42210
-0,          4,          4,        1,   152064, 0x59fd527a
-0,          5,          5,        1,   152064, 0xd987ceea
-0,          6,          6,        1,   152064, 0xc53167fa
-0,          7,          7,        1,   152064, 0xb3179926
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-frext2_panasonic_b b/deps/libav/tests/ref/fate/h264-conformance-frext-frext2_panasonic_b
deleted file mode 100644
index 7c53b5c..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-frext2_panasonic_b
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x0147a2a9
-0,          1,          1,        1,   152064, 0xe2365351
-0,          2,          2,        1,   152064, 0xb5f9daee
-0,          3,          3,        1,   152064, 0xd60818b2
-0,          4,          4,        1,   152064, 0x21b528e5
-0,          5,          5,        1,   152064, 0x9c9dda18
-0,          6,          6,        1,   152064, 0x387fe7de
-0,          7,          7,        1,   152064, 0x8f0c5a1e
-0,          8,          8,        1,   152064, 0x02409694
-0,          9,          9,        1,   152064, 0x2b36a7a7
-0,         10,         10,        1,   152064, 0x3c6d3863
-0,         11,         11,        1,   152064, 0xaa7835e1
-0,         12,         12,        1,   152064, 0x6d105fe7
-0,         13,         13,        1,   152064, 0x9a348732
-0,         14,         14,        1,   152064, 0x96a3af13
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-frext3_panasonic_d b/deps/libav/tests/ref/fate/h264-conformance-frext-frext3_panasonic_d
deleted file mode 100644
index 71b743e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-frext3_panasonic_d
+++ /dev/null
@@ -1,12 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xdd346292
-0,          1,          1,        1,   152064, 0xb07e6efd
-0,          2,          2,        1,   152064, 0x81b4d540
-0,          3,          3,        1,   152064, 0xc50066cf
-0,          4,          4,        1,   152064, 0x30a49588
-0,          5,          5,        1,   152064, 0x57520bfa
-0,          6,          6,        1,   152064, 0xc0409dd9
-0,          7,          7,        1,   152064, 0x8e6453e9
-0,          8,          8,        1,   152064, 0x7ca86d86
-0,          9,          9,        1,   152064, 0xf937b3b5
-0,         10,         10,        1,   152064, 0x6c1f4604
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-frext4_panasonic_a b/deps/libav/tests/ref/fate/h264-conformance-frext-frext4_panasonic_a
deleted file mode 100644
index c0886e4..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-frext4_panasonic_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xd604d440
-0,          1,          1,        1,   152064, 0x08ef262c
-0,          2,          2,        1,   152064, 0x992fca8e
-0,          3,          3,        1,   152064, 0x5a02ee15
-0,          4,          4,        1,   152064, 0xf15d5c66
-0,          5,          5,        1,   152064, 0x360dda12
-0,          6,          6,        1,   152064, 0x18b54985
-0,          7,          7,        1,   152064, 0xf12b6cde
-0,          8,          8,        1,   152064, 0x3b2e63f7
-0,          9,          9,        1,   152064, 0x140abcfd
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-frext_mmco4_sony_b b/deps/libav/tests/ref/fate/h264-conformance-frext-frext_mmco4_sony_b
deleted file mode 100644
index a964a38..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-frext_mmco4_sony_b
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x24846654
-0,          1,          1,        1,   152064, 0xd33945be
-0,          2,          2,        1,   152064, 0x961cbbfb
-0,          3,          3,        1,   152064, 0x91eb854d
-0,          4,          4,        1,   152064, 0x998351b4
-0,          5,          5,        1,   152064, 0xe7515c67
-0,          6,          6,        1,   152064, 0xd32058ae
-0,          7,          7,        1,   152064, 0x99cb5695
-0,          8,          8,        1,   152064, 0x281de175
-0,          9,          9,        1,   152064, 0xf4146f55
-0,         10,         10,        1,   152064, 0x63abbb61
-0,         11,         11,        1,   152064, 0xf44550c5
-0,         12,         12,        1,   152064, 0x5797a5c2
-0,         13,         13,        1,   152064, 0x13b15c60
-0,         14,         14,        1,   152064, 0x6521e682
-0,         15,         15,        1,   152064, 0x780c32a4
-0,         16,         16,        1,   152064, 0x6289f37c
-0,         17,         17,        1,   152064, 0x96d64d81
-0,         18,         18,        1,   152064, 0x12ac80ef
-0,         19,         19,        1,   152064, 0x470956e4
-0,         20,         20,        1,   152064, 0x3954f944
-0,         21,         21,        1,   152064, 0x2147f0db
-0,         22,         22,        1,   152064, 0xca7c9a39
-0,         23,         23,        1,   152064, 0x727e7772
-0,         24,         24,        1,   152064, 0xb3b0f8c8
-0,         25,         25,        1,   152064, 0x6d6eb7ba
-0,         26,         26,        1,   152064, 0x1eaf5734
-0,         27,         27,        1,   152064, 0xd7938056
-0,         28,         28,        1,   152064, 0xcae1ead3
-0,         29,         29,        1,   152064, 0x6411b82c
-0,         30,         30,        1,   152064, 0x6f001718
-0,         31,         31,        1,   152064, 0x3724d9b8
-0,         32,         32,        1,   152064, 0x04501fec
-0,         33,         33,        1,   152064, 0x3f4d13bb
-0,         34,         34,        1,   152064, 0x38f2510a
-0,         35,         35,        1,   152064, 0x5bb71106
-0,         36,         36,        1,   152064, 0xe888b09d
-0,         37,         37,        1,   152064, 0xca6f5f6a
-0,         38,         38,        1,   152064, 0x01c7d329
-0,         39,         39,        1,   152064, 0x4e670932
-0,         40,         40,        1,   152064, 0x651b4984
-0,         41,         41,        1,   152064, 0x76371fa3
-0,         42,         42,        1,   152064, 0x60574af0
-0,         43,         43,        1,   152064, 0xcc1f2080
-0,         44,         44,        1,   152064, 0xdbf29eb6
-0,         45,         45,        1,   152064, 0x8ff870be
-0,         46,         46,        1,   152064, 0x5d39ea56
-0,         47,         47,        1,   152064, 0xabb7c0a5
-0,         48,         48,        1,   152064, 0xecb15771
-0,         49,         49,        1,   152064, 0x571ab1ae
-0,         50,         50,        1,   152064, 0xc0f22bad
-0,         51,         51,        1,   152064, 0x22e7593f
-0,         52,         52,        1,   152064, 0x3c3dee75
-0,         53,         53,        1,   152064, 0x1c80b995
-0,         54,         54,        1,   152064, 0x5ba442fa
-0,         55,         55,        1,   152064, 0xe2291c05
-0,         56,         56,        1,   152064, 0xa780b11e
-0,         57,         57,        1,   152064, 0x15bf83fa
-0,         58,         58,        1,   152064, 0x60fb7c11
-0,         59,         59,        1,   152064, 0x3fb8cee5
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hcaff1_hhi_b b/deps/libav/tests/ref/fate/h264-conformance-frext-hcaff1_hhi_b
deleted file mode 100644
index eb41d46..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hcaff1_hhi_b
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xb055a9bd
-0,          1,          1,        1,   152064, 0x9e1eadb6
-0,          2,          2,        1,   152064, 0x48f117d2
-0,          3,          3,        1,   152064, 0x3e3ff049
-0,          4,          4,        1,   152064, 0x2ff80943
-0,          5,          5,        1,   152064, 0xc5ee16a6
-0,          6,          6,        1,   152064, 0x38c33f28
-0,          7,          7,        1,   152064, 0x3e8444c7
-0,          8,          8,        1,   152064, 0x14ca4ab2
-0,          9,          9,        1,   152064, 0xe20e78f7
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr1_hhi_c b/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr1_hhi_c
deleted file mode 100644
index 285f057..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr1_hhi_c
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xd48c87b3
-0,          1,          1,        1,   152064, 0xb7a67f8f
-0,          2,          2,        1,   152064, 0x3c3f3c11
-0,          3,          3,        1,   152064, 0xc411af54
-0,          4,          4,        1,   152064, 0xde2efb95
-0,          5,          5,        1,   152064, 0xa4787125
-0,          6,          6,        1,   152064, 0x3c17085a
-0,          7,          7,        1,   152064, 0xee217266
-0,          8,          8,        1,   152064, 0xa23a8e9d
-0,          9,          9,        1,   152064, 0x70a06d90
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr2_hhi_a b/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr2_hhi_a
deleted file mode 100644
index 7149850..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr2_hhi_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xd5448f0e
-0,          1,          1,        1,   152064, 0x93d022ba
-0,          2,          2,        1,   152064, 0x1eaed76e
-0,          3,          3,        1,   152064, 0xbbd54f09
-0,          4,          4,        1,   152064, 0x175d6316
-0,          5,          5,        1,   152064, 0x15ede384
-0,          6,          6,        1,   152064, 0xb785e9ac
-0,          7,          7,        1,   152064, 0xdbbb4ee6
-0,          8,          8,        1,   152064, 0xaf27c827
-0,          9,          9,        1,   152064, 0xbf3eeed4
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr3_hhi_a b/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr3_hhi_a
deleted file mode 100644
index 2ec9dce..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr3_hhi_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xd5448f0e
-0,          1,          1,        1,   152064, 0x665e33b5
-0,          2,          2,        1,   152064, 0x6648e99d
-0,          3,          3,        1,   152064, 0xbbd54f09
-0,          4,          4,        1,   152064, 0x3dac7644
-0,          5,          5,        1,   152064, 0xe980f078
-0,          6,          6,        1,   152064, 0xb785e9ac
-0,          7,          7,        1,   152064, 0xa500630e
-0,          8,          8,        1,   152064, 0x6dade9b0
-0,          9,          9,        1,   152064, 0xbf3eeed4
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr4_hhi_a b/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr4_hhi_a
deleted file mode 100644
index 00af8ff..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hcafr4_hhi_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xc7d8832d
-0,          1,          1,        1,   152064, 0x8d9ffc59
-0,          2,          2,        1,   152064, 0xaf3ea0d1
-0,          3,          3,        1,   152064, 0x6805671e
-0,          4,          4,        1,   152064, 0x49202ab8
-0,          5,          5,        1,   152064, 0x6b06b1ad
-0,          6,          6,        1,   152064, 0x909f3e4e
-0,          7,          7,        1,   152064, 0xa4ce28ec
-0,          8,          8,        1,   152064, 0xc3c5b8bc
-0,          9,          9,        1,   152064, 0x78744dac
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hcamff1_hhi_b b/deps/libav/tests/ref/fate/h264-conformance-frext-hcamff1_hhi_b
deleted file mode 100644
index df85212..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hcamff1_hhi_b
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x18f494ec
-0,          1,          1,        1,   152064, 0x7515e6d7
-0,          2,          2,        1,   152064, 0xaa8ee665
-0,          3,          3,        1,   152064, 0xa946e180
-0,          4,          4,        1,   152064, 0xd1467f7e
-0,          5,          5,        1,   152064, 0xd779f4c2
-0,          6,          6,        1,   152064, 0xed456fed
-0,          7,          7,        1,   152064, 0x4ca23a72
-0,          8,          8,        1,   152064, 0x26381cd2
-0,          9,          9,        1,   152064, 0x50df40fa
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpca_brcm_c b/deps/libav/tests/ref/fate/h264-conformance-frext-hpca_brcm_c
deleted file mode 100644
index d608d89..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpca_brcm_c
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x995bb4bd
-0,          1,          1,        1,   152064, 0xad287357
-0,          2,          2,        1,   152064, 0x38fa4661
-0,          3,          3,        1,   152064, 0x8aae73cf
-0,          4,          4,        1,   152064, 0x4a13eada
-0,          5,          5,        1,   152064, 0x48b33901
-0,          6,          6,        1,   152064, 0x011487bc
-0,          7,          7,        1,   152064, 0xd4ce1925
-0,          8,          8,        1,   152064, 0x5d679ddd
-0,          9,          9,        1,   152064, 0x276cd5cf
-0,         10,         10,        1,   152064, 0x99c625f0
-0,         11,         11,        1,   152064, 0xb2f756d1
-0,         12,         12,        1,   152064, 0xb19c2978
-0,         13,         13,        1,   152064, 0xdac0ff3c
-0,         14,         14,        1,   152064, 0x3c1c8d63
-0,         15,         15,        1,   152064, 0x818ea0a8
-0,         16,         16,        1,   152064, 0xa7c122a5
-0,         17,         17,        1,   152064, 0x67ad3519
-0,         18,         18,        1,   152064, 0xc81b2a88
-0,         19,         19,        1,   152064, 0x8ae6633e
-0,         20,         20,        1,   152064, 0xed945788
-0,         21,         21,        1,   152064, 0x4c740bcb
-0,         22,         22,        1,   152064, 0xd8408d09
-0,         23,         23,        1,   152064, 0xb710e8b8
-0,         24,         24,        1,   152064, 0xb8c647b9
-0,         25,         25,        1,   152064, 0x802b2e23
-0,         26,         26,        1,   152064, 0x30672529
-0,         27,         27,        1,   152064, 0x328a72b6
-0,         28,         28,        1,   152064, 0xeb6dbe94
-0,         29,         29,        1,   152064, 0x1c19dcc5
-0,         30,         30,        1,   152064, 0xfdc6b998
-0,         31,         31,        1,   152064, 0xf9e2cd80
-0,         32,         32,        1,   152064, 0x025eb15e
-0,         33,         33,        1,   152064, 0xfd998ad8
-0,         34,         34,        1,   152064, 0x8fdf736f
-0,         35,         35,        1,   152064, 0xa5a7554a
-0,         36,         36,        1,   152064, 0xcea63304
-0,         37,         37,        1,   152064, 0xcb28ec28
-0,         38,         38,        1,   152064, 0x92efb591
-0,         39,         39,        1,   152064, 0x0f2376c3
-0,         40,         40,        1,   152064, 0xe9cb5ecf
-0,         41,         41,        1,   152064, 0xcd2d0eba
-0,         42,         42,        1,   152064, 0xd57fe4fd
-0,         43,         43,        1,   152064, 0xc486ab8e
-0,         44,         44,        1,   152064, 0x01a1f709
-0,         45,         45,        1,   152064, 0x7ac5b13a
-0,         46,         46,        1,   152064, 0x6f519279
-0,         47,         47,        1,   152064, 0xfd7cd9a0
-0,         48,         48,        1,   152064, 0xfae649d2
-0,         49,         49,        1,   152064, 0x618507ca
-0,         50,         50,        1,   152064, 0xb177bc15
-0,         51,         51,        1,   152064, 0x6fa36854
-0,         52,         52,        1,   152064, 0xc13cb77d
-0,         53,         53,        1,   152064, 0x6d40cb01
-0,         54,         54,        1,   152064, 0xa3db96a2
-0,         55,         55,        1,   152064, 0xe5ba6c99
-0,         56,         56,        1,   152064, 0xca9ff3ee
-0,         57,         57,        1,   152064, 0x6c016c65
-0,         58,         58,        1,   152064, 0xdf93ed80
-0,         59,         59,        1,   152064, 0x93112ec8
-0,         60,         60,        1,   152064, 0x8ab3ea14
-0,         61,         61,        1,   152064, 0x02f5b891
-0,         62,         62,        1,   152064, 0xdafd562b
-0,         63,         63,        1,   152064, 0xa96a2bd7
-0,         64,         64,        1,   152064, 0xdff8bc68
-0,         65,         65,        1,   152064, 0x8d956b4b
-0,         66,         66,        1,   152064, 0xb4aeb960
-0,         67,         67,        1,   152064, 0x391cf0dd
-0,         68,         68,        1,   152064, 0x03137de9
-0,         69,         69,        1,   152064, 0x2bfa8c4b
-0,         70,         70,        1,   152064, 0xfb54d3a5
-0,         71,         71,        1,   152064, 0x650146e7
-0,         72,         72,        1,   152064, 0xd3a7765f
-0,         73,         73,        1,   152064, 0x49d72b90
-0,         74,         74,        1,   152064, 0xf089b357
-0,         75,         75,        1,   152064, 0x23a2be41
-0,         76,         76,        1,   152064, 0x2ea86592
-0,         77,         77,        1,   152064, 0x99d6f56b
-0,         78,         78,        1,   152064, 0xc2ca75b9
-0,         79,         79,        1,   152064, 0x390b7278
-0,         80,         80,        1,   152064, 0x0f6d1f1e
-0,         81,         81,        1,   152064, 0x79e2a3f4
-0,         82,         82,        1,   152064, 0x51d5e1da
-0,         83,         83,        1,   152064, 0xdb57419a
-0,         84,         84,        1,   152064, 0xf90a4153
-0,         85,         85,        1,   152064, 0xd192f6c6
-0,         86,         86,        1,   152064, 0x8cd3895a
-0,         87,         87,        1,   152064, 0x0d3ec577
-0,         88,         88,        1,   152064, 0x146e8492
-0,         89,         89,        1,   152064, 0xc9939c22
-0,         90,         90,        1,   152064, 0xf1f4275e
-0,         91,         91,        1,   152064, 0xb898eb35
-0,         92,         92,        1,   152064, 0xed315ee9
-0,         93,         93,        1,   152064, 0x9046b760
-0,         94,         94,        1,   152064, 0x599a736b
-0,         95,         95,        1,   152064, 0xaef20726
-0,         96,         96,        1,   152064, 0x0d136768
-0,         97,         97,        1,   152064, 0xfe4ed2a8
-0,         98,         98,        1,   152064, 0x5a85524b
-0,         99,         99,        1,   152064, 0x6d495dd2
-0,        100,        100,        1,   152064, 0x04bdb815
-0,        101,        101,        1,   152064, 0x28aae1c5
-0,        102,        102,        1,   152064, 0xc20bc8d9
-0,        103,        103,        1,   152064, 0xa33d9b41
-0,        104,        104,        1,   152064, 0x6269cb43
-0,        105,        105,        1,   152064, 0x4f81d636
-0,        106,        106,        1,   152064, 0xc6062166
-0,        107,        107,        1,   152064, 0xb027fbcc
-0,        108,        108,        1,   152064, 0x73a7a584
-0,        109,        109,        1,   152064, 0xf67e520a
-0,        110,        110,        1,   152064, 0x94eff023
-0,        111,        111,        1,   152064, 0xef1da8e5
-0,        112,        112,        1,   152064, 0x2d9ab411
-0,        113,        113,        1,   152064, 0xf0c39b5d
-0,        114,        114,        1,   152064, 0xb2374724
-0,        115,        115,        1,   152064, 0x939a5243
-0,        116,        116,        1,   152064, 0xee3438db
-0,        117,        117,        1,   152064, 0x7da04012
-0,        118,        118,        1,   152064, 0xac611668
-0,        119,        119,        1,   152064, 0xdce3062e
-0,        120,        120,        1,   152064, 0xb57cc00e
-0,        121,        121,        1,   152064, 0xaf96b59e
-0,        122,        122,        1,   152064, 0x56789c13
-0,        123,        123,        1,   152064, 0xb1f678b5
-0,        124,        124,        1,   152064, 0xb340b8c4
-0,        125,        125,        1,   152064, 0x86e6e304
-0,        126,        126,        1,   152064, 0xa056e037
-0,        127,        127,        1,   152064, 0x16885d27
-0,        128,        128,        1,   152064, 0x9c5ac065
-0,        129,        129,        1,   152064, 0x563d5335
-0,        130,        130,        1,   152064, 0x3ca71c1e
-0,        131,        131,        1,   152064, 0xad34e16c
-0,        132,        132,        1,   152064, 0x6d074b27
-0,        133,        133,        1,   152064, 0x9b1c4909
-0,        134,        134,        1,   152064, 0xdbced198
-0,        135,        135,        1,   152064, 0x8a0ded00
-0,        136,        136,        1,   152064, 0x5ffc209b
-0,        137,        137,        1,   152064, 0x47cfd269
-0,        138,        138,        1,   152064, 0xe3c0137e
-0,        139,        139,        1,   152064, 0xcb6a5e53
-0,        140,        140,        1,   152064, 0x87cec05f
-0,        141,        141,        1,   152064, 0x92721dd2
-0,        142,        142,        1,   152064, 0x3f7d7b3b
-0,        143,        143,        1,   152064, 0xd63ef417
-0,        144,        144,        1,   152064, 0xf8e4b05a
-0,        145,        145,        1,   152064, 0xb5dcb421
-0,        146,        146,        1,   152064, 0x53c96f6a
-0,        147,        147,        1,   152064, 0x24ae98a3
-0,        148,        148,        1,   152064, 0x2e9b5fff
-0,        149,        149,        1,   152064, 0x7795bf12
-0,        150,        150,        1,   152064, 0x499d37ca
-0,        151,        151,        1,   152064, 0xfe478487
-0,        152,        152,        1,   152064, 0xcd661afb
-0,        153,        153,        1,   152064, 0x44f8bf00
-0,        154,        154,        1,   152064, 0x90b67809
-0,        155,        155,        1,   152064, 0x8f5726d1
-0,        156,        156,        1,   152064, 0x2e3c39d5
-0,        157,        157,        1,   152064, 0x4b67c4e6
-0,        158,        158,        1,   152064, 0x9fecb7cf
-0,        159,        159,        1,   152064, 0x207766ea
-0,        160,        160,        1,   152064, 0x5846bf7b
-0,        161,        161,        1,   152064, 0x4237fba1
-0,        162,        162,        1,   152064, 0x983e0cbd
-0,        163,        163,        1,   152064, 0x6be100d1
-0,        164,        164,        1,   152064, 0x9d0beb8f
-0,        165,        165,        1,   152064, 0x234b82e7
-0,        166,        166,        1,   152064, 0x83fb5ef1
-0,        167,        167,        1,   152064, 0xf503dcb2
-0,        168,        168,        1,   152064, 0x031a27f2
-0,        169,        169,        1,   152064, 0x2f1abf24
-0,        170,        170,        1,   152064, 0x54d77010
-0,        171,        171,        1,   152064, 0x049fc0fc
-0,        172,        172,        1,   152064, 0x20f2f7e7
-0,        173,        173,        1,   152064, 0xc0d57467
-0,        174,        174,        1,   152064, 0xbe464eef
-0,        175,        175,        1,   152064, 0x035c9052
-0,        176,        176,        1,   152064, 0x91cba4fb
-0,        177,        177,        1,   152064, 0x11cdbbfb
-0,        178,        178,        1,   152064, 0xe61116d5
-0,        179,        179,        1,   152064, 0x16db46b8
-0,        180,        180,        1,   152064, 0x54f30d9f
-0,        181,        181,        1,   152064, 0x211a8d2d
-0,        182,        182,        1,   152064, 0x5a74a56b
-0,        183,        183,        1,   152064, 0x0ff4ba72
-0,        184,        184,        1,   152064, 0x4c398ad6
-0,        185,        185,        1,   152064, 0x830814f0
-0,        186,        186,        1,   152064, 0xa51f4bab
-0,        187,        187,        1,   152064, 0xf3460de6
-0,        188,        188,        1,   152064, 0x7e1979a1
-0,        189,        189,        1,   152064, 0x4b3ebb3a
-0,        190,        190,        1,   152064, 0x83d1f4f8
-0,        191,        191,        1,   152064, 0xfbf08683
-0,        192,        192,        1,   152064, 0x901c07ec
-0,        193,        193,        1,   152064, 0xbc2dc1c7
-0,        194,        194,        1,   152064, 0x6e646b3b
-0,        195,        195,        1,   152064, 0x51a25aab
-0,        196,        196,        1,   152064, 0xa042ab78
-0,        197,        197,        1,   152064, 0xb972af58
-0,        198,        198,        1,   152064, 0xcdca9568
-0,        199,        199,        1,   152064, 0x17b69d1c
-0,        200,        200,        1,   152064, 0x41c43ea2
-0,        201,        201,        1,   152064, 0x195fc7a0
-0,        202,        202,        1,   152064, 0xf4cec580
-0,        203,        203,        1,   152064, 0xb3b10936
-0,        204,        204,        1,   152064, 0x102bc2ec
-0,        205,        205,        1,   152064, 0xc99d4767
-0,        206,        206,        1,   152064, 0x60c745b0
-0,        207,        207,        1,   152064, 0x8176e0cf
-0,        208,        208,        1,   152064, 0xd47e69b5
-0,        209,        209,        1,   152064, 0xacce674c
-0,        210,        210,        1,   152064, 0x031b51f8
-0,        211,        211,        1,   152064, 0x0eb681ef
-0,        212,        212,        1,   152064, 0x0b69334b
-0,        213,        213,        1,   152064, 0xda819c1f
-0,        214,        214,        1,   152064, 0xa93f62d2
-0,        215,        215,        1,   152064, 0x51374db5
-0,        216,        216,        1,   152064, 0x885dccff
-0,        217,        217,        1,   152064, 0xd0780444
-0,        218,        218,        1,   152064, 0xa31733ca
-0,        219,        219,        1,   152064, 0x3f3de84e
-0,        220,        220,        1,   152064, 0x2af2b2c3
-0,        221,        221,        1,   152064, 0xa62dceae
-0,        222,        222,        1,   152064, 0xca1cffd1
-0,        223,        223,        1,   152064, 0x3c7d561b
-0,        224,        224,        1,   152064, 0xbc04130a
-0,        225,        225,        1,   152064, 0xbd2829ae
-0,        226,        226,        1,   152064, 0xdbbb9820
-0,        227,        227,        1,   152064, 0xfc3ef628
-0,        228,        228,        1,   152064, 0xd5da3ec3
-0,        229,        229,        1,   152064, 0x62d5fcc1
-0,        230,        230,        1,   152064, 0x455a8dae
-0,        231,        231,        1,   152064, 0x421c9147
-0,        232,        232,        1,   152064, 0x6a168484
-0,        233,        233,        1,   152064, 0x7ba15d32
-0,        234,        234,        1,   152064, 0xd089ed27
-0,        235,        235,        1,   152064, 0x8fc4d894
-0,        236,        236,        1,   152064, 0x99e47125
-0,        237,        237,        1,   152064, 0xf55dda68
-0,        238,        238,        1,   152064, 0x6bf06cf1
-0,        239,        239,        1,   152064, 0x7dc41a9d
-0,        240,        240,        1,   152064, 0x78b84019
-0,        241,        241,        1,   152064, 0x85ae8973
-0,        242,        242,        1,   152064, 0x7b7aeabe
-0,        243,        243,        1,   152064, 0xf9a8f6bf
-0,        244,        244,        1,   152064, 0xe195ddcd
-0,        245,        245,        1,   152064, 0x83edffe9
-0,        246,        246,        1,   152064, 0x59cce97a
-0,        247,        247,        1,   152064, 0x15268af1
-0,        248,        248,        1,   152064, 0x270cca95
-0,        249,        249,        1,   152064, 0x8bced1f9
-0,        250,        250,        1,   152064, 0x08ee5cec
-0,        251,        251,        1,   152064, 0x01e74f95
-0,        252,        252,        1,   152064, 0x7e19238f
-0,        253,        253,        1,   152064, 0x6bcb2b9d
-0,        254,        254,        1,   152064, 0x58111385
-0,        255,        255,        1,   152064, 0x6c7aa1f7
-0,        256,        256,        1,   152064, 0xb713a822
-0,        257,        257,        1,   152064, 0x1d645cee
-0,        258,        258,        1,   152064, 0x9c592969
-0,        259,        259,        1,   152064, 0x2472769e
-0,        260,        260,        1,   152064, 0x71b7a5ad
-0,        261,        261,        1,   152064, 0xc6bba1c6
-0,        262,        262,        1,   152064, 0x7351f305
-0,        263,        263,        1,   152064, 0x579edbba
-0,        264,        264,        1,   152064, 0x90eda919
-0,        265,        265,        1,   152064, 0x2833b10d
-0,        266,        266,        1,   152064, 0x4b967d65
-0,        267,        267,        1,   152064, 0x6e7d1702
-0,        268,        268,        1,   152064, 0x59dbcf5b
-0,        269,        269,        1,   152064, 0xa138847b
-0,        270,        270,        1,   152064, 0xb2414e8d
-0,        271,        271,        1,   152064, 0xb90497f6
-0,        272,        272,        1,   152064, 0xcd728159
-0,        273,        273,        1,   152064, 0x005d5bdd
-0,        274,        274,        1,   152064, 0x27c88fb6
-0,        275,        275,        1,   152064, 0x3ccb8a93
-0,        276,        276,        1,   152064, 0xc50256dd
-0,        277,        277,        1,   152064, 0x111e7dee
-0,        278,        278,        1,   152064, 0x259d4a5d
-0,        279,        279,        1,   152064, 0x9385148b
-0,        280,        280,        1,   152064, 0x74002ab0
-0,        281,        281,        1,   152064, 0xd2c74adc
-0,        282,        282,        1,   152064, 0x72854b2a
-0,        283,        283,        1,   152064, 0x638e5c08
-0,        284,        284,        1,   152064, 0x9626bbb3
-0,        285,        285,        1,   152064, 0xc107c18f
-0,        286,        286,        1,   152064, 0x8bd04578
-0,        287,        287,        1,   152064, 0xbcdb6db6
-0,        288,        288,        1,   152064, 0x9d0c81be
-0,        289,        289,        1,   152064, 0xf25106b6
-0,        290,        290,        1,   152064, 0x54c25254
-0,        291,        291,        1,   152064, 0x4bf74663
-0,        292,        292,        1,   152064, 0x0051b054
-0,        293,        293,        1,   152064, 0x5193d3d4
-0,        294,        294,        1,   152064, 0xb5d0d045
-0,        295,        295,        1,   152064, 0x350a31ca
-0,        296,        296,        1,   152064, 0xb8fb7264
-0,        297,        297,        1,   152064, 0x7fb97645
-0,        298,        298,        1,   152064, 0xcd948c41
-0,        299,        299,        1,   152064, 0x38c7570a
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcadq_brcm_b b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcadq_brcm_b
deleted file mode 100644
index 49249b3..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcadq_brcm_b
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf3c68dea
-0,          1,          1,        1,   152064, 0xf52d483f
-0,          2,          2,        1,   152064, 0x612f1792
-0,          3,          3,        1,   152064, 0x4df34726
-0,          4,          4,        1,   152064, 0xfed7c058
-0,          5,          5,        1,   152064, 0x2d48025c
-0,          6,          6,        1,   152064, 0x03544ab9
-0,          7,          7,        1,   152064, 0x20cadfc5
-0,          8,          8,        1,   152064, 0x7cd3672e
-0,          9,          9,        1,   152064, 0x5f2b9ede
-0,         10,         10,        1,   152064, 0xc0bbdf75
-0,         11,         11,        1,   152064, 0x95571e7c
-0,         12,         12,        1,   152064, 0x0d1afc5b
-0,         13,         13,        1,   152064, 0x9c91c11f
-0,         14,         14,        1,   152064, 0x73e667e4
-0,         15,         15,        1,   152064, 0xfb7f8892
-0,         16,         16,        1,   152064, 0x5707f566
-0,         17,         17,        1,   152064, 0x21032449
-0,         18,         18,        1,   152064, 0x199e20b7
-0,         19,         19,        1,   152064, 0x23213179
-0,         20,         20,        1,   152064, 0x29812daa
-0,         21,         21,        1,   152064, 0x04e3eb6b
-0,         22,         22,        1,   152064, 0xab206165
-0,         23,         23,        1,   152064, 0x392fbf7b
-0,         24,         24,        1,   152064, 0x137a1c6a
-0,         25,         25,        1,   152064, 0x9caff265
-0,         26,         26,        1,   152064, 0x6becf046
-0,         27,         27,        1,   152064, 0xfc2c3ba6
-0,         28,         28,        1,   152064, 0xcf4b9b4c
-0,         29,         29,        1,   152064, 0x4e2ebd37
-0,         30,         30,        1,   152064, 0xcd419daa
-0,         31,         31,        1,   152064, 0xe12294b0
-0,         32,         32,        1,   152064, 0x6bda7493
-0,         33,         33,        1,   152064, 0xefbf5d0b
-0,         34,         34,        1,   152064, 0x9500458a
-0,         35,         35,        1,   152064, 0x6b5d212e
-0,         36,         36,        1,   152064, 0xb928fc31
-0,         37,         37,        1,   152064, 0x64f2bb2f
-0,         38,         38,        1,   152064, 0xf93a724d
-0,         39,         39,        1,   152064, 0xdd0d32c0
-0,         40,         40,        1,   152064, 0xe1b51d95
-0,         41,         41,        1,   152064, 0xbb43d295
-0,         42,         42,        1,   152064, 0x6dcea069
-0,         43,         43,        1,   152064, 0x89d79805
-0,         44,         44,        1,   152064, 0x50b5dd43
-0,         45,         45,        1,   152064, 0xe3099e3f
-0,         46,         46,        1,   152064, 0x003b6ace
-0,         47,         47,        1,   152064, 0x2213b672
-0,         48,         48,        1,   152064, 0x5b273093
-0,         49,         49,        1,   152064, 0xdbfbd9bf
-0,         50,         50,        1,   152064, 0xf26b89d0
-0,         51,         51,        1,   152064, 0x1470527e
-0,         52,         52,        1,   152064, 0x0e668970
-0,         53,         53,        1,   152064, 0x00218692
-0,         54,         54,        1,   152064, 0xaabf79a8
-0,         55,         55,        1,   152064, 0xf68b4663
-0,         56,         56,        1,   152064, 0x4c08d01f
-0,         57,         57,        1,   152064, 0x48e75380
-0,         58,         58,        1,   152064, 0x4b8be58f
-0,         59,         59,        1,   152064, 0x8a6c1365
-0,         60,         60,        1,   152064, 0x9439ca02
-0,         61,         61,        1,   152064, 0x831d9855
-0,         62,         62,        1,   152064, 0xff031ffd
-0,         63,         63,        1,   152064, 0x3680f4bc
-0,         64,         64,        1,   152064, 0x794c95a4
-0,         65,         65,        1,   152064, 0x23e53349
-0,         66,         66,        1,   152064, 0x85307117
-0,         67,         67,        1,   152064, 0x0bc0bf5a
-0,         68,         68,        1,   152064, 0xc79f46c8
-0,         69,         69,        1,   152064, 0x48be4e21
-0,         70,         70,        1,   152064, 0x2ad89b4f
-0,         71,         71,        1,   152064, 0xd454f9a9
-0,         72,         72,        1,   152064, 0x64852f6d
-0,         73,         73,        1,   152064, 0xcb7b0c05
-0,         74,         74,        1,   152064, 0x4e108ced
-0,         75,         75,        1,   152064, 0xf5e5a37b
-0,         76,         76,        1,   152064, 0x224e29c7
-0,         77,         77,        1,   152064, 0xad90d3c2
-0,         78,         78,        1,   152064, 0x5ddb5d05
-0,         79,         79,        1,   152064, 0x4ebf4337
-0,         80,         80,        1,   152064, 0x7e2bfeed
-0,         81,         81,        1,   152064, 0x00e884c7
-0,         82,         82,        1,   152064, 0xa4f6a534
-0,         83,         83,        1,   152064, 0x622f1511
-0,         84,         84,        1,   152064, 0x8d99233d
-0,         85,         85,        1,   152064, 0x5910d02c
-0,         86,         86,        1,   152064, 0x20d6706c
-0,         87,         87,        1,   152064, 0x8e30a417
-0,         88,         88,        1,   152064, 0x180d745a
-0,         89,         89,        1,   152064, 0xc25189b9
-0,         90,         90,        1,   152064, 0x909101ad
-0,         91,         91,        1,   152064, 0x9967be1c
-0,         92,         92,        1,   152064, 0x72ff3206
-0,         93,         93,        1,   152064, 0x48d07f48
-0,         94,         94,        1,   152064, 0x7f8244b7
-0,         95,         95,        1,   152064, 0xf871e21e
-0,         96,         96,        1,   152064, 0xd4743610
-0,         97,         97,        1,   152064, 0xc2c7a7b1
-0,         98,         98,        1,   152064, 0x95be1a75
-0,         99,         99,        1,   152064, 0x44972b2e
-0,        100,        100,        1,   152064, 0xa6036c4f
-0,        101,        101,        1,   152064, 0xecdd8dd6
-0,        102,        102,        1,   152064, 0xbb7e8551
-0,        103,        103,        1,   152064, 0x42916e6c
-0,        104,        104,        1,   152064, 0x972db010
-0,        105,        105,        1,   152064, 0x80dab6a0
-0,        106,        106,        1,   152064, 0xc753ecdb
-0,        107,        107,        1,   152064, 0x0823bffa
-0,        108,        108,        1,   152064, 0x80876b2d
-0,        109,        109,        1,   152064, 0x4a8b2118
-0,        110,        110,        1,   152064, 0x0be2c13d
-0,        111,        111,        1,   152064, 0xa6966e4f
-0,        112,        112,        1,   152064, 0xf6a57650
-0,        113,        113,        1,   152064, 0x49d66fd4
-0,        114,        114,        1,   152064, 0x21d92047
-0,        115,        115,        1,   152064, 0x155f20a8
-0,        116,        116,        1,   152064, 0x5ab90c1d
-0,        117,        117,        1,   152064, 0xa0c31337
-0,        118,        118,        1,   152064, 0xd20de1d6
-0,        119,        119,        1,   152064, 0x300ad916
-0,        120,        120,        1,   152064, 0xbcb89eb5
-0,        121,        121,        1,   152064, 0x08759342
-0,        122,        122,        1,   152064, 0xa5d06e72
-0,        123,        123,        1,   152064, 0x3b4c537f
-0,        124,        124,        1,   152064, 0x7f48912b
-0,        125,        125,        1,   152064, 0x200dbd1f
-0,        126,        126,        1,   152064, 0x918abfde
-0,        127,        127,        1,   152064, 0xd8072cdf
-0,        128,        128,        1,   152064, 0x89d2902b
-0,        129,        129,        1,   152064, 0xcd2e2e3c
-0,        130,        130,        1,   152064, 0xf343e4a2
-0,        131,        131,        1,   152064, 0xc424acad
-0,        132,        132,        1,   152064, 0xf71e3031
-0,        133,        133,        1,   152064, 0xf1bc1179
-0,        134,        134,        1,   152064, 0x9af58d24
-0,        135,        135,        1,   152064, 0x48a4d01e
-0,        136,        136,        1,   152064, 0xcf24f721
-0,        137,        137,        1,   152064, 0x5bc7b4f3
-0,        138,        138,        1,   152064, 0x8763fc59
-0,        139,        139,        1,   152064, 0xb6954051
-0,        140,        140,        1,   152064, 0x044ba446
-0,        141,        141,        1,   152064, 0xdaaaee7e
-0,        142,        142,        1,   152064, 0x8eac550d
-0,        143,        143,        1,   152064, 0x5191d08c
-0,        144,        144,        1,   152064, 0x3cd76d43
-0,        145,        145,        1,   152064, 0xf01f8fa9
-0,        146,        146,        1,   152064, 0x0e283e9b
-0,        147,        147,        1,   152064, 0x7cef69ee
-0,        148,        148,        1,   152064, 0xc8e332bc
-0,        149,        149,        1,   152064, 0x5b1aa484
-0,        150,        150,        1,   152064, 0x3975234f
-0,        151,        151,        1,   152064, 0x52b8661e
-0,        152,        152,        1,   152064, 0xb4b8fed8
-0,        153,        153,        1,   152064, 0x5aff9f70
-0,        154,        154,        1,   152064, 0x7b575735
-0,        155,        155,        1,   152064, 0x77d51523
-0,        156,        156,        1,   152064, 0xf5131eba
-0,        157,        157,        1,   152064, 0x4bd2b1ad
-0,        158,        158,        1,   152064, 0xccfc8dca
-0,        159,        159,        1,   152064, 0xcf245472
-0,        160,        160,        1,   152064, 0xe055adf5
-0,        161,        161,        1,   152064, 0x2a90e171
-0,        162,        162,        1,   152064, 0x1bd8ea64
-0,        163,        163,        1,   152064, 0x32f1d794
-0,        164,        164,        1,   152064, 0xc938c42a
-0,        165,        165,        1,   152064, 0x12b5644f
-0,        166,        166,        1,   152064, 0x99003711
-0,        167,        167,        1,   152064, 0xaecfad1c
-0,        168,        168,        1,   152064, 0x94b00ae1
-0,        169,        169,        1,   152064, 0xbb4f982f
-0,        170,        170,        1,   152064, 0x6f7f5dc1
-0,        171,        171,        1,   152064, 0x7be7c2cb
-0,        172,        172,        1,   152064, 0x3b2ee4d3
-0,        173,        173,        1,   152064, 0xc75f5666
-0,        174,        174,        1,   152064, 0xff7a3ede
-0,        175,        175,        1,   152064, 0x55866b59
-0,        176,        176,        1,   152064, 0x408b8455
-0,        177,        177,        1,   152064, 0x96c4ab66
-0,        178,        178,        1,   152064, 0x1d87f575
-0,        179,        179,        1,   152064, 0x3a3b17ac
-0,        180,        180,        1,   152064, 0x9c99e591
-0,        181,        181,        1,   152064, 0xc1fc663d
-0,        182,        182,        1,   152064, 0x17b982dd
-0,        183,        183,        1,   152064, 0x24fe9dad
-0,        184,        184,        1,   152064, 0xea8760ee
-0,        185,        185,        1,   152064, 0x23dcefad
-0,        186,        186,        1,   152064, 0xee6d23f0
-0,        187,        187,        1,   152064, 0xfddc1962
-0,        188,        188,        1,   152064, 0xb23190df
-0,        189,        189,        1,   152064, 0xf066a595
-0,        190,        190,        1,   152064, 0x2200fef8
-0,        191,        191,        1,   152064, 0x5491ab2f
-0,        192,        192,        1,   152064, 0xea93fa58
-0,        193,        193,        1,   152064, 0x3e13d4f4
-0,        194,        194,        1,   152064, 0x3dda841d
-0,        195,        195,        1,   152064, 0xfc243577
-0,        196,        196,        1,   152064, 0xca4a9127
-0,        197,        197,        1,   152064, 0x41908ec0
-0,        198,        198,        1,   152064, 0x10a758bd
-0,        199,        199,        1,   152064, 0x6a849e5b
-0,        200,        200,        1,   152064, 0xb55a1f2b
-0,        201,        201,        1,   152064, 0x2bfe9627
-0,        202,        202,        1,   152064, 0x2bfca28c
-0,        203,        203,        1,   152064, 0xd166f336
-0,        204,        204,        1,   152064, 0x9facb32b
-0,        205,        205,        1,   152064, 0x6a672475
-0,        206,        206,        1,   152064, 0xc7b219cf
-0,        207,        207,        1,   152064, 0x2b43ca53
-0,        208,        208,        1,   152064, 0x43b542c4
-0,        209,        209,        1,   152064, 0xdc654337
-0,        210,        210,        1,   152064, 0x68003d7c
-0,        211,        211,        1,   152064, 0x3cb85724
-0,        212,        212,        1,   152064, 0x422701c2
-0,        213,        213,        1,   152064, 0x1c667870
-0,        214,        214,        1,   152064, 0x75ef3230
-0,        215,        215,        1,   152064, 0x0ac82643
-0,        216,        216,        1,   152064, 0x3eb3a0be
-0,        217,        217,        1,   152064, 0x482bd77e
-0,        218,        218,        1,   152064, 0xd3ce1171
-0,        219,        219,        1,   152064, 0xeaefc7e4
-0,        220,        220,        1,   152064, 0xa9c67939
-0,        221,        221,        1,   152064, 0x0af0a25b
-0,        222,        222,        1,   152064, 0xd094d95a
-0,        223,        223,        1,   152064, 0xfda42fc6
-0,        224,        224,        1,   152064, 0x4669f952
-0,        225,        225,        1,   152064, 0x52d40e98
-0,        226,        226,        1,   152064, 0x27c36cd1
-0,        227,        227,        1,   152064, 0xa103b6ce
-0,        228,        228,        1,   152064, 0x2be9026d
-0,        229,        229,        1,   152064, 0x2f4ecc59
-0,        230,        230,        1,   152064, 0x53144cef
-0,        231,        231,        1,   152064, 0x15d54fc9
-0,        232,        232,        1,   152064, 0x7e302db7
-0,        233,        233,        1,   152064, 0x82521901
-0,        234,        234,        1,   152064, 0x1123cdb6
-0,        235,        235,        1,   152064, 0x3185878a
-0,        236,        236,        1,   152064, 0xbb294983
-0,        237,        237,        1,   152064, 0x83d9fe66
-0,        238,        238,        1,   152064, 0xede9fb08
-0,        239,        239,        1,   152064, 0xa543b551
-0,        240,        240,        1,   152064, 0x39e82734
-0,        241,        241,        1,   152064, 0xd0447fb5
-0,        242,        242,        1,   152064, 0x8cc6f502
-0,        243,        243,        1,   152064, 0xda8d1da8
-0,        244,        244,        1,   152064, 0xcafdccca
-0,        245,        245,        1,   152064, 0xbf0e04f4
-0,        246,        246,        1,   152064, 0x0c6eefec
-0,        247,        247,        1,   152064, 0xb9026d39
-0,        248,        248,        1,   152064, 0x0121a7a8
-0,        249,        249,        1,   152064, 0x453ebbc6
-0,        250,        250,        1,   152064, 0x14ae15e3
-0,        251,        251,        1,   152064, 0x51d618e1
-0,        252,        252,        1,   152064, 0x2254f452
-0,        253,        253,        1,   152064, 0x8c360633
-0,        254,        254,        1,   152064, 0x8704d9bc
-0,        255,        255,        1,   152064, 0xe5d48301
-0,        256,        256,        1,   152064, 0xf25b7b3f
-0,        257,        257,        1,   152064, 0xd2ad3b73
-0,        258,        258,        1,   152064, 0x53db0387
-0,        259,        259,        1,   152064, 0x2486341c
-0,        260,        260,        1,   152064, 0x4a24570b
-0,        261,        261,        1,   152064, 0x0694620a
-0,        262,        262,        1,   152064, 0xbbc2a302
-0,        263,        263,        1,   152064, 0x08ad9c02
-0,        264,        264,        1,   152064, 0x601a63ab
-0,        265,        265,        1,   152064, 0xe4234a48
-0,        266,        266,        1,   152064, 0x07702235
-0,        267,        267,        1,   152064, 0x719dbecf
-0,        268,        268,        1,   152064, 0xf301a7ad
-0,        269,        269,        1,   152064, 0xf15c70c3
-0,        270,        270,        1,   152064, 0x0ab93386
-0,        271,        271,        1,   152064, 0x99c05adb
-0,        272,        272,        1,   152064, 0x9ed43530
-0,        273,        273,        1,   152064, 0xa2f62122
-0,        274,        274,        1,   152064, 0xf16f4525
-0,        275,        275,        1,   152064, 0xa3403b4a
-0,        276,        276,        1,   152064, 0x95521096
-0,        277,        277,        1,   152064, 0x0d412988
-0,        278,        278,        1,   152064, 0x829e080a
-0,        279,        279,        1,   152064, 0x0805c1b5
-0,        280,        280,        1,   152064, 0xa136be48
-0,        281,        281,        1,   152064, 0x0f8de228
-0,        282,        282,        1,   152064, 0x272cf2d3
-0,        283,        283,        1,   152064, 0xa1df2a5e
-0,        284,        284,        1,   152064, 0xf9db8350
-0,        285,        285,        1,   152064, 0x5536997d
-0,        286,        286,        1,   152064, 0xab83e81e
-0,        287,        287,        1,   152064, 0xec791b49
-0,        288,        288,        1,   152064, 0x04d03e19
-0,        289,        289,        1,   152064, 0xd6a2bd21
-0,        290,        290,        1,   152064, 0x2d35f0aa
-0,        291,        291,        1,   152064, 0x137bf715
-0,        292,        292,        1,   152064, 0x56ef5ae1
-0,        293,        293,        1,   152064, 0x9bb5821e
-0,        294,        294,        1,   152064, 0x533c7fff
-0,        295,        295,        1,   152064, 0x469ad380
-0,        296,        296,        1,   152064, 0x75710e84
-0,        297,        297,        1,   152064, 0xbbd72551
-0,        298,        298,        1,   152064, 0xf1137026
-0,        299,        299,        1,   152064, 0x6238412b
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcafl_bcrm_c b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcafl_bcrm_c
deleted file mode 100644
index dbfec43..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcafl_bcrm_c
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x502ec077
-0,          1,          1,        1,   152064, 0x84807243
-0,          2,          2,        1,   152064, 0xd7474a6e
-0,          3,          3,        1,   152064, 0x793469bb
-0,          4,          4,        1,   152064, 0xb7a0faf7
-0,          5,          5,        1,   152064, 0x1d3d3cba
-0,          6,          6,        1,   152064, 0xb62583de
-0,          7,          7,        1,   152064, 0xc8422fb1
-0,          8,          8,        1,   152064, 0x321dc699
-0,          9,          9,        1,   152064, 0x7a34d350
-0,         10,         10,        1,   152064, 0xaa4c302d
-0,         11,         11,        1,   152064, 0x45fa7ab0
-0,         12,         12,        1,   152064, 0xc7262e41
-0,         13,         13,        1,   152064, 0x3550000c
-0,         14,         14,        1,   152064, 0xf4bab54b
-0,         15,         15,        1,   152064, 0xaccf9c1a
-0,         16,         16,        1,   152064, 0x9bee20e9
-0,         17,         17,        1,   152064, 0x47fb7720
-0,         18,         18,        1,   152064, 0x12c63ffb
-0,         19,         19,        1,   152064, 0xfa2b8b4d
-0,         20,         20,        1,   152064, 0x279964bd
-0,         21,         21,        1,   152064, 0xb8b01c7e
-0,         22,         22,        1,   152064, 0x816fa010
-0,         23,         23,        1,   152064, 0x59fe1c8c
-0,         24,         24,        1,   152064, 0x13393fad
-0,         25,         25,        1,   152064, 0x991a50a4
-0,         26,         26,        1,   152064, 0x57df3eb7
-0,         27,         27,        1,   152064, 0x744371df
-0,         28,         28,        1,   152064, 0xe9f6d3ff
-0,         29,         29,        1,   152064, 0xc506fba0
-0,         30,         30,        1,   152064, 0x6295b90e
-0,         31,         31,        1,   152064, 0xa19cee2d
-0,         32,         32,        1,   152064, 0xf8c1b3ca
-0,         33,         33,        1,   152064, 0x69f68ce0
-0,         34,         34,        1,   152064, 0x80558bb6
-0,         35,         35,        1,   152064, 0x27824fa5
-0,         36,         36,        1,   152064, 0x27c929a1
-0,         37,         37,        1,   152064, 0xc0fe06d1
-0,         38,         38,        1,   152064, 0xc52bc58c
-0,         39,         39,        1,   152064, 0x0a5363c7
-0,         40,         40,        1,   152064, 0xd0f45a0d
-0,         41,         41,        1,   152064, 0x274710f9
-0,         42,         42,        1,   152064, 0x89d2d390
-0,         43,         43,        1,   152064, 0x12a9bfb0
-0,         44,         44,        1,   152064, 0x04501a93
-0,         45,         45,        1,   152064, 0xf92cbbf4
-0,         46,         46,        1,   152064, 0xf6d1b27d
-0,         47,         47,        1,   152064, 0xe3e904c3
-0,         48,         48,        1,   152064, 0x58f8516d
-0,         49,         49,        1,   152064, 0x70370c2b
-0,         50,         50,        1,   152064, 0xfeebc88c
-0,         51,         51,        1,   152064, 0x974c6ed6
-0,         52,         52,        1,   152064, 0x401bdcf2
-0,         53,         53,        1,   152064, 0xfe61e278
-0,         54,         54,        1,   152064, 0x96ba8bb9
-0,         55,         55,        1,   152064, 0x988492fd
-0,         56,         56,        1,   152064, 0xd1d913a9
-0,         57,         57,        1,   152064, 0x6bc46f0e
-0,         58,         58,        1,   152064, 0x695ef706
-0,         59,         59,        1,   152064, 0x142045c9
-0,         60,         60,        1,   152064, 0xb390ed87
-0,         61,         61,        1,   152064, 0xb9e6d2e5
-0,         62,         62,        1,   152064, 0xe348797f
-0,         63,         63,        1,   152064, 0x1cbd29d6
-0,         64,         64,        1,   152064, 0xbd7dd694
-0,         65,         65,        1,   152064, 0x516873c3
-0,         66,         66,        1,   152064, 0x27bba182
-0,         67,         67,        1,   152064, 0x7541f920
-0,         68,         68,        1,   152064, 0xfdf67042
-0,         69,         69,        1,   152064, 0x6c3c7896
-0,         70,         70,        1,   152064, 0xed86c467
-0,         71,         71,        1,   152064, 0x4ea83ca2
-0,         72,         72,        1,   152064, 0xa3e6725b
-0,         73,         73,        1,   152064, 0x917f5f16
-0,         74,         74,        1,   152064, 0x8cf2d2e1
-0,         75,         75,        1,   152064, 0x57a8d116
-0,         76,         76,        1,   152064, 0x0db267d4
-0,         77,         77,        1,   152064, 0xce782ac5
-0,         78,         78,        1,   152064, 0x1c9d8518
-0,         79,         79,        1,   152064, 0x47598ac7
-0,         80,         80,        1,   152064, 0xc5033d97
-0,         81,         81,        1,   152064, 0xd7aaa3a4
-0,         82,         82,        1,   152064, 0x078afc96
-0,         83,         83,        1,   152064, 0xc9fe673d
-0,         84,         84,        1,   152064, 0xe9284066
-0,         85,         85,        1,   152064, 0xbc570982
-0,         86,         86,        1,   152064, 0x0aac8574
-0,         87,         87,        1,   152064, 0x098cbeee
-0,         88,         88,        1,   152064, 0x19c36a9d
-0,         89,         89,        1,   152064, 0x8fe4a893
-0,         90,         90,        1,   152064, 0x0b652f17
-0,         91,         91,        1,   152064, 0x10f2e6bf
-0,         92,         92,        1,   152064, 0x7ce5634e
-0,         93,         93,        1,   152064, 0x8fe4ac6c
-0,         94,         94,        1,   152064, 0xcaba749e
-0,         95,         95,        1,   152064, 0x5f8a0d5c
-0,         96,         96,        1,   152064, 0xcaa66bbc
-0,         97,         97,        1,   152064, 0xc87ae617
-0,         98,         98,        1,   152064, 0xe8ef4dd7
-0,         99,         99,        1,   152064, 0xdfca5a07
-0,        100,        100,        1,   152064, 0x5f7eab7d
-0,        101,        101,        1,   152064, 0x8a65ebbb
-0,        102,        102,        1,   152064, 0x4beab4a0
-0,        103,        103,        1,   152064, 0xb5e6ab30
-0,        104,        104,        1,   152064, 0x8fe4f4d4
-0,        105,        105,        1,   152064, 0x95bde1ca
-0,        106,        106,        1,   152064, 0xcc5e3a53
-0,        107,        107,        1,   152064, 0xf09f1dd7
-0,        108,        108,        1,   152064, 0x10179672
-0,        109,        109,        1,   152064, 0x4ad16184
-0,        110,        110,        1,   152064, 0x9efa0e23
-0,        111,        111,        1,   152064, 0x22f59522
-0,        112,        112,        1,   152064, 0x4d38f09d
-0,        113,        113,        1,   152064, 0x4c5ebf56
-0,        114,        114,        1,   152064, 0xb19d5077
-0,        115,        115,        1,   152064, 0xa98576b9
-0,        116,        116,        1,   152064, 0x65324239
-0,        117,        117,        1,   152064, 0x709e4031
-0,        118,        118,        1,   152064, 0xf8e81681
-0,        119,        119,        1,   152064, 0x058514e5
-0,        120,        120,        1,   152064, 0xd1d1c806
-0,        121,        121,        1,   152064, 0x0e4dde57
-0,        122,        122,        1,   152064, 0x49e9c2bb
-0,        123,        123,        1,   152064, 0x01417ce6
-0,        124,        124,        1,   152064, 0xda7ebbf1
-0,        125,        125,        1,   152064, 0xa22906b7
-0,        126,        126,        1,   152064, 0x32e2df87
-0,        127,        127,        1,   152064, 0x69917c8f
-0,        128,        128,        1,   152064, 0xea8ed2cc
-0,        129,        129,        1,   152064, 0x0b8d57f1
-0,        130,        130,        1,   152064, 0x5f683bcd
-0,        131,        131,        1,   152064, 0x5162fe2f
-0,        132,        132,        1,   152064, 0x49c052f8
-0,        133,        133,        1,   152064, 0x990b69ba
-0,        134,        134,        1,   152064, 0xa6d4f99f
-0,        135,        135,        1,   152064, 0xe79ef4da
-0,        136,        136,        1,   152064, 0x5e8a3847
-0,        137,        137,        1,   152064, 0x38b1e75f
-0,        138,        138,        1,   152064, 0xf5c91bed
-0,        139,        139,        1,   152064, 0xd59a6d26
-0,        140,        140,        1,   152064, 0xc361de06
-0,        141,        141,        1,   152064, 0x63ed2229
-0,        142,        142,        1,   152064, 0xb8229205
-0,        143,        143,        1,   152064, 0x7c6619af
-0,        144,        144,        1,   152064, 0x4126b02f
-0,        145,        145,        1,   152064, 0x9250b99b
-0,        146,        146,        1,   152064, 0x589778f9
-0,        147,        147,        1,   152064, 0xed1fa45b
-0,        148,        148,        1,   152064, 0x700b6f32
-0,        149,        149,        1,   152064, 0x0590df55
-0,        150,        150,        1,   152064, 0x3e9c4018
-0,        151,        151,        1,   152064, 0x957b8860
-0,        152,        152,        1,   152064, 0x56161560
-0,        153,        153,        1,   152064, 0xbc43bc3b
-0,        154,        154,        1,   152064, 0x508d8632
-0,        155,        155,        1,   152064, 0xbc5736d8
-0,        156,        156,        1,   152064, 0xed7d3aef
-0,        157,        157,        1,   152064, 0x1dcdda9f
-0,        158,        158,        1,   152064, 0x8ef6d5c9
-0,        159,        159,        1,   152064, 0x15466acc
-0,        160,        160,        1,   152064, 0x45d4cf67
-0,        161,        161,        1,   152064, 0x8c900b9d
-0,        162,        162,        1,   152064, 0x747006e0
-0,        163,        163,        1,   152064, 0xac920a0c
-0,        164,        164,        1,   152064, 0xb8210c27
-0,        165,        165,        1,   152064, 0x7dbb873a
-0,        166,        166,        1,   152064, 0x0d4d7584
-0,        167,        167,        1,   152064, 0xefb3fe60
-0,        168,        168,        1,   152064, 0x905e2644
-0,        169,        169,        1,   152064, 0x7c04e534
-0,        170,        170,        1,   152064, 0x8889972a
-0,        171,        171,        1,   152064, 0x21c7d8ad
-0,        172,        172,        1,   152064, 0x1c641176
-0,        173,        173,        1,   152064, 0xf71489a4
-0,        174,        174,        1,   152064, 0xd7ac5555
-0,        175,        175,        1,   152064, 0xb4609c6d
-0,        176,        176,        1,   152064, 0xf5b2bd5e
-0,        177,        177,        1,   152064, 0x9f43ce57
-0,        178,        178,        1,   152064, 0x77642dd3
-0,        179,        179,        1,   152064, 0x3e79565c
-0,        180,        180,        1,   152064, 0x95f40b8e
-0,        181,        181,        1,   152064, 0x3c8ca4d4
-0,        182,        182,        1,   152064, 0xa02ac497
-0,        183,        183,        1,   152064, 0x4c93b377
-0,        184,        184,        1,   152064, 0x55f5ac68
-0,        185,        185,        1,   152064, 0xf8652eca
-0,        186,        186,        1,   152064, 0x56e94574
-0,        187,        187,        1,   152064, 0x6d8302e1
-0,        188,        188,        1,   152064, 0x29a57061
-0,        189,        189,        1,   152064, 0x24e4cfdc
-0,        190,        190,        1,   152064, 0xf5a5d62a
-0,        191,        191,        1,   152064, 0x998870c1
-0,        192,        192,        1,   152064, 0xa15b1f4e
-0,        193,        193,        1,   152064, 0xb0ccb51f
-0,        194,        194,        1,   152064, 0xeaaf59ab
-0,        195,        195,        1,   152064, 0x7e2b4fe6
-0,        196,        196,        1,   152064, 0x72299fea
-0,        197,        197,        1,   152064, 0x769da8b2
-0,        198,        198,        1,   152064, 0xefad7ef8
-0,        199,        199,        1,   152064, 0x24819983
-0,        200,        200,        1,   152064, 0x2aad32ab
-0,        201,        201,        1,   152064, 0xc80cac79
-0,        202,        202,        1,   152064, 0x1659d628
-0,        203,        203,        1,   152064, 0xef941f66
-0,        204,        204,        1,   152064, 0x0d7fcdb5
-0,        205,        205,        1,   152064, 0x7c1853fa
-0,        206,        206,        1,   152064, 0xb94c4d3c
-0,        207,        207,        1,   152064, 0xc47adfc2
-0,        208,        208,        1,   152064, 0x366a6729
-0,        209,        209,        1,   152064, 0x7eb37b70
-0,        210,        210,        1,   152064, 0xafd54c27
-0,        211,        211,        1,   152064, 0x67b18636
-0,        212,        212,        1,   152064, 0x93b22dcf
-0,        213,        213,        1,   152064, 0xa64991f1
-0,        214,        214,        1,   152064, 0xd32a7102
-0,        215,        215,        1,   152064, 0xff665d1c
-0,        216,        216,        1,   152064, 0xf107cc31
-0,        217,        217,        1,   152064, 0xf5b25652
-0,        218,        218,        1,   152064, 0x8caf783d
-0,        219,        219,        1,   152064, 0x72f3eb00
-0,        220,        220,        1,   152064, 0xb5aea5f8
-0,        221,        221,        1,   152064, 0xee70e870
-0,        222,        222,        1,   152064, 0x7c3a0156
-0,        223,        223,        1,   152064, 0x871b6383
-0,        224,        224,        1,   152064, 0x48d831ff
-0,        225,        225,        1,   152064, 0xca233913
-0,        226,        226,        1,   152064, 0xe14bc5eb
-0,        227,        227,        1,   152064, 0x9b1d27e7
-0,        228,        228,        1,   152064, 0xfb9637f7
-0,        229,        229,        1,   152064, 0x0c022157
-0,        230,        230,        1,   152064, 0x16d35fc9
-0,        231,        231,        1,   152064, 0x6d935f71
-0,        232,        232,        1,   152064, 0xae4066fa
-0,        233,        233,        1,   152064, 0xcef94fdc
-0,        234,        234,        1,   152064, 0xc234edb9
-0,        235,        235,        1,   152064, 0x26a4f2e2
-0,        236,        236,        1,   152064, 0xd29ac23e
-0,        237,        237,        1,   152064, 0xb7604395
-0,        238,        238,        1,   152064, 0x408084f6
-0,        239,        239,        1,   152064, 0x0a02026c
-0,        240,        240,        1,   152064, 0x78b33c7c
-0,        241,        241,        1,   152064, 0xcb02b874
-0,        242,        242,        1,   152064, 0xf566513b
-0,        243,        243,        1,   152064, 0xb34e52b1
-0,        244,        244,        1,   152064, 0xf55ff493
-0,        245,        245,        1,   152064, 0xb0e8282a
-0,        246,        246,        1,   152064, 0xe9510bbe
-0,        247,        247,        1,   152064, 0x292e8c5a
-0,        248,        248,        1,   152064, 0x62b9d2b0
-0,        249,        249,        1,   152064, 0x3a8cc827
-0,        250,        250,        1,   152064, 0x25cc465e
-0,        251,        251,        1,   152064, 0xf2bc32e2
-0,        252,        252,        1,   152064, 0x6141f914
-0,        253,        253,        1,   152064, 0x1171256f
-0,        254,        254,        1,   152064, 0x13cb2ded
-0,        255,        255,        1,   152064, 0x3d4ca557
-0,        256,        256,        1,   152064, 0xf2b9e72e
-0,        257,        257,        1,   152064, 0x03f7547a
-0,        258,        258,        1,   152064, 0xc7302955
-0,        259,        259,        1,   152064, 0xe78a46d3
-0,        260,        260,        1,   152064, 0x3726a270
-0,        261,        261,        1,   152064, 0x2f65722a
-0,        262,        262,        1,   152064, 0x55acce40
-0,        263,        263,        1,   152064, 0xf6fa9db2
-0,        264,        264,        1,   152064, 0x70a36937
-0,        265,        265,        1,   152064, 0x9313742d
-0,        266,        266,        1,   152064, 0x2eb14e53
-0,        267,        267,        1,   152064, 0x3d47c9c3
-0,        268,        268,        1,   152064, 0xd0a90348
-0,        269,        269,        1,   152064, 0x6ad48088
-0,        270,        270,        1,   152064, 0x68e64738
-0,        271,        271,        1,   152064, 0x04c3735a
-0,        272,        272,        1,   152064, 0x51d0593f
-0,        273,        273,        1,   152064, 0x42cf2b48
-0,        274,        274,        1,   152064, 0xa5496a0c
-0,        275,        275,        1,   152064, 0x84c25549
-0,        276,        276,        1,   152064, 0x96691600
-0,        277,        277,        1,   152064, 0x423135db
-0,        278,        278,        1,   152064, 0x8d2e08b6
-0,        279,        279,        1,   152064, 0xaeb4c840
-0,        280,        280,        1,   152064, 0xf3e71780
-0,        281,        281,        1,   152064, 0x8858228b
-0,        282,        282,        1,   152064, 0xf28613f8
-0,        283,        283,        1,   152064, 0xb5327882
-0,        284,        284,        1,   152064, 0xbb60bb85
-0,        285,        285,        1,   152064, 0x345ab1c9
-0,        286,        286,        1,   152064, 0x8aac2cba
-0,        287,        287,        1,   152064, 0x7ce15b4c
-0,        288,        288,        1,   152064, 0xc09c55c0
-0,        289,        289,        1,   152064, 0x8482ddd6
-0,        290,        290,        1,   152064, 0xab222a13
-0,        291,        291,        1,   152064, 0xd39b0dea
-0,        292,        292,        1,   152064, 0x6dab6e06
-0,        293,        293,        1,   152064, 0xec0891bd
-0,        294,        294,        1,   152064, 0x88bd9701
-0,        295,        295,        1,   152064, 0xdf13072a
-0,        296,        296,        1,   152064, 0x23b33081
-0,        297,        297,        1,   152064, 0x63943137
-0,        298,        298,        1,   152064, 0xab6a9052
-0,        299,        299,        1,   152064, 0x05485494
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcaflnl_bcrm_c b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcaflnl_bcrm_c
deleted file mode 100644
index 65a366e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcaflnl_bcrm_c
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x3e39c08b
-0,          1,          1,        1,   152064, 0xabc67990
-0,          2,          2,        1,   152064, 0x19614e74
-0,          3,          3,        1,   152064, 0xa3776beb
-0,          4,          4,        1,   152064, 0xcce6ffdf
-0,          5,          5,        1,   152064, 0xb0e94746
-0,          6,          6,        1,   152064, 0xdb1a84ef
-0,          7,          7,        1,   152064, 0xb2624509
-0,          8,          8,        1,   152064, 0x32e2d826
-0,          9,          9,        1,   152064, 0xb3bddf0b
-0,         10,         10,        1,   152064, 0x2e273ce3
-0,         11,         11,        1,   152064, 0x67af7e4d
-0,         12,         12,        1,   152064, 0x505c3261
-0,         13,         13,        1,   152064, 0xa43d015e
-0,         14,         14,        1,   152064, 0xad41c1f6
-0,         15,         15,        1,   152064, 0x633ba55f
-0,         16,         16,        1,   152064, 0xe80634f0
-0,         17,         17,        1,   152064, 0x80a07dc9
-0,         18,         18,        1,   152064, 0x0e7a3bbf
-0,         19,         19,        1,   152064, 0xcb099196
-0,         20,         20,        1,   152064, 0x57c96db5
-0,         21,         21,        1,   152064, 0xccd422fa
-0,         22,         22,        1,   152064, 0x0850b7a7
-0,         23,         23,        1,   152064, 0x30e33156
-0,         24,         24,        1,   152064, 0x34e13f9a
-0,         25,         25,        1,   152064, 0x03d36000
-0,         26,         26,        1,   152064, 0xbf7d49da
-0,         27,         27,        1,   152064, 0x77336d09
-0,         28,         28,        1,   152064, 0xca8be5a9
-0,         29,         29,        1,   152064, 0xe57c0b08
-0,         30,         30,        1,   152064, 0xbe77c093
-0,         31,         31,        1,   152064, 0x6bf1ff05
-0,         32,         32,        1,   152064, 0x9142babf
-0,         33,         33,        1,   152064, 0x08db8e67
-0,         34,         34,        1,   152064, 0x69ac8cb6
-0,         35,         35,        1,   152064, 0xaa3b5c88
-0,         36,         36,        1,   152064, 0x9bd32638
-0,         37,         37,        1,   152064, 0x7972115a
-0,         38,         38,        1,   152064, 0x5c1dd47b
-0,         39,         39,        1,   152064, 0x8a196e02
-0,         40,         40,        1,   152064, 0xa89672bc
-0,         41,         41,        1,   152064, 0x27b220e4
-0,         42,         42,        1,   152064, 0xfa38dc4a
-0,         43,         43,        1,   152064, 0x4784c639
-0,         44,         44,        1,   152064, 0xa5e4229a
-0,         45,         45,        1,   152064, 0xa986bdfc
-0,         46,         46,        1,   152064, 0x2951b47b
-0,         47,         47,        1,   152064, 0x4df404a6
-0,         48,         48,        1,   152064, 0xc75155e8
-0,         49,         49,        1,   152064, 0xfc05248c
-0,         50,         50,        1,   152064, 0x5d53da10
-0,         51,         51,        1,   152064, 0x284376ec
-0,         52,         52,        1,   152064, 0x19fce380
-0,         53,         53,        1,   152064, 0x876be6c9
-0,         54,         54,        1,   152064, 0x39eb8ff9
-0,         55,         55,        1,   152064, 0x289c9543
-0,         56,         56,        1,   152064, 0x24dd2356
-0,         57,         57,        1,   152064, 0x1dc17d3c
-0,         58,         58,        1,   152064, 0xd17c00ac
-0,         59,         59,        1,   152064, 0xc2ad54de
-0,         60,         60,        1,   152064, 0xbe11ee2f
-0,         61,         61,        1,   152064, 0x3db9dc89
-0,         62,         62,        1,   152064, 0xac0d7bc2
-0,         63,         63,        1,   152064, 0x8dab2dde
-0,         64,         64,        1,   152064, 0x566ad225
-0,         65,         65,        1,   152064, 0x587c7853
-0,         66,         66,        1,   152064, 0x601c9c80
-0,         67,         67,        1,   152064, 0x2afaf751
-0,         68,         68,        1,   152064, 0x1c9f7e3a
-0,         69,         69,        1,   152064, 0x899475bf
-0,         70,         70,        1,   152064, 0x0d65c7d9
-0,         71,         71,        1,   152064, 0xafd63d12
-0,         72,         72,        1,   152064, 0x162e62b9
-0,         73,         73,        1,   152064, 0x5c9554be
-0,         74,         74,        1,   152064, 0x35fbdaa2
-0,         75,         75,        1,   152064, 0x6438cbd8
-0,         76,         76,        1,   152064, 0xde0772c9
-0,         77,         77,        1,   152064, 0x79f82854
-0,         78,         78,        1,   152064, 0x86957840
-0,         79,         79,        1,   152064, 0xd9468cbf
-0,         80,         80,        1,   152064, 0x23e74609
-0,         81,         81,        1,   152064, 0x3919a146
-0,         82,         82,        1,   152064, 0xd641078b
-0,         83,         83,        1,   152064, 0x24397220
-0,         84,         84,        1,   152064, 0xe7fc3a7c
-0,         85,         85,        1,   152064, 0x3997154a
-0,         86,         86,        1,   152064, 0x2af3952c
-0,         87,         87,        1,   152064, 0x274ac07a
-0,         88,         88,        1,   152064, 0x288f7b09
-0,         89,         89,        1,   152064, 0xe6f9b022
-0,         90,         90,        1,   152064, 0xf09e2fbb
-0,         91,         91,        1,   152064, 0x7244e477
-0,         92,         92,        1,   152064, 0x0dfc72eb
-0,         93,         93,        1,   152064, 0x0322b21f
-0,         94,         94,        1,   152064, 0x18b08205
-0,         95,         95,        1,   152064, 0x6606153e
-0,         96,         96,        1,   152064, 0x85186272
-0,         97,         97,        1,   152064, 0x3369f064
-0,         98,         98,        1,   152064, 0xbe0d5a44
-0,         99,         99,        1,   152064, 0x320258bb
-0,        100,        100,        1,   152064, 0x4d6fb091
-0,        101,        101,        1,   152064, 0xc9bbf5e7
-0,        102,        102,        1,   152064, 0x0aa1b69b
-0,        103,        103,        1,   152064, 0x85b9ac11
-0,        104,        104,        1,   152064, 0xb25ff818
-0,        105,        105,        1,   152064, 0xa155dc25
-0,        106,        106,        1,   152064, 0xa8e03bfd
-0,        107,        107,        1,   152064, 0x0a862956
-0,        108,        108,        1,   152064, 0x11b49264
-0,        109,        109,        1,   152064, 0xa94e664e
-0,        110,        110,        1,   152064, 0x330e0fa2
-0,        111,        111,        1,   152064, 0xaf3d9518
-0,        112,        112,        1,   152064, 0x0836f2e8
-0,        113,        113,        1,   152064, 0xbf6dc578
-0,        114,        114,        1,   152064, 0x7b524d20
-0,        115,        115,        1,   152064, 0x9ef7677f
-0,        116,        116,        1,   152064, 0xeacf3f34
-0,        117,        117,        1,   152064, 0xfb4e3dbe
-0,        118,        118,        1,   152064, 0xb46e25cb
-0,        119,        119,        1,   152064, 0x363c1603
-0,        120,        120,        1,   152064, 0x263fc542
-0,        121,        121,        1,   152064, 0xf106e548
-0,        122,        122,        1,   152064, 0xde43c56a
-0,        123,        123,        1,   152064, 0xc2c4770a
-0,        124,        124,        1,   152064, 0x122fce19
-0,        125,        125,        1,   152064, 0x3ba01434
-0,        126,        126,        1,   152064, 0x0e8ce5ee
-0,        127,        127,        1,   152064, 0x6ceb82e1
-0,        128,        128,        1,   152064, 0xa23ee21c
-0,        129,        129,        1,   152064, 0xc6d960f9
-0,        130,        130,        1,   152064, 0x0de15258
-0,        131,        131,        1,   152064, 0x187b0333
-0,        132,        132,        1,   152064, 0x92e6582f
-0,        133,        133,        1,   152064, 0xb9586ce0
-0,        134,        134,        1,   152064, 0xefd803b5
-0,        135,        135,        1,   152064, 0x24eafb29
-0,        136,        136,        1,   152064, 0x20c73b14
-0,        137,        137,        1,   152064, 0xbd7ceaaa
-0,        138,        138,        1,   152064, 0x775216c8
-0,        139,        139,        1,   152064, 0xa08971c7
-0,        140,        140,        1,   152064, 0xef0ee865
-0,        141,        141,        1,   152064, 0x9ac61c2f
-0,        142,        142,        1,   152064, 0x52ae8ea9
-0,        143,        143,        1,   152064, 0x06571c14
-0,        144,        144,        1,   152064, 0x6e78ad33
-0,        145,        145,        1,   152064, 0xad01c627
-0,        146,        146,        1,   152064, 0xbfe074d3
-0,        147,        147,        1,   152064, 0x9357a183
-0,        148,        148,        1,   152064, 0x8de7767f
-0,        149,        149,        1,   152064, 0xa5e6e76e
-0,        150,        150,        1,   152064, 0xa6f646fe
-0,        151,        151,        1,   152064, 0x132e99f8
-0,        152,        152,        1,   152064, 0xb79f27de
-0,        153,        153,        1,   152064, 0x36d3cdcf
-0,        154,        154,        1,   152064, 0xdc938336
-0,        155,        155,        1,   152064, 0xacaa3a7f
-0,        156,        156,        1,   152064, 0xc61a37fd
-0,        157,        157,        1,   152064, 0x4fe1ddf0
-0,        158,        158,        1,   152064, 0xc0f7d660
-0,        159,        159,        1,   152064, 0xd72458ea
-0,        160,        160,        1,   152064, 0x6978d123
-0,        161,        161,        1,   152064, 0x64e60ccf
-0,        162,        162,        1,   152064, 0xaa07004c
-0,        163,        163,        1,   152064, 0x07cd1064
-0,        164,        164,        1,   152064, 0xa82320e5
-0,        165,        165,        1,   152064, 0xaedd8d30
-0,        166,        166,        1,   152064, 0x79b082ea
-0,        167,        167,        1,   152064, 0x9ed800ab
-0,        168,        168,        1,   152064, 0xde592bb4
-0,        169,        169,        1,   152064, 0xd966df88
-0,        170,        170,        1,   152064, 0xf921988a
-0,        171,        171,        1,   152064, 0x557ad9ae
-0,        172,        172,        1,   152064, 0xc3f31a9a
-0,        173,        173,        1,   152064, 0x65248561
-0,        174,        174,        1,   152064, 0x63df4aa6
-0,        175,        175,        1,   152064, 0x618da0a9
-0,        176,        176,        1,   152064, 0xe6f1c435
-0,        177,        177,        1,   152064, 0x9f90c38f
-0,        178,        178,        1,   152064, 0xd2853e14
-0,        179,        179,        1,   152064, 0x6e0268a9
-0,        180,        180,        1,   152064, 0x393712d1
-0,        181,        181,        1,   152064, 0x470da25f
-0,        182,        182,        1,   152064, 0xaf55cb3d
-0,        183,        183,        1,   152064, 0x6935b8b9
-0,        184,        184,        1,   152064, 0x5409a15f
-0,        185,        185,        1,   152064, 0x09073fee
-0,        186,        186,        1,   152064, 0xfb274e82
-0,        187,        187,        1,   152064, 0x1a770581
-0,        188,        188,        1,   152064, 0x17277d0d
-0,        189,        189,        1,   152064, 0xd4dcd982
-0,        190,        190,        1,   152064, 0x6b04eaf3
-0,        191,        191,        1,   152064, 0x8a3d822e
-0,        192,        192,        1,   152064, 0x1b971ec9
-0,        193,        193,        1,   152064, 0x14e0c0f6
-0,        194,        194,        1,   152064, 0x00667450
-0,        195,        195,        1,   152064, 0xd2385902
-0,        196,        196,        1,   152064, 0x905da6ab
-0,        197,        197,        1,   152064, 0xa3ffb18b
-0,        198,        198,        1,   152064, 0x10d48b19
-0,        199,        199,        1,   152064, 0xb2c7a3bd
-0,        200,        200,        1,   152064, 0x45593e96
-0,        201,        201,        1,   152064, 0x47a0b60c
-0,        202,        202,        1,   152064, 0x68c6d1b9
-0,        203,        203,        1,   152064, 0xbc881fcc
-0,        204,        204,        1,   152064, 0x422cc6f2
-0,        205,        205,        1,   152064, 0x9b686410
-0,        206,        206,        1,   152064, 0x35dc5e86
-0,        207,        207,        1,   152064, 0x247bedaa
-0,        208,        208,        1,   152064, 0x22b76fd1
-0,        209,        209,        1,   152064, 0x67cc7a75
-0,        210,        210,        1,   152064, 0xa197521e
-0,        211,        211,        1,   152064, 0x428c8662
-0,        212,        212,        1,   152064, 0x33dc2c73
-0,        213,        213,        1,   152064, 0x5b538903
-0,        214,        214,        1,   152064, 0x3c4176b6
-0,        215,        215,        1,   152064, 0x774364ba
-0,        216,        216,        1,   152064, 0xf237d03e
-0,        217,        217,        1,   152064, 0xac8746fb
-0,        218,        218,        1,   152064, 0x6b306a84
-0,        219,        219,        1,   152064, 0xa2ace513
-0,        220,        220,        1,   152064, 0x709c9be7
-0,        221,        221,        1,   152064, 0x2403f373
-0,        222,        222,        1,   152064, 0x147bf717
-0,        223,        223,        1,   152064, 0xe58964c8
-0,        224,        224,        1,   152064, 0xa0da36fc
-0,        225,        225,        1,   152064, 0x1ac1355c
-0,        226,        226,        1,   152064, 0x8a31c9f2
-0,        227,        227,        1,   152064, 0x42ba205c
-0,        228,        228,        1,   152064, 0xa11b3575
-0,        229,        229,        1,   152064, 0xcb35207c
-0,        230,        230,        1,   152064, 0x528f6189
-0,        231,        231,        1,   152064, 0x34f05bd7
-0,        232,        232,        1,   152064, 0x72317356
-0,        233,        233,        1,   152064, 0xaabd5028
-0,        234,        234,        1,   152064, 0x13dbeb7b
-0,        235,        235,        1,   152064, 0x62f1e8a8
-0,        236,        236,        1,   152064, 0x1723bfcd
-0,        237,        237,        1,   152064, 0x5c083c00
-0,        238,        238,        1,   152064, 0x52137894
-0,        239,        239,        1,   152064, 0xef1e082c
-0,        240,        240,        1,   152064, 0x664b3d53
-0,        241,        241,        1,   152064, 0x2eb9b296
-0,        242,        242,        1,   152064, 0xd0ca511e
-0,        243,        243,        1,   152064, 0x012d4724
-0,        244,        244,        1,   152064, 0xa847f5af
-0,        245,        245,        1,   152064, 0x483a2fde
-0,        246,        246,        1,   152064, 0xd1ab0257
-0,        247,        247,        1,   152064, 0x414692c7
-0,        248,        248,        1,   152064, 0x0b79df88
-0,        249,        249,        1,   152064, 0xdaa2c4a3
-0,        250,        250,        1,   152064, 0xd1b44500
-0,        251,        251,        1,   152064, 0xfd3d2cf3
-0,        252,        252,        1,   152064, 0xfdc0f748
-0,        253,        253,        1,   152064, 0xce762a2a
-0,        254,        254,        1,   152064, 0x08b63572
-0,        255,        255,        1,   152064, 0x5a46a38d
-0,        256,        256,        1,   152064, 0x03cee9c0
-0,        257,        257,        1,   152064, 0x9ee45473
-0,        258,        258,        1,   152064, 0x5a432386
-0,        259,        259,        1,   152064, 0x54c83d87
-0,        260,        260,        1,   152064, 0xc9caa1de
-0,        261,        261,        1,   152064, 0xa28367f1
-0,        262,        262,        1,   152064, 0x2607cdf1
-0,        263,        263,        1,   152064, 0x06baa8de
-0,        264,        264,        1,   152064, 0xf5346e32
-0,        265,        265,        1,   152064, 0x6d3e732b
-0,        266,        266,        1,   152064, 0x798c584b
-0,        267,        267,        1,   152064, 0x4076c948
-0,        268,        268,        1,   152064, 0x868cf63a
-0,        269,        269,        1,   152064, 0x23107ac5
-0,        270,        270,        1,   152064, 0x306f3fe2
-0,        271,        271,        1,   152064, 0xbd1d71d6
-0,        272,        272,        1,   152064, 0x1429545f
-0,        273,        273,        1,   152064, 0xaded29aa
-0,        274,        274,        1,   152064, 0x9b455a94
-0,        275,        275,        1,   152064, 0xb3774ce7
-0,        276,        276,        1,   152064, 0x92580986
-0,        277,        277,        1,   152064, 0x0eae2f95
-0,        278,        278,        1,   152064, 0x599208b2
-0,        279,        279,        1,   152064, 0x4804c04c
-0,        280,        280,        1,   152064, 0x5f730e8f
-0,        281,        281,        1,   152064, 0x3e501d1e
-0,        282,        282,        1,   152064, 0x32100740
-0,        283,        283,        1,   152064, 0x62226ff8
-0,        284,        284,        1,   152064, 0x7683b622
-0,        285,        285,        1,   152064, 0xc3e0aec1
-0,        286,        286,        1,   152064, 0xfac12608
-0,        287,        287,        1,   152064, 0xb21a5781
-0,        288,        288,        1,   152064, 0x8f1e4964
-0,        289,        289,        1,   152064, 0x0f62dd6e
-0,        290,        290,        1,   152064, 0xac062ac4
-0,        291,        291,        1,   152064, 0x1b320f7a
-0,        292,        292,        1,   152064, 0x346e7211
-0,        293,        293,        1,   152064, 0xe47592f3
-0,        294,        294,        1,   152064, 0xa3a7919c
-0,        295,        295,        1,   152064, 0xa3580fa6
-0,        296,        296,        1,   152064, 0xc73430c1
-0,        297,        297,        1,   152064, 0x994a2c18
-0,        298,        298,        1,   152064, 0x0b5d8d45
-0,        299,        299,        1,   152064, 0x9eed5109
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcalq_brcm_b b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcalq_brcm_b
deleted file mode 100644
index 49249b3..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcalq_brcm_b
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf3c68dea
-0,          1,          1,        1,   152064, 0xf52d483f
-0,          2,          2,        1,   152064, 0x612f1792
-0,          3,          3,        1,   152064, 0x4df34726
-0,          4,          4,        1,   152064, 0xfed7c058
-0,          5,          5,        1,   152064, 0x2d48025c
-0,          6,          6,        1,   152064, 0x03544ab9
-0,          7,          7,        1,   152064, 0x20cadfc5
-0,          8,          8,        1,   152064, 0x7cd3672e
-0,          9,          9,        1,   152064, 0x5f2b9ede
-0,         10,         10,        1,   152064, 0xc0bbdf75
-0,         11,         11,        1,   152064, 0x95571e7c
-0,         12,         12,        1,   152064, 0x0d1afc5b
-0,         13,         13,        1,   152064, 0x9c91c11f
-0,         14,         14,        1,   152064, 0x73e667e4
-0,         15,         15,        1,   152064, 0xfb7f8892
-0,         16,         16,        1,   152064, 0x5707f566
-0,         17,         17,        1,   152064, 0x21032449
-0,         18,         18,        1,   152064, 0x199e20b7
-0,         19,         19,        1,   152064, 0x23213179
-0,         20,         20,        1,   152064, 0x29812daa
-0,         21,         21,        1,   152064, 0x04e3eb6b
-0,         22,         22,        1,   152064, 0xab206165
-0,         23,         23,        1,   152064, 0x392fbf7b
-0,         24,         24,        1,   152064, 0x137a1c6a
-0,         25,         25,        1,   152064, 0x9caff265
-0,         26,         26,        1,   152064, 0x6becf046
-0,         27,         27,        1,   152064, 0xfc2c3ba6
-0,         28,         28,        1,   152064, 0xcf4b9b4c
-0,         29,         29,        1,   152064, 0x4e2ebd37
-0,         30,         30,        1,   152064, 0xcd419daa
-0,         31,         31,        1,   152064, 0xe12294b0
-0,         32,         32,        1,   152064, 0x6bda7493
-0,         33,         33,        1,   152064, 0xefbf5d0b
-0,         34,         34,        1,   152064, 0x9500458a
-0,         35,         35,        1,   152064, 0x6b5d212e
-0,         36,         36,        1,   152064, 0xb928fc31
-0,         37,         37,        1,   152064, 0x64f2bb2f
-0,         38,         38,        1,   152064, 0xf93a724d
-0,         39,         39,        1,   152064, 0xdd0d32c0
-0,         40,         40,        1,   152064, 0xe1b51d95
-0,         41,         41,        1,   152064, 0xbb43d295
-0,         42,         42,        1,   152064, 0x6dcea069
-0,         43,         43,        1,   152064, 0x89d79805
-0,         44,         44,        1,   152064, 0x50b5dd43
-0,         45,         45,        1,   152064, 0xe3099e3f
-0,         46,         46,        1,   152064, 0x003b6ace
-0,         47,         47,        1,   152064, 0x2213b672
-0,         48,         48,        1,   152064, 0x5b273093
-0,         49,         49,        1,   152064, 0xdbfbd9bf
-0,         50,         50,        1,   152064, 0xf26b89d0
-0,         51,         51,        1,   152064, 0x1470527e
-0,         52,         52,        1,   152064, 0x0e668970
-0,         53,         53,        1,   152064, 0x00218692
-0,         54,         54,        1,   152064, 0xaabf79a8
-0,         55,         55,        1,   152064, 0xf68b4663
-0,         56,         56,        1,   152064, 0x4c08d01f
-0,         57,         57,        1,   152064, 0x48e75380
-0,         58,         58,        1,   152064, 0x4b8be58f
-0,         59,         59,        1,   152064, 0x8a6c1365
-0,         60,         60,        1,   152064, 0x9439ca02
-0,         61,         61,        1,   152064, 0x831d9855
-0,         62,         62,        1,   152064, 0xff031ffd
-0,         63,         63,        1,   152064, 0x3680f4bc
-0,         64,         64,        1,   152064, 0x794c95a4
-0,         65,         65,        1,   152064, 0x23e53349
-0,         66,         66,        1,   152064, 0x85307117
-0,         67,         67,        1,   152064, 0x0bc0bf5a
-0,         68,         68,        1,   152064, 0xc79f46c8
-0,         69,         69,        1,   152064, 0x48be4e21
-0,         70,         70,        1,   152064, 0x2ad89b4f
-0,         71,         71,        1,   152064, 0xd454f9a9
-0,         72,         72,        1,   152064, 0x64852f6d
-0,         73,         73,        1,   152064, 0xcb7b0c05
-0,         74,         74,        1,   152064, 0x4e108ced
-0,         75,         75,        1,   152064, 0xf5e5a37b
-0,         76,         76,        1,   152064, 0x224e29c7
-0,         77,         77,        1,   152064, 0xad90d3c2
-0,         78,         78,        1,   152064, 0x5ddb5d05
-0,         79,         79,        1,   152064, 0x4ebf4337
-0,         80,         80,        1,   152064, 0x7e2bfeed
-0,         81,         81,        1,   152064, 0x00e884c7
-0,         82,         82,        1,   152064, 0xa4f6a534
-0,         83,         83,        1,   152064, 0x622f1511
-0,         84,         84,        1,   152064, 0x8d99233d
-0,         85,         85,        1,   152064, 0x5910d02c
-0,         86,         86,        1,   152064, 0x20d6706c
-0,         87,         87,        1,   152064, 0x8e30a417
-0,         88,         88,        1,   152064, 0x180d745a
-0,         89,         89,        1,   152064, 0xc25189b9
-0,         90,         90,        1,   152064, 0x909101ad
-0,         91,         91,        1,   152064, 0x9967be1c
-0,         92,         92,        1,   152064, 0x72ff3206
-0,         93,         93,        1,   152064, 0x48d07f48
-0,         94,         94,        1,   152064, 0x7f8244b7
-0,         95,         95,        1,   152064, 0xf871e21e
-0,         96,         96,        1,   152064, 0xd4743610
-0,         97,         97,        1,   152064, 0xc2c7a7b1
-0,         98,         98,        1,   152064, 0x95be1a75
-0,         99,         99,        1,   152064, 0x44972b2e
-0,        100,        100,        1,   152064, 0xa6036c4f
-0,        101,        101,        1,   152064, 0xecdd8dd6
-0,        102,        102,        1,   152064, 0xbb7e8551
-0,        103,        103,        1,   152064, 0x42916e6c
-0,        104,        104,        1,   152064, 0x972db010
-0,        105,        105,        1,   152064, 0x80dab6a0
-0,        106,        106,        1,   152064, 0xc753ecdb
-0,        107,        107,        1,   152064, 0x0823bffa
-0,        108,        108,        1,   152064, 0x80876b2d
-0,        109,        109,        1,   152064, 0x4a8b2118
-0,        110,        110,        1,   152064, 0x0be2c13d
-0,        111,        111,        1,   152064, 0xa6966e4f
-0,        112,        112,        1,   152064, 0xf6a57650
-0,        113,        113,        1,   152064, 0x49d66fd4
-0,        114,        114,        1,   152064, 0x21d92047
-0,        115,        115,        1,   152064, 0x155f20a8
-0,        116,        116,        1,   152064, 0x5ab90c1d
-0,        117,        117,        1,   152064, 0xa0c31337
-0,        118,        118,        1,   152064, 0xd20de1d6
-0,        119,        119,        1,   152064, 0x300ad916
-0,        120,        120,        1,   152064, 0xbcb89eb5
-0,        121,        121,        1,   152064, 0x08759342
-0,        122,        122,        1,   152064, 0xa5d06e72
-0,        123,        123,        1,   152064, 0x3b4c537f
-0,        124,        124,        1,   152064, 0x7f48912b
-0,        125,        125,        1,   152064, 0x200dbd1f
-0,        126,        126,        1,   152064, 0x918abfde
-0,        127,        127,        1,   152064, 0xd8072cdf
-0,        128,        128,        1,   152064, 0x89d2902b
-0,        129,        129,        1,   152064, 0xcd2e2e3c
-0,        130,        130,        1,   152064, 0xf343e4a2
-0,        131,        131,        1,   152064, 0xc424acad
-0,        132,        132,        1,   152064, 0xf71e3031
-0,        133,        133,        1,   152064, 0xf1bc1179
-0,        134,        134,        1,   152064, 0x9af58d24
-0,        135,        135,        1,   152064, 0x48a4d01e
-0,        136,        136,        1,   152064, 0xcf24f721
-0,        137,        137,        1,   152064, 0x5bc7b4f3
-0,        138,        138,        1,   152064, 0x8763fc59
-0,        139,        139,        1,   152064, 0xb6954051
-0,        140,        140,        1,   152064, 0x044ba446
-0,        141,        141,        1,   152064, 0xdaaaee7e
-0,        142,        142,        1,   152064, 0x8eac550d
-0,        143,        143,        1,   152064, 0x5191d08c
-0,        144,        144,        1,   152064, 0x3cd76d43
-0,        145,        145,        1,   152064, 0xf01f8fa9
-0,        146,        146,        1,   152064, 0x0e283e9b
-0,        147,        147,        1,   152064, 0x7cef69ee
-0,        148,        148,        1,   152064, 0xc8e332bc
-0,        149,        149,        1,   152064, 0x5b1aa484
-0,        150,        150,        1,   152064, 0x3975234f
-0,        151,        151,        1,   152064, 0x52b8661e
-0,        152,        152,        1,   152064, 0xb4b8fed8
-0,        153,        153,        1,   152064, 0x5aff9f70
-0,        154,        154,        1,   152064, 0x7b575735
-0,        155,        155,        1,   152064, 0x77d51523
-0,        156,        156,        1,   152064, 0xf5131eba
-0,        157,        157,        1,   152064, 0x4bd2b1ad
-0,        158,        158,        1,   152064, 0xccfc8dca
-0,        159,        159,        1,   152064, 0xcf245472
-0,        160,        160,        1,   152064, 0xe055adf5
-0,        161,        161,        1,   152064, 0x2a90e171
-0,        162,        162,        1,   152064, 0x1bd8ea64
-0,        163,        163,        1,   152064, 0x32f1d794
-0,        164,        164,        1,   152064, 0xc938c42a
-0,        165,        165,        1,   152064, 0x12b5644f
-0,        166,        166,        1,   152064, 0x99003711
-0,        167,        167,        1,   152064, 0xaecfad1c
-0,        168,        168,        1,   152064, 0x94b00ae1
-0,        169,        169,        1,   152064, 0xbb4f982f
-0,        170,        170,        1,   152064, 0x6f7f5dc1
-0,        171,        171,        1,   152064, 0x7be7c2cb
-0,        172,        172,        1,   152064, 0x3b2ee4d3
-0,        173,        173,        1,   152064, 0xc75f5666
-0,        174,        174,        1,   152064, 0xff7a3ede
-0,        175,        175,        1,   152064, 0x55866b59
-0,        176,        176,        1,   152064, 0x408b8455
-0,        177,        177,        1,   152064, 0x96c4ab66
-0,        178,        178,        1,   152064, 0x1d87f575
-0,        179,        179,        1,   152064, 0x3a3b17ac
-0,        180,        180,        1,   152064, 0x9c99e591
-0,        181,        181,        1,   152064, 0xc1fc663d
-0,        182,        182,        1,   152064, 0x17b982dd
-0,        183,        183,        1,   152064, 0x24fe9dad
-0,        184,        184,        1,   152064, 0xea8760ee
-0,        185,        185,        1,   152064, 0x23dcefad
-0,        186,        186,        1,   152064, 0xee6d23f0
-0,        187,        187,        1,   152064, 0xfddc1962
-0,        188,        188,        1,   152064, 0xb23190df
-0,        189,        189,        1,   152064, 0xf066a595
-0,        190,        190,        1,   152064, 0x2200fef8
-0,        191,        191,        1,   152064, 0x5491ab2f
-0,        192,        192,        1,   152064, 0xea93fa58
-0,        193,        193,        1,   152064, 0x3e13d4f4
-0,        194,        194,        1,   152064, 0x3dda841d
-0,        195,        195,        1,   152064, 0xfc243577
-0,        196,        196,        1,   152064, 0xca4a9127
-0,        197,        197,        1,   152064, 0x41908ec0
-0,        198,        198,        1,   152064, 0x10a758bd
-0,        199,        199,        1,   152064, 0x6a849e5b
-0,        200,        200,        1,   152064, 0xb55a1f2b
-0,        201,        201,        1,   152064, 0x2bfe9627
-0,        202,        202,        1,   152064, 0x2bfca28c
-0,        203,        203,        1,   152064, 0xd166f336
-0,        204,        204,        1,   152064, 0x9facb32b
-0,        205,        205,        1,   152064, 0x6a672475
-0,        206,        206,        1,   152064, 0xc7b219cf
-0,        207,        207,        1,   152064, 0x2b43ca53
-0,        208,        208,        1,   152064, 0x43b542c4
-0,        209,        209,        1,   152064, 0xdc654337
-0,        210,        210,        1,   152064, 0x68003d7c
-0,        211,        211,        1,   152064, 0x3cb85724
-0,        212,        212,        1,   152064, 0x422701c2
-0,        213,        213,        1,   152064, 0x1c667870
-0,        214,        214,        1,   152064, 0x75ef3230
-0,        215,        215,        1,   152064, 0x0ac82643
-0,        216,        216,        1,   152064, 0x3eb3a0be
-0,        217,        217,        1,   152064, 0x482bd77e
-0,        218,        218,        1,   152064, 0xd3ce1171
-0,        219,        219,        1,   152064, 0xeaefc7e4
-0,        220,        220,        1,   152064, 0xa9c67939
-0,        221,        221,        1,   152064, 0x0af0a25b
-0,        222,        222,        1,   152064, 0xd094d95a
-0,        223,        223,        1,   152064, 0xfda42fc6
-0,        224,        224,        1,   152064, 0x4669f952
-0,        225,        225,        1,   152064, 0x52d40e98
-0,        226,        226,        1,   152064, 0x27c36cd1
-0,        227,        227,        1,   152064, 0xa103b6ce
-0,        228,        228,        1,   152064, 0x2be9026d
-0,        229,        229,        1,   152064, 0x2f4ecc59
-0,        230,        230,        1,   152064, 0x53144cef
-0,        231,        231,        1,   152064, 0x15d54fc9
-0,        232,        232,        1,   152064, 0x7e302db7
-0,        233,        233,        1,   152064, 0x82521901
-0,        234,        234,        1,   152064, 0x1123cdb6
-0,        235,        235,        1,   152064, 0x3185878a
-0,        236,        236,        1,   152064, 0xbb294983
-0,        237,        237,        1,   152064, 0x83d9fe66
-0,        238,        238,        1,   152064, 0xede9fb08
-0,        239,        239,        1,   152064, 0xa543b551
-0,        240,        240,        1,   152064, 0x39e82734
-0,        241,        241,        1,   152064, 0xd0447fb5
-0,        242,        242,        1,   152064, 0x8cc6f502
-0,        243,        243,        1,   152064, 0xda8d1da8
-0,        244,        244,        1,   152064, 0xcafdccca
-0,        245,        245,        1,   152064, 0xbf0e04f4
-0,        246,        246,        1,   152064, 0x0c6eefec
-0,        247,        247,        1,   152064, 0xb9026d39
-0,        248,        248,        1,   152064, 0x0121a7a8
-0,        249,        249,        1,   152064, 0x453ebbc6
-0,        250,        250,        1,   152064, 0x14ae15e3
-0,        251,        251,        1,   152064, 0x51d618e1
-0,        252,        252,        1,   152064, 0x2254f452
-0,        253,        253,        1,   152064, 0x8c360633
-0,        254,        254,        1,   152064, 0x8704d9bc
-0,        255,        255,        1,   152064, 0xe5d48301
-0,        256,        256,        1,   152064, 0xf25b7b3f
-0,        257,        257,        1,   152064, 0xd2ad3b73
-0,        258,        258,        1,   152064, 0x53db0387
-0,        259,        259,        1,   152064, 0x2486341c
-0,        260,        260,        1,   152064, 0x4a24570b
-0,        261,        261,        1,   152064, 0x0694620a
-0,        262,        262,        1,   152064, 0xbbc2a302
-0,        263,        263,        1,   152064, 0x08ad9c02
-0,        264,        264,        1,   152064, 0x601a63ab
-0,        265,        265,        1,   152064, 0xe4234a48
-0,        266,        266,        1,   152064, 0x07702235
-0,        267,        267,        1,   152064, 0x719dbecf
-0,        268,        268,        1,   152064, 0xf301a7ad
-0,        269,        269,        1,   152064, 0xf15c70c3
-0,        270,        270,        1,   152064, 0x0ab93386
-0,        271,        271,        1,   152064, 0x99c05adb
-0,        272,        272,        1,   152064, 0x9ed43530
-0,        273,        273,        1,   152064, 0xa2f62122
-0,        274,        274,        1,   152064, 0xf16f4525
-0,        275,        275,        1,   152064, 0xa3403b4a
-0,        276,        276,        1,   152064, 0x95521096
-0,        277,        277,        1,   152064, 0x0d412988
-0,        278,        278,        1,   152064, 0x829e080a
-0,        279,        279,        1,   152064, 0x0805c1b5
-0,        280,        280,        1,   152064, 0xa136be48
-0,        281,        281,        1,   152064, 0x0f8de228
-0,        282,        282,        1,   152064, 0x272cf2d3
-0,        283,        283,        1,   152064, 0xa1df2a5e
-0,        284,        284,        1,   152064, 0xf9db8350
-0,        285,        285,        1,   152064, 0x5536997d
-0,        286,        286,        1,   152064, 0xab83e81e
-0,        287,        287,        1,   152064, 0xec791b49
-0,        288,        288,        1,   152064, 0x04d03e19
-0,        289,        289,        1,   152064, 0xd6a2bd21
-0,        290,        290,        1,   152064, 0x2d35f0aa
-0,        291,        291,        1,   152064, 0x137bf715
-0,        292,        292,        1,   152064, 0x56ef5ae1
-0,        293,        293,        1,   152064, 0x9bb5821e
-0,        294,        294,        1,   152064, 0x533c7fff
-0,        295,        295,        1,   152064, 0x469ad380
-0,        296,        296,        1,   152064, 0x75710e84
-0,        297,        297,        1,   152064, 0xbbd72551
-0,        298,        298,        1,   152064, 0xf1137026
-0,        299,        299,        1,   152064, 0x6238412b
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcamapalq_bcrm_b b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcamapalq_bcrm_b
deleted file mode 100644
index a81e91f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcamapalq_bcrm_b
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf8248ceb
-0,          1,          1,        1,   152064, 0xb6204c81
-0,          2,          2,        1,   152064, 0x22fb1737
-0,          3,          3,        1,   152064, 0xce8c3fd7
-0,          4,          4,        1,   152064, 0xee88cedc
-0,          5,          5,        1,   152064, 0x1d4209ca
-0,          6,          6,        1,   152064, 0x6fb15238
-0,          7,          7,        1,   152064, 0x505200c2
-0,          8,          8,        1,   152064, 0xb73574ba
-0,          9,          9,        1,   152064, 0x0586a097
-0,         10,         10,        1,   152064, 0xed50fe02
-0,         11,         11,        1,   152064, 0x222221ab
-0,         12,         12,        1,   152064, 0x8afefd46
-0,         13,         13,        1,   152064, 0x6832c5cc
-0,         14,         14,        1,   152064, 0xba4c8110
-0,         15,         15,        1,   152064, 0x95c07e1e
-0,         16,         16,        1,   152064, 0xc5d6fde9
-0,         17,         17,        1,   152064, 0xe75a4921
-0,         18,         18,        1,   152064, 0x53b61688
-0,         19,         19,        1,   152064, 0x0335424b
-0,         20,         20,        1,   152064, 0x621742c7
-0,         21,         21,        1,   152064, 0x4f69f41b
-0,         22,         22,        1,   152064, 0x6b3f65d7
-0,         23,         23,        1,   152064, 0x8dfde04f
-0,         24,         24,        1,   152064, 0x30750ff5
-0,         25,         25,        1,   152064, 0xe3d70f3c
-0,         26,         26,        1,   152064, 0x0c1af825
-0,         27,         27,        1,   152064, 0x58a53935
-0,         28,         28,        1,   152064, 0xc63d9e98
-0,         29,         29,        1,   152064, 0xa85fdc48
-0,         30,         30,        1,   152064, 0x01bb9784
-0,         31,         31,        1,   152064, 0xdd5cb509
-0,         32,         32,        1,   152064, 0x29ae7d2b
-0,         33,         33,        1,   152064, 0xdb08593e
-0,         34,         34,        1,   152064, 0x372d5d4e
-0,         35,         35,        1,   152064, 0x31522664
-0,         36,         36,        1,   152064, 0x3f13f335
-0,         37,         37,        1,   152064, 0xfd10c19a
-0,         38,         38,        1,   152064, 0xef728975
-0,         39,         39,        1,   152064, 0x8e79234d
-0,         40,         40,        1,   152064, 0x47022791
-0,         41,         41,        1,   152064, 0x1ef9d297
-0,         42,         42,        1,   152064, 0x77bf9738
-0,         43,         43,        1,   152064, 0xd6bc8f03
-0,         44,         44,        1,   152064, 0x283ded4a
-0,         45,         45,        1,   152064, 0xd87098d1
-0,         46,         46,        1,   152064, 0x300077a2
-0,         47,         47,        1,   152064, 0x30ffbea4
-0,         48,         48,        1,   152064, 0x5dc5356b
-0,         49,         49,        1,   152064, 0x31cce185
-0,         50,         50,        1,   152064, 0x47fc9148
-0,         51,         51,        1,   152064, 0x1641491e
-0,         52,         52,        1,   152064, 0x2184937d
-0,         53,         53,        1,   152064, 0x126eb74a
-0,         54,         54,        1,   152064, 0x25c07593
-0,         55,         55,        1,   152064, 0xb1294e7e
-0,         56,         56,        1,   152064, 0x8b35f45d
-0,         57,         57,        1,   152064, 0x54765025
-0,         58,         58,        1,   152064, 0x1d17e901
-0,         59,         59,        1,   152064, 0xaeab358d
-0,         60,         60,        1,   152064, 0xf682c91f
-0,         61,         61,        1,   152064, 0x0b4c9b06
-0,         62,         62,        1,   152064, 0x45f326dc
-0,         63,         63,        1,   152064, 0x132eeda3
-0,         64,         64,        1,   152064, 0x3c9b8e16
-0,         65,         65,        1,   152064, 0x1be133c1
-0,         66,         66,        1,   152064, 0xfa876720
-0,         67,         67,        1,   152064, 0x1666cdb8
-0,         68,         68,        1,   152064, 0x362f418f
-0,         69,         69,        1,   152064, 0x926b4a96
-0,         70,         70,        1,   152064, 0xee3da1df
-0,         71,         71,        1,   152064, 0xc11f025d
-0,         72,         72,        1,   152064, 0x9ba62c19
-0,         73,         73,        1,   152064, 0x0d66194f
-0,         74,         74,        1,   152064, 0x2fd09340
-0,         75,         75,        1,   152064, 0x3dfb9e4d
-0,         76,         76,        1,   152064, 0xa3192ce6
-0,         77,         77,        1,   152064, 0x6bfce0e1
-0,         78,         78,        1,   152064, 0x3b7c5286
-0,         79,         79,        1,   152064, 0xb52f4bf5
-0,         80,         80,        1,   152064, 0x30870027
-0,         81,         81,        1,   152064, 0x6f8e71c3
-0,         82,         82,        1,   152064, 0x8d41b09a
-0,         83,         83,        1,   152064, 0xc1ff1d05
-0,         84,         84,        1,   152064, 0xca54125c
-0,         85,         85,        1,   152064, 0x3342d823
-0,         86,         86,        1,   152064, 0xcc4a7542
-0,         87,         87,        1,   152064, 0x21fc9a9d
-0,         88,         88,        1,   152064, 0x91587574
-0,         89,         89,        1,   152064, 0x30929cc2
-0,         90,         90,        1,   152064, 0xf07606b7
-0,         91,         91,        1,   152064, 0x0476b876
-0,         92,         92,        1,   152064, 0x213333dc
-0,         93,         93,        1,   152064, 0x87c67597
-0,         94,         94,        1,   152064, 0x05434641
-0,         95,         95,        1,   152064, 0x959eeffc
-0,         96,         96,        1,   152064, 0x92a130b4
-0,         97,         97,        1,   152064, 0x53d0b544
-0,         98,         98,        1,   152064, 0xaf8c233e
-0,         99,         99,        1,   152064, 0xd3d4259a
-0,        100,        100,        1,   152064, 0xa0287753
-0,        101,        101,        1,   152064, 0xfa23972a
-0,        102,        102,        1,   152064, 0xacae756d
-0,        103,        103,        1,   152064, 0xd8b58b5c
-0,        104,        104,        1,   152064, 0x7db2c755
-0,        105,        105,        1,   152064, 0x31e7b79a
-0,        106,        106,        1,   152064, 0xd8660d98
-0,        107,        107,        1,   152064, 0xdcf0d10d
-0,        108,        108,        1,   152064, 0x3e6567e6
-0,        109,        109,        1,   152064, 0xec3530fd
-0,        110,        110,        1,   152064, 0xf686c61a
-0,        111,        111,        1,   152064, 0x6e706804
-0,        112,        112,        1,   152064, 0x5fd4a1a3
-0,        113,        113,        1,   152064, 0xbb3384f7
-0,        114,        114,        1,   152064, 0x8ffb14dd
-0,        115,        115,        1,   152064, 0x01253a73
-0,        116,        116,        1,   152064, 0xf89c15df
-0,        117,        117,        1,   152064, 0xda2b0b4c
-0,        118,        118,        1,   152064, 0xfc9dfcc1
-0,        119,        119,        1,   152064, 0xfef4f0fa
-0,        120,        120,        1,   152064, 0x91669bea
-0,        121,        121,        1,   152064, 0x3664a565
-0,        122,        122,        1,   152064, 0x32dd7923
-0,        123,        123,        1,   152064, 0x26825231
-0,        124,        124,        1,   152064, 0x5f81896e
-0,        125,        125,        1,   152064, 0x0c64ca2f
-0,        126,        126,        1,   152064, 0x488bb665
-0,        127,        127,        1,   152064, 0x4d183a0f
-0,        128,        128,        1,   152064, 0xed169321
-0,        129,        129,        1,   152064, 0xcec22917
-0,        130,        130,        1,   152064, 0xbe04ea6c
-0,        131,        131,        1,   152064, 0x32b8bf9f
-0,        132,        132,        1,   152064, 0x9c7c2e13
-0,        133,        133,        1,   152064, 0x232e3016
-0,        134,        134,        1,   152064, 0x1b76c08e
-0,        135,        135,        1,   152064, 0x7425d821
-0,        136,        136,        1,   152064, 0x0818ff3c
-0,        137,        137,        1,   152064, 0xb4f2c42b
-0,        138,        138,        1,   152064, 0xe029f979
-0,        139,        139,        1,   152064, 0x97c54c2f
-0,        140,        140,        1,   152064, 0xd101c3b5
-0,        141,        141,        1,   152064, 0x5ed1f5d4
-0,        142,        142,        1,   152064, 0xc28264d1
-0,        143,        143,        1,   152064, 0xa162dd31
-0,        144,        144,        1,   152064, 0x2ee872ce
-0,        145,        145,        1,   152064, 0x809a8fce
-0,        146,        146,        1,   152064, 0xcfcc3ef9
-0,        147,        147,        1,   152064, 0xa5be6ce3
-0,        148,        148,        1,   152064, 0xd75930a0
-0,        149,        149,        1,   152064, 0x28acb80f
-0,        150,        150,        1,   152064, 0x223f2152
-0,        151,        151,        1,   152064, 0x0cf070cb
-0,        152,        152,        1,   152064, 0xcc7d011e
-0,        153,        153,        1,   152064, 0xb2c2a63c
-0,        154,        154,        1,   152064, 0x15514caa
-0,        155,        155,        1,   152064, 0x0c6d18ee
-0,        156,        156,        1,   152064, 0x33b4265d
-0,        157,        157,        1,   152064, 0xb4abaaaf
-0,        158,        158,        1,   152064, 0x26a7a856
-0,        159,        159,        1,   152064, 0xc75249cc
-0,        160,        160,        1,   152064, 0x59ccb0e1
-0,        161,        161,        1,   152064, 0xc613f202
-0,        162,        162,        1,   152064, 0xd1c0e171
-0,        163,        163,        1,   152064, 0xa195da2b
-0,        164,        164,        1,   152064, 0xbc7ed475
-0,        165,        165,        1,   152064, 0x99206e2c
-0,        166,        166,        1,   152064, 0x0ef04e03
-0,        167,        167,        1,   152064, 0x68cbc6a1
-0,        168,        168,        1,   152064, 0x2a5304b1
-0,        169,        169,        1,   152064, 0xf017978b
-0,        170,        170,        1,   152064, 0x94f5641a
-0,        171,        171,        1,   152064, 0xd681bd8f
-0,        172,        172,        1,   152064, 0x16e1e3a3
-0,        173,        173,        1,   152064, 0xe4486c7e
-0,        174,        174,        1,   152064, 0xa1bd394e
-0,        175,        175,        1,   152064, 0x49ad5959
-0,        176,        176,        1,   152064, 0x82219b70
-0,        177,        177,        1,   152064, 0x64e2abcf
-0,        178,        178,        1,   152064, 0x6d7d05d8
-0,        179,        179,        1,   152064, 0xd9ac2251
-0,        180,        180,        1,   152064, 0xf477eee5
-0,        181,        181,        1,   152064, 0xb9826a78
-0,        182,        182,        1,   152064, 0x97828a37
-0,        183,        183,        1,   152064, 0x12099b1f
-0,        184,        184,        1,   152064, 0x1ec45fa7
-0,        185,        185,        1,   152064, 0xfd5501c9
-0,        186,        186,        1,   152064, 0x6a8b26a3
-0,        187,        187,        1,   152064, 0xae58ff40
-0,        188,        188,        1,   152064, 0xc0f47aa1
-0,        189,        189,        1,   152064, 0x08bfa548
-0,        190,        190,        1,   152064, 0x7f2ff5ef
-0,        191,        191,        1,   152064, 0x5efa94a3
-0,        192,        192,        1,   152064, 0xf786f970
-0,        193,        193,        1,   152064, 0xab6bc712
-0,        194,        194,        1,   152064, 0x25647bee
-0,        195,        195,        1,   152064, 0x54333ad5
-0,        196,        196,        1,   152064, 0xb3a99413
-0,        197,        197,        1,   152064, 0xe7a78a0d
-0,        198,        198,        1,   152064, 0xa5054abc
-0,        199,        199,        1,   152064, 0xb94896ea
-0,        200,        200,        1,   152064, 0x9f641bca
-0,        201,        201,        1,   152064, 0x7363901c
-0,        202,        202,        1,   152064, 0xd340a000
-0,        203,        203,        1,   152064, 0x0217f413
-0,        204,        204,        1,   152064, 0xbbdba6e6
-0,        205,        205,        1,   152064, 0xabc42617
-0,        206,        206,        1,   152064, 0xa3442925
-0,        207,        207,        1,   152064, 0x7d06c7e9
-0,        208,        208,        1,   152064, 0xa45e32df
-0,        209,        209,        1,   152064, 0xf5ed407f
-0,        210,        210,        1,   152064, 0x5ec235d5
-0,        211,        211,        1,   152064, 0xa5706635
-0,        212,        212,        1,   152064, 0xa44a209b
-0,        213,        213,        1,   152064, 0xf2137e37
-0,        214,        214,        1,   152064, 0x5220508f
-0,        215,        215,        1,   152064, 0xae6b37da
-0,        216,        216,        1,   152064, 0xdf09b6cd
-0,        217,        217,        1,   152064, 0x2d39e1c0
-0,        218,        218,        1,   152064, 0xc8284a76
-0,        219,        219,        1,   152064, 0x7d7bbe76
-0,        220,        220,        1,   152064, 0xcfed7416
-0,        221,        221,        1,   152064, 0x81caaedd
-0,        222,        222,        1,   152064, 0x9dcdd771
-0,        223,        223,        1,   152064, 0x46c1331b
-0,        224,        224,        1,   152064, 0xace60efa
-0,        225,        225,        1,   152064, 0x9e0909f7
-0,        226,        226,        1,   152064, 0x72f5a321
-0,        227,        227,        1,   152064, 0x68f8cdcc
-0,        228,        228,        1,   152064, 0xcc59fdd9
-0,        229,        229,        1,   152064, 0xc0a700c6
-0,        230,        230,        1,   152064, 0xf4254dcf
-0,        231,        231,        1,   152064, 0xc59b46d1
-0,        232,        232,        1,   152064, 0x2e5b2524
-0,        233,        233,        1,   152064, 0x46051293
-0,        234,        234,        1,   152064, 0x3cbcd1cd
-0,        235,        235,        1,   152064, 0x9f308587
-0,        236,        236,        1,   152064, 0x6b91633f
-0,        237,        237,        1,   152064, 0xb7191012
-0,        238,        238,        1,   152064, 0xd2fd030f
-0,        239,        239,        1,   152064, 0x15a0ae2e
-0,        240,        240,        1,   152064, 0xac3920d0
-0,        241,        241,        1,   152064, 0x0eef80aa
-0,        242,        242,        1,   152064, 0x319008f1
-0,        243,        243,        1,   152064, 0x7734450c
-0,        244,        244,        1,   152064, 0xf112df62
-0,        245,        245,        1,   152064, 0x1dd8ffae
-0,        246,        246,        1,   152064, 0x655ef429
-0,        247,        247,        1,   152064, 0x27026213
-0,        248,        248,        1,   152064, 0x5c14b015
-0,        249,        249,        1,   152064, 0x9512abeb
-0,        250,        250,        1,   152064, 0x961812b2
-0,        251,        251,        1,   152064, 0xb8890aea
-0,        252,        252,        1,   152064, 0x4519db9a
-0,        253,        253,        1,   152064, 0xf358034a
-0,        254,        254,        1,   152064, 0x45d9f2ab
-0,        255,        255,        1,   152064, 0xebd47e7d
-0,        256,        256,        1,   152064, 0x15578be9
-0,        257,        257,        1,   152064, 0x1b373b2d
-0,        258,        258,        1,   152064, 0xbbe707e5
-0,        259,        259,        1,   152064, 0x5bf62385
-0,        260,        260,        1,   152064, 0x832e6ef5
-0,        261,        261,        1,   152064, 0x761e5968
-0,        262,        262,        1,   152064, 0x251f984d
-0,        263,        263,        1,   152064, 0xbda48899
-0,        264,        264,        1,   152064, 0x3fd843b9
-0,        265,        265,        1,   152064, 0x00485425
-0,        266,        266,        1,   152064, 0x4e282b39
-0,        267,        267,        1,   152064, 0x2630a8ea
-0,        268,        268,        1,   152064, 0x5ea5c973
-0,        269,        269,        1,   152064, 0xfc436d21
-0,        270,        270,        1,   152064, 0x69852ef5
-0,        271,        271,        1,   152064, 0x44cb5589
-0,        272,        272,        1,   152064, 0x32f32725
-0,        273,        273,        1,   152064, 0x54d50aca
-0,        274,        274,        1,   152064, 0xe7a639bb
-0,        275,        275,        1,   152064, 0x01be2ad5
-0,        276,        276,        1,   152064, 0x5c63eca4
-0,        277,        277,        1,   152064, 0x94e91116
-0,        278,        278,        1,   152064, 0x9a8be637
-0,        279,        279,        1,   152064, 0x165d9a12
-0,        280,        280,        1,   152064, 0x8c25ca0a
-0,        281,        281,        1,   152064, 0x4ee2ed32
-0,        282,        282,        1,   152064, 0x4b2fe0c6
-0,        283,        283,        1,   152064, 0x521e434e
-0,        284,        284,        1,   152064, 0x97679d7e
-0,        285,        285,        1,   152064, 0x886b9506
-0,        286,        286,        1,   152064, 0x4283eda8
-0,        287,        287,        1,   152064, 0xef793c49
-0,        288,        288,        1,   152064, 0x68ac2afe
-0,        289,        289,        1,   152064, 0x3d1ab510
-0,        290,        290,        1,   152064, 0x98d3ec95
-0,        291,        291,        1,   152064, 0x09f7e512
-0,        292,        292,        1,   152064, 0x801355dd
-0,        293,        293,        1,   152064, 0xf2e87a11
-0,        294,        294,        1,   152064, 0x16757601
-0,        295,        295,        1,   152064, 0x3074d74a
-0,        296,        296,        1,   152064, 0xec8c1290
-0,        297,        297,        1,   152064, 0x46fb1877
-0,        298,        298,        1,   152064, 0xf0b662c4
-0,        299,        299,        1,   152064, 0xf8683940
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcamolq_brcm_b b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcamolq_brcm_b
deleted file mode 100644
index 00f04fd..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcamolq_brcm_b
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xac83f54f
-0,          1,          1,        1,   152064, 0x4d673b43
-0,          2,          2,        1,   152064, 0x9050731f
-0,          3,          3,        1,   152064, 0x4a0741f3
-0,          4,          4,        1,   152064, 0xb2371c28
-0,          5,          5,        1,   152064, 0x42210524
-0,          6,          6,        1,   152064, 0x385f4be5
-0,          7,          7,        1,   152064, 0xe44ec27a
-0,          8,          8,        1,   152064, 0xfc668399
-0,          9,          9,        1,   152064, 0x903fe200
-0,         10,         10,        1,   152064, 0x4da1deaa
-0,         11,         11,        1,   152064, 0x68c956ab
-0,         12,         12,        1,   152064, 0x9cfad799
-0,         13,         13,        1,   152064, 0x841ed3cd
-0,         14,         14,        1,   152064, 0x99e66b48
-0,         15,         15,        1,   152064, 0xcfa28482
-0,         16,         16,        1,   152064, 0x72f2c717
-0,         17,         17,        1,   152064, 0xd1d92c80
-0,         18,         18,        1,   152064, 0x595063eb
-0,         19,         19,        1,   152064, 0x87373979
-0,         20,         20,        1,   152064, 0xfa0e75ac
-0,         21,         21,        1,   152064, 0x0cef3592
-0,         22,         22,        1,   152064, 0xecfc9c9a
-0,         23,         23,        1,   152064, 0x5776ff23
-0,         24,         24,        1,   152064, 0x83419e37
-0,         25,         25,        1,   152064, 0x4bb31524
-0,         26,         26,        1,   152064, 0xad8e1bdc
-0,         27,         27,        1,   152064, 0x7243b6cb
-0,         28,         28,        1,   152064, 0xf016cda0
-0,         29,         29,        1,   152064, 0xa2c1d730
-0,         30,         30,        1,   152064, 0x7999d704
-0,         31,         31,        1,   152064, 0x86ad0baf
-0,         32,         32,        1,   152064, 0x35dafe62
-0,         33,         33,        1,   152064, 0xcb2f5de2
-0,         34,         34,        1,   152064, 0x3542eb82
-0,         35,         35,        1,   152064, 0xa704dd92
-0,         36,         36,        1,   152064, 0x3e50ed92
-0,         37,         37,        1,   152064, 0x2fe5428a
-0,         38,         38,        1,   152064, 0xf05dab9d
-0,         39,         39,        1,   152064, 0xef40c2a3
-0,         40,         40,        1,   152064, 0x2df8983f
-0,         41,         41,        1,   152064, 0x0a205c93
-0,         42,         42,        1,   152064, 0x505562ea
-0,         43,         43,        1,   152064, 0x24114860
-0,         44,         44,        1,   152064, 0x2eecccc1
-0,         45,         45,        1,   152064, 0xc809105f
-0,         46,         46,        1,   152064, 0x394ab285
-0,         47,         47,        1,   152064, 0xfda68f17
-0,         48,         48,        1,   152064, 0x2fd66a51
-0,         49,         49,        1,   152064, 0x3abb891a
-0,         50,         50,        1,   152064, 0x62266682
-0,         51,         51,        1,   152064, 0x68fb38e9
-0,         52,         52,        1,   152064, 0xae4b9d9b
-0,         53,         53,        1,   152064, 0xdaf8e150
-0,         54,         54,        1,   152064, 0x2fd8bf74
-0,         55,         55,        1,   152064, 0xd2ad6c38
-0,         56,         56,        1,   152064, 0x76290574
-0,         57,         57,        1,   152064, 0xaea6b9be
-0,         58,         58,        1,   152064, 0xd0d797d7
-0,         59,         59,        1,   152064, 0x87ad00b2
-0,         60,         60,        1,   152064, 0xe57d11d0
-0,         61,         61,        1,   152064, 0x25a5c567
-0,         62,         62,        1,   152064, 0x477e2202
-0,         63,         63,        1,   152064, 0xaa0618ca
-0,         64,         64,        1,   152064, 0xb5d2262b
-0,         65,         65,        1,   152064, 0xae7c135d
-0,         66,         66,        1,   152064, 0xddb86a7c
-0,         67,         67,        1,   152064, 0x59bad3ba
-0,         68,         68,        1,   152064, 0x0b155178
-0,         69,         69,        1,   152064, 0xc2f265d9
-0,         70,         70,        1,   152064, 0xb550e8a8
-0,         71,         71,        1,   152064, 0x1fef6cbc
-0,         72,         72,        1,   152064, 0xd3d4e578
-0,         73,         73,        1,   152064, 0x70d20c0d
-0,         74,         74,        1,   152064, 0xbb8e95a9
-0,         75,         75,        1,   152064, 0x2a92cda3
-0,         76,         76,        1,   152064, 0xc0a5e7e0
-0,         77,         77,        1,   152064, 0x15b99dab
-0,         78,         78,        1,   152064, 0x536d44e8
-0,         79,         79,        1,   152064, 0xe43fb4fa
-0,         80,         80,        1,   152064, 0xdb0873b0
-0,         81,         81,        1,   152064, 0xc7901e9b
-0,         82,         82,        1,   152064, 0x36b69923
-0,         83,         83,        1,   152064, 0xc6a8ac8d
-0,         84,         84,        1,   152064, 0xd7e4c595
-0,         85,         85,        1,   152064, 0x2d64cf38
-0,         86,         86,        1,   152064, 0x007878b1
-0,         87,         87,        1,   152064, 0xc9c997d4
-0,         88,         88,        1,   152064, 0xf9de12de
-0,         89,         89,        1,   152064, 0x25982d54
-0,         90,         90,        1,   152064, 0xea5eef7c
-0,         91,         91,        1,   152064, 0x108aceb2
-0,         92,         92,        1,   152064, 0x3cbac8c8
-0,         93,         93,        1,   152064, 0x581ec9e1
-0,         94,         94,        1,   152064, 0xc898bd7d
-0,         95,         95,        1,   152064, 0x142a0235
-0,         96,         96,        1,   152064, 0xf9d0aa7e
-0,         97,         97,        1,   152064, 0xb9fe0bc4
-0,         98,         98,        1,   152064, 0x21889912
-0,         99,         99,        1,   152064, 0x3fb2ab18
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcanl_brcm_c b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcanl_brcm_c
deleted file mode 100644
index 23ad267..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcanl_brcm_c
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x2744afa1
-0,          1,          1,        1,   152064, 0x17246583
-0,          2,          2,        1,   152064, 0x501836ed
-0,          3,          3,        1,   152064, 0xe90d6961
-0,          4,          4,        1,   152064, 0x27abe1ad
-0,          5,          5,        1,   152064, 0xcfc730e4
-0,          6,          6,        1,   152064, 0xeaaa83ee
-0,          7,          7,        1,   152064, 0xb5d80ebd
-0,          8,          8,        1,   152064, 0x1e1b9d03
-0,          9,          9,        1,   152064, 0x60e7cf33
-0,         10,         10,        1,   152064, 0xc44616b1
-0,         11,         11,        1,   152064, 0x0a2a5906
-0,         12,         12,        1,   152064, 0xf101309c
-0,         13,         13,        1,   152064, 0x0b57f348
-0,         14,         14,        1,   152064, 0x4f018c05
-0,         15,         15,        1,   152064, 0x22359c60
-0,         16,         16,        1,   152064, 0x020f1cc3
-0,         17,         17,        1,   152064, 0x15be3892
-0,         18,         18,        1,   152064, 0x834a2e23
-0,         19,         19,        1,   152064, 0x1176586c
-0,         20,         20,        1,   152064, 0x9cf25641
-0,         21,         21,        1,   152064, 0xc1c4051d
-0,         22,         22,        1,   152064, 0x790d8bfa
-0,         23,         23,        1,   152064, 0x4dcbe7d7
-0,         24,         24,        1,   152064, 0xe81d3b7b
-0,         25,         25,        1,   152064, 0xe9e21309
-0,         26,         26,        1,   152064, 0x22021dbc
-0,         27,         27,        1,   152064, 0x430c5ecb
-0,         28,         28,        1,   152064, 0xf524be8b
-0,         29,         29,        1,   152064, 0xa437dadc
-0,         30,         30,        1,   152064, 0xff00b440
-0,         31,         31,        1,   152064, 0x4bd1bf15
-0,         32,         32,        1,   152064, 0x1f46a3ea
-0,         33,         33,        1,   152064, 0x60b47c5e
-0,         34,         34,        1,   152064, 0x45117ac6
-0,         35,         35,        1,   152064, 0x43894fca
-0,         36,         36,        1,   152064, 0x21572b55
-0,         37,         37,        1,   152064, 0xe96def09
-0,         38,         38,        1,   152064, 0x4d2ab41f
-0,         39,         39,        1,   152064, 0x072d6b06
-0,         40,         40,        1,   152064, 0x81865687
-0,         41,         41,        1,   152064, 0x8d9a0ea6
-0,         42,         42,        1,   152064, 0x1484d3cd
-0,         43,         43,        1,   152064, 0xbdabae6b
-0,         44,         44,        1,   152064, 0x4211edbe
-0,         45,         45,        1,   152064, 0xd84dad6d
-0,         46,         46,        1,   152064, 0xe4e79344
-0,         47,         47,        1,   152064, 0x9c1addd7
-0,         48,         48,        1,   152064, 0xdcf94283
-0,         49,         49,        1,   152064, 0x6bd005b2
-0,         50,         50,        1,   152064, 0x9679bd10
-0,         51,         51,        1,   152064, 0x052064ab
-0,         52,         52,        1,   152064, 0x915db3f3
-0,         53,         53,        1,   152064, 0xec2fbd58
-0,         54,         54,        1,   152064, 0x26728258
-0,         55,         55,        1,   152064, 0x2b2b617f
-0,         56,         56,        1,   152064, 0x2339eb3d
-0,         57,         57,        1,   152064, 0xcf6e6773
-0,         58,         58,        1,   152064, 0xb993efe4
-0,         59,         59,        1,   152064, 0x4054253d
-0,         60,         60,        1,   152064, 0x4befe5b5
-0,         61,         61,        1,   152064, 0x0678c0fa
-0,         62,         62,        1,   152064, 0xe3c54a03
-0,         63,         63,        1,   152064, 0xffa3210c
-0,         64,         64,        1,   152064, 0xed04b823
-0,         65,         65,        1,   152064, 0x00926457
-0,         66,         66,        1,   152064, 0xd56aaaf0
-0,         67,         67,        1,   152064, 0x6047ef6e
-0,         68,         68,        1,   152064, 0x44316d07
-0,         69,         69,        1,   152064, 0xe8a879b7
-0,         70,         70,        1,   152064, 0x1856cd86
-0,         71,         71,        1,   152064, 0x6528349a
-0,         72,         72,        1,   152064, 0xdeff676e
-0,         73,         73,        1,   152064, 0xda412e47
-0,         74,         74,        1,   152064, 0xa2c2a96f
-0,         75,         75,        1,   152064, 0xc703b8cd
-0,         76,         76,        1,   152064, 0x20b0650b
-0,         77,         77,        1,   152064, 0x8c14faa5
-0,         78,         78,        1,   152064, 0xa442706c
-0,         79,         79,        1,   152064, 0x6e456137
-0,         80,         80,        1,   152064, 0x6dde11c6
-0,         81,         81,        1,   152064, 0xb017978a
-0,         82,         82,        1,   152064, 0xc0bad34b
-0,         83,         83,        1,   152064, 0x8bd439ee
-0,         84,         84,        1,   152064, 0xa92735e4
-0,         85,         85,        1,   152064, 0x1623f501
-0,         86,         86,        1,   152064, 0x5be980b2
-0,         87,         87,        1,   152064, 0x4306b9bf
-0,         88,         88,        1,   152064, 0xb4f18976
-0,         89,         89,        1,   152064, 0x4ffb9b46
-0,         90,         90,        1,   152064, 0x23082275
-0,         91,         91,        1,   152064, 0xc7f0e087
-0,         92,         92,        1,   152064, 0x68b95327
-0,         93,         93,        1,   152064, 0xd030a8e4
-0,         94,         94,        1,   152064, 0xf8f9615c
-0,         95,         95,        1,   152064, 0x1b26fe3e
-0,         96,         96,        1,   152064, 0x3381608d
-0,         97,         97,        1,   152064, 0x9939d49d
-0,         98,         98,        1,   152064, 0x575f4f94
-0,         99,         99,        1,   152064, 0x436c581c
-0,        100,        100,        1,   152064, 0x8f47aa58
-0,        101,        101,        1,   152064, 0xd251d95a
-0,        102,        102,        1,   152064, 0x3c33b32c
-0,        103,        103,        1,   152064, 0xa1e19413
-0,        104,        104,        1,   152064, 0x8d95cbad
-0,        105,        105,        1,   152064, 0x98cbd35e
-0,        106,        106,        1,   152064, 0xceb81a0f
-0,        107,        107,        1,   152064, 0x5490fab1
-0,        108,        108,        1,   152064, 0x8e57a38c
-0,        109,        109,        1,   152064, 0xc379517a
-0,        110,        110,        1,   152064, 0xafc4f747
-0,        111,        111,        1,   152064, 0xbc9c9be4
-0,        112,        112,        1,   152064, 0xd602b2f5
-0,        113,        113,        1,   152064, 0x8d85a450
-0,        114,        114,        1,   152064, 0x48183c74
-0,        115,        115,        1,   152064, 0xd1725590
-0,        116,        116,        1,   152064, 0x5ef42ed7
-0,        117,        117,        1,   152064, 0xad3a3883
-0,        118,        118,        1,   152064, 0x7a3e0ddd
-0,        119,        119,        1,   152064, 0x59bdfd38
-0,        120,        120,        1,   152064, 0x5ac3ba9f
-0,        121,        121,        1,   152064, 0x266cbd00
-0,        122,        122,        1,   152064, 0x97d29e00
-0,        123,        123,        1,   152064, 0x620774c2
-0,        124,        124,        1,   152064, 0xaae8b96f
-0,        125,        125,        1,   152064, 0x5f6bdfb6
-0,        126,        126,        1,   152064, 0xb239da53
-0,        127,        127,        1,   152064, 0x654b5680
-0,        128,        128,        1,   152064, 0xd796b723
-0,        129,        129,        1,   152064, 0xd5c84a81
-0,        130,        130,        1,   152064, 0x2a761652
-0,        131,        131,        1,   152064, 0x1137e145
-0,        132,        132,        1,   152064, 0x1a9a451b
-0,        133,        133,        1,   152064, 0x5ca751c4
-0,        134,        134,        1,   152064, 0x074acec7
-0,        135,        135,        1,   152064, 0x9ddfe77d
-0,        136,        136,        1,   152064, 0xfb211c29
-0,        137,        137,        1,   152064, 0x681ad4dd
-0,        138,        138,        1,   152064, 0x702c12cc
-0,        139,        139,        1,   152064, 0x556c5101
-0,        140,        140,        1,   152064, 0x39d4bb54
-0,        141,        141,        1,   152064, 0xa3a118d6
-0,        142,        142,        1,   152064, 0xb78b7db1
-0,        143,        143,        1,   152064, 0x4e20eed5
-0,        144,        144,        1,   152064, 0x6555a9df
-0,        145,        145,        1,   152064, 0xb607a9a4
-0,        146,        146,        1,   152064, 0x3cf96a94
-0,        147,        147,        1,   152064, 0xb2679007
-0,        148,        148,        1,   152064, 0xf09d5b85
-0,        149,        149,        1,   152064, 0x3961ba07
-0,        150,        150,        1,   152064, 0x0c28363a
-0,        151,        151,        1,   152064, 0x0a017c2d
-0,        152,        152,        1,   152064, 0x3a661de3
-0,        153,        153,        1,   152064, 0xf8d1bdee
-0,        154,        154,        1,   152064, 0x6f47791b
-0,        155,        155,        1,   152064, 0xe05b22c6
-0,        156,        156,        1,   152064, 0x7cc93bb0
-0,        157,        157,        1,   152064, 0xeb90c3d8
-0,        158,        158,        1,   152064, 0x1a1eac98
-0,        159,        159,        1,   152064, 0x92985671
-0,        160,        160,        1,   152064, 0x2fe3ce53
-0,        161,        161,        1,   152064, 0x61def691
-0,        162,        162,        1,   152064, 0x90820730
-0,        163,        163,        1,   152064, 0x17630372
-0,        164,        164,        1,   152064, 0xaf6cea12
-0,        165,        165,        1,   152064, 0xfe3b7ecc
-0,        166,        166,        1,   152064, 0x904a5b2e
-0,        167,        167,        1,   152064, 0x0d88d5f2
-0,        168,        168,        1,   152064, 0x498d22b1
-0,        169,        169,        1,   152064, 0x56baba83
-0,        170,        170,        1,   152064, 0xda4d6dfa
-0,        171,        171,        1,   152064, 0xaa38cbdd
-0,        172,        172,        1,   152064, 0x4077f15d
-0,        173,        173,        1,   152064, 0x7e006ec2
-0,        174,        174,        1,   152064, 0x59964a89
-0,        175,        175,        1,   152064, 0x04c078e3
-0,        176,        176,        1,   152064, 0x7a5faf97
-0,        177,        177,        1,   152064, 0xc517b3e9
-0,        178,        178,        1,   152064, 0xfcc81af5
-0,        179,        179,        1,   152064, 0xdcb44f62
-0,        180,        180,        1,   152064, 0x2a080b72
-0,        181,        181,        1,   152064, 0x91f88c67
-0,        182,        182,        1,   152064, 0xd39caf81
-0,        183,        183,        1,   152064, 0x0764ae31
-0,        184,        184,        1,   152064, 0x0ddb82ed
-0,        185,        185,        1,   152064, 0xed6d17e4
-0,        186,        186,        1,   152064, 0xb4f74712
-0,        187,        187,        1,   152064, 0x23a20787
-0,        188,        188,        1,   152064, 0x853e7b33
-0,        189,        189,        1,   152064, 0xc6bac173
-0,        190,        190,        1,   152064, 0xb590ec15
-0,        191,        191,        1,   152064, 0xfdd2943c
-0,        192,        192,        1,   152064, 0xba5d1160
-0,        193,        193,        1,   152064, 0xe732c5a7
-0,        194,        194,        1,   152064, 0x279f6ce9
-0,        195,        195,        1,   152064, 0xb3835829
-0,        196,        196,        1,   152064, 0x0901b2a1
-0,        197,        197,        1,   152064, 0x3df2b8f8
-0,        198,        198,        1,   152064, 0x374496a4
-0,        199,        199,        1,   152064, 0x1bc6a4ae
-0,        200,        200,        1,   152064, 0xdb4b372e
-0,        201,        201,        1,   152064, 0x8c11c214
-0,        202,        202,        1,   152064, 0xd2d5c093
-0,        203,        203,        1,   152064, 0x8dda094e
-0,        204,        204,        1,   152064, 0x9b2cc401
-0,        205,        205,        1,   152064, 0x1a3b49d5
-0,        206,        206,        1,   152064, 0xaf5342ff
-0,        207,        207,        1,   152064, 0x74c0de83
-0,        208,        208,        1,   152064, 0xcf486137
-0,        209,        209,        1,   152064, 0xcf005b3b
-0,        210,        210,        1,   152064, 0x86a64c55
-0,        211,        211,        1,   152064, 0xdd3f7ae9
-0,        212,        212,        1,   152064, 0xb0d01e53
-0,        213,        213,        1,   152064, 0x83219065
-0,        214,        214,        1,   152064, 0x17a35d27
-0,        215,        215,        1,   152064, 0xf92645b5
-0,        216,        216,        1,   152064, 0x8322bdbf
-0,        217,        217,        1,   152064, 0xd589f6a2
-0,        218,        218,        1,   152064, 0x80a62d9e
-0,        219,        219,        1,   152064, 0x05b3e0d1
-0,        220,        220,        1,   152064, 0xd657aa0b
-0,        221,        221,        1,   152064, 0xec5ac2dd
-0,        222,        222,        1,   152064, 0xbf0ff969
-0,        223,        223,        1,   152064, 0xc34a5140
-0,        224,        224,        1,   152064, 0x814705c4
-0,        225,        225,        1,   152064, 0xe9592008
-0,        226,        226,        1,   152064, 0xf12c933c
-0,        227,        227,        1,   152064, 0x2daee178
-0,        228,        228,        1,   152064, 0xa2573028
-0,        229,        229,        1,   152064, 0x6109f58d
-0,        230,        230,        1,   152064, 0x64ab8ce4
-0,        231,        231,        1,   152064, 0x13a88b6e
-0,        232,        232,        1,   152064, 0x8f0181a9
-0,        233,        233,        1,   152064, 0xd5295fd4
-0,        234,        234,        1,   152064, 0xfdbeeb0d
-0,        235,        235,        1,   152064, 0x05ecd231
-0,        236,        236,        1,   152064, 0x48d164cd
-0,        237,        237,        1,   152064, 0xc279cf63
-0,        238,        238,        1,   152064, 0x1d5e6a03
-0,        239,        239,        1,   152064, 0xd9dc1807
-0,        240,        240,        1,   152064, 0xbcc83676
-0,        241,        241,        1,   152064, 0x65a9811e
-0,        242,        242,        1,   152064, 0x3ccfe5a8
-0,        243,        243,        1,   152064, 0x2f2ff051
-0,        244,        244,        1,   152064, 0x9193e093
-0,        245,        245,        1,   152064, 0x9a30fdc6
-0,        246,        246,        1,   152064, 0x90b7ea10
-0,        247,        247,        1,   152064, 0x3291910c
-0,        248,        248,        1,   152064, 0x2335d186
-0,        249,        249,        1,   152064, 0x2890cf1d
-0,        250,        250,        1,   152064, 0x8c8b6245
-0,        251,        251,        1,   152064, 0x24b84eda
-0,        252,        252,        1,   152064, 0x04a12446
-0,        253,        253,        1,   152064, 0xd9d91d51
-0,        254,        254,        1,   152064, 0xbf450adf
-0,        255,        255,        1,   152064, 0xa19a9a41
-0,        256,        256,        1,   152064, 0x2211ab01
-0,        257,        257,        1,   152064, 0x8fe85430
-0,        258,        258,        1,   152064, 0x5a152861
-0,        259,        259,        1,   152064, 0x7fe76995
-0,        260,        260,        1,   152064, 0x508b99cd
-0,        261,        261,        1,   152064, 0x92e79437
-0,        262,        262,        1,   152064, 0x8572eac9
-0,        263,        263,        1,   152064, 0x42e3d513
-0,        264,        264,        1,   152064, 0x6bee9e38
-0,        265,        265,        1,   152064, 0x2858ad4b
-0,        266,        266,        1,   152064, 0x96d87d00
-0,        267,        267,        1,   152064, 0x749f1032
-0,        268,        268,        1,   152064, 0x668fca6c
-0,        269,        269,        1,   152064, 0x11d278d9
-0,        270,        270,        1,   152064, 0x10fd46ea
-0,        271,        271,        1,   152064, 0xc8b193c8
-0,        272,        272,        1,   152064, 0x035e7d02
-0,        273,        273,        1,   152064, 0x067f583c
-0,        274,        274,        1,   152064, 0xd9648a1e
-0,        275,        275,        1,   152064, 0x92487b7e
-0,        276,        276,        1,   152064, 0xc7b35421
-0,        277,        277,        1,   152064, 0x2ed57c1c
-0,        278,        278,        1,   152064, 0xefe24c5f
-0,        279,        279,        1,   152064, 0x8df0118b
-0,        280,        280,        1,   152064, 0x18f0278d
-0,        281,        281,        1,   152064, 0x63ac45ad
-0,        282,        282,        1,   152064, 0xd79849f0
-0,        283,        283,        1,   152064, 0x1f1d4dab
-0,        284,        284,        1,   152064, 0x736fb5b8
-0,        285,        285,        1,   152064, 0xc24eb80c
-0,        286,        286,        1,   152064, 0x64ca3b11
-0,        287,        287,        1,   152064, 0x35d8674c
-0,        288,        288,        1,   152064, 0x3c5a7b51
-0,        289,        289,        1,   152064, 0x97550b81
-0,        290,        290,        1,   152064, 0x731454b5
-0,        291,        291,        1,   152064, 0x01de43bc
-0,        292,        292,        1,   152064, 0xbda7afae
-0,        293,        293,        1,   152064, 0xeb34d714
-0,        294,        294,        1,   152064, 0x1260cc98
-0,        295,        295,        1,   152064, 0x7e592c36
-0,        296,        296,        1,   152064, 0x40b3676e
-0,        297,        297,        1,   152064, 0x8c9d6b94
-0,        298,        298,        1,   152064, 0xc7988665
-0,        299,        299,        1,   152064, 0xf2994d52
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcaq2lq_brcm_b b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcaq2lq_brcm_b
deleted file mode 100644
index 460f86c..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcaq2lq_brcm_b
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x712a2ad3
-0,          1,          1,        1,   152064, 0x83420c9d
-0,          2,          2,        1,   152064, 0xf3d77f46
-0,          3,          3,        1,   152064, 0x67eab1a2
-0,          4,          4,        1,   152064, 0x41df4534
-0,          5,          5,        1,   152064, 0x68f268ce
-0,          6,          6,        1,   152064, 0x288debdf
-0,          7,          7,        1,   152064, 0x46ae56a7
-0,          8,          8,        1,   152064, 0x1720f327
-0,          9,          9,        1,   152064, 0x64752592
-0,         10,         10,        1,   152064, 0x43e17a27
-0,         11,         11,        1,   152064, 0x39f7cc52
-0,         12,         12,        1,   152064, 0xc19a785c
-0,         13,         13,        1,   152064, 0x562df0d4
-0,         14,         14,        1,   152064, 0x50c96da0
-0,         15,         15,        1,   152064, 0x1da8bdb5
-0,         16,         16,        1,   152064, 0x02ddfb59
-0,         17,         17,        1,   152064, 0x4d0c3e0e
-0,         18,         18,        1,   152064, 0x1605371b
-0,         19,         19,        1,   152064, 0x9772464d
-0,         20,         20,        1,   152064, 0xc603441c
-0,         21,         21,        1,   152064, 0xf9581917
-0,         22,         22,        1,   152064, 0x4dbf74af
-0,         23,         23,        1,   152064, 0x04b8b820
-0,         24,         24,        1,   152064, 0x75061cdf
-0,         25,         25,        1,   152064, 0x760bea90
-0,         26,         26,        1,   152064, 0x7114cab3
-0,         27,         27,        1,   152064, 0x89e14328
-0,         28,         28,        1,   152064, 0x402ba116
-0,         29,         29,        1,   152064, 0x8af2ccc6
-0,         30,         30,        1,   152064, 0x1294333a
-0,         31,         31,        1,   152064, 0xe466aa9f
-0,         32,         32,        1,   152064, 0x7ce28426
-0,         33,         33,        1,   152064, 0x21c16487
-0,         34,         34,        1,   152064, 0xde3d5fc9
-0,         35,         35,        1,   152064, 0x58cb2906
-0,         36,         36,        1,   152064, 0x1df514ec
-0,         37,         37,        1,   152064, 0x7e45bfb6
-0,         38,         38,        1,   152064, 0xcdaaafc0
-0,         39,         39,        1,   152064, 0x70a58eac
-0,         40,         40,        1,   152064, 0xca7263b0
-0,         41,         41,        1,   152064, 0x022621e0
-0,         42,         42,        1,   152064, 0x938901c2
-0,         43,         43,        1,   152064, 0x8c099e47
-0,         44,         44,        1,   152064, 0xebfecda0
-0,         45,         45,        1,   152064, 0x5a3aff71
-0,         46,         46,        1,   152064, 0xb47c6692
-0,         47,         47,        1,   152064, 0xde04b626
-0,         48,         48,        1,   152064, 0xb1c61c94
-0,         49,         49,        1,   152064, 0xbcc7eb35
-0,         50,         50,        1,   152064, 0x801b958d
-0,         51,         51,        1,   152064, 0xf5254f5d
-0,         52,         52,        1,   152064, 0x4336da49
-0,         53,         53,        1,   152064, 0x3139bcaf
-0,         54,         54,        1,   152064, 0xb8359026
-0,         55,         55,        1,   152064, 0xb6d39756
-0,         56,         56,        1,   152064, 0xdf5c1c14
-0,         57,         57,        1,   152064, 0x3f587336
-0,         58,         58,        1,   152064, 0x105eeb74
-0,         59,         59,        1,   152064, 0xffe23c19
-0,         60,         60,        1,   152064, 0xfb1a1c5e
-0,         61,         61,        1,   152064, 0xb8edb942
-0,         62,         62,        1,   152064, 0x7ca92b27
-0,         63,         63,        1,   152064, 0xd2fe1e24
-0,         64,         64,        1,   152064, 0xd6b8939a
-0,         65,         65,        1,   152064, 0xd59743da
-0,         66,         66,        1,   152064, 0x005d9e7a
-0,         67,         67,        1,   152064, 0x4c5cb03e
-0,         68,         68,        1,   152064, 0x4a7c363a
-0,         69,         69,        1,   152064, 0x627c88a8
-0,         70,         70,        1,   152064, 0x3fcd8650
-0,         71,         71,        1,   152064, 0x75b7f0b3
-0,         72,         72,        1,   152064, 0xcbb95a00
-0,         73,         73,        1,   152064, 0xc9871783
-0,         74,         74,        1,   152064, 0xe9c2b471
-0,         75,         75,        1,   152064, 0x513f0eb3
-0,         76,         76,        1,   152064, 0x5a5c4fdc
-0,         77,         77,        1,   152064, 0xdc8cbab6
-0,         78,         78,        1,   152064, 0x86fe75d2
-0,         79,         79,        1,   152064, 0xa6d52ce2
-0,         80,         80,        1,   152064, 0xde74a975
-0,         81,         81,        1,   152064, 0xc1bf3ef2
-0,         82,         82,        1,   152064, 0xa1a1b832
-0,         83,         83,        1,   152064, 0x0b23f718
-0,         84,         84,        1,   152064, 0x842eed85
-0,         85,         85,        1,   152064, 0xda96923b
-0,         86,         86,        1,   152064, 0x7d011f83
-0,         87,         87,        1,   152064, 0x26a25528
-0,         88,         88,        1,   152064, 0x117b7971
-0,         89,         89,        1,   152064, 0x3f17b29d
-0,         90,         90,        1,   152064, 0x428654c0
-0,         91,         91,        1,   152064, 0xc2343316
-0,         92,         92,        1,   152064, 0x284371fe
-0,         93,         93,        1,   152064, 0x388ef972
-0,         94,         94,        1,   152064, 0x5f046560
-0,         95,         95,        1,   152064, 0x6e9ac7e9
-0,         96,         96,        1,   152064, 0x0cd6277c
-0,         97,         97,        1,   152064, 0xfc7ba0b1
-0,         98,         98,        1,   152064, 0x4d840475
-0,         99,         99,        1,   152064, 0xd4cb26a6
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcv_brcm_a b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcv_brcm_a
deleted file mode 100644
index d608d89..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcv_brcm_a
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x995bb4bd
-0,          1,          1,        1,   152064, 0xad287357
-0,          2,          2,        1,   152064, 0x38fa4661
-0,          3,          3,        1,   152064, 0x8aae73cf
-0,          4,          4,        1,   152064, 0x4a13eada
-0,          5,          5,        1,   152064, 0x48b33901
-0,          6,          6,        1,   152064, 0x011487bc
-0,          7,          7,        1,   152064, 0xd4ce1925
-0,          8,          8,        1,   152064, 0x5d679ddd
-0,          9,          9,        1,   152064, 0x276cd5cf
-0,         10,         10,        1,   152064, 0x99c625f0
-0,         11,         11,        1,   152064, 0xb2f756d1
-0,         12,         12,        1,   152064, 0xb19c2978
-0,         13,         13,        1,   152064, 0xdac0ff3c
-0,         14,         14,        1,   152064, 0x3c1c8d63
-0,         15,         15,        1,   152064, 0x818ea0a8
-0,         16,         16,        1,   152064, 0xa7c122a5
-0,         17,         17,        1,   152064, 0x67ad3519
-0,         18,         18,        1,   152064, 0xc81b2a88
-0,         19,         19,        1,   152064, 0x8ae6633e
-0,         20,         20,        1,   152064, 0xed945788
-0,         21,         21,        1,   152064, 0x4c740bcb
-0,         22,         22,        1,   152064, 0xd8408d09
-0,         23,         23,        1,   152064, 0xb710e8b8
-0,         24,         24,        1,   152064, 0xb8c647b9
-0,         25,         25,        1,   152064, 0x802b2e23
-0,         26,         26,        1,   152064, 0x30672529
-0,         27,         27,        1,   152064, 0x328a72b6
-0,         28,         28,        1,   152064, 0xeb6dbe94
-0,         29,         29,        1,   152064, 0x1c19dcc5
-0,         30,         30,        1,   152064, 0xfdc6b998
-0,         31,         31,        1,   152064, 0xf9e2cd80
-0,         32,         32,        1,   152064, 0x025eb15e
-0,         33,         33,        1,   152064, 0xfd998ad8
-0,         34,         34,        1,   152064, 0x8fdf736f
-0,         35,         35,        1,   152064, 0xa5a7554a
-0,         36,         36,        1,   152064, 0xcea63304
-0,         37,         37,        1,   152064, 0xcb28ec28
-0,         38,         38,        1,   152064, 0x92efb591
-0,         39,         39,        1,   152064, 0x0f2376c3
-0,         40,         40,        1,   152064, 0xe9cb5ecf
-0,         41,         41,        1,   152064, 0xcd2d0eba
-0,         42,         42,        1,   152064, 0xd57fe4fd
-0,         43,         43,        1,   152064, 0xc486ab8e
-0,         44,         44,        1,   152064, 0x01a1f709
-0,         45,         45,        1,   152064, 0x7ac5b13a
-0,         46,         46,        1,   152064, 0x6f519279
-0,         47,         47,        1,   152064, 0xfd7cd9a0
-0,         48,         48,        1,   152064, 0xfae649d2
-0,         49,         49,        1,   152064, 0x618507ca
-0,         50,         50,        1,   152064, 0xb177bc15
-0,         51,         51,        1,   152064, 0x6fa36854
-0,         52,         52,        1,   152064, 0xc13cb77d
-0,         53,         53,        1,   152064, 0x6d40cb01
-0,         54,         54,        1,   152064, 0xa3db96a2
-0,         55,         55,        1,   152064, 0xe5ba6c99
-0,         56,         56,        1,   152064, 0xca9ff3ee
-0,         57,         57,        1,   152064, 0x6c016c65
-0,         58,         58,        1,   152064, 0xdf93ed80
-0,         59,         59,        1,   152064, 0x93112ec8
-0,         60,         60,        1,   152064, 0x8ab3ea14
-0,         61,         61,        1,   152064, 0x02f5b891
-0,         62,         62,        1,   152064, 0xdafd562b
-0,         63,         63,        1,   152064, 0xa96a2bd7
-0,         64,         64,        1,   152064, 0xdff8bc68
-0,         65,         65,        1,   152064, 0x8d956b4b
-0,         66,         66,        1,   152064, 0xb4aeb960
-0,         67,         67,        1,   152064, 0x391cf0dd
-0,         68,         68,        1,   152064, 0x03137de9
-0,         69,         69,        1,   152064, 0x2bfa8c4b
-0,         70,         70,        1,   152064, 0xfb54d3a5
-0,         71,         71,        1,   152064, 0x650146e7
-0,         72,         72,        1,   152064, 0xd3a7765f
-0,         73,         73,        1,   152064, 0x49d72b90
-0,         74,         74,        1,   152064, 0xf089b357
-0,         75,         75,        1,   152064, 0x23a2be41
-0,         76,         76,        1,   152064, 0x2ea86592
-0,         77,         77,        1,   152064, 0x99d6f56b
-0,         78,         78,        1,   152064, 0xc2ca75b9
-0,         79,         79,        1,   152064, 0x390b7278
-0,         80,         80,        1,   152064, 0x0f6d1f1e
-0,         81,         81,        1,   152064, 0x79e2a3f4
-0,         82,         82,        1,   152064, 0x51d5e1da
-0,         83,         83,        1,   152064, 0xdb57419a
-0,         84,         84,        1,   152064, 0xf90a4153
-0,         85,         85,        1,   152064, 0xd192f6c6
-0,         86,         86,        1,   152064, 0x8cd3895a
-0,         87,         87,        1,   152064, 0x0d3ec577
-0,         88,         88,        1,   152064, 0x146e8492
-0,         89,         89,        1,   152064, 0xc9939c22
-0,         90,         90,        1,   152064, 0xf1f4275e
-0,         91,         91,        1,   152064, 0xb898eb35
-0,         92,         92,        1,   152064, 0xed315ee9
-0,         93,         93,        1,   152064, 0x9046b760
-0,         94,         94,        1,   152064, 0x599a736b
-0,         95,         95,        1,   152064, 0xaef20726
-0,         96,         96,        1,   152064, 0x0d136768
-0,         97,         97,        1,   152064, 0xfe4ed2a8
-0,         98,         98,        1,   152064, 0x5a85524b
-0,         99,         99,        1,   152064, 0x6d495dd2
-0,        100,        100,        1,   152064, 0x04bdb815
-0,        101,        101,        1,   152064, 0x28aae1c5
-0,        102,        102,        1,   152064, 0xc20bc8d9
-0,        103,        103,        1,   152064, 0xa33d9b41
-0,        104,        104,        1,   152064, 0x6269cb43
-0,        105,        105,        1,   152064, 0x4f81d636
-0,        106,        106,        1,   152064, 0xc6062166
-0,        107,        107,        1,   152064, 0xb027fbcc
-0,        108,        108,        1,   152064, 0x73a7a584
-0,        109,        109,        1,   152064, 0xf67e520a
-0,        110,        110,        1,   152064, 0x94eff023
-0,        111,        111,        1,   152064, 0xef1da8e5
-0,        112,        112,        1,   152064, 0x2d9ab411
-0,        113,        113,        1,   152064, 0xf0c39b5d
-0,        114,        114,        1,   152064, 0xb2374724
-0,        115,        115,        1,   152064, 0x939a5243
-0,        116,        116,        1,   152064, 0xee3438db
-0,        117,        117,        1,   152064, 0x7da04012
-0,        118,        118,        1,   152064, 0xac611668
-0,        119,        119,        1,   152064, 0xdce3062e
-0,        120,        120,        1,   152064, 0xb57cc00e
-0,        121,        121,        1,   152064, 0xaf96b59e
-0,        122,        122,        1,   152064, 0x56789c13
-0,        123,        123,        1,   152064, 0xb1f678b5
-0,        124,        124,        1,   152064, 0xb340b8c4
-0,        125,        125,        1,   152064, 0x86e6e304
-0,        126,        126,        1,   152064, 0xa056e037
-0,        127,        127,        1,   152064, 0x16885d27
-0,        128,        128,        1,   152064, 0x9c5ac065
-0,        129,        129,        1,   152064, 0x563d5335
-0,        130,        130,        1,   152064, 0x3ca71c1e
-0,        131,        131,        1,   152064, 0xad34e16c
-0,        132,        132,        1,   152064, 0x6d074b27
-0,        133,        133,        1,   152064, 0x9b1c4909
-0,        134,        134,        1,   152064, 0xdbced198
-0,        135,        135,        1,   152064, 0x8a0ded00
-0,        136,        136,        1,   152064, 0x5ffc209b
-0,        137,        137,        1,   152064, 0x47cfd269
-0,        138,        138,        1,   152064, 0xe3c0137e
-0,        139,        139,        1,   152064, 0xcb6a5e53
-0,        140,        140,        1,   152064, 0x87cec05f
-0,        141,        141,        1,   152064, 0x92721dd2
-0,        142,        142,        1,   152064, 0x3f7d7b3b
-0,        143,        143,        1,   152064, 0xd63ef417
-0,        144,        144,        1,   152064, 0xf8e4b05a
-0,        145,        145,        1,   152064, 0xb5dcb421
-0,        146,        146,        1,   152064, 0x53c96f6a
-0,        147,        147,        1,   152064, 0x24ae98a3
-0,        148,        148,        1,   152064, 0x2e9b5fff
-0,        149,        149,        1,   152064, 0x7795bf12
-0,        150,        150,        1,   152064, 0x499d37ca
-0,        151,        151,        1,   152064, 0xfe478487
-0,        152,        152,        1,   152064, 0xcd661afb
-0,        153,        153,        1,   152064, 0x44f8bf00
-0,        154,        154,        1,   152064, 0x90b67809
-0,        155,        155,        1,   152064, 0x8f5726d1
-0,        156,        156,        1,   152064, 0x2e3c39d5
-0,        157,        157,        1,   152064, 0x4b67c4e6
-0,        158,        158,        1,   152064, 0x9fecb7cf
-0,        159,        159,        1,   152064, 0x207766ea
-0,        160,        160,        1,   152064, 0x5846bf7b
-0,        161,        161,        1,   152064, 0x4237fba1
-0,        162,        162,        1,   152064, 0x983e0cbd
-0,        163,        163,        1,   152064, 0x6be100d1
-0,        164,        164,        1,   152064, 0x9d0beb8f
-0,        165,        165,        1,   152064, 0x234b82e7
-0,        166,        166,        1,   152064, 0x83fb5ef1
-0,        167,        167,        1,   152064, 0xf503dcb2
-0,        168,        168,        1,   152064, 0x031a27f2
-0,        169,        169,        1,   152064, 0x2f1abf24
-0,        170,        170,        1,   152064, 0x54d77010
-0,        171,        171,        1,   152064, 0x049fc0fc
-0,        172,        172,        1,   152064, 0x20f2f7e7
-0,        173,        173,        1,   152064, 0xc0d57467
-0,        174,        174,        1,   152064, 0xbe464eef
-0,        175,        175,        1,   152064, 0x035c9052
-0,        176,        176,        1,   152064, 0x91cba4fb
-0,        177,        177,        1,   152064, 0x11cdbbfb
-0,        178,        178,        1,   152064, 0xe61116d5
-0,        179,        179,        1,   152064, 0x16db46b8
-0,        180,        180,        1,   152064, 0x54f30d9f
-0,        181,        181,        1,   152064, 0x211a8d2d
-0,        182,        182,        1,   152064, 0x5a74a56b
-0,        183,        183,        1,   152064, 0x0ff4ba72
-0,        184,        184,        1,   152064, 0x4c398ad6
-0,        185,        185,        1,   152064, 0x830814f0
-0,        186,        186,        1,   152064, 0xa51f4bab
-0,        187,        187,        1,   152064, 0xf3460de6
-0,        188,        188,        1,   152064, 0x7e1979a1
-0,        189,        189,        1,   152064, 0x4b3ebb3a
-0,        190,        190,        1,   152064, 0x83d1f4f8
-0,        191,        191,        1,   152064, 0xfbf08683
-0,        192,        192,        1,   152064, 0x901c07ec
-0,        193,        193,        1,   152064, 0xbc2dc1c7
-0,        194,        194,        1,   152064, 0x6e646b3b
-0,        195,        195,        1,   152064, 0x51a25aab
-0,        196,        196,        1,   152064, 0xa042ab78
-0,        197,        197,        1,   152064, 0xb972af58
-0,        198,        198,        1,   152064, 0xcdca9568
-0,        199,        199,        1,   152064, 0x17b69d1c
-0,        200,        200,        1,   152064, 0x41c43ea2
-0,        201,        201,        1,   152064, 0x195fc7a0
-0,        202,        202,        1,   152064, 0xf4cec580
-0,        203,        203,        1,   152064, 0xb3b10936
-0,        204,        204,        1,   152064, 0x102bc2ec
-0,        205,        205,        1,   152064, 0xc99d4767
-0,        206,        206,        1,   152064, 0x60c745b0
-0,        207,        207,        1,   152064, 0x8176e0cf
-0,        208,        208,        1,   152064, 0xd47e69b5
-0,        209,        209,        1,   152064, 0xacce674c
-0,        210,        210,        1,   152064, 0x031b51f8
-0,        211,        211,        1,   152064, 0x0eb681ef
-0,        212,        212,        1,   152064, 0x0b69334b
-0,        213,        213,        1,   152064, 0xda819c1f
-0,        214,        214,        1,   152064, 0xa93f62d2
-0,        215,        215,        1,   152064, 0x51374db5
-0,        216,        216,        1,   152064, 0x885dccff
-0,        217,        217,        1,   152064, 0xd0780444
-0,        218,        218,        1,   152064, 0xa31733ca
-0,        219,        219,        1,   152064, 0x3f3de84e
-0,        220,        220,        1,   152064, 0x2af2b2c3
-0,        221,        221,        1,   152064, 0xa62dceae
-0,        222,        222,        1,   152064, 0xca1cffd1
-0,        223,        223,        1,   152064, 0x3c7d561b
-0,        224,        224,        1,   152064, 0xbc04130a
-0,        225,        225,        1,   152064, 0xbd2829ae
-0,        226,        226,        1,   152064, 0xdbbb9820
-0,        227,        227,        1,   152064, 0xfc3ef628
-0,        228,        228,        1,   152064, 0xd5da3ec3
-0,        229,        229,        1,   152064, 0x62d5fcc1
-0,        230,        230,        1,   152064, 0x455a8dae
-0,        231,        231,        1,   152064, 0x421c9147
-0,        232,        232,        1,   152064, 0x6a168484
-0,        233,        233,        1,   152064, 0x7ba15d32
-0,        234,        234,        1,   152064, 0xd089ed27
-0,        235,        235,        1,   152064, 0x8fc4d894
-0,        236,        236,        1,   152064, 0x99e47125
-0,        237,        237,        1,   152064, 0xf55dda68
-0,        238,        238,        1,   152064, 0x6bf06cf1
-0,        239,        239,        1,   152064, 0x7dc41a9d
-0,        240,        240,        1,   152064, 0x78b84019
-0,        241,        241,        1,   152064, 0x85ae8973
-0,        242,        242,        1,   152064, 0x7b7aeabe
-0,        243,        243,        1,   152064, 0xf9a8f6bf
-0,        244,        244,        1,   152064, 0xe195ddcd
-0,        245,        245,        1,   152064, 0x83edffe9
-0,        246,        246,        1,   152064, 0x59cce97a
-0,        247,        247,        1,   152064, 0x15268af1
-0,        248,        248,        1,   152064, 0x270cca95
-0,        249,        249,        1,   152064, 0x8bced1f9
-0,        250,        250,        1,   152064, 0x08ee5cec
-0,        251,        251,        1,   152064, 0x01e74f95
-0,        252,        252,        1,   152064, 0x7e19238f
-0,        253,        253,        1,   152064, 0x6bcb2b9d
-0,        254,        254,        1,   152064, 0x58111385
-0,        255,        255,        1,   152064, 0x6c7aa1f7
-0,        256,        256,        1,   152064, 0xb713a822
-0,        257,        257,        1,   152064, 0x1d645cee
-0,        258,        258,        1,   152064, 0x9c592969
-0,        259,        259,        1,   152064, 0x2472769e
-0,        260,        260,        1,   152064, 0x71b7a5ad
-0,        261,        261,        1,   152064, 0xc6bba1c6
-0,        262,        262,        1,   152064, 0x7351f305
-0,        263,        263,        1,   152064, 0x579edbba
-0,        264,        264,        1,   152064, 0x90eda919
-0,        265,        265,        1,   152064, 0x2833b10d
-0,        266,        266,        1,   152064, 0x4b967d65
-0,        267,        267,        1,   152064, 0x6e7d1702
-0,        268,        268,        1,   152064, 0x59dbcf5b
-0,        269,        269,        1,   152064, 0xa138847b
-0,        270,        270,        1,   152064, 0xb2414e8d
-0,        271,        271,        1,   152064, 0xb90497f6
-0,        272,        272,        1,   152064, 0xcd728159
-0,        273,        273,        1,   152064, 0x005d5bdd
-0,        274,        274,        1,   152064, 0x27c88fb6
-0,        275,        275,        1,   152064, 0x3ccb8a93
-0,        276,        276,        1,   152064, 0xc50256dd
-0,        277,        277,        1,   152064, 0x111e7dee
-0,        278,        278,        1,   152064, 0x259d4a5d
-0,        279,        279,        1,   152064, 0x9385148b
-0,        280,        280,        1,   152064, 0x74002ab0
-0,        281,        281,        1,   152064, 0xd2c74adc
-0,        282,        282,        1,   152064, 0x72854b2a
-0,        283,        283,        1,   152064, 0x638e5c08
-0,        284,        284,        1,   152064, 0x9626bbb3
-0,        285,        285,        1,   152064, 0xc107c18f
-0,        286,        286,        1,   152064, 0x8bd04578
-0,        287,        287,        1,   152064, 0xbcdb6db6
-0,        288,        288,        1,   152064, 0x9d0c81be
-0,        289,        289,        1,   152064, 0xf25106b6
-0,        290,        290,        1,   152064, 0x54c25254
-0,        291,        291,        1,   152064, 0x4bf74663
-0,        292,        292,        1,   152064, 0x0051b054
-0,        293,        293,        1,   152064, 0x5193d3d4
-0,        294,        294,        1,   152064, 0xb5d0d045
-0,        295,        295,        1,   152064, 0x350a31ca
-0,        296,        296,        1,   152064, 0xb8fb7264
-0,        297,        297,        1,   152064, 0x7fb97645
-0,        298,        298,        1,   152064, 0xcd948c41
-0,        299,        299,        1,   152064, 0x38c7570a
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvfl_bcrm_a b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvfl_bcrm_a
deleted file mode 100644
index dbfec43..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvfl_bcrm_a
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x502ec077
-0,          1,          1,        1,   152064, 0x84807243
-0,          2,          2,        1,   152064, 0xd7474a6e
-0,          3,          3,        1,   152064, 0x793469bb
-0,          4,          4,        1,   152064, 0xb7a0faf7
-0,          5,          5,        1,   152064, 0x1d3d3cba
-0,          6,          6,        1,   152064, 0xb62583de
-0,          7,          7,        1,   152064, 0xc8422fb1
-0,          8,          8,        1,   152064, 0x321dc699
-0,          9,          9,        1,   152064, 0x7a34d350
-0,         10,         10,        1,   152064, 0xaa4c302d
-0,         11,         11,        1,   152064, 0x45fa7ab0
-0,         12,         12,        1,   152064, 0xc7262e41
-0,         13,         13,        1,   152064, 0x3550000c
-0,         14,         14,        1,   152064, 0xf4bab54b
-0,         15,         15,        1,   152064, 0xaccf9c1a
-0,         16,         16,        1,   152064, 0x9bee20e9
-0,         17,         17,        1,   152064, 0x47fb7720
-0,         18,         18,        1,   152064, 0x12c63ffb
-0,         19,         19,        1,   152064, 0xfa2b8b4d
-0,         20,         20,        1,   152064, 0x279964bd
-0,         21,         21,        1,   152064, 0xb8b01c7e
-0,         22,         22,        1,   152064, 0x816fa010
-0,         23,         23,        1,   152064, 0x59fe1c8c
-0,         24,         24,        1,   152064, 0x13393fad
-0,         25,         25,        1,   152064, 0x991a50a4
-0,         26,         26,        1,   152064, 0x57df3eb7
-0,         27,         27,        1,   152064, 0x744371df
-0,         28,         28,        1,   152064, 0xe9f6d3ff
-0,         29,         29,        1,   152064, 0xc506fba0
-0,         30,         30,        1,   152064, 0x6295b90e
-0,         31,         31,        1,   152064, 0xa19cee2d
-0,         32,         32,        1,   152064, 0xf8c1b3ca
-0,         33,         33,        1,   152064, 0x69f68ce0
-0,         34,         34,        1,   152064, 0x80558bb6
-0,         35,         35,        1,   152064, 0x27824fa5
-0,         36,         36,        1,   152064, 0x27c929a1
-0,         37,         37,        1,   152064, 0xc0fe06d1
-0,         38,         38,        1,   152064, 0xc52bc58c
-0,         39,         39,        1,   152064, 0x0a5363c7
-0,         40,         40,        1,   152064, 0xd0f45a0d
-0,         41,         41,        1,   152064, 0x274710f9
-0,         42,         42,        1,   152064, 0x89d2d390
-0,         43,         43,        1,   152064, 0x12a9bfb0
-0,         44,         44,        1,   152064, 0x04501a93
-0,         45,         45,        1,   152064, 0xf92cbbf4
-0,         46,         46,        1,   152064, 0xf6d1b27d
-0,         47,         47,        1,   152064, 0xe3e904c3
-0,         48,         48,        1,   152064, 0x58f8516d
-0,         49,         49,        1,   152064, 0x70370c2b
-0,         50,         50,        1,   152064, 0xfeebc88c
-0,         51,         51,        1,   152064, 0x974c6ed6
-0,         52,         52,        1,   152064, 0x401bdcf2
-0,         53,         53,        1,   152064, 0xfe61e278
-0,         54,         54,        1,   152064, 0x96ba8bb9
-0,         55,         55,        1,   152064, 0x988492fd
-0,         56,         56,        1,   152064, 0xd1d913a9
-0,         57,         57,        1,   152064, 0x6bc46f0e
-0,         58,         58,        1,   152064, 0x695ef706
-0,         59,         59,        1,   152064, 0x142045c9
-0,         60,         60,        1,   152064, 0xb390ed87
-0,         61,         61,        1,   152064, 0xb9e6d2e5
-0,         62,         62,        1,   152064, 0xe348797f
-0,         63,         63,        1,   152064, 0x1cbd29d6
-0,         64,         64,        1,   152064, 0xbd7dd694
-0,         65,         65,        1,   152064, 0x516873c3
-0,         66,         66,        1,   152064, 0x27bba182
-0,         67,         67,        1,   152064, 0x7541f920
-0,         68,         68,        1,   152064, 0xfdf67042
-0,         69,         69,        1,   152064, 0x6c3c7896
-0,         70,         70,        1,   152064, 0xed86c467
-0,         71,         71,        1,   152064, 0x4ea83ca2
-0,         72,         72,        1,   152064, 0xa3e6725b
-0,         73,         73,        1,   152064, 0x917f5f16
-0,         74,         74,        1,   152064, 0x8cf2d2e1
-0,         75,         75,        1,   152064, 0x57a8d116
-0,         76,         76,        1,   152064, 0x0db267d4
-0,         77,         77,        1,   152064, 0xce782ac5
-0,         78,         78,        1,   152064, 0x1c9d8518
-0,         79,         79,        1,   152064, 0x47598ac7
-0,         80,         80,        1,   152064, 0xc5033d97
-0,         81,         81,        1,   152064, 0xd7aaa3a4
-0,         82,         82,        1,   152064, 0x078afc96
-0,         83,         83,        1,   152064, 0xc9fe673d
-0,         84,         84,        1,   152064, 0xe9284066
-0,         85,         85,        1,   152064, 0xbc570982
-0,         86,         86,        1,   152064, 0x0aac8574
-0,         87,         87,        1,   152064, 0x098cbeee
-0,         88,         88,        1,   152064, 0x19c36a9d
-0,         89,         89,        1,   152064, 0x8fe4a893
-0,         90,         90,        1,   152064, 0x0b652f17
-0,         91,         91,        1,   152064, 0x10f2e6bf
-0,         92,         92,        1,   152064, 0x7ce5634e
-0,         93,         93,        1,   152064, 0x8fe4ac6c
-0,         94,         94,        1,   152064, 0xcaba749e
-0,         95,         95,        1,   152064, 0x5f8a0d5c
-0,         96,         96,        1,   152064, 0xcaa66bbc
-0,         97,         97,        1,   152064, 0xc87ae617
-0,         98,         98,        1,   152064, 0xe8ef4dd7
-0,         99,         99,        1,   152064, 0xdfca5a07
-0,        100,        100,        1,   152064, 0x5f7eab7d
-0,        101,        101,        1,   152064, 0x8a65ebbb
-0,        102,        102,        1,   152064, 0x4beab4a0
-0,        103,        103,        1,   152064, 0xb5e6ab30
-0,        104,        104,        1,   152064, 0x8fe4f4d4
-0,        105,        105,        1,   152064, 0x95bde1ca
-0,        106,        106,        1,   152064, 0xcc5e3a53
-0,        107,        107,        1,   152064, 0xf09f1dd7
-0,        108,        108,        1,   152064, 0x10179672
-0,        109,        109,        1,   152064, 0x4ad16184
-0,        110,        110,        1,   152064, 0x9efa0e23
-0,        111,        111,        1,   152064, 0x22f59522
-0,        112,        112,        1,   152064, 0x4d38f09d
-0,        113,        113,        1,   152064, 0x4c5ebf56
-0,        114,        114,        1,   152064, 0xb19d5077
-0,        115,        115,        1,   152064, 0xa98576b9
-0,        116,        116,        1,   152064, 0x65324239
-0,        117,        117,        1,   152064, 0x709e4031
-0,        118,        118,        1,   152064, 0xf8e81681
-0,        119,        119,        1,   152064, 0x058514e5
-0,        120,        120,        1,   152064, 0xd1d1c806
-0,        121,        121,        1,   152064, 0x0e4dde57
-0,        122,        122,        1,   152064, 0x49e9c2bb
-0,        123,        123,        1,   152064, 0x01417ce6
-0,        124,        124,        1,   152064, 0xda7ebbf1
-0,        125,        125,        1,   152064, 0xa22906b7
-0,        126,        126,        1,   152064, 0x32e2df87
-0,        127,        127,        1,   152064, 0x69917c8f
-0,        128,        128,        1,   152064, 0xea8ed2cc
-0,        129,        129,        1,   152064, 0x0b8d57f1
-0,        130,        130,        1,   152064, 0x5f683bcd
-0,        131,        131,        1,   152064, 0x5162fe2f
-0,        132,        132,        1,   152064, 0x49c052f8
-0,        133,        133,        1,   152064, 0x990b69ba
-0,        134,        134,        1,   152064, 0xa6d4f99f
-0,        135,        135,        1,   152064, 0xe79ef4da
-0,        136,        136,        1,   152064, 0x5e8a3847
-0,        137,        137,        1,   152064, 0x38b1e75f
-0,        138,        138,        1,   152064, 0xf5c91bed
-0,        139,        139,        1,   152064, 0xd59a6d26
-0,        140,        140,        1,   152064, 0xc361de06
-0,        141,        141,        1,   152064, 0x63ed2229
-0,        142,        142,        1,   152064, 0xb8229205
-0,        143,        143,        1,   152064, 0x7c6619af
-0,        144,        144,        1,   152064, 0x4126b02f
-0,        145,        145,        1,   152064, 0x9250b99b
-0,        146,        146,        1,   152064, 0x589778f9
-0,        147,        147,        1,   152064, 0xed1fa45b
-0,        148,        148,        1,   152064, 0x700b6f32
-0,        149,        149,        1,   152064, 0x0590df55
-0,        150,        150,        1,   152064, 0x3e9c4018
-0,        151,        151,        1,   152064, 0x957b8860
-0,        152,        152,        1,   152064, 0x56161560
-0,        153,        153,        1,   152064, 0xbc43bc3b
-0,        154,        154,        1,   152064, 0x508d8632
-0,        155,        155,        1,   152064, 0xbc5736d8
-0,        156,        156,        1,   152064, 0xed7d3aef
-0,        157,        157,        1,   152064, 0x1dcdda9f
-0,        158,        158,        1,   152064, 0x8ef6d5c9
-0,        159,        159,        1,   152064, 0x15466acc
-0,        160,        160,        1,   152064, 0x45d4cf67
-0,        161,        161,        1,   152064, 0x8c900b9d
-0,        162,        162,        1,   152064, 0x747006e0
-0,        163,        163,        1,   152064, 0xac920a0c
-0,        164,        164,        1,   152064, 0xb8210c27
-0,        165,        165,        1,   152064, 0x7dbb873a
-0,        166,        166,        1,   152064, 0x0d4d7584
-0,        167,        167,        1,   152064, 0xefb3fe60
-0,        168,        168,        1,   152064, 0x905e2644
-0,        169,        169,        1,   152064, 0x7c04e534
-0,        170,        170,        1,   152064, 0x8889972a
-0,        171,        171,        1,   152064, 0x21c7d8ad
-0,        172,        172,        1,   152064, 0x1c641176
-0,        173,        173,        1,   152064, 0xf71489a4
-0,        174,        174,        1,   152064, 0xd7ac5555
-0,        175,        175,        1,   152064, 0xb4609c6d
-0,        176,        176,        1,   152064, 0xf5b2bd5e
-0,        177,        177,        1,   152064, 0x9f43ce57
-0,        178,        178,        1,   152064, 0x77642dd3
-0,        179,        179,        1,   152064, 0x3e79565c
-0,        180,        180,        1,   152064, 0x95f40b8e
-0,        181,        181,        1,   152064, 0x3c8ca4d4
-0,        182,        182,        1,   152064, 0xa02ac497
-0,        183,        183,        1,   152064, 0x4c93b377
-0,        184,        184,        1,   152064, 0x55f5ac68
-0,        185,        185,        1,   152064, 0xf8652eca
-0,        186,        186,        1,   152064, 0x56e94574
-0,        187,        187,        1,   152064, 0x6d8302e1
-0,        188,        188,        1,   152064, 0x29a57061
-0,        189,        189,        1,   152064, 0x24e4cfdc
-0,        190,        190,        1,   152064, 0xf5a5d62a
-0,        191,        191,        1,   152064, 0x998870c1
-0,        192,        192,        1,   152064, 0xa15b1f4e
-0,        193,        193,        1,   152064, 0xb0ccb51f
-0,        194,        194,        1,   152064, 0xeaaf59ab
-0,        195,        195,        1,   152064, 0x7e2b4fe6
-0,        196,        196,        1,   152064, 0x72299fea
-0,        197,        197,        1,   152064, 0x769da8b2
-0,        198,        198,        1,   152064, 0xefad7ef8
-0,        199,        199,        1,   152064, 0x24819983
-0,        200,        200,        1,   152064, 0x2aad32ab
-0,        201,        201,        1,   152064, 0xc80cac79
-0,        202,        202,        1,   152064, 0x1659d628
-0,        203,        203,        1,   152064, 0xef941f66
-0,        204,        204,        1,   152064, 0x0d7fcdb5
-0,        205,        205,        1,   152064, 0x7c1853fa
-0,        206,        206,        1,   152064, 0xb94c4d3c
-0,        207,        207,        1,   152064, 0xc47adfc2
-0,        208,        208,        1,   152064, 0x366a6729
-0,        209,        209,        1,   152064, 0x7eb37b70
-0,        210,        210,        1,   152064, 0xafd54c27
-0,        211,        211,        1,   152064, 0x67b18636
-0,        212,        212,        1,   152064, 0x93b22dcf
-0,        213,        213,        1,   152064, 0xa64991f1
-0,        214,        214,        1,   152064, 0xd32a7102
-0,        215,        215,        1,   152064, 0xff665d1c
-0,        216,        216,        1,   152064, 0xf107cc31
-0,        217,        217,        1,   152064, 0xf5b25652
-0,        218,        218,        1,   152064, 0x8caf783d
-0,        219,        219,        1,   152064, 0x72f3eb00
-0,        220,        220,        1,   152064, 0xb5aea5f8
-0,        221,        221,        1,   152064, 0xee70e870
-0,        222,        222,        1,   152064, 0x7c3a0156
-0,        223,        223,        1,   152064, 0x871b6383
-0,        224,        224,        1,   152064, 0x48d831ff
-0,        225,        225,        1,   152064, 0xca233913
-0,        226,        226,        1,   152064, 0xe14bc5eb
-0,        227,        227,        1,   152064, 0x9b1d27e7
-0,        228,        228,        1,   152064, 0xfb9637f7
-0,        229,        229,        1,   152064, 0x0c022157
-0,        230,        230,        1,   152064, 0x16d35fc9
-0,        231,        231,        1,   152064, 0x6d935f71
-0,        232,        232,        1,   152064, 0xae4066fa
-0,        233,        233,        1,   152064, 0xcef94fdc
-0,        234,        234,        1,   152064, 0xc234edb9
-0,        235,        235,        1,   152064, 0x26a4f2e2
-0,        236,        236,        1,   152064, 0xd29ac23e
-0,        237,        237,        1,   152064, 0xb7604395
-0,        238,        238,        1,   152064, 0x408084f6
-0,        239,        239,        1,   152064, 0x0a02026c
-0,        240,        240,        1,   152064, 0x78b33c7c
-0,        241,        241,        1,   152064, 0xcb02b874
-0,        242,        242,        1,   152064, 0xf566513b
-0,        243,        243,        1,   152064, 0xb34e52b1
-0,        244,        244,        1,   152064, 0xf55ff493
-0,        245,        245,        1,   152064, 0xb0e8282a
-0,        246,        246,        1,   152064, 0xe9510bbe
-0,        247,        247,        1,   152064, 0x292e8c5a
-0,        248,        248,        1,   152064, 0x62b9d2b0
-0,        249,        249,        1,   152064, 0x3a8cc827
-0,        250,        250,        1,   152064, 0x25cc465e
-0,        251,        251,        1,   152064, 0xf2bc32e2
-0,        252,        252,        1,   152064, 0x6141f914
-0,        253,        253,        1,   152064, 0x1171256f
-0,        254,        254,        1,   152064, 0x13cb2ded
-0,        255,        255,        1,   152064, 0x3d4ca557
-0,        256,        256,        1,   152064, 0xf2b9e72e
-0,        257,        257,        1,   152064, 0x03f7547a
-0,        258,        258,        1,   152064, 0xc7302955
-0,        259,        259,        1,   152064, 0xe78a46d3
-0,        260,        260,        1,   152064, 0x3726a270
-0,        261,        261,        1,   152064, 0x2f65722a
-0,        262,        262,        1,   152064, 0x55acce40
-0,        263,        263,        1,   152064, 0xf6fa9db2
-0,        264,        264,        1,   152064, 0x70a36937
-0,        265,        265,        1,   152064, 0x9313742d
-0,        266,        266,        1,   152064, 0x2eb14e53
-0,        267,        267,        1,   152064, 0x3d47c9c3
-0,        268,        268,        1,   152064, 0xd0a90348
-0,        269,        269,        1,   152064, 0x6ad48088
-0,        270,        270,        1,   152064, 0x68e64738
-0,        271,        271,        1,   152064, 0x04c3735a
-0,        272,        272,        1,   152064, 0x51d0593f
-0,        273,        273,        1,   152064, 0x42cf2b48
-0,        274,        274,        1,   152064, 0xa5496a0c
-0,        275,        275,        1,   152064, 0x84c25549
-0,        276,        276,        1,   152064, 0x96691600
-0,        277,        277,        1,   152064, 0x423135db
-0,        278,        278,        1,   152064, 0x8d2e08b6
-0,        279,        279,        1,   152064, 0xaeb4c840
-0,        280,        280,        1,   152064, 0xf3e71780
-0,        281,        281,        1,   152064, 0x8858228b
-0,        282,        282,        1,   152064, 0xf28613f8
-0,        283,        283,        1,   152064, 0xb5327882
-0,        284,        284,        1,   152064, 0xbb60bb85
-0,        285,        285,        1,   152064, 0x345ab1c9
-0,        286,        286,        1,   152064, 0x8aac2cba
-0,        287,        287,        1,   152064, 0x7ce15b4c
-0,        288,        288,        1,   152064, 0xc09c55c0
-0,        289,        289,        1,   152064, 0x8482ddd6
-0,        290,        290,        1,   152064, 0xab222a13
-0,        291,        291,        1,   152064, 0xd39b0dea
-0,        292,        292,        1,   152064, 0x6dab6e06
-0,        293,        293,        1,   152064, 0xec0891bd
-0,        294,        294,        1,   152064, 0x88bd9701
-0,        295,        295,        1,   152064, 0xdf13072a
-0,        296,        296,        1,   152064, 0x23b33081
-0,        297,        297,        1,   152064, 0x63943137
-0,        298,        298,        1,   152064, 0xab6a9052
-0,        299,        299,        1,   152064, 0x05485494
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvflnl_bcrm_a b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvflnl_bcrm_a
deleted file mode 100644
index 65a366e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvflnl_bcrm_a
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x3e39c08b
-0,          1,          1,        1,   152064, 0xabc67990
-0,          2,          2,        1,   152064, 0x19614e74
-0,          3,          3,        1,   152064, 0xa3776beb
-0,          4,          4,        1,   152064, 0xcce6ffdf
-0,          5,          5,        1,   152064, 0xb0e94746
-0,          6,          6,        1,   152064, 0xdb1a84ef
-0,          7,          7,        1,   152064, 0xb2624509
-0,          8,          8,        1,   152064, 0x32e2d826
-0,          9,          9,        1,   152064, 0xb3bddf0b
-0,         10,         10,        1,   152064, 0x2e273ce3
-0,         11,         11,        1,   152064, 0x67af7e4d
-0,         12,         12,        1,   152064, 0x505c3261
-0,         13,         13,        1,   152064, 0xa43d015e
-0,         14,         14,        1,   152064, 0xad41c1f6
-0,         15,         15,        1,   152064, 0x633ba55f
-0,         16,         16,        1,   152064, 0xe80634f0
-0,         17,         17,        1,   152064, 0x80a07dc9
-0,         18,         18,        1,   152064, 0x0e7a3bbf
-0,         19,         19,        1,   152064, 0xcb099196
-0,         20,         20,        1,   152064, 0x57c96db5
-0,         21,         21,        1,   152064, 0xccd422fa
-0,         22,         22,        1,   152064, 0x0850b7a7
-0,         23,         23,        1,   152064, 0x30e33156
-0,         24,         24,        1,   152064, 0x34e13f9a
-0,         25,         25,        1,   152064, 0x03d36000
-0,         26,         26,        1,   152064, 0xbf7d49da
-0,         27,         27,        1,   152064, 0x77336d09
-0,         28,         28,        1,   152064, 0xca8be5a9
-0,         29,         29,        1,   152064, 0xe57c0b08
-0,         30,         30,        1,   152064, 0xbe77c093
-0,         31,         31,        1,   152064, 0x6bf1ff05
-0,         32,         32,        1,   152064, 0x9142babf
-0,         33,         33,        1,   152064, 0x08db8e67
-0,         34,         34,        1,   152064, 0x69ac8cb6
-0,         35,         35,        1,   152064, 0xaa3b5c88
-0,         36,         36,        1,   152064, 0x9bd32638
-0,         37,         37,        1,   152064, 0x7972115a
-0,         38,         38,        1,   152064, 0x5c1dd47b
-0,         39,         39,        1,   152064, 0x8a196e02
-0,         40,         40,        1,   152064, 0xa89672bc
-0,         41,         41,        1,   152064, 0x27b220e4
-0,         42,         42,        1,   152064, 0xfa38dc4a
-0,         43,         43,        1,   152064, 0x4784c639
-0,         44,         44,        1,   152064, 0xa5e4229a
-0,         45,         45,        1,   152064, 0xa986bdfc
-0,         46,         46,        1,   152064, 0x2951b47b
-0,         47,         47,        1,   152064, 0x4df404a6
-0,         48,         48,        1,   152064, 0xc75155e8
-0,         49,         49,        1,   152064, 0xfc05248c
-0,         50,         50,        1,   152064, 0x5d53da10
-0,         51,         51,        1,   152064, 0x284376ec
-0,         52,         52,        1,   152064, 0x19fce380
-0,         53,         53,        1,   152064, 0x876be6c9
-0,         54,         54,        1,   152064, 0x39eb8ff9
-0,         55,         55,        1,   152064, 0x289c9543
-0,         56,         56,        1,   152064, 0x24dd2356
-0,         57,         57,        1,   152064, 0x1dc17d3c
-0,         58,         58,        1,   152064, 0xd17c00ac
-0,         59,         59,        1,   152064, 0xc2ad54de
-0,         60,         60,        1,   152064, 0xbe11ee2f
-0,         61,         61,        1,   152064, 0x3db9dc89
-0,         62,         62,        1,   152064, 0xac0d7bc2
-0,         63,         63,        1,   152064, 0x8dab2dde
-0,         64,         64,        1,   152064, 0x566ad225
-0,         65,         65,        1,   152064, 0x587c7853
-0,         66,         66,        1,   152064, 0x601c9c80
-0,         67,         67,        1,   152064, 0x2afaf751
-0,         68,         68,        1,   152064, 0x1c9f7e3a
-0,         69,         69,        1,   152064, 0x899475bf
-0,         70,         70,        1,   152064, 0x0d65c7d9
-0,         71,         71,        1,   152064, 0xafd63d12
-0,         72,         72,        1,   152064, 0x162e62b9
-0,         73,         73,        1,   152064, 0x5c9554be
-0,         74,         74,        1,   152064, 0x35fbdaa2
-0,         75,         75,        1,   152064, 0x6438cbd8
-0,         76,         76,        1,   152064, 0xde0772c9
-0,         77,         77,        1,   152064, 0x79f82854
-0,         78,         78,        1,   152064, 0x86957840
-0,         79,         79,        1,   152064, 0xd9468cbf
-0,         80,         80,        1,   152064, 0x23e74609
-0,         81,         81,        1,   152064, 0x3919a146
-0,         82,         82,        1,   152064, 0xd641078b
-0,         83,         83,        1,   152064, 0x24397220
-0,         84,         84,        1,   152064, 0xe7fc3a7c
-0,         85,         85,        1,   152064, 0x3997154a
-0,         86,         86,        1,   152064, 0x2af3952c
-0,         87,         87,        1,   152064, 0x274ac07a
-0,         88,         88,        1,   152064, 0x288f7b09
-0,         89,         89,        1,   152064, 0xe6f9b022
-0,         90,         90,        1,   152064, 0xf09e2fbb
-0,         91,         91,        1,   152064, 0x7244e477
-0,         92,         92,        1,   152064, 0x0dfc72eb
-0,         93,         93,        1,   152064, 0x0322b21f
-0,         94,         94,        1,   152064, 0x18b08205
-0,         95,         95,        1,   152064, 0x6606153e
-0,         96,         96,        1,   152064, 0x85186272
-0,         97,         97,        1,   152064, 0x3369f064
-0,         98,         98,        1,   152064, 0xbe0d5a44
-0,         99,         99,        1,   152064, 0x320258bb
-0,        100,        100,        1,   152064, 0x4d6fb091
-0,        101,        101,        1,   152064, 0xc9bbf5e7
-0,        102,        102,        1,   152064, 0x0aa1b69b
-0,        103,        103,        1,   152064, 0x85b9ac11
-0,        104,        104,        1,   152064, 0xb25ff818
-0,        105,        105,        1,   152064, 0xa155dc25
-0,        106,        106,        1,   152064, 0xa8e03bfd
-0,        107,        107,        1,   152064, 0x0a862956
-0,        108,        108,        1,   152064, 0x11b49264
-0,        109,        109,        1,   152064, 0xa94e664e
-0,        110,        110,        1,   152064, 0x330e0fa2
-0,        111,        111,        1,   152064, 0xaf3d9518
-0,        112,        112,        1,   152064, 0x0836f2e8
-0,        113,        113,        1,   152064, 0xbf6dc578
-0,        114,        114,        1,   152064, 0x7b524d20
-0,        115,        115,        1,   152064, 0x9ef7677f
-0,        116,        116,        1,   152064, 0xeacf3f34
-0,        117,        117,        1,   152064, 0xfb4e3dbe
-0,        118,        118,        1,   152064, 0xb46e25cb
-0,        119,        119,        1,   152064, 0x363c1603
-0,        120,        120,        1,   152064, 0x263fc542
-0,        121,        121,        1,   152064, 0xf106e548
-0,        122,        122,        1,   152064, 0xde43c56a
-0,        123,        123,        1,   152064, 0xc2c4770a
-0,        124,        124,        1,   152064, 0x122fce19
-0,        125,        125,        1,   152064, 0x3ba01434
-0,        126,        126,        1,   152064, 0x0e8ce5ee
-0,        127,        127,        1,   152064, 0x6ceb82e1
-0,        128,        128,        1,   152064, 0xa23ee21c
-0,        129,        129,        1,   152064, 0xc6d960f9
-0,        130,        130,        1,   152064, 0x0de15258
-0,        131,        131,        1,   152064, 0x187b0333
-0,        132,        132,        1,   152064, 0x92e6582f
-0,        133,        133,        1,   152064, 0xb9586ce0
-0,        134,        134,        1,   152064, 0xefd803b5
-0,        135,        135,        1,   152064, 0x24eafb29
-0,        136,        136,        1,   152064, 0x20c73b14
-0,        137,        137,        1,   152064, 0xbd7ceaaa
-0,        138,        138,        1,   152064, 0x775216c8
-0,        139,        139,        1,   152064, 0xa08971c7
-0,        140,        140,        1,   152064, 0xef0ee865
-0,        141,        141,        1,   152064, 0x9ac61c2f
-0,        142,        142,        1,   152064, 0x52ae8ea9
-0,        143,        143,        1,   152064, 0x06571c14
-0,        144,        144,        1,   152064, 0x6e78ad33
-0,        145,        145,        1,   152064, 0xad01c627
-0,        146,        146,        1,   152064, 0xbfe074d3
-0,        147,        147,        1,   152064, 0x9357a183
-0,        148,        148,        1,   152064, 0x8de7767f
-0,        149,        149,        1,   152064, 0xa5e6e76e
-0,        150,        150,        1,   152064, 0xa6f646fe
-0,        151,        151,        1,   152064, 0x132e99f8
-0,        152,        152,        1,   152064, 0xb79f27de
-0,        153,        153,        1,   152064, 0x36d3cdcf
-0,        154,        154,        1,   152064, 0xdc938336
-0,        155,        155,        1,   152064, 0xacaa3a7f
-0,        156,        156,        1,   152064, 0xc61a37fd
-0,        157,        157,        1,   152064, 0x4fe1ddf0
-0,        158,        158,        1,   152064, 0xc0f7d660
-0,        159,        159,        1,   152064, 0xd72458ea
-0,        160,        160,        1,   152064, 0x6978d123
-0,        161,        161,        1,   152064, 0x64e60ccf
-0,        162,        162,        1,   152064, 0xaa07004c
-0,        163,        163,        1,   152064, 0x07cd1064
-0,        164,        164,        1,   152064, 0xa82320e5
-0,        165,        165,        1,   152064, 0xaedd8d30
-0,        166,        166,        1,   152064, 0x79b082ea
-0,        167,        167,        1,   152064, 0x9ed800ab
-0,        168,        168,        1,   152064, 0xde592bb4
-0,        169,        169,        1,   152064, 0xd966df88
-0,        170,        170,        1,   152064, 0xf921988a
-0,        171,        171,        1,   152064, 0x557ad9ae
-0,        172,        172,        1,   152064, 0xc3f31a9a
-0,        173,        173,        1,   152064, 0x65248561
-0,        174,        174,        1,   152064, 0x63df4aa6
-0,        175,        175,        1,   152064, 0x618da0a9
-0,        176,        176,        1,   152064, 0xe6f1c435
-0,        177,        177,        1,   152064, 0x9f90c38f
-0,        178,        178,        1,   152064, 0xd2853e14
-0,        179,        179,        1,   152064, 0x6e0268a9
-0,        180,        180,        1,   152064, 0x393712d1
-0,        181,        181,        1,   152064, 0x470da25f
-0,        182,        182,        1,   152064, 0xaf55cb3d
-0,        183,        183,        1,   152064, 0x6935b8b9
-0,        184,        184,        1,   152064, 0x5409a15f
-0,        185,        185,        1,   152064, 0x09073fee
-0,        186,        186,        1,   152064, 0xfb274e82
-0,        187,        187,        1,   152064, 0x1a770581
-0,        188,        188,        1,   152064, 0x17277d0d
-0,        189,        189,        1,   152064, 0xd4dcd982
-0,        190,        190,        1,   152064, 0x6b04eaf3
-0,        191,        191,        1,   152064, 0x8a3d822e
-0,        192,        192,        1,   152064, 0x1b971ec9
-0,        193,        193,        1,   152064, 0x14e0c0f6
-0,        194,        194,        1,   152064, 0x00667450
-0,        195,        195,        1,   152064, 0xd2385902
-0,        196,        196,        1,   152064, 0x905da6ab
-0,        197,        197,        1,   152064, 0xa3ffb18b
-0,        198,        198,        1,   152064, 0x10d48b19
-0,        199,        199,        1,   152064, 0xb2c7a3bd
-0,        200,        200,        1,   152064, 0x45593e96
-0,        201,        201,        1,   152064, 0x47a0b60c
-0,        202,        202,        1,   152064, 0x68c6d1b9
-0,        203,        203,        1,   152064, 0xbc881fcc
-0,        204,        204,        1,   152064, 0x422cc6f2
-0,        205,        205,        1,   152064, 0x9b686410
-0,        206,        206,        1,   152064, 0x35dc5e86
-0,        207,        207,        1,   152064, 0x247bedaa
-0,        208,        208,        1,   152064, 0x22b76fd1
-0,        209,        209,        1,   152064, 0x67cc7a75
-0,        210,        210,        1,   152064, 0xa197521e
-0,        211,        211,        1,   152064, 0x428c8662
-0,        212,        212,        1,   152064, 0x33dc2c73
-0,        213,        213,        1,   152064, 0x5b538903
-0,        214,        214,        1,   152064, 0x3c4176b6
-0,        215,        215,        1,   152064, 0x774364ba
-0,        216,        216,        1,   152064, 0xf237d03e
-0,        217,        217,        1,   152064, 0xac8746fb
-0,        218,        218,        1,   152064, 0x6b306a84
-0,        219,        219,        1,   152064, 0xa2ace513
-0,        220,        220,        1,   152064, 0x709c9be7
-0,        221,        221,        1,   152064, 0x2403f373
-0,        222,        222,        1,   152064, 0x147bf717
-0,        223,        223,        1,   152064, 0xe58964c8
-0,        224,        224,        1,   152064, 0xa0da36fc
-0,        225,        225,        1,   152064, 0x1ac1355c
-0,        226,        226,        1,   152064, 0x8a31c9f2
-0,        227,        227,        1,   152064, 0x42ba205c
-0,        228,        228,        1,   152064, 0xa11b3575
-0,        229,        229,        1,   152064, 0xcb35207c
-0,        230,        230,        1,   152064, 0x528f6189
-0,        231,        231,        1,   152064, 0x34f05bd7
-0,        232,        232,        1,   152064, 0x72317356
-0,        233,        233,        1,   152064, 0xaabd5028
-0,        234,        234,        1,   152064, 0x13dbeb7b
-0,        235,        235,        1,   152064, 0x62f1e8a8
-0,        236,        236,        1,   152064, 0x1723bfcd
-0,        237,        237,        1,   152064, 0x5c083c00
-0,        238,        238,        1,   152064, 0x52137894
-0,        239,        239,        1,   152064, 0xef1e082c
-0,        240,        240,        1,   152064, 0x664b3d53
-0,        241,        241,        1,   152064, 0x2eb9b296
-0,        242,        242,        1,   152064, 0xd0ca511e
-0,        243,        243,        1,   152064, 0x012d4724
-0,        244,        244,        1,   152064, 0xa847f5af
-0,        245,        245,        1,   152064, 0x483a2fde
-0,        246,        246,        1,   152064, 0xd1ab0257
-0,        247,        247,        1,   152064, 0x414692c7
-0,        248,        248,        1,   152064, 0x0b79df88
-0,        249,        249,        1,   152064, 0xdaa2c4a3
-0,        250,        250,        1,   152064, 0xd1b44500
-0,        251,        251,        1,   152064, 0xfd3d2cf3
-0,        252,        252,        1,   152064, 0xfdc0f748
-0,        253,        253,        1,   152064, 0xce762a2a
-0,        254,        254,        1,   152064, 0x08b63572
-0,        255,        255,        1,   152064, 0x5a46a38d
-0,        256,        256,        1,   152064, 0x03cee9c0
-0,        257,        257,        1,   152064, 0x9ee45473
-0,        258,        258,        1,   152064, 0x5a432386
-0,        259,        259,        1,   152064, 0x54c83d87
-0,        260,        260,        1,   152064, 0xc9caa1de
-0,        261,        261,        1,   152064, 0xa28367f1
-0,        262,        262,        1,   152064, 0x2607cdf1
-0,        263,        263,        1,   152064, 0x06baa8de
-0,        264,        264,        1,   152064, 0xf5346e32
-0,        265,        265,        1,   152064, 0x6d3e732b
-0,        266,        266,        1,   152064, 0x798c584b
-0,        267,        267,        1,   152064, 0x4076c948
-0,        268,        268,        1,   152064, 0x868cf63a
-0,        269,        269,        1,   152064, 0x23107ac5
-0,        270,        270,        1,   152064, 0x306f3fe2
-0,        271,        271,        1,   152064, 0xbd1d71d6
-0,        272,        272,        1,   152064, 0x1429545f
-0,        273,        273,        1,   152064, 0xaded29aa
-0,        274,        274,        1,   152064, 0x9b455a94
-0,        275,        275,        1,   152064, 0xb3774ce7
-0,        276,        276,        1,   152064, 0x92580986
-0,        277,        277,        1,   152064, 0x0eae2f95
-0,        278,        278,        1,   152064, 0x599208b2
-0,        279,        279,        1,   152064, 0x4804c04c
-0,        280,        280,        1,   152064, 0x5f730e8f
-0,        281,        281,        1,   152064, 0x3e501d1e
-0,        282,        282,        1,   152064, 0x32100740
-0,        283,        283,        1,   152064, 0x62226ff8
-0,        284,        284,        1,   152064, 0x7683b622
-0,        285,        285,        1,   152064, 0xc3e0aec1
-0,        286,        286,        1,   152064, 0xfac12608
-0,        287,        287,        1,   152064, 0xb21a5781
-0,        288,        288,        1,   152064, 0x8f1e4964
-0,        289,        289,        1,   152064, 0x0f62dd6e
-0,        290,        290,        1,   152064, 0xac062ac4
-0,        291,        291,        1,   152064, 0x1b320f7a
-0,        292,        292,        1,   152064, 0x346e7211
-0,        293,        293,        1,   152064, 0xe47592f3
-0,        294,        294,        1,   152064, 0xa3a7919c
-0,        295,        295,        1,   152064, 0xa3580fa6
-0,        296,        296,        1,   152064, 0xc73430c1
-0,        297,        297,        1,   152064, 0x994a2c18
-0,        298,        298,        1,   152064, 0x0b5d8d45
-0,        299,        299,        1,   152064, 0x9eed5109
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvmolq_brcm_b b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvmolq_brcm_b
deleted file mode 100644
index 4179ace..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvmolq_brcm_b
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xa18cfb97
-0,          1,          1,        1,   152064, 0x509b54d2
-0,          2,          2,        1,   152064, 0x1ba0fb8e
-0,          3,          3,        1,   152064, 0x43e7721f
-0,          4,          4,        1,   152064, 0xed196624
-0,          5,          5,        1,   152064, 0x4277f1e8
-0,          6,          6,        1,   152064, 0x88015cd6
-0,          7,          7,        1,   152064, 0x0f230af3
-0,          8,          8,        1,   152064, 0x91bbd664
-0,          9,          9,        1,   152064, 0x117c65dd
-0,         10,         10,        1,   152064, 0x8eebe5e8
-0,         11,         11,        1,   152064, 0xd205cc10
-0,         12,         12,        1,   152064, 0x4084a356
-0,         13,         13,        1,   152064, 0x37385081
-0,         14,         14,        1,   152064, 0xb7d34d8a
-0,         15,         15,        1,   152064, 0x96648874
-0,         16,         16,        1,   152064, 0x0623e65b
-0,         17,         17,        1,   152064, 0x7d5b0173
-0,         18,         18,        1,   152064, 0x0b6428e4
-0,         19,         19,        1,   152064, 0xf3ca22a8
-0,         20,         20,        1,   152064, 0x092e322c
-0,         21,         21,        1,   152064, 0xe82c2971
-0,         22,         22,        1,   152064, 0x29bf6111
-0,         23,         23,        1,   152064, 0x84f1ea0d
-0,         24,         24,        1,   152064, 0x45f822eb
-0,         25,         25,        1,   152064, 0x9672b2a7
-0,         26,         26,        1,   152064, 0xdb98e020
-0,         27,         27,        1,   152064, 0x729879eb
-0,         28,         28,        1,   152064, 0x3f629eae
-0,         29,         29,        1,   152064, 0x02e0ddb7
-0,         30,         30,        1,   152064, 0xbb1a0bb1
-0,         31,         31,        1,   152064, 0x9b85b55b
-0,         32,         32,        1,   152064, 0x2bae448b
-0,         33,         33,        1,   152064, 0xa8f28bfa
-0,         34,         34,        1,   152064, 0x687479da
-0,         35,         35,        1,   152064, 0xe1ec3111
-0,         36,         36,        1,   152064, 0x8afa37f1
-0,         37,         37,        1,   152064, 0x4af89faf
-0,         38,         38,        1,   152064, 0x1d9da53a
-0,         39,         39,        1,   152064, 0xdc599bcd
-0,         40,         40,        1,   152064, 0x01fb2e11
-0,         41,         41,        1,   152064, 0x2a33498e
-0,         42,         42,        1,   152064, 0x87874877
-0,         43,         43,        1,   152064, 0xdcd095c6
-0,         44,         44,        1,   152064, 0x4f14e6fb
-0,         45,         45,        1,   152064, 0x65fd165e
-0,         46,         46,        1,   152064, 0x4c267122
-0,         47,         47,        1,   152064, 0x18adf3aa
-0,         48,         48,        1,   152064, 0x74044daa
-0,         49,         49,        1,   152064, 0xa03bca1e
-0,         50,         50,        1,   152064, 0x7c1463fe
-0,         51,         51,        1,   152064, 0x688a14e3
-0,         52,         52,        1,   152064, 0x35c91c4e
-0,         53,         53,        1,   152064, 0xeaf51d07
-0,         54,         54,        1,   152064, 0xee61b9b1
-0,         55,         55,        1,   152064, 0xbab75db3
-0,         56,         56,        1,   152064, 0x199af472
-0,         57,         57,        1,   152064, 0x3bcf96db
-0,         58,         58,        1,   152064, 0x3fecdb09
-0,         59,         59,        1,   152064, 0x07be2431
-0,         60,         60,        1,   152064, 0x61432984
-0,         61,         61,        1,   152064, 0xdb12a3b9
-0,         62,         62,        1,   152064, 0xc2b8403e
-0,         63,         63,        1,   152064, 0x34c60bde
-0,         64,         64,        1,   152064, 0x08639859
-0,         65,         65,        1,   152064, 0xfc0fc556
-0,         66,         66,        1,   152064, 0x9cc27272
-0,         67,         67,        1,   152064, 0x3ef7dbb0
-0,         68,         68,        1,   152064, 0xbb74d9a3
-0,         69,         69,        1,   152064, 0x4007fc6e
-0,         70,         70,        1,   152064, 0x3d902f9b
-0,         71,         71,        1,   152064, 0xfbd0a76a
-0,         72,         72,        1,   152064, 0x4f1a4631
-0,         73,         73,        1,   152064, 0x4f58ee25
-0,         74,         74,        1,   152064, 0xd2c39501
-0,         75,         75,        1,   152064, 0x23de68d5
-0,         76,         76,        1,   152064, 0x4bf7d4ce
-0,         77,         77,        1,   152064, 0x2bdccc79
-0,         78,         78,        1,   152064, 0xc26b8f81
-0,         79,         79,        1,   152064, 0xe77fa90a
-0,         80,         80,        1,   152064, 0x48528308
-0,         81,         81,        1,   152064, 0xab19b66b
-0,         82,         82,        1,   152064, 0x04db5b4a
-0,         83,         83,        1,   152064, 0x9fade901
-0,         84,         84,        1,   152064, 0x1b7274ba
-0,         85,         85,        1,   152064, 0x387a0191
-0,         86,         86,        1,   152064, 0x2b3a8128
-0,         87,         87,        1,   152064, 0x2a0dab30
-0,         88,         88,        1,   152064, 0x5f5fc2da
-0,         89,         89,        1,   152064, 0x5a5c8150
-0,         90,         90,        1,   152064, 0xe0f5095e
-0,         91,         91,        1,   152064, 0xb87c8072
-0,         92,         92,        1,   152064, 0x08155daf
-0,         93,         93,        1,   152064, 0xc308353f
-0,         94,         94,        1,   152064, 0x2a04e8e4
-0,         95,         95,        1,   152064, 0xabe75987
-0,         96,         96,        1,   152064, 0x8733fb98
-0,         97,         97,        1,   152064, 0x810f53a0
-0,         98,         98,        1,   152064, 0xb3e4ea37
-0,         99,         99,        1,   152064, 0xb7a70980
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvnl_brcm_a b/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvnl_brcm_a
deleted file mode 100644
index 23ad267..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-hpcvnl_brcm_a
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0x2744afa1
-0,          1,          1,        1,   152064, 0x17246583
-0,          2,          2,        1,   152064, 0x501836ed
-0,          3,          3,        1,   152064, 0xe90d6961
-0,          4,          4,        1,   152064, 0x27abe1ad
-0,          5,          5,        1,   152064, 0xcfc730e4
-0,          6,          6,        1,   152064, 0xeaaa83ee
-0,          7,          7,        1,   152064, 0xb5d80ebd
-0,          8,          8,        1,   152064, 0x1e1b9d03
-0,          9,          9,        1,   152064, 0x60e7cf33
-0,         10,         10,        1,   152064, 0xc44616b1
-0,         11,         11,        1,   152064, 0x0a2a5906
-0,         12,         12,        1,   152064, 0xf101309c
-0,         13,         13,        1,   152064, 0x0b57f348
-0,         14,         14,        1,   152064, 0x4f018c05
-0,         15,         15,        1,   152064, 0x22359c60
-0,         16,         16,        1,   152064, 0x020f1cc3
-0,         17,         17,        1,   152064, 0x15be3892
-0,         18,         18,        1,   152064, 0x834a2e23
-0,         19,         19,        1,   152064, 0x1176586c
-0,         20,         20,        1,   152064, 0x9cf25641
-0,         21,         21,        1,   152064, 0xc1c4051d
-0,         22,         22,        1,   152064, 0x790d8bfa
-0,         23,         23,        1,   152064, 0x4dcbe7d7
-0,         24,         24,        1,   152064, 0xe81d3b7b
-0,         25,         25,        1,   152064, 0xe9e21309
-0,         26,         26,        1,   152064, 0x22021dbc
-0,         27,         27,        1,   152064, 0x430c5ecb
-0,         28,         28,        1,   152064, 0xf524be8b
-0,         29,         29,        1,   152064, 0xa437dadc
-0,         30,         30,        1,   152064, 0xff00b440
-0,         31,         31,        1,   152064, 0x4bd1bf15
-0,         32,         32,        1,   152064, 0x1f46a3ea
-0,         33,         33,        1,   152064, 0x60b47c5e
-0,         34,         34,        1,   152064, 0x45117ac6
-0,         35,         35,        1,   152064, 0x43894fca
-0,         36,         36,        1,   152064, 0x21572b55
-0,         37,         37,        1,   152064, 0xe96def09
-0,         38,         38,        1,   152064, 0x4d2ab41f
-0,         39,         39,        1,   152064, 0x072d6b06
-0,         40,         40,        1,   152064, 0x81865687
-0,         41,         41,        1,   152064, 0x8d9a0ea6
-0,         42,         42,        1,   152064, 0x1484d3cd
-0,         43,         43,        1,   152064, 0xbdabae6b
-0,         44,         44,        1,   152064, 0x4211edbe
-0,         45,         45,        1,   152064, 0xd84dad6d
-0,         46,         46,        1,   152064, 0xe4e79344
-0,         47,         47,        1,   152064, 0x9c1addd7
-0,         48,         48,        1,   152064, 0xdcf94283
-0,         49,         49,        1,   152064, 0x6bd005b2
-0,         50,         50,        1,   152064, 0x9679bd10
-0,         51,         51,        1,   152064, 0x052064ab
-0,         52,         52,        1,   152064, 0x915db3f3
-0,         53,         53,        1,   152064, 0xec2fbd58
-0,         54,         54,        1,   152064, 0x26728258
-0,         55,         55,        1,   152064, 0x2b2b617f
-0,         56,         56,        1,   152064, 0x2339eb3d
-0,         57,         57,        1,   152064, 0xcf6e6773
-0,         58,         58,        1,   152064, 0xb993efe4
-0,         59,         59,        1,   152064, 0x4054253d
-0,         60,         60,        1,   152064, 0x4befe5b5
-0,         61,         61,        1,   152064, 0x0678c0fa
-0,         62,         62,        1,   152064, 0xe3c54a03
-0,         63,         63,        1,   152064, 0xffa3210c
-0,         64,         64,        1,   152064, 0xed04b823
-0,         65,         65,        1,   152064, 0x00926457
-0,         66,         66,        1,   152064, 0xd56aaaf0
-0,         67,         67,        1,   152064, 0x6047ef6e
-0,         68,         68,        1,   152064, 0x44316d07
-0,         69,         69,        1,   152064, 0xe8a879b7
-0,         70,         70,        1,   152064, 0x1856cd86
-0,         71,         71,        1,   152064, 0x6528349a
-0,         72,         72,        1,   152064, 0xdeff676e
-0,         73,         73,        1,   152064, 0xda412e47
-0,         74,         74,        1,   152064, 0xa2c2a96f
-0,         75,         75,        1,   152064, 0xc703b8cd
-0,         76,         76,        1,   152064, 0x20b0650b
-0,         77,         77,        1,   152064, 0x8c14faa5
-0,         78,         78,        1,   152064, 0xa442706c
-0,         79,         79,        1,   152064, 0x6e456137
-0,         80,         80,        1,   152064, 0x6dde11c6
-0,         81,         81,        1,   152064, 0xb017978a
-0,         82,         82,        1,   152064, 0xc0bad34b
-0,         83,         83,        1,   152064, 0x8bd439ee
-0,         84,         84,        1,   152064, 0xa92735e4
-0,         85,         85,        1,   152064, 0x1623f501
-0,         86,         86,        1,   152064, 0x5be980b2
-0,         87,         87,        1,   152064, 0x4306b9bf
-0,         88,         88,        1,   152064, 0xb4f18976
-0,         89,         89,        1,   152064, 0x4ffb9b46
-0,         90,         90,        1,   152064, 0x23082275
-0,         91,         91,        1,   152064, 0xc7f0e087
-0,         92,         92,        1,   152064, 0x68b95327
-0,         93,         93,        1,   152064, 0xd030a8e4
-0,         94,         94,        1,   152064, 0xf8f9615c
-0,         95,         95,        1,   152064, 0x1b26fe3e
-0,         96,         96,        1,   152064, 0x3381608d
-0,         97,         97,        1,   152064, 0x9939d49d
-0,         98,         98,        1,   152064, 0x575f4f94
-0,         99,         99,        1,   152064, 0x436c581c
-0,        100,        100,        1,   152064, 0x8f47aa58
-0,        101,        101,        1,   152064, 0xd251d95a
-0,        102,        102,        1,   152064, 0x3c33b32c
-0,        103,        103,        1,   152064, 0xa1e19413
-0,        104,        104,        1,   152064, 0x8d95cbad
-0,        105,        105,        1,   152064, 0x98cbd35e
-0,        106,        106,        1,   152064, 0xceb81a0f
-0,        107,        107,        1,   152064, 0x5490fab1
-0,        108,        108,        1,   152064, 0x8e57a38c
-0,        109,        109,        1,   152064, 0xc379517a
-0,        110,        110,        1,   152064, 0xafc4f747
-0,        111,        111,        1,   152064, 0xbc9c9be4
-0,        112,        112,        1,   152064, 0xd602b2f5
-0,        113,        113,        1,   152064, 0x8d85a450
-0,        114,        114,        1,   152064, 0x48183c74
-0,        115,        115,        1,   152064, 0xd1725590
-0,        116,        116,        1,   152064, 0x5ef42ed7
-0,        117,        117,        1,   152064, 0xad3a3883
-0,        118,        118,        1,   152064, 0x7a3e0ddd
-0,        119,        119,        1,   152064, 0x59bdfd38
-0,        120,        120,        1,   152064, 0x5ac3ba9f
-0,        121,        121,        1,   152064, 0x266cbd00
-0,        122,        122,        1,   152064, 0x97d29e00
-0,        123,        123,        1,   152064, 0x620774c2
-0,        124,        124,        1,   152064, 0xaae8b96f
-0,        125,        125,        1,   152064, 0x5f6bdfb6
-0,        126,        126,        1,   152064, 0xb239da53
-0,        127,        127,        1,   152064, 0x654b5680
-0,        128,        128,        1,   152064, 0xd796b723
-0,        129,        129,        1,   152064, 0xd5c84a81
-0,        130,        130,        1,   152064, 0x2a761652
-0,        131,        131,        1,   152064, 0x1137e145
-0,        132,        132,        1,   152064, 0x1a9a451b
-0,        133,        133,        1,   152064, 0x5ca751c4
-0,        134,        134,        1,   152064, 0x074acec7
-0,        135,        135,        1,   152064, 0x9ddfe77d
-0,        136,        136,        1,   152064, 0xfb211c29
-0,        137,        137,        1,   152064, 0x681ad4dd
-0,        138,        138,        1,   152064, 0x702c12cc
-0,        139,        139,        1,   152064, 0x556c5101
-0,        140,        140,        1,   152064, 0x39d4bb54
-0,        141,        141,        1,   152064, 0xa3a118d6
-0,        142,        142,        1,   152064, 0xb78b7db1
-0,        143,        143,        1,   152064, 0x4e20eed5
-0,        144,        144,        1,   152064, 0x6555a9df
-0,        145,        145,        1,   152064, 0xb607a9a4
-0,        146,        146,        1,   152064, 0x3cf96a94
-0,        147,        147,        1,   152064, 0xb2679007
-0,        148,        148,        1,   152064, 0xf09d5b85
-0,        149,        149,        1,   152064, 0x3961ba07
-0,        150,        150,        1,   152064, 0x0c28363a
-0,        151,        151,        1,   152064, 0x0a017c2d
-0,        152,        152,        1,   152064, 0x3a661de3
-0,        153,        153,        1,   152064, 0xf8d1bdee
-0,        154,        154,        1,   152064, 0x6f47791b
-0,        155,        155,        1,   152064, 0xe05b22c6
-0,        156,        156,        1,   152064, 0x7cc93bb0
-0,        157,        157,        1,   152064, 0xeb90c3d8
-0,        158,        158,        1,   152064, 0x1a1eac98
-0,        159,        159,        1,   152064, 0x92985671
-0,        160,        160,        1,   152064, 0x2fe3ce53
-0,        161,        161,        1,   152064, 0x61def691
-0,        162,        162,        1,   152064, 0x90820730
-0,        163,        163,        1,   152064, 0x17630372
-0,        164,        164,        1,   152064, 0xaf6cea12
-0,        165,        165,        1,   152064, 0xfe3b7ecc
-0,        166,        166,        1,   152064, 0x904a5b2e
-0,        167,        167,        1,   152064, 0x0d88d5f2
-0,        168,        168,        1,   152064, 0x498d22b1
-0,        169,        169,        1,   152064, 0x56baba83
-0,        170,        170,        1,   152064, 0xda4d6dfa
-0,        171,        171,        1,   152064, 0xaa38cbdd
-0,        172,        172,        1,   152064, 0x4077f15d
-0,        173,        173,        1,   152064, 0x7e006ec2
-0,        174,        174,        1,   152064, 0x59964a89
-0,        175,        175,        1,   152064, 0x04c078e3
-0,        176,        176,        1,   152064, 0x7a5faf97
-0,        177,        177,        1,   152064, 0xc517b3e9
-0,        178,        178,        1,   152064, 0xfcc81af5
-0,        179,        179,        1,   152064, 0xdcb44f62
-0,        180,        180,        1,   152064, 0x2a080b72
-0,        181,        181,        1,   152064, 0x91f88c67
-0,        182,        182,        1,   152064, 0xd39caf81
-0,        183,        183,        1,   152064, 0x0764ae31
-0,        184,        184,        1,   152064, 0x0ddb82ed
-0,        185,        185,        1,   152064, 0xed6d17e4
-0,        186,        186,        1,   152064, 0xb4f74712
-0,        187,        187,        1,   152064, 0x23a20787
-0,        188,        188,        1,   152064, 0x853e7b33
-0,        189,        189,        1,   152064, 0xc6bac173
-0,        190,        190,        1,   152064, 0xb590ec15
-0,        191,        191,        1,   152064, 0xfdd2943c
-0,        192,        192,        1,   152064, 0xba5d1160
-0,        193,        193,        1,   152064, 0xe732c5a7
-0,        194,        194,        1,   152064, 0x279f6ce9
-0,        195,        195,        1,   152064, 0xb3835829
-0,        196,        196,        1,   152064, 0x0901b2a1
-0,        197,        197,        1,   152064, 0x3df2b8f8
-0,        198,        198,        1,   152064, 0x374496a4
-0,        199,        199,        1,   152064, 0x1bc6a4ae
-0,        200,        200,        1,   152064, 0xdb4b372e
-0,        201,        201,        1,   152064, 0x8c11c214
-0,        202,        202,        1,   152064, 0xd2d5c093
-0,        203,        203,        1,   152064, 0x8dda094e
-0,        204,        204,        1,   152064, 0x9b2cc401
-0,        205,        205,        1,   152064, 0x1a3b49d5
-0,        206,        206,        1,   152064, 0xaf5342ff
-0,        207,        207,        1,   152064, 0x74c0de83
-0,        208,        208,        1,   152064, 0xcf486137
-0,        209,        209,        1,   152064, 0xcf005b3b
-0,        210,        210,        1,   152064, 0x86a64c55
-0,        211,        211,        1,   152064, 0xdd3f7ae9
-0,        212,        212,        1,   152064, 0xb0d01e53
-0,        213,        213,        1,   152064, 0x83219065
-0,        214,        214,        1,   152064, 0x17a35d27
-0,        215,        215,        1,   152064, 0xf92645b5
-0,        216,        216,        1,   152064, 0x8322bdbf
-0,        217,        217,        1,   152064, 0xd589f6a2
-0,        218,        218,        1,   152064, 0x80a62d9e
-0,        219,        219,        1,   152064, 0x05b3e0d1
-0,        220,        220,        1,   152064, 0xd657aa0b
-0,        221,        221,        1,   152064, 0xec5ac2dd
-0,        222,        222,        1,   152064, 0xbf0ff969
-0,        223,        223,        1,   152064, 0xc34a5140
-0,        224,        224,        1,   152064, 0x814705c4
-0,        225,        225,        1,   152064, 0xe9592008
-0,        226,        226,        1,   152064, 0xf12c933c
-0,        227,        227,        1,   152064, 0x2daee178
-0,        228,        228,        1,   152064, 0xa2573028
-0,        229,        229,        1,   152064, 0x6109f58d
-0,        230,        230,        1,   152064, 0x64ab8ce4
-0,        231,        231,        1,   152064, 0x13a88b6e
-0,        232,        232,        1,   152064, 0x8f0181a9
-0,        233,        233,        1,   152064, 0xd5295fd4
-0,        234,        234,        1,   152064, 0xfdbeeb0d
-0,        235,        235,        1,   152064, 0x05ecd231
-0,        236,        236,        1,   152064, 0x48d164cd
-0,        237,        237,        1,   152064, 0xc279cf63
-0,        238,        238,        1,   152064, 0x1d5e6a03
-0,        239,        239,        1,   152064, 0xd9dc1807
-0,        240,        240,        1,   152064, 0xbcc83676
-0,        241,        241,        1,   152064, 0x65a9811e
-0,        242,        242,        1,   152064, 0x3ccfe5a8
-0,        243,        243,        1,   152064, 0x2f2ff051
-0,        244,        244,        1,   152064, 0x9193e093
-0,        245,        245,        1,   152064, 0x9a30fdc6
-0,        246,        246,        1,   152064, 0x90b7ea10
-0,        247,        247,        1,   152064, 0x3291910c
-0,        248,        248,        1,   152064, 0x2335d186
-0,        249,        249,        1,   152064, 0x2890cf1d
-0,        250,        250,        1,   152064, 0x8c8b6245
-0,        251,        251,        1,   152064, 0x24b84eda
-0,        252,        252,        1,   152064, 0x04a12446
-0,        253,        253,        1,   152064, 0xd9d91d51
-0,        254,        254,        1,   152064, 0xbf450adf
-0,        255,        255,        1,   152064, 0xa19a9a41
-0,        256,        256,        1,   152064, 0x2211ab01
-0,        257,        257,        1,   152064, 0x8fe85430
-0,        258,        258,        1,   152064, 0x5a152861
-0,        259,        259,        1,   152064, 0x7fe76995
-0,        260,        260,        1,   152064, 0x508b99cd
-0,        261,        261,        1,   152064, 0x92e79437
-0,        262,        262,        1,   152064, 0x8572eac9
-0,        263,        263,        1,   152064, 0x42e3d513
-0,        264,        264,        1,   152064, 0x6bee9e38
-0,        265,        265,        1,   152064, 0x2858ad4b
-0,        266,        266,        1,   152064, 0x96d87d00
-0,        267,        267,        1,   152064, 0x749f1032
-0,        268,        268,        1,   152064, 0x668fca6c
-0,        269,        269,        1,   152064, 0x11d278d9
-0,        270,        270,        1,   152064, 0x10fd46ea
-0,        271,        271,        1,   152064, 0xc8b193c8
-0,        272,        272,        1,   152064, 0x035e7d02
-0,        273,        273,        1,   152064, 0x067f583c
-0,        274,        274,        1,   152064, 0xd9648a1e
-0,        275,        275,        1,   152064, 0x92487b7e
-0,        276,        276,        1,   152064, 0xc7b35421
-0,        277,        277,        1,   152064, 0x2ed57c1c
-0,        278,        278,        1,   152064, 0xefe24c5f
-0,        279,        279,        1,   152064, 0x8df0118b
-0,        280,        280,        1,   152064, 0x18f0278d
-0,        281,        281,        1,   152064, 0x63ac45ad
-0,        282,        282,        1,   152064, 0xd79849f0
-0,        283,        283,        1,   152064, 0x1f1d4dab
-0,        284,        284,        1,   152064, 0x736fb5b8
-0,        285,        285,        1,   152064, 0xc24eb80c
-0,        286,        286,        1,   152064, 0x64ca3b11
-0,        287,        287,        1,   152064, 0x35d8674c
-0,        288,        288,        1,   152064, 0x3c5a7b51
-0,        289,        289,        1,   152064, 0x97550b81
-0,        290,        290,        1,   152064, 0x731454b5
-0,        291,        291,        1,   152064, 0x01de43bc
-0,        292,        292,        1,   152064, 0xbda7afae
-0,        293,        293,        1,   152064, 0xeb34d714
-0,        294,        294,        1,   152064, 0x1260cc98
-0,        295,        295,        1,   152064, 0x7e592c36
-0,        296,        296,        1,   152064, 0x40b3676e
-0,        297,        297,        1,   152064, 0x8c9d6b94
-0,        298,        298,        1,   152064, 0xc7988665
-0,        299,        299,        1,   152064, 0xf2994d52
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i1_panasonic_a b/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i1_panasonic_a
deleted file mode 100644
index 91e3436..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i1_panasonic_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  2764800, 0xcc4df07d
-0,          1,          1,        1,  2764800, 0x85f9e6d4
-0,          2,          2,        1,  2764800, 0x23ffe90d
-0,          3,          3,        1,  2764800, 0xf0a6d453
-0,          4,          4,        1,  2764800, 0x913a6392
-0,          5,          5,        1,  2764800, 0xcc5f9736
-0,          6,          6,        1,  2764800, 0x43f9f9ce
-0,          7,          7,        1,  2764800, 0xc874b44e
-0,          8,          8,        1,  2764800, 0x83b665e6
-0,          9,          9,        1,  2764800, 0x5ea2e31e
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i2_panasonic_a b/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i2_panasonic_a
deleted file mode 100644
index 1d6d4b5..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i2_panasonic_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  2764800, 0x4f710132
-0,          1,          1,        1,  2764800, 0x57e5b713
-0,          2,          2,        1,  2764800, 0xcca01477
-0,          3,          3,        1,  2764800, 0xa19a95cd
-0,          4,          4,        1,  2764800, 0x700a757d
-0,          5,          5,        1,  2764800, 0xd8c6f60f
-0,          6,          6,        1,  2764800, 0x95a1bbc7
-0,          7,          7,        1,  2764800, 0x0582077a
-0,          8,          8,        1,  2764800, 0x91595f91
-0,          9,          9,        1,  2764800, 0xf5fe034a
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i3_panasonic_a b/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i3_panasonic_a
deleted file mode 100644
index a09e397..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i3_panasonic_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  2764800, 0xda69f69e
-0,          1,          1,        1,  2764800, 0x29ed832f
-0,          2,          2,        1,  2764800, 0xb3244cc4
-0,          3,          3,        1,  2764800, 0xe41a312c
-0,          4,          4,        1,  2764800, 0xac0b344b
-0,          5,          5,        1,  2764800, 0xc585aa20
-0,          6,          6,        1,  2764800, 0x0952054c
-0,          7,          7,        1,  2764800, 0xd1a02f87
-0,          8,          8,        1,  2764800, 0xfcbfe87c
-0,          9,          9,        1,  2764800, 0xe4e9b8a2
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i4_panasonic_a b/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i4_panasonic_a
deleted file mode 100644
index adec664..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i4_panasonic_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  6220800, 0xca2a2a5e
-0,          1,          1,        1,  6220800, 0x8009a65e
-0,          2,          2,        1,  6220800, 0x63e72b3b
-0,          3,          3,        1,  6220800, 0x7459a1cc
-0,          4,          4,        1,  6220800, 0x02191aa9
-0,          5,          5,        1,  6220800, 0x88dca590
-0,          6,          6,        1,  6220800, 0x4484d484
-0,          7,          7,        1,  6220800, 0x8afdb53f
-0,          8,          8,        1,  6220800, 0xd3d6017a
-0,          9,          9,        1,  6220800, 0xf5162af0
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i5_panasonic_a b/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i5_panasonic_a
deleted file mode 100644
index a475197..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i5_panasonic_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  6220800, 0x1df58ce9
-0,          1,          1,        1,  6220800, 0x8f2859ce
-0,          2,          2,        1,  6220800, 0x229cc7ff
-0,          3,          3,        1,  6220800, 0x73e86984
-0,          4,          4,        1,  6220800, 0xb6d4504b
-0,          5,          5,        1,  6220800, 0x4e7d4883
-0,          6,          6,        1,  6220800, 0xbec3f0f7
-0,          7,          7,        1,  6220800, 0x1d9af065
-0,          8,          8,        1,  6220800, 0x44851549
-0,          9,          9,        1,  6220800, 0xfcf8728e
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i6_panasonic_a b/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i6_panasonic_a
deleted file mode 100644
index 25d0eec..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i6_panasonic_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  6220800, 0x408daf70
-0,          1,          1,        1,  6220800, 0x59b254a3
-0,          2,          2,        1,  6220800, 0x4cf4279c
-0,          3,          3,        1,  6220800, 0x5c9437ae
-0,          4,          4,        1,  6220800, 0x986c3eb8
-0,          5,          5,        1,  6220800, 0x23fd883e
-0,          6,          6,        1,  6220800, 0x84f222fe
-0,          7,          7,        1,  6220800, 0xe7f91107
-0,          8,          8,        1,  6220800, 0xb544b31e
-0,          9,          9,        1,  6220800, 0x1ebdde56
diff --git a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i7_panasonic_a b/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i7_panasonic_a
deleted file mode 100644
index 1090b49..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-frext-pph10i7_panasonic_a
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  6220800, 0xf81873fe
-0,          1,          1,        1,  6220800, 0x7b96fbdc
-0,          2,          2,        1,  6220800, 0x75dbafc4
-0,          3,          3,        1,  6220800, 0x7524301e
-0,          4,          4,        1,  6220800, 0x0f3621ab
-0,          5,          5,        1,  6220800, 0xa5e25b35
-0,          6,          6,        1,  6220800, 0x063a8116
-0,          7,          7,        1,  6220800, 0x48ebc8ff
-0,          8,          8,        1,  6220800, 0x1f635df8
-0,          9,          9,        1,  6220800, 0xe282c8bd
diff --git a/deps/libav/tests/ref/fate/h264-conformance-hcbp2_hhi_a b/deps/libav/tests/ref/fate/h264-conformance-hcbp2_hhi_a
deleted file mode 100644
index 977107e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-hcbp2_hhi_a
+++ /dev/null
@@ -1,251 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xf9deb95a
-0,          1,          1,        1,   152064, 0xdce9c541
-0,          2,          2,        1,   152064, 0xc45a8a77
-0,          3,          3,        1,   152064, 0x5132a470
-0,          4,          4,        1,   152064, 0x65542c98
-0,          5,          5,        1,   152064, 0x2df95883
-0,          6,          6,        1,   152064, 0x9f4f1280
-0,          7,          7,        1,   152064, 0x11c9f32c
-0,          8,          8,        1,   152064, 0x66535f0c
-0,          9,          9,        1,   152064, 0x5b13770c
-0,         10,         10,        1,   152064, 0xadcd3278
-0,         11,         11,        1,   152064, 0x06e00e91
-0,         12,         12,        1,   152064, 0x1fa1886f
-0,         13,         13,        1,   152064, 0xd524b6a3
-0,         14,         14,        1,   152064, 0x45f82b73
-0,         15,         15,        1,   152064, 0x0fd301aa
-0,         16,         16,        1,   152064, 0x2983acdd
-0,         17,         17,        1,   152064, 0xe74004c6
-0,         18,         18,        1,   152064, 0xe279328a
-0,         19,         19,        1,   152064, 0x85be8f85
-0,         20,         20,        1,   152064, 0xec503b6b
-0,         21,         21,        1,   152064, 0x3d4495db
-0,         22,         22,        1,   152064, 0x3a9774d2
-0,         23,         23,        1,   152064, 0x80a07a42
-0,         24,         24,        1,   152064, 0x484427ce
-0,         25,         25,        1,   152064, 0x9e6b773f
-0,         26,         26,        1,   152064, 0xd3be5f07
-0,         27,         27,        1,   152064, 0x69a76c5e
-0,         28,         28,        1,   152064, 0xd448fde2
-0,         29,         29,        1,   152064, 0x04a34635
-0,         30,         30,        1,   152064, 0xd4e3e0e1
-0,         31,         31,        1,   152064, 0x2564cf13
-0,         32,         32,        1,   152064, 0x98bc5167
-0,         33,         33,        1,   152064, 0xcf06991f
-0,         34,         34,        1,   152064, 0x3edf621f
-0,         35,         35,        1,   152064, 0x47039967
-0,         36,         36,        1,   152064, 0x299636b5
-0,         37,         37,        1,   152064, 0x2bc0849d
-0,         38,         38,        1,   152064, 0xe94946a6
-0,         39,         39,        1,   152064, 0x5a5768ac
-0,         40,         40,        1,   152064, 0xfe4ce9cd
-0,         41,         41,        1,   152064, 0xbeb34b2e
-0,         42,         42,        1,   152064, 0xa26020e3
-0,         43,         43,        1,   152064, 0xb2514c55
-0,         44,         44,        1,   152064, 0x723be4b1
-0,         45,         45,        1,   152064, 0xeef4434e
-0,         46,         46,        1,   152064, 0x1237e1db
-0,         47,         47,        1,   152064, 0x4814c1fb
-0,         48,         48,        1,   152064, 0xe7544446
-0,         49,         49,        1,   152064, 0xd93a53d9
-0,         50,         50,        1,   152064, 0x90e029c6
-0,         51,         51,        1,   152064, 0xfa493dfc
-0,         52,         52,        1,   152064, 0x081fa2d9
-0,         53,         53,        1,   152064, 0x9782ef8c
-0,         54,         54,        1,   152064, 0x1daf911c
-0,         55,         55,        1,   152064, 0xc9058a57
-0,         56,         56,        1,   152064, 0x68a90f04
-0,         57,         57,        1,   152064, 0xc7115091
-0,         58,         58,        1,   152064, 0xe9731898
-0,         59,         59,        1,   152064, 0xd7bc206e
-0,         60,         60,        1,   152064, 0xf760baac
-0,         61,         61,        1,   152064, 0x6f9700e3
-0,         62,         62,        1,   152064, 0xec54b42d
-0,         63,         63,        1,   152064, 0x0dc5bf77
-0,         64,         64,        1,   152064, 0x196e33c3
-0,         65,         65,        1,   152064, 0x090cae46
-0,         66,         66,        1,   152064, 0x06897499
-0,         67,         67,        1,   152064, 0xf54cd959
-0,         68,         68,        1,   152064, 0x24167906
-0,         69,         69,        1,   152064, 0xea06e67b
-0,         70,         70,        1,   152064, 0xa97ed69c
-0,         71,         71,        1,   152064, 0x03c4ce82
-0,         72,         72,        1,   152064, 0xca864ddd
-0,         73,         73,        1,   152064, 0x1bc9956f
-0,         74,         74,        1,   152064, 0x7864908c
-0,         75,         75,        1,   152064, 0x52f3be55
-0,         76,         76,        1,   152064, 0x78b469b5
-0,         77,         77,        1,   152064, 0x8b3bb23e
-0,         78,         78,        1,   152064, 0x5bed7f47
-0,         79,         79,        1,   152064, 0x401b7e9c
-0,         80,         80,        1,   152064, 0x4cbc3193
-0,         81,         81,        1,   152064, 0xa00b7ed2
-0,         82,         82,        1,   152064, 0xda548927
-0,         83,         83,        1,   152064, 0x30a5cffb
-0,         84,         84,        1,   152064, 0x9536bdf0
-0,         85,         85,        1,   152064, 0x927e3cf4
-0,         86,         86,        1,   152064, 0x95533148
-0,         87,         87,        1,   152064, 0x763c553a
-0,         88,         88,        1,   152064, 0x7010f280
-0,         89,         89,        1,   152064, 0xa537667c
-0,         90,         90,        1,   152064, 0xe599927a
-0,         91,         91,        1,   152064, 0x72dde2ab
-0,         92,         92,        1,   152064, 0x02089d51
-0,         93,         93,        1,   152064, 0x4ca8231a
-0,         94,         94,        1,   152064, 0x90b126aa
-0,         95,         95,        1,   152064, 0x65a9260f
-0,         96,         96,        1,   152064, 0xf37cf34a
-0,         97,         97,        1,   152064, 0xf21f63f6
-0,         98,         98,        1,   152064, 0x95209e85
-0,         99,         99,        1,   152064, 0x0df00a65
-0,        100,        100,        1,   152064, 0x0ce71e2b
-0,        101,        101,        1,   152064, 0x6cbf8843
-0,        102,        102,        1,   152064, 0x17f29296
-0,        103,        103,        1,   152064, 0x88278aa9
-0,        104,        104,        1,   152064, 0x84ad74d0
-0,        105,        105,        1,   152064, 0xda48eea1
-0,        106,        106,        1,   152064, 0xcaf33b25
-0,        107,        107,        1,   152064, 0x9b288538
-0,        108,        108,        1,   152064, 0xd1b7561f
-0,        109,        109,        1,   152064, 0x4bfcbdac
-0,        110,        110,        1,   152064, 0x1dd5b920
-0,        111,        111,        1,   152064, 0xde50ceeb
-0,        112,        112,        1,   152064, 0xa552963b
-0,        113,        113,        1,   152064, 0xb2f5ef15
-0,        114,        114,        1,   152064, 0x5abf061c
-0,        115,        115,        1,   152064, 0x9b4c45f6
-0,        116,        116,        1,   152064, 0xe61d1b02
-0,        117,        117,        1,   152064, 0xe5728c4e
-0,        118,        118,        1,   152064, 0xcb944655
-0,        119,        119,        1,   152064, 0x648b951a
-0,        120,        120,        1,   152064, 0xc3671a38
-0,        121,        121,        1,   152064, 0x7d3fbcf3
-0,        122,        122,        1,   152064, 0x3c0ba1c5
-0,        123,        123,        1,   152064, 0xf5ac0d3a
-0,        124,        124,        1,   152064, 0x87faf534
-0,        125,        125,        1,   152064, 0xb3f05d11
-0,        126,        126,        1,   152064, 0x825e3423
-0,        127,        127,        1,   152064, 0xade45431
-0,        128,        128,        1,   152064, 0x7715d496
-0,        129,        129,        1,   152064, 0x983c45fa
-0,        130,        130,        1,   152064, 0xe8d621d8
-0,        131,        131,        1,   152064, 0x71ec7553
-0,        132,        132,        1,   152064, 0xb20d5556
-0,        133,        133,        1,   152064, 0xfa6bd00b
-0,        134,        134,        1,   152064, 0x2a18acf1
-0,        135,        135,        1,   152064, 0xa241c342
-0,        136,        136,        1,   152064, 0xa3597426
-0,        137,        137,        1,   152064, 0x6f72ff61
-0,        138,        138,        1,   152064, 0xceffe8af
-0,        139,        139,        1,   152064, 0x76853b09
-0,        140,        140,        1,   152064, 0x3f58cc0c
-0,        141,        141,        1,   152064, 0x16080a6d
-0,        142,        142,        1,   152064, 0x752ae0aa
-0,        143,        143,        1,   152064, 0x7dadf81b
-0,        144,        144,        1,   152064, 0x9828aa7c
-0,        145,        145,        1,   152064, 0x05a51e04
-0,        146,        146,        1,   152064, 0xf9a92ae6
-0,        147,        147,        1,   152064, 0xce0169f9
-0,        148,        148,        1,   152064, 0x784d405b
-0,        149,        149,        1,   152064, 0x531b9869
-0,        150,        150,        1,   152064, 0xdf6a6129
-0,        151,        151,        1,   152064, 0x5cdf5aac
-0,        152,        152,        1,   152064, 0x28dd0050
-0,        153,        153,        1,   152064, 0x76bd5ea7
-0,        154,        154,        1,   152064, 0xcf3036bf
-0,        155,        155,        1,   152064, 0x20365c0d
-0,        156,        156,        1,   152064, 0x171ad303
-0,        157,        157,        1,   152064, 0x1388416d
-0,        158,        158,        1,   152064, 0x9b92f171
-0,        159,        159,        1,   152064, 0xe2bc377a
-0,        160,        160,        1,   152064, 0x90639e6c
-0,        161,        161,        1,   152064, 0x1b50e759
-0,        162,        162,        1,   152064, 0x43a9b680
-0,        163,        163,        1,   152064, 0xb1780015
-0,        164,        164,        1,   152064, 0x9a6783a6
-0,        165,        165,        1,   152064, 0x1471e2e4
-0,        166,        166,        1,   152064, 0xb1899be2
-0,        167,        167,        1,   152064, 0x2facd37c
-0,        168,        168,        1,   152064, 0x197361fc
-0,        169,        169,        1,   152064, 0x823ffce1
-0,        170,        170,        1,   152064, 0x9ce3cb14
-0,        171,        171,        1,   152064, 0x16620232
-0,        172,        172,        1,   152064, 0x4fedb29e
-0,        173,        173,        1,   152064, 0xb45cd8b4
-0,        174,        174,        1,   152064, 0x84387e9d
-0,        175,        175,        1,   152064, 0xd5017ca0
-0,        176,        176,        1,   152064, 0x106002a5
-0,        177,        177,        1,   152064, 0x20c44a82
-0,        178,        178,        1,   152064, 0x0694fbb2
-0,        179,        179,        1,   152064, 0x849cfdf3
-0,        180,        180,        1,   152064, 0xef827c85
-0,        181,        181,        1,   152064, 0xc04ecde3
-0,        182,        182,        1,   152064, 0x2f81bee2
-0,        183,        183,        1,   152064, 0x86dbe8cc
-0,        184,        184,        1,   152064, 0x9ee67bcd
-0,        185,        185,        1,   152064, 0xa2618f39
-0,        186,        186,        1,   152064, 0x35a40f36
-0,        187,        187,        1,   152064, 0x9f6b0b54
-0,        188,        188,        1,   152064, 0xcee2c0b5
-0,        189,        189,        1,   152064, 0x3c3cb8f3
-0,        190,        190,        1,   152064, 0xf3ab2e21
-0,        191,        191,        1,   152064, 0xc51afcbc
-0,        192,        192,        1,   152064, 0x272bbb4d
-0,        193,        193,        1,   152064, 0x1448f2cc
-0,        194,        194,        1,   152064, 0xd286e217
-0,        195,        195,        1,   152064, 0xd6abf89e
-0,        196,        196,        1,   152064, 0xf908bb8a
-0,        197,        197,        1,   152064, 0x8a17ddd6
-0,        198,        198,        1,   152064, 0xc30d9039
-0,        199,        199,        1,   152064, 0xb8c6a557
-0,        200,        200,        1,   152064, 0xf1675620
-0,        201,        201,        1,   152064, 0xbb41b898
-0,        202,        202,        1,   152064, 0x662298b2
-0,        203,        203,        1,   152064, 0x0f8271aa
-0,        204,        204,        1,   152064, 0x34d90197
-0,        205,        205,        1,   152064, 0x15254eb2
-0,        206,        206,        1,   152064, 0x4d942235
-0,        207,        207,        1,   152064, 0xa2cefa6a
-0,        208,        208,        1,   152064, 0x909a7050
-0,        209,        209,        1,   152064, 0x219abae7
-0,        210,        210,        1,   152064, 0x0166bc37
-0,        211,        211,        1,   152064, 0x8b960965
-0,        212,        212,        1,   152064, 0x71f6af2a
-0,        213,        213,        1,   152064, 0x8d69f377
-0,        214,        214,        1,   152064, 0x27b1a17d
-0,        215,        215,        1,   152064, 0x6b09b049
-0,        216,        216,        1,   152064, 0x733472e7
-0,        217,        217,        1,   152064, 0x986efe32
-0,        218,        218,        1,   152064, 0x99a37cc5
-0,        219,        219,        1,   152064, 0x82433283
-0,        220,        220,        1,   152064, 0x4698c0bd
-0,        221,        221,        1,   152064, 0x1f6ce7f9
-0,        222,        222,        1,   152064, 0x6e398d44
-0,        223,        223,        1,   152064, 0x14ae5d85
-0,        224,        224,        1,   152064, 0xef2f1e28
-0,        225,        225,        1,   152064, 0x9dfe46ae
-0,        226,        226,        1,   152064, 0x91997a8f
-0,        227,        227,        1,   152064, 0x6c828dda
-0,        228,        228,        1,   152064, 0x723f3f5c
-0,        229,        229,        1,   152064, 0xcb86883d
-0,        230,        230,        1,   152064, 0x1c25cbed
-0,        231,        231,        1,   152064, 0x3cad814a
-0,        232,        232,        1,   152064, 0xe0d8f5e7
-0,        233,        233,        1,   152064, 0xaefb35cc
-0,        234,        234,        1,   152064, 0x5dfc2181
-0,        235,        235,        1,   152064, 0x13f26603
-0,        236,        236,        1,   152064, 0x97a3dd0d
-0,        237,        237,        1,   152064, 0xbecff890
-0,        238,        238,        1,   152064, 0xd226badc
-0,        239,        239,        1,   152064, 0x7f4adbd1
-0,        240,        240,        1,   152064, 0x5da1565a
-0,        241,        241,        1,   152064, 0x35cbac9c
-0,        242,        242,        1,   152064, 0xf1b26f8a
-0,        243,        243,        1,   152064, 0xc8d08d07
-0,        244,        244,        1,   152064, 0xa9f643c2
-0,        245,        245,        1,   152064, 0xc420b0ba
-0,        246,        246,        1,   152064, 0x8871a4f5
-0,        247,        247,        1,   152064, 0x4e7647b4
-0,        248,        248,        1,   152064, 0xb4dad812
-0,        249,        249,        1,   152064, 0x6a3d00d5
diff --git a/deps/libav/tests/ref/fate/h264-conformance-hcmp1_hhi_a b/deps/libav/tests/ref/fate/h264-conformance-hcmp1_hhi_a
deleted file mode 100644
index be619da..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-hcmp1_hhi_a
+++ /dev/null
@@ -1,251 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 0xda244f3f
-0,          1,          1,        1,   152064, 0x35a1cb02
-0,          2,          2,        1,   152064, 0xa729d9ca
-0,          3,          3,        1,   152064, 0x69d90602
-0,          4,          4,        1,   152064, 0x4ccdae72
-0,          5,          5,        1,   152064, 0x06f9d8b9
-0,          6,          6,        1,   152064, 0x0a14a736
-0,          7,          7,        1,   152064, 0xc344b167
-0,          8,          8,        1,   152064, 0xf3303e92
-0,          9,          9,        1,   152064, 0xbe28813f
-0,         10,         10,        1,   152064, 0x971f4980
-0,         11,         11,        1,   152064, 0x69124d31
-0,         12,         12,        1,   152064, 0x6d93e7f2
-0,         13,         13,        1,   152064, 0x5c1315e4
-0,         14,         14,        1,   152064, 0xb011cfe4
-0,         15,         15,        1,   152064, 0x65a0d147
-0,         16,         16,        1,   152064, 0x463d8c39
-0,         17,         17,        1,   152064, 0x15f2a757
-0,         18,         18,        1,   152064, 0xc2418f1f
-0,         19,         19,        1,   152064, 0x7a48b94c
-0,         20,         20,        1,   152064, 0x1c079ec9
-0,         21,         21,        1,   152064, 0x348ced32
-0,         22,         22,        1,   152064, 0x6014d525
-0,         23,         23,        1,   152064, 0x146ed41f
-0,         24,         24,        1,   152064, 0x543177e6
-0,         25,         25,        1,   152064, 0x79a4b44e
-0,         26,         26,        1,   152064, 0x4401a7ae
-0,         27,         27,        1,   152064, 0xc0aec3c1
-0,         28,         28,        1,   152064, 0x92348852
-0,         29,         29,        1,   152064, 0x90eece70
-0,         30,         30,        1,   152064, 0x19efd00f
-0,         31,         31,        1,   152064, 0x608912ac
-0,         32,         32,        1,   152064, 0xa707bdb1
-0,         33,         33,        1,   152064, 0x926e1ffe
-0,         34,         34,        1,   152064, 0x56863ca8
-0,         35,         35,        1,   152064, 0xe18e81b4
-0,         36,         36,        1,   152064, 0xf17466f2
-0,         37,         37,        1,   152064, 0x2281feef
-0,         38,         38,        1,   152064, 0x33603b66
-0,         39,         39,        1,   152064, 0xe30fad28
-0,         40,         40,        1,   152064, 0x66efb21e
-0,         41,         41,        1,   152064, 0x405f32d6
-0,         42,         42,        1,   152064, 0xe90f262b
-0,         43,         43,        1,   152064, 0xf85144b0
-0,         44,         44,        1,   152064, 0xcff4feab
-0,         45,         45,        1,   152064, 0x02b63e49
-0,         46,         46,        1,   152064, 0x91d9ff77
-0,         47,         47,        1,   152064, 0x2c6c0d2a
-0,         48,         48,        1,   152064, 0xacad9e66
-0,         49,         49,        1,   152064, 0x83951353
-0,         50,         50,        1,   152064, 0x549c16e4
-0,         51,         51,        1,   152064, 0xcad9610c
-0,         52,         52,        1,   152064, 0x264e4b57
-0,         53,         53,        1,   152064, 0x9758afe8
-0,         54,         54,        1,   152064, 0x0273a81d
-0,         55,         55,        1,   152064, 0x31c6f1a0
-0,         56,         56,        1,   152064, 0x80d1c9cf
-0,         57,         57,        1,   152064, 0x41b861f7
-0,         58,         58,        1,   152064, 0xad416fe7
-0,         59,         59,        1,   152064, 0xdde59bf0
-0,         60,         60,        1,   152064, 0x886c491c
-0,         61,         61,        1,   152064, 0x4bf4a21f
-0,         62,         62,        1,   152064, 0x2581a06e
-0,         63,         63,        1,   152064, 0x8188cf9b
-0,         64,         64,        1,   152064, 0xbfaf82ce
-0,         65,         65,        1,   152064, 0xed9ef8b1
-0,         66,         66,        1,   152064, 0xf5f4e0c0
-0,         67,         67,        1,   152064, 0xa24421ac
-0,         68,         68,        1,   152064, 0xf0cdde38
-0,         69,         69,        1,   152064, 0x7f211f2c
-0,         70,         70,        1,   152064, 0x241ff38b
-0,         71,         71,        1,   152064, 0x19bc25a6
-0,         72,         72,        1,   152064, 0xd9d5ede9
-0,         73,         73,        1,   152064, 0x88f98579
-0,         74,         74,        1,   152064, 0x630da1aa
-0,         75,         75,        1,   152064, 0x19abf44f
-0,         76,         76,        1,   152064, 0x3a95d341
-0,         77,         77,        1,   152064, 0xdeb9333e
-0,         78,         78,        1,   152064, 0x0c994783
-0,         79,         79,        1,   152064, 0xb58b7d26
-0,         80,         80,        1,   152064, 0x6e392b24
-0,         81,         81,        1,   152064, 0x1f7e2d63
-0,         82,         82,        1,   152064, 0x732342d3
-0,         83,         83,        1,   152064, 0xbda4a761
-0,         84,         84,        1,   152064, 0xdc387777
-0,         85,         85,        1,   152064, 0xd5d00469
-0,         86,         86,        1,   152064, 0xc840cf6d
-0,         87,         87,        1,   152064, 0x3dfef3d9
-0,         88,         88,        1,   152064, 0xf731594f
-0,         89,         89,        1,   152064, 0x126fef41
-0,         90,         90,        1,   152064, 0x5705b1e3
-0,         91,         91,        1,   152064, 0xa8ecbe94
-0,         92,         92,        1,   152064, 0xcbcd0e48
-0,         93,         93,        1,   152064, 0x3da860da
-0,         94,         94,        1,   152064, 0x97882d5f
-0,         95,         95,        1,   152064, 0x19803d16
-0,         96,         96,        1,   152064, 0xa639b969
-0,         97,         97,        1,   152064, 0xc0a00bc3
-0,         98,         98,        1,   152064, 0xb12f0617
-0,         99,         99,        1,   152064, 0x0e53481c
-0,        100,        100,        1,   152064, 0x1fa0e47d
-0,        101,        101,        1,   152064, 0x818119fa
-0,        102,        102,        1,   152064, 0xc28ffc3e
-0,        103,        103,        1,   152064, 0x8abdfb3c
-0,        104,        104,        1,   152064, 0x670cb951
-0,        105,        105,        1,   152064, 0x172808bd
-0,        106,        106,        1,   152064, 0x6be1ea7f
-0,        107,        107,        1,   152064, 0x05dbfadc
-0,        108,        108,        1,   152064, 0xcfcfbcec
-0,        109,        109,        1,   152064, 0x9306e1d2
-0,        110,        110,        1,   152064, 0xcf3ccc54
-0,        111,        111,        1,   152064, 0xf36ad41a
-0,        112,        112,        1,   152064, 0x751b835b
-0,        113,        113,        1,   152064, 0x7ebed47b
-0,        114,        114,        1,   152064, 0x9659d022
-0,        115,        115,        1,   152064, 0xef7701ae
-0,        116,        116,        1,   152064, 0x5cdee3b0
-0,        117,        117,        1,   152064, 0xf6c3ed42
-0,        118,        118,        1,   152064, 0x412ee2fb
-0,        119,        119,        1,   152064, 0x309cd2bd
-0,        120,        120,        1,   152064, 0x50f09af5
-0,        121,        121,        1,   152064, 0x4a05087a
-0,        122,        122,        1,   152064, 0xaedc2125
-0,        123,        123,        1,   152064, 0x54e2692a
-0,        124,        124,        1,   152064, 0x0403590c
-0,        125,        125,        1,   152064, 0x8a4c9833
-0,        126,        126,        1,   152064, 0x36b6893e
-0,        127,        127,        1,   152064, 0x21fd9204
-0,        128,        128,        1,   152064, 0xa1cd3bc7
-0,        129,        129,        1,   152064, 0x3cfa3d18
-0,        130,        130,        1,   152064, 0xb5f7fefd
-0,        131,        131,        1,   152064, 0x133cf831
-0,        132,        132,        1,   152064, 0xcaabdd54
-0,        133,        133,        1,   152064, 0xcab45366
-0,        134,        134,        1,   152064, 0x8b6f4c90
-0,        135,        135,        1,   152064, 0x4de74903
-0,        136,        136,        1,   152064, 0x2dde0c4f
-0,        137,        137,        1,   152064, 0x09364c1d
-0,        138,        138,        1,   152064, 0x610318b9
-0,        139,        139,        1,   152064, 0xd85109d5
-0,        140,        140,        1,   152064, 0x27a1eac7
-0,        141,        141,        1,   152064, 0xafd50e70
-0,        142,        142,        1,   152064, 0x96ac088c
-0,        143,        143,        1,   152064, 0x1332091c
-0,        144,        144,        1,   152064, 0x9d38ce90
-0,        145,        145,        1,   152064, 0xeff10d8e
-0,        146,        146,        1,   152064, 0x6c320de3
-0,        147,        147,        1,   152064, 0xeb683437
-0,        148,        148,        1,   152064, 0xe8a73715
-0,        149,        149,        1,   152064, 0x53a27669
-0,        150,        150,        1,   152064, 0xd5665cdc
-0,        151,        151,        1,   152064, 0x76bc4f86
-0,        152,        152,        1,   152064, 0xb5282913
-0,        153,        153,        1,   152064, 0xf788398b
-0,        154,        154,        1,   152064, 0xa2a74268
-0,        155,        155,        1,   152064, 0x1e8c57c4
-0,        156,        156,        1,   152064, 0x12c0542f
-0,        157,        157,        1,   152064, 0x8dbe9945
-0,        158,        158,        1,   152064, 0x0f7583cd
-0,        159,        159,        1,   152064, 0x814e9e0b
-0,        160,        160,        1,   152064, 0x39575c04
-0,        161,        161,        1,   152064, 0x75a07f38
-0,        162,        162,        1,   152064, 0x8a6247c1
-0,        163,        163,        1,   152064, 0x0f8d606e
-0,        164,        164,        1,   152064, 0x7dcc4169
-0,        165,        165,        1,   152064, 0x039d6df2
-0,        166,        166,        1,   152064, 0x16b779c4
-0,        167,        167,        1,   152064, 0x8b3a9767
-0,        168,        168,        1,   152064, 0x281e6d83
-0,        169,        169,        1,   152064, 0x7d22a528
-0,        170,        170,        1,   152064, 0x93778828
-0,        171,        171,        1,   152064, 0xd54c95fc
-0,        172,        172,        1,   152064, 0xf4e76d9a
-0,        173,        173,        1,   152064, 0xaa7ba3fd
-0,        174,        174,        1,   152064, 0x94d88d91
-0,        175,        175,        1,   152064, 0xa46b9c34
-0,        176,        176,        1,   152064, 0x9dcb4d0c
-0,        177,        177,        1,   152064, 0x347d0983
-0,        178,        178,        1,   152064, 0x870ecd2b
-0,        179,        179,        1,   152064, 0x5dafe6d6
-0,        180,        180,        1,   152064, 0x10d77857
-0,        181,        181,        1,   152064, 0xddc1d127
-0,        182,        182,        1,   152064, 0x2732a13c
-0,        183,        183,        1,   152064, 0x3d81bac9
-0,        184,        184,        1,   152064, 0x619d3dd3
-0,        185,        185,        1,   152064, 0x2db3e1ac
-0,        186,        186,        1,   152064, 0x63a7e7e5
-0,        187,        187,        1,   152064, 0x902a4c92
-0,        188,        188,        1,   152064, 0x9c38e0f6
-0,        189,        189,        1,   152064, 0x8ceb3a46
-0,        190,        190,        1,   152064, 0x73cbb6bd
-0,        191,        191,        1,   152064, 0x5f6fa7d6
-0,        192,        192,        1,   152064, 0x8cdad086
-0,        193,        193,        1,   152064, 0xe7cf083f
-0,        194,        194,        1,   152064, 0x18c0f6b9
-0,        195,        195,        1,   152064, 0xfe582ddf
-0,        196,        196,        1,   152064, 0x5fca4740
-0,        197,        197,        1,   152064, 0x072981ab
-0,        198,        198,        1,   152064, 0xcb874172
-0,        199,        199,        1,   152064, 0xfa153e05
-0,        200,        200,        1,   152064, 0x259ae495
-0,        201,        201,        1,   152064, 0x1714beb4
-0,        202,        202,        1,   152064, 0xa051721e
-0,        203,        203,        1,   152064, 0x52d17b85
-0,        204,        204,        1,   152064, 0x9cbf5da3
-0,        205,        205,        1,   152064, 0x28d69092
-0,        206,        206,        1,   152064, 0xbdb942e7
-0,        207,        207,        1,   152064, 0xeefe2253
-0,        208,        208,        1,   152064, 0xbef2af4d
-0,        209,        209,        1,   152064, 0x622dee36
-0,        210,        210,        1,   152064, 0x61decf4e
-0,        211,        211,        1,   152064, 0x8dfefdbe
-0,        212,        212,        1,   152064, 0x78d67e90
-0,        213,        213,        1,   152064, 0x9cddaa58
-0,        214,        214,        1,   152064, 0x8d487f4d
-0,        215,        215,        1,   152064, 0x67f58715
-0,        216,        216,        1,   152064, 0xc9203f22
-0,        217,        217,        1,   152064, 0x0fec8343
-0,        218,        218,        1,   152064, 0xb57e7b6a
-0,        219,        219,        1,   152064, 0xa2ed7700
-0,        220,        220,        1,   152064, 0x34722cad
-0,        221,        221,        1,   152064, 0x02c83b2a
-0,        222,        222,        1,   152064, 0x91b11583
-0,        223,        223,        1,   152064, 0x7676166d
-0,        224,        224,        1,   152064, 0x76a9d5fc
-0,        225,        225,        1,   152064, 0x4fcd1750
-0,        226,        226,        1,   152064, 0xaa6ff7bf
-0,        227,        227,        1,   152064, 0x5e2bfab6
-0,        228,        228,        1,   152064, 0x3abec811
-0,        229,        229,        1,   152064, 0x0711eb85
-0,        230,        230,        1,   152064, 0xb10ebf41
-0,        231,        231,        1,   152064, 0x32d8cb56
-0,        232,        232,        1,   152064, 0x9b1ca411
-0,        233,        233,        1,   152064, 0x771f0768
-0,        234,        234,        1,   152064, 0x69e1258e
-0,        235,        235,        1,   152064, 0xe8b352e2
-0,        236,        236,        1,   152064, 0x3ee638d8
-0,        237,        237,        1,   152064, 0x0bc48414
-0,        238,        238,        1,   152064, 0xc1df5925
-0,        239,        239,        1,   152064, 0xb30f705e
-0,        240,        240,        1,   152064, 0x90654127
-0,        241,        241,        1,   152064, 0x000e5f43
-0,        242,        242,        1,   152064, 0x1f5e5e15
-0,        243,        243,        1,   152064, 0x4aa48433
-0,        244,        244,        1,   152064, 0xb74a56a3
-0,        245,        245,        1,   152064, 0x94347a06
-0,        246,        246,        1,   152064, 0xd14e58d4
-0,        247,        247,        1,   152064, 0x60116d97
-0,        248,        248,        1,   152064, 0xf2962979
-0,        249,        249,        1,   152064, 0x7f176514
diff --git a/deps/libav/tests/ref/fate/h264-conformance-ls_sva_d b/deps/libav/tests/ref/fate/h264-conformance-ls_sva_d
deleted file mode 100644
index 9d1d219..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-ls_sva_d
+++ /dev/null
@@ -1,1701 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x85d20fc6
-0,          1,          1,        1,    38016, 0xc0432c21
-0,          2,          2,        1,    38016, 0x1450168f
-0,          3,          3,        1,    38016, 0xeddb1833
-0,          4,          4,        1,    38016, 0x631216d4
-0,          5,          5,        1,    38016, 0xfcd1138b
-0,          6,          6,        1,    38016, 0x181f17d5
-0,          7,          7,        1,    38016, 0x3dc91855
-0,          8,          8,        1,    38016, 0x92b71924
-0,          9,          9,        1,    38016, 0xfcb6228d
-0,         10,         10,        1,    38016, 0x11d04b4a
-0,         11,         11,        1,    38016, 0x743a6a06
-0,         12,         12,        1,    38016, 0xac511cc3
-0,         13,         13,        1,    38016, 0x66bc1e2d
-0,         14,         14,        1,    38016, 0x6c761ef3
-0,         15,         15,        1,    38016, 0xa08a1ef5
-0,         16,         16,        1,    38016, 0x777270da
-0,         17,         17,        1,    38016, 0x9a738d9f
-0,         18,         18,        1,    38016, 0x31a8afa2
-0,         19,         19,        1,    38016, 0x1148cc11
-0,         20,         20,        1,    38016, 0xf5fa1f26
-0,         21,         21,        1,    38016, 0xc0481fbc
-0,         22,         22,        1,    38016, 0x461b2228
-0,         23,         23,        1,    38016, 0x27bb209d
-0,         24,         24,        1,    38016, 0xbe921f04
-0,         25,         25,        1,    38016, 0xabdbd493
-0,         26,         26,        1,    38016, 0x4f6ad36e
-0,         27,         27,        1,    38016, 0xe2f8d0ca
-0,         28,         28,        1,    38016, 0xd82aaea2
-0,         29,         29,        1,    38016, 0xb208854b
-0,         30,         30,        1,    38016, 0xfe632920
-0,         31,         31,        1,    38016, 0x1a8128ce
-0,         32,         32,        1,    38016, 0xd9ea2be9
-0,         33,         33,        1,    38016, 0x258b2ab0
-0,         34,         34,        1,    38016, 0xb5812bef
-0,         35,         35,        1,    38016, 0x00c92cdf
-0,         36,         36,        1,    38016, 0x4a6b9f6f
-0,         37,         37,        1,    38016, 0xb589b0a1
-0,         38,         38,        1,    38016, 0xf2d0bbca
-0,         39,         39,        1,    38016, 0xe614cce3
-0,         40,         40,        1,    38016, 0x6d81d01c
-0,         41,         41,        1,    38016, 0x7f32d175
-0,         42,         42,        1,    38016, 0x6abc2f40
-0,         43,         43,        1,    38016, 0x767d2f6a
-0,         44,         44,        1,    38016, 0xd64b30cf
-0,         45,         45,        1,    38016, 0xf83d3000
-0,         46,         46,        1,    38016, 0x5f3230d5
-0,         47,         47,        1,    38016, 0x80b330a0
-0,         48,         48,        1,    38016, 0x42c4326e
-0,         49,         49,        1,    38016, 0x7cb8d069
-0,         50,         50,        1,    38016, 0xb7bb9d2f
-0,         51,         51,        1,    38016, 0xf4f47c47
-0,         52,         52,        1,    38016, 0xe3455aa0
-0,         53,         53,        1,    38016, 0x3b074630
-0,         54,         54,        1,    38016, 0x1fd44e63
-0,         55,         55,        1,    38016, 0x5ecb6a07
-0,         56,         56,        1,    38016, 0xe3a130c9
-0,         57,         57,        1,    38016, 0x307f311a
-0,         58,         58,        1,    38016, 0x4e2d3202
-0,         59,         59,        1,    38016, 0x06ac31c1
-0,         60,         60,        1,    38016, 0x767931ab
-0,         61,         61,        1,    38016, 0xcb6433aa
-0,         62,         62,        1,    38016, 0xc88e3597
-0,         63,         63,        1,    38016, 0xfe06371f
-0,         64,         64,        1,    38016, 0x9e3c8a14
-0,         65,         65,        1,    38016, 0xba819e5b
-0,         66,         66,        1,    38016, 0x0017a693
-0,         67,         67,        1,    38016, 0x25aca2dd
-0,         68,         68,        1,    38016, 0x3bf5980d
-0,         69,         69,        1,    38016, 0x2a0ba2ae
-0,         70,         70,        1,    38016, 0x99e19853
-0,         71,         71,        1,    38016, 0x5e7a9699
-0,         72,         72,        1,    38016, 0x11983c1a
-0,         73,         73,        1,    38016, 0x5ab53cbf
-0,         74,         74,        1,    38016, 0x49803f12
-0,         75,         75,        1,    38016, 0xf1633fdc
-0,         76,         76,        1,    38016, 0x91de3ff3
-0,         77,         77,        1,    38016, 0x418942a1
-0,         78,         78,        1,    38016, 0x670c4277
-0,         79,         79,        1,    38016, 0xc04e403e
-0,         80,         80,        1,    38016, 0xa33e40ad
-0,         81,         81,        1,    38016, 0x7f959a9c
-0,         82,         82,        1,    38016, 0x096696ae
-0,         83,         83,        1,    38016, 0xdb41933c
-0,         84,         84,        1,    38016, 0xb26086b4
-0,         85,         85,        1,    38016, 0x80c97e07
-0,         86,         86,        1,    38016, 0xa7416837
-0,         87,         87,        1,    38016, 0xa82f6342
-0,         88,         88,        1,    38016, 0x8da16527
-0,         89,         89,        1,    38016, 0x1c1965a9
-0,         90,         90,        1,    38016, 0x09ad470c
-0,         91,         91,        1,    38016, 0x3f694725
-0,         92,         92,        1,    38016, 0xa7034699
-0,         93,         93,        1,    38016, 0x38104981
-0,         94,         94,        1,    38016, 0x216048b7
-0,         95,         95,        1,    38016, 0x24e04c22
-0,         96,         96,        1,    38016, 0xbb7e4871
-0,         97,         97,        1,    38016, 0x8c074b97
-0,         98,         98,        1,    38016, 0x92aa4b79
-0,         99,         99,        1,    38016, 0x073c4d97
-0,        100,        100,        1,    38016, 0xe225f953
-0,        101,        101,        1,    38016, 0xcaccf96b
-0,        102,        102,        1,    38016, 0xc395cd82
-0,        103,        103,        1,    38016, 0x8c61ad55
-0,        104,        104,        1,    38016, 0x6fb988f2
-0,        105,        105,        1,    38016, 0x99fe7aea
-0,        106,        106,        1,    38016, 0xab3c73bf
-0,        107,        107,        1,    38016, 0xcdb06bc4
-0,        108,        108,        1,    38016, 0x65a1540a
-0,        109,        109,        1,    38016, 0xc22f4fb0
-0,        110,        110,        1,    38016, 0xe5ca4830
-0,        111,        111,        1,    38016, 0x06b346f9
-0,        112,        112,        1,    38016, 0x02154629
-0,        113,        113,        1,    38016, 0x3d5e4467
-0,        114,        114,        1,    38016, 0x6aa4460c
-0,        115,        115,        1,    38016, 0x05bc47c4
-0,        116,        116,        1,    38016, 0xc46e4666
-0,        117,        117,        1,    38016, 0xc28145f5
-0,        118,        118,        1,    38016, 0xf57f4811
-0,        119,        119,        1,    38016, 0x1bbc49f8
-0,        120,        120,        1,    38016, 0x34e14c2c
-0,        121,        121,        1,    38016, 0x7e7d7740
-0,        122,        122,        1,    38016, 0x97d798f3
-0,        123,        123,        1,    38016, 0x7d71ca3b
-0,        124,        124,        1,    38016, 0xc6bc0776
-0,        125,        125,        1,    38016, 0xda052645
-0,        126,        126,        1,    38016, 0xf0b32de9
-0,        127,        127,        1,    38016, 0x996f23cf
-0,        128,        128,        1,    38016, 0x22ea1a43
-0,        129,        129,        1,    38016, 0xbde61021
-0,        130,        130,        1,    38016, 0x8180079d
-0,        131,        131,        1,    38016, 0x3ac6f314
-0,        132,        132,        1,    38016, 0x93604f67
-0,        133,        133,        1,    38016, 0xb9a55213
-0,        134,        134,        1,    38016, 0x89c8523c
-0,        135,        135,        1,    38016, 0x670a511b
-0,        136,        136,        1,    38016, 0x62395128
-0,        137,        137,        1,    38016, 0x01605431
-0,        138,        138,        1,    38016, 0x677253cd
-0,        139,        139,        1,    38016, 0xc57f56b1
-0,        140,        140,        1,    38016, 0x767f5679
-0,        141,        141,        1,    38016, 0x4abc5717
-0,        142,        142,        1,    38016, 0x838657dc
-0,        143,        143,        1,    38016, 0x63bf56ad
-0,        144,        144,        1,    38016, 0x7019c8ad
-0,        145,        145,        1,    38016, 0xebbaa7bf
-0,        146,        146,        1,    38016, 0xebbc8ddb
-0,        147,        147,        1,    38016, 0xea609f00
-0,        148,        148,        1,    38016, 0x88e6b1e4
-0,        149,        149,        1,    38016, 0x7f9edd6b
-0,        150,        150,        1,    38016, 0xeaf354a6
-0,        151,        151,        1,    38016, 0xf30274c9
-0,        152,        152,        1,    38016, 0x05a756da
-0,        153,        153,        1,    38016, 0xacea1ca6
-0,        154,        154,        1,    38016, 0x1520d86d
-0,        155,        155,        1,    38016, 0xb0f7afa4
-0,        156,        156,        1,    38016, 0xe33c5802
-0,        157,        157,        1,    38016, 0xce2a58cd
-0,        158,        158,        1,    38016, 0xd3ad5a30
-0,        159,        159,        1,    38016, 0x29aa5955
-0,        160,        160,        1,    38016, 0x59015aef
-0,        161,        161,        1,    38016, 0x247c5a72
-0,        162,        162,        1,    38016, 0x79a85b27
-0,        163,        163,        1,    38016, 0x6cf858fe
-0,        164,        164,        1,    38016, 0x78ec5b20
-0,        165,        165,        1,    38016, 0x7cb158c5
-0,        166,        166,        1,    38016, 0xc52c581f
-0,        167,        167,        1,    38016, 0x125c58bd
-0,        168,        168,        1,    38016, 0xf8b257c9
-0,        169,        169,        1,    38016, 0x20329756
-0,        170,        170,        1,    38016, 0x60a07c12
-0,        171,        171,        1,    38016, 0xa2c26ad1
-0,        172,        172,        1,    38016, 0xcbbc681b
-0,        173,        173,        1,    38016, 0x2c0562ad
-0,        174,        174,        1,    38016, 0x8a72640d
-0,        175,        175,        1,    38016, 0xe6e7756a
-0,        176,        176,        1,    38016, 0x64608a48
-0,        177,        177,        1,    38016, 0xe9bea9fa
-0,        178,        178,        1,    38016, 0x24bac776
-0,        179,        179,        1,    38016, 0x6aa9d01b
-0,        180,        180,        1,    38016, 0xf41ebb02
-0,        181,        181,        1,    38016, 0x28017154
-0,        182,        182,        1,    38016, 0x3fc55eb4
-0,        183,        183,        1,    38016, 0xe7bc5f22
-0,        184,        184,        1,    38016, 0xe6706162
-0,        185,        185,        1,    38016, 0xee385fe2
-0,        186,        186,        1,    38016, 0x79c0600b
-0,        187,        187,        1,    38016, 0x735a603f
-0,        188,        188,        1,    38016, 0xe7916199
-0,        189,        189,        1,    38016, 0x542d601d
-0,        190,        190,        1,    38016, 0xbfaa611a
-0,        191,        191,        1,    38016, 0xb7504e05
-0,        192,        192,        1,    38016, 0xd1964339
-0,        193,        193,        1,    38016, 0x4213278a
-0,        194,        194,        1,    38016, 0xb503229f
-0,        195,        195,        1,    38016, 0x166a091c
-0,        196,        196,        1,    38016, 0x37176bbc
-0,        197,        197,        1,    38016, 0x95977cc3
-0,        198,        198,        1,    38016, 0x5bab93f4
-0,        199,        199,        1,    38016, 0x71d5d142
-0,        200,        200,        1,    38016, 0x97d1cfa6
-0,        201,        201,        1,    38016, 0xac82ff20
-0,        202,        202,        1,    38016, 0x489a1fa1
-0,        203,        203,        1,    38016, 0x32944930
-0,        204,        204,        1,    38016, 0x72a2647c
-0,        205,        205,        1,    38016, 0x95b685d6
-0,        206,        206,        1,    38016, 0xb7e19840
-0,        207,        207,        1,    38016, 0x85569129
-0,        208,        208,        1,    38016, 0x6bc6a197
-0,        209,        209,        1,    38016, 0x55ccace8
-0,        210,        210,        1,    38016, 0x9bbdc9c2
-0,        211,        211,        1,    38016, 0xbce4ade3
-0,        212,        212,        1,    38016, 0x39c7c48a
-0,        213,        213,        1,    38016, 0x498ac4aa
-0,        214,        214,        1,    38016, 0xeda3b715
-0,        215,        215,        1,    38016, 0x700db089
-0,        216,        216,        1,    38016, 0xf6b6bf36
-0,        217,        217,        1,    38016, 0x6abebf1c
-0,        218,        218,        1,    38016, 0x8855c17c
-0,        219,        219,        1,    38016, 0xfba09dd5
-0,        220,        220,        1,    38016, 0xd5868240
-0,        221,        221,        1,    38016, 0x438074a2
-0,        222,        222,        1,    38016, 0xc8b2c501
-0,        223,        223,        1,    38016, 0xd48ec1ef
-0,        224,        224,        1,    38016, 0xa715c4be
-0,        225,        225,        1,    38016, 0xd758c281
-0,        226,        226,        1,    38016, 0x07c25900
-0,        227,        227,        1,    38016, 0xee7950e6
-0,        228,        228,        1,    38016, 0x3e154be9
-0,        229,        229,        1,    38016, 0xa8f33bb7
-0,        230,        230,        1,    38016, 0xf493bc3c
-0,        231,        231,        1,    38016, 0x9d69bccb
-0,        232,        232,        1,    38016, 0xbf9fbafa
-0,        233,        233,        1,    38016, 0x2e62b9a8
-0,        234,        234,        1,    38016, 0x2f41bae1
-0,        235,        235,        1,    38016, 0xd820355d
-0,        236,        236,        1,    38016, 0xf3623118
-0,        237,        237,        1,    38016, 0x659b4459
-0,        238,        238,        1,    38016, 0xdcd74654
-0,        239,        239,        1,    38016, 0x73f33f73
-0,        240,        240,        1,    38016, 0xbf96b5ec
-0,        241,        241,        1,    38016, 0xe9ebb550
-0,        242,        242,        1,    38016, 0xfe12b5dd
-0,        243,        243,        1,    38016, 0x9908b6d5
-0,        244,        244,        1,    38016, 0xe805b8cf
-0,        245,        245,        1,    38016, 0x1a8eb68a
-0,        246,        246,        1,    38016, 0x6aed288d
-0,        247,        247,        1,    38016, 0x162f167f
-0,        248,        248,        1,    38016, 0x49110ae5
-0,        249,        249,        1,    38016, 0xab060059
-0,        250,        250,        1,    38016, 0x0fb8a0a8
-0,        251,        251,        1,    38016, 0xf3b0b384
-0,        252,        252,        1,    38016, 0x6f32bb1b
-0,        253,        253,        1,    38016, 0x7278bb3a
-0,        254,        254,        1,    38016, 0xdeb1bdcf
-0,        255,        255,        1,    38016, 0x90efbc5c
-0,        256,        256,        1,    38016, 0xd2f6bb28
-0,        257,        257,        1,    38016, 0xba4dba32
-0,        258,        258,        1,    38016, 0x0751ba19
-0,        259,        259,        1,    38016, 0xc3f7b9db
-0,        260,        260,        1,    38016, 0xca22c433
-0,        261,        261,        1,    38016, 0x82a7e336
-0,        262,        262,        1,    38016, 0x45e90a19
-0,        263,        263,        1,    38016, 0x82cd2c11
-0,        264,        264,        1,    38016, 0x4e2e56cc
-0,        265,        265,        1,    38016, 0x0ad281c6
-0,        266,        266,        1,    38016, 0x8685b8b7
-0,        267,        267,        1,    38016, 0xe502b7b3
-0,        268,        268,        1,    38016, 0x4898b696
-0,        269,        269,        1,    38016, 0xe0fcb729
-0,        270,        270,        1,    38016, 0xe5e0b822
-0,        271,        271,        1,    38016, 0x9030b82c
-0,        272,        272,        1,    38016, 0x7dc6b93c
-0,        273,        273,        1,    38016, 0x727cb981
-0,        274,        274,        1,    38016, 0xb08999c9
-0,        275,        275,        1,    38016, 0x3e54b6d7
-0,        276,        276,        1,    38016, 0x5d15c1e2
-0,        277,        277,        1,    38016, 0x5840d8d7
-0,        278,        278,        1,    38016, 0x1109d730
-0,        279,        279,        1,    38016, 0xb898c47e
-0,        280,        280,        1,    38016, 0xbde196c6
-0,        281,        281,        1,    38016, 0x75999430
-0,        282,        282,        1,    38016, 0xa17db11e
-0,        283,        283,        1,    38016, 0xb428b220
-0,        284,        284,        1,    38016, 0x1537b1ed
-0,        285,        285,        1,    38016, 0x102ab213
-0,        286,        286,        1,    38016, 0xee38af9e
-0,        287,        287,        1,    38016, 0xc9c5b34e
-0,        288,        288,        1,    38016, 0x8618af6d
-0,        289,        289,        1,    38016, 0x97f3af7a
-0,        290,        290,        1,    38016, 0x222eb095
-0,        291,        291,        1,    38016, 0xb1508324
-0,        292,        292,        1,    38016, 0x2149ad09
-0,        293,        293,        1,    38016, 0x67261443
-0,        294,        294,        1,    38016, 0x90918df5
-0,        295,        295,        1,    38016, 0x5d43e726
-0,        296,        296,        1,    38016, 0x1d77dfa3
-0,        297,        297,        1,    38016, 0xa60b941c
-0,        298,        298,        1,    38016, 0x48813a99
-0,        299,        299,        1,    38016, 0x2324b77a
-0,        300,        300,        1,    38016, 0xdfd99d0d
-0,        301,        301,        1,    38016, 0x44129be1
-0,        302,        302,        1,    38016, 0x1137a099
-0,        303,        303,        1,    38016, 0xbd24a0a1
-0,        304,        304,        1,    38016, 0x3883a310
-0,        305,        305,        1,    38016, 0x0680a358
-0,        306,        306,        1,    38016, 0xf333a501
-0,        307,        307,        1,    38016, 0x3945a6ac
-0,        308,        308,        1,    38016, 0x79eea741
-0,        309,        309,        1,    38016, 0x8c7aa6b0
-0,        310,        310,        1,    38016, 0x0342642f
-0,        311,        311,        1,    38016, 0x83632b63
-0,        312,        312,        1,    38016, 0x1503ff51
-0,        313,        313,        1,    38016, 0xa4bcea0f
-0,        314,        314,        1,    38016, 0x37dcd11b
-0,        315,        315,        1,    38016, 0x9aa7287a
-0,        316,        316,        1,    38016, 0x34deae76
-0,        317,        317,        1,    38016, 0x51710057
-0,        318,        318,        1,    38016, 0x9ee6fc0a
-0,        319,        319,        1,    38016, 0xa419ea79
-0,        320,        320,        1,    38016, 0x49388f7e
-0,        321,        321,        1,    38016, 0x08498b2d
-0,        322,        322,        1,    38016, 0x104f8c4d
-0,        323,        323,        1,    38016, 0xdb998d74
-0,        324,        324,        1,    38016, 0xd54e8c95
-0,        325,        325,        1,    38016, 0x54a48e5e
-0,        326,        326,        1,    38016, 0xbe6f8cd0
-0,        327,        327,        1,    38016, 0x2a7f8ec2
-0,        328,        328,        1,    38016, 0x23848f19
-0,        329,        329,        1,    38016, 0x9b168ee3
-0,        330,        330,        1,    38016, 0xc2628fb6
-0,        331,        331,        1,    38016, 0xe2bdfd4e
-0,        332,        332,        1,    38016, 0xfdae1546
-0,        333,        333,        1,    38016, 0xb1fe20db
-0,        334,        334,        1,    38016, 0x5ebf23f0
-0,        335,        335,        1,    38016, 0xecbc1fcb
-0,        336,        336,        1,    38016, 0xe72e141c
-0,        337,        337,        1,    38016, 0xbad7f54d
-0,        338,        338,        1,    38016, 0x95ead3c6
-0,        339,        339,        1,    38016, 0xf5c6b948
-0,        340,        340,        1,    38016, 0x2f8b80ab
-0,        341,        341,        1,    38016, 0x0aed47a7
-0,        342,        342,        1,    38016, 0xdcb278e3
-0,        343,        343,        1,    38016, 0x2a677958
-0,        344,        344,        1,    38016, 0x45427ae8
-0,        345,        345,        1,    38016, 0xebce78de
-0,        346,        346,        1,    38016, 0xaf007bb1
-0,        347,        347,        1,    38016, 0xb4677cdb
-0,        348,        348,        1,    38016, 0xbf6d8024
-0,        349,        349,        1,    38016, 0xb67180de
-0,        350,        350,        1,    38016, 0xb1581358
-0,        351,        351,        1,    38016, 0x258f140d
-0,        352,        352,        1,    38016, 0x753d17e6
-0,        353,        353,        1,    38016, 0xf33816b4
-0,        354,        354,        1,    38016, 0x0d011c76
-0,        355,        355,        1,    38016, 0x48cfd85d
-0,        356,        356,        1,    38016, 0x13ce822d
-0,        357,        357,        1,    38016, 0x221a4468
-0,        358,        358,        1,    38016, 0x11364be7
-0,        359,        359,        1,    38016, 0xafc047b0
-0,        360,        360,        1,    38016, 0xeafd4217
-0,        361,        361,        1,    38016, 0x930b8a41
-0,        362,        362,        1,    38016, 0x2dda0bd2
-0,        363,        363,        1,    38016, 0x461cc3f2
-0,        364,        364,        1,    38016, 0xa99e962a
-0,        365,        365,        1,    38016, 0xc1d954ba
-0,        366,        366,        1,    38016, 0x0ce91a87
-0,        367,        367,        1,    38016, 0x10701e2d
-0,        368,        368,        1,    38016, 0x98c22205
-0,        369,        369,        1,    38016, 0xb76622f1
-0,        370,        370,        1,    38016, 0x6d1a22d4
-0,        371,        371,        1,    38016, 0x00ee23c5
-0,        372,        372,        1,    38016, 0xc38125e6
-0,        373,        373,        1,    38016, 0x8de52597
-0,        374,        374,        1,    38016, 0xec282293
-0,        375,        375,        1,    38016, 0xb50f2238
-0,        376,        376,        1,    38016, 0xbdcf1f9f
-0,        377,        377,        1,    38016, 0x5c6c1780
-0,        378,        378,        1,    38016, 0x41941237
-0,        379,        379,        1,    38016, 0x95ee1e69
-0,        380,        380,        1,    38016, 0x84b65009
-0,        381,        381,        1,    38016, 0x27bbf0ab
-0,        382,        382,        1,    38016, 0xdd86f4fb
-0,        383,        383,        1,    38016, 0x97733086
-0,        384,        384,        1,    38016, 0x3241472f
-0,        385,        385,        1,    38016, 0x5d050c50
-0,        386,        386,        1,    38016, 0x8378aa9b
-0,        387,        387,        1,    38016, 0x94f174cd
-0,        388,        388,        1,    38016, 0x5825df16
-0,        389,        389,        1,    38016, 0x5f362875
-0,        390,        390,        1,    38016, 0x30704cd6
-0,        391,        391,        1,    38016, 0xc74e3614
-0,        392,        392,        1,    38016, 0xe033eb04
-0,        393,        393,        1,    38016, 0x665be967
-0,        394,        394,        1,    38016, 0x95d5ed67
-0,        395,        395,        1,    38016, 0x37dfefc1
-0,        396,        396,        1,    38016, 0x1908ee8e
-0,        397,        397,        1,    38016, 0xf0cfee38
-0,        398,        398,        1,    38016, 0x871df078
-0,        399,        399,        1,    38016, 0xb2f2f0f9
-0,        400,        400,        1,    38016, 0xf955621f
-0,        401,        401,        1,    38016, 0xbd2365a5
-0,        402,        402,        1,    38016, 0xe70d6bb0
-0,        403,        403,        1,    38016, 0x857e6d00
-0,        404,        404,        1,    38016, 0x000d6ee5
-0,        405,        405,        1,    38016, 0x9a2f7244
-0,        406,        406,        1,    38016, 0xe8c2f83c
-0,        407,        407,        1,    38016, 0x23eb0377
-0,        408,        408,        1,    38016, 0xe0802a7f
-0,        409,        409,        1,    38016, 0x5dbc4d69
-0,        410,        410,        1,    38016, 0xa3031f36
-0,        411,        411,        1,    38016, 0x27fbb378
-0,        412,        412,        1,    38016, 0xeee9a313
-0,        413,        413,        1,    38016, 0x189b1e68
-0,        414,        414,        1,    38016, 0x9a90678a
-0,        415,        415,        1,    38016, 0x1a65ed20
-0,        416,        416,        1,    38016, 0x2f51beb7
-0,        417,        417,        1,    38016, 0x671ada9d
-0,        418,        418,        1,    38016, 0x30af355a
-0,        419,        419,        1,    38016, 0x1804d4f9
-0,        420,        420,        1,    38016, 0xee227951
-0,        421,        421,        1,    38016, 0x20dc3900
-0,        422,        422,        1,    38016, 0x334f82dc
-0,        423,        423,        1,    38016, 0xb1728506
-0,        424,        424,        1,    38016, 0x2236fc10
-0,        425,        425,        1,    38016, 0x80d2964d
-0,        426,        426,        1,    38016, 0x5e368712
-0,        427,        427,        1,    38016, 0x10408765
-0,        428,        428,        1,    38016, 0x4b3084c5
-0,        429,        429,        1,    38016, 0x975c473f
-0,        430,        430,        1,    38016, 0x6f16efa3
-0,        431,        431,        1,    38016, 0xe73aac5e
-0,        432,        432,        1,    38016, 0x996b6e24
-0,        433,        433,        1,    38016, 0x424f6f55
-0,        434,        434,        1,    38016, 0x33786d10
-0,        435,        435,        1,    38016, 0x8a0f6870
-0,        436,        436,        1,    38016, 0x5e8556d4
-0,        437,        437,        1,    38016, 0x863b2366
-0,        438,        438,        1,    38016, 0x3fa74842
-0,        439,        439,        1,    38016, 0x70208948
-0,        440,        440,        1,    38016, 0xcf005140
-0,        441,        441,        1,    38016, 0xa7585013
-0,        442,        442,        1,    38016, 0x61145096
-0,        443,        443,        1,    38016, 0x92b952a5
-0,        444,        444,        1,    38016, 0x35575235
-0,        445,        445,        1,    38016, 0x3e47ec63
-0,        446,        446,        1,    38016, 0xfce57b69
-0,        447,        447,        1,    38016, 0xf03815e6
-0,        448,        448,        1,    38016, 0xb5b6af64
-0,        449,        449,        1,    38016, 0x5e3f1b08
-0,        450,        450,        1,    38016, 0xd3f9ee61
-0,        451,        451,        1,    38016, 0xb8e2ee66
-0,        452,        452,        1,    38016, 0x86f8f4b5
-0,        453,        453,        1,    38016, 0x23c8f499
-0,        454,        454,        1,    38016, 0x634df498
-0,        455,        455,        1,    38016, 0xd2b3f570
-0,        456,        456,        1,    38016, 0x053e67d3
-0,        457,        457,        1,    38016, 0x8d2cbeb3
-0,        458,        458,        1,    38016, 0xba0b1e1c
-0,        459,        459,        1,    38016, 0x0f5c7d73
-0,        460,        460,        1,    38016, 0x46b2118a
-0,        461,        461,        1,    38016, 0x818ebae5
-0,        462,        462,        1,    38016, 0x4a7af8a9
-0,        463,        463,        1,    38016, 0x0c22f937
-0,        464,        464,        1,    38016, 0x967ef9b3
-0,        465,        465,        1,    38016, 0x530afd34
-0,        466,        466,        1,    38016, 0x2a00fdb6
-0,        467,        467,        1,    38016, 0xca14f913
-0,        468,        468,        1,    38016, 0x82b6f7bc
-0,        469,        469,        1,    38016, 0xd32879ec
-0,        470,        470,        1,    38016, 0x242b6920
-0,        471,        471,        1,    38016, 0x44fd66e4
-0,        472,        472,        1,    38016, 0x69d3479c
-0,        473,        473,        1,    38016, 0x41a63899
-0,        474,        474,        1,    38016, 0xfb370720
-0,        475,        475,        1,    38016, 0x5cf0f42d
-0,        476,        476,        1,    38016, 0x74e8ca33
-0,        477,        477,        1,    38016, 0x1f09cb30
-0,        478,        478,        1,    38016, 0xc5e8c1d8
-0,        479,        479,        1,    38016, 0x3a82bd74
-0,        480,        480,        1,    38016, 0xada0bd71
-0,        481,        481,        1,    38016, 0xe695bcc9
-0,        482,        482,        1,    38016, 0xc255bb45
-0,        483,        483,        1,    38016, 0x6deebbcd
-0,        484,        484,        1,    38016, 0x6bf5cef2
-0,        485,        485,        1,    38016, 0x8eaed078
-0,        486,        486,        1,    38016, 0x3a8addb0
-0,        487,        487,        1,    38016, 0x0f2bfe11
-0,        488,        488,        1,    38016, 0xe13d2e3b
-0,        489,        489,        1,    38016, 0x9bb7606f
-0,        490,        490,        1,    38016, 0x9fcc8899
-0,        491,        491,        1,    38016, 0xfa22a313
-0,        492,        492,        1,    38016, 0xc599b318
-0,        493,        493,        1,    38016, 0x33ecb361
-0,        494,        494,        1,    38016, 0x2ba8b2df
-0,        495,        495,        1,    38016, 0x0debb343
-0,        496,        496,        1,    38016, 0x8bbcb7cd
-0,        497,        497,        1,    38016, 0x093fbb20
-0,        498,        498,        1,    38016, 0x4340c0d2
-0,        499,        499,        1,    38016, 0xd765bcb8
-0,        500,        500,        1,    38016, 0xe9ea3103
-0,        501,        501,        1,    38016, 0x24d7a1ae
-0,        502,        502,        1,    38016, 0x9b9ac80f
-0,        503,        503,        1,    38016, 0x81b7da0c
-0,        504,        504,        1,    38016, 0xb7c5f017
-0,        505,        505,        1,    38016, 0xa0e9f9c1
-0,        506,        506,        1,    38016, 0x932111a9
-0,        507,        507,        1,    38016, 0x15fc17ba
-0,        508,        508,        1,    38016, 0x3c7710bd
-0,        509,        509,        1,    38016, 0xae1b0ba8
-0,        510,        510,        1,    38016, 0x7dc24093
-0,        511,        511,        1,    38016, 0x8b9042ad
-0,        512,        512,        1,    38016, 0x257f4c1c
-0,        513,        513,        1,    38016, 0xaa0442d8
-0,        514,        514,        1,    38016, 0xbedd462c
-0,        515,        515,        1,    38016, 0xa9bd4905
-0,        516,        516,        1,    38016, 0x69d74f50
-0,        517,        517,        1,    38016, 0x18143c0d
-0,        518,        518,        1,    38016, 0xd2eb5820
-0,        519,        519,        1,    38016, 0x94fb5e93
-0,        520,        520,        1,    38016, 0x3072f80d
-0,        521,        521,        1,    38016, 0xd838f186
-0,        522,        522,        1,    38016, 0x3e41e695
-0,        523,        523,        1,    38016, 0x66eef2cd
-0,        524,        524,        1,    38016, 0x3854ec56
-0,        525,        525,        1,    38016, 0x05d3f9c2
-0,        526,        526,        1,    38016, 0x53820cc3
-0,        527,        527,        1,    38016, 0x09d413ea
-0,        528,        528,        1,    38016, 0x82f217f2
-0,        529,        529,        1,    38016, 0x07b21d50
-0,        530,        530,        1,    38016, 0xd72155c2
-0,        531,        531,        1,    38016, 0x20b04c74
-0,        532,        532,        1,    38016, 0x5b8962f6
-0,        533,        533,        1,    38016, 0xfb8b72c9
-0,        534,        534,        1,    38016, 0x6d0f56a7
-0,        535,        535,        1,    38016, 0x97876300
-0,        536,        536,        1,    38016, 0xfd7f655f
-0,        537,        537,        1,    38016, 0x3e405ff6
-0,        538,        538,        1,    38016, 0x5ad27a20
-0,        539,        539,        1,    38016, 0x46125305
-0,        540,        540,        1,    38016, 0x91017b86
-0,        541,        541,        1,    38016, 0x5c150c66
-0,        542,        542,        1,    38016, 0xc3430969
-0,        543,        543,        1,    38016, 0x5f400689
-0,        544,        544,        1,    38016, 0x21ddf969
-0,        545,        545,        1,    38016, 0x5feff594
-0,        546,        546,        1,    38016, 0xb304f3c1
-0,        547,        547,        1,    38016, 0xa9c3f70e
-0,        548,        548,        1,    38016, 0x6014fa8e
-0,        549,        549,        1,    38016, 0x7198f22e
-0,        550,        550,        1,    38016, 0xe338e495
-0,        551,        551,        1,    38016, 0x9a69ea32
-0,        552,        552,        1,    38016, 0xc0cc5d05
-0,        553,        553,        1,    38016, 0xefa16044
-0,        554,        554,        1,    38016, 0x3e3c6120
-0,        555,        555,        1,    38016, 0x06ef63e1
-0,        556,        556,        1,    38016, 0x25d5631f
-0,        557,        557,        1,    38016, 0xbc8963ee
-0,        558,        558,        1,    38016, 0xc2336218
-0,        559,        559,        1,    38016, 0xb23965fd
-0,        560,        560,        1,    38016, 0x84c9651f
-0,        561,        561,        1,    38016, 0x41f6647a
-0,        562,        562,        1,    38016, 0xddbe6572
-0,        563,        563,        1,    38016, 0x113f65f2
-0,        564,        564,        1,    38016, 0x89beec24
-0,        565,        565,        1,    38016, 0x6490f37b
-0,        566,        566,        1,    38016, 0x15ecf84d
-0,        567,        567,        1,    38016, 0xa439f491
-0,        568,        568,        1,    38016, 0xda8bf5c4
-0,        569,        569,        1,    38016, 0x6bc2f96a
-0,        570,        570,        1,    38016, 0x243d0bac
-0,        571,        571,        1,    38016, 0xb7c611a2
-0,        572,        572,        1,    38016, 0x99243328
-0,        573,        573,        1,    38016, 0xa9534571
-0,        574,        574,        1,    38016, 0xa5a657bd
-0,        575,        575,        1,    38016, 0xd8d06892
-0,        576,        576,        1,    38016, 0xb4eb6c8d
-0,        577,        577,        1,    38016, 0xa3d36ca8
-0,        578,        578,        1,    38016, 0x153a6e9e
-0,        579,        579,        1,    38016, 0xf2607081
-0,        580,        580,        1,    38016, 0x799d7081
-0,        581,        581,        1,    38016, 0x377570cd
-0,        582,        582,        1,    38016, 0x90496e54
-0,        583,        583,        1,    38016, 0x1d4c746c
-0,        584,        584,        1,    38016, 0xbe5e72bb
-0,        585,        585,        1,    38016, 0x3c6a760d
-0,        586,        586,        1,    38016, 0xd4097614
-0,        587,        587,        1,    38016, 0xf45a7a28
-0,        588,        588,        1,    38016, 0x8fe37bb8
-0,        589,        589,        1,    38016, 0x966295dc
-0,        590,        590,        1,    38016, 0xb40da3df
-0,        591,        591,        1,    38016, 0x9714b2ac
-0,        592,        592,        1,    38016, 0xbdb3c61d
-0,        593,        593,        1,    38016, 0x12fcd320
-0,        594,        594,        1,    38016, 0x1ee8d858
-0,        595,        595,        1,    38016, 0x49e5e217
-0,        596,        596,        1,    38016, 0x92aef38e
-0,        597,        597,        1,    38016, 0xc26c0476
-0,        598,        598,        1,    38016, 0x8eed0e04
-0,        599,        599,        1,    38016, 0xe4e3118d
-0,        600,        600,        1,    38016, 0x282ce796
-0,        601,        601,        1,    38016, 0xbec801e1
-0,        602,        602,        1,    38016, 0x864afaf2
-0,        603,        603,        1,    38016, 0xe0860383
-0,        604,        604,        1,    38016, 0x4261001d
-0,        605,        605,        1,    38016, 0x976c0005
-0,        606,        606,        1,    38016, 0x69c40af3
-0,        607,        607,        1,    38016, 0xb3c00e18
-0,        608,        608,        1,    38016, 0x28300c2c
-0,        609,        609,        1,    38016, 0xf2d9ff9d
-0,        610,        610,        1,    38016, 0xcaeaf979
-0,        611,        611,        1,    38016, 0x6733f58e
-0,        612,        612,        1,    38016, 0x2bb80869
-0,        613,        613,        1,    38016, 0x3c370085
-0,        614,        614,        1,    38016, 0x11a2fa2a
-0,        615,        615,        1,    38016, 0x828ff770
-0,        616,        616,        1,    38016, 0x79bcf490
-0,        617,        617,        1,    38016, 0x31d5ee87
-0,        618,        618,        1,    38016, 0x6336f00d
-0,        619,        619,        1,    38016, 0x058af9d1
-0,        620,        620,        1,    38016, 0xff29eb2f
-0,        621,        621,        1,    38016, 0x3c3be1f4
-0,        622,        622,        1,    38016, 0xfbf5ddc2
-0,        623,        623,        1,    38016, 0x22a4d324
-0,        624,        624,        1,    38016, 0xb2d4d1d4
-0,        625,        625,        1,    38016, 0xa159171f
-0,        626,        626,        1,    38016, 0x61a80251
-0,        627,        627,        1,    38016, 0xe0429283
-0,        628,        628,        1,    38016, 0x5c255bd4
-0,        629,        629,        1,    38016, 0xdb0f57ac
-0,        630,        630,        1,    38016, 0x3c8bcbf0
-0,        631,        631,        1,    38016, 0x2be3d2ef
-0,        632,        632,        1,    38016, 0xcd2dc8cc
-0,        633,        633,        1,    38016, 0x6905c4cf
-0,        634,        634,        1,    38016, 0xd9c9c590
-0,        635,        635,        1,    38016, 0xa945cb51
-0,        636,        636,        1,    38016, 0x5c8458d3
-0,        637,        637,        1,    38016, 0xa1624b6e
-0,        638,        638,        1,    38016, 0xb167532e
-0,        639,        639,        1,    38016, 0x149d6413
-0,        640,        640,        1,    38016, 0x85d97340
-0,        641,        641,        1,    38016, 0x8f478203
-0,        642,        642,        1,    38016, 0x1902cc8e
-0,        643,        643,        1,    38016, 0x1521c5e5
-0,        644,        644,        1,    38016, 0xf2d6c7d8
-0,        645,        645,        1,    38016, 0x7150c510
-0,        646,        646,        1,    38016, 0xfc0ec330
-0,        647,        647,        1,    38016, 0x91c4c933
-0,        648,        648,        1,    38016, 0x5ec6cbc8
-0,        649,        649,        1,    38016, 0x23c0955c
-0,        650,        650,        1,    38016, 0x76fb7c27
-0,        651,        651,        1,    38016, 0x33c07597
-0,        652,        652,        1,    38016, 0x797b6acd
-0,        653,        653,        1,    38016, 0xc4945313
-0,        654,        654,        1,    38016, 0xa50f25da
-0,        655,        655,        1,    38016, 0x7bb6096c
-0,        656,        656,        1,    38016, 0x8a1acc48
-0,        657,        657,        1,    38016, 0x19a1c9b4
-0,        658,        658,        1,    38016, 0x4436cd03
-0,        659,        659,        1,    38016, 0xfd73d6fe
-0,        660,        660,        1,    38016, 0x25d3d4f0
-0,        661,        661,        1,    38016, 0x3acfcd98
-0,        662,        662,        1,    38016, 0x2ed3d071
-0,        663,        663,        1,    38016, 0x246fd4bd
-0,        664,        664,        1,    38016, 0x3e410c62
-0,        665,        665,        1,    38016, 0x29da1177
-0,        666,        666,        1,    38016, 0x039f1e46
-0,        667,        667,        1,    38016, 0x178d1e1a
-0,        668,        668,        1,    38016, 0x75561d47
-0,        669,        669,        1,    38016, 0x7d65193c
-0,        670,        670,        1,    38016, 0xd38d19a8
-0,        671,        671,        1,    38016, 0x39c92b20
-0,        672,        672,        1,    38016, 0x6c8aebc3
-0,        673,        673,        1,    38016, 0xd8d4f9be
-0,        674,        674,        1,    38016, 0x7e730a4a
-0,        675,        675,        1,    38016, 0xbfae1fee
-0,        676,        676,        1,    38016, 0x398f3484
-0,        677,        677,        1,    38016, 0xd8e84019
-0,        678,        678,        1,    38016, 0x2cf64db3
-0,        679,        679,        1,    38016, 0x7e074f09
-0,        680,        680,        1,    38016, 0xac384b5a
-0,        681,        681,        1,    38016, 0xd28b3a83
-0,        682,        682,        1,    38016, 0xa5ce5610
-0,        683,        683,        1,    38016, 0xde8565f7
-0,        684,        684,        1,    38016, 0x01397a1a
-0,        685,        685,        1,    38016, 0xdbdf7fb7
-0,        686,        686,        1,    38016, 0x8c1f8ba6
-0,        687,        687,        1,    38016, 0xab2a943c
-0,        688,        688,        1,    38016, 0x4f8b8421
-0,        689,        689,        1,    38016, 0x36f57b3a
-0,        690,        690,        1,    38016, 0x565c4dd9
-0,        691,        691,        1,    38016, 0x53c34715
-0,        692,        692,        1,    38016, 0x38fd4aaa
-0,        693,        693,        1,    38016, 0x4dca43eb
-0,        694,        694,        1,    38016, 0x1afe40f3
-0,        695,        695,        1,    38016, 0xc3dc43cc
-0,        696,        696,        1,    38016, 0x1d92431d
-0,        697,        697,        1,    38016, 0x3f794765
-0,        698,        698,        1,    38016, 0x1c5d4a71
-0,        699,        699,        1,    38016, 0xb601531e
-0,        700,        700,        1,    38016, 0x4d925d7c
-0,        701,        701,        1,    38016, 0x1c605f1e
-0,        702,        702,        1,    38016, 0x50ff5608
-0,        703,        703,        1,    38016, 0x8da14815
-0,        704,        704,        1,    38016, 0x53cc3007
-0,        705,        705,        1,    38016, 0x5ce82198
-0,        706,        706,        1,    38016, 0x074e15bc
-0,        707,        707,        1,    38016, 0x59fb13c9
-0,        708,        708,        1,    38016, 0xe28e13a6
-0,        709,        709,        1,    38016, 0xcb4f3fa8
-0,        710,        710,        1,    38016, 0x7fad560c
-0,        711,        711,        1,    38016, 0x7dbc614a
-0,        712,        712,        1,    38016, 0xe96f6d9c
-0,        713,        713,        1,    38016, 0xf3c47a74
-0,        714,        714,        1,    38016, 0xd2af8027
-0,        715,        715,        1,    38016, 0x504779d1
-0,        716,        716,        1,    38016, 0x876e7f5f
-0,        717,        717,        1,    38016, 0x959f8c3d
-0,        718,        718,        1,    38016, 0x64d690be
-0,        719,        719,        1,    38016, 0xdb899760
-0,        720,        720,        1,    38016, 0xbd229ba1
-0,        721,        721,        1,    38016, 0xdace575b
-0,        722,        722,        1,    38016, 0xfda46324
-0,        723,        723,        1,    38016, 0x57b75dbd
-0,        724,        724,        1,    38016, 0x264a59cf
-0,        725,        725,        1,    38016, 0xfde95cc8
-0,        726,        726,        1,    38016, 0x5116601b
-0,        727,        727,        1,    38016, 0x72e67205
-0,        728,        728,        1,    38016, 0xf1057674
-0,        729,        729,        1,    38016, 0x7e917eb9
-0,        730,        730,        1,    38016, 0x50ed8b28
-0,        731,        731,        1,    38016, 0x357a826c
-0,        732,        732,        1,    38016, 0xd68fa449
-0,        733,        733,        1,    38016, 0x3a839e39
-0,        734,        734,        1,    38016, 0x79469a1b
-0,        735,        735,        1,    38016, 0xa9ca9590
-0,        736,        736,        1,    38016, 0xbf399686
-0,        737,        737,        1,    38016, 0x40499eaf
-0,        738,        738,        1,    38016, 0x9972a76d
-0,        739,        739,        1,    38016, 0xa3d0aff4
-0,        740,        740,        1,    38016, 0xdf27b647
-0,        741,        741,        1,    38016, 0x4147c66e
-0,        742,        742,        1,    38016, 0x1378d1db
-0,        743,        743,        1,    38016, 0x1ca3d444
-0,        744,        744,        1,    38016, 0x464d9538
-0,        745,        745,        1,    38016, 0xaed28de9
-0,        746,        746,        1,    38016, 0xc77a9f86
-0,        747,        747,        1,    38016, 0x0882aa10
-0,        748,        748,        1,    38016, 0x206ac330
-0,        749,        749,        1,    38016, 0x63efd763
-0,        750,        750,        1,    38016, 0xbfe2e663
-0,        751,        751,        1,    38016, 0xfe6ff1ad
-0,        752,        752,        1,    38016, 0x60f9f47e
-0,        753,        753,        1,    38016, 0xba1cf0c0
-0,        754,        754,        1,    38016, 0x1880eb3d
-0,        755,        755,        1,    38016, 0xf0fdd350
-0,        756,        756,        1,    38016, 0xb678eedb
-0,        757,        757,        1,    38016, 0xa17cf5e4
-0,        758,        758,        1,    38016, 0x567fff2a
-0,        759,        759,        1,    38016, 0x52ab043b
-0,        760,        760,        1,    38016, 0x8e8b0bd9
-0,        761,        761,        1,    38016, 0x0f131a7e
-0,        762,        762,        1,    38016, 0x26aa2303
-0,        763,        763,        1,    38016, 0x70c12bab
-0,        764,        764,        1,    38016, 0xa8a93858
-0,        765,        765,        1,    38016, 0x289f3b94
-0,        766,        766,        1,    38016, 0x3d883605
-0,        767,        767,        1,    38016, 0xe171329e
-0,        768,        768,        1,    38016, 0x75292865
-0,        769,        769,        1,    38016, 0x1d2ac8dc
-0,        770,        770,        1,    38016, 0xa336aa94
-0,        771,        771,        1,    38016, 0xcede9906
-0,        772,        772,        1,    38016, 0x1c9a8b52
-0,        773,        773,        1,    38016, 0x2a9c8a78
-0,        774,        774,        1,    38016, 0x920a8583
-0,        775,        775,        1,    38016, 0xb3ee7e2d
-0,        776,        776,        1,    38016, 0x96be75fc
-0,        777,        777,        1,    38016, 0x2a8a68d2
-0,        778,        778,        1,    38016, 0xdf8e6baf
-0,        779,        779,        1,    38016, 0xd46570d1
-0,        780,        780,        1,    38016, 0x765b71af
-0,        781,        781,        1,    38016, 0x25fe71df
-0,        782,        782,        1,    38016, 0x9ca124e3
-0,        783,        783,        1,    38016, 0x77c51bab
-0,        784,        784,        1,    38016, 0x0b380db9
-0,        785,        785,        1,    38016, 0xb0be108b
-0,        786,        786,        1,    38016, 0x5c4808b8
-0,        787,        787,        1,    38016, 0x73331227
-0,        788,        788,        1,    38016, 0xce790cf2
-0,        789,        789,        1,    38016, 0x46ac0dfc
-0,        790,        790,        1,    38016, 0xdc310caf
-0,        791,        791,        1,    38016, 0x909c0606
-0,        792,        792,        1,    38016, 0x0756fb3e
-0,        793,        793,        1,    38016, 0x4eb0fb0d
-0,        794,        794,        1,    38016, 0x6276f6e2
-0,        795,        795,        1,    38016, 0x92e0f070
-0,        796,        796,        1,    38016, 0x6f2d793f
-0,        797,        797,        1,    38016, 0x215f704b
-0,        798,        798,        1,    38016, 0xf9b7765e
-0,        799,        799,        1,    38016, 0xdb6176bf
-0,        800,        800,        1,    38016, 0x2b5165eb
-0,        801,        801,        1,    38016, 0xf1145c06
-0,        802,        802,        1,    38016, 0x343f698d
-0,        803,        803,        1,    38016, 0xcb96713f
-0,        804,        804,        1,    38016, 0xc50f775a
-0,        805,        805,        1,    38016, 0xbb927e81
-0,        806,        806,        1,    38016, 0xa2497bd4
-0,        807,        807,        1,    38016, 0xe52b80fa
-0,        808,        808,        1,    38016, 0x900f7ac7
-0,        809,        809,        1,    38016, 0x77e77d0e
-0,        810,        810,        1,    38016, 0xdb33f302
-0,        811,        811,        1,    38016, 0xf0519288
-0,        812,        812,        1,    38016, 0x4552f487
-0,        813,        813,        1,    38016, 0xe7b5f34c
-0,        814,        814,        1,    38016, 0x0db18be6
-0,        815,        815,        1,    38016, 0xb9ba87c2
-0,        816,        816,        1,    38016, 0x1dc2f805
-0,        817,        817,        1,    38016, 0x4986f535
-0,        818,        818,        1,    38016, 0xc099f301
-0,        819,        819,        1,    38016, 0x3d8c6787
-0,        820,        820,        1,    38016, 0xd3a4796f
-0,        821,        821,        1,    38016, 0xfe01635f
-0,        822,        822,        1,    38016, 0xba8df082
-0,        823,        823,        1,    38016, 0x55f3f017
-0,        824,        824,        1,    38016, 0xf2d7f36a
-0,        825,        825,        1,    38016, 0x8bd8f7a1
-0,        826,        826,        1,    38016, 0xabcd638b
-0,        827,        827,        1,    38016, 0x69ae59ea
-0,        828,        828,        1,    38016, 0x5bf43408
-0,        829,        829,        1,    38016, 0x6466fd67
-0,        830,        830,        1,    38016, 0xc90effb4
-0,        831,        831,        1,    38016, 0x82110480
-0,        832,        832,        1,    38016, 0xb364f74b
-0,        833,        833,        1,    38016, 0x7f1efd76
-0,        834,        834,        1,    38016, 0x1a20f30f
-0,        835,        835,        1,    38016, 0x4b0fe377
-0,        836,        836,        1,    38016, 0x57b4c896
-0,        837,        837,        1,    38016, 0x92b1ab52
-0,        838,        838,        1,    38016, 0x10ceaf82
-0,        839,        839,        1,    38016, 0xc4d3b0b8
-0,        840,        840,        1,    38016, 0x68b9f314
-0,        841,        841,        1,    38016, 0xc627fd70
-0,        842,        842,        1,    38016, 0x5fc108dc
-0,        843,        843,        1,    38016, 0x0f1f12d7
-0,        844,        844,        1,    38016, 0x6edc208e
-0,        845,        845,        1,    38016, 0x91f824eb
-0,        846,        846,        1,    38016, 0x1464b836
-0,        847,        847,        1,    38016, 0x84c7c412
-0,        848,        848,        1,    38016, 0x3e8dd049
-0,        849,        849,        1,    38016, 0x493dd1a7
-0,        850,        850,        1,    38016, 0x25dfbd00
-0,        851,        851,        1,    38016, 0x140bbd33
-0,        852,        852,        1,    38016, 0x488e2db6
-0,        853,        853,        1,    38016, 0x9e4f2c0a
-0,        854,        854,        1,    38016, 0xd60928d3
-0,        855,        855,        1,    38016, 0x38b61e0b
-0,        856,        856,        1,    38016, 0xb6331660
-0,        857,        857,        1,    38016, 0x0a3a0e4c
-0,        858,        858,        1,    38016, 0x6ad9105b
-0,        859,        859,        1,    38016, 0x29a8cd6b
-0,        860,        860,        1,    38016, 0x35e1da7d
-0,        861,        861,        1,    38016, 0x824de492
-0,        862,        862,        1,    38016, 0x1c76d83c
-0,        863,        863,        1,    38016, 0xbe25d98d
-0,        864,        864,        1,    38016, 0x5efaf222
-0,        865,        865,        1,    38016, 0x17370266
-0,        866,        866,        1,    38016, 0x417a2375
-0,        867,        867,        1,    38016, 0xb7e423d3
-0,        868,        868,        1,    38016, 0x224020fe
-0,        869,        869,        1,    38016, 0x4bbe1ee9
-0,        870,        870,        1,    38016, 0x72aa1f21
-0,        871,        871,        1,    38016, 0xc810126d
-0,        872,        872,        1,    38016, 0x42730cd4
-0,        873,        873,        1,    38016, 0xfd510c5d
-0,        874,        874,        1,    38016, 0x7c6f1313
-0,        875,        875,        1,    38016, 0xc1b31b89
-0,        876,        876,        1,    38016, 0x57772339
-0,        877,        877,        1,    38016, 0x20922349
-0,        878,        878,        1,    38016, 0xea4f1a45
-0,        879,        879,        1,    38016, 0x79e214d2
-0,        880,        880,        1,    38016, 0x77521b5d
-0,        881,        881,        1,    38016, 0x5929276c
-0,        882,        882,        1,    38016, 0x40b3130d
-0,        883,        883,        1,    38016, 0x040a157e
-0,        884,        884,        1,    38016, 0x0de31983
-0,        885,        885,        1,    38016, 0xdb0a1852
-0,        886,        886,        1,    38016, 0x73111b91
-0,        887,        887,        1,    38016, 0xf7a61765
-0,        888,        888,        1,    38016, 0xc5dd2557
-0,        889,        889,        1,    38016, 0xabc32e16
-0,        890,        890,        1,    38016, 0x5f093823
-0,        891,        891,        1,    38016, 0x9f462f1e
-0,        892,        892,        1,    38016, 0x29822c19
-0,        893,        893,        1,    38016, 0x259a2697
-0,        894,        894,        1,    38016, 0x7ad61867
-0,        895,        895,        1,    38016, 0x32fe111f
-0,        896,        896,        1,    38016, 0xf65c1142
-0,        897,        897,        1,    38016, 0xc5b91a6d
-0,        898,        898,        1,    38016, 0x4461191e
-0,        899,        899,        1,    38016, 0x0458193a
-0,        900,        900,        1,    38016, 0x3ed084a9
-0,        901,        901,        1,    38016, 0x4dd28047
-0,        902,        902,        1,    38016, 0x18dd8523
-0,        903,        903,        1,    38016, 0x4ab87d32
-0,        904,        904,        1,    38016, 0xecd0824c
-0,        905,        905,        1,    38016, 0xae567d36
-0,        906,        906,        1,    38016, 0xfa2e82d0
-0,        907,        907,        1,    38016, 0xbce08c2e
-0,        908,        908,        1,    38016, 0x125094c4
-0,        909,        909,        1,    38016, 0x475e9b1d
-0,        910,        910,        1,    38016, 0x9b921150
-0,        911,        911,        1,    38016, 0x6f7b1124
-0,        912,        912,        1,    38016, 0xa1fe0d8b
-0,        913,        913,        1,    38016, 0x12930955
-0,        914,        914,        1,    38016, 0x3d981105
-0,        915,        915,        1,    38016, 0x92d92e3b
-0,        916,        916,        1,    38016, 0x29a33ed5
-0,        917,        917,        1,    38016, 0x8d0b578e
-0,        918,        918,        1,    38016, 0xda5571ba
-0,        919,        919,        1,    38016, 0xbc638172
-0,        920,        920,        1,    38016, 0x73fd9abb
-0,        921,        921,        1,    38016, 0x53df952b
-0,        922,        922,        1,    38016, 0xe1758a4c
-0,        923,        923,        1,    38016, 0x064f8812
-0,        924,        924,        1,    38016, 0xd9b08971
-0,        925,        925,        1,    38016, 0xfe6688a9
-0,        926,        926,        1,    38016, 0x3b50938b
-0,        927,        927,        1,    38016, 0x4e1a9c13
-0,        928,        928,        1,    38016, 0x63599bf0
-0,        929,        929,        1,    38016, 0x97e0957f
-0,        930,        930,        1,    38016, 0x5a6e98d7
-0,        931,        931,        1,    38016, 0xa4be8cf2
-0,        932,        932,        1,    38016, 0x53bb901e
-0,        933,        933,        1,    38016, 0x15f0994e
-0,        934,        934,        1,    38016, 0x71499a4b
-0,        935,        935,        1,    38016, 0xf41a87a5
-0,        936,        936,        1,    38016, 0x3e237999
-0,        937,        937,        1,    38016, 0xf77f5dd2
-0,        938,        938,        1,    38016, 0x89874799
-0,        939,        939,        1,    38016, 0x02d82294
-0,        940,        940,        1,    38016, 0xc5920154
-0,        941,        941,        1,    38016, 0x6e61f375
-0,        942,        942,        1,    38016, 0x41a6940c
-0,        943,        943,        1,    38016, 0x130b97f7
-0,        944,        944,        1,    38016, 0xdff09b51
-0,        945,        945,        1,    38016, 0xb2999bd6
-0,        946,        946,        1,    38016, 0x0bb99d20
-0,        947,        947,        1,    38016, 0x9f819633
-0,        948,        948,        1,    38016, 0x5bda9640
-0,        949,        949,        1,    38016, 0xdcf29321
-0,        950,        950,        1,    38016, 0xa6838a63
-0,        951,        951,        1,    38016, 0x820a825e
-0,        952,        952,        1,    38016, 0x69bb7859
-0,        953,        953,        1,    38016, 0x4a8c79c2
-0,        954,        954,        1,    38016, 0x1e97e67d
-0,        955,        955,        1,    38016, 0x1ad4de1b
-0,        956,        956,        1,    38016, 0xe8abeb33
-0,        957,        957,        1,    38016, 0xf3a51523
-0,        958,        958,        1,    38016, 0xb997399c
-0,        959,        959,        1,    38016, 0x9fee8105
-0,        960,        960,        1,    38016, 0xf2b6ada3
-0,        961,        961,        1,    38016, 0xe6f5bbb3
-0,        962,        962,        1,    38016, 0x8ed7ca9f
-0,        963,        963,        1,    38016, 0x711abc1a
-0,        964,        964,        1,    38016, 0x707ab544
-0,        965,        965,        1,    38016, 0x03b8af51
-0,        966,        966,        1,    38016, 0x50497b2c
-0,        967,        967,        1,    38016, 0x72b57a30
-0,        968,        968,        1,    38016, 0xfb6d8164
-0,        969,        969,        1,    38016, 0x88618e82
-0,        970,        970,        1,    38016, 0xb7369e49
-0,        971,        971,        1,    38016, 0x2502a3ca
-0,        972,        972,        1,    38016, 0x793aa276
-0,        973,        973,        1,    38016, 0x883a8ec6
-0,        974,        974,        1,    38016, 0x5f7784e5
-0,        975,        975,        1,    38016, 0xddfa7e94
-0,        976,        976,        1,    38016, 0xdb877fb8
-0,        977,        977,        1,    38016, 0x07e07f39
-0,        978,        978,        1,    38016, 0x412590fb
-0,        979,        979,        1,    38016, 0x1bd1b527
-0,        980,        980,        1,    38016, 0xbb6098c3
-0,        981,        981,        1,    38016, 0x5f1b8788
-0,        982,        982,        1,    38016, 0x42f068e8
-0,        983,        983,        1,    38016, 0x316b53bb
-0,        984,        984,        1,    38016, 0xbdbb3fa0
-0,        985,        985,        1,    38016, 0xa68f506c
-0,        986,        986,        1,    38016, 0xca355d03
-0,        987,        987,        1,    38016, 0xfafc6b88
-0,        988,        988,        1,    38016, 0x0f106535
-0,        989,        989,        1,    38016, 0xa4ae4e63
-0,        990,        990,        1,    38016, 0xb206400f
-0,        991,        991,        1,    38016, 0x3a5946d1
-0,        992,        992,        1,    38016, 0xca739868
-0,        993,        993,        1,    38016, 0xe6939d41
-0,        994,        994,        1,    38016, 0x2ec19a76
-0,        995,        995,        1,    38016, 0x614e96a4
-0,        996,        996,        1,    38016, 0x2c2b9348
-0,        997,        997,        1,    38016, 0xa00c7f1f
-0,        998,        998,        1,    38016, 0x95cb6eca
-0,        999,        999,        1,    38016, 0x069d6c4c
-0,       1000,       1000,        1,    38016, 0xe17e03e3
-0,       1001,       1001,        1,    38016, 0xa7491870
-0,       1002,       1002,        1,    38016, 0xacc91e48
-0,       1003,       1003,        1,    38016, 0x99eb1e2a
-0,       1004,       1004,        1,    38016, 0xb2eb1279
-0,       1005,       1005,        1,    38016, 0xa5020c77
-0,       1006,       1006,        1,    38016, 0xde966613
-0,       1007,       1007,        1,    38016, 0xac7f6e1e
-0,       1008,       1008,        1,    38016, 0x1c378a7a
-0,       1009,       1009,        1,    38016, 0x32e6d8a4
-0,       1010,       1010,        1,    38016, 0xecb8d286
-0,       1011,       1011,        1,    38016, 0xa497d941
-0,       1012,       1012,        1,    38016, 0x8ad7d36e
-0,       1013,       1013,        1,    38016, 0xdbd8a91a
-0,       1014,       1014,        1,    38016, 0x718f61d7
-0,       1015,       1015,        1,    38016, 0x862619cf
-0,       1016,       1016,        1,    38016, 0xaa049781
-0,       1017,       1017,        1,    38016, 0xd3986887
-0,       1018,       1018,        1,    38016, 0x9e9f5782
-0,       1019,       1019,        1,    38016, 0x2a9d4f70
-0,       1020,       1020,        1,    38016, 0x62b91421
-0,       1021,       1021,        1,    38016, 0x32313eaa
-0,       1022,       1022,        1,    38016, 0xf9bf1879
-0,       1023,       1023,        1,    38016, 0xc33c0811
-0,       1024,       1024,        1,    38016, 0xe9c21227
-0,       1025,       1025,        1,    38016, 0xf2922db6
-0,       1026,       1026,        1,    38016, 0x669d0627
-0,       1027,       1027,        1,    38016, 0x64c1048a
-0,       1028,       1028,        1,    38016, 0xdd28fa70
-0,       1029,       1029,        1,    38016, 0xd88e8b77
-0,       1030,       1030,        1,    38016, 0x3716bdb8
-0,       1031,       1031,        1,    38016, 0x1834ef57
-0,       1032,       1032,        1,    38016, 0xddb800b7
-0,       1033,       1033,        1,    38016, 0x140302cc
-0,       1034,       1034,        1,    38016, 0x7fa60568
-0,       1035,       1035,        1,    38016, 0x7cc6fd4b
-0,       1036,       1036,        1,    38016, 0xf14c2568
-0,       1037,       1037,        1,    38016, 0x2ee88bbc
-0,       1038,       1038,        1,    38016, 0x915cd143
-0,       1039,       1039,        1,    38016, 0x13ede5fa
-0,       1040,       1040,        1,    38016, 0x6615f63b
-0,       1041,       1041,        1,    38016, 0x8814f54f
-0,       1042,       1042,        1,    38016, 0xb53ef24a
-0,       1043,       1043,        1,    38016, 0xc6a8ee80
-0,       1044,       1044,        1,    38016, 0x9473ee09
-0,       1045,       1045,        1,    38016, 0x9b77d932
-0,       1046,       1046,        1,    38016, 0x142fc69a
-0,       1047,       1047,        1,    38016, 0xb238c6a2
-0,       1048,       1048,        1,    38016, 0x4364d302
-0,       1049,       1049,        1,    38016, 0xde39d174
-0,       1050,       1050,        1,    38016, 0x7fca7fa6
-0,       1051,       1051,        1,    38016, 0x77678d42
-0,       1052,       1052,        1,    38016, 0xaa7e8b68
-0,       1053,       1053,        1,    38016, 0xeecb8c89
-0,       1054,       1054,        1,    38016, 0x6e5e8980
-0,       1055,       1055,        1,    38016, 0x4f4a80de
-0,       1056,       1056,        1,    38016, 0xb3b5cee6
-0,       1057,       1057,        1,    38016, 0x0c72cf1c
-0,       1058,       1058,        1,    38016, 0xd83fd12d
-0,       1059,       1059,        1,    38016, 0x8deeda59
-0,       1060,       1060,        1,    38016, 0xe7fae46e
-0,       1061,       1061,        1,    38016, 0x8233ecd5
-0,       1062,       1062,        1,    38016, 0x0c32808c
-0,       1063,       1063,        1,    38016, 0xf43f8571
-0,       1064,       1064,        1,    38016, 0xae898f01
-0,       1065,       1065,        1,    38016, 0x5a4a99e9
-0,       1066,       1066,        1,    38016, 0x589f9b80
-0,       1067,       1067,        1,    38016, 0x6ca5a33b
-0,       1068,       1068,        1,    38016, 0x3811af0a
-0,       1069,       1069,        1,    38016, 0x8272eda7
-0,       1070,       1070,        1,    38016, 0xa807f046
-0,       1071,       1071,        1,    38016, 0x5b4fec80
-0,       1072,       1072,        1,    38016, 0xb6e6e7fa
-0,       1073,       1073,        1,    38016, 0x250cdb5c
-0,       1074,       1074,        1,    38016, 0x3f38e876
-0,       1075,       1075,        1,    38016, 0x8110e94a
-0,       1076,       1076,        1,    38016, 0x0f19abd7
-0,       1077,       1077,        1,    38016, 0x9e1ca9bd
-0,       1078,       1078,        1,    38016, 0x1f33abae
-0,       1079,       1079,        1,    38016, 0xff18ad65
-0,       1080,       1080,        1,    38016, 0x3d02b300
-0,       1081,       1081,        1,    38016, 0xb7a9b4b2
-0,       1082,       1082,        1,    38016, 0xd8cab454
-0,       1083,       1083,        1,    38016, 0xb48ab772
-0,       1084,       1084,        1,    38016, 0x7f98fe59
-0,       1085,       1085,        1,    38016, 0x786c1795
-0,       1086,       1086,        1,    38016, 0x013437ff
-0,       1087,       1087,        1,    38016, 0xba28622a
-0,       1088,       1088,        1,    38016, 0xf48486e1
-0,       1089,       1089,        1,    38016, 0xc13695c4
-0,       1090,       1090,        1,    38016, 0x1fc5a4d2
-0,       1091,       1091,        1,    38016, 0x016caefd
-0,       1092,       1092,        1,    38016, 0x76b8bc54
-0,       1093,       1093,        1,    38016, 0xcf63bdbc
-0,       1094,       1094,        1,    38016, 0xeb02c0e2
-0,       1095,       1095,        1,    38016, 0xb57dc067
-0,       1096,       1096,        1,    38016, 0x8ec8c058
-0,       1097,       1097,        1,    38016, 0xcb04be49
-0,       1098,       1098,        1,    38016, 0xceccbfac
-0,       1099,       1099,        1,    38016, 0x3408c0c3
-0,       1100,       1100,        1,    38016, 0xee526afa
-0,       1101,       1101,        1,    38016, 0xd7529aad
-0,       1102,       1102,        1,    38016, 0x98bd9221
-0,       1103,       1103,        1,    38016, 0x2fbd7e5a
-0,       1104,       1104,        1,    38016, 0x0fb8a8fc
-0,       1105,       1105,        1,    38016, 0xfd28af91
-0,       1106,       1106,        1,    38016, 0x81db9907
-0,       1107,       1107,        1,    38016, 0x1f0a8ae7
-0,       1108,       1108,        1,    38016, 0xd91e93e3
-0,       1109,       1109,        1,    38016, 0x5fe6b043
-0,       1110,       1110,        1,    38016, 0x2a618a48
-0,       1111,       1111,        1,    38016, 0xef1c8cc2
-0,       1112,       1112,        1,    38016, 0x928595ce
-0,       1113,       1113,        1,    38016, 0xf2a59a43
-0,       1114,       1114,        1,    38016, 0x61bf92d0
-0,       1115,       1115,        1,    38016, 0x584d840f
-0,       1116,       1116,        1,    38016, 0x42177cb1
-0,       1117,       1117,        1,    38016, 0x08867c3b
-0,       1118,       1118,        1,    38016, 0x5a89813b
-0,       1119,       1119,        1,    38016, 0xba558022
-0,       1120,       1120,        1,    38016, 0x3d58878a
-0,       1121,       1121,        1,    38016, 0x8d215911
-0,       1122,       1122,        1,    38016, 0xea27370c
-0,       1123,       1123,        1,    38016, 0x7e2a1a9c
-0,       1124,       1124,        1,    38016, 0xbb86f763
-0,       1125,       1125,        1,    38016, 0xf03fd3c7
-0,       1126,       1126,        1,    38016, 0x1eaac263
-0,       1127,       1127,        1,    38016, 0x8a4bd0e1
-0,       1128,       1128,        1,    38016, 0x5adcf66d
-0,       1129,       1129,        1,    38016, 0xa0320a89
-0,       1130,       1130,        1,    38016, 0x77338f96
-0,       1131,       1131,        1,    38016, 0xf3498f6a
-0,       1132,       1132,        1,    38016, 0x7e248dcf
-0,       1133,       1133,        1,    38016, 0xf7f68dcc
-0,       1134,       1134,        1,    38016, 0x5da597c9
-0,       1135,       1135,        1,    38016, 0x63db9d00
-0,       1136,       1136,        1,    38016, 0xd1f09e52
-0,       1137,       1137,        1,    38016, 0xfc7ba2e1
-0,       1138,       1138,        1,    38016, 0x8c26ab25
-0,       1139,       1139,        1,    38016, 0x6a45add3
-0,       1140,       1140,        1,    38016, 0x0dd7b2a2
-0,       1141,       1141,        1,    38016, 0x70c00c4f
-0,       1142,       1142,        1,    38016, 0x437e255e
-0,       1143,       1143,        1,    38016, 0x63dd455b
-0,       1144,       1144,        1,    38016, 0x01453a2e
-0,       1145,       1145,        1,    38016, 0x08c120af
-0,       1146,       1146,        1,    38016, 0xf3111451
-0,       1147,       1147,        1,    38016, 0xf3f10603
-0,       1148,       1148,        1,    38016, 0xb154fa41
-0,       1149,       1149,        1,    38016, 0x4734ee73
-0,       1150,       1150,        1,    38016, 0x28ca7926
-0,       1151,       1151,        1,    38016, 0xbb628234
-0,       1152,       1152,        1,    38016, 0x0ca1b42f
-0,       1153,       1153,        1,    38016, 0x8397b202
-0,       1154,       1154,        1,    38016, 0x9d92b832
-0,       1155,       1155,        1,    38016, 0x8fbeb4b2
-0,       1156,       1156,        1,    38016, 0x056aa904
-0,       1157,       1157,        1,    38016, 0x4e78a55c
-0,       1158,       1158,        1,    38016, 0xe8a8a265
-0,       1159,       1159,        1,    38016, 0xb703a17b
-0,       1160,       1160,        1,    38016, 0xe79e9d71
-0,       1161,       1161,        1,    38016, 0xbd769f5d
-0,       1162,       1162,        1,    38016, 0x602ea70f
-0,       1163,       1163,        1,    38016, 0x034caf76
-0,       1164,       1164,        1,    38016, 0x28dd9702
-0,       1165,       1165,        1,    38016, 0xc8879c85
-0,       1166,       1166,        1,    38016, 0x15b098f2
-0,       1167,       1167,        1,    38016, 0xf34b9ce5
-0,       1168,       1168,        1,    38016, 0x6d159fbf
-0,       1169,       1169,        1,    38016, 0x22eb9cac
-0,       1170,       1170,        1,    38016, 0xae42a220
-0,       1171,       1171,        1,    38016, 0x1275a131
-0,       1172,       1172,        1,    38016, 0x8188a057
-0,       1173,       1173,        1,    38016, 0x65dea0d1
-0,       1174,       1174,        1,    38016, 0x5bd19be2
-0,       1175,       1175,        1,    38016, 0xfbd99219
-0,       1176,       1176,        1,    38016, 0xad19b3a2
-0,       1177,       1177,        1,    38016, 0xa897bb92
-0,       1178,       1178,        1,    38016, 0x5b1fbf2e
-0,       1179,       1179,        1,    38016, 0x02a5cb24
-0,       1180,       1180,        1,    38016, 0xd6ead6fe
-0,       1181,       1181,        1,    38016, 0x3083de8a
-0,       1182,       1182,        1,    38016, 0xbf1decb4
-0,       1183,       1183,        1,    38016, 0xd92af986
-0,       1184,       1184,        1,    38016, 0x4c520154
-0,       1185,       1185,        1,    38016, 0xd45805a1
-0,       1186,       1186,        1,    38016, 0x25e2084d
-0,       1187,       1187,        1,    38016, 0x4e3d0960
-0,       1188,       1188,        1,    38016, 0x5b449ef2
-0,       1189,       1189,        1,    38016, 0xda15abcc
-0,       1190,       1190,        1,    38016, 0x1b3ba622
-0,       1191,       1191,        1,    38016, 0xaf61a32a
-0,       1192,       1192,        1,    38016, 0xcfa39e3d
-0,       1193,       1193,        1,    38016, 0x8865a56c
-0,       1194,       1194,        1,    38016, 0x3bc9af9b
-0,       1195,       1195,        1,    38016, 0x0a83c081
-0,       1196,       1196,        1,    38016, 0x5ccec976
-0,       1197,       1197,        1,    38016, 0x1f1fc906
-0,       1198,       1198,        1,    38016, 0x1ef6cc46
-0,       1199,       1199,        1,    38016, 0x7776c39e
-0,       1200,       1200,        1,    38016, 0x5860a212
-0,       1201,       1201,        1,    38016, 0x2d9092a3
-0,       1202,       1202,        1,    38016, 0x964d9f81
-0,       1203,       1203,        1,    38016, 0xc35c9691
-0,       1204,       1204,        1,    38016, 0x5e0dc673
-0,       1205,       1205,        1,    38016, 0xada3b7d6
-0,       1206,       1206,        1,    38016, 0x4f3a8d03
-0,       1207,       1207,        1,    38016, 0xfcb4861a
-0,       1208,       1208,        1,    38016, 0xfa908149
-0,       1209,       1209,        1,    38016, 0x6994c514
-0,       1210,       1210,        1,    38016, 0x37c5aaa9
-0,       1211,       1211,        1,    38016, 0x207abcfe
-0,       1212,       1212,        1,    38016, 0x778d7a2d
-0,       1213,       1213,        1,    38016, 0x60b773ff
-0,       1214,       1214,        1,    38016, 0x41cd67d5
-0,       1215,       1215,        1,    38016, 0x3c595a99
-0,       1216,       1216,        1,    38016, 0xd672b14c
-0,       1217,       1217,        1,    38016, 0x7db2c0fd
-0,       1218,       1218,        1,    38016, 0x3d21cf34
-0,       1219,       1219,        1,    38016, 0xdd1cf044
-0,       1220,       1220,        1,    38016, 0xc4594bcb
-0,       1221,       1221,        1,    38016, 0x595e4356
-0,       1222,       1222,        1,    38016, 0x9cc53c0d
-0,       1223,       1223,        1,    38016, 0x78fc325f
-0,       1224,       1224,        1,    38016, 0xc632324f
-0,       1225,       1225,        1,    38016, 0x18b1f5c1
-0,       1226,       1226,        1,    38016, 0x63aff55e
-0,       1227,       1227,        1,    38016, 0x8a50fb04
-0,       1228,       1228,        1,    38016, 0x7d5e20f6
-0,       1229,       1229,        1,    38016, 0xc31114bb
-0,       1230,       1230,        1,    38016, 0xf4852e6e
-0,       1231,       1231,        1,    38016, 0x9b6927ba
-0,       1232,       1232,        1,    38016, 0x024836c2
-0,       1233,       1233,        1,    38016, 0x20843b21
-0,       1234,       1234,        1,    38016, 0x19134055
-0,       1235,       1235,        1,    38016, 0x1cd843f7
-0,       1236,       1236,        1,    38016, 0x122705b1
-0,       1237,       1237,        1,    38016, 0x1880fc3d
-0,       1238,       1238,        1,    38016, 0x78dbfeaf
-0,       1239,       1239,        1,    38016, 0x212c273d
-0,       1240,       1240,        1,    38016, 0xff2eb7be
-0,       1241,       1241,        1,    38016, 0xe0bd752d
-0,       1242,       1242,        1,    38016, 0x277b478a
-0,       1243,       1243,        1,    38016, 0x59e84ab2
-0,       1244,       1244,        1,    38016, 0x338a50e4
-0,       1245,       1245,        1,    38016, 0xaf715a99
-0,       1246,       1246,        1,    38016, 0xd1e459a8
-0,       1247,       1247,        1,    38016, 0x70da4ac9
-0,       1248,       1248,        1,    38016, 0xa695540d
-0,       1249,       1249,        1,    38016, 0x9385320b
-0,       1250,       1250,        1,    38016, 0x9a8703cd
-0,       1251,       1251,        1,    38016, 0xbeda239e
-0,       1252,       1252,        1,    38016, 0x5bf262c1
-0,       1253,       1253,        1,    38016, 0x9b216899
-0,       1254,       1254,        1,    38016, 0x52f24135
-0,       1255,       1255,        1,    38016, 0x75a23955
-0,       1256,       1256,        1,    38016, 0xb92f4ea2
-0,       1257,       1257,        1,    38016, 0xdac95333
-0,       1258,       1258,        1,    38016, 0x1a2d4ed4
-0,       1259,       1259,        1,    38016, 0xfce25650
-0,       1260,       1260,        1,    38016, 0x1e264fdd
-0,       1261,       1261,        1,    38016, 0xe77349b8
-0,       1262,       1262,        1,    38016, 0x7d2046b0
-0,       1263,       1263,        1,    38016, 0x65373899
-0,       1264,       1264,        1,    38016, 0x3b3569ae
-0,       1265,       1265,        1,    38016, 0x346485d0
-0,       1266,       1266,        1,    38016, 0x80b93e57
-0,       1267,       1267,        1,    38016, 0xeb724ba5
-0,       1268,       1268,        1,    38016, 0x533d7459
-0,       1269,       1269,        1,    38016, 0x60f957a7
-0,       1270,       1270,        1,    38016, 0x900281b2
-0,       1271,       1271,        1,    38016, 0xf4489e06
-0,       1272,       1272,        1,    38016, 0xe77730c9
-0,       1273,       1273,        1,    38016, 0x41b23060
-0,       1274,       1274,        1,    38016, 0x4e8c3012
-0,       1275,       1275,        1,    38016, 0x651f2cff
-0,       1276,       1276,        1,    38016, 0x787b2e99
-0,       1277,       1277,        1,    38016, 0x541e2d10
-0,       1278,       1278,        1,    38016, 0x27a824a3
-0,       1279,       1279,        1,    38016, 0xe1e72121
-0,       1280,       1280,        1,    38016, 0xffb52626
-0,       1281,       1281,        1,    38016, 0x7677c8c9
-0,       1282,       1282,        1,    38016, 0xa501d38f
-0,       1283,       1283,        1,    38016, 0xa6d2c5dc
-0,       1284,       1284,        1,    38016, 0xba94d1c1
-0,       1285,       1285,        1,    38016, 0x137dac4d
-0,       1286,       1286,        1,    38016, 0x65c1bd6e
-0,       1287,       1287,        1,    38016, 0x7a32cd65
-0,       1288,       1288,        1,    38016, 0x518adf61
-0,       1289,       1289,        1,    38016, 0x8baaee58
-0,       1290,       1290,        1,    38016, 0xe7642712
-0,       1291,       1291,        1,    38016, 0xba191b45
-0,       1292,       1292,        1,    38016, 0x93dd16b1
-0,       1293,       1293,        1,    38016, 0x22831478
-0,       1294,       1294,        1,    38016, 0xe48c103a
-0,       1295,       1295,        1,    38016, 0x7c2709e7
-0,       1296,       1296,        1,    38016, 0xd7d8f454
-0,       1297,       1297,        1,    38016, 0xc504f31a
-0,       1298,       1298,        1,    38016, 0x2510e4ae
-0,       1299,       1299,        1,    38016, 0x0b56d119
-0,       1300,       1300,        1,    38016, 0x6c248150
-0,       1301,       1301,        1,    38016, 0xbac4be42
-0,       1302,       1302,        1,    38016, 0x5787c4a8
-0,       1303,       1303,        1,    38016, 0x65b3d0bd
-0,       1304,       1304,        1,    38016, 0xdcc4efbd
-0,       1305,       1305,        1,    38016, 0xfe92f78b
-0,       1306,       1306,        1,    38016, 0xfda60c1c
-0,       1307,       1307,        1,    38016, 0x4997238e
-0,       1308,       1308,        1,    38016, 0xfaca43ca
-0,       1309,       1309,        1,    38016, 0x81fe533c
-0,       1310,       1310,        1,    38016, 0x350bcb11
-0,       1311,       1311,        1,    38016, 0xacfdcde4
-0,       1312,       1312,        1,    38016, 0xb039c663
-0,       1313,       1313,        1,    38016, 0x3402c942
-0,       1314,       1314,        1,    38016, 0x388bc3d0
-0,       1315,       1315,        1,    38016, 0x85dec11a
-0,       1316,       1316,        1,    38016, 0xdfc2be86
-0,       1317,       1317,        1,    38016, 0x515cc1a9
-0,       1318,       1318,        1,    38016, 0xc7ddb990
-0,       1319,       1319,        1,    38016, 0x043fb332
-0,       1320,       1320,        1,    38016, 0x5b05b3a7
-0,       1321,       1321,        1,    38016, 0xacdf9836
-0,       1322,       1322,        1,    38016, 0x55079a49
-0,       1323,       1323,        1,    38016, 0x5de2d90d
-0,       1324,       1324,        1,    38016, 0x7f9deb52
-0,       1325,       1325,        1,    38016, 0x83ddc6d9
-0,       1326,       1326,        1,    38016, 0x77ecdc93
-0,       1327,       1327,        1,    38016, 0x745fe832
-0,       1328,       1328,        1,    38016, 0x920bf8e7
-0,       1329,       1329,        1,    38016, 0xd9fc1803
-0,       1330,       1330,        1,    38016, 0x06c13052
-0,       1331,       1331,        1,    38016, 0x4a962b49
-0,       1332,       1332,        1,    38016, 0xd4a7b571
-0,       1333,       1333,        1,    38016, 0xdb76bd1e
-0,       1334,       1334,        1,    38016, 0x11a4be41
-0,       1335,       1335,        1,    38016, 0x575eb740
-0,       1336,       1336,        1,    38016, 0x7f11bb5c
-0,       1337,       1337,        1,    38016, 0x0f97b9b5
-0,       1338,       1338,        1,    38016, 0xa421bc1e
-0,       1339,       1339,        1,    38016, 0x2510bda8
-0,       1340,       1340,        1,    38016, 0x5ec1c3c2
-0,       1341,       1341,        1,    38016, 0xab02c212
-0,       1342,       1342,        1,    38016, 0x7862c24a
-0,       1343,       1343,        1,    38016, 0x3654c47c
-0,       1344,       1344,        1,    38016, 0x6e4f3fd5
-0,       1345,       1345,        1,    38016, 0x77b54c6f
-0,       1346,       1346,        1,    38016, 0x51016691
-0,       1347,       1347,        1,    38016, 0x5c2e7a7a
-0,       1348,       1348,        1,    38016, 0x29aea461
-0,       1349,       1349,        1,    38016, 0x8f4397b1
-0,       1350,       1350,        1,    38016, 0x8af41dba
-0,       1351,       1351,        1,    38016, 0x4c1154ca
-0,       1352,       1352,        1,    38016, 0xe23e6e91
-0,       1353,       1353,        1,    38016, 0xd0617571
-0,       1354,       1354,        1,    38016, 0x2ab88348
-0,       1355,       1355,        1,    38016, 0x8bf1a109
-0,       1356,       1356,        1,    38016, 0xfdd4c390
-0,       1357,       1357,        1,    38016, 0x17b8c6bf
-0,       1358,       1358,        1,    38016, 0xa012bd5d
-0,       1359,       1359,        1,    38016, 0x4c16cee2
-0,       1360,       1360,        1,    38016, 0x739fcfae
-0,       1361,       1361,        1,    38016, 0x3edae498
-0,       1362,       1362,        1,    38016, 0x0d38e4ad
-0,       1363,       1363,        1,    38016, 0x896cea10
-0,       1364,       1364,        1,    38016, 0x13a0f1a9
-0,       1365,       1365,        1,    38016, 0xfe70eeb4
-0,       1366,       1366,        1,    38016, 0x540bf40e
-0,       1367,       1367,        1,    38016, 0xee20f65e
-0,       1368,       1368,        1,    38016, 0x8404fdf7
-0,       1369,       1369,        1,    38016, 0x1c71b182
-0,       1370,       1370,        1,    38016, 0x96e4c5cc
-0,       1371,       1371,        1,    38016, 0x6aa1dcf1
-0,       1372,       1372,        1,    38016, 0x4549ed9b
-0,       1373,       1373,        1,    38016, 0xd50bffba
-0,       1374,       1374,        1,    38016, 0x22701379
-0,       1375,       1375,        1,    38016, 0x19462a6b
-0,       1376,       1376,        1,    38016, 0x4f6b41e0
-0,       1377,       1377,        1,    38016, 0x9d344fcc
-0,       1378,       1378,        1,    38016, 0x60625fa9
-0,       1379,       1379,        1,    38016, 0xeb377eae
-0,       1380,       1380,        1,    38016, 0x0d9f945d
-0,       1381,       1381,        1,    38016, 0x4d0fb1dc
-0,       1382,       1382,        1,    38016, 0x0b580421
-0,       1383,       1383,        1,    38016, 0x30f3191a
-0,       1384,       1384,        1,    38016, 0xc5f7295c
-0,       1385,       1385,        1,    38016, 0xc4ad35e9
-0,       1386,       1386,        1,    38016, 0x25964387
-0,       1387,       1387,        1,    38016, 0x3a805820
-0,       1388,       1388,        1,    38016, 0x67e26985
-0,       1389,       1389,        1,    38016, 0x518f7941
-0,       1390,       1390,        1,    38016, 0x2a7982e1
-0,       1391,       1391,        1,    38016, 0x54aa84f0
-0,       1392,       1392,        1,    38016, 0x3d808f45
-0,       1393,       1393,        1,    38016, 0x5dae923c
-0,       1394,       1394,        1,    38016, 0xa2a99ccf
-0,       1395,       1395,        1,    38016, 0xefdd9a77
-0,       1396,       1396,        1,    38016, 0x246fcfa5
-0,       1397,       1397,        1,    38016, 0xe315cbcd
-0,       1398,       1398,        1,    38016, 0x4825df58
-0,       1399,       1399,        1,    38016, 0x0e241554
-0,       1400,       1400,        1,    38016, 0x968d8433
-0,       1401,       1401,        1,    38016, 0x97eec628
-0,       1402,       1402,        1,    38016, 0x7c4cb603
-0,       1403,       1403,        1,    38016, 0x6d11e7bf
-0,       1404,       1404,        1,    38016, 0xae041b61
-0,       1405,       1405,        1,    38016, 0x385e040c
-0,       1406,       1406,        1,    38016, 0x449e357a
-0,       1407,       1407,        1,    38016, 0x997f4aac
-0,       1408,       1408,        1,    38016, 0xd68c4f8b
-0,       1409,       1409,        1,    38016, 0xb3b962eb
-0,       1410,       1410,        1,    38016, 0x4685adc2
-0,       1411,       1411,        1,    38016, 0xed0d7473
-0,       1412,       1412,        1,    38016, 0xd069c0bb
-0,       1413,       1413,        1,    38016, 0x76abcd8e
-0,       1414,       1414,        1,    38016, 0xd6c096da
-0,       1415,       1415,        1,    38016, 0x76c2bab5
-0,       1416,       1416,        1,    38016, 0x1461dfb3
-0,       1417,       1417,        1,    38016, 0xf979f59f
-0,       1418,       1418,        1,    38016, 0x0554f985
-0,       1419,       1419,        1,    38016, 0x11c6d2a3
-0,       1420,       1420,        1,    38016, 0xe6e3faee
-0,       1421,       1421,        1,    38016, 0x6ceafbcc
-0,       1422,       1422,        1,    38016, 0x429b02e1
-0,       1423,       1423,        1,    38016, 0x97bd03f1
-0,       1424,       1424,        1,    38016, 0x78330c48
-0,       1425,       1425,        1,    38016, 0xb2720325
-0,       1426,       1426,        1,    38016, 0x26d412ab
-0,       1427,       1427,        1,    38016, 0xb6fb1b5c
-0,       1428,       1428,        1,    38016, 0xde8d300a
-0,       1429,       1429,        1,    38016, 0x7d28450e
-0,       1430,       1430,        1,    38016, 0xb3c5fbef
-0,       1431,       1431,        1,    38016, 0x2222f726
-0,       1432,       1432,        1,    38016, 0x66f7f42f
-0,       1433,       1433,        1,    38016, 0xef8af722
-0,       1434,       1434,        1,    38016, 0x4ac0f8d7
-0,       1435,       1435,        1,    38016, 0x5bfe5c81
-0,       1436,       1436,        1,    38016, 0x4afb6df9
-0,       1437,       1437,        1,    38016, 0xa8128a37
-0,       1438,       1438,        1,    38016, 0x1fc79ed0
-0,       1439,       1439,        1,    38016, 0x9967a997
-0,       1440,       1440,        1,    38016, 0x7bb5f6e1
-0,       1441,       1441,        1,    38016, 0xdda90122
-0,       1442,       1442,        1,    38016, 0x81700c1a
-0,       1443,       1443,        1,    38016, 0x9e121e77
-0,       1444,       1444,        1,    38016, 0xf58926a3
-0,       1445,       1445,        1,    38016, 0x4d1431a4
-0,       1446,       1446,        1,    38016, 0x0de6e741
-0,       1447,       1447,        1,    38016, 0x3ae9f601
-0,       1448,       1448,        1,    38016, 0xbed2e950
-0,       1449,       1449,        1,    38016, 0x619f100d
-0,       1450,       1450,        1,    38016, 0x6fa4a4e2
-0,       1451,       1451,        1,    38016, 0x316cddcd
-0,       1452,       1452,        1,    38016, 0x03132791
-0,       1453,       1453,        1,    38016, 0x10122784
-0,       1454,       1454,        1,    38016, 0x0e732980
-0,       1455,       1455,        1,    38016, 0x382d26f9
-0,       1456,       1456,        1,    38016, 0x651028fd
-0,       1457,       1457,        1,    38016, 0x61732850
-0,       1458,       1458,        1,    38016, 0x47912dde
-0,       1459,       1459,        1,    38016, 0xe3a12fdc
-0,       1460,       1460,        1,    38016, 0x8bc332ff
-0,       1461,       1461,        1,    38016, 0xcc3a3cdc
-0,       1462,       1462,        1,    38016, 0x190e2fec
-0,       1463,       1463,        1,    38016, 0x236c3291
-0,       1464,       1464,        1,    38016, 0xc0e55dd3
-0,       1465,       1465,        1,    38016, 0x06c85411
-0,       1466,       1466,        1,    38016, 0x0c0b3091
-0,       1467,       1467,        1,    38016, 0x8c1333cd
-0,       1468,       1468,        1,    38016, 0x51b339a5
-0,       1469,       1469,        1,    38016, 0x2d5b33ef
-0,       1470,       1470,        1,    38016, 0x73f0395b
-0,       1471,       1471,        1,    38016, 0x505b42d3
-0,       1472,       1472,        1,    38016, 0x56e44c7f
-0,       1473,       1473,        1,    38016, 0x26465781
-0,       1474,       1474,        1,    38016, 0x1d14800d
-0,       1475,       1475,        1,    38016, 0x752cb297
-0,       1476,       1476,        1,    38016, 0x0c3ab720
-0,       1477,       1477,        1,    38016, 0x21c2f136
-0,       1478,       1478,        1,    38016, 0xbae8b293
-0,       1479,       1479,        1,    38016, 0xe4b2fe9b
-0,       1480,       1480,        1,    38016, 0xfaaf0394
-0,       1481,       1481,        1,    38016, 0xa6f61d4b
-0,       1482,       1482,        1,    38016, 0x0e205192
-0,       1483,       1483,        1,    38016, 0x9b3c5c1f
-0,       1484,       1484,        1,    38016, 0x3b93552f
-0,       1485,       1485,        1,    38016, 0xe56e5b54
-0,       1486,       1486,        1,    38016, 0xa1c26095
-0,       1487,       1487,        1,    38016, 0x1eb66e41
-0,       1488,       1488,        1,    38016, 0x83eb6e83
-0,       1489,       1489,        1,    38016, 0xc8a979d3
-0,       1490,       1490,        1,    38016, 0x81fb7b32
-0,       1491,       1491,        1,    38016, 0xe07928b7
-0,       1492,       1492,        1,    38016, 0x38591267
-0,       1493,       1493,        1,    38016, 0xce563165
-0,       1494,       1494,        1,    38016, 0x5fec3563
-0,       1495,       1495,        1,    38016, 0xd7402c7c
-0,       1496,       1496,        1,    38016, 0xf2a93af4
-0,       1497,       1497,        1,    38016, 0x78f22fe7
-0,       1498,       1498,        1,    38016, 0x25554875
-0,       1499,       1499,        1,    38016, 0x79546ca2
-0,       1500,       1500,        1,    38016, 0xdae2814a
-0,       1501,       1501,        1,    38016, 0xf1ef9a9e
-0,       1502,       1502,        1,    38016, 0xb76d8b83
-0,       1503,       1503,        1,    38016, 0x1abf8fa8
-0,       1504,       1504,        1,    38016, 0x8f098fa4
-0,       1505,       1505,        1,    38016, 0xb098843c
-0,       1506,       1506,        1,    38016, 0x1d5186d3
-0,       1507,       1507,        1,    38016, 0x93f4923c
-0,       1508,       1508,        1,    38016, 0x496094e2
-0,       1509,       1509,        1,    38016, 0x7aea93f1
-0,       1510,       1510,        1,    38016, 0x556c6675
-0,       1511,       1511,        1,    38016, 0x90566aca
-0,       1512,       1512,        1,    38016, 0x14899a93
-0,       1513,       1513,        1,    38016, 0xd269e0e7
-0,       1514,       1514,        1,    38016, 0x1261d2cc
-0,       1515,       1515,        1,    38016, 0x299c9301
-0,       1516,       1516,        1,    38016, 0xee9c9ba5
-0,       1517,       1517,        1,    38016, 0xb48ab676
-0,       1518,       1518,        1,    38016, 0x4ef9b1c5
-0,       1519,       1519,        1,    38016, 0x8aae9912
-0,       1520,       1520,        1,    38016, 0x1bc09f53
-0,       1521,       1521,        1,    38016, 0x2e089c6b
-0,       1522,       1522,        1,    38016, 0x67598f8d
-0,       1523,       1523,        1,    38016, 0xacd394e1
-0,       1524,       1524,        1,    38016, 0xe2979b75
-0,       1525,       1525,        1,    38016, 0xb9749ff9
-0,       1526,       1526,        1,    38016, 0x02bda2f0
-0,       1527,       1527,        1,    38016, 0xe6caa499
-0,       1528,       1528,        1,    38016, 0xc6d9a547
-0,       1529,       1529,        1,    38016, 0x1c89aa34
-0,       1530,       1530,        1,    38016, 0x61feb4fc
-0,       1531,       1531,        1,    38016, 0x2a40b1f4
-0,       1532,       1532,        1,    38016, 0x4ad3ac08
-0,       1533,       1533,        1,    38016, 0xf5e8b06d
-0,       1534,       1534,        1,    38016, 0xb0eea800
-0,       1535,       1535,        1,    38016, 0x430cc535
-0,       1536,       1536,        1,    38016, 0x8e66b9cf
-0,       1537,       1537,        1,    38016, 0x5c68b4c4
-0,       1538,       1538,        1,    38016, 0x9381c64b
-0,       1539,       1539,        1,    38016, 0x4234bed7
-0,       1540,       1540,        1,    38016, 0xce72bf02
-0,       1541,       1541,        1,    38016, 0xb8cfbcd7
-0,       1542,       1542,        1,    38016, 0x75a5b1bd
-0,       1543,       1543,        1,    38016, 0xc27fb9eb
-0,       1544,       1544,        1,    38016, 0xa1b1bc62
-0,       1545,       1545,        1,    38016, 0x1cdeb0a3
-0,       1546,       1546,        1,    38016, 0xaea6a799
-0,       1547,       1547,        1,    38016, 0x8152ac4f
-0,       1548,       1548,        1,    38016, 0x59c1a66d
-0,       1549,       1549,        1,    38016, 0x6bd99f24
-0,       1550,       1550,        1,    38016, 0x96a73236
-0,       1551,       1551,        1,    38016, 0xb27e4856
-0,       1552,       1552,        1,    38016, 0x8b57447a
-0,       1553,       1553,        1,    38016, 0xcef84a21
-0,       1554,       1554,        1,    38016, 0x5babc7cc
-0,       1555,       1555,        1,    38016, 0x6ed2cec3
-0,       1556,       1556,        1,    38016, 0xa2efdc17
-0,       1557,       1557,        1,    38016, 0x47bad971
-0,       1558,       1558,        1,    38016, 0x150dffd4
-0,       1559,       1559,        1,    38016, 0x3ecef2ad
-0,       1560,       1560,        1,    38016, 0x355cdade
-0,       1561,       1561,        1,    38016, 0x3b15e809
-0,       1562,       1562,        1,    38016, 0x37fcf890
-0,       1563,       1563,        1,    38016, 0x8ca606d1
-0,       1564,       1564,        1,    38016, 0x51cafefe
-0,       1565,       1565,        1,    38016, 0x736be64a
-0,       1566,       1566,        1,    38016, 0x4f2052c1
-0,       1567,       1567,        1,    38016, 0xc6715e93
-0,       1568,       1568,        1,    38016, 0x765c5a58
-0,       1569,       1569,        1,    38016, 0x5abe5617
-0,       1570,       1570,        1,    38016, 0xb1ac540a
-0,       1571,       1571,        1,    38016, 0xd9f75c21
-0,       1572,       1572,        1,    38016, 0x0c1946c0
-0,       1573,       1573,        1,    38016, 0x93363a34
-0,       1574,       1574,        1,    38016, 0x2c9f2fe4
-0,       1575,       1575,        1,    38016, 0x023c321a
-0,       1576,       1576,        1,    38016, 0x1931314b
-0,       1577,       1577,        1,    38016, 0x16782d59
-0,       1578,       1578,        1,    38016, 0x29aa289f
-0,       1579,       1579,        1,    38016, 0xea0ddb85
-0,       1580,       1580,        1,    38016, 0xe09ae656
-0,       1581,       1581,        1,    38016, 0x682ff29f
-0,       1582,       1582,        1,    38016, 0xf3ac29ca
-0,       1583,       1583,        1,    38016, 0x95160cad
-0,       1584,       1584,        1,    38016, 0x9afa093c
-0,       1585,       1585,        1,    38016, 0x2ad30958
-0,       1586,       1586,        1,    38016, 0x4b600e3a
-0,       1587,       1587,        1,    38016, 0x5b0e099b
-0,       1588,       1588,        1,    38016, 0x2d2aff9b
-0,       1589,       1589,        1,    38016, 0x8bb10aa6
-0,       1590,       1590,        1,    38016, 0xfebe1f1d
-0,       1591,       1591,        1,    38016, 0xa4431abd
-0,       1592,       1592,        1,    38016, 0xef7729a6
-0,       1593,       1593,        1,    38016, 0x7b5b1f78
-0,       1594,       1594,        1,    38016, 0x903b203e
-0,       1595,       1595,        1,    38016, 0xbcc716a2
-0,       1596,       1596,        1,    38016, 0xee6c1f4c
-0,       1597,       1597,        1,    38016, 0xc78c2ab8
-0,       1598,       1598,        1,    38016, 0xa77a255a
-0,       1599,       1599,        1,    38016, 0x9d5815fc
-0,       1600,       1600,        1,    38016, 0x7d5e7d79
-0,       1601,       1601,        1,    38016, 0xf7989072
-0,       1602,       1602,        1,    38016, 0x45499feb
-0,       1603,       1603,        1,    38016, 0xc58aae7b
-0,       1604,       1604,        1,    38016, 0x882aa1cb
-0,       1605,       1605,        1,    38016, 0x56cd97bf
-0,       1606,       1606,        1,    38016, 0x2d6af920
-0,       1607,       1607,        1,    38016, 0x43c312eb
-0,       1608,       1608,        1,    38016, 0x12872b9f
-0,       1609,       1609,        1,    38016, 0x3c623ffe
-0,       1610,       1610,        1,    38016, 0x120e302d
-0,       1611,       1611,        1,    38016, 0x9cb43964
-0,       1612,       1612,        1,    38016, 0xb371311c
-0,       1613,       1613,        1,    38016, 0x28b523d4
-0,       1614,       1614,        1,    38016, 0x58031bff
-0,       1615,       1615,        1,    38016, 0xe6691818
-0,       1616,       1616,        1,    38016, 0x6a9b29c3
-0,       1617,       1617,        1,    38016, 0x794b25ce
-0,       1618,       1618,        1,    38016, 0xfc273119
-0,       1619,       1619,        1,    38016, 0x82ad2a3a
-0,       1620,       1620,        1,    38016, 0x9d2da281
-0,       1621,       1621,        1,    38016, 0x11271ba1
-0,       1622,       1622,        1,    38016, 0x1558b618
-0,       1623,       1623,        1,    38016, 0xf5d8c22f
-0,       1624,       1624,        1,    38016, 0xf20214f9
-0,       1625,       1625,        1,    38016, 0x15b01f3a
-0,       1626,       1626,        1,    38016, 0x68f2b533
-0,       1627,       1627,        1,    38016, 0x9686a827
-0,       1628,       1628,        1,    38016, 0xf214a2dc
-0,       1629,       1629,        1,    38016, 0x3d421eb0
-0,       1630,       1630,        1,    38016, 0x78251e60
-0,       1631,       1631,        1,    38016, 0xab092856
-0,       1632,       1632,        1,    38016, 0x5eaba7bc
-0,       1633,       1633,        1,    38016, 0x612fb699
-0,       1634,       1634,        1,    38016, 0x8a83a3fd
-0,       1635,       1635,        1,    38016, 0xbcd9919b
-0,       1636,       1636,        1,    38016, 0xb9063049
-0,       1637,       1637,        1,    38016, 0x5cb22fde
-0,       1638,       1638,        1,    38016, 0x7db92390
-0,       1639,       1639,        1,    38016, 0x801b241b
-0,       1640,       1640,        1,    38016, 0x6eeb8e1b
-0,       1641,       1641,        1,    38016, 0x660b9568
-0,       1642,       1642,        1,    38016, 0x2a5b8b3d
-0,       1643,       1643,        1,    38016, 0x15098b9a
-0,       1644,       1644,        1,    38016, 0xd29284f5
-0,       1645,       1645,        1,    38016, 0x839323c6
-0,       1646,       1646,        1,    38016, 0xd6a4212c
-0,       1647,       1647,        1,    38016, 0x1c1c2259
-0,       1648,       1648,        1,    38016, 0x0b1d2ef2
-0,       1649,       1649,        1,    38016, 0xecd52cfc
-0,       1650,       1650,        1,    38016, 0x419326cb
-0,       1651,       1651,        1,    38016, 0xea813e68
-0,       1652,       1652,        1,    38016, 0xba9a33ba
-0,       1653,       1653,        1,    38016, 0x703b3b25
-0,       1654,       1654,        1,    38016, 0x391c3cce
-0,       1655,       1655,        1,    38016, 0xd1533fe3
-0,       1656,       1656,        1,    38016, 0xb9361f10
-0,       1657,       1657,        1,    38016, 0x8d652ea6
-0,       1658,       1658,        1,    38016, 0x22dc15ae
-0,       1659,       1659,        1,    38016, 0x2e5e0ee7
-0,       1660,       1660,        1,    38016, 0xd6bd15cf
-0,       1661,       1661,        1,    38016, 0xb16f198a
-0,       1662,       1662,        1,    38016, 0xd9653e95
-0,       1663,       1663,        1,    38016, 0x39da2e3a
-0,       1664,       1664,        1,    38016, 0x01b12526
-0,       1665,       1665,        1,    38016, 0x94a52dde
-0,       1666,       1666,        1,    38016, 0xda0c32d8
-0,       1667,       1667,        1,    38016, 0x89af2566
-0,       1668,       1668,        1,    38016, 0x71961a43
-0,       1669,       1669,        1,    38016, 0x5fb91337
-0,       1670,       1670,        1,    38016, 0x6e430a84
-0,       1671,       1671,        1,    38016, 0x1defffb2
-0,       1672,       1672,        1,    38016, 0xcc93023f
-0,       1673,       1673,        1,    38016, 0xfcd60168
-0,       1674,       1674,        1,    38016, 0x8a3201d4
-0,       1675,       1675,        1,    38016, 0x5235fef3
-0,       1676,       1676,        1,    38016, 0x989121b9
-0,       1677,       1677,        1,    38016, 0x067a1d36
-0,       1678,       1678,        1,    38016, 0xa168242b
-0,       1679,       1679,        1,    38016, 0x425f2475
-0,       1680,       1680,        1,    38016, 0x298f14d9
-0,       1681,       1681,        1,    38016, 0x3a7c1838
-0,       1682,       1682,        1,    38016, 0xd173155a
-0,       1683,       1683,        1,    38016, 0x210113ec
-0,       1684,       1684,        1,    38016, 0xa0c2f88f
-0,       1685,       1685,        1,    38016, 0x4fa1f4e2
-0,       1686,       1686,        1,    38016, 0x812df750
-0,       1687,       1687,        1,    38016, 0xfd5cea45
-0,       1688,       1688,        1,    38016, 0xb823ee4a
-0,       1689,       1689,        1,    38016, 0x3555d6bf
-0,       1690,       1690,        1,    38016, 0x6dabf021
-0,       1691,       1691,        1,    38016, 0x7ae0f191
-0,       1692,       1692,        1,    38016, 0xabdc1546
-0,       1693,       1693,        1,    38016, 0x36dd0dbb
-0,       1694,       1694,        1,    38016, 0x008ffe5f
-0,       1695,       1695,        1,    38016, 0xe956f9c0
-0,       1696,       1696,        1,    38016, 0x9823ee03
-0,       1697,       1697,        1,    38016, 0xf63fedde
-0,       1698,       1698,        1,    38016, 0x67530afb
-0,       1699,       1699,        1,    38016, 0x2da5e470
diff --git a/deps/libav/tests/ref/fate/h264-conformance-midr_mw_d b/deps/libav/tests/ref/fate/h264-conformance-midr_mw_d
deleted file mode 100644
index 51b7c0e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-midr_mw_d
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x3ae838ee
-0,          1,          1,        1,    38016, 0x9ed7e141
-0,          2,          2,        1,    38016, 0x393097f9
-0,          3,          3,        1,    38016, 0x8fb56676
-0,          4,          4,        1,    38016, 0x39d64fd2
-0,          5,          5,        1,    38016, 0x7fad729a
-0,          6,          6,        1,    38016, 0x7e25955f
-0,          7,          7,        1,    38016, 0xc4d9a359
-0,          8,          8,        1,    38016, 0x30afaca4
-0,          9,          9,        1,    38016, 0x9ee195ea
-0,         10,         10,        1,    38016, 0x09f65805
-0,         11,         11,        1,    38016, 0x58d126ab
-0,         12,         12,        1,    38016, 0x4f29282c
-0,         13,         13,        1,    38016, 0x8af235a1
-0,         14,         14,        1,    38016, 0x6dfe525a
-0,         15,         15,        1,    38016, 0xd51c793f
-0,         16,         16,        1,    38016, 0x4e90abba
-0,         17,         17,        1,    38016, 0xe706c5b7
-0,         18,         18,        1,    38016, 0x35fab7ef
-0,         19,         19,        1,    38016, 0xed78b8fc
-0,         20,         20,        1,    38016, 0x2907bb4e
-0,         21,         21,        1,    38016, 0x1749bb47
-0,         22,         22,        1,    38016, 0x284ec688
-0,         23,         23,        1,    38016, 0x534abc24
-0,         24,         24,        1,    38016, 0xcd01bd13
-0,         25,         25,        1,    38016, 0xe97bbd51
-0,         26,         26,        1,    38016, 0xac1cb9e9
-0,         27,         27,        1,    38016, 0xd861c0a3
-0,         28,         28,        1,    38016, 0xf0f1ced4
-0,         29,         29,        1,    38016, 0xa9e8d2bf
-0,         30,         30,        1,    38016, 0x4c6aa7c5
-0,         31,         31,        1,    38016, 0xb20079ac
-0,         32,         32,        1,    38016, 0xbfc3563b
-0,         33,         33,        1,    38016, 0x48259358
-0,         34,         34,        1,    38016, 0x1bce0434
-0,         35,         35,        1,    38016, 0xa0ac59db
-0,         36,         36,        1,    38016, 0x87bdb608
-0,         37,         37,        1,    38016, 0x318037eb
-0,         38,         38,        1,    38016, 0x0f7d8496
-0,         39,         39,        1,    38016, 0x9e65bc1e
-0,         40,         40,        1,    38016, 0xc56be1ea
-0,         41,         41,        1,    38016, 0xc31fefb7
-0,         42,         42,        1,    38016, 0xcbcee4e4
-0,         43,         43,        1,    38016, 0xcf03f238
-0,         44,         44,        1,    38016, 0xc6a903a1
-0,         45,         45,        1,    38016, 0xfdabee4f
-0,         46,         46,        1,    38016, 0x9054bb39
-0,         47,         47,        1,    38016, 0xe9bf8cd8
-0,         48,         48,        1,    38016, 0x943d9e0a
-0,         49,         49,        1,    38016, 0x404cc87d
-0,         50,         50,        1,    38016, 0x3cd9dd49
-0,         51,         51,        1,    38016, 0x5eabbdf1
-0,         52,         52,        1,    38016, 0xd206d9ef
-0,         53,         53,        1,    38016, 0x75e310ad
-0,         54,         54,        1,    38016, 0x01893e25
-0,         55,         55,        1,    38016, 0xda5360e6
-0,         56,         56,        1,    38016, 0x80656a39
-0,         57,         57,        1,    38016, 0x85452c84
-0,         58,         58,        1,    38016, 0x48d92ef7
-0,         59,         59,        1,    38016, 0x0edc45b2
-0,         60,         60,        1,    38016, 0xeb8a3531
-0,         61,         61,        1,    38016, 0x7b5914b5
-0,         62,         62,        1,    38016, 0xf1b6c7fa
-0,         63,         63,        1,    38016, 0x68fca853
-0,         64,         64,        1,    38016, 0x68ebcc02
-0,         65,         65,        1,    38016, 0x793edc8e
-0,         66,         66,        1,    38016, 0x9c86d139
-0,         67,         67,        1,    38016, 0x2aeed2f9
-0,         68,         68,        1,    38016, 0xb8cfc89d
-0,         69,         69,        1,    38016, 0x22d2b5c4
-0,         70,         70,        1,    38016, 0x01ae9d2d
-0,         71,         71,        1,    38016, 0x4e9b7c84
-0,         72,         72,        1,    38016, 0xa52c8553
-0,         73,         73,        1,    38016, 0x50df78d0
-0,         74,         74,        1,    38016, 0x4dc31f1c
-0,         75,         75,        1,    38016, 0xf24ee29a
-0,         76,         76,        1,    38016, 0xced0d363
-0,         77,         77,        1,    38016, 0x2263bfdc
-0,         78,         78,        1,    38016, 0x1363f580
-0,         79,         79,        1,    38016, 0xfc7f3a50
-0,         80,         80,        1,    38016, 0x38427007
-0,         81,         81,        1,    38016, 0xfc5757eb
-0,         82,         82,        1,    38016, 0xf20f4d0b
-0,         83,         83,        1,    38016, 0x64871ca3
-0,         84,         84,        1,    38016, 0xcb66cd99
-0,         85,         85,        1,    38016, 0xaacdda1f
-0,         86,         86,        1,    38016, 0xd52206c8
-0,         87,         87,        1,    38016, 0xcb461142
-0,         88,         88,        1,    38016, 0x9e36a3b3
-0,         89,         89,        1,    38016, 0xf3b44a7c
-0,         90,         90,        1,    38016, 0x1722db32
-0,         91,         91,        1,    38016, 0xa943d602
-0,         92,         92,        1,    38016, 0xc899e7bf
-0,         93,         93,        1,    38016, 0xacd10bdc
-0,         94,         94,        1,    38016, 0x703b3802
-0,         95,         95,        1,    38016, 0xe246efb4
-0,         96,         96,        1,    38016, 0x1ebfccb2
-0,         97,         97,        1,    38016, 0x57380778
-0,         98,         98,        1,    38016, 0xb70e7313
-0,         99,         99,        1,    38016, 0x0cd4af3d
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mps_mw_a b/deps/libav/tests/ref/fate/h264-conformance-mps_mw_a
deleted file mode 100644
index 959a0ae..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mps_mw_a
+++ /dev/null
@@ -1,151 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x06150e88
-0,          1,          1,        1,    38016, 0x32d90103
-0,          2,          2,        1,    38016, 0x5b5f2fae
-0,          3,          3,        1,    38016, 0xba6e6302
-0,          4,          4,        1,    38016, 0x6c4b8e95
-0,          5,          5,        1,    38016, 0x6d51ab43
-0,          6,          6,        1,    38016, 0x5582a7c5
-0,          7,          7,        1,    38016, 0xf48e6545
-0,          8,          8,        1,    38016, 0x083a8481
-0,          9,          9,        1,    38016, 0x0576a254
-0,         10,         10,        1,    38016, 0x07429a61
-0,         11,         11,        1,    38016, 0xd1e26eb1
-0,         12,         12,        1,    38016, 0x94032564
-0,         13,         13,        1,    38016, 0xc9d217c0
-0,         14,         14,        1,    38016, 0xf0ee3f46
-0,         15,         15,        1,    38016, 0xe8fc4d97
-0,         16,         16,        1,    38016, 0xd3b0488d
-0,         17,         17,        1,    38016, 0xc4243d99
-0,         18,         18,        1,    38016, 0xa65b36ed
-0,         19,         19,        1,    38016, 0x84ca1844
-0,         20,         20,        1,    38016, 0xcd6706bf
-0,         21,         21,        1,    38016, 0x1c03ec0a
-0,         22,         22,        1,    38016, 0xf1380127
-0,         23,         23,        1,    38016, 0xa499e0a5
-0,         24,         24,        1,    38016, 0x5fca87ce
-0,         25,         25,        1,    38016, 0x0b385064
-0,         26,         26,        1,    38016, 0x6a4f49c4
-0,         27,         27,        1,    38016, 0x97e0464b
-0,         28,         28,        1,    38016, 0xcbf98750
-0,         29,         29,        1,    38016, 0xa9efe0cd
-0,         30,         30,        1,    38016, 0x9ea7d82e
-0,         31,         31,        1,    38016, 0x28cec5ce
-0,         32,         32,        1,    38016, 0xaec6ac1e
-0,         33,         33,        1,    38016, 0x8cba69b3
-0,         34,         34,        1,    38016, 0x727720c1
-0,         35,         35,        1,    38016, 0xee4f4822
-0,         36,         36,        1,    38016, 0x9d456e11
-0,         37,         37,        1,    38016, 0x14123f91
-0,         38,         38,        1,    38016, 0xf5e1d1a3
-0,         39,         39,        1,    38016, 0xaadd9435
-0,         40,         40,        1,    38016, 0x94df6e5e
-0,         41,         41,        1,    38016, 0x18805412
-0,         42,         42,        1,    38016, 0x0ba26c8c
-0,         43,         43,        1,    38016, 0x4548a5c1
-0,         44,         44,        1,    38016, 0x9217cb5f
-0,         45,         45,        1,    38016, 0x2ea74a9e
-0,         46,         46,        1,    38016, 0xeb0c57b6
-0,         47,         47,        1,    38016, 0xf968a4a5
-0,         48,         48,        1,    38016, 0xa410ef43
-0,         49,         49,        1,    38016, 0x55813001
-0,         50,         50,        1,    38016, 0x9cea4512
-0,         51,         51,        1,    38016, 0x27754fa6
-0,         52,         52,        1,    38016, 0x9824548a
-0,         53,         53,        1,    38016, 0x7f1047eb
-0,         54,         54,        1,    38016, 0x75fb2e10
-0,         55,         55,        1,    38016, 0xe50df970
-0,         56,         56,        1,    38016, 0x6ed6dfb4
-0,         57,         57,        1,    38016, 0x8e97ccee
-0,         58,         58,        1,    38016, 0x7f96c5f0
-0,         59,         59,        1,    38016, 0x0940c200
-0,         60,         60,        1,    38016, 0x86b98701
-0,         61,         61,        1,    38016, 0x977d759a
-0,         62,         62,        1,    38016, 0xf2b17bff
-0,         63,         63,        1,    38016, 0xee1496d7
-0,         64,         64,        1,    38016, 0x6cb1c1b5
-0,         65,         65,        1,    38016, 0xa6bc0db9
-0,         66,         66,        1,    38016, 0x902f660d
-0,         67,         67,        1,    38016, 0x7bf7a434
-0,         68,         68,        1,    38016, 0x97f9c2a6
-0,         69,         69,        1,    38016, 0xf8bf9241
-0,         70,         70,        1,    38016, 0x8639502b
-0,         71,         71,        1,    38016, 0x82c2537f
-0,         72,         72,        1,    38016, 0x1141243a
-0,         73,         73,        1,    38016, 0xcaef5ae5
-0,         74,         74,        1,    38016, 0xe2c4d308
-0,         75,         75,        1,    38016, 0x35530a2c
-0,         76,         76,        1,    38016, 0x22a3b317
-0,         77,         77,        1,    38016, 0xda988427
-0,         78,         78,        1,    38016, 0x54616f11
-0,         79,         79,        1,    38016, 0xc38fc57c
-0,         80,         80,        1,    38016, 0x7039d019
-0,         81,         81,        1,    38016, 0x0fd6e6d9
-0,         82,         82,        1,    38016, 0xc213e48e
-0,         83,         83,        1,    38016, 0xf469b8e1
-0,         84,         84,        1,    38016, 0x1f5c706c
-0,         85,         85,        1,    38016, 0x69652db3
-0,         86,         86,        1,    38016, 0xe1b9d46d
-0,         87,         87,        1,    38016, 0x4e7522aa
-0,         88,         88,        1,    38016, 0x8f4025a4
-0,         89,         89,        1,    38016, 0xbc0483f6
-0,         90,         90,        1,    38016, 0xae91d342
-0,         91,         91,        1,    38016, 0xb1435578
-0,         92,         92,        1,    38016, 0xf7535863
-0,         93,         93,        1,    38016, 0xc16ff613
-0,         94,         94,        1,    38016, 0x55bc394f
-0,         95,         95,        1,    38016, 0xc7b76458
-0,         96,         96,        1,    38016, 0xd3fd69ae
-0,         97,         97,        1,    38016, 0x4b44d724
-0,         98,         98,        1,    38016, 0x740b99c5
-0,         99,         99,        1,    38016, 0x40c7c625
-0,        100,        100,        1,    38016, 0x1691a7ef
-0,        101,        101,        1,    38016, 0x6ea9392e
-0,        102,        102,        1,    38016, 0xf958200f
-0,        103,        103,        1,    38016, 0x916d75eb
-0,        104,        104,        1,    38016, 0x6b4bee69
-0,        105,        105,        1,    38016, 0x87adf9de
-0,        106,        106,        1,    38016, 0x92dc586e
-0,        107,        107,        1,    38016, 0x3c5aa531
-0,        108,        108,        1,    38016, 0x00f81488
-0,        109,        109,        1,    38016, 0x981aeb9f
-0,        110,        110,        1,    38016, 0x49cf8e5f
-0,        111,        111,        1,    38016, 0xfd56b231
-0,        112,        112,        1,    38016, 0x419aaa2e
-0,        113,        113,        1,    38016, 0xae155602
-0,        114,        114,        1,    38016, 0x1e530aa1
-0,        115,        115,        1,    38016, 0x60ca2c1b
-0,        116,        116,        1,    38016, 0x0e7bdec7
-0,        117,        117,        1,    38016, 0xe858b864
-0,        118,        118,        1,    38016, 0x47378c1d
-0,        119,        119,        1,    38016, 0x90008a4d
-0,        120,        120,        1,    38016, 0xa1293af0
-0,        121,        121,        1,    38016, 0x596964a8
-0,        122,        122,        1,    38016, 0xb25d9ccf
-0,        123,        123,        1,    38016, 0xccdbb7a0
-0,        124,        124,        1,    38016, 0x3becf25a
-0,        125,        125,        1,    38016, 0x918d1816
-0,        126,        126,        1,    38016, 0x71d02564
-0,        127,        127,        1,    38016, 0x643015fd
-0,        128,        128,        1,    38016, 0x3af5f577
-0,        129,        129,        1,    38016, 0x77b5ecea
-0,        130,        130,        1,    38016, 0x7f940014
-0,        131,        131,        1,    38016, 0x726f0bf3
-0,        132,        132,        1,    38016, 0xb728078f
-0,        133,        133,        1,    38016, 0x46e1f70a
-0,        134,        134,        1,    38016, 0x79ccdd3e
-0,        135,        135,        1,    38016, 0x80d2ca75
-0,        136,        136,        1,    38016, 0xc87dc034
-0,        137,        137,        1,    38016, 0x7535c12a
-0,        138,        138,        1,    38016, 0x2d32bd77
-0,        139,        139,        1,    38016, 0x2fceb360
-0,        140,        140,        1,    38016, 0x8d0aa592
-0,        141,        141,        1,    38016, 0xc9b9bb80
-0,        142,        142,        1,    38016, 0xa667dd9c
-0,        143,        143,        1,    38016, 0x7b5df35b
-0,        144,        144,        1,    38016, 0x5feb1125
-0,        145,        145,        1,    38016, 0x222a306f
-0,        146,        146,        1,    38016, 0x64c84c75
-0,        147,        147,        1,    38016, 0x5e605c79
-0,        148,        148,        1,    38016, 0x2d2f78f3
-0,        149,        149,        1,    38016, 0x7b72973d
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr1_bt_a b/deps/libav/tests/ref/fate/h264-conformance-mr1_bt_a
deleted file mode 100644
index 11eb590..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr1_bt_a
+++ /dev/null
@@ -1,63 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xc6658719
-0,          1,          1,        1,    38016, 0x8a7c7423
-0,          2,          2,        1,    38016, 0x97e99b66
-0,          3,          3,        1,    38016, 0x73c4c4f7
-0,          4,          4,        1,    38016, 0xb45bfb44
-0,          5,          5,        1,    38016, 0x1bc3249c
-0,          6,          6,        1,    38016, 0xd98a3121
-0,          7,          7,        1,    38016, 0x6f0aefc1
-0,          8,          8,        1,    38016, 0x6287f651
-0,          9,          9,        1,    38016, 0x2a4a1630
-0,         10,         10,        1,    38016, 0x5e7b5a35
-0,         11,         11,        1,    38016, 0x58847533
-0,         12,         12,        1,    38016, 0x2bad942b
-0,         13,         13,        1,    38016, 0x17d75cb1
-0,         14,         14,        1,    38016, 0x6d8e818d
-0,         15,         15,        1,    38016, 0xfa3165db
-0,         16,         16,        1,    38016, 0x6a6e249f
-0,         17,         17,        1,    38016, 0x2d232ece
-0,         18,         18,        1,    38016, 0xfba6616e
-0,         19,         19,        1,    38016, 0xa9e7533f
-0,         20,         20,        1,    38016, 0x7c4827e6
-0,         21,         21,        1,    38016, 0xf570f8ca
-0,         22,         22,        1,    38016, 0x0dac953f
-0,         23,         23,        1,    38016, 0x74cb5f30
-0,         24,         24,        1,    38016, 0x038ce61b
-0,         25,         25,        1,    38016, 0x291f8ecb
-0,         26,         26,        1,    38016, 0x768a6539
-0,         27,         27,        1,    38016, 0x27a960e6
-0,         28,         28,        1,    38016, 0x4d8ab279
-0,         29,         29,        1,    38016, 0x7da78115
-0,         30,         30,        1,    38016, 0x27beadcf
-0,         31,         31,        1,    38016, 0x98c43180
-0,         32,         32,        1,    38016, 0x566d55db
-0,         33,         33,        1,    38016, 0xddc19fda
-0,         34,         34,        1,    38016, 0xe353c891
-0,         35,         35,        1,    38016, 0x17e2e3ab
-0,         36,         36,        1,    38016, 0x8759e7c3
-0,         37,         37,        1,    38016, 0x9d93bca9
-0,         38,         38,        1,    38016, 0x8b77af4e
-0,         39,         39,        1,    38016, 0x9b799dac
-0,         40,         40,        1,    38016, 0xcb8bc504
-0,         41,         41,        1,    38016, 0x58e989c8
-0,         42,         42,        1,    38016, 0x4e4dbb7f
-0,         43,         43,        1,    38016, 0xdfa6934e
-0,         44,         44,        1,    38016, 0x14947459
-0,         45,         45,        1,    38016, 0x7a31ff6a
-0,         46,         46,        1,    38016, 0xc044fbc3
-0,         47,         47,        1,    38016, 0xcaa723d1
-0,         48,         48,        1,    38016, 0x325c1dca
-0,         49,         49,        1,    38016, 0x62fb027d
-0,         50,         50,        1,    38016, 0x710f3ae9
-0,         51,         51,        1,    38016, 0xdbbf1804
-0,         52,         52,        1,    38016, 0x1487f491
-0,         53,         53,        1,    38016, 0x6a722d73
-0,         54,         54,        1,    38016, 0xeb7258dd
-0,         55,         55,        1,    38016, 0x685e8a68
-0,         56,         56,        1,    38016, 0x1627800e
-0,         57,         57,        1,    38016, 0xa88a9a31
-0,         58,         58,        1,    38016, 0x4d5eaf56
-0,         59,         59,        1,    38016, 0xe3a9af0a
-0,         60,         60,        1,    38016, 0x3c38b8b2
-0,         61,         61,        1,    38016, 0x991fc29e
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr1_mw_a b/deps/libav/tests/ref/fate/h264-conformance-mr1_mw_a
deleted file mode 100644
index da7631d..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr1_mw_a
+++ /dev/null
@@ -1,151 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xc8981780
-0,          1,          1,        1,    38016, 0xf089d880
-0,          2,          2,        1,    38016, 0x5eee0731
-0,          3,          3,        1,    38016, 0x79604e7c
-0,          4,          4,        1,    38016, 0xb92186a9
-0,          5,          5,        1,    38016, 0xe18ea8d9
-0,          6,          6,        1,    38016, 0xedb599dd
-0,          7,          7,        1,    38016, 0xc2665a04
-0,          8,          8,        1,    38016, 0x88387c78
-0,          9,          9,        1,    38016, 0x70b09638
-0,         10,         10,        1,    38016, 0xb5629ba8
-0,         11,         11,        1,    38016, 0xc8ee696b
-0,         12,         12,        1,    38016, 0x9af12088
-0,         13,         13,        1,    38016, 0x044f1510
-0,         14,         14,        1,    38016, 0x04153fcc
-0,         15,         15,        1,    38016, 0x6a433225
-0,         16,         16,        1,    38016, 0x8fb43d81
-0,         17,         17,        1,    38016, 0x708c5884
-0,         18,         18,        1,    38016, 0xb2fa310d
-0,         19,         19,        1,    38016, 0xa54f23bf
-0,         20,         20,        1,    38016, 0x875d12a9
-0,         21,         21,        1,    38016, 0xa7c2f3e5
-0,         22,         22,        1,    38016, 0xba120362
-0,         23,         23,        1,    38016, 0xf922ead0
-0,         24,         24,        1,    38016, 0x23c38ae4
-0,         25,         25,        1,    38016, 0x8e705ad0
-0,         26,         26,        1,    38016, 0x60854be9
-0,         27,         27,        1,    38016, 0x63163fd9
-0,         28,         28,        1,    38016, 0x6d5886bd
-0,         29,         29,        1,    38016, 0xd66fdaaa
-0,         30,         30,        1,    38016, 0xcda78bc1
-0,         31,         31,        1,    38016, 0x7e11aa47
-0,         32,         32,        1,    38016, 0x4ac4ceba
-0,         33,         33,        1,    38016, 0x80a45b77
-0,         34,         34,        1,    38016, 0x6d1a19f9
-0,         35,         35,        1,    38016, 0xd2b93d81
-0,         36,         36,        1,    38016, 0x4532dc5a
-0,         37,         37,        1,    38016, 0x874c3d28
-0,         38,         38,        1,    38016, 0xbeb4552c
-0,         39,         39,        1,    38016, 0xd85e8b6d
-0,         40,         40,        1,    38016, 0x4c3a6953
-0,         41,         41,        1,    38016, 0xf8615235
-0,         42,         42,        1,    38016, 0x9b3e613a
-0,         43,         43,        1,    38016, 0xfbba9dd5
-0,         44,         44,        1,    38016, 0x435fbc73
-0,         45,         45,        1,    38016, 0x15746d9d
-0,         46,         46,        1,    38016, 0xfc6c2960
-0,         47,         47,        1,    38016, 0x80c41d21
-0,         48,         48,        1,    38016, 0xa621c891
-0,         49,         49,        1,    38016, 0x24ce0e8b
-0,         50,         50,        1,    38016, 0x15552d28
-0,         51,         51,        1,    38016, 0xbc0b3703
-0,         52,         52,        1,    38016, 0x81643dee
-0,         53,         53,        1,    38016, 0x479c42ea
-0,         54,         54,        1,    38016, 0x63d426db
-0,         55,         55,        1,    38016, 0x5830f8e4
-0,         56,         56,        1,    38016, 0xce24d921
-0,         57,         57,        1,    38016, 0x0224c7b9
-0,         58,         58,        1,    38016, 0x8f44bf31
-0,         59,         59,        1,    38016, 0xc3d5c00f
-0,         60,         60,        1,    38016, 0x13268498
-0,         61,         61,        1,    38016, 0x83b99095
-0,         62,         62,        1,    38016, 0xbb66a4b3
-0,         63,         63,        1,    38016, 0x9b849565
-0,         64,         64,        1,    38016, 0x81edbe5a
-0,         65,         65,        1,    38016, 0x43781090
-0,         66,         66,        1,    38016, 0x449c6974
-0,         67,         67,        1,    38016, 0xbe61a0e0
-0,         68,         68,        1,    38016, 0x5128c18e
-0,         69,         69,        1,    38016, 0x2bf68f94
-0,         70,         70,        1,    38016, 0x0fea4bbb
-0,         71,         71,        1,    38016, 0x7dd650d2
-0,         72,         72,        1,    38016, 0xc4332d1d
-0,         73,         73,        1,    38016, 0xc7946d1c
-0,         74,         74,        1,    38016, 0x6856e33f
-0,         75,         75,        1,    38016, 0x567f7cc2
-0,         76,         76,        1,    38016, 0x378bafed
-0,         77,         77,        1,    38016, 0x3f710f7c
-0,         78,         78,        1,    38016, 0x5d866a75
-0,         79,         79,        1,    38016, 0xe264bdc7
-0,         80,         80,        1,    38016, 0x48b2cbe9
-0,         81,         81,        1,    38016, 0x0a4be700
-0,         82,         82,        1,    38016, 0xcc4ed40d
-0,         83,         83,        1,    38016, 0x93acaf5a
-0,         84,         84,        1,    38016, 0xdd7465f2
-0,         85,         85,        1,    38016, 0x4d492419
-0,         86,         86,        1,    38016, 0xc2c2ca96
-0,         87,         87,        1,    38016, 0x190324d8
-0,         88,         88,        1,    38016, 0xd8962520
-0,         89,         89,        1,    38016, 0x8d917eea
-0,         90,         90,        1,    38016, 0x08ec794f
-0,         91,         91,        1,    38016, 0x7ab598a6
-0,         92,         92,        1,    38016, 0xaaec0ef7
-0,         93,         93,        1,    38016, 0x7f6ffbe3
-0,         94,         94,        1,    38016, 0x116d37cb
-0,         95,         95,        1,    38016, 0x7b3a59fd
-0,         96,         96,        1,    38016, 0xed5361cb
-0,         97,         97,        1,    38016, 0x9c558a98
-0,         98,         98,        1,    38016, 0x292e84ea
-0,         99,         99,        1,    38016, 0x0d35bf44
-0,        100,        100,        1,    38016, 0xaad7bedd
-0,        101,        101,        1,    38016, 0xa6111b87
-0,        102,        102,        1,    38016, 0x3c8bfc27
-0,        103,        103,        1,    38016, 0x65ce6703
-0,        104,        104,        1,    38016, 0x60ece2ec
-0,        105,        105,        1,    38016, 0x8abbb25f
-0,        106,        106,        1,    38016, 0x41108b27
-0,        107,        107,        1,    38016, 0xac26284e
-0,        108,        108,        1,    38016, 0x5f4c0db0
-0,        109,        109,        1,    38016, 0xcccbee91
-0,        110,        110,        1,    38016, 0x34238dc1
-0,        111,        111,        1,    38016, 0x7479b326
-0,        112,        112,        1,    38016, 0xaaf8a957
-0,        113,        113,        1,    38016, 0xc49b55cb
-0,        114,        114,        1,    38016, 0x338b129f
-0,        115,        115,        1,    38016, 0xf0ed3328
-0,        116,        116,        1,    38016, 0x39f8dcb3
-0,        117,        117,        1,    38016, 0x7aecb808
-0,        118,        118,        1,    38016, 0x35e8827a
-0,        119,        119,        1,    38016, 0x16ac8b9d
-0,        120,        120,        1,    38016, 0x3abdcb78
-0,        121,        121,        1,    38016, 0xdfbfba7f
-0,        122,        122,        1,    38016, 0x692a964e
-0,        123,        123,        1,    38016, 0x11a5ebdb
-0,        124,        124,        1,    38016, 0x46bc156d
-0,        125,        125,        1,    38016, 0x1b153144
-0,        126,        126,        1,    38016, 0xdd23349a
-0,        127,        127,        1,    38016, 0xbad02161
-0,        128,        128,        1,    38016, 0xc5030168
-0,        129,        129,        1,    38016, 0x3e4ff28d
-0,        130,        130,        1,    38016, 0x17faffe2
-0,        131,        131,        1,    38016, 0xba04122f
-0,        132,        132,        1,    38016, 0x8a8e0e1e
-0,        133,        133,        1,    38016, 0xe5d6fc7d
-0,        134,        134,        1,    38016, 0x22e3e630
-0,        135,        135,        1,    38016, 0x7eb1a935
-0,        136,        136,        1,    38016, 0xde46bead
-0,        137,        137,        1,    38016, 0x34abc542
-0,        138,        138,        1,    38016, 0x10ceaea3
-0,        139,        139,        1,    38016, 0xb86fa676
-0,        140,        140,        1,    38016, 0xbd9d9d3c
-0,        141,        141,        1,    38016, 0x355fb37f
-0,        142,        142,        1,    38016, 0xfb6fd3b0
-0,        143,        143,        1,    38016, 0x3062edf4
-0,        144,        144,        1,    38016, 0xf6940b60
-0,        145,        145,        1,    38016, 0x78bd2f4e
-0,        146,        146,        1,    38016, 0x51fc444f
-0,        147,        147,        1,    38016, 0x118957cc
-0,        148,        148,        1,    38016, 0x53777a50
-0,        149,        149,        1,    38016, 0xeeaa9761
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr2_mw_a b/deps/libav/tests/ref/fate/h264-conformance-mr2_mw_a
deleted file mode 100644
index fd4b5d9..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr2_mw_a
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x06150e88
-0,          1,          1,        1,    38016, 0x32d90103
-0,          2,          2,        1,    38016, 0xb32d338f
-0,          3,          3,        1,    38016, 0x653c5fc3
-0,          4,          4,        1,    38016, 0x69ec8bce
-0,          5,          5,        1,    38016, 0x354fa53a
-0,          6,          6,        1,    38016, 0x2ee79c2c
-0,          7,          7,        1,    38016, 0x2c50666c
-0,          8,          8,        1,    38016, 0x65ea824d
-0,          9,          9,        1,    38016, 0x7419948b
-0,         10,         10,        1,    38016, 0x19b298a0
-0,         11,         11,        1,    38016, 0x29087291
-0,         12,         12,        1,    38016, 0x92be1e95
-0,         13,         13,        1,    38016, 0x9699119a
-0,         14,         14,        1,    38016, 0xa4863bff
-0,         15,         15,        1,    38016, 0x7dfc4f6b
-0,         16,         16,        1,    38016, 0x946e5cfa
-0,         17,         17,        1,    38016, 0x57287bdc
-0,         18,         18,        1,    38016, 0xe7ae8bbe
-0,         19,         19,        1,    38016, 0x21d367c7
-0,         20,         20,        1,    38016, 0x9d0551c2
-0,         21,         21,        1,    38016, 0xecc980b5
-0,         22,         22,        1,    38016, 0x0ac4a749
-0,         23,         23,        1,    38016, 0x9162262f
-0,         24,         24,        1,    38016, 0x4a071c14
-0,         25,         25,        1,    38016, 0x8571fae8
-0,         26,         26,        1,    38016, 0xc0843707
-0,         27,         27,        1,    38016, 0x7b4a63b0
-0,         28,         28,        1,    38016, 0x5faf5d86
-0,         29,         29,        1,    38016, 0x64623f6b
-0,         30,         30,        1,    38016, 0xa97b523a
-0,         31,         31,        1,    38016, 0x4048459a
-0,         32,         32,        1,    38016, 0x56ba3d73
-0,         33,         33,        1,    38016, 0x5394355a
-0,         34,         34,        1,    38016, 0xb6c0176e
-0,         35,         35,        1,    38016, 0x668c0772
-0,         36,         36,        1,    38016, 0x86feeae8
-0,         37,         37,        1,    38016, 0x9e75f9af
-0,         38,         38,        1,    38016, 0xd72de054
-0,         39,         39,        1,    38016, 0x39eb8743
-0,         40,         40,        1,    38016, 0xd07b4d8e
-0,         41,         41,        1,    38016, 0x89c045a9
-0,         42,         42,        1,    38016, 0x209542e6
-0,         43,         43,        1,    38016, 0xc43886ed
-0,         44,         44,        1,    38016, 0xe091e433
-0,         45,         45,        1,    38016, 0x176b1f65
-0,         46,         46,        1,    38016, 0xd7730c3e
-0,         47,         47,        1,    38016, 0x2bb90778
-0,         48,         48,        1,    38016, 0x9b4540a8
-0,         49,         49,        1,    38016, 0xd34c50db
-0,         50,         50,        1,    38016, 0xf8007af9
-0,         51,         51,        1,    38016, 0x54748466
-0,         52,         52,        1,    38016, 0x20ab88a5
-0,         53,         53,        1,    38016, 0x6aca8887
-0,         54,         54,        1,    38016, 0xa1bf899f
-0,         55,         55,        1,    38016, 0x8145966d
-0,         56,         56,        1,    38016, 0x98f5a29c
-0,         57,         57,        1,    38016, 0x4ed1b4d1
-0,         58,         58,        1,    38016, 0x3177b95c
-0,         59,         59,        1,    38016, 0x2b2cc4b2
-0,         60,         60,        1,    38016, 0xf389db1e
-0,         61,         61,        1,    38016, 0xfc6fca35
-0,         62,         62,        1,    38016, 0x5f06af41
-0,         63,         63,        1,    38016, 0x93a368d6
-0,         64,         64,        1,    38016, 0x3de421f3
-0,         65,         65,        1,    38016, 0x1e3f4b8d
-0,         66,         66,        1,    38016, 0x6c3e6d4a
-0,         67,         67,        1,    38016, 0x96ab4569
-0,         68,         68,        1,    38016, 0x0de2d417
-0,         69,         69,        1,    38016, 0x1a8a8d91
-0,         70,         70,        1,    38016, 0xffb96503
-0,         71,         71,        1,    38016, 0x1e1b4959
-0,         72,         72,        1,    38016, 0x6aa267cd
-0,         73,         73,        1,    38016, 0xcb87a00c
-0,         74,         74,        1,    38016, 0x3b8ac17c
-0,         75,         75,        1,    38016, 0x1348bf7b
-0,         76,         76,        1,    38016, 0x1807b42d
-0,         77,         77,        1,    38016, 0x22dfa6cb
-0,         78,         78,        1,    38016, 0x3d23a622
-0,         79,         79,        1,    38016, 0x662cb1e0
-0,         80,         80,        1,    38016, 0x6ecfafaf
-0,         81,         81,        1,    38016, 0xbffcaa71
-0,         82,         82,        1,    38016, 0xf75ab93f
-0,         83,         83,        1,    38016, 0xaea796bf
-0,         84,         84,        1,    38016, 0x4a547fe8
-0,         85,         85,        1,    38016, 0x2f1a800f
-0,         86,         86,        1,    38016, 0xc7788261
-0,         87,         87,        1,    38016, 0x8be17fd3
-0,         88,         88,        1,    38016, 0xe830830c
-0,         89,         89,        1,    38016, 0x62345ab7
-0,         90,         90,        1,    38016, 0x70f926c6
-0,         91,         91,        1,    38016, 0x37e94bf0
-0,         92,         92,        1,    38016, 0xb1509312
-0,         93,         93,        1,    38016, 0xc70fea7a
-0,         94,         94,        1,    38016, 0x8062243b
-0,         95,         95,        1,    38016, 0xe64a48b1
-0,         96,         96,        1,    38016, 0x6f0c4dd7
-0,         97,         97,        1,    38016, 0x5f9c53b4
-0,         98,         98,        1,    38016, 0x4c5e506c
-0,         99,         99,        1,    38016, 0xb7c631ef
-0,        100,        100,        1,    38016, 0x30f302a9
-0,        101,        101,        1,    38016, 0x4f28ebf0
-0,        102,        102,        1,    38016, 0x3145d3d3
-0,        103,        103,        1,    38016, 0x69b6c92f
-0,        104,        104,        1,    38016, 0xa3b2c646
-0,        105,        105,        1,    38016, 0x5ee00dec
-0,        106,        106,        1,    38016, 0x313ee3ea
-0,        107,        107,        1,    38016, 0x4002070e
-0,        108,        108,        1,    38016, 0x5e0106b1
-0,        109,        109,        1,    38016, 0xd03b2c4d
-0,        110,        110,        1,    38016, 0xdd085316
-0,        111,        111,        1,    38016, 0xb47a5f86
-0,        112,        112,        1,    38016, 0xc25d5750
-0,        113,        113,        1,    38016, 0x16ad52b3
-0,        114,        114,        1,    38016, 0xa4fe2754
-0,        115,        115,        1,    38016, 0xac5dfb18
-0,        116,        116,        1,    38016, 0xe36ee83b
-0,        117,        117,        1,    38016, 0xc708e54e
-0,        118,        118,        1,    38016, 0x6c4beb85
-0,        119,        119,        1,    38016, 0xf19fd825
-0,        120,        120,        1,    38016, 0x94e7bb13
-0,        121,        121,        1,    38016, 0x026e9ddf
-0,        122,        122,        1,    38016, 0xdc71a591
-0,        123,        123,        1,    38016, 0xb46eb169
-0,        124,        124,        1,    38016, 0x25f5d5f4
-0,        125,        125,        1,    38016, 0x27da203d
-0,        126,        126,        1,    38016, 0xed217513
-0,        127,        127,        1,    38016, 0x78d7bb08
-0,        128,        128,        1,    38016, 0x623dd66d
-0,        129,        129,        1,    38016, 0xd68c9f82
-0,        130,        130,        1,    38016, 0x88b059e2
-0,        131,        131,        1,    38016, 0x623159aa
-0,        132,        132,        1,    38016, 0x1782245b
-0,        133,        133,        1,    38016, 0x64f55b4a
-0,        134,        134,        1,    38016, 0x83c7d154
-0,        135,        135,        1,    38016, 0x43461c7c
-0,        136,        136,        1,    38016, 0xc3e38c36
-0,        137,        137,        1,    38016, 0x763394b4
-0,        138,        138,        1,    38016, 0xff99749d
-0,        139,        139,        1,    38016, 0x76ca13d0
-0,        140,        140,        1,    38016, 0x29510aea
-0,        141,        141,        1,    38016, 0x385f4309
-0,        142,        142,        1,    38016, 0x142f5339
-0,        143,        143,        1,    38016, 0x980ca66e
-0,        144,        144,        1,    38016, 0xc330c0db
-0,        145,        145,        1,    38016, 0xa7dbca0f
-0,        146,        146,        1,    38016, 0x4261c683
-0,        147,        147,        1,    38016, 0x6d467d81
-0,        148,        148,        1,    38016, 0x1a107d17
-0,        149,        149,        1,    38016, 0xd91e765a
-0,        150,        150,        1,    38016, 0x789cfb94
-0,        151,        151,        1,    38016, 0xc9bc9ee1
-0,        152,        152,        1,    38016, 0x32f8754c
-0,        153,        153,        1,    38016, 0xad906454
-0,        154,        154,        1,    38016, 0xe5d6b78d
-0,        155,        155,        1,    38016, 0x307bc291
-0,        156,        156,        1,    38016, 0x629bdec9
-0,        157,        157,        1,    38016, 0xf23ccd36
-0,        158,        158,        1,    38016, 0x6105aa1b
-0,        159,        159,        1,    38016, 0x3da66383
-0,        160,        160,        1,    38016, 0x48ce2141
-0,        161,        161,        1,    38016, 0x09fac5fd
-0,        162,        162,        1,    38016, 0xa0bc208d
-0,        163,        163,        1,    38016, 0x49892a74
-0,        164,        164,        1,    38016, 0xfcb48093
-0,        165,        165,        1,    38016, 0x850e7e4c
-0,        166,        166,        1,    38016, 0x7cf24f55
-0,        167,        167,        1,    38016, 0x654845f4
-0,        168,        168,        1,    38016, 0x35ac5d63
-0,        169,        169,        1,    38016, 0x795ea726
-0,        170,        170,        1,    38016, 0xf387a03d
-0,        171,        171,        1,    38016, 0x29279e19
-0,        172,        172,        1,    38016, 0x48e3b03d
-0,        173,        173,        1,    38016, 0xbcfb8192
-0,        174,        174,        1,    38016, 0x3fe2749a
-0,        175,        175,        1,    38016, 0xe0a04bbd
-0,        176,        176,        1,    38016, 0x9a912cd7
-0,        177,        177,        1,    38016, 0x39781e59
-0,        178,        178,        1,    38016, 0x90e5131a
-0,        179,        179,        1,    38016, 0x8bd90b4b
-0,        180,        180,        1,    38016, 0x410dda61
-0,        181,        181,        1,    38016, 0x33eb60fd
-0,        182,        182,        1,    38016, 0x08e8632b
-0,        183,        183,        1,    38016, 0x6163fd94
-0,        184,        184,        1,    38016, 0x60af34e1
-0,        185,        185,        1,    38016, 0x00016227
-0,        186,        186,        1,    38016, 0xe6bd71bd
-0,        187,        187,        1,    38016, 0xb40cdf28
-0,        188,        188,        1,    38016, 0x3cdeb88e
-0,        189,        189,        1,    38016, 0xb9ffe0d6
-0,        190,        190,        1,    38016, 0xd630ce53
-0,        191,        191,        1,    38016, 0x120056c2
-0,        192,        192,        1,    38016, 0x0940399e
-0,        193,        193,        1,    38016, 0x3d337fd0
-0,        194,        194,        1,    38016, 0x6ef1f4b9
-0,        195,        195,        1,    38016, 0x7e20f462
-0,        196,        196,        1,    38016, 0xe397f30a
-0,        197,        197,        1,    38016, 0x6eadf916
-0,        198,        198,        1,    38016, 0x850e07b9
-0,        199,        199,        1,    38016, 0x131b10db
-0,        200,        200,        1,    38016, 0x17961d0e
-0,        201,        201,        1,    38016, 0x447557da
-0,        202,        202,        1,    38016, 0x93da7c0e
-0,        203,        203,        1,    38016, 0xd6259239
-0,        204,        204,        1,    38016, 0x2db99d95
-0,        205,        205,        1,    38016, 0x648ea2bd
-0,        206,        206,        1,    38016, 0xf8f46ef6
-0,        207,        207,        1,    38016, 0xb85a7405
-0,        208,        208,        1,    38016, 0x55dc7bbd
-0,        209,        209,        1,    38016, 0xf38d76f8
-0,        210,        210,        1,    38016, 0x9e860b96
-0,        211,        211,        1,    38016, 0x7c5a5da7
-0,        212,        212,        1,    38016, 0xdf36a619
-0,        213,        213,        1,    38016, 0x327d1144
-0,        214,        214,        1,    38016, 0x4a01eabd
-0,        215,        215,        1,    38016, 0xee8b8717
-0,        216,        216,        1,    38016, 0x874eaf23
-0,        217,        217,        1,    38016, 0xddaaaf38
-0,        218,        218,        1,    38016, 0xcab85271
-0,        219,        219,        1,    38016, 0x970f0d3f
-0,        220,        220,        1,    38016, 0x2a042dcc
-0,        221,        221,        1,    38016, 0xa240e0e7
-0,        222,        222,        1,    38016, 0x9564c081
-0,        223,        223,        1,    38016, 0x894d82b4
-0,        224,        224,        1,    38016, 0xb0748d24
-0,        225,        225,        1,    38016, 0xafa56340
-0,        226,        226,        1,    38016, 0x614287c6
-0,        227,        227,        1,    38016, 0x4dfcaaac
-0,        228,        228,        1,    38016, 0x58dab168
-0,        229,        229,        1,    38016, 0x19fbb779
-0,        230,        230,        1,    38016, 0x25adb4c9
-0,        231,        231,        1,    38016, 0x5fc1bdae
-0,        232,        232,        1,    38016, 0x6581a5d0
-0,        233,        233,        1,    38016, 0x81d57061
-0,        234,        234,        1,    38016, 0x43445964
-0,        235,        235,        1,    38016, 0x68224a19
-0,        236,        236,        1,    38016, 0xa85d390a
-0,        237,        237,        1,    38016, 0xb571344d
-0,        238,        238,        1,    38016, 0xd3632bfd
-0,        239,        239,        1,    38016, 0x5af52535
-0,        240,        240,        1,    38016, 0x21b93882
-0,        241,        241,        1,    38016, 0x8da56743
-0,        242,        242,        1,    38016, 0x9e7b9da2
-0,        243,        243,        1,    38016, 0xc1a6bbd9
-0,        244,        244,        1,    38016, 0xd77be9aa
-0,        245,        245,        1,    38016, 0x2715100f
-0,        246,        246,        1,    38016, 0xac8c1e30
-0,        247,        247,        1,    38016, 0x110c14b9
-0,        248,        248,        1,    38016, 0x5a8ff5c4
-0,        249,        249,        1,    38016, 0x25d4ef19
-0,        250,        250,        1,    38016, 0x080ffe7f
-0,        251,        251,        1,    38016, 0x7f5b15ef
-0,        252,        252,        1,    38016, 0xf97f10e1
-0,        253,        253,        1,    38016, 0xdd80f7e5
-0,        254,        254,        1,    38016, 0xb177df60
-0,        255,        255,        1,    38016, 0x406023f6
-0,        256,        256,        1,    38016, 0xf396220f
-0,        257,        257,        1,    38016, 0x50fc2e7a
-0,        258,        258,        1,    38016, 0x959b42da
-0,        259,        259,        1,    38016, 0x61c7484a
-0,        260,        260,        1,    38016, 0x09825cd1
-0,        261,        261,        1,    38016, 0x0e7b6bd9
-0,        262,        262,        1,    38016, 0x4a386b9e
-0,        263,        263,        1,    38016, 0x817b5e14
-0,        264,        264,        1,    38016, 0x51696069
-0,        265,        265,        1,    38016, 0x84a35f51
-0,        266,        266,        1,    38016, 0xf7758da3
-0,        267,        267,        1,    38016, 0x787b6659
-0,        268,        268,        1,    38016, 0xedb95942
-0,        269,        269,        1,    38016, 0x4d4d8eb5
-0,        270,        270,        1,    38016, 0x716cb36a
-0,        271,        271,        1,    38016, 0x6556b912
-0,        272,        272,        1,    38016, 0xbdd8c0b6
-0,        273,        273,        1,    38016, 0xd9ffbba5
-0,        274,        274,        1,    38016, 0xb5d7b4a7
-0,        275,        275,        1,    38016, 0x4690a4ed
-0,        276,        276,        1,    38016, 0x6fc8bdc4
-0,        277,        277,        1,    38016, 0x827de512
-0,        278,        278,        1,    38016, 0x897bfc43
-0,        279,        279,        1,    38016, 0x41f8144a
-0,        280,        280,        1,    38016, 0xff7d369e
-0,        281,        281,        1,    38016, 0x526f48fa
-0,        282,        282,        1,    38016, 0x53245921
-0,        283,        283,        1,    38016, 0x69a3791e
-0,        284,        284,        1,    38016, 0x3de095df
-0,        285,        285,        1,    38016, 0x9ae2a0f2
-0,        286,        286,        1,    38016, 0xd1668593
-0,        287,        287,        1,    38016, 0x322c4f5b
-0,        288,        288,        1,    38016, 0x15882875
-0,        289,        289,        1,    38016, 0xa8886b9a
-0,        290,        290,        1,    38016, 0xc6f07ac1
-0,        291,        291,        1,    38016, 0xf9446d58
-0,        292,        292,        1,    38016, 0x98ef5ffc
-0,        293,        293,        1,    38016, 0x23434b21
-0,        294,        294,        1,    38016, 0xa1f353d2
-0,        295,        295,        1,    38016, 0x6b3d4452
-0,        296,        296,        1,    38016, 0xd4ac32bf
-0,        297,        297,        1,    38016, 0xc577065d
-0,        298,        298,        1,    38016, 0x2d01111d
-0,        299,        299,        1,    38016, 0xf51721d4
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr2_tandberg_e b/deps/libav/tests/ref/fate/h264-conformance-mr2_tandberg_e
deleted file mode 100644
index 8fbac9f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr2_tandberg_e
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb96f1feb
-0,          1,          1,        1,    38016, 0xca461abd
-0,          2,          2,        1,    38016, 0x578a0c87
-0,          3,          3,        1,    38016, 0xb3cc1ecb
-0,          4,          4,        1,    38016, 0xd2c84463
-0,          5,          5,        1,    38016, 0x815d6363
-0,          6,          6,        1,    38016, 0x7cc17319
-0,          7,          7,        1,    38016, 0x0f7e8cab
-0,          8,          8,        1,    38016, 0x1876abee
-0,          9,          9,        1,    38016, 0x8f25bccd
-0,         10,         10,        1,    38016, 0xc1c7bb9c
-0,         11,         11,        1,    38016, 0xf861bdb5
-0,         12,         12,        1,    38016, 0xae1ac352
-0,         13,         13,        1,    38016, 0x9b6f990b
-0,         14,         14,        1,    38016, 0xa5217121
-0,         15,         15,        1,    38016, 0x12ac8367
-0,         16,         16,        1,    38016, 0x687f8526
-0,         17,         17,        1,    38016, 0x9b009a01
-0,         18,         18,        1,    38016, 0x9c629e04
-0,         19,         19,        1,    38016, 0xfee5a366
-0,         20,         20,        1,    38016, 0x264e9b00
-0,         21,         21,        1,    38016, 0xf89f9508
-0,         22,         22,        1,    38016, 0x19247145
-0,         23,         23,        1,    38016, 0xc4cd41bd
-0,         24,         24,        1,    38016, 0x035c2696
-0,         25,         25,        1,    38016, 0x22310e7f
-0,         26,         26,        1,    38016, 0xdd771898
-0,         27,         27,        1,    38016, 0x61522adf
-0,         28,         28,        1,    38016, 0x5eee412f
-0,         29,         29,        1,    38016, 0x03f05077
-0,         30,         30,        1,    38016, 0x69625001
-0,         31,         31,        1,    38016, 0x8e025073
-0,         32,         32,        1,    38016, 0x37374607
-0,         33,         33,        1,    38016, 0xc90547ea
-0,         34,         34,        1,    38016, 0xe9eb4193
-0,         35,         35,        1,    38016, 0xf7214070
-0,         36,         36,        1,    38016, 0xc3ce38de
-0,         37,         37,        1,    38016, 0xb99933cb
-0,         38,         38,        1,    38016, 0x5ee12b39
-0,         39,         39,        1,    38016, 0x13c921be
-0,         40,         40,        1,    38016, 0x66341136
-0,         41,         41,        1,    38016, 0x97710eef
-0,         42,         42,        1,    38016, 0xe5910c52
-0,         43,         43,        1,    38016, 0xbf9d0fbb
-0,         44,         44,        1,    38016, 0x0405177d
-0,         45,         45,        1,    38016, 0x25ec13da
-0,         46,         46,        1,    38016, 0xda29f457
-0,         47,         47,        1,    38016, 0x8e7dbe67
-0,         48,         48,        1,    38016, 0x64809802
-0,         49,         49,        1,    38016, 0xbd45731d
-0,         50,         50,        1,    38016, 0xf9e75c5b
-0,         51,         51,        1,    38016, 0x4509551e
-0,         52,         52,        1,    38016, 0xd73b54c9
-0,         53,         53,        1,    38016, 0x434d430e
-0,         54,         54,        1,    38016, 0xfbd940fe
-0,         55,         55,        1,    38016, 0xddb1612a
-0,         56,         56,        1,    38016, 0xffec797a
-0,         57,         57,        1,    38016, 0x4355aa0c
-0,         58,         58,        1,    38016, 0x1776d3e0
-0,         59,         59,        1,    38016, 0x7a64dd7f
-0,         60,         60,        1,    38016, 0xe619e56c
-0,         61,         61,        1,    38016, 0x43b0d8e7
-0,         62,         62,        1,    38016, 0x2103caf1
-0,         63,         63,        1,    38016, 0x808fbb8d
-0,         64,         64,        1,    38016, 0x0654ae1e
-0,         65,         65,        1,    38016, 0x8b6da03f
-0,         66,         66,        1,    38016, 0x15ee6b73
-0,         67,         67,        1,    38016, 0x8ab049c4
-0,         68,         68,        1,    38016, 0x7c6d351c
-0,         69,         69,        1,    38016, 0xe3fa3794
-0,         70,         70,        1,    38016, 0x5b3c581c
-0,         71,         71,        1,    38016, 0xf07a70e8
-0,         72,         72,        1,    38016, 0xcc378cb4
-0,         73,         73,        1,    38016, 0x15f49788
-0,         74,         74,        1,    38016, 0x23de74b4
-0,         75,         75,        1,    38016, 0x2e842db6
-0,         76,         76,        1,    38016, 0xd23cf2b9
-0,         77,         77,        1,    38016, 0xfbb7cea3
-0,         78,         78,        1,    38016, 0x05039bf0
-0,         79,         79,        1,    38016, 0x854d8c6c
-0,         80,         80,        1,    38016, 0x7d2770d7
-0,         81,         81,        1,    38016, 0x7e5f6374
-0,         82,         82,        1,    38016, 0x204753ee
-0,         83,         83,        1,    38016, 0x66906f4d
-0,         84,         84,        1,    38016, 0xf6ae700b
-0,         85,         85,        1,    38016, 0x64438aba
-0,         86,         86,        1,    38016, 0xc93aa41f
-0,         87,         87,        1,    38016, 0x27bdbdb7
-0,         88,         88,        1,    38016, 0x7aceb0a3
-0,         89,         89,        1,    38016, 0x751d81bd
-0,         90,         90,        1,    38016, 0xa86e3940
-0,         91,         91,        1,    38016, 0x9d022dd6
-0,         92,         92,        1,    38016, 0x0a484d7c
-0,         93,         93,        1,    38016, 0x6d555adb
-0,         94,         94,        1,    38016, 0xfe9799e0
-0,         95,         95,        1,    38016, 0x245ad49b
-0,         96,         96,        1,    38016, 0x6d22e3e3
-0,         97,         97,        1,    38016, 0xdffc00df
-0,         98,         98,        1,    38016, 0x34ec1984
-0,         99,         99,        1,    38016, 0x15172b1a
-0,        100,        100,        1,    38016, 0x05d742d8
-0,        101,        101,        1,    38016, 0xc94350fc
-0,        102,        102,        1,    38016, 0x3af65a84
-0,        103,        103,        1,    38016, 0xfbf96492
-0,        104,        104,        1,    38016, 0x1c8f6e2e
-0,        105,        105,        1,    38016, 0xe41677dc
-0,        106,        106,        1,    38016, 0xd36284e1
-0,        107,        107,        1,    38016, 0xa5f57f14
-0,        108,        108,        1,    38016, 0x6a7d70f4
-0,        109,        109,        1,    38016, 0x4c1a584f
-0,        110,        110,        1,    38016, 0x4f093dd3
-0,        111,        111,        1,    38016, 0x5a1634b3
-0,        112,        112,        1,    38016, 0xdd1a29b5
-0,        113,        113,        1,    38016, 0x28c81aa3
-0,        114,        114,        1,    38016, 0x681a0e29
-0,        115,        115,        1,    38016, 0x74110802
-0,        116,        116,        1,    38016, 0x468afe8a
-0,        117,        117,        1,    38016, 0xfbb609e0
-0,        118,        118,        1,    38016, 0x79d60da0
-0,        119,        119,        1,    38016, 0x0774036d
-0,        120,        120,        1,    38016, 0x904bf22d
-0,        121,        121,        1,    38016, 0xddeaedb5
-0,        122,        122,        1,    38016, 0x5de1d5af
-0,        123,        123,        1,    38016, 0xb9bad4cf
-0,        124,        124,        1,    38016, 0x452bcf0e
-0,        125,        125,        1,    38016, 0x9ab9cca8
-0,        126,        126,        1,    38016, 0x9b77d6ba
-0,        127,        127,        1,    38016, 0xb9f5dfaf
-0,        128,        128,        1,    38016, 0x7b33fac4
-0,        129,        129,        1,    38016, 0x25e41c67
-0,        130,        130,        1,    38016, 0x6af749b5
-0,        131,        131,        1,    38016, 0xe6576d07
-0,        132,        132,        1,    38016, 0x55a49498
-0,        133,        133,        1,    38016, 0x3bf4bd93
-0,        134,        134,        1,    38016, 0xba65cabb
-0,        135,        135,        1,    38016, 0x0c02de64
-0,        136,        136,        1,    38016, 0xdb86e742
-0,        137,        137,        1,    38016, 0x37acdf69
-0,        138,        138,        1,    38016, 0x8c1ea6be
-0,        139,        139,        1,    38016, 0x5295739e
-0,        140,        140,        1,    38016, 0xb2f85eb7
-0,        141,        141,        1,    38016, 0x17394375
-0,        142,        142,        1,    38016, 0x8a7f7528
-0,        143,        143,        1,    38016, 0x17c3e7a5
-0,        144,        144,        1,    38016, 0xbe1763ef
-0,        145,        145,        1,    38016, 0x236eab70
-0,        146,        146,        1,    38016, 0x4b3e9bbb
-0,        147,        147,        1,    38016, 0xc1d664f9
-0,        148,        148,        1,    38016, 0xc2300411
-0,        149,        149,        1,    38016, 0x1cf2903c
-0,        150,        150,        1,    38016, 0xd8783451
-0,        151,        151,        1,    38016, 0xf3c8ff31
-0,        152,        152,        1,    38016, 0xf6dfd324
-0,        153,        153,        1,    38016, 0x7b93b5d0
-0,        154,        154,        1,    38016, 0xf246a0f4
-0,        155,        155,        1,    38016, 0x5e970b10
-0,        156,        156,        1,    38016, 0xcb98878e
-0,        157,        157,        1,    38016, 0xc804f169
-0,        158,        158,        1,    38016, 0x801fec84
-0,        159,        159,        1,    38016, 0xb242ee41
-0,        160,        160,        1,    38016, 0xb8a7f3c1
-0,        161,        161,        1,    38016, 0x24b10420
-0,        162,        162,        1,    38016, 0x4b7601ab
-0,        163,        163,        1,    38016, 0x4c30f75a
-0,        164,        164,        1,    38016, 0x8e8cf5ae
-0,        165,        165,        1,    38016, 0xd94fefd2
-0,        166,        166,        1,    38016, 0x31c9c604
-0,        167,        167,        1,    38016, 0x09d29f6f
-0,        168,        168,        1,    38016, 0xa55e8075
-0,        169,        169,        1,    38016, 0x482d53da
-0,        170,        170,        1,    38016, 0x957e36f1
-0,        171,        171,        1,    38016, 0xcd261153
-0,        172,        172,        1,    38016, 0xbf08d284
-0,        173,        173,        1,    38016, 0x42957a37
-0,        174,        174,        1,    38016, 0x28b73287
-0,        175,        175,        1,    38016, 0xe6e33893
-0,        176,        176,        1,    38016, 0x7f0e3db5
-0,        177,        177,        1,    38016, 0xb80b46a3
-0,        178,        178,        1,    38016, 0x1ccca614
-0,        179,        179,        1,    38016, 0x531e2dfa
-0,        180,        180,        1,    38016, 0x0d95ef09
-0,        181,        181,        1,    38016, 0xb631a635
-0,        182,        182,        1,    38016, 0x4ed86a94
-0,        183,        183,        1,    38016, 0x919832ab
-0,        184,        184,        1,    38016, 0x724b60d5
-0,        185,        185,        1,    38016, 0x9965f58f
-0,        186,        186,        1,    38016, 0x7b04f567
-0,        187,        187,        1,    38016, 0x774740d6
-0,        188,        188,        1,    38016, 0xf8204134
-0,        189,        189,        1,    38016, 0xcbadfa7a
-0,        190,        190,        1,    38016, 0x9748728a
-0,        191,        191,        1,    38016, 0x973047e7
-0,        192,        192,        1,    38016, 0xcc52aa4d
-0,        193,        193,        1,    38016, 0x3fa7d81f
-0,        194,        194,        1,    38016, 0x7a33eddd
-0,        195,        195,        1,    38016, 0xe51ed885
-0,        196,        196,        1,    38016, 0xcc93b1a2
-0,        197,        197,        1,    38016, 0xf70cab47
-0,        198,        198,        1,    38016, 0x983eb17e
-0,        199,        199,        1,    38016, 0xdb02d6bb
-0,        200,        200,        1,    38016, 0xad99c4f9
-0,        201,        201,        1,    38016, 0xd0e5618c
-0,        202,        202,        1,    38016, 0x5eb05134
-0,        203,        203,        1,    38016, 0x4ce0cf23
-0,        204,        204,        1,    38016, 0x70de3edb
-0,        205,        205,        1,    38016, 0x3519c858
-0,        206,        206,        1,    38016, 0x1a4e785f
-0,        207,        207,        1,    38016, 0x8d09b6ee
-0,        208,        208,        1,    38016, 0x79b2fd7e
-0,        209,        209,        1,    38016, 0xcd5aa9a4
-0,        210,        210,        1,    38016, 0x1e1effd2
-0,        211,        211,        1,    38016, 0xa1d1b497
-0,        212,        212,        1,    38016, 0x5c036e34
-0,        213,        213,        1,    38016, 0x937f152b
-0,        214,        214,        1,    38016, 0xe434bed9
-0,        215,        215,        1,    38016, 0x09eb8913
-0,        216,        216,        1,    38016, 0x4d671935
-0,        217,        217,        1,    38016, 0x9c62f30c
-0,        218,        218,        1,    38016, 0x4d080e9c
-0,        219,        219,        1,    38016, 0x7fe23bb4
-0,        220,        220,        1,    38016, 0x95399638
-0,        221,        221,        1,    38016, 0x6aa41ac2
-0,        222,        222,        1,    38016, 0xe748bc32
-0,        223,        223,        1,    38016, 0x5fab449b
-0,        224,        224,        1,    38016, 0x8798bb84
-0,        225,        225,        1,    38016, 0x4e700879
-0,        226,        226,        1,    38016, 0x6d794fa4
-0,        227,        227,        1,    38016, 0xf40c9e13
-0,        228,        228,        1,    38016, 0x92330fdb
-0,        229,        229,        1,    38016, 0x558b899a
-0,        230,        230,        1,    38016, 0xec2320ed
-0,        231,        231,        1,    38016, 0x3179f275
-0,        232,        232,        1,    38016, 0x86cfd19d
-0,        233,        233,        1,    38016, 0x2c88c48a
-0,        234,        234,        1,    38016, 0x0c84b86f
-0,        235,        235,        1,    38016, 0x95069c90
-0,        236,        236,        1,    38016, 0x82da8061
-0,        237,        237,        1,    38016, 0x847f7634
-0,        238,        238,        1,    38016, 0x48d46d89
-0,        239,        239,        1,    38016, 0x220d81f3
-0,        240,        240,        1,    38016, 0x5cbe9a7e
-0,        241,        241,        1,    38016, 0xc0e9d5b9
-0,        242,        242,        1,    38016, 0xcc26ff97
-0,        243,        243,        1,    38016, 0x01332392
-0,        244,        244,        1,    38016, 0x44e44439
-0,        245,        245,        1,    38016, 0xfe8751ee
-0,        246,        246,        1,    38016, 0x010d74a1
-0,        247,        247,        1,    38016, 0xbf4a7c2d
-0,        248,        248,        1,    38016, 0x77869402
-0,        249,        249,        1,    38016, 0x1ae8b176
-0,        250,        250,        1,    38016, 0x917cc0b8
-0,        251,        251,        1,    38016, 0x3eb6d02a
-0,        252,        252,        1,    38016, 0x815ed568
-0,        253,        253,        1,    38016, 0xcd6bcd54
-0,        254,        254,        1,    38016, 0xd3e5bfcd
-0,        255,        255,        1,    38016, 0x95e2bd36
-0,        256,        256,        1,    38016, 0x102ca664
-0,        257,        257,        1,    38016, 0x95c59672
-0,        258,        258,        1,    38016, 0x1d5b8845
-0,        259,        259,        1,    38016, 0x3d988a4d
-0,        260,        260,        1,    38016, 0x4139a121
-0,        261,        261,        1,    38016, 0x9eeca508
-0,        262,        262,        1,    38016, 0xf9f2a9cc
-0,        263,        263,        1,    38016, 0x9420b177
-0,        264,        264,        1,    38016, 0x13edadd7
-0,        265,        265,        1,    38016, 0x3d18a416
-0,        266,        266,        1,    38016, 0x88b09166
-0,        267,        267,        1,    38016, 0x2e1c939c
-0,        268,        268,        1,    38016, 0x4f8381c3
-0,        269,        269,        1,    38016, 0x36647382
-0,        270,        270,        1,    38016, 0x26a272c1
-0,        271,        271,        1,    38016, 0x9a5a7cc8
-0,        272,        272,        1,    38016, 0xc2fc7734
-0,        273,        273,        1,    38016, 0xd21b7e6c
-0,        274,        274,        1,    38016, 0x948c77a0
-0,        275,        275,        1,    38016, 0x179e7d1a
-0,        276,        276,        1,    38016, 0xbfd17561
-0,        277,        277,        1,    38016, 0x30f97511
-0,        278,        278,        1,    38016, 0x893e6f54
-0,        279,        279,        1,    38016, 0x76036ecb
-0,        280,        280,        1,    38016, 0x3f0e6966
-0,        281,        281,        1,    38016, 0xed946afe
-0,        282,        282,        1,    38016, 0x2c2676de
-0,        283,        283,        1,    38016, 0x7b348c94
-0,        284,        284,        1,    38016, 0x77f5afc8
-0,        285,        285,        1,    38016, 0xdb54cea0
-0,        286,        286,        1,    38016, 0xc9fed974
-0,        287,        287,        1,    38016, 0x04bbe454
-0,        288,        288,        1,    38016, 0x7320ffb9
-0,        289,        289,        1,    38016, 0x841b199a
-0,        290,        290,        1,    38016, 0x7d792ee3
-0,        291,        291,        1,    38016, 0x5ce33607
-0,        292,        292,        1,    38016, 0xec52432e
-0,        293,        293,        1,    38016, 0xe6a04efe
-0,        294,        294,        1,    38016, 0xc7b45cef
-0,        295,        295,        1,    38016, 0xdbe76bf9
-0,        296,        296,        1,    38016, 0xd57f7e18
-0,        297,        297,        1,    38016, 0x8e03915d
-0,        298,        298,        1,    38016, 0x30779ec6
-0,        299,        299,        1,    38016, 0x89b1aa42
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr3_tandberg_b b/deps/libav/tests/ref/fate/h264-conformance-mr3_tandberg_b
deleted file mode 100644
index ee8014e..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr3_tandberg_b
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb96f1feb
-0,          1,          1,        1,    38016, 0xca461abd
-0,          2,          2,        1,    38016, 0x578a0c87
-0,          3,          3,        1,    38016, 0xb3cc1ecb
-0,          4,          4,        1,    38016, 0xd2c84463
-0,          5,          5,        1,    38016, 0x815d6363
-0,          6,          6,        1,    38016, 0x7cc17319
-0,          7,          7,        1,    38016, 0x0f7e8cab
-0,          8,          8,        1,    38016, 0x1876abee
-0,          9,          9,        1,    38016, 0xda748c2f
-0,         10,         10,        1,    38016, 0x7b4dbff0
-0,         11,         11,        1,    38016, 0xd4a1b24a
-0,         12,         12,        1,    38016, 0x714cb4cc
-0,         13,         13,        1,    38016, 0x2c6d80f0
-0,         14,         14,        1,    38016, 0x92266151
-0,         15,         15,        1,    38016, 0x6b766a23
-0,         16,         16,        1,    38016, 0xb24f7efe
-0,         17,         17,        1,    38016, 0x8410838e
-0,         18,         18,        1,    38016, 0x67fe872a
-0,         19,         19,        1,    38016, 0x55b49d36
-0,         20,         20,        1,    38016, 0x7a1c9c41
-0,         21,         21,        1,    38016, 0xb4818e0e
-0,         22,         22,        1,    38016, 0x25f6683c
-0,         23,         23,        1,    38016, 0xe4d141a4
-0,         24,         24,        1,    38016, 0x808216ad
-0,         25,         25,        1,    38016, 0x2acf0baf
-0,         26,         26,        1,    38016, 0xf3de13c4
-0,         27,         27,        1,    38016, 0x5f412187
-0,         28,         28,        1,    38016, 0xb31a340a
-0,         29,         29,        1,    38016, 0x019d42d1
-0,         30,         30,        1,    38016, 0xeeb94b9b
-0,         31,         31,        1,    38016, 0xef55472e
-0,         32,         32,        1,    38016, 0xdb5e3697
-0,         33,         33,        1,    38016, 0x8565303e
-0,         34,         34,        1,    38016, 0x5f9c2c1b
-0,         35,         35,        1,    38016, 0xeb3d27f4
-0,         36,         36,        1,    38016, 0x9a43282d
-0,         37,         37,        1,    38016, 0xe04720c6
-0,         38,         38,        1,    38016, 0x19cc0eba
-0,         39,         39,        1,    38016, 0x218efeb6
-0,         40,         40,        1,    38016, 0x7733f491
-0,         41,         41,        1,    38016, 0x7f3bede9
-0,         42,         42,        1,    38016, 0x49c5ec0d
-0,         43,         43,        1,    38016, 0x803cf19e
-0,         44,         44,        1,    38016, 0x31de0d3f
-0,         45,         45,        1,    38016, 0xa7e30426
-0,         46,         46,        1,    38016, 0xba37f068
-0,         47,         47,        1,    38016, 0x2842bdf8
-0,         48,         48,        1,    38016, 0x76df97dc
-0,         49,         49,        1,    38016, 0xf3246d26
-0,         50,         50,        1,    38016, 0x0a384d72
-0,         51,         51,        1,    38016, 0x40964f41
-0,         52,         52,        1,    38016, 0x46364324
-0,         53,         53,        1,    38016, 0x7cbf3db4
-0,         54,         54,        1,    38016, 0x7a223bec
-0,         55,         55,        1,    38016, 0x458651c1
-0,         56,         56,        1,    38016, 0xb82d7e3c
-0,         57,         57,        1,    38016, 0x0f50a55d
-0,         58,         58,        1,    38016, 0xc306cae4
-0,         59,         59,        1,    38016, 0x9d6ddfcb
-0,         60,         60,        1,    38016, 0xb602e8e9
-0,         61,         61,        1,    38016, 0xbf0ae386
-0,         62,         62,        1,    38016, 0x0a8bd46e
-0,         63,         63,        1,    38016, 0xd437c5c1
-0,         64,         64,        1,    38016, 0xd61d9959
-0,         65,         65,        1,    38016, 0x70639b56
-0,         66,         66,        1,    38016, 0x36fd407b
-0,         67,         67,        1,    38016, 0x58ce3ddd
-0,         68,         68,        1,    38016, 0x86cc1d8c
-0,         69,         69,        1,    38016, 0xee422dc2
-0,         70,         70,        1,    38016, 0xab475639
-0,         71,         71,        1,    38016, 0xc1327ad8
-0,         72,         72,        1,    38016, 0x63d196d4
-0,         73,         73,        1,    38016, 0x1aba8ebd
-0,         74,         74,        1,    38016, 0x74a269ac
-0,         75,         75,        1,    38016, 0x267f3563
-0,         76,         76,        1,    38016, 0xa18ff180
-0,         77,         77,        1,    38016, 0x70c9c9fd
-0,         78,         78,        1,    38016, 0xa6c59f9c
-0,         79,         79,        1,    38016, 0xd7cd8927
-0,         80,         80,        1,    38016, 0xd30b7345
-0,         81,         81,        1,    38016, 0x679a4dda
-0,         82,         82,        1,    38016, 0xeb0562de
-0,         83,         83,        1,    38016, 0xdd7d6cdb
-0,         84,         84,        1,    38016, 0xd6e26b73
-0,         85,         85,        1,    38016, 0xa65a860f
-0,         86,         86,        1,    38016, 0xae95c71e
-0,         87,         87,        1,    38016, 0x1a89ca86
-0,         88,         88,        1,    38016, 0xa33ecee6
-0,         89,         89,        1,    38016, 0x821da6cb
-0,         90,         90,        1,    38016, 0xf0e1612f
-0,         91,         91,        1,    38016, 0x67b8516b
-0,         92,         92,        1,    38016, 0x62f965bc
-0,         93,         93,        1,    38016, 0xd1917aa6
-0,         94,         94,        1,    38016, 0xe72db54d
-0,         95,         95,        1,    38016, 0x9b64e721
-0,         96,         96,        1,    38016, 0xa819efda
-0,         97,         97,        1,    38016, 0xeacfdacb
-0,         98,         98,        1,    38016, 0x52f235e1
-0,         99,         99,        1,    38016, 0x2b512cb8
-0,        100,        100,        1,    38016, 0xaac73fb3
-0,        101,        101,        1,    38016, 0x7d2d504f
-0,        102,        102,        1,    38016, 0x396d503a
-0,        103,        103,        1,    38016, 0x97905235
-0,        104,        104,        1,    38016, 0xf0056693
-0,        105,        105,        1,    38016, 0x728a6a9e
-0,        106,        106,        1,    38016, 0x0eed7824
-0,        107,        107,        1,    38016, 0x59506237
-0,        108,        108,        1,    38016, 0xd4304c93
-0,        109,        109,        1,    38016, 0x7e663ee8
-0,        110,        110,        1,    38016, 0x0ebc2d11
-0,        111,        111,        1,    38016, 0x52db2112
-0,        112,        112,        1,    38016, 0x74aa1815
-0,        113,        113,        1,    38016, 0x57a60dc6
-0,        114,        114,        1,    38016, 0x86e9fa32
-0,        115,        115,        1,    38016, 0x67e8ff09
-0,        116,        116,        1,    38016, 0x26e8f7ea
-0,        117,        117,        1,    38016, 0x183dff56
-0,        118,        118,        1,    38016, 0xa470af8d
-0,        119,        119,        1,    38016, 0xe017d594
-0,        120,        120,        1,    38016, 0xb899d48b
-0,        121,        121,        1,    38016, 0x0d3bc5f7
-0,        122,        122,        1,    38016, 0xd68bbb0d
-0,        123,        123,        1,    38016, 0x8bf5b4cb
-0,        124,        124,        1,    38016, 0x6bfcaa47
-0,        125,        125,        1,    38016, 0x29a9b01b
-0,        126,        126,        1,    38016, 0xcdedbdb7
-0,        127,        127,        1,    38016, 0xdb5ad9c3
-0,        128,        128,        1,    38016, 0x468aeef6
-0,        129,        129,        1,    38016, 0xdc2b143e
-0,        130,        130,        1,    38016, 0x6776277c
-0,        131,        131,        1,    38016, 0xb78d5294
-0,        132,        132,        1,    38016, 0x1dfb63ab
-0,        133,        133,        1,    38016, 0xbd1f99bc
-0,        134,        134,        1,    38016, 0xde16b89a
-0,        135,        135,        1,    38016, 0xbf46edca
-0,        136,        136,        1,    38016, 0x6306e8c4
-0,        137,        137,        1,    38016, 0x7b09d224
-0,        138,        138,        1,    38016, 0xfea1aff6
-0,        139,        139,        1,    38016, 0x183686b0
-0,        140,        140,        1,    38016, 0x665a61ff
-0,        141,        141,        1,    38016, 0xc8af42d1
-0,        142,        142,        1,    38016, 0xe2326bc1
-0,        143,        143,        1,    38016, 0x56dbde82
-0,        144,        144,        1,    38016, 0xa0254f97
-0,        145,        145,        1,    38016, 0x3b74a0b4
-0,        146,        146,        1,    38016, 0x9aee9b7f
-0,        147,        147,        1,    38016, 0xd94b6133
-0,        148,        148,        1,    38016, 0x5819f795
-0,        149,        149,        1,    38016, 0xc45a8c02
-0,        150,        150,        1,    38016, 0x2f9204a0
-0,        151,        151,        1,    38016, 0xbe09e051
-0,        152,        152,        1,    38016, 0xb542badd
-0,        153,        153,        1,    38016, 0x23bd9e00
-0,        154,        154,        1,    38016, 0x4f338d3d
-0,        155,        155,        1,    38016, 0x8c91e8f3
-0,        156,        156,        1,    38016, 0xa7347d57
-0,        157,        157,        1,    38016, 0x6d91de4d
-0,        158,        158,        1,    38016, 0x3443d936
-0,        159,        159,        1,    38016, 0x9d25b4e2
-0,        160,        160,        1,    38016, 0xd93cd4b3
-0,        161,        161,        1,    38016, 0xa1c9e9a0
-0,        162,        162,        1,    38016, 0x1482f220
-0,        163,        163,        1,    38016, 0x1295f270
-0,        164,        164,        1,    38016, 0x399ae9da
-0,        165,        165,        1,    38016, 0x85dcdf28
-0,        166,        166,        1,    38016, 0x4207b9e5
-0,        167,        167,        1,    38016, 0xad1c9d75
-0,        168,        168,        1,    38016, 0x4a266c14
-0,        169,        169,        1,    38016, 0x3afc4508
-0,        170,        170,        1,    38016, 0x2b1b2385
-0,        171,        171,        1,    38016, 0x738f005f
-0,        172,        172,        1,    38016, 0xfec3d833
-0,        173,        173,        1,    38016, 0x3f7f6ae9
-0,        174,        174,        1,    38016, 0xd8551823
-0,        175,        175,        1,    38016, 0x6df03570
-0,        176,        176,        1,    38016, 0x767c3054
-0,        177,        177,        1,    38016, 0x89bd342c
-0,        178,        178,        1,    38016, 0x77ba806c
-0,        179,        179,        1,    38016, 0x1c98005c
-0,        180,        180,        1,    38016, 0xa13ce2a3
-0,        181,        181,        1,    38016, 0x1be59915
-0,        182,        182,        1,    38016, 0x279c6027
-0,        183,        183,        1,    38016, 0x96ac11a2
-0,        184,        184,        1,    38016, 0x3ae95131
-0,        185,        185,        1,    38016, 0xae19f7fe
-0,        186,        186,        1,    38016, 0xcde4efe6
-0,        187,        187,        1,    38016, 0x5ecc3f7a
-0,        188,        188,        1,    38016, 0x79645152
-0,        189,        189,        1,    38016, 0x1ee2e89f
-0,        190,        190,        1,    38016, 0x91d34bb4
-0,        191,        191,        1,    38016, 0xf019d464
-0,        192,        192,        1,    38016, 0x8eb07205
-0,        193,        193,        1,    38016, 0x5399bb5b
-0,        194,        194,        1,    38016, 0x61f0c77a
-0,        195,        195,        1,    38016, 0xb2bd8726
-0,        196,        196,        1,    38016, 0x47b89243
-0,        197,        197,        1,    38016, 0xebfe4d76
-0,        198,        198,        1,    38016, 0xe8f87d91
-0,        199,        199,        1,    38016, 0x5e9fb239
-0,        200,        200,        1,    38016, 0x357ca1f8
-0,        201,        201,        1,    38016, 0x757d2e02
-0,        202,        202,        1,    38016, 0x40672e7c
-0,        203,        203,        1,    38016, 0xd966abca
-0,        204,        204,        1,    38016, 0xe98d0d47
-0,        205,        205,        1,    38016, 0x341babf5
-0,        206,        206,        1,    38016, 0xd12d5a0c
-0,        207,        207,        1,    38016, 0xea2f99ab
-0,        208,        208,        1,    38016, 0x14bce88e
-0,        209,        209,        1,    38016, 0xe4bda9e8
-0,        210,        210,        1,    38016, 0x2c57ec89
-0,        211,        211,        1,    38016, 0x28bbb83e
-0,        212,        212,        1,    38016, 0xf8444b54
-0,        213,        213,        1,    38016, 0x3aba03cd
-0,        214,        214,        1,    38016, 0x373daa20
-0,        215,        215,        1,    38016, 0x69586597
-0,        216,        216,        1,    38016, 0xc0c70d53
-0,        217,        217,        1,    38016, 0x76a5df5a
-0,        218,        218,        1,    38016, 0x1afde8f0
-0,        219,        219,        1,    38016, 0x9638285a
-0,        220,        220,        1,    38016, 0x9f0686c0
-0,        221,        221,        1,    38016, 0xc65b2238
-0,        222,        222,        1,    38016, 0x0d61b610
-0,        223,        223,        1,    38016, 0x78e14e1f
-0,        224,        224,        1,    38016, 0xcf80ac4a
-0,        225,        225,        1,    38016, 0xe094083d
-0,        226,        226,        1,    38016, 0xee5e612e
-0,        227,        227,        1,    38016, 0x51cdad9d
-0,        228,        228,        1,    38016, 0xae41100e
-0,        229,        229,        1,    38016, 0x77558f58
-0,        230,        230,        1,    38016, 0xb9503b95
-0,        231,        231,        1,    38016, 0xb71dffeb
-0,        232,        232,        1,    38016, 0x1872e3e6
-0,        233,        233,        1,    38016, 0x29c3d252
-0,        234,        234,        1,    38016, 0x1c77c6ec
-0,        235,        235,        1,    38016, 0x26feb194
-0,        236,        236,        1,    38016, 0x3307c3c4
-0,        237,        237,        1,    38016, 0x8e5a8080
-0,        238,        238,        1,    38016, 0x933472f7
-0,        239,        239,        1,    38016, 0xd4768d84
-0,        240,        240,        1,    38016, 0x3324485f
-0,        241,        241,        1,    38016, 0xd50af078
-0,        242,        242,        1,    38016, 0x53820752
-0,        243,        243,        1,    38016, 0xbe7f1c47
-0,        244,        244,        1,    38016, 0xe43d3a34
-0,        245,        245,        1,    38016, 0x57194b82
-0,        246,        246,        1,    38016, 0x68a052ed
-0,        247,        247,        1,    38016, 0x5c898052
-0,        248,        248,        1,    38016, 0x7104a6ad
-0,        249,        249,        1,    38016, 0x1676b5e8
-0,        250,        250,        1,    38016, 0xe1cfd375
-0,        251,        251,        1,    38016, 0x16fede04
-0,        252,        252,        1,    38016, 0xca49dd4a
-0,        253,        253,        1,    38016, 0x7b98d9d1
-0,        254,        254,        1,    38016, 0x4020d210
-0,        255,        255,        1,    38016, 0x62c5d1e4
-0,        256,        256,        1,    38016, 0x756abdb4
-0,        257,        257,        1,    38016, 0x558fb00f
-0,        258,        258,        1,    38016, 0x4ab0b1f1
-0,        259,        259,        1,    38016, 0x7c9fb0c2
-0,        260,        260,        1,    38016, 0xcecfbdd0
-0,        261,        261,        1,    38016, 0x70e6d174
-0,        262,        262,        1,    38016, 0x83d7ddde
-0,        263,        263,        1,    38016, 0xbbcde2d9
-0,        264,        264,        1,    38016, 0xc89eeaef
-0,        265,        265,        1,    38016, 0x8565e15c
-0,        266,        266,        1,    38016, 0x28e0db24
-0,        267,        267,        1,    38016, 0x1d9dd334
-0,        268,        268,        1,    38016, 0xce02c452
-0,        269,        269,        1,    38016, 0xe29dbd0c
-0,        270,        270,        1,    38016, 0x4aa3b638
-0,        271,        271,        1,    38016, 0x5533c135
-0,        272,        272,        1,    38016, 0x6c57b65f
-0,        273,        273,        1,    38016, 0x23d3b851
-0,        274,        274,        1,    38016, 0xd8cbb960
-0,        275,        275,        1,    38016, 0x02edb916
-0,        276,        276,        1,    38016, 0xa622bd42
-0,        277,        277,        1,    38016, 0x4ba5be1c
-0,        278,        278,        1,    38016, 0xe69bb625
-0,        279,        279,        1,    38016, 0xbca5b292
-0,        280,        280,        1,    38016, 0xde38b1c8
-0,        281,        281,        1,    38016, 0xe9e3b617
-0,        282,        282,        1,    38016, 0x216cc574
-0,        283,        283,        1,    38016, 0x3780c5ad
-0,        284,        284,        1,    38016, 0x5531e3f9
-0,        285,        285,        1,    38016, 0xe2c5f5d4
-0,        286,        286,        1,    38016, 0x24cefc6e
-0,        287,        287,        1,    38016, 0xa3ce003d
-0,        288,        288,        1,    38016, 0x42d01c9e
-0,        289,        289,        1,    38016, 0xbfc13689
-0,        290,        290,        1,    38016, 0x122647a9
-0,        291,        291,        1,    38016, 0xe45254da
-0,        292,        292,        1,    38016, 0xad955b0c
-0,        293,        293,        1,    38016, 0x4b086abb
-0,        294,        294,        1,    38016, 0xd4857b8c
-0,        295,        295,        1,    38016, 0xa71594ce
-0,        296,        296,        1,    38016, 0x04e4a73d
-0,        297,        297,        1,    38016, 0x295abf63
-0,        298,        298,        1,    38016, 0xbe4ed5dd
-0,        299,        299,        1,    38016, 0x087bcf64
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr4_tandberg_c b/deps/libav/tests/ref/fate/h264-conformance-mr4_tandberg_c
deleted file mode 100644
index 0d5f646..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr4_tandberg_c
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb96f1feb
-0,          1,          1,        1,    38016, 0x0ff111f0
-0,          2,          2,        1,    38016, 0xbac70271
-0,          3,          3,        1,    38016, 0x8c361866
-0,          4,          4,        1,    38016, 0x9d9640be
-0,          5,          5,        1,    38016, 0xd36b563b
-0,          6,          6,        1,    38016, 0xe5966f5f
-0,          7,          7,        1,    38016, 0xb8b28ab0
-0,          8,          8,        1,    38016, 0xf817a3e6
-0,          9,          9,        1,    38016, 0xba26acd8
-0,         10,         10,        1,    38016, 0x453dba2f
-0,         11,         11,        1,    38016, 0xe50bd16e
-0,         12,         12,        1,    38016, 0x95c2c1f7
-0,         13,         13,        1,    38016, 0xc6a59679
-0,         14,         14,        1,    38016, 0x9f468726
-0,         15,         15,        1,    38016, 0x371091eb
-0,         16,         16,        1,    38016, 0xd499d26b
-0,         17,         17,        1,    38016, 0x172fd389
-0,         18,         18,        1,    38016, 0x3c04de2a
-0,         19,         19,        1,    38016, 0xa461aed2
-0,         20,         20,        1,    38016, 0x098cdef2
-0,         21,         21,        1,    38016, 0x5d8d9c7d
-0,         22,         22,        1,    38016, 0x087db718
-0,         23,         23,        1,    38016, 0x064191ef
-0,         24,         24,        1,    38016, 0x2f842ef5
-0,         25,         25,        1,    38016, 0x2b5b0e77
-0,         26,         26,        1,    38016, 0xcc671b7f
-0,         27,         27,        1,    38016, 0x859f4f75
-0,         28,         28,        1,    38016, 0x132a7a48
-0,         29,         29,        1,    38016, 0x6e8987ab
-0,         30,         30,        1,    38016, 0x02db8591
-0,         31,         31,        1,    38016, 0x30567d9b
-0,         32,         32,        1,    38016, 0x92ea3b53
-0,         33,         33,        1,    38016, 0xae807c6e
-0,         34,         34,        1,    38016, 0xbfbc7458
-0,         35,         35,        1,    38016, 0x66294d04
-0,         36,         36,        1,    38016, 0xdb2a5f10
-0,         37,         37,        1,    38016, 0xb19112fe
-0,         38,         38,        1,    38016, 0xdd26490e
-0,         39,         39,        1,    38016, 0x51cd31de
-0,         40,         40,        1,    38016, 0xf6cc2dad
-0,         41,         41,        1,    38016, 0x0c302dfd
-0,         42,         42,        1,    38016, 0xb846245d
-0,         43,         43,        1,    38016, 0xd61c2e88
-0,         44,         44,        1,    38016, 0xf8264117
-0,         45,         45,        1,    38016, 0x13862a3d
-0,         46,         46,        1,    38016, 0xfb481750
-0,         47,         47,        1,    38016, 0x6377e4af
-0,         48,         48,        1,    38016, 0x1759c1b4
-0,         49,         49,        1,    38016, 0xca03942b
-0,         50,         50,        1,    38016, 0x0126810b
-0,         51,         51,        1,    38016, 0x3c8c820b
-0,         52,         52,        1,    38016, 0x863379ec
-0,         53,         53,        1,    38016, 0xaf9b6d52
-0,         54,         54,        1,    38016, 0x9ba86946
-0,         55,         55,        1,    38016, 0xf97980fb
-0,         56,         56,        1,    38016, 0x9cf4785c
-0,         57,         57,        1,    38016, 0x51cdcdc7
-0,         58,         58,        1,    38016, 0x923de162
-0,         59,         59,        1,    38016, 0xdcd3c3cb
-0,         60,         60,        1,    38016, 0x6f9fea31
-0,         61,         61,        1,    38016, 0x7ab7b133
-0,         62,         62,        1,    38016, 0xb8a2c99f
-0,         63,         63,        1,    38016, 0x040a99c6
-0,         64,         64,        1,    38016, 0xa8c4b28f
-0,         65,         65,        1,    38016, 0x4c577509
-0,         66,         66,        1,    38016, 0xb30f7277
-0,         67,         67,        1,    38016, 0xb5f73b46
-0,         68,         68,        1,    38016, 0x723f3ccc
-0,         69,         69,        1,    38016, 0x3e4a0cca
-0,         70,         70,        1,    38016, 0xe0df386e
-0,         71,         71,        1,    38016, 0xc4832c7b
-0,         72,         72,        1,    38016, 0x014a2d9f
-0,         73,         73,        1,    38016, 0xae4272d9
-0,         74,         74,        1,    38016, 0xcde25e0f
-0,         75,         75,        1,    38016, 0xdecb13d6
-0,         76,         76,        1,    38016, 0x9d8ae5d9
-0,         77,         77,        1,    38016, 0x280abccf
-0,         78,         78,        1,    38016, 0x885a9fcc
-0,         79,         79,        1,    38016, 0x9b328b6f
-0,         80,         80,        1,    38016, 0x8fb7663c
-0,         81,         81,        1,    38016, 0x35fd4c32
-0,         82,         82,        1,    38016, 0xdd484efb
-0,         83,         83,        1,    38016, 0xb8f576b1
-0,         84,         84,        1,    38016, 0xe8016312
-0,         85,         85,        1,    38016, 0x65a88d55
-0,         86,         86,        1,    38016, 0x83dca3a9
-0,         87,         87,        1,    38016, 0xfc3ba542
-0,         88,         88,        1,    38016, 0x3d55ac26
-0,         89,         89,        1,    38016, 0xb91f6bbe
-0,         90,         90,        1,    38016, 0x67bd2f75
-0,         91,         91,        1,    38016, 0x0af12875
-0,         92,         92,        1,    38016, 0xc18a2d55
-0,         93,         93,        1,    38016, 0x22fd4e01
-0,         94,         94,        1,    38016, 0x466b8dcd
-0,         95,         95,        1,    38016, 0xfe93c2d9
-0,         96,         96,        1,    38016, 0x2cc0e638
-0,         97,         97,        1,    38016, 0xbe550d40
-0,         98,         98,        1,    38016, 0x65900ffc
-0,         99,         99,        1,    38016, 0xcc61228c
-0,        100,        100,        1,    38016, 0x8ae34904
-0,        101,        101,        1,    38016, 0x74b8411a
-0,        102,        102,        1,    38016, 0xae36408d
-0,        103,        103,        1,    38016, 0x251429ad
-0,        104,        104,        1,    38016, 0x4d8e6dc6
-0,        105,        105,        1,    38016, 0x9e07801e
-0,        106,        106,        1,    38016, 0x8fdd83ef
-0,        107,        107,        1,    38016, 0x976084a1
-0,        108,        108,        1,    38016, 0x69f7609f
-0,        109,        109,        1,    38016, 0x48971b09
-0,        110,        110,        1,    38016, 0x78e63ff4
-0,        111,        111,        1,    38016, 0x0852365b
-0,        112,        112,        1,    38016, 0x8044232c
-0,        113,        113,        1,    38016, 0x9ec3178d
-0,        114,        114,        1,    38016, 0x6f260955
-0,        115,        115,        1,    38016, 0x903cfe23
-0,        116,        116,        1,    38016, 0x441afbe4
-0,        117,        117,        1,    38016, 0xe4420313
-0,        118,        118,        1,    38016, 0xf86d0c34
-0,        119,        119,        1,    38016, 0xafe5f3c3
-0,        120,        120,        1,    38016, 0x9f61e43b
-0,        121,        121,        1,    38016, 0x9330e186
-0,        122,        122,        1,    38016, 0xc900ce86
-0,        123,        123,        1,    38016, 0xffd6c4a6
-0,        124,        124,        1,    38016, 0xd7b3cd79
-0,        125,        125,        1,    38016, 0x8015c914
-0,        126,        126,        1,    38016, 0x36d3c884
-0,        127,        127,        1,    38016, 0x2981db44
-0,        128,        128,        1,    38016, 0x94f40162
-0,        129,        129,        1,    38016, 0x091022c5
-0,        130,        130,        1,    38016, 0xd554203f
-0,        131,        131,        1,    38016, 0xdcf26c7e
-0,        132,        132,        1,    38016, 0xdc398ff4
-0,        133,        133,        1,    38016, 0xeb5ca01c
-0,        134,        134,        1,    38016, 0x4931c311
-0,        135,        135,        1,    38016, 0x0ddabf2a
-0,        136,        136,        1,    38016, 0x2432a265
-0,        137,        137,        1,    38016, 0x65409b4f
-0,        138,        138,        1,    38016, 0x466e6957
-0,        139,        139,        1,    38016, 0x82a08bb4
-0,        140,        140,        1,    38016, 0xdb6a35c4
-0,        141,        141,        1,    38016, 0xda5b0d28
-0,        142,        142,        1,    38016, 0x2be76f6d
-0,        143,        143,        1,    38016, 0x7587a456
-0,        144,        144,        1,    38016, 0x69994004
-0,        145,        145,        1,    38016, 0xaefd46ec
-0,        146,        146,        1,    38016, 0x88094d53
-0,        147,        147,        1,    38016, 0xfcb82a4c
-0,        148,        148,        1,    38016, 0x2877c850
-0,        149,        149,        1,    38016, 0x327f5e88
-0,        150,        150,        1,    38016, 0xaa1c4a3f
-0,        151,        151,        1,    38016, 0x1950dfbd
-0,        152,        152,        1,    38016, 0x8580b472
-0,        153,        153,        1,    38016, 0xb5ef90c0
-0,        154,        154,        1,    38016, 0x0906b3e7
-0,        155,        155,        1,    38016, 0x026b12fa
-0,        156,        156,        1,    38016, 0xe8ef556a
-0,        157,        157,        1,    38016, 0x2e1afe7f
-0,        158,        158,        1,    38016, 0xef2ad28a
-0,        159,        159,        1,    38016, 0xe6d7d947
-0,        160,        160,        1,    38016, 0x25ebd549
-0,        161,        161,        1,    38016, 0xc443f3cf
-0,        162,        162,        1,    38016, 0x9dc7dcad
-0,        163,        163,        1,    38016, 0x8b7ce835
-0,        164,        164,        1,    38016, 0x27a3e48b
-0,        165,        165,        1,    38016, 0x0b6bc8a9
-0,        166,        166,        1,    38016, 0xdb98d21e
-0,        167,        167,        1,    38016, 0x4cb89812
-0,        168,        168,        1,    38016, 0x41f35c5e
-0,        169,        169,        1,    38016, 0xfd764d91
-0,        170,        170,        1,    38016, 0xb7cc313f
-0,        171,        171,        1,    38016, 0x51ba22d1
-0,        172,        172,        1,    38016, 0x00d8deee
-0,        173,        173,        1,    38016, 0x50db806a
-0,        174,        174,        1,    38016, 0xbf022623
-0,        175,        175,        1,    38016, 0xf2fe22ba
-0,        176,        176,        1,    38016, 0x7055191b
-0,        177,        177,        1,    38016, 0xbefb8590
-0,        178,        178,        1,    38016, 0x90e59103
-0,        179,        179,        1,    38016, 0x61d443da
-0,        180,        180,        1,    38016, 0x6ad0e637
-0,        181,        181,        1,    38016, 0xda39f9c1
-0,        182,        182,        1,    38016, 0x03408181
-0,        183,        183,        1,    38016, 0xee973480
-0,        184,        184,        1,    38016, 0x9674d65d
-0,        185,        185,        1,    38016, 0x1fdd5529
-0,        186,        186,        1,    38016, 0x51a219bb
-0,        187,        187,        1,    38016, 0x9cd9747e
-0,        188,        188,        1,    38016, 0xa58a3c33
-0,        189,        189,        1,    38016, 0xdf1905a9
-0,        190,        190,        1,    38016, 0x44a52c69
-0,        191,        191,        1,    38016, 0x0cf6e56b
-0,        192,        192,        1,    38016, 0xe2115e06
-0,        193,        193,        1,    38016, 0x15efa840
-0,        194,        194,        1,    38016, 0x0811bad8
-0,        195,        195,        1,    38016, 0x8240a91d
-0,        196,        196,        1,    38016, 0xdfe46b7d
-0,        197,        197,        1,    38016, 0xcead819a
-0,        198,        198,        1,    38016, 0xe8f87d91
-0,        199,        199,        1,    38016, 0x951ebd82
-0,        200,        200,        1,    38016, 0x37d98ecb
-0,        201,        201,        1,    38016, 0x54fb54da
-0,        202,        202,        1,    38016, 0xb306302e
-0,        203,        203,        1,    38016, 0xa8acd0dc
-0,        204,        204,        1,    38016, 0x68e43757
-0,        205,        205,        1,    38016, 0x7018cd48
-0,        206,        206,        1,    38016, 0x1c34824e
-0,        207,        207,        1,    38016, 0x22e7e478
-0,        208,        208,        1,    38016, 0x534a0470
-0,        209,        209,        1,    38016, 0x1a65bc45
-0,        210,        210,        1,    38016, 0x5e78223b
-0,        211,        211,        1,    38016, 0xc3c9c912
-0,        212,        212,        1,    38016, 0x52557c74
-0,        213,        213,        1,    38016, 0xf5ff1f9a
-0,        214,        214,        1,    38016, 0x56afe047
-0,        215,        215,        1,    38016, 0x50259235
-0,        216,        216,        1,    38016, 0xca19311d
-0,        217,        217,        1,    38016, 0xd96eeb53
-0,        218,        218,        1,    38016, 0x21a218b7
-0,        219,        219,        1,    38016, 0x24162395
-0,        220,        220,        1,    38016, 0xadf9b983
-0,        221,        221,        1,    38016, 0x68443df2
-0,        222,        222,        1,    38016, 0xa970df8a
-0,        223,        223,        1,    38016, 0x8381bbee
-0,        224,        224,        1,    38016, 0x36fe1d22
-0,        225,        225,        1,    38016, 0xa0326ddf
-0,        226,        226,        1,    38016, 0x01dc7ca7
-0,        227,        227,        1,    38016, 0xf485d505
-0,        228,        228,        1,    38016, 0xb5a8fe68
-0,        229,        229,        1,    38016, 0x6385f303
-0,        230,        230,        1,    38016, 0x4d099ef1
-0,        231,        231,        1,    38016, 0xeaa54d25
-0,        232,        232,        1,    38016, 0x5c32c503
-0,        233,        233,        1,    38016, 0xd52538b3
-0,        234,        234,        1,    38016, 0x1ca2e4c2
-0,        235,        235,        1,    38016, 0xe3a95b82
-0,        236,        236,        1,    38016, 0x14393895
-0,        237,        237,        1,    38016, 0xd77cef50
-0,        238,        238,        1,    38016, 0x47b901b8
-0,        239,        239,        1,    38016, 0x14d70226
-0,        240,        240,        1,    38016, 0xab32b360
-0,        241,        241,        1,    38016, 0xb92d3090
-0,        242,        242,        1,    38016, 0xbd50ae43
-0,        243,        243,        1,    38016, 0x5ea8d59a
-0,        244,        244,        1,    38016, 0xb6d7fe63
-0,        245,        245,        1,    38016, 0xe228050d
-0,        246,        246,        1,    38016, 0x09e251ed
-0,        247,        247,        1,    38016, 0xcea332d0
-0,        248,        248,        1,    38016, 0x048838af
-0,        249,        249,        1,    38016, 0x0a625a93
-0,        250,        250,        1,    38016, 0x018aa719
-0,        251,        251,        1,    38016, 0x630e70a8
-0,        252,        252,        1,    38016, 0x93cb4c39
-0,        253,        253,        1,    38016, 0x3cdb7cf8
-0,        254,        254,        1,    38016, 0x48491fb4
-0,        255,        255,        1,    38016, 0x06aa4101
-0,        256,        256,        1,    38016, 0x4b402d3e
-0,        257,        257,        1,    38016, 0x13cbf927
-0,        258,        258,        1,    38016, 0xdc7528b6
-0,        259,        259,        1,    38016, 0x652d0576
-0,        260,        260,        1,    38016, 0xa3a504d6
-0,        261,        261,        1,    38016, 0x5bd33fe4
-0,        262,        262,        1,    38016, 0xae11267b
-0,        263,        263,        1,    38016, 0xb58b5613
-0,        264,        264,        1,    38016, 0x50160d80
-0,        265,        265,        1,    38016, 0x4a643ed0
-0,        266,        266,        1,    38016, 0xe3983ed6
-0,        267,        267,        1,    38016, 0xa1fb3338
-0,        268,        268,        1,    38016, 0x48d0286d
-0,        269,        269,        1,    38016, 0x67043801
-0,        270,        270,        1,    38016, 0x00bafaad
-0,        271,        271,        1,    38016, 0xf07de35a
-0,        272,        272,        1,    38016, 0x493e4579
-0,        273,        273,        1,    38016, 0xa917532b
-0,        274,        274,        1,    38016, 0x463fcc89
-0,        275,        275,        1,    38016, 0xd47c1b1b
-0,        276,        276,        1,    38016, 0x3543c596
-0,        277,        277,        1,    38016, 0x65d6cd5b
-0,        278,        278,        1,    38016, 0x22cbd5ef
-0,        279,        279,        1,    38016, 0x08e0f250
-0,        280,        280,        1,    38016, 0x4e4aeb0a
-0,        281,        281,        1,    38016, 0x7895e0bd
-0,        282,        282,        1,    38016, 0xc11cea95
-0,        283,        283,        1,    38016, 0x13b3bcf8
-0,        284,        284,        1,    38016, 0xcb312186
-0,        285,        285,        1,    38016, 0x791007ca
-0,        286,        286,        1,    38016, 0xaa77354f
-0,        287,        287,        1,    38016, 0x1dbc2a67
-0,        288,        288,        1,    38016, 0x00646a65
-0,        289,        289,        1,    38016, 0x19db488d
-0,        290,        290,        1,    38016, 0x16c155e5
-0,        291,        291,        1,    38016, 0xb760898e
-0,        292,        292,        1,    38016, 0xbd6691e8
-0,        293,        293,        1,    38016, 0x06829781
-0,        294,        294,        1,    38016, 0xcebab8ad
-0,        295,        295,        1,    38016, 0xe2f38e79
-0,        296,        296,        1,    38016, 0x1e00c08e
-0,        297,        297,        1,    38016, 0x86d6c935
-0,        298,        298,        1,    38016, 0xaa88dfdc
-0,        299,        299,        1,    38016, 0xa9029b45
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr5_tandberg_c b/deps/libav/tests/ref/fate/h264-conformance-mr5_tandberg_c
deleted file mode 100644
index 0d5f646..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr5_tandberg_c
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb96f1feb
-0,          1,          1,        1,    38016, 0x0ff111f0
-0,          2,          2,        1,    38016, 0xbac70271
-0,          3,          3,        1,    38016, 0x8c361866
-0,          4,          4,        1,    38016, 0x9d9640be
-0,          5,          5,        1,    38016, 0xd36b563b
-0,          6,          6,        1,    38016, 0xe5966f5f
-0,          7,          7,        1,    38016, 0xb8b28ab0
-0,          8,          8,        1,    38016, 0xf817a3e6
-0,          9,          9,        1,    38016, 0xba26acd8
-0,         10,         10,        1,    38016, 0x453dba2f
-0,         11,         11,        1,    38016, 0xe50bd16e
-0,         12,         12,        1,    38016, 0x95c2c1f7
-0,         13,         13,        1,    38016, 0xc6a59679
-0,         14,         14,        1,    38016, 0x9f468726
-0,         15,         15,        1,    38016, 0x371091eb
-0,         16,         16,        1,    38016, 0xd499d26b
-0,         17,         17,        1,    38016, 0x172fd389
-0,         18,         18,        1,    38016, 0x3c04de2a
-0,         19,         19,        1,    38016, 0xa461aed2
-0,         20,         20,        1,    38016, 0x098cdef2
-0,         21,         21,        1,    38016, 0x5d8d9c7d
-0,         22,         22,        1,    38016, 0x087db718
-0,         23,         23,        1,    38016, 0x064191ef
-0,         24,         24,        1,    38016, 0x2f842ef5
-0,         25,         25,        1,    38016, 0x2b5b0e77
-0,         26,         26,        1,    38016, 0xcc671b7f
-0,         27,         27,        1,    38016, 0x859f4f75
-0,         28,         28,        1,    38016, 0x132a7a48
-0,         29,         29,        1,    38016, 0x6e8987ab
-0,         30,         30,        1,    38016, 0x02db8591
-0,         31,         31,        1,    38016, 0x30567d9b
-0,         32,         32,        1,    38016, 0x92ea3b53
-0,         33,         33,        1,    38016, 0xae807c6e
-0,         34,         34,        1,    38016, 0xbfbc7458
-0,         35,         35,        1,    38016, 0x66294d04
-0,         36,         36,        1,    38016, 0xdb2a5f10
-0,         37,         37,        1,    38016, 0xb19112fe
-0,         38,         38,        1,    38016, 0xdd26490e
-0,         39,         39,        1,    38016, 0x51cd31de
-0,         40,         40,        1,    38016, 0xf6cc2dad
-0,         41,         41,        1,    38016, 0x0c302dfd
-0,         42,         42,        1,    38016, 0xb846245d
-0,         43,         43,        1,    38016, 0xd61c2e88
-0,         44,         44,        1,    38016, 0xf8264117
-0,         45,         45,        1,    38016, 0x13862a3d
-0,         46,         46,        1,    38016, 0xfb481750
-0,         47,         47,        1,    38016, 0x6377e4af
-0,         48,         48,        1,    38016, 0x1759c1b4
-0,         49,         49,        1,    38016, 0xca03942b
-0,         50,         50,        1,    38016, 0x0126810b
-0,         51,         51,        1,    38016, 0x3c8c820b
-0,         52,         52,        1,    38016, 0x863379ec
-0,         53,         53,        1,    38016, 0xaf9b6d52
-0,         54,         54,        1,    38016, 0x9ba86946
-0,         55,         55,        1,    38016, 0xf97980fb
-0,         56,         56,        1,    38016, 0x9cf4785c
-0,         57,         57,        1,    38016, 0x51cdcdc7
-0,         58,         58,        1,    38016, 0x923de162
-0,         59,         59,        1,    38016, 0xdcd3c3cb
-0,         60,         60,        1,    38016, 0x6f9fea31
-0,         61,         61,        1,    38016, 0x7ab7b133
-0,         62,         62,        1,    38016, 0xb8a2c99f
-0,         63,         63,        1,    38016, 0x040a99c6
-0,         64,         64,        1,    38016, 0xa8c4b28f
-0,         65,         65,        1,    38016, 0x4c577509
-0,         66,         66,        1,    38016, 0xb30f7277
-0,         67,         67,        1,    38016, 0xb5f73b46
-0,         68,         68,        1,    38016, 0x723f3ccc
-0,         69,         69,        1,    38016, 0x3e4a0cca
-0,         70,         70,        1,    38016, 0xe0df386e
-0,         71,         71,        1,    38016, 0xc4832c7b
-0,         72,         72,        1,    38016, 0x014a2d9f
-0,         73,         73,        1,    38016, 0xae4272d9
-0,         74,         74,        1,    38016, 0xcde25e0f
-0,         75,         75,        1,    38016, 0xdecb13d6
-0,         76,         76,        1,    38016, 0x9d8ae5d9
-0,         77,         77,        1,    38016, 0x280abccf
-0,         78,         78,        1,    38016, 0x885a9fcc
-0,         79,         79,        1,    38016, 0x9b328b6f
-0,         80,         80,        1,    38016, 0x8fb7663c
-0,         81,         81,        1,    38016, 0x35fd4c32
-0,         82,         82,        1,    38016, 0xdd484efb
-0,         83,         83,        1,    38016, 0xb8f576b1
-0,         84,         84,        1,    38016, 0xe8016312
-0,         85,         85,        1,    38016, 0x65a88d55
-0,         86,         86,        1,    38016, 0x83dca3a9
-0,         87,         87,        1,    38016, 0xfc3ba542
-0,         88,         88,        1,    38016, 0x3d55ac26
-0,         89,         89,        1,    38016, 0xb91f6bbe
-0,         90,         90,        1,    38016, 0x67bd2f75
-0,         91,         91,        1,    38016, 0x0af12875
-0,         92,         92,        1,    38016, 0xc18a2d55
-0,         93,         93,        1,    38016, 0x22fd4e01
-0,         94,         94,        1,    38016, 0x466b8dcd
-0,         95,         95,        1,    38016, 0xfe93c2d9
-0,         96,         96,        1,    38016, 0x2cc0e638
-0,         97,         97,        1,    38016, 0xbe550d40
-0,         98,         98,        1,    38016, 0x65900ffc
-0,         99,         99,        1,    38016, 0xcc61228c
-0,        100,        100,        1,    38016, 0x8ae34904
-0,        101,        101,        1,    38016, 0x74b8411a
-0,        102,        102,        1,    38016, 0xae36408d
-0,        103,        103,        1,    38016, 0x251429ad
-0,        104,        104,        1,    38016, 0x4d8e6dc6
-0,        105,        105,        1,    38016, 0x9e07801e
-0,        106,        106,        1,    38016, 0x8fdd83ef
-0,        107,        107,        1,    38016, 0x976084a1
-0,        108,        108,        1,    38016, 0x69f7609f
-0,        109,        109,        1,    38016, 0x48971b09
-0,        110,        110,        1,    38016, 0x78e63ff4
-0,        111,        111,        1,    38016, 0x0852365b
-0,        112,        112,        1,    38016, 0x8044232c
-0,        113,        113,        1,    38016, 0x9ec3178d
-0,        114,        114,        1,    38016, 0x6f260955
-0,        115,        115,        1,    38016, 0x903cfe23
-0,        116,        116,        1,    38016, 0x441afbe4
-0,        117,        117,        1,    38016, 0xe4420313
-0,        118,        118,        1,    38016, 0xf86d0c34
-0,        119,        119,        1,    38016, 0xafe5f3c3
-0,        120,        120,        1,    38016, 0x9f61e43b
-0,        121,        121,        1,    38016, 0x9330e186
-0,        122,        122,        1,    38016, 0xc900ce86
-0,        123,        123,        1,    38016, 0xffd6c4a6
-0,        124,        124,        1,    38016, 0xd7b3cd79
-0,        125,        125,        1,    38016, 0x8015c914
-0,        126,        126,        1,    38016, 0x36d3c884
-0,        127,        127,        1,    38016, 0x2981db44
-0,        128,        128,        1,    38016, 0x94f40162
-0,        129,        129,        1,    38016, 0x091022c5
-0,        130,        130,        1,    38016, 0xd554203f
-0,        131,        131,        1,    38016, 0xdcf26c7e
-0,        132,        132,        1,    38016, 0xdc398ff4
-0,        133,        133,        1,    38016, 0xeb5ca01c
-0,        134,        134,        1,    38016, 0x4931c311
-0,        135,        135,        1,    38016, 0x0ddabf2a
-0,        136,        136,        1,    38016, 0x2432a265
-0,        137,        137,        1,    38016, 0x65409b4f
-0,        138,        138,        1,    38016, 0x466e6957
-0,        139,        139,        1,    38016, 0x82a08bb4
-0,        140,        140,        1,    38016, 0xdb6a35c4
-0,        141,        141,        1,    38016, 0xda5b0d28
-0,        142,        142,        1,    38016, 0x2be76f6d
-0,        143,        143,        1,    38016, 0x7587a456
-0,        144,        144,        1,    38016, 0x69994004
-0,        145,        145,        1,    38016, 0xaefd46ec
-0,        146,        146,        1,    38016, 0x88094d53
-0,        147,        147,        1,    38016, 0xfcb82a4c
-0,        148,        148,        1,    38016, 0x2877c850
-0,        149,        149,        1,    38016, 0x327f5e88
-0,        150,        150,        1,    38016, 0xaa1c4a3f
-0,        151,        151,        1,    38016, 0x1950dfbd
-0,        152,        152,        1,    38016, 0x8580b472
-0,        153,        153,        1,    38016, 0xb5ef90c0
-0,        154,        154,        1,    38016, 0x0906b3e7
-0,        155,        155,        1,    38016, 0x026b12fa
-0,        156,        156,        1,    38016, 0xe8ef556a
-0,        157,        157,        1,    38016, 0x2e1afe7f
-0,        158,        158,        1,    38016, 0xef2ad28a
-0,        159,        159,        1,    38016, 0xe6d7d947
-0,        160,        160,        1,    38016, 0x25ebd549
-0,        161,        161,        1,    38016, 0xc443f3cf
-0,        162,        162,        1,    38016, 0x9dc7dcad
-0,        163,        163,        1,    38016, 0x8b7ce835
-0,        164,        164,        1,    38016, 0x27a3e48b
-0,        165,        165,        1,    38016, 0x0b6bc8a9
-0,        166,        166,        1,    38016, 0xdb98d21e
-0,        167,        167,        1,    38016, 0x4cb89812
-0,        168,        168,        1,    38016, 0x41f35c5e
-0,        169,        169,        1,    38016, 0xfd764d91
-0,        170,        170,        1,    38016, 0xb7cc313f
-0,        171,        171,        1,    38016, 0x51ba22d1
-0,        172,        172,        1,    38016, 0x00d8deee
-0,        173,        173,        1,    38016, 0x50db806a
-0,        174,        174,        1,    38016, 0xbf022623
-0,        175,        175,        1,    38016, 0xf2fe22ba
-0,        176,        176,        1,    38016, 0x7055191b
-0,        177,        177,        1,    38016, 0xbefb8590
-0,        178,        178,        1,    38016, 0x90e59103
-0,        179,        179,        1,    38016, 0x61d443da
-0,        180,        180,        1,    38016, 0x6ad0e637
-0,        181,        181,        1,    38016, 0xda39f9c1
-0,        182,        182,        1,    38016, 0x03408181
-0,        183,        183,        1,    38016, 0xee973480
-0,        184,        184,        1,    38016, 0x9674d65d
-0,        185,        185,        1,    38016, 0x1fdd5529
-0,        186,        186,        1,    38016, 0x51a219bb
-0,        187,        187,        1,    38016, 0x9cd9747e
-0,        188,        188,        1,    38016, 0xa58a3c33
-0,        189,        189,        1,    38016, 0xdf1905a9
-0,        190,        190,        1,    38016, 0x44a52c69
-0,        191,        191,        1,    38016, 0x0cf6e56b
-0,        192,        192,        1,    38016, 0xe2115e06
-0,        193,        193,        1,    38016, 0x15efa840
-0,        194,        194,        1,    38016, 0x0811bad8
-0,        195,        195,        1,    38016, 0x8240a91d
-0,        196,        196,        1,    38016, 0xdfe46b7d
-0,        197,        197,        1,    38016, 0xcead819a
-0,        198,        198,        1,    38016, 0xe8f87d91
-0,        199,        199,        1,    38016, 0x951ebd82
-0,        200,        200,        1,    38016, 0x37d98ecb
-0,        201,        201,        1,    38016, 0x54fb54da
-0,        202,        202,        1,    38016, 0xb306302e
-0,        203,        203,        1,    38016, 0xa8acd0dc
-0,        204,        204,        1,    38016, 0x68e43757
-0,        205,        205,        1,    38016, 0x7018cd48
-0,        206,        206,        1,    38016, 0x1c34824e
-0,        207,        207,        1,    38016, 0x22e7e478
-0,        208,        208,        1,    38016, 0x534a0470
-0,        209,        209,        1,    38016, 0x1a65bc45
-0,        210,        210,        1,    38016, 0x5e78223b
-0,        211,        211,        1,    38016, 0xc3c9c912
-0,        212,        212,        1,    38016, 0x52557c74
-0,        213,        213,        1,    38016, 0xf5ff1f9a
-0,        214,        214,        1,    38016, 0x56afe047
-0,        215,        215,        1,    38016, 0x50259235
-0,        216,        216,        1,    38016, 0xca19311d
-0,        217,        217,        1,    38016, 0xd96eeb53
-0,        218,        218,        1,    38016, 0x21a218b7
-0,        219,        219,        1,    38016, 0x24162395
-0,        220,        220,        1,    38016, 0xadf9b983
-0,        221,        221,        1,    38016, 0x68443df2
-0,        222,        222,        1,    38016, 0xa970df8a
-0,        223,        223,        1,    38016, 0x8381bbee
-0,        224,        224,        1,    38016, 0x36fe1d22
-0,        225,        225,        1,    38016, 0xa0326ddf
-0,        226,        226,        1,    38016, 0x01dc7ca7
-0,        227,        227,        1,    38016, 0xf485d505
-0,        228,        228,        1,    38016, 0xb5a8fe68
-0,        229,        229,        1,    38016, 0x6385f303
-0,        230,        230,        1,    38016, 0x4d099ef1
-0,        231,        231,        1,    38016, 0xeaa54d25
-0,        232,        232,        1,    38016, 0x5c32c503
-0,        233,        233,        1,    38016, 0xd52538b3
-0,        234,        234,        1,    38016, 0x1ca2e4c2
-0,        235,        235,        1,    38016, 0xe3a95b82
-0,        236,        236,        1,    38016, 0x14393895
-0,        237,        237,        1,    38016, 0xd77cef50
-0,        238,        238,        1,    38016, 0x47b901b8
-0,        239,        239,        1,    38016, 0x14d70226
-0,        240,        240,        1,    38016, 0xab32b360
-0,        241,        241,        1,    38016, 0xb92d3090
-0,        242,        242,        1,    38016, 0xbd50ae43
-0,        243,        243,        1,    38016, 0x5ea8d59a
-0,        244,        244,        1,    38016, 0xb6d7fe63
-0,        245,        245,        1,    38016, 0xe228050d
-0,        246,        246,        1,    38016, 0x09e251ed
-0,        247,        247,        1,    38016, 0xcea332d0
-0,        248,        248,        1,    38016, 0x048838af
-0,        249,        249,        1,    38016, 0x0a625a93
-0,        250,        250,        1,    38016, 0x018aa719
-0,        251,        251,        1,    38016, 0x630e70a8
-0,        252,        252,        1,    38016, 0x93cb4c39
-0,        253,        253,        1,    38016, 0x3cdb7cf8
-0,        254,        254,        1,    38016, 0x48491fb4
-0,        255,        255,        1,    38016, 0x06aa4101
-0,        256,        256,        1,    38016, 0x4b402d3e
-0,        257,        257,        1,    38016, 0x13cbf927
-0,        258,        258,        1,    38016, 0xdc7528b6
-0,        259,        259,        1,    38016, 0x652d0576
-0,        260,        260,        1,    38016, 0xa3a504d6
-0,        261,        261,        1,    38016, 0x5bd33fe4
-0,        262,        262,        1,    38016, 0xae11267b
-0,        263,        263,        1,    38016, 0xb58b5613
-0,        264,        264,        1,    38016, 0x50160d80
-0,        265,        265,        1,    38016, 0x4a643ed0
-0,        266,        266,        1,    38016, 0xe3983ed6
-0,        267,        267,        1,    38016, 0xa1fb3338
-0,        268,        268,        1,    38016, 0x48d0286d
-0,        269,        269,        1,    38016, 0x67043801
-0,        270,        270,        1,    38016, 0x00bafaad
-0,        271,        271,        1,    38016, 0xf07de35a
-0,        272,        272,        1,    38016, 0x493e4579
-0,        273,        273,        1,    38016, 0xa917532b
-0,        274,        274,        1,    38016, 0x463fcc89
-0,        275,        275,        1,    38016, 0xd47c1b1b
-0,        276,        276,        1,    38016, 0x3543c596
-0,        277,        277,        1,    38016, 0x65d6cd5b
-0,        278,        278,        1,    38016, 0x22cbd5ef
-0,        279,        279,        1,    38016, 0x08e0f250
-0,        280,        280,        1,    38016, 0x4e4aeb0a
-0,        281,        281,        1,    38016, 0x7895e0bd
-0,        282,        282,        1,    38016, 0xc11cea95
-0,        283,        283,        1,    38016, 0x13b3bcf8
-0,        284,        284,        1,    38016, 0xcb312186
-0,        285,        285,        1,    38016, 0x791007ca
-0,        286,        286,        1,    38016, 0xaa77354f
-0,        287,        287,        1,    38016, 0x1dbc2a67
-0,        288,        288,        1,    38016, 0x00646a65
-0,        289,        289,        1,    38016, 0x19db488d
-0,        290,        290,        1,    38016, 0x16c155e5
-0,        291,        291,        1,    38016, 0xb760898e
-0,        292,        292,        1,    38016, 0xbd6691e8
-0,        293,        293,        1,    38016, 0x06829781
-0,        294,        294,        1,    38016, 0xcebab8ad
-0,        295,        295,        1,    38016, 0xe2f38e79
-0,        296,        296,        1,    38016, 0x1e00c08e
-0,        297,        297,        1,    38016, 0x86d6c935
-0,        298,        298,        1,    38016, 0xaa88dfdc
-0,        299,        299,        1,    38016, 0xa9029b45
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr6_bt_b b/deps/libav/tests/ref/fate/h264-conformance-mr6_bt_b
deleted file mode 100644
index 3b02506..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr6_bt_b
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    36864, 0x954464be
-0,          1,          1,        1,    36864, 0xace1d90b
-0,          2,          2,        1,    36864, 0x8f149f03
-0,          3,          3,        1,    36864, 0xea9b21eb
-0,          4,          4,        1,    36864, 0xb51d9fe3
-0,          5,          5,        1,    36864, 0x61bd11d7
-0,          6,          6,        1,    36864, 0x9d36980f
-0,          7,          7,        1,    36864, 0xa4192c5e
-0,          8,          8,        1,    36864, 0x11006433
-0,          9,          9,        1,    36864, 0x4a243e46
-0,         10,         10,        1,    36864, 0x1807b5e8
-0,         11,         11,        1,    36864, 0xbe37743c
-0,         12,         12,        1,    36864, 0x82491319
-0,         13,         13,        1,    36864, 0x006e9914
-0,         14,         14,        1,    36864, 0xa5261884
-0,         15,         15,        1,    36864, 0x2030c9d6
-0,         16,         16,        1,    36864, 0xc80eb1ce
-0,         17,         17,        1,    36864, 0x4d559791
-0,         18,         18,        1,    36864, 0xf5f900ee
-0,         19,         19,        1,    36864, 0x2cc9c0d7
-0,         20,         20,        1,    36864, 0x5ba14186
-0,         21,         21,        1,    36864, 0x47a46865
-0,         22,         22,        1,    36864, 0x5ba180b7
-0,         23,         23,        1,    36864, 0xc67c4876
-0,         24,         24,        1,    36864, 0x4311d75d
-0,         25,         25,        1,    36864, 0x56edb851
-0,         26,         26,        1,    36864, 0x7e5aa3e0
-0,         27,         27,        1,    36864, 0x8df8283a
-0,         28,         28,        1,    36864, 0xb8583ddf
-0,         29,         29,        1,    36864, 0xf33fb779
-0,         30,         30,        1,    36864, 0xe9942ddc
-0,         31,         31,        1,    36864, 0x2bc5f7fa
-0,         32,         32,        1,    36864, 0xc7b66c65
-0,         33,         33,        1,    36864, 0x1a524319
-0,         34,         34,        1,    36864, 0xf60c6141
-0,         35,         35,        1,    36864, 0x113f41f2
-0,         36,         36,        1,    36864, 0xad191a31
-0,         37,         37,        1,    36864, 0x3898264a
-0,         38,         38,        1,    36864, 0x3c2f34a4
-0,         39,         39,        1,    36864, 0xd0fc76aa
-0,         40,         40,        1,    36864, 0x2870b546
-0,         41,         41,        1,    36864, 0x7d326fb4
-0,         42,         42,        1,    36864, 0xd7ed14e1
-0,         43,         43,        1,    36864, 0x205174aa
-0,         44,         44,        1,    36864, 0xa3a88be9
-0,         45,         45,        1,    36864, 0xd6f01751
-0,         46,         46,        1,    36864, 0x5420bb80
-0,         47,         47,        1,    36864, 0xe14518f9
-0,         48,         48,        1,    36864, 0x931db61e
-0,         49,         49,        1,    36864, 0x052ecfae
-0,         50,         50,        1,    36864, 0x29b1b0f5
-0,         51,         51,        1,    36864, 0xa3057117
-0,         52,         52,        1,    36864, 0x954464be
-0,         53,         53,        1,    36864, 0xace1d90b
-0,         54,         54,        1,    36864, 0x8f149f03
-0,         55,         55,        1,    36864, 0x485722c5
-0,         56,         56,        1,    36864, 0x534b18f9
-0,         57,         57,        1,    36864, 0xc893a0a6
-0,         58,         58,        1,    36864, 0x8b04e1dd
-0,         59,         59,        1,    36864, 0xaf536964
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr7_bt_b b/deps/libav/tests/ref/fate/h264-conformance-mr7_bt_b
deleted file mode 100644
index 25b7054..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr7_bt_b
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    36864, 0x579e6274
-0,          1,          1,        1,    36864, 0x8650c61c
-0,          2,          2,        1,    36864, 0xbc359647
-0,          3,          3,        1,    36864, 0x08d91c13
-0,          4,          4,        1,    36864, 0xe8b79043
-0,          5,          5,        1,    36864, 0x2f16085a
-0,          6,          6,        1,    36864, 0x81e89739
-0,          7,          7,        1,    36864, 0xf2f324dd
-0,          8,          8,        1,    36864, 0x592b5a01
-0,          9,          9,        1,    36864, 0x4c2f2d91
-0,         10,         10,        1,    36864, 0x8baeb610
-0,         11,         11,        1,    36864, 0x86d47617
-0,         12,         12,        1,    36864, 0xf11011cc
-0,         13,         13,        1,    36864, 0xe56a9daa
-0,         14,         14,        1,    36864, 0xd57119d6
-0,         15,         15,        1,    36864, 0xe28fcde7
-0,         16,         16,        1,    36864, 0x9aeeba86
-0,         17,         17,        1,    36864, 0xa518a7c5
-0,         18,         18,        1,    36864, 0x9af410be
-0,         19,         19,        1,    36864, 0x1fedd12f
-0,         20,         20,        1,    36864, 0xa8032e03
-0,         21,         21,        1,    36864, 0x579e6274
-0,         22,         22,        1,    36864, 0x99846ef6
-0,         23,         23,        1,    36864, 0xb5ad3ca7
-0,         24,         24,        1,    36864, 0x7845cb90
-0,         25,         25,        1,    36864, 0x569fae24
-0,         26,         26,        1,    36864, 0x8a3c9f98
-0,         27,         27,        1,    36864, 0x0b7722af
-0,         28,         28,        1,    36864, 0x699c2dd8
-0,         29,         29,        1,    36864, 0xd477af13
-0,         30,         30,        1,    36864, 0x17b62d7c
-0,         31,         31,        1,    36864, 0xb1ecf6a7
-0,         32,         32,        1,    36864, 0xf9c17e4c
-0,         33,         33,        1,    36864, 0xe7c44618
-0,         34,         34,        1,    36864, 0x7e23654e
-0,         35,         35,        1,    36864, 0xd8a0457c
-0,         36,         36,        1,    36864, 0x57e11df1
-0,         37,         37,        1,    36864, 0xd54d2a43
-0,         38,         38,        1,    36864, 0xc6f03950
-0,         39,         39,        1,    36864, 0x687e750e
-0,         40,         40,        1,    36864, 0x2870b546
-0,         41,         41,        1,    36864, 0xda0370d0
-0,         42,         42,        1,    36864, 0x5a2e0bff
-0,         43,         43,        1,    36864, 0xe1f07533
-0,         44,         44,        1,    36864, 0x3de892b9
-0,         45,         45,        1,    36864, 0xe5c31505
-0,         46,         46,        1,    36864, 0x96b8c082
-0,         47,         47,        1,    36864, 0x55391423
-0,         48,         48,        1,    36864, 0xc285bd71
-0,         49,         49,        1,    36864, 0xf702d9f3
-0,         50,         50,        1,    36864, 0x7afbadf8
-0,         51,         51,        1,    36864, 0xd9b568f7
-0,         52,         52,        1,    36864, 0x579e6274
-0,         53,         53,        1,    36864, 0x8650c61c
-0,         54,         54,        1,    36864, 0xbc359647
-0,         55,         55,        1,    36864, 0x5522328c
-0,         56,         56,        1,    36864, 0x02821fd6
-0,         57,         57,        1,    36864, 0xb4ee9562
-0,         58,         58,        1,    36864, 0xcefedb68
-0,         59,         59,        1,    36864, 0xd959782e
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr8_bt_b b/deps/libav/tests/ref/fate/h264-conformance-mr8_bt_b
deleted file mode 100644
index 220acf1..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr8_bt_b
+++ /dev/null
@@ -1,59 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    36864, 0x36df68f4
-0,          1,          1,        1,    36864, 0x52d4c6d9
-0,          2,          2,        1,    36864, 0xad16b0be
-0,          3,          3,        1,    36864, 0xf8c72556
-0,          4,          4,        1,    36864, 0x70aaad30
-0,          5,          5,        1,    36864, 0x53cffd5e
-0,          6,          6,        1,    36864, 0xb3fa8abc
-0,          7,          7,        1,    36864, 0x9c894009
-0,          8,          8,        1,    36864, 0xfbc08050
-0,          9,          9,        1,    36864, 0x9d5b2d65
-0,         10,         10,        1,    36864, 0x3bd8bb5d
-0,         11,         11,        1,    36864, 0x8d976ecf
-0,         12,         12,        1,    36864, 0x25010368
-0,         13,         13,        1,    36864, 0xb6e6a11c
-0,         14,         14,        1,    36864, 0x595a3967
-0,         15,         15,        1,    36864, 0x4fbcb9a8
-0,         16,         16,        1,    36864, 0xc7c5c16b
-0,         17,         17,        1,    36864, 0x661ae1eb
-0,         18,         18,        1,    36864, 0x169f04a7
-0,         19,         19,        1,    36864, 0xd124c93a
-0,         20,         20,        1,    36864, 0x3f642dba
-0,         21,         21,        1,    36864, 0xe7ad6956
-0,         22,         22,        1,    36864, 0x47dc76d3
-0,         23,         23,        1,    36864, 0x496a3917
-0,         24,         24,        1,    36864, 0xa976d5f3
-0,         25,         25,        1,    36864, 0x507bb685
-0,         26,         26,        1,    36864, 0x2f61ac12
-0,         27,         27,        1,    36864, 0x527818d8
-0,         28,         28,        1,    36864, 0xa4983396
-0,         29,         29,        1,    36864, 0x3ec9b07b
-0,         30,         30,        1,    36864, 0x7db52d99
-0,         31,         31,        1,    36864, 0xe974fd00
-0,         32,         32,        1,    36864, 0x9c677a4f
-0,         33,         33,        1,    36864, 0x108f3a05
-0,         34,         34,        1,    36864, 0x23a56ba2
-0,         35,         35,        1,    36864, 0x4c8d47e8
-0,         36,         36,        1,    36864, 0x9e0b0f09
-0,         37,         37,        1,    36864, 0x4d262b16
-0,         38,         38,        1,    36864, 0x6122402e
-0,         39,         39,        1,    36864, 0xed037036
-0,         40,         40,        1,    36864, 0x62b3ba08
-0,         41,         41,        1,    36864, 0x7f876930
-0,         42,         42,        1,    36864, 0x4a6c0983
-0,         43,         43,        1,    36864, 0xf9787086
-0,         44,         44,        1,    36864, 0x01d1b1b5
-0,         45,         45,        1,    36864, 0xc1622655
-0,         46,         46,        1,    36864, 0x27e8e0f7
-0,         47,         47,        1,    36864, 0xc1622655
-0,         48,         48,        1,    36864, 0x12c2b7e9
-0,         49,         49,        1,    36864, 0xd752d2ef
-0,         50,         50,        1,    36864, 0xcbb1c3a7
-0,         51,         51,        1,    36864, 0x18c56fba
-0,         52,         52,        1,    36864, 0xb1b3771c
-0,         53,         53,        1,    36864, 0x284ef3c4
-0,         54,         54,        1,    36864, 0xda6eb5a0
-0,         55,         55,        1,    36864, 0x17ad337c
-0,         56,         56,        1,    36864, 0xe2801e4f
-0,         57,         57,        1,    36864, 0x6c33bd17
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mr9_bt_b b/deps/libav/tests/ref/fate/h264-conformance-mr9_bt_b
deleted file mode 100644
index 3744802..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mr9_bt_b
+++ /dev/null
@@ -1,59 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    36864, 0xb4c5642e
-0,          1,          1,        1,    36864, 0x929fd05f
-0,          2,          2,        1,    36864, 0x447c9b69
-0,          3,          3,        1,    36864, 0xab0712da
-0,          4,          4,        1,    36864, 0xd9f69216
-0,          5,          5,        1,    36864, 0xec04f6dc
-0,          6,          6,        1,    36864, 0x5ffa86cc
-0,          7,          7,        1,    36864, 0x75122807
-0,          8,          8,        1,    36864, 0x27036a2b
-0,          9,          9,        1,    36864, 0x00072654
-0,         10,         10,        1,    36864, 0x49fab4fd
-0,         11,         11,        1,    36864, 0x975a7545
-0,         12,         12,        1,    36864, 0x9b080a2f
-0,         13,         13,        1,    36864, 0x78db960e
-0,         14,         14,        1,    36864, 0xd7a928d4
-0,         15,         15,        1,    36864, 0x0a83ba1b
-0,         16,         16,        1,    36864, 0xad6bb30c
-0,         17,         17,        1,    36864, 0xf6addb0d
-0,         18,         18,        1,    36864, 0x00540a0a
-0,         19,         19,        1,    36864, 0x049cc748
-0,         20,         20,        1,    36864, 0x5b1e2291
-0,         21,         21,        1,    36864, 0x2367706e
-0,         22,         22,        1,    36864, 0x88ef6b11
-0,         23,         23,        1,    36864, 0x85b73230
-0,         24,         24,        1,    36864, 0xe46cd522
-0,         25,         25,        1,    36864, 0x98489c05
-0,         26,         26,        1,    36864, 0x7e439564
-0,         27,         27,        1,    36864, 0x71330799
-0,         28,         28,        1,    36864, 0x81a6239e
-0,         29,         29,        1,    36864, 0x8005a302
-0,         30,         30,        1,    36864, 0xdf132e3f
-0,         31,         31,        1,    36864, 0x2a1d00de
-0,         32,         32,        1,    36864, 0x7bb57e14
-0,         33,         33,        1,    36864, 0xf2a637cf
-0,         34,         34,        1,    36864, 0xae6f6916
-0,         35,         35,        1,    36864, 0x2f1d4763
-0,         36,         36,        1,    36864, 0xa4e1145e
-0,         37,         37,        1,    36864, 0xc1644392
-0,         38,         38,        1,    36864, 0x21853537
-0,         39,         39,        1,    36864, 0x0bc45bac
-0,         40,         40,        1,    36864, 0x84ccb8ee
-0,         41,         41,        1,    36864, 0x65de651c
-0,         42,         42,        1,    36864, 0x33ff027e
-0,         43,         43,        1,    36864, 0xefe47056
-0,         44,         44,        1,    36864, 0x8952b47c
-0,         45,         45,        1,    36864, 0x78730fcf
-0,         46,         46,        1,    36864, 0x14bae79f
-0,         47,         47,        1,    36864, 0x53230fbe
-0,         48,         48,        1,    36864, 0x15b0b245
-0,         49,         49,        1,    36864, 0x45fbd155
-0,         50,         50,        1,    36864, 0x41cfbac4
-0,         51,         51,        1,    36864, 0x0d635d61
-0,         52,         52,        1,    36864, 0x55aa8d3c
-0,         53,         53,        1,    36864, 0x8f02fbaf
-0,         54,         54,        1,    36864, 0xb17fac3f
-0,         55,         55,        1,    36864, 0xc12627f9
-0,         56,         56,        1,    36864, 0xa5971e4a
-0,         57,         57,        1,    36864, 0x3677abfe
diff --git a/deps/libav/tests/ref/fate/h264-conformance-mv1_brcm_d b/deps/libav/tests/ref/fate/h264-conformance-mv1_brcm_d
deleted file mode 100644
index 47517ee..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-mv1_brcm_d
+++ /dev/null
@@ -1,258 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x230d7aa6
-0,          1,          1,        1,   518400, 0x9fc976e0
-0,          2,          2,        1,   518400, 0x51052db9
-0,          3,          3,        1,   518400, 0xad82d599
-0,          4,          4,        1,   518400, 0xa122c6a7
-0,          5,          5,        1,   518400, 0x0c3a81a0
-0,          6,          6,        1,   518400, 0x6235364e
-0,          7,          7,        1,   518400, 0x4d5104f8
-0,          8,          8,        1,   518400, 0x09cc49b1
-0,          9,          9,        1,   518400, 0xcdb05c19
-0,         10,         10,        1,   518400, 0x894be6de
-0,         11,         11,        1,   518400, 0x53a41fc3
-0,         12,         12,        1,   518400, 0x7568ccee
-0,         13,         13,        1,   518400, 0x2b5ae37b
-0,         14,         14,        1,   518400, 0xd0b994bb
-0,         15,         15,        1,   518400, 0x1b161358
-0,         16,         16,        1,   518400, 0xc5434edc
-0,         17,         17,        1,   518400, 0xc4709590
-0,         18,         18,        1,   518400, 0x60c6803a
-0,         19,         19,        1,   518400, 0xdff3edcd
-0,         20,         20,        1,   518400, 0x8a02b8b4
-0,         21,         21,        1,   518400, 0x478cf791
-0,         22,         22,        1,   518400, 0x7c42fed0
-0,         23,         23,        1,   518400, 0x12b1336d
-0,         24,         24,        1,   518400, 0xe16e765e
-0,         25,         25,        1,   518400, 0x002c291e
-0,         26,         26,        1,   518400, 0x50810b53
-0,         27,         27,        1,   518400, 0xda7e2453
-0,         28,         28,        1,   518400, 0x6e330093
-0,         29,         29,        1,   518400, 0xf30740b3
-0,         30,         30,        1,   518400, 0xc27ae19d
-0,         31,         31,        1,   518400, 0xe49da8c2
-0,         32,         32,        1,   518400, 0xa739372c
-0,         33,         33,        1,   518400, 0x4b44788c
-0,         34,         34,        1,   518400, 0xfdf9e6cf
-0,         35,         35,        1,   518400, 0xee205413
-0,         36,         36,        1,   518400, 0x8792dc0e
-0,         37,         37,        1,   518400, 0x6820d611
-0,         38,         38,        1,   518400, 0x106cbc2c
-0,         39,         39,        1,   518400, 0x7d8e3e92
-0,         40,         40,        1,   518400, 0xbfe48709
-0,         41,         41,        1,   518400, 0xc5d5a55d
-0,         42,         42,        1,   518400, 0x7c234886
-0,         43,         43,        1,   518400, 0x852372b0
-0,         44,         44,        1,   518400, 0x43d697f9
-0,         45,         45,        1,   518400, 0xc3460806
-0,         46,         46,        1,   518400, 0x0600abea
-0,         47,         47,        1,   518400, 0xf6e3ab0e
-0,         48,         48,        1,   518400, 0x651f9a46
-0,         49,         49,        1,   518400, 0xed467ba0
-0,         50,         50,        1,   518400, 0x62312c3f
-0,         51,         51,        1,   518400, 0xb121898d
-0,         52,         52,        1,   518400, 0xb1f96406
-0,         53,         53,        1,   518400, 0x78003318
-0,         54,         54,        1,   518400, 0x1032b15b
-0,         55,         55,        1,   518400, 0x72683d37
-0,         56,         56,        1,   518400, 0xd1349f12
-0,         57,         57,        1,   518400, 0x4162f707
-0,         58,         58,        1,   518400, 0x894711c9
-0,         59,         59,        1,   518400, 0xca37429b
-0,         60,         60,        1,   518400, 0xb8e91eb5
-0,         61,         61,        1,   518400, 0xe5eb3103
-0,         62,         62,        1,   518400, 0x56a33cea
-0,         63,         63,        1,   518400, 0x79ef0227
-0,         64,         64,        1,   518400, 0x7ceaab75
-0,         65,         65,        1,   518400, 0x3f4787b2
-0,         66,         66,        1,   518400, 0x9e6d2abb
-0,         67,         67,        1,   518400, 0xedb0cf82
-0,         68,         68,        1,   518400, 0x19c8723f
-0,         69,         69,        1,   518400, 0x35d8399b
-0,         70,         70,        1,   518400, 0xe0224dc8
-0,         71,         71,        1,   518400, 0xc95467bf
-0,         72,         72,        1,   518400, 0x99662844
-0,         73,         73,        1,   518400, 0x10a322c9
-0,         74,         74,        1,   518400, 0xe6313d98
-0,         75,         75,        1,   518400, 0x2e2a63d1
-0,         76,         76,        1,   518400, 0x2c9d0715
-0,         77,         77,        1,   518400, 0xf31d9e19
-0,         78,         78,        1,   518400, 0xcea1f9f8
-0,         79,         79,        1,   518400, 0xece1cd92
-0,         80,         80,        1,   518400, 0xa8d35347
-0,         81,         81,        1,   518400, 0xd8cd2228
-0,         82,         82,        1,   518400, 0xe040993a
-0,         83,         83,        1,   518400, 0xebc2b387
-0,         84,         84,        1,   518400, 0xc3e81e85
-0,         85,         85,        1,   518400, 0xcc507bc9
-0,         86,         86,        1,   518400, 0xb98c4902
-0,         87,         87,        1,   518400, 0x454a2a50
-0,         88,         88,        1,   518400, 0x1460c5dd
-0,         89,         89,        1,   518400, 0x37d7a99d
-0,         90,         90,        1,   518400, 0x1de7a047
-0,         91,         91,        1,   518400, 0xc7b83c21
-0,         92,         92,        1,   518400, 0xe06d1c9b
-0,         93,         93,        1,   518400, 0xfd8259b5
-0,         94,         94,        1,   518400, 0xc3df7e1a
-0,         95,         95,        1,   518400, 0x60c9ccec
-0,         96,         96,        1,   518400, 0x7d163c04
-0,         97,         97,        1,   518400, 0x8fc61e9d
-0,         98,         98,        1,   518400, 0xa5f520e6
-0,         99,         99,        1,   518400, 0x8d709ec1
-0,        100,        100,        1,   518400, 0xca2b6287
-0,        101,        101,        1,   518400, 0x8531bb18
-0,        102,        102,        1,   518400, 0x830f9187
-0,        103,        103,        1,   518400, 0x67c5d413
-0,        104,        104,        1,   518400, 0x428aeecd
-0,        105,        105,        1,   518400, 0xbf8e3448
-0,        106,        106,        1,   518400, 0x847389f0
-0,        107,        107,        1,   518400, 0x18d0b3ba
-0,        108,        108,        1,   518400, 0xbee957ea
-0,        109,        109,        1,   518400, 0x34941f3e
-0,        110,        110,        1,   518400, 0x850e0126
-0,        111,        111,        1,   518400, 0xab992409
-0,        112,        112,        1,   518400, 0xb7d8d01f
-0,        113,        113,        1,   518400, 0xe602576c
-0,        114,        114,        1,   518400, 0x22388048
-0,        115,        115,        1,   518400, 0x81ab9f4a
-0,        116,        116,        1,   518400, 0xc5977820
-0,        117,        117,        1,   518400, 0xc43f98bd
-0,        118,        118,        1,   518400, 0xfd5e6d12
-0,        119,        119,        1,   518400, 0xb9f12c73
-0,        120,        120,        1,   518400, 0x44be16b9
-0,        121,        121,        1,   518400, 0x32f0d9b9
-0,        122,        122,        1,   518400, 0x6e9c3113
-0,        123,        123,        1,   518400, 0x00618755
-0,        124,        124,        1,   518400, 0x080c9955
-0,        125,        125,        1,   518400, 0xb21d6096
-0,        126,        126,        1,   518400, 0x51502f54
-0,        127,        127,        1,   518400, 0xf062e38b
-0,        128,        128,        1,   518400, 0x66f05988
-0,        129,        129,        1,   518400, 0x37d569f1
-0,        130,        130,        1,   518400, 0xba78ae5e
-0,        131,        131,        1,   518400, 0x634a2d25
-0,        132,        132,        1,   518400, 0x283e5e4a
-0,        133,        133,        1,   518400, 0x9344d41c
-0,        134,        134,        1,   518400, 0x1fdb5c18
-0,        135,        135,        1,   518400, 0xd8139683
-0,        136,        136,        1,   518400, 0xd27f555e
-0,        137,        137,        1,   518400, 0x34ed517f
-0,        138,        138,        1,   518400, 0x1f55ad2d
-0,        139,        139,        1,   518400, 0x9a8bd368
-0,        140,        140,        1,   518400, 0x9726e3bf
-0,        141,        141,        1,   518400, 0xaf8945ee
-0,        142,        142,        1,   518400, 0x28c20699
-0,        143,        143,        1,   518400, 0x43e180c9
-0,        144,        144,        1,   518400, 0x0c88e592
-0,        145,        145,        1,   518400, 0xdcb8825e
-0,        146,        146,        1,   518400, 0x1ec09a5e
-0,        147,        147,        1,   518400, 0x149768b2
-0,        148,        148,        1,   518400, 0x1eeab153
-0,        149,        149,        1,   518400, 0x25666d6f
-0,        150,        150,        1,   518400, 0x691cad89
-0,        151,        151,        1,   518400, 0x2d9f8ced
-0,        152,        152,        1,   518400, 0xd80b768d
-0,        153,        153,        1,   518400, 0xe4f23a79
-0,        154,        154,        1,   518400, 0xd51d0150
-0,        155,        155,        1,   518400, 0x060156f4
-0,        156,        156,        1,   518400, 0x800720fb
-0,        157,        157,        1,   518400, 0x2a433b28
-0,        158,        158,        1,   518400, 0xffc79782
-0,        159,        159,        1,   518400, 0x31ba693b
-0,        160,        160,        1,   518400, 0xd13c8395
-0,        161,        161,        1,   518400, 0x07d9f752
-0,        162,        162,        1,   518400, 0xabb81043
-0,        163,        163,        1,   518400, 0xba0ee926
-0,        164,        164,        1,   518400, 0xa17e7ea9
-0,        165,        165,        1,   518400, 0x9d709e52
-0,        166,        166,        1,   518400, 0x7fa02633
-0,        167,        167,        1,   518400, 0x5cdc5217
-0,        168,        168,        1,   518400, 0x888be0b0
-0,        169,        169,        1,   518400, 0xe1bac436
-0,        170,        170,        1,   518400, 0xa479b1b8
-0,        171,        171,        1,   518400, 0xb61feb17
-0,        172,        172,        1,   518400, 0xa0745cd4
-0,        173,        173,        1,   518400, 0x871cffe5
-0,        174,        174,        1,   518400, 0x01f7deea
-0,        175,        175,        1,   518400, 0xdaf6f9f5
-0,        176,        176,        1,   518400, 0xfee4849c
-0,        177,        177,        1,   518400, 0xc3b9b428
-0,        178,        178,        1,   518400, 0x50b4b47f
-0,        179,        179,        1,   518400, 0xe8e58b82
-0,        180,        180,        1,   518400, 0x7c6f94e0
-0,        181,        181,        1,   518400, 0x0cfe7c08
-0,        182,        182,        1,   518400, 0xb2975466
-0,        183,        183,        1,   518400, 0xa1245de1
-0,        184,        184,        1,   518400, 0x46ae79b7
-0,        185,        185,        1,   518400, 0x8344a9b2
-0,        186,        186,        1,   518400, 0x1e805013
-0,        187,        187,        1,   518400, 0x19b61baf
-0,        188,        188,        1,   518400, 0xd018383b
-0,        189,        189,        1,   518400, 0xc9248d31
-0,        190,        190,        1,   518400, 0x838ad8ec
-0,        191,        191,        1,   518400, 0xa848824a
-0,        192,        192,        1,   518400, 0xc6a46ebd
-0,        193,        193,        1,   518400, 0x2a7c489c
-0,        194,        194,        1,   518400, 0xb1db6cef
-0,        195,        195,        1,   518400, 0xd24a999f
-0,        196,        196,        1,   518400, 0xce47efcd
-0,        197,        197,        1,   518400, 0xf3e058cb
-0,        198,        198,        1,   518400, 0x25d7f6e3
-0,        199,        199,        1,   518400, 0xe3daa12d
-0,        200,        200,        1,   518400, 0xb3de8475
-0,        201,        201,        1,   518400, 0x13efffdc
-0,        202,        202,        1,   518400, 0xfb37e048
-0,        203,        203,        1,   518400, 0x599a6daf
-0,        204,        204,        1,   518400, 0x84bf6814
-0,        205,        205,        1,   518400, 0x83c03a3f
-0,        206,        206,        1,   518400, 0x3a319ae9
-0,        207,        207,        1,   518400, 0x0af252c3
-0,        208,        208,        1,   518400, 0xeb8f2f43
-0,        209,        209,        1,   518400, 0x3bdcd421
-0,        210,        210,        1,   518400, 0x9107e0f2
-0,        211,        211,        1,   518400, 0x5f4fe3cf
-0,        212,        212,        1,   518400, 0x38f1e8ef
-0,        213,        213,        1,   518400, 0xb0359a0b
-0,        214,        214,        1,   518400, 0xdddd4645
-0,        215,        215,        1,   518400, 0xe14ffb0b
-0,        216,        216,        1,   518400, 0x34a31c96
-0,        217,        217,        1,   518400, 0x1f4406de
-0,        218,        218,        1,   518400, 0x042b82b6
-0,        219,        219,        1,   518400, 0x6af16a4d
-0,        220,        220,        1,   518400, 0x3cfba41a
-0,        221,        221,        1,   518400, 0xa054b6e8
-0,        222,        222,        1,   518400, 0x2d55721b
-0,        223,        223,        1,   518400, 0x55391f75
-0,        224,        224,        1,   518400, 0xc2d46fa6
-0,        225,        225,        1,   518400, 0x3a2576d9
-0,        226,        226,        1,   518400, 0xea9ea26d
-0,        227,        227,        1,   518400, 0xe2ec8962
-0,        228,        228,        1,   518400, 0x47568769
-0,        229,        229,        1,   518400, 0xc55e0186
-0,        230,        230,        1,   518400, 0x73a44453
-0,        231,        231,        1,   518400, 0xe36b1c77
-0,        232,        232,        1,   518400, 0x414db365
-0,        233,        233,        1,   518400, 0xfb25f7f6
-0,        234,        234,        1,   518400, 0x5b4847a7
-0,        235,        235,        1,   518400, 0xe96babf4
-0,        236,        236,        1,   518400, 0x15edbf63
-0,        237,        237,        1,   518400, 0x08a984c6
-0,        238,        238,        1,   518400, 0x47ec41af
-0,        239,        239,        1,   518400, 0x1912eaca
-0,        240,        240,        1,   518400, 0xe058b0cc
-0,        241,        241,        1,   518400, 0x03e9660b
-0,        242,        242,        1,   518400, 0x85fea285
-0,        243,        243,        1,   518400, 0xdf02bdd6
-0,        244,        244,        1,   518400, 0xad3e6849
-0,        245,        245,        1,   518400, 0x0ad866b6
-0,        246,        246,        1,   518400, 0x1b994f78
-0,        247,        247,        1,   518400, 0xc5916af5
-0,        248,        248,        1,   518400, 0x5f66adeb
-0,        249,        249,        1,   518400, 0x1c9f96a1
-0,        250,        250,        1,   518400, 0xfc390832
-0,        251,        251,        1,   518400, 0x0352ff56
-0,        252,        252,        1,   518400, 0x6803c8f4
-0,        253,        253,        1,   518400, 0x0f0b8686
-0,        254,        254,        1,   518400, 0xdc3a5bce
-0,        255,        255,        1,   518400, 0x96dd28d1
-0,        256,        256,        1,   518400, 0x51d56824
diff --git a/deps/libav/tests/ref/fate/h264-conformance-nl1_sony_d b/deps/libav/tests/ref/fate/h264-conformance-nl1_sony_d
deleted file mode 100644
index 98a5673..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-nl1_sony_d
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xc805351d
-0,          1,          1,        1,    38016, 0x3809fec3
-0,          2,          2,        1,    38016, 0xf698ce3c
-0,          3,          3,        1,    38016, 0x7e3da603
-0,          4,          4,        1,    38016, 0x68b07d81
-0,          5,          5,        1,    38016, 0xd91f717a
-0,          6,          6,        1,    38016, 0x48885dd6
-0,          7,          7,        1,    38016, 0x27e64e8e
-0,          8,          8,        1,    38016, 0x955835ce
-0,          9,          9,        1,    38016, 0xf19940a0
-0,         10,         10,        1,    38016, 0x9a1c51e4
-0,         11,         11,        1,    38016, 0xf59373af
-0,         12,         12,        1,    38016, 0x5d6c7d06
-0,         13,         13,        1,    38016, 0x32fca533
-0,         14,         14,        1,    38016, 0x37e69987
-0,         15,         15,        1,    38016, 0x96929e05
-0,         16,         16,        1,    38016, 0xee37a1f9
diff --git a/deps/libav/tests/ref/fate/h264-conformance-nl2_sony_h b/deps/libav/tests/ref/fate/h264-conformance-nl2_sony_h
deleted file mode 100644
index 73eb858..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-nl2_sony_h
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xc805351d
-0,          1,          1,        1,    38016, 0x320510a8
-0,          2,          2,        1,    38016, 0x3ef6e4c6
-0,          3,          3,        1,    38016, 0x3b94c5e0
-0,          4,          4,        1,    38016, 0x4be4a689
-0,          5,          5,        1,    38016, 0x70919210
-0,          6,          6,        1,    38016, 0x78a07b5a
-0,          7,          7,        1,    38016, 0x8bd86efc
-0,          8,          8,        1,    38016, 0xe3976cab
-0,          9,          9,        1,    38016, 0x77fa735e
-0,         10,         10,        1,    38016, 0x62488adb
-0,         11,         11,        1,    38016, 0x5b07a6a4
-0,         12,         12,        1,    38016, 0x7058b15f
-0,         13,         13,        1,    38016, 0xa22dc9e2
-0,         14,         14,        1,    38016, 0xc9d5cae3
-0,         15,         15,        1,    38016, 0x16cbd6e1
-0,         16,         16,        1,    38016, 0x4b23d9e9
-0,         17,         17,        1,    38016, 0x96f7d798
-0,         18,         18,        1,    38016, 0xdbcdcfdd
-0,         19,         19,        1,    38016, 0x9314b847
-0,         20,         20,        1,    38016, 0x0a209c28
-0,         21,         21,        1,    38016, 0x6c757322
-0,         22,         22,        1,    38016, 0x3d1a6376
-0,         23,         23,        1,    38016, 0x155f5df7
-0,         24,         24,        1,    38016, 0xd4446441
-0,         25,         25,        1,    38016, 0xe1006713
-0,         26,         26,        1,    38016, 0x5d226a3e
-0,         27,         27,        1,    38016, 0xe839790c
-0,         28,         28,        1,    38016, 0xa28c8b9a
-0,         29,         29,        1,    38016, 0xde469f7a
-0,         30,         30,        1,    38016, 0xf800b7ad
-0,         31,         31,        1,    38016, 0xf2f9ccac
-0,         32,         32,        1,    38016, 0x60feeb52
-0,         33,         33,        1,    38016, 0xad39fd4f
-0,         34,         34,        1,    38016, 0x4075fce6
-0,         35,         35,        1,    38016, 0x5f2f036e
-0,         36,         36,        1,    38016, 0x3e180450
-0,         37,         37,        1,    38016, 0xd806fc04
-0,         38,         38,        1,    38016, 0x3f15fbc6
-0,         39,         39,        1,    38016, 0xb881faa4
-0,         40,         40,        1,    38016, 0xf1cafdc8
-0,         41,         41,        1,    38016, 0xd881f881
-0,         42,         42,        1,    38016, 0x6314fdc8
-0,         43,         43,        1,    38016, 0x8fa6f0d3
-0,         44,         44,        1,    38016, 0x90d0f40d
-0,         45,         45,        1,    38016, 0x1d30ee93
-0,         46,         46,        1,    38016, 0x87f6ecca
-0,         47,         47,        1,    38016, 0xca9ae712
-0,         48,         48,        1,    38016, 0x02c6eb47
-0,         49,         49,        1,    38016, 0xc263f492
-0,         50,         50,        1,    38016, 0x717def51
-0,         51,         51,        1,    38016, 0x0d3af240
-0,         52,         52,        1,    38016, 0xc232ea7d
-0,         53,         53,        1,    38016, 0x3c41f195
-0,         54,         54,        1,    38016, 0x5d77f7fb
-0,         55,         55,        1,    38016, 0x2901fb90
-0,         56,         56,        1,    38016, 0x3b35033e
-0,         57,         57,        1,    38016, 0xca4d034f
-0,         58,         58,        1,    38016, 0x1e730e22
-0,         59,         59,        1,    38016, 0x69b60d52
-0,         60,         60,        1,    38016, 0xe50107bc
-0,         61,         61,        1,    38016, 0x44b6f25f
-0,         62,         62,        1,    38016, 0x222ebc66
-0,         63,         63,        1,    38016, 0x165b7bca
-0,         64,         64,        1,    38016, 0x12a37e44
-0,         65,         65,        1,    38016, 0xcce9a1dc
-0,         66,         66,        1,    38016, 0x273dd1a9
-0,         67,         67,        1,    38016, 0x72b00e90
-0,         68,         68,        1,    38016, 0x449a4fa6
-0,         69,         69,        1,    38016, 0x203d8582
-0,         70,         70,        1,    38016, 0x3fa7aaeb
-0,         71,         71,        1,    38016, 0x0b47d491
-0,         72,         72,        1,    38016, 0x1fa70639
-0,         73,         73,        1,    38016, 0xf9fe391e
-0,         74,         74,        1,    38016, 0x91c6786c
-0,         75,         75,        1,    38016, 0x7ab99bb2
-0,         76,         76,        1,    38016, 0x73f2c0f5
-0,         77,         77,        1,    38016, 0xcffad748
-0,         78,         78,        1,    38016, 0xe2b0ee34
-0,         79,         79,        1,    38016, 0x6025f6d6
-0,         80,         80,        1,    38016, 0xd722017c
-0,         81,         81,        1,    38016, 0x321f0c24
-0,         82,         82,        1,    38016, 0x336f0e81
-0,         83,         83,        1,    38016, 0x783a012f
-0,         84,         84,        1,    38016, 0x134cf484
-0,         85,         85,        1,    38016, 0xec4bf2db
-0,         86,         86,        1,    38016, 0xb481012e
-0,         87,         87,        1,    38016, 0x76ff026c
-0,         88,         88,        1,    38016, 0xaf3b102a
-0,         89,         89,        1,    38016, 0x2eaf0bd6
-0,         90,         90,        1,    38016, 0x39b8f833
-0,         91,         91,        1,    38016, 0xe928d7ea
-0,         92,         92,        1,    38016, 0xbe7ac2f8
-0,         93,         93,        1,    38016, 0x3683b5c4
-0,         94,         94,        1,    38016, 0xb3559d1c
-0,         95,         95,        1,    38016, 0x73fb9f71
-0,         96,         96,        1,    38016, 0x3e97b5aa
-0,         97,         97,        1,    38016, 0x0c9dc525
-0,         98,         98,        1,    38016, 0xecead941
-0,         99,         99,        1,    38016, 0x4999e247
-0,        100,        100,        1,    38016, 0x11ddea7c
-0,        101,        101,        1,    38016, 0x4882cf24
-0,        102,        102,        1,    38016, 0xae9ac0c6
-0,        103,        103,        1,    38016, 0x4f88b589
-0,        104,        104,        1,    38016, 0xc677d43f
-0,        105,        105,        1,    38016, 0x5f46f219
-0,        106,        106,        1,    38016, 0x5c1ffa13
-0,        107,        107,        1,    38016, 0x162e11a3
-0,        108,        108,        1,    38016, 0xd0b631d4
-0,        109,        109,        1,    38016, 0x7133441a
-0,        110,        110,        1,    38016, 0xbb085604
-0,        111,        111,        1,    38016, 0x54a960d2
-0,        112,        112,        1,    38016, 0xc0b468e7
-0,        113,        113,        1,    38016, 0xe1ef485a
-0,        114,        114,        1,    38016, 0x025f27e6
-0,        115,        115,        1,    38016, 0x14da215e
-0,        116,        116,        1,    38016, 0xe8f2394a
-0,        117,        117,        1,    38016, 0x7c7a44e8
-0,        118,        118,        1,    38016, 0xdb2e54c3
-0,        119,        119,        1,    38016, 0xae5c5eee
-0,        120,        120,        1,    38016, 0x74ae643f
-0,        121,        121,        1,    38016, 0x70146b61
-0,        122,        122,        1,    38016, 0x545c5265
-0,        123,        123,        1,    38016, 0xe5a92556
-0,        124,        124,        1,    38016, 0xf19e04e8
-0,        125,        125,        1,    38016, 0xda51e574
-0,        126,        126,        1,    38016, 0x4c17ded9
-0,        127,        127,        1,    38016, 0x51fce958
-0,        128,        128,        1,    38016, 0xae96fd16
-0,        129,        129,        1,    38016, 0x7a610e32
-0,        130,        130,        1,    38016, 0x06f31a06
-0,        131,        131,        1,    38016, 0x658a1998
-0,        132,        132,        1,    38016, 0xda370e80
-0,        133,        133,        1,    38016, 0xe7a00dca
-0,        134,        134,        1,    38016, 0xb07a0810
-0,        135,        135,        1,    38016, 0x193c01a3
-0,        136,        136,        1,    38016, 0xa700fd8f
-0,        137,        137,        1,    38016, 0x8c14ed46
-0,        138,        138,        1,    38016, 0xcd81dc72
-0,        139,        139,        1,    38016, 0x67acd3bb
-0,        140,        140,        1,    38016, 0x662cc586
-0,        141,        141,        1,    38016, 0xa09ac106
-0,        142,        142,        1,    38016, 0xf1abab73
-0,        143,        143,        1,    38016, 0xfd9ba674
-0,        144,        144,        1,    38016, 0x7686ae41
-0,        145,        145,        1,    38016, 0x7185a2e9
-0,        146,        146,        1,    38016, 0x2b5898da
-0,        147,        147,        1,    38016, 0x3cdd6c42
-0,        148,        148,        1,    38016, 0x0299414d
-0,        149,        149,        1,    38016, 0x2b851a52
-0,        150,        150,        1,    38016, 0x01c8ff7b
-0,        151,        151,        1,    38016, 0x55d3f715
-0,        152,        152,        1,    38016, 0xbe5ff38e
-0,        153,        153,        1,    38016, 0xc31fe232
-0,        154,        154,        1,    38016, 0x3201dc26
-0,        155,        155,        1,    38016, 0xf8feed84
-0,        156,        156,        1,    38016, 0x0a471009
-0,        157,        157,        1,    38016, 0xef0d351d
-0,        158,        158,        1,    38016, 0x79de6f09
-0,        159,        159,        1,    38016, 0xa5039be4
-0,        160,        160,        1,    38016, 0x4e1cafa6
-0,        161,        161,        1,    38016, 0x2a71aea1
-0,        162,        162,        1,    38016, 0xa99e9d08
-0,        163,        163,        1,    38016, 0x80aa8a6a
-0,        164,        164,        1,    38016, 0x9f287bb9
-0,        165,        165,        1,    38016, 0x2ddc5ef7
-0,        166,        166,        1,    38016, 0x31843470
-0,        167,        167,        1,    38016, 0x08f3074e
-0,        168,        168,        1,    38016, 0xa639e58d
-0,        169,        169,        1,    38016, 0xcf31d61f
-0,        170,        170,        1,    38016, 0x1ac7e986
-0,        171,        171,        1,    38016, 0x9bbbfe98
-0,        172,        172,        1,    38016, 0x3e0d0ce1
-0,        173,        173,        1,    38016, 0x53240e4c
-0,        174,        174,        1,    38016, 0xda6bf0d5
-0,        175,        175,        1,    38016, 0x1701c355
-0,        176,        176,        1,    38016, 0x572c8b1d
-0,        177,        177,        1,    38016, 0x1f4f5a14
-0,        178,        178,        1,    38016, 0x0fea3e61
-0,        179,        179,        1,    38016, 0xa71c29ed
-0,        180,        180,        1,    38016, 0xd3b218fb
-0,        181,        181,        1,    38016, 0x228e05f8
-0,        182,        182,        1,    38016, 0x4b8bfa9e
-0,        183,        183,        1,    38016, 0x13d505ab
-0,        184,        184,        1,    38016, 0xa58808b3
-0,        185,        185,        1,    38016, 0x4b2a1329
-0,        186,        186,        1,    38016, 0x13c63567
-0,        187,        187,        1,    38016, 0x4ece56f8
-0,        188,        188,        1,    38016, 0x934f67c3
-0,        189,        189,        1,    38016, 0x2b606f56
-0,        190,        190,        1,    38016, 0xba481841
-0,        191,        191,        1,    38016, 0x1488ea11
-0,        192,        192,        1,    38016, 0x066cefeb
-0,        193,        193,        1,    38016, 0xb23105b7
-0,        194,        194,        1,    38016, 0x64312267
-0,        195,        195,        1,    38016, 0xd0cf6a37
-0,        196,        196,        1,    38016, 0xb5a482c5
-0,        197,        197,        1,    38016, 0x61289957
-0,        198,        198,        1,    38016, 0x26a6ba47
-0,        199,        199,        1,    38016, 0xb771d25e
-0,        200,        200,        1,    38016, 0xedb5de8d
-0,        201,        201,        1,    38016, 0x4fd2e829
-0,        202,        202,        1,    38016, 0xbef3ef1f
-0,        203,        203,        1,    38016, 0x5e0ef333
-0,        204,        204,        1,    38016, 0x5081f460
-0,        205,        205,        1,    38016, 0x6798fe84
-0,        206,        206,        1,    38016, 0x28ce0078
-0,        207,        207,        1,    38016, 0x9fb4f6a1
-0,        208,        208,        1,    38016, 0x0a02e822
-0,        209,        209,        1,    38016, 0x5615d41e
-0,        210,        210,        1,    38016, 0x1a3bc214
-0,        211,        211,        1,    38016, 0x5333b48a
-0,        212,        212,        1,    38016, 0x646da3c9
-0,        213,        213,        1,    38016, 0x024fa1b1
-0,        214,        214,        1,    38016, 0x7b4892de
-0,        215,        215,        1,    38016, 0x10ab8953
-0,        216,        216,        1,    38016, 0x8aa28410
-0,        217,        217,        1,    38016, 0xcbd185be
-0,        218,        218,        1,    38016, 0xfa49818a
-0,        219,        219,        1,    38016, 0x0f7a82d5
-0,        220,        220,        1,    38016, 0xb86f716d
-0,        221,        221,        1,    38016, 0xd22a6050
-0,        222,        222,        1,    38016, 0x89a4520e
-0,        223,        223,        1,    38016, 0x8a1147cf
-0,        224,        224,        1,    38016, 0xa02a4196
-0,        225,        225,        1,    38016, 0xece240f7
-0,        226,        226,        1,    38016, 0xa5b940ff
-0,        227,        227,        1,    38016, 0x9b274ce8
-0,        228,        228,        1,    38016, 0xba0b68c7
-0,        229,        229,        1,    38016, 0x39f28a91
-0,        230,        230,        1,    38016, 0xc070af11
-0,        231,        231,        1,    38016, 0x2a26d309
-0,        232,        232,        1,    38016, 0xfa9afe77
-0,        233,        233,        1,    38016, 0xe2f22ebf
-0,        234,        234,        1,    38016, 0xf8ee4a45
-0,        235,        235,        1,    38016, 0x14186047
-0,        236,        236,        1,    38016, 0xe3407152
-0,        237,        237,        1,    38016, 0xcef578b8
-0,        238,        238,        1,    38016, 0x3fc06964
-0,        239,        239,        1,    38016, 0xa7da3ade
-0,        240,        240,        1,    38016, 0xa46d1b2b
-0,        241,        241,        1,    38016, 0x14abfac5
-0,        242,        242,        1,    38016, 0xbffbf269
-0,        243,        243,        1,    38016, 0x1d9c3ade
-0,        244,        244,        1,    38016, 0xc9c39c46
-0,        245,        245,        1,    38016, 0x824afa80
-0,        246,        246,        1,    38016, 0xc76611b8
-0,        247,        247,        1,    38016, 0x31fce0d6
-0,        248,        248,        1,    38016, 0x6740a03f
-0,        249,        249,        1,    38016, 0x91d63134
-0,        250,        250,        1,    38016, 0xb0f6cc86
-0,        251,        251,        1,    38016, 0x3d878a14
-0,        252,        252,        1,    38016, 0x1d008063
-0,        253,        253,        1,    38016, 0xe47cd260
-0,        254,        254,        1,    38016, 0x56503400
-0,        255,        255,        1,    38016, 0xb201dc61
-0,        256,        256,        1,    38016, 0xba42de1b
-0,        257,        257,        1,    38016, 0x9c115ccb
-0,        258,        258,        1,    38016, 0xe9be47d9
-0,        259,        259,        1,    38016, 0xa7684b02
-0,        260,        260,        1,    38016, 0xb4d74f42
-0,        261,        261,        1,    38016, 0xbe006415
-0,        262,        262,        1,    38016, 0xa30c7858
-0,        263,        263,        1,    38016, 0x838f7f47
-0,        264,        264,        1,    38016, 0xc1c28346
-0,        265,        265,        1,    38016, 0xc7737219
-0,        266,        266,        1,    38016, 0xa19a5fd5
-0,        267,        267,        1,    38016, 0x56a64b00
-0,        268,        268,        1,    38016, 0x6b672497
-0,        269,        269,        1,    38016, 0x4cfafbe2
-0,        270,        270,        1,    38016, 0xbe53d51b
-0,        271,        271,        1,    38016, 0x4a86acc7
-0,        272,        272,        1,    38016, 0x297288b0
-0,        273,        273,        1,    38016, 0xd4bd2ec9
-0,        274,        274,        1,    38016, 0x3697e2f6
-0,        275,        275,        1,    38016, 0xa493d289
-0,        276,        276,        1,    38016, 0xb2b9e324
-0,        277,        277,        1,    38016, 0x998de275
-0,        278,        278,        1,    38016, 0x422a10cb
-0,        279,        279,        1,    38016, 0x845383b4
-0,        280,        280,        1,    38016, 0xb4a72107
-0,        281,        281,        1,    38016, 0x0e0eef6b
-0,        282,        282,        1,    38016, 0xbd8bbd01
-0,        283,        283,        1,    38016, 0x2f217c45
-0,        284,        284,        1,    38016, 0xb3515be7
-0,        285,        285,        1,    38016, 0xb633a542
-0,        286,        286,        1,    38016, 0x7e7a7086
-0,        287,        287,        1,    38016, 0xef64a834
-0,        288,        288,        1,    38016, 0x7b81bdad
-0,        289,        289,        1,    38016, 0x0fc7a7d2
-0,        290,        290,        1,    38016, 0x9111351d
-0,        291,        291,        1,    38016, 0x161c43dc
-0,        292,        292,        1,    38016, 0x945fce2a
-0,        293,        293,        1,    38016, 0x48780c38
-0,        294,        294,        1,    38016, 0x28904d31
-0,        295,        295,        1,    38016, 0x140d47d5
-0,        296,        296,        1,    38016, 0x1f5e257c
-0,        297,        297,        1,    38016, 0xb36a159c
-0,        298,        298,        1,    38016, 0x85ad2465
-0,        299,        299,        1,    38016, 0x973649e0
diff --git a/deps/libav/tests/ref/fate/h264-conformance-nl3_sva_e b/deps/libav/tests/ref/fate/h264-conformance-nl3_sva_e
deleted file mode 100644
index a4d6db6..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-nl3_sva_e
+++ /dev/null
@@ -1,34 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x2fad15e2
-0,          1,          1,        1,    38016, 0x7e391566
-0,          2,          2,        1,    38016, 0x954001d4
-0,          3,          3,        1,    38016, 0xe5ae2057
-0,          4,          4,        1,    38016, 0xface3d5e
-0,          5,          5,        1,    38016, 0x2b2361cd
-0,          6,          6,        1,    38016, 0x5e906b5a
-0,          7,          7,        1,    38016, 0xa46398e5
-0,          8,          8,        1,    38016, 0x2a3ea141
-0,          9,          9,        1,    38016, 0xa2a0beac
-0,         10,         10,        1,    38016, 0x4830ab90
-0,         11,         11,        1,    38016, 0xdd53d0fc
-0,         12,         12,        1,    38016, 0x4d71ae7d
-0,         13,         13,        1,    38016, 0x2290a25e
-0,         14,         14,        1,    38016, 0x8baa6cca
-0,         15,         15,        1,    38016, 0xc3e99458
-0,         16,         16,        1,    38016, 0x5c608374
-0,         17,         17,        1,    38016, 0x6443aa6c
-0,         18,         18,        1,    38016, 0x1ef7991c
-0,         19,         19,        1,    38016, 0xd246b49b
-0,         20,         20,        1,    38016, 0xe181a026
-0,         21,         21,        1,    38016, 0x878db497
-0,         22,         22,        1,    38016, 0x071079c2
-0,         23,         23,        1,    38016, 0xa94a62fa
-0,         24,         24,        1,    38016, 0xa9da278f
-0,         25,         25,        1,    38016, 0x247b3195
-0,         26,         26,        1,    38016, 0xd7f81a90
-0,         27,         27,        1,    38016, 0x9c303cdc
-0,         28,         28,        1,    38016, 0x646e42a1
-0,         29,         29,        1,    38016, 0x474a613d
-0,         30,         30,        1,    38016, 0x63255932
-0,         31,         31,        1,    38016, 0x2f0569e4
-0,         32,         32,        1,    38016, 0x1f525192
diff --git a/deps/libav/tests/ref/fate/h264-conformance-nlmq1_jvc_c b/deps/libav/tests/ref/fate/h264-conformance-nlmq1_jvc_c
deleted file mode 100644
index 3030125..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-nlmq1_jvc_c
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xde1a2194
-0,          1,          1,        1,    38016, 0x2957f3e5
-0,          2,          2,        1,    38016, 0x9df4c6cf
-0,          3,          3,        1,    38016, 0xf3db9f2d
-0,          4,          4,        1,    38016, 0xd97474db
-0,          5,          5,        1,    38016, 0x8e3065fa
-0,          6,          6,        1,    38016, 0xc0be49b1
-0,          7,          7,        1,    38016, 0xa69c3f06
-0,          8,          8,        1,    38016, 0x96bb2e92
-0,          9,          9,        1,    38016, 0x1ca232c1
-0,         10,         10,        1,    38016, 0x3a06409d
-0,         11,         11,        1,    38016, 0xcdce66e5
-0,         12,         12,        1,    38016, 0x96387681
-0,         13,         13,        1,    38016, 0xd0309561
-0,         14,         14,        1,    38016, 0xb7b08c49
-0,         15,         15,        1,    38016, 0xf5709355
-0,         16,         16,        1,    38016, 0x3c1594ea
-0,         17,         17,        1,    38016, 0x9be48a2c
-0,         18,         18,        1,    38016, 0xdf7279c3
-0,         19,         19,        1,    38016, 0xe3b660f3
-0,         20,         20,        1,    38016, 0xd72a3cbe
-0,         21,         21,        1,    38016, 0x06a117d1
-0,         22,         22,        1,    38016, 0x8f5501b7
-0,         23,         23,        1,    38016, 0x8f5afd81
-0,         24,         24,        1,    38016, 0x98ecfd2b
-0,         25,         25,        1,    38016, 0xd0b103bf
-0,         26,         26,        1,    38016, 0xb9a7035c
-0,         27,         27,        1,    38016, 0x866c12c7
-0,         28,         28,        1,    38016, 0x3a0329f3
-0,         29,         29,        1,    38016, 0x725141c1
diff --git a/deps/libav/tests/ref/fate/h264-conformance-nlmq2_jvc_c b/deps/libav/tests/ref/fate/h264-conformance-nlmq2_jvc_c
deleted file mode 100644
index 5258eb2..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-nlmq2_jvc_c
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xde1a2194
-0,          1,          1,        1,    38016, 0x8b6cf842
-0,          2,          2,        1,    38016, 0x6dc7c88b
-0,          3,          3,        1,    38016, 0xdaefa55d
-0,          4,          4,        1,    38016, 0x61b77631
-0,          5,          5,        1,    38016, 0xfd096789
-0,          6,          6,        1,    38016, 0x69204c43
-0,          7,          7,        1,    38016, 0x2c8e40c0
-0,          8,          8,        1,    38016, 0xa4f33298
-0,          9,          9,        1,    38016, 0x67193923
-0,         10,         10,        1,    38016, 0x0b634893
-0,         11,         11,        1,    38016, 0x7ced69e1
-0,         12,         12,        1,    38016, 0xc20179dc
-0,         13,         13,        1,    38016, 0x9d4d94b9
-0,         14,         14,        1,    38016, 0xf4158e1a
-0,         15,         15,        1,    38016, 0xf24b986a
-0,         16,         16,        1,    38016, 0x3fd39baf
-0,         17,         17,        1,    38016, 0xc0f991b9
-0,         18,         18,        1,    38016, 0xe3a98216
-0,         19,         19,        1,    38016, 0x37246882
-0,         20,         20,        1,    38016, 0xad5745b0
-0,         21,         21,        1,    38016, 0x42831ea7
-0,         22,         22,        1,    38016, 0x14530a1b
-0,         23,         23,        1,    38016, 0x1a9f03a8
-0,         24,         24,        1,    38016, 0x34f905f3
-0,         25,         25,        1,    38016, 0x94300e93
-0,         26,         26,        1,    38016, 0xcda00be5
-0,         27,         27,        1,    38016, 0x607516d6
-0,         28,         28,        1,    38016, 0xabb02c3b
-0,         29,         29,        1,    38016, 0xcf3746bf
diff --git a/deps/libav/tests/ref/fate/h264-conformance-nrf_mw_e b/deps/libav/tests/ref/fate/h264-conformance-nrf_mw_e
deleted file mode 100644
index ee5f719..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-nrf_mw_e
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x3ae838ee
-0,          1,          1,        1,    38016, 0x9ed7e141
-0,          2,          2,        1,    38016, 0x354e83ed
-0,          3,          3,        1,    38016, 0x96754ff4
-0,          4,          4,        1,    38016, 0x2a013a3c
-0,          5,          5,        1,    38016, 0x57ab4cf2
-0,          6,          6,        1,    38016, 0x55037493
-0,          7,          7,        1,    38016, 0x910b8920
-0,          8,          8,        1,    38016, 0x457785a1
-0,          9,          9,        1,    38016, 0x9d6864ad
-0,         10,         10,        1,    38016, 0xe80131ce
-0,         11,         11,        1,    38016, 0x4cd7f487
-0,         12,         12,        1,    38016, 0x030df59a
-0,         13,         13,        1,    38016, 0x6ea60426
-0,         14,         14,        1,    38016, 0x35311f71
-0,         15,         15,        1,    38016, 0x731450d8
-0,         16,         16,        1,    38016, 0x29368c47
-0,         17,         17,        1,    38016, 0x006292b0
-0,         18,         18,        1,    38016, 0x961493b1
-0,         19,         19,        1,    38016, 0xb2e99a07
-0,         20,         20,        1,    38016, 0xa52f98be
-0,         21,         21,        1,    38016, 0x8c0a8f70
-0,         22,         22,        1,    38016, 0xdc5b992c
-0,         23,         23,        1,    38016, 0xa4a49787
-0,         24,         24,        1,    38016, 0x7a959608
-0,         25,         25,        1,    38016, 0xc9619c0a
-0,         26,         26,        1,    38016, 0xb5519a7e
-0,         27,         27,        1,    38016, 0x05ea9d9b
-0,         28,         28,        1,    38016, 0xf73fac90
-0,         29,         29,        1,    38016, 0x0cd4b3d8
-0,         30,         30,        1,    38016, 0xb3119df6
-0,         31,         31,        1,    38016, 0xb8db5d78
-0,         32,         32,        1,    38016, 0xfb633ee0
-0,         33,         33,        1,    38016, 0xed1c8935
-0,         34,         34,        1,    38016, 0x421fedd1
-0,         35,         35,        1,    38016, 0xa4b84473
-0,         36,         36,        1,    38016, 0x25598f81
-0,         37,         37,        1,    38016, 0x92de1dd7
-0,         38,         38,        1,    38016, 0x776b68c5
-0,         39,         39,        1,    38016, 0x07b49a7a
-0,         40,         40,        1,    38016, 0x883ccd79
-0,         41,         41,        1,    38016, 0xb351e0fc
-0,         42,         42,        1,    38016, 0x5577d53b
-0,         43,         43,        1,    38016, 0xffd9ef7d
-0,         44,         44,        1,    38016, 0x38c1fc8b
-0,         45,         45,        1,    38016, 0xb9abf3e6
-0,         46,         46,        1,    38016, 0x2191b0d6
-0,         47,         47,        1,    38016, 0x313397a3
-0,         48,         48,        1,    38016, 0x96bca02a
-0,         49,         49,        1,    38016, 0xd39ac859
-0,         50,         50,        1,    38016, 0xfb31e18f
-0,         51,         51,        1,    38016, 0xe182b468
-0,         52,         52,        1,    38016, 0x8af7dfd6
-0,         53,         53,        1,    38016, 0x7c19fd4f
-0,         54,         54,        1,    38016, 0xa8373bae
-0,         55,         55,        1,    38016, 0x91055016
-0,         56,         56,        1,    38016, 0x432b5d52
-0,         57,         57,        1,    38016, 0x81301b3f
-0,         58,         58,        1,    38016, 0x0d6c2367
-0,         59,         59,        1,    38016, 0xf0023ac2
-0,         60,         60,        1,    38016, 0xb9f33791
-0,         61,         61,        1,    38016, 0xdab62201
-0,         62,         62,        1,    38016, 0xfab7cfdd
-0,         63,         63,        1,    38016, 0xfbb2a78f
-0,         64,         64,        1,    38016, 0xe317c687
-0,         65,         65,        1,    38016, 0xe4f5d939
-0,         66,         66,        1,    38016, 0x022dda5b
-0,         67,         67,        1,    38016, 0x8b5cdf2c
-0,         68,         68,        1,    38016, 0x3dfec699
-0,         69,         69,        1,    38016, 0x9484a75c
-0,         70,         70,        1,    38016, 0x763a911b
-0,         71,         71,        1,    38016, 0xb1fb7cc8
-0,         72,         72,        1,    38016, 0x56bf7f7b
-0,         73,         73,        1,    38016, 0x87567e3e
-0,         74,         74,        1,    38016, 0x1aa1209e
-0,         75,         75,        1,    38016, 0xe2b0da25
-0,         76,         76,        1,    38016, 0xd250c706
-0,         77,         77,        1,    38016, 0xbea1be9d
-0,         78,         78,        1,    38016, 0x02f0e6fb
-0,         79,         79,        1,    38016, 0xd18d382b
-0,         80,         80,        1,    38016, 0xd0fa57f3
-0,         81,         81,        1,    38016, 0x873b43e3
-0,         82,         82,        1,    38016, 0x75b33855
-0,         83,         83,        1,    38016, 0xcabbe932
-0,         84,         84,        1,    38016, 0xeded9c0f
-0,         85,         85,        1,    38016, 0x86b0b9ec
-0,         86,         86,        1,    38016, 0xb461e10d
-0,         87,         87,        1,    38016, 0x6702dbbe
-0,         88,         88,        1,    38016, 0xb3e47c8c
-0,         89,         89,        1,    38016, 0xd71333ee
-0,         90,         90,        1,    38016, 0x15c3f15d
-0,         91,         91,        1,    38016, 0xa7e6bb4e
-0,         92,         92,        1,    38016, 0x5d5bd15b
-0,         93,         93,        1,    38016, 0x2476f6b0
-0,         94,         94,        1,    38016, 0xbee21b05
-0,         95,         95,        1,    38016, 0x8172d7b9
-0,         96,         96,        1,    38016, 0x4893b4b2
-0,         97,         97,        1,    38016, 0xfda7ed23
-0,         98,         98,        1,    38016, 0xc1ff4cb4
-0,         99,         99,        1,    38016, 0x9fdc8cc4
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_field_1_b b/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_field_1_b
deleted file mode 100644
index 8512102..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_field_1_b
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xc93c7c47
-0,          1,          1,        1,   518400, 0xa3f2e502
-0,          2,          2,        1,   518400, 0xb98920a4
-0,          3,          3,        1,   518400, 0xad098ec1
-0,          4,          4,        1,   518400, 0x3009b7aa
-0,          5,          5,        1,   518400, 0xcf514018
-0,          6,          6,        1,   518400, 0xd869038d
-0,          7,          7,        1,   518400, 0x3ce5e188
-0,          8,          8,        1,   518400, 0x029b4c14
-0,          9,          9,        1,   518400, 0xd2224afc
-0,         10,         10,        1,   518400, 0xbbca027c
-0,         11,         11,        1,   518400, 0x1f3fa0ac
-0,         12,         12,        1,   518400, 0x823b0125
-0,         13,         13,        1,   518400, 0xaaa27cfb
-0,         14,         14,        1,   518400, 0x5e926a4a
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_field_2_b b/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_field_2_b
deleted file mode 100644
index 5808141..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_field_2_b
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xc93c7c47
-0,          1,          1,        1,   518400, 0xf0c4b44a
-0,          2,          2,        1,   518400, 0x3f5dc91c
-0,          3,          3,        1,   518400, 0x03dc8453
-0,          4,          4,        1,   518400, 0x5e5227af
-0,          5,          5,        1,   518400, 0x9e7136af
-0,          6,          6,        1,   518400, 0x963a2e3a
-0,          7,          7,        1,   518400, 0xa544be6c
-0,          8,          8,        1,   518400, 0xefa1f63a
-0,          9,          9,        1,   518400, 0x62155ff1
-0,         10,         10,        1,   518400, 0x253eb857
-0,         11,         11,        1,   518400, 0x73530327
-0,         12,         12,        1,   518400, 0x8920c9a3
-0,         13,         13,        1,   518400, 0x4bdd038c
-0,         14,         14,        1,   518400, 0xea6016dd
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_field_3_b b/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_field_3_b
deleted file mode 100644
index a572030..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_field_3_b
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xc93c7c47
-0,          1,          1,        1,   518400, 0x7112ac25
-0,          2,          2,        1,   518400, 0x28bc28d2
-0,          3,          3,        1,   518400, 0x6fc36875
-0,          4,          4,        1,   518400, 0x3de99be0
-0,          5,          5,        1,   518400, 0x97125499
-0,          6,          6,        1,   518400, 0xb96fca3a
-0,          7,          7,        1,   518400, 0x1ec56c0f
-0,          8,          8,        1,   518400, 0xc65901d0
-0,          9,          9,        1,   518400, 0x2baa1bfa
-0,         10,         10,        1,   518400, 0x244fc6b7
-0,         11,         11,        1,   518400, 0xc3536383
-0,         12,         12,        1,   518400, 0xbcf40d5a
-0,         13,         13,        1,   518400, 0x955f4734
-0,         14,         14,        1,   518400, 0xe1b0275e
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_paff_1r2 b/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_paff_1r2
deleted file mode 100644
index d1a347f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_paff_1r2
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xc93c7c47
-0,          1,          1,        1,   518400, 0xfb452a9c
-0,          2,          2,        1,   518400, 0x2f7a35bd
-0,          3,          3,        1,   518400, 0xe63e30b9
-0,          4,          4,        1,   518400, 0x39628205
-0,          5,          5,        1,   518400, 0x17fa1ea4
-0,          6,          6,        1,   518400, 0xd5ee83e2
-0,          7,          7,        1,   518400, 0x611ee98d
-0,          8,          8,        1,   518400, 0x07c1eeb8
-0,          9,          9,        1,   518400, 0x9dff3418
-0,         10,         10,        1,   518400, 0x87cd2f56
-0,         11,         11,        1,   518400, 0x88675628
-0,         12,         12,        1,   518400, 0x9bb8c9a0
-0,         13,         13,        1,   518400, 0xe6c1df00
-0,         14,         14,        1,   518400, 0xfcaab7a7
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_paff_2r b/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_paff_2r
deleted file mode 100644
index f2bf06f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sharp_mp_paff_2r
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xc93c7c47
-0,          1,          1,        1,   518400, 0xfb452a9c
-0,          2,          2,        1,   518400, 0x2f7a35bd
-0,          3,          3,        1,   518400, 0xe63e30b9
-0,          4,          4,        1,   518400, 0x39628205
-0,          5,          5,        1,   518400, 0x17fa1ea4
-0,          6,          6,        1,   518400, 0xd5ee83e2
-0,          7,          7,        1,   518400, 0x4fd6d5c9
-0,          8,          8,        1,   518400, 0x8703c999
-0,          9,          9,        1,   518400, 0x1a87e2d3
-0,         10,         10,        1,   518400, 0xa27fc4d0
-0,         11,         11,        1,   518400, 0x6effab5d
-0,         12,         12,        1,   518400, 0x51ea02c9
-0,         13,         13,        1,   518400, 0xbcf84c88
-0,         14,         14,        1,   518400, 0x1d41076b
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sl1_sva_b b/deps/libav/tests/ref/fate/h264-conformance-sl1_sva_b
deleted file mode 100644
index a2f16b4..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sl1_sva_b
+++ /dev/null
@@ -1,34 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x666c110c
-0,          1,          1,        1,    38016, 0xc87421f6
-0,          2,          2,        1,    38016, 0x1b74033d
-0,          3,          3,        1,    38016, 0x21fe21c7
-0,          4,          4,        1,    38016, 0x8f03321e
-0,          5,          5,        1,    38016, 0xdbd46290
-0,          6,          6,        1,    38016, 0x316a57d4
-0,          7,          7,        1,    38016, 0x0a688f29
-0,          8,          8,        1,    38016, 0x8bb890d5
-0,          9,          9,        1,    38016, 0x4210c0a4
-0,         10,         10,        1,    38016, 0x45f6b0e7
-0,         11,         11,        1,    38016, 0x5feed346
-0,         12,         12,        1,    38016, 0x22aea97e
-0,         13,         13,        1,    38016, 0x8d96a049
-0,         14,         14,        1,    38016, 0xe623654c
-0,         15,         15,        1,    38016, 0xccd17c75
-0,         16,         16,        1,    38016, 0x32ca7712
-0,         17,         17,        1,    38016, 0x2fe49df2
-0,         18,         18,        1,    38016, 0x6ee49068
-0,         19,         19,        1,    38016, 0x74a0ba36
-0,         20,         20,        1,    38016, 0x5079a13c
-0,         21,         21,        1,    38016, 0xfd20a991
-0,         22,         22,        1,    38016, 0xfc987386
-0,         23,         23,        1,    38016, 0xa1f66a0b
-0,         24,         24,        1,    38016, 0xd7112683
-0,         25,         25,        1,    38016, 0xb60b3784
-0,         26,         26,        1,    38016, 0x9e621ca3
-0,         27,         27,        1,    38016, 0xd9264308
-0,         28,         28,        1,    38016, 0x00db43fb
-0,         29,         29,        1,    38016, 0x665a5b34
-0,         30,         30,        1,    38016, 0x582050ce
-0,         31,         31,        1,    38016, 0x52b95de5
-0,         32,         32,        1,    38016, 0x95d8445e
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sva_ba1_b b/deps/libav/tests/ref/fate/h264-conformance-sva_ba1_b
deleted file mode 100644
index cc55ac9..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sva_ba1_b
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x359316a1
-0,          1,          1,        1,    38016, 0xd5fafa54
-0,          2,          2,        1,    38016, 0xea99e9be
-0,          3,          3,        1,    38016, 0xd680f3db
-0,          4,          4,        1,    38016, 0x8b771545
-0,          5,          5,        1,    38016, 0xff8c3073
-0,          6,          6,        1,    38016, 0x543d403a
-0,          7,          7,        1,    38016, 0xd2136010
-0,          8,          8,        1,    38016, 0x11d17cd3
-0,          9,          9,        1,    38016, 0xd8c69527
-0,         10,         10,        1,    38016, 0x070d9a08
-0,         11,         11,        1,    38016, 0xc8e3b21d
-0,         12,         12,        1,    38016, 0xe903b09e
-0,         13,         13,        1,    38016, 0x30ba9ece
-0,         14,         14,        1,    38016, 0xb32482a4
-0,         15,         15,        1,    38016, 0x56cf8ea3
-0,         16,         16,        1,    38016, 0x0b41abd0
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sva_ba2_d b/deps/libav/tests/ref/fate/h264-conformance-sva_ba2_d
deleted file mode 100644
index b94086f..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sva_ba2_d
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x359316a1
-0,          1,          1,        1,    38016, 0xd7bb1285
-0,          2,          2,        1,    38016, 0x3c36059f
-0,          3,          3,        1,    38016, 0x983d195f
-0,          4,          4,        1,    38016, 0xba323cc5
-0,          5,          5,        1,    38016, 0xc9db4f32
-0,          6,          6,        1,    38016, 0xc2a06817
-0,          7,          7,        1,    38016, 0x18018392
-0,          8,          8,        1,    38016, 0x8b4da14c
-0,          9,          9,        1,    38016, 0x5a33b0f5
-0,         10,         10,        1,    38016, 0x5b48b808
-0,         11,         11,        1,    38016, 0xfc13c523
-0,         12,         12,        1,    38016, 0xb915c169
-0,         13,         13,        1,    38016, 0xfaab94ed
-0,         14,         14,        1,    38016, 0xe455786f
-0,         15,         15,        1,    38016, 0x529182a8
-0,         16,         16,        1,    38016, 0xfb6893a9
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sva_base_b b/deps/libav/tests/ref/fate/h264-conformance-sva_base_b
deleted file mode 100644
index 30663ff..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sva_base_b
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x1c131302
-0,          1,          1,        1,    38016, 0xbbca0c4f
-0,          2,          2,        1,    38016, 0x81f5fd7b
-0,          3,          3,        1,    38016, 0xc8990c96
-0,          4,          4,        1,    38016, 0xd4c337ce
-0,          5,          5,        1,    38016, 0xc4544ee1
-0,          6,          6,        1,    38016, 0x5de26832
-0,          7,          7,        1,    38016, 0xc1fc7ba9
-0,          8,          8,        1,    38016, 0x5fea9c67
-0,          9,          9,        1,    38016, 0xfa0aaf63
-0,         10,         10,        1,    38016, 0xa7f6c07d
-0,         11,         11,        1,    38016, 0x11a0c6ff
-0,         12,         12,        1,    38016, 0xfdefc3a0
-0,         13,         13,        1,    38016, 0xdb729a49
-0,         14,         14,        1,    38016, 0x9b5e7f0b
-0,         15,         15,        1,    38016, 0x6a047ea9
-0,         16,         16,        1,    38016, 0xd8c29302
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sva_cl1_e b/deps/libav/tests/ref/fate/h264-conformance-sva_cl1_e
deleted file mode 100644
index 27cba6d..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sva_cl1_e
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x6811161f
-0,          1,          1,        1,    38016, 0x243a0d4e
-0,          2,          2,        1,    38016, 0x0bc700de
-0,          3,          3,        1,    38016, 0x30db1659
-0,          4,          4,        1,    38016, 0xf88d3f1a
-0,          5,          5,        1,    38016, 0xb37d5bd2
-0,          6,          6,        1,    38016, 0x93f46c04
-0,          7,          7,        1,    38016, 0xdb9878d0
-0,          8,          8,        1,    38016, 0x92509f3a
-0,          9,          9,        1,    38016, 0xd63badea
-0,         10,         10,        1,    38016, 0xb942b664
-0,         11,         11,        1,    38016, 0x703bc4ee
-0,         12,         12,        1,    38016, 0xa78abfcd
-0,         13,         13,        1,    38016, 0x4e1b96d8
-0,         14,         14,        1,    38016, 0xaed371ac
-0,         15,         15,        1,    38016, 0x2c917f89
-0,         16,         16,        1,    38016, 0x57c29c96
-0,         17,         17,        1,    38016, 0xaf1fb16a
-0,         18,         18,        1,    38016, 0x257eb325
-0,         19,         19,        1,    38016, 0x7701b0f9
-0,         20,         20,        1,    38016, 0x7074c151
-0,         21,         21,        1,    38016, 0x9778b1fe
-0,         22,         22,        1,    38016, 0x9c2e8c0c
-0,         23,         23,        1,    38016, 0x394276e9
-0,         24,         24,        1,    38016, 0x2f5157bc
-0,         25,         25,        1,    38016, 0xfb313ee7
-0,         26,         26,        1,    38016, 0xbc6349c3
-0,         27,         27,        1,    38016, 0xdca95a0c
-0,         28,         28,        1,    38016, 0x53c46d45
-0,         29,         29,        1,    38016, 0x62867764
-0,         30,         30,        1,    38016, 0x87847fa3
-0,         31,         31,        1,    38016, 0x74527d90
-0,         32,         32,        1,    38016, 0x5c7a7779
-0,         33,         33,        1,    38016, 0xeafd7e73
-0,         34,         34,        1,    38016, 0x63aa7d06
-0,         35,         35,        1,    38016, 0x2bc06fd2
-0,         36,         36,        1,    38016, 0x058a7eae
-0,         37,         37,        1,    38016, 0xc51a6f85
-0,         38,         38,        1,    38016, 0xb49e6b0b
-0,         39,         39,        1,    38016, 0x881a5997
-0,         40,         40,        1,    38016, 0x5e4956b7
-0,         41,         41,        1,    38016, 0x835441a0
-0,         42,         42,        1,    38016, 0x212933cd
-0,         43,         43,        1,    38016, 0x914031bd
-0,         44,         44,        1,    38016, 0x29b63d29
-0,         45,         45,        1,    38016, 0x03a03b60
-0,         46,         46,        1,    38016, 0x282e1a0f
-0,         47,         47,        1,    38016, 0x8964f214
-0,         48,         48,        1,    38016, 0x23a9c5f9
-0,         49,         49,        1,    38016, 0x04f9a780
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sva_fm1_e b/deps/libav/tests/ref/fate/h264-conformance-sva_fm1_e
deleted file mode 100644
index 0e5f3e0..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sva_fm1_e
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0x1c131302
-0,          1,          1,        1,    38016, 0x89dd0c15
-0,          2,          2,        1,    38016, 0xaf7700bd
-0,          3,          3,        1,    38016, 0x220d1115
-0,          4,          4,        1,    38016, 0x76d0354e
-0,          5,          5,        1,    38016, 0x9e514b93
-0,          6,          6,        1,    38016, 0x20ff5e7c
-0,          7,          7,        1,    38016, 0xd9cb7e01
-0,          8,          8,        1,    38016, 0x26b7992d
-0,          9,          9,        1,    38016, 0xa29dac84
-0,         10,         10,        1,    38016, 0x407cb6e8
-0,         11,         11,        1,    38016, 0xe82cc064
-0,         12,         12,        1,    38016, 0x63ddb80f
-0,         13,         13,        1,    38016, 0xec6f93a1
-0,         14,         14,        1,    38016, 0x5f217759
-0,         15,         15,        1,    38016, 0x341982ba
-0,         16,         16,        1,    38016, 0x3f48980c
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sva_nl1_b b/deps/libav/tests/ref/fate/h264-conformance-sva_nl1_b
deleted file mode 100644
index f2033d8..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sva_nl1_b
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb9ac19bd
-0,          1,          1,        1,    38016, 0x3898fc35
-0,          2,          2,        1,    38016, 0xf6f4ed19
-0,          3,          3,        1,    38016, 0xc31af64b
-0,          4,          4,        1,    38016, 0x42161687
-0,          5,          5,        1,    38016, 0xe88133a3
-0,          6,          6,        1,    38016, 0xebb5415a
-0,          7,          7,        1,    38016, 0x643c62ac
-0,          8,          8,        1,    38016, 0x7ad68041
-0,          9,          9,        1,    38016, 0x2625981b
-0,         10,         10,        1,    38016, 0x1a839bbf
-0,         11,         11,        1,    38016, 0xe41db3a9
-0,         12,         12,        1,    38016, 0x894eb2dd
-0,         13,         13,        1,    38016, 0x4633a2a2
-0,         14,         14,        1,    38016, 0xeb848787
-0,         15,         15,        1,    38016, 0x23c590b0
-0,         16,         16,        1,    38016, 0xc7cbaf63
diff --git a/deps/libav/tests/ref/fate/h264-conformance-sva_nl2_e b/deps/libav/tests/ref/fate/h264-conformance-sva_nl2_e
deleted file mode 100644
index 1770eff..0000000
--- a/deps/libav/tests/ref/fate/h264-conformance-sva_nl2_e
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xb9ac19bd
-0,          1,          1,        1,    38016, 0x53c91566
-0,          2,          2,        1,    38016, 0xb5bd089f
-0,          3,          3,        1,    38016, 0xb81320bb
-0,          4,          4,        1,    38016, 0x7c793dce
-0,          5,          5,        1,    38016, 0x3d605b31
-0,          6,          6,        1,    38016, 0x40216830
-0,          7,          7,        1,    38016, 0x11c48f52
-0,          8,          8,        1,    38016, 0x0f37a013
-0,          9,          9,        1,    38016, 0xb06cb753
-0,         10,         10,        1,    38016, 0x6233ca83
-0,         11,         11,        1,    38016, 0x02b6d5a1
-0,         12,         12,        1,    38016, 0xf76cc409
-0,         13,         13,        1,    38016, 0xd19fa5c3
-0,         14,         14,        1,    38016, 0x8d1c8a02
-0,         15,         15,        1,    38016, 0x6802966d
-0,         16,         16,        1,    38016, 0x107fb055
diff --git a/deps/libav/tests/ref/fate/h264-crop-to-container b/deps/libav/tests/ref/fate/h264-crop-to-container
deleted file mode 100644
index 5dfa441..0000000
--- a/deps/libav/tests/ref/fate/h264-crop-to-container
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/30000
-0,          0,          0,        0,  3110400, 43a312e1eebc7dca1bd23456302a44e3
diff --git a/deps/libav/tests/ref/fate/h264-extreme-plane-pred b/deps/libav/tests/ref/fate/h264-extreme-plane-pred
deleted file mode 100644
index db85e99..0000000
--- a/deps/libav/tests/ref/fate/h264-extreme-plane-pred
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   152064, 1e857d2dfeea75297e090ffe9e37a249
-0,          1,          1,        1,   152064, 29d8336b4e9b77298025074dbad641d1
-0,          2,          2,        1,   152064, 3f1a87d2088a7708f4ed06890c8cd018
-0,          3,          3,        1,   152064, 56b8b8d9fefbd501c4f7918f21f9b015
-0,          4,          4,        1,   152064, 597392c162ea79af1e5d3dd552ffeb47
-0,          5,          5,        1,   152064, 064fdd170aa24463409b1cb0ddc7f5b6
-0,          6,          6,        1,   152064, 9924da4026b10110fa644039e73f92c1
-0,          7,          7,        1,   152064, afdb77f4a4c87faaf35988bf2d1d7c18
-0,          8,          8,        1,   152064, 80714dc3bf376f38c00f8c67fc534fae
-0,          9,          9,        1,   152064, fb0ab4028e1e9879b0bf0e414c0ccb33
-0,         10,         10,        1,   152064, 03c694f4b9e6116214078131f3edff91
-0,         11,         11,        1,   152064, 22d2de0d8f9e5477230b50c50ec46269
-0,         12,         12,        1,   152064, 470e9a6c5bbb15e151afbfd6b2f254a3
-0,         13,         13,        1,   152064, b585555552169640b1a896094335b624
-0,         14,         14,        1,   152064, e261e0f650e6d649a35773520e7f5bff
-0,         15,         15,        1,   152064, 2d1bf889eef057016e473a041fbceac0
-0,         16,         16,        1,   152064, b1a3f8ebf1de26bc8c32d47a4a53c862
-0,         17,         17,        1,   152064, d5cdb80386dbb996ca007a0e210a9905
-0,         18,         18,        1,   152064, 05a200df7b8baa19d2a0309476727dd7
-0,         19,         19,        1,   152064, 890d62163f4aa70a2055d50de0395a35
-0,         20,         20,        1,   152064, c00bdd1c5f0d69bae66ba46a897ad0ad
-0,         21,         21,        1,   152064, 65f76c6d453822eb48b180ac630cbdce
-0,         22,         22,        1,   152064, d6b85fc02c6d8efa53a9f0f148a0520e
-0,         23,         23,        1,   152064, adcb1621c5100b8e201592328bcd11be
-0,         24,         24,        1,   152064, bad7da936734cf4304c1564d6d3e74b9
-0,         25,         25,        1,   152064, a98d1232d0c22e6967415700d980c67f
-0,         26,         26,        1,   152064, 3fa1110c3ada7d37f0495a26774a58fb
-0,         27,         27,        1,   152064, 37613c65cfd3d77e8dda3b5b913e467f
-0,         28,         28,        1,   152064, 42a5cf583a82e722e04c04b10fd36542
-0,         29,         29,        1,   152064, 41c2870e102e3584780cd0243baa1900
-0,         30,         30,        1,   152064, da389397c874f5fd974c57278bd1e327
-0,         31,         31,        1,   152064, 238c265971ef9144d3fe6bc95a2ea060
-0,         32,         32,        1,   152064, 085c83a54aa9327e1e3ee76ffa337538
-0,         33,         33,        1,   152064, f462966f59018b39c10f9a65a80a41f8
-0,         34,         34,        1,   152064, 6e9697b7c8193b38551af4ef56861b7a
-0,         35,         35,        1,   152064, e68113abf3e81a28cafd95d91871886e
-0,         36,         36,        1,   152064, 35a78df5ac1ff6ee469626b750241c9b
-0,         37,         37,        1,   152064, b3302a87e334634a9f92ce51acf96ab3
-0,         38,         38,        1,   152064, 52198528552cefe90004a2b045b33e8f
-0,         39,         39,        1,   152064, 12d9ad991d4bb7935342c8b6474d1726
-0,         40,         40,        1,   152064, 2e6a508aba965f292c7b2e82bd0debbe
-0,         41,         41,        1,   152064, 8daff69112bb5fbc0158cbbf7fbe057e
-0,         42,         42,        1,   152064, 5495a0bb6c88a115957d98b272b0d643
-0,         43,         43,        1,   152064, 955db92ab0c482381200247a207e12bc
-0,         44,         44,        1,   152064, c0f81c5f95fd658c153798a514fedd22
-0,         45,         45,        1,   152064, 3cfc7b9c2d73621cdb04d7e7e8bc2b3b
-0,         46,         46,        1,   152064, e8b6d1d526d6443cba2e64ccd5393a4f
-0,         47,         47,        1,   152064, 7722e2420db0279c9eb7c6f7dfa89c07
-0,         48,         48,        1,   152064, 41b908a50b97a2e927f2e6e285e27592
-0,         49,         49,        1,   152064, e05f0ddd08debc2a0578893662c33ce0
-0,         50,         50,        1,   152064, 1edcedca921dbb68c0ce53371abddd8f
-0,         51,         51,        1,   152064, cdbf0c89feb336e58472f0163e43b02b
-0,         52,         52,        1,   152064, 39c4d20ecfeee09800feae5ad783e0bd
-0,         53,         53,        1,   152064, f60d05d20b3f338aa5917490d2b58f77
-0,         54,         54,        1,   152064, 76e5eae7a5205f6f6aaf8099197dbb1f
-0,         55,         55,        1,   152064, f7c4c80e79b691826915b7810ab7c2a6
-0,         56,         56,        1,   152064, afbc098dcaa8c2a3f41dfc3e846e8e7b
-0,         57,         57,        1,   152064, 6582805bbe4ab9a9138a23deb2ca45a8
-0,         58,         58,        1,   152064, 54444ce52dd1ce7bc24e9cbaba89dc59
-0,         59,         59,        1,   152064, c81193469c0cd5a50c451d869e07a786
-0,         60,         60,        1,   152064, 89f2295b63db3adce2961630569749a5
-0,         61,         61,        1,   152064, 3f4d6dd4dd819168a358384d6b134d00
-0,         62,         62,        1,   152064, 45d3b5c72609a15c1be5a45f790a24c4
-0,         63,         63,        1,   152064, f2283a8bf9599754d2e251c5f0861199
-0,         64,         64,        1,   152064, 06a9ccf8132c494884954bb4cc148c11
-0,         65,         65,        1,   152064, e20e0143fc840db46a88a8556d887ea2
-0,         66,         66,        1,   152064, bcb1ca471f70109293a15b7e1b0f3a7f
-0,         67,         67,        1,   152064, 0c5f59f091b3fd5ced9bb626e5b66ec8
-0,         68,         68,        1,   152064, 4dd6cf80daf74390afe0423f726c2fb6
-0,         69,         69,        1,   152064, fd52e6d570960cf100ac7c973dbd222e
-0,         70,         70,        1,   152064, 684758faa9b5517b2e5dbbabccc6125b
-0,         71,         71,        1,   152064, e538a3bcb2125c8ac324a5be49470960
-0,         72,         72,        1,   152064, 0c91795b7f52e942a1c28b4c6510c6fa
-0,         73,         73,        1,   152064, b33315c61d714bd70d2adce3309633fe
-0,         74,         74,        1,   152064, af2554b6b1d3f215641f85494a78ad3d
-0,         75,         75,        1,   152064, e59b20b3b2c5ec215ea34ab4850f940e
-0,         76,         76,        1,   152064, fb543e874bdd9749aaa710d1551e0ebd
-0,         77,         77,        1,   152064, 4383abaf938da0282fecabed153bca0e
-0,         78,         78,        1,   152064, 4ce40ffa75b42320593e40596c34862a
-0,         79,         79,        1,   152064, f337d0cc81b5c1b1b92c3f367ed5f9cd
-0,         80,         80,        1,   152064, 0f5a8c41fb7334811a485239d9126808
-0,         81,         81,        1,   152064, 0daf3d981474940bdf10a93148d69353
-0,         82,         82,        1,   152064, 21a51f1686071a6af7973df92361964b
-0,         83,         83,        1,   152064, 1f0d471c7b1fa86f236c2dee32822464
-0,         84,         84,        1,   152064, cedc6fd29d67976f899a6a8afba6b38d
-0,         85,         85,        1,   152064, 4af936d3d3b456953c7beb551476824a
-0,         86,         86,        1,   152064, bcaf539953adb1952fefc2cdec6c2f60
-0,         87,         87,        1,   152064, d1dfeafa0939fddc256986c2b00f73c7
-0,         88,         88,        1,   152064, 99c9a2c7b198e2c8cfe007ff4330f036
-0,         89,         89,        1,   152064, 4db6a7edfc44389536983aeeb15edb66
-0,         90,         90,        1,   152064, 8d840674b90e3b488a34e04645430ee7
-0,         91,         91,        1,   152064, ad7b3e55a2eb62fc5102cc5af49301aa
-0,         92,         92,        1,   152064, f24484a975ec64acb50df3e9f9e8eddd
-0,         93,         93,        1,   152064, 5794617c7e40bfcb7f024bda2f2a991d
-0,         94,         94,        1,   152064, ae1c22fcfa7f3b3b62dd2ace4e4b4dc7
-0,         95,         95,        1,   152064, ad9d13345ae5322a578e43653e9a9c16
-0,         96,         96,        1,   152064, be1b86ee130ea9255d9640117559818d
-0,         97,         97,        1,   152064, 81ed195d2831e62fc2cd4fa886de8e20
-0,         98,         98,        1,   152064, 8dde0af730b03ea8b3acd14d42daba04
-0,         99,         99,        1,   152064, c8ffbd5ba1af8b881daf511e4d8c26f3
diff --git a/deps/libav/tests/ref/fate/h264-interlace-crop b/deps/libav/tests/ref/fate/h264-interlace-crop
deleted file mode 100644
index 81b979c..0000000
--- a/deps/libav/tests/ref/fate/h264-interlace-crop
+++ /dev/null
@@ -1,4 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   345600, 0xa9cb7e5a
-0,          1,          1,        1,   345600, 0x73e47555
-0,          2,          2,        1,   345600, 0x87aac593
diff --git a/deps/libav/tests/ref/fate/h264-lossless b/deps/libav/tests/ref/fate/h264-lossless
deleted file mode 100644
index 11cc4d0..0000000
--- a/deps/libav/tests/ref/fate/h264-lossless
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   460800, 0x7731dd2f
-0,          1,          1,        1,   460800, 0x944b8c64
-0,          2,          2,        1,   460800, 0xbe833041
-0,          3,          3,        1,   460800, 0xbe95d96a
-0,          4,          4,        1,   460800, 0xfe7ea5e6
-0,          5,          5,        1,   460800, 0x381743c7
-0,          6,          6,        1,   460800, 0x63fcc2e9
-0,          7,          7,        1,   460800, 0x79574960
-0,          8,          8,        1,   460800, 0xdab9e18a
-0,          9,          9,        1,   460800, 0xd88e8fe8
diff --git a/deps/libav/tests/ref/fate/h264-reinit-large_420_8-to-small_420_8 b/deps/libav/tests/ref/fate/h264-reinit-large_420_8-to-small_420_8
deleted file mode 100644
index 8518855..0000000
--- a/deps/libav/tests/ref/fate/h264-reinit-large_420_8-to-small_420_8
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   608256, 0x65574c43
-0,          1,          1,        1,   608256, 0x5e5a1aa4
-0,          2,          2,        1,   608256, 0xa9a5cbc5
-0,          3,          3,        1,   608256, 0x4e462c02
-0,          4,          4,        1,   608256, 0xf8215f14
-0,          5,          5,        1,   608256, 0x4f332ccd
-0,          6,          6,        1,   608256, 0x5dac18a3
-0,          7,          7,        1,   608256, 0x81196f38
-0,          8,          8,        1,   608256, 0xd4cb4ffc
-0,          9,          9,        1,   608256, 0x839af1a4
-0,         10,         10,        1,   608256, 0x15ab7a99
-0,         11,         11,        1,   608256, 0x7496aec8
-0,         12,         12,        1,   608256, 0xfe974593
-0,         13,         13,        1,   608256, 0x702a94b7
-0,         14,         14,        1,   608256, 0x0f74cd7a
-0,         15,         15,        1,   608256, 0x3b35b667
-0,         16,         16,        1,   608256, 0x22083d70
-0,         17,         17,        1,   608256, 0xab77f6e1
-0,         18,         18,        1,   608256, 0x51513651
-0,         19,         19,        1,   608256, 0x06ff4ef1
-0,         20,         20,        1,   608256, 0xdf2ed7d3
-0,         21,         21,        1,   608256, 0x3107421b
-0,         22,         22,        1,   608256, 0x975823fe
-0,         23,         23,        1,   608256, 0xe40d9894
-0,         24,         24,        1,   608256, 0x8fb1fead
-0,         25,         25,        1,   608256, 0x56e5056b
-0,         26,         26,        1,   608256, 0x3346b970
-0,         27,         27,        1,   608256, 0x7e3c5b82
-0,         28,         28,        1,   608256, 0x6a86c482
-0,         29,         29,        1,   608256, 0x3e800e13
-0,         30,         30,        1,   608256, 0xd6c4589e
-0,         31,         31,        1,   608256, 0xcdfa7d94
-0,         32,         32,        1,   608256, 0xdc91cfce
-0,         33,         33,        1,   608256, 0x8aa5fd0e
-0,         34,         34,        1,   608256, 0x85c190be
-0,         35,         35,        1,   608256, 0xe7563061
-0,         36,         36,        1,   608256, 0x7fd501ec
-0,         37,         37,        1,   608256, 0x088d0df3
-0,         38,         38,        1,   608256, 0x08129a2f
-0,         39,         39,        1,   608256, 0x7bed8d9c
-0,         40,         40,        1,   608256, 0x16ce64c6
-0,         41,         41,        1,   608256, 0x6a120a3a
-0,         42,         42,        1,   608256, 0xfe0b889e
-0,         43,         43,        1,   608256, 0x57f4efcd
-0,         44,         44,        1,   608256, 0xc363ca91
-0,         45,         45,        1,   608256, 0x92237dce
-0,         46,         46,        1,   608256, 0x77bab64f
-0,         47,         47,        1,   608256, 0x29118201
-0,         48,         48,        1,   608256, 0x6f8e8e53
-0,         49,         49,        1,   608256, 0x4a13c4a3
-0,         50,         50,        1,   608256, 0x27a069a3
-0,         51,         51,        1,   608256, 0x22a5ff96
-0,         52,         52,        1,   608256, 0x29ad753f
-0,         53,         53,        1,   608256, 0x955788a6
-0,         54,         54,        1,   608256, 0xb73599c5
-0,         55,         55,        1,   608256, 0x73765aca
-0,         56,         56,        1,   608256, 0x39118f45
-0,         57,         57,        1,   608256, 0xfb0f8b96
-0,         58,         58,        1,   608256, 0xfcf71085
-0,         59,         59,        1,   608256, 0xccaaca7d
-0,         60,         60,        1,   608256, 0xde873299
-0,         61,         61,        1,   608256, 0x5d904202
-0,         62,         62,        1,   608256, 0x1e92c9b8
-0,         63,         63,        1,   608256, 0xdb8ec231
-0,         64,         64,        1,   608256, 0x388e2b9f
-0,         65,         65,        1,   608256, 0x1d190c39
-0,         66,         66,        1,   608256, 0xb6609efd
-0,         67,         67,        1,   608256, 0x0c6bf1d0
-0,         68,         68,        1,   608256, 0x178e0a3c
-0,         69,         69,        1,   608256, 0x439509f7
-0,         70,         70,        1,   608256, 0x00eb29ec
-0,         71,         71,        1,   608256, 0xee45f2a0
-0,         72,         72,        1,   608256, 0xae62eb8c
-0,         73,         73,        1,   608256, 0x3bb7510d
-0,         74,         74,        1,   608256, 0x03f08d02
-0,         75,         75,        1,   608256, 0x4beffc2a
-0,         76,         76,        1,   608256, 0x6071eb56
-0,         77,         77,        1,   608256, 0xbcb4e4e5
-0,         78,         78,        1,   608256, 0x775864aa
-0,         79,         79,        1,   608256, 0x3cfa0a94
-0,         80,         80,        1,   608256, 0x4652d529
-0,         81,         81,        1,   608256, 0xc5be07e2
-0,         82,         82,        1,   608256, 0xe7b480a2
-0,         83,         83,        1,   608256, 0x83b11945
-0,         84,         84,        1,   608256, 0x25ff0458
-0,         85,         85,        1,   608256, 0x5a780cda
-0,         86,         86,        1,   608256, 0x3448077c
-0,         87,         87,        1,   608256, 0x0f9c6f09
-0,         88,         88,        1,   608256, 0x05ece146
-0,         89,         89,        1,   608256, 0x3b02b504
-0,         90,         90,        1,   608256, 0xf3a8e2a6
-0,         91,         91,        1,   608256, 0xd4544847
-0,         92,         92,        1,   608256, 0x49bd2a3f
-0,         93,         93,        1,   608256, 0x22a42082
-0,         94,         94,        1,   608256, 0x8d8d1923
-0,         95,         95,        1,   608256, 0x2ba6877f
-0,         96,         96,        1,   608256, 0x494d481b
-0,         97,         97,        1,   608256, 0x28c99c35
-0,         98,         98,        1,   608256, 0x80128077
-0,         99,         99,        1,   608256, 0x887c2fb0
diff --git a/deps/libav/tests/ref/fate/h264-reinit-small_420_8-to-large_444_10 b/deps/libav/tests/ref/fate/h264-reinit-small_420_8-to-large_444_10
deleted file mode 100644
index 7e7631a..0000000
--- a/deps/libav/tests/ref/fate/h264-reinit-small_420_8-to-large_444_10
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   608256, 0x27a069a3
-0,          1,          1,        1,   608256, 0x22a5ff96
-0,          2,          2,        1,   608256, 0x29ad753f
-0,          3,          3,        1,   608256, 0x955788a6
-0,          4,          4,        1,   608256, 0xb73599c5
-0,          5,          5,        1,   608256, 0x73765aca
-0,          6,          6,        1,   608256, 0x39118f45
-0,          7,          7,        1,   608256, 0xfb0f8b96
-0,          8,          8,        1,   608256, 0xfcf71085
-0,          9,          9,        1,   608256, 0xccaaca7d
-0,         10,         10,        1,   608256, 0xde873299
-0,         11,         11,        1,   608256, 0x5d904202
-0,         12,         12,        1,   608256, 0x1e92c9b8
-0,         13,         13,        1,   608256, 0xdb8ec231
-0,         14,         14,        1,   608256, 0x388e2b9f
-0,         15,         15,        1,   608256, 0x1d190c39
-0,         16,         16,        1,   608256, 0xb6609efd
-0,         17,         17,        1,   608256, 0x0c6bf1d0
-0,         18,         18,        1,   608256, 0x178e0a3c
-0,         19,         19,        1,   608256, 0x439509f7
-0,         20,         20,        1,   608256, 0x00eb29ec
-0,         21,         21,        1,   608256, 0xee45f2a0
-0,         22,         22,        1,   608256, 0xae62eb8c
-0,         23,         23,        1,   608256, 0x3bb7510d
-0,         24,         24,        1,   608256, 0x03f08d02
-0,         25,         25,        1,   608256, 0x4beffc2a
-0,         26,         26,        1,   608256, 0x6071eb56
-0,         27,         27,        1,   608256, 0xbcb4e4e5
-0,         28,         28,        1,   608256, 0x775864aa
-0,         29,         29,        1,   608256, 0x3cfa0a94
-0,         30,         30,        1,   608256, 0x4652d529
-0,         31,         31,        1,   608256, 0xc5be07e2
-0,         32,         32,        1,   608256, 0xe7b480a2
-0,         33,         33,        1,   608256, 0x83b11945
-0,         34,         34,        1,   608256, 0x25ff0458
-0,         35,         35,        1,   608256, 0x5a780cda
-0,         36,         36,        1,   608256, 0x3448077c
-0,         37,         37,        1,   608256, 0x0f9c6f09
-0,         38,         38,        1,   608256, 0x05ece146
-0,         39,         39,        1,   608256, 0x3b02b504
-0,         40,         40,        1,   608256, 0xf3a8e2a6
-0,         41,         41,        1,   608256, 0xd4544847
-0,         42,         42,        1,   608256, 0x49bd2a3f
-0,         43,         43,        1,   608256, 0x22a42082
-0,         44,         44,        1,   608256, 0x8d8d1923
-0,         45,         45,        1,   608256, 0x2ba6877f
-0,         46,         46,        1,   608256, 0x494d481b
-0,         47,         47,        1,   608256, 0x28c99c35
-0,         48,         48,        1,   608256, 0x80128077
-0,         49,         49,        1,   608256, 0x887c2fb0
-0,         50,         50,        1,   608256, 0xfaba3fe4
-0,         51,         51,        1,   608256, 0x0369a227
-0,         52,         52,        1,   608256, 0xe62cb2b1
-0,         53,         53,        1,   608256, 0x851d9e78
-0,         54,         54,        1,   608256, 0x6847b938
-0,         55,         55,        1,   608256, 0x48eb702e
-0,         56,         56,        1,   608256, 0x3eb52eec
-0,         57,         57,        1,   608256, 0xf880edf8
-0,         58,         58,        1,   608256, 0xf7ac1860
-0,         59,         59,        1,   608256, 0x3ead29f3
-0,         60,         60,        1,   608256, 0x6db1860a
-0,         61,         61,        1,   608256, 0x72ee9271
-0,         62,         62,        1,   608256, 0xa8b643e4
-0,         63,         63,        1,   608256, 0x22a95a3e
-0,         64,         64,        1,   608256, 0x4e8aa877
-0,         65,         65,        1,   608256, 0x9545cfcf
-0,         66,         66,        1,   608256, 0x42d820e0
-0,         67,         67,        1,   608256, 0xe701ea6f
-0,         68,         68,        1,   608256, 0x05f61a49
-0,         69,         69,        1,   608256, 0xc1de9f65
-0,         70,         70,        1,   608256, 0x2b121933
-0,         71,         71,        1,   608256, 0x4de4e185
-0,         72,         72,        1,   608256, 0x01c6fb05
-0,         73,         73,        1,   608256, 0x1fbf8603
-0,         74,         74,        1,   608256, 0x9d8f2fd4
-0,         75,         75,        1,   608256, 0xb7d6f14e
-0,         76,         76,        1,   608256, 0x503c33a9
-0,         77,         77,        1,   608256, 0x051e8b02
-0,         78,         78,        1,   608256, 0xeff7c286
-0,         79,         79,        1,   608256, 0xeb80088a
-0,         80,         80,        1,   608256, 0xffbc6cec
-0,         81,         81,        1,   608256, 0x42d55e9d
-0,         82,         82,        1,   608256, 0x4898c507
-0,         83,         83,        1,   608256, 0x2c2411b5
-0,         84,         84,        1,   608256, 0xd70a34a4
-0,         85,         85,        1,   608256, 0xce5e64f5
-0,         86,         86,        1,   608256, 0x7790d293
-0,         87,         87,        1,   608256, 0xac5b44fb
-0,         88,         88,        1,   608256, 0xae4c2921
-0,         89,         89,        1,   608256, 0x373a26bb
-0,         90,         90,        1,   608256, 0x3aa3fed4
-0,         91,         91,        1,   608256, 0x4f4b1496
-0,         92,         92,        1,   608256, 0x4760fe2b
-0,         93,         93,        1,   608256, 0x9e38af43
-0,         94,         94,        1,   608256, 0xd7c66f6e
-0,         95,         95,        1,   608256, 0xf6cb1649
-0,         96,         96,        1,   608256, 0xb0591bf1
-0,         97,         97,        1,   608256, 0xb507b282
-0,         98,         98,        1,   608256, 0xfb53c6e5
-0,         99,         99,        1,   608256, 0x5410f10f
diff --git a/deps/libav/tests/ref/fate/h264-reinit-small_420_9-to-small_420_8 b/deps/libav/tests/ref/fate/h264-reinit-small_420_9-to-small_420_8
deleted file mode 100644
index 662db29..0000000
--- a/deps/libav/tests/ref/fate/h264-reinit-small_420_9-to-small_420_8
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   608256, 0xee06377f
-0,          1,          1,        1,   608256, 0x9c22c5ee
-0,          2,          2,        1,   608256, 0x322abee2
-0,          3,          3,        1,   608256, 0x82745ed3
-0,          4,          4,        1,   608256, 0xe7b9248b
-0,          5,          5,        1,   608256, 0xc8c1ce0e
-0,          6,          6,        1,   608256, 0x8451eba9
-0,          7,          7,        1,   608256, 0xece9412d
-0,          8,          8,        1,   608256, 0xffbc2c24
-0,          9,          9,        1,   608256, 0xf58c117e
-0,         10,         10,        1,   608256, 0x7853f334
-0,         11,         11,        1,   608256, 0x1acd6465
-0,         12,         12,        1,   608256, 0xb668856c
-0,         13,         13,        1,   608256, 0x3f52c230
-0,         14,         14,        1,   608256, 0xd7e8b5b6
-0,         15,         15,        1,   608256, 0xf663681d
-0,         16,         16,        1,   608256, 0x07ef670c
-0,         17,         17,        1,   608256, 0x1d5084f4
-0,         18,         18,        1,   608256, 0x0ea3fe04
-0,         19,         19,        1,   608256, 0xf095d1e0
-0,         20,         20,        1,   608256, 0xbdac37fb
-0,         21,         21,        1,   608256, 0x2cbfdf91
-0,         22,         22,        1,   608256, 0x8da7190f
-0,         23,         23,        1,   608256, 0x08bf6fc9
-0,         24,         24,        1,   608256, 0xa2368e5c
-0,         25,         25,        1,   608256, 0x36d38f81
-0,         26,         26,        1,   608256, 0x94d344cc
-0,         27,         27,        1,   608256, 0x1cf33f86
-0,         28,         28,        1,   608256, 0x98d6341f
-0,         29,         29,        1,   608256, 0xb04e3a3a
-0,         30,         30,        1,   608256, 0x74e52483
-0,         31,         31,        1,   608256, 0x6acc8d96
-0,         32,         32,        1,   608256, 0x136d6c4e
-0,         33,         33,        1,   608256, 0x50efa37a
-0,         34,         34,        1,   608256, 0x53170421
-0,         35,         35,        1,   608256, 0x2ed5210e
-0,         36,         36,        1,   608256, 0x5f471854
-0,         37,         37,        1,   608256, 0xd6ff7856
-0,         38,         38,        1,   608256, 0x446bf456
-0,         39,         39,        1,   608256, 0x872b95b1
-0,         40,         40,        1,   608256, 0xc9e5e827
-0,         41,         41,        1,   608256, 0xdab3eb04
-0,         42,         42,        1,   608256, 0xccd6347e
-0,         43,         43,        1,   608256, 0xd7dfd0a9
-0,         44,         44,        1,   608256, 0x60b834c3
-0,         45,         45,        1,   608256, 0x0b822676
-0,         46,         46,        1,   608256, 0x0e5d3d5a
-0,         47,         47,        1,   608256, 0x1fa0233d
-0,         48,         48,        1,   608256, 0xb853b650
-0,         49,         49,        1,   608256, 0x30d8d033
-0,         50,         50,        1,   608256, 0x27a069a3
-0,         51,         51,        1,   608256, 0x22a5ff96
-0,         52,         52,        1,   608256, 0x29ad753f
-0,         53,         53,        1,   608256, 0x955788a6
-0,         54,         54,        1,   608256, 0xb73599c5
-0,         55,         55,        1,   608256, 0x73765aca
-0,         56,         56,        1,   608256, 0x39118f45
-0,         57,         57,        1,   608256, 0xfb0f8b96
-0,         58,         58,        1,   608256, 0xfcf71085
-0,         59,         59,        1,   608256, 0xccaaca7d
-0,         60,         60,        1,   608256, 0xde873299
-0,         61,         61,        1,   608256, 0x5d904202
-0,         62,         62,        1,   608256, 0x1e92c9b8
-0,         63,         63,        1,   608256, 0xdb8ec231
-0,         64,         64,        1,   608256, 0x388e2b9f
-0,         65,         65,        1,   608256, 0x1d190c39
-0,         66,         66,        1,   608256, 0xb6609efd
-0,         67,         67,        1,   608256, 0x0c6bf1d0
-0,         68,         68,        1,   608256, 0x178e0a3c
-0,         69,         69,        1,   608256, 0x439509f7
-0,         70,         70,        1,   608256, 0x00eb29ec
-0,         71,         71,        1,   608256, 0xee45f2a0
-0,         72,         72,        1,   608256, 0xae62eb8c
-0,         73,         73,        1,   608256, 0x3bb7510d
-0,         74,         74,        1,   608256, 0x03f08d02
-0,         75,         75,        1,   608256, 0x4beffc2a
-0,         76,         76,        1,   608256, 0x6071eb56
-0,         77,         77,        1,   608256, 0xbcb4e4e5
-0,         78,         78,        1,   608256, 0x775864aa
-0,         79,         79,        1,   608256, 0x3cfa0a94
-0,         80,         80,        1,   608256, 0x4652d529
-0,         81,         81,        1,   608256, 0xc5be07e2
-0,         82,         82,        1,   608256, 0xe7b480a2
-0,         83,         83,        1,   608256, 0x83b11945
-0,         84,         84,        1,   608256, 0x25ff0458
-0,         85,         85,        1,   608256, 0x5a780cda
-0,         86,         86,        1,   608256, 0x3448077c
-0,         87,         87,        1,   608256, 0x0f9c6f09
-0,         88,         88,        1,   608256, 0x05ece146
-0,         89,         89,        1,   608256, 0x3b02b504
-0,         90,         90,        1,   608256, 0xf3a8e2a6
-0,         91,         91,        1,   608256, 0xd4544847
-0,         92,         92,        1,   608256, 0x49bd2a3f
-0,         93,         93,        1,   608256, 0x22a42082
-0,         94,         94,        1,   608256, 0x8d8d1923
-0,         95,         95,        1,   608256, 0x2ba6877f
-0,         96,         96,        1,   608256, 0x494d481b
-0,         97,         97,        1,   608256, 0x28c99c35
-0,         98,         98,        1,   608256, 0x80128077
-0,         99,         99,        1,   608256, 0x887c2fb0
diff --git a/deps/libav/tests/ref/fate/h264-reinit-small_422_9-to-small_420_9 b/deps/libav/tests/ref/fate/h264-reinit-small_422_9-to-small_420_9
deleted file mode 100644
index b5a9505..0000000
--- a/deps/libav/tests/ref/fate/h264-reinit-small_422_9-to-small_420_9
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   608256, 0x3aef31f3
-0,          1,          1,        1,   608256, 0x05afe4e8
-0,          2,          2,        1,   608256, 0x9d7dc9b1
-0,          3,          3,        1,   608256, 0x60b3efec
-0,          4,          4,        1,   608256, 0x7dc51741
-0,          5,          5,        1,   608256, 0xb3bfb413
-0,          6,          6,        1,   608256, 0x0a2738b3
-0,          7,          7,        1,   608256, 0xfd3f8f1b
-0,          8,          8,        1,   608256, 0x922d413f
-0,          9,          9,        1,   608256, 0x775b4cfb
-0,         10,         10,        1,   608256, 0xcbfaec82
-0,         11,         11,        1,   608256, 0x1f1903a2
-0,         12,         12,        1,   608256, 0xdd246528
-0,         13,         13,        1,   608256, 0xe3d8afdc
-0,         14,         14,        1,   608256, 0xb29c4235
-0,         15,         15,        1,   608256, 0xa230e654
-0,         16,         16,        1,   608256, 0xe0246276
-0,         17,         17,        1,   608256, 0xd47b6b3c
-0,         18,         18,        1,   608256, 0xa5593d23
-0,         19,         19,        1,   608256, 0x01cd5642
-0,         20,         20,        1,   608256, 0x0c451611
-0,         21,         21,        1,   608256, 0xc4833ff5
-0,         22,         22,        1,   608256, 0xbed881fc
-0,         23,         23,        1,   608256, 0x709e77e6
-0,         24,         24,        1,   608256, 0x9815dad3
-0,         25,         25,        1,   608256, 0x55c1fe5f
-0,         26,         26,        1,   608256, 0xd89ff770
-0,         27,         27,        1,   608256, 0xc636abf7
-0,         28,         28,        1,   608256, 0x17d3f5b1
-0,         29,         29,        1,   608256, 0x0389cd38
-0,         30,         30,        1,   608256, 0x502eea66
-0,         31,         31,        1,   608256, 0xcb697a48
-0,         32,         32,        1,   608256, 0xd4f6c694
-0,         33,         33,        1,   608256, 0x734a5163
-0,         34,         34,        1,   608256, 0xa53f5187
-0,         35,         35,        1,   608256, 0x64d2c1c7
-0,         36,         36,        1,   608256, 0x41a170d0
-0,         37,         37,        1,   608256, 0x6f671fe1
-0,         38,         38,        1,   608256, 0x56983008
-0,         39,         39,        1,   608256, 0x95911957
-0,         40,         40,        1,   608256, 0x027f2a7a
-0,         41,         41,        1,   608256, 0xcd22d70f
-0,         42,         42,        1,   608256, 0x268beec0
-0,         43,         43,        1,   608256, 0xcf14123e
-0,         44,         44,        1,   608256, 0xfc8e3bff
-0,         45,         45,        1,   608256, 0x6974ad54
-0,         46,         46,        1,   608256, 0x8fbd9cdd
-0,         47,         47,        1,   608256, 0x66110ef8
-0,         48,         48,        1,   608256, 0x84b4b1f1
-0,         49,         49,        1,   608256, 0xf0d4949b
-0,         50,         50,        1,   608256, 0xee06377f
-0,         51,         51,        1,   608256, 0x9c22c5ee
-0,         52,         52,        1,   608256, 0x322abee2
-0,         53,         53,        1,   608256, 0x82745ed3
-0,         54,         54,        1,   608256, 0xe7b9248b
-0,         55,         55,        1,   608256, 0xc8c1ce0e
-0,         56,         56,        1,   608256, 0x8451eba9
-0,         57,         57,        1,   608256, 0xece9412d
-0,         58,         58,        1,   608256, 0xffbc2c24
-0,         59,         59,        1,   608256, 0xf58c117e
-0,         60,         60,        1,   608256, 0x7853f334
-0,         61,         61,        1,   608256, 0x1acd6465
-0,         62,         62,        1,   608256, 0xb668856c
-0,         63,         63,        1,   608256, 0x3f52c230
-0,         64,         64,        1,   608256, 0xd7e8b5b6
-0,         65,         65,        1,   608256, 0xf663681d
-0,         66,         66,        1,   608256, 0x07ef670c
-0,         67,         67,        1,   608256, 0x1d5084f4
-0,         68,         68,        1,   608256, 0x0ea3fe04
-0,         69,         69,        1,   608256, 0xf095d1e0
-0,         70,         70,        1,   608256, 0xbdac37fb
-0,         71,         71,        1,   608256, 0x2cbfdf91
-0,         72,         72,        1,   608256, 0x8da7190f
-0,         73,         73,        1,   608256, 0x08bf6fc9
-0,         74,         74,        1,   608256, 0xa2368e5c
-0,         75,         75,        1,   608256, 0x36d38f81
-0,         76,         76,        1,   608256, 0x94d344cc
-0,         77,         77,        1,   608256, 0x1cf33f86
-0,         78,         78,        1,   608256, 0x98d6341f
-0,         79,         79,        1,   608256, 0xb04e3a3a
-0,         80,         80,        1,   608256, 0x74e52483
-0,         81,         81,        1,   608256, 0x6acc8d96
-0,         82,         82,        1,   608256, 0x136d6c4e
-0,         83,         83,        1,   608256, 0x50efa37a
-0,         84,         84,        1,   608256, 0x53170421
-0,         85,         85,        1,   608256, 0x2ed5210e
-0,         86,         86,        1,   608256, 0x5f471854
-0,         87,         87,        1,   608256, 0xd6ff7856
-0,         88,         88,        1,   608256, 0x446bf456
-0,         89,         89,        1,   608256, 0x872b95b1
-0,         90,         90,        1,   608256, 0xc9e5e827
-0,         91,         91,        1,   608256, 0xdab3eb04
-0,         92,         92,        1,   608256, 0xccd6347e
-0,         93,         93,        1,   608256, 0xd7dfd0a9
-0,         94,         94,        1,   608256, 0x60b834c3
-0,         95,         95,        1,   608256, 0x0b822676
-0,         96,         96,        1,   608256, 0x0e5d3d5a
-0,         97,         97,        1,   608256, 0x1fa0233d
-0,         98,         98,        1,   608256, 0xb853b650
-0,         99,         99,        1,   608256, 0x30d8d033
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-AMP_A_Samsung_4 b/deps/libav/tests/ref/fate/hevc-conformance-AMP_A_Samsung_4
deleted file mode 100644
index 84487a5..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-AMP_A_Samsung_4
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  6144000, 0xf7da9a00
-0,          1,          1,        1,  6144000, 0xf5cfc76f
-0,          2,          2,        1,  6144000, 0x20663e82
-0,          3,          3,        1,  6144000, 0xbff3d1e7
-0,          4,          4,        1,  6144000, 0x6f1b824d
-0,          5,          5,        1,  6144000, 0x4d75e5c9
-0,          6,          6,        1,  6144000, 0xb4443853
-0,          7,          7,        1,  6144000, 0x6943bbcb
-0,          8,          8,        1,  6144000, 0x1748b8d3
-0,          9,          9,        1,  6144000, 0x0e15caec
-0,         10,         10,        1,  6144000, 0xf7553ff4
-0,         11,         11,        1,  6144000, 0x34007146
-0,         12,         12,        1,  6144000, 0xd115a7ad
-0,         13,         13,        1,  6144000, 0x1adc8d27
-0,         14,         14,        1,  6144000, 0x2c3a43a6
-0,         15,         15,        1,  6144000, 0x1820500a
-0,         16,         16,        1,  6144000, 0xb33cf5af
-0,         17,         17,        1,  6144000, 0x5ba58d5a
-0,         18,         18,        1,  6144000, 0x453f35bc
-0,         19,         19,        1,  6144000, 0x4e6ac2ab
-0,         20,         20,        1,  6144000, 0xfab2b132
-0,         21,         21,        1,  6144000, 0xf903b7bf
-0,         22,         22,        1,  6144000, 0x160ebf13
-0,         23,         23,        1,  6144000, 0xd147c884
-0,         24,         24,        1,  6144000, 0x266abc04
-0,         25,         25,        1,  6144000, 0x9fabf642
-0,         26,         26,        1,  6144000, 0x1ad4f6c7
-0,         27,         27,        1,  6144000, 0x41fa1e6f
-0,         28,         28,        1,  6144000, 0x14b2b3b4
-0,         29,         29,        1,  6144000, 0x19c6d13e
-0,         30,         30,        1,  6144000, 0x414f5a36
-0,         31,         31,        1,  6144000, 0x439278aa
-0,         32,         32,        1,  6144000, 0xf8e73a55
-0,         33,         33,        1,  6144000, 0xf4cf7779
-0,         34,         34,        1,  6144000, 0x86ac3a16
-0,         35,         35,        1,  6144000, 0xdc9abdb8
-0,         36,         36,        1,  6144000, 0x9ab68a62
-0,         37,         37,        1,  6144000, 0xcd290547
-0,         38,         38,        1,  6144000, 0xd2eb88bb
-0,         39,         39,        1,  6144000, 0x126e084e
-0,         40,         40,        1,  6144000, 0x1aa5302c
-0,         41,         41,        1,  6144000, 0x689cb93e
-0,         42,         42,        1,  6144000, 0xaa9e3be6
-0,         43,         43,        1,  6144000, 0x33dc9ead
-0,         44,         44,        1,  6144000, 0xcb943dd3
-0,         45,         45,        1,  6144000, 0x22a67b19
-0,         46,         46,        1,  6144000, 0x3bfb741a
-0,         47,         47,        1,  6144000, 0x9238e595
-0,         48,         48,        1,  6144000, 0xf0fb6381
-0,         49,         49,        1,  6144000, 0x6ea42af1
-0,         50,         50,        1,  6144000, 0x47d9c3a7
-0,         51,         51,        1,  6144000, 0x9f73966b
-0,         52,         52,        1,  6144000, 0xdf777adc
-0,         53,         53,        1,  6144000, 0xf51f206e
-0,         54,         54,        1,  6144000, 0x465c350a
-0,         55,         55,        1,  6144000, 0x9253a45a
-0,         56,         56,        1,  6144000, 0x72c89751
-0,         57,         57,        1,  6144000, 0x0405cdfc
-0,         58,         58,        1,  6144000, 0xc5ede0c7
-0,         59,         59,        1,  6144000, 0xcf1c2b5e
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-AMP_B_Samsung_4 b/deps/libav/tests/ref/fate/hevc-conformance-AMP_B_Samsung_4
deleted file mode 100644
index 034f7b8..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-AMP_B_Samsung_4
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  6144000, 0xcd32ef33
-0,          1,          1,        1,  6144000, 0x58ce681d
-0,          2,          2,        1,  6144000, 0x77a732b6
-0,          3,          3,        1,  6144000, 0xa95418d0
-0,          4,          4,        1,  6144000, 0xa1593606
-0,          5,          5,        1,  6144000, 0x0d5429bc
-0,          6,          6,        1,  6144000, 0xe7cd205c
-0,          7,          7,        1,  6144000, 0x52c30ff4
-0,          8,          8,        1,  6144000, 0xf0a0f686
-0,          9,          9,        1,  6144000, 0xa6371d86
-0,         10,         10,        1,  6144000, 0x18bf1478
-0,         11,         11,        1,  6144000, 0xb84c6322
-0,         12,         12,        1,  6144000, 0x12f35f80
-0,         13,         13,        1,  6144000, 0xa9009e83
-0,         14,         14,        1,  6144000, 0x08568380
-0,         15,         15,        1,  6144000, 0xb01e98e8
-0,         16,         16,        1,  6144000, 0x0796ee90
-0,         17,         17,        1,  6144000, 0x3bb7cbef
-0,         18,         18,        1,  6144000, 0x7c3d6929
-0,         19,         19,        1,  6144000, 0x62c0e56c
-0,         20,         20,        1,  6144000, 0xd05907f7
-0,         21,         21,        1,  6144000, 0x9aa33b33
-0,         22,         22,        1,  6144000, 0xc47a0195
-0,         23,         23,        1,  6144000, 0xa5a5db13
-0,         24,         24,        1,  6144000, 0x54fda44b
-0,         25,         25,        1,  6144000, 0x7695be2f
-0,         26,         26,        1,  6144000, 0x247228e1
-0,         27,         27,        1,  6144000, 0xec38b2f7
-0,         28,         28,        1,  6144000, 0x223b098d
-0,         29,         29,        1,  6144000, 0xdd13f4bf
-0,         30,         30,        1,  6144000, 0x42651b46
-0,         31,         31,        1,  6144000, 0xc0b2ac9a
-0,         32,         32,        1,  6144000, 0x574908ee
-0,         33,         33,        1,  6144000, 0x070f0d88
-0,         34,         34,        1,  6144000, 0xc68ee679
-0,         35,         35,        1,  6144000, 0x4d571c82
-0,         36,         36,        1,  6144000, 0xec7f28cb
-0,         37,         37,        1,  6144000, 0x07ca3ccd
-0,         38,         38,        1,  6144000, 0xa5161fd7
-0,         39,         39,        1,  6144000, 0xb0908b25
-0,         40,         40,        1,  6144000, 0x4fa56c5e
-0,         41,         41,        1,  6144000, 0x1ad84207
-0,         42,         42,        1,  6144000, 0xc862a32b
-0,         43,         43,        1,  6144000, 0x341b9b0a
-0,         44,         44,        1,  6144000, 0xa940cdab
-0,         45,         45,        1,  6144000, 0x57521b2d
-0,         46,         46,        1,  6144000, 0x31969dee
-0,         47,         47,        1,  6144000, 0x7a09e240
-0,         48,         48,        1,  6144000, 0x14e6c360
-0,         49,         49,        1,  6144000, 0x0dfd6085
-0,         50,         50,        1,  6144000, 0xdf231a1e
-0,         51,         51,        1,  6144000, 0x6d1e9ce1
-0,         52,         52,        1,  6144000, 0xc6c2fb26
-0,         53,         53,        1,  6144000, 0xd4bc5e3e
-0,         54,         54,        1,  6144000, 0xa4a56b9e
-0,         55,         55,        1,  6144000, 0x8ba6349f
-0,         56,         56,        1,  6144000, 0x0683757f
-0,         57,         57,        1,  6144000, 0xe3840d8b
-0,         58,         58,        1,  6144000, 0x2fdf2ae6
-0,         59,         59,        1,  6144000, 0xea877e27
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-AMP_D_Hisilicon b/deps/libav/tests/ref/fate/hevc-conformance-AMP_D_Hisilicon
deleted file mode 100644
index 6e17b83..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-AMP_D_Hisilicon
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0x1559c293
-0,          1,          1,        1,  3110400, 0xd0802706
-0,          2,          2,        1,  3110400, 0xb48cf229
-0,          3,          3,        1,  3110400, 0x4108509b
-0,          4,          4,        1,  3110400, 0xd1cec277
-0,          5,          5,        1,  3110400, 0x3e68c589
-0,          6,          6,        1,  3110400, 0x1543a517
-0,          7,          7,        1,  3110400, 0x5ddcd669
-0,          8,          8,        1,  3110400, 0x09bd4c27
-0,          9,          9,        1,  3110400, 0xd583bfa1
-0,         10,         10,        1,  3110400, 0xe9411279
-0,         11,         11,        1,  3110400, 0xe07e6f3f
-0,         12,         12,        1,  3110400, 0xcfd23191
-0,         13,         13,        1,  3110400, 0x24276734
-0,         14,         14,        1,  3110400, 0x485aeafe
-0,         15,         15,        1,  3110400, 0xb8039a85
-0,         16,         16,        1,  3110400, 0x1d154e19
-0,         17,         17,        1,  3110400, 0xaa3ce800
-0,         18,         18,        1,  3110400, 0xe2601cba
-0,         19,         19,        1,  3110400, 0xb6657a57
-0,         20,         20,        1,  3110400, 0x34dbda52
-0,         21,         21,        1,  3110400, 0x921e218a
-0,         22,         22,        1,  3110400, 0x7de5262f
-0,         23,         23,        1,  3110400, 0x1a97e083
-0,         24,         24,        1,  3110400, 0x4bfc81d0
-0,         25,         25,        1,  3110400, 0x583396e6
-0,         26,         26,        1,  3110400, 0xc96bcd39
-0,         27,         27,        1,  3110400, 0x483cf7cf
-0,         28,         28,        1,  3110400, 0x20882e52
-0,         29,         29,        1,  3110400, 0x93d352fe
-0,         30,         30,        1,  3110400, 0x0c932722
-0,         31,         31,        1,  3110400, 0x78c5a9f0
-0,         32,         32,        1,  3110400, 0xcea3bddd
-0,         33,         33,        1,  3110400, 0x3e4e7c77
-0,         34,         34,        1,  3110400, 0xbe048a0a
-0,         35,         35,        1,  3110400, 0x1cf7ea0d
-0,         36,         36,        1,  3110400, 0xeb60343a
-0,         37,         37,        1,  3110400, 0x2158ed1f
-0,         38,         38,        1,  3110400, 0x3a7126b1
-0,         39,         39,        1,  3110400, 0x282804ff
-0,         40,         40,        1,  3110400, 0x292ed438
-0,         41,         41,        1,  3110400, 0x49a9769d
-0,         42,         42,        1,  3110400, 0xdfc12632
-0,         43,         43,        1,  3110400, 0xff3da16a
-0,         44,         44,        1,  3110400, 0x134b68c6
-0,         45,         45,        1,  3110400, 0x717e6f1d
-0,         46,         46,        1,  3110400, 0x283293f5
-0,         47,         47,        1,  3110400, 0x3d401456
-0,         48,         48,        1,  3110400, 0x500eddac
-0,         49,         49,        1,  3110400, 0x2a96fbff
-0,         50,         50,        1,  3110400, 0x9d75f303
-0,         51,         51,        1,  3110400, 0x08d1fa48
-0,         52,         52,        1,  3110400, 0xa685a8da
-0,         53,         53,        1,  3110400, 0xc19216d8
-0,         54,         54,        1,  3110400, 0x61ebd7f2
-0,         55,         55,        1,  3110400, 0x866c9002
-0,         56,         56,        1,  3110400, 0x3edda174
-0,         57,         57,        1,  3110400, 0x4e848db7
-0,         58,         58,        1,  3110400, 0x1dd822ba
-0,         59,         59,        1,  3110400, 0x8157b534
-0,         60,         60,        1,  3110400, 0x72637dbe
-0,         61,         61,        1,  3110400, 0xc6fc1305
-0,         62,         62,        1,  3110400, 0xbfadeee4
-0,         63,         63,        1,  3110400, 0xad20c230
-0,         64,         64,        1,  3110400, 0x5afff02b
-0,         65,         65,        1,  3110400, 0x5e533c71
-0,         66,         66,        1,  3110400, 0x52e10588
-0,         67,         67,        1,  3110400, 0x13a6dbb1
-0,         68,         68,        1,  3110400, 0xc74de5ae
-0,         69,         69,        1,  3110400, 0x382aafb8
-0,         70,         70,        1,  3110400, 0x5e0a11b2
-0,         71,         71,        1,  3110400, 0x049fe7cc
-0,         72,         72,        1,  3110400, 0x9d79484e
-0,         73,         73,        1,  3110400, 0x1116ced8
-0,         74,         74,        1,  3110400, 0x5d8d075d
-0,         75,         75,        1,  3110400, 0x49392496
-0,         76,         76,        1,  3110400, 0x5f24b3b3
-0,         77,         77,        1,  3110400, 0x6ca1c16d
-0,         78,         78,        1,  3110400, 0x131a16d2
-0,         79,         79,        1,  3110400, 0x39e2f9a1
-0,         80,         80,        1,  3110400, 0x988bd0ee
-0,         81,         81,        1,  3110400, 0xa6c050ec
-0,         82,         82,        1,  3110400, 0x5275142a
-0,         83,         83,        1,  3110400, 0x5705923d
-0,         84,         84,        1,  3110400, 0x3098d52d
-0,         85,         85,        1,  3110400, 0xb16e2eb7
-0,         86,         86,        1,  3110400, 0x0dee6bc8
-0,         87,         87,        1,  3110400, 0x577acf61
-0,         88,         88,        1,  3110400, 0x2b70d954
-0,         89,         89,        1,  3110400, 0x26b5f1c5
-0,         90,         90,        1,  3110400, 0x2351ad88
-0,         91,         91,        1,  3110400, 0xe5bdf6ad
-0,         92,         92,        1,  3110400, 0xaf0d83de
-0,         93,         93,        1,  3110400, 0xaee86799
-0,         94,         94,        1,  3110400, 0xe73fe067
-0,         95,         95,        1,  3110400, 0x46b90697
-0,         96,         96,        1,  3110400, 0xb270f77a
-0,         97,         97,        1,  3110400, 0xf33aa535
-0,         98,         98,        1,  3110400, 0xcafe6eec
-0,         99,         99,        1,  3110400, 0xcf051a31
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-AMP_E_Hisilicon b/deps/libav/tests/ref/fate/hevc-conformance-AMP_E_Hisilicon
deleted file mode 100644
index c1b7f2e..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-AMP_E_Hisilicon
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0xf9342188
-0,          1,          1,        1,  3110400, 0x46638dc4
-0,          2,          2,        1,  3110400, 0x96da436e
-0,          3,          3,        1,  3110400, 0xae9ee064
-0,          4,          4,        1,  3110400, 0x03fc9d17
-0,          5,          5,        1,  3110400, 0xd7ba9ab8
-0,          6,          6,        1,  3110400, 0x9f3cc881
-0,          7,          7,        1,  3110400, 0x911c9e2a
-0,          8,          8,        1,  3110400, 0x2c1bdec1
-0,          9,          9,        1,  3110400, 0xffc2cfb2
-0,         10,         10,        1,  3110400, 0x34136d4c
-0,         11,         11,        1,  3110400, 0x400dca0c
-0,         12,         12,        1,  3110400, 0x5a3d3c71
-0,         13,         13,        1,  3110400, 0x5bd262f9
-0,         14,         14,        1,  3110400, 0x27bbec47
-0,         15,         15,        1,  3110400, 0x53ca3f78
-0,         16,         16,        1,  3110400, 0x7fee4170
-0,         17,         17,        1,  3110400, 0x393d318c
-0,         18,         18,        1,  3110400, 0x203f26f1
-0,         19,         19,        1,  3110400, 0x35e00c3e
-0,         20,         20,        1,  3110400, 0x995afdde
-0,         21,         21,        1,  3110400, 0xa8b623b9
-0,         22,         22,        1,  3110400, 0x047e53bd
-0,         23,         23,        1,  3110400, 0xc7e69515
-0,         24,         24,        1,  3110400, 0x7e5ade49
-0,         25,         25,        1,  3110400, 0x863cddc9
-0,         26,         26,        1,  3110400, 0xb1f6189c
-0,         27,         27,        1,  3110400, 0x622d6d1d
-0,         28,         28,        1,  3110400, 0x1e82ef1a
-0,         29,         29,        1,  3110400, 0x06a7054a
-0,         30,         30,        1,  3110400, 0x736bd4a9
-0,         31,         31,        1,  3110400, 0x1db8ead3
-0,         32,         32,        1,  3110400, 0x1d872697
-0,         33,         33,        1,  3110400, 0x86b11604
-0,         34,         34,        1,  3110400, 0x54bee045
-0,         35,         35,        1,  3110400, 0x3577fa15
-0,         36,         36,        1,  3110400, 0x717b6c0b
-0,         37,         37,        1,  3110400, 0x5e0f0b6e
-0,         38,         38,        1,  3110400, 0x054ecc86
-0,         39,         39,        1,  3110400, 0x9ec29ad1
-0,         40,         40,        1,  3110400, 0x7c3b56e4
-0,         41,         41,        1,  3110400, 0xcf4cf721
-0,         42,         42,        1,  3110400, 0x43c01adb
-0,         43,         43,        1,  3110400, 0x6abb4879
-0,         44,         44,        1,  3110400, 0x90473c9f
-0,         45,         45,        1,  3110400, 0x5f5bb9a9
-0,         46,         46,        1,  3110400, 0x08678e6b
-0,         47,         47,        1,  3110400, 0xf4ad0c9b
-0,         48,         48,        1,  3110400, 0x22870cc8
-0,         49,         49,        1,  3110400, 0xb417cf63
-0,         50,         50,        1,  3110400, 0xb7a1588e
-0,         51,         51,        1,  3110400, 0x7a35ac81
-0,         52,         52,        1,  3110400, 0xcd1c6d82
-0,         53,         53,        1,  3110400, 0x181b9920
-0,         54,         54,        1,  3110400, 0xf2417d5e
-0,         55,         55,        1,  3110400, 0x8a67e02b
-0,         56,         56,        1,  3110400, 0xe7b99077
-0,         57,         57,        1,  3110400, 0x6814e5c2
-0,         58,         58,        1,  3110400, 0xd8bce44d
-0,         59,         59,        1,  3110400, 0x9faf4ebc
-0,         60,         60,        1,  3110400, 0x3daa5fbf
-0,         61,         61,        1,  3110400, 0x747921ba
-0,         62,         62,        1,  3110400, 0xbe30214e
-0,         63,         63,        1,  3110400, 0x8f5533fe
-0,         64,         64,        1,  3110400, 0x835a4545
-0,         65,         65,        1,  3110400, 0xfa99f4c8
-0,         66,         66,        1,  3110400, 0x9559c5db
-0,         67,         67,        1,  3110400, 0xd0d096f8
-0,         68,         68,        1,  3110400, 0x7b24dbb0
-0,         69,         69,        1,  3110400, 0x4a8aa189
-0,         70,         70,        1,  3110400, 0x876bab32
-0,         71,         71,        1,  3110400, 0xc930bec9
-0,         72,         72,        1,  3110400, 0x009841d8
-0,         73,         73,        1,  3110400, 0x93e5be89
-0,         74,         74,        1,  3110400, 0x82260331
-0,         75,         75,        1,  3110400, 0x7ef2e971
-0,         76,         76,        1,  3110400, 0x606b638a
-0,         77,         77,        1,  3110400, 0xf08b84df
-0,         78,         78,        1,  3110400, 0x8a609222
-0,         79,         79,        1,  3110400, 0xa76cb2f3
-0,         80,         80,        1,  3110400, 0x2b611cb3
-0,         81,         81,        1,  3110400, 0x81d5b315
-0,         82,         82,        1,  3110400, 0x6f385e43
-0,         83,         83,        1,  3110400, 0x5959a754
-0,         84,         84,        1,  3110400, 0x1cf4935c
-0,         85,         85,        1,  3110400, 0xc8da3639
-0,         86,         86,        1,  3110400, 0x50a2ee3d
-0,         87,         87,        1,  3110400, 0xd33ad53a
-0,         88,         88,        1,  3110400, 0xe7ed4eff
-0,         89,         89,        1,  3110400, 0x7d72d260
-0,         90,         90,        1,  3110400, 0x16ca295b
-0,         91,         91,        1,  3110400, 0xf126df1d
-0,         92,         92,        1,  3110400, 0x0aca09d1
-0,         93,         93,        1,  3110400, 0x6aefb52b
-0,         94,         94,        1,  3110400, 0xf797ee6d
-0,         95,         95,        1,  3110400, 0xf1053ace
-0,         96,         96,        1,  3110400, 0xf7f91618
-0,         97,         97,        1,  3110400, 0xc711acf8
-0,         98,         98,        1,  3110400, 0x31123f40
-0,         99,         99,        1,  3110400, 0xc7b703dc
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-AMP_F_Hisilicon_3 b/deps/libav/tests/ref/fate/hevc-conformance-AMP_F_Hisilicon_3
deleted file mode 100644
index 71ce9c7..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-AMP_F_Hisilicon_3
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0xa5d2b8b0
-0,          1,          1,        1,  3110400, 0x13035cfa
-0,          2,          2,        1,  3110400, 0x96b16f86
-0,          3,          3,        1,  3110400, 0x09e96331
-0,          4,          4,        1,  3110400, 0xd2662da8
-0,          5,          5,        1,  3110400, 0x77d3db00
-0,          6,          6,        1,  3110400, 0xaa025e5b
-0,          7,          7,        1,  3110400, 0x77284bc5
-0,          8,          8,        1,  3110400, 0x625b165e
-0,          9,          9,        1,  3110400, 0x69c0b4c8
-0,         10,         10,        1,  3110400, 0x52e627a4
-0,         11,         11,        1,  3110400, 0x774eaf6a
-0,         12,         12,        1,  3110400, 0xa9042cad
-0,         13,         13,        1,  3110400, 0xf367e96a
-0,         14,         14,        1,  3110400, 0x4687e2d9
-0,         15,         15,        1,  3110400, 0xe57d46b8
-0,         16,         16,        1,  3110400, 0x074da0b5
-0,         17,         17,        1,  3110400, 0xbf8dd856
-0,         18,         18,        1,  3110400, 0xb9cae21e
-0,         19,         19,        1,  3110400, 0xa43687fc
-0,         20,         20,        1,  3110400, 0x83cce559
-0,         21,         21,        1,  3110400, 0xb19963d9
-0,         22,         22,        1,  3110400, 0x636d69b7
-0,         23,         23,        1,  3110400, 0xfcfe1a00
-0,         24,         24,        1,  3110400, 0x0a804c37
-0,         25,         25,        1,  3110400, 0x6af0c5ec
-0,         26,         26,        1,  3110400, 0xccec0692
-0,         27,         27,        1,  3110400, 0x0547e98d
-0,         28,         28,        1,  3110400, 0xc4dc2caa
-0,         29,         29,        1,  3110400, 0x43473ac6
-0,         30,         30,        1,  3110400, 0xd5e9a795
-0,         31,         31,        1,  3110400, 0x3227df7b
-0,         32,         32,        1,  3110400, 0x087e57bb
-0,         33,         33,        1,  3110400, 0x892f5ad0
-0,         34,         34,        1,  3110400, 0xeeb23459
-0,         35,         35,        1,  3110400, 0xd1efe2a6
-0,         36,         36,        1,  3110400, 0x5abd5104
-0,         37,         37,        1,  3110400, 0x6b018b83
-0,         38,         38,        1,  3110400, 0x91617ca7
-0,         39,         39,        1,  3110400, 0x601cd6ad
-0,         40,         40,        1,  3110400, 0xf81cb126
-0,         41,         41,        1,  3110400, 0x4bb949df
-0,         42,         42,        1,  3110400, 0xed94fea0
-0,         43,         43,        1,  3110400, 0x39ba8fec
-0,         44,         44,        1,  3110400, 0xc65e113c
-0,         45,         45,        1,  3110400, 0x627344cb
-0,         46,         46,        1,  3110400, 0x5680c16a
-0,         47,         47,        1,  3110400, 0x12d02cfc
-0,         48,         48,        1,  3110400, 0x2e409afa
-0,         49,         49,        1,  3110400, 0xfd4142f2
-0,         50,         50,        1,  3110400, 0x6db3965a
-0,         51,         51,        1,  3110400, 0x578962c5
-0,         52,         52,        1,  3110400, 0x68d75bd1
-0,         53,         53,        1,  3110400, 0x568fbb72
-0,         54,         54,        1,  3110400, 0xf3c03b95
-0,         55,         55,        1,  3110400, 0xeb67b532
-0,         56,         56,        1,  3110400, 0x0e445b34
-0,         57,         57,        1,  3110400, 0x32c04ad2
-0,         58,         58,        1,  3110400, 0x239d1a14
-0,         59,         59,        1,  3110400, 0xcb295635
-0,         60,         60,        1,  3110400, 0x7e347c1d
-0,         61,         61,        1,  3110400, 0x74e1fcf7
-0,         62,         62,        1,  3110400, 0x6e399603
-0,         63,         63,        1,  3110400, 0xe3bbdbcd
-0,         64,         64,        1,  3110400, 0xddd336f3
-0,         65,         65,        1,  3110400, 0x7834e9f7
-0,         66,         66,        1,  3110400, 0xb53a7f1f
-0,         67,         67,        1,  3110400, 0x1f52cbb6
-0,         68,         68,        1,  3110400, 0xea26692a
-0,         69,         69,        1,  3110400, 0xa4e1765f
-0,         70,         70,        1,  3110400, 0x6367794d
-0,         71,         71,        1,  3110400, 0x69bff6d1
-0,         72,         72,        1,  3110400, 0xdf52ef08
-0,         73,         73,        1,  3110400, 0x002892b7
-0,         74,         74,        1,  3110400, 0x1ca49791
-0,         75,         75,        1,  3110400, 0x8de95d1d
-0,         76,         76,        1,  3110400, 0x9c9c38cf
-0,         77,         77,        1,  3110400, 0x9f9947cd
-0,         78,         78,        1,  3110400, 0xe5da908b
-0,         79,         79,        1,  3110400, 0x032415ae
-0,         80,         80,        1,  3110400, 0x0fef3a03
-0,         81,         81,        1,  3110400, 0xd04c1b77
-0,         82,         82,        1,  3110400, 0x5d46813b
-0,         83,         83,        1,  3110400, 0x1dbeaa76
-0,         84,         84,        1,  3110400, 0x2b2eea1a
-0,         85,         85,        1,  3110400, 0x7138da47
-0,         86,         86,        1,  3110400, 0xe9a43ef8
-0,         87,         87,        1,  3110400, 0x02f7b1bf
-0,         88,         88,        1,  3110400, 0xd1cdf8b1
-0,         89,         89,        1,  3110400, 0x2e924022
-0,         90,         90,        1,  3110400, 0x59d68bcf
-0,         91,         91,        1,  3110400, 0x3dc70503
-0,         92,         92,        1,  3110400, 0x26aeb1fa
-0,         93,         93,        1,  3110400, 0x91434f9d
-0,         94,         94,        1,  3110400, 0x91411f14
-0,         95,         95,        1,  3110400, 0xd99a172a
-0,         96,         96,        1,  3110400, 0x19678f5a
-0,         97,         97,        1,  3110400, 0xc6c357ae
-0,         98,         98,        1,  3110400, 0xba6cd89f
-0,         99,         99,        1,  3110400, 0x657af6cf
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-AMVP_A_MTK_4 b/deps/libav/tests/ref/fate/hevc-conformance-AMVP_A_MTK_4
deleted file mode 100644
index 59115fb..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-AMVP_A_MTK_4
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x88619f80
-0,          1,          1,        1,   149760, 0x550bdaf0
-0,          2,          2,        1,   149760, 0xb769fa4c
-0,          3,          3,        1,   149760, 0x3c2c2e9a
-0,          4,          4,        1,   149760, 0x75316bcc
-0,          5,          5,        1,   149760, 0x7b9ba7ff
-0,          6,          6,        1,   149760, 0x9981ea7b
-0,          7,          7,        1,   149760, 0x3f682105
-0,          8,          8,        1,   149760, 0x63252c25
-0,          9,          9,        1,   149760, 0x44427967
-0,         10,         10,        1,   149760, 0x24199a9e
-0,         11,         11,        1,   149760, 0xaa30c241
-0,         12,         12,        1,   149760, 0xf24faaaf
-0,         13,         13,        1,   149760, 0x0291c766
-0,         14,         14,        1,   149760, 0xb826e44f
-0,         15,         15,        1,   149760, 0xbc2310b8
-0,         16,         16,        1,   149760, 0xcfd81d4a
-0,         17,         17,        1,   149760, 0xb356484a
-0,         18,         18,        1,   149760, 0x02bf515a
-0,         19,         19,        1,   149760, 0x729d778c
-0,         20,         20,        1,   149760, 0x3ade8453
-0,         21,         21,        1,   149760, 0xfedead3d
-0,         22,         22,        1,   149760, 0x46bfc8db
-0,         23,         23,        1,   149760, 0x8590f422
-0,         24,         24,        1,   149760, 0x6d2dfd9d
-0,         25,         25,        1,   149760, 0x373f2c82
-0,         26,         26,        1,   149760, 0xa12f3ca1
-0,         27,         27,        1,   149760, 0x34be4b0d
-0,         28,         28,        1,   149760, 0x24f538b9
-0,         29,         29,        1,   149760, 0xd1616303
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-AMVP_B_MTK_4 b/deps/libav/tests/ref/fate/hevc-conformance-AMVP_B_MTK_4
deleted file mode 100644
index 1f998c4..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-AMVP_B_MTK_4
+++ /dev/null
@@ -1,42 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xcfffa013
-0,          1,          1,        1,   149760, 0x5166146a
-0,          2,          2,        1,   149760, 0xc3cc318e
-0,          3,          3,        1,   149760, 0x5bb465f9
-0,          4,          4,        1,   149760, 0x10c97bd4
-0,          5,          5,        1,   149760, 0xd9d5c4ab
-0,          6,          6,        1,   149760, 0x5112e11d
-0,          7,          7,        1,   149760, 0xde3803d6
-0,          8,          8,        1,   149760, 0x82c62409
-0,          9,          9,        1,   149760, 0x28f88d53
-0,         10,         10,        1,   149760, 0x796fb89d
-0,         11,         11,        1,   149760, 0x1b95dd75
-0,         12,         12,        1,   149760, 0xfcc9ced4
-0,         13,         13,        1,   149760, 0x6b00ee9c
-0,         14,         14,        1,   149760, 0xdb72e81a
-0,         15,         15,        1,   149760, 0x0c771a25
-0,         16,         16,        1,   149760, 0x959a2215
-0,         17,         17,        1,   149760, 0xf1d672ce
-0,         18,         18,        1,   149760, 0x2f407a06
-0,         19,         19,        1,   149760, 0xee389f83
-0,         20,         20,        1,   149760, 0x2e0695dd
-0,         21,         21,        1,   149760, 0xf80ac1eb
-0,         22,         22,        1,   149760, 0x29decec4
-0,         23,         23,        1,   149760, 0xff34eb5e
-0,         24,         24,        1,   149760, 0x1c85fe71
-0,         25,         25,        1,   149760, 0x056dae51
-0,         26,         26,        1,   149760, 0x78a99f1d
-0,         27,         27,        1,   149760, 0xe507b40c
-0,         28,         28,        1,   149760, 0xbd3fa06c
-0,         29,         29,        1,   149760, 0x3475d95b
-0,         30,         30,        1,   149760, 0x9b25d416
-0,         31,         31,        1,   149760, 0x73c4ec88
-0,         32,         32,        1,   149760, 0xd4437e12
-0,         33,         33,        1,   149760, 0xcf08c736
-0,         34,         34,        1,   149760, 0x0cedd0d6
-0,         35,         35,        1,   149760, 0xc317e9bc
-0,         36,         36,        1,   149760, 0x0dcbd636
-0,         37,         37,        1,   149760, 0x4e6501b0
-0,         38,         38,        1,   149760, 0x5f9c02bb
-0,         39,         39,        1,   149760, 0x43052939
-0,         40,         40,        1,   149760, 0x8ec12318
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-AMVP_C_Samsung_4 b/deps/libav/tests/ref/fate/hevc-conformance-AMVP_C_Samsung_4
deleted file mode 100644
index 16d3446..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-AMVP_C_Samsung_4
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x8087662a
-0,          1,          1,        1,   599040, 0x5278d8db
-0,          2,          2,        1,   599040, 0x73c74090
-0,          3,          3,        1,   599040, 0xde0d8317
-0,          4,          4,        1,   599040, 0xd9d4c26c
-0,          5,          5,        1,   599040, 0x603a10bd
-0,          6,          6,        1,   599040, 0xa91e9b91
-0,          7,          7,        1,   599040, 0x73567e6a
-0,          8,          8,        1,   599040, 0x67912cc6
-0,          9,          9,        1,   599040, 0x98d3fb2c
-0,         10,         10,        1,   599040, 0x50c6d7fc
-0,         11,         11,        1,   599040, 0x8ae23020
-0,         12,         12,        1,   599040, 0x9eaa976f
-0,         13,         13,        1,   599040, 0x3cadf6c0
-0,         14,         14,        1,   599040, 0x7d498902
-0,         15,         15,        1,   599040, 0x525decac
-0,         16,         16,        1,   599040, 0x081485cc
-0,         17,         17,        1,   599040, 0x3fd6ba7a
-0,         18,         18,        1,   599040, 0x8bbbaa4c
-0,         19,         19,        1,   599040, 0x9e60a407
-0,         20,         20,        1,   599040, 0x394becb9
-0,         21,         21,        1,   599040, 0x068dffb5
-0,         22,         22,        1,   599040, 0x531fd221
-0,         23,         23,        1,   599040, 0x3aa6922e
-0,         24,         24,        1,   599040, 0x089d2456
-0,         25,         25,        1,   599040, 0x7c432995
-0,         26,         26,        1,   599040, 0x3693613d
-0,         27,         27,        1,   599040, 0x8b6d902f
-0,         28,         28,        1,   599040, 0x7c9a947b
-0,         29,         29,        1,   599040, 0x51d9e4c6
-0,         30,         30,        1,   599040, 0xdc7f62f3
-0,         31,         31,        1,   599040, 0x9da6cba0
-0,         32,         32,        1,   599040, 0x1bef8581
-0,         33,         33,        1,   599040, 0xc19c4211
-0,         34,         34,        1,   599040, 0x7824188e
-0,         35,         35,        1,   599040, 0xd0511050
-0,         36,         36,        1,   599040, 0x39d93e78
-0,         37,         37,        1,   599040, 0x1e0dc88e
-0,         38,         38,        1,   599040, 0x2cd7522e
-0,         39,         39,        1,   599040, 0x538928a5
-0,         40,         40,        1,   599040, 0x95549fb2
-0,         41,         41,        1,   599040, 0x1f57d5c1
-0,         42,         42,        1,   599040, 0xc99fa8c6
-0,         43,         43,        1,   599040, 0x567f4e7e
-0,         44,         44,        1,   599040, 0x23d3d54f
-0,         45,         45,        1,   599040, 0xe8f74d97
-0,         46,         46,        1,   599040, 0xd2b03a4d
-0,         47,         47,        1,   599040, 0xe59c4faf
-0,         48,         48,        1,   599040, 0x46da921d
-0,         49,         49,        1,   599040, 0x7a344fa3
-0,         50,         50,        1,   599040, 0xbc736fd4
-0,         51,         51,        1,   599040, 0xfe5c362c
-0,         52,         52,        1,   599040, 0x115ed271
-0,         53,         53,        1,   599040, 0x3c4913fc
-0,         54,         54,        1,   599040, 0x1e1f8114
-0,         55,         55,        1,   599040, 0x08c06e58
-0,         56,         56,        1,   599040, 0x599f07f6
-0,         57,         57,        1,   599040, 0xc922a0c9
-0,         58,         58,        1,   599040, 0xc77b5201
-0,         59,         59,        1,   599040, 0x4c2cde6d
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_A_SHARP_4 b/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_A_SHARP_4
deleted file mode 100644
index 53b621b..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_A_SHARP_4
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x001f0c48
-0,          1,          1,        1,   599040, 0x83120d87
-0,          2,          2,        1,   599040, 0x10c267aa
-0,          3,          3,        1,   599040, 0xef591aef
-0,          4,          4,        1,   599040, 0xded62c79
-0,          5,          5,        1,   599040, 0xe7c1c748
-0,          6,          6,        1,   599040, 0x14db55d0
-0,          7,          7,        1,   599040, 0x73c4156b
-0,          8,          8,        1,   599040, 0x0cec903c
-0,          9,          9,        1,   599040, 0x791029a0
-0,         10,         10,        1,   599040, 0x0fe72908
-0,         11,         11,        1,   599040, 0xd0ebe0be
-0,         12,         12,        1,   599040, 0x473cb5aa
-0,         13,         13,        1,   599040, 0xe774cf8c
-0,         14,         14,        1,   599040, 0x3d63909f
-0,         15,         15,        1,   599040, 0xe05af465
-0,         16,         16,        1,   599040, 0x9679aa54
-0,         17,         17,        1,   599040, 0xe9d2ef49
-0,         18,         18,        1,   599040, 0x1e797cac
-0,         19,         19,        1,   599040, 0xf3d51077
-0,         20,         20,        1,   599040, 0x74e3b5e0
-0,         21,         21,        1,   599040, 0xb97e5178
-0,         22,         22,        1,   599040, 0x7c79a425
-0,         23,         23,        1,   599040, 0xfeeedb62
-0,         24,         24,        1,   599040, 0x8d5a3686
-0,         25,         25,        1,   599040, 0x3f6109e4
-0,         26,         26,        1,   599040, 0x365df50e
-0,         27,         27,        1,   599040, 0xd65876a1
-0,         28,         28,        1,   599040, 0xfa21e766
-0,         29,         29,        1,   599040, 0x2f24ed68
-0,         30,         30,        1,   599040, 0x0e90e5d4
-0,         31,         31,        1,   599040, 0xd044eb9c
-0,         32,         32,        1,   599040, 0xe55e8b18
-0,         33,         33,        1,   599040, 0xa92b93b6
-0,         34,         34,        1,   599040, 0x9b6827c6
-0,         35,         35,        1,   599040, 0x486e155b
-0,         36,         36,        1,   599040, 0xbff46adc
-0,         37,         37,        1,   599040, 0x61637615
-0,         38,         38,        1,   599040, 0xc0423ea9
-0,         39,         39,        1,   599040, 0xda80f8d8
-0,         40,         40,        1,   599040, 0xe0f77fcc
-0,         41,         41,        1,   599040, 0x68bef4cf
-0,         42,         42,        1,   599040, 0xd2e0699b
-0,         43,         43,        1,   599040, 0xcc6cd663
-0,         44,         44,        1,   599040, 0x00ed2594
-0,         45,         45,        1,   599040, 0x140b6efb
-0,         46,         46,        1,   599040, 0xa418f9d0
-0,         47,         47,        1,   599040, 0x500083a3
-0,         48,         48,        1,   599040, 0x619045ec
-0,         49,         49,        1,   599040, 0xdf0ce1e6
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_B_SHARP_4 b/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_B_SHARP_4
deleted file mode 100644
index 9aeb3b1..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_B_SHARP_4
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x001f0c48
-0,          1,          1,        1,   599040, 0xf8160d82
-0,          2,          2,        1,   599040, 0x5f2060e2
-0,          3,          3,        1,   599040, 0x421104a7
-0,          4,          4,        1,   599040, 0xded62c79
-0,          5,          5,        1,   599040, 0x782b4517
-0,          6,          6,        1,   599040, 0xcf47861d
-0,          7,          7,        1,   599040, 0xd401373c
-0,          8,          8,        1,   599040, 0x0cec903c
-0,          9,          9,        1,   599040, 0x2dec6230
-0,         10,         10,        1,   599040, 0xe8d25791
-0,         11,         11,        1,   599040, 0x243af0ad
-0,         12,         12,        1,   599040, 0x4f77c47b
-0,         13,         13,        1,   599040, 0x9777f7c4
-0,         14,         14,        1,   599040, 0xc5c5be51
-0,         15,         15,        1,   599040, 0xb9b27b63
-0,         16,         16,        1,   599040, 0xc333f76b
-0,         17,         17,        1,   599040, 0x6bd00f09
-0,         18,         18,        1,   599040, 0x7f76875d
-0,         19,         19,        1,   599040, 0xc9e80bec
-0,         20,         20,        1,   599040, 0x8681b48f
-0,         21,         21,        1,   599040, 0xefaa5077
-0,         22,         22,        1,   599040, 0x73cc72a4
-0,         23,         23,        1,   599040, 0x55c8bc27
-0,         24,         24,        1,   599040, 0x9d84419d
-0,         25,         25,        1,   599040, 0x89db2dfe
-0,         26,         26,        1,   599040, 0x39a012fe
-0,         27,         27,        1,   599040, 0x9ae88b01
-0,         28,         28,        1,   599040, 0x0928f3d0
-0,         29,         29,        1,   599040, 0x39359eb1
-0,         30,         30,        1,   599040, 0x3e00a5b5
-0,         31,         31,        1,   599040, 0xaf1b1809
-0,         32,         32,        1,   599040, 0xe55e8b18
-0,         33,         33,        1,   599040, 0xa4739b3d
-0,         34,         34,        1,   599040, 0x224d47d4
-0,         35,         35,        1,   599040, 0x3ce1d830
-0,         36,         36,        1,   599040, 0xd3b33990
-0,         37,         37,        1,   599040, 0x15c3ae0e
-0,         38,         38,        1,   599040, 0xcce735aa
-0,         39,         39,        1,   599040, 0x173d8406
-0,         40,         40,        1,   599040, 0xe0f77fcc
-0,         41,         41,        1,   599040, 0xbeefe9eb
-0,         42,         42,        1,   599040, 0xb3d761cf
-0,         43,         43,        1,   599040, 0x75ffe5f0
-0,         44,         44,        1,   599040, 0xf446226e
-0,         45,         45,        1,   599040, 0xf425475a
-0,         46,         46,        1,   599040, 0x5180ee65
-0,         47,         47,        1,   599040, 0x5edb78f9
-0,         48,         48,        1,   599040, 0x28eb41c5
-0,         49,         49,        1,   599040, 0x0d65d9d3
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_C_SHARP_3 b/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_C_SHARP_3
deleted file mode 100644
index c891c44..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_C_SHARP_3
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x2b58dee2
-0,          1,          1,        1,   599040, 0x2b58dee2
-0,          2,          2,        1,   599040, 0xcd9295f4
-0,          3,          3,        1,   599040, 0xc052f81f
-0,          4,          4,        1,   599040, 0xfe5932ed
-0,          5,          5,        1,   599040, 0x8a8aa4b9
-0,          6,          6,        1,   599040, 0x6ac33b24
-0,          7,          7,        1,   599040, 0xd053bb83
-0,          8,          8,        1,   599040, 0xa9cf6ba6
-0,          9,          9,        1,   599040, 0x3d5a1a3b
-0,         10,         10,        1,   599040, 0x90997f48
-0,         11,         11,        1,   599040, 0xc99390bd
-0,         12,         12,        1,   599040, 0x9723079d
-0,         13,         13,        1,   599040, 0x7f0fe29b
-0,         14,         14,        1,   599040, 0x778afdb4
-0,         15,         15,        1,   599040, 0x72963905
-0,         16,         16,        1,   599040, 0xa677b29c
-0,         17,         17,        1,   599040, 0x88bdccd8
-0,         18,         18,        1,   599040, 0x8be37199
-0,         19,         19,        1,   599040, 0x6628117a
-0,         20,         20,        1,   599040, 0xefa701b0
-0,         21,         21,        1,   599040, 0x75d6705d
-0,         22,         22,        1,   599040, 0x85242d6f
-0,         23,         23,        1,   599040, 0xd559eaa6
-0,         24,         24,        1,   599040, 0xe0663879
-0,         25,         25,        1,   599040, 0x3255d67c
-0,         26,         26,        1,   599040, 0xf41a4d73
-0,         27,         27,        1,   599040, 0xda630d57
-0,         28,         28,        1,   599040, 0x7b8eec79
-0,         29,         29,        1,   599040, 0x70dff7a6
-0,         30,         30,        1,   599040, 0x4b600806
-0,         31,         31,        1,   599040, 0xdcbbc54d
-0,         32,         32,        1,   599040, 0x7e6e66b4
-0,         33,         33,        1,   599040, 0x645ce246
-0,         34,         34,        1,   599040, 0x03d3117c
-0,         35,         35,        1,   599040, 0x7c3cab88
-0,         36,         36,        1,   599040, 0x5cdaeeef
-0,         37,         37,        1,   599040, 0x4cce6d93
-0,         38,         38,        1,   599040, 0x78c28e4c
-0,         39,         39,        1,   599040, 0x8acbe642
-0,         40,         40,        1,   599040, 0xcd0a39f8
-0,         41,         41,        1,   599040, 0x9c580311
-0,         42,         42,        1,   599040, 0x668eab11
-0,         43,         43,        1,   599040, 0xc76f6206
-0,         44,         44,        1,   599040, 0xe0baf2a2
-0,         45,         45,        1,   599040, 0x430db206
-0,         46,         46,        1,   599040, 0x9c1565ad
-0,         47,         47,        1,   599040, 0xfc302be0
-0,         48,         48,        1,   599040, 0x6ccfc206
-0,         49,         49,        1,   599040, 0x46c7722d
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_D_SHARP_3 b/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_D_SHARP_3
deleted file mode 100644
index 0294a7e..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_D_SHARP_3
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x2b58dee2
-0,          1,          1,        1,   599040, 0x2b58dee2
-0,          2,          2,        1,   599040, 0xb055b638
-0,          3,          3,        1,   599040, 0x3e2b06c9
-0,          4,          4,        1,   599040, 0xa0e53610
-0,          5,          5,        1,   599040, 0x5f6eca50
-0,          6,          6,        1,   599040, 0x516e679d
-0,          7,          7,        1,   599040, 0xdbbbf791
-0,          8,          8,        1,   599040, 0x04be5abc
-0,          9,          9,        1,   599040, 0x85283636
-0,         10,         10,        1,   599040, 0x1bcdb857
-0,         11,         11,        1,   599040, 0x258bb8a8
-0,         12,         12,        1,   599040, 0x33340003
-0,         13,         13,        1,   599040, 0xa2cc0dc3
-0,         14,         14,        1,   599040, 0x2b83400f
-0,         15,         15,        1,   599040, 0xf33ba886
-0,         16,         16,        1,   599040, 0x73f43f10
-0,         17,         17,        1,   599040, 0x63ff4628
-0,         18,         18,        1,   599040, 0x41170243
-0,         19,         19,        1,   599040, 0x84f34b72
-0,         20,         20,        1,   599040, 0x4913e415
-0,         21,         21,        1,   599040, 0x38cfaac3
-0,         22,         22,        1,   599040, 0xb2f0650c
-0,         23,         23,        1,   599040, 0xe0d12249
-0,         24,         24,        1,   599040, 0xca931ca0
-0,         25,         25,        1,   599040, 0xfc14d1cb
-0,         26,         26,        1,   599040, 0xb74667d8
-0,         27,         27,        1,   599040, 0xfdc22b8b
-0,         28,         28,        1,   599040, 0x30b425eb
-0,         29,         29,        1,   599040, 0xc31f3b73
-0,         30,         30,        1,   599040, 0xefda0062
-0,         31,         31,        1,   599040, 0x8fe0d742
-0,         32,         32,        1,   599040, 0xdaa54d1d
-0,         33,         33,        1,   599040, 0x2188ae4b
-0,         34,         34,        1,   599040, 0x7ef0f088
-0,         35,         35,        1,   599040, 0xcfd2619f
-0,         36,         36,        1,   599040, 0x3b0fca50
-0,         37,         37,        1,   599040, 0x78746df2
-0,         38,         38,        1,   599040, 0xdc917e1b
-0,         39,         39,        1,   599040, 0xc6cf2732
-0,         40,         40,        1,   599040, 0xdbd2f5f2
-0,         41,         41,        1,   599040, 0x45a8cba3
-0,         42,         42,        1,   599040, 0xe276b712
-0,         43,         43,        1,   599040, 0x36057004
-0,         44,         44,        1,   599040, 0xe0da7e77
-0,         45,         45,        1,   599040, 0x823e7c30
-0,         46,         46,        1,   599040, 0x62c9457a
-0,         47,         47,        1,   599040, 0xf6743a30
-0,         48,         48,        1,   599040, 0x8db4f476
-0,         49,         49,        1,   599040, 0x79537927
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_E_SHARP_3 b/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_E_SHARP_3
deleted file mode 100644
index 430426b..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_E_SHARP_3
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x1cf21d79
-0,          1,          1,        1,   599040, 0x1cf21d79
-0,          2,          2,        1,   599040, 0xb54ee9e0
-0,          3,          3,        1,   599040, 0x757f33f0
-0,          4,          4,        1,   599040, 0x783e06bc
-0,          5,          5,        1,   599040, 0x73127ae7
-0,          6,          6,        1,   599040, 0x52f86193
-0,          7,          7,        1,   599040, 0x8e8afa2c
-0,          8,          8,        1,   599040, 0x29359620
-0,          9,          9,        1,   599040, 0x23f46fd3
-0,         10,         10,        1,   599040, 0x00c9d47d
-0,         11,         11,        1,   599040, 0xcabcca8d
-0,         12,         12,        1,   599040, 0x02e92d89
-0,         13,         13,        1,   599040, 0x3e97268f
-0,         14,         14,        1,   599040, 0xba6230c2
-0,         15,         15,        1,   599040, 0x4393aa3b
-0,         16,         16,        1,   599040, 0x06b1b9c8
-0,         17,         17,        1,   599040, 0xcc2aa30b
-0,         18,         18,        1,   599040, 0x3e029a11
-0,         19,         19,        1,   599040, 0x0ec1fc36
-0,         20,         20,        1,   599040, 0xd61dd438
-0,         21,         21,        1,   599040, 0xa7b1816b
-0,         22,         22,        1,   599040, 0xa98ef225
-0,         23,         23,        1,   599040, 0x368912ca
-0,         24,         24,        1,   599040, 0x1ae95cbe
-0,         25,         25,        1,   599040, 0x0e01f8ed
-0,         26,         26,        1,   599040, 0x05497937
-0,         27,         27,        1,   599040, 0x735c2420
-0,         28,         28,        1,   599040, 0x0ef80004
-0,         29,         29,        1,   599040, 0xd744091b
-0,         30,         30,        1,   599040, 0x0f3b1576
-0,         31,         31,        1,   599040, 0x24e4fab9
-0,         32,         32,        1,   599040, 0x6b5d7fca
-0,         33,         33,        1,   599040, 0x2afcdaec
-0,         34,         34,        1,   599040, 0x39dfd5b6
-0,         35,         35,        1,   599040, 0xe5844f4e
-0,         36,         36,        1,   599040, 0xf26920d9
-0,         37,         37,        1,   599040, 0x8feb56e2
-0,         38,         38,        1,   599040, 0x6433712f
-0,         39,         39,        1,   599040, 0xba311758
-0,         40,         40,        1,   599040, 0x09f87643
-0,         41,         41,        1,   599040, 0x68562c28
-0,         42,         42,        1,   599040, 0x9465e267
-0,         43,         43,        1,   599040, 0x03e2802f
-0,         44,         44,        1,   599040, 0xa61ed250
-0,         45,         45,        1,   599040, 0x5ab680db
-0,         46,         46,        1,   599040, 0xc4663840
-0,         47,         47,        1,   599040, 0xefe83a4f
-0,         48,         48,        1,   599040, 0x7bfb4ecd
-0,         49,         49,        1,   599040, 0xcafdbfd0
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_F_SHARP_3 b/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_F_SHARP_3
deleted file mode 100644
index aeba53b..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_F_SHARP_3
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x1cf21d79
-0,          1,          1,        1,   599040, 0x1cf21d79
-0,          2,          2,        1,   599040, 0xc182eaa8
-0,          3,          3,        1,   599040, 0x260358ee
-0,          4,          4,        1,   599040, 0x381e5b16
-0,          5,          5,        1,   599040, 0x329dacd8
-0,          6,          6,        1,   599040, 0x7306d51c
-0,          7,          7,        1,   599040, 0x869d359b
-0,          8,          8,        1,   599040, 0xf8fc941a
-0,          9,          9,        1,   599040, 0x0798842b
-0,         10,         10,        1,   599040, 0xe6e1f54e
-0,         11,         11,        1,   599040, 0xc7d5ba9e
-0,         12,         12,        1,   599040, 0xc8c5507a
-0,         13,         13,        1,   599040, 0x97ae604a
-0,         14,         14,        1,   599040, 0x14dd4139
-0,         15,         15,        1,   599040, 0xb2f998dc
-0,         16,         16,        1,   599040, 0xc3a3a6bc
-0,         17,         17,        1,   599040, 0x1f95be77
-0,         18,         18,        1,   599040, 0xb7fd124b
-0,         19,         19,        1,   599040, 0x25703b3c
-0,         20,         20,        1,   599040, 0x3bddeba7
-0,         21,         21,        1,   599040, 0xffcc9b6d
-0,         22,         22,        1,   599040, 0x3dd66a0a
-0,         23,         23,        1,   599040, 0xe9607af7
-0,         24,         24,        1,   599040, 0x218cdc65
-0,         25,         25,        1,   599040, 0x88f97761
-0,         26,         26,        1,   599040, 0x62e1f5d4
-0,         27,         27,        1,   599040, 0xcc3cd429
-0,         28,         28,        1,   599040, 0xb4290272
-0,         29,         29,        1,   599040, 0x4f73142c
-0,         30,         30,        1,   599040, 0x753eefd9
-0,         31,         31,        1,   599040, 0xea77e837
-0,         32,         32,        1,   599040, 0xfa927e55
-0,         33,         33,        1,   599040, 0x3dff1295
-0,         34,         34,        1,   599040, 0x513c2088
-0,         35,         35,        1,   599040, 0x9822b7f0
-0,         36,         36,        1,   599040, 0xc4770af6
-0,         37,         37,        1,   599040, 0x7cb576fb
-0,         38,         38,        1,   599040, 0x2af8ca3a
-0,         39,         39,        1,   599040, 0x0a324910
-0,         40,         40,        1,   599040, 0x1aeb3d7a
-0,         41,         41,        1,   599040, 0x82de1408
-0,         42,         42,        1,   599040, 0x7ebad7f4
-0,         43,         43,        1,   599040, 0xd100bcc1
-0,         44,         44,        1,   599040, 0x4719dc40
-0,         45,         45,        1,   599040, 0xd82f658b
-0,         46,         46,        1,   599040, 0x8c596a54
-0,         47,         47,        1,   599040, 0xd0b4572c
-0,         48,         48,        1,   599040, 0xdc3c5a89
-0,         49,         49,        1,   599040, 0x4f0ad888
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_G_SHARP_3 b/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_G_SHARP_3
deleted file mode 100644
index e0501be..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_G_SHARP_3
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xd9b73cbe
-0,          1,          1,        1,   599040, 0xd9b73cbe
-0,          2,          2,        1,   599040, 0xe4e5dd7c
-0,          3,          3,        1,   599040, 0xa7333d7e
-0,          4,          4,        1,   599040, 0x6b82552b
-0,          5,          5,        1,   599040, 0x4f02e2a4
-0,          6,          6,        1,   599040, 0x8fdcc50a
-0,          7,          7,        1,   599040, 0x2481542d
-0,          8,          8,        1,   599040, 0x73d0dfad
-0,          9,          9,        1,   599040, 0x842b8cd2
-0,         10,         10,        1,   599040, 0x87b3a3b2
-0,         11,         11,        1,   599040, 0xe4decf78
-0,         12,         12,        1,   599040, 0xfba7dd51
-0,         13,         13,        1,   599040, 0x3dc1e85c
-0,         14,         14,        1,   599040, 0xea8a4987
-0,         15,         15,        1,   599040, 0xa3cc5c8c
-0,         16,         16,        1,   599040, 0x10a09cd8
-0,         17,         17,        1,   599040, 0x6739c5f7
-0,         18,         18,        1,   599040, 0x819af14a
-0,         19,         19,        1,   599040, 0xe9d65a5c
-0,         20,         20,        1,   599040, 0x09def54e
-0,         21,         21,        1,   599040, 0x8595aa5d
-0,         22,         22,        1,   599040, 0xc3f134d7
-0,         23,         23,        1,   599040, 0xdac9496a
-0,         24,         24,        1,   599040, 0x760f0897
-0,         25,         25,        1,   599040, 0x8daddaf5
-0,         26,         26,        1,   599040, 0xed313947
-0,         27,         27,        1,   599040, 0xc875ed4d
-0,         28,         28,        1,   599040, 0xdb5d0b3b
-0,         29,         29,        1,   599040, 0x7cbc0e6a
-0,         30,         30,        1,   599040, 0x193bbc9f
-0,         31,         31,        1,   599040, 0x4f20d599
-0,         32,         32,        1,   599040, 0x09e545e8
-0,         33,         33,        1,   599040, 0x0637d524
-0,         34,         34,        1,   599040, 0x11a3bd85
-0,         35,         35,        1,   599040, 0x304155ce
-0,         36,         36,        1,   599040, 0x6636291b
-0,         37,         37,        1,   599040, 0xc4039e80
-0,         38,         38,        1,   599040, 0xd73ca756
-0,         39,         39,        1,   599040, 0x96a68426
-0,         40,         40,        1,   599040, 0xd945391c
-0,         41,         41,        1,   599040, 0x95a83264
-0,         42,         42,        1,   599040, 0x6356a243
-0,         43,         43,        1,   599040, 0xb9b8973e
-0,         44,         44,        1,   599040, 0xf361d0d9
-0,         45,         45,        1,   599040, 0x2783b0e2
-0,         46,         46,        1,   599040, 0x870ac424
-0,         47,         47,        1,   599040, 0xa8397c01
-0,         48,         48,        1,   599040, 0xf1bc2ac0
-0,         49,         49,        1,   599040, 0x82fbb428
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_H_SHARP_3 b/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_H_SHARP_3
deleted file mode 100644
index 01ab258..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CAINIT_H_SHARP_3
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xd9b73cbe
-0,          1,          1,        1,   599040, 0xd9b73cbe
-0,          2,          2,        1,   599040, 0x93a3fabf
-0,          3,          3,        1,   599040, 0x245a522e
-0,          4,          4,        1,   599040, 0xff1e8bb4
-0,          5,          5,        1,   599040, 0x03390b9a
-0,          6,          6,        1,   599040, 0x27030635
-0,          7,          7,        1,   599040, 0x431c6312
-0,          8,          8,        1,   599040, 0xeddc5f83
-0,          9,          9,        1,   599040, 0x34168a1e
-0,         10,         10,        1,   599040, 0xf4d795a4
-0,         11,         11,        1,   599040, 0xe716ea67
-0,         12,         12,        1,   599040, 0xf3b8446d
-0,         13,         13,        1,   599040, 0x082d12d0
-0,         14,         14,        1,   599040, 0x68e12e99
-0,         15,         15,        1,   599040, 0x3fd079df
-0,         16,         16,        1,   599040, 0x6087fb37
-0,         17,         17,        1,   599040, 0x12c2142e
-0,         18,         18,        1,   599040, 0xb3bcf682
-0,         19,         19,        1,   599040, 0xcec84ee7
-0,         20,         20,        1,   599040, 0x12a4fb43
-0,         21,         21,        1,   599040, 0x85749580
-0,         22,         22,        1,   599040, 0x6df99536
-0,         23,         23,        1,   599040, 0x377282a6
-0,         24,         24,        1,   599040, 0xe296f874
-0,         25,         25,        1,   599040, 0x1b29cd1a
-0,         26,         26,        1,   599040, 0x1cf633c9
-0,         27,         27,        1,   599040, 0xf8cd2544
-0,         28,         28,        1,   599040, 0x61c05325
-0,         29,         29,        1,   599040, 0x87646c89
-0,         30,         30,        1,   599040, 0x5b840711
-0,         31,         31,        1,   599040, 0x5bc4c181
-0,         32,         32,        1,   599040, 0x91ce695a
-0,         33,         33,        1,   599040, 0xed54dcca
-0,         34,         34,        1,   599040, 0xc41fef8e
-0,         35,         35,        1,   599040, 0x9da8830b
-0,         36,         36,        1,   599040, 0xb76cec12
-0,         37,         37,        1,   599040, 0xef9661f0
-0,         38,         38,        1,   599040, 0xe1d38227
-0,         39,         39,        1,   599040, 0xce440134
-0,         40,         40,        1,   599040, 0x41a54dd1
-0,         41,         41,        1,   599040, 0xdd83da8e
-0,         42,         42,        1,   599040, 0xf9cee595
-0,         43,         43,        1,   599040, 0x6f5db54d
-0,         44,         44,        1,   599040, 0x00b6f064
-0,         45,         45,        1,   599040, 0xfbaa978d
-0,         46,         46,        1,   599040, 0x2c9ee1d7
-0,         47,         47,        1,   599040, 0xe8c4be1f
-0,         48,         48,        1,   599040, 0x132a260f
-0,         49,         49,        1,   599040, 0x8571a213
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CIP_A_Panasonic_3 b/deps/libav/tests/ref/fate/hevc-conformance-CIP_A_Panasonic_3
deleted file mode 100644
index afa4854..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CIP_A_Panasonic_3
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x6e1f16d0
-0,          1,          1,        1,   149760, 0x5be5bde9
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-CIP_C_Panasonic_2 b/deps/libav/tests/ref/fate/hevc-conformance-CIP_C_Panasonic_2
deleted file mode 100644
index 3346e20..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-CIP_C_Panasonic_2
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xcd1019b2
-0,          1,          1,        1,   149760, 0xeb39efeb
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_A_MAIN10_VIXS_2 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_A_MAIN10_VIXS_2
deleted file mode 100644
index 50be4f1..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_A_MAIN10_VIXS_2
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    76032, 0x4313935b
-0,          1,          1,        1,    76032, 0x4c8071b5
-0,          2,          2,        1,    76032, 0x5e627edc
-0,          3,          3,        1,    76032, 0xb51a996d
-0,          4,          4,        1,    76032, 0x77d1800b
-0,          5,          5,        1,    76032, 0x4fb9bf3f
-0,          6,          6,        1,    76032, 0x838f8c05
-0,          7,          7,        1,    76032, 0xa87aabb6
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_A_SONY_3 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_A_SONY_3
deleted file mode 100644
index 0750bb3..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_A_SONY_3
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x154e6dd9
-0,          2,          2,        1,   599040, 0xcce25693
-0,          3,          3,        1,   599040, 0x3dd84e88
-0,          4,          4,        1,   599040, 0xca197027
-0,          5,          5,        1,   599040, 0xc9af0241
-0,          6,          6,        1,   599040, 0x510470de
-0,          7,          7,        1,   599040, 0xac8c0a7c
-0,          8,          8,        1,   599040, 0x04cbed5e
-0,          9,          9,        1,   599040, 0x514ce2f1
-0,         10,         10,        1,   599040, 0xf37a4eec
-0,         11,         11,        1,   599040, 0xabfd7f2f
-0,         12,         12,        1,   599040, 0x944458a1
-0,         13,         13,        1,   599040, 0xf4f81db2
-0,         14,         14,        1,   599040, 0xdde236fb
-0,         15,         15,        1,   599040, 0x6b0132be
-0,         16,         16,        1,   599040, 0x641683a3
-0,         17,         17,        1,   599040, 0x81d6be90
-0,         18,         18,        1,   599040, 0xf1e04e55
-0,         19,         19,        1,   599040, 0x63c4dc0a
-0,         20,         20,        1,   599040, 0x47170db8
-0,         21,         21,        1,   599040, 0xdc22f27b
-0,         22,         22,        1,   599040, 0xd5b63800
-0,         23,         23,        1,   599040, 0x07b76936
-0,         24,         24,        1,   599040, 0x5215eee2
-0,         25,         25,        1,   599040, 0xb5b2c9b1
-0,         26,         26,        1,   599040, 0x79bee732
-0,         27,         27,        1,   599040, 0x14c1f436
-0,         28,         28,        1,   599040, 0x384f7f05
-0,         29,         29,        1,   599040, 0x44229c42
-0,         30,         30,        1,   599040, 0x5dea88e9
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_B_SONY_3 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_B_SONY_3
deleted file mode 100644
index 83f9b4a..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_B_SONY_3
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xda0cb5d4
-0,          2,          2,        1,   599040, 0x352bc397
-0,          3,          3,        1,   599040, 0x72bc28fe
-0,          4,          4,        1,   599040, 0x22294f68
-0,          5,          5,        1,   599040, 0x1f6415a7
-0,          6,          6,        1,   599040, 0xa9f6b0d7
-0,          7,          7,        1,   599040, 0x6b7c1f2d
-0,          8,          8,        1,   599040, 0xb93857f5
-0,          9,          9,        1,   599040, 0xb0d752d3
-0,         10,         10,        1,   599040, 0x0622e689
-0,         11,         11,        1,   599040, 0x23d8780a
-0,         12,         12,        1,   599040, 0x4844581b
-0,         13,         13,        1,   599040, 0x791322f9
-0,         14,         14,        1,   599040, 0x82f6cf43
-0,         15,         15,        1,   599040, 0xcace3aba
-0,         16,         16,        1,   599040, 0x68a68427
-0,         17,         17,        1,   599040, 0x23fa500a
-0,         18,         18,        1,   599040, 0x7d78b77d
-0,         19,         19,        1,   599040, 0x8d295032
-0,         20,         20,        1,   599040, 0x16fa266c
-0,         21,         21,        1,   599040, 0x37d8173b
-0,         22,         22,        1,   599040, 0x8a4f90e1
-0,         23,         23,        1,   599040, 0x40f98f6d
-0,         24,         24,        1,   599040, 0xc060b193
-0,         25,         25,        1,   599040, 0xa53c3bc1
-0,         26,         26,        1,   599040, 0x5a9556d6
-0,         27,         27,        1,   599040, 0x37582393
-0,         28,         28,        1,   599040, 0x376acd14
-0,         29,         29,        1,   599040, 0x81ee1e64
-0,         30,         30,        1,   599040, 0xff2a600c
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_C_SONY_3 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_C_SONY_3
deleted file mode 100644
index 1087148..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_C_SONY_3
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x57369bf4
-0,          2,          2,        1,   599040, 0x319aab9c
-0,          3,          3,        1,   599040, 0xbc1b7698
-0,          4,          4,        1,   599040, 0x05cea248
-0,          5,          5,        1,   599040, 0xdca73743
-0,          6,          6,        1,   599040, 0x5b5a9f70
-0,          7,          7,        1,   599040, 0x16c51b34
-0,          8,          8,        1,   599040, 0x734fe724
-0,          9,          9,        1,   599040, 0x48e4e0ba
-0,         10,         10,        1,   599040, 0xf1423cc1
-0,         11,         11,        1,   599040, 0xb4bb68b1
-0,         12,         12,        1,   599040, 0x54a77ad6
-0,         13,         13,        1,   599040, 0x6e0dfce3
-0,         14,         14,        1,   599040, 0x7ca687e3
-0,         15,         15,        1,   599040, 0xf9ac2443
-0,         16,         16,        1,   599040, 0xe35b8d34
-0,         17,         17,        1,   599040, 0xef4bbe9f
-0,         18,         18,        1,   599040, 0x21eb418e
-0,         19,         19,        1,   599040, 0xae6df30f
-0,         20,         20,        1,   599040, 0x743500af
-0,         21,         21,        1,   599040, 0x7fba1ce1
-0,         22,         22,        1,   599040, 0x45793eae
-0,         23,         23,        1,   599040, 0x1f7e3467
-0,         24,         24,        1,   599040, 0x7400c7c3
-0,         25,         25,        1,   599040, 0xcf79806d
-0,         26,         26,        1,   599040, 0x324ea91d
-0,         27,         27,        1,   599040, 0x9c8cae92
-0,         28,         28,        1,   599040, 0x70bfc368
-0,         29,         29,        1,   599040, 0x46a0f8ff
-0,         30,         30,        1,   599040, 0xd864208a
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_D_VIXS_1 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_D_VIXS_1
deleted file mode 100644
index 3d9e43b..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_D_VIXS_1
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0x6ef5c76e
-0,          1,          1,        1,  1382400, 0x975238be
-0,          2,          2,        1,  1382400, 0xe5529a79
-0,          3,          3,        1,  1382400, 0x639641d4
-0,          4,          4,        1,  1382400, 0x566eb1df
-0,          5,          5,        1,  1382400, 0x4fd4b46a
-0,          6,          6,        1,  1382400, 0xfb4a6a0e
-0,          7,          7,        1,  1382400, 0x4485af32
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_D_VIXS_2 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_D_VIXS_2
deleted file mode 100644
index 2bdc548..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_D_VIXS_2
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0x6ef5c76e
-0,          1,          1,        1,  1382400, 0x1e1926b1
-0,          2,          2,        1,  1382400, 0x69888786
-0,          3,          3,        1,  1382400, 0x1f193659
-0,          4,          4,        1,  1382400, 0x566eb1df
-0,          5,          5,        1,  1382400, 0x49b3a668
-0,          6,          6,        1,  1382400, 0x1b774ed8
-0,          7,          7,        1,  1382400, 0x2296a2bc
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_E_VIXS_1 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_E_VIXS_1
deleted file mode 100644
index c3ebaf2..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_E_VIXS_1
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0x7119bbe5
-0,          1,          1,        1,  1382400, 0xbeda2c83
-0,          2,          2,        1,  1382400, 0x2cbe6669
-0,          3,          3,        1,  1382400, 0x3cee2619
-0,          4,          4,        1,  1382400, 0x93e388e3
-0,          5,          5,        1,  1382400, 0x5e286889
-0,          6,          6,        1,  1382400, 0x4718f29c
-0,          7,          7,        1,  1382400, 0xbedf4dbd
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_E_VIXS_2 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_E_VIXS_2
deleted file mode 100644
index 4c8b07d..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_E_VIXS_2
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0xecfdf606
-0,          1,          1,        1,  1382400, 0x0b0382e1
-0,          2,          2,        1,  1382400, 0xbef3afd6
-0,          3,          3,        1,  1382400, 0x6a2bcabb
-0,          4,          4,        1,  1382400, 0x663f991c
-0,          5,          5,        1,  1382400, 0xb49b94d8
-0,          6,          6,        1,  1382400, 0x07399433
-0,          7,          7,        1,  1382400, 0x9cca09df
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_F_VIXS_1 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_F_VIXS_1
deleted file mode 100644
index 59f51ef..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_F_VIXS_1
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0xea27f7bd
-0,          1,          1,        1,  1382400, 0xce3d7b4c
-0,          2,          2,        1,  1382400, 0xaea4970e
-0,          3,          3,        1,  1382400, 0xcbc7c89f
-0,          4,          4,        1,  1382400, 0xe5367019
-0,          5,          5,        1,  1382400, 0xb92ca18e
-0,          6,          6,        1,  1382400, 0xde046be1
-0,          7,          7,        1,  1382400, 0x1ae6e393
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_F_VIXS_2 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_F_VIXS_2
deleted file mode 100644
index 3ff62e5..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_F_VIXS_2
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0xea27f7bd
-0,          1,          1,        1,  1382400, 0x423e555b
-0,          2,          2,        1,  1382400, 0x87898ae0
-0,          3,          3,        1,  1382400, 0xfee4beab
-0,          4,          4,        1,  1382400, 0xe5367019
-0,          5,          5,        1,  1382400, 0x3e74b3aa
-0,          6,          6,        1,  1382400, 0x4d8ab61a
-0,          7,          7,        1,  1382400, 0x22500e13
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_G_VIXS_1 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_G_VIXS_1
deleted file mode 100644
index 4b9793b..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_G_VIXS_1
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0xecfdf606
-0,          1,          1,        1,  1382400, 0x7607799b
-0,          2,          2,        1,  1382400, 0x67fb98e4
-0,          3,          3,        1,  1382400, 0xf2dce07f
-0,          4,          4,        1,  1382400, 0x663f991c
-0,          5,          5,        1,  1382400, 0x3877aeb0
-0,          6,          6,        1,  1382400, 0x73409282
-0,          7,          7,        1,  1382400, 0x766c10b1
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_G_VIXS_2 b/deps/libav/tests/ref/fate/hevc-conformance-DBLK_G_VIXS_2
deleted file mode 100644
index 4c8b07d..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DBLK_G_VIXS_2
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0xecfdf606
-0,          1,          1,        1,  1382400, 0x0b0382e1
-0,          2,          2,        1,  1382400, 0xbef3afd6
-0,          3,          3,        1,  1382400, 0x6a2bcabb
-0,          4,          4,        1,  1382400, 0x663f991c
-0,          5,          5,        1,  1382400, 0xb49b94d8
-0,          6,          6,        1,  1382400, 0x07399433
-0,          7,          7,        1,  1382400, 0x9cca09df
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DELTAQP_B_SONY_3 b/deps/libav/tests/ref/fate/hevc-conformance-DELTAQP_B_SONY_3
deleted file mode 100644
index a8427d1..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DELTAQP_B_SONY_3
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x7ea9597c
-0,          2,          2,        1,   599040, 0x3e7365e4
-0,          3,          3,        1,   599040, 0x4a9149c9
-0,          4,          4,        1,   599040, 0x3b1f6549
-0,          5,          5,        1,   599040, 0x3e35f616
-0,          6,          6,        1,   599040, 0x843c7951
-0,          7,          7,        1,   599040, 0xa2adb299
-0,          8,          8,        1,   599040, 0xb9dda682
-0,          9,          9,        1,   599040, 0x9a5e7355
-0,         10,         10,        1,   599040, 0xc4bafa8c
-0,         11,         11,        1,   599040, 0xc4ec160e
-0,         12,         12,        1,   599040, 0x538421a3
-0,         13,         13,        1,   599040, 0xb294a96e
-0,         14,         14,        1,   599040, 0x9bb217df
-0,         15,         15,        1,   599040, 0xbe70c870
-0,         16,         16,        1,   599040, 0xa4e319a8
-0,         17,         17,        1,   599040, 0x3a4c702d
-0,         18,         18,        1,   599040, 0x9f790906
-0,         19,         19,        1,   599040, 0xbbfdb8d6
-0,         20,         20,        1,   599040, 0x0965c0ed
-0,         21,         21,        1,   599040, 0x6993e1f1
-0,         22,         22,        1,   599040, 0xc1cc1df9
-0,         23,         23,        1,   599040, 0xe570c390
-0,         24,         24,        1,   599040, 0x422f6fd7
-0,         25,         25,        1,   599040, 0x9c89298c
-0,         26,         26,        1,   599040, 0x5ece4193
-0,         27,         27,        1,   599040, 0x142a4f2f
-0,         28,         28,        1,   599040, 0xa5356c63
-0,         29,         29,        1,   599040, 0x8458a378
-0,         30,         30,        1,   599040, 0xc149ed56
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DELTAQP_C_SONY_3 b/deps/libav/tests/ref/fate/hevc-conformance-DELTAQP_C_SONY_3
deleted file mode 100644
index 8037e9c..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DELTAQP_C_SONY_3
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xcb2969c5
-0,          2,          2,        1,   599040, 0xd9825d1f
-0,          3,          3,        1,   599040, 0x5ff4245a
-0,          4,          4,        1,   599040, 0xd34e7bcb
-0,          5,          5,        1,   599040, 0x032e1b8b
-0,          6,          6,        1,   599040, 0x5ba1873c
-0,          7,          7,        1,   599040, 0xa0b725ad
-0,          8,          8,        1,   599040, 0x9cade6a6
-0,          9,          9,        1,   599040, 0xe41bee5a
-0,         10,         10,        1,   599040, 0x9de4340f
-0,         11,         11,        1,   599040, 0xb966282a
-0,         12,         12,        1,   599040, 0x52fd5300
-0,         13,         13,        1,   599040, 0x8e6d6753
-0,         14,         14,        1,   599040, 0x2011759b
-0,         15,         15,        1,   599040, 0x5da5b7af
-0,         16,         16,        1,   599040, 0x090e298c
-0,         17,         17,        1,   599040, 0xfd618263
-0,         18,         18,        1,   599040, 0xdaf4ef69
-0,         19,         19,        1,   599040, 0x0349d1a0
-0,         20,         20,        1,   599040, 0x75a35caf
-0,         21,         21,        1,   599040, 0x4544918e
-0,         22,         22,        1,   599040, 0xbca15836
-0,         23,         23,        1,   599040, 0x443bc611
-0,         24,         24,        1,   599040, 0xc380beaf
-0,         25,         25,        1,   599040, 0x01a581ca
-0,         26,         26,        1,   599040, 0x1690835f
-0,         27,         27,        1,   599040, 0x871e9c3b
-0,         28,         28,        1,   599040, 0xf4c20a25
-0,         29,         29,        1,   599040, 0x86d8f2df
-0,         30,         30,        1,   599040, 0x7690bd56
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DSLICE_A_HHI_5 b/deps/libav/tests/ref/fate/hevc-conformance-DSLICE_A_HHI_5
deleted file mode 100644
index 6cd113b..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DSLICE_A_HHI_5
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0xdc18cd12
-0,          1,          1,        1,  3110400, 0x42f7020d
-0,          2,          2,        1,  3110400, 0x6ac4421a
-0,          3,          3,        1,  3110400, 0xdbf78c86
-0,          4,          4,        1,  3110400, 0x123f9c50
-0,          5,          5,        1,  3110400, 0x9356a73f
-0,          6,          6,        1,  3110400, 0xc54a446b
-0,          7,          7,        1,  3110400, 0xdfa92401
-0,          8,          8,        1,  3110400, 0xd3226c6a
-0,          9,          9,        1,  3110400, 0xa0bd149a
-0,         10,         10,        1,  3110400, 0xc38c58cc
-0,         11,         11,        1,  3110400, 0xf1871f13
-0,         12,         12,        1,  3110400, 0xfdf151d5
-0,         13,         13,        1,  3110400, 0x65ca7286
-0,         14,         14,        1,  3110400, 0xac2d80dc
-0,         15,         15,        1,  3110400, 0x3e024908
-0,         16,         16,        1,  3110400, 0x22a66454
-0,         17,         17,        1,  3110400, 0x83b6cac8
-0,         18,         18,        1,  3110400, 0xe1bccc50
-0,         19,         19,        1,  3110400, 0x76be567e
-0,         20,         20,        1,  3110400, 0x743c4335
-0,         21,         21,        1,  3110400, 0xd3d28565
-0,         22,         22,        1,  3110400, 0x2ab3a5a2
-0,         23,         23,        1,  3110400, 0x9141f68e
-0,         24,         24,        1,  3110400, 0xe90fac3b
-0,         25,         25,        1,  3110400, 0xdc8e496d
-0,         26,         26,        1,  3110400, 0x4ea216b9
-0,         27,         27,        1,  3110400, 0xd1f8a08e
-0,         28,         28,        1,  3110400, 0x2b512b98
-0,         29,         29,        1,  3110400, 0x6af060b6
-0,         30,         30,        1,  3110400, 0x69389c02
-0,         31,         31,        1,  3110400, 0x7a8cef2f
-0,         32,         32,        1,  3110400, 0x8f5bd7eb
-0,         33,         33,        1,  3110400, 0x3960d741
-0,         34,         34,        1,  3110400, 0x86c2c23b
-0,         35,         35,        1,  3110400, 0x6d0d258a
-0,         36,         36,        1,  3110400, 0xaff6795b
-0,         37,         37,        1,  3110400, 0x97b9cb1e
-0,         38,         38,        1,  3110400, 0x5966d391
-0,         39,         39,        1,  3110400, 0xb9c90726
-0,         40,         40,        1,  3110400, 0x3ab5836d
-0,         41,         41,        1,  3110400, 0xcc3c95e7
-0,         42,         42,        1,  3110400, 0x190df1ce
-0,         43,         43,        1,  3110400, 0x64e6f266
-0,         44,         44,        1,  3110400, 0x98dfdcdd
-0,         45,         45,        1,  3110400, 0xd8889aff
-0,         46,         46,        1,  3110400, 0x969775b8
-0,         47,         47,        1,  3110400, 0x8f3dec20
-0,         48,         48,        1,  3110400, 0xbd2b80ca
-0,         49,         49,        1,  3110400, 0x68baa6f7
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DSLICE_B_HHI_5 b/deps/libav/tests/ref/fate/hevc-conformance-DSLICE_B_HHI_5
deleted file mode 100644
index 7626d76..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DSLICE_B_HHI_5
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0x96995c57
-0,          1,          1,        1,  3110400, 0x2924a10f
-0,          2,          2,        1,  3110400, 0x892e146c
-0,          3,          3,        1,  3110400, 0x9b0b8733
-0,          4,          4,        1,  3110400, 0xb09ffc2d
-0,          5,          5,        1,  3110400, 0x588e04a0
-0,          6,          6,        1,  3110400, 0xa9ed178c
-0,          7,          7,        1,  3110400, 0x54254788
-0,          8,          8,        1,  3110400, 0x4fa444bc
-0,          9,          9,        1,  3110400, 0xe97d958a
-0,         10,         10,        1,  3110400, 0x8e168461
-0,         11,         11,        1,  3110400, 0xc39e551f
-0,         12,         12,        1,  3110400, 0xb5649a69
-0,         13,         13,        1,  3110400, 0x64eb3085
-0,         14,         14,        1,  3110400, 0xb4485019
-0,         15,         15,        1,  3110400, 0x989e4c47
-0,         16,         16,        1,  3110400, 0x0ff21984
-0,         17,         17,        1,  3110400, 0xe81b3ddd
-0,         18,         18,        1,  3110400, 0x6404610f
-0,         19,         19,        1,  3110400, 0xa61c3403
-0,         20,         20,        1,  3110400, 0x033ca068
-0,         21,         21,        1,  3110400, 0x3513dff4
-0,         22,         22,        1,  3110400, 0xe903a3c2
-0,         23,         23,        1,  3110400, 0xd40b3248
-0,         24,         24,        1,  3110400, 0xa257fb35
-0,         25,         25,        1,  3110400, 0x6fcab221
-0,         26,         26,        1,  3110400, 0x079a34c7
-0,         27,         27,        1,  3110400, 0x7308ecbc
-0,         28,         28,        1,  3110400, 0x1cf2dffb
-0,         29,         29,        1,  3110400, 0x59a0a84d
-0,         30,         30,        1,  3110400, 0x6b76450f
-0,         31,         31,        1,  3110400, 0x27de01f3
-0,         32,         32,        1,  3110400, 0x8541fe8b
-0,         33,         33,        1,  3110400, 0x07b740d9
-0,         34,         34,        1,  3110400, 0x735d36e9
-0,         35,         35,        1,  3110400, 0x0336ac98
-0,         36,         36,        1,  3110400, 0xab9f7d33
-0,         37,         37,        1,  3110400, 0xc5f62e67
-0,         38,         38,        1,  3110400, 0x68d6c250
-0,         39,         39,        1,  3110400, 0xaf26c339
-0,         40,         40,        1,  3110400, 0xfa920d0f
-0,         41,         41,        1,  3110400, 0xac9c6a89
-0,         42,         42,        1,  3110400, 0xa0d0cbd0
-0,         43,         43,        1,  3110400, 0x9d517b81
-0,         44,         44,        1,  3110400, 0x3c3b2b89
-0,         45,         45,        1,  3110400, 0x3cf50b0c
-0,         46,         46,        1,  3110400, 0xee319ebe
-0,         47,         47,        1,  3110400, 0x5b7c3397
-0,         48,         48,        1,  3110400, 0x1a089921
-0,         49,         49,        1,  3110400, 0x69718487
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-DSLICE_C_HHI_5 b/deps/libav/tests/ref/fate/hevc-conformance-DSLICE_C_HHI_5
deleted file mode 100644
index c4275cb..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-DSLICE_C_HHI_5
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0x62a2ceab
-0,          1,          1,        1,  3110400, 0x5e4d6adc
-0,          2,          2,        1,  3110400, 0x4ad0955d
-0,          3,          3,        1,  3110400, 0x17fd7b7c
-0,          4,          4,        1,  3110400, 0xe8270ac1
-0,          5,          5,        1,  3110400, 0xbc32bf86
-0,          6,          6,        1,  3110400, 0x13cc365c
-0,          7,          7,        1,  3110400, 0xef503eb5
-0,          8,          8,        1,  3110400, 0xcc9506f4
-0,          9,          9,        1,  3110400, 0xdc213a9e
-0,         10,         10,        1,  3110400, 0xe567c736
-0,         11,         11,        1,  3110400, 0x0a79aad4
-0,         12,         12,        1,  3110400, 0x61773cff
-0,         13,         13,        1,  3110400, 0x2e93a037
-0,         14,         14,        1,  3110400, 0xf419a7bf
-0,         15,         15,        1,  3110400, 0xa57b06bf
-0,         16,         16,        1,  3110400, 0x6e94960a
-0,         17,         17,        1,  3110400, 0x11f22564
-0,         18,         18,        1,  3110400, 0x850e5f7c
-0,         19,         19,        1,  3110400, 0xdfad06af
-0,         20,         20,        1,  3110400, 0xf2912aee
-0,         21,         21,        1,  3110400, 0x57e1c391
-0,         22,         22,        1,  3110400, 0xc8976a8f
-0,         23,         23,        1,  3110400, 0x88fb8b68
-0,         24,         24,        1,  3110400, 0xbe0e314b
-0,         25,         25,        1,  3110400, 0x33ae23f8
-0,         26,         26,        1,  3110400, 0x4db83c5c
-0,         27,         27,        1,  3110400, 0xa5f71a9d
-0,         28,         28,        1,  3110400, 0x34bb4f19
-0,         29,         29,        1,  3110400, 0xb1fee8d9
-0,         30,         30,        1,  3110400, 0x369990b7
-0,         31,         31,        1,  3110400, 0x6bfdbd4a
-0,         32,         32,        1,  3110400, 0x709dd60d
-0,         33,         33,        1,  3110400, 0x4213781c
-0,         34,         34,        1,  3110400, 0x7810dadd
-0,         35,         35,        1,  3110400, 0x1bc02bc6
-0,         36,         36,        1,  3110400, 0x760ed4aa
-0,         37,         37,        1,  3110400, 0xe2b45e4d
-0,         38,         38,        1,  3110400, 0x517b8d0a
-0,         39,         39,        1,  3110400, 0xf145ed7e
-0,         40,         40,        1,  3110400, 0xd8cbc454
-0,         41,         41,        1,  3110400, 0xa80f26f7
-0,         42,         42,        1,  3110400, 0x340a418d
-0,         43,         43,        1,  3110400, 0x5a0f7264
-0,         44,         44,        1,  3110400, 0xf2936a6d
-0,         45,         45,        1,  3110400, 0x841e715b
-0,         46,         46,        1,  3110400, 0xb17e4131
-0,         47,         47,        1,  3110400, 0x40e3ba7b
-0,         48,         48,        1,  3110400, 0x610254f7
-0,         49,         49,        1,  3110400, 0x76aa8b44
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-ENTP_A_LG_2 b/deps/libav/tests/ref/fate/hevc-conformance-ENTP_A_LG_2
deleted file mode 100644
index 5697619..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-ENTP_A_LG_2
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x866449d5
-0,          1,          1,        1,   599040, 0x6a8919f0
-0,          2,          2,        1,   599040, 0x5bec3742
-0,          3,          3,        1,   599040, 0x0e66f78b
-0,          4,          4,        1,   599040, 0x798e543b
-0,          5,          5,        1,   599040, 0x342467e0
-0,          6,          6,        1,   599040, 0x2cb393e1
-0,          7,          7,        1,   599040, 0x2f326539
-0,          8,          8,        1,   599040, 0x8ac6eb6a
-0,          9,          9,        1,   599040, 0x810a887b
-0,         10,         10,        1,   599040, 0x4feb2d60
-0,         11,         11,        1,   599040, 0xd32165ff
-0,         12,         12,        1,   599040, 0x46e505e1
-0,         13,         13,        1,   599040, 0x2d917014
-0,         14,         14,        1,   599040, 0xb504f112
-0,         15,         15,        1,   599040, 0x0fca37ce
-0,         16,         16,        1,   599040, 0x2d5a269d
-0,         17,         17,        1,   599040, 0x3928ef6d
-0,         18,         18,        1,   599040, 0x94397312
-0,         19,         19,        1,   599040, 0xc1c1257b
-0,         20,         20,        1,   599040, 0x4e23adcc
-0,         21,         21,        1,   599040, 0x3eaef1e0
-0,         22,         22,        1,   599040, 0x5e66fa14
-0,         23,         23,        1,   599040, 0x2adfa0c2
-0,         24,         24,        1,   599040, 0xf888db90
-0,         25,         25,        1,   599040, 0xab3a6418
-0,         26,         26,        1,   599040, 0x7689d0a2
-0,         27,         27,        1,   599040, 0x2f5746bf
-0,         28,         28,        1,   599040, 0xad2cf3da
-0,         29,         29,        1,   599040, 0x32f2854e
-0,         30,         30,        1,   599040, 0xb73cf7db
-0,         31,         31,        1,   599040, 0xbe996991
-0,         32,         32,        1,   599040, 0xe66501c8
-0,         33,         33,        1,   599040, 0x12d1bc13
-0,         34,         34,        1,   599040, 0x06e103d5
-0,         35,         35,        1,   599040, 0x49af0680
-0,         36,         36,        1,   599040, 0xdbf128b0
-0,         37,         37,        1,   599040, 0xa1ac770d
-0,         38,         38,        1,   599040, 0x99156429
-0,         39,         39,        1,   599040, 0x8ce1a9a7
-0,         40,         40,        1,   599040, 0x14067700
-0,         41,         41,        1,   599040, 0xcdedccee
-0,         42,         42,        1,   599040, 0x09c12765
-0,         43,         43,        1,   599040, 0x7979a1be
-0,         44,         44,        1,   599040, 0xbd3148d1
-0,         45,         45,        1,   599040, 0xc83f9aac
-0,         46,         46,        1,   599040, 0x91acbae4
-0,         47,         47,        1,   599040, 0xd230907a
-0,         48,         48,        1,   599040, 0x3f6c31f6
-0,         49,         49,        1,   599040, 0x84496e55
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-ENTP_B_LG_2 b/deps/libav/tests/ref/fate/hevc-conformance-ENTP_B_LG_2
deleted file mode 100644
index 0251f30..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-ENTP_B_LG_2
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x95a24137
-0,          1,          1,        1,   599040, 0x7d7f2b75
-0,          2,          2,        1,   599040, 0xd9fb2120
-0,          3,          3,        1,   599040, 0x14d50590
-0,          4,          4,        1,   599040, 0xe3d1b70e
-0,          5,          5,        1,   599040, 0x57708a86
-0,          6,          6,        1,   599040, 0xae56a720
-0,          7,          7,        1,   599040, 0x74c18679
-0,          8,          8,        1,   599040, 0x6422d2a7
-0,          9,          9,        1,   599040, 0xf587702b
-0,         10,         10,        1,   599040, 0x0f630fe0
-0,         11,         11,        1,   599040, 0x4e3537dd
-0,         12,         12,        1,   599040, 0xa645e9c1
-0,         13,         13,        1,   599040, 0x35ab4155
-0,         14,         14,        1,   599040, 0x4b78ba34
-0,         15,         15,        1,   599040, 0xa9a9e572
-0,         16,         16,        1,   599040, 0x6d57f10f
-0,         17,         17,        1,   599040, 0xffb8e333
-0,         18,         18,        1,   599040, 0x7b2d6319
-0,         19,         19,        1,   599040, 0xcf3319aa
-0,         20,         20,        1,   599040, 0xb0d097ee
-0,         21,         21,        1,   599040, 0xf042f780
-0,         22,         22,        1,   599040, 0xfafafdcb
-0,         23,         23,        1,   599040, 0xc8c1c452
-0,         24,         24,        1,   599040, 0x83c4d488
-0,         25,         25,        1,   599040, 0x81a8fd08
-0,         26,         26,        1,   599040, 0x2cb0c333
-0,         27,         27,        1,   599040, 0xa7bf4e52
-0,         28,         28,        1,   599040, 0x5b7ed8e9
-0,         29,         29,        1,   599040, 0x4ff03464
-0,         30,         30,        1,   599040, 0x54a700c2
-0,         31,         31,        1,   599040, 0x7dbb63aa
-0,         32,         32,        1,   599040, 0xda26288e
-0,         33,         33,        1,   599040, 0x8074da41
-0,         34,         34,        1,   599040, 0xa32b2ab2
-0,         35,         35,        1,   599040, 0x51b457fb
-0,         36,         36,        1,   599040, 0x05e34953
-0,         37,         37,        1,   599040, 0x68c762d6
-0,         38,         38,        1,   599040, 0x11bf469e
-0,         39,         39,        1,   599040, 0xc2fdadaf
-0,         40,         40,        1,   599040, 0x05588da0
-0,         41,         41,        1,   599040, 0x8855f927
-0,         42,         42,        1,   599040, 0x11c85d5a
-0,         43,         43,        1,   599040, 0x7a0aede5
-0,         44,         44,        1,   599040, 0x39dc4f7d
-0,         45,         45,        1,   599040, 0x388f81d6
-0,         46,         46,        1,   599040, 0x2afa830d
-0,         47,         47,        1,   599040, 0xd7f26886
-0,         48,         48,        1,   599040, 0xb8e12aef
-0,         49,         49,        1,   599040, 0x73f7582c
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-ENTP_C_LG_3 b/deps/libav/tests/ref/fate/hevc-conformance-ENTP_C_LG_3
deleted file mode 100644
index 3c0946e..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-ENTP_C_LG_3
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0xaea1c3d6
-0,          1,          1,        1,  3110400, 0x665b4f52
-0,          2,          2,        1,  3110400, 0xc7da58a2
-0,          3,          3,        1,  3110400, 0x1dda6461
-0,          4,          4,        1,  3110400, 0x1d8d6eaf
-0,          5,          5,        1,  3110400, 0x7a29911a
-0,          6,          6,        1,  3110400, 0x0dce92c9
-0,          7,          7,        1,  3110400, 0x79c84570
-0,          8,          8,        1,  3110400, 0x736ef1e7
-0,          9,          9,        1,  3110400, 0x9dd86492
-0,         10,         10,        1,  3110400, 0x0ea31a1b
-0,         11,         11,        1,  3110400, 0x0d84fdc8
-0,         12,         12,        1,  3110400, 0x06ed89a7
-0,         13,         13,        1,  3110400, 0xfaea4fd6
-0,         14,         14,        1,  3110400, 0xe787abe8
-0,         15,         15,        1,  3110400, 0x050b653a
-0,         16,         16,        1,  3110400, 0x35cc1ec1
-0,         17,         17,        1,  3110400, 0x86a43e07
-0,         18,         18,        1,  3110400, 0xa6ab021e
-0,         19,         19,        1,  3110400, 0x491e0efa
-0,         20,         20,        1,  3110400, 0x8f210c38
-0,         21,         21,        1,  3110400, 0x637af0d0
-0,         22,         22,        1,  3110400, 0x47a59197
-0,         23,         23,        1,  3110400, 0x53e04637
-0,         24,         24,        1,  3110400, 0x7b99325e
-0,         25,         25,        1,  3110400, 0x972aa252
-0,         26,         26,        1,  3110400, 0xe76ef917
-0,         27,         27,        1,  3110400, 0x7a25babc
-0,         28,         28,        1,  3110400, 0x3bee3c5c
-0,         29,         29,        1,  3110400, 0xbae82bcb
-0,         30,         30,        1,  3110400, 0x5b65c1e5
-0,         31,         31,        1,  3110400, 0xa546266f
-0,         32,         32,        1,  3110400, 0x5c5b9b8e
-0,         33,         33,        1,  3110400, 0xec29c804
-0,         34,         34,        1,  3110400, 0x384efc7d
-0,         35,         35,        1,  3110400, 0x6c1aaa23
-0,         36,         36,        1,  3110400, 0x55494f9f
-0,         37,         37,        1,  3110400, 0xa9c56fec
-0,         38,         38,        1,  3110400, 0x49c29ef2
-0,         39,         39,        1,  3110400, 0xac24fdd4
-0,         40,         40,        1,  3110400, 0x403d8213
-0,         41,         41,        1,  3110400, 0xf2d8aefe
-0,         42,         42,        1,  3110400, 0x2884f0e1
-0,         43,         43,        1,  3110400, 0x69a0a781
-0,         44,         44,        1,  3110400, 0x3ab6114c
-0,         45,         45,        1,  3110400, 0x1d4425a2
-0,         46,         46,        1,  3110400, 0x59f8970a
-0,         47,         47,        1,  3110400, 0xfe0a05a9
-0,         48,         48,        1,  3110400, 0x50b9be4f
-0,         49,         49,        1,  3110400, 0x3e1b65bd
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-EXT_A_ericsson_4 b/deps/libav/tests/ref/fate/hevc-conformance-EXT_A_ericsson_4
deleted file mode 100644
index bf4616a..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-EXT_A_ericsson_4
+++ /dev/null
@@ -1,4 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8ce7200b
-0,          1,          1,        1,   149760, 0xf97412f6
-0,          2,          2,        1,   149760, 0x0ea132c4
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-IPRED_A_docomo_2 b/deps/libav/tests/ref/fate/hevc-conformance-IPRED_A_docomo_2
deleted file mode 100644
index 33878fd..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-IPRED_A_docomo_2
+++ /dev/null
@@ -1,21 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xac658d10
-0,          1,          1,        1,   599040, 0xe3f65389
-0,          2,          2,        1,   599040, 0xfbd644b0
-0,          3,          3,        1,   599040, 0x3ac49569
-0,          4,          4,        1,   599040, 0x75abc5e2
-0,          5,          5,        1,   599040, 0xe787ddcd
-0,          6,          6,        1,   599040, 0x1df5f293
-0,          7,          7,        1,   599040, 0xa87774aa
-0,          8,          8,        1,   599040, 0x42b2bec6
-0,          9,          9,        1,   599040, 0x89f22378
-0,         10,         10,        1,   599040, 0x0d4e5397
-0,         11,         11,        1,   599040, 0xf4430d13
-0,         12,         12,        1,   599040, 0xfd2ff520
-0,         13,         13,        1,   599040, 0x21bf374b
-0,         14,         14,        1,   599040, 0xcba1032e
-0,         15,         15,        1,   599040, 0x58247f24
-0,         16,         16,        1,   599040, 0x7985788a
-0,         17,         17,        1,   599040, 0x3306488e
-0,         18,         18,        1,   599040, 0x8bcbf22e
-0,         19,         19,        1,   599040, 0xb7a7ae5c
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-IPRED_B_Nokia_3 b/deps/libav/tests/ref/fate/hevc-conformance-IPRED_B_Nokia_3
deleted file mode 100644
index 4de7c3c..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-IPRED_B_Nokia_3
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0x11ef5ddd
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-IPRED_C_Mitsubishi_2 b/deps/libav/tests/ref/fate/hevc-conformance-IPRED_C_Mitsubishi_2
deleted file mode 100644
index bff448b..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-IPRED_C_Mitsubishi_2
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x9a8664e6
-0,          1,          1,        1,   599040, 0x72f15982
-0,          2,          2,        1,   599040, 0xc6610a7b
-0,          3,          3,        1,   599040, 0x091d3a93
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-LS_A_Orange_2 b/deps/libav/tests/ref/fate/hevc-conformance-LS_A_Orange_2
deleted file mode 100644
index 4dd4ad4..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-LS_A_Orange_2
+++ /dev/null
@@ -1,10 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x94a51701
-0,          1,          1,        1,   149760, 0x67c71885
-0,          2,          2,        1,   149760, 0x218f1751
-0,          3,          3,        1,   149760, 0x56951bef
-0,          4,          4,        1,   149760, 0x76aec81e
-0,          5,          5,        1,   149760, 0x20df61ac
-0,          6,          6,        1,   149760, 0x2eacf616
-0,          7,          7,        1,   149760, 0x06322ce2
-0,          8,          8,        1,   149760, 0xf14aa104
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-LS_B_ORANGE_4 b/deps/libav/tests/ref/fate/hevc-conformance-LS_B_ORANGE_4
deleted file mode 100644
index 34dc379..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-LS_B_ORANGE_4
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x25267761
-0,          1,          1,        1,   599040, 0x4b4b6846
-0,          2,          2,        1,   599040, 0x78e251e8
-0,          3,          3,        1,   599040, 0xd5b261b0
-0,          4,          4,        1,   599040, 0x2c4cf4e1
-0,          5,          5,        1,   599040, 0x67dc648f
-0,          6,          6,        1,   599040, 0x3c43bffc
-0,          7,          7,        1,   599040, 0x43dca917
-0,          8,          8,        1,   599040, 0x86c9915e
-0,          9,          9,        1,   599040, 0xcfc4f95c
-0,         10,         10,        1,   599040, 0x1ad40bab
-0,         11,         11,        1,   599040, 0x88b5419e
-0,         12,         12,        1,   599040, 0x94e89a06
-0,         13,         13,        1,   599040, 0x3c68f4a6
-0,         14,         14,        1,   599040, 0xc573ac93
-0,         15,         15,        1,   599040, 0x3c401779
-0,         16,         16,        1,   599040, 0x33358319
-0,         17,         17,        1,   599040, 0xbecb022e
-0,         18,         18,        1,   599040, 0x824ca6c1
-0,         19,         19,        1,   599040, 0x9d13a2b8
-0,         20,         20,        1,   599040, 0xbdd4b44b
-0,         21,         21,        1,   599040, 0x7e43e7e9
-0,         22,         22,        1,   599040, 0x88c39a97
-0,         23,         23,        1,   599040, 0xe0462f05
-0,         24,         24,        1,   599040, 0xc5651fd1
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-LTRPSPS_A_Qualcomm_1 b/deps/libav/tests/ref/fate/hevc-conformance-LTRPSPS_A_Qualcomm_1
deleted file mode 100644
index ddf25c9..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-LTRPSPS_A_Qualcomm_1
+++ /dev/null
@@ -1,501 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xcfffa013
-0,          1,          1,        1,   149760, 0x8ae80654
-0,          2,          2,        1,   149760, 0xa79915b8
-0,          3,          3,        1,   149760, 0xcc5d4a1e
-0,          4,          4,        1,   149760, 0x80636df7
-0,          5,          5,        1,   149760, 0xbd9ab94a
-0,          6,          6,        1,   149760, 0xb7c9ecc5
-0,          7,          7,        1,   149760, 0xbb8607fc
-0,          8,          8,        1,   149760, 0x82c62409
-0,          9,          9,        1,   149760, 0xdc1a9149
-0,         10,         10,        1,   149760, 0x3d55ac92
-0,         11,         11,        1,   149760, 0x398ad055
-0,         12,         12,        1,   149760, 0xd7c2c80b
-0,         13,         13,        1,   149760, 0x17b0e967
-0,         14,         14,        1,   149760, 0x0463f30b
-0,         15,         15,        1,   149760, 0x73d31d58
-0,         16,         16,        1,   149760, 0xaeee2c07
-0,         17,         17,        1,   149760, 0xcd98831c
-0,         18,         18,        1,   149760, 0x38798b8c
-0,         19,         19,        1,   149760, 0x11a6a0d5
-0,         20,         20,        1,   149760, 0x5e509f19
-0,         21,         21,        1,   149760, 0x399ec835
-0,         22,         22,        1,   149760, 0x0250e3c1
-0,         23,         23,        1,   149760, 0xd62510a1
-0,         24,         24,        1,   149760, 0x715016ac
-0,         25,         25,        1,   149760, 0x1f4e9aae
-0,         26,         26,        1,   149760, 0xd27fa636
-0,         27,         27,        1,   149760, 0x55369ec0
-0,         28,         28,        1,   149760, 0x77ffa34e
-0,         29,         29,        1,   149760, 0x5589f2c0
-0,         30,         30,        1,   149760, 0x99c2e78a
-0,         31,         31,        1,   149760, 0xd7e9ff76
-0,         32,         32,        1,   149760, 0xd4437e12
-0,         33,         33,        1,   149760, 0x3af7b718
-0,         34,         34,        1,   149760, 0x6de8bb92
-0,         35,         35,        1,   149760, 0xd523ca09
-0,         36,         36,        1,   149760, 0x44ccbf86
-0,         37,         37,        1,   149760, 0x8eddf1a0
-0,         38,         38,        1,   149760, 0xf554f120
-0,         39,         39,        1,   149760, 0x75bd170c
-0,         40,         40,        1,   149760, 0x4cf40a64
-0,         41,         41,        1,   149760, 0xefe64d68
-0,         42,         42,        1,   149760, 0xa48e7572
-0,         43,         43,        1,   149760, 0x0773b154
-0,         44,         44,        1,   149760, 0x304a8bb9
-0,         45,         45,        1,   149760, 0x6b219051
-0,         46,         46,        1,   149760, 0xbb9b68a3
-0,         47,         47,        1,   149760, 0x060d7cc8
-0,         48,         48,        1,   149760, 0x49317bcb
-0,         49,         49,        1,   149760, 0xac3c9a38
-0,         50,         50,        1,   149760, 0x2f1ea025
-0,         51,         51,        1,   149760, 0x2b87b9b8
-0,         52,         52,        1,   149760, 0x9024bdc9
-0,         53,         53,        1,   149760, 0xa7d1f5c5
-0,         54,         54,        1,   149760, 0x4d590628
-0,         55,         55,        1,   149760, 0x0a65166a
-0,         56,         56,        1,   149760, 0x9f4f350b
-0,         57,         57,        1,   149760, 0x8a40990d
-0,         58,         58,        1,   149760, 0x75f4ad20
-0,         59,         59,        1,   149760, 0xb3aadfd2
-0,         60,         60,        1,   149760, 0xb23df15d
-0,         61,         61,        1,   149760, 0xff99a695
-0,         62,         62,        1,   149760, 0x710963d7
-0,         63,         63,        1,   149760, 0x7c497146
-0,         64,         64,        1,   149760, 0xd3378be9
-0,         65,         65,        1,   149760, 0x0c449d3b
-0,         66,         66,        1,   149760, 0xcb16554e
-0,         67,         67,        1,   149760, 0xeb5e62d5
-0,         68,         68,        1,   149760, 0xc9b8125a
-0,         69,         69,        1,   149760, 0x8c6b2b56
-0,         70,         70,        1,   149760, 0xaba92f83
-0,         71,         71,        1,   149760, 0xc0a45d8a
-0,         72,         72,        1,   149760, 0x72a17719
-0,         73,         73,        1,   149760, 0x98037887
-0,         74,         74,        1,   149760, 0xb752b50b
-0,         75,         75,        1,   149760, 0x91520f28
-0,         76,         76,        1,   149760, 0x58d7f7cb
-0,         77,         77,        1,   149760, 0x8c639e33
-0,         78,         78,        1,   149760, 0xda16eeed
-0,         79,         79,        1,   149760, 0xfcb7fd52
-0,         80,         80,        1,   149760, 0x193fd521
-0,         81,         81,        1,   149760, 0x51cca11e
-0,         82,         82,        1,   149760, 0x8606cc0f
-0,         83,         83,        1,   149760, 0xa588bdfc
-0,         84,         84,        1,   149760, 0x3f828b28
-0,         85,         85,        1,   149760, 0x7a9d6a9f
-0,         86,         86,        1,   149760, 0xf963ded3
-0,         87,         87,        1,   149760, 0x9d4452bb
-0,         88,         88,        1,   149760, 0x474399bf
-0,         89,         89,        1,   149760, 0x934cdcea
-0,         90,         90,        1,   149760, 0x32efebce
-0,         91,         91,        1,   149760, 0xb9ba01ba
-0,         92,         92,        1,   149760, 0xcdb63f42
-0,         93,         93,        1,   149760, 0x4ca2b3fc
-0,         94,         94,        1,   149760, 0xf5b3fae3
-0,         95,         95,        1,   149760, 0xac216fee
-0,         96,         96,        1,   149760, 0x8753dbea
-0,         97,         97,        1,   149760, 0x605c5d19
-0,         98,         98,        1,   149760, 0x441f3093
-0,         99,         99,        1,   149760, 0x586d3630
-0,        100,        100,        1,   149760, 0xb3678490
-0,        101,        101,        1,   149760, 0xc6c90b12
-0,        102,        102,        1,   149760, 0xb103185e
-0,        103,        103,        1,   149760, 0x92a10168
-0,        104,        104,        1,   149760, 0xa77ae265
-0,        105,        105,        1,   149760, 0x14def17a
-0,        106,        106,        1,   149760, 0x0468ea5a
-0,        107,        107,        1,   149760, 0x078832be
-0,        108,        108,        1,   149760, 0xf353fe88
-0,        109,        109,        1,   149760, 0xa42d3435
-0,        110,        110,        1,   149760, 0xd13a85ea
-0,        111,        111,        1,   149760, 0xd3c2f119
-0,        112,        112,        1,   149760, 0x7ee6c196
-0,        113,        113,        1,   149760, 0xa75aadbc
-0,        114,        114,        1,   149760, 0xbe661a3e
-0,        115,        115,        1,   149760, 0x662cb304
-0,        116,        116,        1,   149760, 0x32a7a688
-0,        117,        117,        1,   149760, 0xedf4ff9f
-0,        118,        118,        1,   149760, 0x3d036dbc
-0,        119,        119,        1,   149760, 0x525025d2
-0,        120,        120,        1,   149760, 0x9ab72bd2
-0,        121,        121,        1,   149760, 0xbf401309
-0,        122,        122,        1,   149760, 0xaab6d421
-0,        123,        123,        1,   149760, 0x3713ce39
-0,        124,        124,        1,   149760, 0x5054b38d
-0,        125,        125,        1,   149760, 0x40211b8d
-0,        126,        126,        1,   149760, 0x769d8bcc
-0,        127,        127,        1,   149760, 0xa3b428d7
-0,        128,        128,        1,   149760, 0x3d4df3de
-0,        129,        129,        1,   149760, 0xa1338ae9
-0,        130,        130,        1,   149760, 0xb12f8c9a
-0,        131,        131,        1,   149760, 0x43cc9612
-0,        132,        132,        1,   149760, 0xcbc4b7ce
-0,        133,        133,        1,   149760, 0xae2e2b7c
-0,        134,        134,        1,   149760, 0x685403bd
-0,        135,        135,        1,   149760, 0x1362c52f
-0,        136,        136,        1,   149760, 0x2a7cf8e7
-0,        137,        137,        1,   149760, 0x2863f3a4
-0,        138,        138,        1,   149760, 0xa94bc07d
-0,        139,        139,        1,   149760, 0xe025b2f7
-0,        140,        140,        1,   149760, 0x0c56ce13
-0,        141,        141,        1,   149760, 0x97ce3184
-0,        142,        142,        1,   149760, 0x3761313f
-0,        143,        143,        1,   149760, 0x7bf850ba
-0,        144,        144,        1,   149760, 0xa7d02257
-0,        145,        145,        1,   149760, 0xb64c79ae
-0,        146,        146,        1,   149760, 0x36a610b8
-0,        147,        147,        1,   149760, 0xc4946568
-0,        148,        148,        1,   149760, 0x89a29ed8
-0,        149,        149,        1,   149760, 0x5040a1e2
-0,        150,        150,        1,   149760, 0x3daa53ba
-0,        151,        151,        1,   149760, 0xbca6b7c2
-0,        152,        152,        1,   149760, 0x540af705
-0,        153,        153,        1,   149760, 0x524e8012
-0,        154,        154,        1,   149760, 0x2cfd69dd
-0,        155,        155,        1,   149760, 0x6d222afd
-0,        156,        156,        1,   149760, 0xf522489b
-0,        157,        157,        1,   149760, 0x18357f2f
-0,        158,        158,        1,   149760, 0x38c58007
-0,        159,        159,        1,   149760, 0xb367598b
-0,        160,        160,        1,   149760, 0xeaee7801
-0,        161,        161,        1,   149760, 0x6ec20703
-0,        162,        162,        1,   149760, 0x19b61bbe
-0,        163,        163,        1,   149760, 0x81d328ab
-0,        164,        164,        1,   149760, 0x6f5555eb
-0,        165,        165,        1,   149760, 0x7706277a
-0,        166,        166,        1,   149760, 0x45a7e27a
-0,        167,        167,        1,   149760, 0xd30a2c09
-0,        168,        168,        1,   149760, 0x13fdcefc
-0,        169,        169,        1,   149760, 0x952bf8f5
-0,        170,        170,        1,   149760, 0x18a627d7
-0,        171,        171,        1,   149760, 0x33838dc4
-0,        172,        172,        1,   149760, 0x0b81d369
-0,        173,        173,        1,   149760, 0x9a85acb5
-0,        174,        174,        1,   149760, 0x6bee543e
-0,        175,        175,        1,   149760, 0xff9563dc
-0,        176,        176,        1,   149760, 0x15177760
-0,        177,        177,        1,   149760, 0xc2ca9fcd
-0,        178,        178,        1,   149760, 0xe14290cf
-0,        179,        179,        1,   149760, 0x113a84ed
-0,        180,        180,        1,   149760, 0x423b83ac
-0,        181,        181,        1,   149760, 0x64c37fa9
-0,        182,        182,        1,   149760, 0x07a324fc
-0,        183,        183,        1,   149760, 0xb7a5dd83
-0,        184,        184,        1,   149760, 0xc9c65cfe
-0,        185,        185,        1,   149760, 0xecab5ab0
-0,        186,        186,        1,   149760, 0x04240342
-0,        187,        187,        1,   149760, 0x6d6ec6ea
-0,        188,        188,        1,   149760, 0x18e1413a
-0,        189,        189,        1,   149760, 0x4602403a
-0,        190,        190,        1,   149760, 0x9a4c03b4
-0,        191,        191,        1,   149760, 0x7b93bd44
-0,        192,        192,        1,   149760, 0xa72ecc38
-0,        193,        193,        1,   149760, 0xb4bc1591
-0,        194,        194,        1,   149760, 0x6c8e40b4
-0,        195,        195,        1,   149760, 0x5adb674b
-0,        196,        196,        1,   149760, 0x223f68e5
-0,        197,        197,        1,   149760, 0x6257d660
-0,        198,        198,        1,   149760, 0xade0f8af
-0,        199,        199,        1,   149760, 0xe5834d9a
-0,        200,        200,        1,   149760, 0x593b7957
-0,        201,        201,        1,   149760, 0x278109dc
-0,        202,        202,        1,   149760, 0x9e46908e
-0,        203,        203,        1,   149760, 0x221b16c6
-0,        204,        204,        1,   149760, 0x26f1387b
-0,        205,        205,        1,   149760, 0xfe87a439
-0,        206,        206,        1,   149760, 0x79a2aa13
-0,        207,        207,        1,   149760, 0xd9d6ed45
-0,        208,        208,        1,   149760, 0xc4bde65b
-0,        209,        209,        1,   149760, 0x3f4c2558
-0,        210,        210,        1,   149760, 0x2bce7b58
-0,        211,        211,        1,   149760, 0x76468d74
-0,        212,        212,        1,   149760, 0x3c8ceb15
-0,        213,        213,        1,   149760, 0x6d55430f
-0,        214,        214,        1,   149760, 0x2500386a
-0,        215,        215,        1,   149760, 0x5c220604
-0,        216,        216,        1,   149760, 0xc8c5e3c7
-0,        217,        217,        1,   149760, 0xb35b12d3
-0,        218,        218,        1,   149760, 0x47bbea46
-0,        219,        219,        1,   149760, 0xd15acaff
-0,        220,        220,        1,   149760, 0xf1a35a2f
-0,        221,        221,        1,   149760, 0xf9d845e0
-0,        222,        222,        1,   149760, 0x87cfe711
-0,        223,        223,        1,   149760, 0xf6f2d8a5
-0,        224,        224,        1,   149760, 0x167b5401
-0,        225,        225,        1,   149760, 0x33f355c2
-0,        226,        226,        1,   149760, 0xd0d66b7c
-0,        227,        227,        1,   149760, 0xb676a0ad
-0,        228,        228,        1,   149760, 0x987cbc29
-0,        229,        229,        1,   149760, 0x5fb71596
-0,        230,        230,        1,   149760, 0xf993350a
-0,        231,        231,        1,   149760, 0x586a6ae0
-0,        232,        232,        1,   149760, 0x3b678b28
-0,        233,        233,        1,   149760, 0x45a1c869
-0,        234,        234,        1,   149760, 0xa4ccfdeb
-0,        235,        235,        1,   149760, 0x5ff52df9
-0,        236,        236,        1,   149760, 0x84c01dee
-0,        237,        237,        1,   149760, 0x8d4ed483
-0,        238,        238,        1,   149760, 0x9b4f466f
-0,        239,        239,        1,   149760, 0x954dfaed
-0,        240,        240,        1,   149760, 0xae07d9cd
-0,        241,        241,        1,   149760, 0xf81ecbe8
-0,        242,        242,        1,   149760, 0xdb6f97f7
-0,        243,        243,        1,   149760, 0x1b1b50f4
-0,        244,        244,        1,   149760, 0xbd450e28
-0,        245,        245,        1,   149760, 0x1307a938
-0,        246,        246,        1,   149760, 0xb2af5ddd
-0,        247,        247,        1,   149760, 0xbf80377d
-0,        248,        248,        1,   149760, 0x230b0fbb
-0,        249,        249,        1,   149760, 0x365afaa8
-0,        250,        250,        1,   149760, 0xe517dcb0
-0,        251,        251,        1,   149760, 0xfa1dcda3
-0,        252,        252,        1,   149760, 0x4908b5a1
-0,        253,        253,        1,   149760, 0x423a9ebd
-0,        254,        254,        1,   149760, 0x1145a6d1
-0,        255,        255,        1,   149760, 0x4f40a141
-0,        256,        256,        1,   149760, 0x851e84de
-0,        257,        257,        1,   149760, 0x1709a3cd
-0,        258,        258,        1,   149760, 0x3dace2eb
-0,        259,        259,        1,   149760, 0x3e9d4890
-0,        260,        260,        1,   149760, 0xea53610c
-0,        261,        261,        1,   149760, 0xe50f2ee9
-0,        262,        262,        1,   149760, 0x59a16fc6
-0,        263,        263,        1,   149760, 0x9bee92d8
-0,        264,        264,        1,   149760, 0xf3047aed
-0,        265,        265,        1,   149760, 0x30f922ed
-0,        266,        266,        1,   149760, 0x4eb5c685
-0,        267,        267,        1,   149760, 0xf688d9e5
-0,        268,        268,        1,   149760, 0xf5f5ec81
-0,        269,        269,        1,   149760, 0xa5667bdc
-0,        270,        270,        1,   149760, 0x9a64c3f1
-0,        271,        271,        1,   149760, 0x0fbe3441
-0,        272,        272,        1,   149760, 0xf67f517c
-0,        273,        273,        1,   149760, 0x97155c90
-0,        274,        274,        1,   149760, 0xe41fde38
-0,        275,        275,        1,   149760, 0xdf140d56
-0,        276,        276,        1,   149760, 0x5ae5f31b
-0,        277,        277,        1,   149760, 0x13238d0a
-0,        278,        278,        1,   149760, 0x53a867a4
-0,        279,        279,        1,   149760, 0xbc6327fa
-0,        280,        280,        1,   149760, 0x34ce9cda
-0,        281,        281,        1,   149760, 0x07b6d6f4
-0,        282,        282,        1,   149760, 0x271e7299
-0,        283,        283,        1,   149760, 0x2e53d61b
-0,        284,        284,        1,   149760, 0x5ec6c37a
-0,        285,        285,        1,   149760, 0x2284efdc
-0,        286,        286,        1,   149760, 0x5c59625b
-0,        287,        287,        1,   149760, 0x93965c3b
-0,        288,        288,        1,   149760, 0x4eaa64c0
-0,        289,        289,        1,   149760, 0xde7fd5b7
-0,        290,        290,        1,   149760, 0x00f2fdf1
-0,        291,        291,        1,   149760, 0xb7daf9f2
-0,        292,        292,        1,   149760, 0x988d751e
-0,        293,        293,        1,   149760, 0x5c8baa8e
-0,        294,        294,        1,   149760, 0xcdea5c41
-0,        295,        295,        1,   149760, 0x22d0cddc
-0,        296,        296,        1,   149760, 0xd913bba8
-0,        297,        297,        1,   149760, 0xba74650e
-0,        298,        298,        1,   149760, 0x01af4f86
-0,        299,        299,        1,   149760, 0xc4e60d8a
-0,        300,        300,        1,   149760, 0x1a193c1c
-0,        301,        301,        1,   149760, 0x7f66ab93
-0,        302,        302,        1,   149760, 0xa47c8c5a
-0,        303,        303,        1,   149760, 0x221d4c1c
-0,        304,        304,        1,   149760, 0xadd8f1e7
-0,        305,        305,        1,   149760, 0xa8224d8e
-0,        306,        306,        1,   149760, 0xca2dc482
-0,        307,        307,        1,   149760, 0x74110b2d
-0,        308,        308,        1,   149760, 0x1c2271df
-0,        309,        309,        1,   149760, 0xb1dbae7e
-0,        310,        310,        1,   149760, 0x0932826d
-0,        311,        311,        1,   149760, 0x386f191d
-0,        312,        312,        1,   149760, 0x11863aa3
-0,        313,        313,        1,   149760, 0x0a07f11f
-0,        314,        314,        1,   149760, 0x164d047a
-0,        315,        315,        1,   149760, 0xb79fa393
-0,        316,        316,        1,   149760, 0x83d4eba8
-0,        317,        317,        1,   149760, 0x4d8dad20
-0,        318,        318,        1,   149760, 0x5bd2ae35
-0,        319,        319,        1,   149760, 0xedbfcbf6
-0,        320,        320,        1,   149760, 0x4e3c1463
-0,        321,        321,        1,   149760, 0x79564bd9
-0,        322,        322,        1,   149760, 0x3d84e6f5
-0,        323,        323,        1,   149760, 0x2117e35d
-0,        324,        324,        1,   149760, 0xa7e71f6e
-0,        325,        325,        1,   149760, 0xc4db38cf
-0,        326,        326,        1,   149760, 0x1fb89dc7
-0,        327,        327,        1,   149760, 0x2606f7fc
-0,        328,        328,        1,   149760, 0x232478d4
-0,        329,        329,        1,   149760, 0x5ee6d57a
-0,        330,        330,        1,   149760, 0xc9dcad6a
-0,        331,        331,        1,   149760, 0x9190e77f
-0,        332,        332,        1,   149760, 0x9c4770a6
-0,        333,        333,        1,   149760, 0x58e4f194
-0,        334,        334,        1,   149760, 0x2fdcc67c
-0,        335,        335,        1,   149760, 0xaaede6fd
-0,        336,        336,        1,   149760, 0x676c3f9b
-0,        337,        337,        1,   149760, 0xd420e536
-0,        338,        338,        1,   149760, 0x6dc24987
-0,        339,        339,        1,   149760, 0xc6368607
-0,        340,        340,        1,   149760, 0x34620402
-0,        341,        341,        1,   149760, 0xd98da63e
-0,        342,        342,        1,   149760, 0xeb724c79
-0,        343,        343,        1,   149760, 0x4ba2c1f5
-0,        344,        344,        1,   149760, 0x2795fc4c
-0,        345,        345,        1,   149760, 0x0e7ece9a
-0,        346,        346,        1,   149760, 0x6ac54741
-0,        347,        347,        1,   149760, 0xb96fd2cc
-0,        348,        348,        1,   149760, 0x117291e5
-0,        349,        349,        1,   149760, 0x87415084
-0,        350,        350,        1,   149760, 0x8f73b005
-0,        351,        351,        1,   149760, 0xda24dd2d
-0,        352,        352,        1,   149760, 0xbb7a0383
-0,        353,        353,        1,   149760, 0x31b6d2ad
-0,        354,        354,        1,   149760, 0x87f8b103
-0,        355,        355,        1,   149760, 0xc2c41bca
-0,        356,        356,        1,   149760, 0xf021cb64
-0,        357,        357,        1,   149760, 0x19809718
-0,        358,        358,        1,   149760, 0x81247b86
-0,        359,        359,        1,   149760, 0x2326d770
-0,        360,        360,        1,   149760, 0x2b27c7ee
-0,        361,        361,        1,   149760, 0xa9ce4ef4
-0,        362,        362,        1,   149760, 0x0de330b8
-0,        363,        363,        1,   149760, 0xf8c14fc9
-0,        364,        364,        1,   149760, 0x3264e471
-0,        365,        365,        1,   149760, 0x410e8591
-0,        366,        366,        1,   149760, 0xb38f2ea9
-0,        367,        367,        1,   149760, 0xf4fbcbea
-0,        368,        368,        1,   149760, 0x60935dc0
-0,        369,        369,        1,   149760, 0x98f4cfb4
-0,        370,        370,        1,   149760, 0xab0156db
-0,        371,        371,        1,   149760, 0x0bd8e392
-0,        372,        372,        1,   149760, 0x6b4701c1
-0,        373,        373,        1,   149760, 0xe94b1bea
-0,        374,        374,        1,   149760, 0x86d932fb
-0,        375,        375,        1,   149760, 0xebb7cf5b
-0,        376,        376,        1,   149760, 0xb4022144
-0,        377,        377,        1,   149760, 0xb61506a3
-0,        378,        378,        1,   149760, 0xd48b1fa0
-0,        379,        379,        1,   149760, 0xd4b7ecaf
-0,        380,        380,        1,   149760, 0x9296f641
-0,        381,        381,        1,   149760, 0x976e816a
-0,        382,        382,        1,   149760, 0xd4d1e34e
-0,        383,        383,        1,   149760, 0xe34fd75b
-0,        384,        384,        1,   149760, 0x9a926a62
-0,        385,        385,        1,   149760, 0x3fb24f62
-0,        386,        386,        1,   149760, 0x0e7840af
-0,        387,        387,        1,   149760, 0x1cb583c4
-0,        388,        388,        1,   149760, 0x24c4fd96
-0,        389,        389,        1,   149760, 0x923493e0
-0,        390,        390,        1,   149760, 0xd4755d80
-0,        391,        391,        1,   149760, 0x9cd4b85c
-0,        392,        392,        1,   149760, 0xd01aa4ad
-0,        393,        393,        1,   149760, 0x55e09c4f
-0,        394,        394,        1,   149760, 0x09a873b6
-0,        395,        395,        1,   149760, 0x915a4408
-0,        396,        396,        1,   149760, 0x714aeafb
-0,        397,        397,        1,   149760, 0x8941f5b8
-0,        398,        398,        1,   149760, 0x1fe23244
-0,        399,        399,        1,   149760, 0x1663a392
-0,        400,        400,        1,   149760, 0x91b4d995
-0,        401,        401,        1,   149760, 0xb4fc80b0
-0,        402,        402,        1,   149760, 0x02523fbb
-0,        403,        403,        1,   149760, 0xc6d16d89
-0,        404,        404,        1,   149760, 0xd1d899be
-0,        405,        405,        1,   149760, 0x03c55283
-0,        406,        406,        1,   149760, 0x581b2f1a
-0,        407,        407,        1,   149760, 0xac93eb35
-0,        408,        408,        1,   149760, 0x21d0573b
-0,        409,        409,        1,   149760, 0xda4f9ea4
-0,        410,        410,        1,   149760, 0x2a04ad09
-0,        411,        411,        1,   149760, 0x46d9c0fc
-0,        412,        412,        1,   149760, 0x90b79b33
-0,        413,        413,        1,   149760, 0x6cadf70b
-0,        414,        414,        1,   149760, 0xb4f294a4
-0,        415,        415,        1,   149760, 0xc6d599d2
-0,        416,        416,        1,   149760, 0xec332a7f
-0,        417,        417,        1,   149760, 0x1e4c9fea
-0,        418,        418,        1,   149760, 0xadacff11
-0,        419,        419,        1,   149760, 0x63ffacab
-0,        420,        420,        1,   149760, 0xcc504bbf
-0,        421,        421,        1,   149760, 0xfd9002d4
-0,        422,        422,        1,   149760, 0xe338cabf
-0,        423,        423,        1,   149760, 0x89ab95bd
-0,        424,        424,        1,   149760, 0x932602d1
-0,        425,        425,        1,   149760, 0x063a9a8a
-0,        426,        426,        1,   149760, 0xd07c1d2c
-0,        427,        427,        1,   149760, 0x1016fee6
-0,        428,        428,        1,   149760, 0xe778f595
-0,        429,        429,        1,   149760, 0x5c46d12a
-0,        430,        430,        1,   149760, 0xe50e7d26
-0,        431,        431,        1,   149760, 0x6ef2149d
-0,        432,        432,        1,   149760, 0x5c1c475c
-0,        433,        433,        1,   149760, 0xd1af09dd
-0,        434,        434,        1,   149760, 0x91e38b8e
-0,        435,        435,        1,   149760, 0xe8f0fb1e
-0,        436,        436,        1,   149760, 0xabef97c8
-0,        437,        437,        1,   149760, 0x7a2a5abd
-0,        438,        438,        1,   149760, 0xc74774f0
-0,        439,        439,        1,   149760, 0x47d17c54
-0,        440,        440,        1,   149760, 0x849f8860
-0,        441,        441,        1,   149760, 0xe81e0022
-0,        442,        442,        1,   149760, 0xa572c832
-0,        443,        443,        1,   149760, 0x7670f316
-0,        444,        444,        1,   149760, 0x67556784
-0,        445,        445,        1,   149760, 0x42b2af9d
-0,        446,        446,        1,   149760, 0x731e17c8
-0,        447,        447,        1,   149760, 0x491f3ed7
-0,        448,        448,        1,   149760, 0xdb9d163d
-0,        449,        449,        1,   149760, 0x7282e4d6
-0,        450,        450,        1,   149760, 0x8d6dc686
-0,        451,        451,        1,   149760, 0x2d413343
-0,        452,        452,        1,   149760, 0x27a05c87
-0,        453,        453,        1,   149760, 0x0edfe7c8
-0,        454,        454,        1,   149760, 0xf2fb72cd
-0,        455,        455,        1,   149760, 0x0c046074
-0,        456,        456,        1,   149760, 0xbd2ffeec
-0,        457,        457,        1,   149760, 0xdb849b70
-0,        458,        458,        1,   149760, 0xc8193666
-0,        459,        459,        1,   149760, 0x7dab4b05
-0,        460,        460,        1,   149760, 0x83a94327
-0,        461,        461,        1,   149760, 0x56a2ca36
-0,        462,        462,        1,   149760, 0x7d20c938
-0,        463,        463,        1,   149760, 0xcba79c1b
-0,        464,        464,        1,   149760, 0xea020d13
-0,        465,        465,        1,   149760, 0xf188d8ca
-0,        466,        466,        1,   149760, 0xecec2c0f
-0,        467,        467,        1,   149760, 0xec7e6c6e
-0,        468,        468,        1,   149760, 0x10f4bd53
-0,        469,        469,        1,   149760, 0xe91a78f9
-0,        470,        470,        1,   149760, 0x996b5fe0
-0,        471,        471,        1,   149760, 0xafff2efb
-0,        472,        472,        1,   149760, 0x5270e8d7
-0,        473,        473,        1,   149760, 0x24f548b6
-0,        474,        474,        1,   149760, 0xe4b5ffe6
-0,        475,        475,        1,   149760, 0x59c7f7da
-0,        476,        476,        1,   149760, 0x4a7b30a2
-0,        477,        477,        1,   149760, 0xbe5829b3
-0,        478,        478,        1,   149760, 0x70226e30
-0,        479,        479,        1,   149760, 0xfbba9558
-0,        480,        480,        1,   149760, 0x2cb89025
-0,        481,        481,        1,   149760, 0x18e2a4ad
-0,        482,        482,        1,   149760, 0xf50dce5e
-0,        483,        483,        1,   149760, 0x9f87c44f
-0,        484,        484,        1,   149760, 0xbfdc521d
-0,        485,        485,        1,   149760, 0xa06f5b06
-0,        486,        486,        1,   149760, 0xa169a6fe
-0,        487,        487,        1,   149760, 0xce6280d4
-0,        488,        488,        1,   149760, 0x056c21d6
-0,        489,        489,        1,   149760, 0xdf7177ef
-0,        490,        490,        1,   149760, 0x1097459b
-0,        491,        491,        1,   149760, 0xf00518a4
-0,        492,        492,        1,   149760, 0x6969b893
-0,        493,        493,        1,   149760, 0xfc3ce0af
-0,        494,        494,        1,   149760, 0x53cf36b5
-0,        495,        495,        1,   149760, 0xdef7e027
-0,        496,        496,        1,   149760, 0xff11e733
-0,        497,        497,        1,   149760, 0x4ffd5d92
-0,        498,        498,        1,   149760, 0x96f0bb4a
-0,        499,        499,        1,   149760, 0x7b04dd15
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MAXBINS_A_TI_4 b/deps/libav/tests/ref/fate/hevc-conformance-MAXBINS_A_TI_4
deleted file mode 100644
index 9110cf6..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MAXBINS_A_TI_4
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x9cad90f9
-0,          1,          1,        1,   149760, 0x7deeab1c
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MAXBINS_B_TI_4 b/deps/libav/tests/ref/fate/hevc-conformance-MAXBINS_B_TI_4
deleted file mode 100644
index 5cad961..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MAXBINS_B_TI_4
+++ /dev/null
@@ -1,4 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x211e8487
-0,          1,          1,        1,   149760, 0xa53b13d8
-0,          2,          2,        1,   149760, 0xb63cc103
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MAXBINS_C_TI_4 b/deps/libav/tests/ref/fate/hevc-conformance-MAXBINS_C_TI_4
deleted file mode 100644
index 2eb3843..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MAXBINS_C_TI_4
+++ /dev/null
@@ -1,4 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xa8d7adfa
-0,          1,          1,        1,   149760, 0x76d1ddfe
-0,          2,          2,        1,   149760, 0x56599cae
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_A_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-MERGE_A_TI_3
deleted file mode 100644
index 0ab6acc..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_A_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0x16eb25a8
-0,          2,          2,        1,   149760, 0xcfff29c8
-0,          3,          3,        1,   149760, 0x4c9721e9
-0,          4,          4,        1,   149760, 0xee52e28d
-0,          5,          5,        1,   149760, 0xc25d9657
-0,          6,          6,        1,   149760, 0x0f644c82
-0,          7,          7,        1,   149760, 0x6f57aea1
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_B_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-MERGE_B_TI_3
deleted file mode 100644
index 2f9395f..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_B_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0xb5932505
-0,          2,          2,        1,   149760, 0xa5b20e66
-0,          3,          3,        1,   149760, 0x0d9f17cb
-0,          4,          4,        1,   149760, 0xf2b1dc80
-0,          5,          5,        1,   149760, 0xab8c8272
-0,          6,          6,        1,   149760, 0x50662cf4
-0,          7,          7,        1,   149760, 0x83cc8d5f
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_C_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-MERGE_C_TI_3
deleted file mode 100644
index bcc5a1a..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_C_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0x88cb1216
-0,          2,          2,        1,   149760, 0x6d1024da
-0,          3,          3,        1,   149760, 0x90b13981
-0,          4,          4,        1,   149760, 0x4296ed51
-0,          5,          5,        1,   149760, 0x4da5926f
-0,          6,          6,        1,   149760, 0xa74b4368
-0,          7,          7,        1,   149760, 0x518fb0fc
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_D_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-MERGE_D_TI_3
deleted file mode 100644
index 7b4df26..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_D_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0x3220183c
-0,          2,          2,        1,   149760, 0x43a21acc
-0,          3,          3,        1,   149760, 0x7bde17f9
-0,          4,          4,        1,   149760, 0x98a1cece
-0,          5,          5,        1,   149760, 0x3d7b64b9
-0,          6,          6,        1,   149760, 0xd9311172
-0,          7,          7,        1,   149760, 0x90d192a3
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_E_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-MERGE_E_TI_3
deleted file mode 100644
index 8491172..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_E_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0x187419b5
-0,          2,          2,        1,   149760, 0x61100980
-0,          3,          3,        1,   149760, 0xd799123e
-0,          4,          4,        1,   149760, 0x9011c8d0
-0,          5,          5,        1,   149760, 0xeafe7d99
-0,          6,          6,        1,   149760, 0x94f32245
-0,          7,          7,        1,   149760, 0x8185910a
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_F_MTK_4 b/deps/libav/tests/ref/fate/hevc-conformance-MERGE_F_MTK_4
deleted file mode 100644
index 34a0979..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_F_MTK_4
+++ /dev/null
@@ -1,42 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xcfffa013
-0,          1,          1,        1,   149760, 0xec800e71
-0,          2,          2,        1,   149760, 0x9fb014c7
-0,          3,          3,        1,   149760, 0xfd7a48a8
-0,          4,          4,        1,   149760, 0x99816bb5
-0,          5,          5,        1,   149760, 0x8645acaa
-0,          6,          6,        1,   149760, 0xd2a8e04b
-0,          7,          7,        1,   149760, 0xf96f038d
-0,          8,          8,        1,   149760, 0x82c62409
-0,          9,          9,        1,   149760, 0x64907b29
-0,         10,         10,        1,   149760, 0xfe29990e
-0,         11,         11,        1,   149760, 0xce2dc52d
-0,         12,         12,        1,   149760, 0x164fb2c5
-0,         13,         13,        1,   149760, 0xbcf8ca2d
-0,         14,         14,        1,   149760, 0xe59dc9bc
-0,         15,         15,        1,   149760, 0x2ab10400
-0,         16,         16,        1,   149760, 0xef111c81
-0,         17,         17,        1,   149760, 0xd08466b1
-0,         18,         18,        1,   149760, 0x6d356ff0
-0,         19,         19,        1,   149760, 0x16a59175
-0,         20,         20,        1,   149760, 0xd7888866
-0,         21,         21,        1,   149760, 0x2b22b943
-0,         22,         22,        1,   149760, 0x3b4fc3fe
-0,         23,         23,        1,   149760, 0x4ec8ee47
-0,         24,         24,        1,   149760, 0x0126f17b
-0,         25,         25,        1,   149760, 0x1176ad14
-0,         26,         26,        1,   149760, 0x2d4da75f
-0,         27,         27,        1,   149760, 0x144bb9e4
-0,         28,         28,        1,   149760, 0x5176a21b
-0,         29,         29,        1,   149760, 0x5e3fe673
-0,         30,         30,        1,   149760, 0xa533db65
-0,         31,         31,        1,   149760, 0x3009f3f8
-0,         32,         32,        1,   149760, 0xd4437e12
-0,         33,         33,        1,   149760, 0x5b03cd64
-0,         34,         34,        1,   149760, 0xdc40d49b
-0,         35,         35,        1,   149760, 0xf8cef0f6
-0,         36,         36,        1,   149760, 0x241be1b7
-0,         37,         37,        1,   149760, 0x23830404
-0,         38,         38,        1,   149760, 0x6ef7087e
-0,         39,         39,        1,   149760, 0xaf351e5b
-0,         40,         40,        1,   149760, 0x4cf40a64
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_G_HHI_4 b/deps/libav/tests/ref/fate/hevc-conformance-MERGE_G_HHI_4
deleted file mode 100644
index 2e88350..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MERGE_G_HHI_4
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x65433cfe
-0,          1,          1,        1,   599040, 0x9309e2c5
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MVCLIP_A_qualcomm_3 b/deps/libav/tests/ref/fate/hevc-conformance-MVCLIP_A_qualcomm_3
deleted file mode 100644
index 6756221..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MVCLIP_A_qualcomm_3
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xa5b11720
-0,          1,          1,        1,   149760, 0x42e52c6e
-0,          2,          2,        1,   149760, 0x27b15a30
-0,          3,          3,        1,   149760, 0x4d759826
-0,          4,          4,        1,   149760, 0xfb6daf0c
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MVDL1ZERO_A_docomo_3 b/deps/libav/tests/ref/fate/hevc-conformance-MVDL1ZERO_A_docomo_3
deleted file mode 100644
index 2019db2..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MVDL1ZERO_A_docomo_3
+++ /dev/null
@@ -1,501 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x9b27dc7d
-0,          1,          1,        1,   599040, 0x796cdd26
-0,          2,          2,        1,   599040, 0xd3c9dca9
-0,          3,          3,        1,   599040, 0xf7b2876a
-0,          4,          4,        1,   599040, 0x296701c8
-0,          5,          5,        1,   599040, 0xf9a80f9a
-0,          6,          6,        1,   599040, 0x7cbe9656
-0,          7,          7,        1,   599040, 0x17093be8
-0,          8,          8,        1,   599040, 0x2a0e196e
-0,          9,          9,        1,   599040, 0x3492c809
-0,         10,         10,        1,   599040, 0xbc5523f3
-0,         11,         11,        1,   599040, 0xf618ff66
-0,         12,         12,        1,   599040, 0x07060c9d
-0,         13,         13,        1,   599040, 0xd5a8fb5d
-0,         14,         14,        1,   599040, 0x780e18b9
-0,         15,         15,        1,   599040, 0xff553fbd
-0,         16,         16,        1,   599040, 0x715cce2d
-0,         17,         17,        1,   599040, 0x8a834c19
-0,         18,         18,        1,   599040, 0xbc4a0c21
-0,         19,         19,        1,   599040, 0xc85fed31
-0,         20,         20,        1,   599040, 0xcbb97b56
-0,         21,         21,        1,   599040, 0x518111dd
-0,         22,         22,        1,   599040, 0x5a680f48
-0,         23,         23,        1,   599040, 0x02956f28
-0,         24,         24,        1,   599040, 0x10845ef6
-0,         25,         25,        1,   599040, 0x2ad3c6d7
-0,         26,         26,        1,   599040, 0xa9f725e9
-0,         27,         27,        1,   599040, 0xb835f470
-0,         28,         28,        1,   599040, 0x693bf01d
-0,         29,         29,        1,   599040, 0x50bf3b77
-0,         30,         30,        1,   599040, 0x304873e3
-0,         31,         31,        1,   599040, 0x707a6af9
-0,         32,         32,        1,   599040, 0x50bf2017
-0,         33,         33,        1,   599040, 0x2c583f11
-0,         34,         34,        1,   599040, 0xe738080b
-0,         35,         35,        1,   599040, 0x549984e6
-0,         36,         36,        1,   599040, 0xa22e8a96
-0,         37,         37,        1,   599040, 0xc9f222cd
-0,         38,         38,        1,   599040, 0x28d944bc
-0,         39,         39,        1,   599040, 0x2e366350
-0,         40,         40,        1,   599040, 0xbcc2eb12
-0,         41,         41,        1,   599040, 0x074d3fdd
-0,         42,         42,        1,   599040, 0x0e0bd820
-0,         43,         43,        1,   599040, 0xf078af68
-0,         44,         44,        1,   599040, 0xaeed7222
-0,         45,         45,        1,   599040, 0xb66100cd
-0,         46,         46,        1,   599040, 0x848cd1c5
-0,         47,         47,        1,   599040, 0xa6bf930c
-0,         48,         48,        1,   599040, 0x32501b56
-0,         49,         49,        1,   599040, 0x2498d992
-0,         50,         50,        1,   599040, 0x03481b78
-0,         51,         51,        1,   599040, 0x551d7c11
-0,         52,         52,        1,   599040, 0xfbdc629d
-0,         53,         53,        1,   599040, 0x1f438ded
-0,         54,         54,        1,   599040, 0x4d25ce07
-0,         55,         55,        1,   599040, 0x4fe8f8aa
-0,         56,         56,        1,   599040, 0x5d65d790
-0,         57,         57,        1,   599040, 0xfcba4efb
-0,         58,         58,        1,   599040, 0x50b483a3
-0,         59,         59,        1,   599040, 0x12fd4b31
-0,         60,         60,        1,   599040, 0x71014417
-0,         61,         61,        1,   599040, 0xeed88bc4
-0,         62,         62,        1,   599040, 0xb2d4710d
-0,         63,         63,        1,   599040, 0xbe4dfe69
-0,         64,         64,        1,   599040, 0x9b7844b6
-0,         65,         65,        1,   599040, 0xe2e691bf
-0,         66,         66,        1,   599040, 0xb24200dc
-0,         67,         67,        1,   599040, 0xf29cb5bf
-0,         68,         68,        1,   599040, 0x90350310
-0,         69,         69,        1,   599040, 0xbe1cc3c1
-0,         70,         70,        1,   599040, 0xaae58f97
-0,         71,         71,        1,   599040, 0x0d5cb388
-0,         72,         72,        1,   599040, 0x0fa734e3
-0,         73,         73,        1,   599040, 0xaa41543a
-0,         74,         74,        1,   599040, 0x3e6e1d4b
-0,         75,         75,        1,   599040, 0x6426e543
-0,         76,         76,        1,   599040, 0xe65ad058
-0,         77,         77,        1,   599040, 0xf7f1744d
-0,         78,         78,        1,   599040, 0xa8fa32da
-0,         79,         79,        1,   599040, 0xa2c80e49
-0,         80,         80,        1,   599040, 0x22b972e9
-0,         81,         81,        1,   599040, 0x2462823b
-0,         82,         82,        1,   599040, 0xa7fd0432
-0,         83,         83,        1,   599040, 0x38d22ea4
-0,         84,         84,        1,   599040, 0xb472f4d6
-0,         85,         85,        1,   599040, 0x36c107a0
-0,         86,         86,        1,   599040, 0x9abb5ce0
-0,         87,         87,        1,   599040, 0x74b2861c
-0,         88,         88,        1,   599040, 0xba3d04d3
-0,         89,         89,        1,   599040, 0x65132373
-0,         90,         90,        1,   599040, 0x63585754
-0,         91,         91,        1,   599040, 0xa6c0f4d4
-0,         92,         92,        1,   599040, 0xc2cf9c33
-0,         93,         93,        1,   599040, 0xdf6d16af
-0,         94,         94,        1,   599040, 0x94566b11
-0,         95,         95,        1,   599040, 0x8070818d
-0,         96,         96,        1,   599040, 0x4acc92c1
-0,         97,         97,        1,   599040, 0xb520033c
-0,         98,         98,        1,   599040, 0xc82e7058
-0,         99,         99,        1,   599040, 0xb23367bc
-0,        100,        100,        1,   599040, 0x1fa25586
-0,        101,        101,        1,   599040, 0x2b2abbb8
-0,        102,        102,        1,   599040, 0xb9b74546
-0,        103,        103,        1,   599040, 0x4c4a2ef9
-0,        104,        104,        1,   599040, 0x5eb54025
-0,        105,        105,        1,   599040, 0x1e1cbcc6
-0,        106,        106,        1,   599040, 0xc3bf1017
-0,        107,        107,        1,   599040, 0xdbda1761
-0,        108,        108,        1,   599040, 0x19241b7c
-0,        109,        109,        1,   599040, 0x791dda93
-0,        110,        110,        1,   599040, 0x444a152f
-0,        111,        111,        1,   599040, 0x0b69d08b
-0,        112,        112,        1,   599040, 0xd024abae
-0,        113,        113,        1,   599040, 0x724e0d78
-0,        114,        114,        1,   599040, 0x648f9c09
-0,        115,        115,        1,   599040, 0xee114298
-0,        116,        116,        1,   599040, 0x92d1e98f
-0,        117,        117,        1,   599040, 0xb623cb10
-0,        118,        118,        1,   599040, 0xf8e9b414
-0,        119,        119,        1,   599040, 0xe47a0981
-0,        120,        120,        1,   599040, 0xdc78d28d
-0,        121,        121,        1,   599040, 0xd36d9ad5
-0,        122,        122,        1,   599040, 0xe7bea48e
-0,        123,        123,        1,   599040, 0x0dd39d1d
-0,        124,        124,        1,   599040, 0xb66a18ee
-0,        125,        125,        1,   599040, 0x6085d265
-0,        126,        126,        1,   599040, 0xb9ef646b
-0,        127,        127,        1,   599040, 0x544140a4
-0,        128,        128,        1,   599040, 0x9c546327
-0,        129,        129,        1,   599040, 0xd74d4a8e
-0,        130,        130,        1,   599040, 0x98a504e0
-0,        131,        131,        1,   599040, 0x88849351
-0,        132,        132,        1,   599040, 0xa519f6c7
-0,        133,        133,        1,   599040, 0xc548df7f
-0,        134,        134,        1,   599040, 0x8e690444
-0,        135,        135,        1,   599040, 0x5edbdced
-0,        136,        136,        1,   599040, 0xd3e189c2
-0,        137,        137,        1,   599040, 0x286d44a2
-0,        138,        138,        1,   599040, 0xe946f83e
-0,        139,        139,        1,   599040, 0xdc94ae6d
-0,        140,        140,        1,   599040, 0x5d4e95dc
-0,        141,        141,        1,   599040, 0x2c03280f
-0,        142,        142,        1,   599040, 0x368c6b23
-0,        143,        143,        1,   599040, 0x2fc5d2ee
-0,        144,        144,        1,   599040, 0x85e8f3ec
-0,        145,        145,        1,   599040, 0xd1fdcf69
-0,        146,        146,        1,   599040, 0xa663cf5a
-0,        147,        147,        1,   599040, 0x5d644057
-0,        148,        148,        1,   599040, 0xfdd039e0
-0,        149,        149,        1,   599040, 0x9cdb6369
-0,        150,        150,        1,   599040, 0x3c4ca86b
-0,        151,        151,        1,   599040, 0x27ac4d91
-0,        152,        152,        1,   599040, 0x3f13a8bb
-0,        153,        153,        1,   599040, 0xbcd984c5
-0,        154,        154,        1,   599040, 0xa55eb124
-0,        155,        155,        1,   599040, 0xb09c4a47
-0,        156,        156,        1,   599040, 0x0da7fd48
-0,        157,        157,        1,   599040, 0xa01dc374
-0,        158,        158,        1,   599040, 0xe428b3b0
-0,        159,        159,        1,   599040, 0xff3fcc43
-0,        160,        160,        1,   599040, 0xbc5491c1
-0,        161,        161,        1,   599040, 0x34e51a66
-0,        162,        162,        1,   599040, 0xb63f5acd
-0,        163,        163,        1,   599040, 0xe12f417d
-0,        164,        164,        1,   599040, 0x789bb191
-0,        165,        165,        1,   599040, 0x5fdeaa57
-0,        166,        166,        1,   599040, 0x65034250
-0,        167,        167,        1,   599040, 0xab577632
-0,        168,        168,        1,   599040, 0x1338c7eb
-0,        169,        169,        1,   599040, 0x5a84b078
-0,        170,        170,        1,   599040, 0x9f3fd6c2
-0,        171,        171,        1,   599040, 0x23cd7f3f
-0,        172,        172,        1,   599040, 0x43701c5c
-0,        173,        173,        1,   599040, 0x72eff5aa
-0,        174,        174,        1,   599040, 0x858a7280
-0,        175,        175,        1,   599040, 0x5d1da2b1
-0,        176,        176,        1,   599040, 0x2b6fae7b
-0,        177,        177,        1,   599040, 0x3d96cd3f
-0,        178,        178,        1,   599040, 0x5d6d48e5
-0,        179,        179,        1,   599040, 0x829023ee
-0,        180,        180,        1,   599040, 0xeafa5127
-0,        181,        181,        1,   599040, 0x1adf2830
-0,        182,        182,        1,   599040, 0x35f07617
-0,        183,        183,        1,   599040, 0x7aa691e2
-0,        184,        184,        1,   599040, 0xd11b3ed2
-0,        185,        185,        1,   599040, 0x69c12b52
-0,        186,        186,        1,   599040, 0x34fb8557
-0,        187,        187,        1,   599040, 0xd06c84ff
-0,        188,        188,        1,   599040, 0x26338170
-0,        189,        189,        1,   599040, 0x3d24f1e9
-0,        190,        190,        1,   599040, 0x28a99f46
-0,        191,        191,        1,   599040, 0x22421eea
-0,        192,        192,        1,   599040, 0xc53b57eb
-0,        193,        193,        1,   599040, 0x752433b8
-0,        194,        194,        1,   599040, 0x6332eaaa
-0,        195,        195,        1,   599040, 0x559d273f
-0,        196,        196,        1,   599040, 0xe9811056
-0,        197,        197,        1,   599040, 0x61acf706
-0,        198,        198,        1,   599040, 0x3893c930
-0,        199,        199,        1,   599040, 0x5d6d3f58
-0,        200,        200,        1,   599040, 0xb645df35
-0,        201,        201,        1,   599040, 0x6af7f2eb
-0,        202,        202,        1,   599040, 0xeb456cc5
-0,        203,        203,        1,   599040, 0x32abac64
-0,        204,        204,        1,   599040, 0x1327da04
-0,        205,        205,        1,   599040, 0x73ca53b9
-0,        206,        206,        1,   599040, 0xe940d23e
-0,        207,        207,        1,   599040, 0xc6fdf611
-0,        208,        208,        1,   599040, 0xc72e4309
-0,        209,        209,        1,   599040, 0xecab46a1
-0,        210,        210,        1,   599040, 0xb248b91e
-0,        211,        211,        1,   599040, 0xe9aeb62c
-0,        212,        212,        1,   599040, 0x5827cf39
-0,        213,        213,        1,   599040, 0x763a74d6
-0,        214,        214,        1,   599040, 0x232e397c
-0,        215,        215,        1,   599040, 0xe2ef8213
-0,        216,        216,        1,   599040, 0xddcbe94f
-0,        217,        217,        1,   599040, 0xe8a8919a
-0,        218,        218,        1,   599040, 0x5860fae0
-0,        219,        219,        1,   599040, 0x525b1a95
-0,        220,        220,        1,   599040, 0x50e36027
-0,        221,        221,        1,   599040, 0xd05ee599
-0,        222,        222,        1,   599040, 0xc1e7b87b
-0,        223,        223,        1,   599040, 0x2edfa52c
-0,        224,        224,        1,   599040, 0xca147244
-0,        225,        225,        1,   599040, 0x9e0a77b7
-0,        226,        226,        1,   599040, 0x88ac8035
-0,        227,        227,        1,   599040, 0xe34c890a
-0,        228,        228,        1,   599040, 0xbe4feadd
-0,        229,        229,        1,   599040, 0xd5a7503d
-0,        230,        230,        1,   599040, 0xae18e82d
-0,        231,        231,        1,   599040, 0x66cf3881
-0,        232,        232,        1,   599040, 0x9f08a65c
-0,        233,        233,        1,   599040, 0xeb3e1a58
-0,        234,        234,        1,   599040, 0x2b83004a
-0,        235,        235,        1,   599040, 0x65be32c9
-0,        236,        236,        1,   599040, 0x231586fa
-0,        237,        237,        1,   599040, 0x7e5724fb
-0,        238,        238,        1,   599040, 0xfebe47b6
-0,        239,        239,        1,   599040, 0xfeeb9a38
-0,        240,        240,        1,   599040, 0x44e90683
-0,        241,        241,        1,   599040, 0x546d03f4
-0,        242,        242,        1,   599040, 0x211a534e
-0,        243,        243,        1,   599040, 0x12d2a800
-0,        244,        244,        1,   599040, 0xa6022d19
-0,        245,        245,        1,   599040, 0x6bedd152
-0,        246,        246,        1,   599040, 0x6f7de80b
-0,        247,        247,        1,   599040, 0x778f0771
-0,        248,        248,        1,   599040, 0xe63e4241
-0,        249,        249,        1,   599040, 0xa0298023
-0,        250,        250,        1,   599040, 0xc4c5b8b2
-0,        251,        251,        1,   599040, 0xcca64f1c
-0,        252,        252,        1,   599040, 0xfec4d1a0
-0,        253,        253,        1,   599040, 0xcb7c4b80
-0,        254,        254,        1,   599040, 0x0795f7b7
-0,        255,        255,        1,   599040, 0x5f45706c
-0,        256,        256,        1,   599040, 0x927f04d8
-0,        257,        257,        1,   599040, 0x4c201f08
-0,        258,        258,        1,   599040, 0xdb447b37
-0,        259,        259,        1,   599040, 0xae33725e
-0,        260,        260,        1,   599040, 0x474281af
-0,        261,        261,        1,   599040, 0xe198764e
-0,        262,        262,        1,   599040, 0xb226916f
-0,        263,        263,        1,   599040, 0x8a7156a5
-0,        264,        264,        1,   599040, 0x5fe639ab
-0,        265,        265,        1,   599040, 0xaa62b79e
-0,        266,        266,        1,   599040, 0x94618e23
-0,        267,        267,        1,   599040, 0x47ba12f0
-0,        268,        268,        1,   599040, 0xd33c215e
-0,        269,        269,        1,   599040, 0x581e0537
-0,        270,        270,        1,   599040, 0x19dce924
-0,        271,        271,        1,   599040, 0x95329055
-0,        272,        272,        1,   599040, 0x6d2eb80f
-0,        273,        273,        1,   599040, 0x11d5e940
-0,        274,        274,        1,   599040, 0x30aec978
-0,        275,        275,        1,   599040, 0xd742df04
-0,        276,        276,        1,   599040, 0xef9ef4ae
-0,        277,        277,        1,   599040, 0x51d8fb34
-0,        278,        278,        1,   599040, 0xbb6e070a
-0,        279,        279,        1,   599040, 0x785a9813
-0,        280,        280,        1,   599040, 0xb94d8771
-0,        281,        281,        1,   599040, 0x8bd2fe53
-0,        282,        282,        1,   599040, 0x6b600868
-0,        283,        283,        1,   599040, 0x4b1d6a6f
-0,        284,        284,        1,   599040, 0x974f6365
-0,        285,        285,        1,   599040, 0xebefa21d
-0,        286,        286,        1,   599040, 0x8ce62dad
-0,        287,        287,        1,   599040, 0x7a6e6e1b
-0,        288,        288,        1,   599040, 0x3746d218
-0,        289,        289,        1,   599040, 0xc1aa50d9
-0,        290,        290,        1,   599040, 0xda60f976
-0,        291,        291,        1,   599040, 0x98274aa8
-0,        292,        292,        1,   599040, 0xdf09c760
-0,        293,        293,        1,   599040, 0xeb485b8f
-0,        294,        294,        1,   599040, 0xad76453b
-0,        295,        295,        1,   599040, 0x6eaee19a
-0,        296,        296,        1,   599040, 0x464e9cc8
-0,        297,        297,        1,   599040, 0xccd0bd12
-0,        298,        298,        1,   599040, 0xc7345e2b
-0,        299,        299,        1,   599040, 0xe51dd0a9
-0,        300,        300,        1,   599040, 0x11b9586b
-0,        301,        301,        1,   599040, 0xcb2c85b8
-0,        302,        302,        1,   599040, 0x024ce62d
-0,        303,        303,        1,   599040, 0x8c1da4eb
-0,        304,        304,        1,   599040, 0x9924ed3f
-0,        305,        305,        1,   599040, 0xc8f89a61
-0,        306,        306,        1,   599040, 0x52db38f2
-0,        307,        307,        1,   599040, 0xf1baca44
-0,        308,        308,        1,   599040, 0x8d1b322e
-0,        309,        309,        1,   599040, 0x5e8a990e
-0,        310,        310,        1,   599040, 0xfe281b7c
-0,        311,        311,        1,   599040, 0x065ced47
-0,        312,        312,        1,   599040, 0x962087db
-0,        313,        313,        1,   599040, 0x2e932805
-0,        314,        314,        1,   599040, 0x9a4b4946
-0,        315,        315,        1,   599040, 0x504bea02
-0,        316,        316,        1,   599040, 0xff97cf64
-0,        317,        317,        1,   599040, 0xcca9a61c
-0,        318,        318,        1,   599040, 0x1ab70ff5
-0,        319,        319,        1,   599040, 0x99ed2919
-0,        320,        320,        1,   599040, 0xa02f40d2
-0,        321,        321,        1,   599040, 0x8a1d83c2
-0,        322,        322,        1,   599040, 0xaacec6c2
-0,        323,        323,        1,   599040, 0x4f6fe261
-0,        324,        324,        1,   599040, 0x1dde4745
-0,        325,        325,        1,   599040, 0xa17bdf95
-0,        326,        326,        1,   599040, 0xcb5b56b3
-0,        327,        327,        1,   599040, 0x7088cdd4
-0,        328,        328,        1,   599040, 0xca02bafb
-0,        329,        329,        1,   599040, 0x3c5ca543
-0,        330,        330,        1,   599040, 0x4ab80de3
-0,        331,        331,        1,   599040, 0x75edb57b
-0,        332,        332,        1,   599040, 0x772ef858
-0,        333,        333,        1,   599040, 0xd7fa8d9f
-0,        334,        334,        1,   599040, 0xbc515acc
-0,        335,        335,        1,   599040, 0xb1b66d54
-0,        336,        336,        1,   599040, 0x40290b6a
-0,        337,        337,        1,   599040, 0xd1ff952e
-0,        338,        338,        1,   599040, 0x5641abf7
-0,        339,        339,        1,   599040, 0x3411e0fd
-0,        340,        340,        1,   599040, 0xed4abbaf
-0,        341,        341,        1,   599040, 0x34d40ea4
-0,        342,        342,        1,   599040, 0xa9983db0
-0,        343,        343,        1,   599040, 0x58dc8d9a
-0,        344,        344,        1,   599040, 0x24a989a2
-0,        345,        345,        1,   599040, 0xc9d1dcdd
-0,        346,        346,        1,   599040, 0x6df3031f
-0,        347,        347,        1,   599040, 0xa67339d9
-0,        348,        348,        1,   599040, 0x545b3ed1
-0,        349,        349,        1,   599040, 0xb4d98187
-0,        350,        350,        1,   599040, 0xdd2f8588
-0,        351,        351,        1,   599040, 0x2aee5737
-0,        352,        352,        1,   599040, 0xe7c90c87
-0,        353,        353,        1,   599040, 0xb547f0bc
-0,        354,        354,        1,   599040, 0x69cc594a
-0,        355,        355,        1,   599040, 0xa01adf9c
-0,        356,        356,        1,   599040, 0x77021bc9
-0,        357,        357,        1,   599040, 0x1cd7e74b
-0,        358,        358,        1,   599040, 0x4d284292
-0,        359,        359,        1,   599040, 0xe57fd832
-0,        360,        360,        1,   599040, 0x76992cf7
-0,        361,        361,        1,   599040, 0x88156158
-0,        362,        362,        1,   599040, 0xc872db18
-0,        363,        363,        1,   599040, 0xc0487bf4
-0,        364,        364,        1,   599040, 0x9f3aab7b
-0,        365,        365,        1,   599040, 0xfddd1c86
-0,        366,        366,        1,   599040, 0x2a991cff
-0,        367,        367,        1,   599040, 0x97e3623f
-0,        368,        368,        1,   599040, 0x69e5900a
-0,        369,        369,        1,   599040, 0x7a5167ec
-0,        370,        370,        1,   599040, 0x74bf045a
-0,        371,        371,        1,   599040, 0x5b2c1554
-0,        372,        372,        1,   599040, 0xc7e9c2e1
-0,        373,        373,        1,   599040, 0x9d76e364
-0,        374,        374,        1,   599040, 0x2c365ed8
-0,        375,        375,        1,   599040, 0x3b7bb213
-0,        376,        376,        1,   599040, 0x00a34fa9
-0,        377,        377,        1,   599040, 0x0a82f6b8
-0,        378,        378,        1,   599040, 0x34f8cf6b
-0,        379,        379,        1,   599040, 0x283a256f
-0,        380,        380,        1,   599040, 0x89dfe63a
-0,        381,        381,        1,   599040, 0x757c7bc3
-0,        382,        382,        1,   599040, 0xbcbf4f4a
-0,        383,        383,        1,   599040, 0x45fe93d3
-0,        384,        384,        1,   599040, 0xa93c4724
-0,        385,        385,        1,   599040, 0x25862ef7
-0,        386,        386,        1,   599040, 0xff94b8eb
-0,        387,        387,        1,   599040, 0x9d350c21
-0,        388,        388,        1,   599040, 0x90d6cce5
-0,        389,        389,        1,   599040, 0x5c3e51c8
-0,        390,        390,        1,   599040, 0x8f966096
-0,        391,        391,        1,   599040, 0xddc8ad04
-0,        392,        392,        1,   599040, 0xb64a170a
-0,        393,        393,        1,   599040, 0xfb8fa0c6
-0,        394,        394,        1,   599040, 0x99fa48dc
-0,        395,        395,        1,   599040, 0xd62e9344
-0,        396,        396,        1,   599040, 0x55ff8d51
-0,        397,        397,        1,   599040, 0x1e9809bd
-0,        398,        398,        1,   599040, 0x00f0122d
-0,        399,        399,        1,   599040, 0x5af2911e
-0,        400,        400,        1,   599040, 0xbfcd6c1d
-0,        401,        401,        1,   599040, 0xd809c652
-0,        402,        402,        1,   599040, 0xee36969a
-0,        403,        403,        1,   599040, 0x9c0ed842
-0,        404,        404,        1,   599040, 0x4e07a2b0
-0,        405,        405,        1,   599040, 0xa5b3202b
-0,        406,        406,        1,   599040, 0x4c1add0e
-0,        407,        407,        1,   599040, 0x489b2fa9
-0,        408,        408,        1,   599040, 0xa088c512
-0,        409,        409,        1,   599040, 0x4f6121ac
-0,        410,        410,        1,   599040, 0x1959f62b
-0,        411,        411,        1,   599040, 0x2d51a5c4
-0,        412,        412,        1,   599040, 0x95e70f4f
-0,        413,        413,        1,   599040, 0x4eab3c11
-0,        414,        414,        1,   599040, 0xf2c2b9b5
-0,        415,        415,        1,   599040, 0x62f50ffe
-0,        416,        416,        1,   599040, 0x2104d2f8
-0,        417,        417,        1,   599040, 0x42a8b39f
-0,        418,        418,        1,   599040, 0x857f1fe6
-0,        419,        419,        1,   599040, 0x6ac5190d
-0,        420,        420,        1,   599040, 0x228d7a0b
-0,        421,        421,        1,   599040, 0x0042ef94
-0,        422,        422,        1,   599040, 0x4a83e001
-0,        423,        423,        1,   599040, 0xc43fec08
-0,        424,        424,        1,   599040, 0x5e029548
-0,        425,        425,        1,   599040, 0xbc89dea9
-0,        426,        426,        1,   599040, 0x6c5d88cf
-0,        427,        427,        1,   599040, 0x3a5dabfb
-0,        428,        428,        1,   599040, 0x876e1e54
-0,        429,        429,        1,   599040, 0x55715da8
-0,        430,        430,        1,   599040, 0x199c039b
-0,        431,        431,        1,   599040, 0x0286f71e
-0,        432,        432,        1,   599040, 0xf9a244a1
-0,        433,        433,        1,   599040, 0xf5655275
-0,        434,        434,        1,   599040, 0xde3dba0c
-0,        435,        435,        1,   599040, 0x617f8963
-0,        436,        436,        1,   599040, 0x0fe0e661
-0,        437,        437,        1,   599040, 0x8ba905ea
-0,        438,        438,        1,   599040, 0xb2812b34
-0,        439,        439,        1,   599040, 0x32d61c8b
-0,        440,        440,        1,   599040, 0xb7603400
-0,        441,        441,        1,   599040, 0x232c278f
-0,        442,        442,        1,   599040, 0xdf61c27d
-0,        443,        443,        1,   599040, 0xa053482f
-0,        444,        444,        1,   599040, 0x109724d3
-0,        445,        445,        1,   599040, 0x49d36800
-0,        446,        446,        1,   599040, 0x4a103bff
-0,        447,        447,        1,   599040, 0x7cd3813b
-0,        448,        448,        1,   599040, 0xeef677d7
-0,        449,        449,        1,   599040, 0xc5ad66c2
-0,        450,        450,        1,   599040, 0xa06e472d
-0,        451,        451,        1,   599040, 0x53182cc5
-0,        452,        452,        1,   599040, 0x9e62bfc0
-0,        453,        453,        1,   599040, 0x93515843
-0,        454,        454,        1,   599040, 0x5e0778d7
-0,        455,        455,        1,   599040, 0x957a6d55
-0,        456,        456,        1,   599040, 0x0bc26b3d
-0,        457,        457,        1,   599040, 0x5e0bc514
-0,        458,        458,        1,   599040, 0x7f717a98
-0,        459,        459,        1,   599040, 0x8497968c
-0,        460,        460,        1,   599040, 0x8fb527b8
-0,        461,        461,        1,   599040, 0x8580e487
-0,        462,        462,        1,   599040, 0x59b2d7cc
-0,        463,        463,        1,   599040, 0x5fbc38d7
-0,        464,        464,        1,   599040, 0xb1ba014e
-0,        465,        465,        1,   599040, 0x10481d8f
-0,        466,        466,        1,   599040, 0xd42e42e0
-0,        467,        467,        1,   599040, 0x14a361c1
-0,        468,        468,        1,   599040, 0x58378917
-0,        469,        469,        1,   599040, 0xaeb99a82
-0,        470,        470,        1,   599040, 0x5666ef55
-0,        471,        471,        1,   599040, 0xbd0ce495
-0,        472,        472,        1,   599040, 0xf13af36c
-0,        473,        473,        1,   599040, 0x55e8b101
-0,        474,        474,        1,   599040, 0x4e2966b4
-0,        475,        475,        1,   599040, 0xd973e873
-0,        476,        476,        1,   599040, 0x72d55685
-0,        477,        477,        1,   599040, 0x48eee8c2
-0,        478,        478,        1,   599040, 0x61291b38
-0,        479,        479,        1,   599040, 0x91f839f8
-0,        480,        480,        1,   599040, 0x0a4e9585
-0,        481,        481,        1,   599040, 0x02e0f1f0
-0,        482,        482,        1,   599040, 0xc104009c
-0,        483,        483,        1,   599040, 0x9417127e
-0,        484,        484,        1,   599040, 0x4630302e
-0,        485,        485,        1,   599040, 0x692141ea
-0,        486,        486,        1,   599040, 0x1ebed0bd
-0,        487,        487,        1,   599040, 0x362544a8
-0,        488,        488,        1,   599040, 0xd9cbef36
-0,        489,        489,        1,   599040, 0x54cda997
-0,        490,        490,        1,   599040, 0x79463ed1
-0,        491,        491,        1,   599040, 0xe95b66eb
-0,        492,        492,        1,   599040, 0x5bdaa63e
-0,        493,        493,        1,   599040, 0x72ced562
-0,        494,        494,        1,   599040, 0xcb2bdc53
-0,        495,        495,        1,   599040, 0x4ff80855
-0,        496,        496,        1,   599040, 0x68515ba6
-0,        497,        497,        1,   599040, 0x56228d2d
-0,        498,        498,        1,   599040, 0xb72a68ed
-0,        499,        499,        1,   599040, 0x111cc604
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-MVEDGE_A_qualcomm_3 b/deps/libav/tests/ref/fate/hevc-conformance-MVEDGE_A_qualcomm_3
deleted file mode 100644
index 0db06c5..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-MVEDGE_A_qualcomm_3
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x1d68213a
-0,          1,          1,        1,   149760, 0x9cc81d30
-0,          2,          2,        1,   149760, 0xa3cf6438
-0,          3,          3,        1,   149760, 0x6acf213a
-0,          4,          4,        1,   149760, 0x0f75ce7b
-0,          5,          5,        1,   149760, 0x5e0286a7
-0,          6,          6,        1,   149760, 0xc62cd2b0
-0,          7,          7,        1,   149760, 0x7d9af3ac
-0,          8,          8,        1,   149760, 0x9d58afc7
-0,          9,          9,        1,   149760, 0x91c5ad7f
-0,         10,         10,        1,   149760, 0xc43c5b0a
-0,         11,         11,        1,   149760, 0x6b8cc1a5
-0,         12,         12,        1,   149760, 0x4cebb13e
-0,         13,         13,        1,   149760, 0xca136846
-0,         14,         14,        1,   149760, 0xba22e581
-0,         15,         15,        1,   149760, 0x2844ddd3
-0,         16,         16,        1,   149760, 0xf943399e
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-NUT_A_ericsson_5 b/deps/libav/tests/ref/fate/hevc-conformance-NUT_A_ericsson_5
deleted file mode 100644
index fe65880..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-NUT_A_ericsson_5
+++ /dev/null
@@ -1,35 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8ce7200b
-0,          1,          1,        1,   149760, 0x73610669
-0,          2,          2,        1,   149760, 0x42942047
-0,          3,          3,        1,   149760, 0x57334d85
-0,          4,          4,        1,   149760, 0xdd97fbb3
-0,          5,          5,        1,   149760, 0x10469b12
-0,          6,          6,        1,   149760, 0x9b4231f0
-0,          7,          7,        1,   149760, 0x2b295a52
-0,          8,          8,        1,   149760, 0xdaf7c29f
-0,          9,          9,        1,   149760, 0x6798d072
-0,         10,         10,        1,   149760, 0xf77ae91e
-0,         11,         11,        1,   149760, 0xe2d516c9
-0,         12,         12,        1,   149760, 0x5cf0b221
-0,         13,         13,        1,   149760, 0x1d34991e
-0,         14,         14,        1,   149760, 0xb730d93a
-0,         15,         15,        1,   149760, 0x643b1861
-0,         16,         16,        1,   149760, 0x436586ff
-0,         17,         17,        1,   149760, 0xa65d9b80
-0,         18,         18,        1,   149760, 0x1d395210
-0,         19,         19,        1,   149760, 0x0580f2be
-0,         20,         20,        1,   149760, 0x8e4cea96
-0,         21,         21,        1,   149760, 0x6c98d019
-0,         22,         22,        1,   149760, 0x842803c8
-0,         23,         23,        1,   149760, 0xddc196ee
-0,         24,         24,        1,   149760, 0x89e45523
-0,         25,         25,        1,   149760, 0x2a36b008
-0,         26,         26,        1,   149760, 0x14a319f7
-0,         27,         27,        1,   149760, 0x7394854c
-0,         28,         28,        1,   149760, 0x26dcf933
-0,         29,         29,        1,   149760, 0x5b000b7e
-0,         30,         30,        1,   149760, 0x6e76bded
-0,         31,         31,        1,   149760, 0x0284d92d
-0,         32,         32,        1,   149760, 0xf14a25e0
-0,         33,         33,        1,   149760, 0x10c03d98
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_A_Bossen_1 b/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_A_Bossen_1
deleted file mode 100644
index 4c09ca5..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_A_Bossen_1
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1, 13368960, 0x830b3a1d
-0,          1,          1,        1, 13368960, 0x120ca009
-0,          2,          2,        1, 13368960, 0xc94e0d86
-0,          3,          3,        1, 13368960, 0x3e97d237
-0,          4,          4,        1, 13368960, 0x1caaa873
-0,          5,          5,        1, 13368960, 0xc6af86c6
-0,          6,          6,        1, 13368960, 0x277ee61a
-0,          7,          7,        1, 13368960, 0x7832ef4e
-0,          8,          8,        1, 13368960, 0x328142e9
-0,          9,          9,        1, 13368960, 0xbe22f686
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_B_Bossen_1 b/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_B_Bossen_1
deleted file mode 100644
index a3ab7c8..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_B_Bossen_1
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1, 13368960, 0xe1e32c3d
-0,          1,          1,        1, 13368960, 0x75a503d3
-0,          2,          2,        1, 13368960, 0x71f33a0a
-0,          3,          3,        1, 13368960, 0xd9fe5306
-0,          4,          4,        1, 13368960, 0x2528926a
-0,          5,          5,        1, 13368960, 0x4ae4e500
-0,          6,          6,        1, 13368960, 0x01949c16
-0,          7,          7,        1, 13368960, 0x57b6ea2f
-0,          8,          8,        1, 13368960, 0xfd2b2055
-0,          9,          9,        1, 13368960, 0xc4246a9b
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_C_Bossen_1 b/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_C_Bossen_1
deleted file mode 100644
index 10520d1..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_C_Bossen_1
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3339072, 0x28be238d
-0,          1,          1,        1,  3339072, 0x43b62aae
-0,          2,          2,        1,  3339072, 0x36259da6
-0,          3,          3,        1,  3339072, 0xd0dbbc1e
-0,          4,          4,        1,  3339072, 0x20df7c7c
-0,          5,          5,        1,  3339072, 0xb8872e77
-0,          6,          6,        1,  3339072, 0xceb4cce4
-0,          7,          7,        1,  3339072, 0x4ffa1dab
-0,          8,          8,        1,  3339072, 0x1c687703
-0,          9,          9,        1,  3339072, 0x5a0fa46f
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_D_Bossen_1 b/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_D_Bossen_1
deleted file mode 100644
index 6f1c4fb..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PICSIZE_D_Bossen_1
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3339072, 0xcb16f53e
-0,          1,          1,        1,  3339072, 0x6f1da8ec
-0,          2,          2,        1,  3339072, 0x978dae98
-0,          3,          3,        1,  3339072, 0x34becc01
-0,          4,          4,        1,  3339072, 0x9c900137
-0,          5,          5,        1,  3339072, 0x02fe1d40
-0,          6,          6,        1,  3339072, 0xda9703b6
-0,          7,          7,        1,  3339072, 0x73e5ff5a
-0,          8,          8,        1,  3339072, 0xeec94fab
-0,          9,          9,        1,  3339072, 0xf4a36fc5
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_A_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_A_TI_3
deleted file mode 100644
index 8491172..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_A_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0x187419b5
-0,          2,          2,        1,   149760, 0x61100980
-0,          3,          3,        1,   149760, 0xd799123e
-0,          4,          4,        1,   149760, 0x9011c8d0
-0,          5,          5,        1,   149760, 0xeafe7d99
-0,          6,          6,        1,   149760, 0x94f32245
-0,          7,          7,        1,   149760, 0x8185910a
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_B_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_B_TI_3
deleted file mode 100644
index 1f15a02..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_B_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0xcebf1b76
-0,          2,          2,        1,   149760, 0x33930fb0
-0,          3,          3,        1,   149760, 0xb2933277
-0,          4,          4,        1,   149760, 0x2ff5fd5d
-0,          5,          5,        1,   149760, 0x6616a17a
-0,          6,          6,        1,   149760, 0x3abc48ad
-0,          7,          7,        1,   149760, 0xc12491ef
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_C_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_C_TI_3
deleted file mode 100644
index bf474cc..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_C_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0x2c271a9b
-0,          2,          2,        1,   149760, 0x53e419f3
-0,          3,          3,        1,   149760, 0x96c92a29
-0,          4,          4,        1,   149760, 0x62d5e85b
-0,          5,          5,        1,   149760, 0xea307d47
-0,          6,          6,        1,   149760, 0x9cc40dec
-0,          7,          7,        1,   149760, 0x37d977fa
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_D_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_D_TI_3
deleted file mode 100644
index 2af0e1f..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_D_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0xf11a32ce
-0,          2,          2,        1,   149760, 0x0802237c
-0,          3,          3,        1,   149760, 0x366621a7
-0,          4,          4,        1,   149760, 0x89aacefd
-0,          5,          5,        1,   149760, 0xb3837d16
-0,          6,          6,        1,   149760, 0x5f822072
-0,          7,          7,        1,   149760, 0x24cb9377
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_E_TI_3 b/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_E_TI_3
deleted file mode 100644
index df97237..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PMERGE_E_TI_3
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0xea7b30bf
-0,          2,          2,        1,   149760, 0x273d092a
-0,          3,          3,        1,   149760, 0xef4e0ff0
-0,          4,          4,        1,   149760, 0x9805e02c
-0,          5,          5,        1,   149760, 0xdeb17cbc
-0,          6,          6,        1,   149760, 0xe5c903a4
-0,          7,          7,        1,   149760, 0x838d66b9
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-POC_A_Bossen_3 b/deps/libav/tests/ref/fate/hevc-conformance-POC_A_Bossen_3
deleted file mode 100644
index bcfa7fa..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-POC_A_Bossen_3
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xda17acd4
-0,          0,          0,        1,   149760, 0x1691b47f
-0,          1,          1,        1,   149760, 0xeebeac0c
-0,          2,          2,        1,   149760, 0x895c9f62
-0,          3,          3,        1,   149760, 0x9e2077e8
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PPS_A_qualcomm_7 b/deps/libav/tests/ref/fate/hevc-conformance-PPS_A_qualcomm_7
deleted file mode 100644
index ef57f74..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PPS_A_qualcomm_7
+++ /dev/null
@@ -1,82 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x87159328
-0,          1,          1,        1,   599040, 0x825672ff
-0,          2,          2,        1,   599040, 0x2f4224ff
-0,          3,          3,        1,   599040, 0x4be431ff
-0,          4,          4,        1,   599040, 0xa0118b14
-0,          5,          5,        1,   599040, 0x488aac33
-0,          6,          6,        1,   599040, 0x1edd0d4e
-0,          7,          7,        1,   599040, 0x7f4562a2
-0,          8,          8,        1,   599040, 0xe177a7d4
-0,          9,          9,        1,   599040, 0x32d2fd58
-0,         10,         10,        1,   599040, 0x81d50c36
-0,         11,         11,        1,   599040, 0xdf32810d
-0,         12,         12,        1,   599040, 0xc4f50543
-0,         13,         13,        1,   599040, 0x777bfdce
-0,         14,         14,        1,   599040, 0x01db8731
-0,         15,         15,        1,   599040, 0x74ae2b2c
-0,         16,         16,        1,   599040, 0x424e130a
-0,         17,         17,        1,   599040, 0x7002f7c8
-0,         18,         18,        1,   599040, 0xde098c5b
-0,         19,         19,        1,   599040, 0x072ca0e3
-0,         20,         20,        1,   599040, 0x6c50e3ba
-0,         21,         21,        1,   599040, 0xa398c530
-0,         22,         22,        1,   599040, 0xcd8a780a
-0,         23,         23,        1,   599040, 0x7c849e63
-0,         24,         24,        1,   599040, 0xb70e2a1f
-0,         25,         25,        1,   599040, 0xc00d893c
-0,         26,         26,        1,   599040, 0x5da32c94
-0,         27,         27,        1,   599040, 0xc3177b8c
-0,         28,         28,        1,   599040, 0x06668480
-0,         29,         29,        1,   599040, 0xbceeac78
-0,         30,         30,        1,   599040, 0x162d5cd1
-0,         31,         31,        1,   599040, 0x071b71c4
-0,         32,         32,        1,   599040, 0xfe61e0b2
-0,         33,         33,        1,   599040, 0xe78c121f
-0,         34,         34,        1,   599040, 0x3b47c051
-0,         35,         35,        1,   599040, 0x10c1eedd
-0,         36,         36,        1,   599040, 0x09cf2d2c
-0,         37,         37,        1,   599040, 0xc4272450
-0,         38,         38,        1,   599040, 0x3a9e0db7
-0,         39,         39,        1,   599040, 0xe62595ad
-0,         40,         40,        1,   599040, 0xc03669a5
-0,         41,         41,        1,   599040, 0x4fbb058e
-0,         42,         42,        1,   599040, 0xaaee8771
-0,         43,         43,        1,   599040, 0xcc4f3a71
-0,         44,         44,        1,   599040, 0xc5717c31
-0,         45,         45,        1,   599040, 0xe2bc02fc
-0,         46,         46,        1,   599040, 0x380e06eb
-0,         47,         47,        1,   599040, 0x15d4ba04
-0,         48,         48,        1,   599040, 0xb9204342
-0,         49,         49,        1,   599040, 0xb9d9a246
-0,         50,         50,        1,   599040, 0xb5611280
-0,         51,         51,        1,   599040, 0xc80e3909
-0,         52,         52,        1,   599040, 0xef93ecbd
-0,         53,         53,        1,   599040, 0xdd6b435e
-0,         54,         54,        1,   599040, 0x1622f253
-0,         55,         55,        1,   599040, 0x41cd55a6
-0,         56,         56,        1,   599040, 0x7ed864e7
-0,         57,         57,        1,   599040, 0x1604c563
-0,         58,         58,        1,   599040, 0x1d5a3dc9
-0,         59,         59,        1,   599040, 0xa904a8a5
-0,         60,         60,        1,   599040, 0x19c43226
-0,         61,         61,        1,   599040, 0x60d803e0
-0,         62,         62,        1,   599040, 0xe862b0e0
-0,         63,         63,        1,   599040, 0x37c76c51
-0,         64,         64,        1,   599040, 0x8528cc3c
-0,         65,         65,        1,   599040, 0x03ece1f9
-0,         66,         66,        1,   599040, 0x8f0ef28e
-0,         67,         67,        1,   599040, 0x92164007
-0,         68,         68,        1,   599040, 0x9d3c2ecf
-0,         69,         69,        1,   599040, 0xacf536d4
-0,         70,         70,        1,   599040, 0xbdf6165f
-0,         71,         71,        1,   599040, 0xbc19f80a
-0,         72,         72,        1,   599040, 0x128a6480
-0,         73,         73,        1,   599040, 0xb487c333
-0,         74,         74,        1,   599040, 0x8dc350fa
-0,         75,         75,        1,   599040, 0x0043fe96
-0,         76,         76,        1,   599040, 0x47b502a5
-0,         77,         77,        1,   599040, 0xf62b761f
-0,         78,         78,        1,   599040, 0x608f63c3
-0,         79,         79,        1,   599040, 0xe285d93d
-0,         80,         80,        1,   599040, 0x1c3404cf
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PS_A_VIDYO_3 b/deps/libav/tests/ref/fate/hevc-conformance-PS_A_VIDYO_3
deleted file mode 100644
index 8f7e5e6..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PS_A_VIDYO_3
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x88619f80
-0,          1,          1,        1,   149760, 0x550bdaf0
-0,          2,          2,        1,   149760, 0x4121f7a2
-0,          3,          3,        1,   149760, 0x210b1d07
-0,          4,          4,        1,   149760, 0x731b7758
-0,          5,          5,        1,   149760, 0x17adb789
-0,          6,          6,        1,   149760, 0x98b2f080
-0,          7,          7,        1,   149760, 0xc0be1f2a
-0,          8,          8,        1,   149760, 0xc01e387a
-0,          9,          9,        1,   149760, 0xd932822b
-0,         10,         10,        1,   149760, 0x16c0a1df
-0,         11,         11,        1,   149760, 0x5aa6c005
-0,         12,         12,        1,   149760, 0xd3aab602
-0,         13,         13,        1,   149760, 0x4e6ecab1
-0,         14,         14,        1,   149760, 0x8a86f1f2
-0,         15,         15,        1,   149760, 0x2ed21e1b
-0,         16,         16,        1,   149760, 0x80892f24
-0,         17,         17,        1,   149760, 0xb8a952ef
-0,         18,         18,        1,   149760, 0x557e57fb
-0,         19,         19,        1,   149760, 0x2b825b2c
-0,         20,         20,        1,   149760, 0x30b69b5e
-0,         21,         21,        1,   149760, 0x802ebf08
-0,         22,         22,        1,   149760, 0x95aadc8e
-0,         23,         23,        1,   149760, 0x4d4c02b7
-0,         24,         24,        1,   149760, 0x3fdd1762
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-PS_B_VIDYO_3 b/deps/libav/tests/ref/fate/hevc-conformance-PS_B_VIDYO_3
deleted file mode 100644
index 8f7e5e6..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-PS_B_VIDYO_3
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x88619f80
-0,          1,          1,        1,   149760, 0x550bdaf0
-0,          2,          2,        1,   149760, 0x4121f7a2
-0,          3,          3,        1,   149760, 0x210b1d07
-0,          4,          4,        1,   149760, 0x731b7758
-0,          5,          5,        1,   149760, 0x17adb789
-0,          6,          6,        1,   149760, 0x98b2f080
-0,          7,          7,        1,   149760, 0xc0be1f2a
-0,          8,          8,        1,   149760, 0xc01e387a
-0,          9,          9,        1,   149760, 0xd932822b
-0,         10,         10,        1,   149760, 0x16c0a1df
-0,         11,         11,        1,   149760, 0x5aa6c005
-0,         12,         12,        1,   149760, 0xd3aab602
-0,         13,         13,        1,   149760, 0x4e6ecab1
-0,         14,         14,        1,   149760, 0x8a86f1f2
-0,         15,         15,        1,   149760, 0x2ed21e1b
-0,         16,         16,        1,   149760, 0x80892f24
-0,         17,         17,        1,   149760, 0xb8a952ef
-0,         18,         18,        1,   149760, 0x557e57fb
-0,         19,         19,        1,   149760, 0x2b825b2c
-0,         20,         20,        1,   149760, 0x30b69b5e
-0,         21,         21,        1,   149760, 0x802ebf08
-0,         22,         22,        1,   149760, 0x95aadc8e
-0,         23,         23,        1,   149760, 0x4d4c02b7
-0,         24,         24,        1,   149760, 0x3fdd1762
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RAP_A_docomo_4 b/deps/libav/tests/ref/fate/hevc-conformance-RAP_A_docomo_4
deleted file mode 100644
index 268f4cd..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RAP_A_docomo_4
+++ /dev/null
@@ -1,87 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x1ae5f13d
-0,          1,          1,        1,   149760, 0x0a6ad0e3
-0,          2,          2,        1,   149760, 0x2415af05
-0,          3,          3,        1,   149760, 0xf50f6eef
-0,          4,          4,        1,   149760, 0xef65835c
-0,          5,          5,        1,   149760, 0x4929b5cb
-0,          6,          6,        1,   149760, 0x165c6f55
-0,          7,          7,        1,   149760, 0x9caaa249
-0,          8,          8,        1,   149760, 0x6c25c4cf
-0,          9,          9,        1,   149760, 0x4678cef0
-0,         10,         10,        1,   149760, 0x72e04433
-0,         11,         11,        1,   149760, 0x36f8aa9d
-0,         12,         12,        1,   149760, 0x255189ad
-0,         13,         13,        1,   149760, 0x712d7f7f
-0,         14,         14,        1,   149760, 0x4d088988
-0,         15,         15,        1,   149760, 0xc0da3925
-0,         16,         16,        1,   149760, 0x9990db7c
-0,         17,         17,        1,   149760, 0xb02cc0e8
-0,         18,         18,        1,   149760, 0x3e859d8f
-0,         19,         19,        1,   149760, 0xce786bc1
-0,         20,         20,        1,   149760, 0x87555e5f
-0,         21,         21,        1,   149760, 0x3c95fb7e
-0,         22,         22,        1,   149760, 0xf092b65e
-0,         23,         23,        1,   149760, 0x7db2c04c
-0,         24,         24,        1,   149760, 0x7d39eb21
-0,         25,         25,        1,   149760, 0x2cfd7d57
-0,         26,         26,        1,   149760, 0xb1902c06
-0,         27,         27,        1,   149760, 0xe0eae1d7
-0,         28,         28,        1,   149760, 0xf8212977
-0,         29,         29,        1,   149760, 0x6cb31328
-0,         30,         30,        1,   149760, 0x862ab736
-0,         31,         31,        1,   149760, 0xc7a87f44
-0,         32,         32,        1,   149760, 0x8ff7a1a1
-0,         33,         33,        1,   149760, 0xd7bee49b
-0,         34,         34,        1,   149760, 0x1925db84
-0,         35,         35,        1,   149760, 0xf32a7dc6
-0,         36,         36,        1,   149760, 0x02a1e3b6
-0,         37,         37,        1,   149760, 0xb6398aad
-0,         38,         38,        1,   149760, 0xa3756e2d
-0,         39,         39,        1,   149760, 0xf90f3732
-0,         40,         40,        1,   149760, 0x3b05115a
-0,         41,         41,        1,   149760, 0x81ca9bdb
-0,         42,         42,        1,   149760, 0xa75ee938
-0,         43,         43,        1,   149760, 0x9e5c232f
-0,         44,         44,        1,   149760, 0x64cb04e9
-0,         45,         45,        1,   149760, 0x4064df52
-0,         46,         46,        1,   149760, 0x47fa0afc
-0,         47,         47,        1,   149760, 0xd209252e
-0,         48,         48,        1,   149760, 0x2f811f02
-0,         49,         49,        1,   149760, 0x733b6721
-0,         50,         50,        1,   149760, 0x30b12427
-0,         51,         51,        1,   149760, 0xdf58d3e2
-0,         52,         52,        1,   149760, 0xc144d7be
-0,         53,         53,        1,   149760, 0x48f0ac79
-0,         54,         54,        1,   149760, 0xb8d8a2c6
-0,         55,         55,        1,   149760, 0x2a7d916d
-0,         56,         56,        1,   149760, 0xd9d38cd5
-0,         57,         57,        1,   149760, 0xd7c7f9a6
-0,         58,         58,        1,   149760, 0x64d0df7a
-0,         59,         59,        1,   149760, 0x4e365cff
-0,         60,         60,        1,   149760, 0x74bc2a8b
-0,         61,         61,        1,   149760, 0x70a7cd2b
-0,         62,         62,        1,   149760, 0x0836b51e
-0,         63,         63,        1,   149760, 0xbc37b5d7
-0,         64,         64,        1,   149760, 0xb6d651e5
-0,         65,         65,        1,   149760, 0x7aa0e35f
-0,         66,         66,        1,   149760, 0x0fbc89a3
-0,         67,         67,        1,   149760, 0x2ca2f2a6
-0,         68,         68,        1,   149760, 0xf742c5c5
-0,         69,         69,        1,   149760, 0x4117208f
-0,         70,         70,        1,   149760, 0xec392efb
-0,         71,         71,        1,   149760, 0xbfba5063
-0,         72,         72,        1,   149760, 0xb2499f48
-0,         73,         73,        1,   149760, 0xf1183244
-0,         74,         74,        1,   149760, 0x364a6400
-0,         75,         75,        1,   149760, 0xfcfddf36
-0,         76,         76,        1,   149760, 0xbcc1b37e
-0,         77,         77,        1,   149760, 0xab364748
-0,         78,         78,        1,   149760, 0xebb27fcd
-0,         79,         79,        1,   149760, 0xe2e7a723
-0,         80,         80,        1,   149760, 0xf671b5e0
-0,         81,         81,        1,   149760, 0xbf0cc349
-0,         82,         82,        1,   149760, 0xf195d868
-0,         83,         83,        1,   149760, 0xe0097460
-0,         84,         84,        1,   149760, 0x3d4c1812
-0,         85,         85,        1,   149760, 0x133cd867
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 b/deps/libav/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1
deleted file mode 100644
index 4bea997..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1
+++ /dev/null
@@ -1,84 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xb989ae7a
-0,          1,          1,        1,   149760, 0x4765caed
-0,          2,          2,        1,   149760, 0xd908c148
-0,          3,          3,        1,   149760, 0xf6ebd66c
-0,          4,          4,        1,   149760, 0x5d5ea14b
-0,          5,          5,        1,   149760, 0xcc939a7c
-0,          6,          6,        1,   149760, 0xa91b8243
-0,          7,          7,        1,   149760, 0x61926618
-0,          8,          8,        1,   149760, 0xe440099c
-0,          9,          9,        1,   149760, 0x18b88a73
-0,         10,         10,        1,   149760, 0xa669f2a9
-0,         11,         11,        1,   149760, 0xc2f6af3a
-0,         12,         12,        1,   149760, 0x02465354
-0,         13,         13,        1,   149760, 0x54e51ff9
-0,         14,         14,        1,   149760, 0xb9f3c056
-0,         15,         15,        1,   149760, 0x050274f9
-0,         16,         16,        1,   149760, 0xd7a413c1
-0,         17,         17,        1,   149760, 0x6e92cda4
-0,         18,         18,        1,   149760, 0x9cb86d4d
-0,         19,         19,        1,   149760, 0x95f440a3
-0,         20,         20,        1,   149760, 0x6dabd616
-0,         21,         21,        1,   149760, 0xd6a0b62d
-0,         22,         22,        1,   149760, 0x585c811b
-0,         23,         23,        1,   149760, 0x50a4d6fc
-0,         24,         24,        1,   149760, 0xe419eb23
-0,         25,         25,        1,   149760, 0x1f0fc316
-0,         26,         26,        1,   149760, 0xf61dc981
-0,         27,         27,        1,   149760, 0xff34d001
-0,         28,         28,        1,   149760, 0x598be76c
-0,         29,         29,        1,   149760, 0xbb50a4d6
-0,         30,         30,        1,   149760, 0x2add9abd
-0,         31,         31,        1,   149760, 0xd74185c7
-0,         32,         32,        1,   149760, 0xcdad6e8e
-0,         33,         33,        1,   149760, 0x54d704ad
-0,         34,         34,        1,   149760, 0xe52e7fc0
-0,         35,         35,        1,   149760, 0xdb331061
-0,         36,         36,        1,   149760, 0x7dacb973
-0,         37,         37,        1,   149760, 0xfc8d5670
-0,         38,         38,        1,   149760, 0xca9024cd
-0,         39,         39,        1,   149760, 0x7fc9bbc2
-0,         40,         40,        1,   149760, 0xe9c386a9
-0,         41,         41,        1,   149760, 0xd0dd1a21
-0,         42,         42,        1,   149760, 0x4b57d734
-0,         43,         43,        1,   149760, 0x55607afc
-0,         44,         44,        1,   149760, 0x567c3e8b
-0,         45,         45,        1,   149760, 0x312eda16
-0,         46,         46,        1,   149760, 0xafcbacf8
-0,         47,         47,        1,   149760, 0xcbde8420
-0,         48,         48,        1,   149760, 0x88a2f29e
-0,         49,         49,        1,   149760, 0x417bf220
-0,         50,         50,        1,   149760, 0xa454835a
-0,         51,         51,        1,   149760, 0x16bf2871
-0,         52,         52,        1,   149760, 0x51253402
-0,         53,         53,        1,   149760, 0x13822dfd
-0,         54,         54,        1,   149760, 0x5e099d3d
-0,         55,         55,        1,   149760, 0xcc19fe87
-0,         56,         56,        1,   149760, 0x7f5f6ce2
-0,         57,         57,        1,   149760, 0x79797a94
-0,         58,         58,        1,   149760, 0x16f26086
-0,         59,         59,        1,   149760, 0x01aedea3
-0,         60,         60,        1,   149760, 0xcafd3221
-0,         61,         61,        1,   149760, 0xcbd61c1f
-0,         62,         62,        1,   149760, 0xf46839e5
-0,         63,         63,        1,   149760, 0x87fb61ee
-0,         64,         64,        1,   149760, 0x3362678b
-0,         65,         65,        1,   149760, 0x6e7fc851
-0,         66,         66,        1,   149760, 0x33f96449
-0,         67,         67,        1,   149760, 0xd9d05007
-0,         68,         68,        1,   149760, 0x477f2cf2
-0,         69,         69,        1,   149760, 0xe1f9ccd0
-0,         70,         70,        1,   149760, 0xb3ba8cfb
-0,         71,         71,        1,   149760, 0x64787995
-0,         72,         72,        1,   149760, 0xc10de4c4
-0,         73,         73,        1,   149760, 0x18dd343f
-0,         74,         74,        1,   149760, 0xa1c51358
-0,         75,         75,        1,   149760, 0x91fe6361
-0,         76,         76,        1,   149760, 0xeec85f94
-0,         77,         77,        1,   149760, 0x00a57402
-0,         78,         78,        1,   149760, 0x4e88cc16
-0,         79,         79,        1,   149760, 0xdbd51976
-0,         80,         80,        1,   149760, 0xfebf6b1a
-0,         81,         81,        1,   149760, 0x052546d2
-0,         82,         82,        1,   149760, 0x046cd73b
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RPLM_A_qualcomm_4 b/deps/libav/tests/ref/fate/hevc-conformance-RPLM_A_qualcomm_4
deleted file mode 100644
index 372d120..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RPLM_A_qualcomm_4
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xdb5e3b56
-0,          1,          1,        1,   149760, 0xd5320970
-0,          2,          2,        1,   149760, 0x9387ed18
-0,          3,          3,        1,   149760, 0x3ab6fde8
-0,          4,          4,        1,   149760, 0xf5d39a39
-0,          5,          5,        1,   149760, 0xf8c15b34
-0,          6,          6,        1,   149760, 0x12261fdc
-0,          7,          7,        1,   149760, 0x8ed03f57
-0,          8,          8,        1,   149760, 0x04d29f74
-0,          9,          9,        1,   149760, 0x86daf75e
-0,         10,         10,        1,   149760, 0x85d817a4
-0,         11,         11,        1,   149760, 0xf9c97006
-0,         12,         12,        1,   149760, 0x60baf6ad
-0,         13,         13,        1,   149760, 0x7272aa6b
-0,         14,         14,        1,   149760, 0x18e00ede
-0,         15,         15,        1,   149760, 0x60592cfe
-0,         16,         16,        1,   149760, 0x7d49650d
-0,         17,         17,        1,   149760, 0x865e7b22
-0,         18,         18,        1,   149760, 0xad6a33e4
-0,         19,         19,        1,   149760, 0x7c8ab573
-0,         20,         20,        1,   149760, 0x0c7d8afa
-0,         21,         21,        1,   149760, 0xb0e567a3
-0,         22,         22,        1,   149760, 0x3c2ccbf1
-0,         23,         23,        1,   149760, 0x0804aead
-0,         24,         24,        1,   149760, 0x0dcb6756
-0,         25,         25,        1,   149760, 0x99bc82dd
-0,         26,         26,        1,   149760, 0x4d2907f1
-0,         27,         27,        1,   149760, 0xc4c330ff
-0,         28,         28,        1,   149760, 0x6c73cef4
-0,         29,         29,        1,   149760, 0xbaa82ab1
-0,         30,         30,        1,   149760, 0xeea3d591
-0,         31,         31,        1,   149760, 0x8240d007
-0,         32,         32,        1,   149760, 0x698f11e4
-0,         33,         33,        1,   149760, 0x46700948
-0,         34,         34,        1,   149760, 0x819e62d9
-0,         35,         35,        1,   149760, 0x0cfe1471
-0,         36,         36,        1,   149760, 0xf30dc9da
-0,         37,         37,        1,   149760, 0x81ea3390
-0,         38,         38,        1,   149760, 0x85bc8dec
-0,         39,         39,        1,   149760, 0x01d3451a
-0,         40,         40,        1,   149760, 0x626dc94b
-0,         41,         41,        1,   149760, 0xf50f2a66
-0,         42,         42,        1,   149760, 0x6294bc3e
-0,         43,         43,        1,   149760, 0x41427bc1
-0,         44,         44,        1,   149760, 0xe200ecf3
-0,         45,         45,        1,   149760, 0xc44785c5
-0,         46,         46,        1,   149760, 0xadc8c3cf
-0,         47,         47,        1,   149760, 0x6c57fb6d
-0,         48,         48,        1,   149760, 0x139cddc1
-0,         49,         49,        1,   149760, 0xc5c9def6
-0,         50,         50,        1,   149760, 0xa8da3f7b
-0,         51,         51,        1,   149760, 0x21823d13
-0,         52,         52,        1,   149760, 0x00e265fd
-0,         53,         53,        1,   149760, 0x289f21d2
-0,         54,         54,        1,   149760, 0xa96d8d0b
-0,         55,         55,        1,   149760, 0x4e50b434
-0,         56,         56,        1,   149760, 0x4e469eae
-0,         57,         57,        1,   149760, 0x62a258af
-0,         58,         58,        1,   149760, 0xc61beb2b
-0,         59,         59,        1,   149760, 0x15d7853b
-0,         60,         60,        1,   149760, 0xd5b8941b
-0,         61,         61,        1,   149760, 0x6312a7c5
-0,         62,         62,        1,   149760, 0x2da74d59
-0,         63,         63,        1,   149760, 0x5fd72bc7
-0,         64,         64,        1,   149760, 0x4035f027
-0,         65,         65,        1,   149760, 0xbe9992e2
-0,         66,         66,        1,   149760, 0xb96093b8
-0,         67,         67,        1,   149760, 0x1024bd43
-0,         68,         68,        1,   149760, 0x1376a3fe
-0,         69,         69,        1,   149760, 0xdf93ec7f
-0,         70,         70,        1,   149760, 0x17d27bfa
-0,         71,         71,        1,   149760, 0x440cb7aa
-0,         72,         72,        1,   149760, 0x8b230df3
-0,         73,         73,        1,   149760, 0x2526130e
-0,         74,         74,        1,   149760, 0x77926a77
-0,         75,         75,        1,   149760, 0x8562bddc
-0,         76,         76,        1,   149760, 0xda86bb2e
-0,         77,         77,        1,   149760, 0x2b4f921b
-0,         78,         78,        1,   149760, 0xf13bca77
-0,         79,         79,        1,   149760, 0x53e76b99
-0,         80,         80,        1,   149760, 0x29a2f5bb
-0,         81,         81,        1,   149760, 0x83a8c4f8
-0,         82,         82,        1,   149760, 0xbe6d8f45
-0,         83,         83,        1,   149760, 0x03d3bf96
-0,         84,         84,        1,   149760, 0x3a0bd29e
-0,         85,         85,        1,   149760, 0xdb656a22
-0,         86,         86,        1,   149760, 0x557b020e
-0,         87,         87,        1,   149760, 0x573ee5f2
-0,         88,         88,        1,   149760, 0x5484faea
-0,         89,         89,        1,   149760, 0x06bb73ae
-0,         90,         90,        1,   149760, 0x3d4049fa
-0,         91,         91,        1,   149760, 0xe574eedb
-0,         92,         92,        1,   149760, 0x1c46205d
-0,         93,         93,        1,   149760, 0x0c5c322e
-0,         94,         94,        1,   149760, 0x2bbeed95
-0,         95,         95,        1,   149760, 0x225897dc
-0,         96,         96,        1,   149760, 0x0a39aa8b
-0,         97,         97,        1,   149760, 0x3242e156
-0,         98,         98,        1,   149760, 0x1790ee85
-0,         99,         99,        1,   149760, 0x55ef9dac
-0,        100,        100,        1,   149760, 0x98e1c49e
-0,        101,        101,        1,   149760, 0x479a84b5
-0,        102,        102,        1,   149760, 0x1711b4f9
-0,        103,        103,        1,   149760, 0xd7d25fce
-0,        104,        104,        1,   149760, 0x7bde1977
-0,        105,        105,        1,   149760, 0x25777a4d
-0,        106,        106,        1,   149760, 0x7b55ed5f
-0,        107,        107,        1,   149760, 0xb28e59e6
-0,        108,        108,        1,   149760, 0x8314281a
-0,        109,        109,        1,   149760, 0x3a5ceeb3
-0,        110,        110,        1,   149760, 0x33760ed8
-0,        111,        111,        1,   149760, 0x19332370
-0,        112,        112,        1,   149760, 0xf25d1f68
-0,        113,        113,        1,   149760, 0x4d665712
-0,        114,        114,        1,   149760, 0x3e310eb7
-0,        115,        115,        1,   149760, 0xafa3c1bb
-0,        116,        116,        1,   149760, 0xf0b7a7ec
-0,        117,        117,        1,   149760, 0xa88a747a
-0,        118,        118,        1,   149760, 0x7b7e6e85
-0,        119,        119,        1,   149760, 0xbc8f8ede
-0,        120,        120,        1,   149760, 0x449f7d2f
-0,        121,        121,        1,   149760, 0x9bc70c53
-0,        122,        122,        1,   149760, 0x8544dc98
-0,        123,        123,        1,   149760, 0xef687641
-0,        124,        124,        1,   149760, 0x0c962219
-0,        125,        125,        1,   149760, 0x4325ae76
-0,        126,        126,        1,   149760, 0xcec7a18c
-0,        127,        127,        1,   149760, 0x941ee8a2
-0,        128,        128,        1,   149760, 0x3eaf3f55
-0,        129,        129,        1,   149760, 0x5b571274
-0,        130,        130,        1,   149760, 0x0532488a
-0,        131,        131,        1,   149760, 0x893fbaf7
-0,        132,        132,        1,   149760, 0xd0155ddf
-0,        133,        133,        1,   149760, 0x83ec86ee
-0,        134,        134,        1,   149760, 0xedffba86
-0,        135,        135,        1,   149760, 0x838c19de
-0,        136,        136,        1,   149760, 0x8482639d
-0,        137,        137,        1,   149760, 0x9501004d
-0,        138,        138,        1,   149760, 0x1db0525f
-0,        139,        139,        1,   149760, 0x8b431467
-0,        140,        140,        1,   149760, 0x972e7d24
-0,        141,        141,        1,   149760, 0xd8151b94
-0,        142,        142,        1,   149760, 0x1ded6a85
-0,        143,        143,        1,   149760, 0x03497fe2
-0,        144,        144,        1,   149760, 0x07427bb7
-0,        145,        145,        1,   149760, 0x33c085ef
-0,        146,        146,        1,   149760, 0x0feda1d0
-0,        147,        147,        1,   149760, 0xf86930e7
-0,        148,        148,        1,   149760, 0x42c2ea09
-0,        149,        149,        1,   149760, 0xcfb76b86
-0,        150,        150,        1,   149760, 0x672e2fce
-0,        151,        151,        1,   149760, 0xb006ec79
-0,        152,        152,        1,   149760, 0xdbc8511c
-0,        153,        153,        1,   149760, 0x3278b299
-0,        154,        154,        1,   149760, 0xd19fe063
-0,        155,        155,        1,   149760, 0x13bb8951
-0,        156,        156,        1,   149760, 0xec5cfe36
-0,        157,        157,        1,   149760, 0x9381a0e7
-0,        158,        158,        1,   149760, 0x304cf3c0
-0,        159,        159,        1,   149760, 0xd380511c
-0,        160,        160,        1,   149760, 0xbd1abe11
-0,        161,        161,        1,   149760, 0x7b220293
-0,        162,        162,        1,   149760, 0xbbe85931
-0,        163,        163,        1,   149760, 0x316e422a
-0,        164,        164,        1,   149760, 0x5e5db530
-0,        165,        165,        1,   149760, 0xc48d6ddb
-0,        166,        166,        1,   149760, 0x9adf5d65
-0,        167,        167,        1,   149760, 0x2adb94de
-0,        168,        168,        1,   149760, 0xbc052746
-0,        169,        169,        1,   149760, 0xac4d3569
-0,        170,        170,        1,   149760, 0x3cd8fdee
-0,        171,        171,        1,   149760, 0x34bfd6ed
-0,        172,        172,        1,   149760, 0xf72fec4b
-0,        173,        173,        1,   149760, 0xf8c5b374
-0,        174,        174,        1,   149760, 0x28ff7382
-0,        175,        175,        1,   149760, 0xac3b49f4
-0,        176,        176,        1,   149760, 0x9d995a62
-0,        177,        177,        1,   149760, 0xe0b292f1
-0,        178,        178,        1,   149760, 0x4edbd05d
-0,        179,        179,        1,   149760, 0x4fd5038b
-0,        180,        180,        1,   149760, 0x899d2101
-0,        181,        181,        1,   149760, 0x0733f804
-0,        182,        182,        1,   149760, 0xe4297100
-0,        183,        183,        1,   149760, 0x5aff9292
-0,        184,        184,        1,   149760, 0x41eda25c
-0,        185,        185,        1,   149760, 0xb4d7aaf2
-0,        186,        186,        1,   149760, 0xbd99fade
-0,        187,        187,        1,   149760, 0xdea6d265
-0,        188,        188,        1,   149760, 0xa2d3bdcd
-0,        189,        189,        1,   149760, 0x38f8a729
-0,        190,        190,        1,   149760, 0x0a356f1b
-0,        191,        191,        1,   149760, 0x865411a5
-0,        192,        192,        1,   149760, 0xd6720a40
-0,        193,        193,        1,   149760, 0xf40589f9
-0,        194,        194,        1,   149760, 0x0646106d
-0,        195,        195,        1,   149760, 0x88e55688
-0,        196,        196,        1,   149760, 0xda2fce82
-0,        197,        197,        1,   149760, 0xc823200b
-0,        198,        198,        1,   149760, 0xc9513041
-0,        199,        199,        1,   149760, 0x798d0e88
-0,        200,        200,        1,   149760, 0xb6d4f15a
-0,        201,        201,        1,   149760, 0xab5b24a4
-0,        202,        202,        1,   149760, 0x9888aa8d
-0,        203,        203,        1,   149760, 0xbf13bbf4
-0,        204,        204,        1,   149760, 0x5450bb23
-0,        205,        205,        1,   149760, 0x12aec398
-0,        206,        206,        1,   149760, 0xa5e1579a
-0,        207,        207,        1,   149760, 0xbeeb07e1
-0,        208,        208,        1,   149760, 0x209a9f1b
-0,        209,        209,        1,   149760, 0x4d3d1c1a
-0,        210,        210,        1,   149760, 0xb4edd703
-0,        211,        211,        1,   149760, 0xc71adf66
-0,        212,        212,        1,   149760, 0x40006d36
-0,        213,        213,        1,   149760, 0x1c5485c9
-0,        214,        214,        1,   149760, 0xa3d8c9a1
-0,        215,        215,        1,   149760, 0x9bfac6de
-0,        216,        216,        1,   149760, 0xed3b0782
-0,        217,        217,        1,   149760, 0x8f075ce2
-0,        218,        218,        1,   149760, 0xb744fa07
-0,        219,        219,        1,   149760, 0xa9356722
-0,        220,        220,        1,   149760, 0xd792bd01
-0,        221,        221,        1,   149760, 0xa124618b
-0,        222,        222,        1,   149760, 0x7492bb54
-0,        223,        223,        1,   149760, 0x67dcefca
-0,        224,        224,        1,   149760, 0x8a7f716d
-0,        225,        225,        1,   149760, 0x7775bb01
-0,        226,        226,        1,   149760, 0xe4a845e5
-0,        227,        227,        1,   149760, 0x79a3962d
-0,        228,        228,        1,   149760, 0x4f395ad7
-0,        229,        229,        1,   149760, 0x3948ce05
-0,        230,        230,        1,   149760, 0x037e6c07
-0,        231,        231,        1,   149760, 0x91881ae9
-0,        232,        232,        1,   149760, 0x937e2545
-0,        233,        233,        1,   149760, 0xdc892763
-0,        234,        234,        1,   149760, 0x96ebd47f
-0,        235,        235,        1,   149760, 0xfecbf8c6
-0,        236,        236,        1,   149760, 0xe1443808
-0,        237,        237,        1,   149760, 0xe0cd36c0
-0,        238,        238,        1,   149760, 0xb485eb4d
-0,        239,        239,        1,   149760, 0x36edf31f
-0,        240,        240,        1,   149760, 0x988bb97f
-0,        241,        241,        1,   149760, 0xc266c616
-0,        242,        242,        1,   149760, 0x7ec4c3f4
-0,        243,        243,        1,   149760, 0xedf5e2ff
-0,        244,        244,        1,   149760, 0xbdd351e3
-0,        245,        245,        1,   149760, 0x900e194e
-0,        246,        246,        1,   149760, 0x5dc7daad
-0,        247,        247,        1,   149760, 0x1ce37e7e
-0,        248,        248,        1,   149760, 0x15982333
-0,        249,        249,        1,   149760, 0x976bb72e
-0,        250,        250,        1,   149760, 0x0b42e05e
-0,        251,        251,        1,   149760, 0xffbcc758
-0,        252,        252,        1,   149760, 0x6377782d
-0,        253,        253,        1,   149760, 0x8aa42a80
-0,        254,        254,        1,   149760, 0x8e0ab3fd
-0,        255,        255,        1,   149760, 0xdfdd49d4
-0,        256,        256,        1,   149760, 0x2659a6cb
-0,        257,        257,        1,   149760, 0x1e9a3d51
-0,        258,        258,        1,   149760, 0x7a66d80d
-0,        259,        259,        1,   149760, 0x5756a9e9
-0,        260,        260,        1,   149760, 0x0fa8d6dd
-0,        261,        261,        1,   149760, 0x885799a5
-0,        262,        262,        1,   149760, 0xb8d02df7
-0,        263,        263,        1,   149760, 0xd2e2800c
-0,        264,        264,        1,   149760, 0xa26ee27a
-0,        265,        265,        1,   149760, 0x7c86750f
-0,        266,        266,        1,   149760, 0xb4694ea1
-0,        267,        267,        1,   149760, 0x89d0b75a
-0,        268,        268,        1,   149760, 0x92b9af80
-0,        269,        269,        1,   149760, 0x107dd610
-0,        270,        270,        1,   149760, 0x8ad35f55
-0,        271,        271,        1,   149760, 0xccc32cb1
-0,        272,        272,        1,   149760, 0xd08ce4ff
-0,        273,        273,        1,   149760, 0x30bd8d0a
-0,        274,        274,        1,   149760, 0x01b74d14
-0,        275,        275,        1,   149760, 0x79aa7a3b
-0,        276,        276,        1,   149760, 0x5f7a40fc
-0,        277,        277,        1,   149760, 0x8837643e
-0,        278,        278,        1,   149760, 0xb6b66baa
-0,        279,        279,        1,   149760, 0xf4ae17cd
-0,        280,        280,        1,   149760, 0xe0d2546a
-0,        281,        281,        1,   149760, 0x0e118751
-0,        282,        282,        1,   149760, 0x0732e19c
-0,        283,        283,        1,   149760, 0x9cfe27b3
-0,        284,        284,        1,   149760, 0x1c77b242
-0,        285,        285,        1,   149760, 0x25be3938
-0,        286,        286,        1,   149760, 0x735ce859
-0,        287,        287,        1,   149760, 0x2bca0f6e
-0,        288,        288,        1,   149760, 0xcce3eb48
-0,        289,        289,        1,   149760, 0xf3556dd8
-0,        290,        290,        1,   149760, 0xcb2cecb4
-0,        291,        291,        1,   149760, 0x9c489742
-0,        292,        292,        1,   149760, 0xbe25370d
-0,        293,        293,        1,   149760, 0x798ff17f
-0,        294,        294,        1,   149760, 0x2f1a46c4
-0,        295,        295,        1,   149760, 0x7d119bd6
-0,        296,        296,        1,   149760, 0x42ceab74
-0,        297,        297,        1,   149760, 0x6fcbe2ef
-0,        298,        298,        1,   149760, 0x290fe6da
-0,        299,        299,        1,   149760, 0x6b280a24
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RPLM_B_qualcomm_4 b/deps/libav/tests/ref/fate/hevc-conformance-RPLM_B_qualcomm_4
deleted file mode 100644
index a34dcc0..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RPLM_B_qualcomm_4
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x82ff0cca
-0,          1,          1,        1,   149760, 0xcd05ba17
-0,          2,          2,        1,   149760, 0x33a5b924
-0,          3,          3,        1,   149760, 0xc0a8d82f
-0,          4,          4,        1,   149760, 0xa18c8ce6
-0,          5,          5,        1,   149760, 0x4d3c4902
-0,          6,          6,        1,   149760, 0xf118cb2a
-0,          7,          7,        1,   149760, 0xb37643c0
-0,          8,          8,        1,   149760, 0x0d6f8a70
-0,          9,          9,        1,   149760, 0xeaebd0f0
-0,         10,         10,        1,   149760, 0x81cce277
-0,         11,         11,        1,   149760, 0x85f216cc
-0,         12,         12,        1,   149760, 0x799cc7c7
-0,         13,         13,        1,   149760, 0x575f76da
-0,         14,         14,        1,   149760, 0x79e10395
-0,         15,         15,        1,   149760, 0x80f62423
-0,         16,         16,        1,   149760, 0x13657087
-0,         17,         17,        1,   149760, 0xcd147ae1
-0,         18,         18,        1,   149760, 0xcee71159
-0,         19,         19,        1,   149760, 0x6fa7b8d5
-0,         20,         20,        1,   149760, 0xd90bd038
-0,         21,         21,        1,   149760, 0x13eead73
-0,         22,         22,        1,   149760, 0xe2eddfc8
-0,         23,         23,        1,   149760, 0x1f07a4f6
-0,         24,         24,        1,   149760, 0x90b25f59
-0,         25,         25,        1,   149760, 0xd0dd86ba
-0,         26,         26,        1,   149760, 0x3008066c
-0,         27,         27,        1,   149760, 0x74ec54dd
-0,         28,         28,        1,   149760, 0xa423046c
-0,         29,         29,        1,   149760, 0x8a410bca
-0,         30,         30,        1,   149760, 0x55337573
-0,         31,         31,        1,   149760, 0x55d3623c
-0,         32,         32,        1,   149760, 0x699d234b
-0,         33,         33,        1,   149760, 0xbcd029b6
-0,         34,         34,        1,   149760, 0xa56e6600
-0,         35,         35,        1,   149760, 0x1dfc4a28
-0,         36,         36,        1,   149760, 0x9a72d671
-0,         37,         37,        1,   149760, 0xc01812ae
-0,         38,         38,        1,   149760, 0x8ef428c2
-0,         39,         39,        1,   149760, 0x6e79de92
-0,         40,         40,        1,   149760, 0xf315ba7c
-0,         41,         41,        1,   149760, 0xa678caff
-0,         42,         42,        1,   149760, 0xbd2049c0
-0,         43,         43,        1,   149760, 0x649323ea
-0,         44,         44,        1,   149760, 0x686eb3a4
-0,         45,         45,        1,   149760, 0x89725136
-0,         46,         46,        1,   149760, 0xc4db7e6f
-0,         47,         47,        1,   149760, 0xf6f0d823
-0,         48,         48,        1,   149760, 0x44b3a07a
-0,         49,         49,        1,   149760, 0xf23c221d
-0,         50,         50,        1,   149760, 0x858f11ef
-0,         51,         51,        1,   149760, 0xcd5311c4
-0,         52,         52,        1,   149760, 0x72c9297d
-0,         53,         53,        1,   149760, 0xf6acd772
-0,         54,         54,        1,   149760, 0x8c0f91ed
-0,         55,         55,        1,   149760, 0x7ef6f2be
-0,         56,         56,        1,   149760, 0x1237a677
-0,         57,         57,        1,   149760, 0x66e461f9
-0,         58,         58,        1,   149760, 0x3e06e1b3
-0,         59,         59,        1,   149760, 0xa6f6065c
-0,         60,         60,        1,   149760, 0x16e38cc0
-0,         61,         61,        1,   149760, 0x05762de1
-0,         62,         62,        1,   149760, 0xbda617c5
-0,         63,         63,        1,   149760, 0x75b904a9
-0,         64,         64,        1,   149760, 0x2f8bf179
-0,         65,         65,        1,   149760, 0x9be6a533
-0,         66,         66,        1,   149760, 0xf4eb99e8
-0,         67,         67,        1,   149760, 0xf3a68b9a
-0,         68,         68,        1,   149760, 0x34b86f19
-0,         69,         69,        1,   149760, 0x6a71cc04
-0,         70,         70,        1,   149760, 0xe206a202
-0,         71,         71,        1,   149760, 0xdfa8dea6
-0,         72,         72,        1,   149760, 0x8ef7fb73
-0,         73,         73,        1,   149760, 0x67a8de32
-0,         74,         74,        1,   149760, 0xc8c16870
-0,         75,         75,        1,   149760, 0xf5e5d04d
-0,         76,         76,        1,   149760, 0x79d0cc8d
-0,         77,         77,        1,   149760, 0xcd80a22b
-0,         78,         78,        1,   149760, 0x12dce452
-0,         79,         79,        1,   149760, 0x0586aa3d
-0,         80,         80,        1,   149760, 0x5a4d0c1e
-0,         81,         81,        1,   149760, 0x25dbe94e
-0,         82,         82,        1,   149760, 0x3236bbe8
-0,         83,         83,        1,   149760, 0x3b4bc068
-0,         84,         84,        1,   149760, 0x3f32c299
-0,         85,         85,        1,   149760, 0x5b0738e5
-0,         86,         86,        1,   149760, 0x0c1d0c80
-0,         87,         87,        1,   149760, 0x76ace6f5
-0,         88,         88,        1,   149760, 0xc738ff39
-0,         89,         89,        1,   149760, 0x0f078335
-0,         90,         90,        1,   149760, 0x0e941631
-0,         91,         91,        1,   149760, 0x284ee7d6
-0,         92,         92,        1,   149760, 0xce9b49b8
-0,         93,         93,        1,   149760, 0x7c132570
-0,         94,         94,        1,   149760, 0xa983dc5e
-0,         95,         95,        1,   149760, 0x994e4d69
-0,         96,         96,        1,   149760, 0xb8f599ed
-0,         97,         97,        1,   149760, 0xee81b454
-0,         98,         98,        1,   149760, 0xf27bdeee
-0,         99,         99,        1,   149760, 0xc7628895
-0,        100,        100,        1,   149760, 0x003521d1
-0,        101,        101,        1,   149760, 0x7ed9b167
-0,        102,        102,        1,   149760, 0x47598b95
-0,        103,        103,        1,   149760, 0x879b347e
-0,        104,        104,        1,   149760, 0x55f8f8c1
-0,        105,        105,        1,   149760, 0xdddc5dda
-0,        106,        106,        1,   149760, 0xc531c9a1
-0,        107,        107,        1,   149760, 0x28ef0e7e
-0,        108,        108,        1,   149760, 0x4c090cbd
-0,        109,        109,        1,   149760, 0x5818f270
-0,        110,        110,        1,   149760, 0x89ea1f0e
-0,        111,        111,        1,   149760, 0x263925ef
-0,        112,        112,        1,   149760, 0x4e7d45b8
-0,        113,        113,        1,   149760, 0xa98dbf77
-0,        114,        114,        1,   149760, 0xaa0239b3
-0,        115,        115,        1,   149760, 0x4eaa2226
-0,        116,        116,        1,   149760, 0x9927c7f9
-0,        117,        117,        1,   149760, 0x17f09e34
-0,        118,        118,        1,   149760, 0x45cc73e9
-0,        119,        119,        1,   149760, 0x21836e14
-0,        120,        120,        1,   149760, 0x14c38cf6
-0,        121,        121,        1,   149760, 0x18ee35ee
-0,        122,        122,        1,   149760, 0x4f55f781
-0,        123,        123,        1,   149760, 0x85556339
-0,        124,        124,        1,   149760, 0xc41e3261
-0,        125,        125,        1,   149760, 0xed34ba27
-0,        126,        126,        1,   149760, 0x91e7841c
-0,        127,        127,        1,   149760, 0x1605bd75
-0,        128,        128,        1,   149760, 0xb5af2fbc
-0,        129,        129,        1,   149760, 0x9024b2d8
-0,        130,        130,        1,   149760, 0xda8d3c03
-0,        131,        131,        1,   149760, 0xc23a9686
-0,        132,        132,        1,   149760, 0xf9c8686b
-0,        133,        133,        1,   149760, 0xec09b569
-0,        134,        134,        1,   149760, 0x398df9bb
-0,        135,        135,        1,   149760, 0x716c2934
-0,        136,        136,        1,   149760, 0x0a6ea078
-0,        137,        137,        1,   149760, 0x777739fe
-0,        138,        138,        1,   149760, 0x80417304
-0,        139,        139,        1,   149760, 0xe0a5c378
-0,        140,        140,        1,   149760, 0x9565a659
-0,        141,        141,        1,   149760, 0xdf6f1938
-0,        142,        142,        1,   149760, 0xe60d5639
-0,        143,        143,        1,   149760, 0xa89fa739
-0,        144,        144,        1,   149760, 0xd1529b40
-0,        145,        145,        1,   149760, 0x48a7d440
-0,        146,        146,        1,   149760, 0x5946afbb
-0,        147,        147,        1,   149760, 0x2cad2855
-0,        148,        148,        1,   149760, 0x7ac1d993
-0,        149,        149,        1,   149760, 0x0841a016
-0,        150,        150,        1,   149760, 0x35ea4bd2
-0,        151,        151,        1,   149760, 0x5371effa
-0,        152,        152,        1,   149760, 0xd6445a37
-0,        153,        153,        1,   149760, 0x782ea184
-0,        154,        154,        1,   149760, 0x919c2013
-0,        155,        155,        1,   149760, 0x0ea79614
-0,        156,        156,        1,   149760, 0x1ac0e835
-0,        157,        157,        1,   149760, 0x32a36ada
-0,        158,        158,        1,   149760, 0x6b0ad17c
-0,        159,        159,        1,   149760, 0xcd442d19
-0,        160,        160,        1,   149760, 0x0dd1df50
-0,        161,        161,        1,   149760, 0xe26b248f
-0,        162,        162,        1,   149760, 0x490348bb
-0,        163,        163,        1,   149760, 0x638b547e
-0,        164,        164,        1,   149760, 0xb2cbe2ca
-0,        165,        165,        1,   149760, 0xc6cfaa86
-0,        166,        166,        1,   149760, 0xe2317842
-0,        167,        167,        1,   149760, 0xe6e7cd9b
-0,        168,        168,        1,   149760, 0x55bf48cb
-0,        169,        169,        1,   149760, 0xefee6ea0
-0,        170,        170,        1,   149760, 0x2bb127fa
-0,        171,        171,        1,   149760, 0xebbf0725
-0,        172,        172,        1,   149760, 0xb40718a1
-0,        173,        173,        1,   149760, 0x33c8e7da
-0,        174,        174,        1,   149760, 0xfeea8d03
-0,        175,        175,        1,   149760, 0x52f47fa9
-0,        176,        176,        1,   149760, 0xb08fa2f6
-0,        177,        177,        1,   149760, 0xc9adcd96
-0,        178,        178,        1,   149760, 0xb8981cc2
-0,        179,        179,        1,   149760, 0x547b1eaa
-0,        180,        180,        1,   149760, 0x10733813
-0,        181,        181,        1,   149760, 0x14edfa3d
-0,        182,        182,        1,   149760, 0x28ae8eb3
-0,        183,        183,        1,   149760, 0x9b94a69c
-0,        184,        184,        1,   149760, 0x42f67a2a
-0,        185,        185,        1,   149760, 0x1ead65e6
-0,        186,        186,        1,   149760, 0x30b99840
-0,        187,        187,        1,   149760, 0xafdebbda
-0,        188,        188,        1,   149760, 0xc31cda7f
-0,        189,        189,        1,   149760, 0xe7afdfa8
-0,        190,        190,        1,   149760, 0xc8358146
-0,        191,        191,        1,   149760, 0xb8ea3a3b
-0,        192,        192,        1,   149760, 0xebbb2c0e
-0,        193,        193,        1,   149760, 0xe911c057
-0,        194,        194,        1,   149760, 0x843f3082
-0,        195,        195,        1,   149760, 0xd18f6dcb
-0,        196,        196,        1,   149760, 0xd0f67de3
-0,        197,        197,        1,   149760, 0xa7077645
-0,        198,        198,        1,   149760, 0xb7432bef
-0,        199,        199,        1,   149760, 0x9e3284ee
-0,        200,        200,        1,   149760, 0x931ec601
-0,        201,        201,        1,   149760, 0xd0f92a35
-0,        202,        202,        1,   149760, 0x2141c549
-0,        203,        203,        1,   149760, 0x46abf101
-0,        204,        204,        1,   149760, 0x92069ea7
-0,        205,        205,        1,   149760, 0xbf0dd536
-0,        206,        206,        1,   149760, 0xc0c34245
-0,        207,        207,        1,   149760, 0xd9f60e8b
-0,        208,        208,        1,   149760, 0xe20cb181
-0,        209,        209,        1,   149760, 0xdf58fbd2
-0,        210,        210,        1,   149760, 0xe047e805
-0,        211,        211,        1,   149760, 0xe6dd0520
-0,        212,        212,        1,   149760, 0xa7a1a7dd
-0,        213,        213,        1,   149760, 0x6bd6d799
-0,        214,        214,        1,   149760, 0x9fcbda54
-0,        215,        215,        1,   149760, 0xe9b8bf5a
-0,        216,        216,        1,   149760, 0x818d2b8d
-0,        217,        217,        1,   149760, 0x021c5b55
-0,        218,        218,        1,   149760, 0x0da93d94
-0,        219,        219,        1,   149760, 0x7d66b00d
-0,        220,        220,        1,   149760, 0xf84ab99e
-0,        221,        221,        1,   149760, 0xbc866ed2
-0,        222,        222,        1,   149760, 0x8075f6fa
-0,        223,        223,        1,   149760, 0x64540cad
-0,        224,        224,        1,   149760, 0xf3e28d9a
-0,        225,        225,        1,   149760, 0xb88fef8b
-0,        226,        226,        1,   149760, 0x1c782c83
-0,        227,        227,        1,   149760, 0xb89e4047
-0,        228,        228,        1,   149760, 0x593815a7
-0,        229,        229,        1,   149760, 0xa41a68d1
-0,        230,        230,        1,   149760, 0x7fdc56e5
-0,        231,        231,        1,   149760, 0xea8a0533
-0,        232,        232,        1,   149760, 0xc74709cc
-0,        233,        233,        1,   149760, 0xecca373c
-0,        234,        234,        1,   149760, 0x1dae228f
-0,        235,        235,        1,   149760, 0xbb900da8
-0,        236,        236,        1,   149760, 0xf71e4935
-0,        237,        237,        1,   149760, 0x8587d747
-0,        238,        238,        1,   149760, 0x5382afdd
-0,        239,        239,        1,   149760, 0x4075dea6
-0,        240,        240,        1,   149760, 0x1ccde8f2
-0,        241,        241,        1,   149760, 0x8065ed82
-0,        242,        242,        1,   149760, 0x0726bb8a
-0,        243,        243,        1,   149760, 0xedf2172c
-0,        244,        244,        1,   149760, 0x552cce61
-0,        245,        245,        1,   149760, 0x32851927
-0,        246,        246,        1,   149760, 0x15e8ae45
-0,        247,        247,        1,   149760, 0x9265625c
-0,        248,        248,        1,   149760, 0x11612465
-0,        249,        249,        1,   149760, 0x9f5586fa
-0,        250,        250,        1,   149760, 0x77f295a1
-0,        251,        251,        1,   149760, 0xb0757b88
-0,        252,        252,        1,   149760, 0xa0bd3d9c
-0,        253,        253,        1,   149760, 0x12471db6
-0,        254,        254,        1,   149760, 0x5c329d6b
-0,        255,        255,        1,   149760, 0x62f32654
-0,        256,        256,        1,   149760, 0xeafeb1f0
-0,        257,        257,        1,   149760, 0x707f6647
-0,        258,        258,        1,   149760, 0xe8acda33
-0,        259,        259,        1,   149760, 0x1e9dcb1b
-0,        260,        260,        1,   149760, 0x984a4a40
-0,        261,        261,        1,   149760, 0x066b9585
-0,        262,        262,        1,   149760, 0x5e2d2091
-0,        263,        263,        1,   149760, 0x6a6a5172
-0,        264,        264,        1,   149760, 0xc4c4fe94
-0,        265,        265,        1,   149760, 0x6ed2c46b
-0,        266,        266,        1,   149760, 0x810f27f8
-0,        267,        267,        1,   149760, 0xc27ca970
-0,        268,        268,        1,   149760, 0xfd3dae79
-0,        269,        269,        1,   149760, 0x9744ce6d
-0,        270,        270,        1,   149760, 0x45772f2a
-0,        271,        271,        1,   149760, 0x482ed805
-0,        272,        272,        1,   149760, 0x9606c429
-0,        273,        273,        1,   149760, 0x79a9ca8a
-0,        274,        274,        1,   149760, 0xf625806e
-0,        275,        275,        1,   149760, 0x0c9eed01
-0,        276,        276,        1,   149760, 0xb0007687
-0,        277,        277,        1,   149760, 0x620a7b35
-0,        278,        278,        1,   149760, 0x5d6fa9dc
-0,        279,        279,        1,   149760, 0x92c86275
-0,        280,        280,        1,   149760, 0xca1886f0
-0,        281,        281,        1,   149760, 0x6363a557
-0,        282,        282,        1,   149760, 0x32ab19ca
-0,        283,        283,        1,   149760, 0xa6113c10
-0,        284,        284,        1,   149760, 0x257fd46a
-0,        285,        285,        1,   149760, 0xb8af4e28
-0,        286,        286,        1,   149760, 0x9716d086
-0,        287,        287,        1,   149760, 0x0cc14c4d
-0,        288,        288,        1,   149760, 0xd194f150
-0,        289,        289,        1,   149760, 0xb7cd7cf8
-0,        290,        290,        1,   149760, 0xae1bb1a3
-0,        291,        291,        1,   149760, 0xb4cc355f
-0,        292,        292,        1,   149760, 0x617c1ecb
-0,        293,        293,        1,   149760, 0xf2d1f288
-0,        294,        294,        1,   149760, 0x109bcb52
-0,        295,        295,        1,   149760, 0xe61a97dd
-0,        296,        296,        1,   149760, 0xc629ac10
-0,        297,        297,        1,   149760, 0xb91acded
-0,        298,        298,        1,   149760, 0x54ccb321
-0,        299,        299,        1,   149760, 0x1ad3c115
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RPS_A_docomo_4 b/deps/libav/tests/ref/fate/hevc-conformance-RPS_A_docomo_4
deleted file mode 100644
index e29a74b..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RPS_A_docomo_4
+++ /dev/null
@@ -1,45 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0x0bdf13f8
-0,          2,          2,        1,   149760, 0x45e702c7
-0,          3,          3,        1,   149760, 0x7a3a0c9a
-0,          4,          4,        1,   149760, 0xab0ed81d
-0,          5,          5,        1,   149760, 0xe2d4722a
-0,          6,          6,        1,   149760, 0x1df1f103
-0,          7,          7,        1,   149760, 0xdde42fb8
-0,          8,          8,        1,   149760, 0xfe2eb624
-0,          9,          9,        1,   149760, 0x121ff262
-0,         10,         10,        1,   149760, 0x64e5e7ba
-0,         11,         11,        1,   149760, 0x61b40e67
-0,         12,         12,        1,   149760, 0x8ceeb33f
-0,         13,         13,        1,   149760, 0xcbff6fc5
-0,         14,         14,        1,   149760, 0x07d6f767
-0,         15,         15,        1,   149760, 0x5cff14a5
-0,         16,         16,        1,   149760, 0x5c336ca3
-0,         17,         17,        1,   149760, 0x424990cd
-0,         18,         18,        1,   149760, 0x2c423459
-0,         19,         19,        1,   149760, 0xaff700ac
-0,         20,         20,        1,   149760, 0xaab9e6f4
-0,         21,         21,        1,   149760, 0x7979bfd4
-0,         22,         22,        1,   149760, 0x5096ee11
-0,         23,         23,        1,   149760, 0x4f02d1d0
-0,         24,         24,        1,   149760, 0x0c6468d2
-0,         25,         25,        1,   149760, 0x707e9307
-0,         26,         26,        1,   149760, 0xf4a71dc8
-0,         27,         27,        1,   149760, 0xbefc67f0
-0,         28,         28,        1,   149760, 0x05b8f3a9
-0,         29,         29,        1,   149760, 0xcd080a46
-0,         30,         30,        1,   149760, 0x1b5ab043
-0,         31,         31,        1,   149760, 0xd4b896e2
-0,         32,         32,        1,   149760, 0xbd342d08
-0,         33,         33,        1,   149760, 0x0b993f3c
-0,         34,         34,        1,   149760, 0xd89190e2
-0,         35,         35,        1,   149760, 0x507f2663
-0,         36,         36,        1,   149760, 0x6994c08f
-0,         37,         37,        1,   149760, 0xcf0209b2
-0,         38,         38,        1,   149760, 0x9695327c
-0,         39,         39,        1,   149760, 0x7116fdb3
-0,         40,         40,        1,   149760, 0x1294b154
-0,         41,         41,        1,   149760, 0x7ed1f716
-0,         42,         42,        1,   149760, 0xdc4880da
-0,         43,         43,        1,   149760, 0xa5955d35
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RPS_B_qualcomm_5 b/deps/libav/tests/ref/fate/hevc-conformance-RPS_B_qualcomm_5
deleted file mode 100644
index 3b24e75..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RPS_B_qualcomm_5
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xdb5e3b56
-0,          1,          1,        1,   149760, 0xe328e677
-0,          2,          2,        1,   149760, 0x8f18f4c0
-0,          3,          3,        1,   149760, 0xf48de64c
-0,          4,          4,        1,   149760, 0x2937ad23
-0,          5,          5,        1,   149760, 0x93f166d2
-0,          6,          6,        1,   149760, 0x80e4e9c2
-0,          7,          7,        1,   149760, 0xb2a35da7
-0,          8,          8,        1,   149760, 0xf4fbb5c2
-0,          9,          9,        1,   149760, 0x2193bd91
-0,         10,         10,        1,   149760, 0xd4eec3b4
-0,         11,         11,        1,   149760, 0xb2e20b91
-0,         12,         12,        1,   149760, 0xaf8d17dc
-0,         13,         13,        1,   149760, 0x2189ac78
-0,         14,         14,        1,   149760, 0x52b8130f
-0,         15,         15,        1,   149760, 0xdfbc2f0a
-0,         16,         16,        1,   149760, 0x4c0269cf
-0,         17,         17,        1,   149760, 0xf99bb7d2
-0,         18,         18,        1,   149760, 0xada1495f
-0,         19,         19,        1,   149760, 0x57c42893
-0,         20,         20,        1,   149760, 0x022d29ca
-0,         21,         21,        1,   149760, 0x9883a271
-0,         22,         22,        1,   149760, 0xc8c132d7
-0,         23,         23,        1,   149760, 0xa97f8b43
-0,         24,         24,        1,   149760, 0x1bc187fa
-0,         25,         25,        1,   149760, 0x7b93951b
-0,         26,         26,        1,   149760, 0x88fd367c
-0,         27,         27,        1,   149760, 0x29471b92
-0,         28,         28,        1,   149760, 0x3ba820f1
-0,         29,         29,        1,   149760, 0x0a223169
-0,         30,         30,        1,   149760, 0x70fee1d5
-0,         31,         31,        1,   149760, 0x5f5cf053
-0,         32,         32,        1,   149760, 0x698f11e4
-0,         33,         33,        1,   149760, 0x65314fd4
-0,         34,         34,        1,   149760, 0x7a689450
-0,         35,         35,        1,   149760, 0x28774ca0
-0,         36,         36,        1,   149760, 0x0751f804
-0,         37,         37,        1,   149760, 0x875a6fb9
-0,         38,         38,        1,   149760, 0xde1f5309
-0,         39,         39,        1,   149760, 0x82701dd6
-0,         40,         40,        1,   149760, 0x13a2f45e
-0,         41,         41,        1,   149760, 0xfc3b140c
-0,         42,         42,        1,   149760, 0x4518ab47
-0,         43,         43,        1,   149760, 0xe5459482
-0,         44,         44,        1,   149760, 0x4cfafc6e
-0,         45,         45,        1,   149760, 0xc7cd5e43
-0,         46,         46,        1,   149760, 0x1ee79746
-0,         47,         47,        1,   149760, 0xccc73c83
-0,         48,         48,        1,   149760, 0xd9ecafc7
-0,         49,         49,        1,   149760, 0x65221c9d
-0,         50,         50,        1,   149760, 0x219b0b4b
-0,         51,         51,        1,   149760, 0x9d1e2010
-0,         52,         52,        1,   149760, 0x11685e16
-0,         53,         53,        1,   149760, 0x37eb1297
-0,         54,         54,        1,   149760, 0x99088778
-0,         55,         55,        1,   149760, 0xb41cbf25
-0,         56,         56,        1,   149760, 0x56f78bda
-0,         57,         57,        1,   149760, 0x6c284868
-0,         58,         58,        1,   149760, 0x37f245b9
-0,         59,         59,        1,   149760, 0x79682de2
-0,         60,         60,        1,   149760, 0x5a04f379
-0,         61,         61,        1,   149760, 0xfecc668b
-0,         62,         62,        1,   149760, 0x29328d8c
-0,         63,         63,        1,   149760, 0x8aff3ad7
-0,         64,         64,        1,   149760, 0x4035f027
-0,         65,         65,        1,   149760, 0xe7cead1d
-0,         66,         66,        1,   149760, 0x18578492
-0,         67,         67,        1,   149760, 0xd3ab3f9d
-0,         68,         68,        1,   149760, 0x6f866e38
-0,         69,         69,        1,   149760, 0x6a47800c
-0,         70,         70,        1,   149760, 0x01c6305e
-0,         71,         71,        1,   149760, 0x489ab5a8
-0,         72,         72,        1,   149760, 0xb2570787
-0,         73,         73,        1,   149760, 0xb0d5d478
-0,         74,         74,        1,   149760, 0x88484ccc
-0,         75,         75,        1,   149760, 0xb4c6be2c
-0,         76,         76,        1,   149760, 0x461d874c
-0,         77,         77,        1,   149760, 0x3be464b0
-0,         78,         78,        1,   149760, 0x06aa9443
-0,         79,         79,        1,   149760, 0xe0e625a3
-0,         80,         80,        1,   149760, 0x17e2daeb
-0,         81,         81,        1,   149760, 0x58a1a350
-0,         82,         82,        1,   149760, 0xcd4983ce
-0,         83,         83,        1,   149760, 0x90459a42
-0,         84,         84,        1,   149760, 0x899dedaa
-0,         85,         85,        1,   149760, 0x814e3529
-0,         86,         86,        1,   149760, 0x5795a2e5
-0,         87,         87,        1,   149760, 0xcedb245c
-0,         88,         88,        1,   149760, 0x37f9dd30
-0,         89,         89,        1,   149760, 0x320d899e
-0,         90,         90,        1,   149760, 0x6a33ffca
-0,         91,         91,        1,   149760, 0x6620b9eb
-0,         92,         92,        1,   149760, 0xfc8b1e1b
-0,         93,         93,        1,   149760, 0x835a0dd9
-0,         94,         94,        1,   149760, 0xcee4a9b0
-0,         95,         95,        1,   149760, 0x2c2972f0
-0,         96,         96,        1,   149760, 0x0a39aa8b
-0,         97,         97,        1,   149760, 0xa8a9c0bf
-0,         98,         98,        1,   149760, 0xd563c087
-0,         99,         99,        1,   149760, 0xb0f88320
-0,        100,        100,        1,   149760, 0x0ffffd6b
-0,        101,        101,        1,   149760, 0x95269e8c
-0,        102,        102,        1,   149760, 0xd0d4acd9
-0,        103,        103,        1,   149760, 0x7cf06805
-0,        104,        104,        1,   149760, 0xa5192bbe
-0,        105,        105,        1,   149760, 0x2fed928b
-0,        106,        106,        1,   149760, 0x549edd04
-0,        107,        107,        1,   149760, 0xa42b55d7
-0,        108,        108,        1,   149760, 0xeab32579
-0,        109,        109,        1,   149760, 0x95a727c3
-0,        110,        110,        1,   149760, 0x76714576
-0,        111,        111,        1,   149760, 0x5efc352a
-0,        112,        112,        1,   149760, 0x154a2c06
-0,        113,        113,        1,   149760, 0x516faf62
-0,        114,        114,        1,   149760, 0x622b6d64
-0,        115,        115,        1,   149760, 0x2ada08a9
-0,        116,        116,        1,   149760, 0xf24efa06
-0,        117,        117,        1,   149760, 0x5979b33e
-0,        118,        118,        1,   149760, 0x2130a282
-0,        119,        119,        1,   149760, 0x1ee8b3d1
-0,        120,        120,        1,   149760, 0x840c6913
-0,        121,        121,        1,   149760, 0xa37049b8
-0,        122,        122,        1,   149760, 0x8d95efb0
-0,        123,        123,        1,   149760, 0x22d3afb2
-0,        124,        124,        1,   149760, 0x113d6c6f
-0,        125,        125,        1,   149760, 0xb407014d
-0,        126,        126,        1,   149760, 0x33a8e5c9
-0,        127,        127,        1,   149760, 0x2689ced2
-0,        128,        128,        1,   149760, 0x3eaf3f55
-0,        129,        129,        1,   149760, 0x93ad7fa5
-0,        130,        130,        1,   149760, 0x30c15154
-0,        131,        131,        1,   149760, 0xdce68c7a
-0,        132,        132,        1,   149760, 0xea092d4c
-0,        133,        133,        1,   149760, 0xed679468
-0,        134,        134,        1,   149760, 0x9128c0d5
-0,        135,        135,        1,   149760, 0xd4f121ba
-0,        136,        136,        1,   149760, 0xe5e228f0
-0,        137,        137,        1,   149760, 0x8246dae3
-0,        138,        138,        1,   149760, 0x8a3b430c
-0,        139,        139,        1,   149760, 0x9a8edc3d
-0,        140,        140,        1,   149760, 0x68b0af97
-0,        141,        141,        1,   149760, 0x90d54b52
-0,        142,        142,        1,   149760, 0xd6395796
-0,        143,        143,        1,   149760, 0x70986b40
-0,        144,        144,        1,   149760, 0xc0b4a9c8
-0,        145,        145,        1,   149760, 0x760b973b
-0,        146,        146,        1,   149760, 0xe8fe9846
-0,        147,        147,        1,   149760, 0x61062c97
-0,        148,        148,        1,   149760, 0x9148e99b
-0,        149,        149,        1,   149760, 0x962c6a1e
-0,        150,        150,        1,   149760, 0x57bb088f
-0,        151,        151,        1,   149760, 0x2b0fa8c5
-0,        152,        152,        1,   149760, 0x00f932fc
-0,        153,        153,        1,   149760, 0x4cc58697
-0,        154,        154,        1,   149760, 0xd2bf178f
-0,        155,        155,        1,   149760, 0xc510c1cd
-0,        156,        156,        1,   149760, 0xc48e0192
-0,        157,        157,        1,   149760, 0xa03e7fe5
-0,        158,        158,        1,   149760, 0xb68ce060
-0,        159,        159,        1,   149760, 0x653951c8
-0,        160,        160,        1,   149760, 0xbd1abe11
-0,        161,        161,        1,   149760, 0xad7a2366
-0,        162,        162,        1,   149760, 0xb018279e
-0,        163,        163,        1,   149760, 0xd5994bff
-0,        164,        164,        1,   149760, 0x3eb7e082
-0,        165,        165,        1,   149760, 0x87257b3a
-0,        166,        166,        1,   149760, 0x12fc4c4d
-0,        167,        167,        1,   149760, 0x9fbfa94d
-0,        168,        168,        1,   149760, 0x61714cae
-0,        169,        169,        1,   149760, 0xae291b59
-0,        170,        170,        1,   149760, 0x8f161442
-0,        171,        171,        1,   149760, 0x603cf3a5
-0,        172,        172,        1,   149760, 0xf9f214a0
-0,        173,        173,        1,   149760, 0xbbf5dcb9
-0,        174,        174,        1,   149760, 0x8af1a1ab
-0,        175,        175,        1,   149760, 0x16f581e5
-0,        176,        176,        1,   149760, 0xdadd8eed
-0,        177,        177,        1,   149760, 0x2f1acd8e
-0,        178,        178,        1,   149760, 0xa28bd660
-0,        179,        179,        1,   149760, 0x7902dd67
-0,        180,        180,        1,   149760, 0x9b771dc2
-0,        181,        181,        1,   149760, 0x0fc82bda
-0,        182,        182,        1,   149760, 0xd6128167
-0,        183,        183,        1,   149760, 0xe57b7a2f
-0,        184,        184,        1,   149760, 0x1e158d0e
-0,        185,        185,        1,   149760, 0x682c7c60
-0,        186,        186,        1,   149760, 0x32096bbe
-0,        187,        187,        1,   149760, 0x297652f2
-0,        188,        188,        1,   149760, 0x056c7432
-0,        189,        189,        1,   149760, 0x0469b39a
-0,        190,        190,        1,   149760, 0x00044bc9
-0,        191,        191,        1,   149760, 0x766c0bad
-0,        192,        192,        1,   149760, 0xd6720a40
-0,        193,        193,        1,   149760, 0x814895eb
-0,        194,        194,        1,   149760, 0x1a84fcbc
-0,        195,        195,        1,   149760, 0x8b9442aa
-0,        196,        196,        1,   149760, 0x290187d1
-0,        197,        197,        1,   149760, 0x8f87294f
-0,        198,        198,        1,   149760, 0x8c49a125
-0,        199,        199,        1,   149760, 0xe169806a
-0,        200,        200,        1,   149760, 0x18c0e2f1
-0,        201,        201,        1,   149760, 0xb92b0e67
-0,        202,        202,        1,   149760, 0x98d2acef
-0,        203,        203,        1,   149760, 0x179eeaec
-0,        204,        204,        1,   149760, 0xa054a7bb
-0,        205,        205,        1,   149760, 0x5f78d160
-0,        206,        206,        1,   149760, 0x09f9a40f
-0,        207,        207,        1,   149760, 0xfb4a59f5
-0,        208,        208,        1,   149760, 0xdc5ca1f2
-0,        209,        209,        1,   149760, 0xf2254927
-0,        210,        210,        1,   149760, 0xfda4fab3
-0,        211,        211,        1,   149760, 0x45ab23cc
-0,        212,        212,        1,   149760, 0x1f69c006
-0,        213,        213,        1,   149760, 0x326bb5a1
-0,        214,        214,        1,   149760, 0x810dad28
-0,        215,        215,        1,   149760, 0x96dfc515
-0,        216,        216,        1,   149760, 0xc685fd80
-0,        217,        217,        1,   149760, 0x18da42f4
-0,        218,        218,        1,   149760, 0x11773807
-0,        219,        219,        1,   149760, 0x3f54c458
-0,        220,        220,        1,   149760, 0xa5dff146
-0,        221,        221,        1,   149760, 0x4bc3ffcb
-0,        222,        222,        1,   149760, 0x84801971
-0,        223,        223,        1,   149760, 0x2ff65539
-0,        224,        224,        1,   149760, 0x8a7f716d
-0,        225,        225,        1,   149760, 0xe7e8cdd0
-0,        226,        226,        1,   149760, 0xc8567d5f
-0,        227,        227,        1,   149760, 0x63986bcd
-0,        228,        228,        1,   149760, 0x8817f648
-0,        229,        229,        1,   149760, 0xa0152e36
-0,        230,        230,        1,   149760, 0x2eca851e
-0,        231,        231,        1,   149760, 0x09c0f0cb
-0,        232,        232,        1,   149760, 0xf1c81b23
-0,        233,        233,        1,   149760, 0x93096c98
-0,        234,        234,        1,   149760, 0x1fe47331
-0,        235,        235,        1,   149760, 0x79c0b70e
-0,        236,        236,        1,   149760, 0xb1929b60
-0,        237,        237,        1,   149760, 0xb42ea35a
-0,        238,        238,        1,   149760, 0x42d5bf86
-0,        239,        239,        1,   149760, 0xa83efbd4
-0,        240,        240,        1,   149760, 0xbdd2f313
-0,        241,        241,        1,   149760, 0x85a5dbd4
-0,        242,        242,        1,   149760, 0xc475b180
-0,        243,        243,        1,   149760, 0x63911e68
-0,        244,        244,        1,   149760, 0x5b79baab
-0,        245,        245,        1,   149760, 0xa22d310e
-0,        246,        246,        1,   149760, 0x243ef7b5
-0,        247,        247,        1,   149760, 0x813fdc95
-0,        248,        248,        1,   149760, 0xbb7d19fa
-0,        249,        249,        1,   149760, 0x199ae62c
-0,        250,        250,        1,   149760, 0x7a4ce5b2
-0,        251,        251,        1,   149760, 0xd632a9d3
-0,        252,        252,        1,   149760, 0xc07b75fe
-0,        253,        253,        1,   149760, 0x5bae6a88
-0,        254,        254,        1,   149760, 0x29b411e0
-0,        255,        255,        1,   149760, 0x78706cbe
-0,        256,        256,        1,   149760, 0x2659a6cb
-0,        257,        257,        1,   149760, 0xefb170f8
-0,        258,        258,        1,   149760, 0x9dd107b8
-0,        259,        259,        1,   149760, 0xf38b5ce5
-0,        260,        260,        1,   149760, 0xd7e0f10e
-0,        261,        261,        1,   149760, 0x080b9e49
-0,        262,        262,        1,   149760, 0xa2274c3b
-0,        263,        263,        1,   149760, 0x3d3376c9
-0,        264,        264,        1,   149760, 0xe04719e3
-0,        265,        265,        1,   149760, 0xfe4123e3
-0,        266,        266,        1,   149760, 0x769a3cf6
-0,        267,        267,        1,   149760, 0xaf0be9e6
-0,        268,        268,        1,   149760, 0xe9baa873
-0,        269,        269,        1,   149760, 0x4f5fb405
-0,        270,        270,        1,   149760, 0x207b401e
-0,        271,        271,        1,   149760, 0xb1483351
-0,        272,        272,        1,   149760, 0x5fe3dc9f
-0,        273,        273,        1,   149760, 0xb35dcae7
-0,        274,        274,        1,   149760, 0x8cc69de4
-0,        275,        275,        1,   149760, 0xd6e29308
-0,        276,        276,        1,   149760, 0xf8f53227
-0,        277,        277,        1,   149760, 0xaf483e80
-0,        278,        278,        1,   149760, 0x287cdfc9
-0,        279,        279,        1,   149760, 0xf72b93eb
-0,        280,        280,        1,   149760, 0x09c26976
-0,        281,        281,        1,   149760, 0xae58601f
-0,        282,        282,        1,   149760, 0x7f951546
-0,        283,        283,        1,   149760, 0x81e742b2
-0,        284,        284,        1,   149760, 0xb16554a6
-0,        285,        285,        1,   149760, 0xcdafc4c0
-0,        286,        286,        1,   149760, 0x0bb335bc
-0,        287,        287,        1,   149760, 0xe1e4ba60
-0,        288,        288,        1,   149760, 0xcce3eb48
-0,        289,        289,        1,   149760, 0x8b8992a9
-0,        290,        290,        1,   149760, 0x0a5ff2f6
-0,        291,        291,        1,   149760, 0xb04b8ed1
-0,        292,        292,        1,   149760, 0x0c874aae
-0,        293,        293,        1,   149760, 0x19d6f138
-0,        294,        294,        1,   149760, 0x30e322f2
-0,        295,        295,        1,   149760, 0x67a5700c
-0,        296,        296,        1,   149760, 0xb65bd462
-0,        297,        297,        1,   149760, 0xe267d09e
-0,        298,        298,        1,   149760, 0x8824c043
-0,        299,        299,        1,   149760, 0x680cfc20
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RPS_C_ericsson_5 b/deps/libav/tests/ref/fate/hevc-conformance-RPS_C_ericsson_5
deleted file mode 100644
index e97e7ea..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RPS_C_ericsson_5
+++ /dev/null
@@ -1,41 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8ce7200b
-0,          1,          1,        1,   149760, 0x85340cda
-0,          2,          2,        1,   149760, 0x16fd1f91
-0,          3,          3,        1,   149760, 0x7d8d312d
-0,          4,          4,        1,   149760, 0xae6ed875
-0,          5,          5,        1,   149760, 0xccac730a
-0,          6,          6,        1,   149760, 0x3d321c3f
-0,          7,          7,        1,   149760, 0x18e05688
-0,          8,          8,        1,   149760, 0x23fec4de
-0,          9,          9,        1,   149760, 0x3e0de0ca
-0,         10,         10,        1,   149760, 0x4789e861
-0,         11,         11,        1,   149760, 0x34550f71
-0,         12,         12,        1,   149760, 0xb0b1b4a7
-0,         13,         13,        1,   149760, 0xb9b8967e
-0,         14,         14,        1,   149760, 0x92e7f3c5
-0,         15,         15,        1,   149760, 0x61c0f62e
-0,         16,         16,        1,   149760, 0x819648c5
-0,         17,         17,        1,   149760, 0xe0286f95
-0,         18,         18,        1,   149760, 0xc2d85311
-0,         19,         19,        1,   149760, 0xbb07ec4e
-0,         20,         20,        1,   149760, 0xe073f10b
-0,         21,         21,        1,   149760, 0xd2e8c52f
-0,         22,         22,        1,   149760, 0x12020583
-0,         23,         23,        1,   149760, 0x0dfecaba
-0,         24,         24,        1,   149760, 0xe35f8ee5
-0,         25,         25,        1,   149760, 0x267bbf14
-0,         26,         26,        1,   149760, 0x371037a8
-0,         27,         27,        1,   149760, 0x3d188434
-0,         28,         28,        1,   149760, 0xce81fd31
-0,         29,         29,        1,   149760, 0xfbbf2801
-0,         30,         30,        1,   149760, 0x9af9d1b6
-0,         31,         31,        1,   149760, 0x14e2feea
-0,         32,         32,        1,   149760, 0x83f04b3a
-0,         33,         33,        1,   149760, 0xfc30687f
-0,         34,         34,        1,   149760, 0xaec2be07
-0,         35,         35,        1,   149760, 0xc7da6926
-0,         36,         36,        1,   149760, 0x50d20e8e
-0,         37,         37,        1,   149760, 0xd0fa63e9
-0,         38,         38,        1,   149760, 0x9d15906a
-0,         39,         39,        1,   149760, 0x4c685317
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RPS_D_ericsson_6 b/deps/libav/tests/ref/fate/hevc-conformance-RPS_D_ericsson_6
deleted file mode 100644
index 1a58c0d..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RPS_D_ericsson_6
+++ /dev/null
@@ -1,69 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8ce7200b
-0,          2,          2,        1,   149760, 0x73610669
-0,          3,          3,        1,   149760, 0xc01620f4
-0,          4,          4,        1,   149760, 0x847a4297
-0,          5,          5,        1,   149760, 0xb4d3e870
-0,          6,          6,        1,   149760, 0xc2dd98a6
-0,          7,          7,        1,   149760, 0xefd02009
-0,          8,          8,        1,   149760, 0x3ae86ed0
-0,          9,          9,        1,   149760, 0x92f3cfb6
-0,         10,         10,        1,   149760, 0x0393e437
-0,         11,         11,        1,   149760, 0x6b29ea60
-0,         12,         12,        1,   149760, 0x9cb1216a
-0,         13,         13,        1,   149760, 0x82c2b1c4
-0,         14,         14,        1,   149760, 0x74899241
-0,         15,         15,        1,   149760, 0xa561f720
-0,         16,         16,        1,   149760, 0x339a11f6
-0,         17,         17,        1,   149760, 0x6bd9772b
-0,         18,         18,        1,   149760, 0x0a0c7c7d
-0,         19,         19,        1,   149760, 0x38426f65
-0,         20,         20,        1,   149760, 0x134ee7b3
-0,         21,         21,        1,   149760, 0xe436e35c
-0,         22,         22,        1,   149760, 0x4174d949
-0,         23,         23,        1,   149760, 0x44e60f0d
-0,         24,         24,        1,   149760, 0xbb6fb0a4
-0,         25,         25,        1,   149760, 0x715a653e
-0,         26,         26,        1,   149760, 0xad11b160
-0,         27,         27,        1,   149760, 0xfa6b368e
-0,         28,         28,        1,   149760, 0x60ff970f
-0,         29,         29,        1,   149760, 0x16430649
-0,         30,         30,        1,   149760, 0xa6cc0767
-0,         31,         31,        1,   149760, 0x59b0c566
-0,         32,         32,        1,   149760, 0xc9e3dfa9
-0,         33,         33,        1,   149760, 0x82873917
-0,         34,         34,        1,   149760, 0xc49e5d22
-0,         35,         35,        1,   149760, 0x416890a8
-0,         36,         36,        1,   149760, 0x386e57e8
-0,         37,         37,        1,   149760, 0x1c27e9d7
-0,         38,         38,        1,   149760, 0x85425596
-0,         39,         39,        1,   149760, 0xe6107df8
-0,         40,         40,        1,   149760, 0x056a3977
-0,         41,         41,        1,   149760, 0x753cf7f7
-0,         42,         42,        1,   149760, 0xc4005218
-0,         43,         43,        1,   149760, 0xce7edcf2
-0,         44,         44,        1,   149760, 0x93465fee
-0,         45,         45,        1,   149760, 0xa21b040a
-0,         46,         46,        1,   149760, 0xd82a53d5
-0,         47,         47,        1,   149760, 0x8f8fd3ae
-0,         48,         48,        1,   149760, 0x52420da5
-0,         49,         49,        1,   149760, 0xa899a9be
-0,         50,         50,        1,   149760, 0xcd85e363
-0,         51,         51,        1,   149760, 0x1a9240c4
-0,         52,         52,        1,   149760, 0xf0b11a36
-0,         53,         53,        1,   149760, 0xcf175809
-0,         54,         54,        1,   149760, 0x24afecc2
-0,         55,         55,        1,   149760, 0x874f7176
-0,         56,         56,        1,   149760, 0xb126dff9
-0,         57,         57,        1,   149760, 0x825ba060
-0,         58,         58,        1,   149760, 0x18c55eed
-0,         59,         59,        1,   149760, 0xf09b03f0
-0,         60,         60,        1,   149760, 0xf4dafd64
-0,         61,         61,        1,   149760, 0x08b49190
-0,         62,         62,        1,   149760, 0xcf336dc7
-0,         63,         63,        1,   149760, 0x51c65c08
-0,         64,         64,        1,   149760, 0x6cfe3433
-0,         65,         65,        1,   149760, 0x4b0af196
-0,         66,         66,        1,   149760, 0xffaeb2db
-0,         67,         67,        1,   149760, 0xa990a19f
-0,         68,         68,        1,   149760, 0x7ed944a3
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RPS_E_qualcomm_5 b/deps/libav/tests/ref/fate/hevc-conformance-RPS_E_qualcomm_5
deleted file mode 100644
index 82c25e1..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RPS_E_qualcomm_5
+++ /dev/null
@@ -1,301 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0xd62a31bc
-0,          2,          2,        1,   149760, 0xec822f84
-0,          3,          3,        1,   149760, 0x7a0a0f25
-0,          4,          4,        1,   149760, 0x461dd882
-0,          5,          5,        1,   149760, 0x62777923
-0,          6,          6,        1,   149760, 0x063c2559
-0,          7,          7,        1,   149760, 0x03b34c02
-0,          8,          8,        1,   149760, 0xe999bdad
-0,          9,          9,        1,   149760, 0x3285f731
-0,         10,         10,        1,   149760, 0x1f8ffaaa
-0,         11,         11,        1,   149760, 0xd7c956f4
-0,         12,         12,        1,   149760, 0xb9e3da56
-0,         13,         13,        1,   149760, 0x1200953f
-0,         14,         14,        1,   149760, 0x06c212cc
-0,         15,         15,        1,   149760, 0xaaa84f01
-0,         16,         16,        1,   149760, 0x7a606de8
-0,         17,         17,        1,   149760, 0x47e49e5a
-0,         18,         18,        1,   149760, 0x666a3370
-0,         19,         19,        1,   149760, 0x187b6b6c
-0,         20,         20,        1,   149760, 0x3c8f0ef4
-0,         21,         21,        1,   149760, 0xc3e59d36
-0,         22,         22,        1,   149760, 0xecb40b3b
-0,         23,         23,        1,   149760, 0x0ae9e31e
-0,         24,         24,        1,   149760, 0xd324746b
-0,         25,         25,        1,   149760, 0xc337c3d5
-0,         26,         26,        1,   149760, 0xd3883c16
-0,         27,         27,        1,   149760, 0xa28b836c
-0,         28,         28,        1,   149760, 0x1cd61f86
-0,         29,         29,        1,   149760, 0x52b51344
-0,         30,         30,        1,   149760, 0x3980a396
-0,         31,         31,        1,   149760, 0x85d0e262
-0,         32,         32,        1,   149760, 0xbd342d08
-0,         33,         33,        1,   149760, 0xc6114038
-0,         34,         34,        1,   149760, 0xc3ab6ca9
-0,         35,         35,        1,   149760, 0x6db56aa7
-0,         36,         36,        1,   149760, 0x22df9ab0
-0,         37,         37,        1,   149760, 0xfa6d2caf
-0,         38,         38,        1,   149760, 0xc1b64e52
-0,         39,         39,        1,   149760, 0x4b9c1d64
-0,         40,         40,        1,   149760, 0xbab6de8f
-0,         41,         41,        1,   149760, 0xfc0e1193
-0,         42,         42,        1,   149760, 0x8fa0a268
-0,         43,         43,        1,   149760, 0x80cf5e07
-0,         44,         44,        1,   149760, 0xe9720cd6
-0,         45,         45,        1,   149760, 0xa9bb2593
-0,         46,         46,        1,   149760, 0xc2e3e7c6
-0,         47,         47,        1,   149760, 0xc9a4ffd6
-0,         48,         48,        1,   149760, 0x9acebbe2
-0,         49,         49,        1,   149760, 0xb3a6bee1
-0,         50,         50,        1,   149760, 0xd1f12057
-0,         51,         51,        1,   149760, 0x9a2306c0
-0,         52,         52,        1,   149760, 0xd1ee37ff
-0,         53,         53,        1,   149760, 0xb0e1dca1
-0,         54,         54,        1,   149760, 0x35646e46
-0,         55,         55,        1,   149760, 0x803baac5
-0,         56,         56,        1,   149760, 0x7ee17b15
-0,         57,         57,        1,   149760, 0x03274ce1
-0,         58,         58,        1,   149760, 0xf3db2fea
-0,         59,         59,        1,   149760, 0xc3c4ff33
-0,         60,         60,        1,   149760, 0x0fc4786e
-0,         61,         61,        1,   149760, 0x27505756
-0,         62,         62,        1,   149760, 0x4c797266
-0,         63,         63,        1,   149760, 0xeba43f1b
-0,         64,         64,        1,   149760, 0x1ae5f13d
-0,         65,         65,        1,   149760, 0x97e186b1
-0,         66,         66,        1,   149760, 0xc0556895
-0,         67,         67,        1,   149760, 0x4e4d18ed
-0,         68,         68,        1,   149760, 0x39811c80
-0,         69,         69,        1,   149760, 0x6bca8c2f
-0,         70,         70,        1,   149760, 0x27ec4807
-0,         71,         71,        1,   149760, 0x50cea38b
-0,         72,         72,        1,   149760, 0x7ec4c09d
-0,         73,         73,        1,   149760, 0xb2a8afee
-0,         74,         74,        1,   149760, 0x0e943cbf
-0,         75,         75,        1,   149760, 0x7c119ea8
-0,         76,         76,        1,   149760, 0x71e194e5
-0,         77,         77,        1,   149760, 0x6a5d792d
-0,         78,         78,        1,   149760, 0xb8aeb406
-0,         79,         79,        1,   149760, 0x263767f2
-0,         80,         80,        1,   149760, 0xcfbef5ae
-0,         81,         81,        1,   149760, 0xad7eb01c
-0,         82,         82,        1,   149760, 0x612d937d
-0,         83,         83,        1,   149760, 0x90a591fd
-0,         84,         84,        1,   149760, 0x582a60dd
-0,         85,         85,        1,   149760, 0x2640124e
-0,         86,         86,        1,   149760, 0x1c12b037
-0,         87,         87,        1,   149760, 0xc916c4e7
-0,         88,         88,        1,   149760, 0x43d2bfe6
-0,         89,         89,        1,   149760, 0xdc7460c4
-0,         90,         90,        1,   149760, 0xc46e21a8
-0,         91,         91,        1,   149760, 0xe08dbd50
-0,         92,         92,        1,   149760, 0xf40bceed
-0,         93,         93,        1,   149760, 0x0ab01b81
-0,         94,         94,        1,   149760, 0xe6ab1f16
-0,         95,         95,        1,   149760, 0x6b4f6a62
-0,         96,         96,        1,   149760, 0x8ff7a1a1
-0,         97,         97,        1,   149760, 0x079be281
-0,         98,         98,        1,   149760, 0xa24bc187
-0,         99,         99,        1,   149760, 0xfbed7e79
-0,        100,        100,        1,   149760, 0xa27c2048
-0,        101,        101,        1,   149760, 0xe6119831
-0,        102,        102,        1,   149760, 0xc75684c6
-0,        103,        103,        1,   149760, 0x76575ef4
-0,        104,        104,        1,   149760, 0xebd32a7e
-0,        105,        105,        1,   149760, 0x6e5c703a
-0,        106,        106,        1,   149760, 0x3c43d0b3
-0,        107,        107,        1,   149760, 0xcc3354af
-0,        108,        108,        1,   149760, 0xa7bc26f3
-0,        109,        109,        1,   149760, 0xb04b0400
-0,        110,        110,        1,   149760, 0x3e5d3995
-0,        111,        111,        1,   149760, 0x549331ae
-0,        112,        112,        1,   149760, 0xd39031c0
-0,        113,        113,        1,   149760, 0xada1a1bd
-0,        114,        114,        1,   149760, 0xd08a4bcb
-0,        115,        115,        1,   149760, 0xcbefb4fa
-0,        116,        116,        1,   149760, 0xb311a7e0
-0,        117,        117,        1,   149760, 0xab23a6f2
-0,        118,        118,        1,   149760, 0xa90a6dfb
-0,        119,        119,        1,   149760, 0xafcc72b7
-0,        120,        120,        1,   149760, 0xe7c48044
-0,        121,        121,        1,   149760, 0x4449cf72
-0,        122,        122,        1,   149760, 0xfe4ba9d7
-0,        123,        123,        1,   149760, 0x76623bda
-0,        124,        124,        1,   149760, 0x8d071b0b
-0,        125,        125,        1,   149760, 0x777aaefa
-0,        126,        126,        1,   149760, 0xab995bab
-0,        127,        127,        1,   149760, 0xfd0e8e0c
-0,        128,        128,        1,   149760, 0xb6d651e5
-0,        129,        129,        1,   149760, 0x0646c2d0
-0,        130,        130,        1,   149760, 0xefc2561a
-0,        131,        131,        1,   149760, 0xaa86dcd1
-0,        132,        132,        1,   149760, 0x0caf821e
-0,        133,        133,        1,   149760, 0x55a5e7fa
-0,        134,        134,        1,   149760, 0x1a011bae
-0,        135,        135,        1,   149760, 0xe7a922b2
-0,        136,        136,        1,   149760, 0x4b968175
-0,        137,        137,        1,   149760, 0xc0bc1018
-0,        138,        138,        1,   149760, 0x58775461
-0,        139,        139,        1,   149760, 0x77dad082
-0,        140,        140,        1,   149760, 0x995e78d7
-0,        141,        141,        1,   149760, 0xc6360898
-0,        142,        142,        1,   149760, 0xbd0b48ce
-0,        143,        143,        1,   149760, 0x6d076602
-0,        144,        144,        1,   149760, 0xc3459e98
-0,        145,        145,        1,   149760, 0x8e53625e
-0,        146,        146,        1,   149760, 0xd1ba7915
-0,        147,        147,        1,   149760, 0xf41a48e7
-0,        148,        148,        1,   149760, 0xc3fbdcc3
-0,        149,        149,        1,   149760, 0x1f726dcf
-0,        150,        150,        1,   149760, 0x6f882d61
-0,        151,        151,        1,   149760, 0x2e02c8c5
-0,        152,        152,        1,   149760, 0x35ed54c6
-0,        153,        153,        1,   149760, 0x11dd8c48
-0,        154,        154,        1,   149760, 0xc95bf20b
-0,        155,        155,        1,   149760, 0x64f96433
-0,        156,        156,        1,   149760, 0x1ab5d8d5
-0,        157,        157,        1,   149760, 0x3af856f0
-0,        158,        158,        1,   149760, 0xdaa3bd1b
-0,        159,        159,        1,   149760, 0x25c64816
-0,        160,        160,        1,   149760, 0x6a4cc5d7
-0,        161,        161,        1,   149760, 0xf8e815f5
-0,        162,        162,        1,   149760, 0xa0bf431e
-0,        163,        163,        1,   149760, 0x09567fc4
-0,        164,        164,        1,   149760, 0x2d9408d7
-0,        165,        165,        1,   149760, 0xe09fff24
-0,        166,        166,        1,   149760, 0x6d58a81b
-0,        167,        167,        1,   149760, 0x0280e181
-0,        168,        168,        1,   149760, 0x465e63d1
-0,        169,        169,        1,   149760, 0xedb432a0
-0,        170,        170,        1,   149760, 0xdff70d73
-0,        171,        171,        1,   149760, 0x9386fdb4
-0,        172,        172,        1,   149760, 0xdcb03cb9
-0,        173,        173,        1,   149760, 0x3538dbd4
-0,        174,        174,        1,   149760, 0xc637709d
-0,        175,        175,        1,   149760, 0x7a1a6681
-0,        176,        176,        1,   149760, 0x403ca1e0
-0,        177,        177,        1,   149760, 0xe562d48a
-0,        178,        178,        1,   149760, 0x90a2e933
-0,        179,        179,        1,   149760, 0x0e9e167a
-0,        180,        180,        1,   149760, 0x2da90c4d
-0,        181,        181,        1,   149760, 0x2ce92218
-0,        182,        182,        1,   149760, 0x164a613d
-0,        183,        183,        1,   149760, 0x336d9e2e
-0,        184,        184,        1,   149760, 0x598986e6
-0,        185,        185,        1,   149760, 0xd0039cfc
-0,        186,        186,        1,   149760, 0x8e74c5e6
-0,        187,        187,        1,   149760, 0xb95fa63c
-0,        188,        188,        1,   149760, 0xc688c596
-0,        189,        189,        1,   149760, 0x4757034b
-0,        190,        190,        1,   149760, 0xc9ac948a
-0,        191,        191,        1,   149760, 0x580b9d60
-0,        192,        192,        1,   149760, 0xf39031d6
-0,        193,        193,        1,   149760, 0x2d68ad7b
-0,        194,        194,        1,   149760, 0xf72815ea
-0,        195,        195,        1,   149760, 0xc16323fa
-0,        196,        196,        1,   149760, 0x8a65665e
-0,        197,        197,        1,   149760, 0xcf1d5a89
-0,        198,        198,        1,   149760, 0x03f3011a
-0,        199,        199,        1,   149760, 0x24c47cbc
-0,        200,        200,        1,   149760, 0xcc89db6d
-0,        201,        201,        1,   149760, 0xd8332e3c
-0,        202,        202,        1,   149760, 0x8a73af5f
-0,        203,        203,        1,   149760, 0x9079e1c5
-0,        204,        204,        1,   149760, 0x7b70b098
-0,        205,        205,        1,   149760, 0x8a0fc720
-0,        206,        206,        1,   149760, 0x92644eef
-0,        207,        207,        1,   149760, 0x75cc5f7a
-0,        208,        208,        1,   149760, 0xf04b9756
-0,        209,        209,        1,   149760, 0x156b33cd
-0,        210,        210,        1,   149760, 0x4876d087
-0,        211,        211,        1,   149760, 0x393c01c8
-0,        212,        212,        1,   149760, 0x29b0a5d9
-0,        213,        213,        1,   149760, 0xd76249a1
-0,        214,        214,        1,   149760, 0xb946135e
-0,        215,        215,        1,   149760, 0x4968f245
-0,        216,        216,        1,   149760, 0xb91e27b2
-0,        217,        217,        1,   149760, 0x485bfa6c
-0,        218,        218,        1,   149760, 0xe7f9fe28
-0,        219,        219,        1,   149760, 0x46a6a837
-0,        220,        220,        1,   149760, 0xd2cf971c
-0,        221,        221,        1,   149760, 0xcb518e01
-0,        222,        222,        1,   149760, 0x7870fcd4
-0,        223,        223,        1,   149760, 0x8af73981
-0,        224,        224,        1,   149760, 0xa90281a7
-0,        225,        225,        1,   149760, 0x3fd9c634
-0,        226,        226,        1,   149760, 0x5c4e7e8a
-0,        227,        227,        1,   149760, 0x520d80e9
-0,        228,        228,        1,   149760, 0xd94a7e31
-0,        229,        229,        1,   149760, 0x2a846f4e
-0,        230,        230,        1,   149760, 0x71f027f1
-0,        231,        231,        1,   149760, 0x6edbe368
-0,        232,        232,        1,   149760, 0x5c9923eb
-0,        233,        233,        1,   149760, 0xff230eab
-0,        234,        234,        1,   149760, 0xc7a5ca99
-0,        235,        235,        1,   149760, 0x50732f2a
-0,        236,        236,        1,   149760, 0xa9f3c8bc
-0,        237,        237,        1,   149760, 0x7fa53464
-0,        238,        238,        1,   149760, 0xe4c2edcd
-0,        239,        239,        1,   149760, 0x43f1e758
-0,        240,        240,        1,   149760, 0xdb6b153b
-0,        241,        241,        1,   149760, 0x0979d792
-0,        242,        242,        1,   149760, 0xaae4a6fd
-0,        243,        243,        1,   149760, 0x7ffd1046
-0,        244,        244,        1,   149760, 0x083becd8
-0,        245,        245,        1,   149760, 0xba86428d
-0,        246,        246,        1,   149760, 0xd4cf652a
-0,        247,        247,        1,   149760, 0xe518a1e4
-0,        248,        248,        1,   149760, 0xfbcf0017
-0,        249,        249,        1,   149760, 0xd827b5b1
-0,        250,        250,        1,   149760, 0x6b95eb0d
-0,        251,        251,        1,   149760, 0x625bf8f9
-0,        252,        252,        1,   149760, 0xde17b8b8
-0,        253,        253,        1,   149760, 0xfd731e76
-0,        254,        254,        1,   149760, 0xae0ce756
-0,        255,        255,        1,   149760, 0x15ec506d
-0,        256,        256,        1,   149760, 0xfc9dba5c
-0,        257,        257,        1,   149760, 0x87e46ba1
-0,        258,        258,        1,   149760, 0x31f1d787
-0,        259,        259,        1,   149760, 0xfbde528e
-0,        260,        260,        1,   149760, 0x152becf8
-0,        261,        261,        1,   149760, 0x008386d7
-0,        262,        262,        1,   149760, 0x53c00ef9
-0,        263,        263,        1,   149760, 0x322d4f0b
-0,        264,        264,        1,   149760, 0xd31bf0ec
-0,        265,        265,        1,   149760, 0x66b5097e
-0,        266,        266,        1,   149760, 0xa9cd719f
-0,        267,        267,        1,   149760, 0x427cdc52
-0,        268,        268,        1,   149760, 0x6647dabc
-0,        269,        269,        1,   149760, 0x651df15f
-0,        270,        270,        1,   149760, 0x4ce124c7
-0,        271,        271,        1,   149760, 0x8ad42ad7
-0,        272,        272,        1,   149760, 0x7303ce98
-0,        273,        273,        1,   149760, 0x0c8ad3ab
-0,        274,        274,        1,   149760, 0x86859065
-0,        275,        275,        1,   149760, 0x97f23fc7
-0,        276,        276,        1,   149760, 0x6fde3d1a
-0,        277,        277,        1,   149760, 0xca12860e
-0,        278,        278,        1,   149760, 0xd0c98709
-0,        279,        279,        1,   149760, 0x8f234c79
-0,        280,        280,        1,   149760, 0xbc6987fa
-0,        281,        281,        1,   149760, 0x40246698
-0,        282,        282,        1,   149760, 0x7f83b9ad
-0,        283,        283,        1,   149760, 0x87a3596b
-0,        284,        284,        1,   149760, 0x0ba5d7f6
-0,        285,        285,        1,   149760, 0x2a015c97
-0,        286,        286,        1,   149760, 0xa1a73e7b
-0,        287,        287,        1,   149760, 0x3c1d8178
-0,        288,        288,        1,   149760, 0x2207f0b6
-0,        289,        289,        1,   149760, 0x1f56738a
-0,        290,        290,        1,   149760, 0x0014e5b6
-0,        291,        291,        1,   149760, 0xe0113ffa
-0,        292,        292,        1,   149760, 0x7df23683
-0,        293,        293,        1,   149760, 0x2a1afb23
-0,        294,        294,        1,   149760, 0x072ced03
-0,        295,        295,        1,   149760, 0x7afca5d3
-0,        296,        296,        1,   149760, 0x6055b3da
-0,        297,        297,        1,   149760, 0xa785c79c
-0,        298,        298,        1,   149760, 0x3606db52
-0,        299,        299,        1,   149760, 0x007fdd05
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RPS_F_docomo_1 b/deps/libav/tests/ref/fate/hevc-conformance-RPS_F_docomo_1
deleted file mode 100644
index 06ae9c1..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RPS_F_docomo_1
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x8edb27d7
-0,          1,          1,        1,   149760, 0x0bdf13f8
-0,          2,          2,        1,   149760, 0x45e702c7
-0,          3,          3,        1,   149760, 0xcc6428c0
-0,          4,          4,        1,   149760, 0xab0ed81d
-0,          5,          5,        1,   149760, 0xb518a0ce
-0,          6,          6,        1,   149760, 0x038340c0
-0,          7,          7,        1,   149760, 0x18ac1285
-0,          8,          8,        1,   149760, 0xfe2eb624
-0,          9,          9,        1,   149760, 0x3f67dcf5
-0,         10,         10,        1,   149760, 0x9a9adbf1
-0,         11,         11,        1,   149760, 0x41c67437
-0,         12,         12,        1,   149760, 0x8450a1d0
-0,         13,         13,        1,   149760, 0xae606230
-0,         14,         14,        1,   149760, 0x0525d4ba
-0,         15,         15,        1,   149760, 0x860755bc
-0,         16,         16,        1,   149760, 0xbf646d22
-0,         17,         17,        1,   149760, 0x64c79745
-0,         18,         18,        1,   149760, 0xa3cf35a4
-0,         19,         19,        1,   149760, 0x23d6f5a2
-0,         20,         20,        1,   149760, 0xf2b8ff71
-0,         21,         21,        1,   149760, 0xb98ba444
-0,         22,         22,        1,   149760, 0xa6c0ffd3
-0,         23,         23,        1,   149760, 0x4501ae0d
-0,         24,         24,        1,   149760, 0xd8ba65d1
-0,         25,         25,        1,   149760, 0x684d982b
-0,         26,         26,        1,   149760, 0x1bf223e0
-0,         27,         27,        1,   149760, 0xf1fb5950
-0,         28,         28,        1,   149760, 0x699f0526
-0,         29,         29,        1,   149760, 0x77d4d641
-0,         30,         30,        1,   149760, 0x0f2cd844
-0,         31,         31,        1,   149760, 0xd99cbe3f
-0,         32,         32,        1,   149760, 0xbd342d08
-0,         33,         33,        1,   149760, 0x0b993f3c
-0,         34,         34,        1,   149760, 0xd89190e2
-0,         35,         35,        1,   149760, 0xfae538e6
-0,         36,         36,        1,   149760, 0x6994c08f
-0,         37,         37,        1,   149760, 0xba181c41
-0,         38,         38,        1,   149760, 0x484f4e19
-0,         39,         39,        1,   149760, 0xd2d8f91d
-0,         40,         40,        1,   149760, 0x1294b154
-0,         41,         41,        1,   149760, 0xd98ad86b
-0,         42,         42,        1,   149760, 0x3867767d
-0,         43,         43,        1,   149760, 0x950d76e0
-0,         44,         44,        1,   149760, 0x752cf844
-0,         45,         45,        1,   149760, 0xd4a11c1c
-0,         46,         46,        1,   149760, 0xf5e6dce6
-0,         47,         47,        1,   149760, 0x2c7ff2a6
-0,         48,         48,        1,   149760, 0x7a48af63
-0,         49,         49,        1,   149760, 0xcb72f57a
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RQT_A_HHI_4 b/deps/libav/tests/ref/fate/hevc-conformance-RQT_A_HHI_4
deleted file mode 100644
index 5f2b9da..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RQT_A_HHI_4
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x5c0f5423
-0,          1,          1,        1,   599040, 0x3d23be58
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RQT_B_HHI_4 b/deps/libav/tests/ref/fate/hevc-conformance-RQT_B_HHI_4
deleted file mode 100644
index dcf2691..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RQT_B_HHI_4
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x69854954
-0,          1,          1,        1,   599040, 0x695ebc85
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RQT_C_HHI_4 b/deps/libav/tests/ref/fate/hevc-conformance-RQT_C_HHI_4
deleted file mode 100644
index 2e88350..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RQT_C_HHI_4
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x65433cfe
-0,          1,          1,        1,   599040, 0x9309e2c5
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RQT_D_HHI_4 b/deps/libav/tests/ref/fate/hevc-conformance-RQT_D_HHI_4
deleted file mode 100644
index 7f73896..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RQT_D_HHI_4
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x88d741bf
-0,          1,          1,        1,   599040, 0xbbd9ab22
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RQT_E_HHI_4 b/deps/libav/tests/ref/fate/hevc-conformance-RQT_E_HHI_4
deleted file mode 100644
index f062318..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RQT_E_HHI_4
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xce2e511d
-0,          1,          1,        1,   599040, 0xe55192d0
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RQT_F_HHI_4 b/deps/libav/tests/ref/fate/hevc-conformance-RQT_F_HHI_4
deleted file mode 100644
index 26bf5ac..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RQT_F_HHI_4
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x65433cfe
-0,          1,          1,        1,   599040, 0x6f99cc5f
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-RQT_G_HHI_4 b/deps/libav/tests/ref/fate/hevc-conformance-RQT_G_HHI_4
deleted file mode 100644
index d36ea01..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-RQT_G_HHI_4
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x5c0f5423
-0,          1,          1,        1,   599040, 0xe805b181
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SAO_A_MediaTek_4 b/deps/libav/tests/ref/fate/hevc-conformance-SAO_A_MediaTek_4
deleted file mode 100644
index 01226d9..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SAO_A_MediaTek_4
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x304198c2
-0,          1,          1,        1,   149760, 0xe765e30d
-0,          2,          2,        1,   149760, 0x0130a054
-0,          3,          3,        1,   149760, 0x169ed0c3
-0,          4,          4,        1,   149760, 0x334881a5
-0,          5,          5,        1,   149760, 0x06cadd37
-0,          6,          6,        1,   149760, 0x5ec4a7ee
-0,          7,          7,        1,   149760, 0x595fd534
-0,          8,          8,        1,   149760, 0xa1d97197
-0,          9,          9,        1,   149760, 0xf79a9d84
-0,         10,         10,        1,   149760, 0x10d84f28
-0,         11,         11,        1,   149760, 0xab375848
-0,         12,         12,        1,   149760, 0x3079f8ca
-0,         13,         13,        1,   149760, 0xac101dfb
-0,         14,         14,        1,   149760, 0x5354f852
-0,         15,         15,        1,   149760, 0x64d709d5
-0,         16,         16,        1,   149760, 0xff669ff2
-0,         17,         17,        1,   149760, 0xd20dd474
-0,         18,         18,        1,   149760, 0x32439e22
-0,         19,         19,        1,   149760, 0x3ae5a118
-0,         20,         20,        1,   149760, 0xebe245ef
-0,         21,         21,        1,   149760, 0x9d046e35
-0,         22,         22,        1,   149760, 0x2e5b2347
-0,         23,         23,        1,   149760, 0x0e683e86
-0,         24,         24,        1,   149760, 0xccc1019e
-0,         25,         25,        1,   149760, 0x42a9571a
-0,         26,         26,        1,   149760, 0x8999386c
-0,         27,         27,        1,   149760, 0x3d164645
-0,         28,         28,        1,   149760, 0x657afc5e
-0,         29,         29,        1,   149760, 0x06f832f9
-0,         30,         30,        1,   149760, 0xfbedfe1e
-0,         31,         31,        1,   149760, 0x1edc2fc5
-0,         32,         32,        1,   149760, 0xe1cee4e7
-0,         33,         33,        1,   149760, 0x43a823e0
-0,         34,         34,        1,   149760, 0xc2f42916
-0,         35,         35,        1,   149760, 0x51db1483
-0,         36,         36,        1,   149760, 0x54a9d6bf
-0,         37,         37,        1,   149760, 0x7324e246
-0,         38,         38,        1,   149760, 0x2523cc9d
-0,         39,         39,        1,   149760, 0xfa3bdce3
-0,         40,         40,        1,   149760, 0xcf9fb7bb
-0,         41,         41,        1,   149760, 0xe914e23c
-0,         42,         42,        1,   149760, 0x6c9fd72a
-0,         43,         43,        1,   149760, 0x3580cca9
-0,         44,         44,        1,   149760, 0x1d4ec5c0
-0,         45,         45,        1,   149760, 0x52c4d418
-0,         46,         46,        1,   149760, 0xb728ae3e
-0,         47,         47,        1,   149760, 0x6616ae50
-0,         48,         48,        1,   149760, 0x6f1a919d
-0,         49,         49,        1,   149760, 0x6e76b774
-0,         50,         50,        1,   149760, 0x6075b37d
-0,         51,         51,        1,   149760, 0xeeb7b8df
-0,         52,         52,        1,   149760, 0xfd979056
-0,         53,         53,        1,   149760, 0xc0fda5ee
-0,         54,         54,        1,   149760, 0xd1329055
-0,         55,         55,        1,   149760, 0x9b179f0f
-0,         56,         56,        1,   149760, 0x7461850a
-0,         57,         57,        1,   149760, 0xe63a86ea
-0,         58,         58,        1,   149760, 0xe85c6f94
-0,         59,         59,        1,   149760, 0x0b857d13
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SAO_B_MediaTek_5 b/deps/libav/tests/ref/fate/hevc-conformance-SAO_B_MediaTek_5
deleted file mode 100644
index 9da0268..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SAO_B_MediaTek_5
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xe56f6a5c
-0,          1,          1,        1,   599040, 0x31ec1bb9
-0,          2,          2,        1,   599040, 0xf3ce0311
-0,          3,          3,        1,   599040, 0x1ae1c223
-0,          4,          4,        1,   599040, 0x4369499d
-0,          5,          5,        1,   599040, 0xd7366bd6
-0,          6,          6,        1,   599040, 0x6d3a9099
-0,          7,          7,        1,   599040, 0x49dea495
-0,          8,          8,        1,   599040, 0x375640e7
-0,          9,          9,        1,   599040, 0x76b6f9b0
-0,         10,         10,        1,   599040, 0x7d1f48cf
-0,         11,         11,        1,   599040, 0x4a01899c
-0,         12,         12,        1,   599040, 0x34ff06e6
-0,         13,         13,        1,   599040, 0x270d874f
-0,         14,         14,        1,   599040, 0x5a091d5c
-0,         15,         15,        1,   599040, 0x36406961
-0,         16,         16,        1,   599040, 0xd32f2687
-0,         17,         17,        1,   599040, 0x8d533cb5
-0,         18,         18,        1,   599040, 0x5f189f98
-0,         19,         19,        1,   599040, 0x32b76de3
-0,         20,         20,        1,   599040, 0x2dd0e738
-0,         21,         21,        1,   599040, 0xbc24fe31
-0,         22,         22,        1,   599040, 0xfd5e6578
-0,         23,         23,        1,   599040, 0x23ea676c
-0,         24,         24,        1,   599040, 0xa86d1f70
-0,         25,         25,        1,   599040, 0xef35e81e
-0,         26,         26,        1,   599040, 0x19e5b355
-0,         27,         27,        1,   599040, 0x9dab17b3
-0,         28,         28,        1,   599040, 0x1aebe590
-0,         29,         29,        1,   599040, 0x6fd9b16e
-0,         30,         30,        1,   599040, 0xd2f3087b
-0,         31,         31,        1,   599040, 0x4bdc5019
-0,         32,         32,        1,   599040, 0xeccd10a0
-0,         33,         33,        1,   599040, 0x1eacd33c
-0,         34,         34,        1,   599040, 0xc73d2b6d
-0,         35,         35,        1,   599040, 0xe1305f2b
-0,         36,         36,        1,   599040, 0xb66c5e54
-0,         37,         37,        1,   599040, 0x0ac17870
-0,         38,         38,        1,   599040, 0x9d976180
-0,         39,         39,        1,   599040, 0x0be7d418
-0,         40,         40,        1,   599040, 0x5c4fb909
-0,         41,         41,        1,   599040, 0x7a4de7c2
-0,         42,         42,        1,   599040, 0x9c0d3ed3
-0,         43,         43,        1,   599040, 0xf9b2ba7e
-0,         44,         44,        1,   599040, 0x78e77b58
-0,         45,         45,        1,   599040, 0xc30ead17
-0,         46,         46,        1,   599040, 0x647c9095
-0,         47,         47,        1,   599040, 0x070d61a3
-0,         48,         48,        1,   599040, 0x0ec33c61
-0,         49,         49,        1,   599040, 0x0adcf4f3
-0,         50,         50,        1,   599040, 0x5cbb5aa6
-0,         51,         51,        1,   599040, 0xb9f99f74
-0,         52,         52,        1,   599040, 0xebc3c13e
-0,         53,         53,        1,   599040, 0x40e76036
-0,         54,         54,        1,   599040, 0xf08d2df3
-0,         55,         55,        1,   599040, 0x47442b55
-0,         56,         56,        1,   599040, 0x147622c1
-0,         57,         57,        1,   599040, 0xc95508a3
-0,         58,         58,        1,   599040, 0x361b8995
-0,         59,         59,        1,   599040, 0x51086ed4
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SAO_C_Samsung_4 b/deps/libav/tests/ref/fate/hevc-conformance-SAO_C_Samsung_4
deleted file mode 100644
index f87921d..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SAO_C_Samsung_4
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xf923a1a0
-0,          1,          1,        1,   149760, 0x614d851a
-0,          2,          2,        1,   149760, 0xc3976ce4
-0,          3,          3,        1,   149760, 0x39925bdc
-0,          4,          4,        1,   149760, 0x86067422
-0,          5,          5,        1,   149760, 0x60dc6078
-0,          6,          6,        1,   149760, 0xac79a412
-0,          7,          7,        1,   149760, 0x3b1bab1e
-0,          8,          8,        1,   149760, 0x7562555f
-0,          9,          9,        1,   149760, 0xf0a2385f
-0,         10,         10,        1,   149760, 0xd2661fa6
-0,         11,         11,        1,   149760, 0x89b30a0a
-0,         12,         12,        1,   149760, 0x3c59f8cb
-0,         13,         13,        1,   149760, 0x70e4da0a
-0,         14,         14,        1,   149760, 0x5e60caa8
-0,         15,         15,        1,   149760, 0x9828a7e0
-0,         16,         16,        1,   149760, 0x11e069a1
-0,         17,         17,        1,   149760, 0xe98a55c2
-0,         18,         18,        1,   149760, 0xaa9f64e5
-0,         19,         19,        1,   149760, 0x03c32cea
-0,         20,         20,        1,   149760, 0x869e0f6e
-0,         21,         21,        1,   149760, 0x54baeff8
-0,         22,         22,        1,   149760, 0xf1f8cc04
-0,         23,         23,        1,   149760, 0x1724aafb
-0,         24,         24,        1,   149760, 0xaf01b9f8
-0,         25,         25,        1,   149760, 0xb1b5bbe9
-0,         26,         26,        1,   149760, 0xd9e6d5a4
-0,         27,         27,        1,   149760, 0x8351ca2d
-0,         28,         28,        1,   149760, 0x38dceffe
-0,         29,         29,        1,   149760, 0x3bffe1c4
-0,         30,         30,        1,   149760, 0x4075b534
-0,         31,         31,        1,   149760, 0x0e8fb246
-0,         32,         32,        1,   149760, 0x70fceafb
-0,         33,         33,        1,   149760, 0x940bec8d
-0,         34,         34,        1,   149760, 0x7d34f896
-0,         35,         35,        1,   149760, 0x39a1d77f
-0,         36,         36,        1,   149760, 0x9755e104
-0,         37,         37,        1,   149760, 0xd584cb48
-0,         38,         38,        1,   149760, 0x06ecdd44
-0,         39,         39,        1,   149760, 0x0226a40d
-0,         40,         40,        1,   149760, 0xb53aaf56
-0,         41,         41,        1,   149760, 0xdad4a984
-0,         42,         42,        1,   149760, 0xa58c9eb0
-0,         43,         43,        1,   149760, 0x7330bde6
-0,         44,         44,        1,   149760, 0x98fcabd9
-0,         45,         45,        1,   149760, 0x9570b74a
-0,         46,         46,        1,   149760, 0x3c1eab60
-0,         47,         47,        1,   149760, 0x2038a069
-0,         48,         48,        1,   149760, 0x672fa347
-0,         49,         49,        1,   149760, 0xa7328b16
-0,         50,         50,        1,   149760, 0x677b6a87
-0,         51,         51,        1,   149760, 0xb036b028
-0,         52,         52,        1,   149760, 0x7a7f9966
-0,         53,         53,        1,   149760, 0xc34b7c39
-0,         54,         54,        1,   149760, 0xb44345ed
-0,         55,         55,        1,   149760, 0x90193c4a
-0,         56,         56,        1,   149760, 0x90986e7b
-0,         57,         57,        1,   149760, 0x5e8e6545
-0,         58,         58,        1,   149760, 0x3ac7758e
-0,         59,         59,        1,   149760, 0x4dd271fb
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SAO_D_Samsung_4 b/deps/libav/tests/ref/fate/hevc-conformance-SAO_D_Samsung_4
deleted file mode 100644
index ce1cefe..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SAO_D_Samsung_4
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x0d2edbbc
-0,          1,          1,        1,   149760, 0x4830af95
-0,          2,          2,        1,   149760, 0x39e8d3bb
-0,          3,          3,        1,   149760, 0x3cc8d639
-0,          4,          4,        1,   149760, 0xfcfe8415
-0,          5,          5,        1,   149760, 0xa6cf9a48
-0,          6,          6,        1,   149760, 0x0fe191b3
-0,          7,          7,        1,   149760, 0x71d26e20
-0,          8,          8,        1,   149760, 0x1ee5541a
-0,          9,          9,        1,   149760, 0x4ac56652
-0,         10,         10,        1,   149760, 0x967e7c2c
-0,         11,         11,        1,   149760, 0x2011ba0c
-0,         12,         12,        1,   149760, 0x2da4bc05
-0,         13,         13,        1,   149760, 0x6354fac2
-0,         14,         14,        1,   149760, 0x799e66ce
-0,         15,         15,        1,   149760, 0x2ca24940
-0,         16,         16,        1,   149760, 0x2a102e28
-0,         17,         17,        1,   149760, 0x652edcce
-0,         18,         18,        1,   149760, 0xb1c34a9a
-0,         19,         19,        1,   149760, 0xfae6ce90
-0,         20,         20,        1,   149760, 0xf42fddbf
-0,         21,         21,        1,   149760, 0x2a8532c3
-0,         22,         22,        1,   149760, 0xbe43addc
-0,         23,         23,        1,   149760, 0x3545f94a
-0,         24,         24,        1,   149760, 0xa35fa6fa
-0,         25,         25,        1,   149760, 0xfed8577f
-0,         26,         26,        1,   149760, 0xac03b492
-0,         27,         27,        1,   149760, 0x1fbdabc9
-0,         28,         28,        1,   149760, 0x99707175
-0,         29,         29,        1,   149760, 0x95e69481
-0,         30,         30,        1,   149760, 0xd68412d8
-0,         31,         31,        1,   149760, 0x9f900e37
-0,         32,         32,        1,   149760, 0x7e6eceba
-0,         33,         33,        1,   149760, 0xd1ca85af
-0,         34,         34,        1,   149760, 0x352b1d50
-0,         35,         35,        1,   149760, 0xdef3e377
-0,         36,         36,        1,   149760, 0x08efcc16
-0,         37,         37,        1,   149760, 0xc20a7c74
-0,         38,         38,        1,   149760, 0xa8e45939
-0,         39,         39,        1,   149760, 0x322546cf
-0,         40,         40,        1,   149760, 0xf7167766
-0,         41,         41,        1,   149760, 0x959f808f
-0,         42,         42,        1,   149760, 0xcca5ccc3
-0,         43,         43,        1,   149760, 0x18789407
-0,         44,         44,        1,   149760, 0xf6c97e87
-0,         45,         45,        1,   149760, 0x58aaba55
-0,         46,         46,        1,   149760, 0xc3529005
-0,         47,         47,        1,   149760, 0x3847adb4
-0,         48,         48,        1,   149760, 0xa4d589db
-0,         49,         49,        1,   149760, 0x9c50dd88
-0,         50,         50,        1,   149760, 0xad087c44
-0,         51,         51,        1,   149760, 0x4a6b656d
-0,         52,         52,        1,   149760, 0x6ec79bcf
-0,         53,         53,        1,   149760, 0x82756cb6
-0,         54,         54,        1,   149760, 0x8b3a9a6a
-0,         55,         55,        1,   149760, 0x775c0430
-0,         56,         56,        1,   149760, 0xbaa08d27
-0,         57,         57,        1,   149760, 0x686cd03f
-0,         58,         58,        1,   149760, 0x1b10dc94
-0,         59,         59,        1,   149760, 0xde81e414
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SAO_E_Canon_4 b/deps/libav/tests/ref/fate/hevc-conformance-SAO_E_Canon_4
deleted file mode 100644
index 92aa7f4..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SAO_E_Canon_4
+++ /dev/null
@@ -1,17 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x1613b277
-0,          1,          1,        1,   149760, 0xf92d5543
-0,          2,          2,        1,   149760, 0xf119ba8e
-0,          3,          3,        1,   149760, 0xbce35d0a
-0,          4,          4,        1,   149760, 0x0f4dc325
-0,          5,          5,        1,   149760, 0xc95379ae
-0,          6,          6,        1,   149760, 0xbf4e9b84
-0,          7,          7,        1,   149760, 0x3a7c3cdf
-0,          8,          8,        1,   149760, 0x8d5e8895
-0,          9,          9,        1,   149760, 0x3128397e
-0,         10,         10,        1,   149760, 0x4389dee6
-0,         11,         11,        1,   149760, 0x8a6a7236
-0,         12,         12,        1,   149760, 0x638049ef
-0,         13,         13,        1,   149760, 0x0075da54
-0,         14,         14,        1,   149760, 0x5fd84a25
-0,         15,         15,        1,   149760, 0xfbd4af2b
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SAO_F_Canon_3 b/deps/libav/tests/ref/fate/hevc-conformance-SAO_F_Canon_3
deleted file mode 100644
index cf24055..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SAO_F_Canon_3
+++ /dev/null
@@ -1,17 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x92b5107a
-0,          1,          1,        1,   149760, 0x97eb31ef
-0,          2,          2,        1,   149760, 0xeb743e30
-0,          3,          3,        1,   149760, 0x5fc53434
-0,          4,          4,        1,   149760, 0x75fb1d63
-0,          5,          5,        1,   149760, 0xba0aeb27
-0,          6,          6,        1,   149760, 0x3f0f1780
-0,          7,          7,        1,   149760, 0xf5d0f052
-0,          8,          8,        1,   149760, 0x598ee54e
-0,          9,          9,        1,   149760, 0x09fcf908
-0,         10,         10,        1,   149760, 0x68209041
-0,         11,         11,        1,   149760, 0x05f519e9
-0,         12,         12,        1,   149760, 0xfdecf9b3
-0,         13,         13,        1,   149760, 0x40c96df8
-0,         14,         14,        1,   149760, 0x4b3d1b7b
-0,         15,         15,        1,   149760, 0xc0691cd9
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SAO_G_Canon_3 b/deps/libav/tests/ref/fate/hevc-conformance-SAO_G_Canon_3
deleted file mode 100644
index 5ce6772..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SAO_G_Canon_3
+++ /dev/null
@@ -1,17 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xc4f239e0
-0,          1,          1,        1,   149760, 0xf57a2e44
-0,          2,          2,        1,   149760, 0xbf1e9995
-0,          3,          3,        1,   149760, 0x5fa25087
-0,          4,          4,        1,   149760, 0x709b4c3f
-0,          5,          5,        1,   149760, 0x63abbd5c
-0,          6,          6,        1,   149760, 0xbd87092a
-0,          7,          7,        1,   149760, 0x59156f4a
-0,          8,          8,        1,   149760, 0xf8ed7d88
-0,          9,          9,        1,   149760, 0xdac1cecf
-0,         10,         10,        1,   149760, 0x7ba3b408
-0,         11,         11,        1,   149760, 0xad4bd5f5
-0,         12,         12,        1,   149760, 0x4b1f83c6
-0,         13,         13,        1,   149760, 0x7329797f
-0,         14,         14,        1,   149760, 0x1d201f16
-0,         15,         15,        1,   149760, 0xde263a30
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SDH_A_Orange_3 b/deps/libav/tests/ref/fate/hevc-conformance-SDH_A_Orange_3
deleted file mode 100644
index caf90ee..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SDH_A_Orange_3
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0x0117aa5d
-0,          1,          1,        1,  3110400, 0xa737bc56
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SLICES_A_Rovi_3 b/deps/libav/tests/ref/fate/hevc-conformance-SLICES_A_Rovi_3
deleted file mode 100644
index f884f7f..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SLICES_A_Rovi_3
+++ /dev/null
@@ -1,10 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   460800, 0x7f06cb02
-0,          1,          1,        1,   460800, 0x1ad483aa
-0,          2,          2,        1,   460800, 0x1bbbc991
-0,          3,          3,        1,   460800, 0x8fe7afa5
-0,          4,          4,        1,   460800, 0xe609cb0b
-0,          5,          5,        1,   460800, 0xcc65fec8
-0,          6,          6,        1,   460800, 0xa0601519
-0,          7,          7,        1,   460800, 0x8b0d3002
-0,          8,          8,        1,   460800, 0x7b1191af
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SLIST_A_Sony_4 b/deps/libav/tests/ref/fate/hevc-conformance-SLIST_A_Sony_4
deleted file mode 100644
index ebb65c3..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SLIST_A_Sony_4
+++ /dev/null
@@ -1,66 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xbd0eb43e
-0,          1,          1,        1,   599040, 0x4c3a98b5
-0,          2,          2,        1,   599040, 0x105410dc
-0,          3,          3,        1,   599040, 0xffaff69c
-0,          4,          4,        1,   599040, 0x39cb22ea
-0,          5,          5,        1,   599040, 0xa19296c3
-0,          6,          6,        1,   599040, 0x84cad39d
-0,          7,          7,        1,   599040, 0x5dc5c5a9
-0,          8,          8,        1,   599040, 0xc6a2c0dd
-0,          9,          9,        1,   599040, 0xeb5947bf
-0,         10,         10,        1,   599040, 0x9f8f9ce5
-0,         11,         11,        1,   599040, 0xdce5be4e
-0,         12,         12,        1,   599040, 0x07141c84
-0,         13,         13,        1,   599040, 0x3a05273d
-0,         14,         14,        1,   599040, 0xa16a112c
-0,         15,         15,        1,   599040, 0x6fa79123
-0,         16,         16,        1,   599040, 0xbda4cf46
-0,         17,         17,        1,   599040, 0xa5a81a05
-0,         18,         18,        1,   599040, 0x7370af29
-0,         19,         19,        1,   599040, 0xbd70e89e
-0,         20,         20,        1,   599040, 0xe7850613
-0,         21,         21,        1,   599040, 0xfaa8cf89
-0,         22,         22,        1,   599040, 0x30a78a21
-0,         23,         23,        1,   599040, 0x5520a8cf
-0,         24,         24,        1,   599040, 0xbcd93ea7
-0,         25,         25,        1,   599040, 0xd8ce632c
-0,         26,         26,        1,   599040, 0x87c6476f
-0,         27,         27,        1,   599040, 0xf6799dcc
-0,         28,         28,        1,   599040, 0xc0370664
-0,         29,         29,        1,   599040, 0x17196bd3
-0,         30,         30,        1,   599040, 0xe7ae6de3
-0,         31,         31,        1,   599040, 0x0345bc72
-0,         32,         32,        1,   599040, 0x7b86141e
-0,         33,         33,        1,   599040, 0x65564792
-0,         34,         34,        1,   599040, 0xf90c7f54
-0,         35,         35,        1,   599040, 0x00ce2f3c
-0,         36,         36,        1,   599040, 0xe6b185f2
-0,         37,         37,        1,   599040, 0x513942f1
-0,         38,         38,        1,   599040, 0x7c27b03a
-0,         39,         39,        1,   599040, 0xa201fea3
-0,         40,         40,        1,   599040, 0x5023fd92
-0,         41,         41,        1,   599040, 0xe05ba218
-0,         42,         42,        1,   599040, 0x84b61765
-0,         43,         43,        1,   599040, 0xfa6c8f65
-0,         44,         44,        1,   599040, 0xede8ef78
-0,         45,         45,        1,   599040, 0xcd2763f2
-0,         46,         46,        1,   599040, 0xb83e3bc6
-0,         47,         47,        1,   599040, 0x99fb3a3e
-0,         48,         48,        1,   599040, 0x3dd1e5ac
-0,         49,         49,        1,   599040, 0x776d7464
-0,         50,         50,        1,   599040, 0xaea89891
-0,         51,         51,        1,   599040, 0xfc0f1ec9
-0,         52,         52,        1,   599040, 0x2621f36f
-0,         53,         53,        1,   599040, 0x41101bbc
-0,         54,         54,        1,   599040, 0x7a5d4d0e
-0,         55,         55,        1,   599040, 0xc04fb148
-0,         56,         56,        1,   599040, 0x889d8186
-0,         57,         57,        1,   599040, 0x26f091bf
-0,         58,         58,        1,   599040, 0xe6644a2d
-0,         59,         59,        1,   599040, 0xd48efb7f
-0,         60,         60,        1,   599040, 0xe25204e3
-0,         61,         61,        1,   599040, 0x928f2efd
-0,         62,         62,        1,   599040, 0x535a4f2d
-0,         63,         63,        1,   599040, 0x2672ad63
-0,         64,         64,        1,   599040, 0x194f1463
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SLIST_B_Sony_8 b/deps/libav/tests/ref/fate/hevc-conformance-SLIST_B_Sony_8
deleted file mode 100644
index fc39039..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SLIST_B_Sony_8
+++ /dev/null
@@ -1,66 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xbd0eb43e
-0,          1,          1,        1,   599040, 0x3ea696c4
-0,          2,          2,        1,   599040, 0x866beffc
-0,          3,          3,        1,   599040, 0x89622860
-0,          4,          4,        1,   599040, 0x416bcaf8
-0,          5,          5,        1,   599040, 0x4098709b
-0,          6,          6,        1,   599040, 0x8d1ef343
-0,          7,          7,        1,   599040, 0xbd1bbc79
-0,          8,          8,        1,   599040, 0xc6a2c0dd
-0,          9,          9,        1,   599040, 0x438cc40e
-0,         10,         10,        1,   599040, 0xb666a438
-0,         11,         11,        1,   599040, 0x114580e4
-0,         12,         12,        1,   599040, 0xb75c41dc
-0,         13,         13,        1,   599040, 0x52e1e32f
-0,         14,         14,        1,   599040, 0x22835865
-0,         15,         15,        1,   599040, 0xfb0e0003
-0,         16,         16,        1,   599040, 0xebcb1ef9
-0,         17,         17,        1,   599040, 0xd6939619
-0,         18,         18,        1,   599040, 0xe22afdd8
-0,         19,         19,        1,   599040, 0xff4a248f
-0,         20,         20,        1,   599040, 0x9fc3878e
-0,         21,         21,        1,   599040, 0xce2f6499
-0,         22,         22,        1,   599040, 0x04aa9986
-0,         23,         23,        1,   599040, 0x68ba9838
-0,         24,         24,        1,   599040, 0x62e950a9
-0,         25,         25,        1,   599040, 0x5161526d
-0,         26,         26,        1,   599040, 0xcdde709e
-0,         27,         27,        1,   599040, 0x8c48ded1
-0,         28,         28,        1,   599040, 0x3451ecbb
-0,         29,         29,        1,   599040, 0xfc5a5fca
-0,         30,         30,        1,   599040, 0x7c0090fe
-0,         31,         31,        1,   599040, 0xbc4eb1de
-0,         32,         32,        1,   599040, 0x5350cf4f
-0,         33,         33,        1,   599040, 0x175152d6
-0,         34,         34,        1,   599040, 0xcf65acea
-0,         35,         35,        1,   599040, 0x099a7298
-0,         36,         36,        1,   599040, 0x31b7a2a2
-0,         37,         37,        1,   599040, 0xd6a71415
-0,         38,         38,        1,   599040, 0xe68880e7
-0,         39,         39,        1,   599040, 0x0c7d0373
-0,         40,         40,        1,   599040, 0xfb56ac78
-0,         41,         41,        1,   599040, 0x1177b0dd
-0,         42,         42,        1,   599040, 0x1393026f
-0,         43,         43,        1,   599040, 0xc6346b58
-0,         44,         44,        1,   599040, 0x2949cd11
-0,         45,         45,        1,   599040, 0xff867f22
-0,         46,         46,        1,   599040, 0xef196e4d
-0,         47,         47,        1,   599040, 0x17a2332c
-0,         48,         48,        1,   599040, 0x45d59fbc
-0,         49,         49,        1,   599040, 0x5f51575c
-0,         50,         50,        1,   599040, 0x6049a451
-0,         51,         51,        1,   599040, 0x4d6086ac
-0,         52,         52,        1,   599040, 0xd709596b
-0,         53,         53,        1,   599040, 0xacdbc22f
-0,         54,         54,        1,   599040, 0x45c11bb5
-0,         55,         55,        1,   599040, 0x608a7c7e
-0,         56,         56,        1,   599040, 0x242a67c9
-0,         57,         57,        1,   599040, 0x2d186d8a
-0,         58,         58,        1,   599040, 0x07ed9fd5
-0,         59,         59,        1,   599040, 0xaee9a49b
-0,         60,         60,        1,   599040, 0xaeb2b2a2
-0,         61,         61,        1,   599040, 0x4ca2d84b
-0,         62,         62,        1,   599040, 0x4254b5f6
-0,         63,         63,        1,   599040, 0x105c7a25
-0,         64,         64,        1,   599040, 0x87b51bce
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SLIST_C_Sony_3 b/deps/libav/tests/ref/fate/hevc-conformance-SLIST_C_Sony_3
deleted file mode 100644
index 482e56f..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SLIST_C_Sony_3
+++ /dev/null
@@ -1,66 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xc3e98658
-0,          1,          1,        1,   599040, 0x621fa0b7
-0,          2,          2,        1,   599040, 0x53b2e637
-0,          3,          3,        1,   599040, 0x1db118c2
-0,          4,          4,        1,   599040, 0xa25003ba
-0,          5,          5,        1,   599040, 0x51de524b
-0,          6,          6,        1,   599040, 0x5f01f648
-0,          7,          7,        1,   599040, 0x43d8c9cb
-0,          8,          8,        1,   599040, 0xf7f6c7f6
-0,          9,          9,        1,   599040, 0xb08885ec
-0,         10,         10,        1,   599040, 0x1e6e91a7
-0,         11,         11,        1,   599040, 0x18549abd
-0,         12,         12,        1,   599040, 0xef523cbc
-0,         13,         13,        1,   599040, 0x87985e99
-0,         14,         14,        1,   599040, 0x37521482
-0,         15,         15,        1,   599040, 0xe9fbc0ce
-0,         16,         16,        1,   599040, 0x20bab233
-0,         17,         17,        1,   599040, 0xbe3525e6
-0,         18,         18,        1,   599040, 0xace46e50
-0,         19,         19,        1,   599040, 0xf709b3a9
-0,         20,         20,        1,   599040, 0xf2690bc8
-0,         21,         21,        1,   599040, 0x7eacdec3
-0,         22,         22,        1,   599040, 0xaed66c65
-0,         23,         23,        1,   599040, 0x066b2fa6
-0,         24,         24,        1,   599040, 0x5dc050bd
-0,         25,         25,        1,   599040, 0x170e7de1
-0,         26,         26,        1,   599040, 0x2ccd7b16
-0,         27,         27,        1,   599040, 0x4f7bc972
-0,         28,         28,        1,   599040, 0x72d7f274
-0,         29,         29,        1,   599040, 0x44d2396e
-0,         30,         30,        1,   599040, 0xe4dc9b54
-0,         31,         31,        1,   599040, 0xfacba54d
-0,         32,         32,        1,   599040, 0x7b86141e
-0,         33,         33,        1,   599040, 0x65564792
-0,         34,         34,        1,   599040, 0xf90c7f54
-0,         35,         35,        1,   599040, 0x00ce2f3c
-0,         36,         36,        1,   599040, 0xe6b185f2
-0,         37,         37,        1,   599040, 0x513942f1
-0,         38,         38,        1,   599040, 0x7c27b03a
-0,         39,         39,        1,   599040, 0xa201fea3
-0,         40,         40,        1,   599040, 0x5023fd92
-0,         41,         41,        1,   599040, 0xe05ba218
-0,         42,         42,        1,   599040, 0x84b61765
-0,         43,         43,        1,   599040, 0xfa6c8f65
-0,         44,         44,        1,   599040, 0xede8ef78
-0,         45,         45,        1,   599040, 0xcd2763f2
-0,         46,         46,        1,   599040, 0xb83e3bc6
-0,         47,         47,        1,   599040, 0x99fb3a3e
-0,         48,         48,        1,   599040, 0x3dd1e5ac
-0,         49,         49,        1,   599040, 0x776d7464
-0,         50,         50,        1,   599040, 0xaea89891
-0,         51,         51,        1,   599040, 0xfc0f1ec9
-0,         52,         52,        1,   599040, 0x2621f36f
-0,         53,         53,        1,   599040, 0x41101bbc
-0,         54,         54,        1,   599040, 0x7a5d4d0e
-0,         55,         55,        1,   599040, 0xc04fb148
-0,         56,         56,        1,   599040, 0x889d8186
-0,         57,         57,        1,   599040, 0x26f091bf
-0,         58,         58,        1,   599040, 0xe6644a2d
-0,         59,         59,        1,   599040, 0xd48efb7f
-0,         60,         60,        1,   599040, 0xe25204e3
-0,         61,         61,        1,   599040, 0x928f2efd
-0,         62,         62,        1,   599040, 0x535a4f2d
-0,         63,         63,        1,   599040, 0x2672ad63
-0,         64,         64,        1,   599040, 0x194f1463
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SLIST_D_Sony_9 b/deps/libav/tests/ref/fate/hevc-conformance-SLIST_D_Sony_9
deleted file mode 100644
index 384f81f..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SLIST_D_Sony_9
+++ /dev/null
@@ -1,66 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0xf3038515
-0,          1,          1,        1,   599040, 0xb1bc9386
-0,          2,          2,        1,   599040, 0xa069e86f
-0,          3,          3,        1,   599040, 0xdf7c4cb7
-0,          4,          4,        1,   599040, 0xefaa2ac5
-0,          5,          5,        1,   599040, 0x81c67c18
-0,          6,          6,        1,   599040, 0xeb1a0669
-0,          7,          7,        1,   599040, 0xbab3c0b8
-0,          8,          8,        1,   599040, 0x82b99936
-0,          9,          9,        1,   599040, 0x027a90d1
-0,         10,         10,        1,   599040, 0x5d6d7489
-0,         11,         11,        1,   599040, 0xeaaf6d39
-0,         12,         12,        1,   599040, 0x7788f8fa
-0,         13,         13,        1,   599040, 0x654393e8
-0,         14,         14,        1,   599040, 0xc6c2237c
-0,         15,         15,        1,   599040, 0x8b16d890
-0,         16,         16,        1,   599040, 0x2c36eed0
-0,         17,         17,        1,   599040, 0x02792aa8
-0,         18,         18,        1,   599040, 0xf4088e47
-0,         19,         19,        1,   599040, 0xea9796ad
-0,         20,         20,        1,   599040, 0xa4aecc01
-0,         21,         21,        1,   599040, 0x2ec8c1c4
-0,         22,         22,        1,   599040, 0xcfa87d49
-0,         23,         23,        1,   599040, 0x012b62f1
-0,         24,         24,        1,   599040, 0xd8b72ae0
-0,         25,         25,        1,   599040, 0xe0ca1977
-0,         26,         26,        1,   599040, 0x3f048981
-0,         27,         27,        1,   599040, 0xe416a928
-0,         28,         28,        1,   599040, 0xdfef9086
-0,         29,         29,        1,   599040, 0xd810cd6a
-0,         30,         30,        1,   599040, 0x11fab789
-0,         31,         31,        1,   599040, 0x90a890d5
-0,         32,         32,        1,   599040, 0x0dabef8d
-0,         33,         33,        1,   599040, 0x7a32557d
-0,         34,         34,        1,   599040, 0xc3427914
-0,         35,         35,        1,   599040, 0x65266a45
-0,         36,         36,        1,   599040, 0x8b5e9213
-0,         37,         37,        1,   599040, 0x4e2e2b0a
-0,         38,         38,        1,   599040, 0xaebdb406
-0,         39,         39,        1,   599040, 0xca35eadb
-0,         40,         40,        1,   599040, 0xb711adc7
-0,         41,         41,        1,   599040, 0x594d28b9
-0,         42,         42,        1,   599040, 0x27fec3c9
-0,         43,         43,        1,   599040, 0x35fe73ce
-0,         44,         44,        1,   599040, 0x3069c845
-0,         45,         45,        1,   599040, 0x2df2a12d
-0,         46,         46,        1,   599040, 0x96d42f5c
-0,         47,         47,        1,   599040, 0x95d9319b
-0,         48,         48,        1,   599040, 0x4f8c92aa
-0,         49,         49,        1,   599040, 0x29620b31
-0,         50,         50,        1,   599040, 0x3d1441f7
-0,         51,         51,        1,   599040, 0x7040914d
-0,         52,         52,        1,   599040, 0x95a73274
-0,         53,         53,        1,   599040, 0xda51c6c7
-0,         54,         54,        1,   599040, 0x41592676
-0,         55,         55,        1,   599040, 0xf21c682b
-0,         56,         56,        1,   599040, 0x5d6b65cf
-0,         57,         57,        1,   599040, 0x13fc6e8e
-0,         58,         58,        1,   599040, 0xe05ec001
-0,         59,         59,        1,   599040, 0x06113d89
-0,         60,         60,        1,   599040, 0x1d74bd0d
-0,         61,         61,        1,   599040, 0x757ffab3
-0,         62,         62,        1,   599040, 0x0599c7fb
-0,         63,         63,        1,   599040, 0x8aaa91ed
-0,         64,         64,        1,   599040, 0x79582f08
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-SLPPLP_A_VIDYO_1 b/deps/libav/tests/ref/fate/hevc-conformance-SLPPLP_A_VIDYO_1
deleted file mode 100644
index bbb3cfe..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-SLPPLP_A_VIDYO_1
+++ /dev/null
@@ -1,34 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x88619f80
-0,          1,          1,        1,   149760, 0x550bdaf0
-0,          2,          2,        1,   149760, 0x99440a14
-0,          3,          3,        1,   149760, 0xcc2c2049
-0,          4,          4,        1,   149760, 0x46927368
-0,          5,          5,        1,   149760, 0x53cdb3fe
-0,          6,          6,        1,   149760, 0x654df025
-0,          7,          7,        1,   149760, 0x024d24bc
-0,          8,          8,        1,   149760, 0x409138c2
-0,          9,          9,        1,   149760, 0xfbb47c48
-0,         10,         10,        1,   149760, 0x18caa19d
-0,         11,         11,        1,   149760, 0x0f88c2e5
-0,         12,         12,        1,   149760, 0x1c16aa2d
-0,         13,         13,        1,   149760, 0x60bfcce8
-0,         14,         14,        1,   149760, 0x1c38e3d3
-0,         15,         15,        1,   149760, 0x0d5b044a
-0,         16,         16,        1,   149760, 0x93d21593
-0,         17,         17,        1,   149760, 0xdf283910
-0,         18,         18,        1,   149760, 0x03324c23
-0,         19,         19,        1,   149760, 0x3b175b7b
-0,         20,         20,        1,   149760, 0xb91b9a7e
-0,         21,         21,        1,   149760, 0x734fbbe7
-0,         22,         22,        1,   149760, 0xfc3fea48
-0,         23,         23,        1,   149760, 0x6609103e
-0,         24,         24,        1,   149760, 0x3f5916fa
-0,         25,         25,        1,   149760, 0x08e43f4d
-0,         26,         26,        1,   149760, 0xc84e5471
-0,         27,         27,        1,   149760, 0xbd4e5c8d
-0,         28,         28,        1,   149760, 0x4a4d3995
-0,         29,         29,        1,   149760, 0x662163c0
-0,         30,         30,        1,   149760, 0xda28671f
-0,         31,         31,        1,   149760, 0x19e1878e
-0,         32,         32,        1,   149760, 0x19807e67
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-STRUCT_A_Samsung_5 b/deps/libav/tests/ref/fate/hevc-conformance-STRUCT_A_Samsung_5
deleted file mode 100644
index da5cfa1..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-STRUCT_A_Samsung_5
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x479fa7ca
-0,          1,          1,        1,   149760, 0x761fb3a3
-0,          2,          2,        1,   149760, 0xa0f4cd97
-0,          3,          3,        1,   149760, 0x22a0c92b
-0,          4,          4,        1,   149760, 0xdedc8cb2
-0,          5,          5,        1,   149760, 0x38da8674
-0,          6,          6,        1,   149760, 0xe5d77e68
-0,          7,          7,        1,   149760, 0x31cc6196
-0,          8,          8,        1,   149760, 0xdb70f4d3
-0,          9,          9,        1,   149760, 0x966b6f89
-0,         10,         10,        1,   149760, 0x2297ff66
-0,         11,         11,        1,   149760, 0x2a2fa4e7
-0,         12,         12,        1,   149760, 0x217442b7
-0,         13,         13,        1,   149760, 0x5341ff7f
-0,         14,         14,        1,   149760, 0xb413af37
-0,         15,         15,        1,   149760, 0x61c86ce5
-0,         16,         16,        1,   149760, 0x6b1a0c63
-0,         17,         17,        1,   149760, 0x4596d2e5
-0,         18,         18,        1,   149760, 0xafc0abbd
-0,         19,         19,        1,   149760, 0xb9197a81
-0,         20,         20,        1,   149760, 0xf67d43f3
-0,         21,         21,        1,   149760, 0xe7ef11f2
-0,         22,         22,        1,   149760, 0x89180592
-0,         23,         23,        1,   149760, 0xf6900816
-0,         24,         24,        1,   149760, 0x7cb2f3c0
-0,         25,         25,        1,   149760, 0x71c269f5
-0,         26,         26,        1,   149760, 0x19720666
-0,         27,         27,        1,   149760, 0x5794f402
-0,         28,         28,        1,   149760, 0xe08bf8d2
-0,         29,         29,        1,   149760, 0x11638859
-0,         30,         30,        1,   149760, 0x5024fddc
-0,         31,         31,        1,   149760, 0x8b3d4a37
-0,         32,         32,        1,   149760, 0x5f727144
-0,         33,         33,        1,   149760, 0xb6cf2d76
-0,         34,         34,        1,   149760, 0xf528b070
-0,         35,         35,        1,   149760, 0x3e95f116
-0,         36,         36,        1,   149760, 0x1db5f92a
-0,         37,         37,        1,   149760, 0xf8331667
-0,         38,         38,        1,   149760, 0x57ca4161
-0,         39,         39,        1,   149760, 0x7add32bd
-0,         40,         40,        1,   149760, 0x4b84af44
-0,         41,         41,        1,   149760, 0xf3e1eeaf
-0,         42,         42,        1,   149760, 0x0d602ea8
-0,         43,         43,        1,   149760, 0x420bfdf8
-0,         44,         44,        1,   149760, 0x6e2eb72f
-0,         45,         45,        1,   149760, 0x0450e4ba
-0,         46,         46,        1,   149760, 0xbfa60971
-0,         47,         47,        1,   149760, 0x89791529
-0,         48,         48,        1,   149760, 0x4e32e37b
-0,         49,         49,        1,   149760, 0x273f0927
-0,         50,         50,        1,   149760, 0x0373f961
-0,         51,         51,        1,   149760, 0x5f105bd2
-0,         52,         52,        1,   149760, 0x6b1b290a
-0,         53,         53,        1,   149760, 0xeaad4ccb
-0,         54,         54,        1,   149760, 0xeb21c2e6
-0,         55,         55,        1,   149760, 0x342ff483
-0,         56,         56,        1,   149760, 0x0ac70398
-0,         57,         57,        1,   149760, 0x5366fd7c
-0,         58,         58,        1,   149760, 0xc05249b6
-0,         59,         59,        1,   149760, 0x32279e70
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-STRUCT_B_Samsung_4 b/deps/libav/tests/ref/fate/hevc-conformance-STRUCT_B_Samsung_4
deleted file mode 100644
index c03111c..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-STRUCT_B_Samsung_4
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   599040, 0x4b489a60
-0,          1,          1,        1,   599040, 0x80369c9a
-0,          2,          2,        1,   599040, 0x33189b1a
-0,          3,          3,        1,   599040, 0x01d73abb
-0,          4,          4,        1,   599040, 0xd5de0ab7
-0,          5,          5,        1,   599040, 0xf7b9f1c3
-0,          6,          6,        1,   599040, 0xe72b6446
-0,          7,          7,        1,   599040, 0xf78cc5d6
-0,          8,          8,        1,   599040, 0x9c6d33a2
-0,          9,          9,        1,   599040, 0xacb6cb08
-0,         10,         10,        1,   599040, 0x2a215019
-0,         11,         11,        1,   599040, 0xcd89d5be
-0,         12,         12,        1,   599040, 0x60403ebb
-0,         13,         13,        1,   599040, 0xc5c62e88
-0,         14,         14,        1,   599040, 0x93403d23
-0,         15,         15,        1,   599040, 0x6b86071d
-0,         16,         16,        1,   599040, 0xfaaad32f
-0,         17,         17,        1,   599040, 0x68651db5
-0,         18,         18,        1,   599040, 0xfbedeba6
-0,         19,         19,        1,   599040, 0x7fa3a0c0
-0,         20,         20,        1,   599040, 0x76b34545
-0,         21,         21,        1,   599040, 0x34e4c1cd
-0,         22,         22,        1,   599040, 0xfad3eda9
-0,         23,         23,        1,   599040, 0xf4324901
-0,         24,         24,        1,   599040, 0x991b4fde
-0,         25,         25,        1,   599040, 0xd9d7823d
-0,         26,         26,        1,   599040, 0xd8a80ca5
-0,         27,         27,        1,   599040, 0x19ae0251
-0,         28,         28,        1,   599040, 0xfa68cda7
-0,         29,         29,        1,   599040, 0xb9c72f07
-0,         30,         30,        1,   599040, 0xf1df5f78
-0,         31,         31,        1,   599040, 0xda75192b
-0,         32,         32,        1,   599040, 0x1102b6e6
-0,         33,         33,        1,   599040, 0x259ec490
-0,         34,         34,        1,   599040, 0xee1dabe5
-0,         35,         35,        1,   599040, 0xf6bf5454
-0,         36,         36,        1,   599040, 0x058061be
-0,         37,         37,        1,   599040, 0x2f9aebeb
-0,         38,         38,        1,   599040, 0x169c0bff
-0,         39,         39,        1,   599040, 0xeffb5a9f
-0,         40,         40,        1,   599040, 0xb3bbebac
-0,         41,         41,        1,   599040, 0x174af746
-0,         42,         42,        1,   599040, 0x8359db57
-0,         43,         43,        1,   599040, 0xdd7693ad
-0,         44,         44,        1,   599040, 0x05aebad4
-0,         45,         45,        1,   599040, 0xc34fd8bc
-0,         46,         46,        1,   599040, 0x2798f32e
-0,         47,         47,        1,   599040, 0x319b9b8c
-0,         48,         48,        1,   599040, 0xa28d783f
-0,         49,         49,        1,   599040, 0x5c79026f
-0,         50,         50,        1,   599040, 0xd4ae9b08
-0,         51,         51,        1,   599040, 0x79b19064
-0,         52,         52,        1,   599040, 0xe773bd75
-0,         53,         53,        1,   599040, 0xfbeda52a
-0,         54,         54,        1,   599040, 0x2ed916e6
-0,         55,         55,        1,   599040, 0xd3243fe7
-0,         56,         56,        1,   599040, 0xfdbc20e8
-0,         57,         57,        1,   599040, 0x80983226
-0,         58,         58,        1,   599040, 0x51c66b23
-0,         59,         59,        1,   599040, 0x30816b80
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-TILES_A_Cisco_2 b/deps/libav/tests/ref/fate/hevc-conformance-TILES_A_Cisco_2
deleted file mode 100644
index 63c9722..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-TILES_A_Cisco_2
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0xfc052e85
-0,          1,          1,        1,  3110400, 0xfb49bf20
-0,          2,          2,        1,  3110400, 0x549eef2b
-0,          3,          3,        1,  3110400, 0xc3857801
-0,          4,          4,        1,  3110400, 0xb27d6aea
-0,          5,          5,        1,  3110400, 0xa52e1d58
-0,          6,          6,        1,  3110400, 0x02d348e6
-0,          7,          7,        1,  3110400, 0x45a9c47c
-0,          8,          8,        1,  3110400, 0xc308e886
-0,          9,          9,        1,  3110400, 0x43cd6ed6
-0,         10,         10,        1,  3110400, 0x29a054ce
-0,         11,         11,        1,  3110400, 0x76fbd08e
-0,         12,         12,        1,  3110400, 0x8638d5e2
-0,         13,         13,        1,  3110400, 0xfb4b7823
-0,         14,         14,        1,  3110400, 0x66185e15
-0,         15,         15,        1,  3110400, 0x82eaea0a
-0,         16,         16,        1,  3110400, 0x5895f1c6
-0,         17,         17,        1,  3110400, 0x0a28a1c7
-0,         18,         18,        1,  3110400, 0x37f2ecc8
-0,         19,         19,        1,  3110400, 0x0ad8b6c1
-0,         20,         20,        1,  3110400, 0x90300dcb
-0,         21,         21,        1,  3110400, 0x9731112d
-0,         22,         22,        1,  3110400, 0x5078ba88
-0,         23,         23,        1,  3110400, 0xdcfbacae
-0,         24,         24,        1,  3110400, 0x40769123
-0,         25,         25,        1,  3110400, 0xa09f4d29
-0,         26,         26,        1,  3110400, 0xa3749feb
-0,         27,         27,        1,  3110400, 0xb04c36ae
-0,         28,         28,        1,  3110400, 0x4d30c177
-0,         29,         29,        1,  3110400, 0xe247070a
-0,         30,         30,        1,  3110400, 0x84c669d5
-0,         31,         31,        1,  3110400, 0x3e0529e6
-0,         32,         32,        1,  3110400, 0xd0d58b7a
-0,         33,         33,        1,  3110400, 0x05de0ffa
-0,         34,         34,        1,  3110400, 0x7d10a27f
-0,         35,         35,        1,  3110400, 0x87dd43fe
-0,         36,         36,        1,  3110400, 0xc6f39e98
-0,         37,         37,        1,  3110400, 0x9bf5a18b
-0,         38,         38,        1,  3110400, 0x4880f4e6
-0,         39,         39,        1,  3110400, 0xbba7a2fd
-0,         40,         40,        1,  3110400, 0x82fe2a14
-0,         41,         41,        1,  3110400, 0x7e701e1c
-0,         42,         42,        1,  3110400, 0x23cdbc0c
-0,         43,         43,        1,  3110400, 0xf15977e6
-0,         44,         44,        1,  3110400, 0x50df6fe2
-0,         45,         45,        1,  3110400, 0x8913ddde
-0,         46,         46,        1,  3110400, 0x633c8c0e
-0,         47,         47,        1,  3110400, 0xea604347
-0,         48,         48,        1,  3110400, 0xa5049365
-0,         49,         49,        1,  3110400, 0x35da77a8
-0,         50,         50,        1,  3110400, 0xcfa4af57
-0,         51,         51,        1,  3110400, 0x5a3bfe64
-0,         52,         52,        1,  3110400, 0x91f9ee34
-0,         53,         53,        1,  3110400, 0x21b0df73
-0,         54,         54,        1,  3110400, 0x7807baf2
-0,         55,         55,        1,  3110400, 0x96dbaf03
-0,         56,         56,        1,  3110400, 0xb8d29f57
-0,         57,         57,        1,  3110400, 0x1a04f732
-0,         58,         58,        1,  3110400, 0x54a34b35
-0,         59,         59,        1,  3110400, 0x4850a07a
-0,         60,         60,        1,  3110400, 0x7010be29
-0,         61,         61,        1,  3110400, 0x7178d2e7
-0,         62,         62,        1,  3110400, 0x17483898
-0,         63,         63,        1,  3110400, 0x4c55872a
-0,         64,         64,        1,  3110400, 0xe67b0f06
-0,         65,         65,        1,  3110400, 0x958789cf
-0,         66,         66,        1,  3110400, 0x5cd6ba06
-0,         67,         67,        1,  3110400, 0xb7852fe2
-0,         68,         68,        1,  3110400, 0x8b67bd9f
-0,         69,         69,        1,  3110400, 0x9555c0ff
-0,         70,         70,        1,  3110400, 0x6b99aab7
-0,         71,         71,        1,  3110400, 0xcab904b7
-0,         72,         72,        1,  3110400, 0xeb915c25
-0,         73,         73,        1,  3110400, 0xd3066bd8
-0,         74,         74,        1,  3110400, 0xa2d45cb5
-0,         75,         75,        1,  3110400, 0x011db978
-0,         76,         76,        1,  3110400, 0xf35b9f2c
-0,         77,         77,        1,  3110400, 0x6afd3bde
-0,         78,         78,        1,  3110400, 0xa1ad77b7
-0,         79,         79,        1,  3110400, 0x8b4d3823
-0,         80,         80,        1,  3110400, 0xd806be79
-0,         81,         81,        1,  3110400, 0x29dcff87
-0,         82,         82,        1,  3110400, 0x202fb0f7
-0,         83,         83,        1,  3110400, 0xacfc7d1d
-0,         84,         84,        1,  3110400, 0xf04bdcb8
-0,         85,         85,        1,  3110400, 0x89cef288
-0,         86,         86,        1,  3110400, 0x657315e2
-0,         87,         87,        1,  3110400, 0x1615cb5f
-0,         88,         88,        1,  3110400, 0xc6986395
-0,         89,         89,        1,  3110400, 0x6b77258e
-0,         90,         90,        1,  3110400, 0xcd9975ae
-0,         91,         91,        1,  3110400, 0x5044fd0f
-0,         92,         92,        1,  3110400, 0x20dd1132
-0,         93,         93,        1,  3110400, 0xdb5a0b84
-0,         94,         94,        1,  3110400, 0xf40d29ae
-0,         95,         95,        1,  3110400, 0xe88bffed
-0,         96,         96,        1,  3110400, 0x3e50146a
-0,         97,         97,        1,  3110400, 0xaacd9bfa
-0,         98,         98,        1,  3110400, 0x270b2c2a
-0,         99,         99,        1,  3110400, 0xc727f760
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-TILES_B_Cisco_1 b/deps/libav/tests/ref/fate/hevc-conformance-TILES_B_Cisco_1
deleted file mode 100644
index 9c37121..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-TILES_B_Cisco_1
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  3110400, 0x3471f473
-0,          1,          1,        1,  3110400, 0xb371a3e8
-0,          2,          2,        1,  3110400, 0x6d83c623
-0,          3,          3,        1,  3110400, 0x62d68b96
-0,          4,          4,        1,  3110400, 0xa8ed6ea9
-0,          5,          5,        1,  3110400, 0xcabe52be
-0,          6,          6,        1,  3110400, 0xbbb23578
-0,          7,          7,        1,  3110400, 0xb1609c77
-0,          8,          8,        1,  3110400, 0x61e7c2a7
-0,          9,          9,        1,  3110400, 0x6d8b34ad
-0,         10,         10,        1,  3110400, 0xde0dfa96
-0,         11,         11,        1,  3110400, 0x48c2b0b0
-0,         12,         12,        1,  3110400, 0x647b6f90
-0,         13,         13,        1,  3110400, 0xd37f2dda
-0,         14,         14,        1,  3110400, 0x1b0dd122
-0,         15,         15,        1,  3110400, 0x0b050786
-0,         16,         16,        1,  3110400, 0xcd9ce7e5
-0,         17,         17,        1,  3110400, 0xb92a4ee4
-0,         18,         18,        1,  3110400, 0x4fa4d97c
-0,         19,         19,        1,  3110400, 0x109777eb
-0,         20,         20,        1,  3110400, 0xc3d2236a
-0,         21,         21,        1,  3110400, 0x1cd12d07
-0,         22,         22,        1,  3110400, 0xdd1ef75d
-0,         23,         23,        1,  3110400, 0xd00c0906
-0,         24,         24,        1,  3110400, 0x8de79207
-0,         25,         25,        1,  3110400, 0x18017e1e
-0,         26,         26,        1,  3110400, 0x4329f68a
-0,         27,         27,        1,  3110400, 0x6a402bae
-0,         28,         28,        1,  3110400, 0x90eb1a20
-0,         29,         29,        1,  3110400, 0xe3474876
-0,         30,         30,        1,  3110400, 0xd652e216
-0,         31,         31,        1,  3110400, 0xeb458ebb
-0,         32,         32,        1,  3110400, 0xc5aff075
-0,         33,         33,        1,  3110400, 0xcb4d72e7
-0,         34,         34,        1,  3110400, 0x5504d9c5
-0,         35,         35,        1,  3110400, 0xcd0147b4
-0,         36,         36,        1,  3110400, 0xe2f0001e
-0,         37,         37,        1,  3110400, 0xa2199fe5
-0,         38,         38,        1,  3110400, 0x2f269683
-0,         39,         39,        1,  3110400, 0x7cf11244
-0,         40,         40,        1,  3110400, 0xf39cb39d
-0,         41,         41,        1,  3110400, 0x0e195a06
-0,         42,         42,        1,  3110400, 0x195e31e3
-0,         43,         43,        1,  3110400, 0xc43cd272
-0,         44,         44,        1,  3110400, 0x9dc1c4ea
-0,         45,         45,        1,  3110400, 0x846cd55f
-0,         46,         46,        1,  3110400, 0xe9468052
-0,         47,         47,        1,  3110400, 0xc5bb38ff
-0,         48,         48,        1,  3110400, 0xd1886697
-0,         49,         49,        1,  3110400, 0x23f2012b
-0,         50,         50,        1,  3110400, 0x669d63ff
-0,         51,         51,        1,  3110400, 0xced83804
-0,         52,         52,        1,  3110400, 0x005f5f3d
-0,         53,         53,        1,  3110400, 0x772efc80
-0,         54,         54,        1,  3110400, 0x94012838
-0,         55,         55,        1,  3110400, 0x99770054
-0,         56,         56,        1,  3110400, 0x8654c655
-0,         57,         57,        1,  3110400, 0xed3d19f4
-0,         58,         58,        1,  3110400, 0x8efc2172
-0,         59,         59,        1,  3110400, 0x9aaf930d
-0,         60,         60,        1,  3110400, 0xbe32f43e
-0,         61,         61,        1,  3110400, 0x6008f53e
-0,         62,         62,        1,  3110400, 0xb87897b9
-0,         63,         63,        1,  3110400, 0xe2406eb1
-0,         64,         64,        1,  3110400, 0xbdfa067b
-0,         65,         65,        1,  3110400, 0x82a16dbd
-0,         66,         66,        1,  3110400, 0x909aa5f0
-0,         67,         67,        1,  3110400, 0xc63836b5
-0,         68,         68,        1,  3110400, 0xaf7ad199
-0,         69,         69,        1,  3110400, 0xfa010078
-0,         70,         70,        1,  3110400, 0x00c0c24e
-0,         71,         71,        1,  3110400, 0xbda7cc4e
-0,         72,         72,        1,  3110400, 0xda97f9d5
-0,         73,         73,        1,  3110400, 0xd359e94a
-0,         74,         74,        1,  3110400, 0xcd48c131
-0,         75,         75,        1,  3110400, 0xb52ca032
-0,         76,         76,        1,  3110400, 0x55a69650
-0,         77,         77,        1,  3110400, 0x7241c1a9
-0,         78,         78,        1,  3110400, 0xf06c5744
-0,         79,         79,        1,  3110400, 0xe1befd73
-0,         80,         80,        1,  3110400, 0xe8ffea92
-0,         81,         81,        1,  3110400, 0xd76e40b6
-0,         82,         82,        1,  3110400, 0xbf5f5b4c
-0,         83,         83,        1,  3110400, 0x0eb8d128
-0,         84,         84,        1,  3110400, 0x453dd680
-0,         85,         85,        1,  3110400, 0x7114fada
-0,         86,         86,        1,  3110400, 0xa3b4e7a8
-0,         87,         87,        1,  3110400, 0xbca356f0
-0,         88,         88,        1,  3110400, 0x80a83fa3
-0,         89,         89,        1,  3110400, 0x713a33d4
-0,         90,         90,        1,  3110400, 0x4fda8aea
-0,         91,         91,        1,  3110400, 0x31ed1a88
-0,         92,         92,        1,  3110400, 0x736312a0
-0,         93,         93,        1,  3110400, 0x60aff0c5
-0,         94,         94,        1,  3110400, 0xee66bd76
-0,         95,         95,        1,  3110400, 0xe8f9a352
-0,         96,         96,        1,  3110400, 0xb51520de
-0,         97,         97,        1,  3110400, 0xd0542466
-0,         98,         98,        1,  3110400, 0x92c2f3e1
-0,         99,         99,        1,  3110400, 0xbbe1839a
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-TMVP_A_MS_3 b/deps/libav/tests/ref/fate/hevc-conformance-TMVP_A_MS_3
deleted file mode 100644
index 531370d..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-TMVP_A_MS_3
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xdb5e3b56
-0,          1,          1,        1,   149760, 0x6d4418eb
-0,          2,          2,        1,   149760, 0x0473e366
-0,          3,          3,        1,   149760, 0x988ff70c
-0,          4,          4,        1,   149760, 0x87cfb972
-0,          5,          5,        1,   149760, 0x9f006c8d
-0,          6,          6,        1,   149760, 0xa83fefd9
-0,          7,          7,        1,   149760, 0xee501a46
-0,          8,          8,        1,   149760, 0x04d29f74
-0,          9,          9,        1,   149760, 0xc1ee00dc
-0,         10,         10,        1,   149760, 0x274ef97b
-0,         11,         11,        1,   149760, 0xebec6365
-0,         12,         12,        1,   149760, 0x4555eb87
-0,         13,         13,        1,   149760, 0x50c5ae52
-0,         14,         14,        1,   149760, 0xf2861b67
-0,         15,         15,        1,   149760, 0xd6de4556
-0,         16,         16,        1,   149760, 0xc35d6134
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-TSCL_A_VIDYO_5 b/deps/libav/tests/ref/fate/hevc-conformance-TSCL_A_VIDYO_5
deleted file mode 100644
index 84d4219..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-TSCL_A_VIDYO_5
+++ /dev/null
@@ -1,74 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xcfffa013
-0,          1,          1,        1,   149760, 0x5166146a
-0,          2,          2,        1,   149760, 0xc3cc318e
-0,          3,          3,        1,   149760, 0xcedf65a0
-0,          4,          4,        1,   149760, 0x10c97bd4
-0,          5,          5,        1,   149760, 0xd9d5c4ab
-0,          6,          6,        1,   149760, 0x5112e11d
-0,          7,          7,        1,   149760, 0xde3803d6
-0,          8,          8,        1,   149760, 0x82c62409
-0,          9,          9,        1,   149760, 0x69a587f2
-0,         10,         10,        1,   149760, 0x90e2ac16
-0,         11,         11,        1,   149760, 0xdc2ed2ba
-0,         12,         12,        1,   149760, 0xcabec51f
-0,         13,         13,        1,   149760, 0x915de948
-0,         14,         14,        1,   149760, 0xd824e422
-0,         15,         15,        1,   149760, 0x10f91769
-0,         16,         16,        1,   149760, 0xf8ea1f0a
-0,         17,         17,        1,   149760, 0x88306494
-0,         18,         18,        1,   149760, 0x4b667403
-0,         19,         19,        1,   149760, 0x190b939f
-0,         20,         20,        1,   149760, 0xe754929d
-0,         21,         21,        1,   149760, 0xdd1eb9b5
-0,         22,         22,        1,   149760, 0x5ef1c64b
-0,         23,         23,        1,   149760, 0xab92e9f9
-0,         24,         24,        1,   149760, 0x873fec38
-0,         25,         25,        1,   149760, 0x1f0ca11f
-0,         26,         26,        1,   149760, 0xa2f591ca
-0,         27,         27,        1,   149760, 0x2713a994
-0,         28,         28,        1,   149760, 0xfbdba1f9
-0,         29,         29,        1,   149760, 0x3742ed2e
-0,         30,         30,        1,   149760, 0xf43fe43c
-0,         31,         31,        1,   149760, 0xa84ff250
-0,         32,         32,        1,   149760, 0xd4437e12
-0,         33,         33,        1,   149760, 0xcf08c736
-0,         34,         34,        1,   149760, 0x0cedd0d6
-0,         35,         35,        1,   149760, 0xc317e9bc
-0,         36,         36,        1,   149760, 0x0dcbd636
-0,         37,         37,        1,   149760, 0x4e6501b0
-0,         38,         38,        1,   149760, 0x5f9c02bb
-0,         39,         39,        1,   149760, 0x43052939
-0,         40,         40,        1,   149760, 0x8ec12318
-0,         41,         41,        1,   149760, 0xc51577f3
-0,         42,         42,        1,   149760, 0xbda1775b
-0,         43,         43,        1,   149760, 0x62b7b2a2
-0,         44,         44,        1,   149760, 0x5dd68203
-0,         45,         45,        1,   149760, 0xe004b4bf
-0,         46,         46,        1,   149760, 0x1469769f
-0,         47,         47,        1,   149760, 0x96f57e0a
-0,         48,         48,        1,   149760, 0x75e58819
-0,         49,         49,        1,   149760, 0xf826a158
-0,         50,         50,        1,   149760, 0xf789a3bd
-0,         51,         51,        1,   149760, 0x9d8fb09a
-0,         52,         52,        1,   149760, 0x1d33bbe5
-0,         53,         53,        1,   149760, 0x7e93e014
-0,         54,         54,        1,   149760, 0x04ade2e6
-0,         55,         55,        1,   149760, 0xb93a2c32
-0,         56,         56,        1,   149760, 0x5fa73dc3
-0,         57,         57,        1,   149760, 0xa70099ee
-0,         58,         58,        1,   149760, 0xcc5aaf3e
-0,         59,         59,        1,   149760, 0x4e83f938
-0,         60,         60,        1,   149760, 0x9faae668
-0,         61,         61,        1,   149760, 0x7a5cbf24
-0,         62,         62,        1,   149760, 0x4b23714c
-0,         63,         63,        1,   149760, 0x55d246ad
-0,         64,         64,        1,   149760, 0xd3378be9
-0,         65,         65,        1,   149760, 0xf5ef9731
-0,         66,         66,        1,   149760, 0xc4ba3ad7
-0,         67,         67,        1,   149760, 0xd9182d2c
-0,         68,         68,        1,   149760, 0x0ff5eaa5
-0,         69,         69,        1,   149760, 0xefe21a58
-0,         70,         70,        1,   149760, 0x4cad2a57
-0,         71,         71,        1,   149760, 0x24a35d1a
-0,         72,         72,        1,   149760, 0xeb1b6a6e
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-TSCL_B_VIDYO_4 b/deps/libav/tests/ref/fate/hevc-conformance-TSCL_B_VIDYO_4
deleted file mode 100644
index 6ee24ac..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-TSCL_B_VIDYO_4
+++ /dev/null
@@ -1,74 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x88619f80
-0,          1,          1,        1,   149760, 0x550bdaf0
-0,          2,          2,        1,   149760, 0x99440a14
-0,          3,          3,        1,   149760, 0xcc2c2049
-0,          4,          4,        1,   149760, 0x46927368
-0,          5,          5,        1,   149760, 0x53cdb3fe
-0,          6,          6,        1,   149760, 0x654df025
-0,          7,          7,        1,   149760, 0x024d24bc
-0,          8,          8,        1,   149760, 0x409138c2
-0,          9,          9,        1,   149760, 0xfbb47c48
-0,         10,         10,        1,   149760, 0x18caa19d
-0,         11,         11,        1,   149760, 0x0f88c2e5
-0,         12,         12,        1,   149760, 0x1c16aa2d
-0,         13,         13,        1,   149760, 0x60bfcce8
-0,         14,         14,        1,   149760, 0x1c38e3d3
-0,         15,         15,        1,   149760, 0x0d5b044a
-0,         16,         16,        1,   149760, 0x93d21593
-0,         17,         17,        1,   149760, 0xdf283910
-0,         18,         18,        1,   149760, 0x03324c23
-0,         19,         19,        1,   149760, 0x3b175b7b
-0,         20,         20,        1,   149760, 0xb91b9a7e
-0,         21,         21,        1,   149760, 0x734fbbe7
-0,         22,         22,        1,   149760, 0xfc3fea48
-0,         23,         23,        1,   149760, 0x6609103e
-0,         24,         24,        1,   149760, 0x3f5916fa
-0,         25,         25,        1,   149760, 0x08e43f4d
-0,         26,         26,        1,   149760, 0xc84e5471
-0,         27,         27,        1,   149760, 0xbd4e5c8d
-0,         28,         28,        1,   149760, 0x4a4d3995
-0,         29,         29,        1,   149760, 0x662163c0
-0,         30,         30,        1,   149760, 0xda28671f
-0,         31,         31,        1,   149760, 0x19e1878e
-0,         32,         32,        1,   149760, 0x19807e67
-0,         33,         33,        1,   149760, 0xf7aea3b6
-0,         34,         34,        1,   149760, 0x53f482c9
-0,         35,         35,        1,   149760, 0x7184b3ae
-0,         36,         36,        1,   149760, 0xb425b53d
-0,         37,         37,        1,   149760, 0xfb7cce6e
-0,         38,         38,        1,   149760, 0x820bc1ef
-0,         39,         39,        1,   149760, 0xbb0de30a
-0,         40,         40,        1,   149760, 0xbdcb0af2
-0,         41,         41,        1,   149760, 0xf2404ff7
-0,         42,         42,        1,   149760, 0xd6636f0a
-0,         43,         43,        1,   149760, 0x0e908b06
-0,         44,         44,        1,   149760, 0x36a158f4
-0,         45,         45,        1,   149760, 0x178d5bbd
-0,         46,         46,        1,   149760, 0xba9a6d14
-0,         47,         47,        1,   149760, 0x89145886
-0,         48,         48,        1,   149760, 0x6ec26794
-0,         49,         49,        1,   149760, 0xf6ac7551
-0,         50,         50,        1,   149760, 0xc829c66f
-0,         51,         51,        1,   149760, 0x64d50d50
-0,         52,         52,        1,   149760, 0x215dd855
-0,         53,         53,        1,   149760, 0x8b2ffec3
-0,         54,         54,        1,   149760, 0x1a0b7bcd
-0,         55,         55,        1,   149760, 0x14a5ad0e
-0,         56,         56,        1,   149760, 0x88c34286
-0,         57,         57,        1,   149760, 0xe2706fa9
-0,         58,         58,        1,   149760, 0x8de2decf
-0,         59,         59,        1,   149760, 0x1b37e5d7
-0,         60,         60,        1,   149760, 0xaf8d175a
-0,         61,         61,        1,   149760, 0x0f4aec5f
-0,         62,         62,        1,   149760, 0x3818df10
-0,         63,         63,        1,   149760, 0xe791d309
-0,         64,         64,        1,   149760, 0x6ad9aa0d
-0,         65,         65,        1,   149760, 0x1e1ab8a1
-0,         66,         66,        1,   149760, 0xd0ef526a
-0,         67,         67,        1,   149760, 0x45da3cf1
-0,         68,         68,        1,   149760, 0x3cb4eee6
-0,         69,         69,        1,   149760, 0x3e816ebc
-0,         70,         70,        1,   149760, 0x29d45e93
-0,         71,         71,        1,   149760, 0x824b5bc2
-0,         72,         72,        1,   149760, 0x015e6fd2
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-TSKIP_A_MS_3 b/deps/libav/tests/ref/fate/hevc-conformance-TSKIP_A_MS_3
deleted file mode 100644
index b5eca3c..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-TSKIP_A_MS_3
+++ /dev/null
@@ -1,18 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1382400, 0xaea37937
-0,          1,          1,        1,  1382400, 0xea5c7b5d
-0,          2,          2,        1,  1382400, 0x4e41e421
-0,          3,          3,        1,  1382400, 0x9214d0ee
-0,          4,          4,        1,  1382400, 0xc9aef661
-0,          5,          5,        1,  1382400, 0xddb8a3d2
-0,          6,          6,        1,  1382400, 0xf00f3c55
-0,          7,          7,        1,  1382400, 0x586d98bd
-0,          8,          8,        1,  1382400, 0x60650aa6
-0,          9,          9,        1,  1382400, 0x13108a54
-0,         10,         10,        1,  1382400, 0x90d25797
-0,         11,         11,        1,  1382400, 0x472fbac3
-0,         12,         12,        1,  1382400, 0xb9f2ac5a
-0,         13,         13,        1,  1382400, 0xb6fc0c35
-0,         14,         14,        1,  1382400, 0xfe3fd694
-0,         15,         15,        1,  1382400, 0xb1a0f737
-0,         16,         16,        1,  1382400, 0xf7e62b7e
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-TUSIZE_A_Samsung_1 b/deps/libav/tests/ref/fate/hevc-conformance-TUSIZE_A_Samsung_1
deleted file mode 100644
index 4886a40..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-TUSIZE_A_Samsung_1
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  6144000, 0x3681421d
-0,          1,          1,        1,  6144000, 0xecf3f343
-0,          2,          2,        1,  6144000, 0x53742db2
-0,          3,          3,        1,  6144000, 0x9b780429
-0,          4,          4,        1,  6144000, 0x57abb17e
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-VPSID_A_VIDYO_1 b/deps/libav/tests/ref/fate/hevc-conformance-VPSID_A_VIDYO_1
deleted file mode 100644
index bbb3cfe..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-VPSID_A_VIDYO_1
+++ /dev/null
@@ -1,34 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x88619f80
-0,          1,          1,        1,   149760, 0x550bdaf0
-0,          2,          2,        1,   149760, 0x99440a14
-0,          3,          3,        1,   149760, 0xcc2c2049
-0,          4,          4,        1,   149760, 0x46927368
-0,          5,          5,        1,   149760, 0x53cdb3fe
-0,          6,          6,        1,   149760, 0x654df025
-0,          7,          7,        1,   149760, 0x024d24bc
-0,          8,          8,        1,   149760, 0x409138c2
-0,          9,          9,        1,   149760, 0xfbb47c48
-0,         10,         10,        1,   149760, 0x18caa19d
-0,         11,         11,        1,   149760, 0x0f88c2e5
-0,         12,         12,        1,   149760, 0x1c16aa2d
-0,         13,         13,        1,   149760, 0x60bfcce8
-0,         14,         14,        1,   149760, 0x1c38e3d3
-0,         15,         15,        1,   149760, 0x0d5b044a
-0,         16,         16,        1,   149760, 0x93d21593
-0,         17,         17,        1,   149760, 0xdf283910
-0,         18,         18,        1,   149760, 0x03324c23
-0,         19,         19,        1,   149760, 0x3b175b7b
-0,         20,         20,        1,   149760, 0xb91b9a7e
-0,         21,         21,        1,   149760, 0x734fbbe7
-0,         22,         22,        1,   149760, 0xfc3fea48
-0,         23,         23,        1,   149760, 0x6609103e
-0,         24,         24,        1,   149760, 0x3f5916fa
-0,         25,         25,        1,   149760, 0x08e43f4d
-0,         26,         26,        1,   149760, 0xc84e5471
-0,         27,         27,        1,   149760, 0xbd4e5c8d
-0,         28,         28,        1,   149760, 0x4a4d3995
-0,         29,         29,        1,   149760, 0x662163c0
-0,         30,         30,        1,   149760, 0xda28671f
-0,         31,         31,        1,   149760, 0x19e1878e
-0,         32,         32,        1,   149760, 0x19807e67
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_A_ericsson_MAIN10_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_A_ericsson_MAIN10_2
deleted file mode 100644
index fe46c99..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_A_ericsson_MAIN10_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   299520, 0xa3f96d63
-0,          1,          1,        1,   299520, 0x5f788f3f
-0,          2,          2,        1,   299520, 0x41c7d0ae
-0,          3,          3,        1,   299520, 0x14a9175c
-0,          4,          4,        1,   299520, 0x5215ed5f
-0,          5,          5,        1,   299520, 0xffa5ab17
-0,          6,          6,        1,   299520, 0x7d179b2b
-0,          7,          7,        1,   299520, 0x87280332
-0,          8,          8,        1,   299520, 0xca5e278f
-0,          9,          9,        1,   299520, 0x89d59325
-0,         10,         10,        1,   299520, 0x6593cfa5
-0,         11,         11,        1,   299520, 0x216ce552
-0,         12,         12,        1,   299520, 0x4494f2ac
-0,         13,         13,        1,   299520, 0xc9aafeb4
-0,         14,         14,        1,   299520, 0xe93a43ab
-0,         15,         15,        1,   299520, 0x89bdba99
-0,         16,         16,        1,   299520, 0xdc529079
-0,         17,         17,        1,   299520, 0xfbc29de7
-0,         18,         18,        1,   299520, 0xa8c6c853
-0,         19,         19,        1,   299520, 0xd552dc1f
-0,         20,         20,        1,   299520, 0x60a7d5d9
-0,         21,         21,        1,   299520, 0x4b784987
-0,         22,         22,        1,   299520, 0xec9bd2a0
-0,         23,         23,        1,   299520, 0x71e1d437
-0,         24,         24,        1,   299520, 0x5776a225
-0,         25,         25,        1,   299520, 0x01598543
-0,         26,         26,        1,   299520, 0x8abb1f7b
-0,         27,         27,        1,   299520, 0xa3a0bb58
-0,         28,         28,        1,   299520, 0x4a718127
-0,         29,         29,        1,   299520, 0x6b1647bc
-0,         30,         30,        1,   299520, 0x7b653009
-0,         31,         31,        1,   299520, 0xca15d4be
-0,         32,         32,        1,   299520, 0xf8075689
-0,         33,         33,        1,   299520, 0x2717f2e6
-0,         34,         34,        1,   299520, 0x53ad6267
-0,         35,         35,        1,   299520, 0x29fedd49
-0,         36,         36,        1,   299520, 0x4e8aa5db
-0,         37,         37,        1,   299520, 0xca316c94
-0,         38,         38,        1,   299520, 0x8071fd57
-0,         39,         39,        1,   299520, 0xc9915cd3
-0,         40,         40,        1,   299520, 0xab335447
-0,         41,         41,        1,   299520, 0xf733a390
-0,         42,         42,        1,   299520, 0x1fa14afb
-0,         43,         43,        1,   299520, 0xe5d7ae71
-0,         44,         44,        1,   299520, 0xb48c2ee6
-0,         45,         45,        1,   299520, 0xe288ebcc
-0,         46,         46,        1,   299520, 0xa4000bdd
-0,         47,         47,        1,   299520, 0xf3fdee3a
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_A_ericsson_MAIN_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_A_ericsson_MAIN_2
deleted file mode 100644
index 497c802..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_A_ericsson_MAIN_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xfbb3d914
-0,          1,          1,        1,   149760, 0xdccd707b
-0,          2,          2,        1,   149760, 0x32008963
-0,          3,          3,        1,   149760, 0x0fcdd808
-0,          4,          4,        1,   149760, 0x69f0e1a5
-0,          5,          5,        1,   149760, 0x1be36c09
-0,          6,          6,        1,   149760, 0x18a1588f
-0,          7,          7,        1,   149760, 0xdc46acd8
-0,          8,          8,        1,   149760, 0xec46760a
-0,          9,          9,        1,   149760, 0xe87fc7b5
-0,         10,         10,        1,   149760, 0x7c78d960
-0,         11,         11,        1,   149760, 0x73e2ea91
-0,         12,         12,        1,   149760, 0x9164db8c
-0,         13,         13,        1,   149760, 0x31a6124b
-0,         14,         14,        1,   149760, 0x8a143aed
-0,         15,         15,        1,   149760, 0x15a364f4
-0,         16,         16,        1,   149760, 0x93b8560e
-0,         17,         17,        1,   149760, 0xc2aa985c
-0,         18,         18,        1,   149760, 0xe83ca4da
-0,         19,         19,        1,   149760, 0x6c79cb07
-0,         20,         20,        1,   149760, 0x2c24c739
-0,         21,         21,        1,   149760, 0x6a60f769
-0,         22,         22,        1,   149760, 0x13f00ad1
-0,         23,         23,        1,   149760, 0x59dd330d
-0,         24,         24,        1,   149760, 0x8815348c
-0,         25,         25,        1,   149760, 0x88576cd4
-0,         26,         26,        1,   149760, 0xfa3d6b9c
-0,         27,         27,        1,   149760, 0x810c8145
-0,         28,         28,        1,   149760, 0xf2357fcc
-0,         29,         29,        1,   149760, 0xc885a093
-0,         30,         30,        1,   149760, 0x5939a048
-0,         31,         31,        1,   149760, 0x9f93a489
-0,         32,         32,        1,   149760, 0xc11a879e
-0,         33,         33,        1,   149760, 0x5221c04b
-0,         34,         34,        1,   149760, 0x7dcdca90
-0,         35,         35,        1,   149760, 0xfdd8df1e
-0,         36,         36,        1,   149760, 0x3a88c802
-0,         37,         37,        1,   149760, 0x50ff1081
-0,         38,         38,        1,   149760, 0x6388f458
-0,         39,         39,        1,   149760, 0x85623a2b
-0,         40,         40,        1,   149760, 0x1bfd34a4
-0,         41,         41,        1,   149760, 0xb6037b88
-0,         42,         42,        1,   149760, 0xd24e65c7
-0,         43,         43,        1,   149760, 0xd2bd8fac
-0,         44,         44,        1,   149760, 0x602f64d0
-0,         45,         45,        1,   149760, 0x59415d5e
-0,         46,         46,        1,   149760, 0x9faf5737
-0,         47,         47,        1,   149760, 0x66ce56a9
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_B_ericsson_MAIN10_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_B_ericsson_MAIN10_2
deleted file mode 100644
index d199d38..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_B_ericsson_MAIN10_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   299520, 0x66b3cef3
-0,          1,          1,        1,   299520, 0x99df880f
-0,          2,          2,        1,   299520, 0xb4a03801
-0,          3,          3,        1,   299520, 0x1510c9e2
-0,          4,          4,        1,   299520, 0x42fe77b1
-0,          5,          5,        1,   299520, 0x815e1727
-0,          6,          6,        1,   299520, 0x6dd002f4
-0,          7,          7,        1,   299520, 0x2650e944
-0,          8,          8,        1,   299520, 0x3268c1e9
-0,          9,          9,        1,   299520, 0xced41a5f
-0,         10,         10,        1,   299520, 0x91334b97
-0,         11,         11,        1,   299520, 0xc5bb7ff6
-0,         12,         12,        1,   299520, 0x26e27c35
-0,         13,         13,        1,   299520, 0x482da6cb
-0,         14,         14,        1,   299520, 0xfe742e8e
-0,         15,         15,        1,   299520, 0x3f395752
-0,         16,         16,        1,   299520, 0x189936e5
-0,         17,         17,        1,   299520, 0x56a58a07
-0,         18,         18,        1,   299520, 0x798d8de9
-0,         19,         19,        1,   299520, 0x5d8e947f
-0,         20,         20,        1,   299520, 0x65477654
-0,         21,         21,        1,   299520, 0x5012d167
-0,         22,         22,        1,   299520, 0xe889bb27
-0,         23,         23,        1,   299520, 0x4611c1e6
-0,         24,         24,        1,   299520, 0xb093402b
-0,         25,         25,        1,   299520, 0xddc065d8
-0,         26,         26,        1,   299520, 0x6986e1d9
-0,         27,         27,        1,   299520, 0x0e539004
-0,         28,         28,        1,   299520, 0x4768f9ed
-0,         29,         29,        1,   299520, 0xfad20b53
-0,         30,         30,        1,   299520, 0x82f9c996
-0,         31,         31,        1,   299520, 0x6b366d79
-0,         32,         32,        1,   299520, 0x5a35d42e
-0,         33,         33,        1,   299520, 0xf3849013
-0,         34,         34,        1,   299520, 0x6b8eae50
-0,         35,         35,        1,   299520, 0x0f854274
-0,         36,         36,        1,   299520, 0x31685299
-0,         37,         37,        1,   299520, 0x77357bfb
-0,         38,         38,        1,   299520, 0xd67f1807
-0,         39,         39,        1,   299520, 0x371e7eb6
-0,         40,         40,        1,   299520, 0xe2ee3531
-0,         41,         41,        1,   299520, 0x50f242f1
-0,         42,         42,        1,   299520, 0x265ed919
-0,         43,         43,        1,   299520, 0xad496c85
-0,         44,         44,        1,   299520, 0xb2aef047
-0,         45,         45,        1,   299520, 0xac5c4451
-0,         46,         46,        1,   299520, 0x2b26a0cb
-0,         47,         47,        1,   299520, 0x5738d837
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_B_ericsson_MAIN_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_B_ericsson_MAIN_2
deleted file mode 100644
index bb61b10..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_B_ericsson_MAIN_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x3772de54
-0,          1,          1,        1,   149760, 0x571d885e
-0,          2,          2,        1,   149760, 0x71576f09
-0,          3,          3,        1,   149760, 0xf0724ce0
-0,          4,          4,        1,   149760, 0x2cc6e355
-0,          5,          5,        1,   149760, 0x0ca14365
-0,          6,          6,        1,   149760, 0x5aeb4b4d
-0,          7,          7,        1,   149760, 0xb018561c
-0,          8,          8,        1,   149760, 0x8fb07521
-0,          9,          9,        1,   149760, 0x9e1ccc5b
-0,         10,         10,        1,   149760, 0x0cf3de9f
-0,         11,         11,        1,   149760, 0x918cf512
-0,         12,         12,        1,   149760, 0x9a60e5c4
-0,         13,         13,        1,   149760, 0xc3b01d10
-0,         14,         14,        1,   149760, 0x929b34a6
-0,         15,         15,        1,   149760, 0x1f9462ac
-0,         16,         16,        1,   149760, 0xcadf511e
-0,         17,         17,        1,   149760, 0x318e9af6
-0,         18,         18,        1,   149760, 0x0860a371
-0,         19,         19,        1,   149760, 0x13e3c4d1
-0,         20,         20,        1,   149760, 0xfa27cbf6
-0,         21,         21,        1,   149760, 0x407ffed5
-0,         22,         22,        1,   149760, 0xa3c00c3b
-0,         23,         23,        1,   149760, 0x926938c6
-0,         24,         24,        1,   149760, 0xf5792acf
-0,         25,         25,        1,   149760, 0x66e16a48
-0,         26,         26,        1,   149760, 0xd46e7041
-0,         27,         27,        1,   149760, 0x814c84ee
-0,         28,         28,        1,   149760, 0x165b750a
-0,         29,         29,        1,   149760, 0x24ad9df0
-0,         30,         30,        1,   149760, 0x11189e4e
-0,         31,         31,        1,   149760, 0xb841a5b6
-0,         32,         32,        1,   149760, 0xea738605
-0,         33,         33,        1,   149760, 0xbbf0ca3f
-0,         34,         34,        1,   149760, 0xcfb5d03c
-0,         35,         35,        1,   149760, 0x0654f0b7
-0,         36,         36,        1,   149760, 0x1c2cd18d
-0,         37,         37,        1,   149760, 0x9a4602ae
-0,         38,         38,        1,   149760, 0xf2a2ff5a
-0,         39,         39,        1,   149760, 0x9c153c77
-0,         40,         40,        1,   149760, 0x5ed23e56
-0,         41,         41,        1,   149760, 0x1eb58383
-0,         42,         42,        1,   149760, 0x725e70f2
-0,         43,         43,        1,   149760, 0x652aa56c
-0,         44,         44,        1,   149760, 0x7f736ad2
-0,         45,         45,        1,   149760, 0x0827700a
-0,         46,         46,        1,   149760, 0x76a06370
-0,         47,         47,        1,   149760, 0xa7fe6f9d
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_C_ericsson_MAIN10_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_C_ericsson_MAIN10_2
deleted file mode 100644
index b1e6312..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_C_ericsson_MAIN10_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   299520, 0xbc71d699
-0,          1,          1,        1,   299520, 0x3207e1f9
-0,          2,          2,        1,   299520, 0xdd2087b5
-0,          3,          3,        1,   299520, 0xb512c976
-0,          4,          4,        1,   299520, 0x22957011
-0,          5,          5,        1,   299520, 0x8ce04965
-0,          6,          6,        1,   299520, 0x9cf37cba
-0,          7,          7,        1,   299520, 0xd52f8b2d
-0,          8,          8,        1,   299520, 0x2f55a94d
-0,          9,          9,        1,   299520, 0x53d3cc42
-0,         10,         10,        1,   299520, 0xbc33f3a1
-0,         11,         11,        1,   299520, 0x5e67d0de
-0,         12,         12,        1,   299520, 0x5708ecc5
-0,         13,         13,        1,   299520, 0x104869c0
-0,         14,         14,        1,   299520, 0xaf2a8638
-0,         15,         15,        1,   299520, 0xbdf1d001
-0,         16,         16,        1,   299520, 0xa3f71579
-0,         17,         17,        1,   299520, 0x68cedb09
-0,         18,         18,        1,   299520, 0xa4262d4d
-0,         19,         19,        1,   299520, 0x99320c8d
-0,         20,         20,        1,   299520, 0x57be6268
-0,         21,         21,        1,   299520, 0xc7e14cfc
-0,         22,         22,        1,   299520, 0x3d906541
-0,         23,         23,        1,   299520, 0x804b2f29
-0,         24,         24,        1,   299520, 0x93cf0ae2
-0,         25,         25,        1,   299520, 0x0fd2f932
-0,         26,         26,        1,   299520, 0xf869a25c
-0,         27,         27,        1,   299520, 0xa2dc56cd
-0,         28,         28,        1,   299520, 0x075b14a7
-0,         29,         29,        1,   299520, 0x233b0085
-0,         30,         30,        1,   299520, 0x80a69c4c
-0,         31,         31,        1,   299520, 0xf45f21af
-0,         32,         32,        1,   299520, 0x88dcab6e
-0,         33,         33,        1,   299520, 0xc1df3e99
-0,         34,         34,        1,   299520, 0xac298452
-0,         35,         35,        1,   299520, 0x6b4cc1e3
-0,         36,         36,        1,   299520, 0xfd39c597
-0,         37,         37,        1,   299520, 0xe60f808c
-0,         38,         38,        1,   299520, 0x27c47830
-0,         39,         39,        1,   299520, 0x4fd9ec76
-0,         40,         40,        1,   299520, 0x3249e084
-0,         41,         41,        1,   299520, 0x40632223
-0,         42,         42,        1,   299520, 0x9b68d213
-0,         43,         43,        1,   299520, 0x9e210ed8
-0,         44,         44,        1,   299520, 0x54489508
-0,         45,         45,        1,   299520, 0xc799df16
-0,         46,         46,        1,   299520, 0x020b2211
-0,         47,         47,        1,   299520, 0xcc1a1683
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_C_ericsson_MAIN_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_C_ericsson_MAIN_2
deleted file mode 100644
index 49c4f21..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_C_ericsson_MAIN_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x0948e521
-0,          1,          1,        1,   149760, 0x37afb384
-0,          2,          2,        1,   149760, 0xe1864c4a
-0,          3,          3,        1,   149760, 0x143344eb
-0,          4,          4,        1,   149760, 0x34cce612
-0,          5,          5,        1,   149760, 0x45ce60b3
-0,          6,          6,        1,   149760, 0x17b36585
-0,          7,          7,        1,   149760, 0x6447ebe5
-0,          8,          8,        1,   149760, 0x0f4282c7
-0,          9,          9,        1,   149760, 0xa0c3dab3
-0,         10,         10,        1,   149760, 0x0f3ceb7c
-0,         11,         11,        1,   149760, 0xb861f311
-0,         12,         12,        1,   149760, 0x620fe482
-0,         13,         13,        1,   149760, 0xa3dc1603
-0,         14,         14,        1,   149760, 0x6b7a3a6c
-0,         15,         15,        1,   149760, 0x01d16e5e
-0,         16,         16,        1,   149760, 0xe12f6009
-0,         17,         17,        1,   149760, 0xc96d98bd
-0,         18,         18,        1,   149760, 0x542e9f47
-0,         19,         19,        1,   149760, 0x5bcbc3b8
-0,         20,         20,        1,   149760, 0x3be2c63a
-0,         21,         21,        1,   149760, 0xd63df815
-0,         22,         22,        1,   149760, 0x5c210d61
-0,         23,         23,        1,   149760, 0xc7fb33b8
-0,         24,         24,        1,   149760, 0xa9f13508
-0,         25,         25,        1,   149760, 0xbf636172
-0,         26,         26,        1,   149760, 0xf1966847
-0,         27,         27,        1,   149760, 0xcc0579eb
-0,         28,         28,        1,   149760, 0x467673cb
-0,         29,         29,        1,   149760, 0x4dbca3f2
-0,         30,         30,        1,   149760, 0xada29bc9
-0,         31,         31,        1,   149760, 0x2983a0d5
-0,         32,         32,        1,   149760, 0x3864832a
-0,         33,         33,        1,   149760, 0x6a06b61d
-0,         34,         34,        1,   149760, 0x90a0d994
-0,         35,         35,        1,   149760, 0x3c58f375
-0,         36,         36,        1,   149760, 0x365bd42a
-0,         37,         37,        1,   149760, 0x5665f25f
-0,         38,         38,        1,   149760, 0x75d8fe8f
-0,         39,         39,        1,   149760, 0xc67e3508
-0,         40,         40,        1,   149760, 0x2e7b428b
-0,         41,         41,        1,   149760, 0x59cf741c
-0,         42,         42,        1,   149760, 0x2cc77eb4
-0,         43,         43,        1,   149760, 0x4957970a
-0,         44,         44,        1,   149760, 0xa69f7323
-0,         45,         45,        1,   149760, 0xaf1f6772
-0,         46,         46,        1,   149760, 0x864a5a76
-0,         47,         47,        1,   149760, 0x57795407
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_D_ericsson_MAIN10_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_D_ericsson_MAIN10_2
deleted file mode 100644
index 83cf10c..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_D_ericsson_MAIN10_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    46080, 0xc50ed6b4
-0,          1,          1,        1,    46080, 0x2aeac52d
-0,          2,          2,        1,    46080, 0xe3e36cd3
-0,          3,          3,        1,    46080, 0x81c6b317
-0,          4,          4,        1,    46080, 0x20e24e33
-0,          5,          5,        1,    46080, 0xc4a64f17
-0,          6,          6,        1,    46080, 0xf95a5014
-0,          7,          7,        1,    46080, 0x8d9e9a26
-0,          8,          8,        1,    46080, 0x5f0f4592
-0,          9,          9,        1,    46080, 0xa1b54f9f
-0,         10,         10,        1,    46080, 0x3d5c3673
-0,         11,         11,        1,    46080, 0xca6e5e83
-0,         12,         12,        1,    46080, 0x93eca575
-0,         13,         13,        1,    46080, 0xf84bab2b
-0,         14,         14,        1,    46080, 0xf22599d1
-0,         15,         15,        1,    46080, 0xf916673f
-0,         16,         16,        1,    46080, 0xbb11a29b
-0,         17,         17,        1,    46080, 0x047e1dd7
-0,         18,         18,        1,    46080, 0x9a975834
-0,         19,         19,        1,    46080, 0xa3fe84d4
-0,         20,         20,        1,    46080, 0x08e1c2f4
-0,         21,         21,        1,    46080, 0xbbbcf81b
-0,         22,         22,        1,    46080, 0x4abb0255
-0,         23,         23,        1,    46080, 0x20052dda
-0,         24,         24,        1,    46080, 0x10290ef3
-0,         25,         25,        1,    46080, 0x9e7633d0
-0,         26,         26,        1,    46080, 0x60d0fb3a
-0,         27,         27,        1,    46080, 0xe0209fb3
-0,         28,         28,        1,    46080, 0xea006c44
-0,         29,         29,        1,    46080, 0xe0b84e96
-0,         30,         30,        1,    46080, 0x35e507d7
-0,         31,         31,        1,    46080, 0x4107fcd6
-0,         32,         32,        1,    46080, 0x1b34af49
-0,         33,         33,        1,    46080, 0x4ab91078
-0,         34,         34,        1,    46080, 0x130750dd
-0,         35,         35,        1,    46080, 0x592dbe41
-0,         36,         36,        1,    46080, 0xfd39cf6b
-0,         37,         37,        1,    46080, 0xbe9ee5b7
-0,         38,         38,        1,    46080, 0x25ebde48
-0,         39,         39,        1,    46080, 0x2becd45c
-0,         40,         40,        1,    46080, 0x9b5fdfdb
-0,         41,         41,        1,    46080, 0xededa5f5
-0,         42,         42,        1,    46080, 0x476bc4e5
-0,         43,         43,        1,    46080, 0x4a4a0a4e
-0,         44,         44,        1,    46080, 0x1324f41b
-0,         45,         45,        1,    46080, 0xc503cfc8
-0,         46,         46,        1,    46080, 0x53f7c74c
-0,         47,         47,        1,    46080, 0xc861b5a3
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_D_ericsson_MAIN_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_D_ericsson_MAIN_2
deleted file mode 100644
index 6e6fc32..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_D_ericsson_MAIN_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    23040, 0x6977dbca
-0,          1,          1,        1,    23040, 0xd9bfcb5c
-0,          2,          2,        1,    23040, 0xbdd5a346
-0,          3,          3,        1,    23040, 0x021877cd
-0,          4,          4,        1,    23040, 0xb8a45933
-0,          5,          5,        1,    23040, 0xc289338e
-0,          6,          6,        1,    23040, 0x6968e57d
-0,          7,          7,        1,    23040, 0x1142c50c
-0,          8,          8,        1,    23040, 0xcf86c357
-0,          9,          9,        1,    23040, 0xf73de7ec
-0,         10,         10,        1,    23040, 0x2103ed06
-0,         11,         11,        1,    23040, 0xf0ecc0e2
-0,         12,         12,        1,    23040, 0xa7b1971f
-0,         13,         13,        1,    23040, 0x4454871a
-0,         14,         14,        1,    23040, 0xc5088346
-0,         15,         15,        1,    23040, 0x89189469
-0,         16,         16,        1,    23040, 0x320d977a
-0,         17,         17,        1,    23040, 0xbdc0a95b
-0,         18,         18,        1,    23040, 0xbcfec5c9
-0,         19,         19,        1,    23040, 0xb68ceb37
-0,         20,         20,        1,    23040, 0x41a60b0c
-0,         21,         21,        1,    23040, 0x0e662b47
-0,         22,         22,        1,    23040, 0x0e2440b7
-0,         23,         23,        1,    23040, 0x77415a77
-0,         24,         24,        1,    23040, 0x62936fdf
-0,         25,         25,        1,    23040, 0xaa987f9d
-0,         26,         26,        1,    23040, 0xaf0c8764
-0,         27,         27,        1,    23040, 0x645c913e
-0,         28,         28,        1,    23040, 0x2f249b06
-0,         29,         29,        1,    23040, 0xb54fb546
-0,         30,         30,        1,    23040, 0xc669c247
-0,         31,         31,        1,    23040, 0xe308bb8f
-0,         32,         32,        1,    23040, 0xb920b69d
-0,         33,         33,        1,    23040, 0x86d5c0ff
-0,         34,         34,        1,    23040, 0x7d5ec3e4
-0,         35,         35,        1,    23040, 0x5ca1cdb0
-0,         36,         36,        1,    23040, 0xdc11cf9e
-0,         37,         37,        1,    23040, 0x1a7fd0d5
-0,         38,         38,        1,    23040, 0x9884d5cd
-0,         39,         39,        1,    23040, 0xcafbd5fb
-0,         40,         40,        1,    23040, 0xc670ceb7
-0,         41,         41,        1,    23040, 0x63cecef7
-0,         42,         42,        1,    23040, 0xfe29c28c
-0,         43,         43,        1,    23040, 0x368dc66e
-0,         44,         44,        1,    23040, 0x2ec7c4de
-0,         45,         45,        1,    23040, 0x8954c9d6
-0,         46,         46,        1,    23040, 0xff89ca68
-0,         47,         47,        1,    23040, 0x5ae0b290
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_E_ericsson_MAIN10_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_E_ericsson_MAIN10_2
deleted file mode 100644
index dbf6f78..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_E_ericsson_MAIN10_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    92160, 0x591c992e
-0,          1,          1,        1,    92160, 0xe7a8cd8b
-0,          2,          2,        1,    92160, 0x2e7528bb
-0,          3,          3,        1,    92160, 0x92438eae
-0,          4,          4,        1,    92160, 0x15cc21b9
-0,          5,          5,        1,    92160, 0x3f14a50e
-0,          6,          6,        1,    92160, 0xdbc712e7
-0,          7,          7,        1,    92160, 0x277b2d3f
-0,          8,          8,        1,    92160, 0x05478988
-0,          9,          9,        1,    92160, 0x46888b9c
-0,         10,         10,        1,    92160, 0xb1f46d1b
-0,         11,         11,        1,    92160, 0xa86771fa
-0,         12,         12,        1,    92160, 0x1294944a
-0,         13,         13,        1,    92160, 0xe134cd44
-0,         14,         14,        1,    92160, 0x5fdbf1fb
-0,         15,         15,        1,    92160, 0x01f04b2e
-0,         16,         16,        1,    92160, 0x50989c28
-0,         17,         17,        1,    92160, 0x3202cf37
-0,         18,         18,        1,    92160, 0x67fbdb0f
-0,         19,         19,        1,    92160, 0x4d453062
-0,         20,         20,        1,    92160, 0x799c3e16
-0,         21,         21,        1,    92160, 0xdda76a94
-0,         22,         22,        1,    92160, 0x392d0fc9
-0,         23,         23,        1,    92160, 0x1196e850
-0,         24,         24,        1,    92160, 0x8758d8a9
-0,         25,         25,        1,    92160, 0xb632c2b3
-0,         26,         26,        1,    92160, 0xf3ba5e47
-0,         27,         27,        1,    92160, 0x3ae40182
-0,         28,         28,        1,    92160, 0xf285e2eb
-0,         29,         29,        1,    92160, 0x826aee47
-0,         30,         30,        1,    92160, 0xe06ba18b
-0,         31,         31,        1,    92160, 0xf34b6ef5
-0,         32,         32,        1,    92160, 0xf94045ab
-0,         33,         33,        1,    92160, 0xd0ae63f4
-0,         34,         34,        1,    92160, 0x4c35afc1
-0,         35,         35,        1,    92160, 0x9a150816
-0,         36,         36,        1,    92160, 0x1a4214d4
-0,         37,         37,        1,    92160, 0x9f042653
-0,         38,         38,        1,    92160, 0xf69a40a8
-0,         39,         39,        1,    92160, 0xb8462c18
-0,         40,         40,        1,    92160, 0xf42d4748
-0,         41,         41,        1,    92160, 0x4968dc19
-0,         42,         42,        1,    92160, 0xc8e6001f
-0,         43,         43,        1,    92160, 0xebb42677
-0,         44,         44,        1,    92160, 0x3fb805dd
-0,         45,         45,        1,    92160, 0x1953cfc1
-0,         46,         46,        1,    92160, 0x633108f4
-0,         47,         47,        1,    92160, 0x65aedf42
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_E_ericsson_MAIN_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_E_ericsson_MAIN_2
deleted file mode 100644
index ac478c6..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_E_ericsson_MAIN_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    46080, 0xcd234724
-0,          1,          1,        1,    46080, 0x66649579
-0,          2,          2,        1,    46080, 0x4317d38d
-0,          3,          3,        1,    46080, 0x308dfc39
-0,          4,          4,        1,    46080, 0xe08e3015
-0,          5,          5,        1,    46080, 0xaa0a3e44
-0,          6,          6,        1,    46080, 0x491b61cf
-0,          7,          7,        1,    46080, 0x9c5a9749
-0,          8,          8,        1,    46080, 0x4384ae34
-0,          9,          9,        1,    46080, 0xfd2bf2c1
-0,         10,         10,        1,    46080, 0xf29b18d7
-0,         11,         11,        1,    46080, 0xc1912df5
-0,         12,         12,        1,    46080, 0x9cc3344b
-0,         13,         13,        1,    46080, 0x41c062a3
-0,         14,         14,        1,    46080, 0xa5ec8417
-0,         15,         15,        1,    46080, 0x94e5aed6
-0,         16,         16,        1,    46080, 0x1af6ce24
-0,         17,         17,        1,    46080, 0xd73c0272
-0,         18,         18,        1,    46080, 0xb7b41c50
-0,         19,         19,        1,    46080, 0x7fa442dc
-0,         20,         20,        1,    46080, 0x513e5f5a
-0,         21,         21,        1,    46080, 0x46a1848b
-0,         22,         22,        1,    46080, 0xcf31a1c4
-0,         23,         23,        1,    46080, 0x3ee8c90c
-0,         24,         24,        1,    46080, 0xc54fdd27
-0,         25,         25,        1,    46080, 0x59830556
-0,         26,         26,        1,    46080, 0xf8c70cc7
-0,         27,         27,        1,    46080, 0x44a519f9
-0,         28,         28,        1,    46080, 0xdd0323d3
-0,         29,         29,        1,    46080, 0x93874212
-0,         30,         30,        1,    46080, 0xba8e4d8e
-0,         31,         31,        1,    46080, 0x5c3f4fb0
-0,         32,         32,        1,    46080, 0x37084bf2
-0,         33,         33,        1,    46080, 0xad256b1b
-0,         34,         34,        1,    46080, 0x862b7a7d
-0,         35,         35,        1,    46080, 0x4a2e8d56
-0,         36,         36,        1,    46080, 0xe99d8f5a
-0,         37,         37,        1,    46080, 0xe41a9456
-0,         38,         38,        1,    46080, 0xe7339f1c
-0,         39,         39,        1,    46080, 0xfa38a6c3
-0,         40,         40,        1,    46080, 0x219e97d2
-0,         41,         41,        1,    46080, 0x652d9cc2
-0,         42,         42,        1,    46080, 0x40bf8f94
-0,         43,         43,        1,    46080, 0x2fee9e23
-0,         44,         44,        1,    46080, 0xeea39203
-0,         45,         45,        1,    46080, 0x69819b5c
-0,         46,         46,        1,    46080, 0x511ba0b5
-0,         47,         47,        1,    46080, 0x85fd892f
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_F_ericsson_MAIN10_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_F_ericsson_MAIN10_2
deleted file mode 100644
index 2f103b7..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_F_ericsson_MAIN10_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   138240, 0x99f196ae
-0,          1,          1,        1,   138240, 0x45f407de
-0,          2,          2,        1,   138240, 0xdaef815b
-0,          3,          3,        1,   138240, 0x6812ba5a
-0,          4,          4,        1,   138240, 0x1099912d
-0,          5,          5,        1,   138240, 0xf58ee932
-0,          6,          6,        1,   138240, 0x79df05d8
-0,          7,          7,        1,   138240, 0xa0813719
-0,          8,          8,        1,   138240, 0xe9c7c5c0
-0,          9,          9,        1,   138240, 0xe8c5aba3
-0,         10,         10,        1,   138240, 0x7f0ed0b6
-0,         11,         11,        1,   138240, 0x1bdcfd20
-0,         12,         12,        1,   138240, 0x3b1fc007
-0,         13,         13,        1,   138240, 0xf6a9d270
-0,         14,         14,        1,   138240, 0x3a2d47d4
-0,         15,         15,        1,   138240, 0xbeb9685f
-0,         16,         16,        1,   138240, 0x4cb6eb4a
-0,         17,         17,        1,   138240, 0xa456dcdf
-0,         18,         18,        1,   138240, 0x2933f8e1
-0,         19,         19,        1,   138240, 0x27de28e9
-0,         20,         20,        1,   138240, 0x557c0e51
-0,         21,         21,        1,   138240, 0x6f106540
-0,         22,         22,        1,   138240, 0xf78421a4
-0,         23,         23,        1,   138240, 0xa94029a7
-0,         24,         24,        1,   138240, 0xacfa2b8b
-0,         25,         25,        1,   138240, 0x32e7d347
-0,         26,         26,        1,   138240, 0xe4c17fac
-0,         27,         27,        1,   138240, 0x47e61949
-0,         28,         28,        1,   138240, 0xd248e34b
-0,         29,         29,        1,   138240, 0xb747dc2c
-0,         30,         30,        1,   138240, 0x3a0eaf61
-0,         31,         31,        1,   138240, 0x4e254b5f
-0,         32,         32,        1,   138240, 0xf434f578
-0,         33,         33,        1,   138240, 0xe799308e
-0,         34,         34,        1,   138240, 0xb3e67c89
-0,         35,         35,        1,   138240, 0xb6ceb379
-0,         36,         36,        1,   138240, 0xd70bea99
-0,         37,         37,        1,   138240, 0xad0717a8
-0,         38,         38,        1,   138240, 0x2b50f085
-0,         39,         39,        1,   138240, 0xb334e518
-0,         40,         40,        1,   138240, 0xe7311c3a
-0,         41,         41,        1,   138240, 0x7c46dc19
-0,         42,         42,        1,   138240, 0x18c20dfa
-0,         43,         43,        1,   138240, 0x8bc0f6ae
-0,         44,         44,        1,   138240, 0x91a8c381
-0,         45,         45,        1,   138240, 0x2ba57297
-0,         46,         46,        1,   138240, 0x99d982f0
-0,         47,         47,        1,   138240, 0x0f84942a
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WPP_F_ericsson_MAIN_2 b/deps/libav/tests/ref/fate/hevc-conformance-WPP_F_ericsson_MAIN_2
deleted file mode 100644
index 6256d96..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WPP_F_ericsson_MAIN_2
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    69120, 0x28326a13
-0,          1,          1,        1,    69120, 0x1f41a4a7
-0,          2,          2,        1,    69120, 0x803ceeb4
-0,          3,          3,        1,    69120, 0x1eba4049
-0,          4,          4,        1,    69120, 0x61a25512
-0,          5,          5,        1,    69120, 0x4db37e41
-0,          6,          6,        1,    69120, 0x00f69308
-0,          7,          7,        1,    69120, 0x7478c70f
-0,          8,          8,        1,    69120, 0xba1bd40b
-0,          9,          9,        1,    69120, 0x31d416bc
-0,         10,         10,        1,    69120, 0xd0c042bd
-0,         11,         11,        1,    69120, 0xe7a75aba
-0,         12,         12,        1,    69120, 0xb4235b4c
-0,         13,         13,        1,    69120, 0xaad387c3
-0,         14,         14,        1,    69120, 0xb97aab7a
-0,         15,         15,        1,    69120, 0x1acdda47
-0,         16,         16,        1,    69120, 0x2c95f726
-0,         17,         17,        1,    69120, 0xba3f2ebb
-0,         18,         18,        1,    69120, 0x15fc4901
-0,         19,         19,        1,    69120, 0x56387074
-0,         20,         20,        1,    69120, 0xe9638772
-0,         21,         21,        1,    69120, 0x344db5ec
-0,         22,         22,        1,    69120, 0xf54bd087
-0,         23,         23,        1,    69120, 0x5b35fbe4
-0,         24,         24,        1,    69120, 0x052c0947
-0,         25,         25,        1,    69120, 0xe562417c
-0,         26,         26,        1,    69120, 0x502a4776
-0,         27,         27,        1,    69120, 0x46b05919
-0,         28,         28,        1,    69120, 0x103161a1
-0,         29,         29,        1,    69120, 0xd83e8318
-0,         30,         30,        1,    69120, 0xd7ce8fb1
-0,         31,         31,        1,    69120, 0xda3f8ac5
-0,         32,         32,        1,    69120, 0xecd17de1
-0,         33,         33,        1,    69120, 0x7beeab11
-0,         34,         34,        1,    69120, 0xb295b81f
-0,         35,         35,        1,    69120, 0x785ec9ab
-0,         36,         36,        1,    69120, 0x58a3c317
-0,         37,         37,        1,    69120, 0x05feda91
-0,         38,         38,        1,    69120, 0xd21fdcab
-0,         39,         39,        1,    69120, 0x0d6ce0ee
-0,         40,         40,        1,    69120, 0x40ddc715
-0,         41,         41,        1,    69120, 0x5489d3e1
-0,         42,         42,        1,    69120, 0x7f57c42b
-0,         43,         43,        1,    69120, 0xd470cca3
-0,         44,         44,        1,    69120, 0xfb80c51c
-0,         45,         45,        1,    69120, 0x76b1d068
-0,         46,         46,        1,    69120, 0x5b01d81e
-0,         47,         47,        1,    69120, 0x21cfc241
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WP_A_MAIN10_Toshiba_3 b/deps/libav/tests/ref/fate/hevc-conformance-WP_A_MAIN10_Toshiba_3
deleted file mode 100644
index b2dadba..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WP_A_MAIN10_Toshiba_3
+++ /dev/null
@@ -1,257 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   299520, 0x7750edc7
-0,          1,          1,        1,   299520, 0x97fb359b
-0,          2,          2,        1,   299520, 0x89ac22bc
-0,          3,          3,        1,   299520, 0x4f7e0ecc
-0,          4,          4,        1,   299520, 0x7367f210
-0,          5,          5,        1,   299520, 0x5c2274e3
-0,          6,          6,        1,   299520, 0x11f26352
-0,          7,          7,        1,   299520, 0x2c712fcc
-0,          8,          8,        1,   299520, 0x44d700aa
-0,          9,          9,        1,   299520, 0x7426fc80
-0,         10,         10,        1,   299520, 0xd31d2fef
-0,         11,         11,        1,   299520, 0xd7c8d389
-0,         12,         12,        1,   299520, 0x2a8283e7
-0,         13,         13,        1,   299520, 0x429f5e44
-0,         14,         14,        1,   299520, 0x5c818504
-0,         15,         15,        1,   299520, 0x1057090e
-0,         16,         16,        1,   299520, 0x61404e77
-0,         17,         17,        1,   299520, 0x8ce43ed3
-0,         18,         18,        1,   299520, 0xf08e6c4d
-0,         19,         19,        1,   299520, 0xb133a69f
-0,         20,         20,        1,   299520, 0xd1be15a5
-0,         21,         21,        1,   299520, 0xe875543f
-0,         22,         22,        1,   299520, 0x0310f356
-0,         23,         23,        1,   299520, 0x5ee0a7d9
-0,         24,         24,        1,   299520, 0xacd092bb
-0,         25,         25,        1,   299520, 0x878ef783
-0,         26,         26,        1,   299520, 0xed9a2c06
-0,         27,         27,        1,   299520, 0x0a4cb661
-0,         28,         28,        1,   299520, 0x69aed89b
-0,         29,         29,        1,   299520, 0xaa75d081
-0,         30,         30,        1,   299520, 0x4c0402c6
-0,         31,         31,        1,   299520, 0x7050b8f8
-0,         32,         32,        1,   299520, 0x20cf8db8
-0,         33,         33,        1,   299520, 0xa615d0cb
-0,         34,         34,        1,   299520, 0x3170b77f
-0,         35,         35,        1,   299520, 0x781f17a5
-0,         36,         36,        1,   299520, 0x8767468b
-0,         37,         37,        1,   299520, 0x8f291a78
-0,         38,         38,        1,   299520, 0x87534588
-0,         39,         39,        1,   299520, 0xb4861cee
-0,         40,         40,        1,   299520, 0x38b6ba36
-0,         41,         41,        1,   299520, 0x757ebda4
-0,         42,         42,        1,   299520, 0xeccca3c0
-0,         43,         43,        1,   299520, 0x8af415a3
-0,         44,         44,        1,   299520, 0x37064dea
-0,         45,         45,        1,   299520, 0xfea46d66
-0,         46,         46,        1,   299520, 0x038d776f
-0,         47,         47,        1,   299520, 0x2b905161
-0,         48,         48,        1,   299520, 0x60230f44
-0,         49,         49,        1,   299520, 0x828f8991
-0,         50,         50,        1,   299520, 0x7c5ded06
-0,         51,         51,        1,   299520, 0xef38fd3a
-0,         52,         52,        1,   299520, 0x4c08ea42
-0,         53,         53,        1,   299520, 0x66dd9974
-0,         54,         54,        1,   299520, 0x4af1e690
-0,         55,         55,        1,   299520, 0x3fce05be
-0,         56,         56,        1,   299520, 0x07ccca7a
-0,         57,         57,        1,   299520, 0x1113a830
-0,         58,         58,        1,   299520, 0xe095faa8
-0,         59,         59,        1,   299520, 0x01da87b4
-0,         60,         60,        1,   299520, 0xecd3ea56
-0,         61,         61,        1,   299520, 0x8b80d26b
-0,         62,         62,        1,   299520, 0x625b4844
-0,         63,         63,        1,   299520, 0x1f96bc19
-0,         64,         64,        1,   299520, 0x8de15c59
-0,         65,         65,        1,   299520, 0x8de15c59
-0,         66,         66,        1,   299520, 0xe0f88d0d
-0,         67,         67,        1,   299520, 0xe0f88d0d
-0,         68,         68,        1,   299520, 0xf951adca
-0,         69,         69,        1,   299520, 0x3159e1a0
-0,         70,         70,        1,   299520, 0xa3b9764d
-0,         71,         71,        1,   299520, 0xa294c4db
-0,         72,         72,        1,   299520, 0x9ddd0aa8
-0,         73,         73,        1,   299520, 0x47702302
-0,         74,         74,        1,   299520, 0xebd66219
-0,         75,         75,        1,   299520, 0x9daa6030
-0,         76,         76,        1,   299520, 0x74aad521
-0,         77,         77,        1,   299520, 0x74aad521
-0,         78,         78,        1,   299520, 0x6be83092
-0,         79,         79,        1,   299520, 0x87e19ded
-0,         80,         80,        1,   299520, 0x41f4552c
-0,         81,         81,        1,   299520, 0xdbbd4643
-0,         82,         82,        1,   299520, 0x85505e9d
-0,         83,         83,        1,   299520, 0x33692949
-0,         84,         84,        1,   299520, 0x2d3ded88
-0,         85,         85,        1,   299520, 0x211ed3d4
-0,         86,         86,        1,   299520, 0x9dd3c6b8
-0,         87,         87,        1,   299520, 0x96016144
-0,         88,         88,        1,   299520, 0xdb86dd3a
-0,         89,         89,        1,   299520, 0x2a07d782
-0,         90,         90,        1,   299520, 0x4baeac21
-0,         91,         91,        1,   299520, 0x9426dbd3
-0,         92,         92,        1,   299520, 0x69203a74
-0,         93,         93,        1,   299520, 0x69203a74
-0,         94,         94,        1,   299520, 0xcb3e55c2
-0,         95,         95,        1,   299520, 0xbbc8dea2
-0,         96,         96,        1,   299520, 0x19b27f0d
-0,         97,         97,        1,   299520, 0x0edb8988
-0,         98,         98,        1,   299520, 0x0b3a8feb
-0,         99,         99,        1,   299520, 0xa2a3a4b4
-0,        100,        100,        1,   299520, 0xeb26e563
-0,        101,        101,        1,   299520, 0xd3fb037e
-0,        102,        102,        1,   299520, 0x106089ed
-0,        103,        103,        1,   299520, 0x606fb6ed
-0,        104,        104,        1,   299520, 0x6e14a326
-0,        105,        105,        1,   299520, 0x875cfdab
-0,        106,        106,        1,   299520, 0xa1f316f9
-0,        107,        107,        1,   299520, 0x444fff4a
-0,        108,        108,        1,   299520, 0x9c7b6c8a
-0,        109,        109,        1,   299520, 0xffd0ffa3
-0,        110,        110,        1,   299520, 0x278941d9
-0,        111,        111,        1,   299520, 0x05a1552f
-0,        112,        112,        1,   299520, 0x5b564fbc
-0,        113,        113,        1,   299520, 0x25ffb96d
-0,        114,        114,        1,   299520, 0x6e389daf
-0,        115,        115,        1,   299520, 0x1b48132b
-0,        116,        116,        1,   299520, 0xcc9b5df0
-0,        117,        117,        1,   299520, 0xe8895d00
-0,        118,        118,        1,   299520, 0x35ea30df
-0,        119,        119,        1,   299520, 0x8dcf07b4
-0,        120,        120,        1,   299520, 0x1cf3780e
-0,        121,        121,        1,   299520, 0x5f1a6062
-0,        122,        122,        1,   299520, 0xe2ac4ed0
-0,        123,        123,        1,   299520, 0x07fe56aa
-0,        124,        124,        1,   299520, 0xe892eab8
-0,        125,        125,        1,   299520, 0xdeda11d7
-0,        126,        126,        1,   299520, 0xc8134b3f
-0,        127,        127,        1,   299520, 0x8baa039a
-0,        128,        128,        1,   299520, 0x8ec71908
-0,        129,        129,        1,   299520, 0x8ec71908
-0,        130,        130,        1,   299520, 0x73ae1f71
-0,        131,        131,        1,   299520, 0xb615e210
-0,        132,        132,        1,   299520, 0x7afe31e6
-0,        133,        133,        1,   299520, 0x38362f5b
-0,        134,        134,        1,   299520, 0xbb7c2fad
-0,        135,        135,        1,   299520, 0xe08720c1
-0,        136,        136,        1,   299520, 0xb1118297
-0,        137,        137,        1,   299520, 0x33740a04
-0,        138,        138,        1,   299520, 0x567c1e9c
-0,        139,        139,        1,   299520, 0x3911af2a
-0,        140,        140,        1,   299520, 0xec64ec95
-0,        141,        141,        1,   299520, 0x83128903
-0,        142,        142,        1,   299520, 0xd11a7835
-0,        143,        143,        1,   299520, 0xd96bc851
-0,        144,        144,        1,   299520, 0x726696ba
-0,        145,        145,        1,   299520, 0x35c6b8e4
-0,        146,        146,        1,   299520, 0xd238e317
-0,        147,        147,        1,   299520, 0xf28c861b
-0,        148,        148,        1,   299520, 0x5d49132b
-0,        149,        149,        1,   299520, 0xcbadef81
-0,        150,        150,        1,   299520, 0x1fbcfda6
-0,        151,        151,        1,   299520, 0xa18a07b6
-0,        152,        152,        1,   299520, 0xa1631bb5
-0,        153,        153,        1,   299520, 0xcb80f2d6
-0,        154,        154,        1,   299520, 0x88b23aae
-0,        155,        155,        1,   299520, 0xbaa50ebe
-0,        156,        156,        1,   299520, 0x1bc7151d
-0,        157,        157,        1,   299520, 0x7254b9a4
-0,        158,        158,        1,   299520, 0xd66682cb
-0,        159,        159,        1,   299520, 0x846c055b
-0,        160,        160,        1,   299520, 0x4d0ac94f
-0,        161,        161,        1,   299520, 0xf9a01b25
-0,        162,        162,        1,   299520, 0x193dc288
-0,        163,        163,        1,   299520, 0xf43fb875
-0,        164,        164,        1,   299520, 0xf4fd6452
-0,        165,        165,        1,   299520, 0xafcdfb2a
-0,        166,        166,        1,   299520, 0x5c342ad7
-0,        167,        167,        1,   299520, 0xfe7943ec
-0,        168,        168,        1,   299520, 0xc7e8a82d
-0,        169,        169,        1,   299520, 0x99b1ed3f
-0,        170,        170,        1,   299520, 0x4decbdb8
-0,        171,        171,        1,   299520, 0x3cb0ccc2
-0,        172,        172,        1,   299520, 0x3b210547
-0,        173,        173,        1,   299520, 0xb8dee8bf
-0,        174,        174,        1,   299520, 0x75124e85
-0,        175,        175,        1,   299520, 0xbd390ba5
-0,        176,        176,        1,   299520, 0x5030302d
-0,        177,        177,        1,   299520, 0x38a4c990
-0,        178,        178,        1,   299520, 0x6d091561
-0,        179,        179,        1,   299520, 0x4598d16a
-0,        180,        180,        1,   299520, 0xa60c8a7c
-0,        181,        181,        1,   299520, 0x1987b4ab
-0,        182,        182,        1,   299520, 0x3fc66893
-0,        183,        183,        1,   299520, 0x3fc66893
-0,        184,        184,        1,   299520, 0x84694e9d
-0,        185,        185,        1,   299520, 0x84694e9d
-0,        186,        186,        1,   299520, 0xa736933c
-0,        187,        187,        1,   299520, 0x994e35f8
-0,        188,        188,        1,   299520, 0x80999aab
-0,        189,        189,        1,   299520, 0x5cf09e35
-0,        190,        190,        1,   299520, 0x8678f05d
-0,        191,        191,        1,   299520, 0xe4ca13df
-0,        192,        192,        1,   299520, 0x0ab1fc5b
-0,        193,        193,        1,   299520, 0x949977a6
-0,        194,        194,        1,   299520, 0x0ab1fc5b
-0,        195,        195,        1,   299520, 0xb5677d4e
-0,        196,        196,        1,   299520, 0xefd5e34c
-0,        197,        197,        1,   299520, 0xfb5875da
-0,        198,        198,        1,   299520, 0x3520759c
-0,        199,        199,        1,   299520, 0xc30dbfb6
-0,        200,        200,        1,   299520, 0xcedb09c4
-0,        201,        201,        1,   299520, 0xced1dc4a
-0,        202,        202,        1,   299520, 0xcf7d3425
-0,        203,        203,        1,   299520, 0xede92113
-0,        204,        204,        1,   299520, 0x6ca1204e
-0,        205,        205,        1,   299520, 0x04a46f67
-0,        206,        206,        1,   299520, 0x1bd8fe03
-0,        207,        207,        1,   299520, 0x11dab44d
-0,        208,        208,        1,   299520, 0xc0d1109c
-0,        209,        209,        1,   299520, 0x9e19c78f
-0,        210,        210,        1,   299520, 0xcffab4cb
-0,        211,        211,        1,   299520, 0x07582785
-0,        212,        212,        1,   299520, 0x43182694
-0,        213,        213,        1,   299520, 0x76f8c058
-0,        214,        214,        1,   299520, 0x895cbd03
-0,        215,        215,        1,   299520, 0xec9f9014
-0,        216,        216,        1,   299520, 0xd9cc6c00
-0,        217,        217,        1,   299520, 0xf15c775e
-0,        218,        218,        1,   299520, 0xe4b60e06
-0,        219,        219,        1,   299520, 0x5d825ea9
-0,        220,        220,        1,   299520, 0xd39d2f4a
-0,        221,        221,        1,   299520, 0x9b8dfedc
-0,        222,        222,        1,   299520, 0xc851ce8f
-0,        223,        223,        1,   299520, 0xdc399f09
-0,        224,        224,        1,   299520, 0xbce817c6
-0,        225,        225,        1,   299520, 0x48cc865e
-0,        226,        226,        1,   299520, 0xf875c060
-0,        227,        227,        1,   299520, 0xb3b4b0a3
-0,        228,        228,        1,   299520, 0xce683731
-0,        229,        229,        1,   299520, 0xeddd5126
-0,        230,        230,        1,   299520, 0x2ecf505e
-0,        231,        231,        1,   299520, 0x631c4af2
-0,        232,        232,        1,   299520, 0x1cc7742e
-0,        233,        233,        1,   299520, 0xc5124083
-0,        234,        234,        1,   299520, 0x4a851970
-0,        235,        235,        1,   299520, 0xbfad7925
-0,        236,        236,        1,   299520, 0x92058c0e
-0,        237,        237,        1,   299520, 0x7ecd39b5
-0,        238,        238,        1,   299520, 0x58887a74
-0,        239,        239,        1,   299520, 0xb0825813
-0,        240,        240,        1,   299520, 0xbc763455
-0,        241,        241,        1,   299520, 0x3b259a45
-0,        242,        242,        1,   299520, 0xb200177c
-0,        243,        243,        1,   299520, 0x1cb15851
-0,        244,        244,        1,   299520, 0xd73a92cd
-0,        245,        245,        1,   299520, 0xe43419cf
-0,        246,        246,        1,   299520, 0xf0facff1
-0,        247,        247,        1,   299520, 0xc931e638
-0,        248,        248,        1,   299520, 0xc33e31e7
-0,        249,        249,        1,   299520, 0x03b43a26
-0,        250,        250,        1,   299520, 0x85d64d60
-0,        251,        251,        1,   299520, 0x86a8848c
-0,        252,        252,        1,   299520, 0x5f09afaf
-0,        253,        253,        1,   299520, 0xb7e92098
-0,        254,        254,        1,   299520, 0xf1957fad
-0,        255,        255,        1,   299520, 0xf29dc4b0
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WP_A_Toshiba_3 b/deps/libav/tests/ref/fate/hevc-conformance-WP_A_Toshiba_3
deleted file mode 100644
index a8c5df3..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WP_A_Toshiba_3
+++ /dev/null
@@ -1,257 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xf4bafc83
-0,          1,          1,        1,   149760, 0x611ca492
-0,          2,          2,        1,   149760, 0x8fa9bbb1
-0,          3,          3,        1,   149760, 0x3926aed3
-0,          4,          4,        1,   149760, 0x33e4f7f0
-0,          5,          5,        1,   149760, 0x03cc4fab
-0,          6,          6,        1,   149760, 0xbfae58e5
-0,          7,          7,        1,   149760, 0x0e6f1fea
-0,          8,          8,        1,   149760, 0x5a2ed57e
-0,          9,          9,        1,   149760, 0x5513cc3a
-0,         10,         10,        1,   149760, 0xd610ccca
-0,         11,         11,        1,   149760, 0xbf27617f
-0,         12,         12,        1,   149760, 0x878cd03b
-0,         13,         13,        1,   149760, 0x7b7ec3e9
-0,         14,         14,        1,   149760, 0xdaff0ba7
-0,         15,         15,        1,   149760, 0xce3be576
-0,         16,         16,        1,   149760, 0x16d32b84
-0,         17,         17,        1,   149760, 0xb7f6a144
-0,         18,         18,        1,   149760, 0x4dfb9b67
-0,         19,         19,        1,   149760, 0x29cb06ba
-0,         20,         20,        1,   149760, 0xcee5f14c
-0,         21,         21,        1,   149760, 0xe05bde26
-0,         22,         22,        1,   149760, 0xf717e789
-0,         23,         23,        1,   149760, 0xbbbf0ce8
-0,         24,         24,        1,   149760, 0x0e3ccfb1
-0,         25,         25,        1,   149760, 0x84204399
-0,         26,         26,        1,   149760, 0x02063b2b
-0,         27,         27,        1,   149760, 0xa4198aab
-0,         28,         28,        1,   149760, 0x4a4075aa
-0,         29,         29,        1,   149760, 0x1869435b
-0,         30,         30,        1,   149760, 0x04a12a8b
-0,         31,         31,        1,   149760, 0x7ab3f640
-0,         32,         32,        1,   149760, 0xba55f83a
-0,         33,         33,        1,   149760, 0xa8abaa48
-0,         34,         34,        1,   149760, 0x25483cb4
-0,         35,         35,        1,   149760, 0xc6925d6d
-0,         36,         36,        1,   149760, 0xc944b04d
-0,         37,         37,        1,   149760, 0xd7093017
-0,         38,         38,        1,   149760, 0x8d11c574
-0,         39,         39,        1,   149760, 0xdbaab3e1
-0,         40,         40,        1,   149760, 0xb412a3d9
-0,         41,         41,        1,   149760, 0x37b918a6
-0,         42,         42,        1,   149760, 0x6f6e7575
-0,         43,         43,        1,   149760, 0x059a55de
-0,         44,         44,        1,   149760, 0xe75aa6e6
-0,         45,         45,        1,   149760, 0x627394bf
-0,         46,         46,        1,   149760, 0xbcf99ab9
-0,         47,         47,        1,   149760, 0x29c52e30
-0,         48,         48,        1,   149760, 0x22056e1a
-0,         49,         49,        1,   149760, 0xf272fa39
-0,         50,         50,        1,   149760, 0x4b89033e
-0,         51,         51,        1,   149760, 0x0a59e138
-0,         52,         52,        1,   149760, 0x61a1a6c8
-0,         53,         53,        1,   149760, 0xe5414697
-0,         54,         54,        1,   149760, 0x6db38ec2
-0,         55,         55,        1,   149760, 0x2d09b0ba
-0,         56,         56,        1,   149760, 0x014a751e
-0,         57,         57,        1,   149760, 0x3e6f78d6
-0,         58,         58,        1,   149760, 0xed483aab
-0,         59,         59,        1,   149760, 0xcf366ee0
-0,         60,         60,        1,   149760, 0x4fc5e2dc
-0,         61,         61,        1,   149760, 0xf2a16393
-0,         62,         62,        1,   149760, 0xaa7ff5be
-0,         63,         63,        1,   149760, 0xa8c4c963
-0,         64,         64,        1,   149760, 0x3af766cf
-0,         65,         65,        1,   149760, 0x3af766cf
-0,         66,         66,        1,   149760, 0x11de29e7
-0,         67,         67,        1,   149760, 0x3aa137c0
-0,         68,         68,        1,   149760, 0x6f5bf4c4
-0,         69,         69,        1,   149760, 0xa5b8f392
-0,         70,         70,        1,   149760, 0x106ee459
-0,         71,         71,        1,   149760, 0x65dd99cc
-0,         72,         72,        1,   149760, 0x96facd15
-0,         73,         73,        1,   149760, 0x3355cb07
-0,         74,         74,        1,   149760, 0xe994f26b
-0,         75,         75,        1,   149760, 0xe955f0d5
-0,         76,         76,        1,   149760, 0xb740949e
-0,         77,         77,        1,   149760, 0x0b95963b
-0,         78,         78,        1,   149760, 0xdf7cf302
-0,         79,         79,        1,   149760, 0x8805c30d
-0,         80,         80,        1,   149760, 0xc30c832a
-0,         81,         81,        1,   149760, 0x696836a7
-0,         82,         82,        1,   149760, 0x696836a7
-0,         83,         83,        1,   149760, 0x4c7e0e68
-0,         84,         84,        1,   149760, 0xfee52485
-0,         85,         85,        1,   149760, 0xebbe8381
-0,         86,         86,        1,   149760, 0xb30ff0a9
-0,         87,         87,        1,   149760, 0x4ddafbfb
-0,         88,         88,        1,   149760, 0x5449c902
-0,         89,         89,        1,   149760, 0x79e61161
-0,         90,         90,        1,   149760, 0x72f1a340
-0,         91,         91,        1,   149760, 0xf98bae64
-0,         92,         92,        1,   149760, 0x253dd19f
-0,         93,         93,        1,   149760, 0x253dd19f
-0,         94,         94,        1,   149760, 0xc16e6af4
-0,         95,         95,        1,   149760, 0x66f2a539
-0,         96,         96,        1,   149760, 0xfccfd340
-0,         97,         97,        1,   149760, 0xd76a28c9
-0,         98,         98,        1,   149760, 0x38797af0
-0,         99,         99,        1,   149760, 0x06165c19
-0,        100,        100,        1,   149760, 0x9afee257
-0,        101,        101,        1,   149760, 0x1b2ce435
-0,        102,        102,        1,   149760, 0xb3e2de89
-0,        103,        103,        1,   149760, 0xb585e81f
-0,        104,        104,        1,   149760, 0x6743ece6
-0,        105,        105,        1,   149760, 0xfe5a001f
-0,        106,        106,        1,   149760, 0x064a778f
-0,        107,        107,        1,   149760, 0x99907eef
-0,        108,        108,        1,   149760, 0x1b9ec247
-0,        109,        109,        1,   149760, 0x52adad6c
-0,        110,        110,        1,   149760, 0xf5176bd9
-0,        111,        111,        1,   149760, 0xefdfa365
-0,        112,        112,        1,   149760, 0xa2e8447f
-0,        113,        113,        1,   149760, 0x3ea43a87
-0,        114,        114,        1,   149760, 0xbe643579
-0,        115,        115,        1,   149760, 0x518ae330
-0,        116,        116,        1,   149760, 0x49d815e6
-0,        117,        117,        1,   149760, 0xbfbb1bf0
-0,        118,        118,        1,   149760, 0x19596f6f
-0,        119,        119,        1,   149760, 0x4f6cbeec
-0,        120,        120,        1,   149760, 0xdd3f7460
-0,        121,        121,        1,   149760, 0xf2bb54f3
-0,        122,        122,        1,   149760, 0xb9d5d7cd
-0,        123,        123,        1,   149760, 0xe62736a5
-0,        124,        124,        1,   149760, 0x29c6f950
-0,        125,        125,        1,   149760, 0x99e1faed
-0,        126,        126,        1,   149760, 0x5c149afe
-0,        127,        127,        1,   149760, 0xb4118f9b
-0,        128,        128,        1,   149760, 0x262d7f30
-0,        129,        129,        1,   149760, 0x262d7f30
-0,        130,        130,        1,   149760, 0x13e286ed
-0,        131,        131,        1,   149760, 0xee6b3447
-0,        132,        132,        1,   149760, 0x9e749867
-0,        133,        133,        1,   149760, 0xdbca6bab
-0,        134,        134,        1,   149760, 0x154c9331
-0,        135,        135,        1,   149760, 0x653a3058
-0,        136,        136,        1,   149760, 0x739c1e57
-0,        137,        137,        1,   149760, 0x8e05e122
-0,        138,        138,        1,   149760, 0xe21f583a
-0,        139,        139,        1,   149760, 0xa58149fc
-0,        140,        140,        1,   149760, 0x90bd3787
-0,        141,        141,        1,   149760, 0x385aa42a
-0,        142,        142,        1,   149760, 0xf2589fc6
-0,        143,        143,        1,   149760, 0xd5233b3b
-0,        144,        144,        1,   149760, 0x2cc2d9cc
-0,        145,        145,        1,   149760, 0xb9b0eeef
-0,        146,        146,        1,   149760, 0xa9a60da9
-0,        147,        147,        1,   149760, 0xb854378a
-0,        148,        148,        1,   149760, 0xa76e2c37
-0,        149,        149,        1,   149760, 0xbe5c0542
-0,        150,        150,        1,   149760, 0x4d78b907
-0,        151,        151,        1,   149760, 0x6119f5d7
-0,        152,        152,        1,   149760, 0x195ae3c8
-0,        153,        153,        1,   149760, 0x35e9de61
-0,        154,        154,        1,   149760, 0x99f0df3b
-0,        155,        155,        1,   149760, 0x1a0ebfee
-0,        156,        156,        1,   149760, 0x4ece0a87
-0,        157,        157,        1,   149760, 0x670773b9
-0,        158,        158,        1,   149760, 0xae8c2789
-0,        159,        159,        1,   149760, 0xa145e3f8
-0,        160,        160,        1,   149760, 0x130d2ea3
-0,        161,        161,        1,   149760, 0x9afdf6dc
-0,        162,        162,        1,   149760, 0x8f8ed056
-0,        163,        163,        1,   149760, 0x8d50ad5c
-0,        164,        164,        1,   149760, 0x50b41bbb
-0,        165,        165,        1,   149760, 0xe8a89c0b
-0,        166,        166,        1,   149760, 0x4862c664
-0,        167,        167,        1,   149760, 0x9f99193f
-0,        168,        168,        1,   149760, 0x3d2ea4d8
-0,        169,        169,        1,   149760, 0xfcb83723
-0,        170,        170,        1,   149760, 0x2e135fe9
-0,        171,        171,        1,   149760, 0xcd059eeb
-0,        172,        172,        1,   149760, 0xcc2914ab
-0,        173,        173,        1,   149760, 0x63a4cf21
-0,        174,        174,        1,   149760, 0x0bdf9666
-0,        175,        175,        1,   149760, 0x8fcd46d9
-0,        176,        176,        1,   149760, 0xa2a94d81
-0,        177,        177,        1,   149760, 0x72da1124
-0,        178,        178,        1,   149760, 0x4faf50a2
-0,        179,        179,        1,   149760, 0x52168ea8
-0,        180,        180,        1,   149760, 0x766cd6e4
-0,        181,        181,        1,   149760, 0x9a76dd3f
-0,        182,        182,        1,   149760, 0xacf745bb
-0,        183,        183,        1,   149760, 0xacf745bb
-0,        184,        184,        1,   149760, 0x5d0f5914
-0,        185,        185,        1,   149760, 0x5d0f5914
-0,        186,        186,        1,   149760, 0x491b5959
-0,        187,        187,        1,   149760, 0xce9bf07f
-0,        188,        188,        1,   149760, 0x45123e08
-0,        189,        189,        1,   149760, 0x7ec1ced4
-0,        190,        190,        1,   149760, 0x7ec1ced4
-0,        191,        191,        1,   149760, 0xd383e72e
-0,        192,        192,        1,   149760, 0x29558d4c
-0,        193,        193,        1,   149760, 0xdcea6ec3
-0,        194,        194,        1,   149760, 0x29558d4c
-0,        195,        195,        1,   149760, 0x55b305ad
-0,        196,        196,        1,   149760, 0x68326c39
-0,        197,        197,        1,   149760, 0x89c8c0f7
-0,        198,        198,        1,   149760, 0x1fb33243
-0,        199,        199,        1,   149760, 0xa07b14e8
-0,        200,        200,        1,   149760, 0x6b37b02f
-0,        201,        201,        1,   149760, 0x7453171e
-0,        202,        202,        1,   149760, 0xec95ce93
-0,        203,        203,        1,   149760, 0xdbb0481b
-0,        204,        204,        1,   149760, 0xe44eaafd
-0,        205,        205,        1,   149760, 0xcdf5dfd5
-0,        206,        206,        1,   149760, 0x42695b4e
-0,        207,        207,        1,   149760, 0xe4e26db0
-0,        208,        208,        1,   149760, 0xada778f6
-0,        209,        209,        1,   149760, 0x77dab36a
-0,        210,        210,        1,   149760, 0xcabeb23d
-0,        211,        211,        1,   149760, 0x43d21021
-0,        212,        212,        1,   149760, 0xe4a5280c
-0,        213,        213,        1,   149760, 0xeb408a99
-0,        214,        214,        1,   149760, 0x0751fc6c
-0,        215,        215,        1,   149760, 0x2e770c68
-0,        216,        216,        1,   149760, 0x5a799fb0
-0,        217,        217,        1,   149760, 0x0e2e22dd
-0,        218,        218,        1,   149760, 0x276e6e88
-0,        219,        219,        1,   149760, 0xf83b9da4
-0,        220,        220,        1,   149760, 0xd4599290
-0,        221,        221,        1,   149760, 0xd4599290
-0,        222,        222,        1,   149760, 0xcf41ec75
-0,        223,        223,        1,   149760, 0x84af0bfc
-0,        224,        224,        1,   149760, 0x59db5c12
-0,        225,        225,        1,   149760, 0x0405a92a
-0,        226,        226,        1,   149760, 0xfde2c0fe
-0,        227,        227,        1,   149760, 0x96a68bab
-0,        228,        228,        1,   149760, 0x7e9d4983
-0,        229,        229,        1,   149760, 0x27b724c9
-0,        230,        230,        1,   149760, 0x402cdb15
-0,        231,        231,        1,   149760, 0x0d89328b
-0,        232,        232,        1,   149760, 0x08847a7e
-0,        233,        233,        1,   149760, 0x8eb7f52f
-0,        234,        234,        1,   149760, 0x49bf75bb
-0,        235,        235,        1,   149760, 0xbd6c77e3
-0,        236,        236,        1,   149760, 0x9eb5a5c0
-0,        237,        237,        1,   149760, 0xb5900c9b
-0,        238,        238,        1,   149760, 0xa9278bd6
-0,        239,        239,        1,   149760, 0x688d4c01
-0,        240,        240,        1,   149760, 0xe2669ce6
-0,        241,        241,        1,   149760, 0xb80590b9
-0,        242,        242,        1,   149760, 0xcdcc0036
-0,        243,        243,        1,   149760, 0xad653077
-0,        244,        244,        1,   149760, 0xe87179ae
-0,        245,        245,        1,   149760, 0x91553e8b
-0,        246,        246,        1,   149760, 0xd254f2b4
-0,        247,        247,        1,   149760, 0xe284e289
-0,        248,        248,        1,   149760, 0x09118405
-0,        249,        249,        1,   149760, 0x5f46d196
-0,        250,        250,        1,   149760, 0xfee1f4be
-0,        251,        251,        1,   149760, 0xbccf48bc
-0,        252,        252,        1,   149760, 0x48327792
-0,        253,        253,        1,   149760, 0x3d893b3c
-0,        254,        254,        1,   149760, 0xb2ae071d
-0,        255,        255,        1,   149760, 0x278e0be3
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WP_B_Toshiba_3 b/deps/libav/tests/ref/fate/hevc-conformance-WP_B_Toshiba_3
deleted file mode 100644
index f302764..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WP_B_Toshiba_3
+++ /dev/null
@@ -1,257 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xd8bf0c39
-0,          4,          4,        1,   149760, 0xad390a29
-0,          5,          5,        1,   149760, 0x0d310906
-0,          5,          5,        1,   149760, 0x03bcb5ac
-0,          6,          6,        1,   149760, 0x6c38226f
-0,          7,          7,        1,   149760, 0xc7d898b6
-0,          8,          8,        1,   149760, 0x1e031118
-0,          9,          9,        1,   149760, 0x7a2437f2
-0,         10,         10,        1,   149760, 0x524d616a
-0,         11,         11,        1,   149760, 0x001ac80e
-0,         12,         12,        1,   149760, 0x6fe323e4
-0,         13,         13,        1,   149760, 0x2a95a125
-0,         14,         14,        1,   149760, 0x212316e4
-0,         15,         15,        1,   149760, 0x7984e2ed
-0,         16,         16,        1,   149760, 0xb0a4a95c
-0,         17,         17,        1,   149760, 0x100566ae
-0,         18,         18,        1,   149760, 0xb21b2344
-0,         19,         19,        1,   149760, 0x0578bca2
-0,         20,         20,        1,   149760, 0xf7523964
-0,         21,         21,        1,   149760, 0x38d2ca9e
-0,         22,         22,        1,   149760, 0x77890564
-0,         23,         23,        1,   149760, 0xbdba85df
-0,         24,         24,        1,   149760, 0x646ae92d
-0,         25,         25,        1,   149760, 0xfcbb58b9
-0,         26,         26,        1,   149760, 0x0122aa96
-0,         27,         27,        1,   149760, 0x60f8e1ee
-0,         28,         28,        1,   149760, 0x3fc2d587
-0,         29,         29,        1,   149760, 0xdb622c12
-0,         30,         30,        1,   149760, 0xa8df64cf
-0,         31,         31,        1,   149760, 0x12f8d6c8
-0,         32,         32,        1,   149760, 0xf6703c4d
-0,         33,         33,        1,   149760, 0x66ef211d
-0,         34,         34,        1,   149760, 0x821b02f6
-0,         35,         35,        1,   149760, 0xc87f48a0
-0,         36,         36,        1,   149760, 0xb816ad51
-0,         37,         37,        1,   149760, 0x238e6fa0
-0,         38,         38,        1,   149760, 0x0fc06010
-0,         39,         39,        1,   149760, 0x749c71dc
-0,         40,         40,        1,   149760, 0x88c69718
-0,         41,         41,        1,   149760, 0x4b29aeb1
-0,         42,         42,        1,   149760, 0xaaefb509
-0,         43,         43,        1,   149760, 0x2975fda6
-0,         44,         44,        1,   149760, 0x613ec356
-0,         45,         45,        1,   149760, 0xf1e46db6
-0,         46,         46,        1,   149760, 0x8c8aec07
-0,         47,         47,        1,   149760, 0xb9a8be75
-0,         48,         48,        1,   149760, 0xfdce756a
-0,         49,         49,        1,   149760, 0x9c76f148
-0,         50,         50,        1,   149760, 0x5d1862dd
-0,         51,         51,        1,   149760, 0x42ae08bf
-0,         52,         52,        1,   149760, 0xc28f9247
-0,         53,         53,        1,   149760, 0x719d321c
-0,         54,         54,        1,   149760, 0x1520a7bc
-0,         55,         55,        1,   149760, 0x4fb98c9a
-0,         56,         56,        1,   149760, 0x88d410a6
-0,         57,         57,        1,   149760, 0x807ac417
-0,         58,         58,        1,   149760, 0x6de5f4ab
-0,         59,         59,        1,   149760, 0x678613c7
-0,         60,         60,        1,   149760, 0xe7d12abf
-0,         61,         61,        1,   149760, 0x23955076
-0,         62,         62,        1,   149760, 0x298d1bce
-0,         63,         63,        1,   149760, 0x18d4605d
-0,         64,         64,        1,   149760, 0x3a606618
-0,         65,         65,        1,   149760, 0x861fcb5a
-0,         66,         66,        1,   149760, 0xc6622a90
-0,         67,         67,        1,   149760, 0x62d4cd48
-0,         68,         68,        1,   149760, 0x991430e6
-0,         69,         69,        1,   149760, 0x6316503c
-0,         70,         70,        1,   149760, 0xdf2d29f2
-0,         71,         71,        1,   149760, 0xeeeb307a
-0,         72,         72,        1,   149760, 0xade9ae1d
-0,         73,         73,        1,   149760, 0x54734581
-0,         74,         74,        1,   149760, 0x5ccd7389
-0,         75,         75,        1,   149760, 0xf0588bf8
-0,         76,         76,        1,   149760, 0xf18e44e5
-0,         77,         77,        1,   149760, 0x4512602b
-0,         78,         78,        1,   149760, 0x9aac8281
-0,         79,         79,        1,   149760, 0x69bdad58
-0,         80,         80,        1,   149760, 0x04ffe580
-0,         81,         81,        1,   149760, 0x28bfe45f
-0,         82,         82,        1,   149760, 0xd7ce93b0
-0,         83,         83,        1,   149760, 0xa880b1d4
-0,         84,         84,        1,   149760, 0xf38298d0
-0,         85,         85,        1,   149760, 0x2ae05958
-0,         86,         86,        1,   149760, 0xa892151b
-0,         87,         87,        1,   149760, 0xed2cef63
-0,         88,         88,        1,   149760, 0x678fc6f5
-0,         89,         89,        1,   149760, 0xfcbaa892
-0,         90,         90,        1,   149760, 0x48cc722b
-0,         91,         91,        1,   149760, 0x32cd8975
-0,         92,         92,        1,   149760, 0x05ad8586
-0,         93,         93,        1,   149760, 0x62a0fb36
-0,         94,         94,        1,   149760, 0x41df8d45
-0,         95,         95,        1,   149760, 0x80bd938d
-0,         96,         96,        1,   149760, 0xafe414b0
-0,         97,         97,        1,   149760, 0x3077d51d
-0,         98,         98,        1,   149760, 0x65148cef
-0,         99,         99,        1,   149760, 0xadb76ef0
-0,        100,        100,        1,   149760, 0x889c3051
-0,        101,        101,        1,   149760, 0xe83b227e
-0,        102,        102,        1,   149760, 0xc373f5e0
-0,        103,        103,        1,   149760, 0x6ffa2a5f
-0,        104,        104,        1,   149760, 0x6eef18f5
-0,        105,        105,        1,   149760, 0x1b1ba6e4
-0,        106,        106,        1,   149760, 0x88e316a4
-0,        107,        107,        1,   149760, 0x4c0697f4
-0,        108,        108,        1,   149760, 0x5eb30515
-0,        109,        109,        1,   149760, 0xeeff8fa3
-0,        110,        110,        1,   149760, 0x653a07a9
-0,        111,        111,        1,   149760, 0x3faf44a8
-0,        112,        112,        1,   149760, 0xe33f740e
-0,        113,        113,        1,   149760, 0x6bea0f49
-0,        114,        114,        1,   149760, 0x4d5aa784
-0,        115,        115,        1,   149760, 0x0c85ea00
-0,        116,        116,        1,   149760, 0xf64fc40b
-0,        117,        117,        1,   149760, 0xf222e3b4
-0,        118,        118,        1,   149760, 0x6b3be6bc
-0,        119,        119,        1,   149760, 0x91447dfb
-0,        120,        120,        1,   149760, 0xfd0dd98c
-0,        121,        121,        1,   149760, 0x468eb01a
-0,        122,        122,        1,   149760, 0x928a720a
-0,        123,        123,        1,   149760, 0x0b3f576b
-0,        124,        124,        1,   149760, 0x430493df
-0,        125,        125,        1,   149760, 0x375d2221
-0,        126,        126,        1,   149760, 0x50d0a88c
-0,        127,        127,        1,   149760, 0x54363ffb
-0,        128,        128,        1,   149760, 0xc243c434
-0,        129,        129,        1,   149760, 0x26fe8f5c
-0,        130,        130,        1,   149760, 0xd936485c
-0,        131,        131,        1,   149760, 0xd936485c
-0,        132,        132,        1,   149760, 0xa0cabe5a
-0,        133,        133,        1,   149760, 0xf0956484
-0,        134,        134,        1,   149760, 0x14cda6ee
-0,        135,        135,        1,   149760, 0x0b7ada70
-0,        136,        136,        1,   149760, 0x113f0ec5
-0,        137,        137,        1,   149760, 0xc1364acc
-0,        138,        138,        1,   149760, 0x0c768a6a
-0,        139,        139,        1,   149760, 0x94fd7a00
-0,        140,        140,        1,   149760, 0x624a5ebb
-0,        141,        141,        1,   149760, 0xdd5008a0
-0,        142,        142,        1,   149760, 0xc380626c
-0,        143,        143,        1,   149760, 0xb0974c02
-0,        144,        144,        1,   149760, 0x68be6c1e
-0,        145,        145,        1,   149760, 0xb8d24677
-0,        146,        146,        1,   149760, 0x1efe195c
-0,        147,        147,        1,   149760, 0x29e9153a
-0,        148,        148,        1,   149760, 0x1b6057b7
-0,        149,        149,        1,   149760, 0x959a4461
-0,        150,        150,        1,   149760, 0x4e3d33a9
-0,        151,        151,        1,   149760, 0x206e7899
-0,        152,        152,        1,   149760, 0xcb7da081
-0,        153,        153,        1,   149760, 0xc650ed7b
-0,        154,        154,        1,   149760, 0x82832d10
-0,        155,        155,        1,   149760, 0xdf9c6218
-0,        156,        156,        1,   149760, 0xcc3489c7
-0,        157,        157,        1,   149760, 0xd284a4a1
-0,        158,        158,        1,   149760, 0x7099451c
-0,        159,        159,        1,   149760, 0xec26fc56
-0,        160,        160,        1,   149760, 0x105a496f
-0,        161,        161,        1,   149760, 0xb8756fe8
-0,        162,        162,        1,   149760, 0xb1a509df
-0,        163,        163,        1,   149760, 0x135f8f7e
-0,        164,        164,        1,   149760, 0x3419098d
-0,        165,        165,        1,   149760, 0xa55dad5f
-0,        166,        166,        1,   149760, 0x326ba794
-0,        167,        167,        1,   149760, 0x5401b03c
-0,        168,        168,        1,   149760, 0x3ace76ee
-0,        169,        169,        1,   149760, 0x140191ac
-0,        170,        170,        1,   149760, 0x3e3ca195
-0,        171,        171,        1,   149760, 0x2a8b3622
-0,        172,        172,        1,   149760, 0x9e33c765
-0,        173,        173,        1,   149760, 0xf7795367
-0,        174,        174,        1,   149760, 0xa7909e25
-0,        175,        175,        1,   149760, 0x44a5a014
-0,        176,        176,        1,   149760, 0x919bb07c
-0,        177,        177,        1,   149760, 0xd353b9a7
-0,        178,        178,        1,   149760, 0x4c3dda24
-0,        179,        179,        1,   149760, 0x1428eafb
-0,        180,        180,        1,   149760, 0x9d9fa613
-0,        181,        181,        1,   149760, 0x661475c6
-0,        182,        182,        1,   149760, 0x5f6f4180
-0,        183,        183,        1,   149760, 0xf50a4b4c
-0,        184,        184,        1,   149760, 0xf6373eb9
-0,        185,        185,        1,   149760, 0x0ab24b74
-0,        186,        186,        1,   149760, 0x6b3d58b0
-0,        187,        187,        1,   149760, 0xc4c8bd05
-0,        188,        188,        1,   149760, 0x0df172c6
-0,        189,        189,        1,   149760, 0x81a85144
-0,        190,        190,        1,   149760, 0x7f926ee5
-0,        191,        191,        1,   149760, 0x3a355d45
-0,        192,        192,        1,   149760, 0x9f645c90
-0,        193,        193,        1,   149760, 0xf42674ea
-0,        194,        194,        1,   149760, 0xa6e943ab
-0,        195,        195,        1,   149760, 0xede16b49
-0,        196,        196,        1,   149760, 0xf80c9957
-0,        197,        197,        1,   149760, 0xa7a44665
-0,        198,        198,        1,   149760, 0x08f17b20
-0,        199,        199,        1,   149760, 0x0319e942
-0,        200,        200,        1,   149760, 0xab69057c
-0,        201,        201,        1,   149760, 0xb98814f4
-0,        202,        202,        1,   149760, 0xa172e6d0
-0,        203,        203,        1,   149760, 0x6cd35cd1
-0,        204,        204,        1,   149760, 0x7352b4b9
-0,        205,        205,        1,   149760, 0x07cbdedd
-0,        206,        206,        1,   149760, 0xbe7aa3c8
-0,        207,        207,        1,   149760, 0xdcbc8993
-0,        208,        208,        1,   149760, 0x0c5dbf95
-0,        209,        209,        1,   149760, 0x107e4f2c
-0,        210,        210,        1,   149760, 0xc650e333
-0,        211,        211,        1,   149760, 0x46abae6f
-0,        212,        212,        1,   149760, 0x0e41309d
-0,        213,        213,        1,   149760, 0x831e19a1
-0,        214,        214,        1,   149760, 0xd1955874
-0,        215,        215,        1,   149760, 0x486c41bb
-0,        216,        216,        1,   149760, 0xba020143
-0,        217,        217,        1,   149760, 0x3ebedef4
-0,        218,        218,        1,   149760, 0xda7bc235
-0,        219,        219,        1,   149760, 0x0abcb13e
-0,        220,        220,        1,   149760, 0xdf5159ac
-0,        221,        221,        1,   149760, 0x4e39d893
-0,        222,        222,        1,   149760, 0x393f382d
-0,        223,        223,        1,   149760, 0x92556867
-0,        224,        224,        1,   149760, 0x2daf47a8
-0,        225,        225,        1,   149760, 0x792a4448
-0,        226,        226,        1,   149760, 0x429e05ad
-0,        227,        227,        1,   149760, 0x89caaa32
-0,        228,        228,        1,   149760, 0xa70ec97b
-0,        229,        229,        1,   149760, 0xce0d24b7
-0,        230,        230,        1,   149760, 0x04be745d
-0,        231,        231,        1,   149760, 0xfb04d3d2
-0,        232,        232,        1,   149760, 0x5b472952
-0,        233,        233,        1,   149760, 0x6cd704b5
-0,        234,        234,        1,   149760, 0x18b0db7e
-0,        235,        235,        1,   149760, 0xdfb24e07
-0,        236,        236,        1,   149760, 0x6d9bae45
-0,        237,        237,        1,   149760, 0xf2eb5756
-0,        238,        238,        1,   149760, 0xdf858203
-0,        239,        239,        1,   149760, 0xdcd4822f
-0,        240,        240,        1,   149760, 0x80ceabaf
-0,        241,        241,        1,   149760, 0x8bd1a92f
-0,        242,        242,        1,   149760, 0x981a61ca
-0,        243,        243,        1,   149760, 0x5fa92603
-0,        244,        244,        1,   149760, 0xbb28f8da
-0,        245,        245,        1,   149760, 0x1710666d
-0,        246,        246,        1,   149760, 0xf928099a
-0,        247,        247,        1,   149760, 0x2e0ae9cb
-0,        248,        248,        1,   149760, 0xcf0e402c
-0,        249,        249,        1,   149760, 0x48e5b987
-0,        250,        250,        1,   149760, 0x7dc42853
-0,        251,        251,        1,   149760, 0x25f4aef0
-0,        252,        252,        1,   149760, 0x5f1d37b3
-0,        253,        253,        1,   149760, 0xb2fabf9f
-0,        254,        254,        1,   149760, 0xe87348ee
-0,        255,        255,        1,   149760, 0xbe9ec00f
-0,        256,        256,        1,   149760, 0xd67d1fb2
-0,        257,        257,        1,   149760, 0x92db1ca8
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-WP_MAIN10_B_Toshiba_3 b/deps/libav/tests/ref/fate/hevc-conformance-WP_MAIN10_B_Toshiba_3
deleted file mode 100644
index 23f03f8..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-WP_MAIN10_B_Toshiba_3
+++ /dev/null
@@ -1,257 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   299520, 0x6ecba46b
-0,          4,          4,        1,   299520, 0x54e6ef0a
-0,          5,          5,        1,   299520, 0x7a4d46c5
-0,          6,          6,        1,   299520, 0xccd57f4e
-0,          7,          7,        1,   299520, 0xbe0cb48d
-0,          8,          8,        1,   299520, 0x10e7b49f
-0,          9,          9,        1,   299520, 0x81aa72e2
-0,         10,         10,        1,   299520, 0x5bf7b51f
-0,         11,         11,        1,   299520, 0xfcedee4a
-0,         12,         12,        1,   299520, 0x586c99b6
-0,         13,         13,        1,   299520, 0x414ca13c
-0,         14,         14,        1,   299520, 0x3f0162f2
-0,         15,         15,        1,   299520, 0x4d450c05
-0,         16,         16,        1,   299520, 0x0a58bd84
-0,         17,         17,        1,   299520, 0x26e8394d
-0,         18,         18,        1,   299520, 0xfd78121b
-0,         19,         19,        1,   299520, 0x6afeaf44
-0,         20,         20,        1,   299520, 0x3e9a9270
-0,         21,         21,        1,   299520, 0x58b889ca
-0,         22,         22,        1,   299520, 0x0245ba62
-0,         23,         23,        1,   299520, 0xddecc5ab
-0,         24,         24,        1,   299520, 0x32cf3cd9
-0,         25,         25,        1,   299520, 0x5c0a0440
-0,         26,         26,        1,   299520, 0x9d3e2fee
-0,         27,         27,        1,   299520, 0x2894c708
-0,         28,         28,        1,   299520, 0x25be67d5
-0,         29,         29,        1,   299520, 0xe3ece9d6
-0,         30,         30,        1,   299520, 0xcc98e38b
-0,         31,         31,        1,   299520, 0xc448c794
-0,         32,         32,        1,   299520, 0xb4f75575
-0,         33,         33,        1,   299520, 0xac74a437
-0,         34,         34,        1,   299520, 0x09c7f2e2
-0,         35,         35,        1,   299520, 0xbfaed8ab
-0,         36,         36,        1,   299520, 0xb077d700
-0,         37,         37,        1,   299520, 0x6efa0545
-0,         38,         38,        1,   299520, 0xb8c1802d
-0,         39,         39,        1,   299520, 0x794774f8
-0,         40,         40,        1,   299520, 0x1098f4ff
-0,         41,         41,        1,   299520, 0x80ab8bfc
-0,         42,         42,        1,   299520, 0xc324c3bc
-0,         43,         43,        1,   299520, 0x1eee77cd
-0,         44,         44,        1,   299520, 0x7147e72e
-0,         45,         45,        1,   299520, 0x1a34883c
-0,         46,         46,        1,   299520, 0x74e93e31
-0,         47,         47,        1,   299520, 0x89410382
-0,         48,         48,        1,   299520, 0xfcce0ce1
-0,         49,         49,        1,   299520, 0x07bb33c6
-0,         50,         50,        1,   299520, 0xc1ee7318
-0,         51,         51,        1,   299520, 0xd1c4bd2d
-0,         52,         52,        1,   299520, 0xa670cfae
-0,         53,         53,        1,   299520, 0x718de79b
-0,         54,         54,        1,   299520, 0x85e40b78
-0,         55,         55,        1,   299520, 0x15362e72
-0,         56,         56,        1,   299520, 0xc6e523fa
-0,         57,         57,        1,   299520, 0x3e536edd
-0,         58,         58,        1,   299520, 0x9312996e
-0,         59,         59,        1,   299520, 0x9456d53c
-0,         60,         60,        1,   299520, 0x7bc01398
-0,         61,         61,        1,   299520, 0x5a40bcb4
-0,         62,         62,        1,   299520, 0xcfe126ce
-0,         63,         63,        1,   299520, 0xd9e1adf1
-0,         64,         64,        1,   299520, 0x9027b1ae
-0,         65,         65,        1,   299520, 0x4c1372fb
-0,         66,         66,        1,   299520, 0xe475a00b
-0,         67,         67,        1,   299520, 0x945bc646
-0,         68,         68,        1,   299520, 0xc33dbab3
-0,         69,         69,        1,   299520, 0x9e4afb82
-0,         70,         70,        1,   299520, 0x1bffa858
-0,         71,         71,        1,   299520, 0x3bc78ad7
-0,         72,         72,        1,   299520, 0xa096e683
-0,         73,         73,        1,   299520, 0xb889aa23
-0,         74,         74,        1,   299520, 0x8ffad857
-0,         75,         75,        1,   299520, 0x59d3cc7c
-0,         76,         76,        1,   299520, 0x47d1377a
-0,         77,         77,        1,   299520, 0xea73e864
-0,         78,         78,        1,   299520, 0x0994bd5c
-0,         79,         79,        1,   299520, 0xdf779d85
-0,         80,         80,        1,   299520, 0x8238cfa7
-0,         81,         81,        1,   299520, 0x8f2e94cc
-0,         82,         82,        1,   299520, 0x9e0b0df8
-0,         83,         83,        1,   299520, 0x98ac1ce5
-0,         84,         84,        1,   299520, 0xc1c293ed
-0,         85,         85,        1,   299520, 0x1f1dfedb
-0,         86,         86,        1,   299520, 0xe7297d56
-0,         87,         87,        1,   299520, 0xa1390726
-0,         88,         88,        1,   299520, 0xf0e828e8
-0,         89,         89,        1,   299520, 0x108b8291
-0,         90,         90,        1,   299520, 0xd8830efb
-0,         91,         91,        1,   299520, 0xeee3d2f0
-0,         92,         92,        1,   299520, 0xa35d5b29
-0,         93,         93,        1,   299520, 0xa14d0840
-0,         94,         94,        1,   299520, 0xfa894a56
-0,         95,         95,        1,   299520, 0xd50005b5
-0,         96,         96,        1,   299520, 0xba625134
-0,         97,         97,        1,   299520, 0xce7dd782
-0,         98,         98,        1,   299520, 0x9e04e32f
-0,         99,         99,        1,   299520, 0x07e6d466
-0,        100,        100,        1,   299520, 0x4e66e1d4
-0,        101,        101,        1,   299520, 0x80aa6be6
-0,        102,        102,        1,   299520, 0xa4564be8
-0,        103,        103,        1,   299520, 0x7d34e443
-0,        104,        104,        1,   299520, 0xd5a08c86
-0,        105,        105,        1,   299520, 0xa73e63e8
-0,        106,        106,        1,   299520, 0x93937eb2
-0,        107,        107,        1,   299520, 0x0c08ba8f
-0,        108,        108,        1,   299520, 0x1d6b1a8c
-0,        109,        109,        1,   299520, 0x2e0272b4
-0,        110,        110,        1,   299520, 0x47177676
-0,        111,        111,        1,   299520, 0x6af7ffce
-0,        112,        112,        1,   299520, 0x0564a4bc
-0,        113,        113,        1,   299520, 0x7f664100
-0,        114,        114,        1,   299520, 0x6decd6ae
-0,        115,        115,        1,   299520, 0xb2d94adc
-0,        116,        116,        1,   299520, 0x55d33809
-0,        117,        117,        1,   299520, 0x5b126674
-0,        118,        118,        1,   299520, 0xd25d5750
-0,        119,        119,        1,   299520, 0x789a7f89
-0,        120,        120,        1,   299520, 0xdd082ab2
-0,        121,        121,        1,   299520, 0x3e6132ee
-0,        122,        122,        1,   299520, 0xe48209ca
-0,        123,        123,        1,   299520, 0x707d3b24
-0,        124,        124,        1,   299520, 0x8af19539
-0,        125,        125,        1,   299520, 0x0bbb4c38
-0,        126,        126,        1,   299520, 0xaaba4bd6
-0,        127,        127,        1,   299520, 0xa325d79e
-0,        128,        128,        1,   299520, 0x2bd4b64a
-0,        129,        129,        1,   299520, 0xab0c59a7
-0,        130,        130,        1,   299520, 0x260a56fc
-0,        131,        131,        1,   299520, 0xa1a55847
-0,        132,        132,        1,   299520, 0xa1a55847
-0,        133,        133,        1,   299520, 0x01438514
-0,        134,        134,        1,   299520, 0xa511e8bd
-0,        135,        135,        1,   299520, 0x7ebfd5b9
-0,        136,        136,        1,   299520, 0xdf4f1365
-0,        137,        137,        1,   299520, 0x6266911a
-0,        138,        138,        1,   299520, 0xe8eefcab
-0,        139,        139,        1,   299520, 0x7e74ca0d
-0,        140,        140,        1,   299520, 0x4b21d349
-0,        141,        141,        1,   299520, 0xa8b9ef41
-0,        142,        142,        1,   299520, 0x3187ee5b
-0,        143,        143,        1,   299520, 0x3fadb935
-0,        144,        144,        1,   299520, 0x8dca0391
-0,        145,        145,        1,   299520, 0x68215cc6
-0,        146,        146,        1,   299520, 0x7c81f366
-0,        147,        147,        1,   299520, 0x1a976381
-0,        148,        148,        1,   299520, 0x8ac095f4
-0,        149,        149,        1,   299520, 0xf5f8752b
-0,        150,        150,        1,   299520, 0xd8c03c80
-0,        151,        151,        1,   299520, 0x445a2e07
-0,        152,        152,        1,   299520, 0xddb83c6f
-0,        153,        153,        1,   299520, 0xc6dfe76a
-0,        154,        154,        1,   299520, 0x860a120f
-0,        155,        155,        1,   299520, 0x1ec91a95
-0,        156,        156,        1,   299520, 0x0180cc49
-0,        157,        157,        1,   299520, 0x63a115e3
-0,        158,        158,        1,   299520, 0x8848e971
-0,        159,        159,        1,   299520, 0x49246622
-0,        160,        160,        1,   299520, 0x3169db32
-0,        161,        161,        1,   299520, 0xcf01d8a3
-0,        162,        162,        1,   299520, 0x57a1a9c1
-0,        163,        163,        1,   299520, 0x517670eb
-0,        164,        164,        1,   299520, 0x4e2e6b5a
-0,        165,        165,        1,   299520, 0x06240a68
-0,        166,        166,        1,   299520, 0xa0d076a1
-0,        167,        167,        1,   299520, 0xb73c4515
-0,        168,        168,        1,   299520, 0x9f523268
-0,        169,        169,        1,   299520, 0x6fdcc6a2
-0,        170,        170,        1,   299520, 0xf3f5b69f
-0,        171,        171,        1,   299520, 0xce33a286
-0,        172,        172,        1,   299520, 0xce46e834
-0,        173,        173,        1,   299520, 0x14a6fe0d
-0,        174,        174,        1,   299520, 0x39a8145f
-0,        175,        175,        1,   299520, 0x91981d47
-0,        176,        176,        1,   299520, 0x1507d9be
-0,        177,        177,        1,   299520, 0x4525d4a2
-0,        178,        178,        1,   299520, 0x95e058ab
-0,        179,        179,        1,   299520, 0x8de2438a
-0,        180,        180,        1,   299520, 0xf43dc0ff
-0,        181,        181,        1,   299520, 0xaf232f4b
-0,        182,        182,        1,   299520, 0x8adabd81
-0,        183,        183,        1,   299520, 0x1e837b72
-0,        184,        184,        1,   299520, 0xb79f811d
-0,        185,        185,        1,   299520, 0x1532fb05
-0,        186,        186,        1,   299520, 0x2e3f6341
-0,        187,        187,        1,   299520, 0x10c82269
-0,        188,        188,        1,   299520, 0x8c39bd0c
-0,        189,        189,        1,   299520, 0x64fefe7b
-0,        190,        190,        1,   299520, 0x3ef6d5c7
-0,        191,        191,        1,   299520, 0x571c1edc
-0,        192,        192,        1,   299520, 0xe9e1584c
-0,        193,        193,        1,   299520, 0xd150a0db
-0,        194,        194,        1,   299520, 0x5d140f2d
-0,        195,        195,        1,   299520, 0xea00f302
-0,        196,        196,        1,   299520, 0xdd4e0fc4
-0,        197,        197,        1,   299520, 0x51c760fa
-0,        198,        198,        1,   299520, 0x68d5d26e
-0,        199,        199,        1,   299520, 0xde594a02
-0,        200,        200,        1,   299520, 0xac6d361a
-0,        201,        201,        1,   299520, 0xef6506ae
-0,        202,        202,        1,   299520, 0x744737a8
-0,        203,        203,        1,   299520, 0x2bd0834b
-0,        204,        204,        1,   299520, 0x348a8d0f
-0,        205,        205,        1,   299520, 0x93e165c8
-0,        206,        206,        1,   299520, 0x208d305c
-0,        207,        207,        1,   299520, 0xb927ed9a
-0,        208,        208,        1,   299520, 0xd252b13a
-0,        209,        209,        1,   299520, 0x11a59b2d
-0,        210,        210,        1,   299520, 0xc27785d0
-0,        211,        211,        1,   299520, 0x5c654cb5
-0,        212,        212,        1,   299520, 0x3d03a387
-0,        213,        213,        1,   299520, 0xdb0dc19d
-0,        214,        214,        1,   299520, 0x2ef3bbba
-0,        215,        215,        1,   299520, 0x7d36cd79
-0,        216,        216,        1,   299520, 0xa9ceca1e
-0,        217,        217,        1,   299520, 0x33db4d99
-0,        218,        218,        1,   299520, 0x8d28a55e
-0,        219,        219,        1,   299520, 0x554864a6
-0,        220,        220,        1,   299520, 0x6a336557
-0,        221,        221,        1,   299520, 0xd2285832
-0,        222,        222,        1,   299520, 0x9509f5f8
-0,        223,        223,        1,   299520, 0x8e479b03
-0,        224,        224,        1,   299520, 0x9513a8c3
-0,        225,        225,        1,   299520, 0x81080fac
-0,        226,        226,        1,   299520, 0x6c447b69
-0,        227,        227,        1,   299520, 0xbf4c2fbd
-0,        228,        228,        1,   299520, 0x1a77306e
-0,        229,        229,        1,   299520, 0xd485864b
-0,        230,        230,        1,   299520, 0x4e87b787
-0,        231,        231,        1,   299520, 0xe28e7153
-0,        232,        232,        1,   299520, 0x2ab24b9b
-0,        233,        233,        1,   299520, 0xffcb7357
-0,        234,        234,        1,   299520, 0x5e1e2b7e
-0,        235,        235,        1,   299520, 0x58d39e6d
-0,        236,        236,        1,   299520, 0x4a2b836a
-0,        237,        237,        1,   299520, 0xa1728e1e
-0,        238,        238,        1,   299520, 0x33e5bdd4
-0,        239,        239,        1,   299520, 0x3b144d98
-0,        240,        240,        1,   299520, 0xe72c4de2
-0,        241,        241,        1,   299520, 0x031350cb
-0,        242,        242,        1,   299520, 0x146fba58
-0,        243,        243,        1,   299520, 0x1b6679c7
-0,        244,        244,        1,   299520, 0x27e9d545
-0,        245,        245,        1,   299520, 0x5105beeb
-0,        246,        246,        1,   299520, 0x80284fd3
-0,        247,        247,        1,   299520, 0x426a5d65
-0,        248,        248,        1,   299520, 0xdcc33f89
-0,        249,        249,        1,   299520, 0x29e805ec
-0,        250,        250,        1,   299520, 0x89a09ed9
-0,        251,        251,        1,   299520, 0x60ad258c
-0,        252,        252,        1,   299520, 0xb44ee9b1
-0,        253,        253,        1,   299520, 0x184d6a88
-0,        254,        254,        1,   299520, 0xb4c8cefe
-0,        255,        255,        1,   299520, 0x358a0407
-0,        256,        256,        1,   299520, 0xa5cb97eb
-0,        257,        257,        1,   299520, 0x3d6a096e
-0,        258,        258,        1,   299520, 0xcb266e78
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-cip_B_NEC_3 b/deps/libav/tests/ref/fate/hevc-conformance-cip_B_NEC_3
deleted file mode 100644
index 016f0f1..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-cip_B_NEC_3
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xcbda260f
-0,          1,          1,        1,   149760, 0xbd8d32a9
-0,          2,          2,        1,   149760, 0x39562006
-0,          3,          3,        1,   149760, 0xbc62475b
-0,          4,          4,        1,   149760, 0x1bf1fb79
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_A_NEC_3 b/deps/libav/tests/ref/fate/hevc-conformance-ipcm_A_NEC_3
deleted file mode 100644
index 145f590..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_A_NEC_3
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0x2356474c
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_B_NEC_3 b/deps/libav/tests/ref/fate/hevc-conformance-ipcm_B_NEC_3
deleted file mode 100644
index d917cbc..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_B_NEC_3
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xc80d43f8
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_C_NEC_3 b/deps/libav/tests/ref/fate/hevc-conformance-ipcm_C_NEC_3
deleted file mode 100644
index 6c89cea..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_C_NEC_3
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xb92d38ee
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_D_NEC_3 b/deps/libav/tests/ref/fate/hevc-conformance-ipcm_D_NEC_3
deleted file mode 100644
index 2ccff05..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_D_NEC_3
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xa24d17f8
diff --git a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_E_NEC_2 b/deps/libav/tests/ref/fate/hevc-conformance-ipcm_E_NEC_2
deleted file mode 100644
index 794c4ac..0000000
--- a/deps/libav/tests/ref/fate/hevc-conformance-ipcm_E_NEC_2
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   149760, 0xf4582514
diff --git a/deps/libav/tests/ref/fate/hmac b/deps/libav/tests/ref/fate/hmac
deleted file mode 100644
index 7d2a437..0000000
--- a/deps/libav/tests/ref/fate/hmac
+++ /dev/null
@@ -1,6 +0,0 @@
-9294727a3638bb1c13f48ef8158bfc9d
-750c783e6ab0b503eaa86e310a5db738
-56be34521d144c88dbb8c733f0e8b3f6
-467cb2560355d7fa3ab2d6b939e6e47c
-5a6ffd741d3e23b12f78b1baee9e609a
-8b4b9d11c9e186c58f2a53b08ddfa436
diff --git a/deps/libav/tests/ref/fate/id-cin-video b/deps/libav/tests/ref/fate/id-cin-video
deleted file mode 100644
index f55544f..0000000
--- a/deps/libav/tests/ref/fate/id-cin-video
+++ /dev/null
@@ -1,106 +0,0 @@
-#tb 0: 1/14
-#tb 1: 1/22050
-0,          0,          0,        1,   230400, 0x00000000
-1,          0,          0,     1575,     6300, 0xdd759df8
-0,          1,          1,        1,   230400, 0x3a3486b4
-1,       1575,       1575,     1575,     6300, 0x43aa398c
-0,          2,          2,        1,   230400, 0xb6a9b772
-1,       3150,       3150,     1575,     6300, 0x61a7b9fd
-0,          3,          3,        1,   230400, 0x8e2d4c03
-1,       4725,       4725,     1575,     6300, 0xfc8adbc8
-0,          4,          4,        1,   230400, 0x5df342a9
-1,       6300,       6300,     1575,     6300, 0x84c4dffc
-0,          5,          5,        1,   230400, 0x00f95cc9
-1,       7875,       7875,     1575,     6300, 0x3044ede1
-0,          6,          6,        1,   230400, 0x72ee1c4c
-1,       9450,       9450,     1575,     6300, 0x6de5b64c
-0,          7,          7,        1,   230400, 0x2bd991e8
-1,      11025,      11025,     1575,     6300, 0x1d9df1b0
-0,          8,          8,        1,   230400, 0x84cf471e
-1,      12600,      12600,     1575,     6300, 0xb5864b86
-0,          9,          9,        1,   230400, 0x75253428
-1,      14175,      14175,     1575,     6300, 0xf2f7fbc2
-0,         10,         10,        1,   230400, 0x57246d42
-1,      15750,      15750,     1575,     6300, 0xe61307a8
-0,         11,         11,        1,   230400, 0x57246d42
-1,      17325,      17325,     1575,     6300, 0x07fcd607
-0,         12,         12,        1,   230400, 0x57246d42
-1,      18900,      18900,     1575,     6300, 0xb8dfbdf6
-0,         13,         13,        1,   230400, 0x7072be1b
-1,      20475,      20475,     1575,     6300, 0xf308e40c
-0,         14,         14,        1,   230400, 0x2e9ffcf2
-1,      22050,      22050,     1575,     6300, 0xa6163aa8
-0,         15,         15,        1,   230400, 0x2e9ffcf2
-1,      23625,      23625,     1575,     6300, 0x3f74c286
-0,         16,         16,        1,   230400, 0x1a5cb24d
-1,      25200,      25200,     1575,     6300, 0xcece754c
-0,         17,         17,        1,   230400, 0x1a06c797
-1,      26775,      26775,     1575,     6300, 0x7c5b47b9
-0,         18,         18,        1,   230400, 0x9e51b953
-1,      28350,      28350,     1575,     6300, 0x3a7baf37
-0,         19,         19,        1,   230400, 0x9e51b953
-1,      29925,      29925,     1575,     6300, 0x56fd368e
-0,         20,         20,        1,   230400, 0x9e51b953
-1,      31500,      31500,     1575,     6300, 0x68db250e
-0,         21,         21,        1,   230400, 0x9e51b953
-1,      33075,      33075,     1575,     6300, 0x37d2d710
-0,         22,         22,        1,   230400, 0x9e51b953
-1,      34650,      34650,     1575,     6300, 0xf458b88e
-0,         23,         23,        1,   230400, 0xccd7c68d
-1,      36225,      36225,     1575,     6300, 0xed38430f
-0,         24,         24,        1,   230400, 0x776da8bc
-1,      37800,      37800,     1575,     6300, 0xd5982d28
-0,         25,         25,        1,   230400, 0x495bec1c
-1,      39375,      39375,     1575,     6300, 0x17465fb3
-0,         26,         26,        1,   230400, 0x495bec1c
-1,      40950,      40950,     1575,     6300, 0xe4591d73
-0,         27,         27,        1,   230400, 0x495bec1c
-1,      42525,      42525,     1575,     6300, 0x4cbbf957
-0,         28,         28,        1,   230400, 0x495bec1c
-1,      44100,      44100,     1575,     6300, 0x4f031f50
-0,         29,         29,        1,   230400, 0x495bec1c
-1,      45675,      45675,     1575,     6300, 0xc03f8ca1
-0,         30,         30,        1,   230400, 0x495bec1c
-1,      47250,      47250,     1575,     6300, 0x1f0d133c
-0,         31,         31,        1,   230400, 0x495bec1c
-1,      48825,      48825,     1575,     6300, 0x18dbbeb4
-0,         32,         32,        1,   230400, 0xa1cae3f3
-1,      50400,      50400,     1575,     6300, 0xef3fa45f
-0,         33,         33,        1,   230400, 0x5cd567eb
-1,      51975,      51975,     1575,     6300, 0x7880f935
-0,         34,         34,        1,   230400, 0x57bbfe30
-1,      53550,      53550,     1575,     6300, 0x5eeca5d5
-0,         35,         35,        1,   230400, 0xc7763926
-1,      55125,      55125,     1575,     6300, 0xda99accc
-0,         36,         36,        1,   230400, 0xc7763926
-1,      56700,      56700,     1575,     6300, 0x90aea270
-0,         37,         37,        1,   230400, 0xc7763926
-1,      58275,      58275,     1575,     6300, 0x7fc9da4e
-0,         38,         38,        1,   230400, 0xc7763926
-1,      59850,      59850,     1575,     6300, 0xb64d34d4
-0,         39,         39,        1,   230400, 0xc7763926
-1,      61425,      61425,     1575,     6300, 0x385ed9e7
-0,         40,         40,        1,   230400, 0xc7763926
-1,      63000,      63000,     1575,     6300, 0xd2f5be45
-0,         41,         41,        1,   230400, 0xc7763926
-1,      64575,      64575,     1575,     6300, 0x763fa974
-0,         42,         42,        1,   230400, 0x0e68cb2f
-1,      66150,      66150,     1575,     6300, 0x5a785ec4
-0,         43,         43,        1,   230400, 0x1a5d96ba
-1,      67725,      67725,     1575,     6300, 0x2877c5a5
-0,         44,         44,        1,   230400, 0xff3554f4
-1,      69300,      69300,     1575,     6300, 0x667e81a5
-0,         45,         45,        1,   230400, 0x74438207
-1,      70875,      70875,     1575,     6300, 0xdcfeffeb
-0,         46,         46,        1,   230400, 0x488de02d
-1,      72450,      72450,     1575,     6300, 0x1aae1606
-0,         47,         47,        1,   230400, 0x488de02d
-1,      74025,      74025,     1575,     6300, 0x37e0550f
-0,         48,         48,        1,   230400, 0x488de02d
-1,      75600,      75600,     1575,     6300, 0x018202e9
-0,         49,         49,        1,   230400, 0x488de02d
-1,      77175,      77175,     1575,     6300, 0x2b13de85
-0,         50,         50,        1,   230400, 0x488de02d
-1,      78750,      78750,     1575,     6300, 0xe3bfa403
-0,         51,         51,        1,   230400, 0x488de02d
-1,      80325,      80325,     1575,     6300, 0x2c5bd9c9
diff --git a/deps/libav/tests/ref/fate/idroq-video-encode b/deps/libav/tests/ref/fate/idroq-video-encode
deleted file mode 100644
index badb06d..0000000
--- a/deps/libav/tests/ref/fate/idroq-video-encode
+++ /dev/null
@@ -1 +0,0 @@
-2ac89fa0e5600152667bcbc661f06cfe
diff --git a/deps/libav/tests/ref/fate/iff-byterun1 b/deps/libav/tests/ref/fate/iff-byterun1
deleted file mode 100644
index 6f80c72..0000000
--- a/deps/libav/tests/ref/fate/iff-byterun1
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,        0,   230400, 0x35e51c62
diff --git a/deps/libav/tests/ref/fate/iff-fibonacci b/deps/libav/tests/ref/fate/iff-fibonacci
deleted file mode 100644
index e452f31..0000000
--- a/deps/libav/tests/ref/fate/iff-fibonacci
+++ /dev/null
@@ -1 +0,0 @@
-e968a853779bb6438339e3b8d69d8d24
diff --git a/deps/libav/tests/ref/fate/iff-ilbm b/deps/libav/tests/ref/fate/iff-ilbm
deleted file mode 100644
index a801aff..0000000
--- a/deps/libav/tests/ref/fate/iff-ilbm
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,        0,   230400, 0x0929e342
diff --git a/deps/libav/tests/ref/fate/iff-pcm b/deps/libav/tests/ref/fate/iff-pcm
deleted file mode 100644
index cffcc57..0000000
--- a/deps/libav/tests/ref/fate/iff-pcm
+++ /dev/null
@@ -1 +0,0 @@
-6dc1329541393525a60fd6b9782573f5
diff --git a/deps/libav/tests/ref/fate/iirfilter b/deps/libav/tests/ref/fate/iirfilter
deleted file mode 100644
index 2e5902d..0000000
--- a/deps/libav/tests/ref/fate/iirfilter
+++ /dev/null
@@ -1,1024 +0,0 @@
-     0      0
-    38      2
-   151     15
-   339     65
-   603    182
-   942    381
-  1356    664
-  1845   1021
-  2409   1450
-  3046   1953
-  3755   2530
-  4535   3182
-  5384   3907
-  6300   4700
-  7278   5563
-  8315   6491
-  9405   7481
- 10541   8529
- 11717   9629
- 12924  10773
- 14151  11956
- 15385  13167
- 16615  14396
- 17825  15630
- 18997  16857
- 20114  18060
- 21156  19222
- 22102  20325
- 22929  21349
- 23613  22273
- 24132  23073
- 24461  23726
- 24575  24208
- 24453  24495
- 24073  24564
- 23416  24392
- 22467  23959
- 21213  23245
- 19649  22236
- 17773  20922
- 15590  19296
- 13116  17360
- 10371  15119
-  7386  12591
-  4201   9797
-   867   6771
- -2559   3554
- -6008    199
- -9405  -3235
--12667  -6678
--15707 -10053
--18435 -13277
--20762 -16261
--22602 -18916
--23875 -21153
--24511 -22887
--24457 -24040
--23675 -24546
--22151 -24352
--19895 -23428
--16946 -21762
--13370 -19370
- -9265 -16296
- -4757 -12613
-     0  -8423
-  4831  -3858
-  9544    923
- 13934   5743
- 17799  10406
- 20942  14708
- 23189  18447
- 24395  21430
- 24457  23488
- 23323  24483
- 21001  24321
- 17563  22963
- 13148  20426
-  7959  16795
-  2259  12223
- -3643   6922
- -9405   1166
--14670  -4731
--19092 -10421
--22359 -15550
--24213 -19777
--24481 -22797
--23087 -24368
--20071 -24334
--15590 -22639
- -9924 -19343
- -3457 -14629
-  3345  -8793
-  9959  -2236
- 15851   4563
- 20517  11078
- 23528  16779
- 24575  21171
- 23506  23846
- 20349  24522
- 15327  23076
-  8845  19572
-  1469  14264
- -6117   7589
--13180    135
--18997  -7403
--22942 -14289
--24553 -19814
--23592 -23377
--20092 -24551
--14366 -23145
- -6989 -19239
-  1244 -13192
-  9405  -5620
- 16532   2656
- 21744  10697
- 24357  17548
- 23978  22356
- 20579  24483
- 14518  23593
-  6518  19723
- -2409  13293
--11083   5078
--18310  -3876
--23048 -12378
--24568 -19252
--22573 -23500
--17270 -24458
- -9370 -21908
-     0 -16140
-  9439  -7935
- 17484   1526
- 22832  10824
- 24568  18508
- 22327  23330
- 16392  24452
-  7673  21608
- -2409  15181
--12146   6168
--19828  -3955
--24050 -13466
--23978 -20689
--19535 -24292
--11451 -23552
- -1168 -18512
-  9405 -10015
- 18234    416
- 23560  10836
- 24257  19234
- 20092  23929
- 11817  23916
-  1055  19105
- -9993  10379
--18997   -540
--23986 -11413
--23802 -19939
--18385 -24246
- -8845 -23318
-  2746 -17260
- 13778  -7325
- 21691   4319
- 24575  15045
- 21656  22357
- 13528  24482
-  2071  20823
- -9959  12152
--19581    484
--24331 -11367
--22915 -20460
--15590 -24459
- -4164 -22257
-  8421 -14315
- 18828  -2603
- 24213   9857
- 23022  19756
- 15474  24383
-  3569  22388
- -9405  14211
--19761   2031
--24471 -10785
--22069 -20591
--13148 -24512
-  -264 -21311
- 12763 -11818
- 21968   1241
- 24457  13990
- 19351  22545
-  8137  24211
- -5715  18362
--17799   6720
--24167  -7108
--22646 -18722
--13622 -24326
-     0 -21995
- 13685 -12382
- 22762   1409
- 24035  14788
- 16946  23188
-  3867  23644
--10643  15884
--21401   2514
--24457 -11806
--18584 -21960
- -5825 -24220
-  9160 -17649
- 20762  -4546
- 24527  10303
- 18901  21343
-  5935  24337
- -9405  18028
--21098   4727
--24442 -10470
--17979 -21608
- -4201 -24206
- 11351 -17110
- 22280  -3064
- 23970  12287
- 15590  22636
-   565  23615
--14760  14693
--23773   -479
--22467 -15504
--11284 -23907
-  4942 -21954
- 19021 -10373
- 24575   5837
- 18973  19502
-  4646  24445
--11883  18316
--22929   3786
--23226 -12541
--12505 -23090
-  4239 -22841
- 18997 -11784
- 24567   4932
- 18107  19331
-  2671  24403
--14151  17558
--23919   2036
--21602 -14549
- -8244 -23897
-  9405 -21206
- 22232  -7710
- 23473   9785
- 12342  22272
- -5384  23186
--20286  11920
--24287  -5693
--15090 -20319
-  2409 -24060
- 18633 -14771
- 24538   2613
- 16698  18608
-  -603  24329
--17616  16471
--24575   -682
--17351 -17495
-     0 -24355
- 17404 -17211
- 24575    -65
- 17136  17163
-  -603  24334
--18031  17094
--24538   -374
--16023 -17660
-  2409 -24287
- 19397 -16108
- 24287   1992
- 13872  18902
- -5384  24066
--21251  14131
--23473  -4761
--10473 -20664
-  9405 -23351
- 23151 -10967
- 21602   8573
-  5642  22543
--14151  21682
--24430   6431
--18107 -13147
-   641 -23920
- 18997 -18514
- 24207   -475
- 12505  17922
- -8030  23970
--22929  13357
--21511  -6625
- -4646 -21972
- 15619 -21758
- 24575  -6009
- 15561  14083
- -4942  24019
--21831  16485
--22467  -3138
- -6227 -20474
- 14760 -22641
- 24569  -7904
- 15590  12791
- -5421  23839
--22280  16760
--21797  -3160
- -4201 -20666
- 16754 -22169
- 24442  -6381
- 12602  14430
- -9405  23865
--23848  14348
--18901  -6644
-  1545 -22308
- 20762 -19937
- 22804  -1339
-  5825  18365
--16080  22954
--24457   8529
--12080 -13009
- 10643 -23650
- 24269 -14353
- 16946   7119
- -5127  22521
--22762  18602
--20413  -1370
-     0 -20152
- 20454 -21342
- 22646  -3797
-  4461  17096
--17799  22804
--23902   8148
- -8137 -13817
- 15149 -23296
- 24457 -11618
- 11016  10660
--12763  23135
--24574  14243
--13148  -7861
- 10813 -22608
- 24471 -16124
- 14609   5565
- -9405  21949
--24315  17379
--15474  -3849
-  8598 -21336
- 24213 -18120
- 15793   2745
- -8421  20885
--24220  18429
--15590  -2263
-  8880 -20663
- 24331 -18359
- 14851   2398
- -9959  20685
--24488  17917
--13528  -3137
- 11618 -20918
- 24575 -17075
- 11551   4460
--13778  21286
--24421  15770
- -8845  -6328
- 16307 -21661
- 23802 -13916
-  5348   8671
--18997  21868
--22452  11421
- -1055 -11371
- 21548 -21685
- 20092  -8212
- -3941  14242
--23560  20853
--16476   4267
-  9405 -17009
- 24547 -19106
- 11451    343
--14911  19309
--23978  16208
- -5053  -5409
- 19828 -20699
- 21364 -12016
- -2409  10553
--23347  20700
--16392   6559
- 10268 -15211
- 24568 -18879
-  9090   -118
--17484  18664
--22690  14969
-     0  -6714
- 22719 -20134
- 17270  -9014
- -9717  13022
--24568  18943
- -8527   1506
- 18310 -17662
- 21934 -14749
- -2409   6538
--23695  19463
--14518   7789
- 13433 -13633
- 23978 -17566
-  3270    935
--21744  18075
--18184  11812
-  9405  -9654
- 24544 -18394
-  6989  -3082
--19939  16117
--20092  13945
-  6881  -6613
- 24553 -18196
-  8809  -5437
--18997  14458
--20742  14731
-  6117  -4859
- 24531 -17657
-  8845  -6307
--19210  13526
--20349  14588
-  7170  -4444
- 24575 -17109
-  7098  -5874
--20517  13412
--18780  13691
-  9959  -5272
- 24347 -16558
-  3457  -4241
--22482  13949
--15590  11979
- 14181  -7142
- 23087 -15723
- -2146  -1459
--24213  14726
--10200   9228
- 19092  -9692
- 19717 -14108
- -9405   2343
--24304  15085
- -2259   5221
- 23251 -12286
- 13148 -11127
--17190   6746
--21001  14161
-  7745      2
- 24457 -13938
-  2971  -6372
--23189  10842
--12860  11094
- 17799  -5795
- 20243 -13421
- -9544    -30
--24096  13184
-     0   5498
- 24110 -10713
-  9265  -9718
--20620   6673
--16946  12155
- 14427  -1883
- 22151 -12653
- -6591  -2861
--24457  11378
- -1770   6908
- 23875  -8726
-  9648  -9817
--20762   5209
--16251  11385
- 15707  -1358
- 21059 -11610
- -9405  -2353
--23830  10656
-  2559   5560
- 24560  -8789
-  4201  -8028
--23439   6314
--10371   9643
- 20783  -3542
- 15590 -10404
--16973    742
--19649  10386
- 12407   1870
- 22467  -9720
- -7458  -4144
--24073   8562
-  2446   5991
- 24575  -7072
-  2371  -7375
--24132   5398
- -6808   8306
- 22929  -3667
- 10745  -8824
--21156   1980
--14120   8987
- 18997   -408
- 16918  -8863
--16615  -1001
--19163   8521
- 14151   2220
- 20902  -8027
--11717  -3241
--22200   7441
-  9405   4071
- 23126  -6811
- -7278  -4722
--23754   6177
-  5384   5213
- 24153  -5571
- -3755  -5566
--24386   5013
-  2409   5801
- 24506  -4521
- -1356  -5939
--24557   4104
-   603   5999
- 24573  -3765
-  -151  -5994
--24575   3508
-     0   5937
- 24575  -3331
-  -151  -5835
--24573   3232
-   603   5694
- 24557  -3205
- -1356  -5517
--24506   3244
-  2409   5303
- 24386  -3343
- -3755  -5049
--24153   3494
-  5384   4752
- 23754  -3685
- -7278  -4407
--23126   3906
-  9405   4007
- 22200  -4143
--11717  -3547
--20902   4380
- 14151   3025
- 19163  -4598
--16615  -2434
--16918   4778
- 18997   1780
- 14120  -4898
--21156  -1066
--10745   4934
- 22929    304
-  6808  -4862
--24132    489
- -2371   4664
- 24575  -1288
- -2446  -4320
--24073   2060
-  7458   3820
- 22467  -2767
--12407  -3162
--19649   3365
- 16973   2357
- 15590  -3808
--20783  -1429
--10371   4050
- 23439    419
-  4201  -4055
--24560    616
-  2559   3795
- 23830  -1607
- -9405  -3266
--21059   2473
- 15707   2486
- 16251  -3130
--20762  -1499
- -9648   3505
- 23875    386
-  1770  -3539
--24457    754
-  6591   3205
- 22151  -1798
--14427  -2518
--16946   2618
- 20620   1540
-  9265  -3101
--24110   -381
-     0   3162
- 24096   -809
- -9544  -2775
--20243   1859
- 17799   1978
- 12860  -2598
--23189   -879
- -2971   2893
- 24457   -344
- -7745  -2674
--21001   1478
- 17190   1966
- 13148  -2304
--23251   -890
- -2259   2647
- 24304   -341
- -9405  -2421
--19717   1467
- 19092   1662
- 10200  -2229
--24213   -535
-  2146   2434
- 23087   -692
--14181  -2022
--15590   1706
- 22482   1090
-  3457  -2230
--24347    115
-  9959   2111
- 18780  -1251
--20517  -1374
- -7098   1975
- 24575    238
- -7170  -2057
--20349    938
- 19210   1464
-  8845  -1763
--24531   -392
-  6117   1949
- 20742   -783
--18997  -1425
- -8809   1630
- 24553    385
- -6881  -1825
--20092    770
- 19939   1291
-  6989  -1572
--24544   -244
-  9405   1688
- 18184   -869
--21744  -1069
- -3270   1559
- 23978     -7
--13433  -1511
--14518   1041
- 23695    753
- -2409  -1536
--21934    344
- 18310   1251
-  8527  -1225
--24568   -337
-  9717   1436
- 17270   -719
--22719   -869
-     0   1342
- 22690   -157
--17484  -1188
- -9090   1051
- 24568    353
--10268  -1293
--16392    658
- 23347    745
- -2409  -1224
--21364    244
- 19828    996
-  5053  -1036
--23978   -132
- 14911   1114
- 11451   -783
--24547   -437
-  9405   1124
- 16476   -513
--23560   -661
-  3941   1058
- 20092   -257
--21548   -807
- -1055    945
- 22452    -37
--18997   -887
- -5348    815
- 23802    142
--16307   -917
- -8845    682
- 24421    276
--13778   -913
--11551    563
- 24575    371
--11618   -888
--13528    463
- 24488    431
- -9959   -854
--14851    386
- 24331    462
- -8880   -815
--15590    333
- 24220    471
- -8421   -779
--15793    302
- 24213    460
- -8598   -746
--15474    292
- 24315    433
- -9405   -717
--14609    300
- 24471    391
--10813   -689
--13148    324
- 24574    336
--12763   -660
--11016    359
- 24457    267
--15149   -627
- -8137    400
- 23902    184
--17799   -584
- -4461    444
- 22646     90
--20454   -527
-     0    483
- 20413    -15
--22762   -452
-  5127    511
- 16946   -124
--24269   -357
- 10643    517
- 12080   -232
--24457   -241
- 16080    495
-  5825   -328
--22804   -107
- 20762    440
- -1545   -400
--18901     35
- 23848    347
- -9405   -437
--12602    173
- 24442    220
--16754   -426
- -4201    290
- 21797     69
--22280   -362
-  5421    366
- 15590    -89
--24569   -247
- 14760    384
-  6227   -228
--22467    -95
- 21831    335
- -4942   -321
--15561     71
- 24575    222
--15619   -344
- -4646    214
- 21511     65
--22929   -288
-  8030    300
- 12505   -102
--24207   -162
- 18997    304
-  -641   -232
--18107      4
- 24430    218
--14151   -286
- -5642    160
- 21602     68
--23151   -244
-  9405    253
- 10473    -97
--23473   -115
- 21251    247
- -5384   -216
--13872     49
- 24287    142
--19397   -238
-  2409    183
- 16023    -17
--24538   -153
- 18031    224
-  -603   -158
--17136      0
- 24575    153
--17404   -209
-     0    142
- 17351      6
--24575   -144
- 17616    196
-  -603   -133
--16698     -1
- 24538    131
--18633   -182
-  2409    132
- 15090    -11
--24287   -111
- 20286    169
- -5384   -134
--12342     30
- 23473     86
--22232   -152
-  9405    138
-  8244    -53
--21602    -56
- 23919    132
--14151   -138
- -2671     76
- 18107     21
--24567   -104
- 18997    134
- -4239    -98
--12505     16
- 23226     69
--22929   -119
- 11883    111
-  4646    -53
--18973    -28
- 24575     92
--19021   -113
-  4942     82
- 11284    -16
--22467    -54
- 23773     97
--14760    -97
-  -565     56
- 15590      8
--23970    -65
- 22280     93
--11351    -82
- -4201     37
- 17979     21
--24442    -67
- 21098     85
- -9405    -69
- -5935     26
- 18901     24
--24527    -64
- 20762     77
- -9160    -61
- -5825     23
- 18584     21
--24457    -56
- 21401     69
--10643    -57
- -3867     25
- 16946     15
--24035    -47
- 22762     62
--13685    -55
-     0     29
- 13622      4
--22646    -35
- 24167     53
--17799    -52
-  5715     36
-  8137     -8
--19351    -21
- 24457     41
--21968    -49
- 12763     41
-   264    -21
--13148     -4
- 22069     27
--24471    -40
- 19761     42
- -9405    -31
- -3569     12
- 15474      9
--23022    -27
- 24213     36
--18828    -35
-  8421     25
-  4164     -9
--15590     -9
- 22915     23
--24331    -31
- 19581     31
- -9959    -23
- -2071     10
- 13528      5
--21656    -18
- 24575     26
--21691    -27
- 13778     22
- -2746    -12
- -8845      0
- 18385     11
--23802    -20
- 23986     23
--18997    -22
-  9993     15
-  1055     -7
--11817     -3
- 20092     11
--24257    -17
- 23560     19
--18234    -17
-  9405     12
-  1168     -5
--11451     -3
- 19535     10
--23978    -14
- 24050     16
--19828    -14
- 12146     11
- -2409     -5
- -7673      0
- 16392      6
--22327    -10
- 24568     12
--22832    -12
- 17484     11
- -9439     -7
-     0      3
-  9370      2
--17270     -5
- 22573      8
--24568     -9
- 23048     10
--18310     -8
- 11083      5
- -2409     -3
- -6518     -1
- 14518      3
--20579     -5
- 23978      7
--24357     -7
- 21744      7
--16532     -6
-  9405      3
- -1244     -1
- -6989     -1
- 14366      3
--20092     -4
- 23592      5
--24553     -5
- 22942      5
--18997     -4
- 13180      3
- -6117     -2
- -1469      1
-  8845      2
--15327     -2
- 20349      3
--23506     -4
- 24575      3
--23528     -4
- 20517      3
--15851     -2
-  9959      1
- -3345      0
- -3457      0
-  9924      1
--15590     -2
- 20071      2
--23087     -2
- 24481      3
--24213     -2
- 22359      2
--19092     -1
- 14670      1
- -9405      0
-  3643      0
-  2259      0
- -7959     -1
- 13148      1
--17563     -1
- 21001      1
--23323     -1
- 24457      1
--24395     -1
- 23189      1
--20942     -1
- 17799      1
--13934      0
-  9544      0
- -4831      0
-     0      0
-  4757      1
- -9265      0
- 13370      0
--16946     -1
- 19895      0
--22151     -1
- 23675      0
--24457     -1
- 24511      0
--23875      0
- 22602      0
--20762      0
- 18435      0
--15707      0
- 12667      0
- -9405      0
-  6008      0
- -2559      0
-  -867      0
-  4201      0
- -7386      0
- 10371      0
--13116      0
- 15590      0
--17773      0
- 19649      0
--21213      0
- 22467      0
--23416      0
- 24073      0
--24453      0
- 24575      0
--24461      0
- 24132      0
--23613      0
- 22929      0
--22102      0
- 21156      0
--20114      0
- 18997      0
--17825      0
- 16615      0
--15385      0
- 14151      0
--12924      0
- 11717      0
--10541      0
-  9405      0
- -8315      0
-  7278      0
- -6300      0
-  5384      0
- -4535      0
-  3755      0
- -3046      0
-  2409      0
- -1845      0
-  1356      0
-  -942      0
-   603      0
-  -339      0
-   151      0
-   -38      0
diff --git a/deps/libav/tests/ref/fate/indeo2 b/deps/libav/tests/ref/fate/indeo2
deleted file mode 100644
index 9f80f35..0000000
--- a/deps/libav/tests/ref/fate/indeo2
+++ /dev/null
@@ -1,131 +0,0 @@
-#tb 0: 66667/1000000
-0,          0,          0,        1,    21600, 0x57a2ba42
-0,          1,          1,        1,    21600, 0x61e09615
-0,          2,          2,        1,    21600, 0x826e4e63
-0,          3,          3,        1,    21600, 0x107716ec
-0,          4,          4,        1,    21600, 0xb35ce1f4
-0,          5,          5,        1,    21600, 0x12cab085
-0,          6,          6,        1,    21600, 0x2f917f69
-0,          7,          7,        1,    21600, 0x25aa3d6e
-0,          8,          8,        1,    21600, 0xab1bfbed
-0,          9,          9,        1,    21600, 0x9936dff9
-0,         10,         10,        1,    21600, 0xc23cd8e5
-0,         11,         11,        1,    21600, 0xa7ebbcaa
-0,         12,         12,        1,    21600, 0xd4dda045
-0,         13,         13,        1,    21600, 0xcbce6d7d
-0,         14,         14,        1,    21600, 0x3cf35baf
-0,         15,         15,        1,    21600, 0x16de6008
-0,         16,         16,        1,    21600, 0x49d41acf
-0,         17,         17,        1,    21600, 0x8c630034
-0,         18,         18,        1,    21600, 0x0b310296
-0,         19,         19,        1,    21600, 0x4887067d
-0,         20,         20,        1,    21600, 0x1219f29e
-0,         21,         21,        1,    21600, 0x3f3fc0c8
-0,         22,         22,        1,    21600, 0x1bd1d0fc
-0,         23,         23,        1,    21600, 0x913f9d4c
-0,         24,         24,        1,    21600, 0x69e9a6b4
-0,         25,         25,        1,    21600, 0xcc2e917f
-0,         26,         26,        1,    21600, 0xf6967e30
-0,         27,         27,        1,    21600, 0xdf816593
-0,         28,         28,        1,    21600, 0xfd945b75
-0,         29,         29,        1,    21600, 0x7d7e0224
-0,         30,         30,        1,    21600, 0x7246f584
-0,         31,         31,        1,    21600, 0x07b7ce82
-0,         32,         32,        1,    21600, 0xee16c291
-0,         33,         33,        1,    21600, 0xf4efb53a
-0,         34,         34,        1,    21600, 0x2e73a208
-0,         35,         35,        1,    21600, 0x1c2b6068
-0,         36,         36,        1,    21600, 0x004250de
-0,         37,         37,        1,    21600, 0x61d957d9
-0,         38,         38,        1,    21600, 0x8b5d2cb0
-0,         39,         39,        1,    21600, 0xc0a91fbc
-0,         40,         40,        1,    21600, 0xa38108fc
-0,         41,         41,        1,    21600, 0x551f03b9
-0,         42,         42,        1,    21600, 0x93def5ca
-0,         43,         43,        1,    21600, 0xe8ecf8bb
-0,         44,         44,        1,    21600, 0x4c04fbb0
-0,         45,         45,        1,    21600, 0x0e41dae4
-0,         46,         46,        1,    21600, 0xca9fb0df
-0,         47,         47,        1,    21600, 0xb123af19
-0,         48,         48,        1,    21600, 0xfd59be7a
-0,         49,         49,        1,    21600, 0x2c88b7a6
-0,         50,         50,        1,    21600, 0x64cc9a1f
-0,         51,         51,        1,    21600, 0x73d6a9ba
-0,         52,         52,        1,    21600, 0x79198a11
-0,         53,         53,        1,    21600, 0x0d4a8610
-0,         54,         54,        1,    21600, 0x352e71bc
-0,         55,         55,        1,    21600, 0x08aa627e
-0,         56,         56,        1,    21600, 0xbee36e45
-0,         57,         57,        1,    21600, 0x30de5c1b
-0,         58,         58,        1,    21600, 0x21d75484
-0,         59,         59,        1,    21600, 0xe0e91d52
-0,         60,         60,        1,    21600, 0x678c2ebb
-0,         61,         61,        1,    21600, 0x2080397b
-0,         62,         62,        1,    21600, 0x7dbc1333
-0,         63,         63,        1,    21600, 0x9c730ad0
-0,         64,         64,        1,    21600, 0x4da50f55
-0,         65,         65,        1,    21600, 0xdde5eaa7
-0,         66,         66,        1,    21600, 0x949ed4fa
-0,         67,         67,        1,    21600, 0x5d63bc54
-0,         68,         68,        1,    21600, 0xc5dcba4f
-0,         69,         69,        1,    21600, 0xd68caee1
-0,         70,         70,        1,    21600, 0xf7409fc9
-0,         71,         71,        1,    21600, 0x6b0ca3e5
-0,         72,         72,        1,    21600, 0xd133a108
-0,         73,         73,        1,    21600, 0xf2687b81
-0,         74,         74,        1,    21600, 0x6e94645d
-0,         75,         75,        1,    21600, 0xff7e7524
-0,         76,         76,        1,    21600, 0x8c7255dd
-0,         77,         77,        1,    21600, 0x84e979cf
-0,         78,         78,        1,    21600, 0xaa4e7127
-0,         79,         79,        1,    21600, 0x0b56708c
-0,         80,         80,        1,    21600, 0x38f086c4
-0,         81,         81,        1,    21600, 0x6a7086f6
-0,         82,         82,        1,    21600, 0x57a3619d
-0,         83,         83,        1,    21600, 0xee27639a
-0,         84,         84,        1,    21600, 0x754b7ec6
-0,         85,         85,        1,    21600, 0x2f7b428c
-0,         86,         86,        1,    21600, 0x0dc94603
-0,         87,         87,        1,    21600, 0xeede54d8
-0,         88,         88,        1,    21600, 0x587b4725
-0,         89,         89,        1,    21600, 0xe7c72c7a
-0,         90,         90,        1,    21600, 0x523949cb
-0,         91,         91,        1,    21600, 0xeade5385
-0,         92,         92,        1,    21600, 0x1a8f45c8
-0,         93,         93,        1,    21600, 0x814a393c
-0,         94,         94,        1,    21600, 0xe7b34887
-0,         95,         95,        1,    21600, 0x8eef3f5f
-0,         96,         96,        1,    21600, 0x56f12f08
-0,         97,         97,        1,    21600, 0xb2d02448
-0,         98,         98,        1,    21600, 0xb7d936db
-0,         99,         99,        1,    21600, 0x45f726ab
-0,        100,        100,        1,    21600, 0x6012404d
-0,        101,        101,        1,    21600, 0x273c254e
-0,        102,        102,        1,    21600, 0x38e82c19
-0,        103,        103,        1,    21600, 0x73653274
-0,        104,        104,        1,    21600, 0x2ff63b0c
-0,        105,        105,        1,    21600, 0x96d03611
-0,        106,        106,        1,    21600, 0xee8c29d7
-0,        107,        107,        1,    21600, 0xac043199
-0,        108,        108,        1,    21600, 0xd2c741a7
-0,        109,        109,        1,    21600, 0xdc7b2b81
-0,        110,        110,        1,    21600, 0x376f438f
-0,        111,        111,        1,    21600, 0x55442ff7
-0,        112,        112,        1,    21600, 0x653b1472
-0,        113,        113,        1,    21600, 0xc4293779
-0,        114,        114,        1,    21600, 0xc6553740
-0,        115,        115,        1,    21600, 0xcf441053
-0,        116,        116,        1,    21600, 0xb1531bce
-0,        117,        117,        1,    21600, 0x145323b3
-0,        118,        118,        1,    21600, 0x916c2e9e
-0,        119,        119,        1,    21600, 0xb89bfecc
-0,        120,        120,        1,    21600, 0x8e2415b9
-0,        121,        121,        1,    21600, 0x5af23021
-0,        122,        122,        1,    21600, 0x53e81c10
-0,        123,        123,        1,    21600, 0xf7f82a6f
-0,        124,        124,        1,    21600, 0x851121a2
-0,        125,        125,        1,    21600, 0xa8432bd2
-0,        126,        126,        1,    21600, 0x1a381799
-0,        127,        127,        1,    21600, 0xbb761384
-0,        128,        128,        1,    21600, 0xc8f328d5
-0,        129,        129,        1,    21600, 0xb3742e8a
diff --git a/deps/libav/tests/ref/fate/indeo3 b/deps/libav/tests/ref/fate/indeo3
deleted file mode 100644
index e294f70..0000000
--- a/deps/libav/tests/ref/fate/indeo3
+++ /dev/null
@@ -1,41 +0,0 @@
-#tb 0: 1/600
-0,          0,          0,        1,    21600, 0x845098fc
-0,         60,         60,        1,    21600, 0xc28e8bf0
-0,        120,        120,        1,    21600, 0x2f418fb4
-0,        180,        180,        1,    21600, 0x051d7a0e
-0,        240,        240,        1,    21600, 0x1b36aa7c
-0,        300,        300,        1,    21600, 0xb9e2ad38
-0,        360,        360,        1,    21600, 0x8dc99b60
-0,        420,        420,        1,    21600, 0xa3fa789a
-0,        480,        480,        1,    21600, 0x1fdbade2
-0,        540,        540,        1,    21600, 0x4f4ac164
-0,        600,        600,        1,    21600, 0x0ea5cb50
-0,        660,        660,        1,    21600, 0xfb659528
-0,        720,        720,        1,    21600, 0xac5790f8
-0,        780,        780,        1,    21600, 0x9762beb4
-0,        840,        840,        1,    21600, 0x29b0da0a
-0,        900,        900,        1,    21600, 0x6d88b0da
-0,        960,        960,        1,    21600, 0x687b8efa
-0,       1020,       1020,        1,    21600, 0xcd726220
-0,       1080,       1080,        1,    21600, 0xa1766598
-0,       1140,       1140,        1,    21600, 0xff4b8074
-0,       1200,       1200,        1,    21600, 0x845098fc
-0,       1260,       1260,        1,    21600, 0xdb259e08
-0,       1320,       1320,        1,    21600, 0xb6bda5a0
-0,       1380,       1380,        1,    21600, 0xbb998962
-0,       1440,       1440,        1,    21600, 0x28aa7b7c
-0,       1500,       1500,        1,    21600, 0x1ad1a15c
-0,       1560,       1560,        1,    21600, 0xb535a128
-0,       1620,       1620,        1,    21600, 0x4dbf968a
-0,       1680,       1680,        1,    21600, 0xfe90a8d6
-0,       1740,       1740,        1,    21600, 0xf63fabf0
-0,       1800,       1800,        1,    21600, 0xd6fabe58
-0,       1860,       1860,        1,    21600, 0x172eb09c
-0,       1920,       1920,        1,    21600, 0x44f8a8fe
-0,       1980,       1980,        1,    21600, 0x29429a06
-0,       2040,       2040,        1,    21600, 0xb12f8cc4
-0,       2100,       2100,        1,    21600, 0xd0c78cb4
-0,       2160,       2160,        1,    21600, 0x97e17e0c
-0,       2220,       2220,        1,    21600, 0xf8ac6700
-0,       2280,       2280,        1,    21600, 0xf9c17c94
-0,       2340,       2340,        1,    21600, 0xb10e8c54
diff --git a/deps/libav/tests/ref/fate/indeo3-2 b/deps/libav/tests/ref/fate/indeo3-2
deleted file mode 100644
index 702d06b..0000000
--- a/deps/libav/tests/ref/fate/indeo3-2
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 200/2997
-0,          0,          0,        1,    67680, 0x532a4c40
-0,         37,         37,        1,    67680, 0x63d2757a
-0,         38,         38,        1,    67680, 0xb1dcf7d3
-0,         39,         39,        1,    67680, 0x3225ee89
-0,         40,         40,        1,    67680, 0x9a102730
-0,         41,         41,        1,    67680, 0xf266888b
-0,         42,         42,        1,    67680, 0xd3b30d01
-0,         43,         43,        1,    67680, 0x7c647901
-0,         44,         44,        1,    67680, 0x0838e924
-0,         45,         45,        1,    67680, 0x2d470a56
-0,         46,         46,        1,    67680, 0x3eb99bda
-0,         47,         47,        1,    67680, 0x2b89e9f7
-0,         48,         48,        1,    67680, 0xcc006f93
-0,         49,         49,        1,    67680, 0x967b33e8
-0,         50,         50,        1,    67680, 0xcebbbfd3
-0,         51,         51,        1,    67680, 0x68365b83
-0,         52,         52,        1,    67680, 0xf1b0e536
-0,         53,         53,        1,    67680, 0x292ecc68
-0,         54,         54,        1,    67680, 0x83329d20
-0,         55,         55,        1,    67680, 0xe6ea8f5a
-0,         56,         56,        1,    67680, 0xcef27038
-0,         57,         57,        1,    67680, 0xa30445e4
-0,         58,         58,        1,    67680, 0x61aef9f5
-0,         59,         59,        1,    67680, 0x20abe80c
-0,         60,         60,        1,    67680, 0x7182a479
-0,         61,         61,        1,    67680, 0x56db4ec8
-0,         62,         62,        1,    67680, 0x08c1c3d4
-0,         63,         63,        1,    67680, 0x0d8879ed
-0,         64,         64,        1,    67680, 0x8e4eb9b9
-0,         65,         65,        1,    67680, 0x4629639e
-0,         66,         66,        1,    67680, 0x990bcd94
-0,         67,         67,        1,    67680, 0x2ae85671
-0,         68,         68,        1,    67680, 0xec296417
-0,         69,         69,        1,    67680, 0x41adf8da
-0,         70,         70,        1,    67680, 0xa035008f
-0,         71,         71,        1,    67680, 0xf8845e14
-0,         72,         72,        1,    67680, 0x802e52c4
-0,         73,         73,        1,    67680, 0xa2582b4a
-0,         74,         74,        1,    67680, 0x9ca567d7
-0,         75,         75,        1,    67680, 0x2ec69fac
-0,         76,         76,        1,    67680, 0x3a6d35ea
-0,         77,         77,        1,    67680, 0x9df7b7f6
-0,         78,         78,        1,    67680, 0x2d9dc502
-0,         79,         79,        1,    67680, 0x0ee16604
-0,         80,         80,        1,    67680, 0xb25d31a0
-0,         81,         81,        1,    67680, 0x52c04cb4
-0,         82,         82,        1,    67680, 0xd9ddec28
-0,         83,         83,        1,    67680, 0x1732f444
-0,         84,         84,        1,    67680, 0x19e01da5
-0,         85,         85,        1,    67680, 0x9af109df
-0,         86,         86,        1,    67680, 0xc59ba581
-0,         87,         87,        1,    67680, 0x8daaa58f
-0,         88,         88,        1,    67680, 0xd560a9ae
-0,         89,         89,        1,    67680, 0xe3fe77b4
-0,         90,         90,        1,    67680, 0x2a0e6c20
-0,         91,         91,        1,    67680, 0x9741f744
-0,         92,         92,        1,    67680, 0x8ec827dd
-0,         93,         93,        1,    67680, 0x7d90551f
-0,         94,         94,        1,    67680, 0x4d8f2665
-0,         95,         95,        1,    67680, 0x21e5a86e
-0,         96,         96,        1,    67680, 0x9ba3fe8f
-0,         97,         97,        1,    67680, 0xc84b7e41
-0,         98,         98,        1,    67680, 0x8da743e2
-0,         99,         99,        1,    67680, 0x49c4e00e
-0,        100,        100,        1,    67680, 0x90fc5dab
-0,        101,        101,        1,    67680, 0x9973a011
-0,        102,        102,        1,    67680, 0xfdd58648
-0,        103,        103,        1,    67680, 0xe181e329
-0,        104,        104,        1,    67680, 0xf60065c3
-0,        105,        105,        1,    67680, 0xde9bfc23
-0,        106,        106,        1,    67680, 0x37b9f867
-0,        107,        107,        1,    67680, 0x232ce0e9
-0,        108,        108,        1,    67680, 0x3fde091d
-0,        109,        109,        1,    67680, 0x3f00a465
-0,        110,        110,        1,    67680, 0x882b0042
-0,        111,        111,        1,    67680, 0x1bc3d626
-0,        112,        112,        1,    67680, 0xd15861a7
-0,        113,        113,        1,    67680, 0x056cd815
-0,        114,        114,        1,    67680, 0xe3fc887f
-0,        115,        115,        1,    67680, 0xdbddd03a
-0,        116,        116,        1,    67680, 0xfe6d865f
-0,        117,        117,        1,    67680, 0xbea7f202
-0,        118,        118,        1,    67680, 0x6d4114b9
-0,        119,        119,        1,    67680, 0x47bc93be
-0,        120,        120,        1,    67680, 0xb6136a41
-0,        121,        121,        1,    67680, 0xf0e63ecb
-0,        122,        122,        1,    67680, 0xb014b2a0
-0,        123,        123,        1,    67680, 0xf85a4be5
-0,        124,        124,        1,    67680, 0x21457c25
-0,        125,        125,        1,    67680, 0x75ae6bfb
-0,        126,        126,        1,    67680, 0x7ced988c
-0,        127,        127,        1,    67680, 0x3bf67347
-0,        128,        128,        1,    67680, 0x43e1ace5
-0,        129,        129,        1,    67680, 0xa23f8f45
-0,        130,        130,        1,    67680, 0x29d6cd9e
-0,        131,        131,        1,    67680, 0xad41bd94
-0,        132,        132,        1,    67680, 0x58e131c8
-0,        133,        133,        1,    67680, 0x617debea
-0,        134,        134,        1,    67680, 0x8a9db524
-0,        135,        135,        1,    67680, 0x17264d55
diff --git a/deps/libav/tests/ref/fate/indeo4 b/deps/libav/tests/ref/fate/indeo4
deleted file mode 100644
index 7f60461..0000000
--- a/deps/libav/tests/ref/fate/indeo4
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,    86400, 0x98f5e422
-0,          1,          1,        1,    86400, 0x1864cb06
-0,          2,          2,        1,    86400, 0xb09532ef
-0,          3,          3,        1,    86400, 0x3cd3dcdc
-0,          4,          4,        1,    86400, 0xe738847f
-0,          5,          5,        1,    86400, 0xc9b13afb
-0,          6,          6,        1,    86400, 0x5005d035
-0,          7,          7,        1,    86400, 0x22f63e17
-0,          8,          8,        1,    86400, 0x93391f02
-0,          9,          9,        1,    86400, 0x264830fd
-0,         10,         10,        1,    86400, 0x8fff9f5f
-0,         11,         11,        1,    86400, 0x524997fe
-0,         12,         12,        1,    86400, 0x54e330f9
-0,         13,         13,        1,    86400, 0x1d766a22
-0,         14,         14,        1,    86400, 0x683a70ac
-0,         15,         15,        1,    86400, 0x553b7b3d
-0,         16,         16,        1,    86400, 0x822c79bc
-0,         17,         17,        1,    86400, 0xe1087a1c
-0,         18,         18,        1,    86400, 0xff397595
-0,         19,         19,        1,    86400, 0x1b6b7717
-0,         20,         20,        1,    86400, 0x6c5275c1
-0,         21,         21,        1,    86400, 0x4e6a7189
-0,         22,         22,        1,    86400, 0x285c6eba
-0,         23,         23,        1,    86400, 0xce647227
-0,         24,         24,        1,    86400, 0xa0d07b1c
-0,         25,         25,        1,    86400, 0x5b567861
-0,         26,         26,        1,    86400, 0x105873ec
-0,         27,         27,        1,    86400, 0x59267fa0
-0,         28,         28,        1,    86400, 0xaeac839f
-0,         29,         29,        1,    86400, 0x2faf7402
-0,         30,         30,        1,    86400, 0xc8547a30
-0,         31,         31,        1,    86400, 0x3d357d49
-0,         32,         32,        1,    86400, 0x75db6d6c
-0,         33,         33,        1,    86400, 0x9fbf68e9
-0,         34,         34,        1,    86400, 0x56a64d26
-0,         35,         35,        1,    86400, 0xce9e1f43
-0,         36,         36,        1,    86400, 0xa4d7fddc
-0,         37,         37,        1,    86400, 0x3e20d77c
-0,         38,         38,        1,    86400, 0x4680661d
-0,         39,         39,        1,    86400, 0xf1b20af3
-0,         40,         40,        1,    86400, 0xb79d8045
-0,         41,         41,        1,    86400, 0x9479fc8a
-0,         42,         42,        1,    86400, 0x232965c3
-0,         43,         43,        1,    86400, 0xd18bca17
-0,         44,         44,        1,    86400, 0xb9064249
-0,         45,         45,        1,    86400, 0xcc48ab34
-0,         46,         46,        1,    86400, 0xe25018cd
-0,         47,         47,        1,    86400, 0x8da489ee
-0,         48,         48,        1,    86400, 0x90de0fc1
-0,         49,         49,        1,    86400, 0x2428dcee
-0,         50,         50,        1,    86400, 0x4316e1ae
-0,         51,         51,        1,    86400, 0x2b25e54c
-0,         52,         52,        1,    86400, 0x736ce020
-0,         53,         53,        1,    86400, 0x9a6be09a
-0,         54,         54,        1,    86400, 0x23bddbcd
-0,         55,         55,        1,    86400, 0x9368e465
-0,         56,         56,        1,    86400, 0x1ae9bb87
-0,         57,         57,        1,    86400, 0x4e591f32
-0,         58,         58,        1,    86400, 0xba1bf9dc
-0,         59,         59,        1,    86400, 0x07f0aa60
-0,         60,         60,        1,    86400, 0xf5a2cfa2
-0,         61,         61,        1,    86400, 0xcba5fc18
-0,         62,         62,        1,    86400, 0x858c0cfe
-0,         63,         63,        1,    86400, 0xac73ecd4
-0,         64,         64,        1,    86400, 0xf41bf03c
-0,         65,         65,        1,    86400, 0x928ed146
-0,         66,         66,        1,    86400, 0x9ff5990a
-0,         67,         67,        1,    86400, 0xc2fabc3d
-0,         68,         68,        1,    86400, 0x94af87a3
-0,         69,         69,        1,    86400, 0x9bae514c
-0,         70,         70,        1,    86400, 0xe0da267a
-0,         71,         71,        1,    86400, 0x1d40f55c
-0,         72,         72,        1,    86400, 0xe6173b68
-0,         73,         73,        1,    86400, 0x1445490d
-0,         74,         74,        1,    86400, 0x8d8753c1
-0,         75,         75,        1,    86400, 0xe5a7779d
-0,         76,         76,        1,    86400, 0x3cfc66ef
-0,         77,         77,        1,    86400, 0xa5d45608
-0,         78,         78,        1,    86400, 0x62f17be1
-0,         79,         79,        1,    86400, 0xa64c84d3
-0,         80,         80,        1,    86400, 0xf98162f0
-0,         81,         81,        1,    86400, 0x0db77d9f
-0,         82,         82,        1,    86400, 0x0f0cbac9
-0,         83,         83,        1,    86400, 0xb9934e97
-0,         84,         84,        1,    86400, 0x7f8fa248
-0,         85,         85,        1,    86400, 0xdfd96768
-0,         86,         86,        1,    86400, 0x81b07919
-0,         87,         87,        1,    86400, 0x66c11e9f
-0,         88,         88,        1,    86400, 0xd86eb114
-0,         89,         89,        1,    86400, 0x67f20c1f
-0,         90,         90,        1,    86400, 0x66915de5
-0,         91,         91,        1,    86400, 0x2b8aa76f
-0,         92,         92,        1,    86400, 0x85b5a3d2
-0,         93,         93,        1,    86400, 0x80d29ed6
-0,         94,         94,        1,    86400, 0x4d508e2c
-0,         95,         95,        1,    86400, 0x0d407374
-0,         96,         96,        1,    86400, 0xd4068016
-0,         97,         97,        1,    86400, 0x6ffab98f
-0,         98,         98,        1,    86400, 0x2360903d
-0,         99,         99,        1,    86400, 0x470e04a0
diff --git a/deps/libav/tests/ref/fate/indeo5 b/deps/libav/tests/ref/fate/indeo5
deleted file mode 100644
index 3f0adfb..0000000
--- a/deps/libav/tests/ref/fate/indeo5
+++ /dev/null
@@ -1,135 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,    48600, 0x72d4193b
-0,          1,          1,        1,    48600, 0x72d4193b
-0,          2,          2,        1,    48600, 0x36abd6f3
-0,          3,          3,        1,    48600, 0x99e582f7
-0,          4,          4,        1,    48600, 0xa4cb6fb7
-0,          5,          5,        1,    48600, 0xf9b5657b
-0,          6,          6,        1,    48600, 0xb7d666a4
-0,          7,          7,        1,    48600, 0xb7345308
-0,          8,          8,        1,    48600, 0x4f5339b9
-0,          9,          9,        1,    48600, 0x1a9a02c7
-0,         10,         10,        1,    48600, 0x4ed40866
-0,         11,         11,        1,    48600, 0x635bf2af
-0,         12,         12,        1,    48600, 0x12c02f49
-0,         13,         13,        1,    48600, 0xc548a36d
-0,         14,         14,        1,    48600, 0x9d9ffbf0
-0,         15,         15,        1,    48600, 0x4f9dba66
-0,         16,         16,        1,    48600, 0x2332b0e4
-0,         17,         17,        1,    48600, 0x6c64342d
-0,         18,         18,        1,    48600, 0x81156d54
-0,         19,         19,        1,    48600, 0x8bfb9f04
-0,         20,         20,        1,    48600, 0xd6bc38db
-0,         21,         21,        1,    48600, 0x64de39d7
-0,         22,         22,        1,    48600, 0xbddb3c37
-0,         23,         23,        1,    48600, 0x15b75a31
-0,         24,         24,        1,    48600, 0xa2dd7bdf
-0,         25,         25,        1,    48600, 0xe4fb9b25
-0,         26,         26,        1,    48600, 0xf2788234
-0,         27,         27,        1,    48600, 0xa481a3d0
-0,         28,         28,        1,    48600, 0x6087c790
-0,         29,         29,        1,    48600, 0xf1dacfa1
-0,         30,         30,        1,    48600, 0xe29e2e78
-0,         31,         31,        1,    48600, 0x505b2db1
-0,         32,         32,        1,    48600, 0x7bc56b02
-0,         33,         33,        1,    48600, 0x3f7640de
-0,         34,         34,        1,    48600, 0xd21a3f0b
-0,         35,         35,        1,    48600, 0x92dc9b72
-0,         36,         36,        1,    48600, 0x26e6804e
-0,         37,         37,        1,    48600, 0xc3867fdc
-0,         38,         38,        1,    48600, 0xe135c689
-0,         39,         39,        1,    48600, 0xf0fda68b
-0,         40,         40,        1,    48600, 0x7e07a430
-0,         41,         41,        1,    48600, 0xb0809c56
-0,         42,         42,        1,    48600, 0xd3f3d4b0
-0,         43,         43,        1,    48600, 0x068ce7b9
-0,         44,         44,        1,    48600, 0x3ae5ebb7
-0,         45,         45,        1,    48600, 0x2274d1d8
-0,         46,         46,        1,    48600, 0x9a2b95b7
-0,         47,         47,        1,    48600, 0xe864dc3d
-0,         48,         48,        1,    48600, 0xdf39d4db
-0,         49,         49,        1,    48600, 0x5155c707
-0,         50,         50,        1,    48600, 0xa26e9879
-0,         51,         51,        1,    48600, 0x91b5747c
-0,         52,         52,        1,    48600, 0xe7925589
-0,         53,         53,        1,    48600, 0x582f1cb2
-0,         54,         54,        1,    48600, 0x13180bdb
-0,         55,         55,        1,    48600, 0x1623d914
-0,         56,         56,        1,    48600, 0xfeeea068
-0,         57,         57,        1,    48600, 0x61f8679c
-0,         58,         58,        1,    48600, 0xcb678447
-0,         59,         59,        1,    48600, 0xd0028749
-0,         60,         60,        1,    48600, 0xec116a9c
-0,         61,         61,        1,    48600, 0x16926417
-0,         62,         62,        1,    48600, 0x342c6014
-0,         63,         63,        1,    48600, 0xb81a3ec3
-0,         64,         64,        1,    48600, 0xfd0d4654
-0,         65,         65,        1,    48600, 0x741cc27a
-0,         66,         66,        1,    48600, 0x2c53a9fe
-0,         67,         67,        1,    48600, 0x795dc493
-0,         68,         68,        1,    48600, 0x46eebc82
-0,         69,         69,        1,    48600, 0xa2b7b84b
-0,         70,         70,        1,    48600, 0x2274c95e
-0,         71,         71,        1,    48600, 0x0ba5ac69
-0,         72,         72,        1,    48600, 0x8335eb20
-0,         73,         73,        1,    48600, 0xca80ef55
-0,         74,         74,        1,    48600, 0xbb7cec8a
-0,         75,         75,        1,    48600, 0x775bdde2
-0,         76,         76,        1,    48600, 0x68a5a673
-0,         77,         77,        1,    48600, 0x091ccca2
-0,         78,         78,        1,    48600, 0xced6d065
-0,         79,         79,        1,    48600, 0xed7fca50
-0,         80,         80,        1,    48600, 0x5c77be3f
-0,         81,         81,        1,    48600, 0x84719fe6
-0,         82,         82,        1,    48600, 0x571cc076
-0,         83,         83,        1,    48600, 0xa3b5be2a
-0,         84,         84,        1,    48600, 0x0218bc6f
-0,         85,         85,        1,    48600, 0x5ec1fa4c
-0,         86,         86,        1,    48600, 0xcd3035fa
-0,         87,         87,        1,    48600, 0xb8d2a741
-0,         88,         88,        1,    48600, 0x6d39847c
-0,         89,         89,        1,    48600, 0x0ffefc73
-0,         90,         90,        1,    48600, 0x2bb74b68
-0,         91,         91,        1,    48600, 0xf541d49f
-0,         92,         92,        1,    48600, 0x6f7c9066
-0,         93,         93,        1,    48600, 0x70d58548
-0,         94,         94,        1,    48600, 0x92d38b55
-0,         95,         95,        1,    48600, 0x5f4bdaa6
-0,         96,         96,        1,    48600, 0x43868008
-0,         97,         97,        1,    48600, 0xddb8e551
-0,         98,         98,        1,    48600, 0xcd0cbd5f
-0,         99,         99,        1,    48600, 0xf97e6bbd
-0,        100,        100,        1,    48600, 0x5f1b31eb
-0,        101,        101,        1,    48600, 0x10ff924d
-0,        102,        102,        1,    48600, 0xcc31ca3f
-0,        103,        103,        1,    48600, 0x5f27f9ff
-0,        104,        104,        1,    48600, 0xd6fe4b71
-0,        105,        105,        1,    48600, 0xa7d3b2c4
-0,        106,        106,        1,    48600, 0x9992d6c7
-0,        107,        107,        1,    48600, 0xd283089b
-0,        108,        108,        1,    48600, 0x6ab52ede
-0,        109,        109,        1,    48600, 0x495b1bad
-0,        110,        110,        1,    48600, 0x3a4d1b72
-0,        111,        111,        1,    48600, 0xdb421ba3
-0,        112,        112,        1,    48600, 0x8ad11baa
-0,        113,        113,        1,    48600, 0x17701bcc
-0,        114,        114,        1,    48600, 0x4b771b6a
-0,        115,        115,        1,    48600, 0x5345067e
-0,        116,        116,        1,    48600, 0x2cd403a7
-0,        117,        117,        1,    48600, 0x2cc5fd60
-0,        118,        118,        1,    48600, 0xfa9cf1d4
-0,        119,        119,        1,    48600, 0x8498e2d6
-0,        120,        120,        1,    48600, 0x93dcc863
-0,        121,        121,        1,    48600, 0xd46ac5d5
-0,        122,        122,        1,    48600, 0x34e8c01b
-0,        123,        123,        1,    48600, 0x4ad3b246
-0,        124,        124,        1,    48600, 0x9848a6ca
-0,        125,        125,        1,    48600, 0x7b7e8bee
-0,        126,        126,        1,    48600, 0xaee0896b
-0,        127,        127,        1,    48600, 0x263a812c
-0,        128,        128,        1,    48600, 0x5d7b7782
-0,        129,        129,        1,    48600, 0x3a2b6ad2
-0,        130,        130,        1,    48600, 0xcf2a4ef3
-0,        131,        131,        1,    48600, 0xc0134c9b
-0,        132,        132,        1,    48600, 0x93c342d2
-0,        133,        133,        1,    48600, 0x8d90393c
diff --git a/deps/libav/tests/ref/fate/interplay-mve-16bit b/deps/libav/tests/ref/fate/interplay-mve-16bit
deleted file mode 100644
index 2469aaa..0000000
--- a/deps/libav/tests/ref/fate/interplay-mve-16bit
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/1000000
-0,          0,          0,        0,   614400, 0x00000000
-0,      33360,      33360,        0,   614400, 0x00000000
-0,      66720,      66720,        0,   614400, 0xa17ea4ec
-0,     100080,     100080,        0,   614400, 0x4fd207fb
-0,     133440,     133440,        0,   614400, 0xd7a510fb
-0,     166800,     166800,        0,   614400, 0xe901e2f4
-0,     200160,     200160,        0,   614400, 0x4ac5d3c4
-0,     233520,     233520,        0,   614400, 0x32e3e99c
-0,     266880,     266880,        0,   614400, 0x7a2ff20c
-0,     300240,     300240,        0,   614400, 0x59941193
-0,     333600,     333600,        0,   614400, 0x92773a2b
-0,     366960,     366960,        0,   614400, 0x4cd14313
-0,     400320,     400320,        0,   614400, 0x2a093fa3
-0,     433680,     433680,        0,   614400, 0xf68b8463
-0,     467040,     467040,        0,   614400, 0xa9e1969b
-0,     500400,     500400,        0,   614400, 0x461996bb
-0,     533760,     533760,        0,   614400, 0xae58d053
-0,     567120,     567120,        0,   614400, 0x7693015a
-0,     600480,     600480,        0,   614400, 0x0b3507fa
-0,     633840,     633840,        0,   614400, 0xff5c2492
-0,     667200,     667200,        0,   614400, 0x636e3e32
-0,     700560,     700560,        0,   614400, 0x1acd6d0a
-0,     733920,     733920,        0,   614400, 0x67039232
-0,     767280,     767280,        0,   614400, 0x8ab9c75a
-0,     800640,     800640,        0,   614400, 0xe824bbe2
-0,     834000,     834000,        0,   614400, 0x5133e9ea
-0,     867360,     867360,        0,   614400, 0xcecf1249
-0,     900720,     900720,        0,   614400, 0xe6d928c1
-0,     934080,     934080,        0,   614400, 0x8da46ff1
-0,     967440,     967440,        0,   614400, 0x1c778319
-0,    1000800,    1000800,        0,   614400, 0x35a19451
-0,    1034160,    1034160,        0,   614400, 0x5145d1b9
-0,    1067520,    1067520,        0,   614400, 0x146ee231
-0,    1100880,    1100880,        0,   614400, 0xd9b33380
-0,    1134240,    1134240,        0,   614400, 0x8b112ef8
-0,    1167600,    1167600,        0,   614400, 0xb9e79ab0
-0,    1200960,    1200960,        0,   614400, 0x62d3a498
-0,    1234320,    1234320,        0,   614400, 0xaeaaaa58
-0,    1267680,    1267680,        0,   614400, 0x8922c440
-0,    1301040,    1301040,        0,   614400, 0xd62ef758
-0,    1334400,    1334400,        0,   614400, 0x2a53149f
-0,    1367760,    1367760,        0,   614400, 0x13da47df
-0,    1401120,    1401120,        0,   614400, 0x27c05c3f
-0,    1434480,    1434480,        0,   614400, 0x41ff7ca7
-0,    1467840,    1467840,        0,   614400, 0x6b0e8a07
-0,    1501200,    1501200,        0,   614400, 0xa200ad9f
-0,    1534560,    1534560,        0,   614400, 0x9da7cc77
-0,    1567920,    1567920,        0,   614400, 0x2f5703be
-0,    1601280,    1601280,        0,   614400, 0x91c720f6
-0,    1634640,    1634640,        0,   614400, 0x927a882e
diff --git a/deps/libav/tests/ref/fate/interplay-mve-8bit b/deps/libav/tests/ref/fate/interplay-mve-8bit
deleted file mode 100644
index abd86eb..0000000
--- a/deps/libav/tests/ref/fate/interplay-mve-8bit
+++ /dev/null
@@ -1,111 +0,0 @@
-#tb 0: 1/1000000
-0,          0,          0,        0,   414720, 0xa5cd50ca
-0,      66728,      66728,        0,   414720, 0x3facd321
-0,     133456,     133456,        0,   414720, 0x849e6d4b
-0,     200184,     200184,        0,   414720, 0xe649363f
-0,     266912,     266912,        0,   414720, 0x5bbd7b14
-0,     333640,     333640,        0,   414720, 0xe246ab51
-0,     400368,     400368,        0,   414720, 0x5721b22e
-0,     467096,     467096,        0,   414720, 0xe391e107
-0,     533824,     533824,        0,   414720, 0x04d851ff
-0,     600552,     600552,        0,   414720, 0x8d80d580
-0,     667280,     667280,        0,   414720, 0x5a24b0bc
-0,     734008,     734008,        0,   414720, 0x06cd6960
-0,     800736,     800736,        0,   414720, 0xf5ca48b4
-0,     867464,     867464,        0,   414720, 0x24700f94
-0,     934192,     934192,        0,   414720, 0xb0bfe451
-0,    1000920,    1000920,        0,   414720, 0x00e9f3d1
-0,    1067648,    1067648,        0,   414720, 0x0efbffd1
-0,    1134376,    1134376,        0,   414720, 0x2ecdfc8d
-0,    1201104,    1201104,        0,   414720, 0x94b531fc
-0,    1267832,    1267832,        0,   414720, 0x2c2579f8
-0,    1334560,    1334560,        0,   414720, 0x6c7ecfb8
-0,    1401288,    1401288,        0,   414720, 0x08982527
-0,    1468016,    1468016,        0,   414720, 0x5c0161b3
-0,    1534744,    1534744,        0,   414720, 0x453ce413
-0,    1601472,    1601472,        0,   414720, 0x634e36b2
-0,    1668200,    1668200,        0,   414720, 0x401a683a
-0,    1734928,    1734928,        0,   414720, 0x3c5f442e
-0,    1801656,    1801656,        0,   414720, 0x075ef787
-0,    1868384,    1868384,        0,   414720, 0x8501a04f
-0,    1935112,    1935112,        0,   414720, 0x3620093b
-0,    2001840,    2001840,        0,   414720, 0xa42d9480
-0,    2068568,    2068568,        0,   414720, 0x09b150b4
-0,    2135296,    2135296,        0,   414720, 0xcad407f0
-0,    2202024,    2202024,        0,   414720, 0x69e5eecd
-0,    2268752,    2268752,        0,   414720, 0xb92ad2d9
-0,    2335480,    2335480,        0,   414720, 0xc78eaf29
-0,    2402208,    2402208,        0,   414720, 0x47c3fa91
-0,    2468936,    2468936,        0,   414720, 0x8847b7b8
-0,    2535664,    2535664,        0,   414720, 0x864cab2f
-0,    2602392,    2602392,        0,   414720, 0x78d653e2
-0,    2669120,    2669120,        0,   414720, 0xda15cbd2
-0,    2735848,    2735848,        0,   414720, 0xdf9ce28a
-0,    2802576,    2802576,        0,   414720, 0xe88c49ca
-0,    2869304,    2869304,        0,   414720, 0xd6bcbc07
-0,    2936032,    2936032,        0,   414720, 0xf0b4a7bf
-0,    3002760,    3002760,        0,   414720, 0x74f9bfbf
-0,    3069488,    3069488,        0,   414720, 0x904ce103
-0,    3136216,    3136216,        0,   414720, 0xca877e4a
-0,    3202944,    3202944,        0,   414720, 0x588effd6
-0,    3269672,    3269672,        0,   414720, 0x6dff8b71
-0,    3336400,    3336400,        0,   414720, 0xbeaae788
-0,    3403128,    3403128,        0,   414720, 0x1a4d1242
-0,    3469856,    3469856,        0,   414720, 0x4ae98ea0
-0,    3536584,    3536584,        0,   414720, 0x41ed6d22
-0,    3603312,    3603312,        0,   414720, 0x486e70aa
-0,    3670040,    3670040,        0,   414720, 0xfddc103e
-0,    3736768,    3736768,        0,   414720, 0x8620f03e
-0,    3803496,    3803496,        0,   414720, 0x0e4ec273
-0,    3870224,    3870224,        0,   414720, 0xb2298b3e
-0,    3936952,    3936952,        0,   414720, 0xb4f50176
-0,    4003680,    4003680,        0,   414720, 0xb9c7a495
-0,    4070408,    4070408,        0,   414720, 0xed270702
-0,    4137136,    4137136,        0,   414720, 0x98b72586
-0,    4203864,    4203864,        0,   414720, 0xd8977cb1
-0,    4270592,    4270592,        0,   414720, 0xff3d3851
-0,    4337320,    4337320,        0,   414720, 0x7e4f0424
-0,    4404048,    4404048,        0,   414720, 0xa9e75006
-0,    4470776,    4470776,        0,   414720, 0x8f98cba9
-0,    4537504,    4537504,        0,   414720, 0x25ecd620
-0,    4604232,    4604232,        0,   414720, 0x78cf5c58
-0,    4670960,    4670960,        0,   414720, 0x3fb4b81a
-0,    4737688,    4737688,        0,   414720, 0xd7b655fa
-0,    4804416,    4804416,        0,   414720, 0xd9158db3
-0,    4871144,    4871144,        0,   414720, 0x2e651852
-0,    4937872,    4937872,        0,   414720, 0x9f9adb64
-0,    5004600,    5004600,        0,   414720, 0xe9d16e81
-0,    5071328,    5071328,        0,   414720, 0xbe73daf5
-0,    5138056,    5138056,        0,   414720, 0x3d164329
-0,    5204784,    5204784,        0,   414720, 0x1d5a9bc8
-0,    5271512,    5271512,        0,   414720, 0x8e8debbe
-0,    5338240,    5338240,        0,   414720, 0x4e7a2bf0
-0,    5404968,    5404968,        0,   414720, 0x4a13804d
-0,    5471696,    5471696,        0,   414720, 0x5dd188d8
-0,    5538424,    5538424,        0,   414720, 0xbe7f4963
-0,    5605152,    5605152,        0,   414720, 0xcff3b767
-0,    5671880,    5671880,        0,   414720, 0xbbd3afa0
-0,    5738608,    5738608,        0,   414720, 0xaf9dec62
-0,    5805336,    5805336,        0,   414720, 0xc74816a1
-0,    5872064,    5872064,        0,   414720, 0x51488bfc
-0,    5938792,    5938792,        0,   414720, 0x68c10a2c
-0,    6005520,    6005520,        0,   414720, 0x10179c4e
-0,    6072248,    6072248,        0,   414720, 0x18d559b7
-0,    6138976,    6138976,        0,   414720, 0x8257aa55
-0,    6205704,    6205704,        0,   414720, 0x9ea24501
-0,    6272432,    6272432,        0,   414720, 0x238605cc
-0,    6339160,    6339160,        0,   414720, 0xb552deaa
-0,    6405888,    6405888,        0,   414720, 0x07c3348d
-0,    6472616,    6472616,        0,   414720, 0x82f4f9b0
-0,    6539344,    6539344,        0,   414720, 0xf5d76bc5
-0,    6606072,    6606072,        0,   414720, 0x34b3a1e6
-0,    6672800,    6672800,        0,   414720, 0xda25e11b
-0,    6739528,    6739528,        0,   414720, 0x2b19936b
-0,    6806256,    6806256,        0,   414720, 0xe91f9f73
-0,    6872984,    6872984,        0,   414720, 0x48d09aab
-0,    6939712,    6939712,        0,   414720, 0xac42bf83
-0,    7006440,    7006440,        0,   414720, 0x2d8ca14e
-0,    7073168,    7073168,        0,   414720, 0xe65462fd
-0,    7139896,    7139896,        0,   414720, 0xe5bfc929
-0,    7206624,    7206624,        0,   414720, 0x66784c58
-0,    7273352,    7273352,        0,   414720, 0x70dbeca8
diff --git a/deps/libav/tests/ref/fate/iv8-demux b/deps/libav/tests/ref/fate/iv8-demux
deleted file mode 100644
index 56a54a1..0000000
--- a/deps/libav/tests/ref/fate/iv8-demux
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,        0,    20883, 0x347191e2
-0,          0,       3600,        0,    20882, 0xe1573905
-0,       3600,       7200,        0,    20894, 0xd54f516a
-0,       7200,      10800,        0,    20891, 0x1b5c5039
-0,      10800,      14400,        0,    20883, 0x8e785b4d
-0,      14400,      18000,        0,    20870, 0xd26ca1f6
-0,      18000,      21600,        0,    21448, 0x946f5b2b
-0,      21600,      25200,        0,    21433, 0xb18687c5
-0,      25200,      28800,        0,    20865, 0xc0eb3fce
-0,      28800,      32399,        0,    20842, 0x9d0728ba
-0,      32399,      35999,        0,    20878, 0xf60f5dee
-0,      35999,      39600,        0,    20866, 0x3bde568f
-0,      39600,      43200,        0,    20884, 0x22736993
-0,      43200,      46800,        0,    20860, 0xf56f2fca
-0,      46800,      50400,        0,    20872, 0xf39e3cb3
-0,      50400,      53999,        0,    20835, 0xa3c4363b
-0,      53999,      57600,        0,    20905, 0x552853d1
-0,      57600,      61200,        0,    20874, 0xed0b91ec
-0,      61200,      64799,        0,    20877, 0xe1623e01
-0,      64799,      68399,        0,    20933, 0x19906564
-0,      68399,      72000,     3600,    20891, 0x3d064fd3
-0,      72000,      75600,     3600,    20834, 0xcb774dbc
-0,      75600,      79200,     3600,    20870, 0xbc536589
-0,      79200,      82800,     3600,    21421, 0xc99a68e4
-0,      82800,      86400,     3600,    12869, 0x5684e304
diff --git a/deps/libav/tests/ref/fate/jpeg2000-dcinema b/deps/libav/tests/ref/fate/jpeg2000-dcinema
deleted file mode 100644
index 940759a..0000000
--- a/deps/libav/tests/ref/fate/jpeg2000-dcinema
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/24
-0,          0,          0,        1, 12441600, 0xf0de508b
-0,          1,          1,        1, 12441600, 0x8e50c249
diff --git a/deps/libav/tests/ref/fate/jv b/deps/libav/tests/ref/fate/jv
deleted file mode 100644
index 0d5102d..0000000
--- a/deps/libav/tests/ref/fate/jv
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 2/25
-0,          0,          0,        1,   192000, 0x00000000
-0,          2,          2,        1,   192000, 0x95ece4ea
-0,          3,          3,        1,   192000, 0x9abaf682
-0,          4,          4,        1,   192000, 0x9a93fed6
-0,          5,          5,        1,   192000, 0x112dfade
-0,          6,          6,        1,   192000, 0xb8f3e986
-0,          7,          7,        1,   192000, 0x21daea8e
-0,          8,          8,        1,   192000, 0x5dc1032d
diff --git a/deps/libav/tests/ref/fate/kgv1 b/deps/libav/tests/ref/fate/kgv1
deleted file mode 100644
index 6f35893..0000000
--- a/deps/libav/tests/ref/fate/kgv1
+++ /dev/null
@@ -1,314 +0,0 @@
-#tb 0: 1/60
-0,          0,          0,        1,   153600, 0x00000000
-0,          1,          1,        1,   153600, 0x00000000
-0,          2,          2,        1,   153600, 0x00000000
-0,          3,          3,        1,   153600, 0x00000000
-0,          4,          4,        1,   153600, 0x00000000
-0,          5,          5,        1,   153600, 0x00000000
-0,          6,          6,        1,   153600, 0x00000000
-0,          7,          7,        1,   153600, 0x00000000
-0,          8,          8,        1,   153600, 0x00000000
-0,          9,          9,        1,   153600, 0x00000000
-0,         10,         10,        1,   153600, 0x00000000
-0,         11,         11,        1,   153600, 0x00000000
-0,         12,         12,        1,   153600, 0x00000000
-0,         13,         13,        1,   153600, 0x00000000
-0,         14,         14,        1,   153600, 0x00000000
-0,         15,         15,        1,   153600, 0x00000000
-0,         16,         16,        1,   153600, 0x00000000
-0,         17,         17,        1,   153600, 0x00000000
-0,         18,         18,        1,   153600, 0x00000000
-0,         19,         19,        1,   153600, 0x00000000
-0,         20,         20,        1,   153600, 0x00000000
-0,         21,         21,        1,   153600, 0x00000000
-0,         22,         22,        1,   153600, 0x00000000
-0,         23,         23,        1,   153600, 0x00000000
-0,         24,         24,        1,   153600, 0x00000000
-0,         25,         25,        1,   153600, 0x00000000
-0,         26,         26,        1,   153600, 0x00000000
-0,         27,         27,        1,   153600, 0x00000000
-0,         28,         28,        1,   153600, 0x00000000
-0,         29,         29,        1,   153600, 0x00000000
-0,         30,         30,        1,   153600, 0x00000000
-0,         31,         31,        1,   153600, 0x00000000
-0,         32,         32,        1,   153600, 0x00000000
-0,         33,         33,        1,   153600, 0x00000000
-0,         34,         34,        1,   153600, 0x00000000
-0,         35,         35,        1,   153600, 0x00000000
-0,         36,         36,        1,   153600, 0x00000000
-0,         37,         37,        1,   153600, 0x00000000
-0,         38,         38,        1,   153600, 0x00000000
-0,         39,         39,        1,   153600, 0x00000000
-0,         40,         40,        1,   153600, 0x00000000
-0,         41,         41,        1,   153600, 0x00000000
-0,         42,         42,        1,   153600, 0x00000000
-0,         43,         43,        1,   153600, 0x00000000
-0,         44,         44,        1,   153600, 0x00000000
-0,         45,         45,        1,   153600, 0x00000000
-0,         46,         46,        1,   153600, 0x00000000
-0,         47,         47,        1,   153600, 0xab738fc1
-0,         48,         48,        1,   153600, 0x520c9bd3
-0,         49,         49,        1,   153600, 0x19347233
-0,         50,         50,        1,   153600, 0x9e81fe64
-0,         51,         51,        1,   153600, 0x75be7504
-0,         52,         52,        1,   153600, 0x29374d04
-0,         53,         53,        1,   153600, 0xc6b92fd4
-0,         54,         54,        1,   153600, 0xeeec5124
-0,         55,         55,        1,   153600, 0x2fc36324
-0,         56,         56,        1,   153600, 0x112580f4
-0,         57,         57,        1,   153600, 0x177b9a84
-0,         58,         58,        1,   153600, 0x214abb44
-0,         59,         59,        1,   153600, 0x83580173
-0,         60,         60,        1,   153600, 0x95f49284
-0,         61,         61,        1,   153600, 0xe31c5984
-0,         62,         62,        1,   153600, 0xf1756984
-0,         63,         63,        1,   153600, 0x6c004804
-0,         64,         64,        1,   153600, 0xbe6631b4
-0,         65,         65,        1,   153600, 0x1d910494
-0,         66,         66,        1,   153600, 0xd8ecfc25
-0,         67,         67,        1,   153600, 0xdd281364
-0,         68,         68,        1,   153600, 0x52545084
-0,         69,         69,        1,   153600, 0xfed6b944
-0,         70,         70,        1,   153600, 0x6e0b7ee4
-0,         71,         71,        1,   153600, 0x516a5724
-0,         72,         72,        1,   153600, 0xaffd7844
-0,         73,         73,        1,   153600, 0x5a304ba4
-0,         74,         74,        1,   153600, 0xea365ce4
-0,         75,         75,        1,   153600, 0xef654a84
-0,         76,         76,        1,   153600, 0x32d14584
-0,         77,         77,        1,   153600, 0x6bf843e4
-0,         78,         78,        1,   153600, 0x023d5b94
-0,         79,         79,        1,   153600, 0xd4506154
-0,         80,         80,        1,   153600, 0xeaf0bd24
-0,         81,         81,        1,   153600, 0x426efb94
-0,         82,         82,        1,   153600, 0x98bcde64
-0,         83,         83,        1,   153600, 0xa1bbb4a4
-0,         84,         84,        1,   153600, 0x36688414
-0,         85,         85,        1,   153600, 0x2e4b75d4
-0,         86,         86,        1,   153600, 0x33885884
-0,         87,         87,        1,   153600, 0x6c065224
-0,         88,         88,        1,   153600, 0x1a0252b4
-0,         89,         89,        1,   153600, 0x55896084
-0,         90,         90,        1,   153600, 0xb9df7a04
-0,         91,         91,        1,   153600, 0x6f8a9734
-0,         92,         92,        1,   153600, 0xa3d3dbb4
-0,         93,         93,        1,   153600, 0x907a2483
-0,         94,         94,        1,   153600, 0xf4816ad3
-0,         95,         95,        1,   153600, 0x4e9195e3
-0,         96,         96,        1,   153600, 0xf486a373
-0,         97,         97,        1,   153600, 0x8f6aa693
-0,         98,         98,        1,   153600, 0x8f6aa693
-0,         99,         99,        1,   153600, 0x8f6aa693
-0,        100,        100,        1,   153600, 0x8f6aa693
-0,        101,        101,        1,   153600, 0x8f6aa693
-0,        102,        102,        1,   153600, 0x8f6aa693
-0,        103,        103,        1,   153600, 0x17d9c117
-0,        104,        104,        1,   153600, 0x17d9c117
-0,        105,        105,        1,   153600, 0x17d9c117
-0,        106,        106,        1,   153600, 0x17d9c117
-0,        107,        107,        1,   153600, 0x17d9c117
-0,        108,        108,        1,   153600, 0x7a47386f
-0,        109,        109,        1,   153600, 0x7a47386f
-0,        110,        110,        1,   153600, 0x7a47386f
-0,        111,        111,        1,   153600, 0x7a47386f
-0,        112,        112,        1,   153600, 0x7a47386f
-0,        113,        113,        1,   153600, 0x829dccaa
-0,        114,        114,        1,   153600, 0x829dccaa
-0,        115,        115,        1,   153600, 0x829dccaa
-0,        116,        116,        1,   153600, 0x829dccaa
-0,        117,        117,        1,   153600, 0x829dccaa
-0,        118,        118,        1,   153600, 0x2d58ab4a
-0,        119,        119,        1,   153600, 0x2d58ab4a
-0,        120,        120,        1,   153600, 0x2d58ab4a
-0,        121,        121,        1,   153600, 0x2d58ab4a
-0,        122,        122,        1,   153600, 0x2d58ab4a
-0,        123,        123,        1,   153600, 0x2d58ab4a
-0,        124,        124,        1,   153600, 0x2d58ab4a
-0,        125,        125,        1,   153600, 0x2d58ab4a
-0,        126,        126,        1,   153600, 0x2d58ab4a
-0,        127,        127,        1,   153600, 0x2d58ab4a
-0,        128,        128,        1,   153600, 0x2d58ab4a
-0,        129,        129,        1,   153600, 0x2d58ab4a
-0,        130,        130,        1,   153600, 0x2d58ab4a
-0,        131,        131,        1,   153600, 0x2d58ab4a
-0,        132,        132,        1,   153600, 0x2d58ab4a
-0,        133,        133,        1,   153600, 0x2d58ab4a
-0,        134,        134,        1,   153600, 0x2d58ab4a
-0,        135,        135,        1,   153600, 0x2d58ab4a
-0,        136,        136,        1,   153600, 0x2d58ab4a
-0,        137,        137,        1,   153600, 0x2d58ab4a
-0,        138,        138,        1,   153600, 0x2d58ab4a
-0,        139,        139,        1,   153600, 0x2d58ab4a
-0,        140,        140,        1,   153600, 0x2d58ab4a
-0,        141,        141,        1,   153600, 0x2d58ab4a
-0,        142,        142,        1,   153600, 0x2d58ab4a
-0,        143,        143,        1,   153600, 0x2d58ab4a
-0,        144,        144,        1,   153600, 0x2d58ab4a
-0,        145,        145,        1,   153600, 0x2d58ab4a
-0,        146,        146,        1,   153600, 0x2d58ab4a
-0,        147,        147,        1,   153600, 0x2d58ab4a
-0,        148,        148,        1,   153600, 0x2d58ab4a
-0,        149,        149,        1,   153600, 0x2d58ab4a
-0,        150,        150,        1,   153600, 0x2d58ab4a
-0,        151,        151,        1,   153600, 0x2d58ab4a
-0,        152,        152,        1,   153600, 0x2d58ab4a
-0,        153,        153,        1,   153600, 0x2d58ab4a
-0,        154,        154,        1,   153600, 0x2d58ab4a
-0,        155,        155,        1,   153600, 0x2d58ab4a
-0,        156,        156,        1,   153600, 0x2d58ab4a
-0,        157,        157,        1,   153600, 0x2d58ab4a
-0,        158,        158,        1,   153600, 0x2d58ab4a
-0,        159,        159,        1,   153600, 0x2d58ab4a
-0,        160,        160,        1,   153600, 0x2d58ab4a
-0,        161,        161,        1,   153600, 0x2d58ab4a
-0,        162,        162,        1,   153600, 0x2d58ab4a
-0,        163,        163,        1,   153600, 0x2d58ab4a
-0,        164,        164,        1,   153600, 0x2d58ab4a
-0,        165,        165,        1,   153600, 0x2d58ab4a
-0,        166,        166,        1,   153600, 0x2d58ab4a
-0,        167,        167,        1,   153600, 0x2d58ab4a
-0,        168,        168,        1,   153600, 0x2d58ab4a
-0,        169,        169,        1,   153600, 0x2d58ab4a
-0,        170,        170,        1,   153600, 0x2d58ab4a
-0,        171,        171,        1,   153600, 0x2d58ab4a
-0,        172,        172,        1,   153600, 0x2d58ab4a
-0,        173,        173,        1,   153600, 0x2d58ab4a
-0,        174,        174,        1,   153600, 0x2d58ab4a
-0,        175,        175,        1,   153600, 0x2d58ab4a
-0,        176,        176,        1,   153600, 0x2d58ab4a
-0,        177,        177,        1,   153600, 0x2d58ab4a
-0,        178,        178,        1,   153600, 0x2d58ab4a
-0,        179,        179,        1,   153600, 0x2d58ab4a
-0,        180,        180,        1,   153600, 0x2d58ab4a
-0,        181,        181,        1,   153600, 0x2d58ab4a
-0,        182,        182,        1,   153600, 0x2d58ab4a
-0,        183,        183,        1,   153600, 0x2d58ab4a
-0,        184,        184,        1,   153600, 0x2d58ab4a
-0,        185,        185,        1,   153600, 0x2d58ab4a
-0,        186,        186,        1,   153600, 0x2d58ab4a
-0,        187,        187,        1,   153600, 0x2d58ab4a
-0,        188,        188,        1,   153600, 0x2d58ab4a
-0,        189,        189,        1,   153600, 0x2d58ab4a
-0,        190,        190,        1,   153600, 0x2d58ab4a
-0,        191,        191,        1,   153600, 0x2d58ab4a
-0,        192,        192,        1,   153600, 0x2d58ab4a
-0,        193,        193,        1,   153600, 0x2d58ab4a
-0,        194,        194,        1,   153600, 0x2d58ab4a
-0,        195,        195,        1,   153600, 0x2d58ab4a
-0,        196,        196,        1,   153600, 0x2d58ab4a
-0,        197,        197,        1,   153600, 0x2d58ab4a
-0,        198,        198,        1,   153600, 0x2d58ab4a
-0,        199,        199,        1,   153600, 0x2d58ab4a
-0,        200,        200,        1,   153600, 0x2d58ab4a
-0,        201,        201,        1,   153600, 0x2d58ab4a
-0,        202,        202,        1,   153600, 0x2d58ab4a
-0,        203,        203,        1,   153600, 0x2d58ab4a
-0,        204,        204,        1,   153600, 0x2d58ab4a
-0,        205,        205,        1,   153600, 0x2d58ab4a
-0,        206,        206,        1,   153600, 0x2d58ab4a
-0,        207,        207,        1,   153600, 0x2d58ab4a
-0,        208,        208,        1,   153600, 0x2d58ab4a
-0,        209,        209,        1,   153600, 0x2d58ab4a
-0,        210,        210,        1,   153600, 0x2d58ab4a
-0,        211,        211,        1,   153600, 0x2d58ab4a
-0,        212,        212,        1,   153600, 0x2d58ab4a
-0,        213,        213,        1,   153600, 0x2d58ab4a
-0,        214,        214,        1,   153600, 0x2d58ab4a
-0,        215,        215,        1,   153600, 0x2d58ab4a
-0,        216,        216,        1,   153600, 0x2d58ab4a
-0,        217,        217,        1,   153600, 0x2d58ab4a
-0,        218,        218,        1,   153600, 0x2d58ab4a
-0,        219,        219,        1,   153600, 0x2d58ab4a
-0,        220,        220,        1,   153600, 0x2d58ab4a
-0,        221,        221,        1,   153600, 0x2d58ab4a
-0,        222,        222,        1,   153600, 0x2d58ab4a
-0,        223,        223,        1,   153600, 0x2d58ab4a
-0,        224,        224,        1,   153600, 0x2d58ab4a
-0,        225,        225,        1,   153600, 0x2d58ab4a
-0,        226,        226,        1,   153600, 0x2d58ab4a
-0,        227,        227,        1,   153600, 0x2d58ab4a
-0,        228,        228,        1,   153600, 0x2d58ab4a
-0,        229,        229,        1,   153600, 0x2d58ab4a
-0,        230,        230,        1,   153600, 0x2d58ab4a
-0,        231,        231,        1,   153600, 0x2d58ab4a
-0,        232,        232,        1,   153600, 0x2d58ab4a
-0,        233,        233,        1,   153600, 0x2d58ab4a
-0,        234,        234,        1,   153600, 0x2d58ab4a
-0,        235,        235,        1,   153600, 0x2d58ab4a
-0,        236,        236,        1,   153600, 0x2d58ab4a
-0,        237,        237,        1,   153600, 0x2d58ab4a
-0,        238,        238,        1,   153600, 0x2d58ab4a
-0,        239,        239,        1,   153600, 0x2d58ab4a
-0,        240,        240,        1,   153600, 0x2d58ab4a
-0,        241,        241,        1,   153600, 0x2d58ab4a
-0,        242,        242,        1,   153600, 0x2d58ab4a
-0,        243,        243,        1,   153600, 0x2d58ab4a
-0,        244,        244,        1,   153600, 0x2d58ab4a
-0,        245,        245,        1,   153600, 0x2d58ab4a
-0,        246,        246,        1,   153600, 0x2d58ab4a
-0,        247,        247,        1,   153600, 0x2d58ab4a
-0,        248,        248,        1,   153600, 0x2d58ab4a
-0,        249,        249,        1,   153600, 0x2d58ab4a
-0,        250,        250,        1,   153600, 0x2d58ab4a
-0,        251,        251,        1,   153600, 0x2d58ab4a
-0,        252,        252,        1,   153600, 0x2d58ab4a
-0,        253,        253,        1,   153600, 0x2d58ab4a
-0,        254,        254,        1,   153600, 0x2d58ab4a
-0,        255,        255,        1,   153600, 0x2d58ab4a
-0,        256,        256,        1,   153600, 0x2d58ab4a
-0,        257,        257,        1,   153600, 0x2d58ab4a
-0,        258,        258,        1,   153600, 0x2d58ab4a
-0,        259,        259,        1,   153600, 0x2d58ab4a
-0,        260,        260,        1,   153600, 0x2d58ab4a
-0,        261,        261,        1,   153600, 0x2d58ab4a
-0,        262,        262,        1,   153600, 0x2d58ab4a
-0,        263,        263,        1,   153600, 0x2d58ab4a
-0,        264,        264,        1,   153600, 0x2d58ab4a
-0,        265,        265,        1,   153600, 0x2d58ab4a
-0,        266,        266,        1,   153600, 0x2d58ab4a
-0,        267,        267,        1,   153600, 0x2d58ab4a
-0,        268,        268,        1,   153600, 0x2d58ab4a
-0,        269,        269,        1,   153600, 0x2d58ab4a
-0,        270,        270,        1,   153600, 0x2d58ab4a
-0,        271,        271,        1,   153600, 0x2d58ab4a
-0,        272,        272,        1,   153600, 0x2d58ab4a
-0,        273,        273,        1,   153600, 0x2d58ab4a
-0,        274,        274,        1,   153600, 0x2d58ab4a
-0,        275,        275,        1,   153600, 0x2d58ab4a
-0,        276,        276,        1,   153600, 0x2d58ab4a
-0,        277,        277,        1,   153600, 0x2d58ab4a
-0,        278,        278,        1,   153600, 0x2d58ab4a
-0,        279,        279,        1,   153600, 0x2d58ab4a
-0,        280,        280,        1,   153600, 0x2d58ab4a
-0,        281,        281,        1,   153600, 0x2d58ab4a
-0,        282,        282,        1,   153600, 0x2d58ab4a
-0,        283,        283,        1,   153600, 0x2d58ab4a
-0,        284,        284,        1,   153600, 0x7815bb72
-0,        285,        285,        1,   153600, 0x47ec1353
-0,        286,        286,        1,   153600, 0x6599fabc
-0,        287,        287,        1,   153600, 0x3d8a8690
-0,        288,        288,        1,   153600, 0xc0bc1ba5
-0,        289,        289,        1,   153600, 0x07368f2a
-0,        290,        290,        1,   153600, 0x81c54b89
-0,        291,        291,        1,   153600, 0xbfcae7bf
-0,        292,        292,        1,   153600, 0x1348310e
-0,        293,        293,        1,   153600, 0xb5489dad
-0,        294,        294,        1,   153600, 0xa1eb1408
-0,        295,        295,        1,   153600, 0x15e1832c
-0,        296,        296,        1,   153600, 0xb789cba5
-0,        297,        297,        1,   153600, 0x3ee86e4f
-0,        298,        298,        1,   153600, 0x06ea3883
-0,        299,        299,        1,   153600, 0xcedd02b7
-0,        300,        300,        1,   153600, 0xbce6ce58
-0,        301,        301,        1,   153600, 0xaadf9a00
-0,        302,        302,        1,   153600, 0x98c865a0
-0,        303,        303,        1,   153600, 0x4c8432e0
-0,        304,        304,        1,   153600, 0x00000000
-0,        305,        305,        1,   153600, 0x00000000
-0,        306,        306,        1,   153600, 0x00000000
-0,        307,        307,        1,   153600, 0x00000000
-0,        308,        308,        1,   153600, 0x00000000
-0,        309,        309,        1,   153600, 0x00000000
-0,        310,        310,        1,   153600, 0x00000000
-0,        311,        311,        1,   153600, 0x00000000
-0,        312,        312,        1,   153600, 0x00000000
diff --git a/deps/libav/tests/ref/fate/kmvc b/deps/libav/tests/ref/fate/kmvc
deleted file mode 100644
index 8a733bb..0000000
--- a/deps/libav/tests/ref/fate/kmvc
+++ /dev/null
@@ -1,76 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   153600, 0x00000000
-0,          1,          1,        1,   153600, 0x00000000
-0,          2,          2,        1,   153600, 0x00000000
-0,          3,          3,        1,   153600, 0x3ad906f0
-0,          4,          4,        1,   153600, 0x9f7c2e80
-0,          5,          5,        1,   153600, 0x548c9e10
-0,          6,          6,        1,   153600, 0xab4154e7
-0,          7,          7,        1,   153600, 0x762964be
-0,          8,          8,        1,   153600, 0xea6beab1
-0,          9,          9,        1,   153600, 0x00805c23
-0,         10,         10,        1,   153600, 0x932eebd2
-0,         11,         11,        1,   153600, 0x73a9a1c4
-0,         12,         12,        1,   153600, 0x3ecf80a2
-0,         13,         13,        1,   153600, 0xb7266fcc
-0,         14,         14,        1,   153600, 0xf9a75e02
-0,         15,         15,        1,   153600, 0xa4cb4c00
-0,         16,         16,        1,   153600, 0x8cc653fa
-0,         17,         17,        1,   153600, 0xf0735df0
-0,         18,         18,        1,   153600, 0x46945766
-0,         19,         19,        1,   153600, 0x1cf75120
-0,         20,         20,        1,   153600, 0x015d4476
-0,         21,         21,        1,   153600, 0x4ad6419c
-0,         22,         22,        1,   153600, 0xf97a1292
-0,         23,         23,        1,   153600, 0x8048c6bd
-0,         24,         24,        1,   153600, 0x0aa97f7f
-0,         25,         25,        1,   153600, 0xcd1a0531
-0,         26,         26,        1,   153600, 0xeb9e72b4
-0,         27,         27,        1,   153600, 0x5a61d657
-0,         28,         28,        1,   153600, 0xc4eb1759
-0,         29,         29,        1,   153600, 0x07b05b0c
-0,         30,         30,        1,   153600, 0x9c417927
-0,         31,         31,        1,   153600, 0xa3a28516
-0,         32,         32,        1,   153600, 0x78e97511
-0,         33,         33,        1,   153600, 0x05c94e38
-0,         34,         34,        1,   153600, 0x0003ffa4
-0,         35,         35,        1,   153600, 0x46489827
-0,         36,         36,        1,   153600, 0xa6ac0ea6
-0,         37,         37,        1,   153600, 0xf4ae7e9a
-0,         38,         38,        1,   153600, 0xe07dd526
-0,         39,         39,        1,   153600, 0x5c0d0ab9
-0,         40,         40,        1,   153600, 0xad542525
-0,         41,         41,        1,   153600, 0xa72a35b1
-0,         42,         42,        1,   153600, 0x373d3cbd
-0,         43,         43,        1,   153600, 0x242c3cad
-0,         44,         44,        1,   153600, 0xbe4f44e5
-0,         45,         45,        1,   153600, 0x3b883575
-0,         46,         46,        1,   153600, 0xcd7d2995
-0,         47,         47,        1,   153600, 0x89a01f99
-0,         48,         48,        1,   153600, 0x79ac0861
-0,         49,         49,        1,   153600, 0xefb6ee22
-0,         50,         50,        1,   153600, 0x4498d6b2
-0,         51,         51,        1,   153600, 0x99efd0a6
-0,         52,         52,        1,   153600, 0xd937c282
-0,         53,         53,        1,   153600, 0xa6c6bbb2
-0,         54,         54,        1,   153600, 0xf667bf0e
-0,         55,         55,        1,   153600, 0x83b2c12e
-0,         56,         56,        1,   153600, 0xcbd6c766
-0,         57,         57,        1,   153600, 0xc5b3c762
-0,         58,         58,        1,   153600, 0xe51fc5fa
-0,         59,         59,        1,   153600, 0x6542c5ee
-0,         60,         60,        1,   153600, 0x59d2c946
-0,         61,         61,        1,   153600, 0xccaacdde
-0,         62,         62,        1,   153600, 0x884ec6aa
-0,         63,         63,        1,   153600, 0xb3d7c2de
-0,         64,         64,        1,   153600, 0xd4e8c1a2
-0,         65,         65,        1,   153600, 0xa416c3ba
-0,         66,         66,        1,   153600, 0x6905b62e
-0,         67,         67,        1,   153600, 0xce16b456
-0,         68,         68,        1,   153600, 0xcbd9a67e
-0,         69,         69,        1,   153600, 0x6785afd6
-0,         70,         70,        1,   153600, 0x6fd7b1fa
-0,         71,         71,        1,   153600, 0x2a65b77e
-0,         72,         72,        1,   153600, 0xa162aff6
-0,         73,         73,        1,   153600, 0x227ea802
-0,         74,         74,        1,   153600, 0x98de79fa
diff --git a/deps/libav/tests/ref/fate/lagarith-rgb24 b/deps/libav/tests/ref/fate/lagarith-rgb24
deleted file mode 100644
index 1eb2bc4..0000000
--- a/deps/libav/tests/ref/fate/lagarith-rgb24
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 100/2997
-0,          0,          0,        1,   368640, 0x26f74db2
-0,          1,          1,        1,   368640, 0x63b29ea4
-0,          2,          2,        1,   368640, 0x19467f03
-0,          3,          3,        1,   368640, 0x5fdc3575
diff --git a/deps/libav/tests/ref/fate/lagarith-rgb32 b/deps/libav/tests/ref/fate/lagarith-rgb32
deleted file mode 100644
index 490e2e5..0000000
--- a/deps/libav/tests/ref/fate/lagarith-rgb32
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1001/24000
-0,          0,          0,        1,  1382400, 0x00000000
-0,          1,          1,        1,  1382400, 0x00000000
-0,          2,          2,        1,  1382400, 0x00000000
-0,          3,          3,        1,  1382400, 0x00000000
-0,          4,          4,        1,  1382400, 0x00000000
-0,          5,          5,        1,  1382400, 0xf95bde46
-0,          6,          6,        1,  1382400, 0x4f4c0393
-0,          7,          7,        1,  1382400, 0xe5aa40db
-0,          8,          8,        1,  1382400, 0xc25a8ba2
-0,          9,          9,        1,  1382400, 0x9db3150d
-0,         10,         10,        1,  1382400, 0x730e64b3
-0,         11,         11,        1,  1382400, 0xf8fd7edf
-0,         12,         12,        1,  1382400, 0x0114798a
-0,         13,         13,        1,  1382400, 0x7571210f
-0,         14,         14,        1,  1382400, 0x552ae59d
-0,         15,         15,        1,  1382400, 0x7ae0c946
-0,         16,         16,        1,  1382400, 0x0818c3ef
-0,         17,         17,        1,  1382400, 0x8257cac4
-0,         18,         18,        1,  1382400, 0x7762a979
-0,         19,         19,        1,  1382400, 0x282af57a
-0,         20,         20,        1,  1382400, 0x3f42de50
-0,         21,         21,        1,  1382400, 0xc42d5f93
-0,         22,         22,        1,  1382400, 0x18775c90
-0,         23,         23,        1,  1382400, 0x34befa90
-0,         24,         24,        1,  1382400, 0xd33d5f53
diff --git a/deps/libav/tests/ref/fate/lagarith-yuy2 b/deps/libav/tests/ref/fate/lagarith-yuy2
deleted file mode 100644
index c5aed92..0000000
--- a/deps/libav/tests/ref/fate/lagarith-yuy2
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/10
-0,          0,          0,        1,  1572864, 0xeed76a7d
diff --git a/deps/libav/tests/ref/fate/lagarith-yv12 b/deps/libav/tests/ref/fate/lagarith-yv12
deleted file mode 100644
index c9c9ff3..0000000
--- a/deps/libav/tests/ref/fate/lagarith-yv12
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/60
-0,          0,          0,        1,    92160, 0x1dfdf5c1
-0,          1,          1,        1,    92160, 0x6965884f
diff --git a/deps/libav/tests/ref/fate/lmlm4-demux b/deps/libav/tests/ref/fate/lmlm4-demux
deleted file mode 100644
index 0546135..0000000
--- a/deps/libav/tests/ref/fate/lmlm4-demux
+++ /dev/null
@@ -1,217 +0,0 @@
-#tb 0: 1001/30000
-#tb 1: 1/90000
-0,          0, -9223372036854775808,        1,     5951, 0xe9118e0d
-1,          0,          0,     2160,      768, 0xaebcbebb
-1,       2160,       2160,     2160,      768, 0xaebcbebb
-0,          1, -9223372036854775808,        1,     1672, 0x4b80d4ca
-1,       4320,       4320,     2160,      768, 0xaebcbebb
-0,          2, -9223372036854775808,        1,     1604, 0x99e1b0a7
-1,       6480,       6480,     2160,      768, 0x866fe37a
-1,       8640,       8640,     2160,      768, 0x05d76890
-0,          3, -9223372036854775808,        1,     1204, 0x9559038a
-1,      10800,      10800,     2160,      768, 0x858f5511
-0,          4, -9223372036854775808,        1,     1482, 0x60056564
-1,      12960,      12960,     2160,      768, 0x97cb65ef
-0,          5, -9223372036854775808,        1,     1105, 0xf508cef4
-1,      15120,      15120,     2160,      768, 0xe269742c
-1,      17280,      17280,     2160,      768, 0xa6015f8d
-0,          6, -9223372036854775808,        1,     1193, 0xc8e0fd36
-1,      19440,      19440,     2160,      768, 0x759163e0
-0,          7, -9223372036854775808,        1,     1247, 0x8dd202e5
-1,      21600,      21600,     2160,      768, 0xb1e16082
-1,      23760,      23760,     2160,      768, 0x1b616429
-0,          8, -9223372036854775808,        1,     1367, 0xf59435e5
-1,      25920,      25920,     2160,      768, 0x7e4364f7
-0,          9, -9223372036854775808,        1,     1406, 0x68ba4a7e
-1,      28080,      28080,     2160,      768, 0x59bd64f7
-0,         10, -9223372036854775808,        1,     1262, 0x82c04123
-1,      30240,      30240,     2160,      768, 0xc3116fc6
-1,      32400,      32400,     2160,      768, 0x6a1c6b56
-0,         11, -9223372036854775808,        1,     1381, 0x02335cf9
-1,      34560,      34560,     2160,      768, 0x285a64cf
-0,         12, -9223372036854775808,        1,     1450, 0x7be46fd1
-1,      36720,      36720,     2160,      768, 0x79b16d65
-1,      38880,      38880,     2160,      768, 0x09b47635
-0,         13, -9223372036854775808,        1,     1362, 0x75cc381a
-1,      41040,      41040,     2160,      768, 0x81597446
-0,         14, -9223372036854775808,        1,     1409, 0x9ed74f3f
-1,      43200,      43200,     2160,      768, 0xfeb66eee
-0,         15, -9223372036854775808,        1,     1253, 0x82400ae1
-1,      45360,      45360,     2160,      768, 0x78557618
-1,      47520,      47520,     2160,      768, 0x3af170bf
-0,         16, -9223372036854775808,        1,     5499, 0xed286805
-1,      49680,      49680,     2160,      768, 0xefbd6399
-0,         17, -9223372036854775808,        1,     1403, 0x483c4cbc
-1,      51840,      51840,     2160,      768, 0xc98e7492
-1,      54000,      54000,     2160,      768, 0x010d7149
-0,         18, -9223372036854775808,        1,     1632, 0xa9ebcd6c
-1,      56160,      56160,     2160,      768, 0xce838b07
-0,         19, -9223372036854775808,        1,     1207, 0xc8580724
-1,      58320,      58320,     2160,      768, 0xed18726c
-0,         20, -9223372036854775808,        1,     1289, 0x61fb2fd2
-1,      60480,      60480,     2160,      768, 0x017e6712
-1,      62640,      62640,     2160,      768, 0x7f9268e9
-0,         21, -9223372036854775808,        1,     1230, 0xf348f53c
-1,      64800,      64800,     2160,      768, 0xf6f258fc
-0,         22, -9223372036854775808,        1,     1579, 0xa260b1ac
-1,      66960,      66960,     2160,      768, 0x9a1a6f31
-0,         23, -9223372036854775808,        1,      949, 0x91849002
-1,      69120,      69120,     2160,      768, 0x14b47b23
-1,      71280,      71280,     2160,      768, 0x9bdc6a50
-0,         24, -9223372036854775808,        1,      786, 0x3e33576f
-1,      73440,      73440,     2160,      768, 0x0fc46dab
-0,         25, -9223372036854775808,        1,      894, 0x9ac36a61
-1,      75600,      75600,     2160,      768, 0x6c387372
-1,      77760,      77760,     2160,      768, 0x581e71cd
-0,         26, -9223372036854775808,        1,     1186, 0x6bfc116e
-1,      79920,      79920,     2160,      768, 0x00cb785f
-0,         27, -9223372036854775808,        1,     1187, 0xcfc512ae
-1,      82080,      82080,     2160,      768, 0x1dda7032
-0,         28, -9223372036854775808,        1,     1527, 0x5c2c965a
-1,      84240,      84240,     2160,      768, 0xf57c7103
-1,      86400,      86400,     2160,      768, 0x2d927183
-0,         29, -9223372036854775808,        1,     1536, 0x5ba7ac29
-1,      88560,      88560,     2160,      768, 0xdae86cdf
-0,         30, -9223372036854775808,        1,     1095, 0xce06eb96
-1,      90720,      90720,     2160,      768, 0x2a2f6c3c
-1,      92880,      92880,     2160,      768, 0x44696eba
-0,         31, -9223372036854775808,        1,     1402, 0x642f6b0d
-1,      95040,      95040,     2160,      768, 0xf67c71c4
-0,         32, -9223372036854775808,        1,     5551, 0xf01a9c08
-1,      97200,      97200,     2160,      768, 0xc1ce7237
-0,         33, -9223372036854775808,        1,     1211, 0x350206f7
-1,      99360,      99360,     2160,      768, 0xd9c36ef5
-1,     101520,     101520,     2160,      768, 0x63b06b03
-0,         34, -9223372036854775808,        1,      887, 0x08767619
-1,     103680,     103680,     2160,      768, 0x8de97ebe
-0,         35, -9223372036854775808,        1,     1042, 0xcc81a9ed
-1,     105840,     105840,     2160,      768, 0xbf117c32
-1,     108000,     108000,     2160,      768, 0x82897497
-0,         36, -9223372036854775808,        1,     1247, 0x6f320614
-1,     110160,     110160,     2160,      768, 0x7a347abb
-0,         37, -9223372036854775808,        1,     1459, 0xd28975b5
-1,     112320,     112320,     2160,      768, 0xc99b691e
-0,         38, -9223372036854775808,        1,     1116, 0x1ab1e9db
-1,     114480,     114480,     2160,      768, 0xf4fc6e74
-1,     116640,     116640,     2160,      768, 0x511d6ec4
-0,         39, -9223372036854775808,        1,     1110, 0x6411f66a
-1,     118800,     118800,     2160,      768, 0xb8c06b5f
-0,         40, -9223372036854775808,        1,     1282, 0xd468375d
-1,     120960,     120960,     2160,      768, 0xf1776aed
-1,     123120,     123120,     2160,      768, 0xe6fe7fb4
-0,         41, -9223372036854775808,        1,     1077, 0x1273c6e3
-1,     125280,     125280,     2160,      768, 0x36907aff
-0,         42, -9223372036854775808,        1,     1043, 0x12dbd3ae
-1,     127440,     127440,     2160,      768, 0xddf666bb
-0,         43, -9223372036854775808,        1,     1087, 0x3e70d37a
-1,     129600,     129600,     2160,      768, 0x8e896ebc
-1,     131760,     131760,     2160,      768, 0x0aa47dfa
-0,         44, -9223372036854775808,        1,      992, 0x0651a71c
-1,     133920,     133920,     2160,      768, 0xc1736811
-0,         45, -9223372036854775808,        1,     1012, 0x6a069f8c
-1,     136080,     136080,     2160,      768, 0xb3e87009
-0,         46, -9223372036854775808,        1,     1320, 0x92803d69
-1,     138240,     138240,     2160,      768, 0xf23e6c00
-1,     140400,     140400,     2160,      768, 0x993a71d2
-0,         47, -9223372036854775808,        1,     1080, 0xe0ffbe95
-1,     142560,     142560,     2160,      768, 0xa53466dd
-0,         48, -9223372036854775808,        1,     5639, 0x658ca26b
-1,     144720,     144720,     2160,      768, 0xb43a74b0
-1,     146880,     146880,     2160,      768, 0x348f615c
-0,         49, -9223372036854775808,        1,     1385, 0xbcb96241
-1,     149040,     149040,     2160,      768, 0x298f6e1b
-0,         50, -9223372036854775808,        1,     1142, 0x8c6df318
-1,     151200,     151200,     2160,      768, 0x5db469c8
-0,         51, -9223372036854775808,        1,     1175, 0xcac1faef
-1,     153360,     153360,     2160,      768, 0x08f16c2c
-1,     155520,     155520,     2160,      768, 0x4a0474cb
-0,         52, -9223372036854775808,        1,     1091, 0xa937e32a
-1,     157680,     157680,     2160,      768, 0x077c760b
-0,         53, -9223372036854775808,        1,     1174, 0xfa50040d
-1,     159840,     159840,     2160,      768, 0xa5777c2e
-1,     162000,     162000,     2160,      768, 0x0d157ea6
-0,         54, -9223372036854775808,        1,     1293, 0x0c8d2740
-1,     164160,     164160,     2160,      768, 0x9bc26f86
-0,         55, -9223372036854775808,        1,     1262, 0x502c0c35
-1,     166320,     166320,     2160,      768, 0x1a72742d
-0,         56, -9223372036854775808,        1,     1038, 0x5e98c0cd
-1,     168480,     168480,     2160,      768, 0xa5bb6bbb
-1,     170640,     170640,     2160,      768, 0x48496c4c
-0,         57, -9223372036854775808,        1,     1362, 0x256e43cf
-1,     172800,     172800,     2160,      768, 0x800d78f0
-0,         58, -9223372036854775808,        1,     1200, 0x29e6f055
-1,     174960,     174960,     2160,      768, 0x40db840c
-1,     177120,     177120,     2160,      768, 0xadc96a6b
-0,         59, -9223372036854775808,        1,     1495, 0x88e9b973
-1,     179280,     179280,     2160,      768, 0xff986b03
-0,         60, -9223372036854775808,        1,     1386, 0x849297d2
-1,     181440,     181440,     2160,      768, 0x152473d6
-0,         61, -9223372036854775808,        1,     1572, 0x63b7dc79
-1,     183600,     183600,     2160,      768, 0x01567323
-1,     185760,     185760,     2160,      768, 0xe5f26fe5
-0,         62, -9223372036854775808,        1,     1190, 0x32ccf4cb
-1,     187920,     187920,     2160,      768, 0xa8fd72cd
-0,         63, -9223372036854775808,        1,     1395, 0xa6ec4ae9
-1,     190080,     190080,     2160,      768, 0x8857655b
-0,         64, -9223372036854775808,        1,     5692, 0x81aed6f3
-1,     192240,     192240,     2160,      768, 0x84017b13
-1,     194400,     194400,     2160,      768, 0xe6a968b3
-0,         65, -9223372036854775808,        1,     1335, 0xe98a5497
-1,     196560,     196560,     2160,      768, 0xb03a7566
-0,         66, -9223372036854775808,        1,     1361, 0x8ae15ab5
-1,     198720,     198720,     2160,      768, 0x8bea5f62
-1,     200880,     200880,     2160,      768, 0xac7570b0
-0,         67, -9223372036854775808,        1,     1525, 0xed2bc1e8
-1,     203040,     203040,     2160,      768, 0x11306fac
-0,         68, -9223372036854775808,        1,     1570, 0xba70d74b
-1,     205200,     205200,     2160,      768, 0xf2af5b28
-0,         69, -9223372036854775808,        1,     1349, 0xd97a687d
-1,     207360,     207360,     2160,      768, 0x3069681f
-1,     209520,     209520,     2160,      768, 0x7ff07033
-0,         70, -9223372036854775808,        1,     1270, 0xca8c3ca8
-1,     211680,     211680,     2160,      768, 0xd74973f2
-0,         71, -9223372036854775808,        1,     1016, 0x32d0c81a
-1,     213840,     213840,     2160,      768, 0xb3627304
-1,     216000,     216000,     2160,      768, 0x11ff7589
-0,         72, -9223372036854775808,        1,      983, 0x536faa97
-1,     218160,     218160,     2160,      768, 0x4a156c63
-0,         73, -9223372036854775808,        1,     1111, 0x44ade015
-1,     220320,     220320,     2160,      768, 0xcb036127
-0,         74, -9223372036854775808,        1,     1314, 0xce7c477d
-1,     222480,     222480,     2160,      768, 0x0b796bb9
-1,     224640,     224640,     2160,      768, 0x1d516c35
-0,         75, -9223372036854775808,        1,     1005, 0x0196b491
-1,     226800,     226800,     2160,      768, 0xa9146da1
-0,         76, -9223372036854775808,        1,     1162, 0xb8f6ebe6
-1,     228960,     228960,     2160,      768, 0x6d176392
-1,     231120,     231120,     2160,      768, 0x6f966269
-0,         77, -9223372036854775808,        1,     1440, 0xfca67c72
-1,     233280,     233280,     2160,      768, 0x7ee17724
-0,         78, -9223372036854775808,        1,     1437, 0x491181b1
-1,     235440,     235440,     2160,      768, 0x3f07614a
-0,         79, -9223372036854775808,        1,     1261, 0xf0cd1898
-1,     237600,     237600,     2160,      768, 0x49d56945
-1,     239760,     239760,     2160,      768, 0x68eb660a
-0,         80, -9223372036854775808,        1,     5638, 0x3a25a9f2
-1,     241920,     241920,     2160,      768, 0xe7c96677
-0,         81, -9223372036854775808,        1,     1091, 0x67d9c693
-1,     244080,     244080,     2160,      768, 0x7dc07a35
-1,     246240,     246240,     2160,      768, 0x1e9c6397
-0,         82, -9223372036854775808,        1,      875, 0x52147bb1
-1,     248400,     248400,     2160,      768, 0x93ef5de4
-0,         83, -9223372036854775808,        1,     1188, 0x8522000f
-1,     250560,     250560,     2160,      768, 0x34af6803
-0,         84, -9223372036854775808,        1,     1360, 0x89b82e7b
-1,     252720,     252720,     2160,      768, 0x77e068be
-1,     254880,     254880,     2160,      768, 0x65e274de
-0,         85, -9223372036854775808,        1,     1378, 0xe8644914
-1,     257040,     257040,     2160,      768, 0xb7ad6a8a
-0,         86, -9223372036854775808,        1,     1194, 0x89fef83d
-1,     259200,     259200,     2160,      768, 0x84b3635f
-0,         87, -9223372036854775808,        1,     1422, 0x99daa18b
-1,     261360,     261360,     2160,      768, 0x066b78f2
-1,     263520,     263520,     2160,      768, 0xda137428
-0,         88, -9223372036854775808,        1,     1049, 0x72a9cec1
-1,     265680,     265680,     2160,      768, 0xfd6c7597
-0,         89, -9223372036854775808,        1,     1327, 0x7d15307c
-1,     267840,     267840,     2160,      768, 0x8d766d40
diff --git a/deps/libav/tests/ref/fate/loco-rgb b/deps/libav/tests/ref/fate/loco-rgb
deleted file mode 100644
index ad199f1..0000000
--- a/deps/libav/tests/ref/fate/loco-rgb
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 71/500
-0,          0,          0,        1,    72192, 0x1847500c
-0,          1,          1,        1,    72192, 0x1b0e2e87
-0,          2,          2,        1,    72192, 0x293276c8
-0,          3,          3,        1,    72192, 0x743b9705
-0,          4,          4,        1,    72192, 0xcc1b2530
diff --git a/deps/libav/tests/ref/fate/loco-yuy2 b/deps/libav/tests/ref/fate/loco-yuy2
deleted file mode 100644
index 60a06bc..0000000
--- a/deps/libav/tests/ref/fate/loco-yuy2
+++ /dev/null
@@ -1,4 +0,0 @@
-#tb 0: 71/500
-0,          0,          0,        1,    48128, 0x7795782d
-0,          1,          1,        1,    48128, 0x3d89bcf7
-0,          2,          2,        1,    48128, 0x170d200a
diff --git a/deps/libav/tests/ref/fate/lossless-alac b/deps/libav/tests/ref/fate/lossless-alac
deleted file mode 100644
index df27061..0000000
--- a/deps/libav/tests/ref/fate/lossless-alac
+++ /dev/null
@@ -1 +0,0 @@
-d0beb768d860b4776358077dd9fcb1e9
diff --git a/deps/libav/tests/ref/fate/lossless-meridianaudio b/deps/libav/tests/ref/fate/lossless-meridianaudio
deleted file mode 100644
index 7f6f43f..0000000
--- a/deps/libav/tests/ref/fate/lossless-meridianaudio
+++ /dev/null
@@ -1 +0,0 @@
-b3d0c9523c42fae639f7074e60281509
diff --git a/deps/libav/tests/ref/fate/lossless-monkeysaudio-399 b/deps/libav/tests/ref/fate/lossless-monkeysaudio-399
deleted file mode 100644
index 4b8caa1..0000000
--- a/deps/libav/tests/ref/fate/lossless-monkeysaudio-399
+++ /dev/null
@@ -1 +0,0 @@
-a28d4e5f2192057f7d4bece870f40bd0
diff --git a/deps/libav/tests/ref/fate/lossless-shorten b/deps/libav/tests/ref/fate/lossless-shorten
deleted file mode 100644
index 9cdb369..0000000
--- a/deps/libav/tests/ref/fate/lossless-shorten
+++ /dev/null
@@ -1 +0,0 @@
-da93c50961443b88fce416ae61c8ca8a
diff --git a/deps/libav/tests/ref/fate/lossless-tta b/deps/libav/tests/ref/fate/lossless-tta
deleted file mode 100644
index 85b7a59..0000000
--- a/deps/libav/tests/ref/fate/lossless-tta
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0xb2b8b6d9
diff --git a/deps/libav/tests/ref/fate/lossless-wma b/deps/libav/tests/ref/fate/lossless-wma
deleted file mode 100644
index 5bea19b..0000000
--- a/deps/libav/tests/ref/fate/lossless-wma
+++ /dev/null
@@ -1 +0,0 @@
-35dc840f91cbcece02178d03c8f2fe26
diff --git a/deps/libav/tests/ref/fate/maxis-xa b/deps/libav/tests/ref/fate/maxis-xa
deleted file mode 100644
index c29738c..0000000
--- a/deps/libav/tests/ref/fate/maxis-xa
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,       28,       30, 0x51750711
-0,         28,         28,       28,       30, 0x9ca20c2a
-0,         56,         56,       28,       30, 0x7551081f
-0,         84,         84,       28,       30, 0x09540063
-0,        112,        112,       28,       30, 0x02c40018
-0,        140,        140,       28,       30, 0x0f6c0117
-0,        168,        168,       28,       30, 0x2aab0315
-0,        196,        196,       28,       30, 0x0e6d0117
-0,        224,        224,       28,       30, 0x04770036
-0,        252,        252,       28,       30, 0x939c090f
-0,        280,        280,       28,       30, 0xde511116
-0,        308,        308,       28,       30, 0x2f0f13f5
-0,        336,        336,       28,       30, 0x65bb0630
-0,        364,        364,       28,       30, 0x1f7a0333
-0,        392,        392,       28,       30, 0xa3d71008
-0,        420,        420,       28,       30, 0x69120801
-0,        448,        448,       28,       30, 0x1e7b0207
-0,        476,        476,       28,       30, 0x02c40018
-0,        504,        504,       28,       30, 0x0d050126
-0,        532,        532,       28,       30, 0x41c10333
-0,        560,        560,       28,       30, 0x16a10207
-0,        588,        588,       28,       30, 0x0f210207
-0,        616,        616,       28,       30, 0x4e4b073e
-0,        644,        644,       28,       30, 0xa6f20d1a
-0,        672,        672,       28,       30, 0xe1e40ff9
-0,        700,        700,       28,       30, 0x868b090f
-0,        728,        728,       28,       30, 0x8c85091e
-0,        756,        756,       28,       30, 0x5a21094b
-0,        784,        784,       28,       30, 0x993c0900
-0,        812,        812,       28,       30, 0x5b6b04e6
diff --git a/deps/libav/tests/ref/fate/md5 b/deps/libav/tests/ref/fate/md5
deleted file mode 100644
index af08a84..0000000
--- a/deps/libav/tests/ref/fate/md5
+++ /dev/null
@@ -1,5 +0,0 @@
-0bf1bcc8a1d72e2cf58d42182b637e56
-993a3eb298e52aca83ecfbb6a766b4d0
-07c01ca7c733475fad38c84c56f305c1
-9fc8404827cac26385f48f4f58fd32ce
-a22bfef14302c5ca46e0ae91092bc0e0
diff --git a/deps/libav/tests/ref/fate/mdec b/deps/libav/tests/ref/fate/mdec
deleted file mode 100644
index b7aab62..0000000
--- a/deps/libav/tests/ref/fate/mdec
+++ /dev/null
@@ -1,135 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,   102144, 0x6edc83de
-0,          1,          1,        1,   102144, 0xd0534fda
-0,          2,          2,        1,   102144, 0x6447911f
-0,          3,          3,        1,   102144, 0xf21f3b46
-0,          4,          4,        1,   102144, 0x0975077a
-0,          5,          5,        1,   102144, 0xb9a12d8e
-0,          6,          6,        1,   102144, 0x17413513
-0,          7,          7,        1,   102144, 0x1e622a04
-0,          8,          8,        1,   102144, 0x7489224e
-0,          9,          9,        1,   102144, 0xae14956e
-0,         10,         10,        1,   102144, 0x104fd3a0
-0,         11,         11,        1,   102144, 0xea63a940
-0,         12,         12,        1,   102144, 0x0cf81588
-0,         13,         13,        1,   102144, 0xe4a5b2fd
-0,         14,         14,        1,   102144, 0x0c9aaf77
-0,         15,         15,        1,   102144, 0x065007d7
-0,         16,         16,        1,   102144, 0x54c0c29b
-0,         17,         17,        1,   102144, 0x1114cb8e
-0,         18,         18,        1,   102144, 0xe4270462
-0,         19,         19,        1,   102144, 0x61e5b7fd
-0,         20,         20,        1,   102144, 0x7cbeaca6
-0,         21,         21,        1,   102144, 0xed92daa4
-0,         22,         22,        1,   102144, 0xd8654d0d
-0,         23,         23,        1,   102144, 0x854e842b
-0,         24,         24,        1,   102144, 0x56407c3a
-0,         25,         25,        1,   102144, 0x17db3f90
-0,         26,         26,        1,   102144, 0x8b133b9a
-0,         27,         27,        1,   102144, 0xe4899db9
-0,         28,         28,        1,   102144, 0x579cf092
-0,         29,         29,        1,   102144, 0x19fa5062
-0,         30,         30,        1,   102144, 0x71339792
-0,         31,         31,        1,   102144, 0x970e5c0c
-0,         32,         32,        1,   102144, 0x84ee616a
-0,         33,         33,        1,   102144, 0x1d6f9a23
-0,         34,         34,        1,   102144, 0xc28e19db
-0,         35,         35,        1,   102144, 0x0e898967
-0,         36,         36,        1,   102144, 0x52a8b671
-0,         37,         37,        1,   102144, 0x3f45ea83
-0,         38,         38,        1,   102144, 0x7b0fc603
-0,         39,         39,        1,   102144, 0x14f94469
-0,         40,         40,        1,   102144, 0x5b9f37cc
-0,         41,         41,        1,   102144, 0xf902b7c7
-0,         42,         42,        1,   102144, 0x326836e0
-0,         43,         43,        1,   102144, 0x2e4aebba
-0,         44,         44,        1,   102144, 0xd10ae58c
-0,         45,         45,        1,   102144, 0xbd084ecf
-0,         46,         46,        1,   102144, 0xb2157c0a
-0,         47,         47,        1,   102144, 0xd7f158d4
-0,         48,         48,        1,   102144, 0x3cf86462
-0,         49,         49,        1,   102144, 0x53ecddab
-0,         50,         50,        1,   102144, 0xcdaba8ef
-0,         51,         51,        1,   102144, 0xab9ede18
-0,         52,         52,        1,   102144, 0xb6706e79
-0,         53,         53,        1,   102144, 0x76371069
-0,         54,         54,        1,   102144, 0x3a365016
-0,         55,         55,        1,   102144, 0x52177c09
-0,         56,         56,        1,   102144, 0xc33eb4fb
-0,         57,         57,        1,   102144, 0x16098436
-0,         58,         58,        1,   102144, 0x715d6a2b
-0,         59,         59,        1,   102144, 0xd3abc960
-0,         60,         60,        1,   102144, 0x7f34b0d4
-0,         61,         61,        1,   102144, 0xe3219b9c
-0,         62,         62,        1,   102144, 0x5fa54f54
-0,         63,         63,        1,   102144, 0x0fb746cb
-0,         64,         64,        1,   102144, 0xa6bd2da2
-0,         65,         65,        1,   102144, 0x04579119
-0,         66,         66,        1,   102144, 0xda818691
-0,         67,         67,        1,   102144, 0xe9d44445
-0,         68,         68,        1,   102144, 0x94868dc9
-0,         69,         69,        1,   102144, 0x3ca52ce6
-0,         70,         70,        1,   102144, 0xd7eb4c4f
-0,         71,         71,        1,   102144, 0xfcdfafca
-0,         72,         72,        1,   102144, 0x473a4a5a
-0,         73,         73,        1,   102144, 0xe5a5f3cb
-0,         74,         74,        1,   102144, 0x34070219
-0,         75,         75,        1,   102144, 0x0faa965a
-0,         76,         76,        1,   102144, 0xe2c6acda
-0,         77,         77,        1,   102144, 0xe22776d5
-0,         78,         78,        1,   102144, 0x80d85602
-0,         79,         79,        1,   102144, 0x2f3fa190
-0,         80,         80,        1,   102144, 0x70b461b1
-0,         81,         81,        1,   102144, 0x366c8b27
-0,         82,         82,        1,   102144, 0x65cc0866
-0,         83,         83,        1,   102144, 0x903beb14
-0,         84,         84,        1,   102144, 0xb6c5f5c7
-0,         85,         85,        1,   102144, 0xaa813725
-0,         86,         86,        1,   102144, 0x014a84a0
-0,         87,         87,        1,   102144, 0xd286ece1
-0,         88,         88,        1,   102144, 0x48b1c27d
-0,         89,         89,        1,   102144, 0xa611ef42
-0,         90,         90,        1,   102144, 0x98627584
-0,         91,         91,        1,   102144, 0x43de7c75
-0,         92,         92,        1,   102144, 0xa9e22c68
-0,         93,         93,        1,   102144, 0x84ac34d4
-0,         94,         94,        1,   102144, 0x6abd00ba
-0,         95,         95,        1,   102144, 0x5d11066e
-0,         96,         96,        1,   102144, 0xb6b083aa
-0,         97,         97,        1,   102144, 0x5d152a11
-0,         98,         98,        1,   102144, 0x0c0aec67
-0,         99,         99,        1,   102144, 0xa248bd10
-0,        100,        100,        1,   102144, 0x4e6c12cc
-0,        101,        101,        1,   102144, 0xca1d6753
-0,        102,        102,        1,   102144, 0x116310c3
-0,        103,        103,        1,   102144, 0x16903cd0
-0,        104,        104,        1,   102144, 0x239adfed
-0,        105,        105,        1,   102144, 0x0970ce49
-0,        106,        106,        1,   102144, 0xb628adc1
-0,        107,        107,        1,   102144, 0x473613f7
-0,        108,        108,        1,   102144, 0x3eef3987
-0,        109,        109,        1,   102144, 0x935b99ca
-0,        110,        110,        1,   102144, 0xb9f4d6ee
-0,        111,        111,        1,   102144, 0xac811656
-0,        112,        112,        1,   102144, 0xd1f84af0
-0,        113,        113,        1,   102144, 0xf2fd25f4
-0,        114,        114,        1,   102144, 0x935bbed9
-0,        115,        115,        1,   102144, 0x8c8c3e53
-0,        116,        116,        1,   102144, 0x24afc20f
-0,        117,        117,        1,   102144, 0xad20a451
-0,        118,        118,        1,   102144, 0xd1a0df13
-0,        119,        119,        1,   102144, 0xb0ee53f8
-0,        120,        120,        1,   102144, 0x08cdb591
-0,        121,        121,        1,   102144, 0x89b985b0
-0,        122,        122,        1,   102144, 0xdd27d51f
-0,        123,        123,        1,   102144, 0xa783fce0
-0,        124,        124,        1,   102144, 0xfe5602e8
-0,        125,        125,        1,   102144, 0xfb989934
-0,        126,        126,        1,   102144, 0xf857eb2b
-0,        127,        127,        1,   102144, 0x987a7098
-0,        128,        128,        1,   102144, 0xbc749f42
-0,        129,        129,        1,   102144, 0x221e48a6
-0,        130,        130,        1,   102144, 0x4c4b5da2
-0,        131,        131,        1,   102144, 0x32140027
-0,        132,        132,        1,   102144, 0xbeb4bf18
-0,        133,        133,        1,   102144, 0x523012e5
diff --git a/deps/libav/tests/ref/fate/mdec-v3 b/deps/libav/tests/ref/fate/mdec-v3
deleted file mode 100644
index 7e4bbdb..0000000
--- a/deps/libav/tests/ref/fate/mdec-v3
+++ /dev/null
@@ -1,60 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,    76800, 0x2677be82
-0,          1,          1,        1,    76800, 0x1f323c75
-0,          2,          2,        1,    76800, 0xc8be3be9
-0,          3,          3,        1,    76800, 0x1f323c75
-0,          4,          4,        1,    76800, 0x7e484488
-0,          5,          5,        1,    76800, 0x8bd644aa
-0,          6,          6,        1,    76800, 0xaa62e7b8
-0,          7,          7,        1,    76800, 0xaa62e7b8
-0,          8,          8,        1,    76800, 0x53fadb39
-0,          9,          9,        1,    76800, 0x53fadb39
-0,         10,         10,        1,    76800, 0x1ff9d964
-0,         11,         11,        1,    76800, 0x1ff9d964
-0,         12,         12,        1,    76800, 0xd8c8d947
-0,         13,         13,        1,    76800, 0xd8c8d947
-0,         14,         14,        1,    76800, 0x6d0bd94c
-0,         15,         15,        1,    76800, 0x6d0bd94c
-0,         16,         16,        1,    76800, 0x7e66d948
-0,         17,         17,        1,    76800, 0x7e66d948
-0,         18,         18,        1,    76800, 0x8eecfd72
-0,         19,         19,        1,    76800, 0xb15f29ab
-0,         20,         20,        1,    76800, 0x08e5502e
-0,         21,         21,        1,    76800, 0xaa58796d
-0,         22,         22,        1,    76800, 0xe254a27c
-0,         23,         23,        1,    76800, 0xeec8cf68
-0,         24,         24,        1,    76800, 0x812bf8ee
-0,         25,         25,        1,    76800, 0x929922ef
-0,         26,         26,        1,    76800, 0xe1174e06
-0,         27,         27,        1,    76800, 0x2da77bf1
-0,         28,         28,        1,    76800, 0xd0f6a727
-0,         29,         29,        1,    76800, 0x31bfd168
-0,         30,         30,        1,    76800, 0xb87af225
-0,         31,         31,        1,    76800, 0xd0080859
-0,         32,         32,        1,    76800, 0x99ab15ba
-0,         33,         33,        1,    76800, 0x99ab15ba
-0,         34,         34,        1,    76800, 0x99ab15ba
-0,         35,         35,        1,    76800, 0x99ab15ba
-0,         36,         36,        1,    76800, 0x99ab15ba
-0,         37,         37,        1,    76800, 0x99ab15ba
-0,         38,         38,        1,    76800, 0x99ab15ba
-0,         39,         39,        1,    76800, 0x99ab15ba
-0,         40,         40,        1,    76800, 0x99ab15ba
-0,         41,         41,        1,    76800, 0x99ab15ba
-0,         42,         42,        1,    76800, 0x99ab15ba
-0,         43,         43,        1,    76800, 0x99ab15ba
-0,         44,         44,        1,    76800, 0x99ab15ba
-0,         45,         45,        1,    76800, 0x99ab15ba
-0,         46,         46,        1,    76800, 0x99ab15ba
-0,         47,         47,        1,    76800, 0x99ab15ba
-0,         48,         48,        1,    76800, 0x0c1617d5
-0,         49,         49,        1,    76800, 0xb1c81b5d
-0,         50,         50,        1,    76800, 0xb4e41e44
-0,         51,         51,        1,    76800, 0x765725e2
-0,         52,         52,        1,    76800, 0x25cd3109
-0,         53,         53,        1,    76800, 0xa42b5291
-0,         54,         54,        1,    76800, 0x15bb6ee4
-0,         55,         55,        1,    76800, 0xb33c9f50
-0,         56,         56,        1,    76800, 0x1ca1b874
-0,         57,         57,        1,    76800, 0x7506e92a
-0,         58,         58,        1,    76800, 0x97c9030a
diff --git a/deps/libav/tests/ref/fate/mimic b/deps/libav/tests/ref/fate/mimic
deleted file mode 100644
index 217d487..0000000
--- a/deps/libav/tests/ref/fate/mimic
+++ /dev/null
@@ -1,77 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   115200, 0xa974d407
-0,        548,        548,        0,   115200, 0x72618b84
-0,       1088,       1088,        0,   115200, 0x87768573
-0,       1759,       1759,        0,   115200, 0x5d218e3e
-0,       2437,       2437,        0,   115200, 0x0c0db41c
-0,       3076,       3076,        0,   115200, 0xb777fd48
-0,       3908,       3908,        0,   115200, 0x40765de7
-0,       4545,       4545,        0,   115200, 0x370a3c90
-0,       5092,       5092,        0,   115200, 0xc605785a
-0,       6016,       6016,        0,   115200, 0x49468b23
-0,       6560,       6560,        0,   115200, 0x986b6fd4
-0,       7648,       7648,        0,   115200, 0x30f22ef8
-0,       8164,       8164,        0,   115200, 0xa90bd608
-0,       8836,       8836,        0,   115200, 0x9cf36518
-0,       9632,       9632,        0,   115200, 0x4ef1a679
-0,       9922,       9922,        0,   115200, 0x0df65873
-0,      10316,      10316,        0,   115200, 0xfecd4233
-0,      11104,      11104,        0,   115200, 0xee2f26cb
-0,      11776,      11776,        0,   115200, 0x795f612d
-0,      12321,      12321,        0,   115200, 0xbbb90125
-0,      12992,      12992,        0,   115200, 0x9230fb6e
-0,      13805,      13805,        0,   115200, 0x11869996
-0,      14468,      14468,        0,   115200, 0x6b5c892b
-0,      15136,      15136,        0,   115200, 0x88bdb9cd
-0,      15937,      15937,        0,   115200, 0x364bc5a0
-0,      16608,      16608,        0,   115200, 0x6b66d817
-0,      17281,      17281,        0,   115200, 0xd3a41252
-0,      18089,      18089,        0,   115200, 0x0cf5612f
-0,      18754,      18754,        0,   115200, 0x9752d055
-0,      19808,      19808,        0,   115200, 0x486e9f6f
-0,      20484,      20484,        0,   115200, 0x3eab62f8
-0,      21031,      21031,        0,   115200, 0xa7f52762
-0,      21957,      21957,        0,   115200, 0xfd4c4bbc
-0,      22498,      22498,        0,   115200, 0x194023f6
-0,      22880,      22880,        0,   115200, 0xd4668dad
-0,      23680,      23680,        0,   115200, 0x6b20d64b
-0,      24353,      24353,        0,   115200, 0xf2572aae
-0,      24901,      24901,        0,   115200, 0xc3554f25
-0,      25695,      25695,        0,   115200, 0xeeb5073a
-0,      26495,      26495,        0,   115200, 0xbd46291f
-0,      27040,      27040,        0,   115200, 0x0526838d
-0,      28107,      28107,        0,   115200, 0x85b2e864
-0,      28778,      28778,        0,   115200, 0xcfd894bc
-0,      29316,      29316,        0,   115200, 0x644f10fb
-0,      30240,      30240,        0,   115200, 0x556e4d88
-0,      30786,      30786,        0,   115200, 0x93243614
-0,      31983,      31983,        0,   115200, 0x754275c5
-0,      32929,      32929,        0,   115200, 0x7f648bf3
-0,      33600,      33600,        0,   115200, 0xece18c9b
-0,      34271,      34271,        0,   115200, 0x385d52c1
-0,      35201,      35201,        0,   115200, 0xafc58e4a
-0,      35743,      35743,        0,   115200, 0x50daf750
-0,      36384,      36384,        0,   115200, 0xf6bc67d1
-0,      37344,      37344,        0,   115200, 0xb64b6e07
-0,      38028,      38028,        0,   115200, 0x8751ed15
-0,      38657,      38657,        0,   115200, 0x329ce803
-0,      39334,      39334,        0,   115200, 0x40b2cb05
-0,      40129,      40129,        0,   115200, 0x60f3517d
-0,      40802,      40802,        0,   115200, 0xe0d46fdf
-0,      41472,      41472,        0,   115200, 0x204529fa
-0,      42276,      42276,        0,   115200, 0xd5afaf22
-0,      42944,      42944,        0,   115200, 0xd3cb3d4c
-0,      43616,      43616,        0,   115200, 0x87973a79
-0,      44421,      44421,        0,   115200, 0xe3b2f917
-0,      45092,      45092,        0,   115200, 0xf1923238
-0,      45632,      45632,        0,   115200, 0x51494d71
-0,      46561,      46561,        0,   115200, 0x58bc59bb
-0,      47105,      47105,        0,   115200, 0xd0273fdb
-0,      47776,      47776,        0,   115200, 0x6cc79700
-0,      48294,      48294,        0,   115200, 0xc8172d31
-0,      48960,      48960,        0,   115200, 0x8eb037ef
-0,      49504,      49504,        0,   115200, 0xc0bc2d76
-0,      50053,      50053,        0,   115200, 0x663c467a
-0,      50597,      50597,        0,   115200, 0xd085e950
-0,      51520,      51520,        0,   115200, 0x7d198d72
-0,      52092,      52092,        0,   115200, 0x6ebacda0
diff --git a/deps/libav/tests/ref/fate/mjpegb b/deps/libav/tests/ref/fate/mjpegb
deleted file mode 100644
index e4887f4..0000000
--- a/deps/libav/tests/ref/fate/mjpegb
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1200
-0,          0,          0,        0,    38400, 0x45311080
-0,        100,        100,        0,    38400, 0x9474f731
-0,        200,        200,        0,    38400, 0x429ebb12
-0,        300,        300,        0,    38400, 0x472c199a
-0,        400,        400,        0,    38400, 0xefd49dae
-0,        500,        500,        0,    38400, 0x78627fa9
-0,        600,        600,        0,    38400, 0x2a8d9148
-0,        700,        700,        0,    38400, 0x21cc6738
-0,        800,        800,        0,    38400, 0x0bc4703f
-0,        900,        900,        0,    38400, 0x1ddcc035
diff --git a/deps/libav/tests/ref/fate/motionpixels b/deps/libav/tests/ref/fate/motionpixels
deleted file mode 100644
index 97d8edf..0000000
--- a/deps/libav/tests/ref/fate/motionpixels
+++ /dev/null
@@ -1,112 +0,0 @@
-#tb 0: 66667/1000000
-0,          0,          0,        1,   230400, 0xee05b509
-0,          1,          1,        1,   230400, 0x71048964
-0,          2,          2,        1,   230400, 0x2ebe4ba1
-0,          3,          3,        1,   230400, 0xeedc45a6
-0,          4,          4,        1,   230400, 0x218e8656
-0,          5,          5,        1,   230400, 0x5792b17e
-0,          6,          6,        1,   230400, 0x51b0a062
-0,          7,          7,        1,   230400, 0x5dc4fd9c
-0,          8,          8,        1,   230400, 0x9b0261b1
-0,          9,          9,        1,   230400, 0x35086ffc
-0,         10,         10,        1,   230400, 0xcf9352ff
-0,         11,         11,        1,   230400, 0x0b5139a1
-0,         12,         12,        1,   230400, 0x22e8a31e
-0,         13,         13,        1,   230400, 0x82f61a81
-0,         14,         14,        1,   230400, 0xc5741ab5
-0,         15,         15,        1,   230400, 0xb5e7b2ff
-0,         16,         16,        1,   230400, 0x583289ca
-0,         17,         17,        1,   230400, 0xee52afbb
-0,         18,         18,        1,   230400, 0xfdb4dc1a
-0,         19,         19,        1,   230400, 0xf5ce99c0
-0,         20,         20,        1,   230400, 0xae222255
-0,         21,         21,        1,   230400, 0xc4f4439d
-0,         22,         22,        1,   230400, 0x1758f224
-0,         23,         23,        1,   230400, 0x5f517926
-0,         24,         24,        1,   230400, 0x73a8bed8
-0,         25,         25,        1,   230400, 0x7ef8410c
-0,         26,         26,        1,   230400, 0xfcb693c7
-0,         27,         27,        1,   230400, 0x5292832e
-0,         28,         28,        1,   230400, 0x591261d7
-0,         29,         29,        1,   230400, 0x28cca691
-0,         30,         30,        1,   230400, 0x22cf40ef
-0,         31,         31,        1,   230400, 0x517b10f9
-0,         32,         32,        1,   230400, 0x8197e939
-0,         33,         33,        1,   230400, 0x9654ffdb
-0,         34,         34,        1,   230400, 0x803f10dd
-0,         35,         35,        1,   230400, 0xff9f67af
-0,         36,         36,        1,   230400, 0x4847244c
-0,         37,         37,        1,   230400, 0xff31638f
-0,         38,         38,        1,   230400, 0x9692def5
-0,         39,         39,        1,   230400, 0x67f0a5fb
-0,         40,         40,        1,   230400, 0xce192074
-0,         41,         41,        1,   230400, 0x33d6c4a5
-0,         42,         42,        1,   230400, 0xaf7b5a03
-0,         43,         43,        1,   230400, 0xd956b0c0
-0,         44,         44,        1,   230400, 0x58ff1a65
-0,         45,         45,        1,   230400, 0x044758a1
-0,         46,         46,        1,   230400, 0xe8045b65
-0,         47,         47,        1,   230400, 0xf504c5fb
-0,         48,         48,        1,   230400, 0x17a9a2b0
-0,         49,         49,        1,   230400, 0xf68bab8c
-0,         50,         50,        1,   230400, 0xd06dd0cb
-0,         51,         51,        1,   230400, 0xc47d2673
-0,         52,         52,        1,   230400, 0x2112f291
-0,         53,         53,        1,   230400, 0x4c07c83c
-0,         54,         54,        1,   230400, 0x22ca0113
-0,         55,         55,        1,   230400, 0x25b0c8b1
-0,         56,         56,        1,   230400, 0xb6afc645
-0,         57,         57,        1,   230400, 0x663b1c09
-0,         58,         58,        1,   230400, 0x9006ef1f
-0,         59,         59,        1,   230400, 0x54f81b11
-0,         60,         60,        1,   230400, 0x456b79f2
-0,         61,         61,        1,   230400, 0xb08f24d0
-0,         62,         62,        1,   230400, 0x652ad875
-0,         63,         63,        1,   230400, 0xc6ecd67f
-0,         64,         64,        1,   230400, 0x78dad721
-0,         65,         65,        1,   230400, 0x1d2a4f71
-0,         66,         66,        1,   230400, 0xc71721d1
-0,         67,         67,        1,   230400, 0x64e3a7df
-0,         68,         68,        1,   230400, 0x3bb18e71
-0,         69,         69,        1,   230400, 0xb571d58c
-0,         70,         70,        1,   230400, 0xdae6ed5c
-0,         71,         71,        1,   230400, 0xdd91504b
-0,         72,         72,        1,   230400, 0xd5a807a5
-0,         73,         73,        1,   230400, 0x39a67b03
-0,         74,         74,        1,   230400, 0xe245c8ac
-0,         75,         75,        1,   230400, 0x5b0d7858
-0,         76,         76,        1,   230400, 0x501b8097
-0,         77,         77,        1,   230400, 0xf7b10d48
-0,         78,         78,        1,   230400, 0x769db0bd
-0,         79,         79,        1,   230400, 0x600f1086
-0,         80,         80,        1,   230400, 0x874f5565
-0,         81,         81,        1,   230400, 0x14322f73
-0,         82,         82,        1,   230400, 0x0eaa36a5
-0,         83,         83,        1,   230400, 0x97178d13
-0,         84,         84,        1,   230400, 0xd4c7a0d1
-0,         85,         85,        1,   230400, 0x1d424ec8
-0,         86,         86,        1,   230400, 0x695ad8d9
-0,         87,         87,        1,   230400, 0xe7cc3ecf
-0,         88,         88,        1,   230400, 0xfd25fd8c
-0,         89,         89,        1,   230400, 0xef4bc203
-0,         90,         90,        1,   230400, 0x2a113bec
-0,         91,         91,        1,   230400, 0x6e7ad403
-0,         92,         92,        1,   230400, 0xc6714d2b
-0,         93,         93,        1,   230400, 0x77df8ba6
-0,         94,         94,        1,   230400, 0xcd283106
-0,         95,         95,        1,   230400, 0xcb95676f
-0,         96,         96,        1,   230400, 0xb0b70393
-0,         97,         97,        1,   230400, 0x4c40bd63
-0,         98,         98,        1,   230400, 0x557e8ccf
-0,         99,         99,        1,   230400, 0x9d5934b2
-0,        100,        100,        1,   230400, 0x43c1793f
-0,        101,        101,        1,   230400, 0x0232361e
-0,        102,        102,        1,   230400, 0x92ed91e4
-0,        103,        103,        1,   230400, 0x99769789
-0,        104,        104,        1,   230400, 0xd49c2c5b
-0,        105,        105,        1,   230400, 0x66b03495
-0,        106,        106,        1,   230400, 0xb88a4658
-0,        107,        107,        1,   230400, 0x9c21e4c2
-0,        108,        108,        1,   230400, 0xb343f372
-0,        109,        109,        1,   230400, 0xf7f1e588
-0,        110,        110,        1,   230400, 0x9682bdb2
diff --git a/deps/libav/tests/ref/fate/mpc7-demux b/deps/libav/tests/ref/fate/mpc7-demux
deleted file mode 100644
index f7f2f6e..0000000
--- a/deps/libav/tests/ref/fate/mpc7-demux
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0xdeb152dd
diff --git a/deps/libav/tests/ref/fate/mpc8-demux b/deps/libav/tests/ref/fate/mpc8-demux
deleted file mode 100644
index 85b0aa4..0000000
--- a/deps/libav/tests/ref/fate/mpc8-demux
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x5cdeaf0c
diff --git a/deps/libav/tests/ref/fate/mpeg2-field-enc b/deps/libav/tests/ref/fate/mpeg2-field-enc
deleted file mode 100644
index e302536..0000000
--- a/deps/libav/tests/ref/fate/mpeg2-field-enc
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/90000
-0,      32400,      32400,        0,   622080, 0xb3b66c5c
-0,      36000,      36000,        0,   622080, 0x088ec02b
-0,      39600,      39600,        0,   622080, 0x7a36db21
-0,      43200,      43200,        0,   622080, 0x541b286f
-0,      46800,      46800,        0,   622080, 0xb6c3e590
-0,      50400,      50400,        0,   622080, 0x39dbed51
-0,      54000,      54000,        0,   622080, 0x973dc728
-0,      57600,      57600,        0,   622080, 0xd7a4f804
-0,      61200,      61200,        0,   622080, 0xa2484762
-0,      64800,      64800,        0,   622080, 0x0cd268d1
-0,      68400,      68400,        0,   622080, 0x72eb663d
-0,      72000,      72000,        0,   622080, 0x8fdbac59
-0,      75600,      75600,        0,   622080, 0xa6f4feb9
-0,      79200,      79200,        0,   622080, 0xadb828c6
-0,      82800,      82800,        0,   622080, 0xea630a63
-0,      86400,      86400,        0,   622080, 0xa901d925
-0,      90000,      90000,        0,   622080, 0xac5e7087
-0,      93600,      93600,        0,   622080, 0x10274a2b
-0,      97200,      97200,        0,   622080, 0x143d541c
-0,     100800,     100800,        0,   622080, 0xee94c93a
-0,     104400,     104400,        0,   622080, 0xca030208
-0,     108000,     108000,        0,   622080, 0x26f30ead
-0,     111600,     111600,        0,   622080, 0xfc22f32c
-0,     115200,     115200,        0,   622080, 0x940a5ff8
-0,     118800,     118800,        0,   622080, 0x2164f805
-0,     122400,     122400,        0,   622080, 0xa76f5aba
-0,     126000,     126000,        0,   622080, 0x8c311471
-0,     129600,     129600,        0,   622080, 0xa45e1d95
-0,     133200,     133200,        0,   622080, 0x6cc61d6c
-0,     136800,     136800,        0,   622080, 0x6983b417
diff --git a/deps/libav/tests/ref/fate/mpeg4-als-conformance-00 b/deps/libav/tests/ref/fate/mpeg4-als-conformance-00
deleted file mode 100644
index 84a14c4..0000000
--- a/deps/libav/tests/ref/fate/mpeg4-als-conformance-00
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x7e67db0b
diff --git a/deps/libav/tests/ref/fate/mpeg4-als-conformance-01 b/deps/libav/tests/ref/fate/mpeg4-als-conformance-01
deleted file mode 100644
index 84a14c4..0000000
--- a/deps/libav/tests/ref/fate/mpeg4-als-conformance-01
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x7e67db0b
diff --git a/deps/libav/tests/ref/fate/mpeg4-als-conformance-02 b/deps/libav/tests/ref/fate/mpeg4-als-conformance-02
deleted file mode 100644
index 84a14c4..0000000
--- a/deps/libav/tests/ref/fate/mpeg4-als-conformance-02
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x7e67db0b
diff --git a/deps/libav/tests/ref/fate/mpeg4-als-conformance-03 b/deps/libav/tests/ref/fate/mpeg4-als-conformance-03
deleted file mode 100644
index 84a14c4..0000000
--- a/deps/libav/tests/ref/fate/mpeg4-als-conformance-03
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x7e67db0b
diff --git a/deps/libav/tests/ref/fate/mpeg4-als-conformance-04 b/deps/libav/tests/ref/fate/mpeg4-als-conformance-04
deleted file mode 100644
index 84a14c4..0000000
--- a/deps/libav/tests/ref/fate/mpeg4-als-conformance-04
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x7e67db0b
diff --git a/deps/libav/tests/ref/fate/mpeg4-als-conformance-05 b/deps/libav/tests/ref/fate/mpeg4-als-conformance-05
deleted file mode 100644
index 84a14c4..0000000
--- a/deps/libav/tests/ref/fate/mpeg4-als-conformance-05
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x7e67db0b
diff --git a/deps/libav/tests/ref/fate/msmpeg4v1 b/deps/libav/tests/ref/fate/msmpeg4v1
deleted file mode 100644
index d67a0ef..0000000
--- a/deps/libav/tests/ref/fate/msmpeg4v1
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 100/2997
-0,          0,          0,        1,   126720, 0x84284323
-0,          1,          1,        1,   126720, 0x336fe236
-0,          2,          2,        1,   126720, 0x901f1299
-0,          3,          3,        1,   126720, 0x3b8be5fe
-0,          4,          4,        1,   126720, 0x6da06397
-0,          5,          5,        1,   126720, 0xe83de744
-0,          6,          6,        1,   126720, 0xef2ed2bb
-0,          7,          7,        1,   126720, 0x3ed1797f
-0,          8,          8,        1,   126720, 0xf8c81785
-0,          9,          9,        1,   126720, 0xf38239e0
-0,         10,         10,        1,   126720, 0x005a2d6d
-0,         11,         11,        1,   126720, 0xd6be525d
-0,         12,         12,        1,   126720, 0x39482727
-0,         13,         13,        1,   126720, 0xc8d95bc5
-0,         14,         14,        1,   126720, 0xbaebd1e7
-0,         15,         15,        1,   126720, 0xc94d60b3
-0,         16,         16,        1,   126720, 0x80886d64
-0,         17,         17,        1,   126720, 0xf99a39ee
-0,         18,         18,        1,   126720, 0xbc8b6c26
-0,         19,         19,        1,   126720, 0x2270acf1
-0,         20,         20,        1,   126720, 0x754b5965
-0,         21,         21,        1,   126720, 0x5312dc30
-0,         22,         22,        1,   126720, 0x2254cc6e
-0,         23,         23,        1,   126720, 0x58b4bdcc
-0,         24,         24,        1,   126720, 0xd1ed63ee
-0,         25,         25,        1,   126720, 0x4442dec5
-0,         26,         26,        1,   126720, 0x53403cef
-0,         27,         27,        1,   126720, 0x495d575f
-0,         28,         28,        1,   126720, 0x3ebfc7e8
-0,         29,         29,        1,   126720, 0x8f0abe01
-0,         30,         30,        1,   126720, 0x9540ba61
-0,         31,         31,        1,   126720, 0xb011e3cf
-0,         32,         32,        1,   126720, 0x70b4b1f4
-0,         33,         33,        1,   126720, 0x803b67f9
-0,         34,         34,        1,   126720, 0xa1c92662
-0,         35,         35,        1,   126720, 0x3a3d9e4c
-0,         36,         36,        1,   126720, 0x12660aa2
-0,         37,         37,        1,   126720, 0xb84c7602
-0,         38,         38,        1,   126720, 0x920df241
-0,         39,         39,        1,   126720, 0x5f9db168
-0,         40,         40,        1,   126720, 0xe3f524a6
-0,         41,         41,        1,   126720, 0x5f390fa7
-0,         42,         42,        1,   126720, 0xa9503b4f
-0,         43,         43,        1,   126720, 0x259c08e2
-0,         44,         44,        1,   126720, 0xef7a0279
-0,         45,         45,        1,   126720, 0x4d31ed35
-0,         46,         46,        1,   126720, 0xe10e3c7e
-0,         47,         47,        1,   126720, 0xc35f191e
-0,         48,         48,        1,   126720, 0x3401e9a9
-0,         49,         49,        1,   126720, 0xd50603f9
diff --git a/deps/libav/tests/ref/fate/msrle-8bit b/deps/libav/tests/ref/fate/msrle-8bit
deleted file mode 100644
index 5db1c24..0000000
--- a/deps/libav/tests/ref/fate/msrle-8bit
+++ /dev/null
@@ -1,30 +0,0 @@
-#tb 0: 83333/500000
-0,          0,          0,        1,    11520, 0xaf416a66
-0,          1,          1,        1,    11520, 0x8ab76654
-0,          2,          2,        1,    11520, 0xd22880c4
-0,          3,          3,        1,    11520, 0x9d2f612a
-0,          4,          4,        1,    11520, 0xf538600a
-0,          5,          5,        1,    11520, 0x371d64e6
-0,          6,          6,        1,    11520, 0x49043fbf
-0,          7,          7,        1,    11520, 0x49043fbf
-0,          8,          8,        1,    11520, 0x12d16528
-0,          9,          9,        1,    11520, 0x1e0a6109
-0,         10,         10,        1,    11520, 0x9d2f612a
-0,         11,         11,        1,    11520, 0x96e083ca
-0,         12,         12,        1,    11520, 0x8ab76654
-0,         13,         13,        1,    11520, 0x43ac6de7
-0,         14,         14,        1,    11520, 0x43ac6de7
-0,         15,         15,        1,    11520, 0x5c3e6819
-0,         16,         16,        1,    11520, 0x22758af0
-0,         17,         17,        1,    11520, 0x88845eba
-0,         18,         18,        1,    11520, 0x4b38848a
-0,         19,         19,        1,    11520, 0x4f7495d3
-0,         20,         20,        1,    11520, 0x736b702c
-0,         21,         21,        1,    11520, 0x736b702c
-0,         22,         22,        1,    11520, 0x4f7495d3
-0,         23,         23,        1,    11520, 0x4b38848a
-0,         24,         24,        1,    11520, 0x88845eba
-0,         25,         25,        1,    11520, 0x22758af0
-0,         26,         26,        1,    11520, 0x5c3e6819
-0,         27,         27,        1,    11520, 0x43ac6de7
-0,         28,         28,        1,    11520, 0x43ac6de7
diff --git a/deps/libav/tests/ref/fate/mss2-pal b/deps/libav/tests/ref/fate/mss2-pal
deleted file mode 100644
index ae8bd6f..0000000
--- a/deps/libav/tests/ref/fate/mss2-pal
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     9216, 0xd3c106ef
-0,        100,        100,        0,     9216, 0x8871f7c2
diff --git a/deps/libav/tests/ref/fate/mss2-pals b/deps/libav/tests/ref/fate/mss2-pals
deleted file mode 100644
index ae8bd6f..0000000
--- a/deps/libav/tests/ref/fate/mss2-pals
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     9216, 0xd3c106ef
-0,        100,        100,        0,     9216, 0x8871f7c2
diff --git a/deps/libav/tests/ref/fate/mss2-rgb555 b/deps/libav/tests/ref/fate/mss2-rgb555
deleted file mode 100644
index d15b3b4..0000000
--- a/deps/libav/tests/ref/fate/mss2-rgb555
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     6144, 0x4145b7ae
-0,        100,        100,        0,     6144, 0x3b2b38de
diff --git a/deps/libav/tests/ref/fate/mss2-rgb555s b/deps/libav/tests/ref/fate/mss2-rgb555s
deleted file mode 100644
index d15b3b4..0000000
--- a/deps/libav/tests/ref/fate/mss2-rgb555s
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     6144, 0x4145b7ae
-0,        100,        100,        0,     6144, 0x3b2b38de
diff --git a/deps/libav/tests/ref/fate/mss2-wmv b/deps/libav/tests/ref/fate/mss2-wmv
deleted file mode 100644
index d539c71..0000000
--- a/deps/libav/tests/ref/fate/mss2-wmv
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   230400, 0x00000000
-0,        233,        233,        0,   230400, 0xaf950008
-0,        299,        299,        0,   230400, 0x8d2a0010
-0,        366,        366,        0,   230400, 0xd75e0018
-0,        433,        433,        0,   230400, 0x00000000
-0,        499,        499,        0,   230400, 0x517f0008
-0,        566,        566,        0,   230400, 0xcf5a0010
-0,        633,        633,        0,   230400, 0x00000000
-0,        699,        699,        0,   230400, 0x40ef0018
-0,        766,        766,        0,   230400, 0xdc850008
-0,        833,        833,        0,   230400, 0x00000000
-0,        899,        899,        0,   230400, 0x09a40008
-0,        966,        966,        0,   230400, 0x00000000
-0,       1033,       1033,        0,   230400, 0x8b950008
-0,       1099,       1099,        0,   230400, 0xae260038
-0,       1166,       1166,        0,   230400, 0x6d850008
-0,       1233,       1233,        0,   230400, 0x00000000
-0,       1566,       1566,        0,   230400, 0x8b950008
-0,       1633,       1633,        0,   230400, 0x75450018
-0,       1699,       1699,        0,   230400, 0xb0dd0010
-0,       1766,       1766,        0,   230400, 0xecdd0018
-0,       1833,       1833,        0,   230400, 0x68e3f7f7
-0,       1899,       1899,        0,   230400, 0x9cfdcea6
-0,       1966,       1966,        0,   230400, 0x735ababf
-0,       2033,       2033,        0,   230400, 0xa1c604ea
-0,       2099,       2099,        0,   230400, 0x18a2f97a
-0,       2166,       2166,        0,   230400, 0xf9e82961
-0,       2233,       2233,        0,   230400, 0x57a8e9e8
-0,       2299,       2299,        0,   230400, 0xdef6fd66
-0,       2366,       2366,        0,   230400, 0xc7d923a9
-0,       2433,       2433,        0,   230400, 0x08bb41ee
-0,       2499,       2499,        0,   230400, 0x43ccbd29
-0,       2566,       2566,        0,   230400, 0x46666ee3
-0,       2633,       2633,        0,   230400, 0xbfd2ef29
-0,       2699,       2699,        0,   230400, 0x6504545f
-0,       2766,       2766,        0,   230400, 0x8fb86901
-0,       2833,       2833,        0,   230400, 0xc95f0917
-0,       2899,       2899,        0,   230400, 0x21f6a54b
-0,       2966,       2966,        0,   230400, 0xf808106b
-0,       3033,       3033,        0,   230400, 0x34150020
-0,       3099,       3099,        0,   230400, 0x50fdfe89
-0,       3166,       3166,        0,   230400, 0x920b7708
-0,       3233,       3233,        0,   230400, 0xed64fcc4
-0,       3299,       3299,        0,   230400, 0x6291a170
-0,       3366,       3366,        0,   230400, 0x20524643
-0,       3433,       3433,        0,   230400, 0x92aafecd
-0,       3499,       3499,        0,   230400, 0xf00ee14d
-0,       3566,       3566,        0,   230400, 0xfa3113ea
-0,       3633,       3633,        0,   230400, 0x99c06df1
-0,       3699,       3699,        0,   230400, 0x625c6918
-0,       3766,       3766,        0,   230400, 0xb277b25e
-0,       3833,       3833,        0,   230400, 0x2e913006
-0,       3899,       3899,        0,   230400, 0x3f6f1d99
-0,       3966,       3966,        0,   230400, 0x100ab60f
-0,       4033,       4033,        0,   230400, 0x9b73d0bf
-0,       4099,       4099,        0,   230400, 0xda0df2ce
-0,       4166,       4166,        0,   230400, 0x67f7ca24
-0,       4233,       4233,        0,   230400, 0xbde9b3d0
-0,       4299,       4299,        0,   230400, 0x92e14d07
-0,       4366,       4366,        0,   230400, 0x9426c3d9
-0,       4433,       4433,        0,   230400, 0x6104be70
-0,       4499,       4499,        0,   230400, 0xc4d1078a
-0,       4566,       4566,        0,   230400, 0x89426a42
-0,       4633,       4633,        0,   230400, 0x5271324a
-0,       4699,       4699,        0,   230400, 0x1cb1c735
-0,       4766,       4766,        0,   230400, 0x4249b8c6
-0,       4833,       4833,        0,   230400, 0x4b88cad3
-0,       4899,       4899,        0,   230400, 0x76af545d
-0,       4966,       4966,        0,   230400, 0xfe47e3c4
-0,       5033,       5033,        0,   230400, 0xa2e0e721
-0,       5099,       5099,        0,   230400, 0xde974a42
-0,       5166,       5166,        0,   230400, 0xe86a376b
-0,       5233,       5233,        0,   230400, 0xd52318fd
-0,       5299,       5299,        0,   230400, 0x0bbb1526
-0,       5366,       5366,        0,   230400, 0xa22c5e5e
-0,       5433,       5433,        0,   230400, 0x4532c5d2
-0,       5499,       5499,        0,   230400, 0x88b560ec
-0,       5566,       5566,        0,   230400, 0xcee9d9c9
-0,       5633,       5633,        0,   230400, 0x0429358f
-0,       5699,       5699,        0,   230400, 0xf18a9b98
-0,       5766,       5766,        0,   230400, 0x63f7a12c
-0,       5833,       5833,        0,   230400, 0x98635515
-0,       5899,       5899,        0,   230400, 0x36affebc
-0,       5966,       5966,        0,   230400, 0xd8c19629
-0,       6033,       6033,        0,   230400, 0x9ef5344d
-0,       6099,       6099,        0,   230400, 0x545668dc
-0,       6166,       6166,        0,   230400, 0x50e65e74
-0,       6233,       6233,        0,   230400, 0xe3258be3
-0,       6299,       6299,        0,   230400, 0xeb479e1b
-0,       6366,       6366,        0,   230400, 0x91894243
-0,       6433,       6433,        0,   230400, 0x3c5660fc
-0,       6499,       6499,        0,   230400, 0xf0c35673
-0,       6566,       6566,        0,   230400, 0x552832e8
-0,       6633,       6633,        0,   230400, 0x1970f2b1
-0,       6699,       6699,        0,   230400, 0x812d4c91
-0,       6766,       6766,        0,   230400, 0xa3fbd4ef
-0,       6833,       6833,        0,   230400, 0x486f9649
-0,       6899,       6899,        0,   230400, 0x850f315a
-0,       6966,       6966,        0,   230400, 0xc18ec66b
-0,       7033,       7033,        0,   230400, 0xc9ef266e
diff --git a/deps/libav/tests/ref/fate/msvideo1-16bit b/deps/libav/tests/ref/fate/msvideo1-16bit
deleted file mode 100644
index fffdea2..0000000
--- a/deps/libav/tests/ref/fate/msvideo1-16bit
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 33369/500000
-0,          0,          0,        1,    65712, 0x917e0076
-0,          1,          1,        1,    65712, 0xfe76fd1f
-0,          2,          2,        1,    65712, 0xd85820ee
-0,          3,          3,        1,    65712, 0x1b410f6e
-0,          4,          4,        1,    65712, 0x53c50436
-0,          5,          5,        1,    65712, 0xa191044d
-0,          6,          6,        1,    65712, 0xcf02ff1f
-0,          7,          7,        1,    65712, 0xc2abf85f
-0,          8,          8,        1,    65712, 0xe273087e
-0,          9,          9,        1,    65712, 0x087d0936
-0,         10,         10,        1,    65712, 0x4e4f2e96
-0,         11,         11,        1,    65712, 0x91b51896
-0,         12,         12,        1,    65712, 0x2798450e
-0,         13,         13,        1,    65712, 0x9fea1d06
-0,         14,         14,        1,    65712, 0xc64a2506
-0,         15,         15,        1,    65712, 0x0551fe07
-0,         16,         16,        1,    65712, 0xc64a042e
-0,         17,         17,        1,    65712, 0xf3680dc6
-0,         18,         18,        1,    65712, 0x2ea5356e
-0,         19,         19,        1,    65712, 0x0315ed3f
-0,         20,         20,        1,    65712, 0xc1d1f917
-0,         21,         21,        1,    65712, 0xc0f6e607
-0,         22,         22,        1,    65712, 0x5b0a092e
-0,         23,         23,        1,    65712, 0x1551f16f
-0,         24,         24,        1,    65712, 0x8440ee87
-0,         25,         25,        1,    65712, 0xf7581ae6
-0,         26,         26,        1,    65712, 0xee67037e
-0,         27,         27,        1,    65712, 0x4a212ca6
-0,         28,         28,        1,    65712, 0x693e0aa6
-0,         29,         29,        1,    65712, 0x13e31116
diff --git a/deps/libav/tests/ref/fate/msvideo1-8bit b/deps/libav/tests/ref/fate/msvideo1-8bit
deleted file mode 100644
index 74d54e8..0000000
--- a/deps/libav/tests/ref/fate/msvideo1-8bit
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 10000/300003
-0,          0,          0,        1,    57600, 0x8c3c5ee8
-0,          1,          1,        1,    57600, 0xb79800b1
-0,          2,          2,        1,    57600, 0x54a221be
-0,          3,          3,        1,    57600, 0xb377ffb3
-0,          4,          4,        1,    57600, 0x46efd210
-0,          5,          5,        1,    57600, 0x46efd210
-0,          6,          6,        1,    57600, 0x46efd210
-0,          7,          7,        1,    57600, 0x92751fbc
-0,          8,          8,        1,    57600, 0xd7287442
-0,          9,          9,        1,    57600, 0xcf1153ee
-0,         10,         10,        1,    57600, 0xda5de91a
-0,         11,         11,        1,    57600, 0xa11cd513
-0,         12,         12,        1,    57600, 0xa8edac2a
-0,         13,         13,        1,    57600, 0xefd2a392
-0,         14,         14,        1,    57600, 0x2d7060cf
-0,         15,         15,        1,    57600, 0xbda3130d
-0,         16,         16,        1,    57600, 0xacb8e940
-0,         17,         17,        1,    57600, 0x93778985
-0,         18,         18,        1,    57600, 0x25ed4d97
-0,         19,         19,        1,    57600, 0x5be924bf
-0,         20,         20,        1,    57600, 0xde5ee1f7
-0,         21,         21,        1,    57600, 0x39850ab6
-0,         22,         22,        1,    57600, 0x77da195d
-0,         23,         23,        1,    57600, 0x6dad13c0
-0,         24,         24,        1,    57600, 0x69897c48
-0,         25,         25,        1,    57600, 0xfbe74728
-0,         26,         26,        1,    57600, 0x908af79d
-0,         27,         27,        1,    57600, 0x4ec4a868
-0,         28,         28,        1,    57600, 0x7db370a1
-0,         29,         29,        1,    57600, 0x2b1e52f6
diff --git a/deps/libav/tests/ref/fate/mszh b/deps/libav/tests/ref/fate/mszh
deleted file mode 100644
index 4ff76ff..0000000
--- a/deps/libav/tests/ref/fate/mszh
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 100/2997
-0,          0,          0,        1,   253440, 0x94af61e5
diff --git a/deps/libav/tests/ref/fate/mtv b/deps/libav/tests/ref/fate/mtv
deleted file mode 100644
index 4f8f616..0000000
--- a/deps/libav/tests/ref/fate/mtv
+++ /dev/null
@@ -1,138 +0,0 @@
-#tb 0: 1/16
-#tb 1: 1/44100
-0,          0,          0,        1,    12288, 0xc2258ebc
-1,          0,          0,     1152,      417, 0xae1cc66a
-1,       1152,       1152,     1152,      418, 0xdc3ec850
-1,       2304,       2304,     1152,      418, 0x4e8ed05f
-0,          1,          1,        1,    12288, 0xc2258ebc
-1,       3456,       3456,     1152,      418, 0xeb43d574
-1,       4608,       4608,     1152,      418, 0x9357c91d
-0,          2,          2,        1,    12288, 0xb3fe829c
-1,       5760,       5760,     1152,      418, 0x5306d16b
-1,       6912,       6912,     1152,      418, 0x46e0d4da
-1,       8064,       8064,     1152,      418, 0xac11ce79
-0,          3,          3,        1,    12288, 0x2315884a
-1,       9216,       9216,     1152,      418, 0xffdfc4ad
-1,      10368,      10368,     1152,      418, 0xf8a8c2ff
-0,          4,          4,        1,    12288, 0x95a08046
-1,      11520,      11520,     1152,      418, 0x2d66d83f
-1,      12672,      12672,     1152,      418, 0x65c0da12
-0,          5,          5,        1,    12288, 0xdb49886b
-1,      13824,      13824,     1152,      418, 0x0eafd20f
-1,      14976,      14976,     1152,      418, 0x8c6dd949
-1,      16128,      16128,     1152,      418, 0x9094c02d
-0,          6,          6,        1,    12288, 0xdb49886b
-1,      17280,      17280,     1152,      418, 0xb47bd944
-1,      18432,      18432,     1152,      418, 0x935ccce7
-0,          7,          7,        1,    12288, 0xdb49886b
-1,      19584,      19584,     1152,      418, 0x6e3ed020
-1,      20736,      20736,     1152,      418, 0x8922cd6c
-1,      21888,      21888,     1152,      418, 0xe811c8f8
-0,          8,          8,        1,    12288, 0xdb49886b
-1,      23040,      23040,     1152,      418, 0xb84adc72
-1,      24192,      24192,     1152,      418, 0xa2bbc5f4
-0,          9,          9,        1,    12288, 0xdb49886b
-1,      25344,      25344,     1152,      418, 0xec0cb67d
-1,      26496,      26496,     1152,      418, 0x89d1d014
-0,         10,         10,        1,    12288, 0xdb49886b
-1,      27648,      27648,     1152,      418, 0xfb5bc872
-1,      28800,      28800,     1152,      417, 0x8bfcc7a0
-1,      29952,      29952,     1152,      418, 0xeb4ac61b
-0,         11,         11,        1,    12288, 0xdb49886b
-1,      31104,      31104,     1152,      418, 0xd3cbc3c4
-1,      32256,      32256,     1152,      418, 0xa272d092
-0,         12,         12,        1,    12288, 0xdb49886b
-1,      33408,      33408,     1152,      418, 0x611ec37e
-1,      34560,      34560,     1152,      418, 0x70a3d423
-1,      35712,      35712,     1152,      418, 0xeff9ccf4
-0,         13,         13,        1,    12288, 0xdb49886b
-1,      36864,      36864,     1152,      418, 0x9788c65b
-1,      38016,      38016,     1152,      418, 0xe9a8cb8c
-0,         14,         14,        1,    12288, 0xdb49886b
-1,      39168,      39168,     1152,      418, 0x5834c300
-1,      40320,      40320,     1152,      418, 0xa4b8cd3a
-0,         15,         15,        1,    12288, 0xdb49886b
-1,      41472,      41472,     1152,      418, 0x6de2c7f9
-1,      42624,      42624,     1152,      418, 0x961bbbf3
-1,      43776,      43776,     1152,      418, 0x53edc13a
-0,         16,         16,        1,    12288, 0x95a08046
-1,      44928,      44928,     1152,      418, 0x2fedc4b0
-1,      46080,      46080,     1152,      418, 0xb756c18b
-0,         17,         17,        1,    12288, 0xdb49886b
-1,      47232,      47232,     1152,      418, 0xaf0ed0e4
-1,      48384,      48384,     1152,      418, 0x019fd3f0
-1,      49536,      49536,     1152,      418, 0x6e29d83e
-0,         18,         18,        1,    12288, 0x95a08046
-1,      50688,      50688,     1152,      418, 0x2ddad6bb
-1,      51840,      51840,     1152,      418, 0xafefca99
-0,         19,         19,        1,    12288, 0xdb49886b
-1,      52992,      52992,     1152,      418, 0x366ed013
-1,      54144,      54144,     1152,      418, 0x532ac7e0
-0,         20,         20,        1,    12288, 0x95a08046
-1,      55296,      55296,     1152,      418, 0x1d0cd1ce
-1,      56448,      56448,     1152,      417, 0x572ad1e3
-1,      57600,      57600,     1152,      418, 0x858cd91f
-0,         21,         21,        1,    12288, 0xdb49886b
-1,      58752,      58752,     1152,      418, 0x82cacdfd
-1,      59904,      59904,     1152,      418, 0xf4dcc6ed
-0,         22,         22,        1,    12288, 0x95a08046
-1,      61056,      61056,     1152,      418, 0x2cf3ca72
-1,      62208,      62208,     1152,      418, 0x5963c859
-1,      63360,      63360,     1152,      418, 0xa667c53d
-0,         23,         23,        1,    12288, 0xdb49886b
-1,      64512,      64512,     1152,      418, 0xb2f1d09c
-1,      65664,      65664,     1152,      418, 0x2ec1c8d3
-0,         24,         24,        1,    12288, 0xdb49886b
-1,      66816,      66816,     1152,      418, 0x5754d2e8
-1,      67968,      67968,     1152,      418, 0x1956bdba
-0,         25,         25,        1,    12288, 0xdb49886b
-1,      69120,      69120,     1152,      418, 0x3e18bd55
-1,      70272,      70272,     1152,      418, 0xe4cfc339
-1,      71424,      71424,     1152,      418, 0xb426c835
-0,         26,         26,        1,    12288, 0xdb49886b
-1,      72576,      72576,     1152,      418, 0xd7b6cbcf
-1,      73728,      73728,     1152,      418, 0x340ec315
-0,         27,         27,        1,    12288, 0xdb49886b
-1,      74880,      74880,     1152,      418, 0x23a9baec
-1,      76032,      76032,     1152,      418, 0x9f04cd01
-0,         28,         28,        1,    12288, 0xdb49886b
-1,      77184,      77184,     1152,      418, 0xa80ec223
-1,      78336,      78336,     1152,      418, 0x23d6bd5d
-1,      79488,      79488,     1152,      418, 0xcb25cf5b
-0,         29,         29,        1,    12288, 0xdb49886b
-1,      80640,      80640,     1152,      418, 0xccccc217
-1,      81792,      81792,     1152,      418, 0x757abbfe
-0,         30,         30,        1,    12288, 0xdb49886b
-1,      82944,      82944,     1152,      418, 0xa2e6cc68
-1,      84096,      84096,     1152,      418, 0xdf77cc05
-1,      85248,      85248,     1152,      417, 0xe9d2c5d5
-0,         31,         31,        1,    12288, 0xdb49886b
-1,      86400,      86400,     1152,      418, 0x50dec174
-1,      87552,      87552,     1152,      418, 0xf654b27e
-0,         32,         32,        1,    12288, 0x95a08046
-1,      88704,      88704,     1152,      418, 0x4d8bc26e
-1,      89856,      89856,     1152,      418, 0xccd2bf37
-0,         33,         33,        1,    12288, 0xdb49886b
-1,      91008,      91008,     1152,      418, 0x6ce2c18a
-1,      92160,      92160,     1152,      418, 0xb3cdcf0c
-1,      93312,      93312,     1152,      418, 0x55eebe9a
-0,         34,         34,        1,    12288, 0x95a08046
-1,      94464,      94464,     1152,      418, 0x9031c9ec
-1,      95616,      95616,     1152,      418, 0xb037c49d
-0,         35,         35,        1,    12288, 0xdb49886b
-1,      96768,      96768,     1152,      418, 0x377bcc78
-1,      97920,      97920,     1152,      418, 0x3762c725
-1,      99072,      99072,     1152,      418, 0x39afbd4d
-0,         36,         36,        1,    12288, 0x95a08046
-1,     100224,     100224,     1152,      418, 0x655ed6cd
-1,     101376,     101376,     1152,      418, 0x09aec202
-0,         37,         37,        1,    12288, 0xdb49886b
-1,     102528,     102528,     1152,      418, 0xf2d2ce55
-1,     103680,     103680,     1152,      418, 0x254ebf04
-0,         38,         38,        1,    12288, 0x95a08046
-1,     104832,     104832,     1152,      418, 0xa105cdcc
-1,     105984,     105984,     1152,      418, 0x1477ba58
-1,     107136,     107136,     1152,      418, 0x8d0dcdb2
-0,         39,         39,        1,     3584, 0x0354c435
-1,     108288,     108288,     1152,      418, 0x0d7cbef4
-1,     109440,     109440,     1152,      294, 0x5e2b87c4
diff --git a/deps/libav/tests/ref/fate/mxf-demux b/deps/libav/tests/ref/fate/mxf-demux
deleted file mode 100644
index 426afae..0000000
--- a/deps/libav/tests/ref/fate/mxf-demux
+++ /dev/null
@@ -1,99 +0,0 @@
-#tb 0: 1/25
-#tb 1: 1/8000
-0,          0, -9223372036854775808,        1,     8468, 0xc0855553
-1,          0,          0,    16000,    32000, 0x479155e6
-0,          1, -9223372036854775808,        1,     3814, 0xa10783b4
-0,          2, -9223372036854775808,        1,     3747, 0xb7bf6973
-0,          3, -9223372036854775808,        1,     3705, 0x5462a600
-0,          4, -9223372036854775808,        1,     3704, 0x1e564943
-0,          5, -9223372036854775808,        1,     3760, 0x10464b9a
-0,          6, -9223372036854775808,        1,     3799, 0xd41d6dcf
-0,          7, -9223372036854775808,        1,     3832, 0x5cf6999e
-0,          8, -9223372036854775808,        1,     3778, 0xe5fc7b9e
-0,          9, -9223372036854775808,        1,    38193, 0xd34e5dd4
-0,         10, -9223372036854775808,        1,     8520, 0x2a203e68
-0,         11, -9223372036854775808,        1,     3832, 0xe4c4b2fe
-0,         12, -9223372036854775808,        1,     3787, 0x0cf95fee
-0,         13, -9223372036854775808,        1,     3766, 0x9e019d14
-0,         14, -9223372036854775808,        1,     3785, 0x0ea9ae75
-0,         15, -9223372036854775808,        1,     3703, 0x11d349ff
-0,         16, -9223372036854775808,        1,     3731, 0x5cf358ef
-0,         17, -9223372036854775808,        1,     3785, 0x01c8962f
-0,         18, -9223372036854775808,        1,     3741, 0xb2c47d53
-0,         19, -9223372036854775808,        1,    38150, 0x08fa1f55
-0,         20, -9223372036854775808,        1,     8487, 0x0c234b9a
-0,         21, -9223372036854775808,        1,     3791, 0x831192ef
-0,         22, -9223372036854775808,        1,     3612, 0x598944fb
-0,         23, -9223372036854775808,        1,     3710, 0xccbb711a
-0,         24, -9223372036854775808,        1,     3864, 0x4385966e
-0,         25, -9223372036854775808,        1,     3919, 0x24e2abc3
-0,         26, -9223372036854775808,        1,     3777, 0x210c6219
-0,         27, -9223372036854775808,        1,     3811, 0x23bf68c2
-0,         28, -9223372036854775808,        1,     3802, 0x52688862
-0,         29, -9223372036854775808,        1,    38027, 0x3d5aa8b9
-0,         30, -9223372036854775808,        1,     8333, 0x617de950
-0,         31, -9223372036854775808,        1,     3831, 0x13fad8fc
-0,         32, -9223372036854775808,        1,     3719, 0xbc317470
-0,         33, -9223372036854775808,        1,     3761, 0xeac460b6
-0,         34, -9223372036854775808,        1,     3637, 0x27d64b32
-0,         35, -9223372036854775808,        1,     3666, 0xf0f700a5
-0,         36, -9223372036854775808,        1,     3788, 0x1c4662a8
-0,         37, -9223372036854775808,        1,     3960, 0xef6b9e99
-0,         38, -9223372036854775808,        1,     3793, 0x3a6ca832
-0,         39, -9223372036854775808,        1,    38312, 0xce1317cc
-0,         40, -9223372036854775808,        1,     8548, 0x4ca944d4
-0,         41, -9223372036854775808,        1,     3866, 0x4e85bf0f
-0,         42, -9223372036854775808,        1,     3644, 0x030338e5
-0,         43, -9223372036854775808,        1,     3634, 0xa95f4512
-0,         44, -9223372036854775808,        1,     3925, 0x7583ba86
-0,         45, -9223372036854775808,        1,     3675, 0x979f423f
-0,         46, -9223372036854775808,        1,     3703, 0x11375f7a
-0,         47, -9223372036854775808,        1,     3705, 0xb7de5d16
-0,         48, -9223372036854775808,        1,     3688, 0x1db45852
-0,         49, -9223372036854775808,        1,    38412, 0x2ee26a63
-0,         50, -9223372036854775808,        1,     8385, 0x0bc20a27
-1,      16000,      16000,    16000,    32000, 0x8f7e5009
-0,         51, -9223372036854775808,        1,     3733, 0xa3e2a9a0
-0,         52, -9223372036854775808,        1,     3773, 0x27769caa
-0,         53, -9223372036854775808,        1,     3670, 0xc8335e98
-0,         54, -9223372036854775808,        1,     3596, 0xd6512fb0
-0,         55, -9223372036854775808,        1,     3579, 0xa621fbc2
-0,         56, -9223372036854775808,        1,     3641, 0x2f4f46ca
-0,         57, -9223372036854775808,        1,     3686, 0x0a92385a
-0,         58, -9223372036854775808,        1,     3672, 0xe65137b9
-0,         59, -9223372036854775808,        1,    39065, 0xc723bf8b
-0,         60, -9223372036854775808,        1,     8611, 0x5d177f40
-0,         61, -9223372036854775808,        1,     3758, 0x33d59966
-0,         62, -9223372036854775808,        1,     3674, 0x54f37902
-0,         63, -9223372036854775808,        1,     3615, 0xa0f045fa
-0,         64, -9223372036854775808,        1,     3719, 0x41cf93ff
-0,         65, -9223372036854775808,        1,     3757, 0x3a1b7e8f
-0,         66, -9223372036854775808,        1,     3762, 0xe7f9714d
-0,         67, -9223372036854775808,        1,     3738, 0x8121805b
-0,         68, -9223372036854775808,        1,     3733, 0x13e262db
-0,         69, -9223372036854775808,        1,    38433, 0x3d58c500
-0,         70, -9223372036854775808,        1,     8410, 0xa4f7fd2e
-0,         71, -9223372036854775808,        1,     3711, 0x0e112d3c
-0,         72, -9223372036854775808,        1,     3692, 0xb46574b2
-0,         73, -9223372036854775808,        1,     3563, 0xad43343d
-0,         74, -9223372036854775808,        1,     3613, 0x5cd85c4f
-0,         75, -9223372036854775808,        1,     3653, 0xe15a2853
-0,         76, -9223372036854775808,        1,     3684, 0x9ddd58cb
-0,         77, -9223372036854775808,        1,     3256, 0xd7f89f2e
-0,         78, -9223372036854775808,        1,     3698, 0x2b82624a
-0,         79, -9223372036854775808,        1,    39520, 0xd3f2b7c5
-0,         80, -9223372036854775808,        1,     8493, 0x163559be
-0,         81, -9223372036854775808,        1,     3719, 0x6fa0916f
-0,         82, -9223372036854775808,        1,     3655, 0xa9233de1
-0,         83, -9223372036854775808,        1,     3684, 0xa6125737
-0,         84, -9223372036854775808,        1,     3688, 0xa9da6686
-0,         85, -9223372036854775808,        1,     3685, 0x674d634e
-0,         86, -9223372036854775808,        1,     3677, 0x7a85535d
-0,         87, -9223372036854775808,        1,     3666, 0xce3600a2
-0,         88, -9223372036854775808,        1,     3837, 0x3a7090e1
-0,         89, -9223372036854775808,        1,    38696, 0x12c59cd2
-0,         90, -9223372036854775808,        1,     8022, 0xd343433f
-0,         91, -9223372036854775808,        1,     5157, 0x440c14e5
-0,         92, -9223372036854775808,        1,     5003, 0xf8e1daff
-0,         93, -9223372036854775808,        1,     4954, 0x89866344
-0,         94, -9223372036854775808,        1,    53664, 0xeb0c4c42
diff --git a/deps/libav/tests/ref/fate/nc-demux b/deps/libav/tests/ref/fate/nc-demux
deleted file mode 100644
index 1d00f8e..0000000
--- a/deps/libav/tests/ref/fate/nc-demux
+++ /dev/null
@@ -1,92 +0,0 @@
-#tb 0: 1/100
-0,          0, -9223372036854775808,        1,    19787, 0x75e463f3
-0,          1, -9223372036854775808,        1,    11913, 0x0f429c34
-0,          2, -9223372036854775808,        1,    14225, 0xbd3c704c
-0,          3, -9223372036854775808,        1,    10357, 0xbf232393
-0,          4, -9223372036854775808,        1,     9595, 0xf565d39e
-0,          5, -9223372036854775808,        1,     9262, 0x2afd6ce0
-0,          6, -9223372036854775808,        1,    12214, 0x6ae81d9b
-0,          7, -9223372036854775808,        1,    13920, 0x31b5b307
-0,          8, -9223372036854775808,        1,    10164, 0x141eca4e
-0,          9, -9223372036854775808,        1,     9516, 0xd5f2c42b
-0,         10, -9223372036854775808,        1,    10006, 0x80850a76
-0,         11, -9223372036854775808,        1,    11791, 0x10bc2dcd
-0,         12, -9223372036854775808,        1,    13756, 0xda1fee08
-0,         13, -9223372036854775808,        1,    10452, 0xbb3d62b0
-0,         14, -9223372036854775808,        1,     9171, 0x64ae10f6
-0,         15, -9223372036854775808,        1,     8816, 0x31ad8fcb
-0,         16, -9223372036854775808,        1,    13168, 0xea1085ac
-0,         17, -9223372036854775808,        1,    12797, 0x25143d22
-0,         18, -9223372036854775808,        1,    11324, 0x3a54b38e
-0,         19, -9223372036854775808,        1,     9173, 0x8b2bf552
-0,         20, -9223372036854775808,        1,     9247, 0x2e87226b
-0,         21, -9223372036854775808,        1,    14140, 0x1063786c
-0,         22, -9223372036854775808,        1,    14437, 0xde123a17
-0,         23, -9223372036854775808,        1,    11938, 0x3f1168f4
-0,         24, -9223372036854775808,        1,    11966, 0xdd6786ec
-0,         25, -9223372036854775808,        1,    13213, 0x8ab27c58
-0,         26, -9223372036854775808,        1,    11843, 0x90415d8b
-0,         27, -9223372036854775808,        1,    13345, 0x3c0e1793
-0,         28, -9223372036854775808,        1,     9977, 0x74fc7f4b
-0,         29, -9223372036854775808,        1,     9158, 0x0b5426a5
-0,         30, -9223372036854775808,        1,    12715, 0x0035d569
-0,         31, -9223372036854775808,        1,    19944, 0xe2887ba8
-0,         32, -9223372036854775808,        1,    12762, 0xb0f17939
-0,         33, -9223372036854775808,        1,    10260, 0x182b27aa
-0,         34, -9223372036854775808,        1,     7405, 0x227fe9bf
-0,         35, -9223372036854775808,        1,    13317, 0x1a678c62
-0,         36, -9223372036854775808,        1,    11304, 0x3277af6d
-0,         37, -9223372036854775808,        1,    13291, 0xe267616a
-0,         38, -9223372036854775808,        1,     8975, 0xe7eeacea
-0,         39, -9223372036854775808,        1,     8473, 0x8bb1cbff
-0,         40, -9223372036854775808,        1,    13878, 0xfd3d55bb
-0,         41, -9223372036854775808,        1,    11278, 0x61c7c55e
-0,         42, -9223372036854775808,        1,    13785, 0x2acbf88f
-0,         43, -9223372036854775808,        1,     9521, 0x99e2d065
-0,         44, -9223372036854775808,        1,     9340, 0xe5c96510
-0,         45, -9223372036854775808,        1,    12777, 0x4c3c7844
-0,         46, -9223372036854775808,        1,    10685, 0x39e0f42e
-0,         47, -9223372036854775808,        1,    14237, 0x9398d07f
-0,         48, -9223372036854775808,        1,     9021, 0x3343c7ec
-0,         49, -9223372036854775808,        1,     9327, 0xad489e86
-0,         50, -9223372036854775808,        1,    13507, 0xb1344f1c
-0,         51, -9223372036854775808,        1,    10199, 0x9a8868bf
-0,         52, -9223372036854775808,        1,    14535, 0xddb13f41
-0,         53, -9223372036854775808,        1,     8773, 0x3d8b6a79
-0,         54, -9223372036854775808,        1,    16084, 0x5d915de4
-0,         55, -9223372036854775808,        1,     9156, 0x5cb08a6a
-0,         56, -9223372036854775808,        1,    15027, 0xc23b1dc8
-0,         57, -9223372036854775808,        1,     8240, 0xd6d3526c
-0,         58, -9223372036854775808,        1,     8720, 0x439c43bf
-0,         59, -9223372036854775808,        1,    13684, 0x18fc82f0
-0,         60, -9223372036854775808,        1,     8829, 0xa3ebeb30
-0,         61, -9223372036854775808,        1,    14650, 0x99e8678c
-0,         62, -9223372036854775808,        1,    19626, 0x80a7ee5c
-0,         63, -9223372036854775808,        1,     7762, 0x7c209a12
-0,         64, -9223372036854775808,        1,    13636, 0xc89c1aa3
-0,         65, -9223372036854775808,        1,     8337, 0x749bf76a
-0,         66, -9223372036854775808,        1,    15098, 0xc98bc6dc
-0,         67, -9223372036854775808,        1,     9070, 0xcd4cf7f1
-0,         68, -9223372036854775808,        1,     8269, 0x90e95d54
-0,         69, -9223372036854775808,        1,    12672, 0x034888d0
-0,         70, -9223372036854775808,        1,     7519, 0x6c089672
-0,         71, -9223372036854775808,        1,    14439, 0x5d2478b9
-0,         72, -9223372036854775808,        1,     6928, 0x98fbaa67
-0,         73, -9223372036854775808,        1,     8735, 0x07643f1e
-0,         74, -9223372036854775808,        1,    13522, 0x55034cdb
-0,         75, -9223372036854775808,        1,     7807, 0xf5983103
-0,         76, -9223372036854775808,        1,    14484, 0xfc9cf260
-0,         77, -9223372036854775808,        1,     7193, 0x170a0fa1
-0,         78, -9223372036854775808,        1,     9444, 0x6f9be36f
-0,         79, -9223372036854775808,        1,    12598, 0x69b7609d
-0,         80, -9223372036854775808,        1,     7650, 0x1abaec9e
-0,         81, -9223372036854775808,        1,    15162, 0x2a87f723
-0,         82, -9223372036854775808,        1,     7752, 0xcca248aa
-0,         83, -9223372036854775808,        1,     9085, 0x1ca7d7e5
-0,         84, -9223372036854775808,        1,    13187, 0xababcc64
-0,         85, -9223372036854775808,        1,     7968, 0x64a28f46
-0,         86, -9223372036854775808,        1,    15474, 0xf34c587c
-0,         87, -9223372036854775808,        1,     8615, 0x61301034
-0,         88, -9223372036854775808,        1,    14129, 0x42c88bea
-0,         89, -9223372036854775808,        1,     7223, 0x675d7500
-0,         90, -9223372036854775808,        1,     3072, 0x4cb6254c
diff --git a/deps/libav/tests/ref/fate/noproxy b/deps/libav/tests/ref/fate/noproxy
deleted file mode 100644
index 7707609..0000000
--- a/deps/libav/tests/ref/fate/noproxy
+++ /dev/null
@@ -1,9 +0,0 @@
-The pattern "(null)" does not match the hostname domain.com
-The pattern "example.com domain.com" matches the hostname domain.com
-The pattern "example.com other.com" does not match the hostname domain.com
-The pattern "example.com,domain.com" matches the hostname domain.com
-The pattern "example.com,domain.com" does not match the hostname otherdomain.com
-The pattern "example.com, *.domain.com" matches the hostname sub.domain.com
-The pattern "example.com, *.domain.com" matches the hostname domain.com
-The pattern "example.com, .domain.com" matches the hostname domain.com
-The pattern "*" matches the hostname domain.com
diff --git a/deps/libav/tests/ref/fate/nsv-demux b/deps/libav/tests/ref/fate/nsv-demux
deleted file mode 100644
index 0f09446..0000000
--- a/deps/libav/tests/ref/fate/nsv-demux
+++ /dev/null
@@ -1,173 +0,0 @@
-#tb 0: 1001/15000
-#tb 1: 1/30000000
-0,          0,          0,        1,       12, 0x1396035f
-0,          1,          1,        1,       24, 0x8ab80ac7
-0,          2,          2,        1,      208, 0x1de1603e
-1,    4173848,    4173848,  1567346,      104, 0x8ae85dc9
-1,    5741194,    5741194,  1567346,      105, 0xb7033847
-0,          3,          3,        1,      364, 0xffb4b341
-1,    7308540,    7308540,  1567346,      104, 0x5f853482
-0,          4,          4,        1,      456, 0x7a4deaeb
-1,    8875886,    8875886,  1567346,      105, 0xfcb731fd
-0,          5,          5,        1,      432, 0xf4ddd813
-1,   10443232,   10443232,  1567346,      104, 0x4f8232bb
-1,   12010578,   12010578,  1567346,      105, 0x2f543039
-0,          6,          6,        1,      572, 0xc84c21ff
-1,   13577924,   13577924,  1567346,      104, 0xe4cc34a1
-0,          7,          7,        1,      500, 0x0e6bf9f4
-1,   15145270,   15145270,  1567346,      105, 0xea663711
-0,          8,          8,        1,      508, 0x2d6efe2a
-1,   16712616,   16712616,  1567346,      104, 0x3c583098
-0,          9,          9,        1,      436, 0x7d07d3c5
-1,   18279962,   18279962,  1567346,      105, 0xbe6c33ff
-1,   19847308,   19847308,  1567346,      104, 0x56de2d7a
-0,         10,         10,        1,      620, 0xa9313342
-1,   21414654,   21414654,  1567346,      105, 0x4e80385d
-0,         11,         11,        1,     1384, 0x9b97c579
-1,   22982000,   22982000,  1567346,      104, 0x34eb340d
-0,         12,         12,        1,      760, 0xd1aa8183
-1,   24549346,   24549346,  1567346,      105, 0x87e82f74
-0,         13,         13,        1,      836, 0x261da980
-1,   26116692,   26116692,  1567346,      104, 0xa546377d
-1,   27684038,   27684038,  1567346,      105, 0x92bd349d
-0,         14,         14,        1,      860, 0x52f0afa0
-1,   29251384,   29251384,  1567346,      104, 0xdba53f3d
-0,         15,         15,        1,      696, 0x63845855
-1,   30818730,   30818730,  1567346,      105, 0xd3c3384e
-0,         16,         16,        1,      460, 0x2916e7be
-1,   32386076,   32386076,  1567346,      104, 0xdf7d30ce
-1,   33953422,   33953422,  1567346,      105, 0xae20344e
-0,         17,         17,        1,      328, 0xab8caaca
-1,   35520768,   35520768,  1567346,      104, 0xe4cc33b7
-0,         18,         18,        1,      396, 0xc775bc8e
-1,   37088114,   37088114,  1567346,      105, 0xda993806
-0,         19,         19,        1,      344, 0x114ea25a
-1,   38655460,   38655460,  1567346,      104, 0xd6d12edd
-1,   40222806,   40222806,  1567346,      105, 0x6b9c2ed5
-1,   41790152,   41790152,  1567346,      104, 0xce6c3b04
-0,         21,         21,        1,      532, 0xd5650f54
-1,   43357498,   43357498,  1567346,      105, 0x31db399e
-1,   44924844,   44924844,  1567346,      104, 0xd50b347a
-0,         23,         23,        1,      476, 0x77f1f3a7
-1,   46492190,   46492190,  1567346,      105, 0xe87734d6
-1,   48059536,   48059536,  1567346,      104, 0x21873412
-0,         25,         25,        1,      976, 0x2f7cf7ae
-1,   50140000,   50140000,  1567346,      105, 0x29c03514
-1,   51707346,   51707346,  1567346,      104, 0x91a5347a
-1,   53274692,   53274692,  1567346,      105, 0xdbbf3696
-0,         27,         27,        1,      104, 0x8fbf2f65
-1,   54842038,   54842038,  1567346,      104, 0x3b463afc
-1,   56409384,   56409384,  1567346,      105, 0xddf53845
-1,   57976730,   57976730,  1567346,      104, 0x94c23d1a
-0,         29,         29,        1,      652, 0xa9244ac0
-1,   59544076,   59544076,  1567346,      105, 0xc0fd36c4
-1,   61111422,   61111422,  1567346,      104, 0x36d535e0
-0,         31,         31,        1,      152, 0x97804cc1
-1,   62678768,   62678768,  1567346,      105, 0xe81a35da
-1,   64246114,   64246114,  1567346,      104, 0x2b4e3699
-1,   65813460,   65813460,  1567346,      105, 0x3978392c
-0,         33,         33,        1,      156, 0xca434d31
-1,   67380806,   67380806,  1567346,      104, 0xca903459
-0,         34,         34,        1,      196, 0x1ff16161
-1,   68948152,   68948152,  1567346,      105, 0xedc4374a
-0,         35,         35,        1,      176, 0x9b455230
-1,   70515498,   70515498,  1567346,      104, 0x0b3938d2
-0,         36,         36,        1,      156, 0xbbbf4bf3
-1,   72082844,   72082844,  1567346,      105, 0xb2653246
-1,   73650190,   73650190,  1567346,      104, 0x76333479
-0,         37,         37,        1,      220, 0x77a97152
-1,   75217536,   75217536,  1567346,      105, 0x779138c4
-0,         38,         38,        1,      204, 0x667d5ecf
-1,   76784882,   76784882,  1567346,      104, 0xfe142f55
-0,         39,         39,        1,      232, 0x3a266ccd
-1,   78352228,   78352228,  1567346,      105, 0x39aa3410
-1,   79919574,   79919574,  1567346,      104, 0x520f330d
-0,         40,         40,        1,      308, 0x844a95b7
-1,   81486920,   81486920,  1567346,      104, 0x1aad37b0
-0,         41,         41,        1,      384, 0x71d2c695
-1,   83054266,   83054266,  1567346,      105, 0x164038eb
-1,   84621612,   84621612,  1567346,      104, 0x21d434bd
-0,         43,         43,        1,      520, 0x4f9d012a
-1,   86188958,   86188958,  1567346,      105, 0x9c1236d4
-1,   87756304,   87756304,  1567346,      104, 0x6aa933c3
-1,   89323650,   89323650,  1567346,      105, 0xec5c371e
-0,         45,         45,        1,      648, 0xabd13b29
-1,   90890996,   90890996,  1567346,      104, 0xedb33251
-1,   92458342,   92458342,  1567346,      105, 0x4f953476
-1,   94025688,   94025688,  1567346,      104, 0x7da13400
-0,         47,         47,        1,      604, 0x006b328f
-1,   95593034,   95593034,  1567346,      105, 0x57a83aaa
-1,   97160380,   97160380,  1567346,      104, 0x8b822f2f
-0,         49,         49,        1,      492, 0xa150fac1
-1,   98727726,   98727726,  1567346,      105, 0x3b31341a
-1,  100295072,  100295072,  1567346,      104, 0x74a4316d
-1,  101862418,  101862418,  1567346,      105, 0x05013469
-0,         51,         51,        1,      456, 0xd3e9e52c
-1,  103429764,  103429764,  1567346,      104, 0xcc8932cb
-1,  104997110,  104997110,  1567346,      105, 0xd9233422
-0,         53,         53,        1,      340, 0x7229a1b7
-1,  106564456,  106564456,  1567346,      104, 0x5c603350
-1,  108131802,  108131802,  1567346,      105, 0x76e631bc
-1,  109699148,  109699148,  1567346,      104, 0x657e3b35
-0,         55,         55,        1,      280, 0x48948b60
-1,  111266494,  111266494,  1567346,      105, 0x9d283226
-1,  112833840,  112833840,  1567346,      104, 0x574936ef
-0,         57,         57,        1,      304, 0x3ae68dcf
-1,  114401186,  114401186,  1567346,      105, 0x1b923555
-1,  115968532,  115968532,  1567346,      104, 0x2a9f3583
-1,  117535878,  117535878,  1567346,      105, 0xb8cd306f
-0,         59,         59,        1,      324, 0x005da2ab
-1,  119103224,  119103224,  1567346,      104, 0xa21d3475
-1,  120670570,  120670570,  1567346,      105, 0x651539ea
-0,         61,         61,        1,      348, 0x3230a873
-1,  122237916,  122237916,  1567346,      104, 0x7b7235b8
-1,  123805262,  123805262,  1567346,      105, 0x2bbb337a
-1,  125372608,  125372608,  1567346,      104, 0x26c332eb
-0,         63,         63,        1,      336, 0x8655ad2d
-1,  126939954,  126939954,  1567346,      105, 0x990838d8
-1,  128507300,  128507300,  1567346,      104, 0x4dc63ad4
-1,  130074646,  130074646,  1567346,      105, 0xfb8e3418
-0,         65,         65,        1,      380, 0x742ebc44
-1,  131641992,  131641992,  1567346,      104, 0x1882388e
-1,  133209338,  133209338,  1567346,      105, 0xe6b534cc
-0,         67,         67,        1,      340, 0xfc1aa74e
-1,  134776684,  134776684,  1567346,      104, 0x60fe35d0
-1,  136344030,  136344030,  1567346,      105, 0x5164354a
-1,  137911376,  137911376,  1567346,      104, 0x92ee3115
-0,         69,         69,        1,      332, 0x3cfba56c
-1,  139478722,  139478722,  1567346,      105, 0x9b32327e
-1,  141046068,  141046068,  1567346,      104, 0x9b9e394a
-0,         71,         71,        1,      332, 0xc024ad4c
-1,  142613414,  142613414,  1567346,      105, 0xce3c337f
-1,  144180760,  144180760,  1567346,      104, 0x7a4e33c5
-0,         73,         73,        1,     3432, 0xcdfcd1c9
-1,  146956000,  146956000,  1567346,      105, 0x0e3d34eb
-1,  148523346,  148523346,  1567346,      104, 0xd23e338e
-1,  150090692,  150090692,  1567346,      105, 0x4abf340c
-0,         75,         75,        1,      792, 0xe7df949f
-1,  151658038,  151658038,  1567346,      104, 0xe7522e15
-1,  153225384,  153225384,  1567346,      105, 0x995037ba
-0,         77,         77,        1,      912, 0xbc61d549
-1,  154792730,  154792730,  1567346,      104, 0x5ef12e9b
-1,  156360076,  156360076,  1567346,      105, 0x5c3b3166
-1,  157927422,  157927422,  1567346,      104, 0xfc38314b
-0,         79,         79,        1,      956, 0x809bdff0
-1,  159494768,  159494768,  1567346,      104, 0x5e3636e4
-1,  161062114,  161062114,  1567346,      105, 0xae7b3345
-0,         81,         81,        1,      652, 0x88d3484f
-1,  162629460,  162629460,  1567346,      104, 0x635c317a
-1,  164196806,  164196806,  1567346,      105, 0xa90c361a
-1,  165764152,  165764152,  1567346,      104, 0x8f563594
-0,         83,         83,        1,     1284, 0xecc37164
-1,  167156000,  167156000,  1567346,      105, 0x028e3985
-1,  168723346,  168723346,  1567346,      104, 0x4fd135f6
-0,         85,         85,        1,      428, 0x4794e174
-1,  170290692,  170290692,  1567346,      105, 0xaaf539ac
-1,  171858038,  171858038,  1567346,      104, 0x668b3265
-1,  173425384,  173425384,  1567346,      105, 0x74ad3b4b
-0,         87,         87,        1,      460, 0x7253d94a
-1,  174992730,  174992730,  1567346,      104, 0xbde5332f
-1,  176560076,  176560076,  1567346,      105, 0xdc3631e7
-1,  178127422,  178127422,  1567346,      104, 0x3e363a1e
-0,         89,         89,        1,       24, 0x664206ba
-1,  179694768,  179694768,  1567346,      105, 0x48b63926
diff --git a/deps/libav/tests/ref/fate/nuv-rtjpeg b/deps/libav/tests/ref/fate/nuv-rtjpeg
deleted file mode 100644
index a5c9c4a..0000000
--- a/deps/libav/tests/ref/fate/nuv-rtjpeg
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/1000
-0,        118,        118,        0,   460800, 0x54aedafe
-0,        152,        152,        0,   460800, 0xb7aa8b56
-0,        177,        177,        0,   460800, 0x283ea3b5
-0,        202,        202,        0,   460800, 0x283ea3b5
-0,        235,        235,        0,   460800, 0x10e577de
-0,        269,        269,        0,   460800, 0x4e091ee2
-0,        302,        302,        0,   460800, 0x2ea88828
-0,        335,        335,        0,   460800, 0x4b7f4df0
diff --git a/deps/libav/tests/ref/fate/nuv-rtjpeg-fh b/deps/libav/tests/ref/fate/nuv-rtjpeg-fh
deleted file mode 100644
index 71e6bf9..0000000
--- a/deps/libav/tests/ref/fate/nuv-rtjpeg-fh
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   221184, 0xdaf54f83
-0,         40,         40,        0,   221184, 0xeea3e3b4
-0,         60,         60,        0,   221184, 0x5f1a8525
-0,         80,         80,        0,   221184, 0x950bb170
-0,        100,        100,        0,   221184, 0x6262e94c
-0,        120,        120,        0,   221184, 0x28752197
-0,        140,        140,        0,   221184, 0x0c2811e7
-0,        160,        160,        0,   221184, 0xb2c1a729
-0,        200,        200,        0,   221184, 0x998d6144
-0,        220,        220,        0,   221184, 0xf5d52311
-0,        240,        240,        0,   221184, 0xea9dd6bf
-0,        260,        260,        0,   221184, 0x0e2ed854
-0,        280,        280,        0,   221184, 0xe295ba58
-0,        300,        300,        0,   221184, 0x8aedbb69
-0,        320,        320,        0,   221184, 0x253c9aaa
-0,        340,        340,        0,   221184, 0x5eaf9fb1
-0,        360,        360,        0,   221184, 0xcdb5a0cb
-0,        380,        380,        0,   221184, 0xcdb5a0cb
-0,        400,        400,        0,   221184, 0x23f89994
-0,        420,        420,        0,   221184, 0x23f89994
-0,        440,        440,        0,   221184, 0x10dc98d6
-0,        460,        460,        0,   221184, 0x799b9d98
-0,        480,        480,        0,   221184, 0xb226996c
-0,        500,        500,        0,   221184, 0x0ac59a42
-0,        520,        520,        0,   221184, 0x87c2a654
-0,        540,        540,        0,   221184, 0xf4c1a711
-0,        560,        560,        0,   221184, 0xf60fa72e
-0,        580,        580,        0,   221184, 0xc8f8b6fc
-0,        600,        600,        0,   221184, 0xd709b813
-0,        620,        620,        0,   221184, 0x5fdfb76b
-0,        640,        640,        0,   221184, 0x5798b0aa
-0,        660,        660,        0,   221184, 0xf572b1c3
-0,        680,        680,        0,   221184, 0x14b0afdf
-0,        700,        700,        0,   221184, 0x0a66b5b8
-0,        720,        720,        0,   221184, 0xe316c620
-0,        740,        740,        0,   221184, 0xbc76c5c2
-0,        760,        760,        0,   221184, 0x77c7c5e5
-0,        780,        780,        0,   221184, 0xfc7ac63e
-0,        800,        800,        0,   221184, 0x05a29ffe
-0,        820,        820,        0,   221184, 0x9bffbf6c
-0,        840,        840,        0,   221184, 0x3c55be40
-0,        860,        860,        0,   221184, 0x6f46c14e
-0,        880,        880,        0,   221184, 0x9cf4ae70
-0,        900,        900,        0,   221184, 0xf205b2f8
-0,        920,        920,        0,   221184, 0x7180aff8
-0,        940,        940,        0,   221184, 0x125eaffe
-0,        960,        960,        0,   221184, 0x6970a32d
-0,        980,        980,        0,   221184, 0xaea79f62
-0,       1000,       1000,        0,   221184, 0x48d2a093
-0,       1020,       1020,        0,   221184, 0x10a59eb5
diff --git a/deps/libav/tests/ref/fate/oma-demux b/deps/libav/tests/ref/fate/oma-demux
deleted file mode 100644
index 39fcf5a..0000000
--- a/deps/libav/tests/ref/fate/oma-demux
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0xdd181a1c
diff --git a/deps/libav/tests/ref/fate/parseutils b/deps/libav/tests/ref/fate/parseutils
deleted file mode 100644
index 01f6e08..0000000
--- a/deps/libav/tests/ref/fate/parseutils
+++ /dev/null
@@ -1,45 +0,0 @@
-Testing av_parse_video_rate()
-'-inf' -> -1/0 ERROR
-'inf' -> 1/0 ERROR
-'nan' -> 0/0 ERROR
-'123/0' -> 1/0 ERROR
-'-123 / 0' -> -1/0 ERROR
-'' -> 0/0 ERROR
-'/' -> 0/0 ERROR
-' 123  /  321' -> 41/107 OK
-'foo/foo' -> 0/0 ERROR
-'foo/1' -> 0/0 ERROR
-'1/foo' -> 0/0 ERROR
-'0/0' -> 0/0 ERROR
-'/0' -> 0/0 ERROR
-'1/' -> 0/0 ERROR
-'1' -> 1/1 OK
-'0' -> 0/1 ERROR
-'-123/123' -> -1/1 ERROR
-'-foo' -> 0/0 ERROR
-'123.23' -> 12323/100 OK
-'.23' -> 23/100 OK
-'-.23' -> -23/100 ERROR
-'-0.234' -> -117/500 ERROR
-'-0.0000001' -> 0/1 ERROR
-'  21332.2324   ' -> 917286/43 OK
-' -21332.2324   ' -> -917286/43 ERROR
-
-Testing av_parse_color()
-red -> R(255) G(0) B(0) A(255)
-RED -> R(255) G(0) B(0) A(255)
-Violet -> R(238) G(130) B(238) A(255)
-Yellow -> R(255) G(255) B(0) A(255)
-Red -> R(255) G(0) B(0) A(255)
-0x000000 -> R(0) G(0) B(0) A(255)
-0xff000000 -> R(255) G(0) B(0) A(0)
-0x3e34ff -> R(62) G(52) B(255) A(255)
-0x3e34ffaa -> R(62) G(52) B(255) A(170)
-#ff0000 -> R(255) G(0) B(0) A(255)
-ff0000 -> R(255) G(0) B(0) A(255)
-0xff0000 at 1.0 -> R(255) G(0) B(0) A(255)
-red at 0xf -> R(255) G(0) B(0) A(15)
-red at 0.1 -> R(255) G(0) B(0) A(25)
-red at 0.5 -> R(255) G(0) B(0) A(127)
-red at 1.0 -> R(255) G(0) B(0) A(255)
-red at -0.0 -> R(255) G(0) B(0) A(0)
diff --git a/deps/libav/tests/ref/fate/pcm-planar b/deps/libav/tests/ref/fate/pcm-planar
deleted file mode 100644
index 91b4a78..0000000
--- a/deps/libav/tests/ref/fate/pcm-planar
+++ /dev/null
@@ -1,143 +0,0 @@
-#tb 0: 1/44100
-0,          0,          0,     1471,     5884, 0x00000000
-0,       1471,       1471,     1471,     5884, 0x00000000
-0,       2942,       2942,     1472,     5888, 0x00000000
-0,       4414,       4414,     1471,     5884, 0x00000000
-0,       5885,       5885,     1472,     5888, 0x00000000
-0,       7357,       7357,     1471,     5884, 0x00000000
-0,       8828,       8828,     1472,     5888, 0x00000000
-0,      10300,      10300,     1471,     5884, 0x00000000
-0,      11771,      11771,     1472,     5888, 0x00000000
-0,      13243,      13243,     1471,     5884, 0x00000000
-0,      14714,      14714,     1472,     5888, 0x174b2bd4
-0,      16186,      16186,     1471,     5884, 0xfab9563d
-0,      17657,      17657,     1472,     5888, 0x0129a4f5
-0,      19129,      19129,     1471,     5884, 0xf12b15dd
-0,      20600,      20600,     1472,     5888, 0x60c8c922
-0,      22072,      22072,     1471,     5884, 0x85693c81
-0,      23543,      23543,     1472,     5888, 0xcefcf0e0
-0,      25015,      25015,     1471,     5884, 0x243974ff
-0,      26486,      26486,     1471,     5884, 0x9101b901
-0,      27957,      27957,     1472,     5888, 0xe3c68cb9
-0,      29429,      29429,     1471,     5884, 0x80f2ff5f
-0,      30900,      30900,     1472,     5888, 0xfc2d19dc
-0,      32372,      32372,     1471,     5884, 0xb6e0af21
-0,      33843,      33843,     1472,     5888, 0x476e74ff
-0,      35315,      35315,     1471,     5884, 0x3921bc7f
-0,      36786,      36786,     1472,     5888, 0x44180a3f
-0,      38258,      38258,     1471,     5884, 0x01b5a119
-0,      39729,      39729,     1472,     5888, 0xdd7ad621
-0,      41201,      41201,     1471,     5884, 0xadabe898
-0,      42672,      42672,     1472,     5888, 0x2141ff8e
-0,      44144,      44144,     1471,     5884, 0xfb5118fb
-0,      45615,      45615,     1472,     5888, 0x06d31461
-0,      47087,      47087,     1471,     5884, 0x80ce34c1
-0,      48558,      48558,     1472,     5888, 0x72bf392f
-0,      50030,      50030,     1471,     5884, 0x9d9237cf
-0,      51501,      51501,     1471,     5884, 0xf5c9ce23
-0,      52972,      52972,     1472,     5888, 0x12a05dc5
-0,      54444,      54444,     1471,     5884, 0xd3ed5d4b
-0,      55915,      55915,     1472,     5888, 0x06557401
-0,      57387,      57387,     1471,     5884, 0x53d81662
-0,      58858,      58858,     1472,     5888, 0xd7e0d98d
-0,      60330,      60330,     1471,     5884, 0xdf00752e
-0,      61801,      61801,     1472,     5888, 0x82f1d7a9
-0,      63273,      63273,     1471,     5884, 0x9cb3aba9
-0,      64744,      64744,     1472,     5888, 0xd6f98e91
-0,      66216,      66216,     1471,     5884, 0xaa7f7c09
-0,      67687,      67687,     1472,     5888, 0xb97a82a7
-0,      69159,      69159,     1471,     5884, 0x375a3d53
-0,      70630,      70630,     1472,     5888, 0xa0a460cb
-0,      72102,      72102,     1471,     5884, 0xe05efbab
-0,      73573,      73573,     1472,     5888, 0x95e151f0
-0,      75045,      75045,     1471,     5884, 0x44ac688d
-0,      76516,      76516,     1471,     5884, 0xfc6d929f
-0,      77987,      77987,     1472,     5888, 0x6406c5f1
-0,      79459,      79459,     1471,     5884, 0x4ee9e48c
-0,      80930,      80930,     1472,     5888, 0xd55d43d0
-0,      82402,      82402,     1471,     5884, 0xcae69baf
-0,      83873,      83873,     1472,     5888, 0x4c01f1f5
-0,      85345,      85345,     1471,     5884, 0xf7d6dab6
-0,      86816,      86816,     1472,     5888, 0x1affdeb5
-0,      88288,      88288,     1471,     5884, 0x6db72487
-0,      89759,      89759,     1472,     5888, 0x4f344e49
-0,      91231,      91231,     1471,     5884, 0x2df3827b
-0,      92702,      92702,     1472,     5888, 0x1d1fc283
-0,      94174,      94174,     1471,     5884, 0x22eb1dd5
-0,      95645,      95645,     1472,     5888, 0x734e7093
-0,      97117,      97117,     1471,     5884, 0x357c9531
-0,      98588,      98588,     1472,     5888, 0x108c102d
-0,     100060,     100060,     1471,     5884, 0x96ad26c6
-0,     101531,     101531,     1472,     5888, 0x7bea1996
-0,     103003,     103003,     1471,     5884, 0x124a1f8e
-0,     104474,     104474,     1471,     5884, 0x08d272fb
-0,     105945,     105945,     1472,     5888, 0x88832c6b
-0,     107417,     107417,     1471,     5884, 0xedf41493
-0,     108888,     108888,     1472,     5888, 0xc4f226d7
-0,     110360,     110360,     1471,     5884, 0x97730397
-0,     111831,     111831,     1472,     5888, 0xbc3540e9
-0,     113303,     113303,     1471,     5884, 0x8adfa135
-0,     114774,     114774,     1472,     5888, 0x6d4be121
-0,     116246,     116246,     1471,     5884, 0xc3daea85
-0,     117717,     117717,     1472,     5888, 0x5498e9f0
-0,     119189,     119189,     1471,     5884, 0xa0eb691f
-0,     120660,     120660,     1472,     5888, 0x775c7c59
-0,     122132,     122132,     1471,     5884, 0x9f108fd1
-0,     123603,     123603,     1472,     5888, 0x72d53062
-0,     125075,     125075,     1471,     5884, 0x13a93faa
-0,     126546,     126546,     1472,     5888, 0x64773c8e
-0,     128018,     128018,     1471,     5884, 0xaf696999
-0,     129489,     129489,     1471,     5884, 0xf45e7e81
-0,     130960,     130960,     1472,     5888, 0x00000000
-0,     132432,     132432,     1471,     5884, 0x00000000
-0,     133903,     133903,     1472,     5888, 0x00000000
-0,     135375,     135375,     1471,     5884, 0x00000000
-0,     136846,     136846,     1472,     5888, 0x00000000
-0,     138318,     138318,     1471,     5884, 0x00000000
-0,     139789,     139789,     1472,     5888, 0x00000000
-0,     141261,     141261,     1471,     5884, 0x00000000
-0,     142732,     142732,     1472,     5888, 0x00000000
-0,     144204,     144204,     1471,     5884, 0x00000000
-0,     145675,     145675,     1472,     5888, 0x00000000
-0,     147147,     147147,     1471,     5884, 0x00000000
-0,     148618,     148618,     1472,     5888, 0x00000000
-0,     150090,     150090,     1471,     5884, 0x00000000
-0,     151561,     151561,     1472,     5888, 0x00000000
-0,     153033,     153033,     1471,     5884, 0x00000000
-0,     154504,     154504,     1471,     5884, 0x00000000
-0,     155975,     155975,     1472,     5888, 0x00000000
-0,     157447,     157447,     1471,     5884, 0x00000000
-0,     158918,     158918,     1472,     5888, 0x00000000
-0,     160390,     160390,     1471,     5884, 0x00000000
-0,     161861,     161861,     1472,     5888, 0x00000000
-0,     163333,     163333,     1471,     5884, 0x00000000
-0,     164804,     164804,     1472,     5888, 0x00000000
-0,     166276,     166276,     1471,     5884, 0x00000000
-0,     167747,     167747,     1472,     5888, 0x00000000
-0,     169219,     169219,     1471,     5884, 0x00000000
-0,     170690,     170690,     1472,     5888, 0x00000000
-0,     172162,     172162,     1471,     5884, 0xfe4b2bd4
-0,     173633,     173633,     1472,     5888, 0x00000000
-0,     175105,     175105,     1471,     5884, 0x00000000
-0,     176576,     176576,     1472,     5888, 0x00000000
-0,     178048,     178048,     1471,     5884, 0x00000000
-0,     179519,     179519,     1471,     5884, 0x00000000
-0,     180990,     180990,     1472,     5888, 0x00000000
-0,     182462,     182462,     1471,     5884, 0x00000000
-0,     183933,     183933,     1472,     5888, 0x00000000
-0,     185405,     185405,     1471,     5884, 0x00000000
-0,     186876,     186876,     1472,     5888, 0x00000000
-0,     188348,     188348,     1471,     5884, 0x00000000
-0,     189819,     189819,     1472,     5888, 0x00000000
-0,     191291,     191291,     1471,     5884, 0x00000000
-0,     192762,     192762,     1472,     5888, 0x00000000
-0,     194234,     194234,     1471,     5884, 0x00000000
-0,     195705,     195705,     1472,     5888, 0x00000000
-0,     197177,     197177,     1471,     5884, 0x00000000
-0,     198648,     198648,     1472,     5888, 0x00000000
-0,     200120,     200120,     1471,     5884, 0x00000000
-0,     201591,     201591,     1472,     5888, 0x00000000
-0,     203063,     203063,     1471,     5884, 0x00000000
-0,     204534,     204534,     1472,     5888, 0x00000000
-0,     206006,     206006,     1471,     5884, 0x00000000
-0,     207477,     207477,     1262,     5048, 0x00000000
diff --git a/deps/libav/tests/ref/fate/pcm_dvd b/deps/libav/tests/ref/fate/pcm_dvd
deleted file mode 100644
index 6037451..0000000
--- a/deps/libav/tests/ref/fate/pcm_dvd
+++ /dev/null
@@ -1,124 +0,0 @@
-#tb 0: 1/48000
-0,          0,          0,      334,     1336, 0x8e3c0abc
-0,        400,        400,      334,     1336, 0x99c41108
-0,        720,        720,      334,     1336, 0xd65be322
-0,       1040,       1040,      334,     1336, 0x15b575fb
-0,       1360,       1360,      334,     1336, 0x366f742a
-0,       1680,       1680,      334,     1336, 0xed72ad83
-0,       2000,       2000,      334,     1336, 0x73f21c93
-0,       2400,       2400,      334,     1336, 0x4be7a770
-0,       2720,       2720,      334,     1336, 0x69ecf80c
-0,       3040,       3040,      334,     1336, 0x835dc0e5
-0,       3360,       3360,      334,     1336, 0x3089458d
-0,       3680,       3680,      334,     1336, 0xc73b8cdc
-0,       4080,       4080,      334,     1336, 0xc1cdaa8f
-0,       4400,       4400,      334,     1336, 0x47a49186
-0,       4720,       4720,      334,     1336, 0x2db387e2
-0,       5040,       5040,      334,     1336, 0x90da9a97
-0,       5360,       5360,      334,     1336, 0xcd34a467
-0,       5680,       5680,      334,     1336, 0xdca8bd29
-0,       6080,       6080,      334,     1336, 0xa09f9da3
-0,       6400,       6400,      334,     1336, 0x47c8acf6
-0,       6720,       6720,      334,     1336, 0x94dfa20e
-0,       7040,       7040,      334,     1336, 0x2123a5f6
-0,       7360,       7360,      334,     1336, 0x2f1badde
-0,       7680,       7680,      334,     1336, 0x47579528
-0,       8080,       8080,      334,     1336, 0x028daa10
-0,       8400,       8400,      334,     1336, 0x5ed7adcd
-0,       8720,       8720,      334,     1336, 0xc5ee8f10
-0,       9040,       9040,      334,     1336, 0xcfacb489
-0,       9360,       9360,      334,     1336, 0x07de937b
-0,       9760,       9760,      334,     1336, 0x07bd8f8b
-0,      10080,      10080,      334,     1336, 0x4660912e
-0,      10400,      10400,      334,     1336, 0x047f97ad
-0,      10720,      10720,      334,     1336, 0xe0e8a11f
-0,      11040,      11040,      334,     1336, 0xcd9898e6
-0,      11360,      11360,      334,     1336, 0xccfda786
-0,      11760,      11760,      334,     1336, 0xab1b9e40
-0,      12080,      12080,      334,     1336, 0x2ea79ea1
-0,      12400,      12400,      334,     1336, 0xade2ad7e
-0,      12720,      12720,      334,     1336, 0xe5cf9684
-0,      13040,      13040,      334,     1336, 0xb57184cf
-0,      13360,      13360,      334,     1336, 0x0668a5ce
-0,      13760,      13760,      334,     1336, 0x643a9d96
-0,      14080,      14080,      334,     1336, 0x97dc8ecc
-0,      14400,      14400,      334,     1336, 0x72c2b174
-0,      14720,      14720,      334,     1336, 0xe39d8fc3
-0,      15040,      15040,      334,     1336, 0x56fc76d2
-0,      15360,      15360,      334,     1336, 0x91a884b3
-0,      15760,      15760,      334,     1336, 0x7b039a4e
-0,      16080,      16080,      334,     1336, 0x3770a9dd
-0,      16400,      16400,      334,     1336, 0x317c9cb8
-0,      16720,      16720,      334,     1336, 0xdd97ad48
-0,      17040,      17040,      334,     1336, 0x98066c1b
-0,      17440,      17440,      334,     1336, 0xecd3a31c
-0,      17760,      17760,      334,     1336, 0x0578b329
-0,      18080,      18080,      334,     1336, 0x6942881c
-0,      18400,      18400,      334,     1336, 0x56b5af29
-0,      18720,      18720,      334,     1336, 0xf111a48a
-0,      19040,      19040,      334,     1336, 0x1f5a8d45
-0,      19440,      19440,      334,     1336, 0x39abdded
-0,      19760,      19760,      334,     1336, 0xdb997fe8
-0,      20080,      20080,      334,     1336, 0xd7f0d0b2
-0,      20400,      20400,      334,     1336, 0xf3219413
-0,      20720,      20720,      334,     1336, 0x9d80899d
-0,      21040,      21040,      334,     1336, 0x7238bd63
-0,      21440,      21440,      334,     1336, 0x7376703e
-0,      21760,      21760,      334,     1336, 0x0fd56d02
-0,      22080,      22080,      334,     1336, 0xa6c0951e
-0,      22400,      22400,      334,     1336, 0xfacb674e
-0,      22720,      22720,      334,     1336, 0x805bd289
-0,      23120,      23120,      334,     1336, 0xa2a51a12
-0,      23440,      23440,      334,     1336, 0x8a75d91b
-0,      23760,      23760,      334,     1336, 0x34b1ef80
-0,      24080,      24080,      334,     1336, 0x902921e0
-0,      24400,      24400,      334,     1336, 0xc2db7895
-0,      24720,      24720,      334,     1336, 0x7a0db9e1
-0,      25120,      25120,      334,     1336, 0x66a93277
-0,      25440,      25440,      334,     1336, 0x30830a83
-0,      25760,      25760,      334,     1336, 0x251cf132
-0,      26080,      26080,      334,     1336, 0x08dd852c
-0,      26400,      26400,      334,     1336, 0x22ea164c
-0,      26720,      26720,      334,     1336, 0x3bdd91c4
-0,      27120,      27120,      334,     1336, 0xa4c0fbd7
-0,      27440,      27440,      334,     1336, 0x83aa81bd
-0,      27760,      27760,      334,     1336, 0x8a7b0fdb
-0,      28080,      28080,      334,     1336, 0x35c37b01
-0,      28400,      28400,      334,     1336, 0xdede811e
-0,      28720,      28720,      334,     1336, 0x7473a657
-0,      29120,      29120,      334,     1336, 0x5b917e2b
-0,      29440,      29440,      334,     1336, 0x1c5a7cfc
-0,      29760,      29760,      334,     1336, 0xeb7bab0d
-0,      30080,      30080,      334,     1336, 0x7337795c
-0,      30400,      30400,      334,     1336, 0x68da9d08
-0,      30800,      30800,      334,     1336, 0xe93b87fe
-0,      31120,      31120,      334,     1336, 0xd4639f00
-0,      31440,      31440,      334,     1336, 0x1070a91d
-0,      31760,      31760,      334,     1336, 0x50e3788f
-0,      32080,      32080,      334,     1336, 0x1dac6691
-0,      32400,      32400,      334,     1336, 0xf62c709d
-0,      32800,      32800,      334,     1336, 0x2369648d
-0,      33120,      33120,      334,     1336, 0xbfc792e6
-0,      33440,      33440,      334,     1336, 0x975eb8e3
-0,      33760,      33760,      334,     1336, 0x35c49ba6
-0,      34080,      34080,      334,     1336, 0xe6198aa9
-0,      34400,      34400,      334,     1336, 0x99f37d9d
-0,      34800,      34800,      334,     1336, 0x4815aff1
-0,      35120,      35120,      334,     1336, 0x4fd366ca
-0,      35440,      35440,      334,     1336, 0x43cf7bb4
-0,      35760,      35760,      334,     1336, 0x14a576ac
-0,      36080,      36080,      334,     1336, 0xc6986978
-0,      36480,      36480,      334,     1336, 0x10f67dc4
-0,      36800,      36800,      334,     1336, 0xcca07f7a
-0,      37120,      37120,      334,     1336, 0x6d0a5dfe
-0,      37440,      37440,      334,     1336, 0x4e0761ef
-0,      37760,      37760,      334,     1336, 0x31368e66
-0,      38080,      38080,      334,     1336, 0x14b895c1
-0,      38480,      38480,      334,     1336, 0x4bb7c111
-0,      38800,      38800,      334,     1336, 0x1676a8bb
-0,      39120,      39120,      334,     1336, 0xddaaa459
-0,      39440,      39440,      334,     1336, 0xc43eabce
-0,      39760,      39760,      334,     1336, 0x4d9f8d54
-0,      40080,      40080,      334,     1336, 0x0ac292cb
-0,      40480,      40480,      334,     1336, 0x2d9c74e4
-0,      40800,      40800,      334,     1336, 0xe73da38f
diff --git a/deps/libav/tests/ref/fate/pcm_s16be-stereo b/deps/libav/tests/ref/fate/pcm_s16be-stereo
deleted file mode 100644
index 2500ba2..0000000
--- a/deps/libav/tests/ref/fate/pcm_s16be-stereo
+++ /dev/null
@@ -1 +0,0 @@
-f0c0fd7615cdef66fa72f5816632ca9b
diff --git a/deps/libav/tests/ref/fate/pcm_s16le-stereo b/deps/libav/tests/ref/fate/pcm_s16le-stereo
deleted file mode 100644
index f0837d1..0000000
--- a/deps/libav/tests/ref/fate/pcm_s16le-stereo
+++ /dev/null
@@ -1 +0,0 @@
-0262b20b728f5bb95594e64e2173b2f2
diff --git a/deps/libav/tests/ref/fate/pcm_u8-mono b/deps/libav/tests/ref/fate/pcm_u8-mono
deleted file mode 100644
index 2b46dbc..0000000
--- a/deps/libav/tests/ref/fate/pcm_u8-mono
+++ /dev/null
@@ -1 +0,0 @@
-c2dcec9b230dad733b6b877fbed36755
diff --git a/deps/libav/tests/ref/fate/pcm_u8-stereo b/deps/libav/tests/ref/fate/pcm_u8-stereo
deleted file mode 100644
index 701a515..0000000
--- a/deps/libav/tests/ref/fate/pcm_u8-stereo
+++ /dev/null
@@ -1 +0,0 @@
-973cf68365c3d58ff60ba652433b3bd2
diff --git a/deps/libav/tests/ref/fate/pictor b/deps/libav/tests/ref/fate/pictor
deleted file mode 100644
index 3dc4344..0000000
--- a/deps/libav/tests/ref/fate/pictor
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   192816, 0xf97e2ba1
diff --git a/deps/libav/tests/ref/fate/pngparser b/deps/libav/tests/ref/fate/pngparser
deleted file mode 100644
index b481dcd..0000000
--- a/deps/libav/tests/ref/fate/pngparser
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   271040, 0xffe62f5f
-0,          1,          1,        1,   271040, 0xcf502f5f
-0,          2,          2,        1,   271040, 0x72612f5f
-0,          3,          3,        1,   271040, 0x41cb2f5f
diff --git a/deps/libav/tests/ref/fate/prores-422 b/deps/libav/tests/ref/fate/prores-422
deleted file mode 100644
index 379739f..0000000
--- a/deps/libav/tests/ref/fate/prores-422
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/2997
-0,          0,          0,        0,  8294400, 0xe8e9d448
-0,        100,        100,        0,  8294400, 0xe8e9d448
diff --git a/deps/libav/tests/ref/fate/prores-422_hq b/deps/libav/tests/ref/fate/prores-422_hq
deleted file mode 100644
index dc93c33..0000000
--- a/deps/libav/tests/ref/fate/prores-422_hq
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/2997
-0,          0,          0,        0,  8294400, 0x817063b0
-0,        100,        100,        0,  8294400, 0x817063b0
diff --git a/deps/libav/tests/ref/fate/prores-422_lt b/deps/libav/tests/ref/fate/prores-422_lt
deleted file mode 100644
index 1c50840..0000000
--- a/deps/libav/tests/ref/fate/prores-422_lt
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/2997
-0,          0,          0,        0,  8294400, 0xcd4ccde1
-0,        100,        100,        0,  8294400, 0xcd4ccde1
diff --git a/deps/libav/tests/ref/fate/prores-422_proxy b/deps/libav/tests/ref/fate/prores-422_proxy
deleted file mode 100644
index 3763b00..0000000
--- a/deps/libav/tests/ref/fate/prores-422_proxy
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/2997
-0,          0,          0,        0,  8294400, 0x51d29320
-0,        100,        100,        0,  8294400, 0x51d29320
diff --git a/deps/libav/tests/ref/fate/prores-alpha b/deps/libav/tests/ref/fate/prores-alpha
deleted file mode 100644
index 97be6cf..0000000
--- a/deps/libav/tests/ref/fate/prores-alpha
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/2997
-0,          0,          0,        0, 16588800, 0x8dcdb600
-0,        100,        100,        0, 16588800, 0x8dcdb600
diff --git a/deps/libav/tests/ref/fate/psx-str-demux b/deps/libav/tests/ref/fate/psx-str-demux
deleted file mode 100644
index 42c5731..0000000
--- a/deps/libav/tests/ref/fate/psx-str-demux
+++ /dev/null
@@ -1,202 +0,0 @@
-#tb 0: 1/15
-#tb 1: 4/75
-0,          0,          0,        1,     8832, 0x01ad3eeb
-1,          0,          0,        1,     2304, 0xf0ad1000
-1,          1,          1,        1,     2304, 0x69269ce6
-0,          1,          1,        1,     8968, 0xe0033799
-1,          2,          2,        1,     2304, 0x124a995d
-0,          2,          2,        1,     9036, 0xd6189ab7
-1,          3,          3,        1,     2304, 0x3fc0ca07
-0,          3,          3,        1,     9192, 0xb44b9ffa
-1,          4,          4,        1,     2304, 0x40a1b447
-0,          4,          4,        1,     9404, 0xe94dfd40
-1,          5,          5,        1,     2304, 0x150dae9f
-1,          6,          6,        1,     2304, 0xad16bc63
-0,          5,          5,        1,     9492, 0xf73f2541
-1,          7,          7,        1,     2304, 0xe989b175
-0,          6,          6,        1,     9652, 0x243d53f8
-1,          8,          8,        1,     2304, 0x3c77cd39
-0,          7,          7,        1,     9872, 0x83f3ea7a
-1,          9,          9,        1,     2304, 0x93f0c2ba
-0,          8,          8,        1,    10052, 0x7604247a
-1,         10,         10,        1,     2304, 0x6e2ad2d0
-1,         11,         11,        1,     2304, 0xf8eab90a
-0,          9,          9,        1,    10100, 0x077107fd
-1,         12,         12,        1,     2304, 0xc039bf0d
-0,         10,         10,        1,    10264, 0xae675eb6
-1,         13,         13,        1,     2304, 0x0900c7e8
-0,         11,         11,        1,    10464, 0x428f83ae
-1,         14,         14,        1,     2304, 0x9722d580
-0,         12,         12,        1,    10580, 0x1bdcd71b
-1,         15,         15,        1,     2304, 0x02eec8de
-1,         16,         16,        1,     2304, 0x4807a2b3
-0,         13,         13,        1,    10800, 0xde75213a
-1,         17,         17,        1,     2304, 0x4643be06
-0,         14,         14,        1,    11236, 0x9387cc8e
-1,         18,         18,        1,     2304, 0x5bd9d249
-0,         15,         15,        1,    11420, 0x3a7d321b
-1,         19,         19,        1,     2304, 0x4e33c2bc
-0,         16,         16,        1,    11632, 0x7edc9cdf
-1,         20,         20,        1,     2304, 0x085ca51d
-1,         21,         21,        1,     2304, 0xa205b202
-0,         17,         17,        1,    11936, 0xf0521017
-1,         22,         22,        1,     2304, 0x71b9bcca
-0,         18,         18,        1,    11804, 0x53b22066
-1,         23,         23,        1,     2304, 0xcb769e5f
-0,         19,         19,        1,    11852, 0x9425fb21
-1,         24,         24,        1,     2304, 0x9322d85a
-0,         20,         20,        1,    12108, 0xc386941d
-1,         25,         25,        1,     2304, 0x7f13bf6e
-1,         26,         26,        1,     2304, 0xd302a5cd
-0,         21,         21,        1,    12796, 0x8b7e5dab
-1,         27,         27,        1,     2304, 0x7a7a9e30
-0,         22,         22,        1,    13316, 0x81235102
-1,         28,         28,        1,     2304, 0x6ffccfdd
-0,         23,         23,        1,    13724, 0xe5fc2bca
-1,         29,         29,        1,     2304, 0xae88bf7a
-0,         24,         24,        1,    14304, 0xa5b1f811
-1,         30,         30,        1,     2304, 0xf816c2f5
-1,         31,         31,        1,     2304, 0xdb42a783
-0,         25,         25,        1,    15216, 0xf4996763
-1,         32,         32,        1,     2304, 0xfc55c021
-0,         26,         26,        1,    16224, 0xe30b0679
-1,         33,         33,        1,     2304, 0x9da68fc1
-0,         27,         27,        1,    10640, 0xaeb122c9
-1,         34,         34,        1,     2304, 0x2f65bb0f
-0,         28,         28,        1,    11652, 0x087d18b1
-1,         35,         35,        1,     2304, 0x6e5da2c7
-1,         36,         36,        1,     2304, 0xb0b0c5f8
-0,         29,         29,        1,    12008, 0x1eeeac41
-1,         37,         37,        1,     2304, 0x32559dc6
-0,         30,         30,        1,    12344, 0x488c64ec
-1,         38,         38,        1,     2304, 0x9168aed0
-0,         31,         31,        1,    13004, 0x02a69339
-1,         39,         39,        1,     2304, 0x32069bce
-0,         32,         32,        1,    14092, 0x348a7d3f
-1,         40,         40,        1,     2304, 0x763ca8e0
-1,         41,         41,        1,     2304, 0x70c7a44e
-0,         33,         33,        1,    15048, 0xa55ef200
-1,         42,         42,        1,     2304, 0x7dc1b275
-0,         34,         34,        1,    16100, 0xac17de5b
-1,         43,         43,        1,     2304, 0x2e26ceae
-0,         35,         35,        1,    13180, 0x4d874f61
-1,         44,         44,        1,     2304, 0xa071a7e2
-0,         36,         36,        1,    14592, 0x5f58f505
-1,         45,         45,        1,     2304, 0xe434ad92
-1,         46,         46,        1,     2304, 0xb4469381
-0,         37,         37,        1,    14372, 0x369bb5d9
-1,         47,         47,        1,     2304, 0x3f20a7c5
-0,         38,         38,        1,    16172, 0x513a97b6
-1,         48,         48,        1,     2304, 0x68ef9ef9
-0,         39,         39,        1,    15136, 0x7f9a3865
-1,         49,         49,        1,     2304, 0x32dbb3e2
-0,         40,         40,        1,    16336, 0x1339ba5f
-1,         50,         50,        1,     2304, 0xdd90c7c3
-1,         51,         51,        1,     2304, 0xd106adb5
-0,         41,         41,        1,    16944, 0x122f71b7
-1,         52,         52,        1,     2304, 0x11dca8c4
-0,         42,         42,        1,    17536, 0x7461b152
-1,         53,         53,        1,     2304, 0x646d98bc
-0,         43,         43,        1,    13940, 0xf5278274
-1,         54,         54,        1,     2304, 0x6f019e81
-0,         44,         44,        1,     8592, 0x4bb2eaea
-1,         55,         55,        1,     2304, 0xc872a896
-1,         56,         56,        1,     2304, 0xc7d7a0bc
-0,         45,         45,        1,     8584, 0x2ff1e3db
-1,         57,         57,        1,     2304, 0x181b880a
-0,         46,         46,        1,     8548, 0xadfd01b4
-1,         58,         58,        1,     2304, 0x6486b158
-0,         47,         47,        1,     8548, 0x9e2ec85f
-1,         59,         59,        1,     2304, 0x26d5a3db
-0,         48,         48,        1,     8540, 0x9e2ad166
-1,         60,         60,        1,     2304, 0x4ff89a4d
-1,         61,         61,        1,     2304, 0xc42e9552
-0,         49,         49,        1,     8524, 0x047bc406
-1,         62,         62,        1,     2304, 0x0dc1c346
-0,         50,         50,        1,     8508, 0xd051ddbb
-1,         63,         63,        1,     2304, 0x5e51b7a5
-0,         51,         51,        1,     8572, 0x40b5004c
-1,         64,         64,        1,     2304, 0xbd49c142
-0,         52,         52,        1,     8564, 0xb379db59
-1,         65,         65,        1,     2304, 0x373da274
-1,         66,         66,        1,     2304, 0xde97b1bb
-0,         53,         53,        1,     8592, 0x22d0bc35
-1,         67,         67,        1,     2304, 0x9715bf29
-0,         54,         54,        1,     8656, 0xa58917d5
-1,         68,         68,        1,     2304, 0xc341b4ef
-0,         55,         55,        1,     8616, 0xc9e4f431
-1,         69,         69,        1,     2304, 0xc610adc6
-0,         56,         56,        1,     8660, 0x7a90ffd1
-1,         70,         70,        1,     2304, 0x67bba315
-1,         71,         71,        1,     2304, 0x949b9c16
-0,         57,         57,        1,     8636, 0xec8ce437
-1,         72,         72,        1,     2304, 0xc7c1a8ca
-0,         58,         58,        1,     8668, 0x8b73139f
-1,         73,         73,        1,     2304, 0x1929bc7e
-0,         59,         59,        1,     8640, 0x3ee30f9c
-1,         74,         74,        1,     2304, 0x5fc97897
-0,         60,         60,        1,     8728, 0xdbe12a94
-1,         75,         75,        1,     2304, 0x272da8d3
-1,         76,         76,        1,     2304, 0x141e904d
-0,         61,         61,        1,     8748, 0xc4132fd5
-1,         77,         77,        1,     2304, 0x9880b0ed
-0,         62,         62,        1,     8720, 0x7ac9316a
-1,         78,         78,        1,     2304, 0x0438932a
-0,         63,         63,        1,     8756, 0xf47d843d
-1,         79,         79,        1,     2304, 0x27069761
-0,         64,         64,        1,     8840, 0x82808e79
-1,         80,         80,        1,     2304, 0x0baba2b7
-1,         81,         81,        1,     2304, 0x4bc491af
-0,         65,         65,        1,     8908, 0x63568647
-1,         82,         82,        1,     2304, 0x72e18e82
-0,         66,         66,        1,     8968, 0xbd26de31
-1,         83,         83,        1,     2304, 0xf85d8a91
-0,         67,         67,        1,     9168, 0xe1cd43a3
-1,         84,         84,        1,     2304, 0x653582e3
-0,         68,         68,        1,     9272, 0x0cc64c79
-1,         85,         85,        1,     2304, 0x6b5e8084
-1,         86,         86,        1,     2304, 0x8cc27d10
-0,         69,         69,        1,     9700, 0x5cd2be73
-1,         87,         87,        1,     2304, 0xcf8f9e1d
-0,         70,         70,        1,     9868, 0x9b1629ae
-1,         88,         88,        1,     2304, 0xecbe89df
-0,         71,         71,        1,    10264, 0xa13cb7db
-1,         89,         89,        1,     2304, 0xa433753d
-0,         72,         72,        1,    10908, 0xe995858e
-1,         90,         90,        1,     2304, 0xe386afe9
-1,         91,         91,        1,     2304, 0x90409771
-0,         73,         73,        1,    11272, 0xebea53f6
-1,         92,         92,        1,     2304, 0x29c88ae5
-0,         74,         74,        1,    12128, 0xdfa8b7aa
-1,         93,         93,        1,     2304, 0x900b9e6a
-0,         75,         75,        1,    12560, 0x46048576
-1,         94,         94,        1,     2304, 0x958cbb49
-0,         76,         76,        1,    12900, 0x5b3aeb76
-1,         95,         95,        1,     2304, 0xf83da537
-1,         96,         96,        1,     2304, 0x5fad9e5f
-0,         77,         77,        1,    13544, 0x0f98fb94
-1,         97,         97,        1,     2304, 0xae15902a
-0,         78,         78,        1,    13968, 0x7c17c4c2
-1,         98,         98,        1,     2304, 0xf2a8b9d8
-0,         79,         79,        1,    15020, 0xe8faa930
-1,         99,         99,        1,     2304, 0x7bc99f71
-0,         80,         80,        1,    16152, 0x3f004f78
-1,        100,        100,        1,     2304, 0x3f199672
-1,        101,        101,        1,     2304, 0x4e258c38
-0,         81,         81,        1,    17224, 0x103f3935
-1,        102,        102,        1,     2304, 0x5119b909
-0,         82,         82,        1,    11956, 0x7af9354a
-1,        103,        103,        1,     2304, 0xad57a533
-0,         83,         83,        1,    12644, 0xe113a4b2
-1,        104,        104,        1,     2304, 0xe40eb453
-0,         84,         84,        1,    13420, 0xdf3ec8a4
-1,        105,        105,        1,     2304, 0x502cc37e
-1,        106,        106,        1,     2304, 0x5b7bae9a
-0,         85,         85,        1,    14140, 0x0ad8a165
-1,        107,        107,        1,     2304, 0x0458a92d
-0,         86,         86,        1,    15192, 0xc55f45cd
-1,        108,        108,        1,     2304, 0x1529aba8
-0,         87,         87,        1,    12740, 0xa13c85db
-1,        109,        109,        1,     2304, 0x1a52a9d1
-0,         88,         88,        1,    14416, 0x9e68b57d
-1,        110,        110,        1,     2304, 0x76a2a7c9
diff --git a/deps/libav/tests/ref/fate/ptx b/deps/libav/tests/ref/fate/ptx
deleted file mode 100644
index fad2a50..0000000
--- a/deps/libav/tests/ref/fate/ptx
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   393216, 0xda280efc
diff --git a/deps/libav/tests/ref/fate/pva-demux b/deps/libav/tests/ref/fate/pva-demux
deleted file mode 100644
index 69b1d40..0000000
--- a/deps/libav/tests/ref/fate/pva-demux
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,     2160,      384, 0x071abcc8
-0,       2160,       2160,     2160,      384, 0x31c9aee0
-0,       4320,       4320,     2160,      384, 0xa50eaa94
-0,       6480,       6480,     2160,      384, 0x9e86ba0e
-0,       8640,       8640,     2160,      384, 0x2321b800
-0,      10800,      10800,     2160,      384, 0x2347afa8
-0,      12960,      12960,     2160,      384, 0x0831b8d3
-0,      15120,      15120,     2160,      384, 0xd5acafa1
-0,      17280,      17280,     2160,      384, 0xc975b9d2
-0,      19440,      19440,     2160,      384, 0x2e10b02a
-0,      21600,      21600,     2160,      384, 0x501eadd0
-0,      23760,      23760,     2160,      384, 0x153fc171
-0,      25920,      25920,     2160,      384, 0xc5f0b3c2
-0,      28080,      28080,     2160,      384, 0xf731b200
-0,      30240,      30240,     2160,      384, 0x2e16b713
-0,      32400,      32400,     2160,      384, 0x61f6bba9
-0,      34560,      34560,     2160,      384, 0x1b9eb0ff
-0,      36720,      36720,     2160,      384, 0x2ab4b7bd
-0,      38880,      38880,     2160,      384, 0xd66eb45c
-0,      41040,      41040,     2160,      384, 0x145ab426
-0,      43200,      43200,     2160,      384, 0x297cb370
-0,      45360,      45360,     2160,      384, 0x287bb6b7
-0,      47520,      47520,     2160,      384, 0xfddbb7df
-0,      49680,      49680,     2160,      384, 0xbbb2af0c
-0,      51840,      51840,     2160,      384, 0x8f03b5fc
diff --git a/deps/libav/tests/ref/fate/qcp-demux b/deps/libav/tests/ref/fate/qcp-demux
deleted file mode 100644
index cd7157d..0000000
--- a/deps/libav/tests/ref/fate/qcp-demux
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x4f9f567a
diff --git a/deps/libav/tests/ref/fate/qpeg b/deps/libav/tests/ref/fate/qpeg
deleted file mode 100644
index eca2924..0000000
--- a/deps/libav/tests/ref/fate/qpeg
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   230400, 0x0b712fba
-0,          1,          1,        1,   230400, 0x30252ac7
-0,          2,          2,        1,   230400, 0x6d98a787
-0,          3,          3,        1,   230400, 0x5d1f6ce7
-0,          4,          4,        1,   230400, 0xccb79136
-0,          5,          5,        1,   230400, 0x394093e1
-0,          6,          6,        1,   230400, 0x3e76c5e9
-0,          7,          7,        1,   230400, 0xd6cdc8f1
-0,          8,          8,        1,   230400, 0xd355371d
-0,          9,          9,        1,   230400, 0x2c1519ca
-0,         10,         10,        1,   230400, 0xd82427e1
-0,         11,         11,        1,   230400, 0x4202e3b4
-0,         12,         12,        1,   230400, 0x27c15cda
-0,         13,         13,        1,   230400, 0x3fd7d5db
-0,         14,         14,        1,   230400, 0x03838791
-0,         15,         15,        1,   230400, 0x8253d774
-0,         16,         16,        1,   230400, 0x833e9c9f
-0,         17,         17,        1,   230400, 0xe30aba05
-0,         18,         18,        1,   230400, 0x81056b68
-0,         19,         19,        1,   230400, 0xe6454d37
-0,         20,         20,        1,   230400, 0x6bb65f77
-0,         21,         21,        1,   230400, 0x95b652eb
-0,         22,         22,        1,   230400, 0x4f585a73
-0,         23,         23,        1,   230400, 0x9bc2c9d8
-0,         24,         24,        1,   230400, 0x09f00930
-0,         25,         25,        1,   230400, 0x6be9d11a
-0,         26,         26,        1,   230400, 0x5cdd4ea5
-0,         27,         27,        1,   230400, 0x77508d67
-0,         28,         28,        1,   230400, 0x76b21fdd
-0,         29,         29,        1,   230400, 0x39e2dddb
-0,         30,         30,        1,   230400, 0x8b16d389
-0,         31,         31,        1,   230400, 0xb2b329fb
-0,         32,         32,        1,   230400, 0x8e998c17
-0,         33,         33,        1,   230400, 0x3852049f
-0,         34,         34,        1,   230400, 0x5a7f6302
-0,         35,         35,        1,   230400, 0xdd7d9d86
-0,         36,         36,        1,   230400, 0x337298bd
-0,         37,         37,        1,   230400, 0x2fa38668
-0,         38,         38,        1,   230400, 0xfc42afcd
-0,         39,         39,        1,   230400, 0x20ff7b1d
-0,         40,         40,        1,   230400, 0xa9190f28
-0,         41,         41,        1,   230400, 0x2ca26827
-0,         42,         42,        1,   230400, 0x1106bd55
-0,         43,         43,        1,   230400, 0xb965748e
-0,         44,         44,        1,   230400, 0x2c2d2691
-0,         45,         45,        1,   230400, 0x8096db4d
-0,         46,         46,        1,   230400, 0x7b223871
-0,         47,         47,        1,   230400, 0xf9edbca9
-0,         48,         48,        1,   230400, 0x0e607f74
-0,         49,         49,        1,   230400, 0x3e64ed79
-0,         50,         50,        1,   230400, 0x2198f77a
-0,         51,         51,        1,   230400, 0x3cf4925a
-0,         52,         52,        1,   230400, 0x2de0ebdb
-0,         53,         53,        1,   230400, 0x5104c55f
-0,         54,         54,        1,   230400, 0xebd7f8f7
-0,         55,         55,        1,   230400, 0xfce8a2ae
-0,         56,         56,        1,   230400, 0xeb073121
-0,         57,         57,        1,   230400, 0x8f2ed47d
-0,         58,         58,        1,   230400, 0xdcb72934
-0,         59,         59,        1,   230400, 0xf69e75a1
-0,         60,         60,        1,   230400, 0xc45ab599
-0,         61,         61,        1,   230400, 0x0d218766
-0,         62,         62,        1,   230400, 0x4a6aafce
-0,         63,         63,        1,   230400, 0x642153ca
-0,         64,         64,        1,   230400, 0x8bd7a2a4
-0,         65,         65,        1,   230400, 0x04abeeed
-0,         66,         66,        1,   230400, 0x37bf9f2c
-0,         67,         67,        1,   230400, 0x1d966ae5
-0,         68,         68,        1,   230400, 0x3a2ef337
-0,         69,         69,        1,   230400, 0x9edaf34f
-0,         70,         70,        1,   230400, 0x7f3c0ff8
-0,         71,         71,        1,   230400, 0x403cbdee
-0,         72,         72,        1,   230400, 0x86b340e8
-0,         73,         73,        1,   230400, 0x5a57c916
-0,         74,         74,        1,   230400, 0x35763ab3
-0,         75,         75,        1,   230400, 0xd135a1ba
-0,         76,         76,        1,   230400, 0x56a7b1db
-0,         77,         77,        1,   230400, 0x6e8d2910
-0,         78,         78,        1,   230400, 0xc8d9c4e1
-0,         79,         79,        1,   230400, 0xb61fd11f
-0,         80,         80,        1,   230400, 0x8949b165
-0,         81,         81,        1,   230400, 0x60082f69
-0,         82,         82,        1,   230400, 0xf9c74a14
-0,         83,         83,        1,   230400, 0x1f0af3f4
-0,         84,         84,        1,   230400, 0x1abe4a3b
-0,         85,         85,        1,   230400, 0xdf762ffb
-0,         86,         86,        1,   230400, 0x38513b73
-0,         87,         87,        1,   230400, 0xf3b01fcf
-0,         88,         88,        1,   230400, 0xea7d486c
-0,         89,         89,        1,   230400, 0xfabc7a89
-0,         90,         90,        1,   230400, 0xc72f6977
-0,         91,         91,        1,   230400, 0x1c9e4590
-0,         92,         92,        1,   230400, 0x51abf71e
-0,         93,         93,        1,   230400, 0x39c9d819
-0,         94,         94,        1,   230400, 0xfc62d8e0
-0,         95,         95,        1,   230400, 0x40bb8c0d
-0,         96,         96,        1,   230400, 0xa0bd86d2
-0,         97,         97,        1,   230400, 0x610dfe19
-0,         98,         98,        1,   230400, 0x997e1572
-0,         99,         99,        1,   230400, 0x49919319
diff --git a/deps/libav/tests/ref/fate/qt-alaw-mono b/deps/libav/tests/ref/fate/qt-alaw-mono
deleted file mode 100644
index fc23d57..0000000
--- a/deps/libav/tests/ref/fate/qt-alaw-mono
+++ /dev/null
@@ -1 +0,0 @@
-7257c296fbba7eedf688fcb667144f7b
diff --git a/deps/libav/tests/ref/fate/qt-alaw-stereo b/deps/libav/tests/ref/fate/qt-alaw-stereo
deleted file mode 100644
index 1a9af29..0000000
--- a/deps/libav/tests/ref/fate/qt-alaw-stereo
+++ /dev/null
@@ -1 +0,0 @@
-011d4aecaee697cc861012b7c25b5d40
diff --git a/deps/libav/tests/ref/fate/qt-ima4-mono b/deps/libav/tests/ref/fate/qt-ima4-mono
deleted file mode 100644
index b8fc5f9..0000000
--- a/deps/libav/tests/ref/fate/qt-ima4-mono
+++ /dev/null
@@ -1 +0,0 @@
-e178ed520edf2f46492ae740d88f5815
diff --git a/deps/libav/tests/ref/fate/qt-ima4-stereo b/deps/libav/tests/ref/fate/qt-ima4-stereo
deleted file mode 100644
index 84c9f46..0000000
--- a/deps/libav/tests/ref/fate/qt-ima4-stereo
+++ /dev/null
@@ -1 +0,0 @@
-d22be0e193dcbba1068a1ca6ab04cf77
diff --git a/deps/libav/tests/ref/fate/qt-mac3-mono b/deps/libav/tests/ref/fate/qt-mac3-mono
deleted file mode 100644
index c320e18..0000000
--- a/deps/libav/tests/ref/fate/qt-mac3-mono
+++ /dev/null
@@ -1 +0,0 @@
-728d89210e1c90a9185db729b0b6e8c0
diff --git a/deps/libav/tests/ref/fate/qt-mac3-stereo b/deps/libav/tests/ref/fate/qt-mac3-stereo
deleted file mode 100644
index 7b5ce45..0000000
--- a/deps/libav/tests/ref/fate/qt-mac3-stereo
+++ /dev/null
@@ -1 +0,0 @@
-2eef3c68fce3d18ec757bcbc0d369698
diff --git a/deps/libav/tests/ref/fate/qt-mac6-mono b/deps/libav/tests/ref/fate/qt-mac6-mono
deleted file mode 100644
index d4d5104..0000000
--- a/deps/libav/tests/ref/fate/qt-mac6-mono
+++ /dev/null
@@ -1 +0,0 @@
-eec238d2737365fba15da813e5a7fbc9
diff --git a/deps/libav/tests/ref/fate/qt-mac6-stereo b/deps/libav/tests/ref/fate/qt-mac6-stereo
deleted file mode 100644
index d018cb0..0000000
--- a/deps/libav/tests/ref/fate/qt-mac6-stereo
+++ /dev/null
@@ -1 +0,0 @@
-2716d66016d8230bcc0fe90586da97a9
diff --git a/deps/libav/tests/ref/fate/qt-ulaw-mono b/deps/libav/tests/ref/fate/qt-ulaw-mono
deleted file mode 100644
index 62fbc4e..0000000
--- a/deps/libav/tests/ref/fate/qt-ulaw-mono
+++ /dev/null
@@ -1 +0,0 @@
-63075293c68079826146963e94f45ca6
diff --git a/deps/libav/tests/ref/fate/qt-ulaw-stereo b/deps/libav/tests/ref/fate/qt-ulaw-stereo
deleted file mode 100644
index 642f0cb..0000000
--- a/deps/libav/tests/ref/fate/qt-ulaw-stereo
+++ /dev/null
@@ -1 +0,0 @@
-96316117d444b06b2aa20877f7de36fd
diff --git a/deps/libav/tests/ref/fate/qtrle-16bit b/deps/libav/tests/ref/fate/qtrle-16bit
deleted file mode 100644
index d0d71b5..0000000
--- a/deps/libav/tests/ref/fate/qtrle-16bit
+++ /dev/null
@@ -1,84 +0,0 @@
-#tb 0: 1/600
-0,          0,          0,        1,    57600, 0xe6b0a48c
-0,         40,         40,        1,    57600, 0xe064d51c
-0,         80,         80,        1,    57600, 0xbfce6b33
-0,        120,        120,        1,    57600, 0x371bab02
-0,        160,        160,        1,    57600, 0x0d2d7456
-0,        200,        200,        1,    57600, 0x9184eecb
-0,        240,        240,        1,    57600, 0xb482e8db
-0,        280,        280,        1,    57600, 0x0f4cd4be
-0,        320,        320,        1,    57600, 0xe276cccb
-0,        360,        360,        1,    57600, 0x04c21c62
-0,        400,        400,        1,    57600, 0x848960a2
-0,        440,        440,        1,    57600, 0xc4c8cf03
-0,        480,        480,        1,    57600, 0xb4094866
-0,        520,        520,        1,    57600, 0xf22da043
-0,        560,        560,        1,    57600, 0x6517b67b
-0,        600,        600,        1,    57600, 0x23e39ccb
-0,        640,        640,        1,    57600, 0x41525ca3
-0,        680,        680,        1,    57600, 0xc3edc5f3
-0,        720,        720,        1,    57600, 0x8ce81c7e
-0,        760,        760,        1,    57600, 0x56829443
-0,        800,        800,        1,    57600, 0x511ce287
-0,        840,        840,        1,    57600, 0x8f029a5b
-0,        880,        880,        1,    57600, 0x2b47cf43
-0,        920,        920,        1,    57600, 0x8e7ecf4b
-0,        960,        960,        1,    57600, 0xd620317e
-0,       1000,       1000,        1,    57600, 0x5987646e
-0,       1040,       1040,        1,    57600, 0xcfedb7df
-0,       1080,       1080,        1,    57600, 0x33746e7b
-0,       1120,       1120,        1,    57600, 0x1d318573
-0,       1160,       1160,        1,    57600, 0xc851848b
-0,       1200,       1200,        1,    57600, 0x939db1d7
-0,       1240,       1240,        1,    57600, 0x1719aed3
-0,       1280,       1280,        1,    57600, 0x1ba3e18c
-0,       1320,       1320,        1,    57600, 0x04f355fb
-0,       1360,       1360,        1,    57600, 0x6fafd5f4
-0,       1400,       1400,        1,    57600, 0x434f800b
-0,       1440,       1440,        1,    57600, 0xed42179b
-0,       1480,       1480,        1,    57600, 0x3b33118b
-0,       1520,       1520,        1,    57600, 0xf81880cb
-0,       1560,       1560,        1,    57600, 0xd2c58e1b
-0,       1600,       1600,        1,    57600, 0xd96f50eb
-0,       1640,       1640,        1,    57600, 0x64ef63fb
-0,       1680,       1680,        1,    57600, 0x7b14b6fc
-0,       1720,       1720,        1,    57600, 0xeb1c9054
-0,       1760,       1760,        1,    57600, 0x3b30c97c
-0,       1800,       1800,        1,    57600, 0xc93e9484
-0,       1840,       1840,        1,    57600, 0xe012c0cc
-0,       1880,       1880,        1,    57600, 0x48e2dda4
-0,       1920,       1920,        1,    57600, 0x13eb55fb
-0,       1960,       1960,        1,    57600, 0xa5edbedc
-0,       2000,       2000,        1,    57600, 0x0123a484
-0,       2040,       2040,        1,    57600, 0xc624a7ac
-0,       2080,       2080,        1,    57600, 0xd83cf45c
-0,       2120,       2120,        1,    57600, 0x8f9bf4b4
-0,       2160,       2160,        1,    57600, 0x2d494b8c
-0,       2200,       2200,        1,    57600, 0xb246f07c
-0,       2240,       2240,        1,    57600, 0x5750e67c
-0,       2280,       2280,        1,    57600, 0x6643e9ac
-0,       2320,       2320,        1,    57600, 0x8d3b86b3
-0,       2360,       2360,        1,    57600, 0x4bb0546b
-0,       2400,       2400,        1,    57600, 0xfe439333
-0,       2440,       2440,        1,    57600, 0x0cc76233
-0,       2480,       2480,        1,    57600, 0xb6fe40ae
-0,       2520,       2520,        1,    57600, 0xf79fe0d7
-0,       2560,       2560,        1,    57600, 0xdc90dcbb
-0,       2600,       2600,        1,    57600, 0x371e7c2b
-0,       2640,       2640,        1,    57600, 0x7c4590bb
-0,       2680,       2680,        1,    57600, 0x66f5454b
-0,       2720,       2720,        1,    57600, 0x1678ae5b
-0,       2760,       2760,        1,    57600, 0x1ee8fdec
-0,       2800,       2800,        1,    57600, 0x98d2a083
-0,       2840,       2840,        1,    57600, 0x86d29e5b
-0,       2880,       2880,        1,    57600, 0x23d2bc83
-0,       2920,       2920,        1,    57600, 0x3fc729f2
-0,       2960,       2960,        1,    57600, 0x821d61da
-0,       3000,       3000,        1,    57600, 0xdd549e0e
-0,       3040,       3040,        1,    57600, 0x641234e2
-0,       3080,       3080,        1,    57600, 0x9a282112
-0,       3120,       3120,        1,    57600, 0x6587e2fb
-0,       3160,       3160,        1,    57600, 0x043d0cb2
-0,       3200,       3200,        1,    57600, 0x90328707
-0,       3240,       3240,        1,    57600, 0x5744d313
-0,       3280,       3280,        1,    57600, 0x6e1b95cb
diff --git a/deps/libav/tests/ref/fate/qtrle-1bit b/deps/libav/tests/ref/fate/qtrle-1bit
deleted file mode 100644
index a424e47..0000000
--- a/deps/libav/tests/ref/fate/qtrle-1bit
+++ /dev/null
@@ -1,39 +0,0 @@
-#tb 0: 1/1200
-0,          0,          0,        0,     9600, 0xc5921aa2
-0,        100,        100,        0,     9600, 0x9032fc52
-0,        200,        200,        0,     9600, 0x7db0038e
-0,        300,        300,        0,     9600, 0x95b73c41
-0,        400,        400,        0,     9600, 0x531e4189
-0,        500,        500,        0,     9600, 0xb73390ec
-0,        600,        600,        0,     9600, 0x958e8221
-0,        700,        700,        0,     9600, 0xd393f8a6
-0,        800,        800,        0,     9600, 0xa085da1c
-0,        900,        900,        0,     9600, 0x57ace74f
-0,       1000,       1000,        0,     9600, 0x5d11a308
-0,       1100,       1100,        0,     9600, 0x13e133b7
-0,       1200,       1200,        0,     9600, 0x494edb86
-0,       1300,       1300,        0,     9600, 0x43a448ea
-0,       1400,       1400,        0,     9600, 0x3562d35b
-0,       1500,       1500,        0,     9600, 0x0bc655d2
-0,       1600,       1600,        0,     9600, 0xbece73a1
-0,       1700,       1700,        0,     9600, 0x82e7cfa1
-0,       1800,       1800,        0,     9600, 0xda29fd8f
-0,       1900,       1900,        0,     9600, 0x70fb700b
-0,       2000,       2000,        0,     9600, 0xaf57a6b0
-0,       2100,       2100,        0,     9600, 0x0a5ed9b9
-0,       2200,       2200,        0,     9600, 0xf7c62c38
-0,       2300,       2300,        0,     9600, 0x0aa2ccfd
-0,       2400,       2400,        0,     9600, 0xc9adabae
-0,       2500,       2500,        0,     9600, 0x67ff0aba
-0,       2600,       2600,        0,     9600, 0xea79a465
-0,       2700,       2700,        0,     9600, 0x8928c626
-0,       2800,       2800,        0,     9600, 0x8dab4111
-0,       2900,       2900,        0,     9600, 0x81ef63f9
-0,       3000,       3000,        0,     9600, 0xf977bc5e
-0,       3100,       3100,        0,     9600, 0x9e6a3f4a
-0,       3200,       3200,        0,     9600, 0x77c92865
-0,       3300,       3300,        0,     9600, 0x3915170d
-0,       3400,       3400,        0,     9600, 0xbe19b995
-0,       3500,       3500,        0,     9600, 0x3e8a3077
-0,       3600,       3600,        0,     9600, 0x1331342e
-0,       3700,       3700,        0,     9600, 0x4d692175
diff --git a/deps/libav/tests/ref/fate/qtrle-24bit b/deps/libav/tests/ref/fate/qtrle-24bit
deleted file mode 100644
index 7a162b8..0000000
--- a/deps/libav/tests/ref/fate/qtrle-24bit
+++ /dev/null
@@ -1,35 +0,0 @@
-#tb 0: 1/600
-0,          0,          0,        1,    57600, 0x3718ad00
-0,         60,         60,        1,    57600, 0x54861558
-0,        120,        120,        1,    57600, 0xea1d6233
-0,        180,        180,        1,    57600, 0xf669a2fd
-0,        240,        240,        1,    57600, 0xc9f76f31
-0,        300,        300,        1,    57600, 0xe23c6d7b
-0,        360,        360,        1,    57600, 0xbc9d6167
-0,        420,        420,        1,    57600, 0x0ca63477
-0,        480,        480,        1,    57600, 0xc0850d22
-0,        540,        540,        1,    57600, 0x735d10b2
-0,        600,        600,        1,    57600, 0x561f3c4a
-0,        660,        660,        1,    57600, 0x84db9cf1
-0,        720,        720,        1,    57600, 0x9fb841f4
-0,        780,        780,        1,    57600, 0xeaf262ab
-0,        840,        840,        1,    57600, 0x264886b4
-0,        900,        900,        1,    57600, 0x5edc5518
-0,        960,        960,        1,    57600, 0xd3e60c72
-0,       1020,       1020,        1,    57600, 0x9cabaed7
-0,       1080,       1080,        1,    57600, 0x616716cf
-0,       1140,       1140,        1,    57600, 0xa43f61aa
-0,       1200,       1200,        1,    57600, 0xdba3a0bd
-0,       1260,       1260,        1,    57600, 0xa7dd6dfa
-0,       1320,       1320,        1,    57600, 0xc3fa6c84
-0,       1380,       1380,        1,    57600, 0xb1275fb8
-0,       1440,       1440,        1,    57600, 0x2e39331f
-0,       1500,       1500,        1,    57600, 0x5b9e0bca
-0,       1560,       1560,        1,    57600, 0x0e760f5a
-0,       1620,       1620,        1,    57600, 0xc56c3e69
-0,       1680,       1680,        1,    57600, 0x51da9fb8
-0,       1740,       1740,        1,    57600, 0xe3a1432b
-0,       1800,       1800,        1,    57600, 0xe1b360a3
-0,       1860,       1860,        1,    57600, 0x30b383cd
-0,       1920,       1920,        1,    57600, 0x950c5439
-0,       1980,       1980,        1,    57600, 0x8f9d0ca2
diff --git a/deps/libav/tests/ref/fate/qtrle-2bit b/deps/libav/tests/ref/fate/qtrle-2bit
deleted file mode 100644
index 5866db5..0000000
--- a/deps/libav/tests/ref/fate/qtrle-2bit
+++ /dev/null
@@ -1,39 +0,0 @@
-#tb 0: 1/1200
-0,          0,          0,        0,   230400, 0xb1ee55dc
-0,        100,        100,        0,   230400, 0x97c580bf
-0,        200,        200,        0,   230400, 0xd4bd57e8
-0,        300,        300,        0,   230400, 0x412b79aa
-0,        400,        400,        0,   230400, 0x928a44d1
-0,        500,        500,        0,   230400, 0x6bbdc0e4
-0,        600,        600,        0,   230400, 0x382e960f
-0,        700,        700,        0,   230400, 0x62c863ea
-0,        800,        800,        0,   230400, 0xbfccd3ce
-0,        900,        900,        0,   230400, 0x1987cdd4
-0,       1000,       1000,        0,   230400, 0x40279727
-0,       1100,       1100,        0,   230400, 0x9d4f6746
-0,       1200,       1200,        0,   230400, 0x7b8a77ec
-0,       1300,       1300,        0,   230400, 0x2ce7a781
-0,       1400,       1400,        0,   230400, 0xb749815e
-0,       1500,       1500,        0,   230400, 0x61c88610
-0,       1600,       1600,        0,   230400, 0x8449114d
-0,       1700,       1700,        0,   230400, 0x5f73e666
-0,       1800,       1800,        0,   230400, 0xbde53ce6
-0,       1900,       1900,        0,   230400, 0x8c7406fd
-0,       2000,       2000,        0,   230400, 0xf9e9a3ef
-0,       2100,       2100,        0,   230400, 0x7e0a3077
-0,       2200,       2200,        0,   230400, 0xd9245c5f
-0,       2300,       2300,        0,   230400, 0x6d077ea2
-0,       2400,       2400,        0,   230400, 0xf622bb2a
-0,       2500,       2500,        0,   230400, 0x35292dc8
-0,       2600,       2600,        0,   230400, 0xc0cea946
-0,       2700,       2700,        0,   230400, 0x98b27b60
-0,       2800,       2800,        0,   230400, 0x668ef6bd
-0,       2900,       2900,        0,   230400, 0x6c07a31c
-0,       3000,       3000,        0,   230400, 0x0b4a6ae1
-0,       3100,       3100,        0,   230400, 0x945b9878
-0,       3200,       3200,        0,   230400, 0xab28031c
-0,       3300,       3300,        0,   230400, 0x977252b0
-0,       3400,       3400,        0,   230400, 0x6c3d9706
-0,       3500,       3500,        0,   230400, 0xe053bc2a
-0,       3600,       3600,        0,   230400, 0x4cf2fc7c
-0,       3700,       3700,        0,   230400, 0x610beda7
diff --git a/deps/libav/tests/ref/fate/qtrle-32bit b/deps/libav/tests/ref/fate/qtrle-32bit
deleted file mode 100644
index bbdd464..0000000
--- a/deps/libav/tests/ref/fate/qtrle-32bit
+++ /dev/null
@@ -1,27 +0,0 @@
-#tb 0: 1/2997
-0,          0,          0,        0,  1036800, 0x2a90d062
-0,        100,        100,        0,  1036800, 0x6565aded
-0,        200,        200,        0,  1036800, 0xf0b587d2
-0,        300,        300,        0,  1036800, 0xf0b4e53f
-0,        400,        400,        0,  1036800, 0x5ba4b96a
-0,        500,        500,        0,  1036800, 0x501df9c1
-0,        600,        600,        0,  1036800, 0xcf45b940
-0,        700,        700,        0,  1036800, 0xa454df07
-0,        800,        800,        0,  1036800, 0xc504d152
-0,        900,        900,        0,  1036800, 0xd90ecac7
-0,       1000,       1000,        0,  1036800, 0xe30368df
-0,       1100,       1100,        0,  1036800, 0x0ca35522
-0,       1200,       1200,        0,  1036800, 0xe76b8d43
-0,       1300,       1300,        0,  1036800, 0x7c85a447
-0,       1400,       1400,        0,  1036800, 0x3e2d1b5f
-0,       1500,       1500,        0,  1036800, 0x230fa5a6
-0,       1600,       1600,        0,  1036800, 0x4fad025e
-0,       1700,       1700,        0,  1036800, 0x7d3366ae
-0,       1800,       1800,        0,  1036800, 0xa83720f7
-0,       1900,       1900,        0,  1036800, 0x5dbd13b1
-0,       2000,       2000,        0,  1036800, 0xd0ebd56d
-0,       2100,       2100,        0,  1036800, 0x4d7c67f3
-0,       2200,       2200,        0,  1036800, 0x226baa3f
-0,       2300,       2300,        0,  1036800, 0xc0e93acf
-0,       2400,       2400,        0,  1036800, 0x5a466c17
-0,       2500,       2500,        0,  1036800, 0xfdb7d2ea
diff --git a/deps/libav/tests/ref/fate/qtrle-4bit b/deps/libav/tests/ref/fate/qtrle-4bit
deleted file mode 100644
index cc09e78..0000000
--- a/deps/libav/tests/ref/fate/qtrle-4bit
+++ /dev/null
@@ -1,39 +0,0 @@
-#tb 0: 1/1200
-0,          0,          0,        0,   230400, 0x0655b3d9
-0,        100,        100,        0,   230400, 0x9c626fd3
-0,        200,        200,        0,   230400, 0x5bc95868
-0,        300,        300,        0,   230400, 0x55a38387
-0,        400,        400,        0,   230400, 0xd3495b60
-0,        500,        500,        0,   230400, 0xecdb2d15
-0,        600,        600,        0,   230400, 0x7f9b373e
-0,        700,        700,        0,   230400, 0x51caac22
-0,        800,        800,        0,   230400, 0x0f2ac153
-0,        900,        900,        0,   230400, 0xe5a6f9e7
-0,       1000,       1000,        0,   230400, 0xfc2b2250
-0,       1100,       1100,        0,   230400, 0x24e2da1b
-0,       1200,       1200,        0,   230400, 0x2723d7dd
-0,       1300,       1300,        0,   230400, 0x024a4989
-0,       1400,       1400,        0,   230400, 0xdbafb92d
-0,       1500,       1500,        0,   230400, 0x6b9b5056
-0,       1600,       1600,        0,   230400, 0x010cabb4
-0,       1700,       1700,        0,   230400, 0xf75bc1c0
-0,       1800,       1800,        0,   230400, 0x6c7fd744
-0,       1900,       1900,        0,   230400, 0xabe4371a
-0,       2000,       2000,        0,   230400, 0xe41fb781
-0,       2100,       2100,        0,   230400, 0x42c5649e
-0,       2200,       2200,        0,   230400, 0xf5511deb
-0,       2300,       2300,        0,   230400, 0xebf5ab32
-0,       2400,       2400,        0,   230400, 0x44398194
-0,       2500,       2500,        0,   230400, 0xfd63510c
-0,       2600,       2600,        0,   230400, 0xa013975e
-0,       2700,       2700,        0,   230400, 0xe0aa028d
-0,       2800,       2800,        0,   230400, 0x349f6f3b
-0,       2900,       2900,        0,   230400, 0x2446032c
-0,       3000,       3000,        0,   230400, 0x648f122c
-0,       3100,       3100,        0,   230400, 0xbda221fd
-0,       3200,       3200,        0,   230400, 0xf0f97642
-0,       3300,       3300,        0,   230400, 0x6a1737de
-0,       3400,       3400,        0,   230400, 0x808a8179
-0,       3500,       3500,        0,   230400, 0x121641cf
-0,       3600,       3600,        0,   230400, 0x275d11ea
-0,       3700,       3700,        0,   230400, 0x92adf2cf
diff --git a/deps/libav/tests/ref/fate/qtrle-8bit b/deps/libav/tests/ref/fate/qtrle-8bit
deleted file mode 100644
index bef2358..0000000
--- a/deps/libav/tests/ref/fate/qtrle-8bit
+++ /dev/null
@@ -1,168 +0,0 @@
-#tb 0: 1/600
-0,          0,          0,        1,   921600, 0x1492e3ed
-0,         40,         40,        1,   921600, 0x1492e3ed
-0,         80,         80,        1,   921600, 0x1492e3ed
-0,        120,        120,        1,   921600, 0x23ef4fc7
-0,        160,        160,        1,   921600, 0x23ef4fc7
-0,        200,        200,        1,   921600, 0xe406d4be
-0,        240,        240,        1,   921600, 0xe406d4be
-0,        280,        280,        1,   921600, 0xe406d4be
-0,        320,        320,        1,   921600, 0x62b8b5a1
-0,        360,        360,        1,   921600, 0x62b8b5a1
-0,        400,        400,        1,   921600, 0x7d8ba674
-0,        440,        440,        1,   921600, 0x7d8ba674
-0,        480,        480,        1,   921600, 0x7d8ba674
-0,        520,        520,        1,   921600, 0xfe666be7
-0,        560,        560,        1,   921600, 0xfe666be7
-0,        600,        600,        1,   921600, 0x721baec0
-0,        640,        640,        1,   921600, 0x721baec0
-0,        680,        680,        1,   921600, 0x721baec0
-0,        720,        720,        1,   921600, 0xc237180a
-0,        760,        760,        1,   921600, 0xc237180a
-0,        800,        800,        1,   921600, 0xf03a7482
-0,        840,        840,        1,   921600, 0xf03a7482
-0,        880,        880,        1,   921600, 0xf03a7482
-0,        920,        920,        1,   921600, 0x5612a391
-0,        960,        960,        1,   921600, 0x5612a391
-0,       1000,       1000,        1,   921600, 0x9dbcc46a
-0,       1040,       1040,        1,   921600, 0x9dbcc46a
-0,       1080,       1080,        1,   921600, 0x9dbcc46a
-0,       1120,       1120,        1,   921600, 0xa128a5d5
-0,       1160,       1160,        1,   921600, 0xa128a5d5
-0,       1200,       1200,        1,   921600, 0x63e0025c
-0,       1240,       1240,        1,   921600, 0x63e0025c
-0,       1280,       1280,        1,   921600, 0x63e0025c
-0,       1320,       1320,        1,   921600, 0x262359ed
-0,       1360,       1360,        1,   921600, 0x262359ed
-0,       1400,       1400,        1,   921600, 0x343688e8
-0,       1440,       1440,        1,   921600, 0x343688e8
-0,       1480,       1480,        1,   921600, 0x343688e8
-0,       1520,       1520,        1,   921600, 0x343688e8
-0,       1560,       1560,        1,   921600, 0x343688e8
-0,       1600,       1600,        1,   921600, 0x343688e8
-0,       1640,       1640,        1,   921600, 0x343688e8
-0,       1680,       1680,        1,   921600, 0x343688e8
-0,       1720,       1720,        1,   921600, 0x343688e8
-0,       1760,       1760,        1,   921600, 0x343688e8
-0,       1800,       1800,        1,   921600, 0xe4b29d57
-0,       1840,       1840,        1,   921600, 0xe4b29d57
-0,       1880,       1880,        1,   921600, 0xe4b29d57
-0,       1920,       1920,        1,   921600, 0x198e8a4a
-0,       1960,       1960,        1,   921600, 0x198e8a4a
-0,       2000,       2000,        1,   921600, 0x0cad8dc9
-0,       2040,       2040,        1,   921600, 0x0cad8dc9
-0,       2080,       2080,        1,   921600, 0x0cad8dc9
-0,       2120,       2120,        1,   921600, 0x1f74cf3d
-0,       2160,       2160,        1,   921600, 0x1f74cf3d
-0,       2200,       2200,        1,   921600, 0xec5b5449
-0,       2240,       2240,        1,   921600, 0xec5b5449
-0,       2280,       2280,        1,   921600, 0xec5b5449
-0,       2320,       2320,        1,   921600, 0x39829711
-0,       2360,       2360,        1,   921600, 0x39829711
-0,       2400,       2400,        1,   921600, 0x6de5b9c6
-0,       2440,       2440,        1,   921600, 0x6de5b9c6
-0,       2480,       2480,        1,   921600, 0x6de5b9c6
-0,       2520,       2520,        1,   921600, 0x47b0e9d4
-0,       2560,       2560,        1,   921600, 0x47b0e9d4
-0,       2600,       2600,        1,   921600, 0x756452b8
-0,       2640,       2640,        1,   921600, 0x756452b8
-0,       2680,       2680,        1,   921600, 0x756452b8
-0,       2720,       2720,        1,   921600, 0x6fce3478
-0,       2760,       2760,        1,   921600, 0x6fce3478
-0,       2800,       2800,        1,   921600, 0x372397cd
-0,       2840,       2840,        1,   921600, 0x372397cd
-0,       2880,       2880,        1,   921600, 0x372397cd
-0,       2920,       2920,        1,   921600, 0xe3999ba1
-0,       2960,       2960,        1,   921600, 0xe3999ba1
-0,       3000,       3000,        1,   921600, 0x6ba26b43
-0,       3040,       3040,        1,   921600, 0x6ba26b43
-0,       3080,       3080,        1,   921600, 0x6ba26b43
-0,       3120,       3120,        1,   921600, 0x4e9ee49e
-0,       3160,       3160,        1,   921600, 0x4e9ee49e
-0,       3200,       3200,        1,   921600, 0xdb5fd6e7
-0,       3240,       3240,        1,   921600, 0xdb5fd6e7
-0,       3280,       3280,        1,   921600, 0xdb5fd6e7
-0,       3320,       3320,        1,   921600, 0x8f2254a5
-0,       3360,       3360,        1,   921600, 0x8f2254a5
-0,       3400,       3400,        1,   921600, 0x8f2254a5
-0,       3440,       3440,        1,   921600, 0x8f2254a5
-0,       3480,       3480,        1,   921600, 0x8f2254a5
-0,       3520,       3520,        1,   921600, 0x8f2254a5
-0,       3560,       3560,        1,   921600, 0x8f2254a5
-0,       3600,       3600,        1,   921600, 0x8f2254a5
-0,       3640,       3640,        1,   921600, 0x8f2254a5
-0,       3680,       3680,        1,   921600, 0x8f2254a5
-0,       3720,       3720,        1,   921600, 0x57e95c32
-0,       3760,       3760,        1,   921600, 0x57e95c32
-0,       3800,       3800,        1,   921600, 0x41627a9b
-0,       3840,       3840,        1,   921600, 0x41627a9b
-0,       3880,       3880,        1,   921600, 0x41627a9b
-0,       3920,       3920,        1,   921600, 0x7412dcee
-0,       3960,       3960,        1,   921600, 0x7412dcee
-0,       4000,       4000,        1,   921600, 0xaebe10ed
-0,       4040,       4040,        1,   921600, 0xaebe10ed
-0,       4080,       4080,        1,   921600, 0xaebe10ed
-0,       4120,       4120,        1,   921600, 0x411a91f6
-0,       4160,       4160,        1,   921600, 0x411a91f6
-0,       4200,       4200,        1,   921600, 0xb059df3f
-0,       4240,       4240,        1,   921600, 0xb059df3f
-0,       4280,       4280,        1,   921600, 0xb059df3f
-0,       4320,       4320,        1,   921600, 0x4d6f5a77
-0,       4360,       4360,        1,   921600, 0x4d6f5a77
-0,       4400,       4400,        1,   921600, 0xbbf06df4
-0,       4440,       4440,        1,   921600, 0xbbf06df4
-0,       4480,       4480,        1,   921600, 0xbbf06df4
-0,       4520,       4520,        1,   921600, 0xe27f7bf6
-0,       4560,       4560,        1,   921600, 0xe27f7bf6
-0,       4600,       4600,        1,   921600, 0xd7e8360e
-0,       4640,       4640,        1,   921600, 0xd7e8360e
-0,       4680,       4680,        1,   921600, 0xd7e8360e
-0,       4720,       4720,        1,   921600, 0x1dd4c344
-0,       4760,       4760,        1,   921600, 0x1dd4c344
-0,       4800,       4800,        1,   921600, 0x7995a7ce
-0,       4840,       4840,        1,   921600, 0x7995a7ce
-0,       4880,       4880,        1,   921600, 0x7995a7ce
-0,       4920,       4920,        1,   921600, 0x2ef3c566
-0,       4960,       4960,        1,   921600, 0x2ef3c566
-0,       5000,       5000,        1,   921600, 0xf296736e
-0,       5040,       5040,        1,   921600, 0xf296736e
-0,       5080,       5080,        1,   921600, 0xf296736e
-0,       5120,       5120,        1,   921600, 0xf296736e
-0,       5160,       5160,        1,   921600, 0xf296736e
-0,       5200,       5200,        1,   921600, 0xf296736e
-0,       5240,       5240,        1,   921600, 0xf296736e
-0,       5280,       5280,        1,   921600, 0xf296736e
-0,       5320,       5320,        1,   921600, 0xf296736e
-0,       5360,       5360,        1,   921600, 0xf296736e
-0,       5400,       5400,        1,   921600, 0x1a488311
-0,       5440,       5440,        1,   921600, 0x1a488311
-0,       5480,       5480,        1,   921600, 0x1a488311
-0,       5520,       5520,        1,   921600, 0x9e28011b
-0,       5560,       5560,        1,   921600, 0x9e28011b
-0,       5600,       5600,        1,   921600, 0x84d1ea80
-0,       5640,       5640,        1,   921600, 0x84d1ea80
-0,       5680,       5680,        1,   921600, 0x84d1ea80
-0,       5720,       5720,        1,   921600, 0x9ed41052
-0,       5760,       5760,        1,   921600, 0x9ed41052
-0,       5800,       5800,        1,   921600, 0xd4db7206
-0,       5840,       5840,        1,   921600, 0xd4db7206
-0,       5880,       5880,        1,   921600, 0xd4db7206
-0,       5920,       5920,        1,   921600, 0x55f695a9
-0,       5960,       5960,        1,   921600, 0x55f695a9
-0,       6000,       6000,        1,   921600, 0x9d8c667f
-0,       6040,       6040,        1,   921600, 0x9d8c667f
-0,       6080,       6080,        1,   921600, 0x9d8c667f
-0,       6120,       6120,        1,   921600, 0x9b6037ec
-0,       6160,       6160,        1,   921600, 0x9b6037ec
-0,       6200,       6200,        1,   921600, 0x57c5e835
-0,       6240,       6240,        1,   921600, 0x57c5e835
-0,       6280,       6280,        1,   921600, 0x57c5e835
-0,       6320,       6320,        1,   921600, 0x476dad89
-0,       6360,       6360,        1,   921600, 0x476dad89
-0,       6400,       6400,        1,   921600, 0xcfd6ad2b
-0,       6440,       6440,        1,   921600, 0xcfd6ad2b
-0,       6480,       6480,        1,   921600, 0xcfd6ad2b
-0,       6520,       6520,        1,   921600, 0x3b372379
-0,       6560,       6560,        1,   921600, 0x3b372379
-0,       6600,       6600,        1,   921600, 0x36f245f5
-0,       6620,       6620,        1,   921600, 0x36f245f5
diff --git a/deps/libav/tests/ref/fate/quickdraw b/deps/libav/tests/ref/fate/quickdraw
deleted file mode 100644
index 9a55ad5..0000000
--- a/deps/libav/tests/ref/fate/quickdraw
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/600
-0,          0,          0,        1,   921600, 0xc0e68764
-0,         80,         80,        1,   921600, 0x01a16629
diff --git a/deps/libav/tests/ref/fate/r210 b/deps/libav/tests/ref/fate/r210
deleted file mode 100644
index 45bb10c..0000000
--- a/deps/libav/tests/ref/fate/r210
+++ /dev/null
@@ -1,4 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,  1843200, 0xbd414b93
-0,          1,          1,        1,  1843200, 0x23298f1f
-0,          2,          2,        1,  1843200, 0x5a56df19
diff --git a/deps/libav/tests/ref/fate/ra-144 b/deps/libav/tests/ref/fate/ra-144
deleted file mode 100644
index 4710566..0000000
--- a/deps/libav/tests/ref/fate/ra-144
+++ /dev/null
@@ -1 +0,0 @@
-2da17ae831ea415592c7e6828e3fb69a
diff --git a/deps/libav/tests/ref/fate/ralf b/deps/libav/tests/ref/fate/ralf
deleted file mode 100644
index fb31c3f..0000000
--- a/deps/libav/tests/ref/fate/ralf
+++ /dev/null
@@ -1 +0,0 @@
-10da0398e06a470a0b97817fe113abcb
diff --git a/deps/libav/tests/ref/fate/redcode-demux b/deps/libav/tests/ref/fate/redcode-demux
deleted file mode 100644
index 34a2924..0000000
--- a/deps/libav/tests/ref/fate/redcode-demux
+++ /dev/null
@@ -1,7 +0,0 @@
-#tb 0: 1/240000
-#tb 1: 1/240000
-0,          0,          0,    10010,  1626280, 0x5768c7d6
-1,          0,          0,    18140,    14816, 0xd185e8c7
-0,      10010,      10010,    10010,  1626092, 0x070bd882
-1,      18140,      18140,    40920,    32736, 0x791b737a
-0,      20020,      20020,    10010,   893932, 0x8c7cd0a6
diff --git a/deps/libav/tests/ref/fate/rl2 b/deps/libav/tests/ref/fate/rl2
deleted file mode 100644
index d7dd23d..0000000
--- a/deps/libav/tests/ref/fate/rl2
+++ /dev/null
@@ -1,109 +0,0 @@
-#tb 0: 1171/11025
-0,          0,          0,        1,   192000, 0x7112a667
-0,          1,          1,        1,   192000, 0x6936abf3
-0,          2,          2,        1,   192000, 0xb1f08981
-0,          3,          3,        1,   192000, 0x4ce7fece
-0,          4,          4,        1,   192000, 0xf04decde
-0,          5,          5,        1,   192000, 0x47fef74b
-0,          6,          6,        1,   192000, 0x99b42ac2
-0,          7,          7,        1,   192000, 0x3c4c419d
-0,          8,          8,        1,   192000, 0x66bf5588
-0,          9,          9,        1,   192000, 0xe1de4725
-0,         10,         10,        1,   192000, 0x348b2af9
-0,         11,         11,        1,   192000, 0x1ce73e83
-0,         12,         12,        1,   192000, 0xcdaa6e02
-0,         13,         13,        1,   192000, 0x370dc2ce
-0,         14,         14,        1,   192000, 0x1e1e40fe
-0,         15,         15,        1,   192000, 0x491470a4
-0,         16,         16,        1,   192000, 0x88c43e9a
-0,         17,         17,        1,   192000, 0x036f3f44
-0,         18,         18,        1,   192000, 0xc8be7e25
-0,         19,         19,        1,   192000, 0xbedb397d
-0,         20,         20,        1,   192000, 0x97c410f4
-0,         21,         21,        1,   192000, 0xc2c8225d
-0,         22,         22,        1,   192000, 0xe396bccb
-0,         23,         23,        1,   192000, 0x7e89c24c
-0,         24,         24,        1,   192000, 0xb044954c
-0,         25,         25,        1,   192000, 0x335890dd
-0,         26,         26,        1,   192000, 0x58a457c0
-0,         27,         27,        1,   192000, 0xeb0f4798
-0,         28,         28,        1,   192000, 0x0bfc39a1
-0,         29,         29,        1,   192000, 0x06a6905a
-0,         30,         30,        1,   192000, 0x5300c99b
-0,         31,         31,        1,   192000, 0x38f3f845
-0,         32,         32,        1,   192000, 0x6afa3543
-0,         33,         33,        1,   192000, 0x5106a8e0
-0,         34,         34,        1,   192000, 0xc76f0dab
-0,         35,         35,        1,   192000, 0x8efa6939
-0,         36,         36,        1,   192000, 0x64ea23d7
-0,         37,         37,        1,   192000, 0x421a2817
-0,         38,         38,        1,   192000, 0xc854fa18
-0,         39,         39,        1,   192000, 0x4a10d59c
-0,         40,         40,        1,   192000, 0x72637829
-0,         41,         41,        1,   192000, 0xdbbe2796
-0,         42,         42,        1,   192000, 0xff742e6b
-0,         43,         43,        1,   192000, 0xf94b9346
-0,         44,         44,        1,   192000, 0xc90ea53c
-0,         45,         45,        1,   192000, 0x177483bb
-0,         46,         46,        1,   192000, 0x3510369c
-0,         47,         47,        1,   192000, 0x501034bf
-0,         48,         48,        1,   192000, 0x315c744b
-0,         49,         49,        1,   192000, 0xdb5048ae
-0,         50,         50,        1,   192000, 0x09a86221
-0,         51,         51,        1,   192000, 0xb9c9568a
-0,         52,         52,        1,   192000, 0x5eee665b
-0,         53,         53,        1,   192000, 0xdef85517
-0,         54,         54,        1,   192000, 0x7896b5ad
-0,         55,         55,        1,   192000, 0x19fbad39
-0,         56,         56,        1,   192000, 0x63358748
-0,         57,         57,        1,   192000, 0xca0196a3
-0,         58,         58,        1,   192000, 0x0b321da3
-0,         59,         59,        1,   192000, 0xa07af07e
-0,         60,         60,        1,   192000, 0x21f9310c
-0,         61,         61,        1,   192000, 0x62d59874
-0,         62,         62,        1,   192000, 0x021227b4
-0,         63,         63,        1,   192000, 0x01dac0c2
-0,         64,         64,        1,   192000, 0xf3c33a74
-0,         65,         65,        1,   192000, 0xeebe83b7
-0,         66,         66,        1,   192000, 0x9ec77f97
-0,         67,         67,        1,   192000, 0xc91c2e37
-0,         68,         68,        1,   192000, 0x7b58751d
-0,         69,         69,        1,   192000, 0xb178dfbb
-0,         70,         70,        1,   192000, 0x2a63b5be
-0,         71,         71,        1,   192000, 0x44a407ac
-0,         72,         72,        1,   192000, 0x9a8e17dd
-0,         73,         73,        1,   192000, 0x5546f4c8
-0,         74,         74,        1,   192000, 0xeda94586
-0,         75,         75,        1,   192000, 0x941dfa6b
-0,         76,         76,        1,   192000, 0x9772301d
-0,         77,         77,        1,   192000, 0x8be16b16
-0,         78,         78,        1,   192000, 0x26dd4496
-0,         79,         79,        1,   192000, 0x27823797
-0,         80,         80,        1,   192000, 0xacc914f7
-0,         81,         81,        1,   192000, 0xcbb72c9b
-0,         82,         82,        1,   192000, 0x4bd3391c
-0,         83,         83,        1,   192000, 0x4e6adbfe
-0,         84,         84,        1,   192000, 0x7a791c75
-0,         85,         85,        1,   192000, 0xc4f59c94
-0,         86,         86,        1,   192000, 0xc4f59c94
-0,         87,         87,        1,   192000, 0x984a4a0b
-0,         88,         88,        1,   192000, 0x3353f31f
-0,         89,         89,        1,   192000, 0xa9d4dc5a
-0,         90,         90,        1,   192000, 0xb33425d0
-0,         91,         91,        1,   192000, 0x546d768a
-0,         92,         92,        1,   192000, 0xfefbe5c9
-0,         93,         93,        1,   192000, 0xbd6be61d
-0,         94,         94,        1,   192000, 0xf5792731
-0,         95,         95,        1,   192000, 0xccde0582
-0,         96,         96,        1,   192000, 0x857d58ee
-0,         97,         97,        1,   192000, 0xe914ce48
-0,         98,         98,        1,   192000, 0x1f736298
-0,         99,         99,        1,   192000, 0xec0b4846
-0,        100,        100,        1,   192000, 0xe1422624
-0,        101,        101,        1,   192000, 0x56e2b0e0
-0,        102,        102,        1,   192000, 0xc4190640
-0,        103,        103,        1,   192000, 0x7c461977
-0,        104,        104,        1,   192000, 0x34b1d5e8
-0,        105,        105,        1,   192000, 0xbdc70f7a
-0,        106,        106,        1,   192000, 0xb466cd8d
-0,        107,        107,        1,   192000, 0x0e86a04c
diff --git a/deps/libav/tests/ref/fate/roqvideo b/deps/libav/tests/ref/fate/roqvideo
deleted file mode 100644
index 9febedb..0000000
--- a/deps/libav/tests/ref/fate/roqvideo
+++ /dev/null
@@ -1,211 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   393216, 0x56995aac
-0,          1,          1,        1,   393216, 0xf9ed5d6c
-0,          2,          2,        1,   393216, 0xd3285d75
-0,          3,          3,        1,   393216, 0x82d15d62
-0,          4,          4,        1,   393216, 0x893e5d6f
-0,          5,          5,        1,   393216, 0x82d15d62
-0,          6,          6,        1,   393216, 0x893e5d6f
-0,          7,          7,        1,   393216, 0x82d15d62
-0,          8,          8,        1,   393216, 0x893e5d6f
-0,          9,          9,        1,   393216, 0x82d15d62
-0,         10,         10,        1,   393216, 0x893e5d6f
-0,         11,         11,        1,   393216, 0x82d15d62
-0,         12,         12,        1,   393216, 0x893e5d6f
-0,         13,         13,        1,   393216, 0x82d15d62
-0,         14,         14,        1,   393216, 0x893e5d6f
-0,         15,         15,        1,   393216, 0x82d15d62
-0,         16,         16,        1,   393216, 0x2ae39eca
-0,         17,         17,        1,   393216, 0x9254be70
-0,         18,         18,        1,   393216, 0x4b2ed384
-0,         19,         19,        1,   393216, 0xbbd9d8f7
-0,         20,         20,        1,   393216, 0x1f2be0c3
-0,         21,         21,        1,   393216, 0x2434eb25
-0,         22,         22,        1,   393216, 0xa6cced4e
-0,         23,         23,        1,   393216, 0xd116f38b
-0,         24,         24,        1,   393216, 0x6b86f380
-0,         25,         25,        1,   393216, 0xc1b3f8e9
-0,         26,         26,        1,   393216, 0x2993fd5d
-0,         27,         27,        1,   393216, 0xf489fe18
-0,         28,         28,        1,   393216, 0x9ef10501
-0,         29,         29,        1,   393216, 0x8faf0512
-0,         30,         30,        1,   393216, 0xa54d0736
-0,         31,         31,        1,   393216, 0xf4ef01e0
-0,         32,         32,        1,   393216, 0xe241ef51
-0,         33,         33,        1,   393216, 0xcc38e51f
-0,         34,         34,        1,   393216, 0xb1345876
-0,         35,         35,        1,   393216, 0xf9b0968b
-0,         36,         36,        1,   393216, 0x6bb1523f
-0,         37,         37,        1,   393216, 0x83469a05
-0,         38,         38,        1,   393216, 0x73e30882
-0,         39,         39,        1,   393216, 0x8673da66
-0,         40,         40,        1,   393216, 0xb67596d3
-0,         41,         41,        1,   393216, 0xf7638710
-0,         42,         42,        1,   393216, 0x813a8f47
-0,         43,         43,        1,   393216, 0xb3526555
-0,         44,         44,        1,   393216, 0x1b167be3
-0,         45,         45,        1,   393216, 0x99114562
-0,         46,         46,        1,   393216, 0xfafb0693
-0,         47,         47,        1,   393216, 0x121d96c8
-0,         48,         48,        1,   393216, 0xb3c68c5d
-0,         49,         49,        1,   393216, 0x2035b97f
-0,         50,         50,        1,   393216, 0xfbcaeb62
-0,         51,         51,        1,   393216, 0xfd5aea5d
-0,         52,         52,        1,   393216, 0x66efbddd
-0,         53,         53,        1,   393216, 0xf1e17862
-0,         54,         54,        1,   393216, 0x27fa584d
-0,         55,         55,        1,   393216, 0xe644ec5f
-0,         56,         56,        1,   393216, 0x7e3067ba
-0,         57,         57,        1,   393216, 0x1b6ba6fd
-0,         58,         58,        1,   393216, 0x55bdba34
-0,         59,         59,        1,   393216, 0xc67db2e4
-0,         60,         60,        1,   393216, 0x359de8a2
-0,         61,         61,        1,   393216, 0x7b7a32ef
-0,         62,         62,        1,   393216, 0xbe512a66
-0,         63,         63,        1,   393216, 0x681d82bf
-0,         64,         64,        1,   393216, 0xa2320ec5
-0,         65,         65,        1,   393216, 0xcfbd9954
-0,         66,         66,        1,   393216, 0x7fee9854
-0,         67,         67,        1,   393216, 0x70eec155
-0,         68,         68,        1,   393216, 0x114f684e
-0,         69,         69,        1,   393216, 0xe27f034f
-0,         70,         70,        1,   393216, 0xfbbd89b4
-0,         71,         71,        1,   393216, 0xcef4c58a
-0,         72,         72,        1,   393216, 0x9eea88e9
-0,         73,         73,        1,   393216, 0x911cea42
-0,         74,         74,        1,   393216, 0xec5727ea
-0,         75,         75,        1,   393216, 0xda998c33
-0,         76,         76,        1,   393216, 0xc82140ed
-0,         77,         77,        1,   393216, 0x4caa8591
-0,         78,         78,        1,   393216, 0x4944206c
-0,         79,         79,        1,   393216, 0xd4676a94
-0,         80,         80,        1,   393216, 0x9e0340b3
-0,         81,         81,        1,   393216, 0xbdef7f94
-0,         82,         82,        1,   393216, 0xfac05cb0
-0,         83,         83,        1,   393216, 0xfef5a369
-0,         84,         84,        1,   393216, 0x9fcb3711
-0,         85,         85,        1,   393216, 0x6d93f761
-0,         86,         86,        1,   393216, 0xe95dc1ae
-0,         87,         87,        1,   393216, 0x3e561557
-0,         88,         88,        1,   393216, 0x0fa7a049
-0,         89,         89,        1,   393216, 0xf16afb95
-0,         90,         90,        1,   393216, 0xe53a2064
-0,         91,         91,        1,   393216, 0x57f046a4
-0,         92,         92,        1,   393216, 0xf6f16a0c
-0,         93,         93,        1,   393216, 0xcba0c8b0
-0,         94,         94,        1,   393216, 0x5bdbe522
-0,         95,         95,        1,   393216, 0x0fed0151
-0,         96,         96,        1,   393216, 0xbf86faf8
-0,         97,         97,        1,   393216, 0x39854c5f
-0,         98,         98,        1,   393216, 0xd9b7760a
-0,         99,         99,        1,   393216, 0x8edcc1d9
-0,        100,        100,        1,   393216, 0x44ae1435
-0,        101,        101,        1,   393216, 0xbc3d6d73
-0,        102,        102,        1,   393216, 0xedd82647
-0,        103,        103,        1,   393216, 0x1c2e5ce3
-0,        104,        104,        1,   393216, 0x04e29afe
-0,        105,        105,        1,   393216, 0xb191578e
-0,        106,        106,        1,   393216, 0x31d75a06
-0,        107,        107,        1,   393216, 0xfdb6c56e
-0,        108,        108,        1,   393216, 0xf528f484
-0,        109,        109,        1,   393216, 0x87af758e
-0,        110,        110,        1,   393216, 0xc8bdafb7
-0,        111,        111,        1,   393216, 0x573afe93
-0,        112,        112,        1,   393216, 0xb03cb8f5
-0,        113,        113,        1,   393216, 0x6e03ac71
-0,        114,        114,        1,   393216, 0xf919164e
-0,        115,        115,        1,   393216, 0x80059f3c
-0,        116,        116,        1,   393216, 0xf4ea0b1a
-0,        117,        117,        1,   393216, 0xe7720ffb
-0,        118,        118,        1,   393216, 0x1ec0cd56
-0,        119,        119,        1,   393216, 0x2bc8cf18
-0,        120,        120,        1,   393216, 0xe0bf17b5
-0,        121,        121,        1,   393216, 0x660247e1
-0,        122,        122,        1,   393216, 0xcf66f2a9
-0,        123,        123,        1,   393216, 0x5494d5ab
-0,        124,        124,        1,   393216, 0x2c02f2c4
-0,        125,        125,        1,   393216, 0x93fa3783
-0,        126,        126,        1,   393216, 0x4cc50633
-0,        127,        127,        1,   393216, 0x3f179386
-0,        128,        128,        1,   393216, 0x2bca9e1b
-0,        129,        129,        1,   393216, 0x3e4af867
-0,        130,        130,        1,   393216, 0x7e7df93c
-0,        131,        131,        1,   393216, 0x577e4fb0
-0,        132,        132,        1,   393216, 0x34487f0a
-0,        133,        133,        1,   393216, 0x0937bcfc
-0,        134,        134,        1,   393216, 0xa9e75a5e
-0,        135,        135,        1,   393216, 0xf7bc0c89
-0,        136,        136,        1,   393216, 0x06dacca6
-0,        137,        137,        1,   393216, 0x7baaa4bd
-0,        138,        138,        1,   393216, 0x95477f5f
-0,        139,        139,        1,   393216, 0x51117526
-0,        140,        140,        1,   393216, 0x69656d03
-0,        141,        141,        1,   393216, 0xcbd061bb
-0,        142,        142,        1,   393216, 0x8d1d5be2
-0,        143,        143,        1,   393216, 0x43e55930
-0,        144,        144,        1,   393216, 0xb56f5872
-0,        145,        145,        1,   393216, 0x09a255e9
-0,        146,        146,        1,   393216, 0xcaaa5456
-0,        147,        147,        1,   393216, 0xd267501f
-0,        148,        148,        1,   393216, 0x7bef4eca
-0,        149,        149,        1,   393216, 0x9aa94af3
-0,        150,        150,        1,   393216, 0xd39d4a29
-0,        151,        151,        1,   393216, 0x7a754960
-0,        152,        152,        1,   393216, 0x3f004921
-0,        153,        153,        1,   393216, 0x0f784ca8
-0,        154,        154,        1,   393216, 0x2a062c70
-0,        155,        155,        1,   393216, 0x114ef770
-0,        156,        156,        1,   393216, 0xfb7673bf
-0,        157,        157,        1,   393216, 0xbaea88f7
-0,        158,        158,        1,   393216, 0x6fdfe2ec
-0,        159,        159,        1,   393216, 0xb7b2b398
-0,        160,        160,        1,   393216, 0x14ba127e
-0,        161,        161,        1,   393216, 0x660b3041
-0,        162,        162,        1,   393216, 0xe3f3302a
-0,        163,        163,        1,   393216, 0x34c7f1c9
-0,        164,        164,        1,   393216, 0xa8257bf4
-0,        165,        165,        1,   393216, 0xd63fc649
-0,        166,        166,        1,   393216, 0xf8e5b79c
-0,        167,        167,        1,   393216, 0xa67b52ab
-0,        168,        168,        1,   393216, 0xef8f9c74
-0,        169,        169,        1,   393216, 0x6d3aa6b6
-0,        170,        170,        1,   393216, 0x8c174ee6
-0,        171,        171,        1,   393216, 0x2dfbc524
-0,        172,        172,        1,   393216, 0x7d0808b6
-0,        173,        173,        1,   393216, 0x6cbdf6f5
-0,        174,        174,        1,   393216, 0xfe39bc53
-0,        175,        175,        1,   393216, 0xa3d869b0
-0,        176,        176,        1,   393216, 0x09f00057
-0,        177,        177,        1,   393216, 0x6ba56343
-0,        178,        178,        1,   393216, 0xb696ca3e
-0,        179,        179,        1,   393216, 0x4eba0225
-0,        180,        180,        1,   393216, 0xdd45464b
-0,        181,        181,        1,   393216, 0x2909a9ea
-0,        182,        182,        1,   393216, 0x12aa3f85
-0,        183,        183,        1,   393216, 0x59421352
-0,        184,        184,        1,   393216, 0x57ea0313
-0,        185,        185,        1,   393216, 0x4e5f3a38
-0,        186,        186,        1,   393216, 0x55bc932d
-0,        187,        187,        1,   393216, 0x666ee55d
-0,        188,        188,        1,   393216, 0xb0f84a69
-0,        189,        189,        1,   393216, 0xad3ae63f
-0,        190,        190,        1,   393216, 0x970fd47d
-0,        191,        191,        1,   393216, 0x86c418e0
-0,        192,        192,        1,   393216, 0x52c9ce50
-0,        193,        193,        1,   393216, 0xd54c98c8
-0,        194,        194,        1,   393216, 0xb40e5fea
-0,        195,        195,        1,   393216, 0x2aa74875
-0,        196,        196,        1,   393216, 0x305b251e
-0,        197,        197,        1,   393216, 0xab8c0780
-0,        198,        198,        1,   393216, 0x0101dd0e
-0,        199,        199,        1,   393216, 0x23739cab
-0,        200,        200,        1,   393216, 0xf05196a0
-0,        201,        201,        1,   393216, 0x932d1e00
-0,        202,        202,        1,   393216, 0x932d1e00
-0,        203,        203,        1,   393216, 0x932d1e00
-0,        204,        204,        1,   393216, 0x932d1e00
-0,        205,        205,        1,   393216, 0x932d1e00
-0,        206,        206,        1,   393216, 0x932d1e00
-0,        207,        207,        1,   393216, 0x932d1e00
-0,        208,        208,        1,   393216, 0x932d1e00
-0,        209,        209,        1,   393216, 0x932d1e00
diff --git a/deps/libav/tests/ref/fate/rpza b/deps/libav/tests/ref/fate/rpza
deleted file mode 100644
index a1c5333..0000000
--- a/deps/libav/tests/ref/fate/rpza
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/600
-0,          0,          0,        1,   230400, 0x4aec80a3
-0,         40,         40,        1,   230400, 0xb6c41452
-0,         80,         80,        1,   230400, 0xa6c27f12
-0,        120,        120,        1,   230400, 0x309bd2d2
-0,        160,        160,        1,   230400, 0x597a7341
-0,        200,        200,        1,   230400, 0x597a7341
-0,        240,        240,        1,   230400, 0xd6d6c569
-0,        280,        280,        1,   230400, 0x31413d89
-0,        320,        320,        1,   230400, 0x464e42e9
-0,        360,        360,        1,   230400, 0x502d7c71
-0,        400,        400,        1,   230400, 0x502d7c71
-0,        440,        440,        1,   230400, 0xc96f23d1
-0,        480,        480,        1,   230400, 0xc96f23d1
-0,        520,        520,        1,   230400, 0x5bfd2bc7
-0,        560,        560,        1,   230400, 0x821640a7
-0,        600,        600,        1,   230400, 0x8f001967
-0,        640,        640,        1,   230400, 0x406ba109
-0,        680,        680,        1,   230400, 0x85d99b50
-0,        720,        720,        1,   230400, 0x2fdb4018
-0,        760,        760,        1,   230400, 0xfa127259
-0,        800,        800,        1,   230400, 0xe6427b9b
-0,        840,        840,        1,   230400, 0xe6427b9b
-0,        880,        880,        1,   230400, 0x3a279000
-0,        920,        920,        1,   230400, 0x710755ee
-0,        960,        960,        1,   230400, 0x76549d35
-0,       1000,       1000,        1,   230400, 0xf4d0132c
-0,       1040,       1040,        1,   230400, 0xf4d0132c
-0,       1080,       1080,        1,   230400, 0x19d7ec14
-0,       1120,       1120,        1,   230400, 0x19d7ec14
-0,       1160,       1160,        1,   230400, 0x5f24b7e1
diff --git a/deps/libav/tests/ref/fate/rv30 b/deps/libav/tests/ref/fate/rv30
deleted file mode 100644
index 89a9d8c..0000000
--- a/deps/libav/tests/ref/fate/rv30
+++ /dev/null
@@ -1,110 +0,0 @@
-#tb 0: 1/1000
-0,          1,          1,        0,   126720, 0xcefaec47
-0,         33,         33,        0,   126720, 0xa416ece5
-0,         66,         66,        0,   126720, 0xa416ece5
-0,        100,        100,        0,   126720, 0xa416ece5
-0,        133,        133,        0,   126720, 0x60d6ed27
-0,        166,        166,        0,   126720, 0x259af497
-0,        200,        200,        0,   126720, 0x5e6ff4d7
-0,        233,        233,        0,   126720, 0xcc10f4b7
-0,        266,        266,        0,   126720, 0x763ab817
-0,        300,        300,        0,   126720, 0xe95fb8d7
-0,        333,        333,        0,   126720, 0xe2b1b917
-0,        367,        367,        0,   126720, 0x11abb8f7
-0,        400,        400,        0,   126720, 0x4b62b947
-0,        433,        433,        0,   126720, 0xcaf2bbb7
-0,        467,        467,        0,   126720, 0x2953bc37
-0,        500,        500,        0,   126720, 0x1dd9bbd7
-0,        533,        533,        0,   126720, 0x105eb927
-0,        567,        567,        0,   126720, 0x7fa3ae27
-0,        600,        600,        0,   126720, 0x722e99f7
-0,        633,        633,        0,   126720, 0x5ac9a827
-0,        667,        667,        0,   126720, 0x07beba77
-0,        700,        700,        0,   126720, 0x29d6a887
-0,        734,        734,        0,   126720, 0xa5caab87
-0,        767,        767,        0,   126720, 0x9ca7aac7
-0,        800,        800,        0,   126720, 0xb7debcd7
-0,        834,        834,        0,   126720, 0xd115a757
-0,        867,        867,        0,   126720, 0x6ddaef32
-0,        900,        900,        0,   126720, 0xde1bb900
-0,        934,        934,        0,   126720, 0xac6c071b
-0,        967,        967,        0,   126720, 0x4a9f897c
-0,       1000,       1000,        0,   126720, 0xd8fa050f
-0,       1034,       1034,        0,   126720, 0x5d06be59
-0,       1067,       1067,        0,   126720, 0xdc3e0837
-0,       1101,       1101,        0,   126720, 0xcac6da2b
-0,       1134,       1134,        0,   126720, 0x6672dfc9
-0,       1167,       1167,        0,   126720, 0x7491b176
-0,       1201,       1201,        0,   126720, 0xa9477df0
-0,       1234,       1234,        0,   126720, 0xe976c34f
-0,       1267,       1267,        0,   126720, 0xdb7ab0e2
-0,       1301,       1301,        0,   126720, 0x1b42db35
-0,       1334,       1334,        0,   126720, 0xc6e10f9f
-0,       1368,       1368,        0,   126720, 0x169d61b6
-0,       1401,       1401,        0,   126720, 0xc7623119
-0,       1434,       1434,        0,   126720, 0x5b9b7543
-0,       1468,       1468,        0,   126720, 0x68c27aca
-0,       1501,       1501,        0,   126720, 0xa0e4e1c9
-0,       1534,       1534,        0,   126720, 0xbbdae87e
-0,       1568,       1568,        0,   126720, 0xe67e00a1
-0,       1601,       1601,        0,   126720, 0x648ea605
-0,       1634,       1634,        0,   126720, 0x5becb718
-0,       1668,       1668,        0,   126720, 0xb79ab1da
-0,       1701,       1701,        0,   126720, 0x0d52d1dc
-0,       1735,       1735,        0,   126720, 0x1277b853
-0,       1768,       1768,        0,   126720, 0xc57cbc83
-0,       1801,       1801,        0,   126720, 0x2126bdc3
-0,       1835,       1835,        0,   126720, 0x4c1ef41f
-0,       1868,       1868,        0,   126720, 0x185f6a2c
-0,       1901,       1901,        0,   126720, 0xb2b5a7d3
-0,       1935,       1935,        0,   126720, 0x32d7a26d
-0,       1968,       1968,        0,   126720, 0x0bffd118
-0,       2001,       2001,        0,   126720, 0x2eed823a
-0,       2035,       2035,        0,   126720, 0xc4c0147c
-0,       2068,       2068,        0,   126720, 0x1f8bf8ac
-0,       2102,       2102,        0,   126720, 0xfcb715e8
-0,       2135,       2135,        0,   126720, 0xc3e9fa9c
-0,       2168,       2168,        0,   126720, 0x9ad8572c
-0,       2202,       2202,        0,   126720, 0x2800596d
-0,       2235,       2235,        0,   126720, 0x3caa5094
-0,       2268,       2268,        0,   126720, 0x6162e000
-0,       2302,       2302,        0,   126720, 0x18200f2c
-0,       2335,       2335,        0,   126720, 0x649e699f
-0,       2369,       2369,        0,   126720, 0x5f513367
-0,       2402,       2402,        0,   126720, 0x71fbf4a8
-0,       2435,       2435,        0,   126720, 0x5bff7b97
-0,       2469,       2469,        0,   126720, 0xbad453d4
-0,       2502,       2502,        0,   126720, 0x56e6161d
-0,       2535,       2535,        0,   126720, 0x524f2980
-0,       2569,       2569,        0,   126720, 0x0589405a
-0,       2602,       2602,        0,   126720, 0x5c264043
-0,       2635,       2635,        0,   126720, 0x2394696f
-0,       2669,       2669,        0,   126720, 0x1aa0cd15
-0,       2702,       2702,        0,   126720, 0xd6ec7840
-0,       2736,       2736,        0,   126720, 0xde5531f0
-0,       2769,       2769,        0,   126720, 0x03a42c3a
-0,       2802,       2802,        0,   126720, 0xbdee0efb
-0,       2836,       2836,        0,   126720, 0xa6012736
-0,       2869,       2869,        0,   126720, 0x448f5ae6
-0,       2902,       2902,        0,   126720, 0x8a2550c3
-0,       2936,       2936,        0,   126720, 0x143104e7
-0,       2969,       2969,        0,   126720, 0x75db363d
-0,       3002,       3002,        0,   126720, 0x906d2f9d
-0,       3036,       3036,        0,   126720, 0xfc7b30ab
-0,       3069,       3069,        0,   126720, 0xd3edaa62
-0,       3103,       3103,        0,   126720, 0x6267f3fc
-0,       3136,       3136,        0,   126720, 0x87b6c67f
-0,       3169,       3169,        0,   126720, 0x84da3b79
-0,       3203,       3203,        0,   126720, 0x72fbae15
-0,       3236,       3236,        0,   126720, 0xb8474a80
-0,       3269,       3269,        0,   126720, 0xbeae088b
-0,       3303,       3303,        0,   126720, 0x538b1a14
-0,       3336,       3336,        0,   126720, 0x07bbddcd
-0,       3370,       3370,        0,   126720, 0x807ddf8f
-0,       3403,       3403,        0,   126720, 0x325bb46d
-0,       3436,       3436,        0,   126720, 0xd80c2f2a
-0,       3470,       3470,        0,   126720, 0xfc1b0dec
-0,       3503,       3503,        0,   126720, 0x46068ebc
-0,       3536,       3536,        0,   126720, 0xcd987941
-0,       3570,       3570,        0,   126720, 0x52f37f2e
-0,       3603,       3603,        0,   126720, 0xc96931a2
diff --git a/deps/libav/tests/ref/fate/rv40 b/deps/libav/tests/ref/fate/rv40
deleted file mode 100644
index d5cb265..0000000
--- a/deps/libav/tests/ref/fate/rv40
+++ /dev/null
@@ -1,240 +0,0 @@
-#tb 0: 1/1000
-0,        -41,        -41,        0,   276480, 0x5f7a0d4f
-0,         42,         42,        0,   276480, 0x5f7a0d4f
-0,         83,         83,        0,   276480, 0x5f7a0d4f
-0,        125,        125,        0,   276480, 0x5f7a0d4f
-0,        167,        167,        0,   276480, 0x5f7a0d4f
-0,        209,        209,        0,   276480, 0x5f7a0d4f
-0,        250,        250,        0,   276480, 0x5f7a0d4f
-0,        292,        292,        0,   276480, 0x5f7a0d4f
-0,        334,        334,        0,   276480, 0x5f7a0d4f
-0,        375,        375,        0,   276480, 0x5f7a0d4f
-0,        417,        417,        0,   276480, 0x5f7a0d4f
-0,        459,        459,        0,   276480, 0x5f7a0d4f
-0,        501,        501,        0,   276480, 0x5f7a0d4f
-0,        542,        542,        0,   276480, 0x5f7a0d4f
-0,        584,        584,        0,   276480, 0x5f7a0d4f
-0,        626,        626,        0,   276480, 0x5f7a0d4f
-0,        667,        667,        0,   276480, 0x5f7a0d4f
-0,        709,        709,        0,   276480, 0x5f7a0d4f
-0,        751,        751,        0,   276480, 0x5f7a0d4f
-0,        792,        792,        0,   276480, 0x5f7a0d4f
-0,        834,        834,        0,   276480, 0x5f7a0d4f
-0,        876,        876,        0,   276480, 0x5f7a0d4f
-0,        918,        918,        0,   276480, 0x5f7a0d4f
-0,        959,        959,        0,   276480, 0x5f7a0d4f
-0,       1001,       1001,        0,   276480, 0x5f7a0d4f
-0,       1043,       1043,        0,   276480, 0x5f7a0d4f
-0,       1084,       1084,        0,   276480, 0x5f7a0d4f
-0,       1126,       1126,        0,   276480, 0x5f7a0d4f
-0,       1168,       1168,        0,   276480, 0x5f7a0d4f
-0,       1210,       1210,        0,   276480, 0x5f7a0d4f
-0,       1251,       1251,        0,   276480, 0x5f7a0d4f
-0,       1293,       1293,        0,   276480, 0x5f7a0d4f
-0,       1335,       1335,        0,   276480, 0x5f7a0d4f
-0,       1376,       1376,        0,   276480, 0x75641594
-0,       1418,       1418,        0,   276480, 0x32ee3526
-0,       1460,       1460,        0,   276480, 0xcb53479a
-0,       1502,       1502,        0,   276480, 0x7ca9658e
-0,       1543,       1543,        0,   276480, 0x5ce39368
-0,       1585,       1585,        0,   276480, 0x4ec1e418
-0,       1627,       1627,        0,   276480, 0xb3790499
-0,       1668,       1668,        0,   276480, 0xa9f1506f
-0,       1710,       1710,        0,   276480, 0x85cbc3b5
-0,       1752,       1752,        0,   276480, 0x377c7b46
-0,       1793,       1793,        0,   276480, 0x1a61d8db
-0,       1835,       1835,        0,   276480, 0xe1de7f0a
-0,       1877,       1877,        0,   276480, 0x756a4a2e
-0,       1919,       1919,        0,   276480, 0xcb379547
-0,       1960,       1960,        0,   276480, 0xbae14484
-0,       2002,       2002,        0,   276480, 0x8e12331c
-0,       2044,       2044,        0,   276480, 0x99c085be
-0,       2085,       2085,        0,   276480, 0xe479ffed
-0,       2127,       2127,        0,   276480, 0x99c82949
-0,       2169,       2169,        0,   276480, 0xac7672dd
-0,       2211,       2211,        0,   276480, 0x1e4fae19
-0,       2252,       2252,        0,   276480, 0x776412ef
-0,       2294,       2294,        0,   276480, 0x7d9b579f
-0,       2336,       2336,        0,   276480, 0x1cd1ab29
-0,       2377,       2377,        0,   276480, 0x58ce0f38
-0,       2419,       2419,        0,   276480, 0x5ab69b27
-0,       2461,       2461,        0,   276480, 0x0afad610
-0,       2503,       2503,        0,   276480, 0x9eca3f11
-0,       2544,       2544,        0,   276480, 0xc3db9706
-0,       2586,       2586,        0,   276480, 0xc9c57884
-0,       2628,       2628,        0,   276480, 0xd9fbb2cf
-0,       2669,       2669,        0,   276480, 0xdc07f3c9
-0,       2711,       2711,        0,   276480, 0x000b5269
-0,       2753,       2753,        0,   276480, 0x27ff7a5d
-0,       2794,       2794,        0,   276480, 0xd92e2017
-0,       2836,       2836,        0,   276480, 0x18d4b27d
-0,       2878,       2878,        0,   276480, 0x70647530
-0,       2920,       2920,        0,   276480, 0x97612c4b
-0,       2961,       2961,        0,   276480, 0xc9d4ac78
-0,       3003,       3003,        0,   276480, 0x4ec4d57f
-0,       3045,       3045,        0,   276480, 0xdf4e04d7
-0,       3086,       3086,        0,   276480, 0xbd98f57c
-0,       3128,       3128,        0,   276480, 0x7247ea3e
-0,       3170,       3170,        0,   276480, 0xa5d670ec
-0,       3212,       3212,        0,   276480, 0x5163b29b
-0,       3253,       3253,        0,   276480, 0x99170e64
-0,       3295,       3295,        0,   276480, 0x37f4c0b0
-0,       3337,       3337,        0,   276480, 0x7a4f2561
-0,       3378,       3378,        0,   276480, 0x8a4e991f
-0,       3420,       3420,        0,   276480, 0x6a45425f
-0,       3462,       3462,        0,   276480, 0x1f0e2bb6
-0,       3504,       3504,        0,   276480, 0xd75482c6
-0,       3545,       3545,        0,   276480, 0x7bf6b1ef
-0,       3587,       3587,        0,   276480, 0x6de1e34b
-0,       3629,       3629,        0,   276480, 0x4526c89b
-0,       3670,       3670,        0,   276480, 0xf964e18e
-0,       3712,       3712,        0,   276480, 0xdcaaa99a
-0,       3754,       3754,        0,   276480, 0xd1e98808
-0,       3795,       3795,        0,   276480, 0x556b2365
-0,       3837,       3837,        0,   276480, 0x0cf65540
-0,       3879,       3879,        0,   276480, 0x6e2d524e
-0,       3921,       3921,        0,   276480, 0x22c50a3d
-0,       3962,       3962,        0,   276480, 0x293f19af
-0,       4004,       4004,        0,   276480, 0xf4b1c461
-0,       4046,       4046,        0,   276480, 0x62b76407
-0,       4087,       4087,        0,   276480, 0x51e9b3eb
-0,       4129,       4129,        0,   276480, 0x7b910bc7
-0,       4171,       4171,        0,   276480, 0x6dd14ca6
-0,       4213,       4213,        0,   276480, 0x441f7afd
-0,       4254,       4254,        0,   276480, 0xfb01efc6
-0,       4296,       4296,        0,   276480, 0x4f73ccea
-0,       4338,       4338,        0,   276480, 0x5ac8e06f
-0,       4379,       4379,        0,   276480, 0x294bb441
-0,       4421,       4421,        0,   276480, 0xe04ac45e
-0,       4463,       4463,        0,   276480, 0xa7a38d41
-0,       4505,       4505,        0,   276480, 0xf688a3ed
-0,       4546,       4546,        0,   276480, 0x58f275ea
-0,       4588,       4588,        0,   276480, 0xf0b3b71b
-0,       4630,       4630,        0,   276480, 0x3ce773bf
-0,       4671,       4671,        0,   276480, 0x01840548
-0,       4713,       4713,        0,   276480, 0x674e34e4
-0,       4755,       4755,        0,   276480, 0x41dda2d9
-0,       4796,       4796,        0,   276480, 0xc5b60838
-0,       4838,       4838,        0,   276480, 0x9b209f41
-0,       4880,       4880,        0,   276480, 0xf46ba7fb
-0,       4922,       4922,        0,   276480, 0x28b54815
-0,       4963,       4963,        0,   276480, 0xb605a933
-0,       5005,       5005,        0,   276480, 0x34484aff
-0,       5047,       5047,        0,   276480, 0xaf2b5d89
-0,       5088,       5088,        0,   276480, 0x8facba58
-0,       5130,       5130,        0,   276480, 0xbbe3e99f
-0,       5172,       5172,        0,   276480, 0x02162c7c
-0,       5214,       5214,        0,   276480, 0x28a63236
-0,       5255,       5255,        0,   276480, 0x1ad43fd7
-0,       5297,       5297,        0,   276480, 0xe37883e5
-0,       5339,       5339,        0,   276480, 0x2b8a89c5
-0,       5380,       5380,        0,   276480, 0x71507bd2
-0,       5422,       5422,        0,   276480, 0x35626022
-0,       5464,       5464,        0,   276480, 0x461fc3e7
-0,       5506,       5506,        0,   276480, 0xce5af1ec
-0,       5547,       5547,        0,   276480, 0x7c1139b3
-0,       5589,       5589,        0,   276480, 0x7fd73a99
-0,       5631,       5631,        0,   276480, 0x4ae4c3a6
-0,       5672,       5672,        0,   276480, 0xcb60725a
-0,       5714,       5714,        0,   276480, 0xb52e1aa2
-0,       5756,       5756,        0,   276480, 0xd6f82cae
-0,       5797,       5797,        0,   276480, 0x6310e665
-0,       5839,       5839,        0,   276480, 0xfa88a483
-0,       5881,       5881,        0,   276480, 0xf88f75d4
-0,       5923,       5923,        0,   276480, 0x04a8e3ee
-0,       5964,       5964,        0,   276480, 0x54766a12
-0,       6006,       6006,        0,   276480, 0x0b41f0d7
-0,       6048,       6048,        0,   276480, 0xa29f5b01
-0,       6089,       6089,        0,   276480, 0x754ceaf5
-0,       6131,       6131,        0,   276480, 0x150c0423
-0,       6173,       6173,        0,   276480, 0xde084059
-0,       6215,       6215,        0,   276480, 0x5a38b4af
-0,       6256,       6256,        0,   276480, 0xfcebc261
-0,       6298,       6298,        0,   276480, 0x0eb9770d
-0,       6340,       6340,        0,   276480, 0x046394ae
-0,       6381,       6381,        0,   276480, 0x3d3ca985
-0,       6423,       6423,        0,   276480, 0x94a03c75
-0,       6465,       6465,        0,   276480, 0x800eea2d
-0,       6507,       6507,        0,   276480, 0x6a841f41
-0,       6548,       6548,        0,   276480, 0x2f98911c
-0,       6590,       6590,        0,   276480, 0x923b9937
-0,       6632,       6632,        0,   276480, 0xe82f8e0f
-0,       6673,       6673,        0,   276480, 0xee82d657
-0,       6715,       6715,        0,   276480, 0xefab7ffd
-0,       6757,       6757,        0,   276480, 0x6b9fbc80
-0,       6798,       6798,        0,   276480, 0x4a1ada47
-0,       6840,       6840,        0,   276480, 0x6d4b49d7
-0,       6882,       6882,        0,   276480, 0xe4bdbd1e
-0,       6924,       6924,        0,   276480, 0x225a56c0
-0,       6965,       6965,        0,   276480, 0xd4adadad
-0,       7007,       7007,        0,   276480, 0xff4e1a8c
-0,       7049,       7049,        0,   276480, 0xf58b1b7c
-0,       7090,       7090,        0,   276480, 0xbaffcdcc
-0,       7132,       7132,        0,   276480, 0x374f88f0
-0,       7174,       7174,        0,   276480, 0x3d861ae6
-0,       7216,       7216,        0,   276480, 0xeb6eb88f
-0,       7257,       7257,        0,   276480, 0xdb753d35
-0,       7299,       7299,        0,   276480, 0x9aa543af
-0,       7341,       7341,        0,   276480, 0xb24c8016
-0,       7382,       7382,        0,   276480, 0xea80a82e
-0,       7424,       7424,        0,   276480, 0x2aae902a
-0,       7466,       7466,        0,   276480, 0x5bba3cfb
-0,       7508,       7508,        0,   276480, 0x5c6e97a9
-0,       7549,       7549,        0,   276480, 0x9b9ee961
-0,       7591,       7591,        0,   276480, 0xaa12b6fd
-0,       7633,       7633,        0,   276480, 0xe9d2439f
-0,       7674,       7674,        0,   276480, 0xbf09053c
-0,       7716,       7716,        0,   276480, 0x50c31e73
-0,       7758,       7758,        0,   276480, 0xdd9fb89f
-0,       7799,       7799,        0,   276480, 0x3e4e5aec
-0,       7841,       7841,        0,   276480, 0x0b752d28
-0,       7883,       7883,        0,   276480, 0xaf82399a
-0,       7925,       7925,        0,   276480, 0x7ce5f23c
-0,       7966,       7966,        0,   276480, 0xad135d0f
-0,       8008,       8008,        0,   276480, 0x55dadd30
-0,       8050,       8050,        0,   276480, 0x5aaa7519
-0,       8091,       8091,        0,   276480, 0xe45a5599
-0,       8133,       8133,        0,   276480, 0xc8e89913
-0,       8175,       8175,        0,   276480, 0x2f447fd3
-0,       8217,       8217,        0,   276480, 0x704411fb
-0,       8258,       8258,        0,   276480, 0x9d7430a1
-0,       8300,       8300,        0,   276480, 0x24dd5fd3
-0,       8342,       8342,        0,   276480, 0x51cb657c
-0,       8383,       8383,        0,   276480, 0x2c230702
-0,       8425,       8425,        0,   276480, 0x4a4f76cd
-0,       8467,       8467,        0,   276480, 0xdcd71e88
-0,       8509,       8509,        0,   276480, 0x87160f99
-0,       8550,       8550,        0,   276480, 0x27f54854
-0,       8592,       8592,        0,   276480, 0x694d76e3
-0,       8634,       8634,        0,   276480, 0xcbe93c19
-0,       8675,       8675,        0,   276480, 0x50742e1b
-0,       8717,       8717,        0,   276480, 0x525463e2
-0,       8759,       8759,        0,   276480, 0x819898f9
-0,       8800,       8800,        0,   276480, 0x08fac755
-0,       8842,       8842,        0,   276480, 0x35c46927
-0,       8884,       8884,        0,   276480, 0xeeed00fc
-0,       8926,       8926,        0,   276480, 0xb6f99ee3
-0,       8967,       8967,        0,   276480, 0xd87f4c73
-0,       9009,       9009,        0,   276480, 0xde97d9fd
-0,       9051,       9051,        0,   276480, 0xefc83107
-0,       9092,       9092,        0,   276480, 0xbb22e024
-0,       9134,       9134,        0,   276480, 0x53a7cfcb
-0,       9176,       9176,        0,   276480, 0xbe1fbb19
-0,       9218,       9218,        0,   276480, 0x300f922a
-0,       9259,       9259,        0,   276480, 0x826fc3bd
-0,       9301,       9301,        0,   276480, 0x679aa57a
-0,       9343,       9343,        0,   276480, 0x5497097b
-0,       9384,       9384,        0,   276480, 0x679a53f8
-0,       9426,       9426,        0,   276480, 0x976c9e93
-0,       9468,       9468,        0,   276480, 0xe80f87f2
-0,       9510,       9510,        0,   276480, 0xdc2d7c6c
-0,       9551,       9551,        0,   276480, 0xb194656e
-0,       9593,       9593,        0,   276480, 0xf002c5ca
-0,       9635,       9635,        0,   276480, 0x43fc1c64
-0,       9676,       9676,        0,   276480, 0xf62d8581
-0,       9718,       9718,        0,   276480, 0xb243dda5
-0,       9760,       9760,        0,   276480, 0x1700efbb
-0,       9801,       9801,        0,   276480, 0x9ebe6ba2
-0,       9843,       9843,        0,   276480, 0x8f316c66
-0,       9885,       9885,        0,   276480, 0x6348ecf5
-0,       9927,       9927,        0,   276480, 0x34b5b78a
diff --git a/deps/libav/tests/ref/fate/sha b/deps/libav/tests/ref/fate/sha
deleted file mode 100644
index 2da0694..0000000
--- a/deps/libav/tests/ref/fate/sha
+++ /dev/null
@@ -1,21 +0,0 @@
-Testing SHA-160
-A9993E364706816ABA3E25717850C26C9CD0D89D
-84983E441C3BD26EBAAE4AA1F95129E5E54670F1
-34AA973CD4C4DAA4F61EEB2BDBAD27316534016F
-A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
-84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
-34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
-Testing SHA-224
-23097D223405D8228642A477BDA255B32AADBCE4BDA0B3F7E36C9DA7
-75388B16512776CC5DBA5DA1FD890150B0C6455CB4F58B1952522525
-20794655980C91D8BBB4C1EA97618A4BF03F42581948B2EE4EE7AD67
-23097d22 3405d822 8642a477 bda255b3 2aadbce4 bda0b3f7 e36c9da7
-75388b16 512776cc 5dba5da1 fd890150 b0c6455c b4f58b19 52522525
-20794655 980c91d8 bbb4c1ea 97618a4b f03f4258 1948b2ee 4ee7ad67
-Testing SHA-256
-BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD
-248D6A61D20638B8E5C026930C3E6039A33CE45964FF2167F6ECEDD419DB06C1
-CDC76E5C9914FB9281A1C7E284D73E67F1809A48A497200E046D39CCC7112CD0
-ba7816bf 8f01cfea 414140de 5dae2223 b00361a3 96177a9c b410ff61 f20015ad
-248d6a61 d20638b8 e5c02693 0c3e6039 a33ce459 64ff2167 f6ecedd4 19db06c1
-cdc76e5c 9914fb92 81a1c7e2 84d73e67 f1809a48 a497200e 046d39cc c7112cd0
diff --git a/deps/libav/tests/ref/fate/sierra-vmd-audio b/deps/libav/tests/ref/fate/sierra-vmd-audio
deleted file mode 100644
index 13d3567..0000000
--- a/deps/libav/tests/ref/fate/sierra-vmd-audio
+++ /dev/null
@@ -1,216 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,    61740,   123480, 0x3a794c13
-0,      61740,      61740,     2205,     4410, 0x109d04e0
-0,      63945,      63945,     2205,     4410, 0x224d244f
-0,      66150,      66150,     2205,     4410, 0xbb72413d
-0,      68355,      68355,     2205,     4410, 0xaa5f5b86
-0,      70560,      70560,     2205,     4410, 0x94e7aea7
-0,      72765,      72765,     2205,     4410, 0xad497ca0
-0,      74970,      74970,     2205,     4410, 0x1de10c9e
-0,      77175,      77175,     2205,     4410, 0x9f55efa8
-0,      79380,      79380,     2205,     4410, 0x220a072a
-0,      81585,      81585,     2205,     4410, 0xa7dafb29
-0,      83790,      83790,     2205,     4410, 0xd5e29c7a
-0,      85995,      85995,     2205,     4410, 0xb8465006
-0,      88200,      88200,     2205,     4410, 0x518669c7
-0,      90405,      90405,     2205,     4410, 0xb5b5efca
-0,      92610,      92610,     2205,     4410, 0x8600015d
-0,      94815,      94815,     2205,     4410, 0xe2f68fe9
-0,      97020,      97020,     2205,     4410, 0x8d3458d9
-0,      99225,      99225,     2205,     4410, 0xf1ff4775
-0,     101430,     101430,     2205,     4410, 0x830f67c9
-0,     103635,     103635,     2205,     4410, 0x110e0bc1
-0,     105840,     105840,     2205,     4410, 0x71682f47
-0,     108045,     108045,     2205,     4410, 0x38119095
-0,     110250,     110250,     2205,     4410, 0xd2494db6
-0,     112455,     112455,     2205,     4410, 0x8b552509
-0,     114660,     114660,     2205,     4410, 0x71e52909
-0,     116865,     116865,     2205,     4410, 0x9f0a6f4d
-0,     119070,     119070,     2205,     4410, 0x901302f2
-0,     121275,     121275,     2205,     4410, 0x855d5222
-0,     123480,     123480,     2205,     4410, 0x324bb2fe
-0,     125685,     125685,     2205,     4410, 0xe85f583f
-0,     127890,     127890,     2205,     4410, 0x2cbc67c4
-0,     130095,     130095,     2205,     4410, 0xc82e6aa1
-0,     132300,     132300,     2205,     4410, 0xb9fc423c
-0,     134505,     134505,     2205,     4410, 0x6b9b4ef9
-0,     136710,     136710,     2205,     4410, 0x39290f10
-0,     138915,     138915,     2205,     4410, 0xad718eb4
-0,     141120,     141120,     2205,     4410, 0x82f463ac
-0,     143325,     143325,     2205,     4410, 0xfac87cac
-0,     145530,     145530,     2205,     4410, 0x9e8bcca7
-0,     147735,     147735,     2205,     4410, 0x52f79c99
-0,     149940,     149940,     2205,     4410, 0xf2d14de2
-0,     152145,     152145,     2205,     4410, 0x367f95e1
-0,     154350,     154350,     2205,     4410, 0x8bfac293
-0,     156555,     156555,     2205,     4410, 0x01ea5040
-0,     158760,     158760,     2205,     4410, 0x8ff5e212
-0,     160965,     160965,     2205,     4410, 0x93f32824
-0,     163170,     163170,     2205,     4410, 0x998f90dc
-0,     165375,     165375,     2205,     4410, 0x65231170
-0,     167580,     167580,     2205,     4410, 0xc79039a1
-0,     169785,     169785,     2205,     4410, 0x0b0e58bd
-0,     171990,     171990,     2205,     4410, 0xc24ab4fa
-0,     174195,     174195,     2205,     4410, 0xd3796a8e
-0,     176400,     176400,     2205,     4410, 0xa37f8295
-0,     178605,     178605,     2205,     4410, 0xb760fed7
-0,     180810,     180810,     2205,     4410, 0x05495a34
-0,     183015,     183015,     2205,     4410, 0x6f203437
-0,     185220,     185220,     2205,     4410, 0x71299402
-0,     187425,     187425,     2205,     4410, 0x72e7b346
-0,     189630,     189630,     2205,     4410, 0x879b0dae
-0,     191835,     191835,     2205,     4410, 0x041aa1bd
-0,     194040,     194040,     2205,     4410, 0x18a962e6
-0,     196245,     196245,     2205,     4410, 0x21d20539
-0,     198450,     198450,     2205,     4410, 0x8f449267
-0,     200655,     200655,     2205,     4410, 0xecdc01d6
-0,     202860,     202860,     2205,     4410, 0x458abd5a
-0,     205065,     205065,     2205,     4410, 0xa070ea63
-0,     207270,     207270,     2205,     4410, 0xc25b26ce
-0,     209475,     209475,     2205,     4410, 0x4d9237ca
-0,     211680,     211680,     2205,     4410, 0x748e1801
-0,     213885,     213885,     2205,     4410, 0xc96b69e6
-0,     216090,     216090,     2205,     4410, 0x6663186c
-0,     218295,     218295,     2205,     4410, 0x7f6d3081
-0,     220500,     220500,     2205,     4410, 0x1a0343b5
-0,     222705,     222705,     2205,     4410, 0xc48e338c
-0,     224910,     224910,     2205,     4410, 0x26fc03c8
-0,     227115,     227115,     2205,     4410, 0x69be7e2d
-0,     229320,     229320,     2205,     4410, 0x69a74da1
-0,     231525,     231525,     2205,     4410, 0x85bd2ab3
-0,     233730,     233730,     2205,     4410, 0xeff05426
-0,     235935,     235935,     2205,     4410, 0x292829e0
-0,     238140,     238140,     2205,     4410, 0x8f741798
-0,     240345,     240345,     2205,     4410, 0x6b9337e9
-0,     242550,     242550,     2205,     4410, 0xe4e1703f
-0,     244755,     244755,     2205,     4410, 0x043d6c35
-0,     246960,     246960,     2205,     4410, 0x3a8988e7
-0,     249165,     249165,     2205,     4410, 0x1fa7d2a9
-0,     251370,     251370,     2205,     4410, 0xe28799e3
-0,     253575,     253575,     2205,     4410, 0xc2df4470
-0,     255780,     255780,     2205,     4410, 0x694d0cf5
-0,     257985,     257985,     2205,     4410, 0x5aac2dcf
-0,     260190,     260190,     2205,     4410, 0x259fa2db
-0,     262395,     262395,     2205,     4410, 0xd16d6803
-0,     264600,     264600,     2205,     4410, 0xa4b3478a
-0,     266805,     266805,     2205,     4410, 0xdbe0443d
-0,     269010,     269010,     2205,     4410, 0x26c16119
-0,     271215,     271215,     2205,     4410, 0x0c06475c
-0,     273420,     273420,     2205,     4410, 0x6ffaba2d
-0,     275625,     275625,     2205,     4410, 0x5b287192
-0,     277830,     277830,     2205,     4410, 0xf2cf2651
-0,     280035,     280035,     2205,     4410, 0x3857673a
-0,     282240,     282240,     2205,     4410, 0x5b555feb
-0,     284445,     284445,     2205,     4410, 0x93f997af
-0,     286650,     286650,     2205,     4410, 0xb3ba8d35
-0,     288855,     288855,     2205,     4410, 0x66433944
-0,     291060,     291060,     2205,     4410, 0xf0005a5f
-0,     293265,     293265,     2205,     4410, 0xb948541f
-0,     295470,     295470,     2205,     4410, 0xc8f1b16f
-0,     297675,     297675,     2205,     4410, 0x7d4b7506
-0,     299880,     299880,     2205,     4410, 0xac723c55
-0,     302085,     302085,     2205,     4410, 0x2926fab5
-0,     304290,     304290,     2205,     4410, 0x31684995
-0,     306495,     306495,     2205,     4410, 0x35ebfca4
-0,     308700,     308700,     2205,     4410, 0x9cd42c18
-0,     310905,     310905,     2205,     4410, 0xd7ecd7b1
-0,     313110,     313110,     2205,     4410, 0x5e13c602
-0,     315315,     315315,     2205,     4410, 0xe955b5e3
-0,     317520,     317520,     2205,     4410, 0xefad19a1
-0,     319725,     319725,     2205,     4410, 0x435950de
-0,     321930,     321930,     2205,     4410, 0x9d624ebe
-0,     324135,     324135,     2205,     4410, 0x774a9158
-0,     326340,     326340,     2205,     4410, 0x8c41e66a
-0,     328545,     328545,     2205,     4410, 0x70112740
-0,     330750,     330750,     2205,     4410, 0x55abc7a2
-0,     332955,     332955,     2205,     4410, 0x0ec3183c
-0,     335160,     335160,     2205,     4410, 0x54609c56
-0,     337365,     337365,     2205,     4410, 0x60d49f92
-0,     339570,     339570,     2205,     4410, 0x5fb061c8
-0,     341775,     341775,     2205,     4410, 0x6e119c98
-0,     343980,     343980,     2205,     4410, 0x3f39fc69
-0,     346185,     346185,     2205,     4410, 0xef466d0e
-0,     348390,     348390,     2205,     4410, 0xf4cb6fe1
-0,     350595,     350595,     2205,     4410, 0xc4434439
-0,     352800,     352800,     2205,     4410, 0xd02329d2
-0,     355005,     355005,     2205,     4410, 0x216cffaf
-0,     357210,     357210,     2205,     4410, 0x7e59e8c1
-0,     359415,     359415,     2205,     4410, 0xc7c3346d
-0,     361620,     361620,     2205,     4410, 0x5b3723af
-0,     363825,     363825,     2205,     4410, 0x76097270
-0,     366030,     366030,     2205,     4410, 0xae39a233
-0,     368235,     368235,     2205,     4410, 0x686a471c
-0,     370440,     370440,     2205,     4410, 0x3af3c5e0
-0,     372645,     372645,     2205,     4410, 0x11ac711e
-0,     374850,     374850,     2205,     4410, 0xcd8da8ce
-0,     377055,     377055,     2205,     4410, 0x21296e3a
-0,     379260,     379260,     2205,     4410, 0x77168188
-0,     381465,     381465,     2205,     4410, 0x5fcf59cd
-0,     383670,     383670,     2205,     4410, 0x390c8717
-0,     385875,     385875,     2205,     4410, 0x3d5d5b3c
-0,     388080,     388080,     2205,     4410, 0x3b8f13d3
-0,     390285,     390285,     2205,     4410, 0x5b002c2f
-0,     392490,     392490,     2205,     4410, 0x9e1d2b08
-0,     394695,     394695,     2205,     4410, 0x69454ebd
-0,     396900,     396900,     2205,     4410, 0x62a54bec
-0,     399105,     399105,     2205,     4410, 0x4d231fdb
-0,     401310,     401310,     2205,     4410, 0x65624ff7
-0,     403515,     403515,     2205,     4410, 0x6fc66932
-0,     405720,     405720,     2205,     4410, 0x23200cf6
-0,     407925,     407925,     2205,     4410, 0xf8033122
-0,     410130,     410130,     2205,     4410, 0x0fce0744
-0,     412335,     412335,     2205,     4410, 0x9302683e
-0,     414540,     414540,     2205,     4410, 0xd2380245
-0,     416745,     416745,     2205,     4410, 0x482e0872
-0,     418950,     418950,     2205,     4410, 0xe98e6461
-0,     421155,     421155,     2205,     4410, 0x1db404e3
-0,     423360,     423360,     2205,     4410, 0x47a26d45
-0,     425565,     425565,     2205,     4410, 0x449a348a
-0,     427770,     427770,     2205,     4410, 0xee874f84
-0,     429975,     429975,     2205,     4410, 0xc4ecf965
-0,     432180,     432180,     2205,     4410, 0xcc450bc8
-0,     434385,     434385,     2205,     4410, 0xb18d044b
-0,     436590,     436590,     2205,     4410, 0x895435e8
-0,     438795,     438795,     2205,     4410, 0x57e7574e
-0,     441000,     441000,     2205,     4410, 0x8041ad3d
-0,     443205,     443205,     2205,     4410, 0x853d1616
-0,     445410,     445410,     2205,     4410, 0xa11bb32b
-0,     447615,     447615,     2205,     4410, 0xe10ea0de
-0,     449820,     449820,     2205,     4410, 0xdf2ee328
-0,     452025,     452025,     2205,     4410, 0xd5a6dcae
-0,     454230,     454230,     2205,     4410, 0xd176c00b
-0,     456435,     456435,     2205,     4410, 0x9cd6bcf3
-0,     458640,     458640,     2205,     4410, 0x2569690a
-0,     460845,     460845,     2205,     4410, 0x6824aa1d
-0,     463050,     463050,     2205,     4410, 0xa9110afa
-0,     465255,     465255,     2205,     4410, 0x115c25be
-0,     467460,     467460,     2205,     4410, 0x1100f085
-0,     469665,     469665,     2205,     4410, 0x00000000
-0,     471870,     471870,     2205,     4410, 0x00000000
-0,     474075,     474075,     2205,     4410, 0x00000000
-0,     476280,     476280,     2205,     4410, 0x00000000
-0,     478485,     478485,     2205,     4410, 0x00000000
-0,     480690,     480690,     2205,     4410, 0x00000000
-0,     482895,     482895,     2205,     4410, 0x00000000
-0,     485100,     485100,     2205,     4410, 0x00000000
-0,     487305,     487305,     2205,     4410, 0x00000000
-0,     489510,     489510,     2205,     4410, 0x00000000
-0,     491715,     491715,     2205,     4410, 0x00000000
-0,     493920,     493920,     2205,     4410, 0x00000000
-0,     496125,     496125,     2205,     4410, 0x00000000
-0,     498330,     498330,     2205,     4410, 0x00000000
-0,     500535,     500535,     2205,     4410, 0x00000000
-0,     502740,     502740,     2205,     4410, 0x00000000
-0,     504945,     504945,     2205,     4410, 0x00000000
-0,     507150,     507150,     2205,     4410, 0x00000000
-0,     509355,     509355,     2205,     4410, 0x00000000
-0,     511560,     511560,     2205,     4410, 0x00000000
-0,     513765,     513765,     2205,     4410, 0x00000000
-0,     515970,     515970,     2205,     4410, 0x00000000
-0,     518175,     518175,     2205,     4410, 0x00000000
-0,     520380,     520380,     2205,     4410, 0x00000000
-0,     522585,     522585,     2205,     4410, 0x00000000
-0,     524790,     524790,     2205,     4410, 0x00000000
-0,     526995,     526995,     2205,     4410, 0x00000000
-0,     529200,     529200,     2205,     4410, 0x00000000
-0,     531405,     531405,     2205,     4410, 0x00000000
diff --git a/deps/libav/tests/ref/fate/sierra-vmd-video b/deps/libav/tests/ref/fate/sierra-vmd-video
deleted file mode 100644
index 5b9dde1..0000000
--- a/deps/libav/tests/ref/fate/sierra-vmd-video
+++ /dev/null
@@ -1,118 +0,0 @@
-#tb 0: 1/10
-0,          0,          0,        1,   230400, 0x0224ab01
-0,          1,          1,        1,   230400, 0x449e4d81
-0,          2,          2,        1,   230400, 0x3e15e07a
-0,          3,          3,        1,   230400, 0xdabe4172
-0,          4,          4,        1,   230400, 0x0947b7db
-0,          5,          5,        1,   230400, 0x934e243b
-0,          6,          6,        1,   230400, 0x6b5c5b6c
-0,          7,          7,        1,   230400, 0x4bf7bbb5
-0,          8,          8,        1,   230400, 0x423eec8e
-0,          9,          9,        1,   230400, 0x63663b5e
-0,         10,         10,        1,   230400, 0x9c258a67
-0,         11,         11,        1,   230400, 0x1c92b6e0
-0,         12,         12,        1,   230400, 0xdd0a0e28
-0,         13,         13,        1,   230400, 0x51d64af1
-0,         14,         14,        1,   230400, 0x5776ac12
-0,         15,         15,        1,   230400, 0x49070132
-0,         16,         16,        1,   230400, 0xa59635ab
-0,         17,         17,        1,   230400, 0xb1f99504
-0,         18,         18,        1,   230400, 0x61fac725
-0,         19,         19,        1,   230400, 0xc32c28d5
-0,         20,         20,        1,   230400, 0x2b7a91d6
-0,         21,         21,        1,   230400, 0x917be717
-0,         22,         22,        1,   230400, 0xd3c5a2ff
-0,         23,         23,        1,   230400, 0x0678a707
-0,         24,         24,        1,   230400, 0x122504e6
-0,         25,         25,        1,   230400, 0x76aebdae
-0,         26,         26,        1,   230400, 0x81357545
-0,         27,         27,        1,   230400, 0x38baeebd
-0,         28,         28,        1,   230400, 0x1c5c44d4
-0,         29,         29,        1,   230400, 0x60e189cc
-0,         30,         30,        1,   230400, 0xb1f4381c
-0,         31,         31,        1,   230400, 0xb5048fed
-0,         32,         32,        1,   230400, 0xc947c30e
-0,         33,         33,        1,   230400, 0xe8e31c07
-0,         34,         34,        1,   230400, 0x6d49dd02
-0,         35,         35,        1,   230400, 0x293e15d3
-0,         36,         36,        1,   230400, 0x354d792e
-0,         37,         37,        1,   230400, 0x35468780
-0,         38,         38,        1,   230400, 0x365d3991
-0,         39,         39,        1,   230400, 0xc9debef2
-0,         40,         40,        1,   230400, 0x4c4634c2
-0,         41,         41,        1,   230400, 0x347c2dca
-0,         42,         42,        1,   230400, 0x1efa0aaa
-0,         43,         43,        1,   230400, 0xa79a0b5a
-0,         44,         44,        1,   230400, 0xfdb2dcdb
-0,         45,         45,        1,   230400, 0x42dbea33
-0,         46,         46,        1,   230400, 0x2a207e43
-0,         47,         47,        1,   230400, 0x86573783
-0,         48,         48,        1,   230400, 0xc3968473
-0,         49,         49,        1,   230400, 0x8f62a7b4
-0,         50,         50,        1,   230400, 0x5a2e3073
-0,         51,         51,        1,   230400, 0xd24f5e2c
-0,         52,         52,        1,   230400, 0x1df3c67d
-0,         53,         53,        1,   230400, 0xe4fd884d
-0,         57,         57,        1,   230400, 0x9a228555
-0,         58,         58,        1,   230400, 0x9eba8ed5
-0,         59,         59,        1,   230400, 0x3d808a3d
-0,         60,         60,        1,   230400, 0xf57e866d
-0,         61,         61,        1,   230400, 0x85f594f5
-0,         62,         62,        1,   230400, 0xb09f99dd
-0,         63,         63,        1,   230400, 0x2b368475
-0,         64,         64,        1,   230400, 0xa2417afd
-0,         65,         65,        1,   230400, 0x590b709d
-0,         66,         66,        1,   230400, 0x5d617705
-0,         67,         67,        1,   230400, 0xabf981ad
-0,         68,         68,        1,   230400, 0x5a8590cd
-0,         69,         69,        1,   230400, 0x1bff853d
-0,         70,         70,        1,   230400, 0x71d08055
-0,         71,         71,        1,   230400, 0x2ebd817d
-0,         72,         72,        1,   230400, 0x6e838255
-0,         73,         73,        1,   230400, 0x043984cd
-0,         74,         74,        1,   230400, 0x7ff18495
-0,         75,         75,        1,   230400, 0xa43b8385
-0,         76,         76,        1,   230400, 0x72b5825d
-0,         77,         77,        1,   230400, 0x3a178085
-0,         78,         78,        1,   230400, 0x67748245
-0,         79,         79,        1,   230400, 0xeddf81d5
-0,         80,         80,        1,   230400, 0x8b088665
-0,         81,         81,        1,   230400, 0x6c408e15
-0,         82,         82,        1,   230400, 0x81f196dd
-0,         83,         83,        1,   230400, 0xab9f953d
-0,         84,         84,        1,   230400, 0xa5f69795
-0,         85,         85,        1,   230400, 0xa772950d
-0,         86,         86,        1,   230400, 0x6a5596d5
-0,         87,         87,        1,   230400, 0x1355958d
-0,         88,         88,        1,   230400, 0x4134981d
-0,         89,         89,        1,   230400, 0x8b929515
-0,         90,         90,        1,   230400, 0x482f95c5
-0,         91,         91,        1,   230400, 0x7a9795d5
-0,         92,         92,        1,   230400, 0x21c29abd
-0,         93,         93,        1,   230400, 0x9ae6a475
-0,         94,         94,        1,   230400, 0x3734aee5
-0,         95,         95,        1,   230400, 0xa0a1b365
-0,         96,         96,        1,   230400, 0x2dcab1c5
-0,         97,         97,        1,   230400, 0x9c8b6c44
-0,         98,         98,        1,   230400, 0x5da75feb
-0,         99,         99,        1,   230400, 0x4d02f8e3
-0,        100,        100,        1,   230400, 0x66824f3a
-0,        101,        101,        1,   230400, 0x0c9257e2
-0,        102,        102,        1,   230400, 0xb2927092
-0,        103,        103,        1,   230400, 0xb5dc6e9a
-0,        104,        104,        1,   230400, 0x6e567bc6
-0,        105,        105,        1,   230400, 0xbf9e0f7a
-0,        106,        106,        1,   230400, 0xb16f684a
-0,        107,        107,        1,   230400, 0xf9e55e81
-0,        108,        108,        1,   230400, 0xd8d0bcba
-0,        109,        109,        1,   230400, 0x44720ac0
-0,        110,        110,        1,   230400, 0x7d4c2058
-0,        113,        113,        1,   230400, 0xb0973eb9
-0,        114,        114,        1,   230400, 0x405a13ce
-0,        115,        115,        1,   230400, 0x6422f00a
-0,        116,        116,        1,   230400, 0x924b6c1e
-0,        145,        145,        1,   230400, 0xcf7809c0
-0,        146,        146,        1,   230400, 0x883a3863
-0,        147,        147,        1,   230400, 0x6adc9e03
-0,        148,        148,        1,   230400, 0x4f5ab7a8
-0,        214,        214,        1,   230400, 0xdc0aab94
diff --git a/deps/libav/tests/ref/fate/siff-demux b/deps/libav/tests/ref/fate/siff-demux
deleted file mode 100644
index 692e504..0000000
--- a/deps/libav/tests/ref/fate/siff-demux
+++ /dev/null
@@ -1,112 +0,0 @@
-#tb 0: 1/12
-#tb 1: 1/22050
-0,          0,          0,        1,    15152, 0x14fc0f1f
-1,          0,          0,    22050,    22050, 0xa7d60d27
-0,          1,          1,        1,    15344, 0x31614bd7
-0,          2,          2,        1,    15163, 0x88c46248
-0,          3,          3,        1,    15152, 0x43c9c0e6
-0,          4,          4,        1,    15341, 0x813f6f01
-0,          5,          5,        1,    15152, 0x7598d01c
-0,          6,          6,        1,    15152, 0x40b5cdb1
-0,          7,          7,        1,    15347, 0xe061c843
-0,          8,          8,        1,    15159, 0x2e3c2242
-0,          9,          9,        1,    15151, 0x7201abc5
-0,         10,         10,        1,    15346, 0xeb5a349e
-0,         11,         11,        1,    15154, 0xda9907c9
-0,         12,         12,        1,    15159, 0x8d4d63b0
-1,      22050,      22050,    22050,    22050, 0xeb11185c
-0,         13,         13,        1,    15337, 0xd988436d
-0,         14,         14,        1,    15162, 0x0b495da7
-0,         15,         15,        1,    15164, 0xd8837439
-0,         16,         16,        1,    15339, 0x7ad372cc
-0,         17,         17,        1,    15161, 0xc45d4590
-0,         18,         18,        1,    15159, 0x5bdd9801
-0,         19,         19,        1,    15335, 0x8e17c83e
-0,         20,         20,        1,    15160, 0x5cdbdc04
-0,         21,         21,        1,    15157, 0xf480a643
-0,         22,         22,        1,    15346, 0x0c61b206
-0,         23,         23,        1,    15160, 0x05d9acfd
-0,         24,         24,        1,    15158, 0xebdc3ac4
-1,      44100,      44100,    22050,    22050, 0xd6dc0e17
-0,         25,         25,        1,    15334, 0xb51fd1b9
-0,         26,         26,        1,    15152, 0x81f74e5c
-0,         27,         27,        1,    15161, 0xafeca32c
-0,         28,         28,        1,    15347, 0x8f5e5874
-0,         29,         29,        1,    15157, 0xdeff353c
-0,         30,         30,        1,    15160, 0x93a19aa0
-0,         31,         31,        1,    15347, 0x94224071
-0,         32,         32,        1,    15153, 0x9982aff5
-0,         33,         33,        1,    15164, 0x044bcf2b
-0,         34,         34,        1,    15347, 0x40aca6e9
-0,         35,         35,        1,    15160, 0xf820e2c7
-0,         36,         36,        1,    15154, 0x457832b5
-1,      66150,      66150,    22050,    22050, 0x020412c4
-0,         37,         37,        1,    15334, 0xbb1704f0
-0,         38,         38,        1,    15156, 0xc0672ed1
-0,         39,         39,        1,    15159, 0x9a82c7c1
-0,         40,         40,        1,    15338, 0x03857aae
-0,         41,         41,        1,    15158, 0xe6177548
-0,         42,         42,        1,    15159, 0xf8ecafc4
-0,         43,         43,        1,    15345, 0x0a10882e
-0,         44,         44,        1,    15161, 0xec4339fb
-0,         45,         45,        1,    15157, 0x071935a2
-0,         46,         46,        1,    15340, 0x68aad418
-0,         47,         47,        1,    15151, 0x891bc3fe
-0,         48,         48,        1,    15153, 0xf522e54c
-1,      88200,      88200,    22050,    22050, 0x5d9606ae
-0,         49,         49,        1,    15346, 0x5a018842
-0,         50,         50,        1,    15164, 0x6842ac50
-0,         51,         51,        1,    15156, 0x32369159
-0,         52,         52,        1,    15347, 0xf5be31aa
-0,         53,         53,        1,    15157, 0xd2da28bd
-0,         54,         54,        1,    15152, 0x389feda6
-0,         55,         55,        1,    15345, 0x69187603
-0,         56,         56,        1,    15154, 0x5dc60365
-0,         57,         57,        1,    15159, 0x8c811193
-0,         58,         58,        1,    15344, 0x3db4bf13
-0,         59,         59,        1,    15156, 0xf729ebe1
-0,         60,         60,        1,    15162, 0xf10a4ce5
-1,     110250,     110250,    22050,    22050, 0x08171bca
-0,         61,         61,        1,    15345, 0x749b0604
-0,         62,         62,        1,    15160, 0xfe3bbbce
-0,         63,         63,        1,    15160, 0x6dcc4b85
-0,         64,         64,        1,    15337, 0xab87dd97
-0,         65,         65,        1,    15163, 0x1ce60db8
-0,         66,         66,        1,    15164, 0xfc4a2002
-0,         67,         67,        1,    15345, 0x9108e072
-0,         68,         68,        1,    15153, 0x83fc9055
-0,         69,         69,        1,    15155, 0xa1101e1a
-0,         70,         70,        1,    15343, 0x6418f0e9
-0,         71,         71,        1,    15157, 0x8c743049
-0,         72,         72,        1,    15153, 0x9c0e33eb
-1,     132300,     132300,    22050,    22050, 0xd43b0cf9
-0,         73,         73,        1,    15337, 0x64bae0b6
-0,         74,         74,        1,    15162, 0x5f6b91d5
-0,         75,         75,        1,    15162, 0x44e5dd3d
-0,         76,         76,        1,    15342, 0x968dc44c
-0,         77,         77,        1,    15158, 0x0e706c4d
-0,         78,         78,        1,    15153, 0xa7d2199a
-0,         79,         79,        1,    15345, 0x834d0f2e
-0,         80,         80,        1,    15163, 0x3d5d38c3
-0,         81,         81,        1,    15151, 0xf7d49515
-0,         82,         82,        1,    15337, 0x5f362f2a
-0,         83,         83,        1,    15162, 0xea87d814
-0,         84,         84,        1,    15164, 0xeb0a2662
-1,     154350,     154350,    22050,    22050, 0x486d1bc2
-0,         85,         85,        1,    15340, 0x772109e6
-0,         86,         86,        1,    15156, 0x9459cda5
-0,         87,         87,        1,    15152, 0x4f174e2d
-0,         88,         88,        1,    15343, 0x10d42a59
-0,         89,         89,        1,    15162, 0xd65ec2ec
-0,         90,         90,        1,    15156, 0x1e382319
-0,         91,         91,        1,    15335, 0xec904c2a
-0,         92,         92,        1,    15161, 0x56d49e44
-0,         93,         93,        1,    15154, 0x51d02cd0
-0,         94,         94,        1,    15340, 0xec3e14ee
-0,         95,         95,        1,    15160, 0xe43b5305
-0,         96,         96,        1,    15156, 0x8f2876a5
-1,     176400,     176400,    22050,    22050, 0x5c5508d3
-0,         97,         97,        1,    15340, 0xb26a9059
-0,         98,         98,        1,    15156, 0xf9570ec0
-0,         99,         99,        1,    15151, 0x862ffa1f
-1,     198450,     198450,     1984,     1984, 0x9cb4dfb7
diff --git a/deps/libav/tests/ref/fate/smacker-audio b/deps/libav/tests/ref/fate/smacker-audio
deleted file mode 100644
index 442f479..0000000
--- a/deps/libav/tests/ref/fate/smacker-audio
+++ /dev/null
@@ -1,87 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,    23620,    47240, 0x9974897c
-0,      23620,      23620,     1564,     3128, 0x7e4064b4
-0,      25184,      25184,     1564,     3128, 0x80883301
-0,      26748,      26748,     1568,     3136, 0x2ad2d341
-0,      28316,      28316,     1564,     3128, 0xda8468e3
-0,      29880,      29880,     1568,     3136, 0x9d6f6cdf
-0,      31448,      31448,     1564,     3128, 0x1aaa64b5
-0,      33012,      33012,     1564,     3128, 0x9182728b
-0,      34576,      34576,     1568,     3136, 0xfa8e17b3
-0,      36144,      36144,     1564,     3128, 0x0dc3c1cf
-0,      37708,      37708,     1568,     3136, 0x0109639d
-0,      39276,      39276,     1564,     3128, 0x6d8a12d9
-0,      40840,      40840,     1564,     3128, 0x4b9a9597
-0,      42404,      42404,     1568,     3136, 0x9112710e
-0,      43972,      43972,     1564,     3128, 0x8cccf522
-0,      45536,      45536,     1564,     3128, 0x6594bbf3
-0,      47100,      47100,     1568,     3136, 0xd878a7d5
-0,      48668,      48668,     1564,     3128, 0xaa6e3905
-0,      50232,      50232,     1568,     3136, 0x2a062e04
-0,      51800,      51800,     1564,     3128, 0x84e4006a
-0,      53364,      53364,     1564,     3128, 0x85183633
-0,      54928,      54928,     1568,     3136, 0xb62d4b02
-0,      56496,      56496,     1564,     3128, 0xe209462a
-0,      58060,      58060,     1568,     3136, 0x57c4824b
-0,      59628,      59628,     1564,     3128, 0x664a9163
-0,      61192,      61192,     1564,     3128, 0xb4287874
-0,      62756,      62756,     1568,     3136, 0xde626885
-0,      64324,      64324,     1564,     3128, 0x919763c2
-0,      65888,      65888,     1564,     3128, 0xa4f664e1
-0,      67452,      67452,     1568,     3136, 0xa0bab0d4
-0,      69020,      69020,     1564,     3128, 0xe938939c
-0,      70584,      70584,     1568,     3136, 0x3679bfc7
-0,      72152,      72152,     1564,     3128, 0xc96c55c3
-0,      73716,      73716,     1564,     3128, 0x119114d6
-0,      75280,      75280,     1568,     3136, 0x42f3800f
-0,      76848,      76848,     1564,     3128, 0x4250c4ad
-0,      78412,      78412,     1568,     3136, 0x5cdd4925
-0,      79980,      79980,     1564,     3128, 0xa4c12360
-0,      81544,      81544,     1564,     3128, 0x849f48de
-0,      83108,      83108,     1568,     3136, 0x6acd8ff9
-0,      84676,      84676,     1564,     3128, 0xb2758556
-0,      86240,      86240,     1564,     3128, 0x10f2fcb1
-0,      87804,      87804,     1568,     3136, 0xf0f02b23
-0,      89372,      89372,     1564,     3128, 0x64f759c6
-0,      90936,      90936,     1568,     3136, 0x7ec075e3
-0,      92504,      92504,     1564,     3128, 0xf981d51e
-0,      94068,      94068,     1564,     3128, 0xc622e8b9
-0,      95632,      95632,     1568,     3136, 0xf632e2f8
-0,      97200,      97200,     1564,     3128, 0xda561864
-0,      98764,      98764,     1568,     3136, 0x14d2e888
-0,     100332,     100332,     1564,     3128, 0x015bb869
-0,     101896,     101896,     1564,     3128, 0xedb1fb62
-0,     103460,     103460,     1568,     3136, 0xe0560c41
-0,     105028,     105028,     1564,     3128, 0x14773c9a
-0,     106592,     106592,     1568,     3136, 0x850f1c82
-0,     108160,     108160,     1564,     3128, 0xb0bd5347
-0,     109724,     109724,     1564,     3128, 0x8f82edbf
-0,     111288,     111288,     1568,     3136, 0x493abee2
-0,     112856,     112856,     1564,     3128, 0xf5daff3f
-0,     114420,     114420,     1564,     3128, 0x78ad2690
-0,     115984,     115984,     1568,     3136, 0x490ebafc
-0,     117552,     117552,     1564,     3128, 0x70333fd2
-0,     119116,     119116,     1568,     3136, 0x8cb1c350
-0,     120684,     120684,     1564,     3128, 0x8bd057cb
-0,     122248,     122248,     1564,     3128, 0x161b3dbc
-0,     123812,     123812,     1568,     3136, 0xb47fb88a
-0,     125380,     125380,     1564,     3128, 0x474b381e
-0,     126944,     126944,     1568,     3136, 0x07c519bb
-0,     128512,     128512,     1564,     3128, 0x15b916c8
-0,     130076,     130076,     1564,     3128, 0x0ed7f6fb
-0,     131640,     131640,     1568,     3136, 0x54d6397b
-0,     133208,     133208,     1564,     3128, 0x437242bb
-0,     134772,     134772,     1564,     3128, 0x38f05c4d
-0,     136336,     136336,     1568,     3136, 0x5d000e59
-0,     137904,     137904,     1564,     3128, 0xdeab2d04
-0,     139468,     139468,     1568,     3136, 0x77de6880
-0,     141036,     141036,     1564,     3128, 0xbc87ef25
-0,     142600,     142600,     1564,     3128, 0xc1638ade
-0,     144164,     144164,     1568,     3136, 0xcfb64a5f
-0,     145732,     145732,     1564,     3128, 0x90b1b826
-0,     147296,     147296,     1568,     3136, 0x00000000
-0,     148864,     148864,     1564,     3128, 0x00000000
-0,     150428,     150428,     1564,     3128, 0x00000000
-0,     151992,     151992,     1568,     3136, 0x00000000
-0,     153560,     153560,     1564,     3128, 0x00000000
-0,     155124,     155124,     1428,     2856, 0x00000000
diff --git a/deps/libav/tests/ref/fate/smacker-video b/deps/libav/tests/ref/fate/smacker-video
deleted file mode 100644
index 8bd3071..0000000
--- a/deps/libav/tests/ref/fate/smacker-video
+++ /dev/null
@@ -1,101 +0,0 @@
-#tb 0: 71/1000
-0,          0,          0,        1,   192000, 0x8926d7fc
-0,          1,          1,        1,   192000, 0x2506d384
-0,          2,          2,        1,   192000, 0x9a8dc93a
-0,          3,          3,        1,   192000, 0x4badb7f2
-0,          4,          4,        1,   192000, 0xc1fc9631
-0,          5,          5,        1,   192000, 0xfc906592
-0,          6,          6,        1,   192000, 0xeddd28e2
-0,          7,          7,        1,   192000, 0xeee0dcf5
-0,          8,          8,        1,   192000, 0x76798c91
-0,          9,          9,        1,   192000, 0x8a034c1b
-0,         10,         10,        1,   192000, 0x4df3127c
-0,         11,         11,        1,   192000, 0x2eefd36f
-0,         12,         12,        1,   192000, 0x58a2a1d6
-0,         13,         13,        1,   192000, 0x1a3d7971
-0,         14,         14,        1,   192000, 0xa1a65bd5
-0,         15,         15,        1,   192000, 0x344957b9
-0,         16,         16,        1,   192000, 0xe23b5f4e
-0,         17,         17,        1,   192000, 0xb5c2710b
-0,         18,         18,        1,   192000, 0x7a25938f
-0,         19,         19,        1,   192000, 0x0a84e4c9
-0,         20,         20,        1,   192000, 0x94209b0d
-0,         21,         21,        1,   192000, 0xf940e51f
-0,         22,         22,        1,   192000, 0xb9fdec42
-0,         23,         23,        1,   192000, 0x7b04a376
-0,         24,         24,        1,   192000, 0x5fe0026b
-0,         25,         25,        1,   192000, 0x775aca39
-0,         26,         26,        1,   192000, 0xae14fb32
-0,         27,         27,        1,   192000, 0x661106e5
-0,         28,         28,        1,   192000, 0xe8658dbf
-0,         29,         29,        1,   192000, 0x5359f0f9
-0,         30,         30,        1,   192000, 0xc1ec80f4
-0,         31,         31,        1,   192000, 0xca53806b
-0,         32,         32,        1,   192000, 0xf0766b2e
-0,         33,         33,        1,   192000, 0x39962da8
-0,         34,         34,        1,   192000, 0x4171c37f
-0,         35,         35,        1,   192000, 0x3abf3b46
-0,         36,         36,        1,   192000, 0xecc68313
-0,         37,         37,        1,   192000, 0xea339baf
-0,         38,         38,        1,   192000, 0x616b8f16
-0,         39,         39,        1,   192000, 0xf77a8581
-0,         40,         40,        1,   192000, 0xb315678b
-0,         41,         41,        1,   192000, 0x0a4a5218
-0,         42,         42,        1,   192000, 0x98802be4
-0,         43,         43,        1,   192000, 0xa2f0fd94
-0,         44,         44,        1,   192000, 0x6671c84f
-0,         45,         45,        1,   192000, 0x38327e31
-0,         46,         46,        1,   192000, 0xb85d3e08
-0,         47,         47,        1,   192000, 0xdc69eba9
-0,         48,         48,        1,   192000, 0x8955a0b3
-0,         49,         49,        1,   192000, 0x714a548b
-0,         50,         50,        1,   192000, 0xc0471de9
-0,         51,         51,        1,   192000, 0x2e16e039
-0,         52,         52,        1,   192000, 0x9fa4b033
-0,         53,         53,        1,   192000, 0x4a0f9402
-0,         54,         54,        1,   192000, 0x1f3e6843
-0,         55,         55,        1,   192000, 0x31774850
-0,         56,         56,        1,   192000, 0x9d5336a2
-0,         57,         57,        1,   192000, 0xf7de27a2
-0,         58,         58,        1,   192000, 0x98c717ce
-0,         59,         59,        1,   192000, 0x615b10b8
-0,         60,         60,        1,   192000, 0xd5bc0e7e
-0,         61,         61,        1,   192000, 0xd5bc0e7e
-0,         62,         62,        1,   192000, 0xd5bc0e7e
-0,         63,         63,        1,   192000, 0xd5bc0e7e
-0,         64,         64,        1,   192000, 0xd5bc0e7e
-0,         65,         65,        1,   192000, 0xd5bc0e7e
-0,         66,         66,        1,   192000, 0xd5bc0e7e
-0,         67,         67,        1,   192000, 0xd5bc0e7e
-0,         68,         68,        1,   192000, 0xd5bc0e7e
-0,         69,         69,        1,   192000, 0xd5bc0e7e
-0,         70,         70,        1,   192000, 0xd5bc0e7e
-0,         71,         71,        1,   192000, 0xd5bc0e7e
-0,         72,         72,        1,   192000, 0xd5bc0e7e
-0,         73,         73,        1,   192000, 0xd5bc0e7e
-0,         74,         74,        1,   192000, 0xd5bc0e7e
-0,         75,         75,        1,   192000, 0xd5bc0e7e
-0,         76,         76,        1,   192000, 0xd5bc0e7e
-0,         77,         77,        1,   192000, 0xd5bc0e7e
-0,         78,         78,        1,   192000, 0xd5bc0e7e
-0,         79,         79,        1,   192000, 0xd5bc0e7e
-0,         80,         80,        1,   192000, 0xd5bc0e7e
-0,         81,         81,        1,   192000, 0xd5bc0e7e
-0,         82,         82,        1,   192000, 0xd5bc0e7e
-0,         83,         83,        1,   192000, 0xd5bc0e7e
-0,         84,         84,        1,   192000, 0xd5bc0e7e
-0,         85,         85,        1,   192000, 0xd5bc0e7e
-0,         86,         86,        1,   192000, 0xd5bc0e7e
-0,         87,         87,        1,   192000, 0xd5bc0e7e
-0,         88,         88,        1,   192000, 0xd5bc0e7e
-0,         89,         89,        1,   192000, 0xd5bc0e7e
-0,         90,         90,        1,   192000, 0xd5bc0e7e
-0,         91,         91,        1,   192000, 0xd5bc0e7e
-0,         92,         92,        1,   192000, 0xd5bc0e7e
-0,         93,         93,        1,   192000, 0xd5bc0e7e
-0,         94,         94,        1,   192000, 0xd5bc0e7e
-0,         95,         95,        1,   192000, 0xd5bc0e7e
-0,         96,         96,        1,   192000, 0xd5bc0e7e
-0,         97,         97,        1,   192000, 0xd5bc0e7e
-0,         98,         98,        1,   192000, 0xd5bc0e7e
-0,         99,         99,        1,   192000, 0xd5bc0e7e
diff --git a/deps/libav/tests/ref/fate/smc b/deps/libav/tests/ref/fate/smc
deleted file mode 100644
index cdfc3d5..0000000
--- a/deps/libav/tests/ref/fate/smc
+++ /dev/null
@@ -1,121 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   230400, 0xf814fc90
-0,          3,          3,        1,   230400, 0xe1b13137
-0,          6,          6,        1,   230400, 0xa7f4d408
-0,          9,          9,        1,   230400, 0x4b86e1d5
-0,         12,         12,        1,   230400, 0xc663af5a
-0,         15,         15,        1,   230400, 0x943b5757
-0,         18,         18,        1,   230400, 0x0d7ee496
-0,         21,         21,        1,   230400, 0x78792de4
-0,         24,         24,        1,   230400, 0xd102fb8d
-0,         27,         27,        1,   230400, 0xf9006139
-0,         30,         30,        1,   230400, 0x216bd87d
-0,         33,         33,        1,   230400, 0x1e4c902c
-0,         36,         36,        1,   230400, 0x5aaa7742
-0,         39,         39,        1,   230400, 0x48699d93
-0,         42,         42,        1,   230400, 0xd1e22a5c
-0,         45,         45,        1,   230400, 0x18929315
-0,         48,         48,        1,   230400, 0x680dd4d3
-0,         51,         51,        1,   230400, 0x4cdbcbcb
-0,         54,         54,        1,   230400, 0x6f810d98
-0,         57,         57,        1,   230400, 0xb4f68204
-0,         60,         60,        1,   230400, 0xbd3bb19e
-0,         63,         63,        1,   230400, 0xab27b424
-0,         66,         66,        1,   230400, 0xe5dd675d
-0,         69,         69,        1,   230400, 0x811e45a1
-0,         72,         72,        1,   230400, 0x951011f7
-0,         75,         75,        1,   230400, 0x2f1e2b99
-0,         78,         78,        1,   230400, 0x6657c0d6
-0,         81,         81,        1,   230400, 0xfd29177d
-0,         84,         84,        1,   230400, 0x4b4c01d7
-0,         87,         87,        1,   230400, 0x9af286aa
-0,         90,         90,        1,   230400, 0xc4e9b193
-0,         93,         93,        1,   230400, 0x05dc28ec
-0,         96,         96,        1,   230400, 0x68352119
-0,         99,         99,        1,   230400, 0x0b87e79c
-0,        102,        102,        1,   230400, 0x8358b180
-0,        105,        105,        1,   230400, 0x8debbc9d
-0,        108,        108,        1,   230400, 0x961c58ce
-0,        111,        111,        1,   230400, 0xd8a809c8
-0,        114,        114,        1,   230400, 0x5351789d
-0,        117,        117,        1,   230400, 0xa7ca598c
-0,        120,        120,        1,   230400, 0xc5ce1812
-0,        123,        123,        1,   230400, 0x74496550
-0,        126,        126,        1,   230400, 0x326e366e
-0,        129,        129,        1,   230400, 0x27ae9a92
-0,        132,        132,        1,   230400, 0xadbc8794
-0,        135,        135,        1,   230400, 0x7f3587d8
-0,        138,        138,        1,   230400, 0xf0400ca6
-0,        141,        141,        1,   230400, 0x59a5138e
-0,        144,        144,        1,   230400, 0x456d62a5
-0,        147,        147,        1,   230400, 0xf1a5e5f1
-0,        150,        150,        1,   230400, 0x75c712e4
-0,        153,        153,        1,   230400, 0xd160780a
-0,        156,        156,        1,   230400, 0xc6c23cf0
-0,        159,        159,        1,   230400, 0x0339a2ac
-0,        162,        162,        1,   230400, 0x0e27a2e2
-0,        165,        165,        1,   230400, 0x84976300
-0,        168,        168,        1,   230400, 0xb368f3c4
-0,        171,        171,        1,   230400, 0xa5231fb8
-0,        174,        174,        1,   230400, 0x17c036d4
-0,        177,        177,        1,   230400, 0xfc81a2c0
-0,        180,        180,        1,   230400, 0x99faa403
-0,        183,        183,        1,   230400, 0xff59efd3
-0,        186,        186,        1,   230400, 0xcece1d23
-0,        189,        189,        1,   230400, 0x56c785d9
-0,        192,        192,        1,   230400, 0xe5a9f222
-0,        195,        195,        1,   230400, 0xb80946f8
-0,        198,        198,        1,   230400, 0xf6b642c6
-0,        201,        201,        1,   230400, 0x69573aed
-0,        204,        204,        1,   230400, 0xfb69a1fd
-0,        207,        207,        1,   230400, 0x100b47f4
-0,        210,        210,        1,   230400, 0x6edf9543
-0,        213,        213,        1,   230400, 0x11fdf43c
-0,        216,        216,        1,   230400, 0xd143bf2a
-0,        219,        219,        1,   230400, 0x7ca747c4
-0,        222,        222,        1,   230400, 0xd984bd73
-0,        225,        225,        1,   230400, 0xc5477e8d
-0,        228,        228,        1,   230400, 0xf7d58300
-0,        231,        231,        1,   230400, 0x7a1b9463
-0,        234,        234,        1,   230400, 0x47a29342
-0,        237,        237,        1,   230400, 0xdf437f9d
-0,        240,        240,        1,   230400, 0xf836ef5d
-0,        243,        243,        1,   230400, 0xc98937af
-0,        246,        246,        1,   230400, 0x9258695b
-0,        249,        249,        1,   230400, 0xd4fe179c
-0,        252,        252,        1,   230400, 0x35d524d3
-0,        255,        255,        1,   230400, 0xd9ce5484
-0,        258,        258,        1,   230400, 0xdef776ed
-0,        261,        261,        1,   230400, 0x154c4057
-0,        264,        264,        1,   230400, 0xf5c764f1
-0,        267,        267,        1,   230400, 0x41979b13
-0,        270,        270,        1,   230400, 0xae4e83db
-0,        273,        273,        1,   230400, 0x09fc0f83
-0,        276,        276,        1,   230400, 0x60267fdf
-0,        279,        279,        1,   230400, 0xeaafc525
-0,        282,        282,        1,   230400, 0x80cc35e5
-0,        285,        285,        1,   230400, 0xd82c6164
-0,        288,        288,        1,   230400, 0xd68b8111
-0,        291,        291,        1,   230400, 0x96f874a3
-0,        294,        294,        1,   230400, 0x7fc861c4
-0,        297,        297,        1,   230400, 0xb911f310
-0,        300,        300,        1,   230400, 0x35bbf5aa
-0,        303,        303,        1,   230400, 0xa922b683
-0,        306,        306,        1,   230400, 0xbf6ae353
-0,        309,        309,        1,   230400, 0x6bd3984c
-0,        312,        312,        1,   230400, 0xe51768c0
-0,        315,        315,        1,   230400, 0xee691624
-0,        318,        318,        1,   230400, 0xd546fed7
-0,        321,        321,        1,   230400, 0x98d375e6
-0,        324,        324,        1,   230400, 0x3b9ca990
-0,        327,        327,        1,   230400, 0x27128ad1
-0,        330,        330,        1,   230400, 0x2788e38c
-0,        333,        333,        1,   230400, 0xb0cf3381
-0,        336,        336,        1,   230400, 0x4fc86d39
-0,        339,        339,        1,   230400, 0xf5632fff
-0,        342,        342,        1,   230400, 0x7fa1e6c2
-0,        345,        345,        1,   230400, 0xffeef044
-0,        348,        348,        1,   230400, 0x932af385
-0,        351,        351,        1,   230400, 0x76738428
-0,        354,        354,        1,   230400, 0xf6771ba2
-0,        357,        357,        1,   230400, 0x17e2ff27
diff --git a/deps/libav/tests/ref/fate/smjpeg-demux b/deps/libav/tests/ref/fate/smjpeg-demux
deleted file mode 100644
index 4fcd614..0000000
--- a/deps/libav/tests/ref/fate/smjpeg-demux
+++ /dev/null
@@ -1,425 +0,0 @@
-#tb 0: 1/1000
-#tb 1: 1/1000
-0,          0,          0,        0,      734, 0x5a042c2c
-1,          0,          0,       23,      260, 0x00000000
-1,         23,         23,       23,      260, 0x00000000
-1,         46,         46,       23,      260, 0xac9e0a9b
-1,         69,         69,       23,      260, 0x89256f5b
-1,         92,         92,       23,      260, 0x8e646e36
-0,        111,        111,        0,      763, 0xb5893f2f
-1,        116,        116,       23,      260, 0x3ab972fc
-1,        139,        139,       23,      260, 0xaea86bb2
-1,        162,        162,       23,      260, 0x2366447a
-1,        185,        185,       23,      260, 0x82c14f9c
-1,        208,        208,       23,      260, 0xcdcf6fa8
-0,        222,        222,        0,     3023, 0x0f3907d3
-1,        232,        232,       23,      260, 0xb3ed64bd
-1,        255,        255,       23,      260, 0xac304b92
-1,        278,        278,       23,      260, 0xc8bc553b
-1,        301,        301,       23,      260, 0xd35572b4
-1,        325,        325,       23,      260, 0x182f6190
-0,        333,        333,        0,     4800, 0x22e6e18a
-1,        348,        348,       23,      260, 0xbf9145c0
-1,        371,        371,       23,      260, 0x0ec85a7e
-1,        394,        394,       23,      260, 0x3684720e
-1,        417,        417,       23,      260, 0xe985616a
-1,        441,        441,       23,      260, 0x12b147dc
-0,        444,        444,        0,     6417, 0x427adde5
-1,        464,        464,       23,      260, 0xb8b55dd9
-1,        487,        487,       23,      260, 0xfd4a7007
-1,        510,        510,       23,      260, 0xfcc05c9a
-1,        534,        534,       23,      260, 0x20f74aea
-0,        555,        555,        0,     6776, 0x7a74c6ad
-1,        557,        557,       23,      260, 0x025359ca
-1,        580,        580,       23,      260, 0xace44ba1
-1,        603,        603,       23,      260, 0x03506929
-1,        626,        626,       23,      260, 0x8a926f17
-1,        650,        650,       23,      260, 0x4a7061e7
-0,        666,        666,        0,     6808, 0x1f6eb7c3
-1,        673,        673,       23,      260, 0xf8b66cc9
-1,        696,        696,       23,      260, 0xe8c96dec
-1,        719,        719,       23,      260, 0x672a54a6
-1,        743,        743,       23,      260, 0xe97b5698
-1,        766,        766,       23,      260, 0x377f684d
-0,        777,        777,        0,     6726, 0x452087e6
-1,        789,        789,       23,      260, 0xe9a66786
-1,        812,        812,       23,      260, 0xf8e17080
-1,        835,        835,       23,      260, 0x65eb662a
-1,        859,        859,       23,      260, 0xd8d361e9
-1,        882,        882,       23,      260, 0xb8115a0b
-0,        888,        888,        0,     6829, 0xee82b109
-1,        905,        905,       23,      260, 0xa5a85461
-1,        928,        928,       23,      260, 0xf401663b
-1,        952,        952,       23,      260, 0x042f714e
-1,        975,        975,       23,      260, 0xdf195820
-1,        998,        998,       23,      260, 0x0a67653c
-0,        999,        999,        0,     7055, 0xf41f1108
-1,       1021,       1021,       23,      260, 0xe9b44d02
-1,       1044,       1044,       23,      260, 0xbd4747b9
-1,       1068,       1068,       23,      260, 0x3ef66738
-1,       1091,       1091,       23,      260, 0x0f4a6e44
-0,       1111,       1111,        0,     6977, 0xf8fe1ede
-1,       1114,       1114,       23,      260, 0xaa3d6eb6
-1,       1137,       1137,       23,      260, 0xb9a46c4a
-1,       1160,       1160,       23,      260, 0x4f974c2e
-1,       1184,       1184,       23,      260, 0x9e714a00
-1,       1207,       1207,       23,      260, 0x601a7152
-0,       1222,       1222,        0,     6942, 0x9ad105c6
-1,       1230,       1230,       23,      260, 0xaf317064
-1,       1253,       1253,       23,      260, 0x163d4829
-1,       1277,       1277,       23,      260, 0xc56b4f1a
-1,       1300,       1300,       23,      260, 0x7623729c
-1,       1323,       1323,       23,      260, 0xa514694f
-0,       1333,       1333,        0,     6926, 0xe239dad6
-1,       1346,       1346,       23,      260, 0x93ee4ad8
-1,       1369,       1369,       23,      260, 0x6d8e573f
-1,       1393,       1393,       23,      260, 0x13256d68
-1,       1416,       1416,       23,      260, 0x187761a2
-1,       1439,       1439,       23,      260, 0x426045e7
-0,       1444,       1444,        0,     6966, 0x81dcfab1
-1,       1462,       1462,       23,      260, 0x7e7e5891
-1,       1486,       1486,       23,      260, 0xd6926dcc
-1,       1509,       1509,       23,      260, 0xf0196061
-1,       1532,       1532,       23,      260, 0x7cac49a3
-0,       1555,       1555,        0,     6896, 0x31e6cc02
-1,       1555,       1555,       23,      260, 0x24f4549a
-1,       1578,       1578,       23,      260, 0x937f551d
-1,       1602,       1602,       23,      260, 0x9bf462c5
-1,       1625,       1625,       23,      260, 0xd1e07436
-1,       1648,       1648,       23,      260, 0xdab36215
-0,       1666,       1666,        0,     6889, 0x1cc1006e
-1,       1671,       1671,       23,      260, 0xabc5662b
-1,       1695,       1695,       23,      260, 0xa24f6bf1
-1,       1718,       1718,       23,      260, 0x39e664b2
-1,       1741,       1741,       23,      260, 0xf5dc54ca
-1,       1764,       1764,       23,      260, 0xc3b16974
-0,       1777,       1777,        0,     6933, 0xc303f87f
-1,       1787,       1787,       23,      260, 0x6cf46bca
-1,       1811,       1811,       23,      260, 0x7a6b69b9
-1,       1834,       1834,       23,      260, 0xc02f69b9
-1,       1857,       1857,       23,      260, 0x7fc764a9
-1,       1880,       1880,       23,      260, 0xd9705b09
-0,       1888,       1888,        0,     7034, 0xb4970a20
-1,       1904,       1904,       23,      260, 0x17b05f49
-1,       1927,       1927,       23,      260, 0x10ad647c
-1,       1950,       1950,       23,      260, 0xf9636d69
-1,       1973,       1973,       23,      260, 0x622b5ad9
-1,       1996,       1996,       23,      260, 0x175b646d
-0,       1999,       1999,        0,     6961, 0xf064095d
-1,       2020,       2020,       23,      260, 0x722b5827
-1,       2043,       2043,       23,      260, 0x83614974
-1,       2066,       2066,       23,      260, 0x80366587
-1,       2089,       2089,       23,      260, 0x050f6bf9
-0,       2111,       2111,        0,     7089, 0x5ba350f9
-1,       2113,       2113,       23,      260, 0x949d6735
-1,       2136,       2136,       23,      260, 0x62cd7184
-1,       2159,       2159,       23,      260, 0x21e45713
-1,       2182,       2182,       23,      260, 0x56314509
-1,       2205,       2205,       23,      260, 0x7a1570d3
-0,       2222,       2222,        0,     7078, 0xa83f3e88
-1,       2229,       2229,       23,      260, 0x205a6ffb
-1,       2252,       2252,       23,      260, 0xead94483
-1,       2275,       2275,       23,      260, 0x93c84f10
-1,       2298,       2298,       23,      260, 0xdf45726f
-1,       2321,       2321,       23,      260, 0x35016f1e
-0,       2333,       2333,        0,     7147, 0xcda66cfc
-1,       2345,       2345,       23,      260, 0xa8114bcd
-1,       2368,       2368,       23,      260, 0x14c45130
-1,       2391,       2391,       23,      260, 0x97b07052
-1,       2414,       2414,       23,      260, 0x039b6c77
-1,       2438,       2438,       23,      260, 0x46f74635
-0,       2444,       2444,        0,     7173, 0xb7455859
-1,       2461,       2461,       23,      260, 0x4116540d
-1,       2484,       2484,       23,      260, 0x26747067
-1,       2507,       2507,       23,      260, 0x37f16485
-1,       2530,       2530,       23,      260, 0x631d4a33
-1,       2554,       2554,       23,      260, 0x14ed598d
-0,       2555,       2555,        0,     7213, 0x97b89994
-1,       2577,       2577,       23,      260, 0x3f9349e7
-1,       2600,       2600,       23,      260, 0x91295757
-1,       2623,       2623,       23,      260, 0x95de72bc
-1,       2647,       2647,       23,      260, 0xc7ee5ddb
-0,       2666,       2666,        0,     7170, 0xca8b2948
-1,       2670,       2670,       23,      260, 0x38e965cd
-1,       2693,       2693,       23,      260, 0xfae169e9
-1,       2716,       2716,       23,      260, 0x9c226143
-1,       2739,       2739,       23,      260, 0x1a804dbe
-1,       2763,       2763,       23,      260, 0x4aeb633c
-0,       2777,       2777,        0,     7174, 0xc7cc6bbb
-1,       2786,       2786,       23,      260, 0xa66e6bbb
-1,       2809,       2809,       23,      260, 0x51d17109
-1,       2832,       2832,       23,      260, 0x2bc86b9b
-1,       2856,       2856,       23,      260, 0xe56e6378
-1,       2879,       2879,       23,      260, 0x95665b47
-0,       2888,       2888,        0,     7235, 0xc2e68d2b
-1,       2902,       2902,       23,      260, 0x1c255fdb
-1,       2925,       2925,       23,      260, 0x3a2456cb
-1,       2948,       2948,       23,      260, 0xe18e7270
-1,       2972,       2972,       23,      260, 0x55b65c60
-1,       2995,       2995,       23,      260, 0x62be6515
-0,       3000,       3000,        0,     7261, 0x8204a423
-1,       3018,       3018,       23,      260, 0xdba25d09
-1,       3041,       3041,       23,      260, 0xd7cc4e40
-1,       3065,       3065,       23,      260, 0x335661be
-1,       3088,       3088,       23,      260, 0xc3286de3
-0,       3111,       3111,        0,     7353, 0xacc7e7c0
-1,       3111,       3111,       23,      260, 0x47e76e35
-1,       3134,       3134,       23,      260, 0x4b716f77
-1,       3157,       3157,       23,      260, 0x0716519e
-1,       3181,       3181,       23,      260, 0x032b4490
-1,       3204,       3204,       23,      260, 0x15f067e8
-0,       3222,       3222,        0,     7065, 0x45035c5c
-1,       3227,       3227,       23,      260, 0x16766ffa
-1,       3250,       3250,       23,      260, 0xc94154ac
-1,       3274,       3274,       23,      260, 0x74764bcd
-1,       3297,       3297,       23,      260, 0x3fad6f8f
-1,       3320,       3320,       23,      260, 0x5fa972a9
-0,       3333,       3333,        0,     7269, 0x72edbb76
-1,       3343,       3343,       23,      260, 0xde2a4b7b
-1,       3366,       3366,       23,      260, 0xd8494408
-1,       3390,       3390,       23,      260, 0x843d71a6
-1,       3413,       3413,       23,      260, 0x87fd6b60
-1,       3436,       3436,       23,      260, 0x1cc04a39
-0,       3444,       3444,        0,     7220, 0xb926772f
-1,       3459,       3459,       23,      260, 0x9ca24d94
-1,       3482,       3482,       23,      260, 0x820a7087
-1,       3506,       3506,       23,      260, 0x631166b2
-1,       3529,       3529,       23,      260, 0x2f20492a
-1,       3552,       3552,       23,      260, 0x932156d0
-0,       3555,       3555,        0,     7326, 0x0a66c632
-1,       3575,       3575,       23,      260, 0xdad54c90
-1,       3599,       3599,       23,      260, 0xcce84fc9
-1,       3622,       3622,       23,      260, 0xba317486
-1,       3645,       3645,       23,      260, 0xf5a4626a
-0,       3666,       3666,        0,     7225, 0xe39076ab
-1,       3668,       3668,       23,      260, 0x324669fd
-1,       3691,       3691,       23,      260, 0xc7d37113
-1,       3715,       3715,       23,      260, 0xc6e0644f
-1,       3738,       3738,       23,      260, 0x1b91522e
-1,       3761,       3761,       23,      260, 0x9b84667d
-0,       3777,       3777,        0,     7265, 0xe0209036
-1,       3784,       3784,       23,      260, 0xed7e66eb
-1,       3808,       3808,       23,      260, 0xaf806d1f
-1,       3831,       3831,       23,      260, 0x13a66941
-1,       3854,       3854,       23,      260, 0x13095a41
-1,       3877,       3877,       23,      260, 0x5ba05491
-0,       3888,       3888,        0,     7337, 0x7a5dc093
-1,       3900,       3900,       23,      260, 0xbf785887
-1,       3924,       3924,       23,      260, 0x21965973
-1,       3947,       3947,       23,      260, 0xd9aa7134
-1,       3970,       3970,       23,      260, 0x3add62bc
-1,       3993,       3993,       23,      260, 0xb9626260
-0,       4000,       4000,        0,     7246, 0x519a7a3c
-1,       4017,       4017,       23,      260, 0x5b08629f
-1,       4040,       4040,       23,      260, 0x43a34659
-1,       4063,       4063,       23,      260, 0x68575bda
-1,       4086,       4086,       23,      260, 0xd98b715a
-1,       4109,       4109,       23,      260, 0x7d816a77
-0,       4111,       4111,        0,     7266, 0x352c8078
-1,       4133,       4133,       23,      260, 0x16af6ff1
-1,       4156,       4156,       23,      260, 0x6d4557a7
-1,       4179,       4179,       23,      260, 0x0743401a
-1,       4202,       4202,       23,      260, 0x410563d8
-0,       4222,       4222,        0,     7323, 0xcaf69d7c
-1,       4226,       4226,       23,      260, 0x561371d1
-1,       4249,       4249,       23,      260, 0x3ef15872
-1,       4272,       4272,       23,      260, 0x1dd04972
-1,       4295,       4295,       23,      260, 0xed226c62
-1,       4318,       4318,       23,      260, 0x20857046
-0,       4333,       4333,        0,     7309, 0x98c1e6f7
-1,       4342,       4342,       23,      260, 0xed7f4724
-1,       4365,       4365,       23,      260, 0x7a7445cf
-1,       4388,       4388,       23,      260, 0x06ad6a93
-1,       4411,       4411,       23,      260, 0xdd1b6c91
-1,       4435,       4435,       23,      260, 0x05b94d27
-0,       4444,       4444,      111,     7121, 0x913d5bd6
-1,       4458,       4458,       23,      260, 0x12cc5062
-1,       4481,       4481,       23,      260, 0x44526d0f
-1,       4504,       4504,       23,      260, 0xf2ac6d95
-1,       4527,       4527,       23,      260, 0x27174b0f
-1,       4551,       4551,       23,      260, 0xcf125efe
-0,       4555,       4555,      111,     7088, 0x56302362
-1,       4574,       4574,       23,      260, 0xb8ce45a1
-1,       4597,       4597,       23,      260, 0x91895627
-1,       4620,       4620,       23,      260, 0x6edb706a
-1,       4643,       4643,       23,      260, 0x4e16674b
-0,       4666,       4666,      111,     7104, 0xc0d14f78
-1,       4667,       4667,       23,      260, 0xa9d66370
-1,       4690,       4690,       23,      260, 0x8f007043
-1,       4713,       4713,       23,      260, 0xdc1a5583
-1,       4736,       4736,       23,      260, 0x2f025511
-1,       4760,       4760,       23,      260, 0x2a4d6ddb
-0,       4777,       4777,      111,     7169, 0xd03c825b
-1,       4783,       4783,       23,      260, 0x54806f14
-1,       4806,       4806,       23,      260, 0xe0ac6d80
-1,       4829,       4829,       23,      260, 0xd9cf6c97
-1,       4852,       4852,       23,      260, 0xba705b6d
-1,       4876,       4876,       23,      260, 0x0be158e0
-0,       4888,       4888,      111,     7038, 0x1ecc201d
-1,       4899,       4899,       23,      260, 0x32b3645d
-1,       4922,       4922,       23,      260, 0x4a0a55b4
-1,       4945,       4945,       23,      260, 0x078b6fd8
-1,       4969,       4969,       23,      260, 0xc2816368
-1,       4992,       4992,       23,      260, 0xbdee5e4d
-0,       5000,       5000,      111,     7015, 0x83c94454
-1,       5015,       5015,       23,      260, 0x475366aa
-1,       5038,       5038,       23,      260, 0x2f9a44b9
-1,       5061,       5061,       23,      260, 0x91745ee5
-1,       5085,       5085,       23,      260, 0xc29b6e16
-1,       5108,       5108,       23,      260, 0x6ebb6b0e
-0,       5111,       5111,      111,     6983, 0x9e51f54d
-1,       5131,       5131,       23,      260, 0x4e7d7043
-1,       5154,       5154,       23,      260, 0x10b45caf
-1,       5178,       5178,       23,      260, 0x1b1e4e54
-1,       5201,       5201,       23,      260, 0xcc7b6443
-0,       5222,       5222,      111,     7088, 0x70d33de1
-1,       5224,       5224,       23,      260, 0x29936fdd
-1,       5247,       5247,       23,      260, 0x395256e3
-1,       5270,       5270,       23,      260, 0x50fb459f
-1,       5294,       5294,       23,      260, 0x0bef64ec
-1,       5317,       5317,       23,      260, 0xadd372dd
-0,       5333,       5333,      111,     7096, 0x4d0f81b5
-1,       5340,       5340,       23,      260, 0xc49e56dc
-1,       5363,       5363,       23,      260, 0x44e749c1
-1,       5387,       5387,       23,      260, 0x030e6c8a
-1,       5410,       5410,       23,      260, 0x82a47261
-1,       5433,       5433,       23,      260, 0xa3764fcc
-0,       5444,       5444,      111,     7106, 0xd1a83ddc
-1,       5456,       5456,       23,      260, 0xb1a1498a
-1,       5479,       5479,       23,      260, 0xbf9c7184
-1,       5503,       5503,       23,      260, 0xa45f6da8
-1,       5526,       5526,       23,      260, 0x9a2e4d51
-1,       5549,       5549,       23,      260, 0xa15c56ed
-0,       5555,       5555,      111,     7219, 0x20f47fe4
-1,       5572,       5572,       23,      260, 0x7029496c
-1,       5596,       5596,       23,      260, 0xf3595213
-1,       5619,       5619,       23,      260, 0x0dab6c5a
-1,       5642,       5642,       23,      260, 0x0e2367da
-1,       5665,       5665,       23,      260, 0xbb56610a
-0,       5666,       5666,      111,     7184, 0x45dc6a0e
-1,       5688,       5688,       23,      260, 0xcc916c92
-1,       5712,       5712,       23,      260, 0x886c5ba9
-1,       5735,       5735,       23,      260, 0x1b255a69
-1,       5758,       5758,       23,      260, 0xb7a66792
-0,       5777,       5777,      111,     7222, 0x488c6499
-1,       5781,       5781,       23,      260, 0x7d946b0e
-1,       5804,       5804,       23,      260, 0x07d16714
-1,       5828,       5828,       23,      260, 0x77ef6755
-1,       5851,       5851,       23,      260, 0xb2fe6849
-1,       5874,       5874,       23,      260, 0x601b5325
-0,       5888,       5888,      111,     7254, 0xbd097ba7
-1,       5897,       5897,       23,      260, 0x309c68d0
-1,       5921,       5921,       23,      260, 0x7bbe5d49
-1,       5944,       5944,       23,      260, 0x77bc6e47
-1,       5967,       5967,       23,      260, 0x3e0a6b0b
-1,       5990,       5990,       23,      260, 0x2ae458c4
-0,       6000,       6000,      111,     7189, 0x46e06d43
-1,       6013,       6013,       23,      260, 0x17576d4f
-1,       6037,       6037,       23,      260, 0x496c4bbd
-1,       6060,       6060,       23,      260, 0x972758a0
-1,       6083,       6083,       23,      260, 0xa9897452
-1,       6106,       6106,       23,      260, 0xf58c6b92
-0,       6111,       6111,      111,     7283, 0x19dd7319
-1,       6130,       6130,       23,      260, 0x8368709a
-1,       6153,       6153,       23,      260, 0x3890643f
-1,       6176,       6176,       23,      260, 0xdcc1472c
-1,       6199,       6199,       23,      260, 0xb601605c
-0,       6222,       6222,      111,     7161, 0x23171d02
-1,       6222,       6222,       23,      260, 0xfafd6e13
-1,       6246,       6246,       23,      260, 0x20a55dbf
-1,       6269,       6269,       23,      260, 0x84a147e6
-1,       6292,       6292,       23,      260, 0xe2c75bfd
-1,       6315,       6315,       23,      260, 0x52f672c4
-0,       6333,       6333,      111,     6976, 0xcc610c26
-1,       6339,       6339,       23,      260, 0x98af579a
-1,       6362,       6362,       23,      260, 0xf2034f37
-1,       6385,       6385,       23,      260, 0x75576856
-1,       6408,       6408,       23,      260, 0x4a796f1b
-1,       6431,       6431,       23,      260, 0x3a7a5612
-0,       6444,       6444,      111,     7056, 0x6cd917b0
-1,       6455,       6455,       23,      260, 0x1c0646bd
-1,       6478,       6478,       23,      260, 0xfccd6e2c
-1,       6501,       6501,       23,      260, 0x2bdd7139
-1,       6524,       6524,       23,      260, 0xadb4519a
-1,       6548,       6548,       23,      260, 0x8ef655b5
-0,       6555,       6555,      111,     6736, 0x02b78951
-1,       6571,       6571,       23,      260, 0x157852f6
-1,       6594,       6594,       23,      260, 0xec3a4aa8
-1,       6617,       6617,       23,      260, 0x5fa77041
-1,       6640,       6640,       23,      260, 0xe862690f
-1,       6664,       6664,       23,      260, 0xad1759ce
-0,       6666,       6666,      111,     6540, 0x767e0854
-1,       6687,       6687,       23,      260, 0x856f6d2e
-1,       6710,       6710,       23,      260, 0x19496938
-1,       6733,       6733,       23,      260, 0xf3135c06
-1,       6757,       6757,       23,      260, 0xbec861ab
-0,       6777,       6777,      111,     6170, 0xc84962fb
-1,       6780,       6780,       23,      260, 0x97486f09
-1,       6803,       6803,       23,      260, 0x2dcb64ed
-1,       6826,       6826,       23,      260, 0xac196fe8
-1,       6849,       6849,       23,      260, 0xa7d460f8
-1,       6873,       6873,       23,      260, 0x02e55631
-0,       6888,       6888,      111,     6169, 0x27e06c03
-1,       6896,       6896,       23,      260, 0x92556737
-1,       6919,       6919,       23,      260, 0x9ab25599
-1,       6942,       6942,       23,      260, 0x48017498
-1,       6965,       6965,       23,      260, 0x3f376d65
-1,       6989,       6989,       23,      260, 0x553750e2
-0,       7000,       7000,      111,     5864, 0xd14db83f
-1,       7012,       7012,       23,      260, 0x430a6cb9
-1,       7035,       7035,       23,      260, 0x0d4f3b7e
-1,       7058,       7058,       23,      260, 0xc5ee5733
-1,       7082,       7082,       23,      260, 0xec33744f
-1,       7105,       7105,       23,      260, 0xb7ca6c50
-0,       7111,       7111,      111,     5375, 0x4a21055d
-1,       7128,       7128,       23,      260, 0xca8e6e09
-1,       7151,       7151,       23,      260, 0xde7b67d9
-1,       7174,       7174,       23,      260, 0x1eeb47c6
-1,       7198,       7198,       23,      260, 0x97e355f6
-1,       7221,       7221,       23,      260, 0x4cb871da
-0,       7222,       7222,      111,     5206, 0x95ead3cb
-1,       7244,       7244,       23,      260, 0xf9d65f42
-1,       7267,       7267,       23,      260, 0x4df447f9
-1,       7291,       7291,       23,      260, 0x6da55c39
-1,       7314,       7314,       23,      260, 0xf8487192
-0,       7333,       7333,      111,     5220, 0xcfdcc37e
-1,       7337,       7337,       23,      260, 0xa5ef5e84
-1,       7360,       7360,       23,      260, 0xc750404d
-1,       7383,       7383,       23,      260, 0xe62d5ba7
-1,       7407,       7407,       23,      260, 0xa362739c
-1,       7430,       7430,       23,      260, 0x784c57f9
-0,       7444,       7444,      111,     4946, 0x2d864a77
-1,       7453,       7453,       23,      260, 0xac224b6f
-1,       7476,       7476,       23,      260, 0x34506907
-1,       7500,       7500,       23,      260, 0x94207121
-1,       7523,       7523,       23,      260, 0x018754e6
-1,       7546,       7546,       23,      260, 0xa5355133
-0,       7555,       7555,      111,     4390, 0x2ab9f462
-1,       7569,       7569,       23,      260, 0x93724dac
-1,       7592,       7592,       23,      260, 0x41e24c4c
-1,       7616,       7616,       23,      260, 0x1b2a7301
-1,       7639,       7639,       23,      260, 0xcce36e61
-1,       7662,       7662,       23,      260, 0xb323585a
-0,       7666,       7666,      111,     4051, 0x1d09592e
-1,       7685,       7685,       23,      260, 0x6f7c624d
-1,       7709,       7709,       23,      260, 0x87b96a4a
-1,       7732,       7732,       23,      260, 0xf567622a
-1,       7755,       7755,       23,      260, 0x52ce5d35
-0,       7777,       7777,      111,     3680, 0x39bd6a12
-1,       7778,       7778,       23,      260, 0x58a46c28
-1,       7801,       7801,       23,      260, 0x8e3e6d9a
-1,       7825,       7825,       23,      260, 0x5ef66906
-1,       7848,       7848,       23,      260, 0x351b5f9f
-1,       7871,       7871,       23,      260, 0x90b9588a
-0,       7888,       7888,      111,     2910, 0x6337ece9
-1,       7894,       7894,       23,      260, 0x34e8615f
-1,       7918,       7918,       23,      260, 0xcef75ab9
-1,       7941,       7941,       23,      260, 0x471f6bc8
-1,       7964,       7964,       23,      260, 0xd4756c62
-1,       7987,       7987,       23,      260, 0x7c554702
-0,       8000,       8000,      111,     2153, 0xf4e3bc17
-1,       8010,       8010,       23,      260, 0x185272f1
-1,       8034,       8034,       23,      260, 0x0c364348
-1,       8057,       8057,       23,      260, 0x24354467
-1,       8080,       8080,       23,      260, 0x837d5472
-1,       8103,       8103,       23,      260, 0xece2344f
diff --git a/deps/libav/tests/ref/fate/sp5x b/deps/libav/tests/ref/fate/sp5x
deleted file mode 100644
index 986c111..0000000
--- a/deps/libav/tests/ref/fate/sp5x
+++ /dev/null
@@ -1,21 +0,0 @@
-#tb 0: 513/5000
-#tb 1: 1/8000
-0,          0,          0,        1,   115200, 0x8ebcb7f8
-1,          0,          0,     1024,     2048, 0x366ee71c
-0,          1,          1,        1,   115200, 0x1fa8e673
-1,       1024,       1024,     1024,     2048, 0xc62f0414
-0,          2,          2,        1,   115200, 0xec07fb6a
-1,       2048,       2048,     1024,     2048, 0x754e0f19
-0,          3,          3,        1,   115200, 0x6773a8c3
-1,       3072,       3072,     1024,     2048, 0x4a44152a
-0,          4,          4,        1,   115200, 0x0d279643
-1,       4096,       4096,     1024,     2048, 0x4fd3ff01
-0,          5,          5,        1,   115200, 0xb33796e4
-0,          6,          6,        1,   115200, 0xfe11fc79
-1,       5120,       5120,     1024,     2048, 0x11c3fa1b
-0,          7,          7,        1,   115200, 0x4ac8e31b
-1,       6144,       6144,     1024,     2048, 0x9945fa06
-0,          8,          8,        1,   115200, 0x15317942
-1,       7168,       7168,     1024,     2048, 0x12e5071a
-0,          9,          9,        1,   115200, 0x07803f0e
-1,       8192,       8192,       22,       44, 0x7ad110e8
diff --git a/deps/libav/tests/ref/fate/srtp b/deps/libav/tests/ref/fate/srtp
deleted file mode 100644
index 687a59f..0000000
--- a/deps/libav/tests/ref/fate/srtp
+++ /dev/null
@@ -1,12 +0,0 @@
-80e0123412345678123456780102030405
-Decrypted content matches input
-Decrypted content matches input
-Decrypted content matches input
-81c90007123456788765432100000000000012340000069ec73069ba000001fd
-Decrypted content matches input
-Decrypted content matches input
-Decrypted content matches input
-80e0123412345678123456780102030405
-81c90007123456788765432100000000000012340000069ec73069ba000001fd
-80e0123412345678123456780102030405
-81c90007123456788765432100000000000012340000069ec73069ba000001fd
diff --git a/deps/libav/tests/ref/fate/sub-srt b/deps/libav/tests/ref/fate/sub-srt
deleted file mode 100644
index 5a14664..0000000
--- a/deps/libav/tests/ref/fate/sub-srt
+++ /dev/null
@@ -1 +0,0 @@
-03b2a3f7e7e83624c8e4d1b5569df758
diff --git a/deps/libav/tests/ref/fate/sunraster-1bit-raw b/deps/libav/tests/ref/fate/sunraster-1bit-raw
deleted file mode 100644
index 123e245..0000000
--- a/deps/libav/tests/ref/fate/sunraster-1bit-raw
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    32768, 0x6d16e246
diff --git a/deps/libav/tests/ref/fate/sunraster-1bit-rle b/deps/libav/tests/ref/fate/sunraster-1bit-rle
deleted file mode 100644
index 123e245..0000000
--- a/deps/libav/tests/ref/fate/sunraster-1bit-rle
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    32768, 0x6d16e246
diff --git a/deps/libav/tests/ref/fate/sunraster-24bit-raw b/deps/libav/tests/ref/fate/sunraster-24bit-raw
deleted file mode 100644
index fa059ef..0000000
--- a/deps/libav/tests/ref/fate/sunraster-24bit-raw
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   786432, 0xb4d417bf
diff --git a/deps/libav/tests/ref/fate/sunraster-24bit-rle b/deps/libav/tests/ref/fate/sunraster-24bit-rle
deleted file mode 100644
index fa059ef..0000000
--- a/deps/libav/tests/ref/fate/sunraster-24bit-rle
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   786432, 0xb4d417bf
diff --git a/deps/libav/tests/ref/fate/sunraster-8bit-raw b/deps/libav/tests/ref/fate/sunraster-8bit-raw
deleted file mode 100644
index 659b433..0000000
--- a/deps/libav/tests/ref/fate/sunraster-8bit-raw
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   786432, 0xf4364008
diff --git a/deps/libav/tests/ref/fate/sunraster-8bit-rle b/deps/libav/tests/ref/fate/sunraster-8bit-rle
deleted file mode 100644
index 659b433..0000000
--- a/deps/libav/tests/ref/fate/sunraster-8bit-rle
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   786432, 0xf4364008
diff --git a/deps/libav/tests/ref/fate/sunraster-8bit_gray-raw b/deps/libav/tests/ref/fate/sunraster-8bit_gray-raw
deleted file mode 100644
index 455af5f..0000000
--- a/deps/libav/tests/ref/fate/sunraster-8bit_gray-raw
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   786432, 0x5859b48e
diff --git a/deps/libav/tests/ref/fate/svq1 b/deps/libav/tests/ref/fate/svq1
deleted file mode 100644
index 3b26d1f..0000000
--- a/deps/libav/tests/ref/fate/svq1
+++ /dev/null
@@ -1,151 +0,0 @@
-#tb 0: 1/600
-0,          0,          0,        1,    21600, 0x7f9389e3
-0,         40,         40,        1,    21600, 0xcebb8896
-0,         80,         80,        1,    21600, 0xef51860a
-0,        120,        120,        1,    21600, 0x88d97e7d
-0,        160,        160,        1,    21600, 0xc7757c88
-0,        200,        200,        1,    21600, 0x2f537ade
-0,        240,        240,        1,    21600, 0xd50a7eff
-0,        280,        280,        1,    21600, 0xdcfb7fc6
-0,        320,        320,        1,    21600, 0x0d608299
-0,        360,        360,        1,    21600, 0x97ca81b4
-0,        400,        400,        1,    21600, 0x791f80e7
-0,        440,        440,        1,    21600, 0x96ae7d33
-0,        480,        480,        1,    21600, 0x4d7474a8
-0,        520,        520,        1,    21600, 0x2ae76f37
-0,        560,        560,        1,    21600, 0x7da76265
-0,        600,        600,        1,    21600, 0x93ae3eb6
-0,        640,        640,        1,    21600, 0xebfd3868
-0,        680,        680,        1,    21600, 0x54f82ffa
-0,        720,        720,        1,    21600, 0x8d5b2ad0
-0,        760,        760,        1,    21600, 0xe67128e6
-0,        800,        800,        1,    21600, 0xb7bf613e
-0,        840,        840,        1,    21600, 0xefd0f51b
-0,        880,        880,        1,    21600, 0x31b7da59
-0,        920,        920,        1,    21600, 0x7a84a8f7
-0,        960,        960,        1,    21600, 0x0351ad27
-0,       1000,       1000,        1,    21600, 0xed6f434d
-0,       1040,       1040,        1,    21600, 0x0e771127
-0,       1080,       1080,        1,    21600, 0x37bf0b95
-0,       1120,       1120,        1,    21600, 0x30e10a77
-0,       1160,       1160,        1,    21600, 0x1a48288a
-0,       1200,       1200,        1,    21600, 0xf43c6770
-0,       1240,       1240,        1,    21600, 0x3c43ae68
-0,       1280,       1280,        1,    21600, 0x04dc0949
-0,       1320,       1320,        1,    21600, 0x7920758d
-0,       1360,       1360,        1,    21600, 0x6c12bab5
-0,       1400,       1400,        1,    21600, 0x1ac23706
-0,       1440,       1440,        1,    21600, 0x7a95cb5f
-0,       1480,       1480,        1,    21600, 0xf1bfbb46
-0,       1520,       1520,        1,    21600, 0x773d1d0c
-0,       1560,       1560,        1,    21600, 0x2e7bea65
-0,       1600,       1600,        1,    21600, 0xdb1a086f
-0,       1640,       1640,        1,    21600, 0x5b36b78d
-0,       1680,       1680,        1,    21600, 0x7b533ca6
-0,       1720,       1720,        1,    21600, 0x65d75105
-0,       1760,       1760,        1,    21600, 0xfe6f6207
-0,       1800,       1800,        1,    21600, 0x44c4ce57
-0,       1840,       1840,        1,    21600, 0x220f3dae
-0,       1880,       1880,        1,    21600, 0xb4d20ffb
-0,       1920,       1920,        1,    21600, 0x8907ad72
-0,       1960,       1960,        1,    21600, 0xc6418998
-0,       2000,       2000,        1,    21600, 0x395b6670
-0,       2040,       2040,        1,    21600, 0x83495b88
-0,       2080,       2080,        1,    21600, 0x8920d683
-0,       2120,       2120,        1,    21600, 0xd7fc64ea
-0,       2160,       2160,        1,    21600, 0x21a3b222
-0,       2200,       2200,        1,    21600, 0xc11f2dbd
-0,       2240,       2240,        1,    21600, 0xd1d5495d
-0,       2280,       2280,        1,    21600, 0x70f2de20
-0,       2320,       2320,        1,    21600, 0x10adc9a9
-0,       2360,       2360,        1,    21600, 0xf713c0ec
-0,       2400,       2400,        1,    21600, 0xa346b3fe
-0,       2440,       2440,        1,    21600, 0x7945c29b
-0,       2480,       2480,        1,    21600, 0xb07ceb91
-0,       2520,       2520,        1,    21600, 0xe1eaf9ef
-0,       2560,       2560,        1,    21600, 0x6fa915c7
-0,       2600,       2600,        1,    21600, 0x61952055
-0,       2640,       2640,        1,    21600, 0x4bca2382
-0,       2680,       2680,        1,    21600, 0x36161fe2
-0,       2720,       2720,        1,    21600, 0xf93a28f7
-0,       2760,       2760,        1,    21600, 0xa02a3d47
-0,       2800,       2800,        1,    21600, 0x925b3609
-0,       2840,       2840,        1,    21600, 0x5b6941db
-0,       2880,       2880,        1,    21600, 0x33154a91
-0,       2920,       2920,        1,    21600, 0xb1d75c50
-0,       2960,       2960,        1,    21600, 0x1cb369bd
-0,       3000,       3000,        1,    21600, 0x3be4eff2
-0,       3040,       3040,        1,    21600, 0xbb89c301
-0,       3080,       3080,        1,    21600, 0xc7630d85
-0,       3120,       3120,        1,    21600, 0xf7441c67
-0,       3160,       3160,        1,    21600, 0xc23611ef
-0,       3200,       3200,        1,    21600, 0x840efb21
-0,       3240,       3240,        1,    21600, 0x7d470a0f
-0,       3280,       3280,        1,    21600, 0xfe093210
-0,       3320,       3320,        1,    21600, 0x0f3ea098
-0,       3360,       3360,        1,    21600, 0xcd72286f
-0,       3400,       3400,        1,    21600, 0x826f8030
-0,       3440,       3440,        1,    21600, 0xcda3ace8
-0,       3480,       3480,        1,    21600, 0x39cb4cd0
-0,       3520,       3520,        1,    21600, 0xa86a60ac
-0,       3560,       3560,        1,    21600, 0xcd32ed8e
-0,       3600,       3600,        1,    21600, 0x769b285d
-0,       3640,       3640,        1,    21600, 0x10234cd0
-0,       3680,       3680,        1,    21600, 0x951036b8
-0,       3720,       3720,        1,    21600, 0xaef248fa
-0,       3760,       3760,        1,    21600, 0x74e36e84
-0,       3800,       3800,        1,    21600, 0x3908531b
-0,       3840,       3840,        1,    21600, 0x342f2a9d
-0,       3880,       3880,        1,    21600, 0x291d58f3
-0,       3920,       3920,        1,    21600, 0xcf24b1e5
-0,       3960,       3960,        1,    21600, 0x3e7c7959
-0,       4000,       4000,        1,    21600, 0x6517e573
-0,       4040,       4040,        1,    21600, 0x304cc6db
-0,       4080,       4080,        1,    21600, 0x272895e4
-0,       4120,       4120,        1,    21600, 0x52325837
-0,       4160,       4160,        1,    21600, 0xd01344bd
-0,       4200,       4200,        1,    21600, 0xd25a370b
-0,       4240,       4240,        1,    21600, 0x274e0ae9
-0,       4280,       4280,        1,    21600, 0x6f66138f
-0,       4320,       4320,        1,    21600, 0xd35a0f60
-0,       4360,       4360,        1,    21600, 0xe0610863
-0,       4400,       4400,        1,    21600, 0x920b05fb
-0,       4440,       4440,        1,    21600, 0x5befe39d
-0,       4480,       4480,        1,    21600, 0xd167bd58
-0,       4520,       4520,        1,    21600, 0x653ac504
-0,       4560,       4560,        1,    21600, 0x8372c6d7
-0,       4600,       4600,        1,    21600, 0x0302c276
-0,       4640,       4640,        1,    21600, 0xa176b694
-0,       4680,       4680,        1,    21600, 0x4c2e935a
-0,       4720,       4720,        1,    21600, 0xf7ea844e
-0,       4760,       4760,        1,    21600, 0x76d6c07b
-0,       4800,       4800,        1,    21600, 0x0a14d610
-0,       4840,       4840,        1,    21600, 0x0ec9f3f3
-0,       4880,       4880,        1,    21600, 0xdc90f6ea
-0,       4920,       4920,        1,    21600, 0xc841f9ef
-0,       4960,       4960,        1,    21600, 0x7ab5f9b9
-0,       5000,       5000,        1,    21600, 0xda40f3c2
-0,       5040,       5040,        1,    21600, 0x0040fb72
-0,       5080,       5080,        1,    21600, 0x705b0786
-0,       5120,       5120,        1,    21600, 0x26d5198d
-0,       5160,       5160,        1,    21600, 0x6f5153ad
-0,       5200,       5200,        1,    21600, 0x9f26624b
-0,       5240,       5240,        1,    21600, 0x0d3ea7af
-0,       5280,       5280,        1,    21600, 0xb957ca79
-0,       5320,       5320,        1,    21600, 0x03a60612
-0,       5360,       5360,        1,    21600, 0x3ddc4ff1
-0,       5400,       5400,        1,    21600, 0x8fe5697f
-0,       5440,       5440,        1,    21600, 0x3d199b09
-0,       5480,       5480,        1,    21600, 0x97e2b504
-0,       5520,       5520,        1,    21600, 0x7563f784
-0,       5560,       5560,        1,    21600, 0x9a473879
-0,       5600,       5600,        1,    21600, 0x2e2054e5
-0,       5640,       5640,        1,    21600, 0x06b3658b
-0,       5680,       5680,        1,    21600, 0xa37ee249
-0,       5720,       5720,        1,    21600, 0xa527efa1
-0,       5760,       5760,        1,    21600, 0x12791532
-0,       5800,       5800,        1,    21600, 0xc5350145
-0,       5840,       5840,        1,    21600, 0xcd44f1ac
-0,       5880,       5880,        1,    21600, 0xe610edfb
-0,       5920,       5920,        1,    21600, 0x5642f672
-0,       5960,       5960,        1,    21600, 0xf2bc3e5b
diff --git a/deps/libav/tests/ref/fate/svq3 b/deps/libav/tests/ref/fate/svq3
deleted file mode 100644
index 141300a..0000000
--- a/deps/libav/tests/ref/fate/svq3
+++ /dev/null
@@ -1,181 +0,0 @@
-#tb 0: 1/600
-0,          0,          0,        1,   115200, 0x2c810465
-0,         20,         20,        1,   115200, 0x010b5765
-0,         40,         40,        1,   115200, 0x2be11a4e
-0,         60,         60,        1,   115200, 0x99445d06
-0,         80,         80,        1,   115200, 0x6b54d83c
-0,        100,        100,        1,   115200, 0x3832b76a
-0,        120,        120,        1,   115200, 0x3832b76a
-0,        140,        140,        1,   115200, 0xe18385db
-0,        160,        160,        1,   115200, 0x847d4bf0
-0,        180,        180,        1,   115200, 0x0d650f50
-0,        200,        200,        1,   115200, 0x4b85c44c
-0,        220,        220,        1,   115200, 0xce1927a6
-0,        240,        240,        1,   115200, 0x89353747
-0,        260,        260,        1,   115200, 0x58da43f2
-0,        280,        280,        1,   115200, 0xee9a4eef
-0,        300,        300,        1,   115200, 0xce9453d9
-0,        320,        320,        1,   115200, 0x804a5eb0
-0,        340,        340,        1,   115200, 0xb3d46605
-0,        360,        360,        1,   115200, 0x45b5668e
-0,        380,        380,        1,   115200, 0xdd0d4c5a
-0,        400,        400,        1,   115200, 0x99101301
-0,        420,        420,        1,   115200, 0xf0c3f272
-0,        440,        440,        1,   115200, 0xea21f8b1
-0,        460,        460,        1,   115200, 0xd8e7fbb1
-0,        480,        480,        1,   115200, 0x89d90aa1
-0,        500,        500,        1,   115200, 0x882e19da
-0,        520,        520,        1,   115200, 0xfc0f2709
-0,        540,        540,        1,   115200, 0x9b732f3f
-0,        560,        560,        1,   115200, 0xec453cda
-0,        580,        580,        1,   115200, 0xa77e4989
-0,        600,        600,        1,   115200, 0xad935834
-0,        620,        620,        1,   115200, 0x3a5a6177
-0,        640,        640,        1,   115200, 0xd3c07999
-0,        660,        660,        1,   115200, 0xfad388dd
-0,        680,        680,        1,   115200, 0xaf6e9520
-0,        700,        700,        1,   115200, 0xdb64a4b3
-0,        720,        720,        1,   115200, 0xc6f9b49e
-0,        740,        740,        1,   115200, 0x4446c315
-0,        760,        760,        1,   115200, 0x660bd01c
-0,        780,        780,        1,   115200, 0x963fdd7d
-0,        800,        800,        1,   115200, 0x8733e7b3
-0,        820,        820,        1,   115200, 0x41aaf1d5
-0,        840,        840,        1,   115200, 0xa803fd81
-0,        860,        860,        1,   115200, 0xe2b4077f
-0,        880,        880,        1,   115200, 0xfe6707cb
-0,        900,        900,        1,   115200, 0x027c122d
-0,        920,        920,        1,   115200, 0xbcb81ea8
-0,        940,        940,        1,   115200, 0xd2ac2405
-0,        960,        960,        1,   115200, 0x3d893006
-0,        980,        980,        1,   115200, 0xbdcc3ba8
-0,       1000,       1000,        1,   115200, 0x83ed4c6b
-0,       1020,       1020,        1,   115200, 0x69ee5e7c
-0,       1040,       1040,        1,   115200, 0xfe317411
-0,       1060,       1060,        1,   115200, 0x849e84e6
-0,       1080,       1080,        1,   115200, 0x040f945f
-0,       1100,       1100,        1,   115200, 0x6481ac89
-0,       1120,       1120,        1,   115200, 0x8a48be9e
-0,       1140,       1140,        1,   115200, 0xb162ce94
-0,       1160,       1160,        1,   115200, 0x178dd69a
-0,       1180,       1180,        1,   115200, 0x64fdecaa
-0,       1200,       1200,        1,   115200, 0x4b51297e
-0,       1220,       1220,        1,   115200, 0x3d39a1ae
-0,       1240,       1240,        1,   115200, 0x900fd939
-0,       1260,       1260,        1,   115200, 0x7704fb19
-0,       1280,       1280,        1,   115200, 0xa426137e
-0,       1300,       1300,        1,   115200, 0x9a112706
-0,       1320,       1320,        1,   115200, 0x294931f7
-0,       1340,       1340,        1,   115200, 0x0d0e4372
-0,       1360,       1360,        1,   115200, 0x33bd50e4
-0,       1380,       1380,        1,   115200, 0x9c86e3e2
-0,       1400,       1400,        1,   115200, 0x714af5d5
-0,       1420,       1420,        1,   115200, 0xc5f9fcd0
-0,       1440,       1440,        1,   115200, 0x184602bb
-0,       1460,       1460,        1,   115200, 0x6958e9e6
-0,       1480,       1480,        1,   115200, 0x5a214952
-0,       1500,       1500,        1,   115200, 0x706cca0e
-0,       1520,       1520,        1,   115200, 0x67689363
-0,       1540,       1540,        1,   115200, 0x459f410c
-0,       1560,       1560,        1,   115200, 0xa8f4c365
-0,       1580,       1580,        1,   115200, 0xf1fc50c5
-0,       1600,       1600,        1,   115200, 0xc22af545
-0,       1620,       1620,        1,   115200, 0xd39802a2
-0,       1640,       1640,        1,   115200, 0xb76c04b6
-0,       1660,       1660,        1,   115200, 0x7a548db4
-0,       1680,       1680,        1,   115200, 0x79e56765
-0,       1700,       1700,        1,   115200, 0x3f273a17
-0,       1720,       1720,        1,   115200, 0xe04366db
-0,       1740,       1740,        1,   115200, 0x8e10939b
-0,       1760,       1760,        1,   115200, 0x49220ea2
-0,       1780,       1780,        1,   115200, 0x35361889
-0,       1800,       1800,        1,   115200, 0x9b20bdfa
-0,       1820,       1820,        1,   115200, 0x5d472eaf
-0,       1840,       1840,        1,   115200, 0xeda43081
-0,       1860,       1860,        1,   115200, 0x59bae8b4
-0,       1880,       1880,        1,   115200, 0xf126d6a4
-0,       1900,       1900,        1,   115200, 0x18106464
-0,       1920,       1920,        1,   115200, 0x85530c73
-0,       1940,       1940,        1,   115200, 0xcef32c78
-0,       1960,       1960,        1,   115200, 0xfd6233a0
-0,       1980,       1980,        1,   115200, 0xae9d6fc3
-0,       2000,       2000,        1,   115200, 0x3d0cce10
-0,       2020,       2020,        1,   115200, 0xfce5f124
-0,       2040,       2040,        1,   115200, 0x90b10802
-0,       2060,       2060,        1,   115200, 0xeea44201
-0,       2080,       2080,        1,   115200, 0x1cefb56d
-0,       2100,       2100,        1,   115200, 0xd6daa0b1
-0,       2120,       2120,        1,   115200, 0xd700cef4
-0,       2140,       2140,        1,   115200, 0x36dbf58f
-0,       2160,       2160,        1,   115200, 0xdb20d060
-0,       2180,       2180,        1,   115200, 0x5ca61fd5
-0,       2200,       2200,        1,   115200, 0x4f271361
-0,       2220,       2220,        1,   115200, 0xcaf03743
-0,       2240,       2240,        1,   115200, 0x520f351a
-0,       2260,       2260,        1,   115200, 0x40bc7b89
-0,       2280,       2280,        1,   115200, 0xd0af0b08
-0,       2300,       2300,        1,   115200, 0x6a45290c
-0,       2320,       2320,        1,   115200, 0x57210c14
-0,       2340,       2340,        1,   115200, 0xc1e233f9
-0,       2360,       2360,        1,   115200, 0x96fdfc54
-0,       2380,       2380,        1,   115200, 0x43a8359c
-0,       2400,       2400,        1,   115200, 0xd493bfde
-0,       2420,       2420,        1,   115200, 0xd5339d13
-0,       2440,       2440,        1,   115200, 0x7542baa0
-0,       2460,       2460,        1,   115200, 0x268d2cb9
-0,       2480,       2480,        1,   115200, 0xaf3888bb
-0,       2500,       2500,        1,   115200, 0xb82f520a
-0,       2520,       2520,        1,   115200, 0x0feb2981
-0,       2540,       2540,        1,   115200, 0x45314b58
-0,       2560,       2560,        1,   115200, 0xb26a193a
-0,       2580,       2580,        1,   115200, 0xdfdffc38
-0,       2600,       2600,        1,   115200, 0xec6a55f5
-0,       2620,       2620,        1,   115200, 0xf6e35716
-0,       2640,       2640,        1,   115200, 0x5ce8544e
-0,       2660,       2660,        1,   115200, 0x3e38ddce
-0,       2680,       2680,        1,   115200, 0x964a2006
-0,       2700,       2700,        1,   115200, 0xaba138d6
-0,       2720,       2720,        1,   115200, 0x2f46949c
-0,       2740,       2740,        1,   115200, 0xbdbdb587
-0,       2760,       2760,        1,   115200, 0x1bf11e1d
-0,       2780,       2780,        1,   115200, 0x2632f558
-0,       2800,       2800,        1,   115200, 0x0e58078b
-0,       2820,       2820,        1,   115200, 0x2ab2f9be
-0,       2840,       2840,        1,   115200, 0x9205f1d8
-0,       2860,       2860,        1,   115200, 0x6a4bd949
-0,       2880,       2880,        1,   115200, 0xedc1552f
-0,       2900,       2900,        1,   115200, 0x0a60974d
-0,       2920,       2920,        1,   115200, 0xe1a1400e
-0,       2940,       2940,        1,   115200, 0x45f06952
-0,       2960,       2960,        1,   115200, 0xc5163125
-0,       2980,       2980,        1,   115200, 0x151da156
-0,       3000,       3000,        1,   115200, 0x3f34b048
-0,       3020,       3020,        1,   115200, 0xcf7c1e5d
-0,       3040,       3040,        1,   115200, 0xed9c4e1c
-0,       3060,       3060,        1,   115200, 0x47e06453
-0,       3080,       3080,        1,   115200, 0xc8ce6f19
-0,       3100,       3100,        1,   115200, 0xac619619
-0,       3120,       3120,        1,   115200, 0x64711e2d
-0,       3140,       3140,        1,   115200, 0x1f502b52
-0,       3160,       3160,        1,   115200, 0x39592c9d
-0,       3180,       3180,        1,   115200, 0x7dffb901
-0,       3200,       3200,        1,   115200, 0xc75fa3ce
-0,       3220,       3220,        1,   115200, 0x625bc977
-0,       3240,       3240,        1,   115200, 0x15c7fda3
-0,       3260,       3260,        1,   115200, 0x6e5d35b5
-0,       3280,       3280,        1,   115200, 0xf847cf88
-0,       3300,       3300,        1,   115200, 0xc10867fe
-0,       3320,       3320,        1,   115200, 0xae07fbfc
-0,       3340,       3340,        1,   115200, 0xc1571542
-0,       3360,       3360,        1,   115200, 0x4c7d5602
-0,       3380,       3380,        1,   115200, 0xbe7045aa
-0,       3400,       3400,        1,   115200, 0xc8b4835b
-0,       3420,       3420,        1,   115200, 0xf9b7d427
-0,       3440,       3440,        1,   115200, 0x7fa7c112
-0,       3460,       3460,        1,   115200, 0xe0105feb
-0,       3480,       3480,        1,   115200, 0x70784740
-0,       3500,       3500,        1,   115200, 0xa6801ef5
-0,       3520,       3520,        1,   115200, 0x9cf35921
-0,       3540,       3540,        1,   115200, 0x4d956630
-0,       3560,       3560,        1,   115200, 0x717a25c1
-0,       3580,       3580,        1,   115200, 0x8f5e39de
diff --git a/deps/libav/tests/ref/fate/targa-conformance-CBW8 b/deps/libav/tests/ref/fate/targa-conformance-CBW8
deleted file mode 100644
index 60270d7..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-CBW8
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    16384, 0x267e21ef
diff --git a/deps/libav/tests/ref/fate/targa-conformance-CCM8 b/deps/libav/tests/ref/fate/targa-conformance-CCM8
deleted file mode 100644
index aad3bfc..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-CCM8
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    65536, 0xcf98bc29
diff --git a/deps/libav/tests/ref/fate/targa-conformance-CTC16 b/deps/libav/tests/ref/fate/targa-conformance-CTC16
deleted file mode 100644
index e848ff8..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-CTC16
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    32768, 0xa6b3d20d
diff --git a/deps/libav/tests/ref/fate/targa-conformance-CTC24 b/deps/libav/tests/ref/fate/targa-conformance-CTC24
deleted file mode 100644
index c95f406..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-CTC24
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    49152, 0xaca4bc29
diff --git a/deps/libav/tests/ref/fate/targa-conformance-CTC32 b/deps/libav/tests/ref/fate/targa-conformance-CTC32
deleted file mode 100644
index aad3bfc..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-CTC32
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    65536, 0xcf98bc29
diff --git a/deps/libav/tests/ref/fate/targa-conformance-UBW8 b/deps/libav/tests/ref/fate/targa-conformance-UBW8
deleted file mode 100644
index 60270d7..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-UBW8
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    16384, 0x267e21ef
diff --git a/deps/libav/tests/ref/fate/targa-conformance-UCM8 b/deps/libav/tests/ref/fate/targa-conformance-UCM8
deleted file mode 100644
index aad3bfc..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-UCM8
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    65536, 0xcf98bc29
diff --git a/deps/libav/tests/ref/fate/targa-conformance-UTC16 b/deps/libav/tests/ref/fate/targa-conformance-UTC16
deleted file mode 100644
index e848ff8..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-UTC16
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    32768, 0xa6b3d20d
diff --git a/deps/libav/tests/ref/fate/targa-conformance-UTC24 b/deps/libav/tests/ref/fate/targa-conformance-UTC24
deleted file mode 100644
index c95f406..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-UTC24
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    49152, 0xaca4bc29
diff --git a/deps/libav/tests/ref/fate/targa-conformance-UTC32 b/deps/libav/tests/ref/fate/targa-conformance-UTC32
deleted file mode 100644
index aad3bfc..0000000
--- a/deps/libav/tests/ref/fate/targa-conformance-UTC32
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    65536, 0xcf98bc29
diff --git a/deps/libav/tests/ref/fate/targa-top-to-bottom b/deps/libav/tests/ref/fate/targa-top-to-bottom
deleted file mode 100644
index 4d9577a..0000000
--- a/deps/libav/tests/ref/fate/targa-top-to-bottom
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   196608, 0xb29ec51a
diff --git a/deps/libav/tests/ref/fate/theora-coeff-level64 b/deps/libav/tests/ref/fate/theora-coeff-level64
deleted file mode 100644
index d6abb62..0000000
--- a/deps/libav/tests/ref/fate/theora-coeff-level64
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,  4617600, 0x4ba6df50
-0,         66,         66,        0,  4617600, 0x419fdeaf
-0,        132,        132,        0,  4617600, 0xeb2edced
-0,        198,        198,        0,  4617600, 0xa2bb3a1a
-0,        264,        264,        0,  4617600, 0x411cfb36
-0,        330,        330,        0,  4617600, 0xb2dc22ed
-0,        396,        396,        0,  4617600, 0x236d23b5
-0,        462,        462,        0,  4617600, 0x7fef275e
diff --git a/deps/libav/tests/ref/fate/thp b/deps/libav/tests/ref/fate/thp
deleted file mode 100644
index 52dd059..0000000
--- a/deps/libav/tests/ref/fate/thp
+++ /dev/null
@@ -1,73 +0,0 @@
-#tb 0: 524288/15712911
-0,          0,          0,        1,   291840, 0xbd7e0b22
-0,          1,          1,        1,   291840, 0xf6e12ca5
-0,          2,          2,        1,   291840, 0x528c7049
-0,          3,          3,        1,   291840, 0x93055de9
-0,          4,          4,        1,   291840, 0xf95a51c1
-0,          5,          5,        1,   291840, 0x6ad3a65a
-0,          6,          6,        1,   291840, 0x494684a7
-0,          7,          7,        1,   291840, 0x74c14eb1
-0,          8,          8,        1,   291840, 0x149fcb7e
-0,          9,          9,        1,   291840, 0x25649761
-0,         10,         10,        1,   291840, 0xbc3f9052
-0,         11,         11,        1,   291840, 0x080edfff
-0,         12,         12,        1,   291840, 0x6d7ad684
-0,         13,         13,        1,   291840, 0x6d53844d
-0,         14,         14,        1,   291840, 0xf7ad5385
-0,         15,         15,        1,   291840, 0x0241b56a
-0,         16,         16,        1,   291840, 0x120122c8
-0,         17,         17,        1,   291840, 0x31b0f32a
-0,         18,         18,        1,   291840, 0x14068b98
-0,         19,         19,        1,   291840, 0xeeec658b
-0,         20,         20,        1,   291840, 0x9376374c
-0,         21,         21,        1,   291840, 0x091e8c6e
-0,         22,         22,        1,   291840, 0x744ad07f
-0,         23,         23,        1,   291840, 0xf99c554e
-0,         24,         24,        1,   291840, 0xc84bd677
-0,         25,         25,        1,   291840, 0x3898d474
-0,         26,         26,        1,   291840, 0x1e2910c8
-0,         27,         27,        1,   291840, 0xb11f58bc
-0,         28,         28,        1,   291840, 0xf89170ee
-0,         29,         29,        1,   291840, 0x8f239dc3
-0,         30,         30,        1,   291840, 0x8538c76c
-0,         31,         31,        1,   291840, 0x162ee66f
-0,         32,         32,        1,   291840, 0x5f8708a5
-0,         33,         33,        1,   291840, 0x95802dfb
-0,         34,         34,        1,   291840, 0xc424630d
-0,         35,         35,        1,   291840, 0xfb8a8667
-0,         36,         36,        1,   291840, 0xbad79af5
-0,         37,         37,        1,   291840, 0xc733b325
-0,         38,         38,        1,   291840, 0x4bfbcd70
-0,         39,         39,        1,   291840, 0x502cd950
-0,         40,         40,        1,   291840, 0x8461ca2c
-0,         41,         41,        1,   291840, 0x00219b0d
-0,         42,         42,        1,   291840, 0xa4de45e1
-0,         43,         43,        1,   291840, 0xacd3f4df
-0,         44,         44,        1,   291840, 0x2203a369
-0,         45,         45,        1,   291840, 0x0a66effa
-0,         46,         46,        1,   291840, 0x7ac1fd91
-0,         47,         47,        1,   291840, 0x84970aa7
-0,         48,         48,        1,   291840, 0x569d145f
-0,         49,         49,        1,   291840, 0xe51efe1b
-0,         50,         50,        1,   291840, 0x38e2cd78
-0,         51,         51,        1,   291840, 0x93428ea2
-0,         52,         52,        1,   291840, 0x3d3f5b17
-0,         53,         53,        1,   291840, 0x9546127d
-0,         54,         54,        1,   291840, 0x4178be54
-0,         55,         55,        1,   291840, 0x0d0f8036
-0,         56,         56,        1,   291840, 0xc20557b9
-0,         57,         57,        1,   291840, 0x6d4b2d64
-0,         58,         58,        1,   291840, 0xa750125d
-0,         59,         59,        1,   291840, 0x04623ce3
-0,         60,         60,        1,   291840, 0xc7f2bbc7
-0,         61,         61,        1,   291840, 0x6e271336
-0,         62,         62,        1,   291840, 0xcfbd4246
-0,         63,         63,        1,   291840, 0xe1493be9
-0,         64,         64,        1,   291840, 0x6c731194
-0,         65,         65,        1,   291840, 0x0fc30cc2
-0,         66,         66,        1,   291840, 0x967427f3
-0,         67,         67,        1,   291840, 0x55ae3b00
-0,         68,         68,        1,   291840, 0xbe4f200c
-0,         69,         69,        1,   291840, 0xc515e443
-0,         70,         70,        1,   291840, 0xd738bd69
-0,         71,         71,        1,   291840, 0xa8e0ab69
diff --git a/deps/libav/tests/ref/fate/tiertex-seq b/deps/libav/tests/ref/fate/tiertex-seq
deleted file mode 100644
index 74407e7..0000000
--- a/deps/libav/tests/ref/fate/tiertex-seq
+++ /dev/null
@@ -1,100 +0,0 @@
-#tb 0: 1/25
-#tb 1: 1/22050
-1,          0,          0,      882,     1764, 0x00000000
-1,        882,        882,      882,     1764, 0x80a253d9
-0,          2,          2,        1,    98304, 0x2e5db4a4
-1,       1764,       1764,      882,     1764, 0x95a16721
-1,       2646,       2646,      882,     1764, 0x0f0d4cb6
-1,       3528,       3528,      882,     1764, 0x75026779
-1,       4410,       4410,      882,     1764, 0xb4356e37
-0,          6,          6,        1,    98304, 0xb20c19d0
-1,       5292,       5292,      882,     1764, 0xfafa64cb
-1,       6174,       6174,      882,     1764, 0xe8fd7970
-1,       7056,       7056,      882,     1764, 0x666879b7
-0,          9,          9,        1,    98304, 0x6b8538c0
-1,       7938,       7938,      882,     1764, 0xf2cd7770
-1,       8820,       8820,      882,     1764, 0x54317a1c
-1,       9702,       9702,      882,     1764, 0x9c396930
-1,      10584,      10584,      882,     1764, 0x87115ec4
-0,         13,         13,        1,    98304, 0x172207e3
-1,      11466,      11466,      882,     1764, 0x0c9b69b6
-1,      12348,      12348,      882,     1764, 0x8c3a758a
-1,      13230,      13230,      882,     1764, 0x605d776a
-0,         16,         16,        1,    98304, 0x63fb7dc1
-1,      14112,      14112,      882,     1764, 0x0556852d
-1,      14994,      14994,      882,     1764, 0x7d4363f8
-1,      15876,      15876,      882,     1764, 0xc5cd75d0
-1,      16758,      16758,      882,     1764, 0x3ff3646d
-0,         20,         20,        1,    98304, 0x37cf1601
-1,      17640,      17640,      882,     1764, 0x10136d25
-1,      18522,      18522,      882,     1764, 0xeb1a6cd0
-1,      19404,      19404,      882,     1764, 0xef937ed1
-1,      20286,      20286,      882,     1764, 0x2d2b6f79
-0,         24,         24,        1,    98304, 0x82941990
-1,      21168,      21168,      882,     1764, 0x6f457231
-1,      22050,      22050,      882,     1764, 0x56267c9d
-1,      22932,      22932,      882,     1764, 0xd49e79c8
-0,         27,         27,        1,    98304, 0xe0a5309e
-1,      23814,      23814,      882,     1764, 0xc726703d
-1,      24696,      24696,      882,     1764, 0x2abf8074
-1,      25578,      25578,      882,     1764, 0xb50c556d
-1,      26460,      26460,      882,     1764, 0xc1f2523c
-0,         31,         31,        1,    98304, 0x164cb67d
-1,      27342,      27342,      882,     1764, 0x850a6f93
-1,      28224,      28224,      882,     1764, 0x8da76c31
-1,      29106,      29106,      882,     1764, 0xfcccdf13
-0,         34,         34,        1,    98304, 0xed2189f8
-1,      29988,      29988,      882,     1764, 0x00000000
-1,      30870,      30870,      882,     1764, 0x00000000
-1,      31752,      31752,      882,     1764, 0x00000000
-1,      32634,      32634,      882,     1764, 0x00000000
-0,         38,         38,        1,    98304, 0x7215e529
-1,      33516,      33516,      882,     1764, 0x00000000
-1,      34398,      34398,      882,     1764, 0x00000000
-1,      35280,      35280,      882,     1764, 0x00000000
-0,         41,         41,        1,    98304, 0x170c783b
-1,      36162,      36162,      882,     1764, 0x00000000
-1,      37044,      37044,      882,     1764, 0x00000000
-1,      37926,      37926,      882,     1764, 0x00000000
-1,      38808,      38808,      882,     1764, 0x00000000
-0,         45,         45,        1,    98304, 0xf6bd74c7
-1,      39690,      39690,      882,     1764, 0x00000000
-1,      40572,      40572,      882,     1764, 0x00000000
-1,      41454,      41454,      882,     1764, 0x00000000
-1,      42336,      42336,      882,     1764, 0x00000000
-0,         49,         49,        1,    98304, 0x1efd38c4
-1,      43218,      43218,      882,     1764, 0x00000000
-1,      44100,      44100,      882,     1764, 0x00000000
-1,      44982,      44982,      882,     1764, 0x00000000
-0,         52,         52,        1,    98304, 0x29c26bba
-1,      45864,      45864,      882,     1764, 0x00000000
-1,      46746,      46746,      882,     1764, 0x00000000
-1,      47628,      47628,      882,     1764, 0x00000000
-1,      48510,      48510,      882,     1764, 0x00000000
-0,         56,         56,        1,    98304, 0x880a6313
-1,      49392,      49392,      882,     1764, 0x00000000
-1,      50274,      50274,      882,     1764, 0x00000000
-1,      51156,      51156,      882,     1764, 0x00000000
-0,         59,         59,        1,    98304, 0x73f5bb00
-1,      52038,      52038,      882,     1764, 0x00000000
-1,      52920,      52920,      882,     1764, 0x00000000
-1,      53802,      53802,      882,     1764, 0x00000000
-1,      54684,      54684,      882,     1764, 0x00000000
-0,         63,         63,        1,    98304, 0xc85b19ec
-1,      55566,      55566,      882,     1764, 0x00000000
-1,      56448,      56448,      882,     1764, 0x00000000
-1,      57330,      57330,      882,     1764, 0x00000000
-0,         66,         66,        1,    98304, 0x00000000
-1,      58212,      58212,      882,     1764, 0x00000000
-1,      59094,      59094,      882,     1764, 0x00000000
-1,      59976,      59976,      882,     1764, 0x00000000
-1,      60858,      60858,      882,     1764, 0x00000000
-0,         70,         70,        1,    98304, 0x00000000
-1,      61740,      61740,      882,     1764, 0x00000000
-1,      62622,      62622,      882,     1764, 0x00000000
-1,      63504,      63504,      882,     1764, 0x00000000
-1,      64386,      64386,      882,     1764, 0x00000000
-0,         74,         74,        1,    98304, 0x00000000
-1,      65268,      65268,      882,     1764, 0x00000000
-1,      66150,      66150,      882,     1764, 0x00000000
-1,      67032,      67032,      882,     1764, 0x00000000
diff --git a/deps/libav/tests/ref/fate/tiff-fax-g3 b/deps/libav/tests/ref/fate/tiff-fax-g3
deleted file mode 100644
index fa7bc2f..0000000
--- a/deps/libav/tests/ref/fate/tiff-fax-g3
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1000384, 0xb758eb8b
diff --git a/deps/libav/tests/ref/fate/tiff-fax-g3s b/deps/libav/tests/ref/fate/tiff-fax-g3s
deleted file mode 100644
index fa7bc2f..0000000
--- a/deps/libav/tests/ref/fate/tiff-fax-g3s
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,  1000384, 0xb758eb8b
diff --git a/deps/libav/tests/ref/fate/timefilter b/deps/libav/tests/ref/fate/timefilter
deleted file mode 100644
index 57c1209..0000000
--- a/deps/libav/tests/ref/fate/timefilter
+++ /dev/null
@@ -1,6 +0,0 @@
- [0.800000 0.000800  0.000000] [1.021025 0.998922  0.000000] [1.021025 0.998922  0.000000] [1.021025 0.998922  0.000000]
- [0.001003 0.000000  0.004341] [0.041562 0.000996  0.045245] [0.081175 0.002874  0.074431] [0.118380 0.006568  0.108913]
- [0.001003 0.000000  0.039073] [0.013619 0.000455  0.224390] [0.041562 0.000996  0.407205] [0.068719 0.002305  0.600848]
- [0.001003 0.000000  0.212729] [0.022518 0.000060  0.941262] [0.015889 0.000507  1.391585] [0.041562 0.000996  2.217003]
- [0.001003 0.000000  0.976818] [0.014412 0.000021  2.712350] [0.013691 0.000370  4.648765] [0.018915 0.000542  6.709646]
- [0.001003 0.000000  4.172097] [0.010677 0.000007  7.809261] [0.018915 0.000032 14.578784] [0.013619 0.000387 20.628496]
diff --git a/deps/libav/tests/ref/fate/tmv b/deps/libav/tests/ref/fate/tmv
deleted file mode 100644
index 6203e86..0000000
--- a/deps/libav/tests/ref/fate/tmv
+++ /dev/null
@@ -1,222 +0,0 @@
-#tb 0: 184/11029
-#tb 1: 1/22058
-0,          0,          0,        1,   192000, 0xc698297a
-1,          0,          0,      368,      736, 0xf63db497
-0,          1,          1,        1,   192000, 0x8d5bd6be
-1,        368,        368,      368,      736, 0xbc42caef
-0,          2,          2,        1,   192000, 0x21c32083
-1,        736,        736,      368,      736, 0x5619a45a
-0,          3,          3,        1,   192000, 0x849cd4c0
-1,       1104,       1104,      368,      736, 0x1b8ac0f9
-0,          4,          4,        1,   192000, 0x8c63a4f0
-1,       1472,       1472,      368,      736, 0x55dcac78
-0,          5,          5,        1,   192000, 0x5dbee9ab
-1,       1840,       1840,      368,      736, 0xd9f2a266
-0,          6,          6,        1,   192000, 0x2b12d9bb
-1,       2208,       2208,      368,      736, 0x22f8af51
-0,          7,          7,        1,   192000, 0x1a737e17
-1,       2576,       2576,      368,      736, 0x838bacb8
-0,          8,          8,        1,   192000, 0x90536c29
-1,       2944,       2944,      368,      736, 0x7b29b4f9
-0,          9,          9,        1,   192000, 0xd7795243
-1,       3312,       3312,      368,      736, 0x5a01b505
-0,         10,         10,        1,   192000, 0x08847e17
-1,       3680,       3680,      368,      736, 0xc330abb4
-0,         11,         11,        1,   192000, 0x47aa5a3b
-1,       4048,       4048,      368,      736, 0x84d6c49d
-0,         12,         12,        1,   192000, 0x9435266f
-1,       4416,       4416,      368,      736, 0xd0a1a588
-0,         13,         13,        1,   192000, 0x87e7ea9c
-1,       4784,       4784,      368,      736, 0x9083a382
-0,         14,         14,        1,   192000, 0x6dc00285
-1,       5152,       5152,      368,      736, 0x291eb335
-0,         15,         15,        1,   192000, 0xf6407ddf
-1,       5520,       5520,      368,      736, 0xdda2b452
-0,         16,         16,        1,   192000, 0x55541c09
-1,       5888,       5888,      368,      736, 0x82feab67
-0,         17,         17,        1,   192000, 0xf1c4f5be
-1,       6256,       6256,      368,      736, 0xfca6b943
-0,         18,         18,        1,   192000, 0xe59ff74c
-1,       6624,       6624,      368,      736, 0x2a4ea1fd
-0,         19,         19,        1,   192000, 0x0fedcf04
-1,       6992,       6992,      368,      736, 0xbb4bc783
-0,         20,         20,        1,   192000, 0x04b893dd
-1,       7360,       7360,      368,      736, 0x8c10a799
-0,         21,         21,        1,   192000, 0xfef47d83
-1,       7728,       7728,      368,      736, 0x8751a53b
-0,         22,         22,        1,   192000, 0x07bde9ed
-1,       8096,       8096,      368,      736, 0x4b3c9fc3
-0,         23,         23,        1,   192000, 0xb8003fd2
-1,       8464,       8464,      368,      736, 0x5dad9b46
-0,         24,         24,        1,   192000, 0x4eb6b3ed
-1,       8832,       8832,      368,      736, 0xe106a3e6
-0,         25,         25,        1,   192000, 0x320b0b34
-1,       9200,       9200,      368,      736, 0xa42a9a3b
-0,         26,         26,        1,   192000, 0x5156e90f
-1,       9568,       9568,      368,      736, 0xb5069901
-0,         27,         27,        1,   192000, 0x34778cde
-1,       9936,       9936,      368,      736, 0x3556c3c3
-0,         28,         28,        1,   192000, 0xd8d96e44
-1,      10304,      10304,      368,      736, 0xa870c1ee
-0,         29,         29,        1,   192000, 0x962ae9f3
-1,      10672,      10672,      368,      736, 0xc388b6d8
-0,         30,         30,        1,   192000, 0x3d29d85a
-1,      11040,      11040,      368,      736, 0xe167a2b0
-0,         31,         31,        1,   192000, 0x838554fa
-1,      11408,      11408,      368,      736, 0x15aeb59d
-0,         32,         32,        1,   192000, 0xd64a3b93
-1,      11776,      11776,      368,      736, 0xa576c0bc
-0,         33,         33,        1,   192000, 0x380ef140
-1,      12144,      12144,      368,      736, 0x44f3b827
-0,         34,         34,        1,   192000, 0x076b38c0
-1,      12512,      12512,      368,      736, 0xfa5ecd84
-0,         35,         35,        1,   192000, 0xd9a67c7c
-1,      12880,      12880,      368,      736, 0xb7b996f6
-0,         36,         36,        1,   192000, 0xc2849a50
-1,      13248,      13248,      368,      736, 0xb390c311
-0,         37,         37,        1,   192000, 0x9b94a347
-1,      13616,      13616,      368,      736, 0xc5a9ab0f
-0,         38,         38,        1,   192000, 0xe3ba9c07
-1,      13984,      13984,      368,      736, 0x1a3aa3f6
-0,         39,         39,        1,   192000, 0xef0011f5
-1,      14352,      14352,      368,      736, 0xdaaf9e42
-0,         40,         40,        1,   192000, 0xa98381e8
-1,      14720,      14720,      368,      736, 0xad8fb0ba
-0,         41,         41,        1,   192000, 0x27e5ce9b
-1,      15088,      15088,      368,      736, 0x9cce9e05
-0,         42,         42,        1,   192000, 0x8568e33f
-1,      15456,      15456,      368,      736, 0x70639e6f
-0,         43,         43,        1,   192000, 0x540633b6
-1,      15824,      15824,      368,      736, 0xc5e1ba9b
-0,         44,         44,        1,   192000, 0xd8fcfbed
-1,      16192,      16192,      368,      736, 0x9e6cb422
-0,         45,         45,        1,   192000, 0x15609e04
-1,      16560,      16560,      368,      736, 0x5c559a1e
-0,         46,         46,        1,   192000, 0x7e4f5c9b
-1,      16928,      16928,      368,      736, 0xb071c2da
-0,         47,         47,        1,   192000, 0xef14950d
-1,      17296,      17296,      368,      736, 0xd9bdb9eb
-0,         48,         48,        1,   192000, 0x9e0b85b9
-1,      17664,      17664,      368,      736, 0x5ecab2d5
-0,         49,         49,        1,   192000, 0xf3b69b95
-1,      18032,      18032,      368,      736, 0x0f78a8fe
-0,         50,         50,        1,   192000, 0x09b6db39
-1,      18400,      18400,      368,      736, 0x74ebaccd
-0,         51,         51,        1,   192000, 0x4dc9a300
-1,      18768,      18768,      368,      736, 0x2cfab78e
-0,         52,         52,        1,   192000, 0x29d9fdde
-1,      19136,      19136,      368,      736, 0x32c6c26e
-0,         53,         53,        1,   192000, 0x22e79283
-1,      19504,      19504,      368,      736, 0xbe339d74
-0,         54,         54,        1,   192000, 0x5f5c95aa
-1,      19872,      19872,      368,      736, 0x2c31b687
-0,         55,         55,        1,   192000, 0x4d76efde
-1,      20240,      20240,      368,      736, 0xcbb0b8d5
-0,         56,         56,        1,   192000, 0xb1d79f6a
-1,      20608,      20608,      368,      736, 0x17bcb56a
-0,         57,         57,        1,   192000, 0xedfe6012
-1,      20976,      20976,      368,      736, 0x116fb70c
-0,         58,         58,        1,   192000, 0x4a56033a
-1,      21344,      21344,      368,      736, 0xa22eb34f
-0,         59,         59,        1,   192000, 0xdbc9f746
-1,      21712,      21712,      368,      736, 0x130bc9bb
-0,         60,         60,        1,   192000, 0xedff8a16
-1,      22080,      22080,      368,      736, 0xbb0b77aa
-0,         61,         61,        1,   192000, 0x46b5f843
-1,      22448,      22448,      368,      736, 0xafb5a9f0
-0,         62,         62,        1,   192000, 0xbd12dbfc
-1,      22816,      22816,      368,      736, 0xaf55f1a3
-0,         63,         63,        1,   192000, 0xacf2a336
-1,      23184,      23184,      368,      736, 0x988e9669
-0,         64,         64,        1,   192000, 0x13843e7f
-1,      23552,      23552,      368,      736, 0x4e2cc9ab
-0,         65,         65,        1,   192000, 0x6fda777f
-1,      23920,      23920,      368,      736, 0x34b3b7ea
-0,         66,         66,        1,   192000, 0x16ffef07
-1,      24288,      24288,      368,      736, 0x1252a16b
-0,         67,         67,        1,   192000, 0xb36c06c6
-1,      24656,      24656,      368,      736, 0x04279e74
-0,         68,         68,        1,   192000, 0xd65746b1
-1,      25024,      25024,      368,      736, 0x9c2ecb2e
-0,         69,         69,        1,   192000, 0x2817079b
-1,      25392,      25392,      368,      736, 0x6c16945a
-0,         70,         70,        1,   192000, 0xadb60837
-1,      25760,      25760,      368,      736, 0x2c0cc1f9
-0,         71,         71,        1,   192000, 0x60cb0d87
-1,      26128,      26128,      368,      736, 0x52fba868
-0,         72,         72,        1,   192000, 0x14e5b02b
-1,      26496,      26496,      368,      736, 0xe2a2a5be
-0,         73,         73,        1,   192000, 0x574fd8f4
-1,      26864,      26864,      368,      736, 0x2f56a95b
-0,         74,         74,        1,   192000, 0xffb9a8fa
-1,      27232,      27232,      368,      736, 0x573196a0
-0,         75,         75,        1,   192000, 0xc2904a3e
-1,      27600,      27600,      368,      736, 0xb542c1dc
-0,         76,         76,        1,   192000, 0x22e77c9b
-1,      27968,      27968,      368,      736, 0x7f6a9964
-0,         77,         77,        1,   192000, 0xd76d81c2
-1,      28336,      28336,      368,      736, 0xc39db324
-0,         78,         78,        1,   192000, 0xf5b0fcc8
-1,      28704,      28704,      368,      736, 0xa2dbb058
-0,         79,         79,        1,   192000, 0xc452ce4d
-1,      29072,      29072,      368,      736, 0x8bfac722
-0,         80,         80,        1,   192000, 0x64a53e4f
-1,      29440,      29440,      368,      736, 0x5e679406
-0,         81,         81,        1,   192000, 0xe6c115da
-1,      29808,      29808,      368,      736, 0xd7a8c2aa
-0,         82,         82,        1,   192000, 0x959d45fe
-1,      30176,      30176,      368,      736, 0x5ec6a7a0
-0,         83,         83,        1,   192000, 0xabb270b6
-1,      30544,      30544,      368,      736, 0x9f33c47f
-0,         84,         84,        1,   192000, 0x451642b8
-1,      30912,      30912,      368,      736, 0x4c4998bf
-0,         85,         85,        1,   192000, 0x028b2202
-1,      31280,      31280,      368,      736, 0x2363c344
-0,         86,         86,        1,   192000, 0xf5d79b86
-1,      31648,      31648,      368,      736, 0xecf9a09f
-0,         87,         87,        1,   192000, 0xebe0623e
-1,      32016,      32016,      368,      736, 0x5a069e69
-0,         88,         88,        1,   192000, 0x7560d1eb
-1,      32384,      32384,      368,      736, 0xe2e5b106
-0,         89,         89,        1,   192000, 0xcbf85785
-1,      32752,      32752,      368,      736, 0x7ff4b09e
-0,         90,         90,        1,   192000, 0x180f6aca
-1,      33120,      33120,      368,      736, 0x0157acd2
-0,         91,         91,        1,   192000, 0xea8ecb95
-1,      33488,      33488,      368,      736, 0x64849b5a
-0,         92,         92,        1,   192000, 0x6a5e3639
-1,      33856,      33856,      368,      736, 0x0399b037
-0,         93,         93,        1,   192000, 0x5aa6c22c
-1,      34224,      34224,      368,      736, 0xa57ea80f
-0,         94,         94,        1,   192000, 0xdbb50948
-1,      34592,      34592,      368,      736, 0x233eb2a4
-0,         95,         95,        1,   192000, 0x0184a90a
-1,      34960,      34960,      368,      736, 0x8aa5dfa0
-0,         96,         96,        1,   192000, 0x0efc1358
-1,      35328,      35328,      368,      736, 0x0c9fa877
-0,         97,         97,        1,   192000, 0x29053255
-1,      35696,      35696,      368,      736, 0xbe6faef2
-0,         98,         98,        1,   192000, 0x3a7e239d
-1,      36064,      36064,      368,      736, 0xf800c0f2
-0,         99,         99,        1,   192000, 0x3bd99ca5
-1,      36432,      36432,      368,      736, 0x1d68a964
-0,        100,        100,        1,   192000, 0xe1b5a4d6
-1,      36800,      36800,      368,      736, 0x0e4f8872
-0,        101,        101,        1,   192000, 0xf487f8bb
-1,      37168,      37168,      368,      736, 0x31c6ed1c
-0,        102,        102,        1,   192000, 0x8b14387c
-1,      37536,      37536,      368,      736, 0x7448a8d2
-0,        103,        103,        1,   192000, 0xdaeb9cb4
-1,      37904,      37904,      368,      736, 0x79a2ac09
-0,        104,        104,        1,   192000, 0xdc1d2f5b
-1,      38272,      38272,      368,      736, 0xbdbfa397
-0,        105,        105,        1,   192000, 0x4dcab167
-1,      38640,      38640,      368,      736, 0xa5deb8bb
-0,        106,        106,        1,   192000, 0x87fcf0d3
-1,      39008,      39008,      368,      736, 0x4565d179
-0,        107,        107,        1,   192000, 0x36d37542
-1,      39376,      39376,      368,      736, 0x64d89f91
-0,        108,        108,        1,   192000, 0x59ba49c5
-1,      39744,      39744,      368,      736, 0x32319f68
-0,        109,        109,        1,   192000, 0xf679b712
-1,      40112,      40112,      368,      736, 0x3efdc04f
diff --git a/deps/libav/tests/ref/fate/truemotion1-15 b/deps/libav/tests/ref/fate/truemotion1-15
deleted file mode 100644
index 6b5281d..0000000
--- a/deps/libav/tests/ref/fate/truemotion1-15
+++ /dev/null
@@ -1,106 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,   161280, 0x7041748d
-0,          1,          1,        1,   161280, 0x3cc4dfb5
-0,          2,          2,        1,   161280, 0xca3af22d
-0,          3,          3,        1,   161280, 0x23ad1d85
-0,          4,          4,        1,   161280, 0x9c9cf364
-0,          5,          5,        1,   161280, 0x1551d6a8
-0,          6,          6,        1,   161280, 0xc39f6b95
-0,          7,          7,        1,   161280, 0x3b036dcc
-0,          8,          8,        1,   161280, 0xa6fac1db
-0,          9,          9,        1,   161280, 0x67656b62
-0,         10,         10,        1,   161280, 0xb41f47d1
-0,         11,         11,        1,   161280, 0xc207249e
-0,         12,         12,        1,   161280, 0xbee8f843
-0,         13,         13,        1,   161280, 0x092acf46
-0,         14,         14,        1,   161280, 0x8d9e2680
-0,         15,         15,        1,   161280, 0x8becc20c
-0,         16,         16,        1,   161280, 0x655e444e
-0,         17,         17,        1,   161280, 0x5c112da0
-0,         18,         18,        1,   161280, 0x232fa9eb
-0,         19,         19,        1,   161280, 0x9721745d
-0,         20,         20,        1,   161280, 0x92f1d880
-0,         21,         21,        1,   161280, 0x16233978
-0,         22,         22,        1,   161280, 0x19a27e69
-0,         23,         23,        1,   161280, 0x7b6ad73a
-0,         24,         24,        1,   161280, 0xa7a674aa
-0,         25,         25,        1,   161280, 0x4e434abb
-0,         26,         26,        1,   161280, 0xb96eea14
-0,         27,         27,        1,   161280, 0x1350188c
-0,         28,         28,        1,   161280, 0x79c6f305
-0,         29,         29,        1,   161280, 0xa9c7782d
-0,         30,         30,        1,   161280, 0x40a4f456
-0,         31,         31,        1,   161280, 0xaf291ed6
-0,         32,         32,        1,   161280, 0xab29b4e1
-0,         33,         33,        1,   161280, 0xbfcd2712
-0,         34,         34,        1,   161280, 0xff22a0d7
-0,         35,         35,        1,   161280, 0xb0ae88a9
-0,         36,         36,        1,   161280, 0x811d1259
-0,         37,         37,        1,   161280, 0x593c39a1
-0,         38,         38,        1,   161280, 0x5a5a97f8
-0,         39,         39,        1,   161280, 0xa5639ecf
-0,         40,         40,        1,   161280, 0x543920c6
-0,         41,         41,        1,   161280, 0xb41689ee
-0,         42,         42,        1,   161280, 0xc0ad83de
-0,         43,         43,        1,   161280, 0x9e9e7456
-0,         44,         44,        1,   161280, 0x777ccbfe
-0,         45,         45,        1,   161280, 0x9c2df916
-0,         46,         46,        1,   161280, 0xe0c13b35
-0,         47,         47,        1,   161280, 0x39bfa5a5
-0,         48,         48,        1,   161280, 0x35dfb264
-0,         49,         49,        1,   161280, 0x43018613
-0,         50,         50,        1,   161280, 0x43584b8a
-0,         51,         51,        1,   161280, 0xa5cd230a
-0,         52,         52,        1,   161280, 0x6fe2cfb3
-0,         53,         53,        1,   161280, 0x88a7c0db
-0,         54,         54,        1,   161280, 0x476f1cd2
-0,         55,         55,        1,   161280, 0x96401d49
-0,         56,         56,        1,   161280, 0x7d932919
-0,         57,         57,        1,   161280, 0x06465481
-0,         58,         58,        1,   161280, 0x39631520
-0,         59,         59,        1,   161280, 0xc3fff780
-0,         60,         60,        1,   161280, 0xa81faf28
-0,         61,         61,        1,   161280, 0x7a311f4f
-0,         62,         62,        1,   161280, 0x52f9b931
-0,         63,         63,        1,   161280, 0x938cf016
-0,         64,         64,        1,   161280, 0xf8f6e19c
-0,         65,         65,        1,   161280, 0xca90561b
-0,         66,         66,        1,   161280, 0x8594d06b
-0,         67,         67,        1,   161280, 0xea32bf3b
-0,         68,         68,        1,   161280, 0x4646111a
-0,         69,         69,        1,   161280, 0xee891162
-0,         70,         70,        1,   161280, 0xcfc32082
-0,         71,         71,        1,   161280, 0x863c281a
-0,         72,         72,        1,   161280, 0x01b591aa
-0,         73,         73,        1,   161280, 0x211fbc62
-0,         74,         74,        1,   161280, 0xae2bafe2
-0,         75,         75,        1,   161280, 0xcfe46dca
-0,         76,         76,        1,   161280, 0xcf8fe8a3
-0,         77,         77,        1,   161280, 0x3f8474eb
-0,         78,         78,        1,   161280, 0x06da345a
-0,         79,         79,        1,   161280, 0xbd4d3280
-0,         80,         80,        1,   161280, 0xb5e70fea
-0,         81,         81,        1,   161280, 0x0c99c804
-0,         82,         82,        1,   161280, 0x19841ed4
-0,         83,         83,        1,   161280, 0xf81dea50
-0,         84,         84,        1,   161280, 0x7777d81c
-0,         85,         85,        1,   161280, 0x0497cfd8
-0,         86,         86,        1,   161280, 0x50b6eb64
-0,         87,         87,        1,   161280, 0x5071fc07
-0,         88,         88,        1,   161280, 0xbb7527fb
-0,         89,         89,        1,   161280, 0x13054f1f
-0,         90,         90,        1,   161280, 0x4b78fb27
-0,         91,         91,        1,   161280, 0xf504968f
-0,         92,         92,        1,   161280, 0x555b10b7
-0,         93,         93,        1,   161280, 0xcc0dde40
-0,         94,         94,        1,   161280, 0xcc0dde40
-0,         95,         95,        1,   161280, 0x367f60c8
-0,         96,         96,        1,   161280, 0x367f60c8
-0,         97,         97,        1,   161280, 0x367f60c8
-0,         98,         98,        1,   161280, 0x367f60c8
-0,         99,         99,        1,   161280, 0x367f60c8
-0,        100,        100,        1,   161280, 0x367f60c8
-0,        101,        101,        1,   161280, 0x367f60c8
-0,        102,        102,        1,   161280, 0x367f60c8
-0,        103,        103,        1,   161280, 0x367f60c8
-0,        104,        104,        1,   161280, 0x367f60c8
diff --git a/deps/libav/tests/ref/fate/truemotion1-24 b/deps/libav/tests/ref/fate/truemotion1-24
deleted file mode 100644
index f097ed0..0000000
--- a/deps/libav/tests/ref/fate/truemotion1-24
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,    69120, 0x68beb30f
-0,          1,          1,        1,    69120, 0x3976f5cf
-0,          2,          2,        1,    69120, 0xf815bc3c
-0,          3,          3,        1,    69120, 0xa7cc0ae6
-0,          4,          4,        1,    69120, 0xd85ac282
-0,          5,          5,        1,    69120, 0xf7fd7edb
-0,          6,          6,        1,    69120, 0x433bb6f6
-0,          7,          7,        1,    69120, 0xdbac8bee
-0,          8,          8,        1,    69120, 0x88e2a799
-0,          9,          9,        1,    69120, 0x49617b26
-0,         10,         10,        1,    69120, 0xeb44ca01
-0,         11,         11,        1,    69120, 0x6fea37e8
-0,         12,         12,        1,    69120, 0xf55d74c7
-0,         13,         13,        1,    69120, 0xb5082ca7
-0,         14,         14,        1,    69120, 0x5876d758
diff --git a/deps/libav/tests/ref/fate/truemotion2 b/deps/libav/tests/ref/fate/truemotion2
deleted file mode 100644
index c263ba4..0000000
--- a/deps/libav/tests/ref/fate/truemotion2
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,   230400, 0x135cb509
-0,          1,          1,        1,   230400, 0x919a1ab7
-0,          2,          2,        1,   230400, 0x0af8722b
-0,          3,          3,        1,   230400, 0xc9616809
-0,          4,          4,        1,   230400, 0xe16ecaf7
-0,          5,          5,        1,   230400, 0xa86f8d1b
-0,          6,          6,        1,   230400, 0xd351b5a4
-0,          7,          7,        1,   230400, 0xd112b5b7
-0,          8,          8,        1,   230400, 0xc9c3c9b1
-0,          9,          9,        1,   230400, 0x4f91e572
-0,         10,         10,        1,   230400, 0xb1d8c4d3
-0,         11,         11,        1,   230400, 0x34de10c1
-0,         12,         12,        1,   230400, 0xbd4f3b29
-0,         13,         13,        1,   230400, 0xfeaf1477
-0,         14,         14,        1,   230400, 0x718ffa17
-0,         15,         15,        1,   230400, 0x23b46ef3
-0,         16,         16,        1,   230400, 0x6346d9b8
-0,         17,         17,        1,   230400, 0xdb66bf57
-0,         18,         18,        1,   230400, 0xeb74a2ff
-0,         19,         19,        1,   230400, 0xe0750470
-0,         20,         20,        1,   230400, 0x645eb109
-0,         21,         21,        1,   230400, 0xbb96489a
-0,         22,         22,        1,   230400, 0x58a70e35
-0,         23,         23,        1,   230400, 0xc7563441
-0,         24,         24,        1,   230400, 0x6098f07e
-0,         25,         25,        1,   230400, 0x579ece15
-0,         26,         26,        1,   230400, 0xe1ca8d03
-0,         27,         27,        1,   230400, 0x8928cf34
-0,         28,         28,        1,   230400, 0xf621620e
-0,         29,         29,        1,   230400, 0x98a344ea
diff --git a/deps/libav/tests/ref/fate/tscc-15bit b/deps/libav/tests/ref/fate/tscc-15bit
deleted file mode 100644
index 372b165..0000000
--- a/deps/libav/tests/ref/fate/tscc-15bit
+++ /dev/null
@@ -1,242 +0,0 @@
-#tb 0: 1/15
-#tb 1: 1/11025
-0,          0,          0,        1,   657600, 0xaf456809
-1,          0,          0,    11025,    22050, 0x1740aaec
-0,          1,          1,        1,   657600, 0xaf456809
-0,          2,          2,        1,   657600, 0xaf456809
-0,          3,          3,        1,   657600, 0x2dbe6889
-0,          4,          4,        1,   657600, 0x2dbe6889
-0,          5,          5,        1,   657600, 0x2dbe6889
-0,          6,          6,        1,   657600, 0x2dbe6889
-0,          7,          7,        1,   657600, 0x2dbe6889
-0,          8,          8,        1,   657600, 0x2dbe6889
-0,          9,          9,        1,   657600, 0x2dbe6889
-0,         10,         10,        1,   657600, 0x2dbe6889
-0,         11,         11,        1,   657600, 0x2dbe6889
-0,         12,         12,        1,   657600, 0x2dbe6889
-0,         13,         13,        1,   657600, 0x2dbe6889
-0,         14,         14,        1,   657600, 0x2dbe6889
-0,         15,         15,        1,   657600, 0x2dbe6889
-1,      11025,      11025,    11025,    22050, 0x75ed6086
-0,         16,         16,        1,   657600, 0x2dbe6889
-0,         17,         17,        1,   657600, 0x2dbe6889
-0,         18,         18,        1,   657600, 0x2dbe6889
-0,         19,         19,        1,   657600, 0x2dbe6889
-0,         20,         20,        1,   657600, 0x2dbe6889
-0,         21,         21,        1,   657600, 0x92796e59
-0,         22,         22,        1,   657600, 0x92796e59
-0,         23,         23,        1,   657600, 0x92796e59
-0,         24,         24,        1,   657600, 0x64cb6889
-0,         25,         25,        1,   657600, 0x64cb6889
-0,         26,         26,        1,   657600, 0x64cb6889
-0,         27,         27,        1,   657600, 0x64cb6889
-0,         28,         28,        1,   657600, 0x64cb6889
-0,         29,         29,        1,   657600, 0x64cb6889
-0,         30,         30,        1,   657600, 0x42036b71
-1,      22050,      22050,    11025,    22050, 0xca52a4e9
-0,         31,         31,        1,   657600, 0x42036b71
-0,         32,         32,        1,   657600, 0x42036b71
-0,         33,         33,        1,   657600, 0xc40a6889
-0,         34,         34,        1,   657600, 0xc40a6889
-0,         35,         35,        1,   657600, 0xc40a6889
-0,         36,         36,        1,   657600, 0xaa6f7429
-0,         37,         37,        1,   657600, 0xaa6f7429
-0,         38,         38,        1,   657600, 0xaa6f7429
-0,         39,         39,        1,   657600, 0x854172d9
-0,         40,         40,        1,   657600, 0x854172d9
-0,         41,         41,        1,   657600, 0x854172d9
-0,         42,         42,        1,   657600, 0x22d10de0
-0,         43,         43,        1,   657600, 0xa75f0d60
-0,         44,         44,        1,   657600, 0x7a440be0
-0,         45,         45,        1,   657600, 0x40095d50
-1,      33075,      33075,    11025,    22050, 0xb306d419
-0,         46,         46,        1,   657600, 0x40095d50
-0,         47,         47,        1,   657600, 0x64766320
-0,         48,         48,        1,   657600, 0x64766320
-0,         49,         49,        1,   657600, 0x64766320
-0,         50,         50,        1,   657600, 0x64766320
-0,         51,         51,        1,   657600, 0x64766320
-0,         52,         52,        1,   657600, 0x64766320
-0,         53,         53,        1,   657600, 0x64766320
-0,         54,         54,        1,   657600, 0x64766320
-0,         55,         55,        1,   657600, 0x64766320
-0,         56,         56,        1,   657600, 0x64766320
-0,         57,         57,        1,   657600, 0xf51adc49
-0,         58,         58,        1,   657600, 0xf51adc49
-0,         59,         59,        1,   657600, 0xf51adc49
-0,         60,         60,        1,   657600, 0xdd47af59
-1,      44100,      44100,    11025,    22050, 0x8cbb9625
-0,         61,         61,        1,   657600, 0xdd47af59
-0,         62,         62,        1,   657600, 0xffa8acf1
-0,         63,         63,        1,   657600, 0x5994b059
-0,         64,         64,        1,   657600, 0x5994b059
-0,         65,         65,        1,   657600, 0x5994b059
-0,         66,         66,        1,   657600, 0x03ffae71
-0,         67,         67,        1,   657600, 0x03ffae71
-0,         68,         68,        1,   657600, 0x03ffae71
-0,         69,         69,        1,   657600, 0xe33ab89e
-0,         70,         70,        1,   657600, 0xe33ab89e
-0,         71,         71,        1,   657600, 0xe33ab89e
-0,         72,         72,        1,   657600, 0xbe37b549
-0,         73,         73,        1,   657600, 0xbe37b549
-0,         74,         74,        1,   657600, 0x1d395bf9
-0,         75,         75,        1,   657600, 0x1d395bf9
-1,      55125,      55125,    11025,    22050, 0x34a11f66
-0,         76,         76,        1,   657600, 0x1d395bf9
-0,         77,         77,        1,   657600, 0x1d395bf9
-0,         78,         78,        1,   657600, 0x2ec36f37
-0,         79,         79,        1,   657600, 0x2ec36f37
-0,         80,         80,        1,   657600, 0xb04a6eb7
-0,         81,         81,        1,   657600, 0x66610458
-0,         82,         82,        1,   657600, 0x66610458
-0,         83,         83,        1,   657600, 0xaf8901f0
-0,         84,         84,        1,   657600, 0x3ae41c48
-0,         85,         85,        1,   657600, 0x5b870b70
-0,         86,         86,        1,   657600, 0x11490c60
-0,         87,         87,        1,   657600, 0x70064801
-0,         88,         88,        1,   657600, 0x80d54519
-0,         89,         89,        1,   657600, 0xe8c942b1
-0,         90,         90,        1,   657600, 0x830d8c24
-1,      66150,      66150,    11025,    22050, 0x1ae81230
-0,         91,         91,        1,   657600, 0x830d8c24
-0,         92,         92,        1,   657600, 0x830d8c24
-0,         93,         93,        1,   657600, 0xf3c4707c
-0,         94,         94,        1,   657600, 0x6ace707c
-0,         95,         95,        1,   657600, 0x6ace707c
-0,         96,         96,        1,   657600, 0x6ace707c
-0,         97,         97,        1,   657600, 0x6ace707c
-0,         98,         98,        1,   657600, 0x6ace707c
-0,         99,         99,        1,   657600, 0x5f461aae
-0,        100,        100,        1,   657600, 0x5f461aae
-0,        101,        101,        1,   657600, 0x221ceecf
-0,        102,        102,        1,   657600, 0x221ceecf
-0,        103,        103,        1,   657600, 0x221ceecf
-0,        104,        104,        1,   657600, 0x221ceecf
-0,        105,        105,        1,   657600, 0x221ceecf
-1,      77175,      77175,    11025,    22050, 0x1217eeba
-0,        106,        106,        1,   657600, 0x221ceecf
-0,        107,        107,        1,   657600, 0x221ceecf
-0,        108,        108,        1,   657600, 0x3bf6f39f
-0,        109,        109,        1,   657600, 0x3bf6f39f
-0,        110,        110,        1,   657600, 0x3bf6f39f
-0,        111,        111,        1,   657600, 0xc2caeecf
-0,        112,        112,        1,   657600, 0xc2caeecf
-0,        113,        113,        1,   657600, 0xc2caeecf
-0,        114,        114,        1,   657600, 0xc316d63e
-0,        115,        115,        1,   657600, 0xc316d63e
-0,        116,        116,        1,   657600, 0xc316d63e
-0,        117,        117,        1,   657600, 0x41f6218d
-0,        118,        118,        1,   657600, 0x41f6218d
-0,        119,        119,        1,   657600, 0x41f6218d
-0,        120,        120,        1,   657600, 0xff43ec36
-1,      88200,      88200,    11025,    22050, 0x50e70baa
-0,        121,        121,        1,   657600, 0x0b10eb16
-0,        122,        122,        1,   657600, 0x0b10eb16
-0,        123,        123,        1,   657600, 0xbdf41aa5
-0,        124,        124,        1,   657600, 0xbdf41aa5
-0,        125,        125,        1,   657600, 0xbdf41aa5
-0,        126,        126,        1,   657600, 0xd502ca06
-0,        127,        127,        1,   657600, 0xd502ca06
-0,        128,        128,        1,   657600, 0xd502ca06
-0,        129,        129,        1,   657600, 0x8446f89e
-0,        130,        130,        1,   657600, 0x8446f89e
-0,        131,        131,        1,   657600, 0x8446f89e
-0,        132,        132,        1,   657600, 0x3d4ccf06
-0,        133,        133,        1,   657600, 0x0897d1de
-0,        134,        134,        1,   657600, 0x0897d1de
-0,        135,        135,        1,   657600, 0x3e27e01e
-1,      99225,      99225,    11025,    22050, 0xb19e89c0
-0,        136,        136,        1,   657600, 0x3e27e01e
-0,        137,        137,        1,   657600, 0x3e27e01e
-0,        138,        138,        1,   657600, 0x3e27e01e
-0,        139,        139,        1,   657600, 0x3e27e01e
-0,        140,        140,        1,   657600, 0x3e27e01e
-0,        141,        141,        1,   657600, 0xe51078a8
-0,        142,        142,        1,   657600, 0xe51078a8
-0,        143,        143,        1,   657600, 0xe9967a40
-0,        144,        144,        1,   657600, 0xe9967a40
-0,        145,        145,        1,   657600, 0xe9967a40
-0,        146,        146,        1,   657600, 0xe9967a40
-0,        147,        147,        1,   657600, 0xe9967a40
-0,        148,        148,        1,   657600, 0xe9967a40
-0,        149,        149,        1,   657600, 0xe9967a40
-0,        150,        150,        1,   657600, 0x726cb6b8
-1,     110250,     110250,    11025,    22050, 0x78526696
-0,        151,        151,        1,   657600, 0x2960b6e8
-0,        152,        152,        1,   657600, 0x2960b6e8
-0,        153,        153,        1,   657600, 0x1637d6c8
-0,        154,        154,        1,   657600, 0x6f2fd9b0
-0,        155,        155,        1,   657600, 0x27a7d6c8
-0,        156,        156,        1,   657600, 0xe855d6c8
-0,        157,        157,        1,   657600, 0xe855d6c8
-0,        158,        158,        1,   657600, 0xe855d6c8
-0,        159,        159,        1,   657600, 0x1a8ad6c8
-0,        160,        160,        1,   657600, 0x9c11d648
-0,        161,        161,        1,   657600, 0x6136d648
-0,        162,        162,        1,   657600, 0xdfa0d6c8
-0,        163,        163,        1,   657600, 0xdfa0d6c8
-0,        164,        164,        1,   657600, 0xdfa0d6c8
-0,        165,        165,        1,   657600, 0xdfa0d6c8
-1,     121275,     121275,    11025,    22050, 0x48e3bb21
-0,        166,        166,        1,   657600, 0xdfa0d6c8
-0,        167,        167,        1,   657600, 0xdfa0d6c8
-0,        168,        168,        1,   657600, 0xdfa0d6c8
-0,        169,        169,        1,   657600, 0xdfa0d6c8
-0,        170,        170,        1,   657600, 0xdfa0d6c8
-0,        171,        171,        1,   657600, 0x125cd9b0
-0,        172,        172,        1,   657600, 0x125cd9b0
-0,        173,        173,        1,   657600, 0x8a7ed6c8
-0,        174,        174,        1,   657600, 0x09a6d9b0
-0,        175,        175,        1,   657600, 0x09a6d9b0
-0,        176,        176,        1,   657600, 0x09a6d9b0
-0,        177,        177,        1,   657600, 0x85e87a68
-0,        178,        178,        1,   657600, 0x85e87a68
-0,        179,        179,        1,   657600, 0x85e87a68
-0,        180,        180,        1,   657600, 0xb0a141a8
-1,     132300,     132300,    11025,    22050, 0xbc32204a
-0,        181,        181,        1,   657600, 0xb0a141a8
-0,        182,        182,        1,   657600, 0xf3333bd8
-0,        183,        183,        1,   657600, 0xea090688
-0,        184,        184,        1,   657600, 0xa017fe41
-0,        185,        185,        1,   657600, 0xa017fe41
-0,        186,        186,        1,   657600, 0x32e93bd8
-0,        187,        187,        1,   657600, 0x7fe640c0
-0,        188,        188,        1,   657600, 0x7fe640c0
-0,        189,        189,        1,   657600, 0xcd8995b2
-0,        190,        190,        1,   657600, 0x84278a92
-0,        191,        191,        1,   657600, 0x84278a92
-0,        192,        192,        1,   657600, 0xf1d2874a
-0,        193,        193,        1,   657600, 0xf1d2874a
-0,        194,        194,        1,   657600, 0xf1d2874a
-0,        195,        195,        1,   657600, 0xa58d6742
-1,     143325,     143325,    11025,    22050, 0xdf6f1e46
-0,        196,        196,        1,   657600, 0xa58d6742
-0,        197,        197,        1,   657600, 0xa58d6742
-0,        198,        198,        1,   657600, 0xb0cd11bb
-0,        199,        199,        1,   657600, 0xb0cd11bb
-0,        200,        200,        1,   657600, 0xc55610bb
-0,        201,        201,        1,   657600, 0x4ee1168b
-0,        202,        202,        1,   657600, 0x61c513a3
-0,        203,        203,        1,   657600, 0xd26410bb
-0,        204,        204,        1,   657600, 0xe7c410bb
-0,        205,        205,        1,   657600, 0x444a0dd3
-0,        206,        206,        1,   657600, 0x444a0dd3
-0,        207,        207,        1,   657600, 0x97ac10bb
-0,        208,        208,        1,   657600, 0x97ac10bb
-0,        209,        209,        1,   657600, 0xe8b30dd3
-0,        210,        210,        1,   657600, 0x3d0c10bb
-1,     154350,     154350,    11025,    22050, 0x4c91da9d
-0,        211,        211,        1,   657600, 0x8d2b0dd3
-0,        212,        212,        1,   657600, 0x8d2b0dd3
-0,        213,        213,        1,   657600, 0xa5760dd3
-0,        214,        214,        1,   657600, 0xa5760dd3
-0,        215,        215,        1,   657600, 0xa5760dd3
-0,        216,        216,        1,   657600, 0x31a30dd3
-0,        217,        217,        1,   657600, 0x31a30dd3
-0,        218,        218,        1,   657600, 0x31a30dd3
-0,        219,        219,        1,   657600, 0x31a30dd3
-0,        220,        220,        1,   657600, 0x31a30dd3
-0,        221,        221,        1,   657600, 0x31a30dd3
-0,        222,        222,        1,   657600, 0x31a30dd3
-0,        223,        223,        1,   657600, 0x31a30dd3
-0,        224,        224,        1,   657600, 0x31a30dd3
diff --git a/deps/libav/tests/ref/fate/tscc-32bit b/deps/libav/tests/ref/fate/tscc-32bit
deleted file mode 100644
index 4eef490..0000000
--- a/deps/libav/tests/ref/fate/tscc-32bit
+++ /dev/null
@@ -1,157 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,  2359296, 0x76cccaa7
-0,          1,          1,        1,  2359296, 0x09c52bbf
-0,          2,          2,        1,  2359296, 0xc8746009
-0,          3,          3,        1,  2359296, 0xe48ff59b
-0,          4,          4,        1,  2359296, 0xa2f1fddb
-0,          5,          5,        1,  2359296, 0xbb0e0026
-0,          6,          6,        1,  2359296, 0x66a905ab
-0,          7,          7,        1,  2359296, 0xe990f855
-0,          8,          8,        1,  2359296, 0xe990f855
-0,          9,          9,        1,  2359296, 0x3ec2c64e
-0,         13,         13,        1,  2359296, 0xda3ba3cf
-0,         14,         14,        1,  2359296, 0x60a070fd
-0,         15,         15,        1,  2359296, 0x42e5fedc
-0,         16,         16,        1,  2359296, 0x42e5fedc
-0,         17,         17,        1,  2359296, 0x699cf990
-0,         18,         18,        1,  2359296, 0x699cf990
-0,         19,         19,        1,  2359296, 0x699cf990
-0,         20,         20,        1,  2359296, 0x699cf990
-0,         21,         21,        1,  2359296, 0x699cf990
-0,         22,         22,        1,  2359296, 0x699cf990
-0,         23,         23,        1,  2359296, 0x699cf990
-0,         24,         24,        1,  2359296, 0x1524160c
-0,         25,         25,        1,  2359296, 0x1524160c
-0,         26,         26,        1,  2359296, 0x1524160c
-0,         27,         27,        1,  2359296, 0x1524160c
-0,         28,         28,        1,  2359296, 0x1524160c
-0,         29,         29,        1,  2359296, 0x1524160c
-0,         30,         30,        1,  2359296, 0x1524160c
-0,         31,         31,        1,  2359296, 0x33df0c8c
-0,         32,         32,        1,  2359296, 0x33df0c8c
-0,         33,         33,        1,  2359296, 0x33df0c8c
-0,         34,         34,        1,  2359296, 0x33df0c8c
-0,         35,         35,        1,  2359296, 0x33df0c8c
-0,         36,         36,        1,  2359296, 0x33df0c8c
-0,         37,         37,        1,  2359296, 0x33df0c8c
-0,         38,         38,        1,  2359296, 0xfe3d29f8
-0,         39,         39,        1,  2359296, 0xfe3d29f8
-0,         40,         40,        1,  2359296, 0xfe3d29f8
-0,         41,         41,        1,  2359296, 0xfe3d29f8
-0,         42,         42,        1,  2359296, 0xfe3d29f8
-0,         43,         43,        1,  2359296, 0xfe3d29f8
-0,         44,         44,        1,  2359296, 0xfe3d29f8
-0,         45,         45,        1,  2359296, 0x1b9d197f
-0,         46,         46,        1,  2359296, 0x1b9d197f
-0,         47,         47,        1,  2359296, 0x1b9d197f
-0,         48,         48,        1,  2359296, 0x1b9d197f
-0,         49,         49,        1,  2359296, 0x1b9d197f
-0,         50,         50,        1,  2359296, 0x1b9d197f
-0,         51,         51,        1,  2359296, 0x1b9d197f
-0,         52,         52,        1,  2359296, 0x48c126fb
-0,         53,         53,        1,  2359296, 0x48c126fb
-0,         54,         54,        1,  2359296, 0x48c126fb
-0,         55,         55,        1,  2359296, 0x48c126fb
-0,         56,         56,        1,  2359296, 0x48c126fb
-0,         57,         57,        1,  2359296, 0x48c126fb
-0,         58,         58,        1,  2359296, 0x48c126fb
-0,         59,         59,        1,  2359296, 0xcaa31c7c
-0,         60,         60,        1,  2359296, 0xcaa31c7c
-0,         61,         61,        1,  2359296, 0xcaa31c7c
-0,         62,         62,        1,  2359296, 0xcaa31c7c
-0,         63,         63,        1,  2359296, 0xcaa31c7c
-0,         64,         64,        1,  2359296, 0xcaa31c7c
-0,         65,         65,        1,  2359296, 0xcaa31c7c
-0,         66,         66,        1,  2359296, 0xc6a333ee
-0,         67,         67,        1,  2359296, 0xc6a333ee
-0,         68,         68,        1,  2359296, 0xc6a333ee
-0,         69,         69,        1,  2359296, 0xc6a333ee
-0,         70,         70,        1,  2359296, 0xc6a333ee
-0,         71,         71,        1,  2359296, 0xc6a333ee
-0,         72,         72,        1,  2359296, 0xc6a333ee
-0,         73,         73,        1,  2359296, 0xb96d1583
-0,         74,         74,        1,  2359296, 0xb96d1583
-0,         75,         75,        1,  2359296, 0xb96d1583
-0,         76,         76,        1,  2359296, 0xb96d1583
-0,         77,         77,        1,  2359296, 0xb96d1583
-0,         78,         78,        1,  2359296, 0xb96d1583
-0,         79,         79,        1,  2359296, 0xb96d1583
-0,         80,         80,        1,  2359296, 0x878135ec
-0,         82,         82,        1,  2359296, 0x878135ec
-0,         83,         83,        1,  2359296, 0x878135ec
-0,         84,         84,        1,  2359296, 0x878135ec
-0,         85,         85,        1,  2359296, 0x878135ec
-0,         86,         86,        1,  2359296, 0x878135ec
-0,         87,         87,        1,  2359296, 0x878135ec
-0,         88,         88,        1,  2359296, 0x76922870
-0,         89,         89,        1,  2359296, 0x76922870
-0,         90,         90,        1,  2359296, 0x76922870
-0,         91,         91,        1,  2359296, 0x76922870
-0,         92,         92,        1,  2359296, 0x76922870
-0,         93,         93,        1,  2359296, 0x76922870
-0,         94,         94,        1,  2359296, 0x76922870
-0,         95,         95,        1,  2359296, 0xb0e031f0
-0,         96,         96,        1,  2359296, 0xb0e031f0
-0,         97,         97,        1,  2359296, 0xb0e031f0
-0,         98,         98,        1,  2359296, 0xb0e031f0
-0,         99,         99,        1,  2359296, 0xb0e031f0
-0,        100,        100,        1,  2359296, 0xb0e031f0
-0,        101,        101,        1,  2359296, 0xb0e031f0
-0,        102,        102,        1,  2359296, 0xb2ef2a6e
-0,        103,        103,        1,  2359296, 0xb2ef2a6e
-0,        104,        104,        1,  2359296, 0xb2ef2a6e
-0,        105,        105,        1,  2359296, 0x083c2474
-0,        106,        106,        1,  2359296, 0x083c2474
-0,        107,        107,        1,  2359296, 0x083c2474
-0,        108,        108,        1,  2359296, 0x083c2474
-0,        109,        109,        1,  2359296, 0xbdfe2ef3
-0,        110,        110,        1,  2359296, 0xbdfe2ef3
-0,        111,        111,        1,  2359296, 0xbdfe2ef3
-0,        112,        112,        1,  2359296, 0xbdfe2ef3
-0,        113,        113,        1,  2359296, 0xbdfe2ef3
-0,        114,        114,        1,  2359296, 0xbdfe2ef3
-0,        115,        115,        1,  2359296, 0xbdfe2ef3
-0,        116,        116,        1,  2359296, 0x934b1484
-0,        117,        117,        1,  2359296, 0x934b1484
-0,        118,        118,        1,  2359296, 0x934b1484
-0,        119,        119,        1,  2359296, 0x934b1484
-0,        120,        120,        1,  2359296, 0x3e0d1a7e
-0,        121,        121,        1,  2359296, 0x3e0d1a7e
-0,        122,        122,        1,  2359296, 0x3e0d1a7e
-0,        123,        123,        1,  2359296, 0x3ce539e8
-0,        124,        124,        1,  2359296, 0x3ce539e8
-0,        125,        125,        1,  2359296, 0x3ce539e8
-0,        126,        126,        1,  2359296, 0x3ce539e8
-0,        127,        127,        1,  2359296, 0x3ce539e8
-0,        128,        128,        1,  2359296, 0x3ce539e8
-0,        129,        129,        1,  2359296, 0x3ce539e8
-0,        130,        130,        1,  2359296, 0xd46c2f69
-0,        131,        131,        1,  2359296, 0xd46c2f69
-0,        132,        132,        1,  2359296, 0xd46c2f69
-0,        133,        133,        1,  2359296, 0xd46c2f69
-0,        134,        134,        1,  2359296, 0xd46c2f69
-0,        135,        135,        1,  2359296, 0xd46c2f69
-0,        136,        136,        1,  2359296, 0xd46c2f69
-0,        137,        137,        1,  2359296, 0x8d2933ee
-0,        138,        138,        1,  2359296, 0x8d2933ee
-0,        139,        139,        1,  2359296, 0x8d2933ee
-0,        140,        140,        1,  2359296, 0x8d2933ee
-0,        141,        141,        1,  2359296, 0x8d2933ee
-0,        142,        142,        1,  2359296, 0x8d2933ee
-0,        143,        143,        1,  2359296, 0x8d2933ee
-0,        144,        144,        1,  2359296, 0xb6092b6d
-0,        145,        145,        1,  2359296, 0xb6092b6d
-0,        146,        146,        1,  2359296, 0xb6092b6d
-0,        147,        147,        1,  2359296, 0xb6092b6d
-0,        148,        148,        1,  2359296, 0xb6092b6d
-0,        149,        149,        1,  2359296, 0xb6092b6d
-0,        150,        150,        1,  2359296, 0xb6092b6d
-0,        151,        151,        1,  2359296, 0xe4ef27fa
-0,        152,        152,        1,  2359296, 0xe4ef27fa
-0,        153,        153,        1,  2359296, 0xe4ef27fa
-0,        154,        154,        1,  2359296, 0xe4ef27fa
-0,        155,        155,        1,  2359296, 0xe4ef27fa
-0,        156,        156,        1,  2359296, 0xe4ef27fa
-0,        157,        157,        1,  2359296, 0xe4ef27fa
-0,        158,        158,        1,  2359296, 0x5e5b2672
-0,        159,        159,        1,  2359296, 0x5e5b2672
diff --git a/deps/libav/tests/ref/fate/tscc2 b/deps/libav/tests/ref/fate/tscc2
deleted file mode 100644
index ad71b82..0000000
--- a/deps/libav/tests/ref/fate/tscc2
+++ /dev/null
@@ -1,33 +0,0 @@
-#tb 0: 1/24
-0,          0,          0,        1,   230400, 0x7a2103c0
-0,          1,          1,        1,   230400, 0xd381c279
-0,          2,          2,        1,   230400, 0xd381c279
-0,          3,          3,        1,   230400, 0x110aec27
-0,          4,          4,        1,   230400, 0x4be67ee7
-0,          5,          5,        1,   230400, 0xd87fe4b4
-0,          6,          6,        1,   230400, 0xd87fe4b4
-0,          7,          7,        1,   230400, 0x9bc6a398
-0,          8,          8,        1,   230400, 0xd67d92db
-0,          9,          9,        1,   230400, 0x3df6559e
-0,         10,         10,        1,   230400, 0x3df6559e
-0,         11,         11,        1,   230400, 0x2136ff25
-0,         12,         12,        1,   230400, 0x94573fe6
-0,         13,         13,        1,   230400, 0xbf67d3f5
-0,         14,         14,        1,   230400, 0xbf67d3f5
-0,         15,         15,        1,   230400, 0x2592b5cf
-0,         16,         16,        1,   230400, 0x5b23cd93
-0,         17,         17,        1,   230400, 0x9b76d079
-0,         18,         18,        1,   230400, 0x9b76d079
-0,         19,         19,        1,   230400, 0x771a017e
-0,         20,         20,        1,   230400, 0xacfee1d0
-0,         21,         21,        1,   230400, 0x6b9ff4eb
-0,         22,         22,        1,   230400, 0x6b9ff4eb
-0,         23,         23,        1,   230400, 0xbaf643e1
-0,         24,         24,        1,   230400, 0x052efe59
-0,         25,         25,        1,   230400, 0xd751f901
-0,         26,         26,        1,   230400, 0xd751f901
-0,         27,         27,        1,   230400, 0x6f94e11f
-0,         28,         28,        1,   230400, 0x17eeabb9
-0,         29,         29,        1,   230400, 0x3733a035
-0,         30,         30,        1,   230400, 0x3733a035
-0,         31,         31,        1,   230400, 0xb0829f45
diff --git a/deps/libav/tests/ref/fate/txd-16bpp b/deps/libav/tests/ref/fate/txd-16bpp
deleted file mode 100644
index 3a23c0b..0000000
--- a/deps/libav/tests/ref/fate/txd-16bpp
+++ /dev/null
@@ -1,12 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,        0,    16384, 0x213f9ea8
-0,      18000,      18000,        0,    16384, 0x8185fdb1
-0,      36000,      36000,        0,    16384, 0xf03581d1
-0,      54000,      54000,        0,    16384, 0x629cd573
-0,      72000,      72000,        0,    16384, 0xfe7a5b63
-0,      90000,      90000,        0,    16384, 0x4afc05b2
-0,     108000,     108000,        0,    16384, 0x074b8515
-0,     126000,     126000,        0,    16384, 0x17fde900
-0,     144000,     144000,        0,    16384, 0x831bac76
-0,     162000,     162000,        0,    16384, 0x2fb579f3
-0,     180000,     180000,        0,    16384, 0x68762bed
diff --git a/deps/libav/tests/ref/fate/txd-pal8 b/deps/libav/tests/ref/fate/txd-pal8
deleted file mode 100644
index 3f0aab2..0000000
--- a/deps/libav/tests/ref/fate/txd-pal8
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/90000
-0,          0,          0,        0,   786432, 0x56654d61
diff --git a/deps/libav/tests/ref/fate/ulti b/deps/libav/tests/ref/fate/ulti
deleted file mode 100644
index 4e9968b..0000000
--- a/deps/libav/tests/ref/fate/ulti
+++ /dev/null
@@ -1,63 +0,0 @@
-#tb 0: 1/12
-0,          0,          0,        1,    86400, 0x5d58253d
-0,          1,          1,        1,    86400, 0x0626d90d
-0,          2,          2,        1,    86400, 0x4ecb5048
-0,          3,          3,        1,    86400, 0xf54ea8f7
-0,          4,          4,        1,    86400, 0xa777c21b
-0,          5,          5,        1,    86400, 0x7d71e329
-0,          6,          6,        1,    86400, 0x2903252a
-0,          7,          7,        1,    86400, 0xbe7302c1
-0,          8,          8,        1,    86400, 0x734423a8
-0,          9,          9,        1,    86400, 0x4f422bab
-0,         10,         10,        1,    86400, 0x21fbf200
-0,         11,         11,        1,    86400, 0xabf299a7
-0,         12,         12,        1,    86400, 0x400b4bf8
-0,         13,         13,        1,    86400, 0x61d044f9
-0,         14,         14,        1,    86400, 0x72fb94af
-0,         15,         15,        1,    86400, 0xf522e717
-0,         16,         16,        1,    86400, 0xad3e0297
-0,         17,         17,        1,    86400, 0xbef57a5f
-0,         18,         18,        1,    86400, 0x450ca6e7
-0,         19,         19,        1,    86400, 0x76ae56e6
-0,         20,         20,        1,    86400, 0x7b9b7555
-0,         21,         21,        1,    86400, 0xb522ce0d
-0,         22,         22,        1,    86400, 0xaa9b8536
-0,         23,         23,        1,    86400, 0x019d00c4
-0,         24,         24,        1,    86400, 0xb0f4dee5
-0,         25,         25,        1,    86400, 0xa7482e52
-0,         26,         26,        1,    86400, 0x3c87fc35
-0,         27,         27,        1,    86400, 0xb6d1dede
-0,         28,         28,        1,    86400, 0x926ee647
-0,         29,         29,        1,    86400, 0x8747bfc7
-0,         30,         30,        1,    86400, 0x61569e9b
-0,         31,         31,        1,    86400, 0x9209a5f6
-0,         32,         32,        1,    86400, 0x5f89ef12
-0,         33,         33,        1,    86400, 0x00bfc18f
-0,         34,         34,        1,    86400, 0xcc6f2f62
-0,         35,         35,        1,    86400, 0x3ab9cfbf
-0,         36,         36,        1,    86400, 0x936f2386
-0,         37,         37,        1,    86400, 0x2203a76c
-0,         38,         38,        1,    86400, 0xd3d248a3
-0,         39,         39,        1,    86400, 0x148af7b8
-0,         40,         40,        1,    86400, 0x437bffae
-0,         41,         41,        1,    86400, 0x6876c6d5
-0,         42,         42,        1,    86400, 0x49fc1429
-0,         43,         43,        1,    86400, 0x181efd2c
-0,         44,         44,        1,    86400, 0x26ecd294
-0,         45,         45,        1,    86400, 0xdcdb609e
-0,         46,         46,        1,    86400, 0xd3cb0ecb
-0,         47,         47,        1,    86400, 0x528ffc4b
-0,         48,         48,        1,    86400, 0xb536c7b4
-0,         49,         49,        1,    86400, 0xae4ab8c5
-0,         50,         50,        1,    86400, 0xe14fee77
-0,         51,         51,        1,    86400, 0xcd3e9e85
-0,         52,         52,        1,    86400, 0x71cfba54
-0,         53,         53,        1,    86400, 0x9b309c62
-0,         54,         54,        1,    86400, 0x91b31881
-0,         55,         55,        1,    86400, 0xae8bda28
-0,         56,         56,        1,    86400, 0x8db0f87a
-0,         57,         57,        1,    86400, 0xcd974e98
-0,         58,         58,        1,    86400, 0x4405116e
-0,         59,         59,        1,    86400, 0xfe4cc7b4
-0,         60,         60,        1,    86400, 0x17d27206
-0,         61,         61,        1,    86400, 0x11743762
diff --git a/deps/libav/tests/ref/fate/url b/deps/libav/tests/ref/fate/url
deleted file mode 100644
index 1a6051e..0000000
--- a/deps/libav/tests/ref/fate/url
+++ /dev/null
@@ -1,13 +0,0 @@
-baz
-/foo/baz
-/baz
-/baz
-http://server/foo/baz
-http://server/foo/baz
-http://server/baz
-http://server/baz
-http://server/baz
-https://other/url
-http://server/baz
-http://server/foo/bar?someparam
-http://other/url
diff --git a/deps/libav/tests/ref/fate/utvideo_rgb_left b/deps/libav/tests/ref/fate/utvideo_rgb_left
deleted file mode 100644
index d19a6b1..0000000
--- a/deps/libav/tests/ref/fate/utvideo_rgb_left
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,   921600, 0x27e6001e
-0,          1,          1,        1,   921600, 0x7c0a92bc
-0,          2,          2,        1,   921600, 0x4d2be42c
-0,          3,          3,        1,   921600, 0x58ddd0be
diff --git a/deps/libav/tests/ref/fate/utvideo_rgb_median b/deps/libav/tests/ref/fate/utvideo_rgb_median
deleted file mode 100644
index f041285..0000000
--- a/deps/libav/tests/ref/fate/utvideo_rgb_median
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,   921600, 0x9776611f
-0,          1,          1,        1,   921600, 0xdbfa64f4
-0,          2,          2,        1,   921600, 0xed2a0580
-0,          3,          3,        1,   921600, 0x6ecc80bc
-0,          4,          4,        1,   921600, 0x58ddd0be
diff --git a/deps/libav/tests/ref/fate/utvideo_rgba_left b/deps/libav/tests/ref/fate/utvideo_rgba_left
deleted file mode 100644
index a7e0ed4..0000000
--- a/deps/libav/tests/ref/fate/utvideo_rgba_left
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,  1228800, 0xf1bc9432
-0,          1,          1,        1,  1228800, 0x8480d1e5
-0,          2,          2,        1,  1228800, 0xb01d5fb2
-0,          3,          3,        1,  1228800, 0x53cb42c4
-0,          4,          4,        1,  1228800, 0x2b2ea176
diff --git a/deps/libav/tests/ref/fate/utvideo_rgba_median b/deps/libav/tests/ref/fate/utvideo_rgba_median
deleted file mode 100644
index a7e0ed4..0000000
--- a/deps/libav/tests/ref/fate/utvideo_rgba_median
+++ /dev/null
@@ -1,6 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,  1228800, 0xf1bc9432
-0,          1,          1,        1,  1228800, 0x8480d1e5
-0,          2,          2,        1,  1228800, 0xb01d5fb2
-0,          3,          3,        1,  1228800, 0x53cb42c4
-0,          4,          4,        1,  1228800, 0x2b2ea176
diff --git a/deps/libav/tests/ref/fate/utvideo_rgba_single_symbol b/deps/libav/tests/ref/fate/utvideo_rgba_single_symbol
deleted file mode 100644
index c0e0d98..0000000
--- a/deps/libav/tests/ref/fate/utvideo_rgba_single_symbol
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/24
-0,          0,          0,        1,  3145728, 0xac95c593
diff --git a/deps/libav/tests/ref/fate/utvideo_yuv420_left b/deps/libav/tests/ref/fate/utvideo_yuv420_left
deleted file mode 100644
index 026f8fb..0000000
--- a/deps/libav/tests/ref/fate/utvideo_yuv420_left
+++ /dev/null
@@ -1,8 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,   460800, 0xece98fc8
-0,          1,          1,        1,   460800, 0x9baf786b
-0,          2,          2,        1,   460800, 0x8e8e0510
-0,          3,          3,        1,   460800, 0x27c1f2ba
-0,          4,          4,        1,   460800, 0x6a817987
-0,          5,          5,        1,   460800, 0x2f713ec2
-0,          6,          6,        1,   460800, 0x003b560e
diff --git a/deps/libav/tests/ref/fate/utvideo_yuv420_median b/deps/libav/tests/ref/fate/utvideo_yuv420_median
deleted file mode 100644
index 5662d8c..0000000
--- a/deps/libav/tests/ref/fate/utvideo_yuv420_median
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,   460800, 0x6a817987
-0,          1,          1,        1,   460800, 0x2f713ec2
-0,          2,          2,        1,   460800, 0x003b560e
-0,          3,          3,        1,   460800, 0x9e1bbf63
diff --git a/deps/libav/tests/ref/fate/utvideo_yuv422_left b/deps/libav/tests/ref/fate/utvideo_yuv422_left
deleted file mode 100644
index 438b32a..0000000
--- a/deps/libav/tests/ref/fate/utvideo_yuv422_left
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,   614400, 0x9a6b8802
-0,          1,          1,        1,   614400, 0xaa8687e2
-0,          2,          2,        1,   614400, 0x2fe5bd40
-0,          3,          3,        1,   614400, 0x1c8f3737
diff --git a/deps/libav/tests/ref/fate/utvideo_yuv422_median b/deps/libav/tests/ref/fate/utvideo_yuv422_median
deleted file mode 100644
index 438b32a..0000000
--- a/deps/libav/tests/ref/fate/utvideo_yuv422_median
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,   614400, 0x9a6b8802
-0,          1,          1,        1,   614400, 0xaa8687e2
-0,          2,          2,        1,   614400, 0x2fe5bd40
-0,          3,          3,        1,   614400, 0x1c8f3737
diff --git a/deps/libav/tests/ref/fate/utvideoenc_rgb_left b/deps/libav/tests/ref/fate/utvideoenc_rgb_left
deleted file mode 100644
index 99d1182..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_rgb_left
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   182328, cd084b244939d7e0008d8e5ab3429dc1
-0,          1,          1,        1,   182336, c9c40672750f372134185901147fb776
-0,          2,          2,        1,   182956, c728911ca73225f2dc7453533c9be95e
-0,          3,          3,        1,   182384, 54521f709b461a25198db755bce582fa
-0,          4,          4,        1,   181704, 5e03ab58b4480a6613f54857f10c39e5
-0,          5,          5,        1,   182136, c623fb06b90fdd7a5ba0b4f217b6a388
-0,          6,          6,        1,   181552, 5d03be9dfc01ad99364fc3cc8378af72
-0,          7,          7,        1,   182292, fc90878278c82b2f835151dc6d43dd47
-0,          8,          8,        1,   181424, 9b6339a0d3af2d3034162183cd4d79e4
-0,          9,          9,        1,   182316, 7e45bb5ffe57f98a433420abaffe78cc
-0,         10,         10,        1,   182064, d9525605a7d7d75a8e33502f61733af1
-0,         11,         11,        1,   182596, 62e87fa5c33a8d208deaa8719682b9a5
-0,         12,         12,        1,   180900, 149059d3d56c55358c7044c7d569730f
-0,         13,         13,        1,   181920, 0d20f588c27471a038e159a131e9c8ea
-0,         14,         14,        1,   182824, a301a411ff11042ecb583e1e3b12dbda
-0,         15,         15,        1,   182452, 0ee2a9ed39fb8569a8d6c2b3afb8f80a
-0,         16,         16,        1,   182312, 68dd3b820adf2cbc6686a7d48fa22c6e
-0,         17,         17,        1,   181856, 1897926cfe9b7acaf9c21714c449ce41
-0,         18,         18,        1,   181108, 15d2af460733fdd896078632cdfef9fd
-0,         19,         19,        1,   181388, 8b8e7a4b7d355f41f7e836120c4792ac
-0,         20,         20,        1,   180936, e18e27aa027f2470bfa95c536a0a89af
-0,         21,         21,        1,   180900, eb663ae3c5ffa8e751280e0dbb260e02
-0,         22,         22,        1,   181936, 7514bbe06cee027f54710dc900297863
-0,         23,         23,        1,   182304, 8cb2dcdbd4c919b4c977f45bee46c54c
-0,         24,         24,        1,   182580, 9185ed53b7e8339b61d3abe230bbab71
-0,         25,         25,        1,   182572, 81f8bdd3255b91d6621e9ebd3c9d7679
-0,         26,         26,        1,   182356, 1f9ff40700881054c62e33acde06910d
-0,         27,         27,        1,   181532, 10d2477aa1e319a61e517d25fd6c95d0
-0,         28,         28,        1,   179580, 3012480c43d15866ccc4a81d56650ee2
-0,         29,         29,        1,   179528, 5e0fbd62a164dc72cf511023da792175
-0,         30,         30,        1,   180760, 679f430c86dca203456f532e978dffc2
-0,         31,         31,        1,   181564, 64d31faf01cb7b52d7d7e20280e6652b
-0,         32,         32,        1,   181428, 04961d71aa3c81b33d28b39ead20ee1d
-0,         33,         33,        1,   182980, 51361c802005721002f5f4924f081708
-0,         34,         34,        1,   182624, 67c5582c45e3ee7e6aca49fdc0a980b8
-0,         35,         35,        1,   182352, 4fade9db12f2d6ce633556fdb8914971
-0,         36,         36,        1,   181336, ac8fbab67b36d58c4e8374bfb07458e7
-0,         37,         37,        1,   181528, f798157b6d4d04c767ecb76346922ddc
-0,         38,         38,        1,   179776, 01d407ed0b86eeb2c3ee3c24dd452d8d
-0,         39,         39,        1,   180100, 062e4af150100d7accf86a907a4b99b5
-0,         40,         40,        1,   180228, 23c617b76ef8f274bd089016fb8516c7
-0,         41,         41,        1,   180592, 55f538ae5e44b60209138b7536d5c199
-0,         42,         42,        1,   181188, d39d52f5b690661434b1abd8717b3e30
-0,         43,         43,        1,   181300, 9e202444287234bafd103fab83b1a974
-0,         44,         44,        1,   180812, 602165271de71594132cce98af56a7b2
-0,         45,         45,        1,   178816, c427d67196f43ece6bf3855e1256d7bb
-0,         46,         46,        1,   178196, 0d05902e2870a85333a216c723077e98
-0,         47,         47,        1,   178772, 57f528eb984b5b7181c89b48b58271f3
-0,         48,         48,        1,   178652, 5cd1031b0ada3ba9c2d4c2f2b7c8e277
-0,         49,         49,        1,   178512, d3c0c84fc63f1e32a4a026e2cd39b161
diff --git a/deps/libav/tests/ref/fate/utvideoenc_rgb_median b/deps/libav/tests/ref/fate/utvideoenc_rgb_median
deleted file mode 100644
index 5983ddf..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_rgb_median
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   182160, abcf4f477f74b696faca2fcff1f62aa9
-0,          1,          1,        1,   182104, 7cbcf339fa40c24522067295b39d637f
-0,          2,          2,        1,   183108, dfc2c418f4379a89654c16b34ff19446
-0,          3,          3,        1,   182320, 62a4647b05709d86c51a18be16877e98
-0,          4,          4,        1,   181920, 61d63520703503f6e17fad67cbc08794
-0,          5,          5,        1,   182424, f467638396feabe613b3c851289452d8
-0,          6,          6,        1,   182248, 8a0cba950d6c5d63ba9603212ca95b0e
-0,          7,          7,        1,   181876, 91432f472cf373d5d4036bd100950f3e
-0,          8,          8,        1,   182104, 1c8852d82a48c1b01911ffbedf0ac1f4
-0,          9,          9,        1,   182540, f36b9d48123b55f2141ae10dd26e1ca0
-0,         10,         10,        1,   182120, e6ecdb9af6591916153ca9aeba76b9d0
-0,         11,         11,        1,   182136, 7dc7b828a5b7c652df612474fad66f6b
-0,         12,         12,        1,   181296, 347eac6563435a62f75298cefe13d3a6
-0,         13,         13,        1,   182136, 3bbcd8afacdf9549da9ebd736df548a7
-0,         14,         14,        1,   182412, 17f8c6ef692b4085624ce1ef7efbc963
-0,         15,         15,        1,   182732, 9212760fa11fe4fa193ba1aa259e9765
-0,         16,         16,        1,   181944, 7dd6d6a7084f97a77ec09ec6c62f0ab8
-0,         17,         17,        1,   182232, 518552687d47ae93726679f0ed962ef4
-0,         18,         18,        1,   181512, 29a66924742add13a0cae65d93d38ea9
-0,         19,         19,        1,   181424, 67c965637248333f92da9d493bf7546e
-0,         20,         20,        1,   180764, 298457c6c2b3f4ebcda87a12579f094d
-0,         21,         21,        1,   181072, 493ea592b7d59eebf01c002e7e22fc43
-0,         22,         22,        1,   181160, e30195fcc16ecfbb9348943cff01623f
-0,         23,         23,        1,   182156, d26cfac33e19b4ca11210c9e6cb91955
-0,         24,         24,        1,   182260, 963c157d3f0023b49d23099d53d60c8b
-0,         25,         25,        1,   181976, 2494d481bf2be97692eaeda95f279b0d
-0,         26,         26,        1,   181832, f1be95c840d4fcb0c8d4b7aed5b197c5
-0,         27,         27,        1,   181424, 03d92e89358a8b9b9e7cf302edde307e
-0,         28,         28,        1,   180632, 09f9e162fdaf28342c442172179a75c9
-0,         29,         29,        1,   180624, 481e7f7730ab3ba67c06faa620a8bd5e
-0,         30,         30,        1,   181024, 7a1d1b06b73d2bf41563eb749805780c
-0,         31,         31,        1,   181844, 8a6ce6dd6f79e423a3bb6c2b163adc55
-0,         32,         32,        1,   181712, a68007bbdf0169c9ed2dffae3dc63221
-0,         33,         33,        1,   182008, f37dd0635de369761e2de979ee799c3a
-0,         34,         34,        1,   181800, 14029ba1c364eca476559ce553919e99
-0,         35,         35,        1,   181840, ee227d15f15c3cd564dcad2160453fb7
-0,         36,         36,        1,   181848, 13b5d0892cc76a25b4914f2d706a0ad5
-0,         37,         37,        1,   181976, 1a0be9f2cefe0d867c5c03d6b3987ad8
-0,         38,         38,        1,   181216, 79795d735f9e0f92091203bf8b9eb9ed
-0,         39,         39,        1,   181236, 2d006c8c4ba448ca7841df76e44ffa88
-0,         40,         40,        1,   180672, ed5210abdae49042fcae9bde2f65a057
-0,         41,         41,        1,   181324, fbbc7839c595cd0f0efc0917edfed2c3
-0,         42,         42,        1,   180980, c6120b5a9440f4a0d83731627eb96d98
-0,         43,         43,        1,   181204, ac4371912d16f657c90e8a00cfafdfd2
-0,         44,         44,        1,   180720, d392d95c67349296d922dbf53ec3f832
-0,         45,         45,        1,   180028, 37a2717fbd5aaeb128812298484f8267
-0,         46,         46,        1,   179704, e8716f4856e4ccdc541632a218894f62
-0,         47,         47,        1,   179648, e99cbe5d1bbd7bce241ae500b4de06c2
-0,         48,         48,        1,   179424, 6f8a5e356fb77b61d9dfcabdf97340b9
-0,         49,         49,        1,   178980, 75a7700b822236b0ecb169fd692910f1
diff --git a/deps/libav/tests/ref/fate/utvideoenc_rgb_none b/deps/libav/tests/ref/fate/utvideoenc_rgb_none
deleted file mode 100644
index d6c6962..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_rgb_none
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   301052, 8645cb98470205cceea3c2026223b69f
-0,          1,          1,        1,   301068, 9123c3c31ac0bc0832bb07e8c6d5b372
-0,          2,          2,        1,   300840, 394aa034eba2b306efa8171efc5fb960
-0,          3,          3,        1,   300904, 1abc4512d268bb7bb4b9f467aa19e5a8
-0,          4,          4,        1,   300912, e117d6f8d2bbd89bdce86cd5c4cf6206
-0,          5,          5,        1,   300936, d6a6c100e6dfd0e4dcdaa67ec59a757a
-0,          6,          6,        1,   300944, 3a0bf05461965bf2e538f5ed1067e784
-0,          7,          7,        1,   301044, 66e2fef970e8d997bb52f28eed9ad6fe
-0,          8,          8,        1,   301076, 6ae8f26125255c46be8c6da07d21ba35
-0,          9,          9,        1,   301044, 024d41f9d3b217b58ad6ba2a8f3b680d
-0,         10,         10,        1,   300944, 5dc0387f32b68e365c467f9dcc62b923
-0,         11,         11,        1,   300912, 47db16c6118feb2143fe0d1ec909bb51
-0,         12,         12,        1,   301044, 7161af85d2c85529b83548a701c6f5b7
-0,         13,         13,        1,   300964, 2dd90b4edcfc8d2b84168f42c7a47785
-0,         14,         14,        1,   300868, 76b296949227e7b22f204bec90dd02af
-0,         15,         15,        1,   300880, 44f9c830be2c9efdda335bf774f3b6c6
-0,         16,         16,        1,   301020, 70c1883ae4ff2ae8b0d5a608a75c839c
-0,         17,         17,        1,   301072, bac10cb932595594e4e8146831bbe00b
-0,         18,         18,        1,   301192, 46c2aa31dc33baa4d37f71f9873cbe6f
-0,         19,         19,        1,   301224, 396c406acf79cbe79c064ccbe7a3b648
-0,         20,         20,        1,   301180, 8d5d2071ddc79335f6785a921851905e
-0,         21,         21,        1,   301180, 9767bc30cadd23f0625e665e9b70ac31
-0,         22,         22,        1,   301116, fba702e0ab727d9446a7796790a10545
-0,         23,         23,        1,   301060, 9a08113dd947874b57d4cc85d56343ca
-0,         24,         24,        1,   301128, a58b1ebeb28fac3c88f64c8ba15f0591
-0,         25,         25,        1,   301144, e071b28b961f8d9c5da9b1ff41c24c2a
-0,         26,         26,        1,   301088, d19bed9054db25a718724d746d22c800
-0,         27,         27,        1,   301232, 70b2832bb0eb5f8a74e0bee411f66a46
-0,         28,         28,        1,   301152, 470bd72096d3ef6b5490b03cfdea438d
-0,         29,         29,        1,   301224, f3c285eb28a3c5b820276d3a68976df4
-0,         30,         30,        1,   301224, a432bfc1e022f189a70cbc963d716596
-0,         31,         31,        1,   301160, fbde0ac1bb6e5dbd870c1c6d8f03190c
-0,         32,         32,        1,   301120, 61f251db3d73483206609718063cfbb9
-0,         33,         33,        1,   301096, 6c1908eac263c8c3368683ced8078da4
-0,         34,         34,        1,   301000, 4b8df4fa83c085ea36369dbdd37f58bd
-0,         35,         35,        1,   301152, e2ceb9ff6b72b815e4b511a85dc0ae38
-0,         36,         36,        1,   301232, 27cc508ff5081f9c901c4eabd62e5835
-0,         37,         37,        1,   301228, bdb62b975b1cfe4ba8be08be1e8b1a5e
-0,         38,         38,        1,   301296, 13fc07f3935b70e98922233cf81bc7a4
-0,         39,         39,        1,   301296, 5fe19496257987b809e56e3c11192c43
-0,         40,         40,        1,   301308, a86115cd10e74c795739e8e325403ac6
-0,         41,         41,        1,   301268, 6c1f7bbf077ff58486f256e2ce9d01e6
-0,         42,         42,        1,   301344, 3fda739956dfa07a15cc5bd7e054568d
-0,         43,         43,        1,   301308, 54584061bcce46feb19aafa37922f923
-0,         44,         44,        1,   301292, 092e08d230dcfe4abd1460ef26c31421
-0,         45,         45,        1,   301344, 39ca46f9f38434aee15660263921f392
-0,         46,         46,        1,   301432, f7b76bebcfc614537c20bd6b20096d78
-0,         47,         47,        1,   301440, 86c97147d03bf7aee71073127c7fad32
-0,         48,         48,        1,   301460, 3fdbe5ae0b7e6b7ec0bc5668ba50a491
-0,         49,         49,        1,   301444, 8ef2e62af67f91e886b8f25456b38869
diff --git a/deps/libav/tests/ref/fate/utvideoenc_rgba_left b/deps/libav/tests/ref/fate/utvideoenc_rgba_left
deleted file mode 100644
index 757febe..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_rgba_left
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   195264, 5869dee2126d98ecc1fab1e69720906a
-0,          1,          1,        1,   195272, 1bd08dcde1061b0d9273bdc6dd901382
-0,          2,          2,        1,   195892, 2b3fc3632bcd1cc44f777fb97a56f79b
-0,          3,          3,        1,   195320, 792870fc50a4145ad561b1004a8b6451
-0,          4,          4,        1,   194640, c3d4031c46d6dc64e632e2d38b48fc96
-0,          5,          5,        1,   195072, 27e4b09e7f8446a8dd8dd7dcbc578e2b
-0,          6,          6,        1,   194488, e44441beb8d3e358112e2776a0116ea9
-0,          7,          7,        1,   195228, 0519afd694512aea2c839fe0456e518c
-0,          8,          8,        1,   194360, 7296944c86296fb256188975db6e5620
-0,          9,          9,        1,   195252, 40b53999a36ce413256c7a81c3aa0c44
-0,         10,         10,        1,   195000, 925fe520c460f94ae7a05cf0e6cf8dd8
-0,         11,         11,        1,   195532, af417aac106af9b4e8c04cf1a84d3bd8
-0,         12,         12,        1,   193836, 0eadf04f475a93ebef3979d32c13ee92
-0,         13,         13,        1,   194856, 5814ff44b233d68e4c991703c0fa6f44
-0,         14,         14,        1,   195760, e9a66bbeadeab4ed3f34296346eafc27
-0,         15,         15,        1,   195388, 17d33cd676c8b464d1b97ce0f0234716
-0,         16,         16,        1,   195248, 1054b945cd6e11e70d8b348e540e4dd5
-0,         17,         17,        1,   194792, f0a6ceee9014f6cf8a999f344897ad3e
-0,         18,         18,        1,   194044, 4fbf2b9fd8b7e8233f65b5bf61e326c0
-0,         19,         19,        1,   194324, eb90b72edafab7bbe5e9ff561313927c
-0,         20,         20,        1,   193872, 6ebc973b9f66e1ebdb3029f1aadd9a24
-0,         21,         21,        1,   193836, cde713fba6bede0361779c45f7a6d80b
-0,         22,         22,        1,   194872, 64225b7d92c8371ed0335d7693902f60
-0,         23,         23,        1,   195240, b11e0b10b4e713caffec706d952edb7b
-0,         24,         24,        1,   195516, 932244aee01b068f1bfb5132f092675b
-0,         25,         25,        1,   195508, 2745faafa2ec34dcf2cec2f5f791f49b
-0,         26,         26,        1,   195292, 6ff67783eabad9c72b146d510ffa0b7e
-0,         27,         27,        1,   194468, cc5aa248fe507ac3fbb839b9388856bc
-0,         28,         28,        1,   192516, 13063bb195380953743ab24a73ff6ddd
-0,         29,         29,        1,   192464, a391b0d795b2f565cc3e351975fb528d
-0,         30,         30,        1,   193696, 4239c695d1b9eaa44c2d037a9c39da20
-0,         31,         31,        1,   194500, 5857b4c4cc86a9a0f38d833c236e396c
-0,         32,         32,        1,   194364, ad0eeec7622c76bd996deac7e99390e5
-0,         33,         33,        1,   195916, b98da9283eef85f6dffe308774161441
-0,         34,         34,        1,   195560, 32f924fc40bb777c951481b623a8f46b
-0,         35,         35,        1,   195288, 96a7bb386420902fbb98b8267d4496ca
-0,         36,         36,        1,   194272, 98b88d6092708ffff416417d8f628477
-0,         37,         37,        1,   194464, 3c8295490b77415c2e4ebb7ce9b8cc53
-0,         38,         38,        1,   192712, 17798a13ba5f82939d98dfd619a68e18
-0,         39,         39,        1,   193036, b92ab54b363c1bd29042feeb3b9f5631
-0,         40,         40,        1,   193164, a971b68bb49148afdf510be5f5793933
-0,         41,         41,        1,   193528, 6fbf07d240e0073e57d295bdd0d32465
-0,         42,         42,        1,   194124, 4b1ddea464b8e40da48418e77b4fdf7a
-0,         43,         43,        1,   194236, d46914a9e2bdda30bf84b3282924bb3d
-0,         44,         44,        1,   193748, 3d4587081c6d73366d85e5df42c87810
-0,         45,         45,        1,   191752, 996274b3852ac6af30db8f9e242895e0
-0,         46,         46,        1,   191132, 5a1e47e4d1cc9e18e94041b4357a5de4
-0,         47,         47,        1,   191708, e3048c5ba2b9a494791cad3cbf843780
-0,         48,         48,        1,   191588, dbc63170a9b7be348497162c42a1b9f1
-0,         49,         49,        1,   191448, db923a15f424e69bbf8c8af2a2f7e157
diff --git a/deps/libav/tests/ref/fate/utvideoenc_rgba_median b/deps/libav/tests/ref/fate/utvideoenc_rgba_median
deleted file mode 100644
index 1198a33..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_rgba_median
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   195096, 29ad3287ab4d7f4d46968c6d38ba049b
-0,          1,          1,        1,   195040, 2c7b4f5f0aee96dca6dc30ce01b3c74d
-0,          2,          2,        1,   196044, 7ffc6ab3c4a2eee436ef6a59c72ffb04
-0,          3,          3,        1,   195256, f4453470d77c246cbb30d00c13512359
-0,          4,          4,        1,   194856, b84c4d56bf28033db539e4e0cad3d342
-0,          5,          5,        1,   195360, d2d3371b96f679f9b7c62d98b5d54af9
-0,          6,          6,        1,   195184, 8e3782bc12b24023a5899eb4806ffed6
-0,          7,          7,        1,   194812, 4fcf24a0660606304c58c93db2baf7de
-0,          8,          8,        1,   195040, 6ab57a9dcb4c99df7848a0971335a6b4
-0,          9,          9,        1,   195476, 66a3d66c3dc2f5b0847266a21927fa77
-0,         10,         10,        1,   195056, 530b251a8497af21bc56cd73af5c7ddf
-0,         11,         11,        1,   195072, 2904d24eca3db9734ed78dc8d557a334
-0,         12,         12,        1,   194232, 97566b596b113bf94a12ee1c02058a95
-0,         13,         13,        1,   195072, dceefd5df6efc5fefc8cfa1543b1a20e
-0,         14,         14,        1,   195348, d5b75f298fa6d474435333467b3497ae
-0,         15,         15,        1,   195668, 519f63be313f311cbb3fb48970a19f15
-0,         16,         16,        1,   194880, ab2da22767f540f8adea7e43dd6c1d0c
-0,         17,         17,        1,   195168, 667b85c19dd2d8ae105594f1294297b9
-0,         18,         18,        1,   194448, 575bc4b46f6158e76e503e8028902aaa
-0,         19,         19,        1,   194360, 851acbaf04c464689c8e2c4af3b9ed14
-0,         20,         20,        1,   193700, 1a477e0d665dcd088da6edeef77f21b1
-0,         21,         21,        1,   194008, b0d752c2201235e51ba0bbb59046fa60
-0,         22,         22,        1,   194096, 099df2b23c41ee54a6bd11aa6c92c390
-0,         23,         23,        1,   195092, e4d4dc89b8afba245355cec57ddcae40
-0,         24,         24,        1,   195196, 070c27e0499cf0210d729242ebc1a24e
-0,         25,         25,        1,   194912, 0fb78b7892035ecbec6ee9be6a13831c
-0,         26,         26,        1,   194768, 3ff6a05e68d6e33eeea22232e71bdf9a
-0,         27,         27,        1,   194360, 3828288e90a780d0c338ba5ab046aaa5
-0,         28,         28,        1,   193568, 60afb0ae9e6cbc9d8e4081764de7b4e6
-0,         29,         29,        1,   193560, 6b22fcfce4bff96b2afcb891f4fa9cf3
-0,         30,         30,        1,   193960, cae9eddb4464627fdc4413c3b5159575
-0,         31,         31,        1,   194780, 9e3d730fb835d3acaf92b7be368ea89e
-0,         32,         32,        1,   194648, 1ac7f5ae1b392ee8630266317a1818df
-0,         33,         33,        1,   194944, 374142509500017bbc29e157569bca2f
-0,         34,         34,        1,   194736, 0072a43b8de988683340c81e5bd4dba6
-0,         35,         35,        1,   194776, d5add7706f49a6a2f8d6bf3ed0ce3410
-0,         36,         36,        1,   194784, 7a1d38bc73fd293afef5fbcf9d34decd
-0,         37,         37,        1,   194912, 695e2d4c5d613245d591ae58100323bd
-0,         38,         38,        1,   194152, d4c9adb4f6340bc5f10b5b13f71d07bd
-0,         39,         39,        1,   194172, 0c7419c5c550e784e01a8c9927ecf59a
-0,         40,         40,        1,   193608, 4abff529172476d76c2956179041b2e4
-0,         41,         41,        1,   194260, dfa07971b01032b6a653d0d6715ffa8c
-0,         42,         42,        1,   193916, 6ffe1e68c74d51ea0cba0ede10b0f6f0
-0,         43,         43,        1,   194140, 46e18d23810193dd352fcc49b7c5ef6e
-0,         44,         44,        1,   193656, 4339d3e8b9dbeb376a1e19c4b86824f3
-0,         45,         45,        1,   192964, ff4680c71688f9944cd494105d2ab0b5
-0,         46,         46,        1,   192640, 62ce4b6d3311c34c73c6af1399fedfdc
-0,         47,         47,        1,   192584, f71b06a232a1a62a45ddac80c6f75090
-0,         48,         48,        1,   192360, 6642b9838eb32ed81d4d10a46ab9f954
-0,         49,         49,        1,   191916, d3ed1686383cfa7130ecc17c1ab52432
diff --git a/deps/libav/tests/ref/fate/utvideoenc_rgba_none b/deps/libav/tests/ref/fate/utvideoenc_rgba_none
deleted file mode 100644
index 555409f..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_rgba_none
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   301312, 6912d70f7c20db0b5079a99443ffe65c
-0,          1,          1,        1,   301328, 53f1b7d3c2f87ecfe9c9d305771421c5
-0,          2,          2,        1,   301100, 7040f2b50dc10b2565fa899ba007983d
-0,          3,          3,        1,   301164, 2bfe87a43842b21b083c166a5fcae979
-0,          4,          4,        1,   301172, e6535559b9cafb81d0f5312e6982228f
-0,          5,          5,        1,   301196, 899d3b7f4daca28b8d08fd80b9732332
-0,          6,          6,        1,   301204, 9ba8d921eb9345b9b90e5ec690cedbc6
-0,          7,          7,        1,   301304, 89d5758e5a4966d28fa3e6811822c9e6
-0,          8,          8,        1,   301336, b3f805d45e2cba1f3273fdc30e3d3d9c
-0,          9,          9,        1,   301304, 83c9ce5fdf5b20b29fc787ae20c5aa8f
-0,         10,         10,        1,   301204, 2cb730d551309ac307b69fb1e0f0bcbb
-0,         11,         11,        1,   301172, dc5d09bbd04e7b0a20521e67dbbad5f2
-0,         12,         12,        1,   301304, 9e08281b8be73b732b2793f7ffcf3bd4
-0,         13,         13,        1,   301224, 430fa7e9cc87e9292811601473bb03f9
-0,         14,         14,        1,   301128, 32eab97914c2f165e270e42e3c348ea0
-0,         15,         15,        1,   301140, c38233a19e22cc41957cd5a2e13bbca0
-0,         16,         16,        1,   301280, b87e1697217b744404d7998ec3dfac80
-0,         17,         17,        1,   301332, 231912bca1a1d4b54bc7ad392ca437c5
-0,         18,         18,        1,   301452, 30ce746afa3750735872fc9f2680e5b0
-0,         19,         19,        1,   301484, 9a56d219bcfb153190d17c8d89a0c5e3
-0,         20,         20,        1,   301440, c864010df06930259e712f7029a428b4
-0,         21,         21,        1,   301440, 1a4b6bf6557c65d5f088829602440819
-0,         22,         22,        1,   301376, f0ce8402bf00fcde4399da2f4088cd9f
-0,         23,         23,        1,   301320, 27d296bfd2df72c2fcf790098d2129cd
-0,         24,         24,        1,   301388, 0e78fec341c4d137959491e53ab23d92
-0,         25,         25,        1,   301404, 1ec3ca66bd6005cb754c00e346cdd895
-0,         26,         26,        1,   301348, b78ad47e42cfa510ab92d3ffc99371cf
-0,         27,         27,        1,   301492, 558f35abf593bf29a82e6353c75052d2
-0,         28,         28,        1,   301412, f44dae5d90ac9907b8847db0966e8d0b
-0,         29,         29,        1,   301484, 40d87d4e7c51bc2b3dede754c25e1b7e
-0,         30,         30,        1,   301484, 15dda8edd88e97f3db294bce9397e681
-0,         31,         31,        1,   301420, ff1dd12c16b295c83098a6b0135bd951
-0,         32,         32,        1,   301380, a290b1944381632a50fbb680f3f1af9e
-0,         33,         33,        1,   301356, 73d66b8546ac0698975af841dcea7a4c
-0,         34,         34,        1,   301260, 408ab0a50a74e7aaf196a202fd781892
-0,         35,         35,        1,   301412, bde264649818ed761d74281bf92a871e
-0,         36,         36,        1,   301492, c3612f4a8a748ffd6b43ccf24b2db821
-0,         37,         37,        1,   301488, 068ec12d90d1236e367caaf87f14da03
-0,         38,         38,        1,   301556, 000ee987cce47ab701e743d21a6607e6
-0,         39,         39,        1,   301556, 41277aa578fe7367c138a70b532bdf59
-0,         40,         40,        1,   301568, ebf086337aedfac24afc5c17715424d2
-0,         41,         41,        1,   301528, d8f0c31897748dfc761033f237f31f7f
-0,         42,         42,        1,   301604, 50b67f1d579eb8e7c5e0bdc438bf0ee2
-0,         43,         43,        1,   301568, 8297516127bb32a4326d6a859b2d8407
-0,         44,         44,        1,   301552, 1f9e1272e7249467631c4b9bd88bddcf
-0,         45,         45,        1,   301604, d835d90e9fc37583978c053bab5a96ed
-0,         46,         46,        1,   301692, fcb67990a58d25bff135fcc970714c4a
-0,         47,         47,        1,   301700, a4b0a26ed1626a4e46effa7987a32034
-0,         48,         48,        1,   301720, 44d53eab1be166c9bcc4b7b8bc3f80c9
-0,         49,         49,        1,   301704, 34314d5b44ea555b7d52958dec489fde
diff --git a/deps/libav/tests/ref/fate/utvideoenc_yuv420_left b/deps/libav/tests/ref/fate/utvideoenc_yuv420_left
deleted file mode 100644
index cec5a28..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_yuv420_left
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    59796, a7136363bc4b9ac663178e5c7f24bae7
-0,          1,          1,        1,    60012, d296cf24776234599e22526598de838c
-0,          2,          2,        1,    61040, e889f81df51b75acf8131de97f9da4e3
-0,          3,          3,        1,    59656, a63c343139b1117260cf6f790ba87968
-0,          4,          4,        1,    58592, e2170222ac38ddc0703f5b537b4beb79
-0,          5,          5,        1,    60248, 0ea350ecf7d8a440b06a60550b5dfa4c
-0,          6,          6,        1,    60480, 792694fa65994c407fd76d06fdbbdc34
-0,          7,          7,        1,    59888, eaef81fd1fa459feb9a3b15817c861a4
-0,          8,          8,        1,    60080, 610a75f3c275ffef75006fb862642993
-0,          9,          9,        1,    60320, 1e1cc244d2ea6b259d06384d1a95cc89
-0,         10,         10,        1,    60300, ddbb7eb36b73cd4f1dc28ded5217952e
-0,         11,         11,        1,    60288, 13f14eed47e1c4fec9f99b47316f82b6
-0,         12,         12,        1,    59172, c7c205489a3b389290f2c56e66bf8ddb
-0,         13,         13,        1,    59664, 81eead1a1fe199e4b66e9bc2f04ac892
-0,         14,         14,        1,    61004, d02e17515451d4259d7179741d208b28
-0,         15,         15,        1,    61088, 4f1c9877caf59dc5ebf5646fe98b3ef5
-0,         16,         16,        1,    60072, 5c4c41d25e9aa0da07da89475275513b
-0,         17,         17,        1,    59876, aeeb1f7a68a23f9fd0503831bfeb2ed1
-0,         18,         18,        1,    59396, 154d2a0717aeb78e47e20bbc9d4aa69a
-0,         19,         19,        1,    59076, 3fdcb2330689aed91d92d515a9eb015a
-0,         20,         20,        1,    58740, 71a054852adaf0da188550fd77ae2069
-0,         21,         21,        1,    58584, 403746356fd559e9bace9bb37557e58e
-0,         22,         22,        1,    58952, 1a3d80d21e00ca5ce8c378da373c65d8
-0,         23,         23,        1,    59696, f66ace9c237d6ee91a4c23a957fde2a1
-0,         24,         24,        1,    60664, 69e6f45d9adf351650648b3fd6fc41b8
-0,         25,         25,        1,    59748, ed9e5524584eb0438f88e12af331009e
-0,         26,         26,        1,    59088, 4325aa8c838b5793364c6ab6ed904d84
-0,         27,         27,        1,    58752, 46a17359055b7ac3285c845af9701c74
-0,         28,         28,        1,    56928, a1fb544e10ee9806c80b5b80d85ef813
-0,         29,         29,        1,    56960, e17a9082644d542b3d589346d3421c51
-0,         30,         30,        1,    58140, f5ae6688db909252b67c3fbe62d783ff
-0,         31,         31,        1,    58980, 71a7053ff0857fa0651e2b8c5626598c
-0,         32,         32,        1,    59548, 60b3d97b4f3893b791894968b7586e99
-0,         33,         33,        1,    61248, ceb9cccd0327ae4c52d8a2cf009d15f7
-0,         34,         34,        1,    60032, ea2ce622422c4efa41069707b231fd52
-0,         35,         35,        1,    59252, b891818e1aba1e29c23fecbf405b03c0
-0,         36,         36,        1,    58568, 0aec4492ddb9608bf217f8b828378680
-0,         37,         37,        1,    58744, 0f218bdc62102270393e7973caa251aa
-0,         38,         38,        1,    58280, 89c93e37590d56c7c32f4955e59b7c54
-0,         39,         39,        1,    58236, 9575ac5076c1c347069b48aa8cb6381f
-0,         40,         40,        1,    57308, e4ede1a1ab344b39399b231fec0cf420
-0,         41,         41,        1,    58964, 9f9c800eddf1fbb093c7ae1320f2ec19
-0,         42,         42,        1,    58800, 9729551ff14d80a3b647bb9688e38cd1
-0,         43,         43,        1,    58716, f0d81b0b287bbe1decd18eac2873166b
-0,         44,         44,        1,    58136, e6aa11b60f8be9cd3d3e9d5c22b326ff
-0,         45,         45,        1,    56772, c3dd97f5d29511103b80edfcf39d2fe3
-0,         46,         46,        1,    55904, ae67aee10ae3b04ac2dc19158bb9c69f
-0,         47,         47,        1,    56344, f3c9c3dd5238c1f29f9204e1efeb6235
-0,         48,         48,        1,    56396, 93b8a198ac7c7118da0b581a50633df9
-0,         49,         49,        1,    55480, b2907ad8da8252dd6403b72eeb49b141
diff --git a/deps/libav/tests/ref/fate/utvideoenc_yuv420_median b/deps/libav/tests/ref/fate/utvideoenc_yuv420_median
deleted file mode 100644
index ddd074b..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_yuv420_median
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    62876, c21650baa099fb2dfd35d4f8ddce16d1
-0,          1,          1,        1,    62832, 034a1996d13c15ee0bf482ddc398aac9
-0,          2,          2,        1,    64076, 1f39fd5fc926195b90a3374682a80eac
-0,          3,          3,        1,    62724, 4007f9193b9e3b19e991497bb73679ab
-0,          4,          4,        1,    61664, 3e86c3a2cd07807433ed7f46ede959ec
-0,          5,          5,        1,    63296, 4e7d334f3713ecc07fca77c945c758b7
-0,          6,          6,        1,    63528, 15b8f92a1d84e77521c539a9a02379ac
-0,          7,          7,        1,    62784, 07ead8344bde0c0a060c3313f39cf92e
-0,          8,          8,        1,    63176, 0a8d9329d7f66008a0d41c6ba4749b09
-0,          9,          9,        1,    63492, eefa6ba63516dd2ff9fb0a4e81169977
-0,         10,         10,        1,    63328, 991fd8fcb392774d11b1766cc1dbe0d7
-0,         11,         11,        1,    63328, e2745a89e96a7f0c641fa25a6ed2da83
-0,         12,         12,        1,    62384, 2dd300b64a32ae2d6fb65e88128e5147
-0,         13,         13,        1,    62944, 076331793373fe43cd213ae56fc19e0f
-0,         14,         14,        1,    63932, 37b6b50e7219ba0e593e4ce1de02a864
-0,         15,         15,        1,    64020, ed66d034f605621266054a54714feec9
-0,         16,         16,        1,    62940, fb6a921a8551db3d33b0a24e7e9a3ced
-0,         17,         17,        1,    63052, abac96a9e0128efd4362ec28e66464d2
-0,         18,         18,        1,    62408, 0351d4c9579779dbb398f68f0e4e02e4
-0,         19,         19,        1,    62148, b4f7ed147a1326cf5adae50af6db56ca
-0,         20,         20,        1,    61692, 48a9cdf3d4600768feca7616614dc46d
-0,         21,         21,        1,    61704, d8e6c2daa6ae50caf7d5ee9324812389
-0,         22,         22,        1,    61964, 3983f0bf566d206cde013982722d4453
-0,         23,         23,        1,    62812, b12b44c4df634f608380e2bfb26b717d
-0,         24,         24,        1,    63480, 30ad52da50e0d4f1fc811d24a01e777b
-0,         25,         25,        1,    62708, 2827bd4dec0fa603eaf92bae8c4deb72
-0,         26,         26,        1,    62252, fd7c3a5bcaf83701dd7f2da225f3ce69
-0,         27,         27,        1,    61752, ea9740f3a5f52baaa923e245f649f7c7
-0,         28,         28,        1,    60248, cf4a142fc28437cca11ad1d127a2948f
-0,         29,         29,        1,    60232, 6cd0b708ec41cd10357f8944ae8288bd
-0,         30,         30,        1,    61240, c4a44f902a295f3a6e85276087adcbc0
-0,         31,         31,        1,    62228, a36d5eafa03b784f35303b131ac5d3a0
-0,         32,         32,        1,    62636, e09ca8f58690f991e1ce3986c2864924
-0,         33,         33,        1,    63840, 830de5062cb9c8be8844118c7db4bcef
-0,         34,         34,        1,    62996, e008d4add85b595840a2773d01465147
-0,         35,         35,        1,    62480, 04a38e7c231697aa97e5a401d4329105
-0,         36,         36,        1,    61744, 4cb276703869f45a6ab798e53e615fc0
-0,         37,         37,        1,    62012, dfca9b52389b01d750a4b94d10a8e2e0
-0,         38,         38,        1,    61748, bf2ec90514c268440313fecf68e2f41f
-0,         39,         39,        1,    61688, 99f1c565dc76bde773ccb91b8dbb3860
-0,         40,         40,        1,    60528, 7b66ad4e019964ead8ed1a9eadad9721
-0,         41,         41,        1,    62248, 795e2a8351ac78bc482e341be3af98bb
-0,         42,         42,        1,    61832, d7fc01097c5ec0247d20727aec2adab6
-0,         43,         43,        1,    61688, 4492ffefcaed530fce3221f4bb61ef80
-0,         44,         44,        1,    61216, d9a91c3007686b7166f297bc1dddb9a9
-0,         45,         45,        1,    60192, 7c808c46b376c49fa3d5bd5ba97fce1c
-0,         46,         46,        1,    59388, 6d2a2a72d14ff5c800295de6b2e23465
-0,         47,         47,        1,    59620, 5c1aa124bb6ffb9cd33a6430bf07ea9f
-0,         48,         48,        1,    59584, efc1012cca50e509856e406622d760fe
-0,         49,         49,        1,    58800, fa8563a0bc6022f8f5c5fc70ce0d46f3
diff --git a/deps/libav/tests/ref/fate/utvideoenc_yuv420_none b/deps/libav/tests/ref/fate/utvideoenc_yuv420_none
deleted file mode 100644
index 555eee2..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_yuv420_none
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   144508, 83af3948090ebb44a0091815e4edc61e
-0,          1,          1,        1,   144496, 950742e357ee489fcda4f783b8df3b4c
-0,          2,          2,        1,   144376, 4b818cf0a50e9338fea26101073e445e
-0,          3,          3,        1,   144420, 0335c3b97dca65e9118a12e3cceb1e24
-0,          4,          4,        1,   144588, a9f7e6cb2d9129d97342c4eb67349aa8
-0,          5,          5,        1,   144444, b956115c6bab18a01594103bcb2ba9e0
-0,          6,          6,        1,   144408, 81761b3135ab3f4d5efd6f2790b6b70f
-0,          7,          7,        1,   144408, 566c53ee4126e31b78f6572292f97f55
-0,          8,          8,        1,   144320, 0c24c346a65cb945f8d804817f67f42e
-0,          9,          9,        1,   144316, 7920264636a6933c776b41567181f2d9
-0,         10,         10,        1,   144248, c1c1b10356f27fca35e03fdc67dd1638
-0,         11,         11,        1,   144168, 5a590c4f603aaddd01d4efbf5571426e
-0,         12,         12,        1,   144452, 10459aa8f48f7e8e0ebc03f15f795acd
-0,         13,         13,        1,   144312, 436658612212e706c4ed9f4bdcf45f38
-0,         14,         14,        1,   144252, 7a5612c485c501669e27039c435ac5d3
-0,         15,         15,        1,   144232, 81018c3b49d376d69af71a4ee2c910a9
-0,         16,         16,        1,   144312, 4280abfc59ee6cfddbf45474a42c5cd5
-0,         17,         17,        1,   144348, 0a48ba8ad15f7431830feeb2ac0f2118
-0,         18,         18,        1,   144356, 6c8f0a396195a840a225aca3ada427ff
-0,         19,         19,        1,   144360, 4a0a959d9c3ebb293d94ef37b4f7f19e
-0,         20,         20,        1,   144380, e61b564126a2d8255a7457b70af74514
-0,         21,         21,        1,   144416, fe434ae640e63fb774d6e7c864d02e49
-0,         22,         22,        1,   144344, 9e106257c640b66ca31919668c4da334
-0,         23,         23,        1,   144376, c0cdd6b2aa1bf4d89c82b602f09fa2e0
-0,         24,         24,        1,   144376, 8be60289a2a4c22355b3bd43f2f85fe4
-0,         25,         25,        1,   144320, 124127b8fcacfa5c5e0ee7f0324da7a0
-0,         26,         26,        1,   144408, a5639aedbdbfff34f36dda8872992cde
-0,         27,         27,        1,   144516, fbe3cf39fd764e6a3d05c63be35a4d58
-0,         28,         28,        1,   144676, 6ee82422712e11740d7b003eab69d5bd
-0,         29,         29,        1,   144648, e5f446835709b1baaca14af3aa6fbbb7
-0,         30,         30,        1,   144496, 3b23fb07c528ad824e9c8f10143ae06a
-0,         31,         31,        1,   144496, 4e4dddd0c72f9d3a555b8d32ae82c10e
-0,         32,         32,        1,   144372, 1dfe88fbe0c1193bb04a06840dfab155
-0,         33,         33,        1,   144168, e03b3d67fcbbde71c6985955feebabfe
-0,         34,         34,        1,   144180, 5d5a24b49cff98cbb85f69b547b43e87
-0,         35,         35,        1,   144348, bb9172de1a4c7a00fe80bb673484781b
-0,         36,         36,        1,   144544, 7824a6c4bb8b919306904be6f67f2736
-0,         37,         37,        1,   144516, 456c3884817909b4cca38f8138c079d4
-0,         38,         38,        1,   144532, 0e63cf833a33a9fac9e5969342817fc2
-0,         39,         39,        1,   144452, 9c0155cdd0a5ae42b79475ab47ba87f7
-0,         40,         40,        1,   144532, eefee218d181e74a80a1d2ec27932e91
-0,         41,         41,        1,   144348, fbd4fd20565350dd927005af590912ff
-0,         42,         42,        1,   144332, eac5c49230fb807c81e8a0c9e9721697
-0,         43,         43,        1,   144428, 9ee3fe8be6c4477b0d8ff1d91049634e
-0,         44,         44,        1,   144480, b58fb19549e4497e82491a26d67c1567
-0,         45,         45,        1,   144596, 1c8059bf14f4df3da9db6b89f87a52b9
-0,         46,         46,        1,   144592, db8a5750beb049ea835895d23e924cab
-0,         47,         47,        1,   144512, 58c69889edb9bdab219d698f6a44d2cf
-0,         48,         48,        1,   144468, 3da8e5ae1f1ff9da72abd3d2ac87a7b9
-0,         49,         49,        1,   144500, 4f80ccdb6f9549190ed72407dd7af2c1
diff --git a/deps/libav/tests/ref/fate/utvideoenc_yuv422_left b/deps/libav/tests/ref/fate/utvideoenc_yuv422_left
deleted file mode 100644
index d9afc2c..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_yuv422_left
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    91788, e14e576f1f9abd095f13ceca627adb59
-0,          1,          1,        1,    92140, 4b7db11c2d35fa91ff1b6f65c184e3fa
-0,          2,          2,        1,    93268, 6ef5cb83a4db2afbf14467cbc4b6c4f7
-0,          3,          3,        1,    91612, f08ae129a2867a08770bdb61381bf366
-0,          4,          4,        1,    90456, ed3edabe09b9f6cfbf452a08dafa556d
-0,          5,          5,        1,    92180, a0760e91b3af27a7c1bb0264f128ca50
-0,          6,          6,        1,    92200, 2fda4c87dfa34206173e852b67841406
-0,          7,          7,        1,    91872, 944e7c88c7ebeae9e1efac859ea4fe7d
-0,          8,          8,        1,    91952, 34112ec99382b80c397d26cef93573c7
-0,          9,          9,        1,    92312, 63698686348ccd80cc920e9e73a195aa
-0,         10,         10,        1,    92308, 6a675d6678b7b78fac6375d44f325d06
-0,         11,         11,        1,    92272, bc1401e0acd3864ad30711ca4b61578d
-0,         12,         12,        1,    90920, cd7ecda23a4f312abe71bd3fc28af3e7
-0,         13,         13,        1,    91612, 91ebce52e2594296349476f3bf6a6408
-0,         14,         14,        1,    93112, 34be111d02130ed7389c0c62768041de
-0,         15,         15,        1,    93140, e1b440cad63dbf8ff034f424cd1194cc
-0,         16,         16,        1,    92080, 94181fde8563af0b6810f778f6b1d92b
-0,         17,         17,        1,    91816, ed0997f9b341fc3ab6a8c5d9a4067bd2
-0,         18,         18,        1,    91204, d833b0c3b3dfe60b079b746c4c3aed7f
-0,         19,         19,        1,    90880, 0d4702abb70d7cbc8843a96e3a74117a
-0,         20,         20,        1,    90408, 409860b79fe10ffbffd581c19445fa91
-0,         21,         21,        1,    90280, 5360fa4f1afd8c2c55cf33675a928a14
-0,         22,         22,        1,    90808, fe2ca67d315fb1d8806ee04470d06378
-0,         23,         23,        1,    91584, 84168a6fe20ee00ddd9f54ce8f1e1810
-0,         24,         24,        1,    92684, 6fb3d7193d3bb5400c449717358827e0
-0,         25,         25,        1,    91580, acd2aa86dbae6e133183e5bf2ca389a3
-0,         26,         26,        1,    90928, cc0df9c8e00df5985e39ae486eb59eff
-0,         27,         27,        1,    90536, 8f9d294190c03435f3cee266cca2a31a
-0,         28,         28,        1,    88364, ae9564ad4eb3c1fc03e4befb4b1e719e
-0,         29,         29,        1,    88404, 745a16947203cd7017900b137fca70eb
-0,         30,         30,        1,    89844, 1b7e75be9edb25ffe91c54e270eb8f46
-0,         31,         31,        1,    90752, 9ff03fa3b28f2c84a4da41779e0a2aa4
-0,         32,         32,        1,    91320, 409ed4c3eced8793760505cf8095f51a
-0,         33,         33,        1,    93204, 70865d89c930919474500befe0e2ec3f
-0,         34,         34,        1,    92036, 7388d12a6954b9870749ab6a5f05815f
-0,         35,         35,        1,    91144, b47bfdaec4c00177a9258a03e864400f
-0,         36,         36,        1,    90368, 418df89a063f66cfbb1f806d68aca6a2
-0,         37,         37,        1,    90628, 3f90314ab7311ad0f4bd4808d62a1e80
-0,         38,         38,        1,    89836, 414f90d0efc65b993f6e1fc8f2c1d860
-0,         39,         39,        1,    89792, a07cf9fc580ffee5d61c241dce116ae6
-0,         40,         40,        1,    88896, 3d583229da6b7455b6876843b3b747c7
-0,         41,         41,        1,    90572, cbef36619e7c8e62fc21a735c7701514
-0,         42,         42,        1,    90544, 144816eaeaf0412fca6bf40e6f3e6d3f
-0,         43,         43,        1,    90416, 76f0d9dd1f4fd00b68223dd7c6024b2e
-0,         44,         44,        1,    89788, ce0b66e45ed3c50124680f84614c5ac0
-0,         45,         45,        1,    88120, 5d59770b187109e2e6824f5cb42b9b73
-0,         46,         46,        1,    87164, bb52ce20f4a21ef82a2cc3316ba69e1c
-0,         47,         47,        1,    87632, 87f44c3ecebd09b2ffa94d8ace01f3f3
-0,         48,         48,        1,    87700, cbaed2ac667bdc9aa17ffc68ebaea790
-0,         49,         49,        1,    86624, 21797bc69a89976f9b4b552603a63267
diff --git a/deps/libav/tests/ref/fate/utvideoenc_yuv422_median b/deps/libav/tests/ref/fate/utvideoenc_yuv422_median
deleted file mode 100644
index e1c8fcd..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_yuv422_median
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    89732, 698174b0d0d68e98774363ca7926f6e1
-0,          1,          1,        1,    89652, f0789b7c32ef44207dfc5a454bb5ccee
-0,          2,          2,        1,    90868, 6df1dcb1957efca736e88adfbad8557b
-0,          3,          3,        1,    89520, 9cee942e7f03a97cd2cdf8cea429fb31
-0,          4,          4,        1,    88508, 798f4e8c00f4d949882cdc3f89be0bf6
-0,          5,          5,        1,    90140, 70fc5f4f240b0ca30332b0f37632d1cb
-0,          6,          6,        1,    90176, 1c2747fc56d5eb70ff8f4f361cb70610
-0,          7,          7,        1,    89392, bd8764124753f784d5984cd829c8ca90
-0,          8,          8,        1,    89848, 1dc30ed23a8634f6b2661ac8583fe8cc
-0,          9,          9,        1,    90356, 0910ae7c3a6924031453f458009354fa
-0,         10,         10,        1,    89984, 61da06bf1ed667b54ee749c69ab031eb
-0,         11,         11,        1,    90012, 11d05491f86014f19b34cab3111a95d2
-0,         12,         12,        1,    89072, 4598f16727472daa1710c39b4840efdc
-0,         13,         13,        1,    89776, ed6c0da32acf621e9f79b76a3afaa280
-0,         14,         14,        1,    90680, 05f3a9232bc14ca8721ef04243177a20
-0,         15,         15,        1,    90852, e4deff113ea503656efecb227f6b702a
-0,         16,         16,        1,    89844, 5ee70abd6f1d2e5c55117b28840327e6
-0,         17,         17,        1,    89852, 6721997ae0563009adbdeed31f437ce4
-0,         18,         18,        1,    89144, 8a40f0af74afb4ff05e6242a41c7789f
-0,         19,         19,        1,    88880, 8824c3526629a30fbf9a53abc448844c
-0,         20,         20,        1,    88344, 18a656127a16bb50113bb2e98b11a26d
-0,         21,         21,        1,    88464, 19a3b9510e6347a7782f695b48736991
-0,         22,         22,        1,    88588, e3d22d15b4812c26214db546ce17c7dd
-0,         23,         23,        1,    89720, afe800faa0188dff0899cd83af6301d6
-0,         24,         24,        1,    90216, a9d9ece70c978c595e1d724a0f644f56
-0,         25,         25,        1,    89456, 9bf3e8f87f072d55095acc9351a09f45
-0,         26,         26,        1,    88992, 40d1b1858f1ba0bebd9eb9f5263cda9d
-0,         27,         27,        1,    88632, 1df39644ac99bccab4c6bd72498284c4
-0,         28,         28,        1,    87048, 9983cd95307c1bab653170ba2aecdc55
-0,         29,         29,        1,    87120, 006b48403af94a0bc5121900b48af9c1
-0,         30,         30,        1,    88044, 652d17c8805de56cd83824d99888822e
-0,         31,         31,        1,    89016, 652a971973d088b5098a06b216137151
-0,         32,         32,        1,    89324, 2775a087358ead0281ce188f4006050d
-0,         33,         33,        1,    90328, 564e119bdf5f3c780c0613990ca487db
-0,         34,         34,        1,    89684, 1f5fb4ec22234aee771791b71881b630
-0,         35,         35,        1,    89216, dde7a003cfe5b47f9be407f28dcdfb3f
-0,         36,         36,        1,    88644, 1fed2d2f72ec9488181a06606aaf4e12
-0,         37,         37,        1,    89000, 8f916bee0ad8efe8d3572e4af4bf4b8e
-0,         38,         38,        1,    88628, d802fb5634d3acd72a96bd99c22dd566
-0,         39,         39,        1,    88448, a4d438df349f1f2ff1620fb965d08513
-0,         40,         40,        1,    87332, 18a8527dcfc5c1fa8ae7aa8a83781d2d
-0,         41,         41,        1,    88856, 63179f19a5d60d3ea9fa14c00ca5c493
-0,         42,         42,        1,    88556, 92b568c24ed53e823b54fa6c064d16ac
-0,         43,         43,        1,    88380, c204b982e3ab7fc1aa6b1b132c4ae462
-0,         44,         44,        1,    87888, 45f1cd55d454a0b611b047b6e5172b30
-0,         45,         45,        1,    86876, c668ac58b31feb51902b78fdfcdc1064
-0,         46,         46,        1,    86272, 24a94950de7065cb236e52502c9c8e67
-0,         47,         47,        1,    86388, 51dad738cd8896616694a4fb52b47fbd
-0,         48,         48,        1,    86188, dc6709cd2722eb8dd927f405c6a30915
-0,         49,         49,        1,    85244, 68f40045a250ab0799a7325aa16ec80c
diff --git a/deps/libav/tests/ref/fate/utvideoenc_yuv422_none b/deps/libav/tests/ref/fate/utvideoenc_yuv422_none
deleted file mode 100644
index ca77177..0000000
--- a/deps/libav/tests/ref/fate/utvideoenc_yuv422_none
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   191800, 0e1d199f87997ba47e98596b6087d7d4
-0,          1,          1,        1,   191820, b35714d0635214095ac06d35da00ed32
-0,          2,          2,        1,   191668, 8336829e44f5b90034e5da33dcd27f1f
-0,          3,          3,        1,   191696, ebff701893f27b026fe6fec4a1cbd90b
-0,          4,          4,        1,   191976, c2729ecde4337a51192da71b0ef36e7d
-0,          5,          5,        1,   191760, e2ef2db5ef30019d5fd24cd32c696318
-0,          6,          6,        1,   191708, 638eb1c1b68bc9f4cc315ebdd3bd86f5
-0,          7,          7,        1,   191688, aca858d2cce189eb60012a33ea74d10b
-0,          8,          8,        1,   191576, aa933dea9aac9b61fea004747e3b8e6a
-0,          9,          9,        1,   191544, 6c410ec9e2492d464d439a58e6e338c3
-0,         10,         10,        1,   191472, 7c7661ff35671b3912b2b216bc6df478
-0,         11,         11,        1,   191280, 73c1ff53a0cd5c65eb2ae75a45efbf72
-0,         12,         12,        1,   191700, 201b0b4834878513e6e13bd9f5977a28
-0,         13,         13,        1,   191424, 0affff549b2da09c7852c5e8dbd1c84a
-0,         14,         14,        1,   191420, e0e80adf520953c4bc4033efc77b9092
-0,         15,         15,        1,   191408, 4fa22efbf2101b7f6bfffae227ce1d23
-0,         16,         16,        1,   191500, fef8df893234b38be36803d5f5656e16
-0,         17,         17,        1,   191580, 3585b500a77344fd87f8f18e3816f1a8
-0,         18,         18,        1,   191608, 419189483180612b72491dab5864c6e7
-0,         19,         19,        1,   191616, 197fa32c8a164eeea73defb7422657d1
-0,         20,         20,        1,   191596, a660a6c630f7e55c3ca2f9a37d599223
-0,         21,         21,        1,   191660, d98445b0387c3d54034f8defe1d03ea6
-0,         22,         22,        1,   191540, ef4522aa762b82d1c715805a779c7c1e
-0,         23,         23,        1,   191576, 32d109d2040c69b3944471b0bd399a65
-0,         24,         24,        1,   191636, 58e2f3a01de4175ba7f915e2d065ba36
-0,         25,         25,        1,   191524, 0989a64e78613cfc26124e195cfc0cde
-0,         26,         26,        1,   191640, b9e252a5c4583736a8ba248d15c429aa
-0,         27,         27,        1,   191800, 1541cccc66cb63d3e1ef675a16a1258e
-0,         28,         28,        1,   192028, 5dada6bf987738caebca210067d13c39
-0,         29,         29,        1,   191964, 8d55bb4a1464ac74364d4b1e416d4a0c
-0,         30,         30,        1,   191736, 88c279b9f3e96485f85dbca09177fe26
-0,         31,         31,        1,   191788, aa75795116428edb57dea8b54527e13b
-0,         32,         32,        1,   191636, aa45e4ec1fcc038ea2e48046e5047417
-0,         33,         33,        1,   191400, 7b2861b3ca8bfcdca010d859c0595e03
-0,         34,         34,        1,   191332, 956acfcc00661d9a9ba7575e8c1a011b
-0,         35,         35,        1,   191548, 3b5b7c3b9a6a5ebe10f178077a5fea4d
-0,         36,         36,        1,   191852, 835219e1689946f3e26457ffce197181
-0,         37,         37,        1,   191828, f67a1e4640472287baf194c02f24dc29
-0,         38,         38,        1,   191812, 978f44d430859044350ea20913ae4194
-0,         39,         39,        1,   191700, 92e21c9ded61f69f793c649eece071c4
-0,         40,         40,        1,   191812, 0a460bc35daad68e8042917f26dac542
-0,         41,         41,        1,   191548, 7c7a65b9257f9b4439002c5c414c401c
-0,         42,         42,        1,   191544, b03d903c46536dc336461827fd4d34db
-0,         43,         43,        1,   191700, 75b391d84b120e63ec229fcb48808d19
-0,         44,         44,        1,   191780, c953dcd42a8aa19eb4d4be0149894bbe
-0,         45,         45,        1,   191952, 64be44b2e21f8301f4234e32a10cb1c9
-0,         46,         46,        1,   191916, a6c805f651f3f57a84681b1aab6fe3ef
-0,         47,         47,        1,   191784, 9cc8db3cb63a026645f634aabc89c37b
-0,         48,         48,        1,   191716, e2f0c7543b3484a726411eac4e9a79cd
-0,         49,         49,        1,   191728, 50277180199917d1259e0cad42f52d4c
diff --git a/deps/libav/tests/ref/fate/v210 b/deps/libav/tests/ref/fate/v210
deleted file mode 100644
index 2847564..0000000
--- a/deps/libav/tests/ref/fate/v210
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/50
-0,          0,          0,        1,  3686400, 0x75ee1dde
diff --git a/deps/libav/tests/ref/fate/v410dec b/deps/libav/tests/ref/fate/v410dec
deleted file mode 100644
index 98b2816..0000000
--- a/deps/libav/tests/ref/fate/v410dec
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   393216, 0xfe11a6b0
diff --git a/deps/libav/tests/ref/fate/v410enc b/deps/libav/tests/ref/fate/v410enc
deleted file mode 100644
index ab219bb..0000000
--- a/deps/libav/tests/ref/fate/v410enc
+++ /dev/null
@@ -1 +0,0 @@
-e5c0b1f17d2a64a416dcf9bf7a38d9d9
diff --git a/deps/libav/tests/ref/fate/vb b/deps/libav/tests/ref/fate/vb
deleted file mode 100644
index 336d426..0000000
--- a/deps/libav/tests/ref/fate/vb
+++ /dev/null
@@ -1,37 +0,0 @@
-#tb 0: 1/12
-0,          0,          0,        1,   230400, 0x3bd1d731
-0,          1,          1,        1,   230400, 0x9d0774c3
-0,          2,          2,        1,   230400, 0xa0faafe2
-0,          3,          3,        1,   230400, 0x38325309
-0,          4,          4,        1,   230400, 0xe90a1b1e
-0,          5,          5,        1,   230400, 0x8efbc904
-0,          6,          6,        1,   230400, 0x0a8476f3
-0,          7,          7,        1,   230400, 0x5d94587d
-0,          8,          8,        1,   230400, 0x280b905d
-0,          9,          9,        1,   230400, 0x07178dd9
-0,         10,         10,        1,   230400, 0xf52b8db4
-0,         11,         11,        1,   230400, 0x2b70c1dc
-0,         12,         12,        1,   230400, 0x8157a6e9
-0,         13,         13,        1,   230400, 0xd4a3c357
-0,         14,         14,        1,   230400, 0x703861bb
-0,         15,         15,        1,   230400, 0xa13cf75e
-0,         16,         16,        1,   230400, 0x140e487f
-0,         17,         17,        1,   230400, 0x05cca333
-0,         18,         18,        1,   230400, 0x0506ee2b
-0,         19,         19,        1,   230400, 0xe3e13466
-0,         20,         20,        1,   230400, 0x8a24118c
-0,         21,         21,        1,   230400, 0x22050962
-0,         22,         22,        1,   230400, 0x0f5c8a0d
-0,         23,         23,        1,   230400, 0x3475df44
-0,         24,         24,        1,   230400, 0x65354e06
-0,         25,         25,        1,   230400, 0xb9a01978
-0,         26,         26,        1,   230400, 0x15207ee1
-0,         27,         27,        1,   230400, 0x3b214f0b
-0,         28,         28,        1,   230400, 0xf9461bbb
-0,         29,         29,        1,   230400, 0x1469290f
-0,         30,         30,        1,   230400, 0x8ddfd514
-0,         31,         31,        1,   230400, 0x1bffa6a1
-0,         32,         32,        1,   230400, 0x5a04d712
-0,         33,         33,        1,   230400, 0xaa8de439
-0,         34,         34,        1,   230400, 0x610c5439
-0,         35,         35,        1,   230400, 0xd02d3e7c
diff --git a/deps/libav/tests/ref/fate/vble b/deps/libav/tests/ref/fate/vble
deleted file mode 100644
index 8c4250f..0000000
--- a/deps/libav/tests/ref/fate/vble
+++ /dev/null
@@ -1,5 +0,0 @@
-#tb 0: 1001/30000
-0,          0,          0,        1,  1382400, 0x5e1bc307
-0,          1,          1,        1,  1382400, 0x198795f7
-0,          2,          2,        1,  1382400, 0xa9102ac2
-0,          3,          3,        1,  1382400, 0x9e347932
diff --git a/deps/libav/tests/ref/fate/vc1-ism b/deps/libav/tests/ref/fate/vc1-ism
deleted file mode 100644
index 4daca95..0000000
--- a/deps/libav/tests/ref/fate/vc1-ism
+++ /dev/null
@@ -1,121 +0,0 @@
-#tb 0: 1/10000000
-0,     423334,     423334,        0,    37440, 0xd1bc5235
-0,     840000,     840000,        0,    37440, 0x158e6167
-0,    1256666,    1256666,        0,    37440, 0x0faa4481
-0,    1670000,    1670000,        0,    37440, 0x427158c5
-0,    2086666,    2086666,        0,    37440, 0x4eb53ac6
-0,    2500000,    2500000,        0,    37440, 0x99304eea
-0,    2916666,    2916666,        0,    37440, 0xcc554a6f
-0,    3340000,    3340000,        0,    37440, 0xabeb6c35
-0,    3756666,    3756666,        0,    37440, 0xddfc7e18
-0,    4170000,    4170000,        0,    37440, 0xaa79b504
-0,    4586666,    4586666,        0,    37440, 0x5cb1c839
-0,    5000000,    5000000,        0,    37440, 0x7e36ecca
-0,    5416666,    5416666,        0,    37440, 0xf486f425
-0,    5840000,    5840000,        0,    37440, 0xf1b4138f
-0,    6256666,    6256666,        0,    37440, 0x966f1a49
-0,    6670000,    6670000,        0,    37440, 0x5eff21da
-0,    7086666,    7086666,        0,    37440, 0x333f39b1
-0,    7500000,    7500000,        0,    37440, 0x62e5963e
-0,    7916666,    7916666,        0,    37440, 0x26930671
-0,    8340000,    8340000,        0,    37440, 0x27b4bb6c
-0,    8756666,    8756666,        0,    37440, 0xdbd07766
-0,    9170000,    9170000,        0,    37440, 0x04260104
-0,    9586666,    9586666,        0,    37440, 0x9b1e078b
-0,   10000000,   10000000,        0,    37440, 0xdf4e2474
-0,   10416666,   10416666,        0,    37440, 0x57d44986
-0,   10840000,   10840000,        0,    37440, 0x8780e34c
-0,   11256666,   11256666,        0,    37440, 0xf80c8bc0
-0,   11670000,   11670000,        0,    37440, 0x630a7583
-0,   12086666,   12086666,        0,    37440, 0x235ae089
-0,   12500000,   12500000,        0,    37440, 0x984b8f0e
-0,   12916666,   12916666,        0,    37440, 0x865cf592
-0,   13340000,   13340000,        0,    37440, 0x70f376f2
-0,   13756666,   13756666,        0,    37440, 0x8b30c035
-0,   14170000,   14170000,        0,    37440, 0xde772d79
-0,   14586666,   14586666,        0,    37440, 0x8e076be5
-0,   15000000,   15000000,        0,    37440, 0x3dc2bd9f
-0,   15416666,   15416666,        0,    37440, 0xb782eb67
-0,   15840000,   15840000,        0,    37440, 0x02025d73
-0,   16256666,   16256666,        0,    37440, 0x86bbbce8
-0,   16670000,   16670000,        0,    37440, 0xd6554f62
-0,   17086666,   17086666,        0,    37440, 0xb831b917
-0,   17500000,   17500000,        0,    37440, 0x80643560
-0,   17916666,   17916666,        0,    37440, 0x4ecf9afd
-0,   18340000,   18340000,        0,    37440, 0x9ce51e0b
-0,   18756666,   18756666,        0,    37440, 0x179466cd
-0,   19170000,   19170000,        0,    37440, 0x145fc900
-0,   19586666,   19586666,        0,    37440, 0xb1b50402
-0,   20000000,   20000000,        0,    37440, 0x0a87552a
-0,   20416666,   20416666,        0,    37440, 0x8f53821d
-0,   20840000,   20840000,        0,    37440, 0x1c07c825
-0,   21256666,   21256666,        0,    37440, 0x49dde82f
-0,   21670000,   21670000,        0,    37440, 0xb1a32605
-0,   22086666,   22086666,        0,    37440, 0x410f3cd5
-0,   22500000,   22500000,        0,    37440, 0xff5e6696
-0,   22916666,   22916666,        0,    37440, 0x96f678c9
-0,   23340000,   23340000,        0,    37440, 0x6c9e9e68
-0,   23756666,   23756666,        0,    37440, 0x79a2a655
-0,   24170000,   24170000,        0,    37440, 0xf237bd6c
-0,   24586666,   24586666,        0,    37440, 0x4051b611
-0,   25000000,   25000000,        0,    37440, 0xc7ccc918
-0,   25416666,   25416666,        0,    37440, 0xbd02c122
-0,   25840000,   25840000,        0,    37440, 0xacb3c881
-0,   26256666,   26256666,        0,    37440, 0x2abdb940
-0,   26670000,   26670000,        0,    37440, 0x19d5be85
-0,   27086666,   27086666,        0,    37440, 0xfa5fb1ba
-0,   27503332,   27503332,        0,    37440, 0xdae7a7aa
-0,   27919998,   27919998,        0,    37440, 0x6b0f9f69
-0,   28340000,   28340000,        0,    37440, 0x353e8201
-0,   28756666,   28756666,        0,    37440, 0xa21443aa
-0,   29170000,   29170000,        0,    37440, 0x66c8d7e0
-0,   29586666,   29586666,        0,    37440, 0xc332068e
-0,   30000000,   30000000,        0,    37440, 0x71431b9b
-0,   30416666,   30416666,        0,    37440, 0x392f15cb
-0,   30840000,   30840000,        0,    37440, 0x95a146bb
-0,   31256666,   31256666,        0,    37440, 0x7c51740a
-0,   31670000,   31670000,        0,    37440, 0xa3bdd43c
-0,   32086666,   32086666,        0,    37440, 0xa079f965
-0,   32500000,   32500000,        0,    37440, 0xa95423ea
-0,   32916666,   32916666,        0,    37440, 0xd1bd2c67
-0,   33340000,   33340000,        0,    37440, 0x6cf82844
-0,   33756666,   33756666,        0,    37440, 0xd401e128
-0,   34170000,   34170000,        0,    37440, 0x1f7db118
-0,   34586666,   34586666,        0,    37440, 0x2e0a65a9
-0,   35000000,   35000000,        0,    37440, 0x321c1c40
-0,   35416666,   35416666,        0,    37440, 0x95b2a127
-0,   35840000,   35840000,        0,    37440, 0xa1471f4b
-0,   36256666,   36256666,        0,    37440, 0x29d148c0
-0,   36670000,   36670000,        0,    37440, 0x24c07107
-0,   37086666,   37086666,        0,    37440, 0x0ead678d
-0,   37500000,   37500000,        0,    37440, 0xd0ca6495
-0,   37916666,   37916666,        0,    37440, 0x08f935ef
-0,   38340000,   38340000,        0,    37440, 0xb5ec3c38
-0,   38756666,   38756666,        0,    37440, 0xce371628
-0,   39170000,   39170000,        0,    37440, 0x68170812
-0,   39586666,   39586666,        0,    37440, 0xe222699e
-0,   40000000,   40000000,        0,    37440, 0xd688706c
-0,   40416666,   40416666,        0,    37440, 0x81a033f9
-0,   40840000,   40840000,        0,    37440, 0x28bd0fbf
-0,   41256666,   41256666,        0,    37440, 0xe36db7b2
-0,   41670000,   41670000,        0,    37440, 0x30559121
-0,   42086666,   42086666,        0,    37440, 0xbf2b5fc8
-0,   42500000,   42500000,        0,    37440, 0x4b427672
-0,   42916666,   42916666,        0,    37440, 0x0544b0b4
-0,   43340000,   43340000,        0,    37440, 0x38a70b06
-0,   43756666,   43756666,        0,    37440, 0x4ed62607
-0,   44170000,   44170000,        0,    37440, 0x6efe8ea6
-0,   44586666,   44586666,        0,    37440, 0x81197e11
-0,   45000000,   45000000,        0,    37440, 0xf4060050
-0,   45416666,   45416666,        0,    37440, 0xaf205f13
-0,   45840000,   45840000,        0,    37440, 0x5fa21382
-0,   46256666,   46256666,        0,    37440, 0x8627ad05
-0,   46670000,   46670000,        0,    37440, 0xf7130133
-0,   47086666,   47086666,        0,    37440, 0x76dea7ba
-0,   47500000,   47500000,        0,    37440, 0x1dbae1be
-0,   47916666,   47916666,        0,    37440, 0x74a933f7
-0,   48340000,   48340000,        0,    37440, 0xbdcd41a3
-0,   48756666,   48756666,        0,    37440, 0xf0fe8c1c
-0,   49170000,   49170000,        0,    37440, 0xc0036222
-0,   49586666,   49586666,        0,    37440, 0x3058385c
-0,   49586667,   49586667,        0,    37440, 0x68141016
diff --git a/deps/libav/tests/ref/fate/vc1_sa00040 b/deps/libav/tests/ref/fate/vc1_sa00040
deleted file mode 100644
index 79bff27..0000000
--- a/deps/libav/tests/ref/fate/vc1_sa00040
+++ /dev/null
@@ -1,16 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,    38016, 0xa6f15db5
-0,          1,          1,        1,    38016, 0xa6f15db5
-0,          2,          2,        1,    38016, 0xa6f15db5
-0,          4,          4,        1,    38016, 0x5c4ef0e7
-0,          5,          5,        1,    38016, 0x53a42d1d
-0,          6,          6,        1,    38016, 0x68f7d89e
-0,          7,          7,        1,    38016, 0xc15f4368
-0,          8,          8,        1,    38016, 0xc15f4368
-0,          9,          9,        1,    38016, 0xd1bd47a8
-0,         10,         10,        1,    38016, 0xd1bd47a8
-0,         11,         11,        1,    38016, 0xe1e821ca
-0,         12,         12,        1,    38016, 0xe1e821ca
-0,         13,         13,        1,    38016, 0xe1e821ca
-0,         14,         14,        1,    38016, 0xe1e821ca
-0,         15,         15,        1,    38016, 0xe1e821ca
diff --git a/deps/libav/tests/ref/fate/vc1_sa00050 b/deps/libav/tests/ref/fate/vc1_sa00050
deleted file mode 100644
index 89a3840..0000000
--- a/deps/libav/tests/ref/fate/vc1_sa00050
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   115200, 0xb8830eef
-0,          1,          1,        1,   115200, 0xb8830eef
-0,          2,          2,        1,   115200, 0xb8830eef
-0,          4,          4,        1,   115200, 0x952ff5e1
-0,          5,          5,        1,   115200, 0xa4362b14
-0,          6,          6,        1,   115200, 0x32bacbe7
-0,          7,          7,        1,   115200, 0x509eb814
-0,          8,          8,        1,   115200, 0x509eb814
-0,          9,          9,        1,   115200, 0x11a76c3e
-0,         10,         10,        1,   115200, 0x11a76c3e
-0,         11,         11,        1,   115200, 0x00cf734a
-0,         12,         12,        1,   115200, 0x00cf734a
-0,         13,         13,        1,   115200, 0x00cf734a
-0,         14,         14,        1,   115200, 0x00cf734a
-0,         15,         15,        1,   115200, 0x00cf734a
-0,         16,         16,        1,   115200, 0x00cf734a
-0,         17,         17,        1,   115200, 0x00cf734a
-0,         18,         18,        1,   115200, 0x00cf734a
-0,         19,         19,        1,   115200, 0xfddf48e6
-0,         20,         20,        1,   115200, 0xfddf48e6
-0,         21,         21,        1,   115200, 0x1eccebbf
-0,         22,         22,        1,   115200, 0x3da2f77e
-0,         23,         23,        1,   115200, 0x7c232572
-0,         24,         24,        1,   115200, 0xedf426e5
-0,         25,         25,        1,   115200, 0x5324ab20
-0,         26,         26,        1,   115200, 0x5324ab20
-0,         27,         27,        1,   115200, 0xa23e66bb
-0,         28,         28,        1,   115200, 0x680a50ff
-0,         29,         29,        1,   115200, 0x680a50ff
-0,         30,         30,        1,   115200, 0x680a50ff
diff --git a/deps/libav/tests/ref/fate/vc1_sa10091 b/deps/libav/tests/ref/fate/vc1_sa10091
deleted file mode 100644
index 33326d6..0000000
--- a/deps/libav/tests/ref/fate/vc1_sa10091
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0xae20b4fa
-0,          2,          2,        1,   518400, 0x2b4ccdf9
-0,          3,          3,        1,   518400, 0x2b4ccdf9
-0,          4,          4,        1,   518400, 0x2b4ccdf9
-0,          5,          5,        1,   518400, 0x2b4ccdf9
-0,          6,          6,        1,   518400, 0x2b4ccdf9
-0,          7,          7,        1,   518400, 0x70d9a891
-0,          8,          8,        1,   518400, 0x70d9a891
-0,          9,          9,        1,   518400, 0x70d9a891
-0,         10,         10,        1,   518400, 0xa461ee86
-0,         11,         11,        1,   518400, 0x722bc6e8
-0,         12,         12,        1,   518400, 0x722bc6e8
-0,         13,         13,        1,   518400, 0x722bc6e8
-0,         14,         14,        1,   518400, 0xf752fd2c
-0,         15,         15,        1,   518400, 0xf752fd2c
-0,         16,         16,        1,   518400, 0x91abcaca
-0,         17,         17,        1,   518400, 0x572727c3
-0,         18,         18,        1,   518400, 0x572727c3
-0,         19,         19,        1,   518400, 0x24c12382
-0,         20,         20,        1,   518400, 0x24c12382
-0,         21,         21,        1,   518400, 0x9aa39fe8
-0,         22,         22,        1,   518400, 0x9aa39fe8
-0,         23,         23,        1,   518400, 0x5cb6bd19
-0,         24,         24,        1,   518400, 0x704d9300
-0,         25,         25,        1,   518400, 0x590fad49
-0,         26,         26,        1,   518400, 0x590fad49
-0,         27,         27,        1,   518400, 0x590fad49
-0,         28,         28,        1,   518400, 0x46bea10b
-0,         29,         29,        1,   518400, 0x46bea10b
-0,         30,         30,        1,   518400, 0x46bea10b
diff --git a/deps/libav/tests/ref/fate/vc1_sa10143 b/deps/libav/tests/ref/fate/vc1_sa10143
deleted file mode 100644
index 6a5137f..0000000
--- a/deps/libav/tests/ref/fate/vc1_sa10143
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   518400, 0x89407f55
-0,          2,          2,        1,   518400, 0x8611849c
-0,          3,          3,        1,   518400, 0x0e69ff59
-0,          4,          4,        1,   518400, 0xf31adb03
-0,          5,          5,        1,   518400, 0x1a5b6a69
-0,          6,          6,        1,   518400, 0x6ae6232e
-0,          7,          7,        1,   518400, 0x9a4e3c54
-0,          8,          8,        1,   518400, 0xe5852b45
-0,          9,          9,        1,   518400, 0x0fcfeebc
-0,         10,         10,        1,   518400, 0x06e22dc3
-0,         11,         11,        1,   518400, 0x9d79df09
-0,         12,         12,        1,   518400, 0xcb2c716f
-0,         13,         13,        1,   518400, 0x638a8746
-0,         14,         14,        1,   518400, 0xf7032efd
-0,         15,         15,        1,   518400, 0x306f6cef
-0,         16,         16,        1,   518400, 0xe83d2518
-0,         17,         17,        1,   518400, 0x49ab5bf5
-0,         18,         18,        1,   518400, 0x6b336b6f
-0,         19,         19,        1,   518400, 0x95ae00c9
-0,         20,         20,        1,   518400, 0x68ddb64f
-0,         21,         21,        1,   518400, 0x5205ea68
-0,         22,         22,        1,   518400, 0xb088e617
-0,         23,         23,        1,   518400, 0xa3217616
-0,         24,         24,        1,   518400, 0x1723bc53
-0,         25,         25,        1,   518400, 0xf024872a
-0,         26,         26,        1,   518400, 0x2e81a8bb
-0,         27,         27,        1,   518400, 0xa3a2418e
-0,         28,         28,        1,   518400, 0xb7beffed
-0,         29,         29,        1,   518400, 0x50fb6c94
-0,         30,         30,        1,   518400, 0x5584bb40
diff --git a/deps/libav/tests/ref/fate/vc1_sa20021 b/deps/libav/tests/ref/fate/vc1_sa20021
deleted file mode 100644
index 22989a0..0000000
--- a/deps/libav/tests/ref/fate/vc1_sa20021
+++ /dev/null
@@ -1,61 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   506880, 0x884bc093
-0,          2,          2,        1,   506880, 0x4b09548f
-0,          3,          3,        1,   506880, 0x195cbee1
-0,          4,          4,        1,   506880, 0xc8141e28
-0,          5,          5,        1,   506880, 0xb170c49b
-0,          6,          6,        1,   506880, 0x2782268a
-0,          7,          7,        1,   506880, 0x2782268a
-0,          8,          8,        1,   506880, 0x2782268a
-0,          9,          9,        1,   506880, 0x2782268a
-0,         10,         10,        1,   506880, 0xe6803b32
-0,         11,         11,        1,   506880, 0xe6803b32
-0,         12,         12,        1,   506880, 0xa5ef9baf
-0,         13,         13,        1,   506880, 0xa5ef9baf
-0,         14,         14,        1,   506880, 0x46e8cbcb
-0,         15,         15,        1,   506880, 0x28a2239b
-0,         16,         16,        1,   506880, 0x7667af2f
-0,         17,         17,        1,   506880, 0x7667af2f
-0,         18,         18,        1,   506880, 0x8011bcaf
-0,         19,         19,        1,   506880, 0xd422115b
-0,         20,         20,        1,   506880, 0xd422115b
-0,         21,         21,        1,   506880, 0xd422115b
-0,         22,         22,        1,   506880, 0xbcee0b5b
-0,         23,         23,        1,   506880, 0x08fe9ec8
-0,         24,         24,        1,   506880, 0xc8fb8b37
-0,         25,         25,        1,   506880, 0xc8fb8b37
-0,         26,         26,        1,   506880, 0x2c698b52
-0,         27,         27,        1,   506880, 0x2c698b52
-0,         28,         28,        1,   506880, 0x2c698b52
-0,         29,         29,        1,   506880, 0x2b4ad9bc
-0,         30,         30,        1,   506880, 0x2b4ad9bc
-0,         31,         31,        1,   506880, 0x2b4ad9bc
-0,         32,         32,        1,   506880, 0x2b4ad9bc
-0,         33,         33,        1,   506880, 0x92e84ebb
-0,         34,         34,        1,   506880, 0x92e84ebb
-0,         35,         35,        1,   506880, 0xdb877da3
-0,         36,         36,        1,   506880, 0xdb877da3
-0,         37,         37,        1,   506880, 0xdb877da3
-0,         38,         38,        1,   506880, 0x44610654
-0,         39,         39,        1,   506880, 0x44610654
-0,         40,         40,        1,   506880, 0xe254ce67
-0,         41,         41,        1,   506880, 0xa6085385
-0,         42,         42,        1,   506880, 0x2d45d744
-0,         43,         43,        1,   506880, 0x2d45d744
-0,         44,         44,        1,   506880, 0x6e684f51
-0,         45,         45,        1,   506880, 0xe96186cf
-0,         46,         46,        1,   506880, 0xb535d369
-0,         47,         47,        1,   506880, 0xb535d369
-0,         48,         48,        1,   506880, 0xb535d369
-0,         49,         49,        1,   506880, 0xeed0b7e0
-0,         50,         50,        1,   506880, 0xeed0b7e0
-0,         51,         51,        1,   506880, 0xeed0b7e0
-0,         52,         52,        1,   506880, 0xeed0b7e0
-0,         53,         53,        1,   506880, 0x8789b20b
-0,         54,         54,        1,   506880, 0x0a0f42fb
-0,         55,         55,        1,   506880, 0x09bbac2d
-0,         56,         56,        1,   506880, 0x09bbac2d
-0,         57,         57,        1,   506880, 0x09bbac2d
-0,         58,         58,        1,   506880, 0x09bbac2d
-0,         59,         59,        1,   506880, 0x09bbac2d
-0,         60,         60,        1,   506880, 0xda77f0df
diff --git a/deps/libav/tests/ref/fate/vcr1 b/deps/libav/tests/ref/fate/vcr1
deleted file mode 100644
index da21df4..0000000
--- a/deps/libav/tests/ref/fate/vcr1
+++ /dev/null
@@ -1,129 +0,0 @@
-#tb 0: 66099/1000000
-0,          0,          0,        1,    28512, 0x7165286d
-0,          1,          1,        1,    28512, 0x2b842acc
-0,          2,          2,        1,    28512, 0x6d1b8e85
-0,          3,          3,        1,    28512, 0xc5042fab
-0,          4,          4,        1,    28512, 0x8b84fa8d
-0,          5,          5,        1,    28512, 0x2ba34ee5
-0,          6,          6,        1,    28512, 0x48493c3a
-0,          7,          7,        1,    28512, 0xbd774ff0
-0,          8,          8,        1,    28512, 0xf2e2edcd
-0,          9,          9,        1,    28512, 0x9364c39e
-0,         10,         10,        1,    28512, 0x7203d4d0
-0,         11,         11,        1,    28512, 0x3771e23e
-0,         12,         12,        1,    28512, 0xf332b71e
-0,         13,         13,        1,    28512, 0x64d9aedb
-0,         14,         14,        1,    28512, 0xc8f9cdbe
-0,         15,         15,        1,    28512, 0xf077a6e8
-0,         16,         16,        1,    28512, 0xa9958897
-0,         17,         17,        1,    28512, 0x89fb6c6e
-0,         18,         18,        1,    28512, 0x05b7350c
-0,         19,         19,        1,    28512, 0x23cf3ec8
-0,         20,         20,        1,    28512, 0xf9105aa6
-0,         21,         21,        1,    28512, 0x37ed48cb
-0,         22,         22,        1,    28512, 0xf4b15ce3
-0,         23,         23,        1,    28512, 0x64b994b8
-0,         24,         24,        1,    28512, 0x6731c26b
-0,         25,         25,        1,    28512, 0x650d110b
-0,         26,         26,        1,    28512, 0xbbb248ca
-0,         27,         27,        1,    28512, 0x426ab4ab
-0,         28,         28,        1,    28512, 0xb7f2e361
-0,         29,         29,        1,    28512, 0xced16599
-0,         30,         30,        1,    28512, 0xebf11860
-0,         31,         31,        1,    28512, 0xefe1df5f
-0,         32,         32,        1,    28512, 0x2afc432e
-0,         33,         33,        1,    28512, 0x07bd3eea
-0,         34,         34,        1,    28512, 0x8b133899
-0,         35,         35,        1,    28512, 0x0830f148
-0,         36,         36,        1,    28512, 0x871fc549
-0,         37,         37,        1,    28512, 0x0082c863
-0,         38,         38,        1,    28512, 0x6144bdce
-0,         39,         39,        1,    28512, 0x0af772ea
-0,         40,         40,        1,    28512, 0x982b8707
-0,         41,         41,        1,    28512, 0x565a3bfe
-0,         42,         42,        1,    28512, 0xdf14192e
-0,         43,         43,        1,    28512, 0x0c5ffcc1
-0,         44,         44,        1,    28512, 0x87532564
-0,         45,         45,        1,    28512, 0x0ba1661b
-0,         46,         46,        1,    28512, 0xd0e7a750
-0,         47,         47,        1,    28512, 0x5add4281
-0,         48,         48,        1,    28512, 0x9f45c597
-0,         49,         49,        1,    28512, 0x921736d0
-0,         50,         50,        1,    28512, 0xab177a89
-0,         51,         51,        1,    28512, 0xb83a6f7c
-0,         52,         52,        1,    28512, 0x9bf6716b
-0,         53,         53,        1,    28512, 0xc8ca0f4f
-0,         54,         54,        1,    28512, 0x2ca6c753
-0,         55,         55,        1,    28512, 0xc2f67d1f
-0,         56,         56,        1,    28512, 0x9b0e1d7b
-0,         57,         57,        1,    28512, 0x5257c5d0
-0,         58,         58,        1,    28512, 0xf256bd2f
-0,         59,         59,        1,    28512, 0x1b04bd04
-0,         60,         60,        1,    28512, 0x83deb9e4
-0,         61,         61,        1,    28512, 0x5f3aa6b4
-0,         62,         62,        1,    28512, 0x9313c5f3
-0,         63,         63,        1,    28512, 0x1cfe0c23
-0,         64,         64,        1,    28512, 0x3e9b37bf
-0,         65,         65,        1,    28512, 0x1603b386
-0,         66,         66,        1,    28512, 0x3e70da87
-0,         67,         67,        1,    28512, 0xa6684712
-0,         68,         68,        1,    28512, 0x0454bbb7
-0,         69,         69,        1,    28512, 0x7cf2f717
-0,         70,         70,        1,    28512, 0xdfbd424c
-0,         71,         71,        1,    28512, 0x7318a177
-0,         72,         72,        1,    28512, 0xbffcd503
-0,         73,         73,        1,    28512, 0x85db177d
-0,         74,         74,        1,    28512, 0x2a8269d1
-0,         75,         75,        1,    28512, 0xb5455cd5
-0,         76,         76,        1,    28512, 0x5fd79a35
-0,         77,         77,        1,    28512, 0xc1a7c005
-0,         78,         78,        1,    28512, 0x55230bb0
-0,         79,         79,        1,    28512, 0x5acf45d9
-0,         80,         80,        1,    28512, 0xdf1259bf
-0,         81,         81,        1,    28512, 0xe04e87eb
-0,         82,         82,        1,    28512, 0xfd25abc0
-0,         83,         83,        1,    28512, 0x38c4d017
-0,         84,         84,        1,    28512, 0x7b15d521
-0,         85,         85,        1,    28512, 0xb156b981
-0,         86,         86,        1,    28512, 0xcc99cd09
-0,         87,         87,        1,    28512, 0x633a9cec
-0,         88,         88,        1,    28512, 0xf00a7c1b
-0,         89,         89,        1,    28512, 0x426250e9
-0,         90,         90,        1,    28512, 0xfad02714
-0,         91,         91,        1,    28512, 0x1ea5d8d2
-0,         92,         92,        1,    28512, 0x581ea622
-0,         93,         93,        1,    28512, 0x6b225f61
-0,         94,         94,        1,    28512, 0x68f337e6
-0,         95,         95,        1,    28512, 0x85f7060e
-0,         96,         96,        1,    28512, 0xaa3b1086
-0,         97,         97,        1,    28512, 0x91fa1371
-0,         98,         98,        1,    28512, 0x92acd34a
-0,         99,         99,        1,    28512, 0x0ae8c1e6
-0,        100,        100,        1,    28512, 0x1335a5b3
-0,        101,        101,        1,    28512, 0xc364a5e7
-0,        102,        102,        1,    28512, 0x19b9819a
-0,        103,        103,        1,    28512, 0xd42d7045
-0,        104,        104,        1,    28512, 0x4c866a18
-0,        105,        105,        1,    28512, 0xf0a99685
-0,        106,        106,        1,    28512, 0x47a4a1bd
-0,        107,        107,        1,    28512, 0x8dd09006
-0,        108,        108,        1,    28512, 0x3f0b742d
-0,        109,        109,        1,    28512, 0x1acf52be
-0,        110,        110,        1,    28512, 0x9e5d1460
-0,        111,        111,        1,    28512, 0xd6852de9
-0,        112,        112,        1,    28512, 0x36e00f16
-0,        113,        113,        1,    28512, 0xe83dea09
-0,        114,        114,        1,    28512, 0xbb71daf1
-0,        115,        115,        1,    28512, 0xaeedf763
-0,        116,        116,        1,    28512, 0xa793ed91
-0,        117,        117,        1,    28512, 0x9b0f093f
-0,        118,        118,        1,    28512, 0xc8504b43
-0,        119,        119,        1,    28512, 0x08c68319
-0,        120,        120,        1,    28512, 0x2284b24a
-0,        121,        121,        1,    28512, 0x5980e906
-0,        122,        122,        1,    28512, 0x6ffd2c14
-0,        123,        123,        1,    28512, 0x5c6c3c27
-0,        124,        124,        1,    28512, 0x20d2efec
-0,        125,        125,        1,    28512, 0x69ffec11
-0,        126,        126,        1,    28512, 0x8721f8ab
-0,        127,        127,        1,    28512, 0xb606e164
diff --git a/deps/libav/tests/ref/fate/videoxl b/deps/libav/tests/ref/fate/videoxl
deleted file mode 100644
index 4d2db37..0000000
--- a/deps/libav/tests/ref/fate/videoxl
+++ /dev/null
@@ -1,41 +0,0 @@
-#tb 0: 71/500
-0,          0,          0,        1,    36096, 0xab1c53c1
-0,          1,          1,        1,    36096, 0x8b598ff3
-0,          2,          2,        1,    36096, 0xe9a5f3eb
-0,          3,          3,        1,    36096, 0x10584b30
-0,          4,          4,        1,    36096, 0x19d8c5d2
-0,          5,          5,        1,    36096, 0x43a453b9
-0,          6,          6,        1,    36096, 0xb32db13b
-0,          7,          7,        1,    36096, 0xf117e7b3
-0,          8,          8,        1,    36096, 0x9171fb33
-0,          9,          9,        1,    36096, 0xdf84081c
-0,         10,         10,        1,    36096, 0xc9d9527e
-0,         11,         11,        1,    36096, 0x72fa295e
-0,         12,         12,        1,    36096, 0xce02060e
-0,         13,         13,        1,    36096, 0x31f5fdbd
-0,         14,         14,        1,    36096, 0x4179dc07
-0,         15,         15,        1,    36096, 0xf250c03f
-0,         16,         16,        1,    36096, 0xc4aca7c5
-0,         17,         17,        1,    36096, 0xd9b1837f
-0,         18,         18,        1,    36096, 0x0af164ef
-0,         19,         19,        1,    36096, 0x90123fcd
-0,         20,         20,        1,    36096, 0x60392815
-0,         21,         21,        1,    36096, 0x7a7b0ac9
-0,         22,         22,        1,    36096, 0x36c1fe9c
-0,         23,         23,        1,    36096, 0x50bed8a4
-0,         24,         24,        1,    36096, 0x10f3b998
-0,         25,         25,        1,    36096, 0x18e5b516
-0,         26,         26,        1,    36096, 0x860597dc
-0,         27,         27,        1,    36096, 0x05488146
-0,         28,         28,        1,    36096, 0xac577cec
-0,         29,         29,        1,    36096, 0xc9f95550
-0,         30,         30,        1,    36096, 0xa0c95270
-0,         31,         31,        1,    36096, 0x977c5bf2
-0,         32,         32,        1,    36096, 0xc9f95550
-0,         33,         33,        1,    36096, 0xa0c95270
-0,         34,         34,        1,    36096, 0x977c5bf2
-0,         35,         35,        1,    36096, 0xc9f95550
-0,         36,         36,        1,    36096, 0xa0c95270
-0,         37,         37,        1,    36096, 0x977c5bf2
-0,         38,         38,        1,    36096, 0xc9f95550
-0,         39,         39,        1,    36096, 0xa0c95270
diff --git a/deps/libav/tests/ref/fate/vmnc-16bit b/deps/libav/tests/ref/fate/vmnc-16bit
deleted file mode 100644
index 2a1848e..0000000
--- a/deps/libav/tests/ref/fate/vmnc-16bit
+++ /dev/null
@@ -1,193 +0,0 @@
-#tb 0: 1/5
-0,          0,          0,        1,   864000, 0x9b1cee65
-0,          1,          1,        1,   864000, 0x82950e3f
-0,          2,          2,        1,   864000, 0x335f9678
-0,          3,          3,        1,   864000, 0x6b86b7e7
-0,          4,          4,        1,   864000, 0x25618cf2
-0,          5,          5,        1,   864000, 0xed2196c9
-0,          6,          6,        1,   864000, 0xbeaa31ba
-0,          7,          7,        1,   864000, 0x14e6c8ab
-0,          8,          8,        1,   864000, 0x17e5c196
-0,          9,          9,        1,   864000, 0x4aa15110
-0,         10,         10,        1,   864000, 0x4aa15110
-0,         11,         11,        1,   864000, 0x4aa15110
-0,         12,         12,        1,   864000, 0x3c2d3809
-0,         13,         13,        1,   864000, 0xd075f4d0
-0,         14,         14,        1,   864000, 0x0c3f2833
-0,         15,         15,        1,   864000, 0xe7471872
-0,         16,         16,        1,   864000, 0x4300b71d
-0,         17,         17,        1,   864000, 0x6b5844ec
-0,         18,         18,        1,   864000, 0xb3ebc395
-0,         19,         19,        1,   864000, 0x39aa8a7d
-0,         20,         20,        1,   864000, 0x52a3d93d
-0,         21,         21,        1,   864000, 0x73adbdac
-0,         22,         22,        1,   864000, 0xa9fd6cdc
-0,         23,         23,        1,   864000, 0x4a085344
-0,         24,         24,        1,   864000, 0xc21b943c
-0,         25,         25,        1,   864000, 0xfaef6ed4
-0,         26,         26,        1,   864000, 0xa3e9163c
-0,         27,         27,        1,   864000, 0x917e2be4
-0,         28,         28,        1,   864000, 0x2d89d534
-0,         29,         29,        1,   864000, 0x6fe5a9e4
-0,         30,         30,        1,   864000, 0x71af29ec
-0,         31,         31,        1,   864000, 0x8f33f6ad
-0,         32,         32,        1,   864000, 0xe7d46a24
-0,         33,         33,        1,   864000, 0xb631e044
-0,         34,         34,        1,   864000, 0x77db01cb
-0,         35,         35,        1,   864000, 0x9861b6ec
-0,         36,         36,        1,   864000, 0x973bd263
-0,         37,         37,        1,   864000, 0xdd4c175b
-0,         38,         38,        1,   864000, 0xdc28469b
-0,         39,         39,        1,   864000, 0x67393ebb
-0,         40,         40,        1,   864000, 0x01a06813
-0,         41,         41,        1,   864000, 0x63e88f73
-0,         42,         42,        1,   864000, 0x3ffbdd73
-0,         43,         43,        1,   864000, 0xd25f790b
-0,         44,         44,        1,   864000, 0x14e3c5d3
-0,         45,         45,        1,   864000, 0x0d3d1202
-0,         46,         46,        1,   864000, 0x69decf03
-0,         47,         47,        1,   864000, 0x1b20ab93
-0,         48,         48,        1,   864000, 0xee2f8d4a
-0,         49,         49,        1,   864000, 0xaac44c52
-0,         50,         50,        1,   864000, 0x3f874a5a
-0,         51,         51,        1,   864000, 0x239b2d7a
-0,         52,         52,        1,   864000, 0xb85db552
-0,         53,         53,        1,   864000, 0xb12962a2
-0,         54,         54,        1,   864000, 0xb8270fd9
-0,         55,         55,        1,   864000, 0x14930601
-0,         56,         56,        1,   864000, 0x827a15c1
-0,         57,         57,        1,   864000, 0xe31011d1
-0,         58,         58,        1,   864000, 0xcd2154c1
-0,         59,         59,        1,   864000, 0xad02dbd9
-0,         60,         60,        1,   864000, 0x40c17d58
-0,         61,         61,        1,   864000, 0x8219e3b9
-0,         62,         62,        1,   864000, 0x2d348340
-0,         63,         63,        1,   864000, 0x6b61dfc9
-0,         64,         64,        1,   864000, 0xc8d95be1
-0,         65,         65,        1,   864000, 0x70ba0918
-0,         66,         66,        1,   864000, 0xdc728131
-0,         67,         67,        1,   864000, 0x9b054a10
-0,         68,         68,        1,   864000, 0x3983f751
-0,         69,         69,        1,   864000, 0x325fe1a9
-0,         70,         70,        1,   864000, 0x7a41eac0
-0,         71,         71,        1,   864000, 0x324372a8
-0,         72,         72,        1,   864000, 0xc014ea18
-0,         73,         73,        1,   864000, 0x1a506a1f
-0,         74,         74,        1,   864000, 0x47b59557
-0,         75,         75,        1,   864000, 0x5f2e194f
-0,         76,         76,        1,   864000, 0x9f6abb68
-0,         77,         77,        1,   864000, 0x831d2b97
-0,         78,         78,        1,   864000, 0x0635af7f
-0,         79,         79,        1,   864000, 0xe54a5626
-0,         80,         80,        1,   864000, 0x704dca4f
-0,         81,         81,        1,   864000, 0x47de6676
-0,         82,         82,        1,   864000, 0x609705fd
-0,         83,         83,        1,   864000, 0x8d92e086
-0,         84,         84,        1,   864000, 0xdb7dab5e
-0,         85,         85,        1,   864000, 0xe6ccb686
-0,         86,         86,        1,   864000, 0x0d137f66
-0,         87,         87,        1,   864000, 0xd200035d
-0,         88,         88,        1,   864000, 0x7dcb959d
-0,         89,         89,        1,   864000, 0xee849f75
-0,         90,         90,        1,   864000, 0x89d14acd
-0,         91,         91,        1,   864000, 0x3738029d
-0,         92,         92,        1,   864000, 0x6f4c4395
-0,         93,         93,        1,   864000, 0x06334395
-0,         94,         94,        1,   864000, 0x238b7c94
-0,         95,         95,        1,   864000, 0xfa5d1e14
-0,         96,         96,        1,   864000, 0x50b10e54
-0,         97,         97,        1,   864000, 0x9ed3b6e4
-0,         98,         98,        1,   864000, 0x68da9374
-0,         99,         99,        1,   864000, 0xb32a137c
-0,        100,        100,        1,   864000, 0x577d5084
-0,        101,        101,        1,   864000, 0xd262176b
-0,        102,        102,        1,   864000, 0xf58b44b3
-0,        103,        103,        1,   864000, 0xd0828edc
-0,        104,        104,        1,   864000, 0xc91a7544
-0,        105,        105,        1,   864000, 0x18ae7f1c
-0,        106,        106,        1,   864000, 0x82623643
-0,        107,        107,        1,   864000, 0x9cf82cfb
-0,        108,        108,        1,   864000, 0x93ad116b
-0,        109,        109,        1,   864000, 0xa669044b
-0,        110,        110,        1,   864000, 0x8adf88c3
-0,        111,        111,        1,   864000, 0xb83fb413
-0,        112,        112,        1,   864000, 0xb9e291f3
-0,        113,        113,        1,   864000, 0x5833dcc3
-0,        114,        114,        1,   864000, 0x4ab825aa
-0,        115,        115,        1,   864000, 0xb52c3b53
-0,        116,        116,        1,   864000, 0x0cb0dd53
-0,        117,        117,        1,   864000, 0x98b8dd52
-0,        118,        118,        1,   864000, 0x989230ba
-0,        119,        119,        1,   864000, 0xaed4c073
-0,        120,        120,        1,   864000, 0x76a7c83a
-0,        121,        121,        1,   864000, 0x02711eea
-0,        122,        122,        1,   864000, 0x8de65fe2
-0,        123,        123,        1,   864000, 0xc1163689
-0,        124,        124,        1,   864000, 0xc04f8b31
-0,        125,        125,        1,   864000, 0x69218d2a
-0,        126,        126,        1,   864000, 0x7e3abe62
-0,        127,        127,        1,   864000, 0x00ebe27a
-0,        128,        128,        1,   864000, 0x34803f11
-0,        129,        129,        1,   864000, 0x85591cd9
-0,        130,        130,        1,   864000, 0x8422fb51
-0,        131,        131,        1,   864000, 0x67c759e1
-0,        132,        132,        1,   864000, 0x4ac36af1
-0,        133,        133,        1,   864000, 0xdf00fca2
-0,        134,        134,        1,   864000, 0x74c633d1
-0,        135,        135,        1,   864000, 0x00251c31
-0,        136,        136,        1,   864000, 0x6d12a499
-0,        137,        137,        1,   864000, 0x1b6492e1
-0,        138,        138,        1,   864000, 0xdfc9a2a1
-0,        139,        139,        1,   864000, 0x33dcac79
-0,        140,        140,        1,   864000, 0x2305a499
-0,        141,        141,        1,   864000, 0xe1f3ae71
-0,        142,        142,        1,   864000, 0xc0cc92e1
-0,        143,        143,        1,   864000, 0x53d3b261
-0,        144,        144,        1,   864000, 0xf953aa81
-0,        145,        145,        1,   864000, 0x4108da69
-0,        146,        146,        1,   864000, 0xd6acf9e9
-0,        147,        147,        1,   864000, 0xb97ed900
-0,        148,        148,        1,   864000, 0x1d8b7a80
-0,        149,        149,        1,   864000, 0xd5406cb8
-0,        150,        150,        1,   864000, 0x5aa34948
-0,        151,        151,        1,   864000, 0x328eee01
-0,        152,        152,        1,   864000, 0xac92e621
-0,        153,        153,        1,   864000, 0x4fa1f5e1
-0,        154,        154,        1,   864000, 0xf7c4e8a8
-0,        155,        155,        1,   864000, 0xc358bd58
-0,        156,        156,        1,   864000, 0x29ec4b27
-0,        157,        157,        1,   864000, 0xf7219c88
-0,        158,        158,        1,   864000, 0xe77ff130
-0,        159,        159,        1,   864000, 0x73683417
-0,        160,        160,        1,   864000, 0x08b6be77
-0,        161,        161,        1,   864000, 0x3a7eea6f
-0,        162,        162,        1,   864000, 0xb319cce7
-0,        163,        163,        1,   864000, 0x9607b13e
-0,        164,        164,        1,   864000, 0x30543f0d
-0,        165,        165,        1,   864000, 0x56915a9e
-0,        166,        166,        1,   864000, 0x79f158a6
-0,        167,        167,        1,   864000, 0x498b8bd6
-0,        168,        168,        1,   864000, 0xe9ad7046
-0,        169,        169,        1,   864000, 0xe9ad7046
-0,        170,        170,        1,   864000, 0x10317e0e
-0,        171,        171,        1,   864000, 0x10317e0e
-0,        172,        172,        1,   864000, 0x10317e0e
-0,        173,        173,        1,   864000, 0x99ec7046
-0,        174,        174,        1,   864000, 0x924d46ee
-0,        175,        175,        1,   864000, 0x98bf333e
-0,        176,        176,        1,   864000, 0xb2625c96
-0,        177,        177,        1,   864000, 0xb46b3926
-0,        178,        178,        1,   864000, 0xeb4e5c96
-0,        179,        179,        1,   864000, 0x87154ece
-0,        180,        180,        1,   864000, 0x9e4c666e
-0,        181,        181,        1,   864000, 0x65b53d16
-0,        182,        182,        1,   864000, 0x99e85e8e
-0,        183,        183,        1,   864000, 0x650ba17e
-0,        184,        184,        1,   864000, 0x1ecb000e
-0,        185,        185,        1,   864000, 0xb942327d
-0,        186,        186,        1,   864000, 0x1bf20925
-0,        187,        187,        1,   864000, 0x61dba6a5
-0,        188,        188,        1,   864000, 0x5de16d8d
-0,        189,        189,        1,   864000, 0x4eb1f75d
-0,        190,        190,        1,   864000, 0x4eb1f75d
-0,        191,        191,        1,   864000, 0xd0750144
diff --git a/deps/libav/tests/ref/fate/vmnc-32bit b/deps/libav/tests/ref/fate/vmnc-32bit
deleted file mode 100644
index d55d88f..0000000
--- a/deps/libav/tests/ref/fate/vmnc-32bit
+++ /dev/null
@@ -1,50 +0,0 @@
-#tb 0: 1/5
-0,          0,          0,        1,  3655644, 0x87973530
-0,          1,          1,        1,  3655644, 0x87973530
-0,          2,          2,        1,  3655644, 0x3c3167fd
-0,          5,          5,        1,  3655644, 0x87973530
-0,          7,          7,        1,  3655644, 0x3c3167fd
-0,         10,         10,        1,  3655644, 0x87973530
-0,         11,         11,        1,  3655644, 0x87973530
-0,         12,         12,        1,  3655644, 0x3c3167fd
-0,         15,         15,        1,  3655644, 0x87973530
-0,         18,         18,        1,  3655644, 0x4f0da763
-0,         19,         19,        1,  3655644, 0x66a4a763
-0,         20,         20,        1,  3655644, 0xb20a7496
-0,         23,         23,        1,  3655644, 0x66a4a763
-0,         24,         24,        1,  3655644, 0x5600644a
-0,         26,         26,        1,  3655644, 0xce5880ee
-0,         49,         49,        1,  3655644, 0xa993ef3d
-0,         61,         61,        1,  3655644, 0x73564014
-0,         64,         64,        1,  3655644, 0x2a6e1e8c
-0,         68,         68,        1,  3655644, 0xbae02e7c
-0,         72,         72,        1,  3655644, 0x55af4a2d
-0,         73,         73,        1,  3655644, 0x54b7ff2d
-0,         77,         77,        1,  3655644, 0x39af1aed
-0,         82,         82,        1,  3655644, 0xe48dd11c
-0,         89,         89,        1,  3655644, 0xba15c78d
-0,         96,         96,        1,  3655644, 0x39af1aed
-0,        103,        103,        1,  3655644, 0x27f96cd8
-0,        110,        110,        1,  3655644, 0xf4f068dc
-0,        111,        111,        1,  3655644, 0xf1c55cf5
-0,        113,        113,        1,  3655644, 0xd932633d
-0,        114,        114,        1,  3655644, 0xc6e95e0a
-0,        115,        115,        1,  3655644, 0x9a63c9de
-0,        116,        116,        1,  3655644, 0xf166ad4f
-0,        117,        117,        1,  3655644, 0xe9eeba41
-0,        118,        118,        1,  3655644, 0x7e598ad7
-0,        123,        123,        1,  3655644, 0xf3bd257e
-0,        127,        127,        1,  3655644, 0xf35b3852
-0,        128,        128,        1,  3655644, 0x9d553959
-0,        129,        129,        1,  3655644, 0x0a9de8e2
-0,        135,        135,        1,  3655644, 0xf2325b6c
-0,        137,        137,        1,  3655644, 0xcf924028
-0,        139,        139,        1,  3655644, 0x8dae55bc
-0,        141,        141,        1,  3655644, 0x57b08ced
-0,        143,        143,        1,  3655644, 0xef89a1d8
-0,        145,        145,        1,  3655644, 0x69e5503a
-0,        147,        147,        1,  3655644, 0xc3de7b3f
-0,        149,        149,        1,  3655644, 0x88eea64a
-0,        162,        162,        1,  3655644, 0xe39cce1f
-0,        166,        166,        1,  3655644, 0xf0ed0d04
-0,        171,        171,        1,  3655644, 0x32490d3e
diff --git a/deps/libav/tests/ref/fate/vp31 b/deps/libav/tests/ref/fate/vp31
deleted file mode 100644
index 48221c1..0000000
--- a/deps/libav/tests/ref/fate/vp31
+++ /dev/null
@@ -1,115 +0,0 @@
-#tb 0: 1/25
-0,          0,          0,        1,   261120, 0xc50dec2b
-0,          1,          1,        1,   261120, 0xaa8d4441
-0,          2,          2,        1,   261120, 0x932b0d44
-0,          3,          3,        1,   261120, 0x125e1af7
-0,          4,          4,        1,   261120, 0x09a763a5
-0,          5,          5,        1,   261120, 0x56939852
-0,          6,          6,        1,   261120, 0x0eda6d35
-0,          7,          7,        1,   261120, 0x2f0d3869
-0,          8,          8,        1,   261120, 0xe177c34c
-0,          9,          9,        1,   261120, 0x5d4e833a
-0,         10,         10,        1,   261120, 0x42e26e7a
-0,         11,         11,        1,   261120, 0xf5a60b4c
-0,         12,         12,        1,   261120, 0x29938341
-0,         13,         13,        1,   261120, 0x0a9ebb80
-0,         14,         14,        1,   261120, 0xd18c6a11
-0,         15,         15,        1,   261120, 0x4b8212ac
-0,         16,         16,        1,   261120, 0x7902aabc
-0,         17,         17,        1,   261120, 0x4babac44
-0,         18,         18,        1,   261120, 0xf33efa46
-0,         19,         19,        1,   261120, 0x110dd40a
-0,         20,         20,        1,   261120, 0xae327a8a
-0,         21,         21,        1,   261120, 0xab757d75
-0,         22,         22,        1,   261120, 0xfbd1402d
-0,         23,         23,        1,   261120, 0x4f2c5d31
-0,         24,         24,        1,   261120, 0xc7ea2149
-0,         25,         25,        1,   261120, 0x86072cf7
-0,         26,         26,        1,   261120, 0x37c2f2ed
-0,         27,         27,        1,   261120, 0x1d51ee83
-0,         28,         28,        1,   261120, 0x72291b8b
-0,         29,         29,        1,   261120, 0xe9c8ffaf
-0,         30,         30,        1,   261120, 0x657a1615
-0,         31,         31,        1,   261120, 0x6f832019
-0,         32,         32,        1,   261120, 0xf4445a22
-0,         33,         33,        1,   261120, 0x105306f0
-0,         34,         34,        1,   261120, 0x34c0c36b
-0,         35,         35,        1,   261120, 0x7767be18
-0,         36,         36,        1,   261120, 0x88a7eaeb
-0,         37,         37,        1,   261120, 0x797e69e4
-0,         38,         38,        1,   261120, 0x78901f02
-0,         39,         39,        1,   261120, 0xbc91758e
-0,         40,         40,        1,   261120, 0x35d47b24
-0,         41,         41,        1,   261120, 0xaf0ebc82
-0,         42,         42,        1,   261120, 0x40e63004
-0,         43,         43,        1,   261120, 0x70d1c5c1
-0,         44,         44,        1,   261120, 0x8aea2b70
-0,         45,         45,        1,   261120, 0x51f3cd81
-0,         46,         46,        1,   261120, 0x8f8584b7
-0,         47,         47,        1,   261120, 0x921541fb
-0,         48,         48,        1,   261120, 0xddd3f1ea
-0,         49,         49,        1,   261120, 0x6be2e960
-0,         50,         50,        1,   261120, 0x72997a1f
-0,         51,         51,        1,   261120, 0xe70fc009
-0,         52,         52,        1,   261120, 0x816a0687
-0,         53,         53,        1,   261120, 0x2aa79e82
-0,         54,         54,        1,   261120, 0x85f2fe5c
-0,         55,         55,        1,   261120, 0x000dd8b6
-0,         56,         56,        1,   261120, 0x1be19dd4
-0,         57,         57,        1,   261120, 0xadea80e5
-0,         58,         58,        1,   261120, 0x0cc2204f
-0,         59,         59,        1,   261120, 0xd62968a8
-0,         60,         60,        1,   261120, 0x0afc75c2
-0,         61,         61,        1,   261120, 0x82341f09
-0,         62,         62,        1,   261120, 0xbf7e66cd
-0,         63,         63,        1,   261120, 0x8f3491df
-0,         64,         64,        1,   261120, 0xc316d383
-0,         65,         65,        1,   261120, 0x3de7f632
-0,         66,         66,        1,   261120, 0xda55cfb0
-0,         67,         67,        1,   261120, 0xbd88bb46
-0,         68,         68,        1,   261120, 0x75444b17
-0,         69,         69,        1,   261120, 0x798cc498
-0,         70,         70,        1,   261120, 0xf9a60fa6
-0,         71,         71,        1,   261120, 0xbd8debd7
-0,         72,         72,        1,   261120, 0x7c890029
-0,         73,         73,        1,   261120, 0x7a75e44a
-0,         74,         74,        1,   261120, 0x1f04611c
-0,         75,         75,        1,   261120, 0x96b3ee93
-0,         76,         76,        1,   261120, 0x7fc11f39
-0,         77,         77,        1,   261120, 0xe87d6864
-0,         78,         78,        1,   261120, 0x6797d904
-0,         79,         79,        1,   261120, 0x9e3e7bde
-0,         80,         80,        1,   261120, 0xc31a8039
-0,         81,         81,        1,   261120, 0xe3ef4cf7
-0,         82,         82,        1,   261120, 0x83c56fc9
-0,         83,         83,        1,   261120, 0xb304f7aa
-0,         84,         84,        1,   261120, 0x039a7080
-0,         85,         85,        1,   261120, 0xffb08224
-0,         86,         86,        1,   261120, 0xa7be783a
-0,         87,         87,        1,   261120, 0x572beff3
-0,         88,         88,        1,   261120, 0x1bc59ae8
-0,         89,         89,        1,   261120, 0x11c8feb4
-0,         90,         90,        1,   261120, 0xe2398651
-0,         91,         91,        1,   261120, 0x37c3efba
-0,         92,         92,        1,   261120, 0xb32f0dd4
-0,         93,         93,        1,   261120, 0x66880c50
-0,         94,         94,        1,   261120, 0x4f7392c8
-0,         95,         95,        1,   261120, 0x3d5c08f6
-0,         96,         96,        1,   261120, 0xfd129211
-0,         97,         97,        1,   261120, 0x9b396ebe
-0,         98,         98,        1,   261120, 0x75ab9a4a
-0,         99,         99,        1,   261120, 0xf8c4e7ea
-0,        100,        100,        1,   261120, 0xdd48c7c3
-0,        101,        101,        1,   261120, 0xdebf20e6
-0,        102,        102,        1,   261120, 0x35c32091
-0,        103,        103,        1,   261120, 0xce5a49c7
-0,        104,        104,        1,   261120, 0x69fc8e0d
-0,        105,        105,        1,   261120, 0x43a08b41
-0,        106,        106,        1,   261120, 0x01a0513c
-0,        107,        107,        1,   261120, 0x1d3f490a
-0,        108,        108,        1,   261120, 0xb44df252
-0,        109,        109,        1,   261120, 0x1259753e
-0,        110,        110,        1,   261120, 0x4a1538d6
-0,        111,        111,        1,   261120, 0xd5ed4bd5
-0,        112,        112,        1,   261120, 0xa21590b5
-0,        113,        113,        1,   261120, 0xfb2de1f7
diff --git a/deps/libav/tests/ref/fate/vp5 b/deps/libav/tests/ref/fate/vp5
deleted file mode 100644
index 791fe60..0000000
--- a/deps/libav/tests/ref/fate/vp5
+++ /dev/null
@@ -1,247 +0,0 @@
-#tb 0: 1001/24000
-0,          0,          0,        1,   233472, 0x27488413
-0,          1,          1,        1,   233472, 0x4af384b5
-0,          2,          2,        1,   233472, 0x948d845d
-0,          3,          3,        1,   233472, 0xd6ed845e
-0,          4,          4,        1,   233472, 0x230f8444
-0,          5,          5,        1,   233472, 0x230f8444
-0,          6,          6,        1,   233472, 0x230f8444
-0,          7,          7,        1,   233472, 0xa5078424
-0,          8,          8,        1,   233472, 0xa5078424
-0,          9,          9,        1,   233472, 0xa5078424
-0,         10,         10,        1,   233472, 0xa5078424
-0,         11,         11,        1,   233472, 0xa5078424
-0,         12,         12,        1,   233472, 0xa5078424
-0,         13,         13,        1,   233472, 0xa5078424
-0,         14,         14,        1,   233472, 0xa5078424
-0,         15,         15,        1,   233472, 0xa5078424
-0,         16,         16,        1,   233472, 0xa5078424
-0,         17,         17,        1,   233472, 0xa5078424
-0,         18,         18,        1,   233472, 0xa5078424
-0,         19,         19,        1,   233472, 0xa5078424
-0,         20,         20,        1,   233472, 0xa5078424
-0,         21,         21,        1,   233472, 0xa5078424
-0,         22,         22,        1,   233472, 0xa5078424
-0,         23,         23,        1,   233472, 0xa5078424
-0,         24,         24,        1,   233472, 0xa5078424
-0,         25,         25,        1,   233472, 0xa5078424
-0,         26,         26,        1,   233472, 0xa5078424
-0,         27,         27,        1,   233472, 0xa5078424
-0,         28,         28,        1,   233472, 0xa5078424
-0,         29,         29,        1,   233472, 0xa5078424
-0,         30,         30,        1,   233472, 0xa5078424
-0,         31,         31,        1,   233472, 0xa5078424
-0,         32,         32,        1,   233472, 0xa5078424
-0,         33,         33,        1,   233472, 0xa5078424
-0,         34,         34,        1,   233472, 0xa5078424
-0,         35,         35,        1,   233472, 0xa5078424
-0,         36,         36,        1,   233472, 0xa5078424
-0,         37,         37,        1,   233472, 0xa5078424
-0,         38,         38,        1,   233472, 0xa5078424
-0,         39,         39,        1,   233472, 0xa5078424
-0,         40,         40,        1,   233472, 0x05667dea
-0,         41,         41,        1,   233472, 0x6ae1823e
-0,         42,         42,        1,   233472, 0x3c8a7ea9
-0,         43,         43,        1,   233472, 0xcae2832a
-0,         44,         44,        1,   233472, 0x547a7ec2
-0,         45,         45,        1,   233472, 0xa6628327
-0,         46,         46,        1,   233472, 0xecd77edc
-0,         47,         47,        1,   233472, 0xe9538356
-0,         48,         48,        1,   233472, 0xca297eb1
-0,         49,         49,        1,   233472, 0xe5648329
-0,         50,         50,        1,   233472, 0xad8c7e94
-0,         51,         51,        1,   233472, 0xca0d82fc
-0,         52,         52,        1,   233472, 0x62277e8d
-0,         53,         53,        1,   233472, 0x7ef782f5
-0,         54,         54,        1,   233472, 0x09b27e8d
-0,         55,         55,        1,   233472, 0x66f382f5
-0,         56,         56,        1,   233472, 0x0aaa7e8d
-0,         57,         57,        1,   233472, 0x676b82f5
-0,         58,         58,        1,   233472, 0x0a8a7e8d
-0,         59,         59,        1,   233472, 0x670b82f5
-0,         60,         60,        1,   233472, 0x09fa7e8d
-0,         61,         61,        1,   233472, 0x671b82f5
-0,         62,         62,        1,   233472, 0x0ac27e8d
-0,         63,         63,        1,   233472, 0x674382f5
-0,         64,         64,        1,   233472, 0x0a727e8d
-0,         65,         65,        1,   233472, 0x673382f5
-0,         66,         66,        1,   233472, 0x0a127e8d
-0,         67,         67,        1,   233472, 0x66f382f5
-0,         68,         68,        1,   233472, 0x0aaa7e8d
-0,         69,         69,        1,   233472, 0x676b82f5
-0,         70,         70,        1,   233472, 0x0a8a7e8d
-0,         71,         71,        1,   233472, 0x670b82f5
-0,         72,         72,        1,   233472, 0x09fa7e8d
-0,         73,         73,        1,   233472, 0x671b82f5
-0,         74,         74,        1,   233472, 0x0ac27e8d
-0,         75,         75,        1,   233472, 0x674382f5
-0,         76,         76,        1,   233472, 0x0a727e8d
-0,         77,         77,        1,   233472, 0x673382f5
-0,         78,         78,        1,   233472, 0x0a127e8d
-0,         79,         79,        1,   233472, 0xa3917e7f
-0,         80,         80,        1,   233472, 0x0554868d
-0,         81,         81,        1,   233472, 0x05ba6d7a
-0,         82,         82,        1,   233472, 0x05ba6d7a
-0,         83,         83,        1,   233472, 0x05ba6d7a
-0,         84,         84,        1,   233472, 0x05ba6d7a
-0,         85,         85,        1,   233472, 0x05ba6d7a
-0,         86,         86,        1,   233472, 0x05ba6d7a
-0,         87,         87,        1,   233472, 0x05ba6d7a
-0,         88,         88,        1,   233472, 0x05ba6d7a
-0,         89,         89,        1,   233472, 0x05ba6d7a
-0,         90,         90,        1,   233472, 0x05ba6d7a
-0,         91,         91,        1,   233472, 0x05ba6d7a
-0,         92,         92,        1,   233472, 0x05ba6d7a
-0,         93,         93,        1,   233472, 0x05ba6d7a
-0,         94,         94,        1,   233472, 0x05ba6d7a
-0,         95,         95,        1,   233472, 0x05ba6d7a
-0,         96,         96,        1,   233472, 0x05ba6d7a
-0,         97,         97,        1,   233472, 0x05ba6d7a
-0,         98,         98,        1,   233472, 0x05ba6d7a
-0,         99,         99,        1,   233472, 0x05ba6d7a
-0,        100,        100,        1,   233472, 0x05ba6d7a
-0,        101,        101,        1,   233472, 0x05ba6d7a
-0,        102,        102,        1,   233472, 0x05ba6d7a
-0,        103,        103,        1,   233472, 0x05ba6d7a
-0,        104,        104,        1,   233472, 0x3a6a6d61
-0,        105,        105,        1,   233472, 0x0bab7adc
-0,        106,        106,        1,   233472, 0x12b44993
-0,        107,        107,        1,   233472, 0xa20ad6d1
-0,        108,        108,        1,   233472, 0xfd916a4a
-0,        109,        109,        1,   233472, 0xd34f3e95
-0,        110,        110,        1,   233472, 0x19571d5c
-0,        111,        111,        1,   233472, 0x7c8351ad
-0,        112,        112,        1,   233472, 0xea279823
-0,        113,        113,        1,   233472, 0xc5011cfd
-0,        114,        114,        1,   233472, 0xbd7fb9af
-0,        115,        115,        1,   233472, 0xdfb3bb7c
-0,        116,        116,        1,   233472, 0x6d631236
-0,        117,        117,        1,   233472, 0xdb579a7b
-0,        118,        118,        1,   233472, 0x47584a3e
-0,        119,        119,        1,   233472, 0x7a27a914
-0,        120,        120,        1,   233472, 0x2996270d
-0,        121,        121,        1,   233472, 0xefeaa7ed
-0,        122,        122,        1,   233472, 0xa3e74ae1
-0,        123,        123,        1,   233472, 0x8a51d61c
-0,        124,        124,        1,   233472, 0x25085ee7
-0,        125,        125,        1,   233472, 0x0a811253
-0,        126,        126,        1,   233472, 0x7d3eda84
-0,        127,        127,        1,   233472, 0xd0a0887d
-0,        128,        128,        1,   233472, 0xc9e6702c
-0,        129,        129,        1,   233472, 0x0da14346
-0,        130,        130,        1,   233472, 0x040f0605
-0,        131,        131,        1,   233472, 0x76ea841a
-0,        132,        132,        1,   233472, 0x105b6600
-0,        133,        133,        1,   233472, 0x73015e08
-0,        134,        134,        1,   233472, 0xe77d6662
-0,        135,        135,        1,   233472, 0x7514fcd1
-0,        136,        136,        1,   233472, 0xb091a850
-0,        137,        137,        1,   233472, 0x74ccdccd
-0,        138,        138,        1,   233472, 0xd1c002fc
-0,        139,        139,        1,   233472, 0x7bfcfdac
-0,        140,        140,        1,   233472, 0xf48a133f
-0,        141,        141,        1,   233472, 0x279c16dd
-0,        142,        142,        1,   233472, 0x58427907
-0,        143,        143,        1,   233472, 0x4668a8f2
-0,        144,        144,        1,   233472, 0x93fb555f
-0,        145,        145,        1,   233472, 0x49ed3cf2
-0,        146,        146,        1,   233472, 0xd620fac9
-0,        147,        147,        1,   233472, 0xe4efae83
-0,        148,        148,        1,   233472, 0xe4d377be
-0,        149,        149,        1,   233472, 0x6fc229c1
-0,        150,        150,        1,   233472, 0xab5a8898
-0,        151,        151,        1,   233472, 0x58a493dd
-0,        152,        152,        1,   233472, 0x5c1c1093
-0,        153,        153,        1,   233472, 0x2d831af9
-0,        154,        154,        1,   233472, 0x9a0d3cdf
-0,        155,        155,        1,   233472, 0x2be78f0b
-0,        156,        156,        1,   233472, 0xfc7cc656
-0,        157,        157,        1,   233472, 0xaa8624b7
-0,        158,        158,        1,   233472, 0xb9c9afc1
-0,        159,        159,        1,   233472, 0x709e8009
-0,        160,        160,        1,   233472, 0xd2260830
-0,        161,        161,        1,   233472, 0xadb3954e
-0,        162,        162,        1,   233472, 0x74fc3e65
-0,        163,        163,        1,   233472, 0xb4bcdea4
-0,        164,        164,        1,   233472, 0x60c46cf5
-0,        165,        165,        1,   233472, 0x0e48eff8
-0,        166,        166,        1,   233472, 0x60e46733
-0,        167,        167,        1,   233472, 0x708ec89f
-0,        168,        168,        1,   233472, 0x1f11264e
-0,        169,        169,        1,   233472, 0x6cba8300
-0,        170,        170,        1,   233472, 0xd1a5d756
-0,        171,        171,        1,   233472, 0xb936621e
-0,        172,        172,        1,   233472, 0x1667b4af
-0,        173,        173,        1,   233472, 0xc212276d
-0,        174,        174,        1,   233472, 0x9d7a871d
-0,        175,        175,        1,   233472, 0xb52834f9
-0,        176,        176,        1,   233472, 0x983bde84
-0,        177,        177,        1,   233472, 0xd1c63d88
-0,        178,        178,        1,   233472, 0xa38cb687
-0,        179,        179,        1,   233472, 0xd81bf8ff
-0,        180,        180,        1,   233472, 0x688b231a
-0,        181,        181,        1,   233472, 0xd5ad3038
-0,        182,        182,        1,   233472, 0xcd227f74
-0,        183,        183,        1,   233472, 0x81ec23d6
-0,        184,        184,        1,   233472, 0x52c1cd86
-0,        185,        185,        1,   233472, 0xa4199853
-0,        186,        186,        1,   233472, 0xe82c83e4
-0,        187,        187,        1,   233472, 0xe9810f88
-0,        188,        188,        1,   233472, 0x37e95ae7
-0,        189,        189,        1,   233472, 0xf6974d5d
-0,        190,        190,        1,   233472, 0x31788551
-0,        191,        191,        1,   233472, 0x00d6c539
-0,        192,        192,        1,   233472, 0xdbb52151
-0,        193,        193,        1,   233472, 0x594433d3
-0,        194,        194,        1,   233472, 0xeec44f91
-0,        195,        195,        1,   233472, 0x302894bf
-0,        196,        196,        1,   233472, 0x44f5ddc3
-0,        197,        197,        1,   233472, 0x6c1edd28
-0,        198,        198,        1,   233472, 0x7fd1e412
-0,        199,        199,        1,   233472, 0xd771f11b
-0,        200,        200,        1,   233472, 0x09c675d5
-0,        201,        201,        1,   233472, 0x8fd9112e
-0,        202,        202,        1,   233472, 0x602002e5
-0,        203,        203,        1,   233472, 0xb9a22029
-0,        204,        204,        1,   233472, 0x18e99807
-0,        205,        205,        1,   233472, 0x3d8657d8
-0,        206,        206,        1,   233472, 0x4cd73a85
-0,        207,        207,        1,   233472, 0x84ddb474
-0,        208,        208,        1,   233472, 0x69636bb8
-0,        209,        209,        1,   233472, 0xa0436d50
-0,        210,        210,        1,   233472, 0x93c86d78
-0,        211,        211,        1,   233472, 0x05ba6d7a
-0,        212,        212,        1,   233472, 0x05ba6d7a
-0,        213,        213,        1,   233472, 0x05ba6d7a
-0,        214,        214,        1,   233472, 0x126c6406
-0,        215,        215,        1,   233472, 0xe3885a3a
-0,        216,        216,        1,   233472, 0xf1256fe9
-0,        217,        217,        1,   233472, 0x5a84377e
-0,        218,        218,        1,   233472, 0x7c392d90
-0,        219,        219,        1,   233472, 0x8a74df48
-0,        220,        220,        1,   233472, 0xfa394653
-0,        221,        221,        1,   233472, 0xcbe0cc1b
-0,        222,        222,        1,   233472, 0xbf8639cf
-0,        223,        223,        1,   233472, 0x7dd2c935
-0,        224,        224,        1,   233472, 0x1093148f
-0,        225,        225,        1,   233472, 0x624d7d3e
-0,        226,        226,        1,   233472, 0xb340cd65
-0,        227,        227,        1,   233472, 0x6c0ae5c6
-0,        228,        228,        1,   233472, 0x0c5eaf73
-0,        229,        229,        1,   233472, 0x27be64ce
-0,        230,        230,        1,   233472, 0xac8990f4
-0,        231,        231,        1,   233472, 0x1f935102
-0,        232,        232,        1,   233472, 0x6e57d96f
-0,        233,        233,        1,   233472, 0xf246ea4d
-0,        234,        234,        1,   233472, 0x18058011
-0,        235,        235,        1,   233472, 0x5951fe6e
-0,        236,        236,        1,   233472, 0x0f10371d
-0,        237,        237,        1,   233472, 0xe1481043
-0,        238,        238,        1,   233472, 0xdedeefcc
-0,        239,        239,        1,   233472, 0xf8865db2
-0,        240,        240,        1,   233472, 0xe1b3d4d6
-0,        241,        241,        1,   233472, 0x81962c43
-0,        242,        242,        1,   233472, 0xe903d0bb
-0,        243,        243,        1,   233472, 0x6f530ac6
-0,        244,        244,        1,   233472, 0x94f7466c
-0,        245,        245,        1,   233472, 0xa8c1d365
diff --git a/deps/libav/tests/ref/fate/vp60 b/deps/libav/tests/ref/fate/vp60
deleted file mode 100644
index 5e4b62c..0000000
--- a/deps/libav/tests/ref/fate/vp60
+++ /dev/null
@@ -1,134 +0,0 @@
-#tb 0: 32767/982027
-0,          0,          0,        1,    55296, 0x6a3202a3
-0,          1,          1,        1,    55296, 0x2af202eb
-0,          2,          2,        1,    55296, 0xa1a40388
-0,          3,          3,        1,    55296, 0x61c90426
-0,          4,          4,        1,    55296, 0x17720594
-0,          5,          5,        1,    55296, 0x49440805
-0,          6,          6,        1,    55296, 0x5b2e0d32
-0,          7,          7,        1,    55296, 0x207891c1
-0,          8,          8,        1,    55296, 0x502da4cd
-0,          9,          9,        1,    55296, 0x75a22a75
-0,         10,         10,        1,    55296, 0xd55099af
-0,         11,         11,        1,    55296, 0x48778bb6
-0,         12,         12,        1,    55296, 0xe76b7df7
-0,         13,         13,        1,    55296, 0x5a049f33
-0,         14,         14,        1,    55296, 0xc83d9b90
-0,         15,         15,        1,    55296, 0x567877b8
-0,         16,         16,        1,    55296, 0x334c7f6e
-0,         17,         17,        1,    55296, 0x8717945c
-0,         18,         18,        1,    55296, 0xe432831e
-0,         19,         19,        1,    55296, 0x032e8d2d
-0,         20,         20,        1,    55296, 0x37109fd6
-0,         21,         21,        1,    55296, 0xe9b0b61b
-0,         22,         22,        1,    55296, 0x7385dae8
-0,         23,         23,        1,    55296, 0x74b8a9f5
-0,         24,         24,        1,    55296, 0xbce2e218
-0,         25,         25,        1,    55296, 0x0ab6c623
-0,         26,         26,        1,    55296, 0x2234d6d6
-0,         27,         27,        1,    55296, 0xd18be4d6
-0,         28,         28,        1,    55296, 0x5247ecc9
-0,         29,         29,        1,    55296, 0xc89f10ca
-0,         30,         30,        1,    55296, 0x16181f87
-0,         31,         31,        1,    55296, 0x893bfa85
-0,         32,         32,        1,    55296, 0x1fd9f1c0
-0,         33,         33,        1,    55296, 0xa2e8e6a9
-0,         34,         34,        1,    55296, 0x1b42dfd5
-0,         35,         35,        1,    55296, 0x0fa9f509
-0,         36,         36,        1,    55296, 0x4449c216
-0,         37,         37,        1,    55296, 0xb66baa36
-0,         38,         38,        1,    55296, 0x38c19f3b
-0,         39,         39,        1,    55296, 0xcdce83a0
-0,         40,         40,        1,    55296, 0xac4ea82b
-0,         41,         41,        1,    55296, 0xb77a6979
-0,         42,         42,        1,    55296, 0xc8834ec2
-0,         43,         43,        1,    55296, 0x181d3f0f
-0,         44,         44,        1,    55296, 0x2ae04252
-0,         45,         45,        1,    55296, 0x07633c18
-0,         46,         46,        1,    55296, 0xdc6a3340
-0,         47,         47,        1,    55296, 0xa456ebb1
-0,         48,         48,        1,    55296, 0xbf7de5e2
-0,         49,         49,        1,    55296, 0x54a1c39b
-0,         50,         50,        1,    55296, 0x08fc9423
-0,         51,         51,        1,    55296, 0x926f968a
-0,         52,         52,        1,    55296, 0x5c908481
-0,         53,         53,        1,    55296, 0x6b257f16
-0,         54,         54,        1,    55296, 0xbaf8658a
-0,         55,         55,        1,    55296, 0x61c957b1
-0,         56,         56,        1,    55296, 0xa6d181ff
-0,         57,         57,        1,    55296, 0xef476e69
-0,         58,         58,        1,    55296, 0x74f72f9a
-0,         59,         59,        1,    55296, 0x3a9328e9
-0,         60,         60,        1,    55296, 0xbe962874
-0,         61,         61,        1,    55296, 0x5f8b58cc
-0,         62,         62,        1,    55296, 0x1e066d22
-0,         63,         63,        1,    55296, 0x9ef72b34
-0,         64,         64,        1,    55296, 0x525c2bb1
-0,         65,         65,        1,    55296, 0x8e5a20a3
-0,         66,         66,        1,    55296, 0x1c6723d0
-0,         67,         67,        1,    55296, 0x2b1023c8
-0,         68,         68,        1,    55296, 0x8f682691
-0,         69,         69,        1,    55296, 0x3a0624f5
-0,         70,         70,        1,    55296, 0xbc1046fb
-0,         71,         71,        1,    55296, 0x2859470e
-0,         72,         72,        1,    55296, 0x61d45a12
-0,         73,         73,        1,    55296, 0xa68853b6
-0,         74,         74,        1,    55296, 0x36543ce4
-0,         75,         75,        1,    55296, 0x95b953d4
-0,         76,         76,        1,    55296, 0x804b3c53
-0,         77,         77,        1,    55296, 0x743960f6
-0,         78,         78,        1,    55296, 0x23916b9c
-0,         79,         79,        1,    55296, 0x8f5a59e3
-0,         80,         80,        1,    55296, 0xf1285f83
-0,         81,         81,        1,    55296, 0xde75640f
-0,         82,         82,        1,    55296, 0xde146188
-0,         83,         83,        1,    55296, 0xb5315cc9
-0,         84,         84,        1,    55296, 0xa85f6861
-0,         85,         85,        1,    55296, 0x4fda562f
-0,         86,         86,        1,    55296, 0xa0185863
-0,         87,         87,        1,    55296, 0xe4dc5a5f
-0,         88,         88,        1,    55296, 0x8a2aabb6
-0,         89,         89,        1,    55296, 0x3ba89b4f
-0,         90,         90,        1,    55296, 0x82b07c21
-0,         91,         91,        1,    55296, 0xb7998478
-0,         92,         92,        1,    55296, 0xceca8046
-0,         93,         93,        1,    55296, 0xe652b325
-0,         94,         94,        1,    55296, 0xc26bb607
-0,         95,         95,        1,    55296, 0x40c99200
-0,         96,         96,        1,    55296, 0x61bc9b27
-0,         97,         97,        1,    55296, 0x1e4baa30
-0,         98,         98,        1,    55296, 0xd8a7adb0
-0,         99,         99,        1,    55296, 0x0d0aa8fb
-0,        100,        100,        1,    55296, 0x1f1ba33c
-0,        101,        101,        1,    55296, 0xa000a80b
-0,        102,        102,        1,    55296, 0xb49dd332
-0,        103,        103,        1,    55296, 0x6b8ac499
-0,        104,        104,        1,    55296, 0x9636ed15
-0,        105,        105,        1,    55296, 0xa152f03d
-0,        106,        106,        1,    55296, 0x47a8cfc7
-0,        107,        107,        1,    55296, 0x9f94c82a
-0,        108,        108,        1,    55296, 0xe208d626
-0,        109,        109,        1,    55296, 0x28cc0616
-0,        110,        110,        1,    55296, 0xc545179e
-0,        111,        111,        1,    55296, 0xdf9205af
-0,        112,        112,        1,    55296, 0x31d6ed99
-0,        113,        113,        1,    55296, 0x866bf86e
-0,        114,        114,        1,    55296, 0x0490fbd1
-0,        115,        115,        1,    55296, 0xe1102987
-0,        116,        116,        1,    55296, 0x7f860c29
-0,        117,        117,        1,    55296, 0xc3a91f7a
-0,        118,        118,        1,    55296, 0x69641a52
-0,        119,        119,        1,    55296, 0x05b12204
-0,        120,        120,        1,    55296, 0x715b6206
-0,        121,        121,        1,    55296, 0xdcf55139
-0,        122,        122,        1,    55296, 0x1369f746
-0,        123,        123,        1,    55296, 0xc1533ef5
-0,        124,        124,        1,    55296, 0xc00ff85f
-0,        125,        125,        1,    55296, 0x4f5f70dc
-0,        126,        126,        1,    55296, 0x85720ccc
-0,        127,        127,        1,    55296, 0xfdff0780
-0,        128,        128,        1,    55296, 0x57ef04ff
-0,        129,        129,        1,    55296, 0xbf94041f
-0,        130,        130,        1,    55296, 0x4cee0392
-0,        131,        131,        1,    55296, 0x80160314
-0,        132,        132,        1,    55296, 0x396802af
diff --git a/deps/libav/tests/ref/fate/vp61 b/deps/libav/tests/ref/fate/vp61
deleted file mode 100644
index be1fe53..0000000
--- a/deps/libav/tests/ref/fate/vp61
+++ /dev/null
@@ -1,121 +0,0 @@
-#tb 0: 32767/982027
-0,          0,          0,        1,    18816, 0xc3fe9fc7
-0,          1,          1,        1,    18816, 0x6ddf972f
-0,          2,          2,        1,    18816, 0x72808b6e
-0,          3,          3,        1,    18816, 0x8f09857f
-0,          4,          4,        1,    18816, 0xe8027c00
-0,          5,          5,        1,    18816, 0x308670cf
-0,          6,          6,        1,    18816, 0x0e656170
-0,          7,          7,        1,    18816, 0x594e54a4
-0,          8,          8,        1,    18816, 0x36944b05
-0,          9,          9,        1,    18816, 0x87013a34
-0,         10,         10,        1,    18816, 0xc0f32f0d
-0,         11,         11,        1,    18816, 0x911f1951
-0,         12,         12,        1,    18816, 0xad590d59
-0,         13,         13,        1,    18816, 0x943afff0
-0,         14,         14,        1,    18816, 0x7f5ef719
-0,         15,         15,        1,    18816, 0x889feafc
-0,         16,         16,        1,    18816, 0x4334e12b
-0,         17,         17,        1,    18816, 0xd080cc67
-0,         18,         18,        1,    18816, 0xc3c1c04c
-0,         19,         19,        1,    18816, 0x816bae4b
-0,         20,         20,        1,    18816, 0xed23a5c7
-0,         21,         21,        1,    18816, 0x86689c2f
-0,         22,         22,        1,    18816, 0x63408c52
-0,         23,         23,        1,    18816, 0x399c79d6
-0,         24,         24,        1,    18816, 0xf0ff63bf
-0,         25,         25,        1,    18816, 0xa6185353
-0,         26,         26,        1,    18816, 0xe33d46fc
-0,         27,         27,        1,    18816, 0xd58d3c6d
-0,         28,         28,        1,    18816, 0xc94a27ea
-0,         29,         29,        1,    18816, 0x62f31c59
-0,         30,         30,        1,    18816, 0x71880825
-0,         31,         31,        1,    18816, 0xa6ce01d7
-0,         32,         32,        1,    18816, 0xa1d4fc06
-0,         33,         33,        1,    18816, 0xc208f570
-0,         34,         34,        1,    18816, 0xc862e637
-0,         35,         35,        1,    18816, 0xcf9ed93a
-0,         36,         36,        1,    18816, 0x85a8cbcc
-0,         37,         37,        1,    18816, 0x650ac6c1
-0,         38,         38,        1,    18816, 0xb418c12b
-0,         39,         39,        1,    18816, 0x9fe5b412
-0,         40,         40,        1,    18816, 0x80f6a7c1
-0,         41,         41,        1,    18816, 0x283299e4
-0,         42,         42,        1,    18816, 0x15429202
-0,         43,         43,        1,    18816, 0x9f0f8c8a
-0,         44,         44,        1,    18816, 0x8e828811
-0,         45,         45,        1,    18816, 0xaac67993
-0,         46,         46,        1,    18816, 0x8f3b6f4f
-0,         47,         47,        1,    18816, 0x0b125f95
-0,         48,         48,        1,    18816, 0xb4e75d14
-0,         49,         49,        1,    18816, 0x1bac5933
-0,         50,         50,        1,    18816, 0x300b521b
-0,         51,         51,        1,    18816, 0x51174590
-0,         52,         52,        1,    18816, 0x03df3d70
-0,         53,         53,        1,    18816, 0x338a344a
-0,         54,         54,        1,    18816, 0x45ad328d
-0,         55,         55,        1,    18816, 0x2d4e321a
-0,         56,         56,        1,    18816, 0x15932563
-0,         57,         57,        1,    18816, 0x9b4f1c76
-0,         58,         58,        1,    18816, 0x8e31153c
-0,         59,         59,        1,    18816, 0xfb391185
-0,         60,         60,        1,    18816, 0x93ee0cdc
-0,         61,         61,        1,    18816, 0xddeb0642
-0,         62,         62,        1,    18816, 0xda6cf529
-0,         63,         63,        1,    18816, 0xdbd6f085
-0,         64,         64,        1,    18816, 0x357aec81
-0,         65,         65,        1,    18816, 0x36eaecca
-0,         66,         66,        1,    18816, 0x6535ee02
-0,         67,         67,        1,    18816, 0xb7dfe466
-0,         68,         68,        1,    18816, 0x58d3d86b
-0,         69,         69,        1,    18816, 0xd8aad64b
-0,         70,         70,        1,    18816, 0x37ecd588
-0,         71,         71,        1,    18816, 0xe2f9cee4
-0,         72,         72,        1,    18816, 0xcd1ac93e
-0,         73,         73,        1,    18816, 0x18e1be81
-0,         74,         74,        1,    18816, 0xa05bb9d7
-0,         75,         75,        1,    18816, 0xe0ebb663
-0,         76,         76,        1,    18816, 0x7d61b39a
-0,         77,         77,        1,    18816, 0x01b8acb5
-0,         78,         78,        1,    18816, 0x7577aa8b
-0,         79,         79,        1,    18816, 0x6bbda4b5
-0,         80,         80,        1,    18816, 0xd0cc9b29
-0,         81,         81,        1,    18816, 0xb2858cbb
-0,         82,         82,        1,    18816, 0x93608c9d
-0,         83,         83,        1,    18816, 0x80c38e03
-0,         84,         84,        1,    18816, 0x37d6843c
-0,         85,         85,        1,    18816, 0xacc47b9a
-0,         86,         86,        1,    18816, 0xc4317178
-0,         87,         87,        1,    18816, 0xc92f6ebd
-0,         88,         88,        1,    18816, 0xc1217a3b
-0,         89,         89,        1,    18816, 0x03a37ccb
-0,         90,         90,        1,    18816, 0xf38c71a2
-0,         91,         91,        1,    18816, 0x68ff697d
-0,         92,         92,        1,    18816, 0x0fe358e5
-0,         93,         93,        1,    18816, 0x58455870
-0,         94,         94,        1,    18816, 0xc9075ce7
-0,         95,         95,        1,    18816, 0x16685773
-0,         96,         96,        1,    18816, 0x1b434c0e
-0,         97,         97,        1,    18816, 0x008e4c97
-0,         98,         98,        1,    18816, 0xb4d04f4f
-0,         99,         99,        1,    18816, 0xc8c94848
-0,        100,        100,        1,    18816, 0x64664191
-0,        101,        101,        1,    18816, 0xd591367f
-0,        102,        102,        1,    18816, 0xc70d3141
-0,        103,        103,        1,    18816, 0x8d492655
-0,        104,        104,        1,    18816, 0x7e7f22c8
-0,        105,        105,        1,    18816, 0x335d23f9
-0,        106,        106,        1,    18816, 0x0a7f22b6
-0,        107,        107,        1,    18816, 0x6cf51cb2
-0,        108,        108,        1,    18816, 0x312516e1
-0,        109,        109,        1,    18816, 0x8a3c0c7a
-0,        110,        110,        1,    18816, 0x997d0d20
-0,        111,        111,        1,    18816, 0xffbd117e
-0,        112,        112,        1,    18816, 0x855808ca
-0,        113,        113,        1,    18816, 0xe335fb94
-0,        114,        114,        1,    18816, 0x12e6f95c
-0,        115,        115,        1,    18816, 0x2d62f845
-0,        116,        116,        1,    18816, 0x7e63f591
-0,        117,        117,        1,    18816, 0x7463f175
-0,        118,        118,        1,    18816, 0x1521e0d2
-0,        119,        119,        1,    18816, 0x96a8dbce
diff --git a/deps/libav/tests/ref/fate/vp6a b/deps/libav/tests/ref/fate/vp6a
deleted file mode 100644
index 6ce8486..0000000
--- a/deps/libav/tests/ref/fate/vp6a
+++ /dev/null
@@ -1,94 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   135000, 0x9dceed6d
-0,        249,        249,        0,   135000, 0xcb87787f
-0,        499,        499,        0,   135000, 0xdb4361ce
-0,        749,        749,        0,   135000, 0xb8fd81c2
-0,       1000,       1000,        0,   135000, 0xbf86a7af
-0,       1249,       1249,        0,   135000, 0x2e7787e3
-0,       1499,       1499,        0,   135000, 0x6cec6ebd
-0,       1749,       1749,        0,   135000, 0xa4d08c07
-0,       2000,       2000,        0,   135000, 0x1be48faf
-0,       2249,       2249,        0,   135000, 0xf3cd8ede
-0,       2499,       2499,        0,   135000, 0x33ec8a49
-0,       2749,       2749,        0,   135000, 0x11e887ec
-0,       3000,       3000,        0,   135000, 0x3e215c25
-0,       3249,       3249,        0,   135000, 0x1a2cb3f8
-0,       3499,       3499,        0,   135000, 0x7fb0e48a
-0,       3749,       3749,        0,   135000, 0x749f3738
-0,       4000,       4000,        0,   135000, 0x686e78e9
-0,       4249,       4249,        0,   135000, 0x29515bc7
-0,       4499,       4499,        0,   135000, 0x987126bd
-0,       4749,       4749,        0,   135000, 0xdf77bb13
-0,       5000,       5000,        0,   135000, 0x5fb1468a
-0,       5249,       5249,        0,   135000, 0x06ea50ea
-0,       5499,       5499,        0,   135000, 0x7bd9c715
-0,       5749,       5749,        0,   135000, 0xdd6e6831
-0,       6000,       6000,        0,   135000, 0x0ee3760f
-0,       6249,       6249,        0,   135000, 0xc7984dc8
-0,       6499,       6499,        0,   135000, 0x7e385bff
-0,       6749,       6749,        0,   135000, 0xae155ab9
-0,       7000,       7000,        0,   135000, 0xc05ee8f7
-0,       7249,       7249,        0,   135000, 0x93de3392
-0,       7499,       7499,        0,   135000, 0xfe45b38b
-0,       7749,       7749,        0,   135000, 0xeb5ed72c
-0,       8000,       8000,        0,   135000, 0x0794cb57
-0,       8249,       8249,        0,   135000, 0x2578c6e5
-0,       8499,       8499,        0,   135000, 0x78486707
-0,       8749,       8749,        0,   135000, 0x41e1f0e6
-0,       9000,       9000,        0,   135000, 0x4508eb76
-0,       9249,       9249,        0,   135000, 0xd8c087f3
-0,       9499,       9499,        0,   135000, 0x1a8db89a
-0,       9749,       9749,        0,   135000, 0x6dbd90c6
-0,      10000,      10000,        0,   135000, 0x0845e400
-0,      10249,      10249,        0,   135000, 0xe8b02fc2
-0,      10499,      10499,        0,   135000, 0x8007d813
-0,      10749,      10749,        0,   135000, 0xdfb04e69
-0,      11000,      11000,        0,   135000, 0x5746cf71
-0,      11249,      11249,        0,   135000, 0xe510299f
-0,      11499,      11499,        0,   135000, 0xeea0c829
-0,      11749,      11749,        0,   135000, 0x7c0578ab
-0,      12000,      12000,        0,   135000, 0xb1569ce9
-0,      12249,      12249,        0,   135000, 0x6c233986
-0,      12499,      12499,        0,   135000, 0x95b77f3d
-0,      12749,      12749,        0,   135000, 0xfc368d80
-0,      13000,      13000,        0,   135000, 0x5c73b064
-0,      13249,      13249,        0,   135000, 0x2206da8d
-0,      13499,      13499,        0,   135000, 0x62bb599e
-0,      13749,      13749,        0,   135000, 0x15a68991
-0,      14000,      14000,        0,   135000, 0x5f5eb810
-0,      14249,      14249,        0,   135000, 0x85a9634a
-0,      14499,      14499,        0,   135000, 0xf24b5c1a
-0,      14749,      14749,        0,   135000, 0x38034850
-0,      15000,      15000,        0,   135000, 0x48fd3599
-0,      15249,      15249,        0,   135000, 0xb9d62408
-0,      15499,      15499,        0,   135000, 0xaf202a21
-0,      15749,      15749,        0,   135000, 0x341aa582
-0,      16000,      16000,        0,   135000, 0x90cdc9bb
-0,      16249,      16249,        0,   135000, 0x0b52f319
-0,      16499,      16499,        0,   135000, 0xce61aa5e
-0,      16749,      16749,        0,   135000, 0x988acb45
-0,      17000,      17000,        0,   135000, 0xcd353664
-0,      17249,      17249,        0,   135000, 0xa80c8ce9
-0,      17499,      17499,        0,   135000, 0x15dce784
-0,      17749,      17749,        0,   135000, 0x16bd4519
-0,      18000,      18000,        0,   135000, 0x571712f3
-0,      18249,      18249,        0,   135000, 0x6b109f1e
-0,      18499,      18499,        0,   135000, 0x8e4c19aa
-0,      18749,      18749,        0,   135000, 0x4132bd4c
-0,      19000,      19000,        0,   135000, 0x5babafe2
-0,      19249,      19249,        0,   135000, 0xddef6313
-0,      19499,      19499,        0,   135000, 0x76d6b48b
-0,      19749,      19749,        0,   135000, 0x929e7702
-0,      20000,      20000,        0,   135000, 0x33f5e4a1
-0,      20249,      20249,        0,   135000, 0xdb7041bf
-0,      20499,      20499,        0,   135000, 0xbc761e04
-0,      20749,      20749,        0,   135000, 0x0b2a81e6
-0,      21000,      21000,        0,   135000, 0xf6fd20ea
-0,      21249,      21249,        0,   135000, 0x1894a26c
-0,      21499,      21499,        0,   135000, 0xb25e216f
-0,      21749,      21749,        0,   135000, 0x83bb02ee
-0,      22000,      22000,        0,   135000, 0x6952a3c3
-0,      22249,      22249,        0,   135000, 0x372184d6
-0,      22499,      22499,        0,   135000, 0x2ac47afe
-0,      22749,      22749,        0,   135000, 0x14c33a35
-0,      23000,      23000,        0,   135000, 0xdc08470e
diff --git a/deps/libav/tests/ref/fate/vp6f b/deps/libav/tests/ref/fate/vp6f
deleted file mode 100644
index 8795042..0000000
--- a/deps/libav/tests/ref/fate/vp6f
+++ /dev/null
@@ -1,175 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    13440, 0x7cb0a22f
-0,        100,        100,        0,    13440, 0xdfcea6ba
-0,        200,        200,        0,    13440, 0x59b2a5da
-0,        300,        300,        0,    13440, 0x12f1b2d8
-0,        400,        400,        0,    13440, 0x280fb9f6
-0,        500,        500,        0,    13440, 0x7bace8b3
-0,        600,        600,        0,    13440, 0x4ec91480
-0,        700,        700,        0,    13440, 0xa8010450
-0,        800,        800,        0,    13440, 0x61d8fc46
-0,        900,        900,        0,    13440, 0x242bb24e
-0,       1000,       1000,        0,    13440, 0x88397a36
-0,       1100,       1100,        0,    13440, 0x10e15726
-0,       1200,       1200,        0,    13440, 0x3018438c
-0,       1300,       1300,        0,    13440, 0xbbb94c21
-0,       1400,       1400,        0,    13440, 0xfc3e5e2b
-0,       1500,       1500,        0,    13440, 0xeaa69354
-0,       1600,       1600,        0,    13440, 0x96f1cc01
-0,       1700,       1700,        0,    13440, 0x333fdaff
-0,       1800,       1800,        0,    13440, 0xb5230ed2
-0,       1900,       1900,        0,    13440, 0x59383446
-0,       2000,       2000,        0,    13440, 0x954939e6
-0,       2100,       2100,        0,    13440, 0x53813d2f
-0,       2200,       2200,        0,    13440, 0x3ca53600
-0,       2300,       2300,        0,    13440, 0x7b30227a
-0,       2400,       2400,        0,    13440, 0x5145bbfe
-0,       2500,       2500,        0,    13440, 0xa0979632
-0,       2600,       2600,        0,    13440, 0x08026e21
-0,       2700,       2700,        0,    13440, 0x3f456d1e
-0,       2800,       2800,        0,    13440, 0x7d036b62
-0,       2900,       2900,        0,    13440, 0x508085fb
-0,       3000,       3000,        0,    13440, 0x251dc193
-0,       3100,       3100,        0,    13440, 0xf3121c9b
-0,       3200,       3200,        0,    13440, 0xf5da772e
-0,       3300,       3300,        0,    13440, 0x8179ccf7
-0,       3400,       3400,        0,    13440, 0xd57ceeb3
-0,       3500,       3500,        0,    13440, 0xc8f2169c
-0,       3600,       3600,        0,    13440, 0xbf8296c3
-0,       3700,       3700,        0,    13440, 0xee1927d0
-0,       3800,       3800,        0,    13440, 0xdd84e8d1
-0,       3900,       3900,        0,    13440, 0x7be57be2
-0,       4000,       4000,        0,    13440, 0xae353f91
-0,       4100,       4100,        0,    13440, 0x3ae927f2
-0,       4200,       4200,        0,    13440, 0x417227c6
-0,       4300,       4300,        0,    13440, 0x32572bea
-0,       4400,       4400,        0,    13440, 0x8b9e4839
-0,       4500,       4500,        0,    13440, 0xad669441
-0,       4600,       4600,        0,    13440, 0xc9de99a6
-0,       4700,       4700,        0,    13440, 0xb3ffb88b
-0,       4800,       4800,        0,    13440, 0xb321b8a0
-0,       4900,       4900,        0,    13440, 0x2efdbf53
-0,       5000,       5000,        0,    13440, 0x9b7aa566
-0,       5100,       5100,        0,    13440, 0x563c8d60
-0,       5200,       5200,        0,    13440, 0xe3848ee8
-0,       5300,       5300,        0,    13440, 0xa84b8f1d
-0,       5400,       5400,        0,    13440, 0x52da9f9f
-0,       5500,       5500,        0,    13440, 0x2ed56d97
-0,       5600,       5600,        0,    13440, 0x4e8534c2
-0,       5700,       5700,        0,    13440, 0x318900a6
-0,       5800,       5800,        0,    13440, 0xda96de39
-0,       5900,       5900,        0,    13440, 0xaae7ac0b
-0,       6000,       6000,        0,    13440, 0x7533ad99
-0,       6100,       6100,        0,    13440, 0x4e70c2c9
-0,       6200,       6200,        0,    13440, 0x9ce5e3fa
-0,       6300,       6300,        0,    13440, 0xc788fbbc
-0,       6400,       6400,        0,    13440, 0xd36604a9
-0,       6500,       6500,        0,    13440, 0x246221a4
-0,       6600,       6600,        0,    13440, 0x290c5c2b
-0,       6700,       6700,        0,    13440, 0xde6c68ec
-0,       6800,       6800,        0,    13440, 0x56248dbf
-0,       6900,       6900,        0,    13440, 0x5b898cbd
-0,       7000,       7000,        0,    13440, 0x090574b9
-0,       7100,       7100,        0,    13440, 0x8df2814a
-0,       7200,       7200,        0,    13440, 0xd4a6b285
-0,       7300,       7300,        0,    13440, 0xa016e921
-0,       7400,       7400,        0,    13440, 0x7f93fdc1
-0,       7500,       7500,        0,    13440, 0xfd0dee6f
-0,       7600,       7600,        0,    13440, 0xef04ce0e
-0,       7700,       7700,        0,    13440, 0x7560bee3
-0,       7800,       7800,        0,    13440, 0x5a8cdc85
-0,       7900,       7900,        0,    13440, 0x4788f7bc
-0,       8000,       8000,        0,    13440, 0xc001e34d
-0,       8100,       8100,        0,    13440, 0xc687eb74
-0,       8200,       8200,        0,    13440, 0xbf20feba
-0,       8300,       8300,        0,    13440, 0xd32647a8
-0,       8400,       8400,        0,    13440, 0xe69a955a
-0,       8500,       8500,        0,    13440, 0x1b56951f
-0,       8600,       8600,        0,    13440, 0xd1977378
-0,       8700,       8700,        0,    13440, 0x1620357d
-0,       8800,       8800,        0,    13440, 0x2596116f
-0,       8900,       8900,        0,    13440, 0x7473feca
-0,       9000,       9000,        0,    13440, 0x7f92bb47
-0,       9100,       9100,        0,    13440, 0x6866a683
-0,       9200,       9200,        0,    13440, 0xe9b08d7e
-0,       9300,       9300,        0,    13440, 0xa3fd7546
-0,       9400,       9400,        0,    13440, 0xa4416522
-0,       9500,       9500,        0,    13440, 0xd8f5572e
-0,       9600,       9600,        0,    13440, 0xf5746dbd
-0,       9700,       9700,        0,    13440, 0x256a87c6
-0,       9800,       9800,        0,    13440, 0x722aa2c8
-0,       9900,       9900,        0,    13440, 0xb26de5f5
-0,      10000,      10000,        0,    13440, 0x117f0841
-0,      10100,      10100,        0,    13440, 0xda2d192c
-0,      10200,      10200,        0,    13440, 0xb022442d
-0,      10300,      10300,        0,    13440, 0xbc4044f2
-0,      10400,      10400,        0,    13440, 0x68b330da
-0,      10500,      10500,        0,    13440, 0xc07228cf
-0,      10600,      10600,        0,    13440, 0xaa3f3d44
-0,      10700,      10700,        0,    13440, 0x25867aad
-0,      10800,      10800,        0,    13440, 0xa3ecb432
-0,      10900,      10900,        0,    13440, 0x93ccdcbb
-0,      11000,      11000,        0,    13440, 0x8302fa4f
-0,      11100,      11100,        0,    13440, 0x2f960f33
-0,      11200,      11200,        0,    13440, 0x15d41d14
-0,      11300,      11300,        0,    13440, 0x636529d0
-0,      11400,      11400,        0,    13440, 0x11035be5
-0,      11500,      11500,        0,    13440, 0x9b6e9167
-0,      11600,      11600,        0,    13440, 0x7b01adc7
-0,      11700,      11700,        0,    13440, 0xa237e05d
-0,      11800,      11800,        0,    13440, 0xd2f4f134
-0,      11900,      11900,        0,    13440, 0x2052d368
-0,      12000,      12000,        0,    13440, 0x08f7ae0d
-0,      12100,      12100,        0,    13440, 0xa89185bc
-0,      12200,      12200,        0,    13440, 0xfa628236
-0,      12300,      12300,        0,    13440, 0xdf79848b
-0,      12400,      12400,        0,    13440, 0xd19a906f
-0,      12500,      12500,        0,    13440, 0x219f9324
-0,      12600,      12600,        0,    13440, 0x46509b6d
-0,      12700,      12700,        0,    13440, 0xc5d9a568
-0,      12800,      12800,        0,    13440, 0xb21aaaa8
-0,      12900,      12900,        0,    13440, 0x925a97ed
-0,      13000,      13000,        0,    13440, 0xc5e3557f
-0,      13100,      13100,        0,    13440, 0x7c57155a
-0,      13200,      13200,        0,    13440, 0x6b26d005
-0,      13300,      13300,        0,    13440, 0xfdc7b369
-0,      13400,      13400,        0,    13440, 0x99919fc2
-0,      13500,      13500,        0,    13440, 0xcfe889e4
-0,      13600,      13600,        0,    13440, 0xd1196856
-0,      13700,      13700,        0,    13440, 0xec8348c6
-0,      13800,      13800,        0,    13440, 0x5ede0d9a
-0,      13900,      13900,        0,    13440, 0x198ef66e
-0,      14000,      14000,        0,    13440, 0x62fcefdf
-0,      14100,      14100,        0,    13440, 0x7791f415
-0,      14200,      14200,        0,    13440, 0xfbdb0029
-0,      14300,      14300,        0,    13440, 0xdab12b01
-0,      14400,      14400,        0,    13440, 0x646b2d5f
-0,      14500,      14500,        0,    13440, 0x5410f52e
-0,      14600,      14600,        0,    13440, 0x7186eef8
-0,      14700,      14700,        0,    13440, 0xca251ef6
-0,      14800,      14800,        0,    13440, 0x757c3b43
-0,      14900,      14900,        0,    13440, 0x59ff4982
-0,      15000,      15000,        0,    13440, 0xbe8ff084
-0,      15100,      15100,        0,    13440, 0xc85a9e38
-0,      15200,      15200,        0,    13440, 0x541b9a19
-0,      15300,      15300,        0,    13440, 0x274893c9
-0,      15400,      15400,        0,    13440, 0x7634b5d2
-0,      15500,      15500,        0,    13440, 0x1bd8e10c
-0,      15600,      15600,        0,    13440, 0xa661dfb1
-0,      15700,      15700,        0,    13440, 0x9d01bf92
-0,      15800,      15800,        0,    13440, 0xcb1eb220
-0,      15900,      15900,        0,    13440, 0x0ce27d25
-0,      16000,      16000,        0,    13440, 0x523b594f
-0,      16100,      16100,        0,    13440, 0xf0a04c4f
-0,      16200,      16200,        0,    13440, 0x0f0ffc3d
-0,      16300,      16300,        0,    13440, 0xb0d8b778
-0,      16400,      16400,        0,    13440, 0x5137a642
-0,      16500,      16500,        0,    13440, 0xd213a552
-0,      16600,      16600,        0,    13440, 0xc2fbc9b1
-0,      16700,      16700,        0,    13440, 0xfc2ee379
-0,      16800,      16800,        0,    13440, 0xfb80f737
-0,      16900,      16900,        0,    13440, 0xd6cb2447
-0,      17000,      17000,        0,    13440, 0x124b606d
-0,      17100,      17100,        0,    13440, 0xf788a066
-0,      17200,      17200,        0,    13440, 0xa16eed6e
-0,      17300,      17300,        0,    13440, 0x73ff0f82
diff --git a/deps/libav/tests/ref/fate/vp8-sign-bias b/deps/libav/tests/ref/fate/vp8-sign-bias
deleted file mode 100644
index 77b69ed..0000000
--- a/deps/libav/tests/ref/fate/vp8-sign-bias
+++ /dev/null
@@ -1,9 +0,0 @@
-#tb 0: 1/24
-0,          0,          0,        1,   614880, 12ce23b288485be3ddbc1db28c21517f
-0,          2,          2,        1,   614880, ce352e1079535ea058c0e9ad50f7cdb8
-0,          3,          3,        1,   614880, 9f6bf2739a027dfd12c81586cf75d3a3
-0,          4,          4,        1,   614880, 7593a85ab7790eb39d65fc53f769ed8b
-0,          5,          5,        1,   614880, 52f47f1e0348f3297d9f233fb5405e8b
-0,          6,          6,        1,   614880, cd51d2c200bfd66e8e1b0fd6b404570f
-0,          7,          7,        1,   614880, cf535cf0a53e903cd98a9a944b72da6d
-0,          8,          8,        1,   614880, ff373c0c8a4a319c84e72b1c3d76b399
diff --git a/deps/libav/tests/ref/fate/vp8-size-change b/deps/libav/tests/ref/fate/vp8-size-change
deleted file mode 100644
index d87c563..0000000
--- a/deps/libav/tests/ref/fate/vp8-size-change
+++ /dev/null
@@ -1,31 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,  3110400, 649f0f2e3e09e6938161bb07bede5282
-0,         33,         33,        0,  3110400, f24f632d50eafef73fa89391ca98c375
-0,         67,         67,        0,  3110400, 57b6d2ed51bfaf6588f39eb73e7922b8
-0,        100,        100,        0,  3110400, 463e0988ce28eb1c30669c06113deb4c
-0,        133,        133,        0,  3110400, 3c4ac119f998a0ccd7d3a6361f4d10a0
-0,        167,        167,        0,  3110400, 0f11c5cc9c1ac9055e21e417e1259c69
-0,        200,        200,        0,  3110400, 08c6e70f101c61013f2969b6a370d3f9
-0,        233,        233,        0,  3110400, ea8cb37017d8a9d20bf443b730fd8365
-0,        267,        267,        0,  3110400, 3f614203f054c89151680f4b1b0c6c4c
-0,        300,        300,        0,  3110400, 90488ee40d06c0f05eee8348dde57325
-0,        333,        333,        0,  3110400, f48117b74ac7455e69fd14e9b68ce95d
-0,        367,        367,        0,  3110400, 37ee06b6267b5ec25fd642525cf4469a
-0,        400,        400,        0,  3110400, cd5e0988e7c084f29bda4a18cb38c1e8
-0,        433,        433,        0,  3110400, 1fe943b01f00b8bc0cb5722010cef03c
-0,        467,        467,        0,  3110400, 40d8e8150326c7eb061d3f6cfd307d97
-0,        500,        500,        0,  3110400, 49812cbf928858cb56331c8c8aaaf556
-0,        533,        533,        0,  3110400, 3df607c752273ebcac21123e2c4c010c
-0,        567,        567,        0,  3110400, 020a0ae162c8326f83f8f4d8bf1627d2
-0,        600,        600,        0,  3110400, 459ac9f9488a6a2f4e378703a6b2a45a
-0,        633,        633,        0,  3110400, b1baf9a56f7667e4b8f4e3007b9ebe0f
-0,        667,        667,        0,  3110400, eea61a72a05c380450a96b575ba25f65
-0,        700,        700,        0,  3110400, e013a9f233824631d8c6e3f93106eebe
-0,        733,        733,        0,  3110400, 6c64147ebdee4b36728c6978b290ffb5
-0,        767,        767,        0,  3110400, c37956235667345d92fdfc7c62496e84
-0,        800,        800,        0,  3110400, 0ac58c28575b804d9e63395653c3aef2
-0,        833,        833,        0,  3110400, 641f2a78e338c733ef159bd36ec7966f
-0,        867,        867,        0,  3110400, 9402d455fa5bd556b85f479c42c3a4d2
-0,        900,        900,        0,  3110400, ca86e16b05db0c79b028d709c19e1f13
-0,        933,        933,        0,  3110400, 9167d622809df07eef9bcb3cb09de0f0
-0,        967,        967,        0,  3110400, e1d52ae2a2eb6aabb9bdc7e7ed05253e
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-001 b/deps/libav/tests/ref/fate/vp8-test-vector-001
deleted file mode 100644
index 64accc4..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-001
+++ /dev/null
@@ -1,30 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,    38016, 83c78b5db579710f61f9354d5c51e8c8
-0,          1,          1,        1,    38016, 8d089d226f52d6cdaffdb3fcc080b75b
-0,          2,          2,        1,    38016, acaae81ca812145e85e0be83bdf54226
-0,          3,          3,        1,    38016, e94651d798b6bf5f09a9bba10cacaf7a
-0,          4,          4,        1,    38016, 60c2607913e528d501962bf407341731
-0,          5,          5,        1,    38016, e683f2bf28b31e36db88087bd03b6917
-0,          6,          6,        1,    38016, 0c2923785051bc9b90c2447a85527764
-0,          7,          7,        1,    38016, 1bc97b6b2e4ca36b149c3768495747ac
-0,          8,          8,        1,    38016, 0586d948ed3fd479c6dd08055973bcb4
-0,          9,          9,        1,    38016, c9a1198e1680487c77a2d1631695aeec
-0,         10,         10,        1,    38016, 547d8ffce9c085231c74717a9b815625
-0,         11,         11,        1,    38016, d31c02a5591eb7bd8e73703252e1a1ab
-0,         12,         12,        1,    38016, 23bafc8e22b2ed7e8c5e52369095cd30
-0,         13,         13,        1,    38016, 9725d52d7810a19b20dcc9bb0fa36abd
-0,         14,         14,        1,    38016, 7aefaabdcd2595939fd05078d01b484b
-0,         15,         15,        1,    38016, 828e758d6f0b29b2693b2dc6b09249a6
-0,         16,         16,        1,    38016, 53f09380dde1420ba270b74d8819537c
-0,         17,         17,        1,    38016, 09791a7db3bc28258350cfdc95d8f224
-0,         18,         18,        1,    38016, 2050271dc4ba3f3e427cf8088c96e28d
-0,         19,         19,        1,    38016, 4e69d3f7cea45844b740368fcd4dd815
-0,         20,         20,        1,    38016, 4ed07697e239b7f12ee6a97ad09c08fb
-0,         21,         21,        1,    38016, 1437c129bfbda63ca1d39a94ee91b097
-0,         22,         22,        1,    38016, 4fc951bf45e164b711591155a59c73fa
-0,         23,         23,        1,    38016, 97d1007e27b4b9072751e87e8d1f1415
-0,         24,         24,        1,    38016, 18c809835dcc3d30c93ae1be569dcd24
-0,         25,         25,        1,    38016, de0fd0035a542791c4dda5735657efc5
-0,         26,         26,        1,    38016, 27a70ff95d0cfa10f54652c9fb8a9db2
-0,         27,         27,        1,    38016, 2285b9324ec91099626191f769962e44
-0,         28,         28,        1,    38016, 56794d911b02190212bca92f88ad60c6
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-002 b/deps/libav/tests/ref/fate/vp8-test-vector-002
deleted file mode 100644
index d42674a..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-002
+++ /dev/null
@@ -1,50 +0,0 @@
-#tb 0: 1/24
-0,          0,          0,        1,    38016, 872e9922f37f0e92c767d33e0a15b8e0
-0,          1,          1,        1,    38016, ea5ad6c6ee4355018fc0ba83b5172836
-0,          2,          2,        1,    38016, fe744612b2167c9ba6e1dc81c031e16a
-0,          3,          3,        1,    38016, 744359695caee3f32307a2d7eef09e85
-0,          4,          4,        1,    38016, 07211ac8d8bae4d931ade402ff6e3c12
-0,          5,          5,        1,    38016, 2ce02854f228b1378d9dc34cab8d343b
-0,          6,          6,        1,    38016, af5222ad42c4f22f22fbf19c26c02dcb
-0,          7,          7,        1,    38016, 88538d39f2647df8fedf15bd1b767bbf
-0,          8,          8,        1,    38016, d0d936471dd4e9922eb067c0f09eacab
-0,          9,          9,        1,    38016, 03cb1f5c5026e96f6e686aa1fa9b1028
-0,         10,         10,        1,    38016, 2ebe35e23d2244c5b0f777fbc01f8f37
-0,         11,         11,        1,    38016, f9314f5ea91ebbaaed6e37ca0701ed67
-0,         12,         12,        1,    38016, 37dca7530d09fd1e8bad154b9e312ea2
-0,         13,         13,        1,    38016, 9841dc8ff6424abe362c4dfe03b5fbd0
-0,         14,         14,        1,    38016, 72bd0b70c576dfb544f622c488217491
-0,         15,         15,        1,    38016, 309b21c126153f20f312e38a8dad44e1
-0,         16,         16,        1,    38016, 0acbb170ede66ebdae4e9d8e56908f75
-0,         17,         17,        1,    38016, 318c9c3e531d00734b5f78433da176c9
-0,         18,         18,        1,    38016, 0388dfdb2a792148b44bdb705cc2df99
-0,         19,         19,        1,    38016, f440adff2b44888becbf3ca16e425441
-0,         20,         20,        1,    38016, ac41431627d8d1712d40412ab8c3200c
-0,         21,         21,        1,    38016, 417e1abbfe2a078663dae688ae4a9bb1
-0,         22,         22,        1,    38016, 73d493bdf4a29d5cfeec610109f582a8
-0,         23,         23,        1,    38016, 3c026a536ef36467d4a9db6bcc20cec1
-0,         24,         24,        1,    38016, 57836430f2f10862b84541d99cca062c
-0,         25,         25,        1,    38016, 04ad6fa97e1ff49931b574bdaaddd5db
-0,         26,         26,        1,    38016, e94f2ec4cbf2b9067a4a4307eadebb6f
-0,         27,         27,        1,    38016, e3542cdee672d97c65ab06dbe611247d
-0,         28,         28,        1,    38016, 6c83c6c76aa8bf73646eb7a714cb42bf
-0,         29,         29,        1,    38016, b5f64c6fc6d0c777a0a0b9097862f171
-0,         30,         30,        1,    38016, 293dccaf5027759679bb9e8696b6381a
-0,         31,         31,        1,    38016, 1a3d015ff9b164cb7922aef0aeac520e
-0,         32,         32,        1,    38016, 93f9152d9425f0ec43160a0c01c485b2
-0,         33,         33,        1,    38016, c7c4a8f78f781f70cedc44edc1d06911
-0,         34,         34,        1,    38016, 21330442d5bef415fd765759d867c98b
-0,         35,         35,        1,    38016, 6164258040f85206a3833aeb4f27a34f
-0,         36,         36,        1,    38016, 3213e1405dfe6588a7334a8bc2b1e47f
-0,         37,         37,        1,    38016, a619fa73f0081a349dfa2b000de19045
-0,         38,         38,        1,    38016, 1f3cec4bb793dc4a118ddcf500090f37
-0,         39,         39,        1,    38016, 12308ec77632ca10f1451aec8e62b82f
-0,         40,         40,        1,    38016, 018c7f50ed4a494a9fcd32fdfed6705f
-0,         41,         41,        1,    38016, a7282728fbd7e0b49a6967b0ea4e1f61
-0,         42,         42,        1,    38016, 6aa15ab83e82f246ee9c7b7a040bfaac
-0,         43,         43,        1,    38016, e4c17d2603e03753d54a142491cf5dc0
-0,         44,         44,        1,    38016, 0a7331aa707e42e732f04e9175438195
-0,         45,         45,        1,    38016, b522cfa3f3c706d1901231bb9e6b4b8a
-0,         46,         46,        1,    38016, 7b2a70e47d9af98cfa6216ed2a7d528c
-0,         47,         47,        1,    38016, b56e22bc9beacff9c3207b2757fc7f94
-0,         48,         48,        1,    38016, a3dfc9461c0480cf56ee465ddabf0de1
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-003 b/deps/libav/tests/ref/fate/vp8-test-vector-003
deleted file mode 100644
index 504766f..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-003
+++ /dev/null
@@ -1,50 +0,0 @@
-#tb 0: 1/24
-0,          0,          0,        1,    38016, 96e6ce168b5ef377053e86ab5484e7f9
-0,          1,          1,        1,    38016, 10fd750292d8522ab7ee577043604789
-0,          2,          2,        1,    38016, e040995173dc5c85abbbe38f6823ff9a
-0,          3,          3,        1,    38016, 5aa18f4fbd8b5b887d74f84cc92075dc
-0,          4,          4,        1,    38016, f0dc7f520e88b94e5cb924d804b0472a
-0,          5,          5,        1,    38016, 2375955dce3bb0a824779a800cd1555b
-0,          6,          6,        1,    38016, 3e96a0e477de39530e1950cff284a854
-0,          7,          7,        1,    38016, 6cd40fa8a89221f2b990bd8af2a9ee14
-0,          8,          8,        1,    38016, 0b929243ceeffce836279e2aa84647cd
-0,          9,          9,        1,    38016, 1e95f0ad25fe033076b57c3852bb3550
-0,         10,         10,        1,    38016, 81aa93a3f9c56d2aa4b8285d3507e6b4
-0,         11,         11,        1,    38016, cf9947a302dec306d7f487cf3a2731b0
-0,         12,         12,        1,    38016, 3b9ca47752db95a049678da07974b476
-0,         13,         13,        1,    38016, aa6788405dc47dd44867fca6c95ba3d9
-0,         14,         14,        1,    38016, 276d1c62b908c081c7bbb78f943b0de1
-0,         15,         15,        1,    38016, eb006b6218e457fd794e9b3a5dfbf638
-0,         16,         16,        1,    38016, 9dd5312833e770286c5aa5436a00376e
-0,         17,         17,        1,    38016, 7899278e66aa255ce5bf69a6e1137d0f
-0,         18,         18,        1,    38016, 0ac7d062ea7550fa0717723b1272abc2
-0,         19,         19,        1,    38016, d8f1bb881a46ecafcbbe457a004a71f1
-0,         20,         20,        1,    38016, cc3a04b98159189a74b5241df540d8fb
-0,         21,         21,        1,    38016, 4e29eb2c8c465ae9ffcfa28ec0b3694b
-0,         22,         22,        1,    38016, 608fb6ba526e6aa4ad1c0290aedaa69d
-0,         23,         23,        1,    38016, 4acc6a73547be6310b9a275436c55805
-0,         24,         24,        1,    38016, 482cf409b86242d30f3a78a6c85364df
-0,         25,         25,        1,    38016, a22cb76770f112eb1169218cc87c1e4f
-0,         26,         26,        1,    38016, e74675b051ff05e178a9a24893721d99
-0,         27,         27,        1,    38016, ee5061bff62c8c8603b7bc2bb2bb29e8
-0,         28,         28,        1,    38016, a3c0ab11f338bd488c69f2b62e1e5a74
-0,         29,         29,        1,    38016, 9f6b7e30e0ed4e272393b9a9957752e1
-0,         30,         30,        1,    38016, 9cce9f2ffff1766d05bda04e46eff997
-0,         31,         31,        1,    38016, 5105a2ba923bc6f21ea3d32ab1bc7bf8
-0,         32,         32,        1,    38016, 957d619a1001e2b5e52db166b66b7f50
-0,         33,         33,        1,    38016, fdb4e71cddeec8a321d9c8d4ffc506ce
-0,         34,         34,        1,    38016, 9ee646940fb8ac2312d29e9f1c3b6d40
-0,         35,         35,        1,    38016, a110e81d2105beae81cd36b15bc5ac2f
-0,         36,         36,        1,    38016, 804b6d8fc99fadb9c6bfdae3becee6b5
-0,         37,         37,        1,    38016, e217627bbaeebf30456e38aeb1f0746b
-0,         38,         38,        1,    38016, 56468a2c548dd3085b4bce88c4a1e41d
-0,         39,         39,        1,    38016, ef170e7f21e2b262525b43d6b25dec4c
-0,         40,         40,        1,    38016, 3acc3c47def8a0fa0561eaacaf9e41a1
-0,         41,         41,        1,    38016, 0c3e2187f13e4504fb4b246706bba83c
-0,         42,         42,        1,    38016, 397326a22e6e49487309c39d64037df8
-0,         43,         43,        1,    38016, 95236c1319b6f1f692b3998547811ee7
-0,         44,         44,        1,    38016, 5aff1957504884abf74d6fb74b74b032
-0,         45,         45,        1,    38016, 6de06343435a8926a746037cab5f633c
-0,         46,         46,        1,    38016, 3de68e05ddf2c60ee9110048ceefeb6a
-0,         47,         47,        1,    38016, e637fef689edad6ffd6eeb4a29004bf7
-0,         48,         48,        1,    38016, bb809114af8df5cb4ed82d3a1d11a673
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-004 b/deps/libav/tests/ref/fate/vp8-test-vector-004
deleted file mode 100644
index f402372..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-004
+++ /dev/null
@@ -1,30 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,    38016, 83c78b5db579710f61f9354d5c51e8c8
-0,          1,          1,        1,    38016, d173eb8a8211a05672b43206609c9034
-0,          2,          2,        1,    38016, 204e3e91613d647d30244c00fa2b9563
-0,          3,          3,        1,    38016, 3cc1a395bd10a49b006741778285925b
-0,          4,          4,        1,    38016, 024548b00dea4f104d6b9a728be05786
-0,          5,          5,        1,    38016, 01401e9418f2e00ab4ffdb3296d40ffa
-0,          6,          6,        1,    38016, 35d8b3c1ef9cb864315b7502b93629b2
-0,          7,          7,        1,    38016, aeb44f0fe4c2eecb26c0bd657d65b00b
-0,          8,          8,        1,    38016, 42e40bed012bacf59f0c41d4cfd3e52a
-0,          9,          9,        1,    38016, 9796191fa2bd4572123ea043396e8485
-0,         10,         10,        1,    38016, 2d6d68b902129f3c3f1730e73b98f9c9
-0,         11,         11,        1,    38016, ba348b89248b92d0b86d794dc413e6a0
-0,         12,         12,        1,    38016, 5ce49bf164033d49bef1b23120d202d6
-0,         13,         13,        1,    38016, 54837a426c63a9c40ef8750232615dad
-0,         14,         14,        1,    38016, 350bcddf9a34f5003f6f655aaa020a00
-0,         15,         15,        1,    38016, babb82b1e2ca9315816b6f43b8ef84a0
-0,         16,         16,        1,    38016, c770825785c51fa374fd5bb08ff9f536
-0,         17,         17,        1,    38016, e9e0f92e416fcd27ca2e93a0804ac938
-0,         18,         18,        1,    38016, e0f2b89423da549eaa8b2b89f956f0f8
-0,         19,         19,        1,    38016, 9926b7e13b51115735eb0af8bb5e4ea1
-0,         20,         20,        1,    38016, d6b30a058b854c54068ebfc2b05f8fa0
-0,         21,         21,        1,    38016, a03048df79e41ada8a3ecc15a85e3f94
-0,         22,         22,        1,    38016, 34bef9af0633a43434841fd5189c161c
-0,         23,         23,        1,    38016, 219b447552b1ee409c1b9b56176d36bf
-0,         24,         24,        1,    38016, 95ea99459eaebc2f7233feeaf0549224
-0,         25,         25,        1,    38016, 34e08ce4067ca67ee9014cf628b6bb1c
-0,         26,         26,        1,    38016, 066c09a20d11b9dc3fa6972fd7f242c4
-0,         27,         27,        1,    38016, aed02c1951070ae5febea21ad54add55
-0,         28,         28,        1,    38016, f5a0fde2d818c4aaabd29b069ced6aea
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-005 b/deps/libav/tests/ref/fate/vp8-test-vector-005
deleted file mode 100644
index 3569dee..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-005
+++ /dev/null
@@ -1,50 +0,0 @@
-#tb 0: 1/24
-0,          0,          0,        1,    38016, e7a4be434df4bb524ba56a03cba901f4
-0,          1,          1,        1,    38016, d903ade6d49e51485627c044fbb2190c
-0,          2,          2,        1,    38016, af07ee39629b852870104cb9a9dde9e3
-0,          3,          3,        1,    38016, 388a5f736db2de15342b62294fda4c82
-0,          4,          4,        1,    38016, a072600936aa77738fa2fa88ba212849
-0,          5,          5,        1,    38016, 0f96b1fb05b92498c0e1fcb6552e7e79
-0,          6,          6,        1,    38016, 68b0db002a0127ee79a7c70062aa8c3a
-0,          7,          7,        1,    38016, f9bc8edfeb9ceca9227a20cdab6788de
-0,          8,          8,        1,    38016, bfe2115b000565abc3dce1d38f804ed7
-0,          9,          9,        1,    38016, 67f17f96177f5464af1b97452560d2af
-0,         10,         10,        1,    38016, 658278016e5409b69d014fab0d94d0ea
-0,         11,         11,        1,    38016, 04dfd36afa0ddf22993d21c0a0fc715e
-0,         12,         12,        1,    38016, 088e5a7cc75a895f01f7a4362f104bc1
-0,         13,         13,        1,    38016, fb622a1a421b3689950f1adde9296dbb
-0,         14,         14,        1,    38016, 3711ac7adc816614a2efda9e138f53fc
-0,         15,         15,        1,    38016, 8e6fe3e68ccf53f23dd430b611fbfa6d
-0,         16,         16,        1,    38016, 1c77dd651cd38d3308671f0705d29926
-0,         17,         17,        1,    38016, bb5d7afccebc5d8a29f5980d21530d61
-0,         18,         18,        1,    38016, e51f2eeb39afa50ea243eaca39974f82
-0,         19,         19,        1,    38016, 7a73b1546fb5d8d4b05ebd4c839f74f8
-0,         20,         20,        1,    38016, 62a0db46717d7fb6523c62968fd3bc85
-0,         21,         21,        1,    38016, 98d6e520a164c42c5d19167c0ad48b22
-0,         22,         22,        1,    38016, 9749a21ea432221323c1a6b61ea59d51
-0,         23,         23,        1,    38016, 45fa9a9583db0139611b860bed8f6bc1
-0,         24,         24,        1,    38016, aac06fe351759ca81a5028f2f4a7b534
-0,         25,         25,        1,    38016, 7b7c7c16a377d61b6fe474541a18f0cd
-0,         26,         26,        1,    38016, 2a84883fdfa8450d46b8b9352b7d5a87
-0,         27,         27,        1,    38016, 3fc42d7dd6fa25ec17d8f2881f81b376
-0,         28,         28,        1,    38016, bfb243be1eada17adab5580b748248e7
-0,         29,         29,        1,    38016, 531fd799989db62210efc1999397d280
-0,         30,         30,        1,    38016, 1c1e68673b295e17fca1b14d1eb1995e
-0,         31,         31,        1,    38016, 12ee0f8810a1a3574337ef98987cf919
-0,         32,         32,        1,    38016, 0c6ef1cec243c552e83054d5ac56a8c1
-0,         33,         33,        1,    38016, cf0af3fb96e57143d335086485fbfa5c
-0,         34,         34,        1,    38016, f5df68bb123d1f2f59ba471fbd118a9e
-0,         35,         35,        1,    38016, 0b4a0cf5dd7968fd26959ad2849655b0
-0,         36,         36,        1,    38016, 0ba766224688a95bfa43ac2453555972
-0,         37,         37,        1,    38016, ef3f9fd7e5509bb880377fa1997d318c
-0,         38,         38,        1,    38016, d7486c3176cef98c0046522acbdaa4f0
-0,         39,         39,        1,    38016, f8dd15973993f4a2acd1d34b3610622e
-0,         40,         40,        1,    38016, e99b7f294e6bdd9ae18f013f62174fcd
-0,         41,         41,        1,    38016, 68ccf7e14a1055b24c5faf1b3a1888e7
-0,         42,         42,        1,    38016, 2f230afb6e5c67e4b7e000317638e919
-0,         43,         43,        1,    38016, 9cab31ac76ed26a879ac8b88bf7d33a1
-0,         44,         44,        1,    38016, 1e2affc0f458808b4564bd0453565a81
-0,         45,         45,        1,    38016, 79669092f6c73053c3de6d0d1408cc8c
-0,         46,         46,        1,    38016, 7b27977ba84341b9af4d58a7864f763a
-0,         47,         47,        1,    38016, 2481a387d65e7a16fe831b8da2200985
-0,         48,         48,        1,    38016, fa5e3bc265877b30ca71de0a2b14663b
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-006 b/deps/libav/tests/ref/fate/vp8-test-vector-006
deleted file mode 100644
index 38b92c4..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-006
+++ /dev/null
@@ -1,49 +0,0 @@
-#tb 0: 1/24
-0,          0,          0,        1,    37697, 9ca5df27b0158aca2a38dff946f58c41
-0,          1,          1,        1,    37697, 627129a99538ec1ac51be910ca92ebc4
-0,          2,          2,        1,    37697, 6c2df1f21af317aa5bb68b161ca96c70
-0,          3,          3,        1,    37697, d66db823863838ca5b7f9125609e7de3
-0,          4,          4,        1,    37697, ecc970f8846290c0b7bf8d0865975cb7
-0,          5,          5,        1,    37697, 2fe7575c448562e291933e297335e1c8
-0,          6,          6,        1,    37697, e2a6fb8af11f65ce1153d6021df39e5f
-0,          7,          7,        1,    37697, 4536008cd0a425c9a9d93cbb3e8ba640
-0,          8,          8,        1,    37697, 478f042fff1cf0b6fd2eed391879c7ba
-0,          9,          9,        1,    37697, f079ee39021b1dd730f80bfaff9a6ae4
-0,         10,         10,        1,    37697, cb9b166c785ceabecf79e12e6068d4e4
-0,         11,         11,        1,    37697, 6bd6f77dc9c45cec08949a42aa1c2653
-0,         12,         12,        1,    37697, 1433577eb50b3270c0f1d6d26fb26277
-0,         13,         13,        1,    37697, 2765b207d230efd9a3e2e93c641b8553
-0,         14,         14,        1,    37697, a67e2f6bcf3b03e250c0ad8f1384ffb6
-0,         15,         15,        1,    37697, b5ea80e2dbffefdd8a613c25ee7f5f0c
-0,         16,         16,        1,    37697, e4b58bf735a8258842ad3c364eb9418c
-0,         17,         17,        1,    37697, 8e5fc5d4c78eb495f62e4a014a6a2a6c
-0,         18,         18,        1,    37697, 53bee2faf4cfae16037cda36a6194a57
-0,         19,         19,        1,    37697, e5c2e1de872a7107f80966ae857557d4
-0,         20,         20,        1,    37697, 882e46851681e6e3b376b5d1d9e139fb
-0,         21,         21,        1,    37697, 40b199fe02b5885947af22ce1314a085
-0,         22,         22,        1,    37697, 942b79dd5360c2a114db760424620a84
-0,         23,         23,        1,    37697, fe9f69dd6fc113ceec9127d9e12b3958
-0,         24,         24,        1,    37697, db13edae7e8e8a91d1ec84227c8f818f
-0,         25,         25,        1,    37697, 1963ea61c3e93150f7604ee6fa09b12c
-0,         26,         26,        1,    37697, 8cf43556160454d2353cedb9ba5675aa
-0,         27,         27,        1,    37697, a5e6b5b00fea3d9b1bdbd01fda712f27
-0,         28,         28,        1,    37697, 35f006cb6e570999b9011282c49c6d22
-0,         29,         29,        1,    37697, d884d482371cb2727e26475bb390d38b
-0,         30,         30,        1,    37697, a7233206056d3af69c6cff343b57de84
-0,         31,         31,        1,    37697, 437492f3e594576e1c17065e0091aa2d
-0,         32,         32,        1,    37697, 47f0677d9aff054056a194755628fdb8
-0,         33,         33,        1,    37697, fc93105a16501763a6e6ba3445ee6f32
-0,         34,         34,        1,    37697, 68612903d08399e0f0d9e28c1f18f6ea
-0,         35,         35,        1,    37697, a340fbba24c73372e6248f10e878f11b
-0,         36,         36,        1,    37697, 58c3561b06f9d866587f728877c08860
-0,         37,         37,        1,    37697, f2dd2a029515ad9c0655ccf86a2c524b
-0,         38,         38,        1,    37697, 789d43f63cbb302dad9f3e4b33713746
-0,         39,         39,        1,    37697, d8f979aca1774470269283da048a505b
-0,         40,         40,        1,    37697, ecc06e2175290319cb36614370c8ad62
-0,         41,         41,        1,    37697, 5ba26b83766b666007b502a7194170e3
-0,         42,         42,        1,    37697, 8163a20e9a345b70579c625c50e7ec73
-0,         43,         43,        1,    37697, 1f1a497d768c4bcd57de11b21baf9138
-0,         44,         44,        1,    37697, a21e9a52a982675815c9937b49ebb0ff
-0,         45,         45,        1,    37697, dcc0bd83ce31ac99577cd2f9ced69096
-0,         46,         46,        1,    37697, df36b27588b8515580d5015e5f66dbf9
-0,         47,         47,        1,    37697, 156a6351549949953ce3197b990760a9
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-007 b/deps/libav/tests/ref/fate/vp8-test-vector-007
deleted file mode 100644
index 8d9b912..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-007
+++ /dev/null
@@ -1,30 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,    38016, 98bd0af6928c144888a9c320270e9f0e
-0,          1,          1,        1,    38016, 9ff7cff703d58481acd233451388377c
-0,          2,          2,        1,    38016, e4cd8815527846cc782ea61ef5a46e49
-0,          3,          3,        1,    38016, db45275b87e194e5b505dd8c47da4f5d
-0,          4,          4,        1,    38016, c889d0f7bd34faf4df0e0a9eb9fc292a
-0,          5,          5,        1,    38016, 4dbfb1727baf9b75980e7fdd44ca0924
-0,          6,          6,        1,    38016, 5f217ac95c891dc81f7193fc5352d582
-0,          7,          7,        1,    38016, 11166789635e472f629510f551b11e2c
-0,          8,          8,        1,    38016, 336e6e42e67e1ccb7cda6298cb63f192
-0,          9,          9,        1,    38016, 02dbcff56882e304d5043d0f9b1ff9ff
-0,         10,         10,        1,    38016, fe033ea2c6b8b81a9328b470f8b0d6bb
-0,         11,         11,        1,    38016, 0e3330fe9a7c0439ff53f18f0d15eb48
-0,         12,         12,        1,    38016, 6c0d7e042a3bb32a128c4a405f59b426
-0,         13,         13,        1,    38016, 7e51afc33dbf4b77fc5735f5d9ec0248
-0,         14,         14,        1,    38016, a8381f193f34a5071b8eeba7f5cd1968
-0,         15,         15,        1,    38016, 501a7914b47ff85c24f0533ee98b9fe9
-0,         16,         16,        1,    38016, 00bd5fbb7e3b66514e6c77c3a5f118c3
-0,         17,         17,        1,    38016, 23e296d12a45909cadda252b9f4e67bd
-0,         18,         18,        1,    38016, fa0b5c69bacf766551bebdde0910eb9f
-0,         19,         19,        1,    38016, f5cc24d10d58ebc50503ca321db708cc
-0,         20,         20,        1,    38016, 3997eb9ff6231dee9e23752776113cd6
-0,         21,         21,        1,    38016, 68d4c9cd494d91dd70e7a94c7a4b9a12
-0,         22,         22,        1,    38016, 647b34f3aa7318adce68803ba00104fb
-0,         23,         23,        1,    38016, ffed5301bd6fddd1d24d12e6096cc8a6
-0,         24,         24,        1,    38016, 9511388180811c10d166886868d6e71c
-0,         25,         25,        1,    38016, a9b330803b8ccd91596591c0449423ab
-0,         26,         26,        1,    38016, 69b192888cda09dac658d5820183a2e8
-0,         27,         27,        1,    38016, 8886e5851e60a7474cc9e214ba6373ad
-0,         28,         28,        1,    38016, f59e354deedb129a90ab3922838b03d3
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-008 b/deps/libav/tests/ref/fate/vp8-test-vector-008
deleted file mode 100644
index 9be8d73..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-008
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/23
-0,          0,          0,        1,  1907424, 7146d3a72b6cb8e43ee5280ef8d661fe
-0,          1,          1,        1,  1907424, 5a537e9710158efb5ad2683a1d3b4c72
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-009 b/deps/libav/tests/ref/fate/vp8-test-vector-009
deleted file mode 100644
index fae204d..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-009
+++ /dev/null
@@ -1,50 +0,0 @@
-#tb 0: 1/24
-0,          0,          0,        1,    38016, b3a3121c796a60c88988fef5240a07fe
-0,          1,          1,        1,    38016, f25147764829cf837e00b8fd6383e2c4
-0,          2,          2,        1,    38016, 1b1552291a89c97d5deea145ab0ac0cd
-0,          3,          3,        1,    38016, 0b2e75bbbe8f4248eb1519b6542efc96
-0,          4,          4,        1,    38016, 99e8fc68547e119253ee3b8d79efa774
-0,          5,          5,        1,    38016, 3aaf9210819238da7f704339bd8f262c
-0,          6,          6,        1,    38016, de80b11f4c325e6d467d4abe5ad0db51
-0,          7,          7,        1,    38016, 93d2fba68721768018b35ccac27b6bb1
-0,          8,          8,        1,    38016, 07d7d4f8ad4151a013b652bec21ea9b8
-0,          9,          9,        1,    38016, aaa95e4d39aa31cf68fdb8da268827e5
-0,         10,         10,        1,    38016, 3607fcda0733e0b0fd10a8f7fbe6e39e
-0,         11,         11,        1,    38016, 6d8cc24ea3b9827ef0147c8b7cc6938d
-0,         12,         12,        1,    38016, 977a6b65d41b1b70dd4df9f526045675
-0,         13,         13,        1,    38016, 9258b0e5fc2217c3aebbd96bb06c937a
-0,         14,         14,        1,    38016, 887378a3aad18346a3827cd0aadc6873
-0,         15,         15,        1,    38016, c2a3ff302d74eefd0855f2c862766aca
-0,         16,         16,        1,    38016, 1a7d835f5a977e1fd8cc37bdd8d029ca
-0,         17,         17,        1,    38016, 232be1f7e334001c3abbed550cc60c34
-0,         18,         18,        1,    38016, e8cb3470b9a3ffbc7014793514dc89cf
-0,         19,         19,        1,    38016, 54b20adca41910f003790a975ff7b50d
-0,         20,         20,        1,    38016, 2c5fce4dcdd538f1d9377fa071f3d615
-0,         21,         21,        1,    38016, d559840da8cef1f0b1379a592f708f0a
-0,         22,         22,        1,    38016, ffab5f1060938a62cf8ef9df30ec8a33
-0,         23,         23,        1,    38016, b7d93c8eda8cce4d387f2ea78c415704
-0,         24,         24,        1,    38016, 7840aa27333e6350d114b256ab4304f1
-0,         25,         25,        1,    38016, dc1f3b125177d0ad7f53dd058bba03e7
-0,         26,         26,        1,    38016, 37134fcaad963a22f4df04c0765af455
-0,         27,         27,        1,    38016, 4dc062fb76943a75e7b2428e5babbb3c
-0,         28,         28,        1,    38016, dfda91bc05efc72073a2b6b62f294327
-0,         29,         29,        1,    38016, 7ffc690c63a1c54e35978336dc5828a3
-0,         30,         30,        1,    38016, 9ae31bacbc097c2ccf1500ff89882e46
-0,         31,         31,        1,    38016, 1450c24713dcad41aeba1c44007bf12f
-0,         32,         32,        1,    38016, f125bb52b8a1b11e076de55cca1069ee
-0,         33,         33,        1,    38016, 555e1f2a6d293a0bdc9f92e9c3b3118d
-0,         34,         34,        1,    38016, ec9a8d577a07a4f0d5deae63b3cea6dd
-0,         35,         35,        1,    38016, a54f74e0ee329db4a78851bb7e54b2ba
-0,         36,         36,        1,    38016, 99fcfe7ed9028bc443a790f9cf8eb812
-0,         37,         37,        1,    38016, b9b994ffbe0150945b752a2120b4a475
-0,         38,         38,        1,    38016, f00d70d8a28cecaaec1eb84592e3f6c3
-0,         39,         39,        1,    38016, 3bc8ed07fc92c4d339164891e6624306
-0,         40,         40,        1,    38016, d755777560d745d6bdfa01b9e9cbbcc0
-0,         41,         41,        1,    38016, bcefb5ef8fae173e413406b4a60e2255
-0,         42,         42,        1,    38016, fb47098c334b82764e30819066b13096
-0,         43,         43,        1,    38016, 9e31f68fc96045bba43cf1253eedc419
-0,         44,         44,        1,    38016, 53522d46d2ba91ab23693db7d41ecda7
-0,         45,         45,        1,    38016, d66a074ebe6123590622e5cb308d75e5
-0,         46,         46,        1,    38016, 6574fce175632a22fcc05b47157318e4
-0,         47,         47,        1,    38016, 31f7fb05d060c1dea46044787772baaf
-0,         48,         48,        1,    38016, cec733062ae526ae71b39ae0dc402482
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-010 b/deps/libav/tests/ref/fate/vp8-test-vector-010
deleted file mode 100644
index b250ad9..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-010
+++ /dev/null
@@ -1,58 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   115200, 3441ec1a9b9d325c9aeda44e3b68377d
-0,          1,          1,        1,   115200, bff86a84fd673394f45c09d19a1ee0ac
-0,          2,          2,        1,   115200, 8cd920f0de408e8cd883f9241680ff80
-0,          3,          3,        1,   115200, d1b27cbb40859bbbb6da40dce6ddbf1b
-0,          4,          4,        1,   115200, ca102ed86e45fe452f55a2cf0253de21
-0,          5,          5,        1,   115200, ac7630be64017becd6e958df360263b5
-0,          6,          6,        1,   115200, a044041ede746687d33ba6342d8d3edb
-0,          7,          7,        1,   115200, 75d7c0eec357afd0c2d54e769f551b20
-0,          8,          8,        1,   115200, eebd916e4fba53a66fc8e6ab98091a0f
-0,          9,          9,        1,   115200, c0044160a944dcac81efe9f63def4bc2
-0,         10,         10,        1,   115200, 9ba8b2ccbea045b39bd150ea383abc00
-0,         11,         11,        1,   115200, 8d7654804fc62f7d52d5bf3d47f536e9
-0,         12,         12,        1,   115200, 9fd6cd81fbe6cfc43e03cdf166c7ea93
-0,         13,         13,        1,   115200, a1a494064dba27238005227c0808c5f6
-0,         14,         14,        1,   115200, b8dca72164ea72b3f257c97c3ad87416
-0,         15,         15,        1,   115200, 90ae005c0f3ddb4318318805b8fc29cf
-0,         16,         16,        1,   115200, 8183e7b60f18887a9530a7905db4b417
-0,         17,         17,        1,   115200, 1650ad1fff9076141f59b660c562f0f2
-0,         18,         18,        1,   115200, e9ee675cafd270c366ac9d3ced5af879
-0,         19,         19,        1,   115200, 2257172d6e8628b4dd4d9bf97e9ee2c3
-0,         20,         20,        1,   115200, 577438f88feca7a876381a6fcf094684
-0,         21,         21,        1,   115200, 4b37e90eb35cba66d31616169020c039
-0,         22,         22,        1,   115200, 2c631ab87b8d3b7df13f888e3d6f1690
-0,         23,         23,        1,   115200, e0d46e04d6a57b20c2b056cd0a0ca1ec
-0,         24,         24,        1,   115200, 65bd3e207b8ed966b71f40a04f1900b8
-0,         25,         25,        1,   115200, fd842606a20fb297463b7b3dd6efa2c2
-0,         26,         26,        1,   115200, 778cd96eabe785320254db7692583f47
-0,         27,         27,        1,   115200, 094272ad385a64fbc70a62f958e27eff
-0,         28,         28,        1,   115200, cf5f7b3b94a00938b633ea1d9aa8e8dc
-0,         29,         29,        1,   115200, 032e2f3649484ca17c739cf89052de77
-0,         30,         30,        1,   115200, 9afe92189c21675745609e3b21a75941
-0,         31,         31,        1,   115200, a5e087c496798bfbc64d6c26eee0b3af
-0,         32,         32,        1,   115200, efb2716347ba2e01f7dc103d2a6cebb4
-0,         33,         33,        1,   115200, c83541678dcca8937e372102bc4d1f68
-0,         34,         34,        1,   115200, 3401ed97a9296610c8473dcf03e13f20
-0,         35,         35,        1,   115200, 35af1327fafe026b6539951a9baee282
-0,         36,         36,        1,   115200, f320e2d64192849c08c4c5e6d79e4ecf
-0,         37,         37,        1,   115200, 5a661af83f451d8651cf081399d451b2
-0,         38,         38,        1,   115200, 625d271b60d91229699f1de35d232b13
-0,         39,         39,        1,   115200, 8e504154fa8eba5f9807bf40c647eea8
-0,         40,         40,        1,   115200, 094ecb39a65c71e85d15a587472bb336
-0,         41,         41,        1,   115200, 4d08bfe5771f00e13646be49e3471c4c
-0,         42,         42,        1,   115200, 20841206e07721fb631088d492622543
-0,         43,         43,        1,   115200, edf969142e1b053f951c1a5756f2b5d9
-0,         44,         44,        1,   115200, 4959a13f20311d9b435e501fd753c94b
-0,         45,         45,        1,   115200, a7f34e6c985d630af07a9f6dc47ea50e
-0,         46,         46,        1,   115200, 96f6667d849f3abe4e85e3ce368b76ee
-0,         47,         47,        1,   115200, a47d443c8aa5f2d2e3b44deab3f4f8e7
-0,         48,         48,        1,   115200, 4ebda78d96facc4472ecdb4f667be0c6
-0,         49,         49,        1,   115200, 6ba744c47edab85c6e77584e35e1b735
-0,         50,         50,        1,   115200, 4d2e6882f15356171e4383111ec70e6e
-0,         51,         51,        1,   115200, 85077fc81dff947b1251bfbd981aaf52
-0,         52,         52,        1,   115200, f03e8879a5218387c502eaab31682df9
-0,         53,         53,        1,   115200, 90f6128298cb52f769d697f9f842df27
-0,         54,         54,        1,   115200, 700a705680c1a940141bc03ae5de391b
-0,         55,         55,        1,   115200, 049b3df3ed9673ab8e0f0d0d896f65c2
-0,         56,         56,        1,   115200, ca8c3e5509211dc92078371f06dc8635
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-011 b/deps/libav/tests/ref/fate/vp8-test-vector-011
deleted file mode 100644
index d591ec7..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-011
+++ /dev/null
@@ -1,30 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,    38016, 83c78b5db579710f61f9354d5c51e8c8
-0,          1,          1,        1,    38016, 9b755a63c7c5352660a265f6e24991e1
-0,          2,          2,        1,    38016, a591f0b04447d6d6dd9bb990502594aa
-0,          3,          3,        1,    38016, 6ebbd38d20a4104a842c66df53a8b86e
-0,          4,          4,        1,    38016, a114c37e74a4252ed66c5c4e7c8df84b
-0,          5,          5,        1,    38016, 4bad182348dcfb627b3e15bc228a3c8f
-0,          6,          6,        1,    38016, a843b5c80266f890044a4ba1f59de8ed
-0,          7,          7,        1,    38016, 34816d9129f252afcbd56d6ad1df94c7
-0,          8,          8,        1,    38016, 7d7d46cd08e18aea6fc52c0ec58a4803
-0,          9,          9,        1,    38016, c96c3357d89534fce32251a0d52c68c5
-0,         10,         10,        1,    38016, 5eb1329f955ab80696d8220605a51552
-0,         11,         11,        1,    38016, 68b3d5162cd5b004a6dfeac705c75afa
-0,         12,         12,        1,    38016, b79647c678fbbb9ffbd8c4ff63c05e43
-0,         13,         13,        1,    38016, 4566eb5f995852d72b6913d2ca2e321c
-0,         14,         14,        1,    38016, 02e7e951ac9e42eafb1260defaecf685
-0,         15,         15,        1,    38016, ddbfa0f81a009c41271c9aa587e88baa
-0,         16,         16,        1,    38016, 27d31dba74cb2170c456830a9f888c0b
-0,         17,         17,        1,    38016, 0537650a41bb087a5fd33d6347fe9036
-0,         18,         18,        1,    38016, df2205297d4f00164a3440c8fa1ac4ee
-0,         19,         19,        1,    38016, 9942b757bd3839c1cd6b1068c68967f2
-0,         20,         20,        1,    38016, d9284e1e989cd38d0226b1a3c6e89409
-0,         21,         21,        1,    38016, 12427a3fdc22461fe9d6ff9dd5863bef
-0,         22,         22,        1,    38016, 63f75f2a63630347671c0e6dd2f88bcb
-0,         23,         23,        1,    38016, b161169a678e3959b492d83a03d47dee
-0,         24,         24,        1,    38016, 50a6d4c8722197f0abd1028b968dce58
-0,         25,         25,        1,    38016, c0f81ef6b25034cff00db1e3c369be97
-0,         26,         26,        1,    38016, 01b502a4b69d5be7a82f292e735aa087
-0,         27,         27,        1,    38016, 6bbff03307f93a654e4529e2a5092887
-0,         28,         28,        1,    38016, 17ef5fd4bd1cc6030e1370a43f1d19bf
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-012 b/deps/libav/tests/ref/fate/vp8-test-vector-012
deleted file mode 100644
index 4d5adcb..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-012
+++ /dev/null
@@ -1,30 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,    38016, cc3069a59b6f4319761af2b39923a6e5
-0,          1,          1,        1,    38016, c0bc935941d994c6af6a864f02a90a62
-0,          2,          2,        1,    38016, 5b6073ce4a03967aa87e56dfa27e32c2
-0,          3,          3,        1,    38016, 5310a9d6bf938ed89b10727f11e131c4
-0,          4,          4,        1,    38016, 290fb1310ea10b862b51d37ff9d79f7c
-0,          5,          5,        1,    38016, 0ca1accba77dc867df682b8e3768d6e2
-0,          6,          6,        1,    38016, 2a90659dd4cd5d2f825641be55609d97
-0,          7,          7,        1,    38016, e003db31fbfeab54385252e8c64197fc
-0,          8,          8,        1,    38016, 0778609bd9626652e8a8dd07d5ef9f45
-0,          9,          9,        1,    38016, 36eecf49c4aa2d8c3f232a1dbbb5f4ca
-0,         10,         10,        1,    38016, f69f30dd8ebb7db4c51e0371f6a23736
-0,         11,         11,        1,    38016, e9d5293db5122b9683a0853c2ef678cb
-0,         12,         12,        1,    38016, 75d6a09bca67a82c8aacabb710558330
-0,         13,         13,        1,    38016, 973d73aa4bb4e3de2cb1ba97685e08ca
-0,         14,         14,        1,    38016, daf9ce67baaaa02bc56f49b540f22a30
-0,         15,         15,        1,    38016, d08fd3b942e1219132015819c553f2c2
-0,         16,         16,        1,    38016, 0aeea73b030e47bbd80bb0fb33fb6ebd
-0,         17,         17,        1,    38016, 6e9f5f98fffe27abfae52304c693ae44
-0,         18,         18,        1,    38016, 961c71a47741a1ac47fcaebf958647c8
-0,         19,         19,        1,    38016, e75e53160b9f33eca0dfba999d8002eb
-0,         20,         20,        1,    38016, ebb5d79336f75c44a09971dbba6947f3
-0,         21,         21,        1,    38016, f02317fae5e143103a114ca692b58c25
-0,         22,         22,        1,    38016, 8282867aa63fa23c48cc0216e21933cc
-0,         23,         23,        1,    38016, d0d74ebbf56ca62825641028b66cdb20
-0,         24,         24,        1,    38016, a8df24b0a22fe4fb334ea7063cba8754
-0,         25,         25,        1,    38016, 8a570e42ad6ab42ead80b5022c2eb2f1
-0,         26,         26,        1,    38016, dae566f13fa69de11db3ba7673e6211d
-0,         27,         27,        1,    38016, 914ed8403cdbf4c54d0b9cb1eeee6832
-0,         28,         28,        1,    38016, 18aa8d4bfe06a04ec4e9ccf9c7a92643
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-013 b/deps/libav/tests/ref/fate/vp8-test-vector-013
deleted file mode 100644
index de7c0b3..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-013
+++ /dev/null
@@ -1,30 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,    38016, ad137b9eae93daed28fe31fd5165b4d0
-0,          1,          1,        1,    38016, 7cd527f647680c0eb305050d27fb8092
-0,          2,          2,        1,    38016, f306e07a2e86c82a8cc1333be3812326
-0,          3,          3,        1,    38016, 4ffd6065ef6af716fdb7388479cf300e
-0,          4,          4,        1,    38016, e776c698ae335107d5794c02cf00d3ee
-0,          5,          5,        1,    38016, c0043e3283b96a4aa58d2265b007e67e
-0,          6,          6,        1,    38016, 235dd358e6adb3e144d7d957458e74a0
-0,          7,          7,        1,    38016, 4d34b966a406e7c2d5cef029ddc76021
-0,          8,          8,        1,    38016, 65f9eb823a63e17710b111892c415b70
-0,          9,          9,        1,    38016, 84d4a1d510d1c1aa8f3e7232d574ba9d
-0,         10,         10,        1,    38016, f3218df364f0e283df56b5d4a9cdfca9
-0,         11,         11,        1,    38016, 3079d93a140b51fe3e7b4889fd5fdd24
-0,         12,         12,        1,    38016, 4b76d7f904960792b78378c95453b77a
-0,         13,         13,        1,    38016, 26cdd39f9cd862b383352bf769d212a0
-0,         14,         14,        1,    38016, d98dbe7d7b8a5ccc50cb3a2e3dcacec8
-0,         15,         15,        1,    38016, a931f142064062d7d2d1245278c6edd9
-0,         16,         16,        1,    38016, 0c6dae06c59c040801be386d7e883f52
-0,         17,         17,        1,    38016, cec4a68182fb14185360f57de81e73cb
-0,         18,         18,        1,    38016, 7e819d1d928f974f25d45023a89a6765
-0,         19,         19,        1,    38016, 6d9a9fd28212940497f881ef4886d756
-0,         20,         20,        1,    38016, f22969fc06edc0c9190cae8bb22243ae
-0,         21,         21,        1,    38016, 2fcd676dbf66f842e91649a3d6c80f50
-0,         22,         22,        1,    38016, ce16e8920e91ec208dfb241addfc612b
-0,         23,         23,        1,    38016, 3a205f364751ff5e72d7da20e5713f53
-0,         24,         24,        1,    38016, 2305bcde500197d7697eec4ba89f1533
-0,         25,         25,        1,    38016, 23712ae207ea2381f886ed038ec3852b
-0,         26,         26,        1,    38016, 7197e717541573be07f9cda50ba524a9
-0,         27,         27,        1,    38016, 3f3e3ec6d1d6f49021affbadb75c1fda
-0,         28,         28,        1,    38016, 424fe8391a419b005a6f142ec65d802b
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-014 b/deps/libav/tests/ref/fate/vp8-test-vector-014
deleted file mode 100644
index 4341e59..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-014
+++ /dev/null
@@ -1,50 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,    37697, 7a0356dc950e79744d79c98e391ebee9
-0,          1,          1,        1,    37697, 96e221e75c290dd847b8e55865073366
-0,          2,          2,        1,    37697, 67638290841837c90f180a01094f9191
-0,          3,          3,        1,    37697, 93c8e234e123f7a641c5eb44903b75ab
-0,          4,          4,        1,    37697, b4fa5ce6089221863002019d99ae7f9d
-0,          5,          5,        1,    37697, 5d3b48fbb681ef2b6a0a5e60c03ee5bd
-0,          6,          6,        1,    37697, 26635956a9ed343428b36947723b4b94
-0,          7,          7,        1,    37697, 18e9b11e10350ab20b89482c5d1c5cea
-0,          8,          8,        1,    37697, 44fe40a7ce85552ccf95a451c5732e57
-0,          9,          9,        1,    37697, f38758bf6d522023961d08719e92d3ce
-0,         10,         10,        1,    37697, 28a2a9ebb3633a0822c9a283ab1ddea6
-0,         11,         11,        1,    37697, 4b4485c9419710ad6d3e6aa11fe3a91b
-0,         12,         12,        1,    37697, e3f6850a934c6e3e2fed3026e1e53066
-0,         13,         13,        1,    37697, 4acff1abe788a4944474b82d10af172d
-0,         14,         14,        1,    37697, 4cbfcc008923e8303df170d4e7b1cf34
-0,         15,         15,        1,    37697, dde5de0c676f60b4cea26bbf024bbfb7
-0,         16,         16,        1,    37697, fe1b0890eef18cd4989d251dbc3b7ef2
-0,         17,         17,        1,    37697, 462303741de9904a13bd46534010f588
-0,         18,         18,        1,    37697, 7ab2068505dbccdf522a08a65373b6b6
-0,         19,         19,        1,    37697, cb63092b6880bbdbaa40b40d738aa4dd
-0,         20,         20,        1,    37697, dca7556869370de600afbda82bb45fae
-0,         21,         21,        1,    37697, 5f5cae9db9e3aa3f300706ebc3874987
-0,         22,         22,        1,    37697, eaf7ba4f48eb5722c09420f2be4bc5f3
-0,         23,         23,        1,    37697, dd5b43b72c8b9c3ad53afef0f8869a68
-0,         24,         24,        1,    37697, f5d81cadb4b1f69e9700293e38ea36a2
-0,         25,         25,        1,    37697, 1e56a6becf3099db71fbc7a996c4fbba
-0,         26,         26,        1,    37697, 7e0676c4af74b59d9560d8b42d400de2
-0,         27,         27,        1,    37697, 6717c3c344b45e9e202e808d19c9baa8
-0,         28,         28,        1,    37697, 42b92f6fbd4cc5d4cf4f9b364a8a7741
-0,         29,         29,        1,    37697, 6caca9fcc03e8b9d326aec18eaaae928
-0,         30,         30,        1,    37697, cfa2798d156cabe81160c00939102d90
-0,         31,         31,        1,    37697, 5d018cfac7da660819da2e5d25e8126e
-0,         32,         32,        1,    37697, 761b7b2b64b22abadb89c58ab294520b
-0,         33,         33,        1,    37697, 4e066fa627d4dbf3635148eb6b2a0477
-0,         34,         34,        1,    37697, e0d6dd242cb99c7bc9826a05895344c5
-0,         35,         35,        1,    37697, 84e7beedcba6da53feb722f30211d2f8
-0,         36,         36,        1,    37697, af49b3fcc56b02ca746792b1d3bbe1c8
-0,         37,         37,        1,    37697, cdd9f17b4501bc7f7bedb70f2e33f282
-0,         38,         38,        1,    37697, 69d853dfd9b09d299faec521acb4e765
-0,         39,         39,        1,    37697, c3497292359c1a1de81cd5fb062e5175
-0,         40,         40,        1,    37697, 0e3994e4a62d8c922dbde51186615ea7
-0,         41,         41,        1,    37697, 86bc5561c72bd17e7473f54f6b6311f1
-0,         42,         42,        1,    37697, 0c747481e3dc575c6aad4507f8e62d8e
-0,         43,         43,        1,    37697, 6779dfe5b6a7d4ba5ae5355058f54bc9
-0,         44,         44,        1,    37697, d7d4e85f48d38c1106a031bd9b57d909
-0,         45,         45,        1,    37697, a0ab20a38891925fd77ac2b075f0046f
-0,         46,         46,        1,    37697, 88655045ce8c5cb4c4aa3a5071f1beba
-0,         47,         47,        1,    37697, 7e849d493185a8f782b53a71151bae26
-0,         48,         48,        1,    37697, a5b9a0cbfac73d2227118c0718cf9d14
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-015 b/deps/libav/tests/ref/fate/vp8-test-vector-015
deleted file mode 100644
index b32f233..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-015
+++ /dev/null
@@ -1,261 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,   115200, 6b4c7cc0c6a7218362e43cffef6618c9
-0,          1,          1,        1,   115200, e132a7b1bb4fb15b1019092aedc0e599
-0,          2,          2,        1,   115200, b36975db60f24088d95385ff7e8b7b8a
-0,          3,          3,        1,   115200, 4ae6a13ae0435afb2eac66f15a07b143
-0,          4,          4,        1,   115200, d1de33515e29053171c9fbe969a33fa1
-0,          5,          5,        1,   115200, cf01450481865c10765995a3b92b440f
-0,          6,          6,        1,   115200, 274461d33aeab30885b23bf2818ad150
-0,          7,          7,        1,   115200, cb434c5a829b3d6d15a6e76f05abd51f
-0,          8,          8,        1,   115200, 512019fa16b1cd6bf308c91d6577cf2a
-0,          9,          9,        1,   115200, 2d1174741c144b2162806373d0092739
-0,         10,         10,        1,   115200, 8ec38a17566342a35598bd5ab6d290d5
-0,         11,         11,        1,   115200, 262b71c9874cc7a5138b12b294575572
-0,         12,         12,        1,   115200, bfe5e37095dc450dc717fda5ef77b6fe
-0,         13,         13,        1,   115200, 7fbcdb00872206a597bb69ebe9221b03
-0,         14,         14,        1,   115200, b599ac8568b6780dec25de4211e071ef
-0,         15,         15,        1,   115200, 797085b07f4c1e4f4b0116d329403cf8
-0,         16,         16,        1,   115200, a0d0821365658bee14767698877cc066
-0,         17,         17,        1,   115200, 286a917e787d474eb78b4797a0909a5e
-0,         18,         18,        1,   115200, 3548a320f6954c40a00ddf2e4ee212bd
-0,         19,         19,        1,   115200, 80af737ca733afa28fdae06421b3cf8d
-0,         20,         20,        1,   115200, f31a2b62cb69bc680b314a033f91881b
-0,         21,         21,        1,   115200, 02e4a780b3a0d83a8897988ef17b548c
-0,         22,         22,        1,   115200, 844929e7492b389fc520c5f75d37aa77
-0,         23,         23,        1,   115200, 558ac4c1c11da425baf832a73e1ac2da
-0,         24,         24,        1,   115200, 41b21109a7aa5f163ac0967ecd11f792
-0,         25,         25,        1,   115200, a2a050c04eaa97db43a5a0a96d20a143
-0,         26,         26,        1,   115200, 18d1881d44ab9dc959c34d92c0cabd36
-0,         27,         27,        1,   115200, 53618af318cd187b4fcd5a3c22d3ab79
-0,         28,         28,        1,   115200, 8028e6a6a6dadc8331e39cff1ba2b899
-0,         29,         29,        1,   115200, 2c32a58d68595ff4100cec4fc1637c55
-0,         30,         30,        1,   115200, 8ecc02d32f36edd167cabe2a7bc66683
-0,         31,         31,        1,   115200, 7caa9ce69ac9f71170a69fbcef4c4b34
-0,         32,         32,        1,   115200, df06a6a8a81979c39f2c3546eb03a3c2
-0,         33,         33,        1,   115200, 2bfd578fa08335e975d498e11eadc8bc
-0,         34,         34,        1,   115200, 0d78c5656d56e423ff31cab09855a335
-0,         35,         35,        1,   115200, 7152d9e35748a7ec2e8da37f0b943325
-0,         36,         36,        1,   115200, eb9e0e5cba76f0819da6256136ffd4e3
-0,         37,         37,        1,   115200, c4e5ef875132c06a80f0afb3ee894684
-0,         38,         38,        1,   115200, d2feb49297dd2f0a532479341d607e64
-0,         39,         39,        1,   115200, d092d165608f405161fbf73a19df26ca
-0,         40,         40,        1,   115200, cb228940384c3021af42b0ab81c65d7a
-0,         41,         41,        1,   115200, 426decfbf29a025a7a5e376951c34b83
-0,         42,         42,        1,   115200, 42c25e24bfd048bde0f9105d934cb81e
-0,         43,         43,        1,   115200, 4bf37f8ccb2c4f42fa64a52a4699883f
-0,         44,         44,        1,   115200, 5a00d85407910d4170d11511f03cc3a7
-0,         45,         45,        1,   115200, 032072b8713a2cd7434b5be706a8667d
-0,         46,         46,        1,   115200, e729c561b318aa14d7dbf96299c4675d
-0,         47,         47,        1,   115200, e7e1d71c1c59bb759c89f15c6e8970f0
-0,         48,         48,        1,   115200, 9c04011f4d92257a6dc112c5acad0f59
-0,         49,         49,        1,   115200, ca7c7cbf52dd7af9a62212f3a9bd1f74
-0,         50,         50,        1,   115200, 3cc9c4d3857d692e0dbfee682d63d32c
-0,         51,         51,        1,   115200, 1188fc9620cf0d23af21d8823c127b80
-0,         52,         52,        1,   115200, c614690b8d4d3bea47f1b236ff32d1d8
-0,         53,         53,        1,   115200, d6ccde3360e6a05b61013e85f96de9e9
-0,         54,         54,        1,   115200, 7f11cacc42d14121aeab487975ec190b
-0,         55,         55,        1,   115200, cdd8b538ff107f88c5f0dc7128bc331e
-0,         56,         56,        1,   115200, f43a387e9bb2f4db387d3f44da16457b
-0,         57,         57,        1,   115200, b7ba01b86fce2252105f99848e2ac95c
-0,         58,         58,        1,   115200, 094200f775b6ced838d0c37e0d0b34e6
-0,         59,         59,        1,   115200, b2d2fa96666b96b7cb624133cf404b09
-0,         60,         60,        1,   115200, d935644161a2b06f0efc75dc6d0fcf46
-0,         61,         61,        1,   115200, 2a3be6460f313d7fdd6f6f9c70092a50
-0,         62,         62,        1,   115200, f8254b6469b807ce0e9a1ea4b98a59db
-0,         63,         63,        1,   115200, 43639a3293ec640b203e0c8a97e6f45e
-0,         64,         64,        1,   115200, 055762cccc279c8dd27450ec1d512d5f
-0,         65,         65,        1,   115200, a90dac910f3cdd216293bebc46b36501
-0,         66,         66,        1,   115200, 3531ef2a4a59271f89ca0972b65d06aa
-0,         67,         67,        1,   115200, 1f87adde14795639105be714247d0bd0
-0,         68,         68,        1,   115200, e991cdd7912266937ca6f0d59199645b
-0,         69,         69,        1,   115200, 5b98019db0fca644da5ee73e0160c7c5
-0,         70,         70,        1,   115200, 6276f3907e4bb87885d21e11150d044d
-0,         71,         71,        1,   115200, 985785d7a788dcc07bd5fb72d3dc758e
-0,         72,         72,        1,   115200, 3379548a573d068d47d5f54aaf79c8a9
-0,         73,         73,        1,   115200, a2b36848e7d19383cfabf8bdcabd241a
-0,         74,         74,        1,   115200, 0aeda76888a5a2426ae3b390e38aba52
-0,         75,         75,        1,   115200, 2c652e7850ccc10cbc7a3266f1fb6c00
-0,         76,         76,        1,   115200, 5dfc9e4dce69f1f644fad5b69c0b4008
-0,         77,         77,        1,   115200, da775fc1469012a0c717ebe5dc940e26
-0,         78,         78,        1,   115200, 6185a863f7d023ddb2b049e265aab1bb
-0,         79,         79,        1,   115200, 7a56397397191ab1b7c93a4bdc9b57c1
-0,         80,         80,        1,   115200, 3e95a3f2c2660dc28ec64efef29615f0
-0,         81,         81,        1,   115200, b9ba03bd7c09224174368a60af389b9c
-0,         82,         82,        1,   115200, bfd23a13e077843506a01e44adb27c04
-0,         83,         83,        1,   115200, 9025dff58a57abcc25da69fd233e312a
-0,         84,         84,        1,   115200, ba4b91b0fe4d36f77b62ec3fe7b10a96
-0,         85,         85,        1,   115200, 7955419ff2bc42b703dfc976576a5bd4
-0,         86,         86,        1,   115200, 36d6a723ebb35c45128bfa8a7bba0d49
-0,         87,         87,        1,   115200, 77503cc79e3cb0fc74745bac967fee1d
-0,         88,         88,        1,   115200, a05af40cb4fc009fe94be6dbf148b453
-0,         89,         89,        1,   115200, 35bc39585679f7c07f1b196879719ce6
-0,         90,         90,        1,   115200, 48831c2e2212134ab192a123e847c157
-0,         91,         91,        1,   115200, c09c37f9fd929185452a8beb3c61b839
-0,         92,         92,        1,   115200, c534a38d586f3cac998240a7013c636c
-0,         93,         93,        1,   115200, b598c6999442cf0c53ed6a19d1215eb8
-0,         94,         94,        1,   115200, c639685c8f4af3d006df1833950943aa
-0,         95,         95,        1,   115200, 351e1c089ba5b9024de6e311c4a4afd3
-0,         96,         96,        1,   115200, 67d8ea902179548d0b01544249b2411f
-0,         97,         97,        1,   115200, 3717ddf0edbb2020a5b974678d358d25
-0,         98,         98,        1,   115200, 85f7c6861241e3f43fc63c397c8c3c37
-0,         99,         99,        1,   115200, c5b23b4d3d141d8cfbc5354ca1cfd34d
-0,        100,        100,        1,   115200, c2e42fa6b11cdc3abcf3ee0c3f75a459
-0,        101,        101,        1,   115200, 34df411aa928d5df3628644d9a38c768
-0,        102,        102,        1,   115200, a768b448b6c894d9b927bc880249079a
-0,        103,        103,        1,   115200, a2e9ad0d0ad733b8ccacf0379b05f6f9
-0,        104,        104,        1,   115200, 4b485e9496ab4d417b8cffaf8754f5cb
-0,        105,        105,        1,   115200, 47007fabfacd9e9c5a3997fb70d45895
-0,        106,        106,        1,   115200, 4962433241c7509801b46bea70f38269
-0,        107,        107,        1,   115200, 7b4593b45606650e78aec67722cfc2bf
-0,        108,        108,        1,   115200, 882bcbf7d2c12e93df2fbebc6ac19dd8
-0,        109,        109,        1,   115200, a2998a9c648817236bfffdae454f9fa1
-0,        110,        110,        1,   115200, 56775760fa99e9a9b7293ddc78a44ece
-0,        111,        111,        1,   115200, bb245d095424c28dd2ace22a5a511d6a
-0,        112,        112,        1,   115200, 598c54d2b207190ed549dec7390a4190
-0,        113,        113,        1,   115200, c73f16b2709527fce3d725ade5aab2fc
-0,        114,        114,        1,   115200, 32dcad6eb17bee583884029fe18c07a7
-0,        115,        115,        1,   115200, a1297c404a0d22e0e8e1e4ef67696606
-0,        116,        116,        1,   115200, 2fef1ac7becf9b8c9f3ac2310f444e3b
-0,        117,        117,        1,   115200, 0f03614ed3daec6c37c5b564ad24f595
-0,        118,        118,        1,   115200, 9b175a6353ec377da408b0cf03388081
-0,        119,        119,        1,   115200, 37b991b4a216a4847d0768a3b878284a
-0,        120,        120,        1,   115200, faafcd544080a6a4f87a0d0a393ba37b
-0,        121,        121,        1,   115200, 43ede087f37c1b0392829bbc668242fc
-0,        122,        122,        1,   115200, b7ed1274016c4d1810d8999d495b7370
-0,        123,        123,        1,   115200, 22af7bfc83c6e1f2eff2ae26e115b446
-0,        124,        124,        1,   115200, 969b22455f3be057036ddd5a329b1de3
-0,        125,        125,        1,   115200, 63c24b8a3d6c3a4c2fd47c48860abff9
-0,        126,        126,        1,   115200, b407ddc89c538d7b6fb70e48493f872c
-0,        127,        127,        1,   115200, 5de69fb9e1cd425cd3931116803f5391
-0,        128,        128,        1,   115200, 07fc7a5cb360edae97db999c2a8d2716
-0,        129,        129,        1,   115200, 602a17c58cac811e6e71e33448931ce5
-0,        130,        130,        1,   115200, 44087725484198c8e846d112583e574b
-0,        131,        131,        1,   115200, 0d81da0d23d196ff972894878bd17b73
-0,        132,        132,        1,   115200, b3cd65f1bd2274895e54da99bb4c4f07
-0,        133,        133,        1,   115200, ae8ca35672d8352af49f37f5174c8fbd
-0,        134,        134,        1,   115200, 9eea1ff900cf680e8208cd5d07a4d284
-0,        135,        135,        1,   115200, 5a47f272dfda3fe61955875f761a71f2
-0,        136,        136,        1,   115200, 544558333008db01451c886ac0b62c47
-0,        137,        137,        1,   115200, 5f8e4f3b11d7f5a28ff5cd9f3a6853bb
-0,        138,        138,        1,   115200, e9bc3da7060457f2d52a5bf6fe3bb515
-0,        139,        139,        1,   115200, 6aea6851a092260ae6594c6d9170ea8e
-0,        140,        140,        1,   115200, 38e7fa5bea809a984a5f810940ca0e49
-0,        141,        141,        1,   115200, 9e8a23ac9067a1acf8472d7aa3b9811e
-0,        142,        142,        1,   115200, 6f25f5873afd5c341ca6b3eb284be809
-0,        143,        143,        1,   115200, 40c3240e6cde94aae793a52cb46487da
-0,        144,        144,        1,   115200, b7f1f13842fbf0c6e085280eb89b956f
-0,        145,        145,        1,   115200, 1f059372d8bf4dadf78d8e215bbf9786
-0,        146,        146,        1,   115200, 50c1d6b76930e765bff5ecbaaae686fe
-0,        147,        147,        1,   115200, 5bd8cb05ebc034192e08ca8ce18a7964
-0,        148,        148,        1,   115200, ffc0c20b07e26857dc4f2c079a2ad675
-0,        149,        149,        1,   115200, 5dafb6ac0953c254182dba124e213c07
-0,        150,        150,        1,   115200, c774ed25712a38603fe2e224802768cb
-0,        151,        151,        1,   115200, de549cc803a6138d483be15b28ef2286
-0,        152,        152,        1,   115200, c963d9bc79c1dd2a47f7f8424c56239e
-0,        153,        153,        1,   115200, 9df993e0bef1bedbce1a6b596f2c64f4
-0,        154,        154,        1,   115200, 875792bde0f45358009b506840be68e1
-0,        155,        155,        1,   115200, 7f8c57083d2df08db6287cb025260788
-0,        156,        156,        1,   115200, 47eb13bc0942b5cafeea324fc5bf5cd5
-0,        157,        157,        1,   115200, d89129c7528ff7372f23d1191c75e336
-0,        158,        158,        1,   115200, bdd14e38b00075d8da485d1517dbbd65
-0,        159,        159,        1,   115200, 0e8e21a50a5dd1ac6fc881ad38ec38bd
-0,        160,        160,        1,   115200, a0fce98c23a053b4073715c554b9dc44
-0,        161,        161,        1,   115200, 18bda80360c72d04c60016682b1f6c8d
-0,        162,        162,        1,   115200, 306d7556c18dcf58c8183959d1c34c2a
-0,        163,        163,        1,   115200, 7ada9d23b96ef41322497d1077b00c4d
-0,        164,        164,        1,   115200, d7df0508be4bd0c3e83f346f0b9a1868
-0,        165,        165,        1,   115200, 749725f425f6fd4a79269bca900d09ae
-0,        166,        166,        1,   115200, ed30973158a576e2919e2fcfd00987fc
-0,        167,        167,        1,   115200, 2486d8b742ccc50cf8683af7f4502aec
-0,        168,        168,        1,   115200, bdfb21e4236c904aeacd7b094fcffe98
-0,        169,        169,        1,   115200, df2ef3e452731053ade82506c013164e
-0,        170,        170,        1,   115200, 4695bfd9aa8e5667572f8f2142c6e538
-0,        171,        171,        1,   115200, 649f5315cff1d28f0183144bf4d4eea4
-0,        172,        172,        1,   115200, 450e987b9d6075d32e21d030bc385833
-0,        173,        173,        1,   115200, 7aec79b25dabfcc2eb2f32e7dbff85f2
-0,        174,        174,        1,   115200, c9c2a96239ad556a2ee496d7c4c965c1
-0,        175,        175,        1,   115200, 3a038e48aa1238b62d431823653bc45a
-0,        176,        176,        1,   115200, 6d5c8de6a281dbce68998b2c38063f33
-0,        177,        177,        1,   115200, 045032f57d6a50ae148f4372f5083a62
-0,        178,        178,        1,   115200, 5f39172951e083e712c3b1c528e61a4f
-0,        179,        179,        1,   115200, 5a49eea76b6a86e305fb207fc1479264
-0,        180,        180,        1,   115200, 33ca5fb5f3e4ff3a24235da71c5730d5
-0,        181,        181,        1,   115200, 81f231d20426c5cbd02a85a425f5d0b8
-0,        182,        182,        1,   115200, 302d94aa9a8d3828cf74c8b2b7e7fdd5
-0,        183,        183,        1,   115200, c56f4f0c32b0f2c409b64ed10216a40a
-0,        184,        184,        1,   115200, 9cf7f51e1527f11c38c395bac94849d9
-0,        185,        185,        1,   115200, 0f17e427d14db658131eb0ccdc2a97ef
-0,        186,        186,        1,   115200, 2624dd6b8e4e95770f132d90aa6f6119
-0,        187,        187,        1,   115200, 9ddabfd5f803014443c2a0686869c546
-0,        188,        188,        1,   115200, 0170cb86a377d791d7cbee2af0836db7
-0,        189,        189,        1,   115200, f43a7c63bcafb51ead65e2831610612c
-0,        190,        190,        1,   115200, e7000913b11bdeb74ba4eca110df8470
-0,        191,        191,        1,   115200, a4208c5fcd101ceb5a976838ae9a811f
-0,        192,        192,        1,   115200, 8ddcb546ac632c967e879fb5101afa24
-0,        193,        193,        1,   115200, 547007771194373dd246586744130f7c
-0,        194,        194,        1,   115200, 3608a46fee2731341ae9f71d3a80918a
-0,        195,        195,        1,   115200, 758692e173552eb3439a572c953dda0f
-0,        196,        196,        1,   115200, 481f456d6c6ac2e0325acba5eeabcd26
-0,        197,        197,        1,   115200, c749a3ef8641d5ec4f25c611ffad1000
-0,        198,        198,        1,   115200, 93f089f7f1e78b1a4185c0b0d99875fb
-0,        199,        199,        1,   115200, 1159712bb4dbaed38d2a7558335f4037
-0,        200,        200,        1,   115200, e8dab85a977f525d4d9b448e4278a34b
-0,        201,        201,        1,   115200, 780055af1414e7693777a18428b20a07
-0,        202,        202,        1,   115200, 59252515451fd96ca3f1194d5aadc3a7
-0,        203,        203,        1,   115200, 0a977d6db761c149316417988657610a
-0,        204,        204,        1,   115200, ed81d3a10369c12543f9bb6822a249b6
-0,        205,        205,        1,   115200, 341e844231f6b55ee3c1eb22ca1bac8e
-0,        206,        206,        1,   115200, d0a180c7d15e30a71e297fda0452c153
-0,        207,        207,        1,   115200, 58d6f2522ecd8e5fea34cc9f10da2a88
-0,        208,        208,        1,   115200, dc8f96811577f4fd3e6624abae42f449
-0,        209,        209,        1,   115200, 3624a2e95f94a0a4413e464f4bf93dcd
-0,        210,        210,        1,   115200, cb0deeb5f2d570ca23e3be3ab9231fe9
-0,        211,        211,        1,   115200, 5080848626a52e30eb0f64f234ca3e57
-0,        212,        212,        1,   115200, a31c9fe4255318d86e7855f01588220f
-0,        213,        213,        1,   115200, 6c25fd8d1f0e898f6078decc4220d47d
-0,        214,        214,        1,   115200, 77e52da08ab57ba5784ce42872cc01cb
-0,        215,        215,        1,   115200, b4a87059745b3b862ef7431a9630f16a
-0,        216,        216,        1,   115200, 1dadc814514ef00f11010df21d8a9494
-0,        217,        217,        1,   115200, 5c816a0bbc8ed8fca166aa454093cb59
-0,        218,        218,        1,   115200, 10320c174423d1712d9ce812701bcaf9
-0,        219,        219,        1,   115200, 279c9398657af129e072165f41e0fb8c
-0,        220,        220,        1,   115200, 49d88374bc4d965d3cee3274c7cd9906
-0,        221,        221,        1,   115200, 48871e22f635f50569dea1bd5ca40d5c
-0,        222,        222,        1,   115200, 3b8396580f8fbd99daca4df13662f1fc
-0,        223,        223,        1,   115200, 569245e1bf3cb42aa95f765a8449980f
-0,        224,        224,        1,   115200, c5cab497d244447df0ab832dcc9c5968
-0,        225,        225,        1,   115200, 0a98ca4f1d771c4bc0286b825d085955
-0,        226,        226,        1,   115200, e4a55f175c3933f02ccf74ccf2961da2
-0,        227,        227,        1,   115200, 462dca7f377d708e753ef0bbde19a090
-0,        228,        228,        1,   115200, 6f1680f498b0ed6f89a834b5700cc48a
-0,        229,        229,        1,   115200, 996414e2e3a4bac5868ceeb25b84e6e4
-0,        230,        230,        1,   115200, 6ecb4d4b857578d32f716c56dc7e6be9
-0,        231,        231,        1,   115200, e05c8e33157e20c8e8f255e937d6b6cb
-0,        232,        232,        1,   115200, 6542744da147d16533e41dad287a54fc
-0,        233,        233,        1,   115200, bb4b6921d2855025fbcaff4c12299d02
-0,        234,        234,        1,   115200, 6bc3e605759725012f7e44f1285b0899
-0,        235,        235,        1,   115200, 0be37ecb7cec0cf8a0f9bbc3c590ba98
-0,        236,        236,        1,   115200, 4f1103e5923ba8dea3e99c8b75eaed3c
-0,        237,        237,        1,   115200, 220a8fb0409112c4f4ee769880717fea
-0,        238,        238,        1,   115200, e4c612263cfbc0f41283fd1e88e2ff52
-0,        239,        239,        1,   115200, ede2bc67ad87cd78191b742dd56419b5
-0,        240,        240,        1,   115200, ded6a1d0690603aea233e4d624aa60a9
-0,        241,        241,        1,   115200, 59c8b53e47ebdab696547a887163b272
-0,        242,        242,        1,   115200, 985f8afbc6df2d64d601d2fdc93571d7
-0,        243,        243,        1,   115200, e595f0aa7b6b62094f0ad84252105f55
-0,        244,        244,        1,   115200, c2fe4382a1740bcfc2f4c3573c6c3176
-0,        245,        245,        1,   115200, 880d8c906a8b39a61b68eb0ada857e5f
-0,        246,        246,        1,   115200, 9a3ca55d2d75e3c41a86aea2ec87ff76
-0,        247,        247,        1,   115200, f800751663dbefa61c33c3ebbd5430b4
-0,        248,        248,        1,   115200, d904333c0c76235c8ffdfc81dffddb46
-0,        249,        249,        1,   115200, 6a633a9a7686a9a02bd252ec8bcff4fc
-0,        250,        250,        1,   115200, 930d06ecc252a911a60c2d9d4f2618e6
-0,        251,        251,        1,   115200, bb146a4410c34bba74883d8ae478f47b
-0,        252,        252,        1,   115200, be8ab9fc95685ebec64ff1f8129afa35
-0,        253,        253,        1,   115200, d1f871ea3ceb38bf2b6d00ebfc38187a
-0,        254,        254,        1,   115200, ba33366e050a5f5abbf8202e0afbb9e8
-0,        255,        255,        1,   115200, f706356e12cf4082337bb8f7a5a10673
-0,        256,        256,        1,   115200, 6e8200d3c1cccc0f810985ea2a2030f6
-0,        257,        257,        1,   115200, caafdc1810556197df6f42336edcc07b
-0,        258,        258,        1,   115200, 5321ff525f5bb5063443a3dc43fc42af
-0,        259,        259,        1,   115200, c24bdd3b935f7ca6e9e105b1ae8504db
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-016 b/deps/libav/tests/ref/fate/vp8-test-vector-016
deleted file mode 100644
index 291e7fe..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-016
+++ /dev/null
@@ -1,30 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,    38016, 905a823da31f71f9c25ebb8dfc9ddd3c
-0,          1,          1,        1,    38016, 9a1b97859b2f774954dbf96f45a22a0a
-0,          2,          2,        1,    38016, f0f5651b32577549dc2e6e3050125229
-0,          3,          3,        1,    38016, 9edf800d31dc653a23ed71d0f3fc32e4
-0,          4,          4,        1,    38016, 78dd1fa96e63c177f2b90d702c92f48c
-0,          5,          5,        1,    38016, e1cec336383c4ea63ccaff8bfa5c8e24
-0,          6,          6,        1,    38016, e8b5a454e178ab7ba9b83dfc10b4171e
-0,          7,          7,        1,    38016, 572dbaaf319f1681749135c49940c64e
-0,          8,          8,        1,    38016, b0e8313de033cc75a78532789bb6a3cb
-0,          9,          9,        1,    38016, ffc5581d83ff67b549d63c7de1a1e8cb
-0,         10,         10,        1,    38016, 8ae3fcd3d74947d434b7c5f9ee08bbbf
-0,         11,         11,        1,    38016, 3adff74d92ae0a463dddc6f89965f706
-0,         12,         12,        1,    38016, f08355430fdf5bb16a91eef05f03186b
-0,         13,         13,        1,    38016, d477eb8150a1a94dd6af7f067e8c0429
-0,         14,         14,        1,    38016, f860f225e27871a17060373b79007ec6
-0,         15,         15,        1,    38016, 22a25c07ac5e7c67df793e0d3169386c
-0,         16,         16,        1,    38016, a96f9cef4efe74db0cce039c85c03c4d
-0,         17,         17,        1,    38016, ff9c93cbc364976044144ee631f89bd2
-0,         18,         18,        1,    38016, 3a6b43090adb6c8b5188d544a08295a8
-0,         19,         19,        1,    38016, 7f41a10ada80865d24585860065aa5e4
-0,         20,         20,        1,    38016, 099847f606672fd065e6841000cafcb3
-0,         21,         21,        1,    38016, fbf543c12ce48633e6d10717862c35a7
-0,         22,         22,        1,    38016, 1b9956d8a6c45e39d219da33ff7c334a
-0,         23,         23,        1,    38016, 911eb8f478485c0f4eef1d03f53aa80b
-0,         24,         24,        1,    38016, b801570a437439ce12c5037df0235742
-0,         25,         25,        1,    38016, 8d231805d741abe79670a0e9f13712ea
-0,         26,         26,        1,    38016, 87bfcc2c88c4471067c07fbcf635870d
-0,         27,         27,        1,    38016, d51b6999afde880bc77597063b58d28f
-0,         28,         28,        1,    38016, c69c07a34bfad3b5a95b19a84e991c13
diff --git a/deps/libav/tests/ref/fate/vp8-test-vector-017 b/deps/libav/tests/ref/fate/vp8-test-vector-017
deleted file mode 100644
index a8ccda8..0000000
--- a/deps/libav/tests/ref/fate/vp8-test-vector-017
+++ /dev/null
@@ -1,30 +0,0 @@
-#tb 0: 1/30
-0,          0,          0,        1,    38016, 905a823da31f71f9c25ebb8dfc9ddd3c
-0,          1,          1,        1,    38016, f0f411dd067bff05d5d9c64e3f52a4b1
-0,          2,          2,        1,    38016, c8696f8fa56b4adf18f3db0c384d968f
-0,          3,          3,        1,    38016, 5772aa26a95092b4a8a117e97d6dde49
-0,          4,          4,        1,    38016, fc52254ea1cbcc2e7a5b126d8c44a023
-0,          5,          5,        1,    38016, bf6208554657f568ad69d5c60f692fdb
-0,          6,          6,        1,    38016, 3a68eef642b250177592455f4aa925d9
-0,          7,          7,        1,    38016, 98102b7bd56cbe456d86c93e8cdd48eb
-0,          8,          8,        1,    38016, 59d54b7d97600b2890c8abab2af9a7dc
-0,          9,          9,        1,    38016, ba4b4bb534ee2a00f418828b9723d996
-0,         10,         10,        1,    38016, feb1115136fa96d5e9425ac18261de7c
-0,         11,         11,        1,    38016, ef7eb6dc656c2bd7447c7d8f650108c1
-0,         12,         12,        1,    38016, 89ec385a0d34c8fd5b1334d8756c96b9
-0,         13,         13,        1,    38016, 27bc439dd8e6d50c3c7a6e0b390e7418
-0,         14,         14,        1,    38016, ec36c065d8b668fabb6b16ecc01eea0a
-0,         15,         15,        1,    38016, 5c94f9b441fc70f62856c835f9e9ad50
-0,         16,         16,        1,    38016, 4b6c1bd876b00052b39e6ca91cad9c05
-0,         17,         17,        1,    38016, 1099121afd681cf3218dffb9714a0fd7
-0,         18,         18,        1,    38016, d0c1de888fab35f33c1148dc80494d20
-0,         19,         19,        1,    38016, 745941ea768d06ea27c3fbca782e3591
-0,         20,         20,        1,    38016, 09f85054f188da6f7260debf6b71bbb1
-0,         21,         21,        1,    38016, 2bdd642a7551681f1ca9680a0d9183a8
-0,         22,         22,        1,    38016, 054aba9db9790a0f1c79db491a6cac6d
-0,         23,         23,        1,    38016, fa4b52162f6da0c15100f4382d92d7e4
-0,         24,         24,        1,    38016, 88c589535811dd394bd1723172329629
-0,         25,         25,        1,    38016, c11cc1a30199d46db048120969dc4118
-0,         26,         26,        1,    38016, c61207280f40620f8cd5e962f3aa160f
-0,         27,         27,        1,    38016, 8a721ecbad0b2f17aabb2d06e27c00aa
-0,         28,         28,        1,    38016, da32f1d272e065cd31415b23f86837cc
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-00 b/deps/libav/tests/ref/fate/vp9-00-quantizer-00
deleted file mode 100644
index a6e701e..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-00
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, c3fbb7abbdb5bd4ed4a7e34768c17df1
-0,         33,         33,        0,   152064, 08203c2595bdb2d58ead6f921345d699
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-01 b/deps/libav/tests/ref/fate/vp9-00-quantizer-01
deleted file mode 100644
index 0d22d2b..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-01
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, f041b870cf9236d5f22e2b08a77d5958
-0,         33,         33,        0,   152064, cbdb7526986ae15592891488c9afc84c
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-02 b/deps/libav/tests/ref/fate/vp9-00-quantizer-02
deleted file mode 100644
index 023caf8..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-02
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 98048cfdb4af5059f4085c5acc94ef8f
-0,         33,         33,        0,   152064, 8160183e1eed1d0af4427be216b8b9f7
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-03 b/deps/libav/tests/ref/fate/vp9-00-quantizer-03
deleted file mode 100644
index 5abb9ee..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-03
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 15c548208f5eda243a151a42f4d64855
-0,         33,         33,        0,   152064, e96d463dc8e9b27b1c2ec40f77eee6ef
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-04 b/deps/libav/tests/ref/fate/vp9-00-quantizer-04
deleted file mode 100644
index 1be91be..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-04
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 928c64a0747ac57ab50c1520d694fea7
-0,         33,         33,        0,   152064, a6f6daa293231e95ef30ed168f582c84
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-05 b/deps/libav/tests/ref/fate/vp9-00-quantizer-05
deleted file mode 100644
index 9e359b3..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-05
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 082460718b7d7046c8fb23184b7f71ca
-0,         33,         33,        0,   152064, 4a41aad51c40a92df72333e13f47d3fe
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-06 b/deps/libav/tests/ref/fate/vp9-00-quantizer-06
deleted file mode 100644
index e984311..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-06
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, cfca1bed96ff62a69b2d841fda01c6b9
-0,         33,         33,        0,   152064, 9b4d61f1b998745c108f8eb67925e03d
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-07 b/deps/libav/tests/ref/fate/vp9-00-quantizer-07
deleted file mode 100644
index b1e6b54..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-07
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 6f5122064bead9d9882bec2698a6ed9c
-0,         33,         33,        0,   152064, 50dae67d2f57a76eece210dee8b6df9e
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-08 b/deps/libav/tests/ref/fate/vp9-00-quantizer-08
deleted file mode 100644
index 6bb9687..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-08
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, eb3d6985fcda5d93dd62d53354e8a093
-0,         33,         33,        0,   152064, 5b1f5b7780b4cafe1f75e56a0b526643
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-09 b/deps/libav/tests/ref/fate/vp9-00-quantizer-09
deleted file mode 100644
index 32055ca..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-09
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, d7ccaf28c59875fe91983def5490d2b1
-0,         33,         33,        0,   152064, bd98fe9492054826748de840b4495309
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-10 b/deps/libav/tests/ref/fate/vp9-00-quantizer-10
deleted file mode 100644
index 9f738a3..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-10
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 20dda6231f9801c9c237c6d09d9939b6
-0,         33,         33,        0,   152064, 23c91e93807fb9a4ed5bd5bdd449d99f
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-11 b/deps/libav/tests/ref/fate/vp9-00-quantizer-11
deleted file mode 100644
index 3449ea9..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-11
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 960833315ebcdee97f46c4d98d0f3fef
-0,         33,         33,        0,   152064, eec40507d17b64b7895a61cb87b2096a
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-12 b/deps/libav/tests/ref/fate/vp9-00-quantizer-12
deleted file mode 100644
index 1494fd9..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-12
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 6533224d3b6ba1ec0dd973bbe56c6349
-0,         33,         33,        0,   152064, 12ceadc6d28327a24a75f8c40b6084d1
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-13 b/deps/libav/tests/ref/fate/vp9-00-quantizer-13
deleted file mode 100644
index 1a75e63..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-13
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 7268de6756014f79a56dcf010c52a97f
-0,         33,         33,        0,   152064, 9e39e9b0e2295b8460dfa05f44762771
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-14 b/deps/libav/tests/ref/fate/vp9-00-quantizer-14
deleted file mode 100644
index b614bd7..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-14
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 57e9e333c641fa952f7485b788df225a
-0,         33,         33,        0,   152064, 551f0cea83dcdf4540c3983736757874
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-15 b/deps/libav/tests/ref/fate/vp9-00-quantizer-15
deleted file mode 100644
index e092a9a..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-15
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 17a0a2842856b9e89aede237648d5dda
-0,         33,         33,        0,   152064, c9fcade888a38621bebe3d4b41664245
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-16 b/deps/libav/tests/ref/fate/vp9-00-quantizer-16
deleted file mode 100644
index 159debc..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-16
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 6cc2089e9a3d352fe10b59ccd935c677
-0,         33,         33,        0,   152064, d165bf7b9cb901e121a65038758d8613
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-17 b/deps/libav/tests/ref/fate/vp9-00-quantizer-17
deleted file mode 100644
index bc89173..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-17
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, bc80511c83162c09661f155cd29f6dd8
-0,         33,         33,        0,   152064, a62f1cbdb3f86d2fb4c880cfd917def5
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-18 b/deps/libav/tests/ref/fate/vp9-00-quantizer-18
deleted file mode 100644
index a05d563..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-18
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, b2d350f6faa41cb50c2e8a9907d0f4a5
-0,         33,         33,        0,   152064, 39b4380d16bc8e093dd4dba475175fb3
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-19 b/deps/libav/tests/ref/fate/vp9-00-quantizer-19
deleted file mode 100644
index 43c1c55..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-19
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 441e09be3c15fcb240afd74bb7a10a72
-0,         33,         33,        0,   152064, 32ae5dac876ca5d5ae6ab7c74f4dc25d
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-20 b/deps/libav/tests/ref/fate/vp9-00-quantizer-20
deleted file mode 100644
index 95e5216..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-20
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 7786eb9944dba0553e129133523a98c1
-0,         33,         33,        0,   152064, 206d888f8453427f10a40aa8bf5f6df0
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-21 b/deps/libav/tests/ref/fate/vp9-00-quantizer-21
deleted file mode 100644
index 4ddd9fb..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-21
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, aab95e195be71feca050a839d7b3154d
-0,         33,         33,        0,   152064, 02a05d699bbbdc477e34bb0dad9f0391
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-22 b/deps/libav/tests/ref/fate/vp9-00-quantizer-22
deleted file mode 100644
index bb9d945..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-22
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 41f853c3ee2d4611b645cc643d82e287
-0,         33,         33,        0,   152064, 1c240c653110ff8609ca0f0287a6496d
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-23 b/deps/libav/tests/ref/fate/vp9-00-quantizer-23
deleted file mode 100644
index 968dfc1..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-23
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, bc5b07369df50c8f97ce1a377fe513cf
-0,         33,         33,        0,   152064, ce62ddb4f3e305d0f8587ae8bb44cc79
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-24 b/deps/libav/tests/ref/fate/vp9-00-quantizer-24
deleted file mode 100644
index 8f087c5..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-24
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 982d54041221c977b6f0e37a9236cc76
-0,         33,         33,        0,   152064, 57631e7f13f645c834e2944ebfd6d40e
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-25 b/deps/libav/tests/ref/fate/vp9-00-quantizer-25
deleted file mode 100644
index a14840b..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-25
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, b0fb55f3f2f56b3d27038e83c10123ce
-0,         33,         33,        0,   152064, 9fcac3becdcc2d30d778a55eca4c2018
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-26 b/deps/libav/tests/ref/fate/vp9-00-quantizer-26
deleted file mode 100644
index 0ccb749..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-26
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 4f645e0f354da77b9e2f2a6753c361da
-0,         33,         33,        0,   152064, b7542998ec298273ca662bc9b658d10e
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-27 b/deps/libav/tests/ref/fate/vp9-00-quantizer-27
deleted file mode 100644
index f8c5df7..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-27
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 6edc96a3747cad43828397045764206e
-0,         33,         33,        0,   152064, 5fbc65d20fdca1abd69079851ce676d3
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-28 b/deps/libav/tests/ref/fate/vp9-00-quantizer-28
deleted file mode 100644
index 588ef1c..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-28
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 5db3e910e70da38bb91d01d73acc33dd
-0,         33,         33,        0,   152064, b920ee7f7e61b7fdf9f44b1f738d0292
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-29 b/deps/libav/tests/ref/fate/vp9-00-quantizer-29
deleted file mode 100644
index 583cfa0..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-29
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 3cb3e310be5305077efa6216f6f10654
-0,         33,         33,        0,   152064, 692d3e098af5978fe1a898ebc1a66a7a
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-30 b/deps/libav/tests/ref/fate/vp9-00-quantizer-30
deleted file mode 100644
index 45b2c69..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-30
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, e3b3cea66ea38c5dfba1aa73bb4c611d
-0,         33,         33,        0,   152064, 42bb3e54b19c3f4c4f7ee3a6ba012e19
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-31 b/deps/libav/tests/ref/fate/vp9-00-quantizer-31
deleted file mode 100644
index 22c5749..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-31
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 2523e9ecfd3781eafcd7da192dc105e9
-0,         33,         33,        0,   152064, 6d5feea012b9a1f51fc643633e728764
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-32 b/deps/libav/tests/ref/fate/vp9-00-quantizer-32
deleted file mode 100644
index 8103d96..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-32
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 0a0305eba36500ebf6cc6cc0f01f5a3b
-0,         33,         33,        0,   152064, 2c76bcd6763467f9057a726fbcf50ab1
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-33 b/deps/libav/tests/ref/fate/vp9-00-quantizer-33
deleted file mode 100644
index ab7c061..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-33
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, c68433e0e94047c220be9b629334f744
-0,         33,         33,        0,   152064, fcfa4dff7a39bc9c5e315849ecbb46ea
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-34 b/deps/libav/tests/ref/fate/vp9-00-quantizer-34
deleted file mode 100644
index d5719ec..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-34
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, ad9dc2f912c137b014a33e2792c88a25
-0,         33,         33,        0,   152064, 11221ee4ea5c776f43af68756682cd5a
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-35 b/deps/libav/tests/ref/fate/vp9-00-quantizer-35
deleted file mode 100644
index 623d62c..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-35
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 75031f898cccf303a64ab46b1f815389
-0,         33,         33,        0,   152064, a4fc864e7fbc470dfcab6207e0eea152
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-36 b/deps/libav/tests/ref/fate/vp9-00-quantizer-36
deleted file mode 100644
index e6cde45..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-36
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, c7824af009fde6cafdd8d39fae6bb6cf
-0,         33,         33,        0,   152064, 516a82d5fc4dfa3daf713ed2ec36041b
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-37 b/deps/libav/tests/ref/fate/vp9-00-quantizer-37
deleted file mode 100644
index b4c0134..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-37
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, a2e5c820fd9733e18f9349fb658ca281
-0,         33,         33,        0,   152064, fb23e0bc64728a492a33d985032f21b8
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-38 b/deps/libav/tests/ref/fate/vp9-00-quantizer-38
deleted file mode 100644
index 89e45f9..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-38
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 8347bfb891317e89ef66781d6c28e24f
-0,         33,         33,        0,   152064, a5722f824d32deac042513a1a7dcdcd0
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-39 b/deps/libav/tests/ref/fate/vp9-00-quantizer-39
deleted file mode 100644
index ed5add1..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-39
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 018968f97fac3bdff146cf22c1da5ef0
-0,         33,         33,        0,   152064, ca8b09b01e5132183395e238f1c7901e
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-40 b/deps/libav/tests/ref/fate/vp9-00-quantizer-40
deleted file mode 100644
index 8ac2b91..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-40
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 792660f6589ad5340be4bd0554435866
-0,         33,         33,        0,   152064, 68c84c8a15d679e0a73678b93215c62c
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-41 b/deps/libav/tests/ref/fate/vp9-00-quantizer-41
deleted file mode 100644
index ccd735d..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-41
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, a456bdfc6c1c07b4cb3a3848843743b9
-0,         33,         33,        0,   152064, fe41a12b8cb6bc5667ba2179e076f3b0
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-42 b/deps/libav/tests/ref/fate/vp9-00-quantizer-42
deleted file mode 100644
index 3955ebf..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-42
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, f016dd8431694d989700fb1ba71a5b2d
-0,         33,         33,        0,   152064, e89c3c5b935157b40f2fb0ab92415828
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-43 b/deps/libav/tests/ref/fate/vp9-00-quantizer-43
deleted file mode 100644
index e458266..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-43
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 7b8ab82625f3006bac89d4fb5197e71c
-0,         33,         33,        0,   152064, 18bd3716045563dfba2c72b640b3274b
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-44 b/deps/libav/tests/ref/fate/vp9-00-quantizer-44
deleted file mode 100644
index 178c224..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-44
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 66fde04d8320c750e56406feefd29979
-0,         33,         33,        0,   152064, f9d01d8fc1722ec345e624e14b404215
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-45 b/deps/libav/tests/ref/fate/vp9-00-quantizer-45
deleted file mode 100644
index 4ab45e2..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-45
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, cc97597b015896d73f3e60e7ae44c4da
-0,         33,         33,        0,   152064, fea98bc508f92135641ab99762444b14
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-46 b/deps/libav/tests/ref/fate/vp9-00-quantizer-46
deleted file mode 100644
index df6c212..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-46
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 79ed95c741178bb3c0954f1f6f8e21a3
-0,         33,         33,        0,   152064, f02a06a5e2b5b7619c9a52c5bea0564d
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-47 b/deps/libav/tests/ref/fate/vp9-00-quantizer-47
deleted file mode 100644
index 7e6476e..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-47
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 9b98e948b8c2a822f21bd8419e6f4410
-0,         33,         33,        0,   152064, 491382d68c16c2a3c6f1746598bc4a97
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-48 b/deps/libav/tests/ref/fate/vp9-00-quantizer-48
deleted file mode 100644
index 22a3ce2..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-48
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, f0f095b0edae7262f44d7ed7ef84ded4
-0,         33,         33,        0,   152064, 0e833889ccac81d60251007d1baf6500
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-49 b/deps/libav/tests/ref/fate/vp9-00-quantizer-49
deleted file mode 100644
index 34f74a6..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-49
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 6c1b7b7827617fb9b8417aca2cfdbcaa
-0,         33,         33,        0,   152064, 4c1fc8a89297fdcf79f0faabd42b8684
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-50 b/deps/libav/tests/ref/fate/vp9-00-quantizer-50
deleted file mode 100644
index e9d40af..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-50
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, ca6142db68463487bc28c888ab38476c
-0,         33,         33,        0,   152064, 02a71153ec70f569524c3d814cb62f86
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-51 b/deps/libav/tests/ref/fate/vp9-00-quantizer-51
deleted file mode 100644
index 3a86326..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-51
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, eece2627df1ddf0872256eb92352e179
-0,         33,         33,        0,   152064, 0ee9f221246ad747250e4b5e8ba586e2
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-52 b/deps/libav/tests/ref/fate/vp9-00-quantizer-52
deleted file mode 100644
index 6d976d8..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-52
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 7290039d974c4e50db9d69f9864bcdbe
-0,         33,         33,        0,   152064, 264765de9d02503038a4da54133b9f85
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-53 b/deps/libav/tests/ref/fate/vp9-00-quantizer-53
deleted file mode 100644
index 5f2ab99..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-53
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 917af24da66f143a56a01eb2c2254285
-0,         33,         33,        0,   152064, 45a05d3bc644420519619e4115662a70
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-54 b/deps/libav/tests/ref/fate/vp9-00-quantizer-54
deleted file mode 100644
index 38c2496..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-54
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 6fea2820bb10a9dec9add4d2452b01f5
-0,         33,         33,        0,   152064, 74675169a4bfc2ff5463c4db5d85a79f
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-55 b/deps/libav/tests/ref/fate/vp9-00-quantizer-55
deleted file mode 100644
index c50fdd4..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-55
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 11e5d196f6537fb7d85988d90195e556
-0,         33,         33,        0,   152064, 8536106795f7c93c5a43a11493527469
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-56 b/deps/libav/tests/ref/fate/vp9-00-quantizer-56
deleted file mode 100644
index 80bff69..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-56
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 40839b7a3a40ec10f96b8a75224f646d
-0,         33,         33,        0,   152064, 11408dd73e8c45ddaab99f5c9650102b
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-57 b/deps/libav/tests/ref/fate/vp9-00-quantizer-57
deleted file mode 100644
index 38783aa..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-57
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, d0e9fa03dd48da4592ebaadb4e3794e0
-0,         33,         33,        0,   152064, 5172e29b1e04cd543833d6a68aab297c
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-58 b/deps/libav/tests/ref/fate/vp9-00-quantizer-58
deleted file mode 100644
index 80ead0f..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-58
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, bef4a27d460e7697e038fe6f1c8bd597
-0,         33,         33,        0,   152064, 124674686cafc5f2ff5bc7ea412b8f3b
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-59 b/deps/libav/tests/ref/fate/vp9-00-quantizer-59
deleted file mode 100644
index dbc6a5d..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-59
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, ae9d99e9d16ef20073300559566844ae
-0,         33,         33,        0,   152064, da9405e5a6bfe4ed18d927ba2004008e
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-60 b/deps/libav/tests/ref/fate/vp9-00-quantizer-60
deleted file mode 100644
index c71532e..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-60
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 9e66bb8e1b5e206ea4afe4bf2d335ac5
-0,         33,         33,        0,   152064, 092b74c905c12c1e87e90f5a79857736
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-61 b/deps/libav/tests/ref/fate/vp9-00-quantizer-61
deleted file mode 100644
index b453341..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-61
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, d062dc6be246c8042744018765ef50a8
-0,         33,         33,        0,   152064, 45fd9cbacb6a91060a7e49a58a85869d
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-62 b/deps/libav/tests/ref/fate/vp9-00-quantizer-62
deleted file mode 100644
index 1efa26f..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-62
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 62f7e42fe653e81c5a65a25389e045b5
-0,         33,         33,        0,   152064, cb0cdd0b25689e0a43328550011d960d
diff --git a/deps/libav/tests/ref/fate/vp9-00-quantizer-63 b/deps/libav/tests/ref/fate/vp9-00-quantizer-63
deleted file mode 100644
index f473884..0000000
--- a/deps/libav/tests/ref/fate/vp9-00-quantizer-63
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 8467643dceff827e04acd82eeff1d1b0
-0,         33,         33,        0,   152064, c786f49d66f4dfd685dea9605821a19f
diff --git a/deps/libav/tests/ref/fate/vp9-01-sharpness-1 b/deps/libav/tests/ref/fate/vp9-01-sharpness-1
deleted file mode 100644
index 406bd61..0000000
--- a/deps/libav/tests/ref/fate/vp9-01-sharpness-1
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, a2e5c820fd9733e18f9349fb658ca281
-0,         33,         33,        0,   152064, aa20a75be3a316193496706c9f760d08
-0,         66,         66,        0,   152064, 95567be97a64d3c9efe45f2524116a2e
-0,        100,        100,        0,   152064, 219e86cd6b3cca312856eead21776b1c
-0,        133,        133,        0,   152064, 4a67fd359ca362398e97c15eb018a2bb
-0,        166,        166,        0,   152064, 9916d4e359274d690827f0eb22547423
-0,        200,        200,        0,   152064, a07785b52561150c48f1a8eff89d5d75
-0,        233,        233,        0,   152064, a3382a92982953dfa20018e5ac975b51
-0,        266,        266,        0,   152064, 911836989ca7b148438aa3ec7fc7e303
-0,        300,        300,        0,   152064, 5627b981e3fc9e4401d35d3a5ab25917
diff --git a/deps/libav/tests/ref/fate/vp9-01-sharpness-2 b/deps/libav/tests/ref/fate/vp9-01-sharpness-2
deleted file mode 100644
index 78d7e91..0000000
--- a/deps/libav/tests/ref/fate/vp9-01-sharpness-2
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, a2e5c820fd9733e18f9349fb658ca281
-0,         33,         33,        0,   152064, cd94572239817ae7c9b07de739c3272b
-0,         66,         66,        0,   152064, 383cf752d457e122b5ff49d08960208e
-0,        100,        100,        0,   152064, 1c0a6ec9cd3ce29b8b004e7526f1b07e
-0,        133,        133,        0,   152064, 91c42a8a108d67947cabfc2a5a80df66
-0,        166,        166,        0,   152064, 08c57fc1f3fec0305883315a66c714d1
-0,        200,        200,        0,   152064, 70cb8d8dc83eac82f2d3c4b0376bb1aa
-0,        233,        233,        0,   152064, ffd62a9ef829ec81f0f74f740488a41f
-0,        266,        266,        0,   152064, bab0aa23b5854e2a70926046e4618710
-0,        300,        300,        0,   152064, fec456f38f2a43661e786a8d5f67ed15
diff --git a/deps/libav/tests/ref/fate/vp9-01-sharpness-3 b/deps/libav/tests/ref/fate/vp9-01-sharpness-3
deleted file mode 100644
index 541c7e9..0000000
--- a/deps/libav/tests/ref/fate/vp9-01-sharpness-3
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, a2e5c820fd9733e18f9349fb658ca281
-0,         33,         33,        0,   152064, 0d487a146393a0b8b84b4be1b371b507
-0,         66,         66,        0,   152064, 68372e191eba620a431cfff226026ac3
-0,        100,        100,        0,   152064, de7fd274460e36b983fe93acc208d72f
-0,        133,        133,        0,   152064, afbd36c61bab65b98ff9acf08e215721
-0,        166,        166,        0,   152064, e1e9fc2ab4e7a187a8d8d84aae48d6b9
-0,        200,        200,        0,   152064, 11d95de6a9cc5e00511e99534779faac
-0,        233,        233,        0,   152064, cd2f5539fdfc2d8eefe6b6da28c13398
-0,        266,        266,        0,   152064, a8b3aeed41da7aeb8d5b962ee4a4af93
-0,        300,        300,        0,   152064, 4283670bd1c1c506ef18d3dafca22035
diff --git a/deps/libav/tests/ref/fate/vp9-01-sharpness-4 b/deps/libav/tests/ref/fate/vp9-01-sharpness-4
deleted file mode 100644
index df41b70..0000000
--- a/deps/libav/tests/ref/fate/vp9-01-sharpness-4
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, a2e5c820fd9733e18f9349fb658ca281
-0,         33,         33,        0,   152064, 8bad76c55b5149169d64ce6512521de6
-0,         66,         66,        0,   152064, c1d986e1f9bf46382e598ba289b9bd7c
-0,        100,        100,        0,   152064, 86c097ac6069c786023d3561dae68bac
-0,        133,        133,        0,   152064, 8c238a2831b8c7c49736b6de6ff76ed8
-0,        166,        166,        0,   152064, cb5a038ed0a74a317ee72dae93a7ee3e
-0,        200,        200,        0,   152064, f8fe330a257e3e4e4c39c1c12820a654
-0,        233,        233,        0,   152064, a73e2fcdcbb9334c0c123f8276a2c881
-0,        266,        266,        0,   152064, 24fccece8ee639e4d0e00e4060e1db0c
-0,        300,        300,        0,   152064, 46d6e9aad69a39c718c5fd1e41e86e6e
diff --git a/deps/libav/tests/ref/fate/vp9-01-sharpness-5 b/deps/libav/tests/ref/fate/vp9-01-sharpness-5
deleted file mode 100644
index b183d6b..0000000
--- a/deps/libav/tests/ref/fate/vp9-01-sharpness-5
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, a2e5c820fd9733e18f9349fb658ca281
-0,         33,         33,        0,   152064, f1ce0a5d57a46c9ff1331804b7b03fdb
-0,         66,         66,        0,   152064, 0364a085b06bee6b980189cf5378eda9
-0,        100,        100,        0,   152064, 4b5358698d734b0ae210909a913d4c1e
-0,        133,        133,        0,   152064, dc22565aaceee77b15fd8ab3c84bd5e0
-0,        166,        166,        0,   152064, 5f6340b656536292b46ba9a647aeb6e4
-0,        200,        200,        0,   152064, b7d4bce9a04b2a6caa45801be15e331e
-0,        233,        233,        0,   152064, 534c851cfe59ffc047815ece98d8cede
-0,        266,        266,        0,   152064, 786b0e1564d5c71aabfc2dd528cff4e7
-0,        300,        300,        0,   152064, cac0366209cf471bb7cc3e64966cbbd4
diff --git a/deps/libav/tests/ref/fate/vp9-01-sharpness-6 b/deps/libav/tests/ref/fate/vp9-01-sharpness-6
deleted file mode 100644
index e0189a2..0000000
--- a/deps/libav/tests/ref/fate/vp9-01-sharpness-6
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, a2e5c820fd9733e18f9349fb658ca281
-0,         33,         33,        0,   152064, 45d9ca07ed04210b1ebc743169bc8ec4
-0,         66,         66,        0,   152064, 5b646cc309a711f1d8814f925002d8c4
-0,        100,        100,        0,   152064, 34db8db727fa1ded0a55cc7cf85be249
-0,        133,        133,        0,   152064, 54173d08afe6369b16a9c0c9cc6ce04d
-0,        166,        166,        0,   152064, 76275b0a478cdb3c1fb527ebbce023c3
-0,        200,        200,        0,   152064, e7643cdf0c42f2af700d8730bfc1a453
-0,        233,        233,        0,   152064, 6e53097e56f680cb658d63100e7736f7
-0,        266,        266,        0,   152064, 1a407c3c8ea1d5245ae68c5ce7de70e1
-0,        300,        300,        0,   152064, 6cbca24912cadf09b20be74f14e359c9
diff --git a/deps/libav/tests/ref/fate/vp9-01-sharpness-7 b/deps/libav/tests/ref/fate/vp9-01-sharpness-7
deleted file mode 100644
index 3fad7dc..0000000
--- a/deps/libav/tests/ref/fate/vp9-01-sharpness-7
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, a2e5c820fd9733e18f9349fb658ca281
-0,         33,         33,        0,   152064, f719d0be18d16a448b4e7da3e2d9bf28
-0,         66,         66,        0,   152064, 83ee8ebc0ca796782a2376a76f2ffc26
-0,        100,        100,        0,   152064, 7cf5afdbc229e1af50a5377cfc23d831
-0,        133,        133,        0,   152064, 44244e896e0362f6376ba5afa563ba8b
-0,        166,        166,        0,   152064, df5f518d44eb6cb91b2df5a30d27ef82
-0,        200,        200,        0,   152064, 43cc3f151b8337aca7ee659c8abeb783
-0,        233,        233,        0,   152064, 4e89573470d9b97464e10806fc81aa8b
-0,        266,        266,        0,   152064, 62e0ba70f07ece8d85372f0a42e83a9a
-0,        300,        300,        0,   152064, 45ac2928acb11326f6c4a21401f3609c
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-08x08 b/deps/libav/tests/ref/fate/vp9-02-size-08x08
deleted file mode 100644
index 51a27b3..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-08x08
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,       96, 52def242c36123e5a8f5f53d6a971399
-0,         33,         33,        0,       96, 79c93360fbd47179400414bbfee0901c
-0,         66,         66,        0,       96, c3b1947c79537baa7838905276276a91
-0,        100,        100,        0,       96, 20f35e501bdee0bc63e87b9240265c25
-0,        133,        133,        0,       96, 5e8f1c464bafd54833c51860906b5368
-0,        166,        166,        0,       96, f57b592600dfc99e634a083278af769a
-0,        200,        200,        0,       96, 7b02191f85590cbad3f148c7b92d6436
-0,        233,        233,        0,       96, b0a1c9870447a1744f64cd4087ef55ee
-0,        266,        266,        0,       96, c82712b1ba7a95efb67cbdde0ad708b6
-0,        300,        300,        0,       96, 89f4539f8d7a7b45a91fd2f46335988e
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-08x10 b/deps/libav/tests/ref/fate/vp9-02-size-08x10
deleted file mode 100644
index 3829cfb..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-08x10
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      120, ea3e0f807304b0eb2d3e329b0124f75c
-0,         33,         33,        0,      120, 8d13cf682d63e7eb13094f55d67fc458
-0,         66,         66,        0,      120, e729cc6c3684c94a8f6118c618efc3ea
-0,        100,        100,        0,      120, ac43a0ace8e4112e877c2491ecc14fb5
-0,        133,        133,        0,      120, 53695f90b88d8e8cb838f0faec3238d3
-0,        166,        166,        0,      120, 40afd1c4dfd4a2e3b31631c46d252bcc
-0,        200,        200,        0,      120, 2b656f76f2e84d2f82d9bda2b5be94d3
-0,        233,        233,        0,      120, b22f004d678d047bc401be5e040cf883
-0,        266,        266,        0,      120, 57c840319abfb9c31013fbde54de3fb0
-0,        300,        300,        0,      120, 0f3dfc156216d7cfb6fd1d8c77dadab9
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-08x16 b/deps/libav/tests/ref/fate/vp9-02-size-08x16
deleted file mode 100644
index c2e0a68..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-08x16
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      192, 0553e56a9d89aea496421885aab491f5
-0,         33,         33,        0,      192, b2a14cf676f7ebf3c50450050f76ad16
-0,         66,         66,        0,      192, a308d981e09b50571fb0c8ebdcefe505
-0,        100,        100,        0,      192, d592ec625a0ac0373e82610c3eed9864
-0,        133,        133,        0,      192, acd19642455e643023b4fb882c3891ba
-0,        166,        166,        0,      192, 5af5390fd8c29b795e0ddf83f3f34284
-0,        200,        200,        0,      192, 473505aa2a76231725cf2107d6c9dbef
-0,        233,        233,        0,      192, 84860db6887e320f2d64f80cf0032e57
-0,        266,        266,        0,      192, 408e9cf60e99ae99d204ff08f3196d1a
-0,        300,        300,        0,      192, d8af96b79258f9382e911ed38340bdf5
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-08x18 b/deps/libav/tests/ref/fate/vp9-02-size-08x18
deleted file mode 100644
index 8b7470d..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-08x18
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      216, 4c41f93b1b280b37bc77d7047435eaa4
-0,         33,         33,        0,      216, c9c80fdba2ebc2b8c3490ae35e34f84f
-0,         66,         66,        0,      216, 089d86acb3263fa5ef4f591a7f44556d
-0,        100,        100,        0,      216, 938fca6d93b83484144f5054e4838a41
-0,        133,        133,        0,      216, e0592e2ac9f5e09525ce0d3904cadf47
-0,        166,        166,        0,      216, ea43ff5d1330986e60c08567262ea764
-0,        200,        200,        0,      216, 08b40fe109ee90188f1cba9bbb1b376e
-0,        233,        233,        0,      216, b067068a2a7e36d5c5b5b405a1e73a18
-0,        266,        266,        0,      216, 9cf2d350296288803434b7451bd2be85
-0,        300,        300,        0,      216, 3c785e21dc228d6396738fbfcb470289
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-08x32 b/deps/libav/tests/ref/fate/vp9-02-size-08x32
deleted file mode 100644
index 7d3841f..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-08x32
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      384, f92a7777fd69aa2f2914d9a41c4828ba
-0,         33,         33,        0,      384, 62e1cc73487d2249a88a60e35a22d9c7
-0,         66,         66,        0,      384, aa2619b605cb65eda15fdd99d5775550
-0,        100,        100,        0,      384, e6f0a491c543b835d0cefe5ca62c3dbe
-0,        133,        133,        0,      384, 361be1a06913c398f09494ca1b2d288f
-0,        166,        166,        0,      384, 0497bf849a973357c0ccb8d43f5bd8b4
-0,        200,        200,        0,      384, 5ac6ac523147c409dd00820622161dd7
-0,        233,        233,        0,      384, 7d07245574a46c524360f09be29a5f19
-0,        266,        266,        0,      384, fcfa7fbcaf42f81e4e34a4ee5a029ca1
-0,        300,        300,        0,      384, 336e3fe4f15d3d6c82d82b1855dcfeb4
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-08x34 b/deps/libav/tests/ref/fate/vp9-02-size-08x34
deleted file mode 100644
index affba37..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-08x34
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      408, f3f2cd8f157466ff23dace85d77367ce
-0,         33,         33,        0,      408, 639d9b70a14062e95559c12d2b597f91
-0,         66,         66,        0,      408, b2ee07a6656af583f19593229fa11848
-0,        100,        100,        0,      408, 74e3b5ab4c798a0afe745694e871bbd5
-0,        133,        133,        0,      408, 35f1c30d0f8678f319a392a6c53b5989
-0,        166,        166,        0,      408, 07e2b4c0b92a394bfb11124fe80476f0
-0,        200,        200,        0,      408, 7864bd20dfc5280e5f027d67ea22bf30
-0,        233,        233,        0,      408, 10a2925a7b91dfa9b82de76069388fd4
-0,        266,        266,        0,      408, 79cc7f7a149e8d6e04e065f75e63733c
-0,        300,        300,        0,      408, 6453d10d97532d9bb03f7c06cba9fca0
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-08x64 b/deps/libav/tests/ref/fate/vp9-02-size-08x64
deleted file mode 100644
index 506f39f..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-08x64
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      768, 764bd02b781a38c621a109c12f3d9393
-0,         33,         33,        0,      768, 79496bd2b9212026af816b3b7a0587d5
-0,         66,         66,        0,      768, 2a3afd47ba3d075033fd94d5c3746c45
-0,        100,        100,        0,      768, fca00cad8d37a6646337baebadd0ca31
-0,        133,        133,        0,      768, aca376fb3f8a5ef670ecc2430037262a
-0,        166,        166,        0,      768, 7e6c8d96d1e24855c3e380f1bf2ce02c
-0,        200,        200,        0,      768, 09e051241972969d439f27f324d78490
-0,        233,        233,        0,      768, 2566b2a425caaba41305bf04ff10ea01
-0,        266,        266,        0,      768, db3995bedee42ada1b4ee63c339daf1b
-0,        300,        300,        0,      768, b00b8f1bf4fd907f0487738f5b5442c6
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-08x66 b/deps/libav/tests/ref/fate/vp9-02-size-08x66
deleted file mode 100644
index 6ef07a0..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-08x66
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      792, df20e8df89449fe50bb610e95a449a95
-0,         33,         33,        0,      792, 18f1a66d463274d1b0489f3a50e86857
-0,         66,         66,        0,      792, b0cc102875a94c9a92e53826617adbe9
-0,        100,        100,        0,      792, dfece7c17b4b149283ef51bdc1bd440e
-0,        133,        133,        0,      792, 6e346884f67be259fcabe493109cb63c
-0,        166,        166,        0,      792, 6d282127311eb2d958377490d7cb77f0
-0,        200,        200,        0,      792, 637ac8b14ca5ddbaf7b8910406c3cd08
-0,        233,        233,        0,      792, e7980f3fcb36969da0d218c4389fa9e8
-0,        266,        266,        0,      792, 730a1c95b9fb165f6e1a2f33a0d25de0
-0,        300,        300,        0,      792, 7bd8424d0783b1c8ad617e17408371bb
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-10x08 b/deps/libav/tests/ref/fate/vp9-02-size-10x08
deleted file mode 100644
index f9ea55b..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-10x08
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      120, e1e66a88615da98523ef887f1463fc42
-0,         33,         33,        0,      120, 549842fa98c8faf572882d38b0aae390
-0,         66,         66,        0,      120, 17ee85785517705fdc78c6122a4b2548
-0,        100,        100,        0,      120, 1143391d419dac30a6c11f366157c974
-0,        133,        133,        0,      120, b62d2a962c4c36809ef75a610106715c
-0,        166,        166,        0,      120, e6f143ca33fbc0e776bb149950cdedff
-0,        200,        200,        0,      120, 01716a1077ec66df00474fd4510d2789
-0,        233,        233,        0,      120, 8cb5b6a865fa2cbb15f0d7736fda88a6
-0,        266,        266,        0,      120, 0fb9fd883e895a540fe1704dddbbab04
-0,        300,        300,        0,      120, 150a3b99aa24ef102c92f87c8adb4386
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-10x10 b/deps/libav/tests/ref/fate/vp9-02-size-10x10
deleted file mode 100644
index cff03c2..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-10x10
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      150, 083d638f2e147295d817bb14fff5e4f4
-0,         33,         33,        0,      150, 6dbdc445b6fd6bb99f2025cc2a40977e
-0,         66,         66,        0,      150, 41714089383b181d64fbfa7de5904608
-0,        100,        100,        0,      150, 11fdb8465e1599f7a9227706646d2cba
-0,        133,        133,        0,      150, 907876b3342a10040db0851a936af4e3
-0,        166,        166,        0,      150, e7b18d47d06b25de205d873d3d941640
-0,        200,        200,        0,      150, 523ce7413c8da7f6a657a9b661f36c44
-0,        233,        233,        0,      150, 23caff863af875c66c903662a3e1e6a1
-0,        266,        266,        0,      150, ed4cc5557203e5b7a119112ee9ceb00b
-0,        300,        300,        0,      150, 4bb78a996be3188888d1c60e11a08e1b
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-10x16 b/deps/libav/tests/ref/fate/vp9-02-size-10x16
deleted file mode 100644
index 9f9f5fe..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-10x16
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      240, fab07d6209d2413e0a434e1aaaa12154
-0,         33,         33,        0,      240, f9ffffdb96f98527ba2e553d1265edbb
-0,         66,         66,        0,      240, 56a992264cf7da2b23dd97435e9d0365
-0,        100,        100,        0,      240, b1db980423d8004bd45a789b02b92a65
-0,        133,        133,        0,      240, b29496aedc7026566367b634f55ebb28
-0,        166,        166,        0,      240, 2bc9def672da4a2fc17cbd669e2b8081
-0,        200,        200,        0,      240, 8c54721514cdf577a52a8668b9135f13
-0,        233,        233,        0,      240, 2efab81d5e039d82b3bc7b0303b022c4
-0,        266,        266,        0,      240, bd0f42b91b5d126fd0baec765b1096ad
-0,        300,        300,        0,      240, c6bfea2735a629167bc6a7a7c76eb7f3
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-10x18 b/deps/libav/tests/ref/fate/vp9-02-size-10x18
deleted file mode 100644
index 3f1e9f1..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-10x18
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      270, 0e9182e214aae732d94d007e5fe44888
-0,         33,         33,        0,      270, 2630e2674b5611d68218fddac08815e2
-0,         66,         66,        0,      270, d5cdd7d6a3de17939f60bb60ef6877da
-0,        100,        100,        0,      270, 29d1961096061029e78963fa82581eca
-0,        133,        133,        0,      270, 5c2629f8aa59757f6b4aafa9f6cbcba1
-0,        166,        166,        0,      270, 1f1a8b61e4fbd6222ddf42e9d0a07032
-0,        200,        200,        0,      270, cfb9771190ac2d0129907102d6abb63f
-0,        233,        233,        0,      270, cd98dd856ba573a26a943cbe53221f26
-0,        266,        266,        0,      270, ca13c161f067c4a4ce22bd58a2aca55b
-0,        300,        300,        0,      270, de4bd1a474a76a35b796a5fc45b4f893
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-10x32 b/deps/libav/tests/ref/fate/vp9-02-size-10x32
deleted file mode 100644
index 5ca7bee..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-10x32
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      480, 622e6407a051ea08706394d03330ffbf
-0,         33,         33,        0,      480, 1841a0daf7c3ef7be94e01fdb1d3968a
-0,         66,         66,        0,      480, 37790e6cb2415f7add0ac5d3ab354755
-0,        100,        100,        0,      480, 91485880e17c292096a7335566d3648f
-0,        133,        133,        0,      480, eb6f74983d5fd13d6bd90afbce8836e1
-0,        166,        166,        0,      480, 0069ab5ff7f0d4d601f7d0f9b7a08338
-0,        200,        200,        0,      480, dbf04254765f7497070387e8c34895c6
-0,        233,        233,        0,      480, 410a9b2d9855b2c29618070994adae96
-0,        266,        266,        0,      480, 7e7f34effd90209f29f1b9ae01488b3b
-0,        300,        300,        0,      480, 471530f74082c01c9b0f1fcf3d240d77
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-10x34 b/deps/libav/tests/ref/fate/vp9-02-size-10x34
deleted file mode 100644
index e61e65d..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-10x34
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      510, bfeeaf51f972fd0dfe9ee757083cbb54
-0,         33,         33,        0,      510, 10cd4ed6d762004846412d9cd0caa407
-0,         66,         66,        0,      510, 04cca4008d656ed180de88dd2ddb4f21
-0,        100,        100,        0,      510, ec777e377836895748c06849fa35ed2d
-0,        133,        133,        0,      510, b55633d0f9239dff3e45a4abce4a35a7
-0,        166,        166,        0,      510, 063c3ab4b4c599942c3a8a5b7bfe5029
-0,        200,        200,        0,      510, 07b920169d32b5fc51d5b9ae16fef5bf
-0,        233,        233,        0,      510, 8d49e727db9d3072b5ab7bab2133d9be
-0,        266,        266,        0,      510, 17441437203447e946a57d2f96966332
-0,        300,        300,        0,      510, 5d3f14af0e5cd81d0c7d2059f13efa5a
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-10x64 b/deps/libav/tests/ref/fate/vp9-02-size-10x64
deleted file mode 100644
index 9a9401f..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-10x64
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      960, 835254d0eecb17bed1f2b0f3a1638165
-0,         33,         33,        0,      960, c0c95ce9890eab339a0e0f8b26cb095c
-0,         66,         66,        0,      960, f0337d645ade07cb716952b0d19352e8
-0,        100,        100,        0,      960, 7e3deb21cb3f0ead90c8af94464cde14
-0,        133,        133,        0,      960, c6b1ca6cfce358c411c0637c581157c8
-0,        166,        166,        0,      960, 10fce3f11f1ce90286ff4d74fe44fcfd
-0,        200,        200,        0,      960, ee0565a1f121bc905a35550619127a50
-0,        233,        233,        0,      960, 0624b601d379616eb792c94be60b6c91
-0,        266,        266,        0,      960, a1bb79cdf347548f1103f580f2b6930f
-0,        300,        300,        0,      960, 40e96e16c7e065aa7932e5aa57f32398
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-10x66 b/deps/libav/tests/ref/fate/vp9-02-size-10x66
deleted file mode 100644
index ef9fa1b..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-10x66
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      990, 1bd8b2d3bf679c4b925780bf82e12fae
-0,         33,         33,        0,      990, a0254b4cd4928fe1080cd6f8828288a9
-0,         66,         66,        0,      990, e416e99644cca481dc2806708d716ecb
-0,        100,        100,        0,      990, b1ed3203ffc77ed814f1cda7bfe721d2
-0,        133,        133,        0,      990, 0ff7b9d84765f7b0b0650775ba72b334
-0,        166,        166,        0,      990, 8b6cd91e035bad19b46b132bd411231d
-0,        200,        200,        0,      990, c714759a9a64402043ad00e5677c954c
-0,        233,        233,        0,      990, 8e4738010b724ce66bcd0a5d5afcfbc1
-0,        266,        266,        0,      990, 998a7aab8ed94f4b69bed39fb487f8d5
-0,        300,        300,        0,      990, 9964683a15a65c032631a4f608e6009b
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-16x08 b/deps/libav/tests/ref/fate/vp9-02-size-16x08
deleted file mode 100644
index aac95a3..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-16x08
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      192, 68dccd167f9aa18df0840ebb8715eb68
-0,         33,         33,        0,      192, 65c90bb99fdbee7abf21031d34cb18dc
-0,         66,         66,        0,      192, 9ef1feb2dcbd4d73f3ee84e9e1cd2668
-0,        100,        100,        0,      192, b6281f7c88e9aa132d3902046f8cde5a
-0,        133,        133,        0,      192, 4b439b716a294bddf9f56a229705907b
-0,        166,        166,        0,      192, d42c0a6f0d24522c90bc2233bc1df2c7
-0,        200,        200,        0,      192, 74b763a5a12c4c4a581efb1818a92970
-0,        233,        233,        0,      192, 0c3a0916ddfda5abdd3ac382f036e71f
-0,        266,        266,        0,      192, 26ff590e8ae726f70e8b36f5eaee7a19
-0,        300,        300,        0,      192, 30fa5810995d7132387ea585c4a1cc3a
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-16x10 b/deps/libav/tests/ref/fate/vp9-02-size-16x10
deleted file mode 100644
index bea7010..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-16x10
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      240, fb3cad61d7d9eb511758dbf87dd8abe1
-0,         33,         33,        0,      240, 4fbc1aa5559c8db2930803893bd6ba75
-0,         66,         66,        0,      240, 2d8e2ee04dcc6097ca9e3f27070cdcc8
-0,        100,        100,        0,      240, 05d419f1322855ba3620665b68ce9910
-0,        133,        133,        0,      240, b004f8d88cb2c94f4e9a13cfa5bd480a
-0,        166,        166,        0,      240, 9d9dec90e2213c0411939131aa9adf7f
-0,        200,        200,        0,      240, a00874356ff1b1e9da1a400424661f8d
-0,        233,        233,        0,      240, fda587eb6323cd98c773f05905ac1794
-0,        266,        266,        0,      240, 781c63d221a04d8130806c799d16753a
-0,        300,        300,        0,      240, f346e311829f3789dc5a94da48ada5f4
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-16x16 b/deps/libav/tests/ref/fate/vp9-02-size-16x16
deleted file mode 100644
index b013952..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-16x16
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      384, b5c9daafa548e54a8e33e9881fda33f4
-0,         33,         33,        0,      384, 1193acd7ea4b7aac968e35ef83c64378
-0,         66,         66,        0,      384, cd0e42c0b5a8b3be6f0e1d224062bf99
-0,        100,        100,        0,      384, ed79c71d17f68f86cbfa75ea2bfe97f3
-0,        133,        133,        0,      384, 1502a859c7e07b31faad5b80e3e27cf7
-0,        166,        166,        0,      384, df3f093da914ea947db93c3baa188ecb
-0,        200,        200,        0,      384, 480f86eb183b99277c1b38fdaafe2970
-0,        233,        233,        0,      384, 023e0114282e04963f0f52e00e65ac61
-0,        266,        266,        0,      384, e67f29cf0acc7f9b553458e1e5c59ebf
-0,        300,        300,        0,      384, a779a14ba718f0c1df8a7edc9467d12e
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-16x18 b/deps/libav/tests/ref/fate/vp9-02-size-16x18
deleted file mode 100644
index 1795bd9..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-16x18
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      432, 5156b11cd9995d0c1638c9b0d2b0786c
-0,         33,         33,        0,      432, ef78557f93fb3ea770c7d49ab60edf21
-0,         66,         66,        0,      432, f31fb9bb14566e4538a45ac7bf398b2a
-0,        100,        100,        0,      432, 97633875537f76ade183e975fa91b0fb
-0,        133,        133,        0,      432, 602cf54f9af852175173c21abd63796f
-0,        166,        166,        0,      432, 0b3741a6842cb65d6d21eda891882033
-0,        200,        200,        0,      432, 44240a27a6b6d36c9661d499fb965f87
-0,        233,        233,        0,      432, 9050f263f9a4767f9323ec8aa42cf7e6
-0,        266,        266,        0,      432, 57fa3a8494375f588a95376bc0c3cb28
-0,        300,        300,        0,      432, 084595f2a65aa10e7d3845044a0e7213
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-16x32 b/deps/libav/tests/ref/fate/vp9-02-size-16x32
deleted file mode 100644
index 663a456..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-16x32
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      768, c73d611490a5ddec6c690589deaf5e86
-0,         33,         33,        0,      768, 5d8eaeb222aa64abda59ce7b09b2f6d9
-0,         66,         66,        0,      768, 34321856b8dd5bbb9b63db04d3532289
-0,        100,        100,        0,      768, 947337d2fec8a09242f60e31e99f4065
-0,        133,        133,        0,      768, bb7d92f6fc055f0cf0e97bd2be56cc9e
-0,        166,        166,        0,      768, 5d343c82bcdd0e9d08581043cddfd0ca
-0,        200,        200,        0,      768, 612ded93207712e4916d584cc4a7b87c
-0,        233,        233,        0,      768, 6ba5e0d19893e1b96f5ca86e0bfd7e18
-0,        266,        266,        0,      768, 336572e1dcb110b1eb87bea81e0752f4
-0,        300,        300,        0,      768, 705f73d0a39afce59ea571e68bfe25df
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-16x34 b/deps/libav/tests/ref/fate/vp9-02-size-16x34
deleted file mode 100644
index 54d9aaa..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-16x34
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      816, b8bf711d9a1ce49180ed56407c8a4b0a
-0,         33,         33,        0,      816, 0457929b06ce46aec63d66bd38586e3f
-0,         66,         66,        0,      816, 3b5f417ee5a936797a6f0d138b8ed73b
-0,        100,        100,        0,      816, 5d1a42aeecfd5c8513cb2df94c206c8b
-0,        133,        133,        0,      816, a0ab2dddbc810a1667d779f6ed69d010
-0,        166,        166,        0,      816, b150cd7c4ec83e6f9d948e99d7465350
-0,        200,        200,        0,      816, ea39622ad21312bd8bcecdaf09aa18fb
-0,        233,        233,        0,      816, 467a42e1226a01c8ba244f312f588bab
-0,        266,        266,        0,      816, f2311e15228ffc7fd377b89c203d0fbf
-0,        300,        300,        0,      816, 5df58b3ac0a7856796a46f27be7dcf4c
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-16x64 b/deps/libav/tests/ref/fate/vp9-02-size-16x64
deleted file mode 100644
index 0e19d9a..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-16x64
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1536, 925fdc485f3baa1ed145ae391519d7fd
-0,         33,         33,        0,     1536, d37af656da2d7a727c8451773495d5ed
-0,         66,         66,        0,     1536, 8a0f207a99e46f3d3b2aaa3f1b061981
-0,        100,        100,        0,     1536, a3914c7b739d3af2641fd6aae35428ef
-0,        133,        133,        0,     1536, 0ba3b49970d7b029f2dfa991fdfc6e61
-0,        166,        166,        0,     1536, 55838d1d787dc5a4fa4da2994f04587f
-0,        200,        200,        0,     1536, c089f7ba2b2983df2a4dc2e07798af31
-0,        233,        233,        0,     1536, c23dcb3b109543a61ccfa404a726caae
-0,        266,        266,        0,     1536, 01aaf09960f5ca599ca32768f017d0c9
-0,        300,        300,        0,     1536, 79fe955692ecba8bbb00b20a42ca8104
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-16x66 b/deps/libav/tests/ref/fate/vp9-02-size-16x66
deleted file mode 100644
index 2d75fc8..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-16x66
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1584, c7b0d91f362dff0a581434af6e902d43
-0,         33,         33,        0,     1584, d8b016ef59c6bc193b29d1c714f342c1
-0,         66,         66,        0,     1584, c520bd8d4b81aafc7687befff66c7396
-0,        100,        100,        0,     1584, 92e81bbd3af675c9cdb1cb00d03dabe1
-0,        133,        133,        0,     1584, a271db3defe5daa6d9e0a73a580f4f88
-0,        166,        166,        0,     1584, 4077e857321e241bb98dfd89c0aca46f
-0,        200,        200,        0,     1584, 0466e1453a94baf876e9f64b60235300
-0,        233,        233,        0,     1584, 9d2cb9c7b180d44841e0e4d8a595d912
-0,        266,        266,        0,     1584, 500f443eeb0ecef47c34d1e91f0df6ce
-0,        300,        300,        0,     1584, 83354487982915c33b1c6243d80adaeb
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-18x08 b/deps/libav/tests/ref/fate/vp9-02-size-18x08
deleted file mode 100644
index 49129ce..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-18x08
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      216, 3219af4ef540636b0f67a989e9966059
-0,         33,         33,        0,      216, 1a3655c2cfd2ee332bc89da5b3faf778
-0,         66,         66,        0,      216, d638d5b361a6d81440e26993ed86c97d
-0,        100,        100,        0,      216, d9bc2e7cffd66db4ba9dcbce99448d4d
-0,        133,        133,        0,      216, 399f962e0a0573915bc4da4a9f1effcf
-0,        166,        166,        0,      216, 69d917e19b903e4f07f848e9e557bbe7
-0,        200,        200,        0,      216, d6311488a58acf6eb0cc45bc4fe3c2da
-0,        233,        233,        0,      216, 0ce360a84d5755307f98d65c83f190e1
-0,        266,        266,        0,      216, 2554828e6dbf94424ccac30fb153872e
-0,        300,        300,        0,      216, 598a55f9735e85b8d45105dd6be7f97b
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-18x10 b/deps/libav/tests/ref/fate/vp9-02-size-18x10
deleted file mode 100644
index 3fcf5ca..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-18x10
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      270, bf574489e9360b6475aa012c747e7924
-0,         33,         33,        0,      270, 851100301c2937312a6fd32f5aab5a09
-0,         66,         66,        0,      270, 0f7c1209e44ea7cd4df12d82f9224684
-0,        100,        100,        0,      270, 28d121f9c40de5280435bfdeaec0c072
-0,        133,        133,        0,      270, bb00898d03ce4dff5f7bee719dd3f5b5
-0,        166,        166,        0,      270, a098cc66bc25b81f84b0e930b0915cdb
-0,        200,        200,        0,      270, 81e25f19bfcbfce17bd7138eedae04ee
-0,        233,        233,        0,      270, 69c36c5ce555a461f16a1733450f7258
-0,        266,        266,        0,      270, c95236d9e7c624bb664310bd9ef47fb4
-0,        300,        300,        0,      270, 7ab0942e686939951037314e9402d2c1
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-18x16 b/deps/libav/tests/ref/fate/vp9-02-size-18x16
deleted file mode 100644
index 6b2a43a..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-18x16
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      432, 9535aaa2ea26fbdc16e7fe9cba3fc9b4
-0,         33,         33,        0,      432, 7f6e7ca33c0b27ff052dc2ab6721e37d
-0,         66,         66,        0,      432, d37e3f169457a9c7f2a197353e39d3d6
-0,        100,        100,        0,      432, f26d7d81dd81d051680ea2485e812705
-0,        133,        133,        0,      432, 704b01955ced6d101b9e9315d3327f28
-0,        166,        166,        0,      432, 30d46d6a0f6be383dede451cacf465f4
-0,        200,        200,        0,      432, 83c7ed04f0af61ec665041967cbce05d
-0,        233,        233,        0,      432, 152daf37dd37607886c50dd4c7796357
-0,        266,        266,        0,      432, 609d807351ba74b1c432e3d0516add91
-0,        300,        300,        0,      432, 67953f0c735984232cb6782217cdcdf6
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-18x18 b/deps/libav/tests/ref/fate/vp9-02-size-18x18
deleted file mode 100644
index d7103ae..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-18x18
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      486, 83790b0e7004d8d89b7134ee1a88d885
-0,         33,         33,        0,      486, 0baf0bf556ae56d2f4b04567e6ac7ed9
-0,         66,         66,        0,      486, c648854a4d49f7e407a2450cf4ba292a
-0,        100,        100,        0,      486, 510c3aca23339841ffc72ed5c75d184e
-0,        133,        133,        0,      486, 1c1f3116ec4d4ee1ad790652e49233ad
-0,        166,        166,        0,      486, f94891f4e16fd32d638a2c696f5922e6
-0,        200,        200,        0,      486, e164814c22e38cbe45312dfd48d987fc
-0,        233,        233,        0,      486, f582515fcc6c4308ad931d2f6cf371a0
-0,        266,        266,        0,      486, 0a446974bd227ee34a1621a2b7852abb
-0,        300,        300,        0,      486, beca28bdae8d1fe20036b3646f3109cd
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-18x32 b/deps/libav/tests/ref/fate/vp9-02-size-18x32
deleted file mode 100644
index 450facc..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-18x32
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      864, 62eabc8819ded6ddba2c3a5029497cf0
-0,         33,         33,        0,      864, b760182fddf8bc05f149e80bbcb2c281
-0,         66,         66,        0,      864, 0c44be0472ebd2653ce9fb174c6180ab
-0,        100,        100,        0,      864, bbb033c3bfeeb6f59cb43013597b9d92
-0,        133,        133,        0,      864, a769975cdbc6529525f7cac8a0d9299a
-0,        166,        166,        0,      864, 15b02059bbced62f19c0626efea1ecb9
-0,        200,        200,        0,      864, 47f4b50322ed31649bdcfffb05c70fa2
-0,        233,        233,        0,      864, 8649cdd0a958047839f5b6e7bbf6f288
-0,        266,        266,        0,      864, 2c766e3fd3882a9a5aff52ffe9d1d341
-0,        300,        300,        0,      864, 184a62b7332a1c24acbf03f670fb7ac1
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-18x34 b/deps/libav/tests/ref/fate/vp9-02-size-18x34
deleted file mode 100644
index ef6042a..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-18x34
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      918, 612cc424eaae924cb25c7732c422f752
-0,         33,         33,        0,      918, 010e8c2a814862529fcf8d7771ba2d7f
-0,         66,         66,        0,      918, 7d791b7a5916738998f77586339d5840
-0,        100,        100,        0,      918, aeada5f59f3dda9ab3e898f305428cb2
-0,        133,        133,        0,      918, 06af894d38a1f0d3665c0081f5397ddf
-0,        166,        166,        0,      918, 24bf31323c568e652550e9d35de9c96c
-0,        200,        200,        0,      918, a9681ec47d3e6a19321b9ea47221dc3f
-0,        233,        233,        0,      918, 73ae7268df79c4012952bd3e8011e894
-0,        266,        266,        0,      918, 67aa4145398ca17036959251cb4ce17b
-0,        300,        300,        0,      918, de247b80114c722da849f5aa23adbb38
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-18x64 b/deps/libav/tests/ref/fate/vp9-02-size-18x64
deleted file mode 100644
index 038b21b..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-18x64
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1728, 72c74de547d9ed1b17bc962dbd5e0bb1
-0,         33,         33,        0,     1728, 462849f9e2204738e9f08b40e682a6ae
-0,         66,         66,        0,     1728, f0ee17692fd816747b11d5737b511cda
-0,        100,        100,        0,     1728, 0234d23406660ede76dd22b35a708390
-0,        133,        133,        0,     1728, 6544fdb9dc225d155820d3c7dfc909eb
-0,        166,        166,        0,     1728, 1c073544794389596177512fb4dcffce
-0,        200,        200,        0,     1728, 864709daac7b091d33afa2210c145084
-0,        233,        233,        0,     1728, b049c4ac941743613ede9a41b16acde5
-0,        266,        266,        0,     1728, ad0c4adb0efec03729a79f42eec66267
-0,        300,        300,        0,     1728, 146057d941f5a47eb8b2c9eefeaf3100
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-18x66 b/deps/libav/tests/ref/fate/vp9-02-size-18x66
deleted file mode 100644
index 6d3021b..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-18x66
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1782, c3fc4a1593b9cc2f3752106af8539386
-0,         33,         33,        0,     1782, 7f2ffe6bc1750f6749bb5ad12cbaf34b
-0,         66,         66,        0,     1782, 2539b10a981d59ef54efd77cd7276aaa
-0,        100,        100,        0,     1782, 0bff22b4dfb7485fbedd6ff5b99673d1
-0,        133,        133,        0,     1782, 6a2b38f4abee785260a61bc60f16e7fa
-0,        166,        166,        0,     1782, 2fbb69b5519b51548bf1ee425ff79c55
-0,        200,        200,        0,     1782, dbd267028be2256111b2411b91fcc117
-0,        233,        233,        0,     1782, 12b2f1003633c9e19cae3d0fda06102d
-0,        266,        266,        0,     1782, d419a756c492867523af5185fd57d989
-0,        300,        300,        0,     1782, 8a7d36760bf5db32baef349b97316b47
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-32x08 b/deps/libav/tests/ref/fate/vp9-02-size-32x08
deleted file mode 100644
index ae376d3..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-32x08
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      384, c7b30cde5664387b0f7a80d9b01e4fe2
-0,         33,         33,        0,      384, 2228a2a4e54ab5145525e5803c314dcd
-0,         66,         66,        0,      384, 8c048469eba24f3163c36b7461b3b42a
-0,        100,        100,        0,      384, f6b8e8e701dea09dcf1158e9a52921c6
-0,        133,        133,        0,      384, b3a5fde0daf2eef8fc08521f88f79692
-0,        166,        166,        0,      384, 653ae11cc1380ae7f39b2e007f896d81
-0,        200,        200,        0,      384, 6e66fe002a7dff95e13cc9d3d13d9686
-0,        233,        233,        0,      384, 13308c917a1e22c2f702afc32b8a23c2
-0,        266,        266,        0,      384, 4fee1e63f9452dc3f81c1d634bd7f41d
-0,        300,        300,        0,      384, 666b43ead5c7c99ae5b7637da5aa4d62
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-32x10 b/deps/libav/tests/ref/fate/vp9-02-size-32x10
deleted file mode 100644
index bc816e9..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-32x10
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      480, 7c5b5df373ebfd31d210ff910e02213b
-0,         33,         33,        0,      480, c5b0a5e3eceb792b15818324a43aa2a8
-0,         66,         66,        0,      480, 1d9c0eafd4638dfe4fe308174fde2faf
-0,        100,        100,        0,      480, 47301d12055944b35008028761cf5e7b
-0,        133,        133,        0,      480, 9586ac1087423dcd3b0ff96d43ae475e
-0,        166,        166,        0,      480, 26bfe1afea96c7ef2084fffd1fa99a33
-0,        200,        200,        0,      480, 0995c8a1935266159a7ef3f95d7f4697
-0,        233,        233,        0,      480, 8cfcc0ea67507ab7f3551d8ac50f93a5
-0,        266,        266,        0,      480, 658cf3cb887b055d9de7d50db4eb78a9
-0,        300,        300,        0,      480, 856bd5189688f7ccfe9995752bc0f1f6
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-32x16 b/deps/libav/tests/ref/fate/vp9-02-size-32x16
deleted file mode 100644
index ebb465e..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-32x16
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      768, 7c2818db2632e5c5beee17e7105d9209
-0,         33,         33,        0,      768, cead72bd22995e98b54a91c7b4a20975
-0,         66,         66,        0,      768, eb6baee5d65d778052c88ba5db2f9174
-0,        100,        100,        0,      768, 1f5f38e89e985e9e4172446de05e91fd
-0,        133,        133,        0,      768, 57b57ffcb03627942fc5868324a10feb
-0,        166,        166,        0,      768, 4b4066a452d8e9cd687cd611f5d9cb88
-0,        200,        200,        0,      768, 113e5069b2a4d2c2e802b72649eb435d
-0,        233,        233,        0,      768, e176bb233f76f9fd4c55d62d53487b60
-0,        266,        266,        0,      768, f2ff3def712a846ea7b678bd9078e32b
-0,        300,        300,        0,      768, 21007ed1c727c5ccc5955188a2cec276
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-32x18 b/deps/libav/tests/ref/fate/vp9-02-size-32x18
deleted file mode 100644
index 6afccbb..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-32x18
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      864, 9da5409d344e7b8380688569e54803a5
-0,         33,         33,        0,      864, 9b51e14e2e624ee2b430e9eaf1a48798
-0,         66,         66,        0,      864, b8811779f363b9a595e3a92737771ea9
-0,        100,        100,        0,      864, e5a0c335e5e713a3e77fff0b65127fb9
-0,        133,        133,        0,      864, 1bffa3283b463a356794c8f7a73f8c54
-0,        166,        166,        0,      864, 97c13270621a583eb9e13c05f9d792f0
-0,        200,        200,        0,      864, a6f81a4dde1ffc352ebe9d8ab8782f35
-0,        233,        233,        0,      864, 91a955a86ce9378ff3442794ce0934c6
-0,        266,        266,        0,      864, 2e4f8938e9c88b328a258a0b99366ea6
-0,        300,        300,        0,      864, adbbbc192cf36e1fc7c308824765d482
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-32x32 b/deps/libav/tests/ref/fate/vp9-02-size-32x32
deleted file mode 100644
index fb3fb87..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-32x32
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1536, 117915db1856cee26f05a609c8c8de2e
-0,         33,         33,        0,     1536, 943771a98b26b174e88ed1f4e872e504
-0,         66,         66,        0,     1536, 3e0d2585e1f1cb540998d107aca5c395
-0,        100,        100,        0,     1536, e64a9e1e0232983a69ab48453025b23d
-0,        133,        133,        0,     1536, 2c6ef6637fb7b9425f7d7ea28cd84087
-0,        166,        166,        0,     1536, 419a5a31a43955d408c13ee8a5ddce9c
-0,        200,        200,        0,     1536, 2ab13e1c236553d42d59498ca350b190
-0,        233,        233,        0,     1536, b8068beb037f3232d4da38fe33a8a885
-0,        266,        266,        0,     1536, 160df68b9e3f75e9b1f8ed7cce327bc2
-0,        300,        300,        0,     1536, 1ccafa8c7babdce0983aeb20d298b0ee
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-32x34 b/deps/libav/tests/ref/fate/vp9-02-size-32x34
deleted file mode 100644
index 4e000a5..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-32x34
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1632, 770582911fd0095ebbeae384e87665ac
-0,         33,         33,        0,     1632, f99d7e3131f04413cba2f9de6818976d
-0,         66,         66,        0,     1632, 3bfbb8c9c48f24cd596973a6deb33a3f
-0,        100,        100,        0,     1632, 0b8166afdd357f20c76f77d228bb7171
-0,        133,        133,        0,     1632, 3a3d7f2a03e19a82250d6ca0238f9791
-0,        166,        166,        0,     1632, 9b558f9b8744b016059f69f3fca90d2c
-0,        200,        200,        0,     1632, c857736342f1145d919cb77732120006
-0,        233,        233,        0,     1632, 11dc5dda4c883a3146db060dd50343d0
-0,        266,        266,        0,     1632, 7526a62ae87de174be86eac7bb36c7f3
-0,        300,        300,        0,     1632, 9ef38f47cfc461710ff0dd75690473c0
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-32x64 b/deps/libav/tests/ref/fate/vp9-02-size-32x64
deleted file mode 100644
index d2b9c99..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-32x64
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     3072, caa8471a8b381d53c3e8fc627946a871
-0,         33,         33,        0,     3072, 2cba86ea14c0f28e242625b08f5e9b88
-0,         66,         66,        0,     3072, cea0440ff6569fc82c3030e0340fb649
-0,        100,        100,        0,     3072, c18ef37f1356ade96a2f40af954b31c8
-0,        133,        133,        0,     3072, 21e6e549378bcff47913ef292e74dc37
-0,        166,        166,        0,     3072, a9d3d483f74a5afe5d80725ce696fd20
-0,        200,        200,        0,     3072, a436e2586b0963747deaf5e450e2b230
-0,        233,        233,        0,     3072, 9daaadf265df56974cb0950843d9fd8c
-0,        266,        266,        0,     3072, e0b84714bad2519e62b7d16705fb09d5
-0,        300,        300,        0,     3072, 8cdfce574edbe548da7f6cd9a7076b9e
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-32x66 b/deps/libav/tests/ref/fate/vp9-02-size-32x66
deleted file mode 100644
index 65c87da..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-32x66
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     3168, 920ea4b8a00d41489d122d641d6e4fe5
-0,         33,         33,        0,     3168, 8bfc8d452a79f2978b8e973b77cbf8a8
-0,         66,         66,        0,     3168, 09f3f0d31d3377a844fa5385d9b36b9f
-0,        100,        100,        0,     3168, df43fae763da9360c8062bb92ee091a8
-0,        133,        133,        0,     3168, 445d8c675bb865d1814fcfa6b8a9afd3
-0,        166,        166,        0,     3168, dc7d43db86aac6636724de8790eda555
-0,        200,        200,        0,     3168, d3a9fc272424449ffc5b7e69f8f9948b
-0,        233,        233,        0,     3168, 11ef33b9bccca54b3703bf24ab55e2d6
-0,        266,        266,        0,     3168, ce31b8bf9b00b427ca956abb800d8034
-0,        300,        300,        0,     3168, e707f824d6e95d482bf3a0b4d52ea069
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-34x08 b/deps/libav/tests/ref/fate/vp9-02-size-34x08
deleted file mode 100644
index d6ccbbb..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-34x08
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      408, c14f2ba5b4582c9d3a488976814691b3
-0,         33,         33,        0,      408, 4387a4dce19007b7efb810b5a4069749
-0,         66,         66,        0,      408, ecfe868d28f4861a5612edfd57447a02
-0,        100,        100,        0,      408, 5cba54f568534d29169ac31c8fa505e0
-0,        133,        133,        0,      408, fe9aab7b3378b9fc3e373ee626b887db
-0,        166,        166,        0,      408, fce72dfc7f9c0cb50ff73761b4d82c1f
-0,        200,        200,        0,      408, d4d98f42b1377e0f0ffaa66aa81d40c3
-0,        233,        233,        0,      408, 65c027646dc95a749ce2d7ad0a6beccc
-0,        266,        266,        0,      408, 317b283a0d907270f671272771022e69
-0,        300,        300,        0,      408, d3e2c008584608502f3e24c5c5f64028
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-34x10 b/deps/libav/tests/ref/fate/vp9-02-size-34x10
deleted file mode 100644
index adcb22e..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-34x10
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      510, fd7212b519783cf4831ce4bff91f2312
-0,         33,         33,        0,      510, 9768722ee939d80a6716865fdebca33d
-0,         66,         66,        0,      510, 328ee0f774eeafde00dcc4b9a8f4e9af
-0,        100,        100,        0,      510, f882fa6015fcb042094eadab5fa952cf
-0,        133,        133,        0,      510, 4331a3dabeae27d2bf3590eb96ce914a
-0,        166,        166,        0,      510, 0e15106bd8e90377f6ed8b464d17159c
-0,        200,        200,        0,      510, 8f062653ac2b83f7e541393e838d0e0f
-0,        233,        233,        0,      510, eeb98c1728c1a74510f8bfaf10fc0002
-0,        266,        266,        0,      510, 30bb058a67d6a5ee3693b21cbca5349a
-0,        300,        300,        0,      510, 7ce4b79983b3abc37b141a3bea56e0b7
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-34x16 b/deps/libav/tests/ref/fate/vp9-02-size-34x16
deleted file mode 100644
index db88976..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-34x16
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      816, e443c43101be00470c6a61c1a2995b5a
-0,         33,         33,        0,      816, 1e79b1b46ec704d360b5fb725913b0f1
-0,         66,         66,        0,      816, 6d5e77cafab6bc43498980c515d299d3
-0,        100,        100,        0,      816, 91c3bba5fd2aa29ee54c8f3783cfe5a2
-0,        133,        133,        0,      816, 9548d07c2a6204694d34e973e8339077
-0,        166,        166,        0,      816, 6819a34c7e3c13bee3ea2b18e12e92fd
-0,        200,        200,        0,      816, f75920457f01f65bf30ba1ec41076d4e
-0,        233,        233,        0,      816, 3a04f6cc0c348c21464b173ac6005043
-0,        266,        266,        0,      816, 93a3336374e8cc4dfb2c0b4716ab60ec
-0,        300,        300,        0,      816, 148af188b8a2ee93de406a01c2af180d
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-34x18 b/deps/libav/tests/ref/fate/vp9-02-size-34x18
deleted file mode 100644
index d877088..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-34x18
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      918, ab7eabb355e5163e7451945018fadebd
-0,         33,         33,        0,      918, b9a77cc0c769535808996a6de7b374ff
-0,         66,         66,        0,      918, bd773f11d89091b3c9ebc22d8291dd49
-0,        100,        100,        0,      918, 278c215d6c188752818f07f4d317c0e0
-0,        133,        133,        0,      918, b59856932c675c1ba587644c23cdb002
-0,        166,        166,        0,      918, 2bcaef04f89326a56025269a68742043
-0,        200,        200,        0,      918, 5abb4a1b96b4bc003cd19a146347c54e
-0,        233,        233,        0,      918, 26e36058f451ff80d498ac1c0343489f
-0,        266,        266,        0,      918, 57ac43fcc6f1a2c863188aca68d52524
-0,        300,        300,        0,      918, 282467118b5b7a986ccd28d16dab3ea7
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-34x32 b/deps/libav/tests/ref/fate/vp9-02-size-34x32
deleted file mode 100644
index ce29241..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-34x32
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1632, 7e334867e27046fabf0f39365311c38c
-0,         33,         33,        0,     1632, d2a49216ecedea62f546e54c1552f163
-0,         66,         66,        0,     1632, f66e10d1779533e5b6e2b98369134833
-0,        100,        100,        0,     1632, 0054b8d4393df58eee87784862a29901
-0,        133,        133,        0,     1632, b9cdf3ebea0d1e3f1e0c42db2e11a3c2
-0,        166,        166,        0,     1632, c08a728d955a559457c82e44c3296148
-0,        200,        200,        0,     1632, d05f4c4a8b0e606525c3d388d26a9351
-0,        233,        233,        0,     1632, 78fc2544da88a1a21d6626b0f7bbcf8c
-0,        266,        266,        0,     1632, 90832c4fed05390377551359bb9a91f7
-0,        300,        300,        0,     1632, 5290a0e77081863398f36c7ae192710b
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-34x34 b/deps/libav/tests/ref/fate/vp9-02-size-34x34
deleted file mode 100644
index fc5b90c..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-34x34
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1734, 1bb98ba89abf6b86f47a851f8126e1ff
-0,         33,         33,        0,     1734, b960cc795c179afe7eec360c57fddd7f
-0,         66,         66,        0,     1734, a93cd094a80c542ecb7b6ac7720c5eff
-0,        100,        100,        0,     1734, f1cd34e4f0bf9b1238769f028708b742
-0,        133,        133,        0,     1734, f01437ad14450d2136a8fc971f180eb7
-0,        166,        166,        0,     1734, 8778230f1182c2227bf1e253bd85df4c
-0,        200,        200,        0,     1734, 1d1d5cf6c5cc9e73a1fa5b882e441d74
-0,        233,        233,        0,     1734, 2f7a1867487c56c252e35225f71adb55
-0,        266,        266,        0,     1734, 1d1aea21f70ceed596f22ec32d8712ee
-0,        300,        300,        0,     1734, 260e66df92f32bc853f4cd4ede692ea4
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-34x64 b/deps/libav/tests/ref/fate/vp9-02-size-34x64
deleted file mode 100644
index e31ad98..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-34x64
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     3264, 3856635223f578e1e7f7e7250a53cb8d
-0,         33,         33,        0,     3264, ee8d7c3a0ea165420d7e733b9e59219a
-0,         66,         66,        0,     3264, 3d33f06bac22131f04e3411fc216dc02
-0,        100,        100,        0,     3264, 7aea667775077de32250dac25fd24bb3
-0,        133,        133,        0,     3264, 43fb534551f153c5e9e60240df0bf3b4
-0,        166,        166,        0,     3264, d42b721aa2242d4258d97f840fdcc901
-0,        200,        200,        0,     3264, e876200d720cbe6e36e0ffb775c5ad6c
-0,        233,        233,        0,     3264, 453078449d8701270564086e58a1d69e
-0,        266,        266,        0,     3264, 22cb799a817d45a7591489e6faa31cb9
-0,        300,        300,        0,     3264, 628dc3f03bf5dd5cae135ad1e4b9ebf7
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-34x66 b/deps/libav/tests/ref/fate/vp9-02-size-34x66
deleted file mode 100644
index 2182c29..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-34x66
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     3366, bf4e568217906ee4b58dc4707bee8ef6
-0,         33,         33,        0,     3366, f823f8c7b6e47ba43215f3becd35208e
-0,         66,         66,        0,     3366, 1d986d65b502e77764428e21e77503a6
-0,        100,        100,        0,     3366, 73520382bc54d6aee165402518dd7b5d
-0,        133,        133,        0,     3366, c84e943758f2d7e37126172728838640
-0,        166,        166,        0,     3366, 1d4b298da98e4b66b31ad6874f726aa6
-0,        200,        200,        0,     3366, e67748eeb3c818deb8b51d321cd16a9c
-0,        233,        233,        0,     3366, 4d1514c63e669261beef9e35b04c241e
-0,        266,        266,        0,     3366, 57705e2131e2129efbc68b74a1e0459c
-0,        300,        300,        0,     3366, 681acf1b384856d6e544d8e7a79fc628
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-64x08 b/deps/libav/tests/ref/fate/vp9-02-size-64x08
deleted file mode 100644
index b15296a..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-64x08
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      768, d801797c94039b0a166d46e151ec912c
-0,         33,         33,        0,      768, 161ec22caa3689b214d9ab993424584b
-0,         66,         66,        0,      768, 499b589ecf1873e388c256ce948eabb9
-0,        100,        100,        0,      768, 22bc77650e3df70e3e36f2a1b8d8aa71
-0,        133,        133,        0,      768, 750e40530257a68211596a60de18bffa
-0,        166,        166,        0,      768, 4f812a92157e7186642656b59bc28a3d
-0,        200,        200,        0,      768, a3f141cec127a2c2e16740b8dd4ce56a
-0,        233,        233,        0,      768, a5ba9959bf65ab6e254e5b359a3d59b5
-0,        266,        266,        0,      768, baa72b8a57277d9e9ad4b92aab04f5d1
-0,        300,        300,        0,      768, 4cb9aebb6c9d5bd164461726de201549
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-64x10 b/deps/libav/tests/ref/fate/vp9-02-size-64x10
deleted file mode 100644
index e499cc9..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-64x10
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      960, 97eb5fd0599d482662eb0a1def5c5ef2
-0,         33,         33,        0,      960, dfdc1b61b478dcca8d411021486aa2ec
-0,         66,         66,        0,      960, 2cf560f068bdcb9e345951739091808e
-0,        100,        100,        0,      960, 33cacb04c0797fc7bd774251e04b7fb9
-0,        133,        133,        0,      960, 7fca126c0542c0dcdcf769b156bd85f5
-0,        166,        166,        0,      960, 8a46c5a48cb5bd34be8e647c127f8d61
-0,        200,        200,        0,      960, 1ddf07562c0b7dc68ed61b8e1a09fcf0
-0,        233,        233,        0,      960, d75911d5eb7fc75ffc3ee40344fc7ed2
-0,        266,        266,        0,      960, 498329c8a01d950286af11e1fcf3ac07
-0,        300,        300,        0,      960, 7a6ec019df5f3e419d389699094f87c3
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-64x16 b/deps/libav/tests/ref/fate/vp9-02-size-64x16
deleted file mode 100644
index 4810a6e..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-64x16
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1536, a43068a364cc42619e62406dcf17ddfc
-0,         33,         33,        0,     1536, 94691f93299bbf5b6ba3022b02b3e069
-0,         66,         66,        0,     1536, 3c8fc275490b4daf63ef6d8f9b7f81f6
-0,        100,        100,        0,     1536, 96c06031f0fcad49dfed256c5c737d07
-0,        133,        133,        0,     1536, f722d3a51790b55d070d57d3b9a53d0d
-0,        166,        166,        0,     1536, a753b3dfe13f5778f9f054e73e512ef1
-0,        200,        200,        0,     1536, fa12cbe6cbc38fa8a38ecbcf1af8833c
-0,        233,        233,        0,     1536, cb42303391ef6f76f77d14d2600cce12
-0,        266,        266,        0,     1536, e0c18bb1d4dcc8168b5fdd7c7963987e
-0,        300,        300,        0,     1536, 581b5291cb60e50326c0dfa6a2d09d8a
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-64x18 b/deps/libav/tests/ref/fate/vp9-02-size-64x18
deleted file mode 100644
index 1f8fdf3..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-64x18
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1728, adf7e84a351847683f6a8dd177019e29
-0,         33,         33,        0,     1728, 8227cf283a27277fbab3d7826e340337
-0,         66,         66,        0,     1728, a5551b16db948e395537310d12128e76
-0,        100,        100,        0,     1728, 4b57ed07dbc15de9ab6143656b2a7e8e
-0,        133,        133,        0,     1728, a15489495f0acc41f446e9689e4142d6
-0,        166,        166,        0,     1728, b0a0d5d3ff756e8ae19797455432755c
-0,        200,        200,        0,     1728, 094a440243d36edcdd3e9d0d070de011
-0,        233,        233,        0,     1728, a780bd61e1abbfbb28581784531608bd
-0,        266,        266,        0,     1728, 55886a8c7aad65683aa9366a38382512
-0,        300,        300,        0,     1728, 5ae5b24383f66720a62ed1001664051f
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-64x32 b/deps/libav/tests/ref/fate/vp9-02-size-64x32
deleted file mode 100644
index ed1c9a5..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-64x32
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     3072, 931ab6a2482c3e84bc7ef8dfbc251307
-0,         33,         33,        0,     3072, 3552a9d8470a64ed627a6dbb799b7811
-0,         66,         66,        0,     3072, cae1863fc606a0e3df3e708b7eefdf99
-0,        100,        100,        0,     3072, 4b825a07e235c4708b12a726da8e4cdf
-0,        133,        133,        0,     3072, 0dac578ef616a13be2b9db3c0d775524
-0,        166,        166,        0,     3072, bfd47cbab8285f301777351c8bc5553c
-0,        200,        200,        0,     3072, f29f9a0cfeaaae3bdeb26933bc7c17dc
-0,        233,        233,        0,     3072, c7f3a4d24dcf72ef195a402eff77d8f6
-0,        266,        266,        0,     3072, 88ede6207441a7953cf893032c353663
-0,        300,        300,        0,     3072, 258f4e86541813e3edb1fe5332ff4ab1
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-64x34 b/deps/libav/tests/ref/fate/vp9-02-size-64x34
deleted file mode 100644
index c90f7e3..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-64x34
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     3264, 68d00958a78e6252dd75d632806e2022
-0,         33,         33,        0,     3264, f7b6266e74200a669eecd241db787ee2
-0,         66,         66,        0,     3264, c8b88d43aee037857310edeb74bc66f4
-0,        100,        100,        0,     3264, c6d9a52baf3ca962574bff1364fcb8dc
-0,        133,        133,        0,     3264, b384fbf3ceef0affa69f5e81681edc6e
-0,        166,        166,        0,     3264, cd473f0c8d1cde98153402123a3ee7cf
-0,        200,        200,        0,     3264, c0f320a23c3e39719a3b3590fe3c2ab5
-0,        233,        233,        0,     3264, 751207d15a791728c1022f711a25cd68
-0,        266,        266,        0,     3264, 7396df89a0d88044cf7527420d193636
-0,        300,        300,        0,     3264, b772dd247838b0c3ed12713447894323
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-64x64 b/deps/libav/tests/ref/fate/vp9-02-size-64x64
deleted file mode 100644
index 743732b..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-64x64
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     6144, 35f17db9076fa20368fddfa01543c746
-0,         33,         33,        0,     6144, 61cd775dfc177262da9a91d3912e6718
-0,         66,         66,        0,     6144, 8b8cf175f91425d703332b22b46c1c0e
-0,        100,        100,        0,     6144, 6041afbdd81e228f8f16384d3f9e988e
-0,        133,        133,        0,     6144, d30bd08897b50f518920014c7fa55df9
-0,        166,        166,        0,     6144, fb67222a183876b502f93e48bb779b70
-0,        200,        200,        0,     6144, 60830425ca1dcf3df4ee9c6cd75f066a
-0,        233,        233,        0,     6144, 3e178df858f7fcaa2552a1c5c719b5cc
-0,        266,        266,        0,     6144, 66718eb0c3981beb7c1119df8a2cd27e
-0,        300,        300,        0,     6144, 7c1912448c7756f7451888050760d73d
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-64x66 b/deps/libav/tests/ref/fate/vp9-02-size-64x66
deleted file mode 100644
index 7f2a052..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-64x66
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     6336, 88587de65acfc85ff56daac8ef5d12e6
-0,         33,         33,        0,     6336, be41f6c788b929b5b6b27c5674f40abd
-0,         66,         66,        0,     6336, 04ab3f88ca062a6911405fd84c7e9de4
-0,        100,        100,        0,     6336, 231436e0a68d19d3882f285d38aca3fb
-0,        133,        133,        0,     6336, 1a067e147a6740bb4ce57c4184437eea
-0,        166,        166,        0,     6336, be0c47e06c7e9439570473adf4713f5f
-0,        200,        200,        0,     6336, a213b0611247eafab0711748c25e88a0
-0,        233,        233,        0,     6336, b1df495aa3afb74399f91c74b527b93c
-0,        266,        266,        0,     6336, 46319f21069541e1ee1652621b957860
-0,        300,        300,        0,     6336, 313517a5721b2b14683e7eefc83e51b1
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-66x08 b/deps/libav/tests/ref/fate/vp9-02-size-66x08
deleted file mode 100644
index 76ec31e..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-66x08
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      792, 3b16847e60786706fc339abc452746ff
-0,         33,         33,        0,      792, 365a5951cb127d6df183fe5d5000f493
-0,         66,         66,        0,      792, 6d4bceb815ca7717c4a3f86a6670703a
-0,        100,        100,        0,      792, 5a0a03d4788934285448c85788ae8d71
-0,        133,        133,        0,      792, 8712f9a82d07447e7a0d0a37ddc3858d
-0,        166,        166,        0,      792, cff32e6c183c16962207a86d7c6cf0a0
-0,        200,        200,        0,      792, dc933d90f87110651d7efb39854d3d46
-0,        233,        233,        0,      792, d1299562a022521f0c3cb30668f83b6d
-0,        266,        266,        0,      792, 5054254ca125d7c7e6df4001397170cd
-0,        300,        300,        0,      792, a6bd7c7c0b02afa8d25f911ec847c61a
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-66x10 b/deps/libav/tests/ref/fate/vp9-02-size-66x10
deleted file mode 100644
index 63c775b..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-66x10
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,      990, 7cbd8c6b2fb35c0c3063cb7a379944c9
-0,         33,         33,        0,      990, 14062e74b98bed1ca982f408bc14326c
-0,         66,         66,        0,      990, f6d6868d849aa74b27df1c5f40c7096e
-0,        100,        100,        0,      990, 719c8d7e3769466ee8e3dca3f4747a0e
-0,        133,        133,        0,      990, a72e1a7a4c82ec09ea77f87b0e6f25aa
-0,        166,        166,        0,      990, a5163d142b429afa155cc2f1401a0b8a
-0,        200,        200,        0,      990, 27762d813dd1f80d6aaed5f197124fa5
-0,        233,        233,        0,      990, 02e94454660f3528abbde8f50e94288f
-0,        266,        266,        0,      990, 1d57dcfa57a55d96f14cfe471aac2e0b
-0,        300,        300,        0,      990, 7804477923c0cd067bd09ebca3529775
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-66x16 b/deps/libav/tests/ref/fate/vp9-02-size-66x16
deleted file mode 100644
index 97d67c8..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-66x16
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1584, fa2f292d273c37dc2804a70d1cae1e9d
-0,         33,         33,        0,     1584, ba75d90652c021bc7ca061352e6e94ce
-0,         66,         66,        0,     1584, e65d9a205bd17d100e50c7b6a7ea772d
-0,        100,        100,        0,     1584, 46f9e9ff891576b9462f21d48b7b9e2b
-0,        133,        133,        0,     1584, d23cedacf3a37cf6b2774e0b18b6b9d7
-0,        166,        166,        0,     1584, 84329f7716a6db5a7e64a68a1155bfc6
-0,        200,        200,        0,     1584, ad62286b0e13f4e54df4445cdd4fd4e3
-0,        233,        233,        0,     1584, 4511529eb24b21eb63e280070f888642
-0,        266,        266,        0,     1584, 4e1c122df1785e0e9134c43c85082e05
-0,        300,        300,        0,     1584, ac3a3747a00be3f9f58155648fcf9b24
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-66x18 b/deps/libav/tests/ref/fate/vp9-02-size-66x18
deleted file mode 100644
index 03928de..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-66x18
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     1782, fda5ad9bf70a51b3a41bdcabf2cce32a
-0,         33,         33,        0,     1782, 91916fb20ad542a7a3ad276e6505f9b0
-0,         66,         66,        0,     1782, e18e5d11aec483c76afd68f7e64415a4
-0,        100,        100,        0,     1782, c13da01c2b6c09101bda7af93ad5fd07
-0,        133,        133,        0,     1782, ed8d2568b2ad9c7bd980cba0d3b95cff
-0,        166,        166,        0,     1782, e6f3cf312b69d37579e77f2e52cc936b
-0,        200,        200,        0,     1782, e509f3682e9c4bcdb0889e044b1979b7
-0,        233,        233,        0,     1782, acc3945e557cd7a9642f08a656444976
-0,        266,        266,        0,     1782, 44ddd03aa8f03ba393f12fc6a1b3fc17
-0,        300,        300,        0,     1782, fdd3e68132c742d9f0cf0ea6fff2a074
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-66x32 b/deps/libav/tests/ref/fate/vp9-02-size-66x32
deleted file mode 100644
index 0901a7b..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-66x32
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     3168, 013cd22aea6bfeccc8ec809abd52be5c
-0,         33,         33,        0,     3168, 0980adfb0ef879b3c960797272f025ad
-0,         66,         66,        0,     3168, d1411ffa0429befb8c71d3ab45acee92
-0,        100,        100,        0,     3168, 6c6f825379eaf21709a45be77def7a63
-0,        133,        133,        0,     3168, bab632ef00a080739a41c692f2b21c3a
-0,        166,        166,        0,     3168, fc0f6045aca252f2e904730227b8f337
-0,        200,        200,        0,     3168, c8dbea209329463bfd9238a11b8d5b17
-0,        233,        233,        0,     3168, 457247bf4186ed8459e0a1564f0e68f2
-0,        266,        266,        0,     3168, baa55e20bd7c73960b080d8a0c8db4d5
-0,        300,        300,        0,     3168, dc8933e8edc98cd0cfca44ae22997c62
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-66x34 b/deps/libav/tests/ref/fate/vp9-02-size-66x34
deleted file mode 100644
index a999573..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-66x34
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     3366, 6821eb3fcd1d10db32eff70468dcf9c1
-0,         33,         33,        0,     3366, ed0094d347d9f250d46b4903cbc14801
-0,         66,         66,        0,     3366, fd018555dc9a62b8074d46e7c0fd0b40
-0,        100,        100,        0,     3366, 05d5baf9f2e62bbeeb3809a099e84147
-0,        133,        133,        0,     3366, 7a150c265214269c08e05fe4f296122d
-0,        166,        166,        0,     3366, 9a7ae61d4bb125ee4c4ccce9cc1c3664
-0,        200,        200,        0,     3366, 5a88fd6d96dcbc4255e98dfe19ff96b8
-0,        233,        233,        0,     3366, 4192c273a46b2b196c871ead0e61ec71
-0,        266,        266,        0,     3366, e79ebfc47e755f5db221f392c3216278
-0,        300,        300,        0,     3366, b995c5f483a2e553baf4f66d1a47fc57
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-66x64 b/deps/libav/tests/ref/fate/vp9-02-size-66x64
deleted file mode 100644
index 3a3d6c8..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-66x64
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     6336, 929086fbb3e117bd53110b64c1ee915b
-0,         33,         33,        0,     6336, 9ed45f5e40dd2393434e14a0c0160c63
-0,         66,         66,        0,     6336, 5cdade692b1baf23e61896da18e3e44f
-0,        100,        100,        0,     6336, 11a2ebac61a3f826ec41c8031899e55c
-0,        133,        133,        0,     6336, 621a1e0142b94d14db9c2121553a11fb
-0,        166,        166,        0,     6336, 029a29590f7255f1bc9ff9b7a000ca25
-0,        200,        200,        0,     6336, 5fde42becf6bf054d04e2a0fa1b2d55e
-0,        233,        233,        0,     6336, 5b8ba552cef1931e1412fb4f3420748b
-0,        266,        266,        0,     6336, d41cd7d418f6ec1db802a01a90cfee1e
-0,        300,        300,        0,     6336, cea99c93a84a82edff8c6069d131453f
diff --git a/deps/libav/tests/ref/fate/vp9-02-size-66x66 b/deps/libav/tests/ref/fate/vp9-02-size-66x66
deleted file mode 100644
index 5c4e1ac..0000000
--- a/deps/libav/tests/ref/fate/vp9-02-size-66x66
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,     6534, 69f9028d52f95d2e7f986c57b19fc018
-0,         33,         33,        0,     6534, 068e611f62b3f6222f6b1699748c8fbf
-0,         66,         66,        0,     6534, 3d3fec78ff2274241a7958f17a773a19
-0,        100,        100,        0,     6534, 93d71ef1a2d00c7e70e76ccc1859143d
-0,        133,        133,        0,     6534, 5a35a640d52bc0930825b963b0b9e830
-0,        166,        166,        0,     6534, 782223239e6b1ca1bedbd25d9652a07c
-0,        200,        200,        0,     6534, a4b5e8a319cbc9a12d3e36127c7f0fbb
-0,        233,        233,        0,     6534, a3e2d9a78fa42b3c817aadfd31fd2d16
-0,        266,        266,        0,     6534, e9fc6b83535735f46006f3e4b376755f
-0,        300,        300,        0,     6534, 80223f600dfe86021bd0e83fecdc4b2b
diff --git a/deps/libav/tests/ref/fate/vp9-03-deltaq b/deps/libav/tests/ref/fate/vp9-03-deltaq
deleted file mode 100644
index c8ed23f..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-deltaq
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   126720, 2f90d606edc511c8c960530dd915cb98
-0,         33,         33,        0,   126720, 7fd451a057d6341b2b0d116f59e41a13
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-196x196 b/deps/libav/tests/ref/fate/vp9-03-size-196x196
deleted file mode 100644
index 39efcba..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-196x196
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    57624, 14cc1c34b8106e35238d4650a9123852
-0,         33,         33,        0,    57624, 66e0bb9136ea24e30b781a4610b428a1
-0,         66,         66,        0,    57624, 8e36679c20a3a3e974fdacf7a9343817
-0,        100,        100,        0,    57624, 2669fd03ce7ce01f4fc9db23e06fffdb
-0,        133,        133,        0,    57624, 46ced29eb6edf2136c8ee19e9a87380f
-0,        166,        166,        0,    57624, 4e4138b65a30bc56cd18663a1799f98f
-0,        200,        200,        0,    57624, 580b0431b5f808c67e50ed34e62f39ad
-0,        233,        233,        0,    57624, 1339bbe256d8499ab17d6a550f7dac70
-0,        266,        266,        0,    57624, 89b9dac29a4c4136249c40a3763dc114
-0,        300,        300,        0,    57624, a735d341d7df9dcd0b6e51a82b813f61
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-196x198 b/deps/libav/tests/ref/fate/vp9-03-size-196x198
deleted file mode 100644
index b328ab4..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-196x198
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    58212, d2bd2dfaf2ac22b3f2499844f228d89a
-0,         33,         33,        0,    58212, e066448baeb39da04b22d4d2ebd27b0a
-0,         66,         66,        0,    58212, aace53c0ecca2596c51dd5e70da7abc4
-0,        100,        100,        0,    58212, 077256d024ab101918d10ae61142f203
-0,        133,        133,        0,    58212, e2bfdad36b0365d41dc6813a371111ee
-0,        166,        166,        0,    58212, 17495af68b0a2c075899849382f3b046
-0,        200,        200,        0,    58212, 7853db163344798e5c37672adaac92d8
-0,        233,        233,        0,    58212, 7b2ee2e1ca709c58457c7d818e47c95c
-0,        266,        266,        0,    58212, f7eb3ce10561628f932861358a30b414
-0,        300,        300,        0,    58212, 3182374f5aa539fd0faa44ed4a7492e5
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-196x200 b/deps/libav/tests/ref/fate/vp9-03-size-196x200
deleted file mode 100644
index 0aed802..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-196x200
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    58800, b2f2ac3e3833ae1b4dd075fe00210373
-0,         33,         33,        0,    58800, c0cce05e56a07111fe62553fa3a87074
-0,         66,         66,        0,    58800, 626aab3de03242073e03504e166b4697
-0,        100,        100,        0,    58800, 574d2c810f0bbfac57f1f06c2b97445c
-0,        133,        133,        0,    58800, 7d5bc5860bd1422d08396fe080452099
-0,        166,        166,        0,    58800, 5d47bbfb0f5cdecfe8415ca2caddc206
-0,        200,        200,        0,    58800, fbef6a0fa51029d0475975945ccf4b36
-0,        233,        233,        0,    58800, c9179c153bcb2a8e9d17ed04e5e2c39c
-0,        266,        266,        0,    58800, 107d796592cf2140d4d492beadba2d68
-0,        300,        300,        0,    58800, eee46f9ee67fc1121bffb63aeb7c768f
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-196x202 b/deps/libav/tests/ref/fate/vp9-03-size-196x202
deleted file mode 100644
index 9f8c3f2..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-196x202
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    59388, 7109d2ef160828ece26337f36fcfc092
-0,         33,         33,        0,    59388, bdaa6612f81a956d9b20d55a04df8346
-0,         66,         66,        0,    59388, 15eb75495d2713a64415b990b058d5ca
-0,        100,        100,        0,    59388, b997c84553475ba84e8ba3d7ee19ae4e
-0,        133,        133,        0,    59388, 63a8badd691bcf643cf676d029ce8a6c
-0,        166,        166,        0,    59388, b8ca23d9b3418c4c36040a215b2b7917
-0,        200,        200,        0,    59388, 1be0da18386c35e4a5e5d5d32d9a4468
-0,        233,        233,        0,    59388, e75a03fa70fe7e6b3a8d8ce7dc8305f1
-0,        266,        266,        0,    59388, cbd2b60df9209025c8e890771a05321d
-0,        300,        300,        0,    59388, c655d6fcc3333917b66358a9ac2b1357
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-196x208 b/deps/libav/tests/ref/fate/vp9-03-size-196x208
deleted file mode 100644
index 2e68802..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-196x208
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    61152, efa2a2a76a0fe709a78e491346cfcf29
-0,         33,         33,        0,    61152, 97de85e21b408878853fa870104707d7
-0,         66,         66,        0,    61152, 419bd1157e156d3059190d6b561c57dd
-0,        100,        100,        0,    61152, fbb6e01c524fc7c8007c6cfe2c64f467
-0,        133,        133,        0,    61152, 7453994c2e9901fa23f295ec0b556f9c
-0,        166,        166,        0,    61152, ba39dc984789fa2c4b833cd88013cc97
-0,        200,        200,        0,    61152, cea5061cac1be18d5f9a9301a5460491
-0,        233,        233,        0,    61152, 1c583018c425b1a91949e0c3eb0a4152
-0,        266,        266,        0,    61152, b48be02280ac6f97731af69bcf18de25
-0,        300,        300,        0,    61152, 6f8ab465214d8374c9ff77b939da333e
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-196x210 b/deps/libav/tests/ref/fate/vp9-03-size-196x210
deleted file mode 100644
index 7d24b47..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-196x210
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    61740, fccc18714a9ed3840bd6e9c6ca4858e5
-0,         33,         33,        0,    61740, a8f6eb43cf6ed670eb180c5051de06f7
-0,         66,         66,        0,    61740, 6a9baf9eae6e799deaefd6e801f7ace3
-0,        100,        100,        0,    61740, 3bb44c8a45aab088c9887c11bc6a4acf
-0,        133,        133,        0,    61740, 0907a7e926be9e54bbb087251b4715d9
-0,        166,        166,        0,    61740, 10fef2876c20eb3f9570c0c23e5acc69
-0,        200,        200,        0,    61740, ffe5d2b6d874af0f878075c97940ccfb
-0,        233,        233,        0,    61740, d10fae10144ff88075048827203f7e9c
-0,        266,        266,        0,    61740, bdf35736ac625f2178902c1f24d513c0
-0,        300,        300,        0,    61740, 30882bf2c21785be6234b637c4b16b28
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-196x224 b/deps/libav/tests/ref/fate/vp9-03-size-196x224
deleted file mode 100644
index 152de0d..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-196x224
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    65856, 13263674ea5aa619250dfd139bda872f
-0,         33,         33,        0,    65856, 39f5cbd8917f2b3a1df8cf2b786266de
-0,         66,         66,        0,    65856, f9aade31f9e3065f3d5b8645ef099ac6
-0,        100,        100,        0,    65856, 124f9664380f092e692b5e881f5a8fcc
-0,        133,        133,        0,    65856, e8e040e417830f5e911537828ace21b7
-0,        166,        166,        0,    65856, 84ce09882b9c184a787e8022e6d8c8de
-0,        200,        200,        0,    65856, b1397fd91814e4fdc4f75c89161ced26
-0,        233,        233,        0,    65856, d64f39d64d248f0223ed359e092d46cb
-0,        266,        266,        0,    65856, e04ee663dcc52eebd74255671c6f4ec9
-0,        300,        300,        0,    65856, 955303cb73bf072c693f37d9778ca2b6
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-196x226 b/deps/libav/tests/ref/fate/vp9-03-size-196x226
deleted file mode 100644
index 974ab53..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-196x226
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    66444, 5cb240f10761f59687612ed589759800
-0,         33,         33,        0,    66444, 9d8d5b57336ddfa5c9c5100a0302197d
-0,         66,         66,        0,    66444, 9db74997d23b16f527c63e88795331dc
-0,        100,        100,        0,    66444, 52758cd901533e790334d464bee516da
-0,        133,        133,        0,    66444, 40e671b9b85d07b13acba85eb64bbbaa
-0,        166,        166,        0,    66444, 8524b2cd2c9bb3e41c6167f8269e75d2
-0,        200,        200,        0,    66444, ff194ad6fa180fde86cc05a99c0580ec
-0,        233,        233,        0,    66444, 22ab303cb37745a73c227cd7d1c70003
-0,        266,        266,        0,    66444, 01986c58e82e0b5194418f5b75a8599c
-0,        300,        300,        0,    66444, eedfc9c14cbf3fa10402dbed52103848
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-198x196 b/deps/libav/tests/ref/fate/vp9-03-size-198x196
deleted file mode 100644
index 595299e..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-198x196
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    58212, c980866a6f17d4107ce128ee112d74cf
-0,         33,         33,        0,    58212, d4d5d2a10e73f1d09919355dc4d63d48
-0,         66,         66,        0,    58212, 82c76ed020acb68ff9d8bd81899aa6f8
-0,        100,        100,        0,    58212, 8330705fa354fb5838af56dcf9cc0980
-0,        133,        133,        0,    58212, e47b63d839a592e6372d18249bf5bc0c
-0,        166,        166,        0,    58212, b6095b6f752a50e96cab52e7c3fd52f3
-0,        200,        200,        0,    58212, fc4786f48b6ee31043d94f79c5c8a54f
-0,        233,        233,        0,    58212, 7d3d06c96496bd5ab44fe5489877771d
-0,        266,        266,        0,    58212, 5b96de089a9faa2dc01697fe9dd97f7f
-0,        300,        300,        0,    58212, d7361203b4c264067dcb7bf6912e8df2
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-198x198 b/deps/libav/tests/ref/fate/vp9-03-size-198x198
deleted file mode 100644
index 890dd9c..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-198x198
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    58806, ee0760611da9938e72f551d219671c76
-0,         33,         33,        0,    58806, c512cb8a864c25318254438c7170f373
-0,         66,         66,        0,    58806, aaea10aeb7dfd1f9f6dc77adccfcd56f
-0,        100,        100,        0,    58806, fb4e68ce202d9c6ecbddc6fe50b1cd7b
-0,        133,        133,        0,    58806, 57a803d02f0d71ec4c3c17a112574525
-0,        166,        166,        0,    58806, 526d0beaf7ef721c3a6ae8bf3505fd78
-0,        200,        200,        0,    58806, 972ab31f81dbb79c2273bcfc98569e8b
-0,        233,        233,        0,    58806, e1f05d62691bd1a9494d57449417415c
-0,        266,        266,        0,    58806, bc39a559b25e5a1ac698e0101bd6bf29
-0,        300,        300,        0,    58806, 04caed04ac21c76af873e21899860fb2
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-198x200 b/deps/libav/tests/ref/fate/vp9-03-size-198x200
deleted file mode 100644
index 2535ceb..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-198x200
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    59400, fb0e8171b0f91d9b2ceb5430db27a67b
-0,         33,         33,        0,    59400, 73f121e6aa0e6290cfd06ac9b033c772
-0,         66,         66,        0,    59400, 4113897efc44f49f5169a579bee03596
-0,        100,        100,        0,    59400, aec1d4cf1a15e12b689980cfe136d5d6
-0,        133,        133,        0,    59400, 1322af65f647254330120e67ddae38bd
-0,        166,        166,        0,    59400, 5d28c1684451812c9db41433e6286d85
-0,        200,        200,        0,    59400, 33843fc49d1d8655520c2f42332222ca
-0,        233,        233,        0,    59400, 92a8125d8c75eaf6159d5f431c5c71bf
-0,        266,        266,        0,    59400, 5bc96553842f65a3e37f012b72b580f5
-0,        300,        300,        0,    59400, de5eb6299ee5034dc3b01cdc94bf810a
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-198x202 b/deps/libav/tests/ref/fate/vp9-03-size-198x202
deleted file mode 100644
index ba4d425..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-198x202
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    59994, f5e1cf4cc56742fadddf42189a3f65e3
-0,         33,         33,        0,    59994, f3e8ca2c8deb29a6b5bfe415b39c901e
-0,         66,         66,        0,    59994, 89c513049e41e145bca46a7f7119567c
-0,        100,        100,        0,    59994, 419089035739e84f1aa14ccdf34edcb1
-0,        133,        133,        0,    59994, 4962c98c23b16b9257869a8ad5138731
-0,        166,        166,        0,    59994, fde9e858ec895c36c2d8071e69f68db6
-0,        200,        200,        0,    59994, 42e1271915f31a00be3627fa866ce3ee
-0,        233,        233,        0,    59994, c15f794933f913861a6d0041ff2fccdb
-0,        266,        266,        0,    59994, 35dab245ba952dc6fddc1a9668c30b28
-0,        300,        300,        0,    59994, 30bb4ef77cdde9cf5aea0f1287183b23
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-198x208 b/deps/libav/tests/ref/fate/vp9-03-size-198x208
deleted file mode 100644
index 49fea91..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-198x208
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    61776, d45b561f81cbfcca8a1dddbc2bf8ca31
-0,         33,         33,        0,    61776, 3664f63b2e59e380622caadb7a05545e
-0,         66,         66,        0,    61776, 0662fa199512320704efecc10af1aaa4
-0,        100,        100,        0,    61776, d8dc00882e73be89d0585663892cbcff
-0,        133,        133,        0,    61776, ff64b8d50b7c5b484a06dab09a26147c
-0,        166,        166,        0,    61776, 1771b6a55112eb7ea10885d1390339cc
-0,        200,        200,        0,    61776, 0d5944e8a13e3c2faffb562bbe2671a8
-0,        233,        233,        0,    61776, 744bed3a88407b75a8ff27a1b0cec64e
-0,        266,        266,        0,    61776, 3887415f2ab10d2a265c4a413e7060b9
-0,        300,        300,        0,    61776, 7dd683019b19b464bc0436f41e0b7c87
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-198x210 b/deps/libav/tests/ref/fate/vp9-03-size-198x210
deleted file mode 100644
index 899fd50..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-198x210
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    62370, 8525a27170982c059d5904c1af3b43fb
-0,         33,         33,        0,    62370, c4eb329733913360384d3917a58f6f36
-0,         66,         66,        0,    62370, ec118b87c9cba0e4bd89fd43567cca4e
-0,        100,        100,        0,    62370, 7e57c6caba7924823977e2c9bc11f7fa
-0,        133,        133,        0,    62370, f77ffb7228a5eda848acc40ff636ecad
-0,        166,        166,        0,    62370, c5dddafbe3badcbbcaaebe97076e0394
-0,        200,        200,        0,    62370, 34d69ae2e5b4c4fbcc51627237c9abc5
-0,        233,        233,        0,    62370, d9c63fa8b18d6c54e5fa31db866c06cc
-0,        266,        266,        0,    62370, 7ab392764a399328bf35977539e3148a
-0,        300,        300,        0,    62370, 7fbb7bae3ec775298aaa49a286dfb9d1
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-198x224 b/deps/libav/tests/ref/fate/vp9-03-size-198x224
deleted file mode 100644
index b972f6a..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-198x224
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    66528, 5f69230bfd8bb485bd85552b18339fc0
-0,         33,         33,        0,    66528, f5c365774fc1d0bffd5025ce2e931aaf
-0,         66,         66,        0,    66528, 2898234103c3624e6470ae82c916e000
-0,        100,        100,        0,    66528, d82a7fa705180b68a8ee8cb7de0cdd2d
-0,        133,        133,        0,    66528, 144a162d418deae62883a2cc4c341b4c
-0,        166,        166,        0,    66528, b3419a48385e42ca15717289ff2daa1c
-0,        200,        200,        0,    66528, d6306b5737f88f989bf2e6a1084a94fe
-0,        233,        233,        0,    66528, 5669761d7417b52b3cf81d44a13e3fb7
-0,        266,        266,        0,    66528, 3f730b8658d7a6657d1af38c75357512
-0,        300,        300,        0,    66528, 27df68d515148f732325bf821037d59f
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-198x226 b/deps/libav/tests/ref/fate/vp9-03-size-198x226
deleted file mode 100644
index 4f622cd..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-198x226
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    67122, 412c33a8fd71c99e68e6701b050b107c
-0,         33,         33,        0,    67122, 8e69483ff8a094096dd550b30be20dde
-0,         66,         66,        0,    67122, b8df87ab3d2613be31a3743e34d7e794
-0,        100,        100,        0,    67122, ec4b08a4014950f1fe04e83f8a790af0
-0,        133,        133,        0,    67122, 030da2b60627d879730108826ce6632c
-0,        166,        166,        0,    67122, 03aab0c9b4d75bc0b47fa5237e9efe3d
-0,        200,        200,        0,    67122, fd01e369df258f340eb8e486c07ae136
-0,        233,        233,        0,    67122, 1c301f0e60c96008fd7b6e8de1ebaa29
-0,        266,        266,        0,    67122, 912723f43b2b36366c3e6ab122d31801
-0,        300,        300,        0,    67122, b2774a66f7aa0fb7dd7e64b0d67818cd
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-200x196 b/deps/libav/tests/ref/fate/vp9-03-size-200x196
deleted file mode 100644
index b0b7ee2..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-200x196
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    58800, 651a0627c6cdaee8b46e1f8c4121a368
-0,         33,         33,        0,    58800, 3e63075148df16f69c933cf6c63e078c
-0,         66,         66,        0,    58800, edf18e52b7d52af2bb7594ed358542d8
-0,        100,        100,        0,    58800, 30284124756d00d10f4f8428206ceab8
-0,        133,        133,        0,    58800, 6f6ecde53cd0ea5298f4529d396460c6
-0,        166,        166,        0,    58800, 0431d389278957fbef3e72f69f3ce008
-0,        200,        200,        0,    58800, a047c60c4c60d2ea1f79c86dc98cdf8e
-0,        233,        233,        0,    58800, dceda8bf128a8cdcadfa6c5db49cde51
-0,        266,        266,        0,    58800, d8a6283637f5abda17e0bf150eac2983
-0,        300,        300,        0,    58800, 33dca31ef26fdd0daf9971c8de685d01
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-200x198 b/deps/libav/tests/ref/fate/vp9-03-size-200x198
deleted file mode 100644
index f7c7c3f..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-200x198
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    59400, d4b3578d800c747bcabaa484a140ffb0
-0,         33,         33,        0,    59400, a40f6f8c384c5dc3d5546d960bb6d9e5
-0,         66,         66,        0,    59400, e270ae8754d9906dd88b1c7d05280801
-0,        100,        100,        0,    59400, bde7fde5012840c5e188f3b29f4f0003
-0,        133,        133,        0,    59400, 8f8510c1130615b64fb8469af66ff678
-0,        166,        166,        0,    59400, 79b9d4e0c64f82a6e9540394222a593d
-0,        200,        200,        0,    59400, 34852ac9ca5c6bfa51736296784343c7
-0,        233,        233,        0,    59400, b055218509dbed644113642f8f0ac8a8
-0,        266,        266,        0,    59400, 1628866b436f1c4b892474025226e545
-0,        300,        300,        0,    59400, 3fdec760c04e30c90e74afb38dbf757c
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-200x200 b/deps/libav/tests/ref/fate/vp9-03-size-200x200
deleted file mode 100644
index 6f45370..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-200x200
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    60000, b339f4e563afadb25f43b8c05b12dc03
-0,         33,         33,        0,    60000, 3bd5280e7fb42400085b0b1dbba1905e
-0,         66,         66,        0,    60000, acf1c84cabff763fe2073d2c1f183bfc
-0,        100,        100,        0,    60000, eaa4983b6baf907efb11d137644569d2
-0,        133,        133,        0,    60000, 8a1871c8dc38a19dfd4ac571ad7f39be
-0,        166,        166,        0,    60000, 0be539bd51f5f364828dd0abc70360be
-0,        200,        200,        0,    60000, df60622d2c9f294f61d738be9e3bd16c
-0,        233,        233,        0,    60000, 22b3f1d51ddf92c7d2add305ba0ef405
-0,        266,        266,        0,    60000, 01ba29be721e64a5a50526de0797c7d3
-0,        300,        300,        0,    60000, 7b7aa7fa0e58202b3104671375762587
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-200x202 b/deps/libav/tests/ref/fate/vp9-03-size-200x202
deleted file mode 100644
index 3657e80..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-200x202
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    60600, c4a13df44e66f06961dd72fc990439e9
-0,         33,         33,        0,    60600, 81c73b8d3806ad96af8f422914a253f8
-0,         66,         66,        0,    60600, 05f77526125e802be9cb306e375ded6e
-0,        100,        100,        0,    60600, ab2e224840ff89abec2c675a23a73094
-0,        133,        133,        0,    60600, c30f58f88819eb57102678b169e15188
-0,        166,        166,        0,    60600, 33e5e2799eb4a9c548c8372fd6769db9
-0,        200,        200,        0,    60600, fa53c1c7e60bd1d00335af542ec69ed7
-0,        233,        233,        0,    60600, 534cafe658af10a314d6d084e55b3620
-0,        266,        266,        0,    60600, 502529e4fbecc8b890abf665fa21f53c
-0,        300,        300,        0,    60600, bf1f73c6e77370bc51a770c8ae87bd12
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-200x208 b/deps/libav/tests/ref/fate/vp9-03-size-200x208
deleted file mode 100644
index cd47b57..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-200x208
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    62400, 702748bec18c500dd41d93ae74b11d56
-0,         33,         33,        0,    62400, 4fb542190dab2fd673724d47451ff6ee
-0,         66,         66,        0,    62400, dbb4d27d52797dab67e39d32092c9d44
-0,        100,        100,        0,    62400, e4a0ed1572207b7ba433896bba711148
-0,        133,        133,        0,    62400, 28ec32bc165f4f9d455efec8a7aa8737
-0,        166,        166,        0,    62400, a95910575a6423abffb28ca38c384b34
-0,        200,        200,        0,    62400, 791f1c558c5467725f4614a75a8a687e
-0,        233,        233,        0,    62400, cfd3e12f84f7a811966721e890228313
-0,        266,        266,        0,    62400, 824c5fdf938551c28ac1c996645ae52f
-0,        300,        300,        0,    62400, 7465917fdd0206e393968232a0ec5193
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-200x210 b/deps/libav/tests/ref/fate/vp9-03-size-200x210
deleted file mode 100644
index 91eaa80..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-200x210
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    63000, 31ef44bd12ae702f306c55eba10d2ba7
-0,         33,         33,        0,    63000, 83e9d913f5aa058d79a81047ca45e4a2
-0,         66,         66,        0,    63000, b5e21313b859f1e2c67aaac5fefc9f68
-0,        100,        100,        0,    63000, 959d63c1b219c3479af673a9a8b8d82c
-0,        133,        133,        0,    63000, ffcfaf42b69c7cd92f6e3c21987ff7df
-0,        166,        166,        0,    63000, e9667d3ee4d8179da44de4fbffcb7df2
-0,        200,        200,        0,    63000, 5e2c841bcf4ec6f3a05020d36986fe5b
-0,        233,        233,        0,    63000, 19fe287c30bd4c90b00a9631409568c0
-0,        266,        266,        0,    63000, 58a8843e50b19860a0a91e1e1bb63bfd
-0,        300,        300,        0,    63000, 0ebd31e18597a567f96645acbb2500cf
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-200x224 b/deps/libav/tests/ref/fate/vp9-03-size-200x224
deleted file mode 100644
index 14f52f6..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-200x224
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    67200, 315d69847bf752a84231a368278eb0b6
-0,         33,         33,        0,    67200, d245738f8627fc345ab38a547bc7d352
-0,         66,         66,        0,    67200, 982681cdca448919c2eead94435772ad
-0,        100,        100,        0,    67200, 7b67b2d96476e17cd407bbccb19fd070
-0,        133,        133,        0,    67200, c38dde73ca097049d1fc689e18a49b5d
-0,        166,        166,        0,    67200, 525f323b81d780c669a03655bb0d0b56
-0,        200,        200,        0,    67200, 5dbeb96f65e383771c1c877ec559044a
-0,        233,        233,        0,    67200, 7d96e976265ef0f9faf173376caaa9e9
-0,        266,        266,        0,    67200, 6047c805a724701b80a133486aae0e65
-0,        300,        300,        0,    67200, eb8895dd994076a52aa3a0c1758ccbb7
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-200x226 b/deps/libav/tests/ref/fate/vp9-03-size-200x226
deleted file mode 100644
index 97e600c..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-200x226
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    67800, e45b6b9dce4a8509b7d26bc3cfdf7c86
-0,         33,         33,        0,    67800, ddb9d5033ecfa2d6e9a5505dce374bda
-0,         66,         66,        0,    67800, 52c495d3137143e0bce9382fe5506057
-0,        100,        100,        0,    67800, d09f3d6ad084f2966196acd48246f951
-0,        133,        133,        0,    67800, 1556d006d0119a3172b98a500b27f8d0
-0,        166,        166,        0,    67800, 904f86cfbcc3fa683d3d7744a286cd88
-0,        200,        200,        0,    67800, b35907456b8ccab0ae8efc8405b04c89
-0,        233,        233,        0,    67800, b7f2648fe0f873f7e9ea4a6d913e45ec
-0,        266,        266,        0,    67800, 2da76544bc7e295486c335e17047e12e
-0,        300,        300,        0,    67800, 10fd6424caf837d37564ef15f1c6f93d
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-202x196 b/deps/libav/tests/ref/fate/vp9-03-size-202x196
deleted file mode 100644
index c224ef0..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-202x196
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    59388, 1261466179df96099e598e46c50fa7c1
-0,         33,         33,        0,    59388, cc0fe373cd0399cf0c95edf92d9ab01f
-0,         66,         66,        0,    59388, 7a2dc0afd06ecfcf54321fb759f57601
-0,        100,        100,        0,    59388, db9c138503d27f87449f870ab07cab03
-0,        133,        133,        0,    59388, ddea2e5e2659e97132a537566d5ed989
-0,        166,        166,        0,    59388, c31e90b5eee032526c4e0603332fd160
-0,        200,        200,        0,    59388, 7e5b40f03b905d9ee749d3097a484ea0
-0,        233,        233,        0,    59388, 93e9f7defa94ff03c041448ae1e55cea
-0,        266,        266,        0,    59388, aef8e03f0146699faa16ec28dea49dbe
-0,        300,        300,        0,    59388, a651d949b4c8f0e455c6592dc98385f7
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-202x198 b/deps/libav/tests/ref/fate/vp9-03-size-202x198
deleted file mode 100644
index 96a3a1f..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-202x198
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    59994, 181edc4ebeeff7f0527b93b84d5d8efb
-0,         33,         33,        0,    59994, 132c71b634fb67eed51fcdef1775b6b2
-0,         66,         66,        0,    59994, fd41144770765fc893adc5843ebe32e4
-0,        100,        100,        0,    59994, 77dcbaea101142940b6a78a271842829
-0,        133,        133,        0,    59994, 01737c38c1ac711a9744256788211177
-0,        166,        166,        0,    59994, 31cd0b5f621daac309c6f249f4c26cd8
-0,        200,        200,        0,    59994, e06d34e570dc46904fdb9eeb55811464
-0,        233,        233,        0,    59994, 71bf55030373bde1eaeb52d1e97bfa4a
-0,        266,        266,        0,    59994, e96063ff02e8a23a666222b59391de9c
-0,        300,        300,        0,    59994, 5aa0079168ab5069e8a3064f9e2a6d8b
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-202x200 b/deps/libav/tests/ref/fate/vp9-03-size-202x200
deleted file mode 100644
index a8d42a7..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-202x200
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    60600, 20c41d4a1271183dbbc7a44e6b90ea80
-0,         33,         33,        0,    60600, bd8c1fba8d8742f4d98b7d5097c8c828
-0,         66,         66,        0,    60600, 55cbe06a925009c1b1f9b609b60b4c1d
-0,        100,        100,        0,    60600, 78e80c7cf1f142e2dda1bc269b5b3e00
-0,        133,        133,        0,    60600, 42ee8157a4c8af6670b81e9324b251e9
-0,        166,        166,        0,    60600, 022bdf5a2e1ea5f98503cd25b383ae53
-0,        200,        200,        0,    60600, c2073865386a991da01966878ce1ce6d
-0,        233,        233,        0,    60600, 6a5b95cd4eff0836b9180a25f663d36a
-0,        266,        266,        0,    60600, 5e5498c357340d4755dc98eb0669f103
-0,        300,        300,        0,    60600, 0907d5e4020111b1ecfe707df71bcd8a
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-202x202 b/deps/libav/tests/ref/fate/vp9-03-size-202x202
deleted file mode 100644
index 9867cc7..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-202x202
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    61206, 610cef52d35e9c641f2b8c10489c3d12
-0,         33,         33,        0,    61206, 1f84062e607d4798b0544739fe0da99c
-0,         66,         66,        0,    61206, ea379947b5c52ea3989dfc3f47c729d9
-0,        100,        100,        0,    61206, 1d06b72f06178cbb6bb5d188d22bff43
-0,        133,        133,        0,    61206, 25bd41bd7607f88a01aa0cdc336c9975
-0,        166,        166,        0,    61206, 86836a95a7a9fb1eefb20f7c5a15a9ab
-0,        200,        200,        0,    61206, d8eb3fecce1b646b9877cd4fcca9f9bf
-0,        233,        233,        0,    61206, a057e0b29e4ac9717452cc478c418c12
-0,        266,        266,        0,    61206, 9a3bab91b4f0fff174536b1609c9632c
-0,        300,        300,        0,    61206, d1cd93975f746b6cae490aae31f89e7e
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-202x208 b/deps/libav/tests/ref/fate/vp9-03-size-202x208
deleted file mode 100644
index a2a98f6..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-202x208
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    63024, d2128e290be81bb0700ebe19e3faed4f
-0,         33,         33,        0,    63024, dccaecb7e4ddb7e4224221a659af2a43
-0,         66,         66,        0,    63024, be8e0966aaf3a9fe9164f63695dc3b62
-0,        100,        100,        0,    63024, da944fadc3a239c2254678cadb4cf7fa
-0,        133,        133,        0,    63024, 3c270f3c02fcbd192b7f896f3f9ee6d9
-0,        166,        166,        0,    63024, 0b3ccda0a87c37e40104ae2f1060e8e9
-0,        200,        200,        0,    63024, 254253aba91758f302e7177e614596be
-0,        233,        233,        0,    63024, b1501a4e372a5249e74aab77e57a28f1
-0,        266,        266,        0,    63024, c4497fea1cefed5cf2b2908620153d26
-0,        300,        300,        0,    63024, 5ba20dfa2400b15b5394f315c5c3707d
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-202x210 b/deps/libav/tests/ref/fate/vp9-03-size-202x210
deleted file mode 100644
index b9fb7c2..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-202x210
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    63630, e4663a28cabbfdd3815efda2d38debcc
-0,         33,         33,        0,    63630, 3cc7dbec64e9f697f40d740a72c09fc7
-0,         66,         66,        0,    63630, f108981e0ce9c6c501b9ac61d0f1ba44
-0,        100,        100,        0,    63630, 63191c7aceb8ac6b030cc1a4b3cda18c
-0,        133,        133,        0,    63630, b0a527ae3aafe94d13573199c6f4944f
-0,        166,        166,        0,    63630, 1be14b213ebf1d653468b8c16bae03fb
-0,        200,        200,        0,    63630, 44e5a8333a043cd93b9d1cc78e5f188f
-0,        233,        233,        0,    63630, bfd7619f990f20e23b47d0738a6a8449
-0,        266,        266,        0,    63630, 800405f45ca5198014ef8d8521b044fa
-0,        300,        300,        0,    63630, dca4eda872349708f54486433efc8225
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-202x224 b/deps/libav/tests/ref/fate/vp9-03-size-202x224
deleted file mode 100644
index 9a6b9da..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-202x224
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    67872, 1d318f05310f6d40646f23c62c7eafe4
-0,         33,         33,        0,    67872, 42870bd73e1a0c5d84b986db3d24f0f0
-0,         66,         66,        0,    67872, afaac676150286143c6fec7992a81467
-0,        100,        100,        0,    67872, 128f84400c272628e802c2369b6bf548
-0,        133,        133,        0,    67872, 9adc24d69f12349d8b17c84f5c111767
-0,        166,        166,        0,    67872, b33d2f7a1955248652701f2ade8ab55d
-0,        200,        200,        0,    67872, b8acc23721097fce6c8835f5fcfaa6ee
-0,        233,        233,        0,    67872, b63bf9a08e4dc5879bbd91efaec95960
-0,        266,        266,        0,    67872, 96e8fe29935266f6bd486b99f917eabc
-0,        300,        300,        0,    67872, 54be14f8dde6857867cd4581f8557044
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-202x226 b/deps/libav/tests/ref/fate/vp9-03-size-202x226
deleted file mode 100644
index 38d2e60..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-202x226
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    68478, 5aa0f439c58c6335cd86d4238a8c4b68
-0,         33,         33,        0,    68478, 3616cc306ec05f89d9b0db63200e4abf
-0,         66,         66,        0,    68478, 424e98f8ec0ebf2a326a917ee0159bbe
-0,        100,        100,        0,    68478, ed5710e412f056fa8c1a277d86dd45d7
-0,        133,        133,        0,    68478, 760b850feab485f0bda6cde9943102bc
-0,        166,        166,        0,    68478, f4bd90ca72aa707f9b68e6192ac230fd
-0,        200,        200,        0,    68478, 58e4aad0bc2a9f3fc279df10208bd6f6
-0,        233,        233,        0,    68478, b42f84723dd167d5c544d539275ad537
-0,        266,        266,        0,    68478, 5f54feca21331646e68797380260932a
-0,        300,        300,        0,    68478, 8e787dd318024aff25af8b4d85040f3c
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-208x196 b/deps/libav/tests/ref/fate/vp9-03-size-208x196
deleted file mode 100644
index a541f14..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-208x196
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    61152, 6195975181969789e101a83a555d13f7
-0,         33,         33,        0,    61152, 2aca5e3307d68a5e969564a943b8e723
-0,         66,         66,        0,    61152, aee4b00472ee0b6b7a13e31069181db4
-0,        100,        100,        0,    61152, 7808595b650a7c14d8a4800db7c014e0
-0,        133,        133,        0,    61152, 746eb763b176286aa875ae06b81118c4
-0,        166,        166,        0,    61152, 0e8a78ec061319e27d49ca25e333e017
-0,        200,        200,        0,    61152, ac4432db2bb0971d5f70a7dda1210c19
-0,        233,        233,        0,    61152, 78870f4bd767f8ab65d369a5b322735d
-0,        266,        266,        0,    61152, eee9ddd91209348a64259db6a4a3f80c
-0,        300,        300,        0,    61152, c48d21e36a9c0d0d1c64db3f776b3002
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-208x198 b/deps/libav/tests/ref/fate/vp9-03-size-208x198
deleted file mode 100644
index 2236687..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-208x198
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    61776, 1f1fa3cdf865d8c75183f4ba6203b675
-0,         33,         33,        0,    61776, ead33ead8fea5bd5d831a79f4c75a590
-0,         66,         66,        0,    61776, 9a406b4464989fd4bb7cbcb1b18aeaa7
-0,        100,        100,        0,    61776, fab3d228e7032f2cdc440dbfcb17c4c1
-0,        133,        133,        0,    61776, f2f3f8b8d9ece21c359c89245157c613
-0,        166,        166,        0,    61776, 321f5a8ecb2cec1780013fe72c237bde
-0,        200,        200,        0,    61776, 6f025b1f4ef61d261f05ca149a9470e6
-0,        233,        233,        0,    61776, 85abcc8d8e6b5f286ed6aa6c588cf416
-0,        266,        266,        0,    61776, b28d710dd44389f774aa02edd6327d5c
-0,        300,        300,        0,    61776, 79374bef9819eecafa7396d70c80be7f
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-208x200 b/deps/libav/tests/ref/fate/vp9-03-size-208x200
deleted file mode 100644
index 5f924a3..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-208x200
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    62400, ff2dda3ddbe8b461d960baba0ad132bf
-0,         33,         33,        0,    62400, d6935ac8f2250316f498e8f01afa04fd
-0,         66,         66,        0,    62400, 57173ebaef7b21698c62fa959cb40ead
-0,        100,        100,        0,    62400, f354c76d7cf45e9f3adfdde0f6b3b5c9
-0,        133,        133,        0,    62400, fbc968ecd214b01509a76996e45dd09a
-0,        166,        166,        0,    62400, 9c314b51a80f2a081adf9b9cc26f5f8a
-0,        200,        200,        0,    62400, f22883a6a5b74ffa4bb16f22d496b5a5
-0,        233,        233,        0,    62400, eb4fa914fc5658d43e32c48a0c39bab3
-0,        266,        266,        0,    62400, d763c0c2f44b68e1e3fe9e165334eb0b
-0,        300,        300,        0,    62400, 344e1075a48cd61e79b0550809b4c91f
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-208x202 b/deps/libav/tests/ref/fate/vp9-03-size-208x202
deleted file mode 100644
index b5373d5..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-208x202
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    63024, e5164f87feadf4b65257f578affc3e04
-0,         33,         33,        0,    63024, 6aee5a3b6c3a096dfc1594762b2b248f
-0,         66,         66,        0,    63024, cb1c9dce6fdf7372e0eb2397251f0ade
-0,        100,        100,        0,    63024, 4fe5f24c08690c966b6a14ac3422510b
-0,        133,        133,        0,    63024, b22a273814523251b365f3278d8a3a9c
-0,        166,        166,        0,    63024, 190d9dff373023a25427fc859545ea24
-0,        200,        200,        0,    63024, a6307f38718ed686cb195e3833ab27ab
-0,        233,        233,        0,    63024, 79630bec5a91d69aca42a910413c2800
-0,        266,        266,        0,    63024, 2231cec9c03714b8671e5e1456b148c9
-0,        300,        300,        0,    63024, 278458f6734a24f2eb9bc877a6e9d7df
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-208x208 b/deps/libav/tests/ref/fate/vp9-03-size-208x208
deleted file mode 100644
index aa5bc3c..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-208x208
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    64896, 6bff7c1f4c5ef8412ebf669852c70de6
-0,         33,         33,        0,    64896, fdfd7a2308de9509a41fed2880a8f0f5
-0,         66,         66,        0,    64896, d8b464811e9c3b8a6db9cc277ac88c59
-0,        100,        100,        0,    64896, b8fa29e79be3126dd74310d6dd09c747
-0,        133,        133,        0,    64896, dad29803fed686887a0873eb78a469c6
-0,        166,        166,        0,    64896, 684de29bbf800f52aea4af9850bcc5b3
-0,        200,        200,        0,    64896, 06862dbce7571b4487766b179a596e1d
-0,        233,        233,        0,    64896, 99582a966bc7070112e214ce7912e485
-0,        266,        266,        0,    64896, a61158581a5719cb0cf13fb3301cb8c4
-0,        300,        300,        0,    64896, 9c2295332f34fee3a249262c8ba843bc
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-208x210 b/deps/libav/tests/ref/fate/vp9-03-size-208x210
deleted file mode 100644
index 0477efa..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-208x210
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    65520, b15c7e98ddd137237b062cb51667522f
-0,         33,         33,        0,    65520, 00c594c68b19ef39a79a38e86853dc64
-0,         66,         66,        0,    65520, e6742abe3d2c178af4298e121391c299
-0,        100,        100,        0,    65520, efe5387b38c32f1c25c0fc9836921074
-0,        133,        133,        0,    65520, e0e696f4c18af09a74e052903db1468c
-0,        166,        166,        0,    65520, f1960270c6704ca47caed63161716025
-0,        200,        200,        0,    65520, a1542d7749cfa447481acd7835db838a
-0,        233,        233,        0,    65520, a91fb10a17d1d056667860cc43c81dae
-0,        266,        266,        0,    65520, b673bfbb722522b4e7b5e9c5b85cc31f
-0,        300,        300,        0,    65520, 8b4bb57d3cf609cbf9564a96a6ca6ade
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-208x224 b/deps/libav/tests/ref/fate/vp9-03-size-208x224
deleted file mode 100644
index 18ed456..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-208x224
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    69888, 479d07bb96905ad7d5f0ec3ee12b41ba
-0,         33,         33,        0,    69888, 4b6555aaed8e5a45879773f1bf87962e
-0,         66,         66,        0,    69888, c5f42cb796dd7b6622957016ca6b502f
-0,        100,        100,        0,    69888, f06c954483560866fbff10bae7ba0785
-0,        133,        133,        0,    69888, af83aff39999852310395fe241ccb49b
-0,        166,        166,        0,    69888, 108377d6f30ceba6f2377330af2da38f
-0,        200,        200,        0,    69888, e81e6e0b37a7b92368ede9cab124567c
-0,        233,        233,        0,    69888, 59dbe51caaed8e6e825c78c5901fb22c
-0,        266,        266,        0,    69888, 24686123ea14c8d1a9b447733df0aaab
-0,        300,        300,        0,    69888, ce2035c49237c8076f8dac0d3f61848e
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-208x226 b/deps/libav/tests/ref/fate/vp9-03-size-208x226
deleted file mode 100644
index a7a1981..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-208x226
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    70512, 33aa4af6153570518c59960a0c959053
-0,         33,         33,        0,    70512, 024fa27dee80ad199528052aaa8d42c7
-0,         66,         66,        0,    70512, b949ef118c7e7e62a8b88e2308219ef9
-0,        100,        100,        0,    70512, 3061ee13696ced5e10a646fdd5ca6c34
-0,        133,        133,        0,    70512, c4984bd53dcb7b9e2570f2965d077b2f
-0,        166,        166,        0,    70512, d564c35c5caadcfd9f80377fa414af72
-0,        200,        200,        0,    70512, 9b7d7b10ee2f3eb7a9ffddcebff45b97
-0,        233,        233,        0,    70512, a0ede7085b04cbb3519d56b2e4347d14
-0,        266,        266,        0,    70512, 63d7af745f9e6a34b618db28fe878ffd
-0,        300,        300,        0,    70512, 85077809087e7bdfb9215bfcd1f1bbc0
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-210x196 b/deps/libav/tests/ref/fate/vp9-03-size-210x196
deleted file mode 100644
index 0db3b00..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-210x196
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    61740, 5c69f80da667bfd20394995e93e4cd2b
-0,         33,         33,        0,    61740, 13363cd8e52ca8c1053db1c84c111bc9
-0,         66,         66,        0,    61740, 108976afdf99f59276d6f89879e3bdc3
-0,        100,        100,        0,    61740, 770ce25985e6b479d52a9185876cfe83
-0,        133,        133,        0,    61740, eba7cbb3c91989aa4c13487ed01675b5
-0,        166,        166,        0,    61740, f391c30a47c33a250dd20cb12f0a6e01
-0,        200,        200,        0,    61740, c38e12de302177d19dd744a3ea227e90
-0,        233,        233,        0,    61740, 8c9370439a0b7289919c6ee68e00570f
-0,        266,        266,        0,    61740, ac3748c4b99c4f1aba7430ae12c19cfd
-0,        300,        300,        0,    61740, e5228dc84f7933ccc9306907d737ad3c
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-210x198 b/deps/libav/tests/ref/fate/vp9-03-size-210x198
deleted file mode 100644
index 3949dbd..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-210x198
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    62370, d83ee2413e701ae405a2b74863d4c5a9
-0,         33,         33,        0,    62370, f2ebc0f7dc171e0e5d2911c7ee2df5e1
-0,         66,         66,        0,    62370, e189ef4d8add227352a0d6ee62748ee7
-0,        100,        100,        0,    62370, 6dcb1dca1a0e2ba85034aba9f021427e
-0,        133,        133,        0,    62370, e98c633ba8912f6d65374055ec9af543
-0,        166,        166,        0,    62370, 82111cb7d5addce16d9bcba9e0a99503
-0,        200,        200,        0,    62370, bbbc73002f794ab0261fe384b2524226
-0,        233,        233,        0,    62370, 0bcdc427df47123959f7de9c44fe291e
-0,        266,        266,        0,    62370, 505776b3d82e38612393d60b6aa55c1d
-0,        300,        300,        0,    62370, feb93758242b847f3d53bb4c97b0ad9c
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-210x200 b/deps/libav/tests/ref/fate/vp9-03-size-210x200
deleted file mode 100644
index 9c4245c..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-210x200
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    63000, 2465560246c1ee24d937cb9cbc1422f1
-0,         33,         33,        0,    63000, 8926b628dcdf2182516822c7d0d778ec
-0,         66,         66,        0,    63000, 9bd14d3ebc7fe81c4223116de1b9c2ec
-0,        100,        100,        0,    63000, 2d029d8461c20236066c0786950540fb
-0,        133,        133,        0,    63000, 39412b6e62de43bd40c58d4e2e38daf8
-0,        166,        166,        0,    63000, 3ea211c24f606b29582147bf872994dd
-0,        200,        200,        0,    63000, 261c37f88bf7f40549642578d9464aeb
-0,        233,        233,        0,    63000, 98551d44de1e23165e05975babb72446
-0,        266,        266,        0,    63000, 1d85ad052dd27e7e6bfea5d2babf5176
-0,        300,        300,        0,    63000, ad18b6a3698a3674c2488f927810eb0d
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-210x202 b/deps/libav/tests/ref/fate/vp9-03-size-210x202
deleted file mode 100644
index 253bb1d..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-210x202
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    63630, 5d01848aee2b324f2e356627f9c39532
-0,         33,         33,        0,    63630, b671fe34bc0e5a682baff929d26ea627
-0,         66,         66,        0,    63630, e9a40f87ca5aaa5af9772e286feb9063
-0,        100,        100,        0,    63630, 4730f60d4c856e8ad877c0d8b1729ec4
-0,        133,        133,        0,    63630, 317fc01349e0984c23d15f97a3a0f442
-0,        166,        166,        0,    63630, aea89116ffe48340d1752d1ad5195529
-0,        200,        200,        0,    63630, 14694ba65b6308e5f5571486b62ca1cc
-0,        233,        233,        0,    63630, 53c6102d877c9a30eaa20ddc45207ea0
-0,        266,        266,        0,    63630, 7d1e898b1bead878224e8ff15d624bd9
-0,        300,        300,        0,    63630, 37b684bfae5dbd33e8dbb8332b94ce8a
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-210x208 b/deps/libav/tests/ref/fate/vp9-03-size-210x208
deleted file mode 100644
index 39752a9..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-210x208
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    65520, 1156d318c00d299cf5bdc7e485966dab
-0,         33,         33,        0,    65520, a8094f8f1e7e04e54251bee8c4c800ce
-0,         66,         66,        0,    65520, e2a07d99ffe1cfe6b9fce36e93677fe1
-0,        100,        100,        0,    65520, 63d179b00816dbad75b778d2c23955c6
-0,        133,        133,        0,    65520, 407de5fb2dfdd52e6173905b09ff22f2
-0,        166,        166,        0,    65520, 36900199c56310e651723de4e3ad2f2c
-0,        200,        200,        0,    65520, 908db56e975b5db07af17fdc51b12be8
-0,        233,        233,        0,    65520, 400e32490b1262009a481cc331a00e44
-0,        266,        266,        0,    65520, dc43b786cba033cc92b9921d12f7b3d7
-0,        300,        300,        0,    65520, e8c94c5965c729f5d1ef3ba4509c97c8
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-210x210 b/deps/libav/tests/ref/fate/vp9-03-size-210x210
deleted file mode 100644
index efbc81c..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-210x210
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    66150, b65725c68978bdaaafdf735dfbafa9e3
-0,         33,         33,        0,    66150, 35be2f16bd5dedc9d3f7a016f0d71701
-0,         66,         66,        0,    66150, 8c2873a97b51510d7449869e24a348f5
-0,        100,        100,        0,    66150, 724a30e8ae539e797db8889dc08aec5e
-0,        133,        133,        0,    66150, e3ae1246a63ea22afd026bfb859fe165
-0,        166,        166,        0,    66150, 7e1fa363cf3f44c7a3019f29c14a6da4
-0,        200,        200,        0,    66150, c6f26619ab5687a2a698c8766b79f2eb
-0,        233,        233,        0,    66150, be5b8c50a772afe95d72bf3cc7c4fd2f
-0,        266,        266,        0,    66150, 9eab1417ac249ce31c79750143d52084
-0,        300,        300,        0,    66150, 9d2455048dbc3cdc2343a818c5a2bcb1
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-210x224 b/deps/libav/tests/ref/fate/vp9-03-size-210x224
deleted file mode 100644
index cfa3758..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-210x224
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    70560, bb903b926c4b34ae336e21d65ad8fd25
-0,         33,         33,        0,    70560, c4c0bc3b112487e994d22176817ace3c
-0,         66,         66,        0,    70560, 24e699f7a92ab1b0fe12e0b747470b5b
-0,        100,        100,        0,    70560, 200f403694d3acfda63f52e8373f1420
-0,        133,        133,        0,    70560, 6df417a8ec1810562301c89724b739d1
-0,        166,        166,        0,    70560, 55757b633d8fe669fc0f507dab4fa9f7
-0,        200,        200,        0,    70560, 45bc82bee02cb45422be3ac1019896d0
-0,        233,        233,        0,    70560, 4aaf5d07d2796910767d5084556c9cf9
-0,        266,        266,        0,    70560, f100fa26da47250b98d95a18915f521d
-0,        300,        300,        0,    70560, f5a8def53b4638b6ce7c8588d595d0ad
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-210x226 b/deps/libav/tests/ref/fate/vp9-03-size-210x226
deleted file mode 100644
index 046f733..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-210x226
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    71190, 03707b2f5c392933f7336f380423a0a1
-0,         33,         33,        0,    71190, b388553c79573555a3b660f5e36d4e36
-0,         66,         66,        0,    71190, a1a7fd8ba7fb0fe7733cdf5440c7c1f3
-0,        100,        100,        0,    71190, 9daff7ef71dd54951f0b75a902065259
-0,        133,        133,        0,    71190, 60218a4b8bc0a5b0b40fa560a40fb4c0
-0,        166,        166,        0,    71190, 21229bfed833468fafc27ce93db1450c
-0,        200,        200,        0,    71190, 7aa290c6e503315d7aa3517258d5f63a
-0,        233,        233,        0,    71190, 63fd08ae2e859ff3d874ab2c2ce41a42
-0,        266,        266,        0,    71190, 725b371247fae28ef4b912368738df64
-0,        300,        300,        0,    71190, 7cf2d8d9e464307311b499ff0c3ea05e
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-224x196 b/deps/libav/tests/ref/fate/vp9-03-size-224x196
deleted file mode 100644
index b94c04d..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-224x196
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    65856, 3ffc096f1b42b4d319d4a9efbefc7625
-0,         33,         33,        0,    65856, 78b3655d5cad30fa6b2c2d8fd29463de
-0,         66,         66,        0,    65856, ab197553d9599b2a03aff62d1d694848
-0,        100,        100,        0,    65856, be368d1f3d3fcc710565b5433940f0df
-0,        133,        133,        0,    65856, 374c5db60ea9c110b871bb45be0efff1
-0,        166,        166,        0,    65856, ec50085400d626de5833bc0a94d9941f
-0,        200,        200,        0,    65856, d4ae69937e2a8d9bf2023d4215749635
-0,        233,        233,        0,    65856, 9b0b81eb6d62b8014e0639932fe35bc0
-0,        266,        266,        0,    65856, cd02d0cc268e6b6df0b2dbd3f3b137e6
-0,        300,        300,        0,    65856, 5322ba1085c114f93534e1761a0d8aa1
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-224x198 b/deps/libav/tests/ref/fate/vp9-03-size-224x198
deleted file mode 100644
index dfcc091..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-224x198
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    66528, cf35dffc80946e87bb9d3e18aab9d320
-0,         33,         33,        0,    66528, a76ac92f05e9b097f8ac5882e1ffe656
-0,         66,         66,        0,    66528, faa1e8a11c9df3e9c9a9dafbebea6d04
-0,        100,        100,        0,    66528, 905a28289c8ac793b335096ca7f84e1d
-0,        133,        133,        0,    66528, cb480fa6977baf98a74bddf213ecba82
-0,        166,        166,        0,    66528, 35224d3708e3ba1dafcc58b803d5ea77
-0,        200,        200,        0,    66528, d166d764e87854bca47ab7a2bc8b1f9b
-0,        233,        233,        0,    66528, 562f1e06ae36abba5f1fb53e3d6cd7e8
-0,        266,        266,        0,    66528, 1599cebef060f6464aeef15aacbde446
-0,        300,        300,        0,    66528, 3316ebca2864a9dc04db86069efb1dd1
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-224x200 b/deps/libav/tests/ref/fate/vp9-03-size-224x200
deleted file mode 100644
index f7cf72c..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-224x200
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    67200, 0819e6d715c9b4d94f05f63a7ca86199
-0,         33,         33,        0,    67200, 9b9a4b01ed4c8a93687e45245b3092a3
-0,         66,         66,        0,    67200, 3a076f5b8dba60552e84a391ee04d1c7
-0,        100,        100,        0,    67200, 7aafc561f5b96e9d286bd8deb5687774
-0,        133,        133,        0,    67200, daa43a89ab6b2761eedaa183e33a3465
-0,        166,        166,        0,    67200, c14874409872357b11b65f35a283e058
-0,        200,        200,        0,    67200, 37d2ef52a9c694b2596d58ed9ca0d90b
-0,        233,        233,        0,    67200, c97bc860c006896d80f52ccc0759f472
-0,        266,        266,        0,    67200, 5f8618114a723a017e39a1af695996f3
-0,        300,        300,        0,    67200, ee8234fc5ccd41d05eb87e1510f9795e
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-224x202 b/deps/libav/tests/ref/fate/vp9-03-size-224x202
deleted file mode 100644
index e957344..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-224x202
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    67872, e1e3b4af5910383ff6f66b6ab1a29544
-0,         33,         33,        0,    67872, 8668ef92b72f35728ebb456665d48b95
-0,         66,         66,        0,    67872, dffc7c28f86f07bf28451292990e9594
-0,        100,        100,        0,    67872, aebfb446fa6d48db36dbd9b5cd147f1e
-0,        133,        133,        0,    67872, e3c6cb8c5bb3a26928493bfc297ab827
-0,        166,        166,        0,    67872, 68dabae76c1d27ab0e1079d99cb6d413
-0,        200,        200,        0,    67872, d1f7745eef748688f3871d00a7e67ef8
-0,        233,        233,        0,    67872, 36738851cc2af83fd250dea4cd63941b
-0,        266,        266,        0,    67872, 16c0315c43427e7e6719806a89551703
-0,        300,        300,        0,    67872, c4d589c0ea4cdfc1dd6dff72084c61fd
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-224x208 b/deps/libav/tests/ref/fate/vp9-03-size-224x208
deleted file mode 100644
index b2efc65..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-224x208
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    69888, 85f08afadfd1204d4131b9ee9c8cc10b
-0,         33,         33,        0,    69888, f893de5432a082b3dffcf7499827f548
-0,         66,         66,        0,    69888, cb81e0d7b657bc5a4a9cf8ad75a76a77
-0,        100,        100,        0,    69888, 8a40842123965731c15fc23fb6366d1d
-0,        133,        133,        0,    69888, 09c6d92af14a3fcfb12705cd5da57f2a
-0,        166,        166,        0,    69888, 6bede4dc8770df534b599021b0425309
-0,        200,        200,        0,    69888, 334b0b0448e9e4e6a0cddcd2e3a0af3f
-0,        233,        233,        0,    69888, 09f491f0f3870ef96cff0384cd7183d1
-0,        266,        266,        0,    69888, c9e5f81186ac947a77b051c8f0e76eac
-0,        300,        300,        0,    69888, 917565c3327bff78b53a78ea739472ff
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-224x210 b/deps/libav/tests/ref/fate/vp9-03-size-224x210
deleted file mode 100644
index 0996abd..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-224x210
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    70560, 427421e5fd2087c6ff7b87a27982332f
-0,         33,         33,        0,    70560, b68311fd44e189e4174ac357d5415068
-0,         66,         66,        0,    70560, 2c822ff45be7a1ea412d21ff82c7bc1d
-0,        100,        100,        0,    70560, 34659186d93516eae1dd4d9a391d1c3f
-0,        133,        133,        0,    70560, 1990dd822abc3a10f511589db5aa50f4
-0,        166,        166,        0,    70560, 4a4dc076172c79d9fde3e17b47109835
-0,        200,        200,        0,    70560, 51874c79850120537fa5c405721d0107
-0,        233,        233,        0,    70560, 15d7897a128de9be90be17f1679012c9
-0,        266,        266,        0,    70560, a8d9480accf8585e94161a5f7c371cef
-0,        300,        300,        0,    70560, 8a9d3f09561b895b423ae9428f620b9b
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-224x224 b/deps/libav/tests/ref/fate/vp9-03-size-224x224
deleted file mode 100644
index fba94fc..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-224x224
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    75264, bedd5d2725ffff06a50e23841bc2dfb8
-0,         33,         33,        0,    75264, 8c363f68b0b30f507563516aa99e23ac
-0,         66,         66,        0,    75264, 9cb7d51ca4439614dc3f5980507a4d32
-0,        100,        100,        0,    75264, b393a18de28ab6b8d1c6afd67a7794e0
-0,        133,        133,        0,    75264, 81f69ee1e3d89cb78cac192c352f7741
-0,        166,        166,        0,    75264, aabb51f029a9a02e71524cf3500931e9
-0,        200,        200,        0,    75264, 6581aec620c508d2b42ccceaa2c6044d
-0,        233,        233,        0,    75264, 993cde759158c30dcf0f0a9fdcdfb0d8
-0,        266,        266,        0,    75264, 85985ae8d35514d601800a06c8226625
-0,        300,        300,        0,    75264, 0eba1d7c193e473586e4a5c87d0e0d21
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-224x226 b/deps/libav/tests/ref/fate/vp9-03-size-224x226
deleted file mode 100644
index 2bf1225..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-224x226
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    75936, dca556e648a576b3973fbe4b34d0328c
-0,         33,         33,        0,    75936, 34a49e4aba4aca5c76ab0f751341c32b
-0,         66,         66,        0,    75936, 4b7cc6d500b273efe7e30fc3a3946f74
-0,        100,        100,        0,    75936, 1960f0f1edf9196c96b0de742a3cd53c
-0,        133,        133,        0,    75936, 3cb7d90178636911c5d53a5f8e75599c
-0,        166,        166,        0,    75936, 84b56c60c2282f85102048cc2cf40b88
-0,        200,        200,        0,    75936, 3ca34d2978307ec0fca05130d81bcc26
-0,        233,        233,        0,    75936, c15560be737e02ea9d1deeca0af9bb77
-0,        266,        266,        0,    75936, 391439789a6aa7bb02d7e699795a9559
-0,        300,        300,        0,    75936, 9f681e91cbcbe9920f21236b8ff093c7
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-226x196 b/deps/libav/tests/ref/fate/vp9-03-size-226x196
deleted file mode 100644
index 9cb72d3..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-226x196
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    66444, 4757a31842453f806de2f2256329547e
-0,         33,         33,        0,    66444, fe5fb955a4143091c5bfae7c4a4afe0f
-0,         66,         66,        0,    66444, 93766c5a03d71f99afb7705add7b63f0
-0,        100,        100,        0,    66444, 30c91162aa6fb0ed3e47325146bb6d8a
-0,        133,        133,        0,    66444, 501fe67785b970b1b62c2ae0b36b19ad
-0,        166,        166,        0,    66444, 836be5e778e3d20e75c4fcd71f765b3d
-0,        200,        200,        0,    66444, 21a9fd5e78212fe71719e173844bc6e6
-0,        233,        233,        0,    66444, 81b3919208e345d93dde62740b47dd93
-0,        266,        266,        0,    66444, df010555a929ba88a2f25c6267e3786e
-0,        300,        300,        0,    66444, d2cff8282e5e7a5bbd879c73df0670c3
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-226x198 b/deps/libav/tests/ref/fate/vp9-03-size-226x198
deleted file mode 100644
index f70b330..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-226x198
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    67122, b97087eb8c53cf56dc44576912654fb2
-0,         33,         33,        0,    67122, 219bb68a59dc166806a5b5689a943b66
-0,         66,         66,        0,    67122, 67b2ec19dd3b74d828b51912c25249d6
-0,        100,        100,        0,    67122, 73dd9625538e10a0f94d31ac9fe3db23
-0,        133,        133,        0,    67122, 51e68f201130da18beb0cb27adcf6fa9
-0,        166,        166,        0,    67122, 455d9753b3c0ac5ad7d9da022f69acd0
-0,        200,        200,        0,    67122, 60a8905a63db4cdd2560583fb6415030
-0,        233,        233,        0,    67122, 48c156f4b2c9f936487b43713a4573fd
-0,        266,        266,        0,    67122, a5c8f4190cb34b3ecd42ca8e09bf1646
-0,        300,        300,        0,    67122, 233a5d5187137e047993532fc2e725d3
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-226x200 b/deps/libav/tests/ref/fate/vp9-03-size-226x200
deleted file mode 100644
index 62cea7f..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-226x200
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    67800, 0ae27db338f73f37eaed806b1c789593
-0,         33,         33,        0,    67800, 3f69273752f43699a3bc7b22a88cc3aa
-0,         66,         66,        0,    67800, ce0dfafb59910241d2b1a2275a2c2143
-0,        100,        100,        0,    67800, 8d20f404e25766c819ee728858bcbc76
-0,        133,        133,        0,    67800, 67bc5604c5b0f6c3484b605c1f93c83a
-0,        166,        166,        0,    67800, 1c82def3a06430d205cce0db7b5714de
-0,        200,        200,        0,    67800, 654d7a676e3b8b64541ed8cdefbd7286
-0,        233,        233,        0,    67800, 6c80c78c7b652c5b3b117a0960e89951
-0,        266,        266,        0,    67800, ae73e3c69ec6747c5234d58c5e1e36eb
-0,        300,        300,        0,    67800, e40d716efd8caf2d4004d299fb914328
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-226x202 b/deps/libav/tests/ref/fate/vp9-03-size-226x202
deleted file mode 100644
index d13634a..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-226x202
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    68478, 0cd2876640e71de3a6df7839bd6f0b51
-0,         33,         33,        0,    68478, f887db6839c0cddd1ea9ae6bfd2cc16d
-0,         66,         66,        0,    68478, ff2a890cf4c4973bf181ba8424c2eadc
-0,        100,        100,        0,    68478, f69f2e4f3036a21deb43a0bf4b95771f
-0,        133,        133,        0,    68478, 93f511739c19f1a3b356dda39d945c93
-0,        166,        166,        0,    68478, 7f79633c93765b504fef0324bd10fdba
-0,        200,        200,        0,    68478, d6c53d3937c9a40b227b4486452e0b33
-0,        233,        233,        0,    68478, 4e26625e8997ad6fe08ae68fbdfdbfd7
-0,        266,        266,        0,    68478, 3bf4c8ac0279351bf904cf57b0fc13c1
-0,        300,        300,        0,    68478, 12d64d856025185fa9e610dfa62b05af
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-226x208 b/deps/libav/tests/ref/fate/vp9-03-size-226x208
deleted file mode 100644
index 9e88108..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-226x208
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    70512, 6006cac6628cf9e7cea58aec07471b06
-0,         33,         33,        0,    70512, f7e994921248b6933920c984880ec96c
-0,         66,         66,        0,    70512, c0aeeb9d2009538d8d5e837f45e1542d
-0,        100,        100,        0,    70512, 7dacf9d00e85bd52045eb47bae5225b3
-0,        133,        133,        0,    70512, 024fd008a099ae954e38a3f0a8ebb6c9
-0,        166,        166,        0,    70512, fb6c368a1b3578ab59aa30e0b5cc4853
-0,        200,        200,        0,    70512, 07815251f7020b627c365a7a7be694c7
-0,        233,        233,        0,    70512, db8b8f48f3693867d2bd8208cf4f929a
-0,        266,        266,        0,    70512, 88b42d943c0978d832333a8a3f7b6bbc
-0,        300,        300,        0,    70512, 7aa760190f9328ba4f6fa87d1d9e8d3e
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-226x210 b/deps/libav/tests/ref/fate/vp9-03-size-226x210
deleted file mode 100644
index 0ff9dfc..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-226x210
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    71190, a6c1b7686202f5cc64335f92be595309
-0,         33,         33,        0,    71190, 3e573d4c693a39c5d6cd46b8873e99bb
-0,         66,         66,        0,    71190, d2388f6f641c8ddec98f11493f1a1390
-0,        100,        100,        0,    71190, 16473e33532ebc8de2f02077c406346b
-0,        133,        133,        0,    71190, 6c75d1c01276838fce40837e373f49db
-0,        166,        166,        0,    71190, b718e7445e2b08dde78fa7f30be01346
-0,        200,        200,        0,    71190, 2f556ed5afd60b1bbae76984ce073107
-0,        233,        233,        0,    71190, 4e5d59daed044c39a14c35f18cb4fb7a
-0,        266,        266,        0,    71190, c14901a9906ffcd0eb1efc068ce32941
-0,        300,        300,        0,    71190, 3d73b7f87bcd16c1ec565b5cc8d0fe93
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-226x224 b/deps/libav/tests/ref/fate/vp9-03-size-226x224
deleted file mode 100644
index 37b39a8..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-226x224
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    75936, 80fb3a643384386beadc0991f171669d
-0,         33,         33,        0,    75936, 65a4a51163f49a75f8eeecd94cb2ba47
-0,         66,         66,        0,    75936, d5b2aac9889d2991b83fd4360ada0258
-0,        100,        100,        0,    75936, 7958ff5535358567ea7df351d78256a7
-0,        133,        133,        0,    75936, 7e7413b9a61967d0ade07b81944e9a15
-0,        166,        166,        0,    75936, 40a008016adbf9673adbbc4c0edb4454
-0,        200,        200,        0,    75936, fef7b5e2809ef79917ab394a067ef4be
-0,        233,        233,        0,    75936, 91ee2360faf46a25b95927c55eea603f
-0,        266,        266,        0,    75936, a47f14a80a529f79f97accbe23188046
-0,        300,        300,        0,    75936, 3613bcd41ff13006fbba3bd0087c44f4
diff --git a/deps/libav/tests/ref/fate/vp9-03-size-226x226 b/deps/libav/tests/ref/fate/vp9-03-size-226x226
deleted file mode 100644
index 01c05dc..0000000
--- a/deps/libav/tests/ref/fate/vp9-03-size-226x226
+++ /dev/null
@@ -1,11 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    76614, f2370fc802dafdf5082beffc1907a9c6
-0,         33,         33,        0,    76614, aad6de7b986234a1d621935b272501c9
-0,         66,         66,        0,    76614, 8a6d3784e22e3b4f735e78916fbc3821
-0,        100,        100,        0,    76614, 0c4afce19c43fdf3bb1b972810cc9126
-0,        133,        133,        0,    76614, 814a68dd76a3135221131988910f51ba
-0,        166,        166,        0,    76614, b2379c4b28dca10e67ac58631f9731c0
-0,        200,        200,        0,    76614, b16fd651884340a428cea3fe0ac18ba6
-0,        233,        233,        0,    76614, cb65cd4c421cfd6a19fb123ec27abbe6
-0,        266,        266,        0,    76614, 7f1d2686b9808de8ecc723b18136d57d
-0,        300,        300,        0,    76614, da7fd4bff4b6db0221c42492876c5c4d
diff --git a/deps/libav/tests/ref/fate/vp9-2pass-akiyo b/deps/libav/tests/ref/fate/vp9-2pass-akiyo
deleted file mode 100644
index 5061a76..0000000
--- a/deps/libav/tests/ref/fate/vp9-2pass-akiyo
+++ /dev/null
@@ -1,51 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, 043ce065a309514e1e8ebdcbb3c2458b
-0,         33,         33,        0,   152064, 8579c9cffd95b11db86158e518b2e34a
-0,         66,         66,        0,   152064, ebbba105e499604f5e69b8aa48fe86f4
-0,        100,        100,        0,   152064, b08526fab7e106021f9fb9b1e2d4b725
-0,        133,        133,        0,   152064, 92afa561d06f41ccc6d2e2bcc3ab2ee4
-0,        166,        166,        0,   152064, 50de8ec2db66c783289a3982dd1c4f97
-0,        200,        200,        0,   152064, c2ab55d114b8822adef06ccb093b5ac7
-0,        233,        233,        0,   152064, e3ee4edbe8a1f0b5486bbd8a52e7cbcb
-0,        266,        266,        0,   152064, fc33fd50566cd64e5b13911ee06c6e24
-0,        300,        300,        0,   152064, 05297e847f983a19fe2ba5e05932a110
-0,        333,        333,        0,   152064, d21db9adb27be89ab3b7f75d89175e24
-0,        367,        367,        0,   152064, 29bb87bdebd078f8dd953a70def6c4dc
-0,        400,        400,        0,   152064, c57f7bc772f6143a22edaf926f92de5f
-0,        433,        433,        0,   152064, 39f2fc755d4bc2cc5ec077035382be22
-0,        467,        467,        0,   152064, 000ec9c75374f6d74a5e61189e6fd782
-0,        500,        500,        0,   152064, 3027187c9bdb2a755d14513b7e597bb1
-0,        533,        533,        0,   152064, 2b3129659df2b3aa10b9398c50301e00
-0,        567,        567,        0,   152064, e23bcacf1cafca9a7959508b33e63907
-0,        600,        600,        0,   152064, fe0382dd155284998a0d7eb7effb5adf
-0,        633,        633,        0,   152064, e0a487860dd0df3d865971b483fab3e9
-0,        667,        667,        0,   152064, 7ca757c55b0ea4779cdfa3a535f8f234
-0,        700,        700,        0,   152064, 1a276d27f4ce0e2720e25dbed2e524ae
-0,        734,        734,        0,   152064, dd39bc322c8bdce196a9c2129bcb5d6e
-0,        767,        767,        0,   152064, 63e295427977d645462e0fb3277ccb53
-0,        800,        800,        0,   152064, e9a35655c71da22fb0c7865e0bbc91b8
-0,        834,        834,        0,   152064, 5903bcbccabb3366382b37bf08119dde
-0,        867,        867,        0,   152064, 3b6ce09353b07b193914a71ca2334d8c
-0,        900,        900,        0,   152064, cb3731eb5dbe338125c0a7d6b4bf2868
-0,        934,        934,        0,   152064, 0837c62b54912ed06f7f755894ad3f6b
-0,        967,        967,        0,   152064, 7f215dc14d8e280fc18ad3fb3122fa58
-0,       1001,       1001,        0,   152064, 6dafaf5adc45fead74f0153e3764b17d
-0,       1034,       1034,        0,   152064, e19c8274ee6377dbf005f6516a81c413
-0,       1067,       1067,        0,   152064, 358cbf29bd136d2f9dcb60ab82a2e9e5
-0,       1101,       1101,        0,   152064, 2276d4670ff35c3a76c27c3a5810eea3
-0,       1134,       1134,        0,   152064, 636dd3390d4011c377915d7d3acc9ee1
-0,       1167,       1167,        0,   152064, 5e7a1ed17d80168567d61987425f4e60
-0,       1201,       1201,        0,   152064, c10a4830c5f268888789fccd16c0cc0e
-0,       1234,       1234,        0,   152064, 298ef49418d730a031ff23311031c969
-0,       1267,       1267,        0,   152064, 4dd2249e13cda0f99fa46786d345c96a
-0,       1301,       1301,        0,   152064, 24232dbc6e35a069c60422c4c23dfa51
-0,       1334,       1334,        0,   152064, ae8751c5ac168d6aa4499fe69f018ae2
-0,       1368,       1368,        0,   152064, 6a3a7e60a569e7415f2c3a1453e4dc38
-0,       1401,       1401,        0,   152064, 5475af1c118d1b7cc0a357bc434241a8
-0,       1434,       1434,        0,   152064, c6b5ab39e630e66e8f09698fd1dfa160
-0,       1468,       1468,        0,   152064, f1c0310adf115456167e3fa790e43dde
-0,       1501,       1501,        0,   152064, 3028296307b47d10156fc9657693edc3
-0,       1534,       1534,        0,   152064, 0903dabcb8ac707b423b222ac5bb4898
-0,       1568,       1568,        0,   152064, 713cf71b994e2c85ed577062814c5732
-0,       1601,       1601,        0,   152064, 674f56b9cccf5c9d1f88f68c3996a671
-0,       1634,       1634,        0,   152064, f63732c2ff823960d8b62d866dfb5e6a
diff --git a/deps/libav/tests/ref/fate/vp9-parallelmode-akiyo b/deps/libav/tests/ref/fate/vp9-parallelmode-akiyo
deleted file mode 100644
index 0978807..0000000
--- a/deps/libav/tests/ref/fate/vp9-parallelmode-akiyo
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, f5bc602db15c69545307e56990f9f9f7
-0,         33,         33,        0,   152064, b56428b6f97669938c8b9b05458fca70
-0,         66,         66,        0,   152064, b56428b6f97669938c8b9b05458fca70
-0,        100,        100,        0,   152064, 3098d2eb9129beddb6975e3ae332a4ab
-0,        133,        133,        0,   152064, 6719f3a6c22f05dc53dd3906e4154bd7
-0,        166,        166,        0,   152064, 8cd9a12761e35f67c278949cd3aee88f
-0,        200,        200,        0,   152064, 8cd9a12761e35f67c278949cd3aee88f
-0,        233,        233,        0,   152064, 0160dec415234d39f148e91f72d264ab
-0,        266,        266,        0,   152064, 9f90d96d67d9e9b3716abe2a3faa854e
-0,        300,        300,        0,   152064, 1edb312f9d0be7835b964a3ffa014759
-0,        333,        333,        0,   152064, 7614fd674609afccacd355aa2f714c75
-0,        367,        367,        0,   152064, cb46868706dd246878bebf354aff66f4
-0,        400,        400,        0,   152064, da36fe96cb4956036f890bb2f6d05b98
-0,        433,        433,        0,   152064, af0a178c68b719b369c8fa8537d38e65
-0,        467,        467,        0,   152064, ff03dbc436376fc60ac240cd6c4fc518
-0,        500,        500,        0,   152064, b0bf25e139556bd9067616db7e4f47b5
-0,        533,        533,        0,   152064, e70d5480c1f82fc877bbe1a8093f807a
-0,        567,        567,        0,   152064, 622fb43e6ff63834f0f680a68b49f6e6
-0,        600,        600,        0,   152064, c331ebba15f2290f174533dbffb3c27b
-0,        633,        633,        0,   152064, 15cb153425c55f7065fb36606c48972e
-0,        667,        667,        0,   152064, b95c7699639c51b08b3615ef7fa7046c
-0,        700,        700,        0,   152064, b4774148c71c9c184bda5a18294e459c
-0,        734,        734,        0,   152064, 795b7ce4c5e0dc343bd8f80ad6c1a454
-0,        767,        767,        0,   152064, 19163601b7b6138e2940cf28f6df6c7f
-0,        800,        800,        0,   152064, b9b388e0892c52df0680a30bfa954506
diff --git a/deps/libav/tests/ref/fate/vp9-segmentation-aq-akiyo b/deps/libav/tests/ref/fate/vp9-segmentation-aq-akiyo
deleted file mode 100644
index 2be837a..0000000
--- a/deps/libav/tests/ref/fate/vp9-segmentation-aq-akiyo
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, b208eac12f0ae74a812bc9e314bdfac7
-0,         33,         33,        0,   152064, ebb2259451c3acf3ad6379d1f4092efb
-0,         66,         66,        0,   152064, 33de46060afd14aa359b7bd0d9ff1be8
-0,        100,        100,        0,   152064, 33de46060afd14aa359b7bd0d9ff1be8
-0,        133,        133,        0,   152064, 5d087d8df10fd406d59172710ea0341a
-0,        166,        166,        0,   152064, 3570ed7fb90ac9b5335b97adf0539e94
-0,        200,        200,        0,   152064, 68a8c56b889a3befc75c9ec4293c7fda
-0,        233,        233,        0,   152064, f871f7c0456f644cfb0ec896132a097f
-0,        266,        266,        0,   152064, 14e939bfeb2b878e0782a7ce68ecd214
-0,        300,        300,        0,   152064, bd3e97881ebece0f876d46d067c6a7ff
-0,        333,        333,        0,   152064, a20529c091ef3e68a901c574371224b3
-0,        367,        367,        0,   152064, 5253f16c8b0329d33d38d275124487fb
-0,        400,        400,        0,   152064, c9c2f7d8835e620709a53ff8adfe72bf
-0,        433,        433,        0,   152064, dc8f1df0d7ab8e4f9daf2ccfd96de855
-0,        467,        467,        0,   152064, d09d43208d4de7f81d54f48cff310b6f
-0,        500,        500,        0,   152064, 0dcf7212075c1f15219690ad6ffe2940
-0,        533,        533,        0,   152064, 3b52e3eb4f972318c6912dd29a95dcf3
-0,        567,        567,        0,   152064, aa1414343067749fbd743ace93553492
-0,        600,        600,        0,   152064, 6951cb7a78e0a03f9a3f6264084de6dc
-0,        633,        633,        0,   152064, 5324f2f03c4d5fe35446561af654e9ec
-0,        667,        667,        0,   152064, dff11b046a02ca34c6b1aecc857632ec
-0,        700,        700,        0,   152064, 971182c013c1524d4864fd946b8c1550
-0,        734,        734,        0,   152064, 3306f1dcd5760ba92dd9cec8bfc21b08
-0,        767,        767,        0,   152064, f1f7b13c33332fece576b4d175f91832
-0,        800,        800,        0,   152064, 9e66573fbfe847149eb32e8a9c242c18
diff --git a/deps/libav/tests/ref/fate/vp9-segmentation-sf-akiyo b/deps/libav/tests/ref/fate/vp9-segmentation-sf-akiyo
deleted file mode 100644
index bfef222..0000000
--- a/deps/libav/tests/ref/fate/vp9-segmentation-sf-akiyo
+++ /dev/null
@@ -1,26 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,   152064, f4e04a0f92fab3a52d858bb222807ac0
-0,         33,         33,        0,   152064, 493cb96b8202a1518c6c9bdb848540e4
-0,         66,         66,        0,   152064, 60b5b63f832cff119a43de82102758f4
-0,        100,        100,        0,   152064, 0d9bd42e279d480603f9c670f0a8ffe3
-0,        133,        133,        0,   152064, 25ca563f233688f32f40fec985a116a2
-0,        166,        166,        0,   152064, dd14b43d538708a91de41606703dbe1c
-0,        200,        200,        0,   152064, 01bb23cb43960ff185a97ea79936d3b4
-0,        233,        233,        0,   152064, 85045c4310ee80cd12979bdea4f3f86e
-0,        266,        266,        0,   152064, c8e015ea13359a05483de349313a6686
-0,        300,        300,        0,   152064, 8dbb0406bf6fe19c30a9c9253fcdfe7f
-0,        333,        333,        0,   152064, 84881463643069036d03e8120a5f15e9
-0,        367,        367,        0,   152064, 9abcd3f2f86ff31f8d357389b330df59
-0,        400,        400,        0,   152064, 19ada6395c4e656578d2ceeaba291bb2
-0,        433,        433,        0,   152064, fc29773a6f32eed2bfa44143f8f505b1
-0,        467,        467,        0,   152064, 5e56bd91f5e3d1457c124b5702bdc3b6
-0,        500,        500,        0,   152064, 5b920d73e301adb6c45699a209f09a33
-0,        533,        533,        0,   152064, 4d06ec294270638c6abdd1c2303b34fc
-0,        567,        567,        0,   152064, dc99797067851f74708d7e6ff54367d8
-0,        600,        600,        0,   152064, 5df68b49124219592b043916affb1311
-0,        633,        633,        0,   152064, cfb52d101fad76acb1bb0d48c513bffd
-0,        667,        667,        0,   152064, 206dbd55680b8a83d8bafe33c54c3e36
-0,        700,        700,        0,   152064, 171f2e26771db631788065eecf6c44d9
-0,        734,        734,        0,   152064, b10809dcf9ecfdb4f86a6f3236ac273e
-0,        767,        767,        0,   152064, b354107bdea9bd011b09d9f4a32d4e89
-0,        800,        800,        0,   152064, 0c18be13dc6fbf79a613f2b24bb301c1
diff --git a/deps/libav/tests/ref/fate/vp9-tiling-pedestrian b/deps/libav/tests/ref/fate/vp9-tiling-pedestrian
deleted file mode 100644
index 23c760e..0000000
--- a/deps/libav/tests/ref/fate/vp9-tiling-pedestrian
+++ /dev/null
@@ -1,3 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,  3110400, 1e6c2e768a5107e57e6d626f0511193a
-0,         40,         40,        0,  3110400, 972d3e2b5ee2e3b0907218a243e4cb7d
diff --git a/deps/libav/tests/ref/fate/vqa-cc b/deps/libav/tests/ref/fate/vqa-cc
deleted file mode 100644
index d3c5e6a..0000000
--- a/deps/libav/tests/ref/fate/vqa-cc
+++ /dev/null
@@ -1,39 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,   192000, 0x00000000
-0,          1,          1,        1,   192000, 0x00000000
-0,          2,          2,        1,   192000, 0x00000000
-0,          3,          3,        1,   192000, 0x00000000
-0,          4,          4,        1,   192000, 0xcd900ccc
-0,          5,          5,        1,   192000, 0xfd496438
-0,          6,          6,        1,   192000, 0x965f0bf3
-0,          7,          7,        1,   192000, 0x378fca5f
-0,          8,          8,        1,   192000, 0x5ccd8966
-0,          9,          9,        1,   192000, 0x859676f9
-0,         10,         10,        1,   192000, 0x820bfb1c
-0,         11,         11,        1,   192000, 0x7570cc05
-0,         12,         12,        1,   192000, 0xf38bdb06
-0,         13,         13,        1,   192000, 0x9b0cbb44
-0,         14,         14,        1,   192000, 0x0ed70665
-0,         15,         15,        1,   192000, 0xd16de7fc
-0,         16,         16,        1,   192000, 0x97afb484
-0,         17,         17,        1,   192000, 0x012893f3
-0,         18,         18,        1,   192000, 0x742a4b43
-0,         19,         19,        1,   192000, 0x309dcd75
-0,         20,         20,        1,   192000, 0xed7814ac
-0,         21,         21,        1,   192000, 0xdb7de3d7
-0,         22,         22,        1,   192000, 0xe18679a3
-0,         23,         23,        1,   192000, 0xb1f213f4
-0,         24,         24,        1,   192000, 0x33c99b5c
-0,         25,         25,        1,   192000, 0xf66c0c91
-0,         26,         26,        1,   192000, 0x929cdc73
-0,         27,         27,        1,   192000, 0xa723fc3b
-0,         28,         28,        1,   192000, 0xe6395ccc
-0,         29,         29,        1,   192000, 0x147fbf74
-0,         30,         30,        1,   192000, 0x3ec62d28
-0,         31,         31,        1,   192000, 0x22104ffb
-0,         32,         32,        1,   192000, 0x91f25f58
-0,         33,         33,        1,   192000, 0xc91b0e4e
-0,         34,         34,        1,   192000, 0x4683df56
-0,         35,         35,        1,   192000, 0x8ef8932a
-0,         36,         36,        1,   192000, 0xce6c0ec0
-0,         37,         37,        1,   192000, 0xcc10e2a0
diff --git a/deps/libav/tests/ref/fate/vqf-demux b/deps/libav/tests/ref/fate/vqf-demux
deleted file mode 100644
index 3acae60..0000000
--- a/deps/libav/tests/ref/fate/vqf-demux
+++ /dev/null
@@ -1 +0,0 @@
-d72fb75fb22f4bcc94a1dc7af5356ec1
diff --git a/deps/libav/tests/ref/fate/w64 b/deps/libav/tests/ref/fate/w64
deleted file mode 100644
index 461eadb..0000000
--- a/deps/libav/tests/ref/fate/w64
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0xc1e71a5c
diff --git a/deps/libav/tests/ref/fate/wavpack-channels-4.0 b/deps/libav/tests/ref/fate/wavpack-channels-4.0
deleted file mode 100644
index 4cf6764..0000000
--- a/deps/libav/tests/ref/fate/wavpack-channels-4.0
+++ /dev/null
@@ -1 +0,0 @@
-a03999c3ad17423f3a7e3d537fea8589
diff --git a/deps/libav/tests/ref/fate/wavpack-channels-5.1 b/deps/libav/tests/ref/fate/wavpack-channels-5.1
deleted file mode 100644
index 49fe876..0000000
--- a/deps/libav/tests/ref/fate/wavpack-channels-5.1
+++ /dev/null
@@ -1 +0,0 @@
-4ab874ad4a47141073f6db9aeec422a8
diff --git a/deps/libav/tests/ref/fate/wavpack-channels-6.1 b/deps/libav/tests/ref/fate/wavpack-channels-6.1
deleted file mode 100644
index ed46b7c..0000000
--- a/deps/libav/tests/ref/fate/wavpack-channels-6.1
+++ /dev/null
@@ -1 +0,0 @@
-a524a76c85f55b7d63914fc1543a5268
diff --git a/deps/libav/tests/ref/fate/wavpack-channels-7.1 b/deps/libav/tests/ref/fate/wavpack-channels-7.1
deleted file mode 100644
index 1f54afe..0000000
--- a/deps/libav/tests/ref/fate/wavpack-channels-7.1
+++ /dev/null
@@ -1 +0,0 @@
-cffe4d47290ff3cef974e5aa6bc32559
diff --git a/deps/libav/tests/ref/fate/wavpack-channels-monofloat b/deps/libav/tests/ref/fate/wavpack-channels-monofloat
deleted file mode 100644
index 41d94fa..0000000
--- a/deps/libav/tests/ref/fate/wavpack-channels-monofloat
+++ /dev/null
@@ -1 +0,0 @@
-71386c0f63105e414220f0f0d369a0e6
diff --git a/deps/libav/tests/ref/fate/wavpack-channels-monoint b/deps/libav/tests/ref/fate/wavpack-channels-monoint
deleted file mode 100644
index 204ab6d..0000000
--- a/deps/libav/tests/ref/fate/wavpack-channels-monoint
+++ /dev/null
@@ -1 +0,0 @@
-931f27e3ec69fae0952548504461d97c
diff --git a/deps/libav/tests/ref/fate/wavpack-clipping b/deps/libav/tests/ref/fate/wavpack-clipping
deleted file mode 100644
index fd19f93..0000000
--- a/deps/libav/tests/ref/fate/wavpack-clipping
+++ /dev/null
@@ -1 +0,0 @@
-d18d0b2dc7d329aefcbb889dc99383ab
diff --git a/deps/libav/tests/ref/fate/wavpack-cuesheet b/deps/libav/tests/ref/fate/wavpack-cuesheet
deleted file mode 100644
index e013bb0..0000000
--- a/deps/libav/tests/ref/fate/wavpack-cuesheet
+++ /dev/null
@@ -1 +0,0 @@
-85eb2940491442ca25c2a702a6f30e5f
diff --git a/deps/libav/tests/ref/fate/wavpack-falsestereo b/deps/libav/tests/ref/fate/wavpack-falsestereo
deleted file mode 100644
index 458ce65..0000000
--- a/deps/libav/tests/ref/fate/wavpack-falsestereo
+++ /dev/null
@@ -1 +0,0 @@
-e3fdd584bef84e85f4ca84e2769306f8
diff --git a/deps/libav/tests/ref/fate/wavpack-lossless-12bit b/deps/libav/tests/ref/fate/wavpack-lossless-12bit
deleted file mode 100644
index 2adf043..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossless-12bit
+++ /dev/null
@@ -1 +0,0 @@
-925e047ac0d4c874a9cff3cc9117ac91
diff --git a/deps/libav/tests/ref/fate/wavpack-lossless-16bit b/deps/libav/tests/ref/fate/wavpack-lossless-16bit
deleted file mode 100644
index 04fc280..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossless-16bit
+++ /dev/null
@@ -1 +0,0 @@
-e2dc4b85377b275a48c8bd2a4f5b91fd
diff --git a/deps/libav/tests/ref/fate/wavpack-lossless-24bit b/deps/libav/tests/ref/fate/wavpack-lossless-24bit
deleted file mode 100644
index 1fd8dca..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossless-24bit
+++ /dev/null
@@ -1 +0,0 @@
-9d7bc1a45bd3ba9d1eb5706f0dfc3e47
diff --git a/deps/libav/tests/ref/fate/wavpack-lossless-32bit b/deps/libav/tests/ref/fate/wavpack-lossless-32bit
deleted file mode 100644
index cef05f3..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossless-32bit
+++ /dev/null
@@ -1 +0,0 @@
-c35f539bb5796ed93908c987fab1c26c
diff --git a/deps/libav/tests/ref/fate/wavpack-lossless-8bit b/deps/libav/tests/ref/fate/wavpack-lossless-8bit
deleted file mode 100644
index 58cdb99..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossless-8bit
+++ /dev/null
@@ -1 +0,0 @@
-e4e65e2048ba373d89836907328cfb27
diff --git a/deps/libav/tests/ref/fate/wavpack-lossless-float b/deps/libav/tests/ref/fate/wavpack-lossless-float
deleted file mode 100644
index 6081ae1..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossless-float
+++ /dev/null
@@ -1 +0,0 @@
-04b860cf4f9ecba36c053fdf83dac14a
diff --git a/deps/libav/tests/ref/fate/wavpack-lossy-16bit b/deps/libav/tests/ref/fate/wavpack-lossy-16bit
deleted file mode 100644
index 3adeaa0..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossy-16bit
+++ /dev/null
@@ -1 +0,0 @@
-c2aa8d83d14f799a9289b73bb6263fbc
diff --git a/deps/libav/tests/ref/fate/wavpack-lossy-24bit b/deps/libav/tests/ref/fate/wavpack-lossy-24bit
deleted file mode 100644
index 566ec6d..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossy-24bit
+++ /dev/null
@@ -1 +0,0 @@
-0c04941424ba0981eac0e681130788f7
diff --git a/deps/libav/tests/ref/fate/wavpack-lossy-32bit b/deps/libav/tests/ref/fate/wavpack-lossy-32bit
deleted file mode 100644
index 6b66d0a..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossy-32bit
+++ /dev/null
@@ -1 +0,0 @@
-7b94c7ab8ec78ddf59bd7967199cdc8e
diff --git a/deps/libav/tests/ref/fate/wavpack-lossy-8bit b/deps/libav/tests/ref/fate/wavpack-lossy-8bit
deleted file mode 100644
index d921ea6..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossy-8bit
+++ /dev/null
@@ -1 +0,0 @@
-f0e452d762d5e7b675970e6e67b781e7
diff --git a/deps/libav/tests/ref/fate/wavpack-lossy-float b/deps/libav/tests/ref/fate/wavpack-lossy-float
deleted file mode 100644
index 9f984ac..0000000
--- a/deps/libav/tests/ref/fate/wavpack-lossy-float
+++ /dev/null
@@ -1 +0,0 @@
-d4733e795e5af80da9a265cf83a6da69
diff --git a/deps/libav/tests/ref/fate/wavpack-matroskamode b/deps/libav/tests/ref/fate/wavpack-matroskamode
deleted file mode 100644
index 1f54afe..0000000
--- a/deps/libav/tests/ref/fate/wavpack-matroskamode
+++ /dev/null
@@ -1 +0,0 @@
-cffe4d47290ff3cef974e5aa6bc32559
diff --git a/deps/libav/tests/ref/fate/wavpack-speed-default b/deps/libav/tests/ref/fate/wavpack-speed-default
deleted file mode 100644
index 9dc559f..0000000
--- a/deps/libav/tests/ref/fate/wavpack-speed-default
+++ /dev/null
@@ -1 +0,0 @@
-a57bec3f270c3b294d1e5ea07760514c
diff --git a/deps/libav/tests/ref/fate/wavpack-speed-fast b/deps/libav/tests/ref/fate/wavpack-speed-fast
deleted file mode 100644
index 181d7dd..0000000
--- a/deps/libav/tests/ref/fate/wavpack-speed-fast
+++ /dev/null
@@ -1 +0,0 @@
-ebff08f89073e3f662f822df428711d5
diff --git a/deps/libav/tests/ref/fate/wavpack-speed-high b/deps/libav/tests/ref/fate/wavpack-speed-high
deleted file mode 100644
index 3d85201..0000000
--- a/deps/libav/tests/ref/fate/wavpack-speed-high
+++ /dev/null
@@ -1 +0,0 @@
-a28c4d0f1d0c6ac7739e05150a8c401a
diff --git a/deps/libav/tests/ref/fate/wavpack-speed-vhigh b/deps/libav/tests/ref/fate/wavpack-speed-vhigh
deleted file mode 100644
index 3d85201..0000000
--- a/deps/libav/tests/ref/fate/wavpack-speed-vhigh
+++ /dev/null
@@ -1 +0,0 @@
-a28c4d0f1d0c6ac7739e05150a8c401a
diff --git a/deps/libav/tests/ref/fate/wavpack-zerolsbs b/deps/libav/tests/ref/fate/wavpack-zerolsbs
deleted file mode 100644
index cc16fb9..0000000
--- a/deps/libav/tests/ref/fate/wavpack-zerolsbs
+++ /dev/null
@@ -1 +0,0 @@
-33c09fedba88693f6cc423ca3763e7fe
diff --git a/deps/libav/tests/ref/fate/wc3movie-xan b/deps/libav/tests/ref/fate/wc3movie-xan
deleted file mode 100644
index 57b7f70..0000000
--- a/deps/libav/tests/ref/fate/wc3movie-xan
+++ /dev/null
@@ -1,72 +0,0 @@
-#tb 0: 1/15
-#tb 1: 1/22050
-0,          0,          0,        1,   158400, 0x25aec781
-1,          0,          0,     1470,     2940, 0x92cee2a6
-0,          1,          1,        1,   158400, 0xda4dbf70
-1,       1470,       1470,     1470,     2940, 0x126902c3
-0,          2,          2,        1,   158400, 0x2d8fc909
-1,       2940,       2940,     1470,     2940, 0x4977b9e6
-0,          3,          3,        1,   158400, 0xea93c5ab
-1,       4410,       4410,     1470,     2940, 0x5144d68c
-0,          4,          4,        1,   158400, 0xa1f5bf60
-1,       5880,       5880,     1470,     2940, 0x282ebf71
-0,          5,          5,        1,   158400, 0x739ecfa9
-1,       7350,       7350,     1470,     2940, 0xc2e7c73c
-0,          6,          6,        1,   158400, 0xe9830c7e
-1,       8820,       8820,     1470,     2940, 0x717d6fc5
-0,          7,          7,        1,   158400, 0xd885665b
-1,      10290,      10290,     1470,     2940, 0x78538428
-0,          8,          8,        1,   158400, 0x3235f8ad
-1,      11760,      11760,     1470,     2940, 0x94ffd1ad
-0,          9,          9,        1,   158400, 0xd8550cca
-1,      13230,      13230,     1470,     2940, 0xad43de8b
-0,         10,         10,        1,   158400, 0x05e9e231
-1,      14700,      14700,     1470,     2940, 0x65e4b604
-0,         11,         11,        1,   158400, 0xce9dd29b
-1,      16170,      16170,     1470,     2940, 0xd6d6c30f
-0,         12,         12,        1,   158400, 0x857494a6
-1,      17640,      17640,     1470,     2940, 0x7b897e4e
-0,         13,         13,        1,   158400, 0x9cad464a
-1,      19110,      19110,     1470,     2940, 0xf79546ad
-0,         14,         14,        1,   158400, 0x04c3177a
-1,      20580,      20580,     1470,     2940, 0x658c904e
-0,         15,         15,        1,   158400, 0xa3d2399a
-1,      22050,      22050,     1470,     2940, 0xb7b8cd8c
-0,         16,         16,        1,   158400, 0x12cdd418
-1,      23520,      23520,     1470,     2940, 0x2f2da7c5
-0,         17,         17,        1,   158400, 0x5ef67c9e
-1,      24990,      24990,     1470,     2940, 0x51938cf8
-0,         18,         18,        1,   158400, 0xba7a7f11
-1,      26460,      26460,     1470,     2940, 0xdf61c87a
-0,         19,         19,        1,   158400, 0x084b60e7
-1,      27930,      27930,     1470,     2940, 0xf72a7069
-0,         20,         20,        1,   158400, 0xef95a6a5
-1,      29400,      29400,     1470,     2940, 0x9af2a425
-0,         21,         21,        1,   158400, 0x55f392f1
-1,      30870,      30870,     1470,     2940, 0x4c3f5ac7
-0,         22,         22,        1,   158400, 0x63fca6bb
-1,      32340,      32340,     1470,     2940, 0xfe4cb0b2
-0,         23,         23,        1,   158400, 0x0f7e62fe
-1,      33810,      33810,     1470,     2940, 0x732a35ed
-0,         24,         24,        1,   158400, 0xf35febc1
-1,      35280,      35280,     1470,     2940, 0x526b9e0f
-0,         25,         25,        1,   158400, 0x6bf6f219
-1,      36750,      36750,     1470,     2940, 0x4bd9d4e2
-0,         26,         26,        1,   158400, 0xbdf13e77
-1,      38220,      38220,     1470,     2940, 0x84340827
-0,         27,         27,        1,   158400, 0x88490e47
-1,      39690,      39690,     1470,     2940, 0xe54f7911
-0,         28,         28,        1,   158400, 0xdb786540
-1,      41160,      41160,     1470,     2940, 0x0bbdef52
-0,         29,         29,        1,   158400, 0x7335c045
-1,      42630,      42630,     1470,     2940, 0xc1aac5e1
-0,         30,         30,        1,   158400, 0x6b78015a
-1,      44100,      44100,     1470,     2940, 0x515ea512
-0,         31,         31,        1,   158400, 0x9e9b6d16
-1,      45570,      45570,     1470,     2940, 0x9e7fdac1
-0,         32,         32,        1,   158400, 0xe618e024
-1,      47040,      47040,     1470,     2940, 0xf1d4c9cc
-0,         33,         33,        1,   158400, 0x56cd60f7
-1,      48510,      48510,     1470,     2940, 0x1bc9b6ee
-0,         34,         34,        1,   158400, 0xf08e22fe
-1,      49980,      49980,     1470,     2940, 0xff8ac114
diff --git a/deps/libav/tests/ref/fate/westwood-aud b/deps/libav/tests/ref/fate/westwood-aud
deleted file mode 100644
index 9fab241..0000000
--- a/deps/libav/tests/ref/fate/westwood-aud
+++ /dev/null
@@ -1,12 +0,0 @@
-#tb 0: 1/22050
-0,          0,          0,     1024,      512, 0x6694cc55
-0,       1024,       1024,     1024,      512, 0xdbc5cb22
-0,       2048,       2048,     1024,      512, 0x8e5bcbfd
-0,       3072,       3072,     1024,      512, 0x7b2ac519
-0,       4096,       4096,     1024,      512, 0x6ae0cb0c
-0,       5120,       5120,     1024,      512, 0x055ec435
-0,       6144,       6144,     1024,      512, 0x9424c8d6
-0,       7168,       7168,     1024,      512, 0x58fccb7d
-0,       8192,       8192,     1024,      512, 0x348fd253
-0,       9216,       9216,     1024,      512, 0xe1b1c24e
-0,      10240,      10240,      192,       96, 0x95f81350
diff --git a/deps/libav/tests/ref/fate/wmv8-drm b/deps/libav/tests/ref/fate/wmv8-drm
deleted file mode 100644
index 7f4b523..0000000
--- a/deps/libav/tests/ref/fate/wmv8-drm
+++ /dev/null
@@ -1,130 +0,0 @@
-#tb 0: 1/1000
-0,          0,          0,        0,    84480, 0x7760a00b
-0,       1208,       1208,        0,    84480, 0xfe39a1db
-0,       1250,       1250,        0,    84480, 0xd71961b4
-0,       1291,       1291,        0,    84480, 0xc80dedba
-0,       1333,       1333,        0,    84480, 0x34d8b538
-0,       1375,       1375,        0,    84480, 0x1a86b8e5
-0,       1416,       1416,        0,    84480, 0xabf7c25d
-0,       1458,       1458,        0,    84480, 0x912600ee
-0,       1500,       1500,        0,    84480, 0x7ee7c70b
-0,       1541,       1541,        0,    84480, 0x09c5b0d1
-0,       1583,       1583,        0,    84480, 0x6dbe6c0c
-0,       1625,       1625,        0,    84480, 0x0fe0a120
-0,       1666,       1666,        0,    84480, 0x2352d3a2
-0,       1708,       1708,        0,    84480, 0xb22ce92e
-0,       1750,       1750,        0,    84480, 0x31db0099
-0,       1791,       1791,        0,    84480, 0xad2dd73a
-0,       1833,       1833,        0,    84480, 0xb9af8e20
-0,       1875,       1875,        0,    84480, 0x7b956549
-0,       1916,       1916,        0,    84480, 0x3f774b87
-0,       1958,       1958,        0,    84480, 0x824a23a3
-0,       2000,       2000,        0,    84480, 0x4469a8d8
-0,       2041,       2041,        0,    84480, 0xc80c7a0a
-0,       2083,       2083,        0,    84480, 0xcf958549
-0,       2125,       2125,        0,    84480, 0x449746e3
-0,       2166,       2166,        0,    84480, 0xbac66a82
-0,       2208,       2208,        0,    84480, 0x99e85855
-0,       2250,       2250,        0,    84480, 0xa4a17d17
-0,       2291,       2291,        0,    84480, 0xe29c7587
-0,       2333,       2333,        0,    84480, 0x551de592
-0,       2375,       2375,        0,    84480, 0xe0877bce
-0,       2416,       2416,        0,    84480, 0x9660eb35
-0,       2458,       2458,        0,    84480, 0x0a34b644
-0,       2500,       2500,        0,    84480, 0x352919f0
-0,       2541,       2541,        0,    84480, 0xef56ce27
-0,       2583,       2583,        0,    84480, 0x030fe862
-0,       2625,       2625,        0,    84480, 0x2eba33e2
-0,       2666,       2666,        0,    84480, 0x242de401
-0,       2708,       2708,        0,    84480, 0xbadd61ca
-0,       2750,       2750,        0,    84480, 0x2060465b
-0,       2791,       2791,        0,    84480, 0x256e6965
-0,       2833,       2833,        0,    84480, 0x243b7084
-0,       2875,       2875,        0,    84480, 0x8b3c0b47
-0,       2916,       2916,        0,    84480, 0xc174a9af
-0,       2958,       2958,        0,    84480, 0xb6d48686
-0,       3000,       3000,        0,    84480, 0xa3dd1871
-0,       3041,       3041,        0,    84480, 0x04cdcaf7
-0,       3083,       3083,        0,    84480, 0x55f89c94
-0,       3125,       3125,        0,    84480, 0xda657032
-0,       3166,       3166,        0,    84480, 0x38ba7698
-0,       3208,       3208,        0,    84480, 0x4d03a7f2
-0,       3250,       3250,        0,    84480, 0x115d9035
-0,       3291,       3291,        0,    84480, 0x24c6acc6
-0,       3333,       3333,        0,    84480, 0xdd2bbcae
-0,       3375,       3375,        0,    84480, 0xb4fee0b9
-0,       3416,       3416,        0,    84480, 0xc51c14e0
-0,       3458,       3458,        0,    84480, 0xfb7737de
-0,       3500,       3500,        0,    84480, 0x38675fb0
-0,       3541,       3541,        0,    84480, 0x4752c710
-0,       3583,       3583,        0,    84480, 0xfeb7491b
-0,       3625,       3625,        0,    84480, 0xaa248122
-0,       3666,       3666,        0,    84480, 0x9a4af87c
-0,       3708,       3708,        0,    84480, 0xedcf09df
-0,       3750,       3750,        0,    84480, 0x563a05df
-0,       3791,       3791,        0,    84480, 0x0dde1e03
-0,       3833,       3833,        0,    84480, 0xd8f0ff65
-0,       3875,       3875,        0,    84480, 0xbeb9ae1a
-0,       3916,       3916,        0,    84480, 0x416d1468
-0,       3958,       3958,        0,    84480, 0x66c87d4c
-0,       4000,       4000,        0,    84480, 0xa67c0774
-0,       4041,       4041,        0,    84480, 0xd8f8aec1
-0,       4083,       4083,        0,    84480, 0xadfa502b
-0,       4125,       4125,        0,    84480, 0x50bf20e4
-0,       4166,       4166,        0,    84480, 0xbcb3d8cc
-0,       4208,       4208,        0,    84480, 0xa54677d7
-0,       4250,       4250,        0,    84480, 0x3566042d
-0,       4291,       4291,        0,    84480, 0x4c9eed57
-0,       4333,       4333,        0,    84480, 0xc3b90e58
-0,       4375,       4375,        0,    84480, 0x3c042bfa
-0,       4416,       4416,        0,    84480, 0x19f8e890
-0,       4458,       4458,        0,    84480, 0xd3dacfb9
-0,       4500,       4500,        0,    84480, 0x2365fc6f
-0,       4541,       4541,        0,    84480, 0xa2c19d00
-0,       4583,       4583,        0,    84480, 0xce94336f
-0,       4625,       4625,        0,    84480, 0xfa9bcf14
-0,       4916,       4916,        0,    84480, 0x24d6a243
-0,       4958,       4958,        0,    84480, 0xae1c8854
-0,       5000,       5000,        0,    84480, 0xbb8968bf
-0,       5041,       5041,        0,    84480, 0x6f923623
-0,       5083,       5083,        0,    84480, 0x22e98029
-0,       5125,       5125,        0,    84480, 0x8ac33af3
-0,       5166,       5166,        0,    84480, 0x05947b6e
-0,       5208,       5208,        0,    84480, 0xfc35661a
-0,       5250,       5250,        0,    84480, 0x0e6b6e47
-0,       5291,       5291,        0,    84480, 0x82c764bb
-0,       5333,       5333,        0,    84480, 0x57a36833
-0,       5375,       5375,        0,    84480, 0xc8dd690a
-0,       5416,       5416,        0,    84480, 0x02c47232
-0,       5458,       5458,        0,    84480, 0x6645715d
-0,       5500,       5500,        0,    84480, 0xc64860f7
-0,       5541,       5541,        0,    84480, 0x4f5614b3
-0,       5583,       5583,        0,    84480, 0xa70842ca
-0,       5625,       5625,        0,    84480, 0x379d8458
-0,       5666,       5666,        0,    84480, 0xa14701cf
-0,       5708,       5708,        0,    84480, 0xad1aa2b2
-0,       5750,       5750,        0,    84480, 0xee28f320
-0,       5791,       5791,        0,    84480, 0x505801e9
-0,       5833,       5833,        0,    84480, 0x7947233b
-0,       5875,       5875,        0,    84480, 0x3ce72a9d
-0,       5916,       5916,        0,    84480, 0xa6834e64
-0,       5958,       5958,        0,    84480, 0xfebf4d70
-0,       6000,       6000,        0,    84480, 0x4a0775e2
-0,       6041,       6041,        0,    84480, 0x9d7e945b
-0,       6083,       6083,        0,    84480, 0xaa9eadd9
-0,       6125,       6125,        0,    84480, 0xaa85c9b1
-0,       6166,       6166,        0,    84480, 0xa005edaf
-0,       6208,       6208,        0,    84480, 0x7fc4e5cc
-0,       6250,       6250,        0,    84480, 0xb0f6e8d1
-0,       6291,       6291,        0,    84480, 0x9ef9f330
-0,       6333,       6333,        0,    84480, 0xbe14ff1f
-0,       6375,       6375,        0,    84480, 0xd494048c
-0,       6416,       6416,        0,    84480, 0x046166a7
-0,       6458,       6458,        0,    84480, 0x052a09b2
-0,       6500,       6500,        0,    84480, 0x71fff4ab
-0,       6541,       6541,        0,    84480, 0xb9684e41
-0,       6583,       6583,        0,    84480, 0x1ddce068
-0,       6625,       6625,        0,    84480, 0xb9de300e
-0,       6666,       6666,        0,    84480, 0x13962590
-0,       6708,       6708,        0,    84480, 0xde79482f
-0,       6750,       6750,        0,    84480, 0x7d1ca064
diff --git a/deps/libav/tests/ref/fate/wmv8-drm-nodec b/deps/libav/tests/ref/fate/wmv8-drm-nodec
deleted file mode 100644
index d6bf15e..0000000
--- a/deps/libav/tests/ref/fate/wmv8-drm-nodec
+++ /dev/null
@@ -1,152 +0,0 @@
-#tb 0: 1/1000
-#tb 1: 1/1000
-0,          0,          0,        0,      282, 0x000d949a
-1,          0,          0,        0,     1088, 0x5cd379bb
-1,        435,        435,        0,     1088, 0x8dfa1368
-1,        740,        740,        0,     1088, 0xc0d211be
-1,       1023,       1023,        0,     1088, 0x8238113a
-0,       1208,       1208,        0,      137, 0x903c415e
-0,       1250,       1250,        0,      942, 0xd5b7d2aa
-0,       1291,       1291,        0,      841, 0xaffd8ce6
-1,       1306,       1306,        0,     1088, 0x9f8924b7
-0,       1333,       1333,        0,     1164, 0x4ed84836
-0,       1375,       1375,        0,     1492, 0x37f3e8aa
-0,       1416,       1416,        0,     1663, 0xc091392d
-0,       1458,       1458,        0,     1443, 0x6162c718
-0,       1500,       1500,        0,     1721, 0x7bdb3dd0
-0,       1541,       1541,        0,     1410, 0xde689881
-0,       1583,       1583,        0,     1258, 0xb5b86920
-1,       1589,       1589,        0,     1088, 0x767f317a
-0,       1625,       1625,        0,     2050, 0x99b6d7c7
-0,       1666,       1666,        0,     1242, 0x9ba35009
-0,       1708,       1708,        0,     1630, 0x17f10192
-0,       1750,       1750,        0,     1747, 0xbbee59d7
-0,       1791,       1791,        0,     1565, 0xb09b00d9
-0,       1833,       1833,        0,     1573, 0xd2e62201
-1,       1872,       1872,        0,     1088, 0x57000d38
-0,       1875,       1875,        0,     1353, 0x2305a24d
-0,       1916,       1916,        0,     1425, 0xf41bbb46
-0,       1958,       1958,        0,     1355, 0xfc08a762
-0,       2000,       2000,        0,     1363, 0x98cda71d
-0,       2041,       2041,        0,     1547, 0x8742f11f
-0,       2083,       2083,        0,     1967, 0x43d61723
-0,       2125,       2125,        0,     1378, 0xde22c753
-0,       2166,       2166,        0,      961, 0x2418a4da
-1,       2198,       2198,        0,     1088, 0xad977261
-0,       2208,       2208,        0,      968, 0x0d04ba51
-0,       2250,       2250,        0,     1140, 0x737f3543
-0,       2291,       2291,        0,     1119, 0x3c050388
-0,       2333,       2333,        0,     1078, 0xeac8d981
-0,       2375,       2375,        0,     1113, 0xebfa0314
-0,       2416,       2416,        0,     1229, 0x95dc3cb5
-0,       2458,       2458,        0,     1311, 0x8a6f5bda
-0,       2500,       2500,        0,     1270, 0x2e66540a
-0,       2541,       2541,        0,     1408, 0x5f489779
-0,       2583,       2583,        0,     1359, 0x8bd085f5
-0,       2625,       2625,        0,     1428, 0xef9ba480
-0,       2666,       2666,        0,     1179, 0x5bb221a8
-0,       2708,       2708,        0,     1108, 0x9a6019a8
-0,       2750,       2750,        0,     1205, 0xccba4d22
-0,       2791,       2791,        0,     1306, 0xde708c19
-0,       2833,       2833,       41,     1724, 0xa70b521e
-0,       2875,       2875,       41,     1336, 0xdf3974b9
-0,       2916,       2916,       41,     1259, 0x1f6b4307
-0,       2958,       2958,       41,     1194, 0x635f5a43
-0,       3000,       3000,       41,     1183, 0x1dd47115
-0,       3041,       3041,       41,     1126, 0x5bac3cc8
-0,       3083,       3083,       41,     1360, 0x1fe2d981
-0,       3125,       3125,       41,     1261, 0x34288acb
-0,       3166,       3166,       41,     1250, 0x26bd72b3
-0,       3208,       3208,       41,     1147, 0x02e81ba0
-0,       3250,       3250,       41,     1368, 0xb8146962
-0,       3291,       3291,       41,     1377, 0xf7b6ce65
-0,       3333,       3333,       41,     1396, 0x88467dee
-0,       3375,       3375,       41,     1408, 0x5585c25c
-0,       3416,       3416,       41,     1551, 0x42002c8d
-0,       3458,       3458,       41,     1524, 0xbcb609e3
-1,       3482,       3482,        0,     1088, 0xdce57471
-0,       3500,       3500,       41,     1554, 0x3d740564
-0,       3541,       3541,       41,     1467, 0xc349f2d7
-0,       3583,       3583,       41,     1066, 0xb7401462
-0,       3625,       3625,       41,     1502, 0x3ee602ed
-0,       3666,       3666,       41,     1148, 0xba463637
-0,       3708,       3708,       41,     1351, 0x5e85ae79
-0,       3750,       3750,       41,     1187, 0xed8d6055
-0,       3791,       3791,       41,     1200, 0x64185be6
-0,       3833,       3833,       41,     1175, 0x12ad3c1e
-0,       3875,       3875,       41,     1179, 0x7e034570
-0,       3916,       3916,       41,     1136, 0x5c633c51
-1,       3918,       3918,        0,     1088, 0xf3887977
-0,       3958,       3958,       41,     1064, 0x5eb51d89
-0,       4000,       4000,       41,      953, 0xe148bbdd
-0,       4041,       4041,       41,      989, 0x901ec306
-0,       4083,       4083,       41,     1030, 0x680de26f
-0,       4125,       4125,       41,     1078, 0x86e0ee43
-0,       4166,       4166,       41,     1232, 0x98546a86
-0,       4208,       4208,       41,     1164, 0x93305074
-0,       4250,       4250,       41,     1348, 0x27cfa91b
-0,       4291,       4291,       41,     1417, 0x2312d70e
-0,       4333,       4333,       41,     1285, 0x46ca4cca
-1,       4353,       4353,        0,     1088, 0x1d6c8ed2
-0,       4375,       4375,       41,     1037, 0xcf09dd3d
-0,       4416,       4416,       41,     1005, 0xe780cf1f
-0,       4458,       4458,       41,      890, 0x8b1d8c1b
-0,       4500,       4500,       41,     1023, 0xd1dbd506
-0,       4541,       4541,       41,      803, 0x935e775e
-0,       4583,       4583,       41,     1035, 0x6a220483
-0,       4625,       4625,       41,      466, 0xd88bb237
-1,       4789,       4789,        0,     1088, 0x09115bae
-0,       4916,       4916,       41,      945, 0x8f2eb1ec
-0,       4958,       4958,       41,     1190, 0x4c451c1b
-0,       5000,       5000,       41,     1811, 0x727c52cb
-0,       5041,       5041,       41,     1552, 0x73f82bff
-0,       5083,       5083,       41,     1544, 0xa7241ece
-0,       5125,       5125,       41,     1707, 0x3d1a6464
-0,       5166,       5166,       41,     1103, 0x06b22710
-0,       5208,       5208,       41,     1122, 0x656725b8
-1,       5224,       5224,        0,     1088, 0x0c8b9372
-0,       5250,       5250,       41,     1150, 0xf9674678
-0,       5291,       5291,       41,     1438, 0x03fac426
-0,       5333,       5333,       41,     1623, 0x7adb1321
-0,       5375,       5375,       41,     1677, 0x0b9a3e62
-0,       5416,       5416,       41,     1124, 0x769c0ea2
-0,       5458,       5458,       41,     1221, 0xd942409f
-0,       5500,       5500,       41,     1698, 0xd7ca3fe3
-0,       5541,       5541,       41,     1262, 0xb994692f
-0,       5583,       5583,       41,     2097, 0xf4eb663f
-0,       5625,       5625,       41,     1251, 0xfd4f633a
-1,       5659,       5659,        0,     1088, 0x75a82540
-0,       5666,       5666,       41,     1633, 0xb7e1290e
-0,       5708,       5708,       41,     1739, 0xecd18c38
-0,       5750,       5750,       41,     1132, 0xc83e1828
-0,       5791,       5791,       41,      825, 0xdd02867c
-0,       5833,       5833,       41,      903, 0x349ba205
-0,       5875,       5875,       41,     1013, 0x1366ec2a
-0,       5916,       5916,       41,     1340, 0xeaa2a231
-0,       5958,       5958,       41,     1102, 0x82de2889
-0,       6000,       6000,       41,     1834, 0x59b99b92
-1,       6008,       6008,        0,     1088, 0x690312b0
-0,       6041,       6041,       41,     1332, 0x0610813a
-0,       6083,       6083,       41,     1275, 0x5b0d7be7
-0,       6125,       6125,       41,     1376, 0xd915b0fe
-0,       6166,       6166,       41,     1417, 0x8606b34a
-0,       6208,       6208,       41,     1360, 0x3bcd93d3
-0,       6250,       6250,       41,     1330, 0xd0439c93
-0,       6291,       6291,       41,     1562, 0xb2560a09
-1,       6312,       6312,        0,     1088, 0x76d50ff3
-0,       6333,       6333,       41,     1376, 0x4f9eb447
-0,       6375,       6375,       41,     1405, 0x85d3b084
-0,       6416,       6416,       41,     1344, 0xcdbda2ae
-0,       6458,       6458,       41,     1313, 0xe3067b35
-0,       6500,       6500,       41,     1459, 0xf9d2c56f
-0,       6541,       6541,       41,     1275, 0xf5536d81
-0,       6583,       6583,       41,     1209, 0x3b5b4ea5
-1,       6595,       6595,        0,     1088, 0x8766276f
-0,       6625,       6625,       41,     1352, 0x7b199d28
-0,       6666,       6666,       41,     1349, 0x02adaaf3
-0,       6708,       6708,       41,     1464, 0x20d7cfd2
-0,       6750,       6750,       41,     1377, 0x78e0b1f4
-0,       6791,       6791,       41,      289, 0x1f2e9246
-1,       6878,       6878,        0,     1088, 0x678f20fd
-1,       7161,       7161,        0,     1088, 0x718afa20
-1,       7444,       7444,        0,     1088, 0x758f0939
diff --git a/deps/libav/tests/ref/fate/wnv1 b/deps/libav/tests/ref/fate/wnv1
deleted file mode 100644
index 4de35bf..0000000
--- a/deps/libav/tests/ref/fate/wnv1
+++ /dev/null
@@ -1,87 +0,0 @@
-#tb 0: 13333/200000
-0,          0,          0,        1,    38400, 0x4c3fdc2f
-0,          1,          1,        1,    38400, 0x11c9d0cb
-0,          2,          2,        1,    38400, 0x6c37fd7f
-0,          3,          3,        1,    38400, 0x7e6c9b93
-0,          4,          4,        1,    38400, 0xc9d4c5f7
-0,          5,          5,        1,    38400, 0x5038088a
-0,          6,          6,        1,    38400, 0xa48411b6
-0,          7,          7,        1,    38400, 0xb9b7e97b
-0,          8,          8,        1,    38400, 0xce37e037
-0,          9,          9,        1,    38400, 0x5df528da
-0,         10,         10,        1,    38400, 0xe4e65876
-0,         11,         11,        1,    38400, 0x5bf4a46e
-0,         12,         12,        1,    38400, 0xee478c2a
-0,         13,         13,        1,    38400, 0x51a555c2
-0,         14,         14,        1,    38400, 0x30a4030a
-0,         15,         15,        1,    38400, 0xb13802d6
-0,         16,         16,        1,    38400, 0x45ef5482
-0,         17,         17,        1,    38400, 0x00aef51b
-0,         18,         18,        1,    38400, 0xe8a71d7e
-0,         19,         19,        1,    38400, 0x3d185142
-0,         20,         20,        1,    38400, 0x221f59ea
-0,         21,         21,        1,    38400, 0x1ae13572
-0,         22,         22,        1,    38400, 0xe498450e
-0,         23,         23,        1,    38400, 0xe744747a
-0,         24,         24,        1,    38400, 0x44ee3352
-0,         25,         25,        1,    38400, 0x74187342
-0,         26,         26,        1,    38400, 0xbee9656e
-0,         27,         27,        1,    38400, 0x645c8d1a
-0,         28,         28,        1,    38400, 0x443dde1e
-0,         29,         29,        1,    38400, 0x012106fd
-0,         30,         30,        1,    38400, 0x4bb86b82
-0,         31,         31,        1,    38400, 0x152473ba
-0,         32,         32,        1,    38400, 0xa5214ea2
-0,         33,         33,        1,    38400, 0x9e8c7046
-0,         34,         34,        1,    38400, 0xdd95a9ba
-0,         35,         35,        1,    38400, 0x64c5f292
-0,         36,         36,        1,    38400, 0xdd42a04a
-0,         37,         37,        1,    38400, 0x6069359e
-0,         38,         38,        1,    38400, 0x094bf60f
-0,         39,         39,        1,    38400, 0x584217be
-0,         40,         40,        1,    38400, 0x4c5ef453
-0,         41,         41,        1,    38400, 0x7e83eeb7
-0,         42,         42,        1,    38400, 0xaa57efb3
-0,         43,         43,        1,    38400, 0x42b0a66f
-0,         44,         44,        1,    38400, 0x371fdcbf
-0,         45,         45,        1,    38400, 0xb8f1e1bf
-0,         46,         46,        1,    38400, 0x45c91fa6
-0,         47,         47,        1,    38400, 0x7508338e
-0,         48,         48,        1,    38400, 0xb5dd91ab
-0,         49,         49,        1,    38400, 0x0204b38f
-0,         50,         50,        1,    38400, 0x8ae2da6f
-0,         51,         51,        1,    38400, 0x926ad59f
-0,         52,         52,        1,    38400, 0xf9c3234e
-0,         53,         53,        1,    38400, 0xabcb00f6
-0,         54,         54,        1,    38400, 0x2d1de7bb
-0,         55,         55,        1,    38400, 0x332d39ce
-0,         56,         56,        1,    38400, 0xcd767286
-0,         57,         57,        1,    38400, 0xf3d046ae
-0,         58,         58,        1,    38400, 0x7ccc8162
-0,         59,         59,        1,    38400, 0x09f6997e
-0,         60,         60,        1,    38400, 0x5fcc6536
-0,         61,         61,        1,    38400, 0x9959a3b6
-0,         62,         62,        1,    38400, 0x63a5dcd2
-0,         63,         63,        1,    38400, 0x66deae96
-0,         64,         64,        1,    38400, 0x6feb0b1d
-0,         65,         65,        1,    38400, 0x2063c25e
-0,         66,         66,        1,    38400, 0x617f93de
-0,         67,         67,        1,    38400, 0x4251c806
-0,         68,         68,        1,    38400, 0x702eb68e
-0,         69,         69,        1,    38400, 0xe80b8ea6
-0,         70,         70,        1,    38400, 0xa51ec1b2
-0,         71,         71,        1,    38400, 0x8aa8af8a
-0,         72,         72,        1,    38400, 0x9a260321
-0,         73,         73,        1,    38400, 0x2c732c22
-0,         74,         74,        1,    38400, 0x216ed6a2
-0,         75,         75,        1,    38400, 0x5558326d
-0,         76,         76,        1,    38400, 0x0cae4cf5
-0,         77,         77,        1,    38400, 0xf0e02f3d
-0,         78,         78,        1,    38400, 0xfddd061d
-0,         79,         79,        1,    38400, 0x4563e9d6
-0,         80,         80,        1,    38400, 0xc8ac10d1
-0,         81,         81,        1,    38400, 0x97f8c3fa
-0,         82,         82,        1,    38400, 0x86190eb1
-0,         83,         83,        1,    38400, 0xc9022d65
-0,         84,         84,        1,    38400, 0x345738d5
-0,         85,         85,        1,    38400, 0x457ae80e
diff --git a/deps/libav/tests/ref/fate/ws_snd b/deps/libav/tests/ref/fate/ws_snd
deleted file mode 100644
index 4004e33..0000000
--- a/deps/libav/tests/ref/fate/ws_snd
+++ /dev/null
@@ -1 +0,0 @@
-023317c7876aa5271f086f753d84561b
diff --git a/deps/libav/tests/ref/fate/wtv-demux b/deps/libav/tests/ref/fate/wtv-demux
deleted file mode 100644
index bdd6c20..0000000
--- a/deps/libav/tests/ref/fate/wtv-demux
+++ /dev/null
@@ -1,141 +0,0 @@
-#tb 0: 1/10000000
-#tb 1: 1/10000000
-1,         -2,         -2,   240000,      576, 0x9b6e1638
-1,     239998,     239998,   240000,      576, 0x0ca91183
-1,     479998,     479998,   240000,      576, 0xec6a180f
-1,     719998,     719998,   240000,      576, 0x478a2b9b
-1,     959998,     959998,   240000,      576, 0x00fa15b3
-1,    1199998,    1199998,   240000,      576, 0xfb551816
-1,    1439998,    1439998,   240000,      576, 0x422e12bd
-1,    1679998,    1679998,   240000,      576, 0xa7581b29
-1,    1919998,    1919998,   240000,      576, 0xd4b31a74
-1,    2159998,    2159998,   240000,      576, 0x11521b10
-1,    2399998,    2399998,   240000,      576, 0x3dcc1474
-1,    2639998,    2639998,   240000,      576, 0x66c31aab
-1,    2879998,    2879998,   240000,      576, 0x97f318a8
-1,    3119998,    3119998,   240000,      576, 0xd3fb1a30
-1,    3359998,    3359998,   240000,      576, 0xd2bd16af
-1,    3599998,    3599998,   240000,      576, 0x6c10146a
-1,    3839998,    3839998,   240000,      576, 0x10d81468
-1,    4079998,    4079998,   240000,      576, 0x3813162d
-1,    4319998,    4319998,   240000,      576, 0x89e71d95
-1,    4559998,    4559998,   240000,      576, 0xd1c717f9
-1,    4799998,    4799998,   240000,      576, 0x1a311e5f
-1,    5039998,    5039998,   240000,      576, 0x0ea80e05
-1,    5279998,    5279998,   240000,      576, 0x2f1718f2
-1,    5519998,    5519998,   240000,      576, 0xffe01e13
-1,    5759998,    5759998,   240000,      576, 0xa7b02296
-1,    5999998,    5999998,   240000,      576, 0x199f1597
-1,    6239998,    6239998,   240000,      576, 0xdea217ba
-1,    6479998,    6479998,   240000,      576, 0x8a790f01
-1,    6719998,    6719998,   240000,      576, 0x23e80038
-1,    6959998,    6959998,   240000,      576, 0x75dc048a
-1,    7199998,    7199998,   240000,      576, 0xeb4b0d93
-1,    7439998,    7439998,   240000,      576, 0xde1322f5
-1,    7679998,    7679998,   240000,      576, 0xc3131f35
-0,    7886331,    9486442,   400000,    41980, 0xd4920915
-1,    7919998,    7919998,   240000,      576, 0x708f1381
-1,    8159998,    8159998,   240000,      576, 0x1f00137e
-1,    8399998,    8399998,   240000,      576, 0x05131eb0
-1,    8639998,    8639998,   240000,      576, 0x78151c22
-0,    8686442,    8686442,   400000,     7228, 0x1b141fa3
-1,    8879998,    8879998,   240000,      576, 0x31771239
-0,    9086331,    9086331,   400000,     7492, 0x1a47f3e4
-1,    9119998,    9119998,   240000,      576, 0x3ce4097c
-1,    9359998,    9359998,   240000,      576, 0x180e15f4
-0,    9486442,   10686331,   400000,    25068, 0xcb70a744
-1,    9599998,    9599998,   240000,      576, 0x30db0604
-1,    9839998,    9839998,   240000,      576, 0x9b290284
-0,    9886442,    9886442,   400000,     7212, 0x0ab9f558
-1,   10079998,   10079998,   240000,      576, 0xcf340753
-0,   10286442,   10286442,   400000,     7612, 0xa93054f0
-1,   10319998,   10319998,   240000,      576, 0xdaa41457
-1,   10559998,   10559998,   240000,      576, 0x34d310a2
-0,   10686331,   11886331,   400000,    22868, 0xa77db64a
-1,   10799998,   10799998,   240000,      576, 0x58b31010
-1,   11039998,   11039998,   240000,      576, 0x19610f54
-0,   11086442,   11086442,   400000,     6260, 0x6cf76411
-1,   11279998,   11279998,   240000,      576, 0x17762352
-0,   11486331,   11486331,   400000,     6156, 0xe168394b
-1,   11519998,   11519998,   240000,      576, 0x1fea1448
-1,   11759998,   11759998,   240000,      576, 0x55840a01
-0,   11886331,   13086442,   449438,    23364, 0x53164f1e
-1,   11999998,   11999998,   240000,      576, 0x6c9c24ce
-1,   12239998,   12239998,   240000,      576, 0x955f1e97
-0,   12286442,   12286442,   449438,     6708, 0x89877269
-1,   12479998,   12479998,   240000,      576, 0x2827134f
-0,   12686442,   12686442,   449438,     6908, 0x8d62a249
-1,   12719998,   12719998,   240000,      576, 0x34a01c29
-1,   12959998,   12959998,   240000,      576, 0x7d351e52
-0,   13086442,   14286442,   449438,    38156, 0xec41f682
-1,   13199998,   13199998,   240000,      576, 0x00c91d9e
-1,   13439998,   13439998,   240000,      576, 0x57ea1a97
-0,   13486331,   13486331,   449438,     5764, 0xcc04534b
-1,   13679998,   13679998,   240000,      576, 0xef3a1c74
-0,   13886331,   13886331,   449438,     5388, 0xb8a1c3c5
-1,   13919998,   13919998,   240000,      576, 0x11fc217d
-1,   14159998,   14159998,   240000,      576, 0x59ce20e5
-0,   14286442,   15486331,   449438,    16764, 0x59460d96
-1,   14399998,   14399998,   240000,      576, 0xaafc1dbf
-1,   14639998,   14639998,   240000,      576, 0xdd941609
-0,   14686331,   14686331,   449438,     5548, 0x5c91e93d
-1,   14879998,   14879998,   240000,      576, 0x900420b0
-0,   15086331,   15086331,   449438,     5652, 0x5e321aed
-1,   15119998,   15119998,   240000,      576, 0x5f4f1aa1
-1,   15359998,   15359998,   240000,      576, 0x7d7e18de
-0,   15486331,   16686331,   449438,    15564, 0xefdf5080
-1,   15599998,   15599998,   240000,      576, 0x986c0d9d
-1,   15839998,   15839998,   240000,      576, 0xcb4c21c0
-0,   15886331,   15886331,   449438,     6492, 0xd1d5c5f8
-1,   16079998,   16079998,   240000,      576, 0xbcfb1e8b
-0,   16286331,   16286331,   449438,     5604, 0xf9472b44
-1,   16319998,   16319998,   240000,      576, 0xcb541b4c
-1,   16559998,   16559998,   240000,      576, 0x980426e9
-0,   16686331,   17886331,   449438,    17924, 0x45815b7b
-1,   16799998,   16799998,   240000,      576, 0x09d00aa0
-1,   17039998,   17039998,   240000,      576, 0xad591374
-0,   17086442,   17086442,   449438,     5020, 0x3cc5e554
-1,   17279998,   17279998,   240000,      576, 0x97bf1461
-0,   17486442,   17486442,   449438,     5276, 0xa0554c12
-1,   17519998,   17519998,   240000,      576, 0xdc871cc4
-1,   17759998,   17759998,   240000,      576, 0x56781896
-0,   17886331,   19086442,   449438,    31460, 0x5765eb5f
-1,   17999998,   17999998,   240000,      576, 0xc77714e3
-1,   18239998,   18239998,   240000,      576, 0x280e18d4
-0,   18286331,   18286331,   449438,     4972, 0x91adbab7
-1,   18479998,   18479998,   240000,      576, 0xbc0d2302
-0,   18686442,   18686442,   449438,     5580, 0xfea707cb
-1,   18719998,   18719998,   240000,      576, 0x79191384
-1,   18959998,   18959998,   240000,      576, 0x65481c97
-0,   19086442,   20286331,   449438,    17412, 0x0afe4d27
-1,   19199998,   19199998,   240000,      576, 0xc94d227d
-1,   19439998,   19439998,   240000,      576, 0xa68a1f14
-0,   19486442,   19486442,   449438,     5236, 0x03f55309
-1,   19679998,   19679998,   240000,      576, 0x6af11a5c
-0,   19886331,   19886331,   449438,     4924, 0x558e753c
-1,   19919998,   19919998,   240000,      576, 0x4d1019ef
-1,   20159998,   20159998,   240000,      576, 0x3b1b17b5
-0,   20286331,   21486331,   449438,    15396, 0xf145d121
-1,   20399998,   20399998,   240000,      576, 0xcdd8159f
-1,   20639998,   20639998,   240000,      576, 0x97cd1d06
-0,   20686331,   20686331,   449438,     4708, 0x43066a92
-1,   20879998,   20879998,   240000,      576, 0x5d1b1123
-0,   21086442,   21086442,   449438,     4332, 0x9e22bcba
-1,   21119998,   21119998,   240000,      576, 0x888d0cb0
-1,   21359998,   21359998,   240000,      576, 0x556e1dad
-0,   21486331,   22686442,   449438,    12876, 0x46ff9ef4
-1,   21599998,   21599998,   240000,      576, 0xf7af0bce
-1,   21839998,   21839998,   240000,      576, 0xb5da160a
-0,   21886442,   21886442,   449438,     5940, 0x27cba62e
-1,   22079998,   22079998,   240000,      576, 0x4a8d0e98
-0,   22286442,   22286442,   449438,     6124, 0x6bab0a6d
-1,   22319998,   22319998,   240000,      576, 0x183b1c7e
-1,   22559998,   22559998,   240000,      576, 0xc47120e6
-0,   22686442,   23886442,   449438,    36428, 0x942f9648
-1,   22799998,   22799998,   240000,      576, 0xb1f31346
-0,   23086331,   23086331,   449438,     6660, 0x545a0db7
-0,   23486331,   23486331,   449438,     6780, 0x2d1d4189
-0,   23886442,   25086331,   449438,    16460, 0x7c3b3ca4
-0,   24286442,   24286442,   449438,     6724, 0x8538cc6f
-0,   24686442,   24686442,   449438,     7068, 0x69574fd0
-0,   25086331,   26286331,   449438,    19552, 0xf230e854
diff --git a/deps/libav/tests/ref/fate/xmv-demux b/deps/libav/tests/ref/fate/xmv-demux
deleted file mode 100644
index 20c6ac1..0000000
--- a/deps/libav/tests/ref/fate/xmv-demux
+++ /dev/null
@@ -1,183 +0,0 @@
-#tb 0: 1/1000
-#tb 1: 16/11025
-0,          0,          0,        0,     1508, 0xefceba48
-1,          0,          0,       83,     5976, 0xfa2c2db9
-1,         83,         83,       83,     5976, 0x256b935c
-1,        166,        166,       83,     5976, 0xa78a9563
-1,        249,        249,       83,     5976, 0x4ea056f4
-1,        332,        332,       83,     5976, 0xda772d8d
-1,        415,        415,       83,     5976, 0xafacf7c9
-0,        640,        640,        0,      108, 0x06713c96
-0,        680,        680,        0,      952, 0xd306df7e
-0,        720,        720,        0,     2312, 0xaf316585
-1,        498,        498,       83,     5976, 0xdeb003f4
-0,        760,        760,        0,     3872, 0xfc1c527c
-0,        800,        800,        0,       20, 0xaffc0edd
-0,        840,        840,        0,     6600, 0xe1b66c7f
-1,        581,        581,       28,     2016, 0xa7380d36
-0,        880,        880,        0,     6868, 0xd5b3f631
-1,        609,        609,       28,     2016, 0xbc090bac
-0,        920,        920,        0,     8420, 0xf70ee33b
-1,        637,        637,       28,     2016, 0x6f8c164c
-0,        960,        960,        0,    13144, 0x9a54ef39
-1,        665,        665,       28,     2016, 0x13b80e28
-0,       1000,       1000,        0,     6340, 0xe55bf555
-1,        693,        693,       28,     2016, 0xd40ff863
-0,       1040,       1040,        0,     3736, 0x0b23f89f
-1,        721,        721,       28,     2016, 0x4d530ed7
-0,       1080,       1080,        0,     2624, 0x79e2e451
-1,        749,        749,       30,     2160, 0x0fbc37eb
-0,       1120,       1120,        0,     1860, 0x63886f11
-1,        779,        779,      192,    13824, 0x82fb2602
-0,       1160,       1160,        0,     1244, 0x74594601
-0,       1200,       1200,        0,      564, 0xf4561dfb
-0,       1240,       1240,        0,       80, 0xbf8e2e30
-0,       1280,       1280,        0,       20, 0xa0990c29
-1,        971,        971,      192,    13824, 0x08771caf
-1,       1163,       1163,      192,    13824, 0xdf7d4a65
-1,       1355,       1355,      193,    13896, 0x24bf3f47
-1,       1548,       1548,       50,     3600, 0x9ad26b9f
-1,       1598,       1598,       50,     3600, 0x8c666fd6
-1,       1648,       1648,       50,     3600, 0x305c6ca1
-1,       1698,       1698,       50,     3600, 0x48b04e1e
-0,       2480,       2480,        0,      104, 0x12413980
-0,       2520,       2520,        0,      796, 0x2e698ed3
-1,       1748,       1748,       50,     3600, 0x8c915935
-0,       2560,       2560,        0,     1808, 0x8b3e6e5e
-0,       2600,       2600,        0,     4712, 0xdbd51737
-1,       1798,       1798,       50,     3600, 0xa8f45e01
-0,       2640,       2640,        0,     5548, 0xee9c831c
-0,       2680,       2680,        0,     6152, 0x9c18ccc1
-1,       1848,       1848,       53,     3816, 0xc64cc5ed
-0,       2720,       2720,        0,     6452, 0x7860462a
-1,       1901,       1901,       27,     1944, 0x0ac2e3f1
-0,       2760,       2760,        0,     6676, 0xe1b1c9e4
-1,       1928,       1928,       27,     1944, 0x2197dccd
-0,       2800,       2800,        0,    10904, 0x0bded7b7
-1,       1955,       1955,       27,     1944, 0x0c02e77f
-0,       2840,       2840,        0,    12844, 0xe6d16cff
-1,       1982,       1982,       27,     1944, 0x675ee06a
-0,       2880,       2880,        0,    10920, 0xe114c46b
-1,       2009,       2009,       30,     2160, 0x0d803a8b
-0,       2920,       2920,        0,     5952, 0xb7464634
-1,       2039,       2039,       93,     6696, 0xa7a0dfea
-0,       2960,       2960,        0,     4732, 0x2fa2e36d
-0,       3000,       3000,        0,     2592, 0xf54ddd57
-0,       3040,       3040,        0,     1516, 0x4a1cd4d5
-0,       3080,       3080,        0,      864, 0x49889afc
-1,       2132,       2132,       93,     6696, 0x59aa3145
-0,       3120,       3120,        0,      468, 0x3932e6a4
-0,       3160,       3160,        0,      116, 0x2b8341e6
-0,       3200,       3200,        0,       16, 0x6a3109cf
-1,       2225,       2225,       93,     6696, 0x69be4d78
-1,       2318,       2318,       93,     6696, 0x64064c67
-1,       2411,       2411,       93,     6696, 0xc8536f98
-1,       2504,       2504,       93,     6696, 0xc0ce5199
-1,       2597,       2597,       94,     6768, 0x3b275c58
-1,       2691,       2691,      123,     8856, 0x90e5b37c
-0,       4000,       4000,        0,     1508, 0xefceba48
-1,       2814,       2814,      123,     8856, 0x86b33366
-1,       2937,       2937,      123,     8856, 0x19e18797
-1,       3060,       3060,      123,     8856, 0x0a0c7fbd
-1,       3183,       3183,      124,     8928, 0x4a9b2d42
-0,       4640,       4640,        0,      100, 0x45023894
-0,       4680,       4680,        0,      948, 0xa65ed345
-0,       4720,       4720,      108,     2808, 0xd7285746
-0,       4760,       4760,      108,     5372, 0x05794175
-1,       3307,       3307,       21,     1512, 0xed8b3f4b
-0,       4800,       4800,      108,    11596, 0x8636eca7
-1,       3328,       3328,       21,     1512, 0xa27d3891
-0,       4840,       4840,      108,    11524, 0xe1f39be3
-1,       3349,       3349,       21,     1512, 0xb0f13eb6
-0,       4880,       4880,      108,    23392, 0xab053f05
-1,       3370,       3370,       23,     1656, 0xe5a98324
-0,       4920,       4920,      108,     4560, 0x03197d07
-1,       3393,       3393,       31,     2232, 0x15445433
-0,       4960,       4960,      108,     4440, 0x1cc361a2
-1,       3424,       3424,       31,     2232, 0x5cb348a9
-0,       5000,       5000,      108,    23688, 0x16030634
-1,       3455,       3455,       31,     2232, 0xf10347da
-0,       5040,       5040,      108,    16132, 0xf0eca799
-1,       3486,       3486,       34,     2448, 0x3e16a175
-0,       5080,       5080,      108,    29896, 0x0c0988ea
-1,       3520,       3520,       35,     2520, 0x17e3ca2b
-0,       5120,       5120,      108,    19956, 0x0093aa0b
-1,       3555,       3555,       27,     1944, 0x35c2de84
-0,       5160,       5160,      108,    16392, 0x8829a9ca
-1,       3582,       3582,       27,     1944, 0x55b4db40
-0,       5200,       5200,      108,    16772, 0x9a4a546d
-1,       3609,       3609,       29,     2088, 0xdaae14b2
-0,       5240,       5240,      108,     8920, 0xcd8ca203
-1,       3638,       3638,       27,     1944, 0x92ccd37f
-0,       5280,       5280,      108,     9632, 0x53c1d37b
-1,       3665,       3665,       27,     1944, 0x70efede1
-0,       5320,       5320,      108,     8976, 0xfe4da2cc
-1,       3692,       3692,       27,     1944, 0x7601d304
-0,       5360,       5360,      108,     6680, 0x35348fe0
-1,       3719,       3719,       27,     1944, 0x3922ebc2
-0,       5400,       5400,      108,     9228, 0xcbf62b0c
-1,       3746,       3746,       30,     2160, 0xde462f2e
-0,       5440,       5440,      108,     5108, 0xd1d88511
-1,       3776,       3776,       26,     1872, 0x467ac1d2
-0,       5480,       5480,      108,    10016, 0xaff4b2b2
-1,       3802,       3802,       26,     1872, 0xa1e4cd43
-0,       5520,       5520,      108,     7468, 0x23e81ab8
-1,       3828,       3828,       26,     1872, 0x1dceccc6
-0,       5560,       5560,      108,     4172, 0x253cd05b
-1,       3854,       3854,       26,     1872, 0x2bbad2a5
-0,       5600,       5600,      108,     8188, 0x7ede743f
-1,       3880,       3880,       26,     1872, 0xc603d44d
-0,       5640,       5640,      108,     2884, 0x2dec55a3
-1,       3906,       3906,       26,     1872, 0x1b4cc261
-0,       5680,       5680,      108,     3900, 0xd0666a18
-1,       3932,       3932,       26,     1872, 0x10edd6cf
-0,       5720,       5720,      108,     2996, 0x9cc99b8c
-1,       3958,       3958,       33,     2376, 0xecdb9d61
-0,       5760,       5760,      108,     2156, 0xae612776
-1,       3991,       3991,       36,     2592, 0x5559eced
-0,       5800,       5800,      108,     3988, 0x0d2c9992
-0,       5840,       5840,      108,     1512, 0x6281fc00
-1,       4027,       4027,       36,     2592, 0x8848dfc7
-0,       5880,       5880,      108,     6544, 0xb75c2562
-1,       4063,       4063,       36,     2592, 0x4ca2d7da
-0,       5920,       5920,      108,     4108, 0xfb21efc9
-1,       4099,       4099,       36,     2592, 0x285fd7e6
-0,       5960,       5960,      108,     1096, 0x85922a37
-0,       6000,       6000,      108,     9740, 0xe57d7647
-1,       4135,       4135,       36,     2592, 0x2717e404
-0,       6040,       6040,      108,      416, 0x61c2ea02
-1,       4171,       4171,       36,     2592, 0xf106111a
-0,       6080,       6080,      108,      336, 0x1dc5ac1c
-1,       4207,       4207,       36,     2592, 0xd7d01119
-0,       6120,       6120,      108,      204, 0x16f57017
-1,       4243,       4243,       36,     2592, 0x550cfeda
-0,       6160,       6160,      108,      112, 0x78374234
-0,       6200,       6200,      108,       40, 0x6cb21985
-1,       4279,       4279,       36,     2592, 0x47ad00c4
-1,       4315,       4315,       36,     2592, 0x39bbf306
-1,       4351,       4351,       45,     3240, 0x69addfce
-1,       4396,       4396,      297,    21384, 0x254f63e0
-1,       4693,       4693,      298,    21456, 0x2f7a9859
-0,       6840,       6840,      108,    14420, 0x53324ca4
-0,       6880,       6880,      108,       40, 0x10971420
-1,       4991,       4991,      521,    37512, 0x6e962928
-1,       5512,       5512,       38,     2736, 0x1dc91c69
-0,       8000,       8000,      108,    24904, 0x15574f7e
-1,       5550,       5550,       38,     2736, 0x023434fd
-1,       5588,       5588,       38,     2736, 0x906f1541
-0,       8160,       8160,      108,     1908, 0xccb2dd3c
-1,       5626,       5626,       38,     2736, 0x85a31102
-0,       8200,       8200,      108,     4676, 0xbfa42b7e
-1,       5664,       5664,       42,     3024, 0x9296a5f3
-0,       8240,       8240,      108,     3600, 0x87c9dc58
-0,       8280,       8280,      108,     8184, 0x504a8e65
-1,       5706,       5706,       27,     1944, 0x7bf4dedc
-0,       8320,       8320,      108,     9636, 0x2efb3006
-1,       5733,       5733,       27,     1944, 0x4196c404
-1,       5760,       5760,       27,     1944, 0xcda97c7a
-0,       8360,       8360,      108,     9580, 0x0fb6f4e8
-1,       5787,       5787,       27,     1944, 0x5f4922b2
-0,       8400,       8400,      108,     7840, 0xe996f564
-1,       5814,       5814,       29,     2088, 0x37dfc157
-0,       8440,       8440,      108,     4208, 0xe9c2fba2
-0,       8480,       8480,      108,      556, 0x3f1e077c
diff --git a/deps/libav/tests/ref/fate/xtea b/deps/libav/tests/ref/fate/xtea
deleted file mode 100644
index fed0b4d..0000000
--- a/deps/libav/tests/ref/fate/xtea
+++ /dev/null
@@ -1 +0,0 @@
-Test encryption/decryption success.
diff --git a/deps/libav/tests/ref/fate/xvid-custom-matrix b/deps/libav/tests/ref/fate/xvid-custom-matrix
deleted file mode 100644
index 0361389..0000000
--- a/deps/libav/tests/ref/fate/xvid-custom-matrix
+++ /dev/null
@@ -1,21 +0,0 @@
-#tb 0: 1/25
-0,          1,          1,        1,   622080, 870e846b6b001d3e34fa87df96297e28
-0,          2,          2,        1,   622080, de1a3dd9fcc32086ecdffd4591a8defa
-0,          3,          3,        1,   622080, 59f5f16d4224e98e09f22818cc9227e0
-0,          4,          4,        1,   622080, 9744609bcf95107bdbe6a9e21dc22b9d
-0,          5,          5,        1,   622080, 6dc50ad4b5821cc20f418f2eb273a45c
-0,          6,          6,        1,   622080, 57012fc77d853c17591319cc528ebd93
-0,          7,          7,        1,   622080, fd0068955ce1583f21bb888ad3b6952a
-0,          8,          8,        1,   622080, 58b7bcb056fac5d34ec4197fe10723a7
-0,          9,          9,        1,   622080, 064311346d0ea2753f01f18f13188c27
-0,         10,         10,        1,   622080, 21995e49367aee152a11992f48317bbe
-0,         11,         11,        1,   622080, 288c2cd0ac0a3b74d23da6ba30111d55
-0,         12,         12,        1,   622080, 88db7bf240fd6ee5ef89c34522de76e8
-0,         13,         13,        1,   622080, 8e2d38686bbf768e812005decc37cb90
-0,         14,         14,        1,   622080, 3a7d3c036ecaa669d26660937a8b723e
-0,         15,         15,        1,   622080, 6c8b8e847c544125213c9f49d9607d98
-0,         16,         16,        1,   622080, 16b56117f1b327862f78421116dfe52e
-0,         17,         17,        1,   622080, a7ce423456a59bdb4d5921aff1a27691
-0,         18,         18,        1,   622080, 881c9561c9ab66a7659145173f8e8cda
-0,         19,         19,        1,   622080, 7413961f9accd1d32e116592a6448e9b
-0,         20,         20,        1,   622080, c66409494fd1714e6236596f476cece6
diff --git a/deps/libav/tests/ref/fate/xvid-idctmmx b/deps/libav/tests/ref/fate/xvid-idctmmx
deleted file mode 100644
index c3cafa3..0000000
--- a/deps/libav/tests/ref/fate/xvid-idctmmx
+++ /dev/null
@@ -1,21 +0,0 @@
-#tb 0: 1/25
-0,          1,          1,        1,   622080, 8fe318df973b5d7669e6d28ebf03b229
-0,          2,          2,        1,   622080, 3568d92074e0298a2027f990004fe1a6
-0,          3,          3,        1,   622080, 4781afb6ba38318738e26a98ace4061b
-0,          4,          4,        1,   622080, bd29a005b8392005ef30211f185ca049
-0,          5,          5,        1,   622080, fc50b441ee9256883edba5a584000d66
-0,          6,          6,        1,   622080, 5fce9fb7e66c9d0773ff9c7482cb8307
-0,          7,          7,        1,   622080, 2e0ad7b1ba39e60cdd7a65ed1ed57c30
-0,          8,          8,        1,   622080, b91cfdb91751dabd6691d3c34221b636
-0,          9,          9,        1,   622080, f65507bc00043e8fe345c542f0861a64
-0,         10,         10,        1,   622080, 2e4ee4ea4ec761c2298acced17f63f35
-0,         11,         11,        1,   622080, e7945bd07296205d1549c8edf843af48
-0,         12,         12,        1,   622080, 52fed0ec02c57a138de7dc0e0c804de8
-0,         13,         13,        1,   622080, 3ee2848d0d70795e14765127111a677c
-0,         14,         14,        1,   622080, 42cb0929406b10b95817ffaa2da47335
-0,         15,         15,        1,   622080, 523986866b6cf729e130ea43feacb0a2
-0,         16,         16,        1,   622080, 5d1e4becddf728e93bbcb428de1f02ae
-0,         17,         17,        1,   622080, 0a1453df21e4547447ec8f27a0d4d5ec
-0,         18,         18,        1,   622080, d3495686e769df299b1732326fa3f17e
-0,         19,         19,        1,   622080, 602e9020397b1e82b58b1ff6b9733d21
-0,         20,         20,        1,   622080, 759bd3f739a3b99309efa5c1a697e34d
diff --git a/deps/libav/tests/ref/fate/xwma-demux b/deps/libav/tests/ref/fate/xwma-demux
deleted file mode 100644
index 83a3b08..0000000
--- a/deps/libav/tests/ref/fate/xwma-demux
+++ /dev/null
@@ -1 +0,0 @@
-CRC=0x2ac2159e
diff --git a/deps/libav/tests/ref/fate/xxan-wc4 b/deps/libav/tests/ref/fate/xxan-wc4
deleted file mode 100644
index 88dcc98..0000000
--- a/deps/libav/tests/ref/fate/xxan-wc4
+++ /dev/null
@@ -1,22 +0,0 @@
-#tb 0: 1/15
-0,          0,          0,        1,    79360, 0x8537821b
-0,          1,          1,        1,    79360, 0x110c4343
-0,          2,          2,        1,    79360, 0xa85105bb
-0,          3,          3,        1,    79360, 0x87431836
-0,          4,          4,        1,    79360, 0x5c701720
-0,          5,          5,        1,    79360, 0x20308ce4
-0,          6,          6,        1,    79360, 0xe51d3794
-0,          7,          7,        1,    79360, 0x80e6f1e0
-0,          8,          8,        1,    79360, 0x5aff64cc
-0,          9,          9,        1,    79360, 0x1a3d9ab3
-0,         10,         10,        1,    79360, 0xe154a195
-0,         11,         11,        1,    79360, 0x608dafdc
-0,         12,         12,        1,    79360, 0x93edf73f
-0,         13,         13,        1,    79360, 0x56d97281
-0,         14,         14,        1,    79360, 0xe7a284e6
-0,         15,         15,        1,    79360, 0xd4e5e513
-0,         16,         16,        1,    79360, 0x0a952ab1
-0,         17,         17,        1,    79360, 0x3b21c91c
-0,         18,         18,        1,    79360, 0x943656cb
-0,         19,         19,        1,    79360, 0xffbdb94b
-0,         20,         20,        1,    79360, 0x74976e16
diff --git a/deps/libav/tests/ref/fate/yop b/deps/libav/tests/ref/fate/yop
deleted file mode 100644
index 1a56660..0000000
--- a/deps/libav/tests/ref/fate/yop
+++ /dev/null
@@ -1,7 +0,0 @@
-#tb 0: 1/12
-0,          0,          0,        1,   302760, 0x78939253
-0,          1,          1,        1,   302760, 0x534f5253
-0,          2,          2,        1,   302760, 0x25eaa782
-0,          3,          3,        1,   302760, 0x60861c3d
-0,          4,          4,        1,   302760, 0x43552521
-0,          5,          5,        1,   302760, 0x45abca02
diff --git a/deps/libav/tests/ref/fate/zerocodec b/deps/libav/tests/ref/fate/zerocodec
deleted file mode 100644
index 2d368c3..0000000
--- a/deps/libav/tests/ref/fate/zerocodec
+++ /dev/null
@@ -1,39 +0,0 @@
-#tb 0: 417083/10000000
-0,          0,          0,        1,  1843200, 0x04154bd5
-0,          1,          1,        1,  1843200, 0x3a872d04
-0,          2,          2,        1,  1843200, 0x3b1304a0
-0,          3,          3,        1,  1843200, 0x7474f383
-0,          4,          4,        1,  1843200, 0xce7d1331
-0,          5,          5,        1,  1843200, 0x3cdf496b
-0,          6,          6,        1,  1843200, 0xe9096da2
-0,          7,          7,        1,  1843200, 0x30be7925
-0,          8,          8,        1,  1843200, 0x600b820d
-0,          9,          9,        1,  1843200, 0xe7bb8df1
-0,         10,         10,        1,  1843200, 0x62848e08
-0,         11,         11,        1,  1843200, 0x9a71a7d5
-0,         12,         12,        1,  1843200, 0x743a9f10
-0,         13,         13,        1,  1843200, 0x62b0b185
-0,         14,         14,        1,  1843200, 0xd94eac47
-0,         15,         15,        1,  1843200, 0xa1007b1b
-0,         16,         16,        1,  1843200, 0x11d72cd6
-0,         17,         17,        1,  1843200, 0x141aee09
-0,         18,         18,        1,  1843200, 0x9a90c9d4
-0,         19,         19,        1,  1843200, 0x6bd5cd4c
-0,         20,         20,        1,  1843200, 0xdf2ec1cb
-0,         21,         21,        1,  1843200, 0xeecbcb6c
-0,         22,         22,        1,  1843200, 0x9ecace2f
-0,         23,         23,        1,  1843200, 0x7b59c318
-0,         24,         24,        1,  1843200, 0x050baf2d
-0,         25,         25,        1,  1843200, 0xada36a49
-0,         26,         26,        1,  1843200, 0x4f4d684f
-0,         27,         27,        1,  1843200, 0x9ddc8f33
-0,         28,         28,        1,  1843200, 0x914d9c7e
-0,         29,         29,        1,  1843200, 0x0dc3cab8
-0,         30,         30,        1,  1843200, 0x98f8d766
-0,         31,         31,        1,  1843200, 0x872e3c7b
-0,         32,         32,        1,  1843200, 0xdf7b3cea
-0,         33,         33,        1,  1843200, 0xf7864e53
-0,         34,         34,        1,  1843200, 0x13315ba8
-0,         35,         35,        1,  1843200, 0xc4586114
-0,         36,         36,        1,  1843200, 0x57a96275
-0,         37,         37,        1,  1843200, 0x6e756704
diff --git a/deps/libav/tests/ref/fate/zlib b/deps/libav/tests/ref/fate/zlib
deleted file mode 100644
index 4ff76ff..0000000
--- a/deps/libav/tests/ref/fate/zlib
+++ /dev/null
@@ -1,2 +0,0 @@
-#tb 0: 100/2997
-0,          0,          0,        1,   253440, 0x94af61e5
diff --git a/deps/libav/tests/ref/fate/zmbv-15bit b/deps/libav/tests/ref/fate/zmbv-15bit
deleted file mode 100644
index f054a9d..0000000
--- a/deps/libav/tests/ref/fate/zmbv-15bit
+++ /dev/null
@@ -1,160 +0,0 @@
-#tb 0: 250000/1585341
-0,          0,          0,        1,   192000, 0xe1d317d6
-0,          1,          1,        1,   192000, 0xe100109d
-0,          2,          2,        1,   192000, 0xecc69c65
-0,          3,          3,        1,   192000, 0x68f06324
-0,          4,          4,        1,   192000, 0x68f06324
-0,          5,          5,        1,   192000, 0x68f06324
-0,          6,          6,        1,   192000, 0x68f06324
-0,          7,          7,        1,   192000, 0x68f06324
-0,          8,          8,        1,   192000, 0x68f06324
-0,          9,          9,        1,   192000, 0x68f06324
-0,         10,         10,        1,   192000, 0x68f06324
-0,         11,         11,        1,   192000, 0x68f06324
-0,         12,         12,        1,   192000, 0x68f06324
-0,         13,         13,        1,   192000, 0x68f06324
-0,         14,         14,        1,   192000, 0x68f06324
-0,         15,         15,        1,   192000, 0x68f06324
-0,         16,         16,        1,   192000, 0x68f06324
-0,         17,         17,        1,   192000, 0x4c03d2e3
-0,         18,         18,        1,   192000, 0x4c03d2e3
-0,         19,         19,        1,   192000, 0x4c03d2e3
-0,         20,         20,        1,   192000, 0x4c03d2e3
-0,         21,         21,        1,   192000, 0xb562cf68
-0,         22,         22,        1,   192000, 0xb562cf68
-0,         23,         23,        1,   192000, 0xb562cf68
-0,         24,         24,        1,   192000, 0xb562cf68
-0,         25,         25,        1,   192000, 0xb562cf68
-0,         26,         26,        1,   192000, 0x0e5e03c7
-0,         27,         27,        1,   192000, 0x0e5e03c7
-0,         28,         28,        1,   192000, 0x0e5e03c7
-0,         29,         29,        1,   192000, 0x0e5e03c7
-0,         30,         30,        1,   192000, 0xeb2e0f67
-0,         31,         31,        1,   192000, 0xeb2e0f67
-0,         32,         32,        1,   192000, 0xeb2e0f67
-0,         33,         33,        1,   192000, 0xeb2e0f67
-0,         34,         34,        1,   192000, 0xeb2e0f67
-0,         35,         35,        1,   192000, 0xdce603c7
-0,         36,         36,        1,   192000, 0xdce603c7
-0,         37,         37,        1,   192000, 0xdce603c7
-0,         38,         38,        1,   192000, 0xdce603c7
-0,         39,         39,        1,   192000, 0xa8e7db08
-0,         40,         40,        1,   192000, 0xa8e7db08
-0,         41,         41,        1,   192000, 0xa8e7db08
-0,         42,         42,        1,   192000, 0xa8e7db08
-0,         43,         43,        1,   192000, 0xa8e7db08
-0,         44,         44,        1,   192000, 0x322a1b07
-0,         45,         45,        1,   192000, 0x322a1b07
-0,         46,         46,        1,   192000, 0x322a1b07
-0,         47,         47,        1,   192000, 0x322a1b07
-0,         48,         48,        1,   192000, 0x743206af
-0,         49,         49,        1,   192000, 0x743206af
-0,         50,         50,        1,   192000, 0x743206af
-0,         51,         51,        1,   192000, 0x743206af
-0,         52,         52,        1,   192000, 0x743206af
-0,         53,         53,        1,   192000, 0x50195ddf
-0,         54,         54,        1,   192000, 0x50195ddf
-0,         55,         55,        1,   192000, 0x50195ddf
-0,         56,         56,        1,   192000, 0x50195ddf
-0,         57,         57,        1,   192000, 0xd31620d7
-0,         58,         58,        1,   192000, 0xd31620d7
-0,         59,         59,        1,   192000, 0xd31620d7
-0,         60,         60,        1,   192000, 0xd31620d7
-0,         61,         61,        1,   192000, 0xd31620d7
-0,         62,         62,        1,   192000, 0x3af023bf
-0,         63,         63,        1,   192000, 0x3af023bf
-0,         64,         64,        1,   192000, 0x3af023bf
-0,         65,         65,        1,   192000, 0x3af023bf
-0,         66,         66,        1,   192000, 0x561a124f
-0,         67,         67,        1,   192000, 0x561a124f
-0,         68,         68,        1,   192000, 0x561a124f
-0,         69,         69,        1,   192000, 0x561a124f
-0,         70,         70,        1,   192000, 0x561a124f
-0,         71,         71,        1,   192000, 0x99210c7f
-0,         72,         72,        1,   192000, 0x99210c7f
-0,         73,         73,        1,   192000, 0x99210c7f
-0,         74,         74,        1,   192000, 0x99210c7f
-0,         75,         75,        1,   192000, 0xc77b03c7
-0,         76,         76,        1,   192000, 0xc77b03c7
-0,         77,         77,        1,   192000, 0xc77b03c7
-0,         78,         78,        1,   192000, 0xc77b03c7
-0,         79,         79,        1,   192000, 0xc77b03c7
-0,         80,         80,        1,   192000, 0x83ea7550
-0,         81,         81,        1,   192000, 0xec285270
-0,         82,         82,        1,   192000, 0x0e075558
-0,         83,         83,        1,   192000, 0x880c2108
-0,         84,         84,        1,   192000, 0x40c523f0
-0,         85,         85,        1,   192000, 0x01378f78
-0,         86,         86,        1,   192000, 0x42045558
-0,         87,         87,        1,   192000, 0xde8f3278
-0,         88,         88,        1,   192000, 0xa58c0110
-0,         89,         89,        1,   192000, 0x335ea9d1
-0,         90,         90,        1,   192000, 0x7e94bb41
-0,         91,         91,        1,   192000, 0x9cc5d569
-0,         92,         92,        1,   192000, 0xe942e109
-0,         93,         93,        1,   192000, 0x4cb83848
-0,         94,         94,        1,   192000, 0x6986fe19
-0,         95,         95,        1,   192000, 0xbb8c23f0
-0,         96,         96,        1,   192000, 0x296766c8
-0,         97,         97,        1,   192000, 0xb4230cb0
-0,         98,         98,        1,   192000, 0x2c2f1850
-0,         99,         99,        1,   192000, 0x93c70110
-0,        100,        100,        1,   192000, 0xb830a9d1
-0,        101,        101,        1,   192000, 0xbed48fa9
-0,        102,        102,        1,   192000, 0xc087bb41
-0,        103,        103,        1,   192000, 0x792de6d9
-0,        104,        104,        1,   192000, 0x1edaf849
-0,        105,        105,        1,   192000, 0x6564bb41
-0,        106,        106,        1,   192000, 0x9153d569
-0,        107,        107,        1,   192000, 0xe73ff561
-0,        108,        108,        1,   192000, 0xfa3be3f1
-0,        109,        109,        1,   192000, 0x8008fe19
-0,        110,        110,        1,   192000, 0xd2561b38
-0,        111,        111,        1,   192000, 0xae3c26d8
-0,        112,        112,        1,   192000, 0xb0114f88
-0,        113,        113,        1,   192000, 0x117e1e20
-0,        114,        114,        1,   192000, 0x482d1280
-0,        115,        115,        1,   192000, 0x425106e0
-0,        116,        116,        1,   192000, 0x0e6b0cb0
-0,        117,        117,        1,   192000, 0x95dc2ca8
-0,        118,        118,        1,   192000, 0x52097b20
-0,        119,        119,        1,   192000, 0x41a84f88
-0,        120,        120,        1,   192000, 0xb78d7268
-0,        121,        121,        1,   192000, 0x2cd366c8
-0,        122,        122,        1,   192000, 0xbf39e109
-0,        123,        123,        1,   192000, 0xecbaeca9
-0,        124,        124,        1,   192000, 0x3254eca9
-0,        125,        125,        1,   192000, 0x3fc903f8
-0,        126,        126,        1,   192000, 0x0bbc5e10
-0,        127,        127,        1,   192000, 0xe9103560
-0,        128,        128,        1,   192000, 0xbd5d2f90
-0,        129,        129,        1,   192000, 0x7ace2ca8
-0,        130,        130,        1,   192000, 0x7354c6e1
-0,        131,        131,        1,   192000, 0x72e0d569
-0,        132,        132,        1,   192000, 0xa4ade3f1
-0,        133,        133,        1,   192000, 0xf2f8cf99
-0,        134,        134,        1,   192000, 0x2b7ee6d9
-0,        135,        135,        1,   192000, 0x548d1b38
-0,        136,        136,        1,   192000, 0xa1551b38
-0,        137,        137,        1,   192000, 0xfb3e3560
-0,        138,        138,        1,   192000, 0x3aaaccb1
-0,        139,        139,        1,   192000, 0xa85ee109
-0,        140,        140,        1,   192000, 0xc1bff849
-0,        141,        141,        1,   192000, 0xa62bef91
-0,        142,        142,        1,   192000, 0xddf40cb0
-0,        143,        143,        1,   192000, 0x15bb3e18
-0,        144,        144,        1,   192000, 0x92fd5558
-0,        145,        145,        1,   192000, 0x2d365270
-0,        146,        146,        1,   192000, 0xb5f343e8
-0,        147,        147,        1,   192000, 0x93042108
-0,        148,        148,        1,   192000, 0x96d59830
-0,        149,        149,        1,   192000, 0x1f69ddf0
-0,        150,        150,        1,   192000, 0x8eb0124f
-0,        151,        151,        1,   192000, 0xae727dd7
-0,        152,        152,        1,   192000, 0xb8a63aff
-0,        153,        153,        1,   192000, 0xfae83de7
-0,        154,        154,        1,   192000, 0x2f034987
-0,        155,        155,        1,   192000, 0xa99e1537
-0,        156,        156,        1,   192000, 0x0ad70c7f
-0,        157,        157,        1,   192000, 0x74b3e990
-0,        158,        158,        1,   192000, 0x1bf0d250
diff --git a/deps/libav/tests/ref/fate/zmbv-16bit b/deps/libav/tests/ref/fate/zmbv-16bit
deleted file mode 100644
index b0c3df5..0000000
--- a/deps/libav/tests/ref/fate/zmbv-16bit
+++ /dev/null
@@ -1,160 +0,0 @@
-#tb 0: 250000/1585341
-0,          0,          0,        1,   192000, 0x11e62dbe
-0,          1,          1,        1,   192000, 0x31698b8f
-0,          2,          2,        1,   192000, 0x31698b8f
-0,          3,          3,        1,   192000, 0x31698b8f
-0,          4,          4,        1,   192000, 0x31698b8f
-0,          5,          5,        1,   192000, 0x31698b8f
-0,          6,          6,        1,   192000, 0x31698b8f
-0,          7,          7,        1,   192000, 0x31698b8f
-0,          8,          8,        1,   192000, 0x31698b8f
-0,          9,          9,        1,   192000, 0x31698b8f
-0,         10,         10,        1,   192000, 0x31698b8f
-0,         11,         11,        1,   192000, 0x31698b8f
-0,         12,         12,        1,   192000, 0x31698b8f
-0,         13,         13,        1,   192000, 0x4ca609ea
-0,         14,         14,        1,   192000, 0x4ca609ea
-0,         15,         15,        1,   192000, 0x4ca609ea
-0,         16,         16,        1,   192000, 0x4ca609ea
-0,         17,         17,        1,   192000, 0x33dd0a8b
-0,         18,         18,        1,   192000, 0x33dd0a8b
-0,         19,         19,        1,   192000, 0x33dd0a8b
-0,         20,         20,        1,   192000, 0x33dd0a8b
-0,         21,         21,        1,   192000, 0x33dd0a8b
-0,         22,         22,        1,   192000, 0x08e2420f
-0,         23,         23,        1,   192000, 0x08e2420f
-0,         24,         24,        1,   192000, 0x08e2420f
-0,         25,         25,        1,   192000, 0x08e2420f
-0,         26,         26,        1,   192000, 0x7b7b50ab
-0,         27,         27,        1,   192000, 0x7b7b50ab
-0,         28,         28,        1,   192000, 0x7b7b50ab
-0,         29,         29,        1,   192000, 0x7b7b50ab
-0,         30,         30,        1,   192000, 0x7b7b50ab
-0,         31,         31,        1,   192000, 0x128744fb
-0,         32,         32,        1,   192000, 0x128744fb
-0,         33,         33,        1,   192000, 0x128744fb
-0,         34,         34,        1,   192000, 0x128744fb
-0,         35,         35,        1,   192000, 0x8643163b
-0,         36,         36,        1,   192000, 0x8643163b
-0,         37,         37,        1,   192000, 0x8643163b
-0,         38,         38,        1,   192000, 0x8643163b
-0,         39,         39,        1,   192000, 0x8643163b
-0,         40,         40,        1,   192000, 0x4f7c596f
-0,         41,         41,        1,   192000, 0x4f7c596f
-0,         42,         42,        1,   192000, 0x4f7c596f
-0,         43,         43,        1,   192000, 0x4f7c596f
-0,         44,         44,        1,   192000, 0xa275420f
-0,         45,         45,        1,   192000, 0xa275420f
-0,         46,         46,        1,   192000, 0xa275420f
-0,         47,         47,        1,   192000, 0xa275420f
-0,         48,         48,        1,   192000, 0xa275420f
-0,         49,         49,        1,   192000, 0x2e4796cb
-0,         50,         50,        1,   192000, 0x2e4796cb
-0,         51,         51,        1,   192000, 0x2e4796cb
-0,         52,         52,        1,   192000, 0x2e4796cb
-0,         53,         53,        1,   192000, 0xebd45683
-0,         54,         54,        1,   192000, 0xebd45683
-0,         55,         55,        1,   192000, 0xebd45683
-0,         56,         56,        1,   192000, 0xebd45683
-0,         57,         57,        1,   192000, 0xebd45683
-0,         58,         58,        1,   192000, 0x0bf6596f
-0,         59,         59,        1,   192000, 0x0bf6596f
-0,         60,         60,        1,   192000, 0x0bf6596f
-0,         61,         61,        1,   192000, 0x0bf6596f
-0,         62,         62,        1,   192000, 0xb7af47e7
-0,         63,         63,        1,   192000, 0xb7af47e7
-0,         64,         64,        1,   192000, 0xb7af47e7
-0,         65,         65,        1,   192000, 0xb7af47e7
-0,         66,         66,        1,   192000, 0xb7af47e7
-0,         67,         67,        1,   192000, 0x8bc344fb
-0,         68,         68,        1,   192000, 0x8bc344fb
-0,         69,         69,        1,   192000, 0x8bc344fb
-0,         70,         70,        1,   192000, 0x8bc344fb
-0,         71,         71,        1,   192000, 0x8bc344fb
-0,         72,         72,        1,   192000, 0x02a23f23
-0,         73,         73,        1,   192000, 0x02a23f23
-0,         74,         74,        1,   192000, 0x02a23f23
-0,         75,         75,        1,   192000, 0x02a23f23
-0,         76,         76,        1,   192000, 0x17be3087
-0,         77,         77,        1,   192000, 0x52c7b2d4
-0,         78,         78,        1,   192000, 0xa05e9888
-0,         79,         79,        1,   192000, 0x4d6a6cb4
-0,         80,         80,        1,   192000, 0x3e2189ec
-0,         81,         81,        1,   192000, 0xfbe3ca34
-0,         82,         82,        1,   192000, 0xa9cd8fc4
-0,         83,         83,        1,   192000, 0x986e6cb4
-0,         84,         84,        1,   192000, 0x42373b08
-0,         85,         85,        1,   192000, 0xab96e351
-0,         86,         86,        1,   192000, 0x28ccf4d9
-0,         87,         87,        1,   192000, 0xc19e0f34
-0,         88,         88,        1,   192000, 0xd8da1ae4
-0,         89,         89,        1,   192000, 0xd015728c
-0,         90,         90,        1,   192000, 0x550623a8
-0,         91,         91,        1,   192000, 0x3c5c5268
-0,         92,         92,        1,   192000, 0x3eae8128
-0,         93,         93,        1,   192000, 0x3c51381c
-0,         94,         94,        1,   192000, 0x745046b8
-0,         95,         95,        1,   192000, 0xa8bd43cc
-0,         96,         96,        1,   192000, 0xde8fe351
-0,         97,         97,        1,   192000, 0x3d5cc905
-0,         98,         98,        1,   192000, 0xcf8df4d9
-0,         99,         99,        1,   192000, 0x698b20bc
-0,        100,        100,        1,   192000, 0x159d3244
-0,        101,        101,        1,   192000, 0xba1af4d9
-0,        102,        102,        1,   192000, 0x033a0f34
-0,        103,        103,        1,   192000, 0x72612f58
-0,        104,        104,        1,   192000, 0x11e11dd0
-0,        105,        105,        1,   192000, 0x4fc04f7c
-0,        106,        106,        1,   192000, 0x37779888
-0,        107,        107,        1,   192000, 0xabfc5e18
-0,        108,        108,        1,   192000, 0x0ad97e3c
-0,        109,        109,        1,   192000, 0xddf492b0
-0,        110,        110,        1,   192000, 0x198b23a8
-0,        111,        111,        1,   192000, 0x6b491220
-0,        112,        112,        1,   192000, 0x632417f8
-0,        113,        113,        1,   192000, 0x0dc5381c
-0,        114,        114,        1,   192000, 0x6d548700
-0,        115,        115,        1,   192000, 0xae0c5b2c
-0,        116,        116,        1,   192000, 0x23427e3c
-0,        117,        117,        1,   192000, 0x5def728c
-0,        118,        118,        1,   192000, 0xec831ae4
-0,        119,        119,        1,   192000, 0x00000000
-0,        120,        120,        1,   192000, 0x00000000
-0,        121,        121,        1,   192000, 0x00000000
-0,        122,        122,        1,   192000, 0x00000000
-0,        123,        123,        1,   192000, 0x00000000
-0,        124,        124,        1,   192000, 0x00000000
-0,        125,        125,        1,   192000, 0x00000000
-0,        126,        126,        1,   192000, 0x00000000
-0,        127,        127,        1,   192000, 0x00000000
-0,        128,        128,        1,   192000, 0xd6050414
-0,        129,        129,        1,   192000, 0xf9f90594
-0,        130,        130,        1,   192000, 0xa6220704
-0,        131,        131,        1,   192000, 0x54570858
-0,        132,        132,        1,   192000, 0xd81109ac
-0,        133,        133,        1,   192000, 0xc0540afc
-0,        134,        134,        1,   192000, 0x83ee0c20
-0,        135,        135,        1,   192000, 0x2a810d3c
-0,        136,        136,        1,   192000, 0xb3a71844
-0,        137,        137,        1,   192000, 0xd4ff1c7c
-0,        138,        138,        1,   192000, 0x92b21fdc
-0,        139,        139,        1,   192000, 0x03912364
-0,        140,        140,        1,   192000, 0x65c9262c
-0,        141,        141,        1,   192000, 0xf2e5290c
-0,        142,        142,        1,   192000, 0xc8cc2b4c
-0,        143,        143,        1,   192000, 0x272a2f1c
-0,        144,        144,        1,   192000, 0xa672313c
-0,        145,        145,        1,   192000, 0xab01331c
-0,        146,        146,        1,   192000, 0x92643458
-0,        147,        147,        1,   192000, 0x9a943548
-0,        148,        148,        1,   192000, 0x3eb735ac
-0,        149,        149,        1,   192000, 0x3eb735ac
-0,        150,        150,        1,   192000, 0x3eb735ac
-0,        151,        151,        1,   192000, 0x3eb735ac
-0,        152,        152,        1,   192000, 0x3eb735ac
-0,        153,        153,        1,   192000, 0x3eb735ac
-0,        154,        154,        1,   192000, 0x3eb735ac
-0,        155,        155,        1,   192000, 0x3eb735ac
-0,        156,        156,        1,   192000, 0x3eb735ac
-0,        157,        157,        1,   192000, 0x3eb735ac
-0,        158,        158,        1,   192000, 0x3eb735ac
diff --git a/deps/libav/tests/ref/fate/zmbv-32bit b/deps/libav/tests/ref/fate/zmbv-32bit
deleted file mode 100644
index e1df123..0000000
--- a/deps/libav/tests/ref/fate/zmbv-32bit
+++ /dev/null
@@ -1,160 +0,0 @@
-#tb 0: 250000/1585341
-0,          0,          0,        1,   192000, 0x3ac10e8e
-0,          1,          1,        1,   192000, 0xb772ee57
-0,          2,          2,        1,   192000, 0x9b6e648a
-0,          3,          3,        1,   192000, 0x3d9c33e3
-0,          4,          4,        1,   192000, 0x006db76d
-0,          5,          5,        1,   192000, 0x006db76d
-0,          6,          6,        1,   192000, 0x006db76d
-0,          7,          7,        1,   192000, 0x006db76d
-0,          8,          8,        1,   192000, 0x006db76d
-0,          9,          9,        1,   192000, 0x006db76d
-0,         10,         10,        1,   192000, 0x006db76d
-0,         11,         11,        1,   192000, 0x006db76d
-0,         12,         12,        1,   192000, 0x006db76d
-0,         13,         13,        1,   192000, 0x006db76d
-0,         14,         14,        1,   192000, 0x006db76d
-0,         15,         15,        1,   192000, 0x7b9b28fb
-0,         16,         16,        1,   192000, 0x7b9b28fb
-0,         17,         17,        1,   192000, 0x7b9b28fb
-0,         18,         18,        1,   192000, 0x7b9b28fb
-0,         19,         19,        1,   192000, 0x7b9b28fb
-0,         20,         20,        1,   192000, 0x7b9b28fb
-0,         21,         21,        1,   192000, 0x67be3519
-0,         22,         22,        1,   192000, 0x67be3519
-0,         23,         23,        1,   192000, 0x67be3519
-0,         24,         24,        1,   192000, 0x67be3519
-0,         25,         25,        1,   192000, 0x67be3519
-0,         26,         26,        1,   192000, 0x2ece70dd
-0,         27,         27,        1,   192000, 0x2ece70dd
-0,         28,         28,        1,   192000, 0x2ece70dd
-0,         29,         29,        1,   192000, 0x2ece70dd
-0,         30,         30,        1,   192000, 0x2ece70dd
-0,         31,         31,        1,   192000, 0x2ece70dd
-0,         32,         32,        1,   192000, 0xd3a382cb
-0,         33,         33,        1,   192000, 0xd3a382cb
-0,         34,         34,        1,   192000, 0xd3a382cb
-0,         35,         35,        1,   192000, 0xd3a382cb
-0,         36,         36,        1,   192000, 0xd3a382cb
-0,         37,         37,        1,   192000, 0xd3a382cb
-0,         38,         38,        1,   192000, 0x2d3d7fce
-0,         39,         39,        1,   192000, 0x2d3d7fce
-0,         40,         40,        1,   192000, 0x2d3d7fce
-0,         41,         41,        1,   192000, 0x2d3d7fce
-0,         42,         42,        1,   192000, 0x2d3d7fce
-0,         43,         43,        1,   192000, 0x36fd52fb
-0,         44,         44,        1,   192000, 0x36fd52fb
-0,         45,         45,        1,   192000, 0x36fd52fb
-0,         46,         46,        1,   192000, 0x36fd52fb
-0,         47,         47,        1,   192000, 0x36fd52fb
-0,         48,         48,        1,   192000, 0x36fd52fb
-0,         49,         49,        1,   192000, 0xa38e9ab3
-0,         50,         50,        1,   192000, 0x57095eef
-0,         51,         51,        1,   192000, 0x5c4f4d01
-0,         52,         52,        1,   192000, 0xac20321c
-0,         53,         53,        1,   192000, 0x7e370e40
-0,         54,         54,        1,   192000, 0xe9d92925
-0,         55,         55,        1,   192000, 0xfef4d26d
-0,         56,         56,        1,   192000, 0x77a4ab94
-0,         57,         57,        1,   192000, 0x802fb18e
-0,         58,         58,        1,   192000, 0xce968db2
-0,         59,         59,        1,   192000, 0x21e6ab94
-0,         60,         60,        1,   192000, 0x309d45fa
-0,         61,         61,        1,   192000, 0x5d193709
-0,         62,         62,        1,   192000, 0x72190d33
-0,         63,         63,        1,   192000, 0xdaed162a
-0,         64,         64,        1,   192000, 0x2fcaf23f
-0,         65,         65,        1,   192000, 0x8986d45d
-0,         66,         66,        1,   192000, 0xcf7de34e
-0,         67,         67,        1,   192000, 0x22390d33
-0,         68,         68,        1,   192000, 0x4b29132d
-0,         69,         69,        1,   192000, 0xbffe1f21
-0,         70,         70,        1,   192000, 0xa4eee34e
-0,         71,         71,        1,   192000, 0xe85ae64b
-0,         72,         72,        1,   192000, 0xb7bef23f
-0,         73,         73,        1,   192000, 0x05ab1927
-0,         74,         74,        1,   192000, 0x915f6cd3
-0,         75,         75,        1,   192000, 0x524d69d6
-0,         76,         76,        1,   192000, 0x62da78c7
-0,         77,         77,        1,   192000, 0xbf6f84bb
-0,         78,         78,        1,   192000, 0xbe9f6cd3
-0,         79,         79,        1,   192000, 0x80d0132d
-0,         80,         80,        1,   192000, 0x0789251b
-0,         81,         81,        1,   192000, 0xba1a1f21
-0,         82,         82,        1,   192000, 0x542b42fd
-0,         83,         83,        1,   192000, 0x0ff951ee
-0,         84,         84,        1,   192000, 0x785048f7
-0,         85,         85,        1,   192000, 0x5a50251b
-0,         86,         86,        1,   192000, 0xd5d73a06
-0,         87,         87,        1,   192000, 0x7a3a54eb
-0,         88,         88,        1,   192000, 0x1e2b5de2
-0,         89,         89,        1,   192000, 0xeac542fd
-0,         90,         90,        1,   192000, 0x897a1f21
-0,         91,         91,        1,   192000, 0x61602b15
-0,         92,         92,        1,   192000, 0xb12f221e
-0,         93,         93,        1,   192000, 0x08541f21
-0,         94,         94,        1,   192000, 0xeebd251b
-0,         95,         95,        1,   192000, 0xc1132e12
-0,         96,         96,        1,   192000, 0x99642818
-0,         97,         97,        1,   192000, 0x9b8e162a
-0,         98,         98,        1,   192000, 0x21b81f21
-0,         99,         99,        1,   192000, 0x1abd1030
-0,        100,        100,        1,   192000, 0x0d613d03
-0,        101,        101,        1,   192000, 0xcb32132d
-0,        102,        102,        1,   192000, 0xc680162a
-0,        103,        103,        1,   192000, 0x8dea2818
-0,        104,        104,        1,   192000, 0x3c4e1927
-0,        105,        105,        1,   192000, 0xed733709
-0,        106,        106,        1,   192000, 0xf4051c24
-0,        107,        107,        1,   192000, 0xb8eb221e
-0,        108,        108,        1,   192000, 0x1a412818
-0,        109,        109,        1,   192000, 0x6ee6162a
-0,        110,        110,        1,   192000, 0xe1a248f7
-0,        111,        111,        1,   192000, 0xc2c2221e
-0,        112,        112,        1,   192000, 0x7fdf1f21
-0,        113,        113,        1,   192000, 0x85bc251b
-0,        114,        114,        1,   192000, 0xe77c251b
-0,        115,        115,        1,   192000, 0x8789340c
-0,        116,        116,        1,   192000, 0xb6014000
-0,        117,        117,        1,   192000, 0xaa9542fd
-0,        118,        118,        1,   192000, 0x36ce54eb
-0,        119,        119,        1,   192000, 0xd1324ef1
-0,        120,        120,        1,   192000, 0x0ade60df
-0,        121,        121,        1,   192000, 0xfac56cd3
-0,        122,        122,        1,   192000, 0x00000000
-0,        123,        123,        1,   192000, 0x00000000
-0,        124,        124,        1,   192000, 0xc61c026a
-0,        125,        125,        1,   192000, 0x60810842
-0,        126,        126,        1,   192000, 0x65081393
-0,        127,        127,        1,   192000, 0xc806209f
-0,        128,        128,        1,   192000, 0x53aa32cb
-0,        129,        129,        1,   192000, 0x176546ef
-0,        130,        130,        1,   192000, 0x4e095d0e
-0,        131,        131,        1,   192000, 0xf74b7774
-0,        132,        132,        1,   192000, 0x32809306
-0,        133,        133,        1,   192000, 0x5219ae81
-0,        134,        134,        1,   192000, 0x3badcc40
-0,        135,        135,        1,   192000, 0x1387ea5d
-0,        136,        136,        1,   192000, 0xe0c606f0
-0,        137,        137,        1,   192000, 0x106f2197
-0,        138,        138,        1,   192000, 0xfe2139cf
-0,        139,        139,        1,   192000, 0x907d4f0a
-0,        140,        140,        1,   192000, 0x04415dad
-0,        141,        141,        1,   192000, 0xe0b864b6
-0,        142,        142,        1,   192000, 0xcb2a64b8
-0,        143,        143,        1,   192000, 0xcb2a64b8
-0,        144,        144,        1,   192000, 0xcb2a64b8
-0,        145,        145,        1,   192000, 0xcb2a64b8
-0,        146,        146,        1,   192000, 0xcb2a64b8
-0,        147,        147,        1,   192000, 0xcb2a64b8
-0,        148,        148,        1,   192000, 0xcb2a64b8
-0,        149,        149,        1,   192000, 0xcb2a64b8
-0,        150,        150,        1,   192000, 0xcb2a64b8
-0,        151,        151,        1,   192000, 0xcb2a64b8
-0,        152,        152,        1,   192000, 0xcb2a64b8
-0,        153,        153,        1,   192000, 0xcb2a64b8
-0,        154,        154,        1,   192000, 0xcb2a64b8
-0,        155,        155,        1,   192000, 0xcb2a64b8
-0,        156,        156,        1,   192000, 0xcb2a64b8
-0,        157,        157,        1,   192000, 0xcb2a64b8
-0,        158,        158,        1,   192000, 0xcb2a64b8
diff --git a/deps/libav/tests/ref/fate/zmbv-8bit b/deps/libav/tests/ref/fate/zmbv-8bit
deleted file mode 100644
index 64dacae..0000000
--- a/deps/libav/tests/ref/fate/zmbv-8bit
+++ /dev/null
@@ -1,276 +0,0 @@
-#tb 0: 1000000/70086303
-0,          0,          0,        1,   192000, 0x5234b617
-0,          1,          1,        1,   192000, 0x5234b617
-0,          2,          2,        1,   192000, 0x5234b617
-0,          3,          3,        1,   192000, 0x5234b617
-0,          4,          4,        1,   192000, 0x5234b617
-0,          5,          5,        1,   192000, 0x5234b617
-0,          6,          6,        1,   192000, 0x5234b617
-0,          7,          7,        1,   192000, 0x5234b617
-0,          8,          8,        1,   192000, 0x5234b617
-0,          9,          9,        1,   192000, 0x5234b617
-0,         10,         10,        1,   192000, 0x5234b617
-0,         11,         11,        1,   192000, 0x5234b617
-0,         12,         12,        1,   192000, 0x5234b617
-0,         13,         13,        1,   192000, 0x5234b617
-0,         14,         14,        1,   192000, 0x5234b617
-0,         15,         15,        1,   192000, 0x5234b617
-0,         16,         16,        1,   192000, 0x5234b617
-0,         17,         17,        1,   192000, 0x5234b617
-0,         18,         18,        1,   192000, 0x5234b617
-0,         19,         19,        1,   192000, 0x5234b617
-0,         20,         20,        1,   192000, 0x5234b617
-0,         21,         21,        1,   192000, 0x5234b617
-0,         22,         22,        1,   192000, 0x5234b617
-0,         23,         23,        1,   192000, 0x5234b617
-0,         24,         24,        1,   192000, 0x5234b617
-0,         25,         25,        1,   192000, 0x5234b617
-0,         26,         26,        1,   192000, 0x5234b617
-0,         27,         27,        1,   192000, 0x5234b617
-0,         28,         28,        1,   192000, 0x5234b617
-0,         29,         29,        1,   192000, 0x5234b617
-0,         30,         30,        1,   192000, 0x5234b617
-0,         31,         31,        1,   192000, 0x5234b617
-0,         32,         32,        1,   192000, 0x5234b617
-0,         33,         33,        1,   192000, 0x5234b617
-0,         34,         34,        1,   192000, 0x5234b617
-0,         35,         35,        1,   192000, 0x5234b617
-0,         36,         36,        1,   192000, 0x5234b617
-0,         37,         37,        1,   192000, 0x5234b617
-0,         38,         38,        1,   192000, 0x5234b617
-0,         39,         39,        1,   192000, 0x5234b617
-0,         40,         40,        1,   192000, 0x5234b617
-0,         41,         41,        1,   192000, 0x5234b617
-0,         42,         42,        1,   192000, 0x5234b617
-0,         43,         43,        1,   192000, 0x5234b617
-0,         44,         44,        1,   192000, 0x5234b617
-0,         45,         45,        1,   192000, 0x5234b617
-0,         46,         46,        1,   192000, 0x5234b617
-0,         47,         47,        1,   192000, 0x5234b617
-0,         48,         48,        1,   192000, 0x5234b617
-0,         49,         49,        1,   192000, 0x5234b617
-0,         50,         50,        1,   192000, 0x5234b617
-0,         51,         51,        1,   192000, 0x5234b617
-0,         52,         52,        1,   192000, 0x5234b617
-0,         53,         53,        1,   192000, 0x5234b617
-0,         54,         54,        1,   192000, 0x5234b617
-0,         55,         55,        1,   192000, 0x5234b617
-0,         56,         56,        1,   192000, 0x5234b617
-0,         57,         57,        1,   192000, 0x5234b617
-0,         58,         58,        1,   192000, 0x5234b617
-0,         59,         59,        1,   192000, 0x5234b617
-0,         60,         60,        1,   192000, 0x5234b617
-0,         61,         61,        1,   192000, 0x5234b617
-0,         62,         62,        1,   192000, 0x5234b617
-0,         63,         63,        1,   192000, 0x5234b617
-0,         64,         64,        1,   192000, 0x5234b617
-0,         65,         65,        1,   192000, 0x5234b617
-0,         66,         66,        1,   192000, 0x5234b617
-0,         67,         67,        1,   192000, 0x5234b617
-0,         68,         68,        1,   192000, 0x5234b617
-0,         69,         69,        1,   192000, 0x5234b617
-0,         70,         70,        1,   192000, 0x5234b617
-0,         71,         71,        1,   192000, 0x5234b617
-0,         72,         72,        1,   192000, 0x5234b617
-0,         73,         73,        1,   192000, 0x5234b617
-0,         74,         74,        1,   192000, 0x5234b617
-0,         75,         75,        1,   192000, 0x5234b617
-0,         76,         76,        1,   192000, 0x5234b617
-0,         77,         77,        1,   192000, 0x5234b617
-0,         78,         78,        1,   192000, 0x5234b617
-0,         79,         79,        1,   192000, 0x5234b617
-0,         80,         80,        1,   192000, 0x5234b617
-0,         81,         81,        1,   192000, 0x5234b617
-0,         82,         82,        1,   192000, 0x5234b617
-0,         83,         83,        1,   192000, 0x5234b617
-0,         84,         84,        1,   192000, 0x5234b617
-0,         85,         85,        1,   192000, 0x5234b617
-0,         86,         86,        1,   192000, 0x0c148693
-0,         87,         87,        1,   192000, 0x973f438b
-0,         88,         88,        1,   192000, 0x602a279b
-0,         89,         89,        1,   192000, 0x739c7527
-0,         90,         90,        1,   192000, 0x4ef4b477
-0,         91,         91,        1,   192000, 0x8fffec23
-0,         92,         92,        1,   192000, 0xe192c706
-0,         93,         93,        1,   192000, 0xf38000e5
-0,         94,         94,        1,   192000, 0x628b9051
-0,         95,         95,        1,   192000, 0xd7c162c0
-0,         96,         96,        1,   192000, 0xd4b85307
-0,         97,         97,        1,   192000, 0x377cf8cf
-0,         98,         98,        1,   192000, 0xf1ffdff2
-0,         99,         99,        1,   192000, 0x95a0ab01
-0,        100,        100,        1,   192000, 0xeb69c7f0
-0,        101,        101,        1,   192000, 0xfbd0af52
-0,        102,        102,        1,   192000, 0x32da6d10
-0,        103,        103,        1,   192000, 0xca8e7836
-0,        104,        104,        1,   192000, 0x404cefe9
-0,        105,        105,        1,   192000, 0x0433e9c8
-0,        106,        106,        1,   192000, 0xd6e09ecf
-0,        107,        107,        1,   192000, 0xc9a822b5
-0,        108,        108,        1,   192000, 0x032f2398
-0,        109,        109,        1,   192000, 0x9e0305bf
-0,        110,        110,        1,   192000, 0x9d66c993
-0,        111,        111,        1,   192000, 0xe126b022
-0,        112,        112,        1,   192000, 0xb59d2829
-0,        113,        113,        1,   192000, 0x967ad5b1
-0,        114,        114,        1,   192000, 0xb76ad1dc
-0,        115,        115,        1,   192000, 0xc901e6e3
-0,        116,        116,        1,   192000, 0xd22bc862
-0,        117,        117,        1,   192000, 0xe7547295
-0,        118,        118,        1,   192000, 0x179a8d78
-0,        119,        119,        1,   192000, 0x87a4310f
-0,        120,        120,        1,   192000, 0x4e24d3b3
-0,        121,        121,        1,   192000, 0xb1b8e58a
-0,        122,        122,        1,   192000, 0x0ae55330
-0,        123,        123,        1,   192000, 0xdb3288ab
-0,        124,        124,        1,   192000, 0x31867a92
-0,        125,        125,        1,   192000, 0x2a44a0a5
-0,        126,        126,        1,   192000, 0x29c062f4
-0,        127,        127,        1,   192000, 0xf4df3a2b
-0,        128,        128,        1,   192000, 0x8e424f86
-0,        129,        129,        1,   192000, 0x25b901f9
-0,        130,        130,        1,   192000, 0x77af6cad
-0,        131,        131,        1,   192000, 0x0b82d562
-0,        132,        132,        1,   192000, 0x4322dc3e
-0,        133,        133,        1,   192000, 0x4322dc3e
-0,        134,        134,        1,   192000, 0x4322dc3e
-0,        135,        135,        1,   192000, 0x2c51f91e
-0,        136,        136,        1,   192000, 0x2c51f91e
-0,        137,        137,        1,   192000, 0x2c51f91e
-0,        138,        138,        1,   192000, 0x2c51f91e
-0,        139,        139,        1,   192000, 0x197128e5
-0,        140,        140,        1,   192000, 0x197128e5
-0,        141,        141,        1,   192000, 0x197128e5
-0,        142,        142,        1,   192000, 0xb67867c5
-0,        143,        143,        1,   192000, 0xb67867c5
-0,        144,        144,        1,   192000, 0xb67867c5
-0,        145,        145,        1,   192000, 0xb67867c5
-0,        146,        146,        1,   192000, 0x62fcac19
-0,        147,        147,        1,   192000, 0x62fcac19
-0,        148,        148,        1,   192000, 0x62fcac19
-0,        149,        149,        1,   192000, 0xe4f4f281
-0,        150,        150,        1,   192000, 0xe4f4f281
-0,        151,        151,        1,   192000, 0xe4f4f281
-0,        152,        152,        1,   192000, 0xe4f4f281
-0,        153,        153,        1,   192000, 0x060c3190
-0,        154,        154,        1,   192000, 0x060c3190
-0,        155,        155,        1,   192000, 0x060c3190
-0,        156,        156,        1,   192000, 0xe5c05bb4
-0,        157,        157,        1,   192000, 0xe5c05bb4
-0,        158,        158,        1,   192000, 0xe5c05bb4
-0,        159,        159,        1,   192000, 0xe5c05bb4
-0,        160,        160,        1,   192000, 0xd4b187fc
-0,        161,        161,        1,   192000, 0xd4b187fc
-0,        162,        162,        1,   192000, 0xd4b187fc
-0,        163,        163,        1,   192000, 0x9a549a6c
-0,        164,        164,        1,   192000, 0x9a549a6c
-0,        165,        165,        1,   192000, 0x9a549a6c
-0,        166,        166,        1,   192000, 0x9a549a6c
-0,        167,        167,        1,   192000, 0xd491bd50
-0,        168,        168,        1,   192000, 0xd491bd50
-0,        169,        169,        1,   192000, 0xd491bd50
-0,        170,        170,        1,   192000, 0xfdfad4a8
-0,        171,        171,        1,   192000, 0xfdfad4a8
-0,        172,        172,        1,   192000, 0xfdfad4a8
-0,        173,        173,        1,   192000, 0xfdfad4a8
-0,        174,        174,        1,   192000, 0x363ef77c
-0,        175,        175,        1,   192000, 0x363ef77c
-0,        176,        176,        1,   192000, 0x363ef77c
-0,        177,        177,        1,   192000, 0x80c016f7
-0,        178,        178,        1,   192000, 0x80c016f7
-0,        179,        179,        1,   192000, 0x80c016f7
-0,        180,        180,        1,   192000, 0x80c016f7
-0,        181,        181,        1,   192000, 0x65852e7f
-0,        182,        182,        1,   192000, 0x65852e7f
-0,        183,        183,        1,   192000, 0x65852e7f
-0,        184,        184,        1,   192000, 0xcb13542b
-0,        185,        185,        1,   192000, 0xcb13542b
-0,        186,        186,        1,   192000, 0xcb13542b
-0,        187,        187,        1,   192000, 0xcb13542b
-0,        188,        188,        1,   192000, 0xb7a5664f
-0,        189,        189,        1,   192000, 0xb7a5664f
-0,        190,        190,        1,   192000, 0xb7a5664f
-0,        191,        191,        1,   192000, 0x8a128fd7
-0,        192,        192,        1,   192000, 0x8a128fd7
-0,        193,        193,        1,   192000, 0x8a128fd7
-0,        194,        194,        1,   192000, 0x8a128fd7
-0,        195,        195,        1,   192000, 0x9674b39b
-0,        196,        196,        1,   192000, 0x9674b39b
-0,        197,        197,        1,   192000, 0x9674b39b
-0,        198,        198,        1,   192000, 0x2940e3b3
-0,        199,        199,        1,   192000, 0x2940e3b3
-0,        200,        200,        1,   192000, 0x2940e3b3
-0,        201,        201,        1,   192000, 0x2940e3b3
-0,        202,        202,        1,   192000, 0x0440e56b
-0,        203,        203,        1,   192000, 0x0440e56b
-0,        204,        204,        1,   192000, 0x0440e56b
-0,        205,        205,        1,   192000, 0xefa3d16b
-0,        206,        206,        1,   192000, 0xefa3d16b
-0,        207,        207,        1,   192000, 0xefa3d16b
-0,        208,        208,        1,   192000, 0xefa3d16b
-0,        209,        209,        1,   192000, 0x6569b257
-0,        210,        210,        1,   192000, 0x6569b257
-0,        211,        211,        1,   192000, 0x6569b257
-0,        212,        212,        1,   192000, 0x089985d7
-0,        213,        213,        1,   192000, 0x089985d7
-0,        214,        214,        1,   192000, 0x089985d7
-0,        215,        215,        1,   192000, 0x089985d7
-0,        216,        216,        1,   192000, 0x87e160af
-0,        217,        217,        1,   192000, 0x87e160af
-0,        218,        218,        1,   192000, 0x87e160af
-0,        219,        219,        1,   192000, 0x117433bb
-0,        220,        220,        1,   192000, 0x117433bb
-0,        221,        221,        1,   192000, 0x117433bb
-0,        222,        222,        1,   192000, 0x117433bb
-0,        223,        223,        1,   192000, 0xd9e0f8bc
-0,        224,        224,        1,   192000, 0xd9e0f8bc
-0,        225,        225,        1,   192000, 0xd9e0f8bc
-0,        226,        226,        1,   192000, 0x653cac38
-0,        227,        227,        1,   192000, 0x653cac38
-0,        228,        228,        1,   192000, 0x653cac38
-0,        229,        229,        1,   192000, 0x653cac38
-0,        230,        230,        1,   192000, 0x9070526c
-0,        231,        231,        1,   192000, 0x9070526c
-0,        232,        232,        1,   192000, 0x9070526c
-0,        233,        233,        1,   192000, 0x15e6e9c9
-0,        234,        234,        1,   192000, 0x15e6e9c9
-0,        235,        235,        1,   192000, 0x15e6e9c9
-0,        236,        236,        1,   192000, 0x15e6e9c9
-0,        237,        237,        1,   192000, 0x610eab25
-0,        238,        238,        1,   192000, 0x610eab25
-0,        239,        239,        1,   192000, 0x610eab25
-0,        240,        240,        1,   192000, 0xde2a829d
-0,        241,        241,        1,   192000, 0xde2a829d
-0,        242,        242,        1,   192000, 0xde2a829d
-0,        243,        243,        1,   192000, 0xde2a829d
-0,        244,        244,        1,   192000, 0x2014becd
-0,        245,        245,        1,   192000, 0x2014becd
-0,        246,        246,        1,   192000, 0x2014becd
-0,        247,        247,        1,   192000, 0x551e0f98
-0,        248,        248,        1,   192000, 0x551e0f98
-0,        249,        249,        1,   192000, 0x551e0f98
-0,        250,        250,        1,   192000, 0x551e0f98
-0,        251,        251,        1,   192000, 0x4aaa6bec
-0,        252,        252,        1,   192000, 0x4aaa6bec
-0,        253,        253,        1,   192000, 0x4aaa6bec
-0,        254,        254,        1,   192000, 0x4053d278
-0,        255,        255,        1,   192000, 0x4053d278
-0,        256,        256,        1,   192000, 0x4053d278
-0,        257,        257,        1,   192000, 0x4053d278
-0,        258,        258,        1,   192000, 0xa0e645db
-0,        259,        259,        1,   192000, 0xa0e645db
-0,        260,        260,        1,   192000, 0xa0e645db
-0,        261,        261,        1,   192000, 0x3f1fc327
-0,        262,        262,        1,   192000, 0x3f1fc327
-0,        263,        263,        1,   192000, 0x3f1fc327
-0,        264,        264,        1,   192000, 0x3f1fc327
-0,        265,        265,        1,   192000, 0xa4ca2a9a
-0,        266,        266,        1,   192000, 0xa4ca2a9a
-0,        267,        267,        1,   192000, 0xa4ca2a9a
-0,        268,        268,        1,   192000, 0xf1b2b22e
-0,        269,        269,        1,   192000, 0xf1b2b22e
-0,        270,        270,        1,   192000, 0xf1b2b22e
-0,        271,        271,        1,   192000, 0xf1b2b22e
-0,        272,        272,        1,   192000, 0xd08e49d1
-0,        273,        273,        1,   192000, 0xd08e49d1
-0,        274,        274,        1,   192000, 0xd08e49d1
diff --git a/deps/libav/tests/ref/lavf/aiff b/deps/libav/tests/ref/lavf/aiff
deleted file mode 100644
index c713d02..0000000
--- a/deps/libav/tests/ref/lavf/aiff
+++ /dev/null
@@ -1,3 +0,0 @@
-9d9e55431800bf6aea46a7d67509da4e *./tests/data/lavf/lavf.aif
-88254 ./tests/data/lavf/lavf.aif
-./tests/data/lavf/lavf.aif CRC=0x3a1da17e
diff --git a/deps/libav/tests/ref/lavf/alaw b/deps/libav/tests/ref/lavf/alaw
deleted file mode 100644
index d93d6fc..0000000
--- a/deps/libav/tests/ref/lavf/alaw
+++ /dev/null
@@ -1,3 +0,0 @@
-652d96e474869ddb01403743deb35117 *./tests/data/lavf/lavf.al
-44100 ./tests/data/lavf/lavf.al
-./tests/data/lavf/lavf.al CRC=0xf9643112
diff --git a/deps/libav/tests/ref/lavf/asf b/deps/libav/tests/ref/lavf/asf
deleted file mode 100644
index 572cfc5..0000000
--- a/deps/libav/tests/ref/lavf/asf
+++ /dev/null
@@ -1,3 +0,0 @@
-327385dd5f418faa6237089a40159b78 *./tests/data/lavf/lavf.asf
-333375 ./tests/data/lavf/lavf.asf
-./tests/data/lavf/lavf.asf CRC=0xf6340a10
diff --git a/deps/libav/tests/ref/lavf/au b/deps/libav/tests/ref/lavf/au
deleted file mode 100644
index 71cfdcb..0000000
--- a/deps/libav/tests/ref/lavf/au
+++ /dev/null
@@ -1,3 +0,0 @@
-b9396e3775ea009094e751e7128d614e *./tests/data/lavf/lavf.au
-88224 ./tests/data/lavf/lavf.au
-./tests/data/lavf/lavf.au CRC=0x3a1da17e
diff --git a/deps/libav/tests/ref/lavf/avi b/deps/libav/tests/ref/lavf/avi
deleted file mode 100644
index 08ae042..0000000
--- a/deps/libav/tests/ref/lavf/avi
+++ /dev/null
@@ -1,3 +0,0 @@
-e2e7b7ceaf038b259558f41df203ded9 *./tests/data/lavf/lavf.avi
-330786 ./tests/data/lavf/lavf.avi
-./tests/data/lavf/lavf.avi CRC=0x4c963cda
diff --git a/deps/libav/tests/ref/lavf/bmp b/deps/libav/tests/ref/lavf/bmp
deleted file mode 100644
index b79ee4d..0000000
--- a/deps/libav/tests/ref/lavf/bmp
+++ /dev/null
@@ -1,3 +0,0 @@
-71f4d64a6b3c71f43a4eff526f84841c *./tests/data/images/bmp/02.bmp
-./tests/data/images/bmp/%02d.bmp CRC=0x3447369b
-304182 ./tests/data/images/bmp/02.bmp
diff --git a/deps/libav/tests/ref/lavf/dpx b/deps/libav/tests/ref/lavf/dpx
deleted file mode 100644
index a9f1169..0000000
--- a/deps/libav/tests/ref/lavf/dpx
+++ /dev/null
@@ -1,3 +0,0 @@
-808ea110635774252439722a48329d61 *./tests/data/images/dpx/02.dpx
-./tests/data/images/dpx/%02d.dpx CRC=0x28c7369b
-305792 ./tests/data/images/dpx/02.dpx
diff --git a/deps/libav/tests/ref/lavf/dv_fmt b/deps/libav/tests/ref/lavf/dv_fmt
deleted file mode 100644
index c2b7335..0000000
--- a/deps/libav/tests/ref/lavf/dv_fmt
+++ /dev/null
@@ -1,3 +0,0 @@
-eb51fbb48af28584ea5515f9f2400fcd *./tests/data/lavf/lavf.dv
-3600000 ./tests/data/lavf/lavf.dv
-./tests/data/lavf/lavf.dv CRC=0x0e868a82
diff --git a/deps/libav/tests/ref/lavf/ffm b/deps/libav/tests/ref/lavf/ffm
deleted file mode 100644
index 7518a81..0000000
--- a/deps/libav/tests/ref/lavf/ffm
+++ /dev/null
@@ -1,3 +0,0 @@
-f3f0c42283b75bc826f499f048085c27 *./tests/data/lavf/lavf.ffm
-376832 ./tests/data/lavf/lavf.ffm
-./tests/data/lavf/lavf.ffm CRC=0xdd24439e
diff --git a/deps/libav/tests/ref/lavf/flv_fmt b/deps/libav/tests/ref/lavf/flv_fmt
deleted file mode 100644
index 1d38b6f..0000000
--- a/deps/libav/tests/ref/lavf/flv_fmt
+++ /dev/null
@@ -1,3 +0,0 @@
-62c3177547fb5853a5116661802e1ae2 *./tests/data/lavf/lavf.flv
-329541 ./tests/data/lavf/lavf.flv
-./tests/data/lavf/lavf.flv CRC=0x881785d1
diff --git a/deps/libav/tests/ref/lavf/gif b/deps/libav/tests/ref/lavf/gif
deleted file mode 100644
index 4a4ebfb..0000000
--- a/deps/libav/tests/ref/lavf/gif
+++ /dev/null
@@ -1,3 +0,0 @@
-e6089fd4ef3b9df44090ab3650bdd810 *./tests/data/lavf/lavf.gif
-2906401 ./tests/data/lavf/lavf.gif
-./tests/data/lavf/lavf.gif CRC=0xe5605ff6
diff --git a/deps/libav/tests/ref/lavf/gxf b/deps/libav/tests/ref/lavf/gxf
deleted file mode 100644
index e25d4f2..0000000
--- a/deps/libav/tests/ref/lavf/gxf
+++ /dev/null
@@ -1,3 +0,0 @@
-eaa16531d0b2f3e3ade2186cf33dbf86 *./tests/data/lavf/lavf.gxf
-796392 ./tests/data/lavf/lavf.gxf
-./tests/data/lavf/lavf.gxf CRC=0xd04c769f
diff --git a/deps/libav/tests/ref/lavf/jpg b/deps/libav/tests/ref/lavf/jpg
deleted file mode 100644
index 584a97a..0000000
--- a/deps/libav/tests/ref/lavf/jpg
+++ /dev/null
@@ -1,3 +0,0 @@
-131878fee153a086d740543fbf2ab359 *./tests/data/images/jpg/02.jpg
-./tests/data/images/jpg/%02d.jpg CRC=0x9d770966
-28406 ./tests/data/images/jpg/02.jpg
diff --git a/deps/libav/tests/ref/lavf/mkv b/deps/libav/tests/ref/lavf/mkv
deleted file mode 100644
index 2bf1543..0000000
--- a/deps/libav/tests/ref/lavf/mkv
+++ /dev/null
@@ -1,3 +0,0 @@
-7c21e1e6b4fe71f361564f8eebedf4e1 *./tests/data/lavf/lavf.mkv
-320268 ./tests/data/lavf/lavf.mkv
-./tests/data/lavf/lavf.mkv CRC=0x7d5d3cda
diff --git a/deps/libav/tests/ref/lavf/mmf b/deps/libav/tests/ref/lavf/mmf
deleted file mode 100644
index 947abc7..0000000
--- a/deps/libav/tests/ref/lavf/mmf
+++ /dev/null
@@ -1,3 +0,0 @@
-1a3bbf19a41668c1e928bcafce88ff3e *./tests/data/lavf/lavf.mmf
-22617 ./tests/data/lavf/lavf.mmf
-./tests/data/lavf/lavf.mmf CRC=0x8dea1388
diff --git a/deps/libav/tests/ref/lavf/mov b/deps/libav/tests/ref/lavf/mov
deleted file mode 100644
index f34a006..0000000
--- a/deps/libav/tests/ref/lavf/mov
+++ /dev/null
@@ -1,3 +0,0 @@
-e46f42ed71a589ac356e9cfad4e1e56a *./tests/data/lavf/lavf.mov
-356797 ./tests/data/lavf/lavf.mov
-./tests/data/lavf/lavf.mov CRC=0xe3f4950d
diff --git a/deps/libav/tests/ref/lavf/mpg b/deps/libav/tests/ref/lavf/mpg
deleted file mode 100644
index e4c8ae0..0000000
--- a/deps/libav/tests/ref/lavf/mpg
+++ /dev/null
@@ -1,3 +0,0 @@
-7df31ba8a5909e3c88b1d1a3f93c4ec2 *./tests/data/lavf/lavf.mpg
-372736 ./tests/data/lavf/lavf.mpg
-./tests/data/lavf/lavf.mpg CRC=0xdd24439e
diff --git a/deps/libav/tests/ref/lavf/mulaw b/deps/libav/tests/ref/lavf/mulaw
deleted file mode 100644
index bd54084..0000000
--- a/deps/libav/tests/ref/lavf/mulaw
+++ /dev/null
@@ -1,3 +0,0 @@
-ad492935e361f830f2f8302aa102701d *./tests/data/lavf/lavf.ul
-44100 ./tests/data/lavf/lavf.ul
-./tests/data/lavf/lavf.ul CRC=0x4515fa26
diff --git a/deps/libav/tests/ref/lavf/mxf b/deps/libav/tests/ref/lavf/mxf
deleted file mode 100644
index c69e278..0000000
--- a/deps/libav/tests/ref/lavf/mxf
+++ /dev/null
@@ -1,3 +0,0 @@
-21d359aecf0453a5910d2c1a9ec906b2 *./tests/data/lavf/lavf.mxf
-525881 ./tests/data/lavf/lavf.mxf
-./tests/data/lavf/lavf.mxf CRC=0x773f059a
diff --git a/deps/libav/tests/ref/lavf/mxf_d10 b/deps/libav/tests/ref/lavf/mxf_d10
deleted file mode 100644
index 98569c4..0000000
--- a/deps/libav/tests/ref/lavf/mxf_d10
+++ /dev/null
@@ -1,3 +0,0 @@
-b66087558cd1ff8e64290ffd856c88bc *./tests/data/lavf/lavf.mxf_d10
-5330989 ./tests/data/lavf/lavf.mxf_d10
-./tests/data/lavf/lavf.mxf_d10 CRC=0x4474d480
diff --git a/deps/libav/tests/ref/lavf/nut b/deps/libav/tests/ref/lavf/nut
deleted file mode 100644
index d7a8ab1..0000000
--- a/deps/libav/tests/ref/lavf/nut
+++ /dev/null
@@ -1,3 +0,0 @@
-8c9d5193a672ad0dee90f0712acc3a31 *./tests/data/lavf/lavf.nut
-319680 ./tests/data/lavf/lavf.nut
-./tests/data/lavf/lavf.nut CRC=0x4c963cda
diff --git a/deps/libav/tests/ref/lavf/ogg b/deps/libav/tests/ref/lavf/ogg
deleted file mode 100644
index ea827ac..0000000
--- a/deps/libav/tests/ref/lavf/ogg
+++ /dev/null
@@ -1,3 +0,0 @@
-8ca901bc8d24b80ebe79e387e454d1e9 *./tests/data/lavf/lavf.ogg
-13476 ./tests/data/lavf/lavf.ogg
-./tests/data/lavf/lavf.ogg CRC=0x3a1da17e
diff --git a/deps/libav/tests/ref/lavf/pam b/deps/libav/tests/ref/lavf/pam
deleted file mode 100644
index 636a419..0000000
--- a/deps/libav/tests/ref/lavf/pam
+++ /dev/null
@@ -1,3 +0,0 @@
-0dce5565222cf0f8b309467f279aecd2 *./tests/data/images/pam/02.pam
-./tests/data/images/pam/%02d.pam CRC=0x28c7369b
-304191 ./tests/data/images/pam/02.pam
diff --git a/deps/libav/tests/ref/lavf/pbmpipe b/deps/libav/tests/ref/lavf/pbmpipe
deleted file mode 100644
index d50ed71..0000000
--- a/deps/libav/tests/ref/lavf/pbmpipe
+++ /dev/null
@@ -1,3 +0,0 @@
-8ced96f5b6b7362358199ae993b4ceb7 *./tests/data/lavf/pbmpipe.pbm
-317075 ./tests/data/lavf/pbmpipe.pbm
-./tests/data/lavf/pbmpipe.pbm CRC=0xfae0a1ba
diff --git a/deps/libav/tests/ref/lavf/pcx b/deps/libav/tests/ref/lavf/pcx
deleted file mode 100644
index e60ea78..0000000
--- a/deps/libav/tests/ref/lavf/pcx
+++ /dev/null
@@ -1,3 +0,0 @@
-2df1d747fba23d03b6ff9c91b8b465c9 *./tests/data/images/pcx/02.pcx
-./tests/data/images/pcx/%02d.pcx CRC=0x28c7369b
-364147 ./tests/data/images/pcx/02.pcx
diff --git a/deps/libav/tests/ref/lavf/pgm b/deps/libav/tests/ref/lavf/pgm
deleted file mode 100644
index 419fdaa..0000000
--- a/deps/libav/tests/ref/lavf/pgm
+++ /dev/null
@@ -1,3 +0,0 @@
-388f5c51a678ca6a52cc006095c12f08 *./tests/data/images/pgm/02.pgm
-./tests/data/images/pgm/%02d.pgm CRC=0xa6866b82
-101391 ./tests/data/images/pgm/02.pgm
diff --git a/deps/libav/tests/ref/lavf/pgmpipe b/deps/libav/tests/ref/lavf/pgmpipe
deleted file mode 100644
index 28ad60e..0000000
--- a/deps/libav/tests/ref/lavf/pgmpipe
+++ /dev/null
@@ -1,3 +0,0 @@
-04e66c8e9e064c8310bd657ee559bd70 *./tests/data/lavf/pgmpipe.pgm
-2534775 ./tests/data/lavf/pgmpipe.pgm
-./tests/data/lavf/pgmpipe.pgm CRC=0xadf48ba9
diff --git a/deps/libav/tests/ref/lavf/pixfmt b/deps/libav/tests/ref/lavf/pixfmt
deleted file mode 100644
index 186dde5..0000000
--- a/deps/libav/tests/ref/lavf/pixfmt
+++ /dev/null
@@ -1,38 +0,0 @@
-5641dba168ff665af1cdb4a91e1afdd6 *./tests/data/pixfmt/yuv420p.yuv
-304128 ./tests/data/pixfmt/yuv420p.yuv
-ac68f9fdd9d55efd0306d9b004038761 *./tests/data/pixfmt/yuv422p.yuv
-304128 ./tests/data/pixfmt/yuv422p.yuv
-5641dba168ff665af1cdb4a91e1afdd6 *./tests/data/pixfmt/yuv444p.yuv
-304128 ./tests/data/pixfmt/yuv444p.yuv
-ac68f9fdd9d55efd0306d9b004038761 *./tests/data/pixfmt/yuyv422.yuv
-304128 ./tests/data/pixfmt/yuyv422.yuv
-507c7e9f0c97660385df977469ca9e6d *./tests/data/pixfmt/yuv410p.yuv
-304128 ./tests/data/pixfmt/yuv410p.yuv
-8594ea0b8d7c2c964525b0801b5351de *./tests/data/pixfmt/yuv411p.yuv
-304128 ./tests/data/pixfmt/yuv411p.yuv
-e176bd14185788110e055f945de7f95f *./tests/data/pixfmt/yuvj420p.yuv
-304128 ./tests/data/pixfmt/yuvj420p.yuv
-472028e46a81c98d9b2477507def4723 *./tests/data/pixfmt/yuvj422p.yuv
-304128 ./tests/data/pixfmt/yuvj422p.yuv
-c10442da177c9f1d12be3c53be6fa12c *./tests/data/pixfmt/yuvj444p.yuv
-304128 ./tests/data/pixfmt/yuvj444p.yuv
-c6e0f9b5817f484b175c1ec4ffb4e9c9 *./tests/data/pixfmt/rgb24.yuv
-304128 ./tests/data/pixfmt/rgb24.yuv
-c6e0f9b5817f484b175c1ec4ffb4e9c9 *./tests/data/pixfmt/bgr24.yuv
-304128 ./tests/data/pixfmt/bgr24.yuv
-c6e0f9b5817f484b175c1ec4ffb4e9c9 *./tests/data/pixfmt/rgb32.yuv
-304128 ./tests/data/pixfmt/rgb32.yuv
-66d39d464bd89ded2a124897f0a75ade *./tests/data/pixfmt/rgb565.yuv
-304128 ./tests/data/pixfmt/rgb565.yuv
-c894c3bd8d2631ed1964500b90a0c350 *./tests/data/pixfmt/rgb555.yuv
-304128 ./tests/data/pixfmt/rgb555.yuv
-6be306b0cce5f8e6c271ea17fef9745b *./tests/data/pixfmt/gray.yuv
-304128 ./tests/data/pixfmt/gray.yuv
-31398104d2349dd48328a6862bc6711f *./tests/data/pixfmt/monow.yuv
-304128 ./tests/data/pixfmt/monow.yuv
-31398104d2349dd48328a6862bc6711f *./tests/data/pixfmt/monob.yuv
-304128 ./tests/data/pixfmt/monob.yuv
-00b85790df5740bab95e2559d81603a7 *./tests/data/pixfmt/yuv440p.yuv
-304128 ./tests/data/pixfmt/yuv440p.yuv
-4d8d402c45d913038d4b725396719111 *./tests/data/pixfmt/yuvj440p.yuv
-304128 ./tests/data/pixfmt/yuvj440p.yuv
diff --git a/deps/libav/tests/ref/lavf/png b/deps/libav/tests/ref/lavf/png
deleted file mode 100644
index f216e7e..0000000
--- a/deps/libav/tests/ref/lavf/png
+++ /dev/null
@@ -1,3 +0,0 @@
-c162094e51dc1a3203de43e496086dfd *./tests/data/images/png/02.png
-./tests/data/images/png/%02d.png CRC=0x28c7369b
-248612 ./tests/data/images/png/02.png
diff --git a/deps/libav/tests/ref/lavf/ppm b/deps/libav/tests/ref/lavf/ppm
deleted file mode 100644
index 33275e2..0000000
--- a/deps/libav/tests/ref/lavf/ppm
+++ /dev/null
@@ -1,3 +0,0 @@
-16d5dadf0b362fc8ba3cb676c5dde985 *./tests/data/images/ppm/02.ppm
-./tests/data/images/ppm/%02d.ppm CRC=0x28c7369b
-304143 ./tests/data/images/ppm/02.ppm
diff --git a/deps/libav/tests/ref/lavf/ppmpipe b/deps/libav/tests/ref/lavf/ppmpipe
deleted file mode 100644
index b703e16..0000000
--- a/deps/libav/tests/ref/lavf/ppmpipe
+++ /dev/null
@@ -1,3 +0,0 @@
-74f1f6651ad8f192a7b4c11c2b6c71e5 *./tests/data/lavf/ppmpipe.ppm
-7603575 ./tests/data/lavf/ppmpipe.ppm
-./tests/data/lavf/ppmpipe.ppm CRC=0x87b3c15f
diff --git a/deps/libav/tests/ref/lavf/rm b/deps/libav/tests/ref/lavf/rm
deleted file mode 100644
index 993310d..0000000
--- a/deps/libav/tests/ref/lavf/rm
+++ /dev/null
@@ -1,2 +0,0 @@
-9eeb3b91c0a45f519fd7f2efea882cf4 *./tests/data/lavf/lavf.rm
-346414 ./tests/data/lavf/lavf.rm
diff --git a/deps/libav/tests/ref/lavf/rso b/deps/libav/tests/ref/lavf/rso
deleted file mode 100644
index 5878f43..0000000
--- a/deps/libav/tests/ref/lavf/rso
+++ /dev/null
@@ -1,3 +0,0 @@
-443b72346065d6318ca18c8395aa1d87 *./tests/data/lavf/lavf.rso
-44108 ./tests/data/lavf/lavf.rso
-./tests/data/lavf/lavf.rso CRC=0x298fd284
diff --git a/deps/libav/tests/ref/lavf/sgi b/deps/libav/tests/ref/lavf/sgi
deleted file mode 100644
index b0cd303..0000000
--- a/deps/libav/tests/ref/lavf/sgi
+++ /dev/null
@@ -1,3 +0,0 @@
-7054acafd275e51cec28d4518e213081 *./tests/data/images/sgi/02.sgi
-./tests/data/images/sgi/%02d.sgi CRC=0x28c7369b
-308151 ./tests/data/images/sgi/02.sgi
diff --git a/deps/libav/tests/ref/lavf/sox b/deps/libav/tests/ref/lavf/sox
deleted file mode 100644
index fc368b1..0000000
--- a/deps/libav/tests/ref/lavf/sox
+++ /dev/null
@@ -1,3 +0,0 @@
-683635d5cb1344e44fa96df90c3a993c *./tests/data/lavf/lavf.sox
-176432 ./tests/data/lavf/lavf.sox
-./tests/data/lavf/lavf.sox CRC=0x3a1da17e
diff --git a/deps/libav/tests/ref/lavf/sunrast b/deps/libav/tests/ref/lavf/sunrast
deleted file mode 100644
index 097235b..0000000
--- a/deps/libav/tests/ref/lavf/sunrast
+++ /dev/null
@@ -1,3 +0,0 @@
-07518bcb0841bc677ce6aea8464ea240 *./tests/data/images/sun/02.sun
-./tests/data/images/sun/%02d.sun CRC=0x3447369b
-304123 ./tests/data/images/sun/02.sun
diff --git a/deps/libav/tests/ref/lavf/swf b/deps/libav/tests/ref/lavf/swf
deleted file mode 100644
index 1e07793..0000000
--- a/deps/libav/tests/ref/lavf/swf
+++ /dev/null
@@ -1,3 +0,0 @@
-62c5aeb636fc82cf6ba6277d36e42cb5 *./tests/data/lavf/lavf.swf
-329479 ./tests/data/lavf/lavf.swf
-./tests/data/lavf/lavf.swf CRC=0x881785d1
diff --git a/deps/libav/tests/ref/lavf/tga b/deps/libav/tests/ref/lavf/tga
deleted file mode 100644
index ce6b646..0000000
--- a/deps/libav/tests/ref/lavf/tga
+++ /dev/null
@@ -1,3 +0,0 @@
-c0305c53e6d79d4ed9f35f04f671246c *./tests/data/images/tga/02.tga
-./tests/data/images/tga/%02d.tga CRC=0x3447369b
-304172 ./tests/data/images/tga/02.tga
diff --git a/deps/libav/tests/ref/lavf/tiff b/deps/libav/tests/ref/lavf/tiff
deleted file mode 100644
index b636bd9..0000000
--- a/deps/libav/tests/ref/lavf/tiff
+++ /dev/null
@@ -1,3 +0,0 @@
-b3299346a8959553a437e486d8f3bf76 *./tests/data/images/tiff/02.tiff
-./tests/data/images/tiff/%02d.tiff CRC=0x28c7369b
-307131 ./tests/data/images/tiff/02.tiff
diff --git a/deps/libav/tests/ref/lavf/ts b/deps/libav/tests/ref/lavf/ts
deleted file mode 100644
index 0fe358b..0000000
--- a/deps/libav/tests/ref/lavf/ts
+++ /dev/null
@@ -1,3 +0,0 @@
-647875edb0d1afb9fd0477cbfde3fe8b *./tests/data/lavf/lavf.ts
-406456 ./tests/data/lavf/lavf.ts
-./tests/data/lavf/lavf.ts CRC=0xb4ca6cdc
diff --git a/deps/libav/tests/ref/lavf/voc b/deps/libav/tests/ref/lavf/voc
deleted file mode 100644
index 3131960..0000000
--- a/deps/libav/tests/ref/lavf/voc
+++ /dev/null
@@ -1,3 +0,0 @@
-ae01db5200e569371d4c27316575344c *./tests/data/lavf/lavf.voc
-44305 ./tests/data/lavf/lavf.voc
-./tests/data/lavf/lavf.voc CRC=0x298fd284
diff --git a/deps/libav/tests/ref/lavf/voc_s16 b/deps/libav/tests/ref/lavf/voc_s16
deleted file mode 100644
index deb7999..0000000
--- a/deps/libav/tests/ref/lavf/voc_s16
+++ /dev/null
@@ -1,3 +0,0 @@
-e55a9c632cfeab90bcfb9ff29a71728c *./tests/data/lavf/lavf.s16.voc
-176613 ./tests/data/lavf/lavf.s16.voc
-./tests/data/lavf/lavf.s16.voc CRC=0xe61e3bd0
diff --git a/deps/libav/tests/ref/lavf/wav b/deps/libav/tests/ref/lavf/wav
deleted file mode 100644
index fa8a859..0000000
--- a/deps/libav/tests/ref/lavf/wav
+++ /dev/null
@@ -1,3 +0,0 @@
-41410d9bbe0603740d1c17050746f475 *./tests/data/lavf/lavf.wav
-88246 ./tests/data/lavf/lavf.wav
-./tests/data/lavf/lavf.wav CRC=0x3a1da17e
diff --git a/deps/libav/tests/ref/lavf/xwd b/deps/libav/tests/ref/lavf/xwd
deleted file mode 100644
index 3fd20c8..0000000
--- a/deps/libav/tests/ref/lavf/xwd
+++ /dev/null
@@ -1,3 +0,0 @@
-50baa5560b7d1aa3188b19c1162bf7dc *./tests/data/images/xwd/02.xwd
-./tests/data/images/xwd/%02d.xwd CRC=0x28c7369b
-304239 ./tests/data/images/xwd/02.xwd
diff --git a/deps/libav/tests/ref/lavf/yuv4mpeg b/deps/libav/tests/ref/lavf/yuv4mpeg
deleted file mode 100644
index 8c1566e..0000000
--- a/deps/libav/tests/ref/lavf/yuv4mpeg
+++ /dev/null
@@ -1,2 +0,0 @@
-ec8178cb152f9cdbfd9cb724d977db2e *./tests/data/lavf/lavf.y4m
-3801808 ./tests/data/lavf/lavf.y4m
diff --git a/deps/libav/tests/ref/seek/acodec-adpcm-ima_qt b/deps/libav/tests/ref/seek/acodec-adpcm-ima_qt
deleted file mode 100644
index bdaf1f0..0000000
--- a/deps/libav/tests/ref/seek/acodec-adpcm-ima_qt
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     72 size:    68
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     72 size:    68
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.893878 pts: 1.893878 pos:  88812 size:    68
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos:  37064 size:    68
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     72 size:    68
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.577438 pts: 2.577438 pos: 120840 size:    68
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470113 pts: 1.470113 pos:  68956 size:    68
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365714 pts: 0.365714 pos:  17208 size:    68
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     72 size:    68
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153673 pts: 2.153673 pos: 100984 size:    68
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.046349 pts: 1.046349 pos:  49100 size:    68
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     72 size:    68
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835760 pts: 2.835760 pos: 132944 size:    68
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.731338 pts: 1.731338 pos:  81196 size:    68
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624036 pts: 0.624036 pos:  29312 size:    68
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     72 size:    68
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.411995 pts: 2.411995 pos: 113088 size:    68
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.307574 pts: 1.307574 pos:  61340 size:    68
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200272 pts: 0.200272 pos:   9456 size:    68
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     72 size:    68
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.988209 pts: 1.988209 pos:  93232 size:    68
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883810 pts: 0.883810 pos:  41484 size:    68
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     72 size:    68
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671769 pts: 2.671769 pos: 125260 size:    68
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.564444 pts: 1.564444 pos:  73376 size:    68
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460045 pts: 0.460045 pos:  21628 size:    68
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     72 size:    68
diff --git a/deps/libav/tests/ref/seek/acodec-adpcm-ima_wav b/deps/libav/tests/ref/seek/acodec-adpcm-ima_wav
deleted file mode 100644
index b6517c5..0000000
--- a/deps/libav/tests/ref/seek/acodec-adpcm-ima_wav
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     60 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     60 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.856009 pts: 1.856009 pos:  29756 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.831995 pts: 0.831995 pos:  13372 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     60 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.623991 pts: 2.623991 pos:  42044 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.408005 pts: 1.408005 pos:  22588 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.383991 pts: 0.383991 pos:   6204 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     60 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.176009 pts: 2.176009 pos:  34876 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.023991 pts: 1.023991 pos:  16444 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     60 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.816009 pts: 2.816009 pos:  45116 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.791995 pts: 1.791995 pos:  28732 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.576009 pts: 0.576009 pos:   9276 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     60 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.368005 pts: 2.368005 pos:  37948 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.343991 pts: 1.343991 pos:  21564 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.191995 pts: 0.191995 pos:   3132 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     60 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.983991 pts: 1.983991 pos:  31804 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.896009 pts: 0.896009 pos:  14396 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     60 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.688005 pts: 2.688005 pos:  43068 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.536009 pts: 1.536009 pos:  24636 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.511995 pts: 0.511995 pos:   8252 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     60 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-adpcm-ms b/deps/libav/tests/ref/seek/acodec-adpcm-ms
deleted file mode 100644
index 579be7f..0000000
--- a/deps/libav/tests/ref/seek/acodec-adpcm-ms
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     90 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     90 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.856009 pts: 1.856009 pos:  29786 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.831995 pts: 0.831995 pos:  13402 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     90 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.623991 pts: 2.623991 pos:  42074 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.408005 pts: 1.408005 pos:  22618 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.383991 pts: 0.383991 pos:   6234 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     90 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.176009 pts: 2.176009 pos:  34906 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.023991 pts: 1.023991 pos:  16474 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     90 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.816009 pts: 2.816009 pos:  45146 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.791995 pts: 1.791995 pos:  28762 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.576009 pts: 0.576009 pos:   9306 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     90 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.368005 pts: 2.368005 pos:  37978 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.343991 pts: 1.343991 pos:  21594 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.191995 pts: 0.191995 pos:   3162 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     90 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.983991 pts: 1.983991 pos:  31834 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.896009 pts: 0.896009 pos:  14426 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     90 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.688005 pts: 2.688005 pos:  43098 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.536009 pts: 1.536009 pos:  24666 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.511995 pts: 0.511995 pos:   8282 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     90 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-adpcm-swf b/deps/libav/tests/ref/seek/acodec-adpcm-swf
deleted file mode 100644
index 2f90913..0000000
--- a/deps/libav/tests/ref/seek/acodec-adpcm-swf
+++ /dev/null
@@ -1,49 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    208 size:  2053
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    208 size:  2053
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.858000 pts: 1.858000 pos:  82968 size:  2053
-ret: 0         st: 0 flags:0  ts: 0.788000
-ret: 0         st: 0 flags:1 dts: 0.789000 pts: 0.789000 pos:  35381 size:  2053
-ret:-1         st: 0 flags:1  ts:-0.317000
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.601000 pts: 2.601000 pos: 116072 size:  2053
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  64347 size:  2053
-ret: 0         st: 0 flags:0  ts: 0.365000
-ret: 0         st: 0 flags:1 dts: 0.372000 pts: 0.372000 pos:  16760 size:  2053
-ret:-1         st: 0 flags:1  ts:-0.741000
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.183000 pts: 2.183000 pos:  97451 size:  2053
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.022000 pts: 1.022000 pos:  45726 size:  2053
-ret: 0         st: 0 flags:0  ts:-0.058000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    208 size:  2053
-ret: 0         st: 0 flags:1  ts: 2.836000
-ret: 0         st: 0 flags:1 dts: 2.833000 pts: 2.833000 pos: 126417 size:  2053
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.765000 pts: 1.765000 pos:  78830 size:  2053
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.604000 pts: 0.604000 pos:  27105 size:  2053
-ret: 0         st: 0 flags:0  ts:-0.482000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    208 size:  2053
-ret: 0         st: 0 flags:1  ts: 2.413000
-ret: 0         st: 0 flags:1 dts: 2.368000 pts: 2.368000 pos: 105727 size:  2053
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.347000 pts: 1.347000 pos:  60209 size:  2053
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.186000 pts: 0.186000 pos:   8484 size:  2053
-ret: 0         st: 0 flags:0  ts:-0.905000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    208 size:  2053
-ret: 0         st: 0 flags:1  ts: 1.989000
-ret: 0         st: 0 flags:1 dts: 1.950000 pts: 1.950000 pos:  87106 size:  2053
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.929000 pts: 0.929000 pos:  41588 size:  2053
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:0  ts: 2.672000
-ret: 0         st: 0 flags:1 dts: 2.694000 pts: 2.694000 pos: 120210 size:  2053
-ret: 0         st: 0 flags:1  ts: 1.566000
-ret: 0         st: 0 flags:1 dts: 1.533000 pts: 1.533000 pos:  68485 size:  2053
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.464000 pts: 0.464000 pos:  20898 size:  2053
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/acodec-adpcm-yamaha b/deps/libav/tests/ref/seek/acodec-adpcm-yamaha
deleted file mode 100644
index 5cbfaed..0000000
--- a/deps/libav/tests/ref/seek/acodec-adpcm-yamaha
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.856009 pts: 1.856009 pos:  29754 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.831995 pts: 0.831995 pos:  13370 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.623991 pts: 2.623991 pos:  42042 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.408005 pts: 1.408005 pos:  22586 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.383991 pts: 0.383991 pos:   6202 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.176009 pts: 2.176009 pos:  34874 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.023991 pts: 1.023991 pos:  16442 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.816009 pts: 2.816009 pos:  45114 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.791995 pts: 1.791995 pos:  28730 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.576009 pts: 0.576009 pos:   9274 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.368005 pts: 2.368005 pos:  37946 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.343991 pts: 1.343991 pos:  21562 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.191995 pts: 0.191995 pos:   3130 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.983991 pts: 1.983991 pos:  31802 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.896009 pts: 0.896009 pos:  14394 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.688005 pts: 2.688005 pos:  43066 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.536009 pts: 1.536009 pos:  24634 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.511995 pts: 0.511995 pos:   8250 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-alac b/deps/libav/tests/ref/seek/acodec-alac
deleted file mode 100644
index a281d2e..0000000
--- a/deps/libav/tests/ref/seek/acodec-alac
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  3236
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  3236
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.857596 pts: 1.857596 pos:  73647 size:  4961
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.835918 pts: 0.835918 pos:  29032 size:  3194
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  3236
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.600635 pts: 2.600635 pos: 137553 size: 12843
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.393197 pts: 1.393197 pos:  50155 size:  4414
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos:  12942 size:  3209
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  3236
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.229116 pts: 2.229116 pos: 100931 size:  7896
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.021678 pts: 1.021678 pos:  35314 size:  3031
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  3236
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.786395 pts: 2.786395 pos: 163176 size: 12765
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.764717 pts: 1.764717 pos:  68676 size:  4971
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.557279 pts: 0.557279 pos:  19337 size:  3234
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  3236
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.321995 pts: 2.321995 pos: 108827 size:  7886
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.393197 pts: 1.393197 pos:  50155 size:  4414
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos:   6466 size:  3245
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  3236
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.950476 pts: 1.950476 pos:  78608 size:  6514
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  32226 size:  3088
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  3236
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 150396 size: 12780
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.486077 pts: 1.486077 pos:  54569 size:  4554
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos:  16151 size:  3186
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  3236
diff --git a/deps/libav/tests/ref/seek/acodec-flac b/deps/libav/tests/ref/seek/acodec-flac
deleted file mode 100644
index 15ab0d2..0000000
--- a/deps/libav/tests/ref/seek/acodec-flac
+++ /dev/null
@@ -1,49 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8255 size:   614
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8255 size:   614
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos:  86741 size:  2191
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.809796 pts: 0.809796 pos:  27365 size:   615
-ret:-1         st: 0 flags:1  ts:-0.317506
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.586122 pts: 2.586122 pos: 145605 size:  2384
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos:  53387 size:  1851
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365714 pts: 0.365714 pos:  16889 size:   614
-ret:-1         st: 0 flags:1  ts:-0.740839
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.168163 pts: 2.168163 pos: 110530 size:  2143
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos:  32879 size:   579
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8255 size:   614
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.821224 pts: 2.821224 pos: 167111 size:  2391
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.750204 pts: 1.750204 pos:  75787 size:  2191
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.600816 pts: 0.600816 pos:  22445 size:   616
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8255 size:   614
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.403265 pts: 2.403265 pos: 129792 size:  2138
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.332245 pts: 1.332245 pos:  44811 size:  1609
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.182857 pts: 0.182857 pos:  12571 size:   628
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8255 size:   614
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.985306 pts: 1.985306 pos:  95507 size:  2169
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.888163 pts: 0.888163 pos:  29210 size:   620
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.690612 pts: 2.690612 pos: 155153 size:  2394
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.541224 pts: 1.541224 pos:  59081 size:  1974
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.470204 pts: 0.470204 pos:  19352 size:   608
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/acodec-mp2 b/deps/libav/tests/ref/seek/acodec-mp2
deleted file mode 100644
index 8de3676..0000000
--- a/deps/libav/tests/ref/seek/acodec-mp2
+++ /dev/null
@@ -1,49 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:   417
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:   417
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos:  30093 size:   418
-ret: 0         st: 0 flags:0  ts: 0.788334
-ret: 0         st: 0 flags:1 dts: 0.809796 pts: 0.809796 pos:  12956 size:   418
-ret:-1         st: 0 flags:1  ts:-0.317499
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.586122 pts: 2.586122 pos:  41377 size:   418
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos:  23405 size:   418
-ret: 0         st: 0 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:1 dts: 0.365714 pts: 0.365714 pos:   5851 size:   418
-ret:-1         st: 0 flags:1  ts:-0.740831
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.168163 pts: 2.168163 pos:  34690 size:   418
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos:  16718 size:   418
-ret: 0         st: 0 flags:0  ts:-0.058330
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:   417
-ret: 0         st: 0 flags:1  ts: 2.835837
-ret: 0         st: 0 flags:1 dts: 2.821224 pts: 2.821224 pos:  45139 size:   418
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.750204 pts: 1.750204 pos:  28003 size:   418
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.600816 pts: 0.600816 pos:   9613 size:   418
-ret: 0         st: 0 flags:0  ts:-0.481662
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:   417
-ret: 0         st: 0 flags:1  ts: 2.412505
-ret: 0         st: 0 flags:1 dts: 2.403265 pts: 2.403265 pos:  38452 size:   418
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.332245 pts: 1.332245 pos:  21315 size:   418
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.182857 pts: 0.182857 pos:   2925 size:   418
-ret: 0         st: 0 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:   417
-ret: 0         st: 0 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 1.985306 pts: 1.985306 pos:  31764 size:   418
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.888163 pts: 0.888163 pos:  14210 size:   418
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:0  ts: 2.671674
-ret: 0         st: 0 flags:1 dts: 2.690612 pts: 2.690612 pos:  43049 size:   418
-ret: 0         st: 0 flags:1  ts: 1.565841
-ret: 0         st: 0 flags:1 dts: 1.541224 pts: 1.541224 pos:  24659 size:   418
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.470204 pts: 0.470204 pos:   7523 size:   418
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-alaw b/deps/libav/tests/ref/seek/acodec-pcm-alaw
deleted file mode 100644
index e5466bd..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-alaw
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 167124 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos:  69590 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 227320 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 129786 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos:  32252 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 189982 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos:  92448 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos: 250178 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 152644 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos:  55110 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 212840 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 115306 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  17772 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 175504 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos:  77968 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 235700 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 138166 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos:  40630 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-f32be b/deps/libav/tests/ref/seek/acodec-pcm-f32be
deleted file mode 100644
index 886356a..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-f32be
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  8192
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  8192
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 668288 size:  8192
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 278152 size:  8192
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  8192
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 909072 size:  8192
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 518936 size:  8192
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 128800 size:  8192
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  8192
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 759720 size:  8192
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 369584 size:  8192
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  8192
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:1000504 size:  8192
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 610368 size:  8192
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 220232 size:  8192
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  8192
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 851152 size:  8192
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 461016 size:  8192
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  70880 size:  8192
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  8192
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 701808 size:  8192
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 311664 size:  8192
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  8192
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 942592 size:  8192
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 552456 size:  8192
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 162312 size:  8192
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  8192
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-f32le b/deps/libav/tests/ref/seek/acodec-pcm-f32le
deleted file mode 100644
index 335a8a0..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-f32le
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 668344 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 278208 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 909128 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 518992 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 128856 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 759776 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 369640 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:1000560 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 610424 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 220288 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 851208 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 461072 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  70936 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 701864 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 311720 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 942648 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 552512 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 162368 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-f64be b/deps/libav/tests/ref/seek/acodec-pcm-f64be
deleted file mode 100644
index 9be3b4e..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-f64be
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size: 16384
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size: 16384
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos:1336552 size: 16384
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 556280 size: 16384
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size: 16384
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos:1818120 size: 16384
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos:1037848 size: 16384
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 257576 size: 16384
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size: 16384
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos:1519416 size: 16384
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 739144 size: 16384
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size: 16384
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:2000984 size: 16384
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos:1220712 size: 16384
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 440440 size: 16384
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size: 16384
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos:1702280 size: 16384
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 922008 size: 16384
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 141736 size: 16384
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size: 16384
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos:1403592 size: 16384
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 623304 size: 16384
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size: 16384
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos:1885160 size: 16384
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos:1104888 size: 16384
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 324600 size: 16384
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size: 16384
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-f64le b/deps/libav/tests/ref/seek/acodec-pcm-f64le
deleted file mode 100644
index 41eeda0..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-f64le
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos:1336608 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 556336 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos:1818176 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos:1037904 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 257632 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos:1519472 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 739200 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:2001040 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos:1220768 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 440496 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos:1702336 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 922064 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos: 141792 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos:1403648 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 623360 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos:1885216 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos:1104944 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 324656 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     80 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-mulaw b/deps/libav/tests/ref/seek/acodec-pcm-mulaw
deleted file mode 100644
index e5466bd..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-mulaw
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 167124 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos:  69590 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 227320 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 129786 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos:  32252 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 189982 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos:  92448 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos: 250178 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 152644 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos:  55110 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 212840 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 115306 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  17772 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 175504 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos:  77968 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 235700 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 138166 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos:  40630 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     58 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-s16be b/deps/libav/tests/ref/seek/acodec-pcm-s16be
deleted file mode 100644
index f6a6be4..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-s16be
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 331812 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos: 139300 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos: 454692 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 258084 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos:  65572 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos: 380964 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 184356 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos: 499748 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos: 307236 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos: 106532 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos: 421924 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos: 233508 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos:  32804 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos: 348196 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos: 159780 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 475172 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos: 274468 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos:  81956 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-s16le b/deps/libav/tests/ref/seek/acodec-pcm-s16le
deleted file mode 100644
index 4f1ffc5..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-s16le
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 334178 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 139110 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 454570 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 259502 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos:  64434 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 379894 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 184826 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos: 500286 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 305218 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 110150 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 425610 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 230542 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  35474 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 350938 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 155866 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 471330 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 276262 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos:  81190 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-s24be b/deps/libav/tests/ref/seek/acodec-pcm-s24be
deleted file mode 100644
index ef22082..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-s24be
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  6144
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  6144
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 497700 size:  6144
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos: 208932 size:  6144
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  6144
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos: 682020 size:  6144
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 387108 size:  6144
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos:  98340 size:  6144
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  6144
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos: 571428 size:  6144
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 276516 size:  6144
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  6144
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos: 749604 size:  6144
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos: 460836 size:  6144
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos: 159780 size:  6144
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  6144
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos: 632868 size:  6144
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos: 350244 size:  6144
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos:  49188 size:  6144
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  6144
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos: 522276 size:  6144
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos: 239652 size:  6144
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  6144
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 712740 size:  6144
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos: 411684 size:  6144
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos: 122916 size:  6144
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  6144
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-s24le b/deps/libav/tests/ref/seek/acodec-pcm-s24le
deleted file mode 100644
index c6a37f8..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-s24le
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4092
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4092
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 501266 size:  4092
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 208664 size:  4092
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4092
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 681854 size:  4092
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 389252 size:  4092
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos:  96650 size:  4092
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4092
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 569840 size:  4092
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 277238 size:  4092
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4092
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos: 750428 size:  4092
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 457826 size:  4092
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 165224 size:  4092
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4092
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 638414 size:  4092
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 345812 size:  4092
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  53210 size:  4092
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4092
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 526406 size:  4092
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 233798 size:  4092
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4092
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 706994 size:  4092
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 414392 size:  4092
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 121784 size:  4092
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4092
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-s32be b/deps/libav/tests/ref/seek/acodec-pcm-s32be
deleted file mode 100644
index 6aed744..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-s32be
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  8192
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  8192
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 663588 size:  8192
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos: 278564 size:  8192
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  8192
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos: 909348 size:  8192
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 516132 size:  8192
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos: 131108 size:  8192
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  8192
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos: 761892 size:  8192
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos: 368676 size:  8192
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  8192
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos: 999460 size:  8192
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos: 614436 size:  8192
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos: 213028 size:  8192
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  8192
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos: 843812 size:  8192
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos: 466980 size:  8192
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos:  65572 size:  8192
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  8192
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos: 696356 size:  8192
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos: 319524 size:  8192
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  8192
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 950308 size:  8192
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos: 548900 size:  8192
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos: 163876 size:  8192
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  8192
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-s32le b/deps/libav/tests/ref/seek/acodec-pcm-s32le
deleted file mode 100644
index df85b2d..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-s32le
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 668332 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos: 278196 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 909116 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 518980 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos: 128844 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 759764 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos: 369628 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos:1000548 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 610412 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos: 220276 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 851196 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 461060 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  70924 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 701852 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos: 311708 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 942636 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 552500 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos: 162356 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     68 size:  4096
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-s8 b/deps/libav/tests/ref/seek/acodec-pcm-s8
deleted file mode 100644
index b119e2e..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-s8
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  2048
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  2048
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos: 165924 size:  2048
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos:  69668 size:  2048
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  2048
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos: 227364 size:  2048
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos: 129060 size:  2048
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos:  32804 size:  2048
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  2048
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos: 190500 size:  2048
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos:  92196 size:  2048
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  2048
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos: 249892 size:  2048
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos: 153636 size:  2048
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos:  53284 size:  2048
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  2048
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos: 210980 size:  2048
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos: 116772 size:  2048
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos:  16420 size:  2048
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  2048
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos: 174116 size:  2048
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos:  79908 size:  2048
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  2048
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 237604 size:  2048
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos: 137252 size:  2048
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos:  40996 size:  2048
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:  2048
diff --git a/deps/libav/tests/ref/seek/acodec-pcm-u8 b/deps/libav/tests/ref/seek/acodec-pcm-u8
deleted file mode 100644
index 8348916..0000000
--- a/deps/libav/tests/ref/seek/acodec-pcm-u8
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894172 pts: 1.894172 pos: 167112 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos:  69578 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.576667 pts: 2.576667 pos: 227308 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos: 129774 size:  4096
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos:  32240 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.153333 pts: 2.153333 pos: 189970 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047506 pts: 1.047506 pos:  92436 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.835828 pts: 2.835828 pos: 250166 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730000 pts: 1.730000 pos: 152632 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos:  55098 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.412494 pts: 2.412494 pos: 212828 size:  4096
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos: 115294 size:  4096
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  17760 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.989184 pts: 1.989184 pos: 175492 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos:  77956 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.671678 pts: 2.671678 pos: 235688 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos: 138154 size:  4096
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos:  40618 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
diff --git a/deps/libav/tests/ref/seek/lavf-aiff b/deps/libav/tests/ref/seek/lavf-aiff
deleted file mode 100644
index 784b144..0000000
--- a/deps/libav/tests/ref/seek/lavf-aiff
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     54 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     54 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret:-EOF
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos:  69586 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     54 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret:-EOF
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos:  32248 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     54 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret:-EOF
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     54 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos:  55106 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     54 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  17768 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     54 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos:  77964 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     54 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret:-EOF
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos:  40626 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     54 size:  4096
diff --git a/deps/libav/tests/ref/seek/lavf-alaw b/deps/libav/tests/ref/seek/lavf-alaw
deleted file mode 100644
index 4b1f8fb..0000000
--- a/deps/libav/tests/ref/seek/lavf-alaw
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894150 pts: 1.894150 pos:  41766 size:  1024
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos:  17383 size:  1024
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos:  32432 size:  1024
-ret: 0         st: 0 flags:0  ts: 0.364989
-ret: 0         st: 0 flags:1 dts: 0.364989 pts: 0.364989 pos:   8048 size:  1024
-ret: 0         st: 0 flags:1  ts:-0.740816
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047483 pts: 1.047483 pos:  23097 size:  1024
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730023 pts: 1.730023 pos:  38147 size:  1024
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos:  13763 size:  1024
-ret: 0         st: 0 flags:0  ts:-0.481678
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st: 0 flags:1  ts: 2.412517
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos:  28812 size:  1024
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200816 pts: 0.200816 pos:   4428 size:  1024
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st: 0 flags:1  ts: 1.989161
-ret: 0         st: 0 flags:1 dts: 1.989161 pts: 1.989161 pos:  43861 size:   239
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883356 pts: 0.883356 pos:  19478 size:  1024
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st: 0 flags:0  ts: 2.671655
-ret:-EOF
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos:  34527 size:  1024
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos:  10143 size:  1024
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
diff --git a/deps/libav/tests/ref/seek/lavf-asf b/deps/libav/tests/ref/seek/lavf-asf
deleted file mode 100644
index 89ec4c2..0000000
--- a/deps/libav/tests/ref/seek/lavf-asf
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    575 size:   208
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147775 size:   209
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size:   209
-ret: 0         st: 0 flags:0  ts: 0.788000
-ret: 0         st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size:   209
-ret: 0         st: 0 flags:1  ts:-0.317000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    575 size:   208
-ret: 0         st: 1 flags:0  ts: 2.577000
-ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size:   209
-ret: 0         st: 1 flags:1  ts: 1.471000
-ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size:   209
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147775 size:   209
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    575 size:   208
-ret: 0         st: 0 flags:0  ts: 2.153000
-ret: 0         st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size:   209
-ret: 0         st: 0 flags:1  ts: 1.048000
-ret: 0         st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size:   209
-ret: 0         st: 1 flags:0  ts:-0.058000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    575 size:   208
-ret: 0         st: 1 flags:1  ts: 2.836000
-ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size:   209
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size:   209
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147775 size:   209
-ret: 0         st: 0 flags:0  ts:-0.482000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    575 size:   208
-ret: 0         st: 0 flags:1  ts: 2.413000
-ret: 0         st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size:   209
-ret: 0         st: 1 flags:0  ts: 1.307000
-ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size:   209
-ret: 0         st: 1 flags:1  ts: 0.201000
-ret: 0         st: 1 flags:1 dts: 0.183000 pts: 0.183000 pos:  70975 size:   209
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    575 size:   208
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size:   209
-ret: 0         st: 0 flags:0  ts: 0.883000
-ret: 0         st: 1 flags:1 dts: 0.941000 pts: 0.941000 pos: 301375 size:   209
-ret: 0         st: 0 flags:1  ts:-0.222000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    575 size:   208
-ret: 0         st: 1 flags:0  ts: 2.672000
-ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size:   209
-ret: 0         st: 1 flags:1  ts: 1.566000
-ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 330175 size:   209
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 1 flags:1 dts: 0.470000 pts: 0.470000 pos: 147775 size:   209
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    575 size:   208
diff --git a/deps/libav/tests/ref/seek/lavf-au b/deps/libav/tests/ref/seek/lavf-au
deleted file mode 100644
index a2c57eb..0000000
--- a/deps/libav/tests/ref/seek/lavf-au
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  2048
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  2048
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret:-EOF
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos:  69556 size:  2048
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  2048
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret:-EOF
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos:  32218 size:  2048
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  2048
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret:-EOF
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  2048
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos:  55076 size:  2048
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  2048
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  17738 size:  2048
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  2048
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos:  77934 size:  2048
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  2048
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret:-EOF
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos:  40596 size:  2048
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     24 size:  2048
diff --git a/deps/libav/tests/ref/seek/lavf-avi b/deps/libav/tests/ref/seek/lavf-avi
deleted file mode 100644
index 0cabe12..0000000
--- a/deps/libav/tests/ref/seek/lavf-avi
+++ /dev/null
@@ -1,44 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   9896 size: 27867
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   9896 size: 27867
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301454 size: 27864
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301454 size: 27864
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st: 1 flags:0  ts: 2.586122
-ret: 0         st: 1 flags:1  ts: 1.462857
-ret: 0         st: 1 flags:1 dts: 0.992653 pts: 0.992653 pos: 329544 size:   209
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 156154 size: 27955
-ret:-1         st:-1 flags:1  ts:-0.740831
-ret:-1         st: 0 flags:0  ts: 2.160000
-ret: 0         st: 0 flags:1  ts: 1.040000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301454 size: 27864
-ret: 0         st: 1 flags:0  ts:-0.052245
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:  37772 size:   208
-ret: 0         st: 1 flags:1  ts: 2.847347
-ret: 0         st: 1 flags:1 dts: 0.992653 pts: 0.992653 pos: 329544 size:   209
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 156154 size: 27955
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   9896 size: 27867
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301454 size: 27864
-ret:-1         st: 1 flags:0  ts: 1.306122
-ret: 0         st: 1 flags:1  ts: 0.208980
-ret: 0         st: 1 flags:1 dts: 0.208980 pts: 0.208980 pos:  92788 size:   209
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   9896 size: 27867
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301454 size: 27864
-ret: 0         st: 0 flags:0  ts: 0.880000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 301454 size: 27864
-ret:-1         st: 0 flags:1  ts:-0.240000
-ret:-1         st: 1 flags:0  ts: 2.664490
-ret: 0         st: 1 flags:1  ts: 1.567347
-ret: 0         st: 1 flags:1 dts: 0.992653 pts: 0.992653 pos: 329544 size:   209
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 156154 size: 27955
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-bmp b/deps/libav/tests/ref/seek/lavf-bmp
deleted file mode 100644
index d60729b..0000000
--- a/deps/libav/tests/ref/seek/lavf-bmp
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:304182
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-dv_fmt b/deps/libav/tests/ref/seek/lavf-dv_fmt
deleted file mode 100644
index 3c49749..0000000
--- a/deps/libav/tests/ref/seek/lavf-dv_fmt
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 1 flags:0  ts: 2.576667
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st: 1 flags:1  ts: 1.470833
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts: 2.160000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 1.040000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st: 1 flags:0  ts:-0.058333
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 1 flags:1  ts: 2.835833
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st: 1 flags:0  ts: 1.306667
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st: 1 flags:1  ts: 0.200833
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts: 0.880000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts:-0.240000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 1 flags:0  ts: 2.671667
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st: 1 flags:1  ts: 1.565833
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
diff --git a/deps/libav/tests/ref/seek/lavf-ffm b/deps/libav/tests/ref/seek/lavf-ffm
deleted file mode 100644
index 2597220..0000000
--- a/deps/libav/tests/ref/seek/lavf-ffm
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   8192 size: 24664
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   8192 size: 24664
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st: 0 flags:0  ts: 0.788334
-ret: 0         st: 1 flags:1 dts: 0.772766 pts: 0.772766 pos: 315392 size:   209
-ret: 0         st: 0 flags:1  ts:-0.317499
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   8192 size: 24664
-ret: 0         st: 1 flags:0  ts: 2.576668
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st: 1 flags:1  ts: 1.470835
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 1 flags:1 dts: 0.328685 pts: 0.328685 pos: 155648 size:   209
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   8192 size: 24664
-ret: 0         st: 0 flags:0  ts: 2.153336
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st: 0 flags:1  ts: 1.047503
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st: 1 flags:0  ts:-0.058330
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   8192 size: 24664
-ret: 0         st: 1 flags:1  ts: 2.835837
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 1 flags:1 dts: 0.642154 pts: 0.642154 pos: 274432 size:   209
-ret: 0         st: 0 flags:0  ts:-0.481662
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   8192 size: 24664
-ret: 0         st: 0 flags:1  ts: 2.412505
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st: 1 flags:0  ts: 1.306672
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st: 1 flags:1  ts: 0.200839
-ret: 0         st: 1 flags:1 dts: 0.224195 pts: 0.224195 pos: 114688 size:   209
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   8192 size: 24664
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st: 0 flags:0  ts: 0.883340
-ret: 0         st: 1 flags:1 dts: 0.877256 pts: 0.877256 pos: 339968 size:   209
-ret: 0         st: 0 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   8192 size: 24664
-ret: 0         st: 1 flags:0  ts: 2.671674
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st: 1 flags:1  ts: 1.565841
-ret: 0         st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   209
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 1 flags:1 dts: 0.459297 pts: 0.459297 pos: 204800 size:   209
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   8192 size: 24664
diff --git a/deps/libav/tests/ref/seek/lavf-flv_fmt b/deps/libav/tests/ref/seek/lavf-flv_fmt
deleted file mode 100644
index 2e7a0bc..0000000
--- a/deps/libav/tests/ref/seek/lavf-flv_fmt
+++ /dev/null
@@ -1,44 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 31074
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 31074
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
-ret: 0         st: 0 flags:0  ts: 0.788000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
-ret:-1         st: 0 flags:1  ts:-0.317000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
-ret: 0         st: 0 flags:0  ts: 0.365000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149441 size: 31125
-ret:-1         st: 0 flags:1  ts:-0.741000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
-ret: 0         st: 0 flags:0  ts:-0.058000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 31074
-ret: 0         st: 0 flags:1  ts: 2.836000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149441 size: 31125
-ret: 0         st: 0 flags:0  ts:-0.482000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 31074
-ret: 0         st: 0 flags:1  ts: 2.413000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 31074
-ret: 0         st: 0 flags:0  ts:-0.905000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 31074
-ret: 0         st: 0 flags:1  ts: 1.989000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.672000
-ret: 0         st: 0 flags:1  ts: 1.566000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 298403 size: 31134
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 149441 size: 31125
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-gif b/deps/libav/tests/ref/seek/lavf-gif
deleted file mode 100644
index 883f187..0000000
--- a/deps/libav/tests/ref/seek/lavf-gif
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:2906401
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-gxf b/deps/libav/tests/ref/seek/lavf-gxf
deleted file mode 100644
index bc7ff3b..0000000
--- a/deps/libav/tests/ref/seek/lavf-gxf
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:   5024 size: 65536
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:   5024 size: 65536
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st: 0 flags:0  ts: 0.780000
-ret: 0         st: 0 flags:0 dts: 0.800000 pts: NOPTS    pos: 653328 size: 22148
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:   5024 size: 65536
-ret: 0         st: 1 flags:0  ts: 2.580000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st: 1 flags:1  ts: 1.480000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st: 2 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:0 dts: 0.360000 pts: NOPTS    pos: 302676 size: 25108
-ret: 0         st: 2 flags:1  ts:-0.740000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:   5024 size: 65536
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st: 0 flags:0  ts:-0.060000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:   5024 size: 65536
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st: 1 flags:0  ts: 1.740000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st: 1 flags:1  ts: 0.620000
-ret: 0         st: 0 flags:0 dts: 0.640000 pts: NOPTS    pos: 497156 size: 21596
-ret: 0         st: 2 flags:0  ts:-0.480000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:   5024 size: 65536
-ret: 0         st: 2 flags:1  ts: 2.420000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:0 dts: 0.200000 pts: NOPTS    pos: 209504 size: 22968
-ret: 0         st: 0 flags:0  ts:-0.900000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:   5024 size: 65536
-ret: 0         st: 0 flags:1  ts: 1.980000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st: 1 flags:0  ts: 0.880000
-ret: 0         st: 0 flags:0 dts: 0.880000 pts: NOPTS    pos: 696044 size: 22484
-ret: 0         st: 1 flags:1  ts:-0.220000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:   5024 size: 65536
-ret: 0         st: 2 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st: 2 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos: 741640 size: 54736
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos: 370660 size: 54628
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:   5024 size: 65536
diff --git a/deps/libav/tests/ref/seek/lavf-jpg b/deps/libav/tests/ref/seek/lavf-jpg
deleted file mode 100644
index 88964ca..0000000
--- a/deps/libav/tests/ref/seek/lavf-jpg
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size: 28070
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-mkv b/deps/libav/tests/ref/seek/lavf-mkv
deleted file mode 100644
index f575165..0000000
--- a/deps/libav/tests/ref/seek/lavf-mkv
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    518 size:   208
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    734 size: 27837
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292156 size: 27834
-ret: 0         st: 0 flags:0  ts: 0.788000
-ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292156 size: 27834
-ret: 0         st: 0 flags:1  ts:-0.317000
-ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    734 size: 27837
-ret: 0         st: 1 flags:0  ts: 2.577000
-ret:-EOF
-ret: 0         st: 1 flags:1  ts: 1.471000
-ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 319997 size:   209
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146709 size: 27925
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    734 size: 27837
-ret: 0         st: 0 flags:0  ts: 2.153000
-ret:-EOF
-ret: 0         st: 0 flags:1  ts: 1.048000
-ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292156 size: 27834
-ret: 0         st: 1 flags:0  ts:-0.058000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    518 size:   208
-ret: 0         st: 1 flags:1  ts: 2.836000
-ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 319997 size:   209
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146709 size: 27925
-ret: 0         st: 0 flags:0  ts:-0.482000
-ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    734 size: 27837
-ret: 0         st: 0 flags:1  ts: 2.413000
-ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292156 size: 27834
-ret: 0         st: 1 flags:0  ts: 1.307000
-ret:-EOF
-ret: 0         st: 1 flags:1  ts: 0.201000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    518 size:   208
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    734 size: 27837
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292156 size: 27834
-ret: 0         st: 0 flags:0  ts: 0.883000
-ret: 0         st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292156 size: 27834
-ret: 0         st: 0 flags:1  ts:-0.222000
-ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    734 size: 27837
-ret: 0         st: 1 flags:0  ts: 2.672000
-ret:-EOF
-ret: 0         st: 1 flags:1  ts: 1.566000
-ret: 0         st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 319997 size:   209
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146709 size: 27925
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:    734 size: 27837
diff --git a/deps/libav/tests/ref/seek/lavf-mmf b/deps/libav/tests/ref/seek/lavf-mmf
deleted file mode 100644
index 196d263..0000000
--- a/deps/libav/tests/ref/seek/lavf-mmf
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:  4096
-ret:-1         st:-1 flags:0  ts:-1.000000
-ret:-1         st:-1 flags:1  ts: 1.894167
-ret:-1         st: 0 flags:0  ts: 0.788345
-ret:-1         st: 0 flags:1  ts:-0.317506
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret:-1         st:-1 flags:1  ts: 1.470835
-ret:-1         st: 0 flags:0  ts: 0.365011
-ret:-1         st: 0 flags:1  ts:-0.740839
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret:-1         st:-1 flags:1  ts: 1.047503
-ret:-1         st: 0 flags:0  ts:-0.058322
-ret:-1         st: 0 flags:1  ts: 2.835828
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret:-1         st:-1 flags:1  ts: 0.624171
-ret:-1         st: 0 flags:0  ts:-0.481655
-ret:-1         st: 0 flags:1  ts: 2.412494
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret:-1         st:-1 flags:1  ts: 0.200839
-ret:-1         st: 0 flags:0  ts:-0.904989
-ret:-1         st: 0 flags:1  ts: 1.989184
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671678
-ret:-1         st: 0 flags:1  ts: 1.565850
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-mov b/deps/libav/tests/ref/seek/lavf-mov
deleted file mode 100644
index 0091915..0000000
--- a/deps/libav/tests/ref/seek/lavf-mov
+++ /dev/null
@@ -1,48 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size:  1024
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
-ret:-1         st: 1 flags:0  ts: 2.576667
-ret: 0         st: 1 flags:1  ts: 1.470839
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 163526 size: 27925
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
-ret:-1         st: 0 flags:0  ts: 2.160000
-ret: 0         st: 0 flags:1  ts: 1.040000
-ret: 0         st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size:  1024
-ret: 0         st: 1 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
-ret: 0         st: 1 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 1 flags:1 dts: 0.464399 pts: 0.464399 pos: 162502 size:  1024
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size:  1024
-ret:-1         st: 1 flags:0  ts: 1.306667
-ret: 0         st: 1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 1 flags:1 dts: 0.952018 pts: 0.952018 pos: 325248 size:  1024
-ret: 0         st: 0 flags:0  ts: 0.880000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
-ret: 0         st: 0 flags:1  ts:-0.240000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
-ret:-1         st: 1 flags:0  ts: 2.671678
-ret: 0         st: 1 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326272 size: 27834
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 163526 size: 27925
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 27837
diff --git a/deps/libav/tests/ref/seek/lavf-mpg b/deps/libav/tests/ref/seek/lavf-mpg
deleted file mode 100644
index 6e27064..0000000
--- a/deps/libav/tests/ref/seek/lavf-mpg
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:0 dts: 1.880000 pts: 1.920000 pos: 315392 size: 12800
-ret: 0         st: 0 flags:0  ts: 0.788333
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st: 0 flags:1  ts:-0.317500
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st: 1 flags:0  ts: 2.576667
-ret: 0         st: 1 flags:1 dts: 1.812767 pts: 1.812767 pos: 368652 size:   379
-ret: 0         st: 1 flags:1  ts: 1.470833
-ret: 0         st: 1 flags:1 dts: 1.290322 pts: 1.290322 pos: 145408 size:   261
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st: 0 flags:0  ts: 2.153333
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 2.000000 pos: 339968 size:   681
-ret: 0         st: 0 flags:1  ts: 1.047500
-ret: 0         st: 0 flags:0 dts: 1.040000 pts: 1.080000 pos:  26624 size: 16303
-ret: 0         st: 1 flags:0  ts:-0.058333
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st: 1 flags:1  ts: 2.835833
-ret: 0         st: 1 flags:1 dts: 1.812767 pts: 1.812767 pos: 368652 size:   379
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:0 dts: 1.760000 pts: 1.800000 pos: 280588 size: 13050
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st: 0 flags:0  ts:-0.481667
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st: 0 flags:1  ts: 2.412500
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 2.000000 pos: 339968 size:   681
-ret: 0         st: 1 flags:0  ts: 1.306667
-ret: 0         st: 1 flags:1 dts: 1.551544 pts: 1.551544 pos: 342028 size:   314
-ret: 0         st: 1 flags:1  ts: 0.200844
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 2.000000 pos: 339968 size:   681
-ret: 0         st: 0 flags:0  ts: 0.883344
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st: 0 flags:1  ts:-0.222489
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st: 1 flags:0  ts: 2.671678
-ret: 0         st: 1 flags:1 dts: 1.812767 pts: 1.812767 pos: 368652 size:   379
-ret: 0         st: 1 flags:1  ts: 1.565844
-ret: 0         st: 1 flags:1 dts: 1.551544 pts: 1.551544 pos: 342028 size:   314
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 1 flags:1 dts: 1.029089 pts: 1.029089 pos:   2048 size:   208
diff --git a/deps/libav/tests/ref/seek/lavf-mulaw b/deps/libav/tests/ref/seek/lavf-mulaw
deleted file mode 100644
index 4b1f8fb..0000000
--- a/deps/libav/tests/ref/seek/lavf-mulaw
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.894150 pts: 1.894150 pos:  41766 size:  1024
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos:  17383 size:  1024
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.470839 pts: 1.470839 pos:  32432 size:  1024
-ret: 0         st: 0 flags:0  ts: 0.364989
-ret: 0         st: 0 flags:1 dts: 0.364989 pts: 0.364989 pos:   8048 size:  1024
-ret: 0         st: 0 flags:1  ts:-0.740816
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.047483 pts: 1.047483 pos:  23097 size:  1024
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.730023 pts: 1.730023 pos:  38147 size:  1024
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos:  13763 size:  1024
-ret: 0         st: 0 flags:0  ts:-0.481678
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st: 0 flags:1  ts: 2.412517
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.306667 pts: 1.306667 pos:  28812 size:  1024
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200816 pts: 0.200816 pos:   4428 size:  1024
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st: 0 flags:1  ts: 1.989161
-ret: 0         st: 0 flags:1 dts: 1.989161 pts: 1.989161 pos:  43861 size:   239
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883356 pts: 0.883356 pos:  19478 size:  1024
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st: 0 flags:0  ts: 2.671655
-ret:-EOF
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.565850 pts: 1.565850 pos:  34527 size:  1024
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos:  10143 size:  1024
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
diff --git a/deps/libav/tests/ref/seek/lavf-mxf b/deps/libav/tests/ref/seek/lavf-mxf
deleted file mode 100644
index 5f2cf5d..0000000
--- a/deps/libav/tests/ref/seek/lavf-mxf
+++ /dev/null
@@ -1,48 +0,0 @@
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret:-1         st: 1 flags:0  ts: 2.576667
-ret: 0         st: 1 flags:1  ts: 1.470833
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.480000 pos: 211968 size: 24787
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret:-1         st: 0 flags:0  ts: 2.160000
-ret: 0         st: 0 flags:1  ts: 1.040000
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret: 0         st: 1 flags:0  ts:-0.058333
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret: 0         st: 1 flags:1  ts: 2.835833
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.480000 pos: 211968 size: 24787
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret:-1         st: 1 flags:0  ts: 1.306667
-ret: 0         st: 1 flags:1  ts: 0.200833
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret: 0         st: 0 flags:0  ts: 0.880000
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret: 0         st: 0 flags:1  ts:-0.240000
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
-ret:-1         st: 1 flags:0  ts: 2.671667
-ret: 0         st: 1 flags:1  ts: 1.565833
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: 0.960000 pos: 460800 size: 24712
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts:-0.040000 pts: 0.000000 pos:   6144 size: 24801
diff --git a/deps/libav/tests/ref/seek/lavf-mxf_d10 b/deps/libav/tests/ref/seek/lavf-mxf_d10
deleted file mode 100644
index e091c77..0000000
--- a/deps/libav/tests/ref/seek/lavf-mxf_d10
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:4265984 size:150000
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st: 1 flags:0  ts: 2.576667
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
-ret: 0         st: 1 flags:1  ts: 1.470833
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1923072 size:150000
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st: 0 flags:0  ts: 2.160000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 0 flags:1  ts: 1.040000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 1 flags:0  ts:-0.058333
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st: 1 flags:1  ts: 2.835833
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:3414016 size:150000
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 1 flags:0  ts: 1.306667
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
-ret: 0         st: 1 flags:1  ts: 0.200833
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:5117952 size:150000
-ret: 0         st: 0 flags:0  ts: 0.880000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:4691968 size:150000
-ret: 0         st: 0 flags:1  ts:-0.240000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
-ret: 0         st: 1 flags:0  ts: 2.671667
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
-ret: 0         st: 1 flags:1  ts: 1.565833
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:5117952 size:150000
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:2562048 size:150000
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   6144 size:150000
diff --git a/deps/libav/tests/ref/seek/lavf-nut b/deps/libav/tests/ref/seek/lavf-nut
deleted file mode 100644
index fc3ef63..0000000
--- a/deps/libav/tests/ref/seek/lavf-nut
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st: 1 flags:0  ts: 2.586122
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 1 flags:1  ts: 1.462857
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st: 0 flags:0  ts: 2.160000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 0 flags:1  ts: 1.040000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 1 flags:0  ts:-0.052245
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st: 1 flags:1  ts: 2.847347
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 1 flags:0  ts: 1.306122
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 1 flags:1  ts: 0.208980
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 0 flags:0  ts: 0.880000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 0 flags:1  ts:-0.240000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
-ret: 0         st: 1 flags:0  ts: 2.664490
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st: 1 flags:1  ts: 1.567347
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146329 size: 27925
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    279 size: 27837
diff --git a/deps/libav/tests/ref/seek/lavf-ogg b/deps/libav/tests/ref/seek/lavf-ogg
deleted file mode 100644
index 109ae32..0000000
--- a/deps/libav/tests/ref/seek/lavf-ogg
+++ /dev/null
@@ -1,44 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    124 size:  1364
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    124 size:  1364
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret:-EOF
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret:-EOF
-ret:-1         st: 0 flags:1  ts:-0.317506
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret:-EOF
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret:-EOF
-ret:-1         st: 0 flags:1  ts:-0.740839
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret:-EOF
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    124 size:  1364
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret:-EOF
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret:-EOF
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    124 size:  1364
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret:-EOF
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret:-EOF
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    124 size:  1364
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret:-EOF
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret:-EOF
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-pbmpipe b/deps/libav/tests/ref/seek/lavf-pbmpipe
deleted file mode 100644
index 2858934..0000000
--- a/deps/libav/tests/ref/seek/lavf-pbmpipe
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:317075
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-pcx b/deps/libav/tests/ref/seek/lavf-pcx
deleted file mode 100644
index 418674f..0000000
--- a/deps/libav/tests/ref/seek/lavf-pcx
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:364047
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-pgm b/deps/libav/tests/ref/seek/lavf-pgm
deleted file mode 100644
index 2836367..0000000
--- a/deps/libav/tests/ref/seek/lavf-pgm
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:101391
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-pgmpipe b/deps/libav/tests/ref/seek/lavf-pgmpipe
deleted file mode 100644
index 8ba5180..0000000
--- a/deps/libav/tests/ref/seek/lavf-pgmpipe
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:2534775
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-ppm b/deps/libav/tests/ref/seek/lavf-ppm
deleted file mode 100644
index 6376b5e..0000000
--- a/deps/libav/tests/ref/seek/lavf-ppm
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:304143
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-ppmpipe b/deps/libav/tests/ref/seek/lavf-ppmpipe
deleted file mode 100644
index 46c535a..0000000
--- a/deps/libav/tests/ref/seek/lavf-ppmpipe
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:7603575
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-rm b/deps/libav/tests/ref/seek/lavf-rm
deleted file mode 100644
index adce9e0..0000000
--- a/deps/libav/tests/ref/seek/lavf-rm
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    387 size:   278
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    688 size: 31082
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
-ret: 0         st: 0 flags:0  ts: 0.788000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
-ret: 0         st: 0 flags:1  ts:-0.317000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    688 size: 31082
-ret: 0         st: 1 flags:0  ts: 2.577000
-ret: 0         st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size:   278
-ret: 0         st: 1 flags:1  ts: 1.471000
-ret: 0         st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size:   278
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    688 size: 31082
-ret: 0         st: 0 flags:0  ts: 2.153000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
-ret: 0         st: 0 flags:1  ts: 1.048000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
-ret: 0         st: 1 flags:0  ts:-0.058000
-ret: 0         st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:    387 size:   278
-ret: 0         st: 1 flags:1  ts: 2.836000
-ret: 0         st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size:   278
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134
-ret: 0         st: 0 flags:0  ts:-0.482000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    688 size: 31082
-ret: 0         st: 0 flags:1  ts: 2.413000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
-ret: 0         st: 1 flags:0  ts: 1.307000
-ret: 0         st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size:   278
-ret: 0         st: 1 flags:1  ts: 0.201000
-ret: 0         st: 1 flags:1 dts: 0.174000 pts: 0.174000 pos:  78969 size:   278
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    688 size: 31082
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
-ret: 0         st: 0 flags:0  ts: 0.883000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
-ret: 0         st: 0 flags:1  ts:-0.222000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    688 size: 31082
-ret: 0         st: 1 flags:0  ts: 2.672000
-ret: 0         st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size:   278
-ret: 0         st: 1 flags:1  ts: 1.566000
-ret: 0         st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size:   278
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    688 size: 31082
diff --git a/deps/libav/tests/ref/seek/lavf-sgi b/deps/libav/tests/ref/seek/lavf-sgi
deleted file mode 100644
index b2f605a..0000000
--- a/deps/libav/tests/ref/seek/lavf-sgi
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:308336
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-swf b/deps/libav/tests/ref/seek/lavf-swf
deleted file mode 100644
index 52cd1e2..0000000
--- a/deps/libav/tests/ref/seek/lavf-swf
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:0 dts: 0.000000 pts: 0.000000 pos:     55 size: 31074
-ret:-1         st:-1 flags:0  ts:-1.000000
-ret:-1         st:-1 flags:1  ts: 1.894167
-ret:-1         st: 0 flags:0  ts: 0.800000
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret:-1         st:-1 flags:1  ts: 1.470835
-ret:-1         st: 0 flags:0  ts: 0.360000
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret:-1         st:-1 flags:1  ts: 1.047503
-ret:-1         st: 0 flags:0  ts:-0.040000
-ret:-1         st: 0 flags:1  ts: 2.840000
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret:-1         st:-1 flags:1  ts: 0.624171
-ret:-1         st: 0 flags:0  ts:-0.480000
-ret:-1         st: 0 flags:1  ts: 2.400000
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret:-1         st:-1 flags:1  ts: 0.200839
-ret:-1         st: 0 flags:0  ts:-0.920000
-ret:-1         st: 0 flags:1  ts: 2.000000
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret:-1         st: 0 flags:1  ts: 1.560000
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-tga b/deps/libav/tests/ref/seek/lavf-tga
deleted file mode 100644
index 8f90753..0000000
--- a/deps/libav/tests/ref/seek/lavf-tga
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:304172
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-tiff b/deps/libav/tests/ref/seek/lavf-tiff
deleted file mode 100644
index 1b49f2f..0000000
--- a/deps/libav/tests/ref/seek/lavf-tiff
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:307124
-ret:-EINVAL    st:-1 flags:0  ts:-1.000000
-ret:-EINVAL    st:-1 flags:1  ts: 1.894167
-ret:-EINVAL    st: 0 flags:0  ts: 0.800000
-ret:-EINVAL    st: 0 flags:1  ts:-0.320000
-ret:-EINVAL    st:-1 flags:0  ts: 2.576668
-ret:-EINVAL    st:-1 flags:1  ts: 1.470835
-ret:-EINVAL    st: 0 flags:0  ts: 0.360000
-ret:-EINVAL    st: 0 flags:1  ts:-0.760000
-ret:-EINVAL    st:-1 flags:0  ts: 2.153336
-ret:-EINVAL    st:-1 flags:1  ts: 1.047503
-ret:-EINVAL    st: 0 flags:0  ts:-0.040000
-ret:-EINVAL    st: 0 flags:1  ts: 2.840000
-ret:-EINVAL    st:-1 flags:0  ts: 1.730004
-ret:-EINVAL    st:-1 flags:1  ts: 0.624171
-ret:-EINVAL    st: 0 flags:0  ts:-0.480000
-ret:-EINVAL    st: 0 flags:1  ts: 2.400000
-ret:-EINVAL    st:-1 flags:0  ts: 1.306672
-ret:-EINVAL    st:-1 flags:1  ts: 0.200839
-ret:-EINVAL    st: 0 flags:0  ts:-0.920000
-ret:-EINVAL    st: 0 flags:1  ts: 2.000000
-ret:-EINVAL    st:-1 flags:0  ts: 0.883340
-ret:-EINVAL    st:-1 flags:1  ts:-0.222493
-ret:-EINVAL    st: 0 flags:0  ts: 2.680000
-ret:-EINVAL    st: 0 flags:1  ts: 1.560000
-ret:-EINVAL    st:-1 flags:0  ts: 0.460008
-ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-ts b/deps/libav/tests/ref/seek/lavf-ts
deleted file mode 100644
index df7c4af..0000000
--- a/deps/libav/tests/ref/seek/lavf-ts
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 1.400000 pts: 1.440000 pos:    564 size: 24801
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:0 dts: 1.480000 pts: 1.520000 pos:  44932 size: 14502
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 1 flags:1 dts: 2.160522 pts: 2.160522 pos: 403636 size:   209
-ret: 0         st: 0 flags:0  ts: 0.788333
-ret: 0         st: 0 flags:0 dts: 1.560000 pts: 1.600000 pos:  74260 size: 13388
-ret: 0         st: 0 flags:1  ts:-0.317500
-ret: 0         st: 0 flags:1 dts: 1.400000 pts: 1.440000 pos:    564 size: 24801
-ret: 0         st: 1 flags:0  ts: 2.576667
-ret: 0         st: 1 flags:1 dts: 2.160522 pts: 2.160522 pos: 403636 size:   209
-ret: 0         st: 1 flags:1  ts: 1.470833
-ret: 0         st: 0 flags:0 dts: 2.120000 pts: 2.160000 pos: 294032 size: 13839
-ret: 0         st:-1 flags:0  ts: 0.365002
-ret: 0         st: 0 flags:0 dts: 1.480000 pts: 1.520000 pos:  44932 size: 14502
-ret: 0         st:-1 flags:1  ts:-0.740831
-ret: 0         st: 0 flags:1 dts: 1.400000 pts: 1.440000 pos:    564 size: 24801
-ret: 0         st: 0 flags:0  ts: 2.153333
-ret: 0         st: 1 flags:1 dts: 2.160522 pts: 2.160522 pos: 403636 size:   209
-ret: 0         st: 0 flags:1  ts: 1.047500
-ret: 0         st: 0 flags:0 dts: 1.720000 pts: 1.760000 pos: 130096 size: 14133
-ret: 0         st: 1 flags:0  ts:-0.058333
-ret: 0         st: 0 flags:0 dts: 1.480000 pts: 1.520000 pos:  44932 size: 14502
-ret: 0         st: 1 flags:1  ts: 2.835833
-ret: 0         st: 1 flags:1 dts: 2.160522 pts: 2.160522 pos: 403636 size:   209
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 1 flags:1 dts: 2.160522 pts: 2.160522 pos: 403636 size:   209
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 1.400000 pts: 1.440000 pos:    564 size: 24801
-ret: 0         st: 0 flags:0  ts:-0.481667
-ret: 0         st: 0 flags:0 dts: 1.480000 pts: 1.520000 pos:  44932 size: 14502
-ret: 0         st: 0 flags:1  ts: 2.412500
-ret: 0         st: 1 flags:1 dts: 2.160522 pts: 2.160522 pos: 403636 size:   209
-ret: 0         st: 1 flags:0  ts: 1.306667
-ret: 0         st: 0 flags:0 dts: 2.040000 pts: 2.080000 pos: 265644 size: 12390
-ret: 0         st: 1 flags:1  ts: 0.200844
-ret: 0         st: 0 flags:1 dts: 1.400000 pts: 1.440000 pos:    564 size: 24801
-ret: 0         st:-1 flags:0  ts:-0.904994
-ret: 0         st: 0 flags:0 dts: 1.480000 pts: 1.520000 pos:  44932 size: 14502
-ret: 0         st:-1 flags:1  ts: 1.989173
-ret: 0         st: 1 flags:1 dts: 2.160522 pts: 2.160522 pos: 403636 size:   209
-ret: 0         st: 0 flags:0  ts: 0.883344
-ret: 0         st: 0 flags:0 dts: 1.640000 pts: 1.680000 pos: 102836 size: 12781
-ret: 0         st: 0 flags:1  ts:-0.222489
-ret: 0         st: 0 flags:1 dts: 1.400000 pts: 1.440000 pos:    564 size: 24801
-ret: 0         st: 1 flags:0  ts: 2.671678
-ret: 0         st: 1 flags:1 dts: 2.160522 pts: 2.160522 pos: 403636 size:   209
-ret: 0         st: 1 flags:1  ts: 1.565844
-ret: 0         st: 0 flags:0 dts: 2.200000 pts: 2.240000 pos: 325240 size: 12679
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:0 dts: 1.480000 pts: 1.520000 pos:  44932 size: 14502
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 1.400000 pts: 1.440000 pos:    564 size: 24801
diff --git a/deps/libav/tests/ref/seek/lavf-voc b/deps/libav/tests/ref/seek/lavf-voc
deleted file mode 100644
index 387aef6..0000000
--- a/deps/libav/tests/ref/seek/lavf-voc
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     32 size:  1024
-ret:-1         st:-1 flags:0  ts:-1.000000
-ret:-1         st:-1 flags:1  ts: 1.894167
-ret:-1         st: 0 flags:0  ts: 0.788335
-ret:-1         st: 0 flags:1  ts:-0.317508
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret:-1         st:-1 flags:1  ts: 1.470835
-ret:-1         st: 0 flags:0  ts: 0.365006
-ret:-1         st: 0 flags:1  ts:-0.740837
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret:-1         st:-1 flags:1  ts: 1.047503
-ret:-1         st: 0 flags:0  ts:-0.058323
-ret:-1         st: 0 flags:1  ts: 2.835834
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret:-1         st:-1 flags:1  ts: 0.624171
-ret:-1         st: 0 flags:0  ts:-0.481652
-ret:-1         st: 0 flags:1  ts: 2.412505
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret:-1         st:-1 flags:1  ts: 0.200839
-ret:-1         st: 0 flags:0  ts:-0.905003
-ret:-1         st: 0 flags:1  ts: 1.989176
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.671668
-ret:-1         st: 0 flags:1  ts: 1.565847
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/lavf-wav b/deps/libav/tests/ref/seek/lavf-wav
deleted file mode 100644
index 1a9cfc5..0000000
--- a/deps/libav/tests/ref/seek/lavf-wav
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret:-EOF
-ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.788345 pts: 0.788345 pos:  69578 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret:-EOF
-ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.365011 pts: 0.365011 pos:  32240 size:  4096
-ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret:-EOF
-ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.835828
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.624172 pts: 0.624172 pos:  55098 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:1  ts: 2.412494
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret:-EOF
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200839 pts: 0.200839 pos:  17760 size:  4096
-ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:1  ts: 1.989184
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.883333 pts: 0.883333 pos:  77956 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
-ret: 0         st: 0 flags:0  ts: 2.671678
-ret:-EOF
-ret: 0         st: 0 flags:1  ts: 1.565850
-ret:-EOF
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.460000 pts: 0.460000 pos:  40618 size:  4096
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     46 size:  4096
diff --git a/deps/libav/tests/ref/seek/lavf-yuv4mpeg b/deps/libav/tests/ref/seek/lavf-yuv4mpeg
deleted file mode 100644
index 81c1de9..0000000
--- a/deps/libav/tests/ref/seek/lavf-yuv4mpeg
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     64 size:152064
-ret:-1         st:-1 flags:0  ts:-1.000000
-ret:-1         st:-1 flags:1  ts: 1.894167
-ret:-1         st: 0 flags:0  ts: 0.800000
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret:-1         st:-1 flags:1  ts: 1.470835
-ret:-1         st: 0 flags:0  ts: 0.360000
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret:-1         st:-1 flags:1  ts: 1.047503
-ret:-1         st: 0 flags:0  ts:-0.040000
-ret:-1         st: 0 flags:1  ts: 2.840000
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret:-1         st:-1 flags:1  ts: 0.624171
-ret:-1         st: 0 flags:0  ts:-0.480000
-ret:-1         st: 0 flags:1  ts: 2.400000
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret:-1         st:-1 flags:1  ts: 0.200839
-ret:-1         st: 0 flags:0  ts:-0.920000
-ret:-1         st: 0 flags:1  ts: 2.000000
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret:-1         st: 0 flags:1  ts: 1.560000
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-asv1 b/deps/libav/tests/ref/seek/vsynth2-asv1
deleted file mode 100644
index 5873bb1..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-asv1
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 14316
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 14316
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 776840 size: 18256
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 305352 size: 16180
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 595448 size: 17980
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 135516 size: 14868
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 404100 size: 16856
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 14316
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813396 size: 18296
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 704136 size: 18140
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 241764 size: 15736
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 14316
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813396 size: 18296
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 524488 size: 17548
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:  77020 size: 14496
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 14316
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 813396 size: 18296
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 337808 size: 16388
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 631584 size: 18188
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 180212 size: 15168
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-asv2 b/deps/libav/tests/ref/seek/vsynth2-asv2
deleted file mode 100644
index 7d37b7a..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-asv2
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 13732
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 13732
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 736152 size: 17340
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 289708 size: 15300
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 564140 size: 17016
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 128564 size: 14052
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 383244 size: 15896
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 13732
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770852 size: 17400
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 667016 size: 17172
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 229388 size: 14956
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 13732
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770852 size: 17400
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 496932 size: 16564
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:  73176 size: 13664
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5656 size: 13732
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 770852 size: 17400
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 320444 size: 15592
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 598288 size: 17180
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171012 size: 14392
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-dnxhd-1080i b/deps/libav/tests/ref/seek/vsynth2-dnxhd-1080i
deleted file mode 100644
index 6c41d67..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-dnxhd-1080i
+++ /dev/null
@@ -1,44 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1  ts:-0.760000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:2424868 size:606208
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size:606208
diff --git a/deps/libav/tests/ref/seek/vsynth2-dnxhd-720p b/deps/libav/tests/ref/seek/vsynth2-dnxhd-720p
deleted file mode 100644
index b6398b6..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-dnxhd-720p
+++ /dev/null
@@ -1,40 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st: 0 flags:0  ts: 0.800000
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st: 0 flags:0  ts: 0.360000
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-dnxhd-720p-rd b/deps/libav/tests/ref/seek/vsynth2-dnxhd-720p-rd
deleted file mode 100644
index b6398b6..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-dnxhd-720p-rd
+++ /dev/null
@@ -1,40 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st: 0 flags:0  ts: 0.800000
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st: 0 flags:0  ts: 0.360000
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:458752
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 0.160000 pts: 0.160000 pos:1835008 size:458752
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-dv b/deps/libav/tests/ref/seek/vsynth2-dv
deleted file mode 100644
index baaeefb..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-dv
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts:-0.760000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
diff --git a/deps/libav/tests/ref/seek/vsynth2-dv-411 b/deps/libav/tests/ref/seek/vsynth2-dv-411
deleted file mode 100644
index baaeefb..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-dv-411
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts:-0.760000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
-ret: 0         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:144000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:     -1 size:144000
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:     -1 size:144000
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:144000
diff --git a/deps/libav/tests/ref/seek/vsynth2-dv-50 b/deps/libav/tests/ref/seek/vsynth2-dv-50
deleted file mode 100644
index 1f07e5b..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-dv-50
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:288000
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:288000
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:     -1 size:288000
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:     -1 size:288000
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:288000
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:288000
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:     -1 size:288000
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:     -1 size:288000
-ret: 0         st: 0 flags:1  ts:-0.760000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:288000
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:288000
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:     -1 size:288000
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:288000
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:288000
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:     -1 size:288000
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:     -1 size:288000
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:288000
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:288000
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:     -1 size:288000
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:     -1 size:288000
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:288000
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:288000
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:     -1 size:288000
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:288000
-ret: 0         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:     -1 size:288000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:     -1 size:288000
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:     -1 size:288000
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size:288000
diff --git a/deps/libav/tests/ref/seek/vsynth2-ffv1 b/deps/libav/tests/ref/seek/vsynth2-ffv1
deleted file mode 100644
index 715a272..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-ffv1
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5688 size: 71679
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5688 size: 71679
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2498334 size: 75937
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1630830 size: 72682
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2498334 size: 75937
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 801262 size: 69457
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1630830 size: 72682
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5688 size: 71679
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3392418 size: 77461
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3392418 size: 77461
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 801262 size: 69457
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5688 size: 71679
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3392418 size: 77461
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2498334 size: 75937
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5688 size: 71679
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5688 size: 71679
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3392418 size: 77461
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1630830 size: 72682
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2498334 size: 75937
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 801262 size: 69457
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-flashsv b/deps/libav/tests/ref/seek/vsynth2-flashsv
deleted file mode 100644
index 8bfb2fc..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-flashsv
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size:240757
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size:240757
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:11605762 size:254053
-ret: 0         st: 0 flags:0  ts: 0.788000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:4820517 size:245503
-ret:-1         st: 0 flags:1  ts:-0.317000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:8811911 size:253041
-ret: 0         st: 0 flags:0  ts: 0.365000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: 0.400000 pos:2387452 size:241101
-ret:-1         st: 0 flags:1  ts:-0.741000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:6302834 size:248927
-ret: 0         st: 0 flags:0  ts:-0.058000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size:240757
-ret: 0         st: 0 flags:1  ts: 2.836000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.760000 pts: 1.760000 pos:10843576 size:253913
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.600000 pts: 0.600000 pos:3598805 size:243372
-ret: 0         st: 0 flags:0  ts:-0.482000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size:240757
-ret: 0         st: 0 flags:1  ts: 2.413000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:8053716 size:252195
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:1187821 size:238567
-ret: 0         st: 0 flags:0  ts:-0.905000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size:240757
-ret: 0         st: 0 flags:1  ts: 1.989000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:12114712 size:254237
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.920000 pts: 0.920000 pos:5559238 size:247341
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.672000
-ret: 0         st: 0 flags:1  ts: 1.566000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:9572247 size:254219
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:2870253 size:242377
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-flv b/deps/libav/tests/ref/seek/vsynth2-flv
deleted file mode 100644
index 6952a4e..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-flv
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 10380
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 10380
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83240 size: 12295
-ret: 0         st: 0 flags:0  ts: 0.788000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  52585 size: 11127
-ret:-1         st: 0 flags:1  ts:-0.317000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83240 size: 12295
-ret: 0         st: 0 flags:0  ts: 0.365000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  25960 size: 10089
-ret:-1         st: 0 flags:1  ts:-0.741000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  52585 size: 11127
-ret: 0         st: 0 flags:0  ts:-0.058000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 10380
-ret: 0         st: 0 flags:1  ts: 2.836000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  25960 size: 10089
-ret: 0         st: 0 flags:0  ts:-0.482000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 10380
-ret: 0         st: 0 flags:1  ts: 2.413000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83240 size: 12295
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 10380
-ret: 0         st: 0 flags:0  ts:-0.905000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    199 size: 10380
-ret: 0         st: 0 flags:1  ts: 1.989000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 117158 size: 12730
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  52585 size: 11127
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.672000
-ret: 0         st: 0 flags:1  ts: 1.566000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83240 size: 12295
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  25960 size: 10089
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-h261 b/deps/libav/tests/ref/seek/vsynth2-h261
deleted file mode 100644
index 1789adc..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-h261
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9645
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9645
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126502 size: 11377
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  82060 size: 10322
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126502 size: 11377
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  44666 size:  9404
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  82060 size: 10322
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9645
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175870 size: 11707
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175870 size: 11707
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  44666 size:  9404
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9645
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175870 size: 11707
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126502 size: 11377
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9645
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9645
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 175870 size: 11707
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  82060 size: 10322
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 126502 size: 11377
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  44666 size:  9404
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-h263 b/deps/libav/tests/ref/seek/vsynth2-h263
deleted file mode 100644
index b92074f..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-h263
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10381
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10381
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103702 size: 12296
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  66792 size: 11128
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103702 size: 12296
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  36438 size: 10090
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  66792 size: 11128
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10381
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144546 size: 12731
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144546 size: 12731
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  36438 size: 10090
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10381
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144546 size: 12731
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103702 size: 12296
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10381
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10381
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 144546 size: 12731
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  66792 size: 11128
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 103702 size: 12296
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  36438 size: 10090
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-h263p b/deps/libav/tests/ref/seek/vsynth2-h263p
deleted file mode 100644
index 9d842a6..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-h263p
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 36208
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 36208
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569926 size: 45151
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355976 size: 40907
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569926 size: 45151
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171042 size: 36515
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355976 size: 40907
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 36208
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804366 size: 46411
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804366 size: 46411
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171042 size: 36515
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 36208
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804366 size: 46411
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569926 size: 45151
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 36208
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 36208
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 804366 size: 46411
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 355976 size: 40907
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 569926 size: 45151
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 171042 size: 36515
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-huffyuv b/deps/libav/tests/ref/seek/vsynth2-huffyuv
deleted file mode 100644
index 69a37f5..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-huffyuv
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5724 size:129760
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5724 size:129760
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:6069172 size:128520
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:2579612 size:129192
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:4778228 size:129424
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1160248 size:128504
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:3355284 size:129424
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5724 size:129760
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:6326124 size:128288
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:5553996 size:129016
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:2062492 size:129204
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5724 size:129760
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:6326124 size:128288
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:4260860 size:129280
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 646908 size:128204
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5724 size:129760
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:6326124 size:128288
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:2838068 size:129268
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:5037024 size:129284
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1546172 size:128860
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-jpegls b/deps/libav/tests/ref/seek/vsynth2-jpegls
deleted file mode 100644
index 3c0da21..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-jpegls
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:164074
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:164074
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:7804118 size:176295
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:3172780 size:164643
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:6052974 size:174097
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1402344 size:157283
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:4170248 size:168401
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:164074
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157016 size:176793
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:7101754 size:175326
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:2519260 size:162522
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:164074
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157016 size:176793
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:5360818 size:172183
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 779834 size:154579
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:164074
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:8157016 size:176793
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:3502828 size:166017
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:6401452 size:174815
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1876416 size:159659
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-ljpeg b/deps/libav/tests/ref/seek/vsynth2-ljpeg
deleted file mode 100644
index 92264c9..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-ljpeg
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 96069
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 96069
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:4481864 size: 94870
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:1902318 size: 95465
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:3527724 size: 95724
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 854944 size: 94635
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:2475566 size: 95649
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 96069
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4671498 size: 94595
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:4101338 size: 95353
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:1520284 size: 95410
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 96069
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4671498 size: 94595
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:3145114 size: 95587
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 477226 size: 94261
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 96069
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:4671498 size: 94595
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:2093302 size: 95528
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:3719126 size: 95615
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1139238 size: 95032
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mjpeg b/deps/libav/tests/ref/seek/vsynth2-mjpeg
deleted file mode 100644
index 59db09a..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mjpeg
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 12096
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 12096
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 627854 size: 14811
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 247488 size: 12959
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 480758 size: 14528
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 111000 size: 11927
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 326672 size: 13489
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 12096
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 657522 size: 14881
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 568652 size: 14746
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 196416 size: 12719
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 12096
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 657522 size: 14881
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 423482 size: 14119
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:  63860 size: 11714
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 12096
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 657522 size: 14881
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 273508 size: 13131
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 509926 size: 14597
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146958 size: 12168
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg1 b/deps/libav/tests/ref/seek/vsynth2-mpeg1
deleted file mode 100644
index a85055a..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg1
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  9779
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9779
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 124245 size: 11796
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  76694 size: 10792
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 124245 size: 11796
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  37721 size:  9873
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  76694 size: 10792
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9779
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 177089 size: 12057
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 177089 size: 12057
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  37721 size:  9873
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9779
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 177089 size: 12057
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 124245 size: 11796
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9779
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9779
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 177089 size: 12057
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  76694 size: 10792
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 124245 size: 11796
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  37721 size:  9873
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg1b b/deps/libav/tests/ref/seek/vsynth2-mpeg1b
deleted file mode 100644
index 3b0b084..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg1b
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size: 11817
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 11817
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.800000 pts: NOPTS    pos: 194420 size: 14837
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: NOPTS    pos:  80757 size: 13267
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: NOPTS    pos: 133899 size: 14470
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: NOPTS    pos:  34797 size: 12009
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: NOPTS    pos:  80757 size: 13267
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 11817
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.800000 pts: NOPTS    pos: 194420 size: 14837
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.800000 pts: NOPTS    pos: 194420 size: 14837
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: NOPTS    pos:  34797 size: 12009
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 11817
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.800000 pts: NOPTS    pos: 194420 size: 14837
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: NOPTS    pos: 133899 size: 14470
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 11817
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 11817
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.800000 pts: NOPTS    pos: 194420 size: 14837
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: NOPTS    pos: 133899 size: 14470
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: NOPTS    pos: 133899 size: 14470
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.840000 pts: NOPTS    pos:  80757 size: 13267
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg2-422 b/deps/libav/tests/ref/seek/vsynth2-mpeg2-422
deleted file mode 100644
index d06b7cb..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg2-422
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 17497
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 17497
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 325162 size: 19936
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 200736 size: 22575
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 265477 size: 21329
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos: 104454 size: 28984
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 200736 size: 22575
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 17497
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 325162 size: 19936
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 325162 size: 19936
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos: 104454 size: 28984
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 17497
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 325162 size: 19936
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 265477 size: 21329
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 17497
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 17497
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 325162 size: 19936
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 200736 size: 22575
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 265477 size: 21329
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 200736 size: 22575
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg2-idct-int b/deps/libav/tests/ref/seek/vsynth2-mpeg2-idct-int
deleted file mode 100644
index 698cedf..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg2-idct-int
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9911
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9911
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 127925 size: 11918
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  79103 size: 10909
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 127925 size: 11918
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  38992 size:  9985
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  79103 size: 10909
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9911
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 182138 size: 12183
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 182138 size: 12183
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  38992 size:  9985
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9911
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 182138 size: 12183
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 127925 size: 11918
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9911
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9911
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 182138 size: 12183
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  79103 size: 10909
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 127925 size: 11918
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  38992 size:  9985
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg2-ilace b/deps/libav/tests/ref/seek/vsynth2-mpeg2-ilace
deleted file mode 100644
index a2427f3..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg2-ilace
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 132607 size: 11970
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  82152 size: 10965
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 132607 size: 11970
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  40546 size: 10045
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  82152 size: 10965
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 188429 size: 12232
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 188429 size: 12232
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  40546 size: 10045
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 188429 size: 12232
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 132607 size: 11970
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: NOPTS    pos: 188429 size: 12232
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: NOPTS    pos:  82152 size: 10965
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: NOPTS    pos: 132607 size: 11970
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: NOPTS    pos:  40546 size: 10045
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg2-ivlc-qprd b/deps/libav/tests/ref/seek/vsynth2-mpeg2-ivlc-qprd
deleted file mode 100644
index 9a623c2..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg2-ivlc-qprd
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 16239
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 16239
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 227500 size: 12725
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 164167 size: 13921
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 196681 size: 13159
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  98748 size: 29165
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 164167 size: 13921
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 16239
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 227500 size: 12725
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 227500 size: 12725
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  98748 size: 29165
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 16239
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 227500 size: 12725
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 196681 size: 13159
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 16239
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size: 16239
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 227500 size: 12725
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 164167 size: 13921
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 196681 size: 13159
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 164167 size: 13921
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg2-thread b/deps/libav/tests/ref/seek/vsynth2-mpeg2-thread
deleted file mode 100644
index d8c9e28..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg2-thread
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 158225 size: 12232
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67790 size: 10965
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110330 size: 11970
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  30747 size: 10045
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67790 size: 10965
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 158225 size: 12232
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 158225 size: 12232
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  30747 size: 10045
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 158225 size: 12232
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110330 size: 11970
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9961
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 158225 size: 12232
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67790 size: 10965
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110330 size: 11970
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67790 size: 10965
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg2-thread-ivlc b/deps/libav/tests/ref/seek/vsynth2-mpeg2-thread-ivlc
deleted file mode 100644
index f1909b6..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg2-thread-ivlc
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9954
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9954
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 157678 size: 11930
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67723 size: 10791
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110080 size: 11697
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  30744 size:  9980
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67723 size: 10791
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9954
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 157678 size: 11930
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 157678 size: 11930
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  30744 size:  9980
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9954
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 157678 size: 11930
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110080 size: 11697
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9954
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:      0 size:  9954
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 157678 size: 11930
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67723 size: 10791
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 110080 size: 11697
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  67723 size: 10791
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg4 b/deps/libav/tests/ref/seek/vsynth2-mpeg4
deleted file mode 100644
index 0600ed0..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg4
+++ /dev/null
@@ -1,50 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  75140 size: 10776
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  47228 size:  9634
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  75140 size: 10776
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  23271 size:  8524
-ret: 0         st: 0 flags:1  ts:-0.760000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  47228 size:  9634
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  23271 size:  8524
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  75140 size: 10776
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 106167 size: 11182
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  47228 size:  9634
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  75140 size: 10776
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  23271 size:  8524
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     44 size:  8719
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg4-adap b/deps/libav/tests/ref/seek/vsynth2-mpeg4-adap
deleted file mode 100644
index 87b80cc..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg4-adap
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size:  6855
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size:  6855
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 174444 size: 16883
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  98216 size: 17063
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 135586 size: 17525
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  59442 size: 17261
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  98216 size: 17063
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size:  6855
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 174444 size: 16883
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 174444 size: 16883
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  59442 size: 17261
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size:  6855
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 174444 size: 16883
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 135586 size: 17525
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size:  6855
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size:  6855
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 174444 size: 16883
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  98216 size: 17063
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 135586 size: 17525
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  98216 size: 17063
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg4-adv b/deps/libav/tests/ref/seek/vsynth2-mpeg4-adv
deleted file mode 100644
index 6765864..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg4-adv
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8653
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8653
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  91718 size: 11013
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  59492 size:  9815
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  91718 size: 11013
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  31932 size:  8753
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  59492 size:  9815
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8653
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127612 size: 11279
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127612 size: 11279
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  31932 size:  8753
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8653
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127612 size: 11279
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  91718 size: 11013
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8653
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8653
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 127612 size: 11279
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  59492 size:  9815
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  91718 size: 11013
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  31932 size:  8753
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg4-error b/deps/libav/tests/ref/seek/vsynth2-mpeg4-error
deleted file mode 100644
index 322bcab..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg4-error
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9564
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9564
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113130 size: 12795
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  71648 size: 11680
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113130 size: 12795
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  36770 size: 10310
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  71648 size: 11680
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9564
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159358 size: 13895
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159358 size: 13895
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  36770 size: 10310
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9564
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159358 size: 13895
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113130 size: 12795
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9564
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9564
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 159358 size: 13895
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  71648 size: 11680
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 113130 size: 12795
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  36770 size: 10310
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg4-nr b/deps/libav/tests/ref/seek/vsynth2-mpeg4-nr
deleted file mode 100644
index 5273ae1..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg4-nr
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10673
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10673
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100628 size: 12464
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  65468 size: 11181
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100628 size: 12464
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  35300 size:  9987
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  65468 size: 11181
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10673
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139412 size: 12911
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139412 size: 12911
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  35300 size:  9987
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10673
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139412 size: 12911
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100628 size: 12464
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10673
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size: 10673
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139412 size: 12911
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  65468 size: 11181
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 100628 size: 12464
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  35300 size:  9987
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg4-qpel b/deps/libav/tests/ref/seek/vsynth2-mpeg4-qpel
deleted file mode 100644
index 195fb30..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg4-qpel
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 11942
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 11942
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 141518 size: 15562
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  64104 size: 13382
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 100356 size: 15057
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  32806 size: 11813
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  64104 size: 13382
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 11942
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 141518 size: 15562
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 141518 size: 15562
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  32806 size: 11813
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 11942
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 141518 size: 15562
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 100356 size: 15057
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 11942
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 11942
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 141518 size: 15562
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  64104 size: 13382
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 100356 size: 15057
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos:  64104 size: 13382
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg4-qprd b/deps/libav/tests/ref/seek/vsynth2-mpeg4-qprd
deleted file mode 100644
index 4c3c7f5..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg4-qprd
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14873
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14873
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 211020 size: 14638
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 150654 size: 14502
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180770 size: 14371
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  93024 size: 29366
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 150654 size: 14502
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14873
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 211020 size: 14638
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 211020 size: 14638
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  93024 size: 29366
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14873
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 211020 size: 14638
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180770 size: 14371
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14873
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14873
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 211020 size: 14638
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 150654 size: 14502
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180770 size: 14371
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 150654 size: 14502
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg4-rc b/deps/libav/tests/ref/seek/vsynth2-mpeg4-rc
deleted file mode 100644
index 5c96c78..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg4-rc
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 15766
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 15766
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 207956 size: 13826
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 153800 size: 13382
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180948 size: 13326
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  94582 size: 32807
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 153800 size: 13382
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 15766
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 207956 size: 13826
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 207956 size: 13826
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  94582 size: 32807
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 15766
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 207956 size: 13826
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180948 size: 13326
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 15766
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 15766
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 207956 size: 13826
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 153800 size: 13382
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 180948 size: 13326
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 153800 size: 13382
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-mpeg4-thread b/deps/libav/tests/ref/seek/vsynth2-mpeg4-thread
deleted file mode 100644
index 8c4f663..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-mpeg4-thread
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14874
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14874
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 228210 size: 16324
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 162150 size: 16475
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 195320 size: 16136
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  97832 size: 33332
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 162150 size: 16475
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14874
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 228210 size: 16324
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 228210 size: 16324
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.400000 pts: NOPTS    pos:  97832 size: 33332
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14874
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 228210 size: 16324
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 195320 size: 16136
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14874
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: NOPTS    pos:   5648 size: 14874
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.840000 pts: NOPTS    pos: 228210 size: 16324
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 162150 size: 16475
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.360000 pts: NOPTS    pos: 195320 size: 16136
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: NOPTS    pos: 162150 size: 16475
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-msmpeg4 b/deps/libav/tests/ref/seek/vsynth2-msmpeg4
deleted file mode 100644
index 323f96a..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-msmpeg4
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8637
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8637
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  82508 size: 10783
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  53846 size:  9624
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  82508 size: 10783
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29388 size:  8502
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  53846 size:  9624
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8637
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114264 size: 11180
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114264 size: 11180
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29388 size:  8502
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8637
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114264 size: 11180
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  82508 size: 10783
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8637
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8637
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 114264 size: 11180
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  53846 size:  9624
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  82508 size: 10783
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29388 size:  8502
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-msmpeg4v2 b/deps/libav/tests/ref/seek/vsynth2-msmpeg4v2
deleted file mode 100644
index 177898e..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-msmpeg4v2
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9003
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9003
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83870 size: 11165
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54778 size: 10010
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83870 size: 11165
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29770 size:  8869
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54778 size: 10010
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9003
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116100 size: 11578
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116100 size: 11578
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29770 size:  8869
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9003
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116100 size: 11578
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83870 size: 11165
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9003
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  9003
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116100 size: 11578
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54778 size: 10010
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83870 size: 11165
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29770 size:  8869
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-rgb b/deps/libav/tests/ref/seek/vsynth2-rgb
deleted file mode 100644
index 91f7260..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-rgb
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:304128
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:304128
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:14300040 size:304128
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:6088368 size:304128
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:11258680 size:304128
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:2742872 size:304128
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:7913184 size:304128
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:304128
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:14908312 size:304128
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:13083496 size:304128
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:4871824 size:304128
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:304128
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:14908312 size:304128
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:10042136 size:304128
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:1526328 size:304128
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:304128
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:14908312 size:304128
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:6696640 size:304128
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:11866952 size:304128
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:3655280 size:304128
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-roqvideo b/deps/libav/tests/ref/seek/vsynth2-roqvideo
deleted file mode 100644
index d003a37..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-roqvideo
+++ /dev/null
@@ -1,27 +0,0 @@
-ret: 0         st: 0 flags:0 dts: 0.000000 pts: 0.000000 pos:     24 size: 26082
-ret:-1         st:-1 flags:0  ts:-1.000000
-ret:-1         st:-1 flags:1  ts: 1.894167
-ret:-1         st: 0 flags:0  ts: 0.800000
-ret:-1         st: 0 flags:1  ts:-0.333333
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret:-1         st:-1 flags:1  ts: 1.470835
-ret:-1         st: 0 flags:0  ts: 0.366667
-ret:-1         st: 0 flags:1  ts:-0.733333
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret:-1         st:-1 flags:1  ts: 1.047503
-ret:-1         st: 0 flags:0  ts:-0.066667
-ret:-1         st: 0 flags:1  ts: 2.833333
-ret:-1         st:-1 flags:0  ts: 1.730004
-ret:-1         st:-1 flags:1  ts: 0.624171
-ret:-1         st: 0 flags:0  ts:-0.466667
-ret:-1         st: 0 flags:1  ts: 2.400000
-ret:-1         st:-1 flags:0  ts: 1.306672
-ret:-1         st:-1 flags:1  ts: 0.200839
-ret:-1         st: 0 flags:0  ts:-0.900000
-ret:-1         st: 0 flags:1  ts: 2.000000
-ret:-1         st:-1 flags:0  ts: 0.883340
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.666667
-ret:-1         st: 0 flags:1  ts: 1.566667
-ret:-1         st:-1 flags:0  ts: 0.460008
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-rv10 b/deps/libav/tests/ref/seek/vsynth2-rv10
deleted file mode 100644
index 123b03c..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-rv10
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  98608 size: 12303
-ret: 0         st: 0 flags:0  ts: 0.788000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  61592 size: 11135
-ret: 0         st: 0 flags:1  ts:-0.317000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  98608 size: 12303
-ret: 0         st: 0 flags:0  ts: 0.365000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  31132 size: 10097
-ret: 0         st: 0 flags:1  ts:-0.741000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  61592 size: 11135
-ret: 0         st: 0 flags:0  ts:-0.058000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
-ret: 0         st: 0 flags:1  ts: 2.836000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  31132 size: 10097
-ret: 0         st: 0 flags:0  ts:-0.482000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
-ret: 0         st: 0 flags:1  ts: 2.413000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  98608 size: 12303
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
-ret: 0         st: 0 flags:0  ts:-0.905000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
-ret: 0         st: 0 flags:1  ts: 1.989000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  61592 size: 11135
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
-ret: 0         st: 0 flags:0  ts: 2.672000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139556 size: 12738
-ret: 0         st: 0 flags:1  ts: 1.566000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  98608 size: 12303
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  31132 size: 10097
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size: 10388
diff --git a/deps/libav/tests/ref/seek/vsynth2-rv20 b/deps/libav/tests/ref/seek/vsynth2-rv20
deleted file mode 100644
index f2b24e3..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-rv20
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  98158 size: 11344
-ret: 0         st: 0 flags:0  ts: 0.788000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  61133 size: 10166
-ret: 0         st: 0 flags:1  ts:-0.317000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
-ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  98158 size: 11344
-ret: 0         st: 0 flags:0  ts: 0.365000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  30753 size:  9101
-ret: 0         st: 0 flags:1  ts:-0.741000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  61133 size: 10166
-ret: 0         st: 0 flags:0  ts:-0.058000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
-ret: 0         st: 0 flags:1  ts: 2.836000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  30753 size:  9101
-ret: 0         st: 0 flags:0  ts:-0.482000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
-ret: 0         st: 0 flags:1  ts: 2.413000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  98158 size: 11344
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
-ret: 0         st: 0 flags:0  ts:-0.905000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
-ret: 0         st: 0 flags:1  ts: 1.989000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  61133 size: 10166
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
-ret: 0         st: 0 flags:0  ts: 2.672000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 139145 size: 11803
-ret: 0         st: 0 flags:1  ts: 1.566000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  98158 size: 11344
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  30753 size:  9101
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    239 size:  9361
diff --git a/deps/libav/tests/ref/seek/vsynth2-svq1 b/deps/libav/tests/ref/seek/vsynth2-svq1
deleted file mode 100644
index 17bb99e..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-svq1
+++ /dev/null
@@ -1,50 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552
-ret: 0         st: 0 flags:1  ts:-0.320000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896
-ret: 0         st: 0 flags:1  ts:-0.760000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552
-ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896
-ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     36 size: 22300
diff --git a/deps/libav/tests/ref/seek/vsynth2-wmv1 b/deps/libav/tests/ref/seek/vsynth2-wmv1
deleted file mode 100644
index 85465b3..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-wmv1
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8990
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8990
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83742 size: 11099
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54758 size:  9931
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83742 size: 11099
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29794 size:  8796
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54758 size:  9931
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8990
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115812 size: 11487
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115812 size: 11487
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29794 size:  8796
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8990
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115812 size: 11487
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83742 size: 11099
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8990
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:  8990
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 115812 size: 11487
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54758 size:  9931
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83742 size: 11099
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29794 size:  8796
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-wmv2 b/deps/libav/tests/ref/seek/vsynth2-wmv2
deleted file mode 100644
index 53680d0..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-wmv2
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size:  8917
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size:  8917
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83764 size: 11170
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54534 size:  9989
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83764 size: 11170
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29588 size:  8839
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54534 size:  9989
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size:  8917
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116062 size: 11554
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116062 size: 11554
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29588 size:  8839
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size:  8917
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116062 size: 11554
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83764 size: 11170
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size:  8917
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size:  8917
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116062 size: 11554
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:  54534 size:  9989
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:  83764 size: 11170
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:  29588 size:  8839
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/seek/vsynth2-yuv b/deps/libav/tests/ref/seek/vsynth2-yuv
deleted file mode 100644
index d440761..0000000
--- a/deps/libav/tests/ref/seek/vsynth2-yuv
+++ /dev/null
@@ -1,46 +0,0 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:152064
-ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:152064
-ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos:7153032 size:152064
-ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos:3047088 size:152064
-ret:-1         st: 0 flags:1  ts:-0.320000
-ret:-1         st:-1 flags:0  ts: 2.576668
-ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos:5632312 size:152064
-ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:1374296 size:152064
-ret:-1         st: 0 flags:1  ts:-0.760000
-ret:-1         st:-1 flags:0  ts: 2.153336
-ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos:3959520 size:152064
-ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:152064
-ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:7457176 size:152064
-ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos:6544744 size:152064
-ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos:2438800 size:152064
-ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:152064
-ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:7457176 size:152064
-ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos:5024024 size:152064
-ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos: 766008 size:152064
-ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5648 size:152064
-ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos:7457176 size:152064
-ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos:3351232 size:152064
-ret:-1         st:-1 flags:1  ts:-0.222493
-ret:-1         st: 0 flags:0  ts: 2.680000
-ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos:5936456 size:152064
-ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:1830512 size:152064
-ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-asv1 b/deps/libav/tests/ref/vsynth/vsynth1-asv1
deleted file mode 100644
index e640f1c..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-asv1
+++ /dev/null
@@ -1,4 +0,0 @@
-41b011551d23ddadaab1083cb2106d9f *tests/data/fate/vsynth1-asv1.avi
-1489644 tests/data/fate/vsynth1-asv1.avi
-2dfc5dfc2c1cbbc2543257cd3d2df6af *tests/data/fate/vsynth1-asv1.out.rawvideo
-stddev:   20.00 PSNR: 22.11 MAXDIFF:  158 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-asv2 b/deps/libav/tests/ref/vsynth/vsynth1-asv2
deleted file mode 100644
index 6282ad4..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-asv2
+++ /dev/null
@@ -1,4 +0,0 @@
-a0773690d0e772ff832adea1e8c16773 *tests/data/fate/vsynth1-asv2.avi
-1456044 tests/data/fate/vsynth1-asv2.avi
-d451be09793cd0f35b6d91fc36e2571a *tests/data/fate/vsynth1-asv2.out.rawvideo
-stddev:   18.82 PSNR: 22.63 MAXDIFF:  131 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-cljr b/deps/libav/tests/ref/vsynth/vsynth1-cljr
deleted file mode 100644
index cdd6ca2..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-cljr
+++ /dev/null
@@ -1,4 +0,0 @@
-41fc45d5e8bca3cf2be35457b188cdb3 *tests/data/fate/vsynth1-cljr.avi
-5075648 tests/data/fate/vsynth1-cljr.avi
-72e01607bae16527bc6389cf6db00b5f *tests/data/fate/vsynth1-cljr.out.rawvideo
-stddev:    6.95 PSNR: 31.28 MAXDIFF:   86 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-1080i b/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-1080i
deleted file mode 100644
index 8d396e8..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-1080i
+++ /dev/null
@@ -1,4 +0,0 @@
-9e55c9ec332cc6ee002da67de34ca6d1 *tests/data/fate/vsynth1-dnxhd-1080i.mov
-3031875 tests/data/fate/vsynth1-dnxhd-1080i.mov
-34076f61254997c8157eafed1c916472 *tests/data/fate/vsynth1-dnxhd-1080i.out.rawvideo
-stddev:    6.29 PSNR: 32.15 MAXDIFF:   64 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-720p b/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-720p
deleted file mode 100644
index 94c28ed..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-720p
+++ /dev/null
@@ -1,4 +0,0 @@
-81f5be451dc18cf8a1d333c7885de60b *tests/data/fate/vsynth1-dnxhd-720p.dnxhd
-2293760 tests/data/fate/vsynth1-dnxhd-720p.dnxhd
-94b21e5e68ccf9471eff74afd0ebe319 *tests/data/fate/vsynth1-dnxhd-720p.out.rawvideo
-stddev:    6.32 PSNR: 32.11 MAXDIFF:  183 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-720p-10bit b/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-720p-10bit
deleted file mode 100644
index a667b9d..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-720p-10bit
+++ /dev/null
@@ -1,4 +0,0 @@
-b5e24a055af02edec8674333260214fd *tests/data/fate/vsynth1-dnxhd-720p-10bit.dnxhd
-2293760 tests/data/fate/vsynth1-dnxhd-720p-10bit.dnxhd
-4466ff3d73d01bbe75ea25001d379b63 *tests/data/fate/vsynth1-dnxhd-720p-10bit.out.rawvideo
-stddev:    6.27 PSNR: 32.18 MAXDIFF:   64 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-720p-rd b/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-720p-rd
deleted file mode 100644
index 1de576a..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-dnxhd-720p-rd
+++ /dev/null
@@ -1,4 +0,0 @@
-1dc6e95925c4f3a230848ec17c02abed *tests/data/fate/vsynth1-dnxhd-720p-rd.dnxhd
-2293760 tests/data/fate/vsynth1-dnxhd-720p-rd.dnxhd
-02972d2aec120ec1577ec9053d68ae0f *tests/data/fate/vsynth1-dnxhd-720p-rd.out.rawvideo
-stddev:    6.26 PSNR: 32.19 MAXDIFF:   65 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-dv b/deps/libav/tests/ref/vsynth/vsynth1-dv
deleted file mode 100644
index f5a37ad..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-dv
+++ /dev/null
@@ -1,4 +0,0 @@
-27ade3031b17214cf81c19cbf70f37d7 *tests/data/fate/vsynth1-dv.dv
-7200000 tests/data/fate/vsynth1-dv.dv
-02ac7cdeab91d4d5621e7ce96dddc498 *tests/data/fate/vsynth1-dv.out.rawvideo
-stddev:    6.90 PSNR: 31.34 MAXDIFF:   76 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-dv-411 b/deps/libav/tests/ref/vsynth/vsynth1-dv-411
deleted file mode 100644
index a1f07da..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-dv-411
+++ /dev/null
@@ -1,4 +0,0 @@
-bd67f2431db160d4bb6dcd791cea6efd *tests/data/fate/vsynth1-dv-411.dv
-7200000 tests/data/fate/vsynth1-dv-411.dv
-53946d51762b7826773e681fb02f377b *tests/data/fate/vsynth1-dv-411.out.rawvideo
-stddev:    9.45 PSNR: 28.62 MAXDIFF:   84 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-dv-50 b/deps/libav/tests/ref/vsynth/vsynth1-dv-50
deleted file mode 100644
index 18ee398..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-dv-50
+++ /dev/null
@@ -1,4 +0,0 @@
-26dba84f0ea895b914ef5b333d8394ac *tests/data/fate/vsynth1-dv-50.dv
-14400000 tests/data/fate/vsynth1-dv-50.dv
-a2ff093e93ffed10f730fa21df02fc50 *tests/data/fate/vsynth1-dv-50.out.rawvideo
-stddev:    1.72 PSNR: 43.38 MAXDIFF:   29 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-ffv1 b/deps/libav/tests/ref/vsynth/vsynth1-ffv1
deleted file mode 100644
index a162a77..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-ffv1
+++ /dev/null
@@ -1,4 +0,0 @@
-d236e8441d7e04e24d882bb97faccd36 *tests/data/fate/vsynth1-ffv1.avi
-2689718 tests/data/fate/vsynth1-ffv1.avi
-c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ffv1.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-ffvhuff b/deps/libav/tests/ref/vsynth/vsynth1-ffvhuff
deleted file mode 100644
index cf86f57..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-ffvhuff
+++ /dev/null
@@ -1,4 +0,0 @@
-2279cfd5efce9dc3435b814f1f95dcbc *tests/data/fate/vsynth1-ffvhuff.avi
-5987196 tests/data/fate/vsynth1-ffvhuff.avi
-c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ffvhuff.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-flashsv b/deps/libav/tests/ref/vsynth/vsynth1-flashsv
deleted file mode 100644
index b934d8d..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-flashsv
+++ /dev/null
@@ -1,4 +0,0 @@
-97894502b4cb57aca1105b6333f72dae *tests/data/fate/vsynth1-flashsv.flv
-14681925 tests/data/fate/vsynth1-flashsv.flv
-947cb24ec45a453348ae6fe3fa278071 *tests/data/fate/vsynth1-flashsv.out.rawvideo
-stddev:    2.85 PSNR: 39.03 MAXDIFF:   49 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-flv b/deps/libav/tests/ref/vsynth/vsynth1-flv
deleted file mode 100644
index 4b57bdf..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-flv
+++ /dev/null
@@ -1,4 +0,0 @@
-d6a80659cedee7698aefe9c4a8285fa4 *tests/data/fate/vsynth1-flv.flv
-636269 tests/data/fate/vsynth1-flv.flv
-5ab46d8dd01dbb1d63df2a84858a4b05 *tests/data/fate/vsynth1-flv.out.rawvideo
-stddev:    8.02 PSNR: 30.04 MAXDIFF:  105 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-h261 b/deps/libav/tests/ref/vsynth/vsynth1-h261
deleted file mode 100644
index b350e6f..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-h261
+++ /dev/null
@@ -1,4 +0,0 @@
-d3397557ad8a02d28cb5feeb0b51e5c8 *tests/data/fate/vsynth1-h261.avi
-707576 tests/data/fate/vsynth1-h261.avi
-716e83cb51afb1246bfaa80967df48ea *tests/data/fate/vsynth1-h261.out.rawvideo
-stddev:    9.11 PSNR: 28.93 MAXDIFF:  113 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-h263 b/deps/libav/tests/ref/vsynth/vsynth1-h263
deleted file mode 100644
index d5916fa..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-h263
+++ /dev/null
@@ -1,4 +0,0 @@
-130ae384b6f12fd7d18979aa5371523a *tests/data/fate/vsynth1-h263.avi
-659674 tests/data/fate/vsynth1-h263.avi
-1a1ba9a3a63ec1a1a9585fded0a7c954 *tests/data/fate/vsynth1-h263.out.rawvideo
-stddev:    8.03 PSNR: 30.03 MAXDIFF:  103 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-h263-obmc b/deps/libav/tests/ref/vsynth/vsynth1-h263-obmc
deleted file mode 100644
index ca3d4bf..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-h263-obmc
+++ /dev/null
@@ -1,4 +0,0 @@
-4e7faa9203abf55a492802d30a8d80ea *tests/data/fate/vsynth1-h263-obmc.avi
-657354 tests/data/fate/vsynth1-h263-obmc.avi
-eba1d733a0c4b71322a78f718f312599 *tests/data/fate/vsynth1-h263-obmc.out.rawvideo
-stddev:    8.16 PSNR: 29.89 MAXDIFF:  113 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-h263p b/deps/libav/tests/ref/vsynth/vsynth1-h263p
deleted file mode 100644
index 9e1765f..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-h263p
+++ /dev/null
@@ -1,4 +0,0 @@
-b34c1a52bb504e702485d8d268dd1068 *tests/data/fate/vsynth1-h263p.avi
-2328336 tests/data/fate/vsynth1-h263p.avi
-9554cda00c3487ab3ffda2c3ea22fa2f *tests/data/fate/vsynth1-h263p.out.rawvideo
-stddev:    2.06 PSNR: 41.83 MAXDIFF:   20 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-huffyuv b/deps/libav/tests/ref/vsynth/vsynth1-huffyuv
deleted file mode 100644
index 246da19..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-huffyuv
+++ /dev/null
@@ -1,4 +0,0 @@
-cd93849c8e9846490d8f950f1b2319d5 *tests/data/fate/vsynth1-huffyuv.avi
-7933788 tests/data/fate/vsynth1-huffyuv.avi
-c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-huffyuv.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-jpegls b/deps/libav/tests/ref/vsynth/vsynth1-jpegls
deleted file mode 100644
index b54bd5d..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-jpegls
+++ /dev/null
@@ -1,4 +0,0 @@
-f8acf917e24ea6c9200f2cdf99744ca9 *tests/data/fate/vsynth1-jpegls.avi
-9089800 tests/data/fate/vsynth1-jpegls.avi
-947cb24ec45a453348ae6fe3fa278071 *tests/data/fate/vsynth1-jpegls.out.rawvideo
-stddev:    2.85 PSNR: 39.03 MAXDIFF:   49 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-ljpeg b/deps/libav/tests/ref/vsynth/vsynth1-ljpeg
deleted file mode 100644
index 702de39..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-ljpeg
+++ /dev/null
@@ -1,4 +0,0 @@
-aed2be6710c0dddacfa410dff7ce7e79 *tests/data/fate/vsynth1-ljpeg.avi
-6312924 tests/data/fate/vsynth1-ljpeg.avi
-c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ljpeg.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mjpeg b/deps/libav/tests/ref/vsynth/vsynth1-mjpeg
deleted file mode 100644
index 3c6fb4b..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mjpeg
+++ /dev/null
@@ -1,4 +0,0 @@
-b3ff9a5a9699ceddfee9abbf1b06bb00 *tests/data/fate/vsynth1-mjpeg.avi
-1516128 tests/data/fate/vsynth1-mjpeg.avi
-c6ae81b5b896e4d05ff584311aebdb18 *tests/data/fate/vsynth1-mjpeg.out.rawvideo
-stddev:    7.87 PSNR: 30.21 MAXDIFF:   63 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg1 b/deps/libav/tests/ref/vsynth/vsynth1-mpeg1
deleted file mode 100644
index 5f3d703..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg1
+++ /dev/null
@@ -1,4 +0,0 @@
-1428744c6d5835f27506e69be4f837f4 *tests/data/fate/vsynth1-mpeg1.mpeg1video
-712006 tests/data/fate/vsynth1-mpeg1.mpeg1video
-58f0c332bf689117b57fa629a2bc0d2b *tests/data/fate/vsynth1-mpeg1.out.rawvideo
-stddev:    7.62 PSNR: 30.48 MAXDIFF:   84 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg1b b/deps/libav/tests/ref/vsynth/vsynth1-mpeg1b
deleted file mode 100644
index ddd9bef..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg1b
+++ /dev/null
@@ -1,4 +0,0 @@
-777639666b449ab0a7ef260511e40532 *tests/data/fate/vsynth1-mpeg1b.mpeg1video
-1030337 tests/data/fate/vsynth1-mpeg1b.mpeg1video
-91a7fce732b34748e7bf753ebabe2483 *tests/data/fate/vsynth1-mpeg1b.out.rawvideo
-stddev:    6.30 PSNR: 32.13 MAXDIFF:   75 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2 b/deps/libav/tests/ref/vsynth/vsynth1-mpeg2
deleted file mode 100644
index 1ee3674..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2
+++ /dev/null
@@ -1,4 +0,0 @@
-fbddea2368cd2028fc8db4dfd4682e94 *tests/data/fate/vsynth1-mpeg2.mpeg2video
-728044 tests/data/fate/vsynth1-mpeg2.mpeg2video
-b41ca49c1a02e66ce64d262e2cdaec15 *tests/data/fate/vsynth1-mpeg2.out.rawvideo
-stddev:    7.65 PSNR: 30.45 MAXDIFF:   84 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-422 b/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-422
deleted file mode 100644
index 5948446..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-422
+++ /dev/null
@@ -1,4 +0,0 @@
-af0cb75451aaa807beb5102707a98823 *tests/data/fate/vsynth1-mpeg2-422.mpeg2video
-728200 tests/data/fate/vsynth1-mpeg2-422.mpeg2video
-eb7fe83ce09af2d79ec16577c9d44e3c *tests/data/fate/vsynth1-mpeg2-422.out.rawvideo
-stddev:   10.29 PSNR: 27.88 MAXDIFF:  168 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-idct-int b/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-idct-int
deleted file mode 100644
index dd72d71..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-idct-int
+++ /dev/null
@@ -1,4 +0,0 @@
-4c067397b504d65532d7779cd36f3f88 *tests/data/fate/vsynth1-mpeg2-idct-int.mpeg2video
-725668 tests/data/fate/vsynth1-mpeg2-idct-int.mpeg2video
-8130f71a467315c9e7bd1a25a01dbb23 *tests/data/fate/vsynth1-mpeg2-idct-int.out.rawvideo
-stddev:    7.65 PSNR: 30.45 MAXDIFF:   80 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-ilace b/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-ilace
deleted file mode 100644
index be08c31..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-ilace
+++ /dev/null
@@ -1,4 +0,0 @@
-ec3f6713c88a2b41f6c369fd64341077 *tests/data/fate/vsynth1-mpeg2-ilace.mpeg2video
-737473 tests/data/fate/vsynth1-mpeg2-ilace.mpeg2video
-97615390fdd69abfcbc7e02df863a7d2 *tests/data/fate/vsynth1-mpeg2-ilace.out.rawvideo
-stddev:    7.67 PSNR: 30.43 MAXDIFF:   84 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-ivlc-qprd b/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-ivlc-qprd
deleted file mode 100644
index 5ef30cd..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-ivlc-qprd
+++ /dev/null
@@ -1,4 +0,0 @@
-8f6b20714918e6443e0c03716ed06f0d *tests/data/fate/vsynth1-mpeg2-ivlc-qprd.mpeg2video
-783552 tests/data/fate/vsynth1-mpeg2-ivlc-qprd.mpeg2video
-98eb9da15f880978e7f2ee1e7ce476ef *tests/data/fate/vsynth1-mpeg2-ivlc-qprd.out.rawvideo
-stddev:   10.07 PSNR: 28.06 MAXDIFF:  165 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-thread b/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-thread
deleted file mode 100644
index 55a4fab..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-thread
+++ /dev/null
@@ -1,4 +0,0 @@
-ecd183706688bd977c9994c3d1b23d61 *tests/data/fate/vsynth1-mpeg2-thread.mpeg2video
-801313 tests/data/fate/vsynth1-mpeg2-thread.mpeg2video
-d1658911ca83f5616c1d32abc40750de *tests/data/fate/vsynth1-mpeg2-thread.out.rawvideo
-stddev:    7.63 PSNR: 30.48 MAXDIFF:  110 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-thread-ivlc b/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-thread-ivlc
deleted file mode 100644
index 7d04052..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg2-thread-ivlc
+++ /dev/null
@@ -1,4 +0,0 @@
-23d600b026222253c2340e23300a4c02 *tests/data/fate/vsynth1-mpeg2-thread-ivlc.mpeg2video
-791773 tests/data/fate/vsynth1-mpeg2-thread-ivlc.mpeg2video
-d1658911ca83f5616c1d32abc40750de *tests/data/fate/vsynth1-mpeg2-thread-ivlc.out.rawvideo
-stddev:    7.63 PSNR: 30.48 MAXDIFF:  110 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4 b/deps/libav/tests/ref/vsynth/vsynth1-mpeg4
deleted file mode 100644
index 38a7294..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4
+++ /dev/null
@@ -1,4 +0,0 @@
-dc927acd770e19a97456ecbd4d786938 *tests/data/fate/vsynth1-mpeg4.mp4
-540180 tests/data/fate/vsynth1-mpeg4.mp4
-8828a375448dc5c2215163ba70656f89 *tests/data/fate/vsynth1-mpeg4.out.rawvideo
-stddev:    7.97 PSNR: 30.10 MAXDIFF:  105 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-adap b/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-adap
deleted file mode 100644
index 840eb47..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-adap
+++ /dev/null
@@ -1,4 +0,0 @@
-eb70136b050f0b216febe57e7766b6a8 *tests/data/fate/vsynth1-mpeg4-adap.avi
-403444 tests/data/fate/vsynth1-mpeg4-adap.avi
-fa2049396479b5f170aa764fed5b2a31 *tests/data/fate/vsynth1-mpeg4-adap.out.rawvideo
-stddev:   14.05 PSNR: 25.17 MAXDIFF:  184 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-adv b/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-adv
deleted file mode 100644
index 8ca1f2f..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-adv
+++ /dev/null
@@ -1,4 +0,0 @@
-c67ccefff2a038c1a149eceef8b08d1e *tests/data/fate/vsynth1-mpeg4-adv.avi
-589704 tests/data/fate/vsynth1-mpeg4-adv.avi
-f8b226876b1b2c0b98fd6928fd9adbd8 *tests/data/fate/vsynth1-mpeg4-adv.out.rawvideo
-stddev:    6.98 PSNR: 31.25 MAXDIFF:   84 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-error b/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-error
deleted file mode 100644
index 9180911..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-error
+++ /dev/null
@@ -1,4 +0,0 @@
-63fdc6877c299fe94a061e276ca77bad *tests/data/fate/vsynth1-mpeg4-error.avi
-756824 tests/data/fate/vsynth1-mpeg4-error.avi
-79e94ba32b37759397362cbcb479d4d3 *tests/data/fate/vsynth1-mpeg4-error.out.rawvideo
-stddev:   18.36 PSNR: 22.85 MAXDIFF:  243 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-nr b/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-nr
deleted file mode 100644
index 28f8c6a..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-nr
+++ /dev/null
@@ -1,4 +0,0 @@
-d9eabca19ca600f18539b35a94663603 *tests/data/fate/vsynth1-mpeg4-nr.avi
-675626 tests/data/fate/vsynth1-mpeg4-nr.avi
-d2b89d5958fb7331f6c9e5b7ecaaa5b6 *tests/data/fate/vsynth1-mpeg4-nr.out.rawvideo
-stddev:    6.99 PSNR: 31.23 MAXDIFF:   86 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-qpel b/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-qpel
deleted file mode 100644
index 1ff1dce..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-qpel
+++ /dev/null
@@ -1,4 +0,0 @@
-c02be5680307d8f97a2f442d27f48f3c *tests/data/fate/vsynth1-mpeg4-qpel.avi
-860666 tests/data/fate/vsynth1-mpeg4-qpel.avi
-756928496245ecc701f79eebeec8e5e6 *tests/data/fate/vsynth1-mpeg4-qpel.out.rawvideo
-stddev:    5.63 PSNR: 33.12 MAXDIFF:   70 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-qprd b/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-qprd
deleted file mode 100644
index 0b2892d..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-qprd
+++ /dev/null
@@ -1,4 +0,0 @@
-5a95ba2c240fcb28963fe90fba4ce52b *tests/data/fate/vsynth1-mpeg4-qprd.avi
-710932 tests/data/fate/vsynth1-mpeg4-qprd.avi
-e65f4c7f343fe2bad1cac44b7da5f7c4 *tests/data/fate/vsynth1-mpeg4-qprd.out.rawvideo
-stddev:    9.79 PSNR: 28.31 MAXDIFF:  176 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-rc b/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-rc
deleted file mode 100644
index 0c2abf3..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-rc
+++ /dev/null
@@ -1,4 +0,0 @@
-49ac6ed095ea2dccf53737e6beab7ad7 *tests/data/fate/vsynth1-mpeg4-rc.avi
-830148 tests/data/fate/vsynth1-mpeg4-rc.avi
-4d95e340db9bc57a559162c039f3784e *tests/data/fate/vsynth1-mpeg4-rc.out.rawvideo
-stddev:   10.24 PSNR: 27.92 MAXDIFF:  196 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-thread b/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-thread
deleted file mode 100644
index b0bf7d8..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-mpeg4-thread
+++ /dev/null
@@ -1,4 +0,0 @@
-c081bc20f1eb048626ea783d8b08a531 *tests/data/fate/vsynth1-mpeg4-thread.avi
-774748 tests/data/fate/vsynth1-mpeg4-thread.avi
-64b96cddf5301990e118978b3a3bcd0d *tests/data/fate/vsynth1-mpeg4-thread.out.rawvideo
-stddev:   10.13 PSNR: 28.02 MAXDIFF:  183 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-msmpeg4 b/deps/libav/tests/ref/vsynth/vsynth1-msmpeg4
deleted file mode 100644
index cd1b6db..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-msmpeg4
+++ /dev/null
@@ -1,4 +0,0 @@
-c1d04df31764c0ca281dc6fe023287fb *tests/data/fate/vsynth1-msmpeg4.avi
-624706 tests/data/fate/vsynth1-msmpeg4.avi
-5ca72c39e3fc5df8e62f223c869589f5 *tests/data/fate/vsynth1-msmpeg4.out.rawvideo
-stddev:    7.98 PSNR: 30.09 MAXDIFF:  104 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-msmpeg4v2 b/deps/libav/tests/ref/vsynth/vsynth1-msmpeg4v2
deleted file mode 100644
index fb9862c..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-msmpeg4v2
+++ /dev/null
@@ -1,4 +0,0 @@
-48c76c638b43ee53bde9c58185b25e80 *tests/data/fate/vsynth1-msmpeg4v2.avi
-623776 tests/data/fate/vsynth1-msmpeg4v2.avi
-c6ff1041a0ef62c2a2e5ef519e5e94c4 *tests/data/fate/vsynth1-msmpeg4v2.out.rawvideo
-stddev:    7.97 PSNR: 30.10 MAXDIFF:  105 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-prores b/deps/libav/tests/ref/vsynth/vsynth1-prores
deleted file mode 100644
index 12aa758..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-prores
+++ /dev/null
@@ -1,4 +0,0 @@
-7dfcca40f50ff1d72541bc095c904784 *tests/data/fate/vsynth1-prores.mov
-3859037 tests/data/fate/vsynth1-prores.mov
-0a4153637d0cc0a88a8bcbf04cfaf8c6 *tests/data/fate/vsynth1-prores.out.rawvideo
-stddev:    3.17 PSNR: 38.09 MAXDIFF:   39 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-qtrle b/deps/libav/tests/ref/vsynth/vsynth1-qtrle
deleted file mode 100644
index 4ddd1d8..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-qtrle
+++ /dev/null
@@ -1,4 +0,0 @@
-24650c5b226d054c57be7c06c9220058 *tests/data/fate/vsynth1-qtrle.mov
-15263232 tests/data/fate/vsynth1-qtrle.mov
-243325fb2cae1a9245efd49aff936327 *tests/data/fate/vsynth1-qtrle.out.rawvideo
-stddev:    3.42 PSNR: 37.43 MAXDIFF:   48 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-rgb b/deps/libav/tests/ref/vsynth/vsynth1-rgb
deleted file mode 100644
index f72b737..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-rgb
+++ /dev/null
@@ -1,4 +0,0 @@
-d78bcd5828862c3342388ec8a2c34fef *tests/data/fate/vsynth1-rgb.avi
-15213248 tests/data/fate/vsynth1-rgb.avi
-243325fb2cae1a9245efd49aff936327 *tests/data/fate/vsynth1-rgb.out.rawvideo
-stddev:    3.42 PSNR: 37.43 MAXDIFF:   48 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-roqvideo b/deps/libav/tests/ref/vsynth/vsynth1-roqvideo
deleted file mode 100644
index 5adba69..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-roqvideo
+++ /dev/null
@@ -1,4 +0,0 @@
-cf8b7b0e539bab3169c234ca63d71dd8 *tests/data/fate/vsynth1-roqvideo.roq
-101671 tests/data/fate/vsynth1-roqvideo.roq
-0ad983c291b1ed373645c5b12a108c61 *tests/data/fate/vsynth1-roqvideo.out.rawvideo
-stddev:    7.74 PSNR: 30.35 MAXDIFF:   89 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-rv10 b/deps/libav/tests/ref/vsynth/vsynth1-rv10
deleted file mode 100644
index 234015f..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-rv10
+++ /dev/null
@@ -1,4 +0,0 @@
-4d7e82de72a83905cf84b8abc3e70b8f *tests/data/fate/vsynth1-rv10.rm
-653905 tests/data/fate/vsynth1-rv10.rm
-1a1ba9a3a63ec1a1a9585fded0a7c954 *tests/data/fate/vsynth1-rv10.out.rawvideo
-stddev:    8.03 PSNR: 30.03 MAXDIFF:  103 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-rv20 b/deps/libav/tests/ref/vsynth/vsynth1-rv20
deleted file mode 100644
index abcc4a1..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-rv20
+++ /dev/null
@@ -1,4 +0,0 @@
-81868601e602eee5b6d80f5ece4aaa98 *tests/data/fate/vsynth1-rv20.rm
-646016 tests/data/fate/vsynth1-rv20.rm
-b45fdb0201b06f7649f44050e262c54c *tests/data/fate/vsynth1-rv20.out.rawvideo
-stddev:    8.26 PSNR: 29.79 MAXDIFF:  103 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-svq1 b/deps/libav/tests/ref/vsynth/vsynth1-svq1
deleted file mode 100644
index f610fdc..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-svq1
+++ /dev/null
@@ -1,4 +0,0 @@
-3c90c6c0c4db7993660cee642de05bb4 *tests/data/fate/vsynth1-svq1.mov
-1334367 tests/data/fate/vsynth1-svq1.mov
-9cc35c54b2c77d36bd7e308b393c1f81 *tests/data/fate/vsynth1-svq1.out.rawvideo
-stddev:    9.58 PSNR: 28.50 MAXDIFF:  210 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-v210 b/deps/libav/tests/ref/vsynth/vsynth1-v210
deleted file mode 100644
index defd2f6..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-v210
+++ /dev/null
@@ -1,4 +0,0 @@
-054d7e903fb4d9e68700c56b93d45916 *tests/data/fate/vsynth1-v210.avi
-14752448 tests/data/fate/vsynth1-v210.avi
-50973792d3f1abe04a51ee0121f077f2 *tests/data/fate/vsynth1-v210.out.rawvideo
-stddev:    1.85 PSNR: 42.78 MAXDIFF:   29 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-wmv1 b/deps/libav/tests/ref/vsynth/vsynth1-wmv1
deleted file mode 100644
index 78bd0f0..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-wmv1
+++ /dev/null
@@ -1,4 +0,0 @@
-5f896b2c7d6a0906f5252a5088fbc64a *tests/data/fate/vsynth1-wmv1.avi
-626896 tests/data/fate/vsynth1-wmv1.avi
-5182edba5b5e0354b39ce4f3604b62da *tests/data/fate/vsynth1-wmv1.out.rawvideo
-stddev:    7.97 PSNR: 30.09 MAXDIFF:  110 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-wmv2 b/deps/libav/tests/ref/vsynth/vsynth1-wmv2
deleted file mode 100644
index 6a3cd3b..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-wmv2
+++ /dev/null
@@ -1,4 +0,0 @@
-3c8a93fa645574f5b11eb51cf0efd227 *tests/data/fate/vsynth1-wmv2.avi
-659162 tests/data/fate/vsynth1-wmv2.avi
-2d61f24836d54766e8d370f243d83dcd *tests/data/fate/vsynth1-wmv2.out.rawvideo
-stddev:    7.97 PSNR: 30.09 MAXDIFF:  105 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth1-yuv b/deps/libav/tests/ref/vsynth/vsynth1-yuv
deleted file mode 100644
index 3db5ab0..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth1-yuv
+++ /dev/null
@@ -1,4 +0,0 @@
-a9c708ba20f5c562fb1c89f6aa841c8c *tests/data/fate/vsynth1-yuv.avi
-7610048 tests/data/fate/vsynth1-yuv.avi
-c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-yuv.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-asv1 b/deps/libav/tests/ref/vsynth/vsynth2-asv1
deleted file mode 100644
index 282435b..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-asv1
+++ /dev/null
@@ -1,4 +0,0 @@
-ae8d79e0e421138a9a67a148a42c26c5 *tests/data/fate/vsynth2-asv1.avi
-832500 tests/data/fate/vsynth2-asv1.avi
-c96ff7fd17c52f99ddb7922a4cb9168f *tests/data/fate/vsynth2-asv1.out.rawvideo
-stddev:   10.47 PSNR: 27.73 MAXDIFF:   98 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-asv2 b/deps/libav/tests/ref/vsynth/vsynth2-asv2
deleted file mode 100644
index 8942862..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-asv2
+++ /dev/null
@@ -1,4 +0,0 @@
-ccf6762758395eee9a29ef7a4ef3cd58 *tests/data/fate/vsynth2-asv2.avi
-789060 tests/data/fate/vsynth2-asv2.avi
-74a78015b64b2cf8cb9da2e44f508a69 *tests/data/fate/vsynth2-asv2.out.rawvideo
-stddev:   10.28 PSNR: 27.89 MAXDIFF:   95 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-cljr b/deps/libav/tests/ref/vsynth/vsynth2-cljr
deleted file mode 100644
index 39c74c3..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-cljr
+++ /dev/null
@@ -1,4 +0,0 @@
-5745ff1d80a6f454ae448dcf0bce50e0 *tests/data/fate/vsynth2-cljr.avi
-5075648 tests/data/fate/vsynth2-cljr.avi
-cfe7802bf34aafed7df5dcaa5126ef23 *tests/data/fate/vsynth2-cljr.out.rawvideo
-stddev:    3.69 PSNR: 36.78 MAXDIFF:   22 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-1080i b/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-1080i
deleted file mode 100644
index 35db6d2..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-1080i
+++ /dev/null
@@ -1,4 +0,0 @@
-c456f2a7ac9435ea5bfea86bc69c1c41 *tests/data/fate/vsynth2-dnxhd-1080i.mov
-3031875 tests/data/fate/vsynth2-dnxhd-1080i.mov
-42262a2325441b38b3b3c8a42d888e7d *tests/data/fate/vsynth2-dnxhd-1080i.out.rawvideo
-stddev:    1.31 PSNR: 45.77 MAXDIFF:   23 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-720p b/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-720p
deleted file mode 100644
index afc6fde..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-720p
+++ /dev/null
@@ -1,4 +0,0 @@
-58e07cc6ae0a2d36787044d0e82708a6 *tests/data/fate/vsynth2-dnxhd-720p.dnxhd
-2293760 tests/data/fate/vsynth2-dnxhd-720p.dnxhd
-ab601eaafef74d80d3d20b780dddd836 *tests/data/fate/vsynth2-dnxhd-720p.out.rawvideo
-stddev:    1.36 PSNR: 45.45 MAXDIFF:  127 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-720p-10bit b/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-720p-10bit
deleted file mode 100644
index f087c13..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-720p-10bit
+++ /dev/null
@@ -1,4 +0,0 @@
-4b57da2c0c1280469ff3579f7151c227 *tests/data/fate/vsynth2-dnxhd-720p-10bit.dnxhd
-2293760 tests/data/fate/vsynth2-dnxhd-720p-10bit.dnxhd
-31a6aa8b8702e85fa3b48e73f035c4e4 *tests/data/fate/vsynth2-dnxhd-720p-10bit.out.rawvideo
-stddev:    1.35 PSNR: 45.46 MAXDIFF:   23 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-720p-rd b/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-720p-rd
deleted file mode 100644
index c1b8f96..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-dnxhd-720p-rd
+++ /dev/null
@@ -1,4 +0,0 @@
-092ffb7b8cf3c11556bb05dbb8b476ac *tests/data/fate/vsynth2-dnxhd-720p-rd.dnxhd
-2293760 tests/data/fate/vsynth2-dnxhd-720p-rd.dnxhd
-33547ca318acff9448cba719cb99296d *tests/data/fate/vsynth2-dnxhd-720p-rd.out.rawvideo
-stddev:    1.32 PSNR: 45.66 MAXDIFF:   22 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-dv b/deps/libav/tests/ref/vsynth/vsynth2-dv
deleted file mode 100644
index 2aac5ff..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-dv
+++ /dev/null
@@ -1,4 +0,0 @@
-bfa766f89bfeabc0ae1044f3954bed52 *tests/data/fate/vsynth2-dv.dv
-7200000 tests/data/fate/vsynth2-dv.dv
-7ec62bd3350a6848364669e6e1e4b9cc *tests/data/fate/vsynth2-dv.out.rawvideo
-stddev:    1.71 PSNR: 43.47 MAXDIFF:   33 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-dv-411 b/deps/libav/tests/ref/vsynth/vsynth2-dv-411
deleted file mode 100644
index 00ecace..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-dv-411
+++ /dev/null
@@ -1,4 +0,0 @@
-00a9d8683ac6826af41bcf7223fb0389 *tests/data/fate/vsynth2-dv-411.dv
-7200000 tests/data/fate/vsynth2-dv-411.dv
-3cd4b85065d67bfb7fbab3bea4039711 *tests/data/fate/vsynth2-dv-411.out.rawvideo
-stddev:    2.89 PSNR: 38.91 MAXDIFF:   45 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-dv-50 b/deps/libav/tests/ref/vsynth/vsynth2-dv-50
deleted file mode 100644
index e7e5dc1..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-dv-50
+++ /dev/null
@@ -1,4 +0,0 @@
-61e31c79e8949b25c849753a0785b0d7 *tests/data/fate/vsynth2-dv-50.dv
-14400000 tests/data/fate/vsynth2-dv-50.dv
-af3f2dd5ab62c1a1d98b07d4aeb6852f *tests/data/fate/vsynth2-dv-50.out.rawvideo
-stddev:    0.82 PSNR: 49.82 MAXDIFF:   12 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-ffv1 b/deps/libav/tests/ref/vsynth/vsynth2-ffv1
deleted file mode 100644
index 8263b01..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-ffv1
+++ /dev/null
@@ -1,4 +0,0 @@
-9d8486fc8a260204d8ee3212d95915b5 *tests/data/fate/vsynth2-ffv1.avi
-3546258 tests/data/fate/vsynth2-ffv1.avi
-dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth2-ffv1.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-ffvhuff b/deps/libav/tests/ref/vsynth/vsynth2-ffvhuff
deleted file mode 100644
index 8daed2b..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-ffvhuff
+++ /dev/null
@@ -1,4 +0,0 @@
-f6a213ef136012a3d189d09468d80dd3 *tests/data/fate/vsynth2-ffvhuff.avi
-4988044 tests/data/fate/vsynth2-ffvhuff.avi
-dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth2-ffvhuff.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-flashsv b/deps/libav/tests/ref/vsynth/vsynth2-flashsv
deleted file mode 100644
index cbe79e6..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-flashsv
+++ /dev/null
@@ -1,4 +0,0 @@
-0667077971e0cb63b5f49c580006e90e *tests/data/fate/vsynth2-flashsv.flv
-12368953 tests/data/fate/vsynth2-flashsv.flv
-592b3321994e26a990deb3a0a1415de9 *tests/data/fate/vsynth2-flashsv.out.rawvideo
-stddev:    0.65 PSNR: 51.84 MAXDIFF:   14 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-flv b/deps/libav/tests/ref/vsynth/vsynth2-flv
deleted file mode 100644
index 6864a1b..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-flv
+++ /dev/null
@@ -1,4 +0,0 @@
-2edc92093d36506bcc0a5c0e17e86113 *tests/data/fate/vsynth2-flv.flv
-131360 tests/data/fate/vsynth2-flv.flv
-8999c8264fb0941561f64c4a736e9d88 *tests/data/fate/vsynth2-flv.out.rawvideo
-stddev:    5.33 PSNR: 33.59 MAXDIFF:   80 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-h261 b/deps/libav/tests/ref/vsynth/vsynth2-h261
deleted file mode 100644
index 71ea191..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-h261
+++ /dev/null
@@ -1,4 +0,0 @@
-921e06dffd04667d336449c7cd1c6589 *tests/data/fate/vsynth2-h261.avi
-191074 tests/data/fate/vsynth2-h261.avi
-db7ceff174823b98834faa2320ca89ac *tests/data/fate/vsynth2-h261.out.rawvideo
-stddev:    6.37 PSNR: 32.03 MAXDIFF:   77 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-h263 b/deps/libav/tests/ref/vsynth/vsynth2-h263
deleted file mode 100644
index b2ce370..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-h263
+++ /dev/null
@@ -1,4 +0,0 @@
-329c0318b8727d66946ec729c6e960fc *tests/data/fate/vsynth2-h263.avi
-160094 tests/data/fate/vsynth2-h263.avi
-61213b91b359697ebcefb9e0a53ac54a *tests/data/fate/vsynth2-h263.out.rawvideo
-stddev:    5.43 PSNR: 33.42 MAXDIFF:   77 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-h263-obmc b/deps/libav/tests/ref/vsynth/vsynth2-h263-obmc
deleted file mode 100644
index 67fd2fd..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-h263-obmc
+++ /dev/null
@@ -1,4 +0,0 @@
-3abbe86e18ef9d407cc3817dd31ebeba *tests/data/fate/vsynth2-h263-obmc.avi
-154716 tests/data/fate/vsynth2-h263-obmc.avi
-6f326547cf1cbd95a8c0a5ddce9eb71a *tests/data/fate/vsynth2-h263-obmc.out.rawvideo
-stddev:    5.39 PSNR: 33.49 MAXDIFF:   82 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-h263p b/deps/libav/tests/ref/vsynth/vsynth2-h263p
deleted file mode 100644
index 826dcd1..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-h263p
+++ /dev/null
@@ -1,4 +0,0 @@
-865ca965ab4fdfe225db7de3d23b4ad8 *tests/data/fate/vsynth2-h263p.avi
-868006 tests/data/fate/vsynth2-h263p.avi
-4b0ee791f280029dc03c528f76f195d4 *tests/data/fate/vsynth2-h263p.out.rawvideo
-stddev:    1.91 PSNR: 42.50 MAXDIFF:   19 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-huffyuv b/deps/libav/tests/ref/vsynth/vsynth2-huffyuv
deleted file mode 100644
index 7d062dd..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-huffyuv
+++ /dev/null
@@ -1,4 +0,0 @@
-30d509aca4a7298cf7667581a5e37671 *tests/data/fate/vsynth2-huffyuv.avi
-6455220 tests/data/fate/vsynth2-huffyuv.avi
-dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth2-huffyuv.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-jpegls b/deps/libav/tests/ref/vsynth/vsynth2-jpegls
deleted file mode 100644
index 75ad403..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-jpegls
+++ /dev/null
@@ -1,4 +0,0 @@
-f34315ed0e30cf4d94dd21ff1d4cea1b *tests/data/fate/vsynth2-jpegls.avi
-8334618 tests/data/fate/vsynth2-jpegls.avi
-592b3321994e26a990deb3a0a1415de9 *tests/data/fate/vsynth2-jpegls.out.rawvideo
-stddev:    0.65 PSNR: 51.84 MAXDIFF:   14 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-ljpeg b/deps/libav/tests/ref/vsynth/vsynth2-ljpeg
deleted file mode 100644
index a7b8a2d..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-ljpeg
+++ /dev/null
@@ -1,4 +0,0 @@
-5d603cecd59db0f255a53bda837a6bae *tests/data/fate/vsynth2-ljpeg.avi
-4766902 tests/data/fate/vsynth2-ljpeg.avi
-dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth2-ljpeg.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mjpeg b/deps/libav/tests/ref/vsynth/vsynth2-mjpeg
deleted file mode 100644
index 981d01b..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mjpeg
+++ /dev/null
@@ -1,4 +0,0 @@
-ba05f4fad7f34a96c77964e8cdf9d5c0 *tests/data/fate/vsynth2-mjpeg.avi
-673212 tests/data/fate/vsynth2-mjpeg.avi
-a96a4e15ffcb13e44360df642d049496 *tests/data/fate/vsynth2-mjpeg.out.rawvideo
-stddev:    4.32 PSNR: 35.40 MAXDIFF:   49 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg1 b/deps/libav/tests/ref/vsynth/vsynth2-mpeg1
deleted file mode 100644
index a975973..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg1
+++ /dev/null
@@ -1,4 +0,0 @@
-73ca6f1deab02d1d67a0e8495c026a9e *tests/data/fate/vsynth2-mpeg1.mpeg1video
-192783 tests/data/fate/vsynth2-mpeg1.mpeg1video
-56147e94b12f08df7213e610e177823d *tests/data/fate/vsynth2-mpeg1.out.rawvideo
-stddev:    4.95 PSNR: 34.22 MAXDIFF:   57 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg1b b/deps/libav/tests/ref/vsynth/vsynth2-mpeg1b
deleted file mode 100644
index 4b92ac5..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg1b
+++ /dev/null
@@ -1,4 +0,0 @@
-e026a2fef80c9679776d2b5c8be09338 *tests/data/fate/vsynth2-mpeg1b.mpeg1video
-225198 tests/data/fate/vsynth2-mpeg1b.mpeg1video
-1150495f4bd487486ee53326c42d0bb8 *tests/data/fate/vsynth2-mpeg1b.out.rawvideo
-stddev:    4.10 PSNR: 35.86 MAXDIFF:   59 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2 b/deps/libav/tests/ref/vsynth/vsynth2-mpeg2
deleted file mode 100644
index a2a2ca6..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2
+++ /dev/null
@@ -1,4 +0,0 @@
-2d55ce623a7be4e8136f80266e487678 *tests/data/fate/vsynth2-mpeg2.mpeg2video
-198667 tests/data/fate/vsynth2-mpeg2.mpeg2video
-b7cae8a1f751b821cddcbe4d5dbc518c *tests/data/fate/vsynth2-mpeg2.out.rawvideo
-stddev:    4.96 PSNR: 34.20 MAXDIFF:   59 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-422 b/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-422
deleted file mode 100644
index 2405cf0..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-422
+++ /dev/null
@@ -1,4 +0,0 @@
-2c8e33c2d2efab86fc16a195f6877682 *tests/data/fate/vsynth2-mpeg2-422.mpeg2video
-356124 tests/data/fate/vsynth2-mpeg2-422.mpeg2video
-df6e54e2d8a4feb8382029286857ca6d *tests/data/fate/vsynth2-mpeg2-422.out.rawvideo
-stddev:    3.16 PSNR: 38.13 MAXDIFF:   49 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-idct-int b/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-idct-int
deleted file mode 100644
index 83874b1..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-idct-int
+++ /dev/null
@@ -1,4 +0,0 @@
-f979bcca866e6e4cad5dc6cb06e56cfb *tests/data/fate/vsynth2-mpeg2-idct-int.mpeg2video
-198041 tests/data/fate/vsynth2-mpeg2-idct-int.mpeg2video
-92794e70e4a19a494f10efe353d9895d *tests/data/fate/vsynth2-mpeg2-idct-int.out.rawvideo
-stddev:    4.97 PSNR: 34.19 MAXDIFF:   58 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-ilace b/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-ilace
deleted file mode 100644
index e488bc5..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-ilace
+++ /dev/null
@@ -1,4 +0,0 @@
-f90197a8b6e62ae25f82625337f27240 *tests/data/fate/vsynth2-mpeg2-ilace.mpeg2video
-204579 tests/data/fate/vsynth2-mpeg2-ilace.mpeg2video
-ea5057b60146c06d40449cdfc686bf13 *tests/data/fate/vsynth2-mpeg2-ilace.out.rawvideo
-stddev:    4.98 PSNR: 34.18 MAXDIFF:   65 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-ivlc-qprd b/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-ivlc-qprd
deleted file mode 100644
index 30e129b..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-ivlc-qprd
+++ /dev/null
@@ -1,4 +0,0 @@
-1ba5efeb53fab7b4b71edc96d86f6c91 *tests/data/fate/vsynth2-mpeg2-ivlc-qprd.mpeg2video
-244694 tests/data/fate/vsynth2-mpeg2-ivlc-qprd.mpeg2video
-b26e21599dee48a174bdbc40b2817e55 *tests/data/fate/vsynth2-mpeg2-ivlc-qprd.out.rawvideo
-stddev:    4.15 PSNR: 35.76 MAXDIFF:   74 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-thread b/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-thread
deleted file mode 100644
index f43cdbc..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-thread
+++ /dev/null
@@ -1,4 +0,0 @@
-889c754a42d7689b228853e1ece6d345 *tests/data/fate/vsynth2-mpeg2-thread.mpeg2video
-179650 tests/data/fate/vsynth2-mpeg2-thread.mpeg2video
-8c6a7ed2eb73bd18fd2bb9829464100d *tests/data/fate/vsynth2-mpeg2-thread.out.rawvideo
-stddev:    4.72 PSNR: 34.65 MAXDIFF:   72 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-thread-ivlc b/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-thread-ivlc
deleted file mode 100644
index 2c42a21..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg2-thread-ivlc
+++ /dev/null
@@ -1,4 +0,0 @@
-10b900e32809758857c596d56746e00e *tests/data/fate/vsynth2-mpeg2-thread-ivlc.mpeg2video
-178801 tests/data/fate/vsynth2-mpeg2-thread-ivlc.mpeg2video
-8c6a7ed2eb73bd18fd2bb9829464100d *tests/data/fate/vsynth2-mpeg2-thread-ivlc.out.rawvideo
-stddev:    4.72 PSNR: 34.65 MAXDIFF:   72 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4 b/deps/libav/tests/ref/vsynth/vsynth2-mpeg4
deleted file mode 100644
index a654c13..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4
+++ /dev/null
@@ -1,4 +0,0 @@
-0282105e98166fac06f7ba9e857cfbfe *tests/data/fate/vsynth2-mpeg4.mp4
-119833 tests/data/fate/vsynth2-mpeg4.mp4
-90a3577850239083a9042bef33c50e85 *tests/data/fate/vsynth2-mpeg4.out.rawvideo
-stddev:    5.34 PSNR: 33.57 MAXDIFF:   83 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-adap b/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-adap
deleted file mode 100644
index fb4c206..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-adap
+++ /dev/null
@@ -1,4 +0,0 @@
-76c8962b06b7a0d748bd7eb3f6fc0e18 *tests/data/fate/vsynth2-mpeg4-adap.avi
-198498 tests/data/fate/vsynth2-mpeg4-adap.avi
-4affb83f6adc94f31024b4f9e0168945 *tests/data/fate/vsynth2-mpeg4-adap.out.rawvideo
-stddev:    3.75 PSNR: 36.65 MAXDIFF:   71 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-adv b/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-adv
deleted file mode 100644
index b3bf264..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-adv
+++ /dev/null
@@ -1,4 +0,0 @@
-1875ae5a45936c08778c4430a22e87eb *tests/data/fate/vsynth2-mpeg4-adv.avi
-141534 tests/data/fate/vsynth2-mpeg4-adv.avi
-3f3a21e9db85a9c0f7022f557a5374c1 *tests/data/fate/vsynth2-mpeg4-adv.out.rawvideo
-stddev:    4.94 PSNR: 34.25 MAXDIFF:   69 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-error b/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-error
deleted file mode 100644
index 35dd03d..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-error
+++ /dev/null
@@ -1,4 +0,0 @@
-d3025e5f784efeb2ab9b84f8924eda19 *tests/data/fate/vsynth2-mpeg4-error.avi
-176576 tests/data/fate/vsynth2-mpeg4-error.avi
-96baa9e4c24c837a3ba5abd8dd2cdd30 *tests/data/fate/vsynth2-mpeg4-error.out.rawvideo
-stddev:    8.98 PSNR: 29.06 MAXDIFF:  184 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-nr b/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-nr
deleted file mode 100644
index 7fdce67..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-nr
+++ /dev/null
@@ -1,4 +0,0 @@
-75725f3c2a08efa145a2692a20373a21 *tests/data/fate/vsynth2-mpeg4-nr.avi
-155032 tests/data/fate/vsynth2-mpeg4-nr.avi
-f7fc191308679f709405e62271f5c65f *tests/data/fate/vsynth2-mpeg4-nr.out.rawvideo
-stddev:    4.73 PSNR: 34.63 MAXDIFF:   64 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-qpel b/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-qpel
deleted file mode 100644
index cab264a..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-qpel
+++ /dev/null
@@ -1,4 +0,0 @@
-c45101c6c3b681f5d420a938c0689a37 *tests/data/fate/vsynth2-mpeg4-qpel.avi
-163676 tests/data/fate/vsynth2-mpeg4-qpel.avi
-26dc7c78955fa678fbf150e236eb5627 *tests/data/fate/vsynth2-mpeg4-qpel.out.rawvideo
-stddev:    3.97 PSNR: 36.14 MAXDIFF:   54 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-qprd b/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-qprd
deleted file mode 100644
index 1779dd7..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-qprd
+++ /dev/null
@@ -1,4 +0,0 @@
-81afd85c3ab00b685588e1b61cc3e4b3 *tests/data/fate/vsynth2-mpeg4-qprd.avi
-231446 tests/data/fate/vsynth2-mpeg4-qprd.avi
-de8a883865e2dff7a51f66da6c48df48 *tests/data/fate/vsynth2-mpeg4-qprd.out.rawvideo
-stddev:    3.71 PSNR: 36.72 MAXDIFF:   61 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-rc b/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-rc
deleted file mode 100644
index 74e7962..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-rc
+++ /dev/null
@@ -1,4 +0,0 @@
-e3621649079539ec118e8581c54bc2ef *tests/data/fate/vsynth2-mpeg4-rc.avi
-226320 tests/data/fate/vsynth2-mpeg4-rc.avi
-2b34e606af895b62a250de98749a19b0 *tests/data/fate/vsynth2-mpeg4-rc.out.rawvideo
-stddev:    4.23 PSNR: 35.60 MAXDIFF:   85 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-thread b/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-thread
deleted file mode 100644
index 61478a0..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-mpeg4-thread
+++ /dev/null
@@ -1,4 +0,0 @@
-69b716c9f99c5acb86a744521c32cf72 *tests/data/fate/vsynth2-mpeg4-thread.avi
-250128 tests/data/fate/vsynth2-mpeg4-thread.avi
-5355deb8c7609a3f1ff2173aab1dee70 *tests/data/fate/vsynth2-mpeg4-thread.out.rawvideo
-stddev:    3.69 PSNR: 36.78 MAXDIFF:   65 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-msmpeg4 b/deps/libav/tests/ref/vsynth/vsynth2-msmpeg4
deleted file mode 100644
index a7cc94e..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-msmpeg4
+++ /dev/null
@@ -1,4 +0,0 @@
-f602d25096c83f166bdab01fa07a34c1 *tests/data/fate/vsynth2-msmpeg4.avi
-127668 tests/data/fate/vsynth2-msmpeg4.avi
-0e1c6e25c71c6a8fa8e506e3d97ca4c9 *tests/data/fate/vsynth2-msmpeg4.out.rawvideo
-stddev:    5.33 PSNR: 33.59 MAXDIFF:   78 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-msmpeg4v2 b/deps/libav/tests/ref/vsynth/vsynth2-msmpeg4v2
deleted file mode 100644
index 542dfe5..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-msmpeg4v2
+++ /dev/null
@@ -1,4 +0,0 @@
-43d6ca9b63993b4603d4f08fa6aaeab3 *tests/data/fate/vsynth2-msmpeg4v2.avi
-129906 tests/data/fate/vsynth2-msmpeg4v2.avi
-8920194f8bf8f9cdd6c65b3df9e1a292 *tests/data/fate/vsynth2-msmpeg4v2.out.rawvideo
-stddev:    5.33 PSNR: 33.59 MAXDIFF:   80 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-prores b/deps/libav/tests/ref/vsynth/vsynth2-prores
deleted file mode 100644
index 9d56b95..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-prores
+++ /dev/null
@@ -1,4 +0,0 @@
-7d167fee27e8c34968bbecec282f927a *tests/data/fate/vsynth2-prores.mov
-3884722 tests/data/fate/vsynth2-prores.mov
-ca2f6c1162635dedfa468c90f1fdc0ef *tests/data/fate/vsynth2-prores.out.rawvideo
-stddev:    0.92 PSNR: 48.77 MAXDIFF:   10 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-qtrle b/deps/libav/tests/ref/vsynth/vsynth2-qtrle
deleted file mode 100644
index ac2b557..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-qtrle
+++ /dev/null
@@ -1,4 +0,0 @@
-fe3db3dd385b8e5dc43cccc17b50f7f0 *tests/data/fate/vsynth2-qtrle.mov
-14798419 tests/data/fate/vsynth2-qtrle.mov
-b2418e0e3a9a8619b31219cbcf24dc82 *tests/data/fate/vsynth2-qtrle.out.rawvideo
-stddev:    1.26 PSNR: 46.06 MAXDIFF:   13 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-rgb b/deps/libav/tests/ref/vsynth/vsynth2-rgb
deleted file mode 100644
index 5c9a98e..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-rgb
+++ /dev/null
@@ -1,4 +0,0 @@
-01199075994e44f282fbb6a8e3ccc668 *tests/data/fate/vsynth2-rgb.avi
-15213248 tests/data/fate/vsynth2-rgb.avi
-b2418e0e3a9a8619b31219cbcf24dc82 *tests/data/fate/vsynth2-rgb.out.rawvideo
-stddev:    1.26 PSNR: 46.06 MAXDIFF:   13 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-roqvideo b/deps/libav/tests/ref/vsynth/vsynth2-roqvideo
deleted file mode 100644
index d4c075a..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-roqvideo
+++ /dev/null
@@ -1,4 +0,0 @@
-b46f899b2363065c60f3782ba1f8b7bd *tests/data/fate/vsynth2-roqvideo.roq
-92786 tests/data/fate/vsynth2-roqvideo.roq
-e69fca960dd0911e9b8d589c13e11dc1 *tests/data/fate/vsynth2-roqvideo.out.rawvideo
-stddev:    3.81 PSNR: 36.49 MAXDIFF:   54 bytes:  7603200/   760320
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-rv10 b/deps/libav/tests/ref/vsynth/vsynth2-rv10
deleted file mode 100644
index 7afe4fc..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-rv10
+++ /dev/null
@@ -1,4 +0,0 @@
-b1467b0e8d8cad730e36d1e8ab49d573 *tests/data/fate/vsynth2-rv10.rm
-154310 tests/data/fate/vsynth2-rv10.rm
-61213b91b359697ebcefb9e0a53ac54a *tests/data/fate/vsynth2-rv10.out.rawvideo
-stddev:    5.43 PSNR: 33.42 MAXDIFF:   77 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-rv20 b/deps/libav/tests/ref/vsynth/vsynth2-rv20
deleted file mode 100644
index a3440fa..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-rv20
+++ /dev/null
@@ -1,4 +0,0 @@
-96acb098850b9bf309f89e48b08fe96f *tests/data/fate/vsynth2-rv20.rm
-153302 tests/data/fate/vsynth2-rv20.rm
-46f314e70d9bac2e7d82cfc230534977 *tests/data/fate/vsynth2-rv20.out.rawvideo
-stddev:    5.48 PSNR: 33.35 MAXDIFF:   81 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-svq1 b/deps/libav/tests/ref/vsynth/vsynth2-svq1
deleted file mode 100644
index e2af545..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-svq1
+++ /dev/null
@@ -1,4 +0,0 @@
-c15de1e0b0439981dc94b927b1933889 *tests/data/fate/vsynth2-svq1.mov
-766851 tests/data/fate/vsynth2-svq1.mov
-aa03471dac3f49455a33a2b19fda1098 *tests/data/fate/vsynth2-svq1.out.rawvideo
-stddev:    3.23 PSNR: 37.93 MAXDIFF:   61 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-v210 b/deps/libav/tests/ref/vsynth/vsynth2-v210
deleted file mode 100644
index eb80b34..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-v210
+++ /dev/null
@@ -1,4 +0,0 @@
-ddc80f41b9e92c26adbe09567a4c7a1d *tests/data/fate/vsynth2-v210.avi
-14752448 tests/data/fate/vsynth2-v210.avi
-a627fb50c8276200fd71383977d87ca3 *tests/data/fate/vsynth2-v210.out.rawvideo
-stddev:    0.34 PSNR: 57.43 MAXDIFF:    6 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-wmv1 b/deps/libav/tests/ref/vsynth/vsynth2-wmv1
deleted file mode 100644
index 188b518..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-wmv1
+++ /dev/null
@@ -1,4 +0,0 @@
-73f3b72208ed1e61be60f1412dbf35e2 *tests/data/fate/vsynth2-wmv1.avi
-129518 tests/data/fate/vsynth2-wmv1.avi
-81eee429b665254d19a06607463c0b5e *tests/data/fate/vsynth2-wmv1.out.rawvideo
-stddev:    5.33 PSNR: 33.60 MAXDIFF:   77 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-wmv2 b/deps/libav/tests/ref/vsynth/vsynth2-wmv2
deleted file mode 100644
index 25c0dee..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-wmv2
+++ /dev/null
@@ -1,4 +0,0 @@
-c7db61ce6fc07e8fb9a7204992c2e4c4 *tests/data/fate/vsynth2-wmv2.avi
-129848 tests/data/fate/vsynth2-wmv2.avi
-288bdf1b411b814a067ceb00ac6b9d16 *tests/data/fate/vsynth2-wmv2.out.rawvideo
-stddev:    5.33 PSNR: 33.59 MAXDIFF:   77 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/ref/vsynth/vsynth2-yuv b/deps/libav/tests/ref/vsynth/vsynth2-yuv
deleted file mode 100644
index d79e986..0000000
--- a/deps/libav/tests/ref/vsynth/vsynth2-yuv
+++ /dev/null
@@ -1,4 +0,0 @@
-d08219372af7a764c1afbc99a1002fe0 *tests/data/fate/vsynth2-yuv.avi
-7610048 tests/data/fate/vsynth2-yuv.avi
-dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth2-yuv.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/deps/libav/tests/regression-funcs.sh b/deps/libav/tests/regression-funcs.sh
deleted file mode 100755
index ce5aee8..0000000
--- a/deps/libav/tests/regression-funcs.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-#
-# common regression functions for avconv
-#
-#
-
-test="${1#regtest-}"
-test_ref=$2
-raw_src_dir=$3
-target_exec=$4
-target_path=$5
-threads=${6:-1}
-cpuflags=${8:-all}
-
-datadir="./tests/data"
-target_datadir="${target_path}/${datadir}"
-
-this="$test.$test_ref"
-outfile="$datadir/$test_ref/"
-
-# various files
-avconv="$target_exec ${target_path}/avconv"
-raw_src="${target_path}/$raw_src_dir/%02d.pgm"
-raw_dst="$datadir/$this.out.yuv"
-pcm_src="$target_datadir/asynth1.sw"
-crcfile="$datadir/$this.crc"
-target_crcfile="$target_datadir/$this.crc"
-
-cleanfiles="$raw_dst $crcfile"
-trap 'rm -f -- $cleanfiles' EXIT
-
-mkdir -p "$datadir"
-mkdir -p "$outfile"
-
-[ "${V-0}" -gt 0 ] && echov=echov || echov=:
-
-echov(){
-    echo "$@" >&3
-}
-
-. $(dirname $0)/md5.sh
-
-AVCONV_OPTS="-nostats -y -cpuflags $cpuflags"
-COMMON_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact"
-DEC_OPTS="$COMMON_OPTS -threads $threads"
-ENC_OPTS="$COMMON_OPTS -threads 1 -dct fastint"
-
-run_avconv()
-{
-    $echov $avconv $AVCONV_OPTS $*
-    $avconv $AVCONV_OPTS $*
-}
-
-do_avconv()
-{
-    f="$1"
-    shift
-    set -- $* ${target_path}/$f
-    run_avconv $*
-    do_md5sum $f
-    echo $(wc -c $f)
-}
-
-do_avconv_crc()
-{
-    f="$1"
-    shift
-    run_avconv $* -f crc "$target_crcfile"
-    echo "$f $(cat $crcfile)"
-}
diff --git a/deps/libav/tests/rotozoom.c b/deps/libav/tests/rotozoom.c
deleted file mode 100644
index 69c88c2..0000000
--- a/deps/libav/tests/rotozoom.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Generate a synthetic YUV video sequence suitable for codec testing.
- *
- * copyright (c) Sebastien Bechet <s.bechet at av7.net>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <inttypes.h>
-
-#include "utils.c"
-
-#define FIXP (1 << 16)
-#define MY_PI 205887 // (M_PI * FIX)
-
-static int64_t int_pow(int64_t a, int p)
-{
-    int64_t v = FIXP;
-
-    for (; p; p--) {
-        v *= a;
-        v /= FIXP;
-    }
-
-    return v;
-}
-
-static int64_t int_sin(int64_t a)
-{
-    if (a < 0)
-        a = MY_PI - a;  // 0..inf
-    a %= 2 * MY_PI;     // 0..2PI
-
-    if (a >= MY_PI * 3 / 2)
-        a -= 2 * MY_PI; // -PI / 2 .. 3PI / 2
-    if (a >= MY_PI / 2)
-        a = MY_PI - a;  // -PI / 2 ..  PI / 2
-
-    return a - int_pow(a, 3) / 6 + int_pow(a, 5) / 120 - int_pow(a, 7) / 5040;
-}
-
-static unsigned char tab_r[256 * 256];
-static unsigned char tab_g[256 * 256];
-static unsigned char tab_b[256 * 256];
-
-static int h_cos[360];
-static int h_sin[360];
-
-static int ipol(uint8_t *src, int x, int y)
-{
-    int int_x  = x >> 16;
-    int int_y  = y >> 16;
-    int frac_x = x & 0xFFFF;
-    int frac_y = y & 0xFFFF;
-    int s00    = src[( int_x      & 255) + 256 * ( int_y      & 255)];
-    int s01    = src[((int_x + 1) & 255) + 256 * ( int_y      & 255)];
-    int s10    = src[( int_x      & 255) + 256 * ((int_y + 1) & 255)];
-    int s11    = src[((int_x + 1) & 255) + 256 * ((int_y + 1) & 255)];
-    int s0     = (((1 << 16) - frac_x) * s00 + frac_x * s01) >> 8;
-    int s1     = (((1 << 16) - frac_x) * s10 + frac_x * s11) >> 8;
-
-    return (((1 << 16) - frac_y) * s0 + frac_y * s1) >> 24;
-}
-
-static void gen_image(int num, int w, int h)
-{
-    const int c = h_cos[num % 360];
-    const int s = h_sin[num % 360];
-
-    const int xi = -(w / 2) * c;
-    const int yi =  (w / 2) * s;
-
-    const int xj = -(h / 2) * s;
-    const int yj = -(h / 2) * c;
-    int i, j;
-
-    int x, y;
-    int xprime = xj;
-    int yprime = yj;
-
-    for (j = 0; j < h; j++) {
-        x       = xprime + xi + FIXP * w / 2;
-        xprime += s;
-
-        y       = yprime + yi + FIXP * h / 2;
-        yprime += c;
-
-        for (i = 0; i < w; i++) {
-            x += c;
-            y -= s;
-            put_pixel(i, j,
-                      ipol(tab_r, x, y),
-                      ipol(tab_g, x, y),
-                      ipol(tab_b, x, y));
-        }
-    }
-}
-
-#define W 256
-#define H 256
-
-static int init_demo(const char *filename)
-{
-    int i, j;
-    int h;
-    int radian;
-    char line[3 * W];
-
-    FILE *input_file;
-
-    input_file = fopen(filename, "rb");
-    if (!input_file) {
-        perror(filename);
-        return 1;
-    }
-
-    if (fread(line, 1, 15, input_file) != 15)
-        return 1;
-    for (i = 0; i < H; i++) {
-        if (fread(line, 1, 3 * W, input_file) != 3 * W)
-            return 1;
-        for (j = 0; j < W; j++) {
-            tab_r[W * i + j] = line[3 * j    ];
-            tab_g[W * i + j] = line[3 * j + 1];
-            tab_b[W * i + j] = line[3 * j + 2];
-        }
-    }
-    fclose(input_file);
-
-    /* tables sin/cos */
-    for (i = 0; i < 360; i++) {
-        radian   = 2 * i * MY_PI / 360;
-        h        = 2 * FIXP + int_sin(radian);
-        h_cos[i] = h * int_sin(radian + MY_PI / 2) / 2 / FIXP;
-        h_sin[i] = h * int_sin(radian)             / 2 / FIXP;
-    }
-
-    return 0;
-}
-
-int main(int argc, char **argv)
-{
-    int w, h, i;
-    char buf[1024];
-    int isdir = 0;
-
-    if (argc != 3) {
-        printf("usage: %s image.pnm file|dir\n"
-               "generate a test video stream\n", argv[0]);
-        return 1;
-    }
-
-    if (!freopen(argv[2], "wb", stdout))
-        isdir = 1;
-
-    w = DEFAULT_WIDTH;
-    h = DEFAULT_HEIGHT;
-
-    rgb_tab = malloc(w * h * 3);
-    wrap    = w * 3;
-    width   = w;
-    height  = h;
-
-    if (init_demo(argv[1]))
-        return 1;
-
-    for (i = 0; i < DEFAULT_NB_PICT; i++) {
-        gen_image(i, w, h);
-        if (isdir) {
-            snprintf(buf, sizeof(buf), "%s%02d.pgm", argv[2], i);
-            pgmyuv_save(buf, w, h, rgb_tab);
-        } else {
-            pgmyuv_save(NULL, w, h, rgb_tab);
-        }
-    }
-
-    free(rgb_tab);
-    return 0;
-}
diff --git a/deps/libav/tests/tiny_psnr.c b/deps/libav/tests/tiny_psnr.c
deleted file mode 100644
index 66eaf82..0000000
--- a/deps/libav/tests/tiny_psnr.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <assert.h>
-#include <math.h>
-#include <float.h>
-
-#include "libavutil/intfloat.h"
-#include "libavutil/intreadwrite.h"
-
-#define FFMIN(a, b) ((a) > (b) ? (b) : (a))
-#define F 100
-#define SIZE 2048
-
-uint64_t exp16_table[21] = {
-           65537,
-           65538,
-           65540,
-           65544,
-           65552,
-           65568,
-           65600,
-           65664,
-           65793,
-           66050,
-           66568,
-           67616,
-           69763,
-           74262,
-           84150,
-          108051,
-          178145,
-          484249,
-         3578144,
-       195360063,
-    582360139072LL,
-};
-
-// 16.16 fixpoint log()
-static int64_t log16(uint64_t a)
-{
-    int i;
-    int out = 0;
-
-    if (a < 1 << 16)
-        return -log16((1LL << 32) / a);
-    a <<= 16;
-
-    for (i = 20; i >= 0; i--) {
-        int64_t b = exp16_table[i];
-        if (a < (b << 16))
-            continue;
-        out |= 1 << i;
-        a    = ((a / b) << 16) + (((a % b) << 16) + b / 2) / b;
-    }
-    return out;
-}
-
-static uint64_t int_sqrt(uint64_t a)
-{
-    uint64_t ret    = 0;
-    uint64_t ret_sq = 0;
-    int s;
-
-    for (s = 31; s >= 0; s--) {
-        uint64_t b = ret_sq + (1ULL << (s * 2)) + (ret << s) * 2;
-        if (b <= a) {
-            ret_sq = b;
-            ret   += 1ULL << s;
-        }
-    }
-    return ret;
-}
-
-static int16_t get_s16l(uint8_t *p)
-{
-    union {
-        uint16_t u;
-        int16_t  s;
-    } v;
-    v.u = p[0] | p[1] << 8;
-    return v.s;
-}
-
-static float get_f32l(uint8_t *p)
-{
-    union av_intfloat32 v;
-    v.i = p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
-    return v.f;
-}
-
-static double get_f64l(uint8_t *p)
-{
-    return av_int2double(AV_RL64(p));
-}
-
-int main(int argc, char *argv[])
-{
-    int i, j;
-    uint64_t sse = 0;
-    double sse_d = 0.0;
-    FILE *f[2];
-    uint8_t buf[2][SIZE];
-    int len = 1;
-    int64_t max;
-    int shift      = argc < 5 ? 0 : atoi(argv[4]);
-    int skip_bytes = argc < 6 ? 0 : atoi(argv[5]);
-    int size0      = 0;
-    int size1      = 0;
-    uint64_t maxdist = 0;
-    double maxdist_d = 0.0;
-
-    if (argc < 3) {
-        printf("tiny_psnr <file1> <file2> [<elem size> [<shift> [<skip bytes>]]]\n");
-        printf("WAV headers are skipped automatically.\n");
-        return 1;
-    }
-
-    if (argc > 3) {
-        if (!strcmp(argv[3], "u8")) {
-            len = 1;
-        } else if (!strcmp(argv[3], "s16")) {
-            len = 2;
-        } else if (!strcmp(argv[3], "f32")) {
-            len = 4;
-        } else if (!strcmp(argv[3], "f64")) {
-            len = 8;
-        } else {
-            char *end;
-            len = strtol(argv[3], &end, 0);
-            if (*end || len < 1 || len > 2) {
-                fprintf(stderr, "Unsupported sample format: %s\n", argv[3]);
-                return 1;
-            }
-        }
-    }
-
-    max = (1LL << (8 * len)) - 1;
-
-    f[0] = fopen(argv[1], "rb");
-    f[1] = fopen(argv[2], "rb");
-    if (!f[0] || !f[1]) {
-        fprintf(stderr, "Could not open input files.\n");
-        return 1;
-    }
-
-    for (i = 0; i < 2; i++) {
-        uint8_t *p = buf[i];
-        if (fread(p, 1, 12, f[i]) != 12)
-            return 1;
-        if (!memcmp(p, "RIFF", 4) &&
-            !memcmp(p + 8, "WAVE", 4)) {
-            if (fread(p, 1, 8, f[i]) != 8)
-                return 1;
-            while (memcmp(p, "data", 4)) {
-                int s = p[4] | p[5] << 8 | p[6] << 16 | p[7] << 24;
-                fseek(f[i], s, SEEK_CUR);
-                if (fread(p, 1, 8, f[i]) != 8)
-                    return 1;
-            }
-        } else {
-            fseek(f[i], -12, SEEK_CUR);
-        }
-    }
-
-    fseek(f[shift < 0], abs(shift), SEEK_CUR);
-
-    fseek(f[0], skip_bytes, SEEK_CUR);
-    fseek(f[1], skip_bytes, SEEK_CUR);
-
-    for (;;) {
-        int s0 = fread(buf[0], 1, SIZE, f[0]);
-        int s1 = fread(buf[1], 1, SIZE, f[1]);
-
-        for (j = 0; j < FFMIN(s0, s1); j += len) {
-            switch (len) {
-            case 1:
-            case 2: {
-                int64_t a = buf[0][j];
-                int64_t b = buf[1][j];
-                int dist;
-                if (len == 2) {
-                    a = get_s16l(buf[0] + j);
-                    b = get_s16l(buf[1] + j);
-                } else {
-                    a = buf[0][j];
-                    b = buf[1][j];
-                }
-                sse += (a - b) * (a - b);
-                dist = abs(a - b);
-                if (dist > maxdist)
-                    maxdist = dist;
-                break;
-            }
-            case 4:
-            case 8: {
-                double dist, a, b;
-                if (len == 8) {
-                    a = get_f64l(buf[0] + j);
-                    b = get_f64l(buf[1] + j);
-                } else {
-                    a = get_f32l(buf[0] + j);
-                    b = get_f32l(buf[1] + j);
-                }
-                dist = fabs(a - b);
-                sse_d += (a - b) * (a - b);
-                if (dist > maxdist_d)
-                    maxdist_d = dist;
-                break;
-            }
-            }
-        }
-        size0 += s0;
-        size1 += s1;
-        if (s0 + s1 <= 0)
-            break;
-    }
-
-    i = FFMIN(size0, size1) / len;
-    if (!i)
-        i = 1;
-    switch (len) {
-    case 1:
-    case 2: {
-        uint64_t psnr;
-        uint64_t dev = int_sqrt(((sse / i) * F * F) + (((sse % i) * F * F) + i / 2) / i);
-        if (sse)
-            psnr = ((2 * log16(max << 16) + log16(i) - log16(sse)) *
-                    284619LL * F + (1LL << 31)) / (1LL << 32);
-        else
-            psnr = 1000 * F - 1; // floating point free infinity :)
-
-        printf("stddev:%5d.%02d PSNR:%3d.%02d MAXDIFF:%5"PRIu64" bytes:%9d/%9d\n",
-               (int)(dev / F), (int)(dev % F),
-               (int)(psnr / F), (int)(psnr % F),
-               maxdist, size0, size1);
-        break;
-        }
-    case 4:
-    case 8: {
-        char psnr_str[64];
-        double dev = sqrt(sse_d / i);
-        uint64_t scale = (len == 4) ? (1ULL << 24) : (1ULL << 32);
-
-        if (sse_d) {
-            double psnr = 2 * log(DBL_MAX) - log(i / sse_d);
-            snprintf(psnr_str, sizeof(psnr_str), "%5.02f", psnr);
-        } else
-            snprintf(psnr_str, sizeof(psnr_str), "inf");
-
-        maxdist = maxdist_d * scale;
-
-        printf("stddev:%10.2f PSNR:%s MAXDIFF:%10"PRIu64" bytes:%9d/%9d\n",
-               dev * scale, psnr_str, maxdist, size0, size1);
-        break;
-    }
-    }
-    return 0;
-}
diff --git a/deps/libav/tests/utils.c b/deps/libav/tests/utils.c
deleted file mode 100644
index 2fdc491..0000000
--- a/deps/libav/tests/utils.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define SCALEBITS 8
-#define ONE_HALF  (1 << (SCALEBITS - 1))
-#define FIX(x)    ((int) ((x) * (1L << SCALEBITS) + 0.5))
-
-#define err_if(expr) do {                                              \
-    if (expr) {                                                        \
-        fprintf(stderr, "%s\n", strerror(errno));                      \
-        exit(1);                                                       \
-    }                                                                  \
-} while (0)
-
-static void rgb24_to_yuv420p(unsigned char *lum, unsigned char *cb,
-                             unsigned char *cr, unsigned char *src,
-                             int width, int height)
-{
-    int wrap, wrap3, x, y;
-    int r, g, b, r1, g1, b1;
-    unsigned char *p;
-
-    wrap  = width;
-    wrap3 = width * 3;
-    p     = src;
-    for (y = 0; y < height; y += 2) {
-        for (x = 0; x < width; x += 2) {
-            r       = p[0];
-            g       = p[1];
-            b       = p[2];
-            r1      = r;
-            g1      = g;
-            b1      = b;
-            lum[0]  = (FIX(0.29900) * r + FIX(0.58700) * g +
-                       FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
-            r       = p[3];
-            g       = p[4];
-            b       = p[5];
-            r1     += r;
-            g1     += g;
-            b1     += b;
-            lum[1]  = (FIX(0.29900) * r + FIX(0.58700) * g +
-                       FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
-            p      += wrap3;
-            lum    += wrap;
-
-            r       = p[0];
-            g       = p[1];
-            b       = p[2];
-            r1     += r;
-            g1     += g;
-            b1     += b;
-            lum[0]  = (FIX(0.29900) * r + FIX(0.58700) * g +
-                       FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
-            r       = p[3];
-            g       = p[4];
-            b       = p[5];
-            r1     += r;
-            g1     += g;
-            b1     += b;
-            lum[1]  = (FIX(0.29900) * r + FIX(0.58700) * g +
-                       FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
-
-            cb[0]   = ((- FIX(0.16874) * r1 - FIX(0.33126) * g1 +
-                       FIX(0.50000) * b1 + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128;
-            cr[0]   = ((FIX(0.50000) * r1 - FIX(0.41869) * g1 -
-                       FIX(0.08131) * b1 + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128;
-
-            cb++;
-            cr++;
-            p   += -wrap3 + 2 * 3;
-            lum += -wrap  + 2;
-        }
-        p   += wrap3;
-        lum += wrap;
-    }
-}
-
-/* cif format */
-#define DEFAULT_WIDTH   352
-#define DEFAULT_HEIGHT  288
-#define DEFAULT_NB_PICT  50
-
-static void pgmyuv_save(const char *filename, int w, int h,
-                        unsigned char *rgb_tab)
-{
-    FILE *f;
-    int i, h2, w2;
-    unsigned char *cb, *cr;
-    unsigned char *lum_tab, *cb_tab, *cr_tab;
-
-    lum_tab = malloc(w * h);
-    cb_tab  = malloc(w * h / 4);
-    cr_tab  = malloc(w * h / 4);
-
-    rgb24_to_yuv420p(lum_tab, cb_tab, cr_tab, rgb_tab, w, h);
-
-    if (filename) {
-        f = fopen(filename, "wb");
-        fprintf(f, "P5\n%d %d\n%d\n", w, h * 3 / 2, 255);
-    } else {
-        f = stdout;
-    }
-
-    err_if(fwrite(lum_tab, 1, w * h, f) != w * h);
-    h2 = h / 2;
-    w2 = w / 2;
-    cb = cb_tab;
-    cr = cr_tab;
-
-    if (filename) {
-        for (i = 0; i < h2; i++) {
-            err_if(fwrite(cb, 1, w2, f) != w2);
-            err_if(fwrite(cr, 1, w2, f) != w2);
-            cb += w2;
-            cr += w2;
-        }
-        fclose(f);
-    } else {
-        for (i = 0; i < h2; i++) {
-            err_if(fwrite(cb, 1, w2, f) != w2);
-            cb += w2;
-        }
-        for (i = 0; i < h2; i++) {
-            err_if(fwrite(cr, 1, w2, f) != w2);
-            cr += w2;
-        }
-    }
-
-    free(lum_tab);
-    free(cb_tab);
-    free(cr_tab);
-}
-
-static unsigned char *rgb_tab;
-static int width, height, wrap;
-
-static void put_pixel(int x, int y, int r, int g, int b)
-{
-    unsigned char *p;
-
-    if (x < 0 || x >= width ||
-        y < 0 || y >= height)
-        return;
-
-    p    = rgb_tab + y * wrap + x * 3;
-    p[0] = r;
-    p[1] = g;
-    p[2] = b;
-}
diff --git a/deps/libav/tests/videogen.c b/deps/libav/tests/videogen.c
deleted file mode 100644
index 0b7f67e..0000000
--- a/deps/libav/tests/videogen.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Generate a synthetic YUV video sequence suitable for codec testing.
- * NOTE: No floats are used to guarantee bitexact output.
- *
- * Copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdio.h>
-
-#include "utils.c"
-
-static unsigned int myrnd(unsigned int *seed_ptr, int n)
-{
-    unsigned int seed, val;
-
-    seed = *seed_ptr;
-    seed = (seed * 314159) + 1;
-    if (n == 256) {
-        val = seed >> 24;
-    } else {
-        val = seed % n;
-    }
-    *seed_ptr = seed;
-    return val;
-}
-
-#define NOISE_X  10
-#define NOISE_Y  30
-#define NOISE_W  26
-
-#define FRAC_BITS 8
-#define FRAC_ONE (1 << FRAC_BITS)
-
-/* cosine approximate with 1-x^2 */
-static int int_cos(int a)
-{
-    int v, neg;
-    a = a & (FRAC_ONE - 1);
-    if (a >= (FRAC_ONE / 2))
-        a = FRAC_ONE - a;
-    neg = 0;
-    if (a > (FRAC_ONE / 4)) {
-        neg = -1;
-        a   = (FRAC_ONE / 2) - a;
-    }
-    v = FRAC_ONE - ((a * a) >> 4);
-    v = (v ^ neg) - neg;
-    return v;
-}
-
-#define NB_OBJS  10
-
-typedef struct VObj {
-    int x, y, w, h;
-    int r, g, b;
-} VObj;
-
-static VObj objs[NB_OBJS];
-
-static unsigned int seed = 1;
-
-static void gen_image(int num, int w, int h)
-{
-    int r, g, b, x, y, i, dx, dy, x1, y1;
-    unsigned int seed1;
-
-    if (num == 0) {
-        for (i = 0; i < NB_OBJS; i++) {
-            objs[i].x = myrnd(&seed, w);
-            objs[i].y = myrnd(&seed, h);
-            objs[i].w = myrnd(&seed, w / 4) + 10;
-            objs[i].h = myrnd(&seed, h / 4) + 10;
-            objs[i].r = myrnd(&seed, 256);
-            objs[i].g = myrnd(&seed, 256);
-            objs[i].b = myrnd(&seed, 256);
-        }
-    }
-
-    /* first a moving background with gradients */
-    /* test motion estimation */
-    dx = int_cos(num * FRAC_ONE / 50) * 35;
-    dy = int_cos(num * FRAC_ONE / 50 + FRAC_ONE / 10) * 30;
-    for (y = 0; y < h; y++) {
-        for (x = 0; x < w; x++) {
-            x1 = (x << FRAC_BITS) + dx;
-            y1 = (y << FRAC_BITS) + dy;
-            r  =       ((y1  * 7) >> FRAC_BITS) & 0xff;
-            g  = (((x1 + y1) * 9) >> FRAC_BITS) & 0xff;
-            b  =  ((x1       * 5) >> FRAC_BITS) & 0xff;
-            put_pixel(x, y, r, g, b);
-        }
-    }
-
-    /* then some noise with very high intensity to test saturation */
-    seed1 = num;
-    for (y = 0; y < NOISE_W; y++) {
-        for (x = 0; x < NOISE_W; x++) {
-            r = myrnd(&seed1, 256);
-            g = myrnd(&seed1, 256);
-            b = myrnd(&seed1, 256);
-            put_pixel(x + NOISE_X, y + NOISE_Y, r, g, b);
-        }
-    }
-
-    /* then moving objects */
-    for (i = 0; i < NB_OBJS; i++) {
-        VObj *p = &objs[i];
-        seed1 = i;
-        for (y = 0; y < p->h; y++) {
-            for (x = 0; x < p->w; x++) {
-                r = p->r;
-                g = p->g;
-                b = p->b;
-                /* add a per object noise */
-                r += myrnd(&seed1, 50);
-                g += myrnd(&seed1, 50);
-                b += myrnd(&seed1, 50);
-                put_pixel(x + p->x, y + p->y, r, g, b);
-            }
-        }
-        p->x += myrnd(&seed, 21) - 10;
-        p->y += myrnd(&seed, 21) - 10;
-    }
-}
-
-int main(int argc, char **argv)
-{
-    int w, h, i;
-    char buf[1024];
-    int isdir = 0;
-
-    if (argc != 2) {
-        printf("usage: %s file|dir\n"
-               "generate a test video stream\n", argv[0]);
-        exit(1);
-    }
-
-    if (!freopen(argv[1], "wb", stdout))
-        isdir = 1;
-
-    w = DEFAULT_WIDTH;
-    h = DEFAULT_HEIGHT;
-
-    rgb_tab = malloc(w * h * 3);
-    wrap    = w * 3;
-    width   = w;
-    height  = h;
-
-    for (i = 0; i < DEFAULT_NB_PICT; i++) {
-        gen_image(i, w, h);
-        if (isdir) {
-            snprintf(buf, sizeof(buf), "%s%02d.pgm", argv[1], i);
-            pgmyuv_save(buf, w, h, rgb_tab);
-        } else {
-            pgmyuv_save(NULL, w, h, rgb_tab);
-        }
-    }
-
-    free(rgb_tab);
-    return 0;
-}
diff --git a/deps/libav/tools/aviocat.c b/deps/libav/tools/aviocat.c
deleted file mode 100644
index 6a33a7c..0000000
--- a/deps/libav/tools/aviocat.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libavutil/time.h"
-#include "libavformat/avformat.h"
-
-static int usage(const char *argv0, int ret)
-{
-    fprintf(stderr, "%s [-b bytespersec] [-d duration] input_url output_url\n", argv0);
-    return ret;
-}
-
-int main(int argc, char **argv)
-{
-    int bps = 0, duration = 0, ret, i;
-    const char *input_url = NULL, *output_url = NULL;
-    int64_t stream_pos = 0;
-    int64_t start_time;
-    char errbuf[50];
-    AVIOContext *input, *output;
-
-    av_register_all();
-    avformat_network_init();
-
-    for (i = 1; i < argc; i++) {
-        if (!strcmp(argv[i], "-b") && i + 1 < argc) {
-            bps = atoi(argv[i + 1]);
-            i++;
-        } else if (!strcmp(argv[i], "-d") && i + 1 < argc) {
-            duration = atoi(argv[i + 1]);
-            i++;
-        } else if (!input_url) {
-            input_url = argv[i];
-        } else if (!output_url) {
-            output_url = argv[i];
-        } else {
-            return usage(argv[0], 1);
-        }
-    }
-    if (!output_url)
-        return usage(argv[0], 1);
-
-    ret = avio_open2(&input, input_url, AVIO_FLAG_READ, NULL, NULL);
-    if (ret) {
-        av_strerror(ret, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to open %s: %s\n", input_url, errbuf);
-        return 1;
-    }
-    if (duration && !bps) {
-        int64_t size = avio_size(input);
-        if (size < 0) {
-            av_strerror(ret, errbuf, sizeof(errbuf));
-            fprintf(stderr, "Unable to get size of %s: %s\n", input_url, errbuf);
-            goto fail;
-        }
-        bps = size / duration;
-    }
-    ret = avio_open2(&output, output_url, AVIO_FLAG_WRITE, NULL, NULL);
-    if (ret) {
-        av_strerror(ret, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to open %s: %s\n", output_url, errbuf);
-        goto fail;
-    }
-
-    start_time = av_gettime();
-    while (1) {
-        uint8_t buf[1024];
-        int n;
-        n = avio_read(input, buf, sizeof(buf));
-        if (n <= 0)
-            break;
-        avio_write(output, buf, n);
-        stream_pos += n;
-        if (bps) {
-            avio_flush(output);
-            while ((av_gettime() - start_time) * bps / AV_TIME_BASE < stream_pos)
-                av_usleep(50 * 1000);
-        }
-    }
-
-    avio_flush(output);
-    avio_close(output);
-
-fail:
-    avio_close(input);
-    avformat_network_deinit();
-    return ret ? 1 : 0;
-}
diff --git a/deps/libav/tools/cws2fws.c b/deps/libav/tools/cws2fws.c
deleted file mode 100644
index 74588c1..0000000
--- a/deps/libav/tools/cws2fws.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * cws2fws by Alex Beregszaszi
- * This file is placed in the public domain.
- * Use the program however you see fit.
- *
- * This utility converts compressed Macromedia Flash files to uncompressed ones.
- */
-
-#include "config.h"
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_IO_H
-#include <io.h>
-#endif
-#include <zlib.h>
-
-#ifdef DEBUG
-#define dbgprintf printf
-#else
-#define dbgprintf(...)
-#endif
-
-int main(int argc, char *argv[])
-{
-    int fd_in, fd_out, comp_len, uncomp_len, i, last_out;
-    char buf_in[1024], buf_out[65536];
-    z_stream zstream;
-    struct stat statbuf;
-
-    if (argc < 3) {
-        printf("Usage: %s <infile.swf> <outfile.swf>\n", argv[0]);
-        return 1;
-    }
-
-    fd_in = open(argv[1], O_RDONLY);
-    if (fd_in < 0) {
-        perror("Error opening input file");
-        return 1;
-    }
-
-    fd_out = open(argv[2], O_WRONLY | O_CREAT, 00644);
-    if (fd_out < 0) {
-        perror("Error opening output file");
-        close(fd_in);
-        return 1;
-    }
-
-    if (read(fd_in, &buf_in, 8) != 8) {
-        printf("Header error\n");
-        close(fd_in);
-        close(fd_out);
-        return 1;
-    }
-
-    if (buf_in[0] != 'C' || buf_in[1] != 'W' || buf_in[2] != 'S') {
-        printf("Not a compressed flash file\n");
-        return 1;
-    }
-
-    fstat(fd_in, &statbuf);
-    comp_len   = statbuf.st_size;
-    uncomp_len = buf_in[4] | (buf_in[5] << 8) | (buf_in[6] << 16) | (buf_in[7] << 24);
-
-    printf("Compressed size: %d Uncompressed size: %d\n",
-           comp_len - 4, uncomp_len - 4);
-
-    // write out modified header
-    buf_in[0] = 'F';
-    if (write(fd_out, &buf_in, 8) < 8) {
-        perror("Error writing output file");
-        return 1;
-    }
-
-    zstream.zalloc = NULL;
-    zstream.zfree  = NULL;
-    zstream.opaque = NULL;
-    inflateInit(&zstream);
-
-    for (i = 0; i < comp_len - 8;) {
-        int ret, len = read(fd_in, &buf_in, 1024);
-
-        dbgprintf("read %d bytes\n", len);
-
-        last_out = zstream.total_out;
-
-        zstream.next_in   = &buf_in[0];
-        zstream.avail_in  = len;
-        zstream.next_out  = &buf_out[0];
-        zstream.avail_out = 65536;
-
-        ret = inflate(&zstream, Z_SYNC_FLUSH);
-        if (ret != Z_STREAM_END && ret != Z_OK) {
-            printf("Error while decompressing: %d\n", ret);
-            inflateEnd(&zstream);
-            return 1;
-        }
-
-        dbgprintf("a_in: %d t_in: %lu a_out: %d t_out: %lu -- %lu out\n",
-                  zstream.avail_in, zstream.total_in, zstream.avail_out,
-                  zstream.total_out, zstream.total_out - last_out);
-
-        if (write(fd_out, &buf_out, zstream.total_out - last_out) <
-            zstream.total_out - last_out) {
-            perror("Error writing output file");
-            return 1;
-        }
-
-        i += len;
-
-        if (ret == Z_STREAM_END || ret == Z_BUF_ERROR)
-            break;
-    }
-
-    if (zstream.total_out != uncomp_len - 8) {
-        printf("Size mismatch (%lu != %d), updating header...\n",
-               zstream.total_out, uncomp_len - 8);
-
-        buf_in[0] =  (zstream.total_out + 8)        & 0xff;
-        buf_in[1] = ((zstream.total_out + 8) >>  8) & 0xff;
-        buf_in[2] = ((zstream.total_out + 8) >> 16) & 0xff;
-        buf_in[3] = ((zstream.total_out + 8) >> 24) & 0xff;
-
-        lseek(fd_out, 4, SEEK_SET);
-        if (write(fd_out, &buf_in, 4) < 4) {
-            perror("Error writing output file");
-            return 1;
-        }
-    }
-
-    inflateEnd(&zstream);
-    close(fd_in);
-    close(fd_out);
-    return 0;
-}
diff --git a/deps/libav/tools/graph2dot.c b/deps/libav/tools/graph2dot.c
deleted file mode 100644
index 12f1066..0000000
--- a/deps/libav/tools/graph2dot.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2008-2010 Stefano Sabatini
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#if HAVE_UNISTD_H
-#include <unistd.h>             /* getopt */
-#endif
-#include <stdio.h>
-#include <string.h>
-
-#include "libavutil/channel_layout.h"
-#include "libavutil/mem.h"
-#include "libavutil/pixdesc.h"
-#include "libavutil/audioconvert.h"
-#include "libavfilter/avfilter.h"
-
-#if !HAVE_GETOPT
-#include "compat/getopt.c"
-#endif
-
-static void usage(void)
-{
-    printf("Convert a libavfilter graph to a dot file.\n");
-    printf("Usage: graph2dot [OPTIONS]\n");
-    printf("\n"
-           "Options:\n"
-           "-i INFILE         set INFILE as input file, stdin if omitted\n"
-           "-o OUTFILE        set OUTFILE as output file, stdout if omitted\n"
-           "-h                print this help\n");
-}
-
-struct line {
-    char data[256];
-    struct line *next;
-};
-
-static void print_digraph(FILE *outfile, AVFilterGraph *graph)
-{
-    int i, j;
-
-    fprintf(outfile, "digraph G {\n");
-    fprintf(outfile, "node [shape=box]\n");
-    fprintf(outfile, "rankdir=LR\n");
-
-    for (i = 0; i < graph->nb_filters; i++) {
-        char filter_ctx_label[128];
-        const AVFilterContext *filter_ctx = graph->filters[i];
-
-        snprintf(filter_ctx_label, sizeof(filter_ctx_label), "%s (%s)",
-                 filter_ctx->name,
-                 filter_ctx->filter->name);
-
-        for (j = 0; j < filter_ctx->nb_outputs; j++) {
-            AVFilterLink *link = filter_ctx->outputs[j];
-            if (link) {
-                char dst_filter_ctx_label[128];
-                const AVFilterContext *dst_filter_ctx = link->dst;
-
-                snprintf(dst_filter_ctx_label, sizeof(dst_filter_ctx_label),
-                         "%s (%s)",
-                         dst_filter_ctx->name,
-                         dst_filter_ctx->filter->name);
-
-                fprintf(outfile, "\"%s\" -> \"%s\"",
-                        filter_ctx_label, dst_filter_ctx_label);
-                if (link->type == AVMEDIA_TYPE_VIDEO) {
-                    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
-                    fprintf(outfile,
-                            " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ]",
-                            desc->name, link->w, link->h, link->time_base.num,
-                            link->time_base.den);
-                } else if (link->type == AVMEDIA_TYPE_AUDIO) {
-                    char buf[255];
-                    av_get_channel_layout_string(buf, sizeof(buf), -1,
-                                                 link->channel_layout);
-                    fprintf(outfile,
-                            " [ label= \"fmt:%s sr:%d cl:%s\" ]",
-                            av_get_sample_fmt_name(link->format),
-                            link->sample_rate, buf);
-                }
-                fprintf(outfile, ";\n");
-            }
-        }
-    }
-    fprintf(outfile, "}\n");
-}
-
-int main(int argc, char **argv)
-{
-    const char *outfilename = NULL;
-    const char *infilename  = NULL;
-    FILE *outfile           = NULL;
-    FILE *infile            = NULL;
-    char *graph_string      = NULL;
-    AVFilterGraph *graph = av_mallocz(sizeof(AVFilterGraph));
-    char c;
-
-    av_log_set_level(AV_LOG_DEBUG);
-
-    while ((c = getopt(argc, argv, "hi:o:")) != -1) {
-        switch (c) {
-        case 'h':
-            usage();
-            return 0;
-        case 'i':
-            infilename = optarg;
-            break;
-        case 'o':
-            outfilename = optarg;
-            break;
-        case '?':
-            return 1;
-        }
-    }
-
-    if (!infilename || !strcmp(infilename, "-"))
-        infilename = "/dev/stdin";
-    infile = fopen(infilename, "r");
-    if (!infile) {
-        fprintf(stderr, "Failed to open input file '%s': %s\n",
-                infilename, strerror(errno));
-        return 1;
-    }
-
-    if (!outfilename || !strcmp(outfilename, "-"))
-        outfilename = "/dev/stdout";
-    outfile = fopen(outfilename, "w");
-    if (!outfile) {
-        fprintf(stderr, "Failed to open output file '%s': %s\n",
-                outfilename, strerror(errno));
-        return 1;
-    }
-
-    /* read from infile and put it in a buffer */
-    {
-        unsigned int count = 0;
-        struct line *line, *last_line, *first_line;
-        char *p;
-        last_line = first_line = av_malloc(sizeof(struct line));
-
-        while (fgets(last_line->data, sizeof(last_line->data), infile)) {
-            struct line *new_line = av_malloc(sizeof(struct line));
-            count += strlen(last_line->data);
-            last_line->next = new_line;
-            last_line       = new_line;
-        }
-        last_line->next = NULL;
-
-        graph_string = av_malloc(count + 1);
-        p = graph_string;
-        for (line = first_line; line->next; line = line->next) {
-            unsigned int l = strlen(line->data);
-            memcpy(p, line->data, l);
-            p += l;
-        }
-        *p = '\0';
-    }
-
-    avfilter_register_all();
-
-    if (avfilter_graph_parse(graph, graph_string, NULL, NULL, NULL) < 0) {
-        fprintf(stderr, "Failed to parse the graph description\n");
-        return 1;
-    }
-
-    if (avfilter_graph_config(graph, NULL) < 0)
-        return 1;
-
-    print_digraph(outfile, graph);
-    fflush(outfile);
-
-    return 0;
-}
diff --git a/deps/libav/tools/ismindex.c b/deps/libav/tools/ismindex.c
deleted file mode 100644
index a51c5b7..0000000
--- a/deps/libav/tools/ismindex.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * Copyright (c) 2012 Martin Storsjo
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * To create a simple file for smooth streaming:
- * avconv <normal input/transcoding options> -movflags frag_keyframe foo.ismv
- * ismindex -n foo foo.ismv
- * This step creates foo.ism and foo.ismc that is required by IIS for
- * serving it.
- *
- * To pre-split files for serving as static files by a web server without
- * any extra server support, create the ismv file as above, and split it:
- * ismindex -split foo.ismv
- * This step creates a file Manifest and directories QualityLevel(...),
- * that can be read directly by a smooth streaming player.
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "libavformat/avformat.h"
-#include "libavformat/os_support.h"
-#include "libavutil/intreadwrite.h"
-#include "libavutil/mathematics.h"
-
-static int usage(const char *argv0, int ret)
-{
-    fprintf(stderr, "%s [-split] [-n basename] file1 [file2] ...\n", argv0);
-    return ret;
-}
-
-struct MoofOffset {
-    int64_t time;
-    int64_t offset;
-    int64_t duration;
-};
-
-struct Track {
-    const char *name;
-    int64_t duration;
-    int bitrate;
-    int track_id;
-    int is_audio, is_video;
-    int width, height;
-    int chunks;
-    int sample_rate, channels;
-    uint8_t *codec_private;
-    int codec_private_size;
-    struct MoofOffset *offsets;
-    int timescale;
-    const char *fourcc;
-    int blocksize;
-    int tag;
-};
-
-struct Tracks {
-    int nb_tracks;
-    int64_t duration;
-    struct Track **tracks;
-    int video_track, audio_track;
-    int nb_video_tracks, nb_audio_tracks;
-};
-
-static int copy_tag(AVIOContext *in, AVIOContext *out, int32_t tag_name)
-{
-    int32_t size, tag;
-
-    size = avio_rb32(in);
-    tag  = avio_rb32(in);
-    avio_wb32(out, size);
-    avio_wb32(out, tag);
-    if (tag != tag_name)
-        return -1;
-    size -= 8;
-    while (size > 0) {
-        char buf[1024];
-        int len = FFMIN(sizeof(buf), size);
-        if (avio_read(in, buf, len) != len)
-            break;
-        avio_write(out, buf, len);
-        size -= len;
-    }
-    return 0;
-}
-
-static int write_fragment(const char *filename, AVIOContext *in)
-{
-    AVIOContext *out = NULL;
-    int ret;
-
-    if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, NULL, NULL)) < 0)
-        return ret;
-    copy_tag(in, out, MKBETAG('m', 'o', 'o', 'f'));
-    copy_tag(in, out, MKBETAG('m', 'd', 'a', 't'));
-
-    avio_flush(out);
-    avio_close(out);
-
-    return ret;
-}
-
-static int write_fragments(struct Tracks *tracks, int start_index,
-                           AVIOContext *in)
-{
-    char dirname[100], filename[500];
-    int i, j;
-
-    for (i = start_index; i < tracks->nb_tracks; i++) {
-        struct Track *track = tracks->tracks[i];
-        const char *type    = track->is_video ? "video" : "audio";
-        snprintf(dirname, sizeof(dirname), "QualityLevels(%d)", track->bitrate);
-        mkdir(dirname, 0777);
-        for (j = 0; j < track->chunks; j++) {
-            snprintf(filename, sizeof(filename), "%s/Fragments(%s=%"PRId64")",
-                     dirname, type, track->offsets[j].time);
-            avio_seek(in, track->offsets[j].offset, SEEK_SET);
-            write_fragment(filename, in);
-        }
-    }
-    return 0;
-}
-
-static int read_tfra(struct Tracks *tracks, int start_index, AVIOContext *f)
-{
-    int ret = AVERROR_EOF, track_id;
-    int version, fieldlength, i, j;
-    int64_t pos   = avio_tell(f);
-    uint32_t size = avio_rb32(f);
-    struct Track *track = NULL;
-
-    if (avio_rb32(f) != MKBETAG('t', 'f', 'r', 'a'))
-        goto fail;
-    version = avio_r8(f);
-    avio_rb24(f);
-    track_id = avio_rb32(f); /* track id */
-    for (i = start_index; i < tracks->nb_tracks && !track; i++)
-        if (tracks->tracks[i]->track_id == track_id)
-            track = tracks->tracks[i];
-    if (!track) {
-        /* Ok, continue parsing the next atom */
-        ret = 0;
-        goto fail;
-    }
-    fieldlength = avio_rb32(f);
-    track->chunks  = avio_rb32(f);
-    track->offsets = av_mallocz(sizeof(*track->offsets) * track->chunks);
-    if (!track->offsets) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-    for (i = 0; i < track->chunks; i++) {
-        if (version == 1) {
-            track->offsets[i].time   = avio_rb64(f);
-            track->offsets[i].offset = avio_rb64(f);
-        } else {
-            track->offsets[i].time   = avio_rb32(f);
-            track->offsets[i].offset = avio_rb32(f);
-        }
-        for (j = 0; j < ((fieldlength >> 4) & 3) + 1; j++)
-            avio_r8(f);
-        for (j = 0; j < ((fieldlength >> 2) & 3) + 1; j++)
-            avio_r8(f);
-        for (j = 0; j < ((fieldlength >> 0) & 3) + 1; j++)
-            avio_r8(f);
-        if (i > 0)
-            track->offsets[i - 1].duration = track->offsets[i].time -
-                                             track->offsets[i - 1].time;
-    }
-    if (track->chunks > 0)
-        track->offsets[track->chunks - 1].duration = track->duration -
-                                                     track->offsets[track->chunks - 1].time;
-    ret = 0;
-
-fail:
-    avio_seek(f, pos + size, SEEK_SET);
-    return ret;
-}
-
-static int read_mfra(struct Tracks *tracks, int start_index,
-                     const char *file, int split)
-{
-    int err = 0;
-    AVIOContext *f = NULL;
-    int32_t mfra_size;
-
-    if ((err = avio_open2(&f, file, AVIO_FLAG_READ, NULL, NULL)) < 0)
-        goto fail;
-    avio_seek(f, avio_size(f) - 4, SEEK_SET);
-    mfra_size = avio_rb32(f);
-    avio_seek(f, -mfra_size, SEEK_CUR);
-    if (avio_rb32(f) != mfra_size) {
-        err = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-    if (avio_rb32(f) != MKBETAG('m', 'f', 'r', 'a')) {
-        err = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-    while (!read_tfra(tracks, start_index, f)) {
-        /* Empty */
-    }
-
-    if (split)
-        write_fragments(tracks, start_index, f);
-
-fail:
-    if (f)
-        avio_close(f);
-    if (err)
-        fprintf(stderr, "Unable to read the MFRA atom in %s\n", file);
-    return err;
-}
-
-static int get_private_data(struct Track *track, AVCodecContext *codec)
-{
-    track->codec_private_size = codec->extradata_size;
-    track->codec_private      = av_mallocz(codec->extradata_size);
-    if (!track->codec_private)
-        return AVERROR(ENOMEM);
-    memcpy(track->codec_private, codec->extradata, codec->extradata_size);
-    return 0;
-}
-
-static int get_video_private_data(struct Track *track, AVCodecContext *codec)
-{
-    AVIOContext *io = NULL;
-    uint16_t sps_size, pps_size;
-    int err = AVERROR(EINVAL);
-
-    if (codec->codec_id == AV_CODEC_ID_VC1)
-        return get_private_data(track, codec);
-
-    avio_open_dyn_buf(&io);
-    if (codec->extradata_size < 11 || codec->extradata[0] != 1)
-        goto fail;
-    sps_size = AV_RB16(&codec->extradata[6]);
-    if (11 + sps_size > codec->extradata_size)
-        goto fail;
-    avio_wb32(io, 0x00000001);
-    avio_write(io, &codec->extradata[8], sps_size);
-    pps_size = AV_RB16(&codec->extradata[9 + sps_size]);
-    if (11 + sps_size + pps_size > codec->extradata_size)
-        goto fail;
-    avio_wb32(io, 0x00000001);
-    avio_write(io, &codec->extradata[11 + sps_size], pps_size);
-    err = 0;
-
-fail:
-    track->codec_private_size = avio_close_dyn_buf(io, &track->codec_private);
-    return err;
-}
-
-static int handle_file(struct Tracks *tracks, const char *file, int split)
-{
-    AVFormatContext *ctx = NULL;
-    int err = 0, i, orig_tracks = tracks->nb_tracks;
-    char errbuf[50], *ptr;
-    struct Track *track;
-
-    err = avformat_open_input(&ctx, file, NULL, NULL);
-    if (err < 0) {
-        av_strerror(err, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to open %s: %s\n", file, errbuf);
-        return 1;
-    }
-
-    err = avformat_find_stream_info(ctx, NULL);
-    if (err < 0) {
-        av_strerror(err, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to identify %s: %s\n", file, errbuf);
-        goto fail;
-    }
-
-    if (ctx->nb_streams < 1) {
-        fprintf(stderr, "No streams found in %s\n", file);
-        goto fail;
-    }
-
-    for (i = 0; i < ctx->nb_streams; i++) {
-        struct Track **temp;
-        AVStream *st = ctx->streams[i];
-        track = av_mallocz(sizeof(*track));
-        if (!track) {
-            err = AVERROR(ENOMEM);
-            goto fail;
-        }
-        temp = av_realloc(tracks->tracks,
-                          sizeof(*tracks->tracks) * (tracks->nb_tracks + 1));
-        if (!temp) {
-            av_free(track);
-            err = AVERROR(ENOMEM);
-            goto fail;
-        }
-        tracks->tracks = temp;
-        tracks->tracks[tracks->nb_tracks] = track;
-
-        track->name = file;
-        if ((ptr = strrchr(file, '/')) != NULL)
-            track->name = ptr + 1;
-
-        track->bitrate   = st->codec->bit_rate;
-        track->track_id  = st->id;
-        track->timescale = st->time_base.den;
-        track->duration  = st->duration;
-        track->is_audio  = st->codec->codec_type == AVMEDIA_TYPE_AUDIO;
-        track->is_video  = st->codec->codec_type == AVMEDIA_TYPE_VIDEO;
-
-        if (!track->is_audio && !track->is_video) {
-            fprintf(stderr,
-                    "Track %d in %s is neither video nor audio, skipping\n",
-                    track->track_id, file);
-            av_freep(&tracks->tracks[tracks->nb_tracks]);
-            continue;
-        }
-
-        tracks->duration = FFMAX(tracks->duration,
-                                 av_rescale_rnd(track->duration, AV_TIME_BASE,
-                                                track->timescale, AV_ROUND_UP));
-
-        if (track->is_audio) {
-            if (tracks->audio_track < 0)
-                tracks->audio_track = tracks->nb_tracks;
-            tracks->nb_audio_tracks++;
-            track->channels    = st->codec->channels;
-            track->sample_rate = st->codec->sample_rate;
-            if (st->codec->codec_id == AV_CODEC_ID_AAC) {
-                track->fourcc    = "AACL";
-                track->tag       = 255;
-                track->blocksize = 4;
-            } else if (st->codec->codec_id == AV_CODEC_ID_WMAPRO) {
-                track->fourcc    = "WMAP";
-                track->tag       = st->codec->codec_tag;
-                track->blocksize = st->codec->block_align;
-            }
-            get_private_data(track, st->codec);
-        }
-        if (track->is_video) {
-            if (tracks->video_track < 0)
-                tracks->video_track = tracks->nb_tracks;
-            tracks->nb_video_tracks++;
-            track->width  = st->codec->width;
-            track->height = st->codec->height;
-            if (st->codec->codec_id == AV_CODEC_ID_H264)
-                track->fourcc = "H264";
-            else if (st->codec->codec_id == AV_CODEC_ID_VC1)
-                track->fourcc = "WVC1";
-            get_video_private_data(track, st->codec);
-        }
-
-        tracks->nb_tracks++;
-    }
-
-    avformat_close_input(&ctx);
-
-    err = read_mfra(tracks, orig_tracks, file, split);
-
-fail:
-    if (ctx)
-        avformat_close_input(&ctx);
-    return err;
-}
-
-static void output_server_manifest(struct Tracks *tracks,
-                                   const char *basename)
-{
-    char filename[1000];
-    FILE *out;
-    int i;
-
-    snprintf(filename, sizeof(filename), "%s.ism", basename);
-    out = fopen(filename, "w");
-    if (!out) {
-        perror(filename);
-        return;
-    }
-    fprintf(out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
-    fprintf(out, "<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n");
-    fprintf(out, "\t<head>\n");
-    fprintf(out, "\t\t<meta name=\"clientManifestRelativePath\" "
-                 "content=\"%s.ismc\" />\n", basename);
-    fprintf(out, "\t</head>\n");
-    fprintf(out, "\t<body>\n");
-    fprintf(out, "\t\t<switch>\n");
-    for (i = 0; i < tracks->nb_tracks; i++) {
-        struct Track *track = tracks->tracks[i];
-        const char *type    = track->is_video ? "video" : "audio";
-        fprintf(out, "\t\t\t<%s src=\"%s\" systemBitrate=\"%d\">\n",
-                type, track->name, track->bitrate);
-        fprintf(out, "\t\t\t\t<param name=\"trackID\" value=\"%d\" "
-                     "valueType=\"data\" />\n", track->track_id);
-        fprintf(out, "\t\t\t</%s>\n", type);
-    }
-    fprintf(out, "\t\t</switch>\n");
-    fprintf(out, "\t</body>\n");
-    fprintf(out, "</smil>\n");
-    fclose(out);
-}
-
-static void print_track_chunks(FILE *out, struct Tracks *tracks, int main,
-                               const char *type)
-{
-    int i, j;
-    struct Track *track = tracks->tracks[main];
-    for (i = 0; i < track->chunks; i++) {
-        for (j = main + 1; j < tracks->nb_tracks; j++) {
-            if (tracks->tracks[j]->is_audio == track->is_audio &&
-                track->offsets[i].duration != tracks->tracks[j]->offsets[i].duration)
-                fprintf(stderr, "Mismatched duration of %s chunk %d in %s and %s\n",
-                        type, i, track->name, tracks->tracks[j]->name);
-        }
-        fprintf(out, "\t\t<c n=\"%d\" d=\"%"PRId64"\" />\n",
-                i, track->offsets[i].duration);
-    }
-}
-
-static void output_client_manifest(struct Tracks *tracks,
-                                   const char *basename, int split)
-{
-    char filename[1000];
-    FILE *out;
-    int i, j;
-
-    if (split)
-        snprintf(filename, sizeof(filename), "Manifest");
-    else
-        snprintf(filename, sizeof(filename), "%s.ismc", basename);
-    out = fopen(filename, "w");
-    if (!out) {
-        perror(filename);
-        return;
-    }
-    fprintf(out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
-    fprintf(out, "<SmoothStreamingMedia MajorVersion=\"2\" MinorVersion=\"0\" "
-                 "Duration=\"%"PRId64 "\">\n", tracks->duration * 10);
-    if (tracks->video_track >= 0) {
-        struct Track *track = tracks->tracks[tracks->video_track];
-        struct Track *first_track = track;
-        int index = 0;
-        fprintf(out,
-                "\t<StreamIndex Type=\"video\" QualityLevels=\"%d\" "
-                "Chunks=\"%d\" "
-                "Url=\"QualityLevels({bitrate})/Fragments(video={start time})\">\n",
-                tracks->nb_video_tracks, track->chunks);
-        for (i = 0; i < tracks->nb_tracks; i++) {
-            track = tracks->tracks[i];
-            if (!track->is_video)
-                continue;
-            fprintf(out,
-                    "\t\t<QualityLevel Index=\"%d\" Bitrate=\"%d\" "
-                    "FourCC=\"%s\" MaxWidth=\"%d\" MaxHeight=\"%d\" "
-                    "CodecPrivateData=\"",
-                    index, track->bitrate, track->fourcc, track->width, track->height);
-            for (j = 0; j < track->codec_private_size; j++)
-                fprintf(out, "%02X", track->codec_private[j]);
-            fprintf(out, "\" />\n");
-            index++;
-            if (track->chunks != first_track->chunks)
-                fprintf(stderr, "Mismatched number of video chunks in %s and %s\n",
-                        track->name, first_track->name);
-        }
-        print_track_chunks(out, tracks, tracks->video_track, "video");
-        fprintf(out, "\t</StreamIndex>\n");
-    }
-    if (tracks->audio_track >= 0) {
-        struct Track *track = tracks->tracks[tracks->audio_track];
-        struct Track *first_track = track;
-        int index = 0;
-        fprintf(out,
-                "\t<StreamIndex Type=\"audio\" QualityLevels=\"%d\" "
-                "Chunks=\"%d\" "
-                "Url=\"QualityLevels({bitrate})/Fragments(audio={start time})\">\n",
-                tracks->nb_audio_tracks, track->chunks);
-        for (i = 0; i < tracks->nb_tracks; i++) {
-            track = tracks->tracks[i];
-            if (!track->is_audio)
-                continue;
-            fprintf(out,
-                    "\t\t<QualityLevel Index=\"%d\" Bitrate=\"%d\" "
-                    "FourCC=\"%s\" SamplingRate=\"%d\" Channels=\"%d\" "
-                    "BitsPerSample=\"16\" PacketSize=\"%d\" "
-                    "AudioTag=\"%d\" CodecPrivateData=\"",
-                    index, track->bitrate, track->fourcc, track->sample_rate,
-                    track->channels, track->blocksize, track->tag);
-            for (j = 0; j < track->codec_private_size; j++)
-                fprintf(out, "%02X", track->codec_private[j]);
-            fprintf(out, "\" />\n");
-            index++;
-            if (track->chunks != first_track->chunks)
-                fprintf(stderr, "Mismatched number of audio chunks in %s and %s\n",
-                        track->name, first_track->name);
-        }
-        print_track_chunks(out, tracks, tracks->audio_track, "audio");
-        fprintf(out, "\t</StreamIndex>\n");
-    }
-    fprintf(out, "</SmoothStreamingMedia>\n");
-    fclose(out);
-}
-
-static void clean_tracks(struct Tracks *tracks)
-{
-    int i;
-    for (i = 0; i < tracks->nb_tracks; i++) {
-        av_freep(&tracks->tracks[i]->codec_private);
-        av_freep(&tracks->tracks[i]->offsets);
-        av_freep(&tracks->tracks[i]);
-    }
-    av_freep(&tracks->tracks);
-    tracks->nb_tracks = 0;
-}
-
-int main(int argc, char **argv)
-{
-    const char *basename = NULL;
-    int split = 0, i;
-    struct Tracks tracks = { 0, .video_track = -1, .audio_track = -1 };
-
-    av_register_all();
-
-    for (i = 1; i < argc; i++) {
-        if (!strcmp(argv[i], "-n")) {
-            basename = argv[i + 1];
-            i++;
-        } else if (!strcmp(argv[i], "-split")) {
-            split = 1;
-        } else if (argv[i][0] == '-') {
-            return usage(argv[0], 1);
-        } else {
-            if (handle_file(&tracks, argv[i], split))
-                return 1;
-        }
-    }
-    if (!tracks.nb_tracks || (!basename && !split))
-        return usage(argv[0], 1);
-
-    if (!split)
-        output_server_manifest(&tracks, basename);
-    output_client_manifest(&tracks, basename, split);
-
-    clean_tracks(&tracks);
-
-    return 0;
-}
diff --git a/deps/libav/tools/patcheck b/deps/libav/tools/patcheck
deleted file mode 100755
index e681d6d..0000000
--- a/deps/libav/tools/patcheck
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/bin/sh
-
-# if no argument provided, write stdin to a file and re-run the script
-if [ $# = 0 ]; then
-    cat > patcheck.stdout
-    $0 patcheck.stdout
-    rm -f patcheck.stdout
-    exit
-fi
-
-GREP=grep
-EGREP=egrep
-TMP=patcheck.tmp
-OPT="-nH"
-#FILES=$($GREP '^+++' $* | sed 's/+++ //g')
-
-echo patCHeck 1e10.0
-echo This tool is intended to help a human check/review patches it is very far from
-echo being free of false positives and negatives, its output are just hints of what
-echo may or may not be bad. When you use it and it misses something or detects
-echo something wrong, fix it and send a patch to the libav-devel mailing list.
-echo License:GPL Author: Michael Niedermayer
-
-ERE_PRITYP='(unsigned *|)(char|short|long|int|long *int|short *int|void|float|double|(u|)int(8|16|32|64)_t)'
-ERE_TYPES='(const|static|av_cold|inline| *)*('$ERE_PRITYP'|[a-zA-Z][a-zA-Z0-9_]*)[* ]{1,}[a-zA-Z][a-zA-Z0-9_]*'
-ERE_FUNCS="$ERE_TYPES"' *\('
-
-hiegrep(){
-    arg="$1"
-    msg="$2"
-    shift 2
-    $GREP $OPT '^+' $* | $GREP -v ':+++'| $EGREP --color=always -- "$arg"> $TMP && printf "\n$msg\n"
-    cat $TMP
-}
-
-hiegrep2(){
-    arg="$1"
-    varg="$2"
-    msg="$3"
-    shift 3
-    $GREP $OPT '^+' $* | $GREP -v ':+++' | $EGREP -v -- "$varg" | $EGREP --color=always -- "$arg" > $TMP && printf "\n$msg\n"
-    cat $TMP
-}
-
-hiegrep '[[:space:]]$'    'trailing whitespace' $*
-hiegrep "$(echo x | tr 'x' '\t')"         'tabs' $*
-#hiegrep ':\+$'          'Empty lines' $*
-hiegrep ';;'              'double ;' $*
-hiegrep2 '\b_[a-zA-Z0-9_]{1,}' '__(asm|attribute)([^a-zA-Z0-9]|$)' 'reserved identifer' $*
-hiegrep '//[-/<\* ]*$'    'empty comment' $*
-hiegrep '/\*[-<\* ]*\*/'  'empty comment' $*
-hiegrep 'for *\( *'"$ERE_PRITYP"' '  'not gcc 2.95 compatible' $*
-hiegrep '(static|inline|const) *\1'  'duplicate word' $*
-hiegrep 'INIT_VLC_USE_STATIC' 'forbidden ancient vlc type' $*
-hiegrep '=[-+\*\&] ' 'looks like compound assignment' $*
-hiegrep2 '/\*\* *[a-zA-Z0-9].*' '\*/' 'Inconsistently formatted doxygen comment' $*
-hiegrep '; */\*\*[^<]' 'Misformatted doxygen comment' $*
-hiegrep '//!|/\*!' 'inconsistent doxygen syntax' $*
-
-hiegrep2 '(int|unsigned|static|void)[a-zA-Z0-9 _]*(init|end)[a-zA-Z0-9 _]*\(.*[^;]$' '(av_cold|:\+[^a-zA-Z_])' 'These functions may need av_cold, please review the whole patch for similar functions needing av_cold' $*
-
-hiegrep '\+= *1 *;'     'can be simplified to ++' $*
-hiegrep '-= *1 *;'      'can be simplified to --' $*
-hiegrep '((!|=)= *(0|NULL)[^0-9a-z]|[^0-9a-z](0|NULL) *(!|=)=)' 'x==0 / x!=0 can be simplified to !x / x' $*
-
-$EGREP $OPT '^\+ *(const *|)static' $*| $EGREP --color=always '[^=]= *(0|NULL)[^0-9a-zA-Z]'> $TMP && printf '\nuseless 0 init\n'
-cat $TMP
-hiegrep '# *ifdef * (HAVE|CONFIG)_' 'ifdefs that should be #if' $*
-
-hiegrep '\b(awnser|cant|dont|wont|doesnt|usefull|successfull|occured|teh|alot|wether|skiped|heigth|informations|colums|loosy|loosing|seperate|preceed|upto|paket|posible|unkown|inpossible|dimention|acheive)\b' 'common typos' $*
-
-hiegrep 'av_log\( *NULL' 'Missing context in av_log' $*
-hiegrep '[^sn]printf' 'Please use av_log' $*
-hiegrep '\bmalloc' 'Please use av_malloc' $*
-hiegrep '\) *av_malloc' 'useless casts' $*
-hiegrep ':\+ *'"$ERE_PRITYP"' *inline' 'non static inline or strangely ordered inline+static' $*
-hiegrep "$ERE_FUNCS"' *\)' 'missing void' $*
-hiegrep '(sprintf|strcat|strcpy)' 'Possible security issue, make sure this is safe or use snprintf/av_strl*' $*
-hiegrep '/ *(2|4|8|16|32|64|128|256|512|1024|2048|4096|8192|16384|32768|65536)[^0-9]' 'divide by 2^x could use >> maybe' $*
-hiegrep '#(el|)if *(0|1)' 'useless #if' $*
-hiegrep 'if *\( *(0|1) *\)' 'useless if()' $*
-hiegrep '& *[a-zA-Z0-9_]* *\[ *0 *\]' 'useless & [0]' $*
-hiegrep '(\( *[0-9] *(&&|\|\|)|(&&|\|\|) *[0-9] *\))' 'overriding condition' $*
-hiegrep '(:\+|,|;)( *|static|\*)*'"$ERE_PRITYP"' *\*( |\*)*(src|source|input|in[^a-z])' 'missing const?' $*
-hiegrep '(:\+|,|;)( *|static|\*)*'"$ERE_PRITYP"' *(src|source|input|in)([0-9A-Z_][0-9A-Za-z_]*){1,} *\[' 'missing const (test2)?' $*
-hiegrep ' *static *'"$ERE_FUNCS"'[^)]*\);' 'static prototype, maybe you should reorder your functions' $*
-hiegrep '@file: *[a-zA-Z0-9_]' 'doxy filetag with filename can in the future cause problems when forgotten during a rename' $*
-hiegrep '\bassert' 'Please use av_assert0, av_assert1 or av_assert2' $*
-
-hiegrep2 '\.long_name *=' 'NULL_IF_CONFIG_SMAL' 'missing NULL_IF_CONFIG_SMAL' $*
-hiegrep2 '\.pix_fmts *= *\(' 'const' 'missing const for pix_fmts array' $*
-hiegrep2 '\.sample_fmts *= *\(' 'const' 'missing const for sample_fmts array' $*
-hiegrep2 '\.supported_framerates *= *\(' 'const' 'missing const for supported_framerates array' $*
-hiegrep2 '\.channel_layouts *= *\(' 'const' 'missing const for channel_layouts array' $*
-
-#$EGREP $OPT '^\+.*const ' $*| $GREP -v 'static'> $TMP && printf '\nnon static const\n'
-#cat $TMP
-
-hiegrep2 "$ERE_TYPES" '(static|av_|ff_|typedef|:\+[^a-zA-Z_])' 'Non static with no ff_/av_ prefix' $*
-
-hiegrep ':\+[^}#]*else' 'missing } prior to else' $*
-hiegrep '(if|while|for)\(' 'missing whitespace between keyword and ( (feel free to ignore)' $*
-hiegrep '(else|do){'       'missing whitespace between keyword and { (feel free to ignore)' $*
-hiegrep '}(else|while)'    'missing whitespace between } and keyword (feel free to ignore)' $*
-
-#FIXME this should print the previous statement maybe
-hiegrep ':\+  *{ *$' '{ should be on the same line as the related previous statement' $*
-
-
-rm $TMP
-for i in $($GREP -H '^+.*@param' $*| sed 's/^\([^:]*\):.*@param\(\[.*\]\|\) *\([a-zA-Z0-9_]*\) .*$/\1:\3/') ; do
-    doxpar=$(echo $i | sed 's/^.*:\(.*\)$/\1/')
-    file=$(echo $i | sed 's/^\([^:]*\):.*$/\1/')
-    $GREP " *$doxpar *[),]" $file | $GREP -v '@param' >/dev/null || $GREP --color=always "@param *$doxpar" $file >>$TMP
-done
-if test -e $TMP ; then
-    printf '\nmismatching doxy params\n'
-    cat $TMP
-fi
-
-$EGREP -B2 $OPT '^(\+|) *('"$ERE_TYPES"'|# *define)' $* | $EGREP -A2 --color=always '(:|-)\+[^/]*/(\*([^*]|$)|/([^/]|$))' > $TMP && printf "\n Non doxy comments\n"
-cat $TMP
-
-rm $TMP
-for i in \
-    $($EGREP -H '^\+ *'"$ERE_TYPES" $*  |\
-    $GREP -v '(' | $EGREP -v '\Wgoto\W' |\
-    xargs -d '\n' -n 1 |\
-    $GREP -o '[* ][* ]*[a-zA-Z][0-9a-zA-Z_]* *[,;=]' |\
-    sed 's/.[* ]*\([a-zA-Z][0-9a-zA-Z_]*\) *[,;=]/\1/') \
-    ; do
-    echo $i | $GREP '^NULL$' && continue
-    $EGREP $i' *(\+|-|\*|/|\||&|%|)=[^=]' $* >/dev/null || echo "possibly never written:"$i >> $TMP
-    $EGREP '(=|\(|return).*'$i'(==|[^=])*$'    $* >/dev/null || echo "possibly never read   :"$i >> $TMP
-    $EGREP -o $i' *((\+|-|\*|/|\||&|%|)=[^=]|\+\+|--) *(0x|)[0-9]*(;|)'   $* |\
-           $EGREP -v $i' *= *(0x|)[0-9]{1,};'>/dev/null || echo "possibly constant     :"$i >> $TMP
-done
-if test -e $TMP ; then
-    printf '\npossibly unused variables\n'
-    cat $TMP
-fi
-
-$GREP '^+++ .*Changelog' $* >/dev/null || printf "\nMissing changelog entry (ignore if minor change)\n"
-
-cat $* | tr '\n' '@' | $EGREP --color=always -o '(fprintf|av_log|printf)\([^)]*\)[+ ;@]*\1'  >$TMP && printf "\nMergeable calls\n"
-cat $TMP | tr '@' '\n'
-
-cat $* | tr '\n' '@' | $EGREP --color=always -o '\+ *if *\( *([A-Za-z0-9_]*) *[<>]=? *[0-9]* *\) * \1 *= *[0-9]* *;[ @\\+]*else *if *\( *\1 *[<>]=? *[0-9]* *\) *\1 *= *[0-9]* *;'  >$TMP && printf "\nav_clip / av_clip_uint8 / av_clip_int16 / ...\n"
-cat $TMP | tr '@' '\n'
-
-cat $* | tr '\n' '@' | $EGREP --color=always -o '\+ *if *\( *([A-Za-z0-9_]*) *[<>]=? *([A-Za-z0-9_]*) *\)[ @\\+]*(\1|\2) *= *(\1|\2) *;'  >$TMP && printf "\nFFMIN/FFMAX\n"
-cat $TMP | tr '@' '\n'
-
-cat $* | tr '\n' '@' | $EGREP --color=always -o '\+ *if *\( *([A-Za-z0-9_]*) *\)[ @\\+]*av_free(p|) *\( *(&|) *\1[^-.]'  >$TMP && printf "\nav_free(NULL) is safe\n"
-cat $TMP | tr '@' '\n'
-
-cat $* | tr '\n' '@' | $EGREP --color=always -o '[^a-zA-Z0-9_]([a-zA-Z0-9_]*) *= *av_malloc *\([^)]*\)[ @;\\+]*memset *\( *\1'  >$TMP && printf "\nav_mallocz()\n"
-cat $TMP | tr '@' '\n'
-
-
-# does not work
-#cat $* | tr '\n' '@' | $EGREP -o '[^a-zA-Z_0-9]([a-zA-Z][a-zA-Z_0-9]*) *=[^=].*\1' | $EGREP -o '[^a-zA-Z_0-9]([a-zA-Z][a-zA-Z_0-9]*) *=[^=].*\1 *=[^=]'  >$TMP && printf "\nPossibly written 2x before read\n"
-#cat $TMP | tr '@' '\n'
-
-exit
-
-TODO/idea list:
-
-for all demuxers & muxers
-    $EGREP for "avctx->priv_data"
-
-vertical align =
-/* and * align
-arrays fitting in smaller types
-variables written to twice with no interspaced read
-memset(block, 0, 6*64*sizeof(int16_t)); -> clear_blocks
-check existence of long_name in AVCodec
-check that the patch does not touch codec & (de)muxer layer at the same time ->split
-
-write a regression test containing at least a line that triggers each warning once
diff --git a/deps/libav/tools/pktdumper.c b/deps/libav/tools/pktdumper.c
deleted file mode 100644
index c6398fe..0000000
--- a/deps/libav/tools/pktdumper.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2005 Francois Revol
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include <limits.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_IO_H
-#include <io.h>
-#endif
-
-#include "libavutil/avstring.h"
-#include "libavutil/time.h"
-#include "libavformat/avformat.h"
-
-#define FILENAME_BUF_SIZE 4096
-#define PKTFILESUFF "_%08" PRId64 "_%02d_%010" PRId64 "_%06d_%c.bin"
-
-static int usage(int ret)
-{
-    fprintf(stderr, "Dump (up to maxpkts) AVPackets as they are demuxed by libavformat.\n");
-    fprintf(stderr, "Each packet is dumped in its own file named like\n");
-    fprintf(stderr, "$(basename file.ext)_$PKTNUM_$STREAMINDEX_$STAMP_$SIZE_$FLAGS.bin\n");
-    fprintf(stderr, "pktdumper [-nw] file [maxpkts]\n");
-    fprintf(stderr, "-n\twrite No file at all, only demux.\n");
-    fprintf(stderr, "-w\tWait at end of processing instead of quitting.\n");
-    return ret;
-}
-
-int main(int argc, char **argv)
-{
-    char fntemplate[FILENAME_BUF_SIZE];
-    char pktfilename[FILENAME_BUF_SIZE];
-    AVFormatContext *fctx = NULL;
-    AVPacket pkt;
-    int64_t pktnum  = 0;
-    int64_t maxpkts = 0;
-    int donotquit   = 0;
-    int nowrite     = 0;
-    int err;
-
-    if ((argc > 1) && !strncmp(argv[1], "-", 1)) {
-        if (strchr(argv[1], 'w'))
-            donotquit = 1;
-        if (strchr(argv[1], 'n'))
-            nowrite = 1;
-        argv++;
-        argc--;
-    }
-    if (argc < 2)
-        return usage(1);
-    if (argc > 2)
-        maxpkts = atoi(argv[2]);
-    av_strlcpy(fntemplate, argv[1], sizeof(fntemplate));
-    if (strrchr(argv[1], '/'))
-        av_strlcpy(fntemplate, strrchr(argv[1], '/') + 1, sizeof(fntemplate));
-    if (strrchr(fntemplate, '.'))
-        *strrchr(fntemplate, '.') = '\0';
-    if (strchr(fntemplate, '%')) {
-        fprintf(stderr, "cannot use filenames containing '%%'\n");
-        return usage(1);
-    }
-    if (strlen(fntemplate) + sizeof(PKTFILESUFF) >= sizeof(fntemplate) - 1) {
-        fprintf(stderr, "filename too long\n");
-        return usage(1);
-    }
-    strcat(fntemplate, PKTFILESUFF);
-    printf("FNTEMPLATE: '%s'\n", fntemplate);
-
-    // register all file formats
-    av_register_all();
-
-    err = avformat_open_input(&fctx, argv[1], NULL, NULL);
-    if (err < 0) {
-        fprintf(stderr, "cannot open input: error %d\n", err);
-        return 1;
-    }
-
-    err = avformat_find_stream_info(fctx, NULL);
-    if (err < 0) {
-        fprintf(stderr, "avformat_find_stream_info: error %d\n", err);
-        return 1;
-    }
-
-    av_init_packet(&pkt);
-
-    while ((err = av_read_frame(fctx, &pkt)) >= 0) {
-        int fd;
-        snprintf(pktfilename, sizeof(pktfilename), fntemplate, pktnum,
-                 pkt.stream_index, pkt.pts, pkt.size,
-                 (pkt.flags & AV_PKT_FLAG_KEY) ? 'K' : '_');
-        printf(PKTFILESUFF "\n", pktnum, pkt.stream_index, pkt.pts, pkt.size,
-               (pkt.flags & AV_PKT_FLAG_KEY) ? 'K' : '_');
-        if (!nowrite) {
-            fd  = open(pktfilename, O_WRONLY | O_CREAT, 0644);
-            err = write(fd, pkt.data, pkt.size);
-            if (err < 0) {
-                fprintf(stderr, "write: error %d\n", err);
-                return 1;
-            }
-            close(fd);
-        }
-        av_free_packet(&pkt);
-        pktnum++;
-        if (maxpkts && (pktnum >= maxpkts))
-            break;
-    }
-
-    avformat_close_input(&fctx);
-
-    while (donotquit)
-        av_usleep(60 * 1000000);
-
-    return 0;
-}
diff --git a/deps/libav/tools/probetest.c b/deps/libav/tools/probetest.c
deleted file mode 100644
index 678f4dd..0000000
--- a/deps/libav/tools/probetest.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * copyright (c) 2009 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-
-#include "libavformat/avformat.h"
-#include "libavcodec/put_bits.h"
-#include "libavutil/lfg.h"
-
-static int score_array[1000]; //this must be larger than the number of formats
-static int failures = 0;
-
-static void probe(AVProbeData *pd, int type, int p, int size)
-{
-    int i = 0;
-    AVInputFormat *fmt = NULL;
-
-    while ((fmt = av_iformat_next(fmt))) {
-        if (fmt->flags & AVFMT_NOFILE)
-            continue;
-        if (fmt->read_probe) {
-            int score = fmt->read_probe(pd);
-            if (score > score_array[i] && score > AVPROBE_SCORE_MAX / 4) {
-                score_array[i] = score;
-                fprintf(stderr,
-                        "Failure of %s probing code with score=%d type=%d p=%X size=%d\n",
-                        fmt->name, score, type, p, size);
-                failures++;
-            }
-        }
-        i++;
-    }
-}
-
-int main(void)
-{
-    unsigned int p, i, type, size, retry;
-    AVProbeData pd;
-    AVLFG state;
-    PutBitContext pb;
-
-    avcodec_register_all();
-    av_register_all();
-
-    av_lfg_init(&state, 0xdeadbeef);
-
-    pd.buf = NULL;
-    for (size = 1; size < 65537; size *= 2) {
-        pd.buf_size = size;
-        pd.buf      = av_realloc(pd.buf, size + AVPROBE_PADDING_SIZE);
-        pd.filename = "";
-
-        fprintf(stderr, "testing size=%d\n", size);
-
-        for (retry = 0; retry < 4097; retry += FFMAX(size, 32)) {
-            for (type = 0; type < 4; type++) {
-                for (p = 0; p < 4096; p++) {
-                    unsigned hist = 0;
-                    init_put_bits(&pb, pd.buf, size);
-                    switch (type) {
-                    case 0:
-                        for (i = 0; i < size * 8; i++)
-                            put_bits(&pb, 1, (av_lfg_get(&state) & 0xFFFFFFFF) > p << 20);
-                        break;
-                    case 1:
-                        for (i = 0; i < size * 8; i++) {
-                            unsigned int p2 = hist ? p & 0x3F : (p >> 6);
-                            unsigned int v  = (av_lfg_get(&state) & 0xFFFFFFFF) > p2 << 26;
-                            put_bits(&pb, 1, v);
-                            hist = v;
-                        }
-                        break;
-                    case 2:
-                        for (i = 0; i < size * 8; i++) {
-                            unsigned int p2 = (p >> (hist * 3)) & 7;
-                            unsigned int v  = (av_lfg_get(&state) & 0xFFFFFFFF) > p2 << 29;
-                            put_bits(&pb, 1, v);
-                            hist = (2 * hist + v) & 3;
-                        }
-                        break;
-                    case 3:
-                        for (i = 0; i < size; i++) {
-                            int c = 0;
-                            while (p & 63) {
-                                c = (av_lfg_get(&state) & 0xFFFFFFFF) >> 24;
-                                if (c >= 'a' && c <= 'z' && (p & 1))
-                                    break;
-                                else if (c >= 'A' && c <= 'Z' && (p & 2))
-                                    break;
-                                else if (c >= '0' && c <= '9' && (p & 4))
-                                    break;
-                                else if (c == ' ' && (p & 8))
-                                    break;
-                                else if (c == 0 && (p & 16))
-                                    break;
-                                else if (c == 1 && (p & 32))
-                                    break;
-                            }
-                            pd.buf[i] = c;
-                        }
-                    }
-                    flush_put_bits(&pb);
-                    probe(&pd, type, p, size);
-                }
-            }
-        }
-    }
-    return failures;
-}
diff --git a/deps/libav/tools/qt-faststart.c b/deps/libav/tools/qt-faststart.c
deleted file mode 100644
index ed6de1b..0000000
--- a/deps/libav/tools/qt-faststart.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * qt-faststart.c, v0.2
- * by Mike Melanson (melanson at pcisys.net)
- * This file is placed in the public domain. Use the program however you
- * see fit.
- *
- * This utility rearranges a Quicktime file such that the moov atom
- * is in front of the data, thus facilitating network streaming.
- *
- * To compile this program, start from the base directory from which you
- * are building Libav and type:
- *  make tools/qt-faststart
- * The qt-faststart program will be built in the tools/ directory. If you
- * do not build the program in this manner, correct results are not
- * guaranteed, particularly on 64-bit platforms.
- * Invoke the program with:
- *  qt-faststart <infile.mov> <outfile.mov>
- *
- * Notes: Quicktime files can come in many configurations of top-level
- * atoms. This utility stipulates that the very last atom in the file needs
- * to be a moov atom. When given such a file, this utility will rearrange
- * the top-level atoms by shifting the moov atom from the back of the file
- * to the front, and patch the chunk offsets along the way. This utility
- * presently only operates on uncompressed moov atoms.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include <string.h>
-
-#ifdef __MINGW32__
-#define fseeko(x, y, z) fseeko64(x, y, z)
-#define ftello(x)       ftello64(x)
-#elif defined(_WIN32)
-#define fseeko(x, y, z) _fseeki64(x, y, z)
-#define ftello(x)       _ftelli64(x)
-#endif
-
-#define MIN(a,b) ((a) > (b) ? (b) : (a))
-
-#define BE_16(x) ((((uint8_t*)(x))[0] <<  8) | ((uint8_t*)(x))[1])
-
-#define BE_32(x) (((uint32_t)(((uint8_t*)(x))[0]) << 24) |  \
-                             (((uint8_t*)(x))[1]  << 16) |  \
-                             (((uint8_t*)(x))[2]  <<  8) |  \
-                              ((uint8_t*)(x))[3])
-
-#define BE_64(x) (((uint64_t)(((uint8_t*)(x))[0]) << 56) |  \
-                  ((uint64_t)(((uint8_t*)(x))[1]) << 48) |  \
-                  ((uint64_t)(((uint8_t*)(x))[2]) << 40) |  \
-                  ((uint64_t)(((uint8_t*)(x))[3]) << 32) |  \
-                  ((uint64_t)(((uint8_t*)(x))[4]) << 24) |  \
-                  ((uint64_t)(((uint8_t*)(x))[5]) << 16) |  \
-                  ((uint64_t)(((uint8_t*)(x))[6]) <<  8) |  \
-                  ((uint64_t)( (uint8_t*)(x))[7]))
-
-#define BE_FOURCC(ch0, ch1, ch2, ch3)           \
-    ( (uint32_t)(unsigned char)(ch3)        |   \
-     ((uint32_t)(unsigned char)(ch2) <<  8) |   \
-     ((uint32_t)(unsigned char)(ch1) << 16) |   \
-     ((uint32_t)(unsigned char)(ch0) << 24) )
-
-#define QT_ATOM BE_FOURCC
-/* top level atoms */
-#define FREE_ATOM QT_ATOM('f', 'r', 'e', 'e')
-#define JUNK_ATOM QT_ATOM('j', 'u', 'n', 'k')
-#define MDAT_ATOM QT_ATOM('m', 'd', 'a', 't')
-#define MOOV_ATOM QT_ATOM('m', 'o', 'o', 'v')
-#define PNOT_ATOM QT_ATOM('p', 'n', 'o', 't')
-#define SKIP_ATOM QT_ATOM('s', 'k', 'i', 'p')
-#define WIDE_ATOM QT_ATOM('w', 'i', 'd', 'e')
-#define PICT_ATOM QT_ATOM('P', 'I', 'C', 'T')
-#define FTYP_ATOM QT_ATOM('f', 't', 'y', 'p')
-#define UUID_ATOM QT_ATOM('u', 'u', 'i', 'd')
-
-#define CMOV_ATOM QT_ATOM('c', 'm', 'o', 'v')
-#define STCO_ATOM QT_ATOM('s', 't', 'c', 'o')
-#define CO64_ATOM QT_ATOM('c', 'o', '6', '4')
-
-#define ATOM_PREAMBLE_SIZE    8
-#define COPY_BUFFER_SIZE  65536
-
-int main(int argc, char *argv[])
-{
-    FILE *infile  = NULL;
-    FILE *outfile = NULL;
-    unsigned char atom_bytes[ATOM_PREAMBLE_SIZE];
-    uint32_t atom_type   = 0;
-    uint64_t atom_size   = 0;
-    uint64_t atom_offset = 0;
-    int64_t last_offset;
-    unsigned char *moov_atom = NULL;
-    unsigned char *ftyp_atom = NULL;
-    uint64_t moov_atom_size;
-    uint64_t ftyp_atom_size = 0;
-    uint64_t i, j;
-    uint32_t offset_count;
-    uint64_t current_offset;
-    int64_t start_offset = 0;
-    unsigned char copy_buffer[COPY_BUFFER_SIZE];
-    int bytes_to_copy;
-
-    if (argc != 3) {
-        printf("Usage: qt-faststart <infile.mov> <outfile.mov>\n"
-               "Note: alternatively you can use -movflags +faststart in avconv\n");
-        return 0;
-    }
-
-    if (!strcmp(argv[1], argv[2])) {
-        fprintf(stderr, "input and output files need to be different\n");
-        return 1;
-    }
-
-    infile = fopen(argv[1], "rb");
-    if (!infile) {
-        perror(argv[1]);
-        goto error_out;
-    }
-
-    /* traverse through the atoms in the file to make sure that 'moov' is
-     * at the end */
-    while (!feof(infile)) {
-        if (fread(atom_bytes, ATOM_PREAMBLE_SIZE, 1, infile) != 1) {
-            break;
-        }
-        atom_size = BE_32(&atom_bytes[0]);
-        atom_type = BE_32(&atom_bytes[4]);
-
-        /* keep ftyp atom */
-        if (atom_type == FTYP_ATOM) {
-            ftyp_atom_size = atom_size;
-            free(ftyp_atom);
-            ftyp_atom = malloc(ftyp_atom_size);
-            if (!ftyp_atom) {
-                printf("could not allocate %"PRIu64" bytes for ftyp atom\n",
-                       atom_size);
-                goto error_out;
-            }
-            if (fseeko(infile, -ATOM_PREAMBLE_SIZE, SEEK_CUR) ||
-                fread(ftyp_atom, atom_size, 1, infile) != 1 ||
-                (start_offset = ftello(infile)) < 0) {
-                perror(argv[1]);
-                goto error_out;
-            }
-        } else {
-            int ret;
-            /* 64-bit special case */
-            if (atom_size == 1) {
-                if (fread(atom_bytes, ATOM_PREAMBLE_SIZE, 1, infile) != 1) {
-                    break;
-                }
-                atom_size = BE_64(&atom_bytes[0]);
-                ret = fseeko(infile, atom_size - ATOM_PREAMBLE_SIZE * 2, SEEK_CUR);
-            } else {
-                ret = fseeko(infile, atom_size - ATOM_PREAMBLE_SIZE, SEEK_CUR);
-            }
-            if (ret) {
-                perror(argv[1]);
-                goto error_out;
-            }
-        }
-        printf("%c%c%c%c %10"PRIu64" %"PRIu64"\n",
-               (atom_type >> 24) & 255,
-               (atom_type >> 16) & 255,
-               (atom_type >>  8) & 255,
-               (atom_type >>  0) & 255,
-               atom_offset,
-               atom_size);
-        if ((atom_type != FREE_ATOM) &&
-            (atom_type != JUNK_ATOM) &&
-            (atom_type != MDAT_ATOM) &&
-            (atom_type != MOOV_ATOM) &&
-            (atom_type != PNOT_ATOM) &&
-            (atom_type != SKIP_ATOM) &&
-            (atom_type != WIDE_ATOM) &&
-            (atom_type != PICT_ATOM) &&
-            (atom_type != UUID_ATOM) &&
-            (atom_type != FTYP_ATOM)) {
-            printf("encountered non-QT top-level atom (is this a QuickTime file?)\n");
-            break;
-        }
-        atom_offset += atom_size;
-
-        /* The atom header is 8 (or 16 bytes), if the atom size (which
-         * includes these 8 or 16 bytes) is less than that, we won't be
-         * able to continue scanning sensibly after this atom, so break. */
-        if (atom_size < 8)
-            break;
-    }
-
-    if (atom_type != MOOV_ATOM) {
-        printf("last atom in file was not a moov atom\n");
-        free(ftyp_atom);
-        fclose(infile);
-        return 0;
-    }
-
-    /* moov atom was, in fact, the last atom in the chunk; load the whole
-     * moov atom */
-    if (fseeko(infile, -atom_size, SEEK_END)) {
-        perror(argv[1]);
-        goto error_out;
-    }
-    last_offset    = ftello(infile);
-    if (last_offset < 0) {
-        perror(argv[1]);
-        goto error_out;
-    }
-    moov_atom_size = atom_size;
-    moov_atom      = malloc(moov_atom_size);
-    if (!moov_atom) {
-        printf("could not allocate %"PRIu64" bytes for moov atom\n", atom_size);
-        goto error_out;
-    }
-    if (fread(moov_atom, atom_size, 1, infile) != 1) {
-        perror(argv[1]);
-        goto error_out;
-    }
-
-    /* this utility does not support compressed atoms yet, so disqualify
-     * files with compressed QT atoms */
-    if (BE_32(&moov_atom[12]) == CMOV_ATOM) {
-        printf("this utility does not support compressed moov atoms yet\n");
-        goto error_out;
-    }
-
-    /* close; will be re-opened later */
-    fclose(infile);
-    infile = NULL;
-
-    /* crawl through the moov chunk in search of stco or co64 atoms */
-    for (i = 4; i < moov_atom_size - 4; i++) {
-        atom_type = BE_32(&moov_atom[i]);
-        if (atom_type == STCO_ATOM) {
-            printf(" patching stco atom...\n");
-            atom_size = BE_32(&moov_atom[i - 4]);
-            if (i + atom_size - 4 > moov_atom_size) {
-                printf(" bad atom size\n");
-                goto error_out;
-            }
-            offset_count = BE_32(&moov_atom[i + 8]);
-            if (i + 12 + offset_count * UINT64_C(4) > moov_atom_size) {
-                printf(" bad atom size/element count\n");
-                goto error_out;
-            }
-            for (j = 0; j < offset_count; j++) {
-                current_offset  = BE_32(&moov_atom[i + 12 + j * 4]);
-                current_offset += moov_atom_size;
-                moov_atom[i + 12 + j * 4 + 0] = (current_offset >> 24) & 0xFF;
-                moov_atom[i + 12 + j * 4 + 1] = (current_offset >> 16) & 0xFF;
-                moov_atom[i + 12 + j * 4 + 2] = (current_offset >>  8) & 0xFF;
-                moov_atom[i + 12 + j * 4 + 3] = (current_offset >>  0) & 0xFF;
-            }
-            i += atom_size - 4;
-        } else if (atom_type == CO64_ATOM) {
-            printf(" patching co64 atom...\n");
-            atom_size = BE_32(&moov_atom[i - 4]);
-            if (i + atom_size - 4 > moov_atom_size) {
-                printf(" bad atom size\n");
-                goto error_out;
-            }
-            offset_count = BE_32(&moov_atom[i + 8]);
-            if (i + 12 + offset_count * UINT64_C(8) > moov_atom_size) {
-                printf(" bad atom size/element count\n");
-                goto error_out;
-            }
-            for (j = 0; j < offset_count; j++) {
-                current_offset  = BE_64(&moov_atom[i + 12 + j * 8]);
-                current_offset += moov_atom_size;
-                moov_atom[i + 12 + j * 8 + 0] = (current_offset >> 56) & 0xFF;
-                moov_atom[i + 12 + j * 8 + 1] = (current_offset >> 48) & 0xFF;
-                moov_atom[i + 12 + j * 8 + 2] = (current_offset >> 40) & 0xFF;
-                moov_atom[i + 12 + j * 8 + 3] = (current_offset >> 32) & 0xFF;
-                moov_atom[i + 12 + j * 8 + 4] = (current_offset >> 24) & 0xFF;
-                moov_atom[i + 12 + j * 8 + 5] = (current_offset >> 16) & 0xFF;
-                moov_atom[i + 12 + j * 8 + 6] = (current_offset >>  8) & 0xFF;
-                moov_atom[i + 12 + j * 8 + 7] = (current_offset >>  0) & 0xFF;
-            }
-            i += atom_size - 4;
-        }
-    }
-
-    /* re-open the input file and open the output file */
-    infile = fopen(argv[1], "rb");
-    if (!infile) {
-        perror(argv[1]);
-        goto error_out;
-    }
-
-    if (start_offset > 0) { /* seek after ftyp atom */
-        if (fseeko(infile, start_offset, SEEK_SET)) {
-            perror(argv[1]);
-            goto error_out;
-        }
-
-        last_offset -= start_offset;
-    }
-
-    outfile = fopen(argv[2], "wb");
-    if (!outfile) {
-        perror(argv[2]);
-        goto error_out;
-    }
-
-    /* dump the same ftyp atom */
-    if (ftyp_atom_size > 0) {
-        printf(" writing ftyp atom...\n");
-        if (fwrite(ftyp_atom, ftyp_atom_size, 1, outfile) != 1) {
-            perror(argv[2]);
-            goto error_out;
-        }
-    }
-
-    /* dump the new moov atom */
-    printf(" writing moov atom...\n");
-    if (fwrite(moov_atom, moov_atom_size, 1, outfile) != 1) {
-        perror(argv[2]);
-        goto error_out;
-    }
-
-    /* copy the remainder of the infile, from offset 0 -> last_offset - 1 */
-    printf(" copying rest of file...\n");
-    while (last_offset) {
-        bytes_to_copy = MIN(COPY_BUFFER_SIZE, last_offset);
-
-        if (fread(copy_buffer, bytes_to_copy, 1, infile) != 1) {
-            perror(argv[1]);
-            goto error_out;
-        }
-        if (fwrite(copy_buffer, bytes_to_copy, 1, outfile) != 1) {
-            perror(argv[2]);
-            goto error_out;
-        }
-        last_offset -= bytes_to_copy;
-    }
-
-    fclose(infile);
-    fclose(outfile);
-    free(moov_atom);
-    free(ftyp_atom);
-
-    return 0;
-
-error_out:
-    if (infile)
-        fclose(infile);
-    if (outfile)
-        fclose(outfile);
-    free(moov_atom);
-    free(ftyp_atom);
-    return 1;
-}
diff --git a/deps/libav/tools/trasher.c b/deps/libav/tools/trasher.c
deleted file mode 100644
index 35625e9..0000000
--- a/deps/libav/tools/trasher.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2007 Michael Niedermayer
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include <errno.h>
-#include <string.h>
-
-static uint32_t state;
-static uint32_t ran(void)
-{
-    return state = state * 1664525 + 1013904223;
-}
-
-int main(int argc, char **argv)
-{
-    FILE *f;
-    int count, maxburst, length;
-
-    if (argc < 5) {
-        printf("USAGE: trasher <filename> <count> <maxburst> <seed>\n");
-        return 1;
-    }
-
-    f = fopen(argv[1], "rb+");
-    if (!f) {
-        perror(argv[1]);
-        return 2;
-    }
-    count    = atoi(argv[2]);
-    maxburst = atoi(argv[3]);
-    state    = atoi(argv[4]);
-
-    fseek(f, 0, SEEK_END);
-    length = ftell(f);
-    fseek(f, 0, SEEK_SET);
-
-    while (count--) {
-        int burst = 1 + ran() * (uint64_t) (abs(maxburst) - 1) / UINT32_MAX;
-        int pos   = ran() * (uint64_t) length / UINT32_MAX;
-        fseek(f, pos, SEEK_SET);
-
-        if (maxburst < 0)
-            burst = -maxburst;
-
-        if (pos + burst > length)
-            continue;
-
-        while (burst--) {
-            int val = ran() * 256ULL / UINT32_MAX;
-
-            if (maxburst < 0)
-                val = 0;
-
-            fwrite(&val, 1, 1, f);
-        }
-    }
-
-    return 0;
-}
diff --git a/deps/libav/version.sh b/deps/libav/version.sh
deleted file mode 100755
index 6f72b2c..0000000
--- a/deps/libav/version.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-# check for git short hash
-revision=$(cd "$1" && git describe --always 2> /dev/null)
-
-# no revision number found
-test "$revision" || revision=$(cd "$1" && cat RELEASE 2> /dev/null)
-
-# releases extract the version number from the VERSION file
-version=$(cd "$1" && cat VERSION 2> /dev/null)
-test "$version" || version=$revision
-
-test -n "$3" && version=$version-$3
-
-if [ -z "$2" ]; then
-    echo "$version"
-    exit
-fi
-
-NEW_REVISION="#define LIBAV_VERSION \"$version\""
-OLD_REVISION=$(cat version.h 2> /dev/null)
-
-# Update version.h only on revision changes to avoid spurious rebuilds
-if test "$NEW_REVISION" != "$OLD_REVISION"; then
-    echo "$NEW_REVISION" > "$2"
-fi
diff --git a/grooveplayer/osx_time_shim.c b/grooveplayer/osx_time_shim.c
new file mode 100644
index 0000000..c452e9c
--- /dev/null
+++ b/grooveplayer/osx_time_shim.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2014 K. Ernest "iFire" Lee
+ * Copyright (c) 2014 Andrew Kelley
+ *
+ * This file is part of libgroove, which is MIT licensed.
+ * See http://opensource.org/licenses/MIT
+ */
+
+#include "osx_time_shim.h"
+#include <mach/mach_time.h>
+
+int clock_gettime(clockid_t clk_id, struct timespec *tp) {
+    clock_serv_t cclock;
+    mach_timespec_t mts;
+
+    host_get_clock_service(mach_host_self(), clk_id, &cclock);
+    kern_return_t retval = clock_get_time(cclock, &mts);
+    mach_port_deallocate(mach_task_self(), cclock);
+
+    tp->tv_sec = mts.tv_sec;
+    tp->tv_nsec = mts.tv_nsec;
+
+    return retval;
+}
+
+int pthread_condattr_setclock(pthread_condattr_t *attr, int foo) {
+  return 0;
+}
diff --git a/grooveplayer/osx_time_shim.h b/grooveplayer/osx_time_shim.h
new file mode 100644
index 0000000..c62e36b
--- /dev/null
+++ b/grooveplayer/osx_time_shim.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2014 K. Ernest "iFire" Lee
+ * Copyright (c) 2014 Andrew Kelley
+ *
+ * This file is part of libgroove, which is MIT licensed.
+ * See http://opensource.org/licenses/MIT
+ */
+
+#ifndef GROOVE_MACH_TIME_H_INCLUDED
+#define GROOVE_MACH_TIME_H_INCLUDED
+#ifdef __MACH__
+
+#include <sys/types.h>
+#include <sys/_types/_timespec.h>
+#include <mach/mach.h>
+#include <mach/clock.h>
+#include <pthread.h>
+
+#define CLOCK_MONOTONIC SYSTEM_CLOCK
+
+typedef int clockid_t;
+
+/* the mach kernel uses struct mach_timespec, so struct timespec
+    is loaded from <sys/_types/_timespec.h> for compatability */
+
+int clock_gettime(clockid_t clk_id, struct timespec *tp);
+int pthread_condattr_setclock(pthread_condattr_t *attr, int foo);
+
+#endif
+#endif
diff --git a/grooveplayer/player.c b/grooveplayer/player.c
index 46f2f49..08f3154 100644
--- a/grooveplayer/player.c
+++ b/grooveplayer/player.c
@@ -14,6 +14,7 @@
 #include <SDL2/SDL_audio.h>
 #include <pthread.h>
 #include <time.h>
+#include "osx_time_shim.h"
 
 struct GroovePlayerPrivate {
     struct GroovePlayer externals;

-- 
libgroove packaging



More information about the pkg-multimedia-commits mailing list